diff --git a/CMakeLists.txt b/CMakeLists.txt index ccc87cb9d..99bc79df2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1348,13 +1348,13 @@ endif() if (LINUX AND ENABLE_EXTERNAL_LIBRARIES) install(DIRECTORY ${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/ DESTINATION ${INSTALL_LIB_DIR}) endif() -if(WIN32) +if(WIN32 AND BUILD_GUI) include(DeployQt) windeployqt(${CMAKE_PROJECT_NAME} ${SDRANGEL_BINARY_BIN_DIR} ${PROJECT_SOURCE_DIR}/sdrgui/resources) endif() # Install debug symbols -if (WIN32) +if (WIN32 AND BUILD_GUI) install(FILES $/${CMAKE_PROJECT_NAME}stripped.pdb CONFIGURATIONS Release DESTINATION ${INSTALL_LIB_DIR} RENAME ${CMAKE_PROJECT_NAME}.pdb) install(FILES $ CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_BIN_DIR} ) endif() diff --git a/CMakePresets.json b/CMakePresets.json index d46985f98..dadfcd3cd 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -53,20 +53,21 @@ "RX_SAMPLE_24BIT": "ON", "ARCH_OPT": "SSE4_2", "HIDE_CONSOLE": "OFF", - "ENABLE_AIRSPY": "ON", + "ENABLE_AIRSPY": "OFF", "ENABLE_AIRSPYHF": "ON", - "ENABLE_BLADERF": "ON", + "ENABLE_BLADERF": "OFF", "ENABLE_HACKRF": "ON", "ENABLE_IIO": "ON", "ENABLE_MIRISDR": "OFF", - "ENABLE_PERSEUS": "ON", + "ENABLE_PERSEUS": "OFF", "ENABLE_RTLSDR": "ON", "ENABLE_SDRPLAY": "ON", - "ENABLE_SOAPYSDR": "ON", - "ENABLE_XTRX": "ON", + "ENABLE_SOAPYSDR": "OFF", + "ENABLE_XTRX": "OFF", "ENABLE_USRP": "ON", "BUILD_SERVER": "OFF", "BUILD_MCP_BUNDLE": "ON", + "ENABLE_PROFILER": "ON", "CMAKE_PREFIX_PATH": "C:/Qt/5.15.2/msvc2019_64;C:/Applications/boost_1_81_0" }, "warnings": { @@ -103,7 +104,8 @@ }, { "name": "default-windows", - "configurePreset": "default-windows" + "configurePreset": "default-windows", + "jobs": 12 }, { "name": "default-qt6", @@ -111,7 +113,8 @@ }, { "name": "default-qt6-windows", - "configurePreset": "default-qt6-windows" + "configurePreset": "default-qt6-windows", + "jobs": 12 } ] } diff --git a/app/main.cpp b/app/main.cpp index 7956fa669..86d294484 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -330,6 +330,19 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo int main(int argc, char* argv[]) { + // Chromium (in QtWebEngine) is limited to 60 FPS - disable that, so we can run at monitor's refresh rate + if (qgetenv("SDRANGEL_FRAME_RATE_LIMIT") != "1") + { + const QByteArray flags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"); + + if (!flags.contains("disable-frame-rate-limit")) + { + qputenv("QTWEBENGINE_CHROMIUM_FLAGS", + flags.isEmpty() ? QByteArray("--disable-frame-rate-limit") + : flags + " --disable-frame-rate-limit"); + } + } + #ifdef __APPLE__ // Request OpenGL 3.3 context, needed for glspectrum and 3D Map feature // Note that Mac only supports CoreProfile, so any deprecated OpenGL 2 features diff --git a/doc/img/AcarsDemod_chart.png b/doc/img/AcarsDemod_chart.png new file mode 100644 index 000000000..bb6ef90d4 Binary files /dev/null and b/doc/img/AcarsDemod_chart.png differ diff --git a/doc/img/AcarsDemod_decode.png b/doc/img/AcarsDemod_decode.png new file mode 100644 index 000000000..946626171 Binary files /dev/null and b/doc/img/AcarsDemod_decode.png differ diff --git a/doc/img/AcarsDemod_plugin.png b/doc/img/AcarsDemod_plugin.png new file mode 100644 index 000000000..05061a4f1 Binary files /dev/null and b/doc/img/AcarsDemod_plugin.png differ diff --git a/doc/img/AcarsDemod_table.png b/doc/img/AcarsDemod_table.png new file mode 100644 index 000000000..614a9a905 Binary files /dev/null and b/doc/img/AcarsDemod_table.png differ diff --git a/doc/img/AircraftFeature_aircraft_tab.png b/doc/img/AircraftFeature_aircraft_tab.png new file mode 100644 index 000000000..90995f98f Binary files /dev/null and b/doc/img/AircraftFeature_aircraft_tab.png differ diff --git a/doc/img/AircraftFeature_aircraft_table.png b/doc/img/AircraftFeature_aircraft_table.png new file mode 100644 index 000000000..5e116947b Binary files /dev/null and b/doc/img/AircraftFeature_aircraft_table.png differ diff --git a/doc/img/AircraftFeature_clearance.png b/doc/img/AircraftFeature_clearance.png new file mode 100644 index 000000000..b6afd4378 Binary files /dev/null and b/doc/img/AircraftFeature_clearance.png differ diff --git a/doc/img/AircraftFeature_flight_plan.png b/doc/img/AircraftFeature_flight_plan.png new file mode 100644 index 000000000..2a636f687 Binary files /dev/null and b/doc/img/AircraftFeature_flight_plan.png differ diff --git a/doc/img/AircraftFeature_flight_profile.png b/doc/img/AircraftFeature_flight_profile.png new file mode 100644 index 000000000..5aaa71c69 Binary files /dev/null and b/doc/img/AircraftFeature_flight_profile.png differ diff --git a/doc/img/AircraftFeature_flights_table.png b/doc/img/AircraftFeature_flights_table.png new file mode 100644 index 000000000..0f19dadc1 Binary files /dev/null and b/doc/img/AircraftFeature_flights_table.png differ diff --git a/doc/img/AircraftFeature_loadsheet.png b/doc/img/AircraftFeature_loadsheet.png new file mode 100644 index 000000000..dcf7dcce4 Binary files /dev/null and b/doc/img/AircraftFeature_loadsheet.png differ diff --git a/doc/img/AircraftFeature_statistics.png b/doc/img/AircraftFeature_statistics.png new file mode 100644 index 000000000..e2f80e35b Binary files /dev/null and b/doc/img/AircraftFeature_statistics.png differ diff --git a/plugins/channelrx/CMakeLists.txt b/plugins/channelrx/CMakeLists.txt index f76f9ba15..159fae468 100644 --- a/plugins/channelrx/CMakeLists.txt +++ b/plugins/channelrx/CMakeLists.txt @@ -22,7 +22,17 @@ if (ENABLE_CHANNELRX_FREQSCANNER) add_subdirectory(freqscanner) endif() -if (ENABLE_CHANNELRX_DEMODADSB AND Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND) +if (SERVER_MODE) + set(DEMODADSB_GUI_DEPS_FOUND TRUE) +else() + if (Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND) + set(DEMODADSB_GUI_DEPS_FOUND TRUE) + else() + set(DEMODADSB_GUI_DEPS_FOUND FALSE) + endif() +endif() + +if (ENABLE_CHANNELRX_DEMODADSB AND DEMODADSB_GUI_DEPS_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND) add_subdirectory(demodadsb) # add_subdirectory(demodvormc) else() diff --git a/plugins/channelrx/demodacars/CMakeLists.txt b/plugins/channelrx/demodacars/CMakeLists.txt index 79718bd8e..c03c1db8f 100644 --- a/plugins/channelrx/demodacars/CMakeLists.txt +++ b/plugins/channelrx/demodacars/CMakeLists.txt @@ -9,8 +9,6 @@ set(demodacars_SOURCES acarsdemodwebapiadapter.cpp acarsdemodworker.cpp acarsdemoddata.qrc - acarsmessage.cpp - acarsmultipartassembler.cpp ) set(demodacars_HEADERS @@ -21,14 +19,15 @@ set(demodacars_HEADERS acarsdemodplugin.h acarsdemodwebapiadapter.h acarsdemodworker.h - acarsmessage.h - acarsmultipartassembler.h - acarstextformat.h acarsoqpsk.h acarsvdl2.h acarshfdl.h acarsaero.h - do219.h + acarsiridium.h + acarsiridiumframe.h + acarsiridiumfft.h + acarsiridiumchannelizer.h + acarsiridiumscanner.h vdl2atn.h ) diff --git a/plugins/channelrx/demodacars/acarsaero.h b/plugins/channelrx/demodacars/acarsaero.h index 2b69cdbb3..c643e3167 100644 --- a/plugins/channelrx/demodacars/acarsaero.h +++ b/plugins/channelrx/demodacars/acarsaero.h @@ -1,3023 +1,3426 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_ACARSAERO_H -#define INCLUDE_ACARSAERO_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "util/crc.h" - -#include "acarshfdl.h" - -// Inmarsat Classic Aero (aviation SATCOM) receiver, ICAO Annex 10 Volume III and -// ARINC 741. -// -// Aero is the L band satellite protocol for ACARS, the complement to HFDL for oceanic -// aircraft. Three data rates are in scope: -// -// 600 bps MSK, 600 symbols/s -// 1200 bps MSK, 1200 symbols/s -// 10500 bps OQPSK, 5250 symbols/s, 2 bits per symbol -// -// and three channel types: -// -// P continuous TDM from the ground station (uplink, GES to aircraft) -// R random access bursts from the aircraft (downlink) -// T reserved TDMA bursts from the aircraft (downlink) -// -// Unlike HFDL, where the M1 sequence identifies the rate, an Aero channel's rate and -// type are properties of the frequency tuned, so both are settings rather than -// something detected. -// -// P CHANNEL FRAME -// -// UW (32 bits) 0xE15AE893, the same word at every MSK rate -// header (16 bits) uncoded, MSB first: -// 15-12 format ID (1 on a valid frame) -// 11-8 super frame marker -// 7-4 frame counter -// 3-0 frame counter, repeated -// data (1152 bits) coded, or 4992 bits at 10500 bps -// -// which is 1200 channel bits at 600 and 1200 bps - a 2.0 s frame at 600 bps and a -// 1.0 s frame at 1200 - and 5250 bits, a 0.5 s frame, at 10500 bps. Both copies of -// the frame counter are equal in a valid frame, which together with the format ID -// gives two cheap checks that a correlation was not a false alarm. -// -// RECEIVE CHAIN, in order: -// -// 1. matched filter (half sine over two symbol periods for MSK; RRC alpha 1.0 for -// OQPSK, designed at the symbol rate) -// 2. deinterleave a block of 64 rows x N columns, rows permuted by (i*27) mod 64, -// reading out[j*64 + i] = in[permute[i]*cols + j]. N is 6, 9 and 78 columns for -// 600, 1200 and 10500 bps, so a 600 bps frame is three blocks, 1200 bps is two -// and 10500 bps is one -// 3. soft decision Viterbi, K=7 rate 1/2, polynomials 0x6D/0x4F - byte for byte the -// polynomials HFDL uses, so AcarsHfdlReceiver::viterbiDecode is reused unchanged -// 4. descramble with an additive x^15 + x + 1 LFSR seeded 0x6959, restarted at every -// frame boundary (and at the start of every burst on R and T) -// 5. pack bits into octets LSB first -// 6. split into signal units and check each CRC -// -// SIGNAL UNITS are 12 octets on P and T (10 of payload then a CRC) and 19 octets on R -// (17 then a CRC). The CRC is CRC-16/X-25 - poly 0x1021, init 0xFFFF, reflected, final -// XOR 0xFFFF - stored little endian in the last two octets. (JAERO's own comment calls -// this GENIBUS; the function it actually calls is the reflected variant, and GENIBUS, -// which it also implements, is never used.) -// -// Octet 0 of a signal unit is its type. Type 0x71 is a user data ISU carrying the AES -// and GES addresses, a queue/reference number pair, the number of SSUs to follow and -// the first two octets of user data; SSUs are typed 0xC0 | SEQNO with SEQNO counting -// down to zero and carry eight more octets each (fewer in the last, per a count in the -// ISU). Reassembled, the user data is FF FF followed by a complete ARINC 618 ACARS -// block - SOH, mode, registration, TAK, label, block id, STX/ETX, text, ETX or ETB, -// a two octet BCS and DEL, with odd parity in bit 7 of every octet except the two -// leading FFs and the BCS. Dropping the two FFs therefore gives exactly the byte -// layout AcarsMessage::decode expects, so nothing has to be synthesised. -// -// MSK DETAIL. Consecutive MSK symbols differ by exactly +-90 degrees, so multiplying -// a symbol by the conjugate of its predecessor and then by -j lands the result on the -// real axis, positive for a one. That is the derotate-to-BPSK view of MSK -// (acarsoqpsk.h:47-50 uses the same identity for VHF ACARS) with the per symbol 90 -// degree rotation cancelled in the product, and it means that lane needs no carrier -// recovery at all. -// -// TWO LANES run over every frame and the signal unit CRC arbitrates between them, per -// unit. The differential lane above is the one that always works. The coherent lane -// tracks the carrier with a decision-directed loop seeded from the unique word - a known -// sequence, so a free 33 symbol training burst - and recovers the several dB that -// squaring the noise costs. Neither can lose a unit the other would have got. -// -// Unlike VHF ACARS, whose differential encoding cancels MSK's precoding so its arms -// carry data bits directly, Aero does not pre-encode, so a differential decode still -// follows coherent detection. The two coherent projections are combined with min-sum, -// the standard approximation to the exclusive-or of two log-likelihoods, rather than -// with a raw product that would let one confident symbol inflate an unreliable one. -// -// FRAME TRACKING. A P channel is continuous TDM, so once a frame has been decoded the -// next unique word is due at a known instant. The receiver confirms it inside a half -// symbol window there rather than searching, which both removes almost every false -// correlation and re-locks the symbol timing every frame. -// -// The polarity matters and is easy to get backwards: a one is when the phase does NOT -// reverse. The acquisition correlator cannot catch the mistake, because it correlates -// transitions and takes a magnitude, so an inverted convention correlates just as -// strongly against the unique word and then decodes to nothing at all. -// -// WHAT IS AND IS NOT IMPLEMENTED -// -// 600 and 1200 bps, P channel implemented and verified against a real recording -// 600 and 1200 bps, T bursts implemented and verified against a real recording -// 600 and 1200 bps, R bursts implemented, works end to end, but no recording -// containing R bursts exists to verify it against -// 10500 bps OQPSK not implemented, rateSupported() returns false -// - -#define ACARSAERO_MSK_CHANNEL_SAMPLE_RATE 19200 -#define ACARSAERO_OQPSK_CHANNEL_SAMPLE_RATE 105000 - -#define ACARSAERO_UW 0xE15AE893u -#define ACARSAERO_UW_LEN 32 -#define ACARSAERO_HEADER_LEN 16 -// How far the per-frame timing refinement may move the OQPSK symbol clock phase, in -// samples, before it is treated as the half-symbol alias rather than as ordinary drift -#define ACARSAERO_TIMING_PULL 3 -// Consecutive frames that must decode NOTHING before a symbol clock phase which has already -// been confirmed by a good frame is abandoned for the other half-symbol candidate -#define ACARSAERO_PHASE_FAILURES 3 - -#define ACARSAERO_INTERLEAVER_ROWS 64 -#define ACARSAERO_INTERLEAVER_ROW_STEP 27 -#define ACARSAERO_SCRAMBLER_SEED 0x6959 - -#define ACARSAERO_SU_LEN 12 // P and T channel signal unit, including its CRC -#define ACARSAERO_R_SU_LEN 19 // R channel signal unit, including its CRC -#define ACARSAERO_SU_CRC_LEN 2 - -// R bursts are five interleaver columns; a T burst is five for its header then three -// per signal unit. 95 columns is the largest JAERO ever allocates. -#define ACARSAERO_BURST_HEAD_COLS 5 -#define ACARSAERO_BURST_SU_COLS 3 -#define ACARSAERO_BURST_MAX_COLS 95 -#define ACARSAERO_T_HEADER_LEN 6 // 4 octets plus a CRC, checked on its own - -// Signal units in the largest frame (10500 bps carries 26), for the per-position stats -#define ACARSAERO_MAX_SUS 26 - -class AcarsAeroReceiver -{ -public: - typedef std::complex Cd; - - enum Rate - { - Rate600 = 0, - Rate1200, - Rate10500, - RateCount - }; - - enum ChannelType - { - ChannelP = 0, //!< Continuous TDM from the ground station - ChannelR, //!< Random access bursts from the aircraft - ChannelT //!< Reserved TDMA bursts from the aircraft - }; - - // The rate and channel combinations that exist on air, as one setting. Only the P - // channel runs at 10500 bps; R and T are the aircraft's low rate return links. - // Appending to this list is safe, reordering it is not - the value is serialised. - enum Submode - { - Submode600P = 0, - Submode1200P, - Submode10500P, - Submode600R, - Submode1200R, - Submode600T, - Submode1200T, - SubmodeCount - }; - - static int submodeRate(int submode) - { - switch (submode) - { - case Submode1200P: - case Submode1200R: - case Submode1200T: return Rate1200; - case Submode10500P: return Rate10500; - default: return Rate600; - } - } - - static int submodeChannel(int submode) - { - switch (submode) - { - case Submode600R: - case Submode1200R: return ChannelR; - case Submode600T: - case Submode1200T: return ChannelT; - default: return ChannelP; - } - } - - static const char *submodeName(int submode) - { - switch (submode) - { - case Submode600P: return "600 bps P"; - case Submode1200P: return "1200 bps P"; - case Submode10500P: return "10500 bps P"; - case Submode600R: return "600 bps R"; - case Submode1200R: return "1200 bps R"; - case Submode600T: return "600 bps T"; - case Submode1200T: return "1200 bps T"; - default: return "?"; - } - } - - // A sensible channel filter width for a submode, in Hz - what the RF bandwidth - // control should default to, not the occupied bandwidth. - // - // MSK occupies about 1.2 times the bit rate with its main lobe out to 0.75 times - // it, and OQPSK with roll-off 1.0 occupies twice the symbol rate. The sink sets the - // interpolator cutoff to bandwidth/2.2, so a default equal to the occupied - // bandwidth would put the cutoff inside the main lobe; twice the bit rate (and 2.5 - // times the symbol rate for OQPSK) leaves the passband clear with a little margin - // for tuning error. Being slightly wide costs almost nothing here - the matched - // filter does the selectivity that matters. - static int submodeBandwidth(int submode) - { - int rate = submodeRate(submode); - return isOqpsk(rate) ? (5 * symbolRate(rate) / 2) : (2 * bitRate(rate)); - } - - struct Config - { - // Normalised differential correlation against the 32 bit unique word needed to - // declare sync, 0 to 1. 32 products, so noise reads around 0.15; a genuine - // unique word on a clean satellite downlink reads over 0.9. - // - // Measured, and the optimum is much lower than it looks like it should be. - // Sweeping 0.40 to 0.60 over 5, 6 and 7 dB gives 487, 545, 550, 518, 385, 183 - // of 600 at 0.40/0.44/0.46/0.50/0.55/0.60 - a factor of three between 0.46 and - // 0.60. Below 0.44 it turns over again, because a false correlation costs a - // whole frame of deaf time and that starts to outweigh the extra genuine ones. - // But that sweep was on generated AWGN, and lowering it REGRESSED the real - // recording - 5 messages against 6, and 163 of 222 signal units against 185 - - // because off air there is an adjacent channel 5 kHz away and false - // correlations are commoner than clean noise makes them look. The recording is - // the ground truth, so this stays where it was and the gain is taken instead by - // tracking the frame, below, which removes the false syncs rather than trading - // against them. - double m_syncThreshold = 0.55; - - // Correlation required to confirm the unique word at the START OF THE NEXT - // FRAME, once a frame has been decoded. A P channel is continuous TDM, so the - // next unique word is exactly one frame away - there is no need to search for - // it, only to confirm it where it must be. - // - // That is the whole point: a false correlation can only be accepted if it lands - // inside a half symbol window at a known instant, which is a vanishingly small - // target compared with free running search. So this can sit far below - // m_syncThreshold and hold lock through a fade that free search would lose, - // without ever letting a data pattern masquerade as a frame boundary. - double m_trackThreshold = 0.30; - // Frames whose unique word fails m_trackThreshold before the receiver gives up - // tracking and searches the whole stream again - int m_maxMissedFrames = 2; - // Run a SECOND, coherent lane alongside the differential one and let each - // signal unit's CRC decide which lane's octets to keep. - // - // Differential detection needs no carrier recovery at all, which is why it was - // built first and why it stays: it is what holds the receiver up when the - // carrier loop has not converged or has slipped. But multiplying two noisy - // symbols together squares the noise, and that costs several dB at the error - // rates that matter. The coherent lane tracks the carrier with a - // decision-directed loop seeded from the unique word - which is a known - // sequence, so the reference starts from a 33 symbol data-aided estimate rather - // than from nothing - and recovers most of it. - // - // A 180 degree hangup in that loop is harmless here, because the differential - // decode that follows cancels any constant sign. Only a slip mid-frame hurts, - // and that is what the arbitration covers. - // Carry the symbol timing slip measured at one unique word across the frame that - // follows it. See measureTimingSlip(). - bool m_timingSlope = true; - // How much of each slip measurement to believe. The measurement is the position - // of a correlation peak in noise, so at low SNR most of what it reports is noise - // and feeding that forward walks the sampling instant off a signal that had no - // slip to correct. Swept against both: on a live capture that was losing samples - // 0.05/0.10/0.25/0.50 gave 1402/1425/1452/1432 signal units against 1250 with it - // off, while on generated signal at 3 dB - where there is nothing to correct - - // they cost 0/1/5/12 messages of 240. 0.10 takes almost all of the gain for - // nothing measurable. - double m_timingSlopeGain = 0.10; - bool m_coherent = true; - // Smooth the coherent lane's carrier reference over the frame before detecting - // again. See refitCoherent. - bool m_smooth = true; - // Half width of the centred window, symbols. Measured: 2/4/8/16/24/32 either - // side give 279/288/291/301/292/292 of 480 against 289 unsmoothed, so the - // optimum is broad and shallow around 16. Over 1200 trials it is 739 against - // 705 - real, about 5% relative, but a tenth of a dB rather than the whole - // remaining gap. Longer windows lose because the loop's reference is genuinely - // following something, not just wandering. - int m_smoothHalf = 16; - // Both measured, and the surface around them is flat - anything in - // refGain 0.25 to 0.35 with freqGain 0.005 to 0.01 lands within 2% of the best, - // so neither is delicately tuned. The starting guesses of 0.10 and 0.02 cost - // about 15%, which is worth knowing: the reference wants to follow the carrier - // faster than instinct suggests, and the frequency loop slower. - double m_freqGain = 0.01; // Decision-directed frequency tracking, rad/symbol - double m_refGain = 0.30; // Reference phasor blend per symbol - - // The OQPSK rate wants very different loop gains from the MSK rates, measured - // rather than assumed: about 0.001 and 0.05 against 0.01 and 0.30. Its symbol - // rate is nine times higher and its frames are five times longer in symbols, so - // the carrier moves far less per symbol and there is far more to average over - - // and without a frequency integrator at all it drifts badly, taking the signal - // unit CRC rate from 96% over four frames to 19% over a hundred. - // The OQPSK correlator is a different statistic from the MSK one - 31 products - // over 32 symbols rather than 32 over 33, on a wider pulse - so it keeps its own - // threshold even though it currently matches the MSK value. - // - // It was 0.45 for a long time, from an early measurement that 0.55 would not sync - // the recording at all. That stopped being true once the symbol timing was fixed, - // and 0.45 then measured WORSE than 0.55 in both directions - 27 messages against - // 30 on the recording, and 52% against 63% at 6 dB Eb/N0 - because a threshold - // low enough to admit a marginal correlation starts a frame on a bad instant, and - // with the phase lock a bad acquisition now costs more than a missed one. 0.55 is - // the knee: everything from 0.55 to 0.70 measures identically, everything below - // degrades, so this is the lowest value that gives full performance. - // - // The stale 0.45 was invisible because the harness was overriding it with the MSK - // flag's 0.55 - so the plugin shipped worse than anything ever measured it. See - // test/README.md. - double m_oqpskSyncThreshold = 0.55; - // Retuned against the message error curve rather than against a strong recording, - // which cannot discriminate: at 6 dB Eb/N0 per channel bit these take the rate - // from 19% of messages to 66%, while leaving the recording at its best (99.2% of - // signal units either way). The earlier 0.001 / 0.05 were picked on the recording - // alone and are a little too slow to hold the carrier once noise is in the loop. - double m_oqpskFreqGain = 0.002; - double m_oqpskRefGain = 0.10; - - // A second pass that re-estimates the carrier over the whole frame was built and - // removed. It is recorded in test/README.md rather than here, because the - // negative result is worth more than the code was: forced to the correct carrier - // frequency it beat the tracking loop outright (359 messages against 289), but - // nothing available estimates that frequency well enough to extrapolate over a - // frame, and every principled way of avoiding the need to - squaring, decision - // stripping, the loop's own integrator, block correction, non-causal smoothing - - // measured worse than simply tracking. The reason is that after derotation the - // imaginary axis of an MSK symbol carries the orthogonal arm's crosstalk, which - // is large and data dependent, so any estimator touching the full complex value - // is corrupted by it. - // How far the 16 bit frame header may be from a legal one before the frame is - // abandoned, in bits. 8 accepts anything; 0 demands an exact match. - // - // This is the single most valuable number in the receiver and it was measured, - // not guessed. The header is UNCODED and hard decided, while the data field - // behind it is rate 1/2 convolutionally coded and interleaved - so the header is - // by far the weakest thing in the frame. Demanding an exact match threw away - // 17 of 65 frames at 8 dB whose every signal unit then decoded with a perfect - // CRC, costing 3 to 4 dB. Accepting anything is worse again in a different way: - // a false correlation then burns a whole frame before the receiver looks again, - // and the real frame boundary behind it is missed. - // - // Three is where the two costs cross, measured both ways. Going 0, 1, 2, 3, 4, 8 - // at 6 and 7 dB the yield runs 72, 187, 232, 240, 238, 236 of 320 - rising - // steeply then flat. On a clean signal, where false correlations on data - // patterns are what bite, 1, 2 and 3 all give a perfect 240 of 240 while 4 and 8 - // lose six. So 3 takes the whole of the low SNR gain and stops exactly before - // the false syncs start. Confirmed on a wider run: 626 against 603 of 960 for 2. - // - // The header was never the real gate in any case. Every signal unit carries its - // own CRC-16, which discriminates far harder than 8 bits of header redundancy; - // this check exists to stop a false sync wasting a whole frame of deaf time, not - // to keep garbage out of the output. - int m_headerMaxErrors = 3; - // Accept signal units that are entirely zero with a zero CRC as fill. JAERO - // does this, and real P channels do transmit them. - bool m_acceptZeroFill = true; - // Emit a Frame for signal units that are not ACARS (log-on, channel control, - // acknowledgements ...) as well as for reassembled ACARS blocks - bool m_emitNonAcars = true; - // Seconds of receiver time after which a partially reassembled ISU/SSU chain - // is abandoned. A 22 SSU chain at 600 bps spans several frames, so this has to - // be generous, but it must be bounded or a lost final SSU leaks the chain. - double m_reassemblyTimeout = 120.0; - // Hard cap on partial reassemblies held at once, per channel - int m_maxReassemblies = 64; - }; - - struct Stats - { - uint64_t m_samples = 0; - uint64_t m_syncs = 0; //!< Unique word correlations that started a frame - double m_uwPeak = 0.0; //!< Largest unique word correlation seen - uint64_t m_framesDecoded = 0; - uint64_t m_headerBad = 0; //!< Headers not exactly legal, whether or not accepted - uint64_t m_headerRejected = 0; //!< ... and those too far off to keep the frame - uint64_t m_uwTracked = 0; //!< Frames whose unique word was confirmed where predicted - uint64_t m_uwLost = 0; //!< Tracking gave up and returned to search - uint64_t m_suCrcOk = 0; - uint64_t m_suCrcBad = 0; - uint64_t m_suFromDifferential = 0; //!< Signal units the differential lane won - uint64_t m_suFromCoherent = 0; //!< ... and the coherent lane - // Signal unit CRC results by position within the frame. The convolutional code - // is not flushed at the end of a frame, so the last unit is expected to be the - // weakest; this is what says by how much. - uint64_t m_suOkByPos[ACARSAERO_MAX_SUS] = {0}; - uint64_t m_suBadByPos[ACARSAERO_MAX_SUS] = {0}; - uint64_t m_suFill = 0; //!< Fill-in signal units (type 0x01 or all zero) - uint64_t m_isus = 0; //!< User data ISUs seen - uint64_t m_ssus = 0; - uint64_t m_ssuOrphan = 0; //!< SSU with no matching ISU - uint64_t m_reassembled = 0; //!< Complete user data blocks - uint64_t m_acarsFrames = 0; - uint64_t m_otherFrames = 0; - uint64_t m_bursts = 0; //!< R/T bursts that passed their CRCs - uint64_t m_burstsBad = 0; - uint64_t m_reassemblyTimeouts = 0; - }; - - // One decoded item: either a reassembled ACARS block or a single non-ACARS signal unit - struct Frame - { - std::vector m_bytes; //!< ACARS block from its SOH, or the raw signal unit - std::string m_type; //!< "User data ISU", "Log-on request", ... - bool m_uplink = false; //!< True on the P channel (ground to air) - uint32_t m_aesId = 0; //!< Aircraft Earth Station id, the ICAO 24 bit address - uint8_t m_gesId = 0; //!< Ground Earth Station id - bool m_isAcars = false; - int m_bitRate = 0; //!< 600, 1200 or 10500 - int m_channel = ChannelP; - }; - - AcarsAeroReceiver() - { - setMode(Rate600, ChannelP); - } - - // Every rate in scope is implemented. Kept as a hook because the R and T burst - // paths still do not decode real bursts, and because a rate could be disabled here - // rather than silently receiving nothing. - static bool rateSupported(int rate) { (void) rate; return true; } - - // Rate and channel type are settings, not detected. Reconfigures and resets. - void setMode(int rate, int channel) - { - m_rate = (rate >= 0) && (rate < RateCount) ? rate : (int) Rate600; - m_channel = (channel >= ChannelP) && (channel <= ChannelT) ? channel : (int) ChannelP; - m_sps = samplesPerSymbol(m_rate); - designFilter(); - reset(); - } - - void configure(const Config& config) - { - m_config = config; - reset(); - } - - const Config& config() const { return m_config; } - const Stats& stats() const { return m_stats; } - - //! RMS error vector magnitude as a fraction, or a negative value before the coherent - //! lane has seen anything. Only meaningful on a continuous P channel - double evm() const { return (m_evmMeanSq > 0.0) ? std::sqrt(m_evmMeanSq) : -1.0; } - //! Fraction of recent signal units whose CRC passed, negative before the first one - double suRate() const { return m_suRate; } - int rate() const { return m_rate; } - int channelType() const { return m_channel; } - - void reset() - { - m_lockedPhase = -1; - m_phaseConfirmed = false; - m_phaseFailures = 0; - m_haveCarriedDphi = false; - m_state = StateSearch; - m_ring.assign(ringLength(), Cd(0.0, 0.0)); - m_ringIdx = 0; - m_ringFill = 0; - m_sclk = 0; - m_symPeriod = m_sps; - m_timingAcc = 0.0; - m_timingRate = 0.0; - m_symbolCount = 0; - m_prevSym = Cd(0.0, 0.0); - m_dphi = 0.0; - m_lastSyncError = 0.0; - m_magMean = 0.0; - m_trackWait = 0; - m_missedFrames = 0; - m_magMeanCoh = 0.0; - m_symBuf.clear(); - m_refPhase.clear(); - m_refPhaseAcc = 0.0; - m_projPrevFirst = 0.0; - m_oqpskInit = false; - m_softBitsCoh.clear(); - m_ref = Cd(1.0, 0.0); - m_evmMeanSq = 0.0; - m_suRate = -1.0; - m_dphiSym = 0.0; - m_projPrev = 0.0; - m_cohValid = false; - m_syncPending = false; - m_bestStat = 0.0; - m_bestAgo = 0; - m_bestSum = Cd(0.0, 0.0); - m_softBits.clear(); - m_headerBits.clear(); - m_burstBits.clear(); - m_burstCols = 0; - m_frames.clear(); - m_reassembly.clear(); - m_time = 0.0; - } - - //! Nothing is held back, so this is a no-op. Kept because the harness and the sink - //! call it at the end of a stream and a future receiver may need it again. - void flush() {} - - bool hasFrame() const { return !m_frames.empty(); } - - Frame popFrame() - { - Frame f = m_frames.front(); - m_frames.pop_front(); - return f; - } - - double lastSyncError() const { return m_lastSyncError; } - bool synced() const { return m_state != StateSearch; } - - // The rate the demodulator for a given Aero rate runs at - static int channelSampleRate(int rate) - { - return (rate == Rate10500) ? ACARSAERO_OQPSK_CHANNEL_SAMPLE_RATE - : ACARSAERO_MSK_CHANNEL_SAMPLE_RATE; - } - - static int bitRate(int rate) - { - switch (rate) - { - case Rate1200: return 1200; - case Rate10500: return 10500; - default: return 600; - } - } - - // Symbol rate. MSK carries one bit per symbol so it equals the bit rate; OQPSK - // carries two, so it is half. - static int symbolRate(int rate) - { - return (rate == Rate10500) ? 5250 : bitRate(rate); - } - - static int samplesPerSymbol(int rate) - { - return channelSampleRate(rate) / symbolRate(rate); - } - - static bool isOqpsk(int rate) { return rate == Rate10500; } - - // --------------------------------------------------------------------------------- - // Frame geometry - // --------------------------------------------------------------------------------- - - // Interleaver columns per block. A frame is one or more whole blocks. - static int interleaverCols(int rate) - { - switch (rate) - { - case Rate1200: return 9; - case Rate10500: return 78; - default: return 6; - } - } - - // Coded bits in a frame's data field - static int codedBitsPerFrame(int rate) - { - return (rate == Rate10500) ? 4992 : 1152; - } - - // Dummy bits between the header and the data field. Only 10500 bps has any; JAERO - // names them but does not explain them, so they are simply skipped. - static int dummyBits(int rate) - { - return (rate == Rate10500) ? 178 : 0; - } - - static int dataBitsPerFrame(int rate) { return codedBitsPerFrame(rate) / 2; } - static int susPerFrame(int rate) { return dataBitsPerFrame(rate) / 8 / ACARSAERO_SU_LEN; } - static int blocksPerFrame(int rate) - { - return codedBitsPerFrame(rate) / (ACARSAERO_INTERLEAVER_ROWS * interleaverCols(rate)); - } - - // --------------------------------------------------------------------------------- - // Protocol primitives. Public so the harness can test each in isolation. - // --------------------------------------------------------------------------------- - - static uint32_t uniqueWord() { return ACARSAERO_UW; } - - static int uwBit(int i) { return (ACARSAERO_UW >> (ACARSAERO_UW_LEN - 1 - i)) & 1; } - - // Scrambler: additive LFSR x^15 + x + 1 seeded 0x6959, restarted at every frame - // boundary. HFDL uses the same polynomial and seed (its lfsrNext shifts the other - // way with the seed bits reversed, which is the same sequence), so this is the - // identical generator applied over a longer run. - static uint8_t scramblerBit(int index) - { - static const std::vector seq = []() - { - std::vector s(MAX_SCRAMBLER); - uint16_t lfsr = ACARSAERO_SCRAMBLER_SEED; - for (int i = 0; i < MAX_SCRAMBLER; i++) - { - uint8_t bit = (uint8_t) (((lfsr >> 0) ^ (lfsr >> 14)) & 1); - lfsr = (uint16_t) ((lfsr >> 1) | (bit << 14)); - s[i] = bit; - } - return s; - }(); - return seq[index % MAX_SCRAMBLER]; - } - - // Deinterleaver permutation for a block of 64 rows by cols columns: srcPos[k] is - // where the k'th output (Viterbi input order) bit sits in the received block. - // Computed once per column count and cached. - static const std::vector& deinterleavePos(int cols) - { - static std::map> cache; - static const std::array permute = []() - { - std::array p; - for (int i = 0; i < ACARSAERO_INTERLEAVER_ROWS; i++) { - p[i] = (i * ACARSAERO_INTERLEAVER_ROW_STEP) % ACARSAERO_INTERLEAVER_ROWS; - } - return p; - }(); - - auto it = cache.find(cols); - if (it != cache.end()) { - return it->second; - } - - std::vector pos((size_t) ACARSAERO_INTERLEAVER_ROWS * cols); - int k = 0; - for (int j = 0; j < cols; j++) - { - for (int i = 0; i < ACARSAERO_INTERLEAVER_ROWS; i++) { - pos[k++] = permute[i] * cols + j; - } - } - return cache.emplace(cols, std::move(pos)).first->second; - } - - template - static void deinterleave(const T *in, int cols, T *out) - { - const std::vector& pos = deinterleavePos(cols); - for (size_t k = 0; k < pos.size(); k++) { - out[k] = in[pos[k]]; - } - } - - // MSK bursts are deinterleaved in GROUPS, not as one matrix: the first five - // columns are a 64x5 block of their own, then every following group of three - // columns is its own 64x3 block (JAERO AeroLInterleaver::deinterleaveMSK_ba). - // The OQPSK burst path treats the whole burst as a single 64xN matrix instead, so - // the two must not be conflated. - template - static void deinterleaveBurstMsk(const T *in, int cols, T *out) - { - const int rows = ACARSAERO_INTERLEAVER_ROWS; - deinterleave(in, ACARSAERO_BURST_HEAD_COLS, out); - int done = ACARSAERO_BURST_HEAD_COLS; - while (done + ACARSAERO_BURST_SU_COLS <= cols) - { - deinterleave(in + (size_t) done * rows, ACARSAERO_BURST_SU_COLS, - out + (size_t) done * rows); - done += ACARSAERO_BURST_SU_COLS; - } - } - - // Interleave a burst the way deinterleaveBurstMsk() undoes it: the first five - // columns as one block, then groups of three - template - static void interleaveBurstMsk(const T *in, int cols, T *out) - { - const int rows = ACARSAERO_INTERLEAVER_ROWS; - interleave(in, ACARSAERO_BURST_HEAD_COLS, out); - int done = ACARSAERO_BURST_HEAD_COLS; - while (done + ACARSAERO_BURST_SU_COLS <= cols) - { - interleave(in + (size_t) done * rows, ACARSAERO_BURST_SU_COLS, - out + (size_t) done * rows); - done += ACARSAERO_BURST_SU_COLS; - } - } - - template - static void interleave(const T *in, int cols, T *out) - { - const std::vector& pos = deinterleavePos(cols); - for (size_t k = 0; k < pos.size(); k++) { - out[pos[k]] = in[k]; - } - } - - // CRC-16/X-25 over the payload octets of a signal unit - static uint16_t computeCrc(const uint8_t *buf, int len) - { - crc16x25 crc; - crc.init(); - crc.calculate(const_cast(buf), len); - return (uint16_t) crc.get(); - } - - // A signal unit's CRC sits in its last two octets, little endian - static bool suCrcOk(const uint8_t *su, int len) - { - uint16_t received = (uint16_t) (su[len - 1] << 8) | su[len - 2]; - return computeCrc(su, len - ACARSAERO_SU_CRC_LEN) == received; - } - - static void appendCrc(std::vector& su) - { - uint16_t crc = computeCrc(su.data(), (int) su.size()); - su.push_back((uint8_t) (crc & 0xFF)); - su.push_back((uint8_t) ((crc >> 8) & 0xFF)); - } - - static bool allZero(const uint8_t *buf, int len) - { - for (int i = 0; i < len; i++) - { - if (buf[i]) { - return false; - } - } - return true; - } - - // --------------------------------------------------------------------------------- - // Signal unit types (JAERO aerol.h, namespaces AEROTypeP/R/T) - // --------------------------------------------------------------------------------- - - enum SuType - { - SuFill = 0x01, - SuSystemTableSmc = 0x05, - SuSystemTableBeam = 0x07, - SuSystemTableIndex = 0x0A, - SuSystemTableSatellite = 0x0C, - SuLogOnRequest = 0x10, - SuLogOnConfirm = 0x11, - SuLogOffRequest = 0x12, - SuLogOnReject = 0x13, - SuLogOnInterrogation = 0x14, - SuLogOnOffAcknowledge = 0x15, - SuLogOnPrompt = 0x16, - SuDataChannelReassignment = 0x17, - // Reserved in the SDM rather than unrecognised by us. They do appear on air - - // JAERO names them the same way (aerol.h, Reserved_18/19/26) - SuReserved18 = 0x18, - SuReserved19 = 0x19, - SuReserved26 = 0x26, - SuCallAnnouncement = 0x21, - SuAccessRequestData = 0x22, - SuEirpTable = 0x28, - SuCallProgress = 0x30, - SuCChannelDistress = 0x31, - SuCChannelFlightSafety = 0x32, - SuCChannelOtherSafety = 0x33, - SuCChannelNonSafety = 0x34, - SuPRChannelControl = 0x40, - SuTChannelControl = 0x41, - SuTChannelAssignment = 0x51, - SuTelephonyAck = 0x60, - SuRequestAcknowledgement = 0x61, - SuAcknowledge = 0x62, - SuUserDataIsu = 0x71, - SuUserData3Octet = 0x74, - SuUserData4Octet = 0x76 - }; - - static bool isSsu(uint8_t type) { return (type & 0xC0) == 0xC0; } - - // Which Inmarsat satellite and ocean region a Ground Earth Station id belongs to. - // https://acars-vdl2.groups.io/g/main/topic/frequencies_in_use_inmarsat/112254777 - // Appears valid for AOR-E - static const char *gesName(uint8_t id) - { - switch (id) - { - case 0x43: case 0x44: - return "AOR-E"; - case 0x90: case 0xC1: case 0xC5: - return "IOR"; - case 0x02: case 0x05: case 0xD0: - return "AOR-W"; - case 0x50: case 0x82: case 0x85: - return "POR"; - default: - return nullptr; - } - } - - static bool suIsNoInfo(uint8_t type) - { - switch (type) - { - case SuFill: - case SuSystemTableSmc: - case SuSystemTableBeam: - case SuSystemTableIndex: - case SuSystemTableSatellite: - case SuEirpTable: - case SuReserved18: - case SuReserved19: - case SuReserved26: - return true; - default: - return false; - } - } - - static bool suHasAesId(uint8_t type) - { - if (isSsu(type)) { - return true; - } - switch (type) - { - case SuLogOnRequest: - case SuLogOnConfirm: - case SuLogOffRequest: - case SuLogOnReject: - case SuLogOnInterrogation: - case SuLogOnOffAcknowledge: - case SuLogOnPrompt: - case SuDataChannelReassignment: - case SuCallAnnouncement: - case SuAccessRequestData: - case SuCallProgress: - case SuCChannelDistress: - case SuCChannelFlightSafety: - case SuCChannelOtherSafety: - case SuCChannelNonSafety: - case SuPRChannelControl: - case SuTChannelControl: - case SuTChannelAssignment: - case SuTelephonyAck: - case SuRequestAcknowledgement: - case SuAcknowledge: - case SuUserDataIsu: - case SuUserData3Octet: - case SuUserData4Octet: - return true; - default: - return false; - } - } - - static const char *suTypeName(uint8_t type) - { - if (isSsu(type)) { - return "User data SSU"; - } - - switch (type) - { - case SuFill: return "Fill-in signal unit"; - case SuSystemTableSmc: return "System table, Psmc/Rsmc channels"; - case SuSystemTableBeam: return "System table, GES beam support"; - case SuSystemTableIndex: return "System table index"; - case SuSystemTableSatellite: return "System table, satellite identification"; - case SuLogOnRequest: return "Log-on request"; - case SuLogOnConfirm: return "Log-on confirm"; - case SuLogOffRequest: return "Log-off request"; - case SuLogOnReject: return "Log-on reject"; - case SuLogOnInterrogation: return "Log-on interrogation"; - case SuLogOnOffAcknowledge: return "Log-on/off acknowledge"; - case SuLogOnPrompt: return "Log-on prompt"; - case SuDataChannelReassignment: return "Data channel reassignment"; - case SuReserved18: - case SuReserved19: - case SuReserved26: return "Reserved"; - case SuCallAnnouncement: return "Call announcement"; - case SuAccessRequestData: return "Access request, data"; - case SuEirpTable: return "Data EIRP table broadcast"; - case SuCallProgress: return "Call progress"; - case SuCChannelDistress: return "C channel assignment, distress"; - case SuCChannelFlightSafety: return "C channel assignment, flight safety"; - case SuCChannelOtherSafety: return "C channel assignment, other safety"; - case SuCChannelNonSafety: return "C channel assignment, non-safety"; - case SuPRChannelControl: return "P/R channel control"; - case SuTChannelControl: return "T channel control"; - case SuTChannelAssignment: return "T channel assignment"; - case SuTelephonyAck: return "Telephony acknowledge"; - case SuRequestAcknowledgement: return "Request for acknowledgement"; - case SuAcknowledge: return "Acknowledge"; - case SuUserDataIsu: return "User data ISU"; - case SuUserData3Octet: return "User data, 3 octet LSDU"; - case SuUserData4Octet: return "User data, 4 octet LSDU"; - default: return "Unknown"; - } - } - - // C channel assignment carries the assigned voice frequencies as 15 bit channel - // numbers with bit 15 flagging a spot beam (JAERO aerol.cpp SendCAssignment) - static double cChannelReceiveMHz(int channel) { return channel * 0.0025 + 1510.0; } - static double cChannelTransmitMHz(int channel) { return channel * 0.0025 + 1611.5; } - - // --------------------------------------------------------------------------------- - // ISU/SSU reassembly. This is link layer fragmentation of ONE ACARS block, which is - // a different thing from ACARS multipart (ETB) - that is left to - // AcarsMultipartAssembler downstream, exactly as the other protocols do it. - // --------------------------------------------------------------------------------- - - struct IsuKey - { - uint32_t m_aesId; - uint8_t m_gesId; - uint8_t m_qNo; - uint8_t m_refNo; - - bool operator<(const IsuKey& o) const - { - if (m_aesId != o.m_aesId) return m_aesId < o.m_aesId; - if (m_gesId != o.m_gesId) return m_gesId < o.m_gesId; - if (m_qNo != o.m_qNo) return m_qNo < o.m_qNo; - return m_refNo < o.m_refNo; - } - }; - - struct Reassembly - { - int m_remaining = 0; //!< SSUs still expected, counts down - int m_lastOctets = 0; //!< Octets used in the final SSU - double m_started = 0.0; - std::vector m_data; - }; - - // --------------------------------------------------------------------------------- - // ACARS extraction. The reassembled user data is FF FF then a complete ARINC 618 - // block; strip the FFs and the odd parity and the rest of the plugin takes it. - // --------------------------------------------------------------------------------- - - static bool looksLikeAcars(const std::vector& userData) - { - // JAERO's own sniff test, aerol.cpp ParserISU::parse - return (userData.size() > 16) - && (userData[0] == 0xFF) - && (userData[1] == 0xFF) - && ((userData[15] == 0x83) || (userData[15] == 0x02)); - } - - // True when every octet that should carry odd parity does - static bool acarsParityOk(const std::vector& userData) - { - // The two leading FFs and the two BCS octets before the DEL are the exceptions - if (userData.size() < 7) { - return false; - } - size_t bcs = userData.size() - 3; - for (size_t i = 2; i < userData.size(); i++) - { - if ((i == bcs) || (i == bcs + 1)) { - continue; - } - if (!oddParity(userData[i])) { - return false; - } - } - return true; - } - - // Strip the two FF octets, giving the ARINC 618 block from its SOH. - // - // The parity bits are deliberately LEFT ON, which is what VDL-2 and HFDL deliver - // too: AcarsMessage::decode masks them itself, and libacars wants the block as - // transmitted. SOH and DEL both happen to have odd parity already, so the raw - // first and last octets still compare equal to 0x01 and 0x7F, which is what - // AcarsMessage::decode tests without masking. - static std::vector acarsBlock(const std::vector& userData) - { - if (userData.size() <= 2) { - return std::vector(); - } - return std::vector(userData.begin() + 2, userData.end()); - } - - static bool oddParity(uint8_t v) - { - v = (uint8_t) (v ^ (v >> 4)); - v = (uint8_t) (v ^ (v >> 2)); - v = (uint8_t) (v ^ (v >> 1)); - return (v & 1) != 0; - } - - static uint8_t withOddParity(uint8_t v) - { - v = (uint8_t) (v & 0x7F); - return oddParity(v) ? v : (uint8_t) (v | 0x80); - } - - // --------------------------------------------------------------------------------- - // Encode side, for the test harness generator. Exact inverses of the decode path. - // --------------------------------------------------------------------------------- - - // Wrap an ARINC 618 ACARS block (from its SOH, with its BCS and DEL) as Aero user - // data: two FF octets then the block with odd parity added - static std::vector buildUserData(const std::vector& acarsBlock) - { - std::vector ud = { 0xFF, 0xFF }; - if (acarsBlock.size() < 3) { - return ud; - } - size_t bcs = acarsBlock.size() - 3; - for (size_t i = 0; i < acarsBlock.size(); i++) - { - if ((i == bcs) || (i == bcs + 1)) { - ud.push_back(acarsBlock[i]); - } else { - ud.push_back(withOddParity(acarsBlock[i])); - } - } - return ud; - } - - // Split user data into an ISU and its SSUs, each a complete signal unit with CRC - static std::vector> buildIsuChain(uint32_t aesId, uint8_t gesId, - uint8_t qNo, uint8_t refNo, const std::vector& userData) - { - std::vector> sus; - // Two octets ride in the ISU, eight in each SSU - int remaining = (int) userData.size() - 2; - if (remaining < 0) { - remaining = 0; - } - int ssus = (remaining + 7) / 8; - int lastOctets = remaining - (ssus - 1) * 8; - if (ssus == 0) { - lastOctets = 0; - } - - std::vector isu; - isu.push_back(SuUserDataIsu); - isu.push_back((uint8_t) ((aesId >> 16) & 0xFF)); - isu.push_back((uint8_t) ((aesId >> 8) & 0xFF)); - isu.push_back((uint8_t) (aesId & 0xFF)); - isu.push_back(gesId); - isu.push_back((uint8_t) (((qNo & 0x0F) << 4) | (refNo & 0x0F))); - isu.push_back((uint8_t) (ssus & 0x3F)); - isu.push_back((uint8_t) ((lastOctets & 0x0F) << 4)); - isu.push_back(userData.size() > 0 ? userData[0] : 0); - isu.push_back(userData.size() > 1 ? userData[1] : 0); - appendCrc(isu); - sus.push_back(isu); - - for (int s = 0; s < ssus; s++) - { - std::vector ssu; - // SEQNO counts down and the FIRST SSU is one less than the count in the - // ISU, so the last one carries zero (JAERO ISUData::findisuitemC0 matches - // on SEQNO + 1 against the stored value) - ssu.push_back((uint8_t) (0xC0 | ((ssus - 1 - s) & 0x3F))); - ssu.push_back((uint8_t) (((qNo & 0x0F) << 4) | (refNo & 0x0F))); - int octets = (s == ssus - 1) ? lastOctets : 8; - for (int i = 0; i < 8; i++) - { - size_t src = (size_t) (2 + s * 8 + i); - ssu.push_back((i < octets) && (src < userData.size()) ? userData[src] : 0); - } - appendCrc(ssu); - sus.push_back(ssu); - } - return sus; - } - - static std::vector buildFillSu() - { - std::vector su(ACARSAERO_SU_LEN - ACARSAERO_SU_CRC_LEN, 0); - su[0] = SuFill; - appendCrc(su); - return su; - } - - // K=7 rate 1/2 convolutional encoder that CARRIES ITS STATE, which is what the real - // P channel encoder does - it runs continuously across frame boundaries rather than - // restarting each frame. Measured, not assumed: decoding a real recording with the - // Viterbi forced to start in state 0 lost the first signal unit of three frames in - // four, and letting it start from any state took that unit's success rate from 24% - // to the 95% every other position already got. - // - // Same polynomials as AcarsHfdlReceiver::convEncode; that one always starts from - // zero, which is right for HFDL's per-burst encoder and wrong here. - static void convEncodeContinuous(const std::vector& bits, - std::vector& chips, uint32_t& sr) - { - chips.clear(); - chips.reserve(bits.size() * 2); - for (uint8_t b : bits) - { - sr = ((sr << 1) | (b & 1)) & 0x7F; - chips.push_back(parity7(sr & 0x6D)); - chips.push_back(parity7(sr & 0x4F)); - } - } - - static uint8_t parity7(uint32_t v) - { - v ^= v >> 4; - v ^= v >> 2; - v ^= v >> 1; - return (uint8_t) (v & 1); - } - - // Build one P channel frame's worth of channel bits: unique word, header, then the - // data field encoded, interleaved and scrambled. sus are padded with fill units. - // sr carries the convolutional encoder state from the previous frame. - static std::vector encodeFrameBits(int rate, uint16_t header, - const std::vector>& sus, uint32_t& sr) - { - const int cols = interleaverCols(rate); - const int blockLen = ACARSAERO_INTERLEAVER_ROWS * cols; - const int coded = codedBitsPerFrame(rate); - const int dataBits = coded / 2; - - // Octets of the data field, padded with fill signal units - std::vector octets; - octets.reserve(dataBits / 8); - for (const auto& su : sus) - { - if ((int) octets.size() + ACARSAERO_SU_LEN > dataBits / 8) { - break; - } - octets.insert(octets.end(), su.begin(), su.end()); - } - std::vector fill = buildFillSu(); - while ((int) octets.size() + ACARSAERO_SU_LEN <= dataBits / 8) { - octets.insert(octets.end(), fill.begin(), fill.end()); - } - octets.resize(dataBits / 8, 0); - - // Unpack LSB first, then scramble - std::vector bits(dataBits); - for (int i = 0; i < dataBits; i++) { - bits[i] = (uint8_t) (((octets[i / 8] >> (i % 8)) & 1) ^ scramblerBit(i)); - } - - // Convolutionally encode, then interleave block by block - std::vector chips; - convEncodeContinuous(bits, chips, sr); - chips.resize(coded, 0); - - std::vector tx(coded); - for (int b = 0; b < coded / blockLen; b++) { - interleave(chips.data() + b * blockLen, cols, tx.data() + b * blockLen); - } - - std::vector out; - out.reserve(uwBits(rate) + ACARSAERO_HEADER_LEN + dummyBits(rate) + coded); - appendUw(rate, out); - for (int i = 0; i < ACARSAERO_HEADER_LEN; i++) { - out.push_back((uint8_t) ((header >> (ACARSAERO_HEADER_LEN - 1 - i)) & 1)); - } - for (int i = 0; i < dummyBits(rate); i++) { - out.push_back(0); - } - out.insert(out.end(), tx.begin(), tx.end()); - return out; - } - - // Encode one R or T burst, the counterpart of tryBurstDecode(). - // - // A burst is NOT a frame: there is no 16 bit header and no dummy field, the - // convolutional encoder starts from state zero for every burst instead of running - // continuously, the scrambler restarts with it, and the interleaver is segmented. - // The generator had none of that - it built P channel frames whatever the submode was - // - so the R and T paths were never exercised end to end at all, and the "passes - // loopback" claim in the plan was simply untrue for them. - // - // An R burst is five columns holding one 19 octet signal unit. A T burst is five - // columns of header then three columns per 12 octet signal unit. Either way the - // block is 64 x cols channel bits, so it carries 32 x cols information bits, and - // whatever the signal units do not fill is left as zeros - which also flushes the - // encoder, since the tail of every burst is zero. - static std::vector encodeBurstBits(int rate, int channel, - const std::vector>& sus) - { - const int rows = ACARSAERO_INTERLEAVER_ROWS; - const int suLen = (channel == ChannelR) ? ACARSAERO_R_SU_LEN : ACARSAERO_SU_LEN; - - std::vector octets; - int cols; - - if (channel == ChannelR) - { - cols = ACARSAERO_BURST_HEAD_COLS; - if (!sus.empty()) { - octets.insert(octets.end(), sus[0].begin(), sus[0].end()); - } - } - else - { - cols = ACARSAERO_BURST_HEAD_COLS + (int) sus.size() * ACARSAERO_BURST_SU_COLS; - // The T header is four octets and its own CRC. The receiver takes the signal - // unit count from the burst length rather than from the header, so only the - // CRC has to be right. - std::vector hdr(ACARSAERO_T_HEADER_LEN, 0); - hdr[0] = 0xC0; - hdr[1] = 0x40; - hdr[2] = 0x00; - hdr[3] = 0x01; - uint16_t crc = computeCrc(hdr.data(), ACARSAERO_T_HEADER_LEN - ACARSAERO_SU_CRC_LEN); - hdr[ACARSAERO_T_HEADER_LEN - 2] = (uint8_t) (crc & 0xFF); - hdr[ACARSAERO_T_HEADER_LEN - 1] = (uint8_t) (crc >> 8); - octets = hdr; - for (const auto& su : sus) { - octets.insert(octets.end(), su.begin(), su.end()); - } - } - (void) suLen; - - const int coded = rows * cols; - const int dataBits = coded / 2; - octets.resize((size_t) dataBits / 8, 0); - - std::vector bits(dataBits); - for (int i = 0; i < dataBits; i++) { - bits[i] = (uint8_t) (((octets[i / 8] >> (i % 8)) & 1) ^ scramblerBit(i)); - } - - // From state zero, per burst - not the continuous encoder the P channel uses - uint32_t sr = 0; - std::vector chips; - convEncodeContinuous(bits, chips, sr); - chips.resize(coded, 0); - - std::vector tx(coded); - interleaveBurstMsk(chips.data(), cols, tx.data()); - - std::vector out; - out.reserve(uwBits(rate) + coded); - appendUw(rate, out); - out.insert(out.end(), tx.begin(), tx.end()); - return out; - } - - // Bits the unique word field occupies. OQPSK carries the same 32 bit word on BOTH - // arms, so it takes 64 bits of the stream - which is exactly the 64 that the frame - // arithmetic needs (16 + 178 + 4992 + 64 = 5250) and 32 symbols either way. - static int uwBits(int rate) - { - return isOqpsk(rate) ? (2 * ACARSAERO_UW_LEN) : ACARSAERO_UW_LEN; - } - - static void appendUw(int rate, std::vector& out) - { - for (int i = 0; i < ACARSAERO_UW_LEN; i++) - { - uint8_t b = (uint8_t) uwBit(i); - if (isOqpsk(rate)) { - out.push_back(b); // Q arm - } - out.push_back(b); // I arm, or the MSK symbol - } - } - - // OQPSK modulate a bit stream. The bits arrive Q first then I for each symbol, the - // Q arm is inverted with respect to I, and the Q pulse is staggered HALF A SYMBOL - // EARLY - the three conventions the receiver expects, none of them guessable and - // all three established against a real recording. - static void modulateOqpsk(const std::vector& bits, int sps, std::vector& out) - { - const size_t symbols = bits.size() / 2; - const int span = 6; - const int taps = span * sps + 1; - - // Root raised cosine, roll-off 1.0, the same pulse the receiver matches to - std::vector h(taps); - double sum = 0.0; - for (int i = 0; i < taps; i++) - { - double t = (i - taps / 2) / (double) sps; - // Root raised cosine with roll-off exactly 1, where the general formula - // collapses to 4t cos(2 pi t) / (pi t (1 - 16 t^2)) - double v; - if (std::abs(t) < 1e-9) { - v = 4.0 / M_PI; - } else if (std::abs(std::abs(4.0 * t) - 1.0) < 1e-6) { - v = (1.0 / std::sqrt(2.0)) - * ((1.0 + 2.0 / M_PI) * std::sin(M_PI / 4.0) - + (1.0 - 2.0 / M_PI) * std::cos(M_PI / 4.0)); - } else { - v = (4.0 * t * std::cos(2.0 * M_PI * t)) - / (M_PI * t * (1.0 - 16.0 * t * t)); - } - h[i] = v; - sum += v; - } - for (int i = 0; i < taps; i++) { - h[i] /= sum; - } - - const int lead = taps / 2 + sps; - out.assign(symbols * sps + 2 * lead, Cd(0.0, 0.0)); - - for (size_t n = 0; n < symbols; n++) - { - double q = bits[2 * n] ? -1.0 : 1.0; // Q is inverted with respect to I - double a = bits[2 * n + 1] ? 1.0 : -1.0; - - int iCentre = (int) (lead + n * sps); - int qCentre = iCentre - sps / 2; // Q leads I by half a symbol - - for (int k = 0; k < taps; k++) - { - int pi = iCentre + k - taps / 2; - int pq = qCentre + k - taps / 2; - if ((pi >= 0) && (pi < (int) out.size())) { - out[pi] += Cd(a * h[k], 0.0); - } - if ((pq >= 0) && (pq < (int) out.size())) { - out[pq] += Cd(0.0, q * h[k]); - } - } - } - } - - // MSK modulate a bit stream. The bits are differentially encoded onto the derotated - // BPSK stream, which is the same as saying the MSK phase advances +90 degrees for a - // one and -90 for a zero - continuous phase, constant envelope. - static void modulateMsk(const std::vector& bits, int sps, std::vector& out) - { - out.clear(); - out.reserve(bits.size() * sps); - double phase = 0.0; - for (uint8_t b : bits) - { - double step = (b ? M_PI_2 : -M_PI_2) / sps; - for (int s = 0; s < sps; s++) - { - phase += step; - out.push_back(std::polar(1.0, phase)); - } - } - } - - // --------------------------------------------------------------------------------- - // Receiver - // --------------------------------------------------------------------------------- - - bool processSample(const Cd& in) - { - m_stats.m_samples++; - m_time += 1.0 / channelSampleRate(m_rate); - size_t before = m_frames.size(); - - Cd s = matchedFilter(in); - m_ringIdx = (m_ringIdx + 1) % (int) m_ring.size(); - m_ring[m_ringIdx] = s; - if (m_ringFill < (int) m_ring.size()) { - m_ringFill++; - } - - if (!rateSupported(m_rate)) { - return false; - } - - bool haveFill = m_ringFill >= (ACARSAERO_UW_LEN + 1) * m_sps + 4; - - if (m_state == StateSearch) - { - if (haveFill) { - searchUniqueWord(); - } - } - else if (m_state == StateTrack) - { - trackUniqueWord(); - } - else - { - if (++m_sclk >= m_symPeriod) - { - m_sclk = 0; - processSymbol(); - nextSymbolPeriod(); - } - } - - return m_frames.size() != before; - } - -private: - static const int MAX_SCRAMBLER = 8192; // Longest frame's data field, with margin - - enum State - { - StateSearch = 0, - StateHeader, //!< Collecting the 16 uncoded header bits - StateData, //!< Collecting the coded data field - StateBurst, //!< R/T: collecting soft bits, trying a decode each block - StateTrack //!< P: waiting for the next frame's unique word where predicted - }; - - Config m_config; - Stats m_stats; - int m_rate = Rate600; - int m_channel = ChannelP; - int m_sps = 32; - double m_time = 0.0; - - std::vector m_filter; //!< Matched filter taps - std::vector m_filterDelay; - int m_filterIdx = 0; - - std::vector m_ring; - int m_ringIdx = 0; - int m_ringFill = 0; - - State m_state = StateSearch; - int m_lockedPhase = -1; //!< OQPSK symbol clock phase held across frames, -1 until locked - int m_framePhase = -1; //!< Phase this frame was started on, locked if it decodes - bool m_phaseConfirmed = false; //!< A frame has actually decoded on m_lockedPhase - int m_phaseFailures = 0; //!< Consecutive dead frames since it was confirmed - int m_sclk = 0; - int m_symPeriod = 0; //!< Samples in the symbol being collected - double m_timingAcc = 0.0; //!< Fractional part of the timing correction - double m_timingRate = 0.0; //!< Samples of slip per symbol - measureTimingSlip() - int m_symbolCount = 0; - Cd m_prevSym; - double m_dphi = 0.0; //!< Carrier offset, radians per symbol, from acquisition - double m_lastSyncError = 0.0; - double m_magMean = 0.0; //!< Running mean differential magnitude, for soft scaling - - int m_trackWait = 0; //!< Samples until the predicted unique word window opens - int m_missedFrames = 0; - - bool m_syncPending = false; //!< Holding the correlation peak before committing - double m_bestStat = 0.0; - int m_bestAgo = 0; - Cd m_bestSum; - - std::vector m_headerBits; - std::vector m_softBits; //!< Data field soft bits, 255 = strong 1 - std::vector m_softBitsCoh; //!< ... from the coherent lane - - std::vector m_symBuf; //!< Derotated symbols of the frame, for the smoother - std::vector m_refPhase; //!< ... and the unwrapped reference phase at each - double m_refPhaseAcc = 0.0; //!< Running unwrapped phase of m_ref - double m_projPrevFirst = 0.0; //!< Projection before the first data symbol - bool m_oqpskInit = false; //!< OQPSK carrier seeded for this frame - Cd m_ref; //!< Coherent lane carrier reference, unit magnitude - double m_dphiSym = 0.0; //!< ... and its per symbol advance, tracked - double m_projPrev = 0.0; //!< Previous coherent projection, for the differential decode - double m_evmMeanSq = 0.0; //!< Running mean square in-phase error, see detectCoherent - double m_suRate = -1.0; //!< Running fraction of signal units passing CRC - double m_magMeanCoh = 0.0; - bool m_cohValid = false; - std::vector m_burstBits; - int m_burstTargetSus = 0; //!< T burst signal unit count, from unit one's SEQNO - double m_carriedDphi = 0.0; //!< Per-symbol rotation carried from the last good frame - bool m_haveCarriedDphi = false; //!< ... and whether there is one - int m_burstCols = 0; - - std::deque m_frames; - std::map m_reassembly; - - int ringLength() const { return (ACARSAERO_UW_LEN + 2) * m_sps + 8; } - - void designFilter() - { - if (isOqpsk(m_rate)) { - designRrc(); - } else { - designHalfSine(); - } - m_filterDelay.assign(m_filter.size(), Cd(0.0, 0.0)); - m_filterIdx = 0; - } - - // MSK's matched filter is a half sine spanning two symbol periods - void designHalfSine() - { - int len = 2 * m_sps; - m_filter.assign(len, 0.0); - double sum = 0.0; - for (int i = 0; i < len; i++) - { - m_filter[i] = std::sin(M_PI * i / (double) len); - sum += m_filter[i]; - } - for (int i = 0; i < len; i++) { - m_filter[i] /= sum; - } - } - - // OQPSK uses a root raised cosine with roll-off 1.0, designed at the symbol rate - void designRrc() - { - const double alpha = 1.0; - const int span = 6; - int len = span * m_sps + 1; - m_filter.assign(len, 0.0); - double sum = 0.0; - for (int i = 0; i < len; i++) - { - double t = (i - len / 2) / (double) m_sps; - double v; - if (std::abs(t) < 1e-9) { - v = 1.0 - alpha + 4.0 * alpha / M_PI; - } else if (std::abs(std::abs(4.0 * alpha * t) - 1.0) < 1e-6) { - v = (alpha / std::sqrt(2.0)) - * ((1.0 + 2.0 / M_PI) * std::sin(M_PI / (4.0 * alpha)) - + (1.0 - 2.0 / M_PI) * std::cos(M_PI / (4.0 * alpha))); - } else { - v = (std::sin(M_PI * t * (1.0 - alpha)) - + 4.0 * alpha * t * std::cos(M_PI * t * (1.0 + alpha))) - / (M_PI * t * (1.0 - 16.0 * alpha * alpha * t * t)); - } - m_filter[i] = v; - sum += v; - } - for (int i = 0; i < len; i++) { - m_filter[i] /= sum; - } - } - - Cd matchedFilter(const Cd& in) - { - m_filterDelay[m_filterIdx] = in; - Cd acc(0.0, 0.0); - int idx = m_filterIdx; - for (size_t i = 0; i < m_filter.size(); i++) - { - acc += m_filterDelay[idx] * m_filter[i]; - idx = (idx == 0) ? (int) m_filter.size() - 1 : idx - 1; - } - m_filterIdx = (m_filterIdx + 1) % (int) m_filter.size(); - return acc; - } - - Cd tap(int back) const - { - int n = (int) m_ring.size(); - return m_ring[(m_ringIdx + n - back) % n]; - } - - // Differential detection of MSK. Consecutive symbols differ by exactly +-90 - // degrees - s[n]/s[n-1] is +j for a one and -j for a zero - so multiplying the - // product of a symbol and the conjugate of its predecessor by -j lands it on the - // real axis, positive for a one. This is the derotate-to-BPSK view of MSK with the - // per symbol 90 degree rotation cancelled out: it appears in the product as a - // constant, so there is no need to track a symbol index at all. - static Cd differential(const Cd& sym, const Cd& prev) - { - return sym * std::conj(prev) * Cd(0.0, -1.0); - } - - // The other view of the same identity, the one the coherent lane needs: rotating - // the matched filter output by -90 degrees per symbol turns MSK into plain BPSK, - // u[n] = b[n] exp(j phi), where b[n] are the PRECODED symbols. Their running - // product is the data, which is why a differential decode still follows. - // - // The symbol index origin is arbitrary - shifting it rotates every sample by the - // same multiple of 90 degrees, which the carrier reference absorbs - so long as it - // is used consistently. - static Cd derotate(const Cd& v, int n) - { - switch (((n % 4) + 4) % 4) - { - case 0: return v; - case 1: return Cd(v.imag(), -v.real()); // * -j - case 2: return -v; - default: return Cd(-v.imag(), v.real()); // * +j - } - } - - // --------------------------------------------------------------------------------- - // Acquisition. Differential correlation against the unique word: the products - // u[k] conj(u[k-1]) read +-e^{j dphi}, the sign following whether consecutive - // differentially encoded unique word bits are equal, so the statistic is immune to - // carrier offset and arg(D) gives the per symbol carrier advance. Same machinery as - // the HFDL and VDL-2 receivers. - // --------------------------------------------------------------------------------- - - // The 32 unique word bits are carried by the transitions between 33 symbols, the - // last of which is the newest sample. Bit k is the transition from symbol k to - // symbol k+1, so it reads back (32 - k - 1) and (32 - k) symbols ago. - double uwCorrelation(Cd& sum) const - { - sum = Cd(0.0, 0.0); - double mag = 0.0; - - if (isOqpsk(m_rate)) - { - // OQPSK is not precoded, so the unique word sits directly on the I arm's 32 - // symbols rather than on the transitions between 33 of them. That makes 31 - // products, and the sign template is whether consecutive unique word BITS - // agree rather than whether consecutive data bits do. - for (int k = 0; k + 1 < ACARSAERO_UW_LEN; k++) - { - Cd a = tap((ACARSAERO_UW_LEN - k - 2) * m_sps); - Cd b = tap((ACARSAERO_UW_LEN - k - 1) * m_sps); - Cd d = a * std::conj(b); - sum += (uwBit(k) == uwBit(k + 1)) ? d : -d; - mag += std::abs(d); - } - return (mag > 0.0) ? std::abs(sum) / mag : 0.0; - } - - for (int k = 0; k < ACARSAERO_UW_LEN; k++) - { - Cd d = differential(tap((ACARSAERO_UW_LEN - k - 1) * m_sps), - tap((ACARSAERO_UW_LEN - k) * m_sps)); - sum += uwBit(k) ? d : -d; - mag += std::abs(d); - } - return (mag > 0.0) ? std::abs(sum) / mag : 0.0; - } - - bool searchUniqueWord() - { - Cd sum; - double stat = uwCorrelation(sum); - m_lastSyncError = stat; - if (stat > m_stats.m_uwPeak) { - m_stats.m_uwPeak = stat; - } - const double syncThreshold = isOqpsk(m_rate) ? m_config.m_oqpskSyncThreshold - : m_config.m_syncThreshold; - - // Hold the peak rather than firing on the first sample over the threshold. The - // correlation rises over roughly a symbol either side of perfect alignment, so - // firing on the crossing samples the eye off centre - worth a dB or more at - // 32 samples per symbol, and it costs only half a symbol of latency. - if (stat >= syncThreshold) - { - if (!m_syncPending || (stat > m_bestStat)) - { - m_syncPending = true; - m_bestStat = stat; - m_bestAgo = 0; - m_bestSum = sum; - } - } - - if (!m_syncPending) { - return false; - } - - m_bestAgo++; - if (m_bestAgo <= m_sps / 2) { - return false; - } - - m_stats.m_syncs++; - m_syncPending = false; - m_dphi = std::arg(m_bestSum); - m_lastSyncError = m_bestStat; - startFrame(refineTiming(m_bestAgo)); - return true; - } - - // A P channel frame is a fixed number of symbols, so once one has been decoded the - // next unique word is due at a known instant. Rather than free running search - which - // is what lets a data pattern or an adjacent channel steal a frame - open a window of - // half a symbol either side of the predicted instant, take the correlation peak - // inside it, and accept it against a much lower threshold than acquisition uses. - // - // The window also re-locks the symbol timing every frame, so clock error cannot - // accumulate across a long lock. - // - // Returns true when a frame was started. - bool trackUniqueWord() - { - if (--m_trackWait > 0) { - return false; - } - - Cd sum; - double stat = uwCorrelation(sum); - - if (!m_syncPending || (stat > m_bestStat)) - { - m_syncPending = true; - m_bestStat = stat; - m_bestAgo = 0; - m_bestSum = sum; - } - m_bestAgo++; - - // The window is one symbol wide, centred on the prediction - if (m_trackWait > -m_sps) { - return false; - } - - m_lastSyncError = m_bestStat; - m_syncPending = false; - - if (m_bestStat < m_config.m_trackThreshold) - { - m_missedFrames++; - if (m_missedFrames > m_config.m_maxMissedFrames) - { - m_stats.m_uwLost++; - m_state = StateSearch; - m_lockedPhase = -1; // a fresh acquisition may legitimately pick either phase - m_phaseConfirmed = false; - m_phaseFailures = 0; - m_haveCarriedDphi = false; - return false; - } - // Predict the frame after next and keep tracking through the gap - armTracking(); - return false; - } - - m_missedFrames = 0; - m_stats.m_uwTracked++; - m_stats.m_syncs++; - m_dphi = std::arg(m_bestSum); - measureTimingSlip(m_bestAgo); - startFrame(refineTiming(m_bestAgo)); - return true; - } - - // Open the next prediction window half a symbol before the unique word is due - void armTracking() - { - m_state = StateTrack; - m_syncPending = false; - m_bestStat = 0.0; - // From the frame's last data symbol, the next unique word ends 32 symbols later - m_trackWait = ACARSAERO_UW_LEN * m_sps - m_sps / 2; - } - - // The sample phase, modulo one symbol, of an instant "ago" samples back from now - int instantPhase(int ago) const - { - int64_t at = (int64_t) m_stats.m_samples - (int64_t) ago; - int ph = (int) (at % (int64_t) m_sps); - return (ph < 0) ? (ph + m_sps) : ph; - } - - // Signed distance from a candidate instant's phase to the locked one, in samples, - // taken the short way round the symbol - int phaseError(int ago) const - { - int d = m_lockedPhase - instantPhase(ago); - if (d > m_sps / 2) { - d -= m_sps; - } else if (d < -m_sps / 2) { - d += m_sps; - } - return d; - } - - // Refine the symbol timing against the unique word, which is a known sequence. - // OQPSK ONLY - see below. - // - // The acquisition correlator cannot do this itself. It is deliberately differential, - // so that it works before the carrier is known, and a differential product is a very - // blunt timing discriminator: it multiplies two neighbouring samples and so stays - // large anywhere the eye is open at all. On the 10500 bps recording it reads between - // 0.944 and 0.965 across the WHOLE symbol, which is no discrimination worth the - // name, so peak-holding it lands the sampling instant essentially at random within - // the symbol. That cost the OQPSK rate almost everything: 5% of signal units passing - // at the correlator's own choice of instant against 80% six samples away. - // - // Stripping the modulation with the known unique word bits and summing coherently - // gives the matched filter output instead, which is exactly what peaks at the symbol - // centre. One pass, no loop to lose lock, nothing to tune. - // - // It is NOT applied to the MSK rates, and that is measured rather than assumed. - // Their pulse is a half sine at 32 or 16 samples per symbol, so the differential - // correlator's timing is already good, and every variant of this tried there made it - // worse - 210 signal units of 222 without it, against 195, 175 and 81 for the three - // ways of aligning it to MSK's 33 symbol differentially carried word. Refining - // something that is already right can only add noise. - int refineTiming(int ago) - { - if (!isOqpsk(m_rate)) { - return ago; - } - - const int span = m_sps / 2; - int bestOffset = 0; - double best = -1.0; - - for (int d = -span; d <= span; d++) - { - int at = ago + d; - // tap() only looks backwards, and the ring must hold the word plus the Q arm - if ((at < 0) || (at + ACARSAERO_UW_LEN * m_sps + span >= (int) m_ring.size())) { - continue; - } - // Refuse candidates that would move the symbol clock phase off the one already - // locked. Applied HERE rather than by adjusting the winner afterwards, so the - // result always stays inside the range the bounds check above has validated - - // adjusting it after the fact could push it past the start of the ring, which - // cost 15 of 118 frames on the recording. - if ((m_lockedPhase >= 0) - && (std::abs(phaseError(at - m_sps / 2)) > ACARSAERO_TIMING_PULL)) { - continue; - } - - // A reference direction from the I arm with the modulation stripped - Cd acc(0.0, 0.0); - for (int k = 0; k < ACARSAERO_UW_LEN; k++) - { - Cd v = tap(at + (ACARSAERO_UW_LEN - 1 - k) * m_sps); - acc += uwBit(k) ? v : -v; - } - double amag = std::abs(acc); - if (amag < 1e-12) { - continue; - } - const Cd u = acc / amag; - - // Score by the EYE OPENING the detector actually uses - the real axis of the - // I arm and the imaginary axis of the Q arm - rather than by the magnitude of - // that vector sum. - // - // Magnitude is the obvious criterion and it is measurably wrong here. The - // unique word sits on BOTH arms, so its Q contribution to an I sample adds - // coherently rather than averaging away, and the magnitude peak lands a few - // samples off the instant where the arms actually separate best. On the - // generated signal that difference was everything: 26 of 208 signal units at - // the magnitude peak against 208 of 208 a few samples away. - double score = 0.0; - for (int k = 0; k < ACARSAERO_UW_LEN; k++) - { - int off = at + (ACARSAERO_UW_LEN - 1 - k) * m_sps; - score += std::abs((tap(off) * std::conj(u)).real()); - score += std::abs((tap(off + m_sps / 2) * std::conj(u)).imag()); - } - - if (score > best) - { - best = score; - bestOffset = d; - } - } - - // HALF A SYMBOL BACK, and this is the single largest thing in the 10500 bps path. - // - // The score above cannot tell the two arms apart. OQPSK is symmetric under "shift - // half a symbol and swap the arms", and the reference direction u is estimated - // from whatever sits at the candidate instant - so at the swapped instant u simply - // rotates 90 degrees with the arms and the score comes out the same. The criterion - // has two near-equal maxima half a symbol apart and takes whichever the noise - // favours; on the recording it took the wrong one. - // - // Measured over the whole of samples/10.5k_sample.ogg, sweeping the instant across - // the full symbol: a good region from -13 to -7 samples peaking at -10, and a - // second, worse one around 0 where the search actually lands, with a hole between - // them. -10 is exactly m_sps / 2. That is a structural quantity, not a fitted - // constant, and the plateau is six samples wide, so this is not knife edge. - // - // offset 0 -> 119 frames, 1274/3094 signal units (41%), 12 messages - // offset -10 -> 118 frames, 1820/3068 signal units (59%), 16 messages - // - // Fixing u across the candidates instead was tried, to break the symmetry - // honestly rather than by construction, and is worse than either - it scores zero - // signal units, because the u taken at the search centre is itself on the wrong - // arm, so the criterion is circular. A Gardner loop over the data does not help - // either: it is symmetric under the same shift, so it cannot choose between the - // two maxima, and as an error detector here it measures biased and walks off. - if (best < 0.0) { - // Every candidate was refused by the phase constraint, so the clock has moved - // further than drift explains. Take the lock off and let the next frame - // re-establish it rather than dropping the frame. - m_lockedPhase = -1; - m_framePhase = -1; - return ago - m_sps / 2; - } - - int chosen = ago + bestOffset - m_sps / 2; - - // HOLD THE PHASE ONCE IT IS KNOWN. The two maxima above are half a symbol apart - // and the search is re-run for every frame, so without this it is free to hop - // between them frame by frame - and a frame started on the wrong one decodes to - // NOTHING. On a noiseless generated channel that showed up as every frame being - // either 26 of 26 signal units or 0 of 26 and never anything between, with the - // dead frames exactly accounted for by the header check rejecting them. - // - // A symbol clock cannot physically move half a symbol between frames - that would - // be a 5% clock error - so a jump that large is always the alias and never the - // signal. Anything further than ACARSAERO_TIMING_PULL samples from the phase - // already locked is pulled back to it, which leaves ordinary drift free to track - // and puts the alias out of reach. - // - // The phase is locked ON EVIDENCE, not on the first frame: the search picks the - // wrong maximum often enough at acquisition that locking whatever it chose first - // is WORSE than re-searching every frame (78 of 208 signal units against 104). - // It is committed only once a frame has actually decoded - see decodeFrame() - - // and released again as soon as one does not, so a wrong choice costs one frame - // rather than the whole lock. - m_framePhase = instantPhase(chosen); - return chosen; - } - - // ago is how many samples back the correlation peak sits, so the last unique word - // symbol is at tap(ago) and the next symbol arrives m_sps - ago samples from now - // How long the next symbol should be, in samples. - // - // The unique word re-locks the symbol timing at the start of every frame, and nothing - // tracked it in between - so any steady slip walked the sampling instant further off - // the further in to the frame it got, and the frame degraded from its first signal - // unit to its last. On a live capture that was dropping samples this cost the last - // unit of each frame five times the error rate of the first, inside two seconds. - // - // The slip is already measured: trackUniqueWord() finds the word in a one symbol - // window centred on where it predicted, so the offset of the peak from the centre IS - // the accumulated slip over the frame just gone. Spreading that over the next frame - - // Bresenham fashion, lengthening or shortening the odd symbol by one sample - holds - // the instant where it belongs without a timing loop, an interpolator, or any change - // to how a symbol is taken. - void nextSymbolPeriod() - { - m_symPeriod = m_sps; - if (!m_config.m_timingSlope) { - return; - } - m_timingAcc += m_timingRate; - if (m_timingAcc >= 0.5) - { - m_symPeriod++; - m_timingAcc -= 1.0; - } - else if (m_timingAcc <= -0.5) - { - m_symPeriod--; - m_timingAcc += 1.0; - } - } - - //! Symbols from the end of one unique word to the end of the next - int symbolsPerCycle() const - { - if (m_channel != ChannelP) { - return 0; // Bursts re-acquire every time; there is no cycle - } - return ACARSAERO_UW_LEN + ACARSAERO_HEADER_LEN - + codedBitsPerFrame(m_rate) + dummyBits(m_rate); - } - - // Turn the offset of the tracked unique word from its predicted position in to a - // per symbol correction for the frame that follows - void measureTimingSlip(int bestAgo) - { - const int cycle = symbolsPerCycle(); - if (!m_config.m_timingSlope || (cycle <= 0)) { - return; - } - // The window is one symbol wide and centred on the prediction, so a word found - // at the centre means the timing held. Early means the frame arrived in fewer - // samples than expected, which is a clock running slow or samples going missing. - const double slip = (m_sps / 2.0) - (double) bestAgo; - const double rate = slip / (double) cycle; - m_timingRate = (1.0 - m_config.m_timingSlopeGain) * m_timingRate - + m_config.m_timingSlopeGain * rate; - } - - void startFrame(int ago) - { - m_symPeriod = m_sps; - m_timingAcc = 0.0; - m_sclk = ago; - m_symbolCount = 0; - m_magMean = 0.0; - m_headerBits.clear(); - m_softBits.clear(); - m_burstBits.clear(); - m_burstCols = 0; - // The symbol the last unique word bit ended on is the reference the first data - // bit's differential detection works against - m_prevSym = tap(ago); - if (isOqpsk(m_rate)) { - seedOqpsk(ago); - } else { - seedCoherent(ago); - } - m_state = (m_channel == ChannelP) ? StateHeader : StateBurst; - if (m_state == StateBurst) - { - // R and T bursts have no header; the data field starts immediately - m_burstBits.reserve((size_t) ACARSAERO_INTERLEAVER_ROWS * ACARSAERO_BURST_MAX_COLS); - m_burstTargetSus = 0; - } - } - - - // Seed the OQPSK carrier from the unique word on the I arm, which carries its 32 - // bits directly. Both the phase and the per symbol rotation come out of the same - // pass: the vector sum with the modulation stripped gives the phase, and the mean - // symbol to symbol product of those stripped symbols gives the rotation. - void seedOqpsk(int ago) - { - Cd acc(0.0, 0.0); - Cd rot(0.0, 0.0); - Cd prev(0.0, 0.0); - - for (int k = 0; k < ACARSAERO_UW_LEN; k++) - { - Cd v = tap(ago + (ACARSAERO_UW_LEN - 1 - k) * m_sps) * (uwBit(k) ? 1.0 : -1.0); - acc += v; - if (k) { - rot += v * std::conj(prev); - } - prev = v; - } - - double mag = std::abs(acc); - if (mag > 1e-12) - { - m_ref = acc / mag; - m_cohValid = true; - m_oqpskInit = true; - } - else - { - m_ref = Cd(1.0, 0.0); - m_cohValid = false; - m_oqpskInit = false; - } - m_dphiSym = (std::abs(rot) > 1e-12) ? std::arg(rot) : 0.0; - - // CARRY THE FREQUENCY ACROSS FRAMES. The unique word is only 32 symbols, so the - // rotation estimated from it is coarse - and a 10500 bps frame is 2625 symbols - // long, over which even a tiny error winds up into a phase the loop then has to - // chase from behind. With the loop frozen (gains at zero) a NOISELESS channel - // decodes nothing at all, which is the proof: what the loop mostly does is not - // track a real carrier offset, it repairs this seed. - // - // A P channel is continuous and the offset is a property of the receiver and the - // satellite, not of the frame, so the value the loop has converged on by the END - // of a good frame is a far better seed for the next one than the unique word can - // ever be. Only carried from a frame that actually decoded, so a bad frame cannot - // poison the next - the same evidence gate the symbol clock phase uses. - if (m_haveCarriedDphi) { - m_dphiSym = m_carriedDphi; - } - m_magMeanCoh = 0.0; - } - - // One OQPSK symbol: two bits. The Q arm is sampled HALF A SYMBOL BEFORE the I - // instant, and the stream carries the Q bit first and then the I bit - which is - // JAERO's order, pushing imag() then real() of each constellation point. The Q arm - // also comes out inverted relative to I. All three were established against the - // recording; none of them is guessable. - void oqpskSymbol(uint8_t& softQ, uint8_t& softI) - { - if (!m_oqpskInit) - { - softQ = softI = 128; - return; - } - - m_ref *= std::polar(1.0, m_dphiSym); - - const Cd yI = tap(0); - const Cd yQ = tap(m_sps / 2); - - double sI = (yI * std::conj(m_ref)).real(); - double sQ = (yQ * std::conj(m_ref)).imag(); - - // Decision-directed update from both arms. The Q arm is rotated onto the real - // axis before it is blended in, so the two contribute symmetrically. - const double signI = (sI >= 0.0) ? 1.0 : -1.0; - const double signQ = (sQ >= 0.0) ? 1.0 : -1.0; - - Cd dI = yI * signI; - Cd dQ = yQ * Cd(0.0, -1.0) * signQ; - - for (int i = 0; i < 2; i++) - { - Cd d = i ? dQ : dI; - double mag = std::abs(d); - if (mag < 1e-12) { - continue; - } - d /= mag; - m_dphiSym += m_config.m_oqpskFreqGain * std::arg(d * std::conj(m_ref)); - m_ref = (1.0 - m_config.m_oqpskRefGain) * m_ref + m_config.m_oqpskRefGain * d; - } - double refMag = std::abs(m_ref); - if (refMag > 1e-12) { - m_ref /= refMag; - } - - double mag = 0.5 * (std::abs(sI) + std::abs(sQ)); - m_magMeanCoh = (m_magMeanCoh > 0.0) ? (0.995 * m_magMeanCoh + 0.005 * mag) : mag; - double scale = (m_magMeanCoh > 1e-12) ? m_magMeanCoh : 1.0; - - auto quantise = [scale](double v) - { - return (uint8_t) std::max(0.0, std::min(255.0, 128.0 + (v / scale) * 110.0)); - }; - softQ = quantise(-sQ); // The Q arm is inverted with respect to I - softI = quantise(sI); - } - - // Seed the coherent lane from the unique word, which is a known sequence and so a - // free training burst: reconstruct the precoded symbols it must have produced, strip - // them off, de-rotate by the frequency estimate the correlator already gave us, and - // average. 33 symbols of data-aided estimate is a far better starting phase than - // anything a decision-directed loop reaches on its own within a frame. - // - // The overall sign of the reconstruction is arbitrary (b[0] is taken as +1), which - // does not matter: the differential decode downstream cancels any constant sign. - void seedCoherent(int ago) - { - m_dphiSym = m_dphi; - - Cd acc(0.0, 0.0); - double b = 1.0; - - for (int i = 0; i <= ACARSAERO_UW_LEN; i++) - { - // Symbol i of the unique word span sits (UW_LEN - i) symbols before the - // reference symbol, which is itself at tap(ago) - Cd y = tap(ago + (ACARSAERO_UW_LEN - i) * m_sps); - int n = i - ACARSAERO_UW_LEN; // Index relative to the reference - acc += derotate(y, n) * b * std::polar(1.0, -n * m_dphiSym); - - if (i < ACARSAERO_UW_LEN) { - b *= uwBit(i) ? 1.0 : -1.0; - } - } - - double mag = std::abs(acc); - if (mag > 1e-12) - { - m_ref = acc / mag; - m_cohValid = true; - } - else - { - m_ref = Cd(1.0, 0.0); - m_cohValid = false; - } - // The reference symbol's own projection starts the differential decode - m_projPrev = (derotate(tap(ago), 0) * std::conj(m_ref)).real(); - } - - // One coherent symbol: project onto the tracked reference, decide, feed the - // frequency and reference loops, then combine with the previous projection to undo - // MSK's precoding. - // - // The combination is min-sum, not the product the differential lane uses. Two soft - // values feeding an exclusive-or have log-likelihood - // 2 atanh(tanh(a/2) tanh(b/2)), and sign(ab) min(|a|,|b|) is its standard - // approximation - the same one every LDPC and turbo decoder uses. A raw product - // would let one confident symbol inflate an unreliable one. - uint8_t softBitCoherent(const Cd& sym, int index) - { - if (!m_cohValid) { - return 128; - } - - Cd u = derotate(sym, index); - const Cd refUsed = m_ref * std::polar(1.0, m_dphiSym); - - // Keep the reference phase UNWRAPPED. Smoothing has to happen in the phase - // domain, not by averaging the phasor: a reference that is rotating - which it - // is whenever there is any carrier offset - averages towards zero magnitude and - // a biased angle, whereas a linear phase ramp averages to its own centre value - // exactly. - { - double p = std::arg(refUsed); - double d = p - m_refPhaseAcc; - while (d > M_PI) { d -= 2.0 * M_PI; } - while (d < -M_PI) { d += 2.0 * M_PI; } - m_refPhaseAcc += d; - } - m_symBuf.push_back(u); - m_refPhase.push_back(m_refPhaseAcc); - - Cd proj = u * std::conj(refUsed); - double s = proj.real(); - double sign = (s >= 0.0) ? 1.0 : -1.0; - - // Phase error with the decision removed, for the frequency loop - double residual = std::arg(proj * sign); - m_dphiSym += m_config.m_freqGain * residual; - - // Reference blend, decision-directed. updateRef does the one symbol prediction. - double mag = std::abs(u); - Cd yDemod = (mag > 1e-12) ? (u * sign / mag) : Cd(1.0, 0.0); - m_ref *= std::polar(1.0, m_dphiSym); - m_ref = (1.0 - m_config.m_refGain) * m_ref + m_config.m_refGain * yDemod; - double refMag = std::abs(m_ref); - if (refMag > 1e-12) { - m_ref /= refMag; - } - - m_magMeanCoh = (m_magMeanCoh > 0.0) - ? (0.99 * m_magMeanCoh + 0.01 * std::abs(s)) : std::abs(s); - double scale = (m_magMeanCoh > 1e-12) ? m_magMeanCoh : 1.0; - - // Error vector magnitude, from the IN PHASE component only. - // - // The textbook EVM would include the quadrature error too, but for MSK the - // imaginary axis of a derotated symbol carries the ORTHOGONAL arm's crosstalk - - // large, data dependent and nothing to do with signal quality. Including it - // would report a terrible EVM on a perfect signal. What is left is the amplitude - // error about the decision, which for BPSK in noise is sigma/A and so still - // tracks SNR: about 30% at 10 dB Es/N0, 10% at 20 dB. - // - // Exponentially averaged rather than accumulated, so it describes the signal now - // rather than the whole session. - const double evmErr = std::abs(s) / scale - 1.0; - m_evmMeanSq = (m_evmMeanSq > 0.0) - ? (0.999 * m_evmMeanSq + 0.001 * evmErr * evmErr) - : evmErr * evmErr; - - double a = s / scale; - double p = m_projPrev / scale; - m_projPrev = s; - - double v = ((a * p) >= 0.0 ? 1.0 : -1.0) * std::min(std::abs(a), std::abs(p)); - return (uint8_t) std::max(0.0, std::min(255.0, 128.0 + v * 110.0)); - } - - // Second pass over the frame: SMOOTH the tracking loop's carrier reference, using - // symbols from both sides of each instant, and detect against that instead. - // - // The loop is causal and first order - at a blend of 0.30 its memory is about three - // symbols, so its phase is nearly as noisy as one symbol, and it necessarily lags - // whatever it follows. A receiver that buffers a whole frame before decoding is - // under no such constraint: it can look forwards as well as backwards. That is the - // one advantage this pass takes, and it is the only smoother in the receiver. - // - // Phase accuracy earns more here than it would on plain BPSK. In the derotated view - // of MSK the orthogonal arm sits entirely in quadrature, so the real part rejects it - // exactly - but only while the reference is right. An error of theta both attenuates - // the wanted arm by cos(theta) and leaks the other one in at sin(theta), and that - // second term is interference, not noise. - // - // Smoothing the reference is deliberately modest. Fitting a carrier MODEL to the - // frame - a constant phase and a constant frequency - measures better still when it - // is handed the right frequency (359 messages against 289), but nothing available - // estimates that frequency well enough to extrapolate over 1152 symbols: squaring, - // the textbook decision-free method for BPSK, is destroyed by the crosstalk on the - // imaginary axis and returned half a radian per symbol on a signal with no offset at - // all; stripping the modulation with the decisions is bistable, because one wrong - // decision flips a term rather than shrinking it; and the loop's own integrator is a - // control signal, not an estimate. Smoothing needs no frequency estimate at all. - void smoothCoherent() - { - const size_t n = m_symBuf.size(); - if (!m_cohValid || (n < 64) || (m_softBitsCoh.size() != n) || (m_refPhase.size() != n)) { - return; - } - - const int half = std::max(1, m_config.m_smoothHalf); - - // Running sum, so the window costs one add and one subtract per symbol - std::vector prefix(n + 1, 0.0); - for (size_t i = 0; i < n; i++) { - prefix[i + 1] = prefix[i] + m_refPhase[i]; - } - - double magMean = 0.0; - std::vector proj(n); - - for (size_t i = 0; i < n; i++) - { - size_t from = (i > (size_t) half) ? (i - half) : 0; - size_t to = std::min(n, i + half + 1); - double mean = (prefix[to] - prefix[from]) / (double) (to - from); - - // A centred average of a phase ramp gives the ramp's value at the window - // centre, which is only this symbol when the window is not clipped by an - // end of the frame. Correct for that with the local slope. - double centre = 0.5 * (double) (from + to - 1); - double slope = (n > 1) ? ((m_refPhase[n - 1] - m_refPhase[0]) / (double) (n - 1)) : 0.0; - double phase = mean + slope * ((double) i - centre); - - proj[i] = (m_symBuf[i] * std::polar(1.0, -phase)).real(); - magMean += std::abs(proj[i]); - } - - magMean = (n > 0) ? (magMean / n) : 1.0; - if (magMean < 1e-12) { - return; - } - - double prev = m_projPrevFirst; - for (size_t i = 0; i < n; i++) - { - double a = proj[i] / magMean; - double p = prev / magMean; - prev = proj[i]; - double v = ((a * p) >= 0.0 ? 1.0 : -1.0) * std::min(std::abs(a), std::abs(p)); - m_softBitsCoh[i] = (uint8_t) std::max(0.0, std::min(255.0, 128.0 + v * 110.0)); - } - } - - // Soft bit from differential detection, 255 = strong 1. - // - // Scaled by a running mean of the product magnitude rather than per symbol. - // Normalising each symbol by its own magnitude throws away exactly the information - // the Viterbi decoder wants: a symbol landing near the origin is the one that - // should be marked uncertain, and dividing by its own small magnitude instead - // promotes it to full confidence. - uint8_t softBit(const Cd& sym) - { - // Remove the carrier offset estimated at acquisition so the product stays on - // the real axis over the whole frame - Cd d = differential(sym, m_prevSym) * std::polar(1.0, -m_dphi); - m_prevSym = sym; - - double mag = std::abs(d); - m_magMean = (m_magMean > 0.0) ? (0.99 * m_magMean + 0.01 * mag) : mag; - double ref = (m_magMean > 1e-12) ? m_magMean : 1.0; - // The scale factor here is not a tuning knob and was measured not to be one. - // viterbiDecode's branch metric is |s - 255c|, so the difference between the - // two branches is exactly 2s - 255: affine in s, which makes the survivor - // decisions invariant to any positive scaling of the soft values. Sweeping this - // from 1 to 1000 changed nothing at all, at any Eb/N0. 110 simply uses most of - // the range without clipping typical symbols. - double scaled = 128.0 + (d.real() / ref) * 110.0; - return (uint8_t) std::max(0.0, std::min(255.0, scaled)); - } - - void processSymbol() - { - m_symbolCount++; // Symbols since the unique word - - if (isOqpsk(m_rate)) - { - // Two bits per symbol, and no differential lane: OQPSK is not precoded, so - // there is nothing for a differential detector to recover - uint8_t softQ, softI; - oqpskSymbol(softQ, softI); - consumeSoftBit(softQ, 128); - if (m_state != StateSearch) { - consumeSoftBit(softI, 128); - } - return; - } - - // The coherent lane has to see tap(0) BEFORE the differential lane consumes it, - // because softBit advances m_prevSym - uint8_t softCoh = m_config.m_coherent ? softBitCoherent(tap(0), m_symbolCount) : 128; - uint8_t soft = softBit(tap(0)); - consumeSoftBit(soft, softCoh); - } - - void consumeSoftBit(uint8_t soft, uint8_t softCoh) - { - switch (m_state) - { - case StateHeader: - m_headerBits.push_back((uint8_t) (soft >= 128 ? 1 : 0)); - if ((int) m_headerBits.size() == ACARSAERO_HEADER_LEN) - { - uint16_t header = 0; - for (uint8_t b : m_headerBits) { - header = (uint16_t) ((header << 1) | b); - } - int distance = headerDistance(header); - if (distance > 0) { - m_stats.m_headerBad++; - } - - if (distance > m_config.m_headerMaxErrors) - { - m_stats.m_headerRejected++; - m_state = StateSearch; - m_syncPending = false; - m_missedFrames = 0; - } - else - { - m_header = header; - m_softBits.clear(); - m_softBitsCoh.clear(); - // The buffers must start where the soft bits do - m_symBuf.clear(); - m_refPhase.clear(); - m_projPrevFirst = m_projPrev; - // The symbol buffer has to start where the soft bits do, or the - // refit's own length check quietly disables it - m_softBits.reserve(codedBitsPerFrame(m_rate) + dummyBits(m_rate)); - m_softBitsCoh.reserve(codedBitsPerFrame(m_rate) + dummyBits(m_rate)); - m_state = StateData; - } - } - break; - - case StateData: - m_softBits.push_back(soft); - m_softBitsCoh.push_back(softCoh); - if ((int) m_softBits.size() == codedBitsPerFrame(m_rate) + dummyBits(m_rate)) - { - decodeFrame(); - armTracking(); - } - break; - - case StateBurst: - m_burstBits.push_back(soft); - tryBurstDecode(); - break; - - default: - break; - } - } - - // Bits that would have to flip to make this a legal header: the format ID nibble - // must read 1, and the two copies of the frame counter must agree. The super frame - // marker is unconstrained, so it never contributes. 0 means already legal, 8 is the - // worst case. - static int headerDistance(uint16_t header) - { - auto bits = [](unsigned v) - { - int n = 0; - while (v) { n += (int) (v & 1); v >>= 1; } - return n; - }; - return bits((unsigned) (((header >> 12) & 0x0F) ^ 0x01)) - + bits((unsigned) (((header >> 4) & 0x0F) ^ (header & 0x0F))); - } - - static bool headerValid(uint16_t header) { return headerDistance(header) == 0; } - - // --------------------------------------------------------------------------------- - // Frame decode: deinterleave block by block, Viterbi, descramble, split into - // signal units - // --------------------------------------------------------------------------------- - - // Deinterleave, Viterbi, descramble and pack one lane's soft bits into octets. - // - // The frame is decoded with BOTH ends of the encoder unknown. The start is unknown - // because the P channel encoder runs continuously across frame boundaries, and the - // end because the frame is exactly full of data with no room for a flush. - // - // Handing the previous frame's final state over as this frame's start looks free - - // the encoder is continuous, so it is even exact in principle - and measures worse: - // the first signal unit fell from 95% to 81%. The reason is that the state handed - // over comes from the traceback's END, which is precisely the unflushed part of the - // previous frame and so its least reliable bits. Being confidently wrong about the - // start state costs more than admitting it is unknown. - void decodeLane(const std::vector& soft, std::vector& octets) const - { - const int cols = interleaverCols(m_rate); - const int blockLen = ACARSAERO_INTERLEAVER_ROWS * cols; - const int coded = codedBitsPerFrame(m_rate); - const int dummies = dummyBits(m_rate); - - // Decoding THROUGH the frame boundary was tried and made no difference at all. - // The last signal unit sits at the traceback's starting edge, so extending the - // block with the next frame's first interleaver block - a genuine continuation, - // because the P channel encoder runs continuously - should have given the - // traceback a future to converge on. On a live capture whose signal units fell - // 87/87/82/77/74/74 percent across the frame it moved the total from 1250 to - // 1251 of 1560, and left the profile unchanged. So the traceback converges long - // before the frame ends, and whatever costs the later units is not this. - std::vector de(coded); - for (int b = 0; b < coded / blockLen; b++) - { - deinterleave(soft.data() + dummies + b * blockLen, cols, - de.data() + b * blockLen); - } - - // Neither end of the frame is a known encoder state: the P channel encoder runs - // continuously across frame boundaries (measured - forcing state 0 at the start - // cost the first signal unit of three frames in four on a real recording), and - // there is no flush at the end because the frame is exactly full of data. - std::vector bits; - AcarsHfdlReceiver::viterbiDecode(de, coded / 2, bits, false, false); - - octets.assign(bits.size() / 8, 0); - for (size_t i = 0; i < bits.size(); i++) - { - uint8_t b = (uint8_t) (bits[i] ^ scramblerBit((int) i)); - octets[i / 8] = (uint8_t) (octets[i / 8] | (b << (i % 8))); - } - } - - // Both lanes are decoded and the CRC arbitrates PER SIGNAL UNIT, not per frame: a - // carrier slip part way through a frame costs the coherent lane only the units after - // it, and the differential lane covers those. Neither lane can lose a unit the other - // would have got, which is the same guarantee HFDL's equalizer lane gives. - void decodeFrame() - { - // OQPSK has no differential lane to arbitrate against - it is not precoded, so - // there is nothing for a differential detector to recover - and its coherent - // output goes straight into the primary soft bits - if (m_config.m_coherent && m_config.m_smooth && !isOqpsk(m_rate)) { - smoothCoherent(); - } - - std::vector octets; - decodeLane(m_softBits, octets); - - std::vector octetsCoh; - bool haveCoh = m_config.m_coherent && m_cohValid && !isOqpsk(m_rate) - && (m_softBitsCoh.size() == m_softBits.size()); - if (haveCoh) { - decodeLane(m_softBitsCoh, octetsCoh); - } - - m_stats.m_framesDecoded++; - int suOkThisFrame = 0; - - for (size_t i = 0; i + ACARSAERO_SU_LEN <= octets.size(); i += ACARSAERO_SU_LEN) - { - const uint8_t *diff = octets.data() + i; - bool diffOk = suCrcOk(diff, ACARSAERO_SU_LEN); - size_t pos = i / ACARSAERO_SU_LEN; - bool anyOk = diffOk; - - if (!anyOk && haveCoh && (i + ACARSAERO_SU_LEN <= octetsCoh.size())) { - anyOk = suCrcOk(octetsCoh.data() + i, ACARSAERO_SU_LEN); - } - if (pos < ACARSAERO_MAX_SUS) - { - if (anyOk) { - m_stats.m_suOkByPos[pos]++; - } else { - m_stats.m_suBadByPos[pos]++; - } - } - if (anyOk) { - suOkThisFrame++; - } - - if (diffOk) - { - m_stats.m_suFromDifferential++; - processSignalUnit(diff, ACARSAERO_SU_LEN); - continue; - } - - if (haveCoh && (i + ACARSAERO_SU_LEN <= octetsCoh.size())) - { - const uint8_t *coh = octetsCoh.data() + i; - if (suCrcOk(coh, ACARSAERO_SU_LEN)) - { - m_stats.m_suFromCoherent++; - processSignalUnit(coh, ACARSAERO_SU_LEN); - continue; - } - } - - // Neither lane passed. Hand the differential one over anyway so the fill and - // bad-CRC counters stay comparable with the single lane build. - processSignalUnit(diff, ACARSAERO_SU_LEN); - } - - // Commit the symbol clock phase this frame ran on if it decoded, and FLIP TO THE - // ALIAS if it did not. - // - // Nothing in the unique word can choose between the two phases - OQPSK carries - // the same 32 bit word on BOTH arms (see uwBits()), so the two are genuinely - // indistinguishable there, which is why every criterion tried on it landed on the - // wrong one about half the time. But there are only ever TWO candidates, half a - // symbol apart, so a frame that decodes nothing has already identified the other - // one as correct. That turns a coin flip repeated every frame into at most one - // wasted frame per acquisition. - // - // A frame started on the wrong phase yields ZERO signal units, never a few, so - // this is a clean signal rather than a threshold. - if (isOqpsk(m_rate) && (suOkThisFrame > 0)) - { - // Taken outright rather than averaged over frames: blending the previous - // value in at 0.5, 0.3 and 0.15 measured identical to the message, because - // the loop converges to the same figure inside every frame and there is - // almost no frame to frame variance left to average away. - m_carriedDphi = m_dphiSym; - m_haveCarriedDphi = true; - } - - if (isOqpsk(m_rate) && (m_framePhase >= 0)) - { - if (suOkThisFrame > 0) - { - m_lockedPhase = m_framePhase; - m_phaseConfirmed = true; - m_phaseFailures = 0; - } - else if (!m_phaseConfirmed - || (++m_phaseFailures >= ACARSAERO_PHASE_FAILURES)) - { - // Flip to the other candidate. Only ever on an UNCONFIRMED phase, or - // after several consecutive dead frames on a confirmed one: a frame that - // decodes nothing means the wrong arm at high SNR, but near the cliff it - // usually just means noise, and flipping then throws away a phase that was - // right. Doing it unconditionally cost most of the sensitivity - header - // rejections ran to 18 of 24 frames at 5 dB because each noise-killed - // frame flipped the lock and broke the next one too. - m_lockedPhase = (m_framePhase + m_sps / 2) % m_sps; - m_phaseConfirmed = false; - m_phaseFailures = 0; - } - } - expireReassemblies(); - } - - // --------------------------------------------------------------------------------- - // R/T bursts. An R burst is five interleaver columns holding one 19 octet signal - // unit. A T burst is five columns of header - a 6 octet header with its own CRC - - // then three columns per 12 octet signal unit, so every three column boundary is a - // candidate end of burst and is tried until the CRCs pass. - // --------------------------------------------------------------------------------- - - void tryBurstDecode() - { - const int rows = ACARSAERO_INTERLEAVER_ROWS; - int filled = (int) m_burstBits.size(); - - if ((filled % rows) != 0) { - return; - } - int cols = filled / rows; - if (cols < ACARSAERO_BURST_HEAD_COLS) { - return; - } - if (((cols - ACARSAERO_BURST_HEAD_COLS) % ACARSAERO_BURST_SU_COLS) != 0) { - return; - } - if (cols > ACARSAERO_BURST_MAX_COLS) - { - abandonBurst(); - return; - } - - std::vector de(filled); - if (isOqpsk(m_rate)) { - deinterleave(m_burstBits.data(), cols, de.data()); - } else { - deinterleaveBurstMsk(m_burstBits.data(), cols, de.data()); - } - - std::vector bits; - AcarsHfdlReceiver::viterbiDecode(de, filled / 2, bits, false); - - std::vector octets(bits.size() / 8, 0); - for (size_t i = 0; i < bits.size(); i++) - { - uint8_t b = (uint8_t) (bits[i] ^ scramblerBit((int) i)); - octets[i / 8] = (uint8_t) (octets[i / 8] | (b << (i % 8))); - } - - if (cols == ACARSAERO_BURST_HEAD_COLS) - { - // An R burst is one 19 octet signal unit - if ((m_channel == ChannelR) && (octets.size() >= ACARSAERO_R_SU_LEN) - && suCrcOk(octets.data(), ACARSAERO_R_SU_LEN)) - { - m_stats.m_bursts++; - processSignalUnit(octets.data(), ACARSAERO_R_SU_LEN); - endBurst(); - return; - } - // Otherwise it may be a T burst header, which has to pass its own CRC before - // any signal unit behind it is worth looking at - if ((m_channel == ChannelT) && (octets.size() >= ACARSAERO_T_HEADER_LEN) - && suCrcOk(octets.data(), ACARSAERO_T_HEADER_LEN)) { - return; // Keep accumulating signal units - } - // Neither an R signal unit nor a T header, so this was a false correlation. - // Give up now: holding on to the maximum burst length instead would leave - // the receiver deaf for seconds, which at 1200 symbols/s is most of a - // recording. Costing a false sync five columns bounds it to a quarter - // second. - abandonBurst(); - return; - } - - // T burst: the header, then one signal unit per three columns. - // - // How many signal units there are cannot be taken from the burst length, because - // the length is what we are trying to find. Accepting the first column count at - // which everything passes does not work either - the ISU alone passes its own CRC, - // so a ten unit burst was being accepted as a one unit burst and truncated, which - // is why generated T bursts yielded signal units but never a whole message. - // - // JAERO takes the count from SIX BITS at the start of signal unit ONE, read once - // eleven columns are in, as count = 2 + those bits. That works because the SSU - // sequence numbers count DOWN: unit one of an N unit chain carries SEQNO N-2, so - // 2 + SEQNO is N. The burst then ends at 5 + 3N columns, and no other length is - // worth testing. - // - // Like JAERO, this cannot decode a single unit T burst - the count lives in a - // unit that such a burst does not have. - if (!suCrcOk(octets.data(), ACARSAERO_T_HEADER_LEN)) { - return; - } - - if (m_burstTargetSus == 0) - { - const int probeCols = ACARSAERO_BURST_HEAD_COLS + 2 * ACARSAERO_BURST_SU_COLS; - if (cols < probeCols) { - return; - } - size_t at = (size_t) ACARSAERO_T_HEADER_LEN + ACARSAERO_SU_LEN; - if (octets.size() <= at) { - return; - } - int count = 2 + (octets[at] & 0x3F); - if (count >= 16) { - count = count / 2 + 1; - } - if ((count < 2) || (ACARSAERO_BURST_HEAD_COLS + count * ACARSAERO_BURST_SU_COLS - > ACARSAERO_BURST_MAX_COLS)) - { - abandonBurst(); - return; - } - m_burstTargetSus = count; - } - - if (cols != ACARSAERO_BURST_HEAD_COLS + m_burstTargetSus * ACARSAERO_BURST_SU_COLS) { - return; - } - - int sus = m_burstTargetSus; - if ((int) octets.size() < ACARSAERO_T_HEADER_LEN + sus * ACARSAERO_SU_LEN) { - return; - } - for (int i = 0; i < sus; i++) - { - if (!suCrcOk(octets.data() + ACARSAERO_T_HEADER_LEN + i * ACARSAERO_SU_LEN, - ACARSAERO_SU_LEN)) { - return; // Not the end of the burst yet - } - } - - m_stats.m_bursts++; - for (int i = 0; i < sus; i++) { - processSignalUnit(octets.data() + ACARSAERO_T_HEADER_LEN + i * ACARSAERO_SU_LEN, - ACARSAERO_SU_LEN); - } - endBurst(); - } - - void endBurst() - { - m_state = StateSearch; - m_syncPending = false; - m_burstBits.clear(); - m_burstTargetSus = 0; - expireReassemblies(); - } - - // --------------------------------------------------------------------------------- - // Signal units - // --------------------------------------------------------------------------------- - - void processSignalUnit(const uint8_t *su, int len) - { - if (!suCrcOk(su, len)) - { - // Real P channels transmit all zero signal units as fill, and their CRC - // field is zero rather than a real CRC over zeros - if (m_config.m_acceptZeroFill && allZero(su, len)) - { - m_stats.m_suFill++; - return; - } - m_stats.m_suCrcBad++; - m_suRate = (m_suRate < 0.0) ? 0.0 : (0.95 * m_suRate + 0.05 * 0.0); - return; - } - - m_stats.m_suCrcOk++; - m_suRate = (m_suRate < 0.0) ? 1.0 : (0.95 * m_suRate + 0.05 * 1.0); - uint8_t type = su[0]; - - if (type == SuFill) - { - m_stats.m_suFill++; - return; - } - - if (type == SuUserDataIsu) - { - handleIsu(su, len); - return; - } - if (isSsu(type)) - { - handleSsu(su, len); - return; - } - - if (m_config.m_emitNonAcars) { - emitNonAcars(su, len); - } - } - - void handleIsu(const uint8_t *su, int len) - { - (void) len; - m_stats.m_isus++; - - IsuKey key; - key.m_aesId = ((uint32_t) su[1] << 16) | ((uint32_t) su[2] << 8) | su[3]; - key.m_gesId = su[4]; - key.m_qNo = (uint8_t) ((su[5] >> 4) & 0x0F); - key.m_refNo = (uint8_t) (su[5] & 0x0F); - - // Only evict for a genuinely NEW key. An ISU for a chain already in progress - - // a retransmission, or a replacement after the ground station starts the chain - // again - does not grow the map, so evicting to make room for it would destroy - // an unrelated live chain for nothing. - if ((m_reassembly.find(key) == m_reassembly.end()) - && ((int) m_reassembly.size() >= m_config.m_maxReassemblies)) { - dropOldestReassembly(); - } - - Reassembly& r = m_reassembly[key]; - r.m_remaining = su[6] & 0x3F; - r.m_lastOctets = (su[7] >> 4) & 0x0F; - r.m_started = m_time; - r.m_data.assign(su + 8, su + 10); - - if (r.m_remaining == 0) - { - completeReassembly(key, r); - m_reassembly.erase(key); - } - } - - void handleSsu(const uint8_t *su, int len) - { - (void) len; - m_stats.m_ssus++; - - int seqNo = su[0] & 0x3F; - uint8_t qNo = (uint8_t) ((su[1] >> 4) & 0x0F); - uint8_t refNo = (uint8_t) (su[1] & 0x0F); - - // The queue and reference numbers plus the expected sequence number identify - // which chain this belongs to; the aircraft address appears only in the ISU. - // SEQNO counts down and is one BELOW the count still outstanding, so the first - // SSU of a chain of N carries N-1 and the last carries zero. - // - // (JAERO compares the aircraft address too, but an SSU does not carry one - it - // reuses whatever the last ISU parsed left in a shared scratch item. Matching - // on the queue and reference numbers alone, across all chains in flight, is - // what the fields actually support.) - for (auto it = m_reassembly.begin(); it != m_reassembly.end(); ++it) - { - if ((it->first.m_qNo != qNo) || (it->first.m_refNo != refNo)) { - continue; - } - if (it->second.m_remaining != seqNo + 1) { - continue; - } - - Reassembly& r = it->second; - r.m_remaining--; - if (r.m_remaining == 0) - { - int octets = r.m_lastOctets; - if ((octets < 1) || (octets > 8)) { - octets = 8; - } - r.m_data.insert(r.m_data.end(), su + 2, su + 2 + octets); - IsuKey key = it->first; - completeReassembly(key, r); - m_reassembly.erase(it); - } - else - { - r.m_data.insert(r.m_data.end(), su + 2, su + 10); - } - return; - } - - m_stats.m_ssuOrphan++; - } - - void completeReassembly(const IsuKey& key, const Reassembly& r) - { - m_stats.m_reassembled++; - - Frame f; - f.m_uplink = (m_channel == ChannelP); - f.m_aesId = key.m_aesId; - f.m_gesId = key.m_gesId; - f.m_bitRate = bitRate(m_rate); - f.m_channel = m_channel; - - if (looksLikeAcars(r.m_data)) - { - f.m_isAcars = true; - f.m_type = "ACARS"; - f.m_bytes = acarsBlock(r.m_data); - m_stats.m_acarsFrames++; - } - else - { - f.m_type = "User data"; - f.m_bytes = r.m_data; - m_stats.m_otherFrames++; - } - m_frames.push_back(f); - } - - void emitNonAcars(const uint8_t *su, int len) - { - Frame f; - f.m_uplink = (m_channel == ChannelP); - f.m_type = suTypeName(su[0]); - f.m_bitRate = bitRate(m_rate); - f.m_channel = m_channel; - f.m_bytes.assign(su, su + len - ACARSAERO_SU_CRC_LEN); - - // Signal units addressed to or from an aircraft carry the AES address in octets - // 1 to 3 and the GES in octet 4, the same place the user data ISU has them. - // Broadcasts do not - see suHasAesId() - if ((len >= 6) && suHasAesId(su[0])) - { - f.m_aesId = ((uint32_t) su[1] << 16) | ((uint32_t) su[2] << 8) | su[3]; - f.m_gesId = su[4]; - } - m_stats.m_otherFrames++; - m_frames.push_back(f); - } - - void abandonBurst() - { - m_stats.m_burstsBad++; - m_state = StateSearch; - m_syncPending = false; - m_burstBits.clear(); - m_burstTargetSus = 0; - } - - // Called once per decoded frame or finished burst, not per sample: an ISU/SSU chain - // spans several frames at 600 bps, so frame cadence is fine resolution for a - // timeout measured in a minute or two, and per-sample would be 19200 map walks a - // second for nothing. - void expireReassemblies() - { - if (m_reassembly.empty()) { - return; - } - for (auto it = m_reassembly.begin(); it != m_reassembly.end(); ) - { - if (m_time - it->second.m_started > m_config.m_reassemblyTimeout) - { - m_stats.m_reassemblyTimeouts++; - it = m_reassembly.erase(it); - } - else - { - ++it; - } - } - } - - void dropOldestReassembly() - { - auto oldest = m_reassembly.begin(); - for (auto it = m_reassembly.begin(); it != m_reassembly.end(); ++it) - { - if (it->second.m_started < oldest->second.m_started) { - oldest = it; - } - } - if (oldest != m_reassembly.end()) - { - m_stats.m_reassemblyTimeouts++; - m_reassembly.erase(oldest); - } - } - - uint16_t m_header = 0; -}; - -#endif // INCLUDE_ACARSAERO_H +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// The Inmarsat Classic Aero protocol parameters - the convolutional code and // +// its polynomials, the interleaver row permutation, the scrambler polynomial // +// and seed, the unique words, the frame and signal unit layouts, and the // +// ISU/SSU reassembly rules - were established by reading JAERO by Jonti Olds, // +// https://github.com/jontio/JAERO, MIT. The receiver below is an independent // +// implementation: no code is taken from it. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSAERO_H +#define INCLUDE_ACARSAERO_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util/crc.h" + +#include "acarshfdl.h" + +// Inmarsat Classic Aero (aviation SATCOM) receiver, ICAO Annex 10 Volume III and +// ARINC 741. +// +// Aero is the L band satellite protocol for ACARS, the complement to HFDL for oceanic +// aircraft. Three data rates are in scope: +// +// 600 bps MSK, 600 symbols/s +// 1200 bps MSK, 1200 symbols/s +// 10500 bps OQPSK, 5250 symbols/s, 2 bits per symbol +// +// and three channel types: +// +// P continuous TDM from the ground station (uplink, GES to aircraft) +// R random access bursts from the aircraft (downlink) +// T reserved TDMA bursts from the aircraft (downlink) +// +// Unlike HFDL, where the M1 sequence identifies the rate, an Aero channel's rate and +// type are properties of the frequency tuned, so both are settings rather than +// something detected. +// +// P CHANNEL FRAME +// +// UW (32 bits) 0xE15AE893, the same word at every MSK rate +// header (16 bits) uncoded, MSB first: +// 15-12 format ID (1 on a valid frame) +// 11-8 super frame marker +// 7-4 frame counter +// 3-0 frame counter, repeated +// data (1152 bits) coded, or 4992 bits at 10500 bps +// +// which is 1200 channel bits at 600 and 1200 bps - a 2.0 s frame at 600 bps and a +// 1.0 s frame at 1200 - and 5250 bits, a 0.5 s frame, at 10500 bps. Both copies of +// the frame counter are equal in a valid frame, which together with the format ID +// gives two cheap checks that a correlation was not a false alarm. +// +// RECEIVE CHAIN, in order: +// +// 1. matched filter (half sine over two symbol periods for MSK; RRC alpha 1.0 for +// OQPSK, designed at the symbol rate) +// 2. deinterleave a block of 64 rows x N columns, rows permuted by (i*27) mod 64, +// reading out[j*64 + i] = in[permute[i]*cols + j]. N is 6, 9 and 78 columns for +// 600, 1200 and 10500 bps, so a 600 bps frame is three blocks, 1200 bps is two +// and 10500 bps is one +// 3. soft decision Viterbi, K=7 rate 1/2, polynomials 0x6D/0x4F - byte for byte the +// polynomials HFDL uses, so AcarsHfdlReceiver::viterbiDecode is reused unchanged +// 4. descramble with an additive x^15 + x + 1 LFSR seeded 0x6959, restarted at every +// frame boundary (and at the start of every burst on R and T) +// 5. pack bits into octets LSB first +// 6. split into signal units and check each CRC +// +// SIGNAL UNITS are 12 octets on P and T (10 of payload then a CRC) and 19 octets on R +// (17 then a CRC). The CRC is CRC-16/X-25 - poly 0x1021, init 0xFFFF, reflected, final +// XOR 0xFFFF - stored little endian in the last two octets. (JAERO's own comment calls +// this GENIBUS; the function it actually calls is the reflected variant, and GENIBUS, +// which it also implements, is never used.) +// +// Octet 0 of a signal unit is its type. Type 0x71 is a user data ISU carrying the AES +// and GES addresses, a queue/reference number pair, the number of SSUs to follow and +// the first two octets of user data; SSUs are typed 0xC0 | SEQNO with SEQNO counting +// down to zero and carry eight more octets each (fewer in the last, per a count in the +// ISU). Reassembled, the user data is FF FF followed by a complete ARINC 618 ACARS +// block - SOH, mode, registration, TAK, label, block id, STX/ETX, text, ETX or ETB, +// a two octet BCS and DEL, with odd parity in bit 7 of every octet except the two +// leading FFs and the BCS. Dropping the two FFs therefore gives exactly the byte +// layout AcarsMessage::decode expects, so nothing has to be synthesised. +// +// MSK DETAIL. Consecutive MSK symbols differ by exactly +-90 degrees, so multiplying +// a symbol by the conjugate of its predecessor and then by -j lands the result on the +// real axis, positive for a one. That is the derotate-to-BPSK view of MSK +// (acarsoqpsk.h:47-50 uses the same identity for VHF ACARS) with the per symbol 90 +// degree rotation cancelled in the product, and it means that lane needs no carrier +// recovery at all. +// +// TWO LANES run over every frame and the signal unit CRC arbitrates between them, per +// unit. The differential lane above is the one that always works. The coherent lane +// tracks the carrier with a decision-directed loop seeded from the unique word - a known +// sequence, so a free 33 symbol training burst - and recovers the several dB that +// squaring the noise costs. Neither can lose a unit the other would have got. +// +// Unlike VHF ACARS, whose differential encoding cancels MSK's precoding so its arms +// carry data bits directly, Aero does not pre-encode, so a differential decode still +// follows coherent detection. The two coherent projections are combined with min-sum, +// the standard approximation to the exclusive-or of two log-likelihoods, rather than +// with a raw product that would let one confident symbol inflate an unreliable one. +// +// FRAME TRACKING. A P channel is continuous TDM, so once a frame has been decoded the +// next unique word is due at a known instant. The receiver confirms it inside a half +// symbol window there rather than searching, which both removes almost every false +// correlation and re-locks the symbol timing every frame. +// +// The polarity matters and is easy to get backwards: a one is when the phase does NOT +// reverse. The acquisition correlator cannot catch the mistake, because it correlates +// transitions and takes a magnitude, so an inverted convention correlates just as +// strongly against the unique word and then decodes to nothing at all. +// +// WHAT IS AND IS NOT IMPLEMENTED +// +// 600 and 1200 bps, P channel implemented and verified against a real recording +// 600 and 1200 bps, T bursts implemented and verified against a real recording +// 600 and 1200 bps, R bursts implemented, works end to end, but no recording +// containing R bursts exists to verify it against +// 10500 bps OQPSK not implemented, rateSupported() returns false +// + +#define ACARSAERO_MSK_CHANNEL_SAMPLE_RATE 19200 +#define ACARSAERO_OQPSK_CHANNEL_SAMPLE_RATE 105000 + +#define ACARSAERO_UW 0xE15AE893u +#define ACARSAERO_UW_LEN 32 +#define ACARSAERO_HEADER_LEN 16 +// How far the per-frame timing refinement may move the OQPSK symbol clock phase, in +// samples, before it is treated as the half-symbol alias rather than as ordinary drift +#define ACARSAERO_TIMING_PULL 3 +// Consecutive frames that must decode NOTHING before a symbol clock phase which has already +// been confirmed by a good frame is abandoned for the other half-symbol candidate +#define ACARSAERO_PHASE_FAILURES 3 + +#define ACARSAERO_INTERLEAVER_ROWS 64 +#define ACARSAERO_INTERLEAVER_ROW_STEP 27 +#define ACARSAERO_SCRAMBLER_SEED 0x6959 + +#define ACARSAERO_SU_LEN 12 // P and T channel signal unit, including its CRC +#define ACARSAERO_R_SU_LEN 19 // R channel signal unit, including its CRC +#define ACARSAERO_SU_CRC_LEN 2 + +// R bursts are five interleaver columns; a T burst is five for its header then three +// per signal unit. 95 columns is the largest JAERO ever allocates. +#define ACARSAERO_BURST_HEAD_COLS 5 +#define ACARSAERO_BURST_SU_COLS 3 +#define ACARSAERO_BURST_MAX_COLS 95 +#define ACARSAERO_T_HEADER_LEN 6 // 4 octets plus a CRC, checked on its own + +// Signal units in the largest frame (10500 bps carries 26), for the per-position stats +#define ACARSAERO_MAX_SUS 26 + +class AcarsAeroReceiver +{ +public: + typedef std::complex Cd; + + enum Rate + { + Rate600 = 0, + Rate1200, + Rate10500, + RateCount + }; + + enum ChannelType + { + ChannelP = 0, //!< Continuous TDM from the ground station + ChannelR, //!< Random access bursts from the aircraft + ChannelT //!< Reserved TDMA bursts from the aircraft + }; + + // The rate and channel combinations that exist on air, as one setting. Only the P + // channel runs at 10500 bps; R and T are the aircraft's low rate return links. + // Appending to this list is safe, reordering it is not - the value is serialised. + enum Submode + { + Submode600P = 0, + Submode1200P, + Submode10500P, + Submode600R, + Submode1200R, + Submode600T, + Submode1200T, + SubmodeCount + }; + + static int submodeRate(int submode) + { + switch (submode) + { + case Submode1200P: + case Submode1200R: + case Submode1200T: return Rate1200; + case Submode10500P: return Rate10500; + default: return Rate600; + } + } + + static int submodeChannel(int submode) + { + switch (submode) + { + case Submode600R: + case Submode1200R: return ChannelR; + case Submode600T: + case Submode1200T: return ChannelT; + default: return ChannelP; + } + } + + static const char *submodeName(int submode) + { + switch (submode) + { + case Submode600P: return "600 bps P"; + case Submode1200P: return "1200 bps P"; + case Submode10500P: return "10500 bps P"; + case Submode600R: return "600 bps R"; + case Submode1200R: return "1200 bps R"; + case Submode600T: return "600 bps T"; + case Submode1200T: return "1200 bps T"; + default: return "?"; + } + } + + // A sensible channel filter width for a submode, in Hz - what the RF bandwidth + // control should default to, not the occupied bandwidth. + // + // MSK occupies about 1.2 times the bit rate with its main lobe out to 0.75 times + // it, and OQPSK with roll-off 1.0 occupies twice the symbol rate. The sink sets the + // interpolator cutoff to bandwidth/2.2, so a default equal to the occupied + // bandwidth would put the cutoff inside the main lobe; twice the bit rate (and 2.5 + // times the symbol rate for OQPSK) leaves the passband clear with a little margin + // for tuning error. Being slightly wide costs almost nothing here - the matched + // filter does the selectivity that matters. + static int submodeBandwidth(int submode) + { + int rate = submodeRate(submode); + return isOqpsk(rate) ? (5 * symbolRate(rate) / 2) : (2 * bitRate(rate)); + } + + struct Config + { + // Normalised differential correlation against the 32 bit unique word needed to + // declare sync, 0 to 1. 32 products, so noise reads around 0.15; a genuine + // unique word on a clean satellite downlink reads over 0.9. + // + // Measured, and the optimum is much lower than it looks like it should be. + // Sweeping 0.40 to 0.60 over 5, 6 and 7 dB gives 487, 545, 550, 518, 385, 183 + // of 600 at 0.40/0.44/0.46/0.50/0.55/0.60 - a factor of three between 0.46 and + // 0.60. Below 0.44 it turns over again, because a false correlation costs a + // whole frame of deaf time and that starts to outweigh the extra genuine ones. + // But that sweep was on generated AWGN, and lowering it REGRESSED the real + // recording - 5 messages against 6, and 163 of 222 signal units against 185 - + // because off air there is an adjacent channel 5 kHz away and false + // correlations are commoner than clean noise makes them look. The recording is + // the ground truth, so this stays where it was and the gain is taken instead by + // tracking the frame, below, which removes the false syncs rather than trading + // against them. + double m_syncThreshold = 0.55; + + // Correlation required to confirm the unique word at the START OF THE NEXT + // FRAME, once a frame has been decoded. A P channel is continuous TDM, so the + // next unique word is exactly one frame away - there is no need to search for + // it, only to confirm it where it must be. + // + // That is the whole point: a false correlation can only be accepted if it lands + // inside a half symbol window at a known instant, which is a vanishingly small + // target compared with free running search. So this can sit far below + // m_syncThreshold and hold lock through a fade that free search would lose, + // without ever letting a data pattern masquerade as a frame boundary. + double m_trackThreshold = 0.30; + // Frames whose unique word fails m_trackThreshold before the receiver gives up + // tracking and searches the whole stream again + int m_maxMissedFrames = 2; + // Run a SECOND, coherent lane alongside the differential one and let each + // signal unit's CRC decide which lane's octets to keep. + // + // Differential detection needs no carrier recovery at all, which is why it was + // built first and why it stays: it is what holds the receiver up when the + // carrier loop has not converged or has slipped. But multiplying two noisy + // symbols together squares the noise, and that costs several dB at the error + // rates that matter. The coherent lane tracks the carrier with a + // decision-directed loop seeded from the unique word - which is a known + // sequence, so the reference starts from a 33 symbol data-aided estimate rather + // than from nothing - and recovers most of it. + // + // A 180 degree hangup in that loop is harmless here, because the differential + // decode that follows cancels any constant sign. Only a slip mid-frame hurts, + // and that is what the arbitration covers. + // Carry the symbol timing slip measured at one unique word across the frame that + // follows it. See measureTimingSlip(). + bool m_timingSlope = true; + // How much of each slip measurement to believe. The measurement is the position + // of a correlation peak in noise, so at low SNR most of what it reports is noise + // and feeding that forward walks the sampling instant off a signal that had no + // slip to correct. Swept against both: on a live capture that was losing samples + // 0.05/0.10/0.25/0.50 gave 1402/1425/1452/1432 signal units against 1250 with it + // off, while on generated signal at 3 dB - where there is nothing to correct - + // they cost 0/1/5/12 messages of 240. 0.10 takes almost all of the gain for + // nothing measurable. + double m_timingSlopeGain = 0.10; + bool m_coherent = true; + // Smooth the coherent lane's carrier reference over the frame before detecting + // again. See refitCoherent. + bool m_smooth = true; + // Half width of the centred window, symbols. Measured: 2/4/8/16/24/32 either + // side give 279/288/291/301/292/292 of 480 against 289 unsmoothed, so the + // optimum is broad and shallow around 16. Over 1200 trials it is 739 against + // 705 - real, about 5% relative, but a tenth of a dB rather than the whole + // remaining gap. Longer windows lose because the loop's reference is genuinely + // following something, not just wandering. + int m_smoothHalf = 16; + // Both measured, and the surface around them is flat - anything in + // refGain 0.25 to 0.35 with freqGain 0.005 to 0.01 lands within 2% of the best, + // so neither is delicately tuned. The starting guesses of 0.10 and 0.02 cost + // about 15%, which is worth knowing: the reference wants to follow the carrier + // faster than instinct suggests, and the frequency loop slower. + double m_freqGain = 0.01; // Decision-directed frequency tracking, rad/symbol + double m_refGain = 0.30; // Reference phasor blend per symbol + + // The OQPSK rate wants very different loop gains from the MSK rates, measured + // rather than assumed: about 0.001 and 0.05 against 0.01 and 0.30. Its symbol + // rate is nine times higher and its frames are five times longer in symbols, so + // the carrier moves far less per symbol and there is far more to average over - + // and without a frequency integrator at all it drifts badly, taking the signal + // unit CRC rate from 96% over four frames to 19% over a hundred. + // The OQPSK correlator is a different statistic from the MSK one - 31 products + // over 32 symbols rather than 32 over 33, on a wider pulse - so it keeps its own + // threshold even though it currently matches the MSK value. + // + // It was 0.45 for a long time, from an early measurement that 0.55 would not sync + // the recording at all. That stopped being true once the symbol timing was fixed, + // and 0.45 then measured WORSE than 0.55 in both directions - 27 messages against + // 30 on the recording, and 52% against 63% at 6 dB Eb/N0 - because a threshold + // low enough to admit a marginal correlation starts a frame on a bad instant, and + // with the phase lock a bad acquisition now costs more than a missed one. 0.55 is + // the knee: everything from 0.55 to 0.70 measures identically, everything below + // degrades, so this is the lowest value that gives full performance. + // + // The stale 0.45 was invisible because the harness was overriding it with the MSK + // flag's 0.55 - so the plugin shipped worse than anything ever measured it. See + // test/README.md. + double m_oqpskSyncThreshold = 0.55; + // Retuned against the message error curve rather than against a strong recording, + // which cannot discriminate: at 6 dB Eb/N0 per channel bit these take the rate + // from 19% of messages to 66%, while leaving the recording at its best (99.2% of + // signal units either way). The earlier 0.001 / 0.05 were picked on the recording + // alone and are a little too slow to hold the carrier once noise is in the loop. + double m_oqpskFreqGain = 0.002; + double m_oqpskRefGain = 0.10; + + // A second pass that re-estimates the carrier over the whole frame was built and + // removed. It is recorded in test/README.md rather than here, because the + // negative result is worth more than the code was: forced to the correct carrier + // frequency it beat the tracking loop outright (359 messages against 289), but + // nothing available estimates that frequency well enough to extrapolate over a + // frame, and every principled way of avoiding the need to - squaring, decision + // stripping, the loop's own integrator, block correction, non-causal smoothing - + // measured worse than simply tracking. The reason is that after derotation the + // imaginary axis of an MSK symbol carries the orthogonal arm's crosstalk, which + // is large and data dependent, so any estimator touching the full complex value + // is corrupted by it. + // How far the 16 bit frame header may be from a legal one before the frame is + // abandoned, in bits. 8 accepts anything; 0 demands an exact match. + // + // This is the single most valuable number in the receiver and it was measured, + // not guessed. The header is UNCODED and hard decided, while the data field + // behind it is rate 1/2 convolutionally coded and interleaved - so the header is + // by far the weakest thing in the frame. Demanding an exact match threw away + // 17 of 65 frames at 8 dB whose every signal unit then decoded with a perfect + // CRC, costing 3 to 4 dB. Accepting anything is worse again in a different way: + // a false correlation then burns a whole frame before the receiver looks again, + // and the real frame boundary behind it is missed. + // + // Three is where the two costs cross, measured both ways. Going 0, 1, 2, 3, 4, 8 + // at 6 and 7 dB the yield runs 72, 187, 232, 240, 238, 236 of 320 - rising + // steeply then flat. On a clean signal, where false correlations on data + // patterns are what bite, 1, 2 and 3 all give a perfect 240 of 240 while 4 and 8 + // lose six. So 3 takes the whole of the low SNR gain and stops exactly before + // the false syncs start. Confirmed on a wider run: 626 against 603 of 960 for 2. + // + // The header was never the real gate in any case. Every signal unit carries its + // own CRC-16, which discriminates far harder than 8 bits of header redundancy; + // this check exists to stop a false sync wasting a whole frame of deaf time, not + // to keep garbage out of the output. + int m_headerMaxErrors = 3; + //!< How strongly the unique word has to correlate before the frame header is + //!< trusted rather than checked, and what is allowed then. The header is 16 bits, + //!< so 16 is no check at all - see the note in consumeSoftBit(). + //!< Carry the converged rotation from one frame into the next. Added when the + //!< unique word seed was poor; kept configurable so it can be measured against + //!< the seed now that the seed is good - see seedOqpsk(). + bool m_carryDphi = true; + //!< Rotate the seeded carrier reference by this many quarter turns. For OQPSK a + //!< 90 degree error swaps the arms, which is indistinguishable from starting on + //!< the wrong symbol clock phase - both give a frame that decodes nothing at all. + //!< Diagnostic: if the frames that die are dying of a quadrant error, forcing the + //!< quadrant swaps which offsets work. + int m_seedQuadrant = 0; + //!< Print the carrier loop's state through the first few frames, to stderr. + //!< Diagnostic only - see the note on the tuning cliff in test/README.md. + bool m_traceLoop = false; + double m_headerTrustCorrelation = 0.85; + int m_headerMaxErrorsTrusted = 16; + // Accept signal units that are entirely zero with a zero CRC as fill. JAERO + // does this, and real P channels do transmit them. + bool m_acceptZeroFill = true; + // Emit a Frame for signal units that are not ACARS (log-on, channel control, + // acknowledgements ...) as well as for reassembled ACARS blocks + bool m_emitNonAcars = true; + // Seconds of receiver time after which a partially reassembled ISU/SSU chain + // is abandoned. A 22 SSU chain at 600 bps spans several frames, so this has to + // be generous, but it must be bounded or a lost final SSU leaks the chain. + double m_reassemblyTimeout = 120.0; + // Hard cap on partial reassemblies held at once, per channel + int m_maxReassemblies = 64; + }; + + struct Stats + { + uint64_t m_samples = 0; + uint64_t m_syncs = 0; //!< Unique word correlations that started a frame + double m_uwPeak = 0.0; //!< Largest unique word correlation seen + uint64_t m_framesDecoded = 0; + uint64_t m_headerBad = 0; //!< Headers not exactly legal, whether or not accepted + //!< OQPSK arm selection: how often a frame confirmed the symbol clock phase by + //!< decoding something, and how often one decoded nothing and the phase was + //!< flipped to the other candidate half a symbol away + uint64_t m_phaseConfirms = 0; + uint64_t m_phaseFlips = 0; + uint64_t m_phaseDeadFrames = 0; + //!< How good the carrier seed from the unique word is: the seed the frame started + //!< with against the rotation the loop had converged on by the end of it, summed + //!< over frames that decoded. Radians per symbol; the harness converts to Hz. + double m_seedErrorSum = 0.0; + double m_seedErrorMax = 0.0; + double m_convergedSum = 0.0; + uint64_t m_seedCount = 0; + //!< Frames where the seed came from the unique word rather than the carry, split + //!< by whether they went on to decode anything + uint64_t m_seededFromUw = 0; + uint64_t m_seededFromUwOk = 0; + //!< Frames by how many of their 26 signal units passed: none, some, most, all. + //!< Whether a bad frame is bad outright or merely noisy says whether the loss is + //!< a lock going wrong or ordinary noise. + uint64_t m_frameYield[4] = {0, 0, 0, 0}; + //!< Which symbol clock phase the frames that decoded everything started on, and + //!< which the frames that decoded nothing did. If the dead frames sit half a + //!< symbol away from the live ones then the arm really is alternating; if they + //!< sit on the same phase then whatever kills them is not the timing. + uint64_t m_phaseHistOk[32] = {0}; + uint64_t m_phaseHistDead[32] = {0}; + uint64_t m_headerRejected = 0; //!< ... and those too far off to keep the frame + uint64_t m_uwTracked = 0; //!< Frames whose unique word was confirmed where predicted + uint64_t m_uwLost = 0; //!< Tracking gave up and returned to search + uint64_t m_suCrcOk = 0; + uint64_t m_suCrcBad = 0; + uint64_t m_suFromDifferential = 0; //!< Signal units the differential lane won + uint64_t m_suFromCoherent = 0; //!< ... and the coherent lane + // Signal unit CRC results by position within the frame. The convolutional code + // is not flushed at the end of a frame, so the last unit is expected to be the + // weakest; this is what says by how much. + uint64_t m_suOkByPos[ACARSAERO_MAX_SUS] = {0}; + uint64_t m_suBadByPos[ACARSAERO_MAX_SUS] = {0}; + uint64_t m_suFill = 0; //!< Fill-in signal units (type 0x01 or all zero) + uint64_t m_isus = 0; //!< User data ISUs seen + uint64_t m_ssus = 0; + uint64_t m_ssuOrphan = 0; //!< SSU with no matching ISU + uint64_t m_reassembled = 0; //!< Complete user data blocks + uint64_t m_acarsFrames = 0; + uint64_t m_otherFrames = 0; + uint64_t m_bursts = 0; //!< R/T bursts that passed their CRCs + uint64_t m_burstsBad = 0; + uint64_t m_reassemblyTimeouts = 0; + }; + + // One decoded item: either a reassembled ACARS block or a single non-ACARS signal unit + struct Frame + { + std::vector m_bytes; //!< ACARS block from its SOH, or the raw signal unit + std::string m_type; //!< "User data ISU", "Log-on request", ... + bool m_uplink = false; //!< True on the P channel (ground to air) + uint32_t m_aesId = 0; //!< Aircraft Earth Station id, the ICAO 24 bit address + uint8_t m_gesId = 0; //!< Ground Earth Station id + bool m_isAcars = false; + int m_bitRate = 0; //!< 600, 1200 or 10500 + int m_channel = ChannelP; + }; + + AcarsAeroReceiver() + { + setMode(Rate600, ChannelP); + } + + // Every rate in scope is implemented. Kept as a hook because the R and T burst + // paths still do not decode real bursts, and because a rate could be disabled here + // rather than silently receiving nothing. + static bool rateSupported(int rate) { (void) rate; return true; } + + // Rate and channel type are settings, not detected. Reconfigures and resets. + void setMode(int rate, int channel) + { + m_rate = (rate >= 0) && (rate < RateCount) ? rate : (int) Rate600; + m_channel = (channel >= ChannelP) && (channel <= ChannelT) ? channel : (int) ChannelP; + m_sps = samplesPerSymbol(m_rate); + designFilter(); + reset(); + } + + void configure(const Config& config) + { + m_config = config; + reset(); + } + + const Config& config() const { return m_config; } + const Stats& stats() const { return m_stats; } + + //! RMS error vector magnitude as a fraction, or a negative value before the coherent + //! lane has seen anything. Only meaningful on a continuous P channel + double evm() const { return (m_evmMeanSq > 0.0) ? std::sqrt(m_evmMeanSq) : -1.0; } + //! Fraction of recent signal units whose CRC passed, negative before the first one + double suRate() const { return m_suRate; } + int rate() const { return m_rate; } + int channelType() const { return m_channel; } + + void reset() + { + m_lockedPhase = -1; + m_phaseConfirmed = false; + m_phaseFailures = 0; + m_haveCarriedDphi = false; + m_state = StateSearch; + m_ring.assign(ringLength(), Cd(0.0, 0.0)); + m_ringIdx = 0; + m_ringFill = 0; + m_sclk = 0; + m_symPeriod = m_sps; + m_timingAcc = 0.0; + m_timingRate = 0.0; + m_symbolCount = 0; + m_prevSym = Cd(0.0, 0.0); + m_dphi = 0.0; + m_lastSyncError = 0.0; + m_magMean = 0.0; + m_trackWait = 0; + m_missedFrames = 0; + m_magMeanCoh = 0.0; + m_symBuf.clear(); + m_refPhase.clear(); + m_refPhaseAcc = 0.0; + m_projPrevFirst = 0.0; + m_oqpskInit = false; + m_softBitsCoh.clear(); + m_ref = Cd(1.0, 0.0); + m_evmMeanSq = 0.0; + m_suRate = -1.0; + m_dphiSym = 0.0; + m_projPrev = 0.0; + m_cohValid = false; + m_syncPending = false; + m_bestStat = 0.0; + m_bestAgo = 0; + m_bestSum = Cd(0.0, 0.0); + m_softBits.clear(); + m_headerBits.clear(); + m_burstBits.clear(); + m_burstCols = 0; + m_frames.clear(); + m_reassembly.clear(); + m_time = 0.0; + } + + //! Nothing is held back, so this is a no-op. Kept because the harness and the sink + //! call it at the end of a stream and a future receiver may need it again. + void flush() {} + + bool hasFrame() const { return !m_frames.empty(); } + + Frame popFrame() + { + Frame f = m_frames.front(); + m_frames.pop_front(); + return f; + } + + double lastSyncError() const { return m_lastSyncError; } + bool synced() const { return m_state != StateSearch; } + + // The rate the demodulator for a given Aero rate runs at + static int channelSampleRate(int rate) + { + return (rate == Rate10500) ? ACARSAERO_OQPSK_CHANNEL_SAMPLE_RATE + : ACARSAERO_MSK_CHANNEL_SAMPLE_RATE; + } + + static int bitRate(int rate) + { + switch (rate) + { + case Rate1200: return 1200; + case Rate10500: return 10500; + default: return 600; + } + } + + // Symbol rate. MSK carries one bit per symbol so it equals the bit rate; OQPSK + // carries two, so it is half. + static int symbolRate(int rate) + { + return (rate == Rate10500) ? 5250 : bitRate(rate); + } + + static int samplesPerSymbol(int rate) + { + return channelSampleRate(rate) / symbolRate(rate); + } + + static bool isOqpsk(int rate) { return rate == Rate10500; } + + // --------------------------------------------------------------------------------- + // Frame geometry + // --------------------------------------------------------------------------------- + + // Interleaver columns per block. A frame is one or more whole blocks. + static int interleaverCols(int rate) + { + switch (rate) + { + case Rate1200: return 9; + case Rate10500: return 78; + default: return 6; + } + } + + // Coded bits in a frame's data field + static int codedBitsPerFrame(int rate) + { + return (rate == Rate10500) ? 4992 : 1152; + } + + // Dummy bits between the header and the data field. Only 10500 bps has any; JAERO + // names them but does not explain them, so they are simply skipped. + static int dummyBits(int rate) + { + return (rate == Rate10500) ? 178 : 0; + } + + static int dataBitsPerFrame(int rate) { return codedBitsPerFrame(rate) / 2; } + static int susPerFrame(int rate) { return dataBitsPerFrame(rate) / 8 / ACARSAERO_SU_LEN; } + static int blocksPerFrame(int rate) + { + return codedBitsPerFrame(rate) / (ACARSAERO_INTERLEAVER_ROWS * interleaverCols(rate)); + } + + // --------------------------------------------------------------------------------- + // Protocol primitives. Public so the harness can test each in isolation. + // --------------------------------------------------------------------------------- + + static uint32_t uniqueWord() { return ACARSAERO_UW; } + + static int uwBit(int i) { return (ACARSAERO_UW >> (ACARSAERO_UW_LEN - 1 - i)) & 1; } + + // Scrambler: additive LFSR x^15 + x + 1 seeded 0x6959, restarted at every frame + // boundary. HFDL uses the same polynomial and seed (its lfsrNext shifts the other + // way with the seed bits reversed, which is the same sequence), so this is the + // identical generator applied over a longer run. + static uint8_t scramblerBit(int index) + { + static const std::vector seq = []() + { + std::vector s(MAX_SCRAMBLER); + uint16_t lfsr = ACARSAERO_SCRAMBLER_SEED; + for (int i = 0; i < MAX_SCRAMBLER; i++) + { + uint8_t bit = (uint8_t) (((lfsr >> 0) ^ (lfsr >> 14)) & 1); + lfsr = (uint16_t) ((lfsr >> 1) | (bit << 14)); + s[i] = bit; + } + return s; + }(); + return seq[index % MAX_SCRAMBLER]; + } + + // Deinterleaver permutation for a block of 64 rows by cols columns: srcPos[k] is + // where the k'th output (Viterbi input order) bit sits in the received block. + // Computed once per column count and cached. + static const std::vector& deinterleavePos(int cols) + { + static std::map> cache; + static const std::array permute = []() + { + std::array p; + for (int i = 0; i < ACARSAERO_INTERLEAVER_ROWS; i++) { + p[i] = (i * ACARSAERO_INTERLEAVER_ROW_STEP) % ACARSAERO_INTERLEAVER_ROWS; + } + return p; + }(); + + auto it = cache.find(cols); + if (it != cache.end()) { + return it->second; + } + + std::vector pos((size_t) ACARSAERO_INTERLEAVER_ROWS * cols); + int k = 0; + for (int j = 0; j < cols; j++) + { + for (int i = 0; i < ACARSAERO_INTERLEAVER_ROWS; i++) { + pos[k++] = permute[i] * cols + j; + } + } + return cache.emplace(cols, std::move(pos)).first->second; + } + + template + static void deinterleave(const T *in, int cols, T *out) + { + const std::vector& pos = deinterleavePos(cols); + for (size_t k = 0; k < pos.size(); k++) { + out[k] = in[pos[k]]; + } + } + + // MSK bursts are deinterleaved in GROUPS, not as one matrix: the first five + // columns are a 64x5 block of their own, then every following group of three + // columns is its own 64x3 block (JAERO AeroLInterleaver::deinterleaveMSK_ba). + // The OQPSK burst path treats the whole burst as a single 64xN matrix instead, so + // the two must not be conflated. + template + static void deinterleaveBurstMsk(const T *in, int cols, T *out) + { + const int rows = ACARSAERO_INTERLEAVER_ROWS; + deinterleave(in, ACARSAERO_BURST_HEAD_COLS, out); + int done = ACARSAERO_BURST_HEAD_COLS; + while (done + ACARSAERO_BURST_SU_COLS <= cols) + { + deinterleave(in + (size_t) done * rows, ACARSAERO_BURST_SU_COLS, + out + (size_t) done * rows); + done += ACARSAERO_BURST_SU_COLS; + } + } + + // Interleave a burst the way deinterleaveBurstMsk() undoes it: the first five + // columns as one block, then groups of three + template + static void interleaveBurstMsk(const T *in, int cols, T *out) + { + const int rows = ACARSAERO_INTERLEAVER_ROWS; + interleave(in, ACARSAERO_BURST_HEAD_COLS, out); + int done = ACARSAERO_BURST_HEAD_COLS; + while (done + ACARSAERO_BURST_SU_COLS <= cols) + { + interleave(in + (size_t) done * rows, ACARSAERO_BURST_SU_COLS, + out + (size_t) done * rows); + done += ACARSAERO_BURST_SU_COLS; + } + } + + template + static void interleave(const T *in, int cols, T *out) + { + const std::vector& pos = deinterleavePos(cols); + for (size_t k = 0; k < pos.size(); k++) { + out[pos[k]] = in[k]; + } + } + + // CRC-16/X-25 over the payload octets of a signal unit + static uint16_t computeCrc(const uint8_t *buf, int len) + { + crc16x25 crc; + crc.init(); + crc.calculate(const_cast(buf), len); + return (uint16_t) crc.get(); + } + + // A signal unit's CRC sits in its last two octets, little endian + static bool suCrcOk(const uint8_t *su, int len) + { + uint16_t received = (uint16_t) (su[len - 1] << 8) | su[len - 2]; + return computeCrc(su, len - ACARSAERO_SU_CRC_LEN) == received; + } + + static void appendCrc(std::vector& su) + { + uint16_t crc = computeCrc(su.data(), (int) su.size()); + su.push_back((uint8_t) (crc & 0xFF)); + su.push_back((uint8_t) ((crc >> 8) & 0xFF)); + } + + static bool allZero(const uint8_t *buf, int len) + { + for (int i = 0; i < len; i++) + { + if (buf[i]) { + return false; + } + } + return true; + } + + // --------------------------------------------------------------------------------- + // Signal unit types (JAERO aerol.h, namespaces AEROTypeP/R/T) + // --------------------------------------------------------------------------------- + + enum SuType + { + SuFill = 0x01, + SuSystemTableSmc = 0x05, + SuSystemTableBeam = 0x07, + SuSystemTableIndex = 0x0A, + SuSystemTableSatellite = 0x0C, + SuLogOnRequest = 0x10, + SuLogOnConfirm = 0x11, + SuLogOffRequest = 0x12, + SuLogOnReject = 0x13, + SuLogOnInterrogation = 0x14, + SuLogOnOffAcknowledge = 0x15, + SuLogOnPrompt = 0x16, + SuDataChannelReassignment = 0x17, + // Reserved in the SDM rather than unrecognised by us. They do appear on air - + // JAERO names them the same way (aerol.h, Reserved_18/19/26) + SuReserved18 = 0x18, + SuReserved19 = 0x19, + SuReserved26 = 0x26, + SuCallAnnouncement = 0x21, + SuAccessRequestData = 0x22, + SuEirpTable = 0x28, + SuCallProgress = 0x30, + SuCChannelDistress = 0x31, + SuCChannelFlightSafety = 0x32, + SuCChannelOtherSafety = 0x33, + SuCChannelNonSafety = 0x34, + SuPRChannelControl = 0x40, + SuTChannelControl = 0x41, + SuTChannelAssignment = 0x51, + SuTelephonyAck = 0x60, + SuRequestAcknowledgement = 0x61, + SuAcknowledge = 0x62, + SuUserDataIsu = 0x71, + SuUserData3Octet = 0x74, + SuUserData4Octet = 0x76 + }; + + static bool isSsu(uint8_t type) { return (type & 0xC0) == 0xC0; } + + // Which Inmarsat satellite and ocean region a Ground Earth Station id belongs to. + // https://acars-vdl2.groups.io/g/main/topic/frequencies_in_use_inmarsat/112254777 + // Appears valid for AOR-E + static const char *gesName(uint8_t id) + { + switch (id) + { + case 0x43: case 0x44: + return "AOR-E"; + case 0x90: case 0xC1: case 0xC5: + return "IOR"; + case 0x02: case 0x05: case 0xD0: + return "AOR-W"; + case 0x50: case 0x82: case 0x85: + return "POR"; + default: + return nullptr; + } + } + + static bool suIsNoInfo(uint8_t type) + { + switch (type) + { + case SuFill: + case SuSystemTableSmc: + case SuSystemTableBeam: + case SuSystemTableIndex: + case SuSystemTableSatellite: + case SuEirpTable: + case SuReserved18: + case SuReserved19: + case SuReserved26: + return true; + default: + return false; + } + } + + static bool suHasAesId(uint8_t type) + { + if (isSsu(type)) { + return true; + } + switch (type) + { + case SuLogOnRequest: + case SuLogOnConfirm: + case SuLogOffRequest: + case SuLogOnReject: + case SuLogOnInterrogation: + case SuLogOnOffAcknowledge: + case SuLogOnPrompt: + case SuDataChannelReassignment: + case SuCallAnnouncement: + case SuAccessRequestData: + case SuCallProgress: + case SuCChannelDistress: + case SuCChannelFlightSafety: + case SuCChannelOtherSafety: + case SuCChannelNonSafety: + case SuPRChannelControl: + case SuTChannelControl: + case SuTChannelAssignment: + case SuTelephonyAck: + case SuRequestAcknowledgement: + case SuAcknowledge: + case SuUserDataIsu: + case SuUserData3Octet: + case SuUserData4Octet: + return true; + default: + return false; + } + } + + static const char *suTypeName(uint8_t type) + { + if (isSsu(type)) { + return "User data SSU"; + } + + switch (type) + { + case SuFill: return "Fill-in signal unit"; + case SuSystemTableSmc: return "System table, Psmc/Rsmc channels"; + case SuSystemTableBeam: return "System table, GES beam support"; + case SuSystemTableIndex: return "System table index"; + case SuSystemTableSatellite: return "System table, satellite identification"; + case SuLogOnRequest: return "Log-on request"; + case SuLogOnConfirm: return "Log-on confirm"; + case SuLogOffRequest: return "Log-off request"; + case SuLogOnReject: return "Log-on reject"; + case SuLogOnInterrogation: return "Log-on interrogation"; + case SuLogOnOffAcknowledge: return "Log-on/off acknowledge"; + case SuLogOnPrompt: return "Log-on prompt"; + case SuDataChannelReassignment: return "Data channel reassignment"; + case SuReserved18: + case SuReserved19: + case SuReserved26: return "Reserved"; + case SuCallAnnouncement: return "Call announcement"; + case SuAccessRequestData: return "Access request, data"; + case SuEirpTable: return "Data EIRP table broadcast"; + case SuCallProgress: return "Call progress"; + case SuCChannelDistress: return "C channel assignment, distress"; + case SuCChannelFlightSafety: return "C channel assignment, flight safety"; + case SuCChannelOtherSafety: return "C channel assignment, other safety"; + case SuCChannelNonSafety: return "C channel assignment, non-safety"; + case SuPRChannelControl: return "P/R channel control"; + case SuTChannelControl: return "T channel control"; + case SuTChannelAssignment: return "T channel assignment"; + case SuTelephonyAck: return "Telephony acknowledge"; + case SuRequestAcknowledgement: return "Request for acknowledgement"; + case SuAcknowledge: return "Acknowledge"; + case SuUserDataIsu: return "User data ISU"; + case SuUserData3Octet: return "User data, 3 octet LSDU"; + case SuUserData4Octet: return "User data, 4 octet LSDU"; + default: return "Unknown"; + } + } + + // C channel assignment carries the assigned voice frequencies as 15 bit channel + // numbers with bit 15 flagging a spot beam (JAERO aerol.cpp SendCAssignment) + static double cChannelReceiveMHz(int channel) { return channel * 0.0025 + 1510.0; } + static double cChannelTransmitMHz(int channel) { return channel * 0.0025 + 1611.5; } + + // --------------------------------------------------------------------------------- + // ISU/SSU reassembly. This is link layer fragmentation of ONE ACARS block, which is + // a different thing from ACARS multipart (ETB) - that is left to + // AcarsMultipartAssembler downstream, exactly as the other protocols do it. + // --------------------------------------------------------------------------------- + + struct IsuKey + { + uint32_t m_aesId; + uint8_t m_gesId; + uint8_t m_qNo; + uint8_t m_refNo; + + bool operator<(const IsuKey& o) const + { + if (m_aesId != o.m_aesId) return m_aesId < o.m_aesId; + if (m_gesId != o.m_gesId) return m_gesId < o.m_gesId; + if (m_qNo != o.m_qNo) return m_qNo < o.m_qNo; + return m_refNo < o.m_refNo; + } + }; + + struct Reassembly + { + int m_remaining = 0; //!< SSUs still expected, counts down + int m_lastOctets = 0; //!< Octets used in the final SSU + double m_started = 0.0; + std::vector m_data; + }; + + // --------------------------------------------------------------------------------- + // ACARS extraction. The reassembled user data is FF FF then a complete ARINC 618 + // block; strip the FFs and the odd parity and the rest of the plugin takes it. + // --------------------------------------------------------------------------------- + + static bool looksLikeAcars(const std::vector& userData) + { + // JAERO's own sniff test, aerol.cpp ParserISU::parse + return (userData.size() > 16) + && (userData[0] == 0xFF) + && (userData[1] == 0xFF) + && ((userData[15] == 0x83) || (userData[15] == 0x02)); + } + + // True when every octet that should carry odd parity does + static bool acarsParityOk(const std::vector& userData) + { + // The two leading FFs and the two BCS octets before the DEL are the exceptions + if (userData.size() < 7) { + return false; + } + size_t bcs = userData.size() - 3; + for (size_t i = 2; i < userData.size(); i++) + { + if ((i == bcs) || (i == bcs + 1)) { + continue; + } + if (!oddParity(userData[i])) { + return false; + } + } + return true; + } + + // Strip the two FF octets, giving the ARINC 618 block from its SOH. + // + // The parity bits are deliberately LEFT ON, which is what VDL-2 and HFDL deliver + // too: AcarsMessage::decode masks them itself, and libacars wants the block as + // transmitted. SOH and DEL both happen to have odd parity already, so the raw + // first and last octets still compare equal to 0x01 and 0x7F, which is what + // AcarsMessage::decode tests without masking. + static std::vector acarsBlock(const std::vector& userData) + { + if (userData.size() <= 2) { + return std::vector(); + } + return std::vector(userData.begin() + 2, userData.end()); + } + + static bool oddParity(uint8_t v) + { + v = (uint8_t) (v ^ (v >> 4)); + v = (uint8_t) (v ^ (v >> 2)); + v = (uint8_t) (v ^ (v >> 1)); + return (v & 1) != 0; + } + + static uint8_t withOddParity(uint8_t v) + { + v = (uint8_t) (v & 0x7F); + return oddParity(v) ? v : (uint8_t) (v | 0x80); + } + + // --------------------------------------------------------------------------------- + // Encode side, for the test harness generator. Exact inverses of the decode path. + // --------------------------------------------------------------------------------- + + // Wrap an ARINC 618 ACARS block (from its SOH, with its BCS and DEL) as Aero user + // data: two FF octets then the block with odd parity added + static std::vector buildUserData(const std::vector& acarsBlock) + { + std::vector ud = { 0xFF, 0xFF }; + if (acarsBlock.size() < 3) { + return ud; + } + size_t bcs = acarsBlock.size() - 3; + for (size_t i = 0; i < acarsBlock.size(); i++) + { + if ((i == bcs) || (i == bcs + 1)) { + ud.push_back(acarsBlock[i]); + } else { + ud.push_back(withOddParity(acarsBlock[i])); + } + } + return ud; + } + + // Split user data into an ISU and its SSUs, each a complete signal unit with CRC + static std::vector> buildIsuChain(uint32_t aesId, uint8_t gesId, + uint8_t qNo, uint8_t refNo, const std::vector& userData) + { + std::vector> sus; + // Two octets ride in the ISU, eight in each SSU + int remaining = (int) userData.size() - 2; + if (remaining < 0) { + remaining = 0; + } + int ssus = (remaining + 7) / 8; + int lastOctets = remaining - (ssus - 1) * 8; + if (ssus == 0) { + lastOctets = 0; + } + + std::vector isu; + isu.push_back(SuUserDataIsu); + isu.push_back((uint8_t) ((aesId >> 16) & 0xFF)); + isu.push_back((uint8_t) ((aesId >> 8) & 0xFF)); + isu.push_back((uint8_t) (aesId & 0xFF)); + isu.push_back(gesId); + isu.push_back((uint8_t) (((qNo & 0x0F) << 4) | (refNo & 0x0F))); + isu.push_back((uint8_t) (ssus & 0x3F)); + isu.push_back((uint8_t) ((lastOctets & 0x0F) << 4)); + isu.push_back(userData.size() > 0 ? userData[0] : 0); + isu.push_back(userData.size() > 1 ? userData[1] : 0); + appendCrc(isu); + sus.push_back(isu); + + for (int s = 0; s < ssus; s++) + { + std::vector ssu; + // SEQNO counts down and the FIRST SSU is one less than the count in the + // ISU, so the last one carries zero (JAERO ISUData::findisuitemC0 matches + // on SEQNO + 1 against the stored value) + ssu.push_back((uint8_t) (0xC0 | ((ssus - 1 - s) & 0x3F))); + ssu.push_back((uint8_t) (((qNo & 0x0F) << 4) | (refNo & 0x0F))); + int octets = (s == ssus - 1) ? lastOctets : 8; + for (int i = 0; i < 8; i++) + { + size_t src = (size_t) (2 + s * 8 + i); + ssu.push_back((i < octets) && (src < userData.size()) ? userData[src] : 0); + } + appendCrc(ssu); + sus.push_back(ssu); + } + return sus; + } + + static std::vector buildFillSu() + { + std::vector su(ACARSAERO_SU_LEN - ACARSAERO_SU_CRC_LEN, 0); + su[0] = SuFill; + appendCrc(su); + return su; + } + + // K=7 rate 1/2 convolutional encoder that CARRIES ITS STATE, which is what the real + // P channel encoder does - it runs continuously across frame boundaries rather than + // restarting each frame. Measured, not assumed: decoding a real recording with the + // Viterbi forced to start in state 0 lost the first signal unit of three frames in + // four, and letting it start from any state took that unit's success rate from 24% + // to the 95% every other position already got. + // + // Same polynomials as AcarsHfdlReceiver::convEncode; that one always starts from + // zero, which is right for HFDL's per-burst encoder and wrong here. + static void convEncodeContinuous(const std::vector& bits, + std::vector& chips, uint32_t& sr) + { + chips.clear(); + chips.reserve(bits.size() * 2); + for (uint8_t b : bits) + { + sr = ((sr << 1) | (b & 1)) & 0x7F; + chips.push_back(parity7(sr & 0x6D)); + chips.push_back(parity7(sr & 0x4F)); + } + } + + static uint8_t parity7(uint32_t v) + { + v ^= v >> 4; + v ^= v >> 2; + v ^= v >> 1; + return (uint8_t) (v & 1); + } + + // Build one P channel frame's worth of channel bits: unique word, header, then the + // data field encoded, interleaved and scrambled. sus are padded with fill units. + // sr carries the convolutional encoder state from the previous frame. + static std::vector encodeFrameBits(int rate, uint16_t header, + const std::vector>& sus, uint32_t& sr) + { + const int cols = interleaverCols(rate); + const int blockLen = ACARSAERO_INTERLEAVER_ROWS * cols; + const int coded = codedBitsPerFrame(rate); + const int dataBits = coded / 2; + + // Octets of the data field, padded with fill signal units + std::vector octets; + octets.reserve(dataBits / 8); + for (const auto& su : sus) + { + if ((int) octets.size() + ACARSAERO_SU_LEN > dataBits / 8) { + break; + } + octets.insert(octets.end(), su.begin(), su.end()); + } + std::vector fill = buildFillSu(); + while ((int) octets.size() + ACARSAERO_SU_LEN <= dataBits / 8) { + octets.insert(octets.end(), fill.begin(), fill.end()); + } + octets.resize(dataBits / 8, 0); + + // Unpack LSB first, then scramble + std::vector bits(dataBits); + for (int i = 0; i < dataBits; i++) { + bits[i] = (uint8_t) (((octets[i / 8] >> (i % 8)) & 1) ^ scramblerBit(i)); + } + + // Convolutionally encode, then interleave block by block + std::vector chips; + convEncodeContinuous(bits, chips, sr); + chips.resize(coded, 0); + + std::vector tx(coded); + for (int b = 0; b < coded / blockLen; b++) { + interleave(chips.data() + b * blockLen, cols, tx.data() + b * blockLen); + } + + std::vector out; + out.reserve(uwBits(rate) + ACARSAERO_HEADER_LEN + dummyBits(rate) + coded); + appendUw(rate, out); + for (int i = 0; i < ACARSAERO_HEADER_LEN; i++) { + out.push_back((uint8_t) ((header >> (ACARSAERO_HEADER_LEN - 1 - i)) & 1)); + } + for (int i = 0; i < dummyBits(rate); i++) { + out.push_back(0); + } + out.insert(out.end(), tx.begin(), tx.end()); + return out; + } + + // Encode one R or T burst, the counterpart of tryBurstDecode(). + // + // A burst is NOT a frame: there is no 16 bit header and no dummy field, the + // convolutional encoder starts from state zero for every burst instead of running + // continuously, the scrambler restarts with it, and the interleaver is segmented. + // The generator had none of that - it built P channel frames whatever the submode was + // - so the R and T paths were never exercised end to end at all, and the "passes + // loopback" claim in the plan was simply untrue for them. + // + // An R burst is five columns holding one 19 octet signal unit. A T burst is five + // columns of header then three columns per 12 octet signal unit. Either way the + // block is 64 x cols channel bits, so it carries 32 x cols information bits, and + // whatever the signal units do not fill is left as zeros - which also flushes the + // encoder, since the tail of every burst is zero. + static std::vector encodeBurstBits(int rate, int channel, + const std::vector>& sus) + { + const int rows = ACARSAERO_INTERLEAVER_ROWS; + const int suLen = (channel == ChannelR) ? ACARSAERO_R_SU_LEN : ACARSAERO_SU_LEN; + + std::vector octets; + int cols; + + if (channel == ChannelR) + { + cols = ACARSAERO_BURST_HEAD_COLS; + if (!sus.empty()) { + octets.insert(octets.end(), sus[0].begin(), sus[0].end()); + } + } + else + { + cols = ACARSAERO_BURST_HEAD_COLS + (int) sus.size() * ACARSAERO_BURST_SU_COLS; + // The T header is four octets and its own CRC. The receiver takes the signal + // unit count from the burst length rather than from the header, so only the + // CRC has to be right. + std::vector hdr(ACARSAERO_T_HEADER_LEN, 0); + hdr[0] = 0xC0; + hdr[1] = 0x40; + hdr[2] = 0x00; + hdr[3] = 0x01; + uint16_t crc = computeCrc(hdr.data(), ACARSAERO_T_HEADER_LEN - ACARSAERO_SU_CRC_LEN); + hdr[ACARSAERO_T_HEADER_LEN - 2] = (uint8_t) (crc & 0xFF); + hdr[ACARSAERO_T_HEADER_LEN - 1] = (uint8_t) (crc >> 8); + octets = hdr; + for (const auto& su : sus) { + octets.insert(octets.end(), su.begin(), su.end()); + } + } + (void) suLen; + + const int coded = rows * cols; + const int dataBits = coded / 2; + octets.resize((size_t) dataBits / 8, 0); + + std::vector bits(dataBits); + for (int i = 0; i < dataBits; i++) { + bits[i] = (uint8_t) (((octets[i / 8] >> (i % 8)) & 1) ^ scramblerBit(i)); + } + + // From state zero, per burst - not the continuous encoder the P channel uses + uint32_t sr = 0; + std::vector chips; + convEncodeContinuous(bits, chips, sr); + chips.resize(coded, 0); + + std::vector tx(coded); + interleaveBurstMsk(chips.data(), cols, tx.data()); + + std::vector out; + out.reserve(uwBits(rate) + coded); + appendUw(rate, out); + out.insert(out.end(), tx.begin(), tx.end()); + return out; + } + + // Bits the unique word field occupies. OQPSK carries the same 32 bit word on BOTH + // arms, so it takes 64 bits of the stream - which is exactly the 64 that the frame + // arithmetic needs (16 + 178 + 4992 + 64 = 5250) and 32 symbols either way. + static int uwBits(int rate) + { + return isOqpsk(rate) ? (2 * ACARSAERO_UW_LEN) : ACARSAERO_UW_LEN; + } + + static void appendUw(int rate, std::vector& out) + { + for (int i = 0; i < ACARSAERO_UW_LEN; i++) + { + uint8_t b = (uint8_t) uwBit(i); + if (isOqpsk(rate)) { + out.push_back(b); // Q arm + } + out.push_back(b); // I arm, or the MSK symbol + } + } + + // OQPSK modulate a bit stream. The bits arrive Q first then I for each symbol, the + // Q arm is inverted with respect to I, and the Q pulse is staggered HALF A SYMBOL + // EARLY - the three conventions the receiver expects, none of them guessable and + // all three established against a real recording. + static void modulateOqpsk(const std::vector& bits, int sps, std::vector& out) + { + const size_t symbols = bits.size() / 2; + const int span = 6; + const int taps = span * sps + 1; + + // Root raised cosine, roll-off 1.0, the same pulse the receiver matches to + std::vector h(taps); + double sum = 0.0; + for (int i = 0; i < taps; i++) + { + double t = (i - taps / 2) / (double) sps; + // Root raised cosine with roll-off exactly 1, where the general formula + // collapses to 4t cos(2 pi t) / (pi t (1 - 16 t^2)) + double v; + if (std::abs(t) < 1e-9) { + v = 4.0 / M_PI; + } else if (std::abs(std::abs(4.0 * t) - 1.0) < 1e-6) { + v = (1.0 / std::sqrt(2.0)) + * ((1.0 + 2.0 / M_PI) * std::sin(M_PI / 4.0) + + (1.0 - 2.0 / M_PI) * std::cos(M_PI / 4.0)); + } else { + v = (4.0 * t * std::cos(2.0 * M_PI * t)) + / (M_PI * t * (1.0 - 16.0 * t * t)); + } + h[i] = v; + sum += v; + } + for (int i = 0; i < taps; i++) { + h[i] /= sum; + } + + const int lead = taps / 2 + sps; + out.assign(symbols * sps + 2 * lead, Cd(0.0, 0.0)); + + for (size_t n = 0; n < symbols; n++) + { + double q = bits[2 * n] ? -1.0 : 1.0; // Q is inverted with respect to I + double a = bits[2 * n + 1] ? 1.0 : -1.0; + + int iCentre = (int) (lead + n * sps); + int qCentre = iCentre - sps / 2; // Q leads I by half a symbol + + for (int k = 0; k < taps; k++) + { + int pi = iCentre + k - taps / 2; + int pq = qCentre + k - taps / 2; + if ((pi >= 0) && (pi < (int) out.size())) { + out[pi] += Cd(a * h[k], 0.0); + } + if ((pq >= 0) && (pq < (int) out.size())) { + out[pq] += Cd(0.0, q * h[k]); + } + } + } + } + + // MSK modulate a bit stream. The bits are differentially encoded onto the derotated + // BPSK stream, which is the same as saying the MSK phase advances +90 degrees for a + // one and -90 for a zero - continuous phase, constant envelope. + static void modulateMsk(const std::vector& bits, int sps, std::vector& out) + { + out.clear(); + out.reserve(bits.size() * sps); + double phase = 0.0; + for (uint8_t b : bits) + { + double step = (b ? M_PI_2 : -M_PI_2) / sps; + for (int s = 0; s < sps; s++) + { + phase += step; + out.push_back(std::polar(1.0, phase)); + } + } + } + + // --------------------------------------------------------------------------------- + // Receiver + // --------------------------------------------------------------------------------- + + bool processSample(const Cd& in) + { + m_stats.m_samples++; + m_time += 1.0 / channelSampleRate(m_rate); + size_t before = m_frames.size(); + + Cd s = matchedFilter(in); + m_ringIdx = (m_ringIdx + 1) % (int) m_ring.size(); + m_ring[m_ringIdx] = s; + if (m_ringFill < (int) m_ring.size()) { + m_ringFill++; + } + + if (!rateSupported(m_rate)) { + return false; + } + + bool haveFill = m_ringFill >= (ACARSAERO_UW_LEN + 1) * m_sps + 4; + + if (m_state == StateSearch) + { + if (haveFill) { + searchUniqueWord(); + } + } + else if (m_state == StateTrack) + { + trackUniqueWord(); + } + else + { + if (++m_sclk >= m_symPeriod) + { + m_sclk = 0; + processSymbol(); + nextSymbolPeriod(); + } + } + + return m_frames.size() != before; + } + +private: + static const int MAX_SCRAMBLER = 8192; // Longest frame's data field, with margin + + enum State + { + StateSearch = 0, + StateHeader, //!< Collecting the 16 uncoded header bits + StateData, //!< Collecting the coded data field + StateBurst, //!< R/T: collecting soft bits, trying a decode each block + StateTrack //!< P: waiting for the next frame's unique word where predicted + }; + + Config m_config; + Stats m_stats; + int m_rate = Rate600; + int m_channel = ChannelP; + int m_sps = 32; + double m_time = 0.0; + + std::vector m_filter; //!< Matched filter taps + std::vector m_filterDelay; + int m_filterIdx = 0; + + std::vector m_ring; + int m_ringIdx = 0; + int m_ringFill = 0; + + State m_state = StateSearch; + //!< How well the unique word correlated for the frame being decoded now, which is + //!< how sure we are that this IS a frame - see the header check in consumeSoftBit() + double m_syncCorrelation = 0.0; + int m_lockedPhase = -1; //!< OQPSK symbol clock phase held across frames, -1 until locked + int m_framePhase = -1; //!< Phase this frame was started on, locked if it decodes + bool m_phaseConfirmed = false; //!< A frame has actually decoded on m_lockedPhase + int m_phaseFailures = 0; //!< Consecutive dead frames since it was confirmed + int m_sclk = 0; + int m_symPeriod = 0; //!< Samples in the symbol being collected + double m_timingAcc = 0.0; //!< Fractional part of the timing correction + double m_timingRate = 0.0; //!< Samples of slip per symbol - measureTimingSlip() + int m_symbolCount = 0; + Cd m_prevSym; + double m_dphi = 0.0; //!< Carrier offset, radians per symbol, from acquisition + double m_lastSyncError = 0.0; + double m_magMean = 0.0; //!< Running mean differential magnitude, for soft scaling + + int m_trackWait = 0; //!< Samples until the predicted unique word window opens + int m_missedFrames = 0; + + bool m_syncPending = false; //!< Holding the correlation peak before committing + double m_bestStat = 0.0; + int m_bestAgo = 0; + Cd m_bestSum; + + std::vector m_headerBits; + std::vector m_softBits; //!< Data field soft bits, 255 = strong 1 + std::vector m_softBitsCoh; //!< ... from the coherent lane + + std::vector m_symBuf; //!< Derotated symbols of the frame, for the smoother + std::vector m_refPhase; //!< ... and the unwrapped reference phase at each + double m_refPhaseAcc = 0.0; //!< Running unwrapped phase of m_ref + double m_projPrevFirst = 0.0; //!< Projection before the first data symbol + bool m_oqpskInit = false; //!< OQPSK carrier seeded for this frame + Cd m_ref; //!< Coherent lane carrier reference, unit magnitude + double m_dphiSym = 0.0; //!< ... and its per symbol advance, tracked + double m_projPrev = 0.0; //!< Previous coherent projection, for the differential decode + double m_evmMeanSq = 0.0; //!< Running mean square in-phase error, see detectCoherent + double m_suRate = -1.0; //!< Running fraction of signal units passing CRC + double m_magMeanCoh = 0.0; + bool m_cohValid = false; + std::vector m_burstBits; + int m_burstTargetSus = 0; //!< T burst signal unit count, from unit one's SEQNO + double m_carriedDphi = 0.0; //!< Per-symbol rotation carried from the last good frame + double m_frameSeedDphi = 0.0; //!< What the unique word alone said, for the statistics + int m_traceSymbol = 0; + int m_traceFrame = 0; + int m_frameHeaderDistance = 0; + bool m_frameSeededFromUw = false; + bool m_haveCarriedDphi = false; //!< ... and whether there is one + int m_burstCols = 0; + + std::deque m_frames; + std::map m_reassembly; + + int ringLength() const { return (ACARSAERO_UW_LEN + 2) * m_sps + 8; } + + void designFilter() + { + if (isOqpsk(m_rate)) { + designRrc(); + } else { + designHalfSine(); + } + m_filterDelay.assign(m_filter.size(), Cd(0.0, 0.0)); + m_filterIdx = 0; + } + + // MSK's matched filter is a half sine spanning two symbol periods + void designHalfSine() + { + int len = 2 * m_sps; + m_filter.assign(len, 0.0); + double sum = 0.0; + for (int i = 0; i < len; i++) + { + m_filter[i] = std::sin(M_PI * i / (double) len); + sum += m_filter[i]; + } + for (int i = 0; i < len; i++) { + m_filter[i] /= sum; + } + } + + // OQPSK uses a root raised cosine with roll-off 1.0, designed at the symbol rate + void designRrc() + { + const double alpha = 1.0; + const int span = 6; + int len = span * m_sps + 1; + m_filter.assign(len, 0.0); + double sum = 0.0; + for (int i = 0; i < len; i++) + { + double t = (i - len / 2) / (double) m_sps; + double v; + if (std::abs(t) < 1e-9) { + v = 1.0 - alpha + 4.0 * alpha / M_PI; + } else if (std::abs(std::abs(4.0 * alpha * t) - 1.0) < 1e-6) { + v = (alpha / std::sqrt(2.0)) + * ((1.0 + 2.0 / M_PI) * std::sin(M_PI / (4.0 * alpha)) + + (1.0 - 2.0 / M_PI) * std::cos(M_PI / (4.0 * alpha))); + } else { + v = (std::sin(M_PI * t * (1.0 - alpha)) + + 4.0 * alpha * t * std::cos(M_PI * t * (1.0 + alpha))) + / (M_PI * t * (1.0 - 16.0 * alpha * alpha * t * t)); + } + m_filter[i] = v; + sum += v; + } + for (int i = 0; i < len; i++) { + m_filter[i] /= sum; + } + } + + Cd matchedFilter(const Cd& in) + { + m_filterDelay[m_filterIdx] = in; + Cd acc(0.0, 0.0); + int idx = m_filterIdx; + for (size_t i = 0; i < m_filter.size(); i++) + { + acc += m_filterDelay[idx] * m_filter[i]; + idx = (idx == 0) ? (int) m_filter.size() - 1 : idx - 1; + } + m_filterIdx = (m_filterIdx + 1) % (int) m_filter.size(); + return acc; + } + + Cd tap(int back) const + { + int n = (int) m_ring.size(); + return m_ring[(m_ringIdx + n - back) % n]; + } + + // Differential detection of MSK. Consecutive symbols differ by exactly +-90 + // degrees - s[n]/s[n-1] is +j for a one and -j for a zero - so multiplying the + // product of a symbol and the conjugate of its predecessor by -j lands it on the + // real axis, positive for a one. This is the derotate-to-BPSK view of MSK with the + // per symbol 90 degree rotation cancelled out: it appears in the product as a + // constant, so there is no need to track a symbol index at all. + static Cd differential(const Cd& sym, const Cd& prev) + { + return sym * std::conj(prev) * Cd(0.0, -1.0); + } + + // The other view of the same identity, the one the coherent lane needs: rotating + // the matched filter output by -90 degrees per symbol turns MSK into plain BPSK, + // u[n] = b[n] exp(j phi), where b[n] are the PRECODED symbols. Their running + // product is the data, which is why a differential decode still follows. + // + // The symbol index origin is arbitrary - shifting it rotates every sample by the + // same multiple of 90 degrees, which the carrier reference absorbs - so long as it + // is used consistently. + static Cd derotate(const Cd& v, int n) + { + switch (((n % 4) + 4) % 4) + { + case 0: return v; + case 1: return Cd(v.imag(), -v.real()); // * -j + case 2: return -v; + default: return Cd(-v.imag(), v.real()); // * +j + } + } + + // --------------------------------------------------------------------------------- + // Acquisition. Differential correlation against the unique word: the products + // u[k] conj(u[k-1]) read +-e^{j dphi}, the sign following whether consecutive + // differentially encoded unique word bits are equal, so the statistic is immune to + // carrier offset and arg(D) gives the per symbol carrier advance. Same machinery as + // the HFDL and VDL-2 receivers. + // --------------------------------------------------------------------------------- + + // The 32 unique word bits are carried by the transitions between 33 symbols, the + // last of which is the newest sample. Bit k is the transition from symbol k to + // symbol k+1, so it reads back (32 - k - 1) and (32 - k) symbols ago. + double uwCorrelation(Cd& sum) const + { + sum = Cd(0.0, 0.0); + double mag = 0.0; + + if (isOqpsk(m_rate)) + { + // OQPSK is not precoded, so the unique word sits directly on the I arm's 32 + // symbols rather than on the transitions between 33 of them. That makes 31 + // products, and the sign template is whether consecutive unique word BITS + // agree rather than whether consecutive data bits do. + for (int k = 0; k + 1 < ACARSAERO_UW_LEN; k++) + { + Cd a = tap((ACARSAERO_UW_LEN - k - 2) * m_sps); + Cd b = tap((ACARSAERO_UW_LEN - k - 1) * m_sps); + Cd d = a * std::conj(b); + sum += (uwBit(k) == uwBit(k + 1)) ? d : -d; + mag += std::abs(d); + } + return (mag > 0.0) ? std::abs(sum) / mag : 0.0; + } + + for (int k = 0; k < ACARSAERO_UW_LEN; k++) + { + Cd d = differential(tap((ACARSAERO_UW_LEN - k - 1) * m_sps), + tap((ACARSAERO_UW_LEN - k) * m_sps)); + sum += uwBit(k) ? d : -d; + mag += std::abs(d); + } + return (mag > 0.0) ? std::abs(sum) / mag : 0.0; + } + + bool searchUniqueWord() + { + Cd sum; + double stat = uwCorrelation(sum); + m_lastSyncError = stat; + if (stat > m_stats.m_uwPeak) { + m_stats.m_uwPeak = stat; + } + const double syncThreshold = isOqpsk(m_rate) ? m_config.m_oqpskSyncThreshold + : m_config.m_syncThreshold; + + // Hold the peak rather than firing on the first sample over the threshold. The + // correlation rises over roughly a symbol either side of perfect alignment, so + // firing on the crossing samples the eye off centre - worth a dB or more at + // 32 samples per symbol, and it costs only half a symbol of latency. + if (stat >= syncThreshold) + { + if (!m_syncPending || (stat > m_bestStat)) + { + m_syncPending = true; + m_bestStat = stat; + m_bestAgo = 0; + m_bestSum = sum; + } + } + + if (!m_syncPending) { + return false; + } + + m_bestAgo++; + if (m_bestAgo <= m_sps / 2) { + return false; + } + + m_stats.m_syncs++; + m_syncPending = false; + m_dphi = std::arg(m_bestSum); + m_lastSyncError = m_bestStat; + m_syncCorrelation = m_bestStat; + startFrame(refineTiming(m_bestAgo)); + return true; + } + + // A P channel frame is a fixed number of symbols, so once one has been decoded the + // next unique word is due at a known instant. Rather than free running search - which + // is what lets a data pattern or an adjacent channel steal a frame - open a window of + // half a symbol either side of the predicted instant, take the correlation peak + // inside it, and accept it against a much lower threshold than acquisition uses. + // + // The window also re-locks the symbol timing every frame, so clock error cannot + // accumulate across a long lock. + // + // Returns true when a frame was started. + bool trackUniqueWord() + { + if (--m_trackWait > 0) { + return false; + } + + Cd sum; + double stat = uwCorrelation(sum); + + if (!m_syncPending || (stat > m_bestStat)) + { + m_syncPending = true; + m_bestStat = stat; + m_bestAgo = 0; + m_bestSum = sum; + } + m_bestAgo++; + + // The window is one symbol wide, centred on the prediction + if (m_trackWait > -m_sps) { + return false; + } + + m_lastSyncError = m_bestStat; + m_syncPending = false; + + if (m_bestStat < m_config.m_trackThreshold) + { + m_missedFrames++; + if (m_missedFrames > m_config.m_maxMissedFrames) + { + m_stats.m_uwLost++; + m_state = StateSearch; + m_lockedPhase = -1; // a fresh acquisition may legitimately pick either phase + m_phaseConfirmed = false; + m_phaseFailures = 0; + m_haveCarriedDphi = false; + return false; + } + // Predict the frame after next and keep tracking through the gap + armTracking(); + return false; + } + + m_missedFrames = 0; + m_stats.m_uwTracked++; + m_stats.m_syncs++; + m_dphi = std::arg(m_bestSum); + // This frame's own correlation, not the one the acquisition had - a tracked + // frame is accepted against a much lower threshold, so inheriting the previous + // frame's confidence would trust a header that has not earned it + m_syncCorrelation = m_bestStat; + measureTimingSlip(m_bestAgo); + startFrame(refineTiming(m_bestAgo)); + return true; + } + + // Open the next prediction window half a symbol before the unique word is due + void armTracking() + { + m_state = StateTrack; + m_syncPending = false; + m_bestStat = 0.0; + // From the frame's last data symbol, the next unique word ends 32 symbols later + m_trackWait = ACARSAERO_UW_LEN * m_sps - m_sps / 2; + } + + // The sample phase, modulo one symbol, of an instant "ago" samples back from now + int instantPhase(int ago) const + { + int64_t at = (int64_t) m_stats.m_samples - (int64_t) ago; + int ph = (int) (at % (int64_t) m_sps); + return (ph < 0) ? (ph + m_sps) : ph; + } + + // Signed distance from a candidate instant's phase to the locked one, in samples, + // taken the short way round the symbol + int phaseError(int ago) const + { + int d = m_lockedPhase - instantPhase(ago); + if (d > m_sps / 2) { + d -= m_sps; + } else if (d < -m_sps / 2) { + d += m_sps; + } + return d; + } + + // Refine the symbol timing against the unique word, which is a known sequence. + // OQPSK ONLY - see below. + // + // The acquisition correlator cannot do this itself. It is deliberately differential, + // so that it works before the carrier is known, and a differential product is a very + // blunt timing discriminator: it multiplies two neighbouring samples and so stays + // large anywhere the eye is open at all. On the 10500 bps recording it reads between + // 0.944 and 0.965 across the WHOLE symbol, which is no discrimination worth the + // name, so peak-holding it lands the sampling instant essentially at random within + // the symbol. That cost the OQPSK rate almost everything: 5% of signal units passing + // at the correlator's own choice of instant against 80% six samples away. + // + // Stripping the modulation with the known unique word bits and summing coherently + // gives the matched filter output instead, which is exactly what peaks at the symbol + // centre. One pass, no loop to lose lock, nothing to tune. + // + // It is NOT applied to the MSK rates, and that is measured rather than assumed. + // Their pulse is a half sine at 32 or 16 samples per symbol, so the differential + // correlator's timing is already good, and every variant of this tried there made it + // worse - 210 signal units of 222 without it, against 195, 175 and 81 for the three + // ways of aligning it to MSK's 33 symbol differentially carried word. Refining + // something that is already right can only add noise. + // Kay's estimator over the unique word at a given sampling instant. The same + // estimator seedOqpsk() uses, factored out because the timing refinement needs it + // too - and needs it BEFORE the seed runs. + double uwKayDphi(int at) const + { + const int n = ACARSAERO_UW_LEN; + double sum = 0.0; + double weight = 0.0; + Cd previous(0.0, 0.0); + + for (int k = 0; k < n; k++) + { + Cd v = tap(at + (n - 1 - k) * m_sps) * (uwBit(k) ? 1.0 : -1.0); + if (k) + { + const Cd step = v * std::conj(previous); + if (std::abs(step) > 1e-12) + { + const double x = ((double) k - n / 2.0) / (n / 2.0); + const double w = 1.0 - x * x; + sum += w * std::arg(step); + weight += w; + } + } + previous = v; + } + return (weight > 0.0) ? (sum / weight) : 0.0; + } + + // Two passes, because the timing needs the frequency and the frequency needs the + // timing. + // + // The rotation the scoring needs cannot come from the acquisition correlator, which + // is where it was taken from first. That correlator multiplies adjacent I arm + // samples, and the unique word sits on the Q arm as well, so the crosstalk between + // the arms is coherent across the word rather than averaging away and its argument + // carries a systematic bias - measured at +30 Hz on a noiseless channel with no + // offset at all, and +50 Hz at 1200 Hz. Thirty Hz sounds negligible for a frequency + // and is not: across the 32 symbols of the word it is 1.15 rad of de-rotation that + // should not be there, which moved the chosen instant and cost half the frames at + // offsets that had been working perfectly. + // + // So: refine once with the correlator's estimate, which is biased but close enough + // to sample the word near its centre; re-estimate the frequency there with Kay's + // estimator, which is good to a few Hz; then refine again with that. The improved + // estimate is kept, since it is strictly better than the one acquisition produced. + int refineTiming(int ago) + { + if (!isOqpsk(m_rate)) { + return ago; + } + + const int first = refineTimingAt(ago, m_dphi); + const double kay = uwKayDphi(first); + m_dphi = kay; + return refineTimingAt(ago, kay); + } + + int refineTimingAt(int ago, double rot) + { + const int span = m_sps / 2; + int bestOffset = 0; + double best = -1.0; + + for (int d = -span; d <= span; d++) + { + int at = ago + d; + // tap() only looks backwards, and the ring must hold the word plus the Q arm + if ((at < 0) || (at + ACARSAERO_UW_LEN * m_sps + span >= (int) m_ring.size())) { + continue; + } + // Refuse candidates that would move the symbol clock phase off the one already + // locked. Applied HERE rather than by adjusting the winner afterwards, so the + // result always stays inside the range the bounds check above has validated - + // adjusting it after the fact could push it past the start of the ring, which + // cost 15 of 118 frames on the recording. + if ((m_lockedPhase >= 0) + && (std::abs(phaseError(at - m_sps / 2)) > ACARSAERO_TIMING_PULL)) { + continue; + } + + // A reference direction from the I arm with the modulation stripped, and + // with the carrier rotation taken out. + // + // The de-rotation is not a refinement, it is what makes this work off + // frequency at all. The sum runs over 32 symbols, so at 300 Hz the vectors + // being added swing through 3.8 rad and the "reference direction" becomes + // the average of an arc rather than a direction. The score below then + // projects every symbol onto that one direction, so the symbols at the ends + // of the word contribute nothing, and the instant this picks is wrong by up + // to half a symbol. Everything downstream is then built on samples taken off + // the eye: the frequency estimate seeded from those taps came out at -657 Hz + // where the truth was +300, the carrier reference spun at 45 degrees a + // symbol, and the frame decoded nothing at all. + // + // rot is the per symbol rotation, supplied by refineTiming() above. + Cd acc(0.0, 0.0); + for (int k = 0; k < ACARSAERO_UW_LEN; k++) + { + Cd v = tap(at + (ACARSAERO_UW_LEN - 1 - k) * m_sps); + acc += (uwBit(k) ? v : -v) * std::polar(1.0, -(double) k * rot); + } + double amag = std::abs(acc); + if (amag < 1e-12) { + continue; + } + const Cd u = acc / amag; + + // Score by the EYE OPENING the detector actually uses - the real axis of the + // I arm and the imaginary axis of the Q arm - rather than by the magnitude of + // that vector sum. + // + // Magnitude is the obvious criterion and it is measurably wrong here. The + // unique word sits on BOTH arms, so its Q contribution to an I sample adds + // coherently rather than averaging away, and the magnitude peak lands a few + // samples off the instant where the arms actually separate best. On the + // generated signal that difference was everything: 26 of 208 signal units at + // the magnitude peak against 208 of 208 a few samples away. + double score = 0.0; + for (int k = 0; k < ACARSAERO_UW_LEN; k++) + { + int off = at + (ACARSAERO_UW_LEN - 1 - k) * m_sps; + // The reference carried forward to this symbol, and back half a symbol + // again for the Q arm, which is sampled that much earlier + const Cd uk = u * std::polar(1.0, (double) k * rot); + const Cd uq = uk * std::polar(1.0, -0.5 * rot); + score += std::abs((tap(off) * std::conj(uk)).real()); + score += std::abs((tap(off + m_sps / 2) * std::conj(uq)).imag()); + } + + if (score > best) + { + best = score; + bestOffset = d; + } + } + + // HALF A SYMBOL BACK, and this is the single largest thing in the 10500 bps path. + // + // The score above cannot tell the two arms apart. OQPSK is symmetric under "shift + // half a symbol and swap the arms", and the reference direction u is estimated + // from whatever sits at the candidate instant - so at the swapped instant u simply + // rotates 90 degrees with the arms and the score comes out the same. The criterion + // has two near-equal maxima half a symbol apart and takes whichever the noise + // favours; on the recording it took the wrong one. + // + // Measured over the whole of samples/10.5k_sample.ogg, sweeping the instant across + // the full symbol: a good region from -13 to -7 samples peaking at -10, and a + // second, worse one around 0 where the search actually lands, with a hole between + // them. -10 is exactly m_sps / 2. That is a structural quantity, not a fitted + // constant, and the plateau is six samples wide, so this is not knife edge. + // + // offset 0 -> 119 frames, 1274/3094 signal units (41%), 12 messages + // offset -10 -> 118 frames, 1820/3068 signal units (59%), 16 messages + // + // Fixing u across the candidates instead was tried, to break the symmetry + // honestly rather than by construction, and is worse than either - it scores zero + // signal units, because the u taken at the search centre is itself on the wrong + // arm, so the criterion is circular. A Gardner loop over the data does not help + // either: it is symmetric under the same shift, so it cannot choose between the + // two maxima, and as an error detector here it measures biased and walks off. + if (best < 0.0) { + // Every candidate was refused by the phase constraint, so the clock has moved + // further than drift explains. Take the lock off and let the next frame + // re-establish it rather than dropping the frame. + m_lockedPhase = -1; + m_framePhase = -1; + return ago - m_sps / 2; + } + + int chosen = ago + bestOffset - m_sps / 2; + + // HOLD THE PHASE ONCE IT IS KNOWN. The two maxima above are half a symbol apart + // and the search is re-run for every frame, so without this it is free to hop + // between them frame by frame - and a frame started on the wrong one decodes to + // NOTHING. On a noiseless generated channel that showed up as every frame being + // either 26 of 26 signal units or 0 of 26 and never anything between, with the + // dead frames exactly accounted for by the header check rejecting them. + // + // A symbol clock cannot physically move half a symbol between frames - that would + // be a 5% clock error - so a jump that large is always the alias and never the + // signal. Anything further than ACARSAERO_TIMING_PULL samples from the phase + // already locked is pulled back to it, which leaves ordinary drift free to track + // and puts the alias out of reach. + // + // The phase is locked ON EVIDENCE, not on the first frame: the search picks the + // wrong maximum often enough at acquisition that locking whatever it chose first + // is WORSE than re-searching every frame (78 of 208 signal units against 104). + // It is committed only once a frame has actually decoded - see decodeFrame() - + // and released again as soon as one does not, so a wrong choice costs one frame + // rather than the whole lock. + m_framePhase = instantPhase(chosen); + return chosen; + } + + // ago is how many samples back the correlation peak sits, so the last unique word + // symbol is at tap(ago) and the next symbol arrives m_sps - ago samples from now + // How long the next symbol should be, in samples. + // + // The unique word re-locks the symbol timing at the start of every frame, and nothing + // tracked it in between - so any steady slip walked the sampling instant further off + // the further in to the frame it got, and the frame degraded from its first signal + // unit to its last. On a live capture that was dropping samples this cost the last + // unit of each frame five times the error rate of the first, inside two seconds. + // + // The slip is already measured: trackUniqueWord() finds the word in a one symbol + // window centred on where it predicted, so the offset of the peak from the centre IS + // the accumulated slip over the frame just gone. Spreading that over the next frame - + // Bresenham fashion, lengthening or shortening the odd symbol by one sample - holds + // the instant where it belongs without a timing loop, an interpolator, or any change + // to how a symbol is taken. + void nextSymbolPeriod() + { + m_symPeriod = m_sps; + if (!m_config.m_timingSlope) { + return; + } + m_timingAcc += m_timingRate; + if (m_timingAcc >= 0.5) + { + m_symPeriod++; + m_timingAcc -= 1.0; + } + else if (m_timingAcc <= -0.5) + { + m_symPeriod--; + m_timingAcc += 1.0; + } + } + + //! Symbols from the end of one unique word to the end of the next + int symbolsPerCycle() const + { + if (m_channel != ChannelP) { + return 0; // Bursts re-acquire every time; there is no cycle + } + return ACARSAERO_UW_LEN + ACARSAERO_HEADER_LEN + + codedBitsPerFrame(m_rate) + dummyBits(m_rate); + } + + // Turn the offset of the tracked unique word from its predicted position in to a + // per symbol correction for the frame that follows + void measureTimingSlip(int bestAgo) + { + const int cycle = symbolsPerCycle(); + if (!m_config.m_timingSlope || (cycle <= 0)) { + return; + } + // The window is one symbol wide and centred on the prediction, so a word found + // at the centre means the timing held. Early means the frame arrived in fewer + // samples than expected, which is a clock running slow or samples going missing. + const double slip = (m_sps / 2.0) - (double) bestAgo; + const double rate = slip / (double) cycle; + m_timingRate = (1.0 - m_config.m_timingSlopeGain) * m_timingRate + + m_config.m_timingSlopeGain * rate; + } + + void startFrame(int ago) + { + m_symPeriod = m_sps; + m_timingAcc = 0.0; + m_sclk = ago; + m_symbolCount = 0; + m_magMean = 0.0; + m_headerBits.clear(); + m_softBits.clear(); + m_burstBits.clear(); + m_burstCols = 0; + // The symbol the last unique word bit ended on is the reference the first data + // bit's differential detection works against + m_prevSym = tap(ago); + if (isOqpsk(m_rate)) { + seedOqpsk(ago); + } else { + seedCoherent(ago); + } + m_state = (m_channel == ChannelP) ? StateHeader : StateBurst; + if (m_state == StateBurst) + { + // R and T bursts have no header; the data field starts immediately + m_burstBits.reserve((size_t) ACARSAERO_INTERLEAVER_ROWS * ACARSAERO_BURST_MAX_COLS); + m_burstTargetSus = 0; + } + } + + + // Seed the OQPSK carrier from the unique word on the I arm, which carries its 32 + // bits directly. Both the phase and the per symbol rotation come out of the same + // pass: the vector sum with the modulation stripped gives the phase, and the mean + // symbol to symbol product of those stripped symbols gives the rotation. + void seedOqpsk(int ago) + { + Cd acc(0.0, 0.0); + Cd rot(0.0, 0.0); + Cd prev(0.0, 0.0); + + for (int k = 0; k < ACARSAERO_UW_LEN; k++) + { + Cd v = tap(ago + (ACARSAERO_UW_LEN - 1 - k) * m_sps) * (uwBit(k) ? 1.0 : -1.0); + acc += v; + if (k) { + rot += v * std::conj(prev); + } + prev = v; + } + + // The rotation again, this time from Kay's estimator rather than the plain mean + // of the symbol to symbol phase steps. + // + // Why it is worth the extra loop: the reference below is referenced to the END of + // the word, which means extrapolating the rotation across 31 symbols, so an error + // in it is multiplied by 31. The plain mean is good to about 30 Hz at this SNR, + // which sounds ample for a frequency and is not: 30 Hz over 31 symbols is + // 31 * 2*pi*30/5250 = 1.1 rad, most of the way to the quadrant boundary, and the + // detector is decision directed so it then locks to the wrong thing and the whole + // frame decodes nothing. Measured on generated signal at 20 dB, the receiver was + // losing 23 frames in 27 at a 180 Hz offset for exactly this reason. + // + // Kay weights each phase step by how much of the word it sits inside - a + // parabolic window, heaviest in the middle - which is the minimum variance + // combination for a constant frequency in white noise, and costs one more pass + // over 32 symbols. + double kaySum = 0.0; + double kayWeight = 0.0; + { + const int n = ACARSAERO_UW_LEN; + Cd previous(0.0, 0.0); + for (int k = 0; k < n; k++) + { + Cd v = tap(ago + (n - 1 - k) * m_sps) * (uwBit(k) ? 1.0 : -1.0); + if (k) + { + const Cd step = v * std::conj(previous); + if (std::abs(step) > 1e-12) + { + // 1 - ((k - n/2)/(n/2))^2, zero at the ends and one in the middle + const double x = ((double) k - n / 2.0) / (n / 2.0); + const double w = 1.0 - x * x; + kaySum += w * std::arg(step); + kayWeight += w; + } + } + previous = v; + } + } + + // Sum again with the rotation taken out, referenced to the LAST symbol of the + // word. Two things were wrong with the plain sum above once the tuning is not + // exact, and both of them only bite off frequency: + // + // - it smears. At 100 Hz the symbol to symbol advance is 0.12 rad, so across + // 32 symbols the vectors being added swing through 3.8 rad and largely + // cancel, which is a poor reference however it is pointed. + // - it points at the MIDDLE of the word. The data starts after the word, so by + // the first data symbol the reference is already half the word's rotation + // behind - 1.9 rad at 100 Hz, most of a quadrant. + // + // The detector is decision directed, so a reference that far out makes the first + // decisions wrong and the loop then locks to the wrong thing and stays there. + // That is why the receiver was bistable in tuning: at the exact centre the seed + // is good and every frame decodes, and 100 Hz away NO frame ever decodes, so the + // frame to frame carry below - which is what usually rescues the seed - never + // gets its first good frame to start from. + const double seedDphi = (kayWeight > 0.0) ? (kaySum / kayWeight) + : ((std::abs(rot) > 1e-12) ? std::arg(rot) : 0.0); + // Referenced to the FIRST symbol of the word, not the last. Aligning it to the + // last means extrapolating the rotation across 31 symbols, which multiplies the + // frequency estimate's error by 31: on the first frame of a run, before the + // frame to frame carry has anything to offer, that error is 10 to 12 Hz and + // becomes 25 degrees of phase. The loop then spends the header walking it off, + // the header decodes wrong on a channel with no noise in it, and the interleaver + // spreads the damage over all 26 signal units so the whole frame dies. + Cd aligned(0.0, 0.0); + for (int k = 0; k < ACARSAERO_UW_LEN; k++) + { + Cd v = tap(ago + (ACARSAERO_UW_LEN - 1 - k) * m_sps) * (uwBit(k) ? 1.0 : -1.0); + aligned += v * std::polar(1.0, -(double) k * seedDphi); + } + // Always, never "whichever sum is bigger". That test looked like prudence and + // was the bug: the two sums are referenced to DIFFERENT points in the word - the + // plain one to its centre, the de-rotated one to its end - and those differ by + // half the word's rotation, 15.5 symbols' worth. At 180 Hz that is 3.3 rad, so + // letting noise pick between them threw the phase reference across the quadrant + // boundary at random, frame by frame, and a decision directed detector cannot + // survive that. It is why the receiver looked chaotic in tuning rather than + // merely worse off frequency. + acc = aligned; + + double mag = std::abs(acc); + if (mag > 1e-12) + { + m_ref = acc / mag; + m_cohValid = true; + m_oqpskInit = true; + } + else + { + m_ref = Cd(1.0, 0.0); + m_cohValid = false; + m_oqpskInit = false; + } + m_dphiSym = seedDphi; + + // Now walk the carrier loop across the unique word itself, using its KNOWN bits + // where the detector would use decisions. The reference then arrives at the end + // of the word by tracking rather than by extrapolation, so it is as good as the + // loop can make it rather than as good as a single algebraic estimate - and the + // 31x amplification above is gone entirely. It is the same loop the data uses, + // so it also arrives already settled instead of converging through the header. + if (m_cohValid) + { + for (int k = 1; k < ACARSAERO_UW_LEN; k++) + { + m_ref *= std::polar(1.0, m_dphiSym); + Cd d = tap(ago + (ACARSAERO_UW_LEN - 1 - k) * m_sps) * (uwBit(k) ? 1.0 : -1.0); + const double mag = std::abs(d); + if (mag < 1e-12) { + continue; + } + d /= mag; + m_dphiSym += m_config.m_oqpskFreqGain * std::arg(d * std::conj(m_ref)); + m_ref = (1.0 - m_config.m_oqpskRefGain) * m_ref + m_config.m_oqpskRefGain * d; + const double refMag = std::abs(m_ref); + if (refMag > 1e-12) { + m_ref /= refMag; + } + } + } + + // CARRY THE FREQUENCY ACROSS FRAMES. The unique word is only 32 symbols, so the + // rotation estimated from it is coarse - and a 10500 bps frame is 2625 symbols + // long, over which even a tiny error winds up into a phase the loop then has to + // chase from behind. With the loop frozen (gains at zero) a NOISELESS channel + // decodes nothing at all, which is the proof: what the loop mostly does is not + // track a real carrier offset, it repairs this seed. + // + // A P channel is continuous and the offset is a property of the receiver and the + // satellite, not of the frame, so the value the loop has converged on by the END + // of a good frame is a far better seed for the next one than the unique word can + // ever be. Only carried from a frame that actually decoded, so a bad frame cannot + // poison the next - the same evidence gate the symbol clock phase uses. + if (m_config.m_seedQuadrant && m_cohValid) { + m_ref *= std::polar(1.0, m_config.m_seedQuadrant * M_PI / 2.0); + } + m_traceSymbol = 0; + m_traceFrame++; + if (m_config.m_traceLoop && (m_traceFrame <= 3)) + { + fprintf(stderr, "FRAME %d seed %+8.2f Hz acqDphi %+8.2f Hz (carried %d)\n", + m_traceFrame, m_dphiSym * 5250.0 / (2.0 * M_PI), + m_dphi * 5250.0 / (2.0 * M_PI), (int) m_haveCarriedDphi); + } + m_frameSeedDphi = m_dphiSym; + m_frameSeededFromUw = !m_haveCarriedDphi; + if (m_haveCarriedDphi && m_config.m_carryDphi) { + m_dphiSym = m_carriedDphi; + } + m_magMeanCoh = 0.0; + } + + // One OQPSK symbol: two bits. The Q arm is sampled HALF A SYMBOL BEFORE the I + // instant, and the stream carries the Q bit first and then the I bit - which is + // JAERO's order, pushing imag() then real() of each constellation point. The Q arm + // also comes out inverted relative to I. All three were established against the + // recording; none of them is guessable. + void oqpskSymbol(uint8_t& softQ, uint8_t& softI) + { + if (!m_oqpskInit) + { + softQ = softI = 128; + return; + } + + m_ref *= std::polar(1.0, m_dphiSym); + + const Cd yI = tap(0); + const Cd yQ = tap(m_sps / 2); + + // The Q arm is sampled HALF A SYMBOL BEFORE the I instant, so the carrier has + // rotated half a symbol's worth less by the time it was taken - m_dphiSym/2. + // Derotating both arms by the same reference leaves that as a systematic error + // on Q which grows with the frequency offset: 6 degrees at 180 Hz, 24 at 700, + // a quadrant at 2.6 kHz. And because the reference is decision directed, the + // error does not merely sit on the Q bit, it is fed back into the reference and + // the frequency, so both arms then drift. + const Cd refQ = m_ref * std::polar(1.0, -0.5 * m_dphiSym); + + double sI = (yI * std::conj(m_ref)).real(); + double sQ = (yQ * std::conj(refQ)).imag(); + + // Decision-directed update from both arms. The Q arm is rotated onto the real + // axis before it is blended in, so the two contribute symmetrically - and + // forward by the same half symbol, so that both are on the I arm's timebase + // when they reach the reference. + const double signI = (sI >= 0.0) ? 1.0 : -1.0; + const double signQ = (sQ >= 0.0) ? 1.0 : -1.0; + + Cd dI = yI * signI; + Cd dQ = yQ * Cd(0.0, -1.0) * signQ * std::polar(1.0, 0.5 * m_dphiSym); + + for (int i = 0; i < 2; i++) + { + Cd d = i ? dQ : dI; + double mag = std::abs(d); + if (mag < 1e-12) { + continue; + } + d /= mag; + m_dphiSym += m_config.m_oqpskFreqGain * std::arg(d * std::conj(m_ref)); + m_ref = (1.0 - m_config.m_oqpskRefGain) * m_ref + m_config.m_oqpskRefGain * d; + } + double refMag = std::abs(m_ref); + if (refMag > 1e-12) { + m_ref /= refMag; + } + + if (m_config.m_traceLoop && (m_traceFrame <= 3) + && ((m_traceSymbol % 250) == 0) && (m_traceSymbol <= 2625)) + { + // The rotation the loop is holding, and how far the reference is from where + // the decisions say it should be - the residual the loop has not removed + const double errI = std::arg(Cd(std::abs(sI), 0.0) * std::conj(Cd(1.0, 0.0))); + (void) errI; + fprintf(stderr, " sym %5d dphi %+8.2f Hz |sI| %7.4f |sQ| %7.4f\n", + m_traceSymbol, m_dphiSym * 5250.0 / (2.0 * M_PI), + std::abs(sI), std::abs(sQ)); + } + m_traceSymbol++; + + double mag = 0.5 * (std::abs(sI) + std::abs(sQ)); + m_magMeanCoh = (m_magMeanCoh > 0.0) ? (0.995 * m_magMeanCoh + 0.005 * mag) : mag; + double scale = (m_magMeanCoh > 1e-12) ? m_magMeanCoh : 1.0; + + // Error vector magnitude, exactly as detectCoherent() measures it and for the + // same reason: the amplitude error about the decision, with the quadrature error + // left out. The arms are staggered by half a symbol and the pulse is a raised + // cosine, which is Nyquist at multiples of T - so at one arm's sampling instant + // the other is nowhere near zero, and its crosstalk would swamp the figure. + // + // Both arms, averaged, since OQPSK carries a decision on each and either can be + // the one degrading. Only counted for this rate here: the MSK lane has its own, + // and this detector is the ONLY one 10500 bps runs, which is why the rate showed + // no quality figure at all. + const double errI = std::abs(sI) / scale - 1.0; + const double errQ = std::abs(sQ) / scale - 1.0; + const double meanSq = 0.5 * (errI * errI + errQ * errQ); + m_evmMeanSq = (m_evmMeanSq > 0.0) + ? (0.999 * m_evmMeanSq + 0.001 * meanSq) : meanSq; + + auto quantise = [scale](double v) + { + return (uint8_t) std::max(0.0, std::min(255.0, 128.0 + (v / scale) * 110.0)); + }; + softQ = quantise(-sQ); // The Q arm is inverted with respect to I + softI = quantise(sI); + } + + // Seed the coherent lane from the unique word, which is a known sequence and so a + // free training burst: reconstruct the precoded symbols it must have produced, strip + // them off, de-rotate by the frequency estimate the correlator already gave us, and + // average. 33 symbols of data-aided estimate is a far better starting phase than + // anything a decision-directed loop reaches on its own within a frame. + // + // The overall sign of the reconstruction is arbitrary (b[0] is taken as +1), which + // does not matter: the differential decode downstream cancels any constant sign. + void seedCoherent(int ago) + { + m_dphiSym = m_dphi; + + Cd acc(0.0, 0.0); + double b = 1.0; + + for (int i = 0; i <= ACARSAERO_UW_LEN; i++) + { + // Symbol i of the unique word span sits (UW_LEN - i) symbols before the + // reference symbol, which is itself at tap(ago) + Cd y = tap(ago + (ACARSAERO_UW_LEN - i) * m_sps); + int n = i - ACARSAERO_UW_LEN; // Index relative to the reference + acc += derotate(y, n) * b * std::polar(1.0, -n * m_dphiSym); + + if (i < ACARSAERO_UW_LEN) { + b *= uwBit(i) ? 1.0 : -1.0; + } + } + + double mag = std::abs(acc); + if (mag > 1e-12) + { + m_ref = acc / mag; + m_cohValid = true; + } + else + { + m_ref = Cd(1.0, 0.0); + m_cohValid = false; + } + // The reference symbol's own projection starts the differential decode + m_projPrev = (derotate(tap(ago), 0) * std::conj(m_ref)).real(); + } + + // One coherent symbol: project onto the tracked reference, decide, feed the + // frequency and reference loops, then combine with the previous projection to undo + // MSK's precoding. + // + // The combination is min-sum, not the product the differential lane uses. Two soft + // values feeding an exclusive-or have log-likelihood + // 2 atanh(tanh(a/2) tanh(b/2)), and sign(ab) min(|a|,|b|) is its standard + // approximation - the same one every LDPC and turbo decoder uses. A raw product + // would let one confident symbol inflate an unreliable one. + uint8_t softBitCoherent(const Cd& sym, int index) + { + if (!m_cohValid) { + return 128; + } + + Cd u = derotate(sym, index); + const Cd refUsed = m_ref * std::polar(1.0, m_dphiSym); + + // Keep the reference phase UNWRAPPED. Smoothing has to happen in the phase + // domain, not by averaging the phasor: a reference that is rotating - which it + // is whenever there is any carrier offset - averages towards zero magnitude and + // a biased angle, whereas a linear phase ramp averages to its own centre value + // exactly. + { + double p = std::arg(refUsed); + double d = p - m_refPhaseAcc; + while (d > M_PI) { d -= 2.0 * M_PI; } + while (d < -M_PI) { d += 2.0 * M_PI; } + m_refPhaseAcc += d; + } + + // Buffered for smoothCoherent() only, which runs on a P channel data field and + // nowhere else. R and T bursts never reach the header, so nothing clears these + // for them: buffering in every state let them grow without bound on an R/T + // channel. The loop itself still runs on everything, so the EVM and the carrier + // tracking are unchanged; and a P header's symbols were cleared out when it was + // accepted anyway, so the data field's buffer is exactly what it was + if (m_state == StateData) + { + m_symBuf.push_back(u); + m_refPhase.push_back(m_refPhaseAcc); + } + + Cd proj = u * std::conj(refUsed); + double s = proj.real(); + double sign = (s >= 0.0) ? 1.0 : -1.0; + + // Phase error with the decision removed, for the frequency loop + double residual = std::arg(proj * sign); + m_dphiSym += m_config.m_freqGain * residual; + + // Reference blend, decision-directed. updateRef does the one symbol prediction. + double mag = std::abs(u); + Cd yDemod = (mag > 1e-12) ? (u * sign / mag) : Cd(1.0, 0.0); + m_ref *= std::polar(1.0, m_dphiSym); + m_ref = (1.0 - m_config.m_refGain) * m_ref + m_config.m_refGain * yDemod; + double refMag = std::abs(m_ref); + if (refMag > 1e-12) { + m_ref /= refMag; + } + + m_magMeanCoh = (m_magMeanCoh > 0.0) + ? (0.99 * m_magMeanCoh + 0.01 * std::abs(s)) : std::abs(s); + double scale = (m_magMeanCoh > 1e-12) ? m_magMeanCoh : 1.0; + + // Error vector magnitude, from the IN PHASE component only. + // + // The textbook EVM would include the quadrature error too, but for MSK the + // imaginary axis of a derotated symbol carries the ORTHOGONAL arm's crosstalk - + // large, data dependent and nothing to do with signal quality. Including it + // would report a terrible EVM on a perfect signal. What is left is the amplitude + // error about the decision, which for BPSK in noise is sigma/A and so still + // tracks SNR: about 30% at 10 dB Es/N0, 10% at 20 dB. + // + // Exponentially averaged rather than accumulated, so it describes the signal now + // rather than the whole session. + const double evmErr = std::abs(s) / scale - 1.0; + m_evmMeanSq = (m_evmMeanSq > 0.0) + ? (0.999 * m_evmMeanSq + 0.001 * evmErr * evmErr) + : evmErr * evmErr; + + double a = s / scale; + double p = m_projPrev / scale; + m_projPrev = s; + + double v = ((a * p) >= 0.0 ? 1.0 : -1.0) * std::min(std::abs(a), std::abs(p)); + return (uint8_t) std::max(0.0, std::min(255.0, 128.0 + v * 110.0)); + } + + // Second pass over the frame: SMOOTH the tracking loop's carrier reference, using + // symbols from both sides of each instant, and detect against that instead. + // + // The loop is causal and first order - at a blend of 0.30 its memory is about three + // symbols, so its phase is nearly as noisy as one symbol, and it necessarily lags + // whatever it follows. A receiver that buffers a whole frame before decoding is + // under no such constraint: it can look forwards as well as backwards. That is the + // one advantage this pass takes, and it is the only smoother in the receiver. + // + // Phase accuracy earns more here than it would on plain BPSK. In the derotated view + // of MSK the orthogonal arm sits entirely in quadrature, so the real part rejects it + // exactly - but only while the reference is right. An error of theta both attenuates + // the wanted arm by cos(theta) and leaks the other one in at sin(theta), and that + // second term is interference, not noise. + // + // Smoothing the reference is deliberately modest. Fitting a carrier MODEL to the + // frame - a constant phase and a constant frequency - measures better still when it + // is handed the right frequency (359 messages against 289), but nothing available + // estimates that frequency well enough to extrapolate over 1152 symbols: squaring, + // the textbook decision-free method for BPSK, is destroyed by the crosstalk on the + // imaginary axis and returned half a radian per symbol on a signal with no offset at + // all; stripping the modulation with the decisions is bistable, because one wrong + // decision flips a term rather than shrinking it; and the loop's own integrator is a + // control signal, not an estimate. Smoothing needs no frequency estimate at all. + void smoothCoherent() + { + const size_t n = m_symBuf.size(); + if (!m_cohValid || (n < 64) || (m_softBitsCoh.size() != n) || (m_refPhase.size() != n)) { + return; + } + + const int half = std::max(1, m_config.m_smoothHalf); + + // Running sum, so the window costs one add and one subtract per symbol + std::vector prefix(n + 1, 0.0); + for (size_t i = 0; i < n; i++) { + prefix[i + 1] = prefix[i] + m_refPhase[i]; + } + + double magMean = 0.0; + std::vector proj(n); + + for (size_t i = 0; i < n; i++) + { + size_t from = (i > (size_t) half) ? (i - half) : 0; + size_t to = std::min(n, i + half + 1); + double mean = (prefix[to] - prefix[from]) / (double) (to - from); + + // A centred average of a phase ramp gives the ramp's value at the window + // centre, which is only this symbol when the window is not clipped by an + // end of the frame. Correct for that with the local slope. + double centre = 0.5 * (double) (from + to - 1); + double slope = (n > 1) ? ((m_refPhase[n - 1] - m_refPhase[0]) / (double) (n - 1)) : 0.0; + double phase = mean + slope * ((double) i - centre); + + proj[i] = (m_symBuf[i] * std::polar(1.0, -phase)).real(); + magMean += std::abs(proj[i]); + } + + magMean = (n > 0) ? (magMean / n) : 1.0; + if (magMean < 1e-12) { + return; + } + + double prev = m_projPrevFirst; + for (size_t i = 0; i < n; i++) + { + double a = proj[i] / magMean; + double p = prev / magMean; + prev = proj[i]; + double v = ((a * p) >= 0.0 ? 1.0 : -1.0) * std::min(std::abs(a), std::abs(p)); + m_softBitsCoh[i] = (uint8_t) std::max(0.0, std::min(255.0, 128.0 + v * 110.0)); + } + } + + // Soft bit from differential detection, 255 = strong 1. + // + // Scaled by a running mean of the product magnitude rather than per symbol. + // Normalising each symbol by its own magnitude throws away exactly the information + // the Viterbi decoder wants: a symbol landing near the origin is the one that + // should be marked uncertain, and dividing by its own small magnitude instead + // promotes it to full confidence. + uint8_t softBit(const Cd& sym) + { + // Remove the carrier offset estimated at acquisition so the product stays on + // the real axis over the whole frame + Cd d = differential(sym, m_prevSym) * std::polar(1.0, -m_dphi); + m_prevSym = sym; + + double mag = std::abs(d); + m_magMean = (m_magMean > 0.0) ? (0.99 * m_magMean + 0.01 * mag) : mag; + double ref = (m_magMean > 1e-12) ? m_magMean : 1.0; + // The scale factor here is not a tuning knob and was measured not to be one. + // viterbiDecode's branch metric is |s - 255c|, so the difference between the + // two branches is exactly 2s - 255: affine in s, which makes the survivor + // decisions invariant to any positive scaling of the soft values. Sweeping this + // from 1 to 1000 changed nothing at all, at any Eb/N0. 110 simply uses most of + // the range without clipping typical symbols. + double scaled = 128.0 + (d.real() / ref) * 110.0; + return (uint8_t) std::max(0.0, std::min(255.0, scaled)); + } + + void processSymbol() + { + m_symbolCount++; // Symbols since the unique word + + if (isOqpsk(m_rate)) + { + // Two bits per symbol, and no differential lane: OQPSK is not precoded, so + // there is nothing for a differential detector to recover + uint8_t softQ, softI; + oqpskSymbol(softQ, softI); + consumeSoftBit(softQ, 128); + if (m_state != StateSearch) { + consumeSoftBit(softI, 128); + } + return; + } + + // The coherent lane has to see tap(0) BEFORE the differential lane consumes it, + // because softBit advances m_prevSym + uint8_t softCoh = m_config.m_coherent ? softBitCoherent(tap(0), m_symbolCount) : 128; + uint8_t soft = softBit(tap(0)); + consumeSoftBit(soft, softCoh); + } + + void consumeSoftBit(uint8_t soft, uint8_t softCoh) + { + switch (m_state) + { + case StateHeader: + m_headerBits.push_back((uint8_t) (soft >= 128 ? 1 : 0)); + if ((int) m_headerBits.size() == ACARSAERO_HEADER_LEN) + { + uint16_t header = 0; + for (uint8_t b : m_headerBits) { + header = (uint16_t) ((header << 1) | b); + } + int distance = headerDistance(header); + m_frameHeaderDistance = distance; + if (distance > 0) { + m_stats.m_headerBad++; + } + + // The header is the weakest thing in the frame: 16 bits, uncoded and + // hard decided, where everything behind it is rate 1/2 coded and + // interleaved and carries its own CRC per signal unit. It is not there + // to check the data - it is there to stop a false sync burning a whole + // frame, and it earns its place at correlations near the sync threshold, + // where noise does reach. + // + // But a unique word that correlated at 0.96 IS a frame, and rejecting it + // for header bit errors throws away 26 signal units that would have + // decoded. Measured on a real off air recording: a 100 Hz tuning error + // left the correlation at 0.96 to 0.97 and unchanged, while header + // rejections went from 4 frames in 193 to 272 in 273 - the whole channel + // lost, with the data behind it perfectly good. So the tolerance follows + // the correlation: strict where the sync was marginal, and off where it + // was emphatic. + // OQPSK only. The MSK correlator is a different statistic - differential, + // over the transitions between 33 symbols rather than 32 symbols - and it + // sits near 0.9 on a clean channel, so the same threshold would disable + // the check for those rates. Measured: it cost 600 bps P a message and + // six signal unit CRCs on a channel with no noise in it at all. + const int maxErrors = + (isOqpsk(m_rate) && (m_syncCorrelation >= m_config.m_headerTrustCorrelation)) + ? m_config.m_headerMaxErrorsTrusted + : m_config.m_headerMaxErrors; + if (distance > maxErrors) + { + m_stats.m_headerRejected++; + m_state = StateSearch; + m_syncPending = false; + m_missedFrames = 0; + } + else + { + m_header = header; + m_softBits.clear(); + m_softBitsCoh.clear(); + // The buffers must start where the soft bits do + m_symBuf.clear(); + m_refPhase.clear(); + m_projPrevFirst = m_projPrev; + // The symbol buffer has to start where the soft bits do, or the + // refit's own length check quietly disables it + m_softBits.reserve(codedBitsPerFrame(m_rate) + dummyBits(m_rate)); + m_softBitsCoh.reserve(codedBitsPerFrame(m_rate) + dummyBits(m_rate)); + m_state = StateData; + } + } + break; + + case StateData: + m_softBits.push_back(soft); + m_softBitsCoh.push_back(softCoh); + if ((int) m_softBits.size() == codedBitsPerFrame(m_rate) + dummyBits(m_rate)) + { + decodeFrame(); + armTracking(); + } + break; + + case StateBurst: + m_burstBits.push_back(soft); + tryBurstDecode(); + break; + + default: + break; + } + } + + // Bits that would have to flip to make this a legal header: the format ID nibble + // must read 1, and the two copies of the frame counter must agree. The super frame + // marker is unconstrained, so it never contributes. 0 means already legal, 8 is the + // worst case. + static int headerDistance(uint16_t header) + { + auto bits = [](unsigned v) + { + int n = 0; + while (v) { n += (int) (v & 1); v >>= 1; } + return n; + }; + return bits((unsigned) (((header >> 12) & 0x0F) ^ 0x01)) + + bits((unsigned) (((header >> 4) & 0x0F) ^ (header & 0x0F))); + } + + static bool headerValid(uint16_t header) { return headerDistance(header) == 0; } + + // --------------------------------------------------------------------------------- + // Frame decode: deinterleave block by block, Viterbi, descramble, split into + // signal units + // --------------------------------------------------------------------------------- + + // Deinterleave, Viterbi, descramble and pack one lane's soft bits into octets. + // + // The frame is decoded with BOTH ends of the encoder unknown. The start is unknown + // because the P channel encoder runs continuously across frame boundaries, and the + // end because the frame is exactly full of data with no room for a flush. + // + // Handing the previous frame's final state over as this frame's start looks free - + // the encoder is continuous, so it is even exact in principle - and measures worse: + // the first signal unit fell from 95% to 81%. The reason is that the state handed + // over comes from the traceback's END, which is precisely the unflushed part of the + // previous frame and so its least reliable bits. Being confidently wrong about the + // start state costs more than admitting it is unknown. + void decodeLane(const std::vector& soft, std::vector& octets) const + { + const int cols = interleaverCols(m_rate); + const int blockLen = ACARSAERO_INTERLEAVER_ROWS * cols; + const int coded = codedBitsPerFrame(m_rate); + const int dummies = dummyBits(m_rate); + + // Decoding THROUGH the frame boundary was tried and made no difference at all. + // The last signal unit sits at the traceback's starting edge, so extending the + // block with the next frame's first interleaver block - a genuine continuation, + // because the P channel encoder runs continuously - should have given the + // traceback a future to converge on. On a live capture whose signal units fell + // 87/87/82/77/74/74 percent across the frame it moved the total from 1250 to + // 1251 of 1560, and left the profile unchanged. So the traceback converges long + // before the frame ends, and whatever costs the later units is not this. + std::vector de(coded); + for (int b = 0; b < coded / blockLen; b++) + { + deinterleave(soft.data() + dummies + b * blockLen, cols, + de.data() + b * blockLen); + } + + // Neither end of the frame is a known encoder state: the P channel encoder runs + // continuously across frame boundaries (measured - forcing state 0 at the start + // cost the first signal unit of three frames in four on a real recording), and + // there is no flush at the end because the frame is exactly full of data. + std::vector bits; + AcarsHfdlReceiver::viterbiDecode(de, coded / 2, bits, false, false); + + octets.assign(bits.size() / 8, 0); + for (size_t i = 0; i < bits.size(); i++) + { + uint8_t b = (uint8_t) (bits[i] ^ scramblerBit((int) i)); + octets[i / 8] = (uint8_t) (octets[i / 8] | (b << (i % 8))); + } + } + + // Both lanes are decoded and the CRC arbitrates PER SIGNAL UNIT, not per frame: a + // carrier slip part way through a frame costs the coherent lane only the units after + // it, and the differential lane covers those. Neither lane can lose a unit the other + // would have got, which is the same guarantee HFDL's equalizer lane gives. + void decodeFrame() + { + // OQPSK has no differential lane to arbitrate against - it is not precoded, so + // there is nothing for a differential detector to recover - and its coherent + // output goes straight into the primary soft bits + if (m_config.m_coherent && m_config.m_smooth && !isOqpsk(m_rate)) { + smoothCoherent(); + } + + std::vector octets; + decodeLane(m_softBits, octets); + + std::vector octetsCoh; + bool haveCoh = m_config.m_coherent && m_cohValid && !isOqpsk(m_rate) + && (m_softBitsCoh.size() == m_softBits.size()); + if (haveCoh) { + decodeLane(m_softBitsCoh, octetsCoh); + } + + m_stats.m_framesDecoded++; + int suOkThisFrame = 0; + + // How much of the frame came back, which is the statistic that mattered while + // the 10500 bps frame losses were being chased: a frame is 26 signal units + // sharing one interleaver and one coded block, so it comes back whole or not at + // all, and "0 of 26 with a perfect header" is a very different fault from a few + // units failing. + if (m_config.m_traceLoop && isOqpsk(m_rate)) + { + int here = 0; + for (size_t i = 0; i + ACARSAERO_SU_LEN <= octets.size(); i += ACARSAERO_SU_LEN) + { + if (suCrcOk(octets.data() + i, ACARSAERO_SU_LEN)) { + here++; + } + } + fprintf(stderr, " FRAME yield %2d/26 header distance %2d of 16\n", + here, m_frameHeaderDistance); + } + + for (size_t i = 0; i + ACARSAERO_SU_LEN <= octets.size(); i += ACARSAERO_SU_LEN) + { + const uint8_t *diff = octets.data() + i; + bool diffOk = suCrcOk(diff, ACARSAERO_SU_LEN); + size_t pos = i / ACARSAERO_SU_LEN; + bool anyOk = diffOk; + + if (!anyOk && haveCoh && (i + ACARSAERO_SU_LEN <= octetsCoh.size())) { + anyOk = suCrcOk(octetsCoh.data() + i, ACARSAERO_SU_LEN); + } + if (pos < ACARSAERO_MAX_SUS) + { + if (anyOk) { + m_stats.m_suOkByPos[pos]++; + } else { + m_stats.m_suBadByPos[pos]++; + } + } + if (anyOk) { + suOkThisFrame++; + } + + if (diffOk) + { + m_stats.m_suFromDifferential++; + processSignalUnit(diff, ACARSAERO_SU_LEN); + continue; + } + + if (haveCoh && (i + ACARSAERO_SU_LEN <= octetsCoh.size())) + { + const uint8_t *coh = octetsCoh.data() + i; + if (suCrcOk(coh, ACARSAERO_SU_LEN)) + { + m_stats.m_suFromCoherent++; + processSignalUnit(coh, ACARSAERO_SU_LEN); + continue; + } + } + + // Neither lane passed. Hand the differential one over anyway so the fill and + // bad-CRC counters stay comparable with the single lane build. + processSignalUnit(diff, ACARSAERO_SU_LEN); + } + + // Commit the symbol clock phase this frame ran on if it decoded, and FLIP TO THE + // ALIAS if it did not. + // + // Nothing in the unique word can choose between the two phases - OQPSK carries + // the same 32 bit word on BOTH arms (see uwBits()), so the two are genuinely + // indistinguishable there, which is why every criterion tried on it landed on the + // wrong one about half the time. But there are only ever TWO candidates, half a + // symbol apart, so a frame that decodes nothing has already identified the other + // one as correct. That turns a coin flip repeated every frame into at most one + // wasted frame per acquisition. + // + // A frame started on the wrong phase yields ZERO signal units, never a few, so + // this is a clean signal rather than a threshold. + // A frame that decoded NOTHING says the carried rotation no longer describes the + // signal, so it is dropped and the next frame seeds itself from the unique word + // again. Without this the carry is a trap rather than a shortcut: it is only ever + // refreshed by a frame that decodes, so once it stops matching, nothing decodes, + // and because nothing decodes it is never refreshed. The receiver stays locked to + // the unique word the whole time - the correlator is differential and finds the + // word whatever the offset - so it never gives up and re-acquires either. + // + // That is what retuning the channel did to it. Moving the frequency offset moves + // the residual by the same amount, the carried figure is wrong by that much from + // the next frame onwards, and the demodulator went silent until the mode or rate + // was changed - which is the one path that resets the receiver outright. + // + // Seeding from the word costs nothing now: Kay's estimator over the 32 symbols is + // good to a few Hz, which is what the carry was introduced to improve on when the + // seed was a plain mean and 30 Hz out. + if (isOqpsk(m_rate) && (suOkThisFrame == 0)) { + m_haveCarriedDphi = false; + } + + if (isOqpsk(m_rate) && (suOkThisFrame > 0)) + { + // Taken outright rather than averaged over frames: blending the previous + // value in at 0.5, 0.3 and 0.15 measured identical to the message, because + // the loop converges to the same figure inside every frame and there is + // almost no frame to frame variance left to average away. + const double seedError = std::abs(m_dphiSym - m_frameSeedDphi); + m_stats.m_seedErrorSum += seedError; + m_stats.m_convergedSum += m_dphiSym; + m_stats.m_seedCount++; + if (seedError > m_stats.m_seedErrorMax) { + m_stats.m_seedErrorMax = seedError; + } + m_carriedDphi = m_dphiSym; + m_haveCarriedDphi = true; + } + + if (isOqpsk(m_rate) && (m_framePhase >= 0) && (suOkThisFrame == 0)) { + m_stats.m_phaseDeadFrames++; + } + if (isOqpsk(m_rate) && (m_framePhase >= 0)) + { + const int bucket = (suOkThisFrame == 0) ? 0 + : (suOkThisFrame < ACARSAERO_MAX_SUS / 2) ? 1 + : (suOkThisFrame < ACARSAERO_MAX_SUS) ? 2 : 3; + m_stats.m_frameYield[bucket]++; + const int ph = m_framePhase % 32; + if (suOkThisFrame == 0) { + m_stats.m_phaseHistDead[ph]++; + } else if (suOkThisFrame >= ACARSAERO_MAX_SUS) { + m_stats.m_phaseHistOk[ph]++; + } + } + if (isOqpsk(m_rate) && m_frameSeededFromUw) + { + m_stats.m_seededFromUw++; + if (suOkThisFrame > 0) { + m_stats.m_seededFromUwOk++; + } + } + if (isOqpsk(m_rate) && (m_framePhase >= 0)) + { + if (suOkThisFrame > 0) + { + m_lockedPhase = m_framePhase; + m_phaseConfirmed = true; + m_phaseFailures = 0; + m_stats.m_phaseConfirms++; + } + else if (!m_phaseConfirmed + || (++m_phaseFailures >= ACARSAERO_PHASE_FAILURES)) + { + // Flip to the other candidate. Only ever on an UNCONFIRMED phase, or + // after several consecutive dead frames on a confirmed one: a frame that + // decodes nothing means the wrong arm at high SNR, but near the cliff it + // usually just means noise, and flipping then throws away a phase that was + // right. Doing it unconditionally cost most of the sensitivity - header + // rejections ran to 18 of 24 frames at 5 dB because each noise-killed + // frame flipped the lock and broke the next one too. + m_lockedPhase = (m_framePhase + m_sps / 2) % m_sps; + m_phaseConfirmed = false; + m_phaseFailures = 0; + m_stats.m_phaseFlips++; + } + } + expireReassemblies(); + } + + // --------------------------------------------------------------------------------- + // R/T bursts. An R burst is five interleaver columns holding one 19 octet signal + // unit. A T burst is five columns of header - a 6 octet header with its own CRC - + // then three columns per 12 octet signal unit, so every three column boundary is a + // candidate end of burst and is tried until the CRCs pass. + // --------------------------------------------------------------------------------- + + void tryBurstDecode() + { + const int rows = ACARSAERO_INTERLEAVER_ROWS; + int filled = (int) m_burstBits.size(); + + if ((filled % rows) != 0) { + return; + } + int cols = filled / rows; + if (cols < ACARSAERO_BURST_HEAD_COLS) { + return; + } + if (((cols - ACARSAERO_BURST_HEAD_COLS) % ACARSAERO_BURST_SU_COLS) != 0) { + return; + } + if (cols > ACARSAERO_BURST_MAX_COLS) + { + abandonBurst(); + return; + } + + std::vector de(filled); + if (isOqpsk(m_rate)) { + deinterleave(m_burstBits.data(), cols, de.data()); + } else { + deinterleaveBurstMsk(m_burstBits.data(), cols, de.data()); + } + + std::vector bits; + AcarsHfdlReceiver::viterbiDecode(de, filled / 2, bits, false); + + std::vector octets(bits.size() / 8, 0); + for (size_t i = 0; i < bits.size(); i++) + { + uint8_t b = (uint8_t) (bits[i] ^ scramblerBit((int) i)); + octets[i / 8] = (uint8_t) (octets[i / 8] | (b << (i % 8))); + } + + if (cols == ACARSAERO_BURST_HEAD_COLS) + { + // An R burst is one 19 octet signal unit + if ((m_channel == ChannelR) && (octets.size() >= ACARSAERO_R_SU_LEN) + && suCrcOk(octets.data(), ACARSAERO_R_SU_LEN)) + { + m_stats.m_bursts++; + processSignalUnit(octets.data(), ACARSAERO_R_SU_LEN); + endBurst(); + return; + } + // Otherwise it may be a T burst header, which has to pass its own CRC before + // any signal unit behind it is worth looking at + if ((m_channel == ChannelT) && (octets.size() >= ACARSAERO_T_HEADER_LEN) + && suCrcOk(octets.data(), ACARSAERO_T_HEADER_LEN)) { + return; // Keep accumulating signal units + } + // Neither an R signal unit nor a T header, so this was a false correlation. + // Give up now: holding on to the maximum burst length instead would leave + // the receiver deaf for seconds, which at 1200 symbols/s is most of a + // recording. Costing a false sync five columns bounds it to a quarter + // second. + abandonBurst(); + return; + } + + // T burst: the header, then one signal unit per three columns. + // + // How many signal units there are cannot be taken from the burst length, because + // the length is what we are trying to find. Accepting the first column count at + // which everything passes does not work either - the ISU alone passes its own CRC, + // so a ten unit burst was being accepted as a one unit burst and truncated, which + // is why generated T bursts yielded signal units but never a whole message. + // + // JAERO takes the count from SIX BITS at the start of signal unit ONE, read once + // eleven columns are in, as count = 2 + those bits. That works because the SSU + // sequence numbers count DOWN: unit one of an N unit chain carries SEQNO N-2, so + // 2 + SEQNO is N. The burst then ends at 5 + 3N columns, and no other length is + // worth testing. + // + // Like JAERO, this cannot decode a single unit T burst - the count lives in a + // unit that such a burst does not have. + if (!suCrcOk(octets.data(), ACARSAERO_T_HEADER_LEN)) { + return; + } + + if (m_burstTargetSus == 0) + { + const int probeCols = ACARSAERO_BURST_HEAD_COLS + 2 * ACARSAERO_BURST_SU_COLS; + if (cols < probeCols) { + return; + } + size_t at = (size_t) ACARSAERO_T_HEADER_LEN + ACARSAERO_SU_LEN; + if (octets.size() <= at) { + return; + } + int count = 2 + (octets[at] & 0x3F); + if (count >= 16) { + count = count / 2 + 1; + } + if ((count < 2) || (ACARSAERO_BURST_HEAD_COLS + count * ACARSAERO_BURST_SU_COLS + > ACARSAERO_BURST_MAX_COLS)) + { + abandonBurst(); + return; + } + m_burstTargetSus = count; + } + + if (cols != ACARSAERO_BURST_HEAD_COLS + m_burstTargetSus * ACARSAERO_BURST_SU_COLS) { + return; + } + + int sus = m_burstTargetSus; + if ((int) octets.size() < ACARSAERO_T_HEADER_LEN + sus * ACARSAERO_SU_LEN) { + return; + } + for (int i = 0; i < sus; i++) + { + if (!suCrcOk(octets.data() + ACARSAERO_T_HEADER_LEN + i * ACARSAERO_SU_LEN, + ACARSAERO_SU_LEN)) { + return; // Not the end of the burst yet + } + } + + m_stats.m_bursts++; + for (int i = 0; i < sus; i++) { + processSignalUnit(octets.data() + ACARSAERO_T_HEADER_LEN + i * ACARSAERO_SU_LEN, + ACARSAERO_SU_LEN); + } + endBurst(); + } + + void endBurst() + { + m_state = StateSearch; + m_syncPending = false; + m_burstBits.clear(); + m_burstTargetSus = 0; + expireReassemblies(); + } + + // --------------------------------------------------------------------------------- + // Signal units + // --------------------------------------------------------------------------------- + + void processSignalUnit(const uint8_t *su, int len) + { + if (!suCrcOk(su, len)) + { + // Real P channels transmit all zero signal units as fill, and their CRC + // field is zero rather than a real CRC over zeros + if (m_config.m_acceptZeroFill && allZero(su, len)) + { + m_stats.m_suFill++; + return; + } + m_stats.m_suCrcBad++; + m_suRate = (m_suRate < 0.0) ? 0.0 : (0.95 * m_suRate + 0.05 * 0.0); + return; + } + + m_stats.m_suCrcOk++; + m_suRate = (m_suRate < 0.0) ? 1.0 : (0.95 * m_suRate + 0.05 * 1.0); + uint8_t type = su[0]; + + if (type == SuFill) + { + m_stats.m_suFill++; + return; + } + + if (type == SuUserDataIsu) + { + handleIsu(su, len); + return; + } + if (isSsu(type)) + { + handleSsu(su, len); + return; + } + + if (m_config.m_emitNonAcars) { + emitNonAcars(su, len); + } + } + + void handleIsu(const uint8_t *su, int len) + { + (void) len; + m_stats.m_isus++; + + IsuKey key; + key.m_aesId = ((uint32_t) su[1] << 16) | ((uint32_t) su[2] << 8) | su[3]; + key.m_gesId = su[4]; + key.m_qNo = (uint8_t) ((su[5] >> 4) & 0x0F); + key.m_refNo = (uint8_t) (su[5] & 0x0F); + + // Only evict for a genuinely NEW key. An ISU for a chain already in progress - + // a retransmission, or a replacement after the ground station starts the chain + // again - does not grow the map, so evicting to make room for it would destroy + // an unrelated live chain for nothing. + if ((m_reassembly.find(key) == m_reassembly.end()) + && ((int) m_reassembly.size() >= m_config.m_maxReassemblies)) { + dropOldestReassembly(); + } + + Reassembly& r = m_reassembly[key]; + r.m_remaining = su[6] & 0x3F; + r.m_lastOctets = (su[7] >> 4) & 0x0F; + r.m_started = m_time; + r.m_data.assign(su + 8, su + 10); + + if (r.m_remaining == 0) + { + completeReassembly(key, r); + m_reassembly.erase(key); + } + } + + void handleSsu(const uint8_t *su, int len) + { + (void) len; + m_stats.m_ssus++; + + int seqNo = su[0] & 0x3F; + uint8_t qNo = (uint8_t) ((su[1] >> 4) & 0x0F); + uint8_t refNo = (uint8_t) (su[1] & 0x0F); + + // The queue and reference numbers plus the expected sequence number identify + // which chain this belongs to; the aircraft address appears only in the ISU. + // SEQNO counts down and is one BELOW the count still outstanding, so the first + // SSU of a chain of N carries N-1 and the last carries zero. + // + // (JAERO compares the aircraft address too, but an SSU does not carry one - it + // reuses whatever the last ISU parsed left in a shared scratch item. Matching + // on the queue and reference numbers alone, across all chains in flight, is + // what the fields actually support.) + for (auto it = m_reassembly.begin(); it != m_reassembly.end(); ++it) + { + if ((it->first.m_qNo != qNo) || (it->first.m_refNo != refNo)) { + continue; + } + if (it->second.m_remaining != seqNo + 1) { + continue; + } + + Reassembly& r = it->second; + r.m_remaining--; + if (r.m_remaining == 0) + { + int octets = r.m_lastOctets; + if ((octets < 1) || (octets > 8)) { + octets = 8; + } + r.m_data.insert(r.m_data.end(), su + 2, su + 2 + octets); + IsuKey key = it->first; + completeReassembly(key, r); + m_reassembly.erase(it); + } + else + { + r.m_data.insert(r.m_data.end(), su + 2, su + 10); + } + return; + } + + m_stats.m_ssuOrphan++; + } + + void completeReassembly(const IsuKey& key, const Reassembly& r) + { + m_stats.m_reassembled++; + + Frame f; + f.m_uplink = (m_channel == ChannelP); + f.m_aesId = key.m_aesId; + f.m_gesId = key.m_gesId; + f.m_bitRate = bitRate(m_rate); + f.m_channel = m_channel; + + if (looksLikeAcars(r.m_data)) + { + f.m_isAcars = true; + f.m_type = "ACARS"; + f.m_bytes = acarsBlock(r.m_data); + m_stats.m_acarsFrames++; + } + else + { + f.m_type = "User data"; + f.m_bytes = r.m_data; + m_stats.m_otherFrames++; + } + m_frames.push_back(f); + } + + void emitNonAcars(const uint8_t *su, int len) + { + Frame f; + f.m_uplink = (m_channel == ChannelP); + f.m_type = suTypeName(su[0]); + f.m_bitRate = bitRate(m_rate); + f.m_channel = m_channel; + f.m_bytes.assign(su, su + len - ACARSAERO_SU_CRC_LEN); + + // Signal units addressed to or from an aircraft carry the AES address in octets + // 1 to 3 and the GES in octet 4, the same place the user data ISU has them. + // Broadcasts do not - see suHasAesId() + if ((len >= 6) && suHasAesId(su[0])) + { + f.m_aesId = ((uint32_t) su[1] << 16) | ((uint32_t) su[2] << 8) | su[3]; + f.m_gesId = su[4]; + } + m_stats.m_otherFrames++; + m_frames.push_back(f); + } + + void abandonBurst() + { + m_stats.m_burstsBad++; + m_state = StateSearch; + m_syncPending = false; + m_burstBits.clear(); + m_burstTargetSus = 0; + } + + // Called once per decoded frame or finished burst, not per sample: an ISU/SSU chain + // spans several frames at 600 bps, so frame cadence is fine resolution for a + // timeout measured in a minute or two, and per-sample would be 19200 map walks a + // second for nothing. + void expireReassemblies() + { + if (m_reassembly.empty()) { + return; + } + for (auto it = m_reassembly.begin(); it != m_reassembly.end(); ) + { + if (m_time - it->second.m_started > m_config.m_reassemblyTimeout) + { + m_stats.m_reassemblyTimeouts++; + it = m_reassembly.erase(it); + } + else + { + ++it; + } + } + } + + void dropOldestReassembly() + { + auto oldest = m_reassembly.begin(); + for (auto it = m_reassembly.begin(); it != m_reassembly.end(); ++it) + { + if (it->second.m_started < oldest->second.m_started) { + oldest = it; + } + } + if (oldest != m_reassembly.end()) + { + m_stats.m_reassemblyTimeouts++; + m_reassembly.erase(oldest); + } + } + + uint16_t m_header = 0; +}; + +#endif // INCLUDE_ACARSAERO_H diff --git a/plugins/channelrx/demodacars/acarsdemod.cpp b/plugins/channelrx/demodacars/acarsdemod.cpp index 345259c67..7a71270a6 100644 --- a/plugins/channelrx/demodacars/acarsdemod.cpp +++ b/plugins/channelrx/demodacars/acarsdemod.cpp @@ -1,514 +1,769 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2015-2018 Edouard Griffiths, F4EXB. // -// Copyright (C) 2021 Jon Beniston, M7RCE // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include "acarsdemod.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "SWGChannelSettings.h" -//#include "SWGACARSDemodSettings.h" -#include "SWGChannelReport.h" -#include "SWGMapItem.h" - -#include "dsp/dspengine.h" -#include "dsp/dspcommands.h" -#include "device/deviceapi.h" -#include "feature/feature.h" -#include "util/db.h" -#include "maincore.h" - -#include "acarsdemodworker.h" - -MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgConfigureAcarsDemod, Message) -MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgVdl2Frame, Message) -MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgHfdlFrame, Message) -MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgAeroFrame, Message) -MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgProtocolChange, Message) - -const char * const AcarsDemod::m_channelIdURI = "sdrangel.channel.acarsdemod"; -const char * const AcarsDemod::m_channelId = "ACARSDemod"; - -AcarsDemod::AcarsDemod(DeviceAPI *deviceAPI) : - ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), - m_deviceAPI(deviceAPI), - m_basebandSampleRate(0) -{ - setObjectName(m_channelId); - - m_basebandSink = new AcarsDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); - m_basebandSink->setChannel(this); - m_basebandSink->moveToThread(&m_thread); - - // Decoded frames are processed by the worker on its own thread, for the - // channel's lifetime, in both GUI and server builds - m_workerThread = new QThread(); - m_worker = new AcarsDemodWorker(this); - m_worker->moveToThread(m_workerThread); - QObject::connect(m_workerThread, &QThread::started, m_worker, &AcarsDemodWorker::startWork); - QObject::connect(m_workerThread, &QThread::finished, m_worker, &QObject::deleteLater); - QObject::connect(m_workerThread, &QThread::finished, m_workerThread, &QThread::deleteLater); - m_workerThread->start(); - - // The sink sends its frames straight to the worker - m_basebandSink->setMessageQueueToChannel(m_worker->getInputMessageQueue()); - - applySettings(m_settings, true); - - m_deviceAPI->addChannelSink(this); - m_deviceAPI->addChannelSinkAPI(this); - - m_networkManager = new QNetworkAccessManager(); - QObject::connect( - m_networkManager, - &QNetworkAccessManager::finished, - this, - &AcarsDemod::networkManagerFinished - ); -} - -AcarsDemod::~AcarsDemod() -{ - qDebug("AcarsDemod::~AcarsDemod"); - QObject::disconnect( - m_networkManager, - &QNetworkAccessManager::finished, - this, - &AcarsDemod::networkManagerFinished - ); - delete m_networkManager; - m_deviceAPI->removeChannelSinkAPI(this); - m_deviceAPI->removeChannelSink(this, true); - - if (m_basebandSink->isRunning()) { - stop(); - } - - delete m_basebandSink; - - // The sink is gone, so nothing pushes to the worker any more - m_workerThread->quit(); - m_workerThread->wait(); - m_worker = nullptr; - m_workerThread = nullptr; -} - -void AcarsDemod::setDeviceAPI(DeviceAPI *deviceAPI) -{ - if (deviceAPI != m_deviceAPI) - { - m_deviceAPI->removeChannelSinkAPI(this); - m_deviceAPI->removeChannelSink(this, false); - m_deviceAPI = deviceAPI; - m_deviceAPI->addChannelSink(this); - m_deviceAPI->addChannelSinkAPI(this); - } -} - -uint32_t AcarsDemod::getNumberOfDeviceStreams() const -{ - return m_deviceAPI->getNbSourceStreams(); -} - -void AcarsDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) -{ - (void) firstOfBurst; - m_basebandSink->feed(begin, end); -} - -void AcarsDemod::start() -{ - qDebug("AcarsDemod::start"); - - m_basebandSink->reset(); - m_basebandSink->startWork(); - m_thread.start(); - - DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); - m_basebandSink->getInputMessageQueue()->push(dspMsg); - - AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband *msg = AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband::create(m_settings, true); - m_basebandSink->getInputMessageQueue()->push(msg); -} - -void AcarsDemod::stop() -{ - qDebug("AcarsDemod::stop"); - m_basebandSink->stopWork(); - m_thread.quit(); - m_thread.wait(); -} - -bool AcarsDemod::handleMessage(const Message& cmd) -{ - if (MsgConfigureAcarsDemod::match(cmd)) - { - MsgConfigureAcarsDemod& cfg = (MsgConfigureAcarsDemod&) cmd; - qDebug() << "AcarsDemod::handleMessage: MsgConfigureAcarsDemod"; - applySettings(cfg.getSettings(), cfg.getForce()); - - return true; - } - else if (DSPSignalNotification::match(cmd)) - { - DSPSignalNotification& notif = (DSPSignalNotification&) cmd; - m_basebandSampleRate = notif.getSampleRate(); - m_centerFrequency = notif.getCenterFrequency(); - // Forward to the sink - DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy - qDebug() << "AcarsDemod::handleMessage: DSPSignalNotification"; - m_basebandSink->getInputMessageQueue()->push(rep); - // Forward to the worker, which needs the centre frequency for its outputs - if (m_worker) { - m_worker->getInputMessageQueue()->push(new DSPSignalNotification(notif)); - } - // Forward to GUI if any - if (m_guiMessageQueue) - { - rep = new DSPSignalNotification(notif); - m_guiMessageQueue->push(rep); - } - - return true; - } - else - { - return false; - } -} - -void AcarsDemod::setCenterFrequency(qint64 frequency) -{ - AcarsDemodSettings settings = m_settings; - settings.m_inputFrequencyOffset = frequency; - applySettings(settings, false); - - if (m_guiMessageQueue) // forward to GUI if any - { - MsgConfigureAcarsDemod *msgToGUI = MsgConfigureAcarsDemod::create(settings, false); - m_guiMessageQueue->push(msgToGUI); - } -} - -void AcarsDemod::applySettings(const AcarsDemodSettings& settings, bool force) -{ - qDebug() << "AcarsDemod::applySettings:" - << " m_logEnabled: " << settings.m_logEnabled - << " m_logFilename: " << settings.m_logFilename - << " m_streamIndex: " << settings.m_streamIndex - << " m_useReverseAPI: " << settings.m_useReverseAPI - << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress - << " m_reverseAPIPort: " << settings.m_reverseAPIPort - << " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex - << " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex - << " force: " << force; - - QList reverseAPIKeys; - - if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) { - reverseAPIKeys.append("inputFrequencyOffset"); - } - if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force) { - reverseAPIKeys.append("rfBandwidth"); - } - if ((settings.m_udpEnabled != m_settings.m_udpEnabled) || force) { - reverseAPIKeys.append("udpEnabled"); - } - if ((settings.m_udpAddress != m_settings.m_udpAddress) || force) { - reverseAPIKeys.append("udpAddress"); - } - if ((settings.m_udpPort != m_settings.m_udpPort) || force) { - reverseAPIKeys.append("udpPort"); - } - if ((settings.m_logFilename != m_settings.m_logFilename) || force) { - reverseAPIKeys.append("logFilename"); - } - if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) { - reverseAPIKeys.append("logEnabled"); - } - if (m_settings.m_streamIndex != settings.m_streamIndex) - { - if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only - { - m_deviceAPI->removeChannelSinkAPI(this); - m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); - m_deviceAPI->addChannelSink(this, settings.m_streamIndex); - m_deviceAPI->addChannelSinkAPI(this); - } - - reverseAPIKeys.append("streamIndex"); - } - - AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband *msg = AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband::create(settings, force); - m_basebandSink->getInputMessageQueue()->push(msg); - - if (settings.m_useReverseAPI) - { - bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || - (m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) || - (m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) || - (m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) || - (m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex); - webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); - } - - // The worker handles the outputs (UDP, log, pipes) and, in later phases, - // the higher layer decode - if (m_worker) { - m_worker->getInputMessageQueue()->push(AcarsDemodWorker::MsgConfigureWorker::create(settings, force)); - } - - m_settings = settings; -} - -QByteArray AcarsDemod::serialize() const -{ - return m_settings.serialize(); -} - -bool AcarsDemod::deserialize(const QByteArray& data) -{ - if (m_settings.deserialize(data)) - { - MsgConfigureAcarsDemod *msg = MsgConfigureAcarsDemod::create(m_settings, true); - m_inputMessageQueue.push(msg); - return true; - } - else - { - m_settings.resetToDefaults(); - MsgConfigureAcarsDemod *msg = MsgConfigureAcarsDemod::create(m_settings, true); - m_inputMessageQueue.push(msg); - return false; - } -} - -int AcarsDemod::webapiSettingsGet( - SWGSDRangel::SWGChannelSettings& response, - QString& errorMessage) -{ - (void) errorMessage; - /* response.setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); - response.getAcarsDemodSettings()->init(); - webapiFormatChannelSettings(response, m_settings); */ - return 200; -} - -int AcarsDemod::webapiSettingsPutPatch( - bool force, - const QStringList& channelSettingsKeys, - SWGSDRangel::SWGChannelSettings& response, - QString& errorMessage) -{ - /* (void) errorMessage; - AcarsDemodSettings settings = m_settings; - webapiUpdateChannelSettings(settings, channelSettingsKeys, response); - - MsgConfigureAcarsDemod *msg = MsgConfigureAcarsDemod::create(settings, force); - m_inputMessageQueue.push(msg); - - qDebug("AcarsDemod::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); - if (m_guiMessageQueue) // forward to GUI if any - { - MsgConfigureAcarsDemod *msgToGUI = MsgConfigureAcarsDemod::create(settings, force); - m_guiMessageQueue->push(msgToGUI); - } - - webapiFormatChannelSettings(response, settings); - */ - return 200; -} - -void AcarsDemod::webapiUpdateChannelSettings( - AcarsDemodSettings& settings, - const QStringList& channelSettingsKeys, - SWGSDRangel::SWGChannelSettings& response) -{ - /* if (channelSettingsKeys.contains("inputFrequencyOffset")) { - settings.m_inputFrequencyOffset = response.getAcarsDemodSettings()->getInputFrequencyOffset(); - } - if (channelSettingsKeys.contains("fmDeviation")) { - settings.m_fmDeviation = response.getAcarsDemodSettings()->getFmDeviation(); - } - if (channelSettingsKeys.contains("rfBandwidth")) { - settings.m_rfBandwidth = response.getAcarsDemodSettings()->getRfBandwidth(); - } - if (channelSettingsKeys.contains("udpEnabled")) { - settings.m_udpEnabled = response.getAcarsDemodSettings()->getUdpEnabled(); - } - if (channelSettingsKeys.contains("udpAddress")) { - settings.m_udpAddress = *response.getAcarsDemodSettings()->getUdpAddress(); - } - if (channelSettingsKeys.contains("udpPort")) { - settings.m_udpPort = response.getAcarsDemodSettings()->getUdpPort(); - } - if (channelSettingsKeys.contains("rgbColor")) { - settings.m_rgbColor = response.getAcarsDemodSettings()->getRgbColor(); - } - if (channelSettingsKeys.contains("title")) { - settings.m_title = *response.getAcarsDemodSettings()->getTitle(); - } - if (channelSettingsKeys.contains("streamIndex")) { - settings.m_streamIndex = response.getAcarsDemodSettings()->getStreamIndex(); - } - if (channelSettingsKeys.contains("useReverseAPI")) { - settings.m_useReverseAPI = response.getAcarsDemodSettings()->getUseReverseApi() != 0; - } - if (channelSettingsKeys.contains("reverseAPIAddress")) { - settings.m_reverseAPIAddress = *response.getAcarsDemodSettings()->getReverseApiAddress(); - } - if (channelSettingsKeys.contains("reverseAPIPort")) { - settings.m_reverseAPIPort = response.getAcarsDemodSettings()->getReverseApiPort(); - } - if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) { - settings.m_reverseAPIDeviceIndex = response.getAcarsDemodSettings()->getReverseApiDeviceIndex(); - } - if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { - settings.m_reverseAPIChannelIndex = response.getAcarsDemodSettings()->getReverseApiChannelIndex(); - } */ -} - -void AcarsDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const AcarsDemodSettings& settings) -{ - /*response.getAcarsDemodSettings()->setFmDeviation(settings.m_fmDeviation); - response.getAcarsDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); - response.getAcarsDemodSettings()->setRfBandwidth(settings.m_rfBandwidth); - response.getAcarsDemodSettings()->setUdpEnabled(settings.m_udpEnabled); - response.getAcarsDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress)); - response.getAcarsDemodSettings()->setUdpPort(settings.m_udpPort); - - response.getAcarsDemodSettings()->setRgbColor(settings.m_rgbColor); - if (response.getAcarsDemodSettings()->getTitle()) { - *response.getAcarsDemodSettings()->getTitle() = settings.m_title; - } else { - response.getAcarsDemodSettings()->setTitle(new QString(settings.m_title)); - } - - response.getAcarsDemodSettings()->setStreamIndex(settings.m_streamIndex); - response.getAcarsDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); - - if (response.getAcarsDemodSettings()->getReverseApiAddress()) { - *response.getAcarsDemodSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; - } else { - response.getAcarsDemodSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); - } - - response.getAcarsDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); - response.getAcarsDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); - response.getAcarsDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); */ -} - -void AcarsDemod::webapiReverseSendSettings(QList& channelSettingsKeys, const AcarsDemodSettings& settings, bool force) -{ - /* SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - - QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") - .arg(settings.m_reverseAPIAddress) - .arg(settings.m_reverseAPIPort) - .arg(settings.m_reverseAPIDeviceIndex) - .arg(settings.m_reverseAPIChannelIndex); - m_networkRequest.setUrl(QUrl(channelSettingsURL)); - m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); - - QBuffer *buffer = new QBuffer(); - buffer->open((QBuffer::ReadWrite)); - buffer->write(swgChannelSettings->asJson().toUtf8()); - buffer->seek(0); - - // Always use PATCH to avoid passing reverse API settings - QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); - buffer->setParent(reply); - - delete swgChannelSettings; */ -} - -void AcarsDemod::webapiFormatChannelSettings( - QList& channelSettingsKeys, - SWGSDRangel::SWGChannelSettings *swgChannelSettings, - const AcarsDemodSettings& settings, - bool force -) -{ - /* swgChannelSettings->setDirection(0); // Single sink (Rx) - swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet()); - swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex()); - swgChannelSettings->setChannelType(new QString("AcarsDemod")); - swgChannelSettings->setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); - SWGSDRangel::SWGACARSDemodSettings *sWGACARSDemodSettings = swgChannelSettings->getAcarsDemodSettings(); - - // transfer data that has been modified. When force is on transfer all data except reverse API data - - if (channelSettingsKeys.contains("inputFrequencyOffset") || force) { - sWGACARSDemodSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset); - } - if (channelSettingsKeys.contains("rfBandwidth") || force) { - sWGACARSDemodSettings->setRfBandwidth(settings.m_rfBandwidth); - } - if (channelSettingsKeys.contains("udpEnabled") || force) { - sWGACARSDemodSettings->setUdpEnabled(settings.m_udpEnabled); - } - if (channelSettingsKeys.contains("udpAddress") || force) { - sWGACARSDemodSettings->setUdpAddress(new QString(settings.m_udpAddress)); - } - if (channelSettingsKeys.contains("udpPort") || force) { - sWGACARSDemodSettings->setUdpPort(settings.m_udpPort); - } - if (channelSettingsKeys.contains("rgbColor") || force) { - sWGACARSDemodSettings->setRgbColor(settings.m_rgbColor); - } - if (channelSettingsKeys.contains("title") || force) { - sWGACARSDemodSettings->setTitle(new QString(settings.m_title)); - } - if (channelSettingsKeys.contains("streamIndex") || force) { - sWGACARSDemodSettings->setStreamIndex(settings.m_streamIndex); - } */ -} - -void AcarsDemod::networkManagerFinished(QNetworkReply *reply) -{ - QNetworkReply::NetworkError replyError = reply->error(); - - if (replyError) - { - qWarning() << "AcarsDemod::networkManagerFinished:" - << " error(" << (int) replyError - << "): " << replyError - << ": " << reply->errorString(); - } - else - { - QString answer = reply->readAll(); - answer.chop(1); // remove last \n - qDebug("AcarsDemod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); - } - - reply->deleteLater(); -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2015-2018 Edouard Griffiths, F4EXB. // +// Copyright (C) 2021 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "acarsdemod.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "SWGChannelSettings.h" +#include "SWGChannelReport.h" +#include "SWGACARSDemodSettings.h" +#include "SWGACARSDemodReport.h" +//#include "SWGACARSDemodSettings.h" +#include "SWGChannelReport.h" +#include "SWGMapItem.h" + +#include "dsp/dspengine.h" +#include "dsp/dspcommands.h" +#include "device/deviceapi.h" +#include "feature/feature.h" +#include "util/db.h" +#include "maincore.h" + +#include "acarsdemodworker.h" + +MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgConfigureAcarsDemod, Message) +MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgVdl2Frame, Message) +MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgAcarsPacket, MainCore::MsgPacket) +MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgHfdlFrame, Message) +MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgAeroFrame, Message) +MESSAGE_CLASS_DEFINITION(AcarsDemod::MsgProtocolChange, Message) + +const char * const AcarsDemod::m_channelIdURI = "sdrangel.channel.acarsdemod"; +const char * const AcarsDemod::m_channelId = "ACARSDemod"; + +AcarsDemod::AcarsDemod(DeviceAPI *deviceAPI) : + ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), + m_deviceAPI(deviceAPI), + m_basebandSampleRate(0) +{ + setObjectName(m_channelId); + + m_basebandSink = new AcarsDemodBaseband(this); + m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(getIndexInDeviceSet()) + ); + m_basebandSink->setChannel(this); + m_basebandSink->moveToThread(&m_thread); + + // Decoded frames are processed by the worker on its own thread, for the + // channel's lifetime, in both GUI and server builds + m_workerThread = new QThread(); + m_worker = new AcarsDemodWorker(this); + m_worker->moveToThread(m_workerThread); + QObject::connect(m_workerThread, &QThread::started, m_worker, &AcarsDemodWorker::startWork); + QObject::connect(m_workerThread, &QThread::finished, m_worker, &QObject::deleteLater); + QObject::connect(m_workerThread, &QThread::finished, m_workerThread, &QThread::deleteLater); + m_workerThread->start(); + + // The sink sends its frames straight to the worker + m_basebandSink->setMessageQueueToChannel(m_worker->getInputMessageQueue()); + + applySettings(m_settings, true); + + m_deviceAPI->addChannelSink(this); + m_deviceAPI->addChannelSinkAPI(this); + + m_networkManager = new QNetworkAccessManager(); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AcarsDemod::networkManagerFinished + ); +} + +AcarsDemod::~AcarsDemod() +{ + qDebug("AcarsDemod::~AcarsDemod"); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AcarsDemod::networkManagerFinished + ); + delete m_networkManager; + m_deviceAPI->removeChannelSinkAPI(this); + m_deviceAPI->removeChannelSink(this, true); + + if (m_basebandSink->isRunning()) { + stop(); + } + + // The sink has stopped, so nothing new reaches the worker - but frames it already + // queued are still being processed, and those read the sink (getMagSq() for the feed + // level). So the worker thread must finish, which also deletes the worker, before the + // sink is deleted + m_workerThread->quit(); + m_workerThread->wait(); + m_worker = nullptr; + m_workerThread = nullptr; + + delete m_basebandSink; +} + +void AcarsDemod::setDeviceAPI(DeviceAPI *deviceAPI) +{ + if (deviceAPI != m_deviceAPI) + { + m_deviceAPI->removeChannelSinkAPI(this); + m_deviceAPI->removeChannelSink(this, false); + m_deviceAPI = deviceAPI; + m_deviceAPI->addChannelSink(this); + m_deviceAPI->addChannelSinkAPI(this); + } +} + +uint32_t AcarsDemod::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSourceStreams(); +} + +void AcarsDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) +{ + (void) firstOfBurst; + m_basebandSink->feed(begin, end); +} + +void AcarsDemod::start() +{ + qDebug("AcarsDemod::start"); + + m_basebandSink->reset(); + m_basebandSink->startWork(); + m_thread.start(); + + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + + AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband *msg = AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband::create(m_settings, true); + m_basebandSink->getInputMessageQueue()->push(msg); +} + +void AcarsDemod::stop() +{ + qDebug("AcarsDemod::stop"); + m_basebandSink->stopWork(); + m_thread.quit(); + m_thread.wait(); +} + +bool AcarsDemod::handleMessage(const Message& cmd) +{ + if (MsgConfigureAcarsDemod::match(cmd)) + { + MsgConfigureAcarsDemod& cfg = (MsgConfigureAcarsDemod&) cmd; + qDebug() << "AcarsDemod::handleMessage: MsgConfigureAcarsDemod"; + applySettings(cfg.getSettings(), cfg.getForce()); + + return true; + } + else if (DSPSignalNotification::match(cmd)) + { + DSPSignalNotification& notif = (DSPSignalNotification&) cmd; + m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); + // Forward to the sink + DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy + qDebug() << "AcarsDemod::handleMessage: DSPSignalNotification"; + m_basebandSink->getInputMessageQueue()->push(rep); + // Forward to the worker, which needs the centre frequency for its outputs + if (m_worker) { + m_worker->getInputMessageQueue()->push(new DSPSignalNotification(notif)); + } + // Forward to GUI if any + if (m_guiMessageQueue) + { + rep = new DSPSignalNotification(notif); + m_guiMessageQueue->push(rep); + } + + return true; + } + else + { + return false; + } +} + +void AcarsDemod::setCenterFrequency(qint64 frequency) +{ + AcarsDemodSettings settings = m_settings; + settings.m_inputFrequencyOffset = frequency; + applySettings(settings, false); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAcarsDemod *msgToGUI = MsgConfigureAcarsDemod::create(settings, false); + m_guiMessageQueue->push(msgToGUI); + } +} + +void AcarsDemod::applySettings(const AcarsDemodSettings& settings, bool force) +{ + qDebug() << "AcarsDemod::applySettings:" + << " m_logEnabled: " << settings.m_logEnabled + << " m_logFilename: " << settings.m_logFilename + << " m_streamIndex: " << settings.m_streamIndex + << " m_useReverseAPI: " << settings.m_useReverseAPI + << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress + << " m_reverseAPIPort: " << settings.m_reverseAPIPort + << " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex + << " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex + << " force: " << force; + + QList reverseAPIKeys; + + if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) { + reverseAPIKeys.append("inputFrequencyOffset"); + } + if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force) { + reverseAPIKeys.append("rfBandwidth"); + } + if ((settings.m_udpEnabled != m_settings.m_udpEnabled) || force) { + reverseAPIKeys.append("udpEnabled"); + } + if ((settings.m_udpAddress != m_settings.m_udpAddress) || force) { + reverseAPIKeys.append("udpAddress"); + } + if ((settings.m_udpPort != m_settings.m_udpPort) || force) { + reverseAPIKeys.append("udpPort"); + } + if ((settings.m_logFilename != m_settings.m_logFilename) || force) { + reverseAPIKeys.append("logFilename"); + } + if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) { + reverseAPIKeys.append("logEnabled"); + } + if ((settings.m_mode != m_settings.m_mode) || force) { + reverseAPIKeys.append("mode"); + } + if ((settings.m_aeroChannel != m_settings.m_aeroChannel) || force) { + reverseAPIKeys.append("aeroChannel"); + } + if ((settings.m_iridiumBandwidth != m_settings.m_iridiumBandwidth) || force) { + reverseAPIKeys.append("iridiumBandwidth"); + } + if ((settings.m_correlationThreshold != m_settings.m_correlationThreshold) || force) { + reverseAPIKeys.append("correlationThreshold"); + } + if ((settings.m_filter != m_settings.m_filter) || force) { + reverseAPIKeys.append("filter"); + } + if ((settings.m_filterColumn != m_settings.m_filterColumn) || force) { + reverseAPIKeys.append("filterColumn"); + } + if ((settings.m_hideNoInfo != m_settings.m_hideNoInfo) || force) { + reverseAPIKeys.append("hideNoInfo"); + } + if ((settings.m_showDate != m_settings.m_showDate) || force) { + reverseAPIKeys.append("showDate"); + } + if ((settings.m_displayPhotos != m_settings.m_displayPhotos) || force) { + reverseAPIKeys.append("displayPhotos"); + } + if ((settings.m_displayChart != m_settings.m_displayChart) || force) { + reverseAPIKeys.append("displayChart"); + } + if ((settings.m_scopeCh1 != m_settings.m_scopeCh1) || force) { + reverseAPIKeys.append("scopeCh1"); + } + if ((settings.m_scopeCh2 != m_settings.m_scopeCh2) || force) { + reverseAPIKeys.append("scopeCh2"); + } + if ((settings.m_rgbColor != m_settings.m_rgbColor) || force) { + reverseAPIKeys.append("rgbColor"); + } + if ((settings.m_title != m_settings.m_title) || force) { + reverseAPIKeys.append("title"); + } + if ((settings.m_workspaceIndex != m_settings.m_workspaceIndex) || force) { + reverseAPIKeys.append("workspaceIndex"); + } + if (m_settings.m_streamIndex != settings.m_streamIndex) + { + if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only + { + m_deviceAPI->removeChannelSinkAPI(this); + m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); + m_deviceAPI->addChannelSink(this, settings.m_streamIndex); + m_deviceAPI->addChannelSinkAPI(this); + } + + reverseAPIKeys.append("streamIndex"); + } + + AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband *msg = AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband::create(settings, force); + m_basebandSink->getInputMessageQueue()->push(msg); + + if (settings.m_useReverseAPI) + { + bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || + (m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) || + (m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) || + (m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) || + (m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex); + webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); + } + + // The worker handles the outputs (UDP, log, pipes) and, in later phases, + // the higher layer decode + if (m_worker) { + m_worker->getInputMessageQueue()->push(AcarsDemodWorker::MsgConfigureWorker::create(settings, force)); + } + + m_settings = settings; +} + +QByteArray AcarsDemod::serialize() const +{ + return m_settings.serialize(); +} + +bool AcarsDemod::deserialize(const QByteArray& data) +{ + if (m_settings.deserialize(data)) + { + MsgConfigureAcarsDemod *msg = MsgConfigureAcarsDemod::create(m_settings, true); + m_inputMessageQueue.push(msg); + return true; + } + else + { + m_settings.resetToDefaults(); + MsgConfigureAcarsDemod *msg = MsgConfigureAcarsDemod::create(m_settings, true); + m_inputMessageQueue.push(msg); + return false; + } +} + +// NOTE: the API carries these settings in three directions - reading a PATCH, +// writing a GET, and sending an update to a reverse API - and each one now lists +// them out in full below. A setting added to AcarsDemodSettings has to be added to +// ALL THREE: webapiUpdateChannelSettings, webapiFormatChannelSettings and +// webapiFormatChannelSettings(keys, ...). Missing one leaves the setting silently +// unreadable, unreportable or unsynchronised rather than failing to build. + +// The strings need their own handling: a generated setter takes ownership of what it is +// given, and the default constructor leaves every pointer null - so assigning in place +// without checking writes through nullptr +static void acarsApiSetString(SWGSDRangel::SWGACARSDemodSettings *swg, QString *held, + void (SWGSDRangel::SWGACARSDemodSettings::*setter)(QString *), + const QString& value) +{ + if (held) { + *held = value; + } else { + (swg->*setter)(new QString(value)); + } +} + +int AcarsDemod::webapiSettingsGet( + SWGSDRangel::SWGChannelSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); + response.getAcarsDemodSettings()->init(); + webapiFormatChannelSettings(response, m_settings); + return 200; +} + +int AcarsDemod::webapiSettingsPutPatch( + bool force, + const QStringList& channelSettingsKeys, + SWGSDRangel::SWGChannelSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + AcarsDemodSettings settings = m_settings; + webapiUpdateChannelSettings(settings, channelSettingsKeys, response); + + MsgConfigureAcarsDemod *msg = MsgConfigureAcarsDemod::create(settings, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAcarsDemod *msgToGUI = MsgConfigureAcarsDemod::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatChannelSettings(response, settings); + return 200; +} + +int AcarsDemod::webapiReportGet( + SWGSDRangel::SWGChannelReport& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAcarsDemodReport(new SWGSDRangel::SWGACARSDemodReport()); + response.getAcarsDemodReport()->init(); + webapiFormatChannelReport(response); + return 200; +} + +void AcarsDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) +{ + SWGSDRangel::SWGACARSDemodReport *swg = response.getAcarsDemodReport(); + + const double magsqAvg = getMagSq(); + swg->setChannelPowerDb(magsqAvg > 0.0 ? 10.0 * log10(magsqAvg) : -200.0); + // Depends on the protocol, and in Aero on the rate tuned - see channelSampleRate() + swg->setChannelSampleRate(AcarsDemodSink::channelSampleRate(m_settings)); + + // Both are only meaningful in Aero mode, which is the only one with a continuous + // carrier to average over. The other protocols leave them at zero. + double evm = 0.0; + double suRate = 0.0; + getAeroQuality(evm, suRate); + swg->setAeroEvm((float) evm); + swg->setAeroSignalUnitRate((float) suRate); +} + +void AcarsDemod::webapiUpdateChannelSettings( + AcarsDemodSettings& settings, + const QStringList& channelSettingsKeys, + SWGSDRangel::SWGChannelSettings& response) +{ + SWGSDRangel::SWGACARSDemodSettings *swg = response.getAcarsDemodSettings(); + if (!swg) { + return; + } + + if (channelSettingsKeys.contains("inputFrequencyOffset")) { + settings.m_inputFrequencyOffset = (qint32) swg->getInputFrequencyOffset(); + } + // The ranges are the ones AcarsDemodSettings::deserialize() enforces, as the values go + // to the same places - mode and aeroChannel index tables, rfBandwidth becomes a filter + // cutoff. Deserialize falls back to the default; here a value out of range is ignored + // and the current setting kept + if (channelSettingsKeys.contains("mode")) + { + const int mode = swg->getMode(); + if ((mode >= 0) && (mode < (int) AcarsDemodSettings::ModeCount)) { + settings.m_mode = mode; + } + } + if (channelSettingsKeys.contains("aeroChannel")) + { + const int aeroChannel = swg->getAeroChannel(); + if ((aeroChannel >= 0) && (aeroChannel < AcarsAeroReceiver::SubmodeCount)) { + settings.m_aeroChannel = aeroChannel; + } + } + if (channelSettingsKeys.contains("iridiumBandwidth")) + { + const int iridiumBandwidth = swg->getIridiumBandwidth(); + if ((iridiumBandwidth >= 0) && (iridiumBandwidth < AcarsDemodSettings::IridiumScanWidths)) { + settings.m_iridiumBandwidth = iridiumBandwidth; + } + } + if (channelSettingsKeys.contains("rfBandwidth")) + { + const Real rfBandwidth = (Real) swg->getRfBandwidth(); + if ((rfBandwidth >= 1000.0f) && (rfBandwidth <= 40000.0f)) { + settings.m_rfBandwidth = rfBandwidth; + } + } + if (channelSettingsKeys.contains("correlationThreshold")) + { + const Real correlationThreshold = (Real) swg->getCorrelationThreshold(); + if ((correlationThreshold >= 0.0f) && (correlationThreshold <= 1.0f)) { + settings.m_correlationThreshold = correlationThreshold; + } + } + if (channelSettingsKeys.contains("filterColumn")) + { + const int filterColumn = swg->getFilterColumn(); + if ((filterColumn >= 0) && (filterColumn <= 3)) { + settings.m_filterColumn = filterColumn; + } + } + if (channelSettingsKeys.contains("hideNoInfo")) { + settings.m_hideNoInfo = (bool) swg->getHideNoInfo(); + } + if (channelSettingsKeys.contains("showDate")) { + settings.m_showDate = (bool) swg->getShowDate(); + } + if (channelSettingsKeys.contains("displayPhotos")) { + settings.m_displayPhotos = (bool) swg->getDisplayPhotos(); + } + if (channelSettingsKeys.contains("displayChart")) { + settings.m_displayChart = (bool) swg->getDisplayChart(); + } + if (channelSettingsKeys.contains("udpEnabled")) { + settings.m_udpEnabled = (bool) swg->getUdpEnabled(); + } + if (channelSettingsKeys.contains("udpPort")) + { + const int udpPort = swg->getUdpPort(); + if ((udpPort > 1023) && (udpPort < 65535)) { + settings.m_udpPort = (uint16_t) udpPort; + } + } + if (channelSettingsKeys.contains("logEnabled")) { + settings.m_logEnabled = (bool) swg->getLogEnabled(); + } + if (channelSettingsKeys.contains("scopeCh1")) { + settings.m_scopeCh1 = (int) swg->getScopeCh1(); + } + if (channelSettingsKeys.contains("scopeCh2")) { + settings.m_scopeCh2 = (int) swg->getScopeCh2(); + } + if (channelSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = (quint32) swg->getRgbColor(); + } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = (int) swg->getStreamIndex(); + } + if (channelSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = (bool) swg->getUseReverseApi(); + } + if (channelSettingsKeys.contains("reverseAPIPort")) + { + const int reverseAPIPort = swg->getReverseApiPort(); + if ((reverseAPIPort > 1023) && (reverseAPIPort < 65535)) { + settings.m_reverseAPIPort = (uint16_t) reverseAPIPort; + } + } + if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) { + settings.m_reverseAPIDeviceIndex = (uint16_t) qBound(0, swg->getReverseApiDeviceIndex(), 99); + } + if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { + settings.m_reverseAPIChannelIndex = (uint16_t) qBound(0, swg->getReverseApiChannelIndex(), 99); + } + if (channelSettingsKeys.contains("workspaceIndex")) { + settings.m_workspaceIndex = (int) swg->getWorkspaceIndex(); + } + + if (channelSettingsKeys.contains("filter") && swg->getFilter()) { + settings.m_filter = *swg->getFilter(); + } + if (channelSettingsKeys.contains("udpAddress") && swg->getUdpAddress()) { + settings.m_udpAddress = *swg->getUdpAddress(); + } + if (channelSettingsKeys.contains("logFilename") && swg->getLogFilename()) { + settings.m_logFilename = *swg->getLogFilename(); + } + if (channelSettingsKeys.contains("title") && swg->getTitle()) { + settings.m_title = *swg->getTitle(); + } + if (channelSettingsKeys.contains("reverseAPIAddress") && swg->getReverseApiAddress()) { + settings.m_reverseAPIAddress = *swg->getReverseApiAddress(); + } +} + +void AcarsDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const AcarsDemodSettings& settings) +{ + SWGSDRangel::SWGACARSDemodSettings *swg = response.getAcarsDemodSettings(); + + swg->setInputFrequencyOffset(settings.m_inputFrequencyOffset); + swg->setMode(settings.m_mode); + swg->setAeroChannel(settings.m_aeroChannel); + swg->setIridiumBandwidth(settings.m_iridiumBandwidth); + swg->setRfBandwidth(settings.m_rfBandwidth); + swg->setCorrelationThreshold(settings.m_correlationThreshold); + swg->setFilterColumn(settings.m_filterColumn); + swg->setHideNoInfo(settings.m_hideNoInfo); + swg->setShowDate(settings.m_showDate); + swg->setDisplayPhotos(settings.m_displayPhotos); + swg->setDisplayChart(settings.m_displayChart); + swg->setUdpEnabled(settings.m_udpEnabled); + swg->setUdpPort(settings.m_udpPort); + swg->setLogEnabled(settings.m_logEnabled); + swg->setScopeCh1(settings.m_scopeCh1); + swg->setScopeCh2(settings.m_scopeCh2); + swg->setRgbColor(settings.m_rgbColor); + swg->setStreamIndex(settings.m_streamIndex); + swg->setUseReverseApi(settings.m_useReverseAPI); + swg->setReverseApiPort(settings.m_reverseAPIPort); + swg->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); + swg->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); + swg->setWorkspaceIndex(settings.m_workspaceIndex); + + acarsApiSetString(swg, swg->getFilter(), &SWGSDRangel::SWGACARSDemodSettings::setFilter, + settings.m_filter); + acarsApiSetString(swg, swg->getUdpAddress(), &SWGSDRangel::SWGACARSDemodSettings::setUdpAddress, + settings.m_udpAddress); + acarsApiSetString(swg, swg->getLogFilename(), &SWGSDRangel::SWGACARSDemodSettings::setLogFilename, + settings.m_logFilename); + acarsApiSetString(swg, swg->getTitle(), &SWGSDRangel::SWGACARSDemodSettings::setTitle, + settings.m_title); + acarsApiSetString(swg, swg->getReverseApiAddress(), &SWGSDRangel::SWGACARSDemodSettings::setReverseApiAddress, + settings.m_reverseAPIAddress); +} + +void AcarsDemod::webapiReverseSendSettings(QList& channelSettingsKeys, const AcarsDemodSettings& settings, bool force) +{ + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + + QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIDeviceIndex) + .arg(settings.m_reverseAPIChannelIndex); + m_networkRequest.setUrl(QUrl(channelSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgChannelSettings->asJson().toUtf8()); + buffer->seek(0); + + // Always use PATCH to avoid passing reverse API settings + QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); + buffer->setParent(reply); + + delete swgChannelSettings; +} + +// Only what changed, unless forced - and never the reverse API settings themselves, +// which describe this end of the link rather than the channel +void AcarsDemod::webapiFormatChannelSettings( + QList& channelSettingsKeys, + SWGSDRangel::SWGChannelSettings *swgChannelSettings, + const AcarsDemodSettings& settings, + bool force +) +{ + swgChannelSettings->setDirection(0); // Single sink (Rx) + swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet()); + swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex()); + swgChannelSettings->setChannelType(new QString(m_channelId)); + swgChannelSettings->setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); + SWGSDRangel::SWGACARSDemodSettings *swg = swgChannelSettings->getAcarsDemodSettings(); + + if (channelSettingsKeys.contains("inputFrequencyOffset") || force) { + swg->setInputFrequencyOffset(settings.m_inputFrequencyOffset); + } + if (channelSettingsKeys.contains("mode") || force) { + swg->setMode(settings.m_mode); + } + if (channelSettingsKeys.contains("aeroChannel") || force) { + swg->setAeroChannel(settings.m_aeroChannel); + } + if (channelSettingsKeys.contains("iridiumBandwidth") || force) { + swg->setIridiumBandwidth(settings.m_iridiumBandwidth); + } + if (channelSettingsKeys.contains("rfBandwidth") || force) { + swg->setRfBandwidth(settings.m_rfBandwidth); + } + if (channelSettingsKeys.contains("correlationThreshold") || force) { + swg->setCorrelationThreshold(settings.m_correlationThreshold); + } + if (channelSettingsKeys.contains("filterColumn") || force) { + swg->setFilterColumn(settings.m_filterColumn); + } + if (channelSettingsKeys.contains("hideNoInfo") || force) { + swg->setHideNoInfo(settings.m_hideNoInfo); + } + if (channelSettingsKeys.contains("showDate") || force) { + swg->setShowDate(settings.m_showDate); + } + if (channelSettingsKeys.contains("displayPhotos") || force) { + swg->setDisplayPhotos(settings.m_displayPhotos); + } + if (channelSettingsKeys.contains("displayChart") || force) { + swg->setDisplayChart(settings.m_displayChart); + } + if (channelSettingsKeys.contains("udpEnabled") || force) { + swg->setUdpEnabled(settings.m_udpEnabled); + } + if (channelSettingsKeys.contains("udpPort") || force) { + swg->setUdpPort(settings.m_udpPort); + } + if (channelSettingsKeys.contains("logEnabled") || force) { + swg->setLogEnabled(settings.m_logEnabled); + } + if (channelSettingsKeys.contains("scopeCh1") || force) { + swg->setScopeCh1(settings.m_scopeCh1); + } + if (channelSettingsKeys.contains("scopeCh2") || force) { + swg->setScopeCh2(settings.m_scopeCh2); + } + if (channelSettingsKeys.contains("rgbColor") || force) { + swg->setRgbColor(settings.m_rgbColor); + } + if (channelSettingsKeys.contains("streamIndex") || force) { + swg->setStreamIndex(settings.m_streamIndex); + } + if (channelSettingsKeys.contains("useReverseAPI") || force) { + swg->setUseReverseApi(settings.m_useReverseAPI); + } + if (channelSettingsKeys.contains("reverseAPIPort") || force) { + swg->setReverseApiPort(settings.m_reverseAPIPort); + } + if (channelSettingsKeys.contains("reverseAPIDeviceIndex") || force) { + swg->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); + } + if (channelSettingsKeys.contains("reverseAPIChannelIndex") || force) { + swg->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); + } + if (channelSettingsKeys.contains("workspaceIndex") || force) { + swg->setWorkspaceIndex(settings.m_workspaceIndex); + } + + if (channelSettingsKeys.contains("filter") || force) { + swg->setFilter(new QString(settings.m_filter)); + } + if (channelSettingsKeys.contains("udpAddress") || force) { + swg->setUdpAddress(new QString(settings.m_udpAddress)); + } + if (channelSettingsKeys.contains("logFilename") || force) { + swg->setLogFilename(new QString(settings.m_logFilename)); + } + if (channelSettingsKeys.contains("title") || force) { + swg->setTitle(new QString(settings.m_title)); + } + if (channelSettingsKeys.contains("reverseAPIAddress") || force) { + swg->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } +} + +void AcarsDemod::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "AcarsDemod::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + } + else + { + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("AcarsDemod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + } + + reply->deleteLater(); +} diff --git a/plugins/channelrx/demodacars/acarsdemod.h b/plugins/channelrx/demodacars/acarsdemod.h index 59ba007ae..7e18e4f38 100644 --- a/plugins/channelrx/demodacars/acarsdemod.h +++ b/plugins/channelrx/demodacars/acarsdemod.h @@ -31,6 +31,7 @@ #include "dsp/basebandsamplesink.h" #include "channel/channelapi.h" #include "util/message.h" +#include "maincore.h" // MsgAcarsPacket subclasses MainCore::MsgPacket #include "acarsdemodbaseband.h" #include "acarsdemodsettings.h" @@ -150,6 +151,37 @@ public: { } }; + // An ACARS block, plus what the bearer knew about it that the block itself does not + // say. VDL-2 puts the aircraft's 24 bit ICAO address in the AVLC header of the frame + // the block came out of, where the block names only a registration. + // + // A subclass rather than a separate message so that the address travels WITH its + // packet: there is then no ordering to get right and no way for an address to be + // applied to the wrong block. MainCore::MsgPacket::match() matches this too, because + // Message::matchIdentifier defers to the base class, so the existing packet handling + // - the APRS pipe, the UDP feed, the log - needs no change and sees a plain packet. + class MsgAcarsPacket : public MainCore::MsgPacket { + MESSAGE_CLASS_DECLARATION + + public: + //!< 0 when the bearer gave no address, which is every bearer but VDL-2 + quint32 getIcao() const { return m_icao; } + + static MsgAcarsPacket* create(const QObject *pipeSource, QByteArray packet, quint32 icao) + { + return new MsgAcarsPacket(pipeSource, packet, QDateTime::currentDateTime(), icao); + } + + private: + quint32 m_icao; + + MsgAcarsPacket(const QObject *pipeSource, QByteArray packet, QDateTime dateTime, + quint32 icao) : + MainCore::MsgPacket(pipeSource, packet, dateTime), + m_icao(icao) + { } + }; + // A demodulated VDL-2 AVLC frame that does not carry an ACARS message (XID/GSIF, // X.25, supervisory frames). ACARS frames go out as MainCore::MsgPacket instead, so // downstream consumers of that message always see pure ACARS bytes. @@ -224,11 +256,17 @@ public: SWGSDRangel::SWGChannelSettings& response, const AcarsDemodSettings& settings); + virtual int webapiReportGet( + SWGSDRangel::SWGChannelReport& response, + QString& errorMessage); + static void webapiUpdateChannelSettings( AcarsDemodSettings& settings, const QStringList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings& response); + void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); + ScopeVis *getScopeSink() { return m_basebandSink->getScopeSink(); } double getMagSq() const { return m_basebandSink->getMagSq(); } diff --git a/plugins/channelrx/demodacars/acarsdemodbaseband.cpp b/plugins/channelrx/demodacars/acarsdemodbaseband.cpp index f4774363f..53ec04607 100644 --- a/plugins/channelrx/demodacars/acarsdemodbaseband.cpp +++ b/plugins/channelrx/demodacars/acarsdemodbaseband.cpp @@ -18,6 +18,8 @@ #include +#include + #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "dsp/downchannelizer.h" @@ -26,6 +28,21 @@ MESSAGE_CLASS_DEFINITION(AcarsDemodBaseband::MsgConfigureAcarsDemodBaseband, Message) +// Up to 16x the standard policy (10 s of nominal samples): a burst's decode chain +// (multiple Viterbi attempts, turbo re-estimation, header repair) runs synchronously at +// the end of the burst and can take tens of milliseconds - and clusters of bursts +// compound it - which at accelerated file replay (10x and beyond) would overflow the +// 0.64 s standard FIFO. But capped in samples, since the FIFO is allocated in full: at +// 16x an 8 MS/s Iridium channel took 655 MB for its FIFO alone, and several channels on +// a wideband device took gigabytes. The cap is 8M samples (64 MB with 24 bit samples), still over a +// second at 8 MS/s. +static unsigned int fifoSize(unsigned int sampleRate) +{ + const unsigned int standard = SampleSinkFifo::getSizePolicy(sampleRate); + const unsigned int maxSamples = 8 * 1024 * 1024; + return std::max(standard, std::min(standard * 16, maxSamples)); +} + AcarsDemodBaseband::AcarsDemodBaseband(AcarsDemod *packetDemod) : m_sink(packetDemod), m_running(false) @@ -33,12 +50,7 @@ AcarsDemodBaseband::AcarsDemodBaseband(AcarsDemod *packetDemod) : qDebug("AcarsDemodBaseband::AcarsDemodBaseband"); m_sink.setScopeSink(&m_scopeSink); - // 16x the standard policy (10 s of nominal samples): a burst's decode chain - // (multiple Viterbi attempts, turbo re-estimation, header repair) runs - // synchronously at the end of the burst and can take tens of milliseconds - - // and clusters of bursts compound it - which at accelerated file replay (10x - // and beyond) would overflow the 0.64 s standard FIFO - m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000) * 16); + m_sampleFifo.setSize(fifoSize(48000)); m_channelizer = new DownChannelizer(&m_sink); } @@ -150,8 +162,7 @@ bool AcarsDemodBaseband::handleMessage(const Message& cmd) DSPSignalNotification& notif = (DSPSignalNotification&) cmd; qDebug() << "AcarsDemodBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate(); setBasebandSampleRate(notif.getSampleRate()); - // 16x the standard policy - see the constructor - m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(notif.getSampleRate()) * 16); + m_sampleFifo.setSize(fifoSize(notif.getSampleRate())); return true; } @@ -163,12 +174,7 @@ bool AcarsDemodBaseband::handleMessage(const Message& cmd) void AcarsDemodBaseband::applySettings(const AcarsDemodSettings& settings, bool force) { - // An Aero submode change moves the channel rate exactly as a mode change does, so - // it has to count here too - otherwise switching rate leaves the channelizer where - // it was and the receiver runs at the wrong sample rate - bool modeChanged = (settings.m_mode != m_settings.m_mode) - || ((settings.m_mode == AcarsDemodSettings::Aero) - && (settings.m_aeroChannel != m_settings.m_aeroChannel)); + bool modeChanged = AcarsDemodSettings::rateChanged(settings, m_settings); // The sink has to know the mode before the channelization moves, as the mode sets // the rate it resamples the channelizer output to diff --git a/plugins/channelrx/demodacars/acarsdemodgui.cpp b/plugins/channelrx/demodacars/acarsdemodgui.cpp index f190b2509..2f37c99dc 100644 --- a/plugins/channelrx/demodacars/acarsdemodgui.cpp +++ b/plugins/channelrx/demodacars/acarsdemodgui.cpp @@ -1,7 +1,6 @@ /////////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2016 Edouard Griffiths, F4EXB // // Copyright (C) 2021 Jon Beniston, M7RCE // -// Copyright (c) 2018-2021 Tomasz Lemiech // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -19,6 +18,8 @@ #include #include +#include +#include #include #include #include @@ -63,7 +64,9 @@ #include "acarsdemod.h" #include "acarsdemodsink.h" -#include "acarstextformat.h" +#include "util/acarstextformat.h" +#include "gui/fastheaderview.h" +#include "gui/fastitemdelegate.h" @@ -137,9 +140,17 @@ void AcarsDemodGUI::resizeTable() // Columns in table reordered void AcarsDemodGUI::messages_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) { + (void) logicalIndex; (void) oldVisualIndex; + (void) newVisualIndex; - m_settings.m_columnIndexes[logicalIndex] = newVisualIndex; + // Every column between the two positions moved too, so record them all. Recording + // only the one dragged left the others stale, and replaying them in displaySettings() + // gave a different order after more than one move. + QHeaderView *header = ui->messages->horizontalHeader(); + for (int i = 0; i < ACARSDEMOD_COLUMNS; i++) { + m_settings.m_columnIndexes[i] = header->visualIndex(i); + } } // Column in table resized (when hidden size is 0) @@ -411,7 +422,15 @@ bool AcarsDemodGUI::handleMessage(const Message& message) { qDebug("AcarsDemodGUI::handleMessage: AcarsDemod::MsgConfigureAcarsDemod"); const AcarsDemod::MsgConfigureAcarsDemod& cfg = (AcarsDemod::MsgConfigureAcarsDemod&) message; - m_settings = cfg.getSettings(); + // The table layout and the splitter are the GUI's own: changed here without being + // applied, so the channel's copy of them is stale, and taking it moved columns, + // widths and the splitter back whenever the channel echoed its settings (a REST + // PATCH, a centre frequency change) + AcarsDemodSettings settings = cfg.getSettings(); + std::copy(std::begin(m_settings.m_columnIndexes), std::end(m_settings.m_columnIndexes), std::begin(settings.m_columnIndexes)); + std::copy(std::begin(m_settings.m_columnSizes), std::end(m_settings.m_columnSizes), std::begin(settings.m_columnSizes)); + settings.m_splitterState = ui->splitter->saveState(); + m_settings = settings; blockApplySettings(true); ui->scopeGUI->updateSettings(); m_channelMarker.updateSettings(static_cast(m_settings.m_channelMarker)); @@ -472,6 +491,7 @@ void AcarsDemodGUI::on_mode_currentIndexChanged(int value) case 1: m_settings.m_mode = AcarsDemodSettings::VDL2; break; case 2: m_settings.m_mode = AcarsDemodSettings::HFDL; break; case 3: m_settings.m_mode = AcarsDemodSettings::Aero; break; + case 4: m_settings.m_mode = AcarsDemodSettings::Iridium; break; default: m_settings.m_mode = AcarsDemodSettings::ACARS; break; } @@ -479,6 +499,13 @@ void AcarsDemodGUI::on_mode_currentIndexChanged(int value) applyModeBandwidth(); } +void AcarsDemodGUI::on_iridiumBandwidth_currentIndexChanged(int value) +{ + m_settings.m_iridiumBandwidth = value; + // The channel sample rate is the width scanned, so changing it restarts the channel + applySettings(); +} + void AcarsDemodGUI::on_aeroChannel_currentIndexChanged(int value) { m_settings.m_aeroChannel = value; @@ -512,6 +539,9 @@ void AcarsDemodGUI::applyModeBandwidth() case AcarsDemodSettings::Aero: bw = AcarsAeroReceiver::submodeBandwidth(m_settings.m_aeroChannel) / 100; break; + // Ignored: Iridium scans the whole tuned width, and the sink passes all of it + // rather than filtering to a channel. The control is hidden in this mode + case AcarsDemodSettings::Iridium: bw = ui->rfBW->maximum(); break; default: bw = 125; break; } if (ui->rfBW->value() != bw) { @@ -864,6 +894,19 @@ AcarsDemodGUI::AcarsDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas m_helpURL = "plugins/channelrx/demodacars/readme.md"; RollupContents *rollupContents = getRollupContents(); ui->setupUi(rollupContents); + + ui->messages->setItemDelegate(new FastItemDelegate(ui->messages)); + ui->channelPower->setFixedSize( + ui->channelPower->fontMetrics().horizontalAdvance("-100.0") + 2, + ui->channelPower->sizeHint().height()); + ui->channelPower->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + ui->quality->setFixedSize( + ui->quality->fontMetrics().horizontalAdvance("100.0% SU 100%") + 2, + ui->quality->sizeHint().height()); + + // Before any header configuration below: setHorizontalHeader() resets column state + ui->messages->setHorizontalHeader(new FastHeaderView(Qt::Horizontal, ui->messages)); + setSizePolicy(rollupContents->sizePolicy()); rollupContents->arrangeRollups(); connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); @@ -991,11 +1034,6 @@ AcarsDemodGUI::AcarsDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas connect(&m_osnDB, &OsnDB::downloadProgress, this, &AcarsDemodGUI::downloadProgress); connect(&m_osnDB, &OsnDB::downloadAircraftInformationFinished, this, &AcarsDemodGUI::downloadAircraftInformationFinished); m_aircraftInfo = OsnDB::getAircraftInformationByReg(); - m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); - - m_navAids = OpenAIP::getNavAids(); - m_airports = OurAirportsDB::getAirportsByIdent(); - m_waypoints = Waypoints::getWaypoints(); connect(&m_planeSpotters, &PlaneSpotters::aircraftPhoto, this, &AcarsDemodGUI::aircraftPhoto); connect(ui->photo, &ClickableLabel::clicked, this, &AcarsDemodGUI::photoClicked); @@ -1018,6 +1056,10 @@ AcarsDemodGUI::AcarsDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas } plotChart(); + // The splitter saves a hidden pane as size 0, and restoreState() collapses a + // collapsible pane restored at 0, so the chart button showed a chart with no height. + // Not collapsible, a 0 is raised to the chart's minimum height instead. + ui->splitter->setCollapsible(ui->splitter->indexOf(ui->chart), false); CRightClickEnabler *displayChartClickEnabler = new CRightClickEnabler(ui->displayChart); connect(displayChartClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(clearChart(const QPoint &))); @@ -1065,71 +1107,6 @@ void AcarsDemodGUI::applySettings(bool force) } } -void AcarsDemodGUI::on_feed_clicked(bool checked) -{ - m_settings.m_feedEnabled = checked; - applySettings(); -} - -// Feed settings dialog: station ident plus per-aggregator enable, host and port -void AcarsDemodGUI::feedSelect(const QPoint& p) -{ - QDialog dialog(this); - dialog.setWindowTitle("ACARS Feed Settings"); - - QLineEdit *stationId = new QLineEdit(m_settings.m_feedStationId); - stationId->setToolTip("Station identifier sent with each message (e.g. XX-JBLOGGS-VHF1). Register it with the aggregator to claim your feed"); - QCheckBox *airframes = new QCheckBox("Feed airframes.io"); - airframes->setChecked(m_settings.m_feedAirframes); - QLineEdit *airframesHost = new QLineEdit(m_settings.m_feedAirframesHost); - QSpinBox *airframesPort = new QSpinBox(); - airframesPort->setRange(1, 65535); - airframesPort->setValue(m_settings.m_feedAirframesPort); - QComboBox *airframesProtocol = new QComboBox(); - airframesProtocol->addItems({"TCP", "UDP"}); - airframesProtocol->setCurrentIndex(m_settings.m_feedAirframesTcp ? 0 : 1); - airframesProtocol->setToolTip("Use the protocol, host and port the airframes.io Add Ground Station wizard assigns to your station"); - QCheckBox *avdelphi = new QCheckBox("Feed avdelphi.com"); - avdelphi->setChecked(m_settings.m_feedAvdelphi); - QLineEdit *avdelphiHost = new QLineEdit(m_settings.m_feedAvdelphiHost); - QSpinBox *avdelphiPort = new QSpinBox(); - avdelphiPort->setRange(1, 65535); - avdelphiPort->setValue(m_settings.m_feedAvdelphiPort); - QComboBox *avdelphiProtocol = new QComboBox(); - avdelphiProtocol->addItems({"TCP", "UDP"}); - avdelphiProtocol->setCurrentIndex(m_settings.m_feedAvdelphiTcp ? 0 : 1); - - QFormLayout *form = new QFormLayout(&dialog); - form->addRow("Station ID", stationId); - form->addRow(airframes); - form->addRow("Host", airframesHost); - form->addRow("Port", airframesPort); - form->addRow("Protocol", airframesProtocol); - form->addRow(avdelphi); - form->addRow("Host", avdelphiHost); - form->addRow("Port", avdelphiPort); - form->addRow("Protocol", avdelphiProtocol); - QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - form->addRow(buttons); - connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); - connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); - - dialog.move(p); - if (dialog.exec() == QDialog::Accepted) - { - m_settings.m_feedStationId = stationId->text().trimmed(); - m_settings.m_feedAirframes = airframes->isChecked(); - m_settings.m_feedAirframesHost = airframesHost->text().trimmed(); - m_settings.m_feedAirframesPort = airframesPort->value(); - m_settings.m_feedAirframesTcp = airframesProtocol->currentIndex() == 0; - m_settings.m_feedAvdelphi = avdelphi->isChecked(); - m_settings.m_feedAvdelphiHost = avdelphiHost->text().trimmed(); - m_settings.m_feedAvdelphiPort = avdelphiPort->value(); - m_settings.m_feedAvdelphiTcp = avdelphiProtocol->currentIndex() == 0; - applySettings(); - } -} - // Ground stations heard in HFDL squitters, one row per station and announced // frequency, with a context menu to find the station on the Map or tune to it void AcarsDemodGUI::on_gsTable_clicked() @@ -1258,6 +1235,12 @@ void AcarsDemodGUI::updateModeDependentWidgets() // The rate and channel selector only means anything in Aero mode, and so does the // link quality readout - it needs a continuous carrier to average over ui->aeroChannel->setVisible(aero); + // Iridium scans the whole tuned width rather than one channel + ui->iridiumBandwidth->setVisible(m_settings.m_mode == AcarsDemodSettings::Iridium); + const bool iridium = (m_settings.m_mode == AcarsDemodSettings::Iridium); + ui->rfBW->setVisible(!iridium); + ui->rfBWLabel->setVisible(!iridium); + ui->rfBWText->setVisible(!iridium); ui->qualityLabel->setVisible(aero); ui->quality->setVisible(aero); if (!aero) { @@ -1311,12 +1294,10 @@ void AcarsDemodGUI::displaySettings() ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); - ui->mode->setCurrentIndex(m_settings.m_mode == AcarsDemodSettings::VDL2 ? 1 - : m_settings.m_mode == AcarsDemodSettings::HFDL ? 2 - : m_settings.m_mode == AcarsDemodSettings::Aero ? 3 : 0); + ui->mode->setCurrentIndex(m_settings.m_mode); ui->aeroChannel->setCurrentIndex(m_settings.m_aeroChannel); + ui->iridiumBandwidth->setCurrentIndex(m_settings.m_iridiumBandwidth); updateModeDependentWidgets(); - ui->feed->setChecked(m_settings.m_feedEnabled); ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); @@ -1520,6 +1501,7 @@ void AcarsDemodGUI::makeUIConnections() QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &AcarsDemodGUI::on_deltaFrequency_changed); QObject::connect(ui->mode, QOverload::of(&QComboBox::currentIndexChanged), this, &AcarsDemodGUI::on_mode_currentIndexChanged); QObject::connect(ui->aeroChannel, QOverload::of(&QComboBox::currentIndexChanged), this, &AcarsDemodGUI::on_aeroChannel_currentIndexChanged); + QObject::connect(ui->iridiumBandwidth, QOverload::of(&QComboBox::currentIndexChanged), this, &AcarsDemodGUI::on_iridiumBandwidth_currentIndexChanged); QObject::connect(ui->rfBW, &QSlider::valueChanged, this, &AcarsDemodGUI::on_rfBW_valueChanged); QObject::connect(ui->threshold, &QDial::valueChanged, this, &AcarsDemodGUI::on_threshold_valueChanged); QObject::connect(ui->filter, QOverload::of(&QComboBox::currentIndexChanged), this, &AcarsDemodGUI::on_filter_currentIndexChanged); @@ -1531,12 +1513,6 @@ void AcarsDemodGUI::makeUIConnections() QObject::connect(ui->channel1, QOverload::of(&QComboBox::currentIndexChanged), this, &AcarsDemodGUI::on_channel1_currentIndexChanged); QObject::connect(ui->channel2, QOverload::of(&QComboBox::currentIndexChanged), this, &AcarsDemodGUI::on_channel2_currentIndexChanged); QObject::connect(ui->gsTable, &QToolButton::clicked, this, &AcarsDemodGUI::on_gsTable_clicked); - QObject::connect(ui->feed, &ButtonSwitch::clicked, this, &AcarsDemodGUI::on_feed_clicked); - CRightClickEnabler *feedRightClickEnabler = new CRightClickEnabler(ui->feed); - connect(feedRightClickEnabler, &CRightClickEnabler::rightClick, this, &AcarsDemodGUI::feedSelect); - - // Log the feed connections' lifecycle, so a misconfigured host/port or a - // dropped aggregator connection is visible in the debug output QObject::connect(ui->messages->selectionModel(), &QItemSelectionModel::selectionChanged, this, &AcarsDemodGUI::messagesSelectionChanged); QObject::connect(ui->logEnable, &ButtonSwitch::clicked, this, &AcarsDemodGUI::on_logEnable_clicked); @@ -1917,7 +1893,6 @@ void AcarsDemodGUI::on_logOpen_clicked() QDateTime startTime = QDateTime::currentDateTime(); // Sorting stays on: the proxy places each row as it arrives //ui->messages->setUpdatesEnabled(false); - ui->messages->blockSignals(true); QTextStream in(&file); QString error; QHash colIndexes = CSV::readHeader(in, {"DateTime", "Data"}, error); @@ -1943,9 +1918,12 @@ void AcarsDemodGUI::on_logOpen_clicked() QDateTime dateTime = QDateTime::fromString(cols[dateTimeCol], Qt::ISODateWithMs); QByteArray bytes = QByteArray::fromHex(cols[dataCol].toLatin1()); - // Decoded by the worker, which echoes display events back here - m_acarsDemod->getWorker()->getInputMessageQueue()->push( - MainCore::MsgPacket::create(m_acarsDemod, bytes, dateTime)); + // Decoded by the worker, which echoes display events back here. + // As a replay, so it is not sent out again as live traffic. + if (!bytes.isEmpty()) { + m_acarsDemod->getWorker()->getInputMessageQueue()->push( + AcarsDemodWorker::MsgReplayPacket::create(bytes, dateTime)); + } if (count % 50000 == 0) { @@ -1958,7 +1936,6 @@ void AcarsDemodGUI::on_logOpen_clicked() } } dialog.close(); - ui->messages->blockSignals(false); //ui->messages->setUpdatesEnabled(true); // Nothing to re-sort: the proxy kept the order as the rows arrived } @@ -2102,7 +2079,10 @@ void AcarsDemodGUI::downloadAircraftInformationFinished() QApplication::processEvents(); } m_aircraftInfo = OsnDB::getAircraftInformationByReg(); - m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); + // The worker holds its own copy, for the registration lookups + if (m_acarsDemod->getWorker()) { + m_acarsDemod->getWorker()->getInputMessageQueue()->push(AcarsDemodWorker::MsgReloadAircraftDatabase::create()); + } if (m_progressDialog) { m_progressDialog->close(); diff --git a/plugins/channelrx/demodacars/acarsdemodgui.h b/plugins/channelrx/demodacars/acarsdemodgui.h index 2f01a2e97..3519186cd 100644 --- a/plugins/channelrx/demodacars/acarsdemodgui.h +++ b/plugins/channelrx/demodacars/acarsdemodgui.h @@ -33,12 +33,10 @@ #include "channel/channelgui.h" #include "dsp/channelmarker.h" -#include "util/waypoints.h" #include "util/messagequeue.h" #include "util/planespotters.h" -#include "util/openaip.h" #include "settings/rollupstate.h" -#include "acarsmessage.h" +#include "util/acarsmessage.h" #include "gui/acarsmessageview.h" #include "acarsdemodsettings.h" #include "acarsdemodworker.h" @@ -108,13 +106,9 @@ private: uint32_t m_tickCount; MessageQueue m_inputMessageQueue; - QSharedPointer> m_navAids; - QSharedPointer> m_airports; - QSharedPointer> m_waypoints; PlaneSpotters m_planeSpotters; QString m_photoLink; QSharedPointer> m_aircraftInfo; - QSharedPointer> m_aircraftInfoByIcao; OsnDB m_osnDB; QProgressDialog *m_progressDialog; @@ -201,10 +195,9 @@ private slots: void on_deltaFrequency_changed(qint64 value); void on_mode_currentIndexChanged(int value); void on_aeroChannel_currentIndexChanged(int value); + void on_iridiumBandwidth_currentIndexChanged(int value); void on_gsTable_clicked(); void gsTableContextMenu(QPoint pos); - void on_feed_clicked(bool checked); - void feedSelect(const QPoint& p); void on_rfBW_valueChanged(int index); void on_threshold_valueChanged(int value); void on_filter_currentIndexChanged(int index); diff --git a/plugins/channelrx/demodacars/acarsdemodgui.ui b/plugins/channelrx/demodacars/acarsdemodgui.ui index c132bbc2e..5c8774bee 100644 --- a/plugins/channelrx/demodacars/acarsdemodgui.ui +++ b/plugins/channelrx/demodacars/acarsdemodgui.ui @@ -224,7 +224,7 @@ - Mode: ACARS (2400 baud MSK), VDL Mode 2 (10500 baud D8PSK), HFDL (1800 baud PSK; tune to the published channel frequency) or Aero (Inmarsat Classic Aero, L band satellite) + Mode: ACARS (2400 baud MSK), VDL Mode 2 (10500 baud D8PSK), HFDL (1800 baud PSK; tune to the published channel frequency) Aero (Inmarsat Classic Aero, L band satellite) or Iridium (L band satellite, burst DQPSK - prototype: ring alert and short burst data frames are decoded, ACARS reassembly untested) @@ -246,6 +246,11 @@ Aero + + + Iridium + + @@ -296,6 +301,39 @@ + + + + + 85 + 0 + + + + How much of the band the Iridium scanner covers. Iridium assigns a duplex channel when a call is set up, out of about 240 across 7 MHz, so watching a single channel sees only a few percent of the traffic. The whole width is split into channels and a receiver run on each, which costs proportionally more CPU. There is no point choosing a width the device cannot supply. + + + + 1 MHz + + + + + 2 MHz + + + + + 4 MHz + + + + + 8 MHz + + + + @@ -528,8 +566,8 @@ - - :/txon.png:/txon.png + + :/icons/forward.png:/icons/forward.png true @@ -562,7 +600,7 @@ - + :/icons/chart.png:/icons/chart.png @@ -579,38 +617,21 @@ ... - + :/icons/gs.png:/icons/gs.png - - - - Enable feeding of received ACARS messages to aggregators (airframes.io / avdelphi.com). Right click for settings. - - - ... - - - - :/txon.png:/txon.png - - - true - - - - Download the latest Opensky-Network aircraft database (130MB) + Download the latest aircraft database (45MB) ... - + :/icons/aircraft.png:/icons/aircraft.png @@ -1122,7 +1143,7 @@ - + diff --git a/plugins/channelrx/demodacars/acarsdemodicons.qrc b/plugins/channelrx/demodacars/acarsdemodicons.qrc index 97468e223..13c14167f 100644 --- a/plugins/channelrx/demodacars/acarsdemodicons.qrc +++ b/plugins/channelrx/demodacars/acarsdemodicons.qrc @@ -3,5 +3,6 @@ icons/aircraft.png icons/chart.png icons/gs.png + icons/forward.png diff --git a/plugins/channelrx/demodacars/acarsdemodsettings.cpp b/plugins/channelrx/demodacars/acarsdemodsettings.cpp index c3d2d8662..ff44ad6c2 100644 --- a/plugins/channelrx/demodacars/acarsdemodsettings.cpp +++ b/plugins/channelrx/demodacars/acarsdemodsettings.cpp @@ -37,6 +37,7 @@ void AcarsDemodSettings::resetToDefaults() m_inputFrequencyOffset = 0; m_mode = ACARS; m_aeroChannel = AcarsAeroReceiver::Submode600P; + m_iridiumBandwidth = AcarsDemodSettings::IridiumScanWidths - 1; m_rfBandwidth = 12500.0f; // Pre-key detection threshold, as a fraction of the AM modulation index seen at 2400 Hz. // A real pre-key reads about 0.85 (ARINC 618 section 4.4.3 asks for at least 85 percent @@ -57,18 +58,8 @@ void AcarsDemodSettings::resetToDefaults() m_displayChart = false; m_logFilename = "acars_log.csv"; m_logEnabled = false; - m_feedEnabled = false; - m_feedStationId = ""; - m_feedAirframes = true; - m_feedAirframesHost = "feed.airframes.io"; - m_feedAirframesPort = 5550; // The airframes.io ACARS (acarsdec) station type ingests UDP on 5550; only some // other station types (e.g. VDL2/vdlm2dec on 5555) are TCP - m_feedAirframesTcp = false; - m_feedAvdelphi = false; - m_feedAvdelphiHost = "data.avdelphi.com"; - m_feedAvdelphiPort = 5556; - m_feedAvdelphiTcp = false; m_rgbColor = QColor(25, 205, 2).rgb(); m_title = "ACARS Demodulator"; @@ -129,6 +120,7 @@ QByteArray AcarsDemodSettings::serialize() const s.writeBool(38, m_logEnabled); s.writeS32(39, m_mode); s.writeS32(53, m_aeroChannel); + s.writeS32(56, m_iridiumBandwidth); // Key 40 stored the opposite question, "show these frames", so it is written // inverted rather than moved to a new key - that way an existing preset keeps // behaving exactly as it did, whichever way it was set @@ -136,16 +128,6 @@ QByteArray AcarsDemodSettings::serialize() const s.writeBool(54, m_showDate); s.writeBlob(55, m_splitterState); s.writeBool(41, m_displayChart); - s.writeBool(42, m_feedEnabled); - s.writeString(43, m_feedStationId); - s.writeBool(44, m_feedAirframes); - s.writeString(45, m_feedAirframesHost); - s.writeS32(46, m_feedAirframesPort); - s.writeBool(47, m_feedAvdelphi); - s.writeString(48, m_feedAvdelphiHost); - s.writeS32(49, m_feedAvdelphiPort); - s.writeBool(50, m_feedAirframesTcp); - s.writeBool(51, m_feedAvdelphiTcp); for (int i = 0; i < ACARSDEMOD_COLUMNS; i++) s.writeS32(100 + i, m_columnIndexes[i]); @@ -248,36 +230,24 @@ bool AcarsDemodSettings::deserialize(const QByteArray& data) d.readString(37, &m_logFilename, "acars_log.csv"); d.readBool(38, &m_logEnabled, false); d.readS32(39, &m_mode, (int)ACARS); - if ((m_mode != (int)ACARS) && (m_mode != (int)VDL2) && (m_mode != (int)HFDL) - && (m_mode != (int)Aero)) { + if ((m_mode < 0) || (m_mode >= (int)ModeCount)) { m_mode = (int)ACARS; } d.readS32(53, &m_aeroChannel, AcarsAeroReceiver::Submode600P); if ((m_aeroChannel < 0) || (m_aeroChannel >= AcarsAeroReceiver::SubmodeCount)) { m_aeroChannel = AcarsAeroReceiver::Submode600P; } + + d.readS32(56, &m_iridiumBandwidth, AcarsDemodSettings::IridiumScanWidths - 1); + if ((m_iridiumBandwidth < 0) || (m_iridiumBandwidth >= AcarsDemodSettings::IridiumScanWidths)) { + m_iridiumBandwidth = AcarsDemodSettings::IridiumScanWidths - 1; + } bool displayNoInfo = false; d.readBool(40, &displayNoInfo, false); m_hideNoInfo = !displayNoInfo; d.readBool(54, &m_showDate, true); d.readBlob(55, &m_splitterState); d.readBool(41, &m_displayChart, false); - d.readBool(42, &m_feedEnabled, false); - d.readString(43, &m_feedStationId, ""); - d.readBool(44, &m_feedAirframes, true); - d.readString(45, &m_feedAirframesHost, "feed.airframes.io"); - d.readS32(46, &m_feedAirframesPort, 5550); - if ((m_feedAirframesPort <= 1023) || (m_feedAirframesPort >= 65535)) { - m_feedAirframesPort = 5550; - } - d.readBool(47, &m_feedAvdelphi, false); - d.readString(48, &m_feedAvdelphiHost, "data.avdelphi.com"); - d.readS32(49, &m_feedAvdelphiPort, 5556); - if ((m_feedAvdelphiPort <= 1023) || (m_feedAvdelphiPort >= 65535)) { - m_feedAvdelphiPort = 5556; - } - d.readBool(50, &m_feedAirframesTcp, false); - d.readBool(51, &m_feedAvdelphiTcp, false); // Both of these are fed to the table header - moveSection() and setColumnWidth() - // so a preset from a build with a different column count, or a corrupt one, would diff --git a/plugins/channelrx/demodacars/acarsdemodsettings.h b/plugins/channelrx/demodacars/acarsdemodsettings.h index 24c37c3ab..866311549 100644 --- a/plugins/channelrx/demodacars/acarsdemodsettings.h +++ b/plugins/channelrx/demodacars/acarsdemodsettings.h @@ -1,123 +1,150 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2017 Edouard Griffiths, F4EXB. // -// Copyright (C) 2021 Jon Beniston, M7RCE // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_ACARSDEMODSETTINGS_H -#define INCLUDE_ACARSDEMODSETTINGS_H - -#include -#include - -#include "dsp/dsptypes.h" -#include "util/aircraftreport.h" - -class Serializable; - -// Number of columns in the table. -#define ACARSDEMOD_COLUMNS 23 - -struct AcarsDemodSettings -{ - enum Mode { - ACARS = 0, //!< Plain old ACARS: 2400 baud MSK on AM - VDL2 = 1, //!< VDL Mode 2: 10500 baud D8PSK, ACARS over AVLC - HFDL = 2, //!< HFDL: 1800 baud M-PSK on a 1440 Hz subcarrier, ACARS over MPDU/LPDU - Aero = 3 //!< Inmarsat Classic Aero: L band satellite, ACARS over signal units - }; - - // The protocol tag an AircraftReport gets for a given mode. - static AircraftReport::Protocol protocolForMode(int mode) - { - switch (mode) - { - case VDL2: return AircraftReport::VDL2; - case HFDL: return AircraftReport::HFDL; - case Aero: return AircraftReport::AERO; - default: return AircraftReport::ACARS; - } - } - - qint32 m_inputFrequencyOffset; - int m_mode; //!< One of enum Mode - //!< Which Aero rate and channel is tuned, an AcarsAeroReceiver::Submode. Unlike - //!< HFDL, where the M1 sequence identifies the rate, these are properties of the - //!< frequency tuned, so they are a setting rather than something detected. - int m_aeroChannel; - Real m_rfBandwidth; - Real m_correlationThreshold; //!< Pre-key detection threshold, 0 to 1 - QString m_filter; // Regular expression the filtered column must match - int m_filterColumn; // Which column to filter: 0 Registration, 1 Flight, 2 Label, 3 Message - bool m_udpEnabled; - QString m_udpAddress; - uint16_t m_udpPort; - int m_scopeCh1; - int m_scopeCh2; - bool m_displayPhotos; - //!< Hide frames carrying no usable information from the table - VDL-2 - //!< supervisory/ack frames (RR etc) and Aero satellite housekeeping. They are - //!< still received and still held in the table, only not shown - bool m_hideNoInfo; - //!< Show the date as well as the time in the Date/Time column. The date is only - //!< worth the width once a session has run past midnight - bool m_showDate; - //!< How the table and the decode view divide the space, from QSplitter::saveState - QByteArray m_splitterState; - bool m_displayChart; //!< Show the frames-per-second chart - QString m_logFilename; - bool m_logEnabled; - - // Feeding of received ACARS messages to aggregators, in acarsdec-style JSON - bool m_feedEnabled; - QString m_feedStationId; //!< Station ident sent with each message - bool m_feedAirframes; - QString m_feedAirframesHost; - int m_feedAirframesPort; - bool m_feedAirframesTcp; //!< TCP (as the airframes.io wizard assigns) or UDP - bool m_feedAvdelphi; - QString m_feedAvdelphiHost; - int m_feedAvdelphiPort; - bool m_feedAvdelphiTcp; - - quint32 m_rgbColor; - QString m_title; - Serializable *m_channelMarker; - QString m_audioDeviceName; - int m_streamIndex; //!< MIMO channel. Not relevant when connected to SI (single Rx). - bool m_useReverseAPI; - QString m_reverseAPIAddress; - uint16_t m_reverseAPIPort; - uint16_t m_reverseAPIDeviceIndex; - uint16_t m_reverseAPIChannelIndex; - Serializable *m_scopeGUI; - Serializable *m_rollupState; - int m_workspaceIndex; - QByteArray m_geometryBytes; - bool m_hidden; - - int m_columnIndexes[ACARSDEMOD_COLUMNS];//!< How the columns are ordered in the table - int m_columnSizes[ACARSDEMOD_COLUMNS]; //!< Size of the columns in the table - - AcarsDemodSettings(); - void resetToDefaults(); - void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } - void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } - void setScopeGUI(Serializable *scopeGUI) { m_scopeGUI = scopeGUI; } - QByteArray serialize() const; - bool deserialize(const QByteArray& data); -}; - -#endif /* INCLUDE_ACARSDEMODSETTINGS_H */ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2017 Edouard Griffiths, F4EXB. // +// Copyright (C) 2021 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSDEMODSETTINGS_H +#define INCLUDE_ACARSDEMODSETTINGS_H + +#include +#include + +#include "dsp/dsptypes.h" +#include "util/aircraftreport.h" + +class Serializable; + +// Number of columns in the table. +#define ACARSDEMOD_COLUMNS 23 + +struct AcarsDemodSettings +{ + enum Mode { + ACARS = 0, //!< Plain old ACARS: 2400 baud MSK on AM + VDL2 = 1, //!< VDL Mode 2: 10500 baud D8PSK, ACARS over AVLC + HFDL = 2, //!< HFDL: 1800 baud M-PSK on a 1440 Hz subcarrier, ACARS over MPDU/LPDU + Aero = 3, //!< Inmarsat Classic Aero: L band satellite, ACARS over signal units + Iridium = 4, //!< Iridium: L band satellite, burst DQPSK from low earth orbit. + ModeCount + }; + + // The protocol tag an AircraftReport gets for a given mode. + static AircraftReport::Protocol protocolForMode(int mode) + { + switch (mode) + { + case VDL2: return AircraftReport::VDL2; + case HFDL: return AircraftReport::HFDL; + case Aero: return AircraftReport::AERO; + case Iridium: return AircraftReport::IRIDIUM; + default: return AircraftReport::ACARS; + } + } + + //! Whether a change moves the channel sample rate, and so needs the channelizer + //! retuned, the resampler rebuilt and the receivers restarted. + static bool rateChanged(const AcarsDemodSettings& a, const AcarsDemodSettings& b) + { + if (a.m_mode != b.m_mode) { + return true; + } + + switch (a.m_mode) + { + case Aero: return a.m_aeroChannel != b.m_aeroChannel; + case Iridium: return a.m_iridiumBandwidth != b.m_iridiumBandwidth; + default: return false; + } + } + + //! How many channelizer outputs each Iridium scan width uses. They have to be powers + //! of two, and the sample rate the channel needs is this times the 31.25 kHz channel + //! spacing - so 256 channels is 8 MS/s and covers 8 MHz, the whole Iridium band. + static int iridiumScanChannels(int bandwidth) + { + static const int channels[] = { 32, 64, 128, 256 }; + const int count = (int) (sizeof(channels) / sizeof(channels[0])); + + return channels[((bandwidth < 0) || (bandwidth >= count)) ? (count - 1) : bandwidth]; + } + + static const int IridiumScanWidths = 4; + + qint32 m_inputFrequencyOffset; + int m_mode; //!< One of enum Mode + //!< Which Aero rate and channel is tuned, an AcarsAeroReceiver::Submode. Unlike + //!< HFDL, where the M1 sequence identifies the rate, these are properties of the + //!< frequency tuned, so they are a setting rather than something detected. + int m_aeroChannel; + //!< How much of the band the Iridium scanner covers. Iridium assigns a duplex channel + //!< when a call is set up, out of about 240 across 7 MHz, so watching one channel sees + //!< a few percent of the traffic - the scanner splits the whole width with a polyphase + //!< channelizer instead and runs a receiver on every output. An index into the table + //!< in iridiumScanChannels() below + int m_iridiumBandwidth; + Real m_rfBandwidth; + Real m_correlationThreshold; //!< Pre-key detection threshold, 0 to 1 + QString m_filter; // Regular expression the filtered column must match + int m_filterColumn; // Which column to filter: 0 Registration, 1 Flight, 2 Label, 3 Message + bool m_udpEnabled; + QString m_udpAddress; + uint16_t m_udpPort; + int m_scopeCh1; + int m_scopeCh2; + bool m_displayPhotos; + //!< Hide frames carrying no usable information from the table - VDL-2 + //!< supervisory/ack frames (RR etc) and Aero satellite housekeeping. They are + //!< still received and still held in the table, only not shown + bool m_hideNoInfo; + //!< Show the date as well as the time in the Date/Time column. The date is only + //!< worth the width once a session has run past midnight + bool m_showDate; + //!< How the table and the decode view divide the space, from QSplitter::saveState + QByteArray m_splitterState; + bool m_displayChart; //!< Show the frames-per-second chart + QString m_logFilename; + bool m_logEnabled; + + + quint32 m_rgbColor; + QString m_title; + Serializable *m_channelMarker; + QString m_audioDeviceName; + int m_streamIndex; //!< MIMO channel. Not relevant when connected to SI (single Rx). + bool m_useReverseAPI; + QString m_reverseAPIAddress; + uint16_t m_reverseAPIPort; + uint16_t m_reverseAPIDeviceIndex; + uint16_t m_reverseAPIChannelIndex; + Serializable *m_scopeGUI; + Serializable *m_rollupState; + int m_workspaceIndex; + QByteArray m_geometryBytes; + bool m_hidden; + + int m_columnIndexes[ACARSDEMOD_COLUMNS];//!< How the columns are ordered in the table + int m_columnSizes[ACARSDEMOD_COLUMNS]; //!< Size of the columns in the table + + AcarsDemodSettings(); + void resetToDefaults(); + void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } + void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } + void setScopeGUI(Serializable *scopeGUI) { m_scopeGUI = scopeGUI; } + QByteArray serialize() const; + bool deserialize(const QByteArray& data); +}; + +#endif /* INCLUDE_ACARSDEMODSETTINGS_H */ diff --git a/plugins/channelrx/demodacars/acarsdemodsink.cpp b/plugins/channelrx/demodacars/acarsdemodsink.cpp index 366c6b2ce..b8b4845a7 100644 --- a/plugins/channelrx/demodacars/acarsdemodsink.cpp +++ b/plugins/channelrx/demodacars/acarsdemodsink.cpp @@ -1,349 +1,522 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Edouard Griffiths, F4EXB // -// Copyright (C) 2021-2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include - -#include - -#include "dsp/dspengine.h" -#include "dsp/datafifo.h" -#include "dsp/scopevis.h" -#include "util/db.h" -#include "maincore.h" - -#include "acarsdemod.h" -#include "acarsdemodsink.h" - -AcarsDemodSink::AcarsDemodSink(AcarsDemod *acarsDemod) : - m_scopeSink(nullptr), - m_acarsDemod(acarsDemod), - m_channel(nullptr), - m_channelSampleRate(ACARSDEMOD_CHANNEL_SAMPLE_RATE), - m_channelFrequencyOffset(0), - m_interpolatorDistance(1.0f), - m_interpolatorDistanceRemain(0.0f), - m_magsq(0.0), - m_magsqSum(0.0f), - m_magsqPeak(0.0f), - m_magsqCount(0), - m_messageQueueToChannel(nullptr), - m_scopeBufferIndex(0), - m_demodBufferFill(0) -{ - m_demodBuffer.resize(1<<12); - m_scopeBuffer.resize(m_scopeBufferSize); - m_scopeBegin.resize(1); - - applySettings(m_settings, true); - applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true); -} - -AcarsDemodSink::~AcarsDemodSink() -{ -} - -void AcarsDemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) -{ - Complex ci; - - for (SampleVector::const_iterator it = begin; it != end; ++it) - { - Complex c(it->real(), it->imag()); - c *= m_nco.nextIQ(); - - if (m_interpolatorDistance < 1.0f) - { - while (!m_interpolator.interpolate(&m_interpolatorDistanceRemain, c, &ci)) - { - processOneSample(ci); - m_interpolatorDistanceRemain += m_interpolatorDistance; - } - } - else - { - if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci)) - { - processOneSample(ci); - m_interpolatorDistanceRemain += m_interpolatorDistance; - } - } - } -} - -void AcarsDemodSink::sampleToScope(Real ch1, Real ch2) -{ - m_scopeBuffer[m_scopeBufferIndex++] = Sample(ch1 * SDR_RX_SCALEF, ch2 * SDR_RX_SCALEF); - - if (m_scopeBufferIndex == m_scopeBufferSize) - { - m_scopeBegin[0] = m_scopeBuffer.begin(); - m_scopeSink->feed(m_scopeBegin, m_scopeBufferSize); - m_scopeBufferIndex = 0; - } -} - -Real AcarsDemodSink::scopeChannel(int selection, const Complex& ci, Real magsq) const -{ - bool vdl2 = m_settings.m_mode == AcarsDemodSettings::VDL2; - bool hfdl = m_settings.m_mode == AcarsDemodSettings::HFDL; - bool aero = m_settings.m_mode == AcarsDemodSettings::Aero; - - switch (selection) - { - case 0: return ci.real() / SDR_RX_SCALEF; - case 1: return ci.imag() / SDR_RX_SCALEF; - case 2: return magsq; - case 3: return sqrt(magsq); - case 4: return vdl2 ? (Real) std::min(m_vdl2Receiver.syncStatistic(), 10.0) - : hfdl ? (Real) m_hfdlReceiver.lastSyncError() - : aero ? (Real) m_aeroReceiver.lastSyncError() - : (Real) m_receiver.detectStatistic(); - case 5: return vdl2 ? (m_vdl2Receiver.synced() ? 1.0f : 0.0f) - : hfdl ? (m_hfdlReceiver.synced() ? 1.0f : 0.0f) - : aero ? (m_aeroReceiver.synced() ? 1.0f : 0.0f) - : (m_receiver.detected() ? 1.0f : 0.0f); - default: return 0.0f; - } -} - -void AcarsDemodSink::processOneSample(Complex &ci) -{ - Real re = ci.real() / SDR_RX_SCALEF; - Real im = ci.imag() / SDR_RX_SCALEF; - Real magsq = re*re + im*im; - - m_movingAverage(magsq); - m_magsq = m_movingAverage.asDouble(); - m_magsqSum += magsq; - - if (magsq > m_magsqPeak) { - m_magsqPeak = magsq; - } - - m_magsqCount++; - - if (m_settings.m_mode == AcarsDemodSettings::VDL2) - { - if (m_vdl2Receiver.processSample(std::complex(re, im))) - { - while (m_vdl2Receiver.hasFrame()) - { - AcarsVdl2Receiver::Frame frame = m_vdl2Receiver.popFrame(); - - if (!getMessageQueueToChannel()) { - continue; - } - - if (frame.m_isAcars) - { - // ACARS over AVLC carries the message from the mode character to the - // DEL, so prepending an SOH gives the exact VHF ACARS byte layout and - // the whole existing message path (GUI, UDP, log) works unchanged - QByteArray rxPacket; - rxPacket.append((char) 0x01); - rxPacket.append((const char *) frame.m_bytes.data() + frame.m_infoOffset + 3, frame.m_infoLength - 3); - getMessageQueueToChannel()->push(MainCore::MsgPacket::create(m_acarsDemod, rxPacket)); - } - else - { - getMessageQueueToChannel()->push(AcarsDemod::MsgVdl2Frame::create(frame)); - } - } - } - } - else if (m_settings.m_mode == AcarsDemodSettings::HFDL) - { - if (m_hfdlReceiver.processSample(std::complex(re, im))) - { - while (m_hfdlReceiver.hasFrame()) - { - AcarsHfdlReceiver::Frame frame = m_hfdlReceiver.popFrame(); - - if (!getMessageQueueToChannel()) { - continue; - } - - if (frame.m_isAcars) - { - // The LPDU carries the ACARS message from its SOH onwards, so the - // bytes from the mode character with an SOH prepended give the - // exact VHF ACARS layout and the existing message path works - QByteArray rxPacket; - rxPacket.append((char) 0x01); - rxPacket.append((const char *) frame.m_bytes.data() + frame.m_acarsOffset, - (int) (frame.m_bytes.size() - frame.m_acarsOffset)); - getMessageQueueToChannel()->push(MainCore::MsgPacket::create(m_acarsDemod, rxPacket)); - } - else - { - getMessageQueueToChannel()->push(AcarsDemod::MsgHfdlFrame::create(frame)); - } - } - } - } - else if (m_settings.m_mode == AcarsDemodSettings::Aero) - { - if (m_aeroReceiver.processSample(std::complex(re, im))) - { - while (m_aeroReceiver.hasFrame()) - { - AcarsAeroReceiver::Frame frame = m_aeroReceiver.popFrame(); - - if (!getMessageQueueToChannel()) { - continue; - } - - if (frame.m_isAcars) - { - // Unlike VDL-2 and HFDL, an Aero signal unit chain reassembles to a - // COMPLETE ARINC 618 block starting at its own SOH, so there is no - // SOH to prepend here. Parity is left on, as on the other protocols. - // Verified against AcarsMessage::decode on a real recording. - QByteArray rxPacket((const char *) frame.m_bytes.data(), (int) frame.m_bytes.size()); - getMessageQueueToChannel()->push(MainCore::MsgPacket::create(m_acarsDemod, rxPacket)); - } - else - { - getMessageQueueToChannel()->push(AcarsDemod::MsgAeroFrame::create(frame)); - } - } - } - } - // Tested explicitly rather than left as a bare else: an unrecognised mode used to - // fall through to the VHF MSK demodulator, so a mode added without touching this - // line failed by quietly running the wrong receiver - else if (m_settings.m_mode == AcarsDemodSettings::ACARS) - { - if (m_receiver.processSample(std::complex(re, im))) - { - QByteArray rxPacket((const char *) m_receiver.message(), m_receiver.messageLength()); - - if (getMessageQueueToChannel()) - { - MainCore::MsgPacket *msg = MainCore::MsgPacket::create(m_acarsDemod, rxPacket); - getMessageQueueToChannel()->push(msg); - } - } - } - - if (m_scopeSink) - { - sampleToScope(scopeChannel(m_settings.m_scopeCh1, ci, magsq), - scopeChannel(m_settings.m_scopeCh2, ci, magsq)); - } - - // Demod Analyzer feature - m_demodBuffer[m_demodBufferFill++] = (qint16)(sqrt(magsq) * std::numeric_limits::max()); - - if (m_demodBufferFill >= m_demodBuffer.size()) - { - QList dataPipes; - MainCore::instance()->getDataPipes().getDataPipes(m_channel, "demod", dataPipes); - - for (const auto& pipe : dataPipes) - { - DataFifo *fifo = qobject_cast(pipe->m_element); - - if (fifo) { - fifo->write((quint8*) &m_demodBuffer[0], m_demodBuffer.size() * sizeof(qint16), DataFifo::DataTypeI16); - } - } - - m_demodBufferFill = 0; - } -} - -void AcarsDemodSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force) -{ - qDebug() << "AcarsDemodSink::applyChannelSettings:" - << " channelSampleRate: " << channelSampleRate - << " channelFrequencyOffset: " << channelFrequencyOffset; - - if ((m_channelFrequencyOffset != channelFrequencyOffset) || - (m_channelSampleRate != channelSampleRate) || force) - { - // The published HFDL channel frequency is the (suppressed) SSB carrier; the PSK - // subcarrier sits 1440 Hz above it, so tuning to the published frequency needs - // an extra shift down onto the subcarrier - int subcarrier = m_settings.m_mode == AcarsDemodSettings::HFDL ? ACARSHFDL_SUBCARRIER_HZ : 0; - m_nco.setFreq(-(channelFrequencyOffset + subcarrier), channelSampleRate); - } - - if ((m_channelSampleRate != channelSampleRate) || force) - { - // VDL-2, HFDL and Aero need a sharper filter: the root raised cosine skirt sits - // close to the channel edge and the default 4.5 taps per phase dents it enough - // to cause symbol errors - m_interpolator.create(16, channelSampleRate, m_settings.m_rfBandwidth / 2.2f, - m_settings.m_mode == AcarsDemodSettings::ACARS ? 4.5 : 18.0); - m_interpolatorDistance = (Real) channelSampleRate / (Real) AcarsDemodSink::channelSampleRate(m_settings); - m_interpolatorDistanceRemain = m_interpolatorDistance; - } - - m_channelSampleRate = channelSampleRate; - m_channelFrequencyOffset = channelFrequencyOffset; -} - -void AcarsDemodSink::applySettings(const AcarsDemodSettings& settings, bool force) -{ - qDebug() << "AcarsDemodSink::applySettings: force: " << force; - - // An Aero submode change moves the rate just as a mode change does - bool modeChanged = (settings.m_mode != m_settings.m_mode) - || ((settings.m_mode == AcarsDemodSettings::Aero) - && (settings.m_aeroChannel != m_settings.m_aeroChannel)); - - if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || modeChanged || force) - { - m_interpolator.create(16, m_channelSampleRate, settings.m_rfBandwidth / 2.2f, - settings.m_mode == AcarsDemodSettings::ACARS ? 4.5 : 18.0); - m_interpolatorDistance = (Real) m_channelSampleRate / (Real) AcarsDemodSink::channelSampleRate(settings); - m_interpolatorDistanceRemain = m_interpolatorDistance; - int subcarrier = settings.m_mode == AcarsDemodSettings::HFDL ? ACARSHFDL_SUBCARRIER_HZ : 0; - m_nco.setFreq(-(m_channelFrequencyOffset + subcarrier), m_channelSampleRate); - } - - // Reconfiguring reallocates and resets the receiver, which throws away a transmission in - // progress, so only do it when something it cares about has actually moved - if ((settings.m_correlationThreshold != m_settings.m_correlationThreshold) || force) - { - AcarsOqpskReceiver::Config config = m_receiver.config(); - - config.m_detectThreshold = settings.m_correlationThreshold; - m_receiver.configure(config); - } - - if (modeChanged || force) - { - // Stamp the protocol into the SAME queue the packets go to, so the worker applies - // it in stream order with them rather than from its own separately delivered - // settings - see AcarsDemod::MsgProtocolChange - if (m_messageQueueToChannel) { - m_messageQueueToChannel->push(AcarsDemod::MsgProtocolChange::create(settings.m_mode)); - } - m_vdl2Receiver.reset(); - m_hfdlReceiver.reset(); - // setMode reconfigures the matched filter and buffers for the new rate, and - // resets, so it has to be called rather than reset() alone - m_aeroReceiver.setMode(AcarsAeroReceiver::submodeRate(settings.m_aeroChannel), - AcarsAeroReceiver::submodeChannel(settings.m_aeroChannel)); - } - - m_settings = settings; -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2021-2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include + +#include + +#include "dsp/dspengine.h" +#include "dsp/datafifo.h" +#include "dsp/scopevis.h" +#include "util/db.h" +#include "maincore.h" + +#include "acarsdemod.h" +#include "acarsdemodsink.h" + +AcarsDemodSink::AcarsDemodSink(AcarsDemod *acarsDemod) : + m_scopeSink(nullptr), + m_acarsDemod(acarsDemod), + m_channel(nullptr), + m_channelSampleRate(ACARSDEMOD_CHANNEL_SAMPLE_RATE), + m_channelFrequencyOffset(0), + m_interpolatorDistance(1.0f), + m_interpolatorDistanceRemain(0.0f), + m_magsq(0.0), + m_magsqSum(0.0f), + m_magsqPeak(0.0f), + m_magsqCount(0), + m_messageQueueToChannel(nullptr), + m_scopeBufferIndex(0), + m_demodBufferFill(0), + m_iridiumChannels(0), // Configured on the first Iridium sample + m_iridiumLogCount(0), + m_iridiumCarrierCount(0), + m_demodPipesPresent(false), + m_demodPipeCheck(1) +{ + m_demodBuffer.resize(1<<12); + m_scopeBuffer.resize(m_scopeBufferSize); + m_scopeBegin.resize(1); + + applySettings(m_settings, true); + applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true); +} + +AcarsDemodSink::~AcarsDemodSink() +{ +} + +void AcarsDemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) +{ + Complex ci; + + if ((m_settings.m_mode == AcarsDemodSettings::Iridium) + && (std::fabs(m_interpolatorDistance - 1.0f) < 1e-6f)) + { + for (SampleVector::const_iterator it = begin; it != end; ++it) + { + Complex c(it->real(), it->imag()); + c *= m_nco.nextIQ(); + processOneSample(c); + } + + return; + } + + for (SampleVector::const_iterator it = begin; it != end; ++it) + { + Complex c(it->real(), it->imag()); + c *= m_nco.nextIQ(); + + if (m_interpolatorDistance < 1.0f) + { + while (!m_interpolator.interpolate(&m_interpolatorDistanceRemain, c, &ci)) + { + processOneSample(ci); + m_interpolatorDistanceRemain += m_interpolatorDistance; + } + } + else + { + if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci)) + { + processOneSample(ci); + m_interpolatorDistanceRemain += m_interpolatorDistance; + } + } + } +} + +void AcarsDemodSink::sampleToScope(Real ch1, Real ch2) +{ + m_scopeBuffer[m_scopeBufferIndex++] = Sample(ch1 * SDR_RX_SCALEF, ch2 * SDR_RX_SCALEF); + + if (m_scopeBufferIndex == m_scopeBufferSize) + { + m_scopeBegin[0] = m_scopeBuffer.begin(); + m_scopeSink->feed(m_scopeBegin, m_scopeBufferSize); + m_scopeBufferIndex = 0; + } +} + +Real AcarsDemodSink::scopeChannel(int selection, const Complex& ci, Real magsq) const +{ + bool vdl2 = m_settings.m_mode == AcarsDemodSettings::VDL2; + bool hfdl = m_settings.m_mode == AcarsDemodSettings::HFDL; + bool aero = m_settings.m_mode == AcarsDemodSettings::Aero; + + switch (selection) + { + case 0: return ci.real() / SDR_RX_SCALEF; + case 1: return ci.imag() / SDR_RX_SCALEF; + case 2: return magsq; + case 3: return sqrt(magsq); + case 4: return vdl2 ? (Real) std::min(m_vdl2Receiver.syncStatistic(), 10.0) + : hfdl ? (Real) m_hfdlReceiver.lastSyncError() + : aero ? (Real) m_aeroReceiver.lastSyncError() + : (Real) m_receiver.detectStatistic(); + case 5: return vdl2 ? (m_vdl2Receiver.synced() ? 1.0f : 0.0f) + : hfdl ? (m_hfdlReceiver.synced() ? 1.0f : 0.0f) + : aero ? (m_aeroReceiver.synced() ? 1.0f : 0.0f) + : (m_receiver.detected() ? 1.0f : 0.0f); + default: return 0.0f; + } +} + +void AcarsDemodSink::processOneSample(Complex &ci) +{ + Real re = ci.real() / SDR_RX_SCALEF; + Real im = ci.imag() / SDR_RX_SCALEF; + Real magsq = re*re + im*im; + + m_movingAverage(magsq); + m_magsq = m_movingAverage.asDouble(); + m_magsqSum += magsq; + + if (magsq > m_magsqPeak) { + m_magsqPeak = magsq; + } + + m_magsqCount++; + + if (m_settings.m_mode == AcarsDemodSettings::VDL2) + { + if (m_vdl2Receiver.processSample(std::complex(re, im))) + { + while (m_vdl2Receiver.hasFrame()) + { + AcarsVdl2Receiver::Frame frame = m_vdl2Receiver.popFrame(); + + if (!getMessageQueueToChannel()) { + continue; + } + + if (frame.m_isAcars) + { + // ACARS over AVLC carries the message from the mode character to the + // DEL, so prepending an SOH gives the exact VHF ACARS byte layout and + // the whole existing message path (GUI, UDP, log) works unchanged + QByteArray rxPacket; + rxPacket.append((char) 0x01); + rxPacket.append((const char *) frame.m_bytes.data() + frame.m_infoOffset + 3, frame.m_infoLength - 3); + + // The AVLC header names the airframe by its ICAO address, where the + // block inside names it by registration. Both are worth having: the + // address collates this aircraft with its ADS-B, and the pair is the + // only evidence we ever receive that the two belong together + uint32_t acAddress = frame.m_fromAircraft ? frame.m_srcAddress : frame.m_dstAddress; + int acType = frame.m_fromAircraft ? frame.m_srcType : frame.m_dstType; + getMessageQueueToChannel()->push(AcarsDemod::MsgAcarsPacket::create( + m_acarsDemod, rxPacket, (acType == 1) ? acAddress : 0)); + } + else + { + getMessageQueueToChannel()->push(AcarsDemod::MsgVdl2Frame::create(frame)); + } + } + } + } + else if (m_settings.m_mode == AcarsDemodSettings::HFDL) + { + if (m_hfdlReceiver.processSample(std::complex(re, im))) + { + while (m_hfdlReceiver.hasFrame()) + { + AcarsHfdlReceiver::Frame frame = m_hfdlReceiver.popFrame(); + + if (!getMessageQueueToChannel()) { + continue; + } + + if (frame.m_isAcars) + { + // The LPDU carries the ACARS message from its SOH onwards, so the + // bytes from the mode character with an SOH prepended give the + // exact VHF ACARS layout and the existing message path works + QByteArray rxPacket; + rxPacket.append((char) 0x01); + rxPacket.append((const char *) frame.m_bytes.data() + frame.m_acarsOffset, + (int) (frame.m_bytes.size() - frame.m_acarsOffset)); + getMessageQueueToChannel()->push(MainCore::MsgPacket::create(m_acarsDemod, rxPacket)); + } + else + { + getMessageQueueToChannel()->push(AcarsDemod::MsgHfdlFrame::create(frame)); + } + } + } + } + else if (m_settings.m_mode == AcarsDemodSettings::Aero) + { + if (m_aeroReceiver.processSample(std::complex(re, im))) + { + while (m_aeroReceiver.hasFrame()) + { + AcarsAeroReceiver::Frame frame = m_aeroReceiver.popFrame(); + + if (!getMessageQueueToChannel()) { + continue; + } + + if (frame.m_isAcars) + { + // Unlike VDL-2 and HFDL, an Aero signal unit chain reassembles to a + // COMPLETE ARINC 618 block starting at its own SOH, so there is no + // SOH to prepend here. Parity is left on, as on the other protocols. + // Verified against AcarsMessage::decode on a real recording. + QByteArray rxPacket((const char *) frame.m_bytes.data(), (int) frame.m_bytes.size()); + getMessageQueueToChannel()->push(MainCore::MsgPacket::create(m_acarsDemod, rxPacket)); + } + else + { + getMessageQueueToChannel()->push(AcarsDemod::MsgAeroFrame::create(frame)); + } + } + } + } + // Tested explicitly rather than left as a bare else: an unrecognised mode used to + // fall through to the VHF MSK demodulator, so a mode added without touching this + // line failed by quietly running the wrong receiver + else if (m_settings.m_mode == AcarsDemodSettings::Iridium) + { + // Unlike the other modes this one scans: the channelizer in the scanner splits + // the whole tuned width into Iridium channels and runs a receiver on each, so the + // samples arriving here are the band rather than a channel + const int channels = AcarsDemodSettings::iridiumScanChannels(m_settings.m_iridiumBandwidth); + + if (channels != m_iridiumChannels) + { + m_iridiumScanner.configure(channels); + m_iridiumChannels = channels; + m_iridiumCarrierCount = 0; + m_iridiumLogCount = 0; + m_iridiumLog = IridiumLog(); + } + + m_iridiumScanner.processSample(std::complex(re, im)); + + if (++m_iridiumLogCount >= (qint64) (m_iridiumLogSeconds * m_iridiumScanner.inputRate())) + { + m_iridiumLogCount = 0; + logIridiumSummary(); + } + + while (m_iridiumScanner.hasDetection()) + { + AcarsIridiumScanner::Detection detection = m_iridiumScanner.popDetection(); + + if (!detection.m_message.isEmpty()) + { + QByteArray payload; + + if (AcarsIridiumReassembler::sbdPayload(detection.m_message, + detection.m_frame.m_uplink, payload)) + { + m_iridiumCarrierCount++; + + if (detection.m_acars.isEmpty()) + { + // Both type bytes, because the first on its own does not say + // whether a message could carry ACARS: 0x7608 does and 0x7605 + // does not, and they look the same from the leading byte + const quint8 type0 = (quint8) detection.m_message[0]; + const quint8 type1 = (detection.m_message.size() > 1) + ? (quint8) detection.m_message[1] : 0; + + qInfo() << "Iridium short burst data message," << detection.m_message.size() + << "bytes, type" << QString("0x%1%2").arg(type0, 2, 16, QChar('0')) + .arg(type1, 2, 16, QChar('0')) + << ":" << detection.m_message.toHex('.') + << "(payload is not ACARS)"; + } + } + } + + if (detection.m_acars.isEmpty()) { + continue; + } + + if (getMessageQueueToChannel()) + { + MainCore::MsgPacket *msg = MainCore::MsgPacket::create(m_acarsDemod, detection.m_acars); + getMessageQueueToChannel()->push(msg); + } + } + } + else if (m_settings.m_mode == AcarsDemodSettings::ACARS) + { + if (m_receiver.processSample(std::complex(re, im))) + { + QByteArray rxPacket((const char *) m_receiver.message(), m_receiver.messageLength()); + + if (getMessageQueueToChannel()) + { + MainCore::MsgPacket *msg = MainCore::MsgPacket::create(m_acarsDemod, rxPacket); + getMessageQueueToChannel()->push(msg); + } + } + } + + if (m_scopeSink) + { + sampleToScope(scopeChannel(m_settings.m_scopeCh1, ci, magsq), + scopeChannel(m_settings.m_scopeCh2, ci, magsq)); + } + + // Demod Analyzer feature. + // + // Whether anything is listening is rechecked periodically rather than assumed, so + // that the square root below is not paid for when nothing is. That mattered little + // while every mode ran at 105 kS/s or less, but Iridium scans the band at up to + // 8 MS/s, where this was eight million square roots a second and a pipe lookup two + // thousand times a second for a feature that is usually not attached + if (--m_demodPipeCheck <= 0) + { + QList dataPipes; + MainCore::instance()->getDataPipes().getDataPipes(m_channel, "demod", dataPipes); + + m_demodPipesPresent = !dataPipes.isEmpty(); + m_demodPipeCheck = m_demodPipeCheckInterval; + } + + if (!m_demodPipesPresent) + { + m_demodBufferFill = 0; + return; + } + + m_demodBuffer[m_demodBufferFill++] = (qint16)(sqrt(magsq) * std::numeric_limits::max()); + + if (m_demodBufferFill >= m_demodBuffer.size()) + { + QList dataPipes; + MainCore::instance()->getDataPipes().getDataPipes(m_channel, "demod", dataPipes); + + for (const auto& pipe : dataPipes) + { + DataFifo *fifo = qobject_cast(pipe->m_element); + + if (fifo) { + fifo->write((quint8*) &m_demodBuffer[0], m_demodBuffer.size() * sizeof(qint16), DataFifo::DataTypeI16); + } + } + + m_demodBufferFill = 0; + } +} + +//! Taps per phase for the input resampler. The sharp filter the other modes need is to +//! keep the root raised cosine skirt intact right up to the channel edge. Iridium does not +//! want a channel filter at all - it passes the whole scanned width and lets its own +//! channelizer do the filtering - so the cheap setting is enough, and at several MS/s the +//! difference between 4.5 and 18 taps per phase is a large part of the whole cost +static Real inputFilterTaps(const AcarsDemodSettings& settings) +{ + return ((settings.m_mode == AcarsDemodSettings::ACARS) + || (settings.m_mode == AcarsDemodSettings::Iridium)) ? 4.5 : 18.0; +} + +static Real effectiveRfBandwidth(const AcarsDemodSettings& settings) +{ + if (settings.m_mode == AcarsDemodSettings::Iridium) { + return (Real) AcarsDemodSink::channelSampleRate(settings); + } + + return settings.m_rfBandwidth; +} + +void AcarsDemodSink::logIridiumSummary() +{ + const int bursts = m_iridiumScanner.burstCount(); + + if (bursts == m_iridiumLog.m_bursts) { + return; + } + + qInfo() << "Iridium:" << (bursts - m_iridiumLog.m_bursts) << "bursts in the last" + << m_iridiumLogSeconds << "s on" << m_iridiumChannels << "channels," + << (m_iridiumScanner.duplicateCount() - m_iridiumLog.m_duplicates) << "duplicated," + << (m_iridiumScanner.frameCount() - m_iridiumLog.m_frames) << "frames decoded of which" + << (m_iridiumScanner.idaCount() - m_iridiumLog.m_ida) << "short burst data," + << (m_iridiumScanner.messageCount() - m_iridiumLog.m_messages) << "messages reassembled of which" + << (m_iridiumCarrierCount - m_iridiumLog.m_carriers) << "carry a payload," + << (m_iridiumScanner.acarsCount() - m_iridiumLog.m_acars) << "ACARS"; + + m_iridiumLog.m_bursts = bursts; + m_iridiumLog.m_duplicates = m_iridiumScanner.duplicateCount(); + m_iridiumLog.m_frames = m_iridiumScanner.frameCount(); + m_iridiumLog.m_ida = m_iridiumScanner.idaCount(); + m_iridiumLog.m_messages = m_iridiumScanner.messageCount(); + m_iridiumLog.m_carriers = m_iridiumCarrierCount; + m_iridiumLog.m_acars = m_iridiumScanner.acarsCount(); +} + +void AcarsDemodSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force) +{ + qDebug() << "AcarsDemodSink::applyChannelSettings:" + << " channelSampleRate: " << channelSampleRate + << " channelFrequencyOffset: " << channelFrequencyOffset; + + if ((m_channelFrequencyOffset != channelFrequencyOffset) || + (m_channelSampleRate != channelSampleRate) || force) + { + // The published HFDL channel frequency is the (suppressed) SSB carrier; the PSK + // subcarrier sits 1440 Hz above it, so tuning to the published frequency needs + // an extra shift down onto the subcarrier + int subcarrier = m_settings.m_mode == AcarsDemodSettings::HFDL ? ACARSHFDL_SUBCARRIER_HZ : 0; + m_nco.setFreq(-(channelFrequencyOffset + subcarrier), channelSampleRate); + + // Retuning moves the signal, so everything a receiver has worked out about where + // it is - the carrier it is tracking, the symbol clock phase it has locked, the + // instant it expects the next frame at - describes the old position and not the + // new one. Only a mode or rate change used to reset them, which is why changing + // one was the way to get a demodulator going again after nudging the offset. + // + // Not on a sample rate change alone: that path already rebuilds the interpolator + // below and the receivers cope with it, and a reset there would throw away a + // transmission in progress for nothing. + if (m_channelFrequencyOffset != channelFrequencyOffset) + { + m_vdl2Receiver.reset(); + m_hfdlReceiver.reset(); + m_aeroReceiver.reset(); + } + } + + if ((m_channelSampleRate != channelSampleRate) || force) + { + // VDL-2, HFDL and Aero need a sharper filter: the root raised cosine skirt sits + // close to the channel edge and the default 4.5 taps per phase dents it enough + // to cause symbol errors + m_interpolator.create(16, channelSampleRate, effectiveRfBandwidth(m_settings) / 2.2f, + inputFilterTaps(m_settings)); + m_interpolatorDistance = (Real) channelSampleRate / (Real) AcarsDemodSink::channelSampleRate(m_settings); + m_interpolatorDistanceRemain = m_interpolatorDistance; + } + + m_channelSampleRate = channelSampleRate; + m_channelFrequencyOffset = channelFrequencyOffset; +} + +void AcarsDemodSink::applySettings(const AcarsDemodSettings& settings, bool force) +{ + qDebug() << "AcarsDemodSink::applySettings: force: " << force; + + // An Aero submode or an Iridium scan width moves the rate just as a mode change does + bool modeChanged = AcarsDemodSettings::rateChanged(settings, m_settings); + + if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || modeChanged || force) + { + m_interpolator.create(16, m_channelSampleRate, effectiveRfBandwidth(settings) / 2.2f, + inputFilterTaps(settings)); + m_interpolatorDistance = (Real) m_channelSampleRate / (Real) AcarsDemodSink::channelSampleRate(settings); + m_interpolatorDistanceRemain = m_interpolatorDistance; + int subcarrier = settings.m_mode == AcarsDemodSettings::HFDL ? ACARSHFDL_SUBCARRIER_HZ : 0; + m_nco.setFreq(-(m_channelFrequencyOffset + subcarrier), m_channelSampleRate); + } + + // Reconfiguring reallocates and resets the receiver, which throws away a transmission in + // progress, so only do it when something it cares about has actually moved + if ((settings.m_correlationThreshold != m_settings.m_correlationThreshold) || force) + { + AcarsOqpskReceiver::Config config = m_receiver.config(); + + config.m_detectThreshold = settings.m_correlationThreshold; + m_receiver.configure(config); + } + + if (modeChanged || force) + { + // Stamp the protocol into the SAME queue the packets go to, so the worker applies + // it in stream order with them rather than from its own separately delivered + // settings - see AcarsDemod::MsgProtocolChange + if (m_messageQueueToChannel) { + m_messageQueueToChannel->push(AcarsDemod::MsgProtocolChange::create(settings.m_mode)); + } + m_vdl2Receiver.reset(); + m_hfdlReceiver.reset(); + // setMode reconfigures the matched filter and buffers for the new rate, and + // resets, so it has to be called rather than reset() alone + m_aeroReceiver.setMode(AcarsAeroReceiver::submodeRate(settings.m_aeroChannel), + AcarsAeroReceiver::submodeChannel(settings.m_aeroChannel)); + } + + m_settings = settings; +} diff --git a/plugins/channelrx/demodacars/acarsdemodsink.h b/plugins/channelrx/demodacars/acarsdemodsink.h index cde3b7a6d..dd841aaf1 100644 --- a/plugins/channelrx/demodacars/acarsdemodsink.h +++ b/plugins/channelrx/demodacars/acarsdemodsink.h @@ -34,6 +34,8 @@ #include "acarsvdl2.h" #include "acarshfdl.h" #include "acarsaero.h" +#include "acarsiridium.h" +#include "acarsiridiumscanner.h" #define ACARSDEMOD_CHANNEL_SAMPLE_RATE ACARSOQPSK_CHANNEL_SAMPLE_RATE @@ -66,6 +68,11 @@ public: case AcarsDemodSettings::Aero: return AcarsAeroReceiver::channelSampleRate( AcarsAeroReceiver::submodeRate(settings.m_aeroChannel)); + // Iridium scans rather than tuning one channel, so the rate is the width of band + // it covers, not the rate one receiver runs at + case AcarsDemodSettings::Iridium: + return AcarsDemodSettings::iridiumScanChannels(settings.m_iridiumBandwidth) + * ACARSIRIDIUM_SCAN_SPACING; default: return ACARSDEMOD_CHANNEL_SAMPLE_RATE; } } @@ -134,6 +141,34 @@ private: AcarsVdl2Receiver m_vdl2Receiver; AcarsHfdlReceiver m_hfdlReceiver; AcarsAeroReceiver m_aeroReceiver; + AcarsIridiumScanner m_iridiumScanner; + int m_iridiumChannels; //!< What the scanner is currently configured for + + //!< Scanning the whole band decodes a dozen frames a second, so none of them are + //!< logged individually - what the band is doing is summarised this often instead, + //!< as the change in the scanner's counters since the last one + static constexpr double m_iridiumLogSeconds = 60.0; + qint64 m_iridiumLogCount; //!< Input samples since the last summary + int m_iridiumCarrierCount; //!< Reassembled messages whose type carries a payload + + struct IridiumLog + { + int m_bursts = 0; + int m_duplicates = 0; + int m_frames = 0; + int m_ida = 0; + int m_messages = 0; + int m_carriers = 0; + int m_acars = 0; + }; + + IridiumLog m_iridiumLog; //!< The counters as of the last summary + + //!< Whether a Demod Analyzer is attached, rechecked every so many samples rather + //!< than per sample. A tenth of a second at the fastest rate the plugin runs at + bool m_demodPipesPresent; + int m_demodPipeCheck; + static const int m_demodPipeCheckInterval = 100000; static const int m_scopeBufferSize = 512; SampleVector m_scopeBuffer; @@ -144,6 +179,7 @@ private: int m_demodBufferFill; void processOneSample(Complex &ci); + void logIridiumSummary(); void sampleToScope(Real ch1, Real ch2); Real scopeChannel(int selection, const Complex& ci, Real magsq) const; diff --git a/plugins/channelrx/demodacars/acarsdemodwebapiadapter.cpp b/plugins/channelrx/demodacars/acarsdemodwebapiadapter.cpp index a511957e0..0dc18f60f 100644 --- a/plugins/channelrx/demodacars/acarsdemodwebapiadapter.cpp +++ b/plugins/channelrx/demodacars/acarsdemodwebapiadapter.cpp @@ -31,9 +31,9 @@ int AcarsDemodWebAPIAdapter::webapiSettingsGet( QString& errorMessage) { (void) errorMessage; - /* response.setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); + response.setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); response.getAcarsDemodSettings()->init(); - AcarsDemod::webapiFormatChannelSettings(response, m_settings); */ + AcarsDemod::webapiFormatChannelSettings(response, m_settings); return 200; } @@ -46,7 +46,7 @@ int AcarsDemodWebAPIAdapter::webapiSettingsPutPatch( { (void) force; (void) errorMessage; - // AcarsDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response); + AcarsDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response); return 200; } diff --git a/plugins/channelrx/demodacars/acarsdemodworker.cpp b/plugins/channelrx/demodacars/acarsdemodworker.cpp index a37d6d8ee..469f3c4dd 100644 --- a/plugins/channelrx/demodacars/acarsdemodworker.cpp +++ b/plugins/channelrx/demodacars/acarsdemodworker.cpp @@ -1,2357 +1,2581 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "dsp/dspcommands.h" -#include "util/db.h" -#include "util/units.h" -#include "maincore.h" - -#include "SWGMapItem.h" - -#ifdef _MSC_VER -// For libacars/asn1/asn_system.h -#define ASSUMESTDTYPES -#define ssize_t SSIZE_T -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -// asn_system.h maps these C99 functions to pre-C99 MSVC CRT names; the macros -// break later standard headers (e.g. uses std::ilogb) -#undef isnan -#undef finite -#undef copysign -#undef ilogb -#endif - -#include "acarsdemod.h" -#include "acarsdemodworker.h" -#include "acarstextformat.h" - -// Airport information used by AcarsMessage decoders (file-scope in -// acarsmessage.cpp); initialised in startWork() -extern QSharedPointer> m_airportInfo; - -MESSAGE_CLASS_DEFINITION(AcarsDemodWorker::MsgConfigureWorker, Message) - -// Convert CPDCL altitude in to feet -static int cpdlcAltitude(FANSAltitude_t altitude) -{ - switch(altitude.present) - { - case FANSAltitude_PR_altitudeQNH: - return altitude.choice.altitudeQNH * 10; - case FANSAltitude_PR_altitudeQNHMeters: - return Units::metresToIntegerFeet(altitude.choice.altitudeQNHMeters); - case FANSAltitude_PR_altitudeQFE: - return altitude.choice.altitudeQFE * 10; - case FANSAltitude_PR_altitudeQFEMeters: - return Units::metresToIntegerFeet(altitude.choice.altitudeQFEMeters); - case FANSAltitude_PR_altitudeGNSSFeet: - return altitude.choice.altitudeGNSSFeet; - case FANSAltitude_PR_altitudeGNSSMeters: - return Units::metresToIntegerFeet(altitude.choice.altitudeGNSSMeters); - case FANSAltitude_PR_altitudeFlightLevel: - return altitude.choice.altitudeFlightLevel * 100; - case FANSAltitude_PR_altitudeFlightLevelMetric: - return Units::metresToIntegerFeet(altitude.choice.altitudeFlightLevelMetric * 10.0); - case FANSAltitude_PR_NOTHING: /* No components present */ - default: - return -1; - } -} - -static double cpdlcCoordinate(long degrees, long *tenthsofminutes) -{ - double result = (double)degrees; - if(tenthsofminutes != NULL) { - result += (double)(*tenthsofminutes) / 10.0f / 60.0f; - } - return result; -} - -// Extract lat, lon, alt from FANSPositionReport -static bool cpdlcExtractPosition(FANSPositionReport_t rpt, double &latitude, double &longitude, int &altitude) -{ - // FANSPositionCurrent_t can contain various types of position data (fix name, navaid, etc). - // We want only latitude/longitude coordinates. - FANSPositionCurrent_t pos = rpt.positioncurrent; - if(pos.present != FANSPosition_PR_latitudeLongitude) { - return false; - } - FANSLatitudeLongitude_t latlon = pos.choice.latitudeLongitude; - latitude = cpdlcCoordinate(latlon.latitude.latitudeDegrees, latlon.latitude.minutesLatLon); - if(latlon.latitude.latitudeDirection == FANSLatitudeDirection_south) { - latitude = -latitude; - } - longitude = cpdlcCoordinate(latlon.longitude.longitudeDegrees, latlon.longitude.minutesLatLon); - if(latlon.longitude.longitudeDirection == FANSLongitudeDirection_west) { - longitude = -longitude; - } - altitude = cpdlcAltitude(rpt.altitude); - - return true; -} - -AcarsDemodWorker::AcarsDemodWorker(AcarsDemod *acarsDemod) : - m_acarsDemod(acarsDemod) -{ - qRegisterMetaType("AcarsRowEvent"); - qRegisterMetaType("AcarsAssemblyEvent"); - - connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &AcarsDemodWorker::handleInputMessages); -} - -AcarsDemodWorker::~AcarsDemodWorker() -{ - if (m_logFile.isOpen()) - { - m_logStream.flush(); - m_logFile.close(); - } - if (m_reasmCtx) { - la_reasm_ctx_destroy(m_reasmCtx); - } - m_multipartAssembler.clear(); -} - -// Runs on the worker thread once it starts -void AcarsDemodWorker::startWork() -{ - // Sockets must be created on the thread that uses them - m_udpSocket = new QUdpSocket(this); - m_feedSocket = new QUdpSocket(this); - m_feedAirframesTcpSocket = new QTcpSocket(this); - m_feedAvdelphiTcpSocket = new QTcpSocket(this); - - m_reasmCtx = la_reasm_ctx_new(); - - // Airport information for the AcarsMessage decoders, plus the user-defined label - // names. - // - // All three of these are PROCESS WIDE - m_airportInfo is a global and the two label - // hashes are static members - while startWork() runs on every demodulator's OWN - // worker thread, because it is connected to QThread::started. An unguarded - // check-then-assign therefore races as soon as two channels are created close - // together: QSharedPointer assignment is not atomic, and nor is QHash insertion, so - // the failure mode is a corrupted hash or a double free rather than merely doing the - // work twice. The base label hashes are initialised at file scope, so only these - // additions need guarding. - static std::once_flag sharedDataInit; - std::call_once(sharedDataInit, []() - { - m_airportInfo = OurAirportsDB::getAirportsByIdent(); - - // Add user-defined labels - for (int i = '1'; i <= '4'; i++) - { - for (char c = '0'; c <= '~'; c++) - { - QString label; - label.append(QChar(i)); - label.append(QChar(c)); - m_labels.insert(label, "User defined"); - m_subLabels.insert(label, "User defined"); - } - } - }); - - m_aircraftInfo = OsnDB::getAircraftInformationByReg(); - m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); - - loadVdl2Gs(); -} - -// A different RF channel or protocol: nothing partially reassembled from the old one may -// combine with new traffic. That means ALL THREE reassembly layers, not just ATN - the -// ACARS multipart assembler holds partial ETB chains, and libacars keeps its own -// reassembly context for fragmented messages. Clearing only the ATN decoder left the -// other two to splice a half message from one frequency onto traffic from another. -void AcarsDemodWorker::resetReassembly() -{ - m_atnDecoder.clear(); - m_multipartAssembler.clear(); - if (m_reasmCtx) - { - la_reasm_ctx_destroy(m_reasmCtx); - m_reasmCtx = la_reasm_ctx_new(); - } -} - -void AcarsDemodWorker::handleInputMessages() -{ - Message* message; - while ((message = m_inputMessageQueue.pop())) - { - if (handleMessage(*message)) { - delete message; - } - } -} - -void AcarsDemodWorker::forwardToGui(Message *message) -{ - MessageQueue *guiQueue = m_acarsDemod->getMessageQueueToGUI(); - if (guiQueue) { - guiQueue->push(message); - } else { - delete message; - } -} - -bool AcarsDemodWorker::handleMessage(const Message& message) -{ - if (AcarsDemod::MsgProtocolChange::match(message)) - { - const AcarsDemod::MsgProtocolChange& protocol = (const AcarsDemod::MsgProtocolChange&) message; - // Arrives in stream order with the packets, so everything after it really did - // come off this protocol. The sink also emits this on a FORCED settings apply, which - // happens at startup and on preset load without the mode necessarily changing, so - // only a genuine change discards what is part way through reassembly. - if (m_protocolMode != protocol.getMode()) - { - m_protocolMode = protocol.getMode(); - resetReassembly(); - } - return true; - } - if (MainCore::MsgPacket::match(message)) - { - MainCore::MsgPacket& report = (MainCore::MsgPacket&) message; - processPacket(report.getPacket(), report.getDateTime()); - - // Forward to APRS and other packet features - QList packetsPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_acarsDemod, "packets", packetsPipes); - - for (const auto& pipe : packetsPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - MainCore::MsgPacket *msg = new MainCore::MsgPacket(report); - messageQueue->push(msg); - } - - // Forward via UDP - if (m_settings.m_udpEnabled && m_udpSocket) - { - m_udpSocket->writeDatagram(report.getPacket().data(), report.getPacket().size(), - QHostAddress(m_settings.m_udpAddress), m_settings.m_udpPort); - } - - // Write to log file - if (m_logFile.isOpen()) - { - QByteArray bytes = report.getPacket(); - // One ISO 8601 column, to match the table. It is unambiguous, it sorts - // chronologically as text - which the locale date string did not - and it - // keeps the milliseconds the two locale strings threw away - m_logStream << report.getDateTime().toString(Qt::ISODateWithMs) << "," - << bytes.toHex() - << "\n"; - } - - return true; - } - else if (AcarsDemod::MsgVdl2Frame::match(message)) - { - AcarsDemod::MsgVdl2Frame& report = (AcarsDemod::MsgVdl2Frame&) message; - processVdl2Frame(report.getFrame(), report.getDateTime()); - return true; - } - else if (AcarsDemod::MsgAeroFrame::match(message)) - { - AcarsDemod::MsgAeroFrame& report = (AcarsDemod::MsgAeroFrame&) message; - processAeroFrame(report.getFrame(), report.getDateTime()); - return true; - } - else if (AcarsDemod::MsgHfdlFrame::match(message)) - { - AcarsDemod::MsgHfdlFrame& report = (AcarsDemod::MsgHfdlFrame&) message; - processHfdlFrame(report.getFrame(), report.getDateTime()); - return true; - } - else if (MsgConfigureWorker::match(message)) - { - const MsgConfigureWorker& cfg = (const MsgConfigureWorker&) message; - applySettings(cfg.getSettings(), cfg.getForce()); - return true; - } - else if (DSPSignalNotification::match(message)) - { - const DSPSignalNotification& notif = (const DSPSignalNotification&) message; - if (m_centerFrequency != notif.getCenterFrequency()) { - resetReassembly(); - } - m_centerFrequency = notif.getCenterFrequency(); - return true; - } - return false; -} - -void AcarsDemodWorker::applySettings(const AcarsDemodSettings& settings, bool force) -{ - if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) - || (settings.m_mode != m_settings.m_mode) - || ((settings.m_mode == AcarsDemodSettings::Aero) - && (settings.m_aeroChannel != m_settings.m_aeroChannel))) { - resetReassembly(); - } - - if ((settings.m_logEnabled != m_settings.m_logEnabled) - || (settings.m_logFilename != m_settings.m_logFilename) - || force) - { - if (m_logFile.isOpen()) - { - m_logStream.flush(); - m_logFile.close(); - } - if (settings.m_logEnabled && !settings.m_logFilename.isEmpty()) - { - m_logFile.setFileName(settings.m_logFilename); - if (m_logFile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) - { - qDebug() << "AcarsDemodWorker::applySettings - Logging to: " << settings.m_logFilename; - bool newFile = m_logFile.size() == 0; - m_logStream.setDevice(&m_logFile); - if (newFile) - { - // Write header - m_logStream << "DateTime,Data\n"; - } - } - else - { - qDebug() << "AcarsDemodWorker::applySettings - Unable to open log file: " << settings.m_logFilename; - } - } - } - - m_settings = settings; - - if (m_feedAirframesTcpSocket) { - updateFeedConnections(); - } -} - -// Process an ACARS message from any of the three modes -void AcarsDemodWorker::processPacket(const QByteArray& packet, QDateTime dateTime) -{ - processAcarsMessage(packet, dateTime); -} - -// Whether anything is going to look at what we format. -// -// The channel's GUI message queue is the framework's own test for this, and it is null in -// a server build or for a channel created headlessly. Everything the demodulator exists to -// DO - the UDP forward, the log, the aggregator feeds, the aircraft reports and map items - -// happens either way; what is skipped is only the rendering and the strings kept for the -// decode view, which in a headless run are built, stored and never read. -bool AcarsDemodWorker::hasGui() const -{ - return m_acarsDemod && m_acarsDemod->getMessageQueueToGUI(); -} - -void AcarsDemodWorker::emitAssemblyState(const QSharedPointer& assembly) -{ - // The whole of this exists to populate the decode view - if (!hasGui()) { - return; - } - - AcarsAssemblyEvent e; - e.m_assemblyId = assembly->m_id; - e.m_isMultipart = assembly->isMultipart(); - e.m_uplink = assembly->m_uplink; - e.m_statusText = AcarsMultipartAssembler::statusText(assembly->m_status); - e.m_uniquePartCount = assembly->m_uniquePartCount; - e.m_duplicateCount = assembly->m_duplicateCount; - e.m_missingSequences = assembly->m_missingSequences; - - // The "Combined message" section for the decode view: the libacars decode - // of the complete assembly, our own decoder's text, or the raw combination - if (!assembly->m_libAcarsDecodedText.isEmpty()) - { - QString libAcarsDecode = assembly->m_libAcarsDecodedText.toHtmlEscaped(); - libAcarsDecode.replace("\n", "
"); - e.m_combinedHtmlBody = libAcarsDecode; - } - else if (!assembly->m_decodedText.isEmpty()) - { - QString builtInDecode = assembly->m_decodedText; - builtInDecode.replace("\r", "
"); - builtInDecode.replace("\n", "
"); - e.m_combinedHtmlBody = builtInDecode; - } - else - { - QString combinedText = assembly->m_combinedText.toHtmlEscaped(); - combinedText.replace("\n", "
"); - e.m_combinedHtmlBody = combinedText; - } - - emit assemblyUpdated(e); -} - -// Decode one ACARS message: multipart assembly, our decoders, libacars (ADS-C, -// CPDLC, ARINC 622), aircraft reports, aggregator feeds and the display event -// ACARS labels are two characters and some of them are control codes - the general -// response in demand mode is underscore followed by DEL. Left as-is they render as a -// missing-glyph box, which reads as a decode failure when it is nothing of the sort. -// Substituting the Unicode Control Pictures block shows what the character actually is. -// Display only: the raw label still does the table lookup and still goes out on the feeds. -static QString printableLabel(const QString& label) -{ - QString out; - for (QChar c : label) - { - const ushort u = c.unicode(); - if (u == 0x7F) { - out.append(QChar(0x2421)); // DEL - } else if (u < 0x20) { - out.append(QChar(0x2400 + u)); // NUL through US - } else { - out.append(c); - } - } - return out; -} - -// The event carries a day of the month and a UTC time but no month or year, so the -// reception time supplies those. Searching a few days either side rather than assuming -// the same month is what makes it work across a month boundary - an OUT at 23:55 on the -// 31st is commonly reported a few minutes later, on the 1st. -static QDateTime oooiDateTime(const QDateTime& received, int day, const QTime& time) -{ - if (!time.isValid() || !received.isValid()) { - return QDateTime(); - } - const QDate base = received.toUTC().date(); - if ((day < 1) || (day > 31)) { - return QDateTime(base, time, Qt::UTC); - } - for (int offset = 0; offset <= 2; offset++) - { - for (int sign = 1; sign >= -1; sign -= 2) - { - const QDate d = base.addDays(sign * offset); - if (d.day() == day) { - return QDateTime(d, time, Qt::UTC); - } - if (offset == 0) { - break; - } - } - } - return QDateTime(base, time, Qt::UTC); -} - -// Recognise a weather report inside an ACARS message, and say which airport it is about. -// -// There is no single weather label. Aircraft request weather on 5U and ATIS on 5D/B9, and -// the reply comes back on whatever label the airline's system uses - very often plain -// text. So the label narrows it and the CONTENT decides, which is also what makes a METAR -// forwarded inside a free-text message findable. -// -// Each form is recognised by the shape the WMO and ICAO formats guarantee: -// METAR ICAO ddhhmmZ ... observation, sometimes with a METAR/SPECI prefix -// TAF TAF [AMD|COR] ICAO ddhhmmZ forecast -// NOTAM a series beginning with an exclamation mark or the word NOTAM -// PIREP UA/ or UUA/ followed by /OV -// SIGMET ICAO SIGMET|AIRMET n VALID -static int classifyWeather(const QString& label, const QString& text, - QString& airport, QString& body) -{ - static const QRegularExpression metarRe( - R"((?:^|\n)\s*(?:(?:METAR|SPECI)\s+)?([A-Z]{4})\s+\d{6}Z\s)"); - static const QRegularExpression tafRe( - R"((?:^|\n)\s*TAF(?:\s+(?:AMD|COR|RTD))?\s+([A-Z]{4})\s)"); - static const QRegularExpression sigmetRe( - R"((?:^|\n)\s*([A-Z]{4})\s+(?:SIGMET|AIRMET)\s)"); - static const QRegularExpression notamRe( - R"((?:^|\n)\s*(?:NOTAM|!\s*([A-Z]{3,4})))"); - static const QRegularExpression pirepRe( - R"((?:^|\n)\s*(?:UA|UUA)/.*?/OV\s+([A-Z]{3,4}))"); - static const QRegularExpression atisRe( - R"(([A-Z]{4})\s+(?:ARR|DEP|ARR/DEP)?\s*ATIS\s+([A-Z])\b)"); - - body = text.trimmed(); - if (body.isEmpty()) { - return AircraftReport::WeatherNone; - } - - QRegularExpressionMatch m = tafRe.match(body); - if (m.hasMatch()) - { - airport = m.captured(1); - return AircraftReport::Taf; - } - m = metarRe.match(body); - if (m.hasMatch()) - { - airport = m.captured(1); - return AircraftReport::Metar; - } - m = sigmetRe.match(body); - if (m.hasMatch()) - { - airport = m.captured(1); - return AircraftReport::Sigmet; - } - m = pirepRe.match(body); - if (m.hasMatch()) - { - airport = m.captured(1); - return AircraftReport::Pirep; - } - m = notamRe.match(body); - if (m.hasMatch()) - { - airport = m.captured(1); - return AircraftReport::Notam; - } - m = atisRe.match(body); - if (m.hasMatch()) - { - airport = m.captured(1); - return AircraftReport::Atis; - } - - // Nothing matched on content. The label still says what the message was FOR, so a - // terminal weather report is kept as weather even when its body is a format we do - // not parse - better an unclassified row than a missing one. - if ((label == "AB") || (label == "BB")) { - return AircraftReport::Twip; - } - if ((label == "A9") || (label == "5D") || (label == "B9")) { - return AircraftReport::Atis; - } - if ((label == "5U") || (label == "WO")) { - return AircraftReport::WeatherOther; - } - return AircraftReport::WeatherNone; -} - -void AcarsDemodWorker::processAcarsMessage(QByteArray messageBytes, QDateTime received) -{ - // FIXME: Occasionally last byte is ff instead of 7f - correct, otherwise libacars wont parse - // Should be fixed in sink - if (messageBytes[messageBytes.size()-1] == (char)0xff) { - messageBytes[messageBytes.size()-1] = 0x7f; - } - - // Decode the message - AcarsMessage *message = AcarsMessage::decode(messageBytes); - if (!message) - { - qDebug() << "AcarsDemodWorker::processAcarsMessage: Unsupported ACARS message: " << messageBytes; - return; - } - - // Owned here and freed on every exit path. It used to be appended to m_messages and - // kept for the life of the channel, because the multipart assembler identified parts - // by the message's ADDRESS - so every message ever decoded had to stay allocated for - // those addresses to remain unique. The assembler now uses an id instead, and nothing - // outside this function holds the pointer: the row and assembly events carry copies. - QScopedPointer messageOwner(message); - - message->m_dateTime = received; - - AcarsMultipartAssembler::Part multipartPart; - multipartPart.m_sourceId = ++m_nextSourceId; - multipartPart.m_received = received; - multipartPart.m_uplink = message->m_uplink; - multipartPart.m_address = message->m_address; - multipartPart.m_label = message->m_label; - multipartPart.m_subLabel = message->m_subLabel; - multipartPart.m_blockId = message->m_blockId; - multipartPart.m_originator = message->m_originator; - multipartPart.m_messageNumber = message->m_messageNumber; - if (!message->m_blockSequence.isEmpty()) { - multipartPart.m_blockSequence = message->m_blockSequence[0]; - } - multipartPart.m_text = message->m_text; - multipartPart.m_more = message->m_multiBlock; - - AcarsMultipartAssembler::Result multipart = m_multipartAssembler.add(multipartPart); - if (multipart.m_assembly) - { - // Do not offer a partial or gap-collapsed payload to an application decoder. - // Once complete, earlier table rows get the same decode through the assembly. - if (multipart.m_assembly->m_status == AcarsMultipartAssembler::Complete) - { - message->decode(multipart.m_assembly->m_combinedText); - if (hasGui()) { - multipart.m_assembly->m_decodedText = message->toString(); - } - } - else - { - multipart.m_assembly->m_decodedText.clear(); - multipart.m_assembly->m_libAcarsDecodedText.clear(); - } - } - - feedMessage(*message); - - AcarsRowEvent e; - e.m_frameType = 0; - e.m_received = received; - e.m_uplink = message->m_uplink; - - // Record the aircraft as active for the GUI's chart. Only downlinks show - // the aircraft itself transmitting. - if (!message->m_uplink && !message->m_address.isEmpty()) { - e.m_chartAircraftId = message->m_address; - } - - // Mode is destination of message - // 2 = All ground stations / aircraft - Other characters are specific station / aircraft - // and country specific (the GUI derives the country decode) - e.m_mode = QString("%1").arg(message->m_mode); - - e.m_address = message->m_address; - - // ACK or NACK - Or block ID it corresponds to - if (message->m_ack == (char)ASCII_ACK) { - e.m_ack = "ACK"; - } else if (message->m_ack == (char)ASCII_NAK) { - e.m_ack = "NAK"; - } else { - e.m_ack = QString("%1").arg(message->m_ack); - } - - // Label (type of message) - QString label = printableLabel(message->m_label); - if (!message->m_subLabel.isEmpty()) - { - label.append('/'); - label.append(message->m_subLabel); - e.m_labelDecode = m_subLabels[message->m_subLabel]; - } - else - { - e.m_labelDecode = m_labels.value(message->m_label); - } - // An ACARS block reaches here from every protocol - the VDL-2, HFDL and Aero - // receivers all reassemble one and push it down this same path - so the link it - // came off is m_protocolMode, tracked in stream order, and not simply "ACARS" - switch (m_protocolMode) - { - case AcarsDemodSettings::VDL2: - e.m_protocol = "VDL-2"; - e.m_bitRate = 31500; // 10500 symbols/s of D8PSK, three bits each - break; - case AcarsDemodSettings::HFDL: - e.m_protocol = "HFDL"; - e.m_bitRate = 0; // Per frame, and not carried on this path - break; - case AcarsDemodSettings::Aero: - e.m_protocol = "Aero"; - e.m_bitRate = AcarsAeroReceiver::submodeRate(m_settings.m_aeroChannel); - break; - default: - e.m_protocol = "ACARS"; - e.m_bitRate = 2400; - break; - } - e.m_label = label; - - // Block ID - e.m_blockId = QString("%1").arg(message->m_blockId); - - e.m_originator = message->m_originator; - e.m_originatorDecode = m_originators[message->m_originator]; - e.m_messageNumber = message->m_messageNumber; - e.m_blockSequence = message->m_blockSequence; - e.m_flight = message->m_flight; - - // One sighting for the Aircraft feature, filled in as the message decodes - // and sent at the end - AircraftReport report; - report.m_received = received; - report.m_flight = message->m_flight; - report.m_label = label; - report.m_uplink = message->m_uplink; - report.m_documentKind = AircraftReport::AcarsText; - if (message->m_text.contains("LOADSHEET")) - { - report.m_documentKind = AircraftReport::Loadsheet; - report.m_documentTitle = "Loadsheet"; - } - // The address is only a registration when it is a real one - HFDL/VDL-2 - // link identities show as "AC n"/"GS n"/"Unidentified" forms - if (!message->m_address.isEmpty() && (message->m_address != "Unidentified") - && !message->m_address.startsWith("AC ") && !message->m_address.startsWith("GS ")) { - report.m_registration = message->m_address; - } - - // Get UNIX time message was received - struct timeval rxTimeVal; - rxTimeVal.tv_sec = received.toSecsSinceEpoch(); - rxTimeVal.tv_usec = 0; - - // Tell libacars which protocol this came off. It changes the reassembly rules, and - // until now nothing set it at all, so HFDL and VDL-2 were both being parsed as - // plain VHF ACARS. There is no VDL-2 constant because VDL-2 *is* a VHF protocol. - // - // The protocol comes from m_protocolMode, stamped by the sink into the packet queue, NOT - // from m_settings - the two are configured through independent queues, so a packet - // demodulated under the old mode can arrive after the worker's settings have moved on. - // - // la_config_set_int writes a PROCESS WIDE setting with no per-context alternative in - // the API, so two ACARS demodulators in different modes would otherwise race between - // the set and the parse. The lock below spans both, which serialises parsing across - // every ACARS demodulator in the process - acceptable because a parse is microseconds, - // and the alternative is messages silently reassembled under another channel's rules. - static QMutex protocolMutex; - - la_proto_node *node; - { - QMutexLocker protocolLock(&protocolMutex); - - switch (m_protocolMode) - { - case AcarsDemodSettings::HFDL: - la_config_set_int("acars_bearer", LA_ACARS_BEARER_HFDL); - break; - case AcarsDemodSettings::Aero: - la_config_set_int("acars_bearer", LA_ACARS_BEARER_SATCOM); - break; - default: - la_config_set_int("acars_bearer", LA_ACARS_BEARER_VHF); - break; - } - - // Decode message with libacars - node = la_acars_parse_and_reassemble((uint8_t *)messageBytes.data()+1, messageBytes.length() - 1, - message->m_uplink ? LA_MSG_DIR_GND2AIR : LA_MSG_DIR_AIR2GND, - m_reasmCtx, rxTimeVal); - } // protocol lock released: it only has to span the set and the parse - if (node != nullptr) - { - // Decode binary message data using libacars (FANS 1/A ADS-C & CPDLC, MAIM, Media Advisory) - if (node->next) - { - la_vstring *vstr = la_proto_tree_format_text(nullptr, node->next); - QString full = QString(vstr->str).trimmed(); - // Column: flattened to one line; the full multi-line decode is kept - // for the decode view and Map popups - e.m_textDecode = acarsDecodeToColumn(full); - e.m_fullDecode = full; - if (multipart.m_assembly - && (multipart.m_assembly->m_status == AcarsMultipartAssembler::Complete)) - { - if (hasGui()) { - multipart.m_assembly->m_libAcarsDecodedText = vstr->str; - } - } - e.m_useLibacars = true; - la_vstring_destroy(vstr, true); - } - else - { - // Our decoder for stuff libacars doesn't support, such as B1/B2/QQ - QString full = acarsDecodeToPlain(message->toString()); - e.m_textDecode = acarsDecodeToColumn(full); - e.m_fullDecode = full; - e.m_useLibacars = false; - } - - // ARINC 622 decode - la_proto_node *arincNode = la_proto_tree_find_arinc(node); - if (arincNode) - { - la_arinc_msg *arinc = (la_arinc_msg *)arincNode->data; - if (arinc) - { - // Use our decode if libacars doesn't support the IMI. E.g. TI2 - if (arinc->imi == ARINC_MSG_UNKNOWN) - { - QString full = acarsDecodeToPlain(message->toString()); - e.m_textDecode = acarsDecodeToColumn(full); - e.m_fullDecode = full; - e.m_useLibacars = false; - } - - // Extract ATC comms - if ((arinc->imi == ARINC_MSG_AT1) || (arinc->imi == ARINC_MSG_CR1)) - { - // Use our decoder rather than libacars for ATC, as it expands messages, rather than displays in hierarchical form - AcarsATCCommunications *atcCommunications = dynamic_cast(message); - if (atcCommunications && !atcCommunications->m_622.m_do219.isEmpty()) { - e.m_atc = atcCommunications->m_622.m_do219; - } - AcarsMessageFromSubsystem *sub = dynamic_cast(message); - if (sub && !sub->m_622.m_do219.isEmpty()) { - e.m_atc = sub->m_622.m_do219; - } - report.m_documentKind = AircraftReport::Cpdlc; - report.m_documentTitle = "CPDLC"; - if (!e.m_atc.isEmpty()) - { - report.m_documentText = e.m_atc; - report.m_atc = e.m_atc; - } - if (strlen(arinc->gs_addr) > 0) { - report.m_station = QString(arinc->gs_addr).trimmed(); - } - } - } - } - - // Look for ADS-C data. The tag numbers are direction dependent - in a - // downlink these are position reports, but in an uplink the same tags - // are contract requests, whose data is not a report struct - so only - // extract positions from downlinks. - la_proto_node *adscNode = la_proto_tree_find_adsc(node); - if (adscNode && !message->m_uplink) - { - la_adsc_msg_t *adsc = (la_adsc_msg_t *)adscNode->data; - if (adsc && !adsc->err) - { - la_list *l = adsc->tag_list; - la_adsc_basic_report_t *rpt = NULL; - while(l != NULL) - { - la_adsc_tag_t *tag_struct = (la_adsc_tag_t *)l->data; - uint8_t t = tag_struct->tag; - // Look for a Basic Report - if(t == 7 || t == 9 || t == 10 || t == 18 || t == 19 || t == 20) - { - rpt = (la_adsc_basic_report_t *)tag_struct->data; - e.m_hasPosition = true; - e.m_hasAltitude = true; - e.m_latitude = rpt->lat; - e.m_longitude = rpt->lon; - e.m_altitudeFt = rpt->alt; - // Position for the Aircraft feature - report.m_positionValid = true; - report.m_latitude = rpt->lat; - report.m_longitude = rpt->lon; - report.m_altitudeValid = true; - report.m_altitudeFt = rpt->alt; - report.m_documentKind = AircraftReport::PositionReport; - break; - } - l = la_list_next(l); - } - } - } - - // Look for position in ADS Position report / CPDLC data - la_proto_node *cpdlcNode = la_proto_tree_find_cpdlc(node); - if (cpdlcNode) - { - la_cpdlc_msg *cpdlc = (la_cpdlc_msg *)cpdlcNode->data; - if (cpdlc && !cpdlc->err) - { - if (!strcmp(cpdlc->asn_type->name, "FANSATCDownlinkMessage")) - { - FANSATCDownlinkMessage_t *dm = (FANSATCDownlinkMessage_t *)cpdlc->data; - if (dm) - { - bool positionValid = false; - double latitude, longitude; - int altitudeFt; - if(dm->aTCDownlinkmsgelementid.present == FANSATCDownlinkMsgElementId_PR_dM48PositionReport) - { - positionValid = cpdlcExtractPosition(dm->aTCDownlinkmsgelementid.choice.dM48PositionReport, latitude, longitude, altitudeFt); - } - else - { - FANSATCDownlinkMsgElementIdSequence_t *dmeid_seq = dm->aTCdownlinkmsgelementid_seqOf; - if(dmeid_seq != NULL) - { - for(int i = 0; i < dmeid_seq->list.count; i++) - { - FANSATCDownlinkMsgElementId_t *dmeid_ptr = (FANSATCDownlinkMsgElementId_t *)dmeid_seq->list.array[i]; - if (dmeid_ptr != NULL && dmeid_ptr->present == FANSATCDownlinkMsgElementId_PR_dM48PositionReport) - { - positionValid = cpdlcExtractPosition(dmeid_ptr->choice.dM48PositionReport, latitude, longitude, altitudeFt); - break; - } - } - } - } - if (positionValid) - { - e.m_hasPosition = true; - e.m_hasAltitude = true; - e.m_latitude = latitude; - e.m_longitude = longitude; - e.m_altitudeFt = altitudeFt; - // Position for the Aircraft feature - report.m_positionValid = true; - report.m_latitude = latitude; - report.m_longitude = longitude; - report.m_altitudeValid = true; - report.m_altitudeFt = altitudeFt; - report.m_documentKind = AircraftReport::Cpdlc; - } - } - } - } - } - - la_proto_tree_destroy(node); - } - else - { - e.m_textDecode = "Failed to la_acars_parse_and_reassemble"; - } - - // Weather. An ATIS report has already been parsed and knows its own airport; every - // other form is recognised from the text. - { - QString wxAirport, wxBody; - if (AcarsATISReport *atis = dynamic_cast(message)) - { - report.m_weatherKind = AircraftReport::Atis; - report.m_weatherAirport = atis->m_airport; - report.m_weatherText = atis->m_atisInformation.isEmpty() - ? message->m_text : atis->m_atisInformation; - } - else - { - const int kind = classifyWeather(message->m_label, message->m_text, - wxAirport, wxBody); - if (kind != AircraftReport::WeatherNone) - { - report.m_weatherKind = kind; - report.m_weatherAirport = wxAirport; - report.m_weatherText = wxBody; - } - } - } - - // Route facts for the Aircraft feature: departure/arrival airports and - // flight plan or oceanic clearance routes, from whichever decoder saw them - { - QString dep, arr, route; - if (AcarsFlightStatus *fs = dynamic_cast(message)) - { - dep = fs->m_departureAirport; - arr = fs->m_arrivalAirport; - } - else if (AcarsEventReport *ev = dynamic_cast(message)) - { - dep = ev->m_departureAirport; - arr = ev->m_arrivalAirport; - report.m_documentKind = AircraftReport::OooiEvent; - - // Labels 13 to 16 are the four events proper; 17 and 18 are follow-up - // reports of the same ones and carry no new time - if ((ev->m_event >= AircraftReport::OooiOut) - && (ev->m_event <= AircraftReport::OooiIn)) - { - report.m_oooiEvent = ev->m_event; - report.m_oooiTime = oooiDateTime(report.m_received, ev->m_day, ev->m_eventTime); - } - } - else if (AcarsPositionReport *pr = dynamic_cast(message)) - { - dep = pr->m_departureAirport; - arr = pr->m_arrivalAirport; - } - else if (AcarsOpsReport *ops = dynamic_cast(message)) - { - dep = ops->m_departureAirport; - arr = ops->m_arrivalAirport; - } - else if (AcarsMessageFromSubsystem *sub = dynamic_cast(message)) - { - dep = sub->m_fpnDeparture; - arr = sub->m_fpnArrival; - route = sub->m_fpnRoute; - for (const auto& waypoint : sub->m_fpnWaypoints) - { - AircraftReport::RouteWaypoint point; - point.m_name = waypoint.m_name; - point.m_positionValid = waypoint.m_hasPosition; - point.m_latitude = waypoint.m_latitude; - point.m_longitude = waypoint.m_longitude; - report.m_routeWaypoints.append(point); - } - if (!route.isEmpty()) - { - report.m_documentKind = AircraftReport::FlightPlan; - report.m_documentTitle = "Flight plan"; - } - } - else if (AcarsOceanicClearanceReadback *ocr = dynamic_cast(message)) - { - arr = ocr->m_destination; - route = QStringList({ocr->m_entryPoint, ocr->m_route}).join(" ").trimmed(); - report.m_documentKind = AircraftReport::Clearance; - report.m_documentTitle = "Oceanic clearance readback"; - } - else if (AcarsOceanicClearanceResponse *oc = dynamic_cast(message)) - { - arr = oc->m_destination; - route = QStringList({oc->m_entryPoint, oc->m_route}).join(" ").trimmed(); - report.m_documentKind = AircraftReport::Clearance; - report.m_documentTitle = "Oceanic clearance"; - } - report.m_departure = dep; - report.m_arrival = arr; - report.m_route = route; - } - - // Aircraft position from any decoded message that carries one (flight - // status, position reports, OOOI events, FMS reports) - float posLatitude, posLongitude; - int posAltitudeFt; - if (message->getPosition(posLatitude, posLongitude, posAltitudeFt)) - { - e.m_hasPosition = true; - e.m_latitude = posLatitude; - e.m_longitude = posLongitude; - if (posAltitudeFt >= 0) - { - e.m_hasAltitude = true; - e.m_altitudeFt = posAltitudeFt; - } - // Position for the Aircraft feature - report.m_positionValid = true; - report.m_latitude = posLatitude; - report.m_longitude = posLongitude; - if (posAltitudeFt >= 0) - { - report.m_altitudeValid = true; - report.m_altitudeFt = posAltitudeFt; - } - } - - // The clearance route reaches the Map through the Aircraft feature, which draws - // flight plans and clearances alike - see AircraftTracker::sendRouteToMap(). The - // route itself went out above as report.m_route, and the destination as m_arrival. - - e.m_text = message->m_text; - e.m_hex = QString(messageBytes.toHex()); - - // Report the sighting to the Aircraft feature: the expanded ATC text when - // set above, otherwise the full multi-line decode, otherwise the raw text - if (report.m_documentText.isEmpty()) { - report.m_documentText = e.m_fullDecode; - } - if (report.m_documentText.isEmpty()) { - report.m_documentText = message->m_text; - } - if (!report.m_registration.isEmpty() || !report.m_flight.isEmpty()) { - sendAircraftReport(report); - } - - // Precompute the decode-view HTML for non-multipart rows, mirroring the - // view's old fallback chain - if (!e.m_fullDecode.isEmpty() && hasGui()) - { - e.m_viewDecodeHtml = acarsDecodeToHtml(e.m_fullDecode); - } - else if (!e.m_textDecode.isEmpty() && !e.m_useLibacars) - { - QString html = message->toString(); - html.replace("\r", "
"); - e.m_viewDecodeHtml = html; - } - else if (e.m_textDecode.isEmpty()) - { - e.m_viewDecodeHtml = message->m_text; - } - else - { - e.m_viewDecodeHtml = e.m_textDecode; - } - - // Multipart rows share their assembly id; the assembly state event lets the - // decode view show the evolving combined message for every part's row - if (multipart.m_assembly) - { - e.m_assemblyId = multipart.m_assembly->m_id; - e.m_partNumber = multipart.m_partNumber; - } - - emit rowReady(e); - - if (multipart.m_assembly) { - emitAssemblyState(multipart.m_assembly); - } -} - -// Feed a received ACARS message to the enabled aggregators, as one acarsdec-style -// JSON object per UDP datagram - the format both airframes.io (port 5550) and -// avdelphi.com (vdlm2dec JSON, port 5556) ingest. Messages from all three modes -// pass through here, since VDL-2 and HFDL ACARS arrive on the same path. -void AcarsDemodWorker::feedMessage(const AcarsMessage& message) -{ - if (!m_settings.m_feedEnabled) { - return; - } - - QJsonObject json; - json.insert("timestamp", message.m_dateTime.toMSecsSinceEpoch() / 1000.0); - if (!m_settings.m_feedStationId.isEmpty()) { - json.insert("station_id", m_settings.m_feedStationId); - } - json.insert("channel", 0); - json.insert("freq", (m_centerFrequency + m_settings.m_inputFrequencyOffset) / 1e6); - json.insert("level", CalcDb::dbPower(m_acarsDemod->getMagSq())); - json.insert("error", 0); - json.insert("mode", message.m_mode); - json.insert("label", message.m_label); - json.insert("block_id", QString(message.m_blockId)); - if ((message.m_ack == QChar(ASCII_NAK)) || message.m_ack.isNull()) { - json.insert("ack", false); - } else { - json.insert("ack", QString(message.m_ack)); - } - json.insert("tail", message.m_address); - if (!message.m_flight.isEmpty()) { - json.insert("flight", message.m_flight); - } - QString msgNo = message.m_originator + message.m_messageNumber + message.m_blockSequence; - if (!msgNo.isEmpty()) { - json.insert("msgno", msgNo); - } - json.insert("text", message.m_text); - json.insert("end", !message.m_multiBlock); - // Identify the client, as the standalone decoders do - aggregators use this to - // recognise the source - QJsonObject app; - app.insert("name", "SDRangel"); - app.insert("ver", QCoreApplication::applicationVersion()); - json.insert("app", app); - - QByteArray datagram = QJsonDocument(json).toJson(QJsonDocument::Compact); - datagram.append('\n'); - - // UDP: host names are resolved once and cached; the cache invalidates when the - // setting changes, so a blocking DNS lookup happens at most once per host - auto sendUdp = [this, &datagram](const QString& host, int port, QHostAddress& cache, QString& cachedHost) - { - if (host.isEmpty()) { - return; - } - if (host != cachedHost) - { - cachedHost = host; - cache = QHostAddress(host); - if (cache.isNull()) - { - QHostInfo info = QHostInfo::fromName(host); - cache = info.addresses().isEmpty() ? QHostAddress() : info.addresses().first(); - if (cache.isNull()) { - qWarning() << "AcarsDemodWorker: feed cannot resolve host" << host; - } else { - qDebug() << "AcarsDemodWorker: feed sending UDP to" << host - << "(" << cache.toString() << ") :" << port; - } - } - } - if (!cache.isNull()) { - m_feedSocket->writeDatagram(datagram, cache, port); - } - }; - - // TCP, as the airframes.io station wizard assigns: a newline-delimited JSON - // stream, exactly what vdlm2dec/acarsdec write in their -j network modes. The - // connection is made on demand and re-made after a drop or a settings change; - // a message arriving while unconnected starts the connect and is itself - // dropped, which matches how the standalone feeder clients behave. - auto sendTcp = [&datagram](QTcpSocket& socket, const QString& host, int port, const QString& service) - { - if (host.isEmpty()) { - return; - } - bool wrongPeer = (socket.peerName() != host) || (socket.peerPort() != port); - if ((socket.state() == QAbstractSocket::ConnectedState) && !wrongPeer) - { - qint64 written = socket.write(datagram); - qDebug() << "AcarsDemodWorker: feed sent" << written << "bytes to" << service; - } - else if ((socket.state() == QAbstractSocket::UnconnectedState) || wrongPeer) - { - qDebug() << "AcarsDemodWorker: feed not connected to" << service - << "- reconnecting, message dropped"; - socket.abort(); - socket.connectToHost(host, port); - } - else - { - qDebug() << "AcarsDemodWorker: feed still connecting to" << service - << "(state" << socket.state() << ") - message dropped"; - } - }; - - if (m_settings.m_feedAirframes) - { - if (m_settings.m_feedAirframesTcp) { - sendTcp(*m_feedAirframesTcpSocket, m_settings.m_feedAirframesHost, - m_settings.m_feedAirframesPort, "airframes.io"); - } else { - sendUdp(m_settings.m_feedAirframesHost, m_settings.m_feedAirframesPort, - m_feedAirframesAddr, m_feedAirframesResolvedHost); - } - } - if (m_settings.m_feedAvdelphi) - { - if (m_settings.m_feedAvdelphiTcp) { - sendTcp(*m_feedAvdelphiTcpSocket, m_settings.m_feedAvdelphiHost, - m_settings.m_feedAvdelphiPort, "avdelphi.com"); - } else { - sendUdp(m_settings.m_feedAvdelphiHost, m_settings.m_feedAvdelphiPort, - m_feedAvdelphiAddr, m_feedAvdelphiResolvedHost); - } - } -} - -// Open (or close) the aggregator connections to match the settings. Connections are -// also re-made on demand when a message needs sending, but connecting eagerly here -// means enabling the feed gives immediate feedback in the log rather than silently -// waiting for the first ACARS message. -void AcarsDemodWorker::updateFeedConnections() -{ - auto update = [this](QTcpSocket& socket, bool enabled, bool tcp, const QString& host, int port) - { - bool want = m_settings.m_feedEnabled && enabled && tcp && !host.isEmpty(); - bool wrongPeer = (socket.peerName() != host) || (socket.peerPort() != port); - if (want) - { - if ((socket.state() == QAbstractSocket::UnconnectedState) || wrongPeer) - { - qDebug() << "AcarsDemodWorker: feed connecting to" << host << ":" << port; - socket.abort(); - socket.connectToHost(host, port); - } - } - else if (socket.state() != QAbstractSocket::UnconnectedState) - { - socket.abort(); - } - }; - update(*m_feedAirframesTcpSocket, m_settings.m_feedAirframes, m_settings.m_feedAirframesTcp, - m_settings.m_feedAirframesHost, m_settings.m_feedAirframesPort); - update(*m_feedAvdelphiTcpSocket, m_settings.m_feedAvdelphi, m_settings.m_feedAvdelphiTcp, - m_settings.m_feedAvdelphiHost, m_settings.m_feedAvdelphiPort); -} - -// Send one sighting of an aircraft to any Aircraft features listening on the -// "aircraftreport" pipe. The caller fills in the identity, position and decoded -// content; the source description is filled in here from the channel's tuning. -void AcarsDemodWorker::sendAircraftReport(AircraftReport& report) -{ - QList pipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_acarsDemod, "aircraftreport", pipes); - - if (pipes.size() == 0) { - return; - } - - report.m_protocol = AcarsDemodSettings::protocolForMode(m_settings.m_mode); - report.m_frequency = m_centerFrequency + m_settings.m_inputFrequencyOffset; - report.m_deviceSetIndex = m_acarsDemod->getDeviceSetIndex(); - report.m_channelIndex = m_acarsDemod->getIndexInDeviceSet(); - - for (const auto& pipe : pipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - messageQueue->push(MainCore::MsgAircraftReport::create(m_acarsDemod, report)); - } -} - -// Ground stations (HFDL squitters, VDL-2 GSIFs) go straight to the Map as fixed -// antennas; aircraft go via the Aircraft feature -void AcarsDemodWorker::sendGroundStationToMap(const QString& name, float latitude, float longitude, const QString& text, QDateTime dateTime) -{ - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_acarsDemod, "mapitems", mapPipes); - - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(name)); - swgMapItem->setLatitude(latitude); - swgMapItem->setLongitude(longitude); - swgMapItem->setAltitude(0.0f); - swgMapItem->setPositionDateTime(new QString(dateTime.toString(Qt::ISODateWithMs))); - swgMapItem->setFixedPosition(true); - // The Map feature's antenna icon, as used for its own beacons - swgMapItem->setImage(new QString(QString("qrc:///map/map/antenna.png"))); - swgMapItem->setText(new QString(text)); - swgMapItem->setLabel(new QString(name)); - swgMapItem->setOrientation(0); - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_acarsDemod, swgMapItem); - messageQueue->push(msg); - } -} - -QHash AcarsDemodWorker::m_labels = { - {":;", "Data transceiver auto-tune"}, - {"_j", "Reserved"}, - {":}", "OA to AOA autotune"}, - {"_\x7f", "General response (Demand mode)"}, - {"00", "Hijack situation report"}, - // 10 to 4~ are user defined so will vary with airline - added in constructor - {"51", "Ground GMT request"}, - {"52", "Ground UTC request"}, - {"54", "Voice contact request"}, - {"57", "Alternate aircrew initiated position report"}, - {"5D", "ATIS request"}, - {"5P", "Temporary suspension"}, - {"5R", "Aircrew initiated position report"}, - {"5U", "Weather request"}, - {"5V", "VDL switch advisory"}, - {"5Y", "Aircrew revision to previous ETA / diversion"}, - {"5Z", "Airline designated downlink"}, - {"7A", "Aircrew initiated engine data / take off thrust report"}, - {"7B", "Aircrew entered miscellaneous message"}, - {"80", "Aircrew-addressed downlinks"}, - {"81", "Aircrew-addressed downlinks"}, - {"82", "Aircrew-addressed downlinks"}, - {"83", "Aircrew-addressed downlinks"}, - {"84", "Aircrew-addressed downlinks"}, - {"85", "Aircrew-addressed downlinks"}, - {"86", "Aircrew-addressed downlinks"}, - {"87", "Aircrew-addressed downlinks"}, - {"88", "Aircrew-addressed downlinks"}, - {"89", "Aircrew-addressed downlinks"}, - {"8A", "Aircrew-addressed downlinks"}, - {"8B", "Aircrew-addressed downlinks"}, - {"8C", "Aircrew-addressed downlinks"}, - {"8D", "Aircrew-addressed downlinks"}, - {"8E", "Aircrew-addressed downlinks"}, - {"8F", "Aircrew-addressed downlinks"}, - {"99", "Emergency message"}, - {"A1", "Oceanic clearance"}, - {"A2", "Unassigned"}, - {"A3", "Departure clearance"}, - {"A4", "Flight systems message"}, - {"A5", "Unassigned"}, - {"A6", "Request ADS reports"}, - {"A7", "Free text from ATC"}, - {"A8", "Deliver departure slot"}, - {"A9", "ATIS report"}, - {"A0", "ATS facilities notification"}, - {"AA", "ATC communications"}, - {"AB", "Terminal weather information"}, - {"AC", "Pushback clearance"}, - {"AD", "Expected taxi clearance"}, - {"AE", "Unassigned"}, - {"AF", "CPC command response"}, - {"AF", "Unassigned"}, - // B0-BZ ATS (Air Traffic Service) Messages - see ARINC 623 - {"B1", "Request Oceanic clearance"}, - {"B2", "Oceanic clearance readback"}, - {"B3", "Request departure clearance"}, - {"B4", "Departure clearance readback"}, - {"B5", "Waypoint position report"}, - {"B6", "Provide ADS report"}, - {"B7", "Free text to ATC"}, - {"B8", "Request departure slot"}, - {"B9", "Request ATIS report"}, - {"B0", "ATS facilities notification"}, - {"BA", "ATC communications"}, - {"BB", "Terminal weather information for pilots"}, - {"BC", "Pushback clearance request"}, - {"BD", "Expected taxi clearance request"}, - {"BE", "CPC aircraft log-on/log-off request"}, - {"BF", "CPC WILCO/UNABLE response"}, - {"BG", "Unassigned"}, - {"C0", "Uplink to all cockpit printers"}, - {"C1", "Uplink to cockpit printer No.1"}, - {"C2", "Uplink to cockpit printer No.2"}, - {"C3", "Uplink to cockpit printer No.3"}, - {"CA", "Printer Status = Error"}, - {"CB", "Printer Status = Busy"}, - {"CC", "Printer Status = Local test mode"}, - {"CD", "Printer Status = Out of paper"}, - {"CE", "Printer Status = Buffer overrun"}, - {"CF", "Printer Status = Reserved"}, - {"DI", "De-icing"}, - {"DL", "Data loading"}, - {"E1", "Internet email message"}, - {"E2", "Internet email message / DSP service"}, - {"EL", "Left Engine monitoring unit messages"}, - {"ER", "Right engine monitoring unit messages"}, - {"F3", "Dedicated transceiver advisory"}, - {"H1", "Message to/from terminal"}, // avionic or airborne subsystem - See table C-2A for sub-label - {"H2", "Meteorological report"}, - {"H3", "Icing report"}, - {"H4", "Meteorological configuration report"}, - {"HF", "HFDL messages"}, // Not in ARINC 620 - {"HX", "Undelivered uplink report"}, - {"KB", "Loopback response"}, - {"LB", "Cabin e-logbook"}, - {"LC", "Cabin e-logbook"}, - {"LS", "Techincal (cockpit) e-logbook"}, - {"LT", "Technical (cockpit) e-logbook"}, - {"M1", "IATA departure message"}, // Not in ARINC 620 - {"M2", "IATA arrival message"}, // Not in ARINC 620 - {"M3", "IATA return to ramp message"}, // Not in ARINC 620 - {"M4", "IATA return from airborne message"}, // Not in ARINC 620 - // P0-P6 and PA-PC are protected using ACARS Message Security - {"Q0", "Link test"}, - {"Q1", "Departure / Arrival report"}, - {"Q2", "ETA report"}, - {"Q3", "Clock update advisory"}, - {"Q4", "Voice circuit busy"}, - {"Q5", "Unable to deliver uplink messages"}, - {"Q6", "Voice to data channel changeover advisory"}, - {"Q7", "Delay message"}, - {"QA", "Out / Fuel report"}, - {"QB", "Off report"}, - {"QC", "On report"}, - {"QD", "In / Fuel report"}, - {"QE", "Out / Fuel destination report"}, - {"QF", "Off / Fuel destination report"}, - {"QG", "Out / Return in report"}, - {"QH", "Out report"}, - {"QK", "Landing report"}, - {"QL", "Arrival report"}, - {"QM", "Arrival information report"}, - {"QN", "Diversion report"}, - {"QP", "Out report"}, - {"QQ", "Off report"}, - {"QR", "On report"}, - {"QS", "In report"}, - {"QT", "Out/return in report"}, - {"QV", "Autotune reject"}, - {"QX", "Intercept/unable to process"}, - {"RA", "Command / response uplink"}, - {"RB", "Command / response downlink"}, - {"RE", "Refuel - Administrative and general purpose"}, - {"RF", "Refuel - CG targeting"}, - {"S1", "VHF network statistics report"}, - {"S2", "VHF network performance report"}, - {"S3", "LRU configuration report"}, - {"SA", "Media advisory"}, - {"SQ", "Squitter"}, - {"TE", "Turbulence event report"}, - {"UP", "Message acknowledgement"}, // Not in ARINC 620 - // VA-VZ are supplier defined messages - {"WP", "Potable water remote pre-selection downlinks"}, - // X1-X9 are DSP (Datalink Service Provider) defined - {"X1", "DSP defined"}, - {"X2", "DSP defined"}, - {"X3", "DSP defined"}, - {"X4", "DSP defined"}, - {"X5", "DSP defined"}, - {"X6", "DSP defined"}, - {"X7", "DSP defined"}, - {"X8", "DSP defined"}, - {"X9", "DSP defined"} -}; - -QHash AcarsDemodWorker::m_subLabels = { - // 10 to 4~ are user defined so will vary with airline - added in constructor - {"A1", "ADS Unit (ADSU), left"}, // ARINC 622 - {"A2", "ADS Unit (ADSU), right"}, // ARINC 622 - {"AD", "ADS Unit (ADSU), selected"}, // ARINC 622 - {"CF", "Central fault display"}, - {"DF", "Digital flight data acquisition unit"}, - {"EC", "Engine display system"}, - {"EI", "Engine indicating system"}, - {"F1", "Electronic flight bag #1"}, - {"F1", "Electronic flight bag #2"}, - {"H1", "HF data radio, left"}, - {"H2", "HF data radio, right"}, - {"HD", "HF data radio, selected"}, - {"M1", "Flight management computer (FMC), left"}, - {"M2", "Flight management computer (FMC), right"}, - {"M3", "Flight management computer (FMC), center"}, - {"MD", "Flight management computer (FMC), selected"}, - {"OA", "Onboard airport navigation system"}, - {"PS", "Keyboard/Display unit"}, - {"S1", "Satellite data unit (SDU), left"}, - {"S2", "Satellite data unit (SDU), right"}, - {"SD", "Satellite data unit (SDU), selected"}, - {"T0", "All cabin terminals"}, - {"T1", "Cabin terminal 1"}, - {"T2", "Cabin terminal 2"}, - {"T3", "Cabin terminal 3"}, - {"T4", "Cabin terminal 4"}, - {"T5", "Cabin terminal"}, - {"T6", "Cabin terminal"}, - {"T7", "Cabin terminal"}, - {"T8", "Cabin terminal"}, - {"TA", "TCAS/Traffic computer"}, - {"WO", "Weather observation report"}, -}; - -QHash AcarsDemodWorker::m_originators = { - {"1", "Cabin terminal 1"}, - {"2", "Cabin terminal 2"}, - {"3", "Cabin terminal 3"}, - {"4", "Cabin terminal 4"}, - {"5", "User terminal"}, - {"6", "User terminal"}, - {"7", "User terminal"}, - {"8", "User terminal"}, - {"A", "TCAS"}, - {"C", "CFDIU"}, - {"D", "DFDAU"}, - {"E", "EICAS/ECAM/EFIS"}, - {"F", "FMC"}, - {"J", "ATSU/ADSU"}, - {"L", "CMU (ATS)"}, - {"M", "CMD (AOC)"}, - {"O", "OAT"}, - {"Q", "SDU"}, - {"S", "System control"}, - {"T", "HF data radio"}, - {"U", "User defined"}, - {"Y", "EFB, left"}, - {"Z", "EFB, right"} -}; - -// The vendored ground station list is Windows-1252, not UTF-8. A degree sign there is -// the single byte 0xB0, which is not valid UTF-8, so reading it as UTF-8 turned every -// one in to a replacement character - and coordRe below looks for U+00B0, so it never -// matched and NO ground station ever got a position out of the file. Upstream could -// change, so take UTF-8 when the bytes really are UTF-8 and fall back when they are not. -static QString decodeVdl2Gs(const QByteArray& raw) -{ - const QString utf8 = QString::fromUtf8(raw); - if (!utf8.contains(QChar::ReplacementCharacter)) { - return utf8; - } - - // Windows-1252 is Latin-1 except for 0x80-0x9F, where Latin-1 has C1 control codes. - // Qt 6 dropped QTextCodec, so that range is mapped by hand. The list uses 0x96, an - // en dash, as well as 0xB0. - static const ushort cp1252[32] = { - 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, - 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, - 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178 - }; - QString text = QString::fromLatin1(raw); - for (int i = 0; i < text.size(); i++) - { - const ushort u = text.at(i).unicode(); - if ((u >= 0x80) && (u <= 0x9F)) { - text[i] = QChar(cp1252[u - 0x80]); - } - } - return text; -} - -// The community VDL-2 ground station list (vendored from -// https://sdrangel.org/downloads/VDL2_Ground_Stations.txt), mapping 24-bit -// addresses to names, cities and (where listed) coordinates -void AcarsDemodWorker::loadVdl2Gs() -{ - QFile file(":/vdl2gs.txt"); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) - { - qDebug() << "AcarsDemodWorker::loadVdl2Gs: Failed to open vdl2gs.txt"; - return; - } - QRegularExpression lineRe(R"(^([0-9A-Fa-f]{6}) \[([^\]]*)\] \[([^\]]*)\])"); - QRegularExpression coordRe(QString::fromUtf8(R"((\d+)\x{00b0}(\d+)'([NS]) (\d+)\x{00b0}(\d+)'([EW]))")); - const QStringList lines = decodeVdl2Gs(file.readAll()).split('\n'); - for (const QString& line : lines) - { - QRegularExpressionMatch match = lineRe.match(line); - if (!match.hasMatch()) { - continue; - } - Vdl2GsInfo gs; - QString name = match.captured(2); - gs.m_city = match.captured(3); - QRegularExpressionMatch coord = coordRe.match(name); - if (coord.hasMatch()) - { - gs.m_hasPosition = true; - gs.m_latitude = (coord.captured(1).toFloat() + coord.captured(2).toFloat() / 60.0f) - * (coord.captured(3) == "S" ? -1.0f : 1.0f); - gs.m_longitude = (coord.captured(4).toFloat() + coord.captured(5).toFloat() / 60.0f) - * (coord.captured(6) == "W" ? -1.0f : 1.0f); - name = name.left(coord.capturedStart()).trimmed(); - } - // Strip a trailing frequency from the name (e.g. "KJFK Kennedy Intl 136.100") - name.remove(QRegularExpression(R"(\s+\d{3}\.\d{3}\s*$)")); - gs.m_name = name.trimmed(); - m_vdl2Gs.insert(match.captured(1).toUInt(nullptr, 16), gs); - } - qDebug() << "AcarsDemodWorker::loadVdl2Gs: loaded" << m_vdl2Gs.size() << "ground stations"; -} - -// Decode a VDL-2 AVLC frame that is not an ACARS message (ACARS messages arrive -// via processAcarsMessage like VHF ACARS): the frame summary, the ATN subnetwork -// for information frames and the XID/GSIF link management parameters -void AcarsDemodWorker::processVdl2Frame(const AcarsVdl2Receiver::Frame& frame, QDateTime received) -{ - AcarsRowEvent e; - e.m_frameType = 1; - e.m_received = received; - e.m_uplink = !frame.m_fromAircraft; - - // Record the transmitting aircraft as active for the GUI's chart - if (frame.m_fromAircraft) { - e.m_chartAircraftId = QString("%1").arg(frame.m_srcAddress, 6, 16, QChar('0')).toUpper(); - } - - QString type(frame.m_frameType); - - // Supervisory and link management responses flood the table during data - // transfers; the GUI hides them by default - static const QStringList noInfoTypes = {"RR", "RNR", "REJ", "SREJ", "DM", "DISC", "UA", "FRMR", "U"}; - e.m_noInfo = noInfoTypes.contains(type); - - // The aircraft side of the link in the Registration column: the registration looked - // up from the 24-bit ICAO address via the OpenSky database, or the address itself in - // hex when it is not in the database - auto addressText = [this](uint32_t address, int type) - { - QString hex = QString("%1").arg(address, 6, 16, QChar('0')).toUpper(); - switch (type) - { - case 1: // Aircraft - if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) address)) - { - QString registration = m_aircraftInfoByIcao->value((int) address)->m_registration; - if (!registration.isEmpty()) { - return registration; - } - } - return hex; - case 4: - case 5: // Ground station: name from the community list - if (m_vdl2Gs.contains(address)) { - return QString("GS %1 (%2)").arg(hex).arg(m_vdl2Gs.value(address).m_name); - } - return QString("GS %1").arg(hex); - case 7: return QString("All"); - default: return hex; - } - }; - - // A known ground station's coordinates fill the position columns, arming the - // Map checkbox (which places it as a fixed antenna, like HFDL squitters) - { - uint32_t gsAddress = frame.m_fromAircraft ? frame.m_dstAddress : frame.m_srcAddress; - int gsType = frame.m_fromAircraft ? frame.m_dstType : frame.m_srcType; - if (((gsType == 4) || (gsType == 5)) && m_vdl2Gs.contains(gsAddress)) - { - const Vdl2GsInfo& gs = m_vdl2Gs.value(gsAddress); - if (gs.m_hasPosition) - { - e.m_hasPosition = true; - e.m_latitude = gs.m_latitude; - e.m_longitude = gs.m_longitude; - } - } - } - if (frame.m_fromAircraft) { - e.m_address = addressText(frame.m_srcAddress, frame.m_srcType); - } else { - e.m_address = addressText(frame.m_dstAddress, frame.m_dstType); - } - - e.m_protocol = "VDL-2"; - e.m_bitRate = 31500; - e.m_label = type; - e.m_labelDecode = avlcFrameTypeName(frame.m_frameType); - - QString text = QString("%1 %2 %3") - .arg(addressText(frame.m_srcAddress, frame.m_srcType)) - .arg(QChar(0x2192)) // Right arrow - .arg(addressText(frame.m_dstAddress, frame.m_dstType)); - - // One sighting for the Aircraft feature: the aircraft side of the link, - // identified by its 24-bit ICAO address - AircraftReport report; - report.m_received = received; - report.m_uplink = !frame.m_fromAircraft; - { - uint32_t acAddress = frame.m_fromAircraft ? frame.m_srcAddress : frame.m_dstAddress; - int acType = frame.m_fromAircraft ? frame.m_srcType : frame.m_dstType; - if (acType == 1) - { - report.m_icao = acAddress; - if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) acAddress)) { - report.m_registration = m_aircraftInfoByIcao->value((int) acAddress)->m_registration; - } - } - uint32_t gsAddress = frame.m_fromAircraft ? frame.m_dstAddress : frame.m_srcAddress; - int gsType = frame.m_fromAircraft ? frame.m_dstType : frame.m_srcType; - if ((gsType == 4) || (gsType == 5)) - { - // Short form: the airport code from the ground station list rather - // than the full name/location, falling back to the hex address - if (m_vdl2Gs.contains(gsAddress) && !m_vdl2Gs.value(gsAddress).m_name.isEmpty()) { - report.m_station = QString("GS %1").arg(m_vdl2Gs.value(gsAddress).m_name.section(' ', 0, 0)); - } else { - report.m_station = QString("GS %1").arg(QString("%1").arg(gsAddress, 6, 16, QChar('0')).toUpper()); - } - - // The Mode columns say which ground station the frame used, in the same form - // the Message column shows it. The community list names them "EGLC London - // City UK", of which the first word is the ICAO code. - e.m_mode = QString("%1").arg(gsAddress, 6, 16, QChar('0')).toUpper(); - const Vdl2GsInfo& gs = m_vdl2Gs.value(gsAddress); - e.m_modeDecode = gs.m_name.section(' ', 0, 0); - e.m_gsHasPosition = gs.m_hasPosition; - e.m_gsLatitude = gs.m_latitude; - e.m_gsLongitude = gs.m_longitude; - } - } - - // Information frames carry the ATN subnetwork: X.25, CLNP, COTP and the ICAO - // applications (CM logons, CPDLC, ADS-C v2). XID frames carry link management - // parameters, including the GSIF ground station broadcasts. - bool isInfoFrame = (type == "I") || (type == "UI"); - if ((isInfoFrame || (type == "XID")) && (frame.m_infoLength > 0)) - { - QByteArray info((const char *) frame.m_bytes.data() + frame.m_infoOffset, frame.m_infoLength); - Vdl2AtnDecoder::Result atn; - - if (isInfoFrame) - { - atn = m_atnDecoder.decode(info, frame.m_srcAddress, frame.m_dstAddress, frame.m_fromAircraft); - } - else - { - bool pf = (frame.m_bytes[8] >> 4) & 0x1; // Control field P/F bit - atn = m_atnDecoder.decodeXid(info, frame.m_srcStatus, pf); - } - - text.append(QString(" %1").arg(atn.m_summary)); - - if (!atn.m_decoded.isEmpty()) - { - e.m_textDecode = QString(atn.m_decoded).replace('\n', "; "); - e.m_fullDecode = atn.m_decoded; - e.m_viewDecodeHtml = acarsDecodeToHtml(atn.m_decoded); - } - // Left blank for CPDLC messages with no message data (e.g. an ACSE release - // wrapping an empty PDU) - if (atn.m_isCpdlc && !atn.m_atc.isEmpty()) { - e.m_atc = atn.m_atc; - } - if (atn.m_hasPosition) - { - // From an XID aircraft (or ground station) location parameter. The resolution - // is coarse: 0.1 degrees and 1000 ft. - e.m_hasPosition = true; - e.m_latitude = atn.m_latitude; - e.m_longitude = atn.m_longitude; - if (atn.m_hasAltitude) - { - e.m_hasAltitude = true; - e.m_altitudeFt = atn.m_altitudeFt; - } - // A downlinked location is the aircraft's own position - if (frame.m_fromAircraft) - { - report.m_positionValid = true; - report.m_latitude = atn.m_latitude; - report.m_longitude = atn.m_longitude; - if (atn.m_hasAltitude) - { - report.m_altitudeValid = true; - report.m_altitudeFt = atn.m_altitudeFt; - } - } - } - report.m_documentText = atn.m_decoded; - if (atn.m_isCpdlc) - { - report.m_documentKind = AircraftReport::Cpdlc; - report.m_atc = atn.m_atc; - } - else if (type == "XID") - { - report.m_documentKind = AircraftReport::Logon; - } - } - else if (frame.m_infoLength > 0) - { - text.append(QString(" (%1 bytes)").arg(frame.m_infoLength)); - } - e.m_text = text.trimmed(); - - QByteArray bytes((const char *) frame.m_bytes.data(), (int) frame.m_bytes.size()); - e.m_hex = bytes.toHex(); - - // Report identified aircraft to the Aircraft feature. ACARS-over-AVLC frames - // are reported from processAcarsMessage instead, with their decoded content. - if (report.m_icao) - { - report.m_label = type; - sendAircraftReport(report); - } - - emit rowReady(e); -} - -// Decode an HFDL LPDU or SPDU that is not an ACARS message: logons, squitters -// and the embedded HFNPDU performance/frequency reports -// One Aero signal unit that is not an ACARS message: log-on and log-off exchanges, -// channel control and assignment, acknowledgements and the system table broadcasts. -// ACARS blocks never come here - they are reassembled inside the receiver and pushed as -// MainCore::MsgPacket, so they take the same path as every other protocol's. -void AcarsDemodWorker::processAeroFrame(const AcarsAeroReceiver::Frame& frame, QDateTime received) -{ - AcarsRowEvent e; - e.m_frameType = 3; - e.m_received = received; - e.m_uplink = frame.m_uplink; - - AircraftReport report; - report.m_received = received; - report.m_uplink = frame.m_uplink; - - // The AES ID is the aircraft's ICAO 24 bit address, so the same registration lookup - // the HFDL and VDL-2 paths use applies directly. (Confirmed off air: AES 78016E - // resolves to B-HNF, which the ACARS block in the same recording also names.) - QString address; - if (frame.m_aesId) - { - QString hex = QString("%1").arg(frame.m_aesId, 6, 16, QChar('0')).toUpper(); - address = hex; - report.m_icao = frame.m_aesId; - if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) frame.m_aesId)) - { - QString registration = m_aircraftInfoByIcao->value((int) frame.m_aesId)->m_registration; - if (!registration.isEmpty()) - { - address = registration; - report.m_registration = registration; - } - } - // Only a downlink proves the aircraft transmitted; a ground station addressing - // an aircraft still counts as a sighting but not as an active transmitter for - // the GUI's aircraft-seen chart - if (!frame.m_uplink) { - e.m_chartAircraftId = hex; - } - } - e.m_address = address; - - static const char *channelNames[] = { "P", "R", "T" }; - const char *channel = ((frame.m_channel >= 0) && (frame.m_channel <= AcarsAeroReceiver::ChannelT)) - ? channelNames[frame.m_channel] : "?"; - e.m_protocol = QString("Aero %1").arg(channel); - e.m_bitRate = frame.m_bitRate; - // The signal unit type octet is the label; what it means is the decode - e.m_label = frame.m_bytes.empty() ? QString() - : QString("%1").arg(frame.m_bytes[0], 2, 16, QChar('0')).toUpper(); - e.m_labelDecode = QString::fromStdString(frame.m_type); - - // A signal unit with neither address is a broadcast - the system and EIRP tables - // describe the satellite and its beams rather than talking to any one aircraft. It - // used to render as "GES 00 -> AES", which is two placeholders and a zero pretending - // to be a conversation - // As hexadecimal, which is how the Message column has always shown it. The decode - // names the satellite and region rather than the station - see gesName(). - if (frame.m_gesId) - { - e.m_mode = QString("%1").arg(frame.m_gesId, 2, 16, QChar('0')).toUpper(); - const char *ges = AcarsAeroReceiver::gesName(frame.m_gesId); - e.m_modeDecode = ges ? QString(ges) : QString(); - } - - if (!frame.m_aesId && !frame.m_gesId) - { - e.m_text = "Broadcast"; - } - else - { - QString gesText = QString("GES %1").arg(frame.m_gesId, 2, 16, QChar('0')).toUpper(); - if (frame.m_uplink) { - e.m_text = QString("%1 %2 %3").arg(gesText).arg(QChar(0x2192)).arg(address.isEmpty() ? QString("AES") : address); - } else { - e.m_text = QString("%1 %2 %3").arg(address.isEmpty() ? QString("AES") : address).arg(QChar(0x2192)).arg(gesText); - } - } - - QStringList decode; - const std::vector& b = frame.m_bytes; - uint8_t type = b.empty() ? 0 : b[0]; - - // Satellite housekeeping, which the GUI hides by default. Classified here rather - // than from the "Broadcast" text above, because a broadcast is a consequence of - // carrying no address and not the same question as carrying no information - e.m_noInfo = AcarsAeroReceiver::suIsNoInfo(type); - - switch (type) - { - case AcarsAeroReceiver::SuCChannelDistress: - case AcarsAeroReceiver::SuCChannelFlightSafety: - case AcarsAeroReceiver::SuCChannelOtherSafety: - case AcarsAeroReceiver::SuCChannelNonSafety: - // A voice channel assignment names the pair of L band frequencies the call will - // use, as 15 bit channel numbers with bit 15 flagging a spot beam - if (b.size() >= 10) - { - int rxChannel = ((b[6] & 0x7F) << 8) | b[7]; - int txChannel = ((b[8] & 0x7F) << 8) | b[9]; - decode.append(QString("Receive %1 MHz (%2)") - .arg(AcarsAeroReceiver::cChannelReceiveMHz(rxChannel), 0, 'f', 4) - .arg((b[6] & 0x80) ? "spot beam" : "global beam")); - decode.append(QString("Transmit %1 MHz (%2)") - .arg(AcarsAeroReceiver::cChannelTransmitMHz(txChannel), 0, 'f', 4) - .arg((b[8] & 0x80) ? "spot beam" : "global beam")); - } - break; - - case AcarsAeroReceiver::SuLogOnRequest: - case AcarsAeroReceiver::SuLogOnConfirm: - case AcarsAeroReceiver::SuLogOffRequest: - case AcarsAeroReceiver::SuLogOnReject: - case AcarsAeroReceiver::SuLogOnInterrogation: - case AcarsAeroReceiver::SuLogOnOffAcknowledge: - case AcarsAeroReceiver::SuLogOnPrompt: - case AcarsAeroReceiver::SuDataChannelReassignment: - report.m_documentKind = AircraftReport::Logon; - break; - - default: - break; - } - - if (frame.m_gesId) { - report.m_station = QString("GES %1").arg(frame.m_gesId, 2, 16, QChar('0')).toUpper(); - } - - e.m_textDecode = decode.join("; "); - e.m_fullDecode = decode.join("\n"); - // m_fullDecode is functional - it becomes AircraftReport::m_documentText - but the - // HTML rendering of it is only ever read by the decode view - if (hasGui()) { - e.m_viewDecodeHtml = acarsDecodeToHtml(e.m_fullDecode); - } - - QByteArray bytes((const char *) b.data(), (int) b.size()); - e.m_hex = bytes.toHex(); - - // Report identified aircraft to the Aircraft feature. Signal units that name no - // aircraft - system tables, channel control - are shown in the table but are not - // sightings of anything. - if (report.m_icao || !report.m_registration.isEmpty()) - { - report.m_label = QString::fromStdString(frame.m_type); - report.m_documentText = e.m_fullDecode; - sendAircraftReport(report); - } - - emit rowReady(e); -} - -void AcarsDemodWorker::processHfdlFrame(const AcarsHfdlReceiver::Frame& frame, QDateTime received) -{ - AcarsRowEvent e; - e.m_frameType = 2; - e.m_received = received; - e.m_uplink = frame.m_uplink; - - // Logon LPDUs carry the aircraft's 24 bit ICAO address, which gives the - // registration via the OpenSky database and feeds the aircraft-seen chart - uint32_t icao = 0; - static const QList logonTypes = { 0x2F, 0x3F, 0x4F, 0x5F, 0x8F, 0x9F, 0xBF }; - if ((frame.m_bytes.size() >= 4) && logonTypes.contains(frame.m_bytes[0])) { - icao = AcarsHfdlReceiver::parseIcao(frame.m_bytes.data() + 1); - } - if (icao && !frame.m_uplink) { - e.m_chartAircraftId = QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); - } - - // The 8-bit HFDL aircraft ID is assigned by the ground station at logon; 255 - // means no ID assigned yet - the aircraft is logging on - auto acText = [](uint32_t id) - { - return id == 255 ? QString("Unidentified") : QString("AC %1").arg(id); - }; - - // One sighting for the Aircraft feature, filled in as the frame decodes. Only - // frames that identify the airframe (an ICAO address from a logon) or carry a - // flight identity are reported - the 8-bit "AC n" link IDs are not durable - // identities an aircraft can be collated under. - AircraftReport report; - report.m_received = received; - report.m_uplink = frame.m_uplink; - - // Registration from the ICAO address when a logon carries one, otherwise the - // 8-bit HFDL aircraft/ground station IDs from the MPDU header - QString address; - if (icao) - { - QString hex = QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); - address = hex; - report.m_icao = icao; - report.m_documentKind = AircraftReport::Logon; - if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) icao)) - { - QString registration = m_aircraftInfoByIcao->value((int) icao)->m_registration; - if (!registration.isEmpty()) - { - address = registration; - report.m_registration = registration; - } - } - } - else if (frame.m_type == "Squitter") - { - address = QString("GS %1").arg(frame.m_srcId); - } - else if (frame.m_uplink) - { - address = acText(frame.m_dstId); - } - else - { - address = acText(frame.m_srcId); - } - e.m_address = address; - - // Logon requests carry the flight identity as 6 characters at offset 6, space - // padded for shorter callsigns. The following byte belongs to a varying field - // that can happen to be printable (it showed up as bogus trailing characters, - // often lowercase), so only callsign characters are accepted and the first - // non-callsign byte ends the field. - if ((frame.m_bytes.size() >= 12) && icao) - { - QString flight; - for (int i = 6; i < 12; i++) - { - char ch = (char) frame.m_bytes[i]; - if (((ch >= 'A') && (ch <= 'Z')) || ((ch >= '0') && (ch <= '9')) || (ch == ' ')) { - flight.append(ch); - } else { - break; - } - } - e.m_flight = flight.trimmed(); - report.m_flight = flight.trimmed(); - } - - e.m_protocol = "HFDL"; - e.m_bitRate = frame.m_bitRate; - if (frame.m_isSquitter) - { - // A squitter is not an LPDU and has no type octet to put in the label - e.m_label = "Squitter"; - e.m_labelDecode = "Ground station frequency broadcast"; - } - else - { - e.m_label = QString("%1").arg(frame.m_typeId, 2, 16, QChar('0')).toUpper(); - e.m_labelDecode = QString::fromStdString(frame.m_type); - } - - // The ground station side of the link, decoded from the system table ID - uint32_t gsId = (frame.m_uplink || (frame.m_type == "Squitter")) ? frame.m_srcId : frame.m_dstId; - const char *gsStation = AcarsHfdlReceiver::gsName(gsId); - if (gsStation) { - report.m_station = QString(gsStation).section(',', 0, 0); - } else if (gsId) { - report.m_station = QString("GS %1").arg(gsId); - } - - // The station is what the Mode columns are for. gsName gives "Shannon, Ireland"; - // the town alone is what fits, and the country is in the Message column anyway. - if (gsId) - { - e.m_mode = QString::number(gsId); - e.m_modeDecode = gsStation ? QString(gsStation).section(',', 0, 0) : QString(); - - double gsLatitude, gsLongitude; - if (AcarsHfdlReceiver::gsPosition(gsId, gsLatitude, gsLongitude)) - { - e.m_gsHasPosition = true; - e.m_gsLatitude = (float) gsLatitude; - e.m_gsLongitude = (float) gsLongitude; - } - } - - QString text; - QString decode; - if (frame.m_type == "Squitter") - { - text = QString("Squitter from GS %1").arg(frame.m_srcId); - decode = QString("From %1").arg(gsStation ? gsStation : QString("GS %1").arg(gsId)); - - // The squitter's position is the transmitting ground station itself, from the - // system table: filling the position columns arms the Map checkbox, and the - // "GS" address makes it a fixed antenna icon rather than an aircraft - double gsLat, gsLon; - if (AcarsHfdlReceiver::gsPosition(frame.m_srcId, gsLat, gsLon)) - { - e.m_hasPosition = true; - e.m_latitude = gsLat; - e.m_longitude = gsLon; - } - - AcarsHfdlReceiver::SquitterInfo sq; - if (AcarsHfdlReceiver::parseSquitter(frame.m_bytes, sq)) - { - decode.append(QString("; frame %1.%2; systable v%3") - .arg(sq.m_frameIndex).arg(sq.m_frameOffset).arg(sq.m_systableVersion)); - const char *note = AcarsHfdlReceiver::squitterChangeNote(sq.m_changeNote); - if (note) { - decode.append(QString("; %1").arg(note)); - } - if (sq.m_rls) { - decode.append("; RLS"); - } - // The transmitting station's status plus up to two neighbours; the - // frequency sets are bitmasks into each station's system table - // frequency list, decoded here to kHz - for (const auto& gs : sq.m_gs) - { - if (gs.m_id == 0) { - continue; - } - QStringList freqs; - int freqCount = 0; - const uint16_t *freqList = AcarsHfdlReceiver::gsFrequencies(gs.m_id, &freqCount); - for (int bit = 0; bit < 20; bit++) - { - if ((gs.m_freqsInUse >> bit) & 1) - { - if (freqList && (bit < freqCount)) { - freqs.append(QString::number(freqList[bit])); - } else { - freqs.append(QString("bit%1").arg(bit)); - } - } - } - decode.append(QString("; GS %1%2 on %3") - .arg(gs.m_id) - .arg(gs.m_utcSync ? "" : " (no UTC)") - .arg(freqs.isEmpty() ? "no frequencies" : freqs.join(", ") + " kHz")); - } - // Each station's announced frequencies for the GUI's ground station - // table dialog - one squitter reports up to three stations - for (const auto& gs : sq.m_gs) - { - if (gs.m_id == 0) { - continue; - } - int freqCount = 0; - const uint16_t *freqList = AcarsHfdlReceiver::gsFrequencies(gs.m_id, &freqCount); - QList heard; - for (int bit = 0; (bit < 20) && freqList; bit++) - { - if (((gs.m_freqsInUse >> bit) & 1) && (bit < freqCount)) { - heard.append(freqList[bit]); - } - } - e.m_gsHeardIds.append((int) gs.m_id); - e.m_gsHeardFreqs.append(heard); - } - } - } - else if (frame.m_uplink) - { - text = QString("GS %1 %2 %3").arg(frame.m_srcId).arg(QChar(0x2192)).arg(acText(frame.m_dstId)); - decode = QString("From %1").arg(gsStation ? gsStation : QString("GS %1").arg(gsId)); - } - else - { - text = QString("%1 %2 GS %3").arg(acText(frame.m_srcId)).arg(QChar(0x2192)).arg(frame.m_dstId); - decode = QString("To %1").arg(gsStation ? gsStation : QString("GS %1").arg(gsId)); - } - - // Embedded HFNPDUs: performance data (FF D1) in unnumbered data LPDUs and - // frequency data (FF D5) inside logon requests and resumes. Both carry the - // flight identity and the aircraft's position, which fills the position - // columns and arms the Map checkbox. - if (frame.m_type != "Squitter") - { - // A ground station's frequency-list bitmask rendered as kHz, as for squitters - auto freqMaskText = [](uint32_t gsId, uint32_t mask) - { - QStringList freqs; - int freqCount = 0; - const uint16_t *freqList = AcarsHfdlReceiver::gsFrequencies(gsId, &freqCount); - for (int bit = 0; bit < 20; bit++) - { - if ((mask >> bit) & 1) - { - if (freqList && (bit < freqCount)) { - freqs.append(QString::number(freqList[bit])); - } else { - freqs.append(QString("bit%1").arg(bit)); - } - } - } - return freqs.isEmpty() ? QString("none") : freqs.join(", ") + " kHz"; - }; - auto positionText = [](double latitude, double longitude, int utcSeconds) - { - return QString("%1%2 %3%4 at %5z") - .arg(std::abs(latitude), 0, 'f', 4).arg(latitude < 0.0 ? "S" : "N") - .arg(std::abs(longitude), 0, 'f', 4).arg(longitude < 0.0 ? "W" : "E") - .arg(QTime(0, 0).addSecs(utcSeconds).toString("hh:mm:ss")); - }; - auto setFlightAndPosition = [&](const std::string& flightId, double latitude, double longitude, int utcSeconds) - { - QString flight = QString::fromStdString(flightId).trimmed(); - if (!flight.isEmpty() && e.m_flight.isEmpty()) { - e.m_flight = flight; - } - if (!flight.isEmpty() && report.m_flight.isEmpty()) { - report.m_flight = flight; - } - report.m_documentKind = AircraftReport::PerformanceReport; - // Aircraft without a position feed report the all-ones sentinel, which - // decodes as 180/180 - any latitude beyond 90 marks it unavailable - if (std::abs(latitude) > 90.0) { - return; - } - e.m_hasPosition = true; - e.m_latitude = latitude; - e.m_longitude = longitude; - - // Aircraft dump their STORED performance log too - one record per past - // ground station association, hours old (seen live: a burst carrying - // reports from three flight legs back). Only a report timestamped close - // to now is the aircraft's current position, so only that goes to the - // Map; stale reports still fill the row's position columns. "Now" is the - // wall clock OR the newest report time seen, so replayed recordings - // (whose reports are all hours old against the wall clock but mutually - // consistent) still reach the Map. - auto circAge = [](int a, int b) - { - int d = a - b; - while (d > 43200) { d -= 86400; } - while (d < -43200) { d += 86400; } - return d; - }; - int nowSeconds = received.toUTC().time().msecsSinceStartOfDay() / 1000; - bool fresh = std::abs(circAge(nowSeconds, utcSeconds)) <= 600; - if (!fresh && (m_hfdlNewestReportSecs >= 0)) { - // Not older than 10 minutes behind the newest report seen - fresh = circAge(utcSeconds, m_hfdlNewestReportSecs) >= -600; - } - if ((m_hfdlNewestReportSecs < 0) - || (circAge(utcSeconds, m_hfdlNewestReportSecs) > 0)) { - m_hfdlNewestReportSecs = utcSeconds; - } - if (!fresh) { - return; - } - - // A fresh position goes into the report for the Aircraft feature, - // stamped with the report's own UTC time of day mapped to the nearest - // day around reception - report.m_positionValid = true; - report.m_latitude = (float) latitude; - report.m_longitude = (float) longitude; - QDateTime dayStart = received.toUTC(); - dayStart.setTime(QTime(0, 0)); - QDateTime posTime = dayStart.addSecs(utcSeconds); - const qint64 halfDay = 12 * 3600; - if (posTime.secsTo(received.toUTC()) > halfDay) { - posTime = posTime.addDays(1); - } else if (received.toUTC().secsTo(posTime) > halfDay) { - posTime = posTime.addDays(-1); - } - report.m_positionDateTime = posTime; - }; - - AcarsHfdlReceiver::PerfDataInfo perf; - AcarsHfdlReceiver::FreqDataInfo freqData; - if (AcarsHfdlReceiver::parsePerfData(frame.m_bytes, perf)) - { - decode.append(QString("; Performance data: %1 %2; v%3 leg %4; GS %5 freq %6") - .arg(QString::fromStdString(perf.m_flightId).trimmed()) - .arg(positionText(perf.m_latitude, perf.m_longitude, perf.m_utcSeconds)) - .arg(perf.m_version).arg(perf.m_flightLeg) - .arg(perf.m_gsId).arg(perf.m_freqId)); - decode.append(QString("; freq searches %1/%2; HF off %3/%4 s (prev/cur)") - .arg(perf.m_prevFreqSearches).arg(perf.m_curFreqSearches) - .arg(perf.m_prevHfDisabledSecs).arg(perf.m_curHfDisabledSecs)); - decode.append(QString("; MPDUs rx %1/%2/%3/%4 errs %5/%6/%7/%8, tx %9/%10/%11/%12, delivered %13/%14/%15/%16 (1800/1200/600/300 bps)") - .arg(perf.m_mpdusRx[0]).arg(perf.m_mpdusRx[1]).arg(perf.m_mpdusRx[2]).arg(perf.m_mpdusRx[3]) - .arg(perf.m_mpdusRxErrs[0]).arg(perf.m_mpdusRxErrs[1]).arg(perf.m_mpdusRxErrs[2]).arg(perf.m_mpdusRxErrs[3]) - .arg(perf.m_mpdusTx[0]).arg(perf.m_mpdusTx[1]).arg(perf.m_mpdusTx[2]).arg(perf.m_mpdusTx[3]) - .arg(perf.m_mpdusDelivered[0]).arg(perf.m_mpdusDelivered[1]).arg(perf.m_mpdusDelivered[2]).arg(perf.m_mpdusDelivered[3])); - decode.append(QString("; SPDUs rx %1 errs %2; freq change %3") - .arg(perf.m_spdusRx).arg(perf.m_spdusRxErrs).arg(perf.m_freqChangeCode)); - setFlightAndPosition(perf.m_flightId, perf.m_latitude, perf.m_longitude, perf.m_utcSeconds); - } - else if (AcarsHfdlReceiver::parseFreqData(frame.m_bytes, freqData)) - { - decode.append(QString("; Frequency data: %1 %2") - .arg(QString::fromStdString(freqData.m_flightId).trimmed()) - .arg(positionText(freqData.m_latitude, freqData.m_longitude, freqData.m_utcSeconds))); - for (const auto& pf : freqData.m_gs) - { - if (pf.m_gsId == 0) { - continue; - } - const char *name = AcarsHfdlReceiver::gsName(pf.m_gsId); - decode.append(QString("; GS %1%2: propagating %3, tuned %4") - .arg(pf.m_gsId) - .arg(name ? QString(" (%1)").arg(QString(name).section(',', 0, 0)) : QString()) - .arg(freqMaskText(pf.m_gsId, pf.m_propagating)) - .arg(freqMaskText(pf.m_gsId, pf.m_tuned))); - } - setFlightAndPosition(freqData.m_flightId, freqData.m_latitude, freqData.m_longitude, freqData.m_utcSeconds); - } - } - - e.m_text = text; - e.m_textDecode = decode; - // The column keeps the single semicolon-separated line; the decode view and the - // Map popup get the multi-line form - e.m_fullDecode = QString(decode).replace("; ", "\n"); - e.m_viewDecodeHtml = acarsDecodeToHtml(e.m_fullDecode); - - QByteArray bytes((const char *) frame.m_bytes.data(), (int) frame.m_bytes.size()); - e.m_hex = bytes.toHex(); - - // Report identified aircraft to the Aircraft feature - if (report.m_icao || !report.m_registration.isEmpty() || !report.m_flight.isEmpty()) - { - report.m_label = QString::fromStdString(frame.m_type); - report.m_documentText = e.m_fullDecode; - sendAircraftReport(report); - } - - emit rowReady(e); -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "dsp/dspcommands.h" +#include "util/db.h" +#include "util/units.h" +#include "maincore.h" + + +#ifdef _MSC_VER +// For libacars/asn1/asn_system.h +#define ASSUMESTDTYPES +#define ssize_t SSIZE_T +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +// asn_system.h maps these C99 functions to pre-C99 MSVC CRT names; the macros +// break later standard headers (e.g. uses std::ilogb) +#undef isnan +#undef finite +#undef copysign +#undef ilogb +#endif + +#include "acarsdemod.h" +#include "acarsdemodworker.h" +#include "util/acarstextformat.h" + +// Airport information used by AcarsMessage decoders (file-scope in +// acarsmessage.cpp); initialised in startWork() + +MESSAGE_CLASS_DEFINITION(AcarsDemodWorker::MsgConfigureWorker, Message) +MESSAGE_CLASS_DEFINITION(AcarsDemodWorker::MsgReloadAircraftDatabase, Message) +MESSAGE_CLASS_DEFINITION(AcarsDemodWorker::MsgReplayPacket, Message) + +// Convert CPDCL altitude in to feet +static int cpdlcAltitude(FANSAltitude_t altitude) +{ + switch(altitude.present) + { + case FANSAltitude_PR_altitudeQNH: + return altitude.choice.altitudeQNH * 10; + case FANSAltitude_PR_altitudeQNHMeters: + return Units::metresToIntegerFeet(altitude.choice.altitudeQNHMeters); + case FANSAltitude_PR_altitudeQFE: + return altitude.choice.altitudeQFE * 10; + case FANSAltitude_PR_altitudeQFEMeters: + return Units::metresToIntegerFeet(altitude.choice.altitudeQFEMeters); + case FANSAltitude_PR_altitudeGNSSFeet: + return altitude.choice.altitudeGNSSFeet; + case FANSAltitude_PR_altitudeGNSSMeters: + return Units::metresToIntegerFeet(altitude.choice.altitudeGNSSMeters); + case FANSAltitude_PR_altitudeFlightLevel: + return altitude.choice.altitudeFlightLevel * 100; + case FANSAltitude_PR_altitudeFlightLevelMetric: + return Units::metresToIntegerFeet(altitude.choice.altitudeFlightLevelMetric * 10.0); + case FANSAltitude_PR_NOTHING: /* No components present */ + default: + return -1; + } +} + +static double cpdlcCoordinate(long degrees, long *tenthsofminutes) +{ + double result = (double)degrees; + if(tenthsofminutes != NULL) { + result += (double)(*tenthsofminutes) / 10.0f / 60.0f; + } + return result; +} + +// Extract lat, lon, alt from FANSPositionReport +static bool cpdlcExtractPosition(FANSPositionReport_t rpt, double &latitude, double &longitude, int &altitude) +{ + // FANSPositionCurrent_t can contain various types of position data (fix name, navaid, etc). + // We want only latitude/longitude coordinates. + FANSPositionCurrent_t pos = rpt.positioncurrent; + if(pos.present != FANSPosition_PR_latitudeLongitude) { + return false; + } + FANSLatitudeLongitude_t latlon = pos.choice.latitudeLongitude; + latitude = cpdlcCoordinate(latlon.latitude.latitudeDegrees, latlon.latitude.minutesLatLon); + if(latlon.latitude.latitudeDirection == FANSLatitudeDirection_south) { + latitude = -latitude; + } + longitude = cpdlcCoordinate(latlon.longitude.longitudeDegrees, latlon.longitude.minutesLatLon); + if(latlon.longitude.longitudeDirection == FANSLongitudeDirection_west) { + longitude = -longitude; + } + altitude = cpdlcAltitude(rpt.altitude); + + return true; +} + +AcarsDemodWorker::AcarsDemodWorker(AcarsDemod *acarsDemod) : + m_acarsDemod(acarsDemod) +{ + qRegisterMetaType("AcarsRowEvent"); + qRegisterMetaType("AcarsAssemblyEvent"); + + connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &AcarsDemodWorker::handleInputMessages); +} + +AcarsDemodWorker::~AcarsDemodWorker() +{ + if (m_logFile.isOpen()) + { + m_logStream.flush(); + m_logFile.close(); + } + if (m_reasmCtx) { + la_reasm_ctx_destroy(m_reasmCtx); + } + m_multipartAssembler.clear(); +} + +// Runs on the worker thread once it starts +void AcarsDemodWorker::startWork() +{ + // Sockets must be created on the thread that uses them + m_udpSocket = new QUdpSocket(this); + + m_reasmCtx = la_reasm_ctx_new(); + + // Airport information for the AcarsMessage decoders, plus the user-defined label + // names. + // + // All three of these are PROCESS WIDE - m_airportInfo is a global and the two label + // hashes are static members - while startWork() runs on every demodulator's OWN + // worker thread, because it is connected to QThread::started. An unguarded + // check-then-assign therefore races as soon as two channels are created close + // together: QSharedPointer assignment is not atomic, and nor is QHash insertion, so + // the failure mode is a corrupted hash or a double free rather than merely doing the + // work twice. The base label hashes are initialised at file scope, so only these + // additions need guarding. + // The airport table is shared with the Aircraft feature as well, so it has its own + // process wide guard in the library + acarsInitAirportInfo(); + + static std::once_flag sharedDataInit; + std::call_once(sharedDataInit, []() + { + // Add user-defined labels + for (int i = '1'; i <= '4'; i++) + { + for (char c = '0'; c <= '~'; c++) + { + QString label; + label.append(QChar(i)); + label.append(QChar(c)); + m_labels.insert(label, "User defined"); + m_subLabels.insert(label, "User defined"); + } + } + }); + + m_aircraftInfo = OsnDB::getAircraftInformationByReg(); + m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); + + loadVdl2Gs(); +} + +// A different RF channel or protocol: nothing partially reassembled from the old one may +// combine with new traffic. That means ALL THREE reassembly layers, not just ATN - the +// ACARS multipart assembler holds partial ETB chains, and libacars keeps its own +// reassembly context for fragmented messages. Clearing only the ATN decoder left the +// other two to splice a half message from one frequency onto traffic from another. +void AcarsDemodWorker::resetReassembly() +{ + m_atnDecoder.clear(); + m_multipartAssembler.clear(); + if (m_reasmCtx) + { + la_reasm_ctx_destroy(m_reasmCtx); + m_reasmCtx = la_reasm_ctx_new(); + } +} + +void AcarsDemodWorker::handleInputMessages() +{ + Message* message; + while ((message = m_inputMessageQueue.pop())) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +void AcarsDemodWorker::forwardToGui(Message *message) +{ + MessageQueue *guiQueue = m_acarsDemod->getMessageQueueToGUI(); + if (guiQueue) { + guiQueue->push(message); + } else { + delete message; + } +} + +bool AcarsDemodWorker::handleMessage(const Message& message) +{ + if (AcarsDemod::MsgProtocolChange::match(message)) + { + const AcarsDemod::MsgProtocolChange& protocol = (const AcarsDemod::MsgProtocolChange&) message; + // Arrives in stream order with the packets, so everything after it really did + // come off this protocol. The sink also emits this on a FORCED settings apply, which + // happens at startup and on preset load without the mode necessarily changing, so + // only a genuine change discards what is part way through reassembly. + if (m_protocolMode != protocol.getMode()) + { + m_protocolMode = protocol.getMode(); + resetReassembly(); + } + return true; + } + if (MainCore::MsgPacket::match(message)) + { + MainCore::MsgPacket& report = (MainCore::MsgPacket&) message; + + // VDL-2 sends a subclass carrying the aircraft's address from the AVLC header. + // Every other bearer sends the packet itself, and matches here just the same + quint32 icao = 0; + if (AcarsDemod::MsgAcarsPacket::match(message)) { + icao = ((AcarsDemod::MsgAcarsPacket&) message).getIcao(); + } + processPacket(report.getPacket(), report.getDateTime(), icao); + + // Forward to APRS and other packet features + QList packetsPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_acarsDemod, "packets", packetsPipes); + + for (const auto& pipe : packetsPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + // Deliberately sliced to the base: APRS and the other packet features want + // the bytes, not whatever the bearer happened to know as well + MainCore::MsgPacket *msg = new MainCore::MsgPacket(report); + messageQueue->push(msg); + } + + // Forward via UDP + if (m_settings.m_udpEnabled && m_udpSocket) + { + m_udpSocket->writeDatagram(report.getPacket().data(), report.getPacket().size(), + QHostAddress(m_settings.m_udpAddress), m_settings.m_udpPort); + } + + // Write to log file + if (m_logFile.isOpen()) + { + QByteArray bytes = report.getPacket(); + // One ISO 8601 column, to match the table. It is unambiguous, it sorts + // chronologically as text - which the locale date string did not - and it + // keeps the milliseconds the two locale strings threw away + m_logStream << report.getDateTime().toString(Qt::ISODateWithMs) << "," + << bytes.toHex() + << "\n"; + } + + return true; + } + else if (MsgReplayPacket::match(message)) + { + const MsgReplayPacket& replay = (const MsgReplayPacket&) message; + processPacket(replay.getPacket(), replay.getDateTime(), 0, true); + return true; + } + else if (AcarsDemod::MsgVdl2Frame::match(message)) + { + AcarsDemod::MsgVdl2Frame& report = (AcarsDemod::MsgVdl2Frame&) message; + processVdl2Frame(report.getFrame(), report.getDateTime()); + return true; + } + else if (AcarsDemod::MsgAeroFrame::match(message)) + { + AcarsDemod::MsgAeroFrame& report = (AcarsDemod::MsgAeroFrame&) message; + processAeroFrame(report.getFrame(), report.getDateTime()); + return true; + } + else if (AcarsDemod::MsgHfdlFrame::match(message)) + { + AcarsDemod::MsgHfdlFrame& report = (AcarsDemod::MsgHfdlFrame&) message; + processHfdlFrame(report.getFrame(), report.getDateTime()); + return true; + } + else if (MsgConfigureWorker::match(message)) + { + const MsgConfigureWorker& cfg = (const MsgConfigureWorker&) message; + applySettings(cfg.getSettings(), cfg.getForce()); + return true; + } + else if (MsgReloadAircraftDatabase::match(message)) + { + // The tables were taken once at construction, so without this a database + // downloaded later never reached the registration lookups + m_aircraftInfo = OsnDB::getAircraftInformationByReg(); + m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); + return true; + } + else if (DSPSignalNotification::match(message)) + { + const DSPSignalNotification& notif = (const DSPSignalNotification&) message; + if (m_centerFrequency != notif.getCenterFrequency()) { + resetReassembly(); + } + m_centerFrequency = notif.getCenterFrequency(); + return true; + } + return false; +} + +void AcarsDemodWorker::applySettings(const AcarsDemodSettings& settings, bool force) +{ + // Anything that rebuilds the receivers is a clean break in the stream, so a part + // captured before it must not be joined to one captured after + if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) + || AcarsDemodSettings::rateChanged(settings, m_settings)) { + resetReassembly(); + } + + if ((settings.m_logEnabled != m_settings.m_logEnabled) + || (settings.m_logFilename != m_settings.m_logFilename) + || force) + { + if (m_logFile.isOpen()) + { + m_logStream.flush(); + m_logFile.close(); + } + if (settings.m_logEnabled && !settings.m_logFilename.isEmpty()) + { + m_logFile.setFileName(settings.m_logFilename); + if (m_logFile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) + { + qDebug() << "AcarsDemodWorker::applySettings - Logging to: " << settings.m_logFilename; + bool newFile = m_logFile.size() == 0; + m_logStream.setDevice(&m_logFile); + if (newFile) + { + // Write header + m_logStream << "DateTime,Data\n"; + } + } + else + { + qDebug() << "AcarsDemodWorker::applySettings - Unable to open log file: " << settings.m_logFilename; + } + } + } + + m_settings = settings; +} + +// Process an ACARS message from any of the three modes +void AcarsDemodWorker::processPacket(const QByteArray& packet, QDateTime dateTime, quint32 icao, bool replay) +{ + processAcarsMessage(packet, dateTime, icao, replay); +} + +// Whether anything is going to look at what we format. +// +// The channel's GUI message queue is the framework's own test for this, and it is null in +// a server build or for a channel created headlessly. Everything the demodulator exists to +// DO - the UDP forward, the log, the aggregator feeds, the aircraft reports and map items - +// happens either way; what is skipped is only the rendering and the strings kept for the +// decode view, which in a headless run are built, stored and never read. +bool AcarsDemodWorker::hasGui() const +{ + return m_acarsDemod && m_acarsDemod->getMessageQueueToGUI(); +} + +void AcarsDemodWorker::emitAssemblyState(const QSharedPointer& assembly) +{ + // The whole of this exists to populate the decode view + if (!hasGui()) { + return; + } + + AcarsAssemblyEvent e; + e.m_assemblyId = assembly->m_id; + e.m_isMultipart = assembly->isMultipart(); + e.m_uplink = assembly->m_uplink; + e.m_statusText = AcarsMultipartAssembler::statusText(assembly->m_status); + e.m_uniquePartCount = assembly->m_uniquePartCount; + e.m_duplicateCount = assembly->m_duplicateCount; + e.m_missingSequences = assembly->m_missingSequences; + + // The "Combined message" section for the decode view: the libacars decode + // of the complete assembly, our own decoder's text, or the raw combination + if (!assembly->m_libAcarsDecodedText.isEmpty()) + { + QString libAcarsDecode = assembly->m_libAcarsDecodedText.toHtmlEscaped(); + libAcarsDecode.replace("\n", "
"); + e.m_combinedHtmlBody = libAcarsDecode; + } + else if (!assembly->m_decodedText.isEmpty()) + { + QString builtInDecode = assembly->m_decodedText; + builtInDecode.replace("\r", "
"); + builtInDecode.replace("\n", "
"); + e.m_combinedHtmlBody = builtInDecode; + } + else + { + QString combinedText = assembly->m_combinedText.toHtmlEscaped(); + combinedText.replace("\n", "
"); + e.m_combinedHtmlBody = combinedText; + } + + emit assemblyUpdated(e); +} + +// Decode one ACARS message: multipart assembly, our decoders, libacars (ADS-C, +// CPDLC, ARINC 622), aircraft reports, aggregator feeds and the display event +// ACARS labels are two characters and some of them are control codes - the general +// response in demand mode is underscore followed by DEL. Left as-is they render as a +// missing-glyph box, which reads as a decode failure when it is nothing of the sort. +// Substituting the Unicode Control Pictures block shows what the character actually is. +// Display only: the raw label still does the table lookup and still goes out on the feeds. +static QString printableLabel(const QString& label) +{ + QString out; + for (QChar c : label) + { + const ushort u = c.unicode(); + if (u == 0x7F) { + out.append(QChar(0x2421)); // DEL + } else if (u < 0x20) { + out.append(QChar(0x2400 + u)); // NUL through US + } else { + out.append(c); + } + } + return out; +} + +// The event carries a day of the month and a UTC time but no month or year, so the +// reception time supplies those. Searching a few days either side rather than assuming +// the same month is what makes it work across a month boundary - an OUT at 23:55 on the +// 31st is commonly reported a few minutes later, on the 1st. +static QDateTime oooiDateTime(const QDateTime& received, int day, const QTime& time) +{ + if (!time.isValid() || !received.isValid()) { + return QDateTime(); + } + const QDate base = received.toUTC().date(); + if ((day < 1) || (day > 31)) { + return QDateTime(base, time, Qt::UTC); + } + for (int offset = 0; offset <= 2; offset++) + { + for (int sign = 1; sign >= -1; sign -= 2) + { + const QDate d = base.addDays(sign * offset); + if (d.day() == day) { + return QDateTime(d, time, Qt::UTC); + } + if (offset == 0) { + break; + } + } + } + return QDateTime(base, time, Qt::UTC); +} + +// Recognise a weather report inside an ACARS message, and say which airport it is about. +// +// There is no single weather label. Aircraft request weather on 5U and ATIS on 5D/B9, and +// the reply comes back on whatever label the airline's system uses - very often plain +// text. So the label narrows it and the CONTENT decides, which is also what makes a METAR +// forwarded inside a free-text message findable. +// +// Each form is recognised by the shape the WMO and ICAO formats guarantee: +// METAR ICAO ddhhmmZ ... observation, sometimes with a METAR/SPECI prefix +// TAF TAF [AMD|COR] ICAO ddhhmmZ forecast +// NOTAM a series beginning with an exclamation mark or the word NOTAM +// PIREP UA/ or UUA/ followed by /OV +// SIGMET ICAO SIGMET|AIRMET n VALID +// +// uplink says which way the message went, which is what separates a report from a request +// for one: the ground sends the weather, the aircraft asks for it. It is only consulted +// where the label alone is doing the work - a body that actually contains a METAR or a +// PIREP is weather whichever way it was going, and a PIREP is a downlink by definition. +static int classifyWeather(const QString& label, const QString& text, bool uplink, + QString& airport, QString& body) +{ + static const QRegularExpression metarRe( + R"((?:^|\n)\s*(?:(?:METAR|SPECI)\s+)?([A-Z]{4})\s+\d{6}Z\s)"); + static const QRegularExpression tafRe( + R"((?:^|\n)\s*TAF(?:\s+(?:AMD|COR|RTD))?\s+([A-Z]{4})\s)"); + static const QRegularExpression sigmetRe( + R"((?:^|\n)\s*([A-Z]{4})\s+(?:SIGMET|AIRMET)\s)"); + static const QRegularExpression notamRe( + R"((?:^|\n)\s*(?:NOTAM|!\s*([A-Z]{3,4})))"); + static const QRegularExpression pirepRe( + R"((?:^|\n)\s*(?:UA|UUA)/.*?/OV\s+([A-Z]{3,4}))"); + static const QRegularExpression atisRe( + R"(([A-Z]{4})\s+(?:ARR|DEP|ARR/DEP)?\s*ATIS\s+([A-Z])\b)"); + + body = text.trimmed(); + if (body.isEmpty()) { + return AircraftReport::WeatherNone; + } + + QRegularExpressionMatch m = tafRe.match(body); + if (m.hasMatch()) + { + airport = m.captured(1); + return AircraftReport::Taf; + } + m = metarRe.match(body); + if (m.hasMatch()) + { + airport = m.captured(1); + return AircraftReport::Metar; + } + m = sigmetRe.match(body); + if (m.hasMatch()) + { + airport = m.captured(1); + return AircraftReport::Sigmet; + } + m = pirepRe.match(body); + if (m.hasMatch()) + { + airport = m.captured(1); + return AircraftReport::Pirep; + } + m = notamRe.match(body); + if (m.hasMatch()) + { + airport = m.captured(1); + return AircraftReport::Notam; + } + m = atisRe.match(body); + if (m.hasMatch()) + { + airport = m.captured(1); + return AircraftReport::Atis; + } + + // Nothing matched on content. The label still says what the message was FOR, so a + // terminal weather report is kept as weather even when its body is a format we do + // not parse - better an unclassified row than a missing one. + // + // Uplinks only. These labels name a weather SERVICE, and the aircraft's half of it is + // the request: a downlink on 5U is a list of airports and a report type, such as + // "EGKK LFPO LFBD LFBO-SA", which says nothing whatever about the weather and has no + // business in a table of weather reports. + if (!uplink) { + return AircraftReport::WeatherNone; + } + if ((label == "AB") || (label == "BB")) { + return AircraftReport::Twip; + } + if ((label == "A9") || (label == "5D") || (label == "B9")) { + return AircraftReport::Atis; + } + if ((label == "5U") || (label == "WO")) { + return AircraftReport::WeatherOther; + } + return AircraftReport::WeatherNone; +} + +// Registrations are written inconsistently: the databases use the ICAO form with the +// nationality mark separated (9H-VCP, G-EZTA), while an ACARS address field has no room +// for punctuation and carries it run together (9HVCP, .G-EZTA pads with a dot instead). +// Comparing the two forms directly reports every aircraft as a mismatch, so compare only +// the letters and digits. +static QString registrationKey(const QString& registration) +{ + QString key; + for (const QChar& c : registration) + { + if (c.isLetterOrNumber()) { + key.append(c.toUpper()); + } + } + return key; +} + +void AcarsDemodWorker::processAcarsMessage(QByteArray messageBytes, QDateTime received, quint32 icao, bool replay) +{ + // The demodulators never produce an empty block, but a .csv row whose Data column is + // empty or not hex does, and everything below indexes the last byte + if (messageBytes.isEmpty()) { + return; + } + + // FIXME: Occasionally last byte is ff instead of 7f - correct, otherwise libacars wont parse + // Should be fixed in sink + if (messageBytes[messageBytes.size()-1] == (char)0xff) { + messageBytes[messageBytes.size()-1] = 0x7f; + } + + // Decode the message + AcarsMessage *message = AcarsMessage::decode(messageBytes); + if (!message) + { + qDebug() << "AcarsDemodWorker::processAcarsMessage: Unsupported ACARS message: " << messageBytes; + return; + } + + // Owned here and freed on every exit path. It used to be appended to m_messages and + // kept for the life of the channel, because the multipart assembler identified parts + // by the message's ADDRESS - so every message ever decoded had to stay allocated for + // those addresses to remain unique. The assembler now uses an id instead, and nothing + // outside this function holds the pointer: the row and assembly events carry copies. + QScopedPointer messageOwner(message); + + message->m_dateTime = received; + + AcarsMultipartAssembler::Part multipartPart; + multipartPart.m_sourceId = ++m_nextSourceId; + multipartPart.m_received = received; + multipartPart.m_uplink = message->m_uplink; + multipartPart.m_address = message->m_address; + multipartPart.m_label = message->m_label; + multipartPart.m_subLabel = message->m_subLabel; + multipartPart.m_blockId = message->m_blockId; + multipartPart.m_originator = message->m_originator; + multipartPart.m_messageNumber = message->m_messageNumber; + if (!message->m_blockSequence.isEmpty()) { + multipartPart.m_blockSequence = message->m_blockSequence[0]; + } + multipartPart.m_text = message->m_text; + multipartPart.m_more = message->m_multiBlock; + + // What the document ends up being rendered from. The block's own text unless the + // message turns out to be one of several, in which case it is the assembled whole - + // which is what gets decoded below. + QString documentSource = message->m_text; + + AcarsMultipartAssembler::Result multipart = m_multipartAssembler.add(multipartPart); + if (multipart.m_assembly) + { + // Do not offer a partial or gap-collapsed payload to an application decoder. + // Once complete, earlier table rows get the same decode through the assembly. + if (multipart.m_assembly->m_status == AcarsMultipartAssembler::Complete) + { + // A single block is already decoded on exactly this text. Several are decoded + // afresh on the whole: decoding the same object a second time doubled every + // list a decoder appends to - the route sent to the Aircraft feature among them. + if (multipart.m_assembly->m_combinedText != message->m_text) + { + AcarsMessage *whole = AcarsMessage::decode(messageBytes, multipart.m_assembly->m_combinedText); + if (whole) + { + whole->m_dateTime = received; + messageOwner.reset(whole); + message = whole; + } + } + documentSource = multipart.m_assembly->m_combinedText; + if (hasGui()) { + multipart.m_assembly->m_decodedText = message->toString(); + } + } + else + { + multipart.m_assembly->m_decodedText.clear(); + multipart.m_assembly->m_libAcarsDecodedText.clear(); + } + } + + if (!replay) { + feedMessage(messageBytes, received); + } + + AcarsRowEvent e; + e.m_frameType = 0; + e.m_received = received; + e.m_uplink = message->m_uplink; + + // Record the aircraft as active for the GUI's chart. Only downlinks show + // the aircraft itself transmitting. + if (!message->m_uplink && !message->m_address.isEmpty()) { + e.m_chartAircraftId = message->m_address; + } + + // Mode is destination of message + // 2 = All ground stations / aircraft - Other characters are specific station / aircraft + // and country specific (the GUI derives the country decode) + e.m_mode = QString("%1").arg(message->m_mode); + + e.m_address = message->m_address; + + // ACK or NACK - Or block ID it corresponds to + if (message->m_ack == (char)ASCII_ACK) { + e.m_ack = "ACK"; + } else if (message->m_ack == (char)ASCII_NAK) { + e.m_ack = "NAK"; + } else { + e.m_ack = QString("%1").arg(message->m_ack); + } + + // Label (type of message) + QString label = printableLabel(message->m_label); + if (!message->m_subLabel.isEmpty()) + { + label.append('/'); + label.append(message->m_subLabel); + // value(), never operator[]: these hashes are static and shared by every + // demodulator's worker thread, and operator[] inserts on a miss + e.m_labelDecode = m_subLabels.value(message->m_subLabel); + } + else + { + e.m_labelDecode = m_labels.value(message->m_label); + } + // An ACARS block reaches here from every protocol - the VDL-2, HFDL and Aero + // receivers all reassemble one and push it down this same path - so the link it + // came off is m_protocolMode, tracked in stream order, and not simply "ACARS" + switch (m_protocolMode) + { + case AcarsDemodSettings::VDL2: + e.m_protocol = "VDL-2"; + e.m_bitRate = 31500; // 10500 symbols/s of D8PSK, three bits each + break; + case AcarsDemodSettings::HFDL: + e.m_protocol = "HFDL"; + e.m_bitRate = 0; // Per frame, and not carried on this path + break; + case AcarsDemodSettings::Aero: + e.m_protocol = "Aero"; + // submodeRate() is the Rate enum; bitRate() turns it in to bits per second + e.m_bitRate = AcarsAeroReceiver::bitRate(AcarsAeroReceiver::submodeRate(m_settings.m_aeroChannel)); + break; + case AcarsDemodSettings::Iridium: + e.m_protocol = "Iridium"; + e.m_bitRate = 50000; // 25000 symbols/s of DQPSK, two bits each + break; + default: + e.m_protocol = "ACARS"; + e.m_bitRate = 2400; + break; + } + e.m_label = label; + + // Block ID + e.m_blockId = QString("%1").arg(message->m_blockId); + + e.m_originator = message->m_originator; + e.m_originatorDecode = m_originators.value(message->m_originator); + e.m_messageNumber = message->m_messageNumber; + e.m_blockSequence = message->m_blockSequence; + e.m_flight = message->m_flight; + + // One sighting for the Aircraft feature, filled in as the message decodes + // and sent at the end + AircraftReport report; + report.m_received = received; + report.m_flight = message->m_flight; + report.m_label = label; + report.m_uplink = message->m_uplink; + report.m_documentKind = AircraftReport::AcarsText; + if (message->m_text.contains("LOADSHEET")) + { + report.m_documentKind = AircraftReport::Loadsheet; + report.m_documentTitle = "Loadsheet"; + } + // The address is only a registration when it is a real one - HFDL/VDL-2 + // link identities show as "AC n"/"GS n"/"Unidentified" forms + if (!message->m_address.isEmpty() && (message->m_address != "Unidentified") + && !message->m_address.startsWith("AC ") && !message->m_address.startsWith("GS ")) { + report.m_registration = message->m_address; + } + + // The address of the aircraft that sent this, where the bearer carried one. VDL-2 + // does, in the AVLC header of the same frame, and without it an aircraft heard only + // on VDL-2 is known by registration alone - so it collates with its own ADS-B only + // when the registration happens to be in the OpenSky database. + if (icao) + { + report.m_icao = icao; + + // Both halves of the identity arrived off air in the same frame, which is the + // only time we can check the database rather than trust it. A disagreement is + // logged rather than acted on: it means the database has this address against + // the wrong airframe, or the registration has been reassigned, and which of + // those it is cannot be told from one message. + if (!report.m_registration.isEmpty() && m_aircraftInfoByIcao + && m_aircraftInfoByIcao->contains((int) icao)) + { + const QString known = m_aircraftInfoByIcao->value((int) icao)->m_registration; + if (!known.isEmpty() + && (registrationKey(known) != registrationKey(report.m_registration))) + { + qWarning() << "AcarsDemodWorker: registration mismatch - address" + << QString("%1").arg(icao, 6, 16, QChar('0')).toUpper() + << "transmitted" << report.m_registration + << "but the database says" << known; + } + } + } + + // Get UNIX time message was received + struct timeval rxTimeVal; + rxTimeVal.tv_sec = received.toSecsSinceEpoch(); + rxTimeVal.tv_usec = 0; + + // Tell libacars which protocol this came off. It changes the reassembly rules, and + // until now nothing set it at all, so HFDL and VDL-2 were both being parsed as + // plain VHF ACARS. There is no VDL-2 constant because VDL-2 *is* a VHF protocol. + // + // The protocol comes from m_protocolMode, stamped by the sink into the packet queue, NOT + // from m_settings - the two are configured through independent queues, so a packet + // demodulated under the old mode can arrive after the worker's settings have moved on. + // + // la_config_set_int writes a PROCESS WIDE setting with no per-context alternative in + // the API, so two ACARS demodulators in different modes would otherwise race between + // the set and the parse. The lock below spans both, which serialises parsing across + // every ACARS demodulator in the process - acceptable because a parse is microseconds, + // and the alternative is messages silently reassembled under another channel's rules. + static QMutex protocolMutex; + + la_proto_node *node; + { + QMutexLocker protocolLock(&protocolMutex); + + switch (m_protocolMode) + { + case AcarsDemodSettings::HFDL: + la_config_set_int("acars_bearer", LA_ACARS_BEARER_HFDL); + break; + case AcarsDemodSettings::Aero: + case AcarsDemodSettings::Iridium: + la_config_set_int("acars_bearer", LA_ACARS_BEARER_SATCOM); + break; + default: + la_config_set_int("acars_bearer", LA_ACARS_BEARER_VHF); + break; + } + + // Decode message with libacars + node = la_acars_parse_and_reassemble((uint8_t *)messageBytes.data()+1, messageBytes.length() - 1, + message->m_uplink ? LA_MSG_DIR_GND2AIR : LA_MSG_DIR_AIR2GND, + m_reasmCtx, rxTimeVal); + } // protocol lock released: it only has to span the set and the parse + if (node != nullptr) + { + // Decode binary message data using libacars (FANS 1/A ADS-C & CPDLC, MAIM, Media Advisory) + if (node->next) + { + la_vstring *vstr = la_proto_tree_format_text(nullptr, node->next); + QString full = QString(vstr->str).trimmed(); + // Column: flattened to one line; the full multi-line decode is kept + // for the decode view and Map popups + e.m_textDecode = acarsDecodeToColumn(full); + e.m_fullDecode = full; + if (multipart.m_assembly + && (multipart.m_assembly->m_status == AcarsMultipartAssembler::Complete)) + { + if (hasGui()) { + multipart.m_assembly->m_libAcarsDecodedText = vstr->str; + } + } + e.m_useLibacars = true; + la_vstring_destroy(vstr, true); + } + else + { + // Our decoder for stuff libacars doesn't support, such as B1/B2/QQ + QString full = acarsDecodeToPlain(message->toString()); + e.m_textDecode = acarsDecodeToColumn(full); + e.m_fullDecode = full; + e.m_useLibacars = false; + } + + // ARINC 622 decode + la_proto_node *arincNode = la_proto_tree_find_arinc(node); + if (arincNode) + { + la_arinc_msg *arinc = (la_arinc_msg *)arincNode->data; + if (arinc) + { + // Use our decode if libacars doesn't support the IMI. E.g. TI2 + if (arinc->imi == ARINC_MSG_UNKNOWN) + { + QString full = acarsDecodeToPlain(message->toString()); + e.m_textDecode = acarsDecodeToColumn(full); + e.m_fullDecode = full; + e.m_useLibacars = false; + } + + // Extract ATC comms + if ((arinc->imi == ARINC_MSG_AT1) || (arinc->imi == ARINC_MSG_CR1)) + { + // Use our decoder rather than libacars for ATC, as it expands messages, rather than displays in hierarchical form + AcarsATCCommunications *atcCommunications = dynamic_cast(message); + if (atcCommunications && !atcCommunications->m_622.m_do219.isEmpty()) { + e.m_atc = atcCommunications->m_622.m_do219; + } + AcarsMessageFromSubsystem *sub = dynamic_cast(message); + if (sub && !sub->m_622.m_do219.isEmpty()) { + e.m_atc = sub->m_622.m_do219; + } + report.m_documentKind = AircraftReport::Cpdlc; + report.m_documentTitle = "CPDLC"; + if (!e.m_atc.isEmpty()) + { + report.m_documentText = e.m_atc; + report.m_atc = e.m_atc; + } + if (strlen(arinc->gs_addr) > 0) { + report.m_station = QString(arinc->gs_addr).trimmed(); + } + } + } + } + + // Look for ADS-C data. The tag numbers are direction dependent - in a + // downlink these are position reports, but in an uplink the same tags + // are contract requests, whose data is not a report struct - so only + // extract positions from downlinks. + la_proto_node *adscNode = la_proto_tree_find_adsc(node); + if (adscNode && !message->m_uplink) + { + la_adsc_msg_t *adsc = (la_adsc_msg_t *)adscNode->data; + if (adsc && !adsc->err) + { + la_list *l = adsc->tag_list; + la_adsc_basic_report_t *rpt = NULL; + while(l != NULL) + { + la_adsc_tag_t *tag_struct = (la_adsc_tag_t *)l->data; + uint8_t t = tag_struct->tag; + // Look for a Basic Report + if(t == 7 || t == 9 || t == 10 || t == 18 || t == 19 || t == 20) + { + rpt = (la_adsc_basic_report_t *)tag_struct->data; + e.m_hasPosition = true; + e.m_hasAltitude = true; + e.m_latitude = rpt->lat; + e.m_longitude = rpt->lon; + e.m_altitudeFt = rpt->alt; + // Position for the Aircraft feature + report.m_positionValid = true; + report.m_latitude = rpt->lat; + report.m_longitude = rpt->lon; + report.m_altitudeValid = true; + report.m_altitudeFt = rpt->alt; + report.m_documentKind = AircraftReport::PositionReport; + break; + } + l = la_list_next(l); + } + } + } + + // Look for position in ADS Position report / CPDLC data + la_proto_node *cpdlcNode = la_proto_tree_find_cpdlc(node); + if (cpdlcNode) + { + la_cpdlc_msg *cpdlc = (la_cpdlc_msg *)cpdlcNode->data; + if (cpdlc && !cpdlc->err) + { + if (!strcmp(cpdlc->asn_type->name, "FANSATCDownlinkMessage")) + { + FANSATCDownlinkMessage_t *dm = (FANSATCDownlinkMessage_t *)cpdlc->data; + if (dm) + { + bool positionValid = false; + double latitude, longitude; + int altitudeFt; + if(dm->aTCDownlinkmsgelementid.present == FANSATCDownlinkMsgElementId_PR_dM48PositionReport) + { + positionValid = cpdlcExtractPosition(dm->aTCDownlinkmsgelementid.choice.dM48PositionReport, latitude, longitude, altitudeFt); + } + else + { + FANSATCDownlinkMsgElementIdSequence_t *dmeid_seq = dm->aTCdownlinkmsgelementid_seqOf; + if(dmeid_seq != NULL) + { + for(int i = 0; i < dmeid_seq->list.count; i++) + { + FANSATCDownlinkMsgElementId_t *dmeid_ptr = (FANSATCDownlinkMsgElementId_t *)dmeid_seq->list.array[i]; + if (dmeid_ptr != NULL && dmeid_ptr->present == FANSATCDownlinkMsgElementId_PR_dM48PositionReport) + { + positionValid = cpdlcExtractPosition(dmeid_ptr->choice.dM48PositionReport, latitude, longitude, altitudeFt); + break; + } + } + } + } + if (positionValid) + { + e.m_hasPosition = true; + e.m_hasAltitude = true; + e.m_latitude = latitude; + e.m_longitude = longitude; + e.m_altitudeFt = altitudeFt; + // Position for the Aircraft feature + report.m_positionValid = true; + report.m_latitude = latitude; + report.m_longitude = longitude; + report.m_altitudeValid = true; + report.m_altitudeFt = altitudeFt; + report.m_documentKind = AircraftReport::Cpdlc; + } + } + } + } + } + + la_proto_tree_destroy(node); + } + else + { + e.m_textDecode = "Failed to la_acars_parse_and_reassemble"; + } + + // Weather. An ATIS report has already been parsed and knows its own airport; every + // other form is recognised from the text. + { + QString wxAirport, wxBody; + if (AcarsATISReport *atis = dynamic_cast(message)) + { + report.m_weatherKind = AircraftReport::Atis; + report.m_weatherAirport = atis->m_airport; + report.m_weatherText = atis->m_atisInformation.isEmpty() + ? message->m_text : atis->m_atisInformation; + } + else if (AcarsMeteorologicalReport *met = + dynamic_cast(message)) + { + // The aircraft as a weather station. Unlike everything else on this tab it + // is not about an airport, so none is named - the observations carry their + // own positions. + report.m_weatherKind = AircraftReport::AirReport; + report.m_weatherText = met->toString(); + } + else if (dynamic_cast(message)) + { + // Decoded as a request outright, so there is nothing to classify: it names + // the airports it wants and the report type, and holds no weather at all. + // Kept as a document though - the airports a crew asks the weather for are + // often the alternates they are weighing up, which is said nowhere else. + report.m_documentKind = AircraftReport::WeatherRequest; + report.m_documentTitle = "Weather request"; + } + else + { + const int kind = classifyWeather(message->m_label, message->m_text, + message->m_uplink, wxAirport, wxBody); + if (kind != AircraftReport::WeatherNone) + { + report.m_weatherKind = kind; + report.m_weatherAirport = wxAirport; + report.m_weatherText = wxBody; + } + } + } + + // Categories that no decoder claims, classified by label alone. Only where nothing + // more specific already applied, so a label 80 operational report stays what it is. + if (report.m_documentKind == AircraftReport::NoDocument) + { + const QString label = message->m_label; + if (label == "5Z") + { + report.m_documentKind = AircraftReport::AirlineDownlink; + report.m_documentTitle = "Airline downlink"; + } + else if (label == "99") + { + report.m_documentKind = AircraftReport::EmergencyMessage; + report.m_documentTitle = "Emergency message"; + } + else if ((label.size() == 2) && (label[0] == '8') + && (((label[1] >= '0') && (label[1] <= '9')) + || ((label[1] >= 'A') && (label[1] <= 'F')))) + { + report.m_documentKind = AircraftReport::AircrewMessage; + report.m_documentTitle = "Aircrew message"; + } + } + + // Route facts for the Aircraft feature: departure/arrival airports and + // flight plan or oceanic clearance routes, from whichever decoder saw them + { + QString dep, arr, route; + if (AcarsFlightStatus *fs = dynamic_cast(message)) + { + dep = fs->m_departureAirport; + arr = fs->m_arrivalAirport; + } + else if (AcarsEventReport *ev = dynamic_cast(message)) + { + dep = ev->m_departureAirport; + arr = ev->m_arrivalAirport; + + // Only when one of the four events was actually read. Set unconditionally, + // EVERY message on labels 13 to 18 became a document titled "OOOI" whether + // it was one or not - and most are not: of 134 so titled here, 92 were + // position reports carrying no OOOI time at all, which is what made the + // Documents tab claim OOOI for flights that had never sent one. + if ((ev->m_event >= AircraftReport::OooiOut) + && (ev->m_event <= AircraftReport::OooiIn)) + { + report.m_documentKind = AircraftReport::OooiEvent; + report.m_oooiEvent = ev->m_event; + report.m_oooiTime = oooiDateTime(report.m_received, ev->m_day, ev->m_eventTime); + } + } + else if (AcarsMeteorologicalReport *met = + dynamic_cast(message)) + { + dep = met->m_departureAirport; + arr = met->m_arrivalAirport; + // The last observation is where the aircraft is now; the earlier ones are a + // log of where it has been, sometimes three quarters of an hour back + if (!met->m_observations.isEmpty()) + { + const AcarsMeteorologicalReport::Observation& last = met->m_observations.last(); + report.m_positionValid = true; + report.m_latitude = last.m_latitude; + report.m_longitude = last.m_longitude; + report.m_altitudeValid = true; + report.m_altitudeFt = last.m_altitudeFt; + } + } + else if (AcarsPositionReport *pr = dynamic_cast(message)) + { + dep = pr->m_departureAirport; + arr = pr->m_arrivalAirport; + // Altitude travels with the position below, through getPosition(), so a + // report that gives an altitude and NO position - the cruise report is one - + // would otherwise have it dropped + if (!pr->m_positionValid && (pr->m_altitudeFt > 0)) + { + report.m_altitudeValid = true; + report.m_altitudeFt = pr->m_altitudeFt; + } + } + // The ARINC 620 four character movement reports on labels QP, QQ, QR, QS and QT. + // Every one of these was decoded and then dropped: only the three character form + // below had a branch, so 37 aircraft sent an off report here and not one of them + // ever showed an Off time. + // + // Unlike that three character form these name the airports in four character + // ICAO, which is what everything downstream works in, so the route is taken too. + // + // No day is carried, so the time is resolved against when the message arrived. + else if (AcarsOutReport *out = dynamic_cast(message)) + { + dep = out->m_departure; + arr = out->m_destination; + report.m_documentKind = AircraftReport::OooiEvent; + report.m_oooiEvent = AircraftReport::OooiOut; + report.m_oooiTime = oooiDateTime(report.m_received, -1, + QTime(out->m_outTimeHours, out->m_outTimeMinutes)); + } + else if (AcarsOffReport *off = dynamic_cast(message)) + { + dep = off->m_departure; + arr = off->m_destination; + report.m_documentKind = AircraftReport::OooiEvent; + report.m_oooiEvent = AircraftReport::OooiOff; + report.m_oooiTime = oooiDateTime(report.m_received, -1, + QTime(off->m_offTimeHours, off->m_offTimeMinutes)); + } + else if (AcarsOnReport *on = dynamic_cast(message)) + { + dep = on->m_departure; + arr = on->m_destination; + report.m_documentKind = AircraftReport::OooiEvent; + report.m_oooiEvent = AircraftReport::OooiOn; + report.m_oooiTime = oooiDateTime(report.m_received, -1, + QTime(on->m_onTimeHours, on->m_onTimeMinutes)); + } + else if (AcarsInReport *in = dynamic_cast(message)) + { + dep = in->m_departure; + arr = in->m_destination; + report.m_documentKind = AircraftReport::OooiEvent; + report.m_oooiEvent = AircraftReport::OooiIn; + report.m_oooiTime = oooiDateTime(report.m_received, -1, + QTime(in->m_inTimeHours, in->m_inTimeMinutes)); + } + else if (AcarsOutReturnInReport *returned = + dynamic_cast(message)) + { + // Out and back to the gate without flying. The return is what ends the + // movement, so that is the time recorded - as the QG case does below. + dep = returned->m_departure; + arr = returned->m_destination; + report.m_documentKind = AircraftReport::OooiEvent; + report.m_oooiEvent = AircraftReport::OooiIn; + report.m_oooiTime = oooiDateTime(report.m_received, -1, + QTime(returned->m_returnInTimeHours, returned->m_returnInTimeMinutes)); + } + else if (AcarsShortOooiReport *oooi = dynamic_cast(message)) + { + report.m_documentKind = AircraftReport::OooiEvent; + if (oooi->m_event != AircraftReport::OooiNone) + { + report.m_oooiEvent = oooi->m_event; + // QG reports leaving the gate and coming back to it; the return is the + // one that ends the movement, so that is the time recorded + const QTime when = ((oooi->m_label == "QG") && oooi->m_secondTime.isValid()) + ? oooi->m_secondTime : oooi->m_time; + // No day is given, so it is resolved against when the message arrived + report.m_oooiTime = oooiDateTime(report.m_received, -1, when); + } + // The station and destination are deliberately NOT taken as the departure + // and arrival airports: these reports use three character IATA codes, and + // everything downstream - the route drawing, the airport lookups, the + // From and To columns - is four character ICAO. A three letter code put + // there would be shown as an airport and resolved as none. + } + else if (AcarsOpsReport *ops = dynamic_cast(message)) + { + dep = ops->m_departureAirport; + arr = ops->m_arrivalAirport; + } + else if (AcarsRequestOceanicClearance *rcl = + dynamic_cast(message)) + { + // "KLM701-OMOKO/2109 M083F320" - the entry point the crew asked for, when + // they expect to reach it, and the Mach and level they want to cross at. + // No route is filed from it: this is a request, and the fixes either side + // of the entry point are not in it. + (void) rcl; + report.m_documentKind = AircraftReport::ClearanceRequest; + report.m_documentTitle = "Oceanic clearance request"; + } + else if (AcarsRequestATISReport *atisRequest = + dynamic_cast(message)) + { + (void) atisRequest; + report.m_documentKind = AircraftReport::AtisRequest; + report.m_documentTitle = "ATIS request"; + } + else if (AcarsDepartureClearanceResponse *pdc = + dynamic_cast(message)) + { + // Nothing used to read this class at all, so a departure clearance told the + // Aircraft feature nothing - not where the flight was going, not which + // procedure it was cleared on. It was decoded and then only ever displayed. + // + // Filed as a flight plan rather than as a clearance: the tracker keeps oceanic + // clearances under that name and draws them as such, and this is the route the + // aircraft is cleared to fly from departure, which is the same thing as its + // plan. The plain language dialects carry a route; the two coded ones give + // the procedure and nothing to draw, which is enough on its own to file. + // + // A refusal - "NO DEPARTURE CLEARANCE MESSAGE ON FILE" - is still a clearance + // response and still worth showing, but it names nothing, so filing it would + // put an empty flight plan document over a real one. + if (pdc->m_clearanceAvailable) + { + dep = pdc->m_departureAirport; + arr = pdc->m_destination; + route = pdc->m_route; + report.m_routeSid = pdc->m_sid; + report.m_routeRunway = pdc->m_runway; + if (pdc->m_initialAltitudeFt > 0) { + report.m_routeFlightLevel = pdc->m_initialAltitudeFt / 100; + } + report.m_documentKind = AircraftReport::DepartureClearance; + report.m_documentTitle = "Pre-departure clearance"; + } + } + else if (AcarsLoadsheet *sheet = dynamic_cast(message)) + { + // A loadsheet writes its route in three letter IATA - VLC LHR - and everything + // downstream is four letter ICAO, so it is translated rather than passed on. + // Worth having because a loadsheet is often the ONLY message that says where a + // flight is going: it is sent on the ground before departure, when there is no + // position report and no filed plan to be heard yet. + auto icao = [](const QString& iata) + { + if (iata.size() != 3) { + return QString(); + } + QSharedPointer> airports = + OurAirportsDB::getAirportsByIata(); + const AirportInformation *airport = + airports ? airports->value(iata, nullptr) : nullptr; + return airport ? airport->m_ident : QString(); + }; + dep = icao(sheet->m_from); + arr = icao(sheet->m_to); + } + else if (AcarsMessageFromSubsystem *sub = dynamic_cast(message)) + { + dep = sub->m_fpnDeparture; + arr = sub->m_fpnArrival; + report.m_flightAlias = sub->m_icaoCallsign; + route = sub->m_fpnRoute; + report.m_routeRunway = sub->m_fpnRunway; + report.m_routeSid = sub->m_fpnSid; + report.m_routeStar = sub->m_fpnStar; + report.m_routeApproach = sub->m_fpnApproach; + report.m_routeAlternate = sub->m_fpnAlternate; + // The level the plan is flown at, which is the same thing to the Map as the + // level an oceanic clearance clears an aircraft to - it is what the route's + // fixes are drawn at. Stamping it on the message's own waypoint list is not + // enough: most position reports name their route as a string and carry no + // waypoint list at all, so nothing reached the feature and the line was drawn + // along the ground. + if (sub->m_cruiseLevelValid) { + report.m_routeFlightLevel = sub->m_cruiseLevelFt / 100; + } + for (const auto& waypoint : sub->m_fpnWaypoints) + { + AircraftReport::RouteWaypoint point; + point.m_name = waypoint.m_name; + point.m_positionValid = waypoint.m_hasPosition; + point.m_latitude = waypoint.m_latitude; + point.m_longitude = waypoint.m_longitude; + point.m_hasAltitude = waypoint.m_hasAltitude; + point.m_altitudeFt = waypoint.m_altitudeFt; + point.m_hasEta = waypoint.m_hasEta; + point.m_eta = waypoint.m_eta; + report.m_routeWaypoints.append(point); + } + // The arrival end of a plan names no waypoints at all - only the STAR and + // the approach - so testing the route alone dropped it, and the plan could + // never be assembled from its parts + if (!route.isEmpty() || !report.m_routeSid.isEmpty() || !report.m_routeStar.isEmpty() + || !report.m_routeApproach.isEmpty()) + { + report.m_documentKind = AircraftReport::FlightPlan; + report.m_documentTitle = "Flight plan"; + } + } + else if (AcarsOceanicClearanceReadback *ocr = dynamic_cast(message)) + { + arr = ocr->m_destination; + route = QStringList({ocr->m_entryPoint, ocr->m_route}).join(" ").trimmed(); + report.m_routeFlightLevel = ocr->m_flightLevel; + report.m_routeMach = ocr->m_mach; + report.m_documentKind = AircraftReport::Clearance; + report.m_documentTitle = "Oceanic clearance readback"; + } + else if (AcarsOceanicClearanceResponse *oc = dynamic_cast(message)) + { + arr = oc->m_destination; + route = QStringList({oc->m_entryPoint, oc->m_route}).join(" ").trimmed(); + report.m_routeFlightLevel = oc->m_flightLevel; + report.m_routeMach = oc->m_mach; + report.m_documentKind = AircraftReport::Clearance; + report.m_documentTitle = "Oceanic clearance"; + } + report.m_departure = dep; + report.m_arrival = arr; + report.m_route = route; + } + + // Aircraft position from any decoded message that carries one (flight + // status, position reports, OOOI events, FMS reports) + float posLatitude, posLongitude; + int posAltitudeFt; + if (message->getPosition(posLatitude, posLongitude, posAltitudeFt)) + { + e.m_hasPosition = true; + e.m_latitude = posLatitude; + e.m_longitude = posLongitude; + if (posAltitudeFt >= 0) + { + e.m_hasAltitude = true; + e.m_altitudeFt = posAltitudeFt; + } + // Position for the Aircraft feature + report.m_positionValid = true; + report.m_latitude = posLatitude; + report.m_longitude = posLongitude; + if (posAltitudeFt >= 0) + { + report.m_altitudeValid = true; + report.m_altitudeFt = posAltitudeFt; + } + } + + // The clearance route reaches the Map through the Aircraft feature, which draws + // flight plans and clearances alike - see AircraftTracker::sendRouteToMap(). The + // route itself went out above as report.m_route, and the destination as m_arrival. + + e.m_text = message->m_text; + e.m_hex = QString(messageBytes.toHex()); + + // Report the sighting to the Aircraft feature: the expanded ATC text when + // set above, otherwise the full multi-line decode, otherwise the raw text + if (report.m_documentText.isEmpty()) { + report.m_documentText = e.m_fullDecode; + } + if (report.m_documentText.isEmpty()) { + report.m_documentText = message->m_text; + } + // Kept so the document can be rendered again later rather than stored as finished + // text. Only where OUR parser produced it: libacars decodes the FANS-1/A and media + // advisory traffic, and that decoder is not reachable from the Aircraft feature, so + // those documents stay as they were rendered. + if (!e.m_useLibacars) + { + report.m_documentRaw = messageBytes; + report.m_documentSource = documentSource; + report.m_documentDerivable = true; + } + if (!report.m_registration.isEmpty() || !report.m_flight.isEmpty()) { + sendAircraftReport(report); + } + + // Precompute the decode-view HTML for non-multipart rows, mirroring the + // view's old fallback chain + if (!e.m_fullDecode.isEmpty() && hasGui()) + { + e.m_viewDecodeHtml = acarsDecodeToHtml(e.m_fullDecode); + } + else if (!e.m_textDecode.isEmpty() && !e.m_useLibacars) + { + QString html = message->toString(); + html.replace("\r", "
"); + e.m_viewDecodeHtml = html; + } + else if (e.m_textDecode.isEmpty()) + { + e.m_viewDecodeHtml = message->m_text; + } + else + { + e.m_viewDecodeHtml = e.m_textDecode; + } + + // Multipart rows share their assembly id; the assembly state event lets the + // decode view show the evolving combined message for every part's row + if (multipart.m_assembly) + { + e.m_assemblyId = multipart.m_assembly->m_id; + e.m_partNumber = multipart.m_partNumber; + } + + emit rowReady(e); + + if (multipart.m_assembly) { + emitAssemblyState(multipart.m_assembly); + } +} + +// Hand a received ACARS block, exactly as it came off the air, to whatever is listening +// on the "acarsfeed" pipe. +// +// Raw rather than decoded, and per block rather than per reassembled message, so that the +// archive on the other side can be decoded again by a later decoder - see +// MainCore::MsgAcarsBlock. Everything that used to be built here, the acarsdec style JSON +// the aggregators ingest included, is built on that side now: the parser lives in the +// library rather than in this plugin, so the feature can do it, and doing it there means +// the feed is set up once for a station rather than once per demodulator. +// +// Blocks from all three bearers pass through here, since VDL-2 and HFDL ACARS arrive on +// the same path. +void AcarsDemodWorker::feedMessage(const QByteArray& block, const QDateTime& received) +{ + QList pipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_acarsDemod, "acarsfeed", pipes); + + if (pipes.isEmpty()) { + return; + } + + const qint64 frequency = m_centerFrequency + m_settings.m_inputFrequencyOffset; + const double level = CalcDb::dbPower(m_acarsDemod->getMagSq()); + // The protocol the block actually came off, stamped in stream order - see + // AcarsDemod::MsgProtocolChange. m_settings can already be on the next mode. + const int protocol = (int) AcarsDemodSettings::protocolForMode(m_protocolMode); + + for (const auto& pipe : pipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + messageQueue->push(MainCore::MsgAcarsBlock::create( + m_acarsDemod, block, received, frequency, level, protocol)); + } +} + +// Send one sighting of an aircraft to any Aircraft features listening on the +// "aircraftreport" pipe. The caller fills in the identity, position and decoded +// content; the source description is filled in here from the channel's tuning. +void AcarsDemodWorker::sendAircraftReport(AircraftReport& report) +{ + QList pipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_acarsDemod, "aircraftreport", pipes); + + if (pipes.size() == 0) { + return; + } + + report.m_protocol = AcarsDemodSettings::protocolForMode(m_protocolMode); // As in feedMessage + report.m_frequency = m_centerFrequency + m_settings.m_inputFrequencyOffset; + report.m_deviceSetIndex = m_acarsDemod->getDeviceSetIndex(); + report.m_channelIndex = m_acarsDemod->getIndexInDeviceSet(); + + for (const auto& pipe : pipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + messageQueue->push(MainCore::MsgAircraftReport::create(m_acarsDemod, report)); + } +} + +QHash AcarsDemodWorker::m_labels = { + {":;", "Data transceiver auto-tune"}, + {"_j", "Reserved"}, + {":}", "OA to AOA autotune"}, + {"_\x7f", "General response (Demand mode)"}, + {"00", "Hijack situation report"}, + // 10 to 4~ are user defined so will vary with airline - added in constructor + {"51", "Ground GMT request"}, + {"52", "Ground UTC request"}, + {"54", "Voice contact request"}, + {"57", "Alternate aircrew initiated position report"}, + {"5D", "ATIS request"}, + {"5P", "Temporary suspension"}, + {"5R", "Aircrew initiated position report"}, + {"5U", "Weather request"}, + {"5V", "VDL switch advisory"}, + {"5Y", "Aircrew revision to previous ETA / diversion"}, + {"5Z", "Airline designated downlink"}, + {"7A", "Aircrew initiated engine data / take off thrust report"}, + {"7B", "Aircrew entered miscellaneous message"}, + {"80", "Aircrew-addressed downlinks"}, + {"81", "Aircrew-addressed downlinks"}, + {"82", "Aircrew-addressed downlinks"}, + {"83", "Aircrew-addressed downlinks"}, + {"84", "Aircrew-addressed downlinks"}, + {"85", "Aircrew-addressed downlinks"}, + {"86", "Aircrew-addressed downlinks"}, + {"87", "Aircrew-addressed downlinks"}, + {"88", "Aircrew-addressed downlinks"}, + {"89", "Aircrew-addressed downlinks"}, + {"8A", "Aircrew-addressed downlinks"}, + {"8B", "Aircrew-addressed downlinks"}, + {"8C", "Aircrew-addressed downlinks"}, + {"8D", "Aircrew-addressed downlinks"}, + {"8E", "Aircrew-addressed downlinks"}, + {"8F", "Aircrew-addressed downlinks"}, + {"99", "Emergency message"}, + {"A1", "Oceanic clearance"}, + {"A2", "Unassigned"}, + {"A3", "Departure clearance"}, + {"A4", "Flight systems message"}, + {"A5", "Unassigned"}, + {"A6", "Request ADS reports"}, + {"A7", "Free text from ATC"}, + {"A8", "Deliver departure slot"}, + {"A9", "ATIS report"}, + {"A0", "ATS facilities notification"}, + {"AA", "ATC communications"}, + {"AB", "Terminal weather information"}, + {"AC", "Pushback clearance"}, + {"AD", "Expected taxi clearance"}, + {"AE", "Unassigned"}, + {"AF", "CPC command response"}, + // B0-BZ ATS (Air Traffic Service) Messages - see ARINC 623 + {"B1", "Request Oceanic clearance"}, + {"B2", "Oceanic clearance readback"}, + {"B3", "Request departure clearance"}, + {"B4", "Departure clearance readback"}, + {"B5", "Waypoint position report"}, + {"B6", "Provide ADS report"}, + {"B7", "Free text to ATC"}, + {"B8", "Request departure slot"}, + {"B9", "Request ATIS report"}, + {"B0", "ATS facilities notification"}, + {"BA", "ATC communications"}, + {"BB", "Terminal weather information for pilots"}, + {"BC", "Pushback clearance request"}, + {"BD", "Expected taxi clearance request"}, + {"BE", "CPC aircraft log-on/log-off request"}, + {"BF", "CPC WILCO/UNABLE response"}, + {"BG", "Unassigned"}, + {"C0", "Uplink to all cockpit printers"}, + {"C1", "Uplink to cockpit printer No.1"}, + {"C2", "Uplink to cockpit printer No.2"}, + {"C3", "Uplink to cockpit printer No.3"}, + {"CA", "Printer Status = Error"}, + {"CB", "Printer Status = Busy"}, + {"CC", "Printer Status = Local test mode"}, + {"CD", "Printer Status = Out of paper"}, + {"CE", "Printer Status = Buffer overrun"}, + {"CF", "Printer Status = Reserved"}, + {"DI", "De-icing"}, + {"DL", "Data loading"}, + {"E1", "Internet email message"}, + {"E2", "Internet email message / DSP service"}, + {"EL", "Left Engine monitoring unit messages"}, + {"ER", "Right engine monitoring unit messages"}, + {"F3", "Dedicated transceiver advisory"}, + {"H1", "Message to/from terminal"}, // avionic or airborne subsystem - See table C-2A for sub-label + {"H2", "Meteorological report"}, + {"H3", "Icing report"}, + {"H4", "Meteorological configuration report"}, + {"HF", "HFDL messages"}, // Not in ARINC 620 + {"HX", "Undelivered uplink report"}, + {"KB", "Loopback response"}, + {"LB", "Cabin e-logbook"}, + {"LC", "Cabin e-logbook"}, + {"LS", "Techincal (cockpit) e-logbook"}, + {"LT", "Technical (cockpit) e-logbook"}, + {"M1", "IATA departure message"}, // Not in ARINC 620 + {"M2", "IATA arrival message"}, // Not in ARINC 620 + {"M3", "IATA return to ramp message"}, // Not in ARINC 620 + {"M4", "IATA return from airborne message"}, // Not in ARINC 620 + // P0-P6 and PA-PC are protected using ACARS Message Security + {"Q0", "Link test"}, + {"Q1", "Departure / Arrival report"}, + {"Q2", "ETA report"}, + {"Q3", "Clock update advisory"}, + {"Q4", "Voice circuit busy"}, + {"Q5", "Unable to deliver uplink messages"}, + {"Q6", "Voice to data channel changeover advisory"}, + {"Q7", "Delay message"}, + {"QA", "Out / Fuel report"}, + {"QB", "Off report"}, + {"QC", "On report"}, + {"QD", "In / Fuel report"}, + {"QE", "Out / Fuel destination report"}, + {"QF", "Off / Fuel destination report"}, + {"QG", "Out / Return in report"}, + {"QH", "Out report"}, + {"QK", "Landing report"}, + {"QL", "Arrival report"}, + {"QM", "Arrival information report"}, + {"QN", "Diversion report"}, + {"QP", "Out report"}, + {"QQ", "Off report"}, + {"QR", "On report"}, + {"QS", "In report"}, + {"QT", "Out/return in report"}, + {"QV", "Autotune reject"}, + {"QX", "Intercept/unable to process"}, + {"RA", "Command / response uplink"}, + {"RB", "Command / response downlink"}, + {"RE", "Refuel - Administrative and general purpose"}, + {"RF", "Refuel - CG targeting"}, + {"S1", "VHF network statistics report"}, + {"S2", "VHF network performance report"}, + {"S3", "LRU configuration report"}, + {"SA", "Media advisory"}, + {"SQ", "Squitter"}, + {"TE", "Turbulence event report"}, + {"UP", "Message acknowledgement"}, // Not in ARINC 620 + // VA-VZ are supplier defined messages + {"WP", "Potable water remote pre-selection downlinks"}, + // X1-X9 are DSP (Datalink Service Provider) defined + {"X1", "DSP defined"}, + {"X2", "DSP defined"}, + {"X3", "DSP defined"}, + {"X4", "DSP defined"}, + {"X5", "DSP defined"}, + {"X6", "DSP defined"}, + {"X7", "DSP defined"}, + {"X8", "DSP defined"}, + {"X9", "DSP defined"} +}; + +QHash AcarsDemodWorker::m_subLabels = { + // 10 to 4~ are user defined so will vary with airline - added in constructor + {"A1", "ADS Unit (ADSU), left"}, // ARINC 622 + {"A2", "ADS Unit (ADSU), right"}, // ARINC 622 + {"AD", "ADS Unit (ADSU), selected"}, // ARINC 622 + {"CF", "Central fault display"}, + {"DF", "Digital flight data acquisition unit"}, + {"EC", "Engine display system"}, + {"EI", "Engine indicating system"}, + {"F1", "Electronic flight bag #1"}, + {"F2", "Electronic flight bag #2"}, + {"H1", "HF data radio, left"}, + {"H2", "HF data radio, right"}, + {"HD", "HF data radio, selected"}, + {"M1", "Flight management computer (FMC), left"}, + {"M2", "Flight management computer (FMC), right"}, + {"M3", "Flight management computer (FMC), center"}, + {"MD", "Flight management computer (FMC), selected"}, + {"OA", "Onboard airport navigation system"}, + {"PS", "Keyboard/Display unit"}, + {"S1", "Satellite data unit (SDU), left"}, + {"S2", "Satellite data unit (SDU), right"}, + {"SD", "Satellite data unit (SDU), selected"}, + {"T0", "All cabin terminals"}, + {"T1", "Cabin terminal 1"}, + {"T2", "Cabin terminal 2"}, + {"T3", "Cabin terminal 3"}, + {"T4", "Cabin terminal 4"}, + {"T5", "Cabin terminal"}, + {"T6", "Cabin terminal"}, + {"T7", "Cabin terminal"}, + {"T8", "Cabin terminal"}, + {"TA", "TCAS/Traffic computer"}, + {"WO", "Weather observation report"}, +}; + +QHash AcarsDemodWorker::m_originators = { + {"1", "Cabin terminal 1"}, + {"2", "Cabin terminal 2"}, + {"3", "Cabin terminal 3"}, + {"4", "Cabin terminal 4"}, + {"5", "User terminal"}, + {"6", "User terminal"}, + {"7", "User terminal"}, + {"8", "User terminal"}, + {"A", "TCAS"}, + {"C", "CFDIU"}, + {"D", "DFDAU"}, + {"E", "EICAS/ECAM/EFIS"}, + {"F", "FMC"}, + {"J", "ATSU/ADSU"}, + {"L", "CMU (ATS)"}, + {"M", "CMD (AOC)"}, + {"O", "OAT"}, + {"Q", "SDU"}, + {"S", "System control"}, + {"T", "HF data radio"}, + {"U", "User defined"}, + {"Y", "EFB, left"}, + {"Z", "EFB, right"} +}; + +// The vendored ground station list is Windows-1252, not UTF-8. A degree sign there is +// the single byte 0xB0, which is not valid UTF-8, so reading it as UTF-8 turned every +// one in to a replacement character - and coordRe below looks for U+00B0, so it never +// matched and NO ground station ever got a position out of the file. Upstream could +// change, so take UTF-8 when the bytes really are UTF-8 and fall back when they are not. +static QString decodeVdl2Gs(const QByteArray& raw) +{ + const QString utf8 = QString::fromUtf8(raw); + if (!utf8.contains(QChar::ReplacementCharacter)) { + return utf8; + } + + // Windows-1252 is Latin-1 except for 0x80-0x9F, where Latin-1 has C1 control codes. + // Qt 6 dropped QTextCodec, so that range is mapped by hand. The list uses 0x96, an + // en dash, as well as 0xB0. + static const ushort cp1252[32] = { + 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, + 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178 + }; + QString text = QString::fromLatin1(raw); + for (int i = 0; i < text.size(); i++) + { + const ushort u = text.at(i).unicode(); + if ((u >= 0x80) && (u <= 0x9F)) { + text[i] = QChar(cp1252[u - 0x80]); + } + } + return text; +} + +// The community VDL-2 ground station list (vendored from +// https://sdrangel.org/downloads/VDL2_Ground_Stations.txt), mapping 24-bit +// addresses to names, cities and (where listed) coordinates +void AcarsDemodWorker::loadVdl2Gs() +{ + QFile file(":/vdl2gs.txt"); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + qDebug() << "AcarsDemodWorker::loadVdl2Gs: Failed to open vdl2gs.txt"; + return; + } + QRegularExpression lineRe(R"(^([0-9A-Fa-f]{6}) \[([^\]]*)\] \[([^\]]*)\])"); + QRegularExpression coordRe(QString::fromUtf8(R"((\d+)\x{00b0}(\d+)'([NS]) (\d+)\x{00b0}(\d+)'([EW]))")); + const QStringList lines = decodeVdl2Gs(file.readAll()).split('\n'); + for (const QString& line : lines) + { + QRegularExpressionMatch match = lineRe.match(line); + if (!match.hasMatch()) { + continue; + } + Vdl2GsInfo gs; + QString name = match.captured(2); + gs.m_city = match.captured(3); + QRegularExpressionMatch coord = coordRe.match(name); + if (coord.hasMatch()) + { + gs.m_hasPosition = true; + gs.m_latitude = (coord.captured(1).toFloat() + coord.captured(2).toFloat() / 60.0f) + * (coord.captured(3) == "S" ? -1.0f : 1.0f); + gs.m_longitude = (coord.captured(4).toFloat() + coord.captured(5).toFloat() / 60.0f) + * (coord.captured(6) == "W" ? -1.0f : 1.0f); + name = name.left(coord.capturedStart()).trimmed(); + } + // Strip a trailing frequency from the name (e.g. "KJFK Kennedy Intl 136.100") + name.remove(QRegularExpression(R"(\s+\d{3}\.\d{3}\s*$)")); + gs.m_name = name.trimmed(); + m_vdl2Gs.insert(match.captured(1).toUInt(nullptr, 16), gs); + } + qDebug() << "AcarsDemodWorker::loadVdl2Gs: loaded" << m_vdl2Gs.size() << "ground stations"; +} + +// Decode a VDL-2 AVLC frame that is not an ACARS message (ACARS messages arrive +// via processAcarsMessage like VHF ACARS): the frame summary, the ATN subnetwork +// for information frames and the XID/GSIF link management parameters +void AcarsDemodWorker::processVdl2Frame(const AcarsVdl2Receiver::Frame& frame, QDateTime received) +{ + AcarsRowEvent e; + e.m_frameType = 1; + e.m_received = received; + e.m_uplink = !frame.m_fromAircraft; + + // Record the transmitting aircraft as active for the GUI's chart + if (frame.m_fromAircraft) { + e.m_chartAircraftId = QString("%1").arg(frame.m_srcAddress, 6, 16, QChar('0')).toUpper(); + } + + QString type(frame.m_frameType); + + // Supervisory and link management responses flood the table during data + // transfers; the GUI hides them by default + static const QStringList noInfoTypes = {"RR", "RNR", "REJ", "SREJ", "DM", "DISC", "UA", "FRMR", "U"}; + e.m_noInfo = noInfoTypes.contains(type); + + // The aircraft side of the link in the Registration column: the registration looked + // up from the 24-bit ICAO address via the OpenSky database, or the address itself in + // hex when it is not in the database + auto addressText = [this](uint32_t address, int type) + { + QString hex = QString("%1").arg(address, 6, 16, QChar('0')).toUpper(); + switch (type) + { + case 1: // Aircraft + if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) address)) + { + QString registration = m_aircraftInfoByIcao->value((int) address)->m_registration; + if (!registration.isEmpty()) { + return registration; + } + } + return hex; + case 4: + case 5: // Ground station: name from the community list + if (m_vdl2Gs.contains(address)) { + return QString("GS %1 (%2)").arg(hex).arg(m_vdl2Gs.value(address).m_name); + } + return QString("GS %1").arg(hex); + case 7: return QString("All"); + default: return hex; + } + }; + + // A known ground station's coordinates fill the position columns, arming the + // Map checkbox (which places it as a fixed antenna, like HFDL squitters) + { + uint32_t gsAddress = frame.m_fromAircraft ? frame.m_dstAddress : frame.m_srcAddress; + int gsType = frame.m_fromAircraft ? frame.m_dstType : frame.m_srcType; + if (((gsType == 4) || (gsType == 5)) && m_vdl2Gs.contains(gsAddress)) + { + const Vdl2GsInfo& gs = m_vdl2Gs.value(gsAddress); + if (gs.m_hasPosition) + { + e.m_hasPosition = true; + e.m_latitude = gs.m_latitude; + e.m_longitude = gs.m_longitude; + } + } + } + if (frame.m_fromAircraft) { + e.m_address = addressText(frame.m_srcAddress, frame.m_srcType); + } else { + e.m_address = addressText(frame.m_dstAddress, frame.m_dstType); + } + + e.m_protocol = "VDL-2"; + e.m_bitRate = 31500; + e.m_label = type; + e.m_labelDecode = avlcFrameTypeName(frame.m_frameType); + + QString text = QString("%1 %2 %3") + .arg(addressText(frame.m_srcAddress, frame.m_srcType)) + .arg(QChar(0x2192)) // Right arrow + .arg(addressText(frame.m_dstAddress, frame.m_dstType)); + + // One sighting for the Aircraft feature: the aircraft side of the link, + // identified by its 24-bit ICAO address + AircraftReport report; + report.m_received = received; + report.m_uplink = !frame.m_fromAircraft; + { + uint32_t acAddress = frame.m_fromAircraft ? frame.m_srcAddress : frame.m_dstAddress; + int acType = frame.m_fromAircraft ? frame.m_srcType : frame.m_dstType; + if (acType == 1) + { + report.m_icao = acAddress; + if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) acAddress)) { + report.m_registration = m_aircraftInfoByIcao->value((int) acAddress)->m_registration; + } + } + uint32_t gsAddress = frame.m_fromAircraft ? frame.m_dstAddress : frame.m_srcAddress; + int gsType = frame.m_fromAircraft ? frame.m_dstType : frame.m_srcType; + if ((gsType == 4) || (gsType == 5)) + { + // Short form: the airport code from the ground station list rather + // than the full name/location, falling back to the hex address + if (m_vdl2Gs.contains(gsAddress) && !m_vdl2Gs.value(gsAddress).m_name.isEmpty()) { + report.m_station = QString("GS %1").arg(m_vdl2Gs.value(gsAddress).m_name.section(' ', 0, 0)); + } else { + report.m_station = QString("GS %1").arg(QString("%1").arg(gsAddress, 6, 16, QChar('0')).toUpper()); + } + + // The Mode columns say which ground station the frame used, in the same form + // the Message column shows it. The community list names them "EGLC London + // City UK", of which the first word is the ICAO code. + e.m_mode = QString("%1").arg(gsAddress, 6, 16, QChar('0')).toUpper(); + const Vdl2GsInfo& gs = m_vdl2Gs.value(gsAddress); + e.m_modeDecode = gs.m_name.section(' ', 0, 0); + e.m_gsHasPosition = gs.m_hasPosition; + e.m_gsLatitude = gs.m_latitude; + e.m_gsLongitude = gs.m_longitude; + } + } + + // Information frames carry the ATN subnetwork: X.25, CLNP, COTP and the ICAO + // applications (CM logons, CPDLC, ADS-C v2). XID frames carry link management + // parameters, including the GSIF ground station broadcasts. + bool isInfoFrame = (type == "I") || (type == "UI"); + if ((isInfoFrame || (type == "XID")) && (frame.m_infoLength > 0)) + { + QByteArray info((const char *) frame.m_bytes.data() + frame.m_infoOffset, frame.m_infoLength); + Vdl2AtnDecoder::Result atn; + + if (isInfoFrame) + { + atn = m_atnDecoder.decode(info, frame.m_srcAddress, frame.m_dstAddress, frame.m_fromAircraft); + } + else + { + bool pf = (frame.m_bytes[8] >> 4) & 0x1; // Control field P/F bit + atn = m_atnDecoder.decodeXid(info, frame.m_srcStatus, pf); + } + + text.append(QString(" %1").arg(atn.m_summary)); + + if (!atn.m_decoded.isEmpty()) + { + e.m_textDecode = QString(atn.m_decoded).replace('\n', "; "); + e.m_fullDecode = atn.m_decoded; + // Only the decode view reads the HTML + if (hasGui()) { + e.m_viewDecodeHtml = acarsDecodeToHtml(atn.m_decoded); + } + } + // Left blank for CPDLC messages with no message data (e.g. an ACSE release + // wrapping an empty PDU) + if (atn.m_isCpdlc && !atn.m_atc.isEmpty()) { + e.m_atc = atn.m_atc; + } + if (atn.m_hasPosition) + { + // From an XID aircraft (or ground station) location parameter. The resolution + // is coarse: 0.1 degrees and 1000 ft. + e.m_hasPosition = true; + e.m_latitude = atn.m_latitude; + e.m_longitude = atn.m_longitude; + if (atn.m_hasAltitude) + { + e.m_hasAltitude = true; + e.m_altitudeFt = atn.m_altitudeFt; + } + // A downlinked location is the aircraft's own position + if (frame.m_fromAircraft) + { + report.m_positionValid = true; + report.m_latitude = atn.m_latitude; + report.m_longitude = atn.m_longitude; + if (atn.m_hasAltitude) + { + report.m_altitudeValid = true; + report.m_altitudeFt = atn.m_altitudeFt; + } + } + } + report.m_documentText = atn.m_decoded; + if (atn.m_isCpdlc) + { + report.m_documentKind = AircraftReport::Cpdlc; + report.m_atc = atn.m_atc; + } + else if (type == "XID") + { + report.m_documentKind = AircraftReport::Logon; + // Only from the aircraft: a ground station's XID describes the ground + // station, and an uplink carrying this parameter would not be stating where + // THIS aircraft is going. + if (frame.m_fromAircraft && !atn.m_destinationAirport.isEmpty()) { + report.m_arrival = atn.m_destinationAirport; + } + } + } + else if (frame.m_infoLength > 0) + { + text.append(QString(" (%1 bytes)").arg(frame.m_infoLength)); + } + e.m_text = text.trimmed(); + + QByteArray bytes((const char *) frame.m_bytes.data(), (int) frame.m_bytes.size()); + e.m_hex = bytes.toHex(); + + // Report identified aircraft to the Aircraft feature. ACARS-over-AVLC frames + // are reported from processAcarsMessage instead, with their decoded content. + if (report.m_icao) + { + report.m_label = type; + sendAircraftReport(report); + } + + emit rowReady(e); +} + +// Decode an HFDL LPDU or SPDU that is not an ACARS message: logons, squitters +// and the embedded HFNPDU performance/frequency reports +// One Aero signal unit that is not an ACARS message: log-on and log-off exchanges, +// channel control and assignment, acknowledgements and the system table broadcasts. +// ACARS blocks never come here - they are reassembled inside the receiver and pushed as +// MainCore::MsgPacket, so they take the same path as every other protocol's. +void AcarsDemodWorker::processAeroFrame(const AcarsAeroReceiver::Frame& frame, QDateTime received) +{ + AcarsRowEvent e; + e.m_frameType = 3; + e.m_received = received; + e.m_uplink = frame.m_uplink; + + AircraftReport report; + report.m_received = received; + report.m_uplink = frame.m_uplink; + + // The AES ID is the aircraft's ICAO 24 bit address, so the same registration lookup + // the HFDL and VDL-2 paths use applies directly. (Confirmed off air: AES 78016E + // resolves to B-HNF, which the ACARS block in the same recording also names.) + QString address; + if (frame.m_aesId) + { + QString hex = QString("%1").arg(frame.m_aesId, 6, 16, QChar('0')).toUpper(); + address = hex; + report.m_icao = frame.m_aesId; + if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) frame.m_aesId)) + { + QString registration = m_aircraftInfoByIcao->value((int) frame.m_aesId)->m_registration; + if (!registration.isEmpty()) + { + address = registration; + report.m_registration = registration; + } + } + // Only a downlink proves the aircraft transmitted; a ground station addressing + // an aircraft still counts as a sighting but not as an active transmitter for + // the GUI's aircraft-seen chart + if (!frame.m_uplink) { + e.m_chartAircraftId = hex; + } + } + e.m_address = address; + + static const char *channelNames[] = { "P", "R", "T" }; + const char *channel = ((frame.m_channel >= 0) && (frame.m_channel <= AcarsAeroReceiver::ChannelT)) + ? channelNames[frame.m_channel] : "?"; + e.m_protocol = QString("Aero %1").arg(channel); + e.m_bitRate = frame.m_bitRate; + // The signal unit type octet is the label; what it means is the decode + e.m_label = frame.m_bytes.empty() ? QString() + : QString("%1").arg(frame.m_bytes[0], 2, 16, QChar('0')).toUpper(); + e.m_labelDecode = QString::fromStdString(frame.m_type); + + // A signal unit with neither address is a broadcast - the system and EIRP tables + // describe the satellite and its beams rather than talking to any one aircraft. It + // used to render as "GES 00 -> AES", which is two placeholders and a zero pretending + // to be a conversation + // As hexadecimal, which is how the Message column has always shown it. The decode + // names the satellite and region rather than the station - see gesName(). + if (frame.m_gesId) + { + e.m_mode = QString("%1").arg(frame.m_gesId, 2, 16, QChar('0')).toUpper(); + const char *ges = AcarsAeroReceiver::gesName(frame.m_gesId); + e.m_modeDecode = ges ? QString(ges) : QString(); + } + + if (!frame.m_aesId && !frame.m_gesId) + { + e.m_text = "Broadcast"; + } + else + { + QString gesText = QString("GES %1").arg(frame.m_gesId, 2, 16, QChar('0')).toUpper(); + if (frame.m_uplink) { + e.m_text = QString("%1 %2 %3").arg(gesText).arg(QChar(0x2192)).arg(address.isEmpty() ? QString("AES") : address); + } else { + e.m_text = QString("%1 %2 %3").arg(address.isEmpty() ? QString("AES") : address).arg(QChar(0x2192)).arg(gesText); + } + } + + QStringList decode; + const std::vector& b = frame.m_bytes; + uint8_t type = b.empty() ? 0 : b[0]; + + // Satellite housekeeping, which the GUI hides by default. Classified here rather + // than from the "Broadcast" text above, because a broadcast is a consequence of + // carrying no address and not the same question as carrying no information + e.m_noInfo = AcarsAeroReceiver::suIsNoInfo(type); + + switch (type) + { + case AcarsAeroReceiver::SuCChannelDistress: + case AcarsAeroReceiver::SuCChannelFlightSafety: + case AcarsAeroReceiver::SuCChannelOtherSafety: + case AcarsAeroReceiver::SuCChannelNonSafety: + // A voice channel assignment names the pair of L band frequencies the call will + // use, as 15 bit channel numbers with bit 15 flagging a spot beam + if (b.size() >= 10) + { + int rxChannel = ((b[6] & 0x7F) << 8) | b[7]; + int txChannel = ((b[8] & 0x7F) << 8) | b[9]; + decode.append(QString("Receive %1 MHz (%2)") + .arg(AcarsAeroReceiver::cChannelReceiveMHz(rxChannel), 0, 'f', 4) + .arg((b[6] & 0x80) ? "spot beam" : "global beam")); + decode.append(QString("Transmit %1 MHz (%2)") + .arg(AcarsAeroReceiver::cChannelTransmitMHz(txChannel), 0, 'f', 4) + .arg((b[8] & 0x80) ? "spot beam" : "global beam")); + } + break; + + case AcarsAeroReceiver::SuLogOnRequest: + case AcarsAeroReceiver::SuLogOnConfirm: + case AcarsAeroReceiver::SuLogOffRequest: + case AcarsAeroReceiver::SuLogOnReject: + case AcarsAeroReceiver::SuLogOnInterrogation: + case AcarsAeroReceiver::SuLogOnOffAcknowledge: + case AcarsAeroReceiver::SuLogOnPrompt: + case AcarsAeroReceiver::SuDataChannelReassignment: + report.m_documentKind = AircraftReport::Logon; + break; + + default: + break; + } + + if (frame.m_gesId) { + report.m_station = QString("GES %1").arg(frame.m_gesId, 2, 16, QChar('0')).toUpper(); + } + + e.m_textDecode = decode.join("; "); + e.m_fullDecode = decode.join("\n"); + // m_fullDecode is functional - it becomes AircraftReport::m_documentText - but the + // HTML rendering of it is only ever read by the decode view + if (hasGui()) { + e.m_viewDecodeHtml = acarsDecodeToHtml(e.m_fullDecode); + } + + QByteArray bytes((const char *) b.data(), (int) b.size()); + e.m_hex = bytes.toHex(); + + // Report identified aircraft to the Aircraft feature. Signal units that name no + // aircraft - system tables, channel control - are shown in the table but are not + // sightings of anything. + if (report.m_icao || !report.m_registration.isEmpty()) + { + report.m_label = QString::fromStdString(frame.m_type); + report.m_documentText = e.m_fullDecode; + sendAircraftReport(report); + } + + emit rowReady(e); +} + +void AcarsDemodWorker::processHfdlFrame(const AcarsHfdlReceiver::Frame& frame, QDateTime received) +{ + AcarsRowEvent e; + e.m_frameType = 2; + e.m_received = received; + e.m_uplink = frame.m_uplink; + + // Logon LPDUs carry the aircraft's 24 bit ICAO address, which gives the + // registration via the OpenSky database and feeds the aircraft-seen chart + uint32_t icao = 0; + static const QList logonTypes = { 0x2F, 0x3F, 0x4F, 0x5F, 0x8F, 0x9F, 0xBF }; + if ((frame.m_bytes.size() >= 4) && logonTypes.contains(frame.m_bytes[0])) { + icao = AcarsHfdlReceiver::parseIcao(frame.m_bytes.data() + 1); + } + if (icao && !frame.m_uplink) { + e.m_chartAircraftId = QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); + } + + // The 8-bit HFDL aircraft ID is assigned by the ground station at logon; 255 + // means no ID assigned yet - the aircraft is logging on + auto acText = [](uint32_t id) + { + return id == 255 ? QString("Unidentified") : QString("AC %1").arg(id); + }; + + // One sighting for the Aircraft feature, filled in as the frame decodes. Only + // frames that identify the airframe (an ICAO address from a logon) or carry a + // flight identity are reported - the 8-bit "AC n" link IDs are not durable + // identities an aircraft can be collated under. + AircraftReport report; + report.m_received = received; + report.m_uplink = frame.m_uplink; + + // Registration from the ICAO address when a logon carries one, otherwise the + // 8-bit HFDL aircraft/ground station IDs from the MPDU header + QString address; + if (icao) + { + QString hex = QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); + address = hex; + report.m_icao = icao; + report.m_documentKind = AircraftReport::Logon; + if (m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) icao)) + { + QString registration = m_aircraftInfoByIcao->value((int) icao)->m_registration; + if (!registration.isEmpty()) + { + address = registration; + report.m_registration = registration; + } + } + } + else if (frame.m_type == "Squitter") + { + address = QString("GS %1").arg(frame.m_srcId); + } + else if (frame.m_uplink) + { + address = acText(frame.m_dstId); + } + else + { + address = acText(frame.m_srcId); + } + e.m_address = address; + + // Logon requests carry the flight identity as 6 characters at offset 6, space + // padded for shorter callsigns. The following byte belongs to a varying field + // that can happen to be printable (it showed up as bogus trailing characters, + // often lowercase), so only callsign characters are accepted and the first + // non-callsign byte ends the field. + if ((frame.m_bytes.size() >= 12) && icao) + { + QString flight; + for (int i = 6; i < 12; i++) + { + char ch = (char) frame.m_bytes[i]; + if (((ch >= 'A') && (ch <= 'Z')) || ((ch >= '0') && (ch <= '9')) || (ch == ' ')) { + flight.append(ch); + } else { + break; + } + } + e.m_flight = flight.trimmed(); + report.m_flight = flight.trimmed(); + } + + e.m_protocol = "HFDL"; + e.m_bitRate = frame.m_bitRate; + if (frame.m_isSquitter) + { + // A squitter is not an LPDU and has no type octet to put in the label + e.m_label = "Squitter"; + e.m_labelDecode = "Ground station frequency broadcast"; + } + else + { + e.m_label = QString("%1").arg(frame.m_typeId, 2, 16, QChar('0')).toUpper(); + e.m_labelDecode = QString::fromStdString(frame.m_type); + } + + // The ground station side of the link, decoded from the system table ID + uint32_t gsId = (frame.m_uplink || (frame.m_type == "Squitter")) ? frame.m_srcId : frame.m_dstId; + const char *gsStation = AcarsHfdlReceiver::gsName(gsId); + if (gsStation) { + report.m_station = QString(gsStation).section(',', 0, 0); + } else if (gsId) { + report.m_station = QString("GS %1").arg(gsId); + } + + // The station is what the Mode columns are for. gsName gives "Shannon, Ireland"; + // the town alone is what fits, and the country is in the Message column anyway. + if (gsId) + { + e.m_mode = QString::number(gsId); + e.m_modeDecode = gsStation ? QString(gsStation).section(',', 0, 0) : QString(); + + double gsLatitude, gsLongitude; + if (AcarsHfdlReceiver::gsPosition(gsId, gsLatitude, gsLongitude)) + { + e.m_gsHasPosition = true; + e.m_gsLatitude = (float) gsLatitude; + e.m_gsLongitude = (float) gsLongitude; + } + } + + QString text; + QString decode; + if (frame.m_type == "Squitter") + { + text = QString("Squitter from GS %1").arg(frame.m_srcId); + decode = QString("From %1").arg(gsStation ? gsStation : QString("GS %1").arg(gsId)); + + // The squitter's position is the transmitting ground station itself, from the + // system table: filling the position columns arms the Map checkbox, and the + // "GS" address makes it a fixed antenna icon rather than an aircraft + double gsLat, gsLon; + if (AcarsHfdlReceiver::gsPosition(frame.m_srcId, gsLat, gsLon)) + { + e.m_hasPosition = true; + e.m_latitude = gsLat; + e.m_longitude = gsLon; + } + + AcarsHfdlReceiver::SquitterInfo sq; + if (AcarsHfdlReceiver::parseSquitter(frame.m_bytes, sq)) + { + decode.append(QString("; frame %1.%2; systable v%3") + .arg(sq.m_frameIndex).arg(sq.m_frameOffset).arg(sq.m_systableVersion)); + const char *note = AcarsHfdlReceiver::squitterChangeNote(sq.m_changeNote); + if (note) { + decode.append(QString("; %1").arg(note)); + } + if (sq.m_rls) { + decode.append("; RLS"); + } + // The transmitting station's status plus up to two neighbours; the + // frequency sets are bitmasks into each station's system table + // frequency list, decoded here to kHz + for (const auto& gs : sq.m_gs) + { + if (gs.m_id == 0) { + continue; + } + QStringList freqs; + int freqCount = 0; + const uint16_t *freqList = AcarsHfdlReceiver::gsFrequencies(gs.m_id, &freqCount); + for (int bit = 0; bit < 20; bit++) + { + if ((gs.m_freqsInUse >> bit) & 1) + { + if (freqList && (bit < freqCount)) { + freqs.append(QString::number(freqList[bit])); + } else { + freqs.append(QString("bit%1").arg(bit)); + } + } + } + decode.append(QString("; GS %1%2 on %3") + .arg(gs.m_id) + .arg(gs.m_utcSync ? "" : " (no UTC)") + .arg(freqs.isEmpty() ? "no frequencies" : freqs.join(", ") + " kHz")); + } + // Each station's announced frequencies for the GUI's ground station + // table dialog - one squitter reports up to three stations + for (const auto& gs : sq.m_gs) + { + if (gs.m_id == 0) { + continue; + } + int freqCount = 0; + const uint16_t *freqList = AcarsHfdlReceiver::gsFrequencies(gs.m_id, &freqCount); + QList heard; + for (int bit = 0; (bit < 20) && freqList; bit++) + { + if (((gs.m_freqsInUse >> bit) & 1) && (bit < freqCount)) { + heard.append(freqList[bit]); + } + } + e.m_gsHeardIds.append((int) gs.m_id); + e.m_gsHeardFreqs.append(heard); + } + } + } + else if (frame.m_uplink) + { + text = QString("GS %1 %2 %3").arg(frame.m_srcId).arg(QChar(0x2192)).arg(acText(frame.m_dstId)); + decode = QString("From %1").arg(gsStation ? gsStation : QString("GS %1").arg(gsId)); + } + else + { + text = QString("%1 %2 GS %3").arg(acText(frame.m_srcId)).arg(QChar(0x2192)).arg(frame.m_dstId); + decode = QString("To %1").arg(gsStation ? gsStation : QString("GS %1").arg(gsId)); + } + + // Embedded HFNPDUs: performance data (FF D1) in unnumbered data LPDUs and + // frequency data (FF D5) inside logon requests and resumes. Both carry the + // flight identity and the aircraft's position, which fills the position + // columns and arms the Map checkbox. + if (frame.m_type != "Squitter") + { + // A ground station's frequency-list bitmask rendered as kHz, as for squitters + auto freqMaskText = [](uint32_t gsId, uint32_t mask) + { + QStringList freqs; + int freqCount = 0; + const uint16_t *freqList = AcarsHfdlReceiver::gsFrequencies(gsId, &freqCount); + for (int bit = 0; bit < 20; bit++) + { + if ((mask >> bit) & 1) + { + if (freqList && (bit < freqCount)) { + freqs.append(QString::number(freqList[bit])); + } else { + freqs.append(QString("bit%1").arg(bit)); + } + } + } + return freqs.isEmpty() ? QString("none") : freqs.join(", ") + " kHz"; + }; + auto positionText = [](double latitude, double longitude, int utcSeconds) + { + return QString("%1%2 %3%4 at %5z") + .arg(std::abs(latitude), 0, 'f', 4).arg(latitude < 0.0 ? "S" : "N") + .arg(std::abs(longitude), 0, 'f', 4).arg(longitude < 0.0 ? "W" : "E") + .arg(QTime(0, 0).addSecs(utcSeconds).toString("hh:mm:ss")); + }; + auto setFlightAndPosition = [&](const std::string& flightId, double latitude, double longitude, int utcSeconds) + { + QString flight = QString::fromStdString(flightId).trimmed(); + if (!flight.isEmpty() && e.m_flight.isEmpty()) { + e.m_flight = flight; + } + if (!flight.isEmpty() && report.m_flight.isEmpty()) { + report.m_flight = flight; + } + report.m_documentKind = AircraftReport::PerformanceReport; + // Aircraft without a position feed report the all-ones sentinel, which + // decodes as 180/180 - any latitude beyond 90 marks it unavailable + if (std::abs(latitude) > 90.0) { + return; + } + e.m_hasPosition = true; + e.m_latitude = latitude; + e.m_longitude = longitude; + + // Aircraft dump their STORED performance log too - one record per past + // ground station association, hours old (seen live: a burst carrying + // reports from three flight legs back). Only a report timestamped close + // to now is the aircraft's current position, so only that goes to the + // Map; stale reports still fill the row's position columns. "Now" is the + // wall clock OR the newest report time seen, so replayed recordings + // (whose reports are all hours old against the wall clock but mutually + // consistent) still reach the Map. + auto circAge = [](int a, int b) + { + int d = a - b; + while (d > 43200) { d -= 86400; } + while (d < -43200) { d += 86400; } + return d; + }; + int nowSeconds = received.toUTC().time().msecsSinceStartOfDay() / 1000; + bool fresh = std::abs(circAge(nowSeconds, utcSeconds)) <= 600; + if (!fresh && (m_hfdlNewestReportSecs >= 0)) { + // Not older than 10 minutes behind the newest report seen + fresh = circAge(utcSeconds, m_hfdlNewestReportSecs) >= -600; + } + if ((m_hfdlNewestReportSecs < 0) + || (circAge(utcSeconds, m_hfdlNewestReportSecs) > 0)) { + m_hfdlNewestReportSecs = utcSeconds; + } + if (!fresh) { + return; + } + + // A fresh position goes into the report for the Aircraft feature, + // stamped with the report's own UTC time of day mapped to the nearest + // day around reception + report.m_positionValid = true; + report.m_latitude = (float) latitude; + report.m_longitude = (float) longitude; + QDateTime dayStart = received.toUTC(); + dayStart.setTime(QTime(0, 0)); + QDateTime posTime = dayStart.addSecs(utcSeconds); + const qint64 halfDay = 12 * 3600; + if (posTime.secsTo(received.toUTC()) > halfDay) { + posTime = posTime.addDays(1); + } else if (received.toUTC().secsTo(posTime) > halfDay) { + posTime = posTime.addDays(-1); + } + report.m_positionDateTime = posTime; + }; + + AcarsHfdlReceiver::PerfDataInfo perf; + AcarsHfdlReceiver::FreqDataInfo freqData; + if (AcarsHfdlReceiver::parsePerfData(frame.m_bytes, perf)) + { + decode.append(QString("; Performance data: %1 %2; v%3 leg %4; GS %5 freq %6") + .arg(QString::fromStdString(perf.m_flightId).trimmed()) + .arg(positionText(perf.m_latitude, perf.m_longitude, perf.m_utcSeconds)) + .arg(perf.m_version).arg(perf.m_flightLeg) + .arg(perf.m_gsId).arg(perf.m_freqId)); + decode.append(QString("; freq searches %1/%2; HF off %3/%4 s (prev/cur)") + .arg(perf.m_prevFreqSearches).arg(perf.m_curFreqSearches) + .arg(perf.m_prevHfDisabledSecs).arg(perf.m_curHfDisabledSecs)); + decode.append(QString("; MPDUs rx %1/%2/%3/%4 errs %5/%6/%7/%8, tx %9/%10/%11/%12, delivered %13/%14/%15/%16 (1800/1200/600/300 bps)") + .arg(perf.m_mpdusRx[0]).arg(perf.m_mpdusRx[1]).arg(perf.m_mpdusRx[2]).arg(perf.m_mpdusRx[3]) + .arg(perf.m_mpdusRxErrs[0]).arg(perf.m_mpdusRxErrs[1]).arg(perf.m_mpdusRxErrs[2]).arg(perf.m_mpdusRxErrs[3]) + .arg(perf.m_mpdusTx[0]).arg(perf.m_mpdusTx[1]).arg(perf.m_mpdusTx[2]).arg(perf.m_mpdusTx[3]) + .arg(perf.m_mpdusDelivered[0]).arg(perf.m_mpdusDelivered[1]).arg(perf.m_mpdusDelivered[2]).arg(perf.m_mpdusDelivered[3])); + decode.append(QString("; SPDUs rx %1 errs %2; freq change %3") + .arg(perf.m_spdusRx).arg(perf.m_spdusRxErrs).arg(perf.m_freqChangeCode)); + setFlightAndPosition(perf.m_flightId, perf.m_latitude, perf.m_longitude, perf.m_utcSeconds); + } + else if (AcarsHfdlReceiver::parseFreqData(frame.m_bytes, freqData)) + { + decode.append(QString("; Frequency data: %1 %2") + .arg(QString::fromStdString(freqData.m_flightId).trimmed()) + .arg(positionText(freqData.m_latitude, freqData.m_longitude, freqData.m_utcSeconds))); + for (const auto& pf : freqData.m_gs) + { + if (pf.m_gsId == 0) { + continue; + } + const char *name = AcarsHfdlReceiver::gsName(pf.m_gsId); + decode.append(QString("; GS %1%2: propagating %3, tuned %4") + .arg(pf.m_gsId) + .arg(name ? QString(" (%1)").arg(QString(name).section(',', 0, 0)) : QString()) + .arg(freqMaskText(pf.m_gsId, pf.m_propagating)) + .arg(freqMaskText(pf.m_gsId, pf.m_tuned))); + } + setFlightAndPosition(freqData.m_flightId, freqData.m_latitude, freqData.m_longitude, freqData.m_utcSeconds); + } + } + + e.m_text = text; + e.m_textDecode = decode; + // The column keeps the single semicolon-separated line; the decode view and the + // Map popup get the multi-line form + e.m_fullDecode = QString(decode).replace("; ", "\n"); + // Only the decode view reads the HTML + if (hasGui()) { + e.m_viewDecodeHtml = acarsDecodeToHtml(e.m_fullDecode); + } + + QByteArray bytes((const char *) frame.m_bytes.data(), (int) frame.m_bytes.size()); + e.m_hex = bytes.toHex(); + + // Report identified aircraft to the Aircraft feature + if (report.m_icao || !report.m_registration.isEmpty() || !report.m_flight.isEmpty()) + { + report.m_label = QString::fromStdString(frame.m_type); + report.m_documentText = e.m_fullDecode; + sendAircraftReport(report); + } + + emit rowReady(e); +} diff --git a/plugins/channelrx/demodacars/acarsdemodworker.h b/plugins/channelrx/demodacars/acarsdemodworker.h index 5429daa5f..20c96db11 100644 --- a/plugins/channelrx/demodacars/acarsdemodworker.h +++ b/plugins/channelrx/demodacars/acarsdemodworker.h @@ -39,8 +39,8 @@ #include #include "acarsdemodsettings.h" -#include "acarsmessage.h" -#include "acarsmultipartassembler.h" +#include "util/acarsmessage.h" +#include "util/acarsmultipartassembler.h" #include "acarsvdl2.h" #include "acarshfdl.h" #include "acarsaero.h" @@ -157,6 +157,39 @@ public: {} }; + // The aircraft database has been downloaded again: pick up the new one + class MsgReloadAircraftDatabase : public Message { + MESSAGE_CLASS_DECLARATION + public: + static MsgReloadAircraftDatabase* create() { + return new MsgReloadAircraftDatabase(); + } + private: + MsgReloadAircraftDatabase() : + Message() + {} + }; + + // An ACARS block read back from a .csv log. Decoded and shown like a received one, + // but kept off the outputs - UDP, the "packets" pipes, the log and the aggregator + // feed - which would otherwise send old traffic out again as if it were new, and + // append to the very log being read. + class MsgReplayPacket : public Message { + MESSAGE_CLASS_DECLARATION + public: + const QByteArray& getPacket() const { return m_packet; } + QDateTime getDateTime() const { return m_dateTime; } + static MsgReplayPacket* create(const QByteArray& packet, const QDateTime& dateTime) { + return new MsgReplayPacket(packet, dateTime); + } + private: + QByteArray m_packet; + QDateTime m_dateTime; + MsgReplayPacket(const QByteArray& packet, const QDateTime& dateTime) : + Message(), m_packet(packet), m_dateTime(dateTime) + {} + }; + explicit AcarsDemodWorker(AcarsDemod *acarsDemod); ~AcarsDemodWorker(); @@ -204,13 +237,6 @@ private: int m_hfdlNewestReportSecs = -1; // Newest HFNPDU report time seen, for replay-aware freshness // Aggregator feeds (sockets created on the worker thread) - QUdpSocket *m_feedSocket = nullptr; - QTcpSocket *m_feedAirframesTcpSocket = nullptr; - QTcpSocket *m_feedAvdelphiTcpSocket = nullptr; - QHostAddress m_feedAirframesAddr; // Cached DNS resolutions, for UDP - QString m_feedAirframesResolvedHost; - QHostAddress m_feedAvdelphiAddr; - QString m_feedAvdelphiResolvedHost; // Databases for message decode and flight paths QSharedPointer> m_aircraftInfo; @@ -225,8 +251,10 @@ private: void applySettings(const AcarsDemodSettings& settings, bool force); void forwardToGui(Message *message); - void processPacket(const QByteArray& packet, QDateTime dateTime); - void processAcarsMessage(QByteArray messageBytes, QDateTime received); + //!< icao is the address the bearer knew, or 0 - see AcarsDemod::MsgAcarsPacket + //!< replay is true for a block read back from a .csv log - see MsgReplayPacket + void processPacket(const QByteArray& packet, QDateTime dateTime, quint32 icao = 0, bool replay = false); + void processAcarsMessage(QByteArray messageBytes, QDateTime received, quint32 icao = 0, bool replay = false); void processVdl2Frame(const AcarsVdl2Receiver::Frame& frame, QDateTime received); void processHfdlFrame(const AcarsHfdlReceiver::Frame& frame, QDateTime received); void processAeroFrame(const AcarsAeroReceiver::Frame& frame, QDateTime received); @@ -237,10 +265,8 @@ private: // The protocol the packets currently in flight came off, stamped by the sink rather // than read from m_settings - see AcarsDemod::MsgProtocolChange int m_protocolMode = 0; // AcarsDemodSettings::ACARS - void feedMessage(const AcarsMessage& message); - void updateFeedConnections(); + void feedMessage(const QByteArray& block, const QDateTime& received); void sendAircraftReport(AircraftReport& report); - void sendGroundStationToMap(const QString& name, float latitude, float longitude, const QString& text, QDateTime dateTime); void emitAssemblyState(const QSharedPointer& assembly); private slots: diff --git a/plugins/channelrx/demodacars/acarshfdl.h b/plugins/channelrx/demodacars/acarshfdl.h index e7ae9b803..7bad688d3 100644 --- a/plugins/channelrx/demodacars/acarshfdl.h +++ b/plugins/channelrx/demodacars/acarshfdl.h @@ -2,6 +2,12 @@ // Copyright (C) 2026 Jon Beniston, M7RCE // // Some code by AI // // // +// The HFDL constants and conventions - the physical layer parameters and the // +// MPDU, LPDU and SPDU layouts - were cross-checked against dumphfdl by Tomasz // +// Lemiech, https://github.com/szpajder/dumphfdl, GPL-3.0, and the ARINC 635 // +// system table of ground station names, positions and frequency assignments // +// is the one dumphfdl ships. // +// // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation as version 3 of the License, or // @@ -165,7 +171,9 @@ public: // thread's time, which matters at accelerated file replay. 0 disables the // limit (every failed burst runs the full chain). double m_retryLimitFraction = 0.30; - // Decision directed per-symbol frequency update on the phase residual + // Decision directed per-symbol frequency update on the phase residual. Applied + // scaled by (1 - the reference blend in use), as the loop originally had it in + // effect - see updateRefLane() double m_freqGain = 0.01; // Reference phasor blending for decision-directed symbols... double m_refGain = 0.15; @@ -990,7 +998,7 @@ private: } delta = std::max(-0.5, std::min(0.5, delta)); - m_dphiSym = std::arg(m_bestD); + m_dphiSym = refineAcquisitionDphi(std::arg(m_bestD)); // First following symbol lands one symbol after the peak if (delta >= 0.0) @@ -1081,6 +1089,71 @@ private: m_laneMeta.clear(); } + // Refine the acquisition's per-symbol rotation by maximising the coherent sum over the + // whole A sequence, modulation removed - the maximum likelihood estimate given the + // known symbols. The differential correlation that found the burst multiplies noise + // by noise and averages only 126 products, so its estimate is far noisier: the + // coherent sum's error falls as N^-1.5 rather than N^-0.5. + // + // It matters because of how the carrier loop uses it. Any error in the rotation + // leaves the decision-directed reference lagging by error / gain - about seven times + // the error at the data gain - and the A2 gate, a coherent sum, is where that bites. + // The loop used to apply only (1 - gain) of the estimate (see updateRefLane()), + // which by accident shrank a noisy estimate towards zero and so suited the near-zero + // offsets of real recordings; applying it in full needs it to be accurate instead. + // Measured: the corrected loop order alone lost 2.5 percent of the LPDUs on the + // short real recordings, all at the A2 gate; with this as well it gains 5 percent + // on them, and 4 percent (3249 to 3375) on the overnight Reykjavik capture. + // + // A grid of quarter-bin steps around the coarse estimate, then a parabola through + // the best and its neighbours. Once per sync, so its cost does not matter + double refineAcquisitionDphi(double coarse) const + { + const int sps = ACARSHFDL_SAMPLES_PER_SYMBOL; + const int n = ACARSHFDL_A_LEN; + const int span = 8; + const double step = (2.0 * M_PI / n) / 4.0; + + Cd stripped[ACARSHFDL_A_LEN]; + for (int k = 0; k < n; k++) + { + int back = m_bestAgo + (n - 1 - k) * sps; + stripped[k] = tap(back) * (aBit(k) ? -1.0 : 1.0); + } + + double power[2 * span + 1]; + int best = span; + for (int i = 0; i <= 2 * span; i++) + { + const double d = coarse + (i - span) * step; + // Symbol k is (n - 1 - k) symbols before the newest, so rotating it on by + // that many steps lines every symbol up with the newest one + const Cd rot = std::polar(1.0, d); + Cd phasor(1.0, 0.0); + Cd sum(0.0, 0.0); + for (int k = n - 1; k >= 0; k--) + { + sum += stripped[k] * phasor; + phasor *= rot; + } + power[i] = std::norm(sum); + if (power[i] > power[best]) { + best = i; + } + } + + double shift = 0.0; + if ((best > 0) && (best < 2 * span)) + { + const double denom = power[best - 1] - 2.0 * power[best] + power[best + 1]; + if (denom < -1e-20) { + shift = std::max(-0.5, std::min(0.5, 0.5 * (power[best - 1] - power[best + 1]) / denom)); + } + } + + return coarse + ((best - span) + shift) * step; + } + void abandonBurst() { m_state = StateSearch; @@ -1094,10 +1167,29 @@ private: // --------------------------------------------------------------------------------- // Update a lane's carrier reference with a symbol whose modulation is known or - // decided: the sample with the modulation removed is blended into the reference - static void updateRefLane(Cd& ref, double dphiSym, const Cd& yDemod, double gain) + // decided: the sample with the modulation removed is blended into the reference. + // + // The reference must already have been advanced to this symbol by advanceRef(), + // BEFORE the symbol was derotated and its residual taken - the order the VDL-2 + // receiver uses. Advancing it here instead, after the residual, meant every residual + // was measured against last symbol's phase, so the loop carried the per-symbol + // rotation as a standing lead and the frequency estimate settled at + // rotation / (1 - gain) rather than at the rotation. That is harmless while the gain + // never changes, but it switches between the training and the data gains every 15 + // and 30 symbols, so the estimate was always wrong for one of them, and the data + // symbols carried a phase bias that grew with the tuning error. Measured on + // generated bursts, 1200 and 1800 bps at 20 dB: nothing at all decoded from 150 Hz + // of tuning error either way - the 4PSK and 8PSK decisions slipped - and 8PSK was + // already losing a quarter of its messages at 100 Hz. In this order both decode + // every message out to 400 Hz. + // + // With the gain held constant the two orders are the same second order loop except + // for the integrator's gain, which the old order scaled by (1 - gain); the frequency + // updates below keep that scaling, so the loop's noise behaviour is the one the + // receiver was tuned with. Without it 600 bps lost 6 percent of its messages at the + // cliff + static void updateRefLane(Cd& ref, const Cd& yDemod, double gain) { - ref *= std::polar(1.0, dphiSym); double mag = std::abs(yDemod); if (mag > 1e-12) { ref = (1.0 - gain) * ref + gain * (yDemod / mag); @@ -1108,6 +1200,13 @@ private: } } + // Step a lane's carrier reference on by one symbol's rotation, so it predicts the + // phase of the symbol about to be derotated. Called once per symbol, first + static void advanceRef(Cd& ref, double dphiSym) + { + ref *= std::polar(1.0, dphiSym); + } + void gardner(const Cd& y0) { if ((m_config.m_timingGain == 0.0) || (m_symbolsSinceSync <= 2)) { @@ -1168,6 +1267,9 @@ private: void laneSymbol(EqLane& lane, const Cd& y0) { const int sps = ACARSHFDL_SAMPLES_PER_SYMBOL; + // Advanced first, every symbol, warm-up included, so the derotation below and + // the residual further down are both against this symbol's predicted phase + advanceRef(lane.m_ref, lane.m_dphiSym); Cd xHalf = interpAt(sps / 2, m_mu) * std::conj(lane.m_ref) * std::polar(1.0, 0.5 * lane.m_dphiSym) * m_eqScale; eqPush(lane, xHalf); @@ -1175,8 +1277,8 @@ private: if ((int) m_laneMeta.size() <= lane.m_delay) { - // Warm-up: keep the reference advancing until the first delayed decision - lane.m_ref *= std::polar(1.0, lane.m_dphiSym); + // Warm-up: nothing to decide until the first delayed decision, but the + // reference has still been advanced above return; } @@ -1202,9 +1304,9 @@ private: Cd yDemod = meta.m_knownBit ? -y0d : y0d; double res = std::arg(yDemod * std::conj(lane.m_ref)); if (m_config.m_freqGain != 0.0) { - lane.m_dphiSym += m_config.m_freqGain * res; + lane.m_dphiSym += m_config.m_freqGain * (1.0 - m_config.m_trainGain) * res; } - updateRefLane(lane.m_ref, lane.m_dphiSym, yDemod, m_config.m_trainGain); + updateRefLane(lane.m_ref, yDemod, m_config.m_trainGain); // The known symbols are also the equalizer's training: the taps update // here and are frozen over the data frames double mu = m_config.m_eqMu; @@ -1219,11 +1321,10 @@ private: else { if (m_config.m_freqGain != 0.0) { - lane.m_dphiSym += m_config.m_freqGain * residual; + lane.m_dphiSym += m_config.m_freqGain * (1.0 - m_config.m_refGain) * residual; } double modPhase = phaseIdx * step + (meta.m_flip ? M_PI : 0.0); - updateRefLane(lane.m_ref, lane.m_dphiSym, y0d * std::polar(1.0, -modPhase), - m_config.m_refGain); + updateRefLane(lane.m_ref, y0d * std::polar(1.0, -modPhase), m_config.m_refGain); } // Soft chips for the delayed data symbols; they trail the raw lane's by the @@ -1255,7 +1356,9 @@ private: m_symbolsSinceSync++; Cd y0 = interpAt(0, m_mu); // Raw lane: identical to the receiver without an equalizer, so its soft chips - // and its carrier trajectory are exactly the proven baseline + // and its carrier trajectory are exactly the proven baseline. The reference is + // stepped on to this symbol before it derotates anything - see updateRefLane() + advanceRef(m_ref, m_dphiSym); Cd y = y0 * std::conj(m_ref); gardner(y0); @@ -1306,9 +1409,9 @@ private: Cd yDemod = knownBit ? -y0 : y0; double res = std::arg(yDemod * std::conj(m_ref)); if (m_config.m_freqGain != 0.0) { - m_dphiSym += m_config.m_freqGain * res; + m_dphiSym += m_config.m_freqGain * (1.0 - m_config.m_trainGain) * res; } - updateRefLane(m_ref, m_dphiSym, yDemod, m_config.m_trainGain); + updateRefLane(m_ref, yDemod, m_config.m_trainGain); int rxBit = (std::abs(phi) > M_PI_2) ? 1 : 0; m_stats.m_trainBitsTotal++; m_trainTotalThisBurst++; @@ -1323,10 +1426,10 @@ private: // Decision-directed: remove the decided modulation (constellation phase // plus the scrambler flip) from the received sample and blend it in if (m_config.m_freqGain != 0.0) { - m_dphiSym += m_config.m_freqGain * residual; + m_dphiSym += m_config.m_freqGain * (1.0 - m_config.m_refGain) * residual; } double modPhase = phaseIdx * step + (flip ? M_PI : 0.0); - updateRefLane(m_ref, m_dphiSym, y0 * std::polar(1.0, -modPhase), m_config.m_refGain); + updateRefLane(m_ref, y0 * std::polar(1.0, -modPhase), m_config.m_refGain); } // Equalizer lanes, active once the mode is known: each has its own carrier diff --git a/plugins/channelrx/demodacars/acarsiridium.h b/plugins/channelrx/demodacars/acarsiridium.h new file mode 100644 index 000000000..f168c36b5 --- /dev/null +++ b/plugins/channelrx/demodacars/acarsiridium.h @@ -0,0 +1,849 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSIRIDIUM_H +#define INCLUDE_ACARSIRIDIUM_H + +#include + +#include +#include +#include +#include +#include +#include + +#include "acarsiridiumfft.h" + +// Iridium L band burst receiver, physical layer. +// +// Iridium is unlike the other protocols this plugin decodes. ACARS, VDL-2 and HFDL are +// continuous narrowband channels, and Inmarsat Aero is a geostationary satellite whose +// Doppler barely moves. Iridium is burst TDMA from satellites in low earth orbit: +// +// - bursts of about 8.3 ms in a 90 ms frame, so the receiver sees silence most of the +// time and has nothing to hold a lock on between them +// - DQPSK at 25 kbaud, an order of magnitude faster than the Aero MSK rates +// - low earth orbit gives roughly 37 kHz of Doppler either way, and it moves while the +// burst is being received, so every burst needs its own frequency estimate +// +// This stage finds bursts, demodulates them to symbols, and hands the bit stream from the +// unique word onwards to AcarsIridiumFrameDecoder in acarsiridiumframe.h, which does +// frame classification, BCH and the field decoding. +// +// The constants and the processing order follow gr-iridium, which is the reference this +// was checked against: coarse frequency from the preamble, fine frequency from the whole +// burst, root raised cosine matched filter, symbol timing, then differential demodulation. + +// Five samples per symbol at 25 kbaud. One Iridium channel is 41.67 kHz wide, so 125 kHz +// leaves room either side for a burst that Doppler has pushed off its nominal frequency. +// +// The rate is what it is because of the channelizer in acarsiridiumchannelizer.h, which +// scans the whole band: its output rate is four times its channel spacing, and 31.25 kHz +// spacing - close enough to the 41.67 kHz Iridium grid that every channel is covered - +// gives 125 kHz out. That it also divides the symbol rate exactly is what makes 31.25 kHz +// the spacing to pick +#define ACARSIRIDIUM_CHANNEL_SAMPLE_RATE 125000 +#define ACARSIRIDIUM_SYMBOL_RATE 25000 +#define ACARSIRIDIUM_SAMPLES_PER_SYMBOL (ACARSIRIDIUM_CHANNEL_SAMPLE_RATE / ACARSIRIDIUM_SYMBOL_RATE) + +// A burst is nominally 8.28 ms, which is about 207 symbols, and a simplex burst about +// 20.6 ms. Accept a generous range either side: anything far outside it is interference +#define ACARSIRIDIUM_MIN_BURST_SYMBOLS 40 +#define ACARSIRIDIUM_MAX_BURST_SYMBOLS 640 + +// From gr-iridium lib/iridium.h, which is the reference these were checked against. +// The unique word was then found at zero symbol error in 11 of 18 bursts of a recording +// of the ring alert channel, at symbol 66 every time - the 64 symbol preamble plus the +// two samples the burst detector picks up ahead of it +#define ACARSIRIDIUM_UW_LENGTH 12 +#define ACARSIRIDIUM_PREAMBLE_SHORT 16 // Duplex +#define ACARSIRIDIUM_PREAMBLE_LONG 64 // Simplex, above 1626 MHz + +// How far either side of the expected position the unique word is looked for, and how +// many of its symbols may be wrong before the burst is treated as having no sync. +// +// The window has to be tight, because the search is over two preamble lengths, two +// directions and four rotations, which is a lot of chances to match by luck: allowing two +// errors over a 24 symbol window gives roughly a one in ten chance of a false match on +// any burst, measured on a traffic channel recording where it produced 18 spurious syncs +// at scattered positions against 12 real ones. Over 8 symbols it is below one in a +// hundred, and a false sync is then thrown out by the BCH check in the frame layer, which +// is a far stronger test than the unique word - which is why two errors are allowed here. +// On a ring alert recording the bursts that need the second error are the ones at 10 to +// 18 dB; the strong ones match with no errors at all +#define ACARSIRIDIUM_UW_SEARCH 8 +#define ACARSIRIDIUM_UW_MAX_ERRORS 2 + +// Root raised cosine matched filter, as gr-iridium designs it in burst_downmix_impl.cc: +// +// root_raised_cosine(1.0, d_output_sample_rate, SYMBOLS_PER_SECOND, .4, 51) +// +// Without it the preamble still demodulates perfectly, because it is one symbol repeated +// and so has no transitions to smear, but the data symbols that follow are corrupted by +// intersymbol interference. That showed up as bursts whose preamble was a clean run of +// zero differential symbols and whose unique word then failed to match +#define ACARSIRIDIUM_RRC_ALPHA 0.4 +#define ACARSIRIDIUM_RRC_TAPS 51 + +// How much of the burst the coarse frequency estimate uses, in symbols. gr-iridium sizes +// its estimation FFT as PREAMBLE_LENGTH_SHORT + 10, which covers the whole short preamble +// plus the first symbols of the unique word, and for a long preamble is all preamble. The +// unique word is only symbols 0 and 2, so squaring the signal removes it as well as the +// preamble, leaving a single tone at twice the frequency offset +#define ACARSIRIDIUM_CFO_SYMBOLS (ACARSIRIDIUM_PREAMBLE_SHORT + 10) + +class AcarsIridiumReceiver +{ +public: + typedef std::complex Cd; + + enum Direction + { + DirectionUnknown = 0, + DirectionDownlink, //!< Satellite to ground, which is what is heard + DirectionUplink + }; + + struct Burst + { + qint64 m_sampleIndex = 0; //!< Where the burst started, in channel samples + double m_frequencyOffset = 0.0; //!< Hz from the centre of the channel, mostly Doppler + double m_coarseOffset = 0.0; //!< The preamble only estimate, before refinement + double m_snrDb = 0.0; + double m_powerDb = 0.0; + int m_symbolCount = 0; + std::vector m_symbols; //!< Differential symbol, 0 to 3, rotation not removed + + // Filled in when the unique word is found + Direction m_direction = DirectionUnknown; + int m_uwPosition = -1; //!< Index in m_symbols where the unique word starts + int m_uwErrors = 0; + int m_rotation = 0; //!< Quarter turns of residual frequency error removed + //!< The frame, as the bits the frame layer works on: two per differential symbol, + //!< Gray coded, starting with the 24 bit access code. Empty when there is no sync + std::vector m_frameBits; + }; + + AcarsIridiumReceiver() + { + designRrc(); + reset(); + } + + void reset() + { + m_sampleIndex = 0; + m_burstStart = 0; + m_noiseFloor = 0.0; + m_noiseValid = false; + m_inBurst = false; + m_belowCount = 0; + m_aboveCount = 0; + m_smoothedPower = 0.0; + m_preTrigger.assign(m_preTriggerLength, Cd(0.0, 0.0)); + m_preTriggerWrite = 0; + m_preTriggerCount = 0; + m_burstSamples.clear(); + + // Reserved once rather than grown: the band scanner runs one of these per channel, + // so a reallocation here is a reallocation a couple of hundred times over + m_burstSamples.reserve(ACARSIRIDIUM_MAX_BURST_SYMBOLS * ACARSIRIDIUM_SAMPLES_PER_SYMBOL); + m_bursts.clear(); + m_burstCount = 0; + m_rejectedCount = 0; + } + + //! Two bits per differential symbol, Gray coded. The de_dqpsk() function in + //! iridium-toolkit reads the bit pair as a number and maps it through + //! imap[] = { 0, 1, 3, 2 } to recover the symbol, and that map is its own inverse, so + //! the same table encodes. It is what makes the differential form of the downlink + //! unique word come out as the access code "001100000011000011110011" + static uint8_t grayMap(uint8_t symbol) + { + static const uint8_t imap[4] = { 0, 1, 3, 2 }; + + return imap[symbol & 3]; + } + + //! Feeds one channel sample. Returns true when a burst has been completed and is + //! waiting to be popped + bool processSample(const Cd& sample) + { + const double power = std::norm(sample); + + // Short smoothing, so one noisy sample neither starts nor ends a burst + m_smoothedPower += (power - m_smoothedPower) * 0.25; + + if (!m_inBurst) + { + // The noise floor only tracks while nothing is being received: a long burst + // would otherwise drag it up and the burst would end early + if (!m_noiseValid) + { + m_noiseFloor = m_smoothedPower; + m_noiseValid = true; + } + else + { + m_noiseFloor += (m_smoothedPower - m_noiseFloor) * 0.0001; + } + + if (m_smoothedPower > (m_noiseFloor * m_startThreshold)) + { + m_aboveCount++; + + if (m_aboveCount >= m_startSamples) + { + m_inBurst = true; + m_belowCount = 0; + m_burstStart = m_sampleIndex - (qint64) m_preTriggerCount; + m_burstSamples.clear(); + + // The samples from before the detector fired are part of the burst, + // and the preamble they hold is what the frequency estimate needs. + // Oldest first, which with a ring is wherever the next write would go + for (int i = 0; i < m_preTriggerCount; i++) + { + const int index = (m_preTriggerWrite + m_preTriggerLength - m_preTriggerCount + i) + % m_preTriggerLength; + + m_burstSamples.push_back(m_preTrigger[index]); + } + } + } + else + { + m_aboveCount = 0; + } + } + else + { + m_burstSamples.push_back(sample); + + if (m_smoothedPower < (m_noiseFloor * m_endThreshold)) + { + m_belowCount++; + + if (m_belowCount >= m_endSamples) + { + endBurst(); + m_inBurst = false; + m_aboveCount = 0; + } + } + else + { + m_belowCount = 0; + } + + if ((int) m_burstSamples.size() > (ACARSIRIDIUM_MAX_BURST_SYMBOLS * ACARSIRIDIUM_SAMPLES_PER_SYMBOL)) + { + // Not a burst: something is transmitting continuously, so drop it and + // let the noise floor re-converge rather than growing the buffer for ever + m_burstSamples.clear(); + m_inBurst = false; + m_aboveCount = 0; + m_noiseValid = false; + m_rejectedCount++; + } + } + + m_preTrigger[m_preTriggerWrite] = sample; + m_preTriggerWrite = (m_preTriggerWrite + 1) % m_preTriggerLength; + + if (m_preTriggerCount < m_preTriggerLength) { + m_preTriggerCount++; + } + + m_sampleIndex++; + + return !m_bursts.empty(); + } + + bool hasBurst() const { return !m_bursts.empty(); } + + Burst popBurst() + { + Burst burst = m_bursts.front(); + m_bursts.pop_front(); + return burst; + } + + int burstCount() const { return m_burstCount; } + int rejectedCount() const { return m_rejectedCount; } + double noiseFloor() const { return m_noiseFloor; } + +private: + + //! Root raised cosine taps, by the root_raised_cosine function in GNU Radio firdes, + //! so the matched filter is the same one gr-iridium uses + void designRrc() + { + const int ntaps = ACARSIRIDIUM_RRC_TAPS | 1; + const double alpha = ACARSIRIDIUM_RRC_ALPHA; + const double spb = (double) ACARSIRIDIUM_SAMPLES_PER_SYMBOL; + + m_rrc.resize(ntaps); + double scale = 0.0; + + for (int i = 0; i < ntaps; i++) + { + const double index = (double) (i - (ntaps / 2)); + const double x1 = M_PI * index / spb; + double x2 = 4.0 * alpha * index / spb; + double x3 = (x2 * x2) - 1.0; + double num; + double den; + + if (std::fabs(x3) >= 0.000001) + { + if (i != (ntaps / 2)) { + num = std::cos((1.0 + alpha) * x1) + (std::sin((1.0 - alpha) * x1) / (4.0 * alpha * index / spb)); + } else { + num = std::cos((1.0 + alpha) * x1) + ((1.0 - alpha) * M_PI / (4.0 * alpha)); + } + + den = x3 * M_PI; + } + else + { + // The removable singularity, where index is plus or minus spb / (4 alpha) + x3 = (1.0 - alpha) * x1; + x2 = (1.0 + alpha) * x1; + num = (std::sin(x2) * (1.0 + alpha) * M_PI) + - (std::cos(x3) * ((1.0 - alpha) * M_PI * spb) / (4.0 * alpha * index)) + + (std::sin(x3) * spb * spb / (4.0 * alpha * index * index)); + den = -32.0 * M_PI * alpha * alpha * index / spb; + } + + m_rrc[i] = 4.0 * alpha * num / den; + scale += m_rrc[i]; + } + + for (int i = 0; i < ntaps; i++) { + m_rrc[i] /= scale; + } + } + + //! Matched filter, with the group delay taken out so an output sample lines up with + //! the input sample of the same index and the unique word stays where it was found + std::vector matchedFilter(const std::vector& samples) const + { + const int ntaps = (int) m_rrc.size(); + const int centre = ntaps / 2; + const int length = (int) samples.size(); + std::vector out(length); + + for (int i = 0; i < length; i++) + { + Cd sum(0.0, 0.0); + + for (int k = 0; k < ntaps; k++) + { + const int index = i + k - centre; + + if ((index >= 0) && (index < length)) { + sum += samples[index] * m_rrc[k]; + } + } + + out[i] = sum; + } + + return out; + } + + //! Magnitude of the tone at power times offset, which is how the fine frequency + //! estimate below scores a candidate. The phasor is stepped rather than recomputed, + //! because this is searched over hundreds of candidates for every burst + double toneMagnitude(const std::vector& raised, int power, double offset, int length) const + { + const double w = -2.0 * M_PI * ((double) power * offset) / ACARSIRIDIUM_CHANNEL_SAMPLE_RATE; + const Cd step = std::exp(Cd(0.0, w)); + Cd phasor(1.0, 0.0); + Cd sum(0.0, 0.0); + + for (int i = 0; i < length; i++) + { + sum += raised[i] * phasor; + phasor *= step; + } + + return std::abs(sum); + } + + //! Where the burst actually sits in the channel, from its power spectrum. + //! + //! This exists only to settle which alias the estimates below have landed on, and is + //! the one step in the chain that cannot be ambiguous. Raising the signal to a power + //! to strip the modulation also folds the frequency axis: squaring leaves the offset + //! known only modulo half the sample rate, and the fourth power modulo a quarter of + //! it. Neither fold matters to differential demodulation, because an offset that is a + //! whole number of symbol rates advances the phase by a whole turn per symbol, which + //! is why this went unnoticed until the matched filter was added. It matters a great + //! deal to the matched filter, which would otherwise be centred up to 50 kHz away + //! from the signal - at this sample rate, on the far side of Nyquist. + //! + //! The score is the power a matched filter centred on the candidate would pass, so + //! the whole occupied bandwidth votes rather than any single bin + double estimateFrequencyCentre(const std::vector& samples) + { + const int length = (int) samples.size(); + const double rate = ACARSIRIDIUM_CHANNEL_SAMPLE_RATE; + + // The spectrum from a transform rather than a bin at a time. Scoring each + // candidate separately meant a pass over the whole burst per candidate, which for + // a few hundred candidates is most of the cost of handling a burst - and with the + // whole band being scanned there are a great many bursts + const int size = AcarsIridiumFft::nextPowerOfTwo(std::max(length, 1024)); + m_fft.configure(size); + + std::vector spectrum(size, Cd(0.0, 0.0)); + + for (int i = 0; i < length; i++) { + spectrum[i] = samples[i]; + } + + m_fft.transform(spectrum); + + // A 25 kbaud signal shaped at alpha 0.4 occupies about 35 kHz, so a filter centred + // on the signal passes roughly 17.5 kHz either side. The score for a candidate is + // how much power such a filter would pass, so the whole occupied bandwidth votes + const double binHz = rate / (double) size; + const int half = (int) std::lround(17500.0 / binHz); + + // Running totals, so each candidate costs a subtraction rather than a sweep over + // its whole bandwidth + std::vector prefix(size + 1, 0.0); + + for (int k = 0; k < size; k++) { + prefix[k + 1] = prefix[k] + std::norm(spectrum[k]); + } + + const double total = prefix[size]; + int bestBin = 0; + double bestPower = -1.0; + + for (int c = 0; c < size; c++) + { + const int from = c - half; + const int to = c + half + 1; + double sum; + + if ((from >= 0) && (to <= size)) + { + sum = prefix[to] - prefix[from]; + } + else + { + // The spectrum is periodic at the sample rate, so a candidate near the + // edge takes the rest of its bandwidth from the other end + const int lo = ((from % size) + size) % size; + const int hi = ((to % size) + size) % size; + + sum = (total - prefix[lo]) + prefix[hi]; + } + + if (sum > bestPower) + { + bestPower = sum; + bestBin = c; + } + } + + return ((bestBin < (size / 2)) ? (double) bestBin : (double) (bestBin - size)) * binHz; + } + + //! Fine frequency from the whole burst, raised to the fourth power so the QPSK data + //! cancels as well as the preamble, and read off a transform of the result. + //! + //! The fourth power puts a tone at four times the frequency offset, and its peak is + //! only about 1/T wide - some tens of Hz for a burst this long. Searching for it by + //! scoring candidate offsets one at a time therefore needs a step of a few Hz over + //! the whole range, which is thousands of passes over the burst: with a few hundred + //! channels being scanned at once that was most of the time the scanner spent, and + //! coarsening the step simply steps over the peak and misses it. A transform gives + //! every candidate at once instead. + //! + //! The result is still ambiguous - a tone at four times the offset repeats every + //! quarter of the sample rate - so the answer taken is the one nearest the coarse + //! estimate, which is what that estimate is for + double estimateFrequencyFine(const std::vector& samples, double coarse) + { + const int length = (int) samples.size(); + const double rate = ACARSIRIDIUM_CHANNEL_SAMPLE_RATE; + + // Sized to the burst rather than fixed. A burst defines its own frequency only to + // about 1 / (4T), which is 30 Hz for a short duplex burst, and the bin spacing + // here is rate / (4 * size) - so a transform the length of the burst already + // resolves it as finely as it can be resolved, and the interpolation below picks + // up the rest. Padding every burst out to a fixed large size was eight times the + // work for the short ones, which are most of them + const int size = AcarsIridiumFft::nextPowerOfTwo(std::max(length, 1024)); + m_fft.configure(size); + + std::vector fourth(size, Cd(0.0, 0.0)); + + for (int i = 0; i < length; i++) + { + const Cd s2 = samples[i] * samples[i]; + fourth[i] = s2 * s2; + } + + m_fft.transform(fourth); + + // One alias of the fourth power tone every quarter of the sample rate + const double aliasHz = rate / 4.0; + const double searchHz = aliasHz / 2.0; + + int bestBin = -1; + double bestMagnitude = -1.0; + double best = coarse; + + for (int k = 0; k < size; k++) + { + // Bin to the frequency of the tone, then to the offset that produced it + const double tone = ((k < (size / 2)) ? (double) k : (double) (k - size)) * rate / (double) size; + double offset = tone / 4.0; + + // Slide to whichever alias sits nearest the coarse estimate + offset += std::round((coarse - offset) / aliasHz) * aliasHz; + + if (std::fabs(offset - coarse) > searchHz) { + continue; + } + + const double magnitude = std::norm(fourth[k]); + + if (magnitude > bestMagnitude) + { + bestMagnitude = magnitude; + bestBin = k; + best = offset; + } + } + + if (bestBin < 0) { + return coarse; + } + + // Parabolic interpolation between the neighbouring bins, so the answer is not + // limited to the bin spacing + const double left = std::abs(fourth[(bestBin - 1 + size) % size]); + const double centre = std::abs(fourth[bestBin]); + const double right = std::abs(fourth[(bestBin + 1) % size]); + const double denominator = left - (2.0 * centre) + right; + + if (std::fabs(denominator) > 1e-20) + { + const double shift = 0.5 * (left - right) / denominator; + + if (std::fabs(shift) <= 1.0) { + best += shift * rate / (4.0 * (double) size); + } + } + + return best; + } + + //! Symbol timing by Oerder and Meyr: the squared magnitude carries a line at the + //! symbol rate, and its phase is the timing offset within a symbol. + //! + //! Mind the sign. If the squared magnitude peaks a fraction tau of the way into each + //! symbol, the sum below comes out proportional to e^(-j 2 pi tau / sps), so the + //! offset is MINUS its phase. Taking the phase as it stands gives -tau mod sps, which + //! is only right when tau happens to be zero or half a symbol - anywhere else it + //! samples as far the wrong side of the peak as the peak is from the symbol start + double estimateTiming(const std::vector& samples) const + { + const int sps = ACARSIRIDIUM_SAMPLES_PER_SYMBOL; + Cd sum(0.0, 0.0); + + // The phase only takes as many values as there are samples in a symbol, so a + // small table replaces a transcendental per sample + Cd rotations[ACARSIRIDIUM_SAMPLES_PER_SYMBOL]; + + for (int i = 0; i < sps; i++) + { + const double w = -2.0 * M_PI * (double) i / (double) sps; + + rotations[i] = Cd(std::cos(w), std::sin(w)); + } + + int slot = 0; + + for (size_t i = 0; i < samples.size(); i++) + { + sum += std::norm(samples[i]) * rotations[slot]; + + if (++slot == sps) { + slot = 0; + } + } + + // Negated, as above, then wrapped into [0, 2 pi) so the offset is in [0, sps) + double phase = -std::arg(sum); + + if (phase < 0.0) { + phase += 2.0 * M_PI; + } + + return (phase / (2.0 * M_PI)) * (double) sps; + } + + //! The unique words, as gr-iridium gives them: absolute symbols, only 0 and 2, so + //! the sync is effectively BPSK within the QPSK constellation + static const uint8_t *uniqueWord(Direction direction) + { + static const uint8_t downlink[ACARSIRIDIUM_UW_LENGTH] = { 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 0, 2 }; + static const uint8_t uplink[ACARSIRIDIUM_UW_LENGTH] = { 2, 2, 0, 0, 0, 2, 0, 0, 2, 0, 2, 2 }; + + return (direction == DirectionUplink) ? uplink : downlink; + } + + //! Looks for a unique word in the differential symbols and, when one is found, emits + //! the frame bit stream from it onwards. + //! + //! The search allows for a residual frequency error of a multiple of a quarter of the + //! symbol rate, which leaves a fixed quarter turn on every symbol and so adds a + //! constant to every differential symbol. Trying all four rotations resolves it + void findUniqueWord(Burst& burst) const + { + if (burst.m_symbolCount < (ACARSIRIDIUM_PREAMBLE_SHORT + ACARSIRIDIUM_UW_LENGTH)) { + return; + } + + // A simplex burst carries the long preamble, a duplex burst the short one. Which + // this is depends on the frequency, which the receiver does not know, so both + // are looked for + const int expected[2] = { ACARSIRIDIUM_PREAMBLE_LONG, ACARSIRIDIUM_PREAMBLE_SHORT }; + + int bestErrors = ACARSIRIDIUM_UW_MAX_ERRORS + 1; + int bestPosition = -1; + int bestRotation = 0; + Direction bestDirection = DirectionUnknown; + + for (int d = 0; d < 2; d++) + { + const Direction direction = (d == 0) ? DirectionDownlink : DirectionUplink; + const uint8_t *uw = uniqueWord(direction); + + // The differential form of the unique word, which is what the symbols are + uint8_t wanted[ACARSIRIDIUM_UW_LENGTH - 1]; + + for (int i = 1; i < ACARSIRIDIUM_UW_LENGTH; i++) { + wanted[i-1] = (uint8_t) ((4 + uw[i] - uw[i-1]) % 4); + } + + for (int p = 0; p < 2; p++) + { + for (int offset = -ACARSIRIDIUM_UW_SEARCH; offset <= ACARSIRIDIUM_UW_SEARCH; offset++) + { + // One differential symbol before the unique word is part of the access + // code, so the frame cannot start at symbol zero + const int start = expected[p] + offset; + + if ((start < 1) || ((start + ACARSIRIDIUM_UW_LENGTH - 1) > burst.m_symbolCount)) { + continue; + } + + for (int rotation = 0; rotation < 4; rotation++) + { + int errors = 0; + + for (int i = 0; i < (ACARSIRIDIUM_UW_LENGTH - 1); i++) + { + if (burst.m_symbols[start + i] != ((wanted[i] + rotation) % 4)) + { + errors++; + + if (errors >= bestErrors) { + break; + } + } + } + + if (errors < bestErrors) + { + bestErrors = errors; + bestPosition = start; + bestRotation = rotation; + bestDirection = direction; + } + } + } + } + } + + if (bestPosition < 0) { + return; + } + + burst.m_direction = bestDirection; + burst.m_uwPosition = bestPosition; + burst.m_uwErrors = bestErrors; + burst.m_rotation = bestRotation; + + // The access code is the twelve differential symbols ending with the eleven of + // the unique word. The one before them is the step from the last preamble symbol + // into the unique word, and because the preamble is symbol 0 repeated and the + // downlink unique word also starts at symbol 0 it is a step of nothing - which is + // why the access code begins with two zero bits + for (int i = bestPosition - 1; i < burst.m_symbolCount; i++) + { + const uint8_t symbol = (uint8_t) ((4 + burst.m_symbols[i] - bestRotation) % 4); + const uint8_t mapped = grayMap(symbol); + + burst.m_frameBits.push_back((uint8_t) ((mapped >> 1) & 1)); + burst.m_frameBits.push_back((uint8_t) (mapped & 1)); + } + } + + void endBurst() + { + const int sps = ACARSIRIDIUM_SAMPLES_PER_SYMBOL; + const int symbols = (int) m_burstSamples.size() / sps; + + if ((symbols < ACARSIRIDIUM_MIN_BURST_SYMBOLS) || (symbols > ACARSIRIDIUM_MAX_BURST_SYMBOLS)) + { + m_rejectedCount++; + m_burstSamples.clear(); + return; + } + + Burst burst; + burst.m_sampleIndex = m_burstStart; + burst.m_coarseOffset = estimateFrequencyCentre(m_burstSamples); + burst.m_frequencyOffset = estimateFrequencyFine(m_burstSamples, burst.m_coarseOffset); + + // De-rotate by the estimated offset, so what is left is the modulation + std::vector corrected(m_burstSamples.size()); + const double w = -2.0 * M_PI * burst.m_frequencyOffset / ACARSIRIDIUM_CHANNEL_SAMPLE_RATE; + double power = 0.0; + + // Stepped rather than computed per sample: this used to be a transcendental for + // every sample of every burst, and when the whole band is scanned there are a + // great many bursts. The phasor is renormalised every so often, because repeated + // multiplication lets its magnitude drift + const Cd step(std::cos(w), std::sin(w)); + Cd phasor(1.0, 0.0); + + for (size_t i = 0; i < m_burstSamples.size(); i++) + { + corrected[i] = m_burstSamples[i] * phasor; + power += std::norm(m_burstSamples[i]); + phasor *= step; + + if ((i & 0xff) == 0xff) { + phasor /= std::abs(phasor); + } + } + power /= (double) m_burstSamples.size(); + + burst.m_powerDb = 10.0 * std::log10(power + 1e-20); + burst.m_snrDb = 10.0 * std::log10((power / (m_noiseFloor + 1e-20)) + 1e-20); + + // Matched filter, now the burst is centred. Doing it after the de-rotation rather + // than before is what lets the filter be centred on the signal + const std::vector filtered = matchedFilter(corrected); + + const double timing = estimateTiming(filtered); + + // Differential demodulation: each symbol is the phase STEP from the one before, + // which is what lets a burst be read without ever knowing absolute phase, and is + // why the frequency estimate above only has to be good enough to stop the phase + // walking within a single symbol + Cd previous(0.0, 0.0); + bool havePrevious = false; + + for (int s = 0; s < symbols; s++) + { + const int index = (int) std::lround((double) (s * sps) + timing); + + if ((index < 0) || (index >= (int) filtered.size())) { + continue; + } + + const Cd sample = filtered[index]; + + if (havePrevious) + { + const Cd difference = sample * std::conj(previous); + double angle = std::arg(difference); + + if (angle < 0.0) { + angle += 2.0 * M_PI; + } + + const int quadrant = ((int) std::floor((angle + (M_PI / 4.0)) / (M_PI / 2.0))) & 3; + + burst.m_symbols.push_back((uint8_t) quadrant); + } + + previous = sample; + havePrevious = true; + } + + burst.m_symbolCount = (int) burst.m_symbols.size(); + findUniqueWord(burst); + + if (burst.m_symbolCount >= ACARSIRIDIUM_MIN_BURST_SYMBOLS) + { + m_bursts.push_back(burst); + m_burstCount++; + } + else + { + m_rejectedCount++; + } + + m_burstSamples.clear(); + } + + // Detection thresholds, as ratios against the noise floor. The end one is lower than + // the start one so a fade within a burst does not chop it in two + const double m_startThreshold = 8.0; + const double m_endThreshold = 3.0; + const int m_startSamples = 8; + const int m_endSamples = 16; + const int m_preTriggerLength = 16; + + std::vector m_rrc; + AcarsIridiumFft m_fft; + + qint64 m_sampleIndex; + qint64 m_burstStart; + double m_noiseFloor; + bool m_noiseValid; + double m_smoothedPower; + bool m_inBurst; + int m_aboveCount; + int m_belowCount; + + std::vector m_preTrigger; + int m_preTriggerWrite; + int m_preTriggerCount; + std::vector m_burstSamples; + std::deque m_bursts; + + int m_burstCount; + int m_rejectedCount; +}; + +#endif // INCLUDE_ACARSIRIDIUM_H diff --git a/plugins/channelrx/demodacars/acarsiridiumchannelizer.h b/plugins/channelrx/demodacars/acarsiridiumchannelizer.h new file mode 100644 index 000000000..7dda58b95 --- /dev/null +++ b/plugins/channelrx/demodacars/acarsiridiumchannelizer.h @@ -0,0 +1,346 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSIRIDIUMCHANNELIZER_H +#define INCLUDE_ACARSIRIDIUMCHANNELIZER_H + +#include +#include +#include +#include +#include + +#if defined(USE_SSE4_1) +#include +#endif + +#include "acarsiridiumfft.h" + +// Oversampled polyphase channelizer, so one Iridium receiver can watch the whole band. +// +// Iridium hops: a duplex channel is assigned when a call is set up, and over 240 channels +// spaced 41.67 kHz across roughly 1619 to 1626 MHz. Watching one 125 kHz channel sees +// only a few percent of the traffic - measured on a four minute recording, the busiest +// single channel carried 4% of the short burst data frames in the band. Covering it all +// with one demodulator per channel would mean dozens of them, so the band is split here +// instead, in one pass, and a receiver run on every output. +// +// A plain filter bank decimates by the number of channels, which puts the output rate +// equal to the channel spacing and leaves no room for a signal that does not sit exactly +// in the middle of its channel. This one decimates by a quarter of that, so each output +// runs at four times the channel spacing: +// +// channels M, decimate by D = M / 4, so the output rate is 4 * inputRate / M +// +// The channel spacing is then inputRate / M and the output rate four times it. At +// 31.25 kHz spacing and 125 kHz out, an Iridium burst - about 35 kHz wide, and up to +// 37 kHz off its nominal frequency once Doppler has had its way - is always wholly +// inside at least one output. It is often inside two, so the scanner above this has to +// throw the duplicates away. +// +// Oversampling by a whole number of channels is what keeps this simple: decimating by +// M / 4 rather than M leaves a phase step between output blocks of a quarter turn per +// channel per block, which is a power of -j and so costs nothing to apply. + +class AcarsIridiumChannelizer +{ +public: + typedef std::complex Cd; + + //! How much each channel is oversampled: the output rate is this many times the + //! channel spacing. Four leaves room for a burst anywhere in its channel + static const int Oversample = 4; + + AcarsIridiumChannelizer() : + m_channels(0), + m_decimation(0), + m_tapsPerBranch(0), + m_length(0), + m_write(0), + m_count(0), + m_block(0) + { + } + + //! channels must be a power of two and a multiple of Oversample. The input rate has + //! to be channels * spacing, and for Iridium the spacing wanted is 31.25 kHz, so + //! 8 MS/s gives 256 channels, 4 MS/s gives 128, and so on + void configure(int channels, int tapsPerBranch = 12) + { + m_channels = channels; + m_decimation = channels / Oversample; + m_tapsPerBranch = tapsPerBranch; + m_length = channels * tapsPerBranch; + + designPrototype(); + + m_delay.assign(m_length, Cd(0.0, 0.0)); + m_out.assign(m_channels, Cd(0.0, 0.0)); + m_write = 0; + m_count = 0; + m_block = 0; + + m_fft.configure(channels); + buildRotations(); + } + + int channels() const { return m_channels; } + int decimation() const { return m_decimation; } + + //! Channel spacing, which is also how far apart the channel centres below are + double spacing(double inputRate) const { return inputRate / (double) m_channels; } + + //! Output sample rate of every channel + double channelRate(double inputRate) const { return inputRate / (double) m_decimation; } + + //! Where channel c sits relative to the centre of the band, in Hz. The upper half of + //! the channels are the negative frequencies, as they are in any transform + double channelOffset(int c, double inputRate) const + { + const double step = spacing(inputRate); + + return (c < (m_channels / 2)) ? (c * step) : ((c - m_channels) * step); + } + + //! Feeds one input sample. Returns true when a block of channel samples is ready, + //! one per channel, in channelSamples() + bool processSample(const Cd& sample) + { + m_delay[m_write] = sample; + m_write = (m_write + 1) % m_length; + m_count++; + + if (m_count < m_decimation) { + return false; + } + + m_count = 0; + computeBlock(); + + return true; + } + + const std::vector& channelSamples() const { return m_out; } + + //! The prototype lowpass the bank is built from. Exposed so a test can filter a + //! channel directly with the same taps and check the bank against it + const std::vector& prototype() const { return m_proto; } + +private: + + //! Prototype lowpass, Kaiser windowed sinc. + //! + //! The cutoff is a little wider than the channel spacing, so that a burst sitting + //! between two channel centres is still passed whole by one of them. That makes + //! neighbouring channels overlap, which is why the same burst can be found twice. + //! The stopband has to be inside the output Nyquist - two channel spacings away with + //! this much oversampling - or what is rejected would fold back in + void designPrototype() + { + const int taps = m_length; + const double cutoff = 1.05 / (double) m_channels; // Cycles per input sample + const double beta = 0.1102 * (60.0 - 8.7); // Kaiser, for 60 dB stopband + + m_proto.assign(taps, 0.0); + double sum = 0.0; + + for (int n = 0; n < taps; n++) + { + const double x = (double) n - ((double) (taps - 1) / 2.0); + const double sinc = (std::fabs(x) < 1e-12) + ? (2.0 * cutoff) + : (std::sin(2.0 * M_PI * cutoff * x) / (M_PI * x)); + const double t = ((2.0 * (double) n) / (double) (taps - 1)) - 1.0; + const double window = besselI0(beta * std::sqrt(std::max(0.0, 1.0 - (t * t)))) / besselI0(beta); + + m_proto[n] = sinc * window; + sum += m_proto[n]; + } + + // Unit gain at DC, so a channel output has the same amplitude as its input + for (int n = 0; n < taps; n++) { + m_proto[n] *= (double) m_channels / sum; + } + } + + static double besselI0(double x) + { + double sum = 1.0; + double term = 1.0; + + for (int k = 1; k < 40; k++) + { + term *= (x * x) / (4.0 * (double) k * (double) k); + sum += term; + + if (term < (1e-16 * sum)) { + break; + } + } + + return sum; + } + + void buildRotations() + { + // The phase each channel output carries, as a table indexed by the block counter + // and the channel. + // + // Decimating by M / Oversample rather than by M leaves a step of + // exp(-j2.pi.c.r / Oversample) on channel c at block r, which repeats every + // Oversample blocks. On top of that the first block is emitted once D samples + // have arrived, so it corresponds to input sample D - 1 rather than 0, and that + // offset puts a further constant exp(-j2.pi.c.(D - 1) / M) on each channel. + // Differential demodulation would not notice a constant phase, but folding it in + // costs nothing and makes a channel output exactly what mixing that channel down + // and filtering it would have given - which is what the test checks against + m_rotation.assign(Oversample * m_channels, Cd(0.0, 0.0)); + + for (int r = 0; r < Oversample; r++) + { + for (int c = 0; c < m_channels; c++) + { + const double angle = -2.0 * M_PI * (double) c + * (((double) (r * m_decimation)) + (double) (m_decimation - 1)) + / (double) m_channels; + + m_rotation[(r * m_channels) + c] = Cd(std::cos(angle), std::sin(angle)); + } + } + } + + //! out[i] += in[-i] * h[i], for a run of i. The input walks backwards, because branch + //! p of the bank takes the sample p further back down the delay line, and the run has + //! already been cut so that neither side crosses the end of the buffer. + //! + //! A complex double is exactly one 128 bit register, so a vector unit does the + //! multiply and the add on the real and imaginary parts together rather than one + //! after the other. Two runs are kept going at once because each is a chain of + //! dependent adds, and one chain on its own leaves the pipeline waiting on itself + static void accumulate(Cd *out, const Cd *in, const double *h, int run) + { +#if defined(USE_SSE4_1) + int i = 0; + + for (; (i + 1) < run; i += 2) + { + const __m128d a0 = _mm_loadu_pd((const double *) (in - i)); + const __m128d a1 = _mm_loadu_pd((const double *) (in - i - 1)); + const __m128d o0 = _mm_loadu_pd((double *) (out + i)); + const __m128d o1 = _mm_loadu_pd((double *) (out + i + 1)); + + _mm_storeu_pd((double *) (out + i), + _mm_add_pd(o0, _mm_mul_pd(a0, _mm_set1_pd(h[i])))); + _mm_storeu_pd((double *) (out + i + 1), + _mm_add_pd(o1, _mm_mul_pd(a1, _mm_set1_pd(h[i + 1])))); + } + + for (; i < run; i++) + { + const __m128d a = _mm_loadu_pd((const double *) (in - i)); + const __m128d o = _mm_loadu_pd((double *) (out + i)); + + _mm_storeu_pd((double *) (out + i), + _mm_add_pd(o, _mm_mul_pd(a, _mm_set1_pd(h[i])))); + } +#else + for (int i = 0; i < run; i++) + { + const Cd& sample = in[-i]; + const double tap = h[i]; + + out[i] += Cd(sample.real() * tap, sample.imag() * tap); + } +#endif + } + + void computeBlock() + { + const int newest = (m_write - 1 + m_length) % m_length; + + // Each branch filters every Mth sample of the delay line, which is what makes one + // prototype filter serve as the whole bank. Written straight into the output, + // because the transform below is in place and a copy of the whole bank every + // block is megabytes a second for nothing. + // + // The loop runs tap first and branch second, which looks the wrong way round - + // the branch accumulator cannot stay in a register, and the output is read and + // written once per tap instead of once per block. It is much faster anyway, + // because branch first walks both the delay line and the prototype in strides of + // a whole channel count: at 256 channels that is a 4 kB step per access, which no + // prefetcher will follow. This way all three arrays are walked one element at a + // time, which also makes the inner loop something a vector unit can do + std::fill(m_out.begin(), m_out.end(), Cd(0.0, 0.0)); + + for (int q = 0; q < m_tapsPerBranch; q++) + { + // Branch p reads the sample this far back, so p ascending walks backwards + // down the delay line from here + int index = newest - (q * m_channels); + + while (index < 0) { + index += m_length; + } + + const double *tap = &m_proto[q * m_channels]; + int p = 0; + + while (p < m_channels) + { + // As far as can be gone before the delay line wraps round to its end + const int run = std::min(m_channels - p, index + 1); + + accumulate(&m_out[p], &m_delay[index], &tap[p], run); + + p += run; + index -= run; + + if (index < 0) { + index += m_length; + } + } + } + + m_fft.transform(m_out, true); + + // The phase for this block, which is where the oversampling is paid for + const int base = m_block * m_channels; + + for (int c = 0; c < m_channels; c++) { + m_out[c] *= m_rotation[base + c]; + } + + m_block = (m_block + 1) % Oversample; + } + + int m_channels; + int m_decimation; + int m_tapsPerBranch; + int m_length; + int m_write; + int m_count; + int m_block; + + std::vector m_proto; + std::vector m_delay; + std::vector m_out; + std::vector m_rotation; + AcarsIridiumFft m_fft; +}; + +#endif // INCLUDE_ACARSIRIDIUMCHANNELIZER_H diff --git a/plugins/channelrx/demodacars/acarsiridiumfft.h b/plugins/channelrx/demodacars/acarsiridiumfft.h new file mode 100644 index 000000000..699039574 --- /dev/null +++ b/plugins/channelrx/demodacars/acarsiridiumfft.h @@ -0,0 +1,147 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSIRIDIUMFFT_H +#define INCLUDE_ACARSIRIDIUMFFT_H + +#include +#include +#include + +#if defined(USE_SSE4_1) +#include +#endif + +// A small radix 2 transform, shared by the Iridium channelizer and the burst receiver. +// +// Both only ever need power of two sizes, and both are in a plugin that should not drag +// a transform library in behind it, so this is deliberately plain. It is not fast by the +// standards of a real FFT library; it is fast enough, and the sizes are small. + +class AcarsIridiumFft +{ +public: + typedef std::complex Cd; + + //! Prepares for transforms of the given size, which must be a power of two + void configure(int size) + { + if (m_size == size) { + return; + } + + m_size = size; + m_twiddle.resize(size / 2); + m_twiddleInverse.resize(size / 2); + + for (int k = 0; k < (size / 2); k++) + { + const double angle = -2.0 * M_PI * (double) k / (double) size; + + m_twiddle[k] = Cd(std::cos(angle), std::sin(angle)); + m_twiddleInverse[k] = std::conj(m_twiddle[k]); + } + } + + int size() const { return m_size; } + + //! In place transform. inverse runs the same butterflies with the conjugate twiddles + //! and no scaling, which is what a filter bank wants + void transform(std::vector& data, bool inverse = false) const + { + const int n = m_size; + + for (int i = 1, j = 0; i < n; i++) + { + int bit = n >> 1; + + for (; j & bit; bit >>= 1) { + j ^= bit; + } + + j ^= bit; + + if (i < j) { + std::swap(data[i], data[j]); + } + } + + // Both tables are precomputed: conjugating inside the butterfly meant doing it + // once per butterfly, which for a bank running tens of thousands of transforms a + // second is a great deal of work to repeat for a table that never changes + const Cd *twiddle = inverse ? m_twiddleInverse.data() : m_twiddle.data(); + + for (int len = 2; len <= n; len <<= 1) + { + const int step = n / len; + const int half = len / 2; + + for (int i = 0; i < n; i += len) + { + Cd *lower = &data[i]; + Cd *upper = &data[i + half]; + + for (int k = 0; k < half; k++) + { +#if defined(USE_SSE4_1) + // A complex double fills one 128 bit register. The product of two of + // them is the classic shuffle and alternating add: ac - bd in the + // real half and bc + ad in the imaginary half, which addsub does in + // one instruction instead of the sign juggling it would otherwise take + const __m128d x = _mm_loadu_pd((const double *) &upper[k]); + const __m128d y = _mm_loadu_pd((const double *) &twiddle[k * step]); + const __m128d t1 = _mm_mul_pd(x, _mm_unpacklo_pd(y, y)); + const __m128d t2 = _mm_mul_pd(_mm_shuffle_pd(x, x, 1), _mm_unpackhi_pd(y, y)); + const __m128d v = _mm_addsub_pd(t1, t2); + const __m128d u = _mm_loadu_pd((const double *) &lower[k]); + + _mm_storeu_pd((double *) &lower[k], _mm_add_pd(u, v)); + _mm_storeu_pd((double *) &upper[k], _mm_sub_pd(u, v)); +#else + const Cd w = twiddle[k * step]; + const Cd u = lower[k]; + const Cd v = upper[k] * w; + + lower[k] = u + v; + upper[k] = u - v; +#endif + } + } + } + } + + //! The smallest power of two at least as large as n + static int nextPowerOfTwo(int n) + { + int size = 1; + + while (size < n) { + size <<= 1; + } + + return size; + } + +private: + + int m_size = 0; + std::vector m_twiddle; + std::vector m_twiddleInverse; +}; + +#endif // INCLUDE_ACARSIRIDIUMFFT_H diff --git a/plugins/channelrx/demodacars/acarsiridiumframe.h b/plugins/channelrx/demodacars/acarsiridiumframe.h new file mode 100644 index 000000000..5657d56f8 --- /dev/null +++ b/plugins/channelrx/demodacars/acarsiridiumframe.h @@ -0,0 +1,1118 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSIRIDIUMFRAME_H +#define INCLUDE_ACARSIRIDIUMFRAME_H + +#include +#include +#include + +#include +#include +#include +#include +#include + +// Iridium frame layer: takes the bit stream AcarsIridiumReceiver produces from the unique +// word onwards and turns it into a frame. +// +// The frame formats, the BCH polynomials and the interleaving are all taken from +// iridium-toolkit (bitsparser.py and bch.py), which is the only published description of +// them; the names used here follow its names so the two can be compared. Nothing here was +// guessed - where a constant appears without an obvious meaning, that is because it has +// none in the reference either. +// +// Two frame types matter to this plugin: +// +// - IRA, the ring alert broadcast. It is simplex, continuous, and carries the +// transmitting satellite's position, so it is what proves the receiver works: an +// IRA frame that passes BCH gives a geocentric radius that must come out at the +// Iridium orbit, a little over 7100 km, or the chain is wrong somewhere. +// +// - IDA, the short burst data frames on the duplex traffic channels. These are what +// carry ACARS: an aircraft's satcom unit sends its ACARS block as short burst data, +// which arrives as the payload of a run of IDA frames that have to be put back +// together in order before the block can be parsed. + +class AcarsIridiumFrame +{ +public: + enum Type + { + TypeUnknown = 0, + TypeIRA, //!< Ring alert broadcast, simplex + TypeIBC, //!< Broadcast, duplex + TypeIMS, //!< Paging / messaging + TypeIDA, //!< Short burst data, which is what carries ACARS + TypeLCW //!< A link control word frame that is not data + }; + + Type m_type = TypeUnknown; + bool m_uplink = false; + int m_bchErrorsFixed = 0; + + // IRA + int m_satellite = 0; + int m_beam = 0; + double m_latitude = 0.0; //!< Geocentric, degrees + double m_longitude = 0.0; //!< Degrees + double m_radiusKm = 0.0; //!< From the centre of the Earth + double m_altitudeKm = 0.0; //!< Above a spherical Earth, so only approximate + int m_interval = 0; + int m_slot = 0; + int m_posX = 0; //!< Units of 4 km from the centre of the Earth + int m_posY = 0; + int m_posZ = 0; + QList m_tmsi; //!< Paged subscribers + + // IDA + int m_frameType = -1; //!< The LCW frame type field, 2 for data + int m_counter = 0; //!< Position of this frame in a sequence + int m_dataLength = 0; + bool m_continues = false; //!< More frames follow in this sequence + bool m_crcOk = false; + QByteArray m_data; //!< Short burst data payload + + QString toString() const + { + switch (m_type) + { + case TypeIRA: + { + QString s = QString("IRA sat=%1 beam=%2 int=%3 slot=%4 xyz=%5,%6,%7 %8 %9 %10 km") + .arg(m_satellite).arg(m_beam).arg(m_interval).arg(m_slot) + .arg(m_posX).arg(m_posY).arg(m_posZ) + .arg(m_latitude, 0, 'f', 2).arg(m_longitude, 0, 'f', 2) + .arg(m_altitudeKm, 0, 'f', 0); + + for (int i = 0; i < m_tmsi.size(); i++) { + s += QString(" tmsi:%1").arg(m_tmsi[i], 8, 16, QChar('0')); + } + + return s; + } + case TypeIDA: + return QString("IDA ctr=%1 len=%2%3 crc=%4 [%5]") + .arg(m_counter).arg(m_dataLength) + .arg(m_continues ? "+" : " ") + .arg(m_crcOk ? "ok" : "no") + .arg(QString(m_data.toHex('.'))); + case TypeIBC: + return QString("IBC"); + case TypeIMS: + return QString("IMS"); + case TypeLCW: + return QString("LCW ft=%1").arg(m_frameType); + default: + return QString("?"); + } + } +}; + +class AcarsIridiumFrameDecoder +{ +public: + + // BCH generator polynomials, as iridium-toolkit names them + static const int RingAlertBchPoly = 1207; + static const int MessagingBchPoly = 1897; + static const int AcchBchPoly = 3545; + static const int HeaderPoly = 29; + + //! The access codes, which are the differential unique words after Gray coding, and + //! so are what the frame bit stream starts with + static const char *downlinkAccess() { return "001100000011000011110011"; } + static const char *uplinkAccess() { return "110011000011110011111100"; } + + //! The fixed 32 bit header a paging frame starts with + static const char *messagingHeader() { return "00110011111100110011001111110011"; } + + //! CRC-16/CCITT-FALSE, which short burst data frames carry. Public so a test can + //! check it against the published check value for this CRC + static quint16 crc16CcittFalse(const QByteArray& data) + { + quint16 crc = 0xffff; + + for (int i = 0; i < data.size(); i++) + { + crc ^= (quint16) ((quint8) data[i]) << 8; + + for (int b = 0; b < 8; b++) + { + if (crc & 0x8000) { + crc = (quint16) ((crc << 1) ^ 0x1021); + } else { + crc = (quint16) (crc << 1); + } + } + } + + return crc; + } + + bool decode(const std::vector& frameBits, AcarsIridiumFrame& frame) const + { + const std::string bits = toString(frameBits); + + if (bits.size() < 24) { + return false; + } + + // The receiver allows the unique word two wrong symbols, which is up to four + // wrong bits here, so the access code is matched to the same tolerance rather + // than exactly - otherwise the weaker bursts it syncs would be dropped again + const int downlinkErrors = bitErrors(bits, downlinkAccess()); + const int uplinkErrors = bitErrors(bits, uplinkAccess()); + + if (std::min(downlinkErrors, uplinkErrors) > 4) { + return false; + } + + frame.m_uplink = (uplinkErrors < downlinkErrors); + + const std::string data = bits.substr(24); + + if (decodeRingAlert(data, frame)) { + return true; + } + + if (decodeMessaging(data, frame)) { + return true; + } + + if (decodeLcw(data, frame)) { + return true; + } + + return false; + } + +private: + + static std::string toString(const std::vector& bits) + { + std::string s; + s.reserve(bits.size()); + + for (size_t i = 0; i < bits.size(); i++) { + s.push_back(bits[i] ? '1' : '0'); + } + + return s; + } + + //! How many of the first bits of the stream differ from the given pattern + static int bitErrors(const std::string& bits, const char *pattern) + { + int errors = 0; + + for (int i = 0; pattern[i] != 0; i++) + { + if (bits[i] != pattern[i]) { + errors++; + } + } + + return errors; + } + + static int bitLength(quint32 value) + { + int length = 0; + + while (value) + { + length++; + value >>= 1; + } + + return length; + } + + //! Remainder of a polynomial division in GF(2), which is what a BCH syndrome is. The + //! same as nndivide() in iridium-toolkit + static quint32 gfMod(quint32 poly, quint32 num) + { + if (num == 0) { + return 0; + } + + int shift = bitLength(num) - bitLength(poly); + quint32 top = 1u << (bitLength(num) - 1); + + while (shift >= 0) + { + if (num >= top) { + num ^= (poly << shift); + } + + top >>= 1; + shift--; + } + + return num; + } + + static quint32 toInt(const std::string& bits, size_t start, size_t length) + { + quint32 value = 0; + + for (size_t i = 0; i < length; i++) { + value = (value << 1) | (quint32) (bits[start + i] == '1' ? 1 : 0); + } + + return value; + } + + static std::string fromInt(quint32 value, int length) + { + std::string s(length, '0'); + + for (int i = length - 1; i >= 0; i--) + { + s[i] = (value & 1) ? '1' : '0'; + value >>= 1; + } + + return s; + } + + //! Corrects up to two bit errors in a BCH block by trying every flip, which for the + //! block lengths here is at most a few hundred divisions. iridium-toolkit builds + //! syndrome tables instead, but a burst arrives only every 90 ms, so there is nothing + //! to be gained from the tables and this needs no initialisation + //! + //! Returns the number of errors corrected, or -1 when the block cannot be corrected + static int bchRepair(int poly, const std::string& block, std::string& repaired) + { + const int length = (int) block.size(); + const quint32 value = toInt(block, 0, length); + + if (gfMod(poly, value) == 0) + { + repaired = block; + return 0; + } + + for (int b1 = 0; b1 < length; b1++) + { + const quint32 try1 = value ^ (1u << b1); + + if (gfMod(poly, try1) == 0) + { + repaired = fromInt(try1, length); + return 1; + } + } + + for (int b1 = 0; b1 < length; b1++) + { + const quint32 try1 = value ^ (1u << b1); + + for (int b2 = b1 + 1; b2 < length; b2++) + { + const quint32 try2 = try1 ^ (1u << b2); + + if (gfMod(poly, try2) == 0) + { + repaired = fromInt(try2, length); + return 2; + } + } + } + + return -1; + } + + //! The data part of a corrected BCH block, which is everything above the check bits + static std::string bchData(int poly, const std::string& repaired) + { + return repaired.substr(0, repaired.size() - (bitLength((quint32) poly) - 1)); + } + + static int onesCount(const std::string& bits) + { + int count = 0; + + for (size_t i = 0; i < bits.size(); i++) + { + if (bits[i] == '1') { + count++; + } + } + + return count; + } + + //! The two way interleave: bit pairs are swapped and then read backwards, alternating + //! between the two output blocks. de_interleave() in iridium-toolkit + static void deInterleave(const std::string& group, std::string& odd, std::string& even) + { + std::vector symbols; + + for (size_t z = 0; (z + 1) < group.size(); z += 2) { + symbols.push_back(std::string(1, group[z+1]) + std::string(1, group[z])); + } + + odd.clear(); + even.clear(); + + for (int x = (int) symbols.size() - 1; x >= 0; x -= 2) { + odd += symbols[x]; + } + + for (int x = (int) symbols.size() - 2; x >= 0; x -= 2) { + even += symbols[x]; + } + } + + //! The three way interleave the ring alert header uses. de_interleave3() + static void deInterleave3(const std::string& group, std::string& first, std::string& second, std::string& third) + { + std::vector symbols; + + for (size_t z = 0; (z + 1) < group.size(); z += 2) { + symbols.push_back(std::string(1, group[z+1]) + std::string(1, group[z])); + } + + first.clear(); + second.clear(); + third.clear(); + + for (int x = (int) symbols.size() - 1; x >= 0; x -= 3) { + first += symbols[x]; + } + + for (int x = (int) symbols.size() - 2; x >= 0; x -= 3) { + second += symbols[x]; + } + + for (int x = (int) symbols.size() - 3; x >= 0; x -= 3) { + third += symbols[x]; + } + } + + //! The link control word interleave, which is a fixed table rather than a pattern. + //! de_interleave_lcw(); the table is one based, as it is in the reference + static void deInterleaveLcw(const std::string& bits, std::string& lcw1, std::string& lcw2, std::string& lcw3) + { + static const int table[46] = { + 40, 39, 36, 35, 32, 31, 28, 27, 24, 23, 20, 19, 16, 15, 12, 11, 8, 7, 4, 3, + 41, 38, 37, 34, 33, 30, 29, 26, 25, 22, 21, 18, 17, 14, 13, 10, 9, 6, 5, 2, + 1, 46, 45, 44, 43, 42 + }; + + std::string all; + + for (int i = 0; i < 46; i++) { + all += bits[table[i] - 1]; + } + + lcw1 = all.substr(0, 7); + lcw2 = all.substr(7, 13); + lcw3 = all.substr(20); + } + + //! Runs a run of 32 bit BCH blocks, each of which carries 21 data bits plus a parity + //! bit, and concatenates what they decode to. Used by IRA and IMS + static bool bchBlocks32(const std::vector& blocks, int poly, std::string& out, int& fixed) + { + out.clear(); + fixed = 0; + + for (size_t i = 0; i < blocks.size(); i++) + { + if (blocks[i].size() != 32) { + break; + } + + const std::string parity = blocks[i].substr(31, 1); + std::string repaired; + const int errors = bchRepair(poly, blocks[i].substr(0, 31), repaired); + + if (errors < 0) { + break; + } + + // The spare bit makes the whole 32 even, which catches a block the BCH has + // "corrected" into a different valid codeword + if (((onesCount(repaired) + onesCount(parity)) % 2) == 1) { + break; + } + + fixed += (errors > 0) ? 1 : 0; + out += bchData(poly, repaired); + } + + return !out.empty(); + } + + //! IRA, the ring alert broadcast. Three 32 bit blocks interleaved three ways carry a + //! 63 bit header, and any further 64 bit groups carry pages + bool decodeRingAlert(const std::string& data, AcarsIridiumFrame& frame) const + { + if (data.size() < 96) { + return false; + } + + std::string ra1, ra2, ra3; + deInterleave3(data.substr(0, 96), ra1, ra2, ra3); + + // Classified on all three blocks being valid before anything is corrected, which + // is what keeps a frame of another type from being read as a ring alert + if ((gfMod(RingAlertBchPoly, toInt(ra1, 0, 31)) != 0) + || (gfMod(RingAlertBchPoly, toInt(ra2, 0, 31)) != 0) + || (gfMod(RingAlertBchPoly, toInt(ra3, 0, 31)) != 0)) { + return false; + } + + std::vector blocks; + blocks.push_back(ra1); + blocks.push_back(ra2); + blocks.push_back(ra3); + + for (size_t p = 96; (p + 64) <= data.size(); p += 64) + { + std::string b1, b2; + deInterleave(data.substr(p, 64), b1, b2); + blocks.push_back(b1); + blocks.push_back(b2); + } + + std::string decoded; + int fixed = 0; + + if (!bchBlocks32(blocks, RingAlertBchPoly, decoded, fixed)) { + return false; + } + + if (decoded.size() < 63) { + return false; + } + + frame.m_type = AcarsIridiumFrame::TypeIRA; + frame.m_bchErrorsFixed = fixed; + frame.m_satellite = (int) toInt(decoded, 0, 7); + frame.m_beam = (int) toInt(decoded, 7, 6); + + // Three signed 12 bit positions, in units of 4 km from the centre of the Earth + const double x = signed12(decoded, 13); + const double y = signed12(decoded, 25); + const double z = signed12(decoded, 37); + + frame.m_interval = (int) toInt(decoded, 49, 7); + frame.m_slot = (int) toInt(decoded, 56, 1); + frame.m_posX = (int) x; + frame.m_posY = (int) y; + frame.m_posZ = (int) z; + + // Geocentric rather than geodetic, so up to 0.2 degrees out in latitude + frame.m_latitude = std::atan2(z, std::sqrt((x * x) + (y * y))) * 180.0 / M_PI; + frame.m_longitude = std::atan2(y, x) * 180.0 / M_PI; + frame.m_radiusKm = std::sqrt((x * x) + (y * y) + (z * z)) * 4.0; + frame.m_altitudeKm = frame.m_radiusKm - 6371.0; + + // Pages of 42 bits, ending with an all ones page + for (size_t p = 63; (p + 42) <= decoded.size(); p += 42) + { + const std::string page = decoded.substr(p, 42); + + if (onesCount(page) == 42) { + break; + } + + frame.m_tmsi.append(toInt(page, 0, 32)); + } + + return true; + } + + static double signed12(const std::string& bits, size_t start) + { + const double magnitude = (double) toInt(bits, start + 1, 11); + + return magnitude - ((bits[start] == '1') ? 2048.0 : 0.0); + } + + //! IMS, the paging frames, which start with a fixed header + bool decodeMessaging(const std::string& data, AcarsIridiumFrame& frame) const + { + if (data.size() < 32) { + return false; + } + + if (data.compare(0, 32, messagingHeader()) != 0) { + return false; + } + + std::vector blocks; + + for (size_t p = 32; (p + 64) <= data.size(); p += 64) + { + std::string b1, b2; + deInterleave(data.substr(p, 64), b1, b2); + blocks.push_back(b1); + blocks.push_back(b2); + } + + std::string decoded; + int fixed = 0; + bchBlocks32(blocks, MessagingBchPoly, decoded, fixed); + + frame.m_type = AcarsIridiumFrame::TypeIMS; + frame.m_bchErrorsFixed = fixed; + + return true; + } + + //! A duplex traffic frame. The link control word says what the rest of it is, and + //! frame type 2 is short burst data, which is the one that can carry ACARS + bool decodeLcw(const std::string& data, AcarsIridiumFrame& frame) const + { + if (data.size() < 64) { + return false; + } + + std::string lcw1, lcw2, lcw3; + deInterleaveLcw(data.substr(0, 46), lcw1, lcw2, lcw3); + + if ((gfMod(HeaderPoly, toInt(lcw1, 0, 7)) != 0) || (gfMod(41, toInt(lcw3, 0, 26)) != 0)) { + return false; + } + + // One bit of the middle word is not transmitted, so both values are tried + std::string repaired2; + int errors2 = bchRepair(465, lcw2 + "0", repaired2); + + if (errors2 != 0) { + errors2 = bchRepair(465, lcw2 + "1", repaired2); + } + + if (errors2 != 0) { + return false; + } + + frame.m_frameType = (int) toInt(bchData(HeaderPoly, lcw1), 0, 3); + frame.m_type = AcarsIridiumFrame::TypeLCW; + + if (frame.m_frameType != 2) { + return true; + } + + if (data.size() < (46 + 312)) { + return true; + } + + return decodeData(data.substr(46, 312), frame); + } + + //! Short burst data. The payload is carried in 31 bit BCH blocks that have been + //! interleaved in two stages and then shuffled, and the order below is the reference + //! order - there is no pattern in it to derive + bool decodeData(const std::string& payload, AcarsIridiumFrame& frame) const + { + std::vector blocks; + size_t p = 0; + + for (; (p + 124) <= payload.size(); p += 124) + { + std::string b1, b2; + deInterleave(payload.substr(p, 124), b1, b2); + + const std::string joined = b1 + b2; + + if (joined.size() < 124) { + return false; + } + + blocks.push_back(joined.substr(93, 31)); + blocks.push_back(joined.substr(31, 31)); + blocks.push_back(joined.substr(62, 31)); + blocks.push_back(joined.substr(0, 31)); + } + + std::string tail = payload.substr(p); + + if ((tail.size() % 2) == 1) { + tail = tail.substr(0, tail.size() - 1); + } + + if (tail.size() >= 64) + { + std::string b1, b2; + deInterleave(tail, b1, b2); + + // Each of these has a bit more than the block, which is thrown away + blocks.push_back(b2.substr(1)); + blocks.push_back(b1.substr(1)); + } + + std::string decoded; + int fixed = 0; + + for (size_t i = 0; i < blocks.size(); i++) + { + if (blocks[i].size() != 31) { + return false; + } + + std::string repaired; + const int errors = bchRepair(AcchBchPoly, blocks[i], repaired); + + if (errors < 0) { + return false; + } + + fixed += (errors > 0) ? 1 : 0; + decoded += bchData(AcchBchPoly, repaired); + } + + if (decoded.size() < (9 * 20 + 16)) { + return false; + } + + // Three bits that are always zero in a valid frame, and so are the last check + // that this really is short burst data rather than a frame that happened to pass + if (toInt(decoded, 17, 3) != 0) { + return false; + } + + frame.m_type = AcarsIridiumFrame::TypeIDA; + frame.m_bchErrorsFixed = fixed; + frame.m_continues = (decoded[3] == '1'); + frame.m_counter = (int) toInt(decoded, 5, 3); + frame.m_dataLength = (int) toInt(decoded, 11, 5); + + for (size_t i = 20; (i + 8) <= (9 * 20); i += 8) { + frame.m_data.append((char) toInt(decoded, i, 8)); + } + + if (frame.m_dataLength > 0) + { + // The check is over the frame with the length field zeroed and the trailing + // four bits dropped, and includes the transmitted value, so a good frame + // gives a remainder of zero + std::string crcStream = decoded.substr(0, 20) + std::string(12, '0') + + decoded.substr(20, decoded.size() - 24); + QByteArray bytes; + + for (size_t i = 0; (i + 8) <= crcStream.size(); i += 8) { + bytes.append((char) toInt(crcStream, i, 8)); + } + + frame.m_crcOk = (crc16CcittFalse(bytes) == 0); + + if (frame.m_dataLength <= (int) frame.m_data.size()) { + frame.m_data = frame.m_data.left(frame.m_dataLength); + } + } + + return true; + } + +}; + +// Puts a run of IDA frames back together into one short burst data message, and pulls the +// ACARS block out of it. +// +// An ACARS block is far longer than the twenty bytes an IDA frame carries, so it arrives +// split across a run of frames that have to be collected in order. The rules for deciding +// that a frame continues a run are from ReassembleIDA in iridium-toolkit: the counter has +// to advance by one modulo eight, the direction has to match, and the frame has to arrive +// close enough in time and frequency to be the same transmitter. A frame whose +// continuation bit is clear ends the run. +// +// Confirmed on air: runs of several frames complete rather than time out, and ACARS +// blocks have been read out of the messages they build, passing the block CRC and +// accepted by AcarsMessage::decode +class AcarsIridiumReassembler +{ +public: + + // Tolerances from ReassembleIDA in iridium-toolkit, in milliseconds + static const qint64 ContinuationMs = 280; + static const qint64 TimeoutMs = 1000; + static const int FrequencyToleranceHz = 260; + + //! How far apart two frequencies in the band are, taking it as circular. + //! + //! The channelizer's output is periodic in the input rate, so its last channel sits + //! next to its first: a burst at one end of the band is reported near +rate/2 when it + //! is found in the channel below the fold and near -rate/2 when it is found in the + //! channel above, although the two are one spacing apart. A plain difference makes + //! that pair look a whole band apart, which both hides a duplicate and splits a run + //! of fragments that should have been joined + static double separation(double a, double b, double bandWidth) + { + double d = std::fabs(a - b); + + if (bandWidth > 0.0) + { + d = std::fmod(d, bandWidth); + + if (d > (bandWidth / 2.0)) { + d = bandWidth - d; + } + } + + return d; + } + + //! The width of the band the frequencies passed to addFrame are measured in, so that + //! the fold at its edge can be allowed for. Zero, the default, treats them as a plain + //! line, which is what a single channel receiver wants + void setBandWidth(double bandWidth) { m_bandWidth = bandWidth; } + + //! Feeds a frame. Returns true and fills message when a run has been completed + bool addFrame(const AcarsIridiumFrame& frame, qint64 timeMs, double frequency, QByteArray& message) + { + if (frame.m_type != AcarsIridiumFrame::TypeIDA) { + return false; + } + + // Only frames whose CRC passed are joined up: a bad frame in the middle of a run + // would corrupt the block without any later check noticing + if (!frame.m_crcOk) { + return false; + } + + expire(timeMs); + + for (int i = 0; i < m_partial.size(); i++) + { + Partial& partial = m_partial[i]; + + if ((partial.m_uplink != frame.m_uplink) + || (separation(partial.m_frequency, frequency, m_bandWidth) > FrequencyToleranceHz) + || (timeMs < partial.m_timeMs) + || ((timeMs - partial.m_timeMs) > ContinuationMs) + || (((partial.m_counter + 1) % 8) != frame.m_counter)) { + continue; + } + + partial.m_data.append(frame.m_data); + partial.m_counter = frame.m_counter; + partial.m_timeMs = timeMs; + partial.m_frequency = frequency; + + if (frame.m_continues) { + return false; + } + + message = partial.m_data; + m_partial.removeAt(i); + m_completed++; + + return true; + } + + if (frame.m_counter != 0) + { + // A fragment whose run was never seen, so there is nothing to attach it to + m_orphans++; + return false; + } + + if (!frame.m_continues) + { + // A whole message in one frame + message = frame.m_data; + m_completed++; + + return true; + } + + Partial partial; + partial.m_data = frame.m_data; + partial.m_counter = frame.m_counter; + partial.m_timeMs = timeMs; + partial.m_frequency = frequency; + partial.m_uplink = frame.m_uplink; + m_partial.append(partial); + + return false; + } + + //! Strips the short burst data transport from a reassembled message, leaving the + //! payload an application sent. + //! + //! A reassembled message is NOT an ACARS block, and missing this layer is why none + //! were ever found: every message starts with a two byte type, and the bytes seen on + //! air - 0x7608, 0x0600, 0x7605 - are those types, not content. Only once the type + //! and the headers behind it are off does the payload begin, and only then does a + //! leading SOH mean ACARS. Looking for SOH at the front of the whole message tests a + //! byte that can never be 1. + //! + //! Follows process_l2() of ReassembleIDASBD in iridium-toolkit + static bool sbdPayload(const QByteArray& message, bool uplink, QByteArray& payload) + { + if (message.size() < 5) { + return false; + } + + const quint8 type0 = (quint8) message[0]; + const quint8 type1 = (quint8) message[1]; + + // Only two of the type codes carry short burst data at all + if (type0 == 0x76) + { + if (type1 == 0x05) { + return false; + } + + // Which half of the link it is decides the range of subtypes that make sense + if (uplink) + { + if ((type1 < 0x0c) || (type1 > 0x0e)) { + return false; + } + } + else + { + if ((type1 < 0x08) || (type1 > 0x0b)) { + return false; + } + } + } + else if (type0 == 0x06) + { + if (type1 != 0x00) { + return false; + } + + const quint8 subType = (quint8) message[2]; + + if ((subType != 0x00) && (subType != 0x10) && (subType != 0x20) + && (subType != 0x40) && (subType != 0x50) && (subType != 0x70)) { + return false; + } + } + else + { + return false; + } + + QByteArray data = message.mid(2); + + if ((type0 == 0x06) && (type1 == 0x00)) + { + // The long form, whose header is a fixed 29 bytes + if ((data.size() < 30) || (((quint8) data[0]) != 0x20)) { + return false; + } + + data = data.mid(29); + } + else + { + if ((type0 == 0x76) && (type1 == 0x08)) + { + const quint8 lead = (quint8) data[0]; + const int length = (lead == 0x20) ? 5 : 7; + + if (data.size() <= length) { + return false; + } + + data = data.mid(length); + } + + // An acknowledgement in front of the payload, on the uplink only + if (uplink && (data.size() >= 3) + && ((((quint8) data[0]) == 0x50) || (((quint8) data[0]) == 0x51))) { + data = data.mid(3); + } + + if (data.isEmpty()) { + return false; + } + + // Three more bytes: a marker, the payload length, and which message this is + if ((data.size() > 3) && (((quint8) data[0]) == 0x10)) + { + const int length = (quint8) data[1]; + + data = data.mid(3); + + if (data.size() < length) { + return false; + } + + data = data.left(length); + } + else + { + // A payload with no header. iridium-toolkit warns and keeps it + } + } + + if (data.isEmpty()) { + return false; + } + + payload = data; + + return true; + } + + //! The ACARS block inside a reassembled short burst data message, if it holds one. + //! What counts as ACARS follows consume_l2() of ReassembleIDASBDACARS in + //! iridium-toolkit; the form the block is handed back in does NOT. + //! + //! iridium-toolkit strips the block down for its own parser - leading SOH off, + //! trailing check and DEL off, parity masked away. AcarsMessage::decode in this + //! plugin wants the opposite: the whole ARINC 618 block exactly as transmitted, from + //! SOH to DEL, with the odd parity still in bit 7 of every character. That is what + //! VDL-2, HFDL and Aero all hand it - see the note above acarsBlock() in acarsaero.h - + //! and SOH and DEL already have odd parity, so they compare equal to 0x01 and 0x7F + //! without masking. Handing over a stripped block instead would simply be rejected. + //! Confirmed on air - the blocks this hands over are accepted and their CRCs pass + static bool acarsBlock(const QByteArray& reassembled, bool uplink, QByteArray& block) + { + QByteArray message; + + // The short burst data transport first: what arrives is a typed, headed message, + // and the ACARS block is its payload + if (!sbdPayload(reassembled, uplink, message)) { + return false; + } + + // An ACARS block starts with SOH, which is what says this payload is ACARS + if ((message.size() <= 2) || (((quint8) message[0]) != 0x01)) { + return false; + } + + // A trailing DEL marks a message that carries its own check, in the two bytes + // before it. They do not carry parity, so everything below stops before them + int bodyEnd = message.size(); + QByteArray check; + + if (((quint8) message[message.size() - 1]) == 0x7f) + { + check = message.mid(message.size() - 3, 2); + bodyEnd = message.size() - 3; + } + + // Some messages carry eight bytes of undocumented header between the SOH and the + // block proper, recognised by the 3 that starts it + const bool header = (bodyEnd > 9) && (((quint8) message[1]) == 0x03); + const int bodyStart = header ? 9 : 1; + + if ((bodyEnd - bodyStart) < 13) { + return false; + } + + if (!check.isEmpty()) + { + // The check covers the block and itself, and NOT the eight byte header - the + // reference strips the header before computing it. Including the header made + // every message that had one fail, which is most of them: of three captured + // off the air, two had a header and were silently thrown away while the one + // without it decoded, so the fault looked like ACARS simply being rare + if (crc16Kermit(message.mid(bodyStart, bodyEnd - bodyStart) + check) != 0) { + return false; + } + } + + // Every character of an ACARS block has odd parity in bit 7. Testing it is worth + // doing - it is the only check a message without a trailing DEL gets - but the + // bits stay on, because that is the form the decoder and libacars want + for (int i = bodyStart; i < bodyEnd; i++) + { + quint8 c = (quint8) message[i]; + int ones = 0; + + for (int b = 0; b < 8; b++) + { + if (c & (1 << b)) { + ones++; + } + } + + if ((ones % 2) == 0) { + return false; + } + } + + // SOH, then the block, then its check and DEL: the layout AcarsMessage::decode + // expects, with the optional header taken out from between them + block = QByteArray(1, (char) 0x01) + message.mid(bodyStart); + + return true; + } + + int completedCount() const { return m_completed; } + int orphanCount() const { return m_orphans; } + int brokenCount() const { return m_broken; } + + //! CRC-16/KERMIT, which is what an ACARS block inside short burst data is checked + //! with. Reflected, so unlike the one the frame layer uses. Public so a test can + //! check it against the published check value for this CRC + static quint16 crc16Kermit(const QByteArray& data) + { + quint16 crc = 0; + + for (int i = 0; i < data.size(); i++) + { + crc ^= (quint16) ((quint8) data[i]); + + for (int b = 0; b < 8; b++) + { + if (crc & 1) { + crc = (quint16) ((crc >> 1) ^ 0x8408); + } else { + crc = (quint16) (crc >> 1); + } + } + } + + return crc; + } + +private: + + struct Partial + { + QByteArray m_data; + int m_counter = 0; + qint64 m_timeMs = 0; + double m_frequency = 0.0; + bool m_uplink = false; + }; + + void expire(qint64 timeMs) + { + for (int i = m_partial.size() - 1; i >= 0; i--) + { + if ((timeMs - m_partial[i].m_timeMs) >= TimeoutMs) + { + m_partial.removeAt(i); + m_broken++; + } + } + } + + QList m_partial; + double m_bandWidth = 0.0; + int m_completed = 0; + int m_orphans = 0; + int m_broken = 0; +}; + +#endif // INCLUDE_ACARSIRIDIUMFRAME_H diff --git a/plugins/channelrx/demodacars/acarsiridiumscanner.h b/plugins/channelrx/demodacars/acarsiridiumscanner.h new file mode 100644 index 000000000..373677de6 --- /dev/null +++ b/plugins/channelrx/demodacars/acarsiridiumscanner.h @@ -0,0 +1,315 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSIRIDIUMSCANNER_H +#define INCLUDE_ACARSIRIDIUMSCANNER_H + +#include +#include + +#include +#include +#include +#include +#include + +#include "acarsiridium.h" +#include "acarsiridiumframe.h" +#include "acarsiridiumchannelizer.h" + +// Watches the whole Iridium band at once. +// +// Iridium assigns a duplex channel when a call is set up, out of about 240 spaced +// 41.67 kHz across roughly 1619 to 1626 MHz, so a receiver watching one channel sees a +// few percent of what is on the air - measured on a four minute recording of the whole +// band, the busiest single channel carried 4% of the short burst data frames in it. This +// splits the band with the polyphase channelizer and runs a burst receiver on every +// output, which is what makes scanning practical without the user adding a demodulator +// per channel. +// +// The channelizer spacing is 31.25 kHz rather than the 41.67 kHz of the Iridium grid. +// Lining the two up would need a channel count divisible by three, and a transform of +// that size is far more work than a power of two; nothing needs them aligned, because a +// burst is found by searching its channel rather than by being assumed to sit in the +// middle of one. The cost is that neighbouring channels overlap, so a burst is often +// found twice, and the duplicates have to go - a frame decoded twice would otherwise +// break the short burst data reassembly, whose fragments have to arrive in counter order. + +//! The channelizer spacing, which with four times oversampling gives the 125 kHz the +//! receiver runs at. The input rate is this times the number of channels +#define ACARSIRIDIUM_SCAN_SPACING 31250 + +class AcarsIridiumScanner +{ +public: + typedef std::complex Cd; + + struct Detection + { + AcarsIridiumFrame m_frame; + double m_frequency = 0.0; //!< Hz from the centre of the band + double m_snrDb = 0.0; + qint64 m_sampleIndex = 0; //!< Where the burst started, in input samples + int m_channel = 0; + //!< A short burst data message, once a run of frames has been put back together. + //!< Reported whether or not it turns out to hold ACARS, because the step that + //!< reads an ACARS block out of one is the only part of the chain never tested + //!< against real traffic - if it ever wrongly refuses a message, that has to be + //!< visible rather than silently dropped + QByteArray m_message; + QByteArray m_acars; //!< A complete ACARS block, when one came out + }; + + AcarsIridiumScanner() : + m_channels(0), + m_decimation(0), + m_inputRate(0.0), + m_holdSamples(0), + m_sameTimeSamples(0), + m_sampleIndex(0) + { + } + + //! channels is the number of channelizer outputs, which fixes the input rate at + //! channels * ACARSIRIDIUM_SCAN_SPACING. It must be a power of two + void configure(int channels) + { + m_channels = channels; + m_inputRate = (double) channels * ACARSIRIDIUM_SCAN_SPACING; + m_holdSamples = (qint64) (HoldSeconds * m_inputRate); + m_sameTimeSamples = (qint64) (SameTimeSeconds * m_inputRate); + m_channelizer.configure(channels); + m_reassembler.setBandWidth(m_inputRate); + m_decimation = m_channelizer.decimation(); + m_receivers.clear(); + m_receivers.resize(channels); + m_pending.clear(); + m_detections.clear(); + m_sampleIndex = 0; + m_burstCount = 0; + m_duplicateCount = 0; + m_frameCount = 0; + m_idaCount = 0; + m_messageCount = 0; + m_acarsCount = 0; + } + + int channels() const { return m_channels; } + double inputRate() const { return m_inputRate; } + + //! Feeds one input sample at inputRate + void processSample(const Cd& sample) + { + m_sampleIndex++; + + if (!m_channelizer.processSample(sample)) { + return; + } + + const std::vector& channelSamples = m_channelizer.channelSamples(); + + for (int c = 0; c < m_channels; c++) + { + if (!m_receivers[c].processSample(channelSamples[c])) { + continue; + } + + while (m_receivers[c].hasBurst()) + { + AcarsIridiumReceiver::Burst burst = m_receivers[c].popBurst(); + + if (burst.m_direction == AcarsIridiumReceiver::DirectionUnknown) { + continue; + } + + Candidate candidate; + candidate.m_burst = burst; + candidate.m_channel = c; + candidate.m_frequency = m_channelizer.channelOffset(c, m_inputRate) + + burst.m_frequencyOffset; + // The receiver counts in its own channel samples + candidate.m_sampleIndex = burst.m_sampleIndex * m_decimation; + candidate.m_detectedAt = m_sampleIndex; + m_pending.push_back(candidate); + m_burstCount++; + } + } + + flush(false); + } + + //! Call when the input ends, so anything still held for duplicate checking is emitted + void finish() + { + flush(true); + } + + bool hasDetection() const { return !m_detections.empty(); } + + Detection popDetection() + { + Detection detection = m_detections.front(); + m_detections.pop_front(); + + return detection; + } + + int burstCount() const { return m_burstCount; } + int duplicateCount() const { return m_duplicateCount; } + int frameCount() const { return m_frameCount; } + int idaCount() const { return m_idaCount; } + int messageCount() const { return m_messageCount; } + int acarsCount() const { return m_acarsCount; } + +private: + + struct Candidate + { + AcarsIridiumReceiver::Burst m_burst; + int m_channel = 0; + double m_frequency = 0.0; + qint64 m_sampleIndex = 0; //!< Where the burst started + qint64 m_detectedAt = 0; //!< When it finished and was handed over + }; + + // How long a burst is held before being decoded, so that the same burst found in a + // neighbouring channel has arrived too and the better of the two can be taken. + // Measured from when the burst was handed over, not from when it started: a burst + // runs to 20 ms, so by the time it ends its start is long past and holding against + // that would expire immediately and let every duplicate through. + // + // A duration rather than a count of input samples, because the input rate spans eight + // to one across the bandwidth settings: as a fixed count this was 8 ms at 32 channels + // but 1 ms at 256, which is the wrong way round - the widest setting has the most + // overlapping neighbours and so needs the hold most + static constexpr double HoldSeconds = 0.008; + + // Two detections are the same burst when they start at about the same time and are at + // about the same frequency. Bursts on one channel are a time slot apart, roughly + // 9 ms, so this cannot merge two genuine transmissions; the channel spacing is + // 31.25 kHz, so the frequency tolerance is well inside it + static constexpr double SameTimeSeconds = 0.004; + static constexpr double SameFrequencyHz = 12000.0; + + void flush(bool all) + { + while (!m_pending.empty()) + { + if (!all && ((m_sampleIndex - m_pending.front().m_detectedAt) < m_holdSamples)) { + break; + } + + // Take the oldest, then find every other pending detection that is the same + // burst heard in an overlapping channel, and keep whichever has the best + // signal to noise - that is the one whose channel the burst sat nearest the + // middle of + Candidate best = m_pending.front(); + m_pending.pop_front(); + + for (size_t i = 0; i < m_pending.size(); ) + { + const Candidate& other = m_pending[i]; + + // The band is circular, so the channels either side of the fold at its + // edge are neighbours and a burst in both has to be recognised as one + if ((std::llabs(other.m_sampleIndex - best.m_sampleIndex) < m_sameTimeSamples) + && (AcarsIridiumReassembler::separation(other.m_frequency, best.m_frequency, m_inputRate) < SameFrequencyHz)) + { + if (other.m_burst.m_snrDb > best.m_burst.m_snrDb) { + best = other; + } + + m_pending.erase(m_pending.begin() + i); + m_duplicateCount++; + } + else + { + i++; + } + } + + decode(best); + } + } + + void decode(const Candidate& candidate) + { + Detection detection; + + if (!m_decoder.decode(candidate.m_burst.m_frameBits, detection.m_frame)) { + return; + } + + detection.m_frequency = candidate.m_frequency; + detection.m_snrDb = candidate.m_burst.m_snrDb; + detection.m_sampleIndex = candidate.m_sampleIndex; + detection.m_channel = candidate.m_channel; + m_frameCount++; + + if (detection.m_frame.m_type == AcarsIridiumFrame::TypeIDA) + { + m_idaCount++; + + const qint64 timeMs = (qint64) ((1000.0 * (double) candidate.m_sampleIndex) / m_inputRate); + QByteArray message; + + // Short burst data is reassembled per transmitter, and the reassembler tells + // them apart by frequency, so it is given the absolute frequency in the band + // rather than the offset within a channel + if (m_reassembler.addFrame(detection.m_frame, timeMs, candidate.m_frequency, message)) + { + QByteArray block; + + detection.m_message = message; + m_messageCount++; + + if (AcarsIridiumReassembler::acarsBlock(message, detection.m_frame.m_uplink, block)) + { + detection.m_acars = block; + m_acarsCount++; + } + } + } + + m_detections.push_back(detection); + } + + int m_channels; + int m_decimation; + double m_inputRate; + qint64 m_holdSamples; + qint64 m_sameTimeSamples; + qint64 m_sampleIndex; + + AcarsIridiumChannelizer m_channelizer; + std::vector m_receivers; + AcarsIridiumFrameDecoder m_decoder; + AcarsIridiumReassembler m_reassembler; + + std::deque m_pending; + std::deque m_detections; + + int m_burstCount = 0; + int m_duplicateCount = 0; + int m_frameCount = 0; + int m_idaCount = 0; + int m_messageCount = 0; + int m_acarsCount = 0; +}; + +#endif // INCLUDE_ACARSIRIDIUMSCANNER_H diff --git a/plugins/channelrx/demodacars/acarsmessage.cpp b/plugins/channelrx/demodacars/acarsmessage.cpp deleted file mode 100644 index c369566c6..000000000 --- a/plugins/channelrx/demodacars/acarsmessage.cpp +++ /dev/null @@ -1,2216 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include "acarsmessage.h" - -#include - -#include -#include - -#include "do219.h" - -// Imbedded Message Identifiers - ARINC 622: Table 2-1 -const QHash m_imis = { - {"AD1", "Automatic dependent surveillance (ARINC 745-1)"}, - {"ADS", "Automatic dependent surveillance (ARINC 745-2)"}, - {"DIS", "Automatic dependent surveillance (ARINC 745-1/2)"}, - {"AT0", "Air traffic control communication (Preceeding DO-219)"}, - {"AT1", "Air traffic control communication"}, // DO-219 / CPCLD - {"CR1", "Air traffic control communication - Connect request"}, - {"CC1", "Air traffic control communication - Connect confirm"}, - {"DR1", "Air traffic control communication - Disconnect request"} -}; - -#include "util/ourairportsdb.h" - -QSharedPointer> m_airportInfo; - -static QString icaoAirportName(const QString &icao) -{ - if (m_airportInfo) - { - if (m_airportInfo->contains(icao)) { - return m_airportInfo->value(icao)->m_name; - } - } - return ""; -} - -static QString icaoAndAirportName(const QString &icao) -{ - QString airportName = icaoAirportName(icao); - if (airportName.isEmpty()) { - return icao; - } else { - return QString("%1 (%2)").arg(icao).arg(airportName); - } -} - -AcarsMessage::AcarsMessage(const QByteArray &message) -{ - // Every field below is read at a fixed offset, so a block shorter than the smallest - // legal one would index off the end - and QString/QByteArray operator[] only asserts - // in a debug build, so a release build reads whatever is there instead of failing. - // decode() checks the length before it builds one of these, but nothing obliged it - // to: the test harness constructs an AcarsFlightStatus from an empty QByteArray to - // exercise decode() on its own. A short block leaves every field empty. - if (message.size() < ACARS_MIN_BYTES) { - return; - } - - // Mode is destination of message - // 2 = All ground stations / aircraft - Other characters are specific station / aircraft - // and country specific - m_mode = QString("%1").arg(message[1]); - - // Address is aircraft registration. Prefixed with '.'s if registration is shorter than field width - m_address = QString(message.mid(2, 7)); - while (m_address.startsWith(".")) { - m_address = m_address.mid(1); // Remove prefix - } - - m_ack = message[9]; - - // Label (type of message) - m_label = message.mid(10, 2); - - // Block ID indicates if downlink (0-9) or uplink (A-Z or NUL) - m_blockId = message[12]; - m_uplink = isUplink(m_blockId); - - // Extract text - qsizetype textSize = message.length() - 14 - 1 - 2 - 1; - if (textSize >= 10) - { - m_text = message.mid(14, textSize); - - if (!m_uplink) - { - // Extract downlink fields - m_originator = m_text[0]; - m_messageNumber = m_text.mid(1, 2); - m_blockSequence = m_text[3]; - m_flight = m_text.mid(4, 6); - // Remove extracted fields from text - m_text = m_text.mid(10); - // Is there a sublabel? (Typically for H1 label) - if ((m_text.size() >= 3) && (m_text[0] == '#')) - { - m_subLabel = m_text.mid(1, 2); - m_text = m_text.mid(3); - } - } - else - { - if (m_text.startsWith("- #")) - { - m_subLabel = m_text.mid(3, 2); - m_text = m_text.mid(5); - } - } - } - - m_multiBlock = message[message.length() - 4] == ASCII_ETB; -} - -QString AcarsMessage::toString() -{ - return ""; // Return nothing, as we don't know how to decode this message -} - -AcarsMessage *AcarsMessage::decode(const QByteArray &message) -{ - // A no-text block is 17 bytes and has ETX directly after the block identifier. STX is - // present only when text follows (ARINC 618 Appendix B). - const bool noText = (message.size() == 17) && ((message[13] & 0x7f) == ASCII_ETX); - const bool hasText = (message.size() >= 18) && ((message[13] & 0x7f) == ASCII_STX); - - if ((noText || hasText) - && (message[0] == (char)ASCII_SOH) - && (message[message.size()-1] == (char)ASCII_DEL)) - { - // Remove parity bit from MSB - QByteArray ascii = message; - for (int i = 0; i < message.length(); i++) { - ascii[i] = ascii[i] & 0x7f; - } - - // Extract label (type of message) - QString label(ascii.mid(10, 2)); - - // Extract block identifier to determine if uplink or downlink - QChar blockId(ascii[12]); - bool uplink = isUplink(blockId); - - // Extract message text - int start = 14; - if (!uplink) { - start += 10; // Skip msg num and flight - } - - QString text; - qsizetype textSize = message.length() - start - 1 - 2 - 1; - if (textSize > 0) { - text = ascii.mid(start, textSize); - } - - return decode(ascii, label, text, uplink); - } - else - { - return nullptr; - } -} - -AcarsMessage *AcarsMessage::decode(const QByteArray &message, const QString &label, const QString &text, bool uplink) -{ - AcarsMessage *acarsMessage; - if (label == ":;") { - acarsMessage = new AcarsDataTransceiverAutoTune(message); - } else if (label == "52") { - acarsMessage = new AcarsGroundUTCRequest(message); - } else if (label == "5U") { - acarsMessage = new AcarsWeatherRequest(message); - } else if ((label == "10") || (label == "12") || (label == "22") || (label == "24") || (label == "44")) { - acarsMessage = new AcarsPositionReport(message); - } else if (label == "80") { - acarsMessage = new AcarsOpsReport(message); - } else if ((label == "13") || (label == "14") || (label == "17") || (label == "18")) { - acarsMessage = new AcarsEventReport(message); - } else if (label == "15") { - // Label 15 carries both FST01 flight status and /15 ON EVENT landing reports - if (text.startsWith("/15")) { - acarsMessage = new AcarsEventReport(message); - } else { - acarsMessage = new AcarsFlightStatus(message); - } - } else if (label == "16") { - // Label 16 carries both N space position reports and /16 IN EVENT gate reports - if (text.startsWith("/16")) { - acarsMessage = new AcarsEventReport(message); - } else { - acarsMessage = new AcarsPositionReport(message); - } - } else if (label == "A0") { - acarsMessage = new AcarsATSFacilitiesNotification(message); - } else if (label == "A1") { - acarsMessage = new AcarsOceanicClearanceResponse(message); - } else if (label == "A3") { - acarsMessage = new AcarsDepartureClearanceResponse(message); - } else if (label == "A4") { - acarsMessage = new AcarsFlightSystemsMessage(message); - } else if (label == "A9") { - acarsMessage = new AcarsATISReport(message); - } else if (label == "B0") { - acarsMessage = new AcarsATSFacilitiesNotification(message); - } else if (label == "B1") { - acarsMessage = new AcarsRequestOceanicClearance(message); - } else if (label == "B2") { - acarsMessage = new AcarsOceanicClearanceReadback(message); - } else if (label == "B9") { - acarsMessage = new AcarsRequestATISReport(message); - } else if (label == "AA") { - acarsMessage = new AcarsATCCommunications(message); - } else if (label == "BA") { - acarsMessage = new AcarsATCCommunications(message); - } else if (label == "H1") { - acarsMessage = new AcarsMessageFromSubsystem(message); - } else if (label == "QP") { - acarsMessage = new AcarsOutReport(message); - } else if (label == "QQ") { - acarsMessage = new AcarsOffReport(message); - } else if (label == "QR") { - acarsMessage = new AcarsOnReport(message); - } else if (label == "QS") { - acarsMessage = new AcarsInReport(message); - } else if (label == "QT") { - acarsMessage = new AcarsOutReturnInReport(message); - } else if (label == "SQ") { - acarsMessage = new AcarsSquitter(message); - } else { - acarsMessage = new AcarsMessage(message); - } - acarsMessage->decode(text); - return acarsMessage; -} - -// Block ID is 0-9 for downlink and A-Z for uplink -bool AcarsMessage::isUplink(QChar blockId) -{ - return !blockId.isDigit(); -} - -AcarsDataTransceiverAutoTune::AcarsDataTransceiverAutoTune(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsDataTransceiverAutoTune::decode(const QString &text) -{ - if (text.size() == 6) - { - m_frequencyHz = text.toInt() * 1000; - m_precision = 3; - return true; - } - else if (text.size() == 9) - { - m_frequencyHz = text.toInt(); - m_precision = 6; - return true; - } - else - { - qDebug() << "AcarsDataTransceiverAutoTune: Can't decode: " << text; - m_frequencyHz = -1; - m_precision = 0; - return false; - } -} - -QString AcarsDataTransceiverAutoTune::toString() -{ - if (m_frequencyHz != -1) { - return QString("Tune to: %1MHz").arg(m_frequencyHz/1000000.0, 0, 'f', m_precision); - } else { - return ""; - } -} - -AcarsGroundUTCRequest::AcarsGroundUTCRequest(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsGroundUTCRequest::decode(const QString &text) -{ - if (m_uplink) - { - QRegularExpression re(R"((\d\d)(\d\d)(\d\d)(\d)(\d\d)(\d\d)(\d\d))"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_date = QDate(match.captured(1).toInt() + 2000, match.captured(2).toInt(), match.captured(3).toInt()); - m_day = match.captured(4).toInt(); - m_time = QTime(match.captured(5).toInt(), match.captured(6).toInt(), match.captured(7).toInt()); - return true; - } - else - { - qDebug() << "AcarsGroundUTCRequest: Failed to match " << text; - return false; - } - } - else - { - return true; - } -} - -QString AcarsGroundUTCRequest::toString() -{ - if (m_uplink && m_date.isValid() && m_time.isValid()) - { - const QStringList days = {"", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; - return QString("UTC: %1 %2 %3") - .arg(m_date.toString("yyyy-MM-dd")) - .arg(days[m_day]) - .arg(m_time.toString()); - } - else - { - return ""; - } -} - -// See Table C-2 in Appendix C of ARINC 623 -AcarsOceanicClearanceResponse::AcarsOceanicClearanceResponse(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsOceanicClearanceResponse::decode(const QString &text) -{ - // \r\n not always positioned as spec, so just replace with spaces - QRegularExpression re(R"(CLX (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) CLRNCE (\d\d\d) (\w*) CLRD TO (\w\w\w\w) VIA (\w*) (\w* \w*) ([A-Za-z0-9/ ]*)FM (\w*)\/(\d\d)(\d\d) MNTN F(\d\d\d) M(\d\d\d))"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); - m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); - m_atcCenter = match.captured(6); - m_clearanceNumber = match.captured(7).toInt(); - m_aircraft = match.captured(8); - m_destination = match.captured(9); - m_via = match.captured(10); - m_routeId = match.captured(11); - m_route = match.captured(12).simplified(); - m_entryPoint = match.captured(13); - m_entryTime = QTime(match.captured(14).toInt(), match.captured(15).toInt()); - m_flightLevel = match.captured(16).toInt(); - m_mach = match.captured(17).toInt() / 100.0f; - - // TODO: ATC RECLEARANCE - -/* if (match.lastCapturedIndex() >= 9) { - m_freeText = match.captured(9).trimmed(); - }*/ - return true; - } - else - { - qDebug() << "AcarsOceanicClearanceReadback: Failed to match " << text; - return false; - } -} - -QString AcarsOceanicClearanceResponse::toString() -{ - if (m_messageTime.isValid()) - { - QString s = QString("Time: %1
Date: %2
ATC center: %3
Clearance number: %4
Aircraft: %5
Destination: %6
Via: %7
Route Id: %8
Route: %9
Entry point: %10
Entry time: %11
Flight level: %12
Mach: %13") - .arg(m_messageTime.toString("hh:mm")) - .arg(m_messageDate.toString()) - .arg(icaoAndAirportName(m_atcCenter)) - .arg(m_clearanceNumber) - .arg(m_aircraft) - .arg(icaoAndAirportName(m_destination)) - .arg(m_via) - .arg(m_routeId) - .arg(m_route) - .arg(m_entryPoint) - .arg(m_entryTime.toString("hh:mm")) - .arg(m_flightLevel) - .arg(m_mach) - ; - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; - } - else - { - return ""; - } -} - -// See Table D-2 in Appendix D of ARINC 623 -AcarsDepartureClearanceResponse::AcarsDepartureClearanceResponse(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsDepartureClearanceResponse::decode(const QString &text) -{ - // \r\n not always positioned as spec, so just replace with spaces - QRegularExpression re(R"(CLD (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) PDC (\d\d\d) ([A-Za-z0-9]*) CLRD TO (\w\w\w\w) OFF (\w*) VIA (\w*) SQUAWK (\d\d\d\d) (ADT|MDI) (\d*) ATIS (\w) ([\w ]*)?)"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); - m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); - m_departureAirport = match.captured(6); - m_clearanceNumber = match.captured(7).toInt(); - m_flight = match.captured(8); - m_destination = match.captured(9); - m_runway = match.captured(10); - m_sid = match.captured(11); - m_squawk = match.captured(12); - m_departureTimeType = match.captured(13); // ADT or MDI - // Departure time can be mss hhmm or hhmm/hhmm - m_departureTime = match.captured(14); - m_atis = match.captured(15); - if (match.lastCapturedIndex() >= 16) { - m_freeText = match.captured(16).trimmed(); - } - return true; - } - else - { - qDebug() << "AcarsDepartureClearanceResponse: Failed to match " << text; - return false; - } -} - -QString AcarsDepartureClearanceResponse::toString() -{ - if (m_messageTime.isValid()) - { - QString s = QString("Time: %1
Date: %2
Departure airport: %3
Clearance number: %4
Flight: %5
Destination: %6
Runway: %7
SID: %8
Squawk: %9
Departure time: %10 %11
ATIS: %12") - .arg(m_messageTime.toString("hh:mm")) - .arg(m_messageDate.toString()) - .arg(icaoAndAirportName(m_departureAirport)) - .arg(m_clearanceNumber) - .arg(m_flight) - .arg(icaoAndAirportName(m_destination)) - .arg(m_runway) - .arg(m_sid) - .arg(m_squawk) - .arg(m_departureTimeType) - .arg(m_departureTime) - .arg(m_atis) - ; - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; - } - else - { - return ""; - } -} - -// See Attachment 9 in ARINC 623 -AcarsFlightSystemsMessage::AcarsFlightSystemsMessage(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsFlightSystemsMessage::decode(const QString &text) -{ - QRegularExpression re(R"(FSM (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) (\w*) ([\w\s]*)?)"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); - m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); - m_departureAirport = match.captured(6); - m_flight = match.captured(7); - if (match.lastCapturedIndex() >= 8) { - m_freeText = match.captured(8).trimmed(); // Sometimes last 4 digits are CRC, but not always - } - return true; - } - else - { - qDebug() << "AcarsFlightSystemsMessage: Failed to match " << text; - return false; - } -} - -QString AcarsFlightSystemsMessage::toString() -{ - QString s; - if (m_messageTime.isValid()) - { - s.append(QString("Time %1
Date: %2
Departure airport: %3
Flight: %4") - .arg(m_messageTime.toString("hh:mm")) - .arg(m_messageDate.toString()) - .arg(icaoAndAirportName(m_departureAirport)) - .arg(m_flight)); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - } - return s; -} - -// Appendix B in ARINC 623 -AcarsATISReport::AcarsATISReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsATISReport::decode(const QString &text) -{ - QRegularExpression re(R"(TI2\/(\w\w\w\w)\s+(\w\w\w)\s+ATIS\s+(\w)\s+(\d\d)(\d\d)Z\s+([\s\S]*))"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_airport = match.captured(1); - m_indicator = match.captured(2); - m_atisId = match.captured(3); - m_time = QTime(match.captured(4).toInt(), match.captured(5).toInt()); - m_atisInformation = match.captured(6); - return true; - } - else - { - qDebug() << "AcarsATISReport: Failed to match " << text; - return false; - } -} - -QString AcarsATISReport::toString() -{ - if (!m_airport.isEmpty()) - { - // These are the only 3 in ARINC 623, but EGKK uses COM - const QHash indicators = { - {"ARR", "Arrival"}, - {"DEP", "Departure"}, - {"ENR", "Enroute/VOLMET"} - }; - QString indicator = m_indicator; - if (indicators.contains(indicator)) { - indicator = indicators[indicator]; - } - QString s = QString("Airport: %1
Arrival/departure indicator: %2
ATIS Id: %3
Time: %4") - .arg(icaoAndAirportName(m_airport)) - .arg(indicator) - .arg(m_atisId) - .arg(m_time.toString("hh:mm")); - s.append("\n"); - s.append(m_atisInformation); - if (m_multiBlock) - { - s.append(""); - } - return s; - } - else - { - return ""; - } -} - -// See section 3 in ARINC 622 -AcarsATSFacilitiesNotification::AcarsATSFacilitiesNotification(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsATSFacilitiesNotification::decode(const QString &text) -{ - QRegularExpression re(R"(\/(\w*)\.AFN\/FMH(\w*),([\.\-\w]*),(\w*)(,(\d\d)(\d\d)(\d\d))?)"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_atcCenter = match.captured(1); - m_flight = match.captured(2); - m_aircraftRegistration = match.captured(3); - while (m_aircraftRegistration.startsWith(".")) { - m_aircraftRegistration = m_aircraftRegistration.mid(1); // Remove prefix - } - m_aircraftICAO = match.captured(4); // 24-bit ICAO hex id - if (match.lastCapturedIndex() >= 7) { - m_time = QTime(match.captured(5).toInt(), match.captured(6).toInt(), match.captured(7).toInt()); - } - - int offset = match.capturedStart(0) + match.captured(0).length() + 1; // Skip matched string and / - m_mti = text.mid(offset, 3); - return true; - } - else - { - qDebug() << "AcarsATSFacilitiesNotification: Failed to match " << text; - return false; - } -} - -QString AcarsATSFacilitiesNotification::toString() -{ - QString s = QString("ATC center: %1
Flight: %2
Aircraft: %3") - .arg(icaoAndAirportName(m_atcCenter)) - .arg(m_flight) - .arg(m_aircraftRegistration); - if (!m_aircraftICAO.isEmpty()) { - s.append(QString("
Aircraft ICAO: %1").arg(m_aircraftICAO)); - } - if (m_time.isValid()) { - s.append(QString("
Time: %1").arg(m_time.toString("hh:mm:ss"))); - } - if (!m_mti.isEmpty()) - { - const QHash mtis = { - {"FPO", "AFN contact"}, - {"FAK", "AFN acknowledge"}, - {"FCA", "AFN contact advisory"}, - {"FRP", "AFN response"}, - {"FCP", "AFN complete"}, - }; - s.append(QString("
MTI: %1 (%2)").arg(m_mti).arg(mtis[m_mti])); - } - return s; -} - -AcarsRequestOceanicClearance::AcarsRequestOceanicClearance(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsRequestOceanicClearance::decode(const QString &text) -{ - // Mostly start OC1/RCL, but occasionally just RCL - QRegularExpression re(R"(RCL (\d\d\d)\ ([\w ]*)-([\w ]*)\/(\d\d)(\d\d) M(\d\d\d)F(\d\d\d)( -RMK\/(.*))?)"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_avionicsIndicator = match.captured(1); - m_aircraft = match.captured(2); - m_entryPoint = match.captured(3); - m_entryTime = QTime(match.captured(4).toInt(), match.captured(5).toInt()); - m_mach = match.captured(6).toInt() / 100.0f; - m_flightLevel = match.captured(7).toInt(); - if (match.lastCapturedIndex() >= 9) { - m_freeText = match.captured(9).trimmed(); - } - return true; - } - else - { - qDebug() << "AcarsRequestOceanicClearance: Failed to match " << text; - return false; - } -} - -QString AcarsRequestOceanicClearance::toString() -{ - QString s = QString("Avionics rows: %1
Aircraft: %2
Entry point: %3
Time: %4
Mach: %5
Flight level: %6") - .arg(m_avionicsIndicator) - .arg(m_aircraft) - .arg(m_entryPoint) - .arg(m_entryTime.toString("hh:mm")) - .arg(m_mach, 0, 'f', 2) - .arg(m_flightLevel); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -AcarsOceanicClearanceReadback::AcarsOceanicClearanceReadback(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsOceanicClearanceReadback::decode(const QString &text) -{ - // \r
not always positioned as spec, so just replace with spaces - // Mostly messages start OC1/CLA, but occasionally just CLA - QRegularExpression re(R"(CLA (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) CLRNCE (\d\d\d) (\w*) CLRD TO (\w\w\w\w) VIA (\w*) (\w* \w*) ([A-Za-z0-9/ ]*)FM (\w*)\/(\d\d)(\d\d) MNTN F(\d\d\d) M(\d\d\d))"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); - m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); - m_atcCenter = match.captured(6); - m_clearanceNumber = match.captured(7).toInt(); - m_aircraft = match.captured(8); - m_destination = match.captured(9); - m_via = match.captured(10); - m_routeId = match.captured(11); - m_route = match.captured(12).simplified(); - m_entryPoint = match.captured(13); - m_entryTime = QTime(match.captured(14).toInt(), match.captured(15).toInt()); - m_flightLevel = match.captured(16).toInt(); - m_mach = match.captured(17).toInt() / 100.0f; - - // TODO: ATC RECLEARANCE - -/* if (match.lastCapturedIndex() >= 9) { - m_freeText = match.captured(9).trimmed(); - }*/ - return true; - } - else - { - qDebug() << "AcarsOceanicClearanceReadback: Failed to match " << text; - return false; - } -} - -QString AcarsOceanicClearanceReadback::toString() -{ - QString s = QString("Time: %1
Date: %2
ATC center: %3
Clearance number: %4
Aircraft: %5
Destination: %6
Via: %7
Route Id: %8
Route: %9
Entry point: %10
Entry time: %11
Flight level: %12
Mach: %13") - .arg(m_messageTime.toString("hh:mm")) - .arg(m_messageDate.toString()) - .arg(icaoAndAirportName(m_atcCenter)) - .arg(m_clearanceNumber) - .arg(m_aircraft) - .arg(icaoAndAirportName(m_destination)) - .arg(m_via) - .arg(m_routeId) - .arg(m_route) - .arg(m_entryPoint) - .arg(m_entryTime.toString("hh:mm")) - .arg(m_flightLevel) - .arg(m_mach) - ; - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -AcarsRequestATISReport::AcarsRequestATISReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsRequestATISReport::decode(const QString &text) -{ - int imiIdx = text.indexOf("TI2/"); - if (imiIdx != -1) - { - m_avionicsIndicator = text.mid(imiIdx + 4, 3); - m_airport = text.mid(imiIdx + 7, 4).trimmed(); - m_arrivalDepartureIndicator = text.mid(imiIdx + 11, 1); - return true; - } - else if (!text.contains('/')) - { - m_avionicsIndicator = text.mid(0, 3); - m_airport = text.mid(3, 4).trimmed(); - m_arrivalDepartureIndicator = text.mid(7, 1); - return true; - } - else - { - qDebug() << "AcarsRequestATISReport: Failed to match " << text; - return false; - } -} - -QString AcarsRequestATISReport::toString() -{ - const QHash indicators = { - {"A", "Arrival ATIS"}, - {"D", "Departure ATIS"}, - {"C", "Arrival with automatic update"}, - {"E", "Automatic enroute information service (AEIS) or VOLMET"}, - {"T", "Terminate automatic update of ATIS"} - }; - return QString("Avionics rows: %1
Airport: %2
Arrival/departure indicator: %3") - .arg(m_avionicsIndicator) - .arg(icaoAndAirportName(m_airport)) - .arg(indicators[m_arrivalDepartureIndicator]); -} - -AcarsWeatherRequest::AcarsWeatherRequest(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsWeatherRequest::decode(const QString &text) -{ - if (text.contains("WXRQ")) - { - // E.g: 01 WXRQ 47EZ/20 LGRP/EGGP .G-JZDE /TYP 1/STA EGGP/STA EGCC/STA EGNX - QRegularExpression staRe(R"(\/STA\s+([A-Z0-9]{4}))"); - QRegularExpressionMatchIterator it = staRe.globalMatch(text); - while (it.hasNext()) { - m_airports.append(it.next().captured(1)); - } - QRegularExpression typRe(R"(\/TYP\s+(\w+))"); - QRegularExpressionMatch typMatch = typRe.match(text); - if (typMatch.hasMatch()) { - m_reportType = typMatch.captured(1); - } - // Flight route and registration: LGRP/EGGP .G-JZDE - QRegularExpression routeRe(R"(([A-Z]{4})\/([A-Z]{4})\s+\.([A-Z0-9\-]+))"); - QRegularExpressionMatch routeMatch = routeRe.match(text); - if (routeMatch.hasMatch()) - { - m_origin = routeMatch.captured(1); - m_destination = routeMatch.captured(2); - m_registration = routeMatch.captured(3); - } - if (!m_airports.isEmpty()) { - return true; - } - } - else - { - // E.g: LFLL LFPG LFSG EGKK-SA - a list of airports then the MET report code wanted - QRegularExpression re(R"(^([A-Z0-9]{4}(?: [A-Z0-9]{4})*)-([A-Z]{2})$)"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_airports = match.captured(1).split(' '); - m_reportType = match.captured(2); - return true; - } - } - qDebug() << "AcarsWeatherRequest: Failed to match " << text; - return false; -} - -QString AcarsWeatherRequest::toString() -{ - if (m_airports.isEmpty()) { - return ""; - } - // WMO MET report type codes as used in ARINC 620 weather requests - const QHash reportTypes = { - {"SA", "METAR"}, - {"SP", "SPECI"}, - {"FT", "TAF"}, - {"FC", "Short TAF"}, - {"FA", "Area forecast"}, - {"WS", "SIGMET"}, - {"NO", "NOTAM"} - }; - QStringList lines; - if (!m_registration.isEmpty()) { - lines.append(QString("Aircraft: %1").arg(m_registration)); - } - if (!m_origin.isEmpty()) { - lines.append(QString("Origin: %1").arg(icaoAndAirportName(m_origin))); - } - if (!m_destination.isEmpty()) { - lines.append(QString("Destination: %1").arg(icaoAndAirportName(m_destination))); - } - if (!m_reportType.isEmpty()) - { - QString type = m_reportType; - if (reportTypes.contains(type)) { - type = QString("%1 (%2)").arg(reportTypes[type]).arg(m_reportType); - } - lines.append(QString("Report type: %1").arg(type)); - } - for (const QString &airport : m_airports) { - lines.append(QString("Airport: %1").arg(icaoAndAirportName(airport))); - } - return lines.join("
"); -} - -AcarsFlightStatus::AcarsFlightStatus(const QByteArray &message) : - AcarsMessage(message) -{ -} - -// Flight status report, as used by British Airways on label 15. The format is not -// publicly documented; the field identification here is inferred from off-air -// messages and consistent with the examples at -// https://github.com/airframesio/acars-message-documentation/blob/main/research/15.md -// -// After FST01 come the departure and arrival airports and the position, then a -// fixed-width block - altitude in flight levels, fuel on board, fuel used and static -// air temperature - and finally wind, heading, track and ground speed. -// -// The position is NOT a fixed width. Latitude carries three or four decimal places -// (five or six digits) and longitude three or four (six or seven), and which is used -// varies by aircraft rather than by value, so trailing digits alone cannot say where -// the longitude ends. What pins it is the temperature: it always sits eleven -// characters past the position and is five characters ending in 'C', or five spaces -// when not reported. Only one longitude width puts it there. Across 54 off-air -// messages spanning three field layouts that resolved every one unambiguously. -// -// Assuming seven digits, as this did until 2026-08-26, shifts every field after the -// position one place left for the aircraft that send six. That read altitudes of -// 68000 and 77000 ft, fuel of 62.7 t on an E190 that cannot carry 13, and dropped the -// sign from the temperature - all from messages whose positions still looked right, -// which is why it went unnoticed. E.g. G-LCYJ out of London City: -// FST01EGLCLEIB N51057 E000313 168 0627 0081 M010C 023 223 203 201 352 1244 1037 -// FL168 6270kg 810kg -10C 23kt/223 hdg/trk 352kt -// -// The two layouts differ in more than the position width. The compact one zero-pads -// its fields, signs the temperature adjacently, and counts fuel in 10 kg; the padded -// one right-aligns in spaces and counts fuel in 100 kg. E.g: -// FST01EHAMEGLLN51659E0001153 92 30 19 23246 230 13431335 -// FST01KLAXEGLLN513366W0014766140 1691219 M10C025091098097344 14031345 -// the second being a 747 from Los Angeles reporting 121900 kg burnt, which only makes -// sense at 100 kg a count. -bool AcarsFlightStatus::decode(const QString &text) -{ - // Departure and arrival airports, then latitude and longitude as degrees with a - // variable number of decimal places - static const QRegularExpression re( - R"(^FST01([A-Z0-9]{4})([A-Z0-9]{4})([NS])(\d{4,6})([EW])(\d{6,}))"); - QRegularExpressionMatch match = re.match(text); - if (!match.hasMatch()) - { - qDebug() << "AcarsFlightStatus: Failed to match " << text; - return false; - } - m_departureAirport = match.captured(1); - m_arrivalAirport = match.captured(2); - - // Everything from the hemisphere character on, which is where the offsets below - // are measured from - const QString body = text.mid(13); - const int latDigits = match.captured(4).size(); - - // Find the longitude width by looking for the temperature where each candidate - // would put it. Five spaces means the aircraft did not report one. - static const QRegularExpression tempRe(R"(^(\s{5}|\s*[MP]?\s*(\d{1,3})C)$)"); - int lonDigits = 0; - bool ambiguous = false; - for (int candidate = 6; candidate <= 7; candidate++) - { - const int width = 2 + latDigits + candidate; - if (body.size() < width + 16) { - continue; - } - if (tempRe.match(body.mid(width + 11, 5)).hasMatch()) - { - ambiguous = lonDigits != 0; - lonDigits = candidate; - } - } - - // The position itself is usable either way - the two candidates differ by metres - - // so report it even when the layout is unrecognised, but leave the fields whose - // meaning depends on the width unset rather than guess at them - const bool widthKnown = (lonDigits != 0) && !ambiguous; - if (!widthKnown) - { - qDebug() << "AcarsFlightStatus: Could not locate the field boundary in " << text; - lonDigits = 7; - } - - QString latDigitStr = match.captured(4); - m_latitude = (latDigitStr.left(2) + "." + latDigitStr.mid(2)).toFloat(); - if (match.captured(3) == "S") { - m_latitude = -m_latitude; - } - QString lonDigitStr = match.captured(6).left(lonDigits); - m_longitude = (lonDigitStr.left(3) + "." + lonDigitStr.mid(3)).toFloat(); - if (match.captured(5) == "W") { - m_longitude = -m_longitude; - } - m_positionValid = true; - if (!widthKnown) { - return true; - } - - // Fixed width fields: altitude in flight levels, then fuel on board and fuel used - const bool compact = (lonDigits == 6); - const int fuelUnitKg = compact ? 10 : 100; - QString rest = body.mid(2 + latDigits + lonDigits); - auto takeField = [&rest](int width) - { - QString field = rest.left(width).trimmed(); - rest = rest.mid(width); - return field; - }; - bool ok; - int value = takeField(3).toInt(&ok); - // Guard against a layout we have not seen putting something else here. No airliner - // sending these reports cruises above FL430 - if (ok && (value * 100 <= ACARS_MAX_REPORTED_ALTITUDE_FT)) { - m_altitudeFt = value * 100; - } - value = takeField(4).toInt(&ok); - if (ok) { - m_fuelOnBoardKg = value * fuelUnitKg; - } - value = takeField(4).toInt(&ok); - if (ok) { - m_fuelUsedKg = value * fuelUnitKg; - } - - // Static air temperature, e.g. "M 58C" is -58C and "P018C" is +18C - QString tempField = takeField(5); - QRegularExpressionMatch tempMatch = tempRe.match(tempField); - if (tempMatch.hasMatch() && !tempMatch.captured(2).isEmpty()) - { - m_temperatureC = tempMatch.captured(2).toInt(); - if (tempField.contains('M')) { - m_temperatureC = -m_temperatureC; - } - m_temperatureValid = true; - } - - // The trailing eight digits are the ETA then the message time - QString middle = rest.trimmed(); - static const QRegularExpression timesRe(R"((\d\d)(\d\d)(\d\d)(\d\d)$)"); - QRegularExpressionMatch timesMatch = timesRe.match(middle); - if (timesMatch.hasMatch()) - { - m_eta = QTime(timesMatch.captured(1).toInt(), timesMatch.captured(2).toInt()); - m_time = QTime(timesMatch.captured(3).toInt(), timesMatch.captured(4).toInt()); - middle = middle.left(middle.size() - 8).trimmed(); - } - - // Wind speed and direction, then heading, track and ground speed. The compact - // layout packs all five as three digits each; the padded one gives two digits to - // the wind speed and leaves heading and track blank - static const QRegularExpression compactRe(R"(^(\d{3})(\d{3})(\d{3})(\d{3})(\d{3})$)"); - static const QRegularExpression paddedRe(R"(^(\d{1,2})(\d{3})\s+(\d{1,3})$)"); - QRegularExpressionMatch windMatch = compactRe.match(middle); - if (compact && windMatch.hasMatch() && (windMatch.captured(2).toInt() <= 360)) - { - m_windSpeedKts = windMatch.captured(1).toInt(); - m_windDirectionDeg = windMatch.captured(2).toInt(); - m_headingDeg = windMatch.captured(3).toInt(); - m_trackDeg = windMatch.captured(4).toInt(); - m_speedKts = windMatch.captured(5).toInt(); - } - else if ((windMatch = paddedRe.match(middle)).hasMatch() - && (windMatch.captured(2).toInt() <= 360)) - { - m_windSpeedKts = windMatch.captured(1).toInt(); - m_windDirectionDeg = windMatch.captured(2).toInt(); - m_speedKts = windMatch.captured(3).toInt(); - } - else if (!middle.isEmpty()) - { - m_additionalData = middle; - } - return true; -} - -QString AcarsFlightStatus::toString() -{ - if (m_departureAirport.isEmpty()) { - return ""; - } - QStringList lines; - lines.append(QString("Departure: %1").arg(icaoAndAirportName(m_departureAirport))); - lines.append(QString("Arrival: %1").arg(icaoAndAirportName(m_arrivalAirport))); - lines.append(QString("Position: %1%2 %3%4") - .arg(std::abs(m_latitude), 0, 'f', 4) - .arg(m_latitude < 0.0f ? "S" : "N") - .arg(std::abs(m_longitude), 0, 'f', 4) - .arg(m_longitude < 0.0f ? "W" : "E")); - if (m_altitudeFt >= 0) { - lines.append(QString("Altitude: %1 ft").arg(m_altitudeFt)); - } - if (m_fuelOnBoardKg >= 0) { - lines.append(QString("Fuel on board: %1 t").arg(m_fuelOnBoardKg / 1000.0, 0, 'f', 2)); - } - if (m_fuelUsedKg >= 0) { - lines.append(QString("Fuel used: %1 t").arg(m_fuelUsedKg / 1000.0, 0, 'f', 2)); - } - if (m_temperatureValid) { - lines.append(QString("Temperature: %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); - } - if (m_windSpeedKts >= 0) { - lines.append(QString("Wind: %1%2 %3 kts").arg(m_windDirectionDeg).arg(QChar(0xB0)).arg(m_windSpeedKts)); - } - if (m_headingDeg >= 0) { - lines.append(QString("Heading: %1%2").arg(m_headingDeg).arg(QChar(0xB0))); - } - if (m_trackDeg >= 0) { - lines.append(QString("Track: %1%2").arg(m_trackDeg).arg(QChar(0xB0))); - } - if (m_speedKts >= 0) { - lines.append(QString("Ground speed: %1 kts").arg(m_speedKts)); - } - if (m_eta.isValid()) { - lines.append(QString("ETA: %1").arg(m_eta.toString("hh:mm"))); - } - if (m_time.isValid()) { - lines.append(QString("Time: %1").arg(m_time.toString("hh:mm"))); - } - if (!m_additionalData.isEmpty()) { - lines.append(QString("Additional data: %1").arg(m_additionalData)); - } - return lines.join("
"); -} - -bool AcarsFlightStatus::getPosition(float& latitude, float& longitude, int& altitudeFt) const -{ - if (!m_positionValid) { - return false; - } - latitude = m_latitude; - longitude = m_longitude; - altitudeFt = m_altitudeFt; - return true; -} - -static QString positionString(float latitude, float longitude) -{ - return QString("%1%2 %3%4") - .arg(std::abs(latitude), 0, 'f', 4) - .arg(latitude < 0.0f ? "S" : "N") - .arg(std::abs(longitude), 0, 'f', 4) - .arg(longitude < 0.0f ? "W" : "E"); -} - -AcarsPositionReport::AcarsPositionReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -// A family of related airline position report formats, one per label. Formats -// cross-checked against airframes.io's acars-decoder-typescript test vectors. -bool AcarsPositionReport::decode(const QString &text) -{ - if ((m_label == "12") || (m_label == "16")) - { - // E.g: N 42.150,W121.187,39000,161859, 109,.C-GWSO,1742 (12) - // N 44.203,W 86.546,31965,6, 290 (16) - // N 28.177/W 96.055 (16) - QRegularExpression re(R"(^([NS])\s*(\d{1,2}\.\d+)\s*[,/]\s*([EW])\s*(\d{1,3}\.\d+)(?:,\s*(\d+))?)"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_latitude = match.captured(2).toFloat() * (match.captured(1) == "S" ? -1.0f : 1.0f); - m_longitude = match.captured(4).toFloat() * (match.captured(3) == "W" ? -1.0f : 1.0f); - m_positionValid = true; - if (!match.captured(5).isEmpty()) { - m_altitudeFt = match.captured(5).toInt(); - } - if (m_label == "12") - { - // The fourth field is the time as HHMMSS - QStringList fields = text.split(','); - if (fields.size() >= 4) - { - QString t = fields[3].trimmed(); - if (t.size() == 6) { - m_time = QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); - } - } - } - return true; - } - } - else if (m_label == "10") - { - // E.g: POS082150, N 3885,W 7841,---,308,26922, 51,22290, 529, 19,-225,6 - // The time is HHMMSS; latitude and longitude are degrees x100; the eighth - // field is the altitude in feet - QRegularExpression re(R"(^POS(\d{6}),\s*([NS])\s*(\d+),\s*([EW])\s*(\d+),)"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_time = QTime(match.captured(1).mid(0, 2).toInt(), - match.captured(1).mid(2, 2).toInt(), - match.captured(1).mid(4, 2).toInt()); - m_latitude = match.captured(3).toFloat() / 100.0f * (match.captured(2) == "S" ? -1.0f : 1.0f); - m_longitude = match.captured(5).toFloat() / 100.0f * (match.captured(4) == "W" ? -1.0f : 1.0f); - m_positionValid = true; - QStringList fields = text.split(','); - if (fields.size() >= 8) - { - bool ok; - int alt = fields[7].trimmed().toInt(&ok); - if (ok) { - m_altitudeFt = alt; - } - } - return true; - } - } - else if (m_label == "22") - { - // E.g: N 370824W 760010,-------,194936,30418, , , ,M 42,27335 42, 107, - // Latitude and longitude are degrees x10000; the third field is the time as - // HHMMSS and the fourth the altitude in feet - QRegularExpression re(R"(^([NS])\s*(\d{6})\s*([EW])\s*(\d{6}),)"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_latitude = match.captured(2).toFloat() / 10000.0f * (match.captured(1) == "S" ? -1.0f : 1.0f); - m_longitude = match.captured(4).toFloat() / 10000.0f * (match.captured(3) == "W" ? -1.0f : 1.0f); - m_positionValid = true; - QStringList fields = text.split(','); - if ((fields.size() >= 3) && (fields[2].trimmed().size() == 6)) - { - QString t = fields[2].trimmed(); - m_time = QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); - } - if (fields.size() >= 4) - { - bool ok; - int alt = fields[3].trimmed().toInt(&ok); - if (ok) { - m_altitudeFt = alt; - } - } - return true; - } - } - else if (m_label == "44") - { - // E.g: POS02,N38171W077507,319,KJFK,KUZA,0926,0245,0327,004.6 - // Coordinates are degrees then minutes x10 (38 degrees 17.1 minutes); - // altitude is in flight levels; then departure and arrival airports, the - // date as MMDD, the time and ETA as HHMM, and fuel in tonnes - QRegularExpression re(R"(^(?:00)?(POS|ETA|IN|OFF|ON)(\d{2}),([NS])(\d\d)(\d{3})([EW])(\d{3})(\d{3}),(\d{1,3}),(\w{4}),(\w{4}),(\d{4}),(\d{4}),(\d{4}),(\d+\.?\d*))"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_reportType = match.captured(1); - m_latitude = match.captured(4).toFloat() + match.captured(5).toFloat() / 10.0f / 60.0f; - if (match.captured(3) == "S") { - m_latitude = -m_latitude; - } - m_longitude = match.captured(7).toFloat() + match.captured(8).toFloat() / 10.0f / 60.0f; - if (match.captured(6) == "W") { - m_longitude = -m_longitude; - } - m_positionValid = true; - m_altitudeFt = match.captured(9).toInt() * 100; - m_departureAirport = match.captured(10); - m_arrivalAirport = match.captured(11); - m_month = match.captured(12).mid(0, 2).toInt(); - m_day = match.captured(12).mid(2, 2).toInt(); - m_time = QTime(match.captured(13).mid(0, 2).toInt(), match.captured(13).mid(2, 2).toInt()); - m_eta = QTime(match.captured(14).mid(0, 2).toInt(), match.captured(14).mid(2, 2).toInt()); - m_fuelTons = match.captured(15).toFloat(); - return true; - } - } - else if (m_label == "24") - { - // E.g: /241710/1021/04WM/34962/N53.13/E001.33/3374/1056/ - // Day and time, then flight, altitude in feet, position and ETA - QRegularExpression re(R"(^/24(\d{4})/(\d+)/(\w+)/(\d+)/([NS])(\d{1,2}\.\d+)/([EW])(\d{1,3}\.\d+)/(\d+)/(\d{4})/?)"); - QRegularExpressionMatch match = re.match(text); - if (match.hasMatch()) - { - m_time = QTime(match.captured(1).mid(0, 2).toInt(), match.captured(1).mid(2, 2).toInt()); - m_reportFlight = match.captured(3); - m_altitudeFt = match.captured(4).toInt(); - m_latitude = match.captured(6).toFloat() * (match.captured(5) == "S" ? -1.0f : 1.0f); - m_longitude = match.captured(8).toFloat() * (match.captured(7) == "W" ? -1.0f : 1.0f); - m_positionValid = true; - m_eta = QTime(match.captured(10).mid(0, 2).toInt(), match.captured(10).mid(2, 2).toInt()); - return true; - } - } - qDebug() << "AcarsPositionReport: Failed to match label" << m_label << text; - return false; -} - -QString AcarsPositionReport::toString() -{ - if (!m_positionValid) { - return ""; - } - const QHash reportTypes = { - {"POS", "Position report"}, - {"ETA", "ETA report"}, - {"IN", "In gate report"}, - {"OFF", "Takeoff report"}, - {"ON", "Landing report"} - }; - QStringList lines; - if (!m_reportType.isEmpty()) { - lines.append(QString("Report: %1").arg(reportTypes.value(m_reportType, m_reportType))); - } - if (!m_reportFlight.isEmpty()) { - lines.append(QString("Flight: %1").arg(m_reportFlight)); - } - if (!m_departureAirport.isEmpty()) { - lines.append(QString("Departure: %1").arg(icaoAndAirportName(m_departureAirport))); - } - if (!m_arrivalAirport.isEmpty()) { - lines.append(QString("Arrival: %1").arg(icaoAndAirportName(m_arrivalAirport))); - } - lines.append(QString("Position: %1").arg(positionString(m_latitude, m_longitude))); - if (m_altitudeFt >= 0) { - lines.append(QString("Altitude: %1 ft").arg(m_altitudeFt)); - } - if (m_day >= 0) { - lines.append(QString("Date: %1/%2").arg(m_day, 2, 10, QChar('0')).arg(m_month, 2, 10, QChar('0'))); - } - if (m_time.isValid()) { - lines.append(QString("Time: %1").arg(m_time.toString(m_time.second() ? "hh:mm:ss" : "hh:mm"))); - } - if (m_eta.isValid()) { - lines.append(QString("ETA: %1").arg(m_eta.toString("hh:mm"))); - } - if (m_fuelTons >= 0.0f) { - lines.append(QString("Fuel on board: %1 t").arg(m_fuelTons, 0, 'f', 1)); - } - return lines.join("
"); -} - -bool AcarsPositionReport::getPosition(float& latitude, float& longitude, int& altitudeFt) const -{ - if (!m_positionValid) { - return false; - } - latitude = m_latitude; - longitude = m_longitude; - altitudeFt = m_altitudeFt; - return true; -} - -AcarsEventReport::AcarsEventReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -// OOOI event reports: /13 OUT EVENT / KSFO KEWR 12 231445/TIME 2314 -// with optional additional lines such as /LOC N373703,W1222251 (degrees, minutes, -// seconds), /LOC +38.9603,-077.4595 (decimal) and /FOB 0215 (fuel, 100kg) -bool AcarsEventReport::decode(const QString &text) -{ - QRegularExpression re(R"(^/1([3-8])\s+(.+?)/\s*([A-Z0-9]{4})\s+([A-Z0-9]{4})\s+(\d{1,2})\s+(\d{6}))"); - QRegularExpressionMatch match = re.match(text); - if (!match.hasMatch()) - { - qDebug() << "AcarsEventReport: Failed to match " << text; - return false; - } - m_event = 10 + match.captured(1).toInt(); - m_eventDescription = match.captured(2).trimmed(); - m_departureAirport = match.captured(3); - m_arrivalAirport = match.captured(4); - m_day = match.captured(5).toInt(); - QString t = match.captured(6); - m_eventTime = QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); - - QRegularExpression fobRe(R"(/FOB\s+(\d+))"); - QRegularExpressionMatch fobMatch = fobRe.match(text); - if (fobMatch.hasMatch()) { - m_fuelOnBoard = fobMatch.captured(1).toInt(); - } - - // Position in degrees/minutes/seconds, e.g. N373703,W1222251 - QRegularExpression locDmsRe(R"(/LOC\s+([NS])(\d\d)(\d\d)(\d\d),\s*([EW])(\d{2,3})(\d\d)(\d\d))"); - QRegularExpressionMatch locMatch = locDmsRe.match(text); - if (locMatch.hasMatch()) - { - m_latitude = locMatch.captured(2).toFloat() + locMatch.captured(3).toFloat() / 60.0f + locMatch.captured(4).toFloat() / 3600.0f; - if (locMatch.captured(1) == "S") { - m_latitude = -m_latitude; - } - m_longitude = locMatch.captured(6).toFloat() + locMatch.captured(7).toFloat() / 60.0f + locMatch.captured(8).toFloat() / 3600.0f; - if (locMatch.captured(5) == "W") { - m_longitude = -m_longitude; - } - m_positionValid = true; - } - else - { - // Or decimal, e.g. +38.9603,-077.4595 - QRegularExpression locDecRe(R"(/LOC\s+([+-]\d{1,2}\.\d+),\s*([+-]\d{1,3}\.\d+))"); - locMatch = locDecRe.match(text); - if (locMatch.hasMatch()) - { - m_latitude = locMatch.captured(1).toFloat(); - m_longitude = locMatch.captured(2).toFloat(); - m_positionValid = true; - } - } - return true; -} - -QString AcarsEventReport::toString() -{ - if (m_eventDescription.isEmpty()) { - return ""; - } - const QHash events = { - {13, "Out of gate"}, - {14, "Takeoff"}, - {15, "Landing"}, - {16, "In gate"}, - {17, "Post report"}, - {18, "Post times report"} - }; - QStringList lines; - lines.append(QString("Event: %1 (%2)").arg(events[m_event]).arg(m_eventDescription)); - lines.append(QString("Departure: %1").arg(icaoAndAirportName(m_departureAirport))); - lines.append(QString("Arrival: %1").arg(icaoAndAirportName(m_arrivalAirport))); - if (m_eventTime.isValid()) { - lines.append(QString("Time: Day %1 %2").arg(m_day).arg(m_eventTime.toString("hh:mm:ss"))); - } - if (m_fuelOnBoard >= 0) { - lines.append(QString("Fuel on board: %1 t").arg(m_fuelOnBoard / 10.0, 0, 'f', 1)); - } - if (m_positionValid) { - lines.append(QString("Position: %1").arg(positionString(m_latitude, m_longitude))); - } - return lines.join("
"); -} - -bool AcarsEventReport::getPosition(float& latitude, float& longitude, int& altitudeFt) const -{ - if (!m_positionValid) { - return false; - } - latitude = m_latitude; - longitude = m_longitude; - altitudeFt = -1; - return true; -} - -AcarsOpsReport::AcarsOpsReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -// Coordinates in label 80 reports appear as N29395 (degrees x1000) or N3539.2 -// (degrees then decimal minutes) -static bool parseOpsCoordinate(const QString& s, float& value) -{ - QRegularExpression plainRe(R"(^([NSEW])(\d+)$)"); - QRegularExpressionMatch match = plainRe.match(s); - if (match.hasMatch()) - { - int degDigits = match.captured(2).size() - 3; - value = match.captured(2).left(degDigits).toFloat() - + match.captured(2).mid(degDigits).toFloat() / 1000.0f; - if ((match.captured(1) == "S") || (match.captured(1) == "W")) { - value = -value; - } - return true; - } - QRegularExpression minRe(R"(^([NSEW])(\d+)(\d\d\.\d)$)"); - match = minRe.match(s); - if (match.hasMatch()) - { - value = match.captured(2).toFloat() + match.captured(3).toFloat() / 60.0f; - if ((match.captured(1) == "S") || (match.captured(1) == "W")) { - value = -value; - } - return true; - } - return false; -} - -// Airline operational reports, e.g: -// 3N01 POSRPT 5891/04 KIAH/MMGL .XA-VOI -// /POS N29395W095133/ALT +15608/MCH 558/FOB 0100/ETA 0410 -// with OPNORM and INRANG variants, and optional /FL /TAS /SAT /HDG /NWYP /SPD /UTC -// keyed fields. Formats per airframes.io's decoder test vectors. -bool AcarsOpsReport::decode(const QString &text) -{ - QRegularExpression hdrRe(R"(^3\w0\d\s+(POSRPT|OPNORM|INRANG)\s+(\w+)/(\d{1,2})\s+([A-Z0-9]{4})/([A-Z0-9]{4})\s+\.([A-Z0-9-]+))"); - QRegularExpressionMatch match = hdrRe.match(text); - if (!match.hasMatch()) - { - qDebug() << "AcarsOpsReport: Failed to match " << text; - return false; - } - m_reportType = match.captured(1); - m_reportFlight = match.captured(2); - m_day = match.captured(3).toInt(); - m_departureAirport = match.captured(4); - m_arrivalAirport = match.captured(5); - m_tail = match.captured(6); - - // Keyed fields anywhere in the remainder - auto keyed = [&text](const char *pattern) -> QString - { - QRegularExpression re{QString(pattern)}; - QRegularExpressionMatch m = re.match(text); - return m.hasMatch() ? m.captured(1) : QString(); - }; - - QString pos = keyed(R"(/POS\s+([NS][\d.]+)\s?([EW][\d.]+))"); - if (!pos.isEmpty()) - { - QRegularExpression posRe(R"(/POS\s+([NS][\d.]+)\s?([EW][\d.]+))"); - QRegularExpressionMatch posMatch = posRe.match(text); - float lat, lon; - if (parseOpsCoordinate(posMatch.captured(1), lat) && parseOpsCoordinate(posMatch.captured(2), lon)) - { - m_latitude = lat; - m_longitude = lon; - m_positionValid = true; - } - } - QString alt = keyed(R"(/ALT\s+\+?(\d+))"); - if (!alt.isEmpty()) { - m_altitudeFt = alt.toInt(); - } - QString fl = keyed(R"(/FL\s+(\d+))"); - if (!fl.isEmpty()) { - m_altitudeFt = fl.toInt() * 100; - } - m_nextWaypoint = keyed(R"(/NWYP\s+(\w+))"); - QString hdg = keyed(R"(/HDG\s+(\d+))"); - if (!hdg.isEmpty()) { - m_headingDeg = hdg.toInt(); - } - QString mch = keyed(R"(/MCH\s+(\d+))"); - if (!mch.isEmpty()) { - m_machX1000 = mch.toInt(); - } - QString spd = keyed(R"(/(?:TAS|SPD)\s+(\d+))"); - if (!spd.isEmpty()) { - m_speedKts = spd.toInt(); - } - QString sat = keyed(R"(/SAT\s+([+-]?\d+))"); - if (!sat.isEmpty()) - { - m_temperatureC = sat.toInt(); - m_temperatureValid = true; - } - m_fuelOnBoard = keyed(R"(/FOB\s+([N\d.]+))"); - QString utc = keyed(R"(/UTC\s+(\d{6}))"); - if (!utc.isEmpty()) { - m_time = QTime(utc.mid(0, 2).toInt(), utc.mid(2, 2).toInt(), utc.mid(4, 2).toInt()); - } - QString eta = keyed(R"(/ETA\s+(\d\d):?(\d\d))"); - if (!eta.isEmpty()) - { - QRegularExpression etaRe(R"(/ETA\s+(\d\d):?(\d\d))"); - QRegularExpressionMatch etaMatch = etaRe.match(text); - m_eta = QTime(etaMatch.captured(1).toInt(), etaMatch.captured(2).toInt()); - } - return true; -} - -QString AcarsOpsReport::toString() -{ - if (m_reportType.isEmpty()) { - return ""; - } - const QHash reportTypes = { - {"POSRPT", "Position report"}, - {"OPNORM", "Operations normal"}, - {"INRANG", "In range"} - }; - QStringList lines; - lines.append(QString("Report: %1").arg(reportTypes.value(m_reportType, m_reportType))); - lines.append(QString("Flight: %1").arg(m_reportFlight)); - lines.append(QString("Aircraft: %1").arg(m_tail)); - lines.append(QString("Departure: %1").arg(icaoAndAirportName(m_departureAirport))); - lines.append(QString("Arrival: %1").arg(icaoAndAirportName(m_arrivalAirport))); - if (m_positionValid) { - lines.append(QString("Position: %1").arg(positionString(m_latitude, m_longitude))); - } - if (m_altitudeFt >= 0) { - lines.append(QString("Altitude: %1 ft").arg(m_altitudeFt)); - } - if (!m_nextWaypoint.isEmpty()) { - lines.append(QString("Next waypoint: %1").arg(m_nextWaypoint)); - } - if (m_headingDeg >= 0) { - lines.append(QString("Heading: %1%2").arg(m_headingDeg).arg(QChar(0xB0))); - } - if (m_machX1000 >= 0) { - lines.append(QString("Mach: %1").arg(m_machX1000 / 1000.0, 0, 'f', 3)); - } - if (m_speedKts >= 0) { - lines.append(QString("Speed: %1 kts").arg(m_speedKts)); - } - if (m_temperatureValid) { - lines.append(QString("Temperature: %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); - } - if (!m_fuelOnBoard.isEmpty()) { - lines.append(QString("Fuel on board: %1").arg(m_fuelOnBoard)); - } - if (m_time.isValid()) { - lines.append(QString("Time: Day %1 %2").arg(m_day).arg(m_time.toString("hh:mm:ss"))); - } - if (m_eta.isValid()) { - lines.append(QString("ETA: %1").arg(m_eta.toString("hh:mm"))); - } - return lines.join("
"); -} - -bool AcarsOpsReport::getPosition(float& latitude, float& longitude, int& altitudeFt) const -{ - if (!m_positionValid) { - return false; - } - latitude = m_latitude; - longitude = m_longitude; - altitudeFt = m_altitudeFt; - return true; -} - -bool ARINC622::decode(const QString &text, bool uplink) -{ - QRegularExpression re(R"(\/(?:\w\w )?(\w*)\.(\w\w\d)([\.\w\-]{7})(.*)(\w\w\w\w))"); - QRegularExpressionMatch match = re.match(text.simplified()); - if (match.hasMatch()) - { - m_atcCenter = match.captured(1); - m_imi = match.captured(2); - m_aircraft = match.captured(3); - while (m_aircraft.startsWith(".")) { - m_aircraft = m_aircraft.mid(1); // Remove "." prefix - } - // m_aircraft should be checked against ACARS registration field to ensure they match - m_app = match.captured(4); - if ((m_imi == "AT1") || (m_imi == "CR1")) - { - DO219Decoder decoder; - m_do219 = decoder.decode(m_app, uplink); - } - - m_crc = match.captured(5).toInt(nullptr, 16); - m_valid = true; - return true; - } - else - { - return false; - } -} - -QString ARINC622::toString() -{ - if (m_valid) - { - QString s = QString("ATC Center: %1
IMI: %2
Aircraft: %3
CRC: %4") - .arg(m_atcCenter) - .arg(m_imis[m_imi]) - .arg(m_aircraft) - .arg(QString::number(m_crc, 16)); - - if (!m_do219.isEmpty()) { - s.append(QString("
CPDLC decode: %1").arg(m_do219)); - } else if (!m_app.isEmpty()) { - s.append(QString("
CPDLC data: %1").arg(m_app)); - } - return s; - } - else - { - return ""; - } -} - -AcarsATCCommunications::AcarsATCCommunications(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsATCCommunications::decode(const QString &text) -{ - return m_622.decode(text, m_uplink); -} - -QString AcarsATCCommunications::toString() -{ - return m_622.toString(); -} - -AcarsMessageFromSubsystem::AcarsMessageFromSubsystem(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsMessageFromSubsystem::decode(const QString &text) -{ - if (m_622.decode(text, m_uplink)) { - return true; - } - - // Not an ARINC 622 ATS message: try the FMS report formats, which start with a - // # prefix such as #M1B (FMC), e.g: - // #M1BPOSN43312W123174,EASON,215754,370,EBINY,220601,ELENN,M48,02216,185/TS215754,092122 - // #M1BFPN/RP:DA:KSFO:AA:KEWR:R:... - // Field meanings per airframes.io's acars-message-documentation research - QString t = text; - QRegularExpression subRe(R"(^#(\w{2}[A-Z]?))"); - QRegularExpressionMatch subMatch = subRe.match(t); - if (subMatch.hasMatch()) - { - m_fmsSublabel = subMatch.captured(1); - t = t.mid(subMatch.capturedLength()); - } - else if (!t.startsWith("POS") && !t.startsWith("FPN/") - && (t.mid(1).startsWith("POS") || t.mid(1).startsWith("FPN/"))) - { - // The header parse strips a #xx sublabel from the text, which can leave just - // the supplementary character (the B of #M1B) before the report type - this - // is the form the multipart assembler's combined text takes - m_fmsSublabel = m_subLabel + t.left(1); - t = t.mid(1); - } - - // A route insert - the flight plan the FMS is flying - as ARINC 702A writes it: - // colon separated fields in an /RP: block, appended to a position report or sent on - // its own as an FPN message. The /RA: alternate block has the same shape. - // - // /RP:DA:EGLL:AA:ENGM:R:27L(01R):D:BPK7G:A:RIPA3L:AP:ILSY01R.VABLPU..BPK, - // N51450W000064.Q295.PAAVO..PAAVO,N51518E000513.M604.GIVPO..LARGA,N54518E004092 - // - // DA is the departure airport, AA the arrival, R the departure runway with the - // arrival's in brackets, D the SID, A the STAR and AP the lateral path. In the path - // "." separates a fix from the airway to the next one and ".." is a direct leg, and - // a fix may be followed by its position. R used to be read as the route, which is - // why a plan only ever plotted as its two airports: it is the runway. - auto extractFlightPlan = [this](const QString& s) - { - // Read within the /RP: block where there is one, so the /RA: alternate block's - // own DA and AA are not taken for this flight's - auto block = [](const QString& text, const QString& tag) -> QString - { - const int start = text.indexOf(tag + ":"); - if (start < 0) { - return QString(); - } - const int end = text.indexOf('/', start); - return (end >= 0) ? text.mid(start, end - start) : text.mid(start); - }; - auto field = [](const QString& text, const char *tag) -> QString - { - if (text.isEmpty()) { - return QString(); - } - const QRegularExpression re(QString(":%1:([^:/]*)").arg(tag)); - const QRegularExpressionMatch match = re.match(text); - return match.hasMatch() ? match.captured(1).trimmed() : QString(); - }; - - const QString rpBlock = block(s, "RP"); - const QString rp = rpBlock.isEmpty() ? s : rpBlock; - - m_fpnDeparture = field(rp, "DA"); - m_fpnArrival = field(rp, "AA"); - m_fpnRunway = field(rp, "R"); - m_fpnSid = field(rp, "D"); - m_fpnStar = field(rp, "A"); - m_fpnAlternate = field(block(s, "RA"), "AA"); - - QString path = field(rp, "AP"); - if (path.isEmpty()) { - path = field(rp, "F"); - } - // N51450 is 51 degrees 45.0 minutes north and W000064 is 0 degrees 6.4 minutes - // west: three digits of minutes of which the last is tenths, after two digits of - // degrees for latitude and three for longitude - static const QRegularExpression coordRe(R"(^([NS])(\d{2})(\d{3})([EW])(\d{3})(\d{3})$)"); - const QStringList tokens = path.split('.', Qt::SkipEmptyParts); - - // Everything before the first fix that carries a position is the approach and - // its transition: the path proper is the part that is placed. Where nothing is - // placed there is nothing to separate them by, and it is all route. - int first = 0; - while ((first < tokens.size()) - && !coordRe.match(tokens[first].section(',', 1, 1).trimmed()).hasMatch()) { - first++; - } - if (first >= tokens.size()) { - first = 0; - } else if (first > 0) { - m_fpnApproach = QStringList(tokens.mid(0, first)).join(" "); - } - - for (int i = first; i < tokens.size(); i++) - { - const QString name = tokens[i].section(',', 0, 0).trimmed(); - if (name.isEmpty()) { - continue; - } - const QRegularExpressionMatch coord = - coordRe.match(tokens[i].section(',', 1, 1).trimmed()); - - FpnWaypoint waypoint; - waypoint.m_name = name; - if (coord.hasMatch()) - { - waypoint.m_hasPosition = true; - waypoint.m_latitude = (coord.captured(2).toFloat() - + coord.captured(3).toFloat() / 600.0f) * (coord.captured(1) == "S" ? -1.0f : 1.0f); - waypoint.m_longitude = (coord.captured(5).toFloat() - + coord.captured(6).toFloat() / 600.0f) * (coord.captured(4) == "W" ? -1.0f : 1.0f); - } - - // A fix is usually given twice - once as the airway's far end and again - // with its position - so a name that has just repeated replaces rather than - // extends, keeping whichever of the two placed it - if (!m_fpnWaypoints.isEmpty() && (m_fpnWaypoints.last().m_name == name)) - { - if (waypoint.m_hasPosition) { - m_fpnWaypoints.last() = waypoint; - } - continue; - } - m_fpnWaypoints.append(waypoint); - } - - QStringList names; - for (const FpnWaypoint& waypoint : m_fpnWaypoints) { - names.append(waypoint.m_name); - } - m_fpnRoute = names.join(" "); - - // Older or airline specific forms write the route as free text after the - // arrival airport instead of as a path - if (m_fpnRoute.isEmpty() && !m_fpnArrival.isEmpty()) - { - static const QRegularExpression tailRe(R"(:AA:\w{4}\.+(.+)$)"); - const QRegularExpressionMatch tailMatch = tailRe.match(s); - if (tailMatch.hasMatch()) { - m_fpnRoute = tailMatch.captured(1).trimmed(); - } - } - }; - - // Position report: position, last waypoint and time over it, altitude in flight - // levels, next waypoint and its ETA, the waypoint after, and the static air - // temperature. Latitude and longitude are degrees x1000. - QRegularExpression posRe(R"(^POS([NS])(\d{4,5})([EW])(\d{5,6}),([^,]*),(\d{6}),(\d+),([^,]*),(\d{6}),([^,]*),([MP])\s?(\d+)(.*)$)"); - QRegularExpressionMatch posMatch = posRe.match(t); - if (posMatch.hasMatch()) - { - m_latitude = posMatch.captured(2).toFloat() / 1000.0f * (posMatch.captured(1) == "S" ? -1.0f : 1.0f); - m_longitude = posMatch.captured(4).toFloat() / 1000.0f * (posMatch.captured(3) == "W" ? -1.0f : 1.0f); - m_positionValid = true; - m_lastWaypoint = posMatch.captured(5); - QString ts = posMatch.captured(6); - m_timeOver = QTime(ts.mid(0, 2).toInt(), ts.mid(2, 2).toInt(), ts.mid(4, 2).toInt()); - m_altitudeFt = posMatch.captured(7).toInt() * 100; - m_nextWaypoint = posMatch.captured(8); - ts = posMatch.captured(9); - m_etaNext = QTime(ts.mid(0, 2).toInt(), ts.mid(2, 2).toInt(), ts.mid(4, 2).toInt()); - m_nextPlus1Waypoint = posMatch.captured(10); - m_temperatureC = posMatch.captured(12).toInt(); - if (posMatch.captured(11) == "M") { - m_temperatureC = -m_temperatureC; - } - m_temperatureValid = true; - QString additional = posMatch.captured(13); - if (additional.startsWith(",")) { - additional = additional.mid(1); - } - m_posAdditionalData = additional.trimmed(); - // A position report can carry a route insert after the report fields; it is - // decoded into the flight plan fields above, so the several hundred characters - // it occupies are dropped from the raw remainder rather than shown twice. Cut - // out just those blocks: what follows them is a different subsystem's data. - extractFlightPlan(m_posAdditionalData); - static const QRegularExpression insertRe(R"(/R[PIA]:[^/]*)"); - m_posAdditionalData.remove(insertRe); - m_posAdditionalData = m_posAdditionalData.trimmed(); - return true; - } - - // Flight plan - if (t.startsWith("FPN/")) - { - extractFlightPlan(t); - return !m_fpnDeparture.isEmpty() || !m_fpnArrival.isEmpty() || !m_fpnRoute.isEmpty() - || !m_fpnRunway.isEmpty() || !m_fpnSid.isEmpty() || !m_fpnStar.isEmpty(); - } - - return false; -} - -QString AcarsMessageFromSubsystem::toString() -{ - if (m_622.m_valid) { - return m_622.toString(); - } - QStringList lines; - bool hasFpn = !m_fpnDeparture.isEmpty() || !m_fpnArrival.isEmpty() || !m_fpnRoute.isEmpty() - || !m_fpnRunway.isEmpty() || !m_fpnSid.isEmpty() || !m_fpnStar.isEmpty() - || !m_fpnApproach.isEmpty() || !m_fpnAlternate.isEmpty(); - if (m_positionValid) - { - lines.append(QString("Position: %1").arg(positionString(m_latitude, m_longitude))); - if (m_altitudeFt >= 0) { - lines.append(QString("Altitude: %1 ft").arg(m_altitudeFt)); - } - if (!m_lastWaypoint.isEmpty()) { - lines.append(QString("Last waypoint: %1 at %2").arg(m_lastWaypoint).arg(m_timeOver.toString("hh:mm:ss"))); - } - if (!m_nextWaypoint.isEmpty()) { - lines.append(QString("Next waypoint: %1 ETA %2").arg(m_nextWaypoint).arg(m_etaNext.toString("hh:mm:ss"))); - } - if (!m_nextPlus1Waypoint.isEmpty()) { - lines.append(QString("Then: %1").arg(m_nextPlus1Waypoint)); - } - if (m_temperatureValid) { - lines.append(QString("Temperature: %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); - } - } - if (hasFpn) - { - // In the order the flight is flown, rather than the order the fields happen - // to appear in the message - if (!m_fpnDeparture.isEmpty()) { - lines.append(QString("Departure: %1").arg(icaoAndAirportName(m_fpnDeparture))); - } - if (!m_fpnRunway.isEmpty()) { - lines.append(QString("Runway: %1").arg(m_fpnRunway)); - } - if (!m_fpnSid.isEmpty()) { - lines.append(QString("SID: %1").arg(m_fpnSid)); - } - if (!m_fpnRoute.isEmpty()) { - lines.append(QString("Route: %1").arg(m_fpnRoute)); - } - if (!m_fpnStar.isEmpty()) { - lines.append(QString("STAR: %1").arg(m_fpnStar)); - } - if (!m_fpnApproach.isEmpty()) { - lines.append(QString("Approach: %1").arg(m_fpnApproach)); - } - if (!m_fpnArrival.isEmpty()) { - lines.append(QString("Arrival: %1").arg(icaoAndAirportName(m_fpnArrival))); - } - if (!m_fpnAlternate.isEmpty()) { - lines.append(QString("Alternate: %1").arg(icaoAndAirportName(m_fpnAlternate))); - } - } - if (m_positionValid && !m_posAdditionalData.isEmpty()) { - lines.append(QString("Additional data: %1").arg(m_posAdditionalData)); - } - if (lines.isEmpty()) { - return ""; - } - if (!m_fmsSublabel.isEmpty()) { - lines.prepend(QString("Subsystem: %1").arg(m_fmsSublabel)); - } - return lines.join("
"); -} - -bool AcarsMessageFromSubsystem::getPosition(float& latitude, float& longitude, int& altitudeFt) const -{ - if (!m_positionValid) { - return false; - } - latitude = m_latitude; - longitude = m_longitude; - altitudeFt = m_altitudeFt; - return true; -} - -AcarsOutReport::AcarsOutReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsOutReport::decode(const QString &text) -{ - m_departure = text.mid(0, 4); - m_destination = text.mid(4, 4); - m_outTimeHours = text.mid(8, 2).toInt(); - m_outTimeMinutes = text.mid(10, 2).toInt(); - m_fuel = text.mid(12, 4).toInt(); - m_boardedFuel = text.mid(16, 4); // Can be ----- - m_freeText = text.mid(20, text.length() - 1).trimmed(); - return true; -} - -QString AcarsOutReport::toString() -{ - QString s = QString("Departure: %1
Destination: %2
Out time: %3:%4
Fuel: %5
Boarded fuel: %6") - .arg(icaoAndAirportName(m_departure)) - .arg(icaoAndAirportName(m_destination)) - .arg(m_outTimeHours, 2, 10, QChar('0')) - .arg(m_outTimeMinutes, 2, 10, QChar('0')) - .arg(m_fuel) - .arg(m_boardedFuel); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -AcarsOffReport::AcarsOffReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsOffReport::decode(const QString &text) -{ - m_departure = text.mid(0, 4); - m_destination = text.mid(4, 4); - m_offTimeHours = text.mid(8, 2).toInt(); - m_offTimeMinutes = text.mid(10, 2).toInt(); - m_freeText = text.mid(12, text.length() - 1).trimmed(); - return true; -} - -QString AcarsOffReport::toString() -{ - QString s = QString("Departure: %1
Destination: %2
Off time: %3:%4") - .arg(icaoAndAirportName(m_departure)) - .arg(icaoAndAirportName(m_destination)) - .arg(m_offTimeHours, 2, 10, QChar('0')) - .arg(m_offTimeMinutes, 2, 10, QChar('0')); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -AcarsOnReport::AcarsOnReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsOnReport::decode(const QString &text) -{ - m_departure = text.mid(0, 4); - m_destination = text.mid(4, 4); - m_onTimeHours = text.mid(8, 2).toInt(); - m_onTimeMinutes = text.mid(10, 2).toInt(); - m_freeText = text.mid(12, text.length() - 1).trimmed(); - return true; -} - -QString AcarsOnReport::toString() -{ - QString s = QString("Departure: %1
Destination: %2
On time: %3:%4") - .arg(icaoAndAirportName(m_departure)) - .arg(icaoAndAirportName(m_destination)) - .arg(m_onTimeHours, 2, 10, QChar('0')) - .arg(m_onTimeMinutes, 2, 10, QChar('0')); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -AcarsInReport::AcarsInReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsInReport::decode(const QString &text) -{ - m_departure = text.mid(0, 4); - m_destination = text.mid(4, 4); - m_inTimeHours = text.mid(8, 2).toInt(); - m_inTimeMinutes = text.mid(10, 2).toInt(); - m_fuel = text.mid(12, 4).toInt(); - m_captainFirstOfficerId = text[16]; - m_landingCategory = text[17]; - m_freeText = text.mid(18, text.length() - 1).trimmed(); - return true; -} - -QString AcarsInReport::toString() -{ - QString s = QString("Departure: %1
Destination: %2
In time: %3:%4
Fuel: %5
Id: %6
Landing category: %7") - .arg(icaoAndAirportName(m_departure)) - .arg(icaoAndAirportName(m_destination)) - .arg(m_inTimeHours, 2, 10, QChar('0')) - .arg(m_inTimeMinutes, 2, 10, QChar('0')) - .arg(m_fuel) - .arg(m_captainFirstOfficerId) - .arg(m_landingCategory); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -AcarsOutReturnInReport::AcarsOutReturnInReport(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsOutReturnInReport::decode(const QString &text) -{ - m_departure = text.mid(0, 4); - m_destination = text.mid(4, 4); - m_outTimeHours = text.mid(8, 2).toInt(); - m_outTimeMinutes = text.mid(10, 2).toInt(); - m_returnInTimeHours = text.mid(12, 2).toInt(); - m_returnInTimeMinutes = text.mid(14, 2).toInt(); - m_fuel = text.mid(16, 4).toInt(); - m_freeText = text.mid(20, text.length() - 1).trimmed(); - return true; -} - -QString AcarsOutReturnInReport::toString() -{ - QString s = QString("Departure: %1
Destination: %2
Out time: %3:%4
Return in time: %5:%6
Fuel: %7") - .arg(icaoAndAirportName(m_departure)) - .arg(icaoAndAirportName(m_destination)) - .arg(m_outTimeHours, 2, 10, QChar('0')) - .arg(m_outTimeMinutes, 2, 10, QChar('0')) - .arg(m_returnInTimeHours, 2, 10, QChar('0')) - .arg(m_returnInTimeMinutes, 2, 10, QChar('0')) - .arg(m_fuel); - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} - -// ARINC 620 -AcarsSquitter::AcarsSquitter(const QByteArray &message) : - AcarsMessage(message) -{ -} - -bool AcarsSquitter::decode(const QString &text) -{ - if (m_uplink) - { - m_version = text.mid(0, 2); - m_serviceProvider = text.mid(2, 2); - if (m_version == "00") - { - m_freeText = text.mid(4); - } - else - { - m_iataStationId = text.mid(4, 3); - m_icaoStationId = text.mid(7, 4); - m_stationNumber = text.mid(11, 1); - if (m_version == "01") - { - m_freeText = text.mid(12); - } - else - { - m_latitude = text.mid(12, 5); - m_longitude = text.mid(17, 6); - int idx = 23; - while ((text[idx] != '/') && (idx < text.length())) - { - if ((text[idx] == 'V') || (text[idx] == 'A') || (text[idx] == 'B')) - { - m_alternateService.append(text[idx]); - m_alternateFrequency.append(QString("%1.%2kHz") - .arg(text.mid(idx+1,3)) - .arg(text.mid(idx+4,3))); - idx += 7; - } - else - { - break; - } - } - idx++; - m_freeText = text.mid(idx); - } - } - } - return true; -} - -QString AcarsSquitter::toString() -{ - const QHash service = { - {"A", "VDL Mode 2 ATN Only"}, - {"B", "VDL Mode 2 AOA and ATN"}, - {"V", "VDL Mode 2 AOA Only"}, - }; - const QHash serviceProviders = { - {"XA", "Rockwell Collins IMS"}, - {"XS", "SITA VHF"}, - {"AS", "Honeywell"}, - }; - QString serviceProvider = m_serviceProvider; - if (serviceProviders.contains(m_serviceProvider)) { - serviceProvider = QString("%1 (%2)").arg(m_serviceProvider).arg(serviceProviders.value(m_serviceProvider)); - } - QString s = QString("Version: %1
Service provider: %2") - .arg(m_version) - .arg(serviceProvider); - if (m_version != "00") - { - s.append(QString("
IATA station Id: %1
ICAO station Id: %2
Station number: %3") - .arg(m_iataStationId) - .arg(icaoAndAirportName(m_icaoStationId)) - .arg(m_stationNumber)); - if (m_version != "01") - { - s.append(QString("
Latitude: %1
Longitude: %2") - .arg(m_latitude) - .arg(m_longitude)); - for (int i = 0; i < m_alternateService.size(); i++) - { - s.append(QString("
Alternate service: %1 - %2") - .arg(service[m_alternateService[i]]) - .arg(m_alternateFrequency[i])); - } - } - } - if (!m_freeText.isEmpty()) { - s.append(QString("
Free text: %1").arg(m_freeText)); - } - return s; -} diff --git a/plugins/channelrx/demodacars/icons/forward.png b/plugins/channelrx/demodacars/icons/forward.png new file mode 100644 index 000000000..fe29ead06 Binary files /dev/null and b/plugins/channelrx/demodacars/icons/forward.png differ diff --git a/plugins/channelrx/demodacars/readme.md b/plugins/channelrx/demodacars/readme.md index 147bb331f..0ef610b68 100644 --- a/plugins/channelrx/demodacars/readme.md +++ b/plugins/channelrx/demodacars/readme.md @@ -2,17 +2,17 @@

Introduction

-This plugin can be used to demodulate ACARS, VDL-2, HFDL and Aero data packets, broadcast by aircraft and satellites. -These packets can contain flight plans as well as status information about the aircraft. +This plugin can be used to demodulate ACARS, VDL-2, HFDL, Aero and Iridium data packets, broadcast to and from aircraft. +These packets can contain flight plans and other operational data as well as status information about the aircraft. -ACARS uses MSK modulation at 2400 baud, which is then AM modulated on to the VHF carrier. +ACARS uses MSK modulation at 2,400 baud, which is then AM modulated on to the VHF carrier. In Europe, the main ACARS frequencies are: - 131.525 MHz (SITA - Europe secondary) - 131.725 MHz (SITA - Europe primary) - 131.825 MHz (ARINC/Collins) -VDL Mode 2 uses D8PSK modulation at 10500 baud (bit rate 31500 bps). It can contain ACARS or ATN packets. +VDL Mode 2 uses D8PSK modulation at 10,500 baud (bit rate 31,500 bps). It can contain ACARS or ATN packets. VDL Mode 2 frequencies in Europe are: - 136.675 MHz (ARINC) @@ -24,12 +24,12 @@ VDL Mode 2 frequencies in Europe are: - 136.900 MHz - 136.975 MHz (SITA & ARINC, the common signalling channel) -HFDL uses M-PSK at 1800 baud and frequencies are between 2 and 21 MHz. The active frequencies vary with propagation, and the -frequencies in use are reported in squitters transmitted by the groundstations. These are combined by the demodulator and +HFDL uses M-PSK at 1,800 baud and frequencies are between 2 and 21 MHz. The active frequencies vary with propagation, and the +frequencies in use are reported in squitters transmitted by the ground stations. These are combined by the demodulator and displayed in the Ground Station Table dialog. You can find an initial frequency to try on: https://hfdl.observer/ -Inmarsat Classic Aero (aviation SATCOM). The ground station to aircraft -(P channel) downlink is in L band around: +Inmarsat Classic Aero (aviation SATCOM) uses MSK at 600 and 1,200 bps and OQPSK at 10,500 bps. The ground station to aircraft +(P channel) uplink is in L band around: | Region | Id | Satellite | Longitude | G->A Frequency | |---------------------|-------|---------------------------|-----------|------------------| @@ -38,6 +38,27 @@ Inmarsat Classic Aero (aviation SATCOM). The ground station to aircraft | Pacific Ocean | POR | Inmarsat 4-F1 | 178E | | | Indian Ocean | IOR | Inmarsat 4A-F4 / Alphasat | 25E | | +Unlike the other modes, which are continuous narrowband channels, Iridium is burst TDMA from +satellites in low earth orbit: DQPSK at 25 kBd in bursts of about 8.3 ms within a 90 ms frame. +Channels are spaced 41.67 kHz apart. + +| Channel | Frequency | Carries | +|--------------------------|------------------|--------------------------------------------------------| +| Ring alert | 1,626.270833 MHz | Satellite position and paging - always transmitting | +| Duplex traffic | 1,616 - 1,626 MHz| Short burst data, which is what carries ACARS | + +Iridium does not tune a single channel like the other modes. A duplex channel is assigned when a call is set up, out of +about 240 spaced 41.67 kHz, so watching one channel sees only a few percent of the traffic. Instead the +whole tuned width is split by a polyphase channelizer and a burst receiver run on every output. The width is chosen with +the combo box next to the Mode selector: + +| Scan width | Channels | Sample rate | Covers | +|------------|----------|-------------|-------------------------------------------| +| 1 MHz | 32 | 1 MS/s | part of the band | +| 2 MHz | 64 | 2 MS/s | part of the band | +| 4 MHz | 128 | 4 MS/s | about half the band | +| 8 MHz | 256 | 8 MS/s | all of it, tuned to 1623 MHz | +

Interface

![ACARS Demodulator plugin GUI](../../../doc/img/AcarsDemod_plugin.png) @@ -58,37 +79,43 @@ Average total power in dB relative to a +/- 1.0 amplitude signal received in the

4: Mode and Aero rate

-Selects the demodulator: ACARS, VDL-2, HFDL or Aero - and, in Aero mode +Selects the demodulator: ACARS, VDL-2, HFDL, Aero or Iridium - and, in Aero mode only, the rate and channel selector appears beside it. -Changing either resets the demodulator and sets a default RF bandwidth to suit. - - - ACARS: plain old ACARS, 2400 baud MSK amplitude modulated onto VHF - - VDL-2: VDL Mode 2, D8PSK at 10500 baud - - Aero: Inmarsat Classic Aero, at 600, 1200 or 10500 bps - - HFDL: HF Data Link, 1800 baud PSK at 300 to 1800 bps (Bitrate is automatically detected) - +Changing either resets the demodulator and sets a default RF bandwidth. Each demodulator runs at its own fixed channel sample rate, which the channelizer is set to when the mode is selected. - - - - - - - - -
ModeChannel sample rateSymbol rateSamples per symbol
ACARS48 kS/s2400 Bd20
VDL-2105 kS/s10500 Bd10
HFDL7.2 kS/s1800 Bd4
Aero, 600 bps19.2 kS/s600 Bd32
Aero, 1200 bps19.2 kS/s1200 Bd16
Aero, 10500 bps105 kS/s5250 Bd20
+| Mode | Sample rate | Symbol rate |Samples per symbol| +|------------------|-------------|-------------|------------------| +| ACARS | 48 kS/s | 2,400 Bd | 20 | +| VDL-2 | 105 kS/s | 10,500 Bd | 10 | +| HFDL | 7.2 kS/s | 1,800 Bd | 4 | +| Aero, 600 bps | 19.2 kS/s | 600 Bd | 32 | +| Aero, 1,200 bps | 19.2 kS/s | 1,200 Bd | 16 | +| Aero, 10,500 bps | 105 kS/s | 5,250 Bd | 20 | +| Iridium | 1-8 MS/s | 25,000 Bd | 5 |

5: RF Bandwidth

This specifies the bandwidth of a LPF that is applied to the input signal to limit the RF bandwidth. +A default value is automatically set when selecting the Mode, and in Aero mode the rate +and channel, from the combo boxes (4): + +| Mode | Rate | Default RF bandwidth | +|-------|----------------------|----------------------| +| ACARS | 2,400 bps | 12.5 kHz | +| VDL-2 | 31,500 bps | 25.0 kHz | +| HFDL | 300 - 1,800 bps | 3.0 kHz | +| Aero | 600 bps, P, R or T | 1.2 kHz | +| Aero | 1,200 bps, P, R or T | 2.4 kHz | +| Aero | 10,500 bps P | 13.1 kHz | +| Iridium | 25,000 Bd | not used (see above) |

6: Threshold

ARACS pre-key (preamble) detection threshold, as a fraction from 0 to 1. The statistic it is compared against -is the depth of 2400 Hz modulation on the envelope. A real pre-key +is the depth of 2,400 Hz modulation on the envelope. A real pre-key reads about 0.85 and noise reads near zero, so the default of 0.25 sits between them and is a false alarm setting rather than something to tune per station. Lower it only if transmissions are being missed entirely. @@ -115,63 +142,55 @@ received. In **Aero**, these are the satellite housekeeping the ground earth station broadcasts continuously, whether or not any aircraft is logged on: the system tables that describe -the satellite, its beams and its channels, the data EIRP table, the fill-in signal units -that pad a frame out to length, and the reserved types nobody has documented. On a -P channel these are most of what is transmitted. +the satellite, its beams and its channels. In **VDL-2**, these are the supervisory and link management responses - `RR`, `RNR`, `REJ`, `SREJ`, `DM`, `DISC`, `UA`, `FRMR` and `U`.

11: Display Chart

-When checked, displays a chart plotting the number of frames received per second. +When checked, displays a chart plotting the number of frames received per second for each mode. See below.

12: Display Ground Station Table

When checked, displays a table of the ground stations heard in squitters and the frequencies each announced as in use. Right clicking a row offers finding that station on the Map, or retuning the device so this channel receives that frequency. -

13: Feed

+

13: Download Aircraft Database

-When checked, forwards received ACARS messages to community aggregators, as acarsdec-style JSON - one object per UDP datagram, or a newline-delimited stream over TCP. -Right click the button for settings: a station identifier sent with every message, and per-service enables with host, port and protocol. +Click to download an aircraft database (45MB - same database as used by ADS-B demodulator). -

14: Download OpenSky Database

+This contains information such as the aircraft type, that will be displayed under the aircraft's image. +It also allows matching 24-bit ICAO addresses to registrations, for VDL-2, HFDL and Aero. -

15: Start/stop Logging ACARS packets to .csv File

+

14: Start/stop Logging ACARS packets to .csv File

-When checked, writes all received ACARS packets to a .csv file. The file has two columns, -`DateTime` and `Data`: the date and time as ISO 8601 with milliseconds, and the packet as -hexadecimal. Earlier versions wrote separate `Date` and `Time` columns in the local -format; those files are no longer read. +When checked, writes all received ACARS packets to a .csv file. -

16: .csv Log Filename

+

15: .csv Log Filename

Click to specify the name of the .csv file which received ACARS packets are logged to. -

17: Read Data from .csv File

+

16: Read Data from .csv File

Click to specify a previously written ACARS .csv log file, which is read and used to update the ACARS messages table. -

18: Clear Messages from table

+

17: Clear Messages from table

Pressing this button clears all messages from the table.

Frames per Second Chart

-The chart button toggles a chart plotting the number of frames received per second, as one -series per protocol: +![ACARS FPS Chart](../../../doc/img/AcarsDemod_chart.png) - - **ACARS** - ACARS messages, from whichever protocol is selected. A message carried over - VDL-2, HFDL or Aero counts here, not under its protocol, because it is the same kind of - message however it arrived. + - **ACARS** - ACARS messages, from whichever mode is selected (4). A message carried over + VDL-2, HFDL, Aero or Iridium counts here, not under its mode. - **VDL-2 link** - AVLC link frames that are not ACARS: XID and GSIF link management, and supervisory acknowledgements whether or not they are displayed in the table. - **HFDL** - squitters and logons. - **Aero** - log-ons, log-offs, channel assignments and acknowledgements. -Clicking a legend entry shows or hides that series; right clicking the -chart button clears the data. +Clicking a legend entry shows or hides that series; right clicking the chart button clears the data. The mouse wheel zooms the time axis, or the rate axis with shift held, centred on the cursor; dragging with the left button pans. The time axis follows the newest data whenever its right edge is at the latest point. Data more than 10 minutes old is averaged over one @@ -181,12 +200,16 @@ minute intervals, so long sessions do not accumulate an excessive number of poin The received messages table displays the contents of the ACARS packets that have been received. +![ACARS Messages Table](../../../doc/img/AcarsDemod_table.png) +

Message Decode

The decode field displays a decode of the ACARS message selected in the received messages table. For multipart messages it shows the assembly status, the combined message - decoded once all parts have arrived - and the selected block. +![ACARS Messages Decode](../../../doc/img/AcarsDemod_decode.png) + * Date/Time - The receiver's local date and time when the ACARS message was received, or the recorded date and time when reading a CSV log. Right click the table to choose between showing the date and time or the time alone; the column sorts by the full date and time either way. * Dir - The transmission direction. An up arrow is an uplink from a ground station to an aircraft; a down arrow is a downlink from an aircraft to a ground station. * GS - Ground Station Id. ACARS: ARINC 618 Mode character. VDL-2: Ground Station (GS). HFDL: Ground Station (GS). Aero: Ground Earth Station (GES). @@ -202,32 +225,22 @@ parts have arrived - and the selected block. * Block Seq. - For multipart downlinks, the block sequence character used to order the blocks. * Flight - For downlinks, the six-character flight identifier carried in the message text header. * Message - The ACARS message payload after the standard downlink header fields and any recognized sublabel have been removed. -* Message Decode - A structured, human-readable decode of the message payload, flattened to a single - semicolon-separated line so more fits in the column. Selecting the row displays the full multi-line - decode below the table, with field labels bolded; the same multi-line form is what the Aircraft - feature shows in its Map popups. - Beyond the ARINC 622/623 ATS messages (CPDLC, oceanic and departure clearances, ATIS), decoders are included for - position reports (labels 10, 12, 16, 22, 24, 44 and H1 FMS reports, which also feed the Lat/Lon columns), - airline operational reports (label 80 POSRPT/OPNORM/INRANG), OOOI event reports (labels 13-18 and QP-QT), - flight status reports (label 15 FST01), H1 FMS flight plans and route inserts, - weather requests (label 5U) and frequency autotune (label :;). Several of these are airline formats without public - documentation; the field layouts follow [airframes.io's community documentation](https://github.com/airframesio/acars-message-documentation) and observed traffic. +* Message Decode - A structured, human-readable decode of the message payload. + Selecting the row displays the full multi-line + decode below the table. * ATC - Air Traffic Control communication extracted from supported ARINC 622/CPDLC messages. * Lat (°) - Aircraft latitude extracted from an ADS-C or CPDLC position report or any decoded message carrying a position (position report labels, OOOI events, FST01 flight status, H1 FMS reports), in decimal degrees; north is positive and south is negative. * Lon (°) - Aircraft longitude extracted from the same sources, in decimal degrees; east is positive and west is negative. * Alt (ft) - Aircraft altitude extracted from an ADS-C or CPDLC position report, in feet. * Hex - The complete received ACARS frame rendered as hexadecimal bytes, including its framing, header, payload, check sequence, and terminating byte. -* Protocol - Which link the frame arrived on: `ACARS`, `VDL-2`, `HFDL`, or `Aero` followed by the channel it came on - `Aero P`, `Aero R` or `Aero T` - since on Aero the channel is what says which link it was. This is kept separate from Label Decode, which describes what the Label means and nothing else. -* Rate (bps) - The bit rate the frame was sent at: 2400 for ACARS, 31500 for VDL-2, 300 to 1800 for HFDL and 600, 1200 or 10500 for Aero. Note that VDL-2's 31500 bps is carried by 10500 symbols per second of D8PSK, three bits to a symbol, so this figure and the symbol rate quoted under Mode (4) differ for that protocol alone. - -Both columns are added at the right hand end rather than beside Dir where they belong, because saved column widths and positions are stored by column number and inserting in the middle would shift every one of them. Drag them wherever suits; the position is remembered. +* Protocol - Which link the frame arrived on: `ACARS`, `VDL-2`, `HFDL`, or `Aero` followed by the channel it came on - `Aero P`, `Aero R` or `Aero T`. +* Rate (bps) - The bit rate the frame was sent at: 2400 for ACARS, 31500 for VDL-2, 300 to 1800 for HFDL and 600, 1200 or 10500 for Aero.

VDL-2 Link Frames

In VDL-2 mode, ACARS messages carried over AVLC fill the table exactly as described above. -AVLC frames that do not carry an ACARS message (ATN data, XID/GSIF link management, and - -unless hidden by (10) - supervisory acknowledgements) have no ACARS header, so only the -following columns are used: +AVLC frames that do not carry an ACARS message (ATN data, XID/GSIF link management, and supervisory acknowledgements) +have no ACARS header, so only the following columns are used: * Date/Time - The receiver's local date and time when the frame was received. * Dir - The transmission direction. An up arrow is an uplink to an aircraft; a down arrow is a downlink from an aircraft. @@ -238,23 +251,18 @@ following columns are used: * Label Decode - What the frame type means, for example `Information`, `Exchange identification (link management)`, `Receive ready` or `Selective reject - retransmit this frame`. * Message - The source and destination addresses of the frame, followed for information frames by the decoded protocol stack, layer by layer, for example `X.25 DATA > CLNP > COTP DT > CPDLC`, and for XID frames by the message type, for example `XID: Handoff Initiation` or `XID: Ground Station Information Frame`. X.25 call setup, clear and supervisory packets, ES-IS and IDRP routing traffic are identified by name. * Message Decode - For information frames carrying an ICAO ATN application, the full decode of the CM (context management logon), CPDLC or ADS-C version 2 message. For XID frames, the decoded public and VDL-specific link parameters: connection management, XID sequencing, frequency support, ground station location, destination airport, ATN router NETs and so on. Multi-line decodes are flattened with semicolons; hover over the cell (or select the row) for the original multi-line form. -* ATC - For frames carrying a CPDLC controller-pilot message, the expanded message elements and their arguments, for example `WILCO` or `REQUEST [level], Flight level: 370` - the ATN equivalent of the DO-219 expansion shown for ACARS ATC messages. Left blank for CPDLC frames with no message data. +* ATC - For frames carrying a CPDLC controller-pilot message, the expanded message elements and their arguments, for example `WILCO` or `REQUEST [level], Flight level: 370` - the ATN equivalent of the DO-219 expansion shown for ACARS ATC messages. * Lat (°) / Lon (°) - The position from an XID aircraft or ground station location parameter, or from an ADS-C version 2 report, in decimal degrees. The XID encoding is coarse (0.1 degrees, roughly 10 km); ADS-C positions are precise. * Alt (ft) - The altitude from an XID aircraft location parameter (1000 ft resolution) or an ADS-C version 2 report, in feet. * Hex - The complete AVLC frame rendered as hexadecimal bytes: address fields, link control, information field and frame check sequence.

HFDL Frames

-HFDL frames that are not carrying an ACARS message use the same columns as the VDL-2 link -frames below. The Label is the LPDU type as its hexadecimal octet and the Label Decode is -what that type is - `Logon request`, `Unnumbered data` and so on. A squitter is not an -LPDU and has no type octet, so it is labelled `Squitter`, decoded as -`Ground station frequency broadcast`. +HFDL frames that are not carrying an ACARS message use the same columns as the VDL-2 link frames.

Aero Signal Units

-In Aero mode, ACARS messages carried over the satellite link are reassembled from their -signal units inside the demodulator and fill the table exactly as described above. Signal +In Aero mode, ACARS messages carried over the satellite link are as described above. Signal units that are not carrying an ACARS message use only the following columns: * Date/Time - The receiver's local date and time when the signal unit was received. @@ -264,21 +272,16 @@ units that are not carrying an ACARS message use only the following columns: * GS - Ground Earth Station (GES) Id. * GS Decode - Satellite name, for example 'AOR-E'. See frequency table above. * Registration - The aircraft, when the signal unit names one. The AES ID is the - aircraft's 24-bit ICAO address - the same address it transmits in Mode S / ADS-B - so - the registration is looked up from the OpenSky database (14); when the address is not - in the database, the address itself is shown in hexadecimal. Blank for signal units - that name no aircraft. -* Label - The signal unit type as its hexadecimal octet, for example `10`, `32` or `0C`. + aircraft's 24-bit ICAO address - the same address it transmits in Mode S / ADS-B. +* Label - The signal unit type as its hexadecimal octet. * Label Decode - What that type is, for example `Log-on request`, `C channel assignment, flight safety` or `System table, satellite identification`. * Message - The two ends of the exchange, as `GES 2A` and the aircraft, in the direction of transmission. Signal units carrying neither an AES ID nor a GES ID show `Broadcast` instead: the system and EIRP tables describe the satellite and its beams - rather than addressing any one aircraft, so there is no conversation to show. Most - `Broadcast` rows are hidden by default; uncheck (10) to see them. + rather than addressing any one aircraft, so there is no conversation to show. * Message Decode - The decoded contents, where the unit has any: the pair of L band - frequencies and beam type in a voice channel assignment, the log-on parameters, and so - on. + frequencies and beam type in a voice channel assignment, the log-on parameters, and so on. * Hex - The complete signal unit as hexadecimal bytes, with the type in the first octet.

Attribution

@@ -302,4 +305,9 @@ reading [JAERO](https://github.com/jontio/JAERO) by Jonti Olds (MIT). The community VDL Mode 2 ground station list is vendored from [acars-vdl2 @ Groups.io](https://acars-vdl2.groups.io/). +The frame formats, BCH polynomials and interleaving are from iridium-toolkit, and the physical layer constants from +gr-iridium: https://github.com/muccc/iridium-toolkit and https://github.com/muccc/gr-iridium + +Forward icon by Pandu Bramantyo from Noun Project, licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). + Some code was written using AI. diff --git a/plugins/channelrx/demodacars/vdl2atn.cpp b/plugins/channelrx/demodacars/vdl2atn.cpp index 8dfba7e14..00ad6de77 100644 --- a/plugins/channelrx/demodacars/vdl2atn.cpp +++ b/plugins/channelrx/demodacars/vdl2atn.cpp @@ -23,6 +23,9 @@ #include +// For xidDestinationAirport(), which the Aircraft feature reads too +#include "util/aircraftreport.h" + #include #include @@ -281,6 +284,24 @@ Vdl2AtnDecoder::Result Vdl2AtnDecoder::decode(const QByteArray& info, quint32 sr } } +// The XID VDL parameter set carries the destination as a four letter ICAO ident: +// +// VDL params: +// Parameter set ID: V +// Connection management: 05 +// ... +// Destination airport: EGCC +// +// Anchored to the end of the line so a longer value - the parameter is an octet string, +// so nothing guarantees four characters - is rejected rather than truncated to its first +// four. Only exactly four letters is an ICAO ident. +QString Vdl2AtnDecoder::xidDestinationAirport(const QString& decoded) +{ + // One definition, in sdrbase, because the Aircraft feature reads the same field out + // of stored logons and cannot link this plugin + return ::xidDestinationAirport(decoded); +} + Vdl2AtnDecoder::Result Vdl2AtnDecoder::decodeXid(const QByteArray& info, bool cr, bool pf) { Result result; @@ -307,6 +328,8 @@ Vdl2AtnDecoder::Result Vdl2AtnDecoder::decodeXid(const QByteArray& info, bool cr result.m_summary = "XID"; } + result.m_destinationAirport = xidDestinationAirport(result.m_decoded); + // Pull the position out of a location parameter: "Aircraft location: 51.6N 2.7E // 37000 ft" (aircraft, with altitude) or "Ground station location: 51.6N 2.7E" static const QRegularExpression locRe( @@ -597,6 +620,12 @@ void Vdl2AtnDecoder::parseCotp(const uint8_t *buf, int len, quint32 srcAddr, qui // indented under "Message data:", which are the element text ("WILCO", // "REQUEST [level]") followed by any argument lines ("Flight level: 370"). This is the // ATN equivalent of the DO-219 expansion the ACARS path puts in the ATC column. +// +// The arguments are put into the element's own placeholders rather than listed after +// it, so "NEXT DATA AUTHORITY ([facility designation])" with "Facility designation: +// EDYY" under it reads "NEXT DATA AUTHORITY (EDYY)". Only the value is used: the +// placeholder is usually an abbreviation of the argument's name rather than something +// it adds to, so keeping both gives "PREFERRED LEVEL Flight level: 370" static QString extractCpdlcMessageData(const QString& decoded) { auto indentOf = [](const QString& line) @@ -608,7 +637,7 @@ static QString extractCpdlcMessageData(const QString& decoded) return i; }; - QStringList out; + QStringList elements; const QStringList lines = decoded.split('\n'); for (int i = 0; i < lines.size(); i++) @@ -616,15 +645,77 @@ static QString extractCpdlcMessageData(const QString& decoded) if (lines[i].trimmed() != "Message data:") { continue; } - int indent = indentOf(lines[i]); - while ((i + 1 < lines.size()) && (indentOf(lines[i+1]) > indent) && !lines[i+1].trimmed().isEmpty()) + const int dataIndent = indentOf(lines[i]); + + while ((i + 1 < lines.size()) && (indentOf(lines[i+1]) > dataIndent) && !lines[i+1].trimmed().isEmpty()) { i++; - out.append(lines[i].trimmed()); + const int elementIndent = indentOf(lines[i]); + QString element = lines[i].trimmed(); + + // Argument lines are indented under the element they belong to. If a decode + // ever puts them at the same level they are treated as elements of their + // own, which is what this did for every message before + QStringList names; + QStringList values; + + while ((i + 1 < lines.size()) && (indentOf(lines[i+1]) > elementIndent) && !lines[i+1].trimmed().isEmpty()) + { + i++; + const QString argument = lines[i].trimmed(); + const int colon = argument.indexOf(':'); + + if (colon >= 0) + { + names.append(argument.left(colon).trimmed()); + values.append(argument.mid(colon + 1).trimmed()); + } + else + { + names.append(QString()); + values.append(argument); + } + } + + auto argumentText = [&names, &values](int index) + { + return names[index].isEmpty() ? values[index] + : names[index] + ": " + values[index]; + }; + + // Placeholders are filled left to right, which is the order libacars lists + // the arguments in + int argument = 0; + int from = 0; + + while (argument < names.size()) + { + const int open = element.indexOf('[', from); + if (open < 0) { + break; + } + const int close = element.indexOf(']', open); + if (close < 0) { + break; + } + const QString& replacement = values[argument]; + + element.replace(open, close - open + 1, replacement); + from = open + replacement.size(); + argument++; + } + + // More arguments than placeholders, so the rest are listed as before rather + // than dropped + for (; argument < names.size(); argument++) { + element.append(", " + argumentText(argument)); + } + + elements.append(element.simplified()); } } - return out.join(", "); + return elements.join(", "); } // The ICAO ULCS / application layer, decoded by the vendored dumpvdl2 ASN.1 decoder diff --git a/plugins/channelrx/demodacars/vdl2atn.h b/plugins/channelrx/demodacars/vdl2atn.h index 46f9918b8..e78f92dff 100644 --- a/plugins/channelrx/demodacars/vdl2atn.h +++ b/plugins/channelrx/demodacars/vdl2atn.h @@ -60,8 +60,18 @@ public: float m_longitude = 0.0f; bool m_hasAltitude = false; //!< Aircraft locations carry an altitude, ground stations do not int m_altitudeFt = 0; + //!< Where the aircraft told the ground station it was going, from the XID + //!< destination airport parameter. Frequently the only place a flight's + //!< destination is stated at all - a short sector may log on and land without + //!< ever filing a plan or sending a position report. + QString m_destinationAirport; }; + //!< Pulled out of the formatted decode rather than the parameter tree, as the + //!< position is. Static and public so it can be tested on its own: the text is what + //!< libacars produces and the pattern is the part that can be wrong. + static QString xidDestinationAirport(const QString& decoded); + // Decode the information field of one AVLC I frame Result decode(const QByteArray& info, quint32 srcAddr, quint32 dstAddr, bool fromAircraft); diff --git a/plugins/channelrx/demodadsb/CMakeLists.txt b/plugins/channelrx/demodadsb/CMakeLists.txt index 1d0ee654c..f5268111f 100644 --- a/plugins/channelrx/demodadsb/CMakeLists.txt +++ b/plugins/channelrx/demodadsb/CMakeLists.txt @@ -10,6 +10,9 @@ set(adsb_SOURCES adsbdemodbaseband.cpp adsbdemodreport.cpp adsbdemodworker.cpp + adsbdemodtracker.cpp + adsbdemodtrackerdecode.cpp + adsbaircraft.cpp ) set(adsb_HEADERS @@ -22,6 +25,8 @@ set(adsb_HEADERS adsbdemodbaseband.h adsbdemodreport.h adsbdemodworker.h + adsbdemodtracker.h + adsbaircraft.h adsbdemodstats.h adsb.h ) @@ -35,6 +40,7 @@ if(NOT SERVER_MODE) ${adsb_SOURCES} adsbdemodgui.cpp adsbdemodgui.ui + adsbaircrafttablemodel.cpp adsbdemodfeeddialog.cpp adsbdemodfeeddialog.ui adsbdemoddisplaydialog.cpp @@ -43,6 +49,7 @@ if(NOT SERVER_MODE) adsbdemodnotificationdialog.ui adsbosmtemplateserver.cpp adsbdemodmap.qrc + adsbdemodmapliveries.qrc adsbdemodicons.qrc airlinelogos.qrc flags.qrc @@ -51,12 +58,11 @@ if(NOT SERVER_MODE) set(adsb_HEADERS ${adsb_HEADERS} adsbdemodgui.h + adsbaircrafttablemodel.h adsbdemodfeeddialog.h adsbdemoddisplaydialog.h adsbdemodnotificationdialog.h adsbosmtemplateserver.h - ourairports.h - osndb.h ) set(TARGET_NAME ${PLUGINS_PREFIX}demodadsb) @@ -97,7 +103,7 @@ target_link_libraries(${TARGET_NAME} PRIVATE install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) -if(WIN32) +if(WIN32 AND NOT SERVER_MODE) # Run deployqt for QtGraphicalEffects, which isn't used in other plugins include(DeployQt) windeployqt(${TARGET_NAME} ${SDRANGEL_BINARY_BIN_DIR} ${PROJECT_SOURCE_DIR}/map) diff --git a/plugins/channelrx/demodadsb/adsbaircraft.cpp b/plugins/channelrx/demodadsb/adsbaircraft.cpp new file mode 100644 index 000000000..123460d4b --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbaircraft.cpp @@ -0,0 +1,474 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include "util/units.h" +#include "util/aircraft3dmodels.h" +#include "util/aircraftreport.h" + +#include "adsbaircraft.h" +#include "adsb.h" + +QString ADSBAircraft::getImage() const +{ + if (m_aircraftInfo && !m_aircraftInfo->m_type.isEmpty()) + { + // https://www.icao.int/publications/doc8643/pages/search.aspx + static const QStringList fourEngineTypes = {"A388", "B741", "B742", "B743", "B744", "B748", "B74R", "B74S", "BLCF", "A342", "A343", "A345", "A346", "C17", "K35R"}; + + if (fourEngineTypes.contains(m_aircraftInfo->m_type)) { + return QString("aircraft_heavy_4engine.png"); + } else if (m_aircraftInfo->m_type == "EUFI") { + return QString("eurofighter.png"); + } else if (m_aircraftInfo->m_type == "VF35") { + return QString("f35.png"); + } else if ((m_aircraftInfo->m_type == "SPIT") || (m_aircraftInfo->m_type == "HURI")) { + return QString("spitfire.png"); + } else if ((m_aircraftInfo->m_type == "A400") || (m_aircraftInfo->m_type == "C30J")) { + return QString("a400m.png"); + } else if (m_aircraftInfo->m_type == "H64") { + return QString("apache.png"); + } else if (m_aircraftInfo->m_type == "H47") { + return QString("chinook.png"); + } + } + + if (m_emitterCategory.length() > 0) + { + if (!m_emitterCategory.compare("Heavy")) { // 777/787/A350 and 747/A380 - 4 engine handled above by type + return QString("aircraft_heavy_2engine.png"); + } else if (!m_emitterCategory.compare("Large")) { // A320/737 + return QString("aircraft_large.png"); + } else if (!m_emitterCategory.compare("Small")) { // Private jets + return QString("aircraft_small.png"); + } else if (!m_emitterCategory.compare("Rotorcraft")) { + return QString("aircraft_helicopter.png"); + } else if (!m_emitterCategory.compare("High performance")) { + return QString("aircraft_fighter.png"); + } else if (!m_emitterCategory.compare("Light") + || !m_emitterCategory.compare("Ultralight")) { + return QString("aircraft_light.png"); + } else if (!m_emitterCategory.compare("Glider/sailplane")) { + return QString("aircraft_glider.png"); + } else if (!m_emitterCategory.compare("Space vehicle")) { + return QString("aircraft_space.png"); + } else if (!m_emitterCategory.compare("UAV")) { + return QString("aircraft_drone.png"); + } else if (!m_emitterCategory.compare("Emergency vehicle") + || !m_emitterCategory.compare("Service vehicle")) { + return QString("truck.png"); + } else { + return QString("aircraft_large.png"); + } + } + else + { + return QString("aircraft_large.png"); + } +} + +// The two model sets disagree on case - Bluebell names the 777-300ER B77W, FSLTL B77w - +// and Qt looks resources up case sensitively, so 22 FSLTL liveries found no icon although +// the same one was sitting there under the other spelling. The icons are indexed once by +// lower case name, and that index is what the name is looked up in +static QString liveryIconFile(const QString& name) +{ + static const QHash icons = [] + { + QHash index; + const QStringList files = QDir(":/map/liveries").entryList({"*.png"}, QDir::Files); + index.reserve(files.size()); + for (const QString& file : files) { + index.insert(QFileInfo(file).completeBaseName().toLower(), file); + } + return index; + }(); + + if (name.isEmpty()) { + return QString(); + } + const QString file = icons.value(name.toLower()); + return file.isEmpty() ? QString() : QString("liveries/" + file); +} + +QString ADSBAircraft::getLiveryImage() const +{ + // The 3D model matcher has already picked a model such as + // BB_Airbus_png/A320/A320_BAW.gltf from the type and operator, and the livery icons + // are named after the models, so the icon just follows the model's basename + for (const QString& model : {m_aircraft3DModel, m_aircraftCat3DModel}) + { + if (!model.isEmpty()) + { + const QString image = liveryIconFile(Aircraft3DModels::liveryIconName(model)); + if (!image.isEmpty()) { + return image; + } + } + } + // No model match - use a white version of the plain icon, so the style stays + // consistent with the livery icons rather than dropping back to black + return liveryIconFile(QFileInfo(getImage()).completeBaseName()); +} + +QString ADSBAircraft::getText(const ADSBDemodSettings *settings, bool all, bool links) const +{ + // Written as a link only where one would work; plain text otherwise, rather than + // something that looks clickable and is not + auto identity = [links](const QString& kind, const QString& value) + { + return links ? aircraftMapLink(kind, value) : value.toHtmlEscaped(); + }; + QStringList list; + if (all) + { + if (!m_flagIconURL.isEmpty() && !m_sideviewIconURL.isEmpty()) + { + list.append(QString("
").arg(m_sideviewIconURL).arg(m_flagIconURL)); + } + else if (!m_flagIconURL.isEmpty() && !m_airlineIconURL.isEmpty()) + { + list.append(QString("
").arg(m_airlineIconURL).arg(m_flagIconURL)); + } + else + { + if (!m_flagIconURL.isEmpty()) { + list.append(QString("").arg(m_flagIconURL)); + } else if (!m_sideviewIconURL.isEmpty()) { + list.append(QString("").arg(m_sideviewIconURL)); + } else if (!m_airlineIconURL.isEmpty()) { + list.append(QString("").arg(m_airlineIconURL)); + } + } + list.append(QString("ICAO: %1").arg(identity("icao", m_icaoHex))); + if ((m_aircraftInfo != nullptr) && !m_aircraftInfo->m_registration.isEmpty()) { + list.append(QString("Reg: %1").arg(identity("registration", m_aircraftInfo->m_registration))); + } + if (!m_callsign.isEmpty()) { + list.append(QString("Callsign: %1").arg(identity("flight", m_callsign.trimmed()))); + } + QString atcCallsign = cellText(ADSB_COL_ATC_CALLSIGN); + if (!atcCallsign.isEmpty()) { + list.append(QString("ATC Callsign: %1").arg(atcCallsign)); + } + bool typeKnown = false; + if (m_aircraftInfo != nullptr) + { + if (!m_aircraftInfo->m_model.isEmpty()) + { + list.append(QString("Aircraft: %1").arg(m_aircraftInfo->m_model)); + typeKnown = true; + } + } + // The emitter category is the coarse size class the aircraft broadcasts about + // itself - "Large", "Heavy", "Rotorcraft". Where the model is known it says the + // same thing less precisely, so it is only worth a line when it is not. + if (!m_emitterCategory.isEmpty() && !typeKnown) { + list.append(QString("Category: %1").arg(m_emitterCategory)); + } + if (m_altitudeValid) + { + if (m_onSurface) + { + list.append(QString("Altitude: Surface")); + } + else + { + QString reference = m_altitudeGNSS ? "GNSS" : "Baro"; + if (settings->m_siUnits) { + list.append(QString("Altitude: %1 (m %2)").arg(Units::feetToIntegerMetres(m_altitude)).arg(reference)); + } else { + list.append(QString("Altitude: %1 (ft %2)").arg(m_altitude).arg(reference)); + } + } + } + if (m_groundspeedValid) + { + if (settings->m_siUnits) { + list.append(QString("GS: %1 (kph)").arg(Units::knotsToIntegerKPH(m_groundspeed))); + } else { + list.append(QString("GS: %1 (kn)").arg(m_groundspeed)); + } + } + if (m_verticalRateValid) + { + QString desc; + Real rate; + QString units; + + if (settings->m_siUnits) + { + rate = Units::feetPerMinToIntegerMetresPerSecond(m_verticalRate); + units = QString("m/s"); + } + else + { + rate = m_verticalRate; + units = QString("ft/min"); + } + if (m_verticalRate == 0) { + desc = "Level flight"; + } else if (rate > 0) { + desc = QString("Climbing: %1 (%2)").arg(rate).arg(units); + } else { + desc = QString("Descending: %1 (%2)").arg(rate).arg(units); + } + list.append(QString(desc)); + } + if ((m_status.length() > 0) && m_status.compare("No emergency")) { + list.append(m_status); + } + + QString flightStatus = cellText(ADSB_COL_FLIGHT_STATUS); + if (!flightStatus.isEmpty()) { + list.append(QString("Flight status: %1").arg(flightStatus)); + } + QString dep = cellText(ADSB_COL_DEP); + if (!dep.isEmpty()) { + list.append(QString("Departed: %1").arg(dep)); + } + QString std = cellText(ADSB_COL_STD); + if (!std.isEmpty()) { + list.append(QString("STD: %1").arg(std)); + } + QString atd = cellText(ADSB_COL_ATD); + if (!atd.isEmpty()) + { + list.append(QString("ATD: %1").arg(atd)); + } + else + { + QString etd = cellText(ADSB_COL_ETD); + if (!etd.isEmpty()) { + list.append(QString("ETD: %1").arg(etd)); + } + } + QString arr = cellText(ADSB_COL_ARR); + if (!arr.isEmpty()) { + list.append(QString("Arrival: %1").arg(arr)); + } + QString sta = cellText(ADSB_COL_STA); + if (!sta.isEmpty()) { + list.append(QString("STA: %1").arg(sta)); + } + QString ata = cellText(ADSB_COL_ATA); + if (!ata.isEmpty()) + { + list.append(QString("ATA: %1").arg(ata)); + } + else + { + QString eta = cellText(ADSB_COL_ETA); + if (!eta.isEmpty()) { + list.append(QString("ETA: %1").arg(eta)); + } + } + } + else + { + QDateTime labelDateTime; + list.append(getLabel(settings, labelDateTime)); + } + return list.join("
"); +} + +// See https://nats.aero/blog/2017/07/drone-disruption-gatwick/ for example of UK ATC display +QString ADSBAircraft::getLabel(const ADSBDemodSettings *settings, QDateTime& dateTime) const +{ + QString id; + if (!m_callsign.isEmpty()) + { + QString atcCallsign = cellText(ADSB_COL_ATC_CALLSIGN); + if (settings->m_atcCallsigns && !atcCallsign.isEmpty()) { + id = QString("%1 %2").arg(atcCallsign).arg(m_callsign.mid(3)); + } else { + id = m_callsign; + } + } + else + { + id = m_icaoHex; + } + QStringList strings; + strings.append(id); + if (settings->m_atcLabels) + { + // Route + QString dep = cellText(ADSB_COL_DEP); + QString arr = cellText(ADSB_COL_ARR); + QString stops = cellText(ADSB_COL_STOPS); + if (!dep.isEmpty() && !arr.isEmpty()) + { + if (stops.isEmpty()) { + strings.append(QString("%1-%2").arg(dep).arg(arr)); + } else { + strings.append(QString("%1-%2-%3").arg(dep).arg(stops).arg(arr)); + } + } + + if (m_altitudeValid) + { + QStringList row1; + QChar c = m_altitude >= settings->m_transitionAlt ? 'F' : 'A'; + // Convert altitude to flight level + int fl = m_altitude / 100; + row1.append(QString("%1%2").arg(c).arg(fl)); + // Indicate whether climbing or descending + if (m_verticalRateValid && ((m_verticalRate != 0) || (m_selAltitudeValid && (m_altitude != m_selAltitude)))) + { + QChar dir = m_verticalRate == 0 ? QChar('-') : (m_verticalRate > 0 ? QChar(0x2191) : QChar(0x2193)); + row1.append(dir); + } + if (m_selAltitudeValid && (m_altitude != m_selAltitude)) + { + int selfl = m_selAltitude / 100; + row1.append(QString::number(selfl)); + } + strings.append(row1.join(" ")); + dateTime = m_altitudeDateTime; + } + + QStringList row2; + // Display speed + if (m_groundspeedValid) + { + row2.append(QString("G%2").arg(m_groundspeed)); + } + else if (m_indicatedAirspeedValid) + { + row2.append(QString("I%1").arg(m_indicatedAirspeed)); + if (!dateTime.isValid() || (m_indicatedAirspeedDateTime > dateTime)) { + dateTime = m_indicatedAirspeedDateTime; + } + } + // Aircraft type + if (m_aircraftInfo && !m_aircraftInfo->m_type.isEmpty()) + { + row2.append(m_aircraftInfo->m_type); + } + else if (m_aircraftInfo && !m_aircraftInfo->m_model.isEmpty()) + { + QString name = m_aircraftInfo->m_model; + int idx; + idx = name.indexOf(' '); + if (idx >= 0) { + name = name.left(idx); + } + idx = name.indexOf('-'); + if (idx >= 0) { + name = name.left(idx); + } + row2.append(name); + } + strings.append(row2.join(" ")); + // FIXME: Add ATC altitude and waypoint from ATC feature + } + return strings.join("
"); +} + +void ADSBAircraft::setOnSurface(const QDateTime& dateTime) +{ + // There are a few airports that are below 0 MSL + // https://en.wikipedia.org/wiki/List_of_lowest_airports + // So we could set altitude to a negative value here, which should + // then get clipped to actual terrain elevation in 3D map + // But then PFD altimeter reads negative elsewhere + // Really, the altimeter would typically read airport elevation when on the surface + m_altitude = 0; + m_altitudeValid = true; + m_altitudeGNSS = false; + setCell(ADSB_COL_ALTITUDE, "Surface"); + m_altitudeDateTime = dateTime; +} + +void ADSBAircraft::setAltitude(int altitudeFt, bool gnss, const QDateTime& dateTime, const ADSBDemodSettings& settings) +{ + m_altitude = altitudeFt; + m_altitudeValid = true; + + if (!gnss) + { + m_pressureAltitude = altitudeFt; + m_pressureAltitudeValid = true; + } + else + { + m_pressureAltitudeValid = false; + } + + m_altitudeGNSS = gnss; + setCell(ADSB_COL_ALTITUDE, settings.m_siUnits ? Units::feetToIntegerMetres(m_altitude) : m_altitude); + m_altitudeDateTime = dateTime; +} + +void ADSBAircraft::setVerticalRate(int verticalRate, const ADSBDemodSettings& settings) +{ + m_verticalRate = verticalRate; + m_verticalRateValid = true; + if (settings.m_siUnits) { + setCell(ADSB_COL_VERTICALRATE, Units::feetPerMinToIntegerMetresPerSecond(verticalRate)); + } else { + setCell(ADSB_COL_VERTICALRATE, m_verticalRate); + } +} + +void ADSBAircraft::setGroundspeed(float groundspeed, const ADSBDemodSettings& settings) +{ + m_groundspeed = groundspeed; + m_groundspeedValid = true; + setCell(ADSB_COL_GROUND_SPEED, settings.m_siUnits ? Units::knotsToIntegerKPH(m_groundspeed) : (int)std::round(m_groundspeed)); + // FIXME: dateTime? +} + +void ADSBAircraft::setTrueAirspeed(int airspeed, const ADSBDemodSettings& settings) +{ + m_trueAirspeed = airspeed; + m_trueAirspeedValid = true; + setCell(ADSB_COL_TRUE_AIRSPEED, settings.m_siUnits ? Units::knotsToIntegerKPH(m_trueAirspeed) : m_trueAirspeed); +} + +void ADSBAircraft::setIndicatedAirspeed(int airspeed, const QDateTime& dateTime, const ADSBDemodSettings& settings) +{ + m_indicatedAirspeed = airspeed; + m_indicatedAirspeedValid = true; + setCell(ADSB_COL_INDICATED_AIRSPEED, settings.m_siUnits ? Units::knotsToIntegerKPH(m_indicatedAirspeed) : m_indicatedAirspeed); + m_indicatedAirspeedDateTime = dateTime; +} + +void ADSBAircraft::setTrack(float track, const QDateTime& dateTime) +{ + m_track = track; + m_trackValid = true; + m_trackDateTime = dateTime; + setCell(ADSB_COL_TRACK, std::round(m_track)); + m_orientationDateTime = dateTime; +} + +void ADSBAircraft::setHeading(float heading, const QDateTime& dateTime) +{ + m_heading = heading; + m_headingValid = true; + m_headingDateTime = dateTime; + setCell(ADSB_COL_HEADING, std::round(m_heading)); + m_orientationDateTime = dateTime; + m_trackWhenHeadingSet = m_track; +} + diff --git a/plugins/channelrx/demodadsb/adsbaircraft.h b/plugins/channelrx/demodadsb/adsbaircraft.h new file mode 100644 index 000000000..391cef619 --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbaircraft.h @@ -0,0 +1,389 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ADSBAIRCRAFT_H +#define INCLUDE_ADSBAIRCRAFT_H + +#include +#include +#include +#include +#include + +#include "util/movingaverage.h" +#include "util/osndb.h" + +#include "adsbdemodsettings.h" + +// A position decoded since the last tracker-to-GUI flush. Keeping these samples +// separate from the coalesced aircraft state lets fast CSV replay rebuild tracks. +struct ADSBAircraftPosition { + Real m_latitude; + Real m_longitude; + int m_altitude; + QDateTime m_dateTime; + + ADSBAircraftPosition(Real latitude, Real longitude, int altitude, const QDateTime& dateTime) : + m_latitude(latitude), + m_longitude(longitude), + m_altitude(altitude), + m_dateTime(dateTime) + {} +}; + +// Data about an aircraft extracted from ADS-B and Mode-S frames. +// +// This is what the decoder produces and owns. It deliberately knows nothing about the +// table or the map, so that it can be decoded on the channel's worker thread and in a +// headless server build. The GUI derives Aircraft from it for the display-only state. +struct ADSBAircraft { + int m_icao; // 24-bit ICAO aircraft address + QString m_icaoHex; + QString m_callsign; // Flight callsign + QString m_flight; // Guess at flight number + bool m_globalPosition; // The current local-CPR reference chain was established by a global decode + Real m_latitude; // Latitude in decimal degrees + Real m_longitude; // Longitude in decimal degrees + float m_radius; // Horizontal containment radius limit (Rc) in metres + int m_altitude; // Altitude in feet (will be 0 if on surface) + int m_pressureAltitude; // Pressure altitude in feet for Map PFD altimeter (can be negative on surface) + bool m_onSurface; // Indicates if on surface or airborne + bool m_altitudeGNSS; // Altitude is GNSS HAE (Height above WGS-84 ellipsoid) rather than barometric alitute (relative to 29.92 Hg) + float m_heading; // Heading in degrees magnetic + float m_track; // Track in degrees true? + int m_verticalRate; // Vertical climb rate in ft/min + QString m_emitterCategory; // Aircraft type + QString m_status; // Aircraft status + int m_squawk; // Mode-A code + bool m_spi; // Special position identification (IDENT) active + Real m_range; // Distance from station to aircraft + Real m_azimuth; // Azimuth from station to aircraft + Real m_elevation; // Elevation from station to aircraft + QDateTime m_rxTime; // When last frame received (can be long ago if reading from log file) + QDateTime m_updateTime; // Last time we updated data for this aircraft (used for determining when to remove an aircraft) + + int m_selAltitude; // Selected altitude in MCP/FCU or FMS in feet + int m_selHeading; // Selected heading in MCP/FCU in degrees + float m_baro; // Aircraft baro setting in mb (Mode-S) + float m_roll; // In degrees + int m_groundspeed; // In knots + float m_turnRate; // In degrees per second + int m_trueAirspeed; // In knots + int m_indicatedAirspeed; // In knots + float m_mach; // Mach number + bool m_autopilot; + bool m_vnavMode; + bool m_altHoldMode; + bool m_approachMode; + bool m_lnavMode; + bool m_tcasOperational; // Appears only to be true if TA/RA, false if TA ONLY + + bool m_bdsCapabilities[16][16]; // BDS capabilities are indicaited by BDS 1.7 + int m_adsbVersion; + bool m_nicSupplementA; + bool m_nicSupplementB; + bool m_nicSupplementC; + + bool m_positionValid; // Indicates if we have valid data for the above fields + bool m_positionOnSurface; // Air/surface state at the last accepted position + bool m_altitudeValid; + bool m_pressureAltitudeValid; + bool m_onSurfaceValid; + bool m_headingValid; + bool m_trackValid; + bool m_verticalRateValid; + bool m_selAltitudeValid; + bool m_selHeadingValid; + bool m_baroValid; + bool m_rollValid; + bool m_groundspeedValid; + bool m_turnRateValid; + bool m_trueAirspeedValid; + bool m_indicatedAirspeedValid; + bool m_machValid; + bool m_autopilotValid; + bool m_vnavModeValid; + bool m_altHoldModeValid; + bool m_approachModeValid; + bool m_lnavModeValid; + bool m_tcasOperationalValid; + + bool m_bdsCapabilitiesValid; + bool m_adsbVersionValid; + bool m_nicSupplementAValid; + bool m_nicSupplementBValid; + bool m_nicSupplementCValid; + + // State for calculating position using two CPR frames + bool m_cprValid[2]; + double m_cprLat[2]; + double m_cprLong[2]; + QDateTime m_cprTime[2]; + + int m_adsbFrameCount; // Number of ADS-B frames for this aircraft + int m_modesFrameCount; // Number of Mode-S frames for this aircraft + int m_nonTransponderFrameCount; + int m_tisBFrameCount; + int m_adsrFrameCount; + float m_minCorrelation; + float m_maxCorrelation; + float m_correlation; + MovingAverageUtil m_correlationAvg; + + + + AircraftInformation *m_aircraftInfo; // Info about the aircraft from the database + QString m_aircraft3DModel; // 3D model for map based on aircraft type + QString m_aircraftCat3DModel; // 3D model based on aircraft category + float m_modelAltitudeOffset; // Altitude adjustment so aircraft model doesn't go underground + float m_labelAltitudeOffset; // How height to position label above aircraft + QString m_flagName; // Country flag, for the GUI to resolve an icon from + // Resource paths of the icons shown in the table, resolved by the GUI + QString m_airlineIconPath; + QString m_sideviewIconPath; + QString m_flagIconPath; + QString m_flagIconURL; + QString m_airlineIconURL; + QString m_sideviewIconURL; + + // For animation on 3D map + float m_runwayAltitude; + bool m_runwayAltitudeValid; + // Elevation of the airport the aircraft is nearest to, so heights above the ground + // can be worked out for an arrival - m_runwayAltitude only ever covers a departure + // we watched. Looked up when low, then kept until the aircraft moves away from it + float m_fieldElevation; + bool m_fieldElevationValid; + QDateTime m_fieldElevationTime; // When it was last looked up + bool m_gearDown; + bool m_tyresFlat; // Tyre deflection animation is at its start, where a newly loaded model sits + float m_flaps; // 0 - no flaps, 1 - full flaps + bool m_rotorStarted; // Rotors started on 'Rotorcraft' + bool m_engineStarted; // Engines started (typically propellors) + QDateTime m_engineAnimationTime; // When the engine/rotor animation was last sent, so it + // can be re-asserted for a map opened after the start + QDateTime m_positionDateTime; + QDateTime m_orientationDateTime; // FIXME + QDateTime m_headingDateTime; + QDateTime m_trackDateTime; + QDateTime m_altitudeDateTime; + QDateTime m_indicatedAirspeedDateTime; + QDateTime m_prevTrackDateTime; + int m_prevTrack; + float m_trackWhenHeadingSet; + float m_pitchEst; // Estimated pitch based on vertical rate + float m_rollEst; // Estimated roll based on rate of change in heading + + bool m_notified; // Set when a notification has been made for this aircraft, so we don't repeat it + + // Set while decoding, cleared when the state is sent to the GUI + bool m_isNew; // First frame from this aircraft + bool m_positionChanged; // A point should be added to the flight path + bool m_trailCleared; // The flight path should be thrown away and started again + bool m_mapTrailResetPending; // The external Map still needs the same reset + QList m_positionUpdates; // Every position since the previous GUI flush + + // Values shown in the table. These are the store for a good deal of decoded data, + // not merely a display copy - getText, getLabel and the notification substitution + // all read values back out of them + QVariant m_cells[ADSBDEMOD_COLUMNS]; + quint64 m_dirtyCells[2]; // Cells changed since the table was last updated + + bool m_tcasAlert; // Draw the TCAS cell in red + + // Active TCAS Resolution Advisory, decoded from an RA broadcast (DF16 MV with + // VDS=0x30, DF17 TC=28 ST=2, or DF20/21 BDS 3,0 - decodeRABroadcast()). Broadcasts + // repeat while the RA is active, so the tracker's tick() expires the state when + // they stop, and the terminated flag shortly after it is seen + bool m_raActive = false; + bool m_raCorrective = false; // Corrective (fly the sense now) vs preventive + bool m_raDownward = false; // Downward sense (descend) vs upward (climb) + bool m_raPositive = false; // Positive (climb/descend) vs vertical speed limit + bool m_raTerminated = false; // RA terminated - clear of conflict + bool m_raMultipleThreats = false; + bool m_raOppositeSense = false; // Multiple threats require opposite-sense RAs + unsigned m_raThreatIcao = 0; // Threat's Mode S address, 0 if not identified + QDateTime m_raDateTime; // When the last RA broadcast was received + + ADSBAircraft() : + m_icao(0), + m_globalPosition(false), + m_latitude(0), + m_longitude(0), + m_radius(0.0f), + m_altitude(0), + m_pressureAltitude(0), + m_onSurface(false), + m_altitudeGNSS(false), + m_heading(0), + m_track(0), + m_verticalRate(0), + m_squawk(0), + m_spi(false), + m_range(0.0f), + m_azimuth(0), + m_elevation(0), + m_selAltitude(0), + m_selHeading(0), + m_baro(0), + m_roll(0.0f), + m_groundspeed(0), + m_turnRate(0.0f), + m_trueAirspeed(0), + m_indicatedAirspeed(0), + m_mach(0.0f), + m_autopilot(false), + m_vnavMode(false), + m_altHoldMode(false), + m_approachMode(false), + m_lnavMode(false), + m_tcasOperational(false), + m_adsbVersion(0), + m_nicSupplementA(false), + m_nicSupplementB(false), + m_nicSupplementC(false), + m_positionValid(false), + m_positionOnSurface(false), + m_altitudeValid(false), + m_pressureAltitudeValid(false), + m_onSurfaceValid(false), + m_headingValid(false), + m_trackValid(false), + m_verticalRateValid(false), + m_selAltitudeValid(false), + m_selHeadingValid(false), + m_baroValid(false), + m_rollValid(false), + m_groundspeedValid(false), + m_turnRateValid(false), + m_trueAirspeedValid(false), + m_indicatedAirspeedValid(false), + m_machValid(false), + m_autopilotValid(false), + m_vnavModeValid(false), + m_altHoldModeValid(false), + m_approachModeValid(false), + m_lnavModeValid(false), + m_tcasOperationalValid(false), + m_bdsCapabilitiesValid(false), + m_adsbVersionValid(false), + m_nicSupplementAValid(false), + m_nicSupplementBValid(false), + m_nicSupplementCValid(false), + m_adsbFrameCount(0), + m_modesFrameCount(0), + m_nonTransponderFrameCount(0), + m_tisBFrameCount(0), + m_adsrFrameCount(0), + m_minCorrelation(INFINITY), + m_maxCorrelation(-INFINITY), + m_correlation(0.0f), + m_tcasAlert(false), + m_aircraftInfo(nullptr), + m_modelAltitudeOffset(0.0f), + m_labelAltitudeOffset(5.0f), + m_runwayAltitude(0.0), + m_runwayAltitudeValid(false), + m_fieldElevation(0.0), + m_fieldElevationValid(false), + m_gearDown(false), + m_tyresFlat(true), + m_flaps(0.0), + m_rotorStarted(false), + m_engineStarted(false), + m_prevTrack(0), + m_trackWhenHeadingSet(0.0f), + m_pitchEst(0.0), + m_rollEst(0.0), + m_notified(false), + m_isNew(true), + m_positionChanged(false), + m_trailCleared(false), + m_mapTrailResetPending(false) + { + for (int i = 0; i < 2; i++) { + m_cprValid[i] = false; + m_cprLat[i] = 0.0; + m_cprLong[i] = 0.0; + } + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + m_bdsCapabilities[i][j] = false; + } + } + for (int i = 0; i < 2; i++) { + m_dirtyCells[i] = 0; + } + } + + // The table model reads these; setCell records which cells changed so only + // those are repainted + void setCell(int col, const QVariant& value) + { + if (m_cells[col] != value) + { + m_cells[col] = value; + m_dirtyCells[col >> 6] |= 1ULL << (col & 63); + } + } + const QVariant& cell(int col) const { return m_cells[col]; } + QString cellText(int col) const { return m_cells[col].toString(); } + bool cellsDirty() const { return m_dirtyCells[0] || m_dirtyCells[1]; } + bool cellDirty(int col) const { return (m_dirtyCells[col >> 6] >> (col & 63)) & 1; } + void clearDirtyCells() { m_dirtyCells[0] = 0; m_dirtyCells[1] = 0; } + void markAllCellsDirty() { m_dirtyCells[0] = ~0ULL; m_dirtyCells[1] = ~0ULL; } + + // The range cell holds a number so that the table sorts it numerically; this is + // how it is shown, and how it reads in notifications + static QString rangeText(const QVariant& range) + { + return range.isNull() ? QString() : QString::number(range.toDouble(), 'f', 1); + } + + QString getImage() const; + // Icon showing the airline's livery, derived from the matched 3D model. + // Empty when there is no model match or no icon for the livery + QString getLiveryImage() const; + // links makes the ICAO, registration and callsign clickable, selecting the + // aircraft in the Aircraft feature. Only passed where that can actually happen - + // this same text feeds the demodulator's own map, whose delegate has no link + // handler, and there may be no Aircraft feature to select anything in + QString getText(const ADSBDemodSettings *settings, bool all=false, bool links=false) const; + // Label to use for aircraft on map + QString getLabel(const ADSBDemodSettings *settings, QDateTime& dateTime) const; + + // Name to use when selected as a target (E.g. for use as target name in Rotator Controller) + QString targetName() const + { + if (!m_callsign.isEmpty()) + return QString("Callsign: %1").arg(m_callsign); + else + return QString("ICAO: %1").arg(m_icao, 0, 16); + } + + void setOnSurface(const QDateTime& dateTime); + void setAltitude(int altitudeFt, bool gnss, const QDateTime& dateTime, const ADSBDemodSettings& settings); + void setVerticalRate(int verticalRate, const ADSBDemodSettings& settings); + void setGroundspeed(float groundspeed, const ADSBDemodSettings& settings); + void setTrueAirspeed(int airspeed, const ADSBDemodSettings& settings); + void setIndicatedAirspeed(int airspeed, const QDateTime& dateTime, const ADSBDemodSettings& settings); + void setTrack(float track, const QDateTime& dateTime); + void setHeading(float heading, const QDateTime& dateTime); +}; + + +#endif // INCLUDE_ADSBAIRCRAFT_H diff --git a/plugins/channelrx/demodadsb/adsbaircrafttablemodel.cpp b/plugins/channelrx/demodadsb/adsbaircrafttablemodel.cpp new file mode 100644 index 000000000..538098447 --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbaircrafttablemodel.cpp @@ -0,0 +1,471 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "adsbaircrafttablemodel.h" +#include "adsbdemodgui.h" + +static const QString g_columnNames[ADSBDEMOD_COLUMNS] = { + QStringLiteral("ICAO ID"), + QStringLiteral("Callsign"), + QStringLiteral("ATC Callsign"), + QStringLiteral("Aircraft"), + QStringLiteral("Type"), + QStringLiteral("Sideview"), + QStringLiteral("Airline"), + QStringLiteral("Country"), + QStringLiteral("GS (kn)"), + QStringLiteral("TAS (kn)"), + QStringLiteral("IAS (kn)"), + QStringLiteral("Mach"), + QStringLiteral("Sel Alt (ft)"), + QStringLiteral("Alt (ft)"), + QStringLiteral("VR (ft/m)"), + QStringLiteral("Sel Hd (\u00B0)"), + QStringLiteral("Hd (\u00B0)"), + QStringLiteral("Trk (\u00B0)"), + QStringLiteral("TR (\u00B0/s)"), + QStringLiteral("Roll (\u00B0)"), + QStringLiteral("D (km)"), + QStringLiteral("Az/El (\u00B0)"), + QStringLiteral("Cat"), + QStringLiteral("Status"), + QStringLiteral("Squawk"), + QStringLiteral("Ident"), + QStringLiteral("Reg"), + QStringLiteral("Registered"), + QStringLiteral("Manufacturer"), + QStringLiteral("Owner"), + QStringLiteral("Operator"), + QStringLiteral("AP"), + QStringLiteral("V Mode"), + QStringLiteral("L Mode"), + QStringLiteral("TCAS"), + QStringLiteral("ACAS"), + QStringLiteral("RA"), + QStringLiteral("Max AS (kn)"), + QStringLiteral("Version"), + QStringLiteral("L (m)"), + QStringLiteral("W (m)"), + QStringLiteral("QNH (mb)"), + QStringLiteral("H Wnd (kn)"), + QStringLiteral("OAT (C)"), + QStringLiteral("Wnd (kn)"), + QStringLiteral("Wnd (\u00B0)"), + QStringLiteral("P (hPa)"), + QStringLiteral("T (C)"), + QStringLiteral("U (%)"), + QStringLiteral("Lat (\u00B0)"), + QStringLiteral("Lon (\u00B0)"), + QStringLiteral("IC"), + QStringLiteral("Updated"), + QStringLiteral("Frames"), + QStringLiteral("ADS-B FC"), + QStringLiteral("Mode S FC"), + QStringLiteral("Non-transponder"), + QStringLiteral("TIS-B FC"), + QStringLiteral("ADS-R FC"), + QStringLiteral("Rc"), + QStringLiteral("NACp"), + QStringLiteral("NACv"), + QStringLiteral("GVA"), + QStringLiteral("NIC"), + QStringLiteral("NICbaro"), + QStringLiteral("SIL"), + QStringLiteral("Correlation"), + QStringLiteral("RSSI"), + QStringLiteral("Flight Status"), + QStringLiteral("Dep"), + QStringLiteral("Arr"), + QStringLiteral("Stops"), + QStringLiteral("STD"), + QStringLiteral("ETD"), + QStringLiteral("ATD"), + QStringLiteral("STA"), + QStringLiteral("ETA"), + QStringLiteral("ATA") +}; + +static const QString g_columnTips[ADSBDEMOD_COLUMNS] = { + QStringLiteral(""), + QStringLiteral("Callsign. Links to www.flightradar24.com"), + QStringLiteral("Airline callsign used by ATC"), + QStringLiteral("Aircraft model"), + QStringLiteral("ICAO aircraft type designator"), + QStringLiteral(""), + QStringLiteral("Airline logo"), + QStringLiteral("Country of registration"), + QStringLiteral("Groundspeed in knots or kilometers per hour"), + QStringLiteral("True airpeed in knots or kilometers per hour"), + QStringLiteral("Indicated airspeed in knots or kilometers per hour"), + QStringLiteral("Mach number"), + QStringLiteral("Selected altitude in feet or metres (As set on MCP/FCU or by FMS)"), + QStringLiteral("Altitude in feet or metres"), + QStringLiteral("Vertical climb rate in feet per minute or metres per second"), + QStringLiteral("Selected heading in degrees (As set on MCP/FCU or by FMS)"), + QStringLiteral("Aircraft heading in degrees"), + QStringLiteral("Aircraft track in degrees"), + QStringLiteral("Turn rate in degrees per second"), + QStringLiteral("Roll angle in degrees"), + QStringLiteral("Range or distance of aircraft from home location"), + QStringLiteral("Azimuth and elevation to aircraft from My Position. Double click to set as target."), + QStringLiteral("Aircraft standard category"), + QStringLiteral("Aircraft emergency status"), + QStringLiteral("Mode-A transponder code"), + QStringLiteral("Ident switch active"), + QStringLiteral("Aircraft registration"), + QStringLiteral("Date aircraft was registered"), + QStringLiteral("Aircraft manufacturer"), + QStringLiteral("Owner of the aircraft"), + QStringLiteral("Aircraft operator ICAO code"), + QStringLiteral("Autopilot enabled"), + QStringLiteral("MCP/FCU vertical mode"), + QStringLiteral("MCP/FCU lateral mode"), + QStringLiteral("TCAS operational. RA in red if active"), + QStringLiteral("Airborne collision avoidance system capability"), + QStringLiteral("ACAS active resolition advisory"), + QStringLiteral("Maximum speed in knots"), + QStringLiteral("ADS-B version"), + QStringLiteral("Aircraft length in metres"), + QStringLiteral("Aircraft width in metres"), + QStringLiteral("Barometer setting in millibars"), + QStringLiteral("Headwind in knots or kilometers per hour"), + QStringLiteral("Outside air temperature in degrees Celsius estimated from Mach and TAS"), + QStringLiteral("Wind speed in knots"), + QStringLiteral("Wind direction in degrees"), + QStringLiteral("Static air pressure in hectopascals"), + QStringLiteral("Static air temperature in degrees Celsius"), + QStringLiteral("Humidity in percent"), + QStringLiteral(""), + QStringLiteral(""), + QStringLiteral("Interrogator code (II/SI)"), + QStringLiteral("Time when the last ADS-B message from this aircraft was received."), + QStringLiteral("Number of ADS-B and Mode S frames received from this aircraft"), + QStringLiteral("Number of ADS-B frames received from this aircraft"), + QStringLiteral("Number of Mode S frames received from this aircraft"), + QStringLiteral("Non transponder device frame count"), + QStringLiteral("Number of TIS-B frames received with this aircraft's ICAO"), + QStringLiteral("Number of ADS-R frames received with this aircraft's ICAO"), + QStringLiteral("Horizontal containment radius limit"), + QStringLiteral("Navigation accuracy category - 95% horizontal position"), + QStringLiteral("Navigation accuracy category - velocity"), + QStringLiteral("Geometric vertical accuracy"), + QStringLiteral("Navigation integrity category"), + QStringLiteral("Barometric altitude integrity code"), + QStringLiteral("Surveillance integrity level"), + QStringLiteral("Correlation values for received frames. min/avg/max"), + QStringLiteral("Received Signal Strength Indicator (dBFS)"), + QStringLiteral("Status of flight"), + QStringLiteral("Departure airport"), + QStringLiteral("Arrival airport"), + QStringLiteral(""), + QStringLiteral("Scheduled time of departure"), + QStringLiteral("Estimated time of departure"), + QStringLiteral("Actual time of departure"), + QStringLiteral("Scheduled time of arrival"), + QStringLiteral("Estimated time of arrival"), + QStringLiteral("Actual time of arrival") +}; + +bool ADSBAircraftSortProxy::lessThan(const QModelIndex& left, const QModelIndex& right) const +{ + // The values are compared here rather than by the base class, which would fetch + // them from the model a second time - and sorting runs on every update + const QVariant l = sourceModel()->data(left, ADSBAircraftTableModel::SortRole); + const QVariant r = sourceModel()->data(right, ADSBAircraftTableModel::SortRole); + const bool lString = l.userType() == QMetaType::QString; + const bool rString = r.userType() == QMetaType::QString; + const bool lEmpty = l.isNull() || (lString && l.toString().isEmpty()); + const bool rEmpty = r.isNull() || (rString && r.toString().isEmpty()); + + // Empty cells sort before values in every column, however the column is typed + if (lEmpty || rEmpty) { + return lEmpty && !rEmpty; + } + if (!lString && !rString) { + return l.toDouble() < r.toDouble(); + } + return QString::localeAwareCompare(l.toString(), r.toString()) < 0; +} + +static qreal g_devicePixelRatio = 1.0; +static QHash g_icons; + +void ADSBAircraftTableModel::setDevicePixelRatio(qreal dpr) +{ + if (dpr != g_devicePixelRatio) + { + g_devicePixelRatio = dpr; + g_icons.clear(); + } +} + +// Icons are loaded on demand and kept, as the same few appear on many rows +QVariant ADSBAircraftTableModel::icon(const QString& path, const QSize& size) +{ + if (path.isEmpty()) { + return QVariant(); + } + + auto i = g_icons.find(path); + + if (i == g_icons.end()) + { + QPixmap pixmap(path); + + if (!pixmap.isNull() && (g_devicePixelRatio > 1.0)) + { + // Draw at the full size the table asks for, rather than being limited to + // the image's own pixel size on a scaled display + pixmap = pixmap.scaled(size * g_devicePixelRatio, Qt::KeepAspectRatio, Qt::SmoothTransformation); + pixmap.setDevicePixelRatio(g_devicePixelRatio); + } + i = g_icons.insert(path, QIcon(pixmap)); + } + return QVariant(i.value()); +} + +// Row numbers are the position in the table, not in the underlying model, so they +// count up from one however the table is sorted +QVariant ADSBAircraftSortProxy::headerData(int section, Qt::Orientation orientation, int role) const +{ + if ((orientation == Qt::Vertical) && (role == Qt::DisplayRole)) { + return section + 1; + } + return QSortFilterProxyModel::headerData(section, orientation, role); +} + +const QString *ADSBAircraftTableModel::columnNames() +{ + return g_columnNames; +} + +ADSBAircraftTableModel::ADSBAircraftTableModel(QObject *parent) : + QAbstractTableModel(parent), + m_settings(nullptr) +{ +} + +void ADSBAircraftTableModel::addAircraft(Aircraft *aircraft) +{ + beginInsertRows(QModelIndex(), m_aircraft.size(), m_aircraft.size()); + m_aircraft.append(aircraft); + endInsertRows(); +} + +void ADSBAircraftTableModel::removeAircraft(Aircraft *aircraft) +{ + int row = m_aircraft.indexOf(aircraft); + + if (row >= 0) + { + beginRemoveRows(QModelIndex(), row, row); + m_aircraft.removeAt(row); + endRemoveRows(); + } +} + +void ADSBAircraftTableModel::clear() +{ + beginResetModel(); + m_aircraft.clear(); + endResetModel(); +} + +int ADSBAircraftTableModel::rowForAircraft(const Aircraft *aircraft) const +{ + return m_aircraft.indexOf(const_cast(aircraft)); +} + +void ADSBAircraftTableModel::flushDirty() +{ + for (int row = 0; row < m_aircraft.size(); row++) + { + Aircraft *aircraft = m_aircraft[row]; + + if (!aircraft->cellsDirty()) { + continue; + } + + // One dataChanged spanning the changed columns, rather than one per cell + int first = -1; + int last = -1; + for (int col = 0; col < ADSBDEMOD_COLUMNS; col++) + { + if (aircraft->cellDirty(col)) + { + if (first < 0) { + first = col; + } + last = col; + } + } + aircraft->clearDirtyCells(); + + if (first >= 0) { + emit dataChanged(index(row, first), index(row, last)); + } + } +} + +void ADSBAircraftTableModel::allDataChanged() +{ + if (!m_aircraft.isEmpty()) + { + for (Aircraft *aircraft : m_aircraft) { + aircraft->clearDirtyCells(); + } + emit dataChanged(index(0, 0), index(m_aircraft.size() - 1, ADSBDEMOD_COLUMNS - 1)); + } +} + +void ADSBAircraftTableModel::aircraftDataChanged(const Aircraft *aircraft) +{ + int row = rowForAircraft(aircraft); + + if (row >= 0) { + emit dataChanged(index(row, 0), index(row, ADSBDEMOD_COLUMNS - 1)); + } +} + +int ADSBAircraftTableModel::rowCount(const QModelIndex& parent) const +{ + (void) parent; + return m_aircraft.size(); +} + +int ADSBAircraftTableModel::columnCount(const QModelIndex& parent) const +{ + (void) parent; + return ADSBDEMOD_COLUMNS; +} + +QVariant ADSBAircraftTableModel::data(const QModelIndex& index, int role) const +{ + int row = index.row(); + int col = index.column(); + + if ((row < 0) || (row >= m_aircraft.size()) || (col < 0) || (col >= ADSBDEMOD_COLUMNS)) { + return QVariant(); + } + + const Aircraft *aircraft = m_aircraft[row]; + + switch (role) + { + case Qt::DisplayRole: + case Qt::EditRole: + // Range is held as a number, so that it sorts numerically + if (col == ADSB_COL_RANGE) { + return ADSBAircraft::rangeText(aircraft->cell(col)); + } + return aircraft->cell(col); + + case SortRole: + return aircraft->cell(col); + + case Qt::DecorationRole: + switch (col) + { + case ADSB_COL_AIRLINE: return icon(aircraft->m_airlineIconPath, QSize(85, 20)); + case ADSB_COL_SIDEVIEW: return icon(aircraft->m_sideviewIconPath, QSize(85, 20)); + case ADSB_COL_COUNTRY: return icon(aircraft->m_flagIconPath, QSize(40, 20)); + default: return QVariant(); + } + + case Qt::SizeHintRole: + switch (col) + { + case ADSB_COL_AIRLINE: + case ADSB_COL_SIDEVIEW: + return QVariant(QSize(85, 20)); + case ADSB_COL_COUNTRY: + return QVariant(QSize(40, 20)); + default: + return QVariant(); + } + + case Qt::ForegroundRole: + if ((col == ADSB_COL_TCAS) && aircraft->m_tcasAlert) { + return QBrush(Qt::red); + } + return QVariant(); + + default: + return QVariant(); + } +} + +QVariant ADSBAircraftTableModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Vertical) + { + // Row numbers, which are also the count of aircraft being tracked + if ((role == Qt::DisplayRole) && (section >= 0) && (section < m_aircraft.size())) { + return section + 1; + } + return QVariant(); + } + + if ((section < 0) || (section >= ADSBDEMOD_COLUMNS)) { + return QVariant(); + } + + if (role == Qt::DisplayRole) + { + // These headings carry the units, which the user can switch + if (m_settings && m_settings->m_siUnits) + { + switch (section) + { + case ADSB_COL_ALTITUDE: return QStringLiteral("Alt (m)"); + case ADSB_COL_VERTICALRATE: return QStringLiteral("VR (m/s)"); + case ADSB_COL_SEL_ALTITUDE: return QStringLiteral("Sel Alt (m)"); + case ADSB_COL_GROUND_SPEED: return QStringLiteral("GS (kph)"); + case ADSB_COL_TRUE_AIRSPEED: return QStringLiteral("TAS (kph)"); + case ADSB_COL_INDICATED_AIRSPEED: return QStringLiteral("IAS (kph)"); + case ADSB_COL_HEADWIND: return QStringLiteral("H Wnd (kph)"); + case ADSB_COL_WIND_SPEED: return QStringLiteral("Wnd (kph)"); + default: break; + } + } + else + { + switch (section) + { + case ADSB_COL_ALTITUDE: return QStringLiteral("Alt (ft)"); + case ADSB_COL_VERTICALRATE: return QStringLiteral("VR (ft/m)"); + case ADSB_COL_SEL_ALTITUDE: return QStringLiteral("Sel Alt (ft)"); + case ADSB_COL_GROUND_SPEED: return QStringLiteral("GS (kn)"); + case ADSB_COL_TRUE_AIRSPEED: return QStringLiteral("TAS (kn)"); + case ADSB_COL_INDICATED_AIRSPEED: return QStringLiteral("IAS (kn)"); + case ADSB_COL_HEADWIND: return QStringLiteral("H Wnd (kn)"); + case ADSB_COL_WIND_SPEED: return QStringLiteral("Wnd (kn)"); + default: break; + } + } + return g_columnNames[section]; + } + else if ((role == Qt::ToolTipRole) && !g_columnTips[section].isEmpty()) { + return g_columnTips[section]; + } + + return QVariant(); +} diff --git a/plugins/channelrx/demodadsb/adsbaircrafttablemodel.h b/plugins/channelrx/demodadsb/adsbaircrafttablemodel.h new file mode 100644 index 000000000..6afacfc27 --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbaircrafttablemodel.h @@ -0,0 +1,91 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ADSBAIRCRAFTTABLEMODEL_H +#define INCLUDE_ADSBAIRCRAFTTABLEMODEL_H + +#include +#include +#include + +#include "adsbdemodsettings.h" + +struct Aircraft; + +// Model for the table of aircraft. +// +// The aircraft own their cell values; this presents them as rows. Changes are +// coalesced: decoding marks cells dirty and flushDirty() emits dataChanged for them +// periodically, rather than the table being repainted and re-sorted on every frame, +// which is what a busy sky used to cost. +// Sorts on the raw cell values, with empty cells always ordered before values, so that +// every column treats them the same way +class ADSBAircraftSortProxy : public QSortFilterProxyModel { + Q_OBJECT + +public: + using QSortFilterProxyModel::QSortFilterProxyModel; + + // Row numbers count the rows as displayed, so they say how many aircraft there are + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + +protected: + bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; +}; + +class ADSBAircraftTableModel : public QAbstractTableModel { + Q_OBJECT + +public: + // Raw cell value, used for sorting, so formatted numbers still sort numerically + static const int SortRole = Qt::UserRole; + + explicit ADSBAircraftTableModel(QObject *parent = nullptr); + + void setSettings(const ADSBDemodSettings *settings) { m_settings = settings; } + + void addAircraft(Aircraft *aircraft); + void removeAircraft(Aircraft *aircraft); + void clear(); + + int rowForAircraft(const Aircraft *aircraft) const; + Aircraft *aircraftAt(int row) const { return ((row >= 0) && (row < m_aircraft.size())) ? m_aircraft[row] : nullptr; } + + // Repaint the cells that have changed since the last call + void flushDirty(); + // Everything needs redrawing, e.g. after a change of units + void allDataChanged(); + void aircraftDataChanged(const Aircraft *aircraft); + + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + static const QString *columnNames(); + // The icons are 85x20 pixel images. On a scaled display Qt will not draw them + // larger than that in device pixels, which leaves them undersized, so they are + // scaled for the display when they are loaded + static void setDevicePixelRatio(qreal dpr); + static QVariant icon(const QString& path, const QSize& size); + +private: + QList m_aircraft; + const ADSBDemodSettings *m_settings; +}; + +#endif // INCLUDE_ADSBAIRCRAFTTABLEMODEL_H diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index eb67c05d0..3255b41d9 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -42,6 +42,7 @@ #include "adsbdemod.h" #include "adsbdemodworker.h" +#include "adsbdemodtracker.h" MESSAGE_CLASS_DEFINITION(ADSBDemod::MsgConfigureADSBDemod, Message) MESSAGE_CLASS_DEFINITION(ADSBDemod::MsgAircraftReport, Message) @@ -68,8 +69,21 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) : m_basebandSink = new ADSBDemodBaseband(); m_basebandSink->moveToThread(m_thread); + m_workerThread = new QThread(); m_worker = new ADSBDemodWorker(); - m_basebandSink->setMessageQueueToWorker(m_worker->getInputMessageQueue()); + m_tracker = new ADSBDemodTracker(this); + m_tracker->setExportWorker(m_worker); + m_worker->moveToThread(m_workerThread); + m_tracker->moveToThread(m_workerThread); + QObject::connect(m_workerThread, &QThread::started, m_worker, &ADSBDemodWorker::startWork); + QObject::connect(m_workerThread, &QThread::started, m_tracker, &ADSBDemodTracker::startWork); + QObject::connect(m_workerThread, &QThread::finished, m_worker, &QObject::deleteLater); + QObject::connect(m_workerThread, &QThread::finished, m_tracker, &QObject::deleteLater); + QObject::connect(m_workerThread, &QThread::finished, m_workerThread, &QThread::deleteLater); + m_workerThread->start(); + + // Frames are decoded by the tracker, which passes them on for export and logging + m_basebandSink->setMessageQueueToWorker(m_tracker->getInputMessageQueue()); applySettings(m_settings, QStringList(), true); @@ -93,9 +107,6 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) : ADSBDemod::~ADSBDemod() { - if (m_worker->isRunning()) { - stop(); - } QObject::disconnect( m_networkManager, &QNetworkAccessManager::finished, @@ -106,8 +117,21 @@ ADSBDemod::~ADSBDemod() m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this, true); delete m_basebandSink; // This results in a call to ADSBDemod::stop(), so need to delete before worker and thread - delete m_worker; delete m_thread; + + // Nothing pushes to the tracker any more, so the thread can go. The tracker and + // the worker delete themselves when it finishes + m_workerThread->quit(); + m_workerThread->wait(); + m_tracker = nullptr; + m_worker = nullptr; +} + +void ADSBDemod::setMessageQueueToGUI(MessageQueue* queue) +{ + ChannelAPI::setMessageQueueToGUI(queue); + m_basebandSink->setMessageQueueToGUI(queue); + m_tracker->setMessageQueueToGUI(queue); } void ADSBDemod::setDeviceAPI(DeviceAPI *deviceAPI) @@ -137,8 +161,6 @@ void ADSBDemod::start() { qDebug() << "ADSBDemod::start"; - m_worker->reset(); - m_worker->startWork(); m_basebandSink->reset(); m_basebandSink->startWork(); m_thread->start(); @@ -148,13 +170,15 @@ void ADSBDemod::start() ADSBDemodWorker::MsgConfigureADSBDemodWorker *msg = ADSBDemodWorker::MsgConfigureADSBDemodWorker::create(m_settings, QStringList(), true); m_worker->getInputMessageQueue()->push(msg); + + ADSBDemodTracker::MsgConfigureADSBDemodTracker *trackerMsg = ADSBDemodTracker::MsgConfigureADSBDemodTracker::create(m_settings, QStringList(), true); + m_tracker->getInputMessageQueue()->push(trackerMsg); } void ADSBDemod::stop() { qDebug() << "ADSBDemod::stop"; m_basebandSink->stopWork(); - m_worker->stopWork(); m_thread->exit(); #ifndef __EMSCRIPTEN__ m_thread->wait(); @@ -185,6 +209,8 @@ bool ADSBDemod::handleMessage(const Message& cmd) if (m_guiMessageQueue) { m_guiMessageQueue->push(new DSPSignalNotification(notif)); } + // And to the tracker, which needs the frequency for the reports it sends + m_tracker->getInputMessageQueue()->push(new DSPSignalNotification(notif)); return true; } @@ -232,6 +258,9 @@ void ADSBDemod::applySettings(const ADSBDemodSettings& settings, const QStringLi ADSBDemodWorker::MsgConfigureADSBDemodWorker *workerMsg = ADSBDemodWorker::MsgConfigureADSBDemodWorker::create(settings, settingsKeys, force); m_worker->getInputMessageQueue()->push(workerMsg); + ADSBDemodTracker::MsgConfigureADSBDemodTracker *trackerMsg = ADSBDemodTracker::MsgConfigureADSBDemodTracker::create(settings, settingsKeys, force); + m_tracker->getInputMessageQueue()->push(trackerMsg); + if (settings.m_useReverseAPI) { bool fullUpdate = (settingsKeys.contains("useReverseAPI") && settings.m_useReverseAPI) || diff --git a/plugins/channelrx/demodadsb/adsbdemod.h b/plugins/channelrx/demodadsb/adsbdemod.h index dcffce39c..ad1ce81ca 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.h +++ b/plugins/channelrx/demodadsb/adsbdemod.h @@ -34,6 +34,7 @@ class QNetworkReply; class QThread; class DeviceAPI; class ADSBDemodWorker; +class ADSBDemodTracker; class ADSBDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -174,10 +175,9 @@ public: SWGSDRangel::SWGChannelSettings& response); void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_basebandSink->getMagSqLevels(avg, peak, nbSamples); } - void setMessageQueueToGUI(MessageQueue* queue) final { - ChannelAPI::setMessageQueueToGUI(queue); - m_basebandSink->setMessageQueueToGUI(queue); - } + void setMessageQueueToGUI(MessageQueue* queue) final; + + ADSBDemodTracker *getTracker() { return m_tracker; } void setTarget(const QString& name, float targetAzimuth, float targetElevation, float targetRange); void clearTarget() { m_targetAzElValid = false; } @@ -191,6 +191,8 @@ private: DeviceAPI* m_deviceAPI; QThread *m_thread; ADSBDemodWorker *m_worker; + ADSBDemodTracker *m_tracker; + QThread *m_workerThread; //!< Runs the tracker and the export worker ADSBDemodBaseband* m_basebandSink; ADSBDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink diff --git a/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.cpp b/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.cpp index 4d14bac91..e161c60c7 100644 --- a/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.cpp +++ b/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.cpp @@ -21,6 +21,8 @@ #endif #include +#include "util/flightpathpalette.h" + #include "adsbdemoddisplaydialog.h" ADSBDemodDisplayDialog::ADSBDemodDisplayDialog(ADSBDemodSettings *settings, QWidget* parent) : @@ -67,15 +69,15 @@ ADSBDemodDisplayDialog::ADSBDemodDisplayDialog(ADSBDemodSettings *settings, QWid } ui->mapType->setCurrentIndex((int)settings->m_mapType); ui->maptilerAPIKey->setText(m_settings->m_maptilerAPIKey); + ui->cartoDBAPIKey->setText(m_settings->m_cartoDBAPIKey); ui->navAids->setChecked(settings->m_displayNavAids); ui->atcCallsigns->setChecked(settings->m_atcCallsigns); ui->photos->setChecked(settings->m_displayPhotos); ui->verboseModelMatching->setChecked(settings->m_verboseModelMatching); ui->favourLivery->setChecked(settings->m_favourLivery); + ui->useLiveryIcons->setChecked(settings->m_useLiveryIcons); ui->transitionAltitude->setValue(settings->m_transitionAlt); - for (auto i = ADSBDemodSettings::m_palettes.cbegin(), end = ADSBDemodSettings::m_palettes.cend(); i != end; ++i) { - ui->flightPathPalette->addItem(i.key()); - } + ui->flightPathPalette->addItems(FlightPathPalette::getPaletteNames()); ui->flightPathPalette->setCurrentText(settings->m_flightPathPaletteName); } @@ -164,6 +166,11 @@ void ADSBDemodDisplayDialog::accept() m_settings->m_maptilerAPIKey = ui->maptilerAPIKey->text(); m_settingsKeys.append("maptilerAPIKey"); } + if (m_settings->m_cartoDBAPIKey != ui->cartoDBAPIKey->text()) + { + m_settings->m_cartoDBAPIKey = ui->cartoDBAPIKey->text(); + m_settingsKeys.append("cartoDBAPIKey"); + } if (m_settings->m_displayNavAids != ui->navAids->isChecked()) { m_settings->m_displayNavAids = ui->navAids->isChecked(); @@ -189,6 +196,11 @@ void ADSBDemodDisplayDialog::accept() m_settings->m_favourLivery = ui->favourLivery->isChecked(); m_settingsKeys.append("favourLivery"); } + if (m_settings->m_useLiveryIcons != ui->useLiveryIcons->isChecked()) + { + m_settings->m_useLiveryIcons = ui->useLiveryIcons->isChecked(); + m_settingsKeys.append("useLiveryIcons"); + } if (m_settings->m_transitionAlt != ui->transitionAltitude->value()) { m_settings->m_transitionAlt = ui->transitionAltitude->value(); diff --git a/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.ui b/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.ui index acb000afb..53ae0bb34 100644 --- a/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.ui +++ b/plugins/channelrx/demodadsb/adsbdemoddisplaydialog.ui @@ -277,14 +277,14 @@
- + Zoom level for aircraft scaling - + When map zoom (0 min zoom - 15 max zoom) is higher than this value, aircraft icon size will be scaled @@ -294,14 +294,14 @@ - + Display airports with size - + Sets the minimum airport size that will be displayed on the map @@ -323,14 +323,14 @@ - + Display heliports - + When checked, heliports are displayed on the map @@ -340,14 +340,14 @@ - + Airport display distance (km) - + Displays airports within the specified distance in kilometres from My Position @@ -357,14 +357,14 @@ - + Airspaces to display - + Airspace categories to display @@ -521,14 +521,14 @@ - + Airspace display distance (km) - + Displays airspace within the specified distance in kilometres from My Position @@ -538,14 +538,14 @@ - + Display NAVAIDs - + Display NAVAIDs such as VORs and NDBs @@ -555,7 +555,7 @@ - + Use ATC callsigns (SPEEDBIRD) rather than ICAO (BAW) for aircraft labels on map @@ -565,21 +565,21 @@ - + Use ATC callsigns on map - + Colour palette to use for aircraft flight paths - + Flight path palette @@ -603,6 +603,37 @@ + + + + CartoDB API key + + + + + + + API key for CartoDB (https://carto.com), used by the aviation maps. Leave blank to use the built in key + + + + + + + Livery aircraft icons + + + + + + + Display aircraft icons showing airline liveries, matched from the aircraft type and operator, instead of black icons + + + + + + diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index 1a7fff5aa..ec1c48cc0 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include #ifdef QT_LOCATION_FOUND #include #endif @@ -43,6 +45,7 @@ #include "dsp/devicesamplesource.h" #include "channel/channelwebapiutils.h" #include "feature/featurewebapiutils.h" +#include "util/aircraftreport.h" #include "plugin/pluginapi.h" #include "util/airlines.h" #include "util/crc.h" @@ -63,81 +66,16 @@ #include "adsbdemodreport.h" #include "adsbdemod.h" +#include "util/flightpathpalette.h" + #include "adsbdemodgui.h" #include "adsbdemodfeeddialog.h" #include "adsbdemoddisplaydialog.h" #include "adsbdemodnotificationdialog.h" #include "adsb.h" #include "adsbosmtemplateserver.h" - -const char ADSBDemodGUI::m_idMap[] = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ##### ############-##0123456789######"; - -const QString ADSBDemodGUI::m_categorySetA[] = { - QStringLiteral("None"), - QStringLiteral("Light"), - QStringLiteral("Small"), - QStringLiteral("Large"), - QStringLiteral("High vortex"), - QStringLiteral("Heavy"), - QStringLiteral("High performance"), - QStringLiteral("Rotorcraft") -}; - -const QString ADSBDemodGUI::m_categorySetB[] = { - QStringLiteral("None"), - QStringLiteral("Glider/sailplane"), - QStringLiteral("Lighter-than-air"), - QStringLiteral("Parachutist"), - QStringLiteral("Ultralight"), - QStringLiteral("Reserved"), - QStringLiteral("UAV"), - QStringLiteral("Space vehicle") -}; - -const QString ADSBDemodGUI::m_categorySetC[] = { - QStringLiteral("None"), - QStringLiteral("Emergency vehicle"), - QStringLiteral("Service vehicle"), - QStringLiteral("Ground obstruction"), - QStringLiteral("Cluster obstacle"), - QStringLiteral("Line obstacle"), - QStringLiteral("Reserved"), - QStringLiteral("Reserved") -}; - -const QString ADSBDemodGUI::m_emergencyStatus[] = { - QStringLiteral("No emergency"), - QStringLiteral("General emergency"), - QStringLiteral("Lifeguard/Medical"), - QStringLiteral("Minimum fuel"), - QStringLiteral("No communications"), - QStringLiteral("Unlawful interference"), - QStringLiteral("Downed aircraft"), - QStringLiteral("Reserved") -}; - -const QString ADSBDemodGUI::m_flightStatuses[] = { - QStringLiteral("Airborne"), - QStringLiteral("On-ground"), - QStringLiteral("Alert, airborne"), - QStringLiteral("Alert, on-ground"), - QStringLiteral("Alert, SPI"), - QStringLiteral("SPI"), - QStringLiteral("Reserved"), - QStringLiteral("Not assigned") -}; - -const QString ADSBDemodGUI::m_hazardSeverity[] = { - "NIL", "Light", "Moderate", "Severe" -}; - -const QString ADSBDemodGUI::m_fomSources[] = { - "Invalid", "INS", "GNSS", "DME/DME", "DME/VOR", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved" -}; - -const QString ADSBDemodGUI::m_nacvStrings[] = { - ">= 10 m/s", "< 10 m/s", "< 3 m/s", "< 1 m/s", "< 0.3 m/s", "Reserved", "Reserved", "Reserved" -}; +#include "gui/fastitemdelegate.h" +#include "gui/fastheaderview.h" static const unsigned char colors[3*64] = { 0x00, 0x00, 0x00, @@ -245,352 +183,14 @@ bool ADSBDemodGUI::deserialize(const QByteArray& data) } } -// Longitude zone (returns value in range [1,59] -static int cprNL(double lat) -{ - if (lat == 0.0) - { - return 59; - } - else if ((lat == 87.0) || (lat == -87.0)) - { - return 2; - } - else if ((lat > 87.0) || (lat < -87.0)) - { - return 1; - } - else - { - double nz = 15.0; - double n = 1 - std::cos(M_PI / (2.0 * nz)); - double d = std::cos(std::fabs(lat) * M_PI/180.0); - return std::floor((M_PI * 2.0) / std::acos(1.0 - (n/(d*d)))); - } -} - -static int cprN(double lat, int odd) -{ - int nl = cprNL(lat) - odd; - if (nl > 1) { - return nl; - } else { - return 1; - } -} - -// Can't use std::fmod, as that works differently for negative numbers (See C.2.6.2) -static Real modulus(double x, double y) -{ - return x - y * std::floor(x/y); -} - -QString Aircraft::getImage() const -{ - if (m_aircraftInfo && !m_aircraftInfo->m_type.isEmpty()) - { - // https://www.icao.int/publications/doc8643/pages/search.aspx - static const QStringList fourEngineTypes = {"A388", "B741", "B742", "B743", "B744", "B748", "B74R", "B74S", "BLCF", "A342", "A343", "A345", "A346", "C17", "K35R"}; - - if (fourEngineTypes.contains(m_aircraftInfo->m_type)) { - return QString("aircraft_heavy_4engine.png"); - } else if (m_aircraftInfo->m_type == "EUFI") { - return QString("eurofighter.png"); - } else if (m_aircraftInfo->m_type == "VF35") { - return QString("f35.png"); - } else if ((m_aircraftInfo->m_type == "SPIT") || (m_aircraftInfo->m_type == "HURI")) { - return QString("spitfire.png"); - } else if ((m_aircraftInfo->m_type == "A400") || (m_aircraftInfo->m_type == "C30J")) { - return QString("a400m.png"); - } else if (m_aircraftInfo->m_type == "H64") { - return QString("apache.png"); - } else if (m_aircraftInfo->m_type == "H47") { - return QString("chinook.png"); - } - } - - if (m_emitterCategory.length() > 0) - { - if (!m_emitterCategory.compare("Heavy")) { // 777/787/A350 and 747/A380 - 4 engine handled above by type - return QString("aircraft_heavy_2engine.png"); - } else if (!m_emitterCategory.compare("Large")) { // A320/737 - return QString("aircraft_large.png"); - } else if (!m_emitterCategory.compare("Small")) { // Private jets - return QString("aircraft_small.png"); - } else if (!m_emitterCategory.compare("Rotorcraft")) { - return QString("aircraft_helicopter.png"); - } else if (!m_emitterCategory.compare("High performance")) { - return QString("aircraft_fighter.png"); - } else if (!m_emitterCategory.compare("Light") - || !m_emitterCategory.compare("Ultralight")) { - return QString("aircraft_light.png"); - } else if (!m_emitterCategory.compare("Glider/sailplane")) { - return QString("aircraft_glider.png"); - } else if (!m_emitterCategory.compare("Space vehicle")) { - return QString("aircraft_space.png"); - } else if (!m_emitterCategory.compare("UAV")) { - return QString("aircraft_drone.png"); - } else if (!m_emitterCategory.compare("Emergency vehicle") - || !m_emitterCategory.compare("Service vehicle")) { - return QString("truck.png"); - } else { - return QString("aircraft_large.png"); - } - } - else - { - return QString("aircraft_large.png"); - } -} - -QString Aircraft::getText(const ADSBDemodSettings *settings, bool all) const -{ - QStringList list; - if (m_showAll || all) - { - if (!m_flagIconURL.isEmpty() && !m_sideviewIconURL.isEmpty()) - { - list.append(QString("
").arg(m_sideviewIconURL).arg(m_flagIconURL)); - } - else if (!m_flagIconURL.isEmpty() && !m_airlineIconURL.isEmpty()) - { - list.append(QString("
").arg(m_airlineIconURL).arg(m_flagIconURL)); - } - else - { - if (!m_flagIconURL.isEmpty()) { - list.append(QString("").arg(m_flagIconURL)); - } else if (!m_sideviewIconURL.isEmpty()) { - list.append(QString("").arg(m_sideviewIconURL)); - } else if (!m_airlineIconURL.isEmpty()) { - list.append(QString("").arg(m_airlineIconURL)); - } - } - list.append(QString("ICAO: %1").arg(m_icaoHex)); - if (!m_callsign.isEmpty()) { - list.append(QString("Callsign: %1").arg(m_callsign)); - } - QString atcCallsign = m_atcCallsignItem->text(); - if (!atcCallsign.isEmpty()) { - list.append(QString("ATC Callsign: %1").arg(atcCallsign)); - } - if (m_aircraftInfo != nullptr) - { - if (!m_aircraftInfo->m_model.isEmpty()) { - list.append(QString("Aircraft: %1").arg(m_aircraftInfo->m_model)); - } - } - if (!m_emitterCategory.isEmpty()) { - list.append(QString("Category: %1").arg(m_emitterCategory)); - } - if (m_altitudeValid) - { - if (m_onSurface) - { - list.append(QString("Altitude: Surface")); - } - else - { - QString reference = m_altitudeGNSS ? "GNSS" : "Baro"; - if (m_gui->useSIUints()) { - list.append(QString("Altitude: %1 (m %2)").arg(Units::feetToIntegerMetres(m_altitude)).arg(reference)); - } else { - list.append(QString("Altitude: %1 (ft %2)").arg(m_altitude).arg(reference)); - } - } - } - if (m_groundspeedValid) - { - if (m_gui->useSIUints()) { - list.append(QString("GS: %1 (kph)").arg(Units::knotsToIntegerKPH(m_groundspeed))); - } else { - list.append(QString("GS: %1 (kn)").arg(m_groundspeed)); - } - } - if (m_verticalRateValid) - { - QString desc; - Real rate; - QString units; - - if (m_gui->useSIUints()) - { - rate = Units::feetPerMinToIntegerMetresPerSecond(m_verticalRate); - units = QString("m/s"); - } - else - { - rate = m_verticalRate; - units = QString("ft/min"); - } - if (m_verticalRate == 0) { - desc = "Level flight"; - } else if (rate > 0) { - desc = QString("Climbing: %1 (%2)").arg(rate).arg(units); - } else { - desc = QString("Descending: %1 (%2)").arg(rate).arg(units); - } - list.append(QString(desc)); - } - if ((m_status.length() > 0) && m_status.compare("No emergency")) { - list.append(m_status); - } - - QString flightStatus = m_flightStatusItem->text(); - if (!flightStatus.isEmpty()) { - list.append(QString("Flight status: %1").arg(flightStatus)); - } - QString dep = m_depItem->text(); - if (!dep.isEmpty()) { - list.append(QString("Departed: %1").arg(dep)); - } - QString std = m_stdItem->text(); - if (!std.isEmpty()) { - list.append(QString("STD: %1").arg(std)); - } - QString atd = m_atdItem->text(); - if (!atd.isEmpty()) - { - list.append(QString("ATD: %1").arg(atd)); - } - else - { - QString etd = m_etdItem->text(); - if (!etd.isEmpty()) { - list.append(QString("ETD: %1").arg(etd)); - } - } - QString arr = m_arrItem->text(); - if (!arr.isEmpty()) { - list.append(QString("Arrival: %1").arg(arr)); - } - QString sta = m_staItem->text(); - if (!sta.isEmpty()) { - list.append(QString("STA: %1").arg(sta)); - } - QString ata = m_ataItem->text(); - if (!ata.isEmpty()) - { - list.append(QString("ATA: %1").arg(ata)); - } - else - { - QString eta = m_etaItem->text(); - if (!eta.isEmpty()) { - list.append(QString("ETA: %1").arg(eta)); - } - } - } - else - { - QDateTime labelDateTime; - list.append(getLabel(settings, labelDateTime)); - } - return list.join("
"); -} - -// See https://nats.aero/blog/2017/07/drone-disruption-gatwick/ for example of UK ATC display -QString Aircraft::getLabel(const ADSBDemodSettings *settings, QDateTime& dateTime) const -{ - QString id; - if (!m_callsign.isEmpty()) - { - QString atcCallsign = m_atcCallsignItem->text(); - if (settings->m_atcCallsigns && !atcCallsign.isEmpty()) { - id = QString("%1 %2").arg(atcCallsign).arg(m_callsign.mid(3)); - } else { - id = m_callsign; - } - } - else - { - id = m_icaoHex; - } - QStringList strings; - strings.append(id); - if (settings->m_atcLabels) - { - // Route - QString dep = m_depItem->text(); - QString arr = m_arrItem->text(); - QString stops = m_stopsItem->text(); - if (!dep.isEmpty() && !arr.isEmpty()) - { - if (stops.isEmpty()) { - strings.append(QString("%1-%2").arg(dep).arg(arr)); - } else { - strings.append(QString("%1-%2-%3").arg(dep).arg(stops).arg(arr)); - } - } - - if (m_altitudeValid) - { - QStringList row1; - QChar c = m_altitude >= settings->m_transitionAlt ? 'F' : 'A'; - // Convert altitude to flight level - int fl = m_altitude / 100; - row1.append(QString("%1%2").arg(c).arg(fl)); - // Indicate whether climbing or descending - if (m_verticalRateValid && ((m_verticalRate != 0) || (m_selAltitudeValid && (m_altitude != m_selAltitude)))) - { - QChar dir = m_verticalRate == 0 ? QChar('-') : (m_verticalRate > 0 ? QChar(0x2191) : QChar(0x2193)); - row1.append(dir); - } - if (m_selAltitudeValid && (m_altitude != m_selAltitude)) - { - int selfl = m_selAltitude / 100; - row1.append(QString::number(selfl)); - } - strings.append(row1.join(" ")); - dateTime = m_altitudeDateTime; - } - - QStringList row2; - // Display speed - if (m_groundspeedValid) - { - row2.append(QString("G%2").arg(m_groundspeed)); - } - else if (m_indicatedAirspeedValid) - { - row2.append(QString("I%1").arg(m_indicatedAirspeed)); - if (!dateTime.isValid() || (m_indicatedAirspeedDateTime > dateTime)) { - dateTime = m_indicatedAirspeedDateTime; - } - } - // Aircraft type - if (m_aircraftInfo && !m_aircraftInfo->m_type.isEmpty()) - { - row2.append(m_aircraftInfo->m_type); - } - else if (m_aircraftInfo && !m_aircraftInfo->m_model.isEmpty()) - { - QString name = m_aircraftInfo->m_model; - int idx; - idx = name.indexOf(' '); - if (idx >= 0) { - name = name.left(idx); - } - idx = name.indexOf('-'); - if (idx >= 0) { - name = name.left(idx); - } - row2.append(name); - } - strings.append(row2.join(" ")); - // FIXME: Add ATC altitude and waypoint from ATC feature - } - return strings.join("
"); -} - -void Aircraft::addCoordinate(const QDateTime& dateTime, AircraftModel *model) +void Aircraft::addCoordinate(const ADSBAircraftPosition& position, AircraftModel *model) { - int color = std::min(7, m_altitude / 5000); + int color = FlightPathPalette::getColorIndex(position.m_altitude); bool showFullPath = (model->m_settings->m_flightPaths && m_isHighlighted) || model->m_settings->m_allFlightPaths; bool showATCPath = model->m_settings->m_atcLabels && !showFullPath; - QGeoCoordinate coord(m_latitude, m_longitude, m_altitude); + QGeoCoordinate coord(position.m_latitude, position.m_longitude, position.m_altitude); if (m_coordinates.isEmpty()) { QVariantList list; @@ -615,7 +215,7 @@ void Aircraft::addCoordinate(const QDateTime& dateTime, AircraftModel *model) { QVariantList& prevList = m_coordinates.back(); prevList.push_back(QVariant::fromValue(coord)); - m_coordinateDateTimes.push_back(dateTime); + m_coordinateDateTimes.push_back(position.m_dateTime); if (showFullPath) { model->aircraftCoordsUpdated(this); } @@ -667,7 +267,7 @@ void Aircraft::addCoordinate(const QDateTime& dateTime, AircraftModel *model) } } } - m_coordinateDateTimes.push_back(dateTime); + m_coordinateDateTimes.push_back(position.m_dateTime); m_lastColor = color; // Prune recent list so only last 25 seconds of coordinates @@ -867,11 +467,18 @@ QVariant AircraftModel::data(const QModelIndex &index, int role) const else if (role == AircraftModel::adsbDataRole) { // Create the text to go in the bubble next to the aircraft - return QVariant::fromValue(m_aircrafts[row]->getText(m_settings)); + return QVariant::fromValue(m_aircrafts[row]->getText(m_settings, m_aircrafts[row]->m_showAll)); } else if (role == AircraftModel::aircraftImageRole) { // Select an image to use for the aircraft + if (m_settings && m_settings->m_useLiveryIcons) + { + QString image = m_aircrafts[row]->getLiveryImage(); + if (!image.isEmpty()) { + return QVariant::fromValue(image); + } + } return QVariant::fromValue(m_aircrafts[row]->getImage()); } else if (role == AircraftModel::bubbleColourRole) @@ -937,12 +544,34 @@ bool AircraftModel::setData(const QModelIndex &index, const QVariant& value, int return true; } +// The name the Map feature has this aircraft under, which is not always the name this +// demodulator chose. With an Aircraft feature present, ADSBDemodTracker::sendToMap sends +// the map item to that feature instead of to the Map, and it draws the aircraft under +// its registration so that an airframe heard on several protocols is one item. Asking +// for the ICAO address then finds nothing, which is what this fixes. +// +// Which case we are in is decided the same way sendToMap decides it - by whether anything +// is listening on the aircraftreport pipe - and the name itself comes from the rule both +// sides share, so the two cannot drift apart. +QString ADSBDemodGUI::mapItemName(const Aircraft *aircraft) const +{ + QList reportPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_adsbDemod, "aircraftreport", reportPipes); + if (reportPipes.isEmpty()) { + return aircraft->m_icaoHex; // Drawn by this demodulator, under its own name + } + const QString registration = aircraft->m_aircraftInfo + ? aircraft->m_aircraftInfo->m_registration : QString(); + return aircraftMapItemName(registration, aircraft->m_callsign, (quint32) aircraft->m_icao); +} + void AircraftModel::findOnMap(int index) { if ((index < 0) || (index >= m_aircrafts.count())) { return; } - FeatureWebAPIUtils::mapFind(m_aircrafts[index]->m_icaoHex); + const Aircraft *aircraft = m_aircrafts[index]; + FeatureWebAPIUtils::mapFind(aircraft->m_gui->mapItemName(aircraft)); } // Get list of frequeny scanners to use in menu @@ -1292,3942 +921,122 @@ bool ADSBDemodGUI::setFrequency(qint64 targetFrequencyHz) return false; } -void ADSBDemodGUI::clearFromMap(const QString& name) -{ - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_adsbDemod, "mapitems", mapPipes); - - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(name)); - swgMapItem->setImage(new QString("")); - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_adsbDemod, swgMapItem); - messageQueue->push(msg); - } -} -void ADSBDemodGUI::sendToMap(Aircraft *aircraft, QList *animations) -{ - // Send to Map feature - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_adsbDemod, "mapitems", mapPipes); - if (mapPipes.size() > 0) - { - // Barometric altitude reported by ADS-B is relative to pressure of 1013.25 - // Correct using QNH setting to get altitude relative to sea level - int altitudeFt = aircraft->m_altitude; - if (aircraft->m_onSurfaceValid && aircraft->m_onSurface) { - altitudeFt = 0; // Ignore Mode S altitude - } else if (!aircraft->m_altitudeGNSS) { - altitudeFt += (m_settings.m_qnh - 1013.25) * 30; // Adjust by 30ft per hPa - } - float altitudeM = Units::feetToMetres(altitudeFt); - // On take-off, m_onSurface may go false before aircraft actually takes off - // and due to inaccuracy in baro / QHN, it can appear to move down the runway in the air - // So keep altitude at 0 until it starts to go above first airbourne value - if (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude <= aircraft->m_runwayAltitude)) { - altitudeM = 0; - } - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(aircraft->m_icaoHex)); - swgMapItem->setLatitude(aircraft->m_latitude); - swgMapItem->setLongitude(aircraft->m_longitude); - swgMapItem->setAltitude(altitudeM); - swgMapItem->setPositionDateTime(new QString(aircraft->m_positionDateTime.toString(Qt::ISODateWithMs))); - swgMapItem->setAltitudeDateTime(new QString(aircraft->m_altitudeDateTime.toString(Qt::ISODateWithMs))); - swgMapItem->setFixedPosition(false); - swgMapItem->setAvailableUntil(new QString(aircraft->m_positionDateTime.addSecs(61).toString(Qt::ISODateWithMs))); // Changed from 60 to 61 due to https://github.com/CesiumGS/cesium/issues/12426 - swgMapItem->setImage(new QString(QString("qrc:///map/%1").arg(aircraft->getImage()))); - // Use track, in preference to heading, as we typically receive far fewer heading frames - if (aircraft->m_trackValid) { - swgMapItem->setImageRotation(aircraft->m_track); - } else { - swgMapItem->setImageRotation(aircraft->m_heading); - } - swgMapItem->setText(new QString(aircraft->getText(&m_settings, true))); - if (!aircraft->m_aircraft3DModel.isEmpty()) { - swgMapItem->setModel(new QString(aircraft->m_aircraft3DModel)); - } else { - swgMapItem->setModel(new QString(aircraft->m_aircraftCat3DModel)); - } - QDateTime labelDateTime; - swgMapItem->setLabel(new QString(aircraft->getLabel(&m_settings, labelDateTime))); - if (labelDateTime.isValid()) { - swgMapItem->setLabelDateTime(new QString(labelDateTime.toString(Qt::ISODateWithMs))); - } +void ADSBDemodGUI::Interogator::update(int ic, Aircraft *aircraft, AirspaceModel *airspaceModel, CheckList *checkList, bool display) +{ + if (aircraft->m_positionValid) + { + if (m_valid) + { + bool changed = false; - if (aircraft->m_trackValid) - { - swgMapItem->setOrientation(1); - swgMapItem->setHeading(aircraft->m_track); - swgMapItem->setPitch(aircraft->m_pitchEst); - if (aircraft->m_rollValid) { - swgMapItem->setRoll(aircraft->m_roll); - } else { - swgMapItem->setRoll(aircraft->m_rollEst); - } - swgMapItem->setOrientationDateTime(new QString(aircraft->m_positionDateTime.toString(Qt::ISODateWithMs))); - } - else + if (aircraft->m_latitude < m_minLatitude) { - // Orient aircraft based on velocity calculated from position - swgMapItem->setOrientation(0); - } - - swgMapItem->setModelAltitudeOffset(aircraft->m_modelAltitudeOffset); - swgMapItem->setLabelAltitudeOffset(aircraft->m_labelAltitudeOffset); - swgMapItem->setAltitudeReference(3); // CLIP_TO_GROUND so aircraft don't go under runway - swgMapItem->setAnimations(animations); // Does this need to be duplicated? - - SWGSDRangel::SWGMapAircraftState *aircraftState = new SWGSDRangel::SWGMapAircraftState(); - if (!aircraft->m_callsign.isEmpty()) { - aircraftState->setCallsign(new QString(aircraft->m_callsign)); - } - if (aircraft->m_aircraftInfo) { - aircraftState->setAircraftType(new QString(aircraft->m_aircraftInfo->m_type)); - } - if (aircraft->m_onSurfaceValid) { - aircraftState->setOnSurface(aircraft->m_onSurface); - } else { - aircraftState->setOnSurface(-1); + m_minLatitude = aircraft->m_latitude; + changed = true; } - if (aircraft->m_indicatedAirspeedValid) + if (aircraft->m_latitude > m_maxLatitude) { - aircraftState->setAirspeed(aircraft->m_indicatedAirspeed); - aircraftState->setAirspeedDateTime(new QString(aircraft->m_indicatedAirspeedDateTime.toString(Qt::ISODateWithMs))); + m_maxLatitude = aircraft->m_latitude; + changed = true; } - else + if (aircraft->m_longitude < m_minLongitude) { - aircraftState->setAirspeed(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_trueAirspeedValid) { - aircraftState->setTrueAirspeed(aircraft->m_trueAirspeed); - } else { - aircraftState->setTrueAirspeed(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_groundspeedValid) { - aircraftState->setGroundspeed(aircraft->m_groundspeed); - } else { - aircraftState->setGroundspeed(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_machValid) { - aircraftState->setMach(aircraft->m_mach); - } else { - aircraftState->setMach(std::numeric_limits::quiet_NaN()); + m_minLongitude = aircraft->m_longitude; + changed = true; } - if (aircraft->m_pressureAltitudeValid) + if (aircraft->m_longitude > m_maxLongitude) { - aircraftState->setAltitude(aircraft->m_pressureAltitude); - aircraftState->setAltitudeDateTime(new QString(aircraft->m_altitudeDateTime.toString(Qt::ISODateWithMs))); + m_maxLongitude = aircraft->m_longitude; + changed = true; } - else + if (changed) { - aircraftState->setAltitude(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_baroValid) { - aircraftState->setQnh(aircraft->m_baro); - } else { - aircraftState->setQnh(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_verticalRateValid) { - aircraftState->setVerticalSpeed(aircraft->m_verticalRate); - } else { - aircraftState->setVerticalSpeed(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_headingValid) { - aircraftState->setHeading(aircraft->m_heading); - } else { - aircraftState->setHeading(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_trackValid) { - aircraftState->setTrack(aircraft->m_track); - } else { - aircraftState->setTrack(std::numeric_limits::quiet_NaN()); - } - //aircraftState->setSelectedAirspeed(aircraft->m_selSpeed); // Selected speed not available in ADS-B / Mode-S - if (aircraft->m_selAltitudeValid) { - aircraftState->setSelectedAltitude(roundTo50Feet(aircraft->m_selAltitude)); - } else { - aircraftState->setSelectedAltitude(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_selHeadingValid) { - aircraftState->setSelectedHeading(aircraft->m_selHeading); - } else { - aircraftState->setSelectedHeading(std::numeric_limits::quiet_NaN()); - } - if (aircraft->m_autopilotValid) { - aircraftState->setAutopilot((int) aircraft->m_autopilot); - } else { - aircraftState->setAutopilot(-1); - } - if (aircraft->m_vnavModeValid && aircraft->m_vnavMode) { - aircraftState->setVerticalMode(1); - } else if (aircraft->m_altHoldModeValid && aircraft->m_altHoldMode) { - aircraftState->setVerticalMode(2); - } else if (aircraft->m_approachModeValid && aircraft->m_approachMode) { - aircraftState->setVerticalMode(3); - } else { - aircraftState->setVerticalMode(0); - } - if (aircraft->m_lnavModeValid && aircraft->m_lnavMode) { - aircraftState->setLateralMode(1); - } else if (aircraft->m_approachModeValid && aircraft->m_approachMode) { - aircraftState->setLateralMode(2); - } else { - aircraftState->setLateralMode(0); - } - - // When RA Only, m_tcasOperational appears to be false - QString acasCapability = aircraft->m_acasItem->text(); - if (acasCapability == "") { - aircraftState->setTcasMode(0); // Unknown - } else if (acasCapability == "No ACAS") { - aircraftState->setTcasMode(1); // Off - } else if (acasCapability == "No RA") { - aircraftState->setTcasMode(2); // TA Only - } else { - aircraftState->setTcasMode(3); // TA/RA + calcPoly(); + if (display) { + airspaceModel->airspaceUpdated(&m_airspace); + } } + } + else + { + const double minSize = 0.02; + QBrush brush(QColor(colors[ic*3], colors[ic*3+1], colors[ic*3+2], 0xa0)); - // Windspeed/direction are rarely available, so use calculated headwind as backup - QVariant windSpeed = aircraft->m_windSpeedItem->data(Qt::DisplayRole); - QVariant windDirection = aircraft->m_windDirItem->data(Qt::DisplayRole); - if (!windSpeed.isNull() && !windDirection.isNull()) + m_valid = true; + m_minLatitude = aircraft->m_latitude - minSize; + m_maxLatitude = aircraft->m_latitude + minSize; + m_minLongitude = aircraft->m_longitude - minSize; + m_maxLongitude = aircraft->m_longitude + minSize; + m_airspace.m_name = QString("IC %1").arg(ic); + m_airspace.m_bottom.m_alt = -1; + m_airspace.m_top.m_alt = -1; + calcPoly(); + if (display) { - aircraftState->setWindSpeed(windSpeed.toFloat()); - aircraftState->setWindDirection(windDirection.toFloat()); + airspaceModel->addAirspace(&m_airspace); + checkList->addCheckItem(QString::number(ic), ic, Qt::Checked)->setBackground(brush); } else { - QVariant headwind = aircraft->m_headwindItem->data(Qt::DisplayRole); - if (!headwind.isNull() && aircraft->m_headingValid) - { - aircraftState->setWindSpeed(headwind.toFloat()); - aircraftState->setWindDirection(aircraft->m_heading); - } - else - { - aircraftState->setWindSpeed(std::numeric_limits::quiet_NaN()); - aircraftState->setWindDirection(std::numeric_limits::quiet_NaN()); - } - } - - // Static air temperature rarely available, so use estimated as backup - QVariant staticAirTemp = aircraft->m_staticAirTempItem->data(Qt::DisplayRole); - if (!staticAirTemp.isNull()) - { - aircraftState->setStaticAirTemperature(staticAirTemp.toFloat()); - } - else - { - QVariant estAirTemp = aircraft->m_estAirTempItem->data(Qt::DisplayRole); - if (!estAirTemp.isNull()) { - aircraftState->setStaticAirTemperature(estAirTemp.toFloat()); - } else { - aircraftState->setStaticAirTemperature(std::numeric_limits::quiet_NaN()); - } - } - - swgMapItem->setAircraftState(aircraftState); - - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_adsbDemod, swgMapItem); - messageQueue->push(msg); - } - } - else - { - // mapPipes.size() == 0 - for (auto animation : *animations) { - delete animation; - } - delete animations; - } -} - -// Find aircraft with icao, or create if it doesn't exist -Aircraft *ADSBDemodGUI::getAircraft(int icao, bool &newAircraft) -{ - Aircraft *aircraft; - - if (m_aircraft.contains(icao)) - { - // Update existing aircraft info - aircraft = m_aircraft.value(icao); - } - else - { - // Add new aircraft - newAircraft = true; - aircraft = new Aircraft(this); - aircraft->m_icao = icao; - //aircraft->m_icaoHex = QString::number(aircraft->m_icao, 16); - aircraft->m_icaoHex = QString("%1").arg(aircraft->m_icao, 6, 16, QChar('0')); - m_aircraft.insert(icao, aircraft); - aircraft->m_icaoItem->setText(aircraft->m_icaoHex); - ui->adsbData->setSortingEnabled(false); - int row = ui->adsbData->rowCount(); - ui->adsbData->setRowCount(row + 1); - ui->adsbData->setItem(row, ADSB_COL_ICAO, aircraft->m_icaoItem); - ui->adsbData->setItem(row, ADSB_COL_ATC_CALLSIGN, aircraft->m_atcCallsignItem); - ui->adsbData->setItem(row, ADSB_COL_CALLSIGN, aircraft->m_callsignItem); - ui->adsbData->setItem(row, ADSB_COL_MODEL, aircraft->m_modelItem); - ui->adsbData->setItem(row, ADSB_COL_TYPE, aircraft->m_typeItem); - ui->adsbData->setItem(row, ADSB_COL_SIDEVIEW, aircraft->m_sideviewItem); - ui->adsbData->setItem(row, ADSB_COL_AIRLINE, aircraft->m_airlineItem); - ui->adsbData->setItem(row, ADSB_COL_ALTITUDE, aircraft->m_altitudeItem); - ui->adsbData->setItem(row, ADSB_COL_HEADING, aircraft->m_headingItem); - ui->adsbData->setItem(row, ADSB_COL_TRACK, aircraft->m_trackItem); - ui->adsbData->setItem(row, ADSB_COL_VERTICALRATE, aircraft->m_verticalRateItem); - ui->adsbData->setItem(row, ADSB_COL_RANGE, aircraft->m_rangeItem); - ui->adsbData->setItem(row, ADSB_COL_AZEL, aircraft->m_azElItem); - ui->adsbData->setItem(row, ADSB_COL_LATITUDE, aircraft->m_latitudeItem); - ui->adsbData->setItem(row, ADSB_COL_LONGITUDE, aircraft->m_longitudeItem); - ui->adsbData->setItem(row, ADSB_COL_CATEGORY, aircraft->m_emitterCategoryItem); - ui->adsbData->setItem(row, ADSB_COL_STATUS, aircraft->m_statusItem); - ui->adsbData->setItem(row, ADSB_COL_SQUAWK, aircraft->m_squawkItem); - ui->adsbData->setItem(row, ADSB_COL_IDENT, aircraft->m_identItem); - ui->adsbData->setItem(row, ADSB_COL_REGISTRATION, aircraft->m_registrationItem); - ui->adsbData->setItem(row, ADSB_COL_COUNTRY, aircraft->m_countryItem); - ui->adsbData->setItem(row, ADSB_COL_REGISTERED, aircraft->m_registeredItem); - ui->adsbData->setItem(row, ADSB_COL_MANUFACTURER, aircraft->m_manufacturerNameItem); - ui->adsbData->setItem(row, ADSB_COL_OWNER, aircraft->m_ownerItem); - ui->adsbData->setItem(row, ADSB_COL_OPERATOR_ICAO, aircraft->m_operatorICAOItem); - ui->adsbData->setItem(row, ADSB_COL_IC, aircraft->m_interogatorCodeItem); - ui->adsbData->setItem(row, ADSB_COL_TIME, aircraft->m_timeItem); - ui->adsbData->setItem(row, ADSB_COL_FRAMECOUNT, aircraft->m_totalFrameCountItem); - ui->adsbData->setItem(row, ADSB_COL_ADSB_FRAMECOUNT, aircraft->m_adsbFrameCountItem); - ui->adsbData->setItem(row, ADSB_COL_MODES_FRAMECOUNT, aircraft->m_modesFrameCountItem); - ui->adsbData->setItem(row, ADSB_COL_NON_TRANSPONDER, aircraft->m_nonTransponderItem); - ui->adsbData->setItem(row, ADSB_COL_TIS_B_FRAMECOUNT, aircraft->m_tisBFrameCountItem); - ui->adsbData->setItem(row, ADSB_COL_ADSR_FRAMECOUNT, aircraft->m_adsrFrameCountItem); - ui->adsbData->setItem(row, ADSB_COL_RADIUS, aircraft->m_radiusItem); - ui->adsbData->setItem(row, ADSB_COL_NACP, aircraft->m_nacpItem); - ui->adsbData->setItem(row, ADSB_COL_NACV, aircraft->m_nacvItem); - ui->adsbData->setItem(row, ADSB_COL_GVA, aircraft->m_gvaItem); - ui->adsbData->setItem(row, ADSB_COL_NIC, aircraft->m_nicItem); - ui->adsbData->setItem(row, ADSB_COL_NIC_BARO, aircraft->m_nicBaroItem); - ui->adsbData->setItem(row, ADSB_COL_SIL, aircraft->m_silItem); - ui->adsbData->setItem(row, ADSB_COL_CORRELATION, aircraft->m_correlationItem); - ui->adsbData->setItem(row, ADSB_COL_RSSI, aircraft->m_rssiItem); - ui->adsbData->setItem(row, ADSB_COL_FLIGHT_STATUS, aircraft->m_flightStatusItem); - ui->adsbData->setItem(row, ADSB_COL_DEP, aircraft->m_depItem); - ui->adsbData->setItem(row, ADSB_COL_ARR, aircraft->m_arrItem); - ui->adsbData->setItem(row, ADSB_COL_STOPS, aircraft->m_stopsItem); - ui->adsbData->setItem(row, ADSB_COL_STD, aircraft->m_stdItem); - ui->adsbData->setItem(row, ADSB_COL_ETD, aircraft->m_etdItem); - ui->adsbData->setItem(row, ADSB_COL_ATD, aircraft->m_atdItem); - ui->adsbData->setItem(row, ADSB_COL_STA, aircraft->m_staItem); - ui->adsbData->setItem(row, ADSB_COL_ETA, aircraft->m_etaItem); - ui->adsbData->setItem(row, ADSB_COL_ATA, aircraft->m_ataItem); - ui->adsbData->setItem(row, ADSB_COL_SEL_ALTITUDE, aircraft->m_selAltitudeItem); - ui->adsbData->setItem(row, ADSB_COL_SEL_HEADING, aircraft->m_selHeadingItem); - ui->adsbData->setItem(row, ADSB_COL_BARO, aircraft->m_baroItem); - ui->adsbData->setItem(row, ADSB_COL_AP, aircraft->m_apItem); - ui->adsbData->setItem(row, ADSB_COL_V_MODE, aircraft->m_vModeItem); - ui->adsbData->setItem(row, ADSB_COL_L_MODE, aircraft->m_lModeItem); - ui->adsbData->setItem(row, ADSB_COL_TCAS, aircraft->m_tcasItem); - ui->adsbData->setItem(row, ADSB_COL_ACAS, aircraft->m_acasItem); - ui->adsbData->setItem(row, ADSB_COL_RA, aircraft->m_raItem); - ui->adsbData->setItem(row, ADSB_COL_MAX_SPEED, aircraft->m_maxSpeedItem); - ui->adsbData->setItem(row, ADSB_COL_VERSION, aircraft->m_versionItem); - ui->adsbData->setItem(row, ADSB_COL_LENGTH, aircraft->m_lengthItem); - ui->adsbData->setItem(row, ADSB_COL_WIDTH, aircraft->m_widthItem); - ui->adsbData->setItem(row, ADSB_COL_ROLL, aircraft->m_rollItem); - ui->adsbData->setItem(row, ADSB_COL_GROUND_SPEED, aircraft->m_groundspeedItem); - ui->adsbData->setItem(row, ADSB_COL_TURNRATE, aircraft->m_turnRateItem); - ui->adsbData->setItem(row, ADSB_COL_TRUE_AIRSPEED, aircraft->m_trueAirspeedItem); - ui->adsbData->setItem(row, ADSB_COL_INDICATED_AIRSPEED, aircraft->m_indicatedAirspeedItem); - ui->adsbData->setItem(row, ADSB_COL_MACH, aircraft->m_machItem); - ui->adsbData->setItem(row, ADSB_COL_HEADWIND, aircraft->m_headwindItem); - ui->adsbData->setItem(row, ADSB_COL_EST_AIR_TEMP, aircraft->m_estAirTempItem); - ui->adsbData->setItem(row, ADSB_COL_WIND_SPEED, aircraft->m_windSpeedItem); - ui->adsbData->setItem(row, ADSB_COL_WIND_DIR, aircraft->m_windDirItem); - ui->adsbData->setItem(row, ADSB_COL_STATIC_PRESSURE, aircraft->m_staticPressureItem); - ui->adsbData->setItem(row, ADSB_COL_STATIC_AIR_TEMP, aircraft->m_staticAirTempItem); - ui->adsbData->setItem(row, ADSB_COL_HUMIDITY, aircraft->m_humidityItem); - // Look aircraft up in database - if (m_aircraftInfo != nullptr) - { - if (m_aircraftInfo->contains(icao)) - { - aircraft->m_aircraftInfo = m_aircraftInfo->value(icao); - aircraft->m_modelItem->setText(aircraft->m_aircraftInfo->m_model); - aircraft->m_typeItem->setText(aircraft->m_aircraftInfo->m_type); - aircraft->m_registrationItem->setText(aircraft->m_aircraftInfo->m_registration); - aircraft->m_manufacturerNameItem->setText(aircraft->m_aircraftInfo->m_manufacturerName); - aircraft->m_ownerItem->setText(aircraft->m_aircraftInfo->m_owner); - aircraft->m_operatorICAOItem->setText(aircraft->m_aircraftInfo->m_operatorICAO); - aircraft->m_registeredItem->setText(aircraft->m_aircraftInfo->m_registered); - // Try loading an airline logo based on operator ICAO - QIcon *icon = nullptr; - if (aircraft->m_aircraftInfo->m_operatorICAO.size() > 0) - { - aircraft->m_airlineIconURL = AircraftInformation::resourcePathToURL(AircraftInformation::getAirlineIconPath(aircraft->m_aircraftInfo->m_operatorICAO)); - icon = AircraftInformation::getAirlineIcon(aircraft->m_aircraftInfo->m_operatorICAO); - if (icon != nullptr) - { - aircraft->m_airlineItem->setSizeHint(QSize(85, 20)); - aircraft->m_airlineItem->setIcon(*icon); - } - } - if (icon == nullptr) - { - if (aircraft->m_aircraftInfo->m_operator.size() > 0) - aircraft->m_airlineItem->setText(aircraft->m_aircraftInfo->m_operator); - else - aircraft->m_airlineItem->setText(aircraft->m_aircraftInfo->m_owner); - } - // Try loading a sideview - icon = AircraftInformation::getSideviewIcon(aircraft->m_aircraftInfo->m_registration, aircraft->m_aircraftInfo->m_operatorICAO, aircraft->m_aircraftInfo->m_type); - if (icon) - { - aircraft->m_sideviewItem->setSizeHint(QSize(85, 20)); - aircraft->m_sideviewItem->setIcon(*icon); - aircraft->m_sideviewIconURL = AircraftInformation::resourcePathToURL(AircraftInformation::getSideviewIconPath(aircraft->m_aircraftInfo->m_registration, aircraft->m_aircraftInfo->m_operatorICAO, aircraft->m_aircraftInfo->m_type)); - } - // Try loading a flag based on registration - if (aircraft->m_aircraftInfo->m_registration.size() > 0) - { - QString flag = aircraft->m_aircraftInfo->getFlag(); - if (flag != "") - { - aircraft->m_flagIconURL = AircraftInformation::resourcePathToURL(AircraftInformation::getFlagIconPath(flag)); - icon = AircraftInformation::getFlagIcon(flag); - if (icon != nullptr) - { - aircraft->m_countryItem->setSizeHint(QSize(40, 20)); - aircraft->m_countryItem->setIcon(*icon); - } - } - } - get3DModel(aircraft); - } - } - - if (aircraft->m_aircraft3DModel.isEmpty()) - { - // Default to A320 until we get some more info - aircraft->m_aircraftCat3DModel = get3DModel("A320"); - if (m_modelAltitudeOffset.contains("A320")) - { - aircraft->m_modelAltitudeOffset = m_modelAltitudeOffset.value("A320"); - aircraft->m_labelAltitudeOffset = m_labelAltitudeOffset.value("A320"); - } - } - - if (!m_loadingData) - { - if (m_settings.m_autoResizeTableColumns) - ui->adsbData->resizeColumnsToContents(); - ui->adsbData->setSortingEnabled(true); - } - // Check to see if we need to emit a notification about this new aircraft - checkStaticNotification(aircraft); - } - - return aircraft; -} - -void ADSBDemodGUI::setCallsign(Aircraft *aircraft, const QString& callsign) -{ - aircraft->m_callsign = callsign; - aircraft->m_callsignItem->setText(aircraft->m_callsign); - if (m_routeInfo && m_routeInfo->contains(aircraft->m_callsign)) - { - AircraftRouteInformation *route = m_routeInfo->value(aircraft->m_callsign); - aircraft->m_depItem->setText(route->m_dep); - aircraft->m_arrItem->setText(route->m_arr); - aircraft->m_stopsItem->setText(route->m_stops); - } - atcCallsign(aircraft); - callsignToFlight(aircraft); -} - -void ADSBDemodGUI::atcCallsign(Aircraft *aircraft) -{ - QString icao = aircraft->m_callsign.left(3); - const Airline *airline = Airline::getByICAO(icao); - if (airline) - { - aircraft->m_atcCallsignItem->setText(airline->m_callsign); - // Create icons using data from Airline class, if it doesn't exist in database - if (!aircraft->m_aircraftInfo) - { - // Airline logo - QIcon *icon = nullptr; - aircraft->m_airlineIconURL = AircraftInformation::resourcePathToURL(AircraftInformation::getAirlineIconPath(airline->m_icao)); - icon = AircraftInformation::getAirlineIcon(airline->m_icao); - if (icon != nullptr) - { - aircraft->m_airlineItem->setSizeHint(QSize(85, 20)); - aircraft->m_airlineItem->setIcon(*icon); - } - else - { - aircraft->m_airlineItem->setText(airline->m_name); - } - // Flag - QString flag = airline->m_country.toLower().replace(" ", "_"); - aircraft->m_flagIconURL = AircraftInformation::resourcePathToURL(AircraftInformation::getFlagIconPath(flag)); - icon = AircraftInformation::getFlagIcon(flag); - if (icon != nullptr) - { - aircraft->m_countryItem->setSizeHint(QSize(40, 20)); - aircraft->m_countryItem->setIcon(*icon); - } - } - } -} - -// Try to map callsign to flight number -void ADSBDemodGUI::callsignToFlight(Aircraft *aircraft) -{ - if (!aircraft->m_callsign.isEmpty()) - { - QRegularExpression flightNoExp("^[A-Z]{2,3}[0-9]{1,4}$"); - // Airlines line BA add a single character suffix that can be stripped - // If the suffix is two characters, then it typically means a digit - // has been replaced which I don't know how to guess - // E.g Easyjet might use callsign EZY67JQ for flight EZY6267 - // BA use BAW90BG for BA890 - QRegularExpression suffixedFlightNoExp("^([A-Z]{2,3})([0-9]{1,4})[A-Z]?$"); - QRegularExpressionMatch suffixMatch; - - if (flightNoExp.match(aircraft->m_callsign).hasMatch()) - { - aircraft->m_flight = aircraft->m_callsign; - } - else if ((suffixMatch = suffixedFlightNoExp.match(aircraft->m_callsign)).hasMatch()) - { - aircraft->m_flight = QString("%1%2").arg(suffixMatch.captured(1)).arg(suffixMatch.captured(2)); - } - else - { - // Don't guess, to save wasting API calls - aircraft->m_flight = ""; - } - } - else - { - aircraft->m_flight = ""; - } -} - -// ADS-B and Mode-S selected altitudes have slightly different precision, so values can jump around a bit -// And we end up with altitudes such as 38008 rather than 38000 -// To remove this, we round to nearest 50 feet -int ADSBDemodGUI::roundTo50Feet(int alt) -{ - return ((alt + 25) / 50) * 50; -} - -// Estimate outside air temperature (static temperature) from Mach number and true airspeed, assuming dry air -bool ADSBDemodGUI::calcAirTemp(Aircraft *aircraft) -{ - if (aircraft->m_machValid && aircraft->m_trueAirspeedValid && (aircraft->m_mach > 0.0f)) - { - // Calculate speed of sound - float c = Units::knotsToMetresPerSecond(aircraft->m_trueAirspeed) / aircraft->m_mach; - - // Calculate temperature, given the speed of sound - float a = c / 331.3f; - float T = (a * a - 1.0f) * 273.15f; - - aircraft->m_estAirTempItem->setData(Qt::DisplayRole, (int)std::round(T)); - - return true; - } - else - { - return false; - } -} - -void ADSBDemodGUI::resetStats() -{ - m_correlationAvg.reset(); - m_correlationOnesAvg.reset(); - m_rangeFails = 0; - m_altFails = 0; - m_frameRateTime = QDateTime::currentDateTime(); - m_adsbFrameRateCount = 0; - m_modesFrameRateCount = 0; - m_totalBytes = 0; - m_maxRangeStat = 0.0f; - m_maxAltitudeStat = 0.0f; - m_maxRateState = 0.0f; - for (int i = 0; i < 32; i++) - { - m_dfStats[i] = 0; - m_tcStats[i] = 0; - } - for (int i = 0; i < ui->statsTable->rowCount(); i++) { - ui->statsTable->item(i, 0)->setData(Qt::DisplayRole, 0); - } - - ADSBDemod::MsgResetStats* message = ADSBDemod::MsgResetStats::create(); - m_adsbDemod->getInputMessageQueue()->push(message); -} - -void ADSBDemodGUI::updateDFStats(int df) -{ - switch (df) - { - case 0: - ui->statsTable->item(DF0, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 4: - ui->statsTable->item(DF4, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 5: - ui->statsTable->item(DF5, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 11: - ui->statsTable->item(DF11, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 16: - ui->statsTable->item(DF16, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 17: - ui->statsTable->item(DF17, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 18: - ui->statsTable->item(DF18, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 19: - ui->statsTable->item(DF19, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 20: - case 21: - ui->statsTable->item(DF20_21, 0)->setData(Qt::DisplayRole, m_dfStats[20] + m_dfStats[21]); - break; - case 22: - ui->statsTable->item(DF22, 0)->setData(Qt::DisplayRole, m_dfStats[df]); - break; - case 24: - case 25: - case 26: - case 27: - ui->statsTable->item(DF24, 0)->setData(Qt::DisplayRole, m_dfStats[24] + m_dfStats[25] + m_dfStats[26] + m_dfStats[27]); - break; - default: - break; - } -} - -bool ADSBDemodGUI::updateTCStats(int tc, int row, int low, int high) -{ - if ((tc >= low) && (tc <= high)) - { - qint64 sum = 0; - - for (int i = low; i <= high; i++) { - sum += m_tcStats[i]; - } - ui->statsTable->item(row, 0)->setData(Qt::DisplayRole, sum); - return true; - } - else - { - return false; - } -} - -void Aircraft::setOnSurface(const QDateTime& dateTime) -{ - // There are a few airports that are below 0 MSL - // https://en.wikipedia.org/wiki/List_of_lowest_airports - // So we could set altitude to a negative value here, which should - // then get clipped to actual terrain elevation in 3D map - // But then PFD altimeter reads negative elsewhere - // Really, the altimeter would typically read airport elevation when on the surface - m_altitude = 0; - m_altitudeValid = true; - m_altitudeGNSS = false; - m_altitudeItem->setData(Qt::DisplayRole, "Surface"); - m_altitudeDateTime = dateTime; -} - -void Aircraft::setAltitude(int altitudeFt, bool gnss, const QDateTime& dateTime, const ADSBDemodSettings& settings) -{ - m_altitude = altitudeFt; - m_altitudeValid = true; - - if (!gnss) - { - m_pressureAltitude = altitudeFt; - m_pressureAltitudeValid = true; - } - else - { - m_pressureAltitudeValid = false; - } - - m_altitudeGNSS = gnss; - m_altitudeItem->setData(Qt::DisplayRole, settings.m_siUnits ? Units::feetToIntegerMetres(m_altitude) : m_altitude); - m_altitudeDateTime = dateTime; -} - -void Aircraft::setVerticalRate(int verticalRate, const ADSBDemodSettings& settings) -{ - m_verticalRate = verticalRate; - m_verticalRateValid = true; - if (settings.m_siUnits) { - m_verticalRateItem->setData(Qt::DisplayRole, Units::feetPerMinToIntegerMetresPerSecond(verticalRate)); - } else { - m_verticalRateItem->setData(Qt::DisplayRole, m_verticalRate); - } -} - -void Aircraft::setGroundspeed(float groundspeed, const ADSBDemodSettings& settings) -{ - m_groundspeed = groundspeed; - m_groundspeedValid = true; - m_groundspeedItem->setData(Qt::DisplayRole, settings.m_siUnits ? Units::knotsToIntegerKPH(m_groundspeed) : (int)std::round(m_groundspeed)); - // FIXME: dateTime? -} - -void Aircraft::setTrueAirspeed(int airspeed, const ADSBDemodSettings& settings) -{ - m_trueAirspeed = airspeed; - m_trueAirspeedValid = true; - m_trueAirspeedItem->setData(Qt::DisplayRole, settings.m_siUnits ? Units::knotsToIntegerKPH(m_trueAirspeed) : m_trueAirspeed); -} - -void Aircraft::setIndicatedAirspeed(int airspeed, const QDateTime& dateTime, const ADSBDemodSettings& settings) -{ - m_indicatedAirspeed = airspeed; - m_indicatedAirspeedValid = true; - m_indicatedAirspeedItem->setData(Qt::DisplayRole, settings.m_siUnits ? Units::knotsToIntegerKPH(m_indicatedAirspeed) : m_indicatedAirspeed); - m_indicatedAirspeedDateTime = dateTime; -} - -void Aircraft::setTrack(float track, const QDateTime& dateTime) -{ - m_track = track; - m_trackValid = true; - m_trackDateTime = dateTime; - m_trackItem->setData(Qt::DisplayRole, std::round(m_track)); - m_orientationDateTime = dateTime; -} - -void Aircraft::setHeading(float heading, const QDateTime& dateTime) -{ - m_heading = heading; - m_headingValid = true; - m_headingDateTime = dateTime; - m_headingItem->setData(Qt::DisplayRole, std::round(m_heading)); - m_orientationDateTime = dateTime; - m_trackWhenHeadingSet = m_track; -} - -void ADSBDemodGUI::handleADSB( - const QByteArray data, - const QDateTime dateTime, - float correlation, - float correlationOnes, - unsigned crc, - bool updateModel) -{ - PROFILER_START(); - - bool newAircraft = false; - bool updatedCallsign = false; - bool resetAnimation = false; - - const int df = (data[0] >> 3) & ADS_B_DF_MASK; // Downlink format - const int ca = data[0] & 0x7; // Capability (or Control Field for TIS-B) - unsigned icao; - Aircraft *aircraft; - - if ((df == 11) || (df == 17) || (df == 18)) - { - icao = ((data[1] & 0xff) << 16) | ((data[2] & 0xff) << 8) | (data[3] & 0xff); // ICAO aircraft address - aircraft = getAircraft(icao, newAircraft); - } - else - { - // Extract ICAO from parity - int bytes = data.length(); - unsigned parity = ((data[bytes-3] & 0xff) << 16) | ((data[bytes-2] & 0xff) << 8) | (data[bytes-1] & 0xff); - icao = (parity ^ crc) & 0xffffff; - if (icao == 0) - { - // Appears to be the case often for DF=5 - qDebug() << "ADSBDemodGUI::handleADSB: iaco of 0 - df" << df; - return; - } - aircraft = getAircraft(icao, newAircraft); - } - - // ADS-B, non-transponder ADS-B, TIS-B, or rebroadcast of ADS-B (ADS-R) - if ((df == 17) || ((df == 18) && (ca != 3) && (ca != 4))) - { - const int tc = (data[4] >> 3) & 0x1f; // Type code - //unsigned surveillanceStatus = 0; - - m_tcStats[tc]++; - if (updateTCStats(tc, TC_0, 0, 0)) { - } else if (updateTCStats(tc, TC_1_4, 1, 4)) { - } else if (updateTCStats(tc, TC_5_8, 5, 8)) { - } else if (updateTCStats(tc, TC_9_18, 9, 18)) { - } else if (updateTCStats(tc, TC_19, 19, 19)) { - } else if (updateTCStats(tc, TC_20_22, 20, 22)) { - } else if (updateTCStats(tc, TC_UNUSED, 23, 23)) { - } else if (updateTCStats(tc, TC_24, 24, 24)) { - } else if (updateTCStats(tc, TC_UNUSED, 25, 27)) { - } else if (updateTCStats(tc, TC_28, 28, 28)) { - } else if (updateTCStats(tc, TC_29, 29, 29)) { - } else if (updateTCStats(tc, TC_UNUSED, 30, 30)) { - } else if (updateTCStats(tc, TC_31, 31, 31)) { - } - - if ((tc >= 1) && ((tc <= 4))) - { - // Aircraft identification - BDS 0,8 - QString emitterCategory, callsign; - - decodeID(data, emitterCategory, callsign); - - QString prevEmitterCategory = aircraft->m_emitterCategory; - aircraft->m_emitterCategory = emitterCategory; - aircraft->m_emitterCategoryItem->setText(aircraft->m_emitterCategory); - - updatedCallsign = aircraft->m_callsign != callsign; - if (updatedCallsign) { - setCallsign(aircraft, callsign); - } - - // Select 3D model based on category, if we don't already have one based on ICAO - if ( aircraft->m_aircraft3DModel.isEmpty() - && ( aircraft->m_aircraftCat3DModel.isEmpty() - || (prevEmitterCategory != aircraft->m_emitterCategory) - ) - ) - { - get3DModelBasedOnCategory(aircraft); - // As we're changing the model, we need to reset animations to - // ensure gear/flaps are in correct position on new model - resetAnimation = true; - } - } - else if (((tc >= 5) && (tc <= 18)) || ((tc >= 20) && (tc <= 22)) || (tc == 0)) - { - bool wasOnSurface = aircraft->m_onSurface; - aircraft->m_onSurface = (tc >= 5) && (tc <= 8); - aircraft->m_onSurfaceValid = true; - - if (wasOnSurface != aircraft->m_onSurface) - { - // Can't mix CPR values used on surface and those that are airborne - aircraft->m_cprValid[0] = false; - aircraft->m_cprValid[1] = false; - } - - if (aircraft->m_onSurface) - { - // Surface position - BDS 0,6 - aircraft->setOnSurface(dateTime); - - int movement = ((data[4] & 0x7) << 4) | ((data[5] >> 4) & 0xf); - if (movement == 0) - { - // No information available - aircraft->m_groundspeedValid = false; - aircraft->m_groundspeedItem->setData(Qt::DisplayRole, ""); - } - else if (movement == 1) - { - // Aircraft stopped - aircraft->setGroundspeed(0, m_settings); - } - else if ((movement >= 2) && (movement <= 123)) - { - float base, step; // In knts - int adjust; - if ((movement >= 2) && (movement <= 8)) - { - base = 0.125f; - step = 0.125f; - adjust = 2; - } - else if ((movement >= 9) && (movement <= 12)) - { - base = 1.0f; - step = 0.25f; - adjust = 9; - } - else if ((movement >= 13) && (movement <= 38)) - { - base = 2.0f; - step = 0.5f; - adjust = 13; - } - else if ((movement >= 39) && (movement <= 93)) - { - base = 15.0f; - step = 1.0f; - adjust = 39; - } - else if ((movement >= 94) && (movement <= 108)) - { - base = 70.0f; - step = 2.0f; - adjust = 94; - } - else - { - base = 100.0f; - step = 5.0f; - adjust = 109; - } - aircraft->setGroundspeed(base + (movement - adjust) * step, m_settings); - } - else if (movement == 124) - { - aircraft->setGroundspeed(175, m_settings); // Actually greater than this - } - - int groundTrackStatus = (data[5] >> 3) & 1; - int groundTrackValue = ((data[5] & 0x7) << 4) | ((data[6] >> 4) & 0xf); - if (groundTrackStatus) - { - float groundTrackValueFloat = groundTrackValue * 360.0/128.0; - clearOldHeading(aircraft, dateTime, groundTrackValueFloat); - aircraft->setTrack(groundTrackValueFloat, dateTime); - } - } - else if (((tc >= 9) && (tc <= 18)) || ((tc >= 20) && (tc <= 22)) || (tc == 0)) - { - // Airborne position (9-18 baro, 20-22 GNSS) - - //surveillanceStatus = (data[4] >> 1) & 0x3; - - // ADS-B: Version 0 is single antenna flag, version 2 is NIC supplement-B - // TSI-B: ICAO/Mode A flag - if (aircraft->m_adsbVersionValid && (aircraft->m_adsbVersion == 2) && (df == 17)) - { - aircraft->m_nicSupplementB = data[4] & 1; - aircraft->m_nicSupplementBValid = true; - } - - int altFt; - bool valid = decodeAltitude(data, altFt); - if (valid) - { - aircraft->setAltitude(altFt, (tc >= 20) && (tc <= 22), dateTime, m_settings); - - // Assume runway elevation is at first reported airboune altitude - if (wasOnSurface) - { - aircraft->m_runwayAltitude = aircraft->m_altitude; - aircraft->m_runwayAltitudeValid = true; - } - } - } - - if (tc != 0) - { - int f; - double latCpr, lonCpr; - //unsigned t = (data[2] >> 3) & 1; // Not valid for TIS-B - bool globalValid = false; - double globalLatitude, globalLongitude; - bool localValid = false; - double localLatitude, localLongitude; - - decodeCpr(data, f, latCpr, lonCpr); - - aircraft->m_cprValid[f] = true; - aircraft->m_cprLat[f] = latCpr; - aircraft->m_cprLong[f] = lonCpr; - aircraft->m_cprTime[f] = dateTime; - - // CPR decoding - // Refer to Technical Provisions for Mode S Services and Extended Squitter - Appendix C2.6 - // See also: https://mode-s.org/decode/adsb/airborne-position.html - // For global decoding, we need both odd and even frames - // We also need to check that both frames aren't greater than 10s (airborne) or 50s (surface) apart in time (C.2.6.7), otherwise position may be out by ~10deg - // I've reduced this to 8.5s, as problems have been seen where times are just 9s apart - const int maxTimeDiff = aircraft->m_onSurface ? 48500 : 8500; - if (aircraft->m_cprValid[0] && aircraft->m_cprValid[1] - && (std::abs(aircraft->m_cprTime[0].toMSecsSinceEpoch() - aircraft->m_cprTime[1].toMSecsSinceEpoch()) <= maxTimeDiff) - && !aircraft->m_onSurface) - { - // Global decode using odd and even frames (C.2.6) - globalValid = decodeGlobalPosition(f, aircraft->m_cprLat, aircraft->m_cprLong, aircraft->m_cprTime, globalLatitude, globalLongitude, true); - if (!globalValid) - { - aircraft->m_cprValid[0] = false; - aircraft->m_cprValid[1] = false; - } - else - { - if (!aircraft->m_globalPosition) - { - aircraft->m_globalPosition = true; - double latDiff = abs(globalLatitude - aircraft->m_latitude); - double lonDiff = abs(globalLongitude - aircraft->m_longitude); - double maxLatDiff = 50000/111000.0; - double maxLonDiff = cos(Units::degreesToRadians(globalLatitude)) * maxLatDiff; - if ((latDiff > maxLatDiff) || (lonDiff > maxLonDiff)) - { - qDebug() << "Aircraft global position a long way from local - deleting track" << aircraft->m_icaoHex << globalLatitude << aircraft->m_latitude << globalLongitude << aircraft->m_longitude; - aircraft->clearCoordinates(&m_aircraftModel); - } - } - } - } - - // Local decode using a single aircraft position + location of receiver or previous global position - localValid = decodeLocalPosition(f, aircraft->m_cprLat[f], aircraft->m_cprLong[f], aircraft->m_onSurface, aircraft, localLatitude, localLongitude, true); - - if (aircraft->m_globalPosition && !localValid) - { - qDebug() << "Aircraft local position not valid" << aircraft->m_icaoHex << localLatitude << aircraft->m_latitude << localLongitude << aircraft->m_longitude; - aircraft->m_globalPosition = false; - } - - bool positionsInconsistent = false; - if (globalValid && localValid) - { - double latDiff = abs(globalLatitude - localLatitude); - double lonDiff = abs(globalLongitude - localLongitude); - double maxLatDiff = 5.1/111000.0; - double maxLonDiff = cos(Units::degreesToRadians(globalLatitude)) * maxLatDiff; - positionsInconsistent = (latDiff > maxLatDiff) || (lonDiff > maxLonDiff); - if (positionsInconsistent) - { - qDebug() << "positionsInconsistent" << aircraft->m_icaoHex << globalLatitude << localLatitude << globalLongitude << localLongitude; - aircraft->m_cprValid[0] = false; - aircraft->m_cprValid[1] = false; - } - } - if (!positionsInconsistent) - { - if (globalValid) - { - updateAircraftPosition(aircraft, globalLatitude, globalLongitude, dateTime); - aircraft->addCoordinate(dateTime, &m_aircraftModel); - } - else if (localValid) - { - updateAircraftPosition(aircraft, localLatitude, localLongitude, dateTime); - aircraft->addCoordinate(dateTime, &m_aircraftModel); - } - } - } - } - else if (tc == 19) - { - // Airborne velocity - BDS 0,9 - int st = data[4] & 0x7; // Subtype - - if (df == 17) - { - int nacv = ((data[5] >> 3) & 0x7); // Navigation accuracy for velocity - - aircraft->m_nacvItem->setData(Qt::DisplayRole, m_nacvStrings[nacv]); - } - - if ((st == 1) || (st == 2)) - { - // Ground speed - float v, h; - - if (decodeGroundspeed(data, v, h)) - { - clearOldHeading(aircraft, dateTime, h); - aircraft->setTrack(h, dateTime); - aircraft->setGroundspeed(v, m_settings); - } - } - else if ((st == 3) || (st == 4)) - { - // Airspeed (only likely to get this if an aircraft is unable to determine it's position) - bool tas; - int as; - bool hdgValid; - float hdg; - - bool asValid = decodeAirspeed(data, tas, as, hdgValid, hdg); - - if (hdgValid) { - aircraft->setHeading(hdg, dateTime); - } - - if (asValid) - { - if (tas) { - aircraft->setTrueAirspeed(as, m_settings); - } else { - aircraft->setIndicatedAirspeed(as, dateTime, m_settings); - } - } - } - - if ((st >= 1) && (st <= 4)) - { - int verticalRate; - - if (decodeVerticalRate(data, verticalRate)) { - aircraft->setVerticalRate(verticalRate, m_settings); - } - } - } - else if (tc == 28) - { - // Aircraft status - BDS 6,1 - int st = data[4] & 0x7; // Subtype - if (st == 1) - { - int es = (data[5] >> 5) & 0x7; // Emergency state - int modeA = ((data[5] << 8) & 0x1f00) | (data[6] & 0xff); // Mode-A code (squawk) - aircraft->m_status = m_emergencyStatus[es]; - aircraft->m_statusItem->setText(aircraft->m_status); - aircraft->m_squawk = squawkDecode(modeA); - // This message doesn't signal SPI, so use the state last seen in DF5/21, to keep the text consistent - if (aircraft->m_spi) { - aircraft->m_squawkItem->setText(QString("%1 IDENT").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); - } else { - aircraft->m_squawkItem->setText(QString("%1").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); - } - } - else if (st == 2) - { - // TCAS/ACAS RA Broadcast - } - } - else if (tc == 29) - { - // Target state and status - //bool selAltitudeType = (data[5] >> 7) & 0x1; - int selAltitudeFix = ((data[5] & 0x7f) << 4) | ((data[6] >> 4) & 0xf); - if (selAltitudeFix != 0) - { - int selAltitude = (selAltitudeFix - 1) * 32; // Ft - aircraft->m_selAltitude = selAltitude; - aircraft->m_selAltitudeValid = true; - if (m_settings.m_siUnits) { - aircraft->m_selAltitudeItem->setData(Qt::DisplayRole, Units::feetToIntegerMetres(aircraft->m_selAltitude)); - } else { - aircraft->m_selAltitudeItem->setData(Qt::DisplayRole, roundTo50Feet(aircraft->m_selAltitude)); - } - } - int baroFix = ((data[6] & 0xf) << 5) | ((data[7] >> 3) & 0x1f); - if (baroFix != 0) - { - float baro = (baroFix - 1) * 0.8f + 800.0f; // mb - aircraft->m_baro = baro; - aircraft->m_baroValid = true; - aircraft->m_baroItem->setData(Qt::DisplayRole, std::round(aircraft->m_baro)); - updateQNH(aircraft, baro); - } - bool selHeadingValid = (data[7] >> 2) & 0x1; - if (selHeadingValid) - { - int selHeadingFix = ((data[7] & 0x3) << 7) | ((data[8] >> 1) & 0x7f); - selHeadingFix = (selHeadingFix << 23) >> 23; - float selHeading = selHeadingFix * 180.0f / 256.0f; - if (selHeading < 0.0f) { - selHeading += 360.0f; - } - aircraft->m_selHeading = selHeading; - aircraft->m_selHeadingValid = true; - aircraft->m_selHeadingItem->setData(Qt::DisplayRole, std::round(aircraft->m_selHeading)); - } - - bool modeValid = (data[9] >> 1) & 0x1; - if (modeValid) - { - bool autoPilot = data[9] & 0x1; - bool vnavMode = (data[10] >> 7) & 0x1; - bool altHoldMode = (data[10] >> 6) & 0x1; - bool approachMode = (data[10] >> 4) & 0x1; - bool tcasOperational = (data[10] >> 3) & 0x1; - bool lnavMode = (data[10] >> 2) & 0x1; - - aircraft->m_autopilot = autoPilot; - aircraft->m_autopilotValid = true; - aircraft->m_apItem->setText(autoPilot ? QChar(0x2713) : QChar(0x2717)); // Tick or cross - - aircraft->m_vnavMode = vnavMode; - aircraft->m_vnavModeValid = true; - aircraft->m_altHoldMode = altHoldMode; - aircraft->m_altHoldModeValid = true; - aircraft->m_approachMode = approachMode; - aircraft->m_approachModeValid = true; - aircraft->m_tcasOperational = tcasOperational; - aircraft->m_tcasOperationalValid = true; - aircraft->m_lnavMode = lnavMode; - aircraft->m_lnavModeValid = true; - - if (aircraft->m_tcasItem->text() != "RA") { - aircraft->m_tcasItem->setText(tcasOperational ? QChar(0x2713) : QChar(0x2717)); // Tick or cross - } - - // Should only have one of these active - QString vMode = ""; - if (vnavMode) { - vMode = vMode + "VNAV "; - } - if (altHoldMode) { - vMode = vMode + "HOLD "; - } - if (approachMode) { - vMode = vMode + "APP "; - } - vMode = vMode.trimmed(); - aircraft->m_vModeItem->setText(vMode); - - QString lMode = ""; - if (lnavMode) { - lMode = lMode + "LNAV "; - } - if (approachMode) { - lMode = lMode + "APP "; - } - lMode = lMode.trimmed(); - aircraft->m_lModeItem->setText(lMode); - } - - } - else if (tc == 24) - { - // Surface system status - // Get quite a few from heathrow data - } - else if (tc == 31) - { - // Aircraft operational status - int st = data[4] & 0x7; - - int adsbVersion = (data[9] >> 5) & 0x7; - - aircraft->m_adsbVersion = adsbVersion; - aircraft->m_adsbVersionValid = true; - aircraft->m_versionItem->setData(Qt::DisplayRole, aircraft->m_adsbVersion); - - if (adsbVersion == 2) - { - bool nicSupplementA = (data[9] >> 4) & 0x1; - int nacp = data[9] & 0xf; - int sil = (data[10] >> 4) & 0x3; - //bool hrd = (data[10] >> 2) & 0x1; // Whether headings are magnetic (false) or true North (true) - bool silSuppliment = (data[10] >> 1) & 0x1; // 0 per hour / 1 per sample - - aircraft->m_nicSupplementA = nicSupplementA; - aircraft->m_nicSupplementAValid = true; - - static const QStringList nacpStrings = { - ">= 10 NM", "< 10 NM", "< 4 NM", "< 2 NM", "< 1NM", "< 0.5NM", "< 0.3 NM", "< 0.1 NM", - "< 0.05 NM", "< 30 m", "< 10 m", "< 3 m", "Reserved", "Reserved", "Reserved", "Reserved" - }; - static const QStringList silStrings = { - "> 1e-3", "<= 1e-3", "<= 1e-5", "<= 1e-7" - }; - static const QStringList silSupplimentStrings = { - "ph", "ps" - }; - QString silString = QString("%1 %2").arg(silStrings[sil]).arg(silSupplimentStrings[silSuppliment]); - - aircraft->m_nacpItem->setData(Qt::DisplayRole, nacpStrings[nacp]); - aircraft->m_silItem->setData(Qt::DisplayRole, silString); - - if (st == 0) - { - // Airborne - unsigned capacityClassCode = ((data[5] & 0xff) << 8) | (data[6] & 0xff); - bool tcasOperational = (capacityClassCode >> 13) & 1; - //bool adsbIn = (capacityClassCode >> 12) & 1; - - aircraft->m_tcasOperational = tcasOperational; - aircraft->m_tcasOperationalValid = true; - - int gva = (data[10] >> 6) & 0x3; - bool nicBaro = (data[10] >> 3) & 0x1; - - static const QStringList gvaStrings = { - "> 150 m", "<= 150 m", "<= 45 m", "Reserved" - }; - - aircraft->m_gvaItem->setData(Qt::DisplayRole, gvaStrings[gva]); - aircraft->m_nicBaroItem->setText(nicBaro ? QChar(0x2713) : QChar(0x2717)); // Tick or cross - } - else if (st == 1) - { - // Surface - unsigned capacityClassCode = ((data[5] & 0xff) << 4) | ((data[6] >> 4) & 0xf); - unsigned lengthWidthCode = data[6] & 0xf; - int nacv = (capacityClassCode >> 1) & 0x7; - bool nicSupplementC = capacityClassCode & 1; - - aircraft->m_nicSupplementC = nicSupplementC; - aircraft->m_nicSupplementCValid = true; - - aircraft->m_nacvItem->setData(Qt::DisplayRole, m_nacvStrings[nacv]); - - switch (lengthWidthCode) - { - case 0: - aircraft->m_lengthItem->setData(Qt::DisplayRole, ""); - aircraft->m_widthItem->setData(Qt::DisplayRole, ""); - break; - case 1: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 15); - aircraft->m_widthItem->setData(Qt::DisplayRole, 23); - break; - case 2: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 25); - aircraft->m_widthItem->setData(Qt::DisplayRole, 28.5); - break; - case 3: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 25); - aircraft->m_widthItem->setData(Qt::DisplayRole, 34); - break; - case 4: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 35); - aircraft->m_widthItem->setData(Qt::DisplayRole, 33); - break; - case 5: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 35); - aircraft->m_widthItem->setData(Qt::DisplayRole, 38); - break; - case 6: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 45); - aircraft->m_widthItem->setData(Qt::DisplayRole, 39.5); - break; - case 7: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 45); - aircraft->m_widthItem->setData(Qt::DisplayRole, 45); - break; - case 8: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 55); - aircraft->m_widthItem->setData(Qt::DisplayRole, 45); - break; - case 9: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 55); - aircraft->m_widthItem->setData(Qt::DisplayRole, 52); - break; - case 10: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 65); - aircraft->m_widthItem->setData(Qt::DisplayRole, 59.5); - break; - case 11: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 65); - aircraft->m_widthItem->setData(Qt::DisplayRole, 67); - break; - case 12: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 75); - aircraft->m_widthItem->setData(Qt::DisplayRole, 72.5); - break; - case 13: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 75); - aircraft->m_widthItem->setData(Qt::DisplayRole, 80); - break; - case 14: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 85); - aircraft->m_widthItem->setData(Qt::DisplayRole, 80); - break; - case 15: - aircraft->m_lengthItem->setData(Qt::DisplayRole, 85); - aircraft->m_widthItem->setData(Qt::DisplayRole, 90); - break; - } - } - else - { - // Reserved sub-type - } - - unsigned operationalMode = ((data[7] & 0xff) << 8) | (data[8] & 0xff); - bool tcasActive = (operationalMode >> 13) & 1; - bool identActive = (operationalMode >> 12) & 1; - - if (tcasActive) - { - aircraft->m_tcasItem->setForeground(QBrush(Qt::red)); - aircraft->m_tcasItem->setText("RA"); - } - else if (aircraft->m_tcasOperationalValid) - { - aircraft->m_tcasItem->setForeground(QBrush()); - aircraft->m_tcasItem->setText(aircraft->m_tcasOperational ? QChar(0x2713) : QChar(0x2717)); // Tick or cross - } - else - { - aircraft->m_tcasItem->setText(""); - } - aircraft->m_identItem->setText(identActive ? QChar(0x2713) : QChar(0x2717)); // Tick or cross - - } - } - else - { - // 23, 25, 26, 27, 30 reserved - //qDebug() << "ADSBDemodGUI: Unsupported tc" << tc << aircraft->m_icaoHex << aircraft->m_adsbFrameCount; - } - - // Horizontal containment radius limit (Rc) and Navigation integrity category (NIC) - if (tc == 0) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "?"); - aircraft->m_radius = -1.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 0); - } - else if (tc == 5) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 7.5 m"); - aircraft->m_radius = 7.5f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 11); - } - else if (tc == 6) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 25 m"); - aircraft->m_radius = 25.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 10); - } - else if ((tc == 7) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 75 m"); - aircraft->m_radius = 75.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 9); - } - else if (tc == 7) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 0.1 NM"); - aircraft->m_radius = 185.2f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 8); - } - else if (tc == 8) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, ">= 0.1 NM"); - aircraft->m_radius = 185.2f; // ? - aircraft->m_nicItem->setData(Qt::DisplayRole, 0); - } - else if (tc == 9) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 7.5 m"); - aircraft->m_radius = 7.5f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 11); - } - else if (tc == 10) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 25 m"); - aircraft->m_radius = 25.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 10); - } - else if ((tc == 11) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 75 m"); - aircraft->m_radius = 75.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 9); - } - else if (tc == 11) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 0.1 NM"); - aircraft->m_radius = 185.2f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 8); - } - else if (tc == 12) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 0.2 NM"); - aircraft->m_radius = 370.4f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 7); - } - else if ((tc == 13) && aircraft->m_nicSupplementAValid && !aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 0.3 m"); - aircraft->m_radius = 1111.2f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 6); - } - else if ((tc == 13) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 0.6 m"); - aircraft->m_radius = 1111.2f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 6); - } - else if (tc == 13) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 0.5 NM"); - aircraft->m_radius = 926.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 6); - } - else if (tc == 14) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 1 NM"); - aircraft->m_radius = 1852.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 5); - } - else if (tc == 15) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 2 NM"); - aircraft->m_radius = 3704.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 4); - } - else if ((tc == 16) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 4 m"); - aircraft->m_radius = 7408.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 3); - } - else if (tc == 16) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 8 NM"); - aircraft->m_radius = 14816.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 2); - } - else if (tc == 17) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 20 NM"); - aircraft->m_radius = 37040.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 1); - } - else if (tc == 18) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, ">= 20 NM"); - aircraft->m_radius = 37040.0f; // ? - aircraft->m_nicItem->setData(Qt::DisplayRole, 0); - } - else if (tc == 20) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 7.5 m"); - aircraft->m_radius = 7.5f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 11); - } - else if (tc == 21) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, "< 25 m"); - aircraft->m_radius = 25.0f; - aircraft->m_nicItem->setData(Qt::DisplayRole, 10); - } - else if (tc == 22) - { - aircraft->m_radiusItem->setData(Qt::DisplayRole, ">= 25 m"); - aircraft->m_radius = 25.0f; // ? - aircraft->m_nicItem->setData(Qt::DisplayRole, 0); - } - - // Update aircraft in map - if (aircraft->m_positionValid) - { - // Check to see if we need to start any animations - QList *animations = animate(dateTime, aircraft); - - // Update map displayed in channel - if (updateModel) { - m_aircraftModel.aircraftUpdated(aircraft); - } - - // Send to Map feature - sendToMap(aircraft, animations); - - if (resetAnimation) - { - // Wait until after model has changed before resetting - // otherwise animation might play on old model - aircraft->m_gearDown = false; - aircraft->m_flaps = 0.0; - aircraft->m_engineStarted = false; - aircraft->m_rotorStarted = false; - } - } - } - else if (df == 18) - { - // TIS-B that doesn't match ADS-B formats, such as TIS-B management or Coarse TIB-B position (TODO) - qDebug() << "TIS B message cf=" << ca << " icao: " << QString::number(icao, 16); - } - else if ((df == 4) || (df == 5)) - { - decodeModeS(data, dateTime, df, aircraft); - } - else if ((df == 20) || (df == 21)) - { - decodeModeS(data, dateTime, df, aircraft); - decodeCommB(data, dateTime, df, aircraft, updatedCallsign); - } - else if (df == 11) - { - // All call reply - // Extract 6-bit IC (Interegator Code (II or SI)) which is the address of the Mode-S ground radar - int bytes = data.length(); - unsigned parity = ((data[bytes-3] & 0xff) << 16) | ((data[bytes-2] & 0xff) << 8) | (data[bytes-1] & 0xff); - unsigned ca = data[0] & 0x7; - unsigned d = (parity ^ crc); - unsigned ii = d & 0xf; - unsigned cl = (d >> 4) & 0x7; - bool siCode = cl > 0; - - if ((ca >= 1) && (ca <= 3)) { - return; - } - - if (cl <= 4) - { - unsigned si = ii + (16 * (cl - 1)); - unsigned ic = siCode ? si : ii; - - aircraft->m_interogatorCodeItem->setData(Qt::DisplayRole, ic); - if (ic > 0) { - m_interogators[ic - 1].update(ic, aircraft, &m_airspaceModel, ui->ic, m_settings.m_displayIC[ic - 1]); - } - } - else - { - // This can happen quite frequency when running with a low correlation threshold - // So the IC map probably not very reliable in that case - //qDebug() << "ADSBDemodGUI: DF11 cl out of range" << Qt::hex << cl << d << parity << crc << aircraft->m_icaoHex << aircraft->m_adsbFrameCount; - return; - } - } - else if (df == 0) - { - // Short air-to-air ACAS (Airborne Collision Avoidance System) - //bool onSurface = (data[0] >> 2) & 1; - //unsigned crosslinkCapability = (data[0] >> 1) & 1; - unsigned spare1 = data[0] & 1; - //unsigned sensitivityLevel = (data[1] >> 5) & 0x7; - unsigned spare2 = (data[1] >> 3) & 0x3; - unsigned replyInfo = ((data[1] & 0x7) << 1) | ((data[2] >> 7) & 1); - unsigned spare3 = (data[2] >> 5) & 0x3; - - if ((spare1 != 0) || (spare2 != 0) || (spare3 != 0)) { - qDebug() << "df == 0, SPARE SET TO 1" << aircraft->m_icaoHex; - return; - } - - QString acasCapability; - switch (replyInfo) - { - case 0: - acasCapability = "No ACAS"; - break; - case 2: - acasCapability = "No RA"; - break; - case 3: - acasCapability = "V"; - break; - case 4: - acasCapability = "V+H"; - break; - } - if (!acasCapability.isEmpty()) { - aircraft->m_acasItem->setText(acasCapability); - } - - QString maxSpeed; - switch (replyInfo) - { - case 8: - maxSpeed = "No data"; - break; - case 9: - maxSpeed = "<75"; - break; - case 10: - maxSpeed = "75-150"; - break; - case 11: - maxSpeed = "150-300"; - break; - case 12: - maxSpeed = "300-600"; - break; - case 13: - maxSpeed = "600-1200"; - break; - case 14: - maxSpeed = ">1200"; - break; - } - if (!maxSpeed.isEmpty()) { - aircraft->m_maxSpeedItem->setText(maxSpeed); - } - - decodeModeSAltitude(data, dateTime, aircraft); - } - else if (df == 16) - { - // Long air-to-air ACAS (Airborne Collision Avoidance System) - - decodeModeSAltitude(data, dateTime, aircraft); - - unsigned dv = data[4] & 0xff; - unsigned replyInfo = ((data[1] & 0x7) << 1) | ((data[2] >> 7) & 1); - - QString acasCapability; - switch (replyInfo) - { - case 0: - acasCapability = "No ACAS"; - break; - case 2: - acasCapability = "No RA"; - break; - case 3: - acasCapability = "V"; - break; - case 4: - acasCapability = "V+H"; - break; - } - - if (dv == 0x30) - { - // TODO: Merge in decodeCommB? - unsigned activeRAs = ((data[5] & 0xff) << 6) | ((data[6] >> 2) & 0x3f); - unsigned racs = ((data[6] & 0x3) << 2) | ((data[7] >> 6) & 0x3); - bool raTerminated = (data[7] >> 5) & 1; - bool multipleThreats = (data[7] >> 4) & 1; - unsigned threatType = (data[7] >> 2) & 0x3; - - QString threats; - bool msb = (activeRAs >> 13) & 0x1; - if (!msb) - { - if (!multipleThreats) { - threats = "No threats"; - } else { - threats = "Multiple threats"; - } - } - else - { - threats = "One threat"; - } - - QStringList racStrings; - if (racs & 1) { - racStrings.append("Do not turn right"); - } - if (racs & 2) { - racStrings.append("Do not turn left"); - } - if (racs & 4) { - racStrings.append("Do not pass above"); - } - if (racs & 8) { - racStrings.append("Do not pass below"); - } - - QString threatData; - if (threatType == 1) - { - unsigned threatICAO = ((data[7] & 0x3) << 22) | ((data[8] & 0xff) << 14) | ((data[9] & 0xff) << 6) | ((data[10] >> 2) & 0x3f); - threatData = QString::number(threatICAO, 16); - } - - if (raTerminated) - { - aircraft->m_raItem->setText("RA terminated"); - } - else - { - QStringList s; - s.append(threats); - s.append(racStrings.join("")); - s.append(threatData); - aircraft->m_raItem->setText(s.join(" ")); - } - } - else - { - decodeCommB(data, dateTime, df, aircraft, updatedCallsign); - } - } - else - { - qDebug() << "ADSBDemodGUI: Unsupported df" << df; - } - - // Update stats - m_dfStats[df]++; - updateDFStats(df); - if ((df == 17) || (df == 18)) { - m_adsbFrameRateCount++; - } else { - m_modesFrameRateCount++; - } - m_totalBytes += data.size(); - - aircraft->m_rxTime = dateTime; - aircraft->m_updateTime = QDateTime::currentDateTime(); - QTime time = aircraft->m_updateTime.time(); - aircraft->m_timeItem->setText(QString("%1:%2:%3").arg(time.hour(), 2, 10, QLatin1Char('0')).arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0'))); - if (df == 17) - { - aircraft->m_adsbFrameCount++; - aircraft->m_adsbFrameCountItem->setData(Qt::DisplayRole, aircraft->m_adsbFrameCount); - } - else if (df == 18) - { - if (ca == 0) - { - aircraft->m_nonTransponderFrameCount++; - aircraft->m_nonTransponderItem->setData(Qt::DisplayRole, aircraft->m_nonTransponderFrameCount); - } - else if (ca == 6) - { - aircraft->m_adsrFrameCount++; - aircraft->m_adsrFrameCountItem->setData(Qt::DisplayRole, aircraft->m_adsrFrameCount); - } - else - { - aircraft->m_tisBFrameCount++; - aircraft->m_tisBFrameCountItem->setData(Qt::DisplayRole, aircraft->m_tisBFrameCount); - } - } - else - { - aircraft->m_modesFrameCount++; - aircraft->m_modesFrameCountItem->setData(Qt::DisplayRole, aircraft->m_modesFrameCount); - } - aircraft->m_totalFrameCountItem->setData(Qt::DisplayRole, aircraft->m_adsbFrameCount + aircraft->m_tisBFrameCount + aircraft->m_modesFrameCount); - - if (correlation < aircraft->m_minCorrelation) - aircraft->m_minCorrelation = correlation; - if (correlation > aircraft->m_maxCorrelation) - aircraft->m_maxCorrelation = correlation; - m_correlationAvg(correlation); - aircraft->m_correlationAvg(correlation); - aircraft->m_correlation = aircraft->m_correlationAvg.instantAverage(); - aircraft->m_correlationItem->setText(QString("%1/%2/%3") - .arg(CalcDb::dbPower(aircraft->m_minCorrelation), 3, 'f', 1) - .arg(CalcDb::dbPower(aircraft->m_correlation), 3, 'f', 1) - .arg(CalcDb::dbPower(aircraft->m_maxCorrelation), 3, 'f', 1)); - m_correlationOnesAvg(correlationOnes); - aircraft->m_rssiItem->setText(QString("%1") - .arg(CalcDb::dbPower(m_correlationOnesAvg.instantAverage()), 3, 'f', 1)); - - // Check to see if we need to emit a notification about this aircraft - checkDynamicNotification(aircraft); - - // Update text below photo if it's likely to have changed - if ((aircraft == m_highlightAircraft) && (newAircraft || updatedCallsign)) { - updatePhotoText(aircraft); - } - - PROFILER_STOP("ADS-B decode"); -} - -void ADSBDemodGUI::Interogator::update(int ic, Aircraft *aircraft, AirspaceModel *airspaceModel, CheckList *checkList, bool display) -{ - if (aircraft->m_positionValid) - { - if (m_valid) - { - bool changed = false; - - if (aircraft->m_latitude < m_minLatitude) - { - m_minLatitude = aircraft->m_latitude; - changed = true; - } - if (aircraft->m_latitude > m_maxLatitude) - { - m_maxLatitude = aircraft->m_latitude; - changed = true; - } - if (aircraft->m_longitude < m_minLongitude) - { - m_minLongitude = aircraft->m_longitude; - changed = true; - } - if (aircraft->m_longitude > m_maxLongitude) - { - m_maxLongitude = aircraft->m_longitude; - changed = true; - } - if (changed) - { - calcPoly(); - if (display) { - airspaceModel->airspaceUpdated(&m_airspace); - } - } - } - else - { - const double minSize = 0.02; - QBrush brush(QColor(colors[ic*3], colors[ic*3+1], colors[ic*3+2], 0xa0)); - - m_valid = true; - m_minLatitude = aircraft->m_latitude - minSize; - m_maxLatitude = aircraft->m_latitude + minSize; - m_minLongitude = aircraft->m_longitude - minSize; - m_maxLongitude = aircraft->m_longitude + minSize; - m_airspace.m_name = QString("IC %1").arg(ic); - m_airspace.m_bottom.m_alt = -1; - m_airspace.m_top.m_alt = -1; - calcPoly(); - if (display) - { - airspaceModel->addAirspace(&m_airspace); - checkList->addCheckItem(QString::number(ic), ic, Qt::Checked)->setBackground(brush); - } - else - { - checkList->addCheckItem(QString::number(ic), ic, Qt::Unchecked)->setBackground(brush); - } - checkList->setSortRole(Qt::UserRole + 1); // Sort via data rather than label - checkList->model()->sort(0, Qt::AscendingOrder); - } - } -} - -void ADSBDemodGUI::Interogator::calcPoly() -{ - double w = (m_maxLongitude - m_minLongitude) / 2.0; - double h = (m_maxLatitude - m_minLatitude) / 2.0; - double x = m_minLongitude + w; - double y = m_minLatitude + h; - m_airspace.m_center.setX(x); - m_airspace.m_center.setY(y); - m_airspace.m_position = m_airspace.m_center; - - const int s = 15; - m_airspace.m_polygon.resize(360/s+1); - - for (int d = 0, i = 0; d <= 360; d += s, i++) - { - double a = Units::degreesToRadians((double) d); - double r1 = cos(a) * w; - double r2 = sin(a) * h; - - m_airspace.m_polygon[i] = QPointF(x + r1, y + r2); - } -} - -// Clear heading if much older than latest track figure or too different -void ADSBDemodGUI::clearOldHeading(Aircraft *aircraft, const QDateTime& dateTime, float newTrack) -{ - if (aircraft->m_headingValid - && (aircraft->m_heading != newTrack) - && ( (std::abs(newTrack - aircraft->m_trackWhenHeadingSet) >= 5) - || (aircraft->m_headingDateTime.secsTo(dateTime) >= 10) - ) - ) - { - aircraft->m_headingValid = false; - aircraft->m_headingItem->setData(Qt::DisplayRole, ""); - } -} - -void ADSBDemodGUI::decodeID(const QByteArray& data, QString& emitterCategory, QString& callsign) -{ - // Aircraft identification - BDS 0,8 - unsigned tc = ((data[4] >> 3) & 0x1f); // Type code - int ec = data[4] & 0x7; // Emitter category - - if (tc == 4) { - emitterCategory = m_categorySetA[ec]; - } else if (tc == 3) { - emitterCategory = m_categorySetB[ec]; - } else if (tc == 2) { - emitterCategory = m_categorySetC[ec]; - } else { - emitterCategory = QStringLiteral("Reserved"); - } - - // Flight/callsign - Extract 8 6-bit characters from 6 8-bit bytes, MSB first - unsigned char c[8]; - c[0] = (data[5] >> 2) & 0x3f; // 6 - c[1] = ((data[5] & 0x3) << 4) | ((data[6] & 0xf0) >> 4); // 2+4 - c[2] = ((data[6] & 0xf) << 2) | ((data[7] & 0xc0) >> 6); // 4+2 - c[3] = (data[7] & 0x3f); // 6 - c[4] = (data[8] >> 2) & 0x3f; - c[5] = ((data[8] & 0x3) << 4) | ((data[9] & 0xf0) >> 4); - c[6] = ((data[9] & 0xf) << 2) | ((data[10] & 0xc0) >> 6); - c[7] = (data[10] & 0x3f); - // Map to ASCII - char callsignASCII[9]; - for (int i = 0; i < 8; i++) - callsignASCII[i] = m_idMap[c[i]]; - callsignASCII[8] = '\0'; - callsign = QString(callsignASCII).trimmed(); -} - -bool ADSBDemodGUI::decodeGroundspeed(const QByteArray& data, float& v, float& h) -{ - int st = data[4] & 0x7; // Subtype - 2 is supersonic, with 4kt LSB - int lsb = (st == 2) ? 4 : 1; - int s_ew = (data[5] >> 2) & 1; // East-west velocity sign - int v_ew = ((data[5] & 0x3) << 8) | (data[6] & 0xff); // East-west velocity - int s_ns = (data[7] >> 7) & 1; // North-south velocity sign - int v_ns = ((data[7] & 0x7f) << 3) | ((data[8] >> 5) & 0x7); // North-south velocity - - // All-zeros means no velocity information available - if ((v_ew == 0) || (v_ns == 0)) { - return false; - } - - int v_we; - int v_sn; - - if (s_ew) { - v_we = -1 * (v_ew - 1); - } else { - v_we = v_ew - 1; - } - if (s_ns) { - v_sn = -1 * (v_ns - 1); - } else { - v_sn = v_ns - 1; - } - v_we *= lsb; - v_sn *= lsb; - v = std::round(std::sqrt(v_we*v_we + v_sn*v_sn)); - h = std::atan2(v_we, v_sn) * 360.0/(2.0*M_PI); - if (h < 0.0) { - h += 360.0; - } - return true; -} - -bool ADSBDemodGUI::decodeAirspeed(const QByteArray& data, bool& tas, int& as, bool& hdgValid, float& hdg) -{ - int st = data[4] & 0x7; // Subtype - 4 is supersonic, with 4kt LSB - int lsb = (st == 4) ? 4 : 1; - hdgValid = (data[5] >> 2) & 1; // Heading status - int hdgFix = ((data[5] & 0x3) << 8) | (data[6] & 0xff); // Heading - hdg = hdgFix / 1024.0f * 360.0f; - - tas = (data[7] >> 7) & 1; // Airspeed type (true or indicated) - int asFix = ((data[7] & 0x7f) << 3) | ((data[8] >> 5) & 0x7); // Airspeed - - // All-zeros means no airspeed information available - if (asFix == 0) { - return false; - } - as = (asFix - 1) * lsb; - return true; -} - -bool ADSBDemodGUI::decodeVerticalRate(const QByteArray& data, int& verticalRate) -{ - int s_vr = (data[8] >> 3) & 1; // Vertical rate sign - int vr = ((data[8] & 0x7) << 6) | ((data[9] >> 2) & 0x3f); // Vertical rate - - // All-zeros means no vertical rate information available - if (vr == 0) { - return false; - } - verticalRate = (vr-1)*64*(s_vr?-1:1); - return true; -} - -// Called when we have both lat & long -void ADSBDemodGUI::updateAircraftPosition(Aircraft *aircraft, double latitude, double longitude, const QDateTime& dateTime) -{ - // Calculate range, azimuth and elevation to aircraft from station - m_azEl.setTarget(latitude, longitude, aircraft->m_altitudeValid ? Units::feetToMetres(aircraft->m_altitude) : 0); - m_azEl.calculate(); - - aircraft->m_latitude = latitude; - aircraft->m_longitude = longitude; - aircraft->m_latitudeItem->setData(Qt::DisplayRole, aircraft->m_latitude); - aircraft->m_longitudeItem->setData(Qt::DisplayRole, aircraft->m_longitude); - aircraft->m_positionDateTime = dateTime; - - if (!aircraft->m_positionValid) - { - aircraft->m_positionValid = true; - // Now we have a position, add a plane to the map - m_aircraftModel.addAircraft(aircraft); - } - - aircraft->m_range = m_azEl.getDistance(); - aircraft->m_azimuth = m_azEl.getAzimuth(); - aircraft->m_elevation = m_azEl.getElevation(); - aircraft->m_rangeItem->setText(QString::number(aircraft->m_range/1000.0, 'f', 1)); - aircraft->m_azElItem->setText(QString("%1/%2").arg(std::round(aircraft->m_azimuth)).arg(std::round(aircraft->m_elevation))); - if (aircraft == m_trackAircraft) { - m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation, aircraft->m_range); - } - if (m_azEl.getDistance() > m_maxRangeStat) - { - m_maxRangeStat = m_azEl.getDistance(); - ui->statsTable->item(MAX_RANGE, 0)->setData(Qt::DisplayRole, m_maxRangeStat / 1000.0); - } - if (aircraft->m_altitudeValid && (aircraft->m_altitude > m_maxAltitudeStat)) - { - m_maxAltitudeStat = aircraft->m_altitude; - ui->statsTable->item(MAX_ALTITUDE, 0)->setData(Qt::DisplayRole, m_maxAltitudeStat); - } - if (aircraft->m_altitudeValid) { - updateCoverageMap(m_azEl.getAzimuth(), m_azEl.getElevation(), m_azEl.getDistance(), aircraft->m_altitude); - } -} - -bool ADSBDemodGUI::validateGlobalPosition(double latitude, double longitude, bool countFailure) -{ - // Log files could be from anywhere, so allow any position - if (m_loadingData) { - return true; - } - - // Calculate range to aircraft from station - m_azEl.setTarget(latitude, longitude, 0); - m_azEl.calculate(); - - // Reasonableness test - if (m_azEl.getDistance() < 600000) - { - return true; - } - else if (countFailure) - { - m_rangeFails++; - ui->statsTable->item(RANGE_FAILS, 0)->setData(Qt::DisplayRole, m_rangeFails); - } - return false; -} - -// Called when we have lat & long from local decode and we need to check if it is in a valid range (<180nm/333km airborne or 45nm/83km for surface) -bool ADSBDemodGUI::validateLocalPosition(double latitude, double longitude, bool surfacePosition, bool countFailure) -{ - // Calculate range to aircraft from station - m_azEl.setTarget(latitude, longitude, 0); - m_azEl.calculate(); - - // Don't use the full 333km, as there may be some error in station position - if (m_azEl.getDistance() < (surfacePosition ? 80000 : 320000)) - { - return true; - } - else if (countFailure) - { - m_rangeFails++; - ui->statsTable->item(RANGE_FAILS, 0)->setData(Qt::DisplayRole, m_rangeFails); - } - return false; -} - -bool ADSBDemodGUI::decodeGlobalPosition(int f, const double cprLat[2], const double cprLong[2], const QDateTime cprTime[2], double& latitude, double& longitude, bool countFailure) -{ - // Calculate latitude - const double dLatEven = 360.0/60.0; - const double dLatOdd = 360.0/59.0; - double latEven, latOdd; - int ni, m; - - int j = std::floor(59.0f*cprLat[0] - 60.0f*cprLat[1] + 0.5); - latEven = dLatEven * (modulus(j, 60) + cprLat[0]); - // Southern hemisphere is in range 270-360, so adjust to -90-0 - if (latEven >= 270.0f) { - latEven -= 360.0f; - } - latOdd = dLatOdd * (modulus(j, 59) + cprLat[1]); - if (latOdd >= 270.0f) { - latOdd -= 360.0f; - } - if (cprTime[0] >= cprTime[1]) { - latitude = latEven; - } else { - latitude = latOdd; - } - if ((latitude <= 90.0) && (latitude >= -90.0)) - { - // Check if both frames in same latitude zone - int latEvenNL = cprNL(latEven); - int latOddNL = cprNL(latOdd); - - if (latEvenNL == latOddNL) - { - // Calculate longitude - if (!f) - { - ni = cprN(latEven, 0); - m = std::floor(cprLong[0] * (latEvenNL - 1) - cprLong[1] * latEvenNL + 0.5f); - longitude = (360.0f/ni) * (modulus(m, ni) + cprLong[0]); - } - else - { - ni = cprN(latOdd, 1); - m = std::floor(cprLong[0] * (latOddNL - 1) - cprLong[1] * latOddNL + 0.5f); - longitude = (360.0f/ni) * (modulus(m, ni) + cprLong[1]); - } - if (longitude > 180.0f) { - longitude -= 360.0f; - } - return validateGlobalPosition(latitude, longitude, countFailure); - } - else - { - return false; - } - } - else - { - return false; - } -} - -// Only valid if airborne within 180nm/333km (C.2.6.4) or 45nm for surface -bool ADSBDemodGUI::decodeLocalPosition(int f, double cprLat, double cprLong, bool onSurface, const Aircraft *aircraft, double& latitude, double& longitude, bool countFailure) -{ - double refLatitude; - double refLongitude; - - if (aircraft->m_globalPosition) - { - refLatitude = aircraft->m_latitude; - refLongitude = aircraft->m_longitude; - } - else - { - refLatitude = m_azEl.getLocationSpherical().m_latitude; - refLongitude = m_azEl.getLocationSpherical().m_longitude; - } - - // Calculate latitude - const double maxDeg = onSurface ? 90.0 : 360.0; - const double dLatEven = maxDeg/60.0; - const double dLatOdd = maxDeg/59.0; - double dLat = f ? dLatOdd : dLatEven; - - int j = std::floor(refLatitude/dLat) + std::floor(modulus(refLatitude, dLat)/dLat - cprLat + 0.5); - latitude = dLat * (j + cprLat); - - // Calculate longitude - double dLong; - int latNL = cprNL(latitude); - if (f == 0) - { - if (latNL > 0) { - dLong = maxDeg / latNL; - } else { - dLong = maxDeg; - } - } - else - { - if ((latNL - 1) > 0) { - dLong = maxDeg / (latNL - 1); - } else { - dLong = maxDeg; - } - } - int m = std::floor(refLongitude/dLong) + std::floor(modulus(refLongitude, dLong)/dLong - cprLong + 0.5); - longitude = dLong * (m + cprLong); - - if (aircraft->m_globalPosition) - { - // Reasonableness spec is 2.5nm / 30 seconds - we're less stringent - double latDiff = abs(refLatitude - latitude); - double lonDiff = abs(refLongitude - longitude); - double maxLatDiff = 20000/111000.0; - double maxLonDiff = cos(Units::degreesToRadians(latitude)) * maxLatDiff; - if ((latDiff > maxLatDiff) || (lonDiff > maxLonDiff)) { - if (countFailure) { - //qDebug() << "FAIL" << latDiff << maxLatDiff << lonDiff << maxLonDiff; - } - } - return !((latDiff > maxLatDiff) || (lonDiff > maxLonDiff)); - } - else - { - // Check position is within range of antenna - return validateLocalPosition(latitude, longitude, onSurface, countFailure); - } -} - -void ADSBDemodGUI::decodeCpr(const QByteArray& data, int& f, double& latCpr, double& lonCpr) const -{ - f = (data[6] >> 2) & 1; // CPR odd/even frame - should alternate every 0.2s - int latCprFix = ((data[6] & 3) << 15) | ((data[7] & 0xff) << 7) | ((data[8] >> 1) & 0x7f); - int lonCprFix = ((data[8] & 1) << 16) | ((data[9] & 0xff) << 8) | (data[10] & 0xff); - - latCpr = latCprFix / 131072.0; - lonCpr = lonCprFix / 131072.0; -} - -// This is relative to pressure of 1013.25 - it isn't corrected according to aircraft baro setting - so we can appear underground -bool ADSBDemodGUI::decodeAltitude(const QByteArray& data, int& altFt) const -{ - int alt = ((data[5] & 0xff) << 4) | ((data[6] >> 4) & 0xf); // Altitude - if (alt == 0) { - return false; - } - int q = (alt & 0x10) != 0; - int n = ((alt >> 1) & 0x7f0) | (alt & 0xf); // Remove Q-bit - - if (q == 1) { - altFt = n * ((alt & 0x10) ? 25 : 100) - 1000; - } else { - altFt = gillhamToFeet(n); - } - return true; -} - -// Mode S pressure altitude reported in 100ft or 25ft increments -// Note that we can get Mode-S altitude when still on the ground -void ADSBDemodGUI::decodeModeSAltitude(const QByteArray& data, const QDateTime dateTime, Aircraft *aircraft) -{ - int altitude = 0; // Altitude in feet - int altitudeCode = ((data[2] & 0x1f) << 8) | (data[3] & 0xff); - - if (altitudeCode & 0x40) // M bit indicates metres - { - int altitudeMetres = ((altitudeCode & 0x1f80) >> 1) | (altitudeCode & 0x3f); - altitude = Units::metresToFeet(altitudeMetres); - } - else - { - // Remove M and Q bits - int altitudeFix = ((altitudeCode & 0x1f80) >> 2) | ((altitudeCode & 0x20) >> 1) | (altitudeCode & 0xf); - - // Convert to feet - if (altitudeCode & 0x10) { - altitude = altitudeFix * 25 - 1000; - } else { - altitude = gillhamToFeet(altitudeFix); - } - } - - // We can frequently get false decodes of df 4 frames, so check altitude is reasonable, based on previous value - // If greater than an unlikely climb rate, ignore, as we don't want the aircraft jumping around the 3D map - bool altUnlikely = false; - if (aircraft->m_altitudeValid) - { - int altDiff = abs(aircraft->m_altitude - altitude); - if (altDiff > 500) - { - qint64 msecs = aircraft->m_altitudeDateTime.msecsTo(dateTime); - float climbRate = altDiff / (msecs / (1000.0f * 60.0f)); - if (climbRate > 6000.0f) - { - altUnlikely = true; - m_altFails++; - ui->statsTable->item(ALT_FAILS, 0)->setData(Qt::DisplayRole, m_altFails); - } - } - } - if (!altUnlikely) { - aircraft->setAltitude(altitude, false, dateTime, m_settings); - } -} - -void ADSBDemodGUI::decodeModeS(const QByteArray data, const QDateTime dateTime, int df, Aircraft *aircraft) -{ - bool wasOnSurface = aircraft->m_onSurface; - bool takenOff = false; - - int flightStatus = data[0] & 0x7; - if ((flightStatus == 0) || (flightStatus == 2)) - { - takenOff = wasOnSurface; - aircraft->m_onSurface = false; - aircraft->m_onSurfaceValid = true; - } - else if ((flightStatus == 1) || (flightStatus == 3)) - { - aircraft->m_onSurface = true; - aircraft->m_onSurfaceValid = true; - } - if (wasOnSurface != aircraft->m_onSurface) - { - // Can't mix CPR values used on surface and those that are airborne - aircraft->m_cprValid[0] = false; - aircraft->m_cprValid[1] = false; - } - - if ((df == 4) || (df == 20)) - { - decodeModeSAltitude(data, dateTime, aircraft); - - // Assume runway elevation is at first reported airboune altitude - if (takenOff) - { - aircraft->m_runwayAltitude = aircraft->m_altitude; - aircraft->m_runwayAltitudeValid = true; - } - } - else if ((df == 5) || (df == 21)) - { - // Squawk ident code - int identCode = ((data[2] & 0x1f) << 8) | (data[3] & 0xff); - int squawk = squawkDecode(identCode); - // SPI (IDENT) is indicated in the flight status field, not the identity field - bool spi = (flightStatus == 4) || (flightStatus == 5); - - if ((squawk != aircraft->m_squawk) || (spi != aircraft->m_spi)) - { - aircraft->m_squawk = squawk; - aircraft->m_spi = spi; - if (spi) { - aircraft->m_squawkItem->setText(QString("%1 IDENT").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); - } else { - aircraft->m_squawkItem->setText(QString("%1").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); - } - } - } -} - -static bool isSpeedInconsistent(float speed1, float speed2) -{ - return std::abs(speed1 - speed2) > 50.0f; -} - -static bool isHeadingInconsistent(float heading1, float heading2) -{ - float difference = std::fmod(std::abs(heading1 - heading2), 360.0f); - return std::min(difference, 360.0f - difference) > 45.0f; -} - -static bool isVerticalRateInconsistent(int verticalRate1, int verticalRate2) -{ - return abs(verticalRate1 - verticalRate2) > 1500; -} - -static bool isAltitudeInconsistent(int altitude1, int altitude2) -{ - return abs(altitude1 - altitude2) > 1500; // 30s at climb rate of 3kft/m -} - -static bool isPositionInconsistent(double latitude1, double longitude1, double latitude2, double longitude2) -{ - return (abs(latitude1 - latitude2) > 0.2f) || (abs(longitude1 - longitude2) > 0.3f); // 1 deg lat is ~70 miles. 500mph is ~8miles per minute -} - -void ADSBDemodGUI::decodeCommB(const QByteArray data, const QDateTime dateTime, int df, Aircraft *aircraft, bool &updatedCallsign) -{ - // We only see downlink messages, so do not know the data format, so have to decode all possibilities - // and then see which have legal values and values that are consistent with ADS-B data - - // All IFR aircraft should support ELS (Elementary Surveillance) which includes BDS 1,0 1,7 2,0 3,0 - // Large aircraft are also required to support EHS (Enhanced Surveillance) which adds BDS 4,0 5,0 6,0 - // There is also MRAR (Meteorological Routine Air Report) BDS 4,4 4,5, but only a small % of aircraft support this - // See: https://www.icao.int/APAC/Documents/edocs/Mode%20S%20DAPs%20Implementation%20and%20Operations%20Guidance%20Document3.0.pdf - - // I've implemented a few extra BDSes, but these are rarely seen. - // Figure 2 in "Mode S Transponder Comm-B Capabilities in Current Operational Aircraft" gives a breakdown of what capabilities are reported by BDS 1,7: - // https://www.researchgate.net/publication/346521949_Mode_S_Transponder_Comm-B_Capabilities_in_Current_Operational_Aircraft/link/5fc60b794585152e9be8571c/download - - // Skip messages that are all zeros - if (data[4] || data[5] || data[6] || data[7] || data[8] || data[9] || data[10]) - { - - const int maxWind = 250; // Maximum expected head/tail wind in knts - const int maxSpeedDiff = 50; // Maximum speed difference we allow before we assume message is inconsistent - const int maxAlt = 46000; // Maximum expected altitude for commercial jet - const float maxHeadingDiff = 20.0f; // Maximum difference in heading/track - - // BDS 0,5 - Extended squitter airborne position (tc=11 typically seen in DF16) - - int altitude_0_5; - bool altitudeValid_0_5 = decodeAltitude(data, altitude_0_5); - // Require an altitude having been received by other means, otherwise too high chance of it being incorrect - bool altitudeInconsistent_0_5 = !altitudeValid_0_5 || (aircraft->m_altitudeValid && isAltitudeInconsistent(altitude_0_5, aircraft->m_altitude)); - - const unsigned tc = ((data[4] >> 3) & 0x1f); - bool tcInconsistent = !((tc == 0) || ((tc >= 5) && (tc <= 8)) || ((tc >= 9) && (tc <= 18)) || ((tc >= 20) && (tc <= 22))); // Only position type codes - - int f; - double latCpr, lonCpr; - decodeCpr(data, f, latCpr, lonCpr); - bool cprValid[2] = {f ? aircraft->m_cprValid[0] : true, f ? true : aircraft->m_cprValid[1]}; - double cprLat[2] = {f ? aircraft->m_cprLat[0] : latCpr, f ? latCpr : aircraft->m_cprLat[1]}; - double cprLon[2] = {f ? aircraft->m_cprLong[0] : lonCpr, f ? lonCpr : aircraft->m_cprLong[1]}; - QDateTime cprTime[2] = {f ? aircraft->m_cprTime[0] : dateTime, f ? dateTime : aircraft->m_cprTime[1]}; - double latitude_0_5, longitude_0_5; - double positionValid_0_5 = false; - if (cprValid[0] && cprValid[1] - && (std::abs(cprTime[0].toMSecsSinceEpoch() - cprTime[1].toMSecsSinceEpoch()) <= 8500) - && !aircraft->m_onSurface) - { - if (decodeGlobalPosition(f, cprLat, cprLon, cprTime, latitude_0_5, longitude_0_5, false)) { - positionValid_0_5 = true; - } - } - else - { - if (decodeLocalPosition(f, cprLat[f], cprLon[f], aircraft->m_onSurface, aircraft, latitude_0_5, longitude_0_5, false)) { - positionValid_0_5 = true; - } - } - // Require a position having been received by other means, otherwise too high chance of it being incorrect - bool positionInconsistent_0_5 = !positionValid_0_5 || (aircraft->m_positionValid && isPositionInconsistent(aircraft->m_latitude, aircraft->m_longitude, latitude_0_5, longitude_0_5)); - - bool bds_0_5 = ((tc >= 9) && (tc <= 18)) && !positionInconsistent_0_5 && !altitudeInconsistent_0_5 && !tcInconsistent; - - // BDS 0,8 - Aircraft identification and category - - QString emitterCategory, callsign_0_8; - - decodeID(data, emitterCategory, callsign_0_8); - - bool emitterCategoryInconsistent = (emitterCategory == "Reserved") || (emitterCategory != aircraft->m_emitterCategory); - bool callsignInconsistent_0_8 = callsign_0_8.isEmpty() || callsign_0_8.contains('#'); // Callsign can change between flights - - bool bds_0_8 = ((tc >= 1) && (tc <= 4)) && !emitterCategoryInconsistent && !callsignInconsistent_0_8; - - // BDS 0,9 - Airborne Velocity - - int st = data[4] & 0x7; // Subtype - bool groundspeedSubType = (st == 1) || (st == 2); - bool airspeedSubType = (st == 3) || (st == 4); - float groundspeed_0_9 = 0.0f, track = 0.0f; - bool airspeedType_0_9 = false; - int airspeed = 0; - bool headingValid = false; - float heading = 0.0f; - bool groundspeedValid_0_9 = false; - bool airspeedValid_0_9 = false; - if (groundspeedSubType) - { - // Ground speed - groundspeedValid_0_9 = decodeGroundspeed(data, groundspeed_0_9, track); - } - else if (airspeedSubType) - { - // Airspeed - airspeedValid_0_9 = decodeAirspeed(data, airspeedType_0_9, airspeed, headingValid, heading); - } - int verticalRate = 0; - bool verticalRateValid_0_9 = decodeVerticalRate(data, verticalRate); - - bool groundspeedInconsistent = groundspeedSubType - && groundspeedValid_0_9 - && ((aircraft->m_groundspeedValid && isSpeedInconsistent(groundspeed_0_9, aircraft->m_groundspeed)) - || (aircraft->m_trackValid && isHeadingInconsistent(track, aircraft->m_track))); - bool airspeedInconsistent = airspeedSubType - && ((airspeedValid_0_9 - && (airspeedType_0_9 ? aircraft->m_trueAirspeedValid : aircraft->m_indicatedAirspeedValid) - && isSpeedInconsistent(airspeed, airspeedType_0_9 ? aircraft->m_trueAirspeed : aircraft->m_indicatedAirspeed)) - || (headingValid && aircraft->m_headingValid && isHeadingInconsistent(heading, aircraft->m_heading))); - bool verticalRateInconsistent = verticalRateValid_0_9 && aircraft->m_verticalRateValid && isVerticalRateInconsistent(verticalRate, aircraft->m_verticalRate); - - // Require at least one valid subfield, so a frame that happens to have subtype bits 1-4 but - // no usable content can't consume the single-match slot for other registers - bool bds_0_9 = (tc == 19) - && (groundspeedSubType || airspeedSubType) - && (groundspeedValid_0_9 || airspeedValid_0_9 || (airspeedSubType && headingValid) || verticalRateValid_0_9) - && !groundspeedInconsistent && !airspeedInconsistent && !verticalRateInconsistent; - - // BDS 1,0 - ELS - - bool bds_1_0 = ((data[4] & 0xff) == 0x10) && ((data[5] & 0x7c) == 0x00); - - // BDS 1,7 - Common usage GICB capability report - ELS - - bool cap_0_5 = (data[4] >> 7) & 0x1; - bool cap_0_6 = (data[4] >> 6) & 0x1; - bool cap_0_7 = (data[4] >> 5) & 0x1; - bool cap_0_8 = (data[4] >> 4) & 0x1; - bool cap_0_9 = (data[4] >> 3) & 0x1; - bool cap_0_a = (data[4] >> 2) & 0x1; - bool cap_2_0 = (data[4] >> 1) & 0x1; - bool cap_2_1 = (data[4] >> 0) & 0x1; - - bool cap_4_0 = (data[5] >> 7) & 0x1; - bool cap_4_1 = (data[5] >> 6) & 0x1; - bool cap_4_2 = (data[5] >> 5) & 0x1; - bool cap_4_3 = (data[5] >> 4) & 0x1; - bool cap_4_4 = (data[5] >> 3) & 0x1; - bool cap_4_5 = (data[5] >> 2) & 0x1; - bool cap_4_8 = (data[5] >> 1) & 0x1; - bool cap_5_0 = (data[5] >> 0) & 0x1; - - bool cap_5_1 = (data[6] >> 7) & 0x1; - bool cap_5_2 = (data[6] >> 6) & 0x1; - bool cap_5_3 = (data[6] >> 5) & 0x1; - bool cap_5_4 = (data[6] >> 4) & 0x1; - bool cap_5_5 = (data[6] >> 3) & 0x1; - bool cap_5_6 = (data[6] >> 2) & 0x1; - bool cap_5_f = (data[6] >> 1) & 0x1; - bool cap_6_0 = (data[6] >> 0) & 0x1; - - QStringList caps; - if (cap_0_5) { - caps.append("0,5"); - } - if (cap_0_6) { - caps.append("0,6"); - } - if (cap_0_7) { - caps.append("0,7"); - } - if (cap_0_8) { - caps.append("0,8"); - } - if (cap_0_9) { - caps.append("0,9"); - } - if (cap_0_a) { - caps.append("0,A"); - } - if (cap_2_0) { - caps.append("2,0"); - } - if (cap_2_1) { - caps.append("2,1"); - } - if (cap_4_0) { - caps.append("4,0"); - } - if (cap_4_1) { - caps.append("4,1"); - } - if (cap_4_2) { - caps.append("4,2"); - } - if (cap_4_3) { - caps.append("4,3"); - } - if (cap_4_4) { - caps.append("4,4"); - } - if (cap_4_5) { - caps.append("4,5"); - } - if (cap_4_8) { - caps.append("4,8"); - } - if (cap_5_0) { - caps.append("5,0"); - } - if (cap_5_1) { - caps.append("5,1"); - } - if (cap_5_2) { - caps.append("5,2"); - } - if (cap_5_3) { - caps.append("5,3"); - } - if (cap_5_4) { - caps.append("5,4"); - } - if (cap_5_5) { - caps.append("5,5"); - } - if (cap_5_6) { - caps.append("5,6"); - } - if (cap_5_f) { - caps.append("5,F"); - } - if (cap_6_0) { - caps.append("6,0"); - } - - bool bds_1_7 = cap_2_0 && (data[7] == 0x0) && (data[8] == 0x0) && (data[9] == 0x0) && (data[10] == 0x0); - - // BDS 1,8 1,9 1,A 1,B 1,C 1,D 1,E 1,F Mode S specific services - - // Apart from 1,C and 1,F these can have any bits set/clear and specify BDS code capabilities - // Don't decode for now - - // BDS 2,0 - Aircraft identification - ELS - - // Flight/callsign - Extract 8 6-bit characters from 6 8-bit bytes, MSB first - unsigned char c[9]; - char callsignASCII[9]; - c[0] = (data[5] >> 2) & 0x3f; // 6 - c[1] = ((data[5] & 0x3) << 4) | ((data[6] & 0xf0) >> 4); // 2+4 - c[2] = ((data[6] & 0xf) << 2) | ((data[7] & 0xc0) >> 6); // 4+2 - c[3] = (data[7] & 0x3f); // 6 - c[4] = (data[8] >> 2) & 0x3f; - c[5] = ((data[8] & 0x3) << 4) | ((data[9] & 0xf0) >> 4); - c[6] = ((data[9] & 0xf) << 2) | ((data[10] & 0xc0) >> 6); - c[7] = (data[10] & 0x3f); - // Map to ASCII - for (int i = 0; i < 8; i++) { - callsignASCII[i] = m_idMap[c[i]]; - } - callsignASCII[8] = '\0'; - QString callsignTrimmed = QString(callsignASCII).trimmed(); - bool invalidCallsign = QString(callsignASCII).contains('#'); - bool bds_2_0 = ((data[4] & 0xff) == 0x20) && !invalidCallsign; - - // BDS 2,1 - Aircraft and airline registration markings - - bool aircraftRegistrationStatus = (data[4] >> 7) & 0x1; - char aircraftRegistration[8]; - c[0] = (data[4] >> 1) & 0x3f; - c[1] = ((data[4] & 0x1) << 5) | ((data[5] >> 3) & 0x1f); - c[2] = ((data[5] & 0x7) << 3) | ((data[6] >> 5) & 0x7); - c[3] = ((data[6] & 0x1f) << 1) | ((data[7] >> 7) & 0x1); - c[4] = ((data[7] >> 1) & 0x1f); - c[5] = ((data[7] & 0x1) << 5) | ((data[8] >> 3) & 0x1f); - c[6] = ((data[8] & 0x7) << 3) | ((data[9] >> 5) & 0x7); - // Map to ASCII - for (int i = 0; i < 7; i++) { - aircraftRegistration[i] = m_idMap[c[i]]; - } - aircraftRegistration[7] = '\0'; - QString aircraftRegistrationString = QString(aircraftRegistration).trimmed(); - bool aircraftRegistrationInvalid = QString(aircraftRegistrationString).contains('#'); - bool aircraftRegistrationInconsistent = !aircraftRegistrationStatus && (c[0] || c[1] || c[2] || c[3] || c[4] || c[5] || c[6]); - - bool airlineRegistrationStatus = (data[9] >> 4) & 0x1; - char airlineRegistration[3]; - c[0] = ((data[9] & 0xf) << 2) | ((data[10] >> 6) & 0x3); - c[1] = data[10] & 0x3f; - // Map to ASCII - for (int i = 0; i < 2; i++) { - airlineRegistration[i] = m_idMap[c[i]]; - } - airlineRegistration[2] = '\0'; - QString airlineRegistrationString = QString(airlineRegistration).trimmed(); - bool airlineRegistrationInvalid = QString(airlineRegistrationString).contains('#') || !QChar(QLatin1Char(airlineRegistration[0])).isLetter() || !QChar(QLatin1Char(airlineRegistration[1])).isLetter(); - bool airlineRegistrationInconsistent = !airlineRegistrationStatus && (c[0] || c[1]); - - bool bds_2_1 = !aircraftRegistrationInvalid && !aircraftRegistrationInconsistent && !airlineRegistrationInvalid && !airlineRegistrationInconsistent; - - // BDS 3,0 - ACAS active resolution advisory - ELS - - int acas = data[6] & 0x7f; - int threatType = (data[7] >> 2) & 0x3; - bool bds_3_0 = ((data[4] & 0xff) == 0x30) && (acas < 48) && (threatType != 3); - - // BDS 4,0 - Selected vertical information - EHS - - bool mcpSelectedAltStatus = (data[4] >> 7) & 0x1; - int mcpSelectedAltFix = ((data[4] & 0x7f) << 5) | ((data[5] >> 3) & 0x1f); - int mcpSelectedAlt = mcpSelectedAltFix * 16; // ft - bool mcpSelectedAltInconsistent = (mcpSelectedAlt > maxAlt) || (!mcpSelectedAltStatus && (mcpSelectedAltFix != 0)); - - bool fmsSelectedAltStatus = (data[5] >> 2) & 0x1; - int fmsSelectedAltFix = ((data[5] & 0x3) << 10) | ((data[6] & 0xff) << 2) | ((data[7] >> 6) & 0x3); - int fmsSelectedAlt = fmsSelectedAltFix * 16; // ft - bool fmsSelectedAltInconsistent = (fmsSelectedAlt > maxAlt) || (!fmsSelectedAltStatus && (fmsSelectedAltFix != 0)); - - bool baroSettingStatus = (data[7] >> 5) & 0x1; - int baroSettingFix = ((data[7] & 0x1f) << 7) | ((data[8] >> 1) & 0x7f); - float baroSetting = baroSettingFix * 0.1f + 800.0f; // mb - bool baroSettingIncosistent = !baroSettingStatus && (baroSettingFix != 0); - - bool modeStatus = data[9] & 0x1; - bool vnavMode = (data[10] >> 7) & 0x1; - bool altHoldMode = (data[10] >> 6) & 0x1; - bool approachMode = (data[10] >> 5) & 0x1; - bool modeInconsistent = !modeStatus && (vnavMode || altHoldMode || approachMode); - - bool targetAltSourceStatus = (data[10] >> 2) & 0x1; - int targetAltSource = data[10] & 0x3; - bool targetAltSourceInconsistent = !targetAltSourceStatus && (targetAltSource != 0); - - bool bds_4_0 = ((data[8] & 0x01) == 0x0) && ((data[9] & 0xfe) == 0x0) && ((data[10] & 0x18) == 0x0) - && !mcpSelectedAltInconsistent && !fmsSelectedAltInconsistent && !baroSettingIncosistent && !modeInconsistent && !targetAltSourceInconsistent; - - // BDS 4,1 - Next waypoint - - bool waypointStatus = (data[4] >> 7) & 0x1; - char waypoint[10]; - c[0] = (data[4] >> 1) & 0x3f; - c[1] = ((data[4] & 0x1) << 5) | ((data[5] >> 3) & 0x1f); - c[2] = ((data[5] & 0x7) << 3) | ((data[6] >> 5) & 0x7); - c[3] = ((data[6] & 0x1f) << 1) | ((data[7] >> 7) & 0x1); - c[4] = ((data[7] >> 1) & 0x1f); - c[5] = ((data[7] & 0x1) << 5) | ((data[8] >> 3) & 0x1f); - c[6] = ((data[8] & 0x7) << 3) | ((data[9] >> 5) & 0x7); - c[7] = ((data[9] & 0x1f) << 1) | ((data[10] >> 7) & 0x1); - c[8] = ((data[10] >> 1) & 0x3f); - // Map to ASCII - for (int i = 0; i < 9; i++) { - waypoint[i] = m_idMap[c[i]]; - } - waypoint[9] = '\0'; - QString waypointString = QString(waypoint).trimmed(); - bool waypointInvalid = QString(waypointString).contains('#'); - bool waypointInconsistent = (waypointString.size() != 5) // Most navaid waypoints are 5 characters, and this prevents some incorrect matches, but is it correct? Need examples. - || (!waypointStatus && (c[0] || c[1] || c[2] || c[3] || c[4] || c[5] || c[6] || c[7] || c[8])); - - bool bds_4_1 = !waypointInvalid && !waypointInconsistent; - - // BDS 4,4 - Meteorological routine air report - MRAR - (Appendix E suggests a slightly different format in the future) - - int fomSource = (data[4] >> 4) & 0xf; - bool fomSourceInconsistent = fomSource > 4; - - bool windSpeedStatus = (data[4] >> 3) & 0x1; - int windSpeedFix = ((data[4] & 0x7) << 6) | ((data[5] >> 2) & 0x3f); - int windSpeed = windSpeedFix; // knots - int windDirectionFix = ((data[5] & 0x3) << 7) | ((data[6] >> 1) & 0x7f); - int windDirection = windDirectionFix * 180.0f / 256.0f; // Degrees - bool windSpeedInconsistent = (windSpeed > 250.0f) || (!windSpeedStatus && ((windSpeedFix != 0) || (windDirectionFix != 0))); - - int staticAirTemperatureFix = ((data[6] & 0x1) << 10) | ((data[7] & 0xff) << 2) | ((data[8] >> 6) & 0x3); - staticAirTemperatureFix = (staticAirTemperatureFix << 21) >> 21; - float staticAirTemperature = staticAirTemperatureFix * 0.25f; - bool staticAirTemperatureInconsistent = (staticAirTemperature < -80.0f) || (staticAirTemperature > 60.0f); - - bool averageStaticPressureStatus = (data[8] >> 5) & 0x1; - int averageStaticPressureFix = ((data[8] & 0x1f) << 6) | ((data[9] >> 2) & 0x3f); - int averageStaticPressure = averageStaticPressureFix; // hPa - bool averageStaticPressureInconsistent = !averageStaticPressureStatus && (averageStaticPressureFix != 0); - - bool turbulenceStatus = (data[9] >> 1) & 0x1; - int turbulence = ((data[9] & 0x1) << 1) | ((data[10] >> 7) & 0x1); - bool turbulenceInconsistent = !turbulenceStatus && (turbulence != 0); - - bool humidityStatus = (data[10] >> 6) & 0x1; - int humidityFix = data[10] & 0x3f; - float humidity = humidityFix * 100.0f / 64.0f; // % - bool humidityInconsistent = (humidity > 100.0) || (!humidityStatus && (humidityFix != 0)); - - // Occasionally get frames: 20000000000000 or 08000000000000 - these seem unlikely to be BDS 4,4 - bool noMetData = (((data[4] & 0xff) == 0x20) || ((data[4] & 0xff) == 0x08)) && !(data[5] || data[6] || data[7] || data[8] || data[9] || data[10]); - - bool bds_4_4 = !noMetData && !fomSourceInconsistent && !windSpeedInconsistent && !staticAirTemperatureInconsistent && !averageStaticPressureInconsistent && !turbulenceInconsistent && !humidityInconsistent; - - // BDS 4,5 - Meteorological hazard report - MRAR - (Appendix E suggests a slightly different format in the future) - - bool hazardTurbulenceStatus = (data[4] >> 7) & 0x1; - int hazardTurbulence = (data[4] >> 5) & 0x3; - bool hazardTurbulenceInconsistent = !hazardTurbulenceStatus && (hazardTurbulence != 0); - - bool hazardWindShearStatus = (data[4] >> 4) & 0x1; - int hazardWindShear = (data[4] >> 2) & 0x3; - bool hazardWindShearInconsistent = !hazardWindShearStatus && (hazardWindShear != 0); - - bool hazardMicroburstStatus = (data[4] >> 1) & 0x1; - int hazardMicroburst = ((data[4] & 0x1) << 1) | ((data[5] >> 7) & 0x1); - bool hazardMicroburstInconsistent = !hazardMicroburstStatus && (hazardMicroburst != 0); - - bool hazardIcingStatus = (data[5] >> 6) & 0x1; - int hazardIcing = ((data[5] >> 4) & 0x3); - bool hazardIcingInconsistent = !hazardIcingStatus && (hazardIcing != 0); - - bool hazardWakeVortexStatus = (data[5] >> 3) & 0x1; - int hazardWakeVortex = ((data[5] >> 1) & 0x3); - bool hazardWakeVortexInconsistent = !hazardWakeVortexStatus && (hazardWakeVortex != 0); - - bool hazardStaticAirTemperatureStatus = data[5] & 0x1; - int hazardStaticAirTemperatureFix = ((data[6] & 0xff) << 2) | ((data[7] >> 6) & 0x3); - hazardStaticAirTemperatureFix = (hazardStaticAirTemperatureFix << 22) >> 22; - float hazardStaticAirTemperature = hazardStaticAirTemperatureFix * 0.25f; // deg C - bool hazardStaticAirTemperatureInconsistent = (hazardStaticAirTemperature < -80.0f) || (hazardStaticAirTemperature > 60.0f) || (!hazardStaticAirTemperatureStatus && (hazardStaticAirTemperatureFix != 0)); - - bool hazardAverageStaticPressureStatus = (data[7] >> 5) & 0x1; - int hazardAverageStaticPressureFix = ((data[7] & 0x1f) << 6) | ((data[8] >> 2) & 0x3f); - int hazardAverageStaticPressure = hazardAverageStaticPressureFix; // hPa - bool hazardAverageStaticPressureInconsistent = !hazardAverageStaticPressureStatus && (hazardAverageStaticPressureFix != 0); - - bool hazardRadioHeightStatus = (data[8] >> 1) & 0x1; - int hazardRadioHeightFix = ((data[8] & 0x1) << 11) | ((data[9] & 0xff) << 3) | ((data[10] >> 5) & 0x7); - int hazardRadioHeight = hazardRadioHeightFix * 16; // Ft - bool hazardRadioHeightInconsistent = (hazardRadioHeight > maxAlt) || (!aircraft->m_onSurface && (hazardRadioHeight == 0)) || (!hazardRadioHeightStatus && (hazardRadioHeightFix != 0)); - - bool hazardReserveredInconsistent = (data[10] & 0x1f) != 0; - - bool harzardIcingTempInconsistent = hazardIcingStatus && hazardStaticAirTemperatureStatus && (hazardIcing != 0) && ((hazardStaticAirTemperature >= 20.0f) || (hazardStaticAirTemperature <= -40.0f)); - - bool bds_4_5 = !hazardTurbulenceInconsistent && !hazardWindShearInconsistent && !hazardMicroburstInconsistent && !hazardIcingInconsistent - && !hazardWakeVortexInconsistent && !hazardStaticAirTemperatureInconsistent && !hazardAverageStaticPressureInconsistent - && !hazardRadioHeightInconsistent && !hazardReserveredInconsistent && !harzardIcingTempInconsistent; - - // BDS 5,0 - Track and turn report - EHS - - bool rollAngleStatus = (data[4] >> 7) & 0x1; - int rollAngleFix = ((data[4] & 0x7f) << 3) | ((data[5] >> 5) & 0x7); - rollAngleFix = (rollAngleFix << 22) >> 22; - float rollAngle = rollAngleFix * (45.0f/256.0f); - bool rollAngleInvalid = (rollAngle < -50.0f) || (rollAngle > 50.0f); // More than 50 deg bank unlikely for airliners - bool rollAngleInconsistent = ((abs(rollAngle) >= 1.0f) && aircraft->m_onSurface) || (!rollAngleStatus && (rollAngleFix != 0)); - - bool trueTrackAngleStatus = (data[5] >> 4) & 0x1; - int trueTrackAngleFix = ((data[5] & 0xf) << 7) | ((data[6] >> 1) & 0x7f); - trueTrackAngleFix = (trueTrackAngleFix << 21) >> 21; - float trueTrackAngle = trueTrackAngleFix * (90.0f/512.0f); - if (trueTrackAngle < 0.0f) { - trueTrackAngle += 360.0f; - } - bool trueTrackAngleInconsistent = (aircraft->m_trackValid && (abs(trueTrackAngle - aircraft->m_track) > maxHeadingDiff)) // FIXME: compare to heading or track? - || (!trueTrackAngleStatus && (trueTrackAngleFix != 0)); - - bool groundSpeedStatus = data[6] & 0x1; - int groundSpeedFix = ((data[7] & 0xff) << 2) | ((data[8] >> 6) & 0x3); - int groundSpeed = groundSpeedFix * 2; - bool groundSpeedInconsistent = ((groundSpeed > 800) && (aircraft->m_emitterCategory != "High performance")) - || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - groundSpeed) > maxSpeedDiff)) - || (!groundSpeedStatus && (groundSpeedFix != 0)); - - bool trackAngleRateStatus = (data[8] >> 5) & 0x1; - int trackAngleRateFix = ((data[8] & 0x1f) << 5) | ((data[9] >> 3) & 0x1f); - trackAngleRateFix = (trackAngleRateFix << 22) >> 22; - float trackAngleRate = trackAngleRateFix * (8.0f/256.0f); - bool trackAngleRateInconsistent = !trackAngleRateStatus && (trackAngleRateFix != 0); - - bool trueAirspeedStatus = (data[9] >> 2) & 0x1; - int trueAirspeedFix = ((data[9] & 0x3) << 8) | (data[10] & 0xff); - int trueAirspeed = trueAirspeedFix * 2; - bool trueAirspeedInconsistent = ((trueAirspeed > 575) && (aircraft->m_emitterCategory != "High performance")) - || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - trueAirspeed) > maxWind+maxSpeedDiff)) - || (!trueAirspeedStatus && (trueAirspeedFix != 0)); - - bool headwindStatus = groundSpeedStatus && trueAirspeedStatus; - int headwind = trueAirspeed - groundSpeed; - bool headwindInconsistent = abs(headwind) > maxWind; - - bool bds_5_0 = !rollAngleInvalid && (!rollAngleInconsistent && !trueTrackAngleInconsistent && !groundSpeedInconsistent && !trackAngleRateInconsistent && !trueAirspeedInconsistent && !headwindInconsistent); - - // BDS 5,1 - Position report coarse - - bool positionValid = (data[4] >> 7) & 0x1; - - int latitudeFix = ((data[4] & 0x7f) << 13) | ((data[5] & 0xff) << 5) | ((data[6] >> 3) & 0x1f); - latitudeFix = (latitudeFix << 12) >> 12; - float latitude_5_1 = latitudeFix * (360.0f / 1048576.0f); - - int longitudeFix = ((data[6] & 0x7) << 17) | ((data[7] & 0xff) << 9) | ((data[8] & 0xff) << 1) | ((data[9] >> 7) & 0x1); - longitudeFix = (longitudeFix << 12) >> 12; - float longitude_5_1 = longitudeFix * (360.0f / 1048576.0f); - - bool positionInconsistent = !aircraft->m_positionValid - || (positionValid && aircraft->m_positionValid && isPositionInconsistent(latitude_5_1, longitude_5_1, aircraft->m_latitude, aircraft->m_longitude)) - || (!positionValid && ((latitudeFix != 0) || (longitudeFix != 0))); - - int pressureAltFix = ((data[9] & 0x7f) << 8) | (data[10] & 0xff); - pressureAltFix = (pressureAltFix << 17) >> 17; - int pressureAlt = pressureAltFix * 8; - bool pressureAltInconsistent = (pressureAlt > 50000) || (pressureAlt < -1000) || (positionValid && aircraft->m_altitudeValid && isAltitudeInconsistent(pressureAlt, aircraft->m_altitude)) - || (!positionValid && (pressureAltFix != 0)); - - bool bds_5_1 = !positionInconsistent && !pressureAltInconsistent; - - // BDS 5,3 - Air-referenced state vector - - bool arMagHeadingStatus = (data[4] >> 7) & 1; - int arMagHeadingFix = ((data[4] & 0x7f) << 4) | ((data[5] >> 4) & 0xf); - float arMagHeading = arMagHeadingFix * 90.0f / 512.0f; - bool arMagHeadingInconsistent = (aircraft->m_headingValid && arMagHeadingStatus && (abs(aircraft->m_heading - arMagHeading) > maxHeadingDiff)) - || (!arMagHeadingStatus && (arMagHeadingFix != 0)); - - bool arIndicatedAirspeedStatus = (data[5] >> 3) & 0x1; - int arIndicatedAirspeedFix = ((data[5] & 0x7) << 7) | ((data[6] >> 1) & 0x7f); - int arIndicatedAirspeed = arIndicatedAirspeedFix; // knots - bool arIndicatedAirspeedInconsistent = ((arIndicatedAirspeed > 550) && (aircraft->m_emitterCategory != "High performance")) - || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - arIndicatedAirspeed) > maxWind+maxSpeedDiff)) - || (aircraft->m_indicatedAirspeedValid && (abs(aircraft->m_indicatedAirspeed - arIndicatedAirspeed) > maxSpeedDiff)) - || (arIndicatedAirspeedStatus && (arIndicatedAirspeed < 100) && !aircraft->m_onSurface && (aircraft->m_emitterCategory != "Light")) - || (!arIndicatedAirspeedStatus && (arIndicatedAirspeedFix != 0)); - - bool arMachStatus = data[6] & 0x1; - int arMachFix = ((data[7] & 0xff) << 1) | ((data[8] >> 7) & 0x1); - float arMach = arMachFix * 0.008f; - bool arMachInconsistent = ((arMach >= 1.0f) && (aircraft->m_emitterCategory != "High performance")) - || (!arMachStatus && (arMachFix != 0)); - - bool arTrueAirspeedStatus = (data[8] >> 6) & 0x1; - int arTureAirspeedFix = ((data[8] & 0x3f) << 6) | ((data[9] >> 2) & 0x3f); - float arTrueAirspeed = arTureAirspeedFix * 0.5f; // knots - bool arTrueAirspeedInconsistent = ((arTrueAirspeed > 550) && (aircraft->m_emitterCategory != "High performance")) - || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - arTrueAirspeed) > maxWind+maxSpeedDiff)) - || (aircraft->m_trueAirspeedValid && (abs(aircraft->m_trueAirspeed - arTrueAirspeed) > maxSpeedDiff)) - || (arTrueAirspeedStatus && (arTureAirspeedFix < 100) && !aircraft->m_onSurface && (aircraft->m_emitterCategory != "Light")) - || (!arTrueAirspeedStatus && (arTureAirspeedFix != 0)); - - bool arAltitudeRateStatus = (data[9] >> 1) & 0x1; - int arAltitudeRateFix = ((data[9] & 0x1) << 8) | (data[10] & 0xff); - arAltitudeRateFix = (arAltitudeRateFix << 23) >> 23; // Sign extend 9-bit two's complement value - int arAltitudeRate = arAltitudeRateFix * 64; // Ft/min - bool arAltitudeRateInconsistent = (abs(arAltitudeRate) > 6000) || (!arAltitudeRateStatus && (arAltitudeRateFix != 0)); - - bool bds_5_3 = !arMagHeadingInconsistent && !arIndicatedAirspeedInconsistent && !arMachInconsistent && !arTrueAirspeedInconsistent && !arAltitudeRateInconsistent; - - // BDS 6,0 - Heading and speed report - EHS - - bool magHeadingStatus = (data[4] >> 7) & 1; - int magHeadingFix = ((data[4] & 0x7f) << 4) | ((data[5] >> 4) & 0xf); - magHeadingFix = (magHeadingFix << 21) >> 21; - float magHeading = magHeadingFix * (90.0f / 512.0f); - if (magHeading < 0.0f) { - magHeading += 360.f; - } - bool magHeadingInconsistent = (aircraft->m_headingValid && magHeadingStatus && (abs(aircraft->m_heading - magHeading) > maxHeadingDiff)) - || (!magHeadingStatus && (magHeadingFix != 0)); - - bool indicatedAirspeedStatus = (data[5] >> 3) & 0x1; - int indicatedAirspeedFix = ((data[5] & 0x7) << 7) | ((data[6] >> 1) & 0x7f); - int indicatedAirspeed = indicatedAirspeedFix; - bool indicatedAirspeedInconsistent = ((indicatedAirspeed > 550) && (aircraft->m_emitterCategory != "High performance")) - || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - indicatedAirspeed) > maxWind+maxSpeedDiff)) - || (aircraft->m_indicatedAirspeedValid && (abs(aircraft->m_indicatedAirspeed - indicatedAirspeed) > maxSpeedDiff)) - || (indicatedAirspeedStatus && (indicatedAirspeed < 100) && !aircraft->m_onSurface && (aircraft->m_emitterCategory != "Light")) - || (!indicatedAirspeedStatus && (indicatedAirspeedFix != 0)); - - bool machStatus = data[6] & 0x1; - int machFix = ((data[7] & 0xff) << 2) | ((data[8] >> 6) & 0x3); - float mach = machFix * 2.048f / 512.0f; - bool machInconsistent = ((mach >= 1.0f) && (aircraft->m_emitterCategory != "High performance")) - || (!machStatus && (machFix != 0)); - - bool baroAltRateStatus = (data[8] >> 5) & 0x1; - int baroAltRateFix = ((data[8] & 0x1f) << 5) | ((data[9] >> 3) & 0x1f); - baroAltRateFix = (baroAltRateFix << 22) >> 22; - int baroAltRate = baroAltRateFix * 32; // ft/min - bool baroAltRateInconsistent = (abs(baroAltRate) > 6000) || (aircraft->m_verticalRateValid && abs(baroAltRate - aircraft->m_verticalRate) > 2000) - || (!baroAltRateStatus && (baroAltRateFix != 0)); - - bool verticalVelStatus = (data[9] >> 2) & 0x1; - int verticalVelFix = ((data[9] & 0x3) << 8) | (data[10] & 0xff); - verticalVelFix = (verticalVelFix << 22) >> 22; - int verticalVel = verticalVelFix * 32; // ft/min - bool verticalVelInconsistent = (abs(verticalVel) > 6000) || (aircraft->m_verticalRateValid && abs(verticalVel - aircraft->m_verticalRate) > 2000) - || (!verticalVelStatus && (verticalVelFix != 0)); - - bool bds_6_0 = !magHeadingInconsistent && !indicatedAirspeedInconsistent && !machInconsistent && !baroAltRateInconsistent && !verticalVelInconsistent; - - int possibleMatches = bds_0_5 + bds_0_8 + bds_0_9 + bds_1_0 + bds_1_7 + bds_2_0 + bds_2_1 + bds_3_0 + bds_4_0 + bds_4_1 + bds_4_4 + bds_4_5 + bds_5_0 + bds_5_1 + bds_5_3 + bds_6_0; - - if (possibleMatches == 1) - { - if (bds_0_5) - { - // Only use this data if position and altitude where compared against a previous position, otherwise there's a high chance it may be wrong - if (aircraft->m_altitudeValid && aircraft->m_positionValid) - { - if (altitudeValid_0_5) { - aircraft->setAltitude(altitude_0_5, (tc >= 20) && (tc <= 22), dateTime, m_settings); - } - if (positionValid_0_5) { - updateAircraftPosition(aircraft, latitude_0_5, longitude_0_5, dateTime); - } - if (altitudeValid_0_5 && positionValid_0_5) { - aircraft->addCoordinate(dateTime, &m_aircraftModel); - } - } - } - if (bds_0_8) - { - updatedCallsign = aircraft->m_callsign != callsign_0_8; - if (updatedCallsign) { - setCallsign(aircraft, callsign_0_8); - } - } - if (bds_0_9) - { - if (groundspeedSubType) - { - if (groundspeedValid_0_9) - { - aircraft->setGroundspeed(groundspeed_0_9, m_settings); - aircraft->setTrack(track, dateTime); - } - } - else - { - if (airspeedValid_0_9) - { - if (airspeedType_0_9) { - aircraft->setTrueAirspeed(airspeed, m_settings); - } else { - aircraft->setIndicatedAirspeed(airspeed, dateTime, m_settings); - } - } - if (headingValid) { - aircraft->setHeading(heading, dateTime); - } - } - if (verticalRateValid_0_9) { - aircraft->setVerticalRate(verticalRate, m_settings); - } - } - if (bds_1_7) - { - // Some of these bits are dynamic, so can't assume that because a bit isn't set, - // that message is not ever supported - aircraft->m_bdsCapabilitiesValid = true; - aircraft->m_bdsCapabilities[0][5] |= cap_0_5; - aircraft->m_bdsCapabilities[0][6] |= cap_0_6; - aircraft->m_bdsCapabilities[0][7] |= cap_0_7; - aircraft->m_bdsCapabilities[0][8] |= cap_0_8; - aircraft->m_bdsCapabilities[0][9] |= cap_0_9; - aircraft->m_bdsCapabilities[0][10] |= cap_0_a; - aircraft->m_bdsCapabilities[2][0] |= cap_2_0; - aircraft->m_bdsCapabilities[2][1] |= cap_2_1; - aircraft->m_bdsCapabilities[4][0] |= cap_4_0; - aircraft->m_bdsCapabilities[4][1] |= cap_4_1; - aircraft->m_bdsCapabilities[4][2] |= cap_4_2; - aircraft->m_bdsCapabilities[4][3] |= cap_4_3; - aircraft->m_bdsCapabilities[4][4] |= cap_4_4; - aircraft->m_bdsCapabilities[4][5] |= cap_4_5; - aircraft->m_bdsCapabilities[4][8] |= cap_4_8; - aircraft->m_bdsCapabilities[5][0] |= cap_5_0; - aircraft->m_bdsCapabilities[5][1] |= cap_5_1; - aircraft->m_bdsCapabilities[5][2] |= cap_5_2; - aircraft->m_bdsCapabilities[5][3] |= cap_5_3; - aircraft->m_bdsCapabilities[5][4] |= cap_5_4; - aircraft->m_bdsCapabilities[5][5] |= cap_5_5; - aircraft->m_bdsCapabilities[5][6] |= cap_5_6; - aircraft->m_bdsCapabilities[5][15] |= cap_5_f; - aircraft->m_bdsCapabilities[6][0] |= cap_6_0; - } - if (bds_2_0) - { - updatedCallsign = aircraft->m_callsign != callsignTrimmed; - if (updatedCallsign) { - setCallsign(aircraft, callsignTrimmed); - } - } - if (bds_2_1) - { - qDebug() << "BDS 2,1 - " - << "ICAO:" << aircraft->m_icaoHex - << "aircraftRegistration:" << aircraftRegistrationString - << "airlineRegistration:" << airlineRegistrationString - << "m_bdsCapabilities[2][1]: " << aircraft->m_bdsCapabilities[2][1] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - - if (!aircraftRegistrationString.isEmpty()) { - aircraft->m_registrationItem->setText(aircraftRegistrationString); - } - } - if (bds_4_0) - { - // Could use targetAltSource here, but yet to see it set to anything other than unknown - if (mcpSelectedAltStatus) - { - aircraft->m_selAltitude = mcpSelectedAlt; - aircraft->m_selAltitudeValid = true; - if (m_settings.m_siUnits) { - aircraft->m_selAltitudeItem->setData(Qt::DisplayRole, Units::feetToIntegerMetres(aircraft->m_selAltitude)); - } else { - aircraft->m_selAltitudeItem->setData(Qt::DisplayRole, roundTo50Feet(aircraft->m_selAltitude)); - } - } - else if (fmsSelectedAltStatus) - { - aircraft->m_selAltitude = fmsSelectedAlt; - aircraft->m_selAltitudeValid = true; - if (m_settings.m_siUnits) { - aircraft->m_selAltitudeItem->setData(Qt::DisplayRole, Units::feetToIntegerMetres(aircraft->m_selAltitude)); - } else { - aircraft->m_selAltitudeItem->setData(Qt::DisplayRole, roundTo50Feet(aircraft->m_selAltitude)); - } - } - else - { - aircraft->m_selAltitude = 0; - aircraft->m_selAltitudeValid = false; - aircraft->m_selAltitudeItem->setText(""); - } - - if (baroSettingStatus) - { - aircraft->m_baro = baroSetting; - aircraft->m_baroValid = true; - aircraft->m_baroItem->setData(Qt::DisplayRole, std::round(aircraft->m_baro)); - updateQNH(aircraft, baroSetting); - } - - if (modeStatus) - { - QString mode = ""; - if (vnavMode) { - mode = mode + "VNAV "; - } - if (altHoldMode) { - mode = mode + "HOLD "; - } - if (approachMode) { - mode = mode + "APP "; - } - mode = mode.trimmed(); - aircraft->m_vModeItem->setText(mode); - - aircraft->m_vnavMode = vnavMode; - aircraft->m_vnavModeValid = true; - aircraft->m_altHoldMode = altHoldMode; - aircraft->m_altHoldModeValid = true; - aircraft->m_approachMode = approachMode; - aircraft->m_approachModeValid = true; - } - } - if (bds_4_1) - { - qDebug() << "BDS 4,1 - " - << "ICAO:" << aircraft->m_icaoHex - << "waypoint:" << waypointString - << "m_bdsCapabilities[4][1]: " << aircraft->m_bdsCapabilities[4][1] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - } - if (bds_4_4) - { - if (fomSource != 0) // Ignore FOM "invalid" - { - if (windSpeedStatus) - { - if (m_settings.m_siUnits) { - aircraft->m_windSpeedItem->setData(Qt::DisplayRole, Units::knotsToIntegerKPH(windSpeed)); - } else { - aircraft->m_windSpeedItem->setData(Qt::DisplayRole, windSpeed); - } - aircraft->m_windDirItem->setData(Qt::DisplayRole, windDirection); - // Not clear if air temp depends on the previous status bit - aircraft->m_staticAirTempItem->setData(Qt::DisplayRole, (int)std::round(staticAirTemperature)); - } - if (averageStaticPressureStatus) { - aircraft->m_staticPressureItem->setData(Qt::DisplayRole, averageStaticPressure); - } - if (humidityStatus) { - aircraft->m_humidityItem->setData(Qt::DisplayRole, (int)std::round(humidity)); - } - } - } - if (bds_4_5) - { - qDebug() << "BDS 4,5 - " - << "ICAO:" << aircraft->m_icaoHex - << "hazardTurbulence:" << m_hazardSeverity[hazardTurbulence] - << "hazardWindShear:" << m_hazardSeverity[hazardWindShear] - << "hazardMicroburst:" << m_hazardSeverity[hazardMicroburst] - << "hazardIcing:" << m_hazardSeverity[hazardIcing] - << "hazardWakeVortex:" << m_hazardSeverity[hazardWakeVortex] - << "hazardStaticAirTemperature:" << hazardStaticAirTemperature << "C" - << "hazardAverageStaticPressure:" << hazardAverageStaticPressure << "hPA" - << "hazardRadioHeight:" << hazardRadioHeight << "ft" - << "(Aircraft Alt: " << aircraft->m_altitude << "ft)" - << "m_bdsCapabilities[4][5]: " << aircraft->m_bdsCapabilities[4][5] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - ; - } - if (bds_5_0) - { - if (rollAngleStatus) - { - aircraft->m_roll = rollAngle; - aircraft->m_rollValid = true; - aircraft->m_rollItem->setData(Qt::DisplayRole, std::round(aircraft->m_roll)); - } - if (trueTrackAngleStatus) - { - clearOldHeading(aircraft, dateTime, trueTrackAngle); - aircraft->setTrack(trueTrackAngle, dateTime); - } - if (groundSpeedStatus) - { - aircraft->setGroundspeed(groundSpeed, m_settings); - } - if (trackAngleRateStatus) - { - aircraft->m_turnRate = trackAngleRate; - aircraft->m_turnRateValid = true; - aircraft->m_turnRateItem->setData(Qt::DisplayRole, std::round(aircraft->m_turnRate*10.0f)/10.0f); - } - if (trueAirspeedStatus) - { - aircraft->m_trueAirspeed = trueAirspeed; - aircraft->m_trueAirspeedValid = true; - if (m_settings.m_siUnits) { - aircraft->m_trueAirspeedItem->setData(Qt::DisplayRole, Units::knotsToIntegerKPH(aircraft->m_trueAirspeed)); - } else { - aircraft->m_trueAirspeedItem->setData(Qt::DisplayRole, aircraft->m_trueAirspeed); - } - } - if (headwindStatus) - { - if (m_settings.m_siUnits) { - aircraft->m_headwindItem->setData(Qt::DisplayRole, Units::knotsToIntegerKPH(headwind)); - } else { - aircraft->m_headwindItem->setData(Qt::DisplayRole, headwind); - } - } - } - if (bds_5_1) - { - // Position is specified as "coarse" (lsb = 90/131072 deg which is ~76m. CPR accuracy is 5.1m) - /*qDebug() << "BDS 5,1 - " - << "ICAO:" << aircraft->m_icaoHex - << "latitude:" << latitude_5_1 << "(ADS-B:" << aircraft->m_latitude << ") " - << "longitude:" << longitude_5_1 << "(ADS-B:" << aircraft->m_longitude << ") " - << "pressureAlt:" << pressureAlt << "(ADS-B:" << aircraft->m_altitude << ")" - << "m_bdsCapabilities[5][1]: " << aircraft->m_bdsCapabilities[5][1] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - ;*/ - } - if (bds_5_3) - { - qDebug() << "BDS 5,3 - " - << "ICAO:" << aircraft->m_icaoHex - << "arMagHeading:" << arMagHeading << "(ADS-B:" << aircraft->m_heading << ") " - << "arIndicatedAirspeed:" << arIndicatedAirspeed << "knts" << "(ADS-B GS: " << aircraft->m_groundspeed << ") " - << "arMach:" << arMach - << "arTrueAirspeed:" << arTrueAirspeed << "knts" - << "arAltitudeRate:" << arAltitudeRate << "ft/min" - << "m_bdsCapabilities[5][3]: " << aircraft->m_bdsCapabilities[5][3] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - ; - } - if (bds_6_0) - { - if (arMagHeadingStatus) { - aircraft->setHeading(magHeading, dateTime); - } - if (indicatedAirspeedStatus) - { - aircraft->m_indicatedAirspeed = indicatedAirspeed; - aircraft->m_indicatedAirspeedValid = true; - if (m_settings.m_siUnits) { - aircraft->m_indicatedAirspeedItem->setData(Qt::DisplayRole, Units::knotsToIntegerKPH(aircraft->m_indicatedAirspeed)); - } else { - aircraft->m_indicatedAirspeedItem->setData(Qt::DisplayRole, aircraft->m_indicatedAirspeed); - } - aircraft->m_indicatedAirspeedDateTime = dateTime; - } - if (machStatus) - { - aircraft->m_mach = mach; - aircraft->m_machValid = true; - aircraft->m_machItem->setData(Qt::DisplayRole, aircraft->m_mach); - } - if (verticalVelStatus) { - aircraft->setVerticalRate(verticalVel, m_settings); - } - } - - if (bds_5_0 || bds_6_0) { - calcAirTemp(aircraft); + checkList->addCheckItem(QString::number(ic), ic, Qt::Unchecked)->setBackground(brush); } - } - else if (false) // Enable to debug multiple matching frames - { - qDebug() << "DF" << df - << "matches" << possibleMatches - << "bds_0_5" << bds_0_5 - << "bds_0_8" << bds_0_8 - << "bds_0_9" << bds_0_9 - << "bds_1_0" << bds_1_0 - << "bds_1_7" << bds_1_7 - << "bds_2_0" << bds_2_0 - << "bds_2_1" << bds_2_1 - << "bds_3_0" << bds_3_0 - << "bds_4_0" << bds_4_0 - << "bds_4_1" << bds_4_1 - << "bds_4_4" << bds_4_4 - << "bds_4_5" << bds_4_5 - << "bds_5_0" << bds_5_0 - << "bds_5_1" << bds_5_1 - << "bds_5_3" << bds_5_3 - << "bds_6_0" << bds_6_0 - ; - - qDebug() << data.toHex(); - - qDebug() << (bds_0_5 ? "+" : "-") - << "BDS 0,5 - " - << "altitude:" << altitude_0_5 << "(ADS-B:" << aircraft->m_altitude << ") " - << "latitude:" << latitude_0_5 << "(ADS-B:" << aircraft->m_latitude << ") " - << "longitude:" << longitude_0_5 << "(ADS-B:" << aircraft->m_longitude << ") "; - qDebug() << (bds_0_8 ? "+" : "-") - << "BDS 0,8 - " - << "emitterCategory:" << emitterCategory << "(ADS-B:" << aircraft->m_emitterCategory << ") " - << "callsign:" << callsign_0_8 << "(ADS-B:" << aircraft->m_callsign << ") "; - qDebug() << (bds_0_9 ? "+" : "-") - << "BDS 0,9 - " - << "groundspeedSubType:" << groundspeedSubType - << "speed:" << (groundspeedSubType ? groundspeed_0_9 : airspeed) << "(ADS-B:" << (groundspeedSubType ? aircraft->m_groundspeed : (airspeedType_0_9 ? aircraft->m_trueAirspeed : aircraft->m_indicatedAirspeed)) << ") " - << "verticalRate:" << verticalRate << "(ADS-B:" << aircraft->m_verticalRate << ") "; - qDebug() << (bds_1_0 ? "+" : "-") - << "BDS 1,0 - "; - qDebug() << (bds_1_7 ? "+" : "-") - << "BDS 1,7 - " - << "ICAO:" << aircraft->m_icaoHex - << "BDS:" << caps.join(" "); - qDebug() << (bds_2_0 ? "+" : "-") - << "BDS 2,0 - " - << "ICAO:" << aircraft->m_icaoHex - << "Callsign:" << callsignTrimmed << "(ADS-B:" << aircraft->m_callsign << ") "; - qDebug() << (bds_2_1 ? "+" : "-") - << "BDS 2,1 - " - << "ICAO:" << aircraft->m_icaoHex - << "aircraftRegistration:" << aircraftRegistrationString - << "airlineRegistration:" << airlineRegistrationString - << "m_bdsCapabilities[2][1]: " << aircraft->m_bdsCapabilities[2][1] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_3_0 ? "+" : "-") - << "BDS 3,0 - "; - qDebug() << (bds_4_0 ? "+" : "-") - << "BDS 4,0 - " - << "ICAO:" << aircraft->m_icaoHex - << "mcpSelectedAlt:" << mcpSelectedAlt << "ft" - << "fmsSelectedAlt:" << fmsSelectedAlt << "ft" - << "baroSetting:" << (baroSettingStatus ? QString::number(baroSetting) : "invalid") << (baroSettingStatus ? "mb" : "") - << "vnav: " << vnavMode - << "altHold: " << altHoldMode - << "approach: " << approachMode - << "targetAltSource:" << targetAltSource - << "m_bdsCapabilities[4][0]: " << aircraft->m_bdsCapabilities[4][0] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_4_1 ? "+" : "-") - << "BDS 4,1 - " - << "ICAO:" << aircraft->m_icaoHex - << "waypoint:" << waypointString - << "m_bdsCapabilities[4][1]: " << aircraft->m_bdsCapabilities[4][1] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_4_4 ? "+" : "-") - << "BDS 4,4 - " - << "ICAO:" << aircraft->m_icaoHex - << "fomSource:" << m_fomSources[fomSource] - << "windSpeed:" << windSpeed << "knts" - << "windDirection:" << windDirection << "deg" - << "staticAirTemperature:" << staticAirTemperature << "C" - << "averageStaticPressure:" << averageStaticPressure << "hPa" - << "turbulence:" << turbulence - << "humidity:" << humidity << "%" - << "m_bdsCapabilities[4][4]: " << aircraft->m_bdsCapabilities[4][4] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_4_5 ? "+" : "-") - << "BDS 4,5 - " - << "ICAO:" << aircraft->m_icaoHex - << "hazardTurbulence:" << m_hazardSeverity[hazardTurbulence] - << "hazardWindShear:" << m_hazardSeverity[hazardWindShear] - << "hazardMicroburst:" << m_hazardSeverity[hazardMicroburst] - << "hazardIcing:" << m_hazardSeverity[hazardIcing] - << "hazardWakeVortex:" << m_hazardSeverity[hazardWakeVortex] - << "hazardStaticAirTemperature:" << hazardStaticAirTemperature << "C" - << "hazardAverageStaticPressure:" << hazardAverageStaticPressure << "hPA" - << "hazardRadioHeight:" << hazardRadioHeight << "ft" - << "m_bdsCapabilities[4][5]: " << aircraft->m_bdsCapabilities[4][5] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_5_0 ? "+" : "-") - << "BDS 5,0 - " - << "ICAO:" << aircraft->m_icaoHex - << "rollAngle:" << rollAngle - << "trueTrackAngle:" << trueTrackAngle - << "trackAngleRate: " << trackAngleRate - << "groundSpeed:" << groundSpeed - << "trueAirspeed:" << trueAirspeed - << "headwind:" << headwind - << "(ADS-B GS: " << aircraft->m_groundspeed << ")" - << "(ADS-B TAS: " << aircraft->m_trueAirspeed << ")" - << "(ADS-B heading:" << aircraft->m_heading << ")" - << "m_bdsCapabilities[5][0]: " << aircraft->m_bdsCapabilities[5][0] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_5_1 ? "+" : "-") - << "BDS 5,1 - " - << "ICAO:" << aircraft->m_icaoHex - << "latitude:" << latitude_5_1 << "(ADS-B:" << aircraft->m_latitude << ") " - << "longitude:" << longitude_5_1 << "(ADS-B:" << aircraft->m_longitude << ") " - << "pressureAlt:" << pressureAlt << "(ADS-B:" << aircraft->m_altitude << ")" - << "m_bdsCapabilities[5][1]: " << aircraft->m_bdsCapabilities[5][1] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_5_3 ? "+" : "-") - << "BDS 5,3 - " - << "ICAO:" << aircraft->m_icaoHex - << "arMagHeading:" << arMagHeading << "(ADS-B:" << aircraft->m_heading << ") " - << "arIndicatedAirspeed:" << arIndicatedAirspeed << "knts" << "(ADS-B GS: " << aircraft->m_groundspeed << ") " - << "arMach:" << arMach - << "arTrueAirspeed:" << arTrueAirspeed << "knts" - << "arAltitudeRate:" << arAltitudeRate << "ft/min" - << "arMagHeadingInconsistent" << arMagHeadingInconsistent << "arIndicatedAirspeedInconsistent" << arIndicatedAirspeedInconsistent << "arMachInconsistent" << arMachInconsistent << "arTrueAirspeedInconsistent" << arTrueAirspeedInconsistent - << "m_bdsCapabilities[5][3]: " << aircraft->m_bdsCapabilities[5][3] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; - qDebug() << (bds_6_0 ? "+" : "-") - << "BDS 6,0 - " - << "ICAO:" << aircraft->m_icaoHex - << "magHeading:" << magHeading << "(ADS-B:" << aircraft->m_heading << ") " - << "indicatedAirspeed:" << indicatedAirspeed << "knts" << "(ADS-B GS: " << aircraft->m_groundspeed << ") " - << "mach:" << mach - << "baroAltRate:" << baroAltRate << "ft/min" - << "verticalVel:" << verticalVel << "ft/min" - << "magHeadingInconsistent " << magHeadingInconsistent << "indicatedAirspeedInconsistent" << indicatedAirspeedInconsistent << "machInconsistent" << machInconsistent << "baroAltRateInconsistent" << baroAltRateInconsistent << "verticalVelInconsistent" << verticalVelInconsistent - << "m_bdsCapabilities[6][0]: " << aircraft->m_bdsCapabilities[6][0] - << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + checkList->setSortRole(Qt::UserRole + 1); // Sort via data rather than label + checkList->model()->sort(0, Qt::AscendingOrder); } } } -QList * ADSBDemodGUI::animate(QDateTime dateTime, Aircraft *aircraft) +void ADSBDemodGUI::Interogator::calcPoly() { - QList *animations = new QList(); - - const int gearDownSpeed = 150; - const int gearUpAltitude = 200; - const int gearUpVerticalRate = 1000; - const int accelerationHeight = 1500; - const int flapsRetractAltitude = 2000; - const int flapsCleanSpeed = 200; + double w = (m_maxLongitude - m_minLongitude) / 2.0; + double h = (m_maxLatitude - m_minLatitude) / 2.0; + double x = m_minLongitude + w; + double y = m_minLatitude + h; + m_airspace.m_center.setX(x); + m_airspace.m_center.setY(y); + m_airspace.m_position = m_airspace.m_center; - bool debug = false; + const int s = 15; + m_airspace.m_polygon.resize(360/s+1); - // Landing gear should be down when on surface - // Check speed in case we get a mixture of surface and airborne positions - // during take-off - if ( aircraft->m_onSurface - && !aircraft->m_gearDown - && ( (aircraft->m_groundspeedValid && (aircraft->m_groundspeed < 80)) - || !aircraft->m_groundspeedValid - ) - ) + for (int d = 0, i = 0; d <= 360; d += s, i++) { - if (debug) { - qDebug() << "Gear down as on surface " << aircraft->m_icaoHex; - } - animations->append(gearAnimation(dateTime, false)); - animations->append(gearAngle(dateTime, true)); - aircraft->m_gearDown = true; - } + double a = Units::degreesToRadians((double) d); + double r1 = cos(a) * w; + double r2 = sin(a) * h; - // Flaps when on the surface - if (aircraft->m_onSurface && aircraft->m_groundspeedValid) - { - if ((aircraft->m_groundspeed <= 20) && (aircraft->m_flaps != 0.0)) - { - // No flaps when stationary / taxiing - if (debug) { - qDebug() << "Parking flaps " << aircraft->m_icaoHex; - } - animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.0)); - animations->append(slatsAnimation(dateTime, true)); - aircraft->m_flaps = 0.0; - } - else if ((aircraft->m_groundspeed >= 30) && (aircraft->m_flaps < 0.25)) - { - // Flaps for takeoff - if (debug) { - qDebug() << "Takeoff flaps " << aircraft->m_icaoHex; - } - animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.25)); - animations->append(slatsAnimation(dateTime, false)); - aircraft->m_flaps = 0.25; - } + m_airspace.m_polygon[i] = QPointF(x + r1, y + r2); } +} - // Pitch up on take-off - if ( aircraft->m_gearDown - && !aircraft->m_onSurface - && ( (aircraft->m_verticalRateValid && (aircraft->m_verticalRate > 300)) - || (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + gearUpAltitude/2))) - ) - ) - { - if (debug) { - qDebug() << "Pitch up " << aircraft->m_icaoHex; - } - aircraft->m_pitchEst = 5.0; - animations->append(gearAngle(dateTime, false)); - } - - // Retract landing gear after take-off - if ( aircraft->m_gearDown - && !aircraft->m_onSurface - && ( (aircraft->m_verticalRateValid && (aircraft->m_verticalRate > 1000)) - || (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + gearUpAltitude))) - ) - ) - { - if (debug) { - qDebug() << "Gear up " << aircraft->m_icaoHex - << " VR " << (aircraft->m_verticalRateValid && (aircraft->m_verticalRate > gearUpVerticalRate)) - << " Alt " << (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + gearUpAltitude))) - << "m_altitude " << aircraft->m_altitude << " aircraft->m_runwayAltitude " << aircraft->m_runwayAltitude; - } - aircraft->m_pitchEst = 10.0; - animations->append(gearAnimation(dateTime.addSecs(2), true)); - aircraft->m_gearDown = false; - } - // Reduce pitch at acceleration height - if ( (aircraft->m_flaps > 0.0) - && (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + accelerationHeight))) - ) - { - aircraft->m_pitchEst = 5.0; - } - // Retract flaps/slats after take-off - // Should be after acceleration altitude (1500-3000ft AAL) - // And before max speed for flaps is reached (215knt for A320, 255KIAS for 777) - if ( (aircraft->m_flaps > 0.0) - && ( (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + flapsRetractAltitude))) - || (aircraft->m_groundspeedValid && (aircraft->m_groundspeed > flapsCleanSpeed)) - ) - ) - { - if (debug) { - qDebug() << "Retract flaps " << aircraft->m_icaoHex - << " Spd " << (aircraft->m_groundspeedValid && (aircraft->m_groundspeed > flapsCleanSpeed)) - << " Alt " << (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + flapsRetractAltitude))); - } - animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.0)); - animations->append(slatsAnimation(dateTime, true)); - aircraft->m_flaps = 0.0; - // Clear runway information - aircraft->m_runwayAltitudeValid = false; - aircraft->m_runwayAltitude = 0.0; - } - - // Extend flaps for approach and landing - // We don't know airport elevation, so just base on speed and descent rate - // Vertical rate can go negative during take-off, so we check m_runwayAltitudeValid - if (!aircraft->m_onSurface - && !aircraft->m_runwayAltitudeValid - && (aircraft->m_verticalRateValid && (aircraft->m_verticalRate < 0)) - && aircraft->m_groundspeedValid - ) - { - if ((aircraft->m_groundspeed < flapsCleanSpeed) && (aircraft->m_flaps < 0.25)) - { - // Extend flaps for approach - if (debug) { - qDebug() << "Extend flaps for approach" << aircraft->m_icaoHex; - } - animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.25)); - //animations->append(slatsAnimation(dateTime, false)); - aircraft->m_flaps = 0.25; - aircraft->m_pitchEst = 1.0; - } - } - // Gear down for landing - // We don't know airport elevation, so base on speed and descent rate - if (!aircraft->m_gearDown - && !aircraft->m_onSurface - && !aircraft->m_runwayAltitudeValid - && (aircraft->m_verticalRateValid && (aircraft->m_verticalRate < 100)) - && ( (aircraft->m_groundspeedValid && (aircraft->m_groundspeed < gearDownSpeed)) - || (aircraft->m_altitudeValid && (aircraft->m_altitude < 2000)) - ) - ) - { - if (debug) { - qDebug() << "Flaps/Gear down for landing " << aircraft->m_icaoHex; - } - animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.5)); - animations->append(slatsAnimation(dateTime, false)); - animations->append(gearAnimation(dateTime.addSecs(8), false)); - animations->append(flapsAnimation(dateTime.addSecs(16), 0.5, 1.0)); - aircraft->m_gearDown = true; - aircraft->m_flaps = 1.0; - aircraft->m_pitchEst = 3.0; - } - // Engine control - if (aircraft->m_emitterCategory == "Rotorcraft") - { - // Helicopter rotors - if (!aircraft->m_rotorStarted && !aircraft->m_onSurface) - { - // Start rotors - if (debug) { - qDebug() << "Start rotors " << aircraft->m_icaoHex; - } - animations->append(rotorAnimation(dateTime, false)); - aircraft->m_rotorStarted = true; - } - else if (aircraft->m_rotorStarted && aircraft->m_onSurface) - { - if (debug) { - qDebug() << "Stop rotors " << aircraft->m_icaoHex; - } - animations->append(rotorAnimation(dateTime, true)); - aircraft->m_rotorStarted = false; - } - } - else - { - // Propellors/fans - if (!aircraft->m_engineStarted && aircraft->m_groundspeedValid && (aircraft->m_groundspeed > 0)) - { - if (debug) { - qDebug() << "Start engines " << aircraft->m_icaoHex; - } - animations->append(engineAnimation(dateTime, 1, false)); - animations->append(engineAnimation(dateTime, 2, false)); - aircraft->m_engineStarted = true; - } - else if (aircraft->m_engineStarted && aircraft->m_groundspeedValid && (aircraft->m_groundspeed == 0)) - { - if (debug) { - qDebug() << "Stop engines " << aircraft->m_icaoHex; - } - animations->append(engineAnimation(dateTime, 1, true)); - animations->append(engineAnimation(dateTime, 2, true)); - aircraft->m_engineStarted = false; - } - } - // Estimate pitch, so it looks a little more realistic - if (aircraft->m_onSurface) - { - // Check speed so we don't set pitch to 0 immediately on touch-down - // Should probably record time of touch-down and reduce over time - if (aircraft->m_groundspeedValid) - { - if (aircraft->m_groundspeed < 80) { - aircraft->m_pitchEst = 0.0; - } else if ((aircraft->m_groundspeed < 130) && (aircraft->m_pitchEst >= 2)) { - aircraft->m_pitchEst = 1; - } - } - } - else if ((aircraft->m_flaps < 0.25) && aircraft->m_verticalRateValid) - { - // In climb/descent - aircraft->m_pitchEst = std::abs(aircraft->m_verticalRate / 400.0); - } - // Estimate some roll - if (aircraft->m_onSurface - || (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude < (aircraft->m_runwayAltitude + accelerationHeight)))) - { - aircraft->m_rollEst = 0.0; - } - else if (aircraft->m_trackValid) - { - // Really need to use more data points for this - or better yet, get it from Mode-S frames - if (aircraft->m_prevTrackDateTime.isValid()) - { - qint64 msecs = aircraft->m_prevTrackDateTime.msecsTo(aircraft->m_headingDateTime); - if (msecs > 0) - { - float trackDiff = fmod(aircraft->m_track - aircraft->m_prevTrack + 540.0, 360.0) - 180.0; - float roll = trackDiff / (msecs / 1000.0); - //qDebug() << "Track Diff " << trackDiff << " msecs " << msecs << " roll " << roll; - roll = std::min(roll, 15.0f); - roll = std::max(roll, -15.0f); - aircraft->m_rollEst = roll; - } - } - aircraft->m_prevTrackDateTime = aircraft->m_trackDateTime; - aircraft->m_prevTrack = aircraft->m_track; - } - return animations; -} -SWGSDRangel::SWGMapAnimation *ADSBDemodGUI::gearAnimation(QDateTime startDateTime, bool up) -{ - // Gear up (0.0) / down (1.0) - SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); - animation->setName(new QString("libxplanemp/controls/gear_ratio")); - animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); - animation->setReverse(up); - animation->setLoop(0); - animation->setDuration(5); - animation->setMultiplier(0.2f); - return animation; -} -SWGSDRangel::SWGMapAnimation *ADSBDemodGUI::gearAngle(QDateTime startDateTime, bool flat) -{ - // Gear deflection - on ground it should be flat (0.0) in the air at an angle (1.0) - SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); - animation->setName(new QString("libxplanemp/gear/tire_vertical_deflection_mtr")); - animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); - animation->setReverse(flat); - animation->setLoop(0); - animation->setDuration(1); - animation->setMultiplier(1); - return animation; -} -SWGSDRangel::SWGMapAnimation *ADSBDemodGUI::flapsAnimation(QDateTime startDateTime, float currentFlaps, float flaps) -{ - // Extend / retract flags - bool retract = flaps < currentFlaps; - SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); - animation->setName(new QString("libxplanemp/controls/flap_ratio")); - animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); - animation->setReverse(retract); - animation->setLoop(0); - animation->setDuration(5*std::abs(flaps-currentFlaps)); - animation->setMultiplier(0.2f); - if (retract) { - animation->setStartOffset(1.0 - currentFlaps); - } else { - animation->setStartOffset(currentFlaps); - } - return animation; -} -SWGSDRangel::SWGMapAnimation *ADSBDemodGUI::slatsAnimation(QDateTime startDateTime, bool retract) -{ - // Extend / retract slats - SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); - animation->setName(new QString("libxplanemp/controls/slat_ratio")); - animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); - animation->setReverse(retract); - animation->setLoop(0); - animation->setDuration(5); - animation->setMultiplier(0.2f); - return animation; -} -SWGSDRangel::SWGMapAnimation *ADSBDemodGUI::rotorAnimation(QDateTime startDateTime, bool stop) -{ - // Turn rotors in helicopter.glb model - SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); - animation->setName(new QString("Take 001")); - animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); - animation->setReverse(false); - animation->setLoop(true); - animation->setMultiplier(1); - animation->setStop(stop); - return animation; -} -SWGSDRangel::SWGMapAnimation *ADSBDemodGUI::engineAnimation(QDateTime startDateTime, int engine, bool stop) -{ - // Turn propellors - SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); - animation->setName(new QString(QString("libxplanemp/engines/engine_rotation_angle_deg%1").arg(engine))); - animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); - animation->setReverse(false); - animation->setLoop(true); - animation->setMultiplier(1); - animation->setStop(stop); - return animation; -} -void ADSBDemodGUI::checkStaticNotification(Aircraft *aircraft) -{ - for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) - { - QString match; - switch (m_settings.m_notificationSettings[i]->m_matchColumn) - { - case ADSB_COL_ICAO: - match = aircraft->m_icaoItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_MODEL: - match = aircraft->m_modelItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_TYPE: - match = aircraft->m_typeItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_REGISTRATION: - match = aircraft->m_registrationItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_MANUFACTURER: - match = aircraft->m_manufacturerNameItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_OWNER: - match = aircraft->m_ownerItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_OPERATOR_ICAO: - match = aircraft->m_operatorICAOItem->data(Qt::DisplayRole).toString(); - break; - default: - break; - } - if (!match.isEmpty()) - { - if (m_settings.m_notificationSettings[i]->m_regularExpression.isValid()) - { - if (m_settings.m_notificationSettings[i]->m_regularExpression.match(match).hasMatch()) - { - highlightAircraft(aircraft); - if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) { - speechNotification(aircraft, m_settings.m_notificationSettings[i]->m_speech); - } - if (!m_settings.m_notificationSettings[i]->m_command.isEmpty()) { - commandNotification(aircraft, m_settings.m_notificationSettings[i]->m_command); - } - if (m_settings.m_notificationSettings[i]->m_autoTarget) { - targetAircraft(aircraft); - } - aircraft->m_notified = true; - } - } - } - } -} -void ADSBDemodGUI::checkDynamicNotification(Aircraft *aircraft) -{ - if (!aircraft->m_notified) - { - for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) - { - if ( (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_CALLSIGN) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_ALTITUDE) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_GROUND_SPEED) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_RANGE) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_CATEGORY) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_STATUS) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_SQUAWK) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_DEP) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_ARR) - || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_STOPS) - ) - { - QString match; - switch (m_settings.m_notificationSettings[i]->m_matchColumn) - { - case ADSB_COL_CALLSIGN: - match = aircraft->m_callsignItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_ALTITUDE: - match = aircraft->m_altitudeItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_GROUND_SPEED: - match = aircraft->m_groundspeedItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_RANGE: - match = aircraft->m_rangeItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_CATEGORY: - match = aircraft->m_emitterCategoryItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_STATUS: - match = aircraft->m_statusItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_SQUAWK: - match = aircraft->m_squawkItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_DEP: - match = aircraft->m_depItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_ARR: - match = aircraft->m_arrItem->data(Qt::DisplayRole).toString(); - break; - case ADSB_COL_STOPS: - match = aircraft->m_stopsItem->data(Qt::DisplayRole).toString(); - break; - default: - break; - } - if (!match.isEmpty()) - { - if (m_settings.m_notificationSettings[i]->m_regularExpression.isValid()) - { - if (m_settings.m_notificationSettings[i]->m_regularExpression.match(match).hasMatch()) - { - highlightAircraft(aircraft); - if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) { - speechNotification(aircraft, m_settings.m_notificationSettings[i]->m_speech); - } - if (!m_settings.m_notificationSettings[i]->m_command.isEmpty()) { - commandNotification(aircraft, m_settings.m_notificationSettings[i]->m_command); - } - if (m_settings.m_notificationSettings[i]->m_autoTarget) { - targetAircraft(aircraft); - } - aircraft->m_notified = true; - } - } - } - } - } - } -} -// Initialise text to speech engine -// This takes 10 seconds on some versions of Linux, so only do it, if user actually -// has speech notifications configured void ADSBDemodGUI::enableSpeechIfNeeded() { #ifdef QT_TEXTTOSPEECH_FOUND @@ -5246,11 +1055,11 @@ void ADSBDemodGUI::enableSpeechIfNeeded() #endif } -void ADSBDemodGUI::speechNotification(Aircraft *aircraft, const QString &speech) +void ADSBDemodGUI::speechRequest(const QString &speech) { #ifdef QT_TEXTTOSPEECH_FOUND if (m_speech) { - m_speech->say(subAircraftString(aircraft, speech)); + m_speech->say(speech); } else { qWarning() << "ADSBDemodGUI::speechNotification: Unable to say " << speech; } @@ -5259,86 +1068,7 @@ void ADSBDemodGUI::speechNotification(Aircraft *aircraft, const QString &speech) #endif } -void ADSBDemodGUI::commandNotification(Aircraft *aircraft, const QString &command) -{ -#if QT_CONFIG(process) - QString commandLine = subAircraftString(aircraft, command); - QStringList allArgs = QProcess::splitCommand(commandLine); - - if (allArgs.size() > 0) - { - QString program = allArgs[0]; - allArgs.pop_front(); - QProcess::startDetached(program, allArgs); - } -#else - qWarning() << "ADSBDemodGUI::commandNotification: QProcess not supported. Can't run: " << command; -#endif -} -QString ADSBDemodGUI::subAircraftString(Aircraft *aircraft, const QString &string) -{ - QString s = string; - s = s.replace("${icao}", aircraft->m_icaoItem->data(Qt::DisplayRole).toString()); - s = s.replace("${callsign}", aircraft->m_callsignItem->data(Qt::DisplayRole).toString()); - s = s.replace("${aircraft}", aircraft->m_modelItem->data(Qt::DisplayRole).toString()); - s = s.replace("${type}", aircraft->m_typeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${speed}", aircraft->m_groundspeedItem->data(Qt::DisplayRole).toString()); // For backwards compatibility - s = s.replace("${gs}", aircraft->m_groundspeedItem->data(Qt::DisplayRole).toString()); - s = s.replace("${tas}", aircraft->m_trueAirspeedItem->data(Qt::DisplayRole).toString()); - s = s.replace("${ias}", aircraft->m_indicatedAirspeedItem->data(Qt::DisplayRole).toString()); - s = s.replace("${mach}", aircraft->m_machItem->data(Qt::DisplayRole).toString()); - s = s.replace("${selAltitude}", aircraft->m_selAltitudeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${altitude}", aircraft->m_altitudeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${verticalRate}", aircraft->m_verticalRateItem->data(Qt::DisplayRole).toString()); - s = s.replace("${selHeading}", aircraft->m_selHeadingItem->data(Qt::DisplayRole).toString()); - s = s.replace("${heading}", aircraft->m_headingItem->data(Qt::DisplayRole).toString()); - s = s.replace("${track}", aircraft->m_trackItem->data(Qt::DisplayRole).toString()); - s = s.replace("${turnRate}", aircraft->m_turnRateItem->data(Qt::DisplayRole).toString()); - s = s.replace("${roll}", aircraft->m_rollItem->data(Qt::DisplayRole).toString()); - s = s.replace("${range}", aircraft->m_rangeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${azel}", aircraft->m_azElItem->data(Qt::DisplayRole).toString()); - s = s.replace("${category}", aircraft->m_emitterCategoryItem->data(Qt::DisplayRole).toString()); - s = s.replace("${status}", aircraft->m_statusItem->data(Qt::DisplayRole).toString()); - s = s.replace("${squawk}", aircraft->m_squawkItem->data(Qt::DisplayRole).toString()); - s = s.replace("${ident}", aircraft->m_identItem->data(Qt::DisplayRole).toString()); - s = s.replace("${registration}", aircraft->m_registrationItem->data(Qt::DisplayRole).toString()); - s = s.replace("${manufacturer}", aircraft->m_manufacturerNameItem->data(Qt::DisplayRole).toString()); - s = s.replace("${owner}", aircraft->m_ownerItem->data(Qt::DisplayRole).toString()); - s = s.replace("${operator}", aircraft->m_operatorICAOItem->data(Qt::DisplayRole).toString()); - s = s.replace("${ap}", aircraft->m_apItem->data(Qt::DisplayRole).toString()); - s = s.replace("${vMode}", aircraft->m_vModeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${lMode}", aircraft->m_lModeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${tcas}", aircraft->m_tcasItem->data(Qt::DisplayRole).toString()); - s = s.replace("${acas}", aircraft->m_acasItem->data(Qt::DisplayRole).toString()); - s = s.replace("${ra}", aircraft->m_raItem->data(Qt::DisplayRole).toString()); - s = s.replace("${maxSpeed}", aircraft->m_maxSpeedItem->data(Qt::DisplayRole).toString()); - s = s.replace("${version}", aircraft->m_versionItem->data(Qt::DisplayRole).toString()); - s = s.replace("${length}", aircraft->m_lengthItem->data(Qt::DisplayRole).toString()); - s = s.replace("${width}", aircraft->m_widthItem->data(Qt::DisplayRole).toString()); - s = s.replace("${baro}", aircraft->m_baroItem->data(Qt::DisplayRole).toString()); - s = s.replace("${headwind}", aircraft->m_headwindItem->data(Qt::DisplayRole).toString()); - s = s.replace("${windSpeed}", aircraft->m_windSpeedItem->data(Qt::DisplayRole).toString()); - s = s.replace("${windDirection}", aircraft->m_windDirItem->data(Qt::DisplayRole).toString()); - s = s.replace("${staticPressure}", aircraft->m_staticPressureItem->data(Qt::DisplayRole).toString()); - s = s.replace("${staticAirTemperature}", aircraft->m_staticAirTempItem->data(Qt::DisplayRole).toString()); - s = s.replace("${humidity}", aircraft->m_humidityItem->data(Qt::DisplayRole).toString()); - s = s.replace("${latitude}", aircraft->m_latitudeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${longitude}", aircraft->m_longitudeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${ic}", aircraft->m_interogatorCodeItem->data(Qt::DisplayRole).toString()); - s = s.replace("${rssi}", aircraft->m_rssiItem->data(Qt::DisplayRole).toString()); - s = s.replace("${flightstatus}", aircraft->m_flightStatusItem->data(Qt::DisplayRole).toString()); - s = s.replace("${departure}", aircraft->m_depItem->data(Qt::DisplayRole).toString()); - s = s.replace("${arrival}", aircraft->m_arrItem->data(Qt::DisplayRole).toString()); - s = s.replace("${stops}", aircraft->m_stopsItem->data(Qt::DisplayRole).toString()); - s = s.replace("${std}", aircraft->m_stdItem->data(Qt::DisplayRole).toString()); - s = s.replace("${etd}", aircraft->m_etdItem->data(Qt::DisplayRole).toString()); - s = s.replace("${atd}", aircraft->m_atdItem->data(Qt::DisplayRole).toString()); - s = s.replace("${sta}", aircraft->m_staItem->data(Qt::DisplayRole).toString()); - s = s.replace("${eta}", aircraft->m_etaItem->data(Qt::DisplayRole).toString()); - s = s.replace("${ata}", aircraft->m_ataItem->data(Qt::DisplayRole).toString()); - return s; -} bool ADSBDemodGUI::handleMessage(const Message& message) { @@ -5361,18 +1091,6 @@ bool ADSBDemodGUI::handleMessage(const Message& message) updateAbsoluteCenterFrequency(); return true; } - else if (ADSBDemodReport::MsgReportADSB::match(message)) - { - ADSBDemodReport::MsgReportADSB& report = (ADSBDemodReport::MsgReportADSB&) message; - handleADSB( - report.getData(), - report.getDateTime(), - report.getPreambleCorrelation(), - report.getCorrelationOnes(), - report.getCRC(), - true); - return true; - } else if (ADSBDemodReport::MsgReportDemodStats::match(message)) { ADSBDemodReport::MsgReportDemodStats& report = (ADSBDemodReport::MsgReportDemodStats&) message; @@ -5390,7 +1108,6 @@ bool ADSBDemodGUI::handleMessage(const Message& message) ui->statsTable->item(TYPE_FAILS, 0)->setData(Qt::DisplayRole, stats.m_typeFails); ui->statsTable->item(INVALID_FAILS, 0)->setData(Qt::DisplayRole, stats.m_invalidFails); ui->statsTable->item(ICAO_FAILS, 0)->setData(Qt::DisplayRole, stats.m_icaoFails); - ui->statsTable->item(AVERAGE_CORRELATION, 0)->setData(Qt::DisplayRole, QString::number(CalcDb::dbPower(m_correlationAvg.instantAverage()), 'f', 1)); return true; } else if (ADSBDemod::MsgConfigureADSBDemod::match(message)) @@ -5494,7 +1211,6 @@ void ADSBDemodGUI::on_feed_clicked(bool checked) m_settings.m_feedEnabled = checked; // Don't disable host/port - so they can be entered before connecting applySetting("feedEnabled"); - applyImportSettings(); } void ADSBDemodGUI::on_notifications_clicked() @@ -5502,68 +1218,222 @@ void ADSBDemodGUI::on_notifications_clicked() ADSBDemodNotificationDialog dialog(&m_settings); if (dialog.exec() == QDialog::Accepted) { - enableSpeechIfNeeded(); - applySetting("notificationSettings"); + enableSpeechIfNeeded(); + applySetting("notificationSettings"); + } +} + +void ADSBDemodGUI::on_flightInfo_clicked() +{ + if (!m_settings.m_aviationstackAPIKey.isEmpty()) + { + // Selection mode is single, so only a single row should be returned + QModelIndexList indexList = ui->adsbData->selectionModel()->selectedRows(); + if (!indexList.isEmpty()) + { + Aircraft *aircraft = aircraftForViewRow(indexList.at(0).row()); + if (aircraft) + { + if (!aircraft->m_flight.isEmpty()) + { + // Download flight information + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "requestFlightInformation", + Qt::QueuedConnection, Q_ARG(QString, aircraft->m_flight)); + } + else + { + qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No flight number for selected aircraft"; + } + } + else + { + qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No aircraft for the selected row"; + } + } + else + { + qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No aircraft selected"; + } + } + else + { + qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No flight information service - have you set an API key?"; + } +} + +// Find highlighted aircraft on Map Feature +void ADSBDemodGUI::on_findOnMapFeature_clicked() +{ + QModelIndexList indexList = ui->adsbData->selectionModel()->selectedRows(); + if (!indexList.isEmpty()) + { + Aircraft *aircraft = aircraftForViewRow(indexList.at(0).row()); + if (aircraft) { + FeatureWebAPIUtils::mapFind(mapItemName(aircraft)); + } + } +} + +void ADSBDemodGUI::on_deleteAircraft_clicked() +{ + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "deleteAllAircraft", Qt::QueuedConnection); +} + +// Take an aircraft out of the table and off the map. The tracker decides when +void ADSBDemodGUI::removeAircraft(QHash::iterator& i, Aircraft *aircraft) +{ + if (m_trackAircraft == aircraft) + { + m_adsbDemod->clearTarget(); + m_trackAircraft = nullptr; + } + if (m_highlightAircraft == aircraft) { + m_highlightAircraft = nullptr; + } + + m_aircraftModel.removeAircraft(aircraft); + m_aircraftTableModel.removeAircraft(aircraft); + i = m_aircraft.erase(i); + delete aircraft; +} + +// Everything the tracker decoded since the last flush +void ADSBDemodGUI::aircraftUpdated(const QList& updates) +{ + PROFILER_START(); + ui->adsbData->setUpdatesEnabled(false); + + for (const auto& update : updates) + { + const int icao = update.m_state.m_icao; + Aircraft *aircraft = m_aircraft.value(icao, nullptr); + bool isNew = false; + + if (!aircraft) + { + aircraft = new Aircraft(this); + m_aircraft.insert(icao, aircraft); + isNew = true; + } + + const bool hadPosition = aircraft->m_positionValid; + const bool trailCleared = update.m_state.m_trailCleared; + const bool positionChanged = update.m_state.m_positionChanged; + + // Copy the decoded state over, leaving the display state alone + *static_cast(aircraft) = update.m_state; + + if (isNew) + { + m_aircraftTableModel.addAircraft(aircraft); + if (m_settings.m_autoResizeTableColumns) { + ui->adsbData->resizeColumnsToContents(); + } + } + + if (trailCleared) { + aircraft->clearCoordinates(&m_aircraftModel); + } + if (!aircraft->m_positionUpdates.isEmpty()) + { + for (const ADSBAircraftPosition& position : aircraft->m_positionUpdates) { + aircraft->addCoordinate(position, &m_aircraftModel); + } + aircraft->m_positionUpdates.clear(); + } + else if (positionChanged) + { + // Compatibility fallback for a position update without a sample. + aircraft->addCoordinate( + ADSBAircraftPosition( + aircraft->m_latitude, + aircraft->m_longitude, + aircraft->m_altitude, + aircraft->m_positionDateTime), + &m_aircraftModel); + } + + if (aircraft->m_positionValid) + { + if (!hadPosition) { + m_aircraftModel.addAircraft(aircraft); + } else { + m_aircraftModel.aircraftUpdated(aircraft); + } + } + + // The interrogator coverage boxes are drawn from the aircraft positions + const QVariant ic = aircraft->cell(ADSB_COL_IC); + if (!ic.isNull() && (ic.toInt() > 0)) { + m_interogators[ic.toInt() - 1].update(ic.toInt(), aircraft, &m_airspaceModel, ui->ic, m_settings.m_displayIC[ic.toInt() - 1]); + } + } + + m_aircraftTableModel.flushDirty(); + ui->adsbData->setUpdatesEnabled(true); + PROFILER_STOP("ADS-B table update"); +} + +void ADSBDemodGUI::aircraftRemoved(const QList& icaos) +{ + for (quint32 icao : icaos) + { + QHash::iterator i = m_aircraft.find((int) icao); + if (i != m_aircraft.end()) { + removeAircraft(i, i.value()); + } } } -void ADSBDemodGUI::on_flightInfo_clicked() +void ADSBDemodGUI::statsUpdated(const QHash& stats) { - if (m_flightInformation) + for (auto i = stats.begin(); i != stats.end(); ++i) { - // Selection mode is single, so only a single row should be returned - QModelIndexList indexList = ui->adsbData->selectionModel()->selectedRows(); - if (!indexList.isEmpty()) - { - int row = indexList.at(0).row(); - int icao = ui->adsbData->item(row, 0)->text().toInt(nullptr, 16); - if (m_aircraft.contains(icao)) - { - Aircraft *aircraft = m_aircraft.value(icao); - if (!aircraft->m_flight.isEmpty()) - { - // Download flight information - m_flightInformation->getFlightInformation(aircraft->m_flight); - } - else - { - qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No flight number for selected aircraft"; - } - } - else - { - qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No aircraft with icao " << icao; - } - } - else - { - qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No aircraft selected"; + if ((i.key() >= 0) && (i.key() < ui->statsTable->rowCount())) { + ui->statsTable->item(i.key(), 0)->setData(Qt::DisplayRole, i.value()); } } - else +} + +void ADSBDemodGUI::coverageUpdated(int band, const QVector& polygon) +{ + if ((band >= 0) && (band < 2)) { - qDebug() << "ADSBDemodGUI::on_flightInfo_clicked - No flight information service - have you set an API key?"; + m_coverageAirspace[band].m_polygon = polygon; + m_airspaceModel.airspaceUpdated(&m_coverageAirspace[band]); } } -// Find highlighted aircraft on Map Feature -void ADSBDemodGUI::on_findOnMapFeature_clicked() +void ADSBDemodGUI::qnhEstimate(int qnh) { - QModelIndexList indexList = ui->adsbData->selectionModel()->selectedRows(); - if (!indexList.isEmpty()) - { - int row = indexList.at(0).row(); - QString icao = ui->adsbData->item(row, 0)->text(); - FeatureWebAPIUtils::mapFind(icao); + if (!m_settings.m_manualQNH) { + ui->qnh->setValue(qnh); } } -void ADSBDemodGUI::on_deleteAircraft_clicked() +void ADSBDemodGUI::highlightRequest(quint32 icao) +{ + Aircraft *aircraft = findAircraft(icao); + if (aircraft) { + highlightAircraft(aircraft); + } +} + +void ADSBDemodGUI::targetRequest(quint32 icao) { - QHash::iterator i = m_aircraft.begin(); + Aircraft *aircraft = findAircraft(icao); + if (aircraft) { + targetAircraft(aircraft); + } +} - while (i != m_aircraft.end()) { - removeAircraft(i, i.value()); +void ADSBDemodGUI::photoRefresh(quint32 icao) +{ + Aircraft *aircraft = findAircraft(icao); + if (aircraft && (aircraft == m_highlightAircraft)) + { + updatePhotoText(aircraft); + updatePhotoFlightInformation(aircraft); } } @@ -5606,18 +1476,15 @@ void ADSBDemodGUI::statsTable_customContextMenuRequested(QPoint pos) void ADSBDemodGUI::adsbData_customContextMenuRequested(QPoint pos) { - QTableWidgetItem *item = ui->adsbData->itemAt(pos); - if (item) + QModelIndex index = ui->adsbData->indexAt(pos); + if (index.isValid()) { - int row = item->row(); - int icao = ui->adsbData->item(row, 0)->text().toInt(nullptr, 16); - Aircraft *aircraft = nullptr; - if (m_aircraft.contains(icao)) { - aircraft = m_aircraft.value(icao); - } else { + Aircraft *aircraft = aircraftForViewRow(index.row()); + if (!aircraft) { return; } - QString icaoHex = QString("%1").arg(icao, 6, 16, QChar('0')); + const int icao = aircraft->m_icao; + const QString icaoHex = aircraft->m_icaoHex; QMenu* tableContextMenu = new QMenu(ui->adsbData); connect(tableContextMenu, &QMenu::aboutToHide, tableContextMenu, &QMenu::deleteLater); @@ -5625,7 +1492,7 @@ void ADSBDemodGUI::adsbData_customContextMenuRequested(QPoint pos) // Copy current cell QAction* copyAction = new QAction("Copy", tableContextMenu); - const QString text = item->text(); + const QString text = ui->adsbData->model()->data(index, Qt::DisplayRole).toString(); connect(copyAction, &QAction::triggered, this, [text]()->void { QClipboard *clipboard = QGuiApplication::clipboard(); clipboard->setText(text); @@ -5703,8 +1570,8 @@ void ADSBDemodGUI::adsbData_customContextMenuRequested(QPoint pos) tableContextMenu->addAction(findChannelMapAction); QAction* findMapFeatureAction = new QAction("Find on feature map", tableContextMenu); - connect(findMapFeatureAction, &QAction::triggered, this, [icaoHex]()->void { - FeatureWebAPIUtils::mapFind(icaoHex); + connect(findMapFeatureAction, &QAction::triggered, this, [this, aircraft]()->void { + FeatureWebAPIUtils::mapFind(mapItemName(aircraft)); }); tableContextMenu->addAction(findMapFeatureAction); } @@ -5713,20 +1580,31 @@ void ADSBDemodGUI::adsbData_customContextMenuRequested(QPoint pos) } } -void ADSBDemodGUI::on_adsbData_cellClicked(int row, int column) +void ADSBDemodGUI::adsbData_clicked(const QModelIndex& index) { - (void) column; - // Get ICAO of aircraft in row clicked - int icao = ui->adsbData->item(row, 0)->text().toInt(nullptr, 16); - if (m_aircraft.contains(icao)) { - highlightAircraft(m_aircraft.value(icao)); + Aircraft *aircraft = aircraftForViewRow(index.row()); + if (aircraft) { + highlightAircraft(aircraft); } } -void ADSBDemodGUI::on_adsbData_cellDoubleClicked(int row, int column) +// The aircraft shown in a row of the table. Rows are in the proxy's order, which is +// what the user sees and what the view's signals report +Aircraft *ADSBDemodGUI::aircraftForViewRow(int viewRow) const +{ + QModelIndex index = m_aircraftProxy->mapToSource(m_aircraftProxy->index(viewRow, 0)); + return index.isValid() ? m_aircraftTableModel.aircraftAt(index.row()) : nullptr; +} + +void ADSBDemodGUI::adsbData_doubleClicked(const QModelIndex& modelIndex) { - // Get ICAO of aircraft in row double clicked - int icao = ui->adsbData->item(row, 0)->text().toInt(nullptr, 16); + Aircraft *aircraft = aircraftForViewRow(modelIndex.row()); + if (!aircraft) { + return; + } + const int icao = aircraft->m_icao; + const int column = modelIndex.column(); + if (column == ADSB_COL_ICAO) { // Search for aircraft on planespotters.net @@ -6039,506 +1917,10 @@ void ADSBDemodGUI::on_amDemod_currentIndexChanged(int index) } } -QString ADSBDemodGUI::get3DModel(const QString &aircraftType, const QString &operatorICAO) const -{ - QString aircraftTypeOperator = aircraftType + "_" + operatorICAO; - if (m_3DModels.contains(aircraftTypeOperator)) { - return m_3DModels.value(aircraftTypeOperator); - } - if (m_settings.m_verboseModelMatching) { - qDebug() << "ADS-B: No livery for " << aircraftTypeOperator; - } - return ""; -} - -QString ADSBDemodGUI::get3DModel(const QString &aircraftType) -{ - if (m_3DModelsByType.contains(aircraftType)) - { - // Choose a random livery - QStringList models = m_3DModelsByType.value(aircraftType); - int size = models.size(); - int idx = m_random.bounded(size); - return models[idx]; - } - if (m_settings.m_verboseModelMatching) { - qDebug() << "ADS-B: No aircraft for " << aircraftType; - } - return ""; -} - -void ADSBDemodGUI::get3DModel(Aircraft *aircraft) -{ - QString model; - if (aircraft->m_aircraftInfo && !aircraft->m_aircraftInfo->m_model.isEmpty()) - { - QString aircraftType; - for (auto mm : m_3DModelMatch) - { - if (mm->match(aircraft->m_aircraftInfo->m_model, aircraft->m_aircraftInfo->m_manufacturerName, aircraftType)) - { - QString operatorICAO = aircraft->m_aircraftInfo->m_operatorICAO; - - // Look for operator specific livery - if (!operatorICAO.isEmpty()) { - model = get3DModel(aircraftType, operatorICAO); - } - - if (model.isEmpty()) - { - // Try similar operator (E.g. EasyJet instead of EasyJet Europe) - static const QHash alternateOperator = { - {"EJU", "EZY"}, - {"WUK", "WZZ"}, - {"TFL", "TOM"}, - {"NOZ", "NAX"}, - {"NSZ", "NAX"}, - {"BCS", "DHK"}, - }; - - if (alternateOperator.contains(operatorICAO)) - { - operatorICAO = alternateOperator.value(operatorICAO); - model = get3DModel(aircraftType, operatorICAO); - } - - if (model.isEmpty()) - { - - if (m_settings.m_favourLivery && !operatorICAO.isEmpty()) - { - // Try to find similar aircraft with matching livery - static const QHash alternateTypes = { - {"B788", {"B77W", "B77L", "B772", "B773", "B763", "A332", "A333"}}, - {"B77W", {"B77L", "B772", "B773", "B788", "B763", "A332", "A333"}}, - {"B77L", {"B77W", "B772", "B773", "B788", "B763", "A332", "A333"}}, - {"B772", {"B77W", "B77L", "B773", "B788", "B763", "A332", "A333"}}, - {"B773", {"B77W", "B77L", "B772", "B788", "B763", "A332", "A333"}}, - {"A332", {"A333", "B77W", "B77L", "B773", "B772", "B788", "B763"}}, - {"A333", {"A332", "B77W", "B77L", "B773", "B772", "B788", "B763"}}, - {"A342", {"A343", "A345", "A346"}}, - {"A343", {"A342", "A345", "A346"}}, - {"A345", {"A343", "A342", "A346"}}, - {"A346", {"A345", "A343", "A342"}}, - {"B744", {"B74F"}}, - {"B74F", {"B744"}}, - {"B733", {"B734", "B737", "B738", "B739", "B752", "A320", "A319", "A321"}}, - {"B734", {"B733", "B737", "B738", "B739", "B752", "A320", "A319", "A321"}}, - {"B737", {"B733", "B734", "B738", "B739", "B752", "A320", "A319", "A321"}}, - {"B738", {"B733", "B734", "B737", "B739", "B752", "A320", "A319", "A321"}}, - {"B739", {"B733", "B734", "B737", "B738", "B752", "A320", "A319", "A321"}}, - {"A319", {"A320", "A321", "B733", "B734", "B737", "B738", "B739"}}, - {"A320", {"A319", "A321", "B733", "B734", "B737", "B738", "B739"}}, - {"A321", {"A319", "A320", "B733", "B734", "B737", "B738", "B739"}}, - {"A306", {"A332", "A333", "B763"}}, - }; - - if (alternateTypes.contains(aircraftType)) - { - for (const auto& alternate : alternateTypes.value(aircraftType)) { - model = get3DModel(alternate, operatorICAO); - if (!model.isEmpty()) { - break; - } - } - } - } - - if (model.isEmpty()) - { - // Try for aircraft without specific livery - model = get3DModel(aircraftType); - } - } - } - if (!model.isEmpty()) - { - aircraft->m_aircraft3DModel = model; - if (m_modelAltitudeOffset.contains(aircraftType)) - { - aircraft->m_modelAltitudeOffset = m_modelAltitudeOffset.value(aircraftType); - aircraft->m_labelAltitudeOffset = m_labelAltitudeOffset.value(aircraftType); - } - } - break; - } - } - if (m_settings.m_verboseModelMatching) - { - if (model.isEmpty()) { - qDebug() << "ADS-B: No 3D model for " << aircraft->m_aircraftInfo->m_model << " " << aircraft->m_aircraftInfo->m_operatorICAO << " for " << aircraft->m_icaoHex; - } else { - qDebug() << "ADS-B: Matched " << aircraft->m_aircraftInfo->m_model << " " << aircraft->m_aircraftInfo->m_operatorICAO << " to " << model << " for " << aircraft->m_icaoHex; - } - } - } -} - -void ADSBDemodGUI::get3DModelBasedOnCategory(Aircraft *aircraft) -{ - QString aircraftType; - - if (!aircraft->m_emitterCategory.compare("Heavy")) - { - static const QStringList heavy = {"B744", "B77W", "B788", "A388"}; - aircraftType = heavy[m_random.bounded(heavy.size())]; - } - else if (!aircraft->m_emitterCategory.compare("Large")) - { - static const QStringList large = {"A319", "A320", "A321", "B737", "B738", "B739"}; - aircraftType = large[m_random.bounded(large.size())]; - } - else if (!aircraft->m_emitterCategory.compare("Small")) - { - aircraftType = "LJ45"; - } - else if (!aircraft->m_emitterCategory.compare("Rotorcraft")) - { - aircraft->m_aircraftCat3DModel = "helicopter.glb"; - aircraft->m_modelAltitudeOffset = 4.0f; - aircraft->m_labelAltitudeOffset = 4.0f; - } - else if (!aircraft->m_emitterCategory.compare("High performance")) - { - aircraft->m_aircraftCat3DModel = "f15.glb"; - aircraft->m_modelAltitudeOffset = 1.0f; - aircraft->m_labelAltitudeOffset = 6.0f; - } - else if (!aircraft->m_emitterCategory.compare("Light")) - { - aircraftType = "C172"; - } - else if (!aircraft->m_emitterCategory.compare("Ultralight")) - { - aircraft->m_aircraftCat3DModel = "ultralight.glb"; - aircraft->m_modelAltitudeOffset = 0.55f; - aircraft->m_labelAltitudeOffset = 0.75f; - } - else if (!aircraft->m_emitterCategory.compare("Glider/sailplane")) - { - aircraft->m_aircraftCat3DModel = "glider.glb"; - aircraft->m_modelAltitudeOffset = 1.0f; - aircraft->m_labelAltitudeOffset = 1.5f; - } - else if (!aircraft->m_emitterCategory.compare("Space vehicle")) - { - aircraft->m_aircraftCat3DModel = "atlas_v.glb"; - aircraft->m_labelAltitudeOffset = 16.0f; - } - else if (!aircraft->m_emitterCategory.compare("UAV")) - { - aircraft->m_aircraftCat3DModel = "drone.glb"; - aircraft->m_labelAltitudeOffset = 1.0f; - } - else if (!aircraft->m_emitterCategory.compare("Emergency vehicle")) - { - aircraft->m_aircraftCat3DModel = "fire_truck.glb"; - aircraft->m_modelAltitudeOffset = 0.3f; - aircraft->m_labelAltitudeOffset = 2.5f; - } - else if (!aircraft->m_emitterCategory.compare("Service vehicle")) - { - aircraft->m_aircraftCat3DModel = "airport_truck.glb"; - aircraft->m_labelAltitudeOffset = 3.0f; - } - else - { - aircraftType = "A320"; - } - if (!aircraftType.isEmpty()) - { - aircraft->m_aircraftCat3DModel = ""; - if (aircraft->m_aircraftInfo) { - aircraft->m_aircraftCat3DModel = get3DModel(aircraftType, aircraft->m_aircraftInfo->m_operatorICAO); - } - if (aircraft->m_aircraftCat3DModel.isEmpty()) { - aircraft->m_aircraftCat3DModel = get3DModel(aircraftType, aircraft->m_callsign.left(3)); - } - if (aircraft->m_aircraftCat3DModel.isEmpty()) { - aircraft->m_aircraftCat3DModel = get3DModel(aircraftType); - } - if (m_modelAltitudeOffset.contains(aircraftType)) - { - aircraft->m_modelAltitudeOffset = m_modelAltitudeOffset.value(aircraftType); - aircraft->m_labelAltitudeOffset = m_labelAltitudeOffset.value(aircraftType); - } - } -} -void ADSBDemodGUI::update3DModels() -{ - // Look for all aircraft gltfs in 3d directory - QString modelDir = getDataDir() + "/3d"; - static const QStringList subDirs = {"BB_Airbus_png", "BB_Boeing_png", "BB_Jets_png", "BB_Props_png", "BB_GA_png", "BB_Mil_png", "BB_Heli_png"}; - for (auto subDir : subDirs) - { - QString dirName = modelDir + "/" + subDir; - QDir dir(dirName); - QStringList aircrafts = dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); - for (auto aircraft : aircrafts) - { - if (m_settings.m_verboseModelMatching) { - qDebug() << "Aircraft " << aircraft; - } - QDir aircraftDir(dir.filePath(aircraft)); - QStringList gltfs = aircraftDir.entryList({"*.gltf"}); - QStringList allAircraft; - for (auto gltf : gltfs) - { - QStringList filenameParts = gltf.split(".")[0].split("_"); - if (filenameParts.size() == 2) - { - QString livery = filenameParts[1]; - if (m_settings.m_verboseModelMatching) { - qDebug() << "Aircraft " << aircraft << "Livery " << livery; - } - // Only use relative path, as Map feature will add the prefix - QString filename = subDir + "/" + aircraft + "/" + gltf; - m_3DModels.insert(aircraft + "_" + livery, filename); - allAircraft.append(filename); - } - } - if (gltfs.size() > 0) { - m_3DModelsByType.insert(aircraft, allAircraft); - } - } - } - // Vertical offset so undercarriage isn't underground, because 0,0,0 is in the middle of the model - // rather than at the bottom - m_modelAltitudeOffset.insert("A306", 4.6f); - m_modelAltitudeOffset.insert("A310", 4.6f); - m_modelAltitudeOffset.insert("A318", 3.7f); - m_modelAltitudeOffset.insert("A319", 3.5f); - m_modelAltitudeOffset.insert("A320", 3.5f); - m_modelAltitudeOffset.insert("A321", 3.5f); - m_modelAltitudeOffset.insert("A332", 5.52f); - m_modelAltitudeOffset.insert("A333", 5.52f); - m_modelAltitudeOffset.insert("A334", 5.52f); - m_modelAltitudeOffset.insert("A343", 4.65f); - m_modelAltitudeOffset.insert("A345", 4.65f); - m_modelAltitudeOffset.insert("A346", 4.65f); - m_modelAltitudeOffset.insert("A388", 5.75f); - m_modelAltitudeOffset.insert("B717", 0.0f); - m_modelAltitudeOffset.insert("B733", 3.1f); - m_modelAltitudeOffset.insert("B734", 3.27f); - m_modelAltitudeOffset.insert("B737", 3.0f); - m_modelAltitudeOffset.insert("B738", 3.31f); - m_modelAltitudeOffset.insert("B739", 3.32f); - m_modelAltitudeOffset.insert("B74F", 5.3f); - m_modelAltitudeOffset.insert("B744", 5.25f); - m_modelAltitudeOffset.insert("B752", 3.6f); - m_modelAltitudeOffset.insert("B763", 4.44f); - m_modelAltitudeOffset.insert("B772", 5.57f); - m_modelAltitudeOffset.insert("B773", 5.6f); - m_modelAltitudeOffset.insert("B77L", 5.57f); - m_modelAltitudeOffset.insert("B77W", 5.57f); - m_modelAltitudeOffset.insert("B788", 4.1f); - m_modelAltitudeOffset.insert("BE20", 1.48f); - m_modelAltitudeOffset.insert("C150", 1.05f); - m_modelAltitudeOffset.insert("C172", 1.16f); - m_modelAltitudeOffset.insert("C421", 1.16f); - m_modelAltitudeOffset.insert("H25B", 1.45f); - m_modelAltitudeOffset.insert("LJ45", 1.27f); - m_modelAltitudeOffset.insert("B462", 1.8f); - m_modelAltitudeOffset.insert("B463", 1.9f); - m_modelAltitudeOffset.insert("CRJ2", 1.3f); - m_modelAltitudeOffset.insert("CRJ7", 1.66f); - m_modelAltitudeOffset.insert("CRJ9", 2.27f); - m_modelAltitudeOffset.insert("CRJX", 2.49f); - m_modelAltitudeOffset.insert("DC10", 5.2f); - m_modelAltitudeOffset.insert("E135", 1.88f); - m_modelAltitudeOffset.insert("E145", 1.86f); - m_modelAltitudeOffset.insert("E170", 2.3f); - m_modelAltitudeOffset.insert("E190", 3.05f); - m_modelAltitudeOffset.insert("E195", 2.97f); - m_modelAltitudeOffset.insert("F28", 2.34f); - m_modelAltitudeOffset.insert("F70", 2.43f); - m_modelAltitudeOffset.insert("F100", 2.23f); - m_modelAltitudeOffset.insert("J328", 1.01f); - m_modelAltitudeOffset.insert("MD11", 5.22f); - m_modelAltitudeOffset.insert("MD83", 2.71f); - m_modelAltitudeOffset.insert("MD90", 2.62f); - m_modelAltitudeOffset.insert("AT42", 1.75f); - m_modelAltitudeOffset.insert("AT72", 1.83f); - m_modelAltitudeOffset.insert("D328", 0.99f); - m_modelAltitudeOffset.insert("DH8D", 1.65f); - m_modelAltitudeOffset.insert("F50", 2.16f); - m_modelAltitudeOffset.insert("JS41", 1.9f); - m_modelAltitudeOffset.insert("L410", 1.1f); - m_modelAltitudeOffset.insert("SB20", 2.0f); - m_modelAltitudeOffset.insert("SF34", 1.89f); - - // Label offsets (from bottom of aircraft) - m_labelAltitudeOffset.insert("A306", 10.0f); - m_labelAltitudeOffset.insert("A310", 15.0f); - m_labelAltitudeOffset.insert("A318", 10.0f); - m_labelAltitudeOffset.insert("A319", 10.0f); - m_labelAltitudeOffset.insert("A320", 10.0f); - m_labelAltitudeOffset.insert("A321", 10.0f); - m_labelAltitudeOffset.insert("A332", 14.0f); - m_labelAltitudeOffset.insert("A333", 14.0f); - m_labelAltitudeOffset.insert("A334", 14.0f); - m_labelAltitudeOffset.insert("A343", 14.0f); - m_labelAltitudeOffset.insert("A345", 14.0f); - m_labelAltitudeOffset.insert("A346", 14.0f); - m_labelAltitudeOffset.insert("A388", 20.0f); - m_labelAltitudeOffset.insert("B717", 7.5f); - m_labelAltitudeOffset.insert("B733", 10.0f); - m_labelAltitudeOffset.insert("B734", 10.0f); - m_labelAltitudeOffset.insert("B737", 10.0f); - m_labelAltitudeOffset.insert("B738", 10.0f); - m_labelAltitudeOffset.insert("B739", 10.0f); - m_labelAltitudeOffset.insert("B74F", 15.0f); - m_labelAltitudeOffset.insert("B744", 15.0f); - m_labelAltitudeOffset.insert("B752", 12.0f); - m_labelAltitudeOffset.insert("B763", 14.0f); - m_labelAltitudeOffset.insert("B772", 14.0f); - m_labelAltitudeOffset.insert("B773", 14.0f); - m_labelAltitudeOffset.insert("B77L", 14.0f); - m_labelAltitudeOffset.insert("B77W", 14.0f); - m_labelAltitudeOffset.insert("B788", 14.0f); - m_labelAltitudeOffset.insert("BE20", 4.0f); - m_labelAltitudeOffset.insert("C150", 3.0f); - m_labelAltitudeOffset.insert("C172", 3.0f); - m_labelAltitudeOffset.insert("C421", 4.0f); - m_labelAltitudeOffset.insert("H25B", 5.0f); - m_labelAltitudeOffset.insert("LJ45", 5.0f); - m_labelAltitudeOffset.insert("B462", 7.0f); - m_labelAltitudeOffset.insert("B463", 7.0f); - m_labelAltitudeOffset.insert("CRJ2", 5.5f); - m_labelAltitudeOffset.insert("CRJ7", 6.0f); - m_labelAltitudeOffset.insert("CRJ9", 6.0f); - m_labelAltitudeOffset.insert("CRJX", 6.0f); - m_labelAltitudeOffset.insert("DC10", 15.0f); - m_labelAltitudeOffset.insert("E135", 5.0f); - m_labelAltitudeOffset.insert("E145", 5.0f); - m_labelAltitudeOffset.insert("E170", 8.0f); - m_labelAltitudeOffset.insert("E190", 8.5f); - m_labelAltitudeOffset.insert("E195", 8.5f); - m_labelAltitudeOffset.insert("F28", 7.0f); - m_labelAltitudeOffset.insert("F70", 6.5f); - m_labelAltitudeOffset.insert("F100", 6.5f); - m_labelAltitudeOffset.insert("J328", 5.0f); // Check - m_labelAltitudeOffset.insert("MD11", 15.0f); - m_labelAltitudeOffset.insert("MD83", 7.5f); - m_labelAltitudeOffset.insert("MD90", 7.5f); - m_labelAltitudeOffset.insert("AT42", 7.0f); - m_labelAltitudeOffset.insert("AT72", 7.0f); - m_labelAltitudeOffset.insert("D328", 6.0f); - m_labelAltitudeOffset.insert("DH8D", 6.5f); - m_labelAltitudeOffset.insert("F50", 7.0f); - m_labelAltitudeOffset.insert("JS41", 5.0f); - m_labelAltitudeOffset.insert("L410", 5.0f); - m_labelAltitudeOffset.insert("SB20", 6.5f); - m_labelAltitudeOffset.insert("SF34", 6.0f); - - // Map from OpenSky database names to 3D model names - m_3DModelMatch.append(new ModelMatch("A300.*", "A306")); // A300 B4 is A300-600, but use for others as closest match - m_3DModelMatch.append(new ModelMatch("A310.*", "A310")); - m_3DModelMatch.append(new ModelMatch("A318.*", "A318")); - m_3DModelMatch.append(new ModelMatch("A.?319.*", "A319")); - m_3DModelMatch.append(new ModelMatch("A.?320.*", "A320")); - m_3DModelMatch.append(new ModelMatch("A.?321.*", "A321")); - m_3DModelMatch.append(new ModelMatch("A330.2.*", "A332")); - m_3DModelMatch.append(new ModelMatch("A330.3.*", "A333")); - m_3DModelMatch.append(new ModelMatch("A330.7.*", "A333")); // BelugaXL - m_3DModelMatch.append(new ModelMatch("A330.8.*", "A332")); // 200 Neo - m_3DModelMatch.append(new ModelMatch("A330.9.*", "A333")); // 300 Neo - m_3DModelMatch.append(new ModelMatch("A340.3.*", "A343")); - m_3DModelMatch.append(new ModelMatch("A340.5.*", "A345")); - m_3DModelMatch.append(new ModelMatch("A340.6.*", "A346")); - m_3DModelMatch.append(new ModelMatch("A350.*", "A333")); // No A350 model - use 330 as twin engine - m_3DModelMatch.append(new ModelMatch("A380.*", "A388")); - - m_3DModelMatch.append(new ModelMatch("737.2.*", "B733")); // No 200 model - m_3DModelMatch.append(new ModelMatch("737.3.*", "B733")); - m_3DModelMatch.append(new ModelMatch("737.4.*", "B734")); - m_3DModelMatch.append(new ModelMatch("737.5.*", "B734")); // No 500 model - m_3DModelMatch.append(new ModelMatch("737.6.*", "B737")); // No 600 model - m_3DModelMatch.append(new ModelMatch("737NG.6.*", "B737")); - m_3DModelMatch.append(new ModelMatch("737.7.*", "B737")); - m_3DModelMatch.append(new ModelMatch("737NG.7.*", "B737")); - m_3DModelMatch.append(new ModelMatch("737.8.*", "B738")); - m_3DModelMatch.append(new ModelMatch("737NG.8.*", "B738")); // No Max model yet - m_3DModelMatch.append(new ModelMatch("737MAX.8.*", "B738")); - m_3DModelMatch.append(new ModelMatch("737.9", "B739")); - m_3DModelMatch.append(new ModelMatch("737NG.9", "B739")); - m_3DModelMatch.append(new ModelMatch("737MAX.9", "B739")); - m_3DModelMatch.append(new ModelMatch("B747.*F", "B74F")); - m_3DModelMatch.append(new ModelMatch("B747.*\\(F\\)", "B74F")); - m_3DModelMatch.append(new ModelMatch("747.*", "B744")); - m_3DModelMatch.append(new ModelMatch("757.*", "B752")); - m_3DModelMatch.append(new ModelMatch("767.*", "B763")); - m_3DModelMatch.append(new ModelMatch("777.2.*LR.*", "B77L")); - m_3DModelMatch.append(new ModelMatch("777.2.*", "B772")); - m_3DModelMatch.append(new ModelMatch("777.3.*ER.*", "B77W")); - m_3DModelMatch.append(new ModelMatch("777.3.*", "B773")); - m_3DModelMatch.append(new ModelMatch("777.*", "B772")); - m_3DModelMatch.append(new ModelMatch("787.*", "B788")); - m_3DModelMatch.append(new ModelMatch("717.*", "B717")); - // No 727 model - - // Jets - m_3DModelMatch.append(new ModelMatch(".*EMB.135.*", "E135")); - m_3DModelMatch.append(new ModelMatch(".*ERJ.135.*", "E135")); - m_3DModelMatch.append(new ModelMatch("Embraer 135.*", "E135")); - m_3DModelMatch.append(new ModelMatch(".*EMB.145.*", "E145")); - m_3DModelMatch.append(new ModelMatch(".*ERJ.145.*", "E145")); - m_3DModelMatch.append(new ModelMatch("Embraer 145.*", "E145")); - m_3DModelMatch.append(new ModelMatch(".*EMB.170.*", "E170")); - m_3DModelMatch.append(new ModelMatch(".*ERJ.170.*", "E170")); - m_3DModelMatch.append(new ModelMatch("Embraer 170.*", "E170")); - m_3DModelMatch.append(new ModelMatch(".*EMB.190.*", "E190")); - m_3DModelMatch.append(new ModelMatch(".*ERJ.190.*", "E190")); - m_3DModelMatch.append(new ModelMatch("Embraer 190.*", "E190")); - m_3DModelMatch.append(new ModelMatch(".*EMB.195.*", "E195")); - m_3DModelMatch.append(new ModelMatch(".*ERJ.195.*", "E195")); - m_3DModelMatch.append(new ModelMatch("Embraer 195.*", "E195")); - - m_3DModelMatch.append(new ModelMatch(".*CRJ.200.*", "CRJ2")); - m_3DModelMatch.append(new ModelMatch(".*CRJ.700.*", "CRJ7")); - m_3DModelMatch.append(new ModelMatch(".*CRJ.900.*", "CRJ9")); - m_3DModelMatch.append(new ModelMatch(".*CRJ.1000.*", "CRJX")); - - // PNGs missing - //m_3DModelMatch.append(new ModelMatch("(BAE )?146.2.*", "B462")); - //m_3DModelMatch.append(new ModelMatch("(BAE )?146.3.*", "B463")); - - m_3DModelMatch.append(new ModelMatch("DC-10.*", "DC10")); - - m_3DModelMatch.append(new ModelMatch(".*MD.11.*", "MD11")); - m_3DModelMatch.append(new ModelMatch(".*MD.83.*", "MD83")); - m_3DModelMatch.append(new ModelMatch(".*MD.90.*", "MD90")); - - m_3DModelMatch.append(new ModelMatch(".*F28.*", "F28")); - m_3DModelMatch.append(new ModelMatch(".*F70.*", "F70")); - m_3DModelMatch.append(new ModelMatch(".*F100.*", "F100")); - - // GA - m_3DModelMatch.append(new ModelMatch(".*B200.*", "BE20")); - m_3DModelMatch.append(new ManufacturerModelMatch(".*200.*", ".*Beech.*", "BE20")); - m_3DModelMatch.append(new ModelMatch(".*150.*", "C150")); - m_3DModelMatch.append(new ModelMatch(".*172.*", "C172")); - m_3DModelMatch.append(new ModelMatch(".*421.*", "C421")); - m_3DModelMatch.append(new ModelMatch(".*125.*", "H25B")); - m_3DModelMatch.append(new ManufacturerModelMatch(".*400.*", "Hawker.*", "H25B")); - m_3DModelMatch.append(new ManufacturerModelMatch(".*400.*", "Raytheon.*", "H25B")); - m_3DModelMatch.append(new ModelMatch(".*Learjet.*", "LJ45")); - - // Props - m_3DModelMatch.append(new ModelMatch("ATR.*42.*", "AT42")); - m_3DModelMatch.append(new ModelMatch("ATR.*72.*", "AT72")); - m_3DModelMatch.append(new ModelMatch("Do 328.*", "D328")); - m_3DModelMatch.append(new ModelMatch("DHC-8.*", "DH8D")); - m_3DModelMatch.append(new ModelMatch(".*F50.*", "F50")); - m_3DModelMatch.append(new ModelMatch("Jetstream 41.*", "JS41")); - m_3DModelMatch.append(new ModelMatch(".*L.410.*", "L410")); - m_3DModelMatch.append(new ModelMatch("SAAB.2000.*", "SB20")); - m_3DModelMatch.append(new ManufacturerModelMatch(".*340.*", "Saab.*", "SF34")); -} void ADSBDemodGUI::updateAirports() { @@ -6651,8 +2033,10 @@ void ADSBDemodGUI::targetAircraft(Aircraft *aircraft) m_trackAircraft->m_isTarget = false; m_aircraftModel.aircraftUpdated(m_trackAircraft); } - // Track this aircraft + // Track this aircraft. The tracker sends the rotator updated positions m_trackAircraft = aircraft; + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "setTrackAircraft", Qt::QueuedConnection, + Q_ARG(quint32, (quint32) aircraft->m_icao)); if (aircraft->m_positionValid) m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation, aircraft->m_range); // Change colour of new target @@ -6665,8 +2049,8 @@ void ADSBDemodGUI::updatePhotoText(Aircraft *aircraft) { if (m_settings.m_displayPhotos) { - QString callsign = aircraft->m_callsignItem->text().trimmed(); - QString reg = aircraft->m_registrationItem->text().trimmed(); + QString callsign = aircraft->cellText(ADSB_COL_CALLSIGN).trimmed(); + QString reg = aircraft->cellText(ADSB_COL_REGISTRATION).trimmed(); if (!callsign.isEmpty() && !reg.isEmpty()) { ui->photoHeader->setText(QString("%1 - %2").arg(callsign).arg(reg)); } else if (!callsign.isEmpty()) { @@ -6675,7 +2059,7 @@ void ADSBDemodGUI::updatePhotoText(Aircraft *aircraft) ui->photoHeader->setText(QString("%1").arg(reg)); } - QIcon icon = aircraft->m_countryItem->icon(); + QIcon icon = ADSBAircraftTableModel::icon(aircraft->m_flagIconPath, QSize(40, 20)).value(); QList sizes = icon.availableSizes(); if (sizes.size() > 0) { ui->photoFlag->setPixmap(icon.pixmap(sizes[0])); @@ -6686,23 +2070,23 @@ void ADSBDemodGUI::updatePhotoText(Aircraft *aircraft) updatePhotoFlightInformation(aircraft); QString aircraftDetails = ""; // Note, Qt seems to make the table bigger than this so text is cropped, not wrapped - QString manufacturer = aircraft->m_manufacturerNameItem->text(); + QString manufacturer = aircraft->cellText(ADSB_COL_MANUFACTURER); if (!manufacturer.isEmpty()) { aircraftDetails.append(QString("
Manufacturer:%1").arg(manufacturer)); } - QString model = aircraft->m_modelItem->text(); + QString model = aircraft->cellText(ADSB_COL_MODEL); if (!model.isEmpty()) { aircraftDetails.append(QString("
Aircraft:%1").arg(model)); } - QString owner = aircraft->m_ownerItem->text(); + QString owner = aircraft->cellText(ADSB_COL_OWNER); if (!owner.isEmpty()) { aircraftDetails.append(QString("
Owner:%1").arg(owner)); } - QString operatorICAO = aircraft->m_operatorICAOItem->text(); + QString operatorICAO = aircraft->cellText(ADSB_COL_OPERATOR_ICAO); if (!operatorICAO.isEmpty()) { aircraftDetails.append(QString("
Operator:%1").arg(operatorICAO)); } - QString registered = aircraft->m_registeredItem->text(); + QString registered = aircraft->cellText(ADSB_COL_REGISTERED); if (!registered.isEmpty()) { aircraftDetails.append(QString("
Registered:%1").arg(registered)); } @@ -6715,14 +2099,14 @@ void ADSBDemodGUI::updatePhotoFlightInformation(Aircraft *aircraft) { if (m_settings.m_displayPhotos) { - QString dep = aircraft->m_depItem->text(); - QString arr = aircraft->m_arrItem->text(); - QString std = aircraft->m_stdItem->text(); - QString etd = aircraft->m_etdItem->text(); - QString atd = aircraft->m_atdItem->text(); - QString sta = aircraft->m_staItem->text(); - QString eta = aircraft->m_etaItem->text(); - QString ata = aircraft->m_ataItem->text(); + QString dep = aircraft->cellText(ADSB_COL_DEP); + QString arr = aircraft->cellText(ADSB_COL_ARR); + QString std = aircraft->cellText(ADSB_COL_STD); + QString etd = aircraft->cellText(ADSB_COL_ETD); + QString atd = aircraft->cellText(ADSB_COL_ATD); + QString sta = aircraft->cellText(ADSB_COL_STA); + QString eta = aircraft->cellText(ADSB_COL_ETA); + QString ata = aircraft->cellText(ADSB_COL_ATA); QString flightDetails; if (!dep.isEmpty() && !arr.isEmpty()) { @@ -6783,7 +2167,10 @@ void ADSBDemodGUI::highlightAircraft(Aircraft *aircraft) { // Highlight the row in the table - always do this, as it can become // unselected - ui->adsbData->selectRow(aircraft->m_icaoItem->row()); + int row = m_aircraftTableModel.rowForAircraft(aircraft); + if (row >= 0) { + ui->adsbData->selectRow(m_aircraftProxy->mapFromSource(m_aircraftTableModel.index(row, 0)).row()); + } } else { @@ -6818,7 +2205,6 @@ void ADSBDemodGUI::feedSelect(const QPoint& p) "importMinLongitude", "importMaxLongitude" }); - applyImportSettings(); } } @@ -6826,12 +2212,13 @@ void ADSBDemodGUI::feedSelect(const QPoint& p) void ADSBDemodGUI::on_displaySettings_clicked() { bool oldSiUnits = m_settings.m_siUnits; + bool oldUseLiveryIcons = m_settings.m_useLiveryIcons; ADSBDemodDisplayDialog dialog(&m_settings); new DialogPositioner(&dialog, true); if (dialog.exec() == QDialog::Accepted) { bool unitsChanged = m_settings.m_siUnits != oldSiUnits; - if (unitsChanged) { + if (unitsChanged || (m_settings.m_useLiveryIcons != oldUseLiveryIcons)) { m_aircraftModel.allAircraftUpdated(); } displaySettings(dialog.getSettingsKeys(), false); @@ -6853,6 +2240,40 @@ void ADSBDemodGUI::setShowContainmentRadius(bool show) } } +void ADSBDemodGUI::clearStaleTileCache(const QString& cachePath) +{ + const int currentVersion = 1; + // Per installation rather than per channel: every ADS-B demod shares this cache, and + // QSettings is written immediately, where channel settings are only stored when the + // configuration is saved + QSettings settings; + + if (settings.value("ADSBDemod/tileCacheVersion", 0).toInt() >= currentVersion) { + return; + } + + qDebug() << "ADSBDemodGUI::clearStaleTileCache: clearing the map tile cache once, to" + << "discard tiles fetched before the CartoDB API key became a setting"; + + QDir dir(cachePath); + + if (dir.exists()) + { + const QStringList filenames = dir.entryList({"osm_100-l-*"}); + + for (const auto& filename : filenames) + { + QFile file(dir.filePath(filename)); + + if (!file.remove()) { + qDebug() << "ADSBDemodGUI::clearStaleTileCache: Failed to remove" << file.fileName(); + } + } + } + + settings.setValue("ADSBDemod/tileCacheVersion", currentVersion); +} + void ADSBDemodGUI::applyMapSettings() { #ifdef QT_LOCATION_FOUND @@ -6920,6 +2341,7 @@ void ADSBDemodGUI::applyMapSettings() if (!dir.exists()) { dir.mkpath(cachePath); } + clearStaleTileCache(cachePath); switch (m_settings.m_mapType) { case ADSBDemodSettings::AVIATION_LIGHT: @@ -7033,14 +2455,17 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_speech(nullptr), m_progressDialog(nullptr), m_networkManager(nullptr), - m_importRequestGeneration(0), - m_importAuthenticationRetry(false), m_loadingData(false) { setAttribute(Qt::WA_DeleteOnClose, true); m_helpURL = "plugins/channelrx/demodadsb/readme.md"; RollupContents *rollupContents = getRollupContents(); ui->setupUi(rollupContents); + + ui->statsTable->setItemDelegate(new FastItemDelegate(ui->statsTable)); + ui->statsTable->setHorizontalHeader(new FastHeaderView(Qt::Horizontal, ui->statsTable)); + ui->adsbData->setHorizontalHeader(new FastHeaderView(Qt::Horizontal, ui->adsbData)); + setSizePolicy(rollupContents->sizePolicy()); rollupContents->arrangeRollups(); connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); @@ -7059,7 +2484,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb } m_osmPort = 0; // Pick a free port - m_templateServer = new ADSBOSMTemplateServer(maptilerAPIKey(), m_osmPort); + m_templateServer = new ADSBOSMTemplateServer(maptilerAPIKey(), cartoDBAPIKey(), m_osmPort); #ifdef QT_LOCATION_FOUND ui->map->setAttribute(Qt::WA_AcceptTouchEvents, true); @@ -7086,13 +2511,29 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_adsbDemod = reinterpret_cast(rxChannel); m_adsbDemod->setMessageQueueToGUI(getInputMessageQueue()); + // The decoding happens in the channel's tracker, on its own thread; the GUI shows + // what it sends + ADSBDemodTracker *tracker = m_adsbDemod->getTracker(); + connect(tracker, &ADSBDemodTracker::aircraftUpdated, this, &ADSBDemodGUI::aircraftUpdated); + connect(tracker, &ADSBDemodTracker::aircraftRemoved, this, &ADSBDemodGUI::aircraftRemoved); + connect(tracker, &ADSBDemodTracker::statsUpdated, this, &ADSBDemodGUI::statsUpdated); + connect(tracker, &ADSBDemodTracker::coverageUpdated, this, &ADSBDemodGUI::coverageUpdated); + connect(tracker, &ADSBDemodTracker::qnhEstimate, this, &ADSBDemodGUI::qnhEstimate); + connect(tracker, &ADSBDemodTracker::speechRequest, this, &ADSBDemodGUI::speechRequest); + connect(tracker, &ADSBDemodTracker::highlightRequest, this, &ADSBDemodGUI::highlightRequest); + connect(tracker, &ADSBDemodTracker::targetRequest, this, &ADSBDemodGUI::targetRequest); + connect(tracker, &ADSBDemodTracker::photoRefresh, this, &ADSBDemodGUI::photoRefresh); + connect(tracker, &ADSBDemodTracker::rates, this, &ADSBDemodGUI::rates); + connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); CRightClickEnabler *feedRightClickEnabler = new CRightClickEnabler(ui->feed); connect(feedRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(feedSelect(const QPoint &))); CRightClickEnabler *coverageClickEnabler = new CRightClickEnabler(ui->coverage); - connect(coverageClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(clearCoverage(const QPoint &))); + connect(coverageClickEnabler, &CRightClickEnabler::rightClick, this, [this] (const QPoint&) { + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "clearCoverage", Qt::QueuedConnection); + }); CRightClickEnabler *statsClickEnabler = new CRightClickEnabler(ui->stats); connect(statsClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(clearStats(const QPoint &))); @@ -7129,9 +2570,26 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ui->ic->setText("IC"); + // The table is a view of the aircraft; sorting and filtering happen in the proxy. + // Sorting uses the raw cell values, so formatted numbers still sort numerically + m_aircraftTableModel.setSettings(&m_settings); + m_aircraftProxy = new ADSBAircraftSortProxy(this); + m_aircraftProxy->setSourceModel(&m_aircraftTableModel); + m_aircraftProxy->setSortRole(ADSBAircraftTableModel::SortRole); + m_aircraftProxy->setDynamicSortFilter(true); + ui->adsbData->setModel(m_aircraftProxy); + ui->adsbData->setItemDelegate(new FastItemDelegate(ui->adsbData)); + ui->channelPower->setFixedSize( + ui->channelPower->fontMetrics().horizontalAdvance("-100.0 dB") + 2, + ui->channelPower->sizeHint().height()); + + connect(ui->adsbData, &QTableView::clicked, this, &ADSBDemodGUI::adsbData_clicked); + connect(ui->adsbData, &QTableView::doubleClicked, this, &ADSBDemodGUI::adsbData_doubleClicked); + // Set size of airline icons ui->adsbData->setIconSize(QSize(85, 20)); - // Resize the table using dummy data + ADSBAircraftTableModel::setDevicePixelRatio(ui->adsbData->devicePixelRatioF()); + // Size the columns to fit representative data resizeTable(); // Allow user to reorder columns ui->adsbData->horizontalHeader()->setSectionsMovable(true); @@ -7141,7 +2599,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb menu = new QMenu(ui->adsbData); for (int i = 0; i < ui->adsbData->horizontalHeader()->count(); i++) { - QString text = ui->adsbData->horizontalHeaderItem(i)->text(); + QString text = ADSBAircraftTableModel::columnNames()[i]; menu->addAction(createCheckableItem(text, i, true)); } ui->adsbData->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); @@ -7177,6 +2635,8 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(&m_osnDB, &OsnDB::downloadAircraftInformationFinished, this, &ADSBDemodGUI::downloadAircraftInformationFinished); m_aircraftInfo = OsnDB::getAircraftInformation(); m_routeInfo = OsnDB::getAircraftRouteInformation(); + // The tracker loads its own references to the same read-only data + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "reloadDatabases", Qt::QueuedConnection); // Read airport information database, if it has previously been downloaded connect(&m_ourAirportsDB, &OurAirportsDB::downloadingURL, this, &ADSBDemodGUI::downloadingURL); @@ -7198,6 +2658,8 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb Real stationLongitude = MainCore::instance()->getSettings().getLongitude(); Real stationAltitude = MainCore::instance()->getSettings().getAltitude(); m_azEl.setLocation(stationLatitude, stationLongitude, stationAltitude); + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "setPosition", Qt::QueuedConnection, + Q_ARG(float, stationLatitude), Q_ARG(float, stationLongitude), Q_ARG(float, stationAltitude)); // These are the default values in sdrbase/settings/preferences.cpp if ((stationLatitude == 49.012423f) && (stationLongitude == 8.418125f)) { @@ -7213,17 +2675,13 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb // Get airport weather when requested connect(&m_airportModel, &AirportModel::requestMetar, this, &ADSBDemodGUI::requestMetar); - resetStats(); - - initCoverageMap(); + initCoverageDisplay(); // Add airports within range of My Position updateAirports(); updateAirspaces(); updateNavAids(); - update3DModels(); - m_flightInformation = nullptr; m_aviationWeather = nullptr; connect(&m_planeSpotters, &PlaneSpotters::aircraftPhoto, this, &ADSBDemodGUI::aircraftPhoto); @@ -7238,15 +2696,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb makeUIConnections(); applyAllSettings(); - connect(&m_importTimer, &QTimer::timeout, this, &ADSBDemodGUI::import); m_networkManager = new QNetworkAccessManager(); - QObject::connect( - m_networkManager, - &QNetworkAccessManager::finished, - this, - &ADSBDemodGUI::handleImportNetworkReply - ); - applyImportSettings(); connect(&m_redrawMapTimer, &QTimer::timeout, this, &ADSBDemodGUI::redrawMap); m_redrawMapTimer.setSingleShot(true); @@ -7271,23 +2721,9 @@ ADSBDemodGUI::~ADSBDemodGUI() disconnect(&m_redrawMapTimer, &QTimer::timeout, this, &ADSBDemodGUI::redrawMap); disconnect(&MainCore::instance()->getMasterTimer(), &QTimer::timeout, this, &ADSBDemodGUI::tick); m_redrawMapTimer.stop(); - // Remove aircraft from Map feature - QHash::iterator i = m_aircraft.begin(); - while (i != m_aircraft.end()) - { - Aircraft *aircraft = i.value(); - clearFromMap(QString("%1").arg(aircraft->m_icao, 0, 16)); - ++i; - } delete ui; qDeleteAll(m_aircraft); - if (m_flightInformation) - { - disconnect(m_flightInformation, &FlightInformation::flightUpdated, this, &ADSBDemodGUI::flightInformationUpdated); - delete m_flightInformation; - } delete m_aviationWeather; - qDeleteAll(m_3DModelMatch); delete m_networkManager; } @@ -7298,6 +2734,11 @@ QString ADSBDemodGUI::maptilerAPIKey() const return m_settings.m_maptilerAPIKey.isEmpty() ? "Nzl2cSyOnewxUc9VWg4n" : m_settings.m_maptilerAPIKey; } +QString ADSBDemodGUI::cartoDBAPIKey() const +{ + return m_settings.m_cartoDBAPIKey.isEmpty() ? "cb1_27a9_1_036ae52d2884fda8713b961c" : m_settings.m_cartoDBAPIKey; +} + void ADSBDemodGUI::applySetting(const QString& settingsKey) { applySettings({settingsKey}); @@ -7325,11 +2766,11 @@ void ADSBDemodGUI::applyAllSettings() // All settings are valid - we just use settingsKeys here to avoid updating things that are slow to update void ADSBDemodGUI::displaySettings(const QStringList& settingsKeys, bool force) { - if (settingsKeys.contains("maptilerAPIKey")) + if (settingsKeys.contains("maptilerAPIKey") || settingsKeys.contains("cartoDBAPIKey")) { m_templateServer->close(); delete m_templateServer; - m_templateServer = new ADSBOSMTemplateServer(maptilerAPIKey(), m_osmPort); + m_templateServer = new ADSBOSMTemplateServer(maptilerAPIKey(), cartoDBAPIKey(), m_osmPort); } m_channelMarker.blockSignals(true); @@ -7403,31 +2844,12 @@ void ADSBDemodGUI::displaySettings(const QStringList& settingsKeys, bool force) ui->statsTable->setFont(font); } - // Set units in column headers + // The column headings for these carry the units, which the model picks from the + // settings - it just needs to know they have changed if (settingsKeys.contains("siUnits") || force) { - if (m_settings.m_siUnits) - { - ui->adsbData->horizontalHeaderItem(ADSB_COL_ALTITUDE)->setText("Alt (m)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_VERTICALRATE)->setText("VR (m/s)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_SEL_ALTITUDE)->setText("Sel Alt (m)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_GROUND_SPEED)->setText("GS (kph)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_TRUE_AIRSPEED)->setText("TAS (kph)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_INDICATED_AIRSPEED)->setText("IAS (kph)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_HEADWIND)->setText("H Wnd (kph)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_WIND_SPEED)->setText("Wnd (kph)"); - } - else - { - ui->adsbData->horizontalHeaderItem(ADSB_COL_ALTITUDE)->setText("Alt (ft)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_VERTICALRATE)->setText("VR (ft/m)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_SEL_ALTITUDE)->setText("Sel Alt (ft)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_GROUND_SPEED)->setText("GS (kn)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_TRUE_AIRSPEED)->setText("TAS (kn)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_INDICATED_AIRSPEED)->setText("IAS (kn)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_HEADWIND)->setText("H Wnd (kn)"); - ui->adsbData->horizontalHeaderItem(ADSB_COL_WIND_SPEED)->setText("Wnd (kn)"); - } + emit ui->adsbData->model()->headerDataChanged(Qt::Horizontal, 0, ADSBDEMOD_COLUMNS - 1); + m_aircraftTableModel.allDataChanged(); } // Order and size columns @@ -7464,7 +2886,6 @@ void ADSBDemodGUI::displaySettings(const QStringList& settingsKeys, bool force) ui->stats->setText(""); if (settingsKeys.contains("aviationstackAPIKey") || force) { - initFlightInformation(); } if (settingsKeys.contains("checkWXAPIKey") || force) { initAviationWeather(); @@ -7479,7 +2900,6 @@ void ADSBDemodGUI::displaySettings(const QStringList& settingsKeys, bool force) || settingsKeys.contains("importClientId") || settingsKeys.contains("importClientSecret") || force) { - applyImportSettings(); } getRollupContents()->restoreState(m_rollupState); @@ -7524,54 +2944,17 @@ static double roundUpNearestHundred(double x) return 100 * (int) floor(((int) (x + 99.0)) / 100.0); } -int ADSBDemodGUI::countActiveAircraft() -{ - int total = 0; - QDateTime now = QDateTime::currentDateTime(); - qint64 nowSecs = now.toSecsSinceEpoch(); - QHash::iterator i = m_aircraft.begin(); - - while (i != m_aircraft.end()) - { - Aircraft *aircraft = i.value(); - qint64 secondsSinceLastFrame = nowSecs - aircraft->m_updateTime.toSecsSinceEpoch(); - - if (secondsSinceLastFrame < 10) { - total++; - } - - ++i; - } - - return total; -} -void ADSBDemodGUI::removeAircraft(QHash::iterator& i, Aircraft *aircraft) +// Tell the map model about the aircraft that have moved since the last flush +void ADSBDemodGUI::flushMapUpdates() { - // Don't try to track it anymore - if (m_trackAircraft == aircraft) - { - m_adsbDemod->clearTarget(); - m_trackAircraft = nullptr; - } - if (m_highlightAircraft == aircraft) - { - highlightAircraft(nullptr); + for (Aircraft *aircraft : m_dirtyMapAircraft) { + m_aircraftModel.aircraftUpdated(aircraft); } - - // Remove map model - m_aircraftModel.removeAircraft(aircraft); - // Remove row from table - ui->adsbData->removeRow(aircraft->m_icaoItem->row()); - // Remove aircraft from hash - i = m_aircraft.erase(i); - // Remove from map feature - clearFromMap(aircraft->m_icaoHex); - - // And finally free its memory - delete aircraft; + m_dirtyMapAircraft.clear(); } + void ADSBDemodGUI::tick() { double magsqAvg, magsqPeak; @@ -7594,98 +2977,17 @@ void ADSBDemodGUI::tick() // Tick is called 20x a second const int ticksPerSecond = 20; - // Check for old aircraft every 10 seconds - if (m_tickCount % (ticksPerSecond*10) == 0) + // Repaint the table cells and map markers that have changed. Coalescing these + // rather than redrawing on every frame is what keeps a busy sky affordable + if (m_tickCount % (ticksPerSecond / 4) == 0) { - // Remove aircraft that haven't been heard of for a user-defined time, as probably out of range - QDateTime now = QDateTime::currentDateTime(); - qint64 nowSecs = now.toSecsSinceEpoch(); - QHash::iterator i = m_aircraft.begin(); - - while (i != m_aircraft.end()) - { - Aircraft *aircraft = i.value(); - qint64 secondsSinceLastFrame = nowSecs - aircraft->m_updateTime.toSecsSinceEpoch(); - - if (secondsSinceLastFrame >= m_settings.m_removeTimeout) { - removeAircraft(i, aircraft); - } else { - ++i; - } - } - } - - // Create and send aircraft report every second for WebAPI - if (m_tickCount % ticksPerSecond == 0) { - sendAircraftReport(); + m_aircraftTableModel.flushDirty(); + flushMapUpdates(); } - // Calculate RX frame rate every second - if ((m_tickCount % ticksPerSecond) == 0) + // Averaging old chart data happens once a minute + if ((m_tickCount % (ticksPerSecond * 60)) == 0) { - QDateTime currentDateTime = QDateTime::currentDateTime(); - qint64 ms = m_frameRateTime.msecsTo(currentDateTime); - - if (ms > 0) - { - double s = ms / 1000.0; - double adsbRate = m_adsbFrameRateCount / s; - double modesFrameRate = m_modesFrameRateCount / s; - double totalRate = (m_adsbFrameRateCount + m_modesFrameRateCount) / s; - double dataRate = (m_totalBytes * 8 / 1000) / s; // kpbs - - ui->statsTable->item(ADSB_RATE, 0)->setData(Qt::DisplayRole, adsbRate); - ui->statsTable->item(MODE_S_RATE, 0)->setData(Qt::DisplayRole, modesFrameRate); - ui->statsTable->item(TOTAL_RATE, 0)->setData(Qt::DisplayRole, totalRate); - if (totalRate > m_maxRateState) - { - m_maxRateState = totalRate; - ui->statsTable->item(MAX_RATE, 0)->setData(Qt::DisplayRole, m_maxRateState); - } - ui->statsTable->item(DATA_RATE, 0)->setData(Qt::DisplayRole, dataRate); - - bool xAtMax = true; - if (m_adsbFrameRateSeries) - { - if (m_adsbFrameRateSeries->count() > 0) { - xAtMax = m_adsbFrameRateSeries->at(m_adsbFrameRateSeries->count() - 1).x() == m_xAxis->max().toMSecsSinceEpoch(); - } - m_adsbFrameRateSeries->append(currentDateTime.toMSecsSinceEpoch(), adsbRate); - } - if (m_modesFrameRateSeries) { - m_modesFrameRateSeries->append(currentDateTime.toMSecsSinceEpoch(), modesFrameRate); - } - - if (m_xAxis && xAtMax) { - m_xAxis->setMax(currentDateTime); - } - if (m_fpsYAxis) - { - if (m_fpsYAxis->max() < adsbRate) { - m_fpsYAxis->setMax(roundUpNearestHundred(adsbRate)); - } - if (m_fpsYAxis->max() < modesFrameRate) { - m_fpsYAxis->setMax(roundUpNearestHundred(modesFrameRate)); - } - } - - m_frameRateTime = currentDateTime; - m_adsbFrameRateCount = 0; - m_modesFrameRateCount = 0; - m_totalBytes = 0; - } - - if (m_aircraftSeries) - { - int active = countActiveAircraft(); - - m_aircraftSeries->append(currentDateTime.toMSecsSinceEpoch(), active); - - if (m_aircraftYAxis->max() < active + 1) { - m_aircraftYAxis->setMax(active + 1); - } - } - // Average data 10 minutes old over 1 minute, so we don't have too many points const int ageMins = 10; const int averagePeriodMins = 1; @@ -7714,7 +3016,62 @@ void ADSBDemodGUI::tick() averageSeries(m_adsbFrameRateSeries, startTime, endTime); } - m_averageTime = endTime; + m_averageTime = endTime; + } + } +} + +// The coverage outlines the tracker sends points for +void ADSBDemodGUI::initCoverageDisplay() +{ + float lat = m_azEl.getLocationSpherical().m_latitude; + float lon = m_azEl.getLocationSpherical().m_longitude; + + for (int i = 0; i < 2; i++) + { + m_coverageAirspace[i].m_polygon.resize(2 * 360 / 5); + m_coverageAirspace[i].m_center.setX(lon); + m_coverageAirspace[i].m_center.setY(lat); + m_coverageAirspace[i].m_position.setX(lon); + m_coverageAirspace[i].m_position.setY(i == 0 ? lat : lat + 0.01); + m_coverageAirspace[i].m_bottom.m_alt = (i == 0) ? 0 : 10000; + m_coverageAirspace[i].m_top.m_alt = (i == 0) ? 10000 : 66000; + m_coverageAirspace[i].m_name = (i == 0) ? "Coverage Map Low" : "Coverage Map High"; + } +} + +void ADSBDemodGUI::rates(double adsbRate, double modesRate, int activeAircraft) +{ + QDateTime currentDateTime = QDateTime::currentDateTime(); + bool xAtMax = true; + + if (m_adsbFrameRateSeries) + { + if (m_adsbFrameRateSeries->count() > 0) { + xAtMax = m_adsbFrameRateSeries->at(m_adsbFrameRateSeries->count() - 1).x() == m_xAxis->max().toMSecsSinceEpoch(); + } + m_adsbFrameRateSeries->append(currentDateTime.toMSecsSinceEpoch(), adsbRate); + } + if (m_modesFrameRateSeries) { + m_modesFrameRateSeries->append(currentDateTime.toMSecsSinceEpoch(), modesRate); + } + if (m_xAxis && xAtMax) { + m_xAxis->setMax(currentDateTime); + } + if (m_fpsYAxis) + { + if (m_fpsYAxis->max() < adsbRate) { + m_fpsYAxis->setMax(roundUpNearestHundred(adsbRate)); + } + if (m_fpsYAxis->max() < modesRate) { + m_fpsYAxis->setMax(roundUpNearestHundred(modesRate)); + } + } + if (m_aircraftSeries) + { + m_aircraftSeries->append(currentDateTime.toMSecsSinceEpoch(), activeAircraft); + if (m_aircraftYAxis->max() < activeAircraft + 1) { + m_aircraftYAxis->setMax(activeAircraft + 1); } } } @@ -7754,213 +3111,124 @@ void ADSBDemodGUI::averageSeries(QLineSeries *series, const QDateTime& startTime } } -void ADSBDemodGUI::sendAircraftReport() -{ - ADSBDemod::MsgAircraftReport* message = ADSBDemod::MsgAircraftReport::create(); - - QList& report = message->getReport(); - report.reserve(m_aircraft.size()); - - QHash::iterator i = m_aircraft.begin(); - while (i != m_aircraft.end()) - { - Aircraft *aircraft = i.value(); - - ADSBDemod::MsgAircraftReport::AircraftReport aircraftReport { - aircraft->m_icaoHex, - aircraft->m_callsign, - aircraft->m_latitude, - aircraft->m_longitude, - aircraft->m_altitude, - aircraft->m_groundspeed, - aircraft->m_positionValid, - aircraft->m_altitudeValid, - aircraft->m_groundspeedValid - }; - - report.append(aircraftReport); - - ++i; - } - - m_adsbDemod->getInputMessageQueue()->push(message); -} void ADSBDemodGUI::resizeTable() { - // Fill table with a row of dummy data that will size the columns nicely - int row = ui->adsbData->rowCount(); - ui->adsbData->setRowCount(row + 1); - ui->adsbData->setItem(row, ADSB_COL_ICAO, new QTableWidgetItem("ICAO ID")); - ui->adsbData->setItem(row, ADSB_COL_CALLSIGN, new QTableWidgetItem("WWW88WW")); - ui->adsbData->setItem(row, ADSB_COL_ATC_CALLSIGN, new QTableWidgetItem("ATC Callsign-")); - ui->adsbData->setItem(row, ADSB_COL_MODEL, new QTableWidgetItem("Aircraft12345")); - ui->adsbData->setItem(row, ADSB_COL_TYPE, new QTableWidgetItem("WWWW")); - ui->adsbData->setItem(row, ADSB_COL_SIDEVIEW, new QTableWidgetItem("sideview")); - ui->adsbData->setItem(row, ADSB_COL_AIRLINE, new QTableWidgetItem("airbrigdecargo1")); - ui->adsbData->setItem(row, ADSB_COL_COUNTRY, new QTableWidgetItem("Country")); - ui->adsbData->setItem(row, ADSB_COL_GROUND_SPEED, new QTableWidgetItem("GS (kn)")); - ui->adsbData->setItem(row, ADSB_COL_TRUE_AIRSPEED, new QTableWidgetItem("TAS (kn)")); - ui->adsbData->setItem(row, ADSB_COL_INDICATED_AIRSPEED, new QTableWidgetItem("IAS (kn)")); - ui->adsbData->setItem(row, ADSB_COL_MACH, new QTableWidgetItem("0.999")); - ui->adsbData->setItem(row, ADSB_COL_SEL_ALTITUDE, new QTableWidgetItem("Sel Alt (ft)")); - ui->adsbData->setItem(row, ADSB_COL_ALTITUDE, new QTableWidgetItem("Surface")); - ui->adsbData->setItem(row, ADSB_COL_VERTICALRATE, new QTableWidgetItem("VR (ft/m)")); - ui->adsbData->setItem(row, ADSB_COL_SEL_HEADING, new QTableWidgetItem("Sel Hd (o)")); - ui->adsbData->setItem(row, ADSB_COL_HEADING, new QTableWidgetItem("Hd (o)")); - ui->adsbData->setItem(row, ADSB_COL_TRACK, new QTableWidgetItem("Trk (o)")); - ui->adsbData->setItem(row, ADSB_COL_TURNRATE, new QTableWidgetItem("TR (o/s)")); - ui->adsbData->setItem(row, ADSB_COL_ROLL, new QTableWidgetItem("Roll (o)")); - ui->adsbData->setItem(row, ADSB_COL_RANGE, new QTableWidgetItem("D (km)")); - ui->adsbData->setItem(row, ADSB_COL_AZEL, new QTableWidgetItem("Az/El (o)")); - ui->adsbData->setItem(row, ADSB_COL_CATEGORY, new QTableWidgetItem("Rotorcraft")); - ui->adsbData->setItem(row, ADSB_COL_STATUS, new QTableWidgetItem("No emergency")); - ui->adsbData->setItem(row, ADSB_COL_SQUAWK, new QTableWidgetItem("Squawk")); - ui->adsbData->setItem(row, ADSB_COL_IDENT, new QTableWidgetItem("Ident")); - ui->adsbData->setItem(row, ADSB_COL_REGISTRATION, new QTableWidgetItem("G-888888")); - ui->adsbData->setItem(row, ADSB_COL_REGISTERED, new QTableWidgetItem("8888-88-88")); - ui->adsbData->setItem(row, ADSB_COL_MANUFACTURER, new QTableWidgetItem("The Boeing Company")); - ui->adsbData->setItem(row, ADSB_COL_OWNER, new QTableWidgetItem("British Airways")); - ui->adsbData->setItem(row, ADSB_COL_OPERATOR_ICAO, new QTableWidgetItem("Operator")); - ui->adsbData->setItem(row, ADSB_COL_AP, new QTableWidgetItem("AP")); - ui->adsbData->setItem(row, ADSB_COL_V_MODE, new QTableWidgetItem("V Mode")); - ui->adsbData->setItem(row, ADSB_COL_L_MODE, new QTableWidgetItem("L Mode")); - ui->adsbData->setItem(row, ADSB_COL_TCAS, new QTableWidgetItem("TCAS")); - ui->adsbData->setItem(row, ADSB_COL_ACAS, new QTableWidgetItem("No ACAS")); - ui->adsbData->setItem(row, ADSB_COL_RA, new QTableWidgetItem("RA")); - ui->adsbData->setItem(row, ADSB_COL_MAX_SPEED, new QTableWidgetItem("600-1200")); - ui->adsbData->setItem(row, ADSB_COL_VERSION, new QTableWidgetItem("Version")); - ui->adsbData->setItem(row, ADSB_COL_LENGTH, new QTableWidgetItem("85")); - ui->adsbData->setItem(row, ADSB_COL_WIDTH, new QTableWidgetItem("72.5")); - ui->adsbData->setItem(row, ADSB_COL_BARO, new QTableWidgetItem("Baro (mb)")); - ui->adsbData->setItem(row, ADSB_COL_HEADWIND, new QTableWidgetItem("H Wnd (kn)")); - ui->adsbData->setItem(row, ADSB_COL_EST_AIR_TEMP, new QTableWidgetItem("OAT (C)")); - ui->adsbData->setItem(row, ADSB_COL_WIND_SPEED, new QTableWidgetItem("Wnd (kn)")); - ui->adsbData->setItem(row, ADSB_COL_WIND_DIR, new QTableWidgetItem("Wnd (o)")); - ui->adsbData->setItem(row, ADSB_COL_STATIC_PRESSURE, new QTableWidgetItem("P (hPa)")); - ui->adsbData->setItem(row, ADSB_COL_STATIC_AIR_TEMP, new QTableWidgetItem("T (C)")); - ui->adsbData->setItem(row, ADSB_COL_HUMIDITY, new QTableWidgetItem("U (%)")); - ui->adsbData->setItem(row, ADSB_COL_LATITUDE, new QTableWidgetItem("-90.00000")); - ui->adsbData->setItem(row, ADSB_COL_LONGITUDE, new QTableWidgetItem("-180.000000")); - ui->adsbData->setItem(row, ADSB_COL_IC, new QTableWidgetItem("63")); - ui->adsbData->setItem(row, ADSB_COL_TIME, new QTableWidgetItem("99:99:99")); - ui->adsbData->setItem(row, ADSB_COL_FRAMECOUNT, new QTableWidgetItem("Frames")); - ui->adsbData->setItem(row, ADSB_COL_ADSB_FRAMECOUNT, new QTableWidgetItem("ADS-B FC")); - ui->adsbData->setItem(row, ADSB_COL_MODES_FRAMECOUNT, new QTableWidgetItem("Mode S FC")); - ui->adsbData->setItem(row, ADSB_COL_NON_TRANSPONDER, new QTableWidgetItem("Non-transponder")); - ui->adsbData->setItem(row, ADSB_COL_TIS_B_FRAMECOUNT, new QTableWidgetItem("TIS-B FC")); - ui->adsbData->setItem(row, ADSB_COL_ADSR_FRAMECOUNT, new QTableWidgetItem("ADS-R FC")); - ui->adsbData->setItem(row, ADSB_COL_RADIUS, new QTableWidgetItem("< 0.1 NM")); - ui->adsbData->setItem(row, ADSB_COL_NACP, new QTableWidgetItem("< 0.05 NM")); - ui->adsbData->setItem(row, ADSB_COL_NACV, new QTableWidgetItem("< 0.3 m/s")); - ui->adsbData->setItem(row, ADSB_COL_GVA, new QTableWidgetItem(">= 150 m")); - ui->adsbData->setItem(row, ADSB_COL_NIC, new QTableWidgetItem("< 0.05 NM")); - ui->adsbData->setItem(row, ADSB_COL_NIC_BARO, new QTableWidgetItem("")); - ui->adsbData->setItem(row, ADSB_COL_SIL, new QTableWidgetItem("<= 1e-7 ph")); - ui->adsbData->setItem(row, ADSB_COL_CORRELATION, new QTableWidgetItem("0.001/0.001/0.001")); - ui->adsbData->setItem(row, ADSB_COL_RSSI, new QTableWidgetItem("-100.0")); - ui->adsbData->setItem(row, ADSB_COL_FLIGHT_STATUS, new QTableWidgetItem("scheduled")); - ui->adsbData->setItem(row, ADSB_COL_DEP, new QTableWidgetItem("WWWW")); - ui->adsbData->setItem(row, ADSB_COL_ARR, new QTableWidgetItem("WWWW")); - ui->adsbData->setItem(row, ADSB_COL_STOPS, new QTableWidgetItem("WWWW")); - ui->adsbData->setItem(row, ADSB_COL_STD, new QTableWidgetItem("12:00 -1")); - ui->adsbData->setItem(row, ADSB_COL_ETD, new QTableWidgetItem("12:00 -1")); - ui->adsbData->setItem(row, ADSB_COL_ATD, new QTableWidgetItem("12:00 -1")); - ui->adsbData->setItem(row, ADSB_COL_STA, new QTableWidgetItem("12:00 +1")); - ui->adsbData->setItem(row, ADSB_COL_ETA, new QTableWidgetItem("12:00 +1")); - ui->adsbData->setItem(row, ADSB_COL_ATA, new QTableWidgetItem("12:00 +1")); - ui->adsbData->resizeColumnsToContents(); - ui->adsbData->setRowCount(row); -} - -Aircraft* ADSBDemodGUI::findAircraftByFlight(const QString& flight) -{ - QHash::iterator i = m_aircraft.begin(); - while (i != m_aircraft.end()) - { - Aircraft *aircraft = i.value(); - if (aircraft->m_flight == flight) { - return aircraft; - } - ++i; - } - return nullptr; -} + // Size the columns to fit representative data, so they don't have to be resized + // when an aircraft with a long value turns up. The table used to be filled with a + // dummy row for this; with a model the widths are measured directly instead. + static const char *sampleData[ADSBDEMOD_COLUMNS] = { + "ICAO ID", // ICAO + "WWW88WW", // CALLSIGN + "ATC Callsign-", // ATC_CALLSIGN + "Aircraft12345", // MODEL + "WWWW", // TYPE + "sideview", // SIDEVIEW + "airbrigdecargo1", // AIRLINE + "Country", // COUNTRY + "GS (kn)", // GROUND_SPEED + "TAS (kn)", // TRUE_AIRSPEED + "IAS (kn)", // INDICATED_AIRSPEED + "0.999", // MACH + "Sel Alt (ft)", // SEL_ALTITUDE + "Surface", // ALTITUDE + "VR (ft/m)", // VERTICALRATE + "Sel Hd (o)", // SEL_HEADING + "Hd (o)", // HEADING + "Trk (o)", // TRACK + "TR (o/s)", // TURNRATE + "Roll (o)", // ROLL + "D (km)", // RANGE + "Az/El (o)", // AZEL + "Rotorcraft", // CATEGORY + "No emergency", // STATUS + "Squawk", // SQUAWK + "Ident", // IDENT + "G-888888", // REGISTRATION + "8888-88-88", // REGISTERED + "The Boeing Company", // MANUFACTURER + "British Airways", // OWNER + "Operator", // OPERATOR_ICAO + "AP", // AP + "V Mode", // V_MODE + "L Mode", // L_MODE + "TCAS", // TCAS + "No ACAS", // ACAS + "RA", // RA + "600-1200", // MAX_SPEED + "Version", // VERSION + "85", // LENGTH + "72.5", // WIDTH + "Baro (mb)", // BARO + "H Wnd (kn)", // HEADWIND + "OAT (C)", // EST_AIR_TEMP + "Wnd (kn)", // WIND_SPEED + "Wnd (o)", // WIND_DIR + "P (hPa)", // STATIC_PRESSURE + "T (C)", // STATIC_AIR_TEMP + "U (%)", // HUMIDITY + "-90.00000", // LATITUDE + "-180.000000", // LONGITUDE + "63", // IC + "99:99:99", // TIME + "Frames", // FRAMECOUNT + "ADS-B FC", // ADSB_FRAMECOUNT + "Mode S FC", // MODES_FRAMECOUNT + "Non-transponder", // NON_TRANSPONDER + "TIS-B FC", // TIS_B_FRAMECOUNT + "ADS-R FC", // ADSR_FRAMECOUNT + "< 0.1 NM", // RADIUS + "< 0.05 NM", // NACP + "< 0.3 m/s", // NACV + ">= 150 m", // GVA + "< 0.05 NM", // NIC + "", // NIC_BARO + "<= 1e-7 ph", // SIL + "0.001/0.001/0.001", // CORRELATION + "-100.0", // RSSI + "scheduled", // FLIGHT_STATUS + "WWWW", // DEP + "WWWW", // ARR + "WWWW", // STOPS + "12:00 -1", // STD + "12:00 -1", // ETD + "12:00 -1", // ATD + "12:00 +1", // STA + "12:00 +1", // ETA + "12:00 +1", // ATA + }; -// Convert to hh:mm (+/-days) -QString ADSBDemodGUI::dataTimeToShortString(QDateTime dt) -{ - if (dt.isValid()) + QFontMetrics metrics(ui->adsbData->font()); + const QString *names = ADSBAircraftTableModel::columnNames(); + // Room for the sort indicator and cell margins + const int padding = 4 * ui->adsbData->style()->pixelMetric(QStyle::PM_HeaderMargin) + 12; + + for (int col = 0; col < ADSBDEMOD_COLUMNS; col++) { - QDate currentDate = QDateTime::currentDateTimeUtc().date(); - if (dt.date() == currentDate) - { - return dt.time().toString("hh:mm"); + int width = metrics.horizontalAdvance(names[col]); + const QString sample = QString(sampleData[col]); + + if (!sample.isEmpty()) { + width = std::max(width, metrics.horizontalAdvance(sample)); } - else - { - int days = currentDate.daysTo(dt.date()); - if (days >= 0) { - return QString("%1 +%2").arg(dt.time().toString("hh:mm")).arg(days); - } else { - return QString("%1 %2").arg(dt.time().toString("hh:mm")).arg(days); - } + // The airline, sideview and country columns show icons + if ((col == ADSB_COL_AIRLINE) || (col == ADSB_COL_SIDEVIEW)) { + width = std::max(width, 85); + } else if (col == ADSB_COL_COUNTRY) { + width = std::max(width, 40); } - } - else - { - return ""; + ui->adsbData->setColumnWidth(col, width + padding); } } -void ADSBDemodGUI::initFlightInformation() -{ - if (m_flightInformation) - { - disconnect(m_flightInformation, &FlightInformation::flightUpdated, this, &ADSBDemodGUI::flightInformationUpdated); - delete m_flightInformation; - m_flightInformation = nullptr; - } - if (!m_settings.m_aviationstackAPIKey.isEmpty()) - { - m_flightInformation = FlightInformation::create(m_settings.m_aviationstackAPIKey); - if (m_flightInformation) { - connect(m_flightInformation, &FlightInformation::flightUpdated, this, &ADSBDemodGUI::flightInformationUpdated); - } - } -} -void ADSBDemodGUI::flightInformationUpdated(const FlightInformation::Flight& flight) -{ - Aircraft* aircraft = findAircraftByFlight(flight.m_flightICAO); - if (aircraft) - { - aircraft->m_flightStatusItem->setText(flight.m_flightStatus); - aircraft->m_depItem->setText(flight.m_departureICAO); - aircraft->m_arrItem->setText(flight.m_arrivalICAO); - aircraft->m_stopsItem->setText(""); - aircraft->m_stdItem->setText(dataTimeToShortString(flight.m_departureScheduled)); - aircraft->m_etdItem->setText(dataTimeToShortString(flight.m_departureEstimated)); - aircraft->m_atdItem->setText(dataTimeToShortString(flight.m_departureActual)); - aircraft->m_staItem->setText(dataTimeToShortString(flight.m_arrivalScheduled)); - aircraft->m_etaItem->setText(dataTimeToShortString(flight.m_arrivalEstimated)); - aircraft->m_ataItem->setText(dataTimeToShortString(flight.m_arrivalActual)); - if (aircraft->m_positionValid) { - m_aircraftModel.aircraftUpdated(aircraft); - } - updatePhotoFlightInformation(aircraft); - } - else - { - qDebug() << "ADSBDemodGUI::flightInformationUpdated - Flight not found in ADS-B table: " << flight.m_flightICAO; - } -} +// Convert to hh:mm (+/-days) void ADSBDemodGUI::aircraftPhoto(const PlaneSpottersPhoto *photo) { // Make sure the photo is for the currently highlighted aircraft, as it may // have taken a while to download - if (!photo->m_pixmap.isNull() && m_highlightAircraft && (m_highlightAircraft->m_icaoItem->text() == photo->m_id)) + if (!photo->m_pixmap.isNull() && m_highlightAircraft && (m_highlightAircraft->cellText(ADSB_COL_ICAO) == photo->m_id)) { ui->photo->setPixmap(photo->m_pixmap); ui->photo->setToolTip(QString("Photographer: %1").arg(photo->m_photographer)); // Required by terms of use @@ -8028,6 +3296,7 @@ void ADSBDemodGUI::on_logOpen_clicked() { QDateTime startTime = QDateTime::currentDateTime(); m_loadingData = true; + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "setLoadingData", Qt::QueuedConnection, Q_ARG(bool, true)); ui->adsbData->blockSignals(true); QTextStream in(&file); QString error; @@ -8054,7 +3323,11 @@ void ADSBDemodGUI::on_logOpen_clicked() { if (cols.size() > maxCol) { - QDateTime dateTime = QDateTime(QDate::fromString(cols[dateCol]), QTime::fromString(cols[timeCol])); + QTime time = QTime::fromString(cols[timeCol], QStringLiteral("hh:mm:ss.zzz")); + if (!time.isValid()) { + time = QTime::fromString(cols[timeCol], QStringLiteral("hh:mm:ss")); + } + QDateTime dateTime = QDateTime(QDate::fromString(cols[dateCol]), time); QByteArray bytes = QByteArray::fromHex(cols[dataCol].toLatin1()); float correlation = cols[correlationCol].toFloat(); int df = (bytes[0] >> 3) & ADS_B_DF_MASK; // Downlink format @@ -8068,7 +3341,8 @@ void ADSBDemodGUI::on_logOpen_clicked() crc.calculate((const uint8_t *)bytes.data(), bytes.size()-3); crcCalc = crc.get(); } - handleADSB(bytes, dateTime, correlation, correlation, crcCalc, false); + m_adsbDemod->getTracker()->getInputMessageQueue()->push( + ADSBDemodReport::MsgReportADSB::create(bytes, correlation, correlation, dateTime, crcCalc)); if ((count > 0) && (count % 100000 == 0)) { dialog.setText(QString("Reading ADS-B data\n%1 (Skipped %2)").arg(count).arg(countOtherDF)); @@ -8094,6 +3368,7 @@ void ADSBDemodGUI::on_logOpen_clicked() } ui->adsbData->blockSignals(false); m_loadingData = false; + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "setLoadingData", Qt::QueuedConnection, Q_ARG(bool, false)); if (m_settings.m_autoResizeTableColumns) ui->adsbData->resizeColumnsToContents(); ui->adsbData->setSortingEnabled(true); @@ -8176,6 +3451,8 @@ void ADSBDemodGUI::downloadAircraftInformationFinished() } m_aircraftInfo = OsnDB::getAircraftInformation(); m_routeInfo = OsnDB::getAircraftRouteInformation(); + // The tracker loads its own references to the same read-only data + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "reloadDatabases", Qt::QueuedConnection); m_aircraftModel.updateAircraftInformation(m_aircraftInfo); if (m_progressDialog) { @@ -8207,52 +3484,9 @@ void ADSBDemodGUI::downloadAirportInformationFinished() } } -int ADSBDemodGUI::squawkDecode(int modeA) const -{ - int a, b, c, d; - c = ((modeA >> 12) & 1) | ((modeA >> (10-1)) & 0x2) | ((modeA >> (8-2)) & 0x4); - a = ((modeA >> 11) & 1) | ((modeA >> (9-1)) & 0x2) | ((modeA >> (7-2)) & 0x4); - b = ((modeA >> 5) & 1) | ((modeA >> (3-1)) & 0x2) | ((modeA << (1)) & 0x4); - d = ((modeA >> 4) & 1) | ((modeA >> (2-1)) & 0x2) | ((modeA << (2)) & 0x4); - return a*1000 + b*100 + c*10 + d; -} - -// https://en.wikipedia.org/wiki/Gillham_code -int ADSBDemodGUI::gillhamToFeet(int n) const -{ - int c1 = (n >> 10) & 1; - int a1 = (n >> 9) & 1; - int c2 = (n >> 8) & 1; - int a2 = (n >> 7) & 1; - int c4 = (n >> 6) & 1; - int a4 = (n >> 5) & 1; - int b1 = (n >> 4) & 1; - int b2 = (n >> 3) & 1; - int d2 = (n >> 2) & 1; - int b4 = (n >> 1) & 1; - int d4 = n & 1; - - int n500 = grayToBinary((d2 << 7) | (d4 << 6) | (a1 << 5) | (a2 << 4) | (a4 << 3) | (b1 << 2) | (b2 << 1) | b4, 8); - int n100 = grayToBinary((c1 << 2) | (c2 << 1) | c4, 3) - 1; - if (n100 == 6) { - n100 = 4; - } - if (n500 %2 != 0) { - n100 = 4 - n100; - } - return -1200 + n500*500 + n100*100; -} -int ADSBDemodGUI::grayToBinary(int gray, int bits) const -{ - int binary = 0; - for (int i = bits - 1; i >= 0; i--) { - binary = binary | ((((1 << (i+1)) & binary) >> 1) ^ ((1 << i) & gray)); - } - return binary; -} void ADSBDemodGUI::redrawMap() { @@ -8402,331 +3636,17 @@ bool ADSBDemodGUI::eventFilter(QObject *obj, QEvent *event) return ChannelGUI::eventFilter(obj, event); } -void ADSBDemodGUI::applyImportSettings() -{ - invalidateImportAuthentication(); - m_importTimer.setInterval(m_settings.m_importPeriod * 1000); - if (m_settings.m_feedEnabled && m_settings.m_importEnabled) { - m_importTimer.start(); - } else { - m_importTimer.stop(); - } -} - -bool ADSBDemodGUI::importCredentialsConfigured() const -{ - return !m_settings.m_importClientId.isEmpty() && !m_settings.m_importClientSecret.isEmpty(); -} - -bool ADSBDemodGUI::importAccessTokenValid() const -{ - return !m_importAccessToken.isEmpty() - && QDateTime::currentDateTimeUtc() < m_importAccessTokenExpiry; -} - -void ADSBDemodGUI::invalidateImportAuthentication() -{ - ++m_importRequestGeneration; - m_importTokenReply.clear(); - m_importStatesReply.clear(); - m_importAccessToken.clear(); - m_importAccessTokenExpiry = QDateTime(); - m_importAuthenticationRetry = false; -} - -void ADSBDemodGUI::requestImportAccessToken() -{ - static const QUrl tokenUrl( - QStringLiteral("https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token")); - - if (!m_networkManager || m_importTokenReply || m_importStatesReply) { - return; - } - - const auto encodeFormComponent = [](const QString& value) { - QByteArray encoded = QUrl::toPercentEncoding(value); - encoded.replace("%20", "+"); - return encoded; - }; - QByteArray form("grant_type=client_credentials&client_id="); - form.append(encodeFormComponent(m_settings.m_importClientId)); - form.append("&client_secret="); - form.append(encodeFormComponent(m_settings.m_importClientSecret)); - - QNetworkRequest request(tokenUrl); - request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded")); - QNetworkReply *reply = m_networkManager->post(request, form); - reply->setProperty("adsbImportReplyType", QStringLiteral("token")); - reply->setProperty("adsbImportGeneration", m_importRequestGeneration); - m_importTokenReply = reply; -} - -void ADSBDemodGUI::sendImportRequest() -{ - if (!m_networkManager || m_importTokenReply || m_importStatesReply) { - return; - } - - QString urlString = "https://"; - urlString = urlString + m_settings.m_importHost + "/api/states/all"; - QChar join = '?'; - if (!m_settings.m_importParameters.isEmpty()) - { - urlString = urlString + join + m_settings.m_importParameters; - join = '&'; - } - if (!m_settings.m_importMinLatitude.isEmpty()) - { - urlString = urlString + join + "lamin=" + m_settings.m_importMinLatitude; - join = '&'; - } - if (!m_settings.m_importMaxLatitude.isEmpty()) - { - urlString = urlString + join + "lamax=" + m_settings.m_importMaxLatitude; - join = '&'; - } - if (!m_settings.m_importMinLongitude.isEmpty()) - { - urlString = urlString + join + "lomin=" + m_settings.m_importMinLongitude; - join = '&'; - } - if (!m_settings.m_importMaxLongitude.isEmpty()) - { - urlString = urlString + join + "lomax=" + m_settings.m_importMaxLongitude; - join = '&'; - } - QNetworkRequest request = QNetworkRequest(QUrl(urlString)); - if (importCredentialsConfigured() && importAccessTokenValid()) { - request.setRawHeader("Authorization", "Bearer " + m_importAccessToken.toUtf8()); - } - - QNetworkReply *reply = m_networkManager->get(request); - reply->setProperty("adsbImportReplyType", QStringLiteral("states")); - reply->setProperty("adsbImportGeneration", m_importRequestGeneration); - m_importStatesReply = reply; -} - -// Import ADS-B data from opensky-network via an API call -void ADSBDemodGUI::import() -{ - if (!m_networkManager || m_importTokenReply || m_importStatesReply) { - return; - } - - m_importAuthenticationRetry = false; - - const bool clientIdSet = !m_settings.m_importClientId.isEmpty(); - const bool clientSecretSet = !m_settings.m_importClientSecret.isEmpty(); - if (clientIdSet != clientSecretSet) - { - qWarning() << "ADSBDemodGUI::import: OpenSky authentication requires both a client ID and client secret"; - return; - } - - if (!clientIdSet || importAccessTokenValid()) { - sendImportRequest(); - } else { - requestImportAccessToken(); - } -} - -void ADSBDemodGUI::handleImportNetworkReply(QNetworkReply *reply) -{ - if (!reply) { - return; - } - - if (m_importTokenReply == reply) { - m_importTokenReply.clear(); - } - if (m_importStatesReply == reply) { - m_importStatesReply.clear(); - } - - const int generation = reply->property("adsbImportGeneration").toInt(); - if (generation != m_importRequestGeneration) - { - reply->deleteLater(); - return; - } - - const QString replyType = reply->property("adsbImportReplyType").toString(); - if (replyType == QStringLiteral("token")) { - handleImportTokenReply(reply); - } else if (replyType == QStringLiteral("states")) { - handleImportReply(reply); - } else { - qWarning() << "ADSBDemodGUI::handleImportNetworkReply: Unknown reply type"; - } - - reply->deleteLater(); -} - -void ADSBDemodGUI::handleImportTokenReply(QNetworkReply *reply) -{ - if (reply->error() != QNetworkReply::NoError) - { - qWarning() << "ADSBDemodGUI::handleImportTokenReply: OpenSky token request failed:" - << reply->errorString(); - m_importAuthenticationRetry = false; - return; - } - - QJsonParseError parseError; - const QJsonDocument document = QJsonDocument::fromJson(reply->readAll(), &parseError); - if ((parseError.error != QJsonParseError::NoError) || !document.isObject()) - { - qWarning() << "ADSBDemodGUI::handleImportTokenReply: Invalid OpenSky token response:" - << parseError.errorString(); - m_importAuthenticationRetry = false; - return; - } - - const QJsonObject object = document.object(); - const QString accessToken = object.value(QStringLiteral("access_token")).toString(); - if (accessToken.isEmpty()) - { - qWarning() << "ADSBDemodGUI::handleImportTokenReply: OpenSky token response has no access token"; - m_importAuthenticationRetry = false; - return; - } - const int expiresIn = object.value(QStringLiteral("expires_in")).toInt(1800); - const int refreshMargin = qMin(30, qMax(0, expiresIn / 10)); - m_importAccessToken = accessToken; - m_importAccessTokenExpiry = QDateTime::currentDateTimeUtc().addSecs(qMax(1, expiresIn - refreshMargin)); - if (m_settings.m_feedEnabled && m_settings.m_importEnabled) { - sendImportRequest(); - } -} -// Handle opensky-network API call reply -void ADSBDemodGUI::handleImportReply(QNetworkReply* reply) -{ - if (reply) - { - const int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - if ((statusCode == 401) && importCredentialsConfigured() && !m_importAuthenticationRetry) - { - m_importAccessToken.clear(); - m_importAccessTokenExpiry = QDateTime(); - m_importAuthenticationRetry = true; - requestImportAccessToken(); - return; - } - if (!reply->error()) - { - QJsonDocument document = QJsonDocument::fromJson(reply->readAll()); - if (document.isObject()) - { - QJsonObject obj = document.object(); - if (obj.contains("time") && obj.contains("states")) - { - int seconds = obj.value("time").toInt(); - QDateTime dateTime = QDateTime::fromSecsSinceEpoch(seconds); - QJsonArray states = obj.value("states").toArray(); - for (int i = 0; i < states.size(); i++) - { - QJsonArray state = states[i].toArray(); - int icao = state[0].toString().toInt(nullptr, 16); - bool newAircraft; - Aircraft *aircraft = getAircraft(icao, newAircraft); - QString callsign = state[1].toString().trimmed(); - if (!callsign.isEmpty()) { - setCallsign(aircraft, callsign); - } - QDateTime timePosition = dateTime; - if (state[3].isNull()) { - timePosition = dateTime.addSecs(-15); // At least 15 seconds old - } else { - timePosition = QDateTime::fromSecsSinceEpoch(state[3].toInt()); - } - aircraft->m_rxTime = QDateTime::fromSecsSinceEpoch(state[4].toInt()); - aircraft->m_updateTime = QDateTime::currentDateTime(); - QTime time = aircraft->m_updateTime.time(); - aircraft->m_timeItem->setText(QString("%1:%2:%3").arg(time.hour(), 2, 10, QLatin1Char('0')).arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0'))); - aircraft->m_adsbFrameCount++; - aircraft->m_adsbFrameCountItem->setData(Qt::DisplayRole, aircraft->m_adsbFrameCount); - - if (timePosition > aircraft->m_positionDateTime) - { - if (!state[5].isNull() && !state[6].isNull()) - { - updateAircraftPosition(aircraft, state[6].toDouble(), state[5].toDouble(), timePosition); - aircraft->m_cprValid[0] = false; - aircraft->m_cprValid[1] = false; - } - if (!state[7].isNull()) - { - aircraft->setAltitude((int)Units::metresToFeet(state[7].toDouble()), false, dateTime, m_settings); - aircraft->m_altitudeDateTime = timePosition; - } - if (!state[5].isNull() && !state[6].isNull() && !state[7].isNull()) - { - /*QGeoCoordinate coord(aircraft->m_latitude, aircraft->m_longitude, aircraft->m_altitude); - aircraft->m_coordinates.push_back(QVariant::fromValue(coord)); - aircraft->m_coordinateDateTimes.push_back(dateTime); - */ - aircraft->addCoordinate(dateTime, &m_aircraftModel); - } - } - aircraft->m_onSurface = state[8].toBool(false); - aircraft->m_onSurfaceValid = true; - if (!state[9].isNull()) { - aircraft->setGroundspeed((int)std::round(Units::metresPerSecondToKnots(state[9].toDouble())), m_settings); - } - if (!state[10].isNull()) { - aircraft->setTrack((float)state[10].toDouble(), aircraft->m_rxTime); - } - if (!state[11].isNull()) { - aircraft->setVerticalRate((int)std::round(Units::metresPerSecondToFeetPerMin(state[11].toDouble())), m_settings); - } - if (!state[14].isNull()) - { - aircraft->m_squawk = state[14].toString().toInt(); - aircraft->m_squawkItem->setText(QString("%1").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); - } - // Update aircraft in map - if (aircraft->m_positionValid) - { - // Check to see if we need to start any animations - QList *animations = animate(dateTime, aircraft); - // Update map displayed in channel - m_aircraftModel.aircraftUpdated(aircraft); - // Send to Map feature - sendToMap(aircraft, animations); - } - // Check to see if we need to emit a notification about this aircraft - checkDynamicNotification(aircraft); - } - } - else - { - qDebug() << "ADSBDemodGUI::handleImportReply: Document object does not contain time and states: " << document; - } - } - else - { - qDebug() << "ADSBDemodGUI::handleImportReply: Document is not an object: " << document; - } - } - else - { - qWarning() << "ADSBDemodGUI::handleImportReply: OpenSky states request failed:" - << reply->errorString(); - } - m_importAuthenticationRetry = false; - } -} void ADSBDemodGUI::updatePosition(float latitude, float longitude, float altitude) { @@ -8739,6 +3659,8 @@ void ADSBDemodGUI::updatePosition(float latitude, float longitude, float altitud if (stationPosition != previousPosition) { m_azEl.setLocation(latitude, longitude, altitude); + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "setPosition", Qt::QueuedConnection, + Q_ARG(float, latitude), Q_ARG(float, longitude), Q_ARG(float, altitude)); // Update distances and what is visible, but only do it if position has changed significantly if (!m_lastFullUpdatePosition.isValid() || (stationPosition.distanceTo(m_lastFullUpdatePosition) >= 1000)) @@ -8859,22 +3781,6 @@ void ADSBDemodGUI::on_qnh_valueChanged(int value) applySetting("qnh"); } -void ADSBDemodGUI::updateQNH(const Aircraft *aircraft, float qnh) -{ - if (!m_settings.m_manualQNH) - { - // Ignore aircraft that have QNH set to STD. - if ( ((qnh < 1012) || (std::floor(qnh) > 1013)) - || ( (aircraft->m_altitudeValid && (aircraft->m_altitude < (m_settings.m_transitionAlt - 1000))) - && (aircraft->m_selAltitudeValid && (aircraft->m_selAltitude < m_settings.m_transitionAlt)) // If we have qnh, we'll have selAltitude as well - ) - ) { - // Use moving average, otherwise it can jump around if we can receive aircraft from different airports with different QNH - m_qnhAvg(qnh); - ui->qnh->setValue((int)round(m_qnhAvg.instantAverage())); - } - } -} void ADSBDemodGUI::makeUIConnections() { @@ -8884,8 +3790,8 @@ void ADSBDemodGUI::makeUIConnections() QObject::connect(ui->chipsThreshold, &QDial::valueChanged, this, &ADSBDemodGUI::on_chipsThreshold_valueChanged); QObject::connect(ui->phaseSteps, &QDial::valueChanged, this, &ADSBDemodGUI::on_phaseSteps_valueChanged); QObject::connect(ui->tapsPerPhase, &QDial::valueChanged, this, &ADSBDemodGUI::on_tapsPerPhase_valueChanged); - QObject::connect(ui->adsbData, &QTableWidget::cellClicked, this, &ADSBDemodGUI::on_adsbData_cellClicked); - QObject::connect(ui->adsbData, &QTableWidget::cellDoubleClicked, this, &ADSBDemodGUI::on_adsbData_cellDoubleClicked); + QObject::connect(ui->adsbData, &QTableView::clicked, this, &ADSBDemodGUI::adsbData_clicked); + QObject::connect(ui->adsbData, &QTableView::doubleClicked, this, &ADSBDemodGUI::adsbData_doubleClicked); QObject::connect(ui->spb, QOverload::of(&QComboBox::currentIndexChanged), this, &ADSBDemodGUI::on_spb_currentIndexChanged); QObject::connect(ui->demodModeS, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_demodModeS_clicked); QObject::connect(ui->feed, &ButtonSwitch::clicked, this, &ADSBDemodGUI::on_feed_clicked); @@ -8920,117 +3826,18 @@ void ADSBDemodGUI::updateAbsoluteCenterFrequency() setStatusFrequency(m_deviceCenterFrequency + m_settings.m_inputFrequencyOffset); } -void ADSBDemodGUI::initCoverageMap() -{ - float lat = m_azEl.getLocationSpherical().m_latitude; - float lon = m_azEl.getLocationSpherical().m_longitude; - for (int i = 0; i < 2; i++) - { -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) - m_maxRange[i].resize(360/ADSBDemodGUI::m_maxRangeDeg, 0.0f); -#else - for (int j = 0; j < 360/ADSBDemodGUI::m_maxRangeDeg; j++) { - m_maxRange[i].append(0.0f); - } -#endif - m_coverageAirspace[i].m_polygon.resize(2 * 360/ADSBDemodGUI::m_maxRangeDeg); - m_coverageAirspace[i].m_center.setX(lon); - m_coverageAirspace[i].m_center.setY(lat); - if (i == 0) - { - m_coverageAirspace[i].m_position.setX(lon); - m_coverageAirspace[i].m_position.setY(lat); - m_coverageAirspace[i].m_bottom.m_alt = 0; - m_coverageAirspace[i].m_top.m_alt = 10000; - m_coverageAirspace[i].m_name = "Coverage Map Low"; - } - else - { - m_coverageAirspace[i].m_position.setX(lon); - m_coverageAirspace[i].m_position.setY(lat + 0.01); - m_coverageAirspace[i].m_bottom.m_alt = 10000; - m_coverageAirspace[i].m_top.m_alt = 66000; - m_coverageAirspace[i].m_name = "Coverage Map High"; - } - } - clearCoverageMap(); -} -void ADSBDemodGUI::clearCoverageMap() -{ - for (int j = 0; j < 2; j++) - { - for (int i = 0; i < m_maxRange[j].size(); i++) { - m_maxRange[j][i] = 0.0f; - } - const float d = 0.01f; - for (int i = 0; i < m_coverageAirspace[j].m_polygon.size(); i+=2) - { - float f = i / (float) m_coverageAirspace[j].m_polygon.size(); - m_coverageAirspace[j].m_polygon[i].setX(m_coverageAirspace[j].m_center.x() + d * sin(f * 2*M_PI)); - m_coverageAirspace[j].m_polygon[i].setY(m_coverageAirspace[j].m_center.y() + d * cos(f * 2*M_PI)); - m_coverageAirspace[j].m_polygon[i+1].setX(m_coverageAirspace[j].m_center.x() + d * sin(f * 2*M_PI)); - m_coverageAirspace[j].m_polygon[i+1].setY(m_coverageAirspace[j].m_center.y() + d * cos(f * 2*M_PI)); - } - } -} // Lats and longs in decimal degrees. Distance in metres. Bearing in degrees. // https://www.movable-type.co.uk/scripts/latlong.html -static void calcRadialEndPoint(float startLatitude, float startLongitude, float distance, float bearing, float &endLatitude, float &endLongitude) -{ - double startLatRad = startLatitude*M_PI/180.0; - double startLongRad = startLongitude*M_PI/180.0; - double theta = bearing*M_PI/180.0; - double earthRadius = 6378137.0; // At equator - double delta = distance/earthRadius; - double endLatRad = std::asin(sin(startLatRad)*cos(delta) + cos(startLatRad)*sin(delta)*cos(theta)); - double endLongRad = startLongRad + std::atan2(sin(theta)*sin(delta)*cos(startLatRad), cos(delta) - sin(startLatRad)*sin(endLatRad)); - endLatitude = endLatRad*180.0/M_PI; - endLongitude = endLongRad*180.0/M_PI; -} - -void ADSBDemodGUI::updateCoverageMap(float azimuth, float elevation, float distance, float altitude) -{ - (void) elevation; - - int i = (int) (azimuth / ADSBDemodGUI::m_maxRangeDeg); - int k = altitude >= 10000 ? 1 : 0; - if (distance > m_maxRange[k][i]) - { - m_maxRange[k][i] = distance; - - float lat; - float lon; - float b1 = i * ADSBDemodGUI::m_maxRangeDeg; - calcRadialEndPoint(m_azEl.getLocationSpherical().m_latitude, m_azEl.getLocationSpherical().m_longitude, distance, b1, lat, lon); - m_coverageAirspace[k].m_polygon[i*2].setX(lon); - m_coverageAirspace[k].m_polygon[i*2].setY(lat); - - float b2 = (i + 1) * ADSBDemodGUI::m_maxRangeDeg; - calcRadialEndPoint(m_azEl.getLocationSpherical().m_latitude, m_azEl.getLocationSpherical().m_longitude, distance, b2, lat, lon); - m_coverageAirspace[k].m_polygon[i*2+1].setX(lon); - m_coverageAirspace[k].m_polygon[i*2+1].setY(lat); - - m_airspaceModel.airspaceUpdated(&m_coverageAirspace[k]); - } -} - -void ADSBDemodGUI::clearCoverage(const QPoint& p) -{ - (void) p; - - clearCoverageMap(); - for (int i = 0; i < 2; i++) { - m_airspaceModel.airspaceUpdated(&m_coverageAirspace[i]); - } -} - void ADSBDemodGUI::clearStats(const QPoint& p) { (void) p; - resetStats(); + for (int i = 0; i < ui->statsTable->rowCount(); i++) { + ui->statsTable->item(i, 0)->setData(Qt::DisplayRole, 0); + } + QMetaObject::invokeMethod(m_adsbDemod->getTracker(), "resetStats", Qt::QueuedConnection); } void ADSBDemodGUI::clearChart(const QPoint& p) diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.h b/plugins/channelrx/demodadsb/adsbdemodgui.h index 8745bc40c..6a2ffaffa 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.h +++ b/plugins/channelrx/demodadsb/adsbdemodgui.h @@ -20,6 +20,9 @@ #define INCLUDE_ADSBDEMODGUI_H #include +#include +#include +#include #include #include #include @@ -31,6 +34,9 @@ #include #include +#include "adsbaircraft.h" +#include "adsbaircrafttablemodel.h" +#include "adsbdemodtracker.h" #include "channel/channelgui.h" #include "dsp/dsptypes.h" #include "dsp/channelmarker.h" @@ -69,122 +75,10 @@ namespace Ui { using namespace QtCharts; #endif -// Custom widget to allow formatted decimal numbers to be sorted numerically -class CustomDoubleTableWidgetItem : public QTableWidgetItem -{ -public: - CustomDoubleTableWidgetItem(const QString text = QString("")) : - QTableWidgetItem(text) - { - } - - bool operator <(const QTableWidgetItem& other) const - { - // Treat "" as less than 0 - QString thisText = text(); - QString otherText = other.text(); - if (thisText == "") - return true; - if (otherText == "") - return false; - return thisText.toDouble() < otherText.toDouble(); - } -}; - -// Data about an aircraft extracted from ADS-B and Mode-S frames -struct Aircraft { - int m_icao; // 24-bit ICAO aircraft address - QString m_icaoHex; - QString m_callsign; // Flight callsign - QString m_flight; // Guess at flight number - bool m_globalPosition; // Position has been determined from global decode - Real m_latitude; // Latitude in decimal degrees - Real m_longitude; // Longitude in decimal degrees - float m_radius; // Horizontal containment radius limit (Rc) in metres - int m_altitude; // Altitude in feet (will be 0 if on surface) - int m_pressureAltitude; // Pressure altitude in feet for Map PFD altimeter (can be negative on surface) - bool m_onSurface; // Indicates if on surface or airborne - bool m_altitudeGNSS; // Altitude is GNSS HAE (Height above WGS-84 ellipsoid) rather than barometric alitute (relative to 29.92 Hg) - float m_heading; // Heading in degrees magnetic - float m_track; // Track in degrees true? - int m_verticalRate; // Vertical climb rate in ft/min - QString m_emitterCategory; // Aircraft type - QString m_status; // Aircraft status - int m_squawk; // Mode-A code - bool m_spi; // Special position identification (IDENT) active - Real m_range; // Distance from station to aircraft - Real m_azimuth; // Azimuth from station to aircraft - Real m_elevation; // Elevation from station to aircraft - QDateTime m_rxTime; // When last frame received (can be long ago if reading from log file) - QDateTime m_updateTime; // Last time we updated data for this aircraft (used for determining when to remove an aircraft) - - int m_selAltitude; // Selected altitude in MCP/FCU or FMS in feet - int m_selHeading; // Selected heading in MCP/FCU in degrees - float m_baro; // Aircraft baro setting in mb (Mode-S) - float m_roll; // In degrees - int m_groundspeed; // In knots - float m_turnRate; // In degrees per second - int m_trueAirspeed; // In knots - int m_indicatedAirspeed; // In knots - float m_mach; // Mach number - bool m_autopilot; - bool m_vnavMode; - bool m_altHoldMode; - bool m_approachMode; - bool m_lnavMode; - bool m_tcasOperational; // Appears only to be true if TA/RA, false if TA ONLY - - bool m_bdsCapabilities[16][16]; // BDS capabilities are indicaited by BDS 1.7 - int m_adsbVersion; - bool m_nicSupplementA; - bool m_nicSupplementB; - bool m_nicSupplementC; - - bool m_positionValid; // Indicates if we have valid data for the above fields - bool m_altitudeValid; - bool m_pressureAltitudeValid; - bool m_onSurfaceValid; - bool m_headingValid; - bool m_trackValid; - bool m_verticalRateValid; - bool m_selAltitudeValid; - bool m_selHeadingValid; - bool m_baroValid; - bool m_rollValid; - bool m_groundspeedValid; - bool m_turnRateValid; - bool m_trueAirspeedValid; - bool m_indicatedAirspeedValid; - bool m_machValid; - bool m_autopilotValid; - bool m_vnavModeValid; - bool m_altHoldModeValid; - bool m_approachModeValid; - bool m_lnavModeValid; - bool m_tcasOperationalValid; - - bool m_bdsCapabilitiesValid; - bool m_adsbVersionValid; - bool m_nicSupplementAValid; - bool m_nicSupplementBValid; - bool m_nicSupplementCValid; - - // State for calculating position using two CPR frames - bool m_cprValid[2]; - double m_cprLat[2]; - double m_cprLong[2]; - QDateTime m_cprTime[2]; - - int m_adsbFrameCount; // Number of ADS-B frames for this aircraft - int m_modesFrameCount; // Number of Mode-S frames for this aircraft - int m_nonTransponderFrameCount; - int m_tisBFrameCount; - int m_adsrFrameCount; - float m_minCorrelation; - float m_maxCorrelation; - float m_correlation; - MovingAverageUtil m_correlationAvg; - +// The aircraft as the GUI needs it: the decoded state, plus the flight path shown on +// the map and the icons shown in the table +struct Aircraft : ADSBAircraft { + // Selection state, which belongs to the user rather than to the decoder bool m_isTarget; // Are we targeting this aircraft (sending az/el to rotator) bool m_isHighlighted; // Are we highlighting this aircraft in the table and map bool m_showAll; @@ -196,325 +90,20 @@ struct Aircraft { QList m_recentCoordinateColors; int m_lastColor; - AircraftInformation *m_aircraftInfo; // Info about the aircraft from the database - QString m_aircraft3DModel; // 3D model for map based on aircraft type - QString m_aircraftCat3DModel; // 3D model based on aircraft category - float m_modelAltitudeOffset; // Altitude adjustment so aircraft model doesn't go underground - float m_labelAltitudeOffset; // How height to position label above aircraft ADSBDemodGUI *m_gui; - QString m_flagIconURL; - QString m_airlineIconURL; - QString m_sideviewIconURL; - - // For animation on 3D map - float m_runwayAltitude; - bool m_runwayAltitudeValid; - bool m_gearDown; - float m_flaps; // 0 - no flaps, 1 - full flaps - bool m_rotorStarted; // Rotors started on 'Rotorcraft' - bool m_engineStarted; // Engines started (typically propellors) - QDateTime m_positionDateTime; - QDateTime m_orientationDateTime; // FIXME - QDateTime m_headingDateTime; - QDateTime m_trackDateTime; - QDateTime m_altitudeDateTime; - QDateTime m_indicatedAirspeedDateTime; - QDateTime m_prevTrackDateTime; - int m_prevTrack; - float m_trackWhenHeadingSet; - float m_pitchEst; // Estimated pitch based on vertical rate - float m_rollEst; // Estimated roll based on rate of change in heading - - bool m_notified; // Set when a notification has been made for this aircraft, so we don't repeat it - - // GUI table items for above data - QTableWidgetItem *m_icaoItem; - QTableWidgetItem *m_callsignItem; - QTableWidgetItem* m_atcCallsignItem; - QTableWidgetItem *m_modelItem; - QTableWidgetItem *m_typeItem; - QTableWidgetItem *m_sideviewItem; - QTableWidgetItem *m_airlineItem; - QTableWidgetItem *m_latitudeItem; - QTableWidgetItem *m_longitudeItem; - QTableWidgetItem *m_altitudeItem; - QTableWidgetItem *m_headingItem; - QTableWidgetItem *m_trackItem; - QTableWidgetItem *m_verticalRateItem; - CustomDoubleTableWidgetItem *m_rangeItem; - QTableWidgetItem *m_azElItem; - QTableWidgetItem *m_emitterCategoryItem; - QTableWidgetItem *m_statusItem; - QTableWidgetItem *m_squawkItem; - QTableWidgetItem *m_identItem; - QTableWidgetItem *m_registrationItem; - QTableWidgetItem *m_countryItem; - QTableWidgetItem *m_registeredItem; - QTableWidgetItem *m_manufacturerNameItem; - QTableWidgetItem *m_ownerItem; - QTableWidgetItem *m_operatorICAOItem; - QTableWidgetItem *m_interogatorCodeItem; - QTableWidgetItem *m_timeItem; - QTableWidgetItem *m_totalFrameCountItem; - QTableWidgetItem *m_adsbFrameCountItem; - QTableWidgetItem *m_modesFrameCountItem; - QTableWidgetItem *m_nonTransponderItem; - QTableWidgetItem *m_tisBFrameCountItem; - QTableWidgetItem *m_adsrFrameCountItem; - QTableWidgetItem *m_radiusItem; - QTableWidgetItem *m_nacpItem; - QTableWidgetItem *m_nacvItem; - QTableWidgetItem *m_gvaItem; - QTableWidgetItem *m_nicItem; - QTableWidgetItem *m_nicBaroItem; - QTableWidgetItem *m_silItem; - QTableWidgetItem *m_correlationItem; - QTableWidgetItem *m_rssiItem; - QTableWidgetItem *m_flightStatusItem; - QTableWidgetItem *m_depItem; - QTableWidgetItem *m_arrItem; - QTableWidgetItem *m_stopsItem; - QTableWidgetItem *m_stdItem; - QTableWidgetItem *m_etdItem; - QTableWidgetItem *m_atdItem; - QTableWidgetItem *m_staItem; - QTableWidgetItem *m_etaItem; - QTableWidgetItem *m_ataItem; - QTableWidgetItem *m_selAltitudeItem; - QTableWidgetItem *m_selHeadingItem; - QTableWidgetItem *m_baroItem; - QTableWidgetItem *m_apItem; - QTableWidgetItem *m_vModeItem; - QTableWidgetItem *m_lModeItem; - QTableWidgetItem *m_tcasItem; - QTableWidgetItem *m_acasItem; - QTableWidgetItem *m_raItem; - QTableWidgetItem *m_maxSpeedItem; - QTableWidgetItem *m_versionItem; - QTableWidgetItem *m_lengthItem; - QTableWidgetItem *m_widthItem; - QTableWidgetItem *m_rollItem; - QTableWidgetItem *m_groundspeedItem; - QTableWidgetItem *m_turnRateItem; - QTableWidgetItem *m_trueAirspeedItem; - QTableWidgetItem *m_indicatedAirspeedItem; - QTableWidgetItem *m_machItem; - QTableWidgetItem *m_headwindItem; - QTableWidgetItem *m_estAirTempItem; - QTableWidgetItem *m_windSpeedItem; - QTableWidgetItem *m_windDirItem; - QTableWidgetItem *m_staticPressureItem; - QTableWidgetItem *m_staticAirTempItem; - QTableWidgetItem *m_humidityItem; Aircraft(ADSBDemodGUI *gui) : - m_icao(0), - m_globalPosition(false), - m_latitude(0), - m_longitude(0), - m_radius(0.0f), - m_altitude(0), - m_pressureAltitude(0), - m_onSurface(false), - m_altitudeGNSS(false), - m_heading(0), - m_track(0), - m_verticalRate(0), - m_squawk(0), - m_spi(false), - m_range(0.0f), - m_azimuth(0), - m_elevation(0), - m_selAltitude(0), - m_selHeading(0), - m_baro(0), - m_roll(0.0f), - m_groundspeed(0), - m_turnRate(0.0f), - m_trueAirspeed(0), - m_indicatedAirspeed(0), - m_mach(0.0f), - m_autopilot(false), - m_vnavMode(false), - m_altHoldMode(false), - m_approachMode(false), - m_lnavMode(false), - m_tcasOperational(false), - m_adsbVersion(0), - m_nicSupplementA(false), - m_nicSupplementB(false), - m_nicSupplementC(false), - m_positionValid(false), - m_altitudeValid(false), - m_pressureAltitudeValid(false), - m_onSurfaceValid(false), - m_headingValid(false), - m_trackValid(false), - m_verticalRateValid(false), - m_selAltitudeValid(false), - m_selHeadingValid(false), - m_baroValid(false), - m_rollValid(false), - m_groundspeedValid(false), - m_turnRateValid(false), - m_trueAirspeedValid(false), - m_indicatedAirspeedValid(false), - m_machValid(false), - m_autopilotValid(false), - m_vnavModeValid(false), - m_altHoldModeValid(false), - m_approachModeValid(false), - m_lnavModeValid(false), - m_tcasOperationalValid(false), - m_bdsCapabilitiesValid(false), - m_adsbVersionValid(false), - m_nicSupplementAValid(false), - m_nicSupplementBValid(false), - m_nicSupplementCValid(false), - m_adsbFrameCount(0), - m_modesFrameCount(0), - m_nonTransponderFrameCount(0), - m_tisBFrameCount(0), - m_adsrFrameCount(0), - m_minCorrelation(INFINITY), - m_maxCorrelation(-INFINITY), - m_correlation(0.0f), m_isTarget(false), m_isHighlighted(false), m_showAll(false), m_lastColor(-1), - m_aircraftInfo(nullptr), - m_modelAltitudeOffset(0.0f), - m_labelAltitudeOffset(5.0f), - m_gui(gui), - m_runwayAltitude(0.0), - m_runwayAltitudeValid(false), - m_gearDown(false), - m_flaps(0.0), - m_rotorStarted(false), - m_engineStarted(false), - m_prevTrack(0), - m_trackWhenHeadingSet(0.0f), - m_pitchEst(0.0), - m_rollEst(0.0), - m_notified(false) + m_gui(gui) { - for (int i = 0; i < 2; i++) { - m_cprValid[i] = false; - m_cprLat[i] = 0.0; - m_cprLong[i] = 0.0; - } - for (int i = 0; i < 16; i++) { - for (int j = 0; j < 16; j++) { - m_bdsCapabilities[i][j] = false; - } - } - // These are deleted by QTableWidget - m_icaoItem = new QTableWidgetItem(); - m_callsignItem = new QTableWidgetItem(); - m_atcCallsignItem = new QTableWidgetItem(); - m_modelItem = new QTableWidgetItem(); - m_typeItem = new QTableWidgetItem(); - m_sideviewItem = new QTableWidgetItem(); - m_airlineItem = new QTableWidgetItem(); - m_altitudeItem = new QTableWidgetItem(); - m_headingItem = new QTableWidgetItem(); - m_trackItem = new QTableWidgetItem(); - m_verticalRateItem = new QTableWidgetItem(); - m_rangeItem = new CustomDoubleTableWidgetItem(); - m_azElItem = new QTableWidgetItem(); - m_latitudeItem = new QTableWidgetItem(); - m_longitudeItem = new QTableWidgetItem(); - m_emitterCategoryItem = new QTableWidgetItem(); - m_statusItem = new QTableWidgetItem(); - m_squawkItem = new QTableWidgetItem(); - m_identItem = new QTableWidgetItem(); - m_registrationItem = new QTableWidgetItem(); - m_countryItem = new QTableWidgetItem(); - m_registeredItem = new QTableWidgetItem(); - m_manufacturerNameItem = new QTableWidgetItem(); - m_ownerItem = new QTableWidgetItem(); - m_operatorICAOItem = new QTableWidgetItem(); - m_interogatorCodeItem = new QTableWidgetItem(); - m_timeItem = new QTableWidgetItem(); - m_totalFrameCountItem = new QTableWidgetItem(); - m_adsbFrameCountItem = new QTableWidgetItem(); - m_modesFrameCountItem = new QTableWidgetItem(); - m_nonTransponderItem = new QTableWidgetItem(); - m_tisBFrameCountItem = new QTableWidgetItem(); - m_adsrFrameCountItem = new QTableWidgetItem(); - m_radiusItem = new QTableWidgetItem(); - m_nacpItem = new QTableWidgetItem(); - m_nacvItem = new QTableWidgetItem(); - m_gvaItem = new QTableWidgetItem(); - m_nicItem = new QTableWidgetItem(); - m_nicBaroItem = new QTableWidgetItem(); - m_silItem = new QTableWidgetItem(); - m_correlationItem = new QTableWidgetItem(); - m_rssiItem = new QTableWidgetItem(); - m_flightStatusItem = new QTableWidgetItem(); - m_depItem = new QTableWidgetItem(); - m_arrItem = new QTableWidgetItem(); - m_stopsItem = new QTableWidgetItem(); - m_stdItem = new QTableWidgetItem(); - m_etdItem = new QTableWidgetItem(); - m_atdItem = new QTableWidgetItem(); - m_staItem = new QTableWidgetItem(); - m_etaItem = new QTableWidgetItem(); - m_ataItem = new QTableWidgetItem(); - m_selAltitudeItem = new QTableWidgetItem(); - m_selHeadingItem = new QTableWidgetItem(); - m_baroItem = new QTableWidgetItem(); - m_apItem = new QTableWidgetItem(); - m_vModeItem = new QTableWidgetItem(); - m_lModeItem = new QTableWidgetItem(); - m_tcasItem = new QTableWidgetItem(); - m_acasItem = new QTableWidgetItem(); - m_raItem = new QTableWidgetItem(); - m_maxSpeedItem = new QTableWidgetItem(); - m_versionItem = new QTableWidgetItem(); - m_lengthItem = new QTableWidgetItem(); - m_widthItem = new QTableWidgetItem(); - m_rollItem = new QTableWidgetItem(); - m_groundspeedItem = new QTableWidgetItem(); - m_turnRateItem = new QTableWidgetItem(); - m_trueAirspeedItem = new QTableWidgetItem(); - m_indicatedAirspeedItem = new QTableWidgetItem(); - m_machItem = new QTableWidgetItem(); - m_headwindItem = new QTableWidgetItem(); - m_estAirTempItem = new QTableWidgetItem(); - m_windSpeedItem = new QTableWidgetItem(); - m_windDirItem = new QTableWidgetItem(); - m_staticPressureItem = new QTableWidgetItem(); - m_staticAirTempItem = new QTableWidgetItem(); - m_humidityItem = new QTableWidgetItem(); } Aircraft(const Aircraft&) = delete; Aircraft& operator=(const Aircraft&) = delete; - QString getImage() const; - QString getText(const ADSBDemodSettings *settings, bool all=false) const; - // Label to use for aircraft on map - QString getLabel(const ADSBDemodSettings *settings, QDateTime& dateTime) const; - - // Name to use when selected as a target (E.g. for use as target name in Rotator Controller) - QString targetName() const - { - if (!m_callsign.isEmpty()) - return QString("Callsign: %1").arg(m_callsign); - else - return QString("ICAO: %1").arg(m_icao, 0, 16); - } - - void setOnSurface(const QDateTime& dateTime); - void setAltitude(int altitudeFt, bool gnss, const QDateTime& dateTime, const ADSBDemodSettings& settings); - void setVerticalRate(int verticalRate, const ADSBDemodSettings& settings); - void setGroundspeed(float groundspeed, const ADSBDemodSettings& settings); - void setTrueAirspeed(int airspeed, const ADSBDemodSettings& settings); - void setIndicatedAirspeed(int airspeed, const QDateTime& dateTime, const ADSBDemodSettings& settings); - void setTrack(float track, const QDateTime& dateTime); - void setHeading(float heading, const QDateTime& dateTime); - void addCoordinate(const QDateTime& dateTime, AircraftModel *model); + void addCoordinate(const ADSBAircraftPosition& position, AircraftModel *model); void clearCoordinates(AircraftModel *model); }; @@ -1087,67 +676,6 @@ private: // Match 3D models to Opensky-Network Aircraft database // The database doesn't use consistent names for aircraft, so we use regexps -class ModelMatch { -public: - ModelMatch(const QString &aircraftRegExp, const QString &model) : - m_aircraftRegExp(aircraftRegExp), - m_model(model) - { - m_aircraftRegExp.optimize(); - } - - virtual ~ModelMatch() = default; - - virtual bool match(const QString &aircraft, const QString &manufacturer, QString &model) - { - (void) manufacturer; - - QRegularExpressionMatch match = m_aircraftRegExp.match(aircraft); - if (match.hasMatch()) - { - model = m_model; - return true; - } - else - { - return false; - } - } - -protected: - QRegularExpression m_aircraftRegExp; - QString m_model; -}; - -// For very generic aircraft names, also match against manufacturer name -class ManufacturerModelMatch : public ModelMatch { -public: - ManufacturerModelMatch(const QString &modelRegExp, const QString &manufacturerRegExp, const QString &model) : - ModelMatch(modelRegExp, model), - m_manufacturerRegExp(manufacturerRegExp) - { - m_manufacturerRegExp.optimize(); - } - - virtual bool match(const QString &aircraft, const QString &manufacturer, QString &model) override - { - QRegularExpressionMatch matchManufacturer = m_manufacturerRegExp.match(manufacturer); - if (matchManufacturer.hasMatch()) - { - QRegularExpressionMatch matchAircraft = m_aircraftRegExp.match(aircraft); - if (matchAircraft.hasMatch()) - { - model = m_model; - return true; - } - } - return false; - } - -protected: - QRegularExpression m_manufacturerRegExp; -}; - class ADSBDemodGUI : public ChannelGUI { Q_OBJECT @@ -1199,15 +727,10 @@ public: bool setFrequency(qint64 frequency); bool useSIUints() const { return m_settings.m_siUnits; } Q_INVOKABLE void clearHighlighted(); - QString get3DModel(const QString &aircraft, const QString &operatorICAO) const; - QString get3DModel(const QString &aircraft); - void get3DModel(Aircraft *aircraft); - void get3DModelBasedOnCategory(Aircraft *aircraft); public slots: void channelMarkerChangedByCursor(); void channelMarkerHighlightedByCursor(); - void flightInformationUpdated(const FlightInformation::Flight& flight); void aircraftPhoto(const PlaneSpottersPhoto *photo); private: @@ -1224,14 +747,29 @@ private: bool m_doApplySettings; ADSBDemod* m_adsbDemod; +public: + QString mapItemName(const Aircraft *aircraft) const; +private: uint32_t m_tickCount; MessageQueue m_inputMessageQueue; - QHash m_aircraft; // Hashed on ICAO - QSharedPointer> m_aircraftInfo; - QSharedPointer> m_routeInfo; // Hashed on callsign QSharedPointer> m_airportInfo; // Hashed on id - AircraftModel m_aircraftModel; + AircraftModel m_aircraftModel; // Aircraft on the map + ADSBAircraftTableModel m_aircraftTableModel; + ADSBAircraftSortProxy *m_aircraftProxy; + + // The GUI's copy of the aircraft, kept up to date by the tracker + QHash m_aircraft; // Hashed on ICAO + Aircraft *m_trackAircraft; // Aircraft being sent to a rotator + AzEl m_azEl; // Position of station, for the map overlays + QSharedPointer> m_aircraftInfo; + QSharedPointer> m_routeInfo; + Airspace m_coverageAirspace[2]; + Interogator m_interogators[ADSB_IC_MAX]; + bool m_loadingData; + // Aircraft whose map marker needs redrawing. Telling the QML model on every frame + // makes it re-evaluate bindings and repaint far more often than the eye can use + QSet m_dirtyMapAircraft; AirportModel m_airportModel; AirspaceModel m_airspaceModel; NavAidModel m_navAidModel; @@ -1239,11 +777,6 @@ private: QSharedPointer> m_navAids; QGeoCoordinate m_lastFullUpdatePosition; - AzEl m_azEl; // Position of station - Aircraft *m_trackAircraft; // Aircraft we want to track in Channel Report - MovingAverageUtil m_correlationAvg; - MovingAverageUtil m_correlationOnesAvg; - MovingAverageUtil m_qnhAvg; Aircraft *m_highlightAircraft; // Aircraft we want to highlight, when selected in table @@ -1251,68 +784,9 @@ private: ADSBDemodSettings::AirportType m_currentAirportMinimumSize; bool m_currentDisplayHeliports; - static const int m_maxRangeDeg = 5; - QList m_maxRange[2]; - Airspace m_coverageAirspace[2]; - Interogator m_interogators[ADSB_IC_MAX]; - enum StatsRow { - ADSB_FRAMES, - MODE_S_FRAMES, - TOTAL_FRAMES, - ADSB_RATE, - MODE_S_RATE, - TOTAL_RATE, - DATA_RATE, - CORRELATOR_MATCHES, - PERCENT_VALID, - PREAMBLE_FAILS, - CRC_FAILS, - TYPE_FAILS, - INVALID_FAILS, - ICAO_FAILS, - RANGE_FAILS, - ALT_FAILS, - AVERAGE_CORRELATION, - TC_0, - TC_1_4, - TC_5_8, - TC_9_18, - TC_19, - TC_20_22, - TC_24, - TC_28, - TC_29, - TC_31, - TC_UNUSED, - DF0, - DF4, - DF5, - DF11, - DF16, - DF17, - DF18, - DF19, - DF20_21, - DF22, - DF24, - MAX_RANGE, - MAX_ALTITUDE, - MAX_RATE - }; - qint64 m_rangeFails; - qint64 m_altFails; - QDateTime m_frameRateTime; - qint64 m_adsbFrameRateCount; - qint64 m_modesFrameRateCount; - qint64 m_totalBytes; - float m_maxRangeStat; - float m_maxAltitudeStat; - float m_maxRateState; - qint64 m_dfStats[32]; - qint64 m_tcStats[32]; QChart *m_chart; QLineSeries *m_adsbFrameRateSeries; QLineSeries *m_modesFrameRateSeries; @@ -1326,7 +800,6 @@ private: QTextToSpeech *m_speech; #endif QMenu *menu; // Column select context menu - FlightInformation *m_flightInformation; PlaneSpotters m_planeSpotters; AviationWeather *m_aviationWeather; QString m_photoLink; @@ -1337,38 +810,16 @@ private: OsnDB m_osnDB; OurAirportsDB m_ourAirportsDB; ADSBOSMTemplateServer *m_templateServer; - QRandomGenerator m_random; - QHash m_3DModels; // Hashed aircraft_icao or just aircraft - QHash m_3DModelsByType; // Hashed aircraft to list of all of that type - QList m_3DModelMatch; // Map of database aircraft names to 3D model names - QHash m_modelAltitudeOffset; - QHash m_labelAltitudeOffset; - - QTimer m_importTimer; + QTimer m_redrawMapTimer; QNetworkAccessManager *m_networkManager; - QPointer m_importTokenReply; - QPointer m_importStatesReply; - QString m_importAccessToken; - QDateTime m_importAccessTokenExpiry; - int m_importRequestGeneration; - bool m_importAuthenticationRetry; - bool m_loadingData; - static const char m_idMap[]; - static const QString m_categorySetA[]; - static const QString m_categorySetB[]; - static const QString m_categorySetC[]; - static const QString m_emergencyStatus[]; - static const QString m_flightStatuses[]; - static const QString m_hazardSeverity[]; - static const QString m_fomSources[]; - static const QString m_nacvStrings[]; explicit ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); virtual ~ADSBDemodGUI(); QString maptilerAPIKey() const; + QString cartoDBAPIKey() const; void blockApplySettings(bool block); void applySetting(const QString& settingsKey); @@ -1379,95 +830,36 @@ private: void makeUIConnections(); void updateAbsoluteCenterFrequency(); - void clearFromMap(const QString& name); - void sendToMap(Aircraft *aircraft, QList *animations); - Aircraft *getAircraft(int icao, bool &newAircraft); - void atcCallsign(Aircraft *aircraft); - void callsignToFlight(Aircraft *aircraft); - int roundTo50Feet(int alt); - bool calcAirTemp(Aircraft *aircraft); - void handleADSB( - const QByteArray data, - const QDateTime dateTime, - float correlation, - float correlationOnes, - unsigned crc, - bool updateModel); - - void decodeID(const QByteArray& data, QString& emitterCategory, QString& callsign); - bool decodeGroundspeed(const QByteArray& data, float& v, float& h); - bool decodeAirspeed(const QByteArray& data, bool& tas, int& as, bool& hdgValid, float& hdg); - bool decodeVerticalRate(const QByteArray& data, int& verticalRate); - void updateAircraftPosition(Aircraft *aircraft, double latitude, double longitude, const QDateTime& dateTime); - bool validateGlobalPosition(double latitude, double longitude, bool countFailure); - bool validateLocalPosition(double latitude, double longitude, bool surfacePosition, bool countFailure); - bool decodeGlobalPosition(int f, const double cprLat[2], const double cprLong[2], const QDateTime cprTime[2], double& latitude, double& longitude, bool countFailure); - bool decodeLocalPosition(int f, double cprLat, double cprLong, bool onSurface, const Aircraft *aircraft, double& latitude, double& longitude, bool countFailure); - void decodeCpr(const QByteArray& data, int& f, double& latCpr, double& lonCpr) const; - bool decodeAltitude(const QByteArray& data, int& altFt) const; - void decodeModeSAltitude(const QByteArray& data, const QDateTime dateTime, Aircraft *aircraft); - void decodeModeS(const QByteArray data, const QDateTime dateTime, int df, Aircraft *aircraft); - void decodeCommB(const QByteArray data, const QDateTime dateTime, int df, Aircraft *aircraft, bool &updatedCallsign); - QList *animate(QDateTime dateTime, Aircraft *aircraft); - SWGSDRangel::SWGMapAnimation *gearAnimation(QDateTime startDateTime, bool up); - SWGSDRangel::SWGMapAnimation *gearAngle(QDateTime startDateTime, bool flat); - SWGSDRangel::SWGMapAnimation *flapsAnimation(QDateTime startDateTime, float currentFlaps, float flaps); - SWGSDRangel::SWGMapAnimation *slatsAnimation(QDateTime startDateTime, bool retract); - SWGSDRangel::SWGMapAnimation *rotorAnimation(QDateTime startDateTime, bool stop); - SWGSDRangel::SWGMapAnimation *engineAnimation(QDateTime startDateTime, int engine, bool stop); - void checkStaticNotification(Aircraft *aircraft); - void checkDynamicNotification(Aircraft *aircraft); + void enableSpeechIfNeeded(); void speechNotification(Aircraft *aircraft, const QString &speech); - void commandNotification(Aircraft *aircraft, const QString &command); - QString subAircraftString(Aircraft *aircraft, const QString &string); void resizeTable(); + Aircraft *aircraftForViewRow(int viewRow) const; + void removeAircraft(QHash::iterator& i, Aircraft *aircraft); + void initCoverageDisplay(); + Aircraft *findAircraft(quint32 icao) const { return m_aircraft.value((int) icao, nullptr); } + void flushMapUpdates(); QString getDataDir(); - void update3DModels(); void updateAirports(); void updateAirspaces(); void updateNavAids(); void updateChannelList(); - void removeAircraft(QHash::iterator& i, Aircraft *aircraft); QAction *createCheckableItem(QString& text, int idx, bool checked); - Aircraft* findAircraftByFlight(const QString& flight); - QString dataTimeToShortString(QDateTime dt); - void initFlightInformation(); void initAviationWeather(); void setShowContainmentRadius(bool show); void applyMapSettings(); + void clearStaleTileCache(const QString& cachePath); void updatePhotoText(Aircraft *aircraft); void updatePhotoFlightInformation(Aircraft *aircraft); void findOnChannelMap(Aircraft *aircraft); - int squawkDecode(int code) const; - int gillhamToFeet(int n) const; - int grayToBinary(int gray, int bits) const; void redrawMap(); - void applyImportSettings(); - bool importCredentialsConfigured() const; - bool importAccessTokenValid() const; - void invalidateImportAuthentication(); - void requestImportAccessToken(); - void sendImportRequest(); - void handleImportTokenReply(QNetworkReply *reply); - void sendAircraftReport(); void updatePosition(float latitude, float longitude, float altitude); - void clearOldHeading(Aircraft *aircraft, const QDateTime& dateTime, float newTrack); - void updateQNH(const Aircraft *aircraft, float qnh); - void setCallsign(Aircraft *aircraft, const QString& callsign); - void initCoverageMap(); - void clearCoverageMap(); - void updateCoverageMap(float azimuth, float elevation, float distance, float altitude); void leaveEvent(QEvent*); void enterEvent(EnterEventType*); - void updateDFStats(int df); - bool updateTCStats(int tc, int row, int low, int high); - void resetStats(); void plotChart(); - int countActiveAircraft(); void averageSeries(QLineSeries *series, const QDateTime& startTime, const QDateTime& endTime); void legendMarkerClicked(); @@ -1480,8 +872,20 @@ private slots: void on_tapsPerPhase_valueChanged(int value); void statsTable_customContextMenuRequested(QPoint pos); void adsbData_customContextMenuRequested(QPoint point); - void on_adsbData_cellClicked(int row, int column); - void on_adsbData_cellDoubleClicked(int row, int column); + // Fed by the tracker, which does the decoding on the channel's worker thread + void aircraftUpdated(const QList& updates); + void aircraftRemoved(const QList& icaos); + void statsUpdated(const QHash& stats); + void coverageUpdated(int band, const QVector& polygon); + void qnhEstimate(int qnh); + void speechRequest(const QString& speech); + void highlightRequest(quint32 icao); + void targetRequest(quint32 icao); + void photoRefresh(quint32 icao); + void rates(double adsbRate, double modesRate, int activeAircraft); + + void adsbData_clicked(const QModelIndex& index); + void adsbData_doubleClicked(const QModelIndex& index); void adsbData_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex); void adsbData_sectionResized(int logicalIndex, int oldSize, int newSize); void columnSelectMenu(QPoint pos); @@ -1525,16 +929,12 @@ private slots: void photoClicked(); virtual void showEvent(QShowEvent *event) override; virtual bool eventFilter(QObject *obj, QEvent *event) override; - void import(); - void handleImportNetworkReply(QNetworkReply *reply); - void handleImportReply(QNetworkReply* reply); void preferenceChanged(int elementType); void devicePositionChanged(float latitude, float longitude, float altitude); void requestMetar(const QString& icao); void weatherUpdated(const AviationWeather::METAR &metar); void on_manualQNH_clicked(bool checked); void on_qnh_valueChanged(int value); - void clearCoverage(const QPoint& p); void clearStats(const QPoint& p); void clearChart(const QPoint& p); void resetChartAxes(); diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.ui b/plugins/channelrx/demodadsb/adsbdemodgui.ui index 5710ff7cd..b92a2f74d 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.ui +++ b/plugins/channelrx/demodadsb/adsbdemodgui.ui @@ -1082,7 +1082,7 @@ 0 - + 1 @@ -1104,624 +1104,6 @@ QAbstractItemView::SelectionBehavior::SelectRows - - - ICAO ID - - - Aircraft International Civil Aviation Organization identifier. Links to www.planespotters.net - - - - - Callsign - - - Callsign. Links to www.flightradar24.com - - - - - ATC Callsign - - - Airline callsign used by ATC - - - - - Aircraft - - - Aircraft model - - - - - Type - - - ICAO aircraft type designator - - - - - Sideview - - - - - Airline - - - Airline logo - - - - - Country - - - Country of registration - - - - - GS (kn) - - - Groundspeed in knots or kilometers per hour - - - - - TAS (kn) - - - True airpeed in knots or kilometers per hour - - - - - IAS (kn) - - - Indicated airspeed in knots or kilometers per hour - - - - - Mach - - - Mach number - - - - - Sel Alt (ft) - - - Selected altitude in feet or metres (As set on MCP/FCU or by FMS) - - - - - Alt (ft) - - - Altitude in feet or metres - - - - - VR (ft/m) - - - Vertical climb rate in feet per minute or metres per second - - - - - Sel Hd (°) - - - Selected heading in degrees (As set on MCP/FCU or by FMS) - - - - - Hd (°) - - - Aircraft heading in degrees - - - - - Trk (°) - - - Aircraft track in degrees - - - - - TR (°/s) - - - Turn rate in degrees per second - - - - - Roll (°) - - - Roll angle in degrees - - - - - D (km) - - - Range or distance of aircraft from home location - - - - - Az/El (°) - - - Azimuth and elevation to aircraft from My Position. Double click to set as target. - - - - - Cat - - - Aircraft standard category - - - - - Status - - - Aircraft emergency status - - - - - Squawk - - - Mode-A transponder code - - - - - Ident - - - Ident switch active - - - - - Reg - - - Aircraft registration - - - - - Registered - - - Date aircraft was registered - - - - - Manufacturer - - - Aircraft manufacturer - - - - - Owner - - - Owner of the aircraft - - - - - Operator - - - Aircraft operator ICAO code - - - - - AP - - - Autopilot enabled - - - - - V Mode - - - MCP/FCU vertical mode - - - - - L Mode - - - MCP/FCU lateral mode - - - - - TCAS - - - TCAS operational. RA in red if active - - - - - ACAS - - - Airborne collision avoidance system capability - - - - - RA - - - ACAS active resolition advisory - - - - - Max AS (kn) - - - Maximum speed in knots - - - - - Version - - - ADS-B version - - - - - L (m) - - - Aircraft length in metres - - - - - W (m) - - - Aircraft width in metres - - - - - QNH (mb) - - - Barometer setting in millibars - - - - - H Wnd (kn) - - - Headwind in knots or kilometers per hour - - - - - OAT (C) - - - Outside air temperature in degrees Celsius estimated from Mach and TAS - - - - - Wnd (kn) - - - Wind speed in knots - - - - - Wnd (°) - - - Wind direction in degrees - - - - - P (hPa) - - - Static air pressure in hectopascals - - - - - T (C) - - - Static air temperature in degrees Celsius - - - - - U (%) - - - Humidity in percent - - - - - Lat (°) - - - Latitude in degrees positive towards the North - - - - - Lon (°) - - - Longitude in degrees. Positive towards the East - - - - - IC - - - Interrogator code (II/SI) - - - - - Updated - - - Time when the last ADS-B message from this aircraft was received. - - - - - Frames - - - Number of ADS-B and Mode S frames received from this aircraft - - - - - ADS-B FC - - - Number of ADS-B frames received from this aircraft - - - - - Mode S FC - - - Number of Mode S frames received from this aircraft - - - - - Non-transponder - - - Non transponder device frame count - - - - - TIS-B FC - - - Number of TIS-B frames received with this aircraft's ICAO - - - - - ADS-R FC - - - Number of ADS-R frames received with this aircraft's ICAO - - - - - Rc - - - Horizontal containment radius limit - - - - - NACp - - - Navigation accuracy category - 95% horizontal position - - - - - NACv - - - Navigation accuracy category - velocity - - - - - GVA - - - Geometric vertical accuracy - - - - - NIC - - - Navigation integrity category - - - - - NICbaro - - - Barometric altitude integrity code - - - - - SIL - - - Surveillance integrity level - - - - - Correlation - - - Correlation values for received frames. min/avg/max - - - - - RSSI - - - Received Signal Strength Indicator (dBFS) - - - - - Flight Status - - - Status of flight - - - - - Dep - - - Departure airport - - - - - Arr - - - Arrival airport - - - - - Stops - - - - - STD - - - Scheduled time of departure - - - - - ETD - - - Estimated time of departure - - - - - ATD - - - Actual time of departure - - - - - STA - - - Scheduled time of arrival - - - - - ETA - - - Estimated time of arrival - - - - - ATA - - - Actual time of arrival - - diff --git a/plugins/channelrx/demodadsb/adsbdemodmapliveries.qrc b/plugins/channelrx/demodadsb/adsbdemodmapliveries.qrc new file mode 100644 index 000000000..cc1a5ca5a --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbdemodmapliveries.qrc @@ -0,0 +1,3932 @@ + + + map/liveries/A20N.png + map/liveries/A20N_AAN.png + map/liveries/A20N_ACI.png + map/liveries/A20N_ADH.png + map/liveries/A20N_AEE.png + map/liveries/A20N_AFL.png + map/liveries/A20N_AFX.png + map/liveries/A20N_AHY.png + map/liveries/A20N_AIC.png + map/liveries/A20N_AIC_VTI.png + map/liveries/A20N_AIQ.png + map/liveries/A20N_ALK.png + map/liveries/A20N_AMC.png + map/liveries/A20N_AMU.png + map/liveries/A20N_AMV.png + map/liveries/A20N_ANA.png + map/liveries/A20N_ANZ.png + map/liveries/A20N_APJ.png + map/liveries/A20N_AUA.png + map/liveries/A20N_AUL.png + map/liveries/A20N_AVA.png + map/liveries/A20N_AXM.png + map/liveries/A20N_AZU.png + map/liveries/A20N_BAV.png + map/liveries/A20N_BAW.png + map/liveries/A20N_BEL.png + map/liveries/A20N_BHE.png + map/liveries/A20N_BTK.png + map/liveries/A20N_BVX.png + map/liveries/A20N_CBJ.png + map/liveries/A20N_CCA.png + map/liveries/A20N_CCM.png + map/liveries/A20N_CDC.png + map/liveries/A20N_CEB.png + map/liveries/A20N_CES.png + map/liveries/A20N_CFG_PASSION.png + map/liveries/A20N_CGZ.png + map/liveries/A20N_CHB.png + map/liveries/A20N_CQH.png + map/liveries/A20N_CQN.png + map/liveries/A20N_CSC.png + map/liveries/A20N_CSN.png + map/liveries/A20N_CSZ.png + map/liveries/A20N_CTV.png + map/liveries/A20N_DKH.png + map/liveries/A20N_DLH.png + map/liveries/A20N_EAG.png + map/liveries/A20N_EIN.png + map/liveries/A20N_EJU.png + map/liveries/A20N_EUS.png + map/liveries/A20N_EWG.png + map/liveries/A20N_EZS.png + map/liveries/A20N_EZY.png + map/liveries/A20N_FAD.png + map/liveries/A20N_FBT.png + map/liveries/A20N_FBV.png + map/liveries/A20N_FFT_316.png + map/liveries/A20N_FFT_341.png + map/liveries/A20N_FFT_350.png + map/liveries/A20N_FFT_372.png + map/liveries/A20N_FFT_373.png + map/liveries/A20N_FHA.png + map/liveries/A20N_FLI.png + map/liveries/A20N_FPY.png + map/liveries/A20N_FUZ.png + map/liveries/A20N_FYI.png + map/liveries/A20N_GCR.png + map/liveries/A20N_GFA.png + map/liveries/A20N_GOW.png + map/liveries/A20N_GOW_OC.png + map/liveries/A20N_GVY.png + map/liveries/A20N_HAZ.png + map/liveries/A20N_HKE.png + map/liveries/A20N_HVN.png + map/liveries/A20N_HXA.png + map/liveries/A20N_IAD.png + map/liveries/A20N_IBE.png + map/liveries/A20N_IGO.png + map/liveries/A20N_ITY.png + map/liveries/A20N_JAT_TORTUGA.png + map/liveries/A20N_JHL.png + map/liveries/A20N_JZR.png + map/liveries/A20N_KAC.png + map/liveries/A20N_KLM.png + map/liveries/A20N_KMM.png + map/liveries/A20N_KNE.png + map/liveries/A20N_KZR.png + map/liveries/A20N_LAN.png + map/liveries/A20N_LBT.png + map/liveries/A20N_LHA_VA.png + map/liveries/A20N_LHX.png + map/liveries/A20N_LKE.png + map/liveries/A20N_LNR.png + map/liveries/A20N_MBU.png + map/liveries/A20N_MET.png + map/liveries/A20N_MQT.png + map/liveries/A20N_MSC.png + map/liveries/A20N_MSR.png + map/liveries/A20N_NDF.png + map/liveries/A20N_NKS.png + map/liveries/A20N_NTL.png + map/liveries/A20N_OMS.png + map/liveries/A20N_PFF.png + map/liveries/A20N_PGT.png + map/liveries/A20N_QDA.png + map/liveries/A20N_RBA.png + map/liveries/A20N_RZO.png + map/liveries/A20N_SAS.png + map/liveries/A20N_SBI.png + map/liveries/A20N_SCO.png + map/liveries/A20N_SEH.png + map/liveries/A20N_SHT.png + map/liveries/A20N_SKU.png + map/liveries/A20N_SVR.png + map/liveries/A20N_SWR.png + map/liveries/A20N_SZS.png + map/liveries/A20N_TAI.png + map/liveries/A20N_TAM.png + map/liveries/A20N_TAP.png + map/liveries/A20N_TAR.png + map/liveries/A20N_TEJ.png + map/liveries/A20N_TGW.png + map/liveries/A20N_TKJ.png + map/liveries/A20N_TKY.png + map/liveries/A20N_TNU.png + map/liveries/A20N_TTW.png + map/liveries/A20N_TVF.png + map/liveries/A20N_UKV.png + map/liveries/A20N_UZB.png + map/liveries/A20N_VAE.png + map/liveries/A20N_VCP.png + map/liveries/A20N_VIV.png + map/liveries/A20N_VLG.png + map/liveries/A20N_VOC.png + map/liveries/A20N_VOI.png + map/liveries/A20N_VOS.png + map/liveries/A20N_VRE.png + map/liveries/A20N_VVC.png + map/liveries/A20N_WAT.png + map/liveries/A20N_WMT.png + map/liveries/A20N_WTB.png + map/liveries/A20N_WZZ.png + map/liveries/A20N_XSN.png + map/liveries/A21N.png + map/liveries/A21N_AAL.png + map/liveries/A21N_AAR.png + map/liveries/A21N_ABL.png + map/liveries/A21N_ABQ.png + map/liveries/A21N_ABY.png + map/liveries/A21N_ACA.png + map/liveries/A21N_AEE.png + map/liveries/A21N_AFL.png + map/liveries/A21N_AFX.png + map/liveries/A21N_AIC.png + map/liveries/A21N_AIC_VTI.png + map/liveries/A21N_AIQ.png + map/liveries/A21N_AIZ_4X-AGH.png + map/liveries/A21N_AIZ_4X-AGK.png + map/liveries/A21N_ALK.png + map/liveries/A21N_AMU.png + map/liveries/A21N_ANA.png + map/liveries/A21N_ANZ.png + map/liveries/A21N_APJ.png + map/liveries/A21N_ASA.png + map/liveries/A21N_AVA.png + map/liveries/A21N_AWC.png + map/liveries/A21N_AXM.png + map/liveries/A21N_AZU.png + map/liveries/A21N_BAV.png + map/liveries/A21N_BAW.png + map/liveries/A21N_BHE.png + map/liveries/A21N_BVX.png + map/liveries/A21N_CAL.png + map/liveries/A21N_CBJ.png + map/liveries/A21N_CCA.png + map/liveries/A21N_CDC.png + map/liveries/A21N_CEB.png + map/liveries/A21N_CFG_ISLAND.png + map/liveries/A21N_CFG_SUNSHINE.png + map/liveries/A21N_CPA.png + map/liveries/A21N_CQH.png + map/liveries/A21N_CQN.png + map/liveries/A21N_CSC.png + map/liveries/A21N_CSN.png + map/liveries/A21N_CSZ.png + map/liveries/A21N_CXA.png + map/liveries/A21N_DAL.png + map/liveries/A21N_DJT.png + map/liveries/A21N_DKH.png + map/liveries/A21N_DLH.png + map/liveries/A21N_EIN.png + map/liveries/A21N_EJU.png + map/liveries/A21N_ETD.png + map/liveries/A21N_EUK.png + map/liveries/A21N_EUS.png + map/liveries/A21N_EWG.png + map/liveries/A21N_EXS.png + map/liveries/A21N_EZY.png + map/liveries/A21N_EZY_UK.png + map/liveries/A21N_FBV.png + map/liveries/A21N_FFT.png + map/liveries/A21N_FPY.png + map/liveries/A21N_FWC.png + map/liveries/A21N_GFA.png + map/liveries/A21N_HAL.png + map/liveries/A21N_HAZ.png + map/liveries/A21N_HKE.png + map/liveries/A21N_HVN.png + map/liveries/A21N_HYS.png + map/liveries/A21N_IBS.png + map/liveries/A21N_ICE.png + map/liveries/A21N_IGO.png + map/liveries/A21N_ITY.png + map/liveries/A21N_JBU.png + map/liveries/A21N_JJP.png + map/liveries/A21N_JST.png + map/liveries/A21N_KAL.png + map/liveries/A21N_KLM.png + map/liveries/A21N_KZR.png + map/liveries/A21N_MEA.png + map/liveries/A21N_MQT.png + map/liveries/A21N_MSR.png + map/liveries/A21N_NDF.png + map/liveries/A21N_NKS.png + map/liveries/A21N_NTL.png + map/liveries/A21N_NVR.png + map/liveries/A21N_NWS.png + map/liveries/A21N_OAL_VA.png + map/liveries/A21N_OMS.png + map/liveries/A21N_PAL.png + map/liveries/A21N_PGT.png + map/liveries/A21N_QFA.png + map/liveries/A21N_QNT.png + map/liveries/A21N_RZO_TSF.png + map/liveries/A21N_RZO_TSH.png + map/liveries/A21N_SAS.png + map/liveries/A21N_SBI.png + map/liveries/A21N_SCO.png + map/liveries/A21N_SEH.png + map/liveries/A21N_SHT.png + map/liveries/A21N_SJX.png + map/liveries/A21N_SKU.png + map/liveries/A21N_STW.png + map/liveries/A21N_SVR.png + map/liveries/A21N_SWR.png + map/liveries/A21N_SZN.png + map/liveries/A21N_TAM.png + map/liveries/A21N_TAP.png + map/liveries/A21N_TEJ.png + map/liveries/A21N_TGW.png + map/liveries/A21N_THY.png + map/liveries/A21N_TKJ.png + map/liveries/A21N_TKY.png + map/liveries/A21N_TRA.png + map/liveries/A21N_TSC.png + map/liveries/A21N_UAL.png + map/liveries/A21N_UKV.png + map/liveries/A21N_UZB.png + map/liveries/A21N_VCP.png + map/liveries/A21N_VIV.png + map/liveries/A21N_VJC.png + map/liveries/A21N_VLG.png + map/liveries/A21N_VOI.png + map/liveries/A21N_WAT.png + map/liveries/A21N_WAZ.png + map/liveries/A21N_WMT.png + map/liveries/A21N_WTB_N.png + map/liveries/A21N_WUK.png + map/liveries/A21N_WZZ.png + map/liveries/A21N_XSN.png + map/liveries/A306.png + map/liveries/A306_AAW.png + map/liveries/A306_AHK.png + map/liveries/A306_BCS.png + map/liveries/A306_CES.png + map/liveries/A306_CSN.png + map/liveries/A306_DLH.png + map/liveries/A306_ETD.png + map/liveries/A306_FDX.png + map/liveries/A306_IRA.png + map/liveries/A306_IRM.png + map/liveries/A306_JAL.png + map/liveries/A306_KAC.png + map/liveries/A306_KAL.png + map/liveries/A306_KZU.png + map/liveries/A306_LAA.png + map/liveries/A306_MON.png + map/liveries/A306_PIA.png + map/liveries/A306_QTR.png + map/liveries/A306_RJA.png + map/liveries/A306_RZO.png + map/liveries/A306_SUD.png + map/liveries/A306_SVA.png + map/liveries/A306_TAR.png + map/liveries/A306_THA.png + map/liveries/A306_THY.png + map/liveries/A306_UAE.png + map/liveries/A306_UPS.png + map/liveries/A306F.png + map/liveries/A306F_ABR.png + map/liveries/A306F_BCS.png + map/liveries/A306F_DHL.png + map/liveries/A306F_FDX.png + map/liveries/A306F_MNB.png + map/liveries/A306F_NFC.png + map/liveries/A306F_SOP.png + map/liveries/A306F_UPS.png + map/liveries/A30B.png + map/liveries/A30B_EAG.png + map/liveries/A30B_IRA.png + map/liveries/A30BF.png + map/liveries/A30BF_AMA.png + map/liveries/A310_AIC.png + map/liveries/A310_AME.png + map/liveries/A310_FDX.png + map/liveries/A310_KLM.png + map/liveries/A310_TAP.png + map/liveries/A310_UZB.png + map/liveries/A318_AFR.png + map/liveries/A318_AVA.png + map/liveries/A318_BAW.png + map/liveries/A318_LAN.png + map/liveries/A318_LNE.png + map/liveries/A318_MXA.png + map/liveries/A318_RJA.png + map/liveries/A318_ROT.png + map/liveries/A318_SVW.png + map/liveries/A319.png + map/liveries/A319_AAF.png + map/liveries/A319_AAL.png + map/liveries/A319_AAW.png + map/liveries/A319_AAY.png + map/liveries/A319_ABN.png + map/liveries/A319_ABQ.png + map/liveries/A319_ACA.png + map/liveries/A319_ADH.png + map/liveries/A319_ADR.png + map/liveries/A319_AEE.png + map/liveries/A319_AEE_OC.png + map/liveries/A319_AFL.png + map/liveries/A319_AFR.png + map/liveries/A319_AFX.png + map/liveries/A319_AHY.png + map/liveries/A319_AIA.png + map/liveries/A319_AIC.png + map/liveries/A319_AMC.png + map/liveries/A319_ARE.png + map/liveries/A319_ASL.png + map/liveries/A319_AUA.png + map/liveries/A319_AVA.png + map/liveries/A319_AWE.png + map/liveries/A319_AXB.png + map/liveries/A319_AZA.png + map/liveries/A319_BAW.png + map/liveries/A319_BAW_BEA.png + map/liveries/A319_BEL.png + map/liveries/A319_BEL_NC.png + map/liveries/A319_BER.png + map/liveries/A319_BHE.png + map/liveries/A319_BHP.png + map/liveries/A319_BIX.png + map/liveries/A319_BKP.png + map/liveries/A319_BMA.png + map/liveries/A319_BMI.png + map/liveries/A319_BON.png + map/liveries/A319_BRS.png + map/liveries/A319_BTN.png + map/liveries/A319_BVX.png + map/liveries/A319_BYD.png + map/liveries/A319_CBJ.png + map/liveries/A319_CCA.png + map/liveries/A319_CEB.png + map/liveries/A319_CES.png + map/liveries/A319_CHB.png + map/liveries/A319_CHH.png + map/liveries/A319_CLH.png + map/liveries/A319_CQN.png + map/liveries/A319_CSA.png + map/liveries/A319_CSC.png + map/liveries/A319_CSN.png + map/liveries/A319_CSW.png + map/liveries/A319_CSZ.png + map/liveries/A319_CTM.png + map/liveries/A319_CTN.png + map/liveries/A319_CXA_VA.png + map/liveries/A319_CYP.png + map/liveries/A319_DAL.png + map/liveries/A319_DCS.png + map/liveries/A319_DLH.png + map/liveries/A319_DLH_OC.png + map/liveries/A319_DNV.png + map/liveries/A319_DRK.png + map/liveries/A319_EIN.png + map/liveries/A319_EJU.png + map/liveries/A319_ERT.png + map/liveries/A319_ETD.png + map/liveries/A319_EUS.png + map/liveries/A319_EWG.png + map/liveries/A319_EZS.png + map/liveries/A319_EZY.png + map/liveries/A319_FFT.png + map/liveries/A319_FIE.png + map/liveries/A319_FIN.png + map/liveries/A319_FLO.png + map/liveries/A319_FWC.png + map/liveries/A319_GFA.png + map/liveries/A319_GHL.png + map/liveries/A319_GLD.png + map/liveries/A319_GLG.png + map/liveries/A319_GMI.png + map/liveries/A319_GSW.png + map/liveries/A319_GWI.png + map/liveries/A319_HAY.png + map/liveries/A319_HAZ.png + map/liveries/A319_HIM.png + map/liveries/A319_HYM.png + map/liveries/A319_IAE.png + map/liveries/A319_IBE.png + map/liveries/A319_IRA.png + map/liveries/A319_ISS.png + map/liveries/A319_ITY_BLUE.png + map/liveries/A319_IWA.png + map/liveries/A319_IZG.png + map/liveries/A319_KAC.png + map/liveries/A319_KFR.png + map/liveries/A319_KKK.png + map/liveries/A319_KME.png + map/liveries/A319_KRP.png + map/liveries/A319_KZR.png + map/liveries/A319_LAN.png + map/liveries/A319_LBY.png + map/liveries/A319_LGS.png + map/liveries/A319_LHA_VA.png + map/liveries/A319_LHX.png + map/liveries/A319_LNE.png + map/liveries/A319_LNR.png + map/liveries/A319_LPE.png + map/liveries/A319_LRC.png + map/liveries/A319_LWA.png + map/liveries/A319_LZB.png + map/liveries/A319_MAU.png + map/liveries/A319_MET.png + map/liveries/A319_MGL.png + map/liveries/A319_MLD.png + map/liveries/A319_MLM.png + map/liveries/A319_MOV.png + map/liveries/A319_MXA.png + map/liveries/A319_NDF.png + map/liveries/A319_NKS.png + map/liveries/A319_NKS_NC.png + map/liveries/A319_NLY.png + map/liveries/A319_NMB.png + map/liveries/A319_NTL.png + map/liveries/A319_NWA.png + map/liveries/A319_OAL.png + map/liveries/A319_OAL_VA.png + map/liveries/A319_ONE.png + map/liveries/A319_PAL.png + map/liveries/A319_PLX.png + map/liveries/A319_QTR.png + map/liveries/A319_RBA.png + map/liveries/A319_RJA.png + map/liveries/A319_RLU.png + map/liveries/A319_RNV.png + map/liveries/A319_ROU.png + map/liveries/A319_RSD.png + map/liveries/A319_RSY.png + map/liveries/A319_SAA.png + map/liveries/A319_SAS.png + map/liveries/A319_SAS_OC.png + map/liveries/A319_SBI.png + map/liveries/A319_SBI_NC.png + map/liveries/A319_SCO.png + map/liveries/A319_SDM.png + map/liveries/A319_SDR.png + map/liveries/A319_SHT.png + map/liveries/A319_SHU.png + map/liveries/A319_SKS.png + map/liveries/A319_SLK.png + map/liveries/A319_SVR.png + map/liveries/A319_SWR.png + map/liveries/A319_SZN.png + map/liveries/A319_TAE.png + map/liveries/A319_TAI.png + map/liveries/A319_TAK.png + map/liveries/A319_TAM.png + map/liveries/A319_TAP.png + map/liveries/A319_TAR.png + map/liveries/A319_TBA.png + map/liveries/A319_TCW.png + map/liveries/A319_TEF.png + map/liveries/A319_TEJ.png + map/liveries/A319_THO.png + map/liveries/A319_THY.png + map/liveries/A319_THY_NC.png + map/liveries/A319_TKY.png + map/liveries/A319_UAL.png + map/liveries/A319_UAL_OC.png + map/liveries/A319_UKN.png + map/liveries/A319_UKV_TOPA.png + map/liveries/A319_USA.png + map/liveries/A319_VCP.png + map/liveries/A319_VLC.png + map/liveries/A319_VLG.png + map/liveries/A319_VOC.png + map/liveries/A319_VOE.png + map/liveries/A319_VOI.png + map/liveries/A319_VRD.png + map/liveries/A319_VRE.png + map/liveries/A319_WAT.png + map/liveries/A319_WGT.png + map/liveries/A319_white.png + map/liveries/A319_WHT.png + map/liveries/A319_WTB.png + map/liveries/A319_XSN.png + map/liveries/A320.png + map/liveries/A320_AAF.png + map/liveries/A320_AAL.png + map/liveries/A320_AAR.png + map/liveries/A320_AAW.png + map/liveries/A320_AAY.png + map/liveries/A320_ABL.png + map/liveries/A320_ABN.png + map/liveries/A320_ABQ.png + map/liveries/A320_ABY.png + map/liveries/A320_ACA.png + map/liveries/A320_ACA_NC.png + map/liveries/A320_ACI.png + map/liveries/A320_ACY.png + map/liveries/A320_ADH.png + map/liveries/A320_ADR.png + map/liveries/A320_ADY.png + map/liveries/A320_AEE.png + map/liveries/A320_AEE_NC.png + map/liveries/A320_AEW.png + map/liveries/A320_AFF.png + map/liveries/A320_AFL.png + map/liveries/A320_AFR.png + map/liveries/A320_AFR_SL.png + map/liveries/A320_AFX.png + map/liveries/A320_AHY.png + map/liveries/A320_AIA.png + map/liveries/A320_AIC.png + map/liveries/A320_AIC_IAE.png + map/liveries/A320_AIC_SL.png + map/liveries/A320_AIJ.png + map/liveries/A320_AIQ.png + map/liveries/A320_AIS.png + map/liveries/A320_AIZ.png + map/liveries/A320_ALK.png + map/liveries/A320_AMC.png + map/liveries/A320_AMM.png + map/liveries/A320_AMU.png + map/liveries/A320_AMV.png + map/liveries/A320_AMZ.png + map/liveries/A320_ANA.png + map/liveries/A320_ANK.png + map/liveries/A320_ANR.png + map/liveries/A320_ANZ.png + map/liveries/A320_ANZ_BL.png + map/liveries/A320_APG.png + map/liveries/A320_APJ.png + map/liveries/A320_APJ_SL.png + map/liveries/A320_APK.png + map/liveries/A320_ARE.png + map/liveries/A320_ARG.png + map/liveries/A320_ARR.png + map/liveries/A320_ART.png + map/liveries/A320_ARU.png + map/liveries/A320_ASA_SL.png + map/liveries/A320_ASL.png + map/liveries/A320_AUA.png + map/liveries/A320_AUA_SL.png + map/liveries/A320_AVA.png + map/liveries/A320_AVA_ENCANTO.png + map/liveries/A320_AWC.png + map/liveries/A320_AWE_OC.png + map/liveries/A320_AWG.png + map/liveries/A320_AWQ.png + map/liveries/A320_AXM.png + map/liveries/A320_AZA.png + map/liveries/A320_AZA_NC.png + map/liveries/A320_AZI.png + map/liveries/A320_BAB.png + map/liveries/A320_BAL.png + map/liveries/A320_BAV.png + map/liveries/A320_BAW.png + map/liveries/A320_BAW_IAE.png + map/liveries/A320_BBT.png + map/liveries/A320_BCC.png + map/liveries/A320_BEL.png + map/liveries/A320_BEL_NC.png + map/liveries/A320_BER.png + map/liveries/A320_BGH.png + map/liveries/A320_BHE.png + map/liveries/A320_BHP.png + map/liveries/A320_BIX.png + map/liveries/A320_BKP.png + map/liveries/A320_BMA.png + map/liveries/A320_BNL.png + map/liveries/A320_BRQ.png + map/liveries/A320_BTK.png + map/liveries/A320_BTV.png + map/liveries/A320_BUC.png + map/liveries/A320_BUC_CFM.png + map/liveries/A320_BVX.png + map/liveries/A320_BWG.png + map/liveries/A320_CAI.png + map/liveries/A320_CBJ.png + map/liveries/A320_CCA.png + map/liveries/A320_CCM.png + map/liveries/A320_CDC.png + map/liveries/A320_CEB.png + map/liveries/A320_CES.png + map/liveries/A320_CFG.png + map/liveries/A320_CFG_FBB.png + map/liveries/A320_CFG_FBY.png + map/liveries/A320_CFG_HN.png + map/liveries/A320_CGA.png + map/liveries/A320_CGL.png + map/liveries/A320_CHB.png + map/liveries/A320_CQH.png + map/liveries/A320_CQN.png + map/liveries/A320_CRK.png + map/liveries/A320_CSA.png + map/liveries/A320_CSC.png + map/liveries/A320_CSN.png + map/liveries/A320_CSZ.png + map/liveries/A320_CTN.png + map/liveries/A320_CTO.png + map/liveries/A320_CTV.png + map/liveries/A320_CXA_VA.png + map/liveries/A320_CYP.png + map/liveries/A320_DAL.png + map/liveries/A320_DKH.png + map/liveries/A320_DLH.png + map/liveries/A320_DLH_OC.png + map/liveries/A320_DLH_SL.png + map/liveries/A320_DQA.png + map/liveries/A320_DSM.png + map/liveries/A320_DTR.png + map/liveries/A320_DUB.png + map/liveries/A320_EAA.png + map/liveries/A320_EAG.png + map/liveries/A320_ECN.png + map/liveries/A320_EDW.png + map/liveries/A320_EFW.png + map/liveries/A320_EIN.png + map/liveries/A320_EIN_OC.png + map/liveries/A320_EJU.png + map/liveries/A320_EOK.png + map/liveries/A320_ETD.png + map/liveries/A320_EUS.png + map/liveries/A320_EVE.png + map/liveries/A320_EWG.png + map/liveries/A320_EWL.png + map/liveries/A320_EZS.png + map/liveries/A320_EZY.png + map/liveries/A320_EZY_SL.png + map/liveries/A320_FAD.png + map/liveries/A320_FBT.png + map/liveries/A320_FBV.png + map/liveries/A320_FEI.png + map/liveries/A320_FFT.png + map/liveries/A320_FFT_204.png + map/liveries/A320_FFT_205.png + map/liveries/A320_FFT_208.png + map/liveries/A320_FFT_227.png + map/liveries/A320_FHA.png + map/liveries/A320_FHE.png + map/liveries/A320_FHM.png + map/liveries/A320_FHY_FHG.png + map/liveries/A320_FHY_FHI.png + map/liveries/A320_FHY_FHM.png + map/liveries/A320_FIA.png + map/liveries/A320_FIE.png + map/liveries/A320_FIN.png + map/liveries/A320_FNX.png + map/liveries/A320_FOE.png + map/liveries/A320_FUZ.png + map/liveries/A320_FVP.png + map/liveries/A320_FWC.png + map/liveries/A320_FYI.png + map/liveries/A320_GAP.png + map/liveries/A320_GBB_BLACK.png + map/liveries/A320_GBB_YELLOW.png + map/liveries/A320_GBL.png + map/liveries/A320_GCR.png + map/liveries/A320_GFA.png + map/liveries/A320_GHY.png + map/liveries/A320_GLD.png + map/liveries/A320_GLG.png + map/liveries/A320_GOW.png + map/liveries/A320_GOW_OC.png + map/liveries/A320_GWI.png + map/liveries/A320_GXA.png + map/liveries/A320_HAN.png + map/liveries/A320_HAY.png + map/liveries/A320_HAZ.png + map/liveries/A320_HCC.png + map/liveries/A320_HIM.png + map/liveries/A320_HIS.png + map/liveries/A320_HKE.png + map/liveries/A320_HST.png + map/liveries/A320_HVN.png + map/liveries/A320_HXA.png + map/liveries/A320_HYS.png + map/liveries/A320_IAD.png + map/liveries/A320_IAW.png + map/liveries/A320_IBE.png + map/liveries/A320_IBS.png + map/liveries/A320_IDA.png + map/liveries/A320_IGO.png + map/liveries/A320_IRA.png + map/liveries/A320_IRM.png + map/liveries/A320_ISR.png + map/liveries/A320_ITY_NEW_BLUE.png + map/liveries/A320_IWA.png + map/liveries/A320_IWD.png + map/liveries/A320_IYE.png + map/liveries/A320_IZG.png + map/liveries/A320_IZM.png + map/liveries/A320_JAT_CARDENAL.png + map/liveries/A320_JAT_HALCON.png + map/liveries/A320_JAT_JAGUAR.png + map/liveries/A320_JAV.png + map/liveries/A320_JBU.png + map/liveries/A320_JBU_BARCODE_SL.png + map/liveries/A320_JBU_BLUEBERRY_SL.png + map/liveries/A320_JBU_SPOTLIGHT.png + map/liveries/A320_JBU_STRIPES_BILLBOARD.png + map/liveries/A320_JES.png + map/liveries/A320_JGO.png + map/liveries/A320_JJP.png + map/liveries/A320_JJP_SL.png + map/liveries/A320_JKK.png + map/liveries/A320_JMC.png + map/liveries/A320_JSA.png + map/liveries/A320_JSA_SL.png + map/liveries/A320_JST.png + map/liveries/A320_JST_SL.png + map/liveries/A320_JZR.png + map/liveries/A320_JZR_CAK.png + map/liveries/A320_KAC.png + map/liveries/A320_KGL.png + map/liveries/A320_KHO.png + map/liveries/A320_KKK.png + map/liveries/A320_KME.png + map/liveries/A320_KMM.png + map/liveries/A320_KNE.png + map/liveries/A320_KRP.png + map/liveries/A320_KZR.png + map/liveries/A320_LAA.png + map/liveries/A320_LAN.png + map/liveries/A320_LAO.png + map/liveries/A320_LBT.png + map/liveries/A320_LBY.png + map/liveries/A320_LDA.png + map/liveries/A320_LDA_CFM.png + map/liveries/A320_LGS.png + map/liveries/A320_LHA_VA.png + map/liveries/A320_LIC.png + map/liveries/A320_LKE.png + map/liveries/A320_LLC.png + map/liveries/A320_LLM.png + map/liveries/A320_LMU.png + map/liveries/A320_LNE.png + map/liveries/A320_LNR.png + map/liveries/A320_LRI.png + map/liveries/A320_LZB.png + map/liveries/A320_MAC.png + map/liveries/A320_MBU.png + map/liveries/A320_MDL.png + map/liveries/A320_MEA.png + map/liveries/A320_MET.png + map/liveries/A320_MLD.png + map/liveries/A320_MON.png + map/liveries/A320_MON_NC.png + map/liveries/A320_MPD.png + map/liveries/A320_MQT.png + map/liveries/A320_MSC.png + map/liveries/A320_MSR.png + map/liveries/A320_MXA.png + map/liveries/A320_MYX.png + map/liveries/A320_NDF.png + map/liveries/A320_NIA.png + map/liveries/A320_NKS.png + map/liveries/A320_NKS_STD.png + map/liveries/A320_NLV.png + map/liveries/A320_NLY.png + map/liveries/A320_NMA.png + map/liveries/A320_NTL.png + map/liveries/A320_NVD.png + map/liveries/A320_NWA.png + map/liveries/A320_NWS.png + map/liveries/A320_NWW.png + map/liveries/A320_OAL.png + map/liveries/A320_OAL_VA.png + map/liveries/A320_OCN_NC.png + map/liveries/A320_OCN_OC.png + map/liveries/A320_OCN_W.png + map/liveries/A320_OHY.png + map/liveries/A320_ONE.png + map/liveries/A320_PAL.png + map/liveries/A320_PFF.png + map/liveries/A320_PGT.png + map/liveries/A320_PIA.png + map/liveries/A320_PIC.png + map/liveries/A320_PLX.png + map/liveries/A320_PVI.png + map/liveries/A320_QDA.png + map/liveries/A320_QLK.png + map/liveries/A320_QNT.png + map/liveries/A320_QTR.png + map/liveries/A320_QTR_SL.png + map/liveries/A320_RBG.png + map/liveries/A320_RJA.png + map/liveries/A320_ROU.png + map/liveries/A320_RYR.png + map/liveries/A320_RYW.png + map/liveries/A320_SAA.png + map/liveries/A320_SAB.png + map/liveries/A320_SAS.png + map/liveries/A320_SAS_NC.png + map/liveries/A320_SAT.png + map/liveries/A320_SAU.png + map/liveries/A320_SBI.png + map/liveries/A320_SCO.png + map/liveries/A320_SDM.png + map/liveries/A320_SDR.png + map/liveries/A320_SFJ.png + map/liveries/A320_SFJ_SL.png + map/liveries/A320_SHT_IAE.png + map/liveries/A320_SHU.png + map/liveries/A320_SJV.png + map/liveries/A320_SKS.png + map/liveries/A320_SLK.png + map/liveries/A320_SVA.png + map/liveries/A320_SVR.png + map/liveries/A320_SWE.png + map/liveries/A320_SWR.png + map/liveries/A320_SXS.png + map/liveries/A320_SYA.png + map/liveries/A320_SYR.png + map/liveries/A320_TAI.png + map/liveries/A320_TAM.png + map/liveries/A320_TAP.png + map/liveries/A320_TAR.png + map/liveries/A320_TBA.png + map/liveries/A320_TCW.png + map/liveries/A320_TCX.png + map/liveries/A320_TEF.png + map/liveries/A320_TEJ.png + map/liveries/A320_TGW.png + map/liveries/A320_THA.png + map/liveries/A320_THD_SL.png + map/liveries/A320_THY.png + map/liveries/A320_THY_NC.png + map/liveries/A320_TKY.png + map/liveries/A320_TNU.png + map/liveries/A320_TOM.png + map/liveries/A320_TTW.png + map/liveries/A320_TVJ.png + map/liveries/A320_TVJ_SL.png + map/liveries/A320_TVS.png + map/liveries/A320_TVS_CSA.png + map/liveries/A320_UAL.png + map/liveries/A320_UAL_OC.png + map/liveries/A320_UDC.png + map/liveries/A320_UEA.png + map/liveries/A320_UGD_ALBINO.png + map/liveries/A320_UKV.png + map/liveries/A320_USA.png + map/liveries/A320_UZB.png + map/liveries/A320_VAW_CFM.png + map/liveries/A320_VAW_IAE.png + map/liveries/A320_VCP.png + map/liveries/A320_VIM.png + map/liveries/A320_VIR.png + map/liveries/A320_VIV.png + map/liveries/A320_VJC.png + map/liveries/A320_VLC.png + map/liveries/A320_VLG.png + map/liveries/A320_VLK.png + map/liveries/A320_VOE.png + map/liveries/A320_VOI.png + map/liveries/A320_VRD.png + map/liveries/A320_VRE.png + map/liveries/A320_VSP.png + map/liveries/A320_VTI.png + map/liveries/A320_VVC.png + map/liveries/A320_VVC_OC.png + map/liveries/A320_WAJ.png + map/liveries/A320_WAN.png + map/liveries/A320_WAT.png + map/liveries/A320_WAU.png + map/liveries/A320_WHT.png + map/liveries/A320_WMT.png + map/liveries/A320_WOW.png + map/liveries/A320_WRC.png + map/liveries/A320_WTB.png + map/liveries/A320_WUK.png + map/liveries/A320_WVL.png + map/liveries/A320_WYB.png + map/liveries/A320_WYB_SL.png + map/liveries/A320_WZZ.png + map/liveries/A320_XSN.png + map/liveries/A321.png + map/liveries/A321_AAG.png + map/liveries/A321_AAL.png + map/liveries/A321_AAL_WL.png + map/liveries/A321_AAR.png + map/liveries/A321_ABL.png + map/liveries/A321_ABQ.png + map/liveries/A321_ABY.png + map/liveries/A321_ACA.png + map/liveries/A321_ACA_NC.png + map/liveries/A321_ADH.png + map/liveries/A321_AEE.png + map/liveries/A321_AFF.png + map/liveries/A321_AFL.png + map/liveries/A321_AFR.png + map/liveries/A321_AFX.png + map/liveries/A321_AIC.png + map/liveries/A321_AJM.png + map/liveries/A321_ALK.png + map/liveries/A321_AMU.png + map/liveries/A321_ANA.png + map/liveries/A321_ART.png + map/liveries/A321_ARU.png + map/liveries/A321_ASV.png + map/liveries/A321_AUA.png + map/liveries/A321_AUA_SL.png + map/liveries/A321_AWC.png + map/liveries/A321_AWE.png + map/liveries/A321_AXB.png + map/liveries/A321_AZA.png + map/liveries/A321_BAV.png + map/liveries/A321_BAW.png + map/liveries/A321_BBT.png + map/liveries/A321_BER.png + map/liveries/A321_BHE.png + map/liveries/A321_BIE.png + map/liveries/A321_BMA.png + map/liveries/A321_BMI.png + map/liveries/A321_BTV.png + map/liveries/A321_BVX.png + map/liveries/A321_BYD.png + map/liveries/A321_CAI.png + map/liveries/A321_CBJ.png + map/liveries/A321_CCA.png + map/liveries/A321_CEB.png + map/liveries/A321_CES.png + map/liveries/A321_CES_NC.png + map/liveries/A321_CFG.png + map/liveries/A321_CFG_D_AIAC.png + map/liveries/A321_CFG_D_AIAD.png + map/liveries/A321_CFG_D_ATCF.png + map/liveries/A321_CFG_D_ATCG.png + map/liveries/A321_CFG_OC.png + map/liveries/A321_CSA.png + map/liveries/A321_CSC.png + map/liveries/A321_CSN.png + map/liveries/A321_CTO.png + map/liveries/A321_CXA_VA.png + map/liveries/A321_CYP.png + map/liveries/A321_DAL.png + map/liveries/A321_DKH.png + map/liveries/A321_DLH.png + map/liveries/A321_DLH_OC.png + map/liveries/A321_EFW.png + map/liveries/A321_EIN.png + map/liveries/A321_ETD.png + map/liveries/A321_EUS.png + map/liveries/A321_EVA.png + map/liveries/A321_EWG.png + map/liveries/A321_EXS.png + map/liveries/A321_EZY.png + map/liveries/A321_FFT_701.png + map/liveries/A321_FFT_721.png + map/liveries/A321_FFT_723.png + map/liveries/A321_FHA.png + map/liveries/A321_FIA.png + map/liveries/A321_FIN.png + map/liveries/A321_FIN_WINGFENCE.png + map/liveries/A321_FOE.png + map/liveries/A321_FRR.png + map/liveries/A321_GAP.png + map/liveries/A321_GCR.png + map/liveries/A321_GFA.png + map/liveries/A321_GMI.png + map/liveries/A321_GXA.png + map/liveries/A321_GZQ.png + map/liveries/A321_HAZ.png + map/liveries/A321_HDA.png + map/liveries/A321_HKE.png + map/liveries/A321_HRM.png + map/liveries/A321_HVN.png + map/liveries/A321_IAW.png + map/liveries/A321_IBE.png + map/liveries/A321_IBS.png + map/liveries/A321_IRA.png + map/liveries/A321_IRM.png + map/liveries/A321_IWA.png + map/liveries/A321_JBU.png + map/liveries/A321_JBU_NC_MOMINT.png + map/liveries/A321_JKK.png + map/liveries/A321_JST.png + map/liveries/A321_KFR.png + map/liveries/A321_KGL.png + map/liveries/A321_KYV.png + map/liveries/A321_KZR.png + map/liveries/A321_LAN.png + map/liveries/A321_LBT.png + map/liveries/A321_LHA_VA.png + map/liveries/A321_LLM.png + map/liveries/A321_LNR.png + map/liveries/A321_LTU.png + map/liveries/A321_MBU.png + map/liveries/A321_MEA.png + map/liveries/A321_MET.png + map/liveries/A321_MLD.png + map/liveries/A321_MON.png + map/liveries/A321_MSR.png + map/liveries/A321_NDF.png + map/liveries/A321_NIA.png + map/liveries/A321_NKS.png + map/liveries/A321_NKS_NC.png + map/liveries/A321_NLY.png + map/liveries/A321_NTL.png + map/liveries/A321_NVR.png + map/liveries/A321_NWS.png + map/liveries/A321_NWS_NC.png + map/liveries/A321_OAL_VA.png + map/liveries/A321_OHY.png + map/liveries/A321_PAL.png + map/liveries/A321_PLX.png + map/liveries/A321_QTR.png + map/liveries/A321_RAM.png + map/liveries/A321_RJA.png + map/liveries/A321_ROU.png + map/liveries/A321_SAS.png + map/liveries/A321_SAS_OC.png + map/liveries/A321_SBI.png + map/liveries/A321_SCO.png + map/liveries/A321_SHT.png + map/liveries/A321_SKS.png + map/liveries/A321_STW.png + map/liveries/A321_SVA.png + map/liveries/A321_SVR.png + map/liveries/A321_SWR.png + map/liveries/A321_TAM.png + map/liveries/A321_TAP.png + map/liveries/A321_TCX.png + map/liveries/A321_TEF.png + map/liveries/A321_TEJ.png + map/liveries/A321_THY.png + map/liveries/A321_THY_NCSL.png + map/liveries/A321_TKJ.png + map/liveries/A321_TKY.png + map/liveries/A321_TNA.png + map/liveries/A321_TSC.png + map/liveries/A321_TVJ.png + map/liveries/A321_UDC.png + map/liveries/A321_UKV.png + map/liveries/A321_USA.png + map/liveries/A321_UTA.png + map/liveries/A321_VAW.png + map/liveries/A321_VCP.png + map/liveries/A321_VIV.png + map/liveries/A321_VJC.png + map/liveries/A321_VKG.png + map/liveries/A321_VLC.png + map/liveries/A321_VLG.png + map/liveries/A321_VOI.png + map/liveries/A321_WAT.png + map/liveries/A321_WOW.png + map/liveries/A321_WTB.png + map/liveries/A321_WUK.png + map/liveries/A321_WZZ.png + map/liveries/A321_XSN.png + map/liveries/A321F.png + map/liveries/A321F_AWC.png + map/liveries/A321F_AZU.png + map/liveries/A321F_GEC.png + map/liveries/A332.png + map/liveries/A332_AAL.png + map/liveries/A332_AAW.png + map/liveries/A332_ABB.png + map/liveries/A332_ACI.png + map/liveries/A332_AEA.png + map/liveries/A332_AFL.png + map/liveries/A332_AFR.png + map/liveries/A332_ALK.png + map/liveries/A332_ARG.png + map/liveries/A332_ASL.png + map/liveries/A332_ASY.png + map/liveries/A332_AUA.png + map/liveries/A332_AVA.png + map/liveries/A332_AZA.png + map/liveries/A332_AZU.png + map/liveries/A332_BEC.png + map/liveries/A332_BEL.png + map/liveries/A332_BER.png + map/liveries/A332_BHE.png + map/liveries/A332_BMA.png + map/liveries/A332_BOV.png + map/liveries/A332_BRU.png + map/liveries/A332_BVX.png + map/liveries/A332_CAJ.png + map/liveries/A332_CBJ.png + map/liveries/A332_CCA.png + map/liveries/A332_CES.png + map/liveries/A332_CFG_B.png + map/liveries/A332_CFG_G.png + map/liveries/A332_CFG_S.png + map/liveries/A332_CHH.png + map/liveries/A332_CRL.png + map/liveries/A332_CSC.png + map/liveries/A332_CSN.png + map/liveries/A332_CXA_VA.png + map/liveries/A332_CYP.png + map/liveries/A332_DAH.png + map/liveries/A332_DAL.png + map/liveries/A332_EDW.png + map/liveries/A332_EEZ.png + map/liveries/A332_EIN.png + map/liveries/A332_ETD.png + map/liveries/A332_EVA.png + map/liveries/A332_EXS.png + map/liveries/A332_FJI.png + map/liveries/A332_GBG.png + map/liveries/A332_GCR.png + map/liveries/A332_GFA.png + map/liveries/A332_GIA.png + map/liveries/A332_GRL.png + map/liveries/A332_HAL.png + map/liveries/A332_HAZ.png + map/liveries/A332_HST.png + map/liveries/A332_IAW.png + map/liveries/A332_IBE.png + map/liveries/A332_IRA.png + map/liveries/A332_ITY.png + map/liveries/A332_IWA.png + map/liveries/A332_IYE.png + map/liveries/A332_JAI.png + map/liveries/A332_JST.png + map/liveries/A332_KAC.png + map/liveries/A332_KAL.png + map/liveries/A332_KKK.png + map/liveries/A332_KLM.png + map/liveries/A332_LAA.png + map/liveries/A332_LHA_VA.png + map/liveries/A332_LTU.png + map/liveries/A332_LVG.png + map/liveries/A332_MAS.png + map/liveries/A332_MAU.png + map/liveries/A332_MEA.png + map/liveries/A332_MON.png + map/liveries/A332_MSR.png + map/liveries/A332_MXA.png + map/liveries/A332_MYT.png + map/liveries/A332_NWA.png + map/liveries/A332_NWS.png + map/liveries/A332_OAL_VA.png + map/liveries/A332_OAS.png + map/liveries/A332_OCN.png + map/liveries/A332_OMA.png + map/liveries/A332_PLM.png + map/liveries/A332_PUE.png + map/liveries/A332_QFA.png + map/liveries/A332_QTR.png + map/liveries/A332_RFR.png + map/liveries/A332_RJA.png + map/liveries/A332_RRR.png + map/liveries/A332_SAA.png + map/liveries/A332_SEP.png + map/liveries/A332_SEY.png + map/liveries/A332_STW.png + map/liveries/A332_SWI.png + map/liveries/A332_SWR.png + map/liveries/A332_TAH.png + map/liveries/A332_TAM.png + map/liveries/A332_TAP.png + map/liveries/A332_TCX.png + map/liveries/A332_THY.png + map/liveries/A332_TKY.png + map/liveries/A332_TSC.png + map/liveries/A332_TSC_NC.png + map/liveries/A332_UAE.png + map/liveries/A332_UK4_ZZ333.png + map/liveries/A332_VKG.png + map/liveries/A332_VLC.png + map/liveries/A332_VOZ.png + map/liveries/A332_WAT.png + map/liveries/A332_XSN.png + map/liveries/a332F.png + map/liveries/A332F_ABB_HONGYUAN.png + map/liveries/A332F_AHK.png + map/liveries/A332F_BCS.png + map/liveries/A332F_MAS.png + map/liveries/A332F_MSX.png + map/liveries/A332F_TUA.png + map/liveries/A333.png + map/liveries/A333_AAL.png + map/liveries/A333_AAR.png + map/liveries/A333_AAW.png + map/liveries/A333_ABB.png + map/liveries/A333_ACA.png + map/liveries/A333_AEA.png + map/liveries/A333_AFL.png + map/liveries/A333_AFR.png + map/liveries/A333_ALK.png + map/liveries/A333_AWE.png + map/liveries/A333_BAF.png + map/liveries/A333_BBB.png + map/liveries/A333_BEL.png + map/liveries/A333_BEL_NC.png + map/liveries/A333_BER.png + map/liveries/A333_BTK.png + map/liveries/A333_CAI.png + map/liveries/A333_CAJ.png + map/liveries/A333_CAL.png + map/liveries/A333_CBJ.png + map/liveries/A333_CCA.png + map/liveries/A333_CEB.png + map/liveries/A333_CES.png + map/liveries/A333_CET.png + map/liveries/A333_CFG.png + map/liveries/A333_CHH.png + map/liveries/A333_CPA.png + map/liveries/A333_CPL.png + map/liveries/A333_CRK.png + map/liveries/A333_CRL.png + map/liveries/A333_CSC.png + map/liveries/A333_CSN.png + map/liveries/A333_CSZ.png + map/liveries/A333_CXA_VA.png + map/liveries/A333_DAL.png + map/liveries/A333_DLH.png + map/liveries/A333_DLH_OC.png + map/liveries/A333_EAG.png + map/liveries/A333_EDW.png + map/liveries/A333_EIN.png + map/liveries/A333_ETD.png + map/liveries/A333_EUK.png + map/liveries/A333_EVA.png + map/liveries/A333_EVE.png + map/liveries/A333_EXS.png + map/liveries/A333_FIN.png + map/liveries/A333_FJI.png + map/liveries/A333_FWI.png + map/liveries/A333_GCR.png + map/liveries/A333_GIA.png + map/liveries/A333_HDA.png + map/liveries/A333_HFM.png + map/liveries/A333_HFY_POP.png + map/liveries/A333_IBE.png + map/liveries/A333_IWD.png + map/liveries/A333_KAL.png + map/liveries/A333_KLM.png + map/liveries/A333_KNE.png + map/liveries/A333_LGS.png + map/liveries/A333_LKE.png + map/liveries/A333_LNI.png + map/liveries/A333_LNR.png + map/liveries/A333_LTU.png + map/liveries/A333_MAS.png + map/liveries/A333_MAU.png + map/liveries/A333_MSR.png + map/liveries/A333_NDF.png + map/liveries/A333_NTL.png + map/liveries/A333_NWA.png + map/liveries/A333_NWS.png + map/liveries/A333_OAL_VA.png + map/liveries/A333_OAS.png + map/liveries/A333_OCN.png + map/liveries/A333_OCN_DISCOVER.png + map/liveries/A333_OMA.png + map/liveries/A333_PAL.png + map/liveries/A333_PFF.png + map/liveries/A333_PLM.png + map/liveries/A333_QFA.png + map/liveries/A333_QTR.png + map/liveries/A333_RSY.png + map/liveries/A333_RWD.png + map/liveries/A333_SAA.png + map/liveries/A333_SAS.png + map/liveries/A333_SIA.png + map/liveries/A333_SSV.png + map/liveries/A333_SVA.png + map/liveries/A333_SWR.png + map/liveries/A333_SZN.png + map/liveries/A333_TAH.png + map/liveries/A333_TAP.png + map/liveries/A333_TAX.png + map/liveries/A333_TEF.png + map/liveries/A333_THA.png + map/liveries/A333_THY.png + map/liveries/A333_TKY.png + map/liveries/A333_TSC.png + map/liveries/A333_TSC_NC.png + map/liveries/A333_TWB.png + map/liveries/A333_VIR.png + map/liveries/A333_VKG.png + map/liveries/A333_WAT.png + map/liveries/A333_WFL.png + map/liveries/A333_XAX.png + map/liveries/A333_XSN.png + map/liveries/A333F.png + map/liveries/A333F_ABR.png + map/liveries/A333F_AHK.png + map/liveries/A333F_BCS.png + map/liveries/A333F_HAL.png + map/liveries/A342_AUA.png + map/liveries/A342_CTM.png + map/liveries/A342_EGY.png + map/liveries/A342_MSR.png + map/liveries/A342_QAF.png + map/liveries/A342_RBA.png + map/liveries/A342_RJA.png + map/liveries/A342_SAA.png + map/liveries/A343.png + map/liveries/A343_ABB.png + map/liveries/A343_ACA.png + map/liveries/A343_AFR.png + map/liveries/A343_ALK.png + map/liveries/A343_ARG.png + map/liveries/A343_AUA.png + map/liveries/A343_AXY.png + map/liveries/A343_CAL.png + map/liveries/A343_CCA.png + map/liveries/A343_CES.png + map/liveries/A343_CPA.png + map/liveries/A343_DLH.png + map/liveries/A343_DLH_NC.png + map/liveries/A343_EDW.png + map/liveries/A343_ETD.png + map/liveries/A343_FIN.png + map/liveries/A343_GFA.png + map/liveries/A343_HFY.png + map/liveries/A343_IBE.png + map/liveries/A343_IRC.png + map/liveries/A343_IRM.png + map/liveries/A343_KAC.png + map/liveries/A343_KMF.png + map/liveries/A343_LAN.png + map/liveries/A343_MAU.png + map/liveries/A343_MDG.png + map/liveries/A343_NMB.png + map/liveries/A343_OAL.png + map/liveries/A343_PAL.png + map/liveries/A343_SAA.png + map/liveries/A343_SAS.png + map/liveries/A343_SIA.png + map/liveries/A343_SLM.png + map/liveries/A343_SWI.png + map/liveries/A343_SWR.png + map/liveries/A343_TAP.png + map/liveries/A343_THT.png + map/liveries/A343_THY.png + map/liveries/A343_UAE.png + map/liveries/A343_VCV.png + map/liveries/A343_VIR.png + map/liveries/A343_WAT.png + map/liveries/A345_AHY.png + map/liveries/A345_ARA.png + map/liveries/A345_ETD.png + map/liveries/A345_QAF.png + map/liveries/A345_SIA.png + map/liveries/A345_TAM.png + map/liveries/A345_UAE.png + map/liveries/A346.png + map/liveries/A346_AHY.png + map/liveries/A346_CES.png + map/liveries/A346_CHH.png + map/liveries/A346_CPA.png + map/liveries/A346_DLH.png + map/liveries/A346_DLH_NC.png + map/liveries/A346_DLH_OC.png + map/liveries/A346_ETD.png + map/liveries/A346_IBE.png + map/liveries/A346_IRM.png + map/liveries/A346_MSX.png + map/liveries/A346_QTR.png + map/liveries/A346_SAA.png + map/liveries/A346_THA.png + map/liveries/A346_URO.png + map/liveries/A346_VCV.png + map/liveries/A346_VIR.png + map/liveries/A346_VLC.png + map/liveries/A346_WAT.png + map/liveries/A359.png + map/liveries/A359_AAR.png + map/liveries/A359_AFL.png + map/liveries/A359_AFR.png + map/liveries/A359_AFX.png + map/liveries/A359_AIC.png + map/liveries/A359_AZU.png + map/liveries/A359_BAW.png + map/liveries/A359_BHE.png + map/liveries/A359_BVX.png + map/liveries/A359_CAJ.png + map/liveries/A359_CAL.png + map/liveries/A359_CCA.png + map/liveries/A359_CES.png + map/liveries/A359_CHH.png + map/liveries/A359_CND.png + map/liveries/A359_CPA.png + map/liveries/A359_CRK.png + map/liveries/A359_CSC.png + map/liveries/A359_CSC_PANDA_B-306N.png + map/liveries/A359_CSN.png + map/liveries/A359_DAL.png + map/liveries/A359_DLH.png + map/liveries/A359_EAG.png + map/liveries/A359_EDW.png + map/liveries/A359_ETD.png + map/liveries/A359_ETH.png + map/liveries/A359_EUS.png + map/liveries/A359_EVE.png + map/liveries/A359_FBU.png + map/liveries/A359_FHA.png + map/liveries/A359_FIN.png + map/liveries/A359_FJI.png + map/liveries/A359_FWC.png + map/liveries/A359_FWI.png + map/liveries/A359_FYI.png + map/liveries/A359_GAF.png + map/liveries/A359_HAZ.png + map/liveries/A359_HVN.png + map/liveries/A359_IBE.png + map/liveries/A359_ITY.png + map/liveries/A359_ITY_EI_IFD.png + map/liveries/A359_IWA.png + map/liveries/A359_JAL.png + map/liveries/A359_KAL.png + map/liveries/A359_LHA_VA.png + map/liveries/A359_LNR.png + map/liveries/A359_MAS.png + map/liveries/A359_MAU.png + map/liveries/A359_MQT.png + map/liveries/A359_NDF.png + map/liveries/A359_NTL.png + map/liveries/A359_OAL_VA.png + map/liveries/A359_PAL.png + map/liveries/A359_PLX.png + map/liveries/A359_QTR.png + map/liveries/A359_QTR_OW.png + map/liveries/A359_SAS.png + map/liveries/A359_SCO.png + map/liveries/A359_SIA.png + map/liveries/A359_SJX.png + map/liveries/A359_SWR.png + map/liveries/A359_THA.png + map/liveries/A359_THY.png + map/liveries/A359_TKY.png + map/liveries/A359_UAE.png + map/liveries/A359_UKV.png + map/liveries/A359_VIR_RED_VELVET.png + map/liveries/A359_VSP.png + map/liveries/A359_WAT.png + map/liveries/A359_WFL.png + map/liveries/A359_XSN.png + map/liveries/A388.png + map/liveries/A388_AAR.png + map/liveries/A388_AFR.png + map/liveries/A388_ANA_KAI.png + map/liveries/A388_ANA_LANI.png + map/liveries/A388_BAW.png + map/liveries/A388_CSN.png + map/liveries/A388_DLH.png + map/liveries/A388_DLH_NC.png + map/liveries/A388_DLH_OC.png + map/liveries/A388_EAG.png + map/liveries/A388_ETD.png + map/liveries/A388_FWC.png + map/liveries/A388_HFY.png + map/liveries/A388_KAL.png + map/liveries/A388_MAS.png + map/liveries/A388_MQT.png + map/liveries/A388_NDF.png + map/liveries/A388_QFA.png + map/liveries/A388_QTR.png + map/liveries/A388_SCO_VA.png + map/liveries/A388_SIA.png + map/liveries/A388_TEJ.png + map/liveries/A388_THA.png + map/liveries/A388_UAE.png + map/liveries/A388_UAE_JOURNEY.png + map/liveries/A388_UAE_NC.png + map/liveries/A388_UKV.png + map/liveries/A388_VLC.png + map/liveries/A388_WAT.png + map/liveries/a400m.png + map/liveries/aircraft_drone.png + map/liveries/aircraft_fighter.png + map/liveries/aircraft_glider.png + map/liveries/aircraft_heavy_2engine.png + map/liveries/aircraft_heavy_4engine.png + map/liveries/aircraft_helicopter.png + map/liveries/aircraft_large.png + map/liveries/aircraft_light.png + map/liveries/aircraft_small.png + map/liveries/aircraft_space.png + map/liveries/airport_truck.png + map/liveries/apache.png + map/liveries/Asobo_208B.png + map/liveries/Asobo_208B_ACN.png + map/liveries/Asobo_208B_AZY.png + map/liveries/Asobo_208B_BRG.png + map/liveries/Asobo_208B_BVN.png + map/liveries/Asobo_208B_CFS.png + map/liveries/Asobo_208B_CTP.png + map/liveries/Asobo_208B_FDX.png + map/liveries/Asobo_208B_FDY.png + map/liveries/Asobo_208B_GBA.png + map/liveries/Asobo_208B_HND.png + map/liveries/Asobo_208B_IRO.png + map/liveries/Asobo_208B_LRI.png + map/liveries/Asobo_208B_LRS.png + map/liveries/Asobo_208B_MAL.png + map/liveries/Asobo_208B_MTN.png + map/liveries/Asobo_208B_SDA.png + map/liveries/Asobo_208B_SUB.png + map/liveries/Asobo_208B_TGY.png + map/liveries/Asobo_208B_UKV.png + map/liveries/Asobo_208B_WMA.png + map/liveries/Asobo_B350.png + map/liveries/Asobo_C152.png + map/liveries/Asobo_C172SP.png + map/liveries/Asobo_C25C.png + map/liveries/Asobo_C25C_M-MIKE.png + map/liveries/Asobo_C25C_PS-CSF.png + map/liveries/Asobo_DA40_NG.png + map/liveries/Asobo_DA62.png + map/liveries/Asobo_DA62_BLUE.png + map/liveries/Asobo_DA62_GOLD.png + map/liveries/Asobo_DR400.png + map/liveries/Asobo_TBM930.png + map/liveries/Asobo_TBM930_N960DH.png + map/liveries/Asobo_TBM930_N960VM.png + map/liveries/Asobo_VL3.png + map/liveries/AT42_BCI.png + map/liveries/AT42_CLG.png + map/liveries/AT42_CNF.png + map/liveries/AT42_DHL.png + map/liveries/AT42_DTR.png + map/liveries/AT42_FDX.png + map/liveries/AT42_HOP.png + map/liveries/AT42_OAS.png + map/liveries/AT42_PGA.png + map/liveries/AT42_REA.png + map/liveries/AT42_SEH.png + map/liveries/AT42_TYA.png + map/liveries/AT45.png + map/liveries/AT45_AKT.png + map/liveries/AT45_ANT.png + map/liveries/AT45_CLG.png + map/liveries/AT45_CUB.png + map/liveries/AT45_DTR.png + map/liveries/AT45_EFY.png + map/liveries/AT45_FJA.png + map/liveries/AT45_GUY.png + map/liveries/AT45_IWY.png + map/liveries/AT45_LOG.png + map/liveries/AT45_NSE.png + map/liveries/AT45_SSJ.png + map/liveries/AT45_SWT.png + map/liveries/AT45_TYA.png + map/liveries/AT45_UTA.png + map/liveries/AT45_VCV.png + map/liveries/AT45_WAT.png + map/liveries/AT45_WIA.png + map/liveries/AT46.png + map/liveries/AT46_BHS.png + map/liveries/AT46_BVX.png + map/liveries/AT46_JAC.png + map/liveries/AT46_LIA.png + map/liveries/AT46_LOG.png + map/liveries/AT46_NSE.png + map/liveries/AT46_OAO.png + map/liveries/AT46_SIL.png + map/liveries/AT46_UKV_HIGHLAND_CONNECT.png + map/liveries/AT72_AIZ.png + map/liveries/AT72_ASL.png + map/liveries/AT72_ATR.png + map/liveries/AT72_AUR.png + map/liveries/AT72_AVN.png + map/liveries/AT72_AWM.png + map/liveries/AT72_AZA.png + map/liveries/AT72_AZI.png + map/liveries/AT72_AZU.png + map/liveries/AT72_BHA.png + map/liveries/AT72_BKP.png + map/liveries/AT72_BON.png + map/liveries/AT72_BQB.png + map/liveries/AT72_BRJ.png + map/liveries/AT72_BRX.png + map/liveries/AT72_CCM.png + map/liveries/AT72_CNF.png + map/liveries/AT72_CSA.png + map/liveries/AT72_DAH.png + map/liveries/AT72_DTR.png + map/liveries/AT72_DWT.png + map/liveries/AT72_EIN.png + map/liveries/AT72_FCM.png + map/liveries/AT72_FDX.png + map/liveries/AT72_FFM.png + map/liveries/AT72_FFV.png + map/liveries/AT72_FWI.png + map/liveries/AT72_HOP.png + map/liveries/AT72_HVN.png + map/liveries/AT72_IBB.png + map/liveries/AT72_IRJ.png + map/liveries/AT72_ISK.png + map/liveries/AT72_ISR.png + map/liveries/AT72_JAB.png + map/liveries/AT72_JAI.png + map/liveries/AT72_LAO.png + map/liveries/AT72_MAU.png + map/liveries/AT72_MDG.png + map/liveries/AT72_MMD.png + map/liveries/AT72_MSA.png + map/liveries/AT72_MWG.png + map/liveries/AT72_NAX.png + map/liveries/AT72_NOK.png + map/liveries/AT72_NZM.png + map/liveries/AT72_OZW.png + map/liveries/AT72_PAS.png + map/liveries/AT72_PBT.png + map/liveries/AT72_PIA.png + map/liveries/AT72_PRF.png + map/liveries/AT72_RAM.png + map/liveries/AT72_REA.png + map/liveries/AT72_REU.png + map/liveries/AT72_ROT.png + map/liveries/AT72_SAS.png + map/liveries/AT72_STK.png + map/liveries/AT72_SWT.png + map/liveries/AT72_SYR.png + map/liveries/AT72_TCV.png + map/liveries/AT72_TPC.png + map/liveries/AT72_TUX.png + map/liveries/AT72_UTA.png + map/liveries/AT72_UTN.png + map/liveries/AT72_VTA.png + map/liveries/AT72_WON.png + map/liveries/AT75.png + map/liveries/AT75_ABR.png + map/liveries/AT75_AEA.png + map/liveries/AT75_ASL.png + map/liveries/AT75_BCI.png + map/liveries/AT75_BHA.png + map/liveries/AT75_BVT.png + map/liveries/AT75_CAV.png + map/liveries/AT75_CCM.png + map/liveries/AT75_CNF.png + map/liveries/AT75_CNF_WHITE.png + map/liveries/AT75_CXA_VA.png + map/liveries/AT75_DAH.png + map/liveries/AT75_DTR.png + map/liveries/AT75_EUS.png + map/liveries/AT75_FFM.png + map/liveries/AT75_FIN.png + map/liveries/AT75_IBB.png + map/liveries/AT75_LAO.png + map/liveries/AT75_LHA_VA.png + map/liveries/AT75_MAU.png + map/liveries/AT75_MMD.png + map/liveries/AT75_MWG.png + map/liveries/AT75_NVQ.png + map/liveries/AT75_NYT.png + map/liveries/AT75_OAL.png + map/liveries/AT75_OAO.png + map/liveries/AT75_OVA.png + map/liveries/AT75_PTB.png + map/liveries/AT75_ROT.png + map/liveries/AT75_SCO.png + map/liveries/AT75_SEH.png + map/liveries/AT75_SSJ.png + map/liveries/AT75_UKV.png + map/liveries/AT75_UTA.png + map/liveries/AT75_VFC.png + map/liveries/AT75_WAT.png + map/liveries/AT75_XSN.png + map/liveries/AT75F.png + map/liveries/AT75F_ABR.png + map/liveries/AT75F_ABV.png + map/liveries/AT75F_AZD.png + map/liveries/AT75F_CFS.png + map/liveries/AT75F_IMX.png + map/liveries/AT75F_MAL.png + map/liveries/AT75F_MTL.png + map/liveries/AT75F_MTN.png + map/liveries/AT75F_NFC.png + map/liveries/AT75F_NPT.png + map/liveries/AT75F_PLC.png + map/liveries/AT75F_SRN.png + map/liveries/AT75F_SWT.png + map/liveries/AT75F_TSU.png + map/liveries/AT75F_XSC.png + map/liveries/AT76.png + map/liveries/AT76_ABV.png + map/liveries/AT76_AEA.png + map/liveries/AT76_AEE.png + map/liveries/AT76_AEZ.png + map/liveries/AT76_ANE.png + map/liveries/AT76_ANZ.png + map/liveries/AT76_ASL.png + map/liveries/AT76_ATX.png + map/liveries/AT76_AUR.png + map/liveries/AT76_AUR_N.png + map/liveries/AT76_AVN.png + map/liveries/AT76_AZU.png + map/liveries/AT76_BCV.png + map/liveries/AT76_BHS.png + map/liveries/AT76_BKP.png + map/liveries/AT76_BOT.png + map/liveries/AT76_BRX.png + map/liveries/AT76_BVX.png + map/liveries/AT76_BWA.png + map/liveries/AT76_CCM.png + map/liveries/AT76_CEB.png + map/liveries/AT76_CTV.png + map/liveries/AT76_CVA.png + map/liveries/AT76_DAH.png + map/liveries/AT76_DTR.png + map/liveries/AT76_EAG.png + map/liveries/AT76_EAI.png + map/liveries/AT76_EFY.png + map/liveries/AT76_EFY_DONHENRY.png + map/liveries/AT76_EIN.png + map/liveries/AT76_EWA.png + map/liveries/AT76_EZE.png + map/liveries/AT76_FBV.png + map/liveries/AT76_FJA.png + map/liveries/AT76_FWI.png + map/liveries/AT76_FYI.png + map/liveries/AT76_GUY.png + map/liveries/AT76_GWG.png + map/liveries/AT76_HFA.png + map/liveries/AT76_IBB.png + map/liveries/AT76_IGO.png + map/liveries/AT76_IRA.png + map/liveries/AT76_JAC.png + map/liveries/AT76_LAO.png + map/liveries/AT76_LHA_VA.png + map/liveries/AT76_LLR.png + map/liveries/AT76_LOG.png + map/liveries/AT76_MAV.png + map/liveries/AT76_MDA.png + map/liveries/AT76_MDO.png + map/liveries/AT76_MSC.png + map/liveries/AT76_MXD.png + map/liveries/AT76_OAL.png + map/liveries/AT76_PFF.png + map/liveries/AT76_PTB.png + map/liveries/AT76_RAM.png + map/liveries/AT76_ROT.png + map/liveries/AT76_RSC.png + map/liveries/AT76_RXP.png + map/liveries/AT76_SAS.png + map/liveries/AT76_SEH.png + map/liveries/AT76_SIL.png + map/liveries/AT76_SRQ.png + map/liveries/AT76_SZN.png + map/liveries/AT76_TAP.png + map/liveries/AT76_TOK.png + map/liveries/AT76_TUX.png + map/liveries/AT76_UBA.png + map/liveries/AT76_UBG.png + map/liveries/AT76_UIA.png + map/liveries/AT76_UKV.png + map/liveries/AT76_UTA.png + map/liveries/AT76_VTA.png + map/liveries/AT76_WAT.png + map/liveries/AT76_WON.png + map/liveries/B06_C-GZPM.png + map/liveries/B06_DE6_OE-BXA.png + map/liveries/B06_G-HSDW.png + map/liveries/B06_US3_31A.png + map/liveries/B462_BAE.png + map/liveries/B462_BCY.png + map/liveries/B462_BCY_EI-RJX.png + map/liveries/B462_BEE.png + map/liveries/B462_ELB.png + map/liveries/B462_LZB.png + map/liveries/B463_AZI.png + map/liveries/B463_SCW.png + map/liveries/B463_SCW_SE-DSU.png + map/liveries/B463_SWU.png + map/liveries/B463_SWU_HB-STA.png + map/liveries/B463_SWU_HB-ZUR.png + map/liveries/B463_TAY.png + map/liveries/B463_TAY_EC-ELT.png + map/liveries/B717_BLF.png + map/liveries/B717_DAL.png + map/liveries/B717_HAL.png + map/liveries/B717_QNK.png + map/liveries/B717_VOE.png + map/liveries/B733.png + map/liveries/B733_AUL.png + map/liveries/B733_BAW.png + map/liveries/B733_BBD.png + map/liveries/B733_BBQ.png + map/liveries/B733_BBQ_WL.png + map/liveries/B733_BEL.png + map/liveries/B733_BOV.png + map/liveries/B733_BPA.png + map/liveries/B733_BRO.png + map/liveries/B733_BRU.png + map/liveries/B733_BTI.png + map/liveries/B733_BUR.png + map/liveries/B733_BVL.png + map/liveries/B733_DLH.png + map/liveries/B733_ELB.png + map/liveries/B733_EXS.png + map/liveries/B733_JTG.png + map/liveries/B733_LLC.png + map/liveries/B733_MSA.png + map/liveries/B733_NAX.png + map/liveries/B733_NIG.png + map/liveries/B733_NRL.png + map/liveries/B733_RAM.png + map/liveries/B733_SHI.png + map/liveries/B733_SWA.png + map/liveries/B733_TAY.png + map/liveries/B733_UAL.png + map/liveries/B733_USA.png + map/liveries/B733_VLC.png + map/liveries/B733_VRH.png + map/liveries/B733_VSP.png + map/liveries/B733_WAT.png + map/liveries/B733_WLB.png + map/liveries/B733F.png + map/liveries/B733F_AAH.png + map/liveries/B733F_AIE.png + map/liveries/B733F_AKT.png + map/liveries/B733F_BBQ.png + map/liveries/B733F_BFL.png + map/liveries/B733F_BRH.png + map/liveries/B733F_CGF.png + map/liveries/B733F_CSS.png + map/liveries/B733F_CYZ.png + map/liveries/B733F_LHA.png + map/liveries/B733F_MYU.png + map/liveries/B733F_SWT.png + map/liveries/B734.png + map/liveries/B734_AKT.png + map/liveries/B734_ARR.png + map/liveries/B734_ASA.png + map/liveries/B734_BAW.png + map/liveries/B734_BBD.png + map/liveries/B734_BBG.png + map/liveries/B734_BIE.png + map/liveries/B734_BMS.png + map/liveries/B734_HAT.png + map/liveries/B734_KLM.png + map/liveries/B734_LOT.png + map/liveries/B734_MAR.png + map/liveries/B734_NRL.png + map/liveries/B734_RLX.png + map/liveries/B734_USA.png + map/liveries/B734_UTA.png + map/liveries/B734_VAS.png + map/liveries/B734_WAT.png + map/liveries/B734F.png + map/liveries/B734F_AKT.png + map/liveries/B734F_AWK.png + map/liveries/B734F_AWK_PARCELAIR.png + map/liveries/B734F_FPO.png + map/liveries/B734F_MSA.png + map/liveries/B734F_NPT.png + map/liveries/B734F_XKY.png + map/liveries/B737.png + map/liveries/B737_AAN.png + map/liveries/B737_ADO.png + map/liveries/B737_AEZ.png + map/liveries/B737_AFX.png + map/liveries/B737_AKT.png + map/liveries/B737_AMV.png + map/liveries/B737_ARG.png + map/liveries/B737_ASA.png + map/liveries/B737_AUA.png + map/liveries/B737_AUL.png + map/liveries/B737_AXY.png + map/liveries/B737_AZB.png + map/liveries/B737_BER.png + map/liveries/B737_BHS.png + map/liveries/B737_BLA.png + map/liveries/B737_BOV.png + map/liveries/B737_BRO.png + map/liveries/B737_BRU.png + map/liveries/B737_BVX.png + map/liveries/B737_CCA.png + map/liveries/B737_CDG.png + map/liveries/B737_CES.png + map/liveries/B737_CET.png + map/liveries/B737_CMP.png + map/liveries/B737_COA.png + map/liveries/B737_CSN.png + map/liveries/B737_CXA.png + map/liveries/B737_CXA_VA.png + map/liveries/B737_DAL.png + map/liveries/B737_DRU.png + map/liveries/B737_DUB.png + map/liveries/B737_EQX.png + map/liveries/B737_ETH.png + map/liveries/B737_FBA.png + map/liveries/B737_FBV.png + map/liveries/B737_FEG.png + map/liveries/B737_GLO.png + map/liveries/B737_GMI.png + map/liveries/B737_GZP.png + map/liveries/B737_JAF.png + map/liveries/B737_JTD.png + map/liveries/B737_KLM.png + map/liveries/B737_KQA.png + map/liveries/B737_LGL.png + map/liveries/B737_LGS.png + map/liveries/B737_LHA_VA.png + map/liveries/B737_LKE.png + map/liveries/B737_LLC.png + map/liveries/B737_LNR.png + map/liveries/B737_LWI.png + map/liveries/B737_MSE.png + map/liveries/B737_MWI.png + map/liveries/B737_OAL_VA.png + map/liveries/B737_PFF.png + map/liveries/B737_RAM.png + map/liveries/B737_RLH.png + map/liveries/B737_ROT.png + map/liveries/B737_RYS.png + map/liveries/B737_SAS_NC.png + map/liveries/B737_SAS_OC.png + map/liveries/B737_SQP.png + map/liveries/B737_SWA.png + map/liveries/B737_SWA_BW.png + map/liveries/B737_SWA_SSW.png + map/liveries/B737_SYL.png + map/liveries/B737_TGZ.png + map/liveries/B737_TKY.png + map/liveries/B737_TRA.png + map/liveries/B737_TSO.png + map/liveries/B737_TUA.png + map/liveries/B737_TVS.png + map/liveries/B737_TYA.png + map/liveries/B737_UAL_NC.png + map/liveries/B737_UKV.png + map/liveries/B737_UTA.png + map/liveries/B737_VLC.png + map/liveries/B737_VOZ.png + map/liveries/B737_VSV.png + map/liveries/B737_VXP.png + map/liveries/B737_WAT.png + map/liveries/B737_WJA.png + map/liveries/B737F.png + map/liveries/B737F_ABW.png + map/liveries/B737F_AWK.png + map/liveries/B737F_FBT.png + map/liveries/B737F_PLC.png + map/liveries/B737F_SEJ.png + map/liveries/B738.png + map/liveries/B738_AAL.png + map/liveries/B738_AAL_AIRCAL.png + map/liveries/B738_AAL_CLASSIC.png + map/liveries/B738_AAL_MAX.png + map/liveries/B738_AAL_TWA.png + map/liveries/B738_ABB.png + map/liveries/B738_ABN.png + map/liveries/B738_ABX.png + map/liveries/B738_ABZ.png + map/liveries/B738_ACA.png + map/liveries/B738_ADH.png + map/liveries/B738_ADO.png + map/liveries/B738_AEA.png + map/liveries/B738_AEL.png + map/liveries/B738_AET.png + map/liveries/B738_AEY.png + map/liveries/B738_AEZ.png + map/liveries/B738_AFF.png + map/liveries/B738_AFL.png + map/liveries/B738_AFX.png + map/liveries/B738_AGA.png + map/liveries/B738_AGN.png + map/liveries/B738_AHS.png + map/liveries/B738_AJA.png + map/liveries/B738_AKX_1.png + map/liveries/B738_AKX_2.png + map/liveries/B738_AMV.png + map/liveries/B738_AMX.png + map/liveries/B738_AMX_SSW.png + map/liveries/B738_ANA.png + map/liveries/B738_ANA_1.png + map/liveries/B738_ANA_2.png + map/liveries/B738_ANG.png + map/liveries/B738_ANS.png + map/liveries/B738_ANZ.png + map/liveries/B738_ARA.png + map/liveries/B738_ARG.png + map/liveries/B738_ART.png + map/liveries/B738_ARW.png + map/liveries/B738_ASA.png + map/liveries/B738_ASA_NC.png + map/liveries/B738_AUA.png + map/liveries/B738_AUH.png + map/liveries/B738_AUI.png + map/liveries/B738_AUL.png + map/liveries/B738_AUZ.png + map/liveries/B738_AWV.png + map/liveries/B738_AXB.png + map/liveries/B738_AXB2.png + map/liveries/B738_AXB3.png + map/liveries/B738_AXE.png + map/liveries/B738_AXN.png + map/liveries/B738_AXY.png + map/liveries/B738_AYZ.png + map/liveries/B738_AZV.png + map/liveries/B738_BAL.png + map/liveries/B738_BAW.png + map/liveries/B738_BBC.png + map/liveries/B738_BDR.png + map/liveries/B738_BER.png + map/liveries/B738_BHA.png + map/liveries/B738_BHE.png + map/liveries/B738_BJN.png + map/liveries/B738_BLA.png + map/liveries/B738_BLX.png + map/liveries/B738_BNZ.png + map/liveries/B738_BOE.png + map/liveries/B738_BOV.png + map/liveries/B738_BPX.png + map/liveries/B738_BRQ.png + map/liveries/B738_BRU.png + map/liveries/B738_BSK.png + map/liveries/B738_BTK.png + map/liveries/B738_BVX.png + map/liveries/B738_BWA.png + map/liveries/B738_BZN.png + map/liveries/B738_BZS.png + map/liveries/B738_CAI.png + map/liveries/B738_CAL.png + map/liveries/B738_CAV.png + map/liveries/B738_CAW.png + map/liveries/B738_CAW_BA.png + map/liveries/B738_CAY.png + map/liveries/B738_CCA.png + map/liveries/B738_CCD.png + map/liveries/B738_CCH.png + map/liveries/B738_CDG.png + map/liveries/B738_CES.png + map/liveries/B738_CGA.png + map/liveries/B738_CGN.png + map/liveries/B738_CHH.png + map/liveries/B738_CJA.png + map/liveries/B738_CJT.png + map/liveries/B738_CJX.png + map/liveries/B738_CMP.png + map/liveries/B738_CMP_SSW.png + map/liveries/B738_CND.png + map/liveries/B738_CNM.png + map/liveries/B738_COA.png + map/liveries/B738_CSF.png + map/liveries/B738_CSH.png + map/liveries/B738_CSN.png + map/liveries/B738_CSZ.png + map/liveries/B738_CUA.png + map/liveries/B738_CUH.png + map/liveries/B738_CXA.png + map/liveries/B738_CXI.png + map/liveries/B738_CXN.png + map/liveries/B738_DAH.png + map/liveries/B738_DAL.png + map/liveries/B738_DRU.png + map/liveries/B738_DTH.png + map/liveries/B738_DUB.png + map/liveries/B738_EAG.png + map/liveries/B738_EAL.png + map/liveries/B738_EBA.png + map/liveries/B738_ECN.png + map/liveries/B738_ELY.png + map/liveries/B738_EMI.png + map/liveries/B738_EMR.png + map/liveries/B738_ENT.png + map/liveries/B738_EPA_NC.png + map/liveries/B738_EPA_OC.png + map/liveries/B738_ESR.png + map/liveries/B738_ETH.png + map/liveries/B738_EUK.png + map/liveries/B738_EUS.png + map/liveries/B738_EWG.png + map/liveries/B738_EXS.png + map/liveries/B738_EXS_HOLIDAYS.png + map/liveries/B738_EXS_LOWFARES.png + map/liveries/B738_EZZ.png + map/liveries/B738_FBA.png + map/liveries/B738_FBT.png + map/liveries/B738_FBV.png + map/liveries/B738_FBZ.png + map/liveries/B738_FDB.png + map/liveries/B738_FEG.png + map/liveries/B738_FEI.png + map/liveries/B738_FFM.png + map/liveries/B738_FHA.png + map/liveries/B738_FIA.png + map/liveries/B738_FJI.png + map/liveries/B738_FLE_MAX.png + map/liveries/B738_FLE_OC.png + map/liveries/B738_FLO.png + map/liveries/B738_FOR.png + map/liveries/B738_FOX.png + map/liveries/B738_FRR.png + map/liveries/B738_FUA.png + map/liveries/B738_FUN.png + map/liveries/B738_FUZ.png + map/liveries/B738_FWA.png + map/liveries/B738_FWC.png + map/liveries/B738_FYI.png + map/liveries/B738_FZA.png + map/liveries/B738_GAI.png + map/liveries/B738_GHY.png + map/liveries/B738_GIA.png + map/liveries/B738_GLD.png + map/liveries/B738_GLJ.png + map/liveries/B738_GLO.png + map/liveries/B738_GLO_NC.png + map/liveries/B738_GLS.png + map/liveries/B738_GLT.png + map/liveries/B738_GRE.png + map/liveries/B738_GSM.png + map/liveries/B738_GXL.png + map/liveries/B738_HAM.png + map/liveries/B738_HAZ.png + map/liveries/B738_HBH.png + map/liveries/B738_HCY.png + map/liveries/B738_HGB.png + map/liveries/B738_HIS.png + map/liveries/B738_HLF.png + map/liveries/B738_HLX.png + map/liveries/B738_HUV.png + map/liveries/B738_IAI.png + map/liveries/B738_IAW.png + map/liveries/B738_ICE_NCBOR.png + map/liveries/B738_ICE_NCGRE.png + map/liveries/B738_ICE_NCMAG.png + map/liveries/B738_ICE_NCSKY.png + map/liveries/B738_ICE_NCYEL.png + map/liveries/B738_ICE_OC.png + map/liveries/B738_ICP.png + map/liveries/B738_INX.png + map/liveries/B738_IRB.png + map/liveries/B738_IWA.png + map/liveries/B738_IYE.png + map/liveries/B738_IZA.png + map/liveries/B738_JAF.png + map/liveries/B738_JAI.png + map/liveries/B738_JAL.png + map/liveries/B738_JEF.png + map/liveries/B738_JFU.png + map/liveries/B738_JGO.png + map/liveries/B738_JJA.png + map/liveries/B738_JLL.png + map/liveries/B738_JNA.png + map/liveries/B738_JOR.png + map/liveries/B738_JRR.png + map/liveries/B738_JTA.png + map/liveries/B738_JTD_SSW.png + map/liveries/B738_JYH_DARKBLUE.png + map/liveries/B738_JYH_DARKGREEN.png + map/liveries/B738_JYH_LIGHTBLUE.png + map/liveries/B738_JYH_LIGHTGREEN.png + map/liveries/B738_JYH_ORANGE.png + map/liveries/B738_JYH_PINK.png + map/liveries/B738_JYH_YELLOW.png + map/liveries/B738_KAL.png + map/liveries/B738_KAR.png + map/liveries/B738_KLM.png + map/liveries/B738_KLM_new.png + map/liveries/B738_KNA.png + map/liveries/B738_KQA.png + map/liveries/B738_KYV.png + map/liveries/B738_KZR.png + map/liveries/B738_LAV.png + map/liveries/B738_LDA.png + map/liveries/B738_LGL.png + map/liveries/B738_LGL_SSW.png + map/liveries/B738_LGS.png + map/liveries/B738_LHA_VA.png + map/liveries/B738_LIC.png + map/liveries/B738_LKE.png + map/liveries/B738_LNI.png + map/liveries/B738_LNR.png + map/liveries/B738_LOT.png + map/liveries/B738_LOT_BANK_PEKAO.png + map/liveries/B738_LOT_ENERGYLANDIA.png + map/liveries/B738_LOT_INDEPENDENCE.png + map/liveries/B738_LOT_KROSNO_GLASS.png + map/liveries/B738_LRI.png + map/liveries/B738_MAH.png + map/liveries/B738_MAS.png + map/liveries/B738_MAY_1.png + map/liveries/B738_MAY_2.png + map/liveries/B738_MED.png + map/liveries/B738_MET.png + map/liveries/B738_MGL.png + map/liveries/B738_MHL.png + map/liveries/B738_MMZ.png + map/liveries/B738_MNO.png + map/liveries/B738_MON.png + map/liveries/B738_MQT.png + map/liveries/B738_MSE.png + map/liveries/B738_MSL.png + map/liveries/B738_MSR.png + map/liveries/B738_MWA.png + map/liveries/B738_MXD.png + map/liveries/B738_NAN_HANSSEN.png + map/liveries/B738_NAX.png + map/liveries/B738_NAX_WHITE.png + map/liveries/B738_NDF.png + map/liveries/B738_NHL.png + map/liveries/B738_NOK.png + map/liveries/B738_NOK_HS-DBA.png + map/liveries/B738_NOK_HS-DBD.png + map/liveries/B738_NOK_HS-DBE.png + map/liveries/B738_NOK_HS-DBF.png + map/liveries/B738_NOK_HS-DBG.png + map/liveries/B738_NOK_HS-DBY.png + map/liveries/B738_NOS.png + map/liveries/B738_NOZ.png + map/liveries/B738_NOZ_HANSSEN.png + map/liveries/B738_NOZ_MERCURY.png + map/liveries/B738_NOZ_UNICEF.png + map/liveries/B738_NOZ_WHITE_TAIL.png + map/liveries/B738_NPT.png + map/liveries/B738_NSZ_LARSON.png + map/liveries/B738_NSZ_MOE.png + map/liveries/B738_NSZ_WHITE_TAIL.png + map/liveries/B738_NTL.png + map/liveries/B738_NVA.png + map/liveries/B738_NWE.png + map/liveries/B738_NWS.png + map/liveries/B738_OAL_VA.png + map/liveries/B738_OAS.png + map/liveries/B738_OKA.png + map/liveries/B738_OMA.png + map/liveries/B738_OMN.png + map/liveries/B738_ORB.png + map/liveries/B738_OVA.png + map/liveries/B738_PAA.png + map/liveries/B738_PBD_SSW.png + map/liveries/B738_PBN.png + map/liveries/B738_PFF.png + map/liveries/B738_PGT.png + map/liveries/B738_PLX.png + map/liveries/B738_PRI.png + map/liveries/B738_PRY.png + map/liveries/B738_PTI.png + map/liveries/B738_PVI.png + map/liveries/B738_QFA.png + map/liveries/B738_QTR.png + map/liveries/B738_RAA.png + map/liveries/B738_RAM.png + map/liveries/B738_RAM_NC.png + map/liveries/B738_RBY.png + map/liveries/B738_REB.png + map/liveries/B738_REU.png + map/liveries/B738_REX.png + map/liveries/B738_RLH.png + map/liveries/B738_ROT.png + map/liveries/B738_RPB.png + map/liveries/B738_RRE.png + map/liveries/B738_RSF.png + map/liveries/B738_RUK.png + map/liveries/B738_RXA.png + map/liveries/B738_RYR.png + map/liveries/B738_RYR_SSW.png + map/liveries/B738_RYS.png + map/liveries/B738_SAA.png + map/liveries/B738_SAS.png + map/liveries/B738_SBI.png + map/liveries/B738_SBI_NC.png + map/liveries/B738_SCO.png + map/liveries/B738_SCX.png + map/liveries/B738_SCX_NCWL.png + map/liveries/B738_SDM.png + map/liveries/B738_SEJ.png + map/liveries/B738_SEP.png + map/liveries/B738_SEU.png + map/liveries/B738_SFR.png + map/liveries/B738_SFR_ALBINO.png + map/liveries/B738_SFR_OC.png + map/liveries/B738_SFR_SSW.png + map/liveries/B738_SFR_ZS-FGC.png + map/liveries/B738_SFR_ZS-SJO.png + map/liveries/B738_SFR_ZS-SJU.png + map/liveries/B738_SFR_ZS-SJV.png + map/liveries/B738_SFR_ZS-ZWO.png + map/liveries/B738_SGA.png + map/liveries/B738_SGX.png + map/liveries/B738_SHY.png + map/liveries/B738_SIA.png + map/liveries/B738_SJO.png + map/liveries/B738_SJY.png + map/liveries/B738_SKK.png + map/liveries/B738_SKS.png + map/liveries/B738_SKY.png + map/liveries/B738_SMD.png + map/liveries/B738_SMR.png + map/liveries/B738_SMY.png + map/liveries/B738_SNJ.png + map/liveries/B738_SOL.png + map/liveries/B738_SPL.png + map/liveries/B738_SQP.png + map/liveries/B738_STH.png + map/liveries/B738_SUN.png + map/liveries/B738_SWA.png + map/liveries/B738_SWA_LONE_STAR_ONE.png + map/liveries/B738_SWA_NEW_MEXICO_ONE.png + map/liveries/B738_SWA_TENNESSEE_ONE.png + map/liveries/B738_SWA_TRIPLE_CROWN_ONE.png + map/liveries/B738_SWG.png + map/liveries/B738_SWI.png + map/liveries/B738_SWV.png + map/liveries/B738_SXD.png + map/liveries/B738_SXS.png + map/liveries/B738_SYL.png + map/liveries/B738_SYR.png + map/liveries/B738_SYT.png + map/liveries/B738_TBA.png + map/liveries/B738_TCV.png + map/liveries/B738_TEF.png + map/liveries/B738_TEJ.png + map/liveries/B738_TEJ2.png + map/liveries/B738_TFL.png + map/liveries/B738_TGZ_30_YEARS.png + map/liveries/B738_TGZ_AIRZENA.png + map/liveries/B738_THY.png + map/liveries/B738_TKJ.png + map/liveries/B738_TKY.png + map/liveries/B738_TLM.png + map/liveries/B738_TLP.png + map/liveries/B738_TOM.png + map/liveries/B738_TPK.png + map/liveries/B738_TQQ.png + map/liveries/B738_TRA.png + map/liveries/B738_TRI.png + map/liveries/B738_TSC.png + map/liveries/B738_TSO.png + map/liveries/B738_TTL.png + map/liveries/B738_TUA.png + map/liveries/B738_TUI.png + map/liveries/B738_TUI_SSW_NC.png + map/liveries/B738_TVF.png + map/liveries/B738_TVL.png + map/liveries/B738_TVP.png + map/liveries/B738_TVS.png + map/liveries/B738_TVS_NC.png + map/liveries/B738_TVS_TSOC.png + map/liveries/B738_TWB.png + map/liveries/B738_TWI.png + map/liveries/B738_TYA.png + map/liveries/B738_UAL.png + map/liveries/B738_UAL_NC.png + map/liveries/B738_UBG.png + map/liveries/B738_UBG_BBN.png + map/liveries/B738_UBG_WHITE.png + map/liveries/B738_UKV.png + map/liveries/B738_UTA.png + map/liveries/B738_UTN.png + map/liveries/B738_VAE.png + map/liveries/B738_VAI.png + map/liveries/B738_VCP.png + map/liveries/B738_VIK.png + map/liveries/B738_VIP.png + map/liveries/B738_VLC.png + map/liveries/B738_VOZ.png + map/liveries/B738_VPA.png + map/liveries/B738_VRN.png + map/liveries/B738_VSP.png + map/liveries/B738_VSV.png + map/liveries/B738_VTI.png + map/liveries/B738_VXP_S.png + map/liveries/B738_VXP_W.png + map/liveries/B738_WAT.png + map/liveries/B738_WEV.png + map/liveries/B738_WJA.png + map/liveries/B738_WJA_SSW.png + map/liveries/B738_WSW.png + map/liveries/B738_WTB.png + map/liveries/B738_XAS.png + map/liveries/B738_XSN.png + map/liveries/B738_YZR.png + map/liveries/B738F.png + map/liveries/B738F_ABR.png + map/liveries/B738F_ABV.png + map/liveries/B738F_ABW.png + map/liveries/B738F_ADZ.png + map/liveries/B738F_AIE.png + map/liveries/B738F_AIH.png + map/liveries/B738F_AJC.png + map/liveries/B738F_AXE.png + map/liveries/B738F_AXE_RDS.png + map/liveries/B738F_BBD.png + map/liveries/B738F_BVX.png + map/liveries/B738F_CGF.png + map/liveries/B738F_CSS.png + map/liveries/B738F_CXA_AIR-ROAD.png + map/liveries/B738F_CYZ.png + map/liveries/B738F_FBF.png + map/liveries/B738F_FDX.png + map/liveries/B738F_FPO.png + map/liveries/B738F_GHN.png + map/liveries/B738F_GLO_MERCADOLIBRE.png + map/liveries/B738F_GTI.png + map/liveries/B738F_KMI.png + map/liveries/B738F_LHA.png + map/liveries/B738F_MQC.png + map/liveries/B738F_MYU.png + map/liveries/B738F_NFC.png + map/liveries/B738F_NPT.png + map/liveries/B738F_PFG.png + map/liveries/B738F_PLC.png + map/liveries/B738F_SWQ.png + map/liveries/B738F_SWT.png + map/liveries/B738F_TAY.png + map/liveries/B738F_VAS.png + map/liveries/B738F_XLR.png + map/liveries/B738F_XSC.png + map/liveries/B739.png + map/liveries/B739_AMV.png + map/liveries/B739_ASA.png + map/liveries/B739_ASA_SSWNC.png + map/liveries/B739_AUI.png + map/liveries/B739_AZV.png + map/liveries/B739_BTK.png + map/liveries/B739_BVX.png + map/liveries/B739_COA.png + map/liveries/B739_CSZ.png + map/liveries/B739_CXA_VA.png + map/liveries/B739_DAL.png + map/liveries/B739_DAL_SSW.png + map/liveries/B739_DAL_WL.png + map/liveries/B739_ELY.png + map/liveries/B739_FBV.png + map/liveries/B739_JAI.png + map/liveries/B739_KAL.png + map/liveries/B739_KAR.png + map/liveries/B739_KLM.png + map/liveries/B739_LHA_VA.png + map/liveries/B739_LNI.png + map/liveries/B739_LNR.png + map/liveries/B739_MQT.png + map/liveries/B739_MSE.png + map/liveries/B739_NTL.png + map/liveries/B739_OAL_VA.png + map/liveries/B739_OKA.png + map/liveries/B739_OMA.png + map/liveries/B739_PFF.png + map/liveries/B739_SDM.png + map/liveries/B739_SEJ.png + map/liveries/B739_SMR.png + map/liveries/B739_TEF.png + map/liveries/B739_THY.png + map/liveries/B739_TLM.png + map/liveries/B739_TVS_SKYTRAVEL.png + map/liveries/B739_UAL.png + map/liveries/B739_UAL_SSWNC.png + map/liveries/B739_UTN.png + map/liveries/B739_VAI.png + map/liveries/B739_VCP.png + map/liveries/B739_WAT.png + map/liveries/B73X.png + map/liveries/B73X_SKY.png + map/liveries/B73X_SNJ.png + map/liveries/B744.png + map/liveries/B744_AAA.png + map/liveries/B744_AAL.png + map/liveries/B744_AAR.png + map/liveries/B744_ABN.png + map/liveries/B744_ABZ.png + map/liveries/B744_ACA.png + map/liveries/B744_AFF.png + map/liveries/B744_AFR.png + map/liveries/B744_AIC.png + map/liveries/B744_ALZ.png + map/liveries/B744_ANA.png + map/liveries/B744_ANZ.png + map/liveries/B744_ARG.png + map/liveries/B744_ARW.png + map/liveries/B744_AUH.png + map/liveries/B744_AUZ.png + map/liveries/B744_AXN.png + map/liveries/B744_BAW.png + map/liveries/B744_BHA.png + map/liveries/B744_BUH.png + map/liveries/B744_CAL.png + map/liveries/B744_CCA.png + map/liveries/B744_CNS.png + map/liveries/B744_CPA.png + map/liveries/B744_CRL.png + map/liveries/B744_DAL.png + map/liveries/B744_DLH.png + map/liveries/B744_DUB.png + map/liveries/B744_ELY.png + map/liveries/B744_EMI.png + map/liveries/B744_EMR.png + map/liveries/B744_EUK.png + map/liveries/B744_EVA.png + map/liveries/B744_FLO.png + map/liveries/B744_FMT.png + map/liveries/B744_FUN.png + map/liveries/B744_GAL.png + map/liveries/B744_GIA.png + map/liveries/B744_GLL.png + map/liveries/B744_GTI.png + map/liveries/B744_IAW.png + map/liveries/B744_IRA.png + map/liveries/B744_IRM.png + map/liveries/B744_JAL.png + map/liveries/B744_JGO.png + map/liveries/B744_KAC.png + map/liveries/B744_KAL.png + map/liveries/B744_KLM.png + map/liveries/B744_LNI.png + map/liveries/B744_MAS.png + map/liveries/B744_MHL.png + map/liveries/B744_NWA.png + map/liveries/B744_PAL.png + map/liveries/B744_PIA.png + map/liveries/B744_PLM.png + map/liveries/B744_PNW.png + map/liveries/B744_QFA.png + map/liveries/B744_RAM.png + map/liveries/B744_RSU.png + map/liveries/B744_RUN.png + map/liveries/B744_SAA.png + map/liveries/B744_SEY.png + map/liveries/B744_SIA.png + map/liveries/B744_SUN.png + map/liveries/B744_SVA.png + map/liveries/B744_SWI.png + map/liveries/B744_SYR.png + map/liveries/B744_THA.png + map/liveries/B744_TSO.png + map/liveries/B744_UAL.png + map/liveries/B744_VIR.png + map/liveries/B744_WAT.png + map/liveries/B744F.png + map/liveries/B744F_AAR.png + map/liveries/B744F_ABD_Magma.png + map/liveries/B744F_ABW.png + map/liveries/B744F_ACP.png + map/liveries/B744F_ADZ.png + map/liveries/B744F_ATG.png + map/liveries/B744F_AZG.png + map/liveries/B744F_CAL.png + map/liveries/B744F_CHG.png + map/liveries/B744F_CKS.png + map/liveries/B744F_CLU.png + map/liveries/B744F_CLX.png + map/liveries/B744F_CPA.png + map/liveries/B744F_GTI.png + map/liveries/B744F_HAZ.png + map/liveries/B744F_HGO.png + map/liveries/B744F_ICL.png + map/liveries/B744F_ICV.png + map/liveries/B744F_KAL.png + map/liveries/B744F_KYE.png + map/liveries/B744F_MPH.png + map/liveries/B744F_MPH_KLMCARGO.png + map/liveries/B744F_NCR.png + map/liveries/B744F_NCR_White.png + map/liveries/B744F_OAL_VA.png + map/liveries/B744F_PAC.png + map/liveries/B744F_PLC.png + map/liveries/B744F_RCR.png + map/liveries/B744F_RUN.png + map/liveries/B744F_SIA.png + map/liveries/B744F_SVA.png + map/liveries/B744F_TAY.png + map/liveries/B744F_UKV.png + map/liveries/B744F_UPS.png + map/liveries/B748.png + map/liveries/B748_AAN.png + map/liveries/B748_BAW.png + map/liveries/B748_BVX.png + map/liveries/B748_CCA.png + map/liveries/B748_DLH_NC.png + map/liveries/B748_DLH_OC.png + map/liveries/B748_FBV.png + map/liveries/B748_KAL.png + map/liveries/B748_LHA_VA.png + map/liveries/B748_LNR.png + map/liveries/B748_OAL_VA.png + map/liveries/B748_PAA.png + map/liveries/B748_QAF_QATAR.png + map/liveries/B748_QTR.png + map/liveries/B748_SDM.png + map/liveries/B748_TKY.png + map/liveries/B748_TSO.png + map/liveries/B748_UKV.png + map/liveries/B748_VCP.png + map/liveries/B748_WAT.png + map/liveries/B748_XSN.png + map/liveries/B748F.png + map/liveries/B748F_AAN.png + map/liveries/B748F_ABB.png + map/liveries/B748F_AZG.png + map/liveries/B748F_BVX.png + map/liveries/B748F_CLX.png + map/liveries/B748F_CPA.png + map/liveries/B748F_CXA_VA.png + map/liveries/B748F_GTI.png + map/liveries/B748F_NCA.png + map/liveries/B748F_PAC.png + map/liveries/B748F_QTR_CARGO.png + map/liveries/B748F_UKV.png + map/liveries/B748F_UPS.png + map/liveries/B74F_AAR.png + map/liveries/B74F_ABW.png + map/liveries/B74F_AFR.png + map/liveries/B74F_AZQ.png + map/liveries/B74F_BAW.png + map/liveries/B74F_BBR.png + map/liveries/B74F_CAL.png + map/liveries/B74F_CCA.png + map/liveries/B74F_CKK.png + map/liveries/B74F_CKS.png + map/liveries/B74F_CLX.png + map/liveries/B74F_CSN.png + map/liveries/B74F_DHK.png + map/liveries/B74F_ELY.png + map/liveries/B74F_EVA.png + map/liveries/B74F_GSS.png + map/liveries/B74F_GTI.png + map/liveries/B74F_GWL.png + map/liveries/B74F_ICL.png + map/liveries/B74F_ICV.png + map/liveries/B74F_JAE.png + map/liveries/B74F_JAL.png + map/liveries/B74F_JGO.png + map/liveries/B74F_KAL.png + map/liveries/B74F_KLM.png + map/liveries/B74F_MAS.png + map/liveries/B74F_MPH.png + map/liveries/B74F_NCA.png + map/liveries/B74F_PAC.png + map/liveries/B74F_SQC.png + map/liveries/B74F_SVA.png + map/liveries/B74F_TAY.png + map/liveries/B74F_TCG.png + map/liveries/B74F_UAE.png + map/liveries/B74F_UPS.png + map/liveries/B74F_YZR.png + map/liveries/B752_AAL.png + map/liveries/B752_AAY.png + map/liveries/B752_ABQ.png + map/liveries/B752_AHY.png + map/liveries/B752_AIZ.png + map/liveries/B752_AMX.png + map/liveries/B752_APW.png + map/liveries/B752_ARW.png + map/liveries/B752_AVA.png + map/liveries/B752_AVE.png + map/liveries/B752_AWE.png + map/liveries/B752_BAL.png + map/liveries/B752_BBR.png + map/liveries/B752_BCS.png + map/liveries/B752_BER.png + map/liveries/B752_BHP.png + map/liveries/B752_BIE.png + map/liveries/B752_BLX.png + map/liveries/B752_BPA.png + map/liveries/B752_BTI.png + map/liveries/B752_BZS.png + map/liveries/B752_CFG.png + map/liveries/B752_COA.png + map/liveries/B752_CSH.png + map/liveries/B752_CSN.png + map/liveries/B752_CXN.png + map/liveries/B752_DAL.png + map/liveries/B752_DBR.png + map/liveries/B752_DHX.png + map/liveries/B752_DJT.png + map/liveries/B752_EAL.png + map/liveries/B752_EIN.png + map/liveries/B752_ELY.png + map/liveries/B752_EMI.png + map/liveries/B752_EMR.png + map/liveries/B752_ERO.png + map/liveries/B752_ETH.png + map/liveries/B752_EXS.png + map/liveries/B752_FAG.png + map/liveries/B752_FAM.png + map/liveries/B752_FDX.png + map/liveries/B752_FIF.png + map/liveries/B752_FIN.png + map/liveries/B752_FWA.png + map/liveries/B752_GJT.png + map/liveries/B752_GLG.png + map/liveries/B752_GRL.png + map/liveries/B752_HLN.png + map/liveries/B752_HMY.png + map/liveries/B752_IBE.png + map/liveries/B752_ICE.png + map/liveries/B752_KFY.png + map/liveries/B752_KIW.png + map/liveries/B752_KJC.png + map/liveries/B752_KZR.png + map/liveries/B752_LTU.png + map/liveries/B752_MMZ.png + map/liveries/B752_MON.png + map/liveries/B752_MOV.png + map/liveries/B752_MPH.png + map/liveries/B752_MXA.png + map/liveries/B752_MYT.png + map/liveries/B752_PTI.png + map/liveries/B752_PUA.png + map/liveries/B752_PVG.png + map/liveries/B752_ROM.png + map/liveries/B752_SAY.png + map/liveries/B752_SDO.png + map/liveries/B752_SEY.png + map/liveries/B752_SKY.png + map/liveries/B752_SLB.png + map/liveries/B752_SSV.png + map/liveries/B752_SVK.png + map/liveries/B752_SWI.png + map/liveries/B752_SWV.png + map/liveries/B752_SXS.png + map/liveries/B752_SYC.png + map/liveries/B752_TCV.png + map/liveries/B752_TCX.png + map/liveries/B752_TEJ.png + map/liveries/B752_TOM.png + map/liveries/B752_TRA.png + map/liveries/B752_TSC.png + map/liveries/B752_TWA.png + map/liveries/B752_UAL.png + map/liveries/B752_UPS.png + map/liveries/B752_UTA.png + map/liveries/B752_VLE.png + map/liveries/B752_VLO.png + map/liveries/B752_XAS.png + map/liveries/B752_XLA.png + map/liveries/B763.png + map/liveries/B763_AAL.png + map/liveries/B763_AAR.png + map/liveries/B763_ABB.png + map/liveries/B763_ABN.png + map/liveries/B763_ABX.png + map/liveries/B763_ABZ.png + map/liveries/B763_ACA.png + map/liveries/B763_ADO.png + map/liveries/B763_AEA.png + map/liveries/B763_AEY.png + map/liveries/B763_AFF.png + map/liveries/B763_AFL.png + map/liveries/B763_AGA.png + map/liveries/B763_AGN.png + map/liveries/B763_AHS.png + map/liveries/B763_AHY.png + map/liveries/B763_ALM.png + map/liveries/B763_AMX.png + map/liveries/B763_AMZ.png + map/liveries/B763_ANA.png + map/liveries/B763_ANA_W.png + map/liveries/B763_ANG.png + map/liveries/B763_ANZ.png + map/liveries/B763_ARC.png + map/liveries/B763_ARW.png + map/liveries/B763_AUA.png + map/liveries/B763_AUI.png + map/liveries/B763_AUZ.png + map/liveries/B763_AVA.png + map/liveries/B763_AVE.png + map/liveries/B763_AWC.png + map/liveries/B763_AZA.png + map/liveries/B763_AZG.png + map/liveries/B763_AZV.png + map/liveries/B763_BAL.png + map/liveries/B763_BAW.png + map/liveries/B763_BBR.png + map/liveries/B763_BHA.png + map/liveries/B763_BHP.png + map/liveries/B763_BLX.png + map/liveries/B763_BOV.png + map/liveries/B763_BPA.png + map/liveries/B763_BRU.png + map/liveries/B763_BWA.png + map/liveries/B763_CCA.png + map/liveries/B763_CES.png + map/liveries/B763_CFG.png + map/liveries/B763_CHH.png + map/liveries/B763_CIB.png + map/liveries/B763_CNS.png + map/liveries/B763_CRL.png + map/liveries/B763_CSH.png + map/liveries/B763_CXA_VA.png + map/liveries/B763_DAH.png + map/liveries/B763_DAL.png + map/liveries/B763_DAL_NCGEW.png + map/liveries/B763_DCA.png + map/liveries/B763_DHK.png + map/liveries/B763_DLH.png + map/liveries/B763_EAL.png + map/liveries/B763_EBA.png + map/liveries/B763_ECN.png + map/liveries/B763_ELY.png + map/liveries/B763_EMI.png + map/liveries/B763_EMR.png + map/liveries/B763_ETD.png + map/liveries/B763_ETH.png + map/liveries/B763_EUK.png + map/liveries/B763_FDX.png + map/liveries/B763_FRR.png + map/liveries/B763_FUN.png + map/liveries/B763_FWL.png + map/liveries/B763_GAL.png + map/liveries/B763_GFA.png + map/liveries/B763_GIA.png + map/liveries/B763_GRE.png + map/liveries/B763_GSM.png + map/liveries/B763_GTI.png + map/liveries/B763_HAL.png + map/liveries/B763_HAZ.png + map/liveries/B763_HLN.png + map/liveries/B763_HVN.png + map/liveries/B763_IAW.png + map/liveries/B763_IBE.png + map/liveries/B763_ICE_MAGENTA.png + map/liveries/B763_ICE_SKY_BLUE.png + map/liveries/B763_ISR.png + map/liveries/B763_JAF.png + map/liveries/B763_JAL.png + map/liveries/B763_JAL_WL.png + map/liveries/B763_JGO.png + map/liveries/B763_KLM.png + map/liveries/B763_KQA.png + map/liveries/B763_KZR.png + map/liveries/B763_LAN.png + map/liveries/B763_LCO.png + map/liveries/B763_LDA.png + map/liveries/B763_LLB.png + map/liveries/B763_LNR.png + map/liveries/B763_LOT.png + map/liveries/B763_LTU.png + map/liveries/B763_MAA.png + map/liveries/B763_MAH.png + map/liveries/B763_MDG.png + map/liveries/B763_MGL.png + map/liveries/B763_MMZ.png + map/liveries/B763_MON.png + map/liveries/B763_MPH.png + map/liveries/B763_MSR.png + map/liveries/B763_MXA.png + map/liveries/B763_MYT.png + map/liveries/B763_NAO.png + map/liveries/B763_NDF.png + map/liveries/B763_NOS.png + map/liveries/B763_NWS.png + map/liveries/B763_OAE.png + map/liveries/B763_OAL_VA.png + map/liveries/B763_OOM.png + map/liveries/B763_PRY.png + map/liveries/B763_PUA.png + map/liveries/B763_PVG.png + map/liveries/B763_PVI.png + map/liveries/B763_QFA.png + map/liveries/B763_RAM.png + map/liveries/B763_RBA.png + map/liveries/B763_RKA.png + map/liveries/B763_ROM.png + map/liveries/B763_ROU.png + map/liveries/B763_SAB.png + map/liveries/B763_SAS.png + map/liveries/B763_SBI.png + map/liveries/B763_SDM.png + map/liveries/B763_SEY.png + map/liveries/B763_SGR.png + map/liveries/B763_SUN.png + map/liveries/B763_SVW.png + map/liveries/B763_SWI.png + map/liveries/B763_SYC.png + map/liveries/B763_SYR.png + map/liveries/B763_SYT.png + map/liveries/B763_TAM.png + map/liveries/B763_TBA.png + map/liveries/B763_TCX.png + map/liveries/B763_TEJ.png + map/liveries/B763_TFL.png + map/liveries/B763_TGZ.png + map/liveries/B763_TNA.png + map/liveries/B763_TOM.png + map/liveries/B763_TSO.png + map/liveries/B763_TUA.png + map/liveries/B763_TUS.png + map/liveries/B763_TWA.png + map/liveries/B763_UAL.png + map/liveries/B763_UAL_BLUE.png + map/liveries/B763_UAL_GOLD.png + map/liveries/B763_UDN.png + map/liveries/B763_UKV_AURORA.png + map/liveries/B763_UPS.png + map/liveries/B763_UTA.png + map/liveries/B763_UTN.png + map/liveries/B763_UZB.png + map/liveries/B763_VCP.png + map/liveries/B763_VLE.png + map/liveries/B763_VSP.png + map/liveries/B763_WAT.png + map/liveries/B763_XAS.png + map/liveries/B763F.png + map/liveries/B763F_ABX.png + map/liveries/B763F_ACA.png + map/liveries/B763F_AJT.png + map/liveries/B763F_ANA.png + map/liveries/B763F_ATN.png + map/liveries/B763F_ATN_PRIME.png + map/liveries/B763F_CJT.png + map/liveries/B763F_CKS.png + map/liveries/B763F_DAE.png + map/liveries/B763F_DHK.png + map/liveries/B763F_DHX.png + map/liveries/B763F_FDX.png + map/liveries/B763F_GTI_PRIME_WL.png + map/liveries/B763F_LAE.png + map/liveries/B763F_LCO.png + map/liveries/B763F_LTG.png + map/liveries/B763F_MQC.png + map/liveries/B763F_MZN.png + map/liveries/B763F_NAC.png + map/liveries/B763F_NFC.png + map/liveries/B763F_PAC.png + map/liveries/B763F_PLC.png + map/liveries/B763F_QFA.png + map/liveries/B763F_SRR.png + map/liveries/B763F_TMN.png + map/liveries/B763F_UPS.png + map/liveries/B772.png + map/liveries/B772_AAL.png + map/liveries/B772_AAR.png + map/liveries/B772_ACA.png + map/liveries/B772_AFR.png + map/liveries/B772_AIC.png + map/liveries/B772_ANA.png + map/liveries/B772_ANZ.png + map/liveries/B772_AUA.png + map/liveries/B772_AUH.png + map/liveries/B772_AZA.png + map/liveries/B772_BAW.png + map/liveries/B772_CCA.png + map/liveries/B772_COA.png + map/liveries/B772_CPA.png + map/liveries/B772_CSN.png + map/liveries/B772_CXA_VA.png + map/liveries/B772_DAL.png + map/liveries/B772_DUB.png + map/liveries/B772_EAL.png + map/liveries/B772_ELY.png + map/liveries/B772_FBV.png + map/liveries/B772_FWC.png + map/liveries/B772_HAZ.png + map/liveries/B772_HVN.png + map/liveries/B772_IAE.png + map/liveries/B772_JAL.png + map/liveries/B772_KAC.png + map/liveries/B772_KAL.png + map/liveries/B772_KLM.png + map/liveries/B772_KQA.png + map/liveries/B772_MAS.png + map/liveries/B772_MMZ.png + map/liveries/B772_MSE.png + map/liveries/B772_MSR.png + map/liveries/B772_NWS.png + map/liveries/B772_OAE.png + map/liveries/B772_ORB.png + map/liveries/B772_PIA.png + map/liveries/B772_PIA_NC.png + map/liveries/B772_REU.png + map/liveries/B772_RWZ.png + map/liveries/B772_SIA.png + map/liveries/B772_SVA.png + map/liveries/B772_THA.png + map/liveries/B772_TKY.png + map/liveries/B772_UAE.png + map/liveries/B772_UAL.png + map/liveries/B772_UAL_NC.png + map/liveries/B772_UAL_OC.png + map/liveries/B772_UKV.png + map/liveries/B772_VCP.png + map/liveries/B772_VSP.png + map/liveries/B772_WAT.png + map/liveries/B772_WYB.png + map/liveries/B773_ANA.png + map/liveries/B773_CPA.png + map/liveries/B773_JAL.png + map/liveries/B773_KAL.png + map/liveries/B773_SIA.png + map/liveries/B773_THA.png + map/liveries/B773_TSO.png + map/liveries/B773_UAE.png + map/liveries/B773_VLC.png + map/liveries/B773_VOZ.png + map/liveries/B77L.png + map/liveries/B77L_ACA.png + map/liveries/B77L_ACA_NC.png + map/liveries/B77L_AFR.png + map/liveries/B77L_AIC.png + map/liveries/B77L_BOX.png + map/liveries/B77L_CKK.png + map/liveries/B77L_CSN.png + map/liveries/B77L_DAL.png + map/liveries/B77L_ECN.png + map/liveries/B77L_ETD.png + map/liveries/B77L_ETH.png + map/liveries/B77L_FDX.png + map/liveries/B77L_GEC.png + map/liveries/B77L_JGO.png + map/liveries/B77L_KAL.png + map/liveries/B77L_KAR.png + map/liveries/B77L_LCO.png + map/liveries/B77L_LHA_VA.png + map/liveries/B77L_LNR.png + map/liveries/B77L_MSE.png + map/liveries/B77L_NWS.png + map/liveries/B77L_OAL_VA.png + map/liveries/B77L_PIA.png + map/liveries/B77L_PIA_NC.png + map/liveries/B77L_PLX.png + map/liveries/B77L_PVI.png + map/liveries/B77L_QTR.png + map/liveries/B77L_REU.png + map/liveries/B77L_SOO.png + map/liveries/B77L_SUN.png + map/liveries/B77L_SWI.png + map/liveries/B77L_TAY.png + map/liveries/B77L_TUA.png + map/liveries/B77L_UAE.png + map/liveries/B77L_UKV.png + map/liveries/B77L_WAT.png + map/liveries/B77L_XSN.png + map/liveries/B77LF.png + map/liveries/B77LF_ABW.png + map/liveries/B77LF_AJC.png + map/liveries/B77LF_ANA.png + map/liveries/B77LF_AZG.png + map/liveries/B77LF_BOX.png + map/liveries/B77LF_BOX_DHL.png + map/liveries/B77LF_BVX.png + map/liveries/B77LF_CAL.png + map/liveries/B77LF_CAO.png + map/liveries/B77LF_CKK_NC.png + map/liveries/B77LF_CKS.png + map/liveries/B77LF_CKS_DHL.png + map/liveries/B77LF_CKS_KALITTA-NC.png + map/liveries/B77LF_CMA.png + map/liveries/B77LF_CSG.png + map/liveries/B77LF_CSN.png + map/liveries/B77LF_DHK.png + map/liveries/B77LF_ETD.png + map/liveries/B77LF_EVA.png + map/liveries/B77LF_FDX.png + map/liveries/B77LF_GEC.png + map/liveries/B77LF_GEC_OC.png + map/liveries/B77LF_GTI.png + map/liveries/B77LF_IWA.png + map/liveries/B77LF_KAL_LRF.png + map/liveries/B77LF_MQC.png + map/liveries/B77LF_NFC.png + map/liveries/B77LF_PAC_DHL.png + map/liveries/B77LF_PLC.png + map/liveries/B77LF_QTR_CARGO.png + map/liveries/B77LF_SIA.png + map/liveries/B77LF_SRR.png + map/liveries/B77LF_SVA.png + map/liveries/B77LF_THY_CARGO.png + map/liveries/B77LF_UAE_CARGO.png + map/liveries/B77LF_WYB.png + map/liveries/B77W.png + map/liveries/B77W_AAL.png + map/liveries/B77W_ABG.png + map/liveries/B77W_ACA.png + map/liveries/B77W_AFL.png + map/liveries/B77W_AFR.png + map/liveries/B77W_AIC.png + map/liveries/B77W_ANA.png + map/liveries/B77W_ANZ.png + map/liveries/B77W_AUH.png + map/liveries/B77W_AZV.png + map/liveries/B77W_BAW.png + map/liveries/B77W_BBC.png + map/liveries/B77W_BHE.png + map/liveries/B77W_BVX.png + map/liveries/B77W_CAL.png + map/liveries/B77W_CCA.png + map/liveries/B77W_CES.png + map/liveries/B77W_CET.png + map/liveries/B77W_CPA.png + map/liveries/B77W_CSN.png + map/liveries/B77W_CXA_VA.png + map/liveries/B77W_DLH.png + map/liveries/B77W_DTA.png + map/liveries/B77W_ETD.png + map/liveries/B77w_ETD_NC.png + map/liveries/B77w_ETH.png + map/liveries/B77W_EUS.png + map/liveries/B77W_EVA.png + map/liveries/B77w_FBV.png + map/liveries/B77W_FHA.png + map/liveries/B77W_GFA.png + map/liveries/B77W_GIA.png + map/liveries/B77W_HAZ.png + map/liveries/B77W_IGO.png + map/liveries/B77W_JAI.png + map/liveries/B77W_JAL.png + map/liveries/B77W_JRR.png + map/liveries/B77w_KAC.png + map/liveries/B77W_KAL.png + map/liveries/B77W_KLM.png + map/liveries/B77W_KQA.png + map/liveries/B77W_LHA_VA.png + map/liveries/B77W_LNR.png + map/liveries/B77W_MET.png + map/liveries/B77W_MQT.png + map/liveries/B77W_MSR.png + map/liveries/B77W_NDF.png + map/liveries/B77W_NTL.png + map/liveries/B77w_NWS.png + map/liveries/B77W_OAL_VA.png + map/liveries/B77W_PAL.png + map/liveries/B77W_PIA.png + map/liveries/B77W_PLX.png + map/liveries/B77W_QTR.png + map/liveries/B77w_QTR_WC.png + map/liveries/B77W_REU.png + map/liveries/B77W_SCO.png + map/liveries/B77W_SDM.png + map/liveries/B77W_SIA.png + map/liveries/B77W_SKS.png + map/liveries/B77W_STW.png + map/liveries/B77W_SVA.png + map/liveries/B77w_SWR.png + map/liveries/B77W_TAM.png + map/liveries/B77W_TEJ.png + map/liveries/B77W_THA.png + map/liveries/B77W_THY.png + map/liveries/B77W_TKY.png + map/liveries/B77W_TSO.png + map/liveries/B77W_TUA.png + map/liveries/B77W_UAE.png + map/liveries/B77w_UAL.png + map/liveries/B77W_VIR.png + map/liveries/B77W_VLC.png + map/liveries/B77W_VOZ.png + map/liveries/B77W_WAT.png + map/liveries/B77W_WYB.png + map/liveries/B788.png + map/liveries/B788_AAL.png + map/liveries/B788_ACA.png + map/liveries/B788_AEA.png + map/liveries/B788_AFL.png + map/liveries/B788_AHY.png + map/liveries/B788_AIC.png + map/liveries/B788_AJX.png + map/liveries/B788_AMX.png + map/liveries/B788_ANA.png + map/liveries/B788_ATC.png + map/liveries/B788_AVA.png + map/liveries/B788_BAW.png + map/liveries/B788_BBC.png + map/liveries/B788_BVX.png + map/liveries/B788_CHH.png + map/liveries/B788_CSN.png + map/liveries/B788_CXA.png + map/liveries/B788_ELY.png + map/liveries/B788_ETD.png + map/liveries/B788_ETH.png + map/liveries/B788_IAW.png + map/liveries/B788_JAF.png + map/liveries/B788_JAL.png + map/liveries/B788_JST.png + map/liveries/B788_KQA.png + map/liveries/B788_LAN.png + map/liveries/B788_LOT.png + map/liveries/B788_LOT_OLYMPIC_TEAM.png + map/liveries/B788_NAX.png + map/liveries/B788_NLH.png + map/liveries/B788_OMA.png + map/liveries/B788_PFF.png + map/liveries/B788_QTR.png + map/liveries/B788_RAM.png + map/liveries/B788_RBA.png + map/liveries/B788_REU.png + map/liveries/B788_RJA.png + map/liveries/B788_TFL.png + map/liveries/B788_TGW.png + map/liveries/B788_THA.png + map/liveries/B788_TOM.png + map/liveries/B788_TZP.png + map/liveries/B788_UAL.png + map/liveries/B788_UKV.png + map/liveries/B788_UZB.png + map/liveries/B788_WAT.png + map/liveries/B789.png + map/liveries/B789_AAL.png + map/liveries/B789_AAN.png + map/liveries/B789_ACA.png + map/liveries/B789_ADH.png + map/liveries/B789_AEA.png + map/liveries/B789_AFL.png + map/liveries/B789_AFR.png + map/liveries/B789_AIC_VTI.png + map/liveries/B789_AMX.png + map/liveries/B789_ANA.png + map/liveries/B789_ANZ.png + map/liveries/B789_ANZ_BL.png + map/liveries/B789_APZ.png + map/liveries/B789_ATC.png + map/liveries/B789_AUA.png + map/liveries/B789_AVA.png + map/liveries/B789_BAV.png + map/liveries/B789_BAW.png + map/liveries/B789_BBC.png + map/liveries/B789_BLX.png + map/liveries/B789_BVX.png + map/liveries/B789_CCA.png + map/liveries/B789_CES.png + map/liveries/B789_CHH.png + map/liveries/B789_CSH.png + map/liveries/B789_CSN.png + map/liveries/B789_CXA.png + map/liveries/B789_DKH.png + map/liveries/B789_DLH.png + map/liveries/B789_EAG.png + map/liveries/B789_ELY.png + map/liveries/B789_ETD.png + map/liveries/B789_ETH.png + map/liveries/B789_EVA.png + map/liveries/B789_FBV.png + map/liveries/B789_GFA.png + map/liveries/B789_HAL.png + map/liveries/B789_HVN.png + map/liveries/B789_IGO.png + map/liveries/B789_JAL.png + map/liveries/B789_KAL.png + map/liveries/B789_KLM.png + map/liveries/B789_LAN.png + map/liveries/B789_LHA_VA.png + map/liveries/B789_LIC.png + map/liveries/B789_LNR.png + map/liveries/B789_LOT.png + map/liveries/B789_LOT_INDEPENDENCE.png + map/liveries/B789_MET.png + map/liveries/B789_MGL.png + map/liveries/B789_MSE.png + map/liveries/B789_MSR.png + map/liveries/B789_NAX_FREDDIE.png + map/liveries/B789_NBT.png + map/liveries/B789_NDF.png + map/liveries/B789_NLH.png + map/liveries/B789_NOS.png + map/liveries/B789_NRS.png + map/liveries/B789_NSW.png + map/liveries/B789_NTL.png + map/liveries/B789_OAL_VA.png + map/liveries/B789_OMA.png + map/liveries/B789_PFF.png + map/liveries/B789_QFA.png + map/liveries/B789_QFA_100.png + map/liveries/B789_QFA_2.png + map/liveries/B789_QTR.png + map/liveries/B789_RAM.png + map/liveries/B789_RXI.png + map/liveries/B789_SVA.png + map/liveries/B789_TAM.png + map/liveries/B789_TGW.png + map/liveries/B789_THA.png + map/liveries/B789_THT.png + map/liveries/B789_THY.png + map/liveries/B789_TKY.png + map/liveries/B789_TOM.png + map/liveries/B789_TZP.png + map/liveries/B789_UAL_NC.png + map/liveries/B789_UBT.png + map/liveries/B789_UKV.png + map/liveries/B789_VIR.png + map/liveries/B789_VSP.png + map/liveries/B789_WAT.png + map/liveries/B789_WJA.png + map/liveries/B78X.png + map/liveries/B78X_ANA.png + map/liveries/B78X_BAW.png + map/liveries/B78X_ETD.png + map/liveries/B78X_EVA.png + map/liveries/B78X_HVN.png + map/liveries/B78X_KAL.png + map/liveries/B78X_KLM.png + map/liveries/B78X_SIA.png + map/liveries/B78X_SVA.png + map/liveries/B78X_UAL.png + map/liveries/B78X_UKV.png + map/liveries/B78X_WAT.png + map/liveries/BCS1.png + map/liveries/BCS1_CTN.png + map/liveries/BCS1_DAL.png + map/liveries/BCS1_ITY.png + map/liveries/BCS1_LZB.png + map/liveries/BCS1_MLM.png + map/liveries/BCS1_SWR.png + map/liveries/BCS1_WAT.png + map/liveries/BCS3.png + map/liveries/BCS3_ACA.png + map/liveries/BCS3_AFR.png + map/liveries/BCS3_ATC.png + map/liveries/BCS3_BTI.png + map/liveries/BCS3_CSA.png + map/liveries/BCS3_CTN.png + map/liveries/BCS3_CYP.png + map/liveries/BCS3_DAL.png + map/liveries/BCS3_IAN.png + map/liveries/BCS3_IAW.png + map/liveries/BCS3_ITY.png + map/liveries/BCS3_ITY_Born.png + map/liveries/BCS3_JBU.png + map/liveries/BCS3_JBU_HOPS.png + map/liveries/BCS3_KAL.png + map/liveries/BCS3_LZB.png + map/liveries/BCS3_MSR.png + map/liveries/BCS3_MXY.png + map/liveries/BCS3_QLK.png + map/liveries/BCS3_REU_OLAV.png + map/liveries/BCS3_REU_OMER.png + map/liveries/BCS3_REU_OTER.png + map/liveries/BCS3_SWR.png + map/liveries/BCS3_WAT.png + map/liveries/BE20_BGT.png + map/liveries/BE20_CAT.png + map/liveries/BE20_C-GSAE.png + map/liveries/BE20_D-IKOB.png + map/liveries/BE20_HER.png + map/liveries/BE20_UK4_ZK450.png + map/liveries/BE20_ZS-PEZ.png + map/liveries/C130_AU4_06.png + map/liveries/C130_SE1_841.png + map/liveries/C130_US2_FA.png + map/liveries/C150_r2.png + map/liveries/C17_UK4_ZZ171.png + map/liveries/C172_r2.png + map/liveries/C30J_NO4_5607.png + map/liveries/C30J_UK4_ZH880.png + map/liveries/C30J_US4_21434.png + map/liveries/C421_BGM.png + map/liveries/C421_D-ICVW.png + map/liveries/C421_EC-IHY.png + map/liveries/C421_EC-ILM.png + map/liveries/C5_US4_40061.png + map/liveries/chinook.png + map/liveries/CL41_CA4_SB2.png + map/liveries/CRJ2_ACA.png + map/liveries/CRJ2_ACV.png + map/liveries/CRJ2_ADR.png + map/liveries/CRJ2_AFR.png + map/liveries/CRJ2_AGA.png + map/liveries/CRJ2_ALZ.png + map/liveries/CRJ2_ANE.png + map/liveries/CRJ2_ASQ.png + map/liveries/CRJ2_AUA.png + map/liveries/CRJ2_AWE.png + map/liveries/CRJ2_BGM.png + map/liveries/CRJ2_BRU.png + map/liveries/CRJ2_BZH.png + map/liveries/CRJ2_CDA.png + map/liveries/CRJ2_CDG.png + map/liveries/CRJ2_CIM.png + map/liveries/CRJ2_COM.png + map/liveries/CRJ2_CSH.png + map/liveries/CRJ2_CYH.png + map/liveries/CRJ2_DAN.png + map/liveries/CRJ2_DLA.png + map/liveries/CRJ2_DLH.png + map/liveries/CRJ2_EGF.png + map/liveries/CRJ2_EMR.png + map/liveries/CRJ2_EUK.png + map/liveries/CRJ2_EWG.png + map/liveries/CRJ2_EXY.png + map/liveries/CRJ2_FFT.png + map/liveries/CRJ2_FWA.png + map/liveries/CRJ2_GAL.png + map/liveries/CRJ2_GFV.png + map/liveries/CRJ2_HIS.png + map/liveries/CRJ2_IAE.png + map/liveries/CRJ2_JAL.png + map/liveries/CRJ2_JIA.png + map/liveries/CRJ2_JZA.png + map/liveries/CRJ2_LDA.png + map/liveries/CRJ2_MAH.png + map/liveries/CRJ2_MSO.png + map/liveries/CRJ2_MXI.png + map/liveries/CRJ2_NWA.png + map/liveries/CRJ2_PWV.png + map/liveries/CRJ2_QXE.png + map/liveries/CRJ2_SHD.png + map/liveries/CRJ2_SKW.png + map/liveries/CRJ2_SSF.png + map/liveries/CRJ2_TAO.png + map/liveries/CRJ2_TRS.png + map/liveries/CRJ2_UAL.png + map/liveries/CRJ2_UTA.png + map/liveries/CRJ2_UTN.png + map/liveries/CRJ2_VCV.png + map/liveries/CRJ2_ZMA.png + map/liveries/CRJ7.png + map/liveries/CRJ7_AAL.png + map/liveries/CRJ7_AFR.png + map/liveries/CRJ7_ASH.png + map/liveries/CRJ7_ASQ.png + map/liveries/CRJ7_BRU.png + map/liveries/CRJ7_BVX.png + map/liveries/CRJ7_CLH.png + map/liveries/CRJ7_DAL.png + map/liveries/CRJ7_DLH.png + map/liveries/CRJ7_EGF.png + map/liveries/CRJ7_FFT.png + map/liveries/CRJ7_GJS.png + map/liveries/CRJ7_IAE.png + map/liveries/CRJ7_IBX.png + map/liveries/CRJ7_JIA.png + map/liveries/CRJ7_JZA.png + map/liveries/CRJ7_LLM.png + map/liveries/CRJ7_MGL.png + map/liveries/CRJ7_PFF.png + map/liveries/CRJ7_QXE.png + map/liveries/CRJ7_RLU.png + map/liveries/CRJ7_RLU_WHITE.png + map/liveries/CRJ7_SKW.png + map/liveries/CRJ7_SSF.png + map/liveries/CRJ7_TGZ.png + map/liveries/CRJ7_TUA.png + map/liveries/CRJ7_UAL.png + map/liveries/CRJ7_UKV.png + map/liveries/CRJ7_UVT.png + map/liveries/CRJ7_WAT.png + map/liveries/CRJ9_ANE.png + map/liveries/CRJ9_ASH.png + map/liveries/CRJ9_ASQ.png + map/liveries/CRJ9_CLH.png + map/liveries/CRJ9_IAW.png + map/liveries/CRJ9_JZA.png + map/liveries/CRJ9_SAS.png + map/liveries/CRJ9_TUX.png + map/liveries/CRJX_ANE.png + map/liveries/CRJX_GIA.png + map/liveries/CRJX_HOP.png + map/liveries/D328_AUL.png + map/liveries/D328_BEE.png + map/liveries/D328_EZE.png + map/liveries/D328_ISK.png + map/liveries/D328_RHE.png + map/liveries/D328_SRK.png + map/liveries/D328_WLC.png + map/liveries/DC10_FDX.png + map/liveries/DH8C.png + map/liveries/DH8C_AIE.png + map/liveries/DH8C_ANG.png + map/liveries/DH8C_ANZ.png + map/liveries/DH8C_ANZ_BLK.png + map/liveries/DH8C_DQA.png + map/liveries/DH8C_KEM.png + map/liveries/DH8C_NCB.png + map/liveries/DH8C_PAG.png + map/liveries/DH8C_PER.png + map/liveries/DH8C_PVL.png + map/liveries/DH8C_QLK.png + map/liveries/DH8C_RKA.png + map/liveries/DH8C_RVF.png + map/liveries/DH8C_SHU.png + map/liveries/DH8C_SYL.png + map/liveries/DH8C_WAT.png + map/liveries/DH8C_WIF.png + map/liveries/DH8D.png + map/liveries/DH8D_ACA.png + map/liveries/DH8D_AEE.png + map/liveries/DH8D_AFX.png + map/liveries/DH8D_AKX.png + map/liveries/DH8D_ANA.png + map/liveries/DH8D_ANG.png + map/liveries/DH8D_ARA.png + map/liveries/DH8D_ARE.png + map/liveries/DH8D_ASA.png + map/liveries/DH8D_ATC.png + map/liveries/DH8D_AUA.png + map/liveries/DH8D_AUA_Star.png + map/liveries/DH8D_AUB.png + map/liveries/DH8D_AZB.png + map/liveries/DH8D_BBC.png + map/liveries/DH8D_BBO.png + map/liveries/DH8D_BBZ.png + map/liveries/DH8D_BEE.png + map/liveries/DH8D_BEL.png + map/liveries/DH8D_BER.png + map/liveries/DH8D_BTI.png + map/liveries/DH8D_CGA.png + map/liveries/DH8D_CTN.png + map/liveries/DH8D_CTO.png + map/liveries/DH8D_CXA_VA.png + map/liveries/DH8D_DTA.png + map/liveries/DH8D_DTH.png + map/liveries/DH8D_DWT.png + map/liveries/DH8D_ECN.png + map/liveries/DH8D_ELO.png + map/liveries/DH8D_ETH.png + map/liveries/DH8D_EWG.png + map/liveries/DH8D_EXY.png + map/liveries/DH8D_FFT.png + map/liveries/DH8D_GAP.png + map/liveries/DH8D_HIS.png + map/liveries/DH8D_HYD.png + map/liveries/DH8D_ICE_NCPINK.png + map/liveries/DH8D_IHO.png + map/liveries/DH8D_JAC.png + map/liveries/DH8D_JAL.png + map/liveries/DH8D_JJA.png + map/liveries/DH8D_JMA_GIRAFFE.png + map/liveries/DH8D_JMA_LEOPARD.png + map/liveries/DH8D_JZA.png + map/liveries/DH8D_KEM.png + map/liveries/DH8D_LAM.png + map/liveries/DH8D_LGL.png + map/liveries/DH8D_LHA_VA.png + map/liveries/DH8D_LOT.png + map/liveries/DH8D_MAH.png + map/liveries/DH8D_MET.png + map/liveries/DH8D_OAL.png + map/liveries/DH8D_PAL.png + map/liveries/DH8D_POE.png + map/liveries/DH8D_PTR.png + map/liveries/DH8D_PVL.png + map/liveries/DH8D_QAZ.png + map/liveries/DH8D_QFA.png + map/liveries/DH8D_QLK.png + map/liveries/DH8D_QXE.png + map/liveries/DH8D_RAC.png + map/liveries/DH8D_SAT.png + map/liveries/DH8D_SAU.png + map/liveries/DH8D_SEJ.png + map/liveries/DH8D_SHA.png + map/liveries/DH8D_SHU.png + map/liveries/DH8D_SKK.png + map/liveries/DH8D_SRK.png + map/liveries/DH8D_SWU.png + map/liveries/DH8D_SWU_GREEN.png + map/liveries/DH8D_SYL.png + map/liveries/DH8D_TCF.png + map/liveries/DH8D_TYR.png + map/liveries/DH8D_UKV.png + map/liveries/DH8D_VCP.png + map/liveries/DH8D_VRE.png + map/liveries/DH8D_WAT.png + map/liveries/DH8D_WEN.png + map/liveries/DH8D_WIF.png + map/liveries/DH8D_WJA.png + map/liveries/DH8D_XSN.png + map/liveries/drone.png + map/liveries/E135_BMI.png + map/liveries/E135_CHQ.png + map/liveries/E135_EGF.png + map/liveries/E135_HAF.png + map/liveries/E135_LGL.png + map/liveries/E135_LNK.png + map/liveries/E135_NMB.png + map/liveries/E135_RAE.png + map/liveries/E145_AMX.png + map/liveries/E145_BEL.png + map/liveries/E145_BMI.png + map/liveries/E145_BMI_G-RJXI.png + map/liveries/E145_EGF.png + map/liveries/E145_EZE.png + map/liveries/E145_FFT.png + map/liveries/E145_HOP.png + map/liveries/E145_PGA.png + map/liveries/E145_TWE.png + map/liveries/E145_UAL.png + map/liveries/E145_UDN.png + map/liveries/E145_WST.png + map/liveries/E170.png + map/liveries/E170_AAL.png + map/liveries/E170_ACA.png + map/liveries/E170_AFR.png + map/liveries/E170_AHY.png + map/liveries/E170_ASA.png + map/liveries/E170_BEE.png + map/liveries/E170_BMA.png + map/liveries/E170_BRU.png + map/liveries/E170_CET.png + map/liveries/E170_CFE.png + map/liveries/E170_CYL.png + map/liveries/E170_DAL.png + map/liveries/E170_ELL.png + map/liveries/E170_ELL_ES-AEB.png + map/liveries/E170_FDA_01F.png + map/liveries/E170_FDA_03F.png + map/liveries/E170_FDA_04F.png + map/liveries/E170_FDA_06F.png + map/liveries/E170_FDA_07F.png + map/liveries/E170_FIN.png + map/liveries/E170_HOP.png + map/liveries/E170_JLJ.png + map/liveries/E170_LNK.png + map/liveries/E170_LOT.png + map/liveries/E170_LOT_LUBUSKIE.png + map/liveries/E170_LOT_RETROJET.png + map/liveries/E170_LOT_STARALLIANCE.png + map/liveries/E170_MSR.png + map/liveries/E170_NWA.png + map/liveries/E170_OAS.png + map/liveries/E170_PEV.png + map/liveries/E170_PMW.png + map/liveries/E170_PRR.png + map/liveries/E170_RJA.png + map/liveries/E170_RUS.png + map/liveries/E170_SBI.png + map/liveries/E170_SMX.png + map/liveries/E170_SVA.png + map/liveries/E170_UAL.png + map/liveries/E170_USA.png + map/liveries/E170_VOS.png + map/liveries/E170_WAT.png + map/liveries/E190.png + map/liveries/E190_ACA.png + map/liveries/E190_AFR.png + map/liveries/E190_AHO.png + map/liveries/E190_AHY.png + map/liveries/E190_AHY_BUTA_AIRWAYS.png + map/liveries/E190_AIZ.png + map/liveries/E190_AMX.png + map/liveries/E190_ARG.png + map/liveries/E190_ASL.png + map/liveries/E190_AUA.png + map/liveries/E190_AUI.png + map/liveries/E190_AXY.png + map/liveries/E190_AZU_UO.png + map/liveries/E190_BAV.png + map/liveries/E190_BFY.png + map/liveries/E190_BRU.png + map/liveries/E190_BVX.png + map/liveries/E190_CBG.png + map/liveries/E190_CET.png + map/liveries/E190_CFE.png + map/liveries/E190_CFE_G-LCYN.png + map/liveries/E190_CGZ.png + map/liveries/E190_CLH.png + map/liveries/E190_CMP.png + map/liveries/E190_CSN.png + map/liveries/E190_CYL.png + map/liveries/E190_CYL_EI-SKY.png + map/liveries/E190_DLA.png + map/liveries/E190_DLH.png + map/liveries/E190_EUS.png + map/liveries/E190_EZE.png + map/liveries/E190_FIN.png + map/liveries/E190_FWI.png + map/liveries/E190_GCR.png + map/liveries/E190_GER.png + map/liveries/E190_HBH.png + map/liveries/E190_HOP.png + map/liveries/E190_JAF.png + map/liveries/E190_JBU.png + map/liveries/E190_JBU_BARCODE.png + map/liveries/E190_JBU_BILLBOARD.png + map/liveries/E190_JBU_BLUEBERRY.png + map/liveries/E190_JLJ.png + map/liveries/E190_JTE.png + map/liveries/E190_KAR.png + map/liveries/E190_KLC.png + map/liveries/E190_KLM.png + map/liveries/E190_KLM_PH-NWC.png + map/liveries/E190_KLM_PH-SKY.png + map/liveries/E190_KQA.png + map/liveries/E190_LGL.png + map/liveries/E190_LNK.png + map/liveries/E190_LNK_OC.png + map/liveries/E190_LOT _GRZESKI.png + map/liveries/E190_LOT _SLIWKA.png + map/liveries/E190_LOT.png + map/liveries/E190_LOT_PODKARPACKIE.png + map/liveries/E190_LOT_VISITMORAVIA.png + map/liveries/E190_LOT_WARMIAMAZURY.png + map/liveries/E190_LZB.png + map/liveries/E190_MDA.png + map/liveries/E190_MLD.png + map/liveries/E190_MSC.png + map/liveries/E190_MXY.png + map/liveries/E190_OAW.png + map/liveries/E190_QLK.png + map/liveries/E190_RAM.png + map/liveries/E190_RPB.png + map/liveries/E190_SCO.png + map/liveries/E190_SHH.png + map/liveries/E190_SLI.png + map/liveries/E190_TAP.png + map/liveries/E190_UKV.png + map/liveries/E190_USA.png + map/liveries/E190_UTY.png + map/liveries/E190_VCV.png + map/liveries/E190_WAT.png + map/liveries/E190_WIF.png + map/liveries/E195_AEA.png + map/liveries/E195_AIZ.png + map/liveries/E195_AUR.png + map/liveries/E195_BEE.png + map/liveries/E195_BRU.png + map/liveries/E195_CLH.png + map/liveries/E195_DLA.png + map/liveries/E195_LOT.png + map/liveries/E195_MGX.png + map/liveries/E195_RJA.png + map/liveries/E195_SOV.png + map/liveries/E35L.png + map/liveries/E3D_UK4_ZH103.png + map/liveries/EC35_DE6_D-HBBZ.png + map/liveries/EC35_UK6_G-POLA.png + map/liveries/EUFI_UK4_ZK306.png + map/liveries/eurofighter.png + map/liveries/F100_AAL.png + map/liveries/F100_AFR.png + map/liveries/F100_AUA.png + map/liveries/F100_AVA.png + map/liveries/F100_BER.png + map/liveries/F100_BZH.png + map/liveries/F100_DNM.png + map/liveries/F100_KLM.png + map/liveries/F100_LAM.png + map/liveries/F100_OAW.png + map/liveries/F100_PGA.png + map/liveries/F100_TAM.png + map/liveries/F100_TDR.png + map/liveries/f15.png + map/liveries/F16C_BE4_101.png + map/liveries/F16C_US4_368.png + map/liveries/F16D_US4_926.png + map/liveries/F16D_US4_TB8.png + map/liveries/F18C_US1_183153.png + map/liveries/F18D_US1_BA7.png + map/liveries/F28_ARG.png + map/liveries/F28_GHS.png + map/liveries/F28_GIA.png + map/liveries/F28_IRC.png + map/liveries/F28_TAE.png + map/liveries/F28_VUN.png + map/liveries/f35.png + map/liveries/F50_AVA.png + map/liveries/F50_BCY.png + map/liveries/F50_BTI.png + map/liveries/F50_CRF.png + map/liveries/F50_FXI.png + map/liveries/F50_INC.png + map/liveries/F50_KLC.png + map/liveries/F50_KZR.png + map/liveries/F50_MAS.png + map/liveries/F50_MAV.png + map/liveries/F50_NAF.png + map/liveries/F50_SKX.png + map/liveries/F50_SYA.png + map/liveries/F50_VLM.png + map/liveries/F70_AUA.png + map/liveries/F70_KLM.png + map/liveries/F70_KLM_PH-NWC.png + map/liveries/F70_MAH.png + map/liveries/fire_truck.png + map/liveries/G115_UK4_G-BYUA.png + map/liveries/Generic_Medium.png + map/liveries/glider.png + map/liveries/H25B_N228TM.png + map/liveries/HAWK_SA4_1.png + map/liveries/HAWK_UK4_RA1.png + map/liveries/HAWK_UK4_XX204.png + map/liveries/helicopter.png + map/liveries/J328_AUR.png + map/liveries/J328_SUS.png + map/liveries/JS41_AAL.png + map/liveries/JS41_AWE.png + map/liveries/JS41_BRI.png + map/liveries/JS41_ESY.png + map/liveries/JS41_EZE.png + map/liveries/JS41_HKG.png + map/liveries/JS41_LAM.png + map/liveries/JS41_NYT.png + map/liveries/JS41_SAA.png + map/liveries/JS41_SEH.png + map/liveries/JS41_VNE.png + map/liveries/L410_BCV.png + map/liveries/L410_EST.png + map/liveries/L410_HAX.png + map/liveries/L410_KZN.png + map/liveries/L410_LAF.png + map/liveries/L410_LLI.png + map/liveries/L410_MNX.png + map/liveries/L410_NFA.png + map/liveries/L410_OAO.png + map/liveries/L410_PTK.png + map/liveries/L410_SLD.png + map/liveries/L410_VAA.png + map/liveries/LJ25.png + map/liveries/LJ45_B-3988.png + map/liveries/LJ45_HB-VMB.png + map/liveries/M339_AE4_AF1.png + map/liveries/MD11_CWC.png + map/liveries/MD11_FDX.png + map/liveries/MD11_GEC.png + map/liveries/MD11_MPH.png + map/liveries/MD11_UPS.png + map/liveries/MD11F.png + map/liveries/MD11F_AAL.png + map/liveries/MD11F_AFX.png + map/liveries/MD11F_AJC.png + map/liveries/MD11F_AZA.png + map/liveries/MD11F_CXA_VA.png + map/liveries/MD11F_DAL.png + map/liveries/MD11F_EAG.png + map/liveries/MD11F_FDX.png + map/liveries/MD11F_FIN.png + map/liveries/MD11F_GEC.png + map/liveries/MD11F_MPH.png + map/liveries/MD11F_MQC.png + map/liveries/MD11F_NFC.png + map/liveries/MD11F_NTL.png + map/liveries/MD11F_OAL_VA.png + map/liveries/MD11F_PLC.png + map/liveries/MD11F_SWR.png + map/liveries/MD11F_TKY.png + map/liveries/MD11F_UPS.png + map/liveries/MD11F_VSP.png + map/liveries/MD11F_WAT.png + map/liveries/MD11F_WGN.png + map/liveries/MD11F_XSN.png + map/liveries/MD83_AAL.png + map/liveries/MD83_ARG.png + map/liveries/MD83_AVA.png + map/liveries/MD83_AZA.png + map/liveries/MD83_BUC.png + map/liveries/MD83_DTR.png + map/liveries/MD83_IRA.png + map/liveries/MD83_SAS.png + map/liveries/MD83_VIK.png + map/liveries/MD83_white.png + map/liveries/MD90_DAL.png + map/liveries/MD90_EVA.png + map/liveries/MD90_JAL.png + map/liveries/MG29_BG4_15.png + map/liveries/MG29_RU4_S01.png + map/liveries/P28A.png + map/liveries/PC9_AU4_R01.png + map/liveries/PC9_BAE_ZG969.png + map/liveries/PC9_BAE_ZK119.png + map/liveries/S76_CA9_C-GHJX.png + map/liveries/S76_SE5_SE-JOJ.png + map/liveries/S76_UK4_G-XXEA.png + map/liveries/S76_US9_N362AL.png + map/liveries/SB20_BLF.png + map/liveries/SB20_BRX.png + map/liveries/SB20_CFE.png + map/liveries/SB20_DWT.png + map/liveries/SB20_ETI.png + map/liveries/SB20_EZE.png + map/liveries/SB20_KRP.png + map/liveries/SB20_LIL.png + map/liveries/SB20_LOG.png + map/liveries/SB20_MDV.png + map/liveries/SB20_OLT.png + map/liveries/SB20_POT.png + map/liveries/SB20_SCW.png + map/liveries/SF34.png + map/liveries/SF34_AFR.png + map/liveries/SF34_ATK.png + map/liveries/SF34_CAY.png + map/liveries/SF34_CJC.png + map/liveries/SF34_CVA.png + map/liveries/SF34_DNU.png + map/liveries/SF34_EGF.png + map/liveries/SF34_ELL.png + map/liveries/SF34_EZA.png + map/liveries/SF34_IGA.png + map/liveries/SF34_JAC.png + map/liveries/SF34_JBR.png + map/liveries/SF34_LGA.png + map/liveries/SF34_LOG.png + map/liveries/SF34_MES.png + map/liveries/SF34_MTL.png + map/liveries/SF34_NTJ.png + map/liveries/SF34_OLT.png + map/liveries/SF34_PCO.png + map/liveries/SF34_PCO_WESTJET_LINK.png + map/liveries/SF34_POT.png + map/liveries/SF34_PSC.png + map/liveries/SF34_RHA.png + map/liveries/SF34_RXA.png + map/liveries/SF34_SBM.png + map/liveries/SF34_SGN.png + map/liveries/SF34_SIL.png + map/liveries/SF34_SLI.png + map/liveries/SF34_SRN.png + map/liveries/SF34_UAL.png + map/liveries/SF34_USA.png + map/liveries/SF34_WAT.png + map/liveries/SF34_WEW.png + map/liveries/SF34_WST.png + map/liveries/SF34F.png + map/liveries/SF34F_CSQ.png + map/liveries/SF34F_MTL.png + map/liveries/spitfire.png + map/liveries/SU27_RU4_K01.png + map/liveries/SU95.png + map/liveries/SU95_AFL.png + map/liveries/SU95_AZO.png + map/liveries/SU95_GZP.png + map/liveries/SU95_IAE.png + map/liveries/SU95_LLM.png + map/liveries/SU95_RWZ.png + map/liveries/SU95_SDM.png + map/liveries/SU95_SYL_BLUE.png + map/liveries/SU95_WAT.png + map/liveries/TOR_DE2_45+31.png + map/liveries/TOR_UK4_ZG777.png + map/liveries/truck.png + map/liveries/TUCA_UK4_ZF135.png + map/liveries/ultralight.png + + diff --git a/plugins/channelrx/demodadsb/adsbdemodnotificationdialog.cpp b/plugins/channelrx/demodadsb/adsbdemodnotificationdialog.cpp index 7861069f3..7873564e7 100644 --- a/plugins/channelrx/demodadsb/adsbdemodnotificationdialog.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodnotificationdialog.cpp @@ -21,6 +21,7 @@ #include #include "adsbdemodnotificationdialog.h" +#include "gui/fastitemdelegate.h" // Map main ADS-B table column numbers to combo box indices std::vector ADSBDemodNotificationDialog::m_columnMap = { @@ -39,6 +40,8 @@ ADSBDemodNotificationDialog::ADSBDemodNotificationDialog(ADSBDemodSettings *sett { ui->setupUi(this); + ui->table->setItemDelegate(new FastItemDelegate(ui->table)); + resizeTable(); for (int i = 0; i < m_settings->m_notificationSettings.size(); i++) { diff --git a/plugins/channelrx/demodadsb/adsbdemodsettings.cpp b/plugins/channelrx/demodadsb/adsbdemodsettings.cpp index 695bfa1ef..18e83f429 100644 --- a/plugins/channelrx/demodadsb/adsbdemodsettings.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodsettings.cpp @@ -23,6 +23,8 @@ #include "util/simpleserializer.h" #include "settings/serializable.h" +#include "util/flightpathpalette.h" + #include "adsbdemodsettings.h" ADSBDemodSettings::ADSBDemodSettings() : @@ -81,6 +83,7 @@ void ADSBDemodSettings::resetToDefaults() m_aviationstackAPIKey = ""; m_checkWXAPIKey = ""; m_maptilerAPIKey = ""; + m_cartoDBAPIKey = ""; for (int i = 0; i < ADSBDEMOD_COLUMNS; i++) { m_columnIndexes[i] = i; @@ -117,6 +120,7 @@ void ADSBDemodSettings::resetToDefaults() m_flightPathPaletteName = "Spectral"; applyPalette(); m_favourLivery = true; + m_useLiveryIcons = true; } QByteArray ADSBDemodSettings::serialize() const @@ -214,6 +218,8 @@ QByteArray ADSBDemodSettings::serialize() const s.writeBool(77, m_favourLivery); s.writeString(78, m_maptilerAPIKey); + s.writeString(80, m_cartoDBAPIKey); + s.writeBool(79, m_useLiveryIcons); for (int i = 0; i < ADSBDEMOD_COLUMNS; i++) { s.writeS32(100 + i, m_columnIndexes[i]); @@ -361,6 +367,8 @@ bool ADSBDemodSettings::deserialize(const QByteArray& data) d.readBool(77, &m_favourLivery, true); d.readString(78, &m_maptilerAPIKey, ""); + d.readString(80, &m_cartoDBAPIKey, ""); + d.readBool(79, &m_useLiveryIcons, true); applyPalette(); @@ -591,6 +599,9 @@ void ADSBDemodSettings::applySettings(const QStringList& settingsKeys, const ADS if (settingsKeys.contains("maptilerAPIKey")) { m_maptilerAPIKey = settings.m_maptilerAPIKey; } + if (settingsKeys.contains("cartoDBAPIKey")) { + m_cartoDBAPIKey = settings.m_cartoDBAPIKey; + } if (settingsKeys.contains("logFilename")) { m_logFilename = settings.m_logFilename; } @@ -656,6 +667,9 @@ void ADSBDemodSettings::applySettings(const QStringList& settingsKeys, const ADS if (settingsKeys.contains("favourLivery")) { m_favourLivery = settings.m_favourLivery; } + if (settingsKeys.contains("useLiveryIcons")) { + m_useLiveryIcons = settings.m_useLiveryIcons; + } } QString ADSBDemodSettings::getDebugString(const QStringList& settingsKeys, bool force) const @@ -797,6 +811,9 @@ QString ADSBDemodSettings::getDebugString(const QStringList& settingsKeys, bool if (settingsKeys.contains("maptilerAPIKey") || force) { ostr << " m_maptilerAPIKey: " << m_maptilerAPIKey.toStdString(); } + if (settingsKeys.contains("cartoDBAPIKey") || force) { + ostr << " m_cartoDBAPIKey: " << m_cartoDBAPIKey.toStdString(); + } if (settingsKeys.contains("logFilename") || force) { ostr << " m_logFilename: " << m_logFilename.toStdString(); } @@ -860,90 +877,14 @@ QString ADSBDemodSettings::getDebugString(const QStringList& settingsKeys, bool if (settingsKeys.contains("favourLivery") || force) { ostr << " m_favourLivery: " << m_favourLivery; } + if (settingsKeys.contains("useLiveryIcons") || force) { + ostr << " m_useLiveryIcons: " << m_useLiveryIcons; + } return QString(ostr.str().c_str()); } void ADSBDemodSettings::applyPalette() { - if (m_palettes.contains(m_flightPathPaletteName)) { - m_flightPathPalette = m_palettes.value(m_flightPathPaletteName); - } else { - m_flightPathPalette = m_rainbowPalette; - } + m_flightPathPalette = FlightPathPalette::getPalette(m_flightPathPaletteName); } - -const QVariant ADSBDemodSettings::m_rainbowPalette[8] = { - QVariant(QColor(0xff, 0x00, 0x00)), - QVariant(QColor(0xff, 0x7f, 0x00)), - QVariant(QColor(0xff, 0xff, 0x00)), - QVariant(QColor(0xf7, 0xff, 0x00)), - QVariant(QColor(0x00, 0xff, 0x00)), - QVariant(QColor(0x00, 0xff, 0x7f)), - QVariant(QColor(0x00, 0xff, 0xff)), - QVariant(QColor(0x00, 0x7f, 0xff)), -}; - -const QVariant ADSBDemodSettings::m_pastelPalette[8] = { - QVariant(QColor(0xff, 0xad, 0xad)), - QVariant(QColor(0xff, 0xd6, 0xa5)), - QVariant(QColor(0xfd, 0xff, 0xb6)), - QVariant(QColor(0xca, 0xff, 0xbf)), - QVariant(QColor(0x9b, 0xf6, 0xff)), - QVariant(QColor(0xa0, 0xc4, 0xff)), - QVariant(QColor(0xbd, 0xb2, 0xff)), - QVariant(QColor(0xff, 0xc6, 0xff)), -}; - -const QVariant ADSBDemodSettings::m_spectralPalette[8] = { - QVariant(QColor(0xd5, 0x3e, 0x4f)), - QVariant(QColor(0xf4, 0x6d, 0x43)), - QVariant(QColor(0xfd, 0xae, 0x61)), - QVariant(QColor(0xfe, 0xe0, 0x8b)), - QVariant(QColor(0xe6, 0xf5, 0x98)), - QVariant(QColor(0xab, 0xdd, 0xa4)), - QVariant(QColor(0x66, 0xc2, 0xa5)), - QVariant(QColor(0x32, 0x88, 0xbd)), -}; - -const QVariant ADSBDemodSettings::m_bluePalette[8] = { - QVariant(QColor(0xde, 0xeb, 0xf7)), - QVariant(QColor(0xc6, 0xdb, 0xef)), - QVariant(QColor(0x9e, 0xca, 0xe1)), - QVariant(QColor(0x6b, 0xae, 0xd6)), - QVariant(QColor(0x42, 0x92, 0xc6)), - QVariant(QColor(0x21, 0x71, 0xb5)), - QVariant(QColor(0x08, 0x51, 0x9c)), - QVariant(QColor(0x08, 0x30, 0x6b)), -}; - -const QVariant ADSBDemodSettings::m_purplePalette[8] = { - QVariant(QColor(0xcc, 0xaf, 0xf2)), - QVariant(QColor(0xb6, 0x99, 0xe0)), - QVariant(QColor(0xa0, 0x84, 0xcf)), - QVariant(QColor(0x8a, 0x6f, 0xbd)), - QVariant(QColor(0x76, 0x5a, 0xac)), - QVariant(QColor(0x62, 0x45, 0x9a)), - QVariant(QColor(0x4f, 0x30, 0x89)), - QVariant(QColor(0x3e, 0x18, 0x78)), -}; - -const QVariant ADSBDemodSettings::m_greyPalette[8] = { - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), - QVariant(QColor(0x80, 0x80, 0x80)), -}; - -const QHash ADSBDemodSettings::m_palettes = { - {"Rainbow", &ADSBDemodSettings::m_rainbowPalette[0]}, - {"Pastel", &ADSBDemodSettings::m_pastelPalette[0]}, - {"Spectral", &ADSBDemodSettings::m_spectralPalette[0]}, - {"Blues", &ADSBDemodSettings::m_bluePalette[0]}, - {"Purples", &ADSBDemodSettings::m_purplePalette[0]}, - {"Grey", &ADSBDemodSettings::m_greyPalette[0]}, -}; diff --git a/plugins/channelrx/demodadsb/adsbdemodsettings.h b/plugins/channelrx/demodadsb/adsbdemodsettings.h index acdfa38bc..4636ebcfa 100644 --- a/plugins/channelrx/demodadsb/adsbdemodsettings.h +++ b/plugins/channelrx/demodadsb/adsbdemodsettings.h @@ -197,6 +197,7 @@ struct ADSBDemodSettings QString m_aviationstackAPIKey; //!< aviationstack.com API key QString m_checkWXAPIKey; //!< checkwxapi.com API key QString m_maptilerAPIKey; //!< maptiler.com API key (for osm/satellite map) + QString m_cartoDBAPIKey; //!< carto.com API key (for the aviation maps, which use CartoDB tiles without labels) QString m_logFilename; bool m_logEnabled; @@ -229,6 +230,7 @@ struct ADSBDemodSettings bool m_displayIC[ADSB_IC_MAX]; QString m_flightPathPaletteName; bool m_favourLivery; //!< Favour airline livery over aircraft type when exact 3D model isn't available + bool m_useLiveryIcons; //!< Use aircraft icons with airline liveries on 2D map, instead of black icons const QVariant *m_flightPathPalette; @@ -244,14 +246,6 @@ struct ADSBDemodSettings QString getDebugString(const QStringList& settingsKeys, bool force = false) const; void applyPalette(); - static const QVariant m_rainbowPalette[8]; - static const QVariant m_pastelPalette[8]; - static const QVariant m_spectralPalette[8]; - static const QVariant m_bluePalette[8]; - static const QVariant m_purplePalette[8]; - static const QVariant m_greyPalette[8]; - - static const QHash m_palettes; }; #endif /* PLUGINS_CHANNELRX_DEMODADSB_ADSBDEMODSETTINGS_H_ */ diff --git a/plugins/channelrx/demodadsb/adsbdemodsinkworker.cpp b/plugins/channelrx/demodadsb/adsbdemodsinkworker.cpp index 78f573b6d..b2fbb7d25 100644 --- a/plugins/channelrx/demodadsb/adsbdemodsinkworker.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodsinkworker.cpp @@ -261,18 +261,8 @@ bool ADSBDemodSinkWorker::icaoHeardRecently(unsigned icao, const QDateTime &date void ADSBDemodSinkWorker::forwardFrame(const unsigned char *data, int size, float preambleCorrelation, float correlationOnes, const QDateTime& dateTime, unsigned crc) { - // Pass to GUI - if (m_sink->getMessageQueueToGUI()) - { - ADSBDemodReport::MsgReportADSB *msg = ADSBDemodReport::MsgReportADSB::create( - QByteArray((char*)data, size), - preambleCorrelation, - correlationOnes, - dateTime, - crc); - m_sink->getMessageQueueToGUI()->push(msg); - } - // Pass to worker to feed to other servers + // Pass to the tracker, which decodes the frame, and passes it on to be exported + // to other servers and to the GUI if (m_sink->getMessageQueueToWorker()) { ADSBDemodReport::MsgReportADSB *msg = ADSBDemodReport::MsgReportADSB::create( diff --git a/plugins/channelrx/demodadsb/adsbdemodtracker.cpp b/plugins/channelrx/demodadsb/adsbdemodtracker.cpp new file mode 100644 index 000000000..9b7b292d3 --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbdemodtracker.cpp @@ -0,0 +1,387 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "dsp/dspcommands.h" +#include "maincore.h" + +#include "util/osndb.h" + +#include "adsbdemod.h" +#include "adsbdemodreport.h" +#include "adsbdemodtracker.h" +#include "adsbdemodworker.h" + +MESSAGE_CLASS_DEFINITION(ADSBDemodTracker::MsgConfigureADSBDemodTracker, Message) + +ADSBDemodTracker::ADSBDemodTracker(ADSBDemod *adsbDemod) : + m_adsbDemod(adsbDemod), + m_exportWorker(nullptr), + m_messageQueueToGUI(nullptr), + m_centerFrequency(0), + m_deviceCenterFrequency(0), + m_basebandSampleRate(0), + m_flushTimer(nullptr), + m_tickTimer(nullptr), + m_importNetworkManager(nullptr), + m_importTimer(nullptr), + m_flightInformation(nullptr), + m_importRequestGeneration(0), + m_importAuthenticationRetry(false), + m_statsChanged(false), + m_trackAircraft(nullptr), + m_qnhReported(0), + m_rangeFails(0), + m_altFails(0), + m_adsbFrameRateCount(0), + m_modesFrameRateCount(0), + m_totalBytes(0), + m_maxRangeStat(0.0f), + m_maxAltitudeStat(0.0f), + m_maxRateState(0.0f), + m_loadingData(false) +{ + qRegisterMetaType("ADSBAircraftUpdate"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QHash"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QVector"); + + for (int i = 0; i < 32; i++) + { + m_dfStats[i] = 0; + m_tcStats[i] = 0; + } + m_frameRateTime = QDateTime::currentDateTime(); + m_statsTime = m_frameRateTime; + + initCoverageMap(); +} + +ADSBDemodTracker::~ADSBDemodTracker() +{ + // Anything still on the map belongs to aircraft that are about to go + for (ADSBAircraft *aircraft : m_aircraft) { + clearFromMap(aircraft->m_icaoHex); + } + delete m_flushTimer; + delete m_tickTimer; + delete m_importTimer; + delete m_importNetworkManager; + delete m_flightInformation; + for (auto animations : m_pendingMapUpdates) + { + if (animations) + { + qDeleteAll(*animations); + delete animations; + } + } + m_pendingMapUpdates.clear(); + qDeleteAll(m_aircraft); + m_aircraft.clear(); + m_inputMessageQueue.clear(); +} + +QString ADSBDemodTracker::getDataDir() +{ + // Where the aircraft and airport databases and the 3D models live + QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); + return locations[0]; +} + +void ADSBDemodTracker::startWork() +{ + // Build the shared 3D model tables now rather than letting the first aircraft report + // pay for it. Cheap when another plugin has already done it. + Aircraft3DModels::instance(); + + // Created here so they belong to the thread that will use them + m_flushTimer = new QTimer(); + m_tickTimer = new QTimer(); + m_importTimer = new QTimer(); + m_importNetworkManager = new QNetworkAccessManager(); + connect(m_importTimer, &QTimer::timeout, this, &ADSBDemodTracker::import); + connect(m_importNetworkManager, &QNetworkAccessManager::finished, + this, &ADSBDemodTracker::handleImportNetworkReply); + connect(m_flushTimer, &QTimer::timeout, this, &ADSBDemodTracker::flush); + connect(m_tickTimer, &QTimer::timeout, this, &ADSBDemodTracker::tick); + // Four times a second is well above the rate at which aircraft move on screen, + // and far below the rate at which frames arrive + m_flushTimer->start(250); + m_tickTimer->start(1000); + + applyImportSettings(); + initFlightInformation(); + + connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &ADSBDemodTracker::handleInputMessages); + // Settings and frames can arrive before the thread has started running + handleInputMessages(); +} + +// Send everything that has changed since the last time to the GUI +void ADSBDemodTracker::flush() +{ + if (!m_removedAircraft.isEmpty()) + { + emit aircraftRemoved(m_removedAircraft); + m_removedAircraft.clear(); + } + + if (!m_dirtyAircraft.isEmpty()) + { + QList updates; + updates.reserve(m_dirtyAircraft.size()); + + for (ADSBAircraft *aircraft : m_dirtyAircraft) + { + ADSBAircraftUpdate update; + update.m_state = *aircraft; + update.m_isNew = aircraft->m_isNew; + updates.append(update); + + // The copy carries the flags; ours start again + aircraft->clearDirtyCells(); + aircraft->m_isNew = false; + aircraft->m_positionChanged = false; + aircraft->m_trailCleared = false; + aircraft->m_positionUpdates.clear(); + } + m_dirtyAircraft.clear(); + emit aircraftUpdated(updates); + } + + if (!m_pendingMapUpdates.isEmpty()) + { + for (auto it = m_pendingMapUpdates.cbegin(); it != m_pendingMapUpdates.cend(); ++it) { + sendToMap(it.key(), it.value()); + } + m_pendingMapUpdates.clear(); + } + + if (m_statsChanged) + { + emit statsUpdated(m_stats); + m_statsChanged = false; + } +} + +void ADSBDemodTracker::setStat(int row, const QVariant& value) +{ + if (m_stats.value(row) != value) + { + m_stats[row] = value; + m_statsChanged = true; + } +} + +// Once a second: age out aircraft we have stopped hearing, work out frame rates and +// report the current picture for the web API +void ADSBDemodTracker::tick() +{ + QDateTime now = QDateTime::currentDateTime(); + qint64 nowSecs = now.toSecsSinceEpoch(); + + QHash::iterator i = m_aircraft.begin(); + while (i != m_aircraft.end()) + { + ADSBAircraft *aircraft = i.value(); + + if (nowSecs - aircraft->m_updateTime.toSecsSinceEpoch() >= m_settings.m_removeTimeout) { + removeAircraft(i, aircraft); + } else { + // A resolution advisory is re-broadcast every second or so while it is + // active, so one that stops arriving is over - and the clear-of-conflict + // indication only lingers briefly after it was raised. Queued to the map + // on the transition: no frame will arrive to carry the change otherwise + if ( (aircraft->m_raActive || aircraft->m_raTerminated) + && aircraft->m_raDateTime.isValid() + && (aircraft->m_raDateTime.secsTo(now) >= 10)) + { + aircraft->m_raActive = false; + aircraft->m_raTerminated = false; + aircraft->m_tcasAlert = false; + queueMapUpdate(aircraft, nullptr); + } + ++i; + } + } + + sendAircraftReport(); + + qint64 ms = m_frameRateTime.msecsTo(now); + if (ms > 0) + { + double s = ms / 1000.0; + double adsbRate = m_adsbFrameRateCount / s; + double modesRate = m_modesFrameRateCount / s; + double totalRate = adsbRate + modesRate; + + setStat(ADSB_RATE, adsbRate); + setStat(MODE_S_RATE, modesRate); + setStat(TOTAL_RATE, totalRate); + if (totalRate > m_maxRateState) + { + m_maxRateState = (float) totalRate; + setStat(MAX_RATE, m_maxRateState); + } + setStat(DATA_RATE, (m_totalBytes * 8 / 1000) / s); + + m_frameRateTime = now; + m_adsbFrameRateCount = 0; + m_modesFrameRateCount = 0; + m_totalBytes = 0; + + emit rates(adsbRate, modesRate, countActiveAircraft()); + } +} + +// The databases are loaded by the GUI and shared read-only +void ADSBDemodTracker::reloadDatabases() +{ + m_aircraftInfo = OsnDB::getAircraftInformation(); + m_routeInfo = OsnDB::getAircraftRouteInformation(); + qDebug() << "ADSBDemodTracker::reloadDatabases:" << (m_aircraftInfo ? m_aircraftInfo->size() : 0) << "aircraft"; + + // Aircraft already being tracked may now have details, so look them up again + for (ADSBAircraft *aircraft : m_aircraft) + { + if (m_aircraftInfo->contains(aircraft->m_icao)) + { + aircraft->m_aircraftInfo = m_aircraftInfo->value(aircraft->m_icao); + markDirty(aircraft); + } + } +} + +void ADSBDemodTracker::requestFlightInformation(const QString& flight) +{ + if (m_flightInformation) { + m_flightInformation->getFlightInformation(flight); + } else { + qDebug() << "ADSBDemodTracker::requestFlightInformation: no flight information service - is the API key set?"; + } +} + +void ADSBDemodTracker::setPosition(float latitude, float longitude, float altitude) +{ + const bool moved = (m_azEl.getLocationSpherical().m_latitude != latitude) + || (m_azEl.getLocationSpherical().m_longitude != longitude); + + m_azEl.setLocation(latitude, longitude, altitude); + + if (moved) + { + // The coverage outline is centred on the station, so start it again from here + initCoverageMap(); + for (int i = 0; i < 2; i++) { + emit coverageUpdated(i, m_coverageAirspace[i].m_polygon); + } + } +} + +void ADSBDemodTracker::setTrackAircraft(quint32 icao) +{ + m_trackAircraft = m_aircraft.value((int) icao, nullptr); +} + +void ADSBDemodTracker::deleteAllAircraft() +{ + qDebug() << "ADSBDemodTracker::deleteAllAircraft:" << m_aircraft.size() << "aircraft"; + + QHash::iterator i = m_aircraft.begin(); + + while (i != m_aircraft.end()) + { + ADSBAircraft *aircraft = i.value(); + removeAircraft(i, aircraft); + } + // Tell the GUI now rather than waiting for the next flush + flush(); +} + +void ADSBDemodTracker::handleInputMessages() +{ + Message* message; + + while ((message = m_inputMessageQueue.pop()) != nullptr) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +bool ADSBDemodTracker::handleMessage(const Message& message) +{ + if (MsgConfigureADSBDemodTracker::match(message)) + { + MsgConfigureADSBDemodTracker& cfg = (MsgConfigureADSBDemodTracker&) message; + + applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce()); + return true; + } + else if (ADSBDemodReport::MsgReportADSB::match(message)) + { + ADSBDemodReport::MsgReportADSB& report = (ADSBDemodReport::MsgReportADSB&) message; + + // Beast export and .csv logging + if (m_exportWorker) { + m_exportWorker->getInputMessageQueue()->push(new ADSBDemodReport::MsgReportADSB(report)); + } + handleADSB(report.getData(), report.getDateTime(), report.getPreambleCorrelation(), + report.getCorrelationOnes(), report.getCRC(), true); + return true; + } + else if (DSPSignalNotification::match(message)) + { + DSPSignalNotification& notif = (DSPSignalNotification&) message; + + m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); + m_deviceCenterFrequency = notif.getCenterFrequency(); + return true; + } + else + { + return false; + } +} + +void ADSBDemodTracker::applySettings(const ADSBDemodSettings& settings, const QStringList& settingsKeys, bool force) +{ + const bool wasManualQNH = m_settings.m_manualQNH; + + if (force) { + m_settings = settings; + } else { + m_settings.applySettings(settingsKeys, settings); + } + + // Coming off manual QNH, the spin box holds whatever was typed, so the next estimate + // has to be reported even if it is within the hysteresis of the last one we sent + if (wasManualQNH && !m_settings.m_manualQNH) { + m_qnhReported = 0; + } + + if (m_importTimer) { + applyImportSettings(); + } +} diff --git a/plugins/channelrx/demodadsb/adsbdemodtracker.h b/plugins/channelrx/demodadsb/adsbdemodtracker.h new file mode 100644 index 000000000..0a5597f87 --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbdemodtracker.h @@ -0,0 +1,374 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ADSBDEMODTRACKER_H +#define INCLUDE_ADSBDEMODTRACKER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util/message.h" +#include "util/messagequeue.h" +#include "util/azel.h" +#include "util/movingaverage.h" +#include "util/openaip.h" +#include "util/osndb.h" +#include "util/aircraft3dmodels.h" +#include "util/ourairportsdb.h" + +#include "util/flightinformation.h" + +#include "adsbaircraft.h" +#include "adsbdemodsettings.h" + +namespace SWGSDRangel { + class SWGMapAnimation; +} + +class ADSBDemod; +class ADSBDemodWorker; +class QNetworkAccessManager; +class QNetworkReply; + +// Rows of the statistics table, which the tracker fills in and the GUI displays +enum StatsRow { + ADSB_FRAMES, + MODE_S_FRAMES, + TOTAL_FRAMES, + ADSB_RATE, + MODE_S_RATE, + TOTAL_RATE, + DATA_RATE, + CORRELATOR_MATCHES, + PERCENT_VALID, + PREAMBLE_FAILS, + CRC_FAILS, + TYPE_FAILS, + INVALID_FAILS, + ICAO_FAILS, + RANGE_FAILS, + ALT_FAILS, + AVERAGE_CORRELATION, + TC_0, + TC_1_4, + TC_5_8, + TC_9_18, + TC_19, + TC_20_22, + TC_24, + TC_28, + TC_29, + TC_31, + TC_UNUSED, + DF0, + DF4, + DF5, + DF11, + DF16, + DF17, + DF18, + DF19, + DF20_21, + DF22, + DF24, + MAX_RANGE, + MAX_ALTITUDE, + MAX_RATE +}; + +// One aircraft's decoded state, on its way to the GUI. The state carries its own +// record of which table cells changed, so the GUI repaints only those +struct ADSBAircraftUpdate { + ADSBAircraft m_state; + bool m_isNew = false; +}; + +Q_DECLARE_METATYPE(ADSBAircraftUpdate) + +// Decodes ADS-B and Mode-S frames and tracks the aircraft they come from. +// +// This runs on the channel's worker thread rather than in the GUI, so that a busy +// sky doesn't compete with drawing the user interface, and so that the channel still +// decodes, reports and feeds aggregators when SDRangel is run headless as a server. +// +// Frames arrive here directly from the demodulator; those that are to be exported in +// Beast format or logged are passed on to ADSBDemodWorker, which shares this thread. +class ADSBDemodTracker : public QObject { + Q_OBJECT + +public: + class MsgConfigureADSBDemodTracker : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const ADSBDemodSettings& getSettings() const { return m_settings; } + const QStringList& getSettingsKeys() const { return m_settingsKeys; } + bool getForce() const { return m_force; } + + static MsgConfigureADSBDemodTracker* create(const ADSBDemodSettings& settings, const QStringList& settingsKeys, bool force) + { + return new MsgConfigureADSBDemodTracker(settings, settingsKeys, force); + } + + private: + ADSBDemodSettings m_settings; + QStringList m_settingsKeys; + bool m_force; + + MsgConfigureADSBDemodTracker(const ADSBDemodSettings& settings, const QStringList& settingsKeys, bool force) : + Message(), + m_settings(settings), + m_settingsKeys(settingsKeys), + m_force(force) + { } + }; + + explicit ADSBDemodTracker(ADSBDemod *adsbDemod); + ~ADSBDemodTracker(); + + MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } + + // The worker that exports frames in Beast format and writes the .csv log. It + // shares this thread, so frames can be handed to it directly + void setExportWorker(ADSBDemodWorker *worker) { m_exportWorker = worker; } + void setMessageQueueToGUI(MessageQueue *queue) { m_messageQueueToGUI = queue; } + + static QString getDataDir(); + +public slots: + // Called from the GUI thread, so these are invoked through the event loop + void setPosition(float latitude, float longitude, float altitude); + void setTrackAircraft(quint32 icao); + void setLoadingData(bool loading) + { + if (loading && !m_loadingData) { + m_replayAircraftReported.clear(); + } + m_loadingData = loading; + } + void deleteAllAircraft(); + void clearCoverage(); + void resetStats(); + void reloadDatabases(); + void requestFlightInformation(const QString& flight); + +public: + +signals: + // Everything that changed since the last flush, about four times a second + void aircraftUpdated(const QList& updates); + void aircraftRemoved(const QList& icaos); + void statsUpdated(const QHash& stats); + void coverageUpdated(int band, const QVector& polygon); + void qnhEstimate(int qnh); + // For the frames-per-second chart + void rates(double adsbRate, double modesRate, int activeAircraft); + // The GUI owns the voice, the selection and the photo panel + void speechRequest(const QString& speech); + void highlightRequest(quint32 icao); + void targetRequest(quint32 icao); + void photoRefresh(quint32 icao); + +public slots: + // Called when the worker thread starts. Anything with thread affinity - timers, + // sockets, network access - must be created here rather than in the constructor + void startWork(); + +private slots: + void handleInputMessages(); + void flightInformationUpdated(const FlightInformation::Flight& flight); + // Sends everything that changed to the GUI in one go + void flush(); + // Ages out aircraft that have not been heard from, and reports to the web API + void tick(); + +private: + ADSBDemod *m_adsbDemod; + ADSBDemodWorker *m_exportWorker; + MessageQueue *m_messageQueueToGUI; + MessageQueue m_inputMessageQueue; + ADSBDemodSettings m_settings; + + qint64 m_centerFrequency; + qint64 m_deviceCenterFrequency; + int m_basebandSampleRate; + + QTimer *m_flushTimer; + QTimer *m_tickTimer; + QSet m_dirtyAircraft; + // Aircraft waiting to be sent to the Map, with any animations that have built up for + // them. We hear several frames a second per aircraft but only its position moves, so + // sending on every one just makes the Map redraw the same thing repeatedly + QHash *> m_pendingMapUpdates; + QList m_removedAircraft; + QHash m_stats; + bool m_statsChanged; + QDateTime m_statsTime; + + void get3DModel(ADSBAircraft *aircraft); + void get3DModelBasedOnCategory(ADSBAircraft *aircraft); + QHash m_aircraft; // Hashed on ICAO + QSharedPointer> m_aircraftInfo; + QSharedPointer> m_routeInfo; // Hashed on callsign + AzEl m_azEl; // Position of station + ADSBAircraft *m_trackAircraft; // Aircraft we want to track in Channel Report + MovingAverageUtil m_correlationAvg; + MovingAverageUtil m_correlationOnesAvg; + MovingAverageUtil m_qnhAvg; + //!< The QNH last reported to the GUI, and 0 when none has been. Rounding a moving + //!< average flickers across the boundary between two whole hectopascals, and every + //!< flicker used to run a settings update through the GUI, the channel, the + //!< baseband, the sink, the worker and back into this tracker - so only a change + //!< that has moved clear of the last reported value is sent. + int m_qnhReported; + static const int m_maxRangeDeg = 5; + QList m_maxRange[2]; + Airspace m_coverageAirspace[2]; + qint64 m_rangeFails; + qint64 m_altFails; + QDateTime m_frameRateTime; + qint64 m_adsbFrameRateCount; + qint64 m_modesFrameRateCount; + qint64 m_totalBytes; + float m_maxRangeStat; + float m_maxAltitudeStat; + float m_maxRateState; + qint64 m_dfStats[32]; + qint64 m_tcStats[32]; + QRandomGenerator m_random; + // The model tables live in sdrbase now, shared with the Aircraft feature - see + // Aircraft3DModels. Only the emitter category fallback below is still ours, because + // no other protocol transmits a category. + bool m_loadingData; + // Aircraft for which this CSV replay has already emitted its downstream track + // boundary (an Aircraft report marker or a direct Map item reset). Cleared at the + // start of every file, and deliberately independent of m_aircraft: the demodulator + // can retain live state while a replay starts a new downstream track. + QSet m_replayAircraftReported; + static const char m_idMap[]; + static const QString m_categorySetA[]; + static const QString m_categorySetB[]; + static const QString m_categorySetC[]; + static const QString m_emergencyStatus[]; + static const QString m_flightStatuses[]; + static const QString m_hazardSeverity[]; + static const QString m_fomSources[]; + static const QString m_nacvStrings[]; + void clearFromMap(const QString& name); + void sendToMap(ADSBAircraft *aircraft, + QList *animations, + const QDateTime& aircraftStateDateTime = QDateTime()); + static QList *copyAnimations(QList *animations); + void queueMapUpdate(ADSBAircraft *aircraft, QList *animations); + void discardMapUpdate(ADSBAircraft *aircraft); + ADSBAircraft *getAircraft(int icao, bool &newAircraft); + void atcCallsign(ADSBAircraft *aircraft); + void callsignToFlight(ADSBAircraft *aircraft); + bool calcAirTemp(ADSBAircraft *aircraft); + void handleADSB( + const QByteArray data, + const QDateTime dateTime, + float correlation, + float correlationOnes, + unsigned crc, + bool updateModel); + void decodeID(const QByteArray& data, QString& emitterCategory, QString& callsign); + bool decodeGroundspeed(const QByteArray& data, float& v, float& h); + bool decodeAirspeed(const QByteArray& data, bool& tas, int& as, bool& hdgValid, float& hdg); + bool decodeVerticalRate(const QByteArray& data, int& verticalRate); + void updateAircraftPosition(ADSBAircraft *aircraft, double latitude, double longitude, const QDateTime& dateTime); + bool validateGlobalPosition(double latitude, double longitude, bool countFailure); + bool validateLocalPosition(double latitude, double longitude, bool surfacePosition, bool countFailure); + bool decodeGlobalPosition(int f, const double cprLat[2], const double cprLong[2], const QDateTime cprTime[2], double& latitude, double& longitude, bool countFailure); + bool decodeLocalPosition(int f, double cprLat, double cprLong, bool onSurface, const QDateTime& dateTime, const ADSBAircraft *aircraft, double& latitude, double& longitude, bool countFailure); + void decodeCpr(const QByteArray& data, int& f, double& latCpr, double& lonCpr) const; + bool decodeAltitude(const QByteArray& data, int& altFt) const; + void decodeModeSAltitude(const QByteArray& data, const QDateTime dateTime, ADSBAircraft *aircraft); + void decodeModeS(const QByteArray data, const QDateTime dateTime, int df, ADSBAircraft *aircraft); + void decodeCommB(const QByteArray data, const QDateTime dateTime, int df, ADSBAircraft *aircraft, bool &updatedCallsign); + void decodeRABroadcast(const QByteArray data, const QDateTime dateTime, ADSBAircraft *aircraft); + QList *animate(QDateTime dateTime, ADSBAircraft *aircraft); + SWGSDRangel::SWGMapAnimation *gearAnimation(QDateTime startDateTime, bool up); + SWGSDRangel::SWGMapAnimation *gearAngle(QDateTime startDateTime, bool flat); + SWGSDRangel::SWGMapAnimation *flapsAnimation(QDateTime startDateTime, float currentFlaps, float flaps); + SWGSDRangel::SWGMapAnimation *slatsAnimation(QDateTime startDateTime, bool retract); + SWGSDRangel::SWGMapAnimation *rotorAnimation(QDateTime startDateTime, bool stop); + SWGSDRangel::SWGMapAnimation *engineAnimation(QDateTime startDateTime, int engine, bool stop); + // Whether the model the map draws for this aircraft has a named animation, so it is + // only asked to play what it can - see Aircraft3DModels::hasAnimation() + bool modelHasAnimation(const ADSBAircraft *aircraft, const QString &animation) const; + void checkStaticNotification(ADSBAircraft *aircraft); + void checkDynamicNotification(ADSBAircraft *aircraft); + void commandNotification(ADSBAircraft *aircraft, const QString &command); + QString subAircraftString(ADSBAircraft *aircraft, const QString &string); + void removeAircraft(QHash::iterator& i, ADSBAircraft *aircraft); + ADSBAircraft *findAircraftByFlight(const QString& flight); + int roundTo50Feet(int alt); + int squawkDecode(int code) const; + int gillhamToFeet(int n) const; + int grayToBinary(int gray, int bits) const; + void sendAircraftReport(); + void clearOldHeading(ADSBAircraft *aircraft, const QDateTime& dateTime, float newTrack); + void updateQNH(const ADSBAircraft *aircraft, float qnh); + void setCallsign(ADSBAircraft *aircraft, const QString& callsign); + void initCoverageMap(); + void clearCoverageMap(); + void updateCoverageMap(float azimuth, float elevation, float distance, float altitude); + void updateDFStats(int df); + bool updateTCStats(int tc, int row, int low, int high); + int countActiveAircraft(); + + // Aircraft imported from the OpenSky Network, rather than heard directly + QNetworkAccessManager *m_importNetworkManager; + QTimer *m_importTimer; + QPointer m_importTokenReply; + QPointer m_importStatesReply; + QString m_importAccessToken; + QDateTime m_importAccessTokenExpiry; + int m_importRequestGeneration; + bool m_importAuthenticationRetry; + + FlightInformation *m_flightInformation; + + void initFlightInformation(); + static QString dataTimeToShortString(QDateTime dt); + void applyImportSettings(); + bool importCredentialsConfigured() const; + bool importAccessTokenValid() const; + void invalidateImportAuthentication(); + void requestImportAccessToken(); + void sendImportRequest(); + void handleImportTokenReply(QNetworkReply *reply); + void handleImportNetworkReply(QNetworkReply *reply); + void handleImportReply(QNetworkReply *reply); + void import(); + + bool handleMessage(const Message& message); + void applySettings(const ADSBDemodSettings& settings, const QStringList& settingsKeys, bool force = false); + void markDirty(ADSBAircraft *aircraft) { m_dirtyAircraft.insert(aircraft); } + void setStat(int row, const QVariant& value); +}; + +#endif // INCLUDE_ADSBDEMODTRACKER_H diff --git a/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp b/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp new file mode 100644 index 000000000..ec1e16918 --- /dev/null +++ b/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp @@ -0,0 +1,5466 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "SWGMapItem.h" +#include "SWGMapAnimation.h" +#include "SWGMapAircraftState.h" + +#include "channel/channelwebapiutils.h" +#include "feature/featurewebapiutils.h" +#include "maincore.h" +#include "util/units.h" +#include "util/azel.h" +#include "util/aircraftreport.h" +#include "util/aircraftenginesound.h" +#include "util/aircraft3dmodels.h" +#include "util/morse.h" + +#include +#include +#include +#include +#include +#include +#include "util/db.h" +#include "util/profiler.h" +#include "util/airlines.h" +#include "adsb.h" +#include "adsbdemod.h" +#include "adsbdemodreport.h" +#include "adsbdemodtracker.h" + +const char ADSBDemodTracker::m_idMap[] = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ##### ############-##0123456789######"; + +const QString ADSBDemodTracker::m_categorySetA[] = { + QStringLiteral("None"), + QStringLiteral("Light"), + QStringLiteral("Small"), + QStringLiteral("Large"), + QStringLiteral("High vortex"), + QStringLiteral("Heavy"), + QStringLiteral("High performance"), + QStringLiteral("Rotorcraft") +}; + +const QString ADSBDemodTracker::m_categorySetB[] = { + QStringLiteral("None"), + QStringLiteral("Glider/sailplane"), + QStringLiteral("Lighter-than-air"), + QStringLiteral("Parachutist"), + QStringLiteral("Ultralight"), + QStringLiteral("Reserved"), + QStringLiteral("UAV"), + QStringLiteral("Space vehicle") +}; + +const QString ADSBDemodTracker::m_categorySetC[] = { + QStringLiteral("None"), + QStringLiteral("Emergency vehicle"), + QStringLiteral("Service vehicle"), + QStringLiteral("Ground obstruction"), + QStringLiteral("Cluster obstacle"), + QStringLiteral("Line obstacle"), + QStringLiteral("Reserved"), + QStringLiteral("Reserved") +}; + +const QString ADSBDemodTracker::m_emergencyStatus[] = { + QStringLiteral("No emergency"), + QStringLiteral("General emergency"), + QStringLiteral("Lifeguard/Medical"), + QStringLiteral("Minimum fuel"), + QStringLiteral("No communications"), + QStringLiteral("Unlawful interference"), + QStringLiteral("Downed aircraft"), + QStringLiteral("Reserved") +}; + +const QString ADSBDemodTracker::m_flightStatuses[] = { + QStringLiteral("Airborne"), + QStringLiteral("On-ground"), + QStringLiteral("Alert, airborne"), + QStringLiteral("Alert, on-ground"), + QStringLiteral("Alert, SPI"), + QStringLiteral("SPI"), + QStringLiteral("Reserved"), + QStringLiteral("Not assigned") +}; + +const QString ADSBDemodTracker::m_hazardSeverity[] = { + "NIL", "Light", "Moderate", "Severe" +}; + +const QString ADSBDemodTracker::m_fomSources[] = { + "Invalid", "INS", "GNSS", "DME/DME", "DME/VOR", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved" +}; + +const QString ADSBDemodTracker::m_nacvStrings[] = { + ">= 10 m/s", "< 10 m/s", "< 3 m/s", "< 1 m/s", "< 0.3 m/s", "Reserved", "Reserved", "Reserved" +}; + +// Longitude zone (returns value in range [1,59] +static int cprNL(double lat) +{ + if (lat == 0.0) + { + return 59; + } + else if ((lat == 87.0) || (lat == -87.0)) + { + return 2; + } + else if ((lat > 87.0) || (lat < -87.0)) + { + return 1; + } + else + { + double nz = 15.0; + double n = 1 - std::cos(M_PI / (2.0 * nz)); + double d = std::cos(std::fabs(lat) * M_PI/180.0); + return std::floor((M_PI * 2.0) / std::acos(1.0 - (n/(d*d)))); + } +} + +static int cprN(double lat, int odd) +{ + int nl = cprNL(lat) - odd; + if (nl > 1) { + return nl; + } else { + return 1; + } +} + +// Can't use std::fmod, as that works differently for negative numbers (See C.2.6.2) +static Real modulus(double x, double y) +{ + return x - y * std::floor(x/y); +} + +static bool isSpeedInconsistent(float speed1, float speed2) +{ + return std::abs(speed1 - speed2) > 50.0f; +} + +static bool isHeadingInconsistent(float heading1, float heading2) +{ + float difference = std::fmod(std::abs(heading1 - heading2), 360.0f); + return std::min(difference, 360.0f - difference) > 45.0f; +} + +static bool isVerticalRateInconsistent(int verticalRate1, int verticalRate2) +{ + return abs(verticalRate1 - verticalRate2) > 1500; +} + +static bool isAltitudeInconsistent(int altitude1, int altitude2) +{ + return abs(altitude1 - altitude2) > 1500; // 30s at climb rate of 3kft/m +} + +// Difference in longitude in degrees, accounting for wrap around +-180 +static double longitudeDiff(double longitude1, double longitude2) +{ + double difference = std::abs(longitude1 - longitude2); + return std::min(difference, 360.0 - difference); +} + +// Difference in longitude in degrees that corresponds to the same distance as maxLatDiff degrees of latitude +// A degree of longitude covers cos(latitude) times the distance of a degree of latitude, so the same +// distance is a larger difference in longitude. Limited, to avoid divide by zero at the poles +static double maxLongitudeDiff(double latitude, double maxLatDiff) +{ + return maxLatDiff / std::max(cos(Units::degreesToRadians(latitude)), 0.01); +} + +static bool isPositionInconsistent(double latitude1, double longitude1, double latitude2, double longitude2) +{ + return (std::abs(latitude1 - latitude2) > 0.2) || (longitudeDiff(longitude1, longitude2) > 0.3); // 1 deg lat is ~70 miles. 500mph is ~8miles per minute +} + +// A previous emitter position is only an unambiguous local-CPR reference while an +// aircraft travelling at no more than 600 knots could not have crossed half a CPR +// zone (180 NM airborne or 45 NM on the surface) since that position. +static bool hasUsableCprReference(const ADSBAircraft *aircraft, bool onSurface, const QDateTime& dateTime) +{ + if (!aircraft->m_globalPosition || !aircraft->m_positionValid || !aircraft->m_positionDateTime.isValid()) { + return false; + } + + const qint64 age = aircraft->m_positionDateTime.msecsTo(dateTime); + const qint64 maxAge = onSurface ? 270000 : 1080000; + return (age >= 0) && (age <= maxAge); +} + + + + + + + + + + + +// Initialise text to speech engine +// This takes 10 seconds on some versions of Linux, so only do it, if user actually +// has speech notifications configured + +// ADS-B and Mode-S selected altitudes have slightly different precision, so values can jump around a bit +// And we end up with altitudes such as 38008 rather than 38000 +// To remove this, we round to nearest 50 feet +int ADSBDemodTracker::roundTo50Feet(int alt) +{ + return ((alt + 25) / 50) * 50; +} + +static void calcRadialEndPoint(float startLatitude, float startLongitude, float distance, float bearing, float &endLatitude, float &endLongitude) +{ + double startLatRad = startLatitude*M_PI/180.0; + double startLongRad = startLongitude*M_PI/180.0; + double theta = bearing*M_PI/180.0; + double earthRadius = 6378137.0; // At equator + double delta = distance/earthRadius; + double endLatRad = std::asin(sin(startLatRad)*cos(delta) + cos(startLatRad)*sin(delta)*cos(theta)); + double endLongRad = startLongRad + std::atan2(sin(theta)*sin(delta)*cos(startLatRad), cos(delta) - sin(startLatRad)*sin(endLatRad)); + endLatitude = endLatRad*180.0/M_PI; + endLongitude = endLongRad*180.0/M_PI; +} + +void ADSBDemodTracker::clearFromMap(const QString& name) +{ + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_adsbDemod, "mapitems", mapPipes); + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(name)); + swgMapItem->setImage(new QString("")); + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_adsbDemod, swgMapItem); + messageQueue->push(msg); + } +} + +void ADSBDemodTracker::queueMapUpdate(ADSBAircraft *aircraft, QList *animations) +{ + auto existing = m_pendingMapUpdates.find(aircraft); + + if (existing == m_pendingMapUpdates.end()) + { + m_pendingMapUpdates.insert(aircraft, animations); + } + else if (animations) + { + // Animations are one-offs, so they have to accumulate rather than be replaced + if (*existing) + { + (*existing)->append(*animations); + delete animations; + } + else + { + *existing = animations; + } + } +} + +void ADSBDemodTracker::discardMapUpdate(ADSBAircraft *aircraft) +{ + auto pending = m_pendingMapUpdates.find(aircraft); + + if (pending != m_pendingMapUpdates.end()) + { + if (*pending) + { + qDeleteAll(**pending); + delete *pending; + } + m_pendingMapUpdates.erase(pending); + } +} + +// Every map item we send is owned and deleted by whoever receives it, and there can be +// more than one, so each needs animations of its own rather than a shared list +QList *ADSBDemodTracker::copyAnimations(QList *animations) +{ + if (!animations) { + return nullptr; + } + + QList *copy = new QList(); + + for (auto *animation : *animations) + { + SWGSDRangel::SWGMapAnimation *item = new SWGSDRangel::SWGMapAnimation(); + + if (animation->getName()) { + item->setName(new QString(*animation->getName())); + } + if (animation->getStartDateTime()) { + item->setStartDateTime(new QString(*animation->getStartDateTime())); + } + item->setReverse(animation->getReverse()); + item->setLoop(animation->getLoop()); + item->setStartOffset(animation->getStartOffset()); + item->setMultiplier(animation->getMultiplier()); + item->setDuration(animation->getDuration()); + item->setStop(animation->getStop()); + copy->append(item); + } + + return copy; +} + +void ADSBDemodTracker::sendToMap(ADSBAircraft *aircraft, + QList *animations, + const QDateTime& aircraftStateDateTime) +{ + // When an ADSBAircraft feature is listening, it drives the Map: it gets reports + // carrying the fully-built map item (so the 3D model and PFD aircraft state + // reach the Map losslessly), combined with sightings from other protocols. + // Without one, send to the Map directly as before. + QList reportPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_adsbDemod, "aircraftreport", reportPipes); + + // Send to Map feature + QList mapPipes; + if (reportPipes.size() == 0) { + MainCore::instance()->getMessagePipes().getMessagePipes(m_adsbDemod, "mapitems", mapPipes); + } + + if ((mapPipes.size() > 0) || (reportPipes.size() > 0)) + { + // Barometric altitude reported by ADS-B is relative to pressure of 1013.25 + // Correct using QNH setting to get altitude relative to sea level + int altitudeFt = aircraft->m_altitude; + + if (aircraft->m_onSurfaceValid && aircraft->m_onSurface) { + altitudeFt = 0; // Ignore Mode S altitude + } else if (!aircraft->m_altitudeGNSS) { + altitudeFt += (m_settings.m_qnh - 1013.25) * 30; // Adjust by 30ft per hPa + } + + float altitudeM = Units::feetToMetres(altitudeFt); + + // On take-off, m_onSurface may go false before aircraft actually takes off + // and due to inaccuracy in baro / QHN, it can appear to move down the runway in the air + // So keep altitude at 0 until it starts to go above first airbourne value + if (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude <= aircraft->m_runwayAltitude)) { + altitudeM = 0; + } + + const bool replay = m_loadingData && aircraftStateDateTime.isValid(); + // Only consume the boundary marker when an Aircraft feature will receive it. + // If one is connected part way through a replay, its first report must still + // start a track independent of any state it already holds for the airframe. + const bool replayStart = replay + && !m_replayAircraftReported.contains(aircraft->m_icao); + if (replayStart) { + m_replayAircraftReported.insert(aircraft->m_icao); + } + + // The in-channel map starts a fresh trail for every replay and whenever a newly + // unambiguous global CPR position proves the preceding local trail belonged to + // another CPR zone. The external Map owns an independent automatic track, so it + // must receive the same boundary. Removing and immediately re-adding the item is + // the existing Map protocol for discarding all state associated with an object. + const bool resetDirectMapTrack = reportPipes.isEmpty() + && (replayStart || aircraft->m_mapTrailResetPending); + if (resetDirectMapTrack) + { + qWarning() << "ADSB_MAP_TRACK_RESET" << aircraft->m_icaoHex + << (replayStart ? "replay-start" : "CPR-reference-change") + << aircraft->m_positionDateTime.toString(Qt::ISODateWithMs) + << aircraft->m_latitude << aircraft->m_longitude; + clearFromMap(aircraft->m_icaoHex); + aircraft->m_mapTrailResetPending = false; + } + + for (const auto& pipe : (reportPipes.size() > 0 ? reportPipes : mapPipes)) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(aircraft->m_icaoHex)); + swgMapItem->setLatitude(aircraft->m_latitude); + swgMapItem->setLongitude(aircraft->m_longitude); + swgMapItem->setAltitude(altitudeM); + swgMapItem->setPositionDateTime(new QString(aircraft->m_positionDateTime.toString(Qt::ISODateWithMs))); + swgMapItem->setAltitudeDateTime(new QString(aircraft->m_altitudeDateTime.toString(Qt::ISODateWithMs))); + swgMapItem->setFixedPosition(false); + swgMapItem->setAvailableUntil(new QString(aircraft->m_positionDateTime.addSecs(61).toString(Qt::ISODateWithMs))); // Changed from 60 to 61 due to https://github.com/CesiumGS/cesium/issues/12426 + QString image; + if (m_settings.m_useLiveryIcons) { + image = aircraft->getLiveryImage(); + } + if (image.isEmpty()) { + image = aircraft->getImage(); + } + swgMapItem->setImage(new QString(QString("qrc:///map/%1").arg(image))); + // Use track, in preference to heading, as we typically receive far fewer heading frames + if (aircraft->m_trackValid) { + swgMapItem->setImageRotation(aircraft->m_track); + } else { + swgMapItem->setImageRotation(aircraft->m_heading); + } + // Links only on the pass-through: this item is going to an Aircraft feature, + // which is what makes them lead anywhere. Sent straight to the Map - no + // Aircraft feature open - they would be dead, and the demodulator's own map + // has no link handler in its delegate either. + swgMapItem->setText(new QString( + aircraft->getText(&m_settings, true, reportPipes.size() > 0))); + + if (!aircraft->m_aircraft3DModel.isEmpty()) { + swgMapItem->setModel(new QString(aircraft->m_aircraft3DModel)); + } else { + swgMapItem->setModel(new QString(aircraft->m_aircraftCat3DModel)); + } + + QDateTime labelDateTime; + swgMapItem->setLabel(new QString(aircraft->getLabel(&m_settings, labelDateTime))); + if (labelDateTime.isValid()) { + swgMapItem->setLabelDateTime(new QString(labelDateTime.toString(Qt::ISODateWithMs))); + } + + if (aircraft->m_trackValid) + { + swgMapItem->setOrientation(1); + swgMapItem->setHeading(aircraft->m_track); + swgMapItem->setPitch(aircraft->m_pitchEst); + if (aircraft->m_rollValid) { + swgMapItem->setRoll(aircraft->m_roll); + } else { + swgMapItem->setRoll(aircraft->m_rollEst); + } + swgMapItem->setOrientationDateTime(new QString(aircraft->m_positionDateTime.toString(Qt::ISODateWithMs))); + } + else + { + // Orient aircraft based on velocity calculated from position + swgMapItem->setOrientation(0); + } + + swgMapItem->setModelAltitudeOffset(aircraft->m_modelAltitudeOffset); + swgMapItem->setLabelAltitudeOffset(aircraft->m_labelAltitudeOffset); + swgMapItem->setAltitudeReference(3); // CLIP_TO_GROUND so aircraft don't go under runway + swgMapItem->setAnimations(copyAnimations(animations)); + + // A null track asks the Map to build one from successive positions. Leaving + // the generated object's default empty list here instead says that the + // sender owns an empty track, so no flight path is ever accumulated. + swgMapItem->setTrack(nullptr); + + // Engine sound, looped by the 3D map, spatially located at the aircraft + const QString engineSound = AircraftEngineSound::engineSound( + aircraft->m_aircraftInfo ? aircraft->m_aircraftInfo->m_type : QString(), + aircraft->m_emitterCategory, + aircraft->m_aircraftInfo ? aircraft->m_aircraftInfo->m_model : QString()); + if (!engineSound.isEmpty()) { + swgMapItem->setLoopSound(new QString(engineSound)); + } + + SWGSDRangel::SWGMapAircraftState *aircraftState = new SWGSDRangel::SWGMapAircraftState(); + if (aircraftStateDateTime.isValid()) { + // Present only for unthrottled log replay. The Map uses this both as the + // CZML sample time and as the instruction not to coalesce this state with + // the next frame before it reaches the 3D display. + aircraftState->setDateTime(new QString(aircraftStateDateTime.toString(Qt::ISODateWithMs))); + } + aircraftState->setIcao(new QString(QString::number(aircraft->m_icao, 16))); + if (!aircraft->m_callsign.isEmpty()) { + aircraftState->setCallsign(new QString(aircraft->m_callsign)); + } + if (aircraft->m_aircraftInfo) { + aircraftState->setAircraftType(new QString(aircraft->m_aircraftInfo->m_type)); + } + if (aircraft->m_onSurfaceValid) { + aircraftState->setOnSurface(aircraft->m_onSurface); + } else { + aircraftState->setOnSurface(-1); + } + if (aircraft->m_indicatedAirspeedValid) + { + aircraftState->setAirspeed(aircraft->m_indicatedAirspeed); + aircraftState->setAirspeedDateTime(new QString(aircraft->m_indicatedAirspeedDateTime.toString(Qt::ISODateWithMs))); + } + else + { + aircraftState->setAirspeed(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_trueAirspeedValid) { + aircraftState->setTrueAirspeed(aircraft->m_trueAirspeed); + } else { + aircraftState->setTrueAirspeed(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_groundspeedValid) { + aircraftState->setGroundspeed(aircraft->m_groundspeed); + } else { + aircraftState->setGroundspeed(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_machValid) { + aircraftState->setMach(aircraft->m_mach); + } else { + aircraftState->setMach(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_pressureAltitudeValid) + { + aircraftState->setAltitude(aircraft->m_pressureAltitude); + aircraftState->setAltitudeDateTime(new QString(aircraft->m_altitudeDateTime.toString(Qt::ISODateWithMs))); + } + else + { + aircraftState->setAltitude(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_baroValid) + { + // What the crew has set in the altimeter, from the target state message + aircraftState->setQnh(aircraft->m_baro); + } + else if (aircraft->m_pressureAltitudeValid) + { + // Not every aircraft reports it. The crew's setting would be standard + // above the transition altitude and the local QNH below it, so that + // stands in - without it the PFD shows no setting at all and reads a + // flight level as though it were an altitude on QNH + aircraftState->setQnh(aircraft->m_pressureAltitude >= m_settings.m_transitionAlt + ? 1013.25f : m_settings.m_qnh); + } + else + { + aircraftState->setQnh(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_verticalRateValid) { + aircraftState->setVerticalSpeed(aircraft->m_verticalRate); + } else { + aircraftState->setVerticalSpeed(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_headingValid) { + aircraftState->setHeading(aircraft->m_heading); + } else { + aircraftState->setHeading(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_trackValid) { + aircraftState->setTrack(aircraft->m_track); + } else { + aircraftState->setTrack(std::numeric_limits::quiet_NaN()); + } + //aircraftState->setSelectedAirspeed(aircraft->m_selSpeed); // Selected speed not available in ADS-B / Mode-S + if (aircraft->m_selAltitudeValid) { + aircraftState->setSelectedAltitude(roundTo50Feet(aircraft->m_selAltitude)); + } else { + aircraftState->setSelectedAltitude(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_selHeadingValid) { + aircraftState->setSelectedHeading(aircraft->m_selHeading); + } else { + aircraftState->setSelectedHeading(std::numeric_limits::quiet_NaN()); + } + if (aircraft->m_autopilotValid) { + aircraftState->setAutopilot((int) aircraft->m_autopilot); + } else { + aircraftState->setAutopilot(-1); + } + if (aircraft->m_vnavModeValid && aircraft->m_vnavMode) { + aircraftState->setVerticalMode(1); + } else if (aircraft->m_altHoldModeValid && aircraft->m_altHoldMode) { + aircraftState->setVerticalMode(2); + } else if (aircraft->m_approachModeValid && aircraft->m_approachMode) { + aircraftState->setVerticalMode(3); + } else { + aircraftState->setVerticalMode(0); + } + if (aircraft->m_lnavModeValid && aircraft->m_lnavMode) { + aircraftState->setLateralMode(1); + } else if (aircraft->m_approachModeValid && aircraft->m_approachMode) { + aircraftState->setLateralMode(2); + } else { + aircraftState->setLateralMode(0); + } + + // When RA Only, m_tcasOperational appears to be false + QString acasCapability = aircraft->cellText(ADSB_COL_ACAS); + if (acasCapability == "") { + aircraftState->setTcasMode(0); // Unknown + } else if (acasCapability == "No ACAS") { + aircraftState->setTcasMode(1); // Off + } else if (acasCapability == "No RA") { + aircraftState->setTcasMode(2); // TA Only + } else { + aircraftState->setTcasMode(3); // TA/RA + } + + // Active resolution advisory as a bitfield, 0 when there is none. The + // clear-of-conflict bit is sent (briefly - see tick()) so the page can + // announce it rather than just falling silent + int tcasRA = 0; + if (aircraft->m_raActive || aircraft->m_raTerminated) + { + tcasRA |= aircraft->m_raActive ? 1 : 0; + tcasRA |= aircraft->m_raCorrective ? 2 : 0; + tcasRA |= aircraft->m_raDownward ? 4 : 0; + tcasRA |= aircraft->m_raPositive ? 8 : 0; + tcasRA |= aircraft->m_raTerminated ? 16 : 0; + tcasRA |= aircraft->m_raMultipleThreats ? 32 : 0; + tcasRA |= aircraft->m_raOppositeSense ? 64 : 0; + } + aircraftState->setTcasRa(tcasRA); + if (aircraft->m_raActive && aircraft->m_raThreatIcao) { + aircraftState->setTcasThreatIcao(new QString(QString::number(aircraft->m_raThreatIcao, 16))); + } + // A squawk of 0 is never assigned, so it doubles as "not yet decoded" + aircraftState->setSquawk(aircraft->m_squawk > 0 ? aircraft->m_squawk : -1); + + // Windspeed/direction are rarely available, so use calculated headwind as backup + QVariant windSpeed = aircraft->cell(ADSB_COL_WIND_SPEED); + QVariant windDirection = aircraft->cell(ADSB_COL_WIND_DIR); + if (!windSpeed.isNull() && !windDirection.isNull()) + { + aircraftState->setWindSpeed(windSpeed.toFloat()); + aircraftState->setWindDirection(windDirection.toFloat()); + } + else + { + QVariant headwind = aircraft->cell(ADSB_COL_HEADWIND); + if (!headwind.isNull() && aircraft->m_headingValid) + { + aircraftState->setWindSpeed(headwind.toFloat()); + aircraftState->setWindDirection(aircraft->m_heading); + } + else + { + aircraftState->setWindSpeed(std::numeric_limits::quiet_NaN()); + aircraftState->setWindDirection(std::numeric_limits::quiet_NaN()); + } + } + + // Static air temperature rarely available, so use estimated as backup + QVariant staticAirTemp = aircraft->cell(ADSB_COL_STATIC_AIR_TEMP); + if (!staticAirTemp.isNull()) + { + aircraftState->setStaticAirTemperature(staticAirTemp.toFloat()); + } + else + { + QVariant estAirTemp = aircraft->cell(ADSB_COL_EST_AIR_TEMP); + if (!estAirTemp.isNull()) { + aircraftState->setStaticAirTemperature(estAirTemp.toFloat()); + } else { + aircraftState->setStaticAirTemperature(std::numeric_limits::quiet_NaN()); + } + } + + swgMapItem->setAircraftState(aircraftState); + + if (reportPipes.size() > 0) + { + AircraftReport report; + report.m_protocol = AircraftReport::ADSB; + report.m_frequency = m_deviceCenterFrequency + m_settings.m_inputFrequencyOffset; + report.m_deviceSetIndex = m_adsbDemod->getDeviceSetIndex(); + report.m_channelIndex = m_adsbDemod->getIndexInDeviceSet(); + report.m_icao = (quint32) aircraft->m_icao; + if (aircraft->m_aircraftInfo) { + report.m_registration = aircraft->m_aircraftInfo->m_registration; + } + report.m_flight = aircraft->m_callsign; + report.m_positionValid = true; + report.m_latitude = aircraft->m_latitude; + report.m_longitude = aircraft->m_longitude; + if (aircraft->m_altitudeValid) + { + report.m_altitudeValid = true; + report.m_altitudeFt = altitudeFt; + } + // Track preferred over heading, as for the icon rotation above + if (aircraft->m_trackValid) + { + report.m_headingValid = true; + report.m_heading = aircraft->m_track; + } + else if (aircraft->m_headingValid) + { + report.m_headingValid = true; + report.m_heading = aircraft->m_heading; + } + if (aircraft->m_groundspeedValid) + { + report.m_speedValid = true; + report.m_speedKts = aircraft->m_groundspeed; + } + report.m_positionDateTime = aircraft->m_positionDateTime; + report.m_altitudeDateTime = aircraft->m_altitudeDateTime; + report.m_received = QDateTime::currentDateTime(); + report.m_replay = replay; + report.m_replayStart = replayStart; + report.m_mapItem = swgMapItem; // Ownership transfers with the report + messageQueue->push(MainCore::MsgAircraftReport::create(m_adsbDemod, report)); + } + else + { + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_adsbDemod, swgMapItem); + messageQueue->push(msg); + } + } + } + + // Each pipe was given a copy, so this is ours to free + if (animations) + { + qDeleteAll(*animations); + delete animations; + } +} + +// Find aircraft with icao, or create if it doesn't exist +ADSBAircraft *ADSBDemodTracker::getAircraft(int icao, bool &newAircraft) +{ + ADSBAircraft *aircraft; + + if (m_aircraft.contains(icao)) + { + // Update existing aircraft info + aircraft = m_aircraft.value(icao); + } + else + { + // Add new aircraft + newAircraft = true; + aircraft = new ADSBAircraft(); + aircraft->m_icao = icao; + //aircraft->m_icaoHex = QString::number(aircraft->m_icao, 16); + aircraft->m_icaoHex = QString("%1").arg(aircraft->m_icao, 6, 16, QChar('0')); + m_aircraft.insert(icao, aircraft); + aircraft->setCell(ADSB_COL_ICAO, aircraft->m_icaoHex); + markDirty(aircraft); + + // Look aircraft up in database + if (m_aircraftInfo != nullptr) + { + if (m_aircraftInfo->contains(icao)) + { + aircraft->m_aircraftInfo = m_aircraftInfo->value(icao); + aircraft->setCell(ADSB_COL_MODEL, aircraft->m_aircraftInfo->m_model); + aircraft->setCell(ADSB_COL_TYPE, aircraft->m_aircraftInfo->m_type); + aircraft->setCell(ADSB_COL_REGISTRATION, aircraft->m_aircraftInfo->m_registration); + aircraft->setCell(ADSB_COL_MANUFACTURER, aircraft->m_aircraftInfo->m_manufacturerName); + aircraft->setCell(ADSB_COL_OWNER, aircraft->m_aircraftInfo->m_owner); + aircraft->setCell(ADSB_COL_OPERATOR_ICAO, aircraft->m_aircraftInfo->m_operatorICAO); + aircraft->setCell(ADSB_COL_REGISTERED, aircraft->m_aircraftInfo->m_registered); + // Try loading an airline logo based on operator ICAO + bool hasAirlineIcon = false; + if (aircraft->m_aircraftInfo->m_operatorICAO.size() > 0) + { + const QString path = AircraftInformation::getAirlineIconPath(aircraft->m_aircraftInfo->m_operatorICAO); + hasAirlineIcon = !path.isEmpty(); + if (hasAirlineIcon) + { + aircraft->m_airlineIconPath = path; + aircraft->m_airlineIconURL = AircraftInformation::resourcePathToURL(path); + } + } + if (!hasAirlineIcon) + { + if (aircraft->m_aircraftInfo->m_operator.size() > 0) + aircraft->setCell(ADSB_COL_AIRLINE, aircraft->m_aircraftInfo->m_operator); + else + aircraft->setCell(ADSB_COL_AIRLINE, aircraft->m_aircraftInfo->m_owner); + } + // Try loading a sideview + const QString sideviewPath = AircraftInformation::getSideviewIconPath(aircraft->m_aircraftInfo->m_registration, aircraft->m_aircraftInfo->m_operatorICAO, aircraft->m_aircraftInfo->m_type); + if (!sideviewPath.isEmpty()) + { + aircraft->m_sideviewIconPath = sideviewPath; + aircraft->m_sideviewIconURL = AircraftInformation::resourcePathToURL(sideviewPath); + } + // Try loading a flag based on registration + if (aircraft->m_aircraftInfo->m_registration.size() > 0) + { + QString flag = aircraft->m_aircraftInfo->getFlag(); + if (flag != "") + { + aircraft->m_flagName = flag; + aircraft->m_flagIconPath = AircraftInformation::getFlagIconPath(flag); + aircraft->m_flagIconURL = AircraftInformation::resourcePathToURL(aircraft->m_flagIconPath); + } + } + get3DModel(aircraft); + } + } + + if (aircraft->m_aircraft3DModel.isEmpty()) + { + // Default to A320 until we get some more info + aircraft->m_aircraftCat3DModel = Aircraft3DModels::instance().modelForType("A320"); + Aircraft3DModels::instance().offsetsForType("A320", + aircraft->m_modelAltitudeOffset, aircraft->m_labelAltitudeOffset, + aircraft->m_aircraftCat3DModel); + } + + // Check to see if we need to emit a notification about this new aircraft + checkStaticNotification(aircraft); + } + + return aircraft; +} + +void ADSBDemodTracker::setCallsign(ADSBAircraft *aircraft, const QString& callsign) +{ + aircraft->m_callsign = callsign; + aircraft->setCell(ADSB_COL_CALLSIGN, aircraft->m_callsign); + if (m_routeInfo && m_routeInfo->contains(aircraft->m_callsign)) + { + AircraftRouteInformation *route = m_routeInfo->value(aircraft->m_callsign); + aircraft->setCell(ADSB_COL_DEP, route->m_dep); + aircraft->setCell(ADSB_COL_ARR, route->m_arr); + aircraft->setCell(ADSB_COL_STOPS, route->m_stops); + } + atcCallsign(aircraft); + callsignToFlight(aircraft); +} + +void ADSBDemodTracker::atcCallsign(ADSBAircraft *aircraft) +{ + QString icao = aircraft->m_callsign.left(3); + const Airline *airline = Airline::getByICAO(icao); + if (airline) + { + aircraft->setCell(ADSB_COL_ATC_CALLSIGN, airline->m_callsign); + // Create icons using data from Airline class, if it doesn't exist in database + if (!aircraft->m_aircraftInfo) + { + // Airline logo + QIcon *icon = nullptr; + const QString airlinePath = AircraftInformation::getAirlineIconPath(airline->m_icao); + if (!airlinePath.isEmpty()) + { + aircraft->m_airlineIconPath = airlinePath; + aircraft->m_airlineIconURL = AircraftInformation::resourcePathToURL(airlinePath); + } else { + aircraft->setCell(ADSB_COL_AIRLINE, airline->m_name); + } + // Flag + QString flag = airline->m_country.toLower().replace(" ", "_"); + const QString flagPath = AircraftInformation::getFlagIconPath(flag); + if (!flagPath.isEmpty()) + { + aircraft->m_flagName = flag; + aircraft->m_flagIconPath = flagPath; + aircraft->m_flagIconURL = AircraftInformation::resourcePathToURL(flagPath); + } + } + } +} + +// Try to map callsign to flight number +void ADSBDemodTracker::callsignToFlight(ADSBAircraft *aircraft) +{ + if (!aircraft->m_callsign.isEmpty()) + { + QRegularExpression flightNoExp("^[A-Z]{2,3}[0-9]{1,4}$"); + // Airlines line BA add a single character suffix that can be stripped + // If the suffix is two characters, then it typically means a digit + // has been replaced which I don't know how to guess + // E.g Easyjet might use callsign EZY67JQ for flight EZY6267 + // BA use BAW90BG for BA890 + QRegularExpression suffixedFlightNoExp("^([A-Z]{2,3})([0-9]{1,4})[A-Z]?$"); + QRegularExpressionMatch suffixMatch; + + if (flightNoExp.match(aircraft->m_callsign).hasMatch()) + { + aircraft->m_flight = aircraft->m_callsign; + } + else if ((suffixMatch = suffixedFlightNoExp.match(aircraft->m_callsign)).hasMatch()) + { + aircraft->m_flight = QString("%1%2").arg(suffixMatch.captured(1)).arg(suffixMatch.captured(2)); + } + else + { + // Don't guess, to save wasting API calls + aircraft->m_flight = ""; + } + } + else + { + aircraft->m_flight = ""; + } +} + +// Estimate outside air temperature (static temperature) from Mach number and true airspeed, assuming dry air +bool ADSBDemodTracker::calcAirTemp(ADSBAircraft *aircraft) +{ + if (aircraft->m_machValid && aircraft->m_trueAirspeedValid && (aircraft->m_mach > 0.0f)) + { + // Calculate speed of sound + float c = Units::knotsToMetresPerSecond(aircraft->m_trueAirspeed) / aircraft->m_mach; + + // Calculate temperature, given the speed of sound + float a = c / 331.3f; + float T = (a * a - 1.0f) * 273.15f; + + aircraft->setCell(ADSB_COL_EST_AIR_TEMP, (int)std::round(T)); + + return true; + } + else + { + return false; + } +} + +void ADSBDemodTracker::resetStats() +{ + m_correlationAvg.reset(); + m_correlationOnesAvg.reset(); + m_rangeFails = 0; + m_altFails = 0; + m_frameRateTime = QDateTime::currentDateTime(); + m_adsbFrameRateCount = 0; + m_modesFrameRateCount = 0; + m_totalBytes = 0; + m_maxRangeStat = 0.0f; + m_maxAltitudeStat = 0.0f; + m_maxRateState = 0.0f; + for (int i = 0; i < 32; i++) + { + m_dfStats[i] = 0; + m_tcStats[i] = 0; + } + m_stats.clear(); + m_statsChanged = true; + + ADSBDemod::MsgResetStats* message = ADSBDemod::MsgResetStats::create(); + m_adsbDemod->getInputMessageQueue()->push(message); +} + +void ADSBDemodTracker::updateDFStats(int df) +{ + switch (df) + { + case 0: + setStat(DF0, m_dfStats[df]); + break; + case 4: + setStat(DF4, m_dfStats[df]); + break; + case 5: + setStat(DF5, m_dfStats[df]); + break; + case 11: + setStat(DF11, m_dfStats[df]); + break; + case 16: + setStat(DF16, m_dfStats[df]); + break; + case 17: + setStat(DF17, m_dfStats[df]); + break; + case 18: + setStat(DF18, m_dfStats[df]); + break; + case 19: + setStat(DF19, m_dfStats[df]); + break; + case 20: + case 21: + setStat(DF20_21, m_dfStats[20] + m_dfStats[21]); + break; + case 22: + setStat(DF22, m_dfStats[df]); + break; + case 24: + case 25: + case 26: + case 27: + setStat(DF24, m_dfStats[24] + m_dfStats[25] + m_dfStats[26] + m_dfStats[27]); + break; + default: + break; + } +} + +bool ADSBDemodTracker::updateTCStats(int tc, int row, int low, int high) +{ + if ((tc >= low) && (tc <= high)) + { + qint64 sum = 0; + + for (int i = low; i <= high; i++) { + sum += m_tcStats[i]; + } + setStat(row, sum); + return true; + } + else + { + return false; + } +} + +void ADSBDemodTracker::handleADSB( + const QByteArray data, + const QDateTime dateTime, + float correlation, + float correlationOnes, + unsigned crc, + bool updateModel) +{ + PROFILER_START(); + + bool newAircraft = false; + bool updatedCallsign = false; + bool resetAnimation = false; + bool mapUpdated = false; + + const int df = (data[0] >> 3) & ADS_B_DF_MASK; // Downlink format + const int ca = data[0] & 0x7; // Capability (or Control Field for TIS-B) + unsigned icao; + ADSBAircraft *aircraft; + + if ((df == 11) || (df == 17)) + { + icao = ((data[1] & 0xff) << 16) | ((data[2] & 0xff) << 8) | (data[3] & 0xff); // ICAO aircraft address + aircraft = getAircraft(icao, newAircraft); + } + else if (df == 18) + { + const int cf = ca; + const int tc = (data[4] >> 3) & 0x1f; + const auto meBit = [&data](int bit) -> bool { + const int offset = bit - 1; + const unsigned octet = static_cast(data[4 + offset / 8]); + return (octet >> (7 - (offset % 8))) & 1; + }; + + // DF18 AA is only an ICAO address for the formats below. IMF is part of + // the ME data and its position depends on both CF and the message type. + // Formats with no IMF listed here are specified as ICAO-only. + int imfBit = 0; + if (cf == 0) + { + // ADS-B from a non-transponder device: AA is an ICAO address. + } + else if ((cf == 2) || (cf == 6)) + { + if ((tc >= 1) && (tc <= 4)) { + imfBit = 0; // Identification/category is ICAO-only. + } else if ((tc >= 5) && (tc <= 8)) { + imfBit = 21; // Surface position + } else if ((tc == 0) || ((tc >= 9) && (tc <= 18)) || ((tc >= 20) && (tc <= 22))) { + imfBit = 8; // Airborne position + } else if (tc == 19) { + imfBit = 9; // Airborne velocity + } else if ((cf == 6) && (tc == 28) && ((data[4] & 0x7) == 1)) { + imfBit = 56; // ADS-R emergency/priority status + } else if ((cf == 6) && (tc == 29) && (((data[4] >> 1) & 0x3) == 1)) { + imfBit = 51; // ADS-R target state and status, subtype 1 + } else if ((cf == 6) && (tc == 31)) { + imfBit = 56; // ADS-R operational status + } else { + return; // Message format is not defined for this CF. + } + + if ((imfBit != 0) && meBit(imfBit)) { + return; // AA is not an ICAO address. + } + } + else if (cf == 3) + { + if (meBit(1)) { + return; // Coarse TIS-B track-file address, not ICAO. + } + } + else + { + // CF1 and CF5 use non-ICAO addresses; CF4 is management and CF7 + // is reserved. None can be attached to an ICAO aircraft record. + return; + } + icao = ((data[1] & 0xff) << 16) | ((data[2] & 0xff) << 8) | (data[3] & 0xff); // ICAO aircraft address + aircraft = getAircraft(icao, newAircraft); + } + else + { + // Extract ICAO from parity + int bytes = data.length(); + unsigned parity = ((data[bytes-3] & 0xff) << 16) | ((data[bytes-2] & 0xff) << 8) | (data[bytes-1] & 0xff); + icao = (parity ^ crc) & 0xffffff; + if (icao == 0) + { + // Appears to be the case often for DF=5 + qDebug() << "ADSBDemodTracker::handleADSB: iaco of 0 - df" << df; + return; + } + aircraft = getAircraft(icao, newAircraft); + } + + // ADS-B, non-transponder ADS-B, TIS-B, or rebroadcast of ADS-B (ADS-R) + if ((df == 17) || ((df == 18) && (ca != 3) && (ca != 4))) + { + const int tc = (data[4] >> 3) & 0x1f; // Type code + //unsigned surveillanceStatus = 0; + + m_tcStats[tc]++; + if (updateTCStats(tc, TC_0, 0, 0)) { + } else if (updateTCStats(tc, TC_1_4, 1, 4)) { + } else if (updateTCStats(tc, TC_5_8, 5, 8)) { + } else if (updateTCStats(tc, TC_9_18, 9, 18)) { + } else if (updateTCStats(tc, TC_19, 19, 19)) { + } else if (updateTCStats(tc, TC_20_22, 20, 22)) { + } else if (updateTCStats(tc, TC_UNUSED, 23, 23)) { + } else if (updateTCStats(tc, TC_24, 24, 24)) { + } else if (updateTCStats(tc, TC_UNUSED, 25, 27)) { + } else if (updateTCStats(tc, TC_28, 28, 28)) { + } else if (updateTCStats(tc, TC_29, 29, 29)) { + } else if (updateTCStats(tc, TC_UNUSED, 30, 30)) { + } else if (updateTCStats(tc, TC_31, 31, 31)) { + } + + if ((tc >= 1) && ((tc <= 4))) + { + // ADSBAircraft identification - BDS 0,8 + QString emitterCategory, callsign; + + decodeID(data, emitterCategory, callsign); + + QString prevEmitterCategory = aircraft->m_emitterCategory; + aircraft->m_emitterCategory = emitterCategory; + aircraft->setCell(ADSB_COL_CATEGORY, aircraft->m_emitterCategory); + + updatedCallsign = aircraft->m_callsign != callsign; + if (updatedCallsign) { + setCallsign(aircraft, callsign); + } + + // Select 3D model based on category, if we don't already have one based on ICAO + if ( aircraft->m_aircraft3DModel.isEmpty() + && ( aircraft->m_aircraftCat3DModel.isEmpty() + || (prevEmitterCategory != aircraft->m_emitterCategory) + ) + ) + { + get3DModelBasedOnCategory(aircraft); + // As we're changing the model, we need to reset animations to + // ensure gear/flaps are in correct position on new model + resetAnimation = true; + } + } + else if (((tc >= 5) && (tc <= 18)) || ((tc >= 20) && (tc <= 22)) || (tc == 0)) + { + bool wasOnSurface = aircraft->m_onSurface; + aircraft->m_onSurface = (tc >= 5) && (tc <= 8); + aircraft->m_onSurfaceValid = true; + + if (wasOnSurface != aircraft->m_onSurface) + { + // Can't mix CPR values used on surface and those that are airborne + aircraft->m_cprValid[0] = false; + aircraft->m_cprValid[1] = false; + } + + if (aircraft->m_onSurface) + { + // Surface position - BDS 0,6 + aircraft->setOnSurface(dateTime); + + int movement = ((data[4] & 0x7) << 4) | ((data[5] >> 4) & 0xf); + if (movement == 0) + { + // No information available + aircraft->m_groundspeedValid = false; + aircraft->setCell(ADSB_COL_GROUND_SPEED, ""); + } + else if (movement == 1) + { + // ADSBAircraft stopped + aircraft->setGroundspeed(0, m_settings); + } + else if ((movement >= 2) && (movement <= 123)) + { + float base, step; // In knts + int adjust; + if ((movement >= 2) && (movement <= 8)) + { + base = 0.125f; + step = 0.125f; + adjust = 2; + } + else if ((movement >= 9) && (movement <= 12)) + { + base = 1.0f; + step = 0.25f; + adjust = 9; + } + else if ((movement >= 13) && (movement <= 38)) + { + base = 2.0f; + step = 0.5f; + adjust = 13; + } + else if ((movement >= 39) && (movement <= 93)) + { + base = 15.0f; + step = 1.0f; + adjust = 39; + } + else if ((movement >= 94) && (movement <= 108)) + { + base = 70.0f; + step = 2.0f; + adjust = 94; + } + else + { + base = 100.0f; + step = 5.0f; + adjust = 109; + } + aircraft->setGroundspeed(base + (movement - adjust) * step, m_settings); + } + else if (movement == 124) + { + aircraft->setGroundspeed(175, m_settings); // Actually greater than this + } + + int groundTrackStatus = (data[5] >> 3) & 1; + int groundTrackValue = ((data[5] & 0x7) << 4) | ((data[6] >> 4) & 0xf); + if (groundTrackStatus) + { + float groundTrackValueFloat = groundTrackValue * 360.0/128.0; + clearOldHeading(aircraft, dateTime, groundTrackValueFloat); + aircraft->setTrack(groundTrackValueFloat, dateTime); + } + } + else if (((tc >= 9) && (tc <= 18)) || ((tc >= 20) && (tc <= 22)) || (tc == 0)) + { + // Airborne position (9-18 baro, 20-22 GNSS) + + //surveillanceStatus = (data[4] >> 1) & 0x3; + + // ADS-B: Version 0 is single antenna flag, version 2 is NIC supplement-B + // TSI-B: ICAO/Mode A flag + if (aircraft->m_adsbVersionValid && (aircraft->m_adsbVersion == 2) && (df == 17)) + { + aircraft->m_nicSupplementB = data[4] & 1; + aircraft->m_nicSupplementBValid = true; + } + + int altFt; + bool valid = decodeAltitude(data, altFt); + if (valid) + { + aircraft->setAltitude(altFt, (tc >= 20) && (tc <= 22), dateTime, m_settings); + + // Assume runway elevation is at first reported airboune altitude + if (wasOnSurface) + { + aircraft->m_runwayAltitude = aircraft->m_altitude; + aircraft->m_runwayAltitudeValid = true; + } + } + } + + if (tc != 0) + { + int f; + double latCpr, lonCpr; + //unsigned t = (data[2] >> 3) & 1; // Not valid for TIS-B + bool globalValid = false; + double globalLatitude, globalLongitude; + bool localValid = false; + double localLatitude, localLongitude; + const bool useAircraftReference = hasUsableCprReference(aircraft, aircraft->m_onSurface, dateTime); + + decodeCpr(data, f, latCpr, lonCpr); + + aircraft->m_cprValid[f] = true; + aircraft->m_cprLat[f] = latCpr; + aircraft->m_cprLong[f] = lonCpr; + aircraft->m_cprTime[f] = dateTime; + + // CPR decoding + // Refer to Technical Provisions for Mode S Services and Extended Squitter - Appendix C2.6 + // See also: https://mode-s.org/decode/adsb/airborne-position.html + // For global decoding, we need both odd and even frames + // We also need to check that both frames aren't greater than 10s (airborne) or 50s (surface) apart in time (C.2.6.7), otherwise position may be out by ~10deg + // I've reduced this to 8.5s, as problems have been seen where times are just 9s apart + const int maxTimeDiff = aircraft->m_onSurface ? 48500 : 8500; + if (aircraft->m_cprValid[0] && aircraft->m_cprValid[1] + && (std::abs(aircraft->m_cprTime[0].toMSecsSinceEpoch() - aircraft->m_cprTime[1].toMSecsSinceEpoch()) <= maxTimeDiff) + && !aircraft->m_onSurface) + { + // Global decode using odd and even frames (C.2.6) + globalValid = decodeGlobalPosition(f, aircraft->m_cprLat, aircraft->m_cprLong, aircraft->m_cprTime, globalLatitude, globalLongitude, true); + if (!globalValid) + { + aircraft->m_cprValid[0] = false; + aircraft->m_cprValid[1] = false; + } + } + + // Decode a single frame relative to the most recent emitter position once + // a global decode has established the reference chain. Before that, use + // the receiver position. A failed candidate must not discard an established + // emitter reference and fall back to an unrelated receiver position. + localValid = decodeLocalPosition(f, aircraft->m_cprLat[f], aircraft->m_cprLong[f], aircraft->m_onSurface, dateTime, aircraft, localLatitude, localLongitude, true); + + bool positionsInconsistent = false; + if (globalValid && useAircraftReference) + { + if (localValid) + { + double latDiff = std::abs(globalLatitude - localLatitude); + double lonDiff = longitudeDiff(globalLongitude, localLongitude); + double maxLatDiff = 5.1/111000.0; + double maxLonDiff = maxLongitudeDiff(globalLatitude, maxLatDiff); + positionsInconsistent = (latDiff > maxLatDiff) || (lonDiff > maxLonDiff); + } + else + { + // The new position failed the local reasonableness test, so it must + // not update the established track through a simultaneous global decode. + positionsInconsistent = true; + } + + if (positionsInconsistent) + { + qDebug() << "positionsInconsistent" << aircraft->m_icaoHex << globalLatitude << localLatitude << globalLongitude << localLongitude; + aircraft->m_cprValid[0] = false; + aircraft->m_cprValid[1] = false; + } + } + if (!positionsInconsistent) + { + if (globalValid) + { + if (!useAircraftReference && aircraft->m_positionValid) + { + double latDiff = std::abs(globalLatitude - aircraft->m_latitude); + double lonDiff = longitudeDiff(globalLongitude, aircraft->m_longitude); + double maxLatDiff = 50000/111000.0; + double maxLonDiff = maxLongitudeDiff(globalLatitude, maxLatDiff); + if ((latDiff > maxLatDiff) || (lonDiff > maxLonDiff)) + { + qDebug() << "ADSBAircraft global position a long way from local - deleting track" << aircraft->m_icaoHex << globalLatitude << aircraft->m_latitude << globalLongitude << aircraft->m_longitude; + aircraft->m_trailCleared = true; + aircraft->m_mapTrailResetPending = true; + aircraft->m_positionUpdates.clear(); + } + } + updateAircraftPosition(aircraft, globalLatitude, globalLongitude, dateTime); + aircraft->m_globalPosition = true; + aircraft->m_positionChanged = true; + } + else if (localValid) + { + updateAircraftPosition(aircraft, localLatitude, localLongitude, dateTime); + aircraft->m_positionChanged = true; + } + } + } + } + else if (tc == 19) + { + // Airborne velocity - BDS 0,9 + int st = data[4] & 0x7; // Subtype + + if (df == 17) + { + int nacv = ((data[5] >> 3) & 0x7); // Navigation accuracy for velocity + + aircraft->setCell(ADSB_COL_NACV, m_nacvStrings[nacv]); + } + + if ((st == 1) || (st == 2)) + { + // Ground speed + float v, h; + + if (decodeGroundspeed(data, v, h)) + { + clearOldHeading(aircraft, dateTime, h); + aircraft->setTrack(h, dateTime); + aircraft->setGroundspeed(v, m_settings); + } + } + else if ((st == 3) || (st == 4)) + { + // Airspeed (only likely to get this if an aircraft is unable to determine it's position) + bool tas; + int as; + bool hdgValid; + float hdg; + + bool asValid = decodeAirspeed(data, tas, as, hdgValid, hdg); + + if (hdgValid) { + aircraft->setHeading(hdg, dateTime); + } + + if (asValid) + { + if (tas) { + aircraft->setTrueAirspeed(as, m_settings); + } else { + aircraft->setIndicatedAirspeed(as, dateTime, m_settings); + } + } + } + + if ((st >= 1) && (st <= 4)) + { + int verticalRate; + + if (decodeVerticalRate(data, verticalRate)) { + aircraft->setVerticalRate(verticalRate, m_settings); + } + } + } + else if (tc == 28) + { + // ADSBAircraft status - BDS 6,1 + int st = data[4] & 0x7; // Subtype + if (st == 1) + { + int es = (data[5] >> 5) & 0x7; // Emergency state + int modeA = ((data[5] << 8) & 0x1f00) | (data[6] & 0xff); // Mode-A code (squawk) + aircraft->m_status = m_emergencyStatus[es]; + aircraft->setCell(ADSB_COL_STATUS, aircraft->m_status); + aircraft->m_squawk = squawkDecode(modeA); + // This message doesn't signal SPI, so use the state last seen in DF5/21, to keep the text consistent + if (aircraft->m_spi) { + aircraft->setCell(ADSB_COL_SQUAWK, QString("%1 IDENT").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); + } else { + aircraft->setCell(ADSB_COL_SQUAWK, QString("%1").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); + } + } + else if (st == 2) + { + // TCAS/ACAS RA Broadcast - ME bits 9-56 carry the BDS 3,0 layout + decodeRABroadcast(data, dateTime, aircraft); + } + } + else if (tc == 29) + { + if (aircraft->m_adsbVersionValid && (aircraft->m_adsbVersion == 0)) + { + // Trajectory Change Point - according to the spec this shouldn't be transmitted + } + else if (aircraft->m_adsbVersionValid && (aircraft->m_adsbVersion == 1)) + { + // Target state and status - slightly different to version 2 below. Haven't ever seen version 1, so just ignore for now + } + else if (aircraft->m_adsbVersionValid && (aircraft->m_adsbVersion == 2)) + { + // Target state and status + //bool selAltitudeType = (data[5] >> 7) & 0x1; + int selAltitudeFix = ((data[5] & 0x7f) << 4) | ((data[6] >> 4) & 0xf); + if (selAltitudeFix != 0) + { + int selAltitude = (selAltitudeFix - 1) * 32; // Ft + aircraft->m_selAltitude = selAltitude; + aircraft->m_selAltitudeValid = true; + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, Units::feetToIntegerMetres(aircraft->m_selAltitude)); + } + else { + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, roundTo50Feet(aircraft->m_selAltitude)); + } + } + int baroFix = ((data[6] & 0xf) << 5) | ((data[7] >> 3) & 0x1f); + if (baroFix != 0) + { + float baro = (baroFix - 1) * 0.8f + 800.0f; // mb + aircraft->m_baro = baro; + aircraft->m_baroValid = true; + aircraft->setCell(ADSB_COL_BARO, std::round(aircraft->m_baro)); + updateQNH(aircraft, baro); + } + bool selHeadingValid = (data[7] >> 2) & 0x1; + if (selHeadingValid) + { + int selHeadingFix = ((data[7] & 0x3) << 7) | ((data[8] >> 1) & 0x7f); + selHeadingFix = (selHeadingFix << 23) >> 23; + float selHeading = selHeadingFix * 180.0f / 256.0f; + if (selHeading < 0.0f) { + selHeading += 360.0f; + } + aircraft->m_selHeading = selHeading; + aircraft->m_selHeadingValid = true; + aircraft->setCell(ADSB_COL_SEL_HEADING, std::round(aircraft->m_selHeading)); + } + + bool modeValid = (data[9] >> 1) & 0x1; + if (modeValid) + { + bool autoPilot = data[9] & 0x1; + bool vnavMode = (data[10] >> 7) & 0x1; + bool altHoldMode = (data[10] >> 6) & 0x1; + bool approachMode = (data[10] >> 4) & 0x1; + bool tcasOperational = (data[10] >> 3) & 0x1; + bool lnavMode = (data[10] >> 2) & 0x1; + + aircraft->m_autopilot = autoPilot; + aircraft->m_autopilotValid = true; + aircraft->setCell(ADSB_COL_AP, autoPilot ? QChar(0x2713) : QChar(0x2717)); // Tick or cross + + aircraft->m_vnavMode = vnavMode; + aircraft->m_vnavModeValid = true; + aircraft->m_altHoldMode = altHoldMode; + aircraft->m_altHoldModeValid = true; + aircraft->m_approachMode = approachMode; + aircraft->m_approachModeValid = true; + aircraft->m_tcasOperational = tcasOperational; + aircraft->m_tcasOperationalValid = true; + aircraft->m_lnavMode = lnavMode; + aircraft->m_lnavModeValid = true; + + if (aircraft->cellText(ADSB_COL_TCAS) != "RA") { + aircraft->setCell(ADSB_COL_TCAS, tcasOperational ? QChar(0x2713) : QChar(0x2717)); // Tick or cross + } + + // Should only have one of these active + QString vMode = ""; + if (vnavMode) { + vMode = vMode + "VNAV "; + } + if (altHoldMode) { + vMode = vMode + "HOLD "; + } + if (approachMode) { + vMode = vMode + "APP "; + } + vMode = vMode.trimmed(); + aircraft->setCell(ADSB_COL_V_MODE, vMode); + + QString lMode = ""; + if (lnavMode) { + lMode = lMode + "LNAV "; + } + if (approachMode) { + lMode = lMode + "APP "; + } + lMode = lMode.trimmed(); + aircraft->setCell(ADSB_COL_L_MODE, lMode); + } + } + } + else if (tc == 24) + { + // Surface system status + // Get quite a few from heathrow data + } + else if (tc == 31) + { + // ADSBAircraft operational status + int st = data[4] & 0x7; + + int adsbVersion = (data[9] >> 5) & 0x7; + + aircraft->m_adsbVersion = adsbVersion; + aircraft->m_adsbVersionValid = true; + aircraft->setCell(ADSB_COL_VERSION, aircraft->m_adsbVersion); + + if (adsbVersion == 2) + { + bool nicSupplementA = (data[9] >> 4) & 0x1; + int nacp = data[9] & 0xf; + int sil = (data[10] >> 4) & 0x3; + //bool hrd = (data[10] >> 2) & 0x1; // Whether headings are magnetic (false) or true North (true) + bool silSuppliment = (data[10] >> 1) & 0x1; // 0 per hour / 1 per sample + + aircraft->m_nicSupplementA = nicSupplementA; + aircraft->m_nicSupplementAValid = true; + + static const QStringList nacpStrings = { + ">= 10 NM", "< 10 NM", "< 4 NM", "< 2 NM", "< 1NM", "< 0.5NM", "< 0.3 NM", "< 0.1 NM", + "< 0.05 NM", "< 30 m", "< 10 m", "< 3 m", "Reserved", "Reserved", "Reserved", "Reserved" + }; + static const QStringList silStrings = { + "> 1e-3", "<= 1e-3", "<= 1e-5", "<= 1e-7" + }; + static const QStringList silSupplimentStrings = { + "ph", "ps" + }; + QString silString = QString("%1 %2").arg(silStrings[sil]).arg(silSupplimentStrings[silSuppliment]); + + aircraft->setCell(ADSB_COL_NACP, nacpStrings[nacp]); + aircraft->setCell(ADSB_COL_SIL, silString); + + if (st == 0) + { + // Airborne + unsigned capacityClassCode = ((data[5] & 0xff) << 8) | (data[6] & 0xff); + bool tcasOperational = (capacityClassCode >> 13) & 1; + //bool adsbIn = (capacityClassCode >> 12) & 1; + + aircraft->m_tcasOperational = tcasOperational; + aircraft->m_tcasOperationalValid = true; + + int gva = (data[10] >> 6) & 0x3; + bool nicBaro = (data[10] >> 3) & 0x1; + + static const QStringList gvaStrings = { + "> 150 m", "<= 150 m", "<= 45 m", "Reserved" + }; + + aircraft->setCell(ADSB_COL_GVA, gvaStrings[gva]); + aircraft->setCell(ADSB_COL_NIC_BARO, nicBaro ? QChar(0x2713) : QChar(0x2717)); // Tick or cross + } + else if (st == 1) + { + // Surface + unsigned capacityClassCode = ((data[5] & 0xff) << 4) | ((data[6] >> 4) & 0xf); + unsigned lengthWidthCode = data[6] & 0xf; + int nacv = (capacityClassCode >> 1) & 0x7; + bool nicSupplementC = capacityClassCode & 1; + + aircraft->m_nicSupplementC = nicSupplementC; + aircraft->m_nicSupplementCValid = true; + + aircraft->setCell(ADSB_COL_NACV, m_nacvStrings[nacv]); + + switch (lengthWidthCode) + { + case 0: + aircraft->setCell(ADSB_COL_LENGTH, ""); + aircraft->setCell(ADSB_COL_WIDTH, ""); + break; + case 1: + aircraft->setCell(ADSB_COL_LENGTH, 15); + aircraft->setCell(ADSB_COL_WIDTH, 23); + break; + case 2: + aircraft->setCell(ADSB_COL_LENGTH, 25); + aircraft->setCell(ADSB_COL_WIDTH, 28.5); + break; + case 3: + aircraft->setCell(ADSB_COL_LENGTH, 25); + aircraft->setCell(ADSB_COL_WIDTH, 34); + break; + case 4: + aircraft->setCell(ADSB_COL_LENGTH, 35); + aircraft->setCell(ADSB_COL_WIDTH, 33); + break; + case 5: + aircraft->setCell(ADSB_COL_LENGTH, 35); + aircraft->setCell(ADSB_COL_WIDTH, 38); + break; + case 6: + aircraft->setCell(ADSB_COL_LENGTH, 45); + aircraft->setCell(ADSB_COL_WIDTH, 39.5); + break; + case 7: + aircraft->setCell(ADSB_COL_LENGTH, 45); + aircraft->setCell(ADSB_COL_WIDTH, 45); + break; + case 8: + aircraft->setCell(ADSB_COL_LENGTH, 55); + aircraft->setCell(ADSB_COL_WIDTH, 45); + break; + case 9: + aircraft->setCell(ADSB_COL_LENGTH, 55); + aircraft->setCell(ADSB_COL_WIDTH, 52); + break; + case 10: + aircraft->setCell(ADSB_COL_LENGTH, 65); + aircraft->setCell(ADSB_COL_WIDTH, 59.5); + break; + case 11: + aircraft->setCell(ADSB_COL_LENGTH, 65); + aircraft->setCell(ADSB_COL_WIDTH, 67); + break; + case 12: + aircraft->setCell(ADSB_COL_LENGTH, 75); + aircraft->setCell(ADSB_COL_WIDTH, 72.5); + break; + case 13: + aircraft->setCell(ADSB_COL_LENGTH, 75); + aircraft->setCell(ADSB_COL_WIDTH, 80); + break; + case 14: + aircraft->setCell(ADSB_COL_LENGTH, 85); + aircraft->setCell(ADSB_COL_WIDTH, 80); + break; + case 15: + aircraft->setCell(ADSB_COL_LENGTH, 85); + aircraft->setCell(ADSB_COL_WIDTH, 90); + break; + } + } + else + { + // Reserved sub-type + } + + unsigned operationalMode = ((data[7] & 0xff) << 8) | (data[8] & 0xff); + bool tcasActive = (operationalMode >> 13) & 1; + bool identActive = (operationalMode >> 12) & 1; + + if (tcasActive) + { + aircraft->m_tcasAlert = true; + aircraft->setCell(ADSB_COL_TCAS, "RA"); + } + else if (aircraft->m_tcasOperationalValid) + { + aircraft->m_tcasAlert = false; + aircraft->setCell(ADSB_COL_TCAS, aircraft->m_tcasOperational ? QChar(0x2713) : QChar(0x2717)); // Tick or cross + } + else + { + aircraft->setCell(ADSB_COL_TCAS, ""); + } + aircraft->setCell(ADSB_COL_IDENT, identActive ? QChar(0x2713) : QChar(0x2717)); // Tick or cross + + } + } + else + { + // 23, 25, 26, 27, 30 reserved + //qDebug() << "ADSBDemodGUI: Unsupported tc" << tc << aircraft->m_icaoHex << aircraft->m_adsbFrameCount; + } + + // Horizontal containment radius limit (Rc) and Navigation integrity category (NIC) + if (tc == 0) + { + aircraft->setCell(ADSB_COL_RADIUS, "?"); + aircraft->m_radius = -1.0f; + aircraft->setCell(ADSB_COL_NIC, 0); + } + else if (tc == 5) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 7.5 m"); + aircraft->m_radius = 7.5f; + aircraft->setCell(ADSB_COL_NIC, 11); + } + else if (tc == 6) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 25 m"); + aircraft->m_radius = 25.0f; + aircraft->setCell(ADSB_COL_NIC, 10); + } + else if ((tc == 7) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 75 m"); + aircraft->m_radius = 75.0f; + aircraft->setCell(ADSB_COL_NIC, 9); + } + else if (tc == 7) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 0.1 NM"); + aircraft->m_radius = 185.2f; + aircraft->setCell(ADSB_COL_NIC, 8); + } + else if (tc == 8) + { + aircraft->setCell(ADSB_COL_RADIUS, ">= 0.1 NM"); + aircraft->m_radius = 185.2f; // ? + aircraft->setCell(ADSB_COL_NIC, 0); + } + else if (tc == 9) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 7.5 m"); + aircraft->m_radius = 7.5f; + aircraft->setCell(ADSB_COL_NIC, 11); + } + else if (tc == 10) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 25 m"); + aircraft->m_radius = 25.0f; + aircraft->setCell(ADSB_COL_NIC, 10); + } + else if ((tc == 11) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 75 m"); + aircraft->m_radius = 75.0f; + aircraft->setCell(ADSB_COL_NIC, 9); + } + else if (tc == 11) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 0.1 NM"); + aircraft->m_radius = 185.2f; + aircraft->setCell(ADSB_COL_NIC, 8); + } + else if (tc == 12) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 0.2 NM"); + aircraft->m_radius = 370.4f; + aircraft->setCell(ADSB_COL_NIC, 7); + } + else if ((tc == 13) && aircraft->m_nicSupplementAValid && !aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 0.3 NM"); + aircraft->m_radius = 555.6f; + aircraft->setCell(ADSB_COL_NIC, 6); + } + else if ((tc == 13) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 0.6 NM"); + aircraft->m_radius = 1111.2f; + aircraft->setCell(ADSB_COL_NIC, 6); + } + else if (tc == 13) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 0.5 NM"); + aircraft->m_radius = 926.0f; + aircraft->setCell(ADSB_COL_NIC, 6); + } + else if (tc == 14) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 1 NM"); + aircraft->m_radius = 1852.0f; + aircraft->setCell(ADSB_COL_NIC, 5); + } + else if (tc == 15) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 2 NM"); + aircraft->m_radius = 3704.0f; + aircraft->setCell(ADSB_COL_NIC, 4); + } + else if ((tc == 16) && aircraft->m_nicSupplementAValid && aircraft->m_nicSupplementA && aircraft->m_nicSupplementBValid && aircraft->m_nicSupplementB) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 4 NM"); + aircraft->m_radius = 7408.0f; + aircraft->setCell(ADSB_COL_NIC, 3); + } + else if (tc == 16) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 8 NM"); + aircraft->m_radius = 14816.0f; + aircraft->setCell(ADSB_COL_NIC, 2); + } + else if (tc == 17) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 20 NM"); + aircraft->m_radius = 37040.0f; + aircraft->setCell(ADSB_COL_NIC, 1); + } + else if (tc == 18) + { + aircraft->setCell(ADSB_COL_RADIUS, ">= 20 NM"); + aircraft->m_radius = 37040.0f; // ? + aircraft->setCell(ADSB_COL_NIC, 0); + } + else if (tc == 20) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 7.5 m"); + aircraft->m_radius = 7.5f; + aircraft->setCell(ADSB_COL_NIC, 11); + } + else if (tc == 21) + { + aircraft->setCell(ADSB_COL_RADIUS, "< 25 m"); + aircraft->m_radius = 25.0f; + aircraft->setCell(ADSB_COL_NIC, 10); + } + else if (tc == 22) + { + aircraft->setCell(ADSB_COL_RADIUS, ">= 25 m"); + aircraft->m_radius = 25.0f; // ? + aircraft->setCell(ADSB_COL_NIC, 0); + } + + // Update aircraft in map + if (aircraft->m_positionValid) + { + // Check to see if we need to start any animations + QList *animations = animate(dateTime, aircraft); + + // Update map displayed in channel. Coalesced, see flushMapUpdates + if (updateModel) { + markDirty(aircraft); + } + + if (m_loadingData) { + // A log is already decoded as fast as the tracker can consume it. Do not + // collapse its frames to one final map item: the intermediate positions, + // PFD state and model animations are the flight being replayed. + sendToMap(aircraft, animations, dateTime); + } else { + // Live traffic is coalesced on to the flush timer. + queueMapUpdate(aircraft, animations); + } + mapUpdated = true; + + if (resetAnimation) + { + // Wait until after model has changed before resetting + // otherwise animation might play on old model + aircraft->m_gearDown = false; + aircraft->m_tyresFlat = true; + aircraft->m_flaps = 0.0; + aircraft->m_engineStarted = false; + aircraft->m_rotorStarted = false; + } + } + } + else if (df == 18) + { + // TIS-B that doesn't match ADS-B formats, such as TIS-B management or Coarse TIB-B position (TODO) + qDebug() << "TIS B message cf=" << ca << " icao: " << QString::number(icao, 16); + } + else if ((df == 4) || (df == 5)) + { + decodeModeS(data, dateTime, df, aircraft); + } + else if ((df == 20) || (df == 21)) + { + decodeModeS(data, dateTime, df, aircraft); + decodeCommB(data, dateTime, df, aircraft, updatedCallsign); + } + else if (df == 11) + { + // All call reply + // Extract 6-bit IC (Interegator Code (II or SI)) which is the address of the Mode-S ground radar + int bytes = data.length(); + unsigned parity = ((data[bytes-3] & 0xff) << 16) | ((data[bytes-2] & 0xff) << 8) | (data[bytes-1] & 0xff); + unsigned ca = data[0] & 0x7; + unsigned d = (parity ^ crc); + unsigned ii = d & 0xf; + unsigned cl = (d >> 4) & 0x7; + bool siCode = cl > 0; + + if ((ca >= 1) && (ca <= 3)) { + return; + } + + if (cl <= 4) + { + unsigned si = ii + (16 * (cl - 1)); + unsigned ic = siCode ? si : ii; + + aircraft->setCell(ADSB_COL_IC, ic); + } + else + { + // This can happen quite frequency when running with a low correlation threshold + // So the IC map probably not very reliable in that case + //qDebug() << "ADSBDemodGUI: DF11 cl out of range" << Qt::hex << cl << d << parity << crc << aircraft->m_icaoHex << aircraft->m_adsbFrameCount; + return; + } + } + else if (df == 0) + { + // Short air-to-air ACAS (Airborne Collision Avoidance System) + //bool onSurface = (data[0] >> 2) & 1; + //unsigned crosslinkCapability = (data[0] >> 1) & 1; + unsigned spare1 = data[0] & 1; + //unsigned sensitivityLevel = (data[1] >> 5) & 0x7; + unsigned spare2 = (data[1] >> 3) & 0x3; + unsigned replyInfo = ((data[1] & 0x7) << 1) | ((data[2] >> 7) & 1); + unsigned spare3 = (data[2] >> 5) & 0x3; + + if ((spare1 != 0) || (spare2 != 0) || (spare3 != 0)) { + qDebug() << "df == 0, SPARE SET TO 1" << aircraft->m_icaoHex; + return; + } + + QString acasCapability; + switch (replyInfo) + { + case 0: + acasCapability = "No ACAS"; + break; + case 2: + acasCapability = "No RA"; + break; + case 3: + acasCapability = "V"; + break; + case 4: + acasCapability = "V+H"; + break; + } + if (!acasCapability.isEmpty()) { + aircraft->setCell(ADSB_COL_ACAS, acasCapability); + } + + QString maxSpeed; + switch (replyInfo) + { + case 8: + maxSpeed = "No data"; + break; + case 9: + maxSpeed = "<75"; + break; + case 10: + maxSpeed = "75-150"; + break; + case 11: + maxSpeed = "150-300"; + break; + case 12: + maxSpeed = "300-600"; + break; + case 13: + maxSpeed = "600-1200"; + break; + case 14: + maxSpeed = ">1200"; + break; + } + if (!maxSpeed.isEmpty()) { + aircraft->setCell(ADSB_COL_MAX_SPEED, maxSpeed); + } + + decodeModeSAltitude(data, dateTime, aircraft); + } + else if (df == 16) + { + // Long air-to-air ACAS (Airborne Collision Avoidance System) + + decodeModeSAltitude(data, dateTime, aircraft); + + unsigned dv = data[4] & 0xff; + unsigned replyInfo = ((data[1] & 0x7) << 1) | ((data[2] >> 7) & 1); + + QString acasCapability; + switch (replyInfo) + { + case 0: + acasCapability = "No ACAS"; + break; + case 2: + acasCapability = "No RA"; + break; + case 3: + acasCapability = "V"; + break; + case 4: + acasCapability = "V+H"; + break; + } + + if (!acasCapability.isEmpty()) { + // The DF0 branch below writes this cell; this one computed it and dropped it + aircraft->setCell(ADSB_COL_ACAS, acasCapability); + } + + if (dv == 0x30) + { + decodeRABroadcast(data, dateTime, aircraft); + } + else + { + decodeCommB(data, dateTime, df, aircraft, updatedCallsign); + } + } + else + { + qDebug() << "ADSBDemodGUI: Unsupported df" << df; + } + + // Comm-B and other Mode-S replies carry several PFD values too. Live operation can + // wait for the next coalesced update, but a replay must preserve the state produced + // by every input frame, including a final Mode-S frame with no later ADS-B squitter. + if (!mapUpdated && aircraft->m_positionValid) + { + QList *animations = animate(dateTime, aircraft); + if (updateModel) { + markDirty(aircraft); + } + if (m_loadingData) { + sendToMap(aircraft, animations, dateTime); + } else { + queueMapUpdate(aircraft, animations); + } + } + + // Update stats + m_dfStats[df]++; + updateDFStats(df); + if ((df == 17) || (df == 18)) { + m_adsbFrameRateCount++; + } else { + m_modesFrameRateCount++; + } + m_totalBytes += data.size(); + + aircraft->m_rxTime = dateTime; + aircraft->m_updateTime = QDateTime::currentDateTime(); + QTime time = aircraft->m_updateTime.time(); + aircraft->setCell(ADSB_COL_TIME, QString("%1:%2:%3").arg(time.hour(), 2, 10, QLatin1Char('0')).arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0'))); + if (df == 17) + { + aircraft->m_adsbFrameCount++; + aircraft->setCell(ADSB_COL_ADSB_FRAMECOUNT, aircraft->m_adsbFrameCount); + } + else if (df == 18) + { + if (ca == 0) + { + aircraft->m_nonTransponderFrameCount++; + aircraft->setCell(ADSB_COL_NON_TRANSPONDER, aircraft->m_nonTransponderFrameCount); + } + else if (ca == 6) + { + aircraft->m_adsrFrameCount++; + aircraft->setCell(ADSB_COL_ADSR_FRAMECOUNT, aircraft->m_adsrFrameCount); + } + else + { + aircraft->m_tisBFrameCount++; + aircraft->setCell(ADSB_COL_TIS_B_FRAMECOUNT, aircraft->m_tisBFrameCount); + } + } + else + { + aircraft->m_modesFrameCount++; + aircraft->setCell(ADSB_COL_MODES_FRAMECOUNT, aircraft->m_modesFrameCount); + } + aircraft->setCell(ADSB_COL_FRAMECOUNT, aircraft->m_adsbFrameCount + aircraft->m_tisBFrameCount + aircraft->m_modesFrameCount); + + if (correlation < aircraft->m_minCorrelation) + aircraft->m_minCorrelation = correlation; + if (correlation > aircraft->m_maxCorrelation) + aircraft->m_maxCorrelation = correlation; + m_correlationAvg(correlation); + aircraft->m_correlationAvg(correlation); + aircraft->m_correlation = aircraft->m_correlationAvg.instantAverage(); + aircraft->setCell(ADSB_COL_CORRELATION, QString("%1/%2/%3") + .arg(CalcDb::dbPower(aircraft->m_minCorrelation), 3, 'f', 1) + .arg(CalcDb::dbPower(aircraft->m_correlation), 3, 'f', 1) + .arg(CalcDb::dbPower(aircraft->m_maxCorrelation), 3, 'f', 1)); + m_correlationOnesAvg(correlationOnes); + aircraft->setCell(ADSB_COL_RSSI, QString("%1") + .arg(CalcDb::dbPower(m_correlationOnesAvg.instantAverage()), 3, 'f', 1)); + + // Check to see if we need to emit a notification about this aircraft + checkDynamicNotification(aircraft); + + // Update text below photo if it's likely to have changed + if (newAircraft || updatedCallsign) { + emit photoRefresh((quint32) aircraft->m_icao); + } + + PROFILER_STOP("ADS-B decode"); +} + +// Clear heading if much older than latest track figure or too different +void ADSBDemodTracker::clearOldHeading(ADSBAircraft *aircraft, const QDateTime& dateTime, float newTrack) +{ + if (aircraft->m_headingValid + && (aircraft->m_heading != newTrack) + && ( (std::abs(newTrack - aircraft->m_trackWhenHeadingSet) >= 5) + || (aircraft->m_headingDateTime.secsTo(dateTime) >= 10) + ) + ) + { + aircraft->m_headingValid = false; + aircraft->setCell(ADSB_COL_HEADING, ""); + } +} + +void ADSBDemodTracker::decodeID(const QByteArray& data, QString& emitterCategory, QString& callsign) +{ + // ADSBAircraft identification - BDS 0,8 + unsigned tc = ((data[4] >> 3) & 0x1f); // Type code + int ec = data[4] & 0x7; // Emitter category + + if (tc == 4) { + emitterCategory = m_categorySetA[ec]; + } else if (tc == 3) { + emitterCategory = m_categorySetB[ec]; + } else if (tc == 2) { + emitterCategory = m_categorySetC[ec]; + } else { + emitterCategory = QStringLiteral("Reserved"); + } + + // Flight/callsign - Extract 8 6-bit characters from 6 8-bit bytes, MSB first + unsigned char c[8]; + c[0] = (data[5] >> 2) & 0x3f; // 6 + c[1] = ((data[5] & 0x3) << 4) | ((data[6] & 0xf0) >> 4); // 2+4 + c[2] = ((data[6] & 0xf) << 2) | ((data[7] & 0xc0) >> 6); // 4+2 + c[3] = (data[7] & 0x3f); // 6 + c[4] = (data[8] >> 2) & 0x3f; + c[5] = ((data[8] & 0x3) << 4) | ((data[9] & 0xf0) >> 4); + c[6] = ((data[9] & 0xf) << 2) | ((data[10] & 0xc0) >> 6); + c[7] = (data[10] & 0x3f); + // Map to ASCII + char callsignASCII[9]; + for (int i = 0; i < 8; i++) + callsignASCII[i] = m_idMap[c[i]]; + callsignASCII[8] = '\0'; + callsign = QString(callsignASCII).trimmed(); +} + +bool ADSBDemodTracker::decodeGroundspeed(const QByteArray& data, float& v, float& h) +{ + int st = data[4] & 0x7; // Subtype - 2 is supersonic, with 4kt LSB + int lsb = (st == 2) ? 4 : 1; + int s_ew = (data[5] >> 2) & 1; // East-west velocity sign + int v_ew = ((data[5] & 0x3) << 8) | (data[6] & 0xff); // East-west velocity + int s_ns = (data[7] >> 7) & 1; // North-south velocity sign + int v_ns = ((data[7] & 0x7f) << 3) | ((data[8] >> 5) & 0x7); // North-south velocity + + // All-zeros means no velocity information available + if ((v_ew == 0) || (v_ns == 0)) { + return false; + } + + int v_we; + int v_sn; + + if (s_ew) { + v_we = -1 * (v_ew - 1); + } else { + v_we = v_ew - 1; + } + if (s_ns) { + v_sn = -1 * (v_ns - 1); + } else { + v_sn = v_ns - 1; + } + v_we *= lsb; + v_sn *= lsb; + v = std::round(std::sqrt(v_we*v_we + v_sn*v_sn)); + h = std::atan2(v_we, v_sn) * 360.0/(2.0*M_PI); + if (h < 0.0) { + h += 360.0; + } + return true; +} + +bool ADSBDemodTracker::decodeAirspeed(const QByteArray& data, bool& tas, int& as, bool& hdgValid, float& hdg) +{ + int st = data[4] & 0x7; // Subtype - 4 is supersonic, with 4kt LSB + int lsb = (st == 4) ? 4 : 1; + hdgValid = (data[5] >> 2) & 1; // Heading status + int hdgFix = ((data[5] & 0x3) << 8) | (data[6] & 0xff); // Heading + hdg = hdgFix / 1024.0f * 360.0f; + + tas = (data[7] >> 7) & 1; // Airspeed type (true or indicated) + int asFix = ((data[7] & 0x7f) << 3) | ((data[8] >> 5) & 0x7); // Airspeed + + // All-zeros means no airspeed information available + if (asFix == 0) { + return false; + } + as = (asFix - 1) * lsb; + return true; +} + +bool ADSBDemodTracker::decodeVerticalRate(const QByteArray& data, int& verticalRate) +{ + int s_vr = (data[8] >> 3) & 1; // Vertical rate sign + int vr = ((data[8] & 0x7) << 6) | ((data[9] >> 2) & 0x3f); // Vertical rate + + // All-zeros means no vertical rate information available + if (vr == 0) { + return false; + } + verticalRate = (vr-1)*64*(s_vr?-1:1); + return true; +} + +// Called when we have both lat & long +void ADSBDemodTracker::updateAircraftPosition(ADSBAircraft *aircraft, double latitude, double longitude, const QDateTime& dateTime) +{ + // Calculate range, azimuth and elevation to aircraft from station + m_azEl.setTarget(latitude, longitude, aircraft->m_altitudeValid ? Units::feetToMetres(aircraft->m_altitude) : 0); + m_azEl.calculate(); + + aircraft->m_latitude = latitude; + aircraft->m_longitude = longitude; + aircraft->setCell(ADSB_COL_LATITUDE, aircraft->m_latitude); + aircraft->setCell(ADSB_COL_LONGITUDE, aircraft->m_longitude); + aircraft->m_positionDateTime = dateTime; + aircraft->m_positionOnSurface = aircraft->m_onSurface; + aircraft->m_positionUpdates.append(ADSBAircraftPosition( + aircraft->m_latitude, + aircraft->m_longitude, + aircraft->m_altitude, + dateTime)); + + if (!aircraft->m_positionValid) + { + aircraft->m_positionValid = true; + // Now we have a position, add a plane to the map + markDirty(aircraft); + } + + aircraft->m_range = m_azEl.getDistance(); + aircraft->m_azimuth = m_azEl.getAzimuth(); + aircraft->m_elevation = m_azEl.getElevation(); + aircraft->setCell(ADSB_COL_RANGE, aircraft->m_range / 1000.0); + aircraft->setCell(ADSB_COL_AZEL, QString("%1/%2").arg(std::round(aircraft->m_azimuth)).arg(std::round(aircraft->m_elevation))); + if (aircraft == m_trackAircraft) { + m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation, aircraft->m_range); + } + if (m_azEl.getDistance() > m_maxRangeStat) + { + m_maxRangeStat = m_azEl.getDistance(); + setStat(MAX_RANGE, m_maxRangeStat / 1000.0); + } + if (aircraft->m_altitudeValid && (aircraft->m_altitude > m_maxAltitudeStat)) + { + m_maxAltitudeStat = aircraft->m_altitude; + setStat(MAX_ALTITUDE, m_maxAltitudeStat); + } + if (aircraft->m_altitudeValid) { + updateCoverageMap(m_azEl.getAzimuth(), m_azEl.getElevation(), m_azEl.getDistance(), aircraft->m_altitude); + } +} + +bool ADSBDemodTracker::validateGlobalPosition(double latitude, double longitude, bool countFailure) +{ + // Log files could be from anywhere, so allow any position + if (m_loadingData) { + return true; + } + + // Calculate range to aircraft from station + m_azEl.setTarget(latitude, longitude, 0); + m_azEl.calculate(); + + // Reasonableness test + if (m_azEl.getDistance() < 600000) + { + return true; + } + else if (countFailure) + { + m_rangeFails++; + setStat(RANGE_FAILS, m_rangeFails); + } + return false; +} + +// Called when we have lat & long from local decode and we need to check if it is in a valid range (<180nm/333km airborne or 45nm/83km for surface) +bool ADSBDemodTracker::validateLocalPosition(double latitude, double longitude, bool surfacePosition, bool countFailure) +{ + // Calculate range to aircraft from station + m_azEl.setTarget(latitude, longitude, 0); + m_azEl.calculate(); + + // Don't use the full 333km, as there may be some error in station position + if (m_azEl.getDistance() < (surfacePosition ? 80000 : 320000)) + { + return true; + } + else if (countFailure) + { + m_rangeFails++; + setStat(RANGE_FAILS, m_rangeFails); + } + return false; +} + +bool ADSBDemodTracker::decodeGlobalPosition(int f, const double cprLat[2], const double cprLong[2], const QDateTime cprTime[2], double& latitude, double& longitude, bool countFailure) +{ + // Calculate latitude + const double dLatEven = 360.0/60.0; + const double dLatOdd = 360.0/59.0; + double latEven, latOdd; + int ni, m; + + int j = std::floor(59.0f*cprLat[0] - 60.0f*cprLat[1] + 0.5); + latEven = dLatEven * (modulus(j, 60) + cprLat[0]); + // Southern hemisphere is in range 270-360, so adjust to -90-0 + if (latEven >= 270.0f) { + latEven -= 360.0f; + } + latOdd = dLatOdd * (modulus(j, 59) + cprLat[1]); + if (latOdd >= 270.0f) { + latOdd -= 360.0f; + } + if (cprTime[0] >= cprTime[1]) { + latitude = latEven; + } else { + latitude = latOdd; + } + if ((latitude <= 90.0) && (latitude >= -90.0)) + { + // Check if both frames in same latitude zone + int latEvenNL = cprNL(latEven); + int latOddNL = cprNL(latOdd); + + if (latEvenNL == latOddNL) + { + // Calculate longitude + if (!f) + { + ni = cprN(latEven, 0); + m = std::floor(cprLong[0] * (latEvenNL - 1) - cprLong[1] * latEvenNL + 0.5f); + longitude = (360.0f/ni) * (modulus(m, ni) + cprLong[0]); + } + else + { + ni = cprN(latOdd, 1); + m = std::floor(cprLong[0] * (latOddNL - 1) - cprLong[1] * latOddNL + 0.5f); + longitude = (360.0f/ni) * (modulus(m, ni) + cprLong[1]); + } + if (longitude > 180.0f) { + longitude -= 360.0f; + } + return validateGlobalPosition(latitude, longitude, countFailure); + } + else + { + return false; + } + } + else + { + return false; + } +} + +// Only valid if airborne within 180nm/333km (C.2.6.4) or 45nm for surface +bool ADSBDemodTracker::decodeLocalPosition(int f, double cprLat, double cprLong, bool onSurface, const QDateTime& dateTime, const ADSBAircraft *aircraft, double& latitude, double& longitude, bool countFailure) +{ + double refLatitude; + double refLongitude; + const bool useAircraftReference = hasUsableCprReference(aircraft, onSurface, dateTime); + + if (useAircraftReference) + { + refLatitude = aircraft->m_latitude; + refLongitude = aircraft->m_longitude; + } + else if (aircraft->m_globalPosition) + { + // The globally anchored reference is stale (or the replay timestamp moved + // backwards). Wait for another global pair instead of silently switching + // to the receiver position and selecting a different CPR zone. + return false; + } + else + { + refLatitude = m_azEl.getLocationSpherical().m_latitude; + refLongitude = m_azEl.getLocationSpherical().m_longitude; + } + + // Calculate latitude + const double maxDeg = onSurface ? 90.0 : 360.0; + const double dLatEven = maxDeg/60.0; + const double dLatOdd = maxDeg/59.0; + double dLat = f ? dLatOdd : dLatEven; + + int j = std::floor(refLatitude/dLat) + std::floor(modulus(refLatitude, dLat)/dLat - cprLat + 0.5); + latitude = dLat * (j + cprLat); + + // Calculate longitude + double dLong; + int latNL = cprNL(latitude); + if (f == 0) + { + if (latNL > 0) { + dLong = maxDeg / latNL; + } else { + dLong = maxDeg; + } + } + else + { + if ((latNL - 1) > 0) { + dLong = maxDeg / (latNL - 1); + } else { + dLong = maxDeg; + } + } + int m = std::floor(refLongitude/dLong) + std::floor(modulus(refLongitude, dLong)/dLong - cprLong + 0.5); + longitude = dLong * (m + cprLong); + + if (useAircraftReference) + { + // Doc 9871 C.2.6.10.3 applies this motion test only when the two + // position reports are no more than 30 seconds apart. + const qint64 age = aircraft->m_positionDateTime.msecsTo(dateTime); + if (age <= 30000) + { + double maxDistanceNm; + if (aircraft->m_positionOnSurface != onSurface) { + maxDistanceNm = 2.5; + } else { + maxDistanceNm = onSurface ? 0.75 : 6.0; + } + + const QGeoCoordinate reference(refLatitude, refLongitude); + const QGeoCoordinate decoded(latitude, longitude); + if (reference.distanceTo(decoded) >= maxDistanceNm * 1852.0) { + return false; + } + } + return true; + } + else + { + // Check position is within range of antenna + return validateLocalPosition(latitude, longitude, onSurface, countFailure); + } +} + +void ADSBDemodTracker::decodeCpr(const QByteArray& data, int& f, double& latCpr, double& lonCpr) const +{ + f = (data[6] >> 2) & 1; // CPR odd/even frame - should alternate every 0.2s + int latCprFix = ((data[6] & 3) << 15) | ((data[7] & 0xff) << 7) | ((data[8] >> 1) & 0x7f); + int lonCprFix = ((data[8] & 1) << 16) | ((data[9] & 0xff) << 8) | (data[10] & 0xff); + + latCpr = latCprFix / 131072.0; + lonCpr = lonCprFix / 131072.0; +} + +// This is relative to pressure of 1013.25 - it isn't corrected according to aircraft baro setting - so we can appear underground +bool ADSBDemodTracker::decodeAltitude(const QByteArray& data, int& altFt) const +{ + int alt = ((data[5] & 0xff) << 4) | ((data[6] >> 4) & 0xf); // Altitude + if (alt == 0) { + return false; + } + int q = (alt & 0x10) != 0; + int n = ((alt >> 1) & 0x7f0) | (alt & 0xf); // Remove Q-bit + + if (q == 1) { + altFt = n * ((alt & 0x10) ? 25 : 100) - 1000; + } else { + altFt = gillhamToFeet(n); + } + return true; +} + +// Mode S pressure altitude reported in 100ft or 25ft increments +// Note that we can get Mode-S altitude when still on the ground +void ADSBDemodTracker::decodeModeSAltitude(const QByteArray& data, const QDateTime dateTime, ADSBAircraft *aircraft) +{ + int altitude = 0; // Altitude in feet + int altitudeCode = ((data[2] & 0x1f) << 8) | (data[3] & 0xff); + + if (altitudeCode & 0x40) // M bit indicates metres + { + int altitudeMetres = ((altitudeCode & 0x1f80) >> 1) | (altitudeCode & 0x3f); + altitude = Units::metresToFeet(altitudeMetres); + } + else + { + // Remove M and Q bits + int altitudeFix = ((altitudeCode & 0x1f80) >> 2) | ((altitudeCode & 0x20) >> 1) | (altitudeCode & 0xf); + + // Convert to feet + if (altitudeCode & 0x10) { + altitude = altitudeFix * 25 - 1000; + } else { + altitude = gillhamToFeet(altitudeFix); + } + } + + // We can frequently get false decodes of df 4 frames, so check altitude is reasonable, based on previous value + // If greater than an unlikely climb rate, ignore, as we don't want the aircraft jumping around the 3D map + bool altUnlikely = false; + if (aircraft->m_altitudeValid) + { + int altDiff = abs(aircraft->m_altitude - altitude); + if (altDiff > 500) + { + qint64 msecs = aircraft->m_altitudeDateTime.msecsTo(dateTime); + float climbRate = altDiff / (msecs / (1000.0f * 60.0f)); + if (climbRate > 6000.0f) + { + altUnlikely = true; + m_altFails++; + setStat(ALT_FAILS, m_altFails); + } + } + } + if (!altUnlikely) { + aircraft->setAltitude(altitude, false, dateTime, m_settings); + } +} + +void ADSBDemodTracker::decodeModeS(const QByteArray data, const QDateTime dateTime, int df, ADSBAircraft *aircraft) +{ + bool wasOnSurface = aircraft->m_onSurface; + bool takenOff = false; + + int flightStatus = data[0] & 0x7; + if ((flightStatus == 0) || (flightStatus == 2)) + { + takenOff = wasOnSurface; + aircraft->m_onSurface = false; + aircraft->m_onSurfaceValid = true; + } + else if ((flightStatus == 1) || (flightStatus == 3)) + { + aircraft->m_onSurface = true; + aircraft->m_onSurfaceValid = true; + } + if (wasOnSurface != aircraft->m_onSurface) + { + // Can't mix CPR values used on surface and those that are airborne + aircraft->m_cprValid[0] = false; + aircraft->m_cprValid[1] = false; + } + + if ((df == 4) || (df == 20)) + { + decodeModeSAltitude(data, dateTime, aircraft); + + // Assume runway elevation is at first reported airboune altitude + if (takenOff) + { + aircraft->m_runwayAltitude = aircraft->m_altitude; + aircraft->m_runwayAltitudeValid = true; + } + } + else if ((df == 5) || (df == 21)) + { + // Squawk ident code + int identCode = ((data[2] & 0x1f) << 8) | (data[3] & 0xff); + int squawk = squawkDecode(identCode); + // SPI (IDENT) is indicated in the flight status field, not the identity field + bool spi = (flightStatus == 4) || (flightStatus == 5); + + if ((squawk != aircraft->m_squawk) || (spi != aircraft->m_spi)) + { + aircraft->m_squawk = squawk; + aircraft->m_spi = spi; + if (spi) { + aircraft->setCell(ADSB_COL_SQUAWK, QString("%1 IDENT").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); + } else { + aircraft->setCell(ADSB_COL_SQUAWK, QString("%1").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); + } + } + } +} + +// TCAS/ACAS active resolution advisory report - the 56-bit BDS 3,0 layout, which is +// carried in three different places: the MV field of a DF16 air-air reply (VDS=0x30), +// the MB field of a DF20/21 Comm-B reply, and the ME field of a DF17 TC=28 subtype 2 +// RA broadcast. Byte 4 differs between them (VDS / BDS / TC+ST) but ARA, RACs, RAT, +// MTE, TTI and TID sit at the same offsets in all three, so one decoder serves them all +void ADSBDemodTracker::decodeRABroadcast(const QByteArray data, const QDateTime dateTime, ADSBAircraft *aircraft) +{ + unsigned activeRAs = ((data[5] & 0xff) << 6) | ((data[6] >> 2) & 0x3f); // ARA, bits 41-54 + unsigned racs = ((data[6] & 0x3) << 2) | ((data[7] >> 6) & 0x3); + bool raTerminated = (data[7] >> 5) & 1; + bool multipleThreats = (data[7] >> 4) & 1; + unsigned threatType = (data[7] >> 2) & 0x3; + + // ARA bit 41 selects the coding of bits 42-47; it is not by itself a + // one-threat indication. With MTE set, it distinguishes same-sense RAs + // (bit 41 set) from opposite-sense RAs (bit 41 clear). + const bool singleOrSameSenseRA = (activeRAs >> 13) & 0x1; + QString threats; + if (multipleThreats) { + threats = singleOrSameSenseRA ? "Multiple threats (same-sense RAs)" : "Multiple threats (opposite-sense RAs)"; + } else { + threats = singleOrSameSenseRA ? "One threat" : "No threats"; + } + + QStringList racStrings; + if (racs & 1) { + racStrings.append("Do not turn right"); + } + if (racs & 2) { + racStrings.append("Do not turn left"); + } + if (racs & 4) { + racStrings.append("Do not pass above"); + } + if (racs & 8) { + racStrings.append("Do not pass below"); + } + + unsigned threatICAO = 0; + QString threatData; + if (threatType == 1) + { + threatICAO = ((data[7] & 0x3) << 22) | ((data[8] & 0xff) << 14) | ((data[9] & 0xff) << 6) | ((data[10] >> 2) & 0x3f); + threatData = QString::number(threatICAO, 16); + } + + if (raTerminated) + { + aircraft->setCell(ADSB_COL_RA, "RA terminated"); + } + else + { + QStringList s; + s.append(threats); + s.append(racStrings.join("")); + s.append(threatData); + aircraft->setCell(ADSB_COL_RA, s.join(" ")); + } + + // Typed state for the map's PFD/ND. With ARA bit 41 set, bits 42-47 + // use the single/same-sense coding (bit 42 corrective, 43 downward sense, + // 47 positive rather than a vertical speed limit). With bit 41 clear and + // MTE set, bits 42-45 independently describe upward/downward corrections. + const bool active = (singleOrSameSenseRA || multipleThreats) && !raTerminated; + aircraft->m_raOppositeSense = multipleThreats && !singleOrSameSenseRA; + if (singleOrSameSenseRA) + { + aircraft->m_raCorrective = (activeRAs >> 12) & 1; // ARA bit 42 + aircraft->m_raDownward = (activeRAs >> 11) & 1; // ARA bit 43 + aircraft->m_raPositive = (activeRAs >> 7) & 1; // ARA bit 47 + } + else if (multipleThreats) + { + const bool requiresClimb = (activeRAs >> 12) & 1; // ARA bit 42 + const bool positiveClimb = (activeRAs >> 11) & 1; // ARA bit 43 + const bool requiresDescend = (activeRAs >> 10) & 1; // ARA bit 44 + const bool positiveDescend = (activeRAs >> 9) & 1; // ARA bit 45 + aircraft->m_raCorrective = requiresClimb || requiresDescend; + aircraft->m_raDownward = requiresDescend && !requiresClimb; + aircraft->m_raPositive = requiresClimb != requiresDescend + ? (requiresClimb ? positiveClimb : positiveDescend) + : false; + } + aircraft->m_raActive = active; + aircraft->m_raTerminated = raTerminated; + aircraft->m_raMultipleThreats = multipleThreats; + aircraft->m_raThreatIcao = threatICAO; + aircraft->m_raDateTime = dateTime; + if (active) { + aircraft->m_tcasAlert = true; + aircraft->setCell(ADSB_COL_TCAS, "RA"); + } +} + +void ADSBDemodTracker::decodeCommB(const QByteArray data, const QDateTime dateTime, int df, ADSBAircraft *aircraft, bool &updatedCallsign) +{ + // We only see downlink messages, so do not know the data format, so have to decode all possibilities + // and then see which have legal values and values that are consistent with ADS-B data + + // All IFR aircraft should support ELS (Elementary Surveillance) which includes BDS 1,0 1,7 2,0 3,0 + // Large aircraft are also required to support EHS (Enhanced Surveillance) which adds BDS 4,0 5,0 6,0 + // There is also MRAR (Meteorological Routine Air Report) BDS 4,4 4,5, but only a small % of aircraft support this + // See: https://www.icao.int/APAC/Documents/edocs/Mode%20S%20DAPs%20Implementation%20and%20Operations%20Guidance%20Document3.0.pdf + + // I've implemented a few extra BDSes, but these are rarely seen. + // Figure 2 in "Mode S Transponder Comm-B Capabilities in Current Operational ADSBAircraft" gives a breakdown of what capabilities are reported by BDS 1,7: + // https://www.researchgate.net/publication/346521949_Mode_S_Transponder_Comm-B_Capabilities_in_Current_Operational_Aircraft/link/5fc60b794585152e9be8571c/download + + // Skip messages that are all zeros + if (data[4] || data[5] || data[6] || data[7] || data[8] || data[9] || data[10]) + { + + const int maxWind = 250; // Maximum expected head/tail wind in knts + const int maxSpeedDiff = 50; // Maximum speed difference we allow before we assume message is inconsistent + const int maxAlt = 46000; // Maximum expected altitude for commercial jet + const float maxHeadingDiff = 20.0f; // Maximum difference in heading/track + + // BDS 0,5 - Extended squitter airborne position (tc=11 typically seen in DF16) + + int altitude_0_5; + bool altitudeValid_0_5 = decodeAltitude(data, altitude_0_5); + // Require an altitude having been received by other means, otherwise too high chance of it being incorrect + bool altitudeInconsistent_0_5 = !altitudeValid_0_5 || (aircraft->m_altitudeValid && isAltitudeInconsistent(altitude_0_5, aircraft->m_altitude)); + + const unsigned tc = ((data[4] >> 3) & 0x1f); + bool tcInconsistent = !((tc == 0) || ((tc >= 5) && (tc <= 8)) || ((tc >= 9) && (tc <= 18)) || ((tc >= 20) && (tc <= 22))); // Only position type codes + + int f; + double latCpr, lonCpr; + decodeCpr(data, f, latCpr, lonCpr); + bool cprValid[2] = {f ? aircraft->m_cprValid[0] : true, f ? true : aircraft->m_cprValid[1]}; + double cprLat[2] = {f ? aircraft->m_cprLat[0] : latCpr, f ? latCpr : aircraft->m_cprLat[1]}; + double cprLon[2] = {f ? aircraft->m_cprLong[0] : lonCpr, f ? lonCpr : aircraft->m_cprLong[1]}; + QDateTime cprTime[2] = {f ? aircraft->m_cprTime[0] : dateTime, f ? dateTime : aircraft->m_cprTime[1]}; + double latitude_0_5, longitude_0_5; + double positionValid_0_5 = false; + if (cprValid[0] && cprValid[1] + && (std::abs(cprTime[0].toMSecsSinceEpoch() - cprTime[1].toMSecsSinceEpoch()) <= 8500) + && !aircraft->m_onSurface) + { + if (decodeGlobalPosition(f, cprLat, cprLon, cprTime, latitude_0_5, longitude_0_5, false)) { + positionValid_0_5 = true; + } + } + else + { + if (decodeLocalPosition(f, cprLat[f], cprLon[f], aircraft->m_onSurface, dateTime, aircraft, latitude_0_5, longitude_0_5, false)) { + positionValid_0_5 = true; + } + } + // Require a position having been received by other means, otherwise too high chance of it being incorrect + bool positionInconsistent_0_5 = !positionValid_0_5 || (aircraft->m_positionValid && isPositionInconsistent(aircraft->m_latitude, aircraft->m_longitude, latitude_0_5, longitude_0_5)); + + bool bds_0_5 = ((tc >= 9) && (tc <= 18)) && !positionInconsistent_0_5 && !altitudeInconsistent_0_5 && !tcInconsistent; + + // BDS 0,8 - ADSBAircraft identification and category + + QString emitterCategory, callsign_0_8; + + decodeID(data, emitterCategory, callsign_0_8); + + bool emitterCategoryInconsistent = (emitterCategory == "Reserved") || (emitterCategory != aircraft->m_emitterCategory); + bool callsignInconsistent_0_8 = callsign_0_8.isEmpty() || callsign_0_8.contains('#'); // Callsign can change between flights + + bool bds_0_8 = ((tc >= 1) && (tc <= 4)) && !emitterCategoryInconsistent && !callsignInconsistent_0_8; + + // BDS 0,9 - Airborne Velocity + + int st = data[4] & 0x7; // Subtype + bool groundspeedSubType = (st == 1) || (st == 2); + bool airspeedSubType = (st == 3) || (st == 4); + float groundspeed_0_9 = 0.0f, track = 0.0f; + bool airspeedType_0_9 = false; + int airspeed = 0; + bool headingValid = false; + float heading = 0.0f; + bool groundspeedValid_0_9 = false; + bool airspeedValid_0_9 = false; + if (groundspeedSubType) + { + // Ground speed + groundspeedValid_0_9 = decodeGroundspeed(data, groundspeed_0_9, track); + } + else if (airspeedSubType) + { + // Airspeed + airspeedValid_0_9 = decodeAirspeed(data, airspeedType_0_9, airspeed, headingValid, heading); + } + int verticalRate = 0; + bool verticalRateValid_0_9 = decodeVerticalRate(data, verticalRate); + + bool groundspeedInconsistent = groundspeedSubType + && groundspeedValid_0_9 + && ((aircraft->m_groundspeedValid && isSpeedInconsistent(groundspeed_0_9, aircraft->m_groundspeed)) + || (aircraft->m_trackValid && isHeadingInconsistent(track, aircraft->m_track))); + bool airspeedInconsistent = airspeedSubType + && ((airspeedValid_0_9 + && (airspeedType_0_9 ? aircraft->m_trueAirspeedValid : aircraft->m_indicatedAirspeedValid) + && isSpeedInconsistent(airspeed, airspeedType_0_9 ? aircraft->m_trueAirspeed : aircraft->m_indicatedAirspeed)) + || (headingValid && aircraft->m_headingValid && isHeadingInconsistent(heading, aircraft->m_heading))); + bool verticalRateInconsistent = verticalRateValid_0_9 && aircraft->m_verticalRateValid && isVerticalRateInconsistent(verticalRate, aircraft->m_verticalRate); + + // Require at least one valid subfield, so a frame that happens to have subtype bits 1-4 but + // no usable content can't consume the single-match slot for other registers + bool bds_0_9 = (tc == 19) + && (groundspeedSubType || airspeedSubType) + && (groundspeedValid_0_9 || airspeedValid_0_9 || (airspeedSubType && headingValid) || verticalRateValid_0_9) + && !groundspeedInconsistent && !airspeedInconsistent && !verticalRateInconsistent; + + // BDS 1,0 - ELS + + bool bds_1_0 = ((data[4] & 0xff) == 0x10) && ((data[5] & 0x7c) == 0x00); + + // BDS 1,7 - Common usage GICB capability report - ELS + + bool cap_0_5 = (data[4] >> 7) & 0x1; + bool cap_0_6 = (data[4] >> 6) & 0x1; + bool cap_0_7 = (data[4] >> 5) & 0x1; + bool cap_0_8 = (data[4] >> 4) & 0x1; + bool cap_0_9 = (data[4] >> 3) & 0x1; + bool cap_0_a = (data[4] >> 2) & 0x1; + bool cap_2_0 = (data[4] >> 1) & 0x1; + bool cap_2_1 = (data[4] >> 0) & 0x1; + + bool cap_4_0 = (data[5] >> 7) & 0x1; + bool cap_4_1 = (data[5] >> 6) & 0x1; + bool cap_4_2 = (data[5] >> 5) & 0x1; + bool cap_4_3 = (data[5] >> 4) & 0x1; + bool cap_4_4 = (data[5] >> 3) & 0x1; + bool cap_4_5 = (data[5] >> 2) & 0x1; + bool cap_4_8 = (data[5] >> 1) & 0x1; + bool cap_5_0 = (data[5] >> 0) & 0x1; + + bool cap_5_1 = (data[6] >> 7) & 0x1; + bool cap_5_2 = (data[6] >> 6) & 0x1; + bool cap_5_3 = (data[6] >> 5) & 0x1; + bool cap_5_4 = (data[6] >> 4) & 0x1; + bool cap_5_5 = (data[6] >> 3) & 0x1; + bool cap_5_6 = (data[6] >> 2) & 0x1; + bool cap_5_f = (data[6] >> 1) & 0x1; + bool cap_6_0 = (data[6] >> 0) & 0x1; + + QStringList caps; + if (cap_0_5) { + caps.append("0,5"); + } + if (cap_0_6) { + caps.append("0,6"); + } + if (cap_0_7) { + caps.append("0,7"); + } + if (cap_0_8) { + caps.append("0,8"); + } + if (cap_0_9) { + caps.append("0,9"); + } + if (cap_0_a) { + caps.append("0,A"); + } + if (cap_2_0) { + caps.append("2,0"); + } + if (cap_2_1) { + caps.append("2,1"); + } + if (cap_4_0) { + caps.append("4,0"); + } + if (cap_4_1) { + caps.append("4,1"); + } + if (cap_4_2) { + caps.append("4,2"); + } + if (cap_4_3) { + caps.append("4,3"); + } + if (cap_4_4) { + caps.append("4,4"); + } + if (cap_4_5) { + caps.append("4,5"); + } + if (cap_4_8) { + caps.append("4,8"); + } + if (cap_5_0) { + caps.append("5,0"); + } + if (cap_5_1) { + caps.append("5,1"); + } + if (cap_5_2) { + caps.append("5,2"); + } + if (cap_5_3) { + caps.append("5,3"); + } + if (cap_5_4) { + caps.append("5,4"); + } + if (cap_5_5) { + caps.append("5,5"); + } + if (cap_5_6) { + caps.append("5,6"); + } + if (cap_5_f) { + caps.append("5,F"); + } + if (cap_6_0) { + caps.append("6,0"); + } + + bool bds_1_7 = cap_2_0 && (data[7] == 0x0) && (data[8] == 0x0) && (data[9] == 0x0) && (data[10] == 0x0); + + // BDS 1,8 1,9 1,A 1,B 1,C 1,D 1,E 1,F Mode S specific services + + // Apart from 1,C and 1,F these can have any bits set/clear and specify BDS code capabilities + // Don't decode for now + + // BDS 2,0 - ADSBAircraft identification - ELS + + // Flight/callsign - Extract 8 6-bit characters from 6 8-bit bytes, MSB first + unsigned char c[9]; + char callsignASCII[9]; + c[0] = (data[5] >> 2) & 0x3f; // 6 + c[1] = ((data[5] & 0x3) << 4) | ((data[6] & 0xf0) >> 4); // 2+4 + c[2] = ((data[6] & 0xf) << 2) | ((data[7] & 0xc0) >> 6); // 4+2 + c[3] = (data[7] & 0x3f); // 6 + c[4] = (data[8] >> 2) & 0x3f; + c[5] = ((data[8] & 0x3) << 4) | ((data[9] & 0xf0) >> 4); + c[6] = ((data[9] & 0xf) << 2) | ((data[10] & 0xc0) >> 6); + c[7] = (data[10] & 0x3f); + // Map to ASCII + for (int i = 0; i < 8; i++) { + callsignASCII[i] = m_idMap[c[i]]; + } + callsignASCII[8] = '\0'; + QString callsignTrimmed = QString(callsignASCII).trimmed(); + bool invalidCallsign = QString(callsignASCII).contains('#'); + bool bds_2_0 = ((data[4] & 0xff) == 0x20) && !invalidCallsign; + + // BDS 2,1 - ADSBAircraft and airline registration markings + + bool aircraftRegistrationStatus = (data[4] >> 7) & 0x1; + char aircraftRegistration[8]; + c[0] = (data[4] >> 1) & 0x3f; + c[1] = ((data[4] & 0x1) << 5) | ((data[5] >> 3) & 0x1f); + c[2] = ((data[5] & 0x7) << 3) | ((data[6] >> 5) & 0x7); + c[3] = ((data[6] & 0x1f) << 1) | ((data[7] >> 7) & 0x1); + c[4] = ((data[7] >> 1) & 0x1f); + c[5] = ((data[7] & 0x1) << 5) | ((data[8] >> 3) & 0x1f); + c[6] = ((data[8] & 0x7) << 3) | ((data[9] >> 5) & 0x7); + // Map to ASCII + for (int i = 0; i < 7; i++) { + aircraftRegistration[i] = m_idMap[c[i]]; + } + aircraftRegistration[7] = '\0'; + QString aircraftRegistrationString = QString(aircraftRegistration).trimmed(); + bool aircraftRegistrationInvalid = QString(aircraftRegistrationString).contains('#'); + bool aircraftRegistrationInconsistent = !aircraftRegistrationStatus && (c[0] || c[1] || c[2] || c[3] || c[4] || c[5] || c[6]); + + bool airlineRegistrationStatus = (data[9] >> 4) & 0x1; + char airlineRegistration[3]; + c[0] = ((data[9] & 0xf) << 2) | ((data[10] >> 6) & 0x3); + c[1] = data[10] & 0x3f; + // Map to ASCII + for (int i = 0; i < 2; i++) { + airlineRegistration[i] = m_idMap[c[i]]; + } + airlineRegistration[2] = '\0'; + QString airlineRegistrationString = QString(airlineRegistration).trimmed(); + bool airlineRegistrationInvalid = QString(airlineRegistrationString).contains('#') || !QChar(QLatin1Char(airlineRegistration[0])).isLetter() || !QChar(QLatin1Char(airlineRegistration[1])).isLetter(); + bool airlineRegistrationInconsistent = !airlineRegistrationStatus && (c[0] || c[1]); + + bool bds_2_1 = !aircraftRegistrationInvalid && !aircraftRegistrationInconsistent && !airlineRegistrationInvalid && !airlineRegistrationInconsistent; + + // BDS 3,0 - ACAS active resolution advisory - ELS + + int acas = data[6] & 0x7f; + int threatType = (data[7] >> 2) & 0x3; + bool bds_3_0 = ((data[4] & 0xff) == 0x30) && (acas < 48) && (threatType != 3); + + // BDS 4,0 - Selected vertical information - EHS + + bool mcpSelectedAltStatus = (data[4] >> 7) & 0x1; + int mcpSelectedAltFix = ((data[4] & 0x7f) << 5) | ((data[5] >> 3) & 0x1f); + int mcpSelectedAlt = mcpSelectedAltFix * 16; // ft + bool mcpSelectedAltInconsistent = (mcpSelectedAlt > maxAlt) || (!mcpSelectedAltStatus && (mcpSelectedAltFix != 0)); + + bool fmsSelectedAltStatus = (data[5] >> 2) & 0x1; + int fmsSelectedAltFix = ((data[5] & 0x3) << 10) | ((data[6] & 0xff) << 2) | ((data[7] >> 6) & 0x3); + int fmsSelectedAlt = fmsSelectedAltFix * 16; // ft + bool fmsSelectedAltInconsistent = (fmsSelectedAlt > maxAlt) || (!fmsSelectedAltStatus && (fmsSelectedAltFix != 0)); + + bool baroSettingStatus = (data[7] >> 5) & 0x1; + int baroSettingFix = ((data[7] & 0x1f) << 7) | ((data[8] >> 1) & 0x7f); + float baroSetting = baroSettingFix * 0.1f + 800.0f; // mb + bool baroSettingIncosistent = !baroSettingStatus && (baroSettingFix != 0); + + bool modeStatus = data[9] & 0x1; + bool vnavMode = (data[10] >> 7) & 0x1; + bool altHoldMode = (data[10] >> 6) & 0x1; + bool approachMode = (data[10] >> 5) & 0x1; + bool modeInconsistent = !modeStatus && (vnavMode || altHoldMode || approachMode); + + bool targetAltSourceStatus = (data[10] >> 2) & 0x1; + int targetAltSource = data[10] & 0x3; + bool targetAltSourceInconsistent = !targetAltSourceStatus && (targetAltSource != 0); + + bool bds_4_0 = ((data[8] & 0x01) == 0x0) && ((data[9] & 0xfe) == 0x0) && ((data[10] & 0x18) == 0x0) + && !mcpSelectedAltInconsistent && !fmsSelectedAltInconsistent && !baroSettingIncosistent && !modeInconsistent && !targetAltSourceInconsistent; + + // BDS 4,1 - Next waypoint + + bool waypointStatus = (data[4] >> 7) & 0x1; + char waypoint[10]; + c[0] = (data[4] >> 1) & 0x3f; + c[1] = ((data[4] & 0x1) << 5) | ((data[5] >> 3) & 0x1f); + c[2] = ((data[5] & 0x7) << 3) | ((data[6] >> 5) & 0x7); + c[3] = ((data[6] & 0x1f) << 1) | ((data[7] >> 7) & 0x1); + c[4] = ((data[7] >> 1) & 0x1f); + c[5] = ((data[7] & 0x1) << 5) | ((data[8] >> 3) & 0x1f); + c[6] = ((data[8] & 0x7) << 3) | ((data[9] >> 5) & 0x7); + c[7] = ((data[9] & 0x1f) << 1) | ((data[10] >> 7) & 0x1); + c[8] = ((data[10] >> 1) & 0x3f); + // Map to ASCII + for (int i = 0; i < 9; i++) { + waypoint[i] = m_idMap[c[i]]; + } + waypoint[9] = '\0'; + QString waypointString = QString(waypoint).trimmed(); + bool waypointInvalid = QString(waypointString).contains('#'); + bool waypointInconsistent = (waypointString.size() != 5) // Most navaid waypoints are 5 characters, and this prevents some incorrect matches, but is it correct? Need examples. + || (!waypointStatus && (c[0] || c[1] || c[2] || c[3] || c[4] || c[5] || c[6] || c[7] || c[8])); + + bool bds_4_1 = !waypointInvalid && !waypointInconsistent; + + // BDS 4,4 - Meteorological routine air report - MRAR - (Appendix E suggests a slightly different format in the future) + + int fomSource = (data[4] >> 4) & 0xf; + bool fomSourceInconsistent = fomSource > 4; + + bool windSpeedStatus = (data[4] >> 3) & 0x1; + int windSpeedFix = ((data[4] & 0x7) << 6) | ((data[5] >> 2) & 0x3f); + int windSpeed = windSpeedFix; // knots + int windDirectionFix = ((data[5] & 0x3) << 7) | ((data[6] >> 1) & 0x7f); + int windDirection = windDirectionFix * 180.0f / 256.0f; // Degrees + bool windSpeedInconsistent = (windSpeed > 250.0f) || (!windSpeedStatus && ((windSpeedFix != 0) || (windDirectionFix != 0))); + + int staticAirTemperatureFix = ((data[6] & 0x1) << 10) | ((data[7] & 0xff) << 2) | ((data[8] >> 6) & 0x3); + staticAirTemperatureFix = (staticAirTemperatureFix << 21) >> 21; + float staticAirTemperature = staticAirTemperatureFix * 0.25f; + bool staticAirTemperatureInconsistent = (staticAirTemperature < -80.0f) || (staticAirTemperature > 60.0f); + + bool averageStaticPressureStatus = (data[8] >> 5) & 0x1; + int averageStaticPressureFix = ((data[8] & 0x1f) << 6) | ((data[9] >> 2) & 0x3f); + int averageStaticPressure = averageStaticPressureFix; // hPa + bool averageStaticPressureInconsistent = !averageStaticPressureStatus && (averageStaticPressureFix != 0); + + bool turbulenceStatus = (data[9] >> 1) & 0x1; + int turbulence = ((data[9] & 0x1) << 1) | ((data[10] >> 7) & 0x1); + bool turbulenceInconsistent = !turbulenceStatus && (turbulence != 0); + + bool humidityStatus = (data[10] >> 6) & 0x1; + int humidityFix = data[10] & 0x3f; + float humidity = humidityFix * 100.0f / 64.0f; // % + bool humidityInconsistent = (humidity > 100.0) || (!humidityStatus && (humidityFix != 0)); + + // Occasionally get frames: 20000000000000 or 08000000000000 - these seem unlikely to be BDS 4,4 + bool noMetData = (((data[4] & 0xff) == 0x20) || ((data[4] & 0xff) == 0x08)) && !(data[5] || data[6] || data[7] || data[8] || data[9] || data[10]); + + bool bds_4_4 = !noMetData && !fomSourceInconsistent && !windSpeedInconsistent && !staticAirTemperatureInconsistent && !averageStaticPressureInconsistent && !turbulenceInconsistent && !humidityInconsistent; + + // BDS 4,5 - Meteorological hazard report - MRAR - (Appendix E suggests a slightly different format in the future) + + bool hazardTurbulenceStatus = (data[4] >> 7) & 0x1; + int hazardTurbulence = (data[4] >> 5) & 0x3; + bool hazardTurbulenceInconsistent = !hazardTurbulenceStatus && (hazardTurbulence != 0); + + bool hazardWindShearStatus = (data[4] >> 4) & 0x1; + int hazardWindShear = (data[4] >> 2) & 0x3; + bool hazardWindShearInconsistent = !hazardWindShearStatus && (hazardWindShear != 0); + + bool hazardMicroburstStatus = (data[4] >> 1) & 0x1; + int hazardMicroburst = ((data[4] & 0x1) << 1) | ((data[5] >> 7) & 0x1); + bool hazardMicroburstInconsistent = !hazardMicroburstStatus && (hazardMicroburst != 0); + + bool hazardIcingStatus = (data[5] >> 6) & 0x1; + int hazardIcing = ((data[5] >> 4) & 0x3); + bool hazardIcingInconsistent = !hazardIcingStatus && (hazardIcing != 0); + + bool hazardWakeVortexStatus = (data[5] >> 3) & 0x1; + int hazardWakeVortex = ((data[5] >> 1) & 0x3); + bool hazardWakeVortexInconsistent = !hazardWakeVortexStatus && (hazardWakeVortex != 0); + + bool hazardStaticAirTemperatureStatus = data[5] & 0x1; + int hazardStaticAirTemperatureFix = ((data[6] & 0xff) << 2) | ((data[7] >> 6) & 0x3); + hazardStaticAirTemperatureFix = (hazardStaticAirTemperatureFix << 22) >> 22; + float hazardStaticAirTemperature = hazardStaticAirTemperatureFix * 0.25f; // deg C + bool hazardStaticAirTemperatureInconsistent = (hazardStaticAirTemperature < -80.0f) || (hazardStaticAirTemperature > 60.0f) || (!hazardStaticAirTemperatureStatus && (hazardStaticAirTemperatureFix != 0)); + + bool hazardAverageStaticPressureStatus = (data[7] >> 5) & 0x1; + int hazardAverageStaticPressureFix = ((data[7] & 0x1f) << 6) | ((data[8] >> 2) & 0x3f); + int hazardAverageStaticPressure = hazardAverageStaticPressureFix; // hPa + bool hazardAverageStaticPressureInconsistent = !hazardAverageStaticPressureStatus && (hazardAverageStaticPressureFix != 0); + + bool hazardRadioHeightStatus = (data[8] >> 1) & 0x1; + int hazardRadioHeightFix = ((data[8] & 0x1) << 11) | ((data[9] & 0xff) << 3) | ((data[10] >> 5) & 0x7); + int hazardRadioHeight = hazardRadioHeightFix * 16; // Ft + bool hazardRadioHeightInconsistent = (hazardRadioHeight > maxAlt) || (!aircraft->m_onSurface && (hazardRadioHeight == 0)) || (!hazardRadioHeightStatus && (hazardRadioHeightFix != 0)); + + bool hazardReserveredInconsistent = (data[10] & 0x1f) != 0; + + bool harzardIcingTempInconsistent = hazardIcingStatus && hazardStaticAirTemperatureStatus && (hazardIcing != 0) && ((hazardStaticAirTemperature >= 20.0f) || (hazardStaticAirTemperature <= -40.0f)); + + bool bds_4_5 = !hazardTurbulenceInconsistent && !hazardWindShearInconsistent && !hazardMicroburstInconsistent && !hazardIcingInconsistent + && !hazardWakeVortexInconsistent && !hazardStaticAirTemperatureInconsistent && !hazardAverageStaticPressureInconsistent + && !hazardRadioHeightInconsistent && !hazardReserveredInconsistent && !harzardIcingTempInconsistent; + + // BDS 5,0 - Track and turn report - EHS + + bool rollAngleStatus = (data[4] >> 7) & 0x1; + int rollAngleFix = ((data[4] & 0x7f) << 3) | ((data[5] >> 5) & 0x7); + rollAngleFix = (rollAngleFix << 22) >> 22; + float rollAngle = rollAngleFix * (45.0f/256.0f); + bool rollAngleInvalid = (rollAngle < -50.0f) || (rollAngle > 50.0f); // More than 50 deg bank unlikely for airliners + bool rollAngleInconsistent = ((abs(rollAngle) >= 1.0f) && aircraft->m_onSurface) || (!rollAngleStatus && (rollAngleFix != 0)); + + bool trueTrackAngleStatus = (data[5] >> 4) & 0x1; + int trueTrackAngleFix = ((data[5] & 0xf) << 7) | ((data[6] >> 1) & 0x7f); + trueTrackAngleFix = (trueTrackAngleFix << 21) >> 21; + float trueTrackAngle = trueTrackAngleFix * (90.0f/512.0f); + if (trueTrackAngle < 0.0f) { + trueTrackAngle += 360.0f; + } + bool trueTrackAngleInconsistent = (aircraft->m_trackValid && (abs(trueTrackAngle - aircraft->m_track) > maxHeadingDiff)) // FIXME: compare to heading or track? + || (!trueTrackAngleStatus && (trueTrackAngleFix != 0)); + + bool groundSpeedStatus = data[6] & 0x1; + int groundSpeedFix = ((data[7] & 0xff) << 2) | ((data[8] >> 6) & 0x3); + int groundSpeed = groundSpeedFix * 2; + bool groundSpeedInconsistent = ((groundSpeed > 800) && (aircraft->m_emitterCategory != "High performance")) + || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - groundSpeed) > maxSpeedDiff)) + || (!groundSpeedStatus && (groundSpeedFix != 0)); + + bool trackAngleRateStatus = (data[8] >> 5) & 0x1; + int trackAngleRateFix = ((data[8] & 0x1f) << 5) | ((data[9] >> 3) & 0x1f); + trackAngleRateFix = (trackAngleRateFix << 22) >> 22; + float trackAngleRate = trackAngleRateFix * (8.0f/256.0f); + bool trackAngleRateInconsistent = !trackAngleRateStatus && (trackAngleRateFix != 0); + + bool trueAirspeedStatus = (data[9] >> 2) & 0x1; + int trueAirspeedFix = ((data[9] & 0x3) << 8) | (data[10] & 0xff); + int trueAirspeed = trueAirspeedFix * 2; + bool trueAirspeedInconsistent = ((trueAirspeed > 575) && (aircraft->m_emitterCategory != "High performance")) + || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - trueAirspeed) > maxWind+maxSpeedDiff)) + || (!trueAirspeedStatus && (trueAirspeedFix != 0)); + + bool headwindStatus = groundSpeedStatus && trueAirspeedStatus; + int headwind = trueAirspeed - groundSpeed; + bool headwindInconsistent = abs(headwind) > maxWind; + + bool bds_5_0 = !rollAngleInvalid && (!rollAngleInconsistent && !trueTrackAngleInconsistent && !groundSpeedInconsistent && !trackAngleRateInconsistent && !trueAirspeedInconsistent && !headwindInconsistent); + + // BDS 5,1 - Position report coarse + + bool positionValid = (data[4] >> 7) & 0x1; + + int latitudeFix = ((data[4] & 0x7f) << 13) | ((data[5] & 0xff) << 5) | ((data[6] >> 3) & 0x1f); + latitudeFix = (latitudeFix << 12) >> 12; + float latitude_5_1 = latitudeFix * (360.0f / 1048576.0f); + + int longitudeFix = ((data[6] & 0x7) << 17) | ((data[7] & 0xff) << 9) | ((data[8] & 0xff) << 1) | ((data[9] >> 7) & 0x1); + longitudeFix = (longitudeFix << 12) >> 12; + float longitude_5_1 = longitudeFix * (360.0f / 1048576.0f); + + bool positionInconsistent = !aircraft->m_positionValid + || (positionValid && aircraft->m_positionValid && isPositionInconsistent(latitude_5_1, longitude_5_1, aircraft->m_latitude, aircraft->m_longitude)) + || (!positionValid && ((latitudeFix != 0) || (longitudeFix != 0))); + + int pressureAltFix = ((data[9] & 0x7f) << 8) | (data[10] & 0xff); + pressureAltFix = (pressureAltFix << 17) >> 17; + int pressureAlt = pressureAltFix * 8; + bool pressureAltInconsistent = (pressureAlt > 50000) || (pressureAlt < -1000) || (positionValid && aircraft->m_altitudeValid && isAltitudeInconsistent(pressureAlt, aircraft->m_altitude)) + || (!positionValid && (pressureAltFix != 0)); + + bool bds_5_1 = !positionInconsistent && !pressureAltInconsistent; + + // BDS 5,3 - Air-referenced state vector + + bool arMagHeadingStatus = (data[4] >> 7) & 1; + int arMagHeadingFix = ((data[4] & 0x7f) << 4) | ((data[5] >> 4) & 0xf); + float arMagHeading = arMagHeadingFix * 90.0f / 512.0f; + bool arMagHeadingInconsistent = (aircraft->m_headingValid && arMagHeadingStatus && (abs(aircraft->m_heading - arMagHeading) > maxHeadingDiff)) + || (!arMagHeadingStatus && (arMagHeadingFix != 0)); + + bool arIndicatedAirspeedStatus = (data[5] >> 3) & 0x1; + int arIndicatedAirspeedFix = ((data[5] & 0x7) << 7) | ((data[6] >> 1) & 0x7f); + int arIndicatedAirspeed = arIndicatedAirspeedFix; // knots + bool arIndicatedAirspeedInconsistent = ((arIndicatedAirspeed > 550) && (aircraft->m_emitterCategory != "High performance")) + || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - arIndicatedAirspeed) > maxWind+maxSpeedDiff)) + || (aircraft->m_indicatedAirspeedValid && (abs(aircraft->m_indicatedAirspeed - arIndicatedAirspeed) > maxSpeedDiff)) + || (arIndicatedAirspeedStatus && (arIndicatedAirspeed < 100) && !aircraft->m_onSurface && (aircraft->m_emitterCategory != "Light")) + || (!arIndicatedAirspeedStatus && (arIndicatedAirspeedFix != 0)); + + bool arMachStatus = data[6] & 0x1; + int arMachFix = ((data[7] & 0xff) << 1) | ((data[8] >> 7) & 0x1); + float arMach = arMachFix * 0.008f; + bool arMachInconsistent = ((arMach >= 1.0f) && (aircraft->m_emitterCategory != "High performance")) + || (!arMachStatus && (arMachFix != 0)); + + bool arTrueAirspeedStatus = (data[8] >> 6) & 0x1; + int arTureAirspeedFix = ((data[8] & 0x3f) << 6) | ((data[9] >> 2) & 0x3f); + float arTrueAirspeed = arTureAirspeedFix * 0.5f; // knots + bool arTrueAirspeedInconsistent = ((arTrueAirspeed > 550) && (aircraft->m_emitterCategory != "High performance")) + || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - arTrueAirspeed) > maxWind+maxSpeedDiff)) + || (aircraft->m_trueAirspeedValid && (abs(aircraft->m_trueAirspeed - arTrueAirspeed) > maxSpeedDiff)) + || (arTrueAirspeedStatus && (arTureAirspeedFix < 100) && !aircraft->m_onSurface && (aircraft->m_emitterCategory != "Light")) + || (!arTrueAirspeedStatus && (arTureAirspeedFix != 0)); + + bool arAltitudeRateStatus = (data[9] >> 1) & 0x1; + int arAltitudeRateFix = ((data[9] & 0x1) << 8) | (data[10] & 0xff); + arAltitudeRateFix = (arAltitudeRateFix << 23) >> 23; // Sign extend 9-bit two's complement value + int arAltitudeRate = arAltitudeRateFix * 64; // Ft/min + bool arAltitudeRateInconsistent = (abs(arAltitudeRate) > 6000) || (!arAltitudeRateStatus && (arAltitudeRateFix != 0)); + + bool bds_5_3 = !arMagHeadingInconsistent && !arIndicatedAirspeedInconsistent && !arMachInconsistent && !arTrueAirspeedInconsistent && !arAltitudeRateInconsistent; + + // BDS 6,0 - Heading and speed report - EHS + + bool magHeadingStatus = (data[4] >> 7) & 1; + int magHeadingFix = ((data[4] & 0x7f) << 4) | ((data[5] >> 4) & 0xf); + magHeadingFix = (magHeadingFix << 21) >> 21; + float magHeading = magHeadingFix * (90.0f / 512.0f); + if (magHeading < 0.0f) { + magHeading += 360.f; + } + bool magHeadingInconsistent = (aircraft->m_headingValid && magHeadingStatus && (abs(aircraft->m_heading - magHeading) > maxHeadingDiff)) + || (!magHeadingStatus && (magHeadingFix != 0)); + + bool indicatedAirspeedStatus = (data[5] >> 3) & 0x1; + int indicatedAirspeedFix = ((data[5] & 0x7) << 7) | ((data[6] >> 1) & 0x7f); + int indicatedAirspeed = indicatedAirspeedFix; + bool indicatedAirspeedInconsistent = ((indicatedAirspeed > 550) && (aircraft->m_emitterCategory != "High performance")) + || (aircraft->m_groundspeedValid && (abs(aircraft->m_groundspeed - indicatedAirspeed) > maxWind+maxSpeedDiff)) + || (aircraft->m_indicatedAirspeedValid && (abs(aircraft->m_indicatedAirspeed - indicatedAirspeed) > maxSpeedDiff)) + || (indicatedAirspeedStatus && (indicatedAirspeed < 100) && !aircraft->m_onSurface && (aircraft->m_emitterCategory != "Light")) + || (!indicatedAirspeedStatus && (indicatedAirspeedFix != 0)); + + bool machStatus = data[6] & 0x1; + int machFix = ((data[7] & 0xff) << 2) | ((data[8] >> 6) & 0x3); + float mach = machFix * 2.048f / 512.0f; + bool machInconsistent = ((mach >= 1.0f) && (aircraft->m_emitterCategory != "High performance")) + || (!machStatus && (machFix != 0)); + + bool baroAltRateStatus = (data[8] >> 5) & 0x1; + int baroAltRateFix = ((data[8] & 0x1f) << 5) | ((data[9] >> 3) & 0x1f); + baroAltRateFix = (baroAltRateFix << 22) >> 22; + int baroAltRate = baroAltRateFix * 32; // ft/min + bool baroAltRateInconsistent = (abs(baroAltRate) > 6000) || (aircraft->m_verticalRateValid && abs(baroAltRate - aircraft->m_verticalRate) > 2000) + || (!baroAltRateStatus && (baroAltRateFix != 0)); + + bool verticalVelStatus = (data[9] >> 2) & 0x1; + int verticalVelFix = ((data[9] & 0x3) << 8) | (data[10] & 0xff); + verticalVelFix = (verticalVelFix << 22) >> 22; + int verticalVel = verticalVelFix * 32; // ft/min + bool verticalVelInconsistent = (abs(verticalVel) > 6000) || (aircraft->m_verticalRateValid && abs(verticalVel - aircraft->m_verticalRate) > 2000) + || (!verticalVelStatus && (verticalVelFix != 0)); + + bool bds_6_0 = !magHeadingInconsistent && !indicatedAirspeedInconsistent && !machInconsistent && !baroAltRateInconsistent && !verticalVelInconsistent; + + int possibleMatches = bds_0_5 + bds_0_8 + bds_0_9 + bds_1_0 + bds_1_7 + bds_2_0 + bds_2_1 + bds_3_0 + bds_4_0 + bds_4_1 + bds_4_4 + bds_4_5 + bds_5_0 + bds_5_1 + bds_5_3 + bds_6_0; + + if (possibleMatches == 1) + { + if (bds_0_5) + { + // Only use this data if position and altitude where compared against a previous position, otherwise there's a high chance it may be wrong + if (aircraft->m_altitudeValid && aircraft->m_positionValid) + { + if (altitudeValid_0_5) { + aircraft->setAltitude(altitude_0_5, (tc >= 20) && (tc <= 22), dateTime, m_settings); + } + if (positionValid_0_5) { + updateAircraftPosition(aircraft, latitude_0_5, longitude_0_5, dateTime); + } + if (altitudeValid_0_5 && positionValid_0_5) { + aircraft->m_positionChanged = true; + } + } + } + if (bds_0_8) + { + updatedCallsign = aircraft->m_callsign != callsign_0_8; + if (updatedCallsign) { + setCallsign(aircraft, callsign_0_8); + } + } + if (bds_0_9) + { + if (groundspeedSubType) + { + if (groundspeedValid_0_9) + { + aircraft->setGroundspeed(groundspeed_0_9, m_settings); + aircraft->setTrack(track, dateTime); + } + } + else + { + if (airspeedValid_0_9) + { + if (airspeedType_0_9) { + aircraft->setTrueAirspeed(airspeed, m_settings); + } else { + aircraft->setIndicatedAirspeed(airspeed, dateTime, m_settings); + } + } + if (headingValid) { + aircraft->setHeading(heading, dateTime); + } + } + if (verticalRateValid_0_9) { + aircraft->setVerticalRate(verticalRate, m_settings); + } + } + if (bds_1_7) + { + // Some of these bits are dynamic, so can't assume that because a bit isn't set, + // that message is not ever supported + aircraft->m_bdsCapabilitiesValid = true; + aircraft->m_bdsCapabilities[0][5] |= cap_0_5; + aircraft->m_bdsCapabilities[0][6] |= cap_0_6; + aircraft->m_bdsCapabilities[0][7] |= cap_0_7; + aircraft->m_bdsCapabilities[0][8] |= cap_0_8; + aircraft->m_bdsCapabilities[0][9] |= cap_0_9; + aircraft->m_bdsCapabilities[0][10] |= cap_0_a; + aircraft->m_bdsCapabilities[2][0] |= cap_2_0; + aircraft->m_bdsCapabilities[2][1] |= cap_2_1; + aircraft->m_bdsCapabilities[4][0] |= cap_4_0; + aircraft->m_bdsCapabilities[4][1] |= cap_4_1; + aircraft->m_bdsCapabilities[4][2] |= cap_4_2; + aircraft->m_bdsCapabilities[4][3] |= cap_4_3; + aircraft->m_bdsCapabilities[4][4] |= cap_4_4; + aircraft->m_bdsCapabilities[4][5] |= cap_4_5; + aircraft->m_bdsCapabilities[4][8] |= cap_4_8; + aircraft->m_bdsCapabilities[5][0] |= cap_5_0; + aircraft->m_bdsCapabilities[5][1] |= cap_5_1; + aircraft->m_bdsCapabilities[5][2] |= cap_5_2; + aircraft->m_bdsCapabilities[5][3] |= cap_5_3; + aircraft->m_bdsCapabilities[5][4] |= cap_5_4; + aircraft->m_bdsCapabilities[5][5] |= cap_5_5; + aircraft->m_bdsCapabilities[5][6] |= cap_5_6; + aircraft->m_bdsCapabilities[5][15] |= cap_5_f; + aircraft->m_bdsCapabilities[6][0] |= cap_6_0; + } + if (bds_2_0) + { + updatedCallsign = aircraft->m_callsign != callsignTrimmed; + if (updatedCallsign) { + setCallsign(aircraft, callsignTrimmed); + } + } + if (bds_2_1) + { + qDebug() << "BDS 2,1 - " + << "ICAO:" << aircraft->m_icaoHex + << "aircraftRegistration:" << aircraftRegistrationString + << "airlineRegistration:" << airlineRegistrationString + << "m_bdsCapabilities[2][1]: " << aircraft->m_bdsCapabilities[2][1] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + + if (!aircraftRegistrationString.isEmpty()) { + aircraft->setCell(ADSB_COL_REGISTRATION, aircraftRegistrationString); + } + } + if (bds_3_0) + { + decodeRABroadcast(data, dateTime, aircraft); + } + if (bds_4_0) + { + // Could use targetAltSource here, but yet to see it set to anything other than unknown + if (mcpSelectedAltStatus) + { + aircraft->m_selAltitude = mcpSelectedAlt; + aircraft->m_selAltitudeValid = true; + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, Units::feetToIntegerMetres(aircraft->m_selAltitude)); + } else { + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, roundTo50Feet(aircraft->m_selAltitude)); + } + } + else if (fmsSelectedAltStatus) + { + aircraft->m_selAltitude = fmsSelectedAlt; + aircraft->m_selAltitudeValid = true; + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, Units::feetToIntegerMetres(aircraft->m_selAltitude)); + } else { + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, roundTo50Feet(aircraft->m_selAltitude)); + } + } + else + { + aircraft->m_selAltitude = 0; + aircraft->m_selAltitudeValid = false; + aircraft->setCell(ADSB_COL_SEL_ALTITUDE, ""); + } + + if (baroSettingStatus) + { + aircraft->m_baro = baroSetting; + aircraft->m_baroValid = true; + aircraft->setCell(ADSB_COL_BARO, std::round(aircraft->m_baro)); + updateQNH(aircraft, baroSetting); + } + + if (modeStatus) + { + QString mode = ""; + if (vnavMode) { + mode = mode + "VNAV "; + } + if (altHoldMode) { + mode = mode + "HOLD "; + } + if (approachMode) { + mode = mode + "APP "; + } + mode = mode.trimmed(); + aircraft->setCell(ADSB_COL_V_MODE, mode); + + aircraft->m_vnavMode = vnavMode; + aircraft->m_vnavModeValid = true; + aircraft->m_altHoldMode = altHoldMode; + aircraft->m_altHoldModeValid = true; + aircraft->m_approachMode = approachMode; + aircraft->m_approachModeValid = true; + } + } + if (bds_4_1) + { + qDebug() << "BDS 4,1 - " + << "ICAO:" << aircraft->m_icaoHex + << "waypoint:" << waypointString + << "m_bdsCapabilities[4][1]: " << aircraft->m_bdsCapabilities[4][1] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + } + if (bds_4_4) + { + if (fomSource != 0) // Ignore FOM "invalid" + { + if (windSpeedStatus) + { + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_WIND_SPEED, Units::knotsToIntegerKPH(windSpeed)); + } else { + aircraft->setCell(ADSB_COL_WIND_SPEED, windSpeed); + } + aircraft->setCell(ADSB_COL_WIND_DIR, windDirection); + // Not clear if air temp depends on the previous status bit + aircraft->setCell(ADSB_COL_STATIC_AIR_TEMP, (int)std::round(staticAirTemperature)); + } + if (averageStaticPressureStatus) { + aircraft->setCell(ADSB_COL_STATIC_PRESSURE, averageStaticPressure); + } + if (humidityStatus) { + aircraft->setCell(ADSB_COL_HUMIDITY, (int)std::round(humidity)); + } + } + } + if (bds_4_5) + { + qDebug() << "BDS 4,5 - " + << "ICAO:" << aircraft->m_icaoHex + << "hazardTurbulence:" << m_hazardSeverity[hazardTurbulence] + << "hazardWindShear:" << m_hazardSeverity[hazardWindShear] + << "hazardMicroburst:" << m_hazardSeverity[hazardMicroburst] + << "hazardIcing:" << m_hazardSeverity[hazardIcing] + << "hazardWakeVortex:" << m_hazardSeverity[hazardWakeVortex] + << "hazardStaticAirTemperature:" << hazardStaticAirTemperature << "C" + << "hazardAverageStaticPressure:" << hazardAverageStaticPressure << "hPA" + << "hazardRadioHeight:" << hazardRadioHeight << "ft" + << "(ADSBAircraft Alt: " << aircraft->m_altitude << "ft)" + << "m_bdsCapabilities[4][5]: " << aircraft->m_bdsCapabilities[4][5] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + ; + } + if (bds_5_0) + { + if (rollAngleStatus) + { + aircraft->m_roll = rollAngle; + aircraft->m_rollValid = true; + aircraft->setCell(ADSB_COL_ROLL, std::round(aircraft->m_roll)); + } + if (trueTrackAngleStatus) + { + clearOldHeading(aircraft, dateTime, trueTrackAngle); + aircraft->setTrack(trueTrackAngle, dateTime); + } + if (groundSpeedStatus) + { + aircraft->setGroundspeed(groundSpeed, m_settings); + } + if (trackAngleRateStatus) + { + aircraft->m_turnRate = trackAngleRate; + aircraft->m_turnRateValid = true; + aircraft->setCell(ADSB_COL_TURNRATE, std::round(aircraft->m_turnRate*10.0f)/10.0f); + } + if (trueAirspeedStatus) + { + aircraft->m_trueAirspeed = trueAirspeed; + aircraft->m_trueAirspeedValid = true; + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_TRUE_AIRSPEED, Units::knotsToIntegerKPH(aircraft->m_trueAirspeed)); + } else { + aircraft->setCell(ADSB_COL_TRUE_AIRSPEED, aircraft->m_trueAirspeed); + } + } + if (headwindStatus) + { + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_HEADWIND, Units::knotsToIntegerKPH(headwind)); + } else { + aircraft->setCell(ADSB_COL_HEADWIND, headwind); + } + } + } + if (bds_5_1) + { + // Position is specified as "coarse" (lsb = 90/131072 deg which is ~76m. CPR accuracy is 5.1m) + /*qDebug() << "BDS 5,1 - " + << "ICAO:" << aircraft->m_icaoHex + << "latitude:" << latitude_5_1 << "(ADS-B:" << aircraft->m_latitude << ") " + << "longitude:" << longitude_5_1 << "(ADS-B:" << aircraft->m_longitude << ") " + << "pressureAlt:" << pressureAlt << "(ADS-B:" << aircraft->m_altitude << ")" + << "m_bdsCapabilities[5][1]: " << aircraft->m_bdsCapabilities[5][1] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + ;*/ + } + if (bds_5_3) + { + qDebug() << "BDS 5,3 - " + << "ICAO:" << aircraft->m_icaoHex + << "arMagHeading:" << arMagHeading << "(ADS-B:" << aircraft->m_heading << ") " + << "arIndicatedAirspeed:" << arIndicatedAirspeed << "knts" << "(ADS-B GS: " << aircraft->m_groundspeed << ") " + << "arMach:" << arMach + << "arTrueAirspeed:" << arTrueAirspeed << "knts" + << "arAltitudeRate:" << arAltitudeRate << "ft/min" + << "m_bdsCapabilities[5][3]: " << aircraft->m_bdsCapabilities[5][3] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + ; + } + if (bds_6_0) + { + if (arMagHeadingStatus) { + aircraft->setHeading(magHeading, dateTime); + } + if (indicatedAirspeedStatus) + { + aircraft->m_indicatedAirspeed = indicatedAirspeed; + aircraft->m_indicatedAirspeedValid = true; + if (m_settings.m_siUnits) { + aircraft->setCell(ADSB_COL_INDICATED_AIRSPEED, Units::knotsToIntegerKPH(aircraft->m_indicatedAirspeed)); + } else { + aircraft->setCell(ADSB_COL_INDICATED_AIRSPEED, aircraft->m_indicatedAirspeed); + } + aircraft->m_indicatedAirspeedDateTime = dateTime; + } + if (machStatus) + { + aircraft->m_mach = mach; + aircraft->m_machValid = true; + aircraft->setCell(ADSB_COL_MACH, aircraft->m_mach); + } + if (verticalVelStatus) { + aircraft->setVerticalRate(verticalVel, m_settings); + } + } + + if (bds_5_0 || bds_6_0) { + calcAirTemp(aircraft); + } + } + else if (false) // Enable to debug multiple matching frames + { + qDebug() << "DF" << df + << "matches" << possibleMatches + << "bds_0_5" << bds_0_5 + << "bds_0_8" << bds_0_8 + << "bds_0_9" << bds_0_9 + << "bds_1_0" << bds_1_0 + << "bds_1_7" << bds_1_7 + << "bds_2_0" << bds_2_0 + << "bds_2_1" << bds_2_1 + << "bds_3_0" << bds_3_0 + << "bds_4_0" << bds_4_0 + << "bds_4_1" << bds_4_1 + << "bds_4_4" << bds_4_4 + << "bds_4_5" << bds_4_5 + << "bds_5_0" << bds_5_0 + << "bds_5_1" << bds_5_1 + << "bds_5_3" << bds_5_3 + << "bds_6_0" << bds_6_0 + ; + + qDebug() << data.toHex(); + + qDebug() << (bds_0_5 ? "+" : "-") + << "BDS 0,5 - " + << "altitude:" << altitude_0_5 << "(ADS-B:" << aircraft->m_altitude << ") " + << "latitude:" << latitude_0_5 << "(ADS-B:" << aircraft->m_latitude << ") " + << "longitude:" << longitude_0_5 << "(ADS-B:" << aircraft->m_longitude << ") "; + qDebug() << (bds_0_8 ? "+" : "-") + << "BDS 0,8 - " + << "emitterCategory:" << emitterCategory << "(ADS-B:" << aircraft->m_emitterCategory << ") " + << "callsign:" << callsign_0_8 << "(ADS-B:" << aircraft->m_callsign << ") "; + qDebug() << (bds_0_9 ? "+" : "-") + << "BDS 0,9 - " + << "groundspeedSubType:" << groundspeedSubType + << "speed:" << (groundspeedSubType ? groundspeed_0_9 : airspeed) << "(ADS-B:" << (groundspeedSubType ? aircraft->m_groundspeed : (airspeedType_0_9 ? aircraft->m_trueAirspeed : aircraft->m_indicatedAirspeed)) << ") " + << "verticalRate:" << verticalRate << "(ADS-B:" << aircraft->m_verticalRate << ") "; + qDebug() << (bds_1_0 ? "+" : "-") + << "BDS 1,0 - "; + qDebug() << (bds_1_7 ? "+" : "-") + << "BDS 1,7 - " + << "ICAO:" << aircraft->m_icaoHex + << "BDS:" << caps.join(" "); + qDebug() << (bds_2_0 ? "+" : "-") + << "BDS 2,0 - " + << "ICAO:" << aircraft->m_icaoHex + << "Callsign:" << callsignTrimmed << "(ADS-B:" << aircraft->m_callsign << ") "; + qDebug() << (bds_2_1 ? "+" : "-") + << "BDS 2,1 - " + << "ICAO:" << aircraft->m_icaoHex + << "aircraftRegistration:" << aircraftRegistrationString + << "airlineRegistration:" << airlineRegistrationString + << "m_bdsCapabilities[2][1]: " << aircraft->m_bdsCapabilities[2][1] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_3_0 ? "+" : "-") + << "BDS 3,0 - "; + qDebug() << (bds_4_0 ? "+" : "-") + << "BDS 4,0 - " + << "ICAO:" << aircraft->m_icaoHex + << "mcpSelectedAlt:" << mcpSelectedAlt << "ft" + << "fmsSelectedAlt:" << fmsSelectedAlt << "ft" + << "baroSetting:" << (baroSettingStatus ? QString::number(baroSetting) : "invalid") << (baroSettingStatus ? "mb" : "") + << "vnav: " << vnavMode + << "altHold: " << altHoldMode + << "approach: " << approachMode + << "targetAltSource:" << targetAltSource + << "m_bdsCapabilities[4][0]: " << aircraft->m_bdsCapabilities[4][0] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_4_1 ? "+" : "-") + << "BDS 4,1 - " + << "ICAO:" << aircraft->m_icaoHex + << "waypoint:" << waypointString + << "m_bdsCapabilities[4][1]: " << aircraft->m_bdsCapabilities[4][1] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_4_4 ? "+" : "-") + << "BDS 4,4 - " + << "ICAO:" << aircraft->m_icaoHex + << "fomSource:" << m_fomSources[fomSource] + << "windSpeed:" << windSpeed << "knts" + << "windDirection:" << windDirection << "deg" + << "staticAirTemperature:" << staticAirTemperature << "C" + << "averageStaticPressure:" << averageStaticPressure << "hPa" + << "turbulence:" << turbulence + << "humidity:" << humidity << "%" + << "m_bdsCapabilities[4][4]: " << aircraft->m_bdsCapabilities[4][4] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_4_5 ? "+" : "-") + << "BDS 4,5 - " + << "ICAO:" << aircraft->m_icaoHex + << "hazardTurbulence:" << m_hazardSeverity[hazardTurbulence] + << "hazardWindShear:" << m_hazardSeverity[hazardWindShear] + << "hazardMicroburst:" << m_hazardSeverity[hazardMicroburst] + << "hazardIcing:" << m_hazardSeverity[hazardIcing] + << "hazardWakeVortex:" << m_hazardSeverity[hazardWakeVortex] + << "hazardStaticAirTemperature:" << hazardStaticAirTemperature << "C" + << "hazardAverageStaticPressure:" << hazardAverageStaticPressure << "hPA" + << "hazardRadioHeight:" << hazardRadioHeight << "ft" + << "m_bdsCapabilities[4][5]: " << aircraft->m_bdsCapabilities[4][5] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_5_0 ? "+" : "-") + << "BDS 5,0 - " + << "ICAO:" << aircraft->m_icaoHex + << "rollAngle:" << rollAngle + << "trueTrackAngle:" << trueTrackAngle + << "trackAngleRate: " << trackAngleRate + << "groundSpeed:" << groundSpeed + << "trueAirspeed:" << trueAirspeed + << "headwind:" << headwind + << "(ADS-B GS: " << aircraft->m_groundspeed << ")" + << "(ADS-B TAS: " << aircraft->m_trueAirspeed << ")" + << "(ADS-B heading:" << aircraft->m_heading << ")" + << "m_bdsCapabilities[5][0]: " << aircraft->m_bdsCapabilities[5][0] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_5_1 ? "+" : "-") + << "BDS 5,1 - " + << "ICAO:" << aircraft->m_icaoHex + << "latitude:" << latitude_5_1 << "(ADS-B:" << aircraft->m_latitude << ") " + << "longitude:" << longitude_5_1 << "(ADS-B:" << aircraft->m_longitude << ") " + << "pressureAlt:" << pressureAlt << "(ADS-B:" << aircraft->m_altitude << ")" + << "m_bdsCapabilities[5][1]: " << aircraft->m_bdsCapabilities[5][1] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_5_3 ? "+" : "-") + << "BDS 5,3 - " + << "ICAO:" << aircraft->m_icaoHex + << "arMagHeading:" << arMagHeading << "(ADS-B:" << aircraft->m_heading << ") " + << "arIndicatedAirspeed:" << arIndicatedAirspeed << "knts" << "(ADS-B GS: " << aircraft->m_groundspeed << ") " + << "arMach:" << arMach + << "arTrueAirspeed:" << arTrueAirspeed << "knts" + << "arAltitudeRate:" << arAltitudeRate << "ft/min" + << "arMagHeadingInconsistent" << arMagHeadingInconsistent << "arIndicatedAirspeedInconsistent" << arIndicatedAirspeedInconsistent << "arMachInconsistent" << arMachInconsistent << "arTrueAirspeedInconsistent" << arTrueAirspeedInconsistent + << "m_bdsCapabilities[5][3]: " << aircraft->m_bdsCapabilities[5][3] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + qDebug() << (bds_6_0 ? "+" : "-") + << "BDS 6,0 - " + << "ICAO:" << aircraft->m_icaoHex + << "magHeading:" << magHeading << "(ADS-B:" << aircraft->m_heading << ") " + << "indicatedAirspeed:" << indicatedAirspeed << "knts" << "(ADS-B GS: " << aircraft->m_groundspeed << ") " + << "mach:" << mach + << "baroAltRate:" << baroAltRate << "ft/min" + << "verticalVel:" << verticalVel << "ft/min" + << "magHeadingInconsistent " << magHeadingInconsistent << "indicatedAirspeedInconsistent" << indicatedAirspeedInconsistent << "machInconsistent" << machInconsistent << "baroAltRateInconsistent" << baroAltRateInconsistent << "verticalVelInconsistent" << verticalVelInconsistent + << "m_bdsCapabilities[6][0]: " << aircraft->m_bdsCapabilities[6][0] + << "m_bdsCapabilitiesValid: " << aircraft->m_bdsCapabilitiesValid; + } + } +} + +// The animations the Bluebell models were built with (X-Plane datarefs), and the +// helicopter's. Asked of a model only if it has them - see modelHasAnimation() +static const QString ANIMATION_GEAR = "libxplanemp/controls/gear_ratio"; +static const QString ANIMATION_GEAR_ANGLE = "libxplanemp/gear/tire_vertical_deflection_mtr"; +static const QString ANIMATION_FLAPS = "libxplanemp/controls/flap_ratio"; +static const QString ANIMATION_SLATS = "libxplanemp/controls/slat_ratio"; +static const QString ANIMATION_ROTOR = "Take 001"; +static const QString ANIMATION_ENGINE = "libxplanemp/engines/engine_rotation_angle_deg%1"; // %1 is the engine number + +bool ADSBDemodTracker::modelHasAnimation(const ADSBAircraft *aircraft, const QString &animation) const +{ + // The same choice of model as when the item is sent to the map + const QString &model = !aircraft->m_aircraft3DModel.isEmpty() ? aircraft->m_aircraft3DModel : aircraft->m_aircraftCat3DModel; + return Aircraft3DModels::instance().hasAnimation(model, animation); +} + +// Height above the airport an aircraft is arriving at, which is what decides when the +// gear and flaps come out. m_runwayAltitude only ever covers a departure we watched - +// it is captured from the first airborne altitude and cleared again on climb out - so +// an arrival has no reference at all without this, and the animation had to guess from +// groundspeed, which carries the wind with it. +// +// Airports are bucketed by whole degree so the search looks at a handful rather than +// the eighty thousand in the database. Built once, on first use. +static QHash> *airportGrid() +{ + static QHash> grid; + static bool built = false; + + if (!built) + { + built = true; + QSharedPointer> airports = OurAirportsDB::getAirportsById(); + + if (airports) + { + for (auto i = airports->cbegin(); i != airports->cend(); ++i) + { + const AirportInformation *airport = i.value(); + + // A heliport can be on a building or a rig, so its elevation says + // nothing about the ground an aeroplane is about to land on + if (!airport || (airport->m_type == AirportInformation::Heliport)) { + continue; + } + const int key = (((int) std::floor(airport->m_latitude)) + 90) * 1000 + + ((int) std::floor(airport->m_longitude)) + 180; + grid[key].append(airport); + } + } + qDebug() << "ADSBDemodTracker: airport elevation grid holds" << grid.size() << "cells"; + } + + return &grid; +} + +// Sets m_fieldElevation to the elevation of the nearest airport, when the aircraft is +// low enough for it to matter. Kept on the aircraft and refreshed rarely: the elevation +// of whatever is underneath changes slowly, and this runs for every aircraft on every +// position report +static void updateFieldElevation(ADSBAircraft *aircraft, const QDateTime& dateTime) +{ + const int lookupCeiling = 10000; // Feet, above which an arrival is not imminent + const float searchRange = 20.0f; // Nautical miles + const int refreshSeconds = 60; + + if (!aircraft->m_positionValid || !aircraft->m_altitudeValid) { + return; + } + + // Too high to be landing anywhere near here, and a cruising aircraft passing over + // airports should not pick up their elevations + if (aircraft->m_altitude > lookupCeiling) + { + aircraft->m_fieldElevationValid = false; + return; + } + + if (aircraft->m_fieldElevationTime.isValid() + && (aircraft->m_fieldElevationTime.secsTo(dateTime) < refreshSeconds)) { + return; + } + aircraft->m_fieldElevationTime = dateTime; + + const QHash> *grid = airportGrid(); + const int latDegree = (int) std::floor(aircraft->m_latitude); + const int lonDegree = (int) std::floor(aircraft->m_longitude); + // Nautical miles per degree of longitude shrinks towards the poles + const double lonScale = 60.0 * std::cos(aircraft->m_latitude * M_PI / 180.0); + + const AirportInformation *nearest = nullptr; + float nearestRange = searchRange; + + // The neighbouring cells as well as the one it is in, so an airport just over a + // degree boundary is not missed + for (int dLat = -1; dLat <= 1; dLat++) + { + for (int dLon = -1; dLon <= 1; dLon++) + { + const int key = ((latDegree + dLat) + 90) * 1000 + (lonDegree + dLon) + 180; + const auto cell = grid->find(key); + + if (cell == grid->cend()) { + continue; + } + for (const AirportInformation *airport : *cell) + { + const double north = (airport->m_latitude - aircraft->m_latitude) * 60.0; + const double east = (airport->m_longitude - aircraft->m_longitude) * lonScale; + const float range = (float) std::sqrt((north * north) + (east * east)); + + if (range < nearestRange) + { + nearestRange = range; + nearest = airport; + } + } + } + } + + if (nearest) + { + aircraft->m_fieldElevation = nearest->m_elevation; + aircraft->m_fieldElevationValid = true; + } + else + { + aircraft->m_fieldElevationValid = false; + } +} + +QList * ADSBDemodTracker::animate(QDateTime dateTime, ADSBAircraft *aircraft) +{ + QList *animations = new QList(); + + // What this aircraft's model can play. An animation it lacks would still have been + // sent - engines are re-asserted every few minutes - for the map to catch and log, + // for the whole session. The state below is tracked regardless, so an aircraft whose + // model cannot show its gear still knows where its gear is. + const bool hasGear = modelHasAnimation(aircraft, ANIMATION_GEAR); + const bool hasGearAngle = modelHasAnimation(aircraft, ANIMATION_GEAR_ANGLE); + const bool hasFlaps = modelHasAnimation(aircraft, ANIMATION_FLAPS); + const bool hasSlats = modelHasAnimation(aircraft, ANIMATION_SLATS); + const bool hasRotor = modelHasAnimation(aircraft, ANIMATION_ROTOR); + const bool hasEngine1 = modelHasAnimation(aircraft, ANIMATION_ENGINE.arg(1)); + const bool hasEngine2 = modelHasAnimation(aircraft, ANIMATION_ENGINE.arg(2)); + + updateFieldElevation(aircraft, dateTime); + + // Height above whatever the aircraft is flying over, when that is known. For a + // departure the runway altitude is exact; for an arrival the nearest airport is as + // close as we can get, and good to the few tens of feet that matter here + bool heightValid = false; + int height = 0; + + if (aircraft->m_altitudeValid) + { + if (aircraft->m_runwayAltitudeValid) + { + height = aircraft->m_altitude - (int) aircraft->m_runwayAltitude; + heightValid = true; + } + else if (aircraft->m_fieldElevationValid) + { + height = aircraft->m_altitude - (int) aircraft->m_fieldElevation; + heightValid = true; + } + } + + const int gearDownHeight = 2000; // Above the runway, as most operators fly it + const int gearDownAirspeed = 180; // Indicated, which is what a crew flies to + const int gearDownSpeed = 150; // Groundspeed, the last resort + const int gearDownVerticalRate = -300; // A settled descent. + const int gearUpAltitude = 200; + const int gearUpVerticalRate = 1000; + const int accelerationHeight = 1500; + const int minPitchGroundspeed = 50; // Below which a flight path angle means nothing + const float ftPerMinutePerKnot = 101.269f; // One knot, in feet per minute + // An airliner flies a few degrees nose up of its own flight path - that is the angle + // of attack, and it is what makes the wing lift. Nothing reported gives it, so a + // single representative figure stands in: a jet sits at around 2.5 degrees in the + // cruise and 5 in the climb. Without it the flight path angle alone leaves the models + // and the attitude indicator looking flat, which is what the old estimate was + // compensating for by treating the vertical rate as an attitude + const float angleOfAttack = 3.0f; + // Flown at Vref with the flaps out, an airliner sits at a noticeably higher body + // angle than it does clean. Pitch is this plus the flight path angle, so on a three + // degree glideslope it comes out around +1.5, which is what an approach looks like + const float landingAngleOfAttack = 4.5f; + const int flapsRetractAltitude = 2000; + const int flapsCleanSpeed = 200; + + bool debug = false; + + // Landing gear should be down when on surface + // Check speed in case we get a mixture of surface and airborne positions + // during take-off + if ( aircraft->m_onSurface + && !aircraft->m_gearDown + && ( (aircraft->m_groundspeedValid && (aircraft->m_groundspeed < 80)) + || !aircraft->m_groundspeedValid + ) + ) + { + if (debug) { + qDebug() << "Gear down as on surface " << aircraft->m_icaoHex; + } + if (hasGear) { + animations->append(gearAnimation(dateTime, false)); + } + if (!aircraft->m_tyresFlat) + { + if (hasGearAngle) { + animations->append(gearAngle(dateTime, true)); + } + aircraft->m_tyresFlat = true; + } + aircraft->m_gearDown = true; + } + + // Flaps when on the surface + if (aircraft->m_onSurface && aircraft->m_groundspeedValid) + { + if ((aircraft->m_groundspeed <= 20) && (aircraft->m_flaps != 0.0)) + { + // No flaps when stationary / taxiing + if (debug) { + qDebug() << "Parking flaps " << aircraft->m_icaoHex; + } + if (hasFlaps) { + animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.0)); + } + if (hasSlats) { + animations->append(slatsAnimation(dateTime, true)); + } + aircraft->m_flaps = 0.0; + } + else if ((aircraft->m_groundspeed >= 30) && (aircraft->m_flaps < 0.25)) + { + // Flaps for takeoff + if (debug) { + qDebug() << "Takeoff flaps " << aircraft->m_icaoHex; + } + if (hasFlaps) { + animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.25)); + } + if (hasSlats) { + animations->append(slatsAnimation(dateTime, false)); + } + aircraft->m_flaps = 0.25; + } + } + + // Pitch up on take-off + if ( aircraft->m_gearDown + && !aircraft->m_onSurface + && ( (aircraft->m_verticalRateValid && (aircraft->m_verticalRate > 300)) + || (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + gearUpAltitude/2))) + ) + ) + { + if (debug) { + qDebug() << "Pitch up " << aircraft->m_icaoHex; + } + aircraft->m_pitchEst = 5.0; + // Only as the aircraft leaves the ground. This runs on every update while it + // climbs slower than the rate that retracts the gear, so without the state the + // animation was asked for several times a second for as long as that lasted - + // one aircraft asked 2,485 times in 16 minutes. Every request that reaches a + // loaded model stays on it, and the map walks them all each frame + if (aircraft->m_tyresFlat) + { + if (hasGearAngle) { + animations->append(gearAngle(dateTime, false)); + } + aircraft->m_tyresFlat = false; + } + } + + // Retract landing gear after take-off + if ( aircraft->m_gearDown + && !aircraft->m_onSurface + && ( (aircraft->m_verticalRateValid && (aircraft->m_verticalRate > 1000)) + || (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + gearUpAltitude))) + ) + ) + { + if (debug) { + qDebug() << "Gear up " << aircraft->m_icaoHex + << " VR " << (aircraft->m_verticalRateValid && (aircraft->m_verticalRate > gearUpVerticalRate)) + << " Alt " << (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + gearUpAltitude))) + << "m_altitude " << aircraft->m_altitude << " aircraft->m_runwayAltitude " << aircraft->m_runwayAltitude; + } + aircraft->m_pitchEst = 10.0; + if (hasGear) { + animations->append(gearAnimation(dateTime.addSecs(2), true)); + } + aircraft->m_gearDown = false; + } + + // Reduce pitch at acceleration height + if ( (aircraft->m_flaps > 0.0) + && (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + accelerationHeight))) + ) + { + aircraft->m_pitchEst = 5.0; + } + + // Retract flaps/slats after take-off + // Should be after acceleration altitude (1500-3000ft AAL) + // And before max speed for flaps is reached (215knt for A320, 255KIAS for 777) + if ( (aircraft->m_flaps > 0.0) + && ( (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + flapsRetractAltitude))) + || (aircraft->m_groundspeedValid && (aircraft->m_groundspeed > flapsCleanSpeed)) + ) + ) + { + if (debug) { + qDebug() << "Retract flaps " << aircraft->m_icaoHex + << " Spd " << (aircraft->m_groundspeedValid && (aircraft->m_groundspeed > flapsCleanSpeed)) + << " Alt " << (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude > (aircraft->m_runwayAltitude + flapsRetractAltitude))); + } + if (hasFlaps) { + animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.0)); + } + if (hasSlats) { + animations->append(slatsAnimation(dateTime, true)); + } + aircraft->m_flaps = 0.0; + // Clear runway information + aircraft->m_runwayAltitudeValid = false; + aircraft->m_runwayAltitude = 0.0; + } + + // Extend flaps for approach and landing + // We don't know airport elevation, so just base on speed and descent rate + // Vertical rate can go negative during take-off, so we check m_runwayAltitudeValid + if (!aircraft->m_onSurface + && !aircraft->m_runwayAltitudeValid + && (aircraft->m_verticalRateValid && (aircraft->m_verticalRate < 0)) + && aircraft->m_groundspeedValid + ) + { + if ((aircraft->m_groundspeed < flapsCleanSpeed) && (aircraft->m_flaps < 0.25)) + { + // Extend flaps for approach + if (debug) { + qDebug() << "Extend flaps for approach" << aircraft->m_icaoHex; + } + if (hasFlaps) { + animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.25)); + } + //animations->append(slatsAnimation(dateTime, false)); + aircraft->m_flaps = 0.25; + // Only until the next report, where the flight path angle takes over + aircraft->m_pitchEst = 1.0; + } + } + + // Gear down for landing, at the height above the runway most operators use. + // + // Where no airport is near enough to give an elevation this still has to guess + // m_runwayAltitudeValid still excludes a departure being watched: vertical rate can + // go briefly negative after take-off, and without this the gear would drop again + // moments after retracting + if (!aircraft->m_gearDown + && !aircraft->m_onSurface + && !aircraft->m_runwayAltitudeValid + && (aircraft->m_verticalRateValid && (aircraft->m_verticalRate < gearDownVerticalRate)) + && ( (heightValid && (height < gearDownHeight)) + || ( !heightValid + && ( (aircraft->m_indicatedAirspeedValid && (aircraft->m_indicatedAirspeed < gearDownAirspeed)) + || (!aircraft->m_indicatedAirspeedValid && aircraft->m_groundspeedValid && (aircraft->m_groundspeed < gearDownSpeed)) + ) + ) + ) + ) + { + if (debug) { + qDebug() << "Flaps/Gear down for landing " << aircraft->m_icaoHex; + } + if (hasFlaps) { + animations->append(flapsAnimation(dateTime, aircraft->m_flaps, 0.5)); + } + if (hasSlats) { + animations->append(slatsAnimation(dateTime, false)); + } + if (hasGear) { + animations->append(gearAnimation(dateTime.addSecs(8), false)); + } + if (hasFlaps) { + animations->append(flapsAnimation(dateTime.addSecs(16), 0.5, 1.0)); + } + aircraft->m_gearDown = true; + aircraft->m_flaps = 1.0; + // Only until the next report, where the flight path angle takes over. A three + // degree slope at the landing angle of attack settles around +1.5 + aircraft->m_pitchEst = 1.5; + } + + // Engine control. The running animations are re-asserted every few minutes: the + // start is otherwise a one-shot event, so a map opened, reloaded or reconnected + // after it had fired showed the propellors frozen. The map replaces a looped + // animation that is already playing, so nothing accumulates. + const bool reassert = aircraft->m_engineAnimationTime.isValid() + && (aircraft->m_engineAnimationTime.secsTo(dateTime) >= 300); + if (aircraft->m_emitterCategory == "Rotorcraft") + { + // Helicopter rotors + if (!aircraft->m_rotorStarted && !aircraft->m_onSurface) + { + // Start rotors + if (debug) { + qDebug() << "Start rotors " << aircraft->m_icaoHex; + } + if (hasRotor) { + animations->append(rotorAnimation(dateTime, false)); + } + aircraft->m_rotorStarted = true; + aircraft->m_engineAnimationTime = dateTime; + } + else if (aircraft->m_rotorStarted && aircraft->m_onSurface) + { + if (debug) { + qDebug() << "Stop rotors " << aircraft->m_icaoHex; + } + if (hasRotor) { + animations->append(rotorAnimation(dateTime, true)); + } + aircraft->m_rotorStarted = false; + } + else if (aircraft->m_rotorStarted && reassert) + { + if (hasRotor) { + animations->append(rotorAnimation(dateTime, false)); + } + aircraft->m_engineAnimationTime = dateTime; + } + } + else + { + // Propellors/fans + if (!aircraft->m_engineStarted && aircraft->m_groundspeedValid && (aircraft->m_groundspeed > 0)) + { + if (debug) { + qDebug() << "Start engines " << aircraft->m_icaoHex; + } + if (hasEngine1) { + animations->append(engineAnimation(dateTime, 1, false)); + } + if (hasEngine2) { + animations->append(engineAnimation(dateTime, 2, false)); + } + aircraft->m_engineStarted = true; + aircraft->m_engineAnimationTime = dateTime; + } + else if (aircraft->m_engineStarted && aircraft->m_groundspeedValid && (aircraft->m_groundspeed == 0)) + { + if (debug) { + qDebug() << "Stop engines " << aircraft->m_icaoHex; + } + if (hasEngine1) { + animations->append(engineAnimation(dateTime, 1, true)); + } + if (hasEngine2) { + animations->append(engineAnimation(dateTime, 2, true)); + } + aircraft->m_engineStarted = false; + } + else if (aircraft->m_engineStarted && reassert) + { + if (hasEngine1) { + animations->append(engineAnimation(dateTime, 1, false)); + } + if (hasEngine2) { + animations->append(engineAnimation(dateTime, 2, false)); + } + aircraft->m_engineAnimationTime = dateTime; + } + } + + // Estimate pitch, so it looks a little more realistic + if (aircraft->m_onSurface) + { + // Check speed so we don't set pitch to 0 immediately on touch-down + // Should probably record time of touch-down and reduce over time + if (aircraft->m_groundspeedValid) + { + if (aircraft->m_groundspeed < 80) { + aircraft->m_pitchEst = 0.0; + } else if ((aircraft->m_groundspeed < 130) && (aircraft->m_pitchEst >= 2)) { + aircraft->m_pitchEst = 1; + } + } + } + else if (aircraft->m_verticalRateValid) + { + // In the climb or the descent, the flight path angle: how fast the aircraft is + // climbing against how fast it is going forwards. This replaced an estimate made + // from the vertical rate alone, which took no account of speed - so the same rate + // gave the same attitude at 150 knots as at 500 - and, being an absolute value, + // pitched the nose up in the descent as well as the climb. + // The angle of attack above turns that path angle into the body attitude the + // model is drawn at and the attitude indicator reads. + // + // This used to stop as soon as the approach flaps came out, leaving the attitude + // frozen at whatever the configuration change had set - so an aircraft levelling + // off with the gear down was drawn as nose up as one descending at a thousand + // feet a minute. The flaps only change which angle of attack applies + if (aircraft->m_groundspeedValid && (aircraft->m_groundspeed > minPitchGroundspeed)) + { + const float aoa = (aircraft->m_flaps >= 0.25) ? landingAngleOfAttack : angleOfAttack; + + // Groundspeed rather than airspeed overstates the path angle into a + // headwind, by well under the degree the fixed values were out by + aircraft->m_pitchEst = aoa + Units::radiansToDegrees( + std::atan2((float) aircraft->m_verticalRate, aircraft->m_groundspeed * ftPerMinutePerKnot)); + } + } + + // Estimate some roll + if (aircraft->m_onSurface + || (aircraft->m_runwayAltitudeValid && (aircraft->m_altitude < (aircraft->m_runwayAltitude + accelerationHeight)))) + { + aircraft->m_rollEst = 0.0; + } + else if (aircraft->m_trackValid) + { + // Really need to use more data points for this - or better yet, get it from Mode-S frames + if (aircraft->m_prevTrackDateTime.isValid()) + { + qint64 msecs = aircraft->m_prevTrackDateTime.msecsTo(aircraft->m_headingDateTime); + if (msecs > 0) + { + float trackDiff = fmod(aircraft->m_track - aircraft->m_prevTrack + 540.0, 360.0) - 180.0; + float roll = trackDiff / (msecs / 1000.0); + //qDebug() << "Track Diff " << trackDiff << " msecs " << msecs << " roll " << roll; + roll = std::min(roll, 15.0f); + roll = std::max(roll, -15.0f); + aircraft->m_rollEst = roll; + } + } + aircraft->m_prevTrackDateTime = aircraft->m_trackDateTime; + aircraft->m_prevTrack = aircraft->m_track; + } + + return animations; +} + +SWGSDRangel::SWGMapAnimation *ADSBDemodTracker::gearAnimation(QDateTime startDateTime, bool up) +{ + // Gear up (0.0) / down (1.0) + SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); + animation->setName(new QString(ANIMATION_GEAR)); + animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); + animation->setReverse(up); + animation->setLoop(0); + animation->setDuration(5); + animation->setMultiplier(0.2f); + animation->setSound(new QString("A320_gear.wav")); + return animation; +} + +SWGSDRangel::SWGMapAnimation *ADSBDemodTracker::gearAngle(QDateTime startDateTime, bool flat) +{ + // Gear deflection - on ground it should be flat (0.0) in the air at an angle (1.0) + SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); + animation->setName(new QString(ANIMATION_GEAR_ANGLE)); + animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); + animation->setReverse(flat); + animation->setLoop(0); + animation->setDuration(1); + animation->setMultiplier(1); + return animation; +} + +SWGSDRangel::SWGMapAnimation *ADSBDemodTracker::flapsAnimation(QDateTime startDateTime, float currentFlaps, float flaps) +{ + // Extend / retract flags + bool retract = flaps < currentFlaps; + SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); + animation->setName(new QString(ANIMATION_FLAPS)); + animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); + animation->setReverse(retract); + animation->setLoop(0); + animation->setDuration(5*std::abs(flaps-currentFlaps)); + animation->setMultiplier(0.2f); + if (retract) { + animation->setStartOffset(1.0 - currentFlaps); + } else { + animation->setStartOffset(currentFlaps); + } + animation->setSound(new QString("A320_flaps.wav")); + return animation; +} + +SWGSDRangel::SWGMapAnimation *ADSBDemodTracker::slatsAnimation(QDateTime startDateTime, bool retract) +{ + // Extend / retract slats + SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); + animation->setName(new QString(ANIMATION_SLATS)); + animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); + animation->setReverse(retract); + animation->setLoop(0); + animation->setDuration(5); + animation->setMultiplier(0.2f); + return animation; +} + +SWGSDRangel::SWGMapAnimation *ADSBDemodTracker::rotorAnimation(QDateTime startDateTime, bool stop) +{ + // Turn rotors in helicopter.glb model + SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); + animation->setName(new QString(ANIMATION_ROTOR)); + animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); + animation->setReverse(false); + animation->setLoop(true); + animation->setMultiplier(1); + animation->setStop(stop); + return animation; +} + +SWGSDRangel::SWGMapAnimation *ADSBDemodTracker::engineAnimation(QDateTime startDateTime, int engine, bool stop) +{ + // Turn propellors. ModelConverterX bakes the engine_rotation_angle_deg dataref as + // one degree of rotation per second of animation, so it takes a large multiplier + // to look like a turning propellor - 720 is two revolutions a second + SWGSDRangel::SWGMapAnimation *animation = new SWGSDRangel::SWGMapAnimation(); + animation->setName(new QString(ANIMATION_ENGINE.arg(engine))); + animation->setStartDateTime(new QString(startDateTime.toString(Qt::ISODateWithMs))); + animation->setReverse(false); + animation->setLoop(true); + animation->setMultiplier(720); + animation->setStop(stop); + return animation; +} + +void ADSBDemodTracker::checkStaticNotification(ADSBAircraft *aircraft) +{ + for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) + { + QString match; + switch (m_settings.m_notificationSettings[i]->m_matchColumn) + { + case ADSB_COL_ICAO: + match = aircraft->cell(ADSB_COL_ICAO).toString(); + break; + case ADSB_COL_MODEL: + match = aircraft->cell(ADSB_COL_MODEL).toString(); + break; + case ADSB_COL_TYPE: + match = aircraft->cell(ADSB_COL_TYPE).toString(); + break; + case ADSB_COL_REGISTRATION: + match = aircraft->cell(ADSB_COL_REGISTRATION).toString(); + break; + case ADSB_COL_MANUFACTURER: + match = aircraft->cell(ADSB_COL_MANUFACTURER).toString(); + break; + case ADSB_COL_OWNER: + match = aircraft->cell(ADSB_COL_OWNER).toString(); + break; + case ADSB_COL_OPERATOR_ICAO: + match = aircraft->cell(ADSB_COL_OPERATOR_ICAO).toString(); + break; + default: + break; + } + if (!match.isEmpty()) + { + if (m_settings.m_notificationSettings[i]->m_regularExpression.isValid()) + { + if (m_settings.m_notificationSettings[i]->m_regularExpression.match(match).hasMatch()) + { + emit highlightRequest((quint32) aircraft->m_icao); + + if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) { + emit speechRequest(subAircraftString(aircraft, m_settings.m_notificationSettings[i]->m_speech)); + } + if (!m_settings.m_notificationSettings[i]->m_command.isEmpty()) { + commandNotification(aircraft, m_settings.m_notificationSettings[i]->m_command); + } + if (m_settings.m_notificationSettings[i]->m_autoTarget) { + emit targetRequest((quint32) aircraft->m_icao); + } + + aircraft->m_notified = true; + } + } + } + } +} + +void ADSBDemodTracker::checkDynamicNotification(ADSBAircraft *aircraft) +{ + if (!aircraft->m_notified) + { + for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) + { + if ( (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_CALLSIGN) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_ALTITUDE) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_GROUND_SPEED) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_RANGE) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_CATEGORY) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_STATUS) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_SQUAWK) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_DEP) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_ARR) + || (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_STOPS) + ) + { + QString match; + switch (m_settings.m_notificationSettings[i]->m_matchColumn) + { + case ADSB_COL_CALLSIGN: + match = aircraft->cell(ADSB_COL_CALLSIGN).toString(); + break; + case ADSB_COL_ALTITUDE: + match = aircraft->cell(ADSB_COL_ALTITUDE).toString(); + break; + case ADSB_COL_GROUND_SPEED: + match = aircraft->cell(ADSB_COL_GROUND_SPEED).toString(); + break; + case ADSB_COL_RANGE: + match = ADSBAircraft::rangeText(aircraft->cell(ADSB_COL_RANGE)); + break; + case ADSB_COL_CATEGORY: + match = aircraft->cell(ADSB_COL_CATEGORY).toString(); + break; + case ADSB_COL_STATUS: + match = aircraft->cell(ADSB_COL_STATUS).toString(); + break; + case ADSB_COL_SQUAWK: + match = aircraft->cell(ADSB_COL_SQUAWK).toString(); + break; + case ADSB_COL_DEP: + match = aircraft->cell(ADSB_COL_DEP).toString(); + break; + case ADSB_COL_ARR: + match = aircraft->cell(ADSB_COL_ARR).toString(); + break; + case ADSB_COL_STOPS: + match = aircraft->cell(ADSB_COL_STOPS).toString(); + break; + default: + break; + } + if (!match.isEmpty()) + { + if (m_settings.m_notificationSettings[i]->m_regularExpression.isValid()) + { + if (m_settings.m_notificationSettings[i]->m_regularExpression.match(match).hasMatch()) + { + emit highlightRequest((quint32) aircraft->m_icao); + + if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) { + emit speechRequest(subAircraftString(aircraft, m_settings.m_notificationSettings[i]->m_speech)); + } + if (!m_settings.m_notificationSettings[i]->m_command.isEmpty()) { + commandNotification(aircraft, m_settings.m_notificationSettings[i]->m_command); + } + if (m_settings.m_notificationSettings[i]->m_autoTarget) { + emit targetRequest((quint32) aircraft->m_icao); + } + + aircraft->m_notified = true; + } + } + } + } + } + } +} + +void ADSBDemodTracker::commandNotification(ADSBAircraft *aircraft, const QString &command) +{ +#if QT_CONFIG(process) + QString commandLine = subAircraftString(aircraft, command); + QStringList allArgs = QProcess::splitCommand(commandLine); + + if (allArgs.size() > 0) + { + QString program = allArgs[0]; + allArgs.pop_front(); + QProcess::startDetached(program, allArgs); + } +#else + qWarning() << "ADSBDemodTracker::commandNotification: QProcess not supported. Can't run: " << command; +#endif +} + +QString ADSBDemodTracker::subAircraftString(ADSBAircraft *aircraft, const QString &string) +{ + QString s = string; + s = s.replace("${icao}", aircraft->cell(ADSB_COL_ICAO).toString()); + s = s.replace("${callsign}", aircraft->cell(ADSB_COL_CALLSIGN).toString()); + s = s.replace("${aircraft}", aircraft->cell(ADSB_COL_MODEL).toString()); + s = s.replace("${type}", aircraft->cell(ADSB_COL_TYPE).toString()); + s = s.replace("${speed}", aircraft->cell(ADSB_COL_GROUND_SPEED).toString()); // For backwards compatibility + s = s.replace("${gs}", aircraft->cell(ADSB_COL_GROUND_SPEED).toString()); + s = s.replace("${tas}", aircraft->cell(ADSB_COL_TRUE_AIRSPEED).toString()); + s = s.replace("${ias}", aircraft->cell(ADSB_COL_INDICATED_AIRSPEED).toString()); + s = s.replace("${mach}", aircraft->cell(ADSB_COL_MACH).toString()); + s = s.replace("${selAltitude}", aircraft->cell(ADSB_COL_SEL_ALTITUDE).toString()); + s = s.replace("${altitude}", aircraft->cell(ADSB_COL_ALTITUDE).toString()); + s = s.replace("${verticalRate}", aircraft->cell(ADSB_COL_VERTICALRATE).toString()); + s = s.replace("${selHeading}", aircraft->cell(ADSB_COL_SEL_HEADING).toString()); + s = s.replace("${heading}", aircraft->cell(ADSB_COL_HEADING).toString()); + s = s.replace("${track}", aircraft->cell(ADSB_COL_TRACK).toString()); + s = s.replace("${turnRate}", aircraft->cell(ADSB_COL_TURNRATE).toString()); + s = s.replace("${roll}", aircraft->cell(ADSB_COL_ROLL).toString()); + s = s.replace("${range}", ADSBAircraft::rangeText(aircraft->cell(ADSB_COL_RANGE))); + s = s.replace("${azel}", aircraft->cell(ADSB_COL_AZEL).toString()); + s = s.replace("${category}", aircraft->cell(ADSB_COL_CATEGORY).toString()); + s = s.replace("${status}", aircraft->cell(ADSB_COL_STATUS).toString()); + s = s.replace("${squawk}", aircraft->cell(ADSB_COL_SQUAWK).toString()); + s = s.replace("${ident}", aircraft->cell(ADSB_COL_IDENT).toString()); + s = s.replace("${registration}", aircraft->cell(ADSB_COL_REGISTRATION).toString()); + s = s.replace("${manufacturer}", aircraft->cell(ADSB_COL_MANUFACTURER).toString()); + s = s.replace("${owner}", aircraft->cell(ADSB_COL_OWNER).toString()); + s = s.replace("${operator}", aircraft->cell(ADSB_COL_OPERATOR_ICAO).toString()); + s = s.replace("${ap}", aircraft->cell(ADSB_COL_AP).toString()); + s = s.replace("${vMode}", aircraft->cell(ADSB_COL_V_MODE).toString()); + s = s.replace("${lMode}", aircraft->cell(ADSB_COL_L_MODE).toString()); + s = s.replace("${tcas}", aircraft->cell(ADSB_COL_TCAS).toString()); + s = s.replace("${acas}", aircraft->cell(ADSB_COL_ACAS).toString()); + s = s.replace("${ra}", aircraft->cell(ADSB_COL_RA).toString()); + s = s.replace("${maxSpeed}", aircraft->cell(ADSB_COL_MAX_SPEED).toString()); + s = s.replace("${version}", aircraft->cell(ADSB_COL_VERSION).toString()); + s = s.replace("${length}", aircraft->cell(ADSB_COL_LENGTH).toString()); + s = s.replace("${width}", aircraft->cell(ADSB_COL_WIDTH).toString()); + s = s.replace("${baro}", aircraft->cell(ADSB_COL_BARO).toString()); + s = s.replace("${headwind}", aircraft->cell(ADSB_COL_HEADWIND).toString()); + s = s.replace("${windSpeed}", aircraft->cell(ADSB_COL_WIND_SPEED).toString()); + s = s.replace("${windDirection}", aircraft->cell(ADSB_COL_WIND_DIR).toString()); + s = s.replace("${staticPressure}", aircraft->cell(ADSB_COL_STATIC_PRESSURE).toString()); + s = s.replace("${staticAirTemperature}", aircraft->cell(ADSB_COL_STATIC_AIR_TEMP).toString()); + s = s.replace("${humidity}", aircraft->cell(ADSB_COL_HUMIDITY).toString()); + s = s.replace("${latitude}", aircraft->cell(ADSB_COL_LATITUDE).toString()); + s = s.replace("${longitude}", aircraft->cell(ADSB_COL_LONGITUDE).toString()); + s = s.replace("${ic}", aircraft->cell(ADSB_COL_IC).toString()); + s = s.replace("${rssi}", aircraft->cell(ADSB_COL_RSSI).toString()); + s = s.replace("${flightstatus}", aircraft->cell(ADSB_COL_FLIGHT_STATUS).toString()); + s = s.replace("${departure}", aircraft->cell(ADSB_COL_DEP).toString()); + s = s.replace("${arrival}", aircraft->cell(ADSB_COL_ARR).toString()); + s = s.replace("${stops}", aircraft->cell(ADSB_COL_STOPS).toString()); + s = s.replace("${std}", aircraft->cell(ADSB_COL_STD).toString()); + s = s.replace("${etd}", aircraft->cell(ADSB_COL_ETD).toString()); + s = s.replace("${atd}", aircraft->cell(ADSB_COL_ATD).toString()); + s = s.replace("${sta}", aircraft->cell(ADSB_COL_STA).toString()); + s = s.replace("${eta}", aircraft->cell(ADSB_COL_ETA).toString()); + s = s.replace("${ata}", aircraft->cell(ADSB_COL_ATA).toString()); + return s; +} + +// The matching itself lives in sdrbase now, shared with the Aircraft feature: see +// Aircraft3DModels. What stays here is only the ADS-B specific part - remembering the +// result on the aircraft, and the emitter category fallback below, which no other protocol +// can use because no other protocol transmits a category. +void ADSBDemodTracker::get3DModel(ADSBAircraft *aircraft) +{ + if (!aircraft->m_aircraftInfo) { + return; + } + + QString model; + float altitudeOffset = aircraft->m_modelAltitudeOffset; + float labelOffset = aircraft->m_labelAltitudeOffset; + + const Aircraft3DModels &models = Aircraft3DModels::instance(); + // Failing a model of its own type, a stand-in of the right shape for the type it is - + // a business jet for a Premier, a twin turboprop for a King Air. That knows more than + // the emitter category, so it is kept in preference to one: a category stand-in + // names a single type, which may well not be installed + if (models.modelFor(aircraft->m_aircraftInfo, m_settings.m_favourLivery, + m_settings.m_verboseModelMatching, model, altitudeOffset, labelOffset) + || models.defaultModel(aircraft->m_aircraftInfo->m_type.trimmed().toUpper(), + model, altitudeOffset, labelOffset, true)) + { + aircraft->m_aircraft3DModel = model; + aircraft->m_modelAltitudeOffset = altitudeOffset; + aircraft->m_labelAltitudeOffset = labelOffset; + } +} + +void ADSBDemodTracker::get3DModelBasedOnCategory(ADSBAircraft *aircraft) +{ + QString aircraftType; + QStringList candidateTypes; // Any of these will do, for Heavy and Large + static const QStringList large = {"A319", "A320", "A321", "B737", "B738", "B739", "A20N", "A21N"}; + + if (!aircraft->m_emitterCategory.compare("Heavy")) + { + static const QStringList heavy = {"B744", "B77W", "B788", "A388", "B789", "A359", "B772", "A333", + "A332", "B763", "B748", "A346"}; + candidateTypes = heavy; + } + else if (!aircraft->m_emitterCategory.compare("Large")) + { + candidateTypes = large; + } + else if (!aircraft->m_emitterCategory.compare("Small") || !aircraft->m_emitterCategory.compare("Light")) + { + // Whatever of the right shape is installed: the Bluebell set has a Learjet 45 and + // a Cessna 172, the FSLTL one neither but a Learjet 25, Caravan, TBM and DA62. A + // single named type left these with no model at all with only the FSLTL set + const bool light = !aircraft->m_emitterCategory.compare("Light"); + QString model; + float altitudeOffset = aircraft->m_modelAltitudeOffset; + float labelOffset = aircraft->m_labelAltitudeOffset; + aircraft->m_aircraftCat3DModel = ""; + if (Aircraft3DModels::instance().defaultModel(light ? "C172" : "LJ45", model, altitudeOffset, labelOffset)) + { + aircraft->m_aircraftCat3DModel = model; + aircraft->m_modelAltitudeOffset = altitudeOffset; + aircraft->m_labelAltitudeOffset = labelOffset; + } + } + else if (!aircraft->m_emitterCategory.compare("Rotorcraft")) + { + aircraft->m_aircraftCat3DModel = "helicopter.glb"; + aircraft->m_modelAltitudeOffset = 4.0f; + aircraft->m_labelAltitudeOffset = 4.0f; + } + else if (!aircraft->m_emitterCategory.compare("High performance")) + { + aircraft->m_aircraftCat3DModel = "f15.glb"; + aircraft->m_modelAltitudeOffset = 1.0f; + aircraft->m_labelAltitudeOffset = 6.0f; + } + else if (!aircraft->m_emitterCategory.compare("Ultralight")) + { + aircraft->m_aircraftCat3DModel = "ultralight.glb"; + aircraft->m_modelAltitudeOffset = 0.55f; + aircraft->m_labelAltitudeOffset = 0.75f; + } + else if (!aircraft->m_emitterCategory.compare("Glider/sailplane")) + { + aircraft->m_aircraftCat3DModel = "glider.glb"; + aircraft->m_modelAltitudeOffset = 1.0f; + aircraft->m_labelAltitudeOffset = 1.5f; + } + else if (!aircraft->m_emitterCategory.compare("Space vehicle")) + { + aircraft->m_aircraftCat3DModel = "atlas_v.glb"; + aircraft->m_labelAltitudeOffset = 16.0f; + } + else if (!aircraft->m_emitterCategory.compare("UAV")) + { + aircraft->m_aircraftCat3DModel = "drone.glb"; + aircraft->m_labelAltitudeOffset = 1.0f; + } + else if (!aircraft->m_emitterCategory.compare("Emergency vehicle")) + { + aircraft->m_aircraftCat3DModel = "fire_truck.glb"; + aircraft->m_modelAltitudeOffset = 0.3f; + aircraft->m_labelAltitudeOffset = 2.5f; + } + else if (!aircraft->m_emitterCategory.compare("Service vehicle")) + { + aircraft->m_aircraftCat3DModel = "airport_truck.glb"; + aircraft->m_labelAltitudeOffset = 3.0f; + } + else + { + // No category, or one with no stand-in of its own: most likely an airliner + candidateTypes = large; + } + + if (!candidateTypes.isEmpty()) + { + // Any type of the category in the operator's livery, rather than a type chosen at + // random and then the livery only if that type has it - which, with a BA callsign + // and a 737-800 drawn, gave another airline's 737. An aircraft the database doesn't + // know still has its operator in its callsign: the first three letters of an airline + // callsign are its ICAO code + const Aircraft3DModels& models = Aircraft3DModels::instance(); + QStringList operators; + if (aircraft->m_aircraftInfo && !aircraft->m_aircraftInfo->m_operatorICAO.isEmpty()) { + operators.append(aircraft->m_aircraftInfo->m_operatorICAO); + } + static const QRegularExpression airlineCallsign("^([A-Z]{3})[0-9]"); + const QRegularExpressionMatch match = airlineCallsign.match(aircraft->m_callsign); + if (match.hasMatch() && !operators.contains(match.captured(1))) { + operators.append(match.captured(1)); + } + const int start = m_random.bounded(candidateTypes.size()); + QString model; + for (const QString &op : operators) + { + for (int i = 0; (i < candidateTypes.size()) && model.isEmpty(); i++) + { + const QString &type = candidateTypes[(start + i) % candidateTypes.size()]; + model = models.modelForTypeAndOperator(type, op); + if (!model.isEmpty()) { + aircraftType = type; + } + } + if (!model.isEmpty()) { + break; + } + } + // Otherwise any livery of the first of them that is installed + for (int i = 0; (i < candidateTypes.size()) && model.isEmpty(); i++) + { + const QString &type = candidateTypes[(start + i) % candidateTypes.size()]; + model = models.modelForType(type); + if (!model.isEmpty()) { + aircraftType = type; + } + } + aircraft->m_aircraftCat3DModel = model; + if (!model.isEmpty()) { + models.offsetsForType(aircraftType, aircraft->m_modelAltitudeOffset, aircraft->m_labelAltitudeOffset, model); + } + } +} + + +int ADSBDemodTracker::countActiveAircraft() +{ + int total = 0; + QDateTime now = QDateTime::currentDateTime(); + qint64 nowSecs = now.toSecsSinceEpoch(); + QHash::iterator i = m_aircraft.begin(); + + while (i != m_aircraft.end()) + { + ADSBAircraft *aircraft = i.value(); + qint64 secondsSinceLastFrame = nowSecs - aircraft->m_updateTime.toSecsSinceEpoch(); + + if (secondsSinceLastFrame < 10) { + total++; + } + + ++i; + } + + return total; +} + +void ADSBDemodTracker::removeAircraft(QHash::iterator& i, ADSBAircraft *aircraft) +{ + + // Don't try to track it anymore + if (m_trackAircraft == aircraft) + { + m_adsbDemod->clearTarget(); + m_trackAircraft = nullptr; + } + + // The GUI removes it from the table and the map when told + m_dirtyAircraft.remove(aircraft); + m_removedAircraft.append((quint32) aircraft->m_icao); + // Remove aircraft from hash + i = m_aircraft.erase(i); + // Remove from map feature + clearFromMap(aircraft->m_icaoHex); + + // And finally free its memory + discardMapUpdate(aircraft); + delete aircraft; +} + +void ADSBDemodTracker::sendAircraftReport() +{ + ADSBDemod::MsgAircraftReport* message = ADSBDemod::MsgAircraftReport::create(); + + QList& report = message->getReport(); + report.reserve(m_aircraft.size()); + + QHash::iterator i = m_aircraft.begin(); + while (i != m_aircraft.end()) + { + ADSBAircraft *aircraft = i.value(); + + ADSBDemod::MsgAircraftReport::AircraftReport aircraftReport { + aircraft->m_icaoHex, + aircraft->m_callsign, + aircraft->m_latitude, + aircraft->m_longitude, + aircraft->m_altitude, + aircraft->m_groundspeed + }; + + report.append(aircraftReport); + + ++i; + } + + m_adsbDemod->getInputMessageQueue()->push(message); +} + +ADSBAircraft* ADSBDemodTracker::findAircraftByFlight(const QString& flight) +{ + QHash::iterator i = m_aircraft.begin(); + while (i != m_aircraft.end()) + { + ADSBAircraft *aircraft = i.value(); + if (aircraft->m_flight == flight) { + return aircraft; + } + ++i; + } + return nullptr; +} + +int ADSBDemodTracker::squawkDecode(int modeA) const +{ + int a, b, c, d; + c = ((modeA >> 12) & 1) | ((modeA >> (10-1)) & 0x2) | ((modeA >> (8-2)) & 0x4); + a = ((modeA >> 11) & 1) | ((modeA >> (9-1)) & 0x2) | ((modeA >> (7-2)) & 0x4); + b = ((modeA >> 5) & 1) | ((modeA >> (3-1)) & 0x2) | ((modeA << (1)) & 0x4); + d = ((modeA >> 4) & 1) | ((modeA >> (2-1)) & 0x2) | ((modeA << (2)) & 0x4); + return a*1000 + b*100 + c*10 + d; +} + +// https://en.wikipedia.org/wiki/Gillham_code +int ADSBDemodTracker::gillhamToFeet(int n) const +{ + int c1 = (n >> 10) & 1; + int a1 = (n >> 9) & 1; + int c2 = (n >> 8) & 1; + int a2 = (n >> 7) & 1; + int c4 = (n >> 6) & 1; + int a4 = (n >> 5) & 1; + int b1 = (n >> 4) & 1; + int b2 = (n >> 3) & 1; + int d2 = (n >> 2) & 1; + int b4 = (n >> 1) & 1; + int d4 = n & 1; + + int n500 = grayToBinary((d2 << 7) | (d4 << 6) | (a1 << 5) | (a2 << 4) | (a4 << 3) | (b1 << 2) | (b2 << 1) | b4, 8); + int n100 = grayToBinary((c1 << 2) | (c2 << 1) | c4, 3) - 1; + + if (n100 == 6) { + n100 = 4; + } + if (n500 %2 != 0) { + n100 = 4 - n100; + } + + return -1200 + n500*500 + n100*100; +} + +int ADSBDemodTracker::grayToBinary(int gray, int bits) const +{ + int binary = 0; + for (int i = bits - 1; i >= 0; i--) { + binary = binary | ((((1 << (i+1)) & binary) >> 1) ^ ((1 << i) & gray)); + } + return binary; +} + +void ADSBDemodTracker::updateQNH(const ADSBAircraft *aircraft, float qnh) +{ + if (!m_settings.m_manualQNH) + { + // Ignore aircraft that have QNH set to STD. + if ( ((qnh < 1012) || (std::floor(qnh) > 1013)) + || ( (aircraft->m_altitudeValid && (aircraft->m_altitude < (m_settings.m_transitionAlt - 1000))) + && (aircraft->m_selAltitudeValid && (aircraft->m_selAltitude < m_settings.m_transitionAlt)) // If we have qnh, we'll have selAltitude as well + ) + ) { + // Use moving average, otherwise it can jump around if we can receive aircraft from different airports with different QNH + m_qnhAvg(qnh); + + // This runs for every aircraft that reports a barometric setting, so several + // times a second. Reporting it unconditionally left QSpinBox::setValue() as + // the only thing deciding whether anything happened, and the rounded average + // sits near a boundary for long stretches - so the value oscillated between + // two adjacent hectopascals and each change fanned a full settings update out + // to the baseband, the sink, the worker and this tracker, logging five lines + // a time. A whole hectopascal of hysteresis stops that: QNH is only quoted to + // 1 hPa anyway, and it moves that much over tens of minutes, not milliseconds. + const float average = m_qnhAvg.instantAverage(); + if ((m_qnhReported == 0) || (std::abs(average - m_qnhReported) >= 1.0f)) + { + const int rounded = (int) round(average); + if (rounded != m_qnhReported) + { + m_qnhReported = rounded; + emit qnhEstimate(rounded); + } + } + } + } +} + +// Called again whenever the station position changes, as the outline is drawn around it +void ADSBDemodTracker::initCoverageMap() +{ + float lat = m_azEl.getLocationSpherical().m_latitude; + float lon = m_azEl.getLocationSpherical().m_longitude; + for (int i = 0; i < 2; i++) + { +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + m_maxRange[i].resize(360/ADSBDemodTracker::m_maxRangeDeg, 0.0f); +#else + for (int j = 0; j < 360/ADSBDemodTracker::m_maxRangeDeg; j++) { + m_maxRange[i].append(0.0f); + } +#endif + m_coverageAirspace[i].m_polygon.resize(2 * 360/ADSBDemodTracker::m_maxRangeDeg); + m_coverageAirspace[i].m_center.setX(lon); + m_coverageAirspace[i].m_center.setY(lat); + if (i == 0) + { + m_coverageAirspace[i].m_position.setX(lon); + m_coverageAirspace[i].m_position.setY(lat); + m_coverageAirspace[i].m_bottom.m_alt = 0; + m_coverageAirspace[i].m_top.m_alt = 10000; + m_coverageAirspace[i].m_name = "Coverage Map Low"; + } + else + { + m_coverageAirspace[i].m_position.setX(lon); + m_coverageAirspace[i].m_position.setY(lat + 0.01); + m_coverageAirspace[i].m_bottom.m_alt = 10000; + m_coverageAirspace[i].m_top.m_alt = 66000; + m_coverageAirspace[i].m_name = "Coverage Map High"; + } + } + clearCoverageMap(); +} + +void ADSBDemodTracker::clearCoverageMap() +{ + for (int j = 0; j < 2; j++) + { + for (int i = 0; i < m_maxRange[j].size(); i++) { + m_maxRange[j][i] = 0.0f; + } + const float d = 0.01f; + for (int i = 0; i < m_coverageAirspace[j].m_polygon.size(); i+=2) + { + float f = i / (float) m_coverageAirspace[j].m_polygon.size(); + m_coverageAirspace[j].m_polygon[i].setX(m_coverageAirspace[j].m_center.x() + d * sin(f * 2*M_PI)); + m_coverageAirspace[j].m_polygon[i].setY(m_coverageAirspace[j].m_center.y() + d * cos(f * 2*M_PI)); + m_coverageAirspace[j].m_polygon[i+1].setX(m_coverageAirspace[j].m_center.x() + d * sin(f * 2*M_PI)); + m_coverageAirspace[j].m_polygon[i+1].setY(m_coverageAirspace[j].m_center.y() + d * cos(f * 2*M_PI)); + } + } +} + +void ADSBDemodTracker::updateCoverageMap(float azimuth, float elevation, float distance, float altitude) +{ + (void) elevation; + + int i = (int) (azimuth / ADSBDemodTracker::m_maxRangeDeg); + int k = altitude >= 10000 ? 1 : 0; + if (distance > m_maxRange[k][i]) + { + m_maxRange[k][i] = distance; + + float lat; + float lon; + float b1 = i * ADSBDemodTracker::m_maxRangeDeg; + calcRadialEndPoint(m_azEl.getLocationSpherical().m_latitude, m_azEl.getLocationSpherical().m_longitude, distance, b1, lat, lon); + m_coverageAirspace[k].m_polygon[i*2].setX(lon); + m_coverageAirspace[k].m_polygon[i*2].setY(lat); + + float b2 = (i + 1) * ADSBDemodTracker::m_maxRangeDeg; + calcRadialEndPoint(m_azEl.getLocationSpherical().m_latitude, m_azEl.getLocationSpherical().m_longitude, distance, b2, lat, lon); + m_coverageAirspace[k].m_polygon[i*2+1].setX(lon); + m_coverageAirspace[k].m_polygon[i*2+1].setY(lat); + + emit coverageUpdated(k, m_coverageAirspace[k].m_polygon); + } +} + +void ADSBDemodTracker::clearCoverage() +{ + clearCoverageMap(); + for (int i = 0; i < 2; i++) { + emit coverageUpdated(i, m_coverageAirspace[i].m_polygon); + } +} + + +void ADSBDemodTracker::applyImportSettings() +{ + invalidateImportAuthentication(); + m_importTimer->setInterval(m_settings.m_importPeriod * 1000); + if (m_settings.m_feedEnabled && m_settings.m_importEnabled) { + m_importTimer->start(); + } else { + m_importTimer->stop(); + } +} + +bool ADSBDemodTracker::importCredentialsConfigured() const +{ + return !m_settings.m_importClientId.isEmpty() && !m_settings.m_importClientSecret.isEmpty(); +} + +bool ADSBDemodTracker::importAccessTokenValid() const +{ + return !m_importAccessToken.isEmpty() + && QDateTime::currentDateTimeUtc() < m_importAccessTokenExpiry; +} + +void ADSBDemodTracker::invalidateImportAuthentication() +{ + ++m_importRequestGeneration; + m_importTokenReply.clear(); + m_importStatesReply.clear(); + m_importAccessToken.clear(); + m_importAccessTokenExpiry = QDateTime(); + m_importAuthenticationRetry = false; +} + +void ADSBDemodTracker::requestImportAccessToken() +{ + static const QUrl tokenUrl( + QStringLiteral("https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token")); + + if (!m_importNetworkManager || m_importTokenReply || m_importStatesReply) { + return; + } + + const auto encodeFormComponent = [](const QString& value) { + QByteArray encoded = QUrl::toPercentEncoding(value); + encoded.replace("%20", "+"); + return encoded; + }; + QByteArray form("grant_type=client_credentials&client_id="); + form.append(encodeFormComponent(m_settings.m_importClientId)); + form.append("&client_secret="); + form.append(encodeFormComponent(m_settings.m_importClientSecret)); + + QNetworkRequest request(tokenUrl); + request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded")); + QNetworkReply *reply = m_importNetworkManager->post(request, form); + reply->setProperty("adsbImportReplyType", QStringLiteral("token")); + reply->setProperty("adsbImportGeneration", m_importRequestGeneration); + m_importTokenReply = reply; +} + +void ADSBDemodTracker::sendImportRequest() +{ + if (!m_importNetworkManager || m_importTokenReply || m_importStatesReply) { + return; + } + + QString urlString = "https://"; + urlString = urlString + m_settings.m_importHost + "/api/states/all"; + QChar join = '?'; + if (!m_settings.m_importParameters.isEmpty()) + { + urlString = urlString + join + m_settings.m_importParameters; + join = '&'; + } + if (!m_settings.m_importMinLatitude.isEmpty()) + { + urlString = urlString + join + "lamin=" + m_settings.m_importMinLatitude; + join = '&'; + } + if (!m_settings.m_importMaxLatitude.isEmpty()) + { + urlString = urlString + join + "lamax=" + m_settings.m_importMaxLatitude; + join = '&'; + } + if (!m_settings.m_importMinLongitude.isEmpty()) + { + urlString = urlString + join + "lomin=" + m_settings.m_importMinLongitude; + join = '&'; + } + if (!m_settings.m_importMaxLongitude.isEmpty()) + { + urlString = urlString + join + "lomax=" + m_settings.m_importMaxLongitude; + join = '&'; + } + QNetworkRequest request = QNetworkRequest(QUrl(urlString)); + if (importCredentialsConfigured() && importAccessTokenValid()) { + request.setRawHeader("Authorization", "Bearer " + m_importAccessToken.toUtf8()); + } + + QNetworkReply *reply = m_importNetworkManager->get(request); + reply->setProperty("adsbImportReplyType", QStringLiteral("states")); + reply->setProperty("adsbImportGeneration", m_importRequestGeneration); + m_importStatesReply = reply; +} + +// Import ADS-B data from opensky-network via an API call +void ADSBDemodTracker::import() +{ + if (!m_importNetworkManager || m_importTokenReply || m_importStatesReply) { + return; + } + + m_importAuthenticationRetry = false; + + const bool clientIdSet = !m_settings.m_importClientId.isEmpty(); + const bool clientSecretSet = !m_settings.m_importClientSecret.isEmpty(); + if (clientIdSet != clientSecretSet) + { + qWarning() << "ADSBDemodTracker::import: OpenSky authentication requires both a client ID and client secret"; + return; + } + + if (!clientIdSet || importAccessTokenValid()) { + sendImportRequest(); + } else { + requestImportAccessToken(); + } +} + +void ADSBDemodTracker::handleImportNetworkReply(QNetworkReply *reply) +{ + if (!reply) { + return; + } + + if (m_importTokenReply == reply) { + m_importTokenReply.clear(); + } + if (m_importStatesReply == reply) { + m_importStatesReply.clear(); + } + + const int generation = reply->property("adsbImportGeneration").toInt(); + if (generation != m_importRequestGeneration) + { + reply->deleteLater(); + return; + } + + const QString replyType = reply->property("adsbImportReplyType").toString(); + if (replyType == QStringLiteral("token")) { + handleImportTokenReply(reply); + } else if (replyType == QStringLiteral("states")) { + handleImportReply(reply); + } else { + qWarning() << "ADSBDemodTracker::handleImportNetworkReply: Unknown reply type"; + } + + reply->deleteLater(); +} + +void ADSBDemodTracker::handleImportTokenReply(QNetworkReply *reply) +{ + if (reply->error() != QNetworkReply::NoError) + { + qWarning() << "ADSBDemodTracker::handleImportTokenReply: OpenSky token request failed:" + << reply->errorString(); + m_importAuthenticationRetry = false; + return; + } + + QJsonParseError parseError; + const QJsonDocument document = QJsonDocument::fromJson(reply->readAll(), &parseError); + if ((parseError.error != QJsonParseError::NoError) || !document.isObject()) + { + qWarning() << "ADSBDemodTracker::handleImportTokenReply: Invalid OpenSky token response:" + << parseError.errorString(); + m_importAuthenticationRetry = false; + return; + } + + const QJsonObject object = document.object(); + const QString accessToken = object.value(QStringLiteral("access_token")).toString(); + if (accessToken.isEmpty()) + { + qWarning() << "ADSBDemodTracker::handleImportTokenReply: OpenSky token response has no access token"; + m_importAuthenticationRetry = false; + return; + } + + const int expiresIn = object.value(QStringLiteral("expires_in")).toInt(1800); + const int refreshMargin = qMin(30, qMax(0, expiresIn / 10)); + m_importAccessToken = accessToken; + m_importAccessTokenExpiry = QDateTime::currentDateTimeUtc().addSecs(qMax(1, expiresIn - refreshMargin)); + + if (m_settings.m_feedEnabled && m_settings.m_importEnabled) { + sendImportRequest(); + } +} + +// Handle opensky-network API call reply +void ADSBDemodTracker::handleImportReply(QNetworkReply* reply) +{ + if (reply) + { + const int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + if ((statusCode == 401) && importCredentialsConfigured() && !m_importAuthenticationRetry) + { + m_importAccessToken.clear(); + m_importAccessTokenExpiry = QDateTime(); + m_importAuthenticationRetry = true; + requestImportAccessToken(); + return; + } + + if (!reply->error()) + { + QJsonDocument document = QJsonDocument::fromJson(reply->readAll()); + if (document.isObject()) + { + QJsonObject obj = document.object(); + if (obj.contains("time") && obj.contains("states")) + { + int seconds = obj.value("time").toInt(); + QDateTime dateTime = QDateTime::fromSecsSinceEpoch(seconds); + QJsonArray states = obj.value("states").toArray(); + for (int i = 0; i < states.size(); i++) + { + QJsonArray state = states[i].toArray(); + int icao = state[0].toString().toInt(nullptr, 16); + + bool newAircraft; + ADSBAircraft *aircraft = getAircraft(icao, newAircraft); + + QString callsign = state[1].toString().trimmed(); + if (!callsign.isEmpty()) { + setCallsign(aircraft, callsign); + } + + QDateTime timePosition = dateTime; + if (state[3].isNull()) { + timePosition = dateTime.addSecs(-15); // At least 15 seconds old + } else { + timePosition = QDateTime::fromSecsSinceEpoch(state[3].toInt()); + } + aircraft->m_rxTime = QDateTime::fromSecsSinceEpoch(state[4].toInt()); + aircraft->m_updateTime = QDateTime::currentDateTime(); + QTime time = aircraft->m_updateTime.time(); + aircraft->setCell(ADSB_COL_TIME, QString("%1:%2:%3").arg(time.hour(), 2, 10, QLatin1Char('0')).arg(time.minute(), 2, 10, QLatin1Char('0')).arg(time.second(), 2, 10, QLatin1Char('0'))); + aircraft->m_adsbFrameCount++; + aircraft->setCell(ADSB_COL_ADSB_FRAMECOUNT, aircraft->m_adsbFrameCount); + + if (timePosition > aircraft->m_positionDateTime) + { + if (!state[5].isNull() && !state[6].isNull()) + { + updateAircraftPosition(aircraft, state[6].toDouble(), state[5].toDouble(), timePosition); + aircraft->m_cprValid[0] = false; + aircraft->m_cprValid[1] = false; + } + if (!state[7].isNull()) + { + aircraft->setAltitude((int)Units::metresToFeet(state[7].toDouble()), false, dateTime, m_settings); + aircraft->m_altitudeDateTime = timePosition; + } + if (!state[5].isNull() && !state[6].isNull() && !state[7].isNull()) + { + /*QGeoCoordinate coord(aircraft->m_latitude, aircraft->m_longitude, aircraft->m_altitude); + aircraft->m_coordinates.push_back(QVariant::fromValue(coord)); + aircraft->m_coordinateDateTimes.push_back(dateTime); + */ + aircraft->m_positionChanged = true; + } + } + aircraft->m_onSurface = state[8].toBool(false); + aircraft->m_onSurfaceValid = true; + if (!state[9].isNull()) { + aircraft->setGroundspeed((int)std::round(Units::metresPerSecondToKnots(state[9].toDouble())), m_settings); + } + if (!state[10].isNull()) { + aircraft->setTrack((float)state[10].toDouble(), aircraft->m_rxTime); + } + if (!state[11].isNull()) { + aircraft->setVerticalRate((int)std::round(Units::metresPerSecondToFeetPerMin(state[11].toDouble())), m_settings); + } + if (!state[14].isNull()) + { + aircraft->m_squawk = state[14].toString().toInt(); + aircraft->setCell(ADSB_COL_SQUAWK, QString("%1").arg(aircraft->m_squawk, 4, 10, QLatin1Char('0'))); + } + + // Update aircraft in map + if (aircraft->m_positionValid) + { + // Check to see if we need to start any animations + QList *animations = animate(dateTime, aircraft); + + + // Send to Map feature + sendToMap(aircraft, animations); + } + + // Check to see if we need to emit a notification about this aircraft + checkDynamicNotification(aircraft); + } + } + else + { + qDebug() << "ADSBDemodTracker::handleImportReply: Document object does not contain time and states: " << document; + } + } + else + { + qDebug() << "ADSBDemodTracker::handleImportReply: Document is not an object: " << document; + } + } + else + { + qWarning() << "ADSBDemodTracker::handleImportReply: OpenSky states request failed:" + << reply->errorString(); + } + m_importAuthenticationRetry = false; + } +} + + +QString ADSBDemodTracker::dataTimeToShortString(QDateTime dt) +{ + if (dt.isValid()) + { + QDate currentDate = QDateTime::currentDateTimeUtc().date(); + if (dt.date() == currentDate) + { + return dt.time().toString("hh:mm"); + } + else + { + int days = currentDate.daysTo(dt.date()); + if (days >= 0) { + return QString("%1 +%2").arg(dt.time().toString("hh:mm")).arg(days); + } else { + return QString("%1 %2").arg(dt.time().toString("hh:mm")).arg(days); + } + } + } + else + { + return ""; + } +} + + +void ADSBDemodTracker::initFlightInformation() +{ + if (m_flightInformation) + { + disconnect(m_flightInformation, &FlightInformation::flightUpdated, this, &ADSBDemodTracker::flightInformationUpdated); + delete m_flightInformation; + m_flightInformation = nullptr; + } + if (!m_settings.m_aviationstackAPIKey.isEmpty()) + { + m_flightInformation = FlightInformation::create(m_settings.m_aviationstackAPIKey); + if (m_flightInformation) { + connect(m_flightInformation, &FlightInformation::flightUpdated, this, &ADSBDemodTracker::flightInformationUpdated); + } + } +} + + +void ADSBDemodTracker::flightInformationUpdated(const FlightInformation::Flight& flight) +{ + ADSBAircraft *aircraft = findAircraftByFlight(flight.m_flightICAO); + if (aircraft) + { + aircraft->setCell(ADSB_COL_FLIGHT_STATUS, flight.m_flightStatus); + aircraft->setCell(ADSB_COL_DEP, flight.m_departureICAO); + aircraft->setCell(ADSB_COL_ARR, flight.m_arrivalICAO); + aircraft->setCell(ADSB_COL_STOPS, ""); + aircraft->setCell(ADSB_COL_STD, ADSBDemodTracker::dataTimeToShortString(flight.m_departureScheduled)); + aircraft->setCell(ADSB_COL_ETD, ADSBDemodTracker::dataTimeToShortString(flight.m_departureEstimated)); + aircraft->setCell(ADSB_COL_ATD, ADSBDemodTracker::dataTimeToShortString(flight.m_departureActual)); + aircraft->setCell(ADSB_COL_STA, ADSBDemodTracker::dataTimeToShortString(flight.m_arrivalScheduled)); + aircraft->setCell(ADSB_COL_ETA, ADSBDemodTracker::dataTimeToShortString(flight.m_arrivalEstimated)); + aircraft->setCell(ADSB_COL_ATA, ADSBDemodTracker::dataTimeToShortString(flight.m_arrivalActual)); + // The GUI refreshes the map label and the photo panel from the update + markDirty(aircraft); + emit photoRefresh((quint32) aircraft->m_icao); + } + else + { + qDebug() << "ADSBDemodTracker::flightInformationUpdated - Flight not found in ADS-B table: " << flight.m_flightICAO; + } +} diff --git a/plugins/channelrx/demodadsb/adsbdemodworker.cpp b/plugins/channelrx/demodadsb/adsbdemodworker.cpp index 2a81f3eaf..c6bbe0ba7 100644 --- a/plugins/channelrx/demodadsb/adsbdemodworker.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodworker.cpp @@ -88,63 +88,51 @@ void ADSBBeastServer::discardClient() } ADSBDemodWorker::ADSBDemodWorker() : - m_running(false) + m_heartbeatTimer(nullptr), + m_socket(nullptr), + m_beastServer(nullptr) { - connect(&m_heartbeatTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); - connect(&m_socket, SIGNAL(readyRead()),this, SLOT(recv())); - connect(&m_socket, SIGNAL(connected()), this, SLOT(connected())); - connect(&m_socket, SIGNAL(disconnected()), this, SLOT(disconnected())); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - connect(&m_socket, QOverload::of(&QAbstractSocket::error), this, &ADSBDemodWorker::errorOccurred); -#else - connect(&m_socket, &QAbstractSocket::errorOccurred, this, &ADSBDemodWorker::errorOccurred); -#endif m_startTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); - m_heartbeatTimer.start(60*1000); } ADSBDemodWorker::~ADSBDemodWorker() { - m_heartbeatTimer.stop(); - - m_beastServer.close(); - - if (m_socket.state() != QAbstractSocket::UnconnectedState) { - m_socket.close(); + if (m_socket && m_socket->isOpen()) { + m_socket->close(); } - - m_inputMessageQueue.clear(); -} - -void ADSBDemodWorker::reset() -{ - QMutexLocker mutexLocker(&m_mutex); - m_inputMessageQueue.clear(); -} - -bool ADSBDemodWorker::startWork() -{ - QMutexLocker mutexLocker(&m_mutex); - - if (m_running) { - return m_running; + if (m_beastServer) { + m_beastServer->close(); } - - connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - m_running = true; - return m_running; + if (m_logFile.isOpen()) { + m_logFile.close(); + } + delete m_heartbeatTimer; + delete m_socket; + delete m_beastServer; + m_inputMessageQueue.clear(); } -void ADSBDemodWorker::stopWork() +void ADSBDemodWorker::startWork() { - QMutexLocker mutexLocker(&m_mutex); - - if (!m_running) { - return; - } + // Created here so they belong to the thread that will use them + m_socket = new QTcpSocket(); + m_beastServer = new ADSBBeastServer(); + m_heartbeatTimer = new QTimer(); + + connect(m_heartbeatTimer, &QTimer::timeout, this, &ADSBDemodWorker::heartbeat); + connect(m_socket, &QTcpSocket::readyRead, this, &ADSBDemodWorker::recv); + connect(m_socket, &QTcpSocket::connected, this, &ADSBDemodWorker::connected); + connect(m_socket, &QTcpSocket::disconnected, this, &ADSBDemodWorker::disconnected); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + connect(m_socket, QOverload::of(&QAbstractSocket::error), this, &ADSBDemodWorker::errorOccurred); +#else + connect(m_socket, &QAbstractSocket::errorOccurred, this, &ADSBDemodWorker::errorOccurred); +#endif + m_heartbeatTimer->start(60*1000); - disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - m_running = false; + connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &ADSBDemodWorker::handleInputMessages); + // Settings can arrive before the thread has started running + handleInputMessages(); } void ADSBDemodWorker::handleInputMessages() @@ -164,7 +152,6 @@ bool ADSBDemodWorker::handleMessage(const Message& message) { if (MsgConfigureADSBDemodWorker::match(message)) { - QMutexLocker mutexLocker(&m_mutex); MsgConfigureADSBDemodWorker& cfg = (MsgConfigureADSBDemodWorker&) message; applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce()); @@ -203,12 +190,12 @@ void ADSBDemodWorker::applySettings(const ADSBDemodSettings& settings, const QSt || force) { // Close any existing connection - if (m_socket.isOpen()) { - m_socket.close(); + if (m_socket->isOpen()) { + m_socket->close(); } // Open connection if (settings.m_feedEnabled && settings.m_exportClientEnabled) { - m_socket.connectToHost(settings.m_exportClientHost, settings.m_exportClientPort); + m_socket->connectToHost(settings.m_exportClientHost, settings.m_exportClientPort); } } @@ -217,11 +204,11 @@ void ADSBDemodWorker::applySettings(const ADSBDemodSettings& settings, const QSt || (settingsKeys.contains("exportServerPort") && (settings.m_exportServerPort != m_settings.m_exportServerPort)) || force) { - if (m_beastServer.isListening()) { - m_beastServer.close(); + if (m_beastServer->isListening()) { + m_beastServer->close(); } if (settings.m_feedEnabled && settings.m_exportServerEnabled) { - m_beastServer.listen(settings.m_exportServerPort); + m_beastServer->listen(settings.m_exportServerPort); } } @@ -281,7 +268,7 @@ void ADSBDemodWorker::recv() { // Not expecting to receiving anything from server qDebug() << "ADSBDemodWorker::recv"; - qDebug() << m_socket.readAll(); + qDebug() << m_socket->readAll(); } void ADSBDemodWorker::send(const char *data, int length) @@ -289,11 +276,11 @@ void ADSBDemodWorker::send(const char *data, int length) if (m_settings.m_feedEnabled && m_settings.m_exportClientEnabled) { // Reopen connection if it was lost - if (!m_socket.isOpen()) { - m_socket.connectToHost(m_settings.m_exportClientHost, m_settings.m_exportClientPort); + if (!m_socket->isOpen()) { + m_socket->connectToHost(m_settings.m_exportClientHost, m_settings.m_exportClientPort); } // Send data - m_socket.write(data, length); + m_socket->write(data, length); } } @@ -314,7 +301,7 @@ char *ADSBDemodWorker::escape(char *p, char c) void ADSBDemodWorker::handleADSB(QByteArray data, const QDateTime dateTime, float correlation) { if (m_logFile.isOpen()) { - m_logStream << dateTime.date().toString() << "," << dateTime.time().toString() << "," << data.toHex() << "," << correlation << "\n"; + m_logStream << dateTime.date().toString() << "," << dateTime.time().toString(QStringLiteral("hh:mm:ss.zzz")) << "," << data.toHex() << "," << correlation << "\n"; } if (m_settings.m_feedEnabled && (m_settings.m_exportClientEnabled || m_settings.m_exportServerEnabled)) @@ -365,7 +352,7 @@ void ADSBDemodWorker::handleADSB(QByteArray data, const QDateTime dateTime, floa send(beastBinary, length); } if (m_settings.m_exportServerEnabled) { - m_beastServer.send(beastBinary, length); + m_beastServer->send(beastBinary, length); } } if (m_settings.m_exportClientEnabled && (m_settings.m_exportClientFormat == ADSBDemodSettings::BeastHex)) @@ -379,14 +366,11 @@ void ADSBDemodWorker::handleADSB(QByteArray data, const QDateTime dateTime, floa // Periodically send heartbeat to keep connection alive void ADSBDemodWorker::heartbeat() { - if (m_running) - { - const char heartbeat[] = {BEAST_ESC, '1', 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Mode AC packet - if (m_settings.m_exportClientEnabled) { - send(heartbeat, sizeof(heartbeat)); - } - if (m_settings.m_exportServerEnabled) { - m_beastServer.send(heartbeat, sizeof(heartbeat)); - } + const char heartbeat[] = {BEAST_ESC, '1', 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Mode AC packet + if (m_settings.m_feedEnabled && m_settings.m_exportClientEnabled) { + send(heartbeat, sizeof(heartbeat)); + } + if (m_settings.m_feedEnabled && m_settings.m_exportServerEnabled) { + m_beastServer->send(heartbeat, sizeof(heartbeat)); } } diff --git a/plugins/channelrx/demodadsb/adsbdemodworker.h b/plugins/channelrx/demodadsb/adsbdemodworker.h index 0f04240be..20e42b2a0 100644 --- a/plugins/channelrx/demodadsb/adsbdemodworker.h +++ b/plugins/channelrx/demodadsb/adsbdemodworker.h @@ -84,24 +84,25 @@ public: ADSBDemodWorker(); ~ADSBDemodWorker(); - void reset(); - bool startWork(); - void stopWork(); - bool isRunning() const { return m_running; } MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } +public slots: + // Called when the worker thread starts; everything with thread affinity is + // created here rather than in the constructor + void startWork(); + +public: + private: MessageQueue m_inputMessageQueue; ADSBDemodSettings m_settings; - bool m_running; - QRecursiveMutex m_mutex; - QTimer m_heartbeatTimer; - QTcpSocket m_socket; + QTimer *m_heartbeatTimer; + QTcpSocket *m_socket; QFile m_logFile; QTextStream m_logStream; qint64 m_startTime; - ADSBBeastServer m_beastServer; + ADSBBeastServer *m_beastServer; bool handleMessage(const Message& cmd); void applySettings(const ADSBDemodSettings& settings, const QStringList& settingsKeys, bool force = false); diff --git a/plugins/channelrx/demodadsb/adsbosmtemplateserver.h b/plugins/channelrx/demodadsb/adsbosmtemplateserver.h index efddffaf3..1830db214 100644 --- a/plugins/channelrx/demodadsb/adsbosmtemplateserver.h +++ b/plugins/channelrx/demodadsb/adsbosmtemplateserver.h @@ -28,14 +28,15 @@ class ADSBOSMTemplateServer : public QTcpServer { Q_OBJECT private: - QString m_thunderforestAPIKey; QString m_maptilerAPIKey; + QString m_cartoDBAPIKey; public: // port - port to listen on / is listening on. Use 0 for any free port. - ADSBOSMTemplateServer(const QString &maptilerAPIKey, quint16 &port, QObject* parent = 0) : + ADSBOSMTemplateServer(const QString &maptilerAPIKey, const QString &cartoDBAPIKey, quint16 &port, QObject* parent = 0) : QTcpServer(parent), - m_maptilerAPIKey(maptilerAPIKey) + m_maptilerAPIKey(maptilerAPIKey), + m_cartoDBAPIKey(cartoDBAPIKey) { listen(QHostAddress::Any, port); port = serverPort(); @@ -100,14 +101,14 @@ private slots: int idx = map.indexOf(tokens[1]); xml = QString("\ {\ - \"UrlTemplate\" : \"http://1.basemaps.cartocdn.com/%2/%z/%x/%y.png%1\",\ + \"UrlTemplate\" : \"http://1.basemaps.cartocdn.com/%2/%z/%x/%y.png%1?key=%4\",\ \"ImageFormat\" : \"png\",\ \"QImageFormat\" : \"Indexed8\",\ \"ID\" : \"%3\",\ \"MaximumZoomLevel\" : 20,\ \"MapCopyRight\" : \"CartoDB\",\ \"DataCopyRight\" : \"CartoDB\"\ - }").arg(hiresURL).arg(mapUrl[idx]).arg(mapId[idx]); + }").arg(hiresURL).arg(mapUrl[idx]).arg(mapId[idx]).arg(m_cartoDBAPIKey); } else { diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N.png b/plugins/channelrx/demodadsb/map/liveries/A20N.png new file mode 100644 index 000000000..1fd5ec55a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AAN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AAN.png new file mode 100644 index 000000000..ef35a6fc2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_ACI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_ACI.png new file mode 100644 index 000000000..d5e762511 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_ACI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_ADH.png b/plugins/channelrx/demodadsb/map/liveries/A20N_ADH.png new file mode 100644 index 000000000..672a9dc88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_ADH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AEE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AEE.png new file mode 100644 index 000000000..8dc3a1426 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AFL.png new file mode 100644 index 000000000..3fce854bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AFX.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AFX.png new file mode 100644 index 000000000..6feee8957 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AHY.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AHY.png new file mode 100644 index 000000000..a3324bbee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AIC.png new file mode 100644 index 000000000..29c57f3d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AIC_VTI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AIC_VTI.png new file mode 100644 index 000000000..7183f5650 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AIC_VTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AIQ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AIQ.png new file mode 100644 index 000000000..870954204 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AIQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A20N_ALK.png new file mode 100644 index 000000000..83e12ff42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AMC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AMC.png new file mode 100644 index 000000000..9366be5e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AMC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AMU.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AMU.png new file mode 100644 index 000000000..da0bf1bc4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AMU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AMV.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AMV.png new file mode 100644 index 000000000..70ed5fd3a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AMV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_ANA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_ANA.png new file mode 100644 index 000000000..875f136f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_ANZ.png new file mode 100644 index 000000000..e6d54a4d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_APJ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_APJ.png new file mode 100644 index 000000000..2bf2bb3c3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_APJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AUA.png new file mode 100644 index 000000000..b4bcd203a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AUL.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AUL.png new file mode 100644 index 000000000..3935c1b5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AUL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AVA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AVA.png new file mode 100644 index 000000000..29ae58b9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AXM.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AXM.png new file mode 100644 index 000000000..377317d7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AXM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_AZU.png b/plugins/channelrx/demodadsb/map/liveries/A20N_AZU.png new file mode 100644 index 000000000..205afe569 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_BAV.png b/plugins/channelrx/demodadsb/map/liveries/A20N_BAV.png new file mode 100644 index 000000000..0c8eca0ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_BAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A20N_BAW.png new file mode 100644 index 000000000..4e7c3a27b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_BEL.png b/plugins/channelrx/demodadsb/map/liveries/A20N_BEL.png new file mode 100644 index 000000000..a782cfda1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_BHE.png new file mode 100644 index 000000000..8f1d9d70f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_BTK.png b/plugins/channelrx/demodadsb/map/liveries/A20N_BTK.png new file mode 100644 index 000000000..9a267eeff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_BTK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A20N_BVX.png new file mode 100644 index 000000000..5b4b218e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CBJ.png new file mode 100644 index 000000000..3d15f011e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CCA.png new file mode 100644 index 000000000..ee32a43c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CCM.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CCM.png new file mode 100644 index 000000000..43178c9df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CCM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CDC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CDC.png new file mode 100644 index 000000000..bcac7bf08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CDC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CEB.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CEB.png new file mode 100644 index 000000000..718a82a75 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CES.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CES.png new file mode 100644 index 000000000..e2d34e43c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CFG_PASSION.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CFG_PASSION.png new file mode 100644 index 000000000..3881439d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CFG_PASSION.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CGZ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CGZ.png new file mode 100644 index 000000000..1a461fbce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CGZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CHB.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CHB.png new file mode 100644 index 000000000..47c7cbb5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CHB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CQH.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CQH.png new file mode 100644 index 000000000..42b153e8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CQH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CQN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CQN.png new file mode 100644 index 000000000..02a83f4e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CQN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CSC.png new file mode 100644 index 000000000..2db50e82c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CSN.png new file mode 100644 index 000000000..0248fd677 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CSZ.png new file mode 100644 index 000000000..728e8ce44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_CTV.png b/plugins/channelrx/demodadsb/map/liveries/A20N_CTV.png new file mode 100644 index 000000000..4a7f114d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_CTV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_DKH.png b/plugins/channelrx/demodadsb/map/liveries/A20N_DKH.png new file mode 100644 index 000000000..967b1c2d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_DKH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A20N_DLH.png new file mode 100644 index 000000000..0b009df09 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EAG.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EAG.png new file mode 100644 index 000000000..fb7cea8c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EIN.png new file mode 100644 index 000000000..7479bc396 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EJU.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EJU.png new file mode 100644 index 000000000..2957eb1ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EJU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EUS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EUS.png new file mode 100644 index 000000000..f4295b555 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EWG.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EWG.png new file mode 100644 index 000000000..96d82f1f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EZS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EZS.png new file mode 100644 index 000000000..b55a9fa04 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EZS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_EZY.png b/plugins/channelrx/demodadsb/map/liveries/A20N_EZY.png new file mode 100644 index 000000000..84bab3369 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_EZY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FAD.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FAD.png new file mode 100644 index 000000000..bb630854a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FAD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FBT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FBT.png new file mode 100644 index 000000000..8890f8fb2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FBV.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FBV.png new file mode 100644 index 000000000..d8ffd2aa2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_316.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_316.png new file mode 100644 index 000000000..478c35f9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_316.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_341.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_341.png new file mode 100644 index 000000000..9961d2c5c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_341.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_350.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_350.png new file mode 100644 index 000000000..a89139b1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_350.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_372.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_372.png new file mode 100644 index 000000000..a4d4fec24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_372.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_373.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_373.png new file mode 100644 index 000000000..08f3c077f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FFT_373.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FHA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FHA.png new file mode 100644 index 000000000..2b539dcea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FLI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FLI.png new file mode 100644 index 000000000..596ff0dfc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FLI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FPY.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FPY.png new file mode 100644 index 000000000..97d3335c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FPY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FUZ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FUZ.png new file mode 100644 index 000000000..22bf09c4e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FUZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_FYI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_FYI.png new file mode 100644 index 000000000..3a955d7c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_FYI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_GCR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_GCR.png new file mode 100644 index 000000000..ce3a1b8a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_GCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_GFA.png new file mode 100644 index 000000000..4aa9b2d37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_GOW.png b/plugins/channelrx/demodadsb/map/liveries/A20N_GOW.png new file mode 100644 index 000000000..e04e6c477 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_GOW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_GOW_OC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_GOW_OC.png new file mode 100644 index 000000000..6ef2d379b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_GOW_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_GVY.png b/plugins/channelrx/demodadsb/map/liveries/A20N_GVY.png new file mode 100644 index 000000000..1f6dc4d2b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_GVY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_HAZ.png new file mode 100644 index 000000000..ca84f278f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_HKE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_HKE.png new file mode 100644 index 000000000..1b2044281 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_HKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_HVN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_HVN.png new file mode 100644 index 000000000..a6a716680 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_HXA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_HXA.png new file mode 100644 index 000000000..55ab34d1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_HXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_IAD.png b/plugins/channelrx/demodadsb/map/liveries/A20N_IAD.png new file mode 100644 index 000000000..f3203f38d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_IAD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_IBE.png new file mode 100644 index 000000000..2f1278b1e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_IGO.png b/plugins/channelrx/demodadsb/map/liveries/A20N_IGO.png new file mode 100644 index 000000000..43fc2cfe2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_IGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_ITY.png b/plugins/channelrx/demodadsb/map/liveries/A20N_ITY.png new file mode 100644 index 000000000..e28a6e843 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_ITY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_JAT_TORTUGA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_JAT_TORTUGA.png new file mode 100644 index 000000000..0d1165871 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_JAT_TORTUGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_JHL.png b/plugins/channelrx/demodadsb/map/liveries/A20N_JHL.png new file mode 100644 index 000000000..da7cd7df5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_JHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_JZR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_JZR.png new file mode 100644 index 000000000..bc1476264 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_JZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_KAC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_KAC.png new file mode 100644 index 000000000..c138d7620 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_KLM.png b/plugins/channelrx/demodadsb/map/liveries/A20N_KLM.png new file mode 100644 index 000000000..1408f2c09 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_KMM.png b/plugins/channelrx/demodadsb/map/liveries/A20N_KMM.png new file mode 100644 index 000000000..9366be5e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_KMM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_KNE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_KNE.png new file mode 100644 index 000000000..55f843843 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_KNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_KZR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_KZR.png new file mode 100644 index 000000000..40cfc23ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_LAN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_LAN.png new file mode 100644 index 000000000..2084a99be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_LBT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_LBT.png new file mode 100644 index 000000000..b90cd0dfc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_LBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_LHA_VA.png new file mode 100644 index 000000000..c03734640 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_LHX.png b/plugins/channelrx/demodadsb/map/liveries/A20N_LHX.png new file mode 100644 index 000000000..2e33d81bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_LHX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_LKE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_LKE.png new file mode 100644 index 000000000..7620c4180 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_LKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_LNR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_LNR.png new file mode 100644 index 000000000..4a0421f51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_MBU.png b/plugins/channelrx/demodadsb/map/liveries/A20N_MBU.png new file mode 100644 index 000000000..bfe62c348 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_MBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_MET.png b/plugins/channelrx/demodadsb/map/liveries/A20N_MET.png new file mode 100644 index 000000000..9f0fe34a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_MQT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_MQT.png new file mode 100644 index 000000000..8d62557d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_MSC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_MSC.png new file mode 100644 index 000000000..02de0b743 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_MSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_MSR.png new file mode 100644 index 000000000..a01126355 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A20N_NDF.png new file mode 100644 index 000000000..d177e56db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_NKS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_NKS.png new file mode 100644 index 000000000..14acca868 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_NKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A20N_NTL.png new file mode 100644 index 000000000..6a48069bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_OMS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_OMS.png new file mode 100644 index 000000000..ec97d9ca2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_OMS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_PFF.png b/plugins/channelrx/demodadsb/map/liveries/A20N_PFF.png new file mode 100644 index 000000000..70a1e1b26 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_PGT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_PGT.png new file mode 100644 index 000000000..3a32c6bc2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_PGT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_QDA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_QDA.png new file mode 100644 index 000000000..f40b1afd7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_QDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_RBA.png b/plugins/channelrx/demodadsb/map/liveries/A20N_RBA.png new file mode 100644 index 000000000..61bb35350 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_RBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_RZO.png b/plugins/channelrx/demodadsb/map/liveries/A20N_RZO.png new file mode 100644 index 000000000..66fa67716 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_RZO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SAS.png new file mode 100644 index 000000000..d5ca41bef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SBI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SBI.png new file mode 100644 index 000000000..de674c0d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SCO.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SCO.png new file mode 100644 index 000000000..f4295b555 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SEH.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SEH.png new file mode 100644 index 000000000..fa82aabb3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SEH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SHT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SHT.png new file mode 100644 index 000000000..4e7c3a27b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SKU.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SKU.png new file mode 100644 index 000000000..f7562e766 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SKU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SVR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SVR.png new file mode 100644 index 000000000..b53f54852 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SWR.png new file mode 100644 index 000000000..b6d0a86fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_SZS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_SZS.png new file mode 100644 index 000000000..cd02071c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_SZS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TAI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TAI.png new file mode 100644 index 000000000..fcc277966 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TAM.png new file mode 100644 index 000000000..25ebf152e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TAP.png new file mode 100644 index 000000000..0053d9b5b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TAR.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TAR.png new file mode 100644 index 000000000..82baa0b42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TEJ.png new file mode 100644 index 000000000..819521b43 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TGW.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TGW.png new file mode 100644 index 000000000..0d32271c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TGW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TKJ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TKJ.png new file mode 100644 index 000000000..39d4d8f87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TKJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TKY.png new file mode 100644 index 000000000..efa8df6a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TNU.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TNU.png new file mode 100644 index 000000000..c3d36c125 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TNU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TTW.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TTW.png new file mode 100644 index 000000000..0cfe03429 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TTW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_TVF.png b/plugins/channelrx/demodadsb/map/liveries/A20N_TVF.png new file mode 100644 index 000000000..95e3b9be0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_TVF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_UKV.png b/plugins/channelrx/demodadsb/map/liveries/A20N_UKV.png new file mode 100644 index 000000000..9082a83d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_UZB.png b/plugins/channelrx/demodadsb/map/liveries/A20N_UZB.png new file mode 100644 index 000000000..c0942e71d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_UZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VAE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VAE.png new file mode 100644 index 000000000..f4bb60bef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VCP.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VCP.png new file mode 100644 index 000000000..6692359d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VIV.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VIV.png new file mode 100644 index 000000000..f43a807c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VIV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VLG.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VLG.png new file mode 100644 index 000000000..4cba32899 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VOC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VOC.png new file mode 100644 index 000000000..cdf9eab0c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VOC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VOI.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VOI.png new file mode 100644 index 000000000..be26644dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VOI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VOS.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VOS.png new file mode 100644 index 000000000..d85518c91 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VOS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VRE.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VRE.png new file mode 100644 index 000000000..8d79daa7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_VVC.png b/plugins/channelrx/demodadsb/map/liveries/A20N_VVC.png new file mode 100644 index 000000000..3a0c389b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_VVC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_WAT.png new file mode 100644 index 000000000..c7771d994 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_WMT.png b/plugins/channelrx/demodadsb/map/liveries/A20N_WMT.png new file mode 100644 index 000000000..e3c501d39 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_WMT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_WTB.png b/plugins/channelrx/demodadsb/map/liveries/A20N_WTB.png new file mode 100644 index 000000000..0d4d22d1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_WTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_WZZ.png b/plugins/channelrx/demodadsb/map/liveries/A20N_WZZ.png new file mode 100644 index 000000000..131ac6bc1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_WZZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A20N_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A20N_XSN.png new file mode 100644 index 000000000..f1962ab4f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A20N_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N.png b/plugins/channelrx/demodadsb/map/liveries/A21N.png new file mode 100644 index 000000000..4afab6a88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AAL.png new file mode 100644 index 000000000..143290535 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AAR.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AAR.png new file mode 100644 index 000000000..fb9e6201c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ABL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ABL.png new file mode 100644 index 000000000..32a965fd4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ABL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ABQ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ABQ.png new file mode 100644 index 000000000..5310d41f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ABQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ABY.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ABY.png new file mode 100644 index 000000000..8529c9b08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ABY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ACA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ACA.png new file mode 100644 index 000000000..cd2c902b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AEE.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AEE.png new file mode 100644 index 000000000..adf5ad702 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AFL.png new file mode 100644 index 000000000..f436a8481 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AFX.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AFX.png new file mode 100644 index 000000000..6964457c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AIC.png new file mode 100644 index 000000000..34d4d3195 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AIC_VTI.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AIC_VTI.png new file mode 100644 index 000000000..06dedca0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AIC_VTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AIQ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AIQ.png new file mode 100644 index 000000000..d5ea06023 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AIQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AIZ_4X-AGH.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AIZ_4X-AGH.png new file mode 100644 index 000000000..7e6734e19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AIZ_4X-AGH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AIZ_4X-AGK.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AIZ_4X-AGK.png new file mode 100644 index 000000000..a03c76862 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AIZ_4X-AGK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ALK.png new file mode 100644 index 000000000..91abe7df7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AMU.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AMU.png new file mode 100644 index 000000000..19a2da5e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AMU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ANA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ANA.png new file mode 100644 index 000000000..186e268ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ANZ.png new file mode 100644 index 000000000..ab419ca46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_APJ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_APJ.png new file mode 100644 index 000000000..874c7c409 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_APJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ASA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ASA.png new file mode 100644 index 000000000..2eac8ba71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AVA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AVA.png new file mode 100644 index 000000000..086c7f293 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AWC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AWC.png new file mode 100644 index 000000000..6eef3c41a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AXM.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AXM.png new file mode 100644 index 000000000..a0c3b3f17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AXM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_AZU.png b/plugins/channelrx/demodadsb/map/liveries/A21N_AZU.png new file mode 100644 index 000000000..18530d824 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_BAV.png b/plugins/channelrx/demodadsb/map/liveries/A21N_BAV.png new file mode 100644 index 000000000..05c8fdad6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_BAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A21N_BAW.png new file mode 100644 index 000000000..332aa405c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A21N_BHE.png new file mode 100644 index 000000000..8d21a7978 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A21N_BVX.png new file mode 100644 index 000000000..c4b2944fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CAL.png new file mode 100644 index 000000000..c4edea02e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CBJ.png new file mode 100644 index 000000000..ca254273c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CCA.png new file mode 100644 index 000000000..b9c8ca353 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CDC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CDC.png new file mode 100644 index 000000000..3af6144fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CDC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CEB.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CEB.png new file mode 100644 index 000000000..72a708f48 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CFG_ISLAND.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CFG_ISLAND.png new file mode 100644 index 000000000..5d0e9da76 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CFG_ISLAND.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CFG_SUNSHINE.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CFG_SUNSHINE.png new file mode 100644 index 000000000..0376bd6fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CFG_SUNSHINE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CPA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CPA.png new file mode 100644 index 000000000..164919074 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CQH.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CQH.png new file mode 100644 index 000000000..70a17fce9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CQH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CQN.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CQN.png new file mode 100644 index 000000000..42c94c3e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CQN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CSC.png new file mode 100644 index 000000000..b06372d2f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CSN.png new file mode 100644 index 000000000..af3efaeac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CSZ.png new file mode 100644 index 000000000..92d8f6502 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_CXA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_CXA.png new file mode 100644 index 000000000..095ba5127 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_CXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_DAL.png new file mode 100644 index 000000000..6d82da886 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_DJT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_DJT.png new file mode 100644 index 000000000..e20f2c2cd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_DJT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_DKH.png b/plugins/channelrx/demodadsb/map/liveries/A21N_DKH.png new file mode 100644 index 000000000..e61112a74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_DKH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A21N_DLH.png new file mode 100644 index 000000000..8413b240a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EIN.png new file mode 100644 index 000000000..f724daa9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EJU.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EJU.png new file mode 100644 index 000000000..404470a9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EJU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ETD.png new file mode 100644 index 000000000..ace83812b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EUK.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EUK.png new file mode 100644 index 000000000..004e05e55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EUS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EUS.png new file mode 100644 index 000000000..6fe5ee415 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EWG.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EWG.png new file mode 100644 index 000000000..36d52ab38 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EXS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EXS.png new file mode 100644 index 000000000..6f6a1d9e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EZY.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EZY.png new file mode 100644 index 000000000..bb630d138 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EZY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_EZY_UK.png b/plugins/channelrx/demodadsb/map/liveries/A21N_EZY_UK.png new file mode 100644 index 000000000..963c9b379 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_EZY_UK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_FBV.png b/plugins/channelrx/demodadsb/map/liveries/A21N_FBV.png new file mode 100644 index 000000000..98d1d3fba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_FFT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_FFT.png new file mode 100644 index 000000000..8728789fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_FPY.png b/plugins/channelrx/demodadsb/map/liveries/A21N_FPY.png new file mode 100644 index 000000000..86d09e7c3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_FPY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_FWC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_FWC.png new file mode 100644 index 000000000..eb18c9677 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_GFA.png new file mode 100644 index 000000000..d5c346625 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_HAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_HAL.png new file mode 100644 index 000000000..5fa9c8f85 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_HAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_HAZ.png new file mode 100644 index 000000000..8e50f26d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_HKE.png b/plugins/channelrx/demodadsb/map/liveries/A21N_HKE.png new file mode 100644 index 000000000..87d59aaad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_HKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_HVN.png b/plugins/channelrx/demodadsb/map/liveries/A21N_HVN.png new file mode 100644 index 000000000..e71696bb3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_HYS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_HYS.png new file mode 100644 index 000000000..6d433d7c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_HYS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_IBS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_IBS.png new file mode 100644 index 000000000..427a690a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_IBS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ICE.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ICE.png new file mode 100644 index 000000000..69e873694 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ICE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_IGO.png b/plugins/channelrx/demodadsb/map/liveries/A21N_IGO.png new file mode 100644 index 000000000..f2c06a7e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_IGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_ITY.png b/plugins/channelrx/demodadsb/map/liveries/A21N_ITY.png new file mode 100644 index 000000000..2ac9857ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_ITY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_JBU.png b/plugins/channelrx/demodadsb/map/liveries/A21N_JBU.png new file mode 100644 index 000000000..c1368b14c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_JBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_JJP.png b/plugins/channelrx/demodadsb/map/liveries/A21N_JJP.png new file mode 100644 index 000000000..822ea3863 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_JJP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_JST.png b/plugins/channelrx/demodadsb/map/liveries/A21N_JST.png new file mode 100644 index 000000000..4fb5c1569 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_JST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_KAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_KAL.png new file mode 100644 index 000000000..6ae51d0ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_KLM.png b/plugins/channelrx/demodadsb/map/liveries/A21N_KLM.png new file mode 100644 index 000000000..10119bb48 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_KZR.png b/plugins/channelrx/demodadsb/map/liveries/A21N_KZR.png new file mode 100644 index 000000000..8afde67dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_MEA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_MEA.png new file mode 100644 index 000000000..e57de741b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_MEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_MQT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_MQT.png new file mode 100644 index 000000000..91ce23c9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A21N_MSR.png new file mode 100644 index 000000000..44c748f3c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A21N_NDF.png new file mode 100644 index 000000000..0396e9627 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_NKS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_NKS.png new file mode 100644 index 000000000..ad6eb4076 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_NKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_NTL.png new file mode 100644 index 000000000..d24908d98 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_NVR.png b/plugins/channelrx/demodadsb/map/liveries/A21N_NVR.png new file mode 100644 index 000000000..737c32daa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_NVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_NWS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_NWS.png new file mode 100644 index 000000000..f1ac13525 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_OAL_VA.png new file mode 100644 index 000000000..d077d3379 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_OMS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_OMS.png new file mode 100644 index 000000000..be2ce784c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_OMS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_PAL.png new file mode 100644 index 000000000..54929857f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_PGT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_PGT.png new file mode 100644 index 000000000..ff1ac8a67 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_PGT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_QFA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_QFA.png new file mode 100644 index 000000000..2c42d2d86 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_QNT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_QNT.png new file mode 100644 index 000000000..85ee3cbf6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_QNT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_RZO_TSF.png b/plugins/channelrx/demodadsb/map/liveries/A21N_RZO_TSF.png new file mode 100644 index 000000000..69006bced Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_RZO_TSF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_RZO_TSH.png b/plugins/channelrx/demodadsb/map/liveries/A21N_RZO_TSH.png new file mode 100644 index 000000000..9b8e6361d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_RZO_TSH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SAS.png new file mode 100644 index 000000000..5d6165de0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SBI.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SBI.png new file mode 100644 index 000000000..0d3c7caa5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SCO.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SCO.png new file mode 100644 index 000000000..6fe5ee415 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SEH.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SEH.png new file mode 100644 index 000000000..3b35be8a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SEH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SHT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SHT.png new file mode 100644 index 000000000..9ac8e6ea1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SJX.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SJX.png new file mode 100644 index 000000000..8e41c429a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SJX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SKU.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SKU.png new file mode 100644 index 000000000..f33de35dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SKU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_STW.png b/plugins/channelrx/demodadsb/map/liveries/A21N_STW.png new file mode 100644 index 000000000..acbc993a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_STW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SVR.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SVR.png new file mode 100644 index 000000000..df4aaeb6c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SWR.png new file mode 100644 index 000000000..e2df5f0b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_SZN.png b/plugins/channelrx/demodadsb/map/liveries/A21N_SZN.png new file mode 100644 index 000000000..ecf63aa63 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_SZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TAM.png new file mode 100644 index 000000000..f0c9a857f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TAP.png new file mode 100644 index 000000000..78cce3e6f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TEJ.png new file mode 100644 index 000000000..7f912e541 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TGW.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TGW.png new file mode 100644 index 000000000..95f42001d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TGW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_THY.png b/plugins/channelrx/demodadsb/map/liveries/A21N_THY.png new file mode 100644 index 000000000..6827f49db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TKJ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TKJ.png new file mode 100644 index 000000000..63f8cf09e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TKJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TKY.png new file mode 100644 index 000000000..067fc71a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TRA.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TRA.png new file mode 100644 index 000000000..f47b7ddc2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_TSC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_TSC.png new file mode 100644 index 000000000..548550c04 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_TSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_UAL.png b/plugins/channelrx/demodadsb/map/liveries/A21N_UAL.png new file mode 100644 index 000000000..57ffbfadc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_UKV.png b/plugins/channelrx/demodadsb/map/liveries/A21N_UKV.png new file mode 100644 index 000000000..53040d527 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_UZB.png b/plugins/channelrx/demodadsb/map/liveries/A21N_UZB.png new file mode 100644 index 000000000..cc6e604db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_UZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_VCP.png b/plugins/channelrx/demodadsb/map/liveries/A21N_VCP.png new file mode 100644 index 000000000..246adef2c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_VIV.png b/plugins/channelrx/demodadsb/map/liveries/A21N_VIV.png new file mode 100644 index 000000000..d77240fa7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_VIV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_VJC.png b/plugins/channelrx/demodadsb/map/liveries/A21N_VJC.png new file mode 100644 index 000000000..02f2312a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_VJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_VLG.png b/plugins/channelrx/demodadsb/map/liveries/A21N_VLG.png new file mode 100644 index 000000000..7b5dd3dcd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_VLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_VOI.png b/plugins/channelrx/demodadsb/map/liveries/A21N_VOI.png new file mode 100644 index 000000000..32edb2f16 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_VOI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_WAT.png new file mode 100644 index 000000000..a5d84ec48 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_WAZ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_WAZ.png new file mode 100644 index 000000000..6b1554e44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_WAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_WMT.png b/plugins/channelrx/demodadsb/map/liveries/A21N_WMT.png new file mode 100644 index 000000000..6e0a312ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_WMT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_WTB_N.png b/plugins/channelrx/demodadsb/map/liveries/A21N_WTB_N.png new file mode 100644 index 000000000..e2ee67402 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_WTB_N.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_WUK.png b/plugins/channelrx/demodadsb/map/liveries/A21N_WUK.png new file mode 100644 index 000000000..b77bcc28c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_WUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_WZZ.png b/plugins/channelrx/demodadsb/map/liveries/A21N_WZZ.png new file mode 100644 index 000000000..366f096fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_WZZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A21N_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A21N_XSN.png new file mode 100644 index 000000000..d614ee5b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A21N_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306.png b/plugins/channelrx/demodadsb/map/liveries/A306.png new file mode 100644 index 000000000..ce3bdc3a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F.png b/plugins/channelrx/demodadsb/map/liveries/A306F.png new file mode 100644 index 000000000..619e56cdc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_ABR.png b/plugins/channelrx/demodadsb/map/liveries/A306F_ABR.png new file mode 100644 index 000000000..95eea700b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_ABR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_BCS.png b/plugins/channelrx/demodadsb/map/liveries/A306F_BCS.png new file mode 100644 index 000000000..428b161d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_BCS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_DHL.png b/plugins/channelrx/demodadsb/map/liveries/A306F_DHL.png new file mode 100644 index 000000000..428b161d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_DHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_FDX.png b/plugins/channelrx/demodadsb/map/liveries/A306F_FDX.png new file mode 100644 index 000000000..839b2738b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_MNB.png b/plugins/channelrx/demodadsb/map/liveries/A306F_MNB.png new file mode 100644 index 000000000..a8a9a5013 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_MNB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_NFC.png b/plugins/channelrx/demodadsb/map/liveries/A306F_NFC.png new file mode 100644 index 000000000..a339c1e6c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_NFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_SOP.png b/plugins/channelrx/demodadsb/map/liveries/A306F_SOP.png new file mode 100644 index 000000000..aabb9cafd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_SOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306F_UPS.png b/plugins/channelrx/demodadsb/map/liveries/A306F_UPS.png new file mode 100644 index 000000000..f3447dba2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306F_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_AAW.png b/plugins/channelrx/demodadsb/map/liveries/A306_AAW.png new file mode 100644 index 000000000..9a661135e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_AAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_AHK.png b/plugins/channelrx/demodadsb/map/liveries/A306_AHK.png new file mode 100644 index 000000000..3daad6b1a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_AHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_BCS.png b/plugins/channelrx/demodadsb/map/liveries/A306_BCS.png new file mode 100644 index 000000000..524818591 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_BCS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_CES.png b/plugins/channelrx/demodadsb/map/liveries/A306_CES.png new file mode 100644 index 000000000..d4cf587d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A306_CSN.png new file mode 100644 index 000000000..8a2a09c74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A306_DLH.png new file mode 100644 index 000000000..fd8732169 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A306_ETD.png new file mode 100644 index 000000000..aa311e775 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_FDX.png b/plugins/channelrx/demodadsb/map/liveries/A306_FDX.png new file mode 100644 index 000000000..62bc7c316 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_IRA.png b/plugins/channelrx/demodadsb/map/liveries/A306_IRA.png new file mode 100644 index 000000000..26b8f54b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_IRM.png b/plugins/channelrx/demodadsb/map/liveries/A306_IRM.png new file mode 100644 index 000000000..c8c0b6294 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_IRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_JAL.png b/plugins/channelrx/demodadsb/map/liveries/A306_JAL.png new file mode 100644 index 000000000..7ec7ac80f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_KAC.png b/plugins/channelrx/demodadsb/map/liveries/A306_KAC.png new file mode 100644 index 000000000..36f6bc0b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_KAL.png b/plugins/channelrx/demodadsb/map/liveries/A306_KAL.png new file mode 100644 index 000000000..125b1f909 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_KZU.png b/plugins/channelrx/demodadsb/map/liveries/A306_KZU.png new file mode 100644 index 000000000..08ee0030d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_KZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_LAA.png b/plugins/channelrx/demodadsb/map/liveries/A306_LAA.png new file mode 100644 index 000000000..55ee70088 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_LAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_MON.png b/plugins/channelrx/demodadsb/map/liveries/A306_MON.png new file mode 100644 index 000000000..6c598b33a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_PIA.png b/plugins/channelrx/demodadsb/map/liveries/A306_PIA.png new file mode 100644 index 000000000..0affa70d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A306_QTR.png new file mode 100644 index 000000000..79e254852 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A306_RJA.png new file mode 100644 index 000000000..a5228325f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_RZO.png b/plugins/channelrx/demodadsb/map/liveries/A306_RZO.png new file mode 100644 index 000000000..deb2de48c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_RZO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_SUD.png b/plugins/channelrx/demodadsb/map/liveries/A306_SUD.png new file mode 100644 index 000000000..ba1881fb5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_SUD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_SVA.png b/plugins/channelrx/demodadsb/map/liveries/A306_SVA.png new file mode 100644 index 000000000..25eb2105b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_TAR.png b/plugins/channelrx/demodadsb/map/liveries/A306_TAR.png new file mode 100644 index 000000000..65866d3de Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_TAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_THA.png b/plugins/channelrx/demodadsb/map/liveries/A306_THA.png new file mode 100644 index 000000000..40bf98b46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_THY.png b/plugins/channelrx/demodadsb/map/liveries/A306_THY.png new file mode 100644 index 000000000..dc312f7e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_UAE.png b/plugins/channelrx/demodadsb/map/liveries/A306_UAE.png new file mode 100644 index 000000000..bb3a2f2ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A306_UPS.png b/plugins/channelrx/demodadsb/map/liveries/A306_UPS.png new file mode 100644 index 000000000..e5b54b233 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A306_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A30B.png b/plugins/channelrx/demodadsb/map/liveries/A30B.png new file mode 100644 index 000000000..12da9f5c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A30B.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A30BF.png b/plugins/channelrx/demodadsb/map/liveries/A30BF.png new file mode 100644 index 000000000..57c77bccf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A30BF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A30BF_AMA.png b/plugins/channelrx/demodadsb/map/liveries/A30BF_AMA.png new file mode 100644 index 000000000..0dfed69bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A30BF_AMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A30B_EAG.png b/plugins/channelrx/demodadsb/map/liveries/A30B_EAG.png new file mode 100644 index 000000000..2ed55b63b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A30B_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A30B_IRA.png b/plugins/channelrx/demodadsb/map/liveries/A30B_IRA.png new file mode 100644 index 000000000..6ecae2023 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A30B_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A310_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A310_AIC.png new file mode 100644 index 000000000..c8d563452 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A310_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A310_AME.png b/plugins/channelrx/demodadsb/map/liveries/A310_AME.png new file mode 100644 index 000000000..fa829fc9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A310_AME.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A310_FDX.png b/plugins/channelrx/demodadsb/map/liveries/A310_FDX.png new file mode 100644 index 000000000..535663fa0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A310_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A310_KLM.png b/plugins/channelrx/demodadsb/map/liveries/A310_KLM.png new file mode 100644 index 000000000..013d9de41 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A310_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A310_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A310_TAP.png new file mode 100644 index 000000000..39f91ae27 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A310_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A310_UZB.png b/plugins/channelrx/demodadsb/map/liveries/A310_UZB.png new file mode 100644 index 000000000..20e18493b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A310_UZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A318_AFR.png new file mode 100644 index 000000000..2f692b4b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_AVA.png b/plugins/channelrx/demodadsb/map/liveries/A318_AVA.png new file mode 100644 index 000000000..a2b8dc643 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A318_BAW.png new file mode 100644 index 000000000..51222a655 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_LAN.png b/plugins/channelrx/demodadsb/map/liveries/A318_LAN.png new file mode 100644 index 000000000..c7b8332bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_LNE.png b/plugins/channelrx/demodadsb/map/liveries/A318_LNE.png new file mode 100644 index 000000000..0db31f472 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_LNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_MXA.png b/plugins/channelrx/demodadsb/map/liveries/A318_MXA.png new file mode 100644 index 000000000..472c16484 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_MXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A318_RJA.png new file mode 100644 index 000000000..519a7aa6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_ROT.png b/plugins/channelrx/demodadsb/map/liveries/A318_ROT.png new file mode 100644 index 000000000..c1e2b7e1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_ROT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A318_SVW.png b/plugins/channelrx/demodadsb/map/liveries/A318_SVW.png new file mode 100644 index 000000000..1755c19ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A318_SVW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319.png b/plugins/channelrx/demodadsb/map/liveries/A319.png new file mode 100644 index 000000000..42cf48761 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AAF.png b/plugins/channelrx/demodadsb/map/liveries/A319_AAF.png new file mode 100644 index 000000000..4aa7901ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AAL.png b/plugins/channelrx/demodadsb/map/liveries/A319_AAL.png new file mode 100644 index 000000000..e9d65b793 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AAW.png b/plugins/channelrx/demodadsb/map/liveries/A319_AAW.png new file mode 100644 index 000000000..a092ad826 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AAY.png b/plugins/channelrx/demodadsb/map/liveries/A319_AAY.png new file mode 100644 index 000000000..7c69df367 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ABN.png b/plugins/channelrx/demodadsb/map/liveries/A319_ABN.png new file mode 100644 index 000000000..0208dfb02 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ABN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ABQ.png b/plugins/channelrx/demodadsb/map/liveries/A319_ABQ.png new file mode 100644 index 000000000..0f8c814b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ABQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ACA.png b/plugins/channelrx/demodadsb/map/liveries/A319_ACA.png new file mode 100644 index 000000000..7ce486443 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ADH.png b/plugins/channelrx/demodadsb/map/liveries/A319_ADH.png new file mode 100644 index 000000000..a2de68edb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ADH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ADR.png b/plugins/channelrx/demodadsb/map/liveries/A319_ADR.png new file mode 100644 index 000000000..cfe585c67 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ADR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AEE.png b/plugins/channelrx/demodadsb/map/liveries/A319_AEE.png new file mode 100644 index 000000000..c5323cbad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AEE_OC.png b/plugins/channelrx/demodadsb/map/liveries/A319_AEE_OC.png new file mode 100644 index 000000000..82d55d483 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AEE_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A319_AFL.png new file mode 100644 index 000000000..80b5b05c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A319_AFR.png new file mode 100644 index 000000000..8d5773c0b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AFX.png b/plugins/channelrx/demodadsb/map/liveries/A319_AFX.png new file mode 100644 index 000000000..7729533e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AHY.png b/plugins/channelrx/demodadsb/map/liveries/A319_AHY.png new file mode 100644 index 000000000..77676d096 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AIA.png b/plugins/channelrx/demodadsb/map/liveries/A319_AIA.png new file mode 100644 index 000000000..4639b2e8b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A319_AIC.png new file mode 100644 index 000000000..785a71758 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AMC.png b/plugins/channelrx/demodadsb/map/liveries/A319_AMC.png new file mode 100644 index 000000000..f2468e591 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AMC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ARE.png b/plugins/channelrx/demodadsb/map/liveries/A319_ARE.png new file mode 100644 index 000000000..adb1bd9a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ARE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ASL.png b/plugins/channelrx/demodadsb/map/liveries/A319_ASL.png new file mode 100644 index 000000000..4cbe2ac77 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A319_AUA.png new file mode 100644 index 000000000..71b7ba71a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AVA.png b/plugins/channelrx/demodadsb/map/liveries/A319_AVA.png new file mode 100644 index 000000000..1aab25c33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AWE.png b/plugins/channelrx/demodadsb/map/liveries/A319_AWE.png new file mode 100644 index 000000000..0baeeda78 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AXB.png b/plugins/channelrx/demodadsb/map/liveries/A319_AXB.png new file mode 100644 index 000000000..59827e0e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AXB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_AZA.png b/plugins/channelrx/demodadsb/map/liveries/A319_AZA.png new file mode 100644 index 000000000..6c15143ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A319_BAW.png new file mode 100644 index 000000000..d2cc36e90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BAW_BEA.png b/plugins/channelrx/demodadsb/map/liveries/A319_BAW_BEA.png new file mode 100644 index 000000000..3819ecfe9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BAW_BEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BEL.png b/plugins/channelrx/demodadsb/map/liveries/A319_BEL.png new file mode 100644 index 000000000..063c2b8ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BEL_NC.png b/plugins/channelrx/demodadsb/map/liveries/A319_BEL_NC.png new file mode 100644 index 000000000..5613ed9d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BEL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BER.png b/plugins/channelrx/demodadsb/map/liveries/A319_BER.png new file mode 100644 index 000000000..1ca3e8680 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A319_BHE.png new file mode 100644 index 000000000..5512a7878 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BHP.png b/plugins/channelrx/demodadsb/map/liveries/A319_BHP.png new file mode 100644 index 000000000..cc4194bd2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BHP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BIX.png b/plugins/channelrx/demodadsb/map/liveries/A319_BIX.png new file mode 100644 index 000000000..d5209f11f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BIX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BKP.png b/plugins/channelrx/demodadsb/map/liveries/A319_BKP.png new file mode 100644 index 000000000..bc6a4760c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BKP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BMA.png b/plugins/channelrx/demodadsb/map/liveries/A319_BMA.png new file mode 100644 index 000000000..f8a32c3b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BMI.png b/plugins/channelrx/demodadsb/map/liveries/A319_BMI.png new file mode 100644 index 000000000..baadc6f4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BON.png b/plugins/channelrx/demodadsb/map/liveries/A319_BON.png new file mode 100644 index 000000000..9b5fb1b99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BRS.png b/plugins/channelrx/demodadsb/map/liveries/A319_BRS.png new file mode 100644 index 000000000..9407b5596 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BRS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BTN.png b/plugins/channelrx/demodadsb/map/liveries/A319_BTN.png new file mode 100644 index 000000000..2bc9f406d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A319_BVX.png new file mode 100644 index 000000000..b69324787 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_BYD.png b/plugins/channelrx/demodadsb/map/liveries/A319_BYD.png new file mode 100644 index 000000000..173ce60e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_BYD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A319_CBJ.png new file mode 100644 index 000000000..7af5b7cf0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A319_CCA.png new file mode 100644 index 000000000..5bfe441f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CEB.png b/plugins/channelrx/demodadsb/map/liveries/A319_CEB.png new file mode 100644 index 000000000..a4174f620 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CES.png b/plugins/channelrx/demodadsb/map/liveries/A319_CES.png new file mode 100644 index 000000000..45c342ce5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CHB.png b/plugins/channelrx/demodadsb/map/liveries/A319_CHB.png new file mode 100644 index 000000000..2ac76420b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CHB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CHH.png b/plugins/channelrx/demodadsb/map/liveries/A319_CHH.png new file mode 100644 index 000000000..9609aa0e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CLH.png b/plugins/channelrx/demodadsb/map/liveries/A319_CLH.png new file mode 100644 index 000000000..27a91a0a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CQN.png b/plugins/channelrx/demodadsb/map/liveries/A319_CQN.png new file mode 100644 index 000000000..82e88aef5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CQN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CSA.png b/plugins/channelrx/demodadsb/map/liveries/A319_CSA.png new file mode 100644 index 000000000..8578a421b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A319_CSC.png new file mode 100644 index 000000000..95d7428fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A319_CSN.png new file mode 100644 index 000000000..e0e48b68f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CSW.png b/plugins/channelrx/demodadsb/map/liveries/A319_CSW.png new file mode 100644 index 000000000..decbbd02d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/A319_CSZ.png new file mode 100644 index 000000000..563f5145e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CTM.png b/plugins/channelrx/demodadsb/map/liveries/A319_CTM.png new file mode 100644 index 000000000..077e3f7bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CTM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CTN.png b/plugins/channelrx/demodadsb/map/liveries/A319_CTN.png new file mode 100644 index 000000000..21496315f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A319_CXA_VA.png new file mode 100644 index 000000000..d93c1fa2f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_CYP.png b/plugins/channelrx/demodadsb/map/liveries/A319_CYP.png new file mode 100644 index 000000000..e8362b675 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_CYP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A319_DAL.png new file mode 100644 index 000000000..30f35836e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_DCS.png b/plugins/channelrx/demodadsb/map/liveries/A319_DCS.png new file mode 100644 index 000000000..7173565bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_DCS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A319_DLH.png new file mode 100644 index 000000000..4bb72d3c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/A319_DLH_OC.png new file mode 100644 index 000000000..52d4849ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_DNV.png b/plugins/channelrx/demodadsb/map/liveries/A319_DNV.png new file mode 100644 index 000000000..edfa0acb6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_DNV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_DRK.png b/plugins/channelrx/demodadsb/map/liveries/A319_DRK.png new file mode 100644 index 000000000..e469116f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_DRK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A319_EIN.png new file mode 100644 index 000000000..2bf550f35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_EJU.png b/plugins/channelrx/demodadsb/map/liveries/A319_EJU.png new file mode 100644 index 000000000..105d6d168 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_EJU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ERT.png b/plugins/channelrx/demodadsb/map/liveries/A319_ERT.png new file mode 100644 index 000000000..2d4316ed9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ERT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A319_ETD.png new file mode 100644 index 000000000..e4c660e42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_EUS.png b/plugins/channelrx/demodadsb/map/liveries/A319_EUS.png new file mode 100644 index 000000000..c461e2c97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_EWG.png b/plugins/channelrx/demodadsb/map/liveries/A319_EWG.png new file mode 100644 index 000000000..b906f9445 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_EZS.png b/plugins/channelrx/demodadsb/map/liveries/A319_EZS.png new file mode 100644 index 000000000..4c8e97230 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_EZS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_EZY.png b/plugins/channelrx/demodadsb/map/liveries/A319_EZY.png new file mode 100644 index 000000000..9d4f7f6d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_EZY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_FFT.png b/plugins/channelrx/demodadsb/map/liveries/A319_FFT.png new file mode 100644 index 000000000..850c0f218 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_FIE.png b/plugins/channelrx/demodadsb/map/liveries/A319_FIE.png new file mode 100644 index 000000000..bbdf3e6d7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_FIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_FIN.png b/plugins/channelrx/demodadsb/map/liveries/A319_FIN.png new file mode 100644 index 000000000..491fa5f59 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_FLO.png b/plugins/channelrx/demodadsb/map/liveries/A319_FLO.png new file mode 100644 index 000000000..9628319d7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_FLO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_FWC.png b/plugins/channelrx/demodadsb/map/liveries/A319_FWC.png new file mode 100644 index 000000000..72f0ad0a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A319_GFA.png new file mode 100644 index 000000000..efc30d178 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GHL.png b/plugins/channelrx/demodadsb/map/liveries/A319_GHL.png new file mode 100644 index 000000000..afbb20c5c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GLD.png b/plugins/channelrx/demodadsb/map/liveries/A319_GLD.png new file mode 100644 index 000000000..8dd21daf3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GLG.png b/plugins/channelrx/demodadsb/map/liveries/A319_GLG.png new file mode 100644 index 000000000..aca188d8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GMI.png b/plugins/channelrx/demodadsb/map/liveries/A319_GMI.png new file mode 100644 index 000000000..ff947bb36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GSW.png b/plugins/channelrx/demodadsb/map/liveries/A319_GSW.png new file mode 100644 index 000000000..a2531991b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_GWI.png b/plugins/channelrx/demodadsb/map/liveries/A319_GWI.png new file mode 100644 index 000000000..1e9c80719 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_GWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_HAY.png b/plugins/channelrx/demodadsb/map/liveries/A319_HAY.png new file mode 100644 index 000000000..8a6836a3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_HAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A319_HAZ.png new file mode 100644 index 000000000..b0d897e49 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_HIM.png b/plugins/channelrx/demodadsb/map/liveries/A319_HIM.png new file mode 100644 index 000000000..839224963 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_HIM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_HYM.png b/plugins/channelrx/demodadsb/map/liveries/A319_HYM.png new file mode 100644 index 000000000..598eb4023 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_HYM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_IAE.png b/plugins/channelrx/demodadsb/map/liveries/A319_IAE.png new file mode 100644 index 000000000..1b3eedc3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A319_IBE.png new file mode 100644 index 000000000..baee0cbfe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_IRA.png b/plugins/channelrx/demodadsb/map/liveries/A319_IRA.png new file mode 100644 index 000000000..36690f42a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ISS.png b/plugins/channelrx/demodadsb/map/liveries/A319_ISS.png new file mode 100644 index 000000000..5394dcdd3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ISS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ITY_BLUE.png b/plugins/channelrx/demodadsb/map/liveries/A319_ITY_BLUE.png new file mode 100644 index 000000000..567273871 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ITY_BLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_IWA.png b/plugins/channelrx/demodadsb/map/liveries/A319_IWA.png new file mode 100644 index 000000000..beedcc134 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_IZG.png b/plugins/channelrx/demodadsb/map/liveries/A319_IZG.png new file mode 100644 index 000000000..ddb2566b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_IZG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_KAC.png b/plugins/channelrx/demodadsb/map/liveries/A319_KAC.png new file mode 100644 index 000000000..5ba265b3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_KFR.png b/plugins/channelrx/demodadsb/map/liveries/A319_KFR.png new file mode 100644 index 000000000..161f81abf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_KFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_KKK.png b/plugins/channelrx/demodadsb/map/liveries/A319_KKK.png new file mode 100644 index 000000000..cb5882e9e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_KKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_KME.png b/plugins/channelrx/demodadsb/map/liveries/A319_KME.png new file mode 100644 index 000000000..68f0d4b56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_KME.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_KRP.png b/plugins/channelrx/demodadsb/map/liveries/A319_KRP.png new file mode 100644 index 000000000..e7ed2ba57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_KRP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_KZR.png b/plugins/channelrx/demodadsb/map/liveries/A319_KZR.png new file mode 100644 index 000000000..4694fc2f9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LAN.png b/plugins/channelrx/demodadsb/map/liveries/A319_LAN.png new file mode 100644 index 000000000..c76248c44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LBY.png b/plugins/channelrx/demodadsb/map/liveries/A319_LBY.png new file mode 100644 index 000000000..d870644d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LBY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LGS.png b/plugins/channelrx/demodadsb/map/liveries/A319_LGS.png new file mode 100644 index 000000000..b3b0d7b1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LGS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A319_LHA_VA.png new file mode 100644 index 000000000..0e8eb5017 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LHX.png b/plugins/channelrx/demodadsb/map/liveries/A319_LHX.png new file mode 100644 index 000000000..524bd165b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LHX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LNE.png b/plugins/channelrx/demodadsb/map/liveries/A319_LNE.png new file mode 100644 index 000000000..beceda559 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LNR.png b/plugins/channelrx/demodadsb/map/liveries/A319_LNR.png new file mode 100644 index 000000000..55139ce95 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LPE.png b/plugins/channelrx/demodadsb/map/liveries/A319_LPE.png new file mode 100644 index 000000000..c54032ce6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LPE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LRC.png b/plugins/channelrx/demodadsb/map/liveries/A319_LRC.png new file mode 100644 index 000000000..234a5dc3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LRC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LWA.png b/plugins/channelrx/demodadsb/map/liveries/A319_LWA.png new file mode 100644 index 000000000..1af17bd51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_LZB.png b/plugins/channelrx/demodadsb/map/liveries/A319_LZB.png new file mode 100644 index 000000000..cfe5d451d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_LZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MAU.png b/plugins/channelrx/demodadsb/map/liveries/A319_MAU.png new file mode 100644 index 000000000..efbf5c28d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MET.png b/plugins/channelrx/demodadsb/map/liveries/A319_MET.png new file mode 100644 index 000000000..f5b09fe27 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MGL.png b/plugins/channelrx/demodadsb/map/liveries/A319_MGL.png new file mode 100644 index 000000000..702a06fba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MLD.png b/plugins/channelrx/demodadsb/map/liveries/A319_MLD.png new file mode 100644 index 000000000..dfed7c880 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MLM.png b/plugins/channelrx/demodadsb/map/liveries/A319_MLM.png new file mode 100644 index 000000000..4b48f0a19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MOV.png b/plugins/channelrx/demodadsb/map/liveries/A319_MOV.png new file mode 100644 index 000000000..fa18eb178 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_MXA.png b/plugins/channelrx/demodadsb/map/liveries/A319_MXA.png new file mode 100644 index 000000000..5a990486b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_MXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A319_NDF.png new file mode 100644 index 000000000..06bc21fd9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NKS.png b/plugins/channelrx/demodadsb/map/liveries/A319_NKS.png new file mode 100644 index 000000000..78b9f8cf5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NKS_NC.png b/plugins/channelrx/demodadsb/map/liveries/A319_NKS_NC.png new file mode 100644 index 000000000..6739a558e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NKS_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NLY.png b/plugins/channelrx/demodadsb/map/liveries/A319_NLY.png new file mode 100644 index 000000000..ab7554105 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NLY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NMB.png b/plugins/channelrx/demodadsb/map/liveries/A319_NMB.png new file mode 100644 index 000000000..7cb554214 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NMB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A319_NTL.png new file mode 100644 index 000000000..e84ea6e65 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_NWA.png b/plugins/channelrx/demodadsb/map/liveries/A319_NWA.png new file mode 100644 index 000000000..0564e0dc7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_OAL.png b/plugins/channelrx/demodadsb/map/liveries/A319_OAL.png new file mode 100644 index 000000000..9409c25b0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_OAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A319_OAL_VA.png new file mode 100644 index 000000000..3c947ce1d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ONE.png b/plugins/channelrx/demodadsb/map/liveries/A319_ONE.png new file mode 100644 index 000000000..96b3b4baf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ONE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A319_PAL.png new file mode 100644 index 000000000..aac01375a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_PLX.png b/plugins/channelrx/demodadsb/map/liveries/A319_PLX.png new file mode 100644 index 000000000..440b63430 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A319_QTR.png new file mode 100644 index 000000000..fb8862964 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_RBA.png b/plugins/channelrx/demodadsb/map/liveries/A319_RBA.png new file mode 100644 index 000000000..771be81f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_RBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A319_RJA.png new file mode 100644 index 000000000..95c5c987a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_RLU.png b/plugins/channelrx/demodadsb/map/liveries/A319_RLU.png new file mode 100644 index 000000000..9ff563d21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_RLU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_RNV.png b/plugins/channelrx/demodadsb/map/liveries/A319_RNV.png new file mode 100644 index 000000000..917d87fa2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_RNV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_ROU.png b/plugins/channelrx/demodadsb/map/liveries/A319_ROU.png new file mode 100644 index 000000000..0b3e3fdd6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_ROU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_RSD.png b/plugins/channelrx/demodadsb/map/liveries/A319_RSD.png new file mode 100644 index 000000000..02e70fcae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_RSD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_RSY.png b/plugins/channelrx/demodadsb/map/liveries/A319_RSY.png new file mode 100644 index 000000000..db1393db1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_RSY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A319_SAA.png new file mode 100644 index 000000000..79ae11b71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A319_SAS.png new file mode 100644 index 000000000..13203fd5d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SAS_OC.png b/plugins/channelrx/demodadsb/map/liveries/A319_SAS_OC.png new file mode 100644 index 000000000..f1b59551c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SAS_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SBI.png b/plugins/channelrx/demodadsb/map/liveries/A319_SBI.png new file mode 100644 index 000000000..409721634 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SBI_NC.png b/plugins/channelrx/demodadsb/map/liveries/A319_SBI_NC.png new file mode 100644 index 000000000..bb01e5b07 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SBI_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SCO.png b/plugins/channelrx/demodadsb/map/liveries/A319_SCO.png new file mode 100644 index 000000000..c461e2c97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SDM.png b/plugins/channelrx/demodadsb/map/liveries/A319_SDM.png new file mode 100644 index 000000000..d0cbd2d11 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SDR.png b/plugins/channelrx/demodadsb/map/liveries/A319_SDR.png new file mode 100644 index 000000000..acedaeb4d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SDR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SHT.png b/plugins/channelrx/demodadsb/map/liveries/A319_SHT.png new file mode 100644 index 000000000..85b782d84 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SHU.png b/plugins/channelrx/demodadsb/map/liveries/A319_SHU.png new file mode 100644 index 000000000..e7c9645bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SHU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SKS.png b/plugins/channelrx/demodadsb/map/liveries/A319_SKS.png new file mode 100644 index 000000000..1e3b8f452 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SLK.png b/plugins/channelrx/demodadsb/map/liveries/A319_SLK.png new file mode 100644 index 000000000..991869aca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SVR.png b/plugins/channelrx/demodadsb/map/liveries/A319_SVR.png new file mode 100644 index 000000000..cdb715903 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A319_SWR.png new file mode 100644 index 000000000..eb88070f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_SZN.png b/plugins/channelrx/demodadsb/map/liveries/A319_SZN.png new file mode 100644 index 000000000..e6238604c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_SZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TAE.png b/plugins/channelrx/demodadsb/map/liveries/A319_TAE.png new file mode 100644 index 000000000..d03bb4939 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TAI.png b/plugins/channelrx/demodadsb/map/liveries/A319_TAI.png new file mode 100644 index 000000000..ced0d0c06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TAK.png b/plugins/channelrx/demodadsb/map/liveries/A319_TAK.png new file mode 100644 index 000000000..bd856f8a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TAK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A319_TAM.png new file mode 100644 index 000000000..ee0fb1379 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A319_TAP.png new file mode 100644 index 000000000..05ead8895 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TAR.png b/plugins/channelrx/demodadsb/map/liveries/A319_TAR.png new file mode 100644 index 000000000..35c95fc70 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TBA.png b/plugins/channelrx/demodadsb/map/liveries/A319_TBA.png new file mode 100644 index 000000000..628f38f80 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TCW.png b/plugins/channelrx/demodadsb/map/liveries/A319_TCW.png new file mode 100644 index 000000000..d2506f94f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TCW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TEF.png b/plugins/channelrx/demodadsb/map/liveries/A319_TEF.png new file mode 100644 index 000000000..afd313f89 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/A319_TEJ.png new file mode 100644 index 000000000..faa6148e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_THO.png b/plugins/channelrx/demodadsb/map/liveries/A319_THO.png new file mode 100644 index 000000000..5d77daa96 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_THO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_THY.png b/plugins/channelrx/demodadsb/map/liveries/A319_THY.png new file mode 100644 index 000000000..38fa84896 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_THY_NC.png b/plugins/channelrx/demodadsb/map/liveries/A319_THY_NC.png new file mode 100644 index 000000000..bd5a19d57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_THY_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A319_TKY.png new file mode 100644 index 000000000..5f2cab137 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_UAL.png b/plugins/channelrx/demodadsb/map/liveries/A319_UAL.png new file mode 100644 index 000000000..7b117db1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_UAL_OC.png b/plugins/channelrx/demodadsb/map/liveries/A319_UAL_OC.png new file mode 100644 index 000000000..2ad77f080 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_UAL_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_UKN.png b/plugins/channelrx/demodadsb/map/liveries/A319_UKN.png new file mode 100644 index 000000000..68fd7cd8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_UKN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_UKV_TOPA.png b/plugins/channelrx/demodadsb/map/liveries/A319_UKV_TOPA.png new file mode 100644 index 000000000..302c6686e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_UKV_TOPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_USA.png b/plugins/channelrx/demodadsb/map/liveries/A319_USA.png new file mode 100644 index 000000000..d430fdd58 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VCP.png b/plugins/channelrx/demodadsb/map/liveries/A319_VCP.png new file mode 100644 index 000000000..e084ec986 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VLC.png b/plugins/channelrx/demodadsb/map/liveries/A319_VLC.png new file mode 100644 index 000000000..f23753e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VLG.png b/plugins/channelrx/demodadsb/map/liveries/A319_VLG.png new file mode 100644 index 000000000..3cac24292 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VOC.png b/plugins/channelrx/demodadsb/map/liveries/A319_VOC.png new file mode 100644 index 000000000..2b5ca3d09 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VOC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VOE.png b/plugins/channelrx/demodadsb/map/liveries/A319_VOE.png new file mode 100644 index 000000000..0cf5b4898 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VOI.png b/plugins/channelrx/demodadsb/map/liveries/A319_VOI.png new file mode 100644 index 000000000..fc35ae869 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VOI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VRD.png b/plugins/channelrx/demodadsb/map/liveries/A319_VRD.png new file mode 100644 index 000000000..d05b59260 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VRD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_VRE.png b/plugins/channelrx/demodadsb/map/liveries/A319_VRE.png new file mode 100644 index 000000000..235b01abf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_VRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A319_WAT.png new file mode 100644 index 000000000..e5d690d54 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_WGT.png b/plugins/channelrx/demodadsb/map/liveries/A319_WGT.png new file mode 100644 index 000000000..2883db678 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_WGT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_WHT.png b/plugins/channelrx/demodadsb/map/liveries/A319_WHT.png new file mode 100644 index 000000000..6780febd0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_WHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_WTB.png b/plugins/channelrx/demodadsb/map/liveries/A319_WTB.png new file mode 100644 index 000000000..d90b37f01 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_WTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A319_XSN.png new file mode 100644 index 000000000..d8c1da50d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A319_white.png b/plugins/channelrx/demodadsb/map/liveries/A319_white.png new file mode 100644 index 000000000..7d62d4c3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A319_white.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320.png b/plugins/channelrx/demodadsb/map/liveries/A320.png new file mode 100644 index 000000000..2fc47d4ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AAF.png b/plugins/channelrx/demodadsb/map/liveries/A320_AAF.png new file mode 100644 index 000000000..e1c50ec5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_AAL.png new file mode 100644 index 000000000..9f35de24a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AAR.png b/plugins/channelrx/demodadsb/map/liveries/A320_AAR.png new file mode 100644 index 000000000..2f7c39fc2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AAW.png b/plugins/channelrx/demodadsb/map/liveries/A320_AAW.png new file mode 100644 index 000000000..995f3a89c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AAY.png b/plugins/channelrx/demodadsb/map/liveries/A320_AAY.png new file mode 100644 index 000000000..952edb881 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ABL.png b/plugins/channelrx/demodadsb/map/liveries/A320_ABL.png new file mode 100644 index 000000000..8aff7923a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ABL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ABN.png b/plugins/channelrx/demodadsb/map/liveries/A320_ABN.png new file mode 100644 index 000000000..8ac51283a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ABN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ABQ.png b/plugins/channelrx/demodadsb/map/liveries/A320_ABQ.png new file mode 100644 index 000000000..937658659 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ABQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ABY.png b/plugins/channelrx/demodadsb/map/liveries/A320_ABY.png new file mode 100644 index 000000000..38891d8e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ABY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ACA.png b/plugins/channelrx/demodadsb/map/liveries/A320_ACA.png new file mode 100644 index 000000000..0a4c9a69c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ACA_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_ACA_NC.png new file mode 100644 index 000000000..030265555 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ACA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ACI.png b/plugins/channelrx/demodadsb/map/liveries/A320_ACI.png new file mode 100644 index 000000000..d201307f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ACI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ACY.png b/plugins/channelrx/demodadsb/map/liveries/A320_ACY.png new file mode 100644 index 000000000..faa6b2969 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ACY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ADH.png b/plugins/channelrx/demodadsb/map/liveries/A320_ADH.png new file mode 100644 index 000000000..d48a06a0c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ADH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ADR.png b/plugins/channelrx/demodadsb/map/liveries/A320_ADR.png new file mode 100644 index 000000000..49125891d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ADR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ADY.png b/plugins/channelrx/demodadsb/map/liveries/A320_ADY.png new file mode 100644 index 000000000..0ff6a85e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ADY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AEE.png b/plugins/channelrx/demodadsb/map/liveries/A320_AEE.png new file mode 100644 index 000000000..7d0dcaa24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AEE_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_AEE_NC.png new file mode 100644 index 000000000..2385b1e58 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AEE_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AEW.png b/plugins/channelrx/demodadsb/map/liveries/A320_AEW.png new file mode 100644 index 000000000..33d943efa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AEW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AFF.png b/plugins/channelrx/demodadsb/map/liveries/A320_AFF.png new file mode 100644 index 000000000..f5faa6010 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A320_AFL.png new file mode 100644 index 000000000..d269ada53 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A320_AFR.png new file mode 100644 index 000000000..10c1949bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AFR_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_AFR_SL.png new file mode 100644 index 000000000..42ad76568 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AFR_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AFX.png b/plugins/channelrx/demodadsb/map/liveries/A320_AFX.png new file mode 100644 index 000000000..db9c5c661 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AHY.png b/plugins/channelrx/demodadsb/map/liveries/A320_AHY.png new file mode 100644 index 000000000..8e5fbf4d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIA.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIA.png new file mode 100644 index 000000000..40a281c51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIC.png new file mode 100644 index 000000000..8ab1a7fd7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIC_IAE.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIC_IAE.png new file mode 100644 index 000000000..5e845a118 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIC_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIC_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIC_SL.png new file mode 100644 index 000000000..7e619a665 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIC_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIJ.png new file mode 100644 index 000000000..14d460e4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIQ.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIQ.png new file mode 100644 index 000000000..b462cc642 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIS.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIS.png new file mode 100644 index 000000000..6ff279b3c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AIZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_AIZ.png new file mode 100644 index 000000000..293d7d242 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AIZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A320_ALK.png new file mode 100644 index 000000000..9fe6d3e8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AMC.png b/plugins/channelrx/demodadsb/map/liveries/A320_AMC.png new file mode 100644 index 000000000..0856c8278 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AMC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AMM.png b/plugins/channelrx/demodadsb/map/liveries/A320_AMM.png new file mode 100644 index 000000000..fa69ef2a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AMM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AMU.png b/plugins/channelrx/demodadsb/map/liveries/A320_AMU.png new file mode 100644 index 000000000..6e83d15a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AMU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AMV.png b/plugins/channelrx/demodadsb/map/liveries/A320_AMV.png new file mode 100644 index 000000000..1e5b77b69 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AMV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AMZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_AMZ.png new file mode 100644 index 000000000..a67588d37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AMZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ANA.png b/plugins/channelrx/demodadsb/map/liveries/A320_ANA.png new file mode 100644 index 000000000..185946acd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ANK.png b/plugins/channelrx/demodadsb/map/liveries/A320_ANK.png new file mode 100644 index 000000000..df6e7e963 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ANK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ANR.png b/plugins/channelrx/demodadsb/map/liveries/A320_ANR.png new file mode 100644 index 000000000..9ca8f37d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ANR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_ANZ.png new file mode 100644 index 000000000..27308d00e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ANZ_BL.png b/plugins/channelrx/demodadsb/map/liveries/A320_ANZ_BL.png new file mode 100644 index 000000000..31644318b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ANZ_BL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_APG.png b/plugins/channelrx/demodadsb/map/liveries/A320_APG.png new file mode 100644 index 000000000..0cf9b360d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_APG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_APJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_APJ.png new file mode 100644 index 000000000..182c23d56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_APJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_APJ_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_APJ_SL.png new file mode 100644 index 000000000..8b8ec66d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_APJ_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_APK.png b/plugins/channelrx/demodadsb/map/liveries/A320_APK.png new file mode 100644 index 000000000..887e40805 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_APK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ARE.png b/plugins/channelrx/demodadsb/map/liveries/A320_ARE.png new file mode 100644 index 000000000..f32aa1419 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ARE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ARG.png b/plugins/channelrx/demodadsb/map/liveries/A320_ARG.png new file mode 100644 index 000000000..7218b6f9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ARR.png b/plugins/channelrx/demodadsb/map/liveries/A320_ARR.png new file mode 100644 index 000000000..450169514 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ARR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ART.png b/plugins/channelrx/demodadsb/map/liveries/A320_ART.png new file mode 100644 index 000000000..6fefe98ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ART.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ARU.png b/plugins/channelrx/demodadsb/map/liveries/A320_ARU.png new file mode 100644 index 000000000..ae90f61b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ARU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ASA_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_ASA_SL.png new file mode 100644 index 000000000..34d728d1a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ASA_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ASL.png b/plugins/channelrx/demodadsb/map/liveries/A320_ASL.png new file mode 100644 index 000000000..2307420b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A320_AUA.png new file mode 100644 index 000000000..63abe58d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AUA_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_AUA_SL.png new file mode 100644 index 000000000..935ef6e6b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AUA_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AVA.png b/plugins/channelrx/demodadsb/map/liveries/A320_AVA.png new file mode 100644 index 000000000..c5c49d354 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AVA_ENCANTO.png b/plugins/channelrx/demodadsb/map/liveries/A320_AVA_ENCANTO.png new file mode 100644 index 000000000..ffd0ce819 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AVA_ENCANTO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AWC.png b/plugins/channelrx/demodadsb/map/liveries/A320_AWC.png new file mode 100644 index 000000000..74e4aecf1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AWE_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_AWE_OC.png new file mode 100644 index 000000000..150a96ae9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AWE_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AWG.png b/plugins/channelrx/demodadsb/map/liveries/A320_AWG.png new file mode 100644 index 000000000..b66085d5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AWQ.png b/plugins/channelrx/demodadsb/map/liveries/A320_AWQ.png new file mode 100644 index 000000000..d6bbd8837 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AWQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AXM.png b/plugins/channelrx/demodadsb/map/liveries/A320_AXM.png new file mode 100644 index 000000000..ddbdb3b34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AXM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AZA.png b/plugins/channelrx/demodadsb/map/liveries/A320_AZA.png new file mode 100644 index 000000000..c73a79325 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AZA_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_AZA_NC.png new file mode 100644 index 000000000..20e14bfa2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AZA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_AZI.png b/plugins/channelrx/demodadsb/map/liveries/A320_AZI.png new file mode 100644 index 000000000..11c26e197 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_AZI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BAB.png b/plugins/channelrx/demodadsb/map/liveries/A320_BAB.png new file mode 100644 index 000000000..b2b626c0d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BAB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_BAL.png new file mode 100644 index 000000000..be405b524 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BAV.png b/plugins/channelrx/demodadsb/map/liveries/A320_BAV.png new file mode 100644 index 000000000..af839ec83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A320_BAW.png new file mode 100644 index 000000000..31aa1d556 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BAW_IAE.png b/plugins/channelrx/demodadsb/map/liveries/A320_BAW_IAE.png new file mode 100644 index 000000000..ddf59b184 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BAW_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BBT.png b/plugins/channelrx/demodadsb/map/liveries/A320_BBT.png new file mode 100644 index 000000000..fb3f137ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BCC.png b/plugins/channelrx/demodadsb/map/liveries/A320_BCC.png new file mode 100644 index 000000000..f7d17136d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BCC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BEL.png b/plugins/channelrx/demodadsb/map/liveries/A320_BEL.png new file mode 100644 index 000000000..9f21de365 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BEL_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_BEL_NC.png new file mode 100644 index 000000000..15857ca88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BEL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BER.png b/plugins/channelrx/demodadsb/map/liveries/A320_BER.png new file mode 100644 index 000000000..fd6a43061 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BGH.png b/plugins/channelrx/demodadsb/map/liveries/A320_BGH.png new file mode 100644 index 000000000..8cc5f3be8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BGH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A320_BHE.png new file mode 100644 index 000000000..6ec40d69d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BHP.png b/plugins/channelrx/demodadsb/map/liveries/A320_BHP.png new file mode 100644 index 000000000..e35fdc63d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BHP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BIX.png b/plugins/channelrx/demodadsb/map/liveries/A320_BIX.png new file mode 100644 index 000000000..833c812a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BIX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BKP.png b/plugins/channelrx/demodadsb/map/liveries/A320_BKP.png new file mode 100644 index 000000000..32ae31fe1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BKP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BMA.png b/plugins/channelrx/demodadsb/map/liveries/A320_BMA.png new file mode 100644 index 000000000..bc9481ab4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BNL.png b/plugins/channelrx/demodadsb/map/liveries/A320_BNL.png new file mode 100644 index 000000000..f4d73c8c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BNL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BRQ.png b/plugins/channelrx/demodadsb/map/liveries/A320_BRQ.png new file mode 100644 index 000000000..3ca85a5ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BRQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BTK.png b/plugins/channelrx/demodadsb/map/liveries/A320_BTK.png new file mode 100644 index 000000000..7658d406d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BTK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BTV.png b/plugins/channelrx/demodadsb/map/liveries/A320_BTV.png new file mode 100644 index 000000000..c69f393b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BTV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BUC.png b/plugins/channelrx/demodadsb/map/liveries/A320_BUC.png new file mode 100644 index 000000000..18504c092 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BUC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BUC_CFM.png b/plugins/channelrx/demodadsb/map/liveries/A320_BUC_CFM.png new file mode 100644 index 000000000..efbeab142 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BUC_CFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A320_BVX.png new file mode 100644 index 000000000..eb530d2a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_BWG.png b/plugins/channelrx/demodadsb/map/liveries/A320_BWG.png new file mode 100644 index 000000000..a799a9e5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_BWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CAI.png b/plugins/channelrx/demodadsb/map/liveries/A320_CAI.png new file mode 100644 index 000000000..6c5eae57b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_CBJ.png new file mode 100644 index 000000000..0675c6cbd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A320_CCA.png new file mode 100644 index 000000000..f4e7ebbd8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CCM.png b/plugins/channelrx/demodadsb/map/liveries/A320_CCM.png new file mode 100644 index 000000000..8a8827658 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CCM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CDC.png b/plugins/channelrx/demodadsb/map/liveries/A320_CDC.png new file mode 100644 index 000000000..ea6d5f880 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CDC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CEB.png b/plugins/channelrx/demodadsb/map/liveries/A320_CEB.png new file mode 100644 index 000000000..65a2e0568 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CES.png b/plugins/channelrx/demodadsb/map/liveries/A320_CES.png new file mode 100644 index 000000000..8af5b9e51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CFG.png b/plugins/channelrx/demodadsb/map/liveries/A320_CFG.png new file mode 100644 index 000000000..812c201da Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CFG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CFG_FBB.png b/plugins/channelrx/demodadsb/map/liveries/A320_CFG_FBB.png new file mode 100644 index 000000000..fef6cac24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CFG_FBB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CFG_FBY.png b/plugins/channelrx/demodadsb/map/liveries/A320_CFG_FBY.png new file mode 100644 index 000000000..8a34d0357 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CFG_FBY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CFG_HN.png b/plugins/channelrx/demodadsb/map/liveries/A320_CFG_HN.png new file mode 100644 index 000000000..2e52b136d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CFG_HN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CGA.png b/plugins/channelrx/demodadsb/map/liveries/A320_CGA.png new file mode 100644 index 000000000..507876897 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CGL.png b/plugins/channelrx/demodadsb/map/liveries/A320_CGL.png new file mode 100644 index 000000000..cea584600 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CHB.png b/plugins/channelrx/demodadsb/map/liveries/A320_CHB.png new file mode 100644 index 000000000..c6fdac5a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CHB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CQH.png b/plugins/channelrx/demodadsb/map/liveries/A320_CQH.png new file mode 100644 index 000000000..3272eef52 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CQH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CQN.png b/plugins/channelrx/demodadsb/map/liveries/A320_CQN.png new file mode 100644 index 000000000..b7977724a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CQN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CRK.png b/plugins/channelrx/demodadsb/map/liveries/A320_CRK.png new file mode 100644 index 000000000..d0e861623 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CRK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CSA.png b/plugins/channelrx/demodadsb/map/liveries/A320_CSA.png new file mode 100644 index 000000000..095dc35c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A320_CSC.png new file mode 100644 index 000000000..3ebef6347 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A320_CSN.png new file mode 100644 index 000000000..2be8eb96e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_CSZ.png new file mode 100644 index 000000000..d92a28c4f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CTN.png b/plugins/channelrx/demodadsb/map/liveries/A320_CTN.png new file mode 100644 index 000000000..dd63d3feb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CTO.png b/plugins/channelrx/demodadsb/map/liveries/A320_CTO.png new file mode 100644 index 000000000..e7e962e42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CTO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CTV.png b/plugins/channelrx/demodadsb/map/liveries/A320_CTV.png new file mode 100644 index 000000000..a3672dfb3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CTV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A320_CXA_VA.png new file mode 100644 index 000000000..6ddd67d7a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_CYP.png b/plugins/channelrx/demodadsb/map/liveries/A320_CYP.png new file mode 100644 index 000000000..117e5dcd7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_CYP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_DAL.png new file mode 100644 index 000000000..11c7a998b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DKH.png b/plugins/channelrx/demodadsb/map/liveries/A320_DKH.png new file mode 100644 index 000000000..89d002a15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DKH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A320_DLH.png new file mode 100644 index 000000000..c6775e198 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_DLH_OC.png new file mode 100644 index 000000000..ad233d3a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DLH_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_DLH_SL.png new file mode 100644 index 000000000..a1adf3781 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DLH_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DQA.png b/plugins/channelrx/demodadsb/map/liveries/A320_DQA.png new file mode 100644 index 000000000..5a386add5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DSM.png b/plugins/channelrx/demodadsb/map/liveries/A320_DSM.png new file mode 100644 index 000000000..f2541d50f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DSM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DTR.png b/plugins/channelrx/demodadsb/map/liveries/A320_DTR.png new file mode 100644 index 000000000..0f4073a59 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_DUB.png b/plugins/channelrx/demodadsb/map/liveries/A320_DUB.png new file mode 100644 index 000000000..2cda29b25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_DUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EAA.png b/plugins/channelrx/demodadsb/map/liveries/A320_EAA.png new file mode 100644 index 000000000..7f3c564b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EAG.png b/plugins/channelrx/demodadsb/map/liveries/A320_EAG.png new file mode 100644 index 000000000..710b05722 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ECN.png b/plugins/channelrx/demodadsb/map/liveries/A320_ECN.png new file mode 100644 index 000000000..df0e1c7cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ECN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EDW.png b/plugins/channelrx/demodadsb/map/liveries/A320_EDW.png new file mode 100644 index 000000000..cf65e27e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EDW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EFW.png b/plugins/channelrx/demodadsb/map/liveries/A320_EFW.png new file mode 100644 index 000000000..ddf59b184 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EFW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A320_EIN.png new file mode 100644 index 000000000..5b428a5d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EIN_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_EIN_OC.png new file mode 100644 index 000000000..2a05ac18c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EIN_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EJU.png b/plugins/channelrx/demodadsb/map/liveries/A320_EJU.png new file mode 100644 index 000000000..5f2cc0f50 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EJU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EOK.png b/plugins/channelrx/demodadsb/map/liveries/A320_EOK.png new file mode 100644 index 000000000..6cd2e45ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EOK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A320_ETD.png new file mode 100644 index 000000000..decb501fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EUS.png b/plugins/channelrx/demodadsb/map/liveries/A320_EUS.png new file mode 100644 index 000000000..5b2d5835c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EVE.png b/plugins/channelrx/demodadsb/map/liveries/A320_EVE.png new file mode 100644 index 000000000..05f850cfe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EVE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EWG.png b/plugins/channelrx/demodadsb/map/liveries/A320_EWG.png new file mode 100644 index 000000000..1d4fc1400 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EWL.png b/plugins/channelrx/demodadsb/map/liveries/A320_EWL.png new file mode 100644 index 000000000..ba6c1c1c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EWL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EZS.png b/plugins/channelrx/demodadsb/map/liveries/A320_EZS.png new file mode 100644 index 000000000..38a52ca47 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EZS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EZY.png b/plugins/channelrx/demodadsb/map/liveries/A320_EZY.png new file mode 100644 index 000000000..92fbf8bc0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EZY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_EZY_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_EZY_SL.png new file mode 100644 index 000000000..ce9553c1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_EZY_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FAD.png b/plugins/channelrx/demodadsb/map/liveries/A320_FAD.png new file mode 100644 index 000000000..f68451e62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FAD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FBT.png b/plugins/channelrx/demodadsb/map/liveries/A320_FBT.png new file mode 100644 index 000000000..8f7bc8703 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FBV.png b/plugins/channelrx/demodadsb/map/liveries/A320_FBV.png new file mode 100644 index 000000000..55d9a69db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FEI.png b/plugins/channelrx/demodadsb/map/liveries/A320_FEI.png new file mode 100644 index 000000000..a67588d37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FEI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FFT.png b/plugins/channelrx/demodadsb/map/liveries/A320_FFT.png new file mode 100644 index 000000000..113a488c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FFT_204.png b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_204.png new file mode 100644 index 000000000..c887cbc4c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_204.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FFT_205.png b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_205.png new file mode 100644 index 000000000..6abb0bce7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_205.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FFT_208.png b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_208.png new file mode 100644 index 000000000..30d706f9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_208.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FFT_227.png b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_227.png new file mode 100644 index 000000000..7da185ba9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FFT_227.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FHA.png b/plugins/channelrx/demodadsb/map/liveries/A320_FHA.png new file mode 100644 index 000000000..7a9404bd3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FHE.png b/plugins/channelrx/demodadsb/map/liveries/A320_FHE.png new file mode 100644 index 000000000..f0c70aa80 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FHM.png b/plugins/channelrx/demodadsb/map/liveries/A320_FHM.png new file mode 100644 index 000000000..d2b3cf41b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FHM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHG.png b/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHG.png new file mode 100644 index 000000000..7ce3d9c01 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHI.png b/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHI.png new file mode 100644 index 000000000..4da70dfe3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHM.png b/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHM.png new file mode 100644 index 000000000..2f00bf0fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FHY_FHM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FIA.png b/plugins/channelrx/demodadsb/map/liveries/A320_FIA.png new file mode 100644 index 000000000..60111316d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FIE.png b/plugins/channelrx/demodadsb/map/liveries/A320_FIE.png new file mode 100644 index 000000000..7befc6a90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FIN.png b/plugins/channelrx/demodadsb/map/liveries/A320_FIN.png new file mode 100644 index 000000000..9dc7a78e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FNX.png b/plugins/channelrx/demodadsb/map/liveries/A320_FNX.png new file mode 100644 index 000000000..f60f9f3b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FNX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FOE.png b/plugins/channelrx/demodadsb/map/liveries/A320_FOE.png new file mode 100644 index 000000000..08b259fd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FUZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_FUZ.png new file mode 100644 index 000000000..f196ad18b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FUZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FVP.png b/plugins/channelrx/demodadsb/map/liveries/A320_FVP.png new file mode 100644 index 000000000..befe8e008 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FVP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FWC.png b/plugins/channelrx/demodadsb/map/liveries/A320_FWC.png new file mode 100644 index 000000000..aeeaa89f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_FYI.png b/plugins/channelrx/demodadsb/map/liveries/A320_FYI.png new file mode 100644 index 000000000..72f097c70 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_FYI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GAP.png b/plugins/channelrx/demodadsb/map/liveries/A320_GAP.png new file mode 100644 index 000000000..4b5111a17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GBB_BLACK.png b/plugins/channelrx/demodadsb/map/liveries/A320_GBB_BLACK.png new file mode 100644 index 000000000..57be2a320 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GBB_BLACK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GBB_YELLOW.png b/plugins/channelrx/demodadsb/map/liveries/A320_GBB_YELLOW.png new file mode 100644 index 000000000..41090558e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GBB_YELLOW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GBL.png b/plugins/channelrx/demodadsb/map/liveries/A320_GBL.png new file mode 100644 index 000000000..c679bd17b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GBL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GCR.png b/plugins/channelrx/demodadsb/map/liveries/A320_GCR.png new file mode 100644 index 000000000..808a0b495 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A320_GFA.png new file mode 100644 index 000000000..8b4041a7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GHY.png b/plugins/channelrx/demodadsb/map/liveries/A320_GHY.png new file mode 100644 index 000000000..c2f87748f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GLD.png b/plugins/channelrx/demodadsb/map/liveries/A320_GLD.png new file mode 100644 index 000000000..42c9fee3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GLG.png b/plugins/channelrx/demodadsb/map/liveries/A320_GLG.png new file mode 100644 index 000000000..018646d79 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GOW.png b/plugins/channelrx/demodadsb/map/liveries/A320_GOW.png new file mode 100644 index 000000000..209ec3535 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GOW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GOW_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_GOW_OC.png new file mode 100644 index 000000000..27bb04eee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GOW_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GWI.png b/plugins/channelrx/demodadsb/map/liveries/A320_GWI.png new file mode 100644 index 000000000..c40569434 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_GXA.png b/plugins/channelrx/demodadsb/map/liveries/A320_GXA.png new file mode 100644 index 000000000..b25a90579 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_GXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HAN.png b/plugins/channelrx/demodadsb/map/liveries/A320_HAN.png new file mode 100644 index 000000000..18c9dc52c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HAY.png b/plugins/channelrx/demodadsb/map/liveries/A320_HAY.png new file mode 100644 index 000000000..7f5c80573 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_HAZ.png new file mode 100644 index 000000000..d97f48d2a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HCC.png b/plugins/channelrx/demodadsb/map/liveries/A320_HCC.png new file mode 100644 index 000000000..19dda0656 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HCC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HIM.png b/plugins/channelrx/demodadsb/map/liveries/A320_HIM.png new file mode 100644 index 000000000..de78f907e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HIM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HIS.png b/plugins/channelrx/demodadsb/map/liveries/A320_HIS.png new file mode 100644 index 000000000..1ae9143a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HIS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HKE.png b/plugins/channelrx/demodadsb/map/liveries/A320_HKE.png new file mode 100644 index 000000000..41ddea810 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HST.png b/plugins/channelrx/demodadsb/map/liveries/A320_HST.png new file mode 100644 index 000000000..42f5c1384 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HVN.png b/plugins/channelrx/demodadsb/map/liveries/A320_HVN.png new file mode 100644 index 000000000..ecc4c7d26 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HXA.png b/plugins/channelrx/demodadsb/map/liveries/A320_HXA.png new file mode 100644 index 000000000..d99469759 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_HYS.png b/plugins/channelrx/demodadsb/map/liveries/A320_HYS.png new file mode 100644 index 000000000..5f1125e3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_HYS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IAD.png b/plugins/channelrx/demodadsb/map/liveries/A320_IAD.png new file mode 100644 index 000000000..515c59776 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IAD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IAW.png b/plugins/channelrx/demodadsb/map/liveries/A320_IAW.png new file mode 100644 index 000000000..f8a1468a7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A320_IBE.png new file mode 100644 index 000000000..314c90dc3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IBS.png b/plugins/channelrx/demodadsb/map/liveries/A320_IBS.png new file mode 100644 index 000000000..0ab08eedf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IBS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IDA.png b/plugins/channelrx/demodadsb/map/liveries/A320_IDA.png new file mode 100644 index 000000000..b59a6463f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IGO.png b/plugins/channelrx/demodadsb/map/liveries/A320_IGO.png new file mode 100644 index 000000000..c138ae313 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IRA.png b/plugins/channelrx/demodadsb/map/liveries/A320_IRA.png new file mode 100644 index 000000000..94423cc56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IRM.png b/plugins/channelrx/demodadsb/map/liveries/A320_IRM.png new file mode 100644 index 000000000..f8769c2a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ISR.png b/plugins/channelrx/demodadsb/map/liveries/A320_ISR.png new file mode 100644 index 000000000..201b1f6bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ISR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ITY_NEW_BLUE.png b/plugins/channelrx/demodadsb/map/liveries/A320_ITY_NEW_BLUE.png new file mode 100644 index 000000000..933d25d0a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ITY_NEW_BLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IWA.png b/plugins/channelrx/demodadsb/map/liveries/A320_IWA.png new file mode 100644 index 000000000..0997af3ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IWD.png b/plugins/channelrx/demodadsb/map/liveries/A320_IWD.png new file mode 100644 index 000000000..220c0454d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IWD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IYE.png b/plugins/channelrx/demodadsb/map/liveries/A320_IYE.png new file mode 100644 index 000000000..b6d8eefaa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IYE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IZG.png b/plugins/channelrx/demodadsb/map/liveries/A320_IZG.png new file mode 100644 index 000000000..856a7cbb1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IZG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_IZM.png b/plugins/channelrx/demodadsb/map/liveries/A320_IZM.png new file mode 100644 index 000000000..3e3a2f5b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_IZM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JAT_CARDENAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_JAT_CARDENAL.png new file mode 100644 index 000000000..18cee3bd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JAT_CARDENAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JAT_HALCON.png b/plugins/channelrx/demodadsb/map/liveries/A320_JAT_HALCON.png new file mode 100644 index 000000000..3557c46b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JAT_HALCON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JAT_JAGUAR.png b/plugins/channelrx/demodadsb/map/liveries/A320_JAT_JAGUAR.png new file mode 100644 index 000000000..c72d24050 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JAT_JAGUAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JAV.png b/plugins/channelrx/demodadsb/map/liveries/A320_JAV.png new file mode 100644 index 000000000..fb31a75ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JBU.png b/plugins/channelrx/demodadsb/map/liveries/A320_JBU.png new file mode 100644 index 000000000..acbadf809 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JBU_BARCODE_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_BARCODE_SL.png new file mode 100644 index 000000000..34e0cd3f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_BARCODE_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JBU_BLUEBERRY_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_BLUEBERRY_SL.png new file mode 100644 index 000000000..80f6fe0e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_BLUEBERRY_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JBU_SPOTLIGHT.png b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_SPOTLIGHT.png new file mode 100644 index 000000000..0d5b56be0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_SPOTLIGHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JBU_STRIPES_BILLBOARD.png b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_STRIPES_BILLBOARD.png new file mode 100644 index 000000000..6b6ac50c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JBU_STRIPES_BILLBOARD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JES.png b/plugins/channelrx/demodadsb/map/liveries/A320_JES.png new file mode 100644 index 000000000..2014f473d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JGO.png b/plugins/channelrx/demodadsb/map/liveries/A320_JGO.png new file mode 100644 index 000000000..a67588d37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JJP.png b/plugins/channelrx/demodadsb/map/liveries/A320_JJP.png new file mode 100644 index 000000000..95c3bbdc0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JJP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JJP_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_JJP_SL.png new file mode 100644 index 000000000..2cf2d8c25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JJP_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JKK.png b/plugins/channelrx/demodadsb/map/liveries/A320_JKK.png new file mode 100644 index 000000000..b477ff8cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JMC.png b/plugins/channelrx/demodadsb/map/liveries/A320_JMC.png new file mode 100644 index 000000000..06a85c064 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JMC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JSA.png b/plugins/channelrx/demodadsb/map/liveries/A320_JSA.png new file mode 100644 index 000000000..85b312cd8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JSA_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_JSA_SL.png new file mode 100644 index 000000000..7e8d0d26c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JSA_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JST.png b/plugins/channelrx/demodadsb/map/liveries/A320_JST.png new file mode 100644 index 000000000..9691bab0d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JST_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_JST_SL.png new file mode 100644 index 000000000..bec16687a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JST_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JZR.png b/plugins/channelrx/demodadsb/map/liveries/A320_JZR.png new file mode 100644 index 000000000..8ed6627be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_JZR_CAK.png b/plugins/channelrx/demodadsb/map/liveries/A320_JZR_CAK.png new file mode 100644 index 000000000..8b108d94d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_JZR_CAK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KAC.png b/plugins/channelrx/demodadsb/map/liveries/A320_KAC.png new file mode 100644 index 000000000..b1bcee533 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KGL.png b/plugins/channelrx/demodadsb/map/liveries/A320_KGL.png new file mode 100644 index 000000000..90fe3917d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KHO.png b/plugins/channelrx/demodadsb/map/liveries/A320_KHO.png new file mode 100644 index 000000000..0aa38ea71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KHO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KKK.png b/plugins/channelrx/demodadsb/map/liveries/A320_KKK.png new file mode 100644 index 000000000..1280975e9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KME.png b/plugins/channelrx/demodadsb/map/liveries/A320_KME.png new file mode 100644 index 000000000..3fea4fd09 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KME.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KMM.png b/plugins/channelrx/demodadsb/map/liveries/A320_KMM.png new file mode 100644 index 000000000..0f7fffead Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KMM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KNE.png b/plugins/channelrx/demodadsb/map/liveries/A320_KNE.png new file mode 100644 index 000000000..c09b56694 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KRP.png b/plugins/channelrx/demodadsb/map/liveries/A320_KRP.png new file mode 100644 index 000000000..cab0b70df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KRP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_KZR.png b/plugins/channelrx/demodadsb/map/liveries/A320_KZR.png new file mode 100644 index 000000000..15c710f9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LAA.png b/plugins/channelrx/demodadsb/map/liveries/A320_LAA.png new file mode 100644 index 000000000..39375e610 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LAN.png b/plugins/channelrx/demodadsb/map/liveries/A320_LAN.png new file mode 100644 index 000000000..449fb01f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LAO.png b/plugins/channelrx/demodadsb/map/liveries/A320_LAO.png new file mode 100644 index 000000000..4c1c60260 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LBT.png b/plugins/channelrx/demodadsb/map/liveries/A320_LBT.png new file mode 100644 index 000000000..0062ecef3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LBY.png b/plugins/channelrx/demodadsb/map/liveries/A320_LBY.png new file mode 100644 index 000000000..44bb57c74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LBY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LDA.png b/plugins/channelrx/demodadsb/map/liveries/A320_LDA.png new file mode 100644 index 000000000..8b681efaa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LDA_CFM.png b/plugins/channelrx/demodadsb/map/liveries/A320_LDA_CFM.png new file mode 100644 index 000000000..c0e79ad00 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LDA_CFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LGS.png b/plugins/channelrx/demodadsb/map/liveries/A320_LGS.png new file mode 100644 index 000000000..21b7c4403 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LGS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A320_LHA_VA.png new file mode 100644 index 000000000..ef285e7c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LIC.png b/plugins/channelrx/demodadsb/map/liveries/A320_LIC.png new file mode 100644 index 000000000..ae824d436 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LKE.png b/plugins/channelrx/demodadsb/map/liveries/A320_LKE.png new file mode 100644 index 000000000..6bec575fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LLC.png b/plugins/channelrx/demodadsb/map/liveries/A320_LLC.png new file mode 100644 index 000000000..7de3dc8fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LLM.png b/plugins/channelrx/demodadsb/map/liveries/A320_LLM.png new file mode 100644 index 000000000..ec6445b0c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LMU.png b/plugins/channelrx/demodadsb/map/liveries/A320_LMU.png new file mode 100644 index 000000000..3ade67364 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LMU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LNE.png b/plugins/channelrx/demodadsb/map/liveries/A320_LNE.png new file mode 100644 index 000000000..b3d04526d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LNR.png b/plugins/channelrx/demodadsb/map/liveries/A320_LNR.png new file mode 100644 index 000000000..9547859f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LRI.png b/plugins/channelrx/demodadsb/map/liveries/A320_LRI.png new file mode 100644 index 000000000..0ad903b8a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LRI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_LZB.png b/plugins/channelrx/demodadsb/map/liveries/A320_LZB.png new file mode 100644 index 000000000..9dc4505d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_LZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MAC.png b/plugins/channelrx/demodadsb/map/liveries/A320_MAC.png new file mode 100644 index 000000000..95c3a081e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MBU.png b/plugins/channelrx/demodadsb/map/liveries/A320_MBU.png new file mode 100644 index 000000000..0502fb4d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MDL.png b/plugins/channelrx/demodadsb/map/liveries/A320_MDL.png new file mode 100644 index 000000000..ecb75a672 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MDL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MEA.png b/plugins/channelrx/demodadsb/map/liveries/A320_MEA.png new file mode 100644 index 000000000..adb247ee8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MET.png b/plugins/channelrx/demodadsb/map/liveries/A320_MET.png new file mode 100644 index 000000000..22262a3cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MLD.png b/plugins/channelrx/demodadsb/map/liveries/A320_MLD.png new file mode 100644 index 000000000..7c3b6aa6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MON.png b/plugins/channelrx/demodadsb/map/liveries/A320_MON.png new file mode 100644 index 000000000..2163b9b4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MON_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_MON_NC.png new file mode 100644 index 000000000..601730dff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MON_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MPD.png b/plugins/channelrx/demodadsb/map/liveries/A320_MPD.png new file mode 100644 index 000000000..68dc6acda Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MPD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MQT.png b/plugins/channelrx/demodadsb/map/liveries/A320_MQT.png new file mode 100644 index 000000000..fafd1d269 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MSC.png b/plugins/channelrx/demodadsb/map/liveries/A320_MSC.png new file mode 100644 index 000000000..020037772 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A320_MSR.png new file mode 100644 index 000000000..489b05128 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MXA.png b/plugins/channelrx/demodadsb/map/liveries/A320_MXA.png new file mode 100644 index 000000000..3acdc8cfb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_MYX.png b/plugins/channelrx/demodadsb/map/liveries/A320_MYX.png new file mode 100644 index 000000000..e318aa7e9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_MYX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A320_NDF.png new file mode 100644 index 000000000..e58435e05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NIA.png b/plugins/channelrx/demodadsb/map/liveries/A320_NIA.png new file mode 100644 index 000000000..93a88b404 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NKS.png b/plugins/channelrx/demodadsb/map/liveries/A320_NKS.png new file mode 100644 index 000000000..015e2353e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NKS_STD.png b/plugins/channelrx/demodadsb/map/liveries/A320_NKS_STD.png new file mode 100644 index 000000000..84712a998 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NKS_STD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NLV.png b/plugins/channelrx/demodadsb/map/liveries/A320_NLV.png new file mode 100644 index 000000000..3dd6b1254 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NLV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NLY.png b/plugins/channelrx/demodadsb/map/liveries/A320_NLY.png new file mode 100644 index 000000000..d6a7e63ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NLY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NMA.png b/plugins/channelrx/demodadsb/map/liveries/A320_NMA.png new file mode 100644 index 000000000..4cb7949bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A320_NTL.png new file mode 100644 index 000000000..ea35daf9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NVD.png b/plugins/channelrx/demodadsb/map/liveries/A320_NVD.png new file mode 100644 index 000000000..da1c0c982 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NVD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NWA.png b/plugins/channelrx/demodadsb/map/liveries/A320_NWA.png new file mode 100644 index 000000000..c2573e322 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NWS.png b/plugins/channelrx/demodadsb/map/liveries/A320_NWS.png new file mode 100644 index 000000000..6c9cc82d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_NWW.png b/plugins/channelrx/demodadsb/map/liveries/A320_NWW.png new file mode 100644 index 000000000..168be1065 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_NWW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_OAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_OAL.png new file mode 100644 index 000000000..a50ed4021 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_OAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A320_OAL_VA.png new file mode 100644 index 000000000..64ceb7cdb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_OCN_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_OCN_NC.png new file mode 100644 index 000000000..3db44a785 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_OCN_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_OCN_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_OCN_OC.png new file mode 100644 index 000000000..2f225d80c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_OCN_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_OCN_W.png b/plugins/channelrx/demodadsb/map/liveries/A320_OCN_W.png new file mode 100644 index 000000000..a99c58246 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_OCN_W.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_OHY.png b/plugins/channelrx/demodadsb/map/liveries/A320_OHY.png new file mode 100644 index 000000000..4838cdb15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_OHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ONE.png b/plugins/channelrx/demodadsb/map/liveries/A320_ONE.png new file mode 100644 index 000000000..e30b21815 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ONE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_PAL.png new file mode 100644 index 000000000..d8aacf159 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PFF.png b/plugins/channelrx/demodadsb/map/liveries/A320_PFF.png new file mode 100644 index 000000000..f07090336 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PGT.png b/plugins/channelrx/demodadsb/map/liveries/A320_PGT.png new file mode 100644 index 000000000..77bf4ea9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PGT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PIA.png b/plugins/channelrx/demodadsb/map/liveries/A320_PIA.png new file mode 100644 index 000000000..a6e6a6da6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PIC.png b/plugins/channelrx/demodadsb/map/liveries/A320_PIC.png new file mode 100644 index 000000000..a1c70e7ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PLX.png b/plugins/channelrx/demodadsb/map/liveries/A320_PLX.png new file mode 100644 index 000000000..514f2de33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_PVI.png b/plugins/channelrx/demodadsb/map/liveries/A320_PVI.png new file mode 100644 index 000000000..a67588d37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_PVI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_QDA.png b/plugins/channelrx/demodadsb/map/liveries/A320_QDA.png new file mode 100644 index 000000000..e5a21b4ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_QDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_QLK.png b/plugins/channelrx/demodadsb/map/liveries/A320_QLK.png new file mode 100644 index 000000000..800a8ae76 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_QLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_QNT.png b/plugins/channelrx/demodadsb/map/liveries/A320_QNT.png new file mode 100644 index 000000000..592723de6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_QNT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A320_QTR.png new file mode 100644 index 000000000..4f11cb970 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_QTR_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_QTR_SL.png new file mode 100644 index 000000000..d81237484 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_QTR_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_RBG.png b/plugins/channelrx/demodadsb/map/liveries/A320_RBG.png new file mode 100644 index 000000000..7935f009f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_RBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A320_RJA.png new file mode 100644 index 000000000..534d69e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_ROU.png b/plugins/channelrx/demodadsb/map/liveries/A320_ROU.png new file mode 100644 index 000000000..dd7bdaff1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_ROU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_RYR.png b/plugins/channelrx/demodadsb/map/liveries/A320_RYR.png new file mode 100644 index 000000000..c0e79ad00 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_RYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_RYW.png b/plugins/channelrx/demodadsb/map/liveries/A320_RYW.png new file mode 100644 index 000000000..0cdbfdda2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_RYW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A320_SAA.png new file mode 100644 index 000000000..eff0f9480 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SAB.png b/plugins/channelrx/demodadsb/map/liveries/A320_SAB.png new file mode 100644 index 000000000..a14d18ef1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SAB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A320_SAS.png new file mode 100644 index 000000000..c70894883 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SAS_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_SAS_NC.png new file mode 100644 index 000000000..fba490880 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SAS_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SAT.png b/plugins/channelrx/demodadsb/map/liveries/A320_SAT.png new file mode 100644 index 000000000..67788490f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SAU.png b/plugins/channelrx/demodadsb/map/liveries/A320_SAU.png new file mode 100644 index 000000000..dfd1d6a9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SBI.png b/plugins/channelrx/demodadsb/map/liveries/A320_SBI.png new file mode 100644 index 000000000..d097bcb91 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SCO.png b/plugins/channelrx/demodadsb/map/liveries/A320_SCO.png new file mode 100644 index 000000000..2fc47d4ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SDM.png b/plugins/channelrx/demodadsb/map/liveries/A320_SDM.png new file mode 100644 index 000000000..5bd181d4b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SDR.png b/plugins/channelrx/demodadsb/map/liveries/A320_SDR.png new file mode 100644 index 000000000..298c3a9aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SDR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SFJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_SFJ.png new file mode 100644 index 000000000..873a9e323 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SFJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SFJ_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_SFJ_SL.png new file mode 100644 index 000000000..c83335b42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SFJ_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SHT_IAE.png b/plugins/channelrx/demodadsb/map/liveries/A320_SHT_IAE.png new file mode 100644 index 000000000..ddf59b184 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SHT_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SHU.png b/plugins/channelrx/demodadsb/map/liveries/A320_SHU.png new file mode 100644 index 000000000..00a9f4f14 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SHU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SJV.png b/plugins/channelrx/demodadsb/map/liveries/A320_SJV.png new file mode 100644 index 000000000..cd61fae46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SJV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SKS.png b/plugins/channelrx/demodadsb/map/liveries/A320_SKS.png new file mode 100644 index 000000000..976987d82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SLK.png b/plugins/channelrx/demodadsb/map/liveries/A320_SLK.png new file mode 100644 index 000000000..279d49548 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SVA.png b/plugins/channelrx/demodadsb/map/liveries/A320_SVA.png new file mode 100644 index 000000000..4d1bb0ee0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SVR.png b/plugins/channelrx/demodadsb/map/liveries/A320_SVR.png new file mode 100644 index 000000000..b671a65bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SWE.png b/plugins/channelrx/demodadsb/map/liveries/A320_SWE.png new file mode 100644 index 000000000..cf5d09853 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A320_SWR.png new file mode 100644 index 000000000..a463e519f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SXS.png b/plugins/channelrx/demodadsb/map/liveries/A320_SXS.png new file mode 100644 index 000000000..f4a1eba4e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SYA.png b/plugins/channelrx/demodadsb/map/liveries/A320_SYA.png new file mode 100644 index 000000000..a47613bf4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SYA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_SYR.png b/plugins/channelrx/demodadsb/map/liveries/A320_SYR.png new file mode 100644 index 000000000..c237d5f70 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_SYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TAI.png b/plugins/channelrx/demodadsb/map/liveries/A320_TAI.png new file mode 100644 index 000000000..95e0d4f69 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A320_TAM.png new file mode 100644 index 000000000..73fb61e13 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A320_TAP.png new file mode 100644 index 000000000..bdb2004c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TAR.png b/plugins/channelrx/demodadsb/map/liveries/A320_TAR.png new file mode 100644 index 000000000..3daf847d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TBA.png b/plugins/channelrx/demodadsb/map/liveries/A320_TBA.png new file mode 100644 index 000000000..a37f3df2e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TCW.png b/plugins/channelrx/demodadsb/map/liveries/A320_TCW.png new file mode 100644 index 000000000..a7511edfa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TCW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TCX.png b/plugins/channelrx/demodadsb/map/liveries/A320_TCX.png new file mode 100644 index 000000000..64a3c4772 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TCX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TEF.png b/plugins/channelrx/demodadsb/map/liveries/A320_TEF.png new file mode 100644 index 000000000..b13205f97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_TEJ.png new file mode 100644 index 000000000..05d7294de Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TGW.png b/plugins/channelrx/demodadsb/map/liveries/A320_TGW.png new file mode 100644 index 000000000..50615c685 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TGW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_THA.png b/plugins/channelrx/demodadsb/map/liveries/A320_THA.png new file mode 100644 index 000000000..1cb8a4e1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_THD_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_THD_SL.png new file mode 100644 index 000000000..836197b61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_THD_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_THY.png b/plugins/channelrx/demodadsb/map/liveries/A320_THY.png new file mode 100644 index 000000000..402db48ca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_THY_NC.png b/plugins/channelrx/demodadsb/map/liveries/A320_THY_NC.png new file mode 100644 index 000000000..e32b654b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_THY_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A320_TKY.png new file mode 100644 index 000000000..cddc5d090 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TNU.png b/plugins/channelrx/demodadsb/map/liveries/A320_TNU.png new file mode 100644 index 000000000..de58d39f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TNU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TOM.png b/plugins/channelrx/demodadsb/map/liveries/A320_TOM.png new file mode 100644 index 000000000..c9d2870d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TTW.png b/plugins/channelrx/demodadsb/map/liveries/A320_TTW.png new file mode 100644 index 000000000..e53e6636c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TTW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TVJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_TVJ.png new file mode 100644 index 000000000..4477b3c6f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TVJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TVJ_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_TVJ_SL.png new file mode 100644 index 000000000..59eac11db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TVJ_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TVS.png b/plugins/channelrx/demodadsb/map/liveries/A320_TVS.png new file mode 100644 index 000000000..6a722f106 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TVS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_TVS_CSA.png b/plugins/channelrx/demodadsb/map/liveries/A320_TVS_CSA.png new file mode 100644 index 000000000..dbe8c2a66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_TVS_CSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UAL.png b/plugins/channelrx/demodadsb/map/liveries/A320_UAL.png new file mode 100644 index 000000000..901d7ee3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UAL_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_UAL_OC.png new file mode 100644 index 000000000..72612d232 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UAL_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UDC.png b/plugins/channelrx/demodadsb/map/liveries/A320_UDC.png new file mode 100644 index 000000000..828e21537 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UDC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UEA.png b/plugins/channelrx/demodadsb/map/liveries/A320_UEA.png new file mode 100644 index 000000000..fd9715698 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UGD_ALBINO.png b/plugins/channelrx/demodadsb/map/liveries/A320_UGD_ALBINO.png new file mode 100644 index 000000000..b848755a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UGD_ALBINO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UKV.png b/plugins/channelrx/demodadsb/map/liveries/A320_UKV.png new file mode 100644 index 000000000..8c824cbdb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_USA.png b/plugins/channelrx/demodadsb/map/liveries/A320_USA.png new file mode 100644 index 000000000..6879c19b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_UZB.png b/plugins/channelrx/demodadsb/map/liveries/A320_UZB.png new file mode 100644 index 000000000..26bbb55ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_UZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VAW_CFM.png b/plugins/channelrx/demodadsb/map/liveries/A320_VAW_CFM.png new file mode 100644 index 000000000..e1760f2e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VAW_CFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VAW_IAE.png b/plugins/channelrx/demodadsb/map/liveries/A320_VAW_IAE.png new file mode 100644 index 000000000..5c50b52c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VAW_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VCP.png b/plugins/channelrx/demodadsb/map/liveries/A320_VCP.png new file mode 100644 index 000000000..85bbef49a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VIM.png b/plugins/channelrx/demodadsb/map/liveries/A320_VIM.png new file mode 100644 index 000000000..5973d1180 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VIM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VIR.png b/plugins/channelrx/demodadsb/map/liveries/A320_VIR.png new file mode 100644 index 000000000..1b0c5ad3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VIV.png b/plugins/channelrx/demodadsb/map/liveries/A320_VIV.png new file mode 100644 index 000000000..25ae37f6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VIV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VJC.png b/plugins/channelrx/demodadsb/map/liveries/A320_VJC.png new file mode 100644 index 000000000..88b0faa96 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VLC.png b/plugins/channelrx/demodadsb/map/liveries/A320_VLC.png new file mode 100644 index 000000000..33a70a344 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VLG.png b/plugins/channelrx/demodadsb/map/liveries/A320_VLG.png new file mode 100644 index 000000000..7a282507f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VLK.png b/plugins/channelrx/demodadsb/map/liveries/A320_VLK.png new file mode 100644 index 000000000..416fdf9fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VOE.png b/plugins/channelrx/demodadsb/map/liveries/A320_VOE.png new file mode 100644 index 000000000..cfd4ef0e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VOI.png b/plugins/channelrx/demodadsb/map/liveries/A320_VOI.png new file mode 100644 index 000000000..e89b0649e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VOI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VRD.png b/plugins/channelrx/demodadsb/map/liveries/A320_VRD.png new file mode 100644 index 000000000..281937d68 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VRD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VRE.png b/plugins/channelrx/demodadsb/map/liveries/A320_VRE.png new file mode 100644 index 000000000..d3e9764d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VSP.png b/plugins/channelrx/demodadsb/map/liveries/A320_VSP.png new file mode 100644 index 000000000..b10e97a3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VTI.png b/plugins/channelrx/demodadsb/map/liveries/A320_VTI.png new file mode 100644 index 000000000..36f5e94db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VVC.png b/plugins/channelrx/demodadsb/map/liveries/A320_VVC.png new file mode 100644 index 000000000..de278f94a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VVC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_VVC_OC.png b/plugins/channelrx/demodadsb/map/liveries/A320_VVC_OC.png new file mode 100644 index 000000000..8f0a080f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_VVC_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WAJ.png b/plugins/channelrx/demodadsb/map/liveries/A320_WAJ.png new file mode 100644 index 000000000..a5623d707 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WAJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WAN.png b/plugins/channelrx/demodadsb/map/liveries/A320_WAN.png new file mode 100644 index 000000000..47d2997f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A320_WAT.png new file mode 100644 index 000000000..808b895bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WAU.png b/plugins/channelrx/demodadsb/map/liveries/A320_WAU.png new file mode 100644 index 000000000..5a5cc5cdd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WHT.png b/plugins/channelrx/demodadsb/map/liveries/A320_WHT.png new file mode 100644 index 000000000..fe4bd9c2d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WMT.png b/plugins/channelrx/demodadsb/map/liveries/A320_WMT.png new file mode 100644 index 000000000..a09c77d3c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WMT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WOW.png b/plugins/channelrx/demodadsb/map/liveries/A320_WOW.png new file mode 100644 index 000000000..1f8c701d7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WOW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WRC.png b/plugins/channelrx/demodadsb/map/liveries/A320_WRC.png new file mode 100644 index 000000000..03def7e37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WRC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WTB.png b/plugins/channelrx/demodadsb/map/liveries/A320_WTB.png new file mode 100644 index 000000000..84c28f466 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WUK.png b/plugins/channelrx/demodadsb/map/liveries/A320_WUK.png new file mode 100644 index 000000000..af71d85ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WVL.png b/plugins/channelrx/demodadsb/map/liveries/A320_WVL.png new file mode 100644 index 000000000..19679837a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WVL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WYB.png b/plugins/channelrx/demodadsb/map/liveries/A320_WYB.png new file mode 100644 index 000000000..58601cab0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WYB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WYB_SL.png b/plugins/channelrx/demodadsb/map/liveries/A320_WYB_SL.png new file mode 100644 index 000000000..c2474c630 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WYB_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_WZZ.png b/plugins/channelrx/demodadsb/map/liveries/A320_WZZ.png new file mode 100644 index 000000000..e254c21a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_WZZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A320_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A320_XSN.png new file mode 100644 index 000000000..89ed28a1e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A320_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321.png b/plugins/channelrx/demodadsb/map/liveries/A321.png new file mode 100644 index 000000000..06a0a7232 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321F.png b/plugins/channelrx/demodadsb/map/liveries/A321F.png new file mode 100644 index 000000000..17aa65417 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321F_AWC.png b/plugins/channelrx/demodadsb/map/liveries/A321F_AWC.png new file mode 100644 index 000000000..b97ddd913 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321F_AWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321F_AZU.png b/plugins/channelrx/demodadsb/map/liveries/A321F_AZU.png new file mode 100644 index 000000000..56bf2123d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321F_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321F_GEC.png b/plugins/channelrx/demodadsb/map/liveries/A321F_GEC.png new file mode 100644 index 000000000..aab9e1f7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321F_GEC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AAG.png b/plugins/channelrx/demodadsb/map/liveries/A321_AAG.png new file mode 100644 index 000000000..eb654bad4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AAL.png b/plugins/channelrx/demodadsb/map/liveries/A321_AAL.png new file mode 100644 index 000000000..6e5578317 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AAL_WL.png b/plugins/channelrx/demodadsb/map/liveries/A321_AAL_WL.png new file mode 100644 index 000000000..5bef8e973 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AAL_WL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AAR.png b/plugins/channelrx/demodadsb/map/liveries/A321_AAR.png new file mode 100644 index 000000000..ea4c79e64 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ABL.png b/plugins/channelrx/demodadsb/map/liveries/A321_ABL.png new file mode 100644 index 000000000..d96beb334 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ABL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ABQ.png b/plugins/channelrx/demodadsb/map/liveries/A321_ABQ.png new file mode 100644 index 000000000..d02a878dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ABQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ABY.png b/plugins/channelrx/demodadsb/map/liveries/A321_ABY.png new file mode 100644 index 000000000..4e6d947ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ABY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ACA.png b/plugins/channelrx/demodadsb/map/liveries/A321_ACA.png new file mode 100644 index 000000000..1e0f1b958 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ACA_NC.png b/plugins/channelrx/demodadsb/map/liveries/A321_ACA_NC.png new file mode 100644 index 000000000..999c4c50f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ACA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ADH.png b/plugins/channelrx/demodadsb/map/liveries/A321_ADH.png new file mode 100644 index 000000000..236a5ee12 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ADH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AEE.png b/plugins/channelrx/demodadsb/map/liveries/A321_AEE.png new file mode 100644 index 000000000..b4903925c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AFF.png b/plugins/channelrx/demodadsb/map/liveries/A321_AFF.png new file mode 100644 index 000000000..8ba72105d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A321_AFL.png new file mode 100644 index 000000000..2022412e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A321_AFR.png new file mode 100644 index 000000000..9e4ebca32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AFX.png b/plugins/channelrx/demodadsb/map/liveries/A321_AFX.png new file mode 100644 index 000000000..f3c66fc75 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A321_AIC.png new file mode 100644 index 000000000..5d23bbb82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AJM.png b/plugins/channelrx/demodadsb/map/liveries/A321_AJM.png new file mode 100644 index 000000000..f892f0f20 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AJM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A321_ALK.png new file mode 100644 index 000000000..d02ab0994 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AMU.png b/plugins/channelrx/demodadsb/map/liveries/A321_AMU.png new file mode 100644 index 000000000..ead2d1133 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AMU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ANA.png b/plugins/channelrx/demodadsb/map/liveries/A321_ANA.png new file mode 100644 index 000000000..9b6decb9c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ART.png b/plugins/channelrx/demodadsb/map/liveries/A321_ART.png new file mode 100644 index 000000000..a19a533d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ART.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ARU.png b/plugins/channelrx/demodadsb/map/liveries/A321_ARU.png new file mode 100644 index 000000000..90c36fa1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ARU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ASV.png b/plugins/channelrx/demodadsb/map/liveries/A321_ASV.png new file mode 100644 index 000000000..b7e3840b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ASV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A321_AUA.png new file mode 100644 index 000000000..e18b231fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AUA_SL.png b/plugins/channelrx/demodadsb/map/liveries/A321_AUA_SL.png new file mode 100644 index 000000000..43e4dada6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AUA_SL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AWC.png b/plugins/channelrx/demodadsb/map/liveries/A321_AWC.png new file mode 100644 index 000000000..61dcccd5c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AWE.png b/plugins/channelrx/demodadsb/map/liveries/A321_AWE.png new file mode 100644 index 000000000..24698fd99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AXB.png b/plugins/channelrx/demodadsb/map/liveries/A321_AXB.png new file mode 100644 index 000000000..be50925d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AXB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_AZA.png b/plugins/channelrx/demodadsb/map/liveries/A321_AZA.png new file mode 100644 index 000000000..c9f4eb2a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BAV.png b/plugins/channelrx/demodadsb/map/liveries/A321_BAV.png new file mode 100644 index 000000000..d4668abd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A321_BAW.png new file mode 100644 index 000000000..5ecb5a2e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BBT.png b/plugins/channelrx/demodadsb/map/liveries/A321_BBT.png new file mode 100644 index 000000000..82df07966 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BER.png b/plugins/channelrx/demodadsb/map/liveries/A321_BER.png new file mode 100644 index 000000000..3b2ec8563 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A321_BHE.png new file mode 100644 index 000000000..be779ebce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BIE.png b/plugins/channelrx/demodadsb/map/liveries/A321_BIE.png new file mode 100644 index 000000000..081f6f55a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BMA.png b/plugins/channelrx/demodadsb/map/liveries/A321_BMA.png new file mode 100644 index 000000000..03972720f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BMI.png b/plugins/channelrx/demodadsb/map/liveries/A321_BMI.png new file mode 100644 index 000000000..ace754611 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BTV.png b/plugins/channelrx/demodadsb/map/liveries/A321_BTV.png new file mode 100644 index 000000000..32ec87557 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BTV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A321_BVX.png new file mode 100644 index 000000000..a9c104678 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_BYD.png b/plugins/channelrx/demodadsb/map/liveries/A321_BYD.png new file mode 100644 index 000000000..2e7426b20 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_BYD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CAI.png b/plugins/channelrx/demodadsb/map/liveries/A321_CAI.png new file mode 100644 index 000000000..126249d57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A321_CBJ.png new file mode 100644 index 000000000..9b5b38f62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A321_CCA.png new file mode 100644 index 000000000..4348b03f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CEB.png b/plugins/channelrx/demodadsb/map/liveries/A321_CEB.png new file mode 100644 index 000000000..21d0d999b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CES.png b/plugins/channelrx/demodadsb/map/liveries/A321_CES.png new file mode 100644 index 000000000..b7d68aa92 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CES_NC.png b/plugins/channelrx/demodadsb/map/liveries/A321_CES_NC.png new file mode 100644 index 000000000..9bcf62ea4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CES_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CFG.png b/plugins/channelrx/demodadsb/map/liveries/A321_CFG.png new file mode 100644 index 000000000..419188c3a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CFG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_AIAC.png b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_AIAC.png new file mode 100644 index 000000000..cc872aaa4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_AIAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_AIAD.png b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_AIAD.png new file mode 100644 index 000000000..b4f924c4d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_AIAD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_ATCF.png b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_ATCF.png new file mode 100644 index 000000000..e992a5ed7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_ATCF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_ATCG.png b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_ATCG.png new file mode 100644 index 000000000..2c62f578f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_D_ATCG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CFG_OC.png b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_OC.png new file mode 100644 index 000000000..fec9d6d9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CFG_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CSA.png b/plugins/channelrx/demodadsb/map/liveries/A321_CSA.png new file mode 100644 index 000000000..8baad8555 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A321_CSC.png new file mode 100644 index 000000000..d0bf572ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A321_CSN.png new file mode 100644 index 000000000..10556e3ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CTO.png b/plugins/channelrx/demodadsb/map/liveries/A321_CTO.png new file mode 100644 index 000000000..3bdf2d8b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CTO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A321_CXA_VA.png new file mode 100644 index 000000000..fb46ce19a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_CYP.png b/plugins/channelrx/demodadsb/map/liveries/A321_CYP.png new file mode 100644 index 000000000..aad2f73fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_CYP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A321_DAL.png new file mode 100644 index 000000000..38606cd96 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_DKH.png b/plugins/channelrx/demodadsb/map/liveries/A321_DKH.png new file mode 100644 index 000000000..f26fea3f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_DKH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A321_DLH.png new file mode 100644 index 000000000..f48526987 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/A321_DLH_OC.png new file mode 100644 index 000000000..888cdf1db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EFW.png b/plugins/channelrx/demodadsb/map/liveries/A321_EFW.png new file mode 100644 index 000000000..1218d47d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EFW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A321_EIN.png new file mode 100644 index 000000000..96845146c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A321_ETD.png new file mode 100644 index 000000000..a9e4069e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EUS.png b/plugins/channelrx/demodadsb/map/liveries/A321_EUS.png new file mode 100644 index 000000000..70209f01d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EVA.png b/plugins/channelrx/demodadsb/map/liveries/A321_EVA.png new file mode 100644 index 000000000..a742d2192 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EWG.png b/plugins/channelrx/demodadsb/map/liveries/A321_EWG.png new file mode 100644 index 000000000..7ad31a75b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EXS.png b/plugins/channelrx/demodadsb/map/liveries/A321_EXS.png new file mode 100644 index 000000000..ae8461100 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_EZY.png b/plugins/channelrx/demodadsb/map/liveries/A321_EZY.png new file mode 100644 index 000000000..1a3a667e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_EZY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FFT_701.png b/plugins/channelrx/demodadsb/map/liveries/A321_FFT_701.png new file mode 100644 index 000000000..8868f014e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FFT_701.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FFT_721.png b/plugins/channelrx/demodadsb/map/liveries/A321_FFT_721.png new file mode 100644 index 000000000..1c0772dce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FFT_721.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FFT_723.png b/plugins/channelrx/demodadsb/map/liveries/A321_FFT_723.png new file mode 100644 index 000000000..4b85026a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FFT_723.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FHA.png b/plugins/channelrx/demodadsb/map/liveries/A321_FHA.png new file mode 100644 index 000000000..91d95d18e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FIA.png b/plugins/channelrx/demodadsb/map/liveries/A321_FIA.png new file mode 100644 index 000000000..9e43f3c1e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FIN.png b/plugins/channelrx/demodadsb/map/liveries/A321_FIN.png new file mode 100644 index 000000000..8e7d3f878 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FIN_WINGFENCE.png b/plugins/channelrx/demodadsb/map/liveries/A321_FIN_WINGFENCE.png new file mode 100644 index 000000000..b3a2cdab3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FIN_WINGFENCE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FOE.png b/plugins/channelrx/demodadsb/map/liveries/A321_FOE.png new file mode 100644 index 000000000..7124d47eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_FRR.png b/plugins/channelrx/demodadsb/map/liveries/A321_FRR.png new file mode 100644 index 000000000..e971eac4f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_FRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_GAP.png b/plugins/channelrx/demodadsb/map/liveries/A321_GAP.png new file mode 100644 index 000000000..237fa2536 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_GAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_GCR.png b/plugins/channelrx/demodadsb/map/liveries/A321_GCR.png new file mode 100644 index 000000000..3202ad2b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_GCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A321_GFA.png new file mode 100644 index 000000000..cbc2e7b56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_GMI.png b/plugins/channelrx/demodadsb/map/liveries/A321_GMI.png new file mode 100644 index 000000000..0b2d1a10a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_GMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_GXA.png b/plugins/channelrx/demodadsb/map/liveries/A321_GXA.png new file mode 100644 index 000000000..b56f3f84e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_GXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_GZQ.png b/plugins/channelrx/demodadsb/map/liveries/A321_GZQ.png new file mode 100644 index 000000000..8a31a1d99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_GZQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A321_HAZ.png new file mode 100644 index 000000000..6e7420622 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_HDA.png b/plugins/channelrx/demodadsb/map/liveries/A321_HDA.png new file mode 100644 index 000000000..a798f8665 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_HDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_HKE.png b/plugins/channelrx/demodadsb/map/liveries/A321_HKE.png new file mode 100644 index 000000000..7a072e29f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_HKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_HRM.png b/plugins/channelrx/demodadsb/map/liveries/A321_HRM.png new file mode 100644 index 000000000..d6cc5ee08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_HRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_HVN.png b/plugins/channelrx/demodadsb/map/liveries/A321_HVN.png new file mode 100644 index 000000000..84ab6a9c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_IAW.png b/plugins/channelrx/demodadsb/map/liveries/A321_IAW.png new file mode 100644 index 000000000..68b3397e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A321_IBE.png new file mode 100644 index 000000000..efbf038c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_IBS.png b/plugins/channelrx/demodadsb/map/liveries/A321_IBS.png new file mode 100644 index 000000000..fae19bb29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_IBS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_IRA.png b/plugins/channelrx/demodadsb/map/liveries/A321_IRA.png new file mode 100644 index 000000000..563ee84a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_IRM.png b/plugins/channelrx/demodadsb/map/liveries/A321_IRM.png new file mode 100644 index 000000000..83dc1e2c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_IRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_IWA.png b/plugins/channelrx/demodadsb/map/liveries/A321_IWA.png new file mode 100644 index 000000000..d5daa4265 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_JBU.png b/plugins/channelrx/demodadsb/map/liveries/A321_JBU.png new file mode 100644 index 000000000..52448fa9e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_JBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_JBU_NC_MOMINT.png b/plugins/channelrx/demodadsb/map/liveries/A321_JBU_NC_MOMINT.png new file mode 100644 index 000000000..4c15715fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_JBU_NC_MOMINT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_JKK.png b/plugins/channelrx/demodadsb/map/liveries/A321_JKK.png new file mode 100644 index 000000000..c99af4f19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_JKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_JST.png b/plugins/channelrx/demodadsb/map/liveries/A321_JST.png new file mode 100644 index 000000000..e63c3bb0a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_JST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_KFR.png b/plugins/channelrx/demodadsb/map/liveries/A321_KFR.png new file mode 100644 index 000000000..480e8e0d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_KFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_KGL.png b/plugins/channelrx/demodadsb/map/liveries/A321_KGL.png new file mode 100644 index 000000000..daf0ee0f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_KGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_KYV.png b/plugins/channelrx/demodadsb/map/liveries/A321_KYV.png new file mode 100644 index 000000000..321ac6f19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_KYV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_KZR.png b/plugins/channelrx/demodadsb/map/liveries/A321_KZR.png new file mode 100644 index 000000000..74571cf29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_LAN.png b/plugins/channelrx/demodadsb/map/liveries/A321_LAN.png new file mode 100644 index 000000000..bdb1af80f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_LBT.png b/plugins/channelrx/demodadsb/map/liveries/A321_LBT.png new file mode 100644 index 000000000..a98c5d6af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_LBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A321_LHA_VA.png new file mode 100644 index 000000000..18f442b25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_LLM.png b/plugins/channelrx/demodadsb/map/liveries/A321_LLM.png new file mode 100644 index 000000000..d3b5a5d85 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_LLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_LNR.png b/plugins/channelrx/demodadsb/map/liveries/A321_LNR.png new file mode 100644 index 000000000..3bc553335 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_LTU.png b/plugins/channelrx/demodadsb/map/liveries/A321_LTU.png new file mode 100644 index 000000000..ea2cbcadd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_LTU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_MBU.png b/plugins/channelrx/demodadsb/map/liveries/A321_MBU.png new file mode 100644 index 000000000..15bb17a53 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_MBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_MEA.png b/plugins/channelrx/demodadsb/map/liveries/A321_MEA.png new file mode 100644 index 000000000..1d9d39db6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_MEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_MET.png b/plugins/channelrx/demodadsb/map/liveries/A321_MET.png new file mode 100644 index 000000000..6ee6b2d55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_MLD.png b/plugins/channelrx/demodadsb/map/liveries/A321_MLD.png new file mode 100644 index 000000000..7156ee5ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_MLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_MON.png b/plugins/channelrx/demodadsb/map/liveries/A321_MON.png new file mode 100644 index 000000000..d7bb3d99c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A321_MSR.png new file mode 100644 index 000000000..510b47868 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A321_NDF.png new file mode 100644 index 000000000..52aff1d43 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NIA.png b/plugins/channelrx/demodadsb/map/liveries/A321_NIA.png new file mode 100644 index 000000000..f01ff7df6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NKS.png b/plugins/channelrx/demodadsb/map/liveries/A321_NKS.png new file mode 100644 index 000000000..52b41b74e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NKS_NC.png b/plugins/channelrx/demodadsb/map/liveries/A321_NKS_NC.png new file mode 100644 index 000000000..6f89f87b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NKS_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NLY.png b/plugins/channelrx/demodadsb/map/liveries/A321_NLY.png new file mode 100644 index 000000000..c23adc046 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NLY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A321_NTL.png new file mode 100644 index 000000000..9755c64e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NVR.png b/plugins/channelrx/demodadsb/map/liveries/A321_NVR.png new file mode 100644 index 000000000..b0a0da7b9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NWS.png b/plugins/channelrx/demodadsb/map/liveries/A321_NWS.png new file mode 100644 index 000000000..b3f4b55a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_NWS_NC.png b/plugins/channelrx/demodadsb/map/liveries/A321_NWS_NC.png new file mode 100644 index 000000000..19c658838 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_NWS_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A321_OAL_VA.png new file mode 100644 index 000000000..705d242f0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_OHY.png b/plugins/channelrx/demodadsb/map/liveries/A321_OHY.png new file mode 100644 index 000000000..8d46d97b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_OHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A321_PAL.png new file mode 100644 index 000000000..1e74f6455 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_PLX.png b/plugins/channelrx/demodadsb/map/liveries/A321_PLX.png new file mode 100644 index 000000000..1211b5c7a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A321_QTR.png new file mode 100644 index 000000000..b6db85499 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_RAM.png b/plugins/channelrx/demodadsb/map/liveries/A321_RAM.png new file mode 100644 index 000000000..0f319457e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A321_RJA.png new file mode 100644 index 000000000..7ea30f10a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_ROU.png b/plugins/channelrx/demodadsb/map/liveries/A321_ROU.png new file mode 100644 index 000000000..8bd4b8116 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_ROU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A321_SAS.png new file mode 100644 index 000000000..03777bec2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SAS_OC.png b/plugins/channelrx/demodadsb/map/liveries/A321_SAS_OC.png new file mode 100644 index 000000000..b6417fab8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SAS_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SBI.png b/plugins/channelrx/demodadsb/map/liveries/A321_SBI.png new file mode 100644 index 000000000..617e71bed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SCO.png b/plugins/channelrx/demodadsb/map/liveries/A321_SCO.png new file mode 100644 index 000000000..33f80ea31 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SHT.png b/plugins/channelrx/demodadsb/map/liveries/A321_SHT.png new file mode 100644 index 000000000..1218d47d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SHT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SKS.png b/plugins/channelrx/demodadsb/map/liveries/A321_SKS.png new file mode 100644 index 000000000..ed7b1bdd9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_STW.png b/plugins/channelrx/demodadsb/map/liveries/A321_STW.png new file mode 100644 index 000000000..aa9f4f954 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_STW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SVA.png b/plugins/channelrx/demodadsb/map/liveries/A321_SVA.png new file mode 100644 index 000000000..e3b339a74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SVR.png b/plugins/channelrx/demodadsb/map/liveries/A321_SVR.png new file mode 100644 index 000000000..93fd226c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SVR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A321_SWR.png new file mode 100644 index 000000000..0410b55ca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A321_TAM.png new file mode 100644 index 000000000..e45d380fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A321_TAP.png new file mode 100644 index 000000000..2781e255a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TCX.png b/plugins/channelrx/demodadsb/map/liveries/A321_TCX.png new file mode 100644 index 000000000..3b6b92d57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TCX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TEF.png b/plugins/channelrx/demodadsb/map/liveries/A321_TEF.png new file mode 100644 index 000000000..560e3eb33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/A321_TEJ.png new file mode 100644 index 000000000..05ce05c9e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_THY.png b/plugins/channelrx/demodadsb/map/liveries/A321_THY.png new file mode 100644 index 000000000..f5d4bd297 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_THY_NCSL.png b/plugins/channelrx/demodadsb/map/liveries/A321_THY_NCSL.png new file mode 100644 index 000000000..2b20c104f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_THY_NCSL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TKJ.png b/plugins/channelrx/demodadsb/map/liveries/A321_TKJ.png new file mode 100644 index 000000000..43f826dd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TKJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A321_TKY.png new file mode 100644 index 000000000..9e9569aa6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TNA.png b/plugins/channelrx/demodadsb/map/liveries/A321_TNA.png new file mode 100644 index 000000000..80512b5d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TNA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TSC.png b/plugins/channelrx/demodadsb/map/liveries/A321_TSC.png new file mode 100644 index 000000000..49172f4ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_TVJ.png b/plugins/channelrx/demodadsb/map/liveries/A321_TVJ.png new file mode 100644 index 000000000..378a5116b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_TVJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_UDC.png b/plugins/channelrx/demodadsb/map/liveries/A321_UDC.png new file mode 100644 index 000000000..932cc2edd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_UDC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_UKV.png b/plugins/channelrx/demodadsb/map/liveries/A321_UKV.png new file mode 100644 index 000000000..3acadfa76 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_USA.png b/plugins/channelrx/demodadsb/map/liveries/A321_USA.png new file mode 100644 index 000000000..ac75aa167 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_UTA.png b/plugins/channelrx/demodadsb/map/liveries/A321_UTA.png new file mode 100644 index 000000000..659f486d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VAW.png b/plugins/channelrx/demodadsb/map/liveries/A321_VAW.png new file mode 100644 index 000000000..40220d737 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VCP.png b/plugins/channelrx/demodadsb/map/liveries/A321_VCP.png new file mode 100644 index 000000000..8b8d743b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VIV.png b/plugins/channelrx/demodadsb/map/liveries/A321_VIV.png new file mode 100644 index 000000000..a84193cef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VIV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VJC.png b/plugins/channelrx/demodadsb/map/liveries/A321_VJC.png new file mode 100644 index 000000000..d2d5ee4cd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VKG.png b/plugins/channelrx/demodadsb/map/liveries/A321_VKG.png new file mode 100644 index 000000000..5dd63ed54 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VKG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VLC.png b/plugins/channelrx/demodadsb/map/liveries/A321_VLC.png new file mode 100644 index 000000000..4fa5b5fb2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VLG.png b/plugins/channelrx/demodadsb/map/liveries/A321_VLG.png new file mode 100644 index 000000000..50a68da2c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_VOI.png b/plugins/channelrx/demodadsb/map/liveries/A321_VOI.png new file mode 100644 index 000000000..1bb283c26 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_VOI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A321_WAT.png new file mode 100644 index 000000000..8847a74e9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_WOW.png b/plugins/channelrx/demodadsb/map/liveries/A321_WOW.png new file mode 100644 index 000000000..097692bc5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_WOW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_WTB.png b/plugins/channelrx/demodadsb/map/liveries/A321_WTB.png new file mode 100644 index 000000000..fcae28669 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_WTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_WUK.png b/plugins/channelrx/demodadsb/map/liveries/A321_WUK.png new file mode 100644 index 000000000..c31f2e9f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_WUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_WZZ.png b/plugins/channelrx/demodadsb/map/liveries/A321_WZZ.png new file mode 100644 index 000000000..2f0134c74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_WZZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A321_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A321_XSN.png new file mode 100644 index 000000000..0c5126a4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A321_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332.png b/plugins/channelrx/demodadsb/map/liveries/A332.png new file mode 100644 index 000000000..f5384ebb6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332F_ABB_HONGYUAN.png b/plugins/channelrx/demodadsb/map/liveries/A332F_ABB_HONGYUAN.png new file mode 100644 index 000000000..173fbb085 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332F_ABB_HONGYUAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332F_AHK.png b/plugins/channelrx/demodadsb/map/liveries/A332F_AHK.png new file mode 100644 index 000000000..2cd94c21e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332F_AHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332F_BCS.png b/plugins/channelrx/demodadsb/map/liveries/A332F_BCS.png new file mode 100644 index 000000000..61479e23a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332F_BCS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332F_MAS.png b/plugins/channelrx/demodadsb/map/liveries/A332F_MAS.png new file mode 100644 index 000000000..c28fd7ec6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332F_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332F_MSX.png b/plugins/channelrx/demodadsb/map/liveries/A332F_MSX.png new file mode 100644 index 000000000..6e717aeb8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332F_MSX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332F_TUA.png b/plugins/channelrx/demodadsb/map/liveries/A332F_TUA.png new file mode 100644 index 000000000..b7f99a8ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332F_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AAL.png b/plugins/channelrx/demodadsb/map/liveries/A332_AAL.png new file mode 100644 index 000000000..4a34983b5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AAW.png b/plugins/channelrx/demodadsb/map/liveries/A332_AAW.png new file mode 100644 index 000000000..f160ca137 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ABB.png b/plugins/channelrx/demodadsb/map/liveries/A332_ABB.png new file mode 100644 index 000000000..36b11c867 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ABB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ACI.png b/plugins/channelrx/demodadsb/map/liveries/A332_ACI.png new file mode 100644 index 000000000..0d548649b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ACI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AEA.png b/plugins/channelrx/demodadsb/map/liveries/A332_AEA.png new file mode 100644 index 000000000..c79322b8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A332_AFL.png new file mode 100644 index 000000000..2719d4de2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A332_AFR.png new file mode 100644 index 000000000..30ba1bd94 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A332_ALK.png new file mode 100644 index 000000000..4fbf0803d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ARG.png b/plugins/channelrx/demodadsb/map/liveries/A332_ARG.png new file mode 100644 index 000000000..52e0806fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ASL.png b/plugins/channelrx/demodadsb/map/liveries/A332_ASL.png new file mode 100644 index 000000000..f6fc35ab6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ASY.png b/plugins/channelrx/demodadsb/map/liveries/A332_ASY.png new file mode 100644 index 000000000..2134ad102 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ASY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A332_AUA.png new file mode 100644 index 000000000..a9ee282b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AVA.png b/plugins/channelrx/demodadsb/map/liveries/A332_AVA.png new file mode 100644 index 000000000..f07593fb1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AZA.png b/plugins/channelrx/demodadsb/map/liveries/A332_AZA.png new file mode 100644 index 000000000..824484707 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_AZU.png b/plugins/channelrx/demodadsb/map/liveries/A332_AZU.png new file mode 100644 index 000000000..8a3d9659e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BEC.png b/plugins/channelrx/demodadsb/map/liveries/A332_BEC.png new file mode 100644 index 000000000..6d9e9a869 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BEC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BEL.png b/plugins/channelrx/demodadsb/map/liveries/A332_BEL.png new file mode 100644 index 000000000..d027c3675 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BER.png b/plugins/channelrx/demodadsb/map/liveries/A332_BER.png new file mode 100644 index 000000000..e80a655fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A332_BHE.png new file mode 100644 index 000000000..a10fe57e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BMA.png b/plugins/channelrx/demodadsb/map/liveries/A332_BMA.png new file mode 100644 index 000000000..a1b212e16 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BOV.png b/plugins/channelrx/demodadsb/map/liveries/A332_BOV.png new file mode 100644 index 000000000..101699e2b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BRU.png b/plugins/channelrx/demodadsb/map/liveries/A332_BRU.png new file mode 100644 index 000000000..05881273e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A332_BVX.png new file mode 100644 index 000000000..cb85af092 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CAJ.png b/plugins/channelrx/demodadsb/map/liveries/A332_CAJ.png new file mode 100644 index 000000000..7fa1bd993 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CAJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A332_CBJ.png new file mode 100644 index 000000000..6e6f55b66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A332_CCA.png new file mode 100644 index 000000000..283479c5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CES.png b/plugins/channelrx/demodadsb/map/liveries/A332_CES.png new file mode 100644 index 000000000..cdc2c5bf3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CFG_B.png b/plugins/channelrx/demodadsb/map/liveries/A332_CFG_B.png new file mode 100644 index 000000000..5badfe80a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CFG_B.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CFG_G.png b/plugins/channelrx/demodadsb/map/liveries/A332_CFG_G.png new file mode 100644 index 000000000..d3d10d9b5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CFG_G.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CFG_S.png b/plugins/channelrx/demodadsb/map/liveries/A332_CFG_S.png new file mode 100644 index 000000000..369ee2ae9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CFG_S.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CHH.png b/plugins/channelrx/demodadsb/map/liveries/A332_CHH.png new file mode 100644 index 000000000..b13753fdc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CRL.png b/plugins/channelrx/demodadsb/map/liveries/A332_CRL.png new file mode 100644 index 000000000..c560b6138 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A332_CSC.png new file mode 100644 index 000000000..f3260f70a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A332_CSN.png new file mode 100644 index 000000000..4982d8001 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A332_CXA_VA.png new file mode 100644 index 000000000..38eda67d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_CYP.png b/plugins/channelrx/demodadsb/map/liveries/A332_CYP.png new file mode 100644 index 000000000..10ffc9428 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_CYP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_DAH.png b/plugins/channelrx/demodadsb/map/liveries/A332_DAH.png new file mode 100644 index 000000000..20d28dafe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_DAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A332_DAL.png new file mode 100644 index 000000000..d2b308a2d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_EDW.png b/plugins/channelrx/demodadsb/map/liveries/A332_EDW.png new file mode 100644 index 000000000..1ff443cc8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_EDW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_EEZ.png b/plugins/channelrx/demodadsb/map/liveries/A332_EEZ.png new file mode 100644 index 000000000..349ef2e7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_EEZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A332_EIN.png new file mode 100644 index 000000000..6c9e2778d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A332_ETD.png new file mode 100644 index 000000000..b440edaf4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_EVA.png b/plugins/channelrx/demodadsb/map/liveries/A332_EVA.png new file mode 100644 index 000000000..9a6753476 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_EXS.png b/plugins/channelrx/demodadsb/map/liveries/A332_EXS.png new file mode 100644 index 000000000..9133009e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_FJI.png b/plugins/channelrx/demodadsb/map/liveries/A332_FJI.png new file mode 100644 index 000000000..e49563745 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_FJI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_GBG.png b/plugins/channelrx/demodadsb/map/liveries/A332_GBG.png new file mode 100644 index 000000000..11f85283e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_GBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_GCR.png b/plugins/channelrx/demodadsb/map/liveries/A332_GCR.png new file mode 100644 index 000000000..335cdecb8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_GCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A332_GFA.png new file mode 100644 index 000000000..e6f277cd2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_GIA.png b/plugins/channelrx/demodadsb/map/liveries/A332_GIA.png new file mode 100644 index 000000000..f7c6dfb8a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_GRL.png b/plugins/channelrx/demodadsb/map/liveries/A332_GRL.png new file mode 100644 index 000000000..2a1f6fd5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_GRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_HAL.png b/plugins/channelrx/demodadsb/map/liveries/A332_HAL.png new file mode 100644 index 000000000..badabedac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_HAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A332_HAZ.png new file mode 100644 index 000000000..722544253 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_HST.png b/plugins/channelrx/demodadsb/map/liveries/A332_HST.png new file mode 100644 index 000000000..8c7327fcb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_HST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_IAW.png b/plugins/channelrx/demodadsb/map/liveries/A332_IAW.png new file mode 100644 index 000000000..fce129702 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A332_IBE.png new file mode 100644 index 000000000..7bc4f9086 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_IRA.png b/plugins/channelrx/demodadsb/map/liveries/A332_IRA.png new file mode 100644 index 000000000..56e254caa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_ITY.png b/plugins/channelrx/demodadsb/map/liveries/A332_ITY.png new file mode 100644 index 000000000..ade9852b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_ITY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_IWA.png b/plugins/channelrx/demodadsb/map/liveries/A332_IWA.png new file mode 100644 index 000000000..562a4560b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_IYE.png b/plugins/channelrx/demodadsb/map/liveries/A332_IYE.png new file mode 100644 index 000000000..9e255cb8f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_IYE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_JAI.png b/plugins/channelrx/demodadsb/map/liveries/A332_JAI.png new file mode 100644 index 000000000..a51f4664d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_JAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_JST.png b/plugins/channelrx/demodadsb/map/liveries/A332_JST.png new file mode 100644 index 000000000..bf62cac9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_JST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_KAC.png b/plugins/channelrx/demodadsb/map/liveries/A332_KAC.png new file mode 100644 index 000000000..e7933600d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_KAL.png b/plugins/channelrx/demodadsb/map/liveries/A332_KAL.png new file mode 100644 index 000000000..cb8bca591 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_KKK.png b/plugins/channelrx/demodadsb/map/liveries/A332_KKK.png new file mode 100644 index 000000000..b8247aa1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_KKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_KLM.png b/plugins/channelrx/demodadsb/map/liveries/A332_KLM.png new file mode 100644 index 000000000..515528ab0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_LAA.png b/plugins/channelrx/demodadsb/map/liveries/A332_LAA.png new file mode 100644 index 000000000..736193978 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_LAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A332_LHA_VA.png new file mode 100644 index 000000000..5adf9c254 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_LTU.png b/plugins/channelrx/demodadsb/map/liveries/A332_LTU.png new file mode 100644 index 000000000..0ead51438 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_LTU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_LVG.png b/plugins/channelrx/demodadsb/map/liveries/A332_LVG.png new file mode 100644 index 000000000..667109315 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_LVG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MAS.png b/plugins/channelrx/demodadsb/map/liveries/A332_MAS.png new file mode 100644 index 000000000..baad49067 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MAU.png b/plugins/channelrx/demodadsb/map/liveries/A332_MAU.png new file mode 100644 index 000000000..d27a78494 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MEA.png b/plugins/channelrx/demodadsb/map/liveries/A332_MEA.png new file mode 100644 index 000000000..a376ae854 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MON.png b/plugins/channelrx/demodadsb/map/liveries/A332_MON.png new file mode 100644 index 000000000..8329d122d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A332_MSR.png new file mode 100644 index 000000000..25c61284b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MXA.png b/plugins/channelrx/demodadsb/map/liveries/A332_MXA.png new file mode 100644 index 000000000..27aabf5bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_MYT.png b/plugins/channelrx/demodadsb/map/liveries/A332_MYT.png new file mode 100644 index 000000000..b47aeed05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_MYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_NWA.png b/plugins/channelrx/demodadsb/map/liveries/A332_NWA.png new file mode 100644 index 000000000..6c5e2b442 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_NWS.png b/plugins/channelrx/demodadsb/map/liveries/A332_NWS.png new file mode 100644 index 000000000..37dd432c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A332_OAL_VA.png new file mode 100644 index 000000000..f0831502e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_OAS.png b/plugins/channelrx/demodadsb/map/liveries/A332_OAS.png new file mode 100644 index 000000000..025845612 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_OAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_OCN.png b/plugins/channelrx/demodadsb/map/liveries/A332_OCN.png new file mode 100644 index 000000000..64f8c6216 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_OCN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_OMA.png b/plugins/channelrx/demodadsb/map/liveries/A332_OMA.png new file mode 100644 index 000000000..4168010c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_OMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_PLM.png b/plugins/channelrx/demodadsb/map/liveries/A332_PLM.png new file mode 100644 index 000000000..619490655 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_PLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_PUE.png b/plugins/channelrx/demodadsb/map/liveries/A332_PUE.png new file mode 100644 index 000000000..537f2d975 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_PUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_QFA.png b/plugins/channelrx/demodadsb/map/liveries/A332_QFA.png new file mode 100644 index 000000000..39b97e971 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A332_QTR.png new file mode 100644 index 000000000..e9808f98b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_RFR.png b/plugins/channelrx/demodadsb/map/liveries/A332_RFR.png new file mode 100644 index 000000000..2a267d9ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_RFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A332_RJA.png new file mode 100644 index 000000000..293c8be6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_RRR.png b/plugins/channelrx/demodadsb/map/liveries/A332_RRR.png new file mode 100644 index 000000000..d7b308358 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_RRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A332_SAA.png new file mode 100644 index 000000000..45e4cbb51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_SEP.png b/plugins/channelrx/demodadsb/map/liveries/A332_SEP.png new file mode 100644 index 000000000..100872b69 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_SEP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_SEY.png b/plugins/channelrx/demodadsb/map/liveries/A332_SEY.png new file mode 100644 index 000000000..cb6e9508b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_SEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_STW.png b/plugins/channelrx/demodadsb/map/liveries/A332_STW.png new file mode 100644 index 000000000..103b8c8dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_STW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_SWI.png b/plugins/channelrx/demodadsb/map/liveries/A332_SWI.png new file mode 100644 index 000000000..15c6d44dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A332_SWR.png new file mode 100644 index 000000000..c10a220ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TAH.png b/plugins/channelrx/demodadsb/map/liveries/A332_TAH.png new file mode 100644 index 000000000..0c4310aa6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A332_TAM.png new file mode 100644 index 000000000..e3a778987 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A332_TAP.png new file mode 100644 index 000000000..a603df7ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TCX.png b/plugins/channelrx/demodadsb/map/liveries/A332_TCX.png new file mode 100644 index 000000000..cbf43fa16 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TCX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_THY.png b/plugins/channelrx/demodadsb/map/liveries/A332_THY.png new file mode 100644 index 000000000..2e366bff3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A332_TKY.png new file mode 100644 index 000000000..ba6154e62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TSC.png b/plugins/channelrx/demodadsb/map/liveries/A332_TSC.png new file mode 100644 index 000000000..c967718cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_TSC_NC.png b/plugins/channelrx/demodadsb/map/liveries/A332_TSC_NC.png new file mode 100644 index 000000000..71b6eda36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_TSC_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_UAE.png b/plugins/channelrx/demodadsb/map/liveries/A332_UAE.png new file mode 100644 index 000000000..808fdbac3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_UK4_ZZ333.png b/plugins/channelrx/demodadsb/map/liveries/A332_UK4_ZZ333.png new file mode 100644 index 000000000..0040cc816 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_UK4_ZZ333.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_VKG.png b/plugins/channelrx/demodadsb/map/liveries/A332_VKG.png new file mode 100644 index 000000000..ea04721ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_VKG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_VLC.png b/plugins/channelrx/demodadsb/map/liveries/A332_VLC.png new file mode 100644 index 000000000..3911650a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_VOZ.png b/plugins/channelrx/demodadsb/map/liveries/A332_VOZ.png new file mode 100644 index 000000000..a5c79396b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_VOZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A332_WAT.png new file mode 100644 index 000000000..f1c142b25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A332_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A332_XSN.png new file mode 100644 index 000000000..7a74f211c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A332_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333.png b/plugins/channelrx/demodadsb/map/liveries/A333.png new file mode 100644 index 000000000..449e42a48 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333F.png b/plugins/channelrx/demodadsb/map/liveries/A333F.png new file mode 100644 index 000000000..9a6094081 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333F_ABR.png b/plugins/channelrx/demodadsb/map/liveries/A333F_ABR.png new file mode 100644 index 000000000..4e9a8b5ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333F_ABR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333F_AHK.png b/plugins/channelrx/demodadsb/map/liveries/A333F_AHK.png new file mode 100644 index 000000000..9f25aa9d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333F_AHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333F_BCS.png b/plugins/channelrx/demodadsb/map/liveries/A333F_BCS.png new file mode 100644 index 000000000..b5180a7b5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333F_BCS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333F_HAL.png b/plugins/channelrx/demodadsb/map/liveries/A333F_HAL.png new file mode 100644 index 000000000..494fe4e95 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333F_HAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AAL.png b/plugins/channelrx/demodadsb/map/liveries/A333_AAL.png new file mode 100644 index 000000000..c8db62518 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AAR.png b/plugins/channelrx/demodadsb/map/liveries/A333_AAR.png new file mode 100644 index 000000000..cd07e9edf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AAW.png b/plugins/channelrx/demodadsb/map/liveries/A333_AAW.png new file mode 100644 index 000000000..384df4a5d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_ABB.png b/plugins/channelrx/demodadsb/map/liveries/A333_ABB.png new file mode 100644 index 000000000..5b59998c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_ABB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_ACA.png b/plugins/channelrx/demodadsb/map/liveries/A333_ACA.png new file mode 100644 index 000000000..31061c57d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AEA.png b/plugins/channelrx/demodadsb/map/liveries/A333_AEA.png new file mode 100644 index 000000000..cd493879f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A333_AFL.png new file mode 100644 index 000000000..4b57a164a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A333_AFR.png new file mode 100644 index 000000000..d79230e2d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A333_ALK.png new file mode 100644 index 000000000..bea890227 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_AWE.png b/plugins/channelrx/demodadsb/map/liveries/A333_AWE.png new file mode 100644 index 000000000..79e6d9498 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_AWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_BAF.png b/plugins/channelrx/demodadsb/map/liveries/A333_BAF.png new file mode 100644 index 000000000..611c0a2c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_BAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_BBB.png b/plugins/channelrx/demodadsb/map/liveries/A333_BBB.png new file mode 100644 index 000000000..12fee6e94 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_BBB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_BEL.png b/plugins/channelrx/demodadsb/map/liveries/A333_BEL.png new file mode 100644 index 000000000..304c2693f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_BEL_NC.png b/plugins/channelrx/demodadsb/map/liveries/A333_BEL_NC.png new file mode 100644 index 000000000..e2dac06b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_BEL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_BER.png b/plugins/channelrx/demodadsb/map/liveries/A333_BER.png new file mode 100644 index 000000000..ae7d3a0bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_BTK.png b/plugins/channelrx/demodadsb/map/liveries/A333_BTK.png new file mode 100644 index 000000000..d4fddf28d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_BTK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CAI.png b/plugins/channelrx/demodadsb/map/liveries/A333_CAI.png new file mode 100644 index 000000000..4ec468e2e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CAJ.png b/plugins/channelrx/demodadsb/map/liveries/A333_CAJ.png new file mode 100644 index 000000000..b0fa40ebc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CAJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CAL.png b/plugins/channelrx/demodadsb/map/liveries/A333_CAL.png new file mode 100644 index 000000000..8818ba699 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CBJ.png b/plugins/channelrx/demodadsb/map/liveries/A333_CBJ.png new file mode 100644 index 000000000..8f1f732c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CBJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A333_CCA.png new file mode 100644 index 000000000..e753111cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CEB.png b/plugins/channelrx/demodadsb/map/liveries/A333_CEB.png new file mode 100644 index 000000000..ab5eeccac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CES.png b/plugins/channelrx/demodadsb/map/liveries/A333_CES.png new file mode 100644 index 000000000..92305d26e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CET.png b/plugins/channelrx/demodadsb/map/liveries/A333_CET.png new file mode 100644 index 000000000..f78d34d55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CFG.png b/plugins/channelrx/demodadsb/map/liveries/A333_CFG.png new file mode 100644 index 000000000..fa03c4105 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CFG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CHH.png b/plugins/channelrx/demodadsb/map/liveries/A333_CHH.png new file mode 100644 index 000000000..f1f9e8a7e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CPA.png b/plugins/channelrx/demodadsb/map/liveries/A333_CPA.png new file mode 100644 index 000000000..f8e2d6d29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CPL.png b/plugins/channelrx/demodadsb/map/liveries/A333_CPL.png new file mode 100644 index 000000000..69899bd32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CPL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CRK.png b/plugins/channelrx/demodadsb/map/liveries/A333_CRK.png new file mode 100644 index 000000000..d8cdd9c73 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CRK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CRL.png b/plugins/channelrx/demodadsb/map/liveries/A333_CRL.png new file mode 100644 index 000000000..c0454fc25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A333_CSC.png new file mode 100644 index 000000000..4300d36c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A333_CSN.png new file mode 100644 index 000000000..6ac369cc3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/A333_CSZ.png new file mode 100644 index 000000000..6fb64ee22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A333_CXA_VA.png new file mode 100644 index 000000000..06dda6926 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A333_DAL.png new file mode 100644 index 000000000..adcf96168 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A333_DLH.png new file mode 100644 index 000000000..a7e25f11e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/A333_DLH_OC.png new file mode 100644 index 000000000..b66dfb951 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EAG.png b/plugins/channelrx/demodadsb/map/liveries/A333_EAG.png new file mode 100644 index 000000000..8c6e100ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EDW.png b/plugins/channelrx/demodadsb/map/liveries/A333_EDW.png new file mode 100644 index 000000000..beaf79a90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EDW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EIN.png b/plugins/channelrx/demodadsb/map/liveries/A333_EIN.png new file mode 100644 index 000000000..b4740d40d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A333_ETD.png new file mode 100644 index 000000000..79b374f10 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EUK.png b/plugins/channelrx/demodadsb/map/liveries/A333_EUK.png new file mode 100644 index 000000000..b4740d40d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EVA.png b/plugins/channelrx/demodadsb/map/liveries/A333_EVA.png new file mode 100644 index 000000000..bda58d2a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EVE.png b/plugins/channelrx/demodadsb/map/liveries/A333_EVE.png new file mode 100644 index 000000000..a0e0eb171 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EVE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_EXS.png b/plugins/channelrx/demodadsb/map/liveries/A333_EXS.png new file mode 100644 index 000000000..774856a4e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_FIN.png b/plugins/channelrx/demodadsb/map/liveries/A333_FIN.png new file mode 100644 index 000000000..b999093b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_FJI.png b/plugins/channelrx/demodadsb/map/liveries/A333_FJI.png new file mode 100644 index 000000000..89aa8bb3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_FJI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_FWI.png b/plugins/channelrx/demodadsb/map/liveries/A333_FWI.png new file mode 100644 index 000000000..df3447d2e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_FWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_GCR.png b/plugins/channelrx/demodadsb/map/liveries/A333_GCR.png new file mode 100644 index 000000000..08cd97c15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_GCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_GIA.png b/plugins/channelrx/demodadsb/map/liveries/A333_GIA.png new file mode 100644 index 000000000..a74811b87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_HDA.png b/plugins/channelrx/demodadsb/map/liveries/A333_HDA.png new file mode 100644 index 000000000..13eaa61c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_HDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_HFM.png b/plugins/channelrx/demodadsb/map/liveries/A333_HFM.png new file mode 100644 index 000000000..bcd5435cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_HFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_HFY_POP.png b/plugins/channelrx/demodadsb/map/liveries/A333_HFY_POP.png new file mode 100644 index 000000000..01db1c4c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_HFY_POP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A333_IBE.png new file mode 100644 index 000000000..f88705982 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_IWD.png b/plugins/channelrx/demodadsb/map/liveries/A333_IWD.png new file mode 100644 index 000000000..ffe6ab6af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_IWD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_KAL.png b/plugins/channelrx/demodadsb/map/liveries/A333_KAL.png new file mode 100644 index 000000000..d9be92d0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_KLM.png b/plugins/channelrx/demodadsb/map/liveries/A333_KLM.png new file mode 100644 index 000000000..1f32f24d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_KNE.png b/plugins/channelrx/demodadsb/map/liveries/A333_KNE.png new file mode 100644 index 000000000..2e60f3966 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_KNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_LGS.png b/plugins/channelrx/demodadsb/map/liveries/A333_LGS.png new file mode 100644 index 000000000..53f8d4151 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_LGS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_LKE.png b/plugins/channelrx/demodadsb/map/liveries/A333_LKE.png new file mode 100644 index 000000000..e40945cb0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_LKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_LNI.png b/plugins/channelrx/demodadsb/map/liveries/A333_LNI.png new file mode 100644 index 000000000..7e0774e72 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_LNI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_LNR.png b/plugins/channelrx/demodadsb/map/liveries/A333_LNR.png new file mode 100644 index 000000000..d71d284c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_LTU.png b/plugins/channelrx/demodadsb/map/liveries/A333_LTU.png new file mode 100644 index 000000000..c367483ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_LTU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_MAS.png b/plugins/channelrx/demodadsb/map/liveries/A333_MAS.png new file mode 100644 index 000000000..d1c24971c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_MAU.png b/plugins/channelrx/demodadsb/map/liveries/A333_MAU.png new file mode 100644 index 000000000..16816be7f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A333_MSR.png new file mode 100644 index 000000000..c55929bd8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A333_NDF.png new file mode 100644 index 000000000..1b9c9dd15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A333_NTL.png new file mode 100644 index 000000000..80dcbe36b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_NWA.png b/plugins/channelrx/demodadsb/map/liveries/A333_NWA.png new file mode 100644 index 000000000..81e79a29b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_NWS.png b/plugins/channelrx/demodadsb/map/liveries/A333_NWS.png new file mode 100644 index 000000000..7a3d628d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A333_OAL_VA.png new file mode 100644 index 000000000..8be9f0d56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_OAS.png b/plugins/channelrx/demodadsb/map/liveries/A333_OAS.png new file mode 100644 index 000000000..be42cbfd4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_OAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_OCN.png b/plugins/channelrx/demodadsb/map/liveries/A333_OCN.png new file mode 100644 index 000000000..6a2e9159e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_OCN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_OCN_DISCOVER.png b/plugins/channelrx/demodadsb/map/liveries/A333_OCN_DISCOVER.png new file mode 100644 index 000000000..5cc0fc21c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_OCN_DISCOVER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_OMA.png b/plugins/channelrx/demodadsb/map/liveries/A333_OMA.png new file mode 100644 index 000000000..f979f1d3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_OMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A333_PAL.png new file mode 100644 index 000000000..4f547ea57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_PFF.png b/plugins/channelrx/demodadsb/map/liveries/A333_PFF.png new file mode 100644 index 000000000..90d7ad0b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_PLM.png b/plugins/channelrx/demodadsb/map/liveries/A333_PLM.png new file mode 100644 index 000000000..a7a274df3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_PLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_QFA.png b/plugins/channelrx/demodadsb/map/liveries/A333_QFA.png new file mode 100644 index 000000000..ac350335d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A333_QTR.png new file mode 100644 index 000000000..cf14185e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_RSY.png b/plugins/channelrx/demodadsb/map/liveries/A333_RSY.png new file mode 100644 index 000000000..e63665b9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_RSY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_RWD.png b/plugins/channelrx/demodadsb/map/liveries/A333_RWD.png new file mode 100644 index 000000000..6e8104600 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_RWD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A333_SAA.png new file mode 100644 index 000000000..c67feb520 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A333_SAS.png new file mode 100644 index 000000000..458c7f990 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SIA.png b/plugins/channelrx/demodadsb/map/liveries/A333_SIA.png new file mode 100644 index 000000000..72d04e577 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SSV.png b/plugins/channelrx/demodadsb/map/liveries/A333_SSV.png new file mode 100644 index 000000000..e7e4e59c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SSV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SVA.png b/plugins/channelrx/demodadsb/map/liveries/A333_SVA.png new file mode 100644 index 000000000..e601dc38b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A333_SWR.png new file mode 100644 index 000000000..c85700919 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_SZN.png b/plugins/channelrx/demodadsb/map/liveries/A333_SZN.png new file mode 100644 index 000000000..e1a8c434d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_SZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TAH.png b/plugins/channelrx/demodadsb/map/liveries/A333_TAH.png new file mode 100644 index 000000000..c46659152 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A333_TAP.png new file mode 100644 index 000000000..d86e6ca7d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TAX.png b/plugins/channelrx/demodadsb/map/liveries/A333_TAX.png new file mode 100644 index 000000000..7481fcfdb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TEF.png b/plugins/channelrx/demodadsb/map/liveries/A333_TEF.png new file mode 100644 index 000000000..d6598b473 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_THA.png b/plugins/channelrx/demodadsb/map/liveries/A333_THA.png new file mode 100644 index 000000000..c2b8aafc0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_THY.png b/plugins/channelrx/demodadsb/map/liveries/A333_THY.png new file mode 100644 index 000000000..89555518b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A333_TKY.png new file mode 100644 index 000000000..299962b24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TSC.png b/plugins/channelrx/demodadsb/map/liveries/A333_TSC.png new file mode 100644 index 000000000..142c5cdaa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TSC_NC.png b/plugins/channelrx/demodadsb/map/liveries/A333_TSC_NC.png new file mode 100644 index 000000000..3432afef4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TSC_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_TWB.png b/plugins/channelrx/demodadsb/map/liveries/A333_TWB.png new file mode 100644 index 000000000..74e787d68 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_TWB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_VIR.png b/plugins/channelrx/demodadsb/map/liveries/A333_VIR.png new file mode 100644 index 000000000..bd84470c3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_VKG.png b/plugins/channelrx/demodadsb/map/liveries/A333_VKG.png new file mode 100644 index 000000000..fdb3dde9e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_VKG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A333_WAT.png new file mode 100644 index 000000000..49f3636e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_WFL.png b/plugins/channelrx/demodadsb/map/liveries/A333_WFL.png new file mode 100644 index 000000000..7034afb70 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_WFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_XAX.png b/plugins/channelrx/demodadsb/map/liveries/A333_XAX.png new file mode 100644 index 000000000..eaab9d95d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_XAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A333_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A333_XSN.png new file mode 100644 index 000000000..c932a35c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A333_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A342_AUA.png new file mode 100644 index 000000000..66df4372e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_CTM.png b/plugins/channelrx/demodadsb/map/liveries/A342_CTM.png new file mode 100644 index 000000000..874535984 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_CTM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_EGY.png b/plugins/channelrx/demodadsb/map/liveries/A342_EGY.png new file mode 100644 index 000000000..996a66879 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_EGY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_MSR.png b/plugins/channelrx/demodadsb/map/liveries/A342_MSR.png new file mode 100644 index 000000000..b40abe8b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_QAF.png b/plugins/channelrx/demodadsb/map/liveries/A342_QAF.png new file mode 100644 index 000000000..c73bf3fa1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_QAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_RBA.png b/plugins/channelrx/demodadsb/map/liveries/A342_RBA.png new file mode 100644 index 000000000..aaf4dc175 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_RBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_RJA.png b/plugins/channelrx/demodadsb/map/liveries/A342_RJA.png new file mode 100644 index 000000000..ff831d0da Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A342_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A342_SAA.png new file mode 100644 index 000000000..db6fa2260 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A342_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343.png b/plugins/channelrx/demodadsb/map/liveries/A343.png new file mode 100644 index 000000000..7ad71b58a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_ABB.png b/plugins/channelrx/demodadsb/map/liveries/A343_ABB.png new file mode 100644 index 000000000..5f9e4e9c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_ABB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_ACA.png b/plugins/channelrx/demodadsb/map/liveries/A343_ACA.png new file mode 100644 index 000000000..f8d519e11 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A343_AFR.png new file mode 100644 index 000000000..eae7767a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_ALK.png b/plugins/channelrx/demodadsb/map/liveries/A343_ALK.png new file mode 100644 index 000000000..9d676041c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_ALK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_ARG.png b/plugins/channelrx/demodadsb/map/liveries/A343_ARG.png new file mode 100644 index 000000000..55f095420 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_AUA.png b/plugins/channelrx/demodadsb/map/liveries/A343_AUA.png new file mode 100644 index 000000000..314fda712 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_AXY.png b/plugins/channelrx/demodadsb/map/liveries/A343_AXY.png new file mode 100644 index 000000000..6f08d0f09 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_AXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_CAL.png b/plugins/channelrx/demodadsb/map/liveries/A343_CAL.png new file mode 100644 index 000000000..b95daf299 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A343_CCA.png new file mode 100644 index 000000000..093376038 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_CES.png b/plugins/channelrx/demodadsb/map/liveries/A343_CES.png new file mode 100644 index 000000000..7cc29e4d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_CPA.png b/plugins/channelrx/demodadsb/map/liveries/A343_CPA.png new file mode 100644 index 000000000..b6b44cff8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A343_DLH.png new file mode 100644 index 000000000..4562cc650 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_DLH_NC.png b/plugins/channelrx/demodadsb/map/liveries/A343_DLH_NC.png new file mode 100644 index 000000000..b80fcb13e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_DLH_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_EDW.png b/plugins/channelrx/demodadsb/map/liveries/A343_EDW.png new file mode 100644 index 000000000..1cd1843b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_EDW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A343_ETD.png new file mode 100644 index 000000000..e962e85df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_FIN.png b/plugins/channelrx/demodadsb/map/liveries/A343_FIN.png new file mode 100644 index 000000000..ef558f813 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_GFA.png b/plugins/channelrx/demodadsb/map/liveries/A343_GFA.png new file mode 100644 index 000000000..a3a763194 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_HFY.png b/plugins/channelrx/demodadsb/map/liveries/A343_HFY.png new file mode 100644 index 000000000..a2b922233 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_HFY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A343_IBE.png new file mode 100644 index 000000000..f5713e968 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_IRC.png b/plugins/channelrx/demodadsb/map/liveries/A343_IRC.png new file mode 100644 index 000000000..c79b82e65 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_IRC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_IRM.png b/plugins/channelrx/demodadsb/map/liveries/A343_IRM.png new file mode 100644 index 000000000..19b25582e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_IRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_KAC.png b/plugins/channelrx/demodadsb/map/liveries/A343_KAC.png new file mode 100644 index 000000000..52c249076 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_KMF.png b/plugins/channelrx/demodadsb/map/liveries/A343_KMF.png new file mode 100644 index 000000000..848a93ba8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_KMF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_LAN.png b/plugins/channelrx/demodadsb/map/liveries/A343_LAN.png new file mode 100644 index 000000000..8419b8a2b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_MAU.png b/plugins/channelrx/demodadsb/map/liveries/A343_MAU.png new file mode 100644 index 000000000..dc56ab52a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_MDG.png b/plugins/channelrx/demodadsb/map/liveries/A343_MDG.png new file mode 100644 index 000000000..d1b09d3fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_MDG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_NMB.png b/plugins/channelrx/demodadsb/map/liveries/A343_NMB.png new file mode 100644 index 000000000..7cb48b20b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_NMB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_OAL.png b/plugins/channelrx/demodadsb/map/liveries/A343_OAL.png new file mode 100644 index 000000000..4d04a3813 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_OAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A343_PAL.png new file mode 100644 index 000000000..839fa74b0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A343_SAA.png new file mode 100644 index 000000000..b5495d1f0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A343_SAS.png new file mode 100644 index 000000000..827bdafd4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_SIA.png b/plugins/channelrx/demodadsb/map/liveries/A343_SIA.png new file mode 100644 index 000000000..e5e33b1c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_SLM.png b/plugins/channelrx/demodadsb/map/liveries/A343_SLM.png new file mode 100644 index 000000000..ef2935ea3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_SLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_SWI.png b/plugins/channelrx/demodadsb/map/liveries/A343_SWI.png new file mode 100644 index 000000000..ee93c3f1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A343_SWR.png new file mode 100644 index 000000000..d6d2375c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_TAP.png b/plugins/channelrx/demodadsb/map/liveries/A343_TAP.png new file mode 100644 index 000000000..9f864f425 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_THT.png b/plugins/channelrx/demodadsb/map/liveries/A343_THT.png new file mode 100644 index 000000000..3a13c4153 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_THT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_THY.png b/plugins/channelrx/demodadsb/map/liveries/A343_THY.png new file mode 100644 index 000000000..67c6f349f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_UAE.png b/plugins/channelrx/demodadsb/map/liveries/A343_UAE.png new file mode 100644 index 000000000..82b51cc28 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_VCV.png b/plugins/channelrx/demodadsb/map/liveries/A343_VCV.png new file mode 100644 index 000000000..430f9e894 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_VCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_VIR.png b/plugins/channelrx/demodadsb/map/liveries/A343_VIR.png new file mode 100644 index 000000000..1c21dfec7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A343_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A343_WAT.png new file mode 100644 index 000000000..6a5a08be0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A343_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_AHY.png b/plugins/channelrx/demodadsb/map/liveries/A345_AHY.png new file mode 100644 index 000000000..5eeedc864 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_ARA.png b/plugins/channelrx/demodadsb/map/liveries/A345_ARA.png new file mode 100644 index 000000000..f15082e1a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_ARA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A345_ETD.png new file mode 100644 index 000000000..d06be4620 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_QAF.png b/plugins/channelrx/demodadsb/map/liveries/A345_QAF.png new file mode 100644 index 000000000..3e14d8684 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_QAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_SIA.png b/plugins/channelrx/demodadsb/map/liveries/A345_SIA.png new file mode 100644 index 000000000..85fb85879 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_TAM.png b/plugins/channelrx/demodadsb/map/liveries/A345_TAM.png new file mode 100644 index 000000000..d4f55e035 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A345_UAE.png b/plugins/channelrx/demodadsb/map/liveries/A345_UAE.png new file mode 100644 index 000000000..bfe13f136 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A345_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346.png b/plugins/channelrx/demodadsb/map/liveries/A346.png new file mode 100644 index 000000000..eee0e59f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_AHY.png b/plugins/channelrx/demodadsb/map/liveries/A346_AHY.png new file mode 100644 index 000000000..3fbadd6d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_CES.png b/plugins/channelrx/demodadsb/map/liveries/A346_CES.png new file mode 100644 index 000000000..5d6d33d32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_CHH.png b/plugins/channelrx/demodadsb/map/liveries/A346_CHH.png new file mode 100644 index 000000000..2cf78ac17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_CPA.png b/plugins/channelrx/demodadsb/map/liveries/A346_CPA.png new file mode 100644 index 000000000..3fabe01d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A346_DLH.png new file mode 100644 index 000000000..c603fac71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_DLH_NC.png b/plugins/channelrx/demodadsb/map/liveries/A346_DLH_NC.png new file mode 100644 index 000000000..35c6dd1c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_DLH_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/A346_DLH_OC.png new file mode 100644 index 000000000..410030d15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A346_ETD.png new file mode 100644 index 000000000..9f5d77b06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A346_IBE.png new file mode 100644 index 000000000..0346a590c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_IRM.png b/plugins/channelrx/demodadsb/map/liveries/A346_IRM.png new file mode 100644 index 000000000..542d24205 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_IRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_MSX.png b/plugins/channelrx/demodadsb/map/liveries/A346_MSX.png new file mode 100644 index 000000000..32b96281a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_MSX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A346_QTR.png new file mode 100644 index 000000000..21c63cb41 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_SAA.png b/plugins/channelrx/demodadsb/map/liveries/A346_SAA.png new file mode 100644 index 000000000..4c0098989 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_THA.png b/plugins/channelrx/demodadsb/map/liveries/A346_THA.png new file mode 100644 index 000000000..99033eaf8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_URO.png b/plugins/channelrx/demodadsb/map/liveries/A346_URO.png new file mode 100644 index 000000000..6f40b60af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_URO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_VCV.png b/plugins/channelrx/demodadsb/map/liveries/A346_VCV.png new file mode 100644 index 000000000..5718f8f60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_VCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_VIR.png b/plugins/channelrx/demodadsb/map/liveries/A346_VIR.png new file mode 100644 index 000000000..e1cd3a683 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_VLC.png b/plugins/channelrx/demodadsb/map/liveries/A346_VLC.png new file mode 100644 index 000000000..d1140443f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A346_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A346_WAT.png new file mode 100644 index 000000000..bdd369712 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A346_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359.png b/plugins/channelrx/demodadsb/map/liveries/A359.png new file mode 100644 index 000000000..12341469f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_AAR.png b/plugins/channelrx/demodadsb/map/liveries/A359_AAR.png new file mode 100644 index 000000000..c9ecec697 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_AFL.png b/plugins/channelrx/demodadsb/map/liveries/A359_AFL.png new file mode 100644 index 000000000..9170464f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A359_AFR.png new file mode 100644 index 000000000..1740de177 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_AFX.png b/plugins/channelrx/demodadsb/map/liveries/A359_AFX.png new file mode 100644 index 000000000..10c0de4e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_AIC.png b/plugins/channelrx/demodadsb/map/liveries/A359_AIC.png new file mode 100644 index 000000000..7c32c7260 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_AZU.png b/plugins/channelrx/demodadsb/map/liveries/A359_AZU.png new file mode 100644 index 000000000..48c2f60d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A359_BAW.png new file mode 100644 index 000000000..0e25421db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_BHE.png b/plugins/channelrx/demodadsb/map/liveries/A359_BHE.png new file mode 100644 index 000000000..184c9973b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_BVX.png b/plugins/channelrx/demodadsb/map/liveries/A359_BVX.png new file mode 100644 index 000000000..03eef0ff3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CAJ.png b/plugins/channelrx/demodadsb/map/liveries/A359_CAJ.png new file mode 100644 index 000000000..49ef94857 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CAJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CAL.png b/plugins/channelrx/demodadsb/map/liveries/A359_CAL.png new file mode 100644 index 000000000..fec13339d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CCA.png b/plugins/channelrx/demodadsb/map/liveries/A359_CCA.png new file mode 100644 index 000000000..19bf6738c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CES.png b/plugins/channelrx/demodadsb/map/liveries/A359_CES.png new file mode 100644 index 000000000..5f446c0bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CHH.png b/plugins/channelrx/demodadsb/map/liveries/A359_CHH.png new file mode 100644 index 000000000..af26b26d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CND.png b/plugins/channelrx/demodadsb/map/liveries/A359_CND.png new file mode 100644 index 000000000..8fdd8bb36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CND.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CPA.png b/plugins/channelrx/demodadsb/map/liveries/A359_CPA.png new file mode 100644 index 000000000..d66e7d810 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CRK.png b/plugins/channelrx/demodadsb/map/liveries/A359_CRK.png new file mode 100644 index 000000000..513f49d03 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CRK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CSC.png b/plugins/channelrx/demodadsb/map/liveries/A359_CSC.png new file mode 100644 index 000000000..44a15e7d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CSC_PANDA_B-306N.png b/plugins/channelrx/demodadsb/map/liveries/A359_CSC_PANDA_B-306N.png new file mode 100644 index 000000000..0f44635a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CSC_PANDA_B-306N.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A359_CSN.png new file mode 100644 index 000000000..8efe6a34b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_DAL.png b/plugins/channelrx/demodadsb/map/liveries/A359_DAL.png new file mode 100644 index 000000000..f262bf665 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A359_DLH.png new file mode 100644 index 000000000..515d22c00 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_EAG.png b/plugins/channelrx/demodadsb/map/liveries/A359_EAG.png new file mode 100644 index 000000000..0d9592d62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_EDW.png b/plugins/channelrx/demodadsb/map/liveries/A359_EDW.png new file mode 100644 index 000000000..2cb809d29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_EDW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A359_ETD.png new file mode 100644 index 000000000..7c668d8fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_ETH.png b/plugins/channelrx/demodadsb/map/liveries/A359_ETH.png new file mode 100644 index 000000000..45afba594 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_EUS.png b/plugins/channelrx/demodadsb/map/liveries/A359_EUS.png new file mode 100644 index 000000000..454f1292f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_EVE.png b/plugins/channelrx/demodadsb/map/liveries/A359_EVE.png new file mode 100644 index 000000000..e1de70976 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_EVE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FBU.png b/plugins/channelrx/demodadsb/map/liveries/A359_FBU.png new file mode 100644 index 000000000..1bc203a0d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FHA.png b/plugins/channelrx/demodadsb/map/liveries/A359_FHA.png new file mode 100644 index 000000000..2dea193c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FIN.png b/plugins/channelrx/demodadsb/map/liveries/A359_FIN.png new file mode 100644 index 000000000..43f39dcff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FJI.png b/plugins/channelrx/demodadsb/map/liveries/A359_FJI.png new file mode 100644 index 000000000..e78d642b0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FJI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FWC.png b/plugins/channelrx/demodadsb/map/liveries/A359_FWC.png new file mode 100644 index 000000000..be22d3111 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FWI.png b/plugins/channelrx/demodadsb/map/liveries/A359_FWI.png new file mode 100644 index 000000000..49ef94857 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_FYI.png b/plugins/channelrx/demodadsb/map/liveries/A359_FYI.png new file mode 100644 index 000000000..09355405f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_FYI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_GAF.png b/plugins/channelrx/demodadsb/map/liveries/A359_GAF.png new file mode 100644 index 000000000..4eb8cd280 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_GAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/A359_HAZ.png new file mode 100644 index 000000000..fb4f33674 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_HVN.png b/plugins/channelrx/demodadsb/map/liveries/A359_HVN.png new file mode 100644 index 000000000..fd7df0335 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_IBE.png b/plugins/channelrx/demodadsb/map/liveries/A359_IBE.png new file mode 100644 index 000000000..c8db8d083 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_ITY.png b/plugins/channelrx/demodadsb/map/liveries/A359_ITY.png new file mode 100644 index 000000000..9ef9c7987 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_ITY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_ITY_EI_IFD.png b/plugins/channelrx/demodadsb/map/liveries/A359_ITY_EI_IFD.png new file mode 100644 index 000000000..1e710699b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_ITY_EI_IFD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_IWA.png b/plugins/channelrx/demodadsb/map/liveries/A359_IWA.png new file mode 100644 index 000000000..5e9eb1613 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_JAL.png b/plugins/channelrx/demodadsb/map/liveries/A359_JAL.png new file mode 100644 index 000000000..9969279f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_KAL.png b/plugins/channelrx/demodadsb/map/liveries/A359_KAL.png new file mode 100644 index 000000000..57698afe9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/A359_LHA_VA.png new file mode 100644 index 000000000..8bb80f1ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_LNR.png b/plugins/channelrx/demodadsb/map/liveries/A359_LNR.png new file mode 100644 index 000000000..c1b75c6a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_MAS.png b/plugins/channelrx/demodadsb/map/liveries/A359_MAS.png new file mode 100644 index 000000000..da61d477e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_MAU.png b/plugins/channelrx/demodadsb/map/liveries/A359_MAU.png new file mode 100644 index 000000000..907ebb08d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_MQT.png b/plugins/channelrx/demodadsb/map/liveries/A359_MQT.png new file mode 100644 index 000000000..c942c7b31 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A359_NDF.png new file mode 100644 index 000000000..d69aa722f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_NTL.png b/plugins/channelrx/demodadsb/map/liveries/A359_NTL.png new file mode 100644 index 000000000..afe552f7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/A359_OAL_VA.png new file mode 100644 index 000000000..dae142a37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_PAL.png b/plugins/channelrx/demodadsb/map/liveries/A359_PAL.png new file mode 100644 index 000000000..f4ccfb743 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_PLX.png b/plugins/channelrx/demodadsb/map/liveries/A359_PLX.png new file mode 100644 index 000000000..7b86cc2db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A359_QTR.png new file mode 100644 index 000000000..3ea680139 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_QTR_OW.png b/plugins/channelrx/demodadsb/map/liveries/A359_QTR_OW.png new file mode 100644 index 000000000..1d9c169a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_QTR_OW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_SAS.png b/plugins/channelrx/demodadsb/map/liveries/A359_SAS.png new file mode 100644 index 000000000..c445f9223 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_SCO.png b/plugins/channelrx/demodadsb/map/liveries/A359_SCO.png new file mode 100644 index 000000000..454f1292f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_SIA.png b/plugins/channelrx/demodadsb/map/liveries/A359_SIA.png new file mode 100644 index 000000000..aca563452 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_SJX.png b/plugins/channelrx/demodadsb/map/liveries/A359_SJX.png new file mode 100644 index 000000000..281230b12 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_SJX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_SWR.png b/plugins/channelrx/demodadsb/map/liveries/A359_SWR.png new file mode 100644 index 000000000..c02aec8c5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_THA.png b/plugins/channelrx/demodadsb/map/liveries/A359_THA.png new file mode 100644 index 000000000..3ec3f0d48 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_THY.png b/plugins/channelrx/demodadsb/map/liveries/A359_THY.png new file mode 100644 index 000000000..6450fe9d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_TKY.png b/plugins/channelrx/demodadsb/map/liveries/A359_TKY.png new file mode 100644 index 000000000..ba6efeffa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_UAE.png b/plugins/channelrx/demodadsb/map/liveries/A359_UAE.png new file mode 100644 index 000000000..996308fb2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_UKV.png b/plugins/channelrx/demodadsb/map/liveries/A359_UKV.png new file mode 100644 index 000000000..35ab7c1f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_VIR_RED_VELVET.png b/plugins/channelrx/demodadsb/map/liveries/A359_VIR_RED_VELVET.png new file mode 100644 index 000000000..c5bb6965a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_VIR_RED_VELVET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_VSP.png b/plugins/channelrx/demodadsb/map/liveries/A359_VSP.png new file mode 100644 index 000000000..d05f76165 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A359_WAT.png new file mode 100644 index 000000000..8d2db5190 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_WFL.png b/plugins/channelrx/demodadsb/map/liveries/A359_WFL.png new file mode 100644 index 000000000..02aa4f39d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_WFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A359_XSN.png b/plugins/channelrx/demodadsb/map/liveries/A359_XSN.png new file mode 100644 index 000000000..a631d009e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A359_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388.png b/plugins/channelrx/demodadsb/map/liveries/A388.png new file mode 100644 index 000000000..9b71a1e44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_AAR.png b/plugins/channelrx/demodadsb/map/liveries/A388_AAR.png new file mode 100644 index 000000000..8b1e495c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_AFR.png b/plugins/channelrx/demodadsb/map/liveries/A388_AFR.png new file mode 100644 index 000000000..d902e0829 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_ANA_KAI.png b/plugins/channelrx/demodadsb/map/liveries/A388_ANA_KAI.png new file mode 100644 index 000000000..4a75c9e24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_ANA_KAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_ANA_LANI.png b/plugins/channelrx/demodadsb/map/liveries/A388_ANA_LANI.png new file mode 100644 index 000000000..d85d23ac1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_ANA_LANI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_BAW.png b/plugins/channelrx/demodadsb/map/liveries/A388_BAW.png new file mode 100644 index 000000000..e71a27a8f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_CSN.png b/plugins/channelrx/demodadsb/map/liveries/A388_CSN.png new file mode 100644 index 000000000..97405c98b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_DLH.png b/plugins/channelrx/demodadsb/map/liveries/A388_DLH.png new file mode 100644 index 000000000..5dcc9d278 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_DLH_NC.png b/plugins/channelrx/demodadsb/map/liveries/A388_DLH_NC.png new file mode 100644 index 000000000..0141b385e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_DLH_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/A388_DLH_OC.png new file mode 100644 index 000000000..ad991c467 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_EAG.png b/plugins/channelrx/demodadsb/map/liveries/A388_EAG.png new file mode 100644 index 000000000..7b00b6b40 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_ETD.png b/plugins/channelrx/demodadsb/map/liveries/A388_ETD.png new file mode 100644 index 000000000..36393c6ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_FWC.png b/plugins/channelrx/demodadsb/map/liveries/A388_FWC.png new file mode 100644 index 000000000..6b05c776e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_HFY.png b/plugins/channelrx/demodadsb/map/liveries/A388_HFY.png new file mode 100644 index 000000000..f999474eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_HFY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_KAL.png b/plugins/channelrx/demodadsb/map/liveries/A388_KAL.png new file mode 100644 index 000000000..3335bdd0b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_MAS.png b/plugins/channelrx/demodadsb/map/liveries/A388_MAS.png new file mode 100644 index 000000000..0e12e6bf6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_MQT.png b/plugins/channelrx/demodadsb/map/liveries/A388_MQT.png new file mode 100644 index 000000000..26121b4d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_NDF.png b/plugins/channelrx/demodadsb/map/liveries/A388_NDF.png new file mode 100644 index 000000000..1e2ba3817 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_QFA.png b/plugins/channelrx/demodadsb/map/liveries/A388_QFA.png new file mode 100644 index 000000000..32d1253b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_QTR.png b/plugins/channelrx/demodadsb/map/liveries/A388_QTR.png new file mode 100644 index 000000000..5a44b7ca2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_SCO_VA.png b/plugins/channelrx/demodadsb/map/liveries/A388_SCO_VA.png new file mode 100644 index 000000000..7a6ee5555 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_SCO_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_SIA.png b/plugins/channelrx/demodadsb/map/liveries/A388_SIA.png new file mode 100644 index 000000000..ef3ba7a2d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/A388_TEJ.png new file mode 100644 index 000000000..02b37cda0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_THA.png b/plugins/channelrx/demodadsb/map/liveries/A388_THA.png new file mode 100644 index 000000000..c68772db7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_UAE.png b/plugins/channelrx/demodadsb/map/liveries/A388_UAE.png new file mode 100644 index 000000000..8c86aac1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_UAE_JOURNEY.png b/plugins/channelrx/demodadsb/map/liveries/A388_UAE_JOURNEY.png new file mode 100644 index 000000000..6c0258247 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_UAE_JOURNEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_UAE_NC.png b/plugins/channelrx/demodadsb/map/liveries/A388_UAE_NC.png new file mode 100644 index 000000000..087f360c5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_UAE_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_UKV.png b/plugins/channelrx/demodadsb/map/liveries/A388_UKV.png new file mode 100644 index 000000000..d595656db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_VLC.png b/plugins/channelrx/demodadsb/map/liveries/A388_VLC.png new file mode 100644 index 000000000..c060c7ede Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/A388_WAT.png b/plugins/channelrx/demodadsb/map/liveries/A388_WAT.png new file mode 100644 index 000000000..6faa103e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/A388_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_BCI.png b/plugins/channelrx/demodadsb/map/liveries/AT42_BCI.png new file mode 100644 index 000000000..60459043a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_BCI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_CLG.png b/plugins/channelrx/demodadsb/map/liveries/AT42_CLG.png new file mode 100644 index 000000000..41d095d55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_CLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_CNF.png b/plugins/channelrx/demodadsb/map/liveries/AT42_CNF.png new file mode 100644 index 000000000..e1697526a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_CNF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_DHL.png b/plugins/channelrx/demodadsb/map/liveries/AT42_DHL.png new file mode 100644 index 000000000..46d1258e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_DHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_DTR.png b/plugins/channelrx/demodadsb/map/liveries/AT42_DTR.png new file mode 100644 index 000000000..b7caf7e34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_FDX.png b/plugins/channelrx/demodadsb/map/liveries/AT42_FDX.png new file mode 100644 index 000000000..814e4e9ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_HOP.png b/plugins/channelrx/demodadsb/map/liveries/AT42_HOP.png new file mode 100644 index 000000000..430697db1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_HOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_OAS.png b/plugins/channelrx/demodadsb/map/liveries/AT42_OAS.png new file mode 100644 index 000000000..929486952 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_OAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_PGA.png b/plugins/channelrx/demodadsb/map/liveries/AT42_PGA.png new file mode 100644 index 000000000..5ae8784b9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_PGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_REA.png b/plugins/channelrx/demodadsb/map/liveries/AT42_REA.png new file mode 100644 index 000000000..4d19297f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_REA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_SEH.png b/plugins/channelrx/demodadsb/map/liveries/AT42_SEH.png new file mode 100644 index 000000000..85050c546 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_SEH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT42_TYA.png b/plugins/channelrx/demodadsb/map/liveries/AT42_TYA.png new file mode 100644 index 000000000..eb72d8881 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT42_TYA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45.png b/plugins/channelrx/demodadsb/map/liveries/AT45.png new file mode 100644 index 000000000..70e3ccac5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_AKT.png b/plugins/channelrx/demodadsb/map/liveries/AT45_AKT.png new file mode 100644 index 000000000..2986a24d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_AKT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_ANT.png b/plugins/channelrx/demodadsb/map/liveries/AT45_ANT.png new file mode 100644 index 000000000..efde39356 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_ANT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_CLG.png b/plugins/channelrx/demodadsb/map/liveries/AT45_CLG.png new file mode 100644 index 000000000..513dbf482 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_CLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_CUB.png b/plugins/channelrx/demodadsb/map/liveries/AT45_CUB.png new file mode 100644 index 000000000..0fb88e9a7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_CUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_DTR.png b/plugins/channelrx/demodadsb/map/liveries/AT45_DTR.png new file mode 100644 index 000000000..cd4e81e76 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_EFY.png b/plugins/channelrx/demodadsb/map/liveries/AT45_EFY.png new file mode 100644 index 000000000..31c832e6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_EFY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_FJA.png b/plugins/channelrx/demodadsb/map/liveries/AT45_FJA.png new file mode 100644 index 000000000..5180ecea5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_FJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_GUY.png b/plugins/channelrx/demodadsb/map/liveries/AT45_GUY.png new file mode 100644 index 000000000..4a68c9836 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_GUY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_IWY.png b/plugins/channelrx/demodadsb/map/liveries/AT45_IWY.png new file mode 100644 index 000000000..51e87cee8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_IWY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_LOG.png b/plugins/channelrx/demodadsb/map/liveries/AT45_LOG.png new file mode 100644 index 000000000..a14fc5ec1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_LOG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_NSE.png b/plugins/channelrx/demodadsb/map/liveries/AT45_NSE.png new file mode 100644 index 000000000..00863a59d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_NSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_SSJ.png b/plugins/channelrx/demodadsb/map/liveries/AT45_SSJ.png new file mode 100644 index 000000000..f8c677d17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_SSJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_SWT.png b/plugins/channelrx/demodadsb/map/liveries/AT45_SWT.png new file mode 100644 index 000000000..a2f722429 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_SWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_TYA.png b/plugins/channelrx/demodadsb/map/liveries/AT45_TYA.png new file mode 100644 index 000000000..2eaa4813a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_TYA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_UTA.png b/plugins/channelrx/demodadsb/map/liveries/AT45_UTA.png new file mode 100644 index 000000000..531b946e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_VCV.png b/plugins/channelrx/demodadsb/map/liveries/AT45_VCV.png new file mode 100644 index 000000000..22e67bf9c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_VCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_WAT.png b/plugins/channelrx/demodadsb/map/liveries/AT45_WAT.png new file mode 100644 index 000000000..dd2d3979e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT45_WIA.png b/plugins/channelrx/demodadsb/map/liveries/AT45_WIA.png new file mode 100644 index 000000000..c5514b0c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT45_WIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46.png b/plugins/channelrx/demodadsb/map/liveries/AT46.png new file mode 100644 index 000000000..70e3ccac5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_BHS.png b/plugins/channelrx/demodadsb/map/liveries/AT46_BHS.png new file mode 100644 index 000000000..88c62fcc6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_BHS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_BVX.png b/plugins/channelrx/demodadsb/map/liveries/AT46_BVX.png new file mode 100644 index 000000000..d3be80ab3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_JAC.png b/plugins/channelrx/demodadsb/map/liveries/AT46_JAC.png new file mode 100644 index 000000000..5e2b58823 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_JAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_LIA.png b/plugins/channelrx/demodadsb/map/liveries/AT46_LIA.png new file mode 100644 index 000000000..5bde5378b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_LIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_LOG.png b/plugins/channelrx/demodadsb/map/liveries/AT46_LOG.png new file mode 100644 index 000000000..26db0c5e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_LOG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_NSE.png b/plugins/channelrx/demodadsb/map/liveries/AT46_NSE.png new file mode 100644 index 000000000..9ee9a4a08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_NSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_OAO.png b/plugins/channelrx/demodadsb/map/liveries/AT46_OAO.png new file mode 100644 index 000000000..dd8a73ce2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_OAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_SIL.png b/plugins/channelrx/demodadsb/map/liveries/AT46_SIL.png new file mode 100644 index 000000000..24a093ba6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_SIL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT46_UKV_HIGHLAND_CONNECT.png b/plugins/channelrx/demodadsb/map/liveries/AT46_UKV_HIGHLAND_CONNECT.png new file mode 100644 index 000000000..1424afbcc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT46_UKV_HIGHLAND_CONNECT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AIZ.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AIZ.png new file mode 100644 index 000000000..c934f105e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AIZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_ASL.png b/plugins/channelrx/demodadsb/map/liveries/AT72_ASL.png new file mode 100644 index 000000000..7c41a9c24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_ATR.png b/plugins/channelrx/demodadsb/map/liveries/AT72_ATR.png new file mode 100644 index 000000000..46992d811 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_ATR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AUR.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AUR.png new file mode 100644 index 000000000..6bb36e0bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AUR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AVN.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AVN.png new file mode 100644 index 000000000..7e2262360 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AWM.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AWM.png new file mode 100644 index 000000000..55def92e9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AWM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AZA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AZA.png new file mode 100644 index 000000000..2ff6bd6eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AZI.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AZI.png new file mode 100644 index 000000000..c81281bee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AZI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_AZU.png b/plugins/channelrx/demodadsb/map/liveries/AT72_AZU.png new file mode 100644 index 000000000..52e252a89 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_BHA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_BHA.png new file mode 100644 index 000000000..e228a3115 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_BHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_BKP.png b/plugins/channelrx/demodadsb/map/liveries/AT72_BKP.png new file mode 100644 index 000000000..7d1912d64 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_BKP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_BON.png b/plugins/channelrx/demodadsb/map/liveries/AT72_BON.png new file mode 100644 index 000000000..5d1bd8c67 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_BON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_BQB.png b/plugins/channelrx/demodadsb/map/liveries/AT72_BQB.png new file mode 100644 index 000000000..7f5142ac3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_BQB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_BRJ.png b/plugins/channelrx/demodadsb/map/liveries/AT72_BRJ.png new file mode 100644 index 000000000..027bc1ac6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_BRJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_BRX.png b/plugins/channelrx/demodadsb/map/liveries/AT72_BRX.png new file mode 100644 index 000000000..3f5d96310 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_BRX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_CCM.png b/plugins/channelrx/demodadsb/map/liveries/AT72_CCM.png new file mode 100644 index 000000000..8304afd04 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_CCM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_CNF.png b/plugins/channelrx/demodadsb/map/liveries/AT72_CNF.png new file mode 100644 index 000000000..68d64c5f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_CNF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_CSA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_CSA.png new file mode 100644 index 000000000..f24d79ecb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_CSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_DAH.png b/plugins/channelrx/demodadsb/map/liveries/AT72_DAH.png new file mode 100644 index 000000000..4f10989c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_DAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_DTR.png b/plugins/channelrx/demodadsb/map/liveries/AT72_DTR.png new file mode 100644 index 000000000..f78efc455 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_DWT.png b/plugins/channelrx/demodadsb/map/liveries/AT72_DWT.png new file mode 100644 index 000000000..5d8dcc389 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_DWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_EIN.png b/plugins/channelrx/demodadsb/map/liveries/AT72_EIN.png new file mode 100644 index 000000000..786b73bfb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_FCM.png b/plugins/channelrx/demodadsb/map/liveries/AT72_FCM.png new file mode 100644 index 000000000..2b12a7686 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_FCM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_FDX.png b/plugins/channelrx/demodadsb/map/liveries/AT72_FDX.png new file mode 100644 index 000000000..1518f5121 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_FFM.png b/plugins/channelrx/demodadsb/map/liveries/AT72_FFM.png new file mode 100644 index 000000000..a939005aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_FFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_FFV.png b/plugins/channelrx/demodadsb/map/liveries/AT72_FFV.png new file mode 100644 index 000000000..f58b81fba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_FFV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_FWI.png b/plugins/channelrx/demodadsb/map/liveries/AT72_FWI.png new file mode 100644 index 000000000..e0c221d83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_FWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_HOP.png b/plugins/channelrx/demodadsb/map/liveries/AT72_HOP.png new file mode 100644 index 000000000..b0b20de53 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_HOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_HVN.png b/plugins/channelrx/demodadsb/map/liveries/AT72_HVN.png new file mode 100644 index 000000000..b77a52ad7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_IBB.png b/plugins/channelrx/demodadsb/map/liveries/AT72_IBB.png new file mode 100644 index 000000000..c1990e103 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_IBB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_IRJ.png b/plugins/channelrx/demodadsb/map/liveries/AT72_IRJ.png new file mode 100644 index 000000000..731ccd0a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_IRJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_ISK.png b/plugins/channelrx/demodadsb/map/liveries/AT72_ISK.png new file mode 100644 index 000000000..8dd79f1cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_ISK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_ISR.png b/plugins/channelrx/demodadsb/map/liveries/AT72_ISR.png new file mode 100644 index 000000000..ca6cec7bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_ISR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_JAB.png b/plugins/channelrx/demodadsb/map/liveries/AT72_JAB.png new file mode 100644 index 000000000..5da327c93 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_JAB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_JAI.png b/plugins/channelrx/demodadsb/map/liveries/AT72_JAI.png new file mode 100644 index 000000000..f4f36309c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_JAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_LAO.png b/plugins/channelrx/demodadsb/map/liveries/AT72_LAO.png new file mode 100644 index 000000000..dceb6d482 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_LAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_MAU.png b/plugins/channelrx/demodadsb/map/liveries/AT72_MAU.png new file mode 100644 index 000000000..1b335cd5f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_MDG.png b/plugins/channelrx/demodadsb/map/liveries/AT72_MDG.png new file mode 100644 index 000000000..7e32120aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_MDG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_MMD.png b/plugins/channelrx/demodadsb/map/liveries/AT72_MMD.png new file mode 100644 index 000000000..cab92df76 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_MMD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_MSA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_MSA.png new file mode 100644 index 000000000..27b11656c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_MSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_MWG.png b/plugins/channelrx/demodadsb/map/liveries/AT72_MWG.png new file mode 100644 index 000000000..2c0aecdfd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_MWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_NAX.png b/plugins/channelrx/demodadsb/map/liveries/AT72_NAX.png new file mode 100644 index 000000000..7b5c5781b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_NAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_NOK.png b/plugins/channelrx/demodadsb/map/liveries/AT72_NOK.png new file mode 100644 index 000000000..f38b1f6d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_NOK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_NZM.png b/plugins/channelrx/demodadsb/map/liveries/AT72_NZM.png new file mode 100644 index 000000000..07da56089 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_NZM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_OZW.png b/plugins/channelrx/demodadsb/map/liveries/AT72_OZW.png new file mode 100644 index 000000000..da64066e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_OZW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_PAS.png b/plugins/channelrx/demodadsb/map/liveries/AT72_PAS.png new file mode 100644 index 000000000..83dc0eae5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_PAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_PBT.png b/plugins/channelrx/demodadsb/map/liveries/AT72_PBT.png new file mode 100644 index 000000000..578abb959 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_PBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_PIA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_PIA.png new file mode 100644 index 000000000..da8314760 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_PRF.png b/plugins/channelrx/demodadsb/map/liveries/AT72_PRF.png new file mode 100644 index 000000000..5c44a6a85 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_PRF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_RAM.png b/plugins/channelrx/demodadsb/map/liveries/AT72_RAM.png new file mode 100644 index 000000000..5388e0281 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_REA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_REA.png new file mode 100644 index 000000000..d6590c5eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_REA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_REU.png b/plugins/channelrx/demodadsb/map/liveries/AT72_REU.png new file mode 100644 index 000000000..5dc9377ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_REU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_ROT.png b/plugins/channelrx/demodadsb/map/liveries/AT72_ROT.png new file mode 100644 index 000000000..f17d2fef0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_ROT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_SAS.png b/plugins/channelrx/demodadsb/map/liveries/AT72_SAS.png new file mode 100644 index 000000000..e72748146 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_STK.png b/plugins/channelrx/demodadsb/map/liveries/AT72_STK.png new file mode 100644 index 000000000..0f0810051 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_STK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_SWT.png b/plugins/channelrx/demodadsb/map/liveries/AT72_SWT.png new file mode 100644 index 000000000..e12617328 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_SWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_SYR.png b/plugins/channelrx/demodadsb/map/liveries/AT72_SYR.png new file mode 100644 index 000000000..f3898fa74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_SYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_TCV.png b/plugins/channelrx/demodadsb/map/liveries/AT72_TCV.png new file mode 100644 index 000000000..b48533256 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_TCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_TPC.png b/plugins/channelrx/demodadsb/map/liveries/AT72_TPC.png new file mode 100644 index 000000000..05aa73d16 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_TPC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_TUX.png b/plugins/channelrx/demodadsb/map/liveries/AT72_TUX.png new file mode 100644 index 000000000..d897af3f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_TUX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_UTA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_UTA.png new file mode 100644 index 000000000..c27804b5d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_UTN.png b/plugins/channelrx/demodadsb/map/liveries/AT72_UTN.png new file mode 100644 index 000000000..63897ebad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_UTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_VTA.png b/plugins/channelrx/demodadsb/map/liveries/AT72_VTA.png new file mode 100644 index 000000000..391fae46a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_VTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT72_WON.png b/plugins/channelrx/demodadsb/map/liveries/AT72_WON.png new file mode 100644 index 000000000..87071d42a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT72_WON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75.png b/plugins/channelrx/demodadsb/map/liveries/AT75.png new file mode 100644 index 000000000..a365896c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F.png b/plugins/channelrx/demodadsb/map/liveries/AT75F.png new file mode 100644 index 000000000..af8acaa00 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_ABR.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_ABR.png new file mode 100644 index 000000000..26e302c22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_ABR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_ABV.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_ABV.png new file mode 100644 index 000000000..49a82458a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_ABV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_AZD.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_AZD.png new file mode 100644 index 000000000..17332627e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_AZD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_CFS.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_CFS.png new file mode 100644 index 000000000..599c95a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_CFS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_IMX.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_IMX.png new file mode 100644 index 000000000..17332627e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_IMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_MAL.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_MAL.png new file mode 100644 index 000000000..599c95a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_MAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_MTL.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_MTL.png new file mode 100644 index 000000000..9a3945651 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_MTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_MTN.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_MTN.png new file mode 100644 index 000000000..599c95a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_MTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_NFC.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_NFC.png new file mode 100644 index 000000000..0bc4d2fbc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_NFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_NPT.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_NPT.png new file mode 100644 index 000000000..1fb48f6bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_NPT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_PLC.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_PLC.png new file mode 100644 index 000000000..0d3e854b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_SRN.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_SRN.png new file mode 100644 index 000000000..88f89794f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_SRN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_SWT.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_SWT.png new file mode 100644 index 000000000..ad6751910 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_SWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_TSU.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_TSU.png new file mode 100644 index 000000000..599c95a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_TSU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75F_XSC.png b/plugins/channelrx/demodadsb/map/liveries/AT75F_XSC.png new file mode 100644 index 000000000..e9102157d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75F_XSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_ABR.png b/plugins/channelrx/demodadsb/map/liveries/AT75_ABR.png new file mode 100644 index 000000000..49a82458a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_ABR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_AEA.png b/plugins/channelrx/demodadsb/map/liveries/AT75_AEA.png new file mode 100644 index 000000000..104aec84f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_ASL.png b/plugins/channelrx/demodadsb/map/liveries/AT75_ASL.png new file mode 100644 index 000000000..abb517328 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_BCI.png b/plugins/channelrx/demodadsb/map/liveries/AT75_BCI.png new file mode 100644 index 000000000..24d0c9ce1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_BCI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_BHA.png b/plugins/channelrx/demodadsb/map/liveries/AT75_BHA.png new file mode 100644 index 000000000..4cce2fa5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_BHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_BVT.png b/plugins/channelrx/demodadsb/map/liveries/AT75_BVT.png new file mode 100644 index 000000000..569cef5fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_BVT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_CAV.png b/plugins/channelrx/demodadsb/map/liveries/AT75_CAV.png new file mode 100644 index 000000000..b4ff3e366 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_CAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_CCM.png b/plugins/channelrx/demodadsb/map/liveries/AT75_CCM.png new file mode 100644 index 000000000..9696164ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_CCM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_CNF.png b/plugins/channelrx/demodadsb/map/liveries/AT75_CNF.png new file mode 100644 index 000000000..b67862cc2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_CNF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_CNF_WHITE.png b/plugins/channelrx/demodadsb/map/liveries/AT75_CNF_WHITE.png new file mode 100644 index 000000000..d26b6f812 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_CNF_WHITE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/AT75_CXA_VA.png new file mode 100644 index 000000000..2eb36a75d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_DAH.png b/plugins/channelrx/demodadsb/map/liveries/AT75_DAH.png new file mode 100644 index 000000000..af3662042 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_DAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_DTR.png b/plugins/channelrx/demodadsb/map/liveries/AT75_DTR.png new file mode 100644 index 000000000..d3fc3fb94 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_EUS.png b/plugins/channelrx/demodadsb/map/liveries/AT75_EUS.png new file mode 100644 index 000000000..73247f468 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_FFM.png b/plugins/channelrx/demodadsb/map/liveries/AT75_FFM.png new file mode 100644 index 000000000..a71a1a866 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_FFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_FIN.png b/plugins/channelrx/demodadsb/map/liveries/AT75_FIN.png new file mode 100644 index 000000000..bd67e9250 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_IBB.png b/plugins/channelrx/demodadsb/map/liveries/AT75_IBB.png new file mode 100644 index 000000000..aa4ea9967 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_IBB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_LAO.png b/plugins/channelrx/demodadsb/map/liveries/AT75_LAO.png new file mode 100644 index 000000000..c25c70bbf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_LAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/AT75_LHA_VA.png new file mode 100644 index 000000000..3814b75fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_MAU.png b/plugins/channelrx/demodadsb/map/liveries/AT75_MAU.png new file mode 100644 index 000000000..8d16f6ff8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_MAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_MMD.png b/plugins/channelrx/demodadsb/map/liveries/AT75_MMD.png new file mode 100644 index 000000000..5bfc82a7f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_MMD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_MWG.png b/plugins/channelrx/demodadsb/map/liveries/AT75_MWG.png new file mode 100644 index 000000000..3d37830a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_MWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_NVQ.png b/plugins/channelrx/demodadsb/map/liveries/AT75_NVQ.png new file mode 100644 index 000000000..d648a1895 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_NVQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_NYT.png b/plugins/channelrx/demodadsb/map/liveries/AT75_NYT.png new file mode 100644 index 000000000..9a8376737 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_NYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_OAL.png b/plugins/channelrx/demodadsb/map/liveries/AT75_OAL.png new file mode 100644 index 000000000..17ea70d62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_OAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_OAO.png b/plugins/channelrx/demodadsb/map/liveries/AT75_OAO.png new file mode 100644 index 000000000..29bc3b04c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_OAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_OVA.png b/plugins/channelrx/demodadsb/map/liveries/AT75_OVA.png new file mode 100644 index 000000000..4f31a980b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_OVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_PTB.png b/plugins/channelrx/demodadsb/map/liveries/AT75_PTB.png new file mode 100644 index 000000000..b649aa577 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_PTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_ROT.png b/plugins/channelrx/demodadsb/map/liveries/AT75_ROT.png new file mode 100644 index 000000000..8385801c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_ROT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_SCO.png b/plugins/channelrx/demodadsb/map/liveries/AT75_SCO.png new file mode 100644 index 000000000..73247f468 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_SEH.png b/plugins/channelrx/demodadsb/map/liveries/AT75_SEH.png new file mode 100644 index 000000000..6e2aec088 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_SEH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_SSJ.png b/plugins/channelrx/demodadsb/map/liveries/AT75_SSJ.png new file mode 100644 index 000000000..ef6c2e094 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_SSJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_UKV.png b/plugins/channelrx/demodadsb/map/liveries/AT75_UKV.png new file mode 100644 index 000000000..066bd1364 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_UTA.png b/plugins/channelrx/demodadsb/map/liveries/AT75_UTA.png new file mode 100644 index 000000000..ac54af01b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_VFC.png b/plugins/channelrx/demodadsb/map/liveries/AT75_VFC.png new file mode 100644 index 000000000..5da4d0031 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_VFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_WAT.png b/plugins/channelrx/demodadsb/map/liveries/AT75_WAT.png new file mode 100644 index 000000000..fa7d07cb9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT75_XSN.png b/plugins/channelrx/demodadsb/map/liveries/AT75_XSN.png new file mode 100644 index 000000000..e43aa9cbf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT75_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76.png b/plugins/channelrx/demodadsb/map/liveries/AT76.png new file mode 100644 index 000000000..a365896c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_ABV.png b/plugins/channelrx/demodadsb/map/liveries/AT76_ABV.png new file mode 100644 index 000000000..178807acd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_ABV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AEA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AEA.png new file mode 100644 index 000000000..22cafb4d7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AEE.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AEE.png new file mode 100644 index 000000000..c59542603 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AEZ.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AEZ.png new file mode 100644 index 000000000..c10d15908 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AEZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_ANE.png b/plugins/channelrx/demodadsb/map/liveries/AT76_ANE.png new file mode 100644 index 000000000..d6874e39e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_ANE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/AT76_ANZ.png new file mode 100644 index 000000000..e72cd5b78 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_ASL.png b/plugins/channelrx/demodadsb/map/liveries/AT76_ASL.png new file mode 100644 index 000000000..178807acd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_ATX.png b/plugins/channelrx/demodadsb/map/liveries/AT76_ATX.png new file mode 100644 index 000000000..4d4b14241 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_ATX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AUR.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AUR.png new file mode 100644 index 000000000..0ee8066fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AUR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AUR_N.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AUR_N.png new file mode 100644 index 000000000..e455c25c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AUR_N.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AVN.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AVN.png new file mode 100644 index 000000000..5ad8e4bd5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_AZU.png b/plugins/channelrx/demodadsb/map/liveries/AT76_AZU.png new file mode 100644 index 000000000..776a20283 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_AZU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BCV.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BCV.png new file mode 100644 index 000000000..10b83ac80 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BHS.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BHS.png new file mode 100644 index 000000000..89504a5b0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BHS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BKP.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BKP.png new file mode 100644 index 000000000..656eb0c9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BKP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BOT.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BOT.png new file mode 100644 index 000000000..e0e66a66f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BRX.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BRX.png new file mode 100644 index 000000000..55aa2b678 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BRX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BVX.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BVX.png new file mode 100644 index 000000000..c5f8d19a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_BWA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_BWA.png new file mode 100644 index 000000000..8b890227e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_BWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_CCM.png b/plugins/channelrx/demodadsb/map/liveries/AT76_CCM.png new file mode 100644 index 000000000..0408a3c9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_CCM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_CEB.png b/plugins/channelrx/demodadsb/map/liveries/AT76_CEB.png new file mode 100644 index 000000000..8a6172aeb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_CEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_CTV.png b/plugins/channelrx/demodadsb/map/liveries/AT76_CTV.png new file mode 100644 index 000000000..4a64b37c3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_CTV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_CVA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_CVA.png new file mode 100644 index 000000000..0ff05ed17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_CVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_DAH.png b/plugins/channelrx/demodadsb/map/liveries/AT76_DAH.png new file mode 100644 index 000000000..679f5af6c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_DAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_DTR.png b/plugins/channelrx/demodadsb/map/liveries/AT76_DTR.png new file mode 100644 index 000000000..029ccacdc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EAG.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EAG.png new file mode 100644 index 000000000..13b21b364 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EAI.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EAI.png new file mode 100644 index 000000000..f928eaa49 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EFY.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EFY.png new file mode 100644 index 000000000..0f8d109d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EFY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EFY_DONHENRY.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EFY_DONHENRY.png new file mode 100644 index 000000000..d22107ce8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EFY_DONHENRY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EIN.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EIN.png new file mode 100644 index 000000000..f928eaa49 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EWA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EWA.png new file mode 100644 index 000000000..c19c9e35b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_EZE.png b/plugins/channelrx/demodadsb/map/liveries/AT76_EZE.png new file mode 100644 index 000000000..3d02aec70 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_EZE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_FBV.png b/plugins/channelrx/demodadsb/map/liveries/AT76_FBV.png new file mode 100644 index 000000000..d096707ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_FJA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_FJA.png new file mode 100644 index 000000000..166116f8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_FJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_FWI.png b/plugins/channelrx/demodadsb/map/liveries/AT76_FWI.png new file mode 100644 index 000000000..e0733e33e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_FWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_FYI.png b/plugins/channelrx/demodadsb/map/liveries/AT76_FYI.png new file mode 100644 index 000000000..8cbc067fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_FYI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_GUY.png b/plugins/channelrx/demodadsb/map/liveries/AT76_GUY.png new file mode 100644 index 000000000..a4a81b1bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_GUY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_GWG.png b/plugins/channelrx/demodadsb/map/liveries/AT76_GWG.png new file mode 100644 index 000000000..d0a42bbe1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_GWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_HFA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_HFA.png new file mode 100644 index 000000000..9855839bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_HFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_IBB.png b/plugins/channelrx/demodadsb/map/liveries/AT76_IBB.png new file mode 100644 index 000000000..4c4a274ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_IBB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_IGO.png b/plugins/channelrx/demodadsb/map/liveries/AT76_IGO.png new file mode 100644 index 000000000..3e50b665d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_IGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_IRA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_IRA.png new file mode 100644 index 000000000..025ff2146 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_JAC.png b/plugins/channelrx/demodadsb/map/liveries/AT76_JAC.png new file mode 100644 index 000000000..c9a42ed8f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_JAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_LAO.png b/plugins/channelrx/demodadsb/map/liveries/AT76_LAO.png new file mode 100644 index 000000000..058a48079 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_LAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_LHA_VA.png new file mode 100644 index 000000000..3814b75fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_LLR.png b/plugins/channelrx/demodadsb/map/liveries/AT76_LLR.png new file mode 100644 index 000000000..bb8991a61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_LLR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_LOG.png b/plugins/channelrx/demodadsb/map/liveries/AT76_LOG.png new file mode 100644 index 000000000..ff2b4e26a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_LOG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_MAV.png b/plugins/channelrx/demodadsb/map/liveries/AT76_MAV.png new file mode 100644 index 000000000..861676053 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_MAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_MDA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_MDA.png new file mode 100644 index 000000000..2c05566bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_MDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_MDO.png b/plugins/channelrx/demodadsb/map/liveries/AT76_MDO.png new file mode 100644 index 000000000..d6874e39e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_MDO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_MSC.png b/plugins/channelrx/demodadsb/map/liveries/AT76_MSC.png new file mode 100644 index 000000000..e47d15be9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_MSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_MXD.png b/plugins/channelrx/demodadsb/map/liveries/AT76_MXD.png new file mode 100644 index 000000000..43c78963a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_MXD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_OAL.png b/plugins/channelrx/demodadsb/map/liveries/AT76_OAL.png new file mode 100644 index 000000000..95b6b0dd8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_OAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_PFF.png b/plugins/channelrx/demodadsb/map/liveries/AT76_PFF.png new file mode 100644 index 000000000..7137e1db8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_PTB.png b/plugins/channelrx/demodadsb/map/liveries/AT76_PTB.png new file mode 100644 index 000000000..fdedcf5ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_PTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_RAM.png b/plugins/channelrx/demodadsb/map/liveries/AT76_RAM.png new file mode 100644 index 000000000..0bb4ef44f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_ROT.png b/plugins/channelrx/demodadsb/map/liveries/AT76_ROT.png new file mode 100644 index 000000000..419738e9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_ROT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_RSC.png b/plugins/channelrx/demodadsb/map/liveries/AT76_RSC.png new file mode 100644 index 000000000..4c4a274ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_RSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_RXP.png b/plugins/channelrx/demodadsb/map/liveries/AT76_RXP.png new file mode 100644 index 000000000..0bb4ef44f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_RXP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_SAS.png b/plugins/channelrx/demodadsb/map/liveries/AT76_SAS.png new file mode 100644 index 000000000..0568eeb9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_SEH.png b/plugins/channelrx/demodadsb/map/liveries/AT76_SEH.png new file mode 100644 index 000000000..a14253706 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_SEH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_SIL.png b/plugins/channelrx/demodadsb/map/liveries/AT76_SIL.png new file mode 100644 index 000000000..59bff67e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_SIL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_SRQ.png b/plugins/channelrx/demodadsb/map/liveries/AT76_SRQ.png new file mode 100644 index 000000000..8a6172aeb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_SRQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_SZN.png b/plugins/channelrx/demodadsb/map/liveries/AT76_SZN.png new file mode 100644 index 000000000..ce698ce81 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_SZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_TAP.png b/plugins/channelrx/demodadsb/map/liveries/AT76_TAP.png new file mode 100644 index 000000000..95551264d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_TOK.png b/plugins/channelrx/demodadsb/map/liveries/AT76_TOK.png new file mode 100644 index 000000000..6d1350588 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_TOK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_TUX.png b/plugins/channelrx/demodadsb/map/liveries/AT76_TUX.png new file mode 100644 index 000000000..622487bbf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_TUX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_UBA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_UBA.png new file mode 100644 index 000000000..1fd3081af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_UBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_UBG.png b/plugins/channelrx/demodadsb/map/liveries/AT76_UBG.png new file mode 100644 index 000000000..11e4e2f4c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_UBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_UIA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_UIA.png new file mode 100644 index 000000000..a3c86b2ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_UIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_UKV.png b/plugins/channelrx/demodadsb/map/liveries/AT76_UKV.png new file mode 100644 index 000000000..066bd1364 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_UTA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_UTA.png new file mode 100644 index 000000000..54c5666d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_VTA.png b/plugins/channelrx/demodadsb/map/liveries/AT76_VTA.png new file mode 100644 index 000000000..b5c077200 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_VTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_WAT.png b/plugins/channelrx/demodadsb/map/liveries/AT76_WAT.png new file mode 100644 index 000000000..220c6f907 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/AT76_WON.png b/plugins/channelrx/demodadsb/map/liveries/AT76_WON.png new file mode 100644 index 000000000..5af57e1d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/AT76_WON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B.png new file mode 100644 index 000000000..12676b4d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_ACN.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_ACN.png new file mode 100644 index 000000000..74d48f6fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_ACN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_AZY.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_AZY.png new file mode 100644 index 000000000..5dee68bd0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_AZY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_BRG.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_BRG.png new file mode 100644 index 000000000..c83fab8c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_BRG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_BVN.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_BVN.png new file mode 100644 index 000000000..d554240df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_BVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_CFS.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_CFS.png new file mode 100644 index 000000000..d554240df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_CFS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_CTP.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_CTP.png new file mode 100644 index 000000000..d554240df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_CTP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_FDX.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_FDX.png new file mode 100644 index 000000000..d554240df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_FDY.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_FDY.png new file mode 100644 index 000000000..0919d91f0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_FDY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_GBA.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_GBA.png new file mode 100644 index 000000000..d62e30ceb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_GBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_HND.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_HND.png new file mode 100644 index 000000000..ed03bc3d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_HND.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_IRO.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_IRO.png new file mode 100644 index 000000000..d554240df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_IRO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_LRI.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_LRI.png new file mode 100644 index 000000000..12ed42c57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_LRI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_LRS.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_LRS.png new file mode 100644 index 000000000..ed03bc3d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_LRS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_MAL.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_MAL.png new file mode 100644 index 000000000..6a690bcd9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_MAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_MTN.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_MTN.png new file mode 100644 index 000000000..d554240df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_MTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_SDA.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_SDA.png new file mode 100644 index 000000000..413249cf2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_SDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_SUB.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_SUB.png new file mode 100644 index 000000000..bf932ae78 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_SUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_TGY.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_TGY.png new file mode 100644 index 000000000..55bbf248e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_TGY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_UKV.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_UKV.png new file mode 100644 index 000000000..e683c879f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_WMA.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_WMA.png new file mode 100644 index 000000000..f78980614 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_208B_WMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_B350.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_B350.png new file mode 100644 index 000000000..52db8fda5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_B350.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_C152.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_C152.png new file mode 100644 index 000000000..51544f33b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_C152.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_C172SP.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_C172SP.png new file mode 100644 index 000000000..35046f40c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_C172SP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C.png new file mode 100644 index 000000000..8c308324c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C_M-MIKE.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C_M-MIKE.png new file mode 100644 index 000000000..008e3fbeb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C_M-MIKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C_PS-CSF.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C_PS-CSF.png new file mode 100644 index 000000000..28ffdc88e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_C25C_PS-CSF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_DA40_NG.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA40_NG.png new file mode 100644 index 000000000..628ea6780 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA40_NG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62.png new file mode 100644 index 000000000..fd3f4c4cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62_BLUE.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62_BLUE.png new file mode 100644 index 000000000..d1c36516b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62_BLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62_GOLD.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62_GOLD.png new file mode 100644 index 000000000..5d9555358 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_DA62_GOLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_DR400.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_DR400.png new file mode 100644 index 000000000..1e719d369 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_DR400.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930.png new file mode 100644 index 000000000..a08f1dadc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930_N960DH.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930_N960DH.png new file mode 100644 index 000000000..77134fa90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930_N960DH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930_N960VM.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930_N960VM.png new file mode 100644 index 000000000..5d7c77ce9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_TBM930_N960VM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Asobo_VL3.png b/plugins/channelrx/demodadsb/map/liveries/Asobo_VL3.png new file mode 100644 index 000000000..283da1137 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Asobo_VL3.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B06_C-GZPM.png b/plugins/channelrx/demodadsb/map/liveries/B06_C-GZPM.png new file mode 100644 index 000000000..75a7a8499 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B06_C-GZPM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B06_DE6_OE-BXA.png b/plugins/channelrx/demodadsb/map/liveries/B06_DE6_OE-BXA.png new file mode 100644 index 000000000..94a6d22ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B06_DE6_OE-BXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B06_G-HSDW.png b/plugins/channelrx/demodadsb/map/liveries/B06_G-HSDW.png new file mode 100644 index 000000000..5e8134541 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B06_G-HSDW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B06_US3_31A.png b/plugins/channelrx/demodadsb/map/liveries/B06_US3_31A.png new file mode 100644 index 000000000..1c024a706 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B06_US3_31A.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B462_BAE.png b/plugins/channelrx/demodadsb/map/liveries/B462_BAE.png new file mode 100644 index 000000000..2a6bbe8b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B462_BAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B462_BCY.png b/plugins/channelrx/demodadsb/map/liveries/B462_BCY.png new file mode 100644 index 000000000..8b6334c0f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B462_BCY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B462_BCY_EI-RJX.png b/plugins/channelrx/demodadsb/map/liveries/B462_BCY_EI-RJX.png new file mode 100644 index 000000000..073eae880 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B462_BCY_EI-RJX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B462_BEE.png b/plugins/channelrx/demodadsb/map/liveries/B462_BEE.png new file mode 100644 index 000000000..d77f3d19d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B462_BEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B462_ELB.png b/plugins/channelrx/demodadsb/map/liveries/B462_ELB.png new file mode 100644 index 000000000..574fa2f75 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B462_ELB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B462_LZB.png b/plugins/channelrx/demodadsb/map/liveries/B462_LZB.png new file mode 100644 index 000000000..a8a0508d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B462_LZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_AZI.png b/plugins/channelrx/demodadsb/map/liveries/B463_AZI.png new file mode 100644 index 000000000..a3f3c1b4b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_AZI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_SCW.png b/plugins/channelrx/demodadsb/map/liveries/B463_SCW.png new file mode 100644 index 000000000..29deee85b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_SCW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_SCW_SE-DSU.png b/plugins/channelrx/demodadsb/map/liveries/B463_SCW_SE-DSU.png new file mode 100644 index 000000000..73c39e069 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_SCW_SE-DSU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_SWU.png b/plugins/channelrx/demodadsb/map/liveries/B463_SWU.png new file mode 100644 index 000000000..5a1eadf4e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_SWU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_SWU_HB-STA.png b/plugins/channelrx/demodadsb/map/liveries/B463_SWU_HB-STA.png new file mode 100644 index 000000000..5175278b9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_SWU_HB-STA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_SWU_HB-ZUR.png b/plugins/channelrx/demodadsb/map/liveries/B463_SWU_HB-ZUR.png new file mode 100644 index 000000000..f652baf16 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_SWU_HB-ZUR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_TAY.png b/plugins/channelrx/demodadsb/map/liveries/B463_TAY.png new file mode 100644 index 000000000..a1e0561d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_TAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B463_TAY_EC-ELT.png b/plugins/channelrx/demodadsb/map/liveries/B463_TAY_EC-ELT.png new file mode 100644 index 000000000..f7cd914da Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B463_TAY_EC-ELT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B717_BLF.png b/plugins/channelrx/demodadsb/map/liveries/B717_BLF.png new file mode 100644 index 000000000..acf511e15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B717_BLF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B717_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B717_DAL.png new file mode 100644 index 000000000..e77a5b45b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B717_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B717_HAL.png b/plugins/channelrx/demodadsb/map/liveries/B717_HAL.png new file mode 100644 index 000000000..1883b4aeb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B717_HAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B717_QNK.png b/plugins/channelrx/demodadsb/map/liveries/B717_QNK.png new file mode 100644 index 000000000..02080b354 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B717_QNK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B717_VOE.png b/plugins/channelrx/demodadsb/map/liveries/B717_VOE.png new file mode 100644 index 000000000..17b4d974c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B717_VOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733.png b/plugins/channelrx/demodadsb/map/liveries/B733.png new file mode 100644 index 000000000..57502bead Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F.png b/plugins/channelrx/demodadsb/map/liveries/B733F.png new file mode 100644 index 000000000..7c041d52d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_AAH.png b/plugins/channelrx/demodadsb/map/liveries/B733F_AAH.png new file mode 100644 index 000000000..188affc5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_AAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_AIE.png b/plugins/channelrx/demodadsb/map/liveries/B733F_AIE.png new file mode 100644 index 000000000..056f54076 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_AIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_AKT.png b/plugins/channelrx/demodadsb/map/liveries/B733F_AKT.png new file mode 100644 index 000000000..803a191e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_AKT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_BBQ.png b/plugins/channelrx/demodadsb/map/liveries/B733F_BBQ.png new file mode 100644 index 000000000..f15639cfa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_BBQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_BFL.png b/plugins/channelrx/demodadsb/map/liveries/B733F_BFL.png new file mode 100644 index 000000000..be9c730a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_BFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_BRH.png b/plugins/channelrx/demodadsb/map/liveries/B733F_BRH.png new file mode 100644 index 000000000..17273eaf4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_BRH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_CGF.png b/plugins/channelrx/demodadsb/map/liveries/B733F_CGF.png new file mode 100644 index 000000000..b27296147 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_CGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_CSS.png b/plugins/channelrx/demodadsb/map/liveries/B733F_CSS.png new file mode 100644 index 000000000..080d06e88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_CSS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_CYZ.png b/plugins/channelrx/demodadsb/map/liveries/B733F_CYZ.png new file mode 100644 index 000000000..ccb5425df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_CYZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_LHA.png b/plugins/channelrx/demodadsb/map/liveries/B733F_LHA.png new file mode 100644 index 000000000..35bc77826 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_LHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_MYU.png b/plugins/channelrx/demodadsb/map/liveries/B733F_MYU.png new file mode 100644 index 000000000..815966e32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_MYU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733F_SWT.png b/plugins/channelrx/demodadsb/map/liveries/B733F_SWT.png new file mode 100644 index 000000000..da376354a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733F_SWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_AUL.png b/plugins/channelrx/demodadsb/map/liveries/B733_AUL.png new file mode 100644 index 000000000..84a05e98d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_AUL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B733_BAW.png new file mode 100644 index 000000000..e68e945e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BBD.png b/plugins/channelrx/demodadsb/map/liveries/B733_BBD.png new file mode 100644 index 000000000..46b49c78d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BBD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BBQ.png b/plugins/channelrx/demodadsb/map/liveries/B733_BBQ.png new file mode 100644 index 000000000..2061cf58f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BBQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BBQ_WL.png b/plugins/channelrx/demodadsb/map/liveries/B733_BBQ_WL.png new file mode 100644 index 000000000..dcf1afd1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BBQ_WL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BEL.png b/plugins/channelrx/demodadsb/map/liveries/B733_BEL.png new file mode 100644 index 000000000..c5cba223e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BOV.png b/plugins/channelrx/demodadsb/map/liveries/B733_BOV.png new file mode 100644 index 000000000..19dd11424 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BPA.png b/plugins/channelrx/demodadsb/map/liveries/B733_BPA.png new file mode 100644 index 000000000..630d75eb2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BRO.png b/plugins/channelrx/demodadsb/map/liveries/B733_BRO.png new file mode 100644 index 000000000..4894ef7be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BRO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BRU.png b/plugins/channelrx/demodadsb/map/liveries/B733_BRU.png new file mode 100644 index 000000000..e4d51aba1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BTI.png b/plugins/channelrx/demodadsb/map/liveries/B733_BTI.png new file mode 100644 index 000000000..60b734592 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BUR.png b/plugins/channelrx/demodadsb/map/liveries/B733_BUR.png new file mode 100644 index 000000000..0390be3e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BUR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_BVL.png b/plugins/channelrx/demodadsb/map/liveries/B733_BVL.png new file mode 100644 index 000000000..36ea032e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_BVL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_DLH.png b/plugins/channelrx/demodadsb/map/liveries/B733_DLH.png new file mode 100644 index 000000000..624a7d6a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_ELB.png b/plugins/channelrx/demodadsb/map/liveries/B733_ELB.png new file mode 100644 index 000000000..743ffde60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_ELB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_EXS.png b/plugins/channelrx/demodadsb/map/liveries/B733_EXS.png new file mode 100644 index 000000000..95fd755f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_JTG.png b/plugins/channelrx/demodadsb/map/liveries/B733_JTG.png new file mode 100644 index 000000000..ba1b8b15c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_JTG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_LLC.png b/plugins/channelrx/demodadsb/map/liveries/B733_LLC.png new file mode 100644 index 000000000..d6d857de0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_LLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_MSA.png b/plugins/channelrx/demodadsb/map/liveries/B733_MSA.png new file mode 100644 index 000000000..4e29a6091 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_MSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_NAX.png b/plugins/channelrx/demodadsb/map/liveries/B733_NAX.png new file mode 100644 index 000000000..aeeb2735d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_NAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_NIG.png b/plugins/channelrx/demodadsb/map/liveries/B733_NIG.png new file mode 100644 index 000000000..c1bd8c1fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_NIG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_NRL.png b/plugins/channelrx/demodadsb/map/liveries/B733_NRL.png new file mode 100644 index 000000000..77481b741 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_NRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B733_RAM.png new file mode 100644 index 000000000..70a4adf18 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_SHI.png b/plugins/channelrx/demodadsb/map/liveries/B733_SHI.png new file mode 100644 index 000000000..aa788576e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_SHI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_SWA.png b/plugins/channelrx/demodadsb/map/liveries/B733_SWA.png new file mode 100644 index 000000000..7da8ddd55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_SWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_TAY.png b/plugins/channelrx/demodadsb/map/liveries/B733_TAY.png new file mode 100644 index 000000000..61b310f08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_TAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B733_UAL.png new file mode 100644 index 000000000..070ff144b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_USA.png b/plugins/channelrx/demodadsb/map/liveries/B733_USA.png new file mode 100644 index 000000000..d114115ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_VLC.png b/plugins/channelrx/demodadsb/map/liveries/B733_VLC.png new file mode 100644 index 000000000..c465b52c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_VRH.png b/plugins/channelrx/demodadsb/map/liveries/B733_VRH.png new file mode 100644 index 000000000..7e5372cf0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_VRH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_VSP.png b/plugins/channelrx/demodadsb/map/liveries/B733_VSP.png new file mode 100644 index 000000000..51b24a3ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B733_WAT.png new file mode 100644 index 000000000..c7eaefb85 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B733_WLB.png b/plugins/channelrx/demodadsb/map/liveries/B733_WLB.png new file mode 100644 index 000000000..2538eaf78 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B733_WLB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734.png b/plugins/channelrx/demodadsb/map/liveries/B734.png new file mode 100644 index 000000000..80ccedcd3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F.png b/plugins/channelrx/demodadsb/map/liveries/B734F.png new file mode 100644 index 000000000..4f3dc429d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_AKT.png b/plugins/channelrx/demodadsb/map/liveries/B734F_AKT.png new file mode 100644 index 000000000..383698130 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_AKT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_AWK.png b/plugins/channelrx/demodadsb/map/liveries/B734F_AWK.png new file mode 100644 index 000000000..5b474a7e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_AWK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_AWK_PARCELAIR.png b/plugins/channelrx/demodadsb/map/liveries/B734F_AWK_PARCELAIR.png new file mode 100644 index 000000000..42f3f3624 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_AWK_PARCELAIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_FPO.png b/plugins/channelrx/demodadsb/map/liveries/B734F_FPO.png new file mode 100644 index 000000000..873cc861e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_FPO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_MSA.png b/plugins/channelrx/demodadsb/map/liveries/B734F_MSA.png new file mode 100644 index 000000000..b8170088e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_MSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_NPT.png b/plugins/channelrx/demodadsb/map/liveries/B734F_NPT.png new file mode 100644 index 000000000..fc2ad077a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_NPT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734F_XKY.png b/plugins/channelrx/demodadsb/map/liveries/B734F_XKY.png new file mode 100644 index 000000000..b9d26dbf7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734F_XKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_AKT.png b/plugins/channelrx/demodadsb/map/liveries/B734_AKT.png new file mode 100644 index 000000000..cfacecc61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_AKT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_ARR.png b/plugins/channelrx/demodadsb/map/liveries/B734_ARR.png new file mode 100644 index 000000000..50a72ece5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_ARR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_ASA.png b/plugins/channelrx/demodadsb/map/liveries/B734_ASA.png new file mode 100644 index 000000000..0a67474d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B734_BAW.png new file mode 100644 index 000000000..148f61966 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_BBD.png b/plugins/channelrx/demodadsb/map/liveries/B734_BBD.png new file mode 100644 index 000000000..dedc40ce7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_BBD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_BBG.png b/plugins/channelrx/demodadsb/map/liveries/B734_BBG.png new file mode 100644 index 000000000..b6a99ba3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_BBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_BIE.png b/plugins/channelrx/demodadsb/map/liveries/B734_BIE.png new file mode 100644 index 000000000..9b5cba570 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_BIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_BMS.png b/plugins/channelrx/demodadsb/map/liveries/B734_BMS.png new file mode 100644 index 000000000..b5498adbc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_BMS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_HAT.png b/plugins/channelrx/demodadsb/map/liveries/B734_HAT.png new file mode 100644 index 000000000..fb219ed21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_HAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B734_KLM.png new file mode 100644 index 000000000..f887922e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_LOT.png b/plugins/channelrx/demodadsb/map/liveries/B734_LOT.png new file mode 100644 index 000000000..411e210fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_MAR.png b/plugins/channelrx/demodadsb/map/liveries/B734_MAR.png new file mode 100644 index 000000000..ad8c76ace Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_MAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_NRL.png b/plugins/channelrx/demodadsb/map/liveries/B734_NRL.png new file mode 100644 index 000000000..20dbdda90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_NRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_RLX.png b/plugins/channelrx/demodadsb/map/liveries/B734_RLX.png new file mode 100644 index 000000000..1e2ae5115 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_RLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_USA.png b/plugins/channelrx/demodadsb/map/liveries/B734_USA.png new file mode 100644 index 000000000..2be659fd7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_UTA.png b/plugins/channelrx/demodadsb/map/liveries/B734_UTA.png new file mode 100644 index 000000000..a3cd2bf34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_VAS.png b/plugins/channelrx/demodadsb/map/liveries/B734_VAS.png new file mode 100644 index 000000000..2679ea2d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_VAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B734_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B734_WAT.png new file mode 100644 index 000000000..d31716402 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B734_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737.png b/plugins/channelrx/demodadsb/map/liveries/B737.png new file mode 100644 index 000000000..79219987d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737F.png b/plugins/channelrx/demodadsb/map/liveries/B737F.png new file mode 100644 index 000000000..ea0b195c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737F_ABW.png b/plugins/channelrx/demodadsb/map/liveries/B737F_ABW.png new file mode 100644 index 000000000..d86edacfc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737F_ABW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737F_AWK.png b/plugins/channelrx/demodadsb/map/liveries/B737F_AWK.png new file mode 100644 index 000000000..ea0b195c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737F_AWK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737F_FBT.png b/plugins/channelrx/demodadsb/map/liveries/B737F_FBT.png new file mode 100644 index 000000000..2a0464286 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737F_FBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737F_PLC.png b/plugins/channelrx/demodadsb/map/liveries/B737F_PLC.png new file mode 100644 index 000000000..b8964db03 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737F_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737F_SEJ.png b/plugins/channelrx/demodadsb/map/liveries/B737F_SEJ.png new file mode 100644 index 000000000..2a72d7f3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737F_SEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AAN.png b/plugins/channelrx/demodadsb/map/liveries/B737_AAN.png new file mode 100644 index 000000000..76bb42d99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_ADO.png b/plugins/channelrx/demodadsb/map/liveries/B737_ADO.png new file mode 100644 index 000000000..ba5c8aea2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_ADO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AEZ.png b/plugins/channelrx/demodadsb/map/liveries/B737_AEZ.png new file mode 100644 index 000000000..03f47beb7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AEZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AFX.png b/plugins/channelrx/demodadsb/map/liveries/B737_AFX.png new file mode 100644 index 000000000..0ada7ff51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AKT.png b/plugins/channelrx/demodadsb/map/liveries/B737_AKT.png new file mode 100644 index 000000000..73416d9bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AKT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AMV.png b/plugins/channelrx/demodadsb/map/liveries/B737_AMV.png new file mode 100644 index 000000000..d5764193e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AMV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_ARG.png b/plugins/channelrx/demodadsb/map/liveries/B737_ARG.png new file mode 100644 index 000000000..da452b041 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_ASA.png b/plugins/channelrx/demodadsb/map/liveries/B737_ASA.png new file mode 100644 index 000000000..43adc1007 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AUA.png b/plugins/channelrx/demodadsb/map/liveries/B737_AUA.png new file mode 100644 index 000000000..7640eb371 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AUL.png b/plugins/channelrx/demodadsb/map/liveries/B737_AUL.png new file mode 100644 index 000000000..812a7aa7d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AUL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AXY.png b/plugins/channelrx/demodadsb/map/liveries/B737_AXY.png new file mode 100644 index 000000000..83113ac99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_AZB.png b/plugins/channelrx/demodadsb/map/liveries/B737_AZB.png new file mode 100644 index 000000000..4f734a7a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_AZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BER.png b/plugins/channelrx/demodadsb/map/liveries/B737_BER.png new file mode 100644 index 000000000..500d6854d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BHS.png b/plugins/channelrx/demodadsb/map/liveries/B737_BHS.png new file mode 100644 index 000000000..056bc042d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BHS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BLA.png b/plugins/channelrx/demodadsb/map/liveries/B737_BLA.png new file mode 100644 index 000000000..10ad4a01f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BOV.png b/plugins/channelrx/demodadsb/map/liveries/B737_BOV.png new file mode 100644 index 000000000..bfe774321 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BRO.png b/plugins/channelrx/demodadsb/map/liveries/B737_BRO.png new file mode 100644 index 000000000..d0d17d1d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BRO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BRU.png b/plugins/channelrx/demodadsb/map/liveries/B737_BRU.png new file mode 100644 index 000000000..ff63a22b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B737_BVX.png new file mode 100644 index 000000000..66c674c14 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B737_CCA.png new file mode 100644 index 000000000..168aad89f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CDG.png b/plugins/channelrx/demodadsb/map/liveries/B737_CDG.png new file mode 100644 index 000000000..c49d49651 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CDG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CES.png b/plugins/channelrx/demodadsb/map/liveries/B737_CES.png new file mode 100644 index 000000000..9a4cd30c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CET.png b/plugins/channelrx/demodadsb/map/liveries/B737_CET.png new file mode 100644 index 000000000..53a8c93a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CMP.png b/plugins/channelrx/demodadsb/map/liveries/B737_CMP.png new file mode 100644 index 000000000..ec8e41c0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CMP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_COA.png b/plugins/channelrx/demodadsb/map/liveries/B737_COA.png new file mode 100644 index 000000000..990344278 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_COA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B737_CSN.png new file mode 100644 index 000000000..e7ac57aad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CXA.png b/plugins/channelrx/demodadsb/map/liveries/B737_CXA.png new file mode 100644 index 000000000..9ab2b0334 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B737_CXA_VA.png new file mode 100644 index 000000000..c238bcaef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B737_DAL.png new file mode 100644 index 000000000..ad9e783dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_DRU.png b/plugins/channelrx/demodadsb/map/liveries/B737_DRU.png new file mode 100644 index 000000000..71e431720 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_DRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_DUB.png b/plugins/channelrx/demodadsb/map/liveries/B737_DUB.png new file mode 100644 index 000000000..74965c7c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_DUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_EQX.png b/plugins/channelrx/demodadsb/map/liveries/B737_EQX.png new file mode 100644 index 000000000..7f1024e23 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_EQX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B737_ETH.png new file mode 100644 index 000000000..e2fe21801 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_FBA.png b/plugins/channelrx/demodadsb/map/liveries/B737_FBA.png new file mode 100644 index 000000000..988bf39a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_FBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B737_FBV.png new file mode 100644 index 000000000..80c0b4ad9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_FEG.png b/plugins/channelrx/demodadsb/map/liveries/B737_FEG.png new file mode 100644 index 000000000..83f825fa6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_FEG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_GLO.png b/plugins/channelrx/demodadsb/map/liveries/B737_GLO.png new file mode 100644 index 000000000..ca9fe51f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_GLO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_GMI.png b/plugins/channelrx/demodadsb/map/liveries/B737_GMI.png new file mode 100644 index 000000000..d7daff88b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_GMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_GZP.png b/plugins/channelrx/demodadsb/map/liveries/B737_GZP.png new file mode 100644 index 000000000..915ca5248 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_GZP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_JAF.png b/plugins/channelrx/demodadsb/map/liveries/B737_JAF.png new file mode 100644 index 000000000..2c8b7db9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_JAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_JTD.png b/plugins/channelrx/demodadsb/map/liveries/B737_JTD.png new file mode 100644 index 000000000..99bf69e04 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_JTD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B737_KLM.png new file mode 100644 index 000000000..94c4e8d7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_KQA.png b/plugins/channelrx/demodadsb/map/liveries/B737_KQA.png new file mode 100644 index 000000000..15db4708c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LGL.png b/plugins/channelrx/demodadsb/map/liveries/B737_LGL.png new file mode 100644 index 000000000..aaaf7f1f0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LGS.png b/plugins/channelrx/demodadsb/map/liveries/B737_LGS.png new file mode 100644 index 000000000..dfee970ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LGS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B737_LHA_VA.png new file mode 100644 index 000000000..da0c75e3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LKE.png b/plugins/channelrx/demodadsb/map/liveries/B737_LKE.png new file mode 100644 index 000000000..f8ddef7ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LLC.png b/plugins/channelrx/demodadsb/map/liveries/B737_LLC.png new file mode 100644 index 000000000..80967d787 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B737_LNR.png new file mode 100644 index 000000000..5cc156d0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_LWI.png b/plugins/channelrx/demodadsb/map/liveries/B737_LWI.png new file mode 100644 index 000000000..31ff607cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_LWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_MSE.png b/plugins/channelrx/demodadsb/map/liveries/B737_MSE.png new file mode 100644 index 000000000..30428ca6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_MSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_MWI.png b/plugins/channelrx/demodadsb/map/liveries/B737_MWI.png new file mode 100644 index 000000000..f2ffda961 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_MWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B737_OAL_VA.png new file mode 100644 index 000000000..164890995 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_PFF.png b/plugins/channelrx/demodadsb/map/liveries/B737_PFF.png new file mode 100644 index 000000000..3822c0728 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B737_RAM.png new file mode 100644 index 000000000..00eee60ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_RLH.png b/plugins/channelrx/demodadsb/map/liveries/B737_RLH.png new file mode 100644 index 000000000..f08b1ba25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_RLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_ROT.png b/plugins/channelrx/demodadsb/map/liveries/B737_ROT.png new file mode 100644 index 000000000..e4cdda1de Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_ROT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_RYS.png b/plugins/channelrx/demodadsb/map/liveries/B737_RYS.png new file mode 100644 index 000000000..c0d1ad6fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_RYS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SAS_NC.png b/plugins/channelrx/demodadsb/map/liveries/B737_SAS_NC.png new file mode 100644 index 000000000..ce8ad86bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SAS_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SAS_OC.png b/plugins/channelrx/demodadsb/map/liveries/B737_SAS_OC.png new file mode 100644 index 000000000..bcb31e6c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SAS_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SQP.png b/plugins/channelrx/demodadsb/map/liveries/B737_SQP.png new file mode 100644 index 000000000..609b24999 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SQP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SWA.png b/plugins/channelrx/demodadsb/map/liveries/B737_SWA.png new file mode 100644 index 000000000..edfe722d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SWA_BW.png b/plugins/channelrx/demodadsb/map/liveries/B737_SWA_BW.png new file mode 100644 index 000000000..d4803e972 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SWA_BW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SWA_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B737_SWA_SSW.png new file mode 100644 index 000000000..66aac4e1d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SWA_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_SYL.png b/plugins/channelrx/demodadsb/map/liveries/B737_SYL.png new file mode 100644 index 000000000..f65fd53d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_SYL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TGZ.png b/plugins/channelrx/demodadsb/map/liveries/B737_TGZ.png new file mode 100644 index 000000000..383113e7f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TGZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TKY.png b/plugins/channelrx/demodadsb/map/liveries/B737_TKY.png new file mode 100644 index 000000000..1315b6a59 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TRA.png b/plugins/channelrx/demodadsb/map/liveries/B737_TRA.png new file mode 100644 index 000000000..a31e948e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B737_TSO.png new file mode 100644 index 000000000..6fa576e73 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TUA.png b/plugins/channelrx/demodadsb/map/liveries/B737_TUA.png new file mode 100644 index 000000000..91175eb13 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TVS.png b/plugins/channelrx/demodadsb/map/liveries/B737_TVS.png new file mode 100644 index 000000000..1c5f252a7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TVS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_TYA.png b/plugins/channelrx/demodadsb/map/liveries/B737_TYA.png new file mode 100644 index 000000000..cb83e433c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_TYA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_UAL_NC.png b/plugins/channelrx/demodadsb/map/liveries/B737_UAL_NC.png new file mode 100644 index 000000000..dacf62e60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_UAL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B737_UKV.png new file mode 100644 index 000000000..f48a30bc8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_UTA.png b/plugins/channelrx/demodadsb/map/liveries/B737_UTA.png new file mode 100644 index 000000000..5f484dfb7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_VLC.png b/plugins/channelrx/demodadsb/map/liveries/B737_VLC.png new file mode 100644 index 000000000..937cdfa0a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_VOZ.png b/plugins/channelrx/demodadsb/map/liveries/B737_VOZ.png new file mode 100644 index 000000000..49cf271b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_VOZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_VSV.png b/plugins/channelrx/demodadsb/map/liveries/B737_VSV.png new file mode 100644 index 000000000..16f2a9728 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_VSV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_VXP.png b/plugins/channelrx/demodadsb/map/liveries/B737_VXP.png new file mode 100644 index 000000000..3b0830247 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_VXP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B737_WAT.png new file mode 100644 index 000000000..afa90ae71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B737_WJA.png b/plugins/channelrx/demodadsb/map/liveries/B737_WJA.png new file mode 100644 index 000000000..ec7f5efa4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B737_WJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738.png b/plugins/channelrx/demodadsb/map/liveries/B738.png new file mode 100644 index 000000000..1bfbfa364 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F.png b/plugins/channelrx/demodadsb/map/liveries/B738F.png new file mode 100644 index 000000000..accccc6b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_ABR.png b/plugins/channelrx/demodadsb/map/liveries/B738F_ABR.png new file mode 100644 index 000000000..391b78b7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_ABR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_ABV.png b/plugins/channelrx/demodadsb/map/liveries/B738F_ABV.png new file mode 100644 index 000000000..8cec1c6ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_ABV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_ABW.png b/plugins/channelrx/demodadsb/map/liveries/B738F_ABW.png new file mode 100644 index 000000000..315e5c5fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_ABW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_ADZ.png b/plugins/channelrx/demodadsb/map/liveries/B738F_ADZ.png new file mode 100644 index 000000000..29cf71710 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_ADZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_AIE.png b/plugins/channelrx/demodadsb/map/liveries/B738F_AIE.png new file mode 100644 index 000000000..3e28636c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_AIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_AIH.png b/plugins/channelrx/demodadsb/map/liveries/B738F_AIH.png new file mode 100644 index 000000000..32cef8be1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_AIH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_AJC.png b/plugins/channelrx/demodadsb/map/liveries/B738F_AJC.png new file mode 100644 index 000000000..39243c747 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_AJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_AXE.png b/plugins/channelrx/demodadsb/map/liveries/B738F_AXE.png new file mode 100644 index 000000000..663888663 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_AXE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_AXE_RDS.png b/plugins/channelrx/demodadsb/map/liveries/B738F_AXE_RDS.png new file mode 100644 index 000000000..3acb9e946 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_AXE_RDS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_BBD.png b/plugins/channelrx/demodadsb/map/liveries/B738F_BBD.png new file mode 100644 index 000000000..a9abc17db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_BBD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B738F_BVX.png new file mode 100644 index 000000000..6d177eb3a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_CGF.png b/plugins/channelrx/demodadsb/map/liveries/B738F_CGF.png new file mode 100644 index 000000000..f0a580ccf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_CGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_CSS.png b/plugins/channelrx/demodadsb/map/liveries/B738F_CSS.png new file mode 100644 index 000000000..d68f57266 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_CSS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_CXA_AIR-ROAD.png b/plugins/channelrx/demodadsb/map/liveries/B738F_CXA_AIR-ROAD.png new file mode 100644 index 000000000..948dc3762 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_CXA_AIR-ROAD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_CYZ.png b/plugins/channelrx/demodadsb/map/liveries/B738F_CYZ.png new file mode 100644 index 000000000..4275a859a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_CYZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_FBF.png b/plugins/channelrx/demodadsb/map/liveries/B738F_FBF.png new file mode 100644 index 000000000..48b3f9f42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_FBF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_FDX.png b/plugins/channelrx/demodadsb/map/liveries/B738F_FDX.png new file mode 100644 index 000000000..1ad6d2d1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_FPO.png b/plugins/channelrx/demodadsb/map/liveries/B738F_FPO.png new file mode 100644 index 000000000..d889a06f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_FPO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_GHN.png b/plugins/channelrx/demodadsb/map/liveries/B738F_GHN.png new file mode 100644 index 000000000..1968ffdbe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_GHN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_GLO_MERCADOLIBRE.png b/plugins/channelrx/demodadsb/map/liveries/B738F_GLO_MERCADOLIBRE.png new file mode 100644 index 000000000..621e78163 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_GLO_MERCADOLIBRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B738F_GTI.png new file mode 100644 index 000000000..cb2aa1165 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_KMI.png b/plugins/channelrx/demodadsb/map/liveries/B738F_KMI.png new file mode 100644 index 000000000..3a1e466d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_KMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_LHA.png b/plugins/channelrx/demodadsb/map/liveries/B738F_LHA.png new file mode 100644 index 000000000..6de5e6e22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_LHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_MQC.png b/plugins/channelrx/demodadsb/map/liveries/B738F_MQC.png new file mode 100644 index 000000000..a3441b793 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_MQC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_MYU.png b/plugins/channelrx/demodadsb/map/liveries/B738F_MYU.png new file mode 100644 index 000000000..969ac8fbd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_MYU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_NFC.png b/plugins/channelrx/demodadsb/map/liveries/B738F_NFC.png new file mode 100644 index 000000000..1d5ca142c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_NFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_NPT.png b/plugins/channelrx/demodadsb/map/liveries/B738F_NPT.png new file mode 100644 index 000000000..6cae4b3a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_NPT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_PFG.png b/plugins/channelrx/demodadsb/map/liveries/B738F_PFG.png new file mode 100644 index 000000000..694606d95 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_PFG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_PLC.png b/plugins/channelrx/demodadsb/map/liveries/B738F_PLC.png new file mode 100644 index 000000000..4e7122457 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_SWQ.png b/plugins/channelrx/demodadsb/map/liveries/B738F_SWQ.png new file mode 100644 index 000000000..32dee75f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_SWQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_SWT.png b/plugins/channelrx/demodadsb/map/liveries/B738F_SWT.png new file mode 100644 index 000000000..305ed5d6b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_SWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_TAY.png b/plugins/channelrx/demodadsb/map/liveries/B738F_TAY.png new file mode 100644 index 000000000..553e7e9b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_TAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_VAS.png b/plugins/channelrx/demodadsb/map/liveries/B738F_VAS.png new file mode 100644 index 000000000..12f9a553a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_VAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_XLR.png b/plugins/channelrx/demodadsb/map/liveries/B738F_XLR.png new file mode 100644 index 000000000..f3df91a6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_XLR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738F_XSC.png b/plugins/channelrx/demodadsb/map/liveries/B738F_XSC.png new file mode 100644 index 000000000..628e83004 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738F_XSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_AAL.png new file mode 100644 index 000000000..2eb39f5e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AAL_AIRCAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_AIRCAL.png new file mode 100644 index 000000000..d3f54b6e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_AIRCAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AAL_CLASSIC.png b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_CLASSIC.png new file mode 100644 index 000000000..6401149f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_CLASSIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AAL_MAX.png b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_MAX.png new file mode 100644 index 000000000..805cfe14e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_MAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AAL_TWA.png b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_TWA.png new file mode 100644 index 000000000..c04ff4eb3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AAL_TWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ABB.png b/plugins/channelrx/demodadsb/map/liveries/B738_ABB.png new file mode 100644 index 000000000..1edbd022e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ABB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ABN.png b/plugins/channelrx/demodadsb/map/liveries/B738_ABN.png new file mode 100644 index 000000000..6d446da50 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ABN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ABX.png b/plugins/channelrx/demodadsb/map/liveries/B738_ABX.png new file mode 100644 index 000000000..e821ff4dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ABX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ABZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_ABZ.png new file mode 100644 index 000000000..0dc5f0ead Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ABZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B738_ACA.png new file mode 100644 index 000000000..b887c97fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ADH.png b/plugins/channelrx/demodadsb/map/liveries/B738_ADH.png new file mode 100644 index 000000000..e44a465ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ADH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ADO.png b/plugins/channelrx/demodadsb/map/liveries/B738_ADO.png new file mode 100644 index 000000000..4901220b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ADO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AEA.png b/plugins/channelrx/demodadsb/map/liveries/B738_AEA.png new file mode 100644 index 000000000..0aa5cc6d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AEL.png b/plugins/channelrx/demodadsb/map/liveries/B738_AEL.png new file mode 100644 index 000000000..9eca3c802 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AET.png b/plugins/channelrx/demodadsb/map/liveries/B738_AET.png new file mode 100644 index 000000000..af00e2222 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AEY.png b/plugins/channelrx/demodadsb/map/liveries/B738_AEY.png new file mode 100644 index 000000000..e7fd79915 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AEZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_AEZ.png new file mode 100644 index 000000000..ab1fefe5b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AEZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AFF.png b/plugins/channelrx/demodadsb/map/liveries/B738_AFF.png new file mode 100644 index 000000000..c95c0c526 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AFL.png b/plugins/channelrx/demodadsb/map/liveries/B738_AFL.png new file mode 100644 index 000000000..fecb6f2c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AFX.png b/plugins/channelrx/demodadsb/map/liveries/B738_AFX.png new file mode 100644 index 000000000..d7cee2650 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AGA.png b/plugins/channelrx/demodadsb/map/liveries/B738_AGA.png new file mode 100644 index 000000000..8de21d0d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AGN.png b/plugins/channelrx/demodadsb/map/liveries/B738_AGN.png new file mode 100644 index 000000000..7060ea27a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AGN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AHS.png b/plugins/channelrx/demodadsb/map/liveries/B738_AHS.png new file mode 100644 index 000000000..5f30c992d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AHS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AJA.png b/plugins/channelrx/demodadsb/map/liveries/B738_AJA.png new file mode 100644 index 000000000..eabc9cc35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AKX_1.png b/plugins/channelrx/demodadsb/map/liveries/B738_AKX_1.png new file mode 100644 index 000000000..261dea3c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AKX_1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AKX_2.png b/plugins/channelrx/demodadsb/map/liveries/B738_AKX_2.png new file mode 100644 index 000000000..ce7f480f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AKX_2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AMV.png b/plugins/channelrx/demodadsb/map/liveries/B738_AMV.png new file mode 100644 index 000000000..cc11aa3be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AMV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AMX.png b/plugins/channelrx/demodadsb/map/liveries/B738_AMX.png new file mode 100644 index 000000000..0bc40f707 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AMX_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_AMX_SSW.png new file mode 100644 index 000000000..d918f83f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AMX_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B738_ANA.png new file mode 100644 index 000000000..3ba625c2f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ANA_1.png b/plugins/channelrx/demodadsb/map/liveries/B738_ANA_1.png new file mode 100644 index 000000000..261dea3c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ANA_1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ANA_2.png b/plugins/channelrx/demodadsb/map/liveries/B738_ANA_2.png new file mode 100644 index 000000000..ce7f480f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ANA_2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ANG.png b/plugins/channelrx/demodadsb/map/liveries/B738_ANG.png new file mode 100644 index 000000000..6cfd5fee0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ANG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ANS.png b/plugins/channelrx/demodadsb/map/liveries/B738_ANS.png new file mode 100644 index 000000000..06f23d5f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ANS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_ANZ.png new file mode 100644 index 000000000..92109d0cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ARA.png b/plugins/channelrx/demodadsb/map/liveries/B738_ARA.png new file mode 100644 index 000000000..be0d007d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ARA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ARG.png b/plugins/channelrx/demodadsb/map/liveries/B738_ARG.png new file mode 100644 index 000000000..1044e857d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ART.png b/plugins/channelrx/demodadsb/map/liveries/B738_ART.png new file mode 100644 index 000000000..b8c4f267b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ART.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ARW.png b/plugins/channelrx/demodadsb/map/liveries/B738_ARW.png new file mode 100644 index 000000000..025865202 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ARW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ASA.png b/plugins/channelrx/demodadsb/map/liveries/B738_ASA.png new file mode 100644 index 000000000..bf6823062 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ASA_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_ASA_NC.png new file mode 100644 index 000000000..06ed8b8b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ASA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AUA.png b/plugins/channelrx/demodadsb/map/liveries/B738_AUA.png new file mode 100644 index 000000000..69a65fe6b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AUH.png b/plugins/channelrx/demodadsb/map/liveries/B738_AUH.png new file mode 100644 index 000000000..d1edad3e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AUH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AUI.png b/plugins/channelrx/demodadsb/map/liveries/B738_AUI.png new file mode 100644 index 000000000..db1d1a9cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AUI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AUL.png b/plugins/channelrx/demodadsb/map/liveries/B738_AUL.png new file mode 100644 index 000000000..d9d88b2f9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AUL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AUZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_AUZ.png new file mode 100644 index 000000000..440836cf5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AUZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AWV.png b/plugins/channelrx/demodadsb/map/liveries/B738_AWV.png new file mode 100644 index 000000000..143ebc16a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AWV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AXB.png b/plugins/channelrx/demodadsb/map/liveries/B738_AXB.png new file mode 100644 index 000000000..71237ce63 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AXB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AXB2.png b/plugins/channelrx/demodadsb/map/liveries/B738_AXB2.png new file mode 100644 index 000000000..55952b971 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AXB2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AXB3.png b/plugins/channelrx/demodadsb/map/liveries/B738_AXB3.png new file mode 100644 index 000000000..2eda50573 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AXB3.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AXE.png b/plugins/channelrx/demodadsb/map/liveries/B738_AXE.png new file mode 100644 index 000000000..12c162faf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AXE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AXN.png b/plugins/channelrx/demodadsb/map/liveries/B738_AXN.png new file mode 100644 index 000000000..ffec6737b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AXN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AXY.png b/plugins/channelrx/demodadsb/map/liveries/B738_AXY.png new file mode 100644 index 000000000..2235d6bb9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AYZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_AYZ.png new file mode 100644 index 000000000..e0b7000fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AYZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_AZV.png b/plugins/channelrx/demodadsb/map/liveries/B738_AZV.png new file mode 100644 index 000000000..002e2f1b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_AZV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_BAL.png new file mode 100644 index 000000000..881c2d65a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B738_BAW.png new file mode 100644 index 000000000..8166bf828 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BBC.png b/plugins/channelrx/demodadsb/map/liveries/B738_BBC.png new file mode 100644 index 000000000..08543c4b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BBC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BDR.png b/plugins/channelrx/demodadsb/map/liveries/B738_BDR.png new file mode 100644 index 000000000..422527055 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BDR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BER.png b/plugins/channelrx/demodadsb/map/liveries/B738_BER.png new file mode 100644 index 000000000..127a46091 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BHA.png b/plugins/channelrx/demodadsb/map/liveries/B738_BHA.png new file mode 100644 index 000000000..94a2541c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BHE.png b/plugins/channelrx/demodadsb/map/liveries/B738_BHE.png new file mode 100644 index 000000000..d7d8b18d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BJN.png b/plugins/channelrx/demodadsb/map/liveries/B738_BJN.png new file mode 100644 index 000000000..c7bb53188 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BJN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BLA.png b/plugins/channelrx/demodadsb/map/liveries/B738_BLA.png new file mode 100644 index 000000000..3fdbe8727 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BLX.png b/plugins/channelrx/demodadsb/map/liveries/B738_BLX.png new file mode 100644 index 000000000..b7383d413 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BNZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_BNZ.png new file mode 100644 index 000000000..fb9fdea39 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BNZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BOE.png b/plugins/channelrx/demodadsb/map/liveries/B738_BOE.png new file mode 100644 index 000000000..fb8eab501 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BOV.png b/plugins/channelrx/demodadsb/map/liveries/B738_BOV.png new file mode 100644 index 000000000..07ae39587 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BPX.png b/plugins/channelrx/demodadsb/map/liveries/B738_BPX.png new file mode 100644 index 000000000..29304d723 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BPX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BRQ.png b/plugins/channelrx/demodadsb/map/liveries/B738_BRQ.png new file mode 100644 index 000000000..62e8742fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BRQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BRU.png b/plugins/channelrx/demodadsb/map/liveries/B738_BRU.png new file mode 100644 index 000000000..d5151da07 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BSK.png b/plugins/channelrx/demodadsb/map/liveries/B738_BSK.png new file mode 100644 index 000000000..1a338c819 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BSK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BTK.png b/plugins/channelrx/demodadsb/map/liveries/B738_BTK.png new file mode 100644 index 000000000..47f81a824 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BTK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B738_BVX.png new file mode 100644 index 000000000..fae410a24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BWA.png b/plugins/channelrx/demodadsb/map/liveries/B738_BWA.png new file mode 100644 index 000000000..f4aef656a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BZN.png b/plugins/channelrx/demodadsb/map/liveries/B738_BZN.png new file mode 100644 index 000000000..ba1cdda50 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_BZS.png b/plugins/channelrx/demodadsb/map/liveries/B738_BZS.png new file mode 100644 index 000000000..7dcad1e86 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_BZS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CAI.png b/plugins/channelrx/demodadsb/map/liveries/B738_CAI.png new file mode 100644 index 000000000..2a1968740 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_CAL.png new file mode 100644 index 000000000..ea490bee3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CAV.png b/plugins/channelrx/demodadsb/map/liveries/B738_CAV.png new file mode 100644 index 000000000..fb8b4c82f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CAW.png b/plugins/channelrx/demodadsb/map/liveries/B738_CAW.png new file mode 100644 index 000000000..3eb37f681 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CAW_BA.png b/plugins/channelrx/demodadsb/map/liveries/B738_CAW_BA.png new file mode 100644 index 000000000..5943cf666 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CAW_BA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CAY.png b/plugins/channelrx/demodadsb/map/liveries/B738_CAY.png new file mode 100644 index 000000000..8cbcd5ba3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B738_CCA.png new file mode 100644 index 000000000..bdb2436c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CCD.png b/plugins/channelrx/demodadsb/map/liveries/B738_CCD.png new file mode 100644 index 000000000..83693373f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CCD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CCH.png b/plugins/channelrx/demodadsb/map/liveries/B738_CCH.png new file mode 100644 index 000000000..8db03955d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CCH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CDG.png b/plugins/channelrx/demodadsb/map/liveries/B738_CDG.png new file mode 100644 index 000000000..fe32afa33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CDG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CES.png b/plugins/channelrx/demodadsb/map/liveries/B738_CES.png new file mode 100644 index 000000000..0b93db508 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CGA.png b/plugins/channelrx/demodadsb/map/liveries/B738_CGA.png new file mode 100644 index 000000000..a0a7c098c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CGN.png b/plugins/channelrx/demodadsb/map/liveries/B738_CGN.png new file mode 100644 index 000000000..5c57a5b8b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CGN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CHH.png b/plugins/channelrx/demodadsb/map/liveries/B738_CHH.png new file mode 100644 index 000000000..85d66717a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CJA.png b/plugins/channelrx/demodadsb/map/liveries/B738_CJA.png new file mode 100644 index 000000000..b72c54552 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CJT.png b/plugins/channelrx/demodadsb/map/liveries/B738_CJT.png new file mode 100644 index 000000000..bdcfda321 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CJT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CJX.png b/plugins/channelrx/demodadsb/map/liveries/B738_CJX.png new file mode 100644 index 000000000..df32551c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CJX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CMP.png b/plugins/channelrx/demodadsb/map/liveries/B738_CMP.png new file mode 100644 index 000000000..e93149c33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CMP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CMP_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_CMP_SSW.png new file mode 100644 index 000000000..9c2ab7d3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CMP_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CND.png b/plugins/channelrx/demodadsb/map/liveries/B738_CND.png new file mode 100644 index 000000000..29ee08846 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CND.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CNM.png b/plugins/channelrx/demodadsb/map/liveries/B738_CNM.png new file mode 100644 index 000000000..d080ef34a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CNM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_COA.png b/plugins/channelrx/demodadsb/map/liveries/B738_COA.png new file mode 100644 index 000000000..a7398798b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_COA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CSF.png b/plugins/channelrx/demodadsb/map/liveries/B738_CSF.png new file mode 100644 index 000000000..b36edf232 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CSF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CSH.png b/plugins/channelrx/demodadsb/map/liveries/B738_CSH.png new file mode 100644 index 000000000..68a4f3e08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CSH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B738_CSN.png new file mode 100644 index 000000000..cf5076616 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_CSZ.png new file mode 100644 index 000000000..dda58ab5b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CUA.png b/plugins/channelrx/demodadsb/map/liveries/B738_CUA.png new file mode 100644 index 000000000..81ade2c42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CUH.png b/plugins/channelrx/demodadsb/map/liveries/B738_CUH.png new file mode 100644 index 000000000..ab8e31563 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CUH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CXA.png b/plugins/channelrx/demodadsb/map/liveries/B738_CXA.png new file mode 100644 index 000000000..257367869 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CXI.png b/plugins/channelrx/demodadsb/map/liveries/B738_CXI.png new file mode 100644 index 000000000..7fdee6640 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CXI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_CXN.png b/plugins/channelrx/demodadsb/map/liveries/B738_CXN.png new file mode 100644 index 000000000..98b40921f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_CXN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_DAH.png b/plugins/channelrx/demodadsb/map/liveries/B738_DAH.png new file mode 100644 index 000000000..2ebcff392 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_DAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_DAL.png new file mode 100644 index 000000000..cc014293a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_DRU.png b/plugins/channelrx/demodadsb/map/liveries/B738_DRU.png new file mode 100644 index 000000000..492e7c13f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_DRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_DTH.png b/plugins/channelrx/demodadsb/map/liveries/B738_DTH.png new file mode 100644 index 000000000..846c4aa11 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_DTH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_DUB.png b/plugins/channelrx/demodadsb/map/liveries/B738_DUB.png new file mode 100644 index 000000000..afd95dbcc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_DUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EAG.png b/plugins/channelrx/demodadsb/map/liveries/B738_EAG.png new file mode 100644 index 000000000..f1a92d13a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_EAL.png new file mode 100644 index 000000000..cf95e97f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EBA.png b/plugins/channelrx/demodadsb/map/liveries/B738_EBA.png new file mode 100644 index 000000000..fb9c58f8a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ECN.png b/plugins/channelrx/demodadsb/map/liveries/B738_ECN.png new file mode 100644 index 000000000..dcf400b27 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ECN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B738_ELY.png new file mode 100644 index 000000000..1280074c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EMI.png b/plugins/channelrx/demodadsb/map/liveries/B738_EMI.png new file mode 100644 index 000000000..b2148ad99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EMR.png b/plugins/channelrx/demodadsb/map/liveries/B738_EMR.png new file mode 100644 index 000000000..23ec648aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ENT.png b/plugins/channelrx/demodadsb/map/liveries/B738_ENT.png new file mode 100644 index 000000000..6cc38906f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ENT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EPA_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_EPA_NC.png new file mode 100644 index 000000000..7589a8464 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EPA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EPA_OC.png b/plugins/channelrx/demodadsb/map/liveries/B738_EPA_OC.png new file mode 100644 index 000000000..59ea01a24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EPA_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ESR.png b/plugins/channelrx/demodadsb/map/liveries/B738_ESR.png new file mode 100644 index 000000000..db0a1afdc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ESR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B738_ETH.png new file mode 100644 index 000000000..56386104e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EUK.png b/plugins/channelrx/demodadsb/map/liveries/B738_EUK.png new file mode 100644 index 000000000..7cb5fcf63 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EUS.png b/plugins/channelrx/demodadsb/map/liveries/B738_EUS.png new file mode 100644 index 000000000..3789996e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EWG.png b/plugins/channelrx/demodadsb/map/liveries/B738_EWG.png new file mode 100644 index 000000000..4aca55051 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EXS.png b/plugins/channelrx/demodadsb/map/liveries/B738_EXS.png new file mode 100644 index 000000000..ce361aab1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EXS_HOLIDAYS.png b/plugins/channelrx/demodadsb/map/liveries/B738_EXS_HOLIDAYS.png new file mode 100644 index 000000000..eeb969659 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EXS_HOLIDAYS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EXS_LOWFARES.png b/plugins/channelrx/demodadsb/map/liveries/B738_EXS_LOWFARES.png new file mode 100644 index 000000000..a4afa56c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EXS_LOWFARES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_EZZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_EZZ.png new file mode 100644 index 000000000..bd79a5f20 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_EZZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FBA.png b/plugins/channelrx/demodadsb/map/liveries/B738_FBA.png new file mode 100644 index 000000000..5016a8df5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FBT.png b/plugins/channelrx/demodadsb/map/liveries/B738_FBT.png new file mode 100644 index 000000000..adb10bb9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B738_FBV.png new file mode 100644 index 000000000..f382caa9c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FBZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_FBZ.png new file mode 100644 index 000000000..1558f3995 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FBZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FDB.png b/plugins/channelrx/demodadsb/map/liveries/B738_FDB.png new file mode 100644 index 000000000..4cf059473 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FDB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FEG.png b/plugins/channelrx/demodadsb/map/liveries/B738_FEG.png new file mode 100644 index 000000000..34dbef22a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FEG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FEI.png b/plugins/channelrx/demodadsb/map/liveries/B738_FEI.png new file mode 100644 index 000000000..455f3b26e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FEI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FFM.png b/plugins/channelrx/demodadsb/map/liveries/B738_FFM.png new file mode 100644 index 000000000..d6b6d76a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FFM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FHA.png b/plugins/channelrx/demodadsb/map/liveries/B738_FHA.png new file mode 100644 index 000000000..176ad4746 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FIA.png b/plugins/channelrx/demodadsb/map/liveries/B738_FIA.png new file mode 100644 index 000000000..55b19e2ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FJI.png b/plugins/channelrx/demodadsb/map/liveries/B738_FJI.png new file mode 100644 index 000000000..84f488a79 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FJI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FLE_MAX.png b/plugins/channelrx/demodadsb/map/liveries/B738_FLE_MAX.png new file mode 100644 index 000000000..032b8a4a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FLE_MAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FLE_OC.png b/plugins/channelrx/demodadsb/map/liveries/B738_FLE_OC.png new file mode 100644 index 000000000..5dec708a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FLE_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FLO.png b/plugins/channelrx/demodadsb/map/liveries/B738_FLO.png new file mode 100644 index 000000000..9eca3c802 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FLO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FOR.png b/plugins/channelrx/demodadsb/map/liveries/B738_FOR.png new file mode 100644 index 000000000..9eca3c802 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FOR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FOX.png b/plugins/channelrx/demodadsb/map/liveries/B738_FOX.png new file mode 100644 index 000000000..8856568ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FOX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FRR.png b/plugins/channelrx/demodadsb/map/liveries/B738_FRR.png new file mode 100644 index 000000000..b160698ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FUA.png b/plugins/channelrx/demodadsb/map/liveries/B738_FUA.png new file mode 100644 index 000000000..203c80088 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FUN.png b/plugins/channelrx/demodadsb/map/liveries/B738_FUN.png new file mode 100644 index 000000000..c88837ff9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FUZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_FUZ.png new file mode 100644 index 000000000..76b6ccd35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FUZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FWA.png b/plugins/channelrx/demodadsb/map/liveries/B738_FWA.png new file mode 100644 index 000000000..e85a5c74b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FWC.png b/plugins/channelrx/demodadsb/map/liveries/B738_FWC.png new file mode 100644 index 000000000..2fae713f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FYI.png b/plugins/channelrx/demodadsb/map/liveries/B738_FYI.png new file mode 100644 index 000000000..f433d4b97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FYI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_FZA.png b/plugins/channelrx/demodadsb/map/liveries/B738_FZA.png new file mode 100644 index 000000000..dd10b00d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_FZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GAI.png b/plugins/channelrx/demodadsb/map/liveries/B738_GAI.png new file mode 100644 index 000000000..d979a2286 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GHY.png b/plugins/channelrx/demodadsb/map/liveries/B738_GHY.png new file mode 100644 index 000000000..198393031 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GIA.png b/plugins/channelrx/demodadsb/map/liveries/B738_GIA.png new file mode 100644 index 000000000..672b15531 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GLD.png b/plugins/channelrx/demodadsb/map/liveries/B738_GLD.png new file mode 100644 index 000000000..4924d2031 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GLJ.png b/plugins/channelrx/demodadsb/map/liveries/B738_GLJ.png new file mode 100644 index 000000000..73328b9b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GLJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GLO.png b/plugins/channelrx/demodadsb/map/liveries/B738_GLO.png new file mode 100644 index 000000000..aa963617f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GLO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GLO_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_GLO_NC.png new file mode 100644 index 000000000..45a7c04d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GLO_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GLS.png b/plugins/channelrx/demodadsb/map/liveries/B738_GLS.png new file mode 100644 index 000000000..66481645e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GLS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GLT.png b/plugins/channelrx/demodadsb/map/liveries/B738_GLT.png new file mode 100644 index 000000000..00dd66bd7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GLT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GRE.png b/plugins/channelrx/demodadsb/map/liveries/B738_GRE.png new file mode 100644 index 000000000..f6711303e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GSM.png b/plugins/channelrx/demodadsb/map/liveries/B738_GSM.png new file mode 100644 index 000000000..397ae3cf6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GSM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_GXL.png b/plugins/channelrx/demodadsb/map/liveries/B738_GXL.png new file mode 100644 index 000000000..38f85ab0d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_GXL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HAM.png b/plugins/channelrx/demodadsb/map/liveries/B738_HAM.png new file mode 100644 index 000000000..688c39a41 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_HAZ.png new file mode 100644 index 000000000..7c221d22e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HBH.png b/plugins/channelrx/demodadsb/map/liveries/B738_HBH.png new file mode 100644 index 000000000..97b786588 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HBH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HCY.png b/plugins/channelrx/demodadsb/map/liveries/B738_HCY.png new file mode 100644 index 000000000..e9e712ed3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HCY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HGB.png b/plugins/channelrx/demodadsb/map/liveries/B738_HGB.png new file mode 100644 index 000000000..4a5a13f14 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HGB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HIS.png b/plugins/channelrx/demodadsb/map/liveries/B738_HIS.png new file mode 100644 index 000000000..d148dd996 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HIS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HLF.png b/plugins/channelrx/demodadsb/map/liveries/B738_HLF.png new file mode 100644 index 000000000..70239d226 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HLF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HLX.png b/plugins/channelrx/demodadsb/map/liveries/B738_HLX.png new file mode 100644 index 000000000..5b914b35c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_HUV.png b/plugins/channelrx/demodadsb/map/liveries/B738_HUV.png new file mode 100644 index 000000000..3174aaeee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_HUV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_IAI.png b/plugins/channelrx/demodadsb/map/liveries/B738_IAI.png new file mode 100644 index 000000000..fb6c22563 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_IAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_IAW.png b/plugins/channelrx/demodadsb/map/liveries/B738_IAW.png new file mode 100644 index 000000000..50641d27b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCBOR.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCBOR.png new file mode 100644 index 000000000..3d8fb6945 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCBOR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCGRE.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCGRE.png new file mode 100644 index 000000000..6238ed864 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCGRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCMAG.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCMAG.png new file mode 100644 index 000000000..dfd64807f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCMAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCSKY.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCSKY.png new file mode 100644 index 000000000..7a073bda1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCSKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCYEL.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCYEL.png new file mode 100644 index 000000000..2be44ed2e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_NCYEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICE_OC.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_OC.png new file mode 100644 index 000000000..ca87e5aca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICE_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ICP.png b/plugins/channelrx/demodadsb/map/liveries/B738_ICP.png new file mode 100644 index 000000000..f7b750a11 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ICP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_INX.png b/plugins/channelrx/demodadsb/map/liveries/B738_INX.png new file mode 100644 index 000000000..b3d1e678a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_INX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_IRB.png b/plugins/channelrx/demodadsb/map/liveries/B738_IRB.png new file mode 100644 index 000000000..c55a7c779 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_IRB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_IWA.png b/plugins/channelrx/demodadsb/map/liveries/B738_IWA.png new file mode 100644 index 000000000..571de2cf5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_IYE.png b/plugins/channelrx/demodadsb/map/liveries/B738_IYE.png new file mode 100644 index 000000000..867d3324a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_IYE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_IZA.png b/plugins/channelrx/demodadsb/map/liveries/B738_IZA.png new file mode 100644 index 000000000..9b1734990 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_IZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JAF.png b/plugins/channelrx/demodadsb/map/liveries/B738_JAF.png new file mode 100644 index 000000000..22280c233 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JAI.png b/plugins/channelrx/demodadsb/map/liveries/B738_JAI.png new file mode 100644 index 000000000..de1f47d8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_JAL.png new file mode 100644 index 000000000..a31289598 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JEF.png b/plugins/channelrx/demodadsb/map/liveries/B738_JEF.png new file mode 100644 index 000000000..7a54a6fb0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JFU.png b/plugins/channelrx/demodadsb/map/liveries/B738_JFU.png new file mode 100644 index 000000000..d81406381 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JFU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JGO.png b/plugins/channelrx/demodadsb/map/liveries/B738_JGO.png new file mode 100644 index 000000000..ef448e2c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JJA.png b/plugins/channelrx/demodadsb/map/liveries/B738_JJA.png new file mode 100644 index 000000000..9fcd532cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JLL.png b/plugins/channelrx/demodadsb/map/liveries/B738_JLL.png new file mode 100644 index 000000000..5146c1353 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JLL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JNA.png b/plugins/channelrx/demodadsb/map/liveries/B738_JNA.png new file mode 100644 index 000000000..86b66ae13 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JNA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JOR.png b/plugins/channelrx/demodadsb/map/liveries/B738_JOR.png new file mode 100644 index 000000000..b34864a90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JOR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JRR.png b/plugins/channelrx/demodadsb/map/liveries/B738_JRR.png new file mode 100644 index 000000000..81ec3983d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JTA.png b/plugins/channelrx/demodadsb/map/liveries/B738_JTA.png new file mode 100644 index 000000000..051fa57b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JTD_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_JTD_SSW.png new file mode 100644 index 000000000..b26b0f5dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JTD_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_DARKBLUE.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_DARKBLUE.png new file mode 100644 index 000000000..9c1b849ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_DARKBLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_DARKGREEN.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_DARKGREEN.png new file mode 100644 index 000000000..3965f2da9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_DARKGREEN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_LIGHTBLUE.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_LIGHTBLUE.png new file mode 100644 index 000000000..c4b758e19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_LIGHTBLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_LIGHTGREEN.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_LIGHTGREEN.png new file mode 100644 index 000000000..d6555502d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_LIGHTGREEN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_ORANGE.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_ORANGE.png new file mode 100644 index 000000000..9c68f50be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_ORANGE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_PINK.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_PINK.png new file mode 100644 index 000000000..e917d00bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_PINK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_JYH_YELLOW.png b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_YELLOW.png new file mode 100644 index 000000000..18d070002 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_JYH_YELLOW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_KAL.png new file mode 100644 index 000000000..4a1fa5fc5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KAR.png b/plugins/channelrx/demodadsb/map/liveries/B738_KAR.png new file mode 100644 index 000000000..318b721e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B738_KLM.png new file mode 100644 index 000000000..d8f76aa65 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KLM_new.png b/plugins/channelrx/demodadsb/map/liveries/B738_KLM_new.png new file mode 100644 index 000000000..0b3ded567 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KLM_new.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KNA.png b/plugins/channelrx/demodadsb/map/liveries/B738_KNA.png new file mode 100644 index 000000000..799e64c86 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KNA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KQA.png b/plugins/channelrx/demodadsb/map/liveries/B738_KQA.png new file mode 100644 index 000000000..0099422bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KYV.png b/plugins/channelrx/demodadsb/map/liveries/B738_KYV.png new file mode 100644 index 000000000..19a5955f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KYV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_KZR.png b/plugins/channelrx/demodadsb/map/liveries/B738_KZR.png new file mode 100644 index 000000000..eee67a237 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LAV.png b/plugins/channelrx/demodadsb/map/liveries/B738_LAV.png new file mode 100644 index 000000000..3ce0843f4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LDA.png b/plugins/channelrx/demodadsb/map/liveries/B738_LDA.png new file mode 100644 index 000000000..fec7bb300 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LGL.png b/plugins/channelrx/demodadsb/map/liveries/B738_LGL.png new file mode 100644 index 000000000..7cc60f756 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LGL_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_LGL_SSW.png new file mode 100644 index 000000000..6f9d463f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LGL_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LGS.png b/plugins/channelrx/demodadsb/map/liveries/B738_LGS.png new file mode 100644 index 000000000..490ea3f32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LGS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B738_LHA_VA.png new file mode 100644 index 000000000..848fdd21e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LIC.png b/plugins/channelrx/demodadsb/map/liveries/B738_LIC.png new file mode 100644 index 000000000..7721f6fda Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LKE.png b/plugins/channelrx/demodadsb/map/liveries/B738_LKE.png new file mode 100644 index 000000000..7662614e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LKE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LNI.png b/plugins/channelrx/demodadsb/map/liveries/B738_LNI.png new file mode 100644 index 000000000..d2ffde82f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LNI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B738_LNR.png new file mode 100644 index 000000000..85086bf0b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LOT.png b/plugins/channelrx/demodadsb/map/liveries/B738_LOT.png new file mode 100644 index 000000000..3a26a28eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LOT_BANK_PEKAO.png b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_BANK_PEKAO.png new file mode 100644 index 000000000..26c4d881e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_BANK_PEKAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LOT_ENERGYLANDIA.png b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_ENERGYLANDIA.png new file mode 100644 index 000000000..11c979130 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_ENERGYLANDIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LOT_INDEPENDENCE.png b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_INDEPENDENCE.png new file mode 100644 index 000000000..d78ca057e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_INDEPENDENCE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LOT_KROSNO_GLASS.png b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_KROSNO_GLASS.png new file mode 100644 index 000000000..1a464d7b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LOT_KROSNO_GLASS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_LRI.png b/plugins/channelrx/demodadsb/map/liveries/B738_LRI.png new file mode 100644 index 000000000..b20032495 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_LRI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MAH.png b/plugins/channelrx/demodadsb/map/liveries/B738_MAH.png new file mode 100644 index 000000000..6ea7ef869 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MAS.png b/plugins/channelrx/demodadsb/map/liveries/B738_MAS.png new file mode 100644 index 000000000..401f0fc59 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MAY_1.png b/plugins/channelrx/demodadsb/map/liveries/B738_MAY_1.png new file mode 100644 index 000000000..8d3248c3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MAY_1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MAY_2.png b/plugins/channelrx/demodadsb/map/liveries/B738_MAY_2.png new file mode 100644 index 000000000..6e972dc6e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MAY_2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MED.png b/plugins/channelrx/demodadsb/map/liveries/B738_MED.png new file mode 100644 index 000000000..75185f9d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MED.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MET.png b/plugins/channelrx/demodadsb/map/liveries/B738_MET.png new file mode 100644 index 000000000..7457f8628 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MGL.png b/plugins/channelrx/demodadsb/map/liveries/B738_MGL.png new file mode 100644 index 000000000..a7b0426c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MHL.png b/plugins/channelrx/demodadsb/map/liveries/B738_MHL.png new file mode 100644 index 000000000..b16b71d19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MMZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_MMZ.png new file mode 100644 index 000000000..b0dbc00be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MMZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MNO.png b/plugins/channelrx/demodadsb/map/liveries/B738_MNO.png new file mode 100644 index 000000000..b43fc06f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MNO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MON.png b/plugins/channelrx/demodadsb/map/liveries/B738_MON.png new file mode 100644 index 000000000..c40fc6e9e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MQT.png b/plugins/channelrx/demodadsb/map/liveries/B738_MQT.png new file mode 100644 index 000000000..cda749830 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MSE.png b/plugins/channelrx/demodadsb/map/liveries/B738_MSE.png new file mode 100644 index 000000000..2d3d76b3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MSL.png b/plugins/channelrx/demodadsb/map/liveries/B738_MSL.png new file mode 100644 index 000000000..93c1c0e83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MSL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MSR.png b/plugins/channelrx/demodadsb/map/liveries/B738_MSR.png new file mode 100644 index 000000000..24705d078 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MWA.png b/plugins/channelrx/demodadsb/map/liveries/B738_MWA.png new file mode 100644 index 000000000..80440455a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_MXD.png b/plugins/channelrx/demodadsb/map/liveries/B738_MXD.png new file mode 100644 index 000000000..dcb2279f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_MXD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NAN_HANSSEN.png b/plugins/channelrx/demodadsb/map/liveries/B738_NAN_HANSSEN.png new file mode 100644 index 000000000..ce8479a87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NAN_HANSSEN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NAX.png b/plugins/channelrx/demodadsb/map/liveries/B738_NAX.png new file mode 100644 index 000000000..6470bc83c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NAX_WHITE.png b/plugins/channelrx/demodadsb/map/liveries/B738_NAX_WHITE.png new file mode 100644 index 000000000..7e8a3f98c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NAX_WHITE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NDF.png b/plugins/channelrx/demodadsb/map/liveries/B738_NDF.png new file mode 100644 index 000000000..54fc61561 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NHL.png b/plugins/channelrx/demodadsb/map/liveries/B738_NHL.png new file mode 100644 index 000000000..934631cb3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK.png new file mode 100644 index 000000000..8f1b9b30f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBA.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBA.png new file mode 100644 index 000000000..339cb6e1d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBD.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBD.png new file mode 100644 index 000000000..4ffff9081 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBE.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBE.png new file mode 100644 index 000000000..92de7b6bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBF.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBF.png new file mode 100644 index 000000000..c167dd9dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBG.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBG.png new file mode 100644 index 000000000..2aa89fb1e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBY.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBY.png new file mode 100644 index 000000000..5b8b73fdc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOK_HS-DBY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOS.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOS.png new file mode 100644 index 000000000..52b07e5d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ.png new file mode 100644 index 000000000..f5d4a991b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_HANSSEN.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_HANSSEN.png new file mode 100644 index 000000000..ce8479a87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_HANSSEN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_MERCURY.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_MERCURY.png new file mode 100644 index 000000000..27c09c409 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_MERCURY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_UNICEF.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_UNICEF.png new file mode 100644 index 000000000..31a4ce3ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_UNICEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_WHITE_TAIL.png b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_WHITE_TAIL.png new file mode 100644 index 000000000..d2394bf6e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NOZ_WHITE_TAIL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NPT.png b/plugins/channelrx/demodadsb/map/liveries/B738_NPT.png new file mode 100644 index 000000000..f67687c55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NPT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_LARSON.png b/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_LARSON.png new file mode 100644 index 000000000..1cc1d2d9c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_LARSON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_MOE.png b/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_MOE.png new file mode 100644 index 000000000..5e8595852 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_MOE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_WHITE_TAIL.png b/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_WHITE_TAIL.png new file mode 100644 index 000000000..cc3565290 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NSZ_WHITE_TAIL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NTL.png b/plugins/channelrx/demodadsb/map/liveries/B738_NTL.png new file mode 100644 index 000000000..106241f2f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NVA.png b/plugins/channelrx/demodadsb/map/liveries/B738_NVA.png new file mode 100644 index 000000000..c14fb49b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NWE.png b/plugins/channelrx/demodadsb/map/liveries/B738_NWE.png new file mode 100644 index 000000000..48bab6ed2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_NWS.png b/plugins/channelrx/demodadsb/map/liveries/B738_NWS.png new file mode 100644 index 000000000..ba1c84584 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B738_OAL_VA.png new file mode 100644 index 000000000..3871725ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_OAS.png b/plugins/channelrx/demodadsb/map/liveries/B738_OAS.png new file mode 100644 index 000000000..5aae76fc8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_OAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_OKA.png b/plugins/channelrx/demodadsb/map/liveries/B738_OKA.png new file mode 100644 index 000000000..c3af08b79 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_OKA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_OMA.png b/plugins/channelrx/demodadsb/map/liveries/B738_OMA.png new file mode 100644 index 000000000..b9c3ca8c5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_OMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_OMN.png b/plugins/channelrx/demodadsb/map/liveries/B738_OMN.png new file mode 100644 index 000000000..91ec0bd7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_OMN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ORB.png b/plugins/channelrx/demodadsb/map/liveries/B738_ORB.png new file mode 100644 index 000000000..2a584033c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ORB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_OVA.png b/plugins/channelrx/demodadsb/map/liveries/B738_OVA.png new file mode 100644 index 000000000..815cb0bf8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_OVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PAA.png b/plugins/channelrx/demodadsb/map/liveries/B738_PAA.png new file mode 100644 index 000000000..d7d33b170 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PBD_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_PBD_SSW.png new file mode 100644 index 000000000..63b1aad68 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PBD_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PBN.png b/plugins/channelrx/demodadsb/map/liveries/B738_PBN.png new file mode 100644 index 000000000..27e59b040 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PBN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PFF.png b/plugins/channelrx/demodadsb/map/liveries/B738_PFF.png new file mode 100644 index 000000000..6e2f66ea4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PGT.png b/plugins/channelrx/demodadsb/map/liveries/B738_PGT.png new file mode 100644 index 000000000..80beb793c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PGT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PLX.png b/plugins/channelrx/demodadsb/map/liveries/B738_PLX.png new file mode 100644 index 000000000..df4e38f99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PRI.png b/plugins/channelrx/demodadsb/map/liveries/B738_PRI.png new file mode 100644 index 000000000..e8fb14814 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PRI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PRY.png b/plugins/channelrx/demodadsb/map/liveries/B738_PRY.png new file mode 100644 index 000000000..ad3ced998 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PRY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PTI.png b/plugins/channelrx/demodadsb/map/liveries/B738_PTI.png new file mode 100644 index 000000000..a37908961 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_PVI.png b/plugins/channelrx/demodadsb/map/liveries/B738_PVI.png new file mode 100644 index 000000000..35f3af213 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_PVI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_QFA.png b/plugins/channelrx/demodadsb/map/liveries/B738_QFA.png new file mode 100644 index 000000000..3433ff1a7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_QTR.png b/plugins/channelrx/demodadsb/map/liveries/B738_QTR.png new file mode 100644 index 000000000..eb593080f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RAA.png b/plugins/channelrx/demodadsb/map/liveries/B738_RAA.png new file mode 100644 index 000000000..ce666c3ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B738_RAM.png new file mode 100644 index 000000000..17a1edc18 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RAM_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_RAM_NC.png new file mode 100644 index 000000000..27c025465 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RAM_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RBY.png b/plugins/channelrx/demodadsb/map/liveries/B738_RBY.png new file mode 100644 index 000000000..67468c668 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RBY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_REB.png b/plugins/channelrx/demodadsb/map/liveries/B738_REB.png new file mode 100644 index 000000000..40c505651 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_REB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_REU.png b/plugins/channelrx/demodadsb/map/liveries/B738_REU.png new file mode 100644 index 000000000..e26e5fc35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_REU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_REX.png b/plugins/channelrx/demodadsb/map/liveries/B738_REX.png new file mode 100644 index 000000000..b8effb738 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_REX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RLH.png b/plugins/channelrx/demodadsb/map/liveries/B738_RLH.png new file mode 100644 index 000000000..af8070b57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_ROT.png b/plugins/channelrx/demodadsb/map/liveries/B738_ROT.png new file mode 100644 index 000000000..cae4c0f75 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_ROT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RPB.png b/plugins/channelrx/demodadsb/map/liveries/B738_RPB.png new file mode 100644 index 000000000..4379613a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RPB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RRE.png b/plugins/channelrx/demodadsb/map/liveries/B738_RRE.png new file mode 100644 index 000000000..e20b50ad4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RSF.png b/plugins/channelrx/demodadsb/map/liveries/B738_RSF.png new file mode 100644 index 000000000..329f6c186 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RSF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RUK.png b/plugins/channelrx/demodadsb/map/liveries/B738_RUK.png new file mode 100644 index 000000000..04913dfbe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RXA.png b/plugins/channelrx/demodadsb/map/liveries/B738_RXA.png new file mode 100644 index 000000000..c5d51d03e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RYR.png b/plugins/channelrx/demodadsb/map/liveries/B738_RYR.png new file mode 100644 index 000000000..afcd4db13 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RYR_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_RYR_SSW.png new file mode 100644 index 000000000..c82b2543d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RYR_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_RYS.png b/plugins/channelrx/demodadsb/map/liveries/B738_RYS.png new file mode 100644 index 000000000..6cb85629a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_RYS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SAA.png b/plugins/channelrx/demodadsb/map/liveries/B738_SAA.png new file mode 100644 index 000000000..ae35606a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SAS.png b/plugins/channelrx/demodadsb/map/liveries/B738_SAS.png new file mode 100644 index 000000000..8f3a397d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SBI.png b/plugins/channelrx/demodadsb/map/liveries/B738_SBI.png new file mode 100644 index 000000000..62f3045cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SBI_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_SBI_NC.png new file mode 100644 index 000000000..67b7683f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SBI_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SCO.png b/plugins/channelrx/demodadsb/map/liveries/B738_SCO.png new file mode 100644 index 000000000..3789996e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SCX.png b/plugins/channelrx/demodadsb/map/liveries/B738_SCX.png new file mode 100644 index 000000000..1cd47e2da Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SCX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SCX_NCWL.png b/plugins/channelrx/demodadsb/map/liveries/B738_SCX_NCWL.png new file mode 100644 index 000000000..b8eafccdb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SCX_NCWL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SDM.png b/plugins/channelrx/demodadsb/map/liveries/B738_SDM.png new file mode 100644 index 000000000..e9386ef04 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SEJ.png b/plugins/channelrx/demodadsb/map/liveries/B738_SEJ.png new file mode 100644 index 000000000..6679ede98 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SEP.png b/plugins/channelrx/demodadsb/map/liveries/B738_SEP.png new file mode 100644 index 000000000..11099fbc9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SEP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SEU.png b/plugins/channelrx/demodadsb/map/liveries/B738_SEU.png new file mode 100644 index 000000000..2275613fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SEU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR.png new file mode 100644 index 000000000..113211a86 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ALBINO.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ALBINO.png new file mode 100644 index 000000000..593dc43ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ALBINO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_OC.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_OC.png new file mode 100644 index 000000000..47f6c7e91 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_SSW.png new file mode 100644 index 000000000..b2fcf1183 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-FGC.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-FGC.png new file mode 100644 index 000000000..0ad989272 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-FGC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJO.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJO.png new file mode 100644 index 000000000..2e6cdcd46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJU.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJU.png new file mode 100644 index 000000000..e0b5db734 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJV.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJV.png new file mode 100644 index 000000000..0ceecb76b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-SJV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-ZWO.png b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-ZWO.png new file mode 100644 index 000000000..58eaa1ed6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SFR_ZS-ZWO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SGA.png b/plugins/channelrx/demodadsb/map/liveries/B738_SGA.png new file mode 100644 index 000000000..f2cf3d04d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SGX.png b/plugins/channelrx/demodadsb/map/liveries/B738_SGX.png new file mode 100644 index 000000000..8f8f655ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SGX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SHY.png b/plugins/channelrx/demodadsb/map/liveries/B738_SHY.png new file mode 100644 index 000000000..255d7a4d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B738_SIA.png new file mode 100644 index 000000000..3f9fe32a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SJO.png b/plugins/channelrx/demodadsb/map/liveries/B738_SJO.png new file mode 100644 index 000000000..873771b23 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SJO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SJY.png b/plugins/channelrx/demodadsb/map/liveries/B738_SJY.png new file mode 100644 index 000000000..157c62833 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SJY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SKK.png b/plugins/channelrx/demodadsb/map/liveries/B738_SKK.png new file mode 100644 index 000000000..6ea0486cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SKS.png b/plugins/channelrx/demodadsb/map/liveries/B738_SKS.png new file mode 100644 index 000000000..012d8491e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SKY.png b/plugins/channelrx/demodadsb/map/liveries/B738_SKY.png new file mode 100644 index 000000000..01ee1ffd5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SMD.png b/plugins/channelrx/demodadsb/map/liveries/B738_SMD.png new file mode 100644 index 000000000..915010675 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SMD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SMR.png b/plugins/channelrx/demodadsb/map/liveries/B738_SMR.png new file mode 100644 index 000000000..4c7554f2d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SMY.png b/plugins/channelrx/demodadsb/map/liveries/B738_SMY.png new file mode 100644 index 000000000..92a89c91c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SMY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SNJ.png b/plugins/channelrx/demodadsb/map/liveries/B738_SNJ.png new file mode 100644 index 000000000..98b558474 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SNJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SOL.png b/plugins/channelrx/demodadsb/map/liveries/B738_SOL.png new file mode 100644 index 000000000..a438defe2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SOL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SPL.png b/plugins/channelrx/demodadsb/map/liveries/B738_SPL.png new file mode 100644 index 000000000..035429096 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SPL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SQP.png b/plugins/channelrx/demodadsb/map/liveries/B738_SQP.png new file mode 100644 index 000000000..45c51982c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SQP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_STH.png b/plugins/channelrx/demodadsb/map/liveries/B738_STH.png new file mode 100644 index 000000000..4edba6fab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_STH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SUN.png b/plugins/channelrx/demodadsb/map/liveries/B738_SUN.png new file mode 100644 index 000000000..9cc8447a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWA.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWA.png new file mode 100644 index 000000000..348057c44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWA_LONE_STAR_ONE.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_LONE_STAR_ONE.png new file mode 100644 index 000000000..a5c28b413 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_LONE_STAR_ONE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWA_NEW_MEXICO_ONE.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_NEW_MEXICO_ONE.png new file mode 100644 index 000000000..4ea8423f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_NEW_MEXICO_ONE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWA_TENNESSEE_ONE.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_TENNESSEE_ONE.png new file mode 100644 index 000000000..68d612d0f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_TENNESSEE_ONE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWA_TRIPLE_CROWN_ONE.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_TRIPLE_CROWN_ONE.png new file mode 100644 index 000000000..aede1b640 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWA_TRIPLE_CROWN_ONE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWG.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWG.png new file mode 100644 index 000000000..12b1c541c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWI.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWI.png new file mode 100644 index 000000000..155e9061a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SWV.png b/plugins/channelrx/demodadsb/map/liveries/B738_SWV.png new file mode 100644 index 000000000..f69d014c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SWV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SXD.png b/plugins/channelrx/demodadsb/map/liveries/B738_SXD.png new file mode 100644 index 000000000..ec8058bf4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SXD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SXS.png b/plugins/channelrx/demodadsb/map/liveries/B738_SXS.png new file mode 100644 index 000000000..e9854eb65 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SYL.png b/plugins/channelrx/demodadsb/map/liveries/B738_SYL.png new file mode 100644 index 000000000..82cf36d85 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SYL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SYR.png b/plugins/channelrx/demodadsb/map/liveries/B738_SYR.png new file mode 100644 index 000000000..42e7bd64f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_SYT.png b/plugins/channelrx/demodadsb/map/liveries/B738_SYT.png new file mode 100644 index 000000000..868af6d97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_SYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TBA.png b/plugins/channelrx/demodadsb/map/liveries/B738_TBA.png new file mode 100644 index 000000000..bdaf9e21b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TCV.png b/plugins/channelrx/demodadsb/map/liveries/B738_TCV.png new file mode 100644 index 000000000..6e86e79cd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TEF.png b/plugins/channelrx/demodadsb/map/liveries/B738_TEF.png new file mode 100644 index 000000000..371e41560 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/B738_TEJ.png new file mode 100644 index 000000000..3b9186abb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TEJ2.png b/plugins/channelrx/demodadsb/map/liveries/B738_TEJ2.png new file mode 100644 index 000000000..853c2a15e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TEJ2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TFL.png b/plugins/channelrx/demodadsb/map/liveries/B738_TFL.png new file mode 100644 index 000000000..da0af846b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TGZ_30_YEARS.png b/plugins/channelrx/demodadsb/map/liveries/B738_TGZ_30_YEARS.png new file mode 100644 index 000000000..3300b12b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TGZ_30_YEARS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TGZ_AIRZENA.png b/plugins/channelrx/demodadsb/map/liveries/B738_TGZ_AIRZENA.png new file mode 100644 index 000000000..0ca5a61d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TGZ_AIRZENA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_THY.png b/plugins/channelrx/demodadsb/map/liveries/B738_THY.png new file mode 100644 index 000000000..26570aff8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TKJ.png b/plugins/channelrx/demodadsb/map/liveries/B738_TKJ.png new file mode 100644 index 000000000..9ba4b6931 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TKJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TKY.png b/plugins/channelrx/demodadsb/map/liveries/B738_TKY.png new file mode 100644 index 000000000..da288d218 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TLM.png b/plugins/channelrx/demodadsb/map/liveries/B738_TLM.png new file mode 100644 index 000000000..552158a18 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TLP.png b/plugins/channelrx/demodadsb/map/liveries/B738_TLP.png new file mode 100644 index 000000000..cc3d973e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TLP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TOM.png b/plugins/channelrx/demodadsb/map/liveries/B738_TOM.png new file mode 100644 index 000000000..e507a5a8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TPK.png b/plugins/channelrx/demodadsb/map/liveries/B738_TPK.png new file mode 100644 index 000000000..01fe25b5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TPK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TQQ.png b/plugins/channelrx/demodadsb/map/liveries/B738_TQQ.png new file mode 100644 index 000000000..4624bf605 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TQQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TRA.png b/plugins/channelrx/demodadsb/map/liveries/B738_TRA.png new file mode 100644 index 000000000..e89a584d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TRI.png b/plugins/channelrx/demodadsb/map/liveries/B738_TRI.png new file mode 100644 index 000000000..d5a85c636 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TRI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TSC.png b/plugins/channelrx/demodadsb/map/liveries/B738_TSC.png new file mode 100644 index 000000000..08d831bbe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B738_TSO.png new file mode 100644 index 000000000..8d78a0304 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TTL.png b/plugins/channelrx/demodadsb/map/liveries/B738_TTL.png new file mode 100644 index 000000000..cc4c2800e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TUA.png b/plugins/channelrx/demodadsb/map/liveries/B738_TUA.png new file mode 100644 index 000000000..33151f9fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TUI.png b/plugins/channelrx/demodadsb/map/liveries/B738_TUI.png new file mode 100644 index 000000000..992b0f52a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TUI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TUI_SSW_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_TUI_SSW_NC.png new file mode 100644 index 000000000..96b898245 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TUI_SSW_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TVF.png b/plugins/channelrx/demodadsb/map/liveries/B738_TVF.png new file mode 100644 index 000000000..c98b9872f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TVF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TVL.png b/plugins/channelrx/demodadsb/map/liveries/B738_TVL.png new file mode 100644 index 000000000..a8a42cef3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TVL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TVP.png b/plugins/channelrx/demodadsb/map/liveries/B738_TVP.png new file mode 100644 index 000000000..6715beb46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TVP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TVS.png b/plugins/channelrx/demodadsb/map/liveries/B738_TVS.png new file mode 100644 index 000000000..7cc664071 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TVS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TVS_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_TVS_NC.png new file mode 100644 index 000000000..b318b4b9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TVS_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TVS_TSOC.png b/plugins/channelrx/demodadsb/map/liveries/B738_TVS_TSOC.png new file mode 100644 index 000000000..bcfd3a447 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TVS_TSOC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TWB.png b/plugins/channelrx/demodadsb/map/liveries/B738_TWB.png new file mode 100644 index 000000000..82550aa06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TWB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TWI.png b/plugins/channelrx/demodadsb/map/liveries/B738_TWI.png new file mode 100644 index 000000000..11a358b35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_TYA.png b/plugins/channelrx/demodadsb/map/liveries/B738_TYA.png new file mode 100644 index 000000000..2ee71537a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_TYA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B738_UAL.png new file mode 100644 index 000000000..b14907840 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UAL_NC.png b/plugins/channelrx/demodadsb/map/liveries/B738_UAL_NC.png new file mode 100644 index 000000000..3f2fb3056 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UAL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UBG.png b/plugins/channelrx/demodadsb/map/liveries/B738_UBG.png new file mode 100644 index 000000000..a3f1cfa46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UBG_BBN.png b/plugins/channelrx/demodadsb/map/liveries/B738_UBG_BBN.png new file mode 100644 index 000000000..477ae8315 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UBG_BBN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UBG_WHITE.png b/plugins/channelrx/demodadsb/map/liveries/B738_UBG_WHITE.png new file mode 100644 index 000000000..55c52a5ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UBG_WHITE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B738_UKV.png new file mode 100644 index 000000000..9f9b8cb8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UTA.png b/plugins/channelrx/demodadsb/map/liveries/B738_UTA.png new file mode 100644 index 000000000..d47aee5fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_UTN.png b/plugins/channelrx/demodadsb/map/liveries/B738_UTN.png new file mode 100644 index 000000000..c0f6f487c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_UTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VAE.png b/plugins/channelrx/demodadsb/map/liveries/B738_VAE.png new file mode 100644 index 000000000..3c8f99a14 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VAI.png b/plugins/channelrx/demodadsb/map/liveries/B738_VAI.png new file mode 100644 index 000000000..dc7c38a76 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VCP.png b/plugins/channelrx/demodadsb/map/liveries/B738_VCP.png new file mode 100644 index 000000000..6ace4932d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VIK.png b/plugins/channelrx/demodadsb/map/liveries/B738_VIK.png new file mode 100644 index 000000000..5ac453538 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VIK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VIP.png b/plugins/channelrx/demodadsb/map/liveries/B738_VIP.png new file mode 100644 index 000000000..ee3137606 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VIP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VLC.png b/plugins/channelrx/demodadsb/map/liveries/B738_VLC.png new file mode 100644 index 000000000..47488bfd9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VOZ.png b/plugins/channelrx/demodadsb/map/liveries/B738_VOZ.png new file mode 100644 index 000000000..a0ff5b05e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VOZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VPA.png b/plugins/channelrx/demodadsb/map/liveries/B738_VPA.png new file mode 100644 index 000000000..ee3137606 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VRN.png b/plugins/channelrx/demodadsb/map/liveries/B738_VRN.png new file mode 100644 index 000000000..27338f866 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VRN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VSP.png b/plugins/channelrx/demodadsb/map/liveries/B738_VSP.png new file mode 100644 index 000000000..b57533f7f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VSV.png b/plugins/channelrx/demodadsb/map/liveries/B738_VSV.png new file mode 100644 index 000000000..9e9786326 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VSV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VTI.png b/plugins/channelrx/demodadsb/map/liveries/B738_VTI.png new file mode 100644 index 000000000..793958965 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VXP_S.png b/plugins/channelrx/demodadsb/map/liveries/B738_VXP_S.png new file mode 100644 index 000000000..94ef1e9bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VXP_S.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_VXP_W.png b/plugins/channelrx/demodadsb/map/liveries/B738_VXP_W.png new file mode 100644 index 000000000..fd77ac7b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_VXP_W.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B738_WAT.png new file mode 100644 index 000000000..3b86b1e53 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_WEV.png b/plugins/channelrx/demodadsb/map/liveries/B738_WEV.png new file mode 100644 index 000000000..5e129c433 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_WEV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_WJA.png b/plugins/channelrx/demodadsb/map/liveries/B738_WJA.png new file mode 100644 index 000000000..a2c734fb1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_WJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_WJA_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_WJA_SSW.png new file mode 100644 index 000000000..9276dafc3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_WJA_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_WSW.png b/plugins/channelrx/demodadsb/map/liveries/B738_WSW.png new file mode 100644 index 000000000..d110fcaf5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_WSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_WTB.png b/plugins/channelrx/demodadsb/map/liveries/B738_WTB.png new file mode 100644 index 000000000..c72e5b078 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_WTB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_XAS.png b/plugins/channelrx/demodadsb/map/liveries/B738_XAS.png new file mode 100644 index 000000000..677688364 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_XAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_XSN.png b/plugins/channelrx/demodadsb/map/liveries/B738_XSN.png new file mode 100644 index 000000000..1b35f4a9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B738_YZR.png b/plugins/channelrx/demodadsb/map/liveries/B738_YZR.png new file mode 100644 index 000000000..a91554473 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B738_YZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739.png b/plugins/channelrx/demodadsb/map/liveries/B739.png new file mode 100644 index 000000000..96af020fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_AMV.png b/plugins/channelrx/demodadsb/map/liveries/B739_AMV.png new file mode 100644 index 000000000..2e97f5f06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_AMV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_ASA.png b/plugins/channelrx/demodadsb/map/liveries/B739_ASA.png new file mode 100644 index 000000000..caa138c82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_ASA_SSWNC.png b/plugins/channelrx/demodadsb/map/liveries/B739_ASA_SSWNC.png new file mode 100644 index 000000000..7dd376b5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_ASA_SSWNC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_AUI.png b/plugins/channelrx/demodadsb/map/liveries/B739_AUI.png new file mode 100644 index 000000000..0681442ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_AUI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_AZV.png b/plugins/channelrx/demodadsb/map/liveries/B739_AZV.png new file mode 100644 index 000000000..4949629c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_AZV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_BTK.png b/plugins/channelrx/demodadsb/map/liveries/B739_BTK.png new file mode 100644 index 000000000..1d02e844f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_BTK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B739_BVX.png new file mode 100644 index 000000000..e808f9aa9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_COA.png b/plugins/channelrx/demodadsb/map/liveries/B739_COA.png new file mode 100644 index 000000000..ee947ac08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_COA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_CSZ.png b/plugins/channelrx/demodadsb/map/liveries/B739_CSZ.png new file mode 100644 index 000000000..07c72bd86 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_CSZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B739_CXA_VA.png new file mode 100644 index 000000000..95da6d83b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B739_DAL.png new file mode 100644 index 000000000..676b47bde Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_DAL_SSW.png b/plugins/channelrx/demodadsb/map/liveries/B739_DAL_SSW.png new file mode 100644 index 000000000..bf1c71477 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_DAL_SSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_DAL_WL.png b/plugins/channelrx/demodadsb/map/liveries/B739_DAL_WL.png new file mode 100644 index 000000000..10775d557 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_DAL_WL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B739_ELY.png new file mode 100644 index 000000000..ac5f308a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B739_FBV.png new file mode 100644 index 000000000..47ef13d69 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_JAI.png b/plugins/channelrx/demodadsb/map/liveries/B739_JAI.png new file mode 100644 index 000000000..caa138c82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_JAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B739_KAL.png new file mode 100644 index 000000000..ed5f184ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_KAR.png b/plugins/channelrx/demodadsb/map/liveries/B739_KAR.png new file mode 100644 index 000000000..b1d78fd36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_KAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B739_KLM.png new file mode 100644 index 000000000..5b9d0af64 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B739_LHA_VA.png new file mode 100644 index 000000000..54d07a5c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_LNI.png b/plugins/channelrx/demodadsb/map/liveries/B739_LNI.png new file mode 100644 index 000000000..819ffecd5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_LNI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B739_LNR.png new file mode 100644 index 000000000..e34279c2b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_MQT.png b/plugins/channelrx/demodadsb/map/liveries/B739_MQT.png new file mode 100644 index 000000000..d866068d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_MSE.png b/plugins/channelrx/demodadsb/map/liveries/B739_MSE.png new file mode 100644 index 000000000..917c3d421 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_MSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_NTL.png b/plugins/channelrx/demodadsb/map/liveries/B739_NTL.png new file mode 100644 index 000000000..6579be32c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B739_OAL_VA.png new file mode 100644 index 000000000..dba532f5f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_OKA.png b/plugins/channelrx/demodadsb/map/liveries/B739_OKA.png new file mode 100644 index 000000000..a1fd9dbd8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_OKA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_OMA.png b/plugins/channelrx/demodadsb/map/liveries/B739_OMA.png new file mode 100644 index 000000000..3b1a258e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_OMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_PFF.png b/plugins/channelrx/demodadsb/map/liveries/B739_PFF.png new file mode 100644 index 000000000..3178d0adc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_SDM.png b/plugins/channelrx/demodadsb/map/liveries/B739_SDM.png new file mode 100644 index 000000000..f6cb9b0a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_SEJ.png b/plugins/channelrx/demodadsb/map/liveries/B739_SEJ.png new file mode 100644 index 000000000..fa29bdb4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_SEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_SMR.png b/plugins/channelrx/demodadsb/map/liveries/B739_SMR.png new file mode 100644 index 000000000..e3e180634 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_SMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_TEF.png b/plugins/channelrx/demodadsb/map/liveries/B739_TEF.png new file mode 100644 index 000000000..0dc880ebd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_TEF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_THY.png b/plugins/channelrx/demodadsb/map/liveries/B739_THY.png new file mode 100644 index 000000000..29c80f817 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_TLM.png b/plugins/channelrx/demodadsb/map/liveries/B739_TLM.png new file mode 100644 index 000000000..854b1dc34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_TLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_TVS_SKYTRAVEL.png b/plugins/channelrx/demodadsb/map/liveries/B739_TVS_SKYTRAVEL.png new file mode 100644 index 000000000..a53afa7c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_TVS_SKYTRAVEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B739_UAL.png new file mode 100644 index 000000000..602c3d1bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_UAL_SSWNC.png b/plugins/channelrx/demodadsb/map/liveries/B739_UAL_SSWNC.png new file mode 100644 index 000000000..333eaf013 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_UAL_SSWNC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_UTN.png b/plugins/channelrx/demodadsb/map/liveries/B739_UTN.png new file mode 100644 index 000000000..5f279282d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_UTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_VAI.png b/plugins/channelrx/demodadsb/map/liveries/B739_VAI.png new file mode 100644 index 000000000..c19dc1c70 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_VAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_VCP.png b/plugins/channelrx/demodadsb/map/liveries/B739_VCP.png new file mode 100644 index 000000000..16d52a108 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B739_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B739_WAT.png new file mode 100644 index 000000000..8aad7eb46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B739_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B73X.png b/plugins/channelrx/demodadsb/map/liveries/B73X.png new file mode 100644 index 000000000..be03bcd46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B73X.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B73X_SKY.png b/plugins/channelrx/demodadsb/map/liveries/B73X_SKY.png new file mode 100644 index 000000000..0b8882428 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B73X_SKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B73X_SNJ.png b/plugins/channelrx/demodadsb/map/liveries/B73X_SNJ.png new file mode 100644 index 000000000..a0cd7d643 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B73X_SNJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744.png b/plugins/channelrx/demodadsb/map/liveries/B744.png new file mode 100644 index 000000000..7290a5f42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F.png b/plugins/channelrx/demodadsb/map/liveries/B744F.png new file mode 100644 index 000000000..c83e68e6f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_AAR.png b/plugins/channelrx/demodadsb/map/liveries/B744F_AAR.png new file mode 100644 index 000000000..71207f030 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ABD_Magma.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ABD_Magma.png new file mode 100644 index 000000000..cbb6e7822 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ABD_Magma.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ABW.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ABW.png new file mode 100644 index 000000000..0cb3f4825 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ABW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ACP.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ACP.png new file mode 100644 index 000000000..3d3d4c1fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ACP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ADZ.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ADZ.png new file mode 100644 index 000000000..248d0e526 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ADZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ATG.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ATG.png new file mode 100644 index 000000000..a00632164 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ATG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_AZG.png b/plugins/channelrx/demodadsb/map/liveries/B744F_AZG.png new file mode 100644 index 000000000..bb56560ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_AZG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_CAL.png b/plugins/channelrx/demodadsb/map/liveries/B744F_CAL.png new file mode 100644 index 000000000..0203a6fd2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_CHG.png b/plugins/channelrx/demodadsb/map/liveries/B744F_CHG.png new file mode 100644 index 000000000..b6fb5c2db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_CHG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_CKS.png b/plugins/channelrx/demodadsb/map/liveries/B744F_CKS.png new file mode 100644 index 000000000..c6a4c1d2a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_CKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_CLU.png b/plugins/channelrx/demodadsb/map/liveries/B744F_CLU.png new file mode 100644 index 000000000..966274f83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_CLU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_CLX.png b/plugins/channelrx/demodadsb/map/liveries/B744F_CLX.png new file mode 100644 index 000000000..38137977f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_CLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_CPA.png b/plugins/channelrx/demodadsb/map/liveries/B744F_CPA.png new file mode 100644 index 000000000..8ae3dd341 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B744F_GTI.png new file mode 100644 index 000000000..05fbd5f6c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/B744F_HAZ.png new file mode 100644 index 000000000..4e64ae4ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_HGO.png b/plugins/channelrx/demodadsb/map/liveries/B744F_HGO.png new file mode 100644 index 000000000..63c6bed6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_HGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ICL.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ICL.png new file mode 100644 index 000000000..5b69d065c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ICL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_ICV.png b/plugins/channelrx/demodadsb/map/liveries/B744F_ICV.png new file mode 100644 index 000000000..5216106fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_ICV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B744F_KAL.png new file mode 100644 index 000000000..424cc8879 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_KYE.png b/plugins/channelrx/demodadsb/map/liveries/B744F_KYE.png new file mode 100644 index 000000000..a9c30410a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_KYE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_MPH.png b/plugins/channelrx/demodadsb/map/liveries/B744F_MPH.png new file mode 100644 index 000000000..827158f13 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_MPH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_MPH_KLMCARGO.png b/plugins/channelrx/demodadsb/map/liveries/B744F_MPH_KLMCARGO.png new file mode 100644 index 000000000..f015bb7a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_MPH_KLMCARGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_NCR.png b/plugins/channelrx/demodadsb/map/liveries/B744F_NCR.png new file mode 100644 index 000000000..3cd46c18a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_NCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_NCR_White.png b/plugins/channelrx/demodadsb/map/liveries/B744F_NCR_White.png new file mode 100644 index 000000000..4d68b2caa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_NCR_White.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B744F_OAL_VA.png new file mode 100644 index 000000000..29d0fa839 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_PAC.png b/plugins/channelrx/demodadsb/map/liveries/B744F_PAC.png new file mode 100644 index 000000000..dd6278894 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_PAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_PLC.png b/plugins/channelrx/demodadsb/map/liveries/B744F_PLC.png new file mode 100644 index 000000000..c1a445cf5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_RCR.png b/plugins/channelrx/demodadsb/map/liveries/B744F_RCR.png new file mode 100644 index 000000000..9973cc769 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_RCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_RUN.png b/plugins/channelrx/demodadsb/map/liveries/B744F_RUN.png new file mode 100644 index 000000000..d935f4909 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_RUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B744F_SIA.png new file mode 100644 index 000000000..c43cb5a2a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B744F_SVA.png new file mode 100644 index 000000000..4a2428120 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_TAY.png b/plugins/channelrx/demodadsb/map/liveries/B744F_TAY.png new file mode 100644 index 000000000..5e1c94f51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_TAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B744F_UKV.png new file mode 100644 index 000000000..85be671de Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744F_UPS.png b/plugins/channelrx/demodadsb/map/liveries/B744F_UPS.png new file mode 100644 index 000000000..9ea0855ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744F_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AAA.png b/plugins/channelrx/demodadsb/map/liveries/B744_AAA.png new file mode 100644 index 000000000..4c2313259 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_AAL.png new file mode 100644 index 000000000..1386eedae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AAR.png b/plugins/channelrx/demodadsb/map/liveries/B744_AAR.png new file mode 100644 index 000000000..b8fef9652 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ABN.png b/plugins/channelrx/demodadsb/map/liveries/B744_ABN.png new file mode 100644 index 000000000..ad20d8dca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ABN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ABZ.png b/plugins/channelrx/demodadsb/map/liveries/B744_ABZ.png new file mode 100644 index 000000000..4ee7935e5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ABZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B744_ACA.png new file mode 100644 index 000000000..c0a06ded0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AFF.png b/plugins/channelrx/demodadsb/map/liveries/B744_AFF.png new file mode 100644 index 000000000..86cf77431 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AFR.png b/plugins/channelrx/demodadsb/map/liveries/B744_AFR.png new file mode 100644 index 000000000..0af4a7b71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AIC.png b/plugins/channelrx/demodadsb/map/liveries/B744_AIC.png new file mode 100644 index 000000000..4f770a740 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ALZ.png b/plugins/channelrx/demodadsb/map/liveries/B744_ALZ.png new file mode 100644 index 000000000..0d5481f24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ALZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B744_ANA.png new file mode 100644 index 000000000..6db25e8fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/B744_ANZ.png new file mode 100644 index 000000000..13c4c4e94 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ARG.png b/plugins/channelrx/demodadsb/map/liveries/B744_ARG.png new file mode 100644 index 000000000..65e13381e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ARW.png b/plugins/channelrx/demodadsb/map/liveries/B744_ARW.png new file mode 100644 index 000000000..eaace974d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ARW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AUH.png b/plugins/channelrx/demodadsb/map/liveries/B744_AUH.png new file mode 100644 index 000000000..b99ea0514 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AUH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AUZ.png b/plugins/channelrx/demodadsb/map/liveries/B744_AUZ.png new file mode 100644 index 000000000..dd7b1465c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AUZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_AXN.png b/plugins/channelrx/demodadsb/map/liveries/B744_AXN.png new file mode 100644 index 000000000..8b5d85383 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_AXN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B744_BAW.png new file mode 100644 index 000000000..a267cdeed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_BHA.png b/plugins/channelrx/demodadsb/map/liveries/B744_BHA.png new file mode 100644 index 000000000..206e7f284 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_BHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_BUH.png b/plugins/channelrx/demodadsb/map/liveries/B744_BUH.png new file mode 100644 index 000000000..17fd3899a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_BUH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_CAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_CAL.png new file mode 100644 index 000000000..5f90710e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B744_CCA.png new file mode 100644 index 000000000..de6779121 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_CNS.png b/plugins/channelrx/demodadsb/map/liveries/B744_CNS.png new file mode 100644 index 000000000..f1adc4723 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_CNS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_CPA.png b/plugins/channelrx/demodadsb/map/liveries/B744_CPA.png new file mode 100644 index 000000000..2b6119f38 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_CRL.png b/plugins/channelrx/demodadsb/map/liveries/B744_CRL.png new file mode 100644 index 000000000..5d99f7dc8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_CRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_DAL.png new file mode 100644 index 000000000..be883c97a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_DLH.png b/plugins/channelrx/demodadsb/map/liveries/B744_DLH.png new file mode 100644 index 000000000..fa0e23a1d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_DUB.png b/plugins/channelrx/demodadsb/map/liveries/B744_DUB.png new file mode 100644 index 000000000..2a284dd10 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_DUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B744_ELY.png new file mode 100644 index 000000000..e6a4ddca8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_EMI.png b/plugins/channelrx/demodadsb/map/liveries/B744_EMI.png new file mode 100644 index 000000000..25bc31419 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_EMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_EMR.png b/plugins/channelrx/demodadsb/map/liveries/B744_EMR.png new file mode 100644 index 000000000..e6beb34b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_EMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_EUK.png b/plugins/channelrx/demodadsb/map/liveries/B744_EUK.png new file mode 100644 index 000000000..63d5c91eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_EUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_EVA.png b/plugins/channelrx/demodadsb/map/liveries/B744_EVA.png new file mode 100644 index 000000000..94d09f70a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_FLO.png b/plugins/channelrx/demodadsb/map/liveries/B744_FLO.png new file mode 100644 index 000000000..14d3d23af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_FLO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_FMT.png b/plugins/channelrx/demodadsb/map/liveries/B744_FMT.png new file mode 100644 index 000000000..e791ac12e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_FMT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_FUN.png b/plugins/channelrx/demodadsb/map/liveries/B744_FUN.png new file mode 100644 index 000000000..4b2a43d87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_FUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_GAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_GAL.png new file mode 100644 index 000000000..7662afa61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_GAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_GIA.png b/plugins/channelrx/demodadsb/map/liveries/B744_GIA.png new file mode 100644 index 000000000..94af42cdd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_GLL.png b/plugins/channelrx/demodadsb/map/liveries/B744_GLL.png new file mode 100644 index 000000000..d56c4af7a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_GLL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B744_GTI.png new file mode 100644 index 000000000..85e085185 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_IAW.png b/plugins/channelrx/demodadsb/map/liveries/B744_IAW.png new file mode 100644 index 000000000..e905e34e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_IRA.png b/plugins/channelrx/demodadsb/map/liveries/B744_IRA.png new file mode 100644 index 000000000..00e10b64e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_IRM.png b/plugins/channelrx/demodadsb/map/liveries/B744_IRM.png new file mode 100644 index 000000000..4b9f4cf87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_IRM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_JAL.png new file mode 100644 index 000000000..f220cabd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_JGO.png b/plugins/channelrx/demodadsb/map/liveries/B744_JGO.png new file mode 100644 index 000000000..298601c33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_JGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_KAC.png b/plugins/channelrx/demodadsb/map/liveries/B744_KAC.png new file mode 100644 index 000000000..06ffd6bde Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_KAL.png new file mode 100644 index 000000000..406358518 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B744_KLM.png new file mode 100644 index 000000000..7c66206a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_LNI.png b/plugins/channelrx/demodadsb/map/liveries/B744_LNI.png new file mode 100644 index 000000000..bb09c5649 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_LNI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_MAS.png b/plugins/channelrx/demodadsb/map/liveries/B744_MAS.png new file mode 100644 index 000000000..de230dbe2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_MHL.png b/plugins/channelrx/demodadsb/map/liveries/B744_MHL.png new file mode 100644 index 000000000..957c7a45d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_MHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_NWA.png b/plugins/channelrx/demodadsb/map/liveries/B744_NWA.png new file mode 100644 index 000000000..09bfbfee9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_PAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_PAL.png new file mode 100644 index 000000000..17b233633 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_PIA.png b/plugins/channelrx/demodadsb/map/liveries/B744_PIA.png new file mode 100644 index 000000000..0d5bbd75a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_PLM.png b/plugins/channelrx/demodadsb/map/liveries/B744_PLM.png new file mode 100644 index 000000000..51e6f4308 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_PLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_PNW.png b/plugins/channelrx/demodadsb/map/liveries/B744_PNW.png new file mode 100644 index 000000000..4b8237ff0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_PNW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_QFA.png b/plugins/channelrx/demodadsb/map/liveries/B744_QFA.png new file mode 100644 index 000000000..778611ae0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B744_RAM.png new file mode 100644 index 000000000..6d3e9eaa4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_RSU.png b/plugins/channelrx/demodadsb/map/liveries/B744_RSU.png new file mode 100644 index 000000000..fa81bdc60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_RSU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_RUN.png b/plugins/channelrx/demodadsb/map/liveries/B744_RUN.png new file mode 100644 index 000000000..24c7de012 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_RUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SAA.png b/plugins/channelrx/demodadsb/map/liveries/B744_SAA.png new file mode 100644 index 000000000..46c4acb56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SEY.png b/plugins/channelrx/demodadsb/map/liveries/B744_SEY.png new file mode 100644 index 000000000..1fda31202 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B744_SIA.png new file mode 100644 index 000000000..a3780e499 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SUN.png b/plugins/channelrx/demodadsb/map/liveries/B744_SUN.png new file mode 100644 index 000000000..51c1fa72a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B744_SVA.png new file mode 100644 index 000000000..a3805a715 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SWI.png b/plugins/channelrx/demodadsb/map/liveries/B744_SWI.png new file mode 100644 index 000000000..83614dc31 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_SYR.png b/plugins/channelrx/demodadsb/map/liveries/B744_SYR.png new file mode 100644 index 000000000..e48fb3b35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_SYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_THA.png b/plugins/channelrx/demodadsb/map/liveries/B744_THA.png new file mode 100644 index 000000000..d66a01ab8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B744_TSO.png new file mode 100644 index 000000000..67625adc5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B744_UAL.png new file mode 100644 index 000000000..edfd34b3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_VIR.png b/plugins/channelrx/demodadsb/map/liveries/B744_VIR.png new file mode 100644 index 000000000..e61d20110 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B744_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B744_WAT.png new file mode 100644 index 000000000..0c186cf37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B744_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748.png b/plugins/channelrx/demodadsb/map/liveries/B748.png new file mode 100644 index 000000000..154084d2c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F.png b/plugins/channelrx/demodadsb/map/liveries/B748F.png new file mode 100644 index 000000000..f0edb208e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_AAN.png b/plugins/channelrx/demodadsb/map/liveries/B748F_AAN.png new file mode 100644 index 000000000..ece617c22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_AAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_ABB.png b/plugins/channelrx/demodadsb/map/liveries/B748F_ABB.png new file mode 100644 index 000000000..115a245ca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_ABB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_AZG.png b/plugins/channelrx/demodadsb/map/liveries/B748F_AZG.png new file mode 100644 index 000000000..13a7dcec6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_AZG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B748F_BVX.png new file mode 100644 index 000000000..426a46738 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_CLX.png b/plugins/channelrx/demodadsb/map/liveries/B748F_CLX.png new file mode 100644 index 000000000..c1a6b9eb1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_CLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_CPA.png b/plugins/channelrx/demodadsb/map/liveries/B748F_CPA.png new file mode 100644 index 000000000..332461a0c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B748F_CXA_VA.png new file mode 100644 index 000000000..07a748849 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B748F_GTI.png new file mode 100644 index 000000000..94c77bcb4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_NCA.png b/plugins/channelrx/demodadsb/map/liveries/B748F_NCA.png new file mode 100644 index 000000000..5180d79f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_NCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_PAC.png b/plugins/channelrx/demodadsb/map/liveries/B748F_PAC.png new file mode 100644 index 000000000..70dde1fa2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_PAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_QTR_CARGO.png b/plugins/channelrx/demodadsb/map/liveries/B748F_QTR_CARGO.png new file mode 100644 index 000000000..793e3d37d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_QTR_CARGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B748F_UKV.png new file mode 100644 index 000000000..091277fcc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748F_UPS.png b/plugins/channelrx/demodadsb/map/liveries/B748F_UPS.png new file mode 100644 index 000000000..a189686ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748F_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_AAN.png b/plugins/channelrx/demodadsb/map/liveries/B748_AAN.png new file mode 100644 index 000000000..89009de09 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_AAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B748_BAW.png new file mode 100644 index 000000000..3f76e8a6e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B748_BVX.png new file mode 100644 index 000000000..b2b58dfd0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B748_CCA.png new file mode 100644 index 000000000..a4df84669 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_DLH_NC.png b/plugins/channelrx/demodadsb/map/liveries/B748_DLH_NC.png new file mode 100644 index 000000000..e3e0756ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_DLH_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_DLH_OC.png b/plugins/channelrx/demodadsb/map/liveries/B748_DLH_OC.png new file mode 100644 index 000000000..333465b37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_DLH_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B748_FBV.png new file mode 100644 index 000000000..44c7542fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B748_KAL.png new file mode 100644 index 000000000..5c3566bf1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B748_LHA_VA.png new file mode 100644 index 000000000..413620257 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B748_LNR.png new file mode 100644 index 000000000..a6b3fca68 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B748_OAL_VA.png new file mode 100644 index 000000000..f9de2ba72 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_PAA.png b/plugins/channelrx/demodadsb/map/liveries/B748_PAA.png new file mode 100644 index 000000000..06ce9b2cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_PAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_QAF_QATAR.png b/plugins/channelrx/demodadsb/map/liveries/B748_QAF_QATAR.png new file mode 100644 index 000000000..908dc45f4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_QAF_QATAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_QTR.png b/plugins/channelrx/demodadsb/map/liveries/B748_QTR.png new file mode 100644 index 000000000..908dc45f4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_SDM.png b/plugins/channelrx/demodadsb/map/liveries/B748_SDM.png new file mode 100644 index 000000000..fa24aaf6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_TKY.png b/plugins/channelrx/demodadsb/map/liveries/B748_TKY.png new file mode 100644 index 000000000..c8b54fe32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B748_TSO.png new file mode 100644 index 000000000..7c2305c3c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B748_UKV.png new file mode 100644 index 000000000..52002e1cd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_VCP.png b/plugins/channelrx/demodadsb/map/liveries/B748_VCP.png new file mode 100644 index 000000000..313a42499 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B748_WAT.png new file mode 100644 index 000000000..9e0ea04da Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B748_XSN.png b/plugins/channelrx/demodadsb/map/liveries/B748_XSN.png new file mode 100644 index 000000000..77bb9d01b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B748_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_AAR.png b/plugins/channelrx/demodadsb/map/liveries/B74F_AAR.png new file mode 100644 index 000000000..7bbcecd77 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_ABW.png b/plugins/channelrx/demodadsb/map/liveries/B74F_ABW.png new file mode 100644 index 000000000..f440b27e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_ABW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_AFR.png b/plugins/channelrx/demodadsb/map/liveries/B74F_AFR.png new file mode 100644 index 000000000..b8c8e8227 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_AZQ.png b/plugins/channelrx/demodadsb/map/liveries/B74F_AZQ.png new file mode 100644 index 000000000..772a27732 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_AZQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B74F_BAW.png new file mode 100644 index 000000000..fba348048 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_BBR.png b/plugins/channelrx/demodadsb/map/liveries/B74F_BBR.png new file mode 100644 index 000000000..6fd9437ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_BBR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_CAL.png b/plugins/channelrx/demodadsb/map/liveries/B74F_CAL.png new file mode 100644 index 000000000..87ddf5447 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B74F_CCA.png new file mode 100644 index 000000000..4c3022aa1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_CKK.png b/plugins/channelrx/demodadsb/map/liveries/B74F_CKK.png new file mode 100644 index 000000000..fbdcb5945 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_CKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_CKS.png b/plugins/channelrx/demodadsb/map/liveries/B74F_CKS.png new file mode 100644 index 000000000..e7191621f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_CKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_CLX.png b/plugins/channelrx/demodadsb/map/liveries/B74F_CLX.png new file mode 100644 index 000000000..7b250904f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_CLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B74F_CSN.png new file mode 100644 index 000000000..35f5960d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_DHK.png b/plugins/channelrx/demodadsb/map/liveries/B74F_DHK.png new file mode 100644 index 000000000..90b881a34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_DHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B74F_ELY.png new file mode 100644 index 000000000..0c00875b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_EVA.png b/plugins/channelrx/demodadsb/map/liveries/B74F_EVA.png new file mode 100644 index 000000000..bb862fda0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_GSS.png b/plugins/channelrx/demodadsb/map/liveries/B74F_GSS.png new file mode 100644 index 000000000..22728980a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_GSS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B74F_GTI.png new file mode 100644 index 000000000..dfd64ff08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_GWL.png b/plugins/channelrx/demodadsb/map/liveries/B74F_GWL.png new file mode 100644 index 000000000..3eda7d890 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_GWL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_ICL.png b/plugins/channelrx/demodadsb/map/liveries/B74F_ICL.png new file mode 100644 index 000000000..1ea4e91a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_ICL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_ICV.png b/plugins/channelrx/demodadsb/map/liveries/B74F_ICV.png new file mode 100644 index 000000000..392b492a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_ICV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_JAE.png b/plugins/channelrx/demodadsb/map/liveries/B74F_JAE.png new file mode 100644 index 000000000..bf598173a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_JAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B74F_JAL.png new file mode 100644 index 000000000..cf2e628ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_JGO.png b/plugins/channelrx/demodadsb/map/liveries/B74F_JGO.png new file mode 100644 index 000000000..9c9b1c7b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_JGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B74F_KAL.png new file mode 100644 index 000000000..3f734240d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B74F_KLM.png new file mode 100644 index 000000000..9aa0c5e83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_MAS.png b/plugins/channelrx/demodadsb/map/liveries/B74F_MAS.png new file mode 100644 index 000000000..4eea77d10 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_MPH.png b/plugins/channelrx/demodadsb/map/liveries/B74F_MPH.png new file mode 100644 index 000000000..e8e677909 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_MPH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_NCA.png b/plugins/channelrx/demodadsb/map/liveries/B74F_NCA.png new file mode 100644 index 000000000..eedd8cc3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_NCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_PAC.png b/plugins/channelrx/demodadsb/map/liveries/B74F_PAC.png new file mode 100644 index 000000000..0833bcccc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_PAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_SQC.png b/plugins/channelrx/demodadsb/map/liveries/B74F_SQC.png new file mode 100644 index 000000000..a7b10a267 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_SQC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B74F_SVA.png new file mode 100644 index 000000000..6990da7b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_TAY.png b/plugins/channelrx/demodadsb/map/liveries/B74F_TAY.png new file mode 100644 index 000000000..5d38b67f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_TAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_TCG.png b/plugins/channelrx/demodadsb/map/liveries/B74F_TCG.png new file mode 100644 index 000000000..c9cdaaf27 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_TCG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_UAE.png b/plugins/channelrx/demodadsb/map/liveries/B74F_UAE.png new file mode 100644 index 000000000..963060370 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_UPS.png b/plugins/channelrx/demodadsb/map/liveries/B74F_UPS.png new file mode 100644 index 000000000..c76e45c35 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B74F_YZR.png b/plugins/channelrx/demodadsb/map/liveries/B74F_YZR.png new file mode 100644 index 000000000..3b68dc9fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B74F_YZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B752_AAL.png new file mode 100644 index 000000000..aa582e7af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AAY.png b/plugins/channelrx/demodadsb/map/liveries/B752_AAY.png new file mode 100644 index 000000000..4c7a9615c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ABQ.png b/plugins/channelrx/demodadsb/map/liveries/B752_ABQ.png new file mode 100644 index 000000000..eb3748c05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ABQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AHY.png b/plugins/channelrx/demodadsb/map/liveries/B752_AHY.png new file mode 100644 index 000000000..22b29f29d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AIZ.png b/plugins/channelrx/demodadsb/map/liveries/B752_AIZ.png new file mode 100644 index 000000000..6857e35d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AIZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AMX.png b/plugins/channelrx/demodadsb/map/liveries/B752_AMX.png new file mode 100644 index 000000000..672c2f08b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_APW.png b/plugins/channelrx/demodadsb/map/liveries/B752_APW.png new file mode 100644 index 000000000..26002c13e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_APW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ARW.png b/plugins/channelrx/demodadsb/map/liveries/B752_ARW.png new file mode 100644 index 000000000..87b049a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ARW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AVA.png b/plugins/channelrx/demodadsb/map/liveries/B752_AVA.png new file mode 100644 index 000000000..acb9963d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AVE.png b/plugins/channelrx/demodadsb/map/liveries/B752_AVE.png new file mode 100644 index 000000000..587567a00 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AVE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_AWE.png b/plugins/channelrx/demodadsb/map/liveries/B752_AWE.png new file mode 100644 index 000000000..82de849c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_AWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BAL.png b/plugins/channelrx/demodadsb/map/liveries/B752_BAL.png new file mode 100644 index 000000000..9634d257e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BBR.png b/plugins/channelrx/demodadsb/map/liveries/B752_BBR.png new file mode 100644 index 000000000..14fdb426b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BBR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BCS.png b/plugins/channelrx/demodadsb/map/liveries/B752_BCS.png new file mode 100644 index 000000000..2ada9ea8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BCS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BER.png b/plugins/channelrx/demodadsb/map/liveries/B752_BER.png new file mode 100644 index 000000000..65985ac89 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BHP.png b/plugins/channelrx/demodadsb/map/liveries/B752_BHP.png new file mode 100644 index 000000000..d957c379c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BHP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BIE.png b/plugins/channelrx/demodadsb/map/liveries/B752_BIE.png new file mode 100644 index 000000000..25aa32f52 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BLX.png b/plugins/channelrx/demodadsb/map/liveries/B752_BLX.png new file mode 100644 index 000000000..b146ed302 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BPA.png b/plugins/channelrx/demodadsb/map/liveries/B752_BPA.png new file mode 100644 index 000000000..27f5c73b9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BTI.png b/plugins/channelrx/demodadsb/map/liveries/B752_BTI.png new file mode 100644 index 000000000..df8af466d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_BZS.png b/plugins/channelrx/demodadsb/map/liveries/B752_BZS.png new file mode 100644 index 000000000..6554711a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_BZS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_CFG.png b/plugins/channelrx/demodadsb/map/liveries/B752_CFG.png new file mode 100644 index 000000000..be6a6806d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_CFG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_COA.png b/plugins/channelrx/demodadsb/map/liveries/B752_COA.png new file mode 100644 index 000000000..4a300e366 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_COA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_CSH.png b/plugins/channelrx/demodadsb/map/liveries/B752_CSH.png new file mode 100644 index 000000000..2c184e110 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_CSH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B752_CSN.png new file mode 100644 index 000000000..ce3d59583 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_CXN.png b/plugins/channelrx/demodadsb/map/liveries/B752_CXN.png new file mode 100644 index 000000000..7ba10703f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_CXN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B752_DAL.png new file mode 100644 index 000000000..6bf91498b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_DBR.png b/plugins/channelrx/demodadsb/map/liveries/B752_DBR.png new file mode 100644 index 000000000..87f9a68e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_DBR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_DHX.png b/plugins/channelrx/demodadsb/map/liveries/B752_DHX.png new file mode 100644 index 000000000..584d4ba03 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_DHX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_DJT.png b/plugins/channelrx/demodadsb/map/liveries/B752_DJT.png new file mode 100644 index 000000000..4036f2631 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_DJT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_EAL.png b/plugins/channelrx/demodadsb/map/liveries/B752_EAL.png new file mode 100644 index 000000000..99c5d9d13 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_EAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_EIN.png b/plugins/channelrx/demodadsb/map/liveries/B752_EIN.png new file mode 100644 index 000000000..1557b63e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_EIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B752_ELY.png new file mode 100644 index 000000000..0ce3cc1b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_EMI.png b/plugins/channelrx/demodadsb/map/liveries/B752_EMI.png new file mode 100644 index 000000000..87b049a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_EMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_EMR.png b/plugins/channelrx/demodadsb/map/liveries/B752_EMR.png new file mode 100644 index 000000000..87b049a05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_EMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ERO.png b/plugins/channelrx/demodadsb/map/liveries/B752_ERO.png new file mode 100644 index 000000000..b11a7d6dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ERO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B752_ETH.png new file mode 100644 index 000000000..b8b785d0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_EXS.png b/plugins/channelrx/demodadsb/map/liveries/B752_EXS.png new file mode 100644 index 000000000..c828a39b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_EXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_FAG.png b/plugins/channelrx/demodadsb/map/liveries/B752_FAG.png new file mode 100644 index 000000000..c4449b0d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_FAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_FAM.png b/plugins/channelrx/demodadsb/map/liveries/B752_FAM.png new file mode 100644 index 000000000..972fbb76d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_FAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_FDX.png b/plugins/channelrx/demodadsb/map/liveries/B752_FDX.png new file mode 100644 index 000000000..506150f01 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_FIF.png b/plugins/channelrx/demodadsb/map/liveries/B752_FIF.png new file mode 100644 index 000000000..3d0a0f134 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_FIF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_FIN.png b/plugins/channelrx/demodadsb/map/liveries/B752_FIN.png new file mode 100644 index 000000000..b2a2a9698 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_FWA.png b/plugins/channelrx/demodadsb/map/liveries/B752_FWA.png new file mode 100644 index 000000000..cb68723c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_FWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_GJT.png b/plugins/channelrx/demodadsb/map/liveries/B752_GJT.png new file mode 100644 index 000000000..8f912e868 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_GJT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_GLG.png b/plugins/channelrx/demodadsb/map/liveries/B752_GLG.png new file mode 100644 index 000000000..8a359cf57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_GLG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_GRL.png b/plugins/channelrx/demodadsb/map/liveries/B752_GRL.png new file mode 100644 index 000000000..74acba11e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_GRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_HLN.png b/plugins/channelrx/demodadsb/map/liveries/B752_HLN.png new file mode 100644 index 000000000..91d1c4583 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_HLN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_HMY.png b/plugins/channelrx/demodadsb/map/liveries/B752_HMY.png new file mode 100644 index 000000000..60c2f717b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_HMY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_IBE.png b/plugins/channelrx/demodadsb/map/liveries/B752_IBE.png new file mode 100644 index 000000000..b58fbfa14 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ICE.png b/plugins/channelrx/demodadsb/map/liveries/B752_ICE.png new file mode 100644 index 000000000..12b372fd0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ICE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_KFY.png b/plugins/channelrx/demodadsb/map/liveries/B752_KFY.png new file mode 100644 index 000000000..314bf74d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_KFY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_KIW.png b/plugins/channelrx/demodadsb/map/liveries/B752_KIW.png new file mode 100644 index 000000000..ff0b27bf8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_KIW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_KJC.png b/plugins/channelrx/demodadsb/map/liveries/B752_KJC.png new file mode 100644 index 000000000..3ff2e7c73 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_KJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_KZR.png b/plugins/channelrx/demodadsb/map/liveries/B752_KZR.png new file mode 100644 index 000000000..483bac225 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_LTU.png b/plugins/channelrx/demodadsb/map/liveries/B752_LTU.png new file mode 100644 index 000000000..d2d1b600f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_LTU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_MMZ.png b/plugins/channelrx/demodadsb/map/liveries/B752_MMZ.png new file mode 100644 index 000000000..949c22d6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_MMZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_MON.png b/plugins/channelrx/demodadsb/map/liveries/B752_MON.png new file mode 100644 index 000000000..fef3d171e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_MOV.png b/plugins/channelrx/demodadsb/map/liveries/B752_MOV.png new file mode 100644 index 000000000..36b73deaf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_MOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_MPH.png b/plugins/channelrx/demodadsb/map/liveries/B752_MPH.png new file mode 100644 index 000000000..65a970b9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_MPH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_MXA.png b/plugins/channelrx/demodadsb/map/liveries/B752_MXA.png new file mode 100644 index 000000000..bdc20e6ca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_MXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_MYT.png b/plugins/channelrx/demodadsb/map/liveries/B752_MYT.png new file mode 100644 index 000000000..5b88f1408 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_MYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_PTI.png b/plugins/channelrx/demodadsb/map/liveries/B752_PTI.png new file mode 100644 index 000000000..fbe0770ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_PTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_PUA.png b/plugins/channelrx/demodadsb/map/liveries/B752_PUA.png new file mode 100644 index 000000000..9742ad6b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_PUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_PVG.png b/plugins/channelrx/demodadsb/map/liveries/B752_PVG.png new file mode 100644 index 000000000..ce4567005 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_PVG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_ROM.png b/plugins/channelrx/demodadsb/map/liveries/B752_ROM.png new file mode 100644 index 000000000..3ad41172c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_ROM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SAY.png b/plugins/channelrx/demodadsb/map/liveries/B752_SAY.png new file mode 100644 index 000000000..b9906cacb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SDO.png b/plugins/channelrx/demodadsb/map/liveries/B752_SDO.png new file mode 100644 index 000000000..2c8ec244f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SDO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SEY.png b/plugins/channelrx/demodadsb/map/liveries/B752_SEY.png new file mode 100644 index 000000000..65910e728 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SKY.png b/plugins/channelrx/demodadsb/map/liveries/B752_SKY.png new file mode 100644 index 000000000..1624b7431 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SLB.png b/plugins/channelrx/demodadsb/map/liveries/B752_SLB.png new file mode 100644 index 000000000..6f65efb91 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SLB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SSV.png b/plugins/channelrx/demodadsb/map/liveries/B752_SSV.png new file mode 100644 index 000000000..1f0534906 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SSV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SVK.png b/plugins/channelrx/demodadsb/map/liveries/B752_SVK.png new file mode 100644 index 000000000..4a9709804 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SVK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SWI.png b/plugins/channelrx/demodadsb/map/liveries/B752_SWI.png new file mode 100644 index 000000000..024912253 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SWV.png b/plugins/channelrx/demodadsb/map/liveries/B752_SWV.png new file mode 100644 index 000000000..d9f1f36f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SWV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SXS.png b/plugins/channelrx/demodadsb/map/liveries/B752_SXS.png new file mode 100644 index 000000000..53f8670ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SXS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_SYC.png b/plugins/channelrx/demodadsb/map/liveries/B752_SYC.png new file mode 100644 index 000000000..fd4aee923 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_SYC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TCV.png b/plugins/channelrx/demodadsb/map/liveries/B752_TCV.png new file mode 100644 index 000000000..ee1bf7deb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TCX.png b/plugins/channelrx/demodadsb/map/liveries/B752_TCX.png new file mode 100644 index 000000000..83ce1345f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TCX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/B752_TEJ.png new file mode 100644 index 000000000..af885cc05 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TOM.png b/plugins/channelrx/demodadsb/map/liveries/B752_TOM.png new file mode 100644 index 000000000..159a7ad5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TRA.png b/plugins/channelrx/demodadsb/map/liveries/B752_TRA.png new file mode 100644 index 000000000..7b1b92c33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TSC.png b/plugins/channelrx/demodadsb/map/liveries/B752_TSC.png new file mode 100644 index 000000000..784ae73cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_TWA.png b/plugins/channelrx/demodadsb/map/liveries/B752_TWA.png new file mode 100644 index 000000000..5d5ae0da0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_TWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B752_UAL.png new file mode 100644 index 000000000..54b14c93d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_UPS.png b/plugins/channelrx/demodadsb/map/liveries/B752_UPS.png new file mode 100644 index 000000000..28b550b57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_UTA.png b/plugins/channelrx/demodadsb/map/liveries/B752_UTA.png new file mode 100644 index 000000000..96d1cdbd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_VLE.png b/plugins/channelrx/demodadsb/map/liveries/B752_VLE.png new file mode 100644 index 000000000..6a116f9f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_VLE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_VLO.png b/plugins/channelrx/demodadsb/map/liveries/B752_VLO.png new file mode 100644 index 000000000..395409abd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_VLO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_XAS.png b/plugins/channelrx/demodadsb/map/liveries/B752_XAS.png new file mode 100644 index 000000000..9223aaf6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_XAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B752_XLA.png b/plugins/channelrx/demodadsb/map/liveries/B752_XLA.png new file mode 100644 index 000000000..662a9a730 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B752_XLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763.png b/plugins/channelrx/demodadsb/map/liveries/B763.png new file mode 100644 index 000000000..4dec48c36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F.png b/plugins/channelrx/demodadsb/map/liveries/B763F.png new file mode 100644 index 000000000..efc321c89 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_ABX.png b/plugins/channelrx/demodadsb/map/liveries/B763F_ABX.png new file mode 100644 index 000000000..1c4660eb7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_ABX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B763F_ACA.png new file mode 100644 index 000000000..425cc81f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_AJT.png b/plugins/channelrx/demodadsb/map/liveries/B763F_AJT.png new file mode 100644 index 000000000..612bed176 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_AJT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B763F_ANA.png new file mode 100644 index 000000000..18ac42c34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_ATN.png b/plugins/channelrx/demodadsb/map/liveries/B763F_ATN.png new file mode 100644 index 000000000..ecf838489 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_ATN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_ATN_PRIME.png b/plugins/channelrx/demodadsb/map/liveries/B763F_ATN_PRIME.png new file mode 100644 index 000000000..acce9721d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_ATN_PRIME.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_CJT.png b/plugins/channelrx/demodadsb/map/liveries/B763F_CJT.png new file mode 100644 index 000000000..d0fbb9e7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_CJT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_CKS.png b/plugins/channelrx/demodadsb/map/liveries/B763F_CKS.png new file mode 100644 index 000000000..f61493be1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_CKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_DAE.png b/plugins/channelrx/demodadsb/map/liveries/B763F_DAE.png new file mode 100644 index 000000000..d89ce6dc1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_DAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_DHK.png b/plugins/channelrx/demodadsb/map/liveries/B763F_DHK.png new file mode 100644 index 000000000..a5d81182d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_DHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_DHX.png b/plugins/channelrx/demodadsb/map/liveries/B763F_DHX.png new file mode 100644 index 000000000..708b2f2c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_DHX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_FDX.png b/plugins/channelrx/demodadsb/map/liveries/B763F_FDX.png new file mode 100644 index 000000000..48f6d5c3a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_GTI_PRIME_WL.png b/plugins/channelrx/demodadsb/map/liveries/B763F_GTI_PRIME_WL.png new file mode 100644 index 000000000..875490eb9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_GTI_PRIME_WL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_LAE.png b/plugins/channelrx/demodadsb/map/liveries/B763F_LAE.png new file mode 100644 index 000000000..8952b0ae5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_LAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_LCO.png b/plugins/channelrx/demodadsb/map/liveries/B763F_LCO.png new file mode 100644 index 000000000..d45315108 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_LCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_LTG.png b/plugins/channelrx/demodadsb/map/liveries/B763F_LTG.png new file mode 100644 index 000000000..b211761b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_LTG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_MQC.png b/plugins/channelrx/demodadsb/map/liveries/B763F_MQC.png new file mode 100644 index 000000000..d557cd8a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_MQC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_MZN.png b/plugins/channelrx/demodadsb/map/liveries/B763F_MZN.png new file mode 100644 index 000000000..ecf838489 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_MZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_NAC.png b/plugins/channelrx/demodadsb/map/liveries/B763F_NAC.png new file mode 100644 index 000000000..726166ee9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_NAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_NFC.png b/plugins/channelrx/demodadsb/map/liveries/B763F_NFC.png new file mode 100644 index 000000000..f40fd932a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_NFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_PAC.png b/plugins/channelrx/demodadsb/map/liveries/B763F_PAC.png new file mode 100644 index 000000000..c41949309 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_PAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_PLC.png b/plugins/channelrx/demodadsb/map/liveries/B763F_PLC.png new file mode 100644 index 000000000..71dad6978 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_QFA.png b/plugins/channelrx/demodadsb/map/liveries/B763F_QFA.png new file mode 100644 index 000000000..a31b49f40 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_SRR.png b/plugins/channelrx/demodadsb/map/liveries/B763F_SRR.png new file mode 100644 index 000000000..7906a5846 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_SRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_TMN.png b/plugins/channelrx/demodadsb/map/liveries/B763F_TMN.png new file mode 100644 index 000000000..8dc0897df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_TMN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763F_UPS.png b/plugins/channelrx/demodadsb/map/liveries/B763F_UPS.png new file mode 100644 index 000000000..81e1d864d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763F_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_AAL.png new file mode 100644 index 000000000..8d043dcde Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AAR.png b/plugins/channelrx/demodadsb/map/liveries/B763_AAR.png new file mode 100644 index 000000000..84b30f8ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ABB.png b/plugins/channelrx/demodadsb/map/liveries/B763_ABB.png new file mode 100644 index 000000000..74095963a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ABB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ABN.png b/plugins/channelrx/demodadsb/map/liveries/B763_ABN.png new file mode 100644 index 000000000..d788926a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ABN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ABX.png b/plugins/channelrx/demodadsb/map/liveries/B763_ABX.png new file mode 100644 index 000000000..08b462a1e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ABX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ABZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_ABZ.png new file mode 100644 index 000000000..e5aec38ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ABZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B763_ACA.png new file mode 100644 index 000000000..8c2aace03 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ADO.png b/plugins/channelrx/demodadsb/map/liveries/B763_ADO.png new file mode 100644 index 000000000..6dd5fa7af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ADO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AEA.png b/plugins/channelrx/demodadsb/map/liveries/B763_AEA.png new file mode 100644 index 000000000..276e4b0fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AEY.png b/plugins/channelrx/demodadsb/map/liveries/B763_AEY.png new file mode 100644 index 000000000..2fca7417f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AFF.png b/plugins/channelrx/demodadsb/map/liveries/B763_AFF.png new file mode 100644 index 000000000..3b6c0ed18 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AFL.png b/plugins/channelrx/demodadsb/map/liveries/B763_AFL.png new file mode 100644 index 000000000..51e857803 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AGA.png b/plugins/channelrx/demodadsb/map/liveries/B763_AGA.png new file mode 100644 index 000000000..f52351925 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AGN.png b/plugins/channelrx/demodadsb/map/liveries/B763_AGN.png new file mode 100644 index 000000000..a5d5cdb23 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AGN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AHS.png b/plugins/channelrx/demodadsb/map/liveries/B763_AHS.png new file mode 100644 index 000000000..487539a73 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AHS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AHY.png b/plugins/channelrx/demodadsb/map/liveries/B763_AHY.png new file mode 100644 index 000000000..fce5b751e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ALM.png b/plugins/channelrx/demodadsb/map/liveries/B763_ALM.png new file mode 100644 index 000000000..eedb9f3b4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ALM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AMX.png b/plugins/channelrx/demodadsb/map/liveries/B763_AMX.png new file mode 100644 index 000000000..8cf455158 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AMZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_AMZ.png new file mode 100644 index 000000000..78e5baeae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AMZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B763_ANA.png new file mode 100644 index 000000000..08c66057b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ANA_W.png b/plugins/channelrx/demodadsb/map/liveries/B763_ANA_W.png new file mode 100644 index 000000000..d49b61687 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ANA_W.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ANG.png b/plugins/channelrx/demodadsb/map/liveries/B763_ANG.png new file mode 100644 index 000000000..6e12a2801 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ANG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_ANZ.png new file mode 100644 index 000000000..b95690396 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ARC.png b/plugins/channelrx/demodadsb/map/liveries/B763_ARC.png new file mode 100644 index 000000000..f26dcffec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ARC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ARW.png b/plugins/channelrx/demodadsb/map/liveries/B763_ARW.png new file mode 100644 index 000000000..f26dcffec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ARW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AUA.png b/plugins/channelrx/demodadsb/map/liveries/B763_AUA.png new file mode 100644 index 000000000..527c04b57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AUI.png b/plugins/channelrx/demodadsb/map/liveries/B763_AUI.png new file mode 100644 index 000000000..b9ff1ae95 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AUI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AUZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_AUZ.png new file mode 100644 index 000000000..2cf95e9b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AUZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AVA.png b/plugins/channelrx/demodadsb/map/liveries/B763_AVA.png new file mode 100644 index 000000000..b6a205b50 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AVE.png b/plugins/channelrx/demodadsb/map/liveries/B763_AVE.png new file mode 100644 index 000000000..5a8f8eba0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AVE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AWC.png b/plugins/channelrx/demodadsb/map/liveries/B763_AWC.png new file mode 100644 index 000000000..8384159fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AZA.png b/plugins/channelrx/demodadsb/map/liveries/B763_AZA.png new file mode 100644 index 000000000..b37fa6111 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AZG.png b/plugins/channelrx/demodadsb/map/liveries/B763_AZG.png new file mode 100644 index 000000000..8b7bcda00 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AZG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_AZV.png b/plugins/channelrx/demodadsb/map/liveries/B763_AZV.png new file mode 100644 index 000000000..609c629a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_AZV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_BAL.png new file mode 100644 index 000000000..09713bb6f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B763_BAW.png new file mode 100644 index 000000000..3baf82262 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BBR.png b/plugins/channelrx/demodadsb/map/liveries/B763_BBR.png new file mode 100644 index 000000000..028d9df4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BBR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BHA.png b/plugins/channelrx/demodadsb/map/liveries/B763_BHA.png new file mode 100644 index 000000000..c71b1836e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BHP.png b/plugins/channelrx/demodadsb/map/liveries/B763_BHP.png new file mode 100644 index 000000000..5a9dd6a43 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BHP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BLX.png b/plugins/channelrx/demodadsb/map/liveries/B763_BLX.png new file mode 100644 index 000000000..28640e82c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BOV.png b/plugins/channelrx/demodadsb/map/liveries/B763_BOV.png new file mode 100644 index 000000000..59ace253a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BPA.png b/plugins/channelrx/demodadsb/map/liveries/B763_BPA.png new file mode 100644 index 000000000..16f69464c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BRU.png b/plugins/channelrx/demodadsb/map/liveries/B763_BRU.png new file mode 100644 index 000000000..538df74a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_BWA.png b/plugins/channelrx/demodadsb/map/liveries/B763_BWA.png new file mode 100644 index 000000000..f69c893aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_BWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B763_CCA.png new file mode 100644 index 000000000..d5bd194bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CES.png b/plugins/channelrx/demodadsb/map/liveries/B763_CES.png new file mode 100644 index 000000000..46056c511 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CFG.png b/plugins/channelrx/demodadsb/map/liveries/B763_CFG.png new file mode 100644 index 000000000..976ad837a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CFG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CHH.png b/plugins/channelrx/demodadsb/map/liveries/B763_CHH.png new file mode 100644 index 000000000..005629e6f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CIB.png b/plugins/channelrx/demodadsb/map/liveries/B763_CIB.png new file mode 100644 index 000000000..dc945b2bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CIB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CNS.png b/plugins/channelrx/demodadsb/map/liveries/B763_CNS.png new file mode 100644 index 000000000..056e39abe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CNS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CRL.png b/plugins/channelrx/demodadsb/map/liveries/B763_CRL.png new file mode 100644 index 000000000..90480ce8e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CRL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CSH.png b/plugins/channelrx/demodadsb/map/liveries/B763_CSH.png new file mode 100644 index 000000000..c2a05565f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CSH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B763_CXA_VA.png new file mode 100644 index 000000000..9175e97a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_DAH.png b/plugins/channelrx/demodadsb/map/liveries/B763_DAH.png new file mode 100644 index 000000000..97306af6b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_DAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_DAL.png new file mode 100644 index 000000000..696e5eb62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_DAL_NCGEW.png b/plugins/channelrx/demodadsb/map/liveries/B763_DAL_NCGEW.png new file mode 100644 index 000000000..e1715ffee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_DAL_NCGEW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_DCA.png b/plugins/channelrx/demodadsb/map/liveries/B763_DCA.png new file mode 100644 index 000000000..d6db241b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_DCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_DHK.png b/plugins/channelrx/demodadsb/map/liveries/B763_DHK.png new file mode 100644 index 000000000..7708fa24e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_DHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_DLH.png b/plugins/channelrx/demodadsb/map/liveries/B763_DLH.png new file mode 100644 index 000000000..aa3707c32 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_EAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_EAL.png new file mode 100644 index 000000000..d52beb1be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_EAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_EBA.png b/plugins/channelrx/demodadsb/map/liveries/B763_EBA.png new file mode 100644 index 000000000..e70f107df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_EBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ECN.png b/plugins/channelrx/demodadsb/map/liveries/B763_ECN.png new file mode 100644 index 000000000..e9b9addf8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ECN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B763_ELY.png new file mode 100644 index 000000000..fd88eb761 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_EMI.png b/plugins/channelrx/demodadsb/map/liveries/B763_EMI.png new file mode 100644 index 000000000..d0cf278c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_EMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_EMR.png b/plugins/channelrx/demodadsb/map/liveries/B763_EMR.png new file mode 100644 index 000000000..4fdc5829e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_EMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B763_ETD.png new file mode 100644 index 000000000..058cbf0e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B763_ETH.png new file mode 100644 index 000000000..380891b44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_EUK.png b/plugins/channelrx/demodadsb/map/liveries/B763_EUK.png new file mode 100644 index 000000000..2df892294 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_EUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_FDX.png b/plugins/channelrx/demodadsb/map/liveries/B763_FDX.png new file mode 100644 index 000000000..7e26a1ee4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_FRR.png b/plugins/channelrx/demodadsb/map/liveries/B763_FRR.png new file mode 100644 index 000000000..5e5a8c9d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_FRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_FUN.png b/plugins/channelrx/demodadsb/map/liveries/B763_FUN.png new file mode 100644 index 000000000..ff6860eae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_FUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_FWL.png b/plugins/channelrx/demodadsb/map/liveries/B763_FWL.png new file mode 100644 index 000000000..b9757112b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_FWL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_GAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_GAL.png new file mode 100644 index 000000000..57479a611 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_GAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_GFA.png b/plugins/channelrx/demodadsb/map/liveries/B763_GFA.png new file mode 100644 index 000000000..e88ce32a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_GIA.png b/plugins/channelrx/demodadsb/map/liveries/B763_GIA.png new file mode 100644 index 000000000..137dd23cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_GRE.png b/plugins/channelrx/demodadsb/map/liveries/B763_GRE.png new file mode 100644 index 000000000..fc0eb5bab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_GRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_GSM.png b/plugins/channelrx/demodadsb/map/liveries/B763_GSM.png new file mode 100644 index 000000000..bb5daac9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_GSM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B763_GTI.png new file mode 100644 index 000000000..176461145 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_HAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_HAL.png new file mode 100644 index 000000000..2bfce8c0f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_HAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_HAZ.png new file mode 100644 index 000000000..f1129d0b9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_HLN.png b/plugins/channelrx/demodadsb/map/liveries/B763_HLN.png new file mode 100644 index 000000000..245601478 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_HLN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_HVN.png b/plugins/channelrx/demodadsb/map/liveries/B763_HVN.png new file mode 100644 index 000000000..b1fe4bec7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_IAW.png b/plugins/channelrx/demodadsb/map/liveries/B763_IAW.png new file mode 100644 index 000000000..c9b997077 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_IBE.png b/plugins/channelrx/demodadsb/map/liveries/B763_IBE.png new file mode 100644 index 000000000..a0fe42254 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_IBE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ICE_MAGENTA.png b/plugins/channelrx/demodadsb/map/liveries/B763_ICE_MAGENTA.png new file mode 100644 index 000000000..d0f5ac59d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ICE_MAGENTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ICE_SKY_BLUE.png b/plugins/channelrx/demodadsb/map/liveries/B763_ICE_SKY_BLUE.png new file mode 100644 index 000000000..c73e6adad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ICE_SKY_BLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ISR.png b/plugins/channelrx/demodadsb/map/liveries/B763_ISR.png new file mode 100644 index 000000000..c3dd14263 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ISR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_JAF.png b/plugins/channelrx/demodadsb/map/liveries/B763_JAF.png new file mode 100644 index 000000000..e41af7d4e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_JAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_JAL.png new file mode 100644 index 000000000..0f292b1cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_JAL_WL.png b/plugins/channelrx/demodadsb/map/liveries/B763_JAL_WL.png new file mode 100644 index 000000000..9558c8064 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_JAL_WL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_JGO.png b/plugins/channelrx/demodadsb/map/liveries/B763_JGO.png new file mode 100644 index 000000000..e92b9fa96 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_JGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B763_KLM.png new file mode 100644 index 000000000..0e73fef4e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_KQA.png b/plugins/channelrx/demodadsb/map/liveries/B763_KQA.png new file mode 100644 index 000000000..5c758f348 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_KZR.png b/plugins/channelrx/demodadsb/map/liveries/B763_KZR.png new file mode 100644 index 000000000..864924f81 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LAN.png b/plugins/channelrx/demodadsb/map/liveries/B763_LAN.png new file mode 100644 index 000000000..cd9f6766e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LCO.png b/plugins/channelrx/demodadsb/map/liveries/B763_LCO.png new file mode 100644 index 000000000..90c58f9a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LDA.png b/plugins/channelrx/demodadsb/map/liveries/B763_LDA.png new file mode 100644 index 000000000..e2455e2e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LLB.png b/plugins/channelrx/demodadsb/map/liveries/B763_LLB.png new file mode 100644 index 000000000..6804f5d72 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LLB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B763_LNR.png new file mode 100644 index 000000000..89ef2268c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LOT.png b/plugins/channelrx/demodadsb/map/liveries/B763_LOT.png new file mode 100644 index 000000000..3165dd1f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_LTU.png b/plugins/channelrx/demodadsb/map/liveries/B763_LTU.png new file mode 100644 index 000000000..41d452630 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_LTU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MAA.png b/plugins/channelrx/demodadsb/map/liveries/B763_MAA.png new file mode 100644 index 000000000..f26dcffec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MAH.png b/plugins/channelrx/demodadsb/map/liveries/B763_MAH.png new file mode 100644 index 000000000..4f89a9971 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MDG.png b/plugins/channelrx/demodadsb/map/liveries/B763_MDG.png new file mode 100644 index 000000000..a96217877 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MDG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MGL.png b/plugins/channelrx/demodadsb/map/liveries/B763_MGL.png new file mode 100644 index 000000000..5d804031e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MMZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_MMZ.png new file mode 100644 index 000000000..de1e8406d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MMZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MON.png b/plugins/channelrx/demodadsb/map/liveries/B763_MON.png new file mode 100644 index 000000000..1f2ea970b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MON.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MPH.png b/plugins/channelrx/demodadsb/map/liveries/B763_MPH.png new file mode 100644 index 000000000..e18498717 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MPH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MSR.png b/plugins/channelrx/demodadsb/map/liveries/B763_MSR.png new file mode 100644 index 000000000..80ca2b674 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MXA.png b/plugins/channelrx/demodadsb/map/liveries/B763_MXA.png new file mode 100644 index 000000000..28595a63b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_MYT.png b/plugins/channelrx/demodadsb/map/liveries/B763_MYT.png new file mode 100644 index 000000000..b5cfe1039 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_MYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_NAO.png b/plugins/channelrx/demodadsb/map/liveries/B763_NAO.png new file mode 100644 index 000000000..bce44c527 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_NAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_NDF.png b/plugins/channelrx/demodadsb/map/liveries/B763_NDF.png new file mode 100644 index 000000000..70203add4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_NOS.png b/plugins/channelrx/demodadsb/map/liveries/B763_NOS.png new file mode 100644 index 000000000..94874edff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_NOS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_NWS.png b/plugins/channelrx/demodadsb/map/liveries/B763_NWS.png new file mode 100644 index 000000000..cc3f1f782 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_OAE.png b/plugins/channelrx/demodadsb/map/liveries/B763_OAE.png new file mode 100644 index 000000000..bafd1f70f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_OAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B763_OAL_VA.png new file mode 100644 index 000000000..c18964b3c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_OOM.png b/plugins/channelrx/demodadsb/map/liveries/B763_OOM.png new file mode 100644 index 000000000..448fa0a60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_OOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_PRY.png b/plugins/channelrx/demodadsb/map/liveries/B763_PRY.png new file mode 100644 index 000000000..8867ef345 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_PRY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_PUA.png b/plugins/channelrx/demodadsb/map/liveries/B763_PUA.png new file mode 100644 index 000000000..8c5ee4442 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_PUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_PVG.png b/plugins/channelrx/demodadsb/map/liveries/B763_PVG.png new file mode 100644 index 000000000..afcd15fd9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_PVG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_PVI.png b/plugins/channelrx/demodadsb/map/liveries/B763_PVI.png new file mode 100644 index 000000000..f26dcffec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_PVI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_QFA.png b/plugins/channelrx/demodadsb/map/liveries/B763_QFA.png new file mode 100644 index 000000000..cdccb672a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B763_RAM.png new file mode 100644 index 000000000..520bcbe83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_RBA.png b/plugins/channelrx/demodadsb/map/liveries/B763_RBA.png new file mode 100644 index 000000000..cd341b02b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_RBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_RKA.png b/plugins/channelrx/demodadsb/map/liveries/B763_RKA.png new file mode 100644 index 000000000..168750864 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_RKA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ROM.png b/plugins/channelrx/demodadsb/map/liveries/B763_ROM.png new file mode 100644 index 000000000..5fb480d80 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ROM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_ROU.png b/plugins/channelrx/demodadsb/map/liveries/B763_ROU.png new file mode 100644 index 000000000..7b4fa6be0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_ROU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SAB.png b/plugins/channelrx/demodadsb/map/liveries/B763_SAB.png new file mode 100644 index 000000000..d62d5098c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SAB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SAS.png b/plugins/channelrx/demodadsb/map/liveries/B763_SAS.png new file mode 100644 index 000000000..bdd2c5d1c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SBI.png b/plugins/channelrx/demodadsb/map/liveries/B763_SBI.png new file mode 100644 index 000000000..693135541 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SDM.png b/plugins/channelrx/demodadsb/map/liveries/B763_SDM.png new file mode 100644 index 000000000..fa8670ca7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SEY.png b/plugins/channelrx/demodadsb/map/liveries/B763_SEY.png new file mode 100644 index 000000000..9108c8fb0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SEY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SGR.png b/plugins/channelrx/demodadsb/map/liveries/B763_SGR.png new file mode 100644 index 000000000..488701ca4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SGR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SUN.png b/plugins/channelrx/demodadsb/map/liveries/B763_SUN.png new file mode 100644 index 000000000..73b2ab8c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SVW.png b/plugins/channelrx/demodadsb/map/liveries/B763_SVW.png new file mode 100644 index 000000000..9b8da931d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SVW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SWI.png b/plugins/channelrx/demodadsb/map/liveries/B763_SWI.png new file mode 100644 index 000000000..1ad41644d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SYC.png b/plugins/channelrx/demodadsb/map/liveries/B763_SYC.png new file mode 100644 index 000000000..777d890f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SYC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SYR.png b/plugins/channelrx/demodadsb/map/liveries/B763_SYR.png new file mode 100644 index 000000000..000f87247 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_SYT.png b/plugins/channelrx/demodadsb/map/liveries/B763_SYT.png new file mode 100644 index 000000000..8f5468478 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_SYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TAM.png b/plugins/channelrx/demodadsb/map/liveries/B763_TAM.png new file mode 100644 index 000000000..95e53c40a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TBA.png b/plugins/channelrx/demodadsb/map/liveries/B763_TBA.png new file mode 100644 index 000000000..52c04d0ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TCX.png b/plugins/channelrx/demodadsb/map/liveries/B763_TCX.png new file mode 100644 index 000000000..052d0d7b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TCX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/B763_TEJ.png new file mode 100644 index 000000000..2af6da198 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TFL.png b/plugins/channelrx/demodadsb/map/liveries/B763_TFL.png new file mode 100644 index 000000000..649fa50f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TGZ.png b/plugins/channelrx/demodadsb/map/liveries/B763_TGZ.png new file mode 100644 index 000000000..c9202fedc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TGZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TNA.png b/plugins/channelrx/demodadsb/map/liveries/B763_TNA.png new file mode 100644 index 000000000..29aab68f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TNA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TOM.png b/plugins/channelrx/demodadsb/map/liveries/B763_TOM.png new file mode 100644 index 000000000..47a1d685f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B763_TSO.png new file mode 100644 index 000000000..d4ac43bd6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TUA.png b/plugins/channelrx/demodadsb/map/liveries/B763_TUA.png new file mode 100644 index 000000000..db1421cb6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TUS.png b/plugins/channelrx/demodadsb/map/liveries/B763_TUS.png new file mode 100644 index 000000000..c79d8ecf5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_TWA.png b/plugins/channelrx/demodadsb/map/liveries/B763_TWA.png new file mode 100644 index 000000000..ae2e7d4d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_TWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B763_UAL.png new file mode 100644 index 000000000..205a33bce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UAL_BLUE.png b/plugins/channelrx/demodadsb/map/liveries/B763_UAL_BLUE.png new file mode 100644 index 000000000..337375c62 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UAL_BLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UAL_GOLD.png b/plugins/channelrx/demodadsb/map/liveries/B763_UAL_GOLD.png new file mode 100644 index 000000000..f7b367ce9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UAL_GOLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UDN.png b/plugins/channelrx/demodadsb/map/liveries/B763_UDN.png new file mode 100644 index 000000000..1d74c1369 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UDN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UKV_AURORA.png b/plugins/channelrx/demodadsb/map/liveries/B763_UKV_AURORA.png new file mode 100644 index 000000000..a20435b26 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UKV_AURORA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UPS.png b/plugins/channelrx/demodadsb/map/liveries/B763_UPS.png new file mode 100644 index 000000000..03c363e79 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UTA.png b/plugins/channelrx/demodadsb/map/liveries/B763_UTA.png new file mode 100644 index 000000000..18c1f18b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UTN.png b/plugins/channelrx/demodadsb/map/liveries/B763_UTN.png new file mode 100644 index 000000000..4f2875c8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_UZB.png b/plugins/channelrx/demodadsb/map/liveries/B763_UZB.png new file mode 100644 index 000000000..8c31d5a24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_UZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_VCP.png b/plugins/channelrx/demodadsb/map/liveries/B763_VCP.png new file mode 100644 index 000000000..eea47fb83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_VLE.png b/plugins/channelrx/demodadsb/map/liveries/B763_VLE.png new file mode 100644 index 000000000..4430d304c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_VLE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_VSP.png b/plugins/channelrx/demodadsb/map/liveries/B763_VSP.png new file mode 100644 index 000000000..2bf193b06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B763_WAT.png new file mode 100644 index 000000000..60a0f174e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B763_XAS.png b/plugins/channelrx/demodadsb/map/liveries/B763_XAS.png new file mode 100644 index 000000000..47d7538af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B763_XAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772.png b/plugins/channelrx/demodadsb/map/liveries/B772.png new file mode 100644 index 000000000..896e69a0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B772_AAL.png new file mode 100644 index 000000000..7e03e7b21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AAR.png b/plugins/channelrx/demodadsb/map/liveries/B772_AAR.png new file mode 100644 index 000000000..5aa2cf422 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B772_ACA.png new file mode 100644 index 000000000..fa0b46d6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AFR.png b/plugins/channelrx/demodadsb/map/liveries/B772_AFR.png new file mode 100644 index 000000000..4886189ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AIC.png b/plugins/channelrx/demodadsb/map/liveries/B772_AIC.png new file mode 100644 index 000000000..688024112 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B772_ANA.png new file mode 100644 index 000000000..5d0cdd4c5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/B772_ANZ.png new file mode 100644 index 000000000..8d0b78695 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AUA.png b/plugins/channelrx/demodadsb/map/liveries/B772_AUA.png new file mode 100644 index 000000000..64c0fe73d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AUH.png b/plugins/channelrx/demodadsb/map/liveries/B772_AUH.png new file mode 100644 index 000000000..f5b07a8c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AUH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_AZA.png b/plugins/channelrx/demodadsb/map/liveries/B772_AZA.png new file mode 100644 index 000000000..704c66df3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B772_BAW.png new file mode 100644 index 000000000..a35d672f0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B772_CCA.png new file mode 100644 index 000000000..0b6359db5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_COA.png b/plugins/channelrx/demodadsb/map/liveries/B772_COA.png new file mode 100644 index 000000000..9258ce0bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_COA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_CPA.png b/plugins/channelrx/demodadsb/map/liveries/B772_CPA.png new file mode 100644 index 000000000..8d821af61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B772_CSN.png new file mode 100644 index 000000000..b1026b692 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B772_CXA_VA.png new file mode 100644 index 000000000..979c76813 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B772_DAL.png new file mode 100644 index 000000000..c485bb910 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_DUB.png b/plugins/channelrx/demodadsb/map/liveries/B772_DUB.png new file mode 100644 index 000000000..4b929b7c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_DUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_EAL.png b/plugins/channelrx/demodadsb/map/liveries/B772_EAL.png new file mode 100644 index 000000000..f8a8a1396 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_EAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B772_ELY.png new file mode 100644 index 000000000..15f7160a7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B772_FBV.png new file mode 100644 index 000000000..2462527d8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_FWC.png b/plugins/channelrx/demodadsb/map/liveries/B772_FWC.png new file mode 100644 index 000000000..6204afb39 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_FWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/B772_HAZ.png new file mode 100644 index 000000000..8adfeb02a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_HVN.png b/plugins/channelrx/demodadsb/map/liveries/B772_HVN.png new file mode 100644 index 000000000..d7137610e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_IAE.png b/plugins/channelrx/demodadsb/map/liveries/B772_IAE.png new file mode 100644 index 000000000..942692506 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B772_JAL.png new file mode 100644 index 000000000..b2b28a278 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_KAC.png b/plugins/channelrx/demodadsb/map/liveries/B772_KAC.png new file mode 100644 index 000000000..22dac79c5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B772_KAL.png new file mode 100644 index 000000000..28b61ed24 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B772_KLM.png new file mode 100644 index 000000000..04c6a79b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_KQA.png b/plugins/channelrx/demodadsb/map/liveries/B772_KQA.png new file mode 100644 index 000000000..ecbec57ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_MAS.png b/plugins/channelrx/demodadsb/map/liveries/B772_MAS.png new file mode 100644 index 000000000..50e1513db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_MMZ.png b/plugins/channelrx/demodadsb/map/liveries/B772_MMZ.png new file mode 100644 index 000000000..e82e55ecb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_MMZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_MSE.png b/plugins/channelrx/demodadsb/map/liveries/B772_MSE.png new file mode 100644 index 000000000..6473edca1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_MSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_MSR.png b/plugins/channelrx/demodadsb/map/liveries/B772_MSR.png new file mode 100644 index 000000000..6e68b2c41 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_NWS.png b/plugins/channelrx/demodadsb/map/liveries/B772_NWS.png new file mode 100644 index 000000000..046ce4a37 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_OAE.png b/plugins/channelrx/demodadsb/map/liveries/B772_OAE.png new file mode 100644 index 000000000..cb127364a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_OAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_ORB.png b/plugins/channelrx/demodadsb/map/liveries/B772_ORB.png new file mode 100644 index 000000000..6fd1fc5a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_ORB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_PIA.png b/plugins/channelrx/demodadsb/map/liveries/B772_PIA.png new file mode 100644 index 000000000..b4159e44d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_PIA_NC.png b/plugins/channelrx/demodadsb/map/liveries/B772_PIA_NC.png new file mode 100644 index 000000000..15ae0fdee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_PIA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_REU.png b/plugins/channelrx/demodadsb/map/liveries/B772_REU.png new file mode 100644 index 000000000..a935bae2b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_REU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_RWZ.png b/plugins/channelrx/demodadsb/map/liveries/B772_RWZ.png new file mode 100644 index 000000000..12f6fc46b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_RWZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B772_SIA.png new file mode 100644 index 000000000..1b86f6a51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B772_SVA.png new file mode 100644 index 000000000..b3236395a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_THA.png b/plugins/channelrx/demodadsb/map/liveries/B772_THA.png new file mode 100644 index 000000000..1a1f7934e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_TKY.png b/plugins/channelrx/demodadsb/map/liveries/B772_TKY.png new file mode 100644 index 000000000..9a9100400 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_UAE.png b/plugins/channelrx/demodadsb/map/liveries/B772_UAE.png new file mode 100644 index 000000000..1caa1656a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B772_UAL.png new file mode 100644 index 000000000..d616330f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_UAL_NC.png b/plugins/channelrx/demodadsb/map/liveries/B772_UAL_NC.png new file mode 100644 index 000000000..65497e1a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_UAL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_UAL_OC.png b/plugins/channelrx/demodadsb/map/liveries/B772_UAL_OC.png new file mode 100644 index 000000000..7a86579df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_UAL_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B772_UKV.png new file mode 100644 index 000000000..adb02bc19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_VCP.png b/plugins/channelrx/demodadsb/map/liveries/B772_VCP.png new file mode 100644 index 000000000..73e984717 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_VSP.png b/plugins/channelrx/demodadsb/map/liveries/B772_VSP.png new file mode 100644 index 000000000..9c53d9619 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B772_WAT.png new file mode 100644 index 000000000..0222fb5df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B772_WYB.png b/plugins/channelrx/demodadsb/map/liveries/B772_WYB.png new file mode 100644 index 000000000..5f4b4ecba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B772_WYB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B773_ANA.png new file mode 100644 index 000000000..9a5245954 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_CPA.png b/plugins/channelrx/demodadsb/map/liveries/B773_CPA.png new file mode 100644 index 000000000..59e7216c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B773_JAL.png new file mode 100644 index 000000000..c97a2ec27 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B773_KAL.png new file mode 100644 index 000000000..3196b1a44 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B773_SIA.png new file mode 100644 index 000000000..8870a1fef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_THA.png b/plugins/channelrx/demodadsb/map/liveries/B773_THA.png new file mode 100644 index 000000000..76574f298 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B773_TSO.png new file mode 100644 index 000000000..4000543ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_UAE.png b/plugins/channelrx/demodadsb/map/liveries/B773_UAE.png new file mode 100644 index 000000000..f57bfdc10 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_VLC.png b/plugins/channelrx/demodadsb/map/liveries/B773_VLC.png new file mode 100644 index 000000000..373b2d604 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B773_VOZ.png b/plugins/channelrx/demodadsb/map/liveries/B773_VOZ.png new file mode 100644 index 000000000..5e4f411ea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B773_VOZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L.png b/plugins/channelrx/demodadsb/map/liveries/B77L.png new file mode 100644 index 000000000..bd89fd41e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF.png b/plugins/channelrx/demodadsb/map/liveries/B77LF.png new file mode 100644 index 000000000..df6e5a2eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_ABW.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_ABW.png new file mode 100644 index 000000000..e960a54ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_ABW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_AJC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_AJC.png new file mode 100644 index 000000000..ad2a26f15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_AJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_ANA.png new file mode 100644 index 000000000..38980c7fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_AZG.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_AZG.png new file mode 100644 index 000000000..ae0476df7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_AZG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_BOX.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_BOX.png new file mode 100644 index 000000000..d323632f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_BOX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_BOX_DHL.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_BOX_DHL.png new file mode 100644 index 000000000..028a3c196 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_BOX_DHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_BVX.png new file mode 100644 index 000000000..7b49a4196 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CAL.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CAL.png new file mode 100644 index 000000000..34b7329e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CAO.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CAO.png new file mode 100644 index 000000000..d151baa7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CKK_NC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKK_NC.png new file mode 100644 index 000000000..3affc3afc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKK_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS.png new file mode 100644 index 000000000..0ac7f2fd3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS_DHL.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS_DHL.png new file mode 100644 index 000000000..214b79a0a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS_DHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS_KALITTA-NC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS_KALITTA-NC.png new file mode 100644 index 000000000..a4beb0778 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CKS_KALITTA-NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CMA.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CMA.png new file mode 100644 index 000000000..500fe1be0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CSG.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CSG.png new file mode 100644 index 000000000..e18ec326f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CSG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_CSN.png new file mode 100644 index 000000000..1a14cd80a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_DHK.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_DHK.png new file mode 100644 index 000000000..d3125ce87 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_DHK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_ETD.png new file mode 100644 index 000000000..e551bda63 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_EVA.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_EVA.png new file mode 100644 index 000000000..717b76dee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_FDX.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_FDX.png new file mode 100644 index 000000000..8cb85d446 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_GEC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_GEC.png new file mode 100644 index 000000000..6760dde46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_GEC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_GEC_OC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_GEC_OC.png new file mode 100644 index 000000000..2d9b9b47e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_GEC_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_GTI.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_GTI.png new file mode 100644 index 000000000..ff2587c77 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_GTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_IWA.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_IWA.png new file mode 100644 index 000000000..704c30439 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_IWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_KAL_LRF.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_KAL_LRF.png new file mode 100644 index 000000000..a99b0b7a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_KAL_LRF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_MQC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_MQC.png new file mode 100644 index 000000000..56c38b0a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_MQC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_NFC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_NFC.png new file mode 100644 index 000000000..3b702b796 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_NFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_PAC_DHL.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_PAC_DHL.png new file mode 100644 index 000000000..6908574b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_PAC_DHL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_PLC.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_PLC.png new file mode 100644 index 000000000..8bcbe6b55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_QTR_CARGO.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_QTR_CARGO.png new file mode 100644 index 000000000..3639e4e5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_QTR_CARGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_SIA.png new file mode 100644 index 000000000..dfb603d26 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_SRR.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_SRR.png new file mode 100644 index 000000000..ff38631d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_SRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_SVA.png new file mode 100644 index 000000000..b229715a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_THY_CARGO.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_THY_CARGO.png new file mode 100644 index 000000000..3dd886ea3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_THY_CARGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_UAE_CARGO.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_UAE_CARGO.png new file mode 100644 index 000000000..c26a59a03 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_UAE_CARGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77LF_WYB.png b/plugins/channelrx/demodadsb/map/liveries/B77LF_WYB.png new file mode 100644 index 000000000..297bd5101 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77LF_WYB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B77L_ACA.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_ACA_NC.png b/plugins/channelrx/demodadsb/map/liveries/B77L_ACA_NC.png new file mode 100644 index 000000000..80f2a20ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_ACA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_AFR.png b/plugins/channelrx/demodadsb/map/liveries/B77L_AFR.png new file mode 100644 index 000000000..afa14aa64 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_AIC.png b/plugins/channelrx/demodadsb/map/liveries/B77L_AIC.png new file mode 100644 index 000000000..e5b8f8656 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_BOX.png b/plugins/channelrx/demodadsb/map/liveries/B77L_BOX.png new file mode 100644 index 000000000..82d4c4682 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_BOX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_CKK.png b/plugins/channelrx/demodadsb/map/liveries/B77L_CKK.png new file mode 100644 index 000000000..1d6a8205f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_CKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B77L_CSN.png new file mode 100644 index 000000000..783dd8531 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_DAL.png b/plugins/channelrx/demodadsb/map/liveries/B77L_DAL.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_ECN.png b/plugins/channelrx/demodadsb/map/liveries/B77L_ECN.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_ECN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B77L_ETD.png new file mode 100644 index 000000000..185b5cf98 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B77L_ETH.png new file mode 100644 index 000000000..45dba1cf3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_FDX.png b/plugins/channelrx/demodadsb/map/liveries/B77L_FDX.png new file mode 100644 index 000000000..c6c631b27 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_GEC.png b/plugins/channelrx/demodadsb/map/liveries/B77L_GEC.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_GEC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_JGO.png b/plugins/channelrx/demodadsb/map/liveries/B77L_JGO.png new file mode 100644 index 000000000..c8a6c6182 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_JGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B77L_KAL.png new file mode 100644 index 000000000..8e9306e28 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_KAR.png b/plugins/channelrx/demodadsb/map/liveries/B77L_KAR.png new file mode 100644 index 000000000..b5574dd4f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_KAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_LCO.png b/plugins/channelrx/demodadsb/map/liveries/B77L_LCO.png new file mode 100644 index 000000000..c115ce43d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_LCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B77L_LHA_VA.png new file mode 100644 index 000000000..c87eca439 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B77L_LNR.png new file mode 100644 index 000000000..67e1112bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_MSE.png b/plugins/channelrx/demodadsb/map/liveries/B77L_MSE.png new file mode 100644 index 000000000..3571e99a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_MSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_NWS.png b/plugins/channelrx/demodadsb/map/liveries/B77L_NWS.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B77L_OAL_VA.png new file mode 100644 index 000000000..6ee8acf90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_PIA.png b/plugins/channelrx/demodadsb/map/liveries/B77L_PIA.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_PIA_NC.png b/plugins/channelrx/demodadsb/map/liveries/B77L_PIA_NC.png new file mode 100644 index 000000000..7f690eb56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_PIA_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_PLX.png b/plugins/channelrx/demodadsb/map/liveries/B77L_PLX.png new file mode 100644 index 000000000..bb277353d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_PVI.png b/plugins/channelrx/demodadsb/map/liveries/B77L_PVI.png new file mode 100644 index 000000000..0c87f1e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_PVI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_QTR.png b/plugins/channelrx/demodadsb/map/liveries/B77L_QTR.png new file mode 100644 index 000000000..88c2dff97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_REU.png b/plugins/channelrx/demodadsb/map/liveries/B77L_REU.png new file mode 100644 index 000000000..8a8777e66 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_REU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_SOO.png b/plugins/channelrx/demodadsb/map/liveries/B77L_SOO.png new file mode 100644 index 000000000..041b6a0b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_SOO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_SUN.png b/plugins/channelrx/demodadsb/map/liveries/B77L_SUN.png new file mode 100644 index 000000000..dea646002 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_SUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_SWI.png b/plugins/channelrx/demodadsb/map/liveries/B77L_SWI.png new file mode 100644 index 000000000..e2b40f467 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_SWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_TAY.png b/plugins/channelrx/demodadsb/map/liveries/B77L_TAY.png new file mode 100644 index 000000000..e80f9d5c5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_TAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_TUA.png b/plugins/channelrx/demodadsb/map/liveries/B77L_TUA.png new file mode 100644 index 000000000..04316f027 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_UAE.png b/plugins/channelrx/demodadsb/map/liveries/B77L_UAE.png new file mode 100644 index 000000000..819cb4fed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B77L_UKV.png new file mode 100644 index 000000000..781c58908 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B77L_WAT.png new file mode 100644 index 000000000..45e51d98c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77L_XSN.png b/plugins/channelrx/demodadsb/map/liveries/B77L_XSN.png new file mode 100644 index 000000000..1d10c4e21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77L_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W.png b/plugins/channelrx/demodadsb/map/liveries/B77W.png new file mode 100644 index 000000000..5902451fa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_AAL.png new file mode 100644 index 000000000..0cd5ec4b5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_ABG.png b/plugins/channelrx/demodadsb/map/liveries/B77W_ABG.png new file mode 100644 index 000000000..6ad806307 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_ABG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_ACA.png new file mode 100644 index 000000000..20c9ec550 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_AFL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_AFL.png new file mode 100644 index 000000000..83ba7299b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_AFR.png b/plugins/channelrx/demodadsb/map/liveries/B77W_AFR.png new file mode 100644 index 000000000..47bbbfab9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_AIC.png b/plugins/channelrx/demodadsb/map/liveries/B77W_AIC.png new file mode 100644 index 000000000..125f5e04e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_ANA.png new file mode 100644 index 000000000..3785293db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/B77W_ANZ.png new file mode 100644 index 000000000..236e6e72b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_AUH.png b/plugins/channelrx/demodadsb/map/liveries/B77W_AUH.png new file mode 100644 index 000000000..c0724b45a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_AUH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_AZV.png b/plugins/channelrx/demodadsb/map/liveries/B77W_AZV.png new file mode 100644 index 000000000..b66855c2b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_AZV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B77W_BAW.png new file mode 100644 index 000000000..acb848487 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_BBC.png b/plugins/channelrx/demodadsb/map/liveries/B77W_BBC.png new file mode 100644 index 000000000..a0958af6f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_BBC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_BHE.png b/plugins/channelrx/demodadsb/map/liveries/B77W_BHE.png new file mode 100644 index 000000000..8a5805925 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_BHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B77W_BVX.png new file mode 100644 index 000000000..bc4f5fd0a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CAL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CAL.png new file mode 100644 index 000000000..5a2ba77c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CCA.png new file mode 100644 index 000000000..d523e8b9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CES.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CES.png new file mode 100644 index 000000000..a086aa39d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CET.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CET.png new file mode 100644 index 000000000..488bf375a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CPA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CPA.png new file mode 100644 index 000000000..f6d19ceec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CPA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CSN.png new file mode 100644 index 000000000..c030b9a2e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_CXA_VA.png new file mode 100644 index 000000000..1bf875f1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_DLH.png b/plugins/channelrx/demodadsb/map/liveries/B77W_DLH.png new file mode 100644 index 000000000..bb89fba58 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_DTA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_DTA.png new file mode 100644 index 000000000..32acb7019 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_DTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B77W_ETD.png new file mode 100644 index 000000000..3e7d33417 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_EUS.png b/plugins/channelrx/demodadsb/map/liveries/B77W_EUS.png new file mode 100644 index 000000000..7c6c7af3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_EVA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_EVA.png new file mode 100644 index 000000000..9df0455f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_FHA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_FHA.png new file mode 100644 index 000000000..d29f5711c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_FHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_GFA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_GFA.png new file mode 100644 index 000000000..9953ec9e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_GIA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_GIA.png new file mode 100644 index 000000000..b60ba89df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_HAZ.png b/plugins/channelrx/demodadsb/map/liveries/B77W_HAZ.png new file mode 100644 index 000000000..4681316f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_HAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_IGO.png b/plugins/channelrx/demodadsb/map/liveries/B77W_IGO.png new file mode 100644 index 000000000..9400c44c9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_IGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_JAI.png b/plugins/channelrx/demodadsb/map/liveries/B77W_JAI.png new file mode 100644 index 000000000..d6bc5fc39 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_JAI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_JAL.png new file mode 100644 index 000000000..7b2119f86 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_JRR.png b/plugins/channelrx/demodadsb/map/liveries/B77W_JRR.png new file mode 100644 index 000000000..39a440e4f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_JRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_KAL.png new file mode 100644 index 000000000..0f49c9b3a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B77W_KLM.png new file mode 100644 index 000000000..9b174934b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_KQA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_KQA.png new file mode 100644 index 000000000..450b5feee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_LHA_VA.png new file mode 100644 index 000000000..26dbc52a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B77W_LNR.png new file mode 100644 index 000000000..fc9de8794 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_MET.png b/plugins/channelrx/demodadsb/map/liveries/B77W_MET.png new file mode 100644 index 000000000..1a204556e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_MQT.png b/plugins/channelrx/demodadsb/map/liveries/B77W_MQT.png new file mode 100644 index 000000000..54a42d0e0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_MQT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_MSR.png b/plugins/channelrx/demodadsb/map/liveries/B77W_MSR.png new file mode 100644 index 000000000..33e3845b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_NDF.png b/plugins/channelrx/demodadsb/map/liveries/B77W_NDF.png new file mode 100644 index 000000000..350c7d0e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_NTL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_NTL.png new file mode 100644 index 000000000..080ddc8e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_OAL_VA.png new file mode 100644 index 000000000..a36e5b1cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_PAL.png b/plugins/channelrx/demodadsb/map/liveries/B77W_PAL.png new file mode 100644 index 000000000..16a0c1f22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_PIA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_PIA.png new file mode 100644 index 000000000..8e1a8787d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_PIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_PLX.png b/plugins/channelrx/demodadsb/map/liveries/B77W_PLX.png new file mode 100644 index 000000000..5055f5533 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_PLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_QTR.png b/plugins/channelrx/demodadsb/map/liveries/B77W_QTR.png new file mode 100644 index 000000000..743129fb8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_REU.png b/plugins/channelrx/demodadsb/map/liveries/B77W_REU.png new file mode 100644 index 000000000..ea0cdec10 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_REU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_SCO.png b/plugins/channelrx/demodadsb/map/liveries/B77W_SCO.png new file mode 100644 index 000000000..7c6c7af3e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_SDM.png b/plugins/channelrx/demodadsb/map/liveries/B77W_SDM.png new file mode 100644 index 000000000..c7bad3b21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_SIA.png new file mode 100644 index 000000000..326026263 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_SKS.png b/plugins/channelrx/demodadsb/map/liveries/B77W_SKS.png new file mode 100644 index 000000000..6fa641b7e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_SKS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_STW.png b/plugins/channelrx/demodadsb/map/liveries/B77W_STW.png new file mode 100644 index 000000000..80a57cecd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_STW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_SVA.png new file mode 100644 index 000000000..5e41af6b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_TAM.png b/plugins/channelrx/demodadsb/map/liveries/B77W_TAM.png new file mode 100644 index 000000000..2c10f6723 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_TEJ.png b/plugins/channelrx/demodadsb/map/liveries/B77W_TEJ.png new file mode 100644 index 000000000..df0533d9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_TEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_THA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_THA.png new file mode 100644 index 000000000..7ba3aeb68 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_THY.png b/plugins/channelrx/demodadsb/map/liveries/B77W_THY.png new file mode 100644 index 000000000..5a92396a8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_TKY.png b/plugins/channelrx/demodadsb/map/liveries/B77W_TKY.png new file mode 100644 index 000000000..afa6ab9dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_TSO.png b/plugins/channelrx/demodadsb/map/liveries/B77W_TSO.png new file mode 100644 index 000000000..6630bbd75 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_TSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_TUA.png b/plugins/channelrx/demodadsb/map/liveries/B77W_TUA.png new file mode 100644 index 000000000..7e7aa49ca Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_UAE.png b/plugins/channelrx/demodadsb/map/liveries/B77W_UAE.png new file mode 100644 index 000000000..d408f7e52 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_UAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_VIR.png b/plugins/channelrx/demodadsb/map/liveries/B77W_VIR.png new file mode 100644 index 000000000..82318e68e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_VLC.png b/plugins/channelrx/demodadsb/map/liveries/B77W_VLC.png new file mode 100644 index 000000000..761b935e6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_VLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_VOZ.png b/plugins/channelrx/demodadsb/map/liveries/B77W_VOZ.png new file mode 100644 index 000000000..6380cb628 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_VOZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B77W_WAT.png new file mode 100644 index 000000000..598bd879f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77W_WYB.png b/plugins/channelrx/demodadsb/map/liveries/B77W_WYB.png new file mode 100644 index 000000000..aa52bf5b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77W_WYB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_ETD_NC.png b/plugins/channelrx/demodadsb/map/liveries/B77w_ETD_NC.png new file mode 100644 index 000000000..e1da6e75d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_ETD_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B77w_ETH.png new file mode 100644 index 000000000..beb66219d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B77w_FBV.png new file mode 100644 index 000000000..8d7873c36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_KAC.png b/plugins/channelrx/demodadsb/map/liveries/B77w_KAC.png new file mode 100644 index 000000000..acac0d8df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_KAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_NWS.png b/plugins/channelrx/demodadsb/map/liveries/B77w_NWS.png new file mode 100644 index 000000000..a3e2f86bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_NWS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_QTR_WC.png b/plugins/channelrx/demodadsb/map/liveries/B77w_QTR_WC.png new file mode 100644 index 000000000..40d41fb9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_QTR_WC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_SWR.png b/plugins/channelrx/demodadsb/map/liveries/B77w_SWR.png new file mode 100644 index 000000000..358991fbd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B77w_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B77w_UAL.png new file mode 100644 index 000000000..f40ce7cc4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B77w_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788.png b/plugins/channelrx/demodadsb/map/liveries/B788.png new file mode 100644 index 000000000..e9bc03f2a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B788_AAL.png new file mode 100644 index 000000000..1e3505573 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B788_ACA.png new file mode 100644 index 000000000..a03816305 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AEA.png b/plugins/channelrx/demodadsb/map/liveries/B788_AEA.png new file mode 100644 index 000000000..bb0ead39c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AFL.png b/plugins/channelrx/demodadsb/map/liveries/B788_AFL.png new file mode 100644 index 000000000..a2e04e16a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AHY.png b/plugins/channelrx/demodadsb/map/liveries/B788_AHY.png new file mode 100644 index 000000000..73165622e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AIC.png b/plugins/channelrx/demodadsb/map/liveries/B788_AIC.png new file mode 100644 index 000000000..3d3bf2977 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AJX.png b/plugins/channelrx/demodadsb/map/liveries/B788_AJX.png new file mode 100644 index 000000000..2db72bc95 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AJX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AMX.png b/plugins/channelrx/demodadsb/map/liveries/B788_AMX.png new file mode 100644 index 000000000..b4ca1f0d4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B788_ANA.png new file mode 100644 index 000000000..2733f8ee4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_ATC.png b/plugins/channelrx/demodadsb/map/liveries/B788_ATC.png new file mode 100644 index 000000000..d40f7a697 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_ATC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_AVA.png b/plugins/channelrx/demodadsb/map/liveries/B788_AVA.png new file mode 100644 index 000000000..deb453b6c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B788_BAW.png new file mode 100644 index 000000000..8f420d186 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_BBC.png b/plugins/channelrx/demodadsb/map/liveries/B788_BBC.png new file mode 100644 index 000000000..74f191516 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_BBC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B788_BVX.png new file mode 100644 index 000000000..02048e70f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_CHH.png b/plugins/channelrx/demodadsb/map/liveries/B788_CHH.png new file mode 100644 index 000000000..6ed0a6c0d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B788_CSN.png new file mode 100644 index 000000000..de3467c6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_CXA.png b/plugins/channelrx/demodadsb/map/liveries/B788_CXA.png new file mode 100644 index 000000000..e29dae2e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_CXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B788_ELY.png new file mode 100644 index 000000000..52a8ce673 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B788_ETD.png new file mode 100644 index 000000000..c504e9008 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B788_ETH.png new file mode 100644 index 000000000..74247fa21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_IAW.png b/plugins/channelrx/demodadsb/map/liveries/B788_IAW.png new file mode 100644 index 000000000..53a3dddaf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_JAF.png b/plugins/channelrx/demodadsb/map/liveries/B788_JAF.png new file mode 100644 index 000000000..bce710298 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_JAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B788_JAL.png new file mode 100644 index 000000000..8ecf8e122 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_JST.png b/plugins/channelrx/demodadsb/map/liveries/B788_JST.png new file mode 100644 index 000000000..d9dd82582 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_JST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_KQA.png b/plugins/channelrx/demodadsb/map/liveries/B788_KQA.png new file mode 100644 index 000000000..1b6f642bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_LAN.png b/plugins/channelrx/demodadsb/map/liveries/B788_LAN.png new file mode 100644 index 000000000..c62e30d57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_LOT.png b/plugins/channelrx/demodadsb/map/liveries/B788_LOT.png new file mode 100644 index 000000000..7aebfba04 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_LOT_OLYMPIC_TEAM.png b/plugins/channelrx/demodadsb/map/liveries/B788_LOT_OLYMPIC_TEAM.png new file mode 100644 index 000000000..9511961a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_LOT_OLYMPIC_TEAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_NAX.png b/plugins/channelrx/demodadsb/map/liveries/B788_NAX.png new file mode 100644 index 000000000..494719266 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_NAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_NLH.png b/plugins/channelrx/demodadsb/map/liveries/B788_NLH.png new file mode 100644 index 000000000..9aa2fd254 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_NLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_OMA.png b/plugins/channelrx/demodadsb/map/liveries/B788_OMA.png new file mode 100644 index 000000000..ff36fe387 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_OMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_PFF.png b/plugins/channelrx/demodadsb/map/liveries/B788_PFF.png new file mode 100644 index 000000000..48f4b53e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_QTR.png b/plugins/channelrx/demodadsb/map/liveries/B788_QTR.png new file mode 100644 index 000000000..f4618fb40 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B788_RAM.png new file mode 100644 index 000000000..2d4f84b22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_RBA.png b/plugins/channelrx/demodadsb/map/liveries/B788_RBA.png new file mode 100644 index 000000000..cfd48f77f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_RBA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_REU.png b/plugins/channelrx/demodadsb/map/liveries/B788_REU.png new file mode 100644 index 000000000..3ff75e4ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_REU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_RJA.png b/plugins/channelrx/demodadsb/map/liveries/B788_RJA.png new file mode 100644 index 000000000..832ab2e63 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_TFL.png b/plugins/channelrx/demodadsb/map/liveries/B788_TFL.png new file mode 100644 index 000000000..0bc17e12c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_TFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_TGW.png b/plugins/channelrx/demodadsb/map/liveries/B788_TGW.png new file mode 100644 index 000000000..3ad87047b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_TGW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_THA.png b/plugins/channelrx/demodadsb/map/liveries/B788_THA.png new file mode 100644 index 000000000..94ee45a56 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_TOM.png b/plugins/channelrx/demodadsb/map/liveries/B788_TOM.png new file mode 100644 index 000000000..f62f17e30 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_TOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_TZP.png b/plugins/channelrx/demodadsb/map/liveries/B788_TZP.png new file mode 100644 index 000000000..f937eaeb7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_TZP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B788_UAL.png new file mode 100644 index 000000000..5c5321bb5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B788_UKV.png new file mode 100644 index 000000000..c3960b54d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_UZB.png b/plugins/channelrx/demodadsb/map/liveries/B788_UZB.png new file mode 100644 index 000000000..db771b34b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_UZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B788_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B788_WAT.png new file mode 100644 index 000000000..d26ceea60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B788_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789.png b/plugins/channelrx/demodadsb/map/liveries/B789.png new file mode 100644 index 000000000..c75aaa126 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AAL.png b/plugins/channelrx/demodadsb/map/liveries/B789_AAL.png new file mode 100644 index 000000000..a797959e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AAN.png b/plugins/channelrx/demodadsb/map/liveries/B789_AAN.png new file mode 100644 index 000000000..92c6d50f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ACA.png b/plugins/channelrx/demodadsb/map/liveries/B789_ACA.png new file mode 100644 index 000000000..f68ebd8dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ADH.png b/plugins/channelrx/demodadsb/map/liveries/B789_ADH.png new file mode 100644 index 000000000..56a68d777 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ADH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AEA.png b/plugins/channelrx/demodadsb/map/liveries/B789_AEA.png new file mode 100644 index 000000000..b94e37c29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AFL.png b/plugins/channelrx/demodadsb/map/liveries/B789_AFL.png new file mode 100644 index 000000000..6b78c8359 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AFR.png b/plugins/channelrx/demodadsb/map/liveries/B789_AFR.png new file mode 100644 index 000000000..cf09e091f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AIC_VTI.png b/plugins/channelrx/demodadsb/map/liveries/B789_AIC_VTI.png new file mode 100644 index 000000000..eb8a97be5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AIC_VTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AMX.png b/plugins/channelrx/demodadsb/map/liveries/B789_AMX.png new file mode 100644 index 000000000..a2cd16bdd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B789_ANA.png new file mode 100644 index 000000000..f0794d781 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/B789_ANZ.png new file mode 100644 index 000000000..ef8e7f774 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ANZ_BL.png b/plugins/channelrx/demodadsb/map/liveries/B789_ANZ_BL.png new file mode 100644 index 000000000..93e9ffaf1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ANZ_BL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_APZ.png b/plugins/channelrx/demodadsb/map/liveries/B789_APZ.png new file mode 100644 index 000000000..1919c80d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_APZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ATC.png b/plugins/channelrx/demodadsb/map/liveries/B789_ATC.png new file mode 100644 index 000000000..bdf081101 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ATC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AUA.png b/plugins/channelrx/demodadsb/map/liveries/B789_AUA.png new file mode 100644 index 000000000..b51a7c0dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_AVA.png b/plugins/channelrx/demodadsb/map/liveries/B789_AVA.png new file mode 100644 index 000000000..458f40caf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_BAV.png b/plugins/channelrx/demodadsb/map/liveries/B789_BAV.png new file mode 100644 index 000000000..d1a6ae0b5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_BAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B789_BAW.png new file mode 100644 index 000000000..d85e7bd1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_BBC.png b/plugins/channelrx/demodadsb/map/liveries/B789_BBC.png new file mode 100644 index 000000000..7650e619f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_BBC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_BLX.png b/plugins/channelrx/demodadsb/map/liveries/B789_BLX.png new file mode 100644 index 000000000..96e216ce2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_BLX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_BVX.png b/plugins/channelrx/demodadsb/map/liveries/B789_BVX.png new file mode 100644 index 000000000..80c7ea1f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_CCA.png b/plugins/channelrx/demodadsb/map/liveries/B789_CCA.png new file mode 100644 index 000000000..4ae90d14d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_CCA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_CES.png b/plugins/channelrx/demodadsb/map/liveries/B789_CES.png new file mode 100644 index 000000000..df0dffee6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_CES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_CHH.png b/plugins/channelrx/demodadsb/map/liveries/B789_CHH.png new file mode 100644 index 000000000..0dbcb0c57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_CHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_CSH.png b/plugins/channelrx/demodadsb/map/liveries/B789_CSH.png new file mode 100644 index 000000000..3bf2139f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_CSH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_CSN.png b/plugins/channelrx/demodadsb/map/liveries/B789_CSN.png new file mode 100644 index 000000000..4a84e0be4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_CXA.png b/plugins/channelrx/demodadsb/map/liveries/B789_CXA.png new file mode 100644 index 000000000..f6562cc15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_CXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_DKH.png b/plugins/channelrx/demodadsb/map/liveries/B789_DKH.png new file mode 100644 index 000000000..cccad1c29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_DKH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_DLH.png b/plugins/channelrx/demodadsb/map/liveries/B789_DLH.png new file mode 100644 index 000000000..f42dae962 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_EAG.png b/plugins/channelrx/demodadsb/map/liveries/B789_EAG.png new file mode 100644 index 000000000..f0b24b372 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ELY.png b/plugins/channelrx/demodadsb/map/liveries/B789_ELY.png new file mode 100644 index 000000000..c6d5cce12 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ELY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B789_ETD.png new file mode 100644 index 000000000..5db2fd0ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_ETH.png b/plugins/channelrx/demodadsb/map/liveries/B789_ETH.png new file mode 100644 index 000000000..3d004b985 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_EVA.png b/plugins/channelrx/demodadsb/map/liveries/B789_EVA.png new file mode 100644 index 000000000..aa2f35159 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_FBV.png b/plugins/channelrx/demodadsb/map/liveries/B789_FBV.png new file mode 100644 index 000000000..41104b0c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_FBV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_GFA.png b/plugins/channelrx/demodadsb/map/liveries/B789_GFA.png new file mode 100644 index 000000000..65616cb9d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_GFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_HAL.png b/plugins/channelrx/demodadsb/map/liveries/B789_HAL.png new file mode 100644 index 000000000..2cfbac327 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_HAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_HVN.png b/plugins/channelrx/demodadsb/map/liveries/B789_HVN.png new file mode 100644 index 000000000..c0d018d3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_IGO.png b/plugins/channelrx/demodadsb/map/liveries/B789_IGO.png new file mode 100644 index 000000000..c2a19ea3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_IGO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_JAL.png b/plugins/channelrx/demodadsb/map/liveries/B789_JAL.png new file mode 100644 index 000000000..b11b624f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B789_KAL.png new file mode 100644 index 000000000..60d5c07cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B789_KLM.png new file mode 100644 index 000000000..dbc59be58 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_LAN.png b/plugins/channelrx/demodadsb/map/liveries/B789_LAN.png new file mode 100644 index 000000000..25dfcd4bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_LAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/B789_LHA_VA.png new file mode 100644 index 000000000..27d95a24a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_LIC.png b/plugins/channelrx/demodadsb/map/liveries/B789_LIC.png new file mode 100644 index 000000000..3e983448b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_LIC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_LNR.png b/plugins/channelrx/demodadsb/map/liveries/B789_LNR.png new file mode 100644 index 000000000..16b93755c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_LNR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_LOT.png b/plugins/channelrx/demodadsb/map/liveries/B789_LOT.png new file mode 100644 index 000000000..8f786e0fb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_LOT_INDEPENDENCE.png b/plugins/channelrx/demodadsb/map/liveries/B789_LOT_INDEPENDENCE.png new file mode 100644 index 000000000..bbf465307 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_LOT_INDEPENDENCE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_MET.png b/plugins/channelrx/demodadsb/map/liveries/B789_MET.png new file mode 100644 index 000000000..fec742303 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_MGL.png b/plugins/channelrx/demodadsb/map/liveries/B789_MGL.png new file mode 100644 index 000000000..55b67e302 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_MGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_MSE.png b/plugins/channelrx/demodadsb/map/liveries/B789_MSE.png new file mode 100644 index 000000000..167a4dd83 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_MSE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_MSR.png b/plugins/channelrx/demodadsb/map/liveries/B789_MSR.png new file mode 100644 index 000000000..6c604069c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NAX_FREDDIE.png b/plugins/channelrx/demodadsb/map/liveries/B789_NAX_FREDDIE.png new file mode 100644 index 000000000..ccc4156ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NAX_FREDDIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NBT.png b/plugins/channelrx/demodadsb/map/liveries/B789_NBT.png new file mode 100644 index 000000000..add5b9b84 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NDF.png b/plugins/channelrx/demodadsb/map/liveries/B789_NDF.png new file mode 100644 index 000000000..31163727a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NDF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NLH.png b/plugins/channelrx/demodadsb/map/liveries/B789_NLH.png new file mode 100644 index 000000000..ccc4156ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NOS.png b/plugins/channelrx/demodadsb/map/liveries/B789_NOS.png new file mode 100644 index 000000000..7a9281acb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NOS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NRS.png b/plugins/channelrx/demodadsb/map/liveries/B789_NRS.png new file mode 100644 index 000000000..68969d8ff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NRS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NSW.png b/plugins/channelrx/demodadsb/map/liveries/B789_NSW.png new file mode 100644 index 000000000..dc5273d15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NSW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_NTL.png b/plugins/channelrx/demodadsb/map/liveries/B789_NTL.png new file mode 100644 index 000000000..4186c52a2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/B789_OAL_VA.png new file mode 100644 index 000000000..d7cff74df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_OMA.png b/plugins/channelrx/demodadsb/map/liveries/B789_OMA.png new file mode 100644 index 000000000..725da32e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_OMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_PFF.png b/plugins/channelrx/demodadsb/map/liveries/B789_PFF.png new file mode 100644 index 000000000..26cdfd668 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_QFA.png b/plugins/channelrx/demodadsb/map/liveries/B789_QFA.png new file mode 100644 index 000000000..5e2cf0df8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_QFA_100.png b/plugins/channelrx/demodadsb/map/liveries/B789_QFA_100.png new file mode 100644 index 000000000..258dd783f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_QFA_100.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_QFA_2.png b/plugins/channelrx/demodadsb/map/liveries/B789_QFA_2.png new file mode 100644 index 000000000..bdf83c20d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_QFA_2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_QTR.png b/plugins/channelrx/demodadsb/map/liveries/B789_QTR.png new file mode 100644 index 000000000..fe697cf1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_QTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_RAM.png b/plugins/channelrx/demodadsb/map/liveries/B789_RAM.png new file mode 100644 index 000000000..f5bbd2eaa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_RXI.png b/plugins/channelrx/demodadsb/map/liveries/B789_RXI.png new file mode 100644 index 000000000..bc379e6c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_RXI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B789_SVA.png new file mode 100644 index 000000000..dbb1fcd4d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_TAM.png b/plugins/channelrx/demodadsb/map/liveries/B789_TAM.png new file mode 100644 index 000000000..790f2d55d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_TGW.png b/plugins/channelrx/demodadsb/map/liveries/B789_TGW.png new file mode 100644 index 000000000..615436c98 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_TGW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_THA.png b/plugins/channelrx/demodadsb/map/liveries/B789_THA.png new file mode 100644 index 000000000..7c795c0eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_THA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_THT.png b/plugins/channelrx/demodadsb/map/liveries/B789_THT.png new file mode 100644 index 000000000..340a99760 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_THT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_THY.png b/plugins/channelrx/demodadsb/map/liveries/B789_THY.png new file mode 100644 index 000000000..ffba7451e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_THY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_TKY.png b/plugins/channelrx/demodadsb/map/liveries/B789_TKY.png new file mode 100644 index 000000000..6baa1ca17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_TOM.png b/plugins/channelrx/demodadsb/map/liveries/B789_TOM.png new file mode 100644 index 000000000..f5f4dbb92 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_TOM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_TZP.png b/plugins/channelrx/demodadsb/map/liveries/B789_TZP.png new file mode 100644 index 000000000..9a42751fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_TZP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_UAL_NC.png b/plugins/channelrx/demodadsb/map/liveries/B789_UAL_NC.png new file mode 100644 index 000000000..8341e5309 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_UAL_NC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_UBT.png b/plugins/channelrx/demodadsb/map/liveries/B789_UBT.png new file mode 100644 index 000000000..c95f4164e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_UBT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B789_UKV.png new file mode 100644 index 000000000..83e03fe77 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_VIR.png b/plugins/channelrx/demodadsb/map/liveries/B789_VIR.png new file mode 100644 index 000000000..ccbcf9749 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_VIR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_VSP.png b/plugins/channelrx/demodadsb/map/liveries/B789_VSP.png new file mode 100644 index 000000000..fcebc386a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B789_WAT.png new file mode 100644 index 000000000..e6ecd67f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B789_WJA.png b/plugins/channelrx/demodadsb/map/liveries/B789_WJA.png new file mode 100644 index 000000000..655fac92a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B789_WJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X.png b/plugins/channelrx/demodadsb/map/liveries/B78X.png new file mode 100644 index 000000000..17b8b08df Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_ANA.png b/plugins/channelrx/demodadsb/map/liveries/B78X_ANA.png new file mode 100644 index 000000000..935b88ba6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_BAW.png b/plugins/channelrx/demodadsb/map/liveries/B78X_BAW.png new file mode 100644 index 000000000..53c1ede8f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_BAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_ETD.png b/plugins/channelrx/demodadsb/map/liveries/B78X_ETD.png new file mode 100644 index 000000000..e314d6191 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_ETD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_EVA.png b/plugins/channelrx/demodadsb/map/liveries/B78X_EVA.png new file mode 100644 index 000000000..e487246f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_HVN.png b/plugins/channelrx/demodadsb/map/liveries/B78X_HVN.png new file mode 100644 index 000000000..e310c8e79 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_HVN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_KAL.png b/plugins/channelrx/demodadsb/map/liveries/B78X_KAL.png new file mode 100644 index 000000000..9f229f0ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_KLM.png b/plugins/channelrx/demodadsb/map/liveries/B78X_KLM.png new file mode 100644 index 000000000..10df2d447 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_SIA.png b/plugins/channelrx/demodadsb/map/liveries/B78X_SIA.png new file mode 100644 index 000000000..c6f38093b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_SIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_SVA.png b/plugins/channelrx/demodadsb/map/liveries/B78X_SVA.png new file mode 100644 index 000000000..9aaac4fae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_UAL.png b/plugins/channelrx/demodadsb/map/liveries/B78X_UAL.png new file mode 100644 index 000000000..e66d33feb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_UKV.png b/plugins/channelrx/demodadsb/map/liveries/B78X_UKV.png new file mode 100644 index 000000000..731adc5f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/B78X_WAT.png b/plugins/channelrx/demodadsb/map/liveries/B78X_WAT.png new file mode 100644 index 000000000..93cb8cca9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/B78X_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1.png b/plugins/channelrx/demodadsb/map/liveries/BCS1.png new file mode 100644 index 000000000..da3542471 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_CTN.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_CTN.png new file mode 100644 index 000000000..06c497338 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_CTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_DAL.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_DAL.png new file mode 100644 index 000000000..a67d6b7ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_ITY.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_ITY.png new file mode 100644 index 000000000..f492e4d8f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_ITY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_LZB.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_LZB.png new file mode 100644 index 000000000..22ce9a046 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_LZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_MLM.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_MLM.png new file mode 100644 index 000000000..71d5d129c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_MLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_SWR.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_SWR.png new file mode 100644 index 000000000..3efc824aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS1_WAT.png b/plugins/channelrx/demodadsb/map/liveries/BCS1_WAT.png new file mode 100644 index 000000000..8c80bbe18 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS1_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3.png b/plugins/channelrx/demodadsb/map/liveries/BCS3.png new file mode 100644 index 000000000..a1209e8c7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_ACA.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_ACA.png new file mode 100644 index 000000000..258a6631b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_AFR.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_AFR.png new file mode 100644 index 000000000..2fb9a3479 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_ATC.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_ATC.png new file mode 100644 index 000000000..8374d282c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_ATC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_BTI.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_BTI.png new file mode 100644 index 000000000..292fc0d22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_BTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_CSA.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_CSA.png new file mode 100644 index 000000000..0a79f67b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_CSA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_CTN.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_CTN.png new file mode 100644 index 000000000..91c835227 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_CTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_CYP.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_CYP.png new file mode 100644 index 000000000..dcdc46ef4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_CYP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_DAL.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_DAL.png new file mode 100644 index 000000000..796d9f901 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_IAN.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_IAN.png new file mode 100644 index 000000000..e75d7765d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_IAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_IAW.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_IAW.png new file mode 100644 index 000000000..54c8e044f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_ITY.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_ITY.png new file mode 100644 index 000000000..91f7dba08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_ITY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_ITY_Born.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_ITY_Born.png new file mode 100644 index 000000000..c002bf172 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_ITY_Born.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_JBU.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_JBU.png new file mode 100644 index 000000000..319af088e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_JBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_JBU_HOPS.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_JBU_HOPS.png new file mode 100644 index 000000000..90e581825 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_JBU_HOPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_KAL.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_KAL.png new file mode 100644 index 000000000..c8cbe4da3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_KAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_LZB.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_LZB.png new file mode 100644 index 000000000..cda007a46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_LZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_MSR.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_MSR.png new file mode 100644 index 000000000..8b3635a3f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_MXY.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_MXY.png new file mode 100644 index 000000000..ef6bdfa33 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_MXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_QLK.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_QLK.png new file mode 100644 index 000000000..60a51b0a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_QLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OLAV.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OLAV.png new file mode 100644 index 000000000..ddc016451 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OLAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OMER.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OMER.png new file mode 100644 index 000000000..6e2e3f275 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OMER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OTER.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OTER.png new file mode 100644 index 000000000..db9ac7312 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_REU_OTER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_SWR.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_SWR.png new file mode 100644 index 000000000..653710255 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BCS3_WAT.png b/plugins/channelrx/demodadsb/map/liveries/BCS3_WAT.png new file mode 100644 index 000000000..ee08d3f78 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BCS3_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_BGT.png b/plugins/channelrx/demodadsb/map/liveries/BE20_BGT.png new file mode 100644 index 000000000..d141a6245 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_BGT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_C-GSAE.png b/plugins/channelrx/demodadsb/map/liveries/BE20_C-GSAE.png new file mode 100644 index 000000000..2fb89d0af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_C-GSAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_CAT.png b/plugins/channelrx/demodadsb/map/liveries/BE20_CAT.png new file mode 100644 index 000000000..ef167f2b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_CAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_D-IKOB.png b/plugins/channelrx/demodadsb/map/liveries/BE20_D-IKOB.png new file mode 100644 index 000000000..6db0adf45 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_D-IKOB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_HER.png b/plugins/channelrx/demodadsb/map/liveries/BE20_HER.png new file mode 100644 index 000000000..bde2edf39 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_HER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_UK4_ZK450.png b/plugins/channelrx/demodadsb/map/liveries/BE20_UK4_ZK450.png new file mode 100644 index 000000000..96c702928 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_UK4_ZK450.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/BE20_ZS-PEZ.png b/plugins/channelrx/demodadsb/map/liveries/BE20_ZS-PEZ.png new file mode 100644 index 000000000..5ed9e7d88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/BE20_ZS-PEZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C130_AU4_06.png b/plugins/channelrx/demodadsb/map/liveries/C130_AU4_06.png new file mode 100644 index 000000000..b2bb31ecc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C130_AU4_06.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C130_SE1_841.png b/plugins/channelrx/demodadsb/map/liveries/C130_SE1_841.png new file mode 100644 index 000000000..bda25d9cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C130_SE1_841.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C130_US2_FA.png b/plugins/channelrx/demodadsb/map/liveries/C130_US2_FA.png new file mode 100644 index 000000000..9d66c6c19 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C130_US2_FA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C150_r2.png b/plugins/channelrx/demodadsb/map/liveries/C150_r2.png new file mode 100644 index 000000000..64feb76f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C150_r2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C172_r2.png b/plugins/channelrx/demodadsb/map/liveries/C172_r2.png new file mode 100644 index 000000000..0f7f2e1b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C172_r2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C17_UK4_ZZ171.png b/plugins/channelrx/demodadsb/map/liveries/C17_UK4_ZZ171.png new file mode 100644 index 000000000..95e0c8340 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C17_UK4_ZZ171.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C30J_NO4_5607.png b/plugins/channelrx/demodadsb/map/liveries/C30J_NO4_5607.png new file mode 100644 index 000000000..5cd648293 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C30J_NO4_5607.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C30J_UK4_ZH880.png b/plugins/channelrx/demodadsb/map/liveries/C30J_UK4_ZH880.png new file mode 100644 index 000000000..b36a6e439 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C30J_UK4_ZH880.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C30J_US4_21434.png b/plugins/channelrx/demodadsb/map/liveries/C30J_US4_21434.png new file mode 100644 index 000000000..072ceb4a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C30J_US4_21434.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C421_BGM.png b/plugins/channelrx/demodadsb/map/liveries/C421_BGM.png new file mode 100644 index 000000000..8ca1e7e50 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C421_BGM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C421_D-ICVW.png b/plugins/channelrx/demodadsb/map/liveries/C421_D-ICVW.png new file mode 100644 index 000000000..7ba21ca7c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C421_D-ICVW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C421_EC-IHY.png b/plugins/channelrx/demodadsb/map/liveries/C421_EC-IHY.png new file mode 100644 index 000000000..122ce2135 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C421_EC-IHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C421_EC-ILM.png b/plugins/channelrx/demodadsb/map/liveries/C421_EC-ILM.png new file mode 100644 index 000000000..8c46ba46b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C421_EC-ILM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/C5_US4_40061.png b/plugins/channelrx/demodadsb/map/liveries/C5_US4_40061.png new file mode 100644 index 000000000..c4aa54aba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/C5_US4_40061.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CL41_CA4_SB2.png b/plugins/channelrx/demodadsb/map/liveries/CL41_CA4_SB2.png new file mode 100644 index 000000000..c96ccc61e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CL41_CA4_SB2.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ACA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ACA.png new file mode 100644 index 000000000..b301ac167 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ACV.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ACV.png new file mode 100644 index 000000000..c8955a8fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ACV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ADR.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ADR.png new file mode 100644 index 000000000..fd9f2ad80 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ADR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_AFR.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AFR.png new file mode 100644 index 000000000..061ff273d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_AGA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AGA.png new file mode 100644 index 000000000..6a69a0e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ALZ.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ALZ.png new file mode 100644 index 000000000..7beea4cec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ALZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ANE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ANE.png new file mode 100644 index 000000000..bd43ce5c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ANE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ASQ.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ASQ.png new file mode 100644 index 000000000..75d62d327 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ASQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_AUA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AUA.png new file mode 100644 index 000000000..3208813fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_AWE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AWE.png new file mode 100644 index 000000000..8e45c3cc8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_AWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_BGM.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_BGM.png new file mode 100644 index 000000000..d87ed6e97 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_BGM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_BRU.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_BRU.png new file mode 100644 index 000000000..efaa43a3b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_BZH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_BZH.png new file mode 100644 index 000000000..0be979a1a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_BZH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_CDA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CDA.png new file mode 100644 index 000000000..c8955a8fc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_CDG.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CDG.png new file mode 100644 index 000000000..6cbfe6519 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CDG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_CIM.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CIM.png new file mode 100644 index 000000000..84e9a8208 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CIM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_COM.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_COM.png new file mode 100644 index 000000000..c12ad05af Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_COM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_CSH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CSH.png new file mode 100644 index 000000000..10b5d3a71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CSH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_CYH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CYH.png new file mode 100644 index 000000000..657350fa8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_CYH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_DAN.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_DAN.png new file mode 100644 index 000000000..6dee0ff5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_DAN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_DLA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_DLA.png new file mode 100644 index 000000000..0eb47db48 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_DLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_DLH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_DLH.png new file mode 100644 index 000000000..8268f76fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_EGF.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EGF.png new file mode 100644 index 000000000..aca8d3b71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_EMR.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EMR.png new file mode 100644 index 000000000..6a69a0e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EMR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_EUK.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EUK.png new file mode 100644 index 000000000..6a69a0e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EUK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_EWG.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EWG.png new file mode 100644 index 000000000..bd94a00ac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_EXY.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EXY.png new file mode 100644 index 000000000..6a0971d82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_EXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_FFT.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_FFT.png new file mode 100644 index 000000000..72537af30 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_FWA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_FWA.png new file mode 100644 index 000000000..6a69a0e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_FWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_GAL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_GAL.png new file mode 100644 index 000000000..6a69a0e8c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_GAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_GFV.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_GFV.png new file mode 100644 index 000000000..439eeab6e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_GFV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_HIS.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_HIS.png new file mode 100644 index 000000000..44b8f5853 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_HIS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_IAE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_IAE.png new file mode 100644 index 000000000..749fdf176 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_JAL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_JAL.png new file mode 100644 index 000000000..a62765e53 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_JIA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_JIA.png new file mode 100644 index 000000000..74351c242 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_JIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_JZA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_JZA.png new file mode 100644 index 000000000..09faa9871 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_JZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_LDA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_LDA.png new file mode 100644 index 000000000..a32ffe5b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_LDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_MAH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_MAH.png new file mode 100644 index 000000000..e44b36266 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_MAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_MSO.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_MSO.png new file mode 100644 index 000000000..e4e24ec92 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_MSO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_MXI.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_MXI.png new file mode 100644 index 000000000..5de6142d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_MXI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_NWA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_NWA.png new file mode 100644 index 000000000..a76be574e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_PWV.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_PWV.png new file mode 100644 index 000000000..59543548a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_PWV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_QXE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_QXE.png new file mode 100644 index 000000000..6c2a06339 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_QXE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_SHD.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_SHD.png new file mode 100644 index 000000000..e020beeda Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_SHD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_SKW.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_SKW.png new file mode 100644 index 000000000..ef9ba9d7e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_SKW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_SSF.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_SSF.png new file mode 100644 index 000000000..7bb62bba5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_SSF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_TAO.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_TAO.png new file mode 100644 index 000000000..4e4d95923 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_TAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_TRS.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_TRS.png new file mode 100644 index 000000000..f280175e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_TRS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_UAL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_UAL.png new file mode 100644 index 000000000..d2171cd85 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_UTA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_UTA.png new file mode 100644 index 000000000..fe007a958 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_UTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_UTN.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_UTN.png new file mode 100644 index 000000000..de2924397 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_UTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_VCV.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_VCV.png new file mode 100644 index 000000000..7d621e0f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_VCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ2_ZMA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ZMA.png new file mode 100644 index 000000000..63ef4b49e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ2_ZMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7.png new file mode 100644 index 000000000..1f72f8091 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_AAL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_AAL.png new file mode 100644 index 000000000..15f851f06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_AFR.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_AFR.png new file mode 100644 index 000000000..22a64f575 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_ASH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_ASH.png new file mode 100644 index 000000000..71e430cac Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_ASH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_ASQ.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_ASQ.png new file mode 100644 index 000000000..48669fad5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_ASQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_BRU.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_BRU.png new file mode 100644 index 000000000..ab12e5da1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_BVX.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_BVX.png new file mode 100644 index 000000000..3c67a0a26 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_CLH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_CLH.png new file mode 100644 index 000000000..463938f7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_CLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_DAL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_DAL.png new file mode 100644 index 000000000..04d800806 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_DLH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_DLH.png new file mode 100644 index 000000000..548d3a1ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_EGF.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_EGF.png new file mode 100644 index 000000000..03e1ed697 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_EGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_FFT.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_FFT.png new file mode 100644 index 000000000..d54f35cd1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_GJS.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_GJS.png new file mode 100644 index 000000000..19e81ef89 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_GJS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_IAE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_IAE.png new file mode 100644 index 000000000..46dccd2d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_IBX.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_IBX.png new file mode 100644 index 000000000..f1452a3a6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_IBX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_JIA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_JIA.png new file mode 100644 index 000000000..66beaafff Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_JIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_JZA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_JZA.png new file mode 100644 index 000000000..8cd54050a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_JZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_LLM.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_LLM.png new file mode 100644 index 000000000..7132f5aa6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_LLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_MGL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_MGL.png new file mode 100644 index 000000000..2ca32bd7d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_MGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_PFF.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_PFF.png new file mode 100644 index 000000000..c954601e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_PFF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_QXE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_QXE.png new file mode 100644 index 000000000..5831dd9ce Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_QXE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_RLU.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_RLU.png new file mode 100644 index 000000000..dce5ae954 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_RLU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_RLU_WHITE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_RLU_WHITE.png new file mode 100644 index 000000000..aedfbab67 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_RLU_WHITE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_SKW.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_SKW.png new file mode 100644 index 000000000..4c5eb6eea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_SKW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_SSF.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_SSF.png new file mode 100644 index 000000000..3a0c57fa0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_SSF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_TGZ.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_TGZ.png new file mode 100644 index 000000000..3275fad0b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_TGZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_TUA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_TUA.png new file mode 100644 index 000000000..76d15ee61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_TUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_UAL.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_UAL.png new file mode 100644 index 000000000..74f1ac566 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_UKV.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_UKV.png new file mode 100644 index 000000000..737346132 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_UVT.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_UVT.png new file mode 100644 index 000000000..d1c2687b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_UVT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ7_WAT.png b/plugins/channelrx/demodadsb/map/liveries/CRJ7_WAT.png new file mode 100644 index 000000000..bb899e704 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ7_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_ANE.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_ANE.png new file mode 100644 index 000000000..1e8c2dbc0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_ANE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_ASH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_ASH.png new file mode 100644 index 000000000..d38765f9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_ASH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_ASQ.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_ASQ.png new file mode 100644 index 000000000..9184afda0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_ASQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_CLH.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_CLH.png new file mode 100644 index 000000000..ccf64429d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_CLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_IAW.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_IAW.png new file mode 100644 index 000000000..af2d4453d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_IAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_JZA.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_JZA.png new file mode 100644 index 000000000..79c626cba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_JZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_SAS.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_SAS.png new file mode 100644 index 000000000..32eb0eb28 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJ9_TUX.png b/plugins/channelrx/demodadsb/map/liveries/CRJ9_TUX.png new file mode 100644 index 000000000..707c39e50 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJ9_TUX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJX_ANE.png b/plugins/channelrx/demodadsb/map/liveries/CRJX_ANE.png new file mode 100644 index 000000000..f46f462dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJX_ANE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJX_GIA.png b/plugins/channelrx/demodadsb/map/liveries/CRJX_GIA.png new file mode 100644 index 000000000..522cae189 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJX_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/CRJX_HOP.png b/plugins/channelrx/demodadsb/map/liveries/CRJX_HOP.png new file mode 100644 index 000000000..2df80888e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/CRJX_HOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_AUL.png b/plugins/channelrx/demodadsb/map/liveries/D328_AUL.png new file mode 100644 index 000000000..dbcbe2140 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_AUL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_BEE.png b/plugins/channelrx/demodadsb/map/liveries/D328_BEE.png new file mode 100644 index 000000000..bd4ccf9ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_BEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_EZE.png b/plugins/channelrx/demodadsb/map/liveries/D328_EZE.png new file mode 100644 index 000000000..3ff780d90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_EZE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_ISK.png b/plugins/channelrx/demodadsb/map/liveries/D328_ISK.png new file mode 100644 index 000000000..adda15575 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_ISK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_RHE.png b/plugins/channelrx/demodadsb/map/liveries/D328_RHE.png new file mode 100644 index 000000000..b273f6d7e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_RHE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_SRK.png b/plugins/channelrx/demodadsb/map/liveries/D328_SRK.png new file mode 100644 index 000000000..1f3f34ffb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_SRK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/D328_WLC.png b/plugins/channelrx/demodadsb/map/liveries/D328_WLC.png new file mode 100644 index 000000000..5d3dbafa5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/D328_WLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DC10_FDX.png b/plugins/channelrx/demodadsb/map/liveries/DC10_FDX.png new file mode 100644 index 000000000..ce3809b06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DC10_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C.png b/plugins/channelrx/demodadsb/map/liveries/DH8C.png new file mode 100644 index 000000000..b383d9439 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_AIE.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_AIE.png new file mode 100644 index 000000000..a094f7983 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_AIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_ANG.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_ANG.png new file mode 100644 index 000000000..2f08b4550 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_ANG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_ANZ.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_ANZ.png new file mode 100644 index 000000000..44eba7188 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_ANZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_ANZ_BLK.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_ANZ_BLK.png new file mode 100644 index 000000000..29ec71913 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_ANZ_BLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_DQA.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_DQA.png new file mode 100644 index 000000000..db42365ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_DQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_KEM.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_KEM.png new file mode 100644 index 000000000..d8f12cb92 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_KEM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_NCB.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_NCB.png new file mode 100644 index 000000000..2d174f3dc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_NCB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_PAG.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_PAG.png new file mode 100644 index 000000000..e63a9264f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_PAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_PER.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_PER.png new file mode 100644 index 000000000..451a0d725 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_PER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_PVL.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_PVL.png new file mode 100644 index 000000000..a90032409 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_PVL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_QLK.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_QLK.png new file mode 100644 index 000000000..ce7f78cf7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_QLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_RKA.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_RKA.png new file mode 100644 index 000000000..2b316a0f1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_RKA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_RVF.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_RVF.png new file mode 100644 index 000000000..8ba19a633 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_RVF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_SHU.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_SHU.png new file mode 100644 index 000000000..9b87063cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_SHU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_SYL.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_SYL.png new file mode 100644 index 000000000..d57f8a69b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_SYL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_WAT.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_WAT.png new file mode 100644 index 000000000..b5f33964f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8C_WIF.png b/plugins/channelrx/demodadsb/map/liveries/DH8C_WIF.png new file mode 100644 index 000000000..b6f3b0b31 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8C_WIF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D.png b/plugins/channelrx/demodadsb/map/liveries/DH8D.png new file mode 100644 index 000000000..d6300f96b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ACA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ACA.png new file mode 100644 index 000000000..9928d62b3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AEE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AEE.png new file mode 100644 index 000000000..94f05671a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AFX.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AFX.png new file mode 100644 index 000000000..11e750596 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AKX.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AKX.png new file mode 100644 index 000000000..30c545cb6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AKX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ANA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ANA.png new file mode 100644 index 000000000..30c545cb6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ANA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ANG.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ANG.png new file mode 100644 index 000000000..d0911dfb2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ANG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ARA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ARA.png new file mode 100644 index 000000000..9d1f17b1d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ARA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ARE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ARE.png new file mode 100644 index 000000000..dbac0b3dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ARE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ASA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ASA.png new file mode 100644 index 000000000..52daed0bd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ATC.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ATC.png new file mode 100644 index 000000000..98782a777 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ATC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AUA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AUA.png new file mode 100644 index 000000000..c6e3a26fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AUA_Star.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AUA_Star.png new file mode 100644 index 000000000..a9235b7f0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AUA_Star.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AUB.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AUB.png new file mode 100644 index 000000000..cd8306561 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AUB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_AZB.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_AZB.png new file mode 100644 index 000000000..27523365c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_AZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BBC.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BBC.png new file mode 100644 index 000000000..07bdff808 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BBC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BBO.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BBO.png new file mode 100644 index 000000000..3902eb4e9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BBO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BBZ.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BBZ.png new file mode 100644 index 000000000..73425e8c1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BBZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BEE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BEE.png new file mode 100644 index 000000000..2b468d443 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BEL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BEL.png new file mode 100644 index 000000000..19bd79a71 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BER.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BER.png new file mode 100644 index 000000000..172c4e3fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_BTI.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_BTI.png new file mode 100644 index 000000000..8a6dd2f9a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_BTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_CGA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_CGA.png new file mode 100644 index 000000000..6e6bd48bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_CGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_CTN.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_CTN.png new file mode 100644 index 000000000..ec118bc34 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_CTN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_CTO.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_CTO.png new file mode 100644 index 000000000..ec564d7c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_CTO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_CXA_VA.png new file mode 100644 index 000000000..9a3605368 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_DTA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_DTA.png new file mode 100644 index 000000000..ffd13177c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_DTA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_DTH.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_DTH.png new file mode 100644 index 000000000..2dfeda7a0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_DTH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_DWT.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_DWT.png new file mode 100644 index 000000000..4e1439e3a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_DWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ECN.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ECN.png new file mode 100644 index 000000000..497b684f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ECN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ELO.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ELO.png new file mode 100644 index 000000000..05b499854 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ELO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ETH.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ETH.png new file mode 100644 index 000000000..991a6a2c4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ETH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_EWG.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_EWG.png new file mode 100644 index 000000000..d7d193f6a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_EWG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_EXY.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_EXY.png new file mode 100644 index 000000000..f58f95ed6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_EXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_FFT.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_FFT.png new file mode 100644 index 000000000..a839295d7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_GAP.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_GAP.png new file mode 100644 index 000000000..656ab16ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_GAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_HIS.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_HIS.png new file mode 100644 index 000000000..69bb8adb7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_HIS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_HYD.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_HYD.png new file mode 100644 index 000000000..ab3b7ae57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_HYD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_ICE_NCPINK.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_ICE_NCPINK.png new file mode 100644 index 000000000..bba065959 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_ICE_NCPINK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_IHO.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_IHO.png new file mode 100644 index 000000000..a5dc6f52f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_IHO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_JAC.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_JAC.png new file mode 100644 index 000000000..b769174c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_JAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_JAL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_JAL.png new file mode 100644 index 000000000..b769174c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_JJA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_JJA.png new file mode 100644 index 000000000..efa88b375 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_JJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_JMA_GIRAFFE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_JMA_GIRAFFE.png new file mode 100644 index 000000000..8f15ff0f8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_JMA_GIRAFFE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_JMA_LEOPARD.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_JMA_LEOPARD.png new file mode 100644 index 000000000..adb93f7e4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_JMA_LEOPARD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_JZA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_JZA.png new file mode 100644 index 000000000..762079941 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_JZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_KEM.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_KEM.png new file mode 100644 index 000000000..b1fdff335 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_KEM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_LAM.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_LAM.png new file mode 100644 index 000000000..df3ecbd40 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_LAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_LGL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_LGL.png new file mode 100644 index 000000000..5b4506e0a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_LGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_LHA_VA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_LHA_VA.png new file mode 100644 index 000000000..1f52ae56f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_LHA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_LOT.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_LOT.png new file mode 100644 index 000000000..dc646c6c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_MAH.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_MAH.png new file mode 100644 index 000000000..e4e5612de Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_MAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_MET.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_MET.png new file mode 100644 index 000000000..cfc2a5b43 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_MET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_OAL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_OAL.png new file mode 100644 index 000000000..15314d8d5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_OAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_PAL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_PAL.png new file mode 100644 index 000000000..656ab16ef Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_PAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_POE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_POE.png new file mode 100644 index 000000000..df3076f18 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_POE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_PTR.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_PTR.png new file mode 100644 index 000000000..78d76a459 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_PTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_PVL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_PVL.png new file mode 100644 index 000000000..17c40282c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_PVL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_QAZ.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_QAZ.png new file mode 100644 index 000000000..285a6448b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_QAZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_QFA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_QFA.png new file mode 100644 index 000000000..a158a7449 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_QFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_QLK.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_QLK.png new file mode 100644 index 000000000..e6d292fbb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_QLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_QXE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_QXE.png new file mode 100644 index 000000000..53279c6aa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_QXE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_RAC.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_RAC.png new file mode 100644 index 000000000..dbad0f745 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_RAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SAT.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SAT.png new file mode 100644 index 000000000..22b8e22b1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SAU.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SAU.png new file mode 100644 index 000000000..f949740e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SAU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SEJ.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SEJ.png new file mode 100644 index 000000000..c8351d710 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SEJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SHA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SHA.png new file mode 100644 index 000000000..e4a190866 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SHU.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SHU.png new file mode 100644 index 000000000..c3a86bf91 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SHU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SKK.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SKK.png new file mode 100644 index 000000000..327fa8199 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SKK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SRK.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SRK.png new file mode 100644 index 000000000..9345dce5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SRK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SWU.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SWU.png new file mode 100644 index 000000000..b7708dfe6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SWU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SWU_GREEN.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SWU_GREEN.png new file mode 100644 index 000000000..deaa0f38a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SWU_GREEN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_SYL.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_SYL.png new file mode 100644 index 000000000..9c97d0e77 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_SYL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_TCF.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_TCF.png new file mode 100644 index 000000000..2f556c2b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_TCF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_TYR.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_TYR.png new file mode 100644 index 000000000..de19b54bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_TYR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_UKV.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_UKV.png new file mode 100644 index 000000000..0c6896f1a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_VCP.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_VCP.png new file mode 100644 index 000000000..84e4fe8ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_VCP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_VRE.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_VRE.png new file mode 100644 index 000000000..3604d6244 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_VRE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_WAT.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_WAT.png new file mode 100644 index 000000000..1d5f080fe Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_WEN.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_WEN.png new file mode 100644 index 000000000..cea75a7eb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_WEN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_WIF.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_WIF.png new file mode 100644 index 000000000..2e15ab3a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_WIF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_WJA.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_WJA.png new file mode 100644 index 000000000..a81fa3d06 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_WJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/DH8D_XSN.png b/plugins/channelrx/demodadsb/map/liveries/DH8D_XSN.png new file mode 100644 index 000000000..d8be0912b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/DH8D_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_BMI.png b/plugins/channelrx/demodadsb/map/liveries/E135_BMI.png new file mode 100644 index 000000000..ec9df1c20 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_BMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_CHQ.png b/plugins/channelrx/demodadsb/map/liveries/E135_CHQ.png new file mode 100644 index 000000000..b9193a122 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_CHQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_EGF.png b/plugins/channelrx/demodadsb/map/liveries/E135_EGF.png new file mode 100644 index 000000000..8ee95d00d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_EGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_HAF.png b/plugins/channelrx/demodadsb/map/liveries/E135_HAF.png new file mode 100644 index 000000000..4ff994206 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_HAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_LGL.png b/plugins/channelrx/demodadsb/map/liveries/E135_LGL.png new file mode 100644 index 000000000..568fe9cbf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_LGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_LNK.png b/plugins/channelrx/demodadsb/map/liveries/E135_LNK.png new file mode 100644 index 000000000..2f0ec1867 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_LNK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_NMB.png b/plugins/channelrx/demodadsb/map/liveries/E135_NMB.png new file mode 100644 index 000000000..dbcf72f08 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_NMB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E135_RAE.png b/plugins/channelrx/demodadsb/map/liveries/E135_RAE.png new file mode 100644 index 000000000..9dc401104 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E135_RAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_AMX.png b/plugins/channelrx/demodadsb/map/liveries/E145_AMX.png new file mode 100644 index 000000000..56a455ed9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_BEL.png b/plugins/channelrx/demodadsb/map/liveries/E145_BEL.png new file mode 100644 index 000000000..6ffa08f11 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_BEL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_BMI.png b/plugins/channelrx/demodadsb/map/liveries/E145_BMI.png new file mode 100644 index 000000000..5c02941a4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_BMI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_BMI_G-RJXI.png b/plugins/channelrx/demodadsb/map/liveries/E145_BMI_G-RJXI.png new file mode 100644 index 000000000..42901fd78 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_BMI_G-RJXI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_EGF.png b/plugins/channelrx/demodadsb/map/liveries/E145_EGF.png new file mode 100644 index 000000000..1ea88530b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_EGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_EZE.png b/plugins/channelrx/demodadsb/map/liveries/E145_EZE.png new file mode 100644 index 000000000..c006bbd65 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_EZE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_FFT.png b/plugins/channelrx/demodadsb/map/liveries/E145_FFT.png new file mode 100644 index 000000000..6b5b5063b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_FFT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_HOP.png b/plugins/channelrx/demodadsb/map/liveries/E145_HOP.png new file mode 100644 index 000000000..b60d58b0e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_HOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_PGA.png b/plugins/channelrx/demodadsb/map/liveries/E145_PGA.png new file mode 100644 index 000000000..41bb93b17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_PGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_TWE.png b/plugins/channelrx/demodadsb/map/liveries/E145_TWE.png new file mode 100644 index 000000000..8d647fb64 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_TWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_UAL.png b/plugins/channelrx/demodadsb/map/liveries/E145_UAL.png new file mode 100644 index 000000000..96eccef0c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_UDN.png b/plugins/channelrx/demodadsb/map/liveries/E145_UDN.png new file mode 100644 index 000000000..aa6220191 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_UDN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E145_WST.png b/plugins/channelrx/demodadsb/map/liveries/E145_WST.png new file mode 100644 index 000000000..6f6439f15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E145_WST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170.png b/plugins/channelrx/demodadsb/map/liveries/E170.png new file mode 100644 index 000000000..e59983725 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_AAL.png b/plugins/channelrx/demodadsb/map/liveries/E170_AAL.png new file mode 100644 index 000000000..8c5616fae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_ACA.png b/plugins/channelrx/demodadsb/map/liveries/E170_ACA.png new file mode 100644 index 000000000..50d4b2860 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_AFR.png b/plugins/channelrx/demodadsb/map/liveries/E170_AFR.png new file mode 100644 index 000000000..fc08d8c57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_AHY.png b/plugins/channelrx/demodadsb/map/liveries/E170_AHY.png new file mode 100644 index 000000000..d9d8c32d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_ASA.png b/plugins/channelrx/demodadsb/map/liveries/E170_ASA.png new file mode 100644 index 000000000..f3437afbd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_ASA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_BEE.png b/plugins/channelrx/demodadsb/map/liveries/E170_BEE.png new file mode 100644 index 000000000..73b37089b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_BEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_BMA.png b/plugins/channelrx/demodadsb/map/liveries/E170_BMA.png new file mode 100644 index 000000000..84ca9f1e9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_BMA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_BRU.png b/plugins/channelrx/demodadsb/map/liveries/E170_BRU.png new file mode 100644 index 000000000..b2c320736 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_CET.png b/plugins/channelrx/demodadsb/map/liveries/E170_CET.png new file mode 100644 index 000000000..2c1e5d5a9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_CET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_CFE.png b/plugins/channelrx/demodadsb/map/liveries/E170_CFE.png new file mode 100644 index 000000000..3554374ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_CFE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_CYL.png b/plugins/channelrx/demodadsb/map/liveries/E170_CYL.png new file mode 100644 index 000000000..cfee5c478 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_CYL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_DAL.png b/plugins/channelrx/demodadsb/map/liveries/E170_DAL.png new file mode 100644 index 000000000..91c9665e3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_ELL.png b/plugins/channelrx/demodadsb/map/liveries/E170_ELL.png new file mode 100644 index 000000000..fd1ce5c6e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_ELL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_ELL_ES-AEB.png b/plugins/channelrx/demodadsb/map/liveries/E170_ELL_ES-AEB.png new file mode 100644 index 000000000..a83967941 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_ELL_ES-AEB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_FDA_01F.png b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_01F.png new file mode 100644 index 000000000..dfb2fef6e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_01F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_FDA_03F.png b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_03F.png new file mode 100644 index 000000000..d94eefb36 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_03F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_FDA_04F.png b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_04F.png new file mode 100644 index 000000000..bd3865509 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_04F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_FDA_06F.png b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_06F.png new file mode 100644 index 000000000..7f33d1307 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_06F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_FDA_07F.png b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_07F.png new file mode 100644 index 000000000..545f5240b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_FDA_07F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_FIN.png b/plugins/channelrx/demodadsb/map/liveries/E170_FIN.png new file mode 100644 index 000000000..83f2e1ad8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_HOP.png b/plugins/channelrx/demodadsb/map/liveries/E170_HOP.png new file mode 100644 index 000000000..20bbb229d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_HOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_JLJ.png b/plugins/channelrx/demodadsb/map/liveries/E170_JLJ.png new file mode 100644 index 000000000..ad40a683c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_JLJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_LNK.png b/plugins/channelrx/demodadsb/map/liveries/E170_LNK.png new file mode 100644 index 000000000..a1b3d9a1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_LNK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_LOT.png b/plugins/channelrx/demodadsb/map/liveries/E170_LOT.png new file mode 100644 index 000000000..9813edd2f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_LOT_LUBUSKIE.png b/plugins/channelrx/demodadsb/map/liveries/E170_LOT_LUBUSKIE.png new file mode 100644 index 000000000..1a095af45 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_LOT_LUBUSKIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_LOT_RETROJET.png b/plugins/channelrx/demodadsb/map/liveries/E170_LOT_RETROJET.png new file mode 100644 index 000000000..bbde53e65 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_LOT_RETROJET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_LOT_STARALLIANCE.png b/plugins/channelrx/demodadsb/map/liveries/E170_LOT_STARALLIANCE.png new file mode 100644 index 000000000..57152807e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_LOT_STARALLIANCE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_MSR.png b/plugins/channelrx/demodadsb/map/liveries/E170_MSR.png new file mode 100644 index 000000000..b39ddbb4c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_MSR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_NWA.png b/plugins/channelrx/demodadsb/map/liveries/E170_NWA.png new file mode 100644 index 000000000..83b052269 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_NWA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_OAS.png b/plugins/channelrx/demodadsb/map/liveries/E170_OAS.png new file mode 100644 index 000000000..4cc248ccb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_OAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_PEV.png b/plugins/channelrx/demodadsb/map/liveries/E170_PEV.png new file mode 100644 index 000000000..9b2d18605 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_PEV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_PMW.png b/plugins/channelrx/demodadsb/map/liveries/E170_PMW.png new file mode 100644 index 000000000..c851934b9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_PMW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_PRR.png b/plugins/channelrx/demodadsb/map/liveries/E170_PRR.png new file mode 100644 index 000000000..687e6ff29 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_PRR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_RJA.png b/plugins/channelrx/demodadsb/map/liveries/E170_RJA.png new file mode 100644 index 000000000..2d57e5fe9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_RUS.png b/plugins/channelrx/demodadsb/map/liveries/E170_RUS.png new file mode 100644 index 000000000..0096011f5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_RUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_SBI.png b/plugins/channelrx/demodadsb/map/liveries/E170_SBI.png new file mode 100644 index 000000000..29b4d7022 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_SBI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_SMX.png b/plugins/channelrx/demodadsb/map/liveries/E170_SMX.png new file mode 100644 index 000000000..0439247cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_SMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_SVA.png b/plugins/channelrx/demodadsb/map/liveries/E170_SVA.png new file mode 100644 index 000000000..64437aae4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_SVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_UAL.png b/plugins/channelrx/demodadsb/map/liveries/E170_UAL.png new file mode 100644 index 000000000..0a3fd6ab9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_USA.png b/plugins/channelrx/demodadsb/map/liveries/E170_USA.png new file mode 100644 index 000000000..c7597f61b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_VOS.png b/plugins/channelrx/demodadsb/map/liveries/E170_VOS.png new file mode 100644 index 000000000..c5d5afb21 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_VOS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E170_WAT.png b/plugins/channelrx/demodadsb/map/liveries/E170_WAT.png new file mode 100644 index 000000000..fbfbc4e3d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E170_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190.png b/plugins/channelrx/demodadsb/map/liveries/E190.png new file mode 100644 index 000000000..fe79cb306 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_ACA.png b/plugins/channelrx/demodadsb/map/liveries/E190_ACA.png new file mode 100644 index 000000000..54226738f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_ACA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AFR.png b/plugins/channelrx/demodadsb/map/liveries/E190_AFR.png new file mode 100644 index 000000000..899fd2779 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AHO.png b/plugins/channelrx/demodadsb/map/liveries/E190_AHO.png new file mode 100644 index 000000000..e803d607f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AHO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AHY.png b/plugins/channelrx/demodadsb/map/liveries/E190_AHY.png new file mode 100644 index 000000000..639874ec0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AHY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AHY_BUTA_AIRWAYS.png b/plugins/channelrx/demodadsb/map/liveries/E190_AHY_BUTA_AIRWAYS.png new file mode 100644 index 000000000..fb9dc060f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AHY_BUTA_AIRWAYS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AIZ.png b/plugins/channelrx/demodadsb/map/liveries/E190_AIZ.png new file mode 100644 index 000000000..ee608ca7b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AIZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AMX.png b/plugins/channelrx/demodadsb/map/liveries/E190_AMX.png new file mode 100644 index 000000000..0a062276a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AMX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_ARG.png b/plugins/channelrx/demodadsb/map/liveries/E190_ARG.png new file mode 100644 index 000000000..829cb5c98 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_ASL.png b/plugins/channelrx/demodadsb/map/liveries/E190_ASL.png new file mode 100644 index 000000000..9e3596fba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_ASL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AUA.png b/plugins/channelrx/demodadsb/map/liveries/E190_AUA.png new file mode 100644 index 000000000..3e1e46cd3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AUI.png b/plugins/channelrx/demodadsb/map/liveries/E190_AUI.png new file mode 100644 index 000000000..c997f21ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AUI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AXY.png b/plugins/channelrx/demodadsb/map/liveries/E190_AXY.png new file mode 100644 index 000000000..6da50703c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_AZU_UO.png b/plugins/channelrx/demodadsb/map/liveries/E190_AZU_UO.png new file mode 100644 index 000000000..c0370df9f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_AZU_UO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_BAV.png b/plugins/channelrx/demodadsb/map/liveries/E190_BAV.png new file mode 100644 index 000000000..5a06f2ecc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_BAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_BFY.png b/plugins/channelrx/demodadsb/map/liveries/E190_BFY.png new file mode 100644 index 000000000..2dd291b23 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_BFY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_BRU.png b/plugins/channelrx/demodadsb/map/liveries/E190_BRU.png new file mode 100644 index 000000000..ad8fa1d1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_BVX.png b/plugins/channelrx/demodadsb/map/liveries/E190_BVX.png new file mode 100644 index 000000000..3b9fcfe58 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_BVX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CBG.png b/plugins/channelrx/demodadsb/map/liveries/E190_CBG.png new file mode 100644 index 000000000..805839655 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CBG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CET.png b/plugins/channelrx/demodadsb/map/liveries/E190_CET.png new file mode 100644 index 000000000..8f601cded Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CET.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CFE.png b/plugins/channelrx/demodadsb/map/liveries/E190_CFE.png new file mode 100644 index 000000000..7409e5019 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CFE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CFE_G-LCYN.png b/plugins/channelrx/demodadsb/map/liveries/E190_CFE_G-LCYN.png new file mode 100644 index 000000000..f29f7c3f2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CFE_G-LCYN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CGZ.png b/plugins/channelrx/demodadsb/map/liveries/E190_CGZ.png new file mode 100644 index 000000000..b9530f82d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CGZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CLH.png b/plugins/channelrx/demodadsb/map/liveries/E190_CLH.png new file mode 100644 index 000000000..b1dc8339c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CMP.png b/plugins/channelrx/demodadsb/map/liveries/E190_CMP.png new file mode 100644 index 000000000..b7da782f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CMP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CSN.png b/plugins/channelrx/demodadsb/map/liveries/E190_CSN.png new file mode 100644 index 000000000..90853f10c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CYL.png b/plugins/channelrx/demodadsb/map/liveries/E190_CYL.png new file mode 100644 index 000000000..917730541 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CYL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_CYL_EI-SKY.png b/plugins/channelrx/demodadsb/map/liveries/E190_CYL_EI-SKY.png new file mode 100644 index 000000000..89ba98ec3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_CYL_EI-SKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_DLA.png b/plugins/channelrx/demodadsb/map/liveries/E190_DLA.png new file mode 100644 index 000000000..d27f4329a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_DLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_DLH.png b/plugins/channelrx/demodadsb/map/liveries/E190_DLH.png new file mode 100644 index 000000000..3a5fc6de0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_DLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_EUS.png b/plugins/channelrx/demodadsb/map/liveries/E190_EUS.png new file mode 100644 index 000000000..c3384db88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_EUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_EZE.png b/plugins/channelrx/demodadsb/map/liveries/E190_EZE.png new file mode 100644 index 000000000..970f2bcf7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_EZE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_FIN.png b/plugins/channelrx/demodadsb/map/liveries/E190_FIN.png new file mode 100644 index 000000000..fd1dac813 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_FWI.png b/plugins/channelrx/demodadsb/map/liveries/E190_FWI.png new file mode 100644 index 000000000..543b249be Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_FWI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_GCR.png b/plugins/channelrx/demodadsb/map/liveries/E190_GCR.png new file mode 100644 index 000000000..622d603b6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_GCR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_GER.png b/plugins/channelrx/demodadsb/map/liveries/E190_GER.png new file mode 100644 index 000000000..aaa41f36f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_GER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_HBH.png b/plugins/channelrx/demodadsb/map/liveries/E190_HBH.png new file mode 100644 index 000000000..970f2bcf7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_HBH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_HOP.png b/plugins/channelrx/demodadsb/map/liveries/E190_HOP.png new file mode 100644 index 000000000..cbe0ebd90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_HOP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JAF.png b/plugins/channelrx/demodadsb/map/liveries/E190_JAF.png new file mode 100644 index 000000000..3e9b0c86b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JBU.png b/plugins/channelrx/demodadsb/map/liveries/E190_JBU.png new file mode 100644 index 000000000..71bb21c22 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JBU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BARCODE.png b/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BARCODE.png new file mode 100644 index 000000000..029d445f9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BARCODE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BILLBOARD.png b/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BILLBOARD.png new file mode 100644 index 000000000..8b66bf6d0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BILLBOARD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BLUEBERRY.png b/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BLUEBERRY.png new file mode 100644 index 000000000..59963908e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JBU_BLUEBERRY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JLJ.png b/plugins/channelrx/demodadsb/map/liveries/E190_JLJ.png new file mode 100644 index 000000000..98edc2a54 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JLJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_JTE.png b/plugins/channelrx/demodadsb/map/liveries/E190_JTE.png new file mode 100644 index 000000000..caa11d4e8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_JTE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_KAR.png b/plugins/channelrx/demodadsb/map/liveries/E190_KAR.png new file mode 100644 index 000000000..647e1b9a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_KAR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_KLC.png b/plugins/channelrx/demodadsb/map/liveries/E190_KLC.png new file mode 100644 index 000000000..c177c884d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_KLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_KLM.png b/plugins/channelrx/demodadsb/map/liveries/E190_KLM.png new file mode 100644 index 000000000..fdb2ad3e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_KLM_PH-NWC.png b/plugins/channelrx/demodadsb/map/liveries/E190_KLM_PH-NWC.png new file mode 100644 index 000000000..182d494f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_KLM_PH-NWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_KLM_PH-SKY.png b/plugins/channelrx/demodadsb/map/liveries/E190_KLM_PH-SKY.png new file mode 100644 index 000000000..7d282def0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_KLM_PH-SKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_KQA.png b/plugins/channelrx/demodadsb/map/liveries/E190_KQA.png new file mode 100644 index 000000000..445fd8d41 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_KQA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LGL.png b/plugins/channelrx/demodadsb/map/liveries/E190_LGL.png new file mode 100644 index 000000000..a56092260 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LGL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LNK.png b/plugins/channelrx/demodadsb/map/liveries/E190_LNK.png new file mode 100644 index 000000000..62771d4cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LNK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LNK_OC.png b/plugins/channelrx/demodadsb/map/liveries/E190_LNK_OC.png new file mode 100644 index 000000000..a302cd9e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LNK_OC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LOT _GRZESKI.png b/plugins/channelrx/demodadsb/map/liveries/E190_LOT _GRZESKI.png new file mode 100644 index 000000000..90ed5a2f6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LOT _GRZESKI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LOT _SLIWKA.png b/plugins/channelrx/demodadsb/map/liveries/E190_LOT _SLIWKA.png new file mode 100644 index 000000000..a67a9976b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LOT _SLIWKA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LOT.png b/plugins/channelrx/demodadsb/map/liveries/E190_LOT.png new file mode 100644 index 000000000..fd31cc095 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LOT_PODKARPACKIE.png b/plugins/channelrx/demodadsb/map/liveries/E190_LOT_PODKARPACKIE.png new file mode 100644 index 000000000..55a101a9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LOT_PODKARPACKIE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LOT_VISITMORAVIA.png b/plugins/channelrx/demodadsb/map/liveries/E190_LOT_VISITMORAVIA.png new file mode 100644 index 000000000..62b65ff4a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LOT_VISITMORAVIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LOT_WARMIAMAZURY.png b/plugins/channelrx/demodadsb/map/liveries/E190_LOT_WARMIAMAZURY.png new file mode 100644 index 000000000..bba01ac46 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LOT_WARMIAMAZURY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_LZB.png b/plugins/channelrx/demodadsb/map/liveries/E190_LZB.png new file mode 100644 index 000000000..7ded2beb7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_LZB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_MDA.png b/plugins/channelrx/demodadsb/map/liveries/E190_MDA.png new file mode 100644 index 000000000..5e0b9534c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_MDA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_MLD.png b/plugins/channelrx/demodadsb/map/liveries/E190_MLD.png new file mode 100644 index 000000000..da455d7b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_MLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_MSC.png b/plugins/channelrx/demodadsb/map/liveries/E190_MSC.png new file mode 100644 index 000000000..9a3830380 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_MSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_MXY.png b/plugins/channelrx/demodadsb/map/liveries/E190_MXY.png new file mode 100644 index 000000000..cf43184f4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_MXY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_OAW.png b/plugins/channelrx/demodadsb/map/liveries/E190_OAW.png new file mode 100644 index 000000000..f88aedeba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_OAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_QLK.png b/plugins/channelrx/demodadsb/map/liveries/E190_QLK.png new file mode 100644 index 000000000..a8d669a31 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_QLK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_RAM.png b/plugins/channelrx/demodadsb/map/liveries/E190_RAM.png new file mode 100644 index 000000000..9c197f2b7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_RAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_RPB.png b/plugins/channelrx/demodadsb/map/liveries/E190_RPB.png new file mode 100644 index 000000000..5756c0c55 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_RPB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_SCO.png b/plugins/channelrx/demodadsb/map/liveries/E190_SCO.png new file mode 100644 index 000000000..c3384db88 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_SCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_SHH.png b/plugins/channelrx/demodadsb/map/liveries/E190_SHH.png new file mode 100644 index 000000000..bcb7c8b82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_SHH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_SLI.png b/plugins/channelrx/demodadsb/map/liveries/E190_SLI.png new file mode 100644 index 000000000..e98377574 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_SLI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_TAP.png b/plugins/channelrx/demodadsb/map/liveries/E190_TAP.png new file mode 100644 index 000000000..365e88615 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_TAP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_UKV.png b/plugins/channelrx/demodadsb/map/liveries/E190_UKV.png new file mode 100644 index 000000000..4bf7f4b02 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_UKV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_USA.png b/plugins/channelrx/demodadsb/map/liveries/E190_USA.png new file mode 100644 index 000000000..c8118479b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_UTY.png b/plugins/channelrx/demodadsb/map/liveries/E190_UTY.png new file mode 100644 index 000000000..ec6c3610f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_UTY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_VCV.png b/plugins/channelrx/demodadsb/map/liveries/E190_VCV.png new file mode 100644 index 000000000..435b94bf4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_VCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_WAT.png b/plugins/channelrx/demodadsb/map/liveries/E190_WAT.png new file mode 100644 index 000000000..ecba523ed Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E190_WIF.png b/plugins/channelrx/demodadsb/map/liveries/E190_WIF.png new file mode 100644 index 000000000..97b1d4a8d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E190_WIF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_AEA.png b/plugins/channelrx/demodadsb/map/liveries/E195_AEA.png new file mode 100644 index 000000000..f321809f9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_AEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_AIZ.png b/plugins/channelrx/demodadsb/map/liveries/E195_AIZ.png new file mode 100644 index 000000000..2465ee2ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_AIZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_AUR.png b/plugins/channelrx/demodadsb/map/liveries/E195_AUR.png new file mode 100644 index 000000000..384fa4bc7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_AUR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_BEE.png b/plugins/channelrx/demodadsb/map/liveries/E195_BEE.png new file mode 100644 index 000000000..b119b6038 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_BEE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_BRU.png b/plugins/channelrx/demodadsb/map/liveries/E195_BRU.png new file mode 100644 index 000000000..887958042 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_BRU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_CLH.png b/plugins/channelrx/demodadsb/map/liveries/E195_CLH.png new file mode 100644 index 000000000..21e91030c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_CLH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_DLA.png b/plugins/channelrx/demodadsb/map/liveries/E195_DLA.png new file mode 100644 index 000000000..1a667fa2a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_DLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_LOT.png b/plugins/channelrx/demodadsb/map/liveries/E195_LOT.png new file mode 100644 index 000000000..f46417a39 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_LOT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_MGX.png b/plugins/channelrx/demodadsb/map/liveries/E195_MGX.png new file mode 100644 index 000000000..e83483e57 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_MGX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_RJA.png b/plugins/channelrx/demodadsb/map/liveries/E195_RJA.png new file mode 100644 index 000000000..d3787357a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_RJA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E195_SOV.png b/plugins/channelrx/demodadsb/map/liveries/E195_SOV.png new file mode 100644 index 000000000..924d24dd2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E195_SOV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E35L.png b/plugins/channelrx/demodadsb/map/liveries/E35L.png new file mode 100644 index 000000000..5c54398bb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E35L.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/E3D_UK4_ZH103.png b/plugins/channelrx/demodadsb/map/liveries/E3D_UK4_ZH103.png new file mode 100644 index 000000000..8d4fbba61 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/E3D_UK4_ZH103.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/EC35_DE6_D-HBBZ.png b/plugins/channelrx/demodadsb/map/liveries/EC35_DE6_D-HBBZ.png new file mode 100644 index 000000000..d15bd2392 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/EC35_DE6_D-HBBZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/EC35_UK6_G-POLA.png b/plugins/channelrx/demodadsb/map/liveries/EC35_UK6_G-POLA.png new file mode 100644 index 000000000..2a6eca17f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/EC35_UK6_G-POLA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/EUFI_UK4_ZK306.png b/plugins/channelrx/demodadsb/map/liveries/EUFI_UK4_ZK306.png new file mode 100644 index 000000000..a7e45a785 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/EUFI_UK4_ZK306.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_AAL.png b/plugins/channelrx/demodadsb/map/liveries/F100_AAL.png new file mode 100644 index 000000000..1d679e49b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_AFR.png b/plugins/channelrx/demodadsb/map/liveries/F100_AFR.png new file mode 100644 index 000000000..b73a908cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_AUA.png b/plugins/channelrx/demodadsb/map/liveries/F100_AUA.png new file mode 100644 index 000000000..2676fb9d3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_AVA.png b/plugins/channelrx/demodadsb/map/liveries/F100_AVA.png new file mode 100644 index 000000000..16a72820f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_BER.png b/plugins/channelrx/demodadsb/map/liveries/F100_BER.png new file mode 100644 index 000000000..e5e63ac02 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_BER.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_BZH.png b/plugins/channelrx/demodadsb/map/liveries/F100_BZH.png new file mode 100644 index 000000000..98f0bab9c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_BZH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_DNM.png b/plugins/channelrx/demodadsb/map/liveries/F100_DNM.png new file mode 100644 index 000000000..06c41862b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_DNM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_KLM.png b/plugins/channelrx/demodadsb/map/liveries/F100_KLM.png new file mode 100644 index 000000000..c951b573b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_LAM.png b/plugins/channelrx/demodadsb/map/liveries/F100_LAM.png new file mode 100644 index 000000000..bb1edbd96 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_LAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_OAW.png b/plugins/channelrx/demodadsb/map/liveries/F100_OAW.png new file mode 100644 index 000000000..95596803a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_OAW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_PGA.png b/plugins/channelrx/demodadsb/map/liveries/F100_PGA.png new file mode 100644 index 000000000..30e7be7e2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_PGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_TAM.png b/plugins/channelrx/demodadsb/map/liveries/F100_TAM.png new file mode 100644 index 000000000..b35583d68 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_TAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F100_TDR.png b/plugins/channelrx/demodadsb/map/liveries/F100_TDR.png new file mode 100644 index 000000000..f0d73a4c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F100_TDR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F16C_BE4_101.png b/plugins/channelrx/demodadsb/map/liveries/F16C_BE4_101.png new file mode 100644 index 000000000..40772be1b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F16C_BE4_101.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F16C_US4_368.png b/plugins/channelrx/demodadsb/map/liveries/F16C_US4_368.png new file mode 100644 index 000000000..e75758a4c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F16C_US4_368.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F16D_US4_926.png b/plugins/channelrx/demodadsb/map/liveries/F16D_US4_926.png new file mode 100644 index 000000000..bc1f656c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F16D_US4_926.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F16D_US4_TB8.png b/plugins/channelrx/demodadsb/map/liveries/F16D_US4_TB8.png new file mode 100644 index 000000000..d9b05917b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F16D_US4_TB8.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F18C_US1_183153.png b/plugins/channelrx/demodadsb/map/liveries/F18C_US1_183153.png new file mode 100644 index 000000000..965e7a84e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F18C_US1_183153.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F18D_US1_BA7.png b/plugins/channelrx/demodadsb/map/liveries/F18D_US1_BA7.png new file mode 100644 index 000000000..7d58a2e54 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F18D_US1_BA7.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F28_ARG.png b/plugins/channelrx/demodadsb/map/liveries/F28_ARG.png new file mode 100644 index 000000000..dc5022195 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F28_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F28_GHS.png b/plugins/channelrx/demodadsb/map/liveries/F28_GHS.png new file mode 100644 index 000000000..177a273bf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F28_GHS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F28_GIA.png b/plugins/channelrx/demodadsb/map/liveries/F28_GIA.png new file mode 100644 index 000000000..bc2e560cf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F28_GIA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F28_IRC.png b/plugins/channelrx/demodadsb/map/liveries/F28_IRC.png new file mode 100644 index 000000000..0160d7a1f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F28_IRC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F28_TAE.png b/plugins/channelrx/demodadsb/map/liveries/F28_TAE.png new file mode 100644 index 000000000..deb9b0952 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F28_TAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F28_VUN.png b/plugins/channelrx/demodadsb/map/liveries/F28_VUN.png new file mode 100644 index 000000000..7e67e8005 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F28_VUN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_AVA.png b/plugins/channelrx/demodadsb/map/liveries/F50_AVA.png new file mode 100644 index 000000000..6220d8763 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_BCY.png b/plugins/channelrx/demodadsb/map/liveries/F50_BCY.png new file mode 100644 index 000000000..7a75945cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_BCY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_BTI.png b/plugins/channelrx/demodadsb/map/liveries/F50_BTI.png new file mode 100644 index 000000000..751c1d744 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_BTI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_CRF.png b/plugins/channelrx/demodadsb/map/liveries/F50_CRF.png new file mode 100644 index 000000000..6b711d492 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_CRF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_FXI.png b/plugins/channelrx/demodadsb/map/liveries/F50_FXI.png new file mode 100644 index 000000000..497ac0bc8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_FXI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_INC.png b/plugins/channelrx/demodadsb/map/liveries/F50_INC.png new file mode 100644 index 000000000..da9308bc0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_INC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_KLC.png b/plugins/channelrx/demodadsb/map/liveries/F50_KLC.png new file mode 100644 index 000000000..ea39b2478 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_KLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_KZR.png b/plugins/channelrx/demodadsb/map/liveries/F50_KZR.png new file mode 100644 index 000000000..e9870b1ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_KZR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_MAS.png b/plugins/channelrx/demodadsb/map/liveries/F50_MAS.png new file mode 100644 index 000000000..e2c6b3726 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_MAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_MAV.png b/plugins/channelrx/demodadsb/map/liveries/F50_MAV.png new file mode 100644 index 000000000..ce27d1d60 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_MAV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_NAF.png b/plugins/channelrx/demodadsb/map/liveries/F50_NAF.png new file mode 100644 index 000000000..46121cdad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_NAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_SKX.png b/plugins/channelrx/demodadsb/map/liveries/F50_SKX.png new file mode 100644 index 000000000..c6818cad8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_SKX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_SYA.png b/plugins/channelrx/demodadsb/map/liveries/F50_SYA.png new file mode 100644 index 000000000..1de16c639 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_SYA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F50_VLM.png b/plugins/channelrx/demodadsb/map/liveries/F50_VLM.png new file mode 100644 index 000000000..f9c310508 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F50_VLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F70_AUA.png b/plugins/channelrx/demodadsb/map/liveries/F70_AUA.png new file mode 100644 index 000000000..bc1e4667f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F70_AUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F70_KLM.png b/plugins/channelrx/demodadsb/map/liveries/F70_KLM.png new file mode 100644 index 000000000..f5f9f538f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F70_KLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F70_KLM_PH-NWC.png b/plugins/channelrx/demodadsb/map/liveries/F70_KLM_PH-NWC.png new file mode 100644 index 000000000..765c65844 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F70_KLM_PH-NWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/F70_MAH.png b/plugins/channelrx/demodadsb/map/liveries/F70_MAH.png new file mode 100644 index 000000000..8d12ae846 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/F70_MAH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/G115_UK4_G-BYUA.png b/plugins/channelrx/demodadsb/map/liveries/G115_UK4_G-BYUA.png new file mode 100644 index 000000000..82bb0e9c6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/G115_UK4_G-BYUA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/Generic_Medium.png b/plugins/channelrx/demodadsb/map/liveries/Generic_Medium.png new file mode 100644 index 000000000..409aa2909 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/Generic_Medium.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/H25B_N228TM.png b/plugins/channelrx/demodadsb/map/liveries/H25B_N228TM.png new file mode 100644 index 000000000..8ce6d910c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/H25B_N228TM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/HAWK_SA4_1.png b/plugins/channelrx/demodadsb/map/liveries/HAWK_SA4_1.png new file mode 100644 index 000000000..aef275456 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/HAWK_SA4_1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/HAWK_UK4_RA1.png b/plugins/channelrx/demodadsb/map/liveries/HAWK_UK4_RA1.png new file mode 100644 index 000000000..45b089168 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/HAWK_UK4_RA1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/HAWK_UK4_XX204.png b/plugins/channelrx/demodadsb/map/liveries/HAWK_UK4_XX204.png new file mode 100644 index 000000000..078320159 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/HAWK_UK4_XX204.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/J328_AUR.png b/plugins/channelrx/demodadsb/map/liveries/J328_AUR.png new file mode 100644 index 000000000..502278136 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/J328_AUR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/J328_SUS.png b/plugins/channelrx/demodadsb/map/liveries/J328_SUS.png new file mode 100644 index 000000000..837c15259 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/J328_SUS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_AAL.png b/plugins/channelrx/demodadsb/map/liveries/JS41_AAL.png new file mode 100644 index 000000000..75fe7a45b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_AWE.png b/plugins/channelrx/demodadsb/map/liveries/JS41_AWE.png new file mode 100644 index 000000000..55cb15ae3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_AWE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_BRI.png b/plugins/channelrx/demodadsb/map/liveries/JS41_BRI.png new file mode 100644 index 000000000..a09d3bd6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_BRI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_ESY.png b/plugins/channelrx/demodadsb/map/liveries/JS41_ESY.png new file mode 100644 index 000000000..2b643bded Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_ESY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_EZE.png b/plugins/channelrx/demodadsb/map/liveries/JS41_EZE.png new file mode 100644 index 000000000..0cbf065a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_EZE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_HKG.png b/plugins/channelrx/demodadsb/map/liveries/JS41_HKG.png new file mode 100644 index 000000000..fc4902a15 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_HKG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_LAM.png b/plugins/channelrx/demodadsb/map/liveries/JS41_LAM.png new file mode 100644 index 000000000..9dc6db289 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_LAM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_NYT.png b/plugins/channelrx/demodadsb/map/liveries/JS41_NYT.png new file mode 100644 index 000000000..e98b034f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_NYT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_SAA.png b/plugins/channelrx/demodadsb/map/liveries/JS41_SAA.png new file mode 100644 index 000000000..7f1e99d9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_SAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_SEH.png b/plugins/channelrx/demodadsb/map/liveries/JS41_SEH.png new file mode 100644 index 000000000..4660030fd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_SEH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/JS41_VNE.png b/plugins/channelrx/demodadsb/map/liveries/JS41_VNE.png new file mode 100644 index 000000000..cdf6f2bbd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/JS41_VNE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_BCV.png b/plugins/channelrx/demodadsb/map/liveries/L410_BCV.png new file mode 100644 index 000000000..c56ea5b74 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_BCV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_EST.png b/plugins/channelrx/demodadsb/map/liveries/L410_EST.png new file mode 100644 index 000000000..4e4b7a2c2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_EST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_HAX.png b/plugins/channelrx/demodadsb/map/liveries/L410_HAX.png new file mode 100644 index 000000000..182b83c51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_HAX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_KZN.png b/plugins/channelrx/demodadsb/map/liveries/L410_KZN.png new file mode 100644 index 000000000..b12a917c8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_KZN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_LAF.png b/plugins/channelrx/demodadsb/map/liveries/L410_LAF.png new file mode 100644 index 000000000..5d2b0fe82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_LAF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_LLI.png b/plugins/channelrx/demodadsb/map/liveries/L410_LLI.png new file mode 100644 index 000000000..37be84300 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_LLI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_MNX.png b/plugins/channelrx/demodadsb/map/liveries/L410_MNX.png new file mode 100644 index 000000000..df74b4ab2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_MNX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_NFA.png b/plugins/channelrx/demodadsb/map/liveries/L410_NFA.png new file mode 100644 index 000000000..473f92123 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_NFA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_OAO.png b/plugins/channelrx/demodadsb/map/liveries/L410_OAO.png new file mode 100644 index 000000000..f25149e1e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_OAO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_PTK.png b/plugins/channelrx/demodadsb/map/liveries/L410_PTK.png new file mode 100644 index 000000000..0fd21a4dd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_PTK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_SLD.png b/plugins/channelrx/demodadsb/map/liveries/L410_SLD.png new file mode 100644 index 000000000..0cd996a5a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_SLD.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/L410_VAA.png b/plugins/channelrx/demodadsb/map/liveries/L410_VAA.png new file mode 100644 index 000000000..3db299eea Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/L410_VAA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/LJ25.png b/plugins/channelrx/demodadsb/map/liveries/LJ25.png new file mode 100644 index 000000000..225da0560 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/LJ25.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/LJ45_B-3988.png b/plugins/channelrx/demodadsb/map/liveries/LJ45_B-3988.png new file mode 100644 index 000000000..5fe64daee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/LJ45_B-3988.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/LJ45_HB-VMB.png b/plugins/channelrx/demodadsb/map/liveries/LJ45_HB-VMB.png new file mode 100644 index 000000000..f145375cc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/LJ45_HB-VMB.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/M339_AE4_AF1.png b/plugins/channelrx/demodadsb/map/liveries/M339_AE4_AF1.png new file mode 100644 index 000000000..2adb94475 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/M339_AE4_AF1.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F.png b/plugins/channelrx/demodadsb/map/liveries/MD11F.png new file mode 100644 index 000000000..facd9a462 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_AAL.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_AAL.png new file mode 100644 index 000000000..745947367 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_AFX.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_AFX.png new file mode 100644 index 000000000..eb55e9f49 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_AFX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_AJC.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_AJC.png new file mode 100644 index 000000000..f7d63a0c0 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_AJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_AZA.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_AZA.png new file mode 100644 index 000000000..dfb32b0e1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_CXA_VA.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_CXA_VA.png new file mode 100644 index 000000000..09e86d782 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_CXA_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_DAL.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_DAL.png new file mode 100644 index 000000000..ace15d55c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_EAG.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_EAG.png new file mode 100644 index 000000000..82495f194 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_EAG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_FDX.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_FDX.png new file mode 100644 index 000000000..bd58edf58 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_FIN.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_FIN.png new file mode 100644 index 000000000..0280683ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_FIN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_GEC.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_GEC.png new file mode 100644 index 000000000..54a73eb6d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_GEC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_MPH.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_MPH.png new file mode 100644 index 000000000..19e25308f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_MPH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_MQC.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_MQC.png new file mode 100644 index 000000000..4f7cc2828 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_MQC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_NFC.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_NFC.png new file mode 100644 index 000000000..658b63a42 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_NFC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_NTL.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_NTL.png new file mode 100644 index 000000000..0404e95d9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_NTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_OAL_VA.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_OAL_VA.png new file mode 100644 index 000000000..79405294f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_OAL_VA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_PLC.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_PLC.png new file mode 100644 index 000000000..9505e035f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_PLC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_SWR.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_SWR.png new file mode 100644 index 000000000..e8aeb95ee Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_SWR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_TKY.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_TKY.png new file mode 100644 index 000000000..27f1d79a1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_TKY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_UPS.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_UPS.png new file mode 100644 index 000000000..b90f6d173 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_VSP.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_VSP.png new file mode 100644 index 000000000..7a9a08182 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_VSP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_WAT.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_WAT.png new file mode 100644 index 000000000..c6f304005 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_WGN.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_WGN.png new file mode 100644 index 000000000..a894e6552 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_WGN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11F_XSN.png b/plugins/channelrx/demodadsb/map/liveries/MD11F_XSN.png new file mode 100644 index 000000000..eb55e9f49 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11F_XSN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11_CWC.png b/plugins/channelrx/demodadsb/map/liveries/MD11_CWC.png new file mode 100644 index 000000000..cb678978f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11_CWC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11_FDX.png b/plugins/channelrx/demodadsb/map/liveries/MD11_FDX.png new file mode 100644 index 000000000..48fa2e2d1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11_FDX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11_GEC.png b/plugins/channelrx/demodadsb/map/liveries/MD11_GEC.png new file mode 100644 index 000000000..144d5a4f3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11_GEC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11_MPH.png b/plugins/channelrx/demodadsb/map/liveries/MD11_MPH.png new file mode 100644 index 000000000..fe7a07a17 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11_MPH.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD11_UPS.png b/plugins/channelrx/demodadsb/map/liveries/MD11_UPS.png new file mode 100644 index 000000000..617737703 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD11_UPS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_AAL.png b/plugins/channelrx/demodadsb/map/liveries/MD83_AAL.png new file mode 100644 index 000000000..f9dc82ea2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_AAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_ARG.png b/plugins/channelrx/demodadsb/map/liveries/MD83_ARG.png new file mode 100644 index 000000000..562c91c6c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_ARG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_AVA.png b/plugins/channelrx/demodadsb/map/liveries/MD83_AVA.png new file mode 100644 index 000000000..01fdfbde8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_AVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_AZA.png b/plugins/channelrx/demodadsb/map/liveries/MD83_AZA.png new file mode 100644 index 000000000..89252f2b2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_AZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_BUC.png b/plugins/channelrx/demodadsb/map/liveries/MD83_BUC.png new file mode 100644 index 000000000..723f931ae Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_BUC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_DTR.png b/plugins/channelrx/demodadsb/map/liveries/MD83_DTR.png new file mode 100644 index 000000000..5eb45806b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_DTR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_IRA.png b/plugins/channelrx/demodadsb/map/liveries/MD83_IRA.png new file mode 100644 index 000000000..c3c7a1ecf Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_IRA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_SAS.png b/plugins/channelrx/demodadsb/map/liveries/MD83_SAS.png new file mode 100644 index 000000000..b548fc4f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_SAS.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_VIK.png b/plugins/channelrx/demodadsb/map/liveries/MD83_VIK.png new file mode 100644 index 000000000..68a92226b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_VIK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD83_white.png b/plugins/channelrx/demodadsb/map/liveries/MD83_white.png new file mode 100644 index 000000000..8e16e3cd2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD83_white.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD90_DAL.png b/plugins/channelrx/demodadsb/map/liveries/MD90_DAL.png new file mode 100644 index 000000000..99073c601 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD90_DAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD90_EVA.png b/plugins/channelrx/demodadsb/map/liveries/MD90_EVA.png new file mode 100644 index 000000000..8914058cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD90_EVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MD90_JAL.png b/plugins/channelrx/demodadsb/map/liveries/MD90_JAL.png new file mode 100644 index 000000000..ba317c602 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MD90_JAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MG29_BG4_15.png b/plugins/channelrx/demodadsb/map/liveries/MG29_BG4_15.png new file mode 100644 index 000000000..6700efa69 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MG29_BG4_15.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/MG29_RU4_S01.png b/plugins/channelrx/demodadsb/map/liveries/MG29_RU4_S01.png new file mode 100644 index 000000000..f9295b59f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/MG29_RU4_S01.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/P28A.png b/plugins/channelrx/demodadsb/map/liveries/P28A.png new file mode 100644 index 000000000..8880f3bc7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/P28A.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/PC9_AU4_R01.png b/plugins/channelrx/demodadsb/map/liveries/PC9_AU4_R01.png new file mode 100644 index 000000000..17dc88724 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/PC9_AU4_R01.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/PC9_BAE_ZG969.png b/plugins/channelrx/demodadsb/map/liveries/PC9_BAE_ZG969.png new file mode 100644 index 000000000..e83dbd56c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/PC9_BAE_ZG969.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/PC9_BAE_ZK119.png b/plugins/channelrx/demodadsb/map/liveries/PC9_BAE_ZK119.png new file mode 100644 index 000000000..f8e53049d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/PC9_BAE_ZK119.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/S76_CA9_C-GHJX.png b/plugins/channelrx/demodadsb/map/liveries/S76_CA9_C-GHJX.png new file mode 100644 index 000000000..b05ff981e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/S76_CA9_C-GHJX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/S76_SE5_SE-JOJ.png b/plugins/channelrx/demodadsb/map/liveries/S76_SE5_SE-JOJ.png new file mode 100644 index 000000000..250e79294 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/S76_SE5_SE-JOJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/S76_UK4_G-XXEA.png b/plugins/channelrx/demodadsb/map/liveries/S76_UK4_G-XXEA.png new file mode 100644 index 000000000..5607db14f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/S76_UK4_G-XXEA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/S76_US9_N362AL.png b/plugins/channelrx/demodadsb/map/liveries/S76_US9_N362AL.png new file mode 100644 index 000000000..8896aeb47 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/S76_US9_N362AL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_BLF.png b/plugins/channelrx/demodadsb/map/liveries/SB20_BLF.png new file mode 100644 index 000000000..4a107652d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_BLF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_BRX.png b/plugins/channelrx/demodadsb/map/liveries/SB20_BRX.png new file mode 100644 index 000000000..d2a5ec46c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_BRX.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_CFE.png b/plugins/channelrx/demodadsb/map/liveries/SB20_CFE.png new file mode 100644 index 000000000..d96c5650b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_CFE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_DWT.png b/plugins/channelrx/demodadsb/map/liveries/SB20_DWT.png new file mode 100644 index 000000000..ddf28f1f7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_DWT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_ETI.png b/plugins/channelrx/demodadsb/map/liveries/SB20_ETI.png new file mode 100644 index 000000000..d6ef37d7f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_ETI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_EZE.png b/plugins/channelrx/demodadsb/map/liveries/SB20_EZE.png new file mode 100644 index 000000000..40b028337 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_EZE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_KRP.png b/plugins/channelrx/demodadsb/map/liveries/SB20_KRP.png new file mode 100644 index 000000000..e0214082d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_KRP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_LIL.png b/plugins/channelrx/demodadsb/map/liveries/SB20_LIL.png new file mode 100644 index 000000000..a762373cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_LIL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_LOG.png b/plugins/channelrx/demodadsb/map/liveries/SB20_LOG.png new file mode 100644 index 000000000..0b9076bd9 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_LOG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_MDV.png b/plugins/channelrx/demodadsb/map/liveries/SB20_MDV.png new file mode 100644 index 000000000..89dce6c90 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_MDV.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_OLT.png b/plugins/channelrx/demodadsb/map/liveries/SB20_OLT.png new file mode 100644 index 000000000..bdf7a0efa Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_OLT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_POT.png b/plugins/channelrx/demodadsb/map/liveries/SB20_POT.png new file mode 100644 index 000000000..68f5f7ed1 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_POT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SB20_SCW.png b/plugins/channelrx/demodadsb/map/liveries/SB20_SCW.png new file mode 100644 index 000000000..b2492a3a5 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SB20_SCW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34.png b/plugins/channelrx/demodadsb/map/liveries/SF34.png new file mode 100644 index 000000000..ca4a97ab3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34F.png b/plugins/channelrx/demodadsb/map/liveries/SF34F.png new file mode 100644 index 000000000..72b5a9133 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34F_CSQ.png b/plugins/channelrx/demodadsb/map/liveries/SF34F_CSQ.png new file mode 100644 index 000000000..07e7f1059 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34F_CSQ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34F_MTL.png b/plugins/channelrx/demodadsb/map/liveries/SF34F_MTL.png new file mode 100644 index 000000000..f225964d6 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34F_MTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_AFR.png b/plugins/channelrx/demodadsb/map/liveries/SF34_AFR.png new file mode 100644 index 000000000..79a877546 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_AFR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_ATK.png b/plugins/channelrx/demodadsb/map/liveries/SF34_ATK.png new file mode 100644 index 000000000..a31fa685e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_ATK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_CAY.png b/plugins/channelrx/demodadsb/map/liveries/SF34_CAY.png new file mode 100644 index 000000000..1f657b166 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_CAY.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_CJC.png b/plugins/channelrx/demodadsb/map/liveries/SF34_CJC.png new file mode 100644 index 000000000..d1a9f49d2 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_CJC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_CVA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_CVA.png new file mode 100644 index 000000000..558a20959 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_CVA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_DNU.png b/plugins/channelrx/demodadsb/map/liveries/SF34_DNU.png new file mode 100644 index 000000000..4948a8855 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_DNU.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_EGF.png b/plugins/channelrx/demodadsb/map/liveries/SF34_EGF.png new file mode 100644 index 000000000..35117dd11 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_EGF.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_ELL.png b/plugins/channelrx/demodadsb/map/liveries/SF34_ELL.png new file mode 100644 index 000000000..938652c31 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_ELL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_EZA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_EZA.png new file mode 100644 index 000000000..3481e8332 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_EZA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_IGA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_IGA.png new file mode 100644 index 000000000..57a930974 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_IGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_JAC.png b/plugins/channelrx/demodadsb/map/liveries/SF34_JAC.png new file mode 100644 index 000000000..b3b8cc87a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_JAC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_JBR.png b/plugins/channelrx/demodadsb/map/liveries/SF34_JBR.png new file mode 100644 index 000000000..b4f8297ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_JBR.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_LGA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_LGA.png new file mode 100644 index 000000000..dcd66fd99 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_LGA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_LOG.png b/plugins/channelrx/demodadsb/map/liveries/SF34_LOG.png new file mode 100644 index 000000000..aabc8f935 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_LOG.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_MES.png b/plugins/channelrx/demodadsb/map/liveries/SF34_MES.png new file mode 100644 index 000000000..810f99184 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_MES.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_MTL.png b/plugins/channelrx/demodadsb/map/liveries/SF34_MTL.png new file mode 100644 index 000000000..71cc3504f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_MTL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_NTJ.png b/plugins/channelrx/demodadsb/map/liveries/SF34_NTJ.png new file mode 100644 index 000000000..10aaf7291 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_NTJ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_OLT.png b/plugins/channelrx/demodadsb/map/liveries/SF34_OLT.png new file mode 100644 index 000000000..7167e822e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_OLT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_PCO.png b/plugins/channelrx/demodadsb/map/liveries/SF34_PCO.png new file mode 100644 index 000000000..b1af28032 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_PCO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_PCO_WESTJET_LINK.png b/plugins/channelrx/demodadsb/map/liveries/SF34_PCO_WESTJET_LINK.png new file mode 100644 index 000000000..fee888c82 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_PCO_WESTJET_LINK.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_POT.png b/plugins/channelrx/demodadsb/map/liveries/SF34_POT.png new file mode 100644 index 000000000..5344ce7ab Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_POT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_PSC.png b/plugins/channelrx/demodadsb/map/liveries/SF34_PSC.png new file mode 100644 index 000000000..f1714f93e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_PSC.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_RHA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_RHA.png new file mode 100644 index 000000000..ef8895576 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_RHA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_RXA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_RXA.png new file mode 100644 index 000000000..eb6f9a4db Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_RXA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_SBM.png b/plugins/channelrx/demodadsb/map/liveries/SF34_SBM.png new file mode 100644 index 000000000..fe9179679 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_SBM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_SGN.png b/plugins/channelrx/demodadsb/map/liveries/SF34_SGN.png new file mode 100644 index 000000000..45f81ad4f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_SGN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_SIL.png b/plugins/channelrx/demodadsb/map/liveries/SF34_SIL.png new file mode 100644 index 000000000..ab32135bc Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_SIL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_SLI.png b/plugins/channelrx/demodadsb/map/liveries/SF34_SLI.png new file mode 100644 index 000000000..c6044200b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_SLI.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_SRN.png b/plugins/channelrx/demodadsb/map/liveries/SF34_SRN.png new file mode 100644 index 000000000..4a752fffd Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_SRN.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_UAL.png b/plugins/channelrx/demodadsb/map/liveries/SF34_UAL.png new file mode 100644 index 000000000..d3a4e96cb Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_UAL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_USA.png b/plugins/channelrx/demodadsb/map/liveries/SF34_USA.png new file mode 100644 index 000000000..0e1ee4a5e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_USA.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_WAT.png b/plugins/channelrx/demodadsb/map/liveries/SF34_WAT.png new file mode 100644 index 000000000..8f592df98 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_WEW.png b/plugins/channelrx/demodadsb/map/liveries/SF34_WEW.png new file mode 100644 index 000000000..178a031a3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_WEW.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SF34_WST.png b/plugins/channelrx/demodadsb/map/liveries/SF34_WST.png new file mode 100644 index 000000000..12fbf15ba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SF34_WST.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU27_RU4_K01.png b/plugins/channelrx/demodadsb/map/liveries/SU27_RU4_K01.png new file mode 100644 index 000000000..af299bf9b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU27_RU4_K01.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95.png b/plugins/channelrx/demodadsb/map/liveries/SU95.png new file mode 100644 index 000000000..41c72ef51 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_AFL.png b/plugins/channelrx/demodadsb/map/liveries/SU95_AFL.png new file mode 100644 index 000000000..05f3f857a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_AFL.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_AZO.png b/plugins/channelrx/demodadsb/map/liveries/SU95_AZO.png new file mode 100644 index 000000000..263778c63 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_AZO.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_GZP.png b/plugins/channelrx/demodadsb/map/liveries/SU95_GZP.png new file mode 100644 index 000000000..001522c91 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_GZP.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_IAE.png b/plugins/channelrx/demodadsb/map/liveries/SU95_IAE.png new file mode 100644 index 000000000..f0c306818 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_IAE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_LLM.png b/plugins/channelrx/demodadsb/map/liveries/SU95_LLM.png new file mode 100644 index 000000000..ad6583659 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_LLM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_RWZ.png b/plugins/channelrx/demodadsb/map/liveries/SU95_RWZ.png new file mode 100644 index 000000000..da4d59c30 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_RWZ.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_SDM.png b/plugins/channelrx/demodadsb/map/liveries/SU95_SDM.png new file mode 100644 index 000000000..8241f4798 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_SDM.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_SYL_BLUE.png b/plugins/channelrx/demodadsb/map/liveries/SU95_SYL_BLUE.png new file mode 100644 index 000000000..f59042981 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_SYL_BLUE.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/SU95_WAT.png b/plugins/channelrx/demodadsb/map/liveries/SU95_WAT.png new file mode 100644 index 000000000..aa0952002 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/SU95_WAT.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/TOR_DE2_45+31.png b/plugins/channelrx/demodadsb/map/liveries/TOR_DE2_45+31.png new file mode 100644 index 000000000..93e873652 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/TOR_DE2_45+31.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/TOR_UK4_ZG777.png b/plugins/channelrx/demodadsb/map/liveries/TOR_UK4_ZG777.png new file mode 100644 index 000000000..02b01c74f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/TOR_UK4_ZG777.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/TUCA_UK4_ZF135.png b/plugins/channelrx/demodadsb/map/liveries/TUCA_UK4_ZF135.png new file mode 100644 index 000000000..40b06aa0d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/TUCA_UK4_ZF135.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/a332F.png b/plugins/channelrx/demodadsb/map/liveries/a332F.png new file mode 100644 index 000000000..533b1ac25 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/a332F.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/a400m.png b/plugins/channelrx/demodadsb/map/liveries/a400m.png new file mode 100644 index 000000000..4358e640a Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/a400m.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_drone.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_drone.png new file mode 100644 index 000000000..58cdc792b Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_drone.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_fighter.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_fighter.png new file mode 100644 index 000000000..818c86129 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_fighter.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_glider.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_glider.png new file mode 100644 index 000000000..327560bc7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_glider.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_heavy_2engine.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_heavy_2engine.png new file mode 100644 index 000000000..0af806069 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_heavy_2engine.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_heavy_4engine.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_heavy_4engine.png new file mode 100644 index 000000000..2d92265e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_heavy_4engine.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_helicopter.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_helicopter.png new file mode 100644 index 000000000..33da813b8 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_helicopter.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_large.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_large.png new file mode 100644 index 000000000..38571c3ad Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_large.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_light.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_light.png new file mode 100644 index 000000000..9cbd8fbba Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_light.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_small.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_small.png new file mode 100644 index 000000000..218431c5c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_small.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/aircraft_space.png b/plugins/channelrx/demodadsb/map/liveries/aircraft_space.png new file mode 100644 index 000000000..02c43f10f Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/aircraft_space.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/airport_truck.png b/plugins/channelrx/demodadsb/map/liveries/airport_truck.png new file mode 100644 index 000000000..99176a656 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/airport_truck.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/apache.png b/plugins/channelrx/demodadsb/map/liveries/apache.png new file mode 100644 index 000000000..9002310e7 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/apache.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/chinook.png b/plugins/channelrx/demodadsb/map/liveries/chinook.png new file mode 100644 index 000000000..7fc6bea4c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/chinook.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/drone.png b/plugins/channelrx/demodadsb/map/liveries/drone.png new file mode 100644 index 000000000..edbede763 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/drone.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/eurofighter.png b/plugins/channelrx/demodadsb/map/liveries/eurofighter.png new file mode 100644 index 000000000..3a5c67423 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/eurofighter.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/f15.png b/plugins/channelrx/demodadsb/map/liveries/f15.png new file mode 100644 index 000000000..4ce53301d Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/f15.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/f35.png b/plugins/channelrx/demodadsb/map/liveries/f35.png new file mode 100644 index 000000000..dbb4d24f4 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/f35.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/fire_truck.png b/plugins/channelrx/demodadsb/map/liveries/fire_truck.png new file mode 100644 index 000000000..f8a7f66ec Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/fire_truck.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/glider.png b/plugins/channelrx/demodadsb/map/liveries/glider.png new file mode 100644 index 000000000..c0c5056c3 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/glider.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/helicopter.png b/plugins/channelrx/demodadsb/map/liveries/helicopter.png new file mode 100644 index 000000000..daf588633 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/helicopter.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/spitfire.png b/plugins/channelrx/demodadsb/map/liveries/spitfire.png new file mode 100644 index 000000000..e04db9203 Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/spitfire.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/truck.png b/plugins/channelrx/demodadsb/map/liveries/truck.png new file mode 100644 index 000000000..3392ed83c Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/truck.png differ diff --git a/plugins/channelrx/demodadsb/map/liveries/ultralight.png b/plugins/channelrx/demodadsb/map/liveries/ultralight.png new file mode 100644 index 000000000..11f713a9e Binary files /dev/null and b/plugins/channelrx/demodadsb/map/liveries/ultralight.png differ diff --git a/plugins/channelrx/demodadsb/map/map_6_strict.qml b/plugins/channelrx/demodadsb/map/map_6_strict.qml index cb0d428d8..a753cd299 100644 --- a/plugins/channelrx/demodadsb/map/map_6_strict.qml +++ b/plugins/channelrx/demodadsb/map/map_6_strict.qml @@ -282,7 +282,8 @@ Item { console.log("z=" + aircraft.sourceItem.z) aircraft.sourceItem.z = aircraft.sourceItem.z + 1 } else if (mouse.button === Qt.RightButton) { - contextMenu.popup() + var p = mapToItem(contextMenu.parent, mouse.x, mouse.y) + contextMenu.popup(p.x, p.y) } } onDoubleClicked: { @@ -331,7 +332,8 @@ Item { if (mouse.button === Qt.LeftButton) { showAll = !showAll } else if (mouse.button === Qt.RightButton) { - contextMenu.popup() + var p = mapToItem(contextMenu.parent, mouse.x, mouse.y) + contextMenu.popup(p.x, p.y) } } Menu { @@ -459,7 +461,8 @@ Item { scanner: scanners[i] }) } - contextMenu.popup() + var p = mapToItem(contextMenu.parent, mouse.x, mouse.y) + contextMenu.popup(p.x, p.y) } } onDoubleClicked: (mouse) => { diff --git a/plugins/channelrx/demodadsb/readme.md b/plugins/channelrx/demodadsb/readme.md index 23e8e05b5..0f14e1452 100644 --- a/plugins/channelrx/demodadsb/readme.md +++ b/plugins/channelrx/demodadsb/readme.md @@ -12,6 +12,10 @@ The ADS-B plugin can send aircraft for display on the [Map Feature](../../featur ![ADS-B on 3D Map](../../../doc/img/ADSBDemod_plugin_map_3d.png) +The ADS-B plugin can also send data to the [Aircraft feature](../../feature/aircraft/readme.md) to be combined with ACARS data. + +The ADS-B plugin can be run in server mode, with aircraft state accessible via SDRangel's API and received frames can be forwarded via IP to aggregators. +

Interface

The top and bottom bars of the channel window are described [here](../../../sdrgui/channel/readme.md) @@ -107,6 +111,7 @@ Map: * Whether NAVAIDs, such as VORs, are displayed on the map. * Whether callsigns as said by ATC (E.g. Speedbird) are used on the map instead of the airline ICAO designator (E.g. BAW). * The colour palette to use for aircraft flight paths. +* Whether aircraft are displayed using icons showing their airline's livery, instead of black icons. Livery icons are matched from the aircraft type and operator, in the same way as 3D models, so require the 3D models to have been downloaded via the Map feature. Aircraft without a matching livery icon are displayed with a white version of the plain icon. Livery icons are sized proportionally to the real aircraft, so an A380 will appear larger than an A320.

13: Display Flight Path

@@ -460,8 +465,18 @@ The Az/El row gives the azimuth and elevation of the airport from the location s ![RTL SDR Device Settings for ADS-B](../../../doc/img/ADSBDemod_plugin_rtlsdr.png) +

API

+ +Full details of the API can be found in the Swagger documentation. + +As a simple example, to get current aircraft state (callsign, position and groundspeed): + + curl -X GET "http://127.0.0.1:8091/sdrangel/deviceset/0/channel/0/report" +

Attribution

+Aircraft images are from [PlaneSpotters](https://www.planespotters.net/) + Airline logos, sideviews and flags are by Steve Hibberd from [RadarSpotting](https://radarspotting.com) Aircraft and route data comes from [OpenSky Network](https://opensky-network.org/), [RadarSpotting](https://radarspotting.com) / [Planebase](https://planebase.biz/) and [VRS](https://sdm.virtualradarserver.co.uk/). diff --git a/plugins/channelrx/demodselcal/readme.md b/plugins/channelrx/demodselcal/readme.md index 74ea75316..2b31c2199 100644 --- a/plugins/channelrx/demodselcal/readme.md +++ b/plugins/channelrx/demodselcal/readme.md @@ -192,6 +192,10 @@ aircraft database used by the ADS-B demodulator has not been downloaded, you are asked whether to download it too (45MB): it provides aircraft types and images. The databases are stored in SDRangel's application data directory. +The [Aircraft feature](../../feature/aircraft/readme.md) uses the same database. When +one is running, every received call is passed to it, and it works out which aircraft +the call was for from the aircraft it is tracking - see its SELCAL section. +

22: Read calls from a CSV log

Click the load button to select an existing CSV log and add its calls to the diff --git a/plugins/channelrx/demodselcal/selcaldemod.cpp b/plugins/channelrx/demodselcal/selcaldemod.cpp index ca189ca80..61b5823f6 100644 --- a/plugins/channelrx/demodselcal/selcaldemod.cpp +++ b/plugins/channelrx/demodselcal/selcaldemod.cpp @@ -173,6 +173,7 @@ bool SELCALDemod::handleMessage(const Message& cmd) if (getMessageQueueToGUI()) { getMessageQueueToGUI()->push(MsgMessage::create(call)); } + sendAircraftReport(call); if (m_settings.m_udpEnabled) { QJsonObject json; @@ -360,6 +361,33 @@ void SELCALDemod::sendSampleRateToDemodAnalyzer() } } +// Tell the Aircraft feature about the call. +void SELCALDemod::sendAircraftReport(const SELCALMessages::Call& call) +{ + QList pipes; + MainCore::instance()->getMessagePipes().getMessagePipes(this, "aircraftreport", pipes); + + if (pipes.isEmpty()) { + return; + } + + AircraftReport report; + report.m_protocol = AircraftReport::SELCAL; + report.m_selcalCode = call.m_code; + report.m_frequency = call.m_frequency; + report.m_received = call.m_dateTime; + report.m_uplink = true; // A ground station calling an aircraft + report.m_label = "SELCAL"; + report.m_deviceSetIndex = getDeviceSetIndex(); + report.m_channelIndex = getIndexInDeviceSet(); + + for (const auto& pipe : pipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + messageQueue->push(MainCore::MsgAircraftReport::create(this, report)); + } +} + QByteArray SELCALDemod::serialize() const { return m_settings.serialize(); diff --git a/plugins/channelrx/demodselcal/selcaldemod.h b/plugins/channelrx/demodselcal/selcaldemod.h index c1667c826..5ef1ae968 100644 --- a/plugins/channelrx/demodselcal/selcaldemod.h +++ b/plugins/channelrx/demodselcal/selcaldemod.h @@ -168,6 +168,7 @@ private: virtual bool handleMessage(const Message& cmd); void applySettings(const QStringList& settingsKeys, const SELCALDemodSettings& settings, bool force = false); void sendSampleRateToDemodAnalyzer(); + void sendAircraftReport(const SELCALMessages::Call& call); void webapiReverseSendSettings(const QList& channelSettingsKeys, const SELCALDemodSettings& settings, bool force); void webapiFormatChannelSettings(const QList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings *swgChannelSettings, const SELCALDemodSettings& settings, bool force); diff --git a/plugins/feature/CMakeLists.txt b/plugins/feature/CMakeLists.txt index af7407af8..7ef8dd979 100644 --- a/plugins/feature/CMakeLists.txt +++ b/plugins/feature/CMakeLists.txt @@ -29,6 +29,16 @@ else() message(STATUS "Not building afc (ENABLE_FEATURE_AFC=${ENABLE_FEATURE_AFC})") endif() +# Positioning for the distance and track geometry, Charts for the GUI's rate chart and +# flight profile. Both are optional components in some Qt 6 packages, and without this +# the feature failed the whole configure step rather than turning itself off. +if (ENABLE_FEATURE_AIRCRAFT AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND + AND (NOT ENABLE_GUI OR Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND)) + add_subdirectory(aircraft) +else() + message(STATUS "Not building aircraft (ENABLE_FEATURE_AIRCRAFT=${ENABLE_FEATURE_AIRCRAFT} Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND} Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND=${Qt${QT_DEFAULT_MAJOR_VERSION}Charts_FOUND})") +endif() + if (ENABLE_FEATURE_AIS) add_subdirectory(ais) else() diff --git a/plugins/feature/aircraft/aircraft.cpp b/plugins/feature/aircraft/aircraft.cpp index c74e474ed..9d1dfb5a6 100644 --- a/plugins/feature/aircraft/aircraft.cpp +++ b/plugins/feature/aircraft/aircraft.cpp @@ -18,8 +18,23 @@ #include #include +#include +#include +#include +#include +#include +#include +#include #include "SWGMapItem.h" +#include "SWGFeatureSettings.h" +#include "SWGFeatureReport.h" +#include "SWGFeatureActions.h" +#include "SWGAircraftSettings.h" +#include "SWGAircraftReport.h" +#include "SWGAircraftActions.h" +#include "SWGAircraftNotificationSettings.h" +#include "SWGAircraftProtocolReport.h" #include "maincore.h" @@ -34,7 +49,8 @@ const char* const Aircraft::m_featureId = "Aircraft"; Aircraft::Aircraft(WebAPIAdapterInterface *webAPIAdapterInterface) : Feature(m_featureIdURI, webAPIAdapterInterface), - m_availableChannelHandler({"sdrangel.channel.adsbdemod", "sdrangel.channel.acarsdemod"}, QStringList{"aircraftreport"}) + m_availableChannelHandler(AircraftSettings::sourceURIs(), + QStringList{"aircraftreport", "acarsfeed"}) { qDebug("Aircraft::Aircraft: webAPIAdapterInterface: %p", webAPIAdapterInterface); setObjectName(m_featureId); @@ -45,6 +61,17 @@ Aircraft::Aircraft(WebAPIAdapterInterface *webAPIAdapterInterface) : &AvailableChannelOrFeatureHandler::messageEnqueued, this, &Aircraft::handleChannelMessageQueue); + QObject::connect( + &m_availableChannelHandler, + &AvailableChannelOrFeatureHandler::channelsOrFeaturesChanged, + this, + &Aircraft::updateReportPipes); + m_networkManager = new QNetworkAccessManager(); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Aircraft::networkManagerFinished); // All processing runs on the tracker's thread, for the feature's lifetime, // so it works the same with or without a GUI @@ -64,6 +91,12 @@ Aircraft::~Aircraft() &AvailableChannelOrFeatureHandler::messageEnqueued, this, &Aircraft::handleChannelMessageQueue); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Aircraft::networkManagerFinished); + delete m_networkManager; m_thread->quit(); m_thread->wait(); m_tracker = nullptr; @@ -90,20 +123,29 @@ bool Aircraft::handleMessage(const Message& cmd) applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce()); return true; } + else if (MainCore::MsgAcarsBlock::match(cmd)) + { + // Straight to the tracker's thread, which owns the archive and the connections. + // Not filtered by m_disabledSources: that says which demodulators contribute to + // the aircraft tables, and a receiver may reasonably want to archive and feed a + // band it does not track. + MainCore::MsgAcarsBlock& block = (MainCore::MsgAcarsBlock&) cmd; + if (m_tracker) { + m_tracker->getInputMessageQueue()->push(AircraftTracker::MsgAcarsBlock::create( + block.getBlock(), block.getDateTime(), block.getFrequency(), + block.getLevel(), block.getProtocol())); + } + return true; + } else if (MainCore::MsgAircraftReport::match(cmd)) { // All processing happens on the tracker's thread MainCore::MsgAircraftReport& report = (MainCore::MsgAircraftReport&) cmd; - // The user can turn individual demodulators off - bool wanted = true; - if (!m_settings.m_disabledSources.isEmpty()) - { - const ChannelAPI *channel = qobject_cast(report.getPipeSource()); - if (channel && m_settings.m_disabledSources.contains(channel->getURI())) { - wanted = false; - } - } + // The user can turn individual demodulators off. Their pipes are withdrawn, but + // reports already queued still arrive. The source is only compared: it may have + // been deleted since it queued this. + const bool wanted = !m_disabledChannels.contains(report.getPipeSource()); if (m_tracker && wanted) { @@ -149,11 +191,151 @@ void Aircraft::applySettings(const AircraftSettings& settings, const QListgetInputMessageQueue()->push(AircraftTracker::MsgConfigureTracker::create(settings, settingsKeys, force)); } } +// The settings that changed, or all of them when forced, to the remote instance - built +// by the same code as a settings GET, then cut down to those keys. The reverse API's own +// settings are never sent: they say where to send, not what. +void Aircraft::webapiReverseSendSettings(const QList& featureSettingsKeys, const AircraftSettings& settings, bool force) +{ + SWGSDRangel::SWGFeatureSettings swgFeatureSettings; + swgFeatureSettings.setAircraftSettings(new SWGSDRangel::SWGAircraftSettings()); + swgFeatureSettings.getAircraftSettings()->init(); + webapiFormatFeatureSettings(swgFeatureSettings, settings); + + QJsonObject *all = swgFeatureSettings.getAircraftSettings()->asJsonObject(); + QJsonObject sent; + static const QStringList reverseAPIKeys = { + "useReverseAPI", "reverseAPIAddress", "reverseAPIPort", + "reverseAPIFeatureSetIndex", "reverseAPIFeatureIndex" + }; + for (auto it = all->constBegin(); it != all->constEnd(); ++it) + { + // The JSON names are the settings keys, but for the casing of "API" + auto sameKey = [&it](const QString& key) { return key.compare(it.key(), Qt::CaseInsensitive) == 0; }; + const bool reverseAPIKey = std::any_of(reverseAPIKeys.begin(), reverseAPIKeys.end(), sameKey); + const bool changed = std::any_of(featureSettingsKeys.begin(), featureSettingsKeys.end(), sameKey); + if (!reverseAPIKey && (force || changed)) { + sent.insert(it.key(), it.value()); + } + } + delete all; + // asJsonObject() leaves out an empty list or string altogether, so emptying one - + // re-enabling the last disabled source, deleting the last rule - would never be sent + // and the remote would keep the old value for good + static const QHash emptyValues = { + {"disabledSources", QJsonArray()}, {"notificationSettings", QJsonArray()}, + {"title", QString()}, {"databaseFilename", QString()}, {"feedStationId", QString()}, + {"feedAirframesHost", QString()}, {"feedAvdelphiHost", QString()} + }; + for (auto it = emptyValues.constBegin(); it != emptyValues.constEnd(); ++it) + { + if (!sent.contains(it.key()) && (force || featureSettingsKeys.contains(it.key()))) { + sent.insert(it.key(), it.value()); + } + } + if (sent.isEmpty()) { + return; + } + + QJsonObject body; + body.insert("featureType", "Aircraft"); + body.insert("AircraftSettings", sent); + + QString featureSettingsURL = QString("http://%1:%2/sdrangel/featureset/%3/feature/%4/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIFeatureSetIndex) + .arg(settings.m_reverseAPIFeatureIndex); + m_networkRequest.setUrl(QUrl(featureSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(QJsonDocument(body).toJson(QJsonDocument::Compact)); + buffer->seek(0); + + // Always use PATCH to avoid passing reverse API settings + QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); + buffer->setParent(reply); +} + +void Aircraft::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "Aircraft::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + } + else + { + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("Aircraft::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + } + + reply->deleteLater(); +} + +// A disabled demodulator loses its "aircraftreport" pipe rather than having its reports +// dropped here: ADS-B sends to the Map itself only when it has no such pipe, so dropping +// them took ADS-B aircraft off the Map altogether. +void Aircraft::updateReportPipes() +{ + const AvailableChannelOrFeatureList& available = m_availableChannelHandler.getAvailableChannelOrFeatureList(); + + // A channel that has gone took its pipe with it, and a new one may reuse its address + for (auto it = m_disabledChannels.begin(); it != m_disabledChannels.end(); ) + { + if (available.indexOfObject(*it) < 0) { + it = m_disabledChannels.erase(it); + } else { + ++it; + } + } + + for (const auto& channelOrFeature : available) + { + const ChannelAPI *channel = qobject_cast(channelOrFeature.m_object); + const bool disable = channel && m_settings.m_disabledSources.contains(channel->getURI()); + const bool disabled = m_disabledChannels.contains(channelOrFeature.m_object); + + if (disable) + { + // Every time, not only when first disabled: a channel whose index changes + // looks new to the handler's rescan, which registers its pipes again + m_availableChannelHandler.deregisterPipes(channelOrFeature.m_object, {"aircraftreport"}); + m_disabledChannels.insert(channelOrFeature.m_object); + } + else if (disabled) + { + m_availableChannelHandler.registerPipes(channelOrFeature.getLongId(), {"aircraftreport"}); + m_disabledChannels.remove(channelOrFeature.m_object); + } + } +} + void Aircraft::handleChannelMessageQueue(MessageQueue* messageQueue) { Message* message; @@ -165,3 +347,372 @@ void Aircraft::handleChannelMessageQueue(MessageQueue* messageQueue) } } } + +int Aircraft::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAircraftSettings(new SWGSDRangel::SWGAircraftSettings()); + response.getAircraftSettings()->init(); + webapiFormatFeatureSettings(response, m_settings); + return 200; +} + +int Aircraft::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + AircraftSettings settings = m_settings; + webapiUpdateFeatureSettings(settings, featureSettingsKeys, response); + + MsgConfigureAircraft *msg = MsgConfigureAircraft::create(settings, featureSettingsKeys, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAircraft *msgToGUI = MsgConfigureAircraft::create(settings, featureSettingsKeys, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatFeatureSettings(response, settings); + return 200; +} + +int Aircraft::webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAircraftReport(new SWGSDRangel::SWGAircraftReport()); + response.getAircraftReport()->init(); + webapiFormatFeatureReport(response); + return 200; +} + +// Selecting an aircraft or a flight from outside. This is what the links in an aircraft's +// Map popup come back through: the Map has no idea what an aircraft is, so it posts the +// action and this feature does the work. +int Aircraft::webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage) +{ + SWGSDRangel::SWGAircraftActions *swgAircraftActions = query.getAircraftActions(); + + if (!swgAircraftActions) + { + errorMessage = "Missing AircraftActions in query"; + return 400; + } + + struct Action { + const char *m_key; + AircraftTracker::MsgSelect::Kind m_kind; + QString *m_value; + }; + const Action actions[] = { + { "selectIcao", AircraftTracker::MsgSelect::Icao, swgAircraftActions->getSelectIcao() }, + { "selectRegistration", AircraftTracker::MsgSelect::Registration, + swgAircraftActions->getSelectRegistration() }, + { "selectFlight", AircraftTracker::MsgSelect::Flight, swgAircraftActions->getSelectFlight() }, + }; + + for (const Action& action : actions) + { + if (!featureActionsKeys.contains(action.m_key) || !action.m_value) { + continue; + } + // Through the tracker's queue rather than straight to the GUI, so that a select + // arriving while the tracker is mid-flush is applied in order with everything + // else - and so that it works the same way whether or not a GUI exists + if (m_tracker) { + m_tracker->getInputMessageQueue()->push( + AircraftTracker::MsgSelect::create(action.m_kind, *action.m_value)); + } + } + return 202; +} + +void Aircraft::webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const AircraftSettings& settings) +{ + SWGSDRangel::SWGAircraftSettings *swg = response.getAircraftSettings(); + + swg->setRemovalMins(settings.m_removalMins); + swg->setAdsbPositionMins(settings.m_adsbPositionMins); + swg->setAcarsPositionMins(settings.m_acarsPositionMins); + swg->setRetentionDays(settings.m_retentionDays); + swg->setAtcLabels(settings.m_atcLabels ? 1 : 0); + swg->setAtcCallsigns(settings.m_atcCallsigns ? 1 : 0); + swg->setDisplayMaxRangeOnMap(settings.m_displayMaxRangeOnMap ? 1 : 0); + swg->setFavourLivery(settings.m_favourLivery ? 1 : 0); + swg->setDisplayStatistics(settings.m_displayStatistics ? 1 : 0); + swg->setDisplayChart(settings.m_displayChart ? 1 : 0); + swg->setDisplayCoverage(settings.m_displayCoverage ? 1 : 0); + swg->setUseLiveryIcons(settings.m_useLiveryIcons ? 1 : 0); + swg->setFeedEnabled(settings.m_feedEnabled ? 1 : 0); + swg->setFeedAirframes(settings.m_feedAirframes ? 1 : 0); + swg->setFeedAirframesPort(settings.m_feedAirframesPort); + swg->setFeedAirframesTcp(settings.m_feedAirframesTcp ? 1 : 0); + swg->setFeedAvdelphi(settings.m_feedAvdelphi ? 1 : 0); + swg->setFeedAvdelphiPort(settings.m_feedAvdelphiPort); + swg->setFeedAvdelphiTcp(settings.m_feedAvdelphiTcp ? 1 : 0); + swg->setRgbColor(settings.m_rgbColor); + swg->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + swg->setReverseApiPort(settings.m_reverseAPIPort); + swg->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex); + swg->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex); + swg->setWorkspaceIndex(settings.m_workspaceIndex); + + // The generated setters take ownership of what they are given, and the default + // constructor leaves every pointer null - so assign in place where one is already + // there and allocate where it is not + auto setString = [](QString **held, const QString& value) + { + if (*held) { + **held = value; + } else { + *held = new QString(value); + } + }; + QString *title = swg->getTitle(); + setString(&title, settings.m_title); + swg->setTitle(title); + QString *database = swg->getDatabaseFilename(); + setString(&database, settings.m_databaseFilename); + swg->setDatabaseFilename(database); + QString *stationId = swg->getFeedStationId(); + setString(&stationId, settings.m_feedStationId); + swg->setFeedStationId(stationId); + QString *airframesHost = swg->getFeedAirframesHost(); + setString(&airframesHost, settings.m_feedAirframesHost); + swg->setFeedAirframesHost(airframesHost); + QString *avdelphiHost = swg->getFeedAvdelphiHost(); + setString(&avdelphiHost, settings.m_feedAvdelphiHost); + swg->setFeedAvdelphiHost(avdelphiHost); + + // The lists likewise. init() has usually allocated them already, and on a PUT or + // PATCH the response is the request, holding the lists that were parsed into it - so + // replacing them through the setters leaked them, and everything in them + auto emptyList = [](auto *held) + { + using List = std::remove_pointer_t; + if (!held) { + return new List(); + } + qDeleteAll(*held); + held->clear(); + return held; + }; + + QList *disabled = emptyList(swg->getDisabledSources()); + for (const QString& uri : settings.m_disabledSources) { + disabled->append(new QString(uri)); + } + swg->setDisabledSources(disabled); + + QList *rules = + emptyList(swg->getNotificationSettings()); + for (const auto& rule : settings.m_notificationSettings) + { + if (!rule) { + continue; + } + SWGSDRangel::SWGAircraftNotificationSettings *swgRule = + new SWGSDRangel::SWGAircraftNotificationSettings(); + swgRule->init(); + swgRule->setMatchColumn(rule->m_matchColumn); + swgRule->setRegExp(new QString(rule->m_regExp)); + swgRule->setSpeech(new QString(rule->m_speech)); + swgRule->setCommand(new QString(rule->m_command)); + rules->append(swgRule); + } + swg->setNotificationSettings(rules); + + QString *address = swg->getReverseApiAddress(); + setString(&address, settings.m_reverseAPIAddress); + swg->setReverseApiAddress(address); +} + +void Aircraft::webapiUpdateFeatureSettings( + AircraftSettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response) +{ + SWGSDRangel::SWGAircraftSettings *swg = response.getAircraftSettings(); + if (!swg) { + return; + } + + if (featureSettingsKeys.contains("removalMins")) { + settings.m_removalMins = swg->getRemovalMins(); + } + if (featureSettingsKeys.contains("adsbPositionMins")) { + settings.m_adsbPositionMins = swg->getAdsbPositionMins(); + } + if (featureSettingsKeys.contains("acarsPositionMins")) { + settings.m_acarsPositionMins = swg->getAcarsPositionMins(); + } + if (featureSettingsKeys.contains("retentionDays")) { + settings.m_retentionDays = swg->getRetentionDays(); + } + if (featureSettingsKeys.contains("atcLabels")) { + settings.m_atcLabels = swg->getAtcLabels() != 0; + } + if (featureSettingsKeys.contains("atcCallsigns")) { + settings.m_atcCallsigns = swg->getAtcCallsigns() != 0; + } + if (featureSettingsKeys.contains("displayMaxRangeOnMap")) { + settings.m_displayMaxRangeOnMap = swg->getDisplayMaxRangeOnMap() != 0; + } + if (featureSettingsKeys.contains("favourLivery")) { + settings.m_favourLivery = swg->getFavourLivery() != 0; + } + if (featureSettingsKeys.contains("displayStatistics")) { + settings.m_displayStatistics = swg->getDisplayStatistics() != 0; + } + if (featureSettingsKeys.contains("displayChart")) { + settings.m_displayChart = swg->getDisplayChart() != 0; + } + if (featureSettingsKeys.contains("displayCoverage")) { + settings.m_displayCoverage = swg->getDisplayCoverage() != 0; + } + if (featureSettingsKeys.contains("useLiveryIcons")) { + settings.m_useLiveryIcons = swg->getUseLiveryIcons() != 0; + } + if (featureSettingsKeys.contains("feedEnabled")) { + settings.m_feedEnabled = swg->getFeedEnabled() != 0; + } + if (featureSettingsKeys.contains("feedStationId") && swg->getFeedStationId()) { + settings.m_feedStationId = *swg->getFeedStationId(); + } + if (featureSettingsKeys.contains("feedAirframes")) { + settings.m_feedAirframes = swg->getFeedAirframes() != 0; + } + if (featureSettingsKeys.contains("feedAirframesHost") && swg->getFeedAirframesHost()) { + settings.m_feedAirframesHost = *swg->getFeedAirframesHost(); + } + if (featureSettingsKeys.contains("feedAirframesPort")) { + settings.m_feedAirframesPort = swg->getFeedAirframesPort(); + } + if (featureSettingsKeys.contains("feedAirframesTcp")) { + settings.m_feedAirframesTcp = swg->getFeedAirframesTcp() != 0; + } + if (featureSettingsKeys.contains("feedAvdelphi")) { + settings.m_feedAvdelphi = swg->getFeedAvdelphi() != 0; + } + if (featureSettingsKeys.contains("feedAvdelphiHost") && swg->getFeedAvdelphiHost()) { + settings.m_feedAvdelphiHost = *swg->getFeedAvdelphiHost(); + } + if (featureSettingsKeys.contains("feedAvdelphiPort")) { + settings.m_feedAvdelphiPort = swg->getFeedAvdelphiPort(); + } + if (featureSettingsKeys.contains("feedAvdelphiTcp")) { + settings.m_feedAvdelphiTcp = swg->getFeedAvdelphiTcp() != 0; + } + if (featureSettingsKeys.contains("databaseFilename") && swg->getDatabaseFilename()) { + settings.m_databaseFilename = *swg->getDatabaseFilename(); + } + if (featureSettingsKeys.contains("disabledSources")) + { + settings.m_disabledSources.clear(); + if (swg->getDisabledSources()) + { + for (const QString *uri : *swg->getDisabledSources()) + { + if (uri) { + settings.m_disabledSources.append(*uri); + } + } + } + } + if (featureSettingsKeys.contains("notificationSettings")) + { + settings.m_notificationSettings.clear(); + if (swg->getNotificationSettings()) + { + for (const SWGSDRangel::SWGAircraftNotificationSettings *swgRule : *swg->getNotificationSettings()) + { + if (!swgRule) { + continue; + } + QSharedPointer rule( + new AircraftSettings::NotificationSettings()); + rule->m_matchColumn = + const_cast(swgRule)->getMatchColumn(); + auto text = [](QString *p) { return p ? *p : QString(); }; + rule->m_regExp = text(const_cast(swgRule)->getRegExp()); + rule->m_speech = text(const_cast(swgRule)->getSpeech()); + rule->m_command = text(const_cast(swgRule)->getCommand()); + rule->updateRegularExpression(); + settings.m_notificationSettings.append(rule); + } + } + } + if (featureSettingsKeys.contains("title") && swg->getTitle()) { + settings.m_title = *swg->getTitle(); + } + if (featureSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = swg->getRgbColor(); + } + if (featureSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = swg->getUseReverseApi() != 0; + } + if (featureSettingsKeys.contains("reverseAPIAddress") && swg->getReverseApiAddress()) { + settings.m_reverseAPIAddress = *swg->getReverseApiAddress(); + } + if (featureSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = swg->getReverseApiPort(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureSetIndex")) { + settings.m_reverseAPIFeatureSetIndex = swg->getReverseApiFeatureSetIndex(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) { + settings.m_reverseAPIFeatureIndex = swg->getReverseApiFeatureIndex(); + } + if (featureSettingsKeys.contains("workspaceIndex")) { + settings.m_workspaceIndex = swg->getWorkspaceIndex(); + } +} + +void Aircraft::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) +{ + SWGSDRangel::SWGAircraftReport *swg = response.getAircraftReport(); + if (!m_tracker) { + return; + } + + const AircraftTracker::Totals totals = m_tracker->totals(); + swg->setAircraftCount(totals.m_aircraft); + swg->setActiveAircraftCount(totals.m_activeAircraft); + swg->setFlightCount(totals.m_flights); + swg->setMessageCount(totals.m_messages); + + QList *protocols = + new QList(); + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + // Not init(): that allocates the protocol string the setter would then replace + SWGSDRangel::SWGAircraftProtocolReport *swgProtocol = + new SWGSDRangel::SWGAircraftProtocolReport(); + swgProtocol->setProtocol(new QString(m_tracker->protocolName(i))); + swgProtocol->setMessageCount(totals.m_messagesByProtocol[i]); + protocols->append(swgProtocol); + } + // Into the list init() has already allocated, rather than leaking it on every GET + if (swg->getProtocols()) + { + qDeleteAll(*swg->getProtocols()); + *swg->getProtocols() = *protocols; + delete protocols; + } + else + { + swg->setProtocols(protocols); + } +} diff --git a/plugins/feature/aircraft/aircraft.h b/plugins/feature/aircraft/aircraft.h index f74dd6447..97d770f12 100644 --- a/plugins/feature/aircraft/aircraft.h +++ b/plugins/feature/aircraft/aircraft.h @@ -19,6 +19,8 @@ #ifndef INCLUDE_FEATURE_AIRCRAFT_H_ #define INCLUDE_FEATURE_AIRCRAFT_H_ +#include + #include "feature/feature.h" #include "util/message.h" #include "availablechannelorfeaturehandler.h" @@ -28,6 +30,8 @@ class WebAPIAdapterInterface; class QThread; +class QNetworkAccessManager; +class QNetworkReply; // Collates aircraft data from the ADS-B and ACARS (VHF/VDL-2/HFDL/Aero) demodulators // into a combined aircraft/flight model, and is the source of aircraft items for @@ -79,21 +83,56 @@ public: virtual QByteArray serialize() const; virtual bool deserialize(const QByteArray& data); + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage); + + virtual int webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage); + + static void webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const AircraftSettings& settings); + + static void webapiUpdateFeatureSettings( + AircraftSettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response); + static const char* const m_featureIdURI; static const char* const m_featureId; private: AircraftSettings m_settings; AvailableChannelOrFeatureHandler m_availableChannelHandler; + QSet m_disabledChannels; //!< Channels whose "aircraftreport" pipe has been withdrawn. Compared, never dereferenced. QThread *m_thread; AircraftTracker *m_tracker; + QNetworkAccessManager *m_networkManager; + QNetworkRequest m_networkRequest; void start(); void stop(); void applySettings(const AircraftSettings& settings, const QList& settingsKeys, bool force = false); + void webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response); + void webapiReverseSendSettings(const QList& featureSettingsKeys, const AircraftSettings& settings, bool force); private slots: void handleChannelMessageQueue(MessageQueue* messageQueue); + void updateReportPipes(); + void networkManagerFinished(QNetworkReply *reply); }; #endif // INCLUDE_FEATURE_AIRCRAFT_H_ diff --git a/plugins/feature/aircraft/aircraftdb.cpp b/plugins/feature/aircraft/aircraftdb.cpp index d7095dcef..e890225a0 100644 --- a/plugins/feature/aircraft/aircraftdb.cpp +++ b/plugins/feature/aircraft/aircraftdb.cpp @@ -1,1282 +1,2779 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -// Session persistence for the Aircraft feature: the collated aircraft, flights, -// documents and ATC log are kept in a SQLite database (vendored amalgamation - -// public domain, no Qt SQL dependency), written every minute and on exit, and -// restored on startup. Runs on the tracker thread, so the GUI never blocks on a -// save. Aircraft older than the removal timeout are pruned on load; the -// self-contained ATC log is restored in full. - -#include -#include - -#include -#include -#include -#include -#include - -#include "sqlite/sqlite3.h" - -#include "aircrafttracker.h" - -// Current schema version. v2 added the aliases column to flights. -#define AIRCRAFT_DB_VERSION 3 - -// Where the session is kept. The setting wins; otherwise the default location, whose -// directory may not exist yet -QString AircraftTracker::databasePath(const AircraftSettings& settings) -{ - if (!settings.m_databaseFilename.isEmpty()) - { - QDir().mkpath(QFileInfo(settings.m_databaseFilename).absolutePath()); - return settings.m_databaseFilename; - } - - QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); - QDir().mkpath(locations[0]); - return locations[0] + "/aircraft.db"; -} - -static bool execSQL(sqlite3 *db, const char *sql) -{ - char *errMsg = nullptr; - if (sqlite3_exec(db, sql, nullptr, nullptr, &errMsg) != SQLITE_OK) - { - qWarning() << "AircraftTracker: SQL failed:" << sql << ":" << (errMsg ? errMsg : ""); - sqlite3_free(errMsg); - return false; - } - return true; -} - -// Run a prepared INSERT and say whether the row went in. -// -// sqlite3_step returns SQLITE_DONE for a successful INSERT; anything else - a full disk, -// an I/O error, a constraint - means the row is not there. Ignoring it let a failed save -// look successful, and saveDatabase() then cleared the dirty flag, so nothing retried and -// the database silently stayed as it was. -static bool stepInsert(sqlite3 *db, sqlite3_stmt *stmt, const char *what, bool& failed) -{ - if (failed) { - return false; // Already given up on this transaction - } - if (sqlite3_step(stmt) != SQLITE_DONE) - { - qWarning() << "AircraftTracker::saveDatabase: writing" << what << "failed:" - << sqlite3_errmsg(db); - failed = true; - return false; - } - return true; -} - -static void bindText(sqlite3_stmt *stmt, int idx, const QString& text) -{ - QByteArray utf8 = text.toUtf8(); - sqlite3_bind_text(stmt, idx, utf8.constData(), utf8.size(), SQLITE_TRANSIENT); -} - -static QString columnText(sqlite3_stmt *stmt, int idx) -{ - const char *text = (const char *) sqlite3_column_text(stmt, idx); - return text ? QString::fromUtf8(text) : QString(); -} - -static QDateTime columnDateTime(sqlite3_stmt *stmt, int idx) -{ - qint64 ms = sqlite3_column_int64(stmt, idx); - return ms ? QDateTime::fromMSecsSinceEpoch(ms) : QDateTime(); -} - -static qint64 dateTimeValue(const QDateTime& dateTime) -{ - return dateTime.isValid() ? dateTime.toMSecsSinceEpoch() : 0; -} - -// Add a column if the table does not already have it. -// -// Migrating on the version number alone is not enough: a column added to CREATE TABLE -// and to the migration for the version BELOW the current one never reaches a database -// that is already at the current version, and the next INSERT then binds more values -// than the table has columns and fails to prepare - taking the whole save with it. -// Asking the table what it actually has is immune to that. -static bool tableExists(sqlite3 *db, const char *table) -{ - sqlite3_stmt *stmt = nullptr; - bool exists = false; - if (sqlite3_prepare_v2(db, "SELECT 1 FROM sqlite_master WHERE type='table' AND name=?", - -1, &stmt, nullptr) == SQLITE_OK) - { - sqlite3_bind_text(stmt, 1, table, -1, SQLITE_STATIC); - exists = (sqlite3_step(stmt) == SQLITE_ROW); - } - sqlite3_finalize(stmt); - return exists; -} - -static void ensureColumn(sqlite3 *db, const char *table, const char *column, const char *decl) -{ - sqlite3_stmt *stmt = nullptr; - const QString query = QString("PRAGMA table_info(%1)").arg(table); - bool found = false; - if (sqlite3_prepare_v2(db, query.toUtf8().constData(), -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - const unsigned char *name = sqlite3_column_text(stmt, 1); - if (name && (qstrcmp((const char *) name, column) == 0)) - { - found = true; - break; - } - } - } - sqlite3_finalize(stmt); - if (!found) - { - qDebug() << "AircraftTracker::openDatabase: adding" << table << "." << column; - execSQL(db, QString("ALTER TABLE %1 ADD COLUMN %2 %3").arg(table).arg(column).arg(decl).toUtf8().constData()); - } -} - -bool AircraftTracker::openDatabase() -{ - QString path = databasePath(m_settings); - if (sqlite3_open(path.toUtf8().constData(), &m_db) != SQLITE_OK) - { - qWarning() << "AircraftTracker::openDatabase: Failed to open" << path << ":" << sqlite3_errmsg(m_db); - sqlite3_close(m_db); - m_db = nullptr; - return false; - } - - // Write-ahead logging is considerably faster for the periodic full rewrite - execSQL(m_db, "PRAGMA journal_mode=WAL"); - execSQL(m_db, "PRAGMA synchronous=NORMAL"); - - // Whether the all time table is about to be created, which says this database has - // never had one and so its existing aircraft have never been counted into it - const bool seenIsNew = !tableExists(m_db, "seen"); - - bool ok = execSQL(m_db, - "CREATE TABLE IF NOT EXISTS meta (version INTEGER);" - "CREATE TABLE IF NOT EXISTS aircraft (" - "id INTEGER PRIMARY KEY, icao INTEGER, registration TEXT, flight TEXT," - "position_valid INTEGER, latitude REAL, longitude REAL," - "altitude_valid INTEGER, altitude REAL," - "heading_valid INTEGER, heading REAL," - "speed_valid INTEGER, speed REAL," - "position_time INTEGER, last_seen INTEGER," - "departure TEXT, arrival TEXT, route TEXT," - "last_document TEXT, messages INTEGER, model3d TEXT);" - "CREATE TABLE IF NOT EXISTS sources (" - "aircraft_id INTEGER, protocol INTEGER, frequency INTEGER, count INTEGER);" - // The same tally per flight rather than per airframe - what a given flight was - // heard on, which is what the Map shows. Added without a version bump because - // IF NOT EXISTS creates it on the next open of an older database, where bumping - // would send every existing database down the "starting afresh" branch and - // delete everything in it. - "CREATE TABLE IF NOT EXISTS flight_sources (" - "flight_id INTEGER, protocol INTEGER, frequency INTEGER, count INTEGER);" - "CREATE TABLE IF NOT EXISTS track (" - "flight_id INTEGER, seq INTEGER, latitude REAL, longitude REAL, altitude REAL, time INTEGER);" - "CREATE TABLE IF NOT EXISTS flights (" - "id INTEGER PRIMARY KEY, aircraft_id INTEGER, flight TEXT," - "first_seen INTEGER, last_seen INTEGER," - "departure TEXT, arrival TEXT, route TEXT, is_current INTEGER," - "aliases TEXT DEFAULT '', messages INTEGER DEFAULT 0," - "out_time INTEGER DEFAULT 0, off_time INTEGER DEFAULT 0," - "on_time INTEGER DEFAULT 0, in_time INTEGER DEFAULT 0);" - "CREATE TABLE IF NOT EXISTS documents (" - "flight_id INTEGER, kind INTEGER, title TEXT, text TEXT, received INTEGER);" - "CREATE TABLE IF NOT EXISTS profile (" - "flight_id INTEGER, time INTEGER, altitude REAL, speed REAL);" - "CREATE TABLE IF NOT EXISTS atc (" - "time INTEGER, protocol TEXT, uplink INTEGER," - "from_station TEXT, to_station TEXT, message TEXT, tooltip TEXT," - "aircraft_id INTEGER, flight_id INTEGER, map_name TEXT);" - // Every airframe ever heard, for the all time aircraft count. One row each, no - // matter how often it comes back, which is the whole reason a count cannot do - // the job. Kept out of every DELETE below: this is the one table that has to - // outlive both the retention period and a schema reset, and losing it would - // silently reset a figure the user cannot recover. Added without a version bump - // because IF NOT EXISTS creates it on the next open of an older database - and - // bumping would send every existing v3 database down the "starting afresh" - // branch, which deletes everything - "CREATE TABLE IF NOT EXISTS seen (" - "key TEXT PRIMARY KEY, first_seen INTEGER, last_seen INTEGER);"); - if (!ok) - { - sqlite3_close(m_db); - m_db = nullptr; - return false; - } - - // An existing database already knows about aircraft heard before the all time table - // existed, so seed it from them rather than starting the count at nothing on an - // installation that has been running for months. Only what is still within the - // retention period can be recovered, so the figure starts low and is honest about it - // via the "since" date. Done once, on creation: repeating it every open would undo a - // reset, since the aircraft table would put the same rows straight back. - if (seenIsNew) - { - execSQL(m_db, - "INSERT OR IGNORE INTO seen (key, first_seen, last_seen) " - "SELECT CASE WHEN icao IS NOT NULL AND icao != 0 THEN printf('%06X', icao) " - "ELSE 'R:' || registration END, last_seen, last_seen " - "FROM aircraft " - "WHERE (icao IS NOT NULL AND icao != 0) " - "OR (registration IS NOT NULL AND registration != '')"); - } - - // Columns added after a version bump, which the version chain below would miss on a - // database already at the current version - ensureColumn(m_db, "flights", "messages", "INTEGER DEFAULT 0"); - ensureColumn(m_db, "flights", "out_time", "INTEGER DEFAULT 0"); - ensureColumn(m_db, "flights", "off_time", "INTEGER DEFAULT 0"); - ensureColumn(m_db, "flights", "on_time", "INTEGER DEFAULT 0"); - ensureColumn(m_db, "flights", "in_time", "INTEGER DEFAULT 0"); - // The departure, arrival and route are stored, so what decides whether a report may - // replace them has to be stored with them - otherwise the first message after a - // restart wins however delayed it is, which is the case the timestamp exists for - ensureColumn(m_db, "flights", "route_filed", "INTEGER DEFAULT 0"); - // A model is no use on its own: without the offsets it sits half underground, and - // without knowing whether we chose it, the livery setting may not replace it - ensureColumn(m_db, "aircraft", "model_altitude_offset", "REAL DEFAULT 0"); - ensureColumn(m_db, "aircraft", "label_altitude_offset", "REAL DEFAULT 0"); - // Defaulted to -1, which no row written since says: that is what distinguishes a - // row from before these columns existed, whose model has no offsets to go with it, - // from one that legitimately holds a zero offset - ensureColumn(m_db, "aircraft", "model_is_ours", "INTEGER DEFAULT -1"); - - // Schema version, for future migrations - sqlite3_stmt *stmt = nullptr; - int version = 0; - if (sqlite3_prepare_v2(m_db, "SELECT version FROM meta", -1, &stmt, nullptr) == SQLITE_OK) - { - if (sqlite3_step(stmt) == SQLITE_ROW) { - version = sqlite3_column_int(stmt, 0); - } - } - sqlite3_finalize(stmt); - if (version == 0) { - execSQL(m_db, "INSERT INTO meta (version) VALUES (" QT_STRINGIFY(AIRCRAFT_DB_VERSION) ")"); - } else if ((version == 1) || (version == 2)) { - if (version == 1) - { - // v1 -> v2: flight name aliases - qDebug() << "AircraftTracker::openDatabase: Migrating database from version 1"; - execSQL(m_db, "ALTER TABLE flights ADD COLUMN aliases TEXT DEFAULT ''"); - } - // v2 -> v3: the track belongs to the flight rather than the airframe. The old - // rows are keyed by aircraft and cannot be divided between that aircraft's - // flights after the fact, so they are discarded - tracks re-accumulate from the - // next report, and they were only ever kept for m_retentionDays anyway - qDebug() << "AircraftTracker::openDatabase: Migrating database from version" << version - << "- stored tracks are discarded"; - // v2 -> v3 also gives the flight its own message count. The Past Flights table - // showed the document count under a "Msgs" heading, which reads as zero for any - // flight heard only on ADS-B - execSQL(m_db, "ALTER TABLE flights ADD COLUMN messages INTEGER DEFAULT 0"); - execSQL(m_db, - "DROP TABLE IF EXISTS track;" - "CREATE TABLE track (" - "flight_id INTEGER, seq INTEGER, latitude REAL, longitude REAL, altitude REAL, time INTEGER);"); - execSQL(m_db, "UPDATE meta SET version = " QT_STRINGIFY(AIRCRAFT_DB_VERSION)); - } else if (version != AIRCRAFT_DB_VERSION) { - qDebug() << "AircraftTracker::openDatabase: Database version" << version << "- starting afresh"; - execSQL(m_db, - "DELETE FROM aircraft; DELETE FROM sources; DELETE FROM track;" - "DELETE FROM flight_sources;" - "DELETE FROM flights; DELETE FROM documents; DELETE FROM profile;" - "DELETE FROM atc; DELETE FROM meta;"); - execSQL(m_db, "INSERT INTO meta (version) VALUES (" QT_STRINGIFY(AIRCRAFT_DB_VERSION) ")"); - } - - return true; -} - -// The user has chosen a different file for the session. If nothing is there yet the -// current session moves with them, so the aircraft, flights and messages they have -// collected are not left behind; if a database is already there it is theirs and is -// opened as it stands, replacing what is in memory. -// Put the setting back to the file actually in use, and tell the GUI - it owns the -// settings that are serialised, so leaving it holding the path that failed would save a -// pointer to a database nothing is writing to. -void AircraftTracker::revertDatabaseFilename(const QString& path) -{ - m_settings.m_databaseFilename = - (path == AircraftSettings::defaultDatabaseFilename()) ? QString() : path; - emit databaseFilenameReverted(m_settings.m_databaseFilename); -} - -void AircraftTracker::changeDatabase(const QString& oldPath) -{ - const QString newPath = databasePath(m_settings); - - if (newPath == oldPath) { - return; - } - - // Make sure everything collected so far is on disk before the file moves. If it - // could not be, the switch does not happen: adopting an existing database calls - // deleteAll() below, which would throw away the very session that failed to save. - // The setting goes back to the file actually in use, so the two do not disagree. - if (m_db && !m_loadingDatabase && !saveDatabase()) - { - qWarning() << "AircraftTracker::changeDatabase: could not save the session to" - << oldPath << "- keeping it rather than switching to" << newPath; - revertDatabaseFilename(oldPath); - return; - } - closeDatabase(); - - const bool haveExisting = QFileInfo::exists(newPath) && (QFileInfo(newPath).size() > 0); - - bool moved = false; - if (!haveExisting && QFileInfo::exists(oldPath)) - { - // QFile::rename copies and removes when the paths are on different volumes - moved = QFile::rename(oldPath, newPath); - if (moved) { - qDebug() << "AircraftTracker::changeDatabase: moved the session from" << oldPath << "to" << newPath; - } else { - qWarning() << "AircraftTracker::changeDatabase: could not move" << oldPath << "to" << newPath - << "- the session stays in memory and will be written to the new file"; - } - } - - if (!openDatabase()) - { - // Without this there is no database at all: the old one is closed and the new one - // would not open, so everything from here on would be kept in memory and lost on - // exit, silently. Go back to the file that was working. - qWarning() << "AircraftTracker::changeDatabase: could not open" << newPath - << "- going back to" << oldPath; - // The file has to go back before it can be reopened. Reverting the setting alone - // would point at a path the history is no longer at, and opening it would create - // an empty database there - leaving every restored aircraft to be written out - // again over nothing, with the real history stranded under the new name. - if (moved && !QFile::rename(newPath, oldPath)) - { - qWarning() << "AircraftTracker::changeDatabase: could not move" << newPath - << "back to" << oldPath << "- staying with it rather than opening" - << "an empty database over the session"; - if (!openDatabase()) { - qWarning() << "AircraftTracker::changeDatabase: and could not reopen it" - << "- the session is now in memory only"; - } - return; - } - revertDatabaseFilename(oldPath); - if (!openDatabase()) { - qWarning() << "AircraftTracker::changeDatabase: could not reopen" << oldPath - << "either - the session is now in memory only"; - } - return; - } - - if (haveExisting) - { - // Their database, their contents: start again from what it holds - deleteAll(); - loadDatabase(); - } - else - { - // Everything is still in memory; write it where it now belongs. The file may or - // may not have been moved successfully, so do not assume the points came with it - forgetSavedTracks(); - m_dbDirty = true; - saveDatabase(); - } -} - -void AircraftTracker::closeDatabase() -{ - if (m_db) - { - sqlite3_close(m_db); - m_db = nullptr; - } -} - -// Write the whole session state in one transaction, replacing the previous save -// The small tables are still rewritten whole - all of them together came to about -// 21000 rows against 1.06 MILLION in track and profile, and rewriting those two every -// minute was blocking the tracker thread for the best part of a second. Measured on a -// real 72 MB session database: 870506 track and 194527 profile rows, 0.93 s to delete -// and re-insert, once a minute and growing for as long as the session ran. That stall -// was visible as a sawtooth on the message rate chart, because reports queued behind it -// and were then all counted into whichever sample followed. -// -// Track and profile only ever grow, so they are written incrementally: each flight -// remembers how many of its points are already stored and the save appends the rest. -// The three ways that can stop being true are all accounted for - a flight merged into -// another has its arrays rebuilt (m_flightsToRewrite), a flight discarded by the -// retention period has to take its rows with it (m_flightsToDelete), and clearing -// everything invalidates the lot (m_dbTrackWipe). -bool AircraftTracker::saveDatabase() -{ - // Nothing to do if nothing changed since the last save - which counts as saved. - // No database at all does not: nothing has been written and nothing will be. - if (!m_db) { - return false; - } - if (!m_dbDirty) { - return true; - } - - // The save replaces the whole database, so a DELETE that fails after a BEGIN that - // succeeded would leave the old rows in place and the new ones appended to them - if (!execSQL(m_db, "BEGIN")) - { - qWarning() << "AircraftTracker::saveDatabase: could not start a transaction"; - return false; // m_dbDirty stays set, so the next tick tries again - } - if (!execSQL(m_db, - "DELETE FROM aircraft; DELETE FROM sources; DELETE FROM flight_sources;" - "DELETE FROM flights; DELETE FROM documents;" - "DELETE FROM atc;")) - { - execSQL(m_db, "ROLLBACK"); - return false; - } - - // What is stored for these flights is stale, so it goes before anything is written - if (m_dbTrackWipe) - { - if (!execSQL(m_db, "DELETE FROM track; DELETE FROM profile;")) - { - execSQL(m_db, "ROLLBACK"); - return false; - } - // The flag is cleared after the COMMIT, not here. forgetSavedTracks() has already - // set every flight's saved count to zero, so a save that rolls back after this - // point leaves the old rows in the database and the wipe forgotten - and the next - // save appends the whole of every track on top of them. - } - else if (!m_flightsToDelete.isEmpty() || !m_flightsToRewrite.isEmpty()) - { - sqlite3_stmt *dropStmt = nullptr; - if (sqlite3_prepare_v2(m_db, - "DELETE FROM track WHERE flight_id = ?", -1, &dropStmt, nullptr) == SQLITE_OK) - { - for (quint64 id : m_flightsToDelete + m_flightsToRewrite) - { - sqlite3_reset(dropStmt); - sqlite3_bind_int64(dropStmt, 1, (qint64) id); - sqlite3_step(dropStmt); - } - } - sqlite3_finalize(dropStmt); - - dropStmt = nullptr; - if (sqlite3_prepare_v2(m_db, - "DELETE FROM profile WHERE flight_id = ?", -1, &dropStmt, nullptr) == SQLITE_OK) - { - for (quint64 id : m_flightsToDelete + m_flightsToRewrite) - { - sqlite3_reset(dropStmt); - sqlite3_bind_int64(dropStmt, 1, (qint64) id); - sqlite3_step(dropStmt); - } - } - sqlite3_finalize(dropStmt); - } - - bool failed = false; - - sqlite3_stmt *aircraftStmt = nullptr; - sqlite3_stmt *sourceStmt = nullptr; - sqlite3_stmt *trackStmt = nullptr; - sqlite3_stmt *flightStmt = nullptr; - sqlite3_stmt *flightSourceStmt = nullptr; - sqlite3_stmt *documentStmt = nullptr; - sqlite3_stmt *profileStmt = nullptr; - sqlite3_stmt *atcStmt = nullptr; - sqlite3_prepare_v2(m_db, - "INSERT INTO aircraft VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", -1, &aircraftStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO sources VALUES (?,?,?,?)", -1, &sourceStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO flight_sources VALUES (?,?,?,?)", -1, &flightSourceStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO track VALUES (?,?,?,?,?,?)", -1, &trackStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO flights VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", -1, &flightStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO documents VALUES (?,?,?,?,?)", -1, &documentStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO profile VALUES (?,?,?,?)", -1, &profileStmt, nullptr); - sqlite3_prepare_v2(m_db, "INSERT INTO atc VALUES (?,?,?,?,?,?,?,?,?,?)", -1, &atcStmt, nullptr); - if (!aircraftStmt || !sourceStmt || !trackStmt || !flightStmt || !documentStmt - || !profileStmt || !atcStmt || !flightSourceStmt) - { - // Name the one that failed. sqlite3_errmsg reports the LAST call, which is a - // successful prepare when an earlier one failed, and so said "not an error" - const char *which = !aircraftStmt ? "aircraft" : !sourceStmt ? "sources" - : !trackStmt ? "track" : !flightStmt ? "flights" - : !documentStmt ? "documents" : !profileStmt ? "profile" - : !atcStmt ? "atc" : "flight_sources"; - qWarning() << "AircraftTracker::saveDatabase: could not prepare the" << which << "insert"; - qWarning() << "AircraftTracker::saveDatabase: Failed to prepare statements:" << sqlite3_errmsg(m_db); - execSQL(m_db, "ROLLBACK"); - sqlite3_finalize(aircraftStmt); - sqlite3_finalize(sourceStmt); - sqlite3_finalize(trackStmt); - sqlite3_finalize(flightStmt); - sqlite3_finalize(documentStmt); - sqlite3_finalize(profileStmt); - sqlite3_finalize(atcStmt); - sqlite3_finalize(flightSourceStmt); - return false; - } - - for (const TrackedAircraft *item : m_aircraft) - { - sqlite3_reset(aircraftStmt); - sqlite3_bind_int64(aircraftStmt, 1, (qint64) item->m_id); - sqlite3_bind_int64(aircraftStmt, 2, item->m_icao); - bindText(aircraftStmt, 3, item->m_registration); - bindText(aircraftStmt, 4, item->m_flight); - sqlite3_bind_int(aircraftStmt, 5, item->m_positionValid ? 1 : 0); - sqlite3_bind_double(aircraftStmt, 6, item->m_latitude); - sqlite3_bind_double(aircraftStmt, 7, item->m_longitude); - sqlite3_bind_int(aircraftStmt, 8, item->m_altitudeValid ? 1 : 0); - sqlite3_bind_double(aircraftStmt, 9, item->m_altitudeFt); - sqlite3_bind_int(aircraftStmt, 10, item->m_headingValid ? 1 : 0); - sqlite3_bind_double(aircraftStmt, 11, item->m_heading); - sqlite3_bind_int(aircraftStmt, 12, item->m_speedValid ? 1 : 0); - sqlite3_bind_double(aircraftStmt, 13, item->m_speedKts); - sqlite3_bind_int64(aircraftStmt, 14, dateTimeValue(item->m_positionDateTime)); - sqlite3_bind_int64(aircraftStmt, 15, dateTimeValue(item->m_lastSeen)); - bindText(aircraftStmt, 16, item->m_departure); - bindText(aircraftStmt, 17, item->m_arrival); - bindText(aircraftStmt, 18, item->m_route); - bindText(aircraftStmt, 19, item->m_lastDocumentText); - sqlite3_bind_int(aircraftStmt, 20, item->m_messages); - bindText(aircraftStmt, 21, item->m_model3D); - sqlite3_bind_double(aircraftStmt, 22, item->m_modelAltitudeOffset); - sqlite3_bind_double(aircraftStmt, 23, item->m_labelAltitudeOffset); - sqlite3_bind_int(aircraftStmt, 24, item->m_modelIsOurs ? 1 : 0); - stepInsert(m_db, aircraftStmt, "aircraft", failed); - - QHashIterator, int> sourceIt(item->m_sources); - while (sourceIt.hasNext()) - { - sourceIt.next(); - sqlite3_reset(sourceStmt); - sqlite3_bind_int64(sourceStmt, 1, (qint64) item->m_id); - sqlite3_bind_int(sourceStmt, 2, sourceIt.key().first); - sqlite3_bind_int64(sourceStmt, 3, sourceIt.key().second); - sqlite3_bind_int(sourceStmt, 4, sourceIt.value()); - stepInsert(m_db, sourceStmt, "sources", failed); - } - - for (TrackedFlight *flight : item->m_flights) - { - // Only what is not stored yet. m_trackSaved is advanced after the commit, - // so a rolled back transaction leaves it describing what is really there. - for (int p = flight->m_trackSaved; p < flight->m_track.size(); p++) - { - sqlite3_reset(trackStmt); - sqlite3_bind_int64(trackStmt, 1, (qint64) flight->m_id); - sqlite3_bind_int(trackStmt, 2, p); - sqlite3_bind_double(trackStmt, 3, flight->m_track[p].latitude()); - sqlite3_bind_double(trackStmt, 4, flight->m_track[p].longitude()); - sqlite3_bind_double(trackStmt, 5, flight->m_track[p].altitude()); - sqlite3_bind_int64(trackStmt, 6, dateTimeValue(flight->m_trackTimes[p])); - stepInsert(m_db, trackStmt, "track", failed); - } - - sqlite3_reset(flightStmt); - sqlite3_bind_int64(flightStmt, 1, (qint64) flight->m_id); - sqlite3_bind_int64(flightStmt, 2, (qint64) item->m_id); - bindText(flightStmt, 3, flight->m_flight); - sqlite3_bind_int64(flightStmt, 4, dateTimeValue(flight->m_firstSeen)); - sqlite3_bind_int64(flightStmt, 5, dateTimeValue(flight->m_lastSeen)); - bindText(flightStmt, 6, flight->m_departure); - bindText(flightStmt, 7, flight->m_arrival); - bindText(flightStmt, 8, flight->m_route); - sqlite3_bind_int(flightStmt, 9, flight == item->m_currentFlight ? 1 : 0); - bindText(flightStmt, 10, flight->m_aliases.join(",")); - sqlite3_bind_int(flightStmt, 11, flight->m_messages); - sqlite3_bind_int64(flightStmt, 12, dateTimeValue(flight->m_out)); - sqlite3_bind_int64(flightStmt, 13, dateTimeValue(flight->m_off)); - sqlite3_bind_int64(flightStmt, 14, dateTimeValue(flight->m_on)); - sqlite3_bind_int64(flightStmt, 15, dateTimeValue(flight->m_in)); - sqlite3_bind_int64(flightStmt, 16, dateTimeValue(flight->m_routeFiled)); - stepInsert(m_db, flightStmt, "flights", failed); - - QHashIterator, int> flightSourceIt(flight->m_sources); - while (flightSourceIt.hasNext()) - { - flightSourceIt.next(); - sqlite3_reset(flightSourceStmt); - sqlite3_bind_int64(flightSourceStmt, 1, (qint64) flight->m_id); - sqlite3_bind_int(flightSourceStmt, 2, flightSourceIt.key().first); - sqlite3_bind_int64(flightSourceStmt, 3, flightSourceIt.key().second); - sqlite3_bind_int(flightSourceStmt, 4, flightSourceIt.value()); - stepInsert(m_db, flightSourceStmt, "flight_sources", failed); - } - - for (const TrackedDocument *doc : flight->m_documents) - { - sqlite3_reset(documentStmt); - sqlite3_bind_int64(documentStmt, 1, (qint64) flight->m_id); - sqlite3_bind_int(documentStmt, 2, doc->m_kind); - bindText(documentStmt, 3, doc->m_title); - bindText(documentStmt, 4, doc->m_text); - sqlite3_bind_int64(documentStmt, 5, dateTimeValue(doc->m_received)); - stepInsert(m_db, documentStmt, "documents", failed); - } - - for (int p = flight->m_profileSaved; p < flight->m_profileTimes.size(); p++) - { - sqlite3_reset(profileStmt); - sqlite3_bind_int64(profileStmt, 1, (qint64) flight->m_id); - sqlite3_bind_int64(profileStmt, 2, flight->m_profileTimes[p]); - if (std::isnan(flight->m_profileAltFt[p])) { - sqlite3_bind_null(profileStmt, 3); - } else { - sqlite3_bind_double(profileStmt, 3, flight->m_profileAltFt[p]); - } - if (std::isnan(flight->m_profileSpeedKts[p])) { - sqlite3_bind_null(profileStmt, 4); - } else { - sqlite3_bind_double(profileStmt, 4, flight->m_profileSpeedKts[p]); - } - stepInsert(m_db, profileStmt, "profile", failed); - } - } - } - - for (const AtcEvent& e : m_atcLog) - { - sqlite3_reset(atcStmt); - sqlite3_bind_int64(atcStmt, 1, dateTimeValue(e.m_received)); - bindText(atcStmt, 2, e.m_protocol); - sqlite3_bind_int(atcStmt, 3, e.m_uplink ? 1 : 0); - bindText(atcStmt, 4, e.m_from); - bindText(atcStmt, 5, e.m_to); - bindText(atcStmt, 6, e.m_message); - bindText(atcStmt, 7, e.m_tooltip); - sqlite3_bind_int64(atcStmt, 8, (qint64) e.m_aircraftId); - sqlite3_bind_int64(atcStmt, 9, (qint64) e.m_flightId); - bindText(atcStmt, 10, e.m_mapName); - stepInsert(m_db, atcStmt, "atc", failed); - } - - sqlite3_finalize(aircraftStmt); - sqlite3_finalize(sourceStmt); - sqlite3_finalize(trackStmt); - sqlite3_finalize(flightStmt); - sqlite3_finalize(documentStmt); - sqlite3_finalize(profileStmt); - sqlite3_finalize(atcStmt); - sqlite3_finalize(flightSourceStmt); - if (failed) - { - // Leave the previous contents alone and keep the dirty flag, so the next save - // tries the whole thing again rather than leaving a half written database behind - qWarning() << "AircraftTracker::saveDatabase: rolling back, session not saved"; - execSQL(m_db, "ROLLBACK"); - return false; - } - if (!execSQL(m_db, "COMMIT")) - { - qWarning() << "AircraftTracker::saveDatabase: commit failed, session not saved"; - execSQL(m_db, "ROLLBACK"); - return false; - } - - // Only now that the rows are really there. Doing this as they were written would - // have a rolled back save leave every flight claiming points the database does not - // hold, and the next save would append after them - a permanent hole in the track. - for (TrackedAircraft *item : m_aircraft) - { - for (TrackedFlight *flight : item->m_flights) - { - flight->m_trackSaved = flight->m_track.size(); - flight->m_profileSaved = flight->m_profileTimes.size(); - } - } - m_flightsToDelete.clear(); - m_flightsToRewrite.clear(); - m_dbTrackWipe = false; - - m_dbDirty = false; - return true; -} - -// Nothing stored relates to what is in memory any more, so the next save empties both -// tables and writes every point again -void AircraftTracker::forgetSavedTracks() -{ - m_dbTrackWipe = true; - m_flightsToDelete.clear(); - m_flightsToRewrite.clear(); - for (TrackedAircraft *item : m_aircraft) - { - for (TrackedFlight *flight : item->m_flights) - { - flight->m_trackSaved = 0; - flight->m_profileSaved = 0; - } - } -} - -// Restore the previous session. Aircraft older than the removal timeout are -// pruned afterwards; the ATC log is restored in full. The GUI, if any, gets the -// restored state when it connects and requests a resync. -void AircraftTracker::loadDatabase() -{ - if (!m_db) { - return; - } - - m_loadingDatabase = true; - QHash aircraftById; - QHash flightsById; - sqlite3_stmt *stmt = nullptr; - - // Aircraft - if (sqlite3_prepare_v2(m_db, "SELECT * FROM aircraft", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedAircraft *item = new TrackedAircraft(); - qint64 id = sqlite3_column_int64(stmt, 0); - item->m_id = (quint64) id; - m_nextId = std::max(m_nextId, item->m_id + 1); - item->m_icao = (quint32) sqlite3_column_int64(stmt, 1); - item->m_registration = columnText(stmt, 2); - item->m_flight = columnText(stmt, 3); - item->m_positionValid = sqlite3_column_int(stmt, 4) != 0; - item->m_latitude = (float) sqlite3_column_double(stmt, 5); - item->m_longitude = (float) sqlite3_column_double(stmt, 6); - item->m_altitudeValid = sqlite3_column_int(stmt, 7) != 0; - item->m_altitudeFt = (float) sqlite3_column_double(stmt, 8); - item->m_headingValid = sqlite3_column_int(stmt, 9) != 0; - item->m_heading = (float) sqlite3_column_double(stmt, 10); - item->m_speedValid = sqlite3_column_int(stmt, 11) != 0; - item->m_speedKts = (float) sqlite3_column_double(stmt, 12); - item->m_positionDateTime = columnDateTime(stmt, 13); - item->m_lastSeen = columnDateTime(stmt, 14); - item->m_departure = columnText(stmt, 15); - item->m_arrival = columnText(stmt, 16); - item->m_route = columnText(stmt, 17); - item->m_lastDocumentText = columnText(stmt, 18); - item->m_messages = sqlite3_column_int(stmt, 19); - item->m_model3D = columnText(stmt, 20); - // Added by ensureColumn(), so a database written before they existed reads - // them as the defaults - which is the same as never having had a model - item->m_modelAltitudeOffset = (float) sqlite3_column_double(stmt, 21); - item->m_labelAltitudeOffset = (float) sqlite3_column_double(stmt, 22); - const int modelIsOurs = sqlite3_column_int(stmt, 23); - item->m_modelIsOurs = modelIsOurs > 0; - // A row written before these columns existed has the model but nothing that - // goes with it, so the model is dropped and chosen again on the next report - // rather than drawn at the wrong height and never replaced - if (modelIsOurs < 0) { - item->m_model3D.clear(); - } - - m_aircraft.append(item); - aircraftById.insert(id, item); - if (item->m_icao) { - m_byKey.insert(QString("I%1").arg(item->m_icao, 6, 16, QChar('0')), item); - } - if (!item->m_registration.isEmpty()) { - m_byKey.insert("R" + item->m_registration, item); - } - if (!item->m_flight.isEmpty()) { - m_byKey.insert("F" + item->m_flight, item); - } - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // Protocols/frequencies heard on - if (sqlite3_prepare_v2(m_db, "SELECT * FROM sources", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedAircraft *item = aircraftById.value(sqlite3_column_int64(stmt, 0)); - if (item) { - item->m_sources.insert( - qMakePair(sqlite3_column_int(stmt, 1), (qint64) sqlite3_column_int64(stmt, 2)), - sqlite3_column_int(stmt, 3)); - } - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // Flights - if (sqlite3_prepare_v2(m_db, "SELECT * FROM flights ORDER BY id", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedAircraft *item = aircraftById.value(sqlite3_column_int64(stmt, 1)); - if (!item) { - continue; - } - TrackedFlight *flight = new TrackedFlight(); - flight->m_id = (quint64) sqlite3_column_int64(stmt, 0); - m_nextId = std::max(m_nextId, flight->m_id + 1); - flight->m_aircraft = item; - flight->m_flight = columnText(stmt, 2); - flight->m_firstSeen = columnDateTime(stmt, 3); - flight->m_lastSeen = columnDateTime(stmt, 4); - flight->m_departure = columnText(stmt, 5); - flight->m_arrival = columnText(stmt, 6); - flight->m_route = columnText(stmt, 7); - flight->m_messages = sqlite3_column_int(stmt, 10); - flight->m_out = columnDateTime(stmt, 11); - flight->m_off = columnDateTime(stmt, 12); - flight->m_on = columnDateTime(stmt, 13); - flight->m_in = columnDateTime(stmt, 14); - flight->m_routeFiled = columnDateTime(stmt, 15); - QString aliases = columnText(stmt, 9); - if (!aliases.isEmpty()) { - flight->m_aliases = aliases.split(','); - } - item->m_flights.append(flight); - if (sqlite3_column_int(stmt, 8)) { - item->m_currentFlight = flight; - } - flightsById.insert(sqlite3_column_int64(stmt, 0), flight); - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // Protocols/frequencies each flight was heard on. After the flights, because it is - // keyed on their ids. - if (sqlite3_prepare_v2(m_db, "SELECT * FROM flight_sources", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); - if (flight) { - flight->m_sources.insert( - qMakePair(sqlite3_column_int(stmt, 1), (qint64) sqlite3_column_int64(stmt, 2)), - sqlite3_column_int(stmt, 3)); - } - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // Tracks. Keyed by flight, so this has to come after the flights are loaded. - // Exactly 0N 0E is a zeroed-out field saved before the filter for them existed, - // not a position. - if (sqlite3_prepare_v2(m_db, "SELECT * FROM track ORDER BY flight_id, seq", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); - double latitude = sqlite3_column_double(stmt, 2); - double longitude = sqlite3_column_double(stmt, 3); - if (flight && ((latitude != 0.0) || (longitude != 0.0))) - { - flight->m_track.append(QGeoCoordinate(latitude, longitude, sqlite3_column_double(stmt, 4))); - flight->m_trackTimes.append(columnDateTime(stmt, 5)); - } - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // Documents - if (sqlite3_prepare_v2(m_db, "SELECT * FROM documents ORDER BY received", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); - if (!flight) { - continue; - } - TrackedDocument *doc = new TrackedDocument(); - doc->m_kind = sqlite3_column_int(stmt, 1); - doc->m_title = columnText(stmt, 2); - doc->m_text = columnText(stmt, 3); - doc->m_received = columnDateTime(stmt, 4); - flight->m_documents.append(doc); - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // Flight profiles - if (sqlite3_prepare_v2(m_db, "SELECT * FROM profile ORDER BY flight_id, time", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); - if (flight) - { - flight->m_profileTimes.append(sqlite3_column_int64(stmt, 1)); - flight->m_profileAltFt.append(sqlite3_column_type(stmt, 2) == SQLITE_NULL - ? std::numeric_limits::quiet_NaN() : (float) sqlite3_column_double(stmt, 2)); - flight->m_profileSpeedKts.append(sqlite3_column_type(stmt, 3) == SQLITE_NULL - ? std::numeric_limits::quiet_NaN() : (float) sqlite3_column_double(stmt, 3)); - } - } - } - sqlite3_finalize(stmt); - stmt = nullptr; - - // ATC log - if (sqlite3_prepare_v2(m_db, "SELECT * FROM atc ORDER BY time", -1, &stmt, nullptr) == SQLITE_OK) - { - while (sqlite3_step(stmt) == SQLITE_ROW) - { - AtcEvent e; - e.m_received = columnDateTime(stmt, 0); - e.m_protocol = columnText(stmt, 1); - e.m_uplink = sqlite3_column_int(stmt, 2) != 0; - e.m_from = columnText(stmt, 3); - e.m_to = columnText(stmt, 4); - e.m_message = columnText(stmt, 5); - e.m_tooltip = columnText(stmt, 6); - e.m_aircraftId = (quint64) sqlite3_column_int64(stmt, 7); - e.m_flightId = (quint64) sqlite3_column_int64(stmt, 8); - e.m_mapName = columnText(stmt, 9); - m_atcLog.append(e); - } - } - sqlite3_finalize(stmt); - - // Everything just read is, by definition, already in the database - without this the - // first save would write the whole restored history out again. - // - // Before EVERY merge below, not after: absorbAircraft() runs one of its own - // through mergeLoadedFlights(), so putting this between the two loops still - // erased what the first had recorded. merging two restored flights deletes one and - // rewrites the other, and says so through m_flightsToDelete, m_flightsToRewrite and a - // zeroed m_trackSaved. Doing this afterwards overwrote all three, so the next save - // left the merged-away flight's rows orphaned in the database and never wrote the - // combined track - and the merged history was gone by the restart after that. - for (TrackedAircraft *item : m_aircraft) - { - for (TrackedFlight *flight : item->m_flights) - { - flight->m_trackSaved = flight->m_track.size(); - flight->m_profileSaved = flight->m_profileTimes.size(); - } - } - m_flightsToDelete.clear(); - m_flightsToRewrite.clear(); - m_dbTrackWipe = false; - - // Fold weak flight-only aircraft into the identified airframe flying the - // same flight, and merge flights that are the same flight under its ACARS - // and ADS-B names (sessions saved before these existed live) - QList weakItems; - for (TrackedAircraft *a : m_aircraft) - { - if ((a->m_icao == 0) && a->m_registration.isEmpty()) { - weakItems.append(a); - } - } - for (TrackedAircraft *weak : weakItems) - { - TrackedAircraft *strong = nullptr; - for (TrackedAircraft *cand : m_aircraft) - { - if ((cand == weak) || ((cand->m_icao == 0) && cand->m_registration.isEmpty())) { - continue; - } - for (TrackedFlight *weakFlight : weak->m_flights) - { - if (weakFlight->m_flight.isEmpty()) { - continue; - } - for (TrackedFlight *candFlight : cand->m_flights) - { - // Exact name only: number-based matching is only safe - // within a single airframe - if ((candFlight->m_flight != weakFlight->m_flight) - && !candFlight->m_aliases.contains(weakFlight->m_flight)) { - continue; - } - // ... and only when the two were flying it at the same time. A - // callsign is flown again day after day, by a different airframe as - // often as by the same one, so a flight-only record from last week - // must not be folded into whichever aircraft flew that number most - // recently - which is what an unbounded name match did. - if (!weakFlight->m_lastSeen.isValid() || !candFlight->m_lastSeen.isValid() - || (std::abs(weakFlight->m_lastSeen.secsTo(candFlight->m_lastSeen)) - >= m_flightKeyValidSecs)) { - continue; - } - strong = cand; - break; - } - if (strong) { - break; - } - } - if (strong) { - break; - } - } - if (strong) { - absorbAircraft(strong, weak); - } - } - for (TrackedAircraft *item : m_aircraft) { - mergeLoadedFlights(item); - } - - // Prune aircraft not heard from within the removal timeout, then send the - // survivors to the Map and register their current flight names - removeOldAircraft(); - - m_loadingDatabase = false; - for (TrackedAircraft *item : m_aircraft) - { - if (item->m_currentFlight) - { - if (!item->m_currentFlight->m_flight.isEmpty()) - { - item->m_flight = item->m_currentFlight->m_flight; - m_byKey.insert("F" + item->m_flight, item); - } - for (const QString& alias : item->m_currentFlight->m_aliases) { - m_byKey.insert("F" + alias, item); - } - } - // Restored aircraft start inactive: they appear in the archive tables and are - // not drawn until data arrives for them again - item->m_active = false; - m_dirtyAircraft.insert(item); - for (TrackedFlight *flight : item->m_flights) { - m_dirtyFlights.insert(flight); - } - } - - // Anything restored that is already past its retention goes now - discardOldAircraft(); -} - - -// The key an airframe is counted under for all time. The ICAO address where there is -// one, because it is the only identifier that is genuinely the airframe; otherwise the -// registration, which is nearly as good, prefixed to keep the two namespaces apart. -// -// A flight number is deliberately NOT accepted. It identifies a service rather than an -// airframe, so counting one would both inflate the total and count the same aircraft -// again the day it is heard with an address - and an aircraft with neither an address -// nor a registration is rare, since ADS-B always carries the first and an ACARS block -// almost always carries the second. -static QString seenKey(quint32 icao, const QString& registration) -{ - if (icao) { - return QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); - } - if (!registration.isEmpty()) { - return "R:" + registration; - } - return QString(); -} - -int AircraftTracker::recordSeen(TrackedAircraft *item, int& countDelta) -{ - countDelta = 0; - const QString key = seenKey(item->m_icao, item->m_registration); - if (key.isEmpty()) { - return -1; // Nothing to recognise it by yet: ask again next report - } - if (!m_db) { - return -1; // Not written: ask again rather than counting it as done - } - - // A registration-only airframe is recorded under its registration and moves to its - // ICAO address the day one arrives. The old row has to move with it: left behind, a - // later session hears the same aircraft, inserts the address as a key it has never - // seen, and counts one airframe as two for ever. - // - // Written as "is there a stale registration row" rather than "did the key just - // change", because the change may have happened in an earlier session - the aircraft - // is restored already holding both identities, with nothing to say which of them it - // was last recorded under. - // - // The two rows are folded into one that spans both: the earlier first_seen and the - // later last_seen. That has to be done explicitly - an UPDATE that simply rekeys the - // row cannot merge, and one that rekeys onto an address that already has a row - // cannot even run. - if (item->m_icao && !item->m_registration.isEmpty()) - { - const QString stale = "R:" + item->m_registration; - qint64 staleFirst = 0; - qint64 staleLast = 0; - bool staleExists = false; - - sqlite3_stmt *moveStmt = nullptr; - if (sqlite3_prepare_v2(m_db, "SELECT first_seen, last_seen FROM seen WHERE key = ?", - -1, &moveStmt, nullptr) == SQLITE_OK) - { - bindText(moveStmt, 1, stale); - if (sqlite3_step(moveStmt) == SQLITE_ROW) - { - staleExists = true; - staleFirst = sqlite3_column_int64(moveStmt, 0); - staleLast = sqlite3_column_int64(moveStmt, 1); - } - } - sqlite3_finalize(moveStmt); - - if (staleExists) - { - // Whether the address already had a row of its own decides whether this is a - // rename or a merge - and a merge is one airframe fewer than the table held - bool addressExists = false; - moveStmt = nullptr; - if (sqlite3_prepare_v2(m_db, "SELECT 1 FROM seen WHERE key = ?", - -1, &moveStmt, nullptr) == SQLITE_OK) - { - bindText(moveStmt, 1, key); - addressExists = sqlite3_step(moveStmt) == SQLITE_ROW; - } - sqlite3_finalize(moveStmt); - - bool folded = false; - moveStmt = nullptr; - if (sqlite3_prepare_v2(m_db, "DELETE FROM seen WHERE key = ?", - -1, &moveStmt, nullptr) == SQLITE_OK) - { - bindText(moveStmt, 1, stale); - folded = sqlite3_step(moveStmt) == SQLITE_DONE; - } - sqlite3_finalize(moveStmt); - if (!folded) { - qWarning() << "AircraftTracker::recordSeen: could not fold" << stale - << "into" << key << ":" << sqlite3_errmsg(m_db); - } - - if (folded) - { - // Carry the span across. INSERT OR IGNORE below cannot widen a row it - // does not create, so where the address had one already this is the only - // thing that keeps the airframe's real first_seen. - moveStmt = nullptr; - if (sqlite3_prepare_v2(m_db, - "INSERT INTO seen (key, first_seen, last_seen) VALUES (?,?,?)" - " ON CONFLICT(key) DO UPDATE SET" - " first_seen = MIN(first_seen, excluded.first_seen)," - " last_seen = MAX(last_seen, excluded.last_seen)", - -1, &moveStmt, nullptr) == SQLITE_OK) - { - bindText(moveStmt, 1, key); - sqlite3_bind_int64(moveStmt, 2, staleFirst); - sqlite3_bind_int64(moveStmt, 3, staleLast); - if (sqlite3_step(moveStmt) != SQLITE_DONE) { - qWarning() << "AircraftTracker::recordSeen:" << sqlite3_errmsg(m_db); - } - } - sqlite3_finalize(moveStmt); - - // Two rows became one, so the all time count the caller holds is now one - // too high. It is only read from the table at startup, so without this it - // would stay wrong until the next run. - if (addressExists) { - countDelta--; - } - } - } - } - - const qint64 now = QDateTime::currentSecsSinceEpoch(); - sqlite3_stmt *stmt = nullptr; - - // INSERT OR IGNORE, then ask how many rows changed: exactly 1 when this airframe - // was new and 0 when it was already there, which is the answer the count needs. An - // upsert would report 1 either way, and last_insert_rowid cannot be used to tell - // them apart because the aircraft and flight inserts move it too - if (sqlite3_prepare_v2(m_db, - "INSERT OR IGNORE INTO seen (key, first_seen, last_seen) VALUES (?,?,?)", - -1, &stmt, nullptr) != SQLITE_OK) - { - qWarning() << "AircraftTracker::recordSeen:" << sqlite3_errmsg(m_db); - return -1; // A failure is not "already counted": try again - } - bindText(stmt, 1, key); - sqlite3_bind_int64(stmt, 2, now); - sqlite3_bind_int64(stmt, 3, now); - - bool inserted = false; - bool stepped = false; - if (sqlite3_step(stmt) == SQLITE_DONE) - { - stepped = true; - inserted = sqlite3_changes(m_db) > 0; - } - else - { - qWarning() << "AircraftTracker::recordSeen:" << sqlite3_errmsg(m_db); - } - sqlite3_finalize(stmt); - if (!stepped) { - return -1; // Nothing was written, so nothing has been counted - } - - if (!inserted) - { - // Heard before, so only the last seen time moves - stmt = nullptr; - if (sqlite3_prepare_v2(m_db, "UPDATE seen SET last_seen = ? WHERE key = ?", - -1, &stmt, nullptr) == SQLITE_OK) - { - sqlite3_bind_int64(stmt, 1, now); - bindText(stmt, 2, key); - sqlite3_step(stmt); - } - sqlite3_finalize(stmt); - } - if (inserted) { - countDelta++; - } - return 1; -} - -// How many different airframes have ever been heard -int AircraftTracker::seenCount() -{ - if (!m_db) { - return 0; - } - sqlite3_stmt *stmt = nullptr; - int count = 0; - if (sqlite3_prepare_v2(m_db, "SELECT COUNT(*) FROM seen", -1, &stmt, nullptr) == SQLITE_OK) - { - if (sqlite3_step(stmt) == SQLITE_ROW) { - count = sqlite3_column_int(stmt, 0); - } - } - sqlite3_finalize(stmt); - return count; -} - -// Only from an explicit "reset all time statistics", never from clearing the session -void AircraftTracker::resetSeen() -{ - if (m_db) { - execSQL(m_db, "DELETE FROM seen"); - } -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +// Session persistence for the Aircraft feature: the collated aircraft, flights, +// documents and ATC log are kept in a SQLite database (vendored amalgamation - +// public domain, no Qt SQL dependency), written every minute and on exit, and +// restored on startup. Runs on the tracker thread, so the GUI never blocks on a +// save. Aircraft older than the removal timeout are pruned on load; the +// self-contained ATC log is restored in full. + +#include +#include + +#include +#include +#include +#include +#include + +#include "sqlite/sqlite3.h" +#include "util/aircraft3dmodels.h" + +#include "aircrafttracker.h" + +// Current schema version. Only this version is read: an older database is started +// over and a newer one is left alone. +#define AIRCRAFT_DB_VERSION 5 + +// Where the session is kept. The setting wins; otherwise the default location, whose +// directory may not exist yet +QString AircraftTracker::databasePath(const AircraftSettings& settings) +{ + if (!settings.m_databaseFilename.isEmpty()) + { + QDir().mkpath(QFileInfo(settings.m_databaseFilename).absolutePath()); + return settings.m_databaseFilename; + } + + QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); + QDir().mkpath(locations[0]); + return locations[0] + "/aircraft.db"; +} + +// What the session database is costing on disk. SQLite is in WAL mode, so what has been +// written most recently is in the -wal file rather than in the database itself, and a +// figure that ignored it would sit still for a whole session and then jump on a checkpoint. +void AircraftTracker::updateDatabaseSize() +{ + const QString path = databasePath(m_settings); + qint64 bytes = 0; + + for (const QString& suffix : { QString(), QString("-wal"), QString("-shm") }) + { + const QFileInfo info(path + suffix); + if (info.exists()) { + bytes += info.size(); + } + } + if (bytes != m_statistics.m_databaseBytes) + { + m_statistics.m_databaseBytes = bytes; + m_statisticsDirty = true; + } +} + +static bool execSQL(sqlite3 *db, const char *sql) +{ + char *errMsg = nullptr; + if (sqlite3_exec(db, sql, nullptr, nullptr, &errMsg) != SQLITE_OK) + { + qWarning() << "AircraftTracker: SQL failed:" << sql << ":" << (errMsg ? errMsg : ""); + sqlite3_free(errMsg); + return false; + } + return true; +} + +// Run a DELETE taking one flight id for each of the given flights, saying whether all +// of them went through +static bool deleteByFlight(sqlite3 *db, const char *sql, const QSet& flightIds) +{ + if (flightIds.isEmpty()) { + return true; + } + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(db, sql, -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::saveDatabase: could not prepare" << sql << ":" << sqlite3_errmsg(db); + return false; + } + bool ok = true; + for (quint64 id : flightIds) + { + sqlite3_reset(stmt); + sqlite3_bind_int64(stmt, 1, (qint64) id); + if (sqlite3_step(stmt) != SQLITE_DONE) + { + qWarning() << "AircraftTracker::saveDatabase:" << sql << "failed:" << sqlite3_errmsg(db); + ok = false; + break; + } + } + sqlite3_finalize(stmt); + return ok; +} + +// Run a prepared INSERT and say whether the row went in. +// +// sqlite3_step returns SQLITE_DONE for a successful INSERT; anything else - a full disk, +// an I/O error, a constraint - means the row is not there. Ignoring it let a failed save +// look successful, and saveDatabase() then cleared the dirty flag, so nothing retried and +// the database silently stayed as it was. +static bool stepInsert(sqlite3 *db, sqlite3_stmt *stmt, const char *what, bool& failed) +{ + if (failed) { + return false; // Already given up on this transaction + } + if (sqlite3_step(stmt) != SQLITE_DONE) + { + qWarning() << "AircraftTracker::saveDatabase: writing" << what << "failed:" + << sqlite3_errmsg(db); + failed = true; + return false; + } + return true; +} + +static void bindText(sqlite3_stmt *stmt, int idx, const QString& text) +{ + QByteArray utf8 = text.toUtf8(); + sqlite3_bind_text(stmt, idx, utf8.constData(), utf8.size(), SQLITE_TRANSIENT); +} + +static QString columnText(sqlite3_stmt *stmt, int idx) +{ + const char *text = (const char *) sqlite3_column_text(stmt, idx); + return text ? QString::fromUtf8(text) : QString(); +} + +static QDateTime columnDateTime(sqlite3_stmt *stmt, int idx) +{ + qint64 ms = sqlite3_column_int64(stmt, idx); + return ms ? QDateTime::fromMSecsSinceEpoch(ms) : QDateTime(); +} + +static qint64 dateTimeValue(const QDateTime& dateTime) +{ + return dateTime.isValid() ? dateTime.toMSecsSinceEpoch() : 0; +} + +// Add a column if the table does not already have it. +// +// Migrating on the version number alone is not enough: a column added to CREATE TABLE +// and to the migration for the version BELOW the current one never reaches a database +// that is already at the current version, and the next INSERT then binds more values +// than the table has columns and fails to prepare - taking the whole save with it. +// Asking the table what it actually has is immune to that. +static bool tableExists(sqlite3 *db, const char *table) +{ + sqlite3_stmt *stmt = nullptr; + bool exists = false; + if (sqlite3_prepare_v2(db, "SELECT 1 FROM sqlite_master WHERE type='table' AND name=?", + -1, &stmt, nullptr) == SQLITE_OK) + { + sqlite3_bind_text(stmt, 1, table, -1, SQLITE_STATIC); + exists = (sqlite3_step(stmt) == SQLITE_ROW); + } + sqlite3_finalize(stmt); + return exists; +} + +// The waypoint positions a message carried, as one string: "NAME@lat,lon" per waypoint +// where it was placed, the bare name where it was not, separated by spaces. Waypoint +// names hold neither a space nor an @, so nothing has to be escaped. +// +// They are stored rather than re-resolved from the names, because an oceanic clearance +// names positions like 5730N020W that no database holds - the coordinates the message +// itself gave are the only way to place them, and dropping them would lose exactly the +// waypoints that make an oceanic route worth drawing. +static QString encodeRoutePoints(const QList& points) +{ + QStringList out; + for (const AircraftReport::RouteWaypoint& point : points) + { + if (point.m_positionValid) + { + // Six decimal places: enough for a tenth of a metre, where the default six + // SIGNIFICANT digits would round a three digit longitude to about 100 m + out.append(QString("%1@%2,%3").arg(point.m_name) + .arg(point.m_latitude, 0, 'f', 6).arg(point.m_longitude, 0, 'f', 6)); + } + else + { + out.append(point.m_name); + } + } + return out.join(" "); +} + +// Several short fields as one. The unit separator, which no ARINC field contains, and a +// fixed order - so a part added later appends rather than shifting the ones before it, +// and a database written before it simply has fewer. +static const QChar RoutePartSeparator(0x1f); + +static QString encodeRouteParts(const QStringList& parts) +{ + for (const QString& part : parts) + { + if (!part.isEmpty()) { + return parts.join(RoutePartSeparator); + } + } + return QString(); // Nothing filed, so nothing to store +} + +static void decodeRouteParts(const QString& text, const QList& into) +{ + if (text.isEmpty()) { + return; + } + const QStringList parts = text.split(RoutePartSeparator); + for (int i = 0; (i < parts.size()) && (i < into.size()); i++) { + *into[i] = parts[i]; + } +} + +// Recover a plan's parts from the message that filed it, for rows written before those +// parts were stored. +// +// The runway, SID, STAR, approach and alternate were only added to the flights table +// part way through a session, so every plan filed before that has its document text and +// its waypoints but none of the parts - the STAR is sitting in the message, in plain +// sight, and the route drawn for that flight cannot use it. The text is this +// application's own rendering of the plan, one "Label: value" a line, so reading the +// parts back out of it is reliable rather than a guess at someone else's format. +// +// Takes the parts in the same order decodeRouteParts() does, and only ever fills one +// that is empty - so a part an insert actually filed always wins over a parsed one, and +// running this twice does nothing the first run did not. Once the flight is saved again +// the parts are stored properly and this stops finding anything to do. +static void recoverRoutePartsFromText(const QString& text, const QList& into) +{ + if (text.isEmpty()) { + return; + } + + // An airport is rendered with its name after it - "SBGR (Sao Paulo/Guarulhos...)" - + // and sometimes with a runway stuck to it, as "ESSA(19L)". The code is the leading + // run of letters and digits either way. + auto airport = [](const QString& value) + { + int end = 0; + while ((end < value.size()) && value[end].isLetterOrNumber()) { + end++; + } + return value.left(end); + }; + + struct Field { + const char *m_label; + int m_index; + bool m_isAirport; + }; + static const Field fields[] { + { "Runway", 0, false }, + { "SID", 1, false }, + { "STAR", 2, false }, + { "Approach", 3, false }, + { "Alternate", 4, true }, + { "Departure", 5, true }, + { "Arrival", 6, true }, + }; + + const QStringList lines = text.split('\n'); + + for (const QString& line : lines) + { + const int colon = line.indexOf(':'); + + if (colon < 0) { + continue; + } + + const QString label = line.left(colon).trimmed(); + const QString value = line.mid(colon + 1).trimmed(); + + if (value.isEmpty()) { + continue; + } + + for (const Field& field : fields) + { + if ((label != QLatin1String(field.m_label)) || (field.m_index >= into.size())) { + continue; + } + // Only what is missing, so a filed part always wins over a parsed one + if (into[field.m_index]->isEmpty()) { + *into[field.m_index] = field.m_isAirport ? airport(value) : value; + } + break; + } + } +} + +static QList decodeRoutePoints(const QString& text) +{ + QList points; + + for (const QString& field : text.split(" ", Qt::SkipEmptyParts)) + { + AircraftReport::RouteWaypoint point; + const int at = field.indexOf('@'); + if (at < 0) + { + point.m_name = field; + } + else + { + point.m_name = field.left(at); + const QStringList coords = field.mid(at + 1).split(','); + if (coords.size() == 2) + { + bool latOk = false, lonOk = false; + const float latitude = coords[0].toFloat(&latOk); + const float longitude = coords[1].toFloat(&lonOk); + if (latOk && lonOk) + { + point.m_positionValid = true; + point.m_latitude = latitude; + point.m_longitude = longitude; + } + } + } + points.append(point); + } + return points; +} + +static void ensureColumn(sqlite3 *db, const char *table, const char *column, const char *decl) +{ + sqlite3_stmt *stmt = nullptr; + const QString query = QString("PRAGMA table_info(%1)").arg(table); + bool found = false; + if (sqlite3_prepare_v2(db, query.toUtf8().constData(), -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + const unsigned char *name = sqlite3_column_text(stmt, 1); + if (name && (qstrcmp((const char *) name, column) == 0)) + { + found = true; + break; + } + } + } + sqlite3_finalize(stmt); + if (!found) + { + qDebug() << "AircraftTracker::openDatabase: adding" << table << "." << column; + execSQL(db, QString("ALTER TABLE %1 ADD COLUMN %2 %3").arg(table).arg(column).arg(decl).toUtf8().constData()); + } +} + +// Whether a table has a column. Used to tell a database that merely SAYS it is the +// current version from one that actually has the current version's shape. +static bool columnExists(sqlite3 *db, const char *table, const char *column) +{ + sqlite3_stmt *stmt = nullptr; + bool found = false; + const QByteArray sql = QByteArray("PRAGMA table_info(") + table + ")"; + + if (sqlite3_prepare_v2(db, sql.constData(), -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + const unsigned char *name = sqlite3_column_text(stmt, 1); + if (name && (qstrcmp((const char *) name, column) == 0)) + { + found = true; + break; + } + } + } + sqlite3_finalize(stmt); + return found; +} + +bool AircraftTracker::openDatabase() +{ + QString path = databasePath(m_settings); + if (sqlite3_open(path.toUtf8().constData(), &m_db) != SQLITE_OK) + { + qWarning() << "AircraftTracker::openDatabase: Failed to open" << path << ":" << sqlite3_errmsg(m_db); + sqlite3_close(m_db); + m_db = nullptr; + return false; + } + + // Write-ahead logging is considerably faster for the periodic full rewrite + execSQL(m_db, "PRAGMA journal_mode=WAL"); + execSQL(m_db, "PRAGMA synchronous=NORMAL"); + + // Whether the all time table is about to be created, which says this database has + // never had one and so its existing aircraft have never been counted into it + const bool seenIsNew = !tableExists(m_db, "seen"); + + // A database written by an older version is DROPPED here, before the tables below + // are created, rather than merely emptied. + // + // Emptying is not enough, because a version change can move the schema and not only + // the data: CREATE TABLE IF NOT EXISTS leaves an existing table exactly as it was, so + // a table that has gained a column is still the old shape and DELETE does nothing + // about that. That is not hypothetical - when documents gained its raw and source + // columns the insert could no longer be prepared, so every save failed and rolled + // back, and the next start found an empty database. Silently, because a save that + // rolls back looks like a save that had nothing to do. + // + // seen is deliberately left alone: it is the all time airframe count, and it is meant + // to survive everything else being thrown away. + if (tableExists(m_db, "meta")) + { + int existing = 0; + sqlite3_stmt *versionStmt = nullptr; + if (sqlite3_prepare_v2(m_db, "SELECT version FROM meta", -1, &versionStmt, nullptr) == SQLITE_OK) + { + if (sqlite3_step(versionStmt) == SQLITE_ROW) { + existing = sqlite3_column_int(versionStmt, 0); + } + } + sqlite3_finalize(versionStmt); + + // What this build's inserts require, and therefore what makes a database the + // right SHAPE rather than merely the right version number. + // + // The version alone is not enough to trust. A database written by the code that + // emptied tables on a version change instead of recreating them ends up claiming + // the new version while still having the old columns - and then every save fails + // to prepare and rolls back, silently, for good. One did. Add a line here + // whenever a table gains a column, and such a database repairs itself on the next + // start rather than needing the version bumped to shift it. + const bool shapeIsCurrent = columnExists(m_db, "documents", "raw") + && columnExists(m_db, "documents", "source") + && tableExists(m_db, "acars_blocks"); + + // A newer build's database is left exactly as it is, rather than thrown away by + // a build that merely cannot read it + if (existing > AIRCRAFT_DB_VERSION) + { + qWarning() << "AircraftTracker::openDatabase:" << path << "is database version" << existing + << "- this build only reads version" << AIRCRAFT_DB_VERSION << "- not using it"; + sqlite3_close(m_db); + m_db = nullptr; + return false; + } + + // 0 is a database with no version row yet. Only this version is read - older + // ones were only ever development databases - so anything else is started over. + if (((existing != 0) && (existing != AIRCRAFT_DB_VERSION)) || !shapeIsCurrent) + { + qDebug() << "AircraftTracker::openDatabase: Database version" << existing + << (shapeIsCurrent ? "cannot be migrated" : "does not have this version's tables") + << "- recreating its tables"; + execSQL(m_db, + "DROP TABLE IF EXISTS aircraft; DROP TABLE IF EXISTS sources;" + "DROP TABLE IF EXISTS track; DROP TABLE IF EXISTS flight_sources;" + "DROP TABLE IF EXISTS stat_records; DROP TABLE IF EXISTS stat_counters;" + "DROP TABLE IF EXISTS flights; DROP TABLE IF EXISTS documents;" + "DROP TABLE IF EXISTS acars_blocks; DROP TABLE IF EXISTS profile;" + "DROP TABLE IF EXISTS atc; DROP TABLE IF EXISTS meta;"); + } + } + + bool ok = execSQL(m_db, + "CREATE TABLE IF NOT EXISTS meta (version INTEGER);" + "CREATE TABLE IF NOT EXISTS aircraft (" + "id INTEGER PRIMARY KEY, icao INTEGER, registration TEXT, flight TEXT," + "position_valid INTEGER, latitude REAL, longitude REAL," + "altitude_valid INTEGER, altitude REAL," + "heading_valid INTEGER, heading REAL," + "speed_valid INTEGER, speed REAL," + "position_time INTEGER, last_seen INTEGER," + "departure TEXT, arrival TEXT, route TEXT," + "last_document TEXT, messages INTEGER, model3d TEXT);" + "CREATE TABLE IF NOT EXISTS sources (" + "aircraft_id INTEGER, protocol INTEGER, frequency INTEGER, count INTEGER);" + // The same tally per flight rather than per airframe - what a given flight was + // heard on, which is what the Map shows. Added without a version bump because + // IF NOT EXISTS creates it on the next open of an older database, where bumping + // would send every existing database down the "starting afresh" branch and + // delete everything in it. + // The all time statistics. They used to live in the preset, on the grounds that + // they describe the receiving setup rather than the traffic - but the database is + // the per setup file, and keeping the records in one place and the airframe count + // that belongs with them ("seen", below) in another meant switching databases + // gave one database's count with another's records. Like "seen", these are never + // touched by clearing the aircraft or by the retention period: they outlive the + // traffic they were measured from. + // + // One row per record: kind 0 is maximum range, and then protocol says which; + // kind 1 is fastest and kind 2 highest, neither of which is per protocol. + "CREATE TABLE IF NOT EXISTS stat_records (" + "kind INTEGER, protocol INTEGER, value REAL, aircraft TEXT, recorded INTEGER," + "position_valid INTEGER, latitude REAL, longitude REAL," + "altitude_valid INTEGER, altitude_ft REAL, frequency INTEGER," + "PRIMARY KEY (kind, protocol));" + "CREATE TABLE IF NOT EXISTS stat_counters (name TEXT PRIMARY KEY, value INTEGER);" + "CREATE TABLE IF NOT EXISTS coverage (" + " protocol INTEGER, bin INTEGER, range REAL, latitude REAL, longitude REAL," + " PRIMARY KEY (protocol, bin));" + "CREATE TABLE IF NOT EXISTS flight_sources (" + "flight_id INTEGER, protocol INTEGER, frequency INTEGER, count INTEGER);" + "CREATE TABLE IF NOT EXISTS track (" + "flight_id INTEGER, seq INTEGER, latitude REAL, longitude REAL, altitude REAL, time INTEGER);" + "CREATE TABLE IF NOT EXISTS flights (" + "id INTEGER PRIMARY KEY, aircraft_id INTEGER, flight TEXT," + "first_seen INTEGER, last_seen INTEGER," + "departure TEXT, arrival TEXT, route TEXT, is_current INTEGER," + "aliases TEXT DEFAULT '', messages INTEGER DEFAULT 0," + "out_time INTEGER DEFAULT 0, off_time INTEGER DEFAULT 0," + "on_time INTEGER DEFAULT 0, in_time INTEGER DEFAULT 0);" + // text is what a document was LAST rendered as, and raw/source are what it was + // rendered from. A document our own parser produced is rendered again on load, so + // that a decoder fix reaches everything already stored rather than only what + // arrives after it; one that libacars or the ATN decoder produced has no raw and + // keeps its text, because neither of those is reachable from this feature. + "CREATE TABLE IF NOT EXISTS documents (" + "flight_id INTEGER, kind INTEGER, title TEXT, text TEXT, received INTEGER," + "raw BLOB, source TEXT);" + // Every ACARS block heard, exactly as it came off the air. Raw, and one row per + // BLOCK rather than per reassembled message, so that a later decoder can be run + // over the whole archive - see MainCore::MsgAcarsBlock. None of the metadata is + // in the block itself, so it is stored beside it. + "CREATE TABLE IF NOT EXISTS acars_blocks (" + "received INTEGER, frequency INTEGER, level REAL, protocol INTEGER, block BLOB);" + "CREATE TABLE IF NOT EXISTS profile (" + "flight_id INTEGER, time INTEGER, altitude REAL, speed REAL);" + "CREATE TABLE IF NOT EXISTS atc (" + "time INTEGER, protocol TEXT, uplink INTEGER," + "from_station TEXT, to_station TEXT, message TEXT, tooltip TEXT," + "aircraft_id INTEGER, flight_id INTEGER, map_name TEXT, link TEXT DEFAULT '');" + // Every airframe ever heard, for the all time aircraft count. One row each, no + // matter how often it comes back, which is the whole reason a count cannot do + // the job. Kept out of every DELETE below: this is the one table that has to + // outlive both the retention period and a schema reset, and losing it would + // silently reset a figure the user cannot recover. Added without a version bump + // because IF NOT EXISTS creates it on the next open of an older database - and + // bumping would send every existing v3 database down the "starting afresh" + // branch, which deletes everything + "CREATE TABLE IF NOT EXISTS seen (" + "key TEXT PRIMARY KEY, first_seen INTEGER, last_seen INTEGER);"); + if (!ok) + { + sqlite3_close(m_db); + m_db = nullptr; + return false; + } + + // An existing database already knows about aircraft heard before the all time table + // existed, so seed it from them rather than starting the count at nothing on an + // installation that has been running for months. Only what is still within the + // retention period can be recovered, so the figure starts low and is honest about it + // via the "since" date. Done once, on creation: repeating it every open would undo a + // reset, since the aircraft table would put the same rows straight back. + if (seenIsNew) + { + execSQL(m_db, + "INSERT OR IGNORE INTO seen (key, first_seen, last_seen) " + "SELECT CASE WHEN icao IS NOT NULL AND icao != 0 THEN printf('%06X', icao) " + "ELSE 'R:' || registration END, last_seen, last_seen " + "FROM aircraft " + "WHERE (icao IS NOT NULL AND icao != 0) " + "OR (registration IS NOT NULL AND registration != '')"); + } + + // Columns added after a version bump, which the version chain below would miss on a + // database already at the current version + // Messages stored before the link was recorded keep an empty one, which the table + // shows as a blank cell rather than guessing + ensureColumn(m_db, "atc", "link", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "messages", "INTEGER DEFAULT 0"); + ensureColumn(m_db, "flights", "out_time", "INTEGER DEFAULT 0"); + ensureColumn(m_db, "flights", "off_time", "INTEGER DEFAULT 0"); + ensureColumn(m_db, "flights", "on_time", "INTEGER DEFAULT 0"); + ensureColumn(m_db, "flights", "in_time", "INTEGER DEFAULT 0"); + // The departure, arrival and route are stored, so what decides whether a report may + // replace them has to be stored with them - otherwise the first message after a + // restart wins however delayed it is, which is the case the timestamp exists for + ensureColumn(m_db, "flights", "route_filed", "INTEGER DEFAULT 0"); + // The filed routes themselves. m_route above is only the route STRING shown in the + // tables; what the Map draws is the flight plan and the oceanic clearance, each with + // its own waypoints, the positions the message gave for them, the message text for + // the popup and when it was filed. None of it was stored, so a restored flight had + // nothing to draw and selecting an archived flight showed its track but no route. + // Appended after route_filed, and in this order, because the flights INSERT binds by + // position - so a database that predates them ends up with the same column order as + // one created now. + ensureColumn(m_db, "flights", "fp_waypoints", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "fp_points", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "fp_text", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "fp_filed", "INTEGER DEFAULT 0"); + ensureColumn(m_db, "flights", "oc_waypoints", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "oc_points", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "oc_text", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "oc_filed", "INTEGER DEFAULT 0"); + // What an insert carries besides the path - runway, SID, STAR, approach, alternate + // and the plan's own airports - as one field each. They are only ever read and + // written together, and a column apiece would be fourteen more on a table that + // already has two dozen. + ensureColumn(m_db, "flights", "fp_parts", "TEXT DEFAULT ''"); + ensureColumn(m_db, "flights", "oc_parts", "TEXT DEFAULT ''"); + + // Without these, everything keyed on a flight is a full table scan - and track runs + // to millions of rows. It was tolerable while the whole table was read once at + // startup and never queried again, but a per flight DELETE on a merge or a prune + // scanned the lot, and fetching one flight's track on demand would too. + execSQL(m_db, "CREATE INDEX IF NOT EXISTS track_flight ON track (flight_id);"); + execSQL(m_db, "CREATE INDEX IF NOT EXISTS profile_flight ON profile (flight_id);"); + // And for the same reason the documents and ATC messages, now that a save deletes + // and moves them by flight and aircraft rather than replacing the tables + execSQL(m_db, "CREATE INDEX IF NOT EXISTS documents_flight ON documents (flight_id);"); + execSQL(m_db, "CREATE INDEX IF NOT EXISTS atc_aircraft ON atc (aircraft_id);"); + execSQL(m_db, "CREATE INDEX IF NOT EXISTS atc_flight ON atc (flight_id);"); + // A model is no use on its own: without the offsets it sits half underground, and + // without knowing whether we chose it, the livery setting may not replace it + ensureColumn(m_db, "aircraft", "model_altitude_offset", "REAL DEFAULT 0"); + ensureColumn(m_db, "aircraft", "label_altitude_offset", "REAL DEFAULT 0"); + // Defaulted to -1, which no row written since says: that is what distinguishes a + // row from before these columns existed, whose model has no offsets to go with it, + // from one that legitimately holds a zero offset + ensureColumn(m_db, "aircraft", "model_is_ours", "INTEGER DEFAULT -1"); + + // Schema version. Anything other than this version had its tables dropped above, + // which leaves no version row, so the only case left is a new database. + sqlite3_stmt *stmt = nullptr; + int version = 0; + if (sqlite3_prepare_v2(m_db, "SELECT version FROM meta", -1, &stmt, nullptr) == SQLITE_OK) + { + if (sqlite3_step(stmt) == SQLITE_ROW) { + version = sqlite3_column_int(stmt, 0); + } + } + sqlite3_finalize(stmt); + if (version == 0) { + execSQL(m_db, "INSERT INTO meta (version) VALUES (" QT_STRINGIFY(AIRCRAFT_DB_VERSION) ")"); + } + + return true; +} + +// The user has chosen a different file for the session. If nothing is there yet the +// current session moves with them, so the aircraft, flights and messages they have +// collected are not left behind; if a database is already there it is theirs and is +// opened as it stands, replacing what is in memory. +// Put the setting back to the file actually in use, and tell the GUI - it owns the +// settings that are serialised, so leaving it holding the path that failed would save a +// pointer to a database nothing is writing to. +void AircraftTracker::revertDatabaseFilename(const QString& path) +{ + m_settings.m_databaseFilename = + (path == AircraftSettings::defaultDatabaseFilename()) ? QString() : path; + emit databaseFilenameReverted(m_settings.m_databaseFilename); +} + +// A consistent copy of a database, -wal and all, while anything else may have it open +static bool copyDatabase(const QString& from, const QString& to) +{ + sqlite3 *db = nullptr; + if (sqlite3_open_v2(from.toUtf8().constData(), &db, SQLITE_OPEN_READWRITE, nullptr) != SQLITE_OK) + { + sqlite3_close(db); + return false; + } + sqlite3_stmt *stmt = nullptr; + bool ok = false; + if (sqlite3_prepare_v2(db, "VACUUM INTO ?", -1, &stmt, nullptr) == SQLITE_OK) + { + bindText(stmt, 1, to); + ok = sqlite3_step(stmt) == SQLITE_DONE; + if (!ok) { + qWarning() << "AircraftTracker::changeDatabase: VACUUM INTO failed:" << sqlite3_errmsg(db); + } + } + sqlite3_finalize(stmt); + sqlite3_close(db); + return ok; +} + +void AircraftTracker::changeDatabase(const QString& oldPath) +{ + const QString newPath = databasePath(m_settings); + + if (newPath == oldPath) { + return; + } + + // Make sure everything collected so far is on disk before the file moves. If it + // could not be, the switch does not happen: adopting an existing database calls + // deleteAll() below, which would throw away the very session that failed to save. + // The setting goes back to the file actually in use, so the two do not disagree. + if (m_db && !m_loadingDatabase && !saveDatabase()) + { + qWarning() << "AircraftTracker::changeDatabase: could not save the session to" + << oldPath << "- keeping it rather than switching to" << newPath; + revertDatabaseFilename(oldPath); + return; + } + // Everything into the main file before it moves. Only a checkpoint that completed + // says so: one that could not (another connection reading) leaves committed pages in + // the -wal file, which a rename would leave behind. + bool walFlushed = false; + if (m_db) { + walFlushed = sqlite3_wal_checkpoint_v2(m_db, nullptr, SQLITE_CHECKPOINT_TRUNCATE, nullptr, nullptr) == SQLITE_OK; + } + closeDatabase(); + + const bool haveExisting = QFileInfo::exists(newPath) && (QFileInfo(newPath).size() > 0); + + // The session moves as the file it is, never as what memory can write back. Memory + // does not hold the ACARS archive or the all time airframe count, nor the track and + // profile of flights not yet looked at, which are read from the database on demand - + // and once the database was closed they were read from the new, empty one. + bool moved = false; + bool copied = false; + if (!haveExisting && QFileInfo::exists(oldPath)) + { + // An empty file at the target holds nothing, and on Windows a rename onto an + // existing file fails + if (QFileInfo::exists(newPath)) { + QFile::remove(newPath); + } + // QFile::rename copies and removes when the paths are on different volumes + moved = walFlushed && QFile::rename(oldPath, newPath); + if (moved) + { + qDebug() << "AircraftTracker::changeDatabase: moved the session from" << oldPath << "to" << newPath; + } + else + { + // A rename fails while anything else has the file open - a database browser, + // say. SQLite can still copy it, consistently and with the -wal included, + // and the original is left where it was. + copied = copyDatabase(oldPath, newPath); + if (copied) + { + qDebug() << "AircraftTracker::changeDatabase: could not move" << oldPath + << "so copied it to" << newPath; + } + else + { + qWarning() << "AircraftTracker::changeDatabase: could neither move nor copy" << oldPath + << "to" << newPath << "- staying with it"; + revertDatabaseFilename(oldPath); + if (!openDatabase()) { + qWarning() << "AircraftTracker::changeDatabase: could not reopen" << oldPath + << "- the session is now in memory only"; + } + return; + } + } + } + + if (!openDatabase()) + { + // Without this there is no database at all: the old one is closed and the new one + // would not open, so everything from here on would be kept in memory and lost on + // exit, silently. Go back to the file that was working. + qWarning() << "AircraftTracker::changeDatabase: could not open" << newPath + << "- going back to" << oldPath; + // The file has to go back before it can be reopened. Reverting the setting alone + // would point at a path the history is no longer at, and opening it would create + // an empty database there - leaving every restored aircraft to be written out + // again over nothing, with the real history stranded under the new name. + if (moved && !QFile::rename(newPath, oldPath)) + { + qWarning() << "AircraftTracker::changeDatabase: could not move" << newPath + << "back to" << oldPath << "- staying with it rather than opening" + << "an empty database over the session"; + if (!openDatabase()) { + qWarning() << "AircraftTracker::changeDatabase: and could not reopen it" + << "- the session is now in memory only"; + } + return; + } + revertDatabaseFilename(oldPath); + if (!openDatabase()) { + qWarning() << "AircraftTracker::changeDatabase: could not reopen" << oldPath + << "either - the session is now in memory only"; + } + return; + } + + if (haveExisting) + { + // Their database, their contents: start again from what it holds - the all time + // figures included, which are this database's and not the last one's + deleteAll(); + forgetAllTimeFigures(); + loadDatabase(); + } + else if (!moved && !copied) + { + // There was no file to bring: write what is held to the new one + forgetSavedHistory(); + m_dbDirty = true; + saveDatabase(); + } + // Otherwise the file is the session as last saved, so what memory says is stored is + // still true, and nothing has to be read or written again +} + +// The all time statistics and coverage belong to the database they were measured into, +// so switching to another one starts from what that one holds. deleteAll() leaves them +// alone - they are meant to outlive the traffic - and the loaders only fill in what the +// new database has, so without this the last database's figures were kept wherever the +// new one had none, and then saved into it. +void AircraftTracker::forgetAllTimeFigures() +{ + m_statistics.m_allTime = AircraftStatistics::Scope(); + m_allTimeSecondsBase = 0; + m_allTimeSince = QDateTime::currentDateTime(); + m_statisticsLoaded = false; + m_statisticsDirty = true; + + removeCoverageFromMap(); + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + m_coverageRangeKm[i].fill(0.0f, m_coverageBins); + m_coverageOrigin[i] = QGeoCoordinate(); + m_coverageDirty[i] = true; + } + m_coverageLoaded = false; + m_coverageChanged = false; +} + +void AircraftTracker::closeDatabase() +{ + if (m_db) + { + // Every statement is finalized where it is used, so this should not fail. If it + // does, the handle is left for SQLite to close when the last statement goes + // rather than leaked, and the reason is in the log. + if (sqlite3_close(m_db) != SQLITE_OK) + { + qWarning() << "AircraftTracker::closeDatabase: close failed:" << sqlite3_errmsg(m_db); + sqlite3_close_v2(m_db); + } + m_db = nullptr; + } +} + +// Write the whole session state in one transaction, replacing the previous save +// The small tables are still rewritten whole - all of them together came to about +// 21000 rows against 1.06 MILLION in track and profile, and rewriting those two every +// minute was blocking the tracker thread for the best part of a second. Measured on a +// real 72 MB session database: 870506 track and 194527 profile rows, 0.93 s to delete +// and re-insert, once a minute and growing for as long as the session ran. That stall +// was visible as a sawtooth on the message rate chart, because reports queued behind it +// and were then all counted into whichever sample followed. +// +// Track and profile only ever grow, so they are written incrementally: each flight +// remembers how many of its points are already stored and the save appends the rest. +// The three ways that can stop being true are all accounted for - a flight merged into +// another has its track or profile rebuilt (m_tracksToRewrite, m_profilesToRewrite), a +// flight discarded by the retention period has to take its rows with it +// (m_flightsToDelete), and clearing everything invalidates the lot (m_dbTrackWipe). +bool AircraftTracker::saveDatabase() +{ + // Nothing to do if nothing changed since the last save - which counts as saved. + // No database at all does not: nothing has been written and nothing will be. + if (!m_db) { + return false; + } + if (!m_dbDirty) { + return true; + } + + int documentsHeld = 0; + for (const TrackedAircraft *item : m_aircraft) + { + for (const TrackedFlight *flight : item->m_flights) { + documentsHeld += flight->m_documents.size(); + } + } + + // The small tables are replaced whole, so a DELETE that fails after a BEGIN that + // succeeded would leave the old rows in place and the new ones appended to them + if (!execSQL(m_db, "BEGIN")) + { + qWarning() << "AircraftTracker::saveDatabase: could not start a transaction"; + return false; // m_dbDirty stays set, so the next tick tries again + } + if (!execSQL(m_db, + "DELETE FROM aircraft; DELETE FROM sources; DELETE FROM flight_sources;" + "DELETE FROM flights;")) + { + execSQL(m_db, "ROLLBACK"); + return false; + } + + // Documents and the ATC log are written incrementally, like the track. They used to + // be replaced whole, which was most of the time and most of the write ahead log of + // every save once a session had a few days in it - and it meant any moment memory + // was short of them lost the stored ones, with nothing said. + if (m_dbMessageWipe || m_dbMessageRewrite) + { + if (!execSQL(m_db, "DELETE FROM documents; DELETE FROM atc;")) + { + execSQL(m_db, "ROLLBACK"); + return false; + } + } + else if (!saveMessageChanges()) + { + execSQL(m_db, "ROLLBACK"); + return false; + } + + // What is stored for these flights is stale, so it goes before anything is written + if (m_dbTrackWipe) + { + if (!execSQL(m_db, "DELETE FROM track; DELETE FROM profile;")) + { + execSQL(m_db, "ROLLBACK"); + return false; + } + // The flag is cleared after the COMMIT, not here. forgetSavedHistory() has already + // set every flight's saved count to zero, so a save that rolls back after this + // point leaves the old rows in the database and the wipe forgotten - and the next + // save appends the whole of every track on top of them. + } + else if (!m_flightsToDelete.isEmpty() || !m_tracksToRewrite.isEmpty() + || !m_profilesToRewrite.isEmpty()) + { + // Checked, because the flights being rewritten have their saved counts at zero: + // a delete that failed while the save went on appended a second copy of the whole + // track on top of the first + if (!deleteByFlight(m_db, "DELETE FROM track WHERE flight_id = ?", m_flightsToDelete + m_tracksToRewrite) + || !deleteByFlight(m_db, "DELETE FROM profile WHERE flight_id = ?", m_flightsToDelete + m_profilesToRewrite)) + { + execSQL(m_db, "ROLLBACK"); + return false; + } + } + + bool failed = false; + + // The ACARS archive only ever grows, so only what has arrived since the last save is + // written - rewriting every block every save would make the save time grow with the + // session, and this is the one table with no upper bound on its size. Nor is it held + // in memory: m_acarsBlocks is just what is waiting to be written. + if (m_dbMessageWipe) { + if (!execSQL(m_db, "DELETE FROM acars_blocks")) + { + execSQL(m_db, "ROLLBACK"); + return false; + } + } + if (!m_acarsBlocks.isEmpty()) + { + sqlite3_stmt *blockStmt = nullptr; + if (sqlite3_prepare_v2(m_db, + "INSERT INTO acars_blocks (received, frequency, level, protocol, block)" + " VALUES (?, ?, ?, ?, ?)", -1, &blockStmt, nullptr) == SQLITE_OK) + { + for (int i = 0; i < m_acarsBlocks.size(); i++) + { + const AcarsBlockRecord& record = m_acarsBlocks[i]; + sqlite3_reset(blockStmt); + sqlite3_bind_int64(blockStmt, 1, dateTimeValue(record.m_dateTime)); + sqlite3_bind_int64(blockStmt, 2, record.m_frequency); + sqlite3_bind_double(blockStmt, 3, record.m_level); + sqlite3_bind_int(blockStmt, 4, record.m_protocol); + sqlite3_bind_blob(blockStmt, 5, record.m_block.constData(), + record.m_block.size(), SQLITE_TRANSIENT); + stepInsert(m_db, blockStmt, "acars_blocks", failed); + } + sqlite3_finalize(blockStmt); + } + else + { + // Failed, not skipped: the commit clears the queue, and these blocks are held + // nowhere else + qWarning() << "AircraftTracker::saveDatabase: could not prepare the acars_blocks insert:" + << sqlite3_errmsg(m_db); + failed = true; + } + } + + + sqlite3_stmt *aircraftStmt = nullptr; + sqlite3_stmt *sourceStmt = nullptr; + sqlite3_stmt *trackStmt = nullptr; + sqlite3_stmt *flightStmt = nullptr; + sqlite3_stmt *flightSourceStmt = nullptr; + sqlite3_stmt *documentStmt = nullptr; + sqlite3_stmt *profileStmt = nullptr; + sqlite3_stmt *atcStmt = nullptr; + sqlite3_prepare_v2(m_db, + "INSERT INTO aircraft VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", -1, &aircraftStmt, nullptr); + sqlite3_prepare_v2(m_db, "INSERT INTO sources VALUES (?,?,?,?)", -1, &sourceStmt, nullptr); + // The reason, read straight after the call that failed. sqlite3_errmsg reports the + // LAST call, so asking once at the end names whichever prepare happened to run after + // the broken one - which is how a documents insert that no longer matched its table + // reported "not an error" and took a while to find. + auto prepared = [this](sqlite3_stmt *stmt, const char *what) + { + if (!stmt) { + qWarning() << "AircraftTracker::saveDatabase: could not prepare the" << what + << "insert:" << sqlite3_errmsg(m_db); + } + return stmt != nullptr; + }; + sqlite3_prepare_v2(m_db, "INSERT INTO flight_sources VALUES (?,?,?,?)", -1, &flightSourceStmt, nullptr); + sqlite3_prepare_v2(m_db, "INSERT INTO track VALUES (?,?,?,?,?,?)", -1, &trackStmt, nullptr); + sqlite3_prepare_v2(m_db, + "INSERT INTO flights VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + -1, &flightStmt, nullptr); + sqlite3_prepare_v2(m_db, "INSERT INTO documents VALUES (?,?,?,?,?,?,?)", -1, &documentStmt, nullptr); + sqlite3_prepare_v2(m_db, "INSERT INTO profile VALUES (?,?,?,?)", -1, &profileStmt, nullptr); + sqlite3_prepare_v2(m_db, "INSERT INTO atc VALUES (?,?,?,?,?,?,?,?,?,?,?)", -1, &atcStmt, nullptr); + // Every one of them reported, not just the first, so a schema change that has moved + // more than one table is fixed in one go rather than one restart at a time + bool allPrepared = true; + allPrepared &= prepared(aircraftStmt, "aircraft"); + allPrepared &= prepared(sourceStmt, "sources"); + allPrepared &= prepared(flightSourceStmt, "flight_sources"); + allPrepared &= prepared(trackStmt, "track"); + allPrepared &= prepared(flightStmt, "flights"); + allPrepared &= prepared(documentStmt, "documents"); + allPrepared &= prepared(profileStmt, "profile"); + allPrepared &= prepared(atcStmt, "atc"); + + if (!allPrepared) + { + qWarning() << "AircraftTracker::saveDatabase: nothing was saved"; + execSQL(m_db, "ROLLBACK"); + sqlite3_finalize(aircraftStmt); + sqlite3_finalize(sourceStmt); + sqlite3_finalize(trackStmt); + sqlite3_finalize(flightStmt); + sqlite3_finalize(documentStmt); + sqlite3_finalize(profileStmt); + sqlite3_finalize(atcStmt); + sqlite3_finalize(flightSourceStmt); + return false; + } + + for (const TrackedAircraft *item : m_aircraft) + { + sqlite3_reset(aircraftStmt); + sqlite3_bind_int64(aircraftStmt, 1, (qint64) item->m_id); + sqlite3_bind_int64(aircraftStmt, 2, item->m_icao); + bindText(aircraftStmt, 3, item->m_registration); + bindText(aircraftStmt, 4, item->m_flight); + sqlite3_bind_int(aircraftStmt, 5, item->m_positionValid ? 1 : 0); + sqlite3_bind_double(aircraftStmt, 6, item->m_latitude); + sqlite3_bind_double(aircraftStmt, 7, item->m_longitude); + sqlite3_bind_int(aircraftStmt, 8, item->m_altitudeValid ? 1 : 0); + sqlite3_bind_double(aircraftStmt, 9, item->m_altitudeFt); + sqlite3_bind_int(aircraftStmt, 10, item->m_headingValid ? 1 : 0); + sqlite3_bind_double(aircraftStmt, 11, item->m_heading); + sqlite3_bind_int(aircraftStmt, 12, item->m_speedValid ? 1 : 0); + sqlite3_bind_double(aircraftStmt, 13, item->m_speedKts); + sqlite3_bind_int64(aircraftStmt, 14, dateTimeValue(item->m_positionDateTime)); + sqlite3_bind_int64(aircraftStmt, 15, dateTimeValue(item->m_lastSeen)); + bindText(aircraftStmt, 16, item->m_departure); + bindText(aircraftStmt, 17, item->m_arrival); + bindText(aircraftStmt, 18, item->m_route); + bindText(aircraftStmt, 19, item->m_lastDocumentText); + sqlite3_bind_int(aircraftStmt, 20, item->m_messages); + bindText(aircraftStmt, 21, item->m_model3D); + sqlite3_bind_double(aircraftStmt, 22, item->m_modelAltitudeOffset); + sqlite3_bind_double(aircraftStmt, 23, item->m_labelAltitudeOffset); + sqlite3_bind_int(aircraftStmt, 24, item->m_modelIsOurs ? 1 : 0); + stepInsert(m_db, aircraftStmt, "aircraft", failed); + + QHashIterator, int> sourceIt(item->m_sources); + while (sourceIt.hasNext()) + { + sourceIt.next(); + sqlite3_reset(sourceStmt); + sqlite3_bind_int64(sourceStmt, 1, (qint64) item->m_id); + sqlite3_bind_int(sourceStmt, 2, sourceIt.key().first); + sqlite3_bind_int64(sourceStmt, 3, sourceIt.key().second); + sqlite3_bind_int(sourceStmt, 4, sourceIt.value()); + stepInsert(m_db, sourceStmt, "sources", failed); + } + + for (TrackedFlight *flight : item->m_flights) + { + // Only what is not stored yet. m_trackSaved is advanced after the commit, + // so a rolled back transaction leaves it describing what is really there. + for (int p = flight->m_trackSaved; p < flight->m_track.size(); p++) + { + sqlite3_reset(trackStmt); + sqlite3_bind_int64(trackStmt, 1, (qint64) flight->m_id); + sqlite3_bind_int(trackStmt, 2, p); + sqlite3_bind_double(trackStmt, 3, flight->m_track[p].latitude()); + sqlite3_bind_double(trackStmt, 4, flight->m_track[p].longitude()); + sqlite3_bind_double(trackStmt, 5, flight->m_track[p].altitude()); + sqlite3_bind_int64(trackStmt, 6, dateTimeValue(flight->m_trackTimes[p])); + stepInsert(m_db, trackStmt, "track", failed); + } + + sqlite3_reset(flightStmt); + sqlite3_bind_int64(flightStmt, 1, (qint64) flight->m_id); + sqlite3_bind_int64(flightStmt, 2, (qint64) item->m_id); + bindText(flightStmt, 3, flight->m_flight); + sqlite3_bind_int64(flightStmt, 4, dateTimeValue(flight->m_firstSeen)); + sqlite3_bind_int64(flightStmt, 5, dateTimeValue(flight->m_lastSeen)); + bindText(flightStmt, 6, flight->m_departure); + bindText(flightStmt, 7, flight->m_arrival); + bindText(flightStmt, 8, flight->m_route); + sqlite3_bind_int(flightStmt, 9, flight == item->m_currentFlight ? 1 : 0); + bindText(flightStmt, 10, flight->m_aliases.join(",")); + sqlite3_bind_int(flightStmt, 11, flight->m_messages); + sqlite3_bind_int64(flightStmt, 12, dateTimeValue(flight->m_out)); + sqlite3_bind_int64(flightStmt, 13, dateTimeValue(flight->m_off)); + sqlite3_bind_int64(flightStmt, 14, dateTimeValue(flight->m_on)); + sqlite3_bind_int64(flightStmt, 15, dateTimeValue(flight->m_in)); + sqlite3_bind_int64(flightStmt, 16, dateTimeValue(flight->m_routeFiled)); + // The two filed routes, in the column order added in openDatabase() + int column = 17; + for (const TrackedFlight::FiledRoute *route : { &flight->m_flightPlan, &flight->m_clearance }) + { + bindText(flightStmt, column++, route->m_waypoints); + bindText(flightStmt, column++, encodeRoutePoints(route->m_points)); + bindText(flightStmt, column++, route->m_text); + sqlite3_bind_int64(flightStmt, column++, dateTimeValue(route->m_filed)); + } + // After all eight of those rather than beside each route, because that is + // where ALTER TABLE put them - see openDatabase() + for (const TrackedFlight::FiledRoute *route : { &flight->m_flightPlan, &flight->m_clearance }) + { + bindText(flightStmt, column++, encodeRouteParts( + { route->m_runway, route->m_sid, route->m_star, route->m_approach, + route->m_alternate, route->m_departure, route->m_arrival, + // The level and speed the route is flown at, stored with the rest + // of it - the message that gave them is not heard again, so without + // this a reloaded route goes back to lying on the ground + route->m_flightLevel > 0 ? QString::number(route->m_flightLevel) : QString(), + route->m_mach > 0.0f ? QString::number(route->m_mach, 'f', 2) : QString() })); + } + stepInsert(m_db, flightStmt, "flights", failed); + + QHashIterator, int> flightSourceIt(flight->m_sources); + while (flightSourceIt.hasNext()) + { + flightSourceIt.next(); + sqlite3_reset(flightSourceStmt); + sqlite3_bind_int64(flightSourceStmt, 1, (qint64) flight->m_id); + sqlite3_bind_int(flightSourceStmt, 2, flightSourceIt.key().first); + sqlite3_bind_int64(flightSourceStmt, 3, flightSourceIt.key().second); + sqlite3_bind_int(flightSourceStmt, 4, flightSourceIt.value()); + stepInsert(m_db, flightSourceStmt, "flight_sources", failed); + } + + for (int d = flight->m_documentsSaved; d < flight->m_documents.size(); d++) + { + const TrackedDocument *doc = flight->m_documents[d]; + sqlite3_reset(documentStmt); + sqlite3_bind_int64(documentStmt, 1, (qint64) flight->m_id); + sqlite3_bind_int(documentStmt, 2, doc->m_kind); + bindText(documentStmt, 3, doc->m_title); + bindText(documentStmt, 4, doc->m_text); + sqlite3_bind_int64(documentStmt, 5, dateTimeValue(doc->m_received)); + if (doc->m_raw.isEmpty()) { + sqlite3_bind_null(documentStmt, 6); + } else { + sqlite3_bind_blob(documentStmt, 6, doc->m_raw.constData(), + doc->m_raw.size(), SQLITE_TRANSIENT); + } + bindText(documentStmt, 7, doc->m_source); + stepInsert(m_db, documentStmt, "documents", failed); + } + + for (int p = flight->m_profileSaved; p < flight->m_profileTimes.size(); p++) + { + sqlite3_reset(profileStmt); + sqlite3_bind_int64(profileStmt, 1, (qint64) flight->m_id); + sqlite3_bind_int64(profileStmt, 2, flight->m_profileTimes[p]); + if (std::isnan(flight->m_profileAltFt[p])) { + sqlite3_bind_null(profileStmt, 3); + } else { + sqlite3_bind_double(profileStmt, 3, flight->m_profileAltFt[p]); + } + if (std::isnan(flight->m_profileSpeedKts[p])) { + sqlite3_bind_null(profileStmt, 4); + } else { + sqlite3_bind_double(profileStmt, 4, flight->m_profileSpeedKts[p]); + } + stepInsert(m_db, profileStmt, "profile", failed); + } + } + } + + for (const AtcEvent& e : m_atcLog) + { + if (e.m_stored) { + continue; + } + sqlite3_reset(atcStmt); + sqlite3_bind_int64(atcStmt, 1, dateTimeValue(e.m_received)); + bindText(atcStmt, 2, e.m_protocol); + sqlite3_bind_int(atcStmt, 3, e.m_uplink ? 1 : 0); + bindText(atcStmt, 4, e.m_from); + bindText(atcStmt, 5, e.m_to); + bindText(atcStmt, 6, e.m_message); + bindText(atcStmt, 7, e.m_tooltip); + sqlite3_bind_int64(atcStmt, 8, (qint64) e.m_aircraftId); + sqlite3_bind_int64(atcStmt, 9, (qint64) e.m_flightId); + bindText(atcStmt, 10, e.m_mapName); + bindText(atcStmt, 11, e.m_link); + stepInsert(m_db, atcStmt, "atc", failed); + } + + sqlite3_finalize(aircraftStmt); + sqlite3_finalize(sourceStmt); + sqlite3_finalize(trackStmt); + sqlite3_finalize(flightStmt); + sqlite3_finalize(documentStmt); + sqlite3_finalize(profileStmt); + sqlite3_finalize(atcStmt); + sqlite3_finalize(flightSourceStmt); + // Inside the transaction, so a rollback takes the statistics with everything else + // The flag is cleared after the commit, like everything else: cleared here, a save + // that then rolled back left the coverage unsaved until the next bin grew + bool coverageWritten = false; + if (!failed && m_coverageChanged) + { + if (saveCoverage()) { + coverageWritten = true; + } else { + failed = true; + } + } + if (!failed && !saveStatistics()) { + failed = true; + } + if (failed) + { + // Leave the previous contents alone and keep the dirty flag, so the next save + // tries the whole thing again rather than leaving a half written database behind + qWarning() << "AircraftTracker::saveDatabase: rolling back, session not saved"; + execSQL(m_db, "ROLLBACK"); + return false; + } + if (!execSQL(m_db, "COMMIT")) + { + qWarning() << "AircraftTracker::saveDatabase: commit failed, session not saved"; + execSQL(m_db, "ROLLBACK"); + return false; + } + + // Only now that the rows are really there. Doing this as they were written would + // have a rolled back save leave every flight claiming points the database does not + // hold, and the next save would append after them - a permanent hole in the track. + // + // And ONLY for flights whose history is actually in memory: a restored flight's + // track is loaded lazily, so until ensureTrackLoaded() runs, m_trackSaved counts + // rows the empty list does not hold. Overwriting it with the list length here + // claimed the stored rows did not exist - the flight's next append then restarted + // seq at 0 and the following save wrote a SECOND copy of the track on top of the + // stored one. Loaded back, the two generations interleave point by point (ORDER BY + // seq with duplicate seqs), which drew as tracks leaping back and forth between + // two paths on both maps. + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + if (flight->m_trackLoaded) { + flight->m_trackSaved = flight->m_track.size(); + } + if (flight->m_profileLoaded) { + flight->m_profileSaved = flight->m_profileTimes.size(); + } + flight->m_documentsSaved = flight->m_documents.size(); + } + } + for (AtcEvent& e : m_atcLog) { + e.m_stored = true; + } + forgetPendingChanges(); + m_dbTrackWipe = false; + m_dbMessageRewrite = false; + if (coverageWritten) { + m_coverageChanged = false; + } + // Only now that the rows are committed, or a rolled back save would drop blocks the + // database does not hold - they stay queued for the next save instead + m_acarsBlocks.clear(); + const bool everythingDeleted = m_dbMessageWipe; + m_dbMessageWipe = false; + + m_dbDirty = false; + + // Give the space back to the file system, which SQLite does not do on its own. + // + // Deleting every row leaves the pages on the database's free list, not with the + // operating system, so the file stays exactly the size it was - which is why + // clearing everything left the reported database size unchanged. VACUUM rebuilds the + // file without the free pages, and the checkpoint truncates the write ahead log, + // which is counted in that figure too and would otherwise still hold the deletes. + // + // Only after everything was deleted, never on an ordinary save: VACUUM rewrites the + // whole database, which on a session of any size is slow and needs as much free disk + // again. After a delete there is next to nothing left to rewrite, so it is quick. + if (everythingDeleted) + { + execSQL(m_db, "VACUUM"); + execSQL(m_db, "PRAGMA wal_checkpoint(TRUNCATE)"); + } + + // The figure is only refreshed once a minute otherwise, so without this the size sits + // at its old value for up to a minute after a save that changed it - and after a + // delete, which is when it is looked at, that reads as nothing having happened + updateDatabaseSize(); + qDebug() << "AircraftTracker::saveDatabase: wrote" << m_aircraft.size() << "aircraft," + << tableCount("flights") << "flights," << documentsHeld << "documents," + << m_atcLog.size() << "ATC messages"; + return true; +} + +// The changes a save has to make beyond appending - deletes, rewrites and moves - once +// they no longer apply: they have been committed, the history is to be written out +// whole, or memory has just been read from the database and matches it +void AircraftTracker::forgetPendingChanges() +{ + m_flightsToDelete.clear(); + m_tracksToRewrite.clear(); + m_profilesToRewrite.clear(); + m_documentsToRewrite.clear(); + m_atcAircraftMoves.clear(); + m_atcFlightMoves.clear(); + m_atcAircraftToDelete.clear(); + m_atcPrunedIds.clear(); + m_atcPruneCutoff = QDateTime(); +} + +// What has changed in the documents and ATC tables since the last save, other than the +// rows to append: messages that moved with a merge, and those that went with discarded +// aircraft and flights or were cut down for a rewrite. Inside the caller's transaction. +bool AircraftTracker::saveMessageChanges() +{ + // Run one statement for each pair of ids, in order: a later move can start from where + // an earlier one ended + auto forEach = [this](const char *sql, const QList>& pairs, bool twoIds) + { + if (pairs.isEmpty()) { + return true; + } + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, sql, -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::saveMessageChanges: could not prepare" << sql + << ":" << sqlite3_errmsg(m_db); + return false; + } + bool ok = true; + for (const auto& pair : pairs) + { + sqlite3_reset(stmt); + sqlite3_bind_int64(stmt, 1, (qint64) pair.first); + if (twoIds) { + sqlite3_bind_int64(stmt, 2, (qint64) pair.second); + } + if (sqlite3_step(stmt) != SQLITE_DONE) + { + qWarning() << "AircraftTracker::saveMessageChanges:" << sql << "failed:" + << sqlite3_errmsg(m_db); + ok = false; + break; + } + } + sqlite3_finalize(stmt); + return ok; + }; + auto ids = [](const QSet& set) + { + QList> pairs; + for (quint64 id : set) { + pairs.append({id, 0}); + } + return pairs; + }; + // (to, from) for the UPDATEs, whose first parameter is the new id + auto swapped = [](const QList>& moves) + { + QList> pairs; + for (const auto& move : moves) { + pairs.append({move.second, move.first}); + } + return pairs; + }; + + if (!forEach("UPDATE atc SET aircraft_id = ? WHERE aircraft_id = ?", swapped(m_atcAircraftMoves), true) + || !forEach("UPDATE atc SET flight_id = ? WHERE flight_id = ?", swapped(m_atcFlightMoves), true) + || !forEach("DELETE FROM documents WHERE flight_id = ?", ids(m_flightsToDelete + m_documentsToRewrite), false) + || !forEach("DELETE FROM atc WHERE aircraft_id = ?", ids(m_atcAircraftToDelete), false)) { + return false; + } + if (m_atcPruneCutoff.isValid()) + { + QList> pruned; + for (quint64 id : m_atcPrunedIds) { + pruned.append({id, (quint64) dateTimeValue(m_atcPruneCutoff)}); + } + if (!forEach("DELETE FROM atc WHERE aircraft_id = ? AND time < ?", pruned, true)) { + return false; + } + } + return true; +} + +// The all time records and counters, replaced wholesale - there are a few dozen rows at +// most, so there is nothing to gain from working out which changed. Inside the caller's +// transaction, so a rollback takes these with it. +// The coverage bins, one row per protocol and bearing, with the receiver position they +// were measured from. +// +// A table of its own, created with IF NOT EXISTS and WITHOUT touching the schema +// version: an existing database gains it on the next run and keeps everything it already +// holds. Bumping the version would have dropped every aircraft, flight and message +// anyone had collected, to add a feature that starts empty anyway. +bool AircraftTracker::saveCoverage() +{ + if (!execSQL(m_db, "DELETE FROM coverage")) { + return false; + } + + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "INSERT INTO coverage VALUES (?,?,?,?,?)", + -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::saveCoverage:" << sqlite3_errmsg(m_db); + return false; + } + + bool failed = false; + for (int protocol = 0; protocol < AircraftReport::ProtocolCount; protocol++) + { + if (!m_coverageOrigin[protocol].isValid()) { + continue; + } + for (int bin = 0; bin < m_coverageRangeKm[protocol].size(); bin++) + { + // Only the bins that hold something, so a fresh protocol costs no rows + if (m_coverageRangeKm[protocol][bin] <= 0.0f) { + continue; + } + sqlite3_reset(stmt); + sqlite3_bind_int(stmt, 1, protocol); + sqlite3_bind_int(stmt, 2, bin); + sqlite3_bind_double(stmt, 3, m_coverageRangeKm[protocol][bin]); + sqlite3_bind_double(stmt, 4, m_coverageOrigin[protocol].latitude()); + sqlite3_bind_double(stmt, 5, m_coverageOrigin[protocol].longitude()); + stepInsert(m_db, stmt, "coverage", failed); + } + } + sqlite3_finalize(stmt); + + return !failed; +} + +bool AircraftTracker::loadCoverage() +{ + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "SELECT protocol, bin, range, latitude, longitude FROM coverage", + -1, &stmt, nullptr) != SQLITE_OK) + { + // An older database that has not been opened by this build yet has no such + // table. Not an error - there is simply no coverage to restore. + return false; + } + + bool any = false; + while (sqlite3_step(stmt) == SQLITE_ROW) + { + const int protocol = sqlite3_column_int(stmt, 0); + const int bin = sqlite3_column_int(stmt, 1); + if ((protocol < 0) || (protocol >= AircraftReport::ProtocolCount) + || (bin < 0) || (bin >= m_coverageBins)) { + continue; + } + if (m_coverageRangeKm[protocol].isEmpty()) { + m_coverageRangeKm[protocol].fill(0.0f, m_coverageBins); + } + m_coverageRangeKm[protocol][bin] = (float) sqlite3_column_double(stmt, 2); + m_coverageOrigin[protocol] = QGeoCoordinate(sqlite3_column_double(stmt, 3), + sqlite3_column_double(stmt, 4)); + m_coverageDirty[protocol] = true; + any = true; + } + sqlite3_finalize(stmt); + + m_coverageLoaded = any; + return any; +} + +bool AircraftTracker::saveStatistics() +{ + if (!execSQL(m_db, "DELETE FROM stat_records; DELETE FROM stat_counters;")) { + return false; + } + + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "INSERT INTO stat_records VALUES (?,?,?,?,?,?,?,?,?,?,?)", + -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::saveStatistics:" << sqlite3_errmsg(m_db); + return false; + } + + bool failed = false; + auto put = [&](int kind, int protocol, const AircraftStatistics::Record& r) + { + if (!r.m_valid) { + return; // An unset record is an absent row, so a reset writes nothing + } + sqlite3_reset(stmt); + sqlite3_bind_int(stmt, 1, kind); + sqlite3_bind_int(stmt, 2, protocol); + sqlite3_bind_double(stmt, 3, r.m_value); + bindText(stmt, 4, r.m_aircraft); + sqlite3_bind_int64(stmt, 5, dateTimeValue(r.m_when)); + sqlite3_bind_int(stmt, 6, r.m_positionValid ? 1 : 0); + sqlite3_bind_double(stmt, 7, r.m_latitude); + sqlite3_bind_double(stmt, 8, r.m_longitude); + sqlite3_bind_int(stmt, 9, r.m_altitudeValid ? 1 : 0); + sqlite3_bind_double(stmt, 10, r.m_altitudeFt); + sqlite3_bind_int64(stmt, 11, r.m_frequency); + stepInsert(m_db, stmt, "stat_records", failed); + }; + + const AircraftStatistics::Scope& all = m_statistics.m_allTime; + for (int i = 0; i < AircraftReport::ProtocolCount; i++) { + put(0, i, all.m_maxRange[i]); + } + put(1, -1, all.m_fastest); + put(2, -1, all.m_highest); + sqlite3_finalize(stmt); + + stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "INSERT INTO stat_counters VALUES (?,?)", + -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::saveStatistics:" << sqlite3_errmsg(m_db); + return false; + } + auto count = [&](const char *name, qint64 value) + { + sqlite3_reset(stmt); + bindText(stmt, 1, QString(name)); + sqlite3_bind_int64(stmt, 2, value); + stepInsert(m_db, stmt, "stat_counters", failed); + }; + count("maxConcurrent", all.m_maxConcurrent); + count("maxConcurrentWhen", dateTimeValue(all.m_maxConcurrentWhen)); + count("totalMessages", (qint64) all.m_totalMessages); + for (int i = 0; i < AircraftReport::ProtocolCount; i++) { + count(qPrintable(QString("messages%1").arg(i)), (qint64) all.m_messagesByProtocol[i]); + } + count("seconds", all.m_seconds); + count("firstStart", dateTimeValue(m_statistics.m_firstStart)); + sqlite3_finalize(stmt); + + return !failed; +} + +// Returns false when the database holds no statistics at all, which is what tells the +// caller to look for a set in the preset to import - see applySettings() +bool AircraftTracker::loadStatistics() +{ + AircraftStatistics::Scope& all = m_statistics.m_allTime; + bool any = false; + + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "SELECT * FROM stat_records", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + const int kind = sqlite3_column_int(stmt, 0); + const int protocol = sqlite3_column_int(stmt, 1); + AircraftStatistics::Record r; + r.m_valid = true; + r.m_value = (float) sqlite3_column_double(stmt, 2); + r.m_aircraft = columnText(stmt, 3); + r.m_when = columnDateTime(stmt, 4); + r.m_positionValid = sqlite3_column_int(stmt, 5) != 0; + r.m_latitude = (float) sqlite3_column_double(stmt, 6); + r.m_longitude = (float) sqlite3_column_double(stmt, 7); + r.m_altitudeValid = sqlite3_column_int(stmt, 8) != 0; + r.m_altitudeFt = (float) sqlite3_column_double(stmt, 9); + r.m_frequency = sqlite3_column_int64(stmt, 10); + + if ((kind == 0) && (protocol >= 0) && (protocol < AircraftReport::ProtocolCount)) { + all.m_maxRange[protocol] = r; + } else if (kind == 1) { + all.m_fastest = r; + } else if (kind == 2) { + all.m_highest = r; + } else { + continue; // A kind this build does not know: leave it in the table + } + any = true; + } + } + sqlite3_finalize(stmt); + + stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "SELECT name, value FROM stat_counters", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + const QString name = columnText(stmt, 0); + const qint64 value = sqlite3_column_int64(stmt, 1); + any = true; + if (name == "maxConcurrent") { + all.m_maxConcurrent = (int) value; + } else if (name == "maxConcurrentWhen") { + all.m_maxConcurrentWhen = value ? QDateTime::fromMSecsSinceEpoch(value) : QDateTime(); + } else if (name == "totalMessages") { + all.m_totalMessages = (quint64) value; + } else if (name == "seconds") { + all.m_seconds = value; + } else if (name == "firstStart") { + m_statistics.m_firstStart = value ? QDateTime::fromMSecsSinceEpoch(value) : QDateTime(); + } else if (name.startsWith("messages")) + { + const int protocol = name.mid(8).toInt(); + if ((protocol >= 0) && (protocol < AircraftReport::ProtocolCount)) { + all.m_messagesByProtocol[protocol] = (quint64) value; + } + } + } + } + sqlite3_finalize(stmt); + + return any; +} + + +// A restored flight's track, read the first time anything wants it. The index added in +// openDatabase() is what makes this a lookup rather than a scan of the whole table. +void AircraftTracker::ensureTrackLoaded(TrackedFlight *flight) +{ + if (!flight || flight->m_trackLoaded) { + return; + } + flight->m_trackLoaded = true; // Set first, so a failure does not retry for ever + + // What the table holds for this flight, counted when the database was opened + const int stored = flight->m_trackSaved; + if (!m_db || (stored == 0)) + { + flight->m_trackSaved = flight->m_track.size(); + return; + } + + // ORDER BY time, not seq: a database written by a build where a save could reset a + // restored flight's saved count holds TWO generations of rows for one flight, both + // starting at seq 0 - ordered by seq they interleave point by point, and the track + // leaps back and forth between the two paths. Ordered by time (seq only as the + // tiebreak within one instant) the generations come back out end to end, which is + // the actual flight. For a healthy flight the two orders are identical. + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, + "SELECT latitude, longitude, altitude, time, seq FROM track WHERE flight_id = ? ORDER BY time, seq", + -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::ensureTrackLoaded:" << sqlite3_errmsg(m_db); + return; + } + sqlite3_bind_int64(stmt, 1, (qint64) flight->m_id); + + QList track; + QList times; + int rowCount = 0; + int maxSeq = -1; + while (sqlite3_step(stmt) == SQLITE_ROW) + { + rowCount++; + maxSeq = std::max(maxSeq, sqlite3_column_int(stmt, 4)); + // Exactly 0N 0E is a zeroed-out field saved before the filter for them existed, + // not a position + const double latitude = sqlite3_column_double(stmt, 0); + const double longitude = sqlite3_column_double(stmt, 1); + if ((latitude == 0.0) && (longitude == 0.0)) { + continue; + } + track.append(QGeoCoordinate(latitude, longitude, sqlite3_column_double(stmt, 2))); + times.append(columnDateTime(stmt, 3)); + } + sqlite3_finalize(stmt); + + // Anything received since the flight was restored is newer than everything stored, so + // the stored points go in front of it rather than replacing it + flight->m_track = track + flight->m_track; + flight->m_trackTimes = times + flight->m_trackTimes; + flight->m_trackSaved = track.size(); + + if ((track.size() != stored) || (rowCount != maxSeq + 1)) + { + // Rows were dropped as zeroed positions - or the seq numbers are duplicated + // (two generations, see above) or have holes - so the table no longer matches + // what is in memory and the save cannot simply append to it. Rewriting the + // flight is the only thing that puts the two back in step - and it quietly + // cleans out the bad rows, which nothing else would. + m_tracksToRewrite.insert(flight->m_id); + flight->m_trackSaved = 0; + m_dbDirty = true; + } +} + +void AircraftTracker::ensureProfileLoaded(TrackedFlight *flight) +{ + if (!flight || flight->m_profileLoaded) { + return; + } + flight->m_profileLoaded = true; + + const int stored = flight->m_profileSaved; + if (!m_db || (stored == 0)) + { + flight->m_profileSaved = flight->m_profileTimes.size(); + return; + } + + sqlite3_stmt *stmt = nullptr; + if (sqlite3_prepare_v2(m_db, + "SELECT time, altitude, speed FROM profile WHERE flight_id = ? ORDER BY time", + -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::ensureProfileLoaded:" << sqlite3_errmsg(m_db); + return; + } + sqlite3_bind_int64(stmt, 1, (qint64) flight->m_id); + + QList times; + QList altitude; + QList speed; + while (sqlite3_step(stmt) == SQLITE_ROW) + { + times.append(sqlite3_column_int64(stmt, 0)); + altitude.append(sqlite3_column_type(stmt, 1) == SQLITE_NULL + ? std::numeric_limits::quiet_NaN() : (float) sqlite3_column_double(stmt, 1)); + speed.append(sqlite3_column_type(stmt, 2) == SQLITE_NULL + ? std::numeric_limits::quiet_NaN() : (float) sqlite3_column_double(stmt, 2)); + } + sqlite3_finalize(stmt); + + flight->m_profileTimes = times + flight->m_profileTimes; + flight->m_profileAltFt = altitude + flight->m_profileAltFt; + flight->m_profileSpeedKts = speed + flight->m_profileSpeedKts; + flight->m_profileSaved = times.size(); +} + +// Everything at once, for the two places that genuinely need the whole history in memory: +// writing the session into a different database, and wiping the stored points to write +// them all again. Both are rare and deliberate; everything else takes one flight. +void AircraftTracker::ensureAllHistoryLoaded() +{ + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + ensureTrackLoaded(flight); + ensureProfileLoaded(flight); + } + } +} + +// Nothing stored relates to what is in memory any more, so the next save empties the +// track, profile, documents and ATC tables and writes everything again. Everything has +// to be read in first, or the points that were never read would be wiped without ever +// having been written back. +void AircraftTracker::forgetSavedHistory() +{ + ensureAllHistoryLoaded(); + m_dbTrackWipe = true; + m_dbMessageRewrite = true; + forgetPendingChanges(); + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + flight->m_trackSaved = 0; + flight->m_profileSaved = 0; + flight->m_documentsSaved = 0; + } + } + for (AtcEvent& e : m_atcLog) { + e.m_stored = false; + } +} + +// Restore the previous session. Aircraft older than the removal timeout are +// pruned afterwards; the ATC log is restored in full. The GUI, if any, gets the +// restored state when it connects and requests a resync. +void AircraftTracker::loadDatabase() +{ + if (!m_db) { + return; + } + + m_loadingDatabase = true; + QHash aircraftById; + QHash flightsById; + sqlite3_stmt *stmt = nullptr; + + // Ids are never reused, so the next one has to clear every id still referenced - + // not only those of the aircraft and flights loaded below. ATC and document rows + // outlive the aircraft they were heard from, and taking the next id from the two + // tables alone handed their ids to new flights, which then claimed old messages. + if (sqlite3_prepare_v2(m_db, + "SELECT MAX(id) FROM (" + "SELECT MAX(id) AS id FROM aircraft UNION ALL SELECT MAX(id) FROM flights " + "UNION ALL SELECT MAX(aircraft_id) FROM atc UNION ALL SELECT MAX(flight_id) FROM atc " + "UNION ALL SELECT MAX(flight_id) FROM documents UNION ALL SELECT MAX(flight_id) FROM track " + "UNION ALL SELECT MAX(flight_id) FROM profile UNION ALL SELECT MAX(flight_id) FROM flight_sources " + "UNION ALL SELECT MAX(aircraft_id) FROM sources)", + -1, &stmt, nullptr) == SQLITE_OK) + { + if ((sqlite3_step(stmt) == SQLITE_ROW) && (sqlite3_column_type(stmt, 0) != SQLITE_NULL)) { + m_nextId = std::max(m_nextId, (quint64) sqlite3_column_int64(stmt, 0) + 1); + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + + // Aircraft + if (sqlite3_prepare_v2(m_db, "SELECT * FROM aircraft", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + TrackedAircraft *item = new TrackedAircraft(); + qint64 id = sqlite3_column_int64(stmt, 0); + item->m_id = (quint64) id; + m_nextId = std::max(m_nextId, item->m_id + 1); + item->m_icao = (quint32) sqlite3_column_int64(stmt, 1); + item->m_registration = columnText(stmt, 2); + item->m_flight = columnText(stmt, 3); + item->m_positionValid = sqlite3_column_int(stmt, 4) != 0; + item->m_latitude = (float) sqlite3_column_double(stmt, 5); + item->m_longitude = (float) sqlite3_column_double(stmt, 6); + item->m_altitudeValid = sqlite3_column_int(stmt, 7) != 0; + item->m_altitudeFt = (float) sqlite3_column_double(stmt, 8); + item->m_headingValid = sqlite3_column_int(stmt, 9) != 0; + item->m_heading = (float) sqlite3_column_double(stmt, 10); + item->m_speedValid = sqlite3_column_int(stmt, 11) != 0; + item->m_speedKts = (float) sqlite3_column_double(stmt, 12); + item->m_positionDateTime = columnDateTime(stmt, 13); + item->m_lastSeen = columnDateTime(stmt, 14); + item->m_departure = columnText(stmt, 15); + item->m_arrival = columnText(stmt, 16); + item->m_route = columnText(stmt, 17); + item->m_lastDocumentText = columnText(stmt, 18); + item->m_messages = sqlite3_column_int(stmt, 19); + item->m_model3D = columnText(stmt, 20); + // Added by ensureColumn(), so a database written before they existed reads + // them as the defaults - which is the same as never having had a model + item->m_modelAltitudeOffset = (float) sqlite3_column_double(stmt, 21); + item->m_labelAltitudeOffset = (float) sqlite3_column_double(stmt, 22); + const int modelIsOurs = sqlite3_column_int(stmt, 23); + item->m_modelIsOurs = modelIsOurs > 0; + // A row written before these columns existed has the model but nothing that + // goes with it, so the model is dropped and chosen again on the next report + // rather than drawn at the wrong height and never replaced + if (modelIsOurs < 0) { + item->m_model3D.clear(); + } + // Nor is one that is no longer installed: the map would ask for a file that + // isn't there, and draw nothing at all for the aircraft + if (!item->m_model3D.isEmpty() && !Aircraft3DModels::instance().isInstalled(item->m_model3D)) { + item->m_model3D.clear(); + } + + m_aircraft.append(item); + aircraftById.insert(id, item); + if (item->m_icao) { + m_byKey.insert(QString("I%1").arg(item->m_icao, 6, 16, QChar('0')), item); + } + if (!item->m_registration.isEmpty()) { + m_byKey.insert("R" + item->m_registration, item); + } + if (!item->m_flight.isEmpty()) { + m_byKey.insert("F" + item->m_flight, item); + } + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + + // Protocols/frequencies heard on + if (sqlite3_prepare_v2(m_db, "SELECT * FROM sources", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + TrackedAircraft *item = aircraftById.value(sqlite3_column_int64(stmt, 0)); + if (item) { + item->m_sources.insert( + qMakePair(sqlite3_column_int(stmt, 1), (qint64) sqlite3_column_int64(stmt, 2)), + sqlite3_column_int(stmt, 3)); + } + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + + // Flights + if (sqlite3_prepare_v2(m_db, "SELECT * FROM flights ORDER BY id", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + TrackedAircraft *item = aircraftById.value(sqlite3_column_int64(stmt, 1)); + if (!item) { + continue; + } + TrackedFlight *flight = new TrackedFlight(); + flight->m_id = (quint64) sqlite3_column_int64(stmt, 0); + m_nextId = std::max(m_nextId, flight->m_id + 1); + flight->m_aircraft = item; + flight->m_flight = columnText(stmt, 2); + flight->m_firstSeen = columnDateTime(stmt, 3); + flight->m_lastSeen = columnDateTime(stmt, 4); + flight->m_departure = columnText(stmt, 5); + flight->m_arrival = columnText(stmt, 6); + flight->m_route = columnText(stmt, 7); + flight->m_messages = sqlite3_column_int(stmt, 10); + flight->m_out = columnDateTime(stmt, 11); + flight->m_off = columnDateTime(stmt, 12); + flight->m_on = columnDateTime(stmt, 13); + flight->m_in = columnDateTime(stmt, 14); + flight->m_routeFiled = columnDateTime(stmt, 15); + int routeColumn = 16; + for (TrackedFlight::FiledRoute *route : { &flight->m_flightPlan, &flight->m_clearance }) + { + route->m_waypoints = columnText(stmt, routeColumn++); + route->m_points = decodeRoutePoints(columnText(stmt, routeColumn++)); + route->m_text = columnText(stmt, routeColumn++); + route->m_filed = columnDateTime(stmt, routeColumn++); + } + // decodeRouteParts writes into QStrings, so the two numeric parts land here + // first and are converted after + QString flightLevelText; + QString machText; + for (TrackedFlight::FiledRoute *route : { &flight->m_flightPlan, &flight->m_clearance }) + { + const QList parts { + &route->m_runway, &route->m_sid, &route->m_star, &route->m_approach, + &route->m_alternate, &route->m_departure, &route->m_arrival, + &flightLevelText, &machText }; + flightLevelText.clear(); + machText.clear(); + decodeRouteParts(columnText(stmt, routeColumn++), parts); + route->m_flightLevel = flightLevelText.toInt(); + route->m_mach = machText.toFloat(); + // Whatever the row could not carry, taken back out of the message + recoverRoutePartsFromText(route->m_text, parts); + } + QString aliases = columnText(stmt, 9); + if (!aliases.isEmpty()) { + flight->m_aliases = aliases.split(','); + } + item->m_flights.append(flight); + if (sqlite3_column_int(stmt, 8)) { + item->m_currentFlight = flight; + } + flightsById.insert(sqlite3_column_int64(stmt, 0), flight); + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + + // Protocols/frequencies each flight was heard on. After the flights, because it is + // keyed on their ids. + if (sqlite3_prepare_v2(m_db, "SELECT * FROM flight_sources", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); + if (flight) { + flight->m_sources.insert( + qMakePair(sqlite3_column_int(stmt, 1), (qint64) sqlite3_column_int64(stmt, 2)), + sqlite3_column_int(stmt, 3)); + } + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + + // Tracks and profiles are NOT read here, only how many rows each flight has - which + // is exactly what the incremental save needs in order to append. The rows themselves + // are fetched when something wants them, one flight at a time. + for (auto it = flightsById.cbegin(); it != flightsById.cend(); ++it) + { + it.value()->m_trackLoaded = false; + it.value()->m_profileLoaded = false; + } + for (int pass = 0; pass < 2; pass++) + { + const char *query = pass == 0 + ? "SELECT flight_id, COUNT(*) FROM track GROUP BY flight_id" + : "SELECT flight_id, COUNT(*) FROM profile GROUP BY flight_id"; + if (sqlite3_prepare_v2(m_db, query, -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); + if (!flight) { + continue; + } + // Standing in for the points until they are read, so a flight nobody + // looks at is never rewritten + if (pass == 0) { + flight->m_trackSaved = sqlite3_column_int(stmt, 1); + } else { + flight->m_profileSaved = sqlite3_column_int(stmt, 1); + } + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + } + + // Documents + int rerendered = 0; + if (sqlite3_prepare_v2(m_db, "SELECT * FROM documents ORDER BY received", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + TrackedFlight *flight = flightsById.value(sqlite3_column_int64(stmt, 0)); + if (!flight) { + continue; + } + TrackedDocument *doc = new TrackedDocument(); + doc->m_kind = sqlite3_column_int(stmt, 1); + doc->m_title = columnText(stmt, 2); + doc->m_text = columnText(stmt, 3); + doc->m_received = columnDateTime(stmt, 4); + const void *blob = sqlite3_column_blob(stmt, 5); + const int bytes = sqlite3_column_bytes(stmt, 5); + if (blob && (bytes > 0)) { + doc->m_raw = QByteArray((const char *) blob, bytes); + } + doc->m_source = columnText(stmt, 6); + // Rendered again by whatever the parser does now, rather than shown as it was + // written. The stored text is the fallback: a document with no raw came from a + // decoder this feature cannot run, and a raw that no longer decodes should not + // lose the text it once had. + if (!doc->m_raw.isEmpty()) + { + const QString rendered = renderDocument(doc->m_raw, doc->m_source); + if (!rendered.isEmpty()) + { + if (rendered != doc->m_text) { + rerendered++; + } + doc->m_text = rendered; + } + } + flight->m_documents.append(doc); + } + } + sqlite3_finalize(stmt); + stmt = nullptr; + if (rerendered > 0) { + qDebug() << "AircraftTracker::loadDatabase:" << rerendered + << "documents came out differently under the current decoder"; + } + + // Flight profiles are fetched on demand as well - see the row counts read above + sqlite3_finalize(stmt); + stmt = nullptr; + + // ATC log + if (sqlite3_prepare_v2(m_db, "SELECT * FROM atc ORDER BY time", -1, &stmt, nullptr) == SQLITE_OK) + { + while (sqlite3_step(stmt) == SQLITE_ROW) + { + AtcEvent e; + e.m_received = columnDateTime(stmt, 0); + e.m_protocol = columnText(stmt, 1); + e.m_uplink = sqlite3_column_int(stmt, 2) != 0; + e.m_from = columnText(stmt, 3); + e.m_to = columnText(stmt, 4); + e.m_message = columnText(stmt, 5); + e.m_tooltip = columnText(stmt, 6); + e.m_aircraftId = (quint64) sqlite3_column_int64(stmt, 7); + e.m_flightId = (quint64) sqlite3_column_int64(stmt, 8); + e.m_mapName = columnText(stmt, 9); + e.m_link = columnText(stmt, 10); + e.m_stored = true; + m_atcLog.append(e); + } + } + sqlite3_finalize(stmt); + + // Everything just read is, by definition, already in the database - without this the + // first save would write the whole restored history out again. + // + // Before EVERY merge below, not after: absorbAircraft() runs one of its own through + // mergeLoadedFlights(), so putting this between the two loops still erased what the + // first had recorded - merging two restored flights deletes one and rewrites the + // other, and says so through m_flightsToDelete, m_tracksToRewrite and a zeroed + // m_trackSaved. + // + // The track and profile counts are NOT set from the lists here: the points have not + // been read, so the lists are empty while the table is full, and taking the sizes + // would tell the next save that the whole stored history had never been written. They + // come from the row counts read above instead. + forgetPendingChanges(); + m_dbTrackWipe = false; + // Unlike the track, the documents were read in full, so the lists are what is stored + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) { + flight->m_documentsSaved = flight->m_documents.size(); + } + } + // Memory now reflects this file, so any pending clear belonged to the last one. It + // matters because changeDatabase() calls deleteAll() before opening the new database. + m_dbMessageWipe = false; + m_dbMessageRewrite = false; + + // Flights stored before the airport fields were trimmed hold whatever the airline + // wrote after the code, because the field ran to the next : or / and a route holds + // neither: EGPD(34O)..AVANT.UM184.HEMEL.. is an airport, a landing runway and a whole + // route in what should be four characters. The demodulator splits them now, and this + // splits what was stored before it did - so the route it swallowed comes back rather + // than waiting for the aircraft to file again. + int airportsTrimmed = 0; + int routesRecovered = 0; + { + static const QRegularExpression airportRe(R"(^([A-Z0-9]{4})[^A-Z0-9])"); + static const QRegularExpression bracketRe(R"(^\([^)]*\))"); + static const QRegularExpression separatorRe("[ .]+"); + + for (auto it = flightsById.cbegin(); it != flightsById.cend(); ++it) + { + TrackedFlight *flight = it.value(); + + for (int end = 0; end < 2; end++) + { + QString& airport = (end == 0) ? flight->m_departure : flight->m_arrival; + const QRegularExpressionMatch match = airportRe.match(airport); + if (!match.hasMatch()) { + continue; + } + + QString tail = airport.mid(match.captured(1).size()); + airport = match.captured(1); + airportsTrimmed++; + + // The runway comes first where it is given at all, then the route, joined + // to the airport by the dots that mean "direct to" + const QRegularExpressionMatch bracket = bracketRe.match(tail); + if (bracket.hasMatch()) { + tail = tail.mid(bracket.captured(0).size()); + } + while (tail.startsWith('.')) { + tail.remove(0, 1); + } + if ((end == 0) || tail.isEmpty()) { + continue; // Only the arrival carries the route, in this form + } + + // Longer wins, counted in names rather than placed, so that this needs + // none of the databases - which are not what was being read here. It is + // what keeps a plan filed properly since from being replaced by the tail + // of an older message, while still replacing the "ILS 34" that an + // approach-only insert left behind. + const int recovered = tail.split(separatorRe, Qt::SkipEmptyParts).size(); + if (recovered < 2) { + continue; + } + if (flight->m_route.split(separatorRe, Qt::SkipEmptyParts).size() < recovered) + { + flight->m_route = tail; + routesRecovered++; + } + TrackedFlight::FiledRoute& plan = flight->m_flightPlan; + if (plan.m_waypoints.split(separatorRe, Qt::SkipEmptyParts).size() < recovered) + { + plan.m_waypoints = tail; + plan.m_points.clear(); // Names only; nothing placed them + } + } + } + } + // Position reports stored as OOOI events, from before a label 13 to 18 message had + // to carry an actual event to be filed as one. They are not documents under the + // current rules, so they are dropped from the list rather than left claiming to be + // something they are not. Nothing is lost: the messages themselves are in the ACARS + // block archive, and their positions are already in the track. + static const QRegularExpression poxShape("^POX,"); + static const QRegularExpression companyShape(R"RX(^\d{6},\s*\d+,\d{4},)RX"); + int positionsUnfiled = 0; + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + QList kept; + const int stored = flight->m_documents.size(); + for (TrackedDocument *doc : flight->m_documents) + { + const bool misfiled = (doc->m_kind == AircraftReport::OooiEvent) + && (poxShape.match(doc->m_source).hasMatch() + || companyShape.match(doc->m_source).hasMatch()); + if (misfiled) + { + positionsUnfiled++; + delete doc; + } + else + { + kept.append(doc); + } + } + flight->m_documents = kept; + if (kept.size() != stored) + { + // Saved incrementally, so what was dropped has to be taken out of the table + flight->m_documentsSaved = 0; + m_documentsToRewrite.insert(flight->m_id); + } + } + } + if (positionsUnfiled > 0) + { + m_dbDirty = true; + qDebug() << "AircraftTracker::loadDatabase: dropped" << positionsUnfiled + << "position reports that had been stored as OOOI events"; + } + + // Pre-departure clearances stored before they had a kind of their own were filed as + // flight plans, which is what they are for drawing purposes but not for the Flights + // table's clearance column. Reclassified by their title, which is the only thing + // that distinguishes them, so the ones already held tick CL like new ones do. + int clearancesReclassified = 0; + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + for (TrackedDocument *doc : flight->m_documents) + { + if ((doc->m_kind == AircraftReport::FlightPlan) + && (doc->m_title == "Pre-departure clearance")) + { + doc->m_kind = AircraftReport::DepartureClearance; + clearancesReclassified++; + } + } + } + } + if (clearancesReclassified > 0) + { + m_dbDirty = true; + qDebug() << "AircraftTracker::loadDatabase: reclassified" << clearancesReclassified + << "stored pre-departure clearances"; + } + + // Destinations out of stored VDL-2 logons. + // + // The XID destination was not read until recently, so every flight heard before that + // has the logon text stored and nothing taken from it. In a week of traffic that is + // 662 flights whose arrival is empty while their own logons state it outright. + // + // It also replaces an arrival that matches the callsign to route database, because + // that is a guess rather than something anyone said: of 606 flights whose stored + // arrival disagreed with their own logons, 605 were holding exactly the database's + // answer. An arrival that differs from the database was set by a message, and is + // left alone - a logon does not outrank a filed plan. + int destinationsRecovered = 0; + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + // One destination across all of its logons, or none at all. An aircraft that + // named two is not a case to choose between here. + QString destination; + bool ambiguous = false; + for (const TrackedDocument *doc : flight->m_documents) + { + if (doc->m_kind != AircraftReport::Logon) { + continue; + } + const QString found = xidDestinationAirport(doc->m_text); + if (found.isEmpty()) { + continue; + } + if (destination.isEmpty()) { + destination = found; + } else if (destination != found) { + ambiguous = true; + break; + } + } + if (ambiguous || destination.isEmpty() || (flight->m_arrival == destination)) { + continue; + } + + if (!flight->m_arrival.isEmpty()) + { + // Held already, so only a database guess may be overruled. Provenance is + // not stored, so it is recovered the only way it can be: a value equal to + // what the database says for this callsign either came from there or is + // indistinguishable from it, and either way the logon agrees or improves. + const AircraftRouteInformation *entry = nullptr; + QStringList names; + names.append(flight->m_flight); + names.append(flight->m_aliases); + for (const QString& name : names) + { + if (!name.isEmpty() && m_routeInfo && m_routeInfo->contains(name)) + { + entry = m_routeInfo->value(name); + break; + } + } + if (!entry || (entry->m_arr != flight->m_arrival)) { + continue; // A message set this; a logon does not outrank it + } + } + + flight->m_arrival = destination; + flight->m_arrivalFromDatabase = false; + destinationsRecovered++; + } + } + if (destinationsRecovered > 0) + { + m_dbDirty = true; + qDebug() << "AircraftTracker::loadDatabase: took" << destinationsRecovered + << "destinations from stored VDL-2 logons"; + } + + if (airportsTrimmed > 0) + { + m_dbDirty = true; + qDebug() << "AircraftTracker::loadDatabase: trimmed" << airportsTrimmed + << "airport fields that had a runway or a route written after the code," + << "recovering" << routesRecovered << "routes"; + } + + // Flights saved before the filed routes had columns of their own kept only the route + // STRING and the document that filed it, so nothing could be drawn for them - the + // clearance was in the database and on screen, and the line was not. Both halves are + // stored, so the route is rebuilt from them: the waypoints from the string, the text + // and which of the two routes it is from the document, and the time from route_filed. + // + // Only where the flight has a route document, because m_route is also filled in from + // the callsign to route database, and what that holds is the airports rather than the + // waypoints. The positions a message gave for its waypoints are NOT recoverable, only + // their names - which for an oceanic route names them anyway. + // + // It runs once per flight in practice: the next save writes the columns, and a flight + // that has them is skipped. + int routesRebuilt = 0; + for (auto it = flightsById.cbegin(); it != flightsById.cend(); ++it) + { + TrackedFlight *flight = it.value(); + + if (flight->m_route.isEmpty() + || !flight->m_flightPlan.m_waypoints.isEmpty() + || !flight->m_clearance.m_waypoints.isEmpty()) { + continue; + } + + // The most recent of them, because that is the one m_route came from + const TrackedDocument *filedBy = nullptr; + for (const TrackedDocument *doc : flight->m_documents) + { + if ((doc->m_kind != AircraftReport::FlightPlan) + && (doc->m_kind != AircraftReport::Clearance)) { + continue; + } + if (!filedBy || (doc->m_received > filedBy->m_received)) { + filedBy = doc; + } + } + if (!filedBy) { + continue; + } + + TrackedFlight::FiledRoute& route = (filedBy->m_kind == AircraftReport::Clearance) + ? flight->m_clearance : flight->m_flightPlan; + route.m_waypoints = flight->m_route; + route.m_text = filedBy->m_text; + route.m_filed = flight->m_routeFiled.isValid() ? flight->m_routeFiled : filedBy->m_received; + routesRebuilt++; + } + if (routesRebuilt > 0) + { + m_dbDirty = true; // So they are written into the columns they now have + qDebug() << "AircraftTracker::loadDatabase: rebuilt" << routesRebuilt + << "filed routes from the route string and the document that filed it"; + } + + // What came back, against what is in the file. The two disagreeing is the only + // warning there will be that something is being dropped on the way in - and it is + // read back rather than counted as it goes, so a row the load skipped still shows. + { + int documentsRead = 0; + for (const TrackedAircraft *item : m_aircraft) + { + for (const TrackedFlight *flight : item->m_flights) { + documentsRead += flight->m_documents.size(); + } + } + qDebug() << "AircraftTracker::loadDatabase: read" << m_aircraft.size() << "of" + << tableCount("aircraft") << "aircraft," << flightsById.size() << "of" + << tableCount("flights") << "flights," << documentsRead << "of" + << tableCount("documents") << "documents," << m_atcLog.size() << "of" + << tableCount("atc") << "ATC messages"; + } + + // The all time figures belong to this database, so they arrive with it. Where there + // are none, an older preset's blob is imported once - see applySettings(). + loadCoverage(); + if (loadStatistics()) + { + m_statisticsLoaded = true; + // The stored seconds are what was listened to BEFORE now, and flush() reports the + // all time clock as that base plus the time since. Without setting the base here + // the loaded figure was overwritten on the very first flush by this session's own + // elapsed time - so the all time listening time read as the session's, and the all + // time messages per minute, a lifetime total of messages over a few seconds of + // clock, came out in the millions. + m_allTimeSecondsBase = m_statistics.m_allTime.m_seconds; + // From now rather than from the start of the session, because this also runs when + // the user switches to a different database part way through one, and that + // database has not been listening for the time already spent on the last + m_allTimeSince = QDateTime::currentDateTime(); + } + + // The ACARS archive stays on disk. It used to be read in whole here and then held for + // the life of the session, though nothing reads it back - the saves only ever append + // - so every launch paid for months of blocks in memory to no purpose. Not even + // counted here: COUNT(*) on a table this size is a scan of the whole thing. + + updateDatabaseSize(); + // The airframe count cannot be a running total, so it is counted from the table - + // and re-counted on every load, not only at startup, or switching databases would + // leave the previous one's figure beside this one's records + m_statistics.m_allTime.m_distinctAircraft = seenCount(); + m_statisticsDirty = true; + + // Fold weak flight-only aircraft into the identified airframe flying the + // same flight, and merge flights that are the same flight under its ACARS + // and ADS-B names (sessions saved before these existed live) + QList weakItems; + for (TrackedAircraft *a : m_aircraft) + { + if ((a->m_icao == 0) && a->m_registration.isEmpty()) { + weakItems.append(a); + } + } + for (TrackedAircraft *weak : weakItems) + { + TrackedAircraft *strong = nullptr; + for (TrackedAircraft *cand : m_aircraft) + { + if ((cand == weak) || ((cand->m_icao == 0) && cand->m_registration.isEmpty())) { + continue; + } + for (TrackedFlight *weakFlight : weak->m_flights) + { + if (weakFlight->m_flight.isEmpty()) { + continue; + } + for (TrackedFlight *candFlight : cand->m_flights) + { + // Exact name only: number-based matching is only safe + // within a single airframe + if ((candFlight->m_flight != weakFlight->m_flight) + && !candFlight->m_aliases.contains(weakFlight->m_flight)) { + continue; + } + // ... and only when the two were flying it at the same time. A + // callsign is flown again day after day, by a different airframe as + // often as by the same one, so a flight-only record from last week + // must not be folded into whichever aircraft flew that number most + // recently - which is what an unbounded name match did. + if (!weakFlight->m_lastSeen.isValid() || !candFlight->m_lastSeen.isValid() + || (std::abs(weakFlight->m_lastSeen.secsTo(candFlight->m_lastSeen)) + >= m_flightKeyValidSecs)) { + continue; + } + strong = cand; + break; + } + if (strong) { + break; + } + } + if (strong) { + break; + } + } + if (strong) { + absorbAircraft(strong, weak); + } + } + for (TrackedAircraft *item : m_aircraft) { + mergeLoadedFlights(item); + } + + // Prune aircraft not heard from within the removal timeout, then send the + // survivors to the Map and register their current flight names + removeOldAircraft(); + + m_loadingDatabase = false; + for (TrackedAircraft *item : m_aircraft) + { + if (item->m_currentFlight) + { + if (!item->m_currentFlight->m_flight.isEmpty()) + { + item->m_flight = item->m_currentFlight->m_flight; + m_byKey.insert("F" + item->m_flight, item); + } + for (const QString& alias : item->m_currentFlight->m_aliases) { + m_byKey.insert("F" + alias, item); + } + } + // Restored aircraft start inactive: they appear in the archive tables and are + // not drawn until data arrives for them again + item->m_active = false; + m_dirtyAircraft.insert(item); + for (TrackedFlight *flight : item->m_flights) { + m_dirtyFlights.insert(flight); + } + } + + // Anything restored that is already past its retention goes now + discardOldAircraft(); +} + + +// The key an airframe is counted under for all time. The ICAO address where there is +// one, because it is the only identifier that is genuinely the airframe; otherwise the +// registration, which is nearly as good, prefixed to keep the two namespaces apart. +// +// A flight number is deliberately NOT accepted. It identifies a service rather than an +// airframe, so counting one would both inflate the total and count the same aircraft +// again the day it is heard with an address - and an aircraft with neither an address +// nor a registration is rare, since ADS-B always carries the first and an ACARS block +// almost always carries the second. +static QString seenKey(quint32 icao, const QString& registration) +{ + if (icao) { + return QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); + } + if (!registration.isEmpty()) { + return "R:" + registration; + } + return QString(); +} + +int AircraftTracker::recordSeen(TrackedAircraft *item, int& countDelta) +{ + countDelta = 0; + const QString key = seenKey(item->m_icao, item->m_registration); + if (key.isEmpty()) { + return -1; // Nothing to recognise it by yet: ask again next report + } + if (!m_db) { + return -1; // Not written: ask again rather than counting it as done + } + + // A registration-only airframe is recorded under its registration and moves to its + // ICAO address the day one arrives. The old row has to move with it: left behind, a + // later session hears the same aircraft, inserts the address as a key it has never + // seen, and counts one airframe as two for ever. + // + // Written as "is there a stale registration row" rather than "did the key just + // change", because the change may have happened in an earlier session - the aircraft + // is restored already holding both identities, with nothing to say which of them it + // was last recorded under. + // + // The two rows are folded into one that spans both: the earlier first_seen and the + // later last_seen. That has to be done explicitly - an UPDATE that simply rekeys the + // row cannot merge, and one that rekeys onto an address that already has a row + // cannot even run. + if (item->m_icao && !item->m_registration.isEmpty()) + { + const QString stale = "R:" + item->m_registration; + qint64 staleFirst = 0; + qint64 staleLast = 0; + bool staleExists = false; + + sqlite3_stmt *moveStmt = nullptr; + if (sqlite3_prepare_v2(m_db, "SELECT first_seen, last_seen FROM seen WHERE key = ?", + -1, &moveStmt, nullptr) == SQLITE_OK) + { + bindText(moveStmt, 1, stale); + if (sqlite3_step(moveStmt) == SQLITE_ROW) + { + staleExists = true; + staleFirst = sqlite3_column_int64(moveStmt, 0); + staleLast = sqlite3_column_int64(moveStmt, 1); + } + } + sqlite3_finalize(moveStmt); + + if (staleExists) + { + // Whether the address already had a row of its own decides whether this is a + // rename or a merge - and a merge is one airframe fewer than the table held + bool addressExists = false; + moveStmt = nullptr; + if (sqlite3_prepare_v2(m_db, "SELECT 1 FROM seen WHERE key = ?", + -1, &moveStmt, nullptr) == SQLITE_OK) + { + bindText(moveStmt, 1, key); + addressExists = sqlite3_step(moveStmt) == SQLITE_ROW; + } + sqlite3_finalize(moveStmt); + + bool folded = false; + moveStmt = nullptr; + if (sqlite3_prepare_v2(m_db, "DELETE FROM seen WHERE key = ?", + -1, &moveStmt, nullptr) == SQLITE_OK) + { + bindText(moveStmt, 1, stale); + folded = sqlite3_step(moveStmt) == SQLITE_DONE; + } + sqlite3_finalize(moveStmt); + if (!folded) { + qWarning() << "AircraftTracker::recordSeen: could not fold" << stale + << "into" << key << ":" << sqlite3_errmsg(m_db); + } + + if (folded) + { + // Carry the span across. INSERT OR IGNORE below cannot widen a row it + // does not create, so where the address had one already this is the only + // thing that keeps the airframe's real first_seen. + moveStmt = nullptr; + if (sqlite3_prepare_v2(m_db, + "INSERT INTO seen (key, first_seen, last_seen) VALUES (?,?,?)" + " ON CONFLICT(key) DO UPDATE SET" + " first_seen = MIN(first_seen, excluded.first_seen)," + " last_seen = MAX(last_seen, excluded.last_seen)", + -1, &moveStmt, nullptr) == SQLITE_OK) + { + bindText(moveStmt, 1, key); + sqlite3_bind_int64(moveStmt, 2, staleFirst); + sqlite3_bind_int64(moveStmt, 3, staleLast); + if (sqlite3_step(moveStmt) != SQLITE_DONE) { + qWarning() << "AircraftTracker::recordSeen:" << sqlite3_errmsg(m_db); + } + } + sqlite3_finalize(moveStmt); + + // Two rows became one, so the all time count the caller holds is now one + // too high. It is only read from the table at startup, so without this it + // would stay wrong until the next run. + if (addressExists) { + countDelta--; + } + } + } + } + + const qint64 now = QDateTime::currentSecsSinceEpoch(); + sqlite3_stmt *stmt = nullptr; + + // INSERT OR IGNORE, then ask how many rows changed: exactly 1 when this airframe + // was new and 0 when it was already there, which is the answer the count needs. An + // upsert would report 1 either way, and last_insert_rowid cannot be used to tell + // them apart because the aircraft and flight inserts move it too + if (sqlite3_prepare_v2(m_db, + "INSERT OR IGNORE INTO seen (key, first_seen, last_seen) VALUES (?,?,?)", + -1, &stmt, nullptr) != SQLITE_OK) + { + qWarning() << "AircraftTracker::recordSeen:" << sqlite3_errmsg(m_db); + return -1; // A failure is not "already counted": try again + } + bindText(stmt, 1, key); + sqlite3_bind_int64(stmt, 2, now); + sqlite3_bind_int64(stmt, 3, now); + + bool inserted = false; + bool stepped = false; + if (sqlite3_step(stmt) == SQLITE_DONE) + { + stepped = true; + inserted = sqlite3_changes(m_db) > 0; + } + else + { + qWarning() << "AircraftTracker::recordSeen:" << sqlite3_errmsg(m_db); + } + sqlite3_finalize(stmt); + if (!stepped) { + return -1; // Nothing was written, so nothing has been counted + } + + if (!inserted) + { + // Heard before, so only the last seen time moves + stmt = nullptr; + if (sqlite3_prepare_v2(m_db, "UPDATE seen SET last_seen = ? WHERE key = ?", + -1, &stmt, nullptr) == SQLITE_OK) + { + sqlite3_bind_int64(stmt, 1, now); + bindText(stmt, 2, key); + sqlite3_step(stmt); + } + sqlite3_finalize(stmt); + } + if (inserted) { + countDelta++; + } + return 1; +} + +// How many different airframes have ever been heard +// How many rows a table holds. Used to compare what is stored against what is in +// memory, which is the only way to notice that a save is about to destroy something. +int AircraftTracker::tableCount(const char *table) +{ + if (!m_db) { + return 0; + } + const QString sql = QString("SELECT COUNT(*) FROM %1").arg(table); + sqlite3_stmt *stmt = nullptr; + int count = 0; + if (sqlite3_prepare_v2(m_db, sql.toUtf8().constData(), -1, &stmt, nullptr) == SQLITE_OK) + { + if (sqlite3_step(stmt) == SQLITE_ROW) { + count = sqlite3_column_int(stmt, 0); + } + } + sqlite3_finalize(stmt); + return count; +} + +int AircraftTracker::seenCount() +{ + if (!m_db) { + return 0; + } + sqlite3_stmt *stmt = nullptr; + int count = 0; + if (sqlite3_prepare_v2(m_db, "SELECT COUNT(*) FROM seen", -1, &stmt, nullptr) == SQLITE_OK) + { + if (sqlite3_step(stmt) == SQLITE_ROW) { + count = sqlite3_column_int(stmt, 0); + } + } + sqlite3_finalize(stmt); + return count; +} + +// Only from an explicit "reset all time statistics", never from clearing the session +void AircraftTracker::resetSeen() +{ + if (m_db) { + execSQL(m_db, "DELETE FROM seen"); + } +} diff --git a/plugins/feature/aircraft/aircraftgui.cpp b/plugins/feature/aircraft/aircraftgui.cpp index 582c72664..e5b41c26e 100644 --- a/plugins/feature/aircraft/aircraftgui.cpp +++ b/plugins/feature/aircraft/aircraftgui.cpp @@ -1,1979 +1,3293 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef QT_TEXTTOSPEECH_FOUND -#include -#endif - -#include "feature/featureuiset.h" -#include "feature/featurewebapiutils.h" -#include "gui/basicfeaturesettingsdialog.h" -#include "gui/dialogpositioner.h" -#include "maincore.h" -#include "util/osndb.h" - -#include "ui_aircraftgui.h" -#include "aircraft.h" -#include "aircraftgui.h" -#include "aircraftnotificationdialog.h" -#include "aircraftsettingsdialog.h" - -AircraftGUI* AircraftGUI::create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature) -{ - AircraftGUI* gui = new AircraftGUI(pluginAPI, featureUISet, feature); - return gui; -} - -void AircraftGUI::destroy() -{ - delete this; -} - -void AircraftGUI::resetToDefaults() -{ - m_settings.resetToDefaults(); - displaySettings(); - applySettings(true); -} - -// The three splitters travel together in one blob, each holding its own -// QSplitter::saveState(). A version leads it so that adding a fourth later can be read -// by an older build without it making nonsense of the ones it does understand. -QByteArray AircraftGUI::saveSplitters() const -{ - QByteArray data; - QDataStream stream(&data, QIODevice::WriteOnly); - stream.setVersion(QDataStream::Qt_5_15); - - stream << (quint32) 1; - stream << ui->splitter->saveState() - << ui->aircraftSplitter->saveState() - << ui->weatherSplitter->saveState(); - return data; -} - -void AircraftGUI::restoreSplitters(const QByteArray& data) -{ - if (data.isEmpty()) { - return; - } - QDataStream stream(data); - stream.setVersion(QDataStream::Qt_5_15); - - quint32 version = 0; - stream >> version; - if ((version != 1) || (stream.status() != QDataStream::Ok)) { - return; // Written by something else, or truncated: leave the defaults - } - - QByteArray outer, aircraft, weather; - stream >> outer >> aircraft >> weather; - if (stream.status() != QDataStream::Ok) { - return; - } - ui->splitter->restoreState(outer); - ui->aircraftSplitter->restoreState(aircraft); - ui->weatherSplitter->restoreState(weather); -} - -QByteArray AircraftGUI::serialize() const -{ - // The records live in the tracker, which is where they are set. serialize() is const - // and is the actual persistence path for a feature, so take a copy of the settings - // and drop the current blob into that. - AircraftSettings settings = m_settings; - settings.m_statistics = m_statisticsBlob; - settings.m_splitterStates = saveSplitters(); - return settings.serialize(); -} - -bool AircraftGUI::deserialize(const QByteArray& data) -{ - if (m_settings.deserialize(data)) - { - // Hold on to the records that were just read: serialize() writes this back, and - // until the tracker sends its first update there is nothing else to write - m_statisticsBlob = m_settings.m_statistics; - m_feature->setWorkspaceIndex(m_settings.m_workspaceIndex); - displaySettings(); - applySettings(true); - return true; - } - else - { - resetToDefaults(); - return false; - } -} - -void AircraftGUI::setWorkspaceIndex(int index) -{ - m_settings.m_workspaceIndex = index; - m_feature->setWorkspaceIndex(index); - m_settingsKeys.append("workspaceIndex"); - applySettings(); -} - -bool AircraftGUI::handleMessage(const Message& message) -{ - if (Aircraft::MsgConfigureAircraft::match(message)) - { - const Aircraft::MsgConfigureAircraft& cfg = (Aircraft::MsgConfigureAircraft&) message; - - if (cfg.getForce()) { - m_settings = cfg.getSettings(); - } else { - m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings()); - } - - blockApplySettings(true); - displaySettings(); - blockApplySettings(false); - - return true; - } - - return false; -} - -void AircraftGUI::handleInputMessages() -{ - Message* message; - - while ((message = getInputMessageQueue()->pop())) - { - if (handleMessage(*message)) { - delete message; - } - } -} - -void AircraftGUI::onWidgetRolled(QWidget* widget, bool rollDown) -{ - (void) widget; - (void) rollDown; - - RollupContents *rollupContents = getRollupContents(); - - rollupContents->saveState(m_rollupState); - applySettings(); -} - -AircraftTracker *AircraftGUI::tracker() const -{ - return m_aircraft->getTracker(); -} - -AircraftGUI::AircraftGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent) : - FeatureGUI(parent), - ui(new Ui::AircraftGUI), - m_pluginAPI(pluginAPI), - m_featureUISet(featureUISet), - m_doApplySettings(true) -{ - m_feature = feature; - setAttribute(Qt::WA_DeleteOnClose, true); - m_helpURL = "plugins/feature/aircraft/readme.md"; - RollupContents *rollupContents = getRollupContents(); - ui->setupUi(rollupContents); - rollupContents->arrangeRollups(); - connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); - - m_aircraft = reinterpret_cast(feature); - m_aircraft->setMessageQueueToGUI(&m_inputMessageQueue); - - connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); - connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - - AircraftInformation::init(); - - // Aircraft and flights tables: model/view, with the data coming as - // snapshots from the tracker thread - m_aircraftModel = new AircraftTableModel(this); - m_aircraftProxy = new ActiveFilterProxy(true, this); - m_oldAircraftProxy = new ActiveFilterProxy(false, this); - m_flightModel = new FlightTableModel(this); - m_flightProxy = new ActiveFilterProxy(true, this); - m_oldFlightProxy = new ActiveFilterProxy(false, this); - - for (auto pair : { qMakePair(ui->aircraft, m_aircraftProxy), qMakePair(ui->oldAircraft, m_oldAircraftProxy) }) - { - pair.second->setSourceModel(m_aircraftModel); - pair.second->setSortRole(Qt::DisplayRole); - pair.first->setModel(pair.second); - pair.first->setSortingEnabled(true); - pair.first->horizontalHeader()->setSectionsMovable(true); - pair.first->setIconSize(QSize(85, 20)); - showRowNumbers(pair.first); - connect(pair.first->selectionModel(), &QItemSelectionModel::selectionChanged, - this, &AircraftGUI::aircraftSelectionChanged); - } - - for (auto pair : { qMakePair(ui->flights, m_flightProxy), qMakePair(ui->oldFlights, m_oldFlightProxy) }) - { - pair.second->setSourceModel(m_flightModel); - pair.first->setModel(pair.second); - pair.first->setSortingEnabled(true); - pair.first->horizontalHeader()->setSectionsMovable(true); - showRowNumbers(pair.first); - connect(pair.first->selectionModel(), &QItemSelectionModel::selectionChanged, - this, &AircraftGUI::flightSelectionChanged); - } - - setDefaultColumnWidths(); - - // Documents and ATC log tables - ui->documents->setSortingEnabled(true); - ui->documents->horizontalHeader()->setSectionsMovable(true); - ui->documents->horizontalHeader()->setStretchLastSection(true); - connect(ui->documents, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::documentSelectionChanged); - connect(ui->weather, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::weatherSelectionChanged); - ui->weather->setSortingEnabled(true); - ui->weather->horizontalHeader()->setSectionsMovable(true); - ui->weather->horizontalHeader()->setStretchLastSection(true); - ui->weather->verticalHeader()->setVisible(false); - connect(ui->pastFlights, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::pastFlightSelectionChanged); - connect(ui->find, &QLineEdit::returnPressed, this, &AircraftGUI::on_find_returnPressed); - m_findTimer.setSingleShot(true); - connect(&m_findTimer, &QTimer::timeout, this, [this]() { - ui->find->setStyleSheet(findFrom(-1, ui->find->text()) ? "" : "QLineEdit { color: red; }"); - }); - - // A row found while the keyboard stays in the Find box is a selection in a view - // that does not have focus, which most styles draw in a washed out grey. Make the - // unfocused highlight the same as the focused one so the match is actually visible. - for (QTableView *view : {ui->aircraft, ui->oldAircraft, ui->flights, ui->oldFlights}) - { - QPalette palette = view->palette(); - palette.setColor(QPalette::Inactive, QPalette::Highlight, - palette.color(QPalette::Active, QPalette::Highlight)); - palette.setColor(QPalette::Inactive, QPalette::HighlightedText, - palette.color(QPalette::Active, QPalette::HighlightedText)); - view->setPalette(palette); - } - connect(ui->find, &QLineEdit::textChanged, this, &AircraftGUI::on_find_textChanged); - // Changing which column to look in searches again from the top - connect(ui->findColumn, QOverload::of(&QComboBox::currentIndexChanged), this, - [this](int) { on_find_textChanged(ui->find->text()); }); - ui->atcMessages->setSortingEnabled(true); - ui->atcMessages->horizontalHeader()->setSectionsMovable(true); - ui->atcMessages->horizontalHeader()->setStretchLastSection(true); - - // Selecting an aircraft or a flight filters the Documents and ATC tables - connect(ui->aircraftTabs, &QTabWidget::currentChanged, this, [this](int) { - QWidget *tab = ui->aircraftTabs->currentWidget(); - - applyMessageFilter(); - - // Only a tab that IS one of the selection tables may re-derive the selection - // from it. Weather is not one, and falling through to the aircraft table there - // used to silently discard a flight selection - which empties Documents and - // ATC, since with nothing selected they show nothing. - if ((tab == ui->flightsTab) || (tab == ui->oldFlightsTab)) { - flightSelectionChanged(); - } else if ((tab == ui->aircraftTab) || (tab == ui->oldAircraftTab)) { - aircraftSelectionChanged(); - } - }); - - // Context menus: copy cell contents or find the aircraft on the Map - for (auto pair : { qMakePair((QTableView *) ui->aircraft, true), qMakePair((QTableView *) ui->oldAircraft, true), - qMakePair((QTableView *) ui->flights, false), qMakePair((QTableView *) ui->oldFlights, false) }) - { - QTableView *view = pair.first; - bool isAircraft = pair.second; - view->setContextMenuPolicy(Qt::CustomContextMenu); - connect(view, &QTableView::customContextMenuRequested, this, - [this, view, isAircraft](QPoint pos) { viewContextMenu(view, isAircraft, pos); }); - } - for (QTableWidget *table : {ui->documents, ui->atcMessages}) - { - table->setContextMenuPolicy(Qt::CustomContextMenu); - connect(table, &QTableWidget::customContextMenuRequested, this, - [this, table](QPoint pos) { tableContextMenu(table, pos); }); - } - - // Aircraft photos from planespotters.net, shown for the selected aircraft - connect(&m_planeSpotters, &PlaneSpotters::aircraftPhoto, this, &AircraftGUI::aircraftPhoto); - connect(ui->photo, &ClickableLabel::clicked, this, &AircraftGUI::photoClicked); - ui->photoHeader->setVisible(false); - ui->photoFlag->setVisible(false); - ui->photo->setVisible(false); - ui->flightDetails->setVisible(false); - - // Charts - plotChart(); - plotProfileChart(); - - // Reuse the ADS-B demodulator's control tower icon (its resources are - // process wide); the "ATC" text shows if it isn't available - QIcon towerIcon(":/icons/controltower.png"); - if (!towerIcon.isNull()) { - ui->atcLabels->setIcon(towerIcon); - } - - // Column select menu - m_columnMenu = new QMenu(ui->aircraft); - for (int i = 0; i < AIRCRAFT_COLUMNS; i++) - { - QString text = m_aircraftModel->headerData(i, Qt::Horizontal).toString(); - m_columnMenu->addAction(createCheckableItem(text, i, true, SLOT(aircraftColumnSelectMenuChecked()))); - } - ui->aircraft->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); - connect(ui->aircraft->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), SLOT(aircraftColumnSelectMenu(QPoint))); - connect(ui->aircraft->horizontalHeader(), SIGNAL(sectionMoved(int, int, int)), SLOT(aircraft_sectionMoved(int, int, int))); - connect(ui->aircraft->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(aircraft_sectionResized(int, int, int))); - - m_flightColumnMenu = new QMenu(ui->flights); - for (int i = 0; i < FLIGHT_COLUMNS; i++) - { - QString text = m_flightModel->headerData(i, Qt::Horizontal).toString(); - m_flightColumnMenu->addAction(createCheckableItem(text, i, true, SLOT(flightColumnSelectMenuChecked()))); - } - ui->flights->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); - connect(ui->flights->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), SLOT(flightColumnSelectMenu(QPoint))); - connect(ui->flights->horizontalHeader(), SIGNAL(sectionMoved(int, int, int)), SLOT(flights_sectionMoved(int, int, int))); - connect(ui->flights->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(flights_sectionResized(int, int, int))); - - // The tracker does all the processing on its own thread; these queued - // connections deliver its batched snapshots - AircraftTracker *t = tracker(); - connect(t, &AircraftTracker::aircraftUpdated, this, &AircraftGUI::trackerAircraftUpdated); - connect(t, &AircraftTracker::aircraftRemoved, this, &AircraftGUI::trackerAircraftRemoved); - connect(t, &AircraftTracker::flightsUpdated, this, &AircraftGUI::trackerFlightsUpdated); - connect(t, &AircraftTracker::flightsRemoved, this, &AircraftGUI::trackerFlightsRemoved); - connect(t, &AircraftTracker::documentsAdded, this, &AircraftGUI::trackerDocumentsAdded); - connect(t, &AircraftTracker::atcMessages, this, &AircraftGUI::trackerAtcMessages); - connect(t, &AircraftTracker::weatherReports, this, &AircraftGUI::trackerWeatherReports); - connect(t, &AircraftTracker::profileUpdated, this, &AircraftGUI::trackerProfileUpdated); - connect(t, &AircraftTracker::messageRates, this, &AircraftGUI::trackerMessageRates); - connect(t, &AircraftTracker::statisticsUpdated, this, &AircraftGUI::trackerStatistics); - connect(t, &AircraftTracker::speechNotification, this, &AircraftGUI::trackerSpeechNotification); - connect(t, &AircraftTracker::allCleared, this, &AircraftGUI::trackerAllCleared); - connect(t, &AircraftTracker::databaseFilenameReverted, - this, &AircraftGUI::trackerDatabaseFilenameReverted); - - m_settings.setRollupState(&m_rollupState); - - displaySettings(); - applySettings(true); - makeUIConnections(); - m_resizer.enableChildMouseTracking(); - - // Get the current state - the tracker may have restored a session before - // this GUI connected - t->getInputMessageQueue()->push(AircraftTracker::MsgResync::create()); -} - -AircraftGUI::~AircraftGUI() -{ - delete ui; -} - -void AircraftGUI::makeUIConnections() -{ - QObject::connect( - ui->deleteAircraft, - &QToolButton::clicked, - this, - &AircraftGUI::on_deleteAircraft_clicked - ); - QObject::connect( - ui->settings, - &QToolButton::clicked, - this, - &AircraftGUI::on_settings_clicked - ); - QObject::connect( - ui->notifications, - &QToolButton::clicked, - this, - &AircraftGUI::on_notifications_clicked - ); - QObject::connect( - ui->atcLabels, - &ButtonSwitch::clicked, - this, - &AircraftGUI::on_atcLabels_clicked - ); - // The statistics sit to the right of the tables. Give the tables the bulk of the - // width by default - the statistics are two narrow columns and a date - while still - // letting the handle be dragged. - ui->aircraftSplitter->setStretchFactor(0, 4); - ui->aircraftSplitter->setStretchFactor(1, 1); - - QObject::connect(ui->stats, &ButtonSwitch::clicked, this, &AircraftGUI::on_stats_clicked); - ui->stats->setContextMenuPolicy(Qt::CustomContextMenu); - QObject::connect(ui->stats, &QWidget::customContextMenuRequested, this, &AircraftGUI::statsContextMenu); - QObject::connect(ui->displayChart, &ButtonSwitch::clicked, this, &AircraftGUI::on_displayChart_clicked); - ui->displayChart->setContextMenuPolicy(Qt::CustomContextMenu); - QObject::connect(ui->displayChart, &QWidget::customContextMenuRequested, this, &AircraftGUI::chartContextMenu); - - // Nothing is selected yet, so the two history tabs have nothing to be about. They - // are visible in the .ui so that they can be seen while it is being edited. - updateHistoryTables(); -} - -void AircraftGUI::blockApplySettings(bool block) -{ - m_doApplySettings = !block; -} - -void AircraftGUI::applySettings(bool force) -{ - if (m_doApplySettings) - { - Aircraft::MsgConfigureAircraft* message = Aircraft::MsgConfigureAircraft::create(m_settings, m_settingsKeys, force); - m_aircraft->getInputMessageQueue()->push(message); - } - - m_settingsKeys.clear(); -} - -// Default column widths from representative content -// Row numbers down the left of a table. The numbers themselves come from -// ActiveFilterProxy::headerData(), which counts displayed position rather than source -// row so that the top row is 1 whatever the sort order. -// -// The header is left non-clickable: clicking a vertical section selects the row, which -// the table already does when a cell is clicked, and making it look interactive invites -// the assumption that it sorts. -void AircraftGUI::showRowNumbers(QTableView *table) -{ - QHeaderView *header = table->verticalHeader(); - header->setVisible(true); - header->setSectionsClickable(false); - header->setHighlightSections(false); - // The resize mode is deliberately left alone. Setting ResizeToContents here - which - // seemed reasonable, since the rows carry airline logos of differing heights - makes - // the header re-measure EVERY row whenever anything in the table changes. On a table - // holding a session's worth of restored aircraft, each measurement pulls in that - // row's logo and sideview images, and start up went from seconds to over a minute of - // a blocked GUI. Row numbering does not need it: the view sizes its own rows exactly - // as it did when the header was hidden. -} - -// The Statistics tab. Rebuilt wholesale on each update - it is a couple of dozen rows -// arriving a few times a second at most, and a table that small is cheaper to refill -// than to diff. -// -// Every figure is given twice, for this session and for all time, because the pair is -// what makes either readable: 210 km on its own says nothing, 210 km against an all time -// best of 340 km says the band is poor today. The session columns come first, as the -// ones that change while you watch. -void AircraftGUI::trackerStatistics(const AircraftStatistics& statistics) -{ - m_statisticsBlob = AircraftTracker::serializeStatistics(statistics); - - // Sized by the enum, so adding a protocol fails to compile here rather than - // reading past the end of the array on the very next line - static const char *protocolNames[AircraftReport::ProtocolCount] = - { "ADS-B", "ACARS", "VDL-2", "HFDL", "Aero" }; - - QTableWidget *table = ui->statistics; - const bool first = (table->columnCount() == 0); - if (first) - { - table->setColumnCount(5); - table->setHorizontalHeaderLabels( - { "Statistic", "Session", "Session set by", "All time", "All time set by" }); - table->horizontalHeader()->setSectionsMovable(true); - table->verticalHeader()->setVisible(false); - } - - QList rows; - - auto record = [](const AircraftStatistics::Record& r, const QString& suffix) - { - if (!r.m_valid) { - return QStringList{ QString(), QString() }; - } - return QStringList{ - QString("%1 %2").arg(r.m_value, 0, 'f', 1).arg(suffix), - QString("%1, %2").arg(r.m_aircraft, - r.m_when.isValid() ? r.m_when.toString("yyyy-MM-dd hh:mm") : QString("?")) - }; - }; - - // Interleaves a statistic computed for each scope into one row: label, then the - // session's value and detail, then all time's - auto both = [&rows](const QString& label, const QStringList& session, - const QStringList& allTime) - { - rows.append(QStringList{ label } + session + allTime); - }; - - const AircraftStatistics::Scope& ses = statistics.m_session; - const AircraftStatistics::Scope& all = statistics.m_allTime; - - // Furthest per protocol. They are wildly different by nature - line of sight VHF - // against HF skywave against a satellite downlink - so one combined figure would - // say nothing useful. - for (int i = 0; i < AircraftReport::ProtocolCount; i++) - { - both(QString("Maximum range, %1").arg(protocolNames[i]), - record(ses.m_maxRange[i], "km"), record(all.m_maxRange[i], "km")); - } - - both("Fastest ground speed", record(ses.m_fastest, "kn"), record(all.m_fastest, "kn")); - both("Highest altitude", record(ses.m_highest, "ft"), record(all.m_highest, "ft")); - - auto concurrent = [](const AircraftStatistics::Scope& scope) - { - return QStringList{ QString::number(scope.m_maxConcurrent), - scope.m_maxConcurrentWhen.isValid() - ? scope.m_maxConcurrentWhen.toString("yyyy-MM-dd hh:mm") : QString() }; - }; - both(QString("Most aircraft at once (%1 min)").arg(AircraftStatistics::ConcurrentWindowMins), - concurrent(ses), concurrent(all)); - - both("Aircraft heard", - QStringList{ QString::number(ses.m_distinctAircraft), QString() }, - QStringList{ QString::number(all.m_distinctAircraft), QString() }); - both("Total messages", - QStringList{ QString::number(ses.m_totalMessages), QString() }, - QStringList{ QString::number(all.m_totalMessages), QString() }); - - // The share is of that scope's own total, so a protocol that has been quiet today - // shows its reduced share against its long run one rather than against nothing - auto messages = [](const AircraftStatistics::Scope& scope, int protocol) - { - const quint64 n = scope.m_messagesByProtocol[protocol]; - QString share; - if (scope.m_totalMessages > 0) { - share = QString("%1%").arg(100.0 * n / scope.m_totalMessages, 0, 'f', 1); - } - return QStringList{ QString::number(n), share }; - }; - for (int i = 0; i < AircraftReport::ProtocolCount; i++) { - both(QString("Messages, %1").arg(protocolNames[i]), messages(ses, i), messages(all, i)); - } - - auto elapsed = [](qint64 secs, const QDateTime& since) - { - if (secs <= 0) { - return QStringList{ QString(), QString() }; - } - return QStringList{ QString("%1h %2m").arg(secs / 3600).arg((secs % 3600) / 60), - since.isValid() ? QString("since %1").arg(since.toString("yyyy-MM-dd hh:mm")) - : QString() }; - }; - both("Listening time", elapsed(ses.m_seconds, statistics.m_sessionStart), - elapsed(all.m_seconds, statistics.m_firstStart)); - - auto perMinute = [](const AircraftStatistics::Scope& scope) - { - if (scope.m_seconds <= 0) { - return QStringList{ QString(), QString() }; - } - return QStringList{ - QString("%1").arg(scope.m_totalMessages * 60.0 / scope.m_seconds, 0, 'f', 1), - QString() }; - }; - both("Messages per minute", perMinute(ses), perMinute(all)); - - table->setRowCount(rows.size()); - for (int row = 0; row < rows.size(); row++) - { - for (int col = 0; col < table->columnCount(); col++) - { - QTableWidgetItem *item = table->item(row, col); - if (!item) - { - item = new QTableWidgetItem(); - table->setItem(row, col, item); - } - item->setText(rows[row].value(col)); - } - } - if (first) { - table->resizeColumnsToContents(); - } -} - -void AircraftGUI::setDefaultColumnWidths() -{ - - const QFontMetrics fm(font()); - auto width = [&fm](const char *sample) { return fm.horizontalAdvance(sample) + 12; }; - - ui->aircraft->setColumnWidth(AircraftTableModel::COL_ICAO, width("ABCDEF")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_REG, width("G-ABCDEF")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_TYPE, width("B77W")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_FLIGHT, width("RYR33KQW")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_AIRLINE, std::max(90, width("Airline name"))); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_SIDEVIEW, 90); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_COUNTRY, 45); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_LATITUDE, width("-90.00000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_LONGITUDE, width("-180.00000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_DISTANCE, width("Dist (km)")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_ALTITUDE, width("40000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_HEADING, width("360")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_SPEED, width("500")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_PROTOCOLS, width("ACARS 131.725; HFDL 10.081")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_MESSAGES, width("10000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_LAST_SEEN, width("12/12/2026 12:00:00")); - - ui->flights->setColumnWidth(FlightTableModel::COL_FLIGHT, width("RYR33KQW")); - ui->flights->setColumnWidth(FlightTableModel::COL_REG, width("G-ABCDEF")); - ui->flights->setColumnWidth(FlightTableModel::COL_FROM, width("EGKK")); - ui->flights->setColumnWidth(FlightTableModel::COL_TO, width("EGKK")); - ui->flights->setColumnWidth(FlightTableModel::COL_FIRST_SEEN, width("12/12/2026 12:00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_LAST_SEEN, width("12/12/2026 12:00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_DOCS, width("Docs")); - ui->flights->setColumnWidth(FlightTableModel::COL_PROTOCOLS, width("ACARS 131.725; HFDL 10.081")); - - // The archive views show the same columns, so give them the same widths - for (auto pair : { qMakePair((QTableView *) ui->aircraft, (QTableView *) ui->oldAircraft), - qMakePair((QTableView *) ui->flights, (QTableView *) ui->oldFlights) }) - { - for (int col = 0; col < pair.first->model()->columnCount(); col++) { - pair.second->setColumnWidth(col, pair.first->columnWidth(col)); - } - } -} - -void AircraftGUI::displaySettings() -{ - setTitleColor(m_settings.m_rgbColor); - setWindowTitle(m_settings.m_title); - setTitle(m_settings.m_title); - blockApplySettings(true); - - ui->atcLabels->setChecked(m_settings.m_atcLabels); - ui->stats->setChecked(m_settings.m_displayStatistics); - ui->statistics->setVisible(m_settings.m_displayStatistics); - ui->displayChart->setChecked(m_settings.m_displayChart); - ui->chart->setVisible(m_settings.m_displayChart); - - // Order and size columns - QHeaderView *header = ui->aircraft->horizontalHeader(); - - for (int i = 0; i < AIRCRAFT_COLUMNS; i++) - { - bool hidden = m_settings.m_columnSizes[i] == 0; - header->setSectionHidden(i, hidden); - if (i < m_columnMenu->actions().size()) { - m_columnMenu->actions().at(i)->setChecked(!hidden); - } - if (m_settings.m_columnSizes[i] > 0) { - ui->aircraft->setColumnWidth(i, m_settings.m_columnSizes[i]); - } - header->moveSection(header->visualIndex(i), m_settings.m_columnIndexes[i]); - } - - QHeaderView *flightHeader = ui->flights->horizontalHeader(); - for (int i = 0; i < FLIGHT_COLUMNS; i++) - { - bool hidden = m_settings.m_flightColumnSizes[i] == 0; - flightHeader->setSectionHidden(i, hidden); - if (i < m_flightColumnMenu->actions().size()) { - m_flightColumnMenu->actions().at(i)->setChecked(!hidden); - } - if (m_settings.m_flightColumnSizes[i] > 0) { - ui->flights->setColumnWidth(i, m_settings.m_flightColumnSizes[i]); - } - flightHeader->moveSection(flightHeader->visualIndex(i), m_settings.m_flightColumnIndexes[i]); - } - - // After the column work, so the tables are their final shape before the splitters - // are asked to divide the space between them - restoreSplitters(m_settings.m_splitterStates); - - getRollupContents()->restoreState(m_rollupState); - blockApplySettings(false); - getRollupContents()->arrangeRollups(); -} - -void AircraftGUI::onMenuDialogCalled(const QPoint &p) -{ - if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings) - { - BasicFeatureSettingsDialog dialog(this); - dialog.setTitle(m_settings.m_title); - dialog.setUseReverseAPI(m_settings.m_useReverseAPI); - dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); - dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); - dialog.setReverseAPIFeatureSetIndex(m_settings.m_reverseAPIFeatureSetIndex); - dialog.setReverseAPIFeatureIndex(m_settings.m_reverseAPIFeatureIndex); - dialog.setDefaultTitle(m_displayedName); - - dialog.move(p); - new DialogPositioner(&dialog, false); - dialog.exec(); - - m_settings.m_title = dialog.getTitle(); - m_settings.m_useReverseAPI = dialog.useReverseAPI(); - m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); - m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); - m_settings.m_reverseAPIFeatureSetIndex = dialog.getReverseAPIFeatureSetIndex(); - m_settings.m_reverseAPIFeatureIndex = dialog.getReverseAPIFeatureIndex(); - - setTitle(m_settings.m_title); - setTitleColor(m_settings.m_rgbColor); - - m_settingsKeys.append("title"); - m_settingsKeys.append("useReverseAPI"); - m_settingsKeys.append("reverseAPIAddress"); - m_settingsKeys.append("reverseAPIPort"); - m_settingsKeys.append("reverseAPIFeatureSetIndex"); - m_settingsKeys.append("reverseAPIFeatureIndex"); - - applySettings(); - } - - resetContextMenuType(); -} - -// ---- Snapshots from the tracker ---- - -void AircraftGUI::trackerAircraftUpdated(const QList& aircraft) -{ - m_aircraftModel->upsert(aircraft); - - // Keep the selection-derived state fresh - for (const AircraftDisplay& d : aircraft) - { - if (d.m_id == m_selectedAircraftId) - { - m_selectedRegistration = d.m_registration; - m_selectedIcao = d.m_icao; - } - } -} - -void AircraftGUI::trackerAircraftRemoved(const QList& ids) -{ - m_aircraftModel->remove(ids); - if (ids.contains(m_selectedAircraftId)) { - m_selectedAircraftId = 0; - } -} - -void AircraftGUI::trackerFlightsUpdated(const QList& flights) -{ - m_flightModel->upsert(flights); - // A new flight for the aircraft on screen, or a new aircraft on the flight on screen, - // has to show up without the user clicking away and back - if ((m_selectedAircraftId != 0) || !m_selectedFlightNumber.isEmpty()) { - updateHistoryTables(); - } -} - -void AircraftGUI::trackerFlightsRemoved(const QList& ids) -{ - m_flightModel->remove(ids); - if (ids.contains(m_selectedFlightId)) { - m_selectedFlightId = 0; - } -} - -void AircraftGUI::trackerDocumentsAdded(const QList& documents) -{ - ui->documents->setSortingEnabled(false); - for (const DocumentEvent& e : documents) - { - int row = ui->documents->rowCount(); - ui->documents->setRowCount(row + 1); - QTableWidgetItem *timeItem = new QTableWidgetItem(); - timeItem->setData(Qt::DisplayRole, e.m_received); - timeItem->setData(Qt::UserRole, e.m_text); - timeItem->setData(Qt::UserRole + 1, (qulonglong) e.m_aircraftId); - timeItem->setData(Qt::UserRole + 2, (qulonglong) e.m_flightId); - timeItem->setData(Qt::UserRole + 3, e.m_mapName); - ui->documents->setItem(row, DOCUMENT_COL_TIME, timeItem); - ui->documents->setItem(row, DOCUMENT_COL_FLIGHT, new QTableWidgetItem(e.m_flight)); - ui->documents->setItem(row, DOCUMENT_COL_REG, new QTableWidgetItem(e.m_reg)); - ui->documents->setItem(row, DOCUMENT_COL_TYPE, new QTableWidgetItem(e.m_kind)); - ui->documents->setItem(row, DOCUMENT_COL_TITLE, new QTableWidgetItem(e.m_title)); - } - // setSortingEnabled(true) sorts immediately, and a row's hidden flag belongs to the - // VIEW's row number rather than to the item, so it does not travel with the row. - // Hiding inside the loop above therefore left the flags on whichever rows the sort - // happened to move into those positions - documents vanishing or being replaced by - // unrelated ones, with nothing touched. - ui->documents->setSortingEnabled(true); - applyMessageFilter(); -} - -// Weather is about airports, so unlike the Documents and ATC tables it is not filtered -// by the selected aircraft - the aircraft that carried a METAR is incidental to it. -void AircraftGUI::trackerWeatherReports(const QList& reports) -{ - ui->weather->setSortingEnabled(false); - for (const WeatherEvent& e : reports) - { - int row = ui->weather->rowCount(); - ui->weather->setRowCount(row + 1); - - QTableWidgetItem *timeItem = new QTableWidgetItem(); - timeItem->setData(Qt::DisplayRole, e.m_received); - timeItem->setData(Qt::UserRole, e.m_text); // Read back by the detail pane - ui->weather->setItem(row, WEATHER_COL_TIME, timeItem); - ui->weather->setItem(row, WEATHER_COL_AIRPORT, new QTableWidgetItem(e.m_airport)); - ui->weather->setItem(row, WEATHER_COL_TYPE, new QTableWidgetItem(e.m_kind)); - ui->weather->setItem(row, WEATHER_COL_VIA, new QTableWidgetItem(e.m_from)); - QTableWidgetItem *reportItem = new QTableWidgetItem(e.m_summary); - reportItem->setToolTip(e.m_text); - ui->weather->setItem(row, WEATHER_COL_REPORT, reportItem); - } - ui->weather->setSortingEnabled(true); - ui->weather->scrollToBottom(); -} - -void AircraftGUI::weatherSelectionChanged() -{ - const QList selected = ui->weather->selectedItems(); - for (const auto *selItem : selected) - { - QTableWidgetItem *timeItem = ui->weather->item(selItem->row(), WEATHER_COL_TIME); - if (timeItem) - { - ui->weatherText->setPlainText(timeItem->data(Qt::UserRole).toString()); - return; - } - } - ui->weatherText->clear(); -} - -void AircraftGUI::trackerAtcMessages(const QList& messages) -{ - ui->atcMessages->setSortingEnabled(false); - for (const AtcEvent& e : messages) - { - int row = ui->atcMessages->rowCount(); - ui->atcMessages->setRowCount(row + 1); - QTableWidgetItem *timeItem = new QTableWidgetItem(); - timeItem->setData(Qt::DisplayRole, e.m_received); - timeItem->setData(Qt::UserRole + 1, (qulonglong) e.m_aircraftId); - timeItem->setData(Qt::UserRole + 2, (qulonglong) e.m_flightId); - timeItem->setData(Qt::UserRole + 3, e.m_mapName); - ui->atcMessages->setItem(row, ATC_COL_TIME, timeItem); - ui->atcMessages->setItem(row, ATC_COL_PROTOCOL, new QTableWidgetItem(e.m_protocol)); - ui->atcMessages->setItem(row, ATC_COL_DIR, - new QTableWidgetItem(QString("%1").arg(QChar(e.m_uplink ? 0x2191 : 0x2193)))); - ui->atcMessages->setItem(row, ATC_COL_FROM, new QTableWidgetItem(e.m_from)); - ui->atcMessages->setItem(row, ATC_COL_TO, new QTableWidgetItem(e.m_to)); - QTableWidgetItem *messageItem = new QTableWidgetItem(e.m_message); - messageItem->setToolTip(e.m_tooltip); - ui->atcMessages->setItem(row, ATC_COL_MESSAGE, messageItem); - } - // As in trackerDocumentsAdded: hide after the sort, not before - ui->atcMessages->setSortingEnabled(true); - applyMessageFilter(); - ui->atcMessages->scrollToBottom(); -} - -// The tracker could not move to the database that was asked for and has stayed with the -// one it had. These settings are the ones that get serialised, so they have to agree - -// otherwise the preset would name a file nothing is writing to. -void AircraftGUI::trackerDatabaseFilenameReverted(const QString& filename) -{ - if (m_settings.m_databaseFilename == filename) { - return; - } - m_settings.m_databaseFilename = filename; - m_settingsKeys.append("databaseFilename"); - applySettings(); -} - -void AircraftGUI::trackerAllCleared() -{ - m_aircraftModel->clear(); - m_flightModel->clear(); - ui->documents->setRowCount(0); - ui->documentText->clear(); - ui->atcMessages->setRowCount(0); - ui->weather->setRowCount(0); - ui->weatherText->clear(); - m_selectedAircraftId = 0; - m_selectedFlightId = 0; - m_selectedRegistration.clear(); - m_selectedIcao = 0; - plotProfileChart(); -} - -void AircraftGUI::trackerSpeechNotification(const QString& speech) -{ -#ifdef QT_TEXTTOSPEECH_FOUND - if (!m_speech) { - m_speech = new QTextToSpeech(this); - } - m_speech->say(speech); -#else - qWarning() << "AircraftGUI::trackerSpeechNotification: TextToSpeech not supported. Unable to say " << speech; -#endif -} - -// ---- Selection, filtering, photo and profile ---- - -// Whether a Documents/ATC row matches the selected aircraft (Aircraft tab -// active) or flight (Flights tab active); everything shows with no selection -bool AircraftGUI::messageRowVisible(const QTableWidgetItem *firstItem) const -{ - if (m_selectedFlightId) { - return firstItem->data(Qt::UserRole + 2).toULongLong() == m_selectedFlightId; - } - if (m_selectedAircraftId) { - return firstItem->data(Qt::UserRole + 1).toULongLong() == m_selectedAircraftId; - } - return false; -} - -void AircraftGUI::applyMessageFilter() -{ - for (QTableWidget *table : {ui->documents, ui->atcMessages}) - { - for (int row = 0; row < table->rowCount(); row++) { - table->setRowHidden(row, !messageRowVisible(table->item(row, 0))); - } - } -} - -// The archive tabs show what we are no longer hearing from -bool AircraftGUI::showingArchive() const -{ - QWidget *tab = ui->aircraftTabs->currentWidget(); - return (tab == ui->oldAircraftTab) || (tab == ui->oldFlightsTab); -} - -// What the aircraft database knows about this airframe, which does not change as it flies -void AircraftGUI::updateAircraftInfo(const QString& registration, quint32 icao) -{ - ui->aircraftInfo->setRowCount(0); - - QSharedPointer> byReg = OsnDB::getAircraftInformationByReg(); - QSharedPointer> byIcao = OsnDB::getAircraftInformation(); - const AircraftInformation *info = nullptr; - - if (byReg && byReg->contains(registration)) { - info = byReg->value(registration); - } else if (icao && byIcao && byIcao->contains((int) icao)) { - info = byIcao->value((int) icao); - } - if (!info) { - return; - } - - const QList> details = { - { "ICAO", QString("%1").arg(info->m_icao, 6, 16, QChar('0')).toUpper() }, - { "Registration", info->m_registration }, - { "Manufacturer", info->m_manufacturerName }, - { "Model", info->m_model }, - { "Type", info->m_type }, - { "Owner", info->m_owner }, - { "Operator", info->m_operator }, - { "Operator ICAO", info->m_operatorICAO }, - { "Registered", info->m_registered }, - }; - - for (const auto& detail : details) - { - if (detail.second.isEmpty()) { - continue; - } - int row = ui->aircraftInfo->rowCount(); - ui->aircraftInfo->setRowCount(row + 1); - ui->aircraftInfo->setItem(row, 0, new QTableWidgetItem(detail.first)); - ui->aircraftInfo->setItem(row, 1, new QTableWidgetItem(detail.second)); - } - - // The country is shown as its flag, as it is in the aircraft table - const QString flag = info->getFlag(); - if (!flag.isEmpty()) - { - int row = ui->aircraftInfo->rowCount(); - ui->aircraftInfo->setRowCount(row + 1); - ui->aircraftInfo->setItem(row, 0, new QTableWidgetItem("Country")); - - QTableWidgetItem *country = new QTableWidgetItem(); - QIcon *icon = AircraftInformation::getFlagIcon(flag); - if (icon) - { - country->setIcon(*icon); - country->setToolTip(flag); - } - else - { - country->setText(flag); - } - ui->aircraftInfo->setItem(row, 1, country); - } - ui->aircraftInfo->resizeColumnToContents(0); -} - -// The two history tabs, both built from the flight model rather than from the tracker. -// -// Every flight the feature knows about is already in that model, live and archived alike, -// and a FlightDisplay carries both the aircraft it was flown by and the flight number - -// so "which flights has this aircraft operated" and "which aircraft have operated this -// flight" are two readings of the same list, and neither needs the tracker to be asked. -// Highlight the next row matching what was typed, in whichever table is on show. -// -// A filter would hide everything else, and what is wanted here is to pick one aircraft -// out of a busy table while still seeing the rest of the traffic around it - so this -// selects and scrolls to the match instead. Enter steps on to the next one and wraps. -bool AircraftGUI::findFrom(int startRow, const QString& text) -{ - if (text.isEmpty()) { - return false; - } - - const bool flights = (ui->aircraftTabs->currentWidget() == ui->flightsTab) - || (ui->aircraftTabs->currentWidget() == ui->oldFlightsTab); - QTableView *view = flights ? (showingArchive() ? ui->oldFlights : ui->flights) - : (showingArchive() ? ui->oldAircraft : ui->aircraft); - ActiveFilterProxy *proxy = flights ? (showingArchive() ? m_oldFlightProxy : m_flightProxy) - : (showingArchive() ? m_oldAircraftProxy : m_aircraftProxy); - const int rows = proxy->rowCount(); - if (rows == 0) { - return false; - } - const int column = ui->findColumn->currentIndex(); - - for (int i = 0; i < rows; i++) - { - // Walk in the order the rows are displayed, so stepping through the matches - // follows the sort the user is looking at rather than the model's own order - const int row = (startRow + 1 + i) % rows; - const int sourceRow = proxy->mapToSource(proxy->index(row, 0)).row(); - - // Type and airline are not on either snapshot - they come from the database, - // which is what the table itself displays in those columns, so searching them - // matches what is on screen - auto typeFields = [](const QString& registration) { - QStringList f; - QSharedPointer> byReg - = OsnDB::getAircraftInformationByReg(); - if (byReg && byReg->contains(registration)) - { - const AircraftInformation *info = byReg->value(registration); - f << info->m_type << info->m_model << info->m_manufacturerName; - } - return f; - }; - - QStringList fields; - if (flights) - { - const FlightDisplay *d = m_flightModel->flightAt(sourceRow); - if (!d) { - continue; - } - // A flight has no ICAO address of its own - the airframe flying it does, - // and that is what the Aircraft table is for, so ICAO simply finds nothing - switch (column) - { - case FindIcao: break; - case FindReg: fields << d->m_reg; break; - case FindType: fields << typeFields(d->m_reg); break; - case FindFlight: fields << d->m_flight << d->m_aliases; break; - default: - fields << d->m_flight << d->m_aliases << d->m_reg - << d->m_departure << d->m_arrival << d->m_route - << typeFields(d->m_reg); - break; - } - } - else - { - const AircraftDisplay *d = m_aircraftModel->aircraftAt(sourceRow); - if (!d) { - continue; - } - const QString icao = QString("%1").arg(d->m_icao, 6, 16, QChar('0')).toUpper(); - switch (column) - { - case FindIcao: fields << icao; break; - case FindReg: fields << d->m_registration; break; - case FindType: fields << typeFields(d->m_registration); break; - case FindFlight: fields << d->m_flight; break; - default: - fields << icao << d->m_registration << d->m_flight << d->m_mapName - << typeFields(d->m_registration); - QSharedPointer> byReg - = OsnDB::getAircraftInformationByReg(); - if (byReg && byReg->contains(d->m_registration)) - { - const AircraftInformation *info = byReg->value(d->m_registration); - fields << info->m_operator << info->m_operatorICAO << info->m_owner; - } - break; - } - } - - for (const QString& field : fields) - { - if (!field.isEmpty() && field.contains(text, Qt::CaseInsensitive)) - { - m_findRow = row; - view->selectRow(row); - view->scrollTo(proxy->index(row, 0), QAbstractItemView::PositionAtCenter); - return true; - } - } - } - return false; -} - -// Typing searches from the top, so the match follows what has been typed so far -void AircraftGUI::on_find_textChanged(const QString& text) -{ - m_findRow = -1; - if (text.isEmpty()) - { - m_findTimer.stop(); - ui->find->setStyleSheet(""); - return; - } - // Wait for a pause in typing. Each match selects a row, and selecting reloads the - // message tables, the flight profile and the photograph, so searching on every - // keystroke would do all of that for each half-typed registration - m_findTimer.start(300); -} - -// Enter steps on to the next match -void AircraftGUI::on_find_returnPressed() -{ - const QString text = ui->find->text(); - ui->find->setStyleSheet(findFrom(m_findRow, text) ? "" : "QLineEdit { color: red; }"); -} - -void AircraftGUI::updateHistoryTables() -{ - m_updatingHistoryTables = true; - static const QStringList flightHeadings = - { "Flight", "From", "To", "First seen", "Last seen", "Msgs" }; - static const QStringList aircraftHeadings = - { "Reg", "From", "To", "First seen", "Last seen", "Msgs" }; - - auto prepare = [](QTableWidget *table, const QStringList& headings) - { - if (table->columnCount() == 0) - { - table->setColumnCount(headings.size()); - table->setHorizontalHeaderLabels(headings); - table->horizontalHeader()->setSectionsMovable(true); - table->verticalHeader()->setVisible(false); - } - // Sorting has to be off while the rows are replaced, or Qt re-sorts after each - // cell is set and the rows shuffle out from under the loop - table->setSortingEnabled(false); - table->setRowCount(0); - }; - - auto fill = [](QTableWidget *table, int row, const QStringList& values) - { - for (int col = 0; col < values.size(); col++) { - table->setItem(row, col, new QTableWidgetItem(values[col])); - } - }; - - // QTableWidgetItem sorts on the display role, so the dates have to sort correctly as - // TEXT. This format does - year first, zero padded throughout - which is why it is - // used here rather than a friendlier local format. - const QString dateFormat = "yyyy-MM-dd hh:mm"; - - // The tracker flushes every 300 ms and every flush that touches a flight rebuilds - // these tables, so a selection the user has just made would be wiped within a frame - // or two of making it. Remember it and put it back. - const quint64 keepSelected = m_selectedFlightId; - - // Past Flights: everything this aircraft has operated - prepare(ui->pastFlights, flightHeadings); - if (m_selectedAircraftId != 0) - { - int row = 0; - for (int i = 0; i < m_flightModel->rowCount(); i++) - { - const FlightDisplay *f = m_flightModel->flightAt(i); - if (!f || (f->m_aircraftId != m_selectedAircraftId)) { - continue; - } - ui->pastFlights->setRowCount(row + 1); - fill(ui->pastFlights, row, - { f->m_flight, f->m_departure, f->m_arrival, - f->m_firstSeen.toString(dateFormat), f->m_lastSeen.toString(dateFormat), - QString::number(f->m_messages) }); - ui->pastFlights->item(row, 0)->setData(Qt::UserRole, f->m_id); - row++; - } - } - ui->pastFlights->setSortingEnabled(true); - ui->pastFlights->sortByColumn(4, Qt::DescendingOrder); - - // After the sort, because sorting moves the rows around - if (keepSelected) - { - for (int row = 0; row < ui->pastFlights->rowCount(); row++) - { - const QTableWidgetItem *first = ui->pastFlights->item(row, 0); - if (first && (first->data(Qt::UserRole).toULongLong() == keepSelected)) - { - ui->pastFlights->selectRow(row); - break; - } - } - } - - // Past Aircraft: everything that has operated this flight number - prepare(ui->pastAircraft, aircraftHeadings); - if (!m_selectedFlightNumber.isEmpty()) - { - int row = 0; - for (int i = 0; i < m_flightModel->rowCount(); i++) - { - const FlightDisplay *f = m_flightModel->flightAt(i); - if (!f || f->m_flight.compare(m_selectedFlightNumber, Qt::CaseInsensitive)) { - continue; - } - ui->pastAircraft->setRowCount(row + 1); - fill(ui->pastAircraft, row, - { f->m_reg, f->m_departure, f->m_arrival, - f->m_firstSeen.toString(dateFormat), f->m_lastSeen.toString(dateFormat), - QString::number(f->m_messages) }); - row++; - } - } - ui->pastAircraft->setSortingEnabled(true); - ui->pastAircraft->sortByColumn(4, Qt::DescendingOrder); - - // These two tabs live in messageTabs, NOT aircraftTabs - asking aircraftTabs for - // them returns -1, and setTabVisible(-1) does nothing at all, which is why they - // used to stay visible whatever was selected. - ui->messageTabs->setTabVisible(ui->messageTabs->indexOf(ui->pastFlightsTab), - m_selectedAircraftId != 0); - ui->messageTabs->setTabVisible(ui->messageTabs->indexOf(ui->pastAircraftTab), - !m_selectedFlightNumber.isEmpty()); - m_updatingHistoryTables = false; -} - -// Selecting one of the aircraft's past flights charts its profile and draws its track -// on the map. Nothing is selected once the table is rebuilt, which returns both to the -// flight the aircraft is on now. -void AircraftGUI::pastFlightSelectionChanged() -{ - if (m_updatingHistoryTables) { - return; - } - - quint64 flightId = 0; - QString title; - const QList selected = ui->pastFlights->selectedItems(); - if (!selected.isEmpty()) - { - const QTableWidgetItem *first = ui->pastFlights->item(selected.first()->row(), 0); - if (first) - { - flightId = first->data(Qt::UserRole).toULongLong(); - title = first->text(); - } - } - // With no past flight selected the messages widen back out to the whole aircraft, - // while the track and the chart go back to the flight it is on now - m_selectedFlightId = flightId; - applyMessageFilter(); - - if (flightId == 0) - { - for (int i = 0; i < m_aircraftModel->rowCount(); i++) - { - const AircraftDisplay *d = m_aircraftModel->aircraftAt(i); - if (d && (d->m_id == m_selectedAircraftId)) - { - flightId = d->m_currentFlightId; - title = d->m_flight.isEmpty() ? d->m_mapName : d->m_flight; - break; - } - } - } - watchFlight(flightId, title); -} - -void AircraftGUI::aircraftSelectionChanged() -{ - m_selectedAircraftId = 0; - m_selectedRegistration.clear(); - m_selectedIcao = 0; - // An airframe is selected, so "what else has flown this number" no longer has a - // number to be about - m_selectedFlightId = 0; - m_selectedFlightNumber.clear(); - quint64 currentFlightId = 0; - QString title; - - QTableView *view = showingArchive() ? ui->oldAircraft : ui->aircraft; - ActiveFilterProxy *proxy = showingArchive() ? m_oldAircraftProxy : m_aircraftProxy; - QModelIndexList selected = view->selectionModel()->selectedRows(); - if (!selected.isEmpty()) - { - int sourceRow = proxy->mapToSource(selected.first()).row(); - const AircraftDisplay *d = m_aircraftModel->aircraftAt(sourceRow); - if (d) - { - m_selectedAircraftId = d->m_id; - m_selectedRegistration = d->m_registration; - m_selectedIcao = d->m_icao; - currentFlightId = d->m_currentFlightId; - title = d->m_flight.isEmpty() ? d->m_mapName : d->m_flight; - } - } - applyMessageFilter(); - updateHistoryTables(); - updatePhoto(m_selectedRegistration, m_selectedIcao); - watchFlight(currentFlightId, title); -} - -void AircraftGUI::flightSelectionChanged() -{ - m_selectedFlightId = 0; - m_selectedFlightNumber.clear(); - m_selectedAircraftId = 0; - quint64 watchId = 0; - QString title; - QString registration; - - QTableView *view = showingArchive() ? ui->oldFlights : ui->flights; - ActiveFilterProxy *proxy = showingArchive() ? m_oldFlightProxy : m_flightProxy; - QModelIndexList selected = view->selectionModel()->selectedRows(); - if (!selected.isEmpty()) - { - int sourceRow = proxy->mapToSource(selected.first()).row(); - const FlightDisplay *d = m_flightModel->flightAt(sourceRow); - if (d) - { - m_selectedFlightId = d->m_id; - m_selectedFlightNumber = d->m_flight; - watchId = d->m_id; - title = d->m_flight.isEmpty() ? d->m_reg : d->m_flight; - registration = d->m_reg; - } - } - applyMessageFilter(); - updateHistoryTables(); - updatePhoto(registration, 0); - watchFlight(watchId, title); -} - -// Tell the tracker which flight's profile to send us -void AircraftGUI::watchFlight(quint64 flightId, const QString& title) -{ - m_profileFlightId = flightId; - m_profileTitle = title; - m_profileTimes.clear(); - m_profileAltFt.clear(); - m_profileSpeedKts.clear(); - plotProfileChart(); - tracker()->getInputMessageQueue()->push(AircraftTracker::MsgWatchFlight::create(flightId)); -} - -void AircraftGUI::trackerProfileUpdated(quint64 flightId, const QList& times, const QList& altitudeFt, const QList& speedKts) -{ - if (flightId != m_profileFlightId) { - return; - } - m_profileTimes = times; - m_profileAltFt = altitudeFt; - m_profileSpeedKts = speedKts; - plotProfileChart(); -} - -void AircraftGUI::documentSelectionChanged() -{ - QList selected = ui->documents->selectedItems(); - for (const auto *selItem : selected) - { - QTableWidgetItem *timeItem = ui->documents->item(selItem->row(), DOCUMENT_COL_TIME); - if (timeItem) - { - ui->documentText->setPlainText(timeItem->data(Qt::UserRole).toString()); - return; - } - } - // Nothing selected - the previous message is not the selected one, and leaving it - // there reads as though it is - ui->documentText->clear(); -} - -// Fetch and display the planespotters.net photo for an aircraft -void AircraftGUI::updatePhoto(const QString& registration, quint32 icao) -{ - QString key = !registration.isEmpty() ? registration - : (icao ? QString("%1").arg(icao, 6, 16, QChar('0')).toUpper() : QString()); - if (key == m_photoKey) { - return; - } - m_photoKey = key; - - // Hide the previous aircraft's photo - ui->photoHeader->setVisible(false); - ui->photoFlag->setVisible(false); - ui->photo->setVisible(false); - ui->photo->setPixmap(QPixmap()); - ui->flightDetails->setVisible(false); - m_photoLink.clear(); - - if (key.isEmpty()) { - return; - } - - updatePhotoText(registration, icao); - updateAircraftInfo(registration, icao); - if (!registration.isEmpty()) { - m_planeSpotters.getAircraftPhotoByRegistration(registration); - } else { - m_planeSpotters.getAircraftPhoto(key); - } -} - -void AircraftGUI::updatePhotoText(const QString& registration, quint32 icao) -{ - ui->photoHeader->setText(registration.isEmpty() - ? QString("%1").arg(icao, 6, 16, QChar('0')).toUpper() : registration); - - ui->photoFlag->setPixmap(QPixmap()); - ui->flightDetails->setPixmap(QPixmap()); - - QSharedPointer> aircraftInfoDB = OsnDB::getAircraftInformationByReg(); - if (aircraftInfoDB && aircraftInfoDB->contains(registration)) - { - const AircraftInformation *aircraftInfo = aircraftInfoDB->value(registration); - - QString flag = aircraftInfo->getFlag(); - if (!flag.isEmpty()) - { - QIcon *icon = AircraftInformation::getFlagIcon(flag); - if (icon) - { - QList sizes = icon->availableSizes(); - if (sizes.size() > 0) { - ui->photoFlag->setPixmap(icon->pixmap(sizes[0])); - } - } - } - - // The airline's logo under the photograph. The manufacturer, model, owner, - // operator and registration date that used to sit beside the photograph are - // gone - the aircraftInfo table next to it lists all five, so they were on - // screen twice. - QIcon *airlineIcon = AircraftInformation::getAirlineIcon(aircraftInfo->m_operatorICAO); - if (airlineIcon) - { - QList sizes = airlineIcon->availableSizes(); - if (sizes.size() > 0) { - ui->flightDetails->setPixmap(airlineIcon->pixmap(sizes[0])); - } - } - } -} - -void AircraftGUI::aircraftPhoto(const PlaneSpottersPhoto *photo) -{ - // The download takes a while, and the selection can move on while it runs. Checking - // only that SOMETHING is selected would put aircraft A's photograph next to aircraft - // B's details, which reads as a wrong answer rather than a slow one. - if (!photo->m_pixmap.isNull() && !m_photoKey.isEmpty() && (photo->m_id == m_photoKey)) - { - ui->photo->setPixmap(photo->m_pixmap); - ui->photo->setToolTip(QString("Photographer: %1").arg(photo->m_photographer)); // Required by terms of use - ui->photoHeader->setVisible(true); - ui->photoFlag->setVisible(true); - ui->photo->setVisible(true); - ui->flightDetails->setVisible(true); - m_photoLink = photo->m_link; - } -} - -void AircraftGUI::photoClicked() -{ - // Photo needs to link back to PlaneSpotters, as per terms of use - if (!m_photoLink.isEmpty()) { - QDesktopServices::openUrl(QUrl(m_photoLink)); - } -} - -// ---- Context menus ---- - -// Jump to a flight in the Flights table, from the aircraft that is flying it -void AircraftGUI::selectFlight(const QString& flight) -{ - ui->aircraftTabs->setCurrentWidget(ui->flightsTab); - - ActiveFilterProxy *proxy = m_flightProxy; - QTableView *view = ui->flights; - for (int row = 0; row < proxy->rowCount(); row++) - { - const FlightDisplay *d = m_flightModel->flightAt(proxy->mapToSource(proxy->index(row, 0)).row()); - if (d && !d->m_flight.compare(flight, Qt::CaseInsensitive)) - { - view->selectRow(row); - view->scrollTo(proxy->index(row, 0), QAbstractItemView::PositionAtCenter); - return; - } - } -} - -// And the other way: the airframe that flew a flight -void AircraftGUI::selectAircraft(quint64 aircraftId) -{ - ui->aircraftTabs->setCurrentWidget(ui->aircraftTab); - - ActiveFilterProxy *proxy = m_aircraftProxy; - QTableView *view = ui->aircraft; - for (int row = 0; row < proxy->rowCount(); row++) - { - const AircraftDisplay *d = m_aircraftModel->aircraftAt(proxy->mapToSource(proxy->index(row, 0)).row()); - if (d && (d->m_id == aircraftId)) - { - view->selectRow(row); - view->scrollTo(proxy->index(row, 0), QAbstractItemView::PositionAtCenter); - return; - } - } -} - -void AircraftGUI::showContextMenu(QWidget *parent, const QString& cellText, const QString& mapName, - QPoint globalPos, const QString& showFlight, quint64 showAircraftId) -{ - QMenu *menu = new QMenu(parent); - menu->setAttribute(Qt::WA_DeleteOnClose); - - if (!cellText.isEmpty()) - { - QAction *copyAction = new QAction(QString("Copy %1").arg(cellText), menu); - connect(copyAction, &QAction::triggered, this, [cellText]() { - QGuiApplication::clipboard()->setText(cellText); - }); - menu->addAction(copyAction); - } - if (!mapName.isEmpty()) - { - QAction *findAction = new QAction(QString("Find %1 on map").arg(mapName), menu); - connect(findAction, &QAction::triggered, this, [mapName]() { - FeatureWebAPIUtils::mapFind(mapName); - }); - menu->addAction(findAction); - } - if (!showFlight.isEmpty()) - { - QAction *action = new QAction(QString("Display flight %1").arg(showFlight), menu); - connect(action, &QAction::triggered, this, [this, showFlight]() { - selectFlight(showFlight); - }); - menu->addAction(action); - } - if (showAircraftId != 0) - { - QAction *action = new QAction("Display aircraft", menu); - connect(action, &QAction::triggered, this, [this, showAircraftId]() { - selectAircraft(showAircraftId); - }); - menu->addAction(action); - } - if (menu->actions().isEmpty()) - { - delete menu; - return; - } - menu->popup(globalPos); -} - -void AircraftGUI::viewContextMenu(QTableView *view, bool aircraftView, QPoint pos) -{ - QSortFilterProxyModel *proxy = qobject_cast(view->model()); - QModelIndex index = view->indexAt(pos); - if (!index.isValid()) { - return; - } - - QString cellText = index.data(Qt::DisplayRole).toString(); - QString mapName; - QString showFlight; - quint64 showAircraftId = 0; - if (aircraftView) - { - const AircraftDisplay *d = m_aircraftModel->aircraftAt(proxy->mapToSource(index).row()); - if (d) - { - mapName = d->m_mapName; - showFlight = d->m_flight; - } - } - else - { - const FlightDisplay *d = m_flightModel->flightAt(proxy->mapToSource(index).row()); - if (d) - { - mapName = d->m_reg; - showAircraftId = d->m_aircraftId; - } - } - showContextMenu(view, cellText, mapName, view->viewport()->mapToGlobal(pos), - showFlight, showAircraftId); -} - -void AircraftGUI::tableContextMenu(QTableWidget *table, QPoint pos) -{ - QTableWidgetItem *item = table->itemAt(pos); - if (!item) { - return; - } - QString mapName = table->item(item->row(), 0)->data(Qt::UserRole + 3).toString(); - showContextMenu(table, item->text(), mapName, table->viewport()->mapToGlobal(pos)); -} - -// ---- Charts ---- - -void AircraftGUI::plotChart() -{ - QChart *oldChart = m_chart; - - m_chart = new QChart(); - m_chart->layout()->setContentsMargins(0, 0, 0, 0); - m_chart->setMargins(QMargins(1, 1, 1, 1)); - m_chart->setTheme(QChart::ChartThemeDark); - m_chart->legend()->setAlignment(Qt::AlignRight); - - m_chartXAxis = new QDateTimeAxis(); - m_chartXAxis->setFormat("hh:mm:ss"); - m_chartYAxis = new QValueAxis(); - m_chartYAxis->setTitleText("Msgs/s"); - - m_chart->addAxis(m_chartXAxis, Qt::AlignBottom); - m_chart->addAxis(m_chartYAxis, Qt::AlignLeft); - - static const char *seriesNames[CHART_SERIES] = {"ADS-B", "ACARS", "VDL2", "HFDL", "Aero", "Total"}; - for (int i = 0; i < CHART_SERIES; i++) - { - m_chartSeries[i] = new QLineSeries(); - m_chartSeries[i]->setName(seriesNames[i]); - m_chart->addSeries(m_chartSeries[i]); - m_chartSeries[i]->attachAxis(m_chartXAxis); - m_chartSeries[i]->attachAxis(m_chartYAxis); - } - - const QDateTime now = QDateTime::currentDateTime(); - m_chartXAxis->setMin(now.addSecs(-60)); - m_chartXAxis->setMax(now); - m_chartYAxis->setRange(0.0, 10.0); - - ui->chart->setChart(m_chart); - - // Click a legend entry to show/hide its series - const auto markers = m_chart->legend()->markers(); - for (QLegendMarker *marker : markers) { - connect(marker, &QLegendMarker::clicked, this, &AircraftGUI::legendMarkerClicked); - } - - delete oldChart; -} - -void AircraftGUI::legendMarkerClicked() -{ - QLegendMarker *marker = qobject_cast(sender()); - if (marker) - { - marker->series()->setVisible(!marker->series()->isVisible()); - marker->setVisible(true); - } -} - -void AircraftGUI::trackerMessageRates(const QList& rates) -{ - const QDateTime now = QDateTime::currentDateTime(); - - for (int i = 0; (i < CHART_SERIES) && (i < rates.size()); i++) - { - m_chartSeries[i]->append(now.toMSecsSinceEpoch(), rates[i]); - if (m_chartYAxis->max() < rates[i]) { - m_chartYAxis->setMax(std::ceil(rates[i]) + 1.0); - } - // Bound long-running growth - if (m_chartSeries[i]->count() > 1000) { - m_chartSeries[i]->removePoints(0, m_chartSeries[i]->count() - 1000); - } - } - m_chartXAxis->setMax(now); - if (m_chartSeries[0]->count() > 0) { - m_chartXAxis->setMin(QDateTime::fromMSecsSinceEpoch((qint64) m_chartSeries[0]->at(0).x())); - } -} - -// Altitude and speed against time for the watched flight -void AircraftGUI::plotProfileChart() -{ - QChart *oldChart = m_profileChart; - m_profileChart = new QChart(); - m_profileChart->layout()->setContentsMargins(0, 0, 0, 0); - m_profileChart->setMargins(QMargins(1, 1, 1, 1)); - m_profileChart->setTheme(QChart::ChartThemeDark); - m_profileChart->legend()->setAlignment(Qt::AlignRight); - m_profileChart->setTitle(m_profileFlightId ? m_profileTitle : "No flight selected"); - - QDateTimeAxis *xAxis = new QDateTimeAxis(); - xAxis->setFormat("hh:mm"); - QValueAxis *altAxis = new QValueAxis(); - altAxis->setTitleText("Alt (ft)"); - QValueAxis *speedAxis = new QValueAxis(); - speedAxis->setTitleText("Speed (kn)"); - m_profileChart->addAxis(xAxis, Qt::AlignBottom); - m_profileChart->addAxis(altAxis, Qt::AlignLeft); - m_profileChart->addAxis(speedAxis, Qt::AlignRight); - - QLineSeries *altSeries = new QLineSeries(); - altSeries->setName("Altitude"); - QLineSeries *speedSeries = new QLineSeries(); - speedSeries->setName("Speed"); - - float maxAlt = 0.0f; - float maxSpeed = 0.0f; - for (int i = 0; i < m_profileTimes.size(); i++) - { - if (!std::isnan(m_profileAltFt[i])) - { - altSeries->append(m_profileTimes[i], m_profileAltFt[i]); - maxAlt = std::max(maxAlt, m_profileAltFt[i]); - } - if (!std::isnan(m_profileSpeedKts[i])) - { - speedSeries->append(m_profileTimes[i], m_profileSpeedKts[i]); - maxSpeed = std::max(maxSpeed, m_profileSpeedKts[i]); - } - } - - m_profileChart->addSeries(altSeries); - altSeries->attachAxis(xAxis); - altSeries->attachAxis(altAxis); - m_profileChart->addSeries(speedSeries); - speedSeries->attachAxis(xAxis); - speedSeries->attachAxis(speedAxis); - - if (!m_profileTimes.isEmpty()) - { - xAxis->setMin(QDateTime::fromMSecsSinceEpoch(m_profileTimes.first())); - xAxis->setMax(QDateTime::fromMSecsSinceEpoch(std::max(m_profileTimes.first() + 60000, m_profileTimes.last()))); - } - else - { - const QDateTime now = QDateTime::currentDateTime(); - xAxis->setMin(now.addSecs(-60)); - xAxis->setMax(now); - } - altAxis->setRange(0.0, std::max(1000.0, std::ceil(maxAlt / 1000.0) * 1000.0)); - speedAxis->setRange(0.0, std::max(100.0, std::ceil(maxSpeed / 100.0) * 100.0)); - - ui->profileChart->setChart(m_profileChart); - delete oldChart; -} - -// ---- Toolbar ---- - -void AircraftGUI::on_deleteAircraft_clicked() -{ - tracker()->getInputMessageQueue()->push(AircraftTracker::MsgDeleteAll::create()); -} - -void AircraftGUI::on_settings_clicked() -{ - AircraftSettingsDialog dialog(&m_settings, this); - - if (dialog.exec() == QDialog::Accepted) - { - const QStringList& changed = dialog.changedSettings(); - - if (!changed.isEmpty()) - { - m_settingsKeys.append(changed); - applySettings(); - } - } -} - -void AircraftGUI::on_notifications_clicked() -{ - AircraftNotificationDialog dialog(&m_settings, this); - new DialogPositioner(&dialog, true); - if (dialog.exec() == QDialog::Accepted) - { - m_settingsKeys.append("notificationSettings"); - applySettings(); - } -} - -// The statistics table and the message rate chart live in the same vertical splitter as -// the tables, rather than in tabs, so they can be watched at the same time as the traffic -// they describe - the same arrangement the ADS-B demodulator uses. -// Right clicking either toggle resets what it shows, which is how the same two buttons -// behave in the ADS-B demodulator -void AircraftGUI::statsContextMenu(const QPoint& pos) -{ - QMenu menu(this); - QAction *session = menu.addAction("Reset session statistics"); - QAction *allTime = menu.addAction("Reset all time statistics"); - QAction *chosen = menu.exec(ui->stats->mapToGlobal(pos)); - - if (chosen == session) - { - tracker()->getInputMessageQueue()->push( - AircraftTracker::MsgResetStatistics::create(false)); - } - else if (chosen == allTime) - { - // The stored blob has to be cleared as well as the tracker's copy, or the next - // update would serialise the old figures straight back out of the preset - m_statisticsBlob = QByteArray(); - m_settings.m_statistics = QByteArray(); - m_settingsKeys.append("statistics"); - tracker()->getInputMessageQueue()->push( - AircraftTracker::MsgResetStatistics::create(true)); - applySettings(); - } -} - -void AircraftGUI::on_stats_clicked(bool checked) -{ - m_settings.m_displayStatistics = checked; - ui->statistics->setVisible(checked); - m_settingsKeys.append("displayStatistics"); - applySettings(); -} - -void AircraftGUI::chartContextMenu(const QPoint& pos) -{ - QMenu menu(this); - QAction *reset = menu.addAction("Reset chart data"); - if (menu.exec(ui->displayChart->mapToGlobal(pos)) == reset) - { - for (int i = 0; i < CHART_SERIES; i++) - { - if (m_chartSeries[i]) { - m_chartSeries[i]->clear(); - } - } - } -} - -void AircraftGUI::on_displayChart_clicked(bool checked) -{ - m_settings.m_displayChart = checked; - ui->chart->setVisible(checked); - m_settingsKeys.append("displayChart"); - applySettings(); -} - -void AircraftGUI::on_atcLabels_clicked(bool checked) -{ - m_settings.m_atcLabels = checked; - m_settingsKeys.append("atcLabels"); - applySettings(); // The tracker refreshes the Map labels -} - -// ---- Column management ---- - -void AircraftGUI::aircraft_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) -{ - (void) oldVisualIndex; - - m_settings.m_columnIndexes[logicalIndex] = newVisualIndex; - m_settingsKeys.append("columnIndexes"); - applySettings(); -} - -void AircraftGUI::aircraft_sectionResized(int logicalIndex, int oldSize, int newSize) -{ - (void) oldSize; - - m_settings.m_columnSizes[logicalIndex] = newSize; - m_settingsKeys.append("columnSizes"); - applySettings(); -} - -void AircraftGUI::flights_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) -{ - (void) oldVisualIndex; - - m_settings.m_flightColumnIndexes[logicalIndex] = newVisualIndex; - m_settingsKeys.append("flightColumnIndexes"); - applySettings(); -} - -void AircraftGUI::flights_sectionResized(int logicalIndex, int oldSize, int newSize) -{ - (void) oldSize; - - m_settings.m_flightColumnSizes[logicalIndex] = newSize; - m_settingsKeys.append("flightColumnSizes"); - applySettings(); -} - -void AircraftGUI::flightColumnSelectMenu(QPoint pos) -{ - m_flightColumnMenu->popup(ui->flights->horizontalHeader()->viewport()->mapToGlobal(pos)); -} - -void AircraftGUI::flightColumnSelectMenuChecked(bool checked) -{ - (void) checked; - - QAction* action = qobject_cast(sender()); - if (action != nullptr) - { - int idx = action->data().toInt(nullptr); - ui->flights->setColumnHidden(idx, !action->isChecked()); - } -} - -void AircraftGUI::aircraftColumnSelectMenu(QPoint pos) -{ - m_columnMenu->popup(ui->aircraft->horizontalHeader()->viewport()->mapToGlobal(pos)); -} - -void AircraftGUI::aircraftColumnSelectMenuChecked(bool checked) -{ - (void) checked; - - QAction* action = qobject_cast(sender()); - if (action != nullptr) - { - int idx = action->data().toInt(nullptr); - ui->aircraft->setColumnHidden(idx, !action->isChecked()); - } -} - -QAction *AircraftGUI::createCheckableItem(QString &text, int idx, bool checked, const char *slot) -{ - QAction *action = new QAction(text, this); - action->setCheckable(true); - action->setChecked(checked); - action->setData(QVariant(idx)); - connect(action, SIGNAL(triggered()), this, slot); - return action; -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef QT_TEXTTOSPEECH_FOUND +#include +#endif + +#include "feature/featureuiset.h" +#include "feature/featurewebapiutils.h" +#include "gui/basicfeaturesettingsdialog.h" +#include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" +#include "maincore.h" +#include "util/osndb.h" + +#include "ui_aircraftgui.h" +#include "aircraft.h" +#include "aircraftgui.h" +#include "aircraftnotificationdialog.h" +#include "aircraftsettingsdialog.h" +#include "util/profiler.h" +#include "gui/fastitemdelegate.h" +#include "gui/fastheaderview.h" + +// How many columns the user can actually see. Hiding the last one is refused, because +// the menu that unhides them hangs off the header, and a table with nothing visible has +// no header left to right-click - there is then no way back without editing the settings +static int visibleColumnCount(const QTableView *view, int columns) +{ + int visible = 0; + for (int i = 0; i < columns; i++) + { + if (!view->isColumnHidden(i)) { + visible++; + } + } + return visible; +} + +// Gives a table's header the context menu that hides and shows its columns, the same +// one the aircraft and flights tables have. Those two keep their own menus as members, +// because their column state is saved and restored; the tables here only need the menu +static void addColumnMenu(QTableView *view, int columns) +{ + QMenu *menu = new QMenu(view); + const QAbstractItemModel *model = view->model(); + + for (int i = 0; i < columns; i++) + { + QAction *action = menu->addAction(model ? model->headerData(i, Qt::Horizontal).toString() : QString()); + action->setCheckable(true); + action->setChecked(!view->isColumnHidden(i)); + QObject::connect(action, &QAction::toggled, view, [view, columns, i, action](bool checked) + { + // Refuse the last one: the menu that would put it back hangs off the header, + // and a table with nothing visible has no header left to right-click + if (!checked && (visibleColumnCount(view, columns) <= 1)) + { + action->setChecked(true); + return; + } + view->setColumnHidden(i, !checked); + }); + } + + view->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); + QObject::connect(view->horizontalHeader(), &QWidget::customContextMenuRequested, view, + [view, menu](const QPoint& pos) + { + menu->popup(view->horizontalHeader()->viewport()->mapToGlobal(pos)); + }); +} + +// Settings saved before that guard existed can still have everything hidden, so recover +// rather than restoring a table the user cannot use +static void showAllColumnsIfNoneVisible(QTableView *view, int *columnSizes, int columns, QMenu *menu) +{ + if (visibleColumnCount(view, columns) > 0) { + return; + } + qWarning() << "AircraftGUI: every column was hidden in the saved settings - showing them all"; + for (int i = 0; i < columns; i++) + { + view->setColumnHidden(i, false); + if (columnSizes[i] == 0) { + columnSizes[i] = view->columnWidth(i); + } + if (i < menu->actions().size()) { + menu->actions().at(i)->setChecked(true); + } + } +} + +// Puts a header's columns in the saved order, each column's saved value being its visual +// index. They are placed leftmost first: moving a column into place only shifts the ones +// to the right of where it lands, so those already placed stay put. Going through them in +// logical order instead lets a later move push an earlier one out of position - 207 of +// the orders of up to six columns come back wrong that way. Sorting by the saved value, +// rather than indexing by it, also copes with a layout saved before every column's +// position was stored, in which two columns can claim the same place. +static void restoreColumnOrder(QHeaderView *header, const int *visualIndexes, int columns) +{ + QList order; + for (int i = 0; i < columns; i++) { + order.append(i); + } + // Read in full before the first move, because each move emits sectionMoved and the + // handlers write the new layout back over these very settings + std::stable_sort(order.begin(), order.end(), [visualIndexes](int a, int b) { + return visualIndexes[a] < visualIndexes[b]; + }); + for (int visual = 0; visual < columns; visual++) { + header->moveSection(header->visualIndex(order[visual]), visual); + } +} + +AircraftGUI* AircraftGUI::create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature) +{ + AircraftGUI* gui = new AircraftGUI(pluginAPI, featureUISet, feature); + return gui; +} + +void AircraftGUI::destroy() +{ + delete this; +} + +void AircraftGUI::resetToDefaults() +{ + m_settings.resetToDefaults(); + displaySettings(); + applySettings(true); +} + +// The three splitters travel together in one blob, each holding its own +// QSplitter::saveState(). A version leads it so that adding a fourth later can be read +// by an older build without it making nonsense of the ones it does understand. +QByteArray AircraftGUI::saveSplitters() const +{ + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly); + stream.setVersion(QDataStream::Qt_5_15); + + // Version 2 adds the Documents and Logons splitters. Bumped rather than appended + // silently: restoreSplitters() reads a fixed number of blobs, so a version 1 preset + // has to be recognised as such and its two missing states left at their defaults. + stream << (quint32) 2; + stream << ui->splitter->saveState() + << ui->aircraftSplitter->saveState() + << ui->weatherSplitter->saveState() + << ui->documentsSplitter->saveState() + << ui->logonsSplitter->saveState(); + return data; +} + +void AircraftGUI::restoreSplitters(const QByteArray& data) +{ + if (data.isEmpty()) { + return; + } + QDataStream stream(data); + stream.setVersion(QDataStream::Qt_5_15); + + quint32 version = 0; + stream >> version; + if (((version != 1) && (version != 2)) || (stream.status() != QDataStream::Ok)) { + return; // Written by something else, or truncated: leave the defaults + } + + QByteArray outer, aircraft, weather; + stream >> outer >> aircraft >> weather; + if (stream.status() != QDataStream::Ok) { + return; + } + ui->splitter->restoreState(outer); + ui->aircraftSplitter->restoreState(aircraft); + ui->weatherSplitter->restoreState(weather); + + // A version 1 preset stops here, and the two below keep the layout the .ui gives them + if (version < 2) { + return; + } + QByteArray documents, logons; + stream >> documents >> logons; + if (stream.status() != QDataStream::Ok) { + return; + } + ui->documentsSplitter->restoreState(documents); + ui->logonsSplitter->restoreState(logons); +} + +QByteArray AircraftGUI::serialize() const +{ + // The records live in the session database now, written by the tracker that sets + // them, so nothing goes in the preset. An empty blob is deliberate rather than an + // omission: a preset written before the move still carries one, and the tracker + // imports that once, so leaving a stale copy here would only invite confusion. + AircraftSettings settings = m_settings; + settings.m_statistics = QByteArray(); + settings.m_splitterStates = saveSplitters(); + return settings.serialize(); +} + +bool AircraftGUI::deserialize(const QByteArray& data) +{ + if (m_settings.deserialize(data)) + { + // m_settings.m_statistics is only still read for the one time import into the + // session database, which the tracker does - see AircraftTracker::applySettings() + m_feature->setWorkspaceIndex(m_settings.m_workspaceIndex); + displaySettings(); + applySettings(true); + return true; + } + else + { + resetToDefaults(); + return false; + } +} + +void AircraftGUI::setWorkspaceIndex(int index) +{ + m_settings.m_workspaceIndex = index; + m_feature->setWorkspaceIndex(index); + m_settingsKeys.append("workspaceIndex"); + applySettings(); +} + +bool AircraftGUI::handleMessage(const Message& message) +{ + if (Aircraft::MsgConfigureAircraft::match(message)) + { + const Aircraft::MsgConfigureAircraft& cfg = (Aircraft::MsgConfigureAircraft&) message; + + if (cfg.getForce()) { + m_settings = cfg.getSettings(); + } else { + m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings()); + } + + blockApplySettings(true); + displaySettings(); + blockApplySettings(false); + + return true; + } + + return false; +} + +void AircraftGUI::handleInputMessages() +{ + Message* message; + + while ((message = getInputMessageQueue()->pop())) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +void AircraftGUI::onWidgetRolled(QWidget* widget, bool rollDown) +{ + (void) widget; + (void) rollDown; + + RollupContents *rollupContents = getRollupContents(); + + rollupContents->saveState(m_rollupState); + applySettings(); +} + +AircraftTracker *AircraftGUI::tracker() const +{ + return m_aircraft->getTracker(); +} + +AircraftGUI::AircraftGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent) : + FeatureGUI(parent), + ui(new Ui::AircraftGUI), + m_pluginAPI(pluginAPI), + m_featureUISet(featureUISet), + m_doApplySettings(true) +{ + m_feature = feature; + setAttribute(Qt::WA_DeleteOnClose, true); + m_helpURL = "plugins/feature/aircraft/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + + m_aircraft = reinterpret_cast(feature); + m_aircraft->setMessageQueueToGUI(&m_inputMessageQueue); + + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); + connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); + + AircraftInformation::init(); + + // Before any header configuration below, as setHorizontalHeader() resets section + // state. QHeaderView draws through QStyle, and the Fusion style asks Windows for the + // high contrast setting once per drawn primitive, uncached - around 14 system calls + // for one header repaint. FastHeaderView draws the section itself + for (QTableView *view : {(QTableView *) ui->aircraft, (QTableView *) ui->oldAircraft, + (QTableView *) ui->flights, (QTableView *) ui->oldFlights, + (QTableView *) ui->documents, (QTableView *) ui->logons, + (QTableView *) ui->atcMessages, (QTableView *) ui->statistics, + (QTableView *) ui->weather, (QTableView *) ui->aircraftInfo, + (QTableView *) ui->pastFlights, (QTableView *) ui->pastAircraft}) { + view->setHorizontalHeader(new FastHeaderView(Qt::Horizontal, view)); + } + + // Aircraft and flights tables: model/view, with the data coming as + // snapshots from the tracker thread + m_aircraftModel = new AircraftTableModel(this); + m_aircraftProxy = new ActiveFilterProxy(true, this); + m_oldAircraftProxy = new ActiveFilterProxy(false, this); + m_flightModel = new FlightTableModel(this); + m_flightProxy = new ActiveFilterProxy(true, this); + m_oldFlightProxy = new ActiveFilterProxy(false, this); + // The live views are re-sorted and re-filtered once per batch from the tracker, by + // trackerAircraftUpdated() and trackerFlightsUpdated(), rather than dynamically. The + // models emit a dataChanged for each row they update, and a sorted dynamic proxy + // re-sorts on every one of them - a layout change of the whole view per aircraft, for + // batches of dozens every 300 ms. The archive views stay dynamic: the rows changing + // are almost all live ones, which they look at and ignore, and invalidating them + // instead would sort the whole archive on every batch. + m_aircraftProxy->setDynamicSortFilter(false); + m_flightProxy->setDynamicSortFilter(false); + + for (auto pair : { qMakePair(ui->aircraft, m_aircraftProxy), qMakePair(ui->oldAircraft, m_oldAircraftProxy) }) + { + pair.second->setSourceModel(m_aircraftModel); + pair.second->setSortRole(Qt::DisplayRole); + pair.first->setModel(pair.second); + pair.first->setSortingEnabled(true); + pair.first->horizontalHeader()->setSectionsMovable(true); + pair.first->setIconSize(QSize(85, 20)); + showRowNumbers(pair.first); + connect(pair.first->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &AircraftGUI::aircraftSelectionChanged); + } + + for (auto pair : { qMakePair(ui->flights, m_flightProxy), qMakePair(ui->oldFlights, m_oldFlightProxy) }) + { + pair.second->setSourceModel(m_flightModel); + pair.first->setModel(pair.second); + pair.first->setSortingEnabled(true); + pair.first->horizontalHeader()->setSectionsMovable(true); + showRowNumbers(pair.first); + connect(pair.first->selectionModel(), &QItemSelectionModel::selectionChanged, + this, &AircraftGUI::flightSelectionChanged); + } + + setDefaultColumnWidths(); + + // Documents and ATC log tables + ui->documents->setSortingEnabled(true); + ui->documents->horizontalHeader()->setSectionsMovable(true); + ui->documents->horizontalHeader()->setStretchLastSection(true); + ui->logons->setSortingEnabled(true); + ui->logons->horizontalHeader()->setSectionsMovable(true); + ui->logons->horizontalHeader()->setStretchLastSection(true); + connect(ui->documents, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::documentSelectionChanged); + connect(ui->logons, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::logonSelectionChanged); + connect(ui->weather, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::weatherSelectionChanged); + ui->weather->setSortingEnabled(true); + ui->weather->horizontalHeader()->setSectionsMovable(true); + ui->weather->horizontalHeader()->setStretchLastSection(true); + ui->weather->verticalHeader()->setVisible(false); + connect(ui->pastFlights, &QTableWidget::itemSelectionChanged, this, &AircraftGUI::pastFlightSelectionChanged); + connect(ui->find, &QLineEdit::returnPressed, this, &AircraftGUI::on_find_returnPressed); + m_findTimer.setSingleShot(true); + connect(&m_findTimer, &QTimer::timeout, this, [this]() { + ui->find->setStyleSheet(findFrom(-1, ui->find->text()) ? "" : "QLineEdit { color: red; }"); + }); + + // A row found while the keyboard stays in the Find box is a selection in a view + // that does not have focus, which most styles draw in a washed out grey. Make the + // unfocused highlight the same as the focused one so the match is actually visible. + // Painting cells through QStyle costs a SystemParametersInfo call per cell with the + // Fusion style - see FastItemDelegate. These tables are the ones that showed it + for (QAbstractItemView *view : {(QAbstractItemView *) ui->aircraft, (QAbstractItemView *) ui->oldAircraft, + (QAbstractItemView *) ui->flights, (QAbstractItemView *) ui->oldFlights, + (QAbstractItemView *) ui->documents, (QAbstractItemView *) ui->logons, + (QAbstractItemView *) ui->atcMessages, (QAbstractItemView *) ui->statistics, + (QAbstractItemView *) ui->weather, (QAbstractItemView *) ui->aircraftInfo, + (QAbstractItemView *) ui->pastFlights, (QAbstractItemView *) ui->pastAircraft}) { + view->setItemDelegate(new FastItemDelegate(view)); + } + + for (QTableView *view : {ui->aircraft, ui->oldAircraft, ui->flights, ui->oldFlights}) + { + QPalette palette = view->palette(); + palette.setColor(QPalette::Inactive, QPalette::Highlight, + palette.color(QPalette::Active, QPalette::Highlight)); + palette.setColor(QPalette::Inactive, QPalette::HighlightedText, + palette.color(QPalette::Active, QPalette::HighlightedText)); + view->setPalette(palette); + } + connect(ui->find, &QLineEdit::textChanged, this, &AircraftGUI::on_find_textChanged); + // Changing which column to look in searches again from the top + connect(ui->findColumn, QOverload::of(&QComboBox::currentIndexChanged), this, + [this](int) { on_find_textChanged(ui->find->text()); }); + ui->atcMessages->setSortingEnabled(true); + ui->atcMessages->horizontalHeader()->setSectionsMovable(true); + ui->atcMessages->horizontalHeader()->setStretchLastSection(true); + + // A row's hidden flag belongs to the view's row number, not to the row's items, so a + // sort the user asks for leaves the flags where they were while the rows move. New + // messages only filter the rows they add, so nothing else would put that right. + // Queued, so that it runs after the view's own handler has done the sort. + for (QTableWidget *table : {ui->documents, ui->logons, ui->atcMessages}) + { + connect(table->horizontalHeader(), &QHeaderView::sortIndicatorChanged, this, + [this](int, Qt::SortOrder) { applyMessageFilter(); }, Qt::QueuedConnection); + } + + // Selecting an aircraft or a flight filters the Documents and ATC tables + connect(ui->aircraftTabs, &QTabWidget::currentChanged, this, [this](int) { + QWidget *tab = ui->aircraftTabs->currentWidget(); + + applyMessageFilter(); + + // Only a tab that IS one of the selection tables may re-derive the selection + // from it. Weather is not one, and falling through to the aircraft table there + // used to silently discard a flight selection - which empties Documents and + // ATC, since with nothing selected they show nothing. + if ((tab == ui->flightsTab) || (tab == ui->oldFlightsTab)) { + flightSelectionChanged(); + } else if ((tab == ui->aircraftTab) || (tab == ui->oldAircraftTab)) { + aircraftSelectionChanged(); + } + }); + + // Context menus: copy cell contents or find the aircraft on the Map + for (auto pair : { qMakePair((QTableView *) ui->aircraft, true), qMakePair((QTableView *) ui->oldAircraft, true), + qMakePair((QTableView *) ui->flights, false), qMakePair((QTableView *) ui->oldFlights, false) }) + { + QTableView *view = pair.first; + bool isAircraft = pair.second; + view->setContextMenuPolicy(Qt::CustomContextMenu); + connect(view, &QTableView::customContextMenuRequested, this, + [this, view, isAircraft](QPoint pos) { viewContextMenu(view, isAircraft, pos); }); + } + for (QTableWidget *table : {ui->documents, ui->logons, ui->atcMessages, ui->statistics}) + { + table->setContextMenuPolicy(Qt::CustomContextMenu); + connect(table, &QTableWidget::customContextMenuRequested, this, + [this, table](QPoint pos) { tableContextMenu(table, pos); }); + } + + // Aircraft photos from planespotters.net, shown for the selected aircraft + connect(&m_planeSpotters, &PlaneSpotters::aircraftPhoto, this, &AircraftGUI::aircraftPhoto); + connect(ui->photo, &ClickableLabel::clicked, this, &AircraftGUI::photoClicked); + ui->photoHeader->setVisible(false); + ui->photoFlag->setVisible(false); + ui->photo->setVisible(false); + ui->flightDetails->setVisible(false); + + // Charts + plotChart(); + plotProfileChart(); + + // Reuse the ADS-B demodulator's control tower icon (its resources are + // process wide); the "ATC" text shows if it isn't available + QIcon towerIcon(":/icons/controltower.png"); + if (!towerIcon.isNull()) { + ui->atcLabels->setIcon(towerIcon); + } + + // Column select menu + m_columnMenu = new QMenu(ui->aircraft); + for (int i = 0; i < AIRCRAFT_COLUMNS; i++) + { + QString text = m_aircraftModel->headerData(i, Qt::Horizontal).toString(); + m_columnMenu->addAction(createCheckableItem(text, i, true, SLOT(aircraftColumnSelectMenuChecked()))); + } + ui->aircraft->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); + connect(ui->aircraft->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), SLOT(aircraftColumnSelectMenu(QPoint))); + connect(ui->aircraft->horizontalHeader(), SIGNAL(sectionMoved(int, int, int)), SLOT(aircraft_sectionMoved(int, int, int))); + connect(ui->aircraft->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(aircraft_sectionResized(int, int, int))); + + m_flightColumnMenu = new QMenu(ui->flights); + for (int i = 0; i < FLIGHT_COLUMNS; i++) + { + QString text = m_flightModel->headerData(i, Qt::Horizontal).toString(); + m_flightColumnMenu->addAction(createCheckableItem(text, i, true, SLOT(flightColumnSelectMenuChecked()))); + } + ui->flights->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); + connect(ui->flights->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), SLOT(flightColumnSelectMenu(QPoint))); + + // The tables whose column state is not saved, so they need no menu of their own + addColumnMenu(ui->oldAircraft, AIRCRAFT_COLUMNS); + addColumnMenu(ui->oldFlights, FLIGHT_COLUMNS); + addColumnMenu(ui->weather, WEATHER_COL_REPORT + 1); + connect(ui->flights->horizontalHeader(), SIGNAL(sectionMoved(int, int, int)), SLOT(flights_sectionMoved(int, int, int))); + connect(ui->flights->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(flights_sectionResized(int, int, int))); + + // The tracker does all the processing on its own thread; these queued + // connections deliver its batched snapshots + AircraftTracker *t = tracker(); + connect(t, &AircraftTracker::aircraftUpdated, this, &AircraftGUI::trackerAircraftUpdated); + connect(t, &AircraftTracker::aircraftRemoved, this, &AircraftGUI::trackerAircraftRemoved); + connect(t, &AircraftTracker::flightsUpdated, this, &AircraftGUI::trackerFlightsUpdated); + connect(t, &AircraftTracker::flightsRemoved, this, &AircraftGUI::trackerFlightsRemoved); + connect(t, &AircraftTracker::documentsAdded, this, &AircraftGUI::trackerDocumentsAdded); + connect(t, &AircraftTracker::flightsMerged, this, &AircraftGUI::trackerFlightsMerged); + connect(t, &AircraftTracker::aircraftMerged, this, &AircraftGUI::trackerAircraftMerged); + connect(t, &AircraftTracker::atcMessages, this, &AircraftGUI::trackerAtcMessages); + connect(t, &AircraftTracker::weatherReports, this, &AircraftGUI::trackerWeatherReports); + connect(t, &AircraftTracker::profileUpdated, this, &AircraftGUI::trackerProfileUpdated); + connect(t, &AircraftTracker::messageRates, this, &AircraftGUI::trackerMessageRates); + connect(t, &AircraftTracker::statisticsUpdated, this, &AircraftGUI::trackerStatistics); + connect(t, &AircraftTracker::speechNotification, this, &AircraftGUI::trackerSpeechNotification); + connect(t, &AircraftTracker::allCleared, this, &AircraftGUI::trackerAllCleared); + connect(t, &AircraftTracker::databaseFilenameReverted, + this, &AircraftGUI::trackerDatabaseFilenameReverted); + connect(t, &AircraftTracker::selectRequested, this, &AircraftGUI::trackerSelectRequested); + + m_settings.setRollupState(&m_rollupState); + + displaySettings(); + applySettings(true); + makeUIConnections(); + m_resizer.enableChildMouseTracking(); + + // Get the current state - the tracker may have restored a session before + // this GUI connected + t->getInputMessageQueue()->push(AircraftTracker::MsgResync::create()); +} + +AircraftGUI::~AircraftGUI() +{ + delete ui; +} + +void AircraftGUI::makeUIConnections() +{ + QObject::connect( + ui->deleteAircraft, + &QToolButton::clicked, + this, + &AircraftGUI::on_deleteAircraft_clicked + ); + QObject::connect( + ui->settings, + &QToolButton::clicked, + this, + &AircraftGUI::on_settings_clicked + ); + QObject::connect(ui->feed, &ButtonSwitch::clicked, this, &AircraftGUI::on_feed_clicked); + // The settings are behind a right click, as they were on the demodulator's button + CRightClickEnabler *feedRightClickEnabler = new CRightClickEnabler(ui->feed); + connect(feedRightClickEnabler, &CRightClickEnabler::rightClick, this, &AircraftGUI::feedSelect); + + // Same gesture the ADS-B demodulator uses for its own coverage map. Queued because + // the tracker lives on its own thread. + CRightClickEnabler *coverageRightClickEnabler = new CRightClickEnabler(ui->coverage); + connect(coverageRightClickEnabler, &CRightClickEnabler::rightClick, this, [this] (const QPoint&) { + QMetaObject::invokeMethod(m_aircraft->getTracker(), "clearCoverage", Qt::QueuedConnection); + }); + QObject::connect( + ui->notifications, + &QToolButton::clicked, + this, + &AircraftGUI::on_notifications_clicked + ); + QObject::connect( + ui->atcLabels, + &ButtonSwitch::clicked, + this, + &AircraftGUI::on_atcLabels_clicked + ); + // The statistics sit to the right of the tables. Give the tables the bulk of the + // width by default - the statistics are two narrow columns and a date - while still + // letting the handle be dragged. + ui->aircraftSplitter->setStretchFactor(0, 4); + ui->aircraftSplitter->setStretchFactor(1, 1); + + QObject::connect(ui->stats, &ButtonSwitch::clicked, this, &AircraftGUI::on_stats_clicked); + ui->stats->setContextMenuPolicy(Qt::CustomContextMenu); + QObject::connect(ui->stats, &QWidget::customContextMenuRequested, this, &AircraftGUI::statsContextMenu); + QObject::connect(ui->displayChart, &ButtonSwitch::clicked, this, &AircraftGUI::on_displayChart_clicked); + QObject::connect(ui->coverage, &ButtonSwitch::clicked, this, &AircraftGUI::on_coverage_clicked); + ui->displayChart->setContextMenuPolicy(Qt::CustomContextMenu); + QObject::connect(ui->displayChart, &QWidget::customContextMenuRequested, this, &AircraftGUI::chartContextMenu); + + // Nothing is selected yet, so the two history tabs have nothing to be about. They + // are visible in the .ui so that they can be seen while it is being edited. + updateHistoryTables(); +} + +void AircraftGUI::blockApplySettings(bool block) +{ + m_doApplySettings = !block; +} + +void AircraftGUI::applySettings(bool force) +{ + if (m_doApplySettings) + { + Aircraft::MsgConfigureAircraft* message = Aircraft::MsgConfigureAircraft::create(m_settings, m_settingsKeys, force); + m_aircraft->getInputMessageQueue()->push(message); + } + + m_settingsKeys.clear(); +} + +// Default column widths from representative content +// Row numbers down the left of a table. The numbers themselves come from +// ActiveFilterProxy::headerData(), which counts displayed position rather than source +// row so that the top row is 1 whatever the sort order. +// +// The header is left non-clickable: clicking a vertical section selects the row, which +// the table already does when a cell is clicked, and making it look interactive invites +// the assumption that it sorts. +void AircraftGUI::showRowNumbers(QTableView *table) +{ + QHeaderView *header = table->verticalHeader(); + header->setVisible(true); + header->setSectionsClickable(false); + header->setHighlightSections(false); + // The resize mode is deliberately left alone. Setting ResizeToContents here - which + // seemed reasonable, since the rows carry airline logos of differing heights - makes + // the header re-measure EVERY row whenever anything in the table changes. On a table + // holding a session's worth of restored aircraft, each measurement pulls in that + // row's logo and sideview images, and start up went from seconds to over a minute of + // a blocked GUI. Row numbering does not need it: the view sizes its own rows exactly + // as it did when the header was hidden. +} + +// The Statistics tab. Rebuilt wholesale on each update - it is a couple of dozen rows +// arriving a few times a second at most, and a table that small is cheaper to refill +// than to diff. +// +// Every figure is given twice, for this session and for all time, because the pair is +// what makes either readable: 210 km on its own says nothing, 210 km against an all time +// best of 340 km says the band is poor today. The session columns come first, as the +// ones that change while you watch. +void AircraftGUI::trackerStatistics(const AircraftStatistics& statistics) +{ + PROFILER_START() + QTableWidget *table = ui->statistics; + const bool first = (table->columnCount() == 0); + if (first) + { + table->setColumnCount(5); + table->setHorizontalHeaderLabels( + { "Statistic", "Session", "Session set by", "All time", "All time set by" }); + table->horizontalHeader()->setSectionsMovable(true); + table->verticalHeader()->setVisible(false); + } + + QList rows; + + auto record = [](const AircraftStatistics::Record& r, const QString& suffix) + { + if (!r.m_valid) { + return QStringList{ QString(), QString() }; + } + // Who, when, and on what. The row already says which protocol, but not which of + // its frequencies - and on HFDL, where the usable band moves through the day, + // that is most of what the record tells you. Records kept before the frequency + // was recorded have none, and simply do not show one. + QString by = QString("%1, %2").arg(r.m_aircraft, + r.m_when.isValid() ? r.m_when.toString("yyyy-MM-dd hh:mm") : QString("?")); + if (r.m_frequency) { + by.append(QString(", %1 MHz").arg(r.m_frequency / 1e6, 0, 'f', 3)); + } + return QStringList{ QString("%1 %2").arg(r.m_value, 0, 'f', 1).arg(suffix), by }; + }; + + // Interleaves a statistic computed for each scope into one row: label, then the + // session's value and detail, then all time's + auto both = [&rows](const QString& label, const QStringList& session, + const QStringList& allTime) + { + rows.append(QStringList{ label } + session + allTime); + }; + + const AircraftStatistics::Scope& ses = statistics.m_session; + const AircraftStatistics::Scope& all = statistics.m_allTime; + + // Furthest per protocol. They are wildly different by nature - line of sight VHF + // against HF skywave against a satellite downlink - so one combined figure would + // say nothing useful. + for (int i : AircraftReport::displayOrder()) + { + if (!AircraftReport::reportsPosition(i)) { + continue; + } + // The tracker's names, which the web API report uses too, so the two cannot drift + both(QString("Maximum range, %1").arg(AircraftTracker::protocolName(i)), + record(ses.m_maxRange[i], "km"), record(all.m_maxRange[i], "km")); + } + + both("Fastest ground speed", record(ses.m_fastest, "kn"), record(all.m_fastest, "kn")); + both("Highest altitude", record(ses.m_highest, "ft"), record(all.m_highest, "ft")); + + auto concurrent = [](const AircraftStatistics::Scope& scope) + { + return QStringList{ QString::number(scope.m_maxConcurrent), + scope.m_maxConcurrentWhen.isValid() + ? scope.m_maxConcurrentWhen.toString("yyyy-MM-dd hh:mm") : QString() }; + }; + both(QString("Most aircraft at once (%1 min)").arg(AircraftStatistics::ConcurrentWindowMins), + concurrent(ses), concurrent(all)); + + both("Aircraft heard", + QStringList{ QString::number(ses.m_distinctAircraft), QString() }, + QStringList{ QString::number(all.m_distinctAircraft), QString() }); + both("Total messages", + QStringList{ QString::number(ses.m_totalMessages), QString() }, + QStringList{ QString::number(all.m_totalMessages), QString() }); + + // A property of the database rather than of either period, so it goes in the all time + // column - which is the one the aircraft, flight and message counts beside it describe + both("Database size", QStringList{ QString(), QString() }, + QStringList{ statistics.m_databaseBytes > 0 + ? QString("%1 MB").arg(statistics.m_databaseBytes / (1024.0 * 1024.0), 0, 'f', 1) + : QString(), + QFileInfo(AircraftTracker::databasePath(m_settings)).fileName() }); + + // The share is of that scope's own total, so a protocol that has been quiet today + // shows its reduced share against its long run one rather than against nothing + auto messages = [](const AircraftStatistics::Scope& scope, int protocol) + { + const quint64 n = scope.m_messagesByProtocol[protocol]; + QString share; + if (scope.m_totalMessages > 0) { + share = QString("%1%").arg(100.0 * n / scope.m_totalMessages, 0, 'f', 1); + } + return QStringList{ QString::number(n), share }; + }; + for (int i : AircraftReport::displayOrder()) { + both(QString("Messages, %1").arg(AircraftTracker::protocolName(i)), messages(ses, i), messages(all, i)); + } + + auto elapsed = [](qint64 secs, const QDateTime& since) + { + if (secs <= 0) { + return QStringList{ QString(), QString() }; + } + return QStringList{ QString("%1h %2m").arg(secs / 3600).arg((secs % 3600) / 60), + since.isValid() ? QString("since %1").arg(since.toString("yyyy-MM-dd hh:mm")) + : QString() }; + }; + both("Listening time", elapsed(ses.m_seconds, statistics.m_sessionStart), + elapsed(all.m_seconds, statistics.m_firstStart)); + + auto perMinute = [](const AircraftStatistics::Scope& scope) + { + if (scope.m_seconds <= 0) { + return QStringList{ QString(), QString() }; + } + return QStringList{ + QString("%1").arg(scope.m_totalMessages * 60.0 / scope.m_seconds, 0, 'f', 1), + QString() }; + }; + both("Messages per minute", perMinute(ses), perMinute(all)); + + table->setRowCount(rows.size()); + for (int row = 0; row < rows.size(); row++) + { + for (int col = 0; col < table->columnCount(); col++) + { + QTableWidgetItem *item = table->item(row, col); + if (!item) + { + item = new QTableWidgetItem(); + table->setItem(row, col, item); + } + item->setText(rows[row].value(col)); + } + } + if (first) { + table->resizeColumnsToContents(); + } + PROFILER_STOP("Aircraft table: statistics") +} + +void AircraftGUI::setDefaultColumnWidths() +{ + + const QFontMetrics fm(font()); + // A sorted column draws a sort arrow in its header, and the header lays that out + // BESIDE the text rather than over it - so a width that only just fits the text hid + // the text itself the moment the column was sorted on. The style knows how big the + // arrow is; asking it is better than picking a number that is wrong on another theme. + QHeaderView *anyHeader = ui->flights->horizontalHeader(); + const int sortArrow = style()->pixelMetric(QStyle::PM_HeaderMarkSize, nullptr, anyHeader) + + 2 * style()->pixelMetric(QStyle::PM_HeaderMargin, nullptr, anyHeader); + auto width = [&fm, sortArrow](const char *sample) { + return fm.horizontalAdvance(sample) + 12 + sortArrow; + }; + + ui->aircraft->setColumnWidth(AircraftTableModel::COL_ICAO, width("ABCDEF")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_REG, width("G-ABCDEF")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_TYPE, width("B77W")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_FLIGHT, width("RYR33KQW")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_FLIGHT_NO, width("Flight No")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_AIRLINE, std::max(90, width("Airline name"))); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_SIDEVIEW, 90); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_COUNTRY, 45); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_LATITUDE, width("-90.00000")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_LONGITUDE, width("-180.00000")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_DISTANCE, width("Dist (km)")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_ALTITUDE, width("40000")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_HEADING, width("360")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_SPEED, width("500")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_PROTOCOLS, width("ACARS 131.725; HFDL 10.081")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_MESSAGES, width("10000")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_LAST_SEEN, width("12/12/2026 12:00:00")); + ui->aircraft->setColumnWidth(AircraftTableModel::COL_SELCAL, width("SELCAL")); + + // Every column, not just some: the ones left out took Qt's default and came out far + // wider than a tick or a time needs. Sized to the widest thing each actually shows, + // or to its own heading where that is wider - a column narrower than its title reads + // as truncated even when the data fits. + ui->flights->setColumnWidth(FlightTableModel::COL_FLIGHT, width("RYR33KQW")); + ui->flights->setColumnWidth(FlightTableModel::COL_FLIGHT_NO, width("Flight No")); + ui->flights->setColumnWidth(FlightTableModel::COL_REG, width("G-ABCDEF")); + ui->flights->setColumnWidth(FlightTableModel::COL_FROM, width("WWWW")); + ui->flights->setColumnWidth(FlightTableModel::COL_TO, width("WWWW")); + ui->flights->setColumnWidth(FlightTableModel::COL_DOCS, width("Docs")); + // A tick, so the heading is what sets the width + ui->flights->setColumnWidth(FlightTableModel::COL_LS, width("LS")); + ui->flights->setColumnWidth(FlightTableModel::COL_CL, width("CL")); + ui->flights->setColumnWidth(FlightTableModel::COL_FP, width("FP")); + // Shown as hh:mm, and the headings are shorter than that + ui->flights->setColumnWidth(FlightTableModel::COL_OUT, width("00:00")); + ui->flights->setColumnWidth(FlightTableModel::COL_OFF, width("00:00")); + ui->flights->setColumnWidth(FlightTableModel::COL_ON, width("00:00")); + ui->flights->setColumnWidth(FlightTableModel::COL_IN, width("00:00")); + ui->flights->setColumnWidth(FlightTableModel::COL_FIRST_SEEN, width("12/12/2026 12:00:00")); + ui->flights->setColumnWidth(FlightTableModel::COL_LAST_SEEN, width("12/12/2026 12:00:00")); + ui->flights->setColumnWidth(FlightTableModel::COL_PROTOCOLS, width("ACARS 131.725; HFDL 10.081")); + ui->flights->setColumnWidth(FlightTableModel::COL_ROUTE_SOURCE, width("Message <>DB")); + + // The archive views show the same columns, so give them the same widths + for (auto pair : { qMakePair((QTableView *) ui->aircraft, (QTableView *) ui->oldAircraft), + qMakePair((QTableView *) ui->flights, (QTableView *) ui->oldFlights) }) + { + for (int col = 0; col < pair.first->model()->columnCount(); col++) { + pair.second->setColumnWidth(col, pair.first->columnWidth(col)); + } + } + + // These carry a date and a time to the second now. Left at the default width they + // wrapped onto two lines, which they were already close to doing without the seconds. + ui->documents->setColumnWidth(DOCUMENT_COL_TIME, width("29/08/2026 13:41:22")); + ui->atcMessages->setColumnWidth(ATC_COL_TIME, width("29/08/2026 13:41:22")); + // Wide enough for a protocol and an HF frequency, which is the longest it gets + ui->atcMessages->setColumnWidth(ATC_COL_PROTOCOL, width("HFDL 11384.000")); +} + +void AircraftGUI::displaySettings() +{ + setTitleColor(m_settings.m_rgbColor); + setWindowTitle(m_settings.m_title); + setTitle(m_settings.m_title); + blockApplySettings(true); + + ui->atcLabels->setChecked(m_settings.m_atcLabels); + ui->stats->setChecked(m_settings.m_displayStatistics); + ui->statistics->setVisible(m_settings.m_displayStatistics); + ui->displayChart->setChecked(m_settings.m_displayChart); + ui->coverage->setChecked(m_settings.m_displayCoverage); + // The feed itself is restored by applySettings(), which calls updateFeedConnections() + // whatever changed - so without this the feed came back up on restart while its + // button sat unlit, saying the opposite of what was happening + ui->feed->setChecked(m_settings.m_feedEnabled); + ui->chart->setVisible(m_settings.m_displayChart); + + // Order and size columns + QHeaderView *header = ui->aircraft->horizontalHeader(); + + for (int i = 0; i < AIRCRAFT_COLUMNS; i++) + { + bool hidden = m_settings.m_columnSizes[i] == 0; + header->setSectionHidden(i, hidden); + if (i < m_columnMenu->actions().size()) { + m_columnMenu->actions().at(i)->setChecked(!hidden); + } + if (m_settings.m_columnSizes[i] > 0) { + ui->aircraft->setColumnWidth(i, m_settings.m_columnSizes[i]); + } + } + restoreColumnOrder(header, m_settings.m_columnIndexes, AIRCRAFT_COLUMNS); + showAllColumnsIfNoneVisible(ui->aircraft, m_settings.m_columnSizes, AIRCRAFT_COLUMNS, m_columnMenu); + + QHeaderView *flightHeader = ui->flights->horizontalHeader(); + for (int i = 0; i < FLIGHT_COLUMNS; i++) + { + bool hidden = m_settings.m_flightColumnSizes[i] == 0; + flightHeader->setSectionHidden(i, hidden); + if (i < m_flightColumnMenu->actions().size()) { + m_flightColumnMenu->actions().at(i)->setChecked(!hidden); + } + if (m_settings.m_flightColumnSizes[i] > 0) { + ui->flights->setColumnWidth(i, m_settings.m_flightColumnSizes[i]); + } + } + restoreColumnOrder(flightHeader, m_settings.m_flightColumnIndexes, FLIGHT_COLUMNS); + showAllColumnsIfNoneVisible(ui->flights, m_settings.m_flightColumnSizes, FLIGHT_COLUMNS, m_flightColumnMenu); + + // After the column work, so the tables are their final shape before the splitters + // are asked to divide the space between them + restoreSplitters(m_settings.m_splitterStates); + + getRollupContents()->restoreState(m_rollupState); + blockApplySettings(false); + getRollupContents()->arrangeRollups(); +} + +void AircraftGUI::onMenuDialogCalled(const QPoint &p) +{ + if (m_contextMenuType == ContextMenuType::ContextMenuChannelSettings) + { + BasicFeatureSettingsDialog dialog(this); + dialog.setTitle(m_settings.m_title); + dialog.setUseReverseAPI(m_settings.m_useReverseAPI); + dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); + dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); + dialog.setReverseAPIFeatureSetIndex(m_settings.m_reverseAPIFeatureSetIndex); + dialog.setReverseAPIFeatureIndex(m_settings.m_reverseAPIFeatureIndex); + dialog.setDefaultTitle(m_displayedName); + + dialog.move(p); + new DialogPositioner(&dialog, false); + dialog.exec(); + + m_settings.m_title = dialog.getTitle(); + m_settings.m_useReverseAPI = dialog.useReverseAPI(); + m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); + m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); + m_settings.m_reverseAPIFeatureSetIndex = dialog.getReverseAPIFeatureSetIndex(); + m_settings.m_reverseAPIFeatureIndex = dialog.getReverseAPIFeatureIndex(); + + setTitle(m_settings.m_title); + setTitleColor(m_settings.m_rgbColor); + + m_settingsKeys.append("title"); + m_settingsKeys.append("useReverseAPI"); + m_settingsKeys.append("reverseAPIAddress"); + m_settingsKeys.append("reverseAPIPort"); + m_settingsKeys.append("reverseAPIFeatureSetIndex"); + m_settingsKeys.append("reverseAPIFeatureIndex"); + + applySettings(); + } + + resetContextMenuType(); +} + +// ---- Snapshots from the tracker ---- + +void AircraftGUI::trackerAircraftUpdated(const QList& aircraft) +{ + PROFILER_START() + // As ADS-B does: the view repaints on every dataChanged otherwise, and each repaint + // of a table cell costs a SystemParametersInfo syscall per primitive drawn through + // the Fusion style, so a batch of a hundred aircraft repainted the table a hundred + // times + // Both views, since both are proxies over the one model and both relayout + const ViewSelections before = selectedIds(false); + ui->aircraft->setUpdatesEnabled(false); + ui->oldAircraft->setUpdatesEnabled(false); + m_ignoreSelectionChanges = true; + m_aircraftModel->upsert(aircraft); + // The one re-sort and re-filter of the live view for the whole batch - see the + // constructor. An aircraft archived here leaves the view without the neighbouring + // row being selected in its place, as it would be by a row removal. + m_aircraftProxy->invalidate(); + m_ignoreSelectionChanges = false; + ui->aircraft->setUpdatesEnabled(true); + ui->oldAircraft->setUpdatesEnabled(true); + keepSelections(false, before); + + // Keep the selection-derived state fresh + bool survivorArrived = false; + for (const AircraftDisplay& d : aircraft) + { + if (d.m_id == m_selectedAircraftId) + { + m_selectedRegistration = d.m_registration; + m_selectedIcao = d.m_icao; + } + survivorArrived = survivorArrived || ((m_reselectAircraftId != 0) && (d.m_id == m_reselectAircraftId)); + } + // The survivor of a merge that took a selected row with it, as it is after the merge. + // Not before: the row it had until now can be in the other view of the pair from the + // one the merge has put it in, and selecting it there would have the selection taken + // away again when this batch moved it. + if (survivorArrived) { + reselectMerged(); + } + PROFILER_STOP("Aircraft table: aircraft upsert") +} + +// Gone for good - discarded by the retention sweep, or absorbed into another aircraft, +// which trackerAircraftMerged() has already been told about. Archiving is not removal: +// an archived aircraft stays in the model and moves to the other view. +void AircraftGUI::trackerAircraftRemoved(const QList& ids) +{ + // The row of an aircraft that was merged away goes here, and with it the selection + // if it was the selected one. That selection has already been moved to the survivor, + // and is put on its row when the tracker sends it. Any other selection stays with the + // aircraft it was made on - see keepSelections(). + const ViewSelections before = selectedIds(false); + m_ignoreSelectionChanges = true; + m_aircraftModel->remove(ids); + m_ignoreSelectionChanges = false; + keepSelections(false, before); + if (ids.contains(m_selectedAircraftId)) { + m_selectedAircraftId = 0; + } + if (ids.contains(m_reselectAircraftId)) { + m_reselectAircraftId = 0; // The survivor went too, so there is nothing to put back + } + + // Their messages go too, or the tables grow for as long as the feature runs. A row + // whose flight is still with us is kept: the flight is what it belongs to, and an + // absorbed aircraft's flights move to the survivor rather than going with it. + const QSet gone(ids.begin(), ids.end()); + removeMessageRows([this, &gone](quint64 aircraftId, quint64 flightId) { + return gone.contains(aircraftId) && ((flightId == 0) || (m_flightModel->rowOf(flightId) < 0)); + }); + // The retention sweep is what removes aircraft other than by merging, and the tracker + // prunes its own log of what belongs to nothing at the same time + pruneOrphanMessageRows(); + + // The selected aircraft itself was discarded, which the view was not allowed to turn + // into a selection of its neighbour, so nothing else will deselect it + if ((m_selectionOwner == SelectionAircraft) && (m_reselectAircraftId == 0) + && (m_aircraftModel->rowOf(m_selectedAircraftId) < 0)) { + dropSelection(); + } +} + +void AircraftGUI::trackerFlightsUpdated(const QList& flights) +{ + PROFILER_START() + // As trackerAircraftUpdated() + const ViewSelections before = selectedIds(true); + ui->flights->setUpdatesEnabled(false); + ui->oldFlights->setUpdatesEnabled(false); + m_ignoreSelectionChanges = true; + m_flightModel->upsert(flights); + m_flightProxy->invalidate(); + m_ignoreSelectionChanges = false; + ui->flights->setUpdatesEnabled(true); + ui->oldFlights->setUpdatesEnabled(true); + keepSelections(true, before); + // The survivor of a merge is reselected only once its row is as the merge left it, as + // in trackerAircraftUpdated(). Typically the merged-away flight was the current one + // and the survivor an older name for it, archived until the merge made it current: + // selected straight away it was selected in the archive, and lost from there when + // this batch moved it back to the live view. reselectMerged() refills the history + // tables itself when it succeeds. + bool survivorArrived = false; + for (const FlightDisplay& d : flights) + { + if ((m_reselectFlightId != 0) && (d.m_id == m_reselectFlightId)) + { + survivorArrived = true; + break; + } + } + const bool reselected = survivorArrived && reselectMerged(); + // A new flight for the aircraft on screen, or a new aircraft on the flight on screen, + // has to show up without the user clicking away and back + if (!reselected && ((m_selectedAircraftId != 0) || !m_selectedFlightNumber.isEmpty())) { + updateHistoryTables(); + } + PROFILER_STOP("Aircraft table: flights upsert") +} + +// Two flights were the same flight, so everything shown against the old one now belongs +// to the survivor. +// +// The document and ATC tables hold every message from every aircraft and show only the +// rows whose flight is the selected one, so a row still tagged with the id that has just +// been merged away matches nothing and is hidden. That is what made a selected flight's +// documents disappear a few seconds after they appeared - the ACARS and ADS-B names for +// it were recognised as one flight, and the rows were left pointing at the half that +// ceased to exist. Selecting the flight again rebuilt them, which is why it looked +// intermittent rather than broken. +void AircraftGUI::trackerFlightsMerged(quint64 from, quint64 to) +{ + retagMessageRows(Qt::UserRole + 2, from, to); + // The selection follows the flight rather than being dropped with the id it was + // made under. Done here, before flightsRemoved is delivered, so that its own test + // for the selected flight no longer matches. + if (m_selectedFlightId == from) + { + m_selectedFlightId = to; + // The row it was made on is about to be removed, which empties the view's + // selection; the survivor's row takes it over once the tracker sends it as the + // merge left it - see trackerFlightsUpdated() + if (m_selectionOwner == SelectionFlight) { + m_reselectFlightId = to; + } + } + if (m_reselectFlightId == from) { + m_reselectFlightId = to; // Merged again before its row arrived + } + // The tracker moves its watch to the survivor and sends the profile under the + // survivor's id, which would otherwise be discarded as being for some other flight + // and leave the chart frozen at the moment of the merge + if (m_profileFlightId == from) { + m_profileFlightId = to; + } + applyMessageFilter(); +} + +// The same for an aircraft: a weak duplicate - known only by one identifier - turned out +// to be an airframe already tracked under another, and has been absorbed into it. Its +// flights keep their ids, so only what is held against the aircraft id has to move. +void AircraftGUI::trackerAircraftMerged(quint64 from, quint64 to) +{ + retagMessageRows(Qt::UserRole + 1, from, to); + if (m_selectedAircraftId == from) + { + m_selectedAircraftId = to; + if (m_selectionOwner == SelectionAircraft) { + m_reselectAircraftId = to; + } + } + if (m_reselectAircraftId == from) { + m_reselectAircraftId = to; + } + // Still the same aircraft's history, so a sort chosen in Past Flights is kept + if (m_pastFlightsAircraftId == from) { + m_pastFlightsAircraftId = to; + } + applyMessageFilter(); +} + +// Gone for good - discarded with its aircraft by the retention sweep, or merged into +// another flight, which trackerFlightsMerged() has already been told about +void AircraftGUI::trackerFlightsRemoved(const QList& ids) +{ + // As in trackerAircraftRemoved(): a selected row removed because its flight was + // merged is a selection we mean to keep + const ViewSelections before = selectedIds(true); + m_ignoreSelectionChanges = true; + m_flightModel->remove(ids); + m_ignoreSelectionChanges = false; + keepSelections(true, before); + if (ids.contains(m_reselectFlightId)) { + m_reselectFlightId = 0; + } + + // A merged flight's rows were moved to the survivor before this, so these are the + // rows of flights that are genuinely gone + const QSet gone(ids.begin(), ids.end()); + removeMessageRows([&gone](quint64 aircraftId, quint64 flightId) { + (void) aircraftId; + return (flightId != 0) && gone.contains(flightId); + }); + + if (ids.contains(m_selectedFlightId)) + { + m_selectedFlightId = 0; + // Nothing can match a selection that no longer exists, so the tables would keep + // showing whatever was last let through until something else refiltered them + applyMessageFilter(); + } + // As for an aircraft: the selected flight was discarded, not merged + if ((m_selectionOwner == SelectionFlight) && (m_reselectFlightId == 0) + && (m_flightModel->rowOf(m_selectedFlightId) < 0)) + { + dropSelection(); // Refills the history tables as well + return; + } + // The history tables list flights too, and would go on listing the removed ones + // until the next flush happened to refill them + if ((m_selectedAircraftId != 0) || !m_selectedFlightNumber.isEmpty()) { + updateHistoryTables(); + } +} + +// A time cell that shows seconds and still sorts chronologically. A QDateTime in the +// display role sorts correctly but Qt renders it in the locale's SHORT format, which has +// no seconds; a formatted string shows what we want but sorts by its first character, so +// the 2nd of a month would come before the 29th of the one before it. The two therefore +// have to be separated - the text is what is shown, the date what is compared. +// +// The date part keeps the locale's own format so the column looks as it did; only the +// time is spelled out. +class DateTimeTableItem : public QTableWidgetItem +{ +public: + explicit DateTimeTableItem(const QDateTime& when) : + QTableWidgetItem(when.toString(format())), + m_when(when) + { + } + + bool operator<(const QTableWidgetItem& other) const override + { + const DateTimeTableItem *item = dynamic_cast(&other); + return item ? (m_when < item->m_when) : QTableWidgetItem::operator<(other); + } + + const QDateTime& when() const { return m_when; } + +private: + static const QString& format() + { + static const QString f = QLocale().dateFormat(QLocale::ShortFormat) + " hh:mm:ss"; + return f; + } + + QDateTime m_when; +}; + +// Re-points the Documents, Logons and ATC rows tagged with one aircraft or flight id +// (the role says which) at another +void AircraftGUI::retagMessageRows(int role, quint64 from, quint64 to) +{ + for (QTableWidget *table : {ui->documents, ui->logons, ui->atcMessages}) + { + for (int row = 0; row < table->rowCount(); row++) + { + QTableWidgetItem *item = table->item(row, 0); + if (item && (item->data(role).toULongLong() == from)) { + item->setData(role, (qulonglong) to); + } + } + } +} + +// Takes out of the Documents, Logons and ATC tables the rows the test picks, given each +// row's aircraft and flight ids - and, when olderThan is valid, only those received before +// it. Unattributed SELCAL calls carry neither id, so a test for the ids of something that +// has gone never picks them; only pruneOrphanMessageRows() does, by age. +// +// From the bottom up and a run of adjacent rows at a time, so each removal moves only +// the rows below it once. The header keeps the hidden flags of the rows that remain in +// step with them, so nothing needs refiltering afterwards. +void AircraftGUI::removeMessageRows(const std::function& matches, + const QDateTime& olderThan) +{ + for (QTableWidget *table : {ui->documents, ui->logons, ui->atcMessages}) + { + auto rowMatches = [table, &matches, &olderThan](int row) { + const QTableWidgetItem *item = table->item(row, 0); + if (!item) { + return false; + } + if (olderThan.isValid()) + { + // Every row's first item is one of these - trackerDocumentsAdded() and + // trackerAtcMessages() are what fill the tables + const DateTimeTableItem *timeItem = dynamic_cast(item); + if (!timeItem || !timeItem->when().isValid() || (timeItem->when() >= olderThan)) { + return false; + } + } + return matches(item->data(Qt::UserRole + 1).toULongLong(), + item->data(Qt::UserRole + 2).toULongLong()); + }; + bool updatesSuspended = false; + int row = table->rowCount() - 1; + while (row >= 0) + { + if (!rowMatches(row)) + { + row--; + continue; + } + const int last = row; + while ((row >= 0) && rowMatches(row)) { + row--; + } + if (!updatesSuspended) + { + table->setUpdatesEnabled(false); + updatesSuspended = true; + } + table->model()->removeRows(row + 1, last - row); + } + if (updatesSuspended) { + table->setUpdatesEnabled(true); + } + } +} + +// The tracker's retention sweep discards an ATC message that belongs to no aircraft it +// still holds once the message is older than the retention period: an unattributed SELCAL +// call, or a message from an aircraft that went before its messages were taken with it. +// The tables here are only ever pruned by the aircraft and flights the tracker removes, so +// without the same rule those rows stayed until the feature was restarted. Documents and +// logons go by it too, keeping a row while its flight is still with us as +// trackerAircraftRemoved() does, and weather reports, which are about airports, go by +// age alone as the tracker's do. +void AircraftGUI::pruneOrphanMessageRows() +{ + if (m_settings.m_retentionDays <= 0) { + return; + } + m_orphansPrunedMs = QDateTime::currentMSecsSinceEpoch(); + const QDateTime cutoff = QDateTime::currentDateTime().addDays(-m_settings.m_retentionDays); + removeMessageRows([this](quint64 aircraftId, quint64 flightId) { + return ((aircraftId == 0) || (m_aircraftModel->rowOf(aircraftId) < 0)) + && ((flightId == 0) || (m_flightModel->rowOf(flightId) < 0)); + }, cutoff); + + bool updatesSuspended = false; + for (int row = ui->weather->rowCount() - 1; row >= 0; row--) + { + const QTableWidgetItem *item = ui->weather->item(row, WEATHER_COL_TIME); + const QDateTime received = item ? item->data(Qt::DisplayRole).toDateTime() : QDateTime(); + if (received.isValid() && (received < cutoff)) + { + if (!updatesSuspended) + { + ui->weather->setUpdatesEnabled(false); + updatesSuspended = true; + } + ui->weather->removeRow(row); + } + } + if (updatesSuspended) { + ui->weather->setUpdatesEnabled(true); + } +} + +void AircraftGUI::trackerDocumentsAdded(const QList& documents) +{ + PROFILER_START() + // Size and repaint each table once for the batch. The rows are split between two + // tables, so count them before sizing rather than growing a row at a time + int logonCount = 0; + for (const DocumentEvent& e : documents) { + logonCount += (e.m_kind == "Logon") ? 1 : 0; + } + ui->documents->setUpdatesEnabled(false); + ui->logons->setUpdatesEnabled(false); + int nextDocumentRow = ui->documents->rowCount(); + int nextLogonRow = ui->logons->rowCount(); + ui->documents->setRowCount(nextDocumentRow + documents.size() - logonCount); + ui->logons->setRowCount(nextLogonRow + logonCount); + ui->documents->setSortingEnabled(false); + ui->logons->setSortingEnabled(false); + const int firstDocumentRow = nextDocumentRow; + const int firstLogonRow = nextLogonRow; + QSet addedDocuments; + QSet addedLogons; + for (const DocumentEvent& e : documents) + { + // Logons go to their own tab. There are far more of them than of everything else + // together - 6610 against 700 in a week here - so left in with the flight plans + // and clearances they buried them. + const bool logon = (e.m_kind == "Logon"); + QTableWidget *table = logon ? ui->logons : ui->documents; + const int row = logon ? nextLogonRow++ : nextDocumentRow++; + QTableWidgetItem *timeItem = new DateTimeTableItem(e.m_received); + timeItem->setData(Qt::UserRole, e.m_text); + timeItem->setData(Qt::UserRole + 1, (qulonglong) e.m_aircraftId); + timeItem->setData(Qt::UserRole + 2, (qulonglong) e.m_flightId); + timeItem->setData(Qt::UserRole + 3, e.m_mapName); + table->setItem(row, DOCUMENT_COL_TIME, timeItem); + (logon ? addedLogons : addedDocuments).insert(timeItem); + table->setItem(row, DOCUMENT_COL_FLIGHT, new QTableWidgetItem(e.m_flight)); + table->setItem(row, DOCUMENT_COL_REG, new QTableWidgetItem(e.m_reg)); + table->setItem(row, DOCUMENT_COL_TYPE, new QTableWidgetItem(e.m_kind)); + table->setItem(row, DOCUMENT_COL_TITLE, new QTableWidgetItem(e.m_title)); + } + // setSortingEnabled(true) sorts immediately, and a row's hidden flag belongs to the + // VIEW's row number rather than to the item, so it does not travel with the row. + // Hiding inside the loop above therefore left the flags on whichever rows the sort + // happened to move into those positions - documents vanishing or being replaced by + // unrelated ones, with nothing touched. + ui->documents->setSortingEnabled(true); + ui->logons->setSortingEnabled(true); + // Usually the new rows have sorted to the end and nothing else moved, and then only + // they need filtering. Both are tried, so neither is left unfiltered when the other + // falls back to the full pass. + const bool documentsFiltered = filterAppendedRows(ui->documents, firstDocumentRow, addedDocuments); + const bool logonsFiltered = filterAppendedRows(ui->logons, firstLogonRow, addedLogons); + if (!documentsFiltered || !logonsFiltered) { + applyMessageFilter(); + } + // After the filter: hiding rows repaints too, so keep both suppressed until the end + ui->documents->setUpdatesEnabled(true); + ui->logons->setUpdatesEnabled(true); + PROFILER_STOP("Aircraft table: documents") +} + +// Weather is about airports, so unlike the Documents and ATC tables it is not filtered +// by the selected aircraft - the aircraft that carried a METAR is incidental to it. +void AircraftGUI::trackerWeatherReports(const QList& reports) +{ + PROFILER_START() + ui->weather->setSortingEnabled(false); + for (const WeatherEvent& e : reports) + { + int row = ui->weather->rowCount(); + ui->weather->setRowCount(row + 1); + + QTableWidgetItem *timeItem = new QTableWidgetItem(); + timeItem->setData(Qt::DisplayRole, e.m_received); + timeItem->setData(Qt::UserRole, e.m_text); // Read back by the detail pane + ui->weather->setItem(row, WEATHER_COL_TIME, timeItem); + ui->weather->setItem(row, WEATHER_COL_AIRPORT, new QTableWidgetItem(e.m_airport)); + ui->weather->setItem(row, WEATHER_COL_TYPE, new QTableWidgetItem(e.m_kind)); + ui->weather->setItem(row, WEATHER_COL_VIA, new QTableWidgetItem(e.m_from)); + QTableWidgetItem *reportItem = new QTableWidgetItem(e.m_summary); + reportItem->setToolTip(e.m_text); + ui->weather->setItem(row, WEATHER_COL_REPORT, reportItem); + } + ui->weather->setSortingEnabled(true); + ui->weather->scrollToBottom(); + PROFILER_STOP("Aircraft table: weather") +} + +void AircraftGUI::weatherSelectionChanged() +{ + const QList selected = ui->weather->selectedItems(); + for (const auto *selItem : selected) + { + QTableWidgetItem *timeItem = ui->weather->item(selItem->row(), WEATHER_COL_TIME); + if (timeItem) + { + // The report carries HTML, which setPlainText() would show as tags + ui->weatherText->setHtml(timeItem->data(Qt::UserRole).toString()); + return; + } + } + ui->weatherText->clear(); +} + +void AircraftGUI::trackerAtcMessages(const QList& messages) +{ + PROFILER_START() + // Size and repaint once for the batch, not once per message + ui->atcMessages->setUpdatesEnabled(false); + int nextRow = ui->atcMessages->rowCount(); + const int firstRow = nextRow; + QSet added; + ui->atcMessages->setRowCount(nextRow + messages.size()); + ui->atcMessages->setSortingEnabled(false); + for (const AtcEvent& e : messages) + { + const int row = nextRow++; + QTableWidgetItem *timeItem = new DateTimeTableItem(e.m_received); + timeItem->setData(Qt::UserRole + 1, (qulonglong) e.m_aircraftId); + timeItem->setData(Qt::UserRole + 2, (qulonglong) e.m_flightId); + timeItem->setData(Qt::UserRole + 3, e.m_mapName); + ui->atcMessages->setItem(row, ATC_COL_TIME, timeItem); + added.insert(timeItem); + // The link it arrived on, not e.m_protocol: every ATC message is CPDLC by + // definition - addAtcMessage() returns early for anything else - so that + // column held the same word in every row + ui->atcMessages->setItem(row, ATC_COL_PROTOCOL, new QTableWidgetItem(e.m_link)); + ui->atcMessages->setItem(row, ATC_COL_DIR, + new QTableWidgetItem(QString("%1").arg(QChar(e.m_uplink ? 0x2191 : 0x2193)))); + ui->atcMessages->setItem(row, ATC_COL_FROM, new QTableWidgetItem(e.m_from)); + ui->atcMessages->setItem(row, ATC_COL_TO, new QTableWidgetItem(e.m_to)); + QTableWidgetItem *messageItem = new QTableWidgetItem(e.m_message); + messageItem->setToolTip(e.m_tooltip); + ui->atcMessages->setItem(row, ATC_COL_MESSAGE, messageItem); + } + // As in trackerDocumentsAdded: hide after the sort, not before, and only the new + // rows where nothing else moved + ui->atcMessages->setSortingEnabled(true); + if (!filterAppendedRows(ui->atcMessages, firstRow, added)) { + applyMessageFilter(); + } + ui->atcMessages->scrollToBottom(); + ui->atcMessages->setUpdatesEnabled(true); + PROFILER_STOP("Aircraft table: ATC messages") +} + +// The tracker could not move to the database that was asked for and has stayed with the +// one it had. These settings are the ones that get serialised, so they have to agree - +// otherwise the preset would name a file nothing is writing to. +void AircraftGUI::trackerDatabaseFilenameReverted(const QString& filename) +{ + if (m_settings.m_databaseFilename == filename) { + return; + } + m_settings.m_databaseFilename = filename; + m_settingsKeys.append("databaseFilename"); + applySettings(); +} + +// Asked from outside - the web API, and so a link clicked in an aircraft's Map popup - +// to show a particular aircraft or flight. The row may be in the live table or the +// archive, so both are searched and the tab holding the match is brought forward. +void AircraftGUI::trackerSelectRequested(int kind, const QString& value) +{ + if (value.isEmpty()) { + return; + } + + if (kind == AircraftTracker::MsgSelect::Flight) + { + // The most recently seen flight of that number, which is what someone clicking a + // flight number on the Map means by it + quint64 best = 0; + QDateTime bestSeen; + for (int i = 0; i < m_flightModel->rowCount(); i++) + { + const FlightDisplay *f = m_flightModel->flightAt(i); + if (!f || f->m_flight.compare(value, Qt::CaseInsensitive)) { + continue; + } + if (!bestSeen.isValid() || (f->m_lastSeen > bestSeen)) + { + bestSeen = f->m_lastSeen; + best = f->m_id; + } + } + // By id, so it is the flight found above and not merely the first of that number + if (best) { + selectFlightById(best); + } + return; + } + + for (int i = 0; i < m_aircraftModel->rowCount(); i++) + { + const AircraftDisplay *d = m_aircraftModel->aircraftAt(i); + if (!d) { + continue; + } + const bool match = (kind == AircraftTracker::MsgSelect::Icao) + ? (d->m_icao && (QString("%1").arg(d->m_icao, 6, 16, QChar('0')).compare( + value, Qt::CaseInsensitive) == 0)) + : (!d->m_registration.isEmpty() + && (d->m_registration.compare(value, Qt::CaseInsensitive) == 0)); + if (match) + { + selectAircraft(d->m_id); + return; + } + } +} + +void AircraftGUI::trackerAllCleared() +{ + m_aircraftModel->clear(); + m_flightModel->clear(); + ui->documents->setRowCount(0); + ui->logons->setRowCount(0); + ui->documentText->clear(); + ui->logonText->clear(); + ui->atcMessages->setRowCount(0); + ui->weather->setRowCount(0); + ui->weatherText->clear(); + clearSelectionState(); +} + +// Back to nothing selected. The models were reset rather than having rows removed, and a +// reset emits no selection change, so none of the handlers that would otherwise do this +// get to run - and everything the selection drove went on showing the deleted aircraft. +void AircraftGUI::clearSelectionState() +{ + m_selectionOwner = SelectionNone; + m_selectedAircraftId = 0; + m_selectedFlightId = 0; + m_selectedFlightNumber.clear(); + m_selectedRegistration.clear(); + m_selectedIcao = 0; + m_reselectAircraftId = 0; + m_reselectFlightId = 0; + m_findRow = -1; + + // The local half of watchFlight(0) only. The tracker is watching nothing already: + // Delete All clears its watch, and a resync is for a GUI that has not chosen one. + // Left as it was, plotProfileChart() redrew the deleted flight from what it held. + m_profileFlightId = 0; + m_profileTitle.clear(); + m_profileTimes.clear(); + m_profileAltFt.clear(); + m_profileSpeedKts.clear(); + plotProfileChart(); + + updatePhoto(QString(), 0); // Hides the photograph and empties the details table + updateHistoryTables(); // Empties both history tabs, and hides them +} + +void AircraftGUI::trackerSpeechNotification(const QString& speech) +{ +#ifdef QT_TEXTTOSPEECH_FOUND + if (!m_speech) { + m_speech = new QTextToSpeech(this); + } + m_speech->say(speech); +#else + qWarning() << "AircraftGUI::trackerSpeechNotification: TextToSpeech not supported. Unable to say " << speech; +#endif +} + +// ---- Selection, filtering, photo and profile ---- + +// Whether a Documents/ATC row matches the selected aircraft (Aircraft tab +// active) or flight (Flights tab active); everything shows with no selection +bool AircraftGUI::messageRowVisible(const QTableWidgetItem *firstItem) const +{ + if (m_selectedFlightId) { + return firstItem->data(Qt::UserRole + 2).toULongLong() == m_selectedFlightId; + } + if (m_selectedAircraftId) { + return firstItem->data(Qt::UserRole + 1).toULongLong() == m_selectedAircraftId; + } + // With nothing selected, what belongs to no aircraft at all: the SELCAL calls that + // could not be pinned on one. Nothing else is ever logged without an aircraft, and + // these would otherwise have nowhere to be seen. + return firstItem->data(Qt::UserRole + 1).toULongLong() == 0; +} + +// Filters only the rows a batch has just added, when that is enough: the table has to be +// sorted again once they are in, and a row's hidden flag stays with the view's row number +// rather than travelling with the row, so if the sort put any new row among the old ones +// the old rows below it have moved under their flags and everything needs doing. Usually +// - sorted by time, which is the default - the new rows all land at the end. Returns false +// when the caller must fall back to applyMessageFilter(). +bool AircraftGUI::filterAppendedRows(QTableWidget *table, int firstNewRow, const QSet& added) +{ + // All the rows from where the new ones were added must be new ones, which can only + // be if every old row is where it was + for (int row = firstNewRow; row < table->rowCount(); row++) + { + if (!added.contains(table->item(row, 0))) { + return false; + } + } + for (int row = firstNewRow; row < table->rowCount(); row++) + { + const bool visible = messageRowVisible(table->item(row, 0)); + if (table->isRowHidden(row) == visible) { + table->setRowHidden(row, !visible); + } + } + return true; +} + +void AircraftGUI::applyMessageFilter() +{ + PROFILER_START() + int shown = 0; + for (QTableWidget *table : {ui->documents, ui->logons, ui->atcMessages}) + { + for (int row = 0; row < table->rowCount(); row++) + { + const bool visible = messageRowVisible(table->item(row, 0)); + // Only where it changes. setRowHidden() is itself O(rows) in QHeaderView, and + // this runs on every batch of new messages over every row ever logged - the + // trap AcarsMessageModel describes, quadratic in a log that is never pruned + // by default. Asking is cheap; it is the change that costs. + if (table->isRowHidden(row) == visible) { + table->setRowHidden(row, !visible); + } + shown += visible ? 1 : 0; + } + } + + // Hiding a row keeps its selection and emits no selection change, so the pane below + // went on showing a message whose row was no longer on screen - and with nothing + // selected at all it showed the last message the user had happened to click, which + // reads as though it belonged to whatever is selected now. + auto clearWhenNothingShown = [](QTableWidget *table, AcarsMessageView *pane) + { + const QList selected = table->selectedItems(); + for (const QTableWidgetItem *item : selected) + { + if (!table->isRowHidden(item->row())) { + return; // Still showing the row it describes + } + } + pane->clear(); + }; + clearWhenNothingShown(ui->documents, ui->documentText); + clearWhenNothingShown(ui->logons, ui->logonText); + + // Only when what it filters on has moved, so this is a handful of lines around a + // selection change rather than one on every message. The Documents and ATC tables + // hide EVERY row when nothing is selected, so a selection lost without the user + // touching anything empties them, and nothing used to say when that happened. + static quint64 lastFlight = 0; + static quint64 lastAircraft = 0; + static int lastShown = -1; + // Also when the number of visible rows moves without the selection moving, which is + // the symptom itself: documents that were on screen going away while the same flight + // is still selected. Logging only the selection could never have caught that. + if ((m_selectedFlightId != lastFlight) || (m_selectedAircraftId != lastAircraft) + || (shown != lastShown)) + { + lastShown = shown; + qDebug() << "AircraftGUI::applyMessageFilter: flight" << lastFlight << "->" + << m_selectedFlightId << " aircraft" << lastAircraft << "->" + << m_selectedAircraftId << " showing" << shown << "rows of" + << (ui->documents->rowCount() + ui->atcMessages->rowCount()); + lastFlight = m_selectedFlightId; + lastAircraft = m_selectedAircraftId; + } + PROFILER_STOP("Aircraft table: message filter") +} + +// The archive tabs show what we are no longer hearing from +bool AircraftGUI::showingArchive() const +{ + QWidget *tab = ui->aircraftTabs->currentWidget(); + return (tab == ui->oldAircraftTab) || (tab == ui->oldFlightsTab); +} + +// What the aircraft database knows about this airframe, which does not change as it flies +void AircraftGUI::updateAircraftInfo(const QString& registration, quint32 icao) +{ + ui->aircraftInfo->setRowCount(0); + + QSharedPointer> byReg = OsnDB::getAircraftInformationByReg(); + QSharedPointer> byIcao = OsnDB::getAircraftInformation(); + const AircraftInformation *info = nullptr; + + if (byReg && byReg->contains(registration)) { + info = byReg->value(registration); + } else if (icao && byIcao && byIcao->contains((int) icao)) { + info = byIcao->value((int) icao); + } + if (!info) { + return; + } + + const QList> details = { + { "ICAO", QString("%1").arg(info->m_icao, 6, 16, QChar('0')).toUpper() }, + { "Registration", info->m_registration }, + { "Manufacturer", info->m_manufacturerName }, + { "Model", info->m_model }, + { "Type", info->m_type }, + { "Owner", info->m_owner }, + { "Operator", info->m_operator }, + { "Operator ICAO", info->m_operatorICAO }, + { "Registered", info->m_registered }, + }; + + for (const auto& detail : details) + { + if (detail.second.isEmpty()) { + continue; + } + int row = ui->aircraftInfo->rowCount(); + ui->aircraftInfo->setRowCount(row + 1); + ui->aircraftInfo->setItem(row, 0, new QTableWidgetItem(detail.first)); + ui->aircraftInfo->setItem(row, 1, new QTableWidgetItem(detail.second)); + } + + // The country is shown as its flag, as it is in the aircraft table + const QString flag = info->getFlag(); + if (!flag.isEmpty()) + { + int row = ui->aircraftInfo->rowCount(); + ui->aircraftInfo->setRowCount(row + 1); + ui->aircraftInfo->setItem(row, 0, new QTableWidgetItem("Country")); + + QTableWidgetItem *country = new QTableWidgetItem(); + QIcon *icon = AircraftInformation::getFlagIcon(flag); + if (icon) + { + country->setIcon(*icon); + country->setToolTip(flag); + } + else + { + country->setText(flag); + } + ui->aircraftInfo->setItem(row, 1, country); + } + ui->aircraftInfo->resizeColumnToContents(0); +} + +// The two history tabs, both built from the flight model rather than from the tracker. +// +// Every flight the feature knows about is already in that model, live and archived alike, +// and a FlightDisplay carries both the aircraft it was flown by and the flight number - +// so "which flights has this aircraft operated" and "which aircraft have operated this +// flight" are two readings of the same list, and neither needs the tracker to be asked. +// Highlight the next row matching what was typed, in whichever table is on show. +// +// A filter would hide everything else, and what is wanted here is to pick one aircraft +// out of a busy table while still seeing the rest of the traffic around it - so this +// selects and scrolls to the match instead. Enter steps on to the next one and wraps. +bool AircraftGUI::findFrom(int startRow, const QString& text) +{ + if (text.isEmpty()) { + return false; + } + + const bool flights = (ui->aircraftTabs->currentWidget() == ui->flightsTab) + || (ui->aircraftTabs->currentWidget() == ui->oldFlightsTab); + QTableView *view = flights ? (showingArchive() ? ui->oldFlights : ui->flights) + : (showingArchive() ? ui->oldAircraft : ui->aircraft); + ActiveFilterProxy *proxy = flights ? (showingArchive() ? m_oldFlightProxy : m_flightProxy) + : (showingArchive() ? m_oldAircraftProxy : m_aircraftProxy); + const int rows = proxy->rowCount(); + if (rows == 0) { + return false; + } + const int column = ui->findColumn->currentIndex(); + // Fetched once for the whole search. Each fetch takes a lock and looks at the + // database file's modification time, twice, and doing that for every row of a + // couple of thousand aircraft made a search thousands of file system calls. + const QSharedPointer> byReg + = OsnDB::getAircraftInformationByReg(); + + for (int i = 0; i < rows; i++) + { + // Walk in the order the rows are displayed, so stepping through the matches + // follows the sort the user is looking at rather than the model's own order + const int row = (startRow + 1 + i) % rows; + const int sourceRow = proxy->mapToSource(proxy->index(row, 0)).row(); + + // Type and airline are not on either snapshot - they come from the database, + // which is what the table itself displays in those columns, so searching them + // matches what is on screen + auto typeFields = [&byReg](const QString& registration) { + QStringList f; + if (byReg && byReg->contains(registration)) + { + const AircraftInformation *info = byReg->value(registration); + f << info->m_type << info->m_model << info->m_manufacturerName; + } + return f; + }; + + QStringList fields; + if (flights) + { + const FlightDisplay *d = m_flightModel->flightAt(sourceRow); + if (!d) { + continue; + } + // A flight has no ICAO address of its own - the airframe flying it does, + // and that is what the Aircraft table is for, so ICAO simply finds nothing + switch (column) + { + case FindIcao: break; + case FindSelcal: break; // Belongs to the airframe, like the ICAO address + case FindReg: fields << d->m_reg; break; + case FindType: fields << typeFields(d->m_reg); break; + case FindFlight: fields << d->m_flight << d->m_aliases; break; + default: + fields << d->m_flight << d->m_aliases << d->m_reg + << d->m_departure << d->m_arrival << d->m_route + << typeFields(d->m_reg); + break; + } + } + else + { + const AircraftDisplay *d = m_aircraftModel->aircraftAt(sourceRow); + if (!d) { + continue; + } + const QString icao = QString("%1").arg(d->m_icao, 6, 16, QChar('0')).toUpper(); + switch (column) + { + case FindIcao: fields << icao; break; + case FindReg: fields << d->m_registration; break; + case FindType: fields << typeFields(d->m_registration); break; + case FindFlight: fields << d->m_flight; break; + case FindSelcal: fields << d->m_selcal; break; + default: + fields << icao << d->m_registration << d->m_flight << d->m_mapName + << d->m_selcal << typeFields(d->m_registration); + if (byReg && byReg->contains(d->m_registration)) + { + const AircraftInformation *info = byReg->value(d->m_registration); + fields << info->m_operator << info->m_operatorICAO << info->m_owner; + } + break; + } + } + + for (const QString& field : fields) + { + if (!field.isEmpty() && field.contains(text, Qt::CaseInsensitive)) + { + m_findRow = row; + view->selectRow(row); + view->scrollTo(proxy->index(row, 0), QAbstractItemView::PositionAtCenter); + return true; + } + } + } + return false; +} + +// Typing searches from the top, so the match follows what has been typed so far +void AircraftGUI::on_find_textChanged(const QString& text) +{ + m_findRow = -1; + if (text.isEmpty()) + { + m_findTimer.stop(); + ui->find->setStyleSheet(""); + return; + } + // Wait for a pause in typing. Each match selects a row, and selecting reloads the + // message tables, the flight profile and the photograph, so searching on every + // keystroke would do all of that for each half-typed registration + m_findTimer.start(300); +} + +// Enter steps on to the next match +void AircraftGUI::on_find_returnPressed() +{ + const QString text = ui->find->text(); + ui->find->setStyleSheet(findFrom(m_findRow, text) ? "" : "QLineEdit { color: red; }"); +} + +void AircraftGUI::updateHistoryTables() +{ + m_updatingHistoryTables = true; + // "Callsign", not "Flight": this is what the aircraft transmits - BAW31, TOM3TW - + // which is not the flight number a passenger is sold, and the two often differ + static const QStringList flightHeadings = + { "Callsign", "From", "To", "First seen", "Last seen", "Msgs" }; + static const QStringList aircraftHeadings = + { "Reg", "From", "To", "First seen", "Last seen", "Msgs" }; + // The tables in the .ui carry these on each column; these two are built here, so + // they had none at all + static const QStringList flightTips = { + "Callsign the flight was flown under", + "Departure airport, from a message where one said so, otherwise from the callsign" + " to route database", + "Arrival airport, from a message where one said so, otherwise from the callsign" + " to route database", + "When the flight was first heard", + "When the flight was last heard", + "Messages received for this flight" }; + static const QStringList aircraftTips = { + "Registration, or the ICAO 24 bit address where no registration is known", + "Departure airport of the last flight heard", + "Arrival airport of the last flight heard", + "When the aircraft was first heard", + "When the aircraft was last heard", + "Messages received from this aircraft" }; + + auto prepare = [](QTableWidget *table, const QStringList& headings, + const QStringList& tips) + { + if (table->columnCount() == 0) + { + table->setColumnCount(headings.size()); + table->setHorizontalHeaderLabels(headings); + for (int col = 0; (col < tips.size()) && (col < table->columnCount()); col++) + { + if (QTableWidgetItem *header = table->horizontalHeaderItem(col)) { + header->setToolTip(tips[col]); + } + } + table->horizontalHeader()->setSectionsMovable(true); + table->verticalHeader()->setVisible(false); + } + // Sorting has to be off while the rows are replaced, or Qt re-sorts after each + // cell is set and the rows shuffle out from under the loop + table->setSortingEnabled(false); + table->setRowCount(0); + }; + + auto fill = [](QTableWidget *table, int row, const QStringList& values) + { + for (int col = 0; col < values.size(); col++) { + table->setItem(row, col, new QTableWidgetItem(values[col])); + } + }; + + // QTableWidgetItem sorts on the display role, so the dates have to sort correctly as + // TEXT. This format does - year first, zero padded throughout - which is why it is + // used here rather than a friendlier local format. + const QString dateFormat = "yyyy-MM-dd hh:mm"; + + // The tracker flushes every 300 ms and every flush that touches a flight rebuilds + // these tables, so a selection the user has just made would be wiped within a frame + // or two of making it. Remember it and put it back. + const quint64 keepSelected = m_selectedFlightId; + + // Past Flights: everything this aircraft has operated + prepare(ui->pastFlights, flightHeadings, flightTips); + if (m_selectedAircraftId != 0) + { + int row = 0; + for (int i = 0; i < m_flightModel->rowCount(); i++) + { + const FlightDisplay *f = m_flightModel->flightAt(i); + if (!f || (f->m_aircraftId != m_selectedAircraftId)) { + continue; + } + ui->pastFlights->setRowCount(row + 1); + fill(ui->pastFlights, row, + { f->m_flight, f->m_departure, f->m_arrival, + f->m_firstSeen.toString(dateFormat), f->m_lastSeen.toString(dateFormat), + QString::number(f->m_messages) }); + ui->pastFlights->item(row, 0)->setData(Qt::UserRole, f->m_id); + row++; + } + } + // Re-enabling sorting re-sorts by whatever the header says, which keeps a sort the + // user picked. Most recent first only when the table is filled for a different + // aircraft - forcing it on every refill undid their choice within a second. + ui->pastFlights->setSortingEnabled(true); + if (m_selectedAircraftId != m_pastFlightsAircraftId) + { + ui->pastFlights->sortByColumn(4, Qt::DescendingOrder); + m_pastFlightsAircraftId = m_selectedAircraftId; + } + + // After the sort, because sorting moves the rows around + if (keepSelected) + { + for (int row = 0; row < ui->pastFlights->rowCount(); row++) + { + const QTableWidgetItem *first = ui->pastFlights->item(row, 0); + if (first && (first->data(Qt::UserRole).toULongLong() == keepSelected)) + { + ui->pastFlights->selectRow(row); + break; + } + } + } + + // Past Aircraft: everything that has operated this flight number + prepare(ui->pastAircraft, aircraftHeadings, aircraftTips); + if (!m_selectedFlightNumber.isEmpty()) + { + int row = 0; + for (int i = 0; i < m_flightModel->rowCount(); i++) + { + const FlightDisplay *f = m_flightModel->flightAt(i); + if (!f || f->m_flight.compare(m_selectedFlightNumber, Qt::CaseInsensitive)) { + continue; + } + ui->pastAircraft->setRowCount(row + 1); + fill(ui->pastAircraft, row, + { f->m_reg, f->m_departure, f->m_arrival, + f->m_firstSeen.toString(dateFormat), f->m_lastSeen.toString(dateFormat), + QString::number(f->m_messages) }); + row++; + } + } + ui->pastAircraft->setSortingEnabled(true); + if (m_selectedFlightNumber.compare(m_pastAircraftFlightNumber, Qt::CaseInsensitive)) + { + ui->pastAircraft->sortByColumn(4, Qt::DescendingOrder); + m_pastAircraftFlightNumber = m_selectedFlightNumber; + } + + // These two tabs live in messageTabs, NOT aircraftTabs - asking aircraftTabs for + // them returns -1, and setTabVisible(-1) does nothing at all, which is why they + // used to stay visible whatever was selected. + ui->messageTabs->setTabVisible(ui->messageTabs->indexOf(ui->pastFlightsTab), + m_selectedAircraftId != 0); + ui->messageTabs->setTabVisible(ui->messageTabs->indexOf(ui->pastAircraftTab), + !m_selectedFlightNumber.isEmpty()); + m_updatingHistoryTables = false; +} + +// Selecting one of the aircraft's past flights charts its profile and draws its track +// on the map. Nothing is selected once the table is rebuilt, which returns both to the +// flight the aircraft is on now. +void AircraftGUI::pastFlightSelectionChanged() +{ + if (m_updatingHistoryTables) { + return; + } + + quint64 flightId = 0; + QString title; + const QList selected = ui->pastFlights->selectedItems(); + if (!selected.isEmpty()) + { + const QTableWidgetItem *first = ui->pastFlights->item(selected.first()->row(), 0); + if (first) + { + flightId = first->data(Qt::UserRole).toULongLong(); + title = first->text(); + } + } + // With no past flight selected the messages widen back out to the whole aircraft, + // while the track and the chart go back to the flight it is on now + m_selectedFlightId = flightId; + applyMessageFilter(); + + if (flightId == 0) + { + for (int i = 0; i < m_aircraftModel->rowCount(); i++) + { + const AircraftDisplay *d = m_aircraftModel->aircraftAt(i); + if (d && (d->m_id == m_selectedAircraftId)) + { + flightId = d->m_currentFlightId; + title = d->m_flight.isEmpty() ? d->m_mapName : d->m_flight; + break; + } + } + } + watchFlight(flightId, title); +} + +void AircraftGUI::aircraftSelectionChanged() +{ + if (m_ignoreSelectionChanges) { + return; + } + QTableView *aircraftView = showingArchive() ? ui->oldAircraft : ui->aircraft; + const bool haveSelection = !aircraftView->selectionModel()->selectedRows().isEmpty(); + + // Nothing selected here and the documents are not ours to change: a selection model + // re-emitting with nothing in it says nothing about what the other table holds, and + // acting on it is what stole the selection from a flight the user had just clicked. + // Sorting by a column whose value changes - Docs, as documents arrive - moves rows + // under the selection and makes that happen every few seconds. + if (!haveSelection && (m_selectionOwner != SelectionAircraft)) { + return; + } + // Whatever happens below re-derives the selection from the table, so a merge's + // survivor no longer needs putting back + m_reselectAircraftId = 0; + m_reselectFlightId = 0; + if (haveSelection) + { + m_selectionOwner = SelectionAircraft; + // Only one table may hold a selection, or the loser goes on re-asserting itself. + // Blocked, or clearing it would re-enter through flightSelectionChanged(). Its + // current index goes as well: left behind, Qt selects the next row in its place + // when that row leaves the view, which handed the selection to a flight nobody + // had clicked. + QTableView *flightView = showingArchive() ? ui->oldFlights : ui->flights; + const QSignalBlocker blocker(flightView->selectionModel()); + flightView->selectionModel()->clear(); + } + else + { + m_selectionOwner = SelectionNone; + } + + m_selectedAircraftId = 0; + m_selectedRegistration.clear(); + m_selectedIcao = 0; + // An airframe is selected, so "what else has flown this number" no longer has a + // number to be about + m_selectedFlightId = 0; + m_selectedFlightNumber.clear(); + quint64 currentFlightId = 0; + QString title; + + QTableView *view = showingArchive() ? ui->oldAircraft : ui->aircraft; + ActiveFilterProxy *proxy = showingArchive() ? m_oldAircraftProxy : m_aircraftProxy; + QModelIndexList selected = view->selectionModel()->selectedRows(); + if (!selected.isEmpty()) + { + int sourceRow = proxy->mapToSource(selected.first()).row(); + const AircraftDisplay *d = m_aircraftModel->aircraftAt(sourceRow); + if (d) + { + m_selectedAircraftId = d->m_id; + m_selectedRegistration = d->m_registration; + m_selectedIcao = d->m_icao; + currentFlightId = d->m_currentFlightId; + title = d->m_flight.isEmpty() ? d->m_mapName : d->m_flight; + } + } + applyMessageFilter(); + updateHistoryTables(); + updatePhoto(m_selectedRegistration, m_selectedIcao); + watchFlight(currentFlightId, title); +} + +void AircraftGUI::flightSelectionChanged() +{ + if (m_ignoreSelectionChanges) { + return; + } + QTableView *flightView = showingArchive() ? ui->oldFlights : ui->flights; + const bool haveSelection = !flightView->selectionModel()->selectedRows().isEmpty(); + + // The same rule as aircraftSelectionChanged(), for the same reason + if (!haveSelection && (m_selectionOwner != SelectionFlight)) { + return; + } + m_reselectAircraftId = 0; + m_reselectFlightId = 0; + if (haveSelection) + { + m_selectionOwner = SelectionFlight; + QTableView *aircraftView = showingArchive() ? ui->oldAircraft : ui->aircraft; + const QSignalBlocker blocker(aircraftView->selectionModel()); + aircraftView->selectionModel()->clear(); + } + else + { + m_selectionOwner = SelectionNone; + } + + m_selectedFlightId = 0; + m_selectedFlightNumber.clear(); + m_selectedAircraftId = 0; + quint64 watchId = 0; + QString title; + QString registration; + + QTableView *view = showingArchive() ? ui->oldFlights : ui->flights; + ActiveFilterProxy *proxy = showingArchive() ? m_oldFlightProxy : m_flightProxy; + QModelIndexList selected = view->selectionModel()->selectedRows(); + if (!selected.isEmpty()) + { + int sourceRow = proxy->mapToSource(selected.first()).row(); + const FlightDisplay *d = m_flightModel->flightAt(sourceRow); + if (d) + { + m_selectedFlightId = d->m_id; + m_selectedFlightNumber = d->m_flight; + watchId = d->m_id; + title = d->m_flight.isEmpty() ? d->m_reg : d->m_flight; + registration = d->m_reg; + } + } + applyMessageFilter(); + updateHistoryTables(); + updatePhoto(registration, 0); + watchFlight(watchId, title); +} + +// Puts the selection back on the survivor of a merge, once the tracker has sent its row as +// the merge left it - the tracker always does, in the flush after the merge, and only then +// is the row in the view it is going to stay in. Called with that batch, by +// trackerAircraftUpdated() and trackerFlightsUpdated(). +// The merged-away row was removed, and the view's selection with it. Done quietly, with +// the selection handlers ignoring it: trackerAircraftMerged() and trackerFlightsMerged() +// moved everything the selection drives across already, and going through the handlers +// would redo it from nothing - restarting the profile and redrawing the track on the Map +// for what is still the same flight. Returns whether it reselected. +bool AircraftGUI::reselectMerged() +{ + const bool flights = (m_selectionOwner == SelectionFlight); + const quint64 id = flights ? m_reselectFlightId : m_reselectAircraftId; + const quint64 selectedId = flights ? m_selectedFlightId : m_selectedAircraftId; + if ((id == 0) || (m_selectionOwner == SelectionNone) || (selectedId != id)) + { + // Nothing to do, or something else has been selected since + m_reselectAircraftId = 0; + m_reselectFlightId = 0; + return false; + } + + const int sourceRow = flights ? m_flightModel->rowOf(id) : m_aircraftModel->rowOf(id); + if (sourceRow < 0) { + return false; // Not delivered yet - tried again when it is + } + m_reselectAircraftId = 0; + m_reselectFlightId = 0; + + struct Place { + QWidget *m_tab; + QTableView *m_view; + ActiveFilterProxy *m_proxy; + }; + const QList places = flights + ? QList{ { ui->flightsTab, ui->flights, m_flightProxy }, + { ui->oldFlightsTab, ui->oldFlights, m_oldFlightProxy } } + : QList{ { ui->aircraftTab, ui->aircraft, m_aircraftProxy }, + { ui->oldAircraftTab, ui->oldAircraft, m_oldAircraftProxy } }; + const QModelIndex sourceIndex = flights ? m_flightModel->index(sourceRow, 0) + : m_aircraftModel->index(sourceRow, 0); + QWidget *shown = ui->aircraftTabs->currentWidget(); + const bool showingThisKind = (shown == places[0].m_tab) || (shown == places[1].m_tab); + + m_ignoreSelectionChanges = true; + for (const Place& place : places) + { + const QModelIndex index = place.m_proxy->mapFromSource(sourceIndex); + if (index.isValid()) + { + // The survivor can be live where the merged-away one was archived, or the + // other way round. If the other of the pair is on show, bring this one + // forward, as selectRow() does - but not from some other tab altogether, + // which would be taking the user somewhere they did not go. + if (showingThisKind && (shown != place.m_tab)) { + ui->aircraftTabs->setCurrentWidget(place.m_tab); + } + place.m_view->selectRow(index.row()); + } + else + { + // With the current index, which would otherwise make Qt select a neighbour + // when its row left the view + place.m_view->selectionModel()->clear(); + } + } + m_ignoreSelectionChanges = false; + + // What the survivor brings that the merged-away one may not have had + if (flights) + { + const FlightDisplay *d = m_flightModel->flightAt(sourceRow); + m_selectedFlightNumber = d->m_flight; + const QString title = d->m_flight.isEmpty() ? d->m_reg : d->m_flight; + if ((m_profileFlightId == id) && (title != m_profileTitle)) + { + m_profileTitle = title; + plotProfileChart(); + } + updatePhoto(d->m_reg, 0); + } + else + { + // The watched flight is left alone: flights keep their ids when their aircraft is + // absorbed, so the tracker goes on sending the same one + const AircraftDisplay *d = m_aircraftModel->aircraftAt(sourceRow); + m_selectedRegistration = d->m_registration; + m_selectedIcao = d->m_icao; + updatePhoto(m_selectedRegistration, m_selectedIcao); + } + applyMessageFilter(); + updateHistoryTables(); + return true; +} + +// The id of the aircraft or flight selected in one of the four views, or 0 for none +quint64 AircraftGUI::selectedIdIn(bool flights, bool archive) const +{ + QTableView *view = flights ? (archive ? ui->oldFlights : ui->flights) + : (archive ? ui->oldAircraft : ui->aircraft); + const QModelIndexList selected = view->selectionModel()->selectedRows(); + if (selected.isEmpty()) { + return 0; + } + if (flights) + { + const ActiveFilterProxy *proxy = archive ? m_oldFlightProxy : m_flightProxy; + const FlightDisplay *d = m_flightModel->flightAt(proxy->mapToSource(selected.first()).row()); + return d ? d->m_id : 0; + } + const ActiveFilterProxy *proxy = archive ? m_oldAircraftProxy : m_aircraftProxy; + const AircraftDisplay *d = m_aircraftModel->aircraftAt(proxy->mapToSource(selected.first()).row()); + return d ? d->m_id : 0; +} + +AircraftGUI::ViewSelections AircraftGUI::selectedIds(bool flights) const +{ + ViewSelections ids; + ids.m_live = selectedIdIn(flights, false); + ids.m_archive = selectedIdIn(flights, true); + return ids; +} + +// Puts each of a pair of views' selections back on the aircraft or flight it was made on, +// after the tracker's changes have been applied to their model with the selection handlers +// ignoring what that did. Taken by id beforehand, as selectedIds(). +// +// A selection belongs to an aircraft or a flight, not to a row. Rows move under it as the +// view re-sorts, which the views' persistent indexes take care of, but they also leave a +// view - archived, back from the archive, merged, discarded - and then Qt, keeping one row +// selected in a single selection view, selects the row next to the one that went. Taken as +// the user's choice, that put an unrelated aircraft's documents, photograph and profile on +// screen, and it happened just as readily in a view whose selection had been cleared but +// whose current index had not, which was how the other table came to take the selection. +// Applied in the middle of the model's removal, it also read the model while its rows and +// the proxy's mapping disagreed. +// +// So a view's selection is put back on its own aircraft or flight if that is still in the +// view, and otherwise cleared with the current index, and a row Qt selected in a view that +// had nothing is cleared again. The aircraft or flight the documents are being shown for +// moves to the other view of the pair along with its row, bringing that tab forward if the +// pair is on show, as reselectMerged() and selectRow() do. +void AircraftGUI::keepSelections(bool flights, const ViewSelections& before) +{ + struct Place { + QWidget *m_tab; + QTableView *m_view; + ActiveFilterProxy *m_proxy; + quint64 m_was; + QModelIndex m_keep; + }; + Place places[2] = { + { flights ? ui->flightsTab : ui->aircraftTab, flights ? ui->flights : ui->aircraft, + flights ? m_flightProxy : m_aircraftProxy, before.m_live, QModelIndex() }, + { flights ? ui->oldFlightsTab : ui->oldAircraftTab, flights ? ui->oldFlights : ui->oldAircraft, + flights ? m_oldFlightProxy : m_oldAircraftProxy, before.m_archive, QModelIndex() } + }; + auto indexIn = [this, flights](const Place& place, quint64 id) { + const int sourceRow = (id == 0) ? -1 : (flights ? m_flightModel->rowOf(id) : m_aircraftModel->rowOf(id)); + if (sourceRow < 0) { + return QModelIndex(); + } + return place.m_proxy->mapFromSource(flights ? m_flightModel->index(sourceRow, 0) + : m_aircraftModel->index(sourceRow, 0)); + }; + + for (Place& place : places) { + place.m_keep = indexIn(place, place.m_was); + } + const bool owned = (m_selectionOwner == (flights ? SelectionFlight : SelectionAircraft)); + const quint64 ownedId = flights ? m_selectedFlightId : m_selectedAircraftId; + int followedTo = -1; + for (int i = 0; owned && (ownedId != 0) && (i < 2); i++) + { + if ((places[i].m_was == ownedId) && !places[i].m_keep.isValid()) + { + const QModelIndex index = indexIn(places[1 - i], ownedId); + if (index.isValid()) + { + places[1 - i].m_keep = index; + followedTo = 1 - i; + } + } + } + + m_ignoreSelectionChanges = true; + QWidget *shown = ui->aircraftTabs->currentWidget(); + if ((followedTo >= 0) && ((shown == places[0].m_tab) || (shown == places[1].m_tab))) { + ui->aircraftTabs->setCurrentWidget(places[followedTo].m_tab); + } + for (const Place& place : places) + { + QItemSelectionModel *selection = place.m_view->selectionModel(); + if (place.m_keep.isValid()) + { + // Usually it is still selected where it was, and there is nothing to do + if ((selection->currentIndex().row() != place.m_keep.row()) + || !selection->isRowSelected(place.m_keep.row(), QModelIndex())) { + selection->setCurrentIndex(place.m_keep, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + } + } + else if ((place.m_was != 0) || selection->hasSelection()) + { + selection->clear(); + } + } + m_ignoreSelectionChanges = false; +} + +// The aircraft or flight the documents were being shown for has gone for good, so there is +// nothing left for the selection to follow. Its row went without Qt being allowed to select +// a neighbour in its place, so this is the deselection the handlers used to do then. +void AircraftGUI::dropSelection() +{ + clearSelectionState(); + applyMessageFilter(); + // The tracker half of watchFlight(0), which clearSelectionState() leaves out + tracker()->getInputMessageQueue()->push(AircraftTracker::MsgWatchFlight::create(0)); +} + +// Tell the tracker which flight's profile to send us +void AircraftGUI::watchFlight(quint64 flightId, const QString& title) +{ + m_profileFlightId = flightId; + m_profileTitle = title; + m_profileTimes.clear(); + m_profileAltFt.clear(); + m_profileSpeedKts.clear(); + plotProfileChart(); + tracker()->getInputMessageQueue()->push(AircraftTracker::MsgWatchFlight::create(flightId)); +} + +void AircraftGUI::trackerProfileUpdated(quint64 flightId, const QList& times, const QList& altitudeFt, const QList& speedKts) +{ + if (flightId != m_profileFlightId) { + return; + } + m_profileTimes = times; + m_profileAltFt = altitudeFt; + m_profileSpeedKts = speedKts; + plotProfileChart(); +} + +// The Logons tab is the Documents tab over a different set of rows, so it behaves the +// same way - selecting a row shows the logon underneath it +void AircraftGUI::logonSelectionChanged() +{ + QList selected = ui->logons->selectedItems(); + for (const auto *selItem : selected) + { + QTableWidgetItem *timeItem = ui->logons->item(selItem->row(), DOCUMENT_COL_TIME); + if (timeItem) + { + ui->logonText->setPlainText(timeItem->data(Qt::UserRole).toString()); + return; + } + } + ui->logonText->clear(); +} + +void AircraftGUI::documentSelectionChanged() +{ + QList selected = ui->documents->selectedItems(); + for (const auto *selItem : selected) + { + QTableWidgetItem *timeItem = ui->documents->item(selItem->row(), DOCUMENT_COL_TIME); + if (timeItem) + { + ui->documentText->setPlainText(timeItem->data(Qt::UserRole).toString()); + return; + } + } + // Nothing selected - the previous message is not the selected one, and leaving it + // there reads as though it is + ui->documentText->clear(); +} + +// Fetch and display the planespotters.net photo for an aircraft +void AircraftGUI::updatePhoto(const QString& registration, quint32 icao) +{ + QString key = !registration.isEmpty() ? registration + : (icao ? QString("%1").arg(icao, 6, 16, QChar('0')).toUpper() : QString()); + if (key == m_photoKey) { + return; + } + m_photoKey = key; + + // Hide the previous aircraft's photo + ui->photoHeader->setVisible(false); + ui->photoFlag->setVisible(false); + ui->photo->setVisible(false); + ui->photo->setPixmap(QPixmap()); + ui->flightDetails->setVisible(false); + m_photoLink.clear(); + + if (key.isEmpty()) + { + // updateAircraftInfo() is what empties the details table, and it is not reached + // from here, so the last airframe's details stayed beside nothing selected + ui->aircraftInfo->setRowCount(0); + return; + } + + updatePhotoText(registration, icao); + updateAircraftInfo(registration, icao); + if (!registration.isEmpty()) { + m_planeSpotters.getAircraftPhotoByRegistration(registration); + } else { + m_planeSpotters.getAircraftPhoto(key); + } +} + +void AircraftGUI::updatePhotoText(const QString& registration, quint32 icao) +{ + ui->photoHeader->setText(registration.isEmpty() + ? QString("%1").arg(icao, 6, 16, QChar('0')).toUpper() : registration); + + ui->photoFlag->setPixmap(QPixmap()); + ui->flightDetails->setPixmap(QPixmap()); + + QSharedPointer> aircraftInfoDB = OsnDB::getAircraftInformationByReg(); + if (aircraftInfoDB && aircraftInfoDB->contains(registration)) + { + const AircraftInformation *aircraftInfo = aircraftInfoDB->value(registration); + + QString flag = aircraftInfo->getFlag(); + if (!flag.isEmpty()) + { + QIcon *icon = AircraftInformation::getFlagIcon(flag); + if (icon) + { + QList sizes = icon->availableSizes(); + if (sizes.size() > 0) { + ui->photoFlag->setPixmap(icon->pixmap(sizes[0])); + } + } + } + + // The airline's logo under the photograph. The manufacturer, model, owner, + // operator and registration date that used to sit beside the photograph are + // gone - the aircraftInfo table next to it lists all five, so they were on + // screen twice. + QIcon *airlineIcon = AircraftInformation::getAirlineIcon(aircraftInfo->m_operatorICAO); + if (airlineIcon) + { + QList sizes = airlineIcon->availableSizes(); + if (sizes.size() > 0) { + ui->flightDetails->setPixmap(airlineIcon->pixmap(sizes[0])); + } + } + } +} + +void AircraftGUI::aircraftPhoto(const PlaneSpottersPhoto *photo) +{ + // The download takes a while, and the selection can move on while it runs. Checking + // only that SOMETHING is selected would put aircraft A's photograph next to aircraft + // B's details, which reads as a wrong answer rather than a slow one. + if (!photo->m_pixmap.isNull() && !m_photoKey.isEmpty() && (photo->m_id == m_photoKey)) + { + ui->photo->setPixmap(photo->m_pixmap); + ui->photo->setToolTip(QString("Photographer: %1").arg(photo->m_photographer)); // Required by terms of use + ui->photoHeader->setVisible(true); + ui->photoFlag->setVisible(true); + ui->photo->setVisible(true); + ui->flightDetails->setVisible(true); + m_photoLink = photo->m_link; + } +} + +void AircraftGUI::photoClicked() +{ + // Photo needs to link back to PlaneSpotters, as per terms of use + if (!m_photoLink.isEmpty()) { + QDesktopServices::openUrl(QUrl(m_photoLink)); + } +} + +// ---- Context menus ---- + +// Jump to a flight in the Flights table, from the aircraft that is flying it +// Select the first row the test accepts, looking in the live table and then in the +// archive, and bring forward whichever tab holds it. The archive matters: an aircraft +// that has just gone quiet is still linked from its Map popup and from other rows. +bool AircraftGUI::selectRow(bool flights, const std::function& matches) +{ + struct Place { + QWidget *m_tab; + QTableView *m_view; + ActiveFilterProxy *m_proxy; + }; + const QList places = flights + ? QList{ { ui->flightsTab, ui->flights, m_flightProxy }, + { ui->oldFlightsTab, ui->oldFlights, m_oldFlightProxy } } + : QList{ { ui->aircraftTab, ui->aircraft, m_aircraftProxy }, + { ui->oldAircraftTab, ui->oldAircraft, m_oldAircraftProxy } }; + + for (const Place& place : places) + { + for (int row = 0; row < place.m_proxy->rowCount(); row++) + { + const int sourceRow = place.m_proxy->mapToSource(place.m_proxy->index(row, 0)).row(); + if (matches(sourceRow)) + { + ui->aircraftTabs->setCurrentWidget(place.m_tab); + place.m_view->selectRow(row); + place.m_view->scrollTo(place.m_proxy->index(row, 0), QAbstractItemView::PositionAtCenter); + return true; + } + } + } + return false; +} + +void AircraftGUI::selectFlight(const QString& flight) +{ + selectRow(true, [this, &flight](int sourceRow) { + const FlightDisplay *d = m_flightModel->flightAt(sourceRow); + return d && !d->m_flight.compare(flight, Qt::CaseInsensitive); + }); +} + +void AircraftGUI::selectFlightById(quint64 flightId) +{ + selectRow(true, [this, flightId](int sourceRow) { + const FlightDisplay *d = m_flightModel->flightAt(sourceRow); + return d && (d->m_id == flightId); + }); +} + +// And the other way: the airframe that flew a flight +void AircraftGUI::selectAircraft(quint64 aircraftId) +{ + selectRow(false, [this, aircraftId](int sourceRow) { + const AircraftDisplay *d = m_aircraftModel->aircraftAt(sourceRow); + return d && (d->m_id == aircraftId); + }); +} + +// Whether the Map still holds this aircraft, and so whether finding it there can work. +// Asked of the tracker's own expiry rather than recomputed here, so this cannot drift +// away from what the Map was actually told: an aircraft comes off the Map when the +// position it was placed at stops being believable - after "Keep ADS-B position for" or +// "Keep ACARS position for" depending on where the position came from - and when it is +// archived, which takes it off whatever its position said. +bool AircraftGUI::aircraftOnMap(quint64 aircraftId) const +{ + const AircraftDisplay *d = m_aircraftModel->aircraftById(aircraftId); + if (!d) { + return false; // Discarded entirely, so certainly not on the Map + } + return d->m_active + && d->m_mapAvailableUntil.isValid() + && (d->m_mapAvailableUntil > QDateTime::currentDateTime()); +} + +void AircraftGUI::showContextMenu(QWidget *parent, const QString& cellText, const QString& mapName, + QPoint globalPos, const QString& showFlight, quint64 showAircraftId, + quint64 mapAircraftId) +{ + QMenu *menu = new QMenu(parent); + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->setToolTipsVisible(true); // Off by default, and the disabled Find explains itself + + if (!cellText.isEmpty()) + { + QAction *copyAction = new QAction(QString("Copy %1").arg(cellText), menu); + connect(copyAction, &QAction::triggered, this, [cellText]() { + QGuiApplication::clipboard()->setText(cellText); + }); + menu->addAction(copyAction); + } + if (!mapName.isEmpty()) + { + QAction *findAction = new QAction(QString("Find %1 on map").arg(mapName), menu); + connect(findAction, &QAction::triggered, this, [mapName]() { + FeatureWebAPIUtils::mapFind(mapName); + }); + // Shown but disabled once the aircraft has come off the Map, rather than hidden: + // the menu stays the same shape wherever it is opened, and the reason is worth + // saying - otherwise Find silently does nothing and looks broken + if ((mapAircraftId != 0) && !aircraftOnMap(mapAircraftId)) + { + findAction->setEnabled(false); + findAction->setToolTip(QString("%1 is no longer on the map - its position was" + " last updated too long ago").arg(mapName)); + } + menu->addAction(findAction); + } + if (!showFlight.isEmpty()) + { + QAction *action = new QAction(QString("Display flight %1").arg(showFlight), menu); + connect(action, &QAction::triggered, this, [this, showFlight]() { + selectFlight(showFlight); + }); + menu->addAction(action); + } + if (showAircraftId != 0) + { + QAction *action = new QAction("Display aircraft", menu); + connect(action, &QAction::triggered, this, [this, showAircraftId]() { + selectAircraft(showAircraftId); + }); + menu->addAction(action); + } + if (menu->actions().isEmpty()) + { + delete menu; + return; + } + menu->popup(globalPos); +} + +void AircraftGUI::viewContextMenu(QTableView *view, bool aircraftView, QPoint pos) +{ + QSortFilterProxyModel *proxy = qobject_cast(view->model()); + QModelIndex index = view->indexAt(pos); + if (!index.isValid()) { + return; + } + + QString cellText = index.data(Qt::DisplayRole).toString(); + QString mapName; + QString showFlight; + quint64 showAircraftId = 0; + quint64 mapAircraftId = 0; + if (aircraftView) + { + const AircraftDisplay *d = m_aircraftModel->aircraftAt(proxy->mapToSource(index).row()); + if (d) + { + mapName = d->m_mapName; + showFlight = d->m_flight; + mapAircraftId = d->m_id; + } + } + else + { + const FlightDisplay *d = m_flightModel->flightAt(proxy->mapToSource(index).row()); + if (d) + { + mapName = d->m_reg; + showAircraftId = d->m_aircraftId; + mapAircraftId = d->m_aircraftId; + } + } + showContextMenu(view, cellText, mapName, view->viewport()->mapToGlobal(pos), + showFlight, showAircraftId, mapAircraftId); +} + +void AircraftGUI::tableContextMenu(QTableWidget *table, QPoint pos) +{ + QTableWidgetItem *item = table->itemAt(pos); + if (!item) { + return; + } + // The statistics table shares this menu but carries no map name, and its first + // column is a label rather than something to find + QTableWidgetItem *first = table->item(item->row(), 0); + const QString mapName = first ? first->data(Qt::UserRole + 3).toString() : QString(); + const quint64 mapAircraftId = first ? first->data(Qt::UserRole + 1).toULongLong() : 0; + showContextMenu(table, item->text(), mapName, table->viewport()->mapToGlobal(pos), + QString(), 0, mapAircraftId); +} + +// ---- Charts ---- + +void AircraftGUI::plotChart() +{ + QChart *oldChart = m_chart; + + m_chart = new QChart(); + m_chart->layout()->setContentsMargins(0, 0, 0, 0); + m_chart->setMargins(QMargins(1, 1, 1, 1)); + m_chart->setTheme(QChart::ChartThemeDark); + m_chart->legend()->setAlignment(Qt::AlignRight); + + m_chartXAxis = new QDateTimeAxis(); + m_chartXAxis->setFormat("hh:mm:ss"); + m_chartYAxis = new QValueAxis(); + m_chartYAxis->setTitleText("Msgs/s"); + + m_chart->addAxis(m_chartXAxis, Qt::AlignBottom); + m_chart->addAxis(m_chartYAxis, Qt::AlignLeft); + + for (int i = 0; i < CHART_SERIES; i++) + { + m_chartSeries[i] = new QLineSeries(); + // One per protocol, named as everywhere else, and then the total. A fixed list + // of names here went out of step the moment a protocol was added. + m_chartSeries[i]->setName((i < AircraftReport::ProtocolCount) + ? AircraftTracker::protocolName(i) : QString("Total")); + m_chart->addSeries(m_chartSeries[i]); + m_chartSeries[i]->attachAxis(m_chartXAxis); + m_chartSeries[i]->attachAxis(m_chartYAxis); + } + + const QDateTime now = QDateTime::currentDateTime(); + m_chartXAxis->setMin(now.addSecs(-60)); + m_chartXAxis->setMax(now); + m_chartYAxis->setRange(0.0, 10.0); + + ui->chart->setChart(m_chart); + + // Click a legend entry to show/hide its series + const auto markers = m_chart->legend()->markers(); + for (QLegendMarker *marker : markers) { + connect(marker, &QLegendMarker::clicked, this, &AircraftGUI::legendMarkerClicked); + } + + delete oldChart; +} + +void AircraftGUI::legendMarkerClicked() +{ + QLegendMarker *marker = qobject_cast(sender()); + if (marker) + { + marker->series()->setVisible(!marker->series()->isVisible()); + marker->setVisible(true); + } +} + +void AircraftGUI::trackerMessageRates(const QList& rates) +{ + const QDateTime now = QDateTime::currentDateTime(); + + // The tracker prunes its ATC log of what belongs to nothing even in a sweep that + // discards no aircraft, and then sends nothing to say so. These samples come every ten + // seconds; the sweep runs once a minute, so pruning as often as that is enough. + if (now.toMSecsSinceEpoch() - m_orphansPrunedMs >= 60 * 1000) { + pruneOrphanMessageRows(); + } + + // The axis fits what is plotted now, falling as well as rising. Only ever growing + // left one burst flattening the chart for as long as the feature ran. Every retained + // point is in view - the x axis starts at the oldest - and a series hidden from the + // legend does not count. + qreal maxRate = 0.0; + for (int i = 0; (i < CHART_SERIES) && (i < rates.size()); i++) + { + m_chartSeries[i]->append(now.toMSecsSinceEpoch(), rates[i]); + // Bound long-running growth + if (m_chartSeries[i]->count() > 1000) { + m_chartSeries[i]->removePoints(0, m_chartSeries[i]->count() - 1000); + } + if (m_chartSeries[i]->isVisible()) + { + for (int j = 0; j < m_chartSeries[i]->count(); j++) { + maxRate = std::max(maxRate, m_chartSeries[i]->at(j).y()); + } + } + } + const qreal yMax = std::ceil(maxRate) + 1.0; + if (m_chartYAxis->max() != yMax) { + m_chartYAxis->setMax(yMax); + } + m_chartXAxis->setMax(now); + if (m_chartSeries[0]->count() > 0) { + m_chartXAxis->setMin(QDateTime::fromMSecsSinceEpoch((qint64) m_chartSeries[0]->at(0).x())); + } +} + +// Altitude and speed against time for the watched flight +void AircraftGUI::plotProfileChart() +{ + QChart *oldChart = m_profileChart; + m_profileChart = new QChart(); + m_profileChart->layout()->setContentsMargins(0, 0, 0, 0); + m_profileChart->setMargins(QMargins(1, 1, 1, 1)); + m_profileChart->setTheme(QChart::ChartThemeDark); + m_profileChart->legend()->setAlignment(Qt::AlignRight); + m_profileChart->setTitle(m_profileFlightId ? m_profileTitle : "No flight selected"); + + QDateTimeAxis *xAxis = new QDateTimeAxis(); + xAxis->setFormat("hh:mm"); + QValueAxis *altAxis = new QValueAxis(); + altAxis->setTitleText("Alt (ft)"); + QValueAxis *speedAxis = new QValueAxis(); + speedAxis->setTitleText("Speed (kn)"); + m_profileChart->addAxis(xAxis, Qt::AlignBottom); + m_profileChart->addAxis(altAxis, Qt::AlignLeft); + m_profileChart->addAxis(speedAxis, Qt::AlignRight); + + QLineSeries *altSeries = new QLineSeries(); + altSeries->setName("Altitude"); + QLineSeries *speedSeries = new QLineSeries(); + speedSeries->setName("Speed"); + + float maxAlt = 0.0f; + float maxSpeed = 0.0f; + for (int i = 0; i < m_profileTimes.size(); i++) + { + if (!std::isnan(m_profileAltFt[i])) + { + altSeries->append(m_profileTimes[i], m_profileAltFt[i]); + maxAlt = std::max(maxAlt, m_profileAltFt[i]); + } + if (!std::isnan(m_profileSpeedKts[i])) + { + speedSeries->append(m_profileTimes[i], m_profileSpeedKts[i]); + maxSpeed = std::max(maxSpeed, m_profileSpeedKts[i]); + } + } + + m_profileChart->addSeries(altSeries); + altSeries->attachAxis(xAxis); + altSeries->attachAxis(altAxis); + m_profileChart->addSeries(speedSeries); + speedSeries->attachAxis(xAxis); + speedSeries->attachAxis(speedAxis); + + if (!m_profileTimes.isEmpty()) + { + xAxis->setMin(QDateTime::fromMSecsSinceEpoch(m_profileTimes.first())); + xAxis->setMax(QDateTime::fromMSecsSinceEpoch(std::max(m_profileTimes.first() + 60000, m_profileTimes.last()))); + } + else + { + const QDateTime now = QDateTime::currentDateTime(); + xAxis->setMin(now.addSecs(-60)); + xAxis->setMax(now); + } + altAxis->setRange(0.0, std::max(1000.0, std::ceil(maxAlt / 1000.0) * 1000.0)); + speedAxis->setRange(0.0, std::max(100.0, std::ceil(maxSpeed / 100.0) * 100.0)); + + ui->profileChart->setChart(m_profileChart); + delete oldChart; +} + +// ---- Toolbar ---- + +void AircraftGUI::on_deleteAircraft_clicked() +{ + tracker()->getInputMessageQueue()->push(AircraftTracker::MsgDeleteAll::create()); +} + +void AircraftGUI::on_feed_clicked(bool checked) +{ + m_settings.m_feedEnabled = checked; + m_settingsKeys.append("feedEnabled"); + applySettings(); +} + +// Feed settings dialog: station ident plus per-aggregator enable, host and port. +// +// Here rather than in the ACARS demodulator, where it used to be: a receiver runs one +// demodulator per band - VHF, VDL-2, HFDL - and this had to be filled in identically in +// each of them, opening three sets of connections to the same aggregator under the same +// station identity. The station is a property of the receiver, so it is configured once. +void AircraftGUI::feedSelect(const QPoint& p) +{ + QDialog dialog(this); + dialog.setWindowTitle("ACARS Feed Settings"); + + QLineEdit *stationId = new QLineEdit(m_settings.m_feedStationId); + stationId->setToolTip("Station identifier sent with each message (e.g. XX-JBLOGGS-VHF1). Register it with the aggregator to claim your feed"); + QCheckBox *airframes = new QCheckBox("Feed airframes.io"); + airframes->setChecked(m_settings.m_feedAirframes); + QLineEdit *airframesHost = new QLineEdit(m_settings.m_feedAirframesHost); + QSpinBox *airframesPort = new QSpinBox(); + airframesPort->setRange(1, 65535); + airframesPort->setValue(m_settings.m_feedAirframesPort); + QComboBox *airframesProtocol = new QComboBox(); + airframesProtocol->addItems({"TCP", "UDP"}); + airframesProtocol->setCurrentIndex(m_settings.m_feedAirframesTcp ? 0 : 1); + airframesProtocol->setToolTip("Use the protocol, host and port the airframes.io Add Ground Station wizard assigns to your station"); + QCheckBox *avdelphi = new QCheckBox("Feed avdelphi.com"); + avdelphi->setChecked(m_settings.m_feedAvdelphi); + QLineEdit *avdelphiHost = new QLineEdit(m_settings.m_feedAvdelphiHost); + QSpinBox *avdelphiPort = new QSpinBox(); + avdelphiPort->setRange(1, 65535); + avdelphiPort->setValue(m_settings.m_feedAvdelphiPort); + QComboBox *avdelphiProtocol = new QComboBox(); + avdelphiProtocol->addItems({"TCP", "UDP"}); + avdelphiProtocol->setCurrentIndex(m_settings.m_feedAvdelphiTcp ? 0 : 1); + + QFormLayout *form = new QFormLayout(&dialog); + form->addRow("Station ID", stationId); + form->addRow(airframes); + form->addRow("Host", airframesHost); + form->addRow("Port", airframesPort); + form->addRow("Protocol", airframesProtocol); + form->addRow(avdelphi); + form->addRow("Host", avdelphiHost); + form->addRow("Port", avdelphiPort); + form->addRow("Protocol", avdelphiProtocol); + QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + form->addRow(buttons); + connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); + connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); + + dialog.move(p); + if (dialog.exec() == QDialog::Accepted) + { + m_settings.m_feedStationId = stationId->text().trimmed(); + m_settings.m_feedAirframes = airframes->isChecked(); + m_settings.m_feedAirframesHost = airframesHost->text().trimmed(); + m_settings.m_feedAirframesPort = airframesPort->value(); + m_settings.m_feedAirframesTcp = airframesProtocol->currentIndex() == 0; + m_settings.m_feedAvdelphi = avdelphi->isChecked(); + m_settings.m_feedAvdelphiHost = avdelphiHost->text().trimmed(); + m_settings.m_feedAvdelphiPort = avdelphiPort->value(); + m_settings.m_feedAvdelphiTcp = avdelphiProtocol->currentIndex() == 0; + m_settingsKeys.append({"feedStationId", "feedAirframes", "feedAirframesHost", + "feedAirframesPort", "feedAirframesTcp", "feedAvdelphi", + "feedAvdelphiHost", "feedAvdelphiPort", "feedAvdelphiTcp"}); + applySettings(); + } +} + +void AircraftGUI::on_settings_clicked() +{ + AircraftSettingsDialog dialog(&m_settings, this); + + if (dialog.exec() == QDialog::Accepted) + { + const QStringList& changed = dialog.changedSettings(); + + if (!changed.isEmpty()) + { + m_settingsKeys.append(changed); + applySettings(); + } + } +} + +void AircraftGUI::on_notifications_clicked() +{ + AircraftNotificationDialog dialog(&m_settings, this); + new DialogPositioner(&dialog, true); + if (dialog.exec() == QDialog::Accepted) + { + m_settingsKeys.append("notificationSettings"); + applySettings(); + } +} + +// The statistics table and the message rate chart live in the same vertical splitter as +// the tables, rather than in tabs, so they can be watched at the same time as the traffic +// they describe - the same arrangement the ADS-B demodulator uses. +// Right clicking either toggle resets what it shows, which is how the same two buttons +// behave in the ADS-B demodulator +void AircraftGUI::statsContextMenu(const QPoint& pos) +{ + QMenu menu(this); + QAction *session = menu.addAction("Reset session statistics"); + QAction *allTime = menu.addAction("Reset all time statistics"); + QAction *chosen = menu.exec(ui->stats->mapToGlobal(pos)); + + if (chosen == session) + { + tracker()->getInputMessageQueue()->push( + AircraftTracker::MsgResetStatistics::create(false)); + } + else if (chosen == allTime) + { + // Clearing the preset's copy as well, so a preset written before the records + // moved into the database cannot be imported over the reset that just happened + m_settings.m_statistics = QByteArray(); + m_settingsKeys.append("statistics"); + tracker()->getInputMessageQueue()->push( + AircraftTracker::MsgResetStatistics::create(true)); + applySettings(); + } +} + +void AircraftGUI::on_stats_clicked(bool checked) +{ + m_settings.m_displayStatistics = checked; + ui->statistics->setVisible(checked); + m_settingsKeys.append("displayStatistics"); + applySettings(); +} + +void AircraftGUI::chartContextMenu(const QPoint& pos) +{ + QMenu menu(this); + QAction *reset = menu.addAction("Reset chart data"); + if (menu.exec(ui->displayChart->mapToGlobal(pos)) == reset) + { + for (int i = 0; i < CHART_SERIES; i++) + { + if (m_chartSeries[i]) { + m_chartSeries[i]->clear(); + } + } + } +} + +void AircraftGUI::on_displayChart_clicked(bool checked) +{ + m_settings.m_displayChart = checked; + ui->chart->setVisible(checked); + m_settingsKeys.append("displayChart"); + applySettings(); +} + +void AircraftGUI::on_coverage_clicked(bool checked) +{ + m_settings.m_displayCoverage = checked; + m_settingsKeys.append("displayCoverage"); + applySettings(); +} + +void AircraftGUI::on_atcLabels_clicked(bool checked) +{ + m_settings.m_atcLabels = checked; + m_settingsKeys.append("atcLabels"); + applySettings(); // The tracker refreshes the Map labels +} + +// ---- Column management ---- + +// Every column's position, not just the one dragged: those between where it was and where +// it went have each moved one place, and storing only the dragged column left them +// claiming their old places - so the order restored was not the order saved +void AircraftGUI::aircraft_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) +{ + (void) logicalIndex; + (void) oldVisualIndex; + (void) newVisualIndex; + + const QHeaderView *header = ui->aircraft->horizontalHeader(); + for (int i = 0; i < AIRCRAFT_COLUMNS; i++) { + m_settings.m_columnIndexes[i] = header->visualIndex(i); + } + m_settingsKeys.append("columnIndexes"); + applySettings(); +} + +void AircraftGUI::aircraft_sectionResized(int logicalIndex, int oldSize, int newSize) +{ + (void) oldSize; + + m_settings.m_columnSizes[logicalIndex] = newSize; + m_settingsKeys.append("columnSizes"); + applySettings(); +} + +// As aircraft_sectionMoved() +void AircraftGUI::flights_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) +{ + (void) logicalIndex; + (void) oldVisualIndex; + (void) newVisualIndex; + + const QHeaderView *header = ui->flights->horizontalHeader(); + for (int i = 0; i < FLIGHT_COLUMNS; i++) { + m_settings.m_flightColumnIndexes[i] = header->visualIndex(i); + } + m_settingsKeys.append("flightColumnIndexes"); + applySettings(); +} + +void AircraftGUI::flights_sectionResized(int logicalIndex, int oldSize, int newSize) +{ + (void) oldSize; + + m_settings.m_flightColumnSizes[logicalIndex] = newSize; + m_settingsKeys.append("flightColumnSizes"); + applySettings(); +} + +void AircraftGUI::flightColumnSelectMenu(QPoint pos) +{ + m_flightColumnMenu->popup(ui->flights->horizontalHeader()->viewport()->mapToGlobal(pos)); +} + +void AircraftGUI::flightColumnSelectMenuChecked(bool checked) +{ + (void) checked; + + QAction* action = qobject_cast(sender()); + if (action != nullptr) + { + int idx = action->data().toInt(nullptr); + if (!action->isChecked() && (visibleColumnCount(ui->flights, FLIGHT_COLUMNS) <= 1)) + { + // The menu that would put it back lives on the header, and a table with no + // visible columns has no header to right-click: refuse the last one + action->setChecked(true); + return; + } + ui->flights->setColumnHidden(idx, !action->isChecked()); + } +} + +void AircraftGUI::aircraftColumnSelectMenu(QPoint pos) +{ + m_columnMenu->popup(ui->aircraft->horizontalHeader()->viewport()->mapToGlobal(pos)); +} + +void AircraftGUI::aircraftColumnSelectMenuChecked(bool checked) +{ + (void) checked; + + QAction* action = qobject_cast(sender()); + if (action != nullptr) + { + int idx = action->data().toInt(nullptr); + if (!action->isChecked() && (visibleColumnCount(ui->aircraft, AIRCRAFT_COLUMNS) <= 1)) + { + // The menu that would put it back lives on the header, and a table with no + // visible columns has no header to right-click: refuse the last one + action->setChecked(true); + return; + } + ui->aircraft->setColumnHidden(idx, !action->isChecked()); + } +} + +QAction *AircraftGUI::createCheckableItem(QString &text, int idx, bool checked, const char *slot) +{ + QAction *action = new QAction(text, this); + action->setCheckable(true); + action->setChecked(checked); + action->setData(QVariant(idx)); + connect(action, SIGNAL(triggered()), this, slot); + return action; +} diff --git a/plugins/feature/aircraft/aircraftgui.h b/plugins/feature/aircraft/aircraftgui.h index f7fb2e52f..b689ff798 100644 --- a/plugins/feature/aircraft/aircraftgui.h +++ b/plugins/feature/aircraft/aircraftgui.h @@ -19,9 +19,12 @@ #ifndef INCLUDE_FEATURE_AIRCRAFTGUI_H_ #define INCLUDE_FEATURE_AIRCRAFTGUI_H_ +#include + #include #include #include +#include #include #include "feature/featuregui.h" @@ -73,10 +76,6 @@ private: PluginAPI* m_pluginAPI; FeatureUISet* m_featureUISet; AircraftSettings m_settings; - // The statistics records, serialised by the tracker and held ready for serialize(), - // which is const and cannot go and ask for them - QByteArray m_statisticsBlob; - // All three splitters in one blob - see AircraftSettings::m_splitterStates QByteArray saveSplitters() const; void restoreSplitters(const QByteArray& data); @@ -86,7 +85,7 @@ private: // the selection that triggered the rebuild had just chosen bool m_updatingHistoryTables = false; // Which column Find looks in, in the order the combo lists them - enum FindColumn { FindAll = 0, FindIcao, FindReg, FindType, FindFlight }; + enum FindColumn { FindAll = 0, FindIcao, FindReg, FindType, FindFlight, FindSelcal }; // Where the last match was, so Enter steps on to the next one rather than finding // the same row again int m_findRow = -1; @@ -114,10 +113,34 @@ private: QMenu *m_flightColumnMenu; // Selection driving the Documents/ATC filter, the photo and the profile + //!< Which table the documents are being shown for. The Aircraft and Flights tables + //!< each hold their own selection and Qt keeps both, so without this the handlers + //!< fought: each cleared the other's state, and a selection model re-emitting after + //!< a sort took the selection back from the table the user had actually clicked. + enum SelectionOwner { SelectionNone, SelectionAircraft, SelectionFlight }; + SelectionOwner m_selectionOwner = SelectionNone; quint64 m_selectedAircraftId = 0; QString m_selectedRegistration; quint32 m_selectedIcao = 0; quint64 m_selectedFlightId = 0; + // A selected row whose aircraft or flight was merged into another goes with it when + // the merged-away one is removed. These hold the survivor whose row should take the + // selection over, until the tracker sends that row as it is after the merge - see + // reselectMerged() + quint64 m_reselectAircraftId = 0; + quint64 m_reselectFlightId = 0; + // Set while the tracker's changes are being applied to a model, or a reselection is + // moving a selection we mean to keep, so the selection changes they cause are not taken + // as the user's. A row leaving a view makes Qt select its neighbour, and the models are + // half updated while it happens - see keepSelections() + bool m_ignoreSelectionChanges = false; + // When the message tables were last pruned of rows belonging to nothing - see + // pruneOrphanMessageRows() + qint64 m_orphansPrunedMs = 0; + // What the history tables were last filled for. The default sort is applied only + // when that changes, so a sort the user chose survives the refills every flush brings + quint64 m_pastFlightsAircraftId = 0; + QString m_pastAircraftFlightNumber; // Message rate chart, driven by the tracker's rate samples static const int CHART_SERIES = AircraftReport::ProtocolCount + 1; @@ -156,12 +179,31 @@ private: void trackerStatistics(const AircraftStatistics& statistics); bool messageRowVisible(const QTableWidgetItem *firstItem) const; void applyMessageFilter(); + bool filterAppendedRows(QTableWidget *table, int firstNewRow, const QSet& added); + void retagMessageRows(int role, quint64 from, quint64 to); + void removeMessageRows(const std::function& matches, + const QDateTime& olderThan = QDateTime()); + void pruneOrphanMessageRows(); + bool reselectMerged(); + //!< The aircraft or flight selected in each of a pair of views, by id + struct ViewSelections { + quint64 m_live = 0; + quint64 m_archive = 0; + }; + quint64 selectedIdIn(bool flights, bool archive) const; + ViewSelections selectedIds(bool flights) const; + void keepSelections(bool flights, const ViewSelections& before); + void dropSelection(); + void clearSelectionState(); void tableContextMenu(QTableWidget *table, QPoint pos); void viewContextMenu(QTableView *view, bool aircraftView, QPoint pos); void showContextMenu(QWidget *parent, const QString& cellText, const QString& mapName, QPoint globalPos, const QString& showFlight = QString(), - quint64 showAircraftId = 0); + quint64 showAircraftId = 0, quint64 mapAircraftId = 0); + bool aircraftOnMap(quint64 aircraftId) const; + bool selectRow(bool flights, const std::function& matches); void selectFlight(const QString& flight); + void selectFlightById(quint64 flightId); void selectAircraft(quint64 aircraftId); void plotChart(); void plotProfileChart(); @@ -178,6 +220,8 @@ private slots: void handleInputMessages(); void on_deleteAircraft_clicked(); void on_settings_clicked(); + void on_feed_clicked(bool checked); + void feedSelect(const QPoint& p); void on_notifications_clicked(); void on_atcLabels_clicked(bool checked); void on_stats_clicked(bool checked); @@ -191,7 +235,9 @@ private slots: void pastFlightSelectionChanged(); void chartContextMenu(const QPoint& pos); void on_displayChart_clicked(bool checked); + void on_coverage_clicked(bool checked); void documentSelectionChanged(); + void logonSelectionChanged(); void aircraftSelectionChanged(); void flightSelectionChanged(); void aircraft_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex); @@ -211,6 +257,8 @@ private slots: void trackerAircraftRemoved(const QList& ids); void trackerFlightsUpdated(const QList& flights); void trackerFlightsRemoved(const QList& ids); + void trackerFlightsMerged(quint64 from, quint64 to); + void trackerAircraftMerged(quint64 from, quint64 to); void trackerDocumentsAdded(const QList& documents); void trackerAtcMessages(const QList& messages); void trackerProfileUpdated(quint64 flightId, const QList& times, const QList& altitudeFt, const QList& speedKts); @@ -218,6 +266,7 @@ private slots: void trackerSpeechNotification(const QString& speech); void trackerAllCleared(); void trackerDatabaseFilenameReverted(const QString& filename); + void trackerSelectRequested(int kind, const QString& value); // Column enums for the Documents and ATC tables (still QTableWidgets) private: diff --git a/plugins/feature/aircraft/aircraftgui.ui b/plugins/feature/aircraft/aircraftgui.ui index 48e59b1af..cee2fa919 100644 --- a/plugins/feature/aircraft/aircraftgui.ui +++ b/plugins/feature/aircraft/aircraftgui.ui @@ -93,7 +93,12 @@
- Flight + Callsign + + + + + SELCAL @@ -107,7 +112,7 @@ - Highlight the next aircraft or flight matching this text. Matches ICAO address, registration, type, flight number, airline, departure or arrival. Press Enter to step through the matches + Highlight the next aircraft or flight matching this text. Matches ICAO address, registration, type, flight number, SELCAL code, airline, departure or arrival. Press Enter to step through the matches Find @@ -189,6 +194,40 @@ + + + + Display the coverage of each protocol on the Map, one colour each. Right click to reset the coverage data. + + + + + + + :/icons/coverage.png:/icons/coverage.png + + + true + + + + + + + Enable feeding of received ACARS messages to aggregators (airframes.io / avdelphi.com). Right click for settings. + + + ... + + + + :/txon.png:/txon.png + + + true + + + @@ -702,7 +741,14 @@ 2 - + + + Qt::Vertical + + + false + + 0 @@ -731,10 +777,10 @@ - Flight + Callsign - Flight the document belongs to + Callsign of the flight the document belongs to @@ -762,16 +808,115 @@ + + + The selected document + + + true + + + + + + + + Logons + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + - + + + Qt::Vertical + + + false + + + + + 0 + 0 + + - The selected document + Datalink logons for the selected aircraft or flight. Kept apart from the documents because there are far more of them than of everything else together. + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + + Time + + + Time the logon was received + + + + + Callsign + + + Callsign of the flight the logon belongs to + + + + + Reg + + + Aircraft registration or ICAO address + + + + + Type + + + Kind of logon + + + + + Title + + + Logon title + + + + + + The selected logon true + diff --git a/plugins/feature/aircraft/aircrafticons.qrc b/plugins/feature/aircraft/aircrafticons.qrc index cecaa0c34..012fd50b6 100644 --- a/plugins/feature/aircraft/aircrafticons.qrc +++ b/plugins/feature/aircraft/aircrafticons.qrc @@ -1,6 +1,7 @@ - - - icons/stats.png - icons/chart.png - + + + icons/stats.png + icons/chart.png + icons/coverage.png + diff --git a/plugins/feature/aircraft/aircraftnotificationdialog.cpp b/plugins/feature/aircraft/aircraftnotificationdialog.cpp index 4bbfd1c32..b6a91df16 100644 --- a/plugins/feature/aircraft/aircraftnotificationdialog.cpp +++ b/plugins/feature/aircraft/aircraftnotificationdialog.cpp @@ -19,6 +19,7 @@ #include #include "aircraftnotificationdialog.h" +#include "gui/fastitemdelegate.h" AircraftNotificationDialog::AircraftNotificationDialog(AircraftSettings *settings, QWidget* parent) : @@ -28,6 +29,11 @@ AircraftNotificationDialog::AircraftNotificationDialog(AircraftSettings *setting { ui->setupUi(this); + // Cells painted through QStyle cost a SystemParametersInfo call each with the Fusion + // style - 28 to 93 us depending on the machine. See FastItemDelegate + ui->table->setItemDelegate(new FastItemDelegate(ui->table)); + + resizeTable(); for (int i = 0; i < m_settings->m_notificationSettings.size(); i++) { diff --git a/plugins/feature/aircraft/aircraftsettings.cpp b/plugins/feature/aircraft/aircraftsettings.cpp index 3de22fa56..2b6795b6a 100644 --- a/plugins/feature/aircraft/aircraftsettings.cpp +++ b/plugins/feature/aircraft/aircraftsettings.cpp @@ -37,9 +37,12 @@ AircraftSettings::AircraftSettings() : // unless the user turns it off, so a demodulator added later is included by default. const QStringList& AircraftSettings::sourceURIs() { + // Also the list the feature connects its pipes to, so a demodulator added here is + // both heard and offered in the settings dialog static const QStringList uris = { "sdrangel.channel.adsbdemod", - "sdrangel.channel.acarsdemod" + "sdrangel.channel.acarsdemod", + "sdrangel.channel.selcaldemod" }; return uris; } @@ -50,6 +53,8 @@ QString AircraftSettings::sourceName(const QString& uri) return "ADS-B Demodulator"; } else if (uri == "sdrangel.channel.acarsdemod") { return "ACARS Demodulator"; + } else if (uri == "sdrangel.channel.selcaldemod") { + return "SELCAL Demodulator"; } return uri; } @@ -85,6 +90,17 @@ void AircraftSettings::resetToDefaults() m_displayChart = false; m_favourLivery = true; m_useLiveryIcons = false; + m_feedEnabled = false; + m_feedStationId = ""; + m_feedAirframes = true; + m_feedAirframesHost = "feed.airframes.io"; + m_feedAirframesPort = 5550; + m_feedAirframesTcp = false; + m_feedAvdelphi = false; + m_feedAvdelphiHost = "data.avdelphi.com"; + m_feedAvdelphiPort = 5556; + m_feedAvdelphiTcp = false; + m_displayCoverage = false; m_databaseFilename = ""; m_disabledSources.clear(); // Rules that speak and run commands are exactly the kind of thing a reset is asked @@ -139,15 +155,30 @@ QByteArray AircraftSettings::serialize() const s.writeBlob(43, m_splitterStates); s.writeBool(40, m_favourLivery); s.writeBool(45, m_useLiveryIcons); + s.writeBool(46, m_feedEnabled); + s.writeString(47, m_feedStationId); + s.writeBool(48, m_feedAirframes); + s.writeString(49, m_feedAirframesHost); + s.writeS32(50, m_feedAirframesPort); + s.writeBool(51, m_feedAirframesTcp); + s.writeBool(52, m_feedAvdelphi); + s.writeString(53, m_feedAvdelphiHost); + s.writeS32(54, m_feedAvdelphiPort); + s.writeBool(55, m_feedAvdelphiTcp); + s.writeBool(56, m_displayCoverage); for (int i = 0; i < AIRCRAFT_COLUMNS; i++) { s.writeS32(300 + i, m_columnIndexes[i]); } for (int i = 0; i < FLIGHT_COLUMNS; i++) { - s.writeS32(500 + i, m_flightColumnIndexes[i]); + // 700/800 rather than 500/600: the flight columns were reordered, so a layout + // saved against the old order describes different columns and must not be + // applied to them. Reading from new keys makes an old preset fall back to + // the defaults, which are the new order, exactly once. + s.writeS32(700 + i, m_flightColumnIndexes[i]); } for (int i = 0; i < FLIGHT_COLUMNS; i++) { - s.writeS32(600 + i, m_flightColumnSizes[i]); + s.writeS32(800 + i, m_flightColumnSizes[i]); } for (int i = 0; i < AIRCRAFT_COLUMNS; i++) { @@ -214,12 +245,31 @@ bool AircraftSettings::deserialize(const QByteArray& data) d.readBlob(43, &m_splitterStates); d.readBool(40, &m_favourLivery, true); d.readBool(45, &m_useLiveryIcons, false); + d.readBool(46, &m_feedEnabled, false); + d.readString(47, &m_feedStationId, ""); + d.readBool(48, &m_feedAirframes, true); + d.readString(49, &m_feedAirframesHost, "feed.airframes.io"); + d.readS32(50, &m_feedAirframesPort, 5550); + // A port out of range would be refused by the socket and the feed would sit there + // failing, so a corrupt or hand edited preset falls back to the published one + if ((m_feedAirframesPort <= 1023) || (m_feedAirframesPort >= 65535)) { + m_feedAirframesPort = 5550; + } + d.readBool(51, &m_feedAirframesTcp, false); + d.readBool(52, &m_feedAvdelphi, false); + d.readString(53, &m_feedAvdelphiHost, "data.avdelphi.com"); + d.readS32(54, &m_feedAvdelphiPort, 5556); + if ((m_feedAvdelphiPort <= 1023) || (m_feedAvdelphiPort >= 65535)) { + m_feedAvdelphiPort = 5556; + } + d.readBool(55, &m_feedAvdelphiTcp, false); + d.readBool(56, &m_displayCoverage, false); for (int i = 0; i < FLIGHT_COLUMNS; i++) { - d.readS32(500 + i, &m_flightColumnIndexes[i], i); + d.readS32(700 + i, &m_flightColumnIndexes[i], i); } for (int i = 0; i < FLIGHT_COLUMNS; i++) { - d.readS32(600 + i, &m_flightColumnSizes[i], -1); + d.readS32(800 + i, &m_flightColumnSizes[i], -1); } for (int i = 0; i < AIRCRAFT_COLUMNS; i++) { d.readS32(300 + i, &m_columnIndexes[i], i); @@ -291,12 +341,45 @@ void AircraftSettings::applySettings(const QStringList& settingsKeys, const Airc if (settingsKeys.contains("displayChart")) { m_displayChart = settings.m_displayChart; } + if (settingsKeys.contains("displayCoverage")) { + m_displayCoverage = settings.m_displayCoverage; + } if (settingsKeys.contains("favourLivery")) { m_favourLivery = settings.m_favourLivery; } if (settingsKeys.contains("useLiveryIcons")) { m_useLiveryIcons = settings.m_useLiveryIcons; } + if (settingsKeys.contains("feedEnabled")) { + m_feedEnabled = settings.m_feedEnabled; + } + if (settingsKeys.contains("feedStationId")) { + m_feedStationId = settings.m_feedStationId; + } + if (settingsKeys.contains("feedAirframes")) { + m_feedAirframes = settings.m_feedAirframes; + } + if (settingsKeys.contains("feedAirframesHost")) { + m_feedAirframesHost = settings.m_feedAirframesHost; + } + if (settingsKeys.contains("feedAirframesPort")) { + m_feedAirframesPort = settings.m_feedAirframesPort; + } + if (settingsKeys.contains("feedAirframesTcp")) { + m_feedAirframesTcp = settings.m_feedAirframesTcp; + } + if (settingsKeys.contains("feedAvdelphi")) { + m_feedAvdelphi = settings.m_feedAvdelphi; + } + if (settingsKeys.contains("feedAvdelphiHost")) { + m_feedAvdelphiHost = settings.m_feedAvdelphiHost; + } + if (settingsKeys.contains("feedAvdelphiPort")) { + m_feedAvdelphiPort = settings.m_feedAvdelphiPort; + } + if (settingsKeys.contains("feedAvdelphiTcp")) { + m_feedAvdelphiTcp = settings.m_feedAvdelphiTcp; + } if (settingsKeys.contains("statistics")) { m_statistics = settings.m_statistics; } diff --git a/plugins/feature/aircraft/aircraftsettings.h b/plugins/feature/aircraft/aircraftsettings.h index bba423358..db07aeb30 100644 --- a/plugins/feature/aircraft/aircraftsettings.h +++ b/plugins/feature/aircraft/aircraftsettings.h @@ -1,126 +1,143 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_FEATURE_AIRCRAFTSETTINGS_H_ -#define INCLUDE_FEATURE_AIRCRAFTSETTINGS_H_ - -#include -#include -#include -#include -#include - -class Serializable; - -// Number of columns in the tables. These size the saved width and order arrays, and -// the header's own sectionMoved/sectionResized hand back a logical index straight out of -// the model - so a column added to a model without changing the count here writes off -// the end of the array. aircrafttablemodels.cpp asserts the two agree at compile time. -#define AIRCRAFT_COLUMNS 16 -// Flight, Reg, From, To, Out, Off, On, In, First seen, Last seen, LS, OC, FP, Docs, -// Protocols -#define FLIGHT_COLUMNS 15 - -struct AircraftSettings -{ - // What a notification rule matches against - enum NotificationMatch { - MATCH_ICAO, - MATCH_REG, - MATCH_FLIGHT, - MATCH_TYPE - }; - - struct NotificationSettings { - int m_matchColumn; // One of enum NotificationMatch - QString m_regExp; - QString m_speech; - QString m_command; - QRegularExpression m_regularExpression; - - NotificationSettings(); - void updateRegularExpression(); - }; - QString m_title; - quint32 m_rgbColor; - bool m_useReverseAPI; - QString m_reverseAPIAddress; - uint16_t m_reverseAPIPort; - uint16_t m_reverseAPIFeatureSetIndex; - uint16_t m_reverseAPIFeatureIndex; - Serializable *m_rollupState; - int m_workspaceIndex; - QByteArray m_geometryBytes; - - int m_removalMins; // Archive an aircraft after this many minutes without a report - // How long a position stays believable, and so how long the aircraft stays on the - // Map. Separate figures because the protocols report at wildly different rates: ADS-B - // is about once a second, while an ACARS, VDL-2 or HFDL position can be the only one - // for many minutes. Applies to the 2D and 3D maps alike. - int m_adsbPositionMins; - int m_acarsPositionMins; - int m_retentionDays; // Discard archived aircraft after this many days; 0 keeps them - bool m_atcLabels; // Display route, altitude and speed in Map labels - bool m_atcCallsigns; // Map labels use the airline's callsign (SPEEDBIRD) not its code (BAW) - // Keep the furthest aircraft ever heard on the Map, at the position it was in when - // it set the record. Serialised at key 44. - bool m_displayMaxRangeOnMap; - // The Statistics tab's records - furthest, fastest, highest - serialised by the - // tracker. Kept opaque here so a new statistic does not need a new settings key. - QByteArray m_statistics; - //!< How the splitters divide the space. One blob for all of them, so that adding - //!< another splitter later does not need another settings key. - //!< Serialised at key 43: SimpleDeserializer REJECTS THE WHOLE BLOB if an id appears - //!< twice, so a clashing key does not lose one setting, it loses every setting the - //!< feature has. This was first written at 41, which m_adsbPositionMins already had. - QByteArray m_splitterStates; - bool m_displayStatistics; // Statistics table shown in the splitter - bool m_displayChart; // Message rate chart shown in the splitter - // Prefer a model in the right airline livery over a model of exactly the right type - bool m_favourLivery; - bool m_useLiveryIcons; // Use aircraft icons with airline liveries on 2D map, instead of black icons - QString m_databaseFilename; // Where the session is kept; empty means the default location - QStringList m_disabledSources; // Channel URIs not to accept reports from; empty accepts all - - // The demodulators that can feed this feature, and what to call them - static const QStringList& sourceURIs(); - static QString sourceName(const QString& uri); - static QString defaultDatabaseFilename(); - QList> m_notificationSettings; - - int m_columnIndexes[AIRCRAFT_COLUMNS]; - int m_columnSizes[AIRCRAFT_COLUMNS]; - int m_flightColumnIndexes[FLIGHT_COLUMNS]; - int m_flightColumnSizes[FLIGHT_COLUMNS]; - - AircraftSettings(); - void resetToDefaults(); - QByteArray serialize() const; - bool deserialize(const QByteArray& data); - void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } - void applySettings(const QStringList& settingsKeys, const AircraftSettings& settings); - QString getDebugString(const QStringList& settingsKeys, bool force=false) const; - - QByteArray serializeNotificationSettings(const QList>& notificationSettings) const; - static void deserializeNotificationSettings(const QByteArray& data, QList>& notificationSettings); -}; - -QDataStream& operator<<(QDataStream& out, const QSharedPointer& settings); -QDataStream& operator>>(QDataStream& in, QSharedPointer& settings); - -#endif // INCLUDE_FEATURE_AIRCRAFTSETTINGS_H_ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_AIRCRAFTSETTINGS_H_ +#define INCLUDE_FEATURE_AIRCRAFTSETTINGS_H_ + +#include +#include +#include +#include +#include + +class Serializable; + +// Number of columns in the tables. These size the saved width and order arrays, and +// the header's own sectionMoved/sectionResized hand back a logical index straight out of +// the model - so a column added to a model without changing the count here writes off +// the end of the array. aircrafttablemodels.cpp asserts the two agree at compile time. +#define AIRCRAFT_COLUMNS 18 +// Flight, Reg, From, To, Out, Off, On, In, First seen, Last seen, LS, OC, FP, Docs, +// Protocols +#define FLIGHT_COLUMNS 17 + +struct AircraftSettings +{ + // What a notification rule matches against + enum NotificationMatch { + MATCH_ICAO, + MATCH_REG, + MATCH_FLIGHT, + MATCH_TYPE + }; + + struct NotificationSettings { + int m_matchColumn; // One of enum NotificationMatch + QString m_regExp; + QString m_speech; + QString m_command; + QRegularExpression m_regularExpression; + + NotificationSettings(); + void updateRegularExpression(); + }; + QString m_title; + quint32 m_rgbColor; + bool m_useReverseAPI; + QString m_reverseAPIAddress; + uint16_t m_reverseAPIPort; + uint16_t m_reverseAPIFeatureSetIndex; + uint16_t m_reverseAPIFeatureIndex; + Serializable *m_rollupState; + int m_workspaceIndex; + QByteArray m_geometryBytes; + + int m_removalMins; // Archive an aircraft after this many minutes without a report + // How long a position stays believable, and so how long the aircraft stays on the + // Map. Separate figures because the protocols report at wildly different rates: ADS-B + // is about once a second, while an ACARS, VDL-2 or HFDL position can be the only one + // for many minutes. Applies to the 2D and 3D maps alike. + int m_adsbPositionMins; + int m_acarsPositionMins; + int m_retentionDays; // Discard archived aircraft after this many days; 0 keeps them + bool m_atcLabels; // Display route, altitude and speed in Map labels + bool m_atcCallsigns; // Map labels use the airline's callsign (SPEEDBIRD) not its code (BAW) + // Keep the furthest aircraft ever heard on the Map, at the position it was in when + // it set the record. Serialised at key 44. + bool m_displayMaxRangeOnMap; + // The Statistics tab's records - furthest, fastest, highest - serialised by the + // tracker. Kept opaque here so a new statistic does not need a new settings key. + QByteArray m_statistics; + //!< How the splitters divide the space. One blob for all of them, so that adding + //!< another splitter later does not need another settings key. + //!< Serialised at key 43: SimpleDeserializer REJECTS THE WHOLE BLOB if an id appears + //!< twice, so a clashing key does not lose one setting, it loses every setting the + //!< feature has. This was first written at 41, which m_adsbPositionMins already had. + QByteArray m_splitterStates; + bool m_displayStatistics; // Statistics table shown in the splitter + bool m_displayChart; // Message rate chart shown in the splitter + // Prefer a model in the right airline livery over a model of exactly the right type + bool m_favourLivery; + bool m_useLiveryIcons; // Use aircraft icons with airline liveries on 2D map, instead of black icons + + // Feeding received ACARS on to aggregators, in acarsdec style JSON. Here rather than + // in the ACARS demodulator because a receiver runs one of those per band - VHF, + // VDL-2, HFDL - and the feed is a property of the station, not of any one of them. + bool m_feedEnabled; + QString m_feedStationId; //!< Station ident sent with each message + bool m_feedAirframes; + QString m_feedAirframesHost; + int m_feedAirframesPort; + bool m_feedAirframesTcp; //!< TCP (as the airframes.io wizard assigns) or UDP + bool m_feedAvdelphi; + QString m_feedAvdelphiHost; + int m_feedAvdelphiPort; + bool m_feedAvdelphiTcp; + //!< Draw the polar coverage of each protocol on the Map - see + //!< AircraftTracker::updateCoverage() + bool m_displayCoverage; + QString m_databaseFilename; // Where the session is kept; empty means the default location + QStringList m_disabledSources; // Channel URIs not to accept reports from; empty accepts all + + // The demodulators that can feed this feature, and what to call them + static const QStringList& sourceURIs(); + static QString sourceName(const QString& uri); + static QString defaultDatabaseFilename(); + QList> m_notificationSettings; + + int m_columnIndexes[AIRCRAFT_COLUMNS]; + int m_columnSizes[AIRCRAFT_COLUMNS]; + int m_flightColumnIndexes[FLIGHT_COLUMNS]; + int m_flightColumnSizes[FLIGHT_COLUMNS]; + + AircraftSettings(); + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } + void applySettings(const QStringList& settingsKeys, const AircraftSettings& settings); + QString getDebugString(const QStringList& settingsKeys, bool force=false) const; + + QByteArray serializeNotificationSettings(const QList>& notificationSettings) const; + static void deserializeNotificationSettings(const QByteArray& data, QList>& notificationSettings); +}; + +QDataStream& operator<<(QDataStream& out, const QSharedPointer& settings); +QDataStream& operator>>(QDataStream& in, QSharedPointer& settings); + +#endif // INCLUDE_FEATURE_AIRCRAFTSETTINGS_H_ diff --git a/plugins/feature/aircraft/aircrafttablemodels.cpp b/plugins/feature/aircraft/aircrafttablemodels.cpp index e67cfbcdf..5c4ee1f64 100644 --- a/plugins/feature/aircraft/aircrafttablemodels.cpp +++ b/plugins/feature/aircraft/aircrafttablemodels.cpp @@ -16,9 +16,13 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include #include +#include +#include #include "util/airlines.h" #include "util/osndb.h" +#include "util/ourairportsdb.h" #include "aircrafttablemodels.h" #include "aircraftsettings.h" @@ -48,7 +52,39 @@ int AircraftTableModel::columnCount(const QModelIndex& parent) const QVariant AircraftTableModel::headerData(int section, Qt::Orientation orientation, int role) const { - if ((orientation != Qt::Horizontal) || (role != Qt::DisplayRole)) { + if (orientation != Qt::Horizontal) { + return QVariant(); + } + // What each column holds. Several headings are abbreviated to fit, and the table's + // own tooltip says nothing about the columns. + if (role == Qt::ToolTipRole) + { + switch (section) + { + case COL_ICAO: return "The aircraft's ICAO 24 bit address as hex. Unique to the airframe."; + case COL_REG: return "Registration, from a message or looked up from the ICAO address"; + case COL_TYPE: return "ICAO aircraft type designator, e.g. B77W"; + case COL_FLIGHT: return "Callsign the aircraft is transmitting - not the flight number"; + case COL_FLIGHT_NO: return "Flight number, the form a passenger is sold. Often differs from the callsign."; + case COL_AIRLINE: return "Operator, from the callsign's airline designator"; + case COL_SIDEVIEW: return "Side view of the type in the operator's livery, where one is known"; + case COL_COUNTRY: return "Country of registration, from the ICAO address block"; + case COL_LATITUDE: return "Latitude last reported, in degrees"; + case COL_LONGITUDE: return "Longitude last reported, in degrees"; + case COL_DISTANCE: return "Distance from the receiver that heard it, in km"; + case COL_ALTITUDE: return "Altitude last reported, in feet"; + case COL_HEADING: return "Heading or track last reported, in degrees"; + case COL_SPEED: return "Speed last reported, in knots"; + case COL_PROTOCOLS: return "Which protocols this aircraft has been heard on, and on what frequencies"; + case COL_MESSAGES: return "Messages received from this aircraft"; + case COL_LAST_SEEN: return "When a message was last received from this aircraft"; + case COL_SELCAL: return "SELCAL code: the one it was heard called on, otherwise what the" + " SELCAL database assigns it. Download the database from the" + " SELCAL Demodulator"; + default: return QVariant(); + } + } + if (role != Qt::DisplayRole) { return QVariant(); } switch (section) @@ -56,7 +92,8 @@ QVariant AircraftTableModel::headerData(int section, Qt::Orientation orientation case COL_ICAO: return "ICAO"; case COL_REG: return "Reg"; case COL_TYPE: return "Type"; - case COL_FLIGHT: return "Flight"; + case COL_FLIGHT: return "Callsign"; + case COL_FLIGHT_NO: return "Flight No"; case COL_AIRLINE: return "Airline"; case COL_SIDEVIEW: return "Sideview"; case COL_COUNTRY: return "Country"; @@ -69,6 +106,7 @@ QVariant AircraftTableModel::headerData(int section, Qt::Orientation orientation case COL_PROTOCOLS: return "Protocols"; case COL_MESSAGES: return "Msgs"; case COL_LAST_SEEN: return "Last seen"; + case COL_SELCAL: return "SELCAL"; default: return QVariant(); } } @@ -181,7 +219,10 @@ QVariant AircraftTableModel::data(const QModelIndex& index, int role) const return d.m_icao ? QString("%1").arg(d.m_icao, 6, 16, QChar('0')).toUpper() : QVariant(); case COL_REG: return d.m_registration; case COL_TYPE: return row.m_type; - case COL_FLIGHT: return d.m_flight; + // The ICAO callsign the transponder broadcasts and the IATA number ACARS carries, + // for the flight the airframe is on now - see AircraftTracker::flightNameForms() + case COL_FLIGHT: return d.m_callsign; + case COL_FLIGHT_NO: return d.m_flightNumber; case COL_AIRLINE: return row.m_airline.isNull() ? QVariant(row.m_airlineText) : QVariant(); case COL_LATITUDE: return d.m_positionValid ? QVariant((double) d.m_latitude) : QVariant(); case COL_LONGITUDE: return d.m_positionValid ? QVariant((double) d.m_longitude) : QVariant(); @@ -199,12 +240,15 @@ QVariant AircraftTableModel::data(const QModelIndex& index, int role) const case COL_PROTOCOLS: return d.m_protocols; case COL_MESSAGES: return d.m_messages; case COL_LAST_SEEN: return d.m_lastSeen; + case COL_SELCAL: return d.m_selcal; default: return QVariant(); } } void AircraftTableModel::upsert(const QList& aircraft) { + QList added; + for (const AircraftDisplay& d : aircraft) { int row = m_rowById.value(d.m_id, -1); @@ -220,30 +264,66 @@ void AircraftTableModel::upsert(const QList& aircraft) } else { - beginInsertRows(QModelIndex(), m_rows.size(), m_rows.size()); + // Collected and inserted in one go below: a beginInsertRows per aircraft makes + // the proxy re-sort and the view relayout once per row, and a feed delivers + // these in batches of dozens Row newRow; newRow.m_display = d; - m_rowById.insert(d.m_id, m_rows.size()); - m_rows.append(newRow); - endInsertRows(); + added.append(newRow); + } + } + + if (!added.isEmpty()) + { + beginInsertRows(QModelIndex(), m_rows.size(), m_rows.size() + added.size() - 1); + for (const Row& r : added) + { + m_rowById.insert(r.m_display.m_id, m_rows.size()); + m_rows.append(r); } + endInsertRows(); } } -void AircraftTableModel::remove(const QList& ids) +// Rows for ids we hold, highest first, so removing one never moves the next +template +static QList rowsDescending(const QHash& rowById, const QList& ids, T&& forget) { + QList rows; for (quint64 id : ids) { - int row = m_rowById.value(id, -1); + const int row = rowById.value(id, -1); if (row >= 0) { - beginRemoveRows(QModelIndex(), row, row); - m_rows.removeAt(row); - m_rowById.remove(id); - reindex(row); - endRemoveRows(); + rows.append(row); + forget(id); } } + std::sort(rows.begin(), rows.end(), std::greater()); + return rows; +} + +void AircraftTableModel::remove(const QList& ids) +{ + // Removed in contiguous runs and reindexed once. One row at a time reindexed + // everything below each removal, so the retention sweep discarding a few hundred + // archived aircraft cost hundreds of passes over the whole table. + const QList rows = rowsDescending(m_rowById, ids, [this](quint64 id) { m_rowById.remove(id); }); + if (rows.isEmpty()) { + return; + } + for (int i = 0; i < rows.size(); ) + { + const int last = rows[i]; + int first = last; + while ((++i < rows.size()) && (rows[i] == first - 1)) { + first--; + } + beginRemoveRows(QModelIndex(), first, last); + m_rows.erase(m_rows.begin() + first, m_rows.begin() + last + 1); + endRemoveRows(); + } + reindex(rows.last()); } void AircraftTableModel::reindex(int from) @@ -266,6 +346,20 @@ const AircraftDisplay *AircraftTableModel::aircraftAt(int row) const return ((row >= 0) && (row < m_rows.size())) ? &m_rows[row].m_display : nullptr; } +// Both the current and the archived aircraft views are proxies over this one model, so +// this finds an aircraft whichever of them is showing it - and returns nullptr for one +// that has been discarded altogether +const AircraftDisplay *AircraftTableModel::aircraftById(quint64 id) const +{ + const auto it = m_rowById.constFind(id); + return (it != m_rowById.constEnd()) ? aircraftAt(it.value()) : nullptr; +} + +int AircraftTableModel::rowOf(quint64 id) const +{ + return m_rowById.value(id, -1); +} + FlightTableModel::FlightTableModel(QObject *parent) : QAbstractTableModel(parent) { @@ -281,14 +375,58 @@ int FlightTableModel::columnCount(const QModelIndex& parent) const return parent.isValid() ? 0 : COL_COUNT; } +// The airport's name, for a tooltip. Looked up here rather than carried on every +// flight display: it is wanted only while the pointer rests on a cell, and the database +// is a shared hash that is loaded already. +static QString airportName(const QString& icao) +{ + if (icao.size() != 4) { + return QString(); + } + QSharedPointer> airports = + OurAirportsDB::getAirportsByIdent(); + const AirportInformation *airport = airports ? airports->value(icao, nullptr) : nullptr; + return airport ? airport->m_name : QString(); +} + QVariant FlightTableModel::headerData(int section, Qt::Orientation orientation, int role) const { - if ((orientation != Qt::Horizontal) || (role != Qt::DisplayRole)) { + if (orientation != Qt::Horizontal) { + return QVariant(); + } + // Four of these headings are two letters, so without this there is nothing anywhere + // that says what they are + if (role == Qt::ToolTipRole) + { + switch (section) + { + case COL_FLIGHT: return "Callsign the flight was flown under - what the aircraft transmits, not the flight number"; + case COL_FLIGHT_NO: return "Flight number, the form a passenger is sold. Often unrelated to the callsign."; + case COL_REG: return "Registration of the aircraft that flew it"; + case COL_FROM: return "Departure airport. Green where a message said so, plain where it is only the route database's guess."; + case COL_TO: return "Arrival airport. Green where a message said so, plain where it is only the route database's guess."; + case COL_DOCS: return "Documents collected for this flight: flight plans, clearances, loadsheets and OOOI events. Logons have their own tab and are not counted here."; + case COL_LS: return "Loadsheet: weights, fuel and passenger figures, sent before departure"; + case COL_CL: return "Clearance: an oceanic clearance, a request for one, or a pre-departure clearance"; + case COL_FP: return "Flight plan: a filed route, from the aircraft's own FMC or from a departure clearance"; + case COL_OUT: return "OOOI: off the gate"; + case COL_OFF: return "OOOI: airborne"; + case COL_ON: return "OOOI: landed"; + case COL_IN: return "OOOI: on the gate"; + case COL_FIRST_SEEN: return "When this flight was first heard"; + case COL_LAST_SEEN: return "When this flight was last heard"; + case COL_PROTOCOLS: return "Which protocols this flight was heard on, and on what frequencies"; + case COL_ROUTE_SOURCE: return "Where From and To came from: a received message or the callsign to route database, and whether the two agree"; + default: return QVariant(); + } + } + if (role != Qt::DisplayRole) { return QVariant(); } switch (section) { - case COL_FLIGHT: return "Flight"; + case COL_FLIGHT: return "Callsign"; + case COL_FLIGHT_NO: return "Flight No"; case COL_REG: return "Reg"; case COL_FROM: return "From"; case COL_TO: return "To"; @@ -299,10 +437,11 @@ QVariant FlightTableModel::headerData(int section, Qt::Orientation orientation, case COL_FIRST_SEEN: return "First seen"; case COL_LAST_SEEN: return "Last seen"; case COL_LS: return "LS"; - case COL_OC: return "OC"; + case COL_CL: return "CL"; case COL_FP: return "FP"; case COL_DOCS: return "Docs"; case COL_PROTOCOLS: return "Protocols"; + case COL_ROUTE_SOURCE: return "Route src"; default: return QVariant(); } } @@ -339,13 +478,62 @@ QVariant FlightTableModel::data(const QModelIndex& index, int role) const } } + // Green where an aircraft itself said so, plain where it is only the callsign to + // route database's guess. That is the distinction worth seeing at a glance, and it + // does not depend on the database holding the callsign at all - most do not, so + // colouring by agreement with it left confirmed routes looking unconfirmed. + // + // No red: where a message and the database disagree, what is displayed is the + // message's own answer, so marking it suspect said the opposite of the truth. The + // disagreement is reported in the Route src column instead. + if ((role == Qt::ForegroundRole) + && ((index.column() == COL_FROM) || (index.column() == COL_TO))) + { + const bool fromMessage = (index.column() == COL_FROM) ? d.m_departureFromMessage + : d.m_arrivalFromMessage; + return fromMessage ? QVariant(QColor(0, 192, 0)) : QVariant(); + } + if (role == Qt::ToolTipRole) { - if ((index.column() == COL_FLIGHT) && !d.m_aliases.isEmpty()) { + if (((index.column() == COL_FLIGHT) || (index.column() == COL_FLIGHT_NO)) + && !d.m_aliases.isEmpty()) { return QString("Also known as: %1").arg(d.m_aliases); } - if ((index.column() == COL_FROM) && !d.m_route.isEmpty()) { - return QString("Route: %1").arg(d.m_route); + if ((index.column() == COL_FROM) || (index.column() == COL_TO) + || (index.column() == COL_ROUTE_SOURCE)) + { + QStringList lines; + // Named, because a four letter ident is only recognisable if you happen to + // know it. Both ends whichever cell is hovered, since the pair is what the + // row is about. + for (int end = 0; end < 2; end++) + { + const QString ident = end ? d.m_arrival : d.m_departure; + if (ident.isEmpty()) { + continue; + } + const QString name = airportName(ident); + lines.append(QString("%1: %2").arg(end ? "To" : "From") + .arg(name.isEmpty() ? ident : QString("%1 - %2").arg(ident).arg(name))); + } + if ((index.column() == COL_FROM) && !d.m_route.isEmpty()) { + lines.append(QString("Route: %1").arg(d.m_route)); + } + if (d.m_routeSource.isEmpty()) { + return lines.isEmpty() ? QVariant() : QVariant(lines.join("\n")); + } + QString tip = (d.m_routeSource == "Database") + ? "From the callsign to route database, which is a guess until a message says otherwise" + : "From a received message"; + if (d.m_routeChecked) + { + tip += d.m_routeAgrees + ? " - the route database agrees" + : " - the route database says something different"; + } + lines.append(tip); + return lines.join("\n"); } return QVariant(); } @@ -355,7 +543,10 @@ QVariant FlightTableModel::data(const QModelIndex& index, int role) const switch (index.column()) { - case COL_FLIGHT: return d.m_flight; + // The ICAO callsign the transponder broadcasts, and the IATA number ACARS carries. + // One flight, two names - see AircraftTracker::flightNameForms() + case COL_FLIGHT: return d.m_callsign; + case COL_FLIGHT_NO: return d.m_flightNumber; case COL_REG: return d.m_reg; case COL_FROM: return d.m_departure; case COL_TO: return d.m_arrival; @@ -374,18 +565,33 @@ QVariant FlightTableModel::data(const QModelIndex& index, int role) const // crosses is as loud as a column of ticks, which makes the ticks - the thing worth // spotting - harder to pick out than an empty cell does. case COL_LS: return d.m_hasLoadsheet ? QString(QChar(0x2713)) : QString(); - case COL_OC: return d.m_hasClearance ? QString(QChar(0x2713)) : QString(); + case COL_CL: return d.m_hasClearance ? QString(QChar(0x2713)) : QString(); case COL_FP: return d.m_hasFlightPlan ? QString(QChar(0x2713)) : QString(); case COL_DOCS: return d.m_documents; // What THIS flight has been heard on. The aircraft table's column of the same // name is the airframe's, over every flight it has ever made. case COL_PROTOCOLS: return d.m_protocols; + // "Message" on its own where the database has never heard of the callsign, and with + // a verdict where it has + case COL_ROUTE_SOURCE: + if (d.m_routeSource.isEmpty() || !d.m_routeChecked) { + return d.m_routeSource; + } + return d.m_routeAgrees ? QString("Message =DB") : QString("Message <>DB"); default: return QVariant(); } } void FlightTableModel::upsert(const QList& flights) { + // New flights are collected and inserted in one go, as AircraftTableModel::upsert() + // does and for the same reason: a resync delivers every flight in the session at once, + // and a beginInsertRows per flight re-sorted both proxies and relaid out both views + // once per row. Indexed as they are collected, so a flight that appears twice in the + // batch updates the row it is about to get rather than getting two. + QList added; + QHash addedIndex; + for (const FlightDisplay& d : flights) { int row = m_rowById.value(d.m_id, -1); @@ -396,28 +602,50 @@ void FlightTableModel::upsert(const QList& flights) } else { - beginInsertRows(QModelIndex(), m_rows.size(), m_rows.size()); + const int pending = addedIndex.value(d.m_id, -1); + if (pending >= 0) + { + added[pending] = d; + } + else + { + addedIndex.insert(d.m_id, added.size()); + added.append(d); + } + } + } + + if (!added.isEmpty()) + { + beginInsertRows(QModelIndex(), m_rows.size(), m_rows.size() + added.size() - 1); + for (const FlightDisplay& d : added) + { m_rowById.insert(d.m_id, m_rows.size()); m_rows.append(d); - endInsertRows(); } + endInsertRows(); } } void FlightTableModel::remove(const QList& ids) { - for (quint64 id : ids) + // In contiguous runs and reindexed once - see AircraftTableModel::remove() + const QList rows = rowsDescending(m_rowById, ids, [this](quint64 id) { m_rowById.remove(id); }); + if (rows.isEmpty()) { + return; + } + for (int i = 0; i < rows.size(); ) { - int row = m_rowById.value(id, -1); - if (row >= 0) - { - beginRemoveRows(QModelIndex(), row, row); - m_rows.removeAt(row); - m_rowById.remove(id); - reindex(row); - endRemoveRows(); + const int last = rows[i]; + int first = last; + while ((++i < rows.size()) && (rows[i] == first - 1)) { + first--; } + beginRemoveRows(QModelIndex(), first, last); + m_rows.erase(m_rows.begin() + first, m_rows.begin() + last + 1); + endRemoveRows(); } + reindex(rows.last()); } void FlightTableModel::reindex(int from) @@ -439,3 +667,8 @@ const FlightDisplay *FlightTableModel::flightAt(int row) const { return ((row >= 0) && (row < m_rows.size())) ? &m_rows[row] : nullptr; } + +int FlightTableModel::rowOf(quint64 id) const +{ + return m_rowById.value(id, -1); +} diff --git a/plugins/feature/aircraft/aircrafttablemodels.h b/plugins/feature/aircraft/aircrafttablemodels.h index 2011d7448..fec73e352 100644 --- a/plugins/feature/aircraft/aircrafttablemodels.h +++ b/plugins/feature/aircraft/aircrafttablemodels.h @@ -124,6 +124,11 @@ public: COL_PROTOCOLS, COL_MESSAGES, COL_LAST_SEEN, + // Appended rather than placed beside the callsign where it belongs: the saved + // column widths and order are stored by index, so inserting in the middle would + // shift every one of them. Drag it where you want it. + COL_FLIGHT_NO, + COL_SELCAL, // Appended for the same reason COL_COUNT }; @@ -138,6 +143,9 @@ public: void remove(const QList& ids); void clear(); const AircraftDisplay *aircraftAt(int row) const; + const AircraftDisplay *aircraftById(quint64 id) const; + //!< The model row holding this aircraft, or -1 if it has none + int rowOf(quint64 id) const; private: struct Row { @@ -162,25 +170,33 @@ class FlightTableModel : public QAbstractTableModel Q_OBJECT public: + // In the order the table reads left to right: who and which aircraft, where it is + // going, what it has sent, when it did the four things a flight does, when it was + // heard, and last the two that are more diagnostic than operational. + // + // Columns used to be appended here rather than placed where they belonged, because + // the saved widths and order are stored BY INDEX and inserting one shifted them all. + // That is settled by moving the stored layout to its own settings keys, so a layout + // saved before this reorder falls back to the defaults - which are this order - once, + // rather than being applied to the wrong columns. enum Col { - COL_FLIGHT, + COL_FLIGHT, // Callsign, which is what the aircraft transmits + COL_FLIGHT_NO, // Flight number, which is what a passenger is sold COL_REG, COL_FROM, COL_TO, + COL_DOCS, + COL_LS, // Loadsheet + COL_CL, // Any clearance: oceanic, and cleared for departure + COL_FP, // Flight plan COL_OUT, // OOOI: off the gate COL_OFF, // airborne COL_ON, // landed COL_IN, // on the gate COL_FIRST_SEEN, COL_LAST_SEEN, - COL_LS, // Loadsheet - COL_OC, // Oceanic clearance - COL_FP, // Flight plan - COL_DOCS, - // Appended rather than placed beside Messages where it belongs: the saved - // column widths and order are stored by index, so inserting in the middle - // would shift every one of them. Drag it where you want it. COL_PROTOCOLS, + COL_ROUTE_SOURCE, // Where From and To came from COL_COUNT }; @@ -195,6 +211,8 @@ public: void remove(const QList& ids); void clear(); const FlightDisplay *flightAt(int row) const; + //!< The model row holding this flight, or -1 if it has none + int rowOf(quint64 id) const; private: QList m_rows; diff --git a/plugins/feature/aircraft/aircrafttracker.cpp b/plugins/feature/aircraft/aircrafttracker.cpp index 63e83d46f..d2ff40997 100644 --- a/plugins/feature/aircraft/aircrafttracker.cpp +++ b/plugins/feature/aircraft/aircrafttracker.cpp @@ -1,3621 +1,6066 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "SWGMapItem.h" -#include "SWGMapCoordinate.h" - -#include "feature/feature.h" -#include "maincore.h" -#include "util/units.h" - -#include "util/airlines.h" -#include "channel/channelwebapiutils.h" -#include "util/aircraft3dmodels.h" - -#include "aircrafttracker.h" - -MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgConfigureTracker, Message) -MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgReport, Message) - -AircraftTracker::MsgReport::~MsgReport() -{ - delete m_report.m_mapItem; -} -MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgDeleteAll, Message) -MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgResetStatistics, Message) -MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgResync, Message) -MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgWatchFlight, Message) - -AircraftTracker::AircraftTracker(Feature *feature) : - m_feature(feature) -{ - qRegisterMetaType("AircraftDisplay"); - qRegisterMetaType("FlightDisplay"); - qRegisterMetaType("DocumentEvent"); - qRegisterMetaType("AtcEvent"); - qRegisterMetaType>("QList"); - qRegisterMetaType>("QList"); - qRegisterMetaType>("QList"); - qRegisterMetaType>("QList"); - qRegisterMetaType("WeatherEvent"); - qRegisterMetaType>("QList"); - qRegisterMetaType>("QList"); - qRegisterMetaType>("QList"); - qRegisterMetaType>("QList"); - - for (int i = 0; i < CHART_COUNTS; i++) { - m_chartCounts[i] = 0; - } - - connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &AircraftTracker::handleInputMessages); -} - -AircraftTracker::~AircraftTracker() -{ - saveDatabase(); - closeDatabase(); - qDeleteAll(m_aircraft); -} - -// Runs on the tracker thread once it starts -void AircraftTracker::startWork() -{ - // As in the ADS-B tracker: get the shared 3D model tables built off the critical path - Aircraft3DModels::instance(); - - m_statistics.m_sessionStart = QDateTime::currentDateTime(); - m_statistics.m_session = AircraftStatistics::Scope(); - m_allTimeSince = m_statistics.m_sessionStart; - m_sessionHeard.clear(); - m_sessionRecorded.clear(); - - m_aircraftInfo = OsnDB::getAircraftInformationByReg(); - m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); - m_routeInfo = OsnDB::getAircraftRouteInformation(); - m_navAids = OpenAIP::getNavAids(); - m_airports = OurAirportsDB::getAirportsByIdent(); - m_waypoints = Waypoints::getWaypoints(); - - m_flushTimer = new QTimer(this); - connect(m_flushTimer, &QTimer::timeout, this, &AircraftTracker::flush); - m_flushTimer->start(300); - - m_removalTimer = new QTimer(this); - connect(m_removalTimer, &QTimer::timeout, this, &AircraftTracker::removeOldAircraft); - m_removalTimer->start(60*1000); - - m_chartTimer = new QTimer(this); - connect(m_chartTimer, &QTimer::timeout, this, &AircraftTracker::updateChartCounts); - m_chartTimer->start(10*1000); - m_chartRateTime = QDateTime::currentDateTime(); - - if (openDatabase()) - { - loadDatabase(); - // The all time aircraft count lives in the database, so it can only be read once - // that is open - which may be after the settings first arrived - m_statistics.m_allTime.m_distinctAircraft = seenCount(); - m_statisticsDirty = true; - } -} - -void AircraftTracker::handleInputMessages() -{ - Message* message; - while ((message = m_inputMessageQueue.pop())) - { - if (handleMessage(*message)) { - delete message; - } - } -} - -bool AircraftTracker::handleMessage(const Message& message) -{ - if (MsgReport::match(message)) - { - MsgReport& report = (MsgReport&) message; - processReport(report.getReport()); - return true; - } - else if (MsgConfigureTracker::match(message)) - { - const MsgConfigureTracker& cfg = (const MsgConfigureTracker&) message; - applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce()); - return true; - } - else if (MsgDeleteAll::match(message)) - { - deleteAll(); - return true; - } - else if (MsgResetStatistics::match(message)) - { - MsgResetStatistics& msg = (MsgResetStatistics&) message; - if (msg.getAllTime()) - { - m_statistics.m_allTime = AircraftStatistics::Scope(); - m_statistics.m_firstStart = QDateTime::currentDateTime(); - m_allTimeSecondsBase = 0; - m_allTimeSince = m_statistics.m_firstStart; - // Without this the aircraft count would come straight back, since it is - // counted from the table rather than held as a number - resetSeen(); - // Anything heard since the reset still belongs to the new all time figures, - // so let this session's airframes be counted again - m_sessionRecorded.clear(); - } - else - { - m_statistics.m_session = AircraftStatistics::Scope(); - m_statistics.m_sessionStart = QDateTime::currentDateTime(); - m_sessionHeard.clear(); - } - m_statisticsDirty = true; - return true; - } - else if (MsgResync::match(message)) - { - resync(); - return true; - } - else if (MsgWatchFlight::match(message)) - { - const MsgWatchFlight& watch = (const MsgWatchFlight&) message; - TrackedFlight *previous = flightById(m_watchedFlight); - m_watchedFlight = watch.getFlightId(); - TrackedFlight *flight = flightById(m_watchedFlight); - // The map draws the watched flight's track rather than the current one, so both - // the aircraft that is no longer watched and the one now watched need theirs sent - for (TrackedFlight *f : { previous, flight }) - { - if (f && f->m_aircraft) - { - f->m_aircraft->m_mapTrackChanged = true; - m_dirtyAircraft.insert(f->m_aircraft); - } - } - if (flight) { - emitProfile(flight); - } - return true; - } - return false; -} - -void AircraftTracker::applySettings(const AircraftSettings& settings, const QList& settingsKeys, bool force) -{ - bool atcLabelsChanged = settingsKeys.contains("atcLabels") && (settings.m_atcLabels != m_settings.m_atcLabels); - // The callsign style is part of the label too - atcLabel() writes the flight through - // flightLabel(), which is what turns BAW123 into SPEEDBIRD 123 - so switching it has - // to refresh the Map for exactly the same reason toggling the ATC button does - bool atcCallsignsChanged = settingsKeys.contains("atcCallsigns") - && (settings.m_atcCallsigns != m_settings.m_atcCallsigns); - bool liveryChanged = settingsKeys.contains("favourLivery") - && (settings.m_favourLivery != m_settings.m_favourLivery); - // The icon is part of the map item, so switching icon styles has to refresh the Map - // just like a label change does - bool liveryIconsChanged = settingsKeys.contains("useLiveryIcons") - && (settings.m_useLiveryIcons != m_settings.m_useLiveryIcons); - // A forced configuration replaces the settings wholesale and may carry no key list - // at all, which is how a preset arrives - and the database is opened in startWork() - // before that happens, on the default path. Comparing the values rather than trusting - // the key list is what lets a preset's own database be opened. - bool databaseChanged = (force || settingsKeys.contains("databaseFilename")) - && (settings.m_databaseFilename != m_settings.m_databaseFilename); - QString oldDatabasePath = databaseChanged ? databasePath(m_settings) : QString(); - - const bool statisticsArrived = settingsKeys.contains("statistics") || force; - // Which rule fired for an aircraft is remembered by its INDEX in the list, so - // editing the list silently changes what those indices mean: a new rule that lands - // on the index of one that has already fired would never fire itself. Compared by - // content rather than by the key list, because a forced configuration carries no - // keys at all, and re-firing every rule on an unchanged preset load would be its own - // bug - the aircraft would all announce themselves again. - const QString notificationsBefore = notificationSignature(m_settings); - if (force) { - m_settings = settings; - } else { - m_settings.applySettings(settingsKeys, settings); - } - if (notificationSignature(m_settings) != notificationsBefore) - { - for (TrackedAircraft *item : m_aircraft) { - item->m_notifiedRules.clear(); - } - } - - // The records come back from the preset the first time settings arrive. Reloading - // them later would undo anything set since - EXCEPT when the blob is empty, which is - // how the GUI asks for a reset. Without that exception "Reset records" did nothing - // after startup and the next update put the old values straight back. - const bool resetRequested = settingsKeys.contains("statistics") - && settings.m_statistics.isEmpty(); - // Wait for a blob with something in it. The GUI's constructor forces a configuration - // through with default settings BEFORE the framework calls deserialize(), so keying - // this on "the first settings to arrive" consumed the one chance to load on an empty - // blob, and the stored records were then never read - the all time figures started - // again from nothing on every launch. - const bool haveStored = !m_settings.m_statistics.isEmpty(); - if (statisticsArrived && ((!m_statisticsLoaded && haveStored) || resetRequested)) - { - m_statisticsLoaded = haveStored; - AircraftStatistics stored = deserializeStatistics(m_settings.m_statistics); - // Only the all time side is stored, so keep everything this session has counted - stored.m_session = m_statistics.m_session; - stored.m_sessionStart = m_statistics.m_sessionStart; - if (!stored.m_firstStart.isValid()) - { - // Nothing stored: either this is the first run, or a reset has just set the - // moment the all time figures start from, which must not be discarded here - stored.m_firstStart = m_statistics.m_firstStart.isValid() - ? m_statistics.m_firstStart : m_statistics.m_sessionStart; - } - m_allTimeSecondsBase = stored.m_allTime.m_seconds; - m_allTimeSince = (m_allTimeSecondsBase == 0) && m_statistics.m_firstStart.isValid() - ? m_statistics.m_firstStart : m_statistics.m_sessionStart; - // The aircraft count is the one figure the blob cannot hold - see the note on - // AircraftStatistics. It comes from the database, which may not be open yet on - // the first pass, in which case the next flush picks it up - stored.m_allTime.m_distinctAircraft = seenCount(); - m_statistics = stored; - m_statisticsDirty = true; - } - - if (databaseChanged) { - changeDatabase(oldDatabasePath); - } - - // Refresh the labels of aircraft already on the Map. Only active aircraft are on - // it, so archived ones must not be sent here - that would put the whole history - // back on the Map every time settings are applied. - // - // Pass-through aircraft are included, which flush() deliberately does NOT do. The - // reasoning that holds there does not hold here. flush() runs on every report, and - // a basic item built by this feature would keep replacing the richer one ADS-B is - // sending, so while ADS-B is talking it stands back. This is a one-off refresh after - // the user toggled a setting, and skipping pass-through aircraft on the assumption - // that "their next ADS-B report will relabel them" is only true for aircraft ADS-B - // is STILL hearing. One that went quiet a few seconds ago gets skipped here and - // never receives another report, so its label stayed stale indefinitely - which is - // exactly the reported symptom of only some labels changing. - // - // The cost is small and self-correcting: an aircraft ADS-B is actively sending gets - // a plainer popup for one update, restored on its next report a fraction of a second - // later. The icon, the heading and the 3D model are all preserved, because - // sendToMap() re-sends the model remembered from the pass-through. - // Choosing again is only meaningful for models we picked ourselves; a pass-through - // model belongs to the demodulator, which will send its own next report anyway - if (liveryChanged) - { - for (TrackedAircraft *item : m_aircraft) - { - if (item->m_modelIsOurs) - { - item->m_model3D = ""; - item->m_modelIsOurs = false; - update3DModel(item); - } - } - } - - if (atcLabelsChanged || atcCallsignsChanged || liveryChanged || liveryIconsChanged || force) - { - for (TrackedAircraft *item : m_aircraft) - { - if (item->m_active && item->m_positionValid) { - sendToMap(item); - } - } - } -} - -QString AircraftTracker::regFor(const TrackedAircraft *item) const -{ - return !item->m_registration.isEmpty() ? item->m_registration - : (item->m_icao ? QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper() : QString()); -} - -// Identity keys are namespaced so an ICAO hex string can never collide with a -// registration or a flight number -static QString icaoKey(quint32 icao) { return QString("I%1").arg(icao, 6, 16, QChar('0')); } -static QString regKey(const QString& reg) { return "R" + reg; } -static QString flightKey(const QString& flight) { return "F" + flight; } - -// Give an identity to this aircraft, folding in any other record that already held it. -// A registration and an ICAO address each belong to exactly one airframe, so two records -// answering to the same one ARE the same airframe - an ACARS registration-only record and -// an ADS-B ICAO-only record, tied together the moment a message carries both. The key was -// simply re-pointed at the survivor before, leaving the other record in the list holding -// its flights, documents and messages, and unreachable by any key. -// -// Deliberately not used for a flight number, which is not an identity: it is reused day -// after day and by different airframes, and the caller has its own narrower rule for it. -void AircraftTracker::claimKey(TrackedAircraft *item, const QString& key) -{ - TrackedAircraft *other = m_byKey.value(key); - if (other && (other != item)) { - absorbAircraft(item, other); - } - m_byKey.insert(key, item); - // The identity has just strengthened, so what it is recognised by in the all time - // table may have changed with it - see recordSeen() - m_sessionRecorded.remove(item->m_id); -} - -// A flight key stays registered for as long as the aircraft does, so asking when the -// AIRCRAFT was last heard says nothing about the callsign: an airframe heard a minute ago -// under today's callsign would keep every historical one it has ever flown looking just -// as fresh, and claim a report belonging to whoever is flying that number now. -QDateTime AircraftTracker::flightLastSeen(const TrackedAircraft *item, const QString& flight) -{ - QDateTime when; - for (const TrackedFlight *f : item->m_flights) - { - if (!flightMatches(f, flight) || !f->m_lastSeen.isValid()) { - continue; - } - if (!when.isValid() || (f->m_lastSeen > when)) { - when = f->m_lastSeen; - } - } - return when; -} - -// Two flights of one airframe are the same operation when their times overlap, or when -// the gap between them is short enough that the aircraft never went away. The archive -// timeout is that boundary at run time - a gap longer than it starts a new flight - and -// using it here as well is what keeps a reload from rejoining what a session split. -bool AircraftTracker::sameOperation(const TrackedFlight *a, const TrackedFlight *b) const -{ - if (!a->m_firstSeen.isValid() || !a->m_lastSeen.isValid() - || !b->m_firstSeen.isValid() || !b->m_lastSeen.isValid()) - { - return true; // Nothing to separate them by, so behave as before - } - if ((a->m_firstSeen <= b->m_lastSeen) && (b->m_firstSeen <= a->m_lastSeen)) { - return true; // Overlapping - } - const qint64 gap = (a->m_lastSeen < b->m_firstSeen) - ? a->m_lastSeen.secsTo(b->m_firstSeen) : b->m_lastSeen.secsTo(a->m_firstSeen); - return gap <= (qint64) m_settings.m_removalMins * 60; -} - -AircraftTracker::TrackedAircraft *AircraftTracker::findOrCreateAircraft(const AircraftReport& report) -{ - TrackedAircraft *item = nullptr; - - // Strongest identity first - if (report.m_icao && m_byKey.contains(icaoKey(report.m_icao))) { - item = m_byKey.value(icaoKey(report.m_icao)); - } else if (!report.m_registration.isEmpty() && m_byKey.contains(regKey(report.m_registration))) { - item = m_byKey.value(regKey(report.m_registration)); - } - - // A flight number is NOT an identity - it is reused, day after day and by different - // airframes. Matching on one is only safe when the report offers nothing better: - // an unseen ICAO address arriving on a historical flight number would otherwise be - // folded in to the aircraft that flew it last, and then ignored, because the code - // below only adopts an identity the item does not already have. - // - // Even with nothing stronger it has to be recent. The key lives as long as the - // aircraft does, so without this a flight number seen days ago still claims today's. - if (!item && !report.m_flight.isEmpty() - && (report.m_icao == 0) && report.m_registration.isEmpty() - && m_byKey.contains(flightKey(report.m_flight))) - { - TrackedAircraft *candidate = m_byKey.value(flightKey(report.m_flight)); - const QDateTime when = report.m_received.isValid() ? report.m_received - : QDateTime::currentDateTime(); - // How recently this aircraft flew THIS callsign, not how recently it was heard. - // - // Bounded at both ends: secsTo() runs negative when the report is OLDER than what - // was last heard, and a negative number is less than any window - so a delayed - // report claiming a callsign since taken up by another airframe was matched to - // that airframe rather than rejected. - const QDateTime flownAt = flightLastSeen(candidate, report.m_flight); - const qint64 age = flownAt.secsTo(when); - if (flownAt.isValid() && (age >= 0) && (age < m_flightKeyValidSecs)) { - item = candidate; - } - } - - if (!item) - { - item = new TrackedAircraft(); - item->m_id = m_nextId++; - m_aircraft.append(item); - } - - // Adopt any stronger identities the report carries and register their keys - if (report.m_icao && (item->m_icao == 0)) - { - item->m_icao = report.m_icao; - claimKey(item, icaoKey(report.m_icao)); - } - if (!report.m_registration.isEmpty() && item->m_registration.isEmpty()) - { - item->m_registration = report.m_registration; - claimKey(item, regKey(report.m_registration)); - } - if (!report.m_flight.isEmpty()) - { - // If the flight key belongs to a weaker entry created before this - // airframe was identified, fold it in rather than orphaning it - but only when - // that entry was flying this callsign at about the same time. A callsign is - // flown again day after day, so an unbounded match folded a flight-only record - // of somebody else's operation into this airframe. - TrackedAircraft *other = m_byKey.value(flightKey(report.m_flight)); - if (other && (other != item) && (other->m_icao == 0) && other->m_registration.isEmpty()) - { - const QDateTime flownAt = flightLastSeen(other, report.m_flight); - const QDateTime when = report.m_received.isValid() ? report.m_received - : QDateTime::currentDateTime(); - const qint64 age = flownAt.isValid() ? flownAt.secsTo(when) : -1; - if (flownAt.isValid() && (age >= 0) && (age < m_flightKeyValidSecs)) { - absorbAircraft(item, other); - } - } - item->m_flight = report.m_flight; - m_byKey.insert(flightKey(report.m_flight), item); - } - - // Cross reference registration and ICAO through the OpenSky database - if (item->m_icao && item->m_registration.isEmpty() - && m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) item->m_icao)) - { - item->m_registration = m_aircraftInfoByIcao->value((int) item->m_icao)->m_registration; - if (!item->m_registration.isEmpty()) { - claimKey(item, regKey(item->m_registration)); - } - } - if ((item->m_icao == 0) && !item->m_registration.isEmpty() - && m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) - { - item->m_icao = (quint32) m_aircraftInfo->value(item->m_registration)->m_icao; - if (item->m_icao) { - claimKey(item, icaoKey(item->m_icao)); - } - } - - return item; -} - -// A location in a link management frame is a coarse handoff hint rather than a fix, so -// it is trusted least. Everything else that isn't ADS-B is a real position report -// A link management frame's altitude is both coarse and, on some aircraft, wrong - so -// it is only believed when nothing better has been heard lately, and never sets a record -int AircraftTracker::altitudeRank(const AircraftReport& report) -{ - if (report.m_protocol == AircraftReport::ADSB) { - return AltitudeAdsb; - } - if (report.m_documentKind == AircraftReport::Logon) { - return AltitudeCoarse; - } - return AltitudeReported; -} - -int AircraftTracker::positionRank(const AircraftReport& report) -{ - if (report.m_protocol == AircraftReport::ADSB) { - return PositionAdsb; - } - if (report.m_documentKind == AircraftReport::Logon) { - return PositionCoarse; - } - - return PositionReported; -} - -void AircraftTracker::processReport(AircraftReport& report) -{ - TrackedAircraft *item = findOrCreateAircraft(report); - - // Receiving data makes it active, which puts it in the active tables and on the map - setActive(item, true); - - // The LATEST report, not the last one to arrive. A replayed or delayed report can - // be hours old, and assigning it made a currently active aircraft look stale - at - // which point the removal timer archived it and took it off the Map. - if (report.m_received.isValid() - && (!item->m_lastSeen.isValid() || (report.m_received > item->m_lastSeen))) { - item->m_lastSeen = report.m_received; - } - item->m_messages++; - item->m_sources[qMakePair((int) report.m_protocol, report.m_frequency)]++; - - if (!report.m_documentText.isEmpty()) { - item->m_lastDocumentText = report.m_documentText; - } - - // For the message rate chart: one series per protocol then a total - if ((report.m_protocol >= 0) && (report.m_protocol < AircraftReport::ProtocolCount)) { - m_chartCounts[report.m_protocol]++; - } - m_chartCounts[AircraftReport::ProtocolCount]++; - - // Track the flight this report belongs to (route facts are collated there), - // and collect notable documents and ATC messages. The aircraft shows the - // flight's primary name, so it doesn't flap between the ACARS flight number - // and the ADS-B callsign forms. - TrackedFlight *flight = updateFlight(item, report); - // The same tally as the airframe's, but only for the flight it is on now - if (flight) { - flight->m_sources[qMakePair((int) report.m_protocol, report.m_frequency)]++; - } - if (flight) { - flight->m_messages++; - } - if (!flight->m_flight.isEmpty()) { - item->m_flight = flight->m_flight; - } - addDocument(item, flight, report); - addAtcMessage(item, flight, report); - addWeatherReport(item, report); - - checkNotifications(item, report); - - // Altitude is measured separately from position - on ADS-B by a different message - // entirely - so it is taken in on its own account. It used to be updated only - // alongside a position that had passed the ranking and plausibility checks, which - // meant a distant aircraft whose position was rejected lost its altitude with it, - // and a protocol that reports altitude without a position never set one at all. - // Whether THIS report's altitude is one worth recording - see altitudeRank() - bool reportAltitudeValid = false; - float reportAltitudeFt = 0.0f; - - if (report.m_altitudeValid) - { - // Not if we already hold a later observation - a stored record from a log dump - // arrives long after the altitude it describes - const bool stale = report.m_altitudeDateTime.isValid() - && item->m_altitudeDateTime.isValid() - && (report.m_altitudeDateTime < item->m_altitudeDateTime); - - const int altRank = altitudeRank(report); - // When each source was last heard, so it has to move forward only. A replayed or - // delayed report carries an older reception time, and writing it here made live - // ADS-B look as though it had gone quiet - at which point the coarser sources - // below were let through to replace an altitude that was perfectly good. - if (report.m_received.isValid() - && (!item->m_altitudeRankTimes[altRank].isValid() - || (report.m_received > item->m_altitudeRankTimes[altRank]))) { - item->m_altitudeRankTimes[altRank] = report.m_received; - } - - // Only fall back to a coarser source once the better ones have gone quiet, as - // positions already do. Without this a single bad XID octet replaced a good - // ADS-B altitude until the next ADS-B message arrived. - bool altSuperseded = false; - for (int better = 0; better < altRank; better++) - { - if (item->m_altitudeRankTimes[better].isValid() - && (item->m_altitudeRankTimes[better].secsTo(report.m_received) < m_positionRankTimeoutSecs)) { - altSuperseded = true; - } - } - - // The records take the altitude THIS report carried, and never a coarse one: - // an aircraft heard only on link management frames is better left without a - // highest-altitude record than given a wrong one, because a record is never - // corrected afterwards - reportAltitudeValid = (altRank != AltitudeCoarse); - reportAltitudeFt = report.m_altitudeFt; - - if (!stale && !altSuperseded) - { - // The one before it is kept as well, so a position timestamped between the - // two can have its altitude worked out rather than guessed - see altitudeAt() - if (report.m_altitudeDateTime.isValid() && item->m_altitudeDateTime.isValid() - && (report.m_altitudeDateTime > item->m_altitudeDateTime)) - { - item->m_prevAltitudeFt = item->m_altitudeFt; - item->m_prevAltitudeDateTime = item->m_altitudeDateTime; - } - item->m_altitudeFt = report.m_altitudeFt; - item->m_altitudeValid = true; - if (report.m_altitudeDateTime.isValid()) { - item->m_altitudeDateTime = report.m_altitudeDateTime; - } - } - } - - // Whether THIS report supplied the position we are now holding - see updateStatistics() - bool positionAccepted = false; - // How far away the position THIS report carried is, whether or not it was adopted - bool reportRangeValid = false; - float reportRangeKm = 0.0f; - - // Exactly 0N 0E is a zeroed-out field, not a position off the coast of Africa - bool positionValid = report.m_positionValid - && ((report.m_latitude != 0.0f) || (report.m_longitude != 0.0f)); - - if (positionValid) - { - // A report timestamped before the position we are already holding is a report - // of where the aircraft USED to be - a stored record from a log dump (seen with - // HFDL performance data), or simply out of order. Adopting one rewound the - // coordinates while the timestamp stayed where it was, so the two then described - // different moments, and appended a point to the track out of time order. - // - // The one exception is a held position that has itself gone stale: it is on its - // way off the Map, so an older fix is still an improvement on it. That exception - // is needed because the protocols timestamp differently - ADS-B stamps when we - // received the frame, an ACARS position report when the aircraft measured it, so - // an ACARS fix routinely looks minutes old the moment it arrives. Without it, an - // aircraft that had just left ADS-B coverage would refuse its own oceanic - // positions until their clock caught up with the last ADS-B one. - QDateTime posTime = report.m_positionDateTime.isValid() ? report.m_positionDateTime : report.m_received; - bool current = !item->m_positionDateTime.isValid() - || (item->m_positionDateTime.secsTo(posTime) >= 0) - || positionStale(item, report.m_received); - - const QGeoCoordinate reported(report.m_latitude, report.m_longitude); - const int rank = positionRank(report); - - // Only fall back to a less accurate source once the better ones have gone quiet - bool superseded = false; - for (int better = 0; better < rank; better++) - { - if (item->m_positionRankTimes[better].isValid() - && (item->m_positionRankTimes[better].secsTo(report.m_received) < m_positionRankTimeoutSecs)) { - superseded = true; - } - } - - // A position the aircraft could not have flown to since the last one is a report - // of where it used to be, or a bad decode - not where it is now. The tolerance - // covers the resolution of the position and any slop in the times - // A better source is always allowed to correct a worse one - otherwise a coarse - // position 11 km out could reject the ADS-B fix that would have put it right - bool plausible = true; - if (item->m_positionValid && item->m_positionDateTime.isValid() && (rank >= item->m_positionRank)) - { - const double km = QGeoCoordinate(item->m_latitude, item->m_longitude).distanceTo(reported) / 1000.0; - const double hours = std::abs((double) item->m_positionDateTime.secsTo(posTime)) / 3600.0; - plausible = km <= (m_maxGroundSpeedKn * 1.852 * hours) + m_positionToleranceKm; - } - - // The range record for a protocol asks how far away the aircraft was when we heard - // it on that protocol, so it uses the position THIS report carried - not the one we - // end up holding, which may have come from a better source. Gating it on the - // position being ADOPTED was wrong: an aircraft inside ADS-B coverage has every - // ACARS, VDL-2 and Aero position superseded within the rank timeout, so those - // protocols could never record a range at all however far away they heard it. A - // report carrying no position still measures nothing, which is what stopped - // ADS-B distances being credited to HFDL. - // - // Checked against the position we are holding whatever its rank - unlike the - // tracked position, a range record is never corrected later, so a bad decode - // would leave a wrong figure in it for ever. - bool rangePlausible = true; - if (item->m_positionValid && item->m_positionDateTime.isValid()) - { - const double km = QGeoCoordinate(item->m_latitude, item->m_longitude).distanceTo(reported) / 1000.0; - const double hours = std::abs((double) item->m_positionDateTime.secsTo(posTime)) / 3600.0; - rangePlausible = km <= (m_maxGroundSpeedKn * 1.852 * hours) + m_positionToleranceKm; - } - if (rangePlausible) - { - // Distance from the antenna that heard this report, not from "here" - a - // remote SDR is somewhere else entirely, and a range figure measured from - // the wrong end is worse than none - const QGeoCoordinate receiver = receiverPosition(report.m_deviceSetIndex); - if (receiver.isValid()) - { - reportRangeKm = (float) (receiver.distanceTo(reported) / 1000.0); - reportRangeValid = true; - } - } - - if (current && !superseded && plausible) - { - positionAccepted = true; - item->m_positionRankTimes[rank] = report.m_received; - item->m_positionRank = rank; - item->m_positionValid = true; - item->m_latitude = report.m_latitude; - item->m_longitude = report.m_longitude; - if (reportRangeValid) - { - item->m_distanceKm = reportRangeKm; - item->m_distanceValid = true; - } - // The position and the moment it describes always come from the same - // report. Keeping the newer of the two timestamps while taking an older - // report's coordinates is what made the pair disagree. - item->m_positionDateTime = posTime; - - // Accumulate the full track - it survives gaps between protocols - // The altitude that belongs with this fix is the altitude AT posTime, which - // on ADS-B is not the newest one received - see altitudeAt() - const float trackAltFt = report.m_altitudeValid - ? altitudeAt(item, posTime, report.m_altitudeFt) : 0.0f; - QGeoCoordinate coordinate(report.m_latitude, report.m_longitude, - report.m_altitudeValid ? Units::feetToMetres(trackAltFt) : 0.0f); - // Every reported position is kept. There is deliberately no distance - // threshold: a transponder reports at its own rate whatever the aircraft is - // doing, so a distance guard only ever discards points from SLOW aircraft - - // taxiing, on approach - which is precisely where the track needs detail, - // while doing nothing at all about a fast one. The only thing worth dropping - // is a position identical to the one before it, which carries nothing. - // Position only. An altitude report does not move the aircraft, and it - // arrives carrying the position and timestamp of the LAST position report, - // so appending on any change of altitude filled the track with points at a - // repeated place and time. The altitude recorded against a track point is - // the altitude when that position was reported, which is what it should be. - // ... and in time order. An older fix is adopted only when the position - // being held has gone stale, but appending it after a newer point would - // leave the track's times running backwards - and the Map's smoother divides - // by the difference between consecutive times, so a negative one gives inf - // and then nan, exactly as two identical times do. - const bool inOrder = flight && (flight->m_trackTimes.isEmpty() - || (posTime >= flight->m_trackTimes.last())); - const bool moved = inOrder && (flight->m_track.isEmpty() - || (flight->m_track.last().latitude() != coordinate.latitude()) - || (flight->m_track.last().longitude() != coordinate.longitude())); - if (moved) - { - // Heading along the track when the report has none - if (!flight->m_track.isEmpty()) - { - float trackHeading = (float) flight->m_track.last().azimuthTo(coordinate); - if (!report.m_headingValid) - { - item->m_heading = trackHeading; - item->m_headingValid = true; - item->m_headingDateTime = posTime; - } - } - flight->m_track.append(coordinate); - flight->m_trackTimes.append(posTime); - item->m_mapTrackChanged = true; - - } - } - } - // Both only move forward, as the position, the altitude and the last seen time do: - // a delayed report describes what the aircraft was doing then, not now - const QDateTime observed = report.m_received.isValid() ? report.m_received - : QDateTime::currentDateTime(); - if (report.m_headingValid - && (!item->m_headingDateTime.isValid() || (observed >= item->m_headingDateTime))) - { - item->m_heading = report.m_heading; - item->m_headingValid = true; - item->m_headingDateTime = observed; - } - if (report.m_speedValid - && (!item->m_speedDateTime.isValid() || (observed >= item->m_speedDateTime))) - { - item->m_speedKts = report.m_speedKts; - item->m_speedValid = true; - item->m_speedDateTime = observed; - } - - // The GUI and basic map item are updated from the flush timer - update3DModel(item); - updateStatistics(report, item, reportRangeValid, reportRangeKm, - reportAltitudeValid, reportAltitudeFt); - m_dbDirty = true; - m_dirtyAircraft.insert(item); - - if (report.m_mapItem) - { - // ADS-B pass-through goes straight out - the item carries this - // report's aircraft state for the Map's PFD - forwardMapItem(item, report.m_mapItem); - report.m_mapItem = nullptr; // Ownership transferred - item->m_lastMapItemTime = report.m_received; - } -} - -// Flush batched GUI notifications and basic map updates -void AircraftTracker::flush() -{ - if (!m_dirtyAircraft.isEmpty()) - { - const QDateTime now = QDateTime::currentDateTime(); - QList displays; - for (TrackedAircraft *item : m_dirtyAircraft) - { - displays.append(displayFor(item)); - - // While pass-through items are flowing, a basic item built here - // would replace the rich one, so only send when ADS-B is quiet. - // Only aircraft we are currently hearing are drawn. - bool passThroughActive = item->m_lastMapItemTime.isValid() - && (item->m_lastMapItemTime.secsTo(now) < 60); - if (item->m_active && item->m_positionValid && !passThroughActive) - { - sendToMap(item); - item->m_mapResync = false; - m_mapResyncPending.remove(item); - } - } - m_dirtyAircraft.clear(); - emit aircraftUpdated(displays); - } - - // Aircraft a Map that has just opened is still owed. They were not sendable when - // they were last looked at - typically their ADS-B pass-through had been quiet for - // less than a minute, so a basic item would have replaced a richer one - and the - // dirty set they came from is emptied every pass, so without a queue of their own a - // quiet aircraft would simply never reach that Map. - if (!m_mapResyncPending.isEmpty()) - { - const QDateTime now = QDateTime::currentDateTime(); - const QSet owed = m_mapResyncPending; - for (TrackedAircraft *item : owed) - { - const bool passThroughActive = item->m_lastMapItemTime.isValid() - && (item->m_lastMapItemTime.secsTo(now) < 60); - if (!item->m_active) - { - m_mapResyncPending.remove(item); // Archived, so not on any Map - } - else if (item->m_positionValid && !passThroughActive) - { - sendToMap(item); - item->m_mapResync = false; - m_mapResyncPending.remove(item); - } - } - } - - // After the aircraft loop above has emptied m_dirtyAircraft, so the aircraft it marks - // dirty go out on the next flush rather than being cleared unsent. The routes and the - // record marker below are re-sent within this one. - checkMapConsumers(); - - // Both cheap unless something they depend on has changed - updateRecordMapItem(); - retryRoutes(); - - // The concurrent count has to be recomputed on a timer rather than only when a report - // arrives: aircraft leaving the window lower it, and nothing signals that. - const QDateTime stamp = QDateTime::currentDateTime(); - updateConcurrent(stamp); - - // Both elapsed figures advance whether or not anything is being received, so nudge - // the display once a minute rather than leaving the clocks frozen on a quiet band - if (m_statistics.m_sessionStart.isValid()) - { - const qint64 minute = m_statistics.m_sessionStart.secsTo(stamp) / 60; - if (minute != m_statisticsMinute) - { - m_statisticsMinute = minute; - m_statisticsDirty = true; - } - } - - if (m_statisticsDirty) - { - m_statisticsDirty = false; - if (m_statistics.m_sessionStart.isValid()) - { - m_statistics.m_session.m_seconds = m_statistics.m_sessionStart.secsTo(stamp); - m_statistics.m_allTime.m_seconds = m_allTimeSecondsBase - + (m_allTimeSince.isValid() ? m_allTimeSince.secsTo(stamp) - : m_statistics.m_session.m_seconds); - } - emit statisticsUpdated(m_statistics); - } - - if (!m_dirtyFlights.isEmpty()) - { - QList displays; - bool watchedDirty = false; - for (TrackedFlight *flight : m_dirtyFlights) - { - displays.append(displayFor(flight)); - watchedDirty = watchedDirty || (flight->m_id == m_watchedFlight); - } - m_dirtyFlights.clear(); - emit flightsUpdated(displays); - if (watchedDirty) - { - TrackedFlight *flight = flightById(m_watchedFlight); - if (flight) { - emitProfile(flight); - } - } - } - - if (!m_pendingDocuments.isEmpty()) - { - emit documentsAdded(m_pendingDocuments); - m_pendingDocuments.clear(); - } - if (!m_pendingAtc.isEmpty()) - { - emit atcMessages(m_pendingAtc); - m_pendingAtc.clear(); - } - if (!m_pendingWeather.isEmpty()) - { - emit weatherReports(m_pendingWeather); - m_pendingWeather.clear(); - } -} - -void AircraftTracker::updateChartCounts() -{ - const QDateTime now = QDateTime::currentDateTime(); - const qint64 elapsedMS = m_chartRateTime.msecsTo(now); - if (elapsedMS <= 0) { - return; - } - QList rates; - for (int i = 0; i < CHART_COUNTS; i++) - { - rates.append(m_chartCounts[i] / (elapsedMS / 1000.0f)); - m_chartCounts[i] = 0; - } - m_chartRateTime = now; - emit messageRates(rates); -} - -AircraftDisplay AircraftTracker::displayFor(const TrackedAircraft *item) const -{ - AircraftDisplay d; - d.m_id = item->m_id; - d.m_icao = item->m_icao; - d.m_registration = item->m_registration; - d.m_flight = item->m_flight; - d.m_positionValid = item->m_positionValid; - d.m_distanceValid = item->m_distanceValid; - d.m_distanceKm = item->m_distanceKm; - d.m_latitude = item->m_latitude; - d.m_longitude = item->m_longitude; - d.m_altitudeValid = item->m_altitudeValid; - d.m_altitudeFt = item->m_altitudeFt; - d.m_headingValid = item->m_headingValid; - d.m_heading = item->m_heading; - d.m_speedValid = item->m_speedValid; - d.m_speedKts = item->m_speedKts; - d.m_protocols = sourcesText(item->m_sources); - d.m_messages = item->m_messages; - d.m_lastSeen = item->m_lastSeen; - d.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; - d.m_currentFlightId = item->m_currentFlight ? item->m_currentFlight->m_id : 0; - d.m_active = item->m_active; - return d; -} - -FlightDisplay AircraftTracker::displayFor(const TrackedFlight *flight) const -{ - FlightDisplay d; - d.m_id = flight->m_id; - d.m_aircraftId = flight->m_aircraft->m_id; - d.m_flight = flight->m_flight; - d.m_aliases = flight->m_aliases.join(", "); - d.m_reg = regFor(flight->m_aircraft); - d.m_departure = flight->m_departure; - d.m_arrival = flight->m_arrival; - d.m_route = flight->m_route; - d.m_firstSeen = flight->m_firstSeen; - d.m_lastSeen = flight->m_lastSeen; - d.m_documents = flight->m_documents.size(); - d.m_messages = flight->m_messages; - d.m_protocols = sourcesText(flight->m_sources); - d.m_out = flight->m_out; - d.m_off = flight->m_off; - d.m_on = flight->m_on; - d.m_in = flight->m_in; - for (const TrackedDocument *doc : flight->m_documents) - { - switch (doc->m_kind) - { - case AircraftReport::Loadsheet: d.m_hasLoadsheet = true; break; - case AircraftReport::Clearance: d.m_hasClearance = true; break; - case AircraftReport::FlightPlan: d.m_hasFlightPlan = true; break; - default: break; - } - } - // Only the flight an active aircraft is currently flying counts as active - d.m_active = flight->m_aircraft->m_active && (flight->m_aircraft->m_currentFlight == flight); - return d; -} - -DocumentEvent AircraftTracker::documentEvent(const TrackedAircraft *item, const TrackedFlight *flight, const TrackedDocument *doc) const -{ - DocumentEvent e; - e.m_aircraftId = item->m_id; - e.m_flightId = flight->m_id; - e.m_received = doc->m_received; - e.m_flight = flight->m_flight; - e.m_reg = regFor(item); - e.m_kind = documentKindName(doc->m_kind); - e.m_title = doc->m_title; - e.m_text = doc->m_text; - e.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; - return e; -} - -AircraftTracker::TrackedFlight *AircraftTracker::flightById(quint64 id) const -{ - if (id == 0) { - return nullptr; - } - for (TrackedAircraft *item : m_aircraft) - { - for (TrackedFlight *flight : item->m_flights) - { - if (flight->m_id == id) { - return flight; - } - } - } - return nullptr; -} - -void AircraftTracker::emitProfile(const TrackedFlight *flight) -{ - emit profileUpdated(flight->m_id, flight->m_profileTimes, flight->m_profileAltFt, flight->m_profileSpeedKts); -} - -// Resend the complete state - the GUI has just connected -void AircraftTracker::resync() -{ - emit allCleared(); - - QList aircraft; - QList flights; - QList documents; - for (TrackedAircraft *item : m_aircraft) - { - aircraft.append(displayFor(item)); - for (TrackedFlight *flight : item->m_flights) - { - flights.append(displayFor(flight)); - for (TrackedDocument *doc : flight->m_documents) { - documents.append(documentEvent(item, flight, doc)); - } - } - } - std::sort(documents.begin(), documents.end(), - [](const DocumentEvent& a, const DocumentEvent& b) { return a.m_received < b.m_received; }); - - if (!aircraft.isEmpty()) { - emit aircraftUpdated(aircraft); - } - if (!flights.isEmpty()) { - emit flightsUpdated(flights); - } - if (!documents.isEmpty()) { - emit documentsAdded(documents); - } - if (!m_atcLog.isEmpty()) { - emit atcMessages(m_atcLog); - } - if (!m_weatherLog.isEmpty()) { - emit weatherReports(m_weatherLog); - } -} - -void AircraftTracker::deleteAll() -{ - for (TrackedAircraft *item : m_aircraft) - { - if (!item->m_mapName.isEmpty()) { - removeFromMap(item->m_mapName); - } - // The routes as well as the aircraft. They are named after the flight rather than - // the airframe, so removing the aircraft leaves the lines and their waypoint - // markers behind - and a moment later the flights holding the only record of what - // those items are called are deleted, so nothing can ever take them off. - for (TrackedFlight *flight : item->m_flights) - { - removeDrawnRoute(flight->m_flightPlan); - removeDrawnRoute(flight->m_clearance); - } - } - qDeleteAll(m_aircraft); - m_aircraft.clear(); - m_byKey.clear(); - m_atcLog.clear(); - m_dirtyAircraft.clear(); - m_mapResyncPending.clear(); - m_dirtyFlights.clear(); - m_pendingDocuments.clear(); - m_pendingAtc.clear(); - // The weather log is keyed on airports rather than aircraft, so it is easy to - // forget here - but the GUI clears its rows on allCleared(), and leaving the log - // behind put every report straight back on the next resync. Worse, the dedupe index - // survived too, so a report that arrived again after the clear was recognised as - // one already held and never re-emitted at all. - m_pendingWeather.clear(); - m_weatherLog.clear(); - m_weatherIndex.clear(); - m_routesPending.clear(); - m_watchedFlight = 0; - forgetSavedTracks(); - m_dbDirty = true; - emit allCleared(); -} - -// Aircraft we have stopped hearing from are not discarded - they move to the archive -// tables and come off the map, so the session's history stays available -void AircraftTracker::removeOldAircraft() -{ - QDateTime currentDateTime = QDateTime::currentDateTime(); - - // The aircraft database may have been downloaded since we last looked - m_aircraftInfo = OsnDB::getAircraftInformationByReg(); - m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); - m_routeInfo = OsnDB::getAircraftRouteInformation(); - - // The timer that drives this also drives the periodic session save - if (m_db && !m_loadingDatabase) { - saveDatabase(); - } - - for (TrackedAircraft *item : m_aircraft) - { - if (item->m_active - && item->m_lastSeen.isValid() - && (item->m_lastSeen.secsTo(currentDateTime) > m_settings.m_removalMins * 60)) - { - setActive(item, false); - continue; - } - - // A stale position comes off the Map while the aircraft stays in the tables. - // The 3D map drops the entity on its own when the availability interval ends, - // but nothing takes it off the 2D map, so it would sit at its last known - // position until the aircraft was archived - three hours later by default. - if (item->m_active && !item->m_mapName.isEmpty() - && positionStale(item, currentDateTime)) - { - removeFromMap(item->m_mapName); - item->m_mapName = ""; // Re-sent in full if a fresh position arrives - item->m_mapTrackChanged = true; - } - } - - discardOldAircraft(); -} - -// Archived aircraft are kept for a while so their history is still there, but not for -// ever - the session database is rewritten in full on every save, so it has to be -// bounded. A retention of zero means the user wants to keep everything. -void AircraftTracker::discardOldAircraft() -{ - if (m_settings.m_retentionDays <= 0) { - return; - } - - const QDateTime cutoff = QDateTime::currentDateTime().addDays(-m_settings.m_retentionDays); - QList discardedAircraft; - QList discardedFlights; - - for (int i = m_aircraft.size() - 1; i >= 0; i--) - { - TrackedAircraft *item = m_aircraft[i]; - - if (item->m_active || !item->m_lastSeen.isValid() || (item->m_lastSeen >= cutoff)) { - continue; - } - - discardedAircraft.append(item->m_id); - for (TrackedFlight *flight : item->m_flights) - { - discardedFlights.append(flight->m_id); - m_flightsToDelete.insert(flight->m_id); - m_dirtyFlights.remove(flight); - if (m_watchedFlight == flight->m_id) { - m_watchedFlight = 0; - } - } - for (const QString& key : m_byKey.keys(item)) { - m_byKey.remove(key); - } - m_dirtyAircraft.remove(item); - m_mapResyncPending.remove(item); - m_aircraft.removeAt(i); - delete item; - m_dbDirty = true; - } - - if (!discardedFlights.isEmpty()) { - emit flightsRemoved(discardedFlights); - } - if (!discardedAircraft.isEmpty()) - { - qDebug() << "AircraftTracker::discardOldAircraft: discarded" << discardedAircraft.size() - << "aircraft not heard for" << m_settings.m_retentionDays << "days"; - emit aircraftRemoved(discardedAircraft); - } -} - -// Moving an aircraft between the active and archive tables -void AircraftTracker::setActive(TrackedAircraft *item, bool active) -{ - if (item->m_active == active) { - return; - } - - item->m_active = active; - - if (!active && !item->m_mapName.isEmpty()) - { - removeFromMap(item->m_mapName); - item->m_mapTrackChanged = true; // The whole track is resent if it returns - } - - m_dirtyAircraft.insert(item); - for (TrackedFlight *flight : item->m_flights) { - m_dirtyFlights.insert(flight); - } - m_dbDirty = true; -} - -// Fold a weaker duplicate into an identified aircraft. A flight-only sighting -// (e.g. ACARS with no registration) creates an aircraft keyed only by its -// flight; when a later report ties that flight to a real airframe, the weak -// entry's data moves across instead of being orphaned. -void AircraftTracker::absorbAircraft(TrackedAircraft *item, TrackedAircraft *weak) -{ - item->m_messages += weak->m_messages; - QHashIterator, int> sourceIt(weak->m_sources); - while (sourceIt.hasNext()) - { - sourceIt.next(); - item->m_sources[sourceIt.key()] += sourceIt.value(); - } - // Which of the two is carrying the current state varies: the weak entry is usually - // the flight-only ACARS record and the survivor the ICAO-backed one, but it is just - // as often the other way round. Keeping the survivor's simply because it survives - // threw away a position, altitude, speed or heading it did not have - so each is - // merged on validity and then on time. - const bool takeWeakPosition = weak->m_positionValid - && (!item->m_positionValid - || (weak->m_positionDateTime.isValid() - && (!item->m_positionDateTime.isValid() - || (weak->m_positionDateTime > item->m_positionDateTime)))); - if (takeWeakPosition) - { - item->m_positionValid = true; - item->m_latitude = weak->m_latitude; - item->m_longitude = weak->m_longitude; - item->m_positionDateTime = weak->m_positionDateTime; - item->m_positionRank = weak->m_positionRank; - item->m_distanceValid = weak->m_distanceValid; - item->m_distanceKm = weak->m_distanceKm; - // The track moves with the flights, below - item->m_mapTrackChanged = true; - } - - // When a position or altitude of each rank was last heard is the union of the two. - // It is what decides whether a coarser source may overwrite a better one, so losing - // half of it would let a stale ACARS fix supersede live ADS-B. - for (int i = 0; i < PositionRanks; i++) - { - if (weak->m_positionRankTimes[i].isValid() - && (!item->m_positionRankTimes[i].isValid() - || (weak->m_positionRankTimes[i] > item->m_positionRankTimes[i]))) { - item->m_positionRankTimes[i] = weak->m_positionRankTimes[i]; - } - } - for (int i = 0; i < AltitudeRanks; i++) - { - if (weak->m_altitudeRankTimes[i].isValid() - && (!item->m_altitudeRankTimes[i].isValid() - || (weak->m_altitudeRankTimes[i] > item->m_altitudeRankTimes[i]))) { - item->m_altitudeRankTimes[i] = weak->m_altitudeRankTimes[i]; - } - } - - // Altitude is measured separately from position on ADS-B - a Mode S altitude reply - // carries no position - so it merges separately, and takes with it the pair of - // observations altitudeAt() interpolates a track point's height between. - // The two most recent samples of the four, rather than one record's pair. Taking a - // pair whole discards a newer sample the other record held, and altitudeAt() - // interpolates a track point's height BETWEEN these two - so the wrong pair does not - // merely lose detail, it interpolates over the wrong interval. - if (weak->m_altitudeValid) - { - QList> samples; - auto offer = [&samples](bool valid, const QDateTime& when, float value) - { - if (valid && when.isValid()) { - samples.append(qMakePair(when, value)); - } - }; - offer(item->m_altitudeValid, item->m_altitudeDateTime, item->m_altitudeFt); - offer(item->m_altitudeValid, item->m_prevAltitudeDateTime, item->m_prevAltitudeFt); - offer(true, weak->m_altitudeDateTime, weak->m_altitudeFt); - offer(true, weak->m_prevAltitudeDateTime, weak->m_prevAltitudeFt); - - std::sort(samples.begin(), samples.end(), - [](const QPair& a, const QPair& b) { - return a.first > b.first; - }); - // Both records usually hold the same newest observation, having both just heard - // it. Taking the top two of the sorted list would then take that one instant - // twice, throw away the real second newest, and leave altitudeAt() with a zero - // span to interpolate over - which it refuses, so the merge would cost exactly - // the interpolation it is meant to preserve. - for (int i = samples.size() - 1; i > 0; i--) - { - if (samples[i].first == samples[i - 1].first) { - samples.removeAt(i); - } - } - - if (samples.isEmpty()) - { - // Neither record timestamped its altitude, so there is nothing to order them - // by and the survivor's is kept unless it has none at all - if (!item->m_altitudeValid) - { - item->m_altitudeValid = true; - item->m_altitudeFt = weak->m_altitudeFt; - } - } - else - { - item->m_altitudeValid = true; - item->m_altitudeDateTime = samples[0].first; - item->m_altitudeFt = samples[0].second; - if (samples.size() > 1) - { - item->m_prevAltitudeDateTime = samples[1].first; - item->m_prevAltitudeFt = samples[1].second; - } - } - } - - // Neither speed nor heading is timestamped, so "whichever one of the two has it" is - // as far as this can honestly go - if (weak->m_speedValid - && (!item->m_speedValid - || (weak->m_speedDateTime.isValid() - && (!item->m_speedDateTime.isValid() - || (weak->m_speedDateTime > item->m_speedDateTime))))) - { - item->m_speedValid = true; - item->m_speedKts = weak->m_speedKts; - item->m_speedDateTime = weak->m_speedDateTime; - } - if (weak->m_headingValid - && (!item->m_headingValid - || (weak->m_headingDateTime.isValid() - && (!item->m_headingDateTime.isValid() - || (weak->m_headingDateTime > item->m_headingDateTime))))) - { - item->m_headingValid = true; - item->m_heading = weak->m_heading; - item->m_headingDateTime = weak->m_headingDateTime; - } - if (weak->m_lastSeen.isValid() - && (!item->m_lastSeen.isValid() || (weak->m_lastSeen > item->m_lastSeen))) { - item->m_lastSeen = weak->m_lastSeen; - } - if (item->m_departure.isEmpty()) { - item->m_departure = weak->m_departure; - } - if (item->m_arrival.isEmpty()) { - item->m_arrival = weak->m_arrival; - } - if (item->m_route.isEmpty()) { - item->m_route = weak->m_route; - } - if (item->m_lastDocumentText.isEmpty()) { - item->m_lastDocumentText = weak->m_lastDocumentText; - } - - // The weak entry's flight history moves across, oldest first - for (TrackedFlight *flight : weak->m_flights) { - flight->m_aircraft = item; - } - QList flights = weak->m_flights; - flights.append(item->m_flights); - item->m_flights = flights; - if (!item->m_currentFlight) { - item->m_currentFlight = weak->m_currentFlight; - } - weak->m_flights.clear(); - weak->m_currentFlight = nullptr; - - for (const QString& key : m_byKey.keys(weak)) { - m_byKey.insert(key, item); - } - if (!weak->m_mapName.isEmpty()) { - removeFromMap(weak->m_mapName); - } - m_dirtyAircraft.remove(weak); - m_mapResyncPending.remove(weak); - // It was counted as an aircraft heard when it was created, and it has just turned - // out to be one already counted - so take it back off both the session set and the - // count, or identifying an airframe part way through inflates the figure by one - if (m_sessionHeard.remove(weak->m_id)) { - m_statistics.m_session.m_distinctAircraft = m_sessionHeard.size(); - m_statisticsDirty = true; - } - m_sessionRecorded.remove(weak->m_id); - emit aircraftRemoved(QList{weak->m_id}); - m_aircraft.removeAll(weak); - delete weak; - - // Merging histories can leave the same flight twice - mergeLoadedFlights(item); - m_dirtyAircraft.insert(item); - for (TrackedFlight *flight : item->m_flights) { - m_dirtyFlights.insert(flight); - } - m_dbDirty = true; -} - -// Merge any of an aircraft's flights that are the same flight under different -// names - after loading a session saved before names were aliased, or after -// absorbing a duplicate aircraft -void AircraftTracker::mergeLoadedFlights(TrackedAircraft *item) -{ - for (int i = 0; i < item->m_flights.size(); i++) - { - TrackedFlight *dst = item->m_flights[i]; - for (int j = i + 1; j < item->m_flights.size(); ) - { - TrackedFlight *src = item->m_flights[j]; - bool matches = flightMatches(dst, src->m_flight); - for (const QString& alias : src->m_aliases) { - matches = matches || flightMatches(dst, alias); - } - // The name is not enough. One airframe flies the same callsign again and - // again - a daily rotation is the same number every day - and merging on the - // name alone put every one of those operations into a single flight holding - // days of track, several sets of OOOI times and several routes. Run time - // splits them on the archive timeout; this is the same rule, so a reload - // stops undoing it. - if (matches && sameOperation(dst, src)) { - mergeFlightInto(item, dst, src); // Removes src from the list - } else { - j++; - } - } - } - - // One airframe flies one flight at a time, so flights whose time spans - // overlap are the same flight under names that can't be matched textually - // (some airlines' callsigns are unrelated to the flight number) - for (int i = 0; i < item->m_flights.size(); i++) - { - TrackedFlight *dst = item->m_flights[i]; - for (int j = i + 1; j < item->m_flights.size(); ) - { - TrackedFlight *src = item->m_flights[j]; - if (dst->m_firstSeen.isValid() && dst->m_lastSeen.isValid() - && src->m_firstSeen.isValid() && src->m_lastSeen.isValid() - && (dst->m_firstSeen <= src->m_lastSeen) - && (src->m_firstSeen <= dst->m_lastSeen)) { - mergeFlightInto(item, dst, src); - } else { - j++; - } - } - } - - // Keep the current flight at the end of the history - if (item->m_currentFlight) - { - item->m_flights.removeAll(item->m_currentFlight); - item->m_flights.append(item->m_currentFlight); - } -} - -// Split a flight identity into the airline designator and the flight number: -// a 3-letter ICAO designator (BAW31) or a 2-character IATA one (BA0031), with -// leading zeros stripped from the number so the two forms compare equal -bool AircraftTracker::splitFlightName(const QString& flight, QString& airline, QString& number) -{ - int prefixLen; - if ((flight.size() > 3) && flight[0].isLetter() && flight[1].isLetter() && flight[2].isLetter()) { - prefixLen = 3; - } else if ((flight.size() > 2) && !(flight[0].isDigit() && flight[1].isDigit())) { - prefixLen = 2; - } else { - return false; - } - airline = flight.left(prefixLen); - QString rest = flight.mid(prefixLen); - int i = 0; - while ((i < rest.size() - 1) && (rest[i] == '0')) { - i++; - } - number = rest.mid(i); - return !number.isEmpty(); -} - -// Whether two names are the same flight in its IATA and ICAO callsign forms, -// e.g. BA0031 and BAW31. Only used within one airframe, so matching on the -// flight number alone is safe. -bool AircraftTracker::sameFlightNumber(const QString& a, const QString& b) -{ - QString airlineA, numberA, airlineB, numberB; - if (!splitFlightName(a, airlineA, numberA) || !splitFlightName(b, airlineB, numberB)) { - return false; - } - return numberA == numberB; -} - -bool AircraftTracker::flightMatches(const TrackedFlight *flight, const QString& name) -{ - if ((flight->m_flight == name) || flight->m_aliases.contains(name)) { - return true; - } - if (sameFlightNumber(flight->m_flight, name)) { - return true; - } - for (const QString& alias : flight->m_aliases) - { - if (sameFlightNumber(alias, name)) { - return true; - } - } - return false; -} - -// Record another name for a flight. The ICAO callsign form (3-letter airline -// designator) is preferred as the primary name - it is what the route database -// is keyed on - with the other forms kept as aliases. -void AircraftTracker::addFlightAlias(TrackedAircraft *item, TrackedFlight *flight, const QString& name) -{ - if ((flight->m_flight == name) || flight->m_aliases.contains(name)) { - return; - } - - QString airline, number; - bool nameIsCallsign = splitFlightName(name, airline, number) && (airline.size() == 3); - bool primaryIsCallsign = splitFlightName(flight->m_flight, airline, number) && (airline.size() == 3); - - if (nameIsCallsign && !primaryIsCallsign) - { - flight->m_aliases.append(flight->m_flight); - flight->m_flight = name; - } - else - { - flight->m_aliases.append(name); - } - m_byKey.insert("F" + name, item); -} - -// Fold one flight into another - they are the same flight under different names -void AircraftTracker::mergeFlightInto(TrackedAircraft *item, TrackedFlight *dst, TrackedFlight *src) -{ - addFlightAlias(item, dst, src->m_flight); - for (const QString& alias : src->m_aliases) { - addFlightAlias(item, dst, alias); - } - if (src->m_firstSeen.isValid() && (!dst->m_firstSeen.isValid() || (src->m_firstSeen < dst->m_firstSeen))) { - dst->m_firstSeen = src->m_firstSeen; - } - if (src->m_lastSeen.isValid() && (src->m_lastSeen > dst->m_lastSeen)) { - dst->m_lastSeen = src->m_lastSeen; - } - if (dst->m_departure.isEmpty()) { - dst->m_departure = src->m_departure; - } - if (dst->m_arrival.isEmpty()) { - dst->m_arrival = src->m_arrival; - } - if (dst->m_route.isEmpty()) - { - dst->m_route = src->m_route; - // With the route, not separately: left to itself the time would end up claiming - // that whichever route dst kept was filed when src's was - dst->m_routeFiled = src->m_routeFiled; - } - QHashIterator, int> flightSourceIt(src->m_sources); - while (flightSourceIt.hasNext()) - { - flightSourceIt.next(); - dst->m_sources[flightSourceIt.key()] += flightSourceIt.value(); - } - dst->m_documents.append(src->m_documents); - src->m_documents.clear(); - - // Interleave the profile samples in time order - if (!src->m_profileTimes.isEmpty()) - { - QList times; - QList alts, speeds; - int i = 0, j = 0; - while ((i < dst->m_profileTimes.size()) || (j < src->m_profileTimes.size())) - { - bool takeDst = (j >= src->m_profileTimes.size()) - || ((i < dst->m_profileTimes.size()) && (dst->m_profileTimes[i] <= src->m_profileTimes[j])); - if (takeDst) - { - times.append(dst->m_profileTimes[i]); - alts.append(dst->m_profileAltFt[i]); - speeds.append(dst->m_profileSpeedKts[i]); - i++; - } - else - { - times.append(src->m_profileTimes[j]); - alts.append(src->m_profileAltFt[j]); - speeds.append(src->m_profileSpeedKts[j]); - j++; - } - } - dst->m_profileTimes = times; - dst->m_profileAltFt = alts; - dst->m_profileSpeedKts = speeds; - // Rebuilt, not appended to, so what is stored for this flight is now wrong - dst->m_profileSaved = 0; - m_flightsToRewrite.insert(dst->m_id); - } - - dst->m_messages += src->m_messages; - if (!dst->m_out.isValid()) { dst->m_out = src->m_out; } - if (!dst->m_off.isValid()) { dst->m_off = src->m_off; } - if (!dst->m_on.isValid()) { dst->m_on = src->m_on; } - if (!dst->m_in.isValid()) { dst->m_in = src->m_in; } - - if (!src->m_track.isEmpty()) - { - QList track; - QList times; - int i = 0, j = 0; - while ((i < dst->m_track.size()) || (j < src->m_track.size())) - { - const bool takeDst = (j >= src->m_track.size()) - || ((i < dst->m_track.size()) && (dst->m_trackTimes[i] <= src->m_trackTimes[j])); - if (takeDst) - { - track.append(dst->m_track[i]); - times.append(dst->m_trackTimes[i]); - i++; - } - else - { - track.append(src->m_track[j]); - times.append(src->m_trackTimes[j]); - j++; - } - } - dst->m_track = track; - dst->m_trackTimes = times; - dst->m_trackSaved = 0; - m_flightsToRewrite.insert(dst->m_id); - item->m_mapTrackChanged = true; - } - - // The routes move too, or they are lost with src while what was drawn from them - // stays on the Map with nothing left that knows how to take it off. Where dst has one - // of its own, src's drawing is removed rather than kept: two flights have become one, - // and only one route can be current. - for (auto pair : { qMakePair(&src->m_flightPlan, &dst->m_flightPlan), - qMakePair(&src->m_clearance, &dst->m_clearance) }) - { - TrackedFlight::FiledRoute *from = pair.first; - TrackedFlight::FiledRoute *to = pair.second; - // The newer route wins, not the destination's. Which flight is which here is - // not the order they were flown: reconciling two names for one flight merges the - // current flight INTO the alias it turns out to be, so keeping the destination's - // route would systematically keep the older of the two. - const bool takeFrom = !from->m_waypoints.isEmpty() - && (to->m_waypoints.isEmpty() - || (from->m_filed.isValid() - && (!to->m_filed.isValid() || (from->m_filed > to->m_filed)))); - if (takeFrom) - { - // What the destination had drawn comes off first: two flights have become - // one, and only one route can be current - removeDrawnRoute(*to); - // Taken whole, drawn names included, so a later redraw knows what to replace - *to = *from; - if (to->m_pending) { - m_routesPending.insert(dst->m_id); - } - } - else { - removeDrawnRoute(*from); - } - } - m_routesPending.remove(src->m_id); - - m_flightsToDelete.insert(src->m_id); - if (m_watchedFlight == src->m_id) { - m_watchedFlight = dst->m_id; - } - if (item->m_currentFlight == src) { - item->m_currentFlight = dst; - } - m_dirtyFlights.remove(src); - m_dirtyFlights.insert(dst); - m_dbDirty = true; - emit flightsRemoved(QList{src->m_id}); - item->m_flights.removeAll(src); - delete src; -} - -// The flight a report belongs to -AircraftTracker::TrackedFlight *AircraftTracker::updateFlight(TrackedAircraft *item, const AircraftReport& report) -{ - TrackedFlight *flight = item->m_currentFlight; - - // An airframe that comes back later on the same callsign is flying it again, not - // still flying it. Without this the second operation was appended to the first, so - // one flight held two days of track, two sets of OOOI times and two routes. The - // archive timeout is the boundary because it is already the answer to "has this - // aircraft gone away": if it was away long enough to be archived, its return is a - // new flight. - if (flight && flight->m_lastSeen.isValid() && report.m_received.isValid()) - { - const qint64 gap = flight->m_lastSeen.secsTo(report.m_received); - if (gap > (qint64) m_settings.m_removalMins * 60) - { - item->m_departure.clear(); - item->m_arrival.clear(); - item->m_route.clear(); - m_dirtyFlights.insert(flight); - item->m_currentFlight = nullptr; - flight = nullptr; - item->m_mapTrackChanged = true; // A different flight, a different track - } - } - - if (!flight) - { - flight = new TrackedFlight(); - flight->m_id = m_nextId++; - flight->m_aircraft = item; - flight->m_flight = report.m_flight; - flight->m_firstSeen = report.m_received; - item->m_flights.append(flight); - item->m_currentFlight = flight; - } - else if (!report.m_flight.isEmpty() && (flight->m_flight != report.m_flight) - && !flight->m_aliases.contains(report.m_flight)) - { - if (flight->m_flight.isEmpty()) - { - // The identity of the flight already under way became known - flight->m_flight = report.m_flight; - } - else if (flightMatches(flight, report.m_flight)) - { - // The same flight number in the other form, e.g. BA0031 vs BAW31 - addFlightAlias(item, flight, report.m_flight); - } - else - { - // Some airlines' callsigns are unrelated to the flight number - // (e.g. LS0232 vs EXS79HP), so the forms can't be matched by name - // alone. If the name matches the previous flight and that flight - // was seen moments ago, the two are the same flight alternating - // between its ACARS and ADS-B identities - reunite them. - TrackedFlight *previous = (item->m_flights.size() >= 2) - ? item->m_flights[item->m_flights.size() - 2] : nullptr; - // Bounded at both ends, as the flight key match is: a report older than the - // previous flight's last message is not evidence that the two are the same - // flight alternating between its identities - const qint64 sincePrevious = previous && previous->m_lastSeen.isValid() - ? previous->m_lastSeen.secsTo(report.m_received) : -1; - if (previous && flightMatches(previous, report.m_flight) - && previous->m_lastSeen.isValid() - && (sincePrevious >= 0) && (sincePrevious < 10*60)) - { - mergeFlightInto(item, previous, flight); - flight = previous; - } - else - { - // A new flight by the same airframe: the old flight's route no - // longer describes the aircraft - item->m_departure.clear(); - item->m_arrival.clear(); - item->m_route.clear(); - flight = new TrackedFlight(); - flight->m_id = m_nextId++; - flight->m_aircraft = item; - flight->m_flight = report.m_flight; - flight->m_firstSeen = report.m_received; - item->m_flights.append(flight); - // The flight it was on is no longer the active one - if (item->m_currentFlight) { - m_dirtyFlights.insert(item->m_currentFlight); - } - item->m_currentFlight = flight; - item->m_mapTrackChanged = true; // A different flight, a different track - } - } - } - - // The latest report, not the last to arrive - as on the aircraft above. A flight - // whose last seen time went backwards sorts wrongly and reads as finished. - if (report.m_received.isValid() - && (!flight->m_lastSeen.isValid() || (report.m_received > flight->m_lastSeen))) { - flight->m_lastSeen = report.m_received; - } - - // An event happens once, so the first report of it is the one to keep - the same - // event is often re-sent, and a later copy is not a later event - if ((report.m_oooiEvent != AircraftReport::OooiNone) && report.m_oooiTime.isValid()) - { - switch (report.m_oooiEvent) - { - case AircraftReport::OooiOut: if (!flight->m_out.isValid()) { flight->m_out = report.m_oooiTime; } break; - case AircraftReport::OooiOff: if (!flight->m_off.isValid()) { flight->m_off = report.m_oooiTime; } break; - case AircraftReport::OooiOn: if (!flight->m_on.isValid()) { flight->m_on = report.m_oooiTime; } break; - case AircraftReport::OooiIn: if (!flight->m_in.isValid()) { flight->m_in = report.m_oooiTime; } break; - default: break; - } - } - - // Flight profile sample, at most one every 5 seconds - if ((report.m_altitudeValid || report.m_speedValid) && report.m_received.isValid()) - { - qint64 ms = report.m_received.toMSecsSinceEpoch(); - if (flight->m_profileTimes.isEmpty() || (ms - flight->m_profileTimes.last() >= 5000)) - { - flight->m_profileTimes.append(ms); - flight->m_profileAltFt.append(report.m_altitudeValid ? report.m_altitudeFt : std::numeric_limits::quiet_NaN()); - flight->m_profileSpeedKts.append(report.m_speedValid ? report.m_speedKts : std::numeric_limits::quiet_NaN()); - } - } - - // Route facts a message revealed. They move forward in time only, for the same - // reason the filed routes below do: a delayed message says where the flight was - // going earlier, not where it is going now. Without this the Route column could - // disagree with the route drawn on the Map, which does compare filing times. - // - // A fact we do not hold at all is still worth taking from an older message, since - // the alternative is nothing - but it does not move the clock forward, or the next - // genuinely newer message would be rejected by it. - const bool routeIsNewer = !flight->m_routeFiled.isValid() || !report.m_received.isValid() - || (report.m_received >= flight->m_routeFiled); - bool routeFactTaken = false; - if (!report.m_departure.isEmpty() && (routeIsNewer || flight->m_departure.isEmpty())) - { - flight->m_departure = report.m_departure; - routeFactTaken = true; - } - if (!report.m_arrival.isEmpty() && (routeIsNewer || flight->m_arrival.isEmpty())) - { - flight->m_arrival = report.m_arrival; - routeFactTaken = true; - } - if (!report.m_route.isEmpty() && (routeIsNewer || flight->m_route.isEmpty())) - { - flight->m_route = report.m_route; - routeFactTaken = true; - } - if (routeFactTaken && routeIsNewer && report.m_received.isValid()) { - flight->m_routeFiled = report.m_received; - } - // A flight plan and an oceanic clearance both name a list of waypoints, and both - // are drawn. Nothing else that fills in m_route does - the route database fills it - // with the airport pair, which is not a route at all. - if (!report.m_route.isEmpty()) - { - // A route filed before the one being held is a record of what the aircraft was - // cleared onto earlier, not what it is on now. Replacing on arrival rather than - // on filing time let a delayed message overwrite the current route, and redraw - // the Map with it. - auto file = [&report](TrackedFlight::FiledRoute& route) - { - if (route.m_filed.isValid() && report.m_received.isValid() - && (report.m_received < route.m_filed)) { - return false; - } - route.m_waypoints = report.m_route; - route.m_points = report.m_routeWaypoints; - route.m_text = report.m_documentText; - route.m_filed = report.m_received; - return true; - }; - - if (report.m_documentKind == AircraftReport::FlightPlan) - { - if (file(flight->m_flightPlan)) { - sendRouteToMap(flight, flight->m_flightPlan, "Flight plan"); - } - } - else if (report.m_documentKind == AircraftReport::Clearance) - { - if (file(flight->m_clearance)) { - sendRouteToMap(flight, flight->m_clearance, "Oceanic clearance"); - } - } - } - - // Enrich from the callsign to route database when no message has revealed the - // route - the same database the ADS-B demodulator uses - if (!flight->m_flight.isEmpty() && flight->m_departure.isEmpty() && flight->m_arrival.isEmpty() - && m_routeInfo && m_routeInfo->contains(flight->m_flight)) - { - const AircraftRouteInformation *route = m_routeInfo->value(flight->m_flight); - flight->m_departure = route->m_dep; - flight->m_arrival = route->m_arr; - if (!route->m_stops.isEmpty()) { - flight->m_route = route->m_stops; - } - } - - // The aircraft-level route facts drive the Map popups - if (item->m_departure.isEmpty()) { - item->m_departure = flight->m_departure; - } - if (item->m_arrival.isEmpty()) { - item->m_arrival = flight->m_arrival; - } - if (item->m_route.isEmpty()) { - item->m_route = flight->m_route; - } - - m_dirtyFlights.insert(flight); - - return flight; -} - -QString AircraftTracker::documentKindName(int kind) const -{ - switch (kind) - { - case AircraftReport::AcarsText: return "Text"; - case AircraftReport::PositionReport: return "Position report"; - case AircraftReport::OooiEvent: return "OOOI"; - case AircraftReport::Loadsheet: return "Loadsheet"; - case AircraftReport::FlightPlan: return "Flight plan"; - case AircraftReport::Clearance: return "Clearance"; - case AircraftReport::Cpdlc: return "CPDLC"; - case AircraftReport::Logon: return "Logon"; - case AircraftReport::PerformanceReport: return "Performance"; - default: return ""; - } -} - -// Collect notable documents - flight plans, clearances, loadsheets, logons, -// OOOI events - against the flight they belong to. Plain ACARS messages would -// flood the log so they are not collected, and CPDLC goes to the ATC log. -void AircraftTracker::addDocument(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report) -{ - switch (report.m_documentKind) - { - case AircraftReport::Loadsheet: - case AircraftReport::FlightPlan: - case AircraftReport::Clearance: - case AircraftReport::Logon: - case AircraftReport::OooiEvent: - break; - default: - return; - } - if (report.m_documentText.isEmpty()) { - return; - } - // Retransmissions produce identical documents back to back - if (!flight->m_documents.isEmpty() - && (flight->m_documents.last()->m_kind == (int) report.m_documentKind) - && (flight->m_documents.last()->m_text == report.m_documentText)) { - return; - } - - TrackedDocument *doc = new TrackedDocument(); - doc->m_kind = report.m_documentKind; - doc->m_title = report.m_documentTitle.isEmpty() ? documentKindName(report.m_documentKind) : report.m_documentTitle; - doc->m_text = report.m_documentText; - doc->m_received = report.m_received; - flight->m_documents.append(doc); - - m_pendingDocuments.append(documentEvent(item, flight, doc)); - m_dirtyFlights.insert(flight); - m_dbDirty = true; -} - -// Log of controller-pilot data link messages across all channels. Only the -// concise ATC message text (e.g. "WILCO") is kept, not the full decode. -QString AircraftTracker::weatherKindName(int kind) -{ - switch (kind) - { - case AircraftReport::Metar: return "METAR"; - case AircraftReport::Taf: return "TAF"; - case AircraftReport::Atis: return "D-ATIS"; - case AircraftReport::Twip: return "TWIP"; - case AircraftReport::Notam: return "NOTAM"; - case AircraftReport::Pirep: return "PIREP"; - case AircraftReport::Sigmet: return "SIGMET"; - default: return "Weather"; - } -} - -// Weather reaches us through whichever aircraft asked for it, but it describes an -// airport, so it is logged on its own rather than against that aircraft. -void AircraftTracker::addWeatherReport(TrackedAircraft *item, const AircraftReport& report) -{ - if ((report.m_weatherKind == AircraftReport::WeatherNone) - || report.m_weatherText.isEmpty()) { - return; - } - - WeatherEvent e; - e.m_received = report.m_received; - e.m_airport = report.m_weatherAirport; - e.m_kind = weatherKindName(report.m_weatherKind); - e.m_text = report.m_weatherText; - e.m_summary = QString(e.m_text).replace('\n', " ").simplified(); - e.m_from = !item->m_flight.isEmpty() ? item->m_flight : regFor(item); - - // The same METAR is sent to every aircraft that asks, so the identical report - // arrives again and again. Only a genuinely new one is worth a row. - // - // This used to scan the whole log, comparing the full text of every entry against - // every arrival - and since the log only grows, the cost per report grew with it, on - // the tracker thread, for exactly the traffic that produces the most repeats. - const size_t key = qHashMulti(0, e.m_airport, e.m_kind, e.m_text); - for (auto it = m_weatherIndex.constFind(key); - (it != m_weatherIndex.constEnd()) && (it.key() == key); ++it) - { - // value() rather than at(): should the log ever be cleared without the index, - // a stale position then simply fails to match and the report is logged again, - // where at() would be undefined behaviour - const WeatherEvent seen = m_weatherLog.value(it.value()); - if ((seen.m_airport == e.m_airport) && (seen.m_kind == e.m_kind) - && (seen.m_text == e.m_text)) { - return; - } - } - - m_weatherIndex.insert(key, m_weatherLog.size()); - m_weatherLog.append(e); - m_pendingWeather.append(e); -} - -void AircraftTracker::addAtcMessage(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report) -{ - if ((report.m_documentKind != AircraftReport::Cpdlc) || report.m_atc.isEmpty()) { - return; - } - - QString flightName = !flight->m_flight.isEmpty() ? flight->m_flight : regFor(item); - - AtcEvent e; - e.m_aircraftId = item->m_id; - e.m_flightId = flight->m_id; - e.m_received = report.m_received; - e.m_protocol = documentKindName(report.m_documentKind); - e.m_uplink = report.m_uplink; - e.m_from = report.m_uplink ? report.m_station : flightName; - e.m_to = report.m_uplink ? flightName : report.m_station; - e.m_message = QString(report.m_atc).replace('\n', "; "); - e.m_tooltip = report.m_atc; - e.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; - - // Retransmissions produce identical messages back to back - if (!m_atcLog.isEmpty() - && (m_atcLog.last().m_message == e.m_message) - && (m_atcLog.last().m_from == e.m_from) - && (m_atcLog.last().m_to == e.m_to)) { - return; - } - - m_atcLog.append(e); - m_pendingAtc.append(e); - m_dbDirty = true; -} - -// Speech and command notifications for aircraft matching the user's rules. -// Each rule fires at most once per aircraft. Speech is passed to the GUI; -// commands run here, so they work in server mode too. -void AircraftTracker::checkNotifications(TrackedAircraft *item, const AircraftReport& report) -{ - for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) - { - if (item->m_notifiedRules.contains(i)) { - continue; - } - const AircraftSettings::NotificationSettings *rule = m_settings.m_notificationSettings[i].data(); - - QString match; - switch (rule->m_matchColumn) - { - case AircraftSettings::MATCH_ICAO: - if (item->m_icao) { - match = QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper(); - } - break; - case AircraftSettings::MATCH_REG: - match = item->m_registration; - break; - case AircraftSettings::MATCH_FLIGHT: - match = item->m_flight; - break; - case AircraftSettings::MATCH_TYPE: - if (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) { - match = m_aircraftInfo->value(item->m_registration)->m_type; - } - break; - default: - break; - } - - if (!match.isEmpty() - && rule->m_regularExpression.isValid() - && rule->m_regularExpression.match(match).hasMatch()) - { - item->m_notifiedRules.insert(i); - if (!rule->m_speech.isEmpty()) { - emit speechNotification(subAircraftString(item, report, rule->m_speech)); - } - if (!rule->m_command.isEmpty()) { - commandNotification(subAircraftString(item, report, rule->m_command)); - } - } - } -} - -QString AircraftTracker::subAircraftString(TrackedAircraft *item, const AircraftReport& report, const QString& string) const -{ - QString s = string; - s = s.replace("${icao}", item->m_icao ? QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper() : QString()); - s = s.replace("${reg}", item->m_registration); - s = s.replace("${flight}", item->m_flight); - QString type; - if (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) { - type = m_aircraftInfo->value(item->m_registration)->m_type; - } - s = s.replace("${type}", type); - s = s.replace("${protocol}", protocolName(report.m_protocol)); - return s; -} - -void AircraftTracker::commandNotification(const QString& command) -{ -#if QT_CONFIG(process) - QStringList allArgs = QProcess::splitCommand(command); - if (allArgs.size() > 0) - { - QString program = allArgs[0]; - allArgs.pop_front(); - QProcess::startDetached(program, allArgs); - } -#else - qWarning() << "AircraftTracker::commandNotification: QProcess not supported. Can't run: " << command; -#endif -} - - -// The all time figures outlive the session that set them, so they travel in the settings -// as an opaque blob - a versioned stream rather than a settings key each, so that adding -// a statistic later does not need a new key and cannot collide with one. -// -// The session side is deliberately not written: it is defined by the run it describes. -// Nor is the all time aircraft count, which the database holds - see AircraftStatistics. -// -// Version 1 held the records alone. It still reads, and its records become the all time -// records, which is what they always were. Version 3 added where each record was set; -// records read from an older blob simply have no position, and are not drawn on the Map. -QByteArray AircraftTracker::serializeStatistics(const AircraftStatistics& statistics) -{ - QByteArray data; - QDataStream stream(&data, QIODevice::WriteOnly); - stream.setVersion(QDataStream::Qt_5_15); - - stream << (quint32) 3; // format version - stream << (quint32) AircraftReport::ProtocolCount; - - auto put = [&stream](const AircraftStatistics::Record& r) - { - stream << r.m_valid << r.m_value << r.m_aircraft << r.m_when; - // Added in version 3 - stream << r.m_positionValid << r.m_latitude << r.m_longitude - << r.m_altitudeValid << r.m_altitudeFt; - }; - - const AircraftStatistics::Scope& all = statistics.m_allTime; - for (int i = 0; i < AircraftReport::ProtocolCount; i++) { - put(all.m_maxRange[i]); - } - put(all.m_fastest); - put(all.m_highest); - stream << all.m_maxConcurrent << all.m_maxConcurrentWhen; - - // Added in version 2 - stream << all.m_totalMessages; - for (int i = 0; i < AircraftReport::ProtocolCount; i++) { - stream << all.m_messagesByProtocol[i]; - } - stream << all.m_seconds << statistics.m_firstStart; - return data; -} - -AircraftStatistics AircraftTracker::deserializeStatistics(const QByteArray& data) -{ - AircraftStatistics statistics; - if (data.isEmpty()) { - return statistics; - } - - QDataStream stream(data); - stream.setVersion(QDataStream::Qt_5_15); - - quint32 version = 0; - quint32 protocols = 0; - stream >> version >> protocols; - if ((version < 1) || (version > 3) || (stream.status() != QDataStream::Ok)) { - return statistics; // Written by something else, or truncated: start clean - } - - auto get = [&stream, version](AircraftStatistics::Record& r) - { - stream >> r.m_valid >> r.m_value >> r.m_aircraft >> r.m_when; - if (version >= 3) - { - stream >> r.m_positionValid >> r.m_latitude >> r.m_longitude - >> r.m_altitudeValid >> r.m_altitudeFt; - } - }; - - AircraftStatistics::Scope& all = statistics.m_allTime; - - // Read what was written even if the protocol list has grown since; records for - // protocols that did not exist then simply stay unset - for (quint32 i = 0; i < protocols; i++) - { - AircraftStatistics::Record r; - get(r); - if (i < (quint32) AircraftReport::ProtocolCount) { - all.m_maxRange[i] = r; - } - } - get(all.m_fastest); - get(all.m_highest); - stream >> all.m_maxConcurrent >> all.m_maxConcurrentWhen; - - if (version >= 2) - { - stream >> all.m_totalMessages; - for (quint32 i = 0; i < protocols; i++) - { - quint64 n = 0; - stream >> n; - if (i < (quint32) AircraftReport::ProtocolCount) { - all.m_messagesByProtocol[i] = n; - } - } - stream >> all.m_seconds >> statistics.m_firstStart; - } - - if (stream.status() != QDataStream::Ok) { - return AircraftStatistics(); - } - return statistics; -} - - -// A 3D model for the map, for aircraft the ADS-B demodulator is not providing one for. -// -// This is the same matcher ADS-B uses - it moved to sdrbase so both can share it - and it -// works from the model name, manufacturer and operator in the OpenSky database, which is -// reached through the registration. So an aircraft heard only on ACARS, HFDL or Aero now -// gets a model too, which is most of the oceanic traffic ADS-B cannot see at all. -// -// Chosen ONCE and kept. The livery is picked at random where there is a choice, so asking -// again on every report would change the aircraft's appearance as it flew. -void AircraftTracker::update3DModel(TrackedAircraft *item) -{ - if (!item->m_model3D.isEmpty()) { - return; - } - - const AircraftInformation *info = nullptr; - if (m_aircraftInfo && !item->m_registration.isEmpty()) - { - auto it = m_aircraftInfo->find(item->m_registration); - if (it != m_aircraftInfo->end()) { - info = it.value(); - } - } - - QString model; - float altitudeOffset = 0.0f; - float labelOffset = 0.0f; - bool matched = info && Aircraft3DModels::instance().modelFor( - info, m_settings.m_favourLivery, false, model, altitudeOffset, labelOffset); - - if (!matched) - { - // Only a fraction of types have a model of their own, and an aircraft we know - // nothing about has none either. Rather than leave it as a flat billboard among - // modelled aircraft, stand in something of about the right shape and size - matched = Aircraft3DModels::instance().defaultModel( - info ? info->m_type : QString(), model, altitudeOffset, labelOffset); - } - - if (matched) - { - item->m_model3D = model; - item->m_modelAltitudeOffset = altitudeOffset; - item->m_labelAltitudeOffset = labelOffset; - item->m_modelIsOurs = true; - } -} - -// Where the receiver was for a report that arrived on this device set. -// -// A device can know where it is - a remote SDR reports the server's position - and that -// is the antenna that actually heard the aircraft, so it is preferred over My Position. -// getDevicePosition() leaves its arguments alone and returns false when the device has -// none, which makes the fallback a single call. -// -// It is cached because that helper builds an entire device report and parses it as JSON: -// far too expensive per message, but nothing here moves quickly, so a periodic refresh -// picks up a device that has just learned where it is. -QGeoCoordinate AircraftTracker::receiverPosition(int deviceSetIndex) -{ - const QDateTime now = QDateTime::currentDateTime(); - if (!m_devicePositionsRefreshed.isValid() - || (m_devicePositionsRefreshed.secsTo(now) > 60)) - { - m_devicePositions.clear(); - m_devicePositionsRefreshed = now; - } - - auto cached = m_devicePositions.find(deviceSetIndex); - if (cached != m_devicePositions.end()) { - return cached.value(); - } - - float latitude = MainCore::instance()->getSettings().getLatitude(); - float longitude = MainCore::instance()->getSettings().getLongitude(); - float altitude = MainCore::instance()->getSettings().getAltitude(); - - if (deviceSetIndex >= 0) { - ChannelWebAPIUtils::getDevicePosition((unsigned int) deviceSetIndex, latitude, longitude, altitude); - } - - QGeoCoordinate position(latitude, longitude, altitude); - m_devicePositions.insert(deviceSetIndex, position); - return position; -} - -// Records, counters and the concurrent aircraft window -void AircraftTracker::updateStatistics(const AircraftReport& report, TrackedAircraft *item, - bool rangeValid, float rangeKm, - bool altitudeValid, float altitudeFt) -{ - m_statisticsDirty = true; - - const QString who = !item->m_registration.isEmpty() ? item->m_registration - : (!item->m_flight.isEmpty() ? item->m_flight - : QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper()); - const QDateTime when = report.m_received.isValid() ? report.m_received - : QDateTime::currentDateTime(); - - // rangeValid/rangeKm describe the position THIS report carried - see the note where - // they are worked out. A report that carried none measures nothing, which is what - // keeps ADS-B distances from being credited to HFDL's text-only reports. - // - // The position stored with a record is the one THIS report carried, for the same - // reason: it is the fix the range was measured from, so it is where the record was - // set. Exactly 0N 0E is a zeroed field rather than a place, as it is on ingest. - const bool positionValid = report.m_positionValid - && ((report.m_latitude != 0.0f) || (report.m_longitude != 0.0f)); - - m_statistics.m_session.update(report.m_protocol, rangeValid, rangeKm, - item->m_speedValid, item->m_speedKts, altitudeValid, altitudeFt, who, when, - positionValid, report.m_latitude, report.m_longitude); - m_statistics.m_allTime.update(report.m_protocol, rangeValid, rangeKm, - item->m_speedValid, item->m_speedKts, altitudeValid, altitudeFt, who, when, - positionValid, report.m_latitude, report.m_longitude); - - // First time this airframe has been heard in this session - which is not the same as - // the first time it was tracked, because the tracked list is restored from the - // database at startup - if (!m_sessionHeard.contains(item->m_id)) - { - m_sessionHeard.insert(item->m_id); - m_statistics.m_session.m_distinctAircraft = m_sessionHeard.size(); - } - - // Counted into the all time figure separately, and only once it can be identified - // well enough to recognise again on another day - if (!m_sessionRecorded.contains(item->m_id)) - { - int countDelta = 0; - if (recordSeen(item, countDelta) >= 0) - { - m_sessionRecorded.insert(item->m_id); - if (countDelta != 0) - { - m_statistics.m_allTime.m_distinctAircraft = - std::max(0, m_statistics.m_allTime.m_distinctAircraft + countDelta); - m_statisticsDirty = true; - } - } - } -} - -// The most aircraft heard within any 15 minute window. Counted over what has actually -// been heard recently rather than over the tracked list, which holds aircraft for far -// longer than that and would only ever report the retention period's total. -void AircraftTracker::updateConcurrent(const QDateTime& now) -{ - int concurrent = 0; - for (const TrackedAircraft *item : m_aircraft) - { - if (item->m_lastSeen.isValid() - && (item->m_lastSeen.secsTo(now) <= AircraftStatistics::ConcurrentWindowMins * 60)) { - concurrent++; - } - } - for (AircraftStatistics::Scope *scope : { &m_statistics.m_session, &m_statistics.m_allTime }) - { - if (concurrent > scope->m_maxConcurrent) - { - scope->m_maxConcurrent = concurrent; - scope->m_maxConcurrentWhen = now; - m_statisticsDirty = true; - } - } -} - -// Everything a rule does, in the order the rules are held. Two lists with the same -// signature address the same aircraft in the same way, whatever else has changed in the -// settings, so the record of which have already fired still means what it says. -QString AircraftTracker::notificationSignature(const AircraftSettings& settings) -{ - QStringList parts; - for (const auto& rule : settings.m_notificationSettings) - { - if (rule) { - parts.append(QString("%1\x1f%2\x1f%3\x1f%4").arg(rule->m_matchColumn) - .arg(rule->m_regExp).arg(rule->m_speech).arg(rule->m_command)); - } - } - return parts.join(QChar(0x1e)); -} - -QString AircraftTracker::protocolName(int protocol) const -{ - switch (protocol) - { - case AircraftReport::ADSB: return "ADS-B"; - case AircraftReport::ACARS: return "ACARS"; - case AircraftReport::VDL2: return "VDL2"; - case AircraftReport::HFDL: return "HFDL"; - case AircraftReport::AERO: return "Aero"; - default: return "?"; - } -} - -// E.g: {"ADS-B", "ACARS 131.725", "HFDL 5.720"}. ADS-B has no frequency - it is -// always 1090 MHz. -QStringList AircraftTracker::sourcesList(const QHash, int>& sources) const -{ - QStringList parts; - QList> keys = sources.keys(); - std::sort(keys.begin(), keys.end()); - for (const auto& key : keys) - { - QString part = protocolName(key.first); - if ((key.second != 0) && (key.first != (int) AircraftReport::ADSB)) { - part += QString(" %1").arg(key.second / 1e6, 0, 'f', 3); - } - if (!parts.contains(part)) { - parts.append(part); - } - } - return parts; -} - -QString AircraftTracker::sourcesText(const QHash, int>& sources) const -{ - return sourcesList(sources).join("; "); -} - -// Name on the Map: registration when known, otherwise flight, otherwise the ICAO -// address in hex, so successive reports update one item -// How a flight is written on the Map: either as flown (BAW123) or as ATC says it -// (SPEEDBIRD 123), which is what is heard on the radio -QString AircraftTracker::flightLabel(const QString& flight) const -{ - if (!m_settings.m_atcCallsigns || (flight.size() < 3)) { - return flight; - } - - const Airline *airline = Airline::getByICAO(flight.left(3)); - - if (airline && !airline->m_callsign.isEmpty()) { - return QString("%1 %2").arg(airline->m_callsign, flight.mid(3)); - } - return flight; -} - -QString AircraftTracker::mapItemName(const TrackedAircraft *item) const -{ - if (!item->m_registration.isEmpty()) { - return item->m_registration; - } - if (!item->m_flight.isEmpty()) { - return item->m_flight; - } - if (item->m_icao) { - return QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper(); - } - return QString(); -} - -// ATC style Map label, like the ADS-B demodulator's: identity, route, flight -// level, then speed and type -QString AircraftTracker::atcLabel(const TrackedAircraft *item) const -{ - QStringList lines; - lines.append(!item->m_flight.isEmpty() ? flightLabel(item->m_flight) : mapItemName(item)); - if (!item->m_departure.isEmpty() && !item->m_arrival.isEmpty()) { - lines.append(QString("%1-%2").arg(item->m_departure).arg(item->m_arrival)); - } - if (item->m_altitudeValid && item->m_positionValid) - { - QChar c = item->m_altitudeFt >= 6000.0f ? 'F' : 'A'; - lines.append(QString("%1%2").arg(c).arg((int) (item->m_altitudeFt / 100.0f))); - } - QStringList row; - if (item->m_speedValid) { - row.append(QString("G%1").arg((int) item->m_speedKts)); - } - if (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) - { - const QString& type = m_aircraftInfo->value(item->m_registration)->m_type; - if (!type.isEmpty()) { - row.append(type); - } - } - if (!row.isEmpty()) { - lines.append(row.join(" ")); - } - return lines.join("
"); -} - -// Map icon by aircraft type, reusing the ADS-B demodulator's icon set (its qrc -// resources are process wide) -QString AircraftTracker::aircraftImage(const TrackedAircraft *item) const -{ - return aircraftImage(item->m_registration, item->m_model3D); -} - -QString AircraftTracker::aircraftImage(const QString& registration, const QString& model3D) const -{ - static const QStringList fourEngineTypes = { - "A388", "B741", "B742", "B743", "B744", "B748", "B74R", "B74S", "BLCF", - "A342", "A343", "A345", "A346", "C17", "K35R"}; - static const QStringList heavyTwinTypes = { - "B772", "B773", "B77L", "B77W", "B788", "B789", "B78X", - "A332", "A333", "A338", "A339", "A359", "A35K", - "B762", "B763", "B764", "MD11", "DC10"}; - static const QStringList smallTypes = { - "GLF4", "GLF5", "GLF6", "GLEX", "GL5T", "CL60", "C25A", "C25B", "C25C", - "C525", "C550", "C560", "C56X", "C680", "C68A", "C750", "E50P", "E55P", - "E545", "E550", "F2TH", "F900", "FA7X", "FA8X", "LJ35", "LJ45", "LJ60", - "PC24", "PRM1", "HDJT"}; - - // The livery icons are named after the 3D models they were rendered from - // (e.g. BB_Airbus_png/A320/A320_BAW.gltf -> A320_BAW.png), so an aircraft's icon - // follows its matched model's basename. Like the plain icons, they are the ADS-B - // demodulator's resources, so may not exist in every build - if (m_settings.m_useLiveryIcons && !model3D.isEmpty()) - { - QString image = QString("liveries/%1.png").arg(QFileInfo(model3D).completeBaseName()); - if (QFile::exists(":/map/" + image)) { - return image; - } - } - - QString name = "aircraft_large.png"; - if (m_aircraftInfo && m_aircraftInfo->contains(registration)) - { - const QString& type = m_aircraftInfo->value(registration)->m_type; - if (fourEngineTypes.contains(type)) { - name = "aircraft_heavy_4engine.png"; - } else if (heavyTwinTypes.contains(type)) { - name = "aircraft_heavy_2engine.png"; - } else if (smallTypes.contains(type)) { - name = "aircraft_small.png"; - } - } - // No model match - use a white version of the plain icon, so the style stays - // consistent with the livery icons rather than dropping back to black - if (m_settings.m_useLiveryIcons && QFile::exists(":/map/liveries/" + name)) { - return "liveries/" + name; - } - return name; -} - -// A position is timestamped when it was measured, an altitude when IT was measured, -// and on ADS-B those are different messages - a Mode S altitude reply carries no -// position. Pairing a fix with whatever altitude arrived most recently therefore states -// a height the aircraft had at some other moment. With the two most recent altitude -// observations bracketing the fix, the right value is a linear interpolation between -// them; outside that, the nearest is the best available and is used unchanged. -float AircraftTracker::altitudeAt(const TrackedAircraft *item, const QDateTime& when, float fallbackFt) -{ - if (!when.isValid() || !item->m_altitudeDateTime.isValid() - || !item->m_prevAltitudeDateTime.isValid()) - { - return fallbackFt; // Nothing timestamped to work from - } - const qint64 span = item->m_prevAltitudeDateTime.msecsTo(item->m_altitudeDateTime); - const qint64 offset = item->m_prevAltitudeDateTime.msecsTo(when); - if ((span <= 0) || (offset < 0) || (offset > span)) { - return fallbackFt; // Not between the two, so nothing to interpolate - } - const float t = (float) offset / (float) span; - return item->m_prevAltitudeFt + t * (item->m_altitudeFt - item->m_prevAltitudeFt); -} - -// How long a position stays believable, as a CZML availability interval. Without one an -// entity is available for ever, and on the 3D map that means its model and every texture -// the model carries stay resident until something explicitly deletes it - which was -// enough to exhaust GPU texture memory and lose the WebGL context on a busy sky. -// -// The window has to match how often the protocol that gave us the position actually -// reports. ADS-B is about once a second, so the demodulator's 61 seconds is right for -// it; a position that came from ACARS, VDL-2 or HFDL can be the only one for many -// minutes, and expiring it that fast would make the aircraft flicker. -// How long the position we hold stays believable. ADS-B reports about once a second, -// so a position a minute old means we have stopped hearing the aircraft; a position -// from ACARS, VDL-2 or HFDL may be the only one for many minutes and expiring it as -// fast would leave the aircraft off the map almost always. -int AircraftTracker::positionTimeoutSecs(const TrackedAircraft *item) const -{ - const int mins = (item->m_positionRank == PositionAdsb) ? m_settings.m_adsbPositionMins - : m_settings.m_acarsPositionMins; - // The extra second is the demodulator's, for CesiumGS/cesium#12426 - return (mins * 60) + 1; -} - -bool AircraftTracker::positionStale(const TrackedAircraft *item, const QDateTime& now) const -{ - return item->m_positionDateTime.isValid() - && (item->m_positionDateTime.secsTo(now) > positionTimeoutSecs(item)); -} - -QDateTime AircraftTracker::mapAvailableUntil(const TrackedAircraft *item) const -{ - if (!item->m_positionDateTime.isValid()) { - return QDateTime(); - } - return item->m_positionDateTime.addSecs(positionTimeoutSecs(item)); -} - -// The whole collated track, so it survives gaps between protocols. Each -// coordinate must carry its time - the Map dereferences it unconditionally. -// Selecting one of an aircraft's past flights draws that flight's track instead of the -// one it is on now. The icon is left where the aircraft actually is - the track is -// history, the aircraft is not -const AircraftTracker::TrackedFlight *AircraftTracker::trackFlight(const TrackedAircraft *item) const -{ - if (m_watchedFlight != 0) - { - for (const TrackedFlight *flight : item->m_flights) - { - if (flight->m_id == m_watchedFlight) { - return flight; - } - } - } - return item->m_currentFlight; -} - -QList *AircraftTracker::buildTrack(const TrackedFlight *flight) const -{ - QList *track = new QList(); - if (!flight) { - return track; // An empty list, not null: null means "unchanged" to the Map - } - for (int i = 0; i < flight->m_track.size(); i++) - { - SWGSDRangel::SWGMapCoordinate *coord = new SWGSDRangel::SWGMapCoordinate(); - coord->setLatitude(flight->m_track[i].latitude()); - coord->setLongitude(flight->m_track[i].longitude()); - coord->setAltitude(flight->m_track[i].altitude()); - // WithMs, not Qt::ISODate: that is whole seconds, and two positions in the - // same second then reach the Map with identical times - which the Map's - // Whittaker-Eilers smoother divides by, giving inf and then nan - coord->setDateTime(new QString(flight->m_trackTimes[i].toString(Qt::ISODateWithMs))); - track->append(coord); - } - return track; -} - -void AircraftTracker::sendToMap(TrackedAircraft *item) -{ - // The Map shows what we are currently hearing. Archived aircraft are taken off it - // by setActive(), and must not be put back by any other path - nor may an aircraft - // whose position has gone stale, which keeps sending messages that carry no new one - if (!item->m_active || positionStale(item, QDateTime::currentDateTime())) { - return; - } - - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - - if (mapPipes.size() == 0) { - return; - } - - // When the name upgrades (a logon revealed the airframe), the old item is - // removed and the full track continues under the new name - QString name = mapItemName(item); - if (name.isEmpty()) { - return; - } - if (!item->m_mapName.isEmpty() && (item->m_mapName != name)) { - removeFromMap(item->m_mapName); - } - // Rebuilding the whole track for every report is expensive, so it is only - // sent when it has changed; the Map keeps its stored track otherwise - bool sendTrack = item->m_mapTrackChanged || (item->m_mapName != name); - item->m_mapName = name; - - const AircraftInformation *info = - (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) - ? m_aircraftInfo->value(item->m_registration) : nullptr; - - QStringList text; - // The same picture header the ADS-B demodulator puts on its popups - a side view of - // the type in the operator's livery, or failing that the airline's logo, beside the - // country flag. An aircraft heard only on ACARS then reads the same as one heard on - // ADS-B, which is the point: the popup should not say which protocol found it. - if (info) - { - const QString sideview = AircraftInformation::resourcePathToURL( - AircraftInformation::getSideviewIconPath(info->m_registration, - info->m_operatorICAO, info->m_type)); - const QString airline = AircraftInformation::resourcePathToURL( - AircraftInformation::getAirlineIconPath(info->m_operatorICAO)); - const QString country = info->getFlag(); - const QString flag = country.isEmpty() - ? QString() : AircraftInformation::getFlagIconURL(country); - - if (!flag.isEmpty() && !sideview.isEmpty()) { - text.append(QString("
" - "
").arg(sideview).arg(flag)); - } else if (!flag.isEmpty() && !airline.isEmpty()) { - text.append(QString("
" - "
").arg(airline).arg(flag)); - } else if (!flag.isEmpty()) { - text.append(QString("").arg(flag)); - } else if (!sideview.isEmpty()) { - text.append(QString("").arg(sideview)); - } else if (!airline.isEmpty()) { - text.append(QString("").arg(airline)); - } - } - if (!item->m_registration.isEmpty()) { - text.append(QString("Reg: %1").arg(item->m_registration)); - } - if (!item->m_flight.isEmpty()) { - text.append(QString("Flight: %1").arg(item->m_flight)); - } - if (info) - { - QString type = info->m_model.isEmpty() ? info->m_type - : (info->m_type.isEmpty() ? info->m_model - : QString("%1 (%2)").arg(info->m_model).arg(info->m_type)); - if (!type.isEmpty()) { - text.append(QString("Type: %1").arg(type)); - } - } - if (!item->m_departure.isEmpty()) { - text.append(QString("From: %1").arg(item->m_departure)); - } - if (!item->m_arrival.isEmpty()) { - text.append(QString("To: %1").arg(item->m_arrival)); - } - if (!item->m_route.isEmpty()) { - text.append(QString("Route: %1").arg(item->m_route)); - } - // The flight's list, not the airframe's: the Map is about what is being heard - // now, and an airframe's all time list names protocols and frequencies it was heard - // on weeks ago and is not being heard on at all - QStringList sources = item->m_currentFlight - ? sourcesList(item->m_currentFlight->m_sources) : QStringList(); - if (sources.size() == 1) - { - text.append(QString("Heard on: %1").arg(sources[0])); - } - else if (!sources.isEmpty()) - { - text.append("Heard on:"); - text.append(sources); - } - // The most recent decoded message used to go on the end. An ACARS message is often - // twenty lines of free text, which made the popup unreadable and pushed everything - // above it off screen. It is in the feature's own Documents tab, which is where a - // whole message belongs. - - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(name)); - swgMapItem->setLatitude(item->m_latitude); - swgMapItem->setLongitude(item->m_longitude); - swgMapItem->setAltitude(item->m_altitudeValid ? Units::feetToMetres(item->m_altitudeFt) : 0.0f); - swgMapItem->setPositionDateTime(new QString(item->m_positionDateTime.toString(Qt::ISODateWithMs))); - const QDateTime until = mapAvailableUntil(item); - if (until.isValid()) { - swgMapItem->setAvailableUntil(new QString(until.toString(Qt::ISODateWithMs))); - } - if (item->m_altitudeDateTime.isValid()) { - swgMapItem->setAltitudeDateTime(new QString(item->m_altitudeDateTime.toString(Qt::ISODateWithMs))); - } - swgMapItem->setImage(new QString(QString("qrc:///map/%1").arg(aircraftImage(item)))); - if (item->m_headingValid) { - swgMapItem->setImageRotation((int) item->m_heading); - } - swgMapItem->setText(new QString(text.join("\n"))); - if (m_settings.m_atcLabels) { - swgMapItem->setLabel(new QString(atcLabel(item))); - } else { - swgMapItem->setLabel(new QString(item->m_flight.isEmpty() ? name : item->m_flight)); - } - if (sendTrack) { - swgMapItem->setTrack(buildTrack(trackFlight(item))); - } - - // Keep using the 3D model a pass-through provided, so the 3D map shows - // the model rather than falling back to a flat billboard of the icon - if (!item->m_model3D.isEmpty()) - { - swgMapItem->setModel(new QString(item->m_model3D)); - // Without these the model sits half underground: 0,0,0 is the middle of the - // model rather than the bottom of its undercarriage. They were never sent - // from here, so even a pass-through model was at the wrong height whenever - // this feature re-sent it. - swgMapItem->setModelAltitudeOffset(item->m_modelAltitudeOffset); - swgMapItem->setLabelAltitudeOffset(item->m_labelAltitudeOffset); - if (item->m_headingValid) - { - swgMapItem->setOrientation(1); - swgMapItem->setHeading(item->m_heading); - } - } - - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); - messageQueue->push(msg); - } - item->m_mapTrackChanged = false; -} - -// Forward a fully-built map item from a demodulator (the ADS-B pass-through, which -// carries the 3D model and full aircraft state for the Map's PFD) to the Map, -// renamed to this feature's naming and enriched with the collated track and route -// facts. Takes ownership of the item. -void AircraftTracker::forwardMapItem(TrackedAircraft *item, SWGSDRangel::SWGMapItem *swgMapItem) -{ - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - - QString name = mapItemName(item); - if ((mapPipes.size() == 0) || name.isEmpty() - || positionStale(item, QDateTime::currentDateTime())) - { - delete swgMapItem; - return; - } - if (!item->m_mapName.isEmpty() && (item->m_mapName != name)) { - removeFromMap(item->m_mapName); - } - // Rebuilding the whole track for every report is expensive, so it is only - // sent when it has changed; the Map keeps its stored track otherwise - bool sendTrack = item->m_mapTrackChanged || (item->m_mapName != name); - - // On the 3D map an entity shows either its model or a flat billboard of the - // 2D icon. When the pass-through brings a model to an aircraft first drawn - // without one, the item is removed and re-added so the stale billboard goes. - QString *model = swgMapItem->getModel(); - bool hasModel = (model != nullptr) && !model->isEmpty(); - if (hasModel) - { - if (!item->m_mapModelForm && (item->m_mapName == name)) - { - removeFromMap(name); - sendTrack = true; - } - item->m_model3D = *model; - // ... and what goes with it. Without these the item built here on the next quiet - // period, and the row written to the database, carry a zero offset or the offsets - // of whichever model this one replaced - so the aircraft sits at the wrong height - // as soon as the pass-through stops. - item->m_modelAltitudeOffset = swgMapItem->getModelAltitudeOffset(); - item->m_labelAltitudeOffset = swgMapItem->getLabelAltitudeOffset(); - item->m_modelIsOurs = false; - item->m_mapModelForm = true; - } - item->m_mapName = name; - item->m_mapResync = false; - m_mapResyncPending.remove(item); - - if (swgMapItem->getName()) { - *swgMapItem->getName() = name; - } else { - swgMapItem->setName(new QString(name)); - } - - // Both paths describe the same entity, so they must agree on how long it lives - const QDateTime until = mapAvailableUntil(item); - if (until.isValid()) - { - if (swgMapItem->getAvailableUntil()) { - *swgMapItem->getAvailableUntil() = until.toString(Qt::ISODateWithMs); - } else { - swgMapItem->setAvailableUntil(new QString(until.toString(Qt::ISODateWithMs))); - } - } - - // Add what other protocols have revealed to the popup - QStringList extra; - QString text = swgMapItem->getText() ? *swgMapItem->getText() : QString(); - if (!item->m_departure.isEmpty() && !text.contains(item->m_departure)) { - extra.append(QString("From: %1").arg(item->m_departure)); - } - if (!item->m_arrival.isEmpty() && !text.contains(item->m_arrival)) { - extra.append(QString("To: %1").arg(item->m_arrival)); - } - if (!item->m_route.isEmpty() && !text.contains(item->m_route)) { - extra.append(QString("Route: %1").arg(item->m_route)); - } - // The flight's list, for the same reason as in sendToMap() - QStringList sources = item->m_currentFlight - ? sourcesList(item->m_currentFlight->m_sources) : QStringList(); - if (sources.size() == 1) - { - extra.append(QString("Heard on: %1").arg(sources[0])); - } - else if (!sources.isEmpty()) - { - extra.append("Heard on:"); - extra.append(sources); - } - if (swgMapItem->getText()) { - swgMapItem->getText()->append("\n" + extra.join("\n")); - } else { - swgMapItem->setText(new QString(extra.join("\n"))); - } - - // The label is always ours, not the demodulator's: its own ATC labels - // setting would otherwise override this feature's on every update - QString label = m_settings.m_atcLabels ? atcLabel(item) - : (item->m_flight.isEmpty() ? name : item->m_flight); - if (swgMapItem->getLabel()) { - *swgMapItem->getLabel() = label; - } else { - swgMapItem->setLabel(new QString(label)); - } - - if (sendTrack) - { - swgMapItem->setTrack(buildTrack(trackFlight(item))); - item->m_mapTrackChanged = false; - } - - // Each message takes ownership of its item, so additional Map features get a - // copy - QList items; - items.append(swgMapItem); - for (int i = 1; i < mapPipes.size(); i++) - { - SWGSDRangel::SWGMapItem *copy = new SWGSDRangel::SWGMapItem(); - QJsonObject *json = swgMapItem->asJsonObject(); - copy->fromJsonObject(*json); - delete json; - items.append(copy); - } - for (int i = 0; i < mapPipes.size(); i++) - { - MessageQueue *messageQueue = qobject_cast(mapPipes[i]->m_element); - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, items[i]); - messageQueue->push(msg); - } -} - -// The furthest an aircraft has ever been heard, drawn at the position it was in when -// it set the record. Unlike everything else this feature puts on the Map this is not an -// aircraft that is flying now - it marks a place - so it is a fixed position with no -// track and no expiry, and it stays there until the record is beaten, the records are -// reset, or the option is turned off. -// -// Records set before version 3 of the statistics blob have no position stored, so the -// best record that CAN be drawn is used rather than the best overall - otherwise -// upgrading would leave the option doing nothing until the old record was beaten. -const char *AircraftTracker::RecordMapItemName = "Max range record"; - -void AircraftTracker::updateRecordMapItem() -{ - const AircraftStatistics::Record *best = nullptr; - int bestProtocol = -1; - - if (m_settings.m_displayMaxRangeOnMap) - { - // The record, not the furthest record that happens to be placeable. Skipping the - // unplaceable ones put a 301 km ACARS marker on the Map while the statistics - // table said the record was 7281 km on HFDL - two different answers to the same - // question, which is worse than no marker at all. - for (int i = 0; i < AircraftReport::ProtocolCount; i++) - { - const AircraftStatistics::Record& r = m_statistics.m_allTime.m_maxRange[i]; - if (r.m_valid && (!best || (r.m_value > best->m_value))) - { - best = &r; - bestProtocol = i; - } - } - } - - // A record set before the position was stored alongside it has nowhere to be drawn. - // Nothing is drawn until it is beaten, rather than something that contradicts the - // table - said once, since this is checked several times a second. - if (best && !best->m_positionValid) - { - if (!m_recordUnplaceableWarned) - { - qDebug() << "AircraftTracker: the maximum range record" << best->m_value - << "km, set by" << best->m_aircraft - << "on" << protocolName(bestProtocol) - << "- was set before positions were kept with records, so it cannot" - << "be drawn on the Map. It will appear once the record is beaten."; - m_recordUnplaceableWarned = true; - } - best = nullptr; - } - else if (best) { - m_recordUnplaceableWarned = false; - } - - if (!best) - { - if (m_recordOnMap) - { - removeFromMap(RecordMapItemName); - m_recordOnMap = false; - m_recordMapKey.clear(); - } - return; - } - - // flush() runs three times a second, and the record changes perhaps twice a day - const QString key = QString("%1|%2|%3|%4|%5") - .arg(best->m_aircraft) - .arg(best->m_value, 0, 'f', 3) - .arg(best->m_latitude, 0, 'f', 5) - .arg(best->m_longitude, 0, 'f', 5) - .arg(bestProtocol); - if (m_recordOnMap && (key == m_recordMapKey)) { - return; - } - - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - if (mapPipes.isEmpty()) { - return; // No Map open: try again when there is one - } - m_recordMapKey = key; - m_recordOnMap = true; - - // The record names the aircraft as its registration where it had one, otherwise its - // flight number - both of which the key map is built on, so the airframe can be found - // again where it is still tracked and its own icon used, livery and all. Where it is - // not, the type still comes from the registration, and the icon is the plain one in - // white rather than the black it used to be - which is the same fallback a tracked - // aircraft with no model match gets. - const TrackedAircraft *holder = m_byKey.value(regKey(best->m_aircraft), nullptr); - if (!holder) { - holder = m_byKey.value(flightKey(best->m_aircraft), nullptr); - } - const QString recordImage = holder ? aircraftImage(holder) - : aircraftImage(best->m_aircraft, QString()); - - QStringList text; - text.append(QString("Maximum range record")); - text.append(QString("Aircraft: %1").arg(best->m_aircraft)); - text.append(QString("Range: %1 km").arg(best->m_value, 0, 'f', 1)); - text.append(QString("Protocol: %1").arg(protocolName(bestProtocol))); - if (best->m_altitudeValid) { - text.append(QString("Altitude: %1 ft").arg((int) std::round(best->m_altitudeFt))); - } - if (best->m_when.isValid()) { - text.append(QString("When: %1").arg(best->m_when.toString("yyyy-MM-dd hh:mm:ss"))); - } - - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(RecordMapItemName)); - swgMapItem->setLatitude(best->m_latitude); - swgMapItem->setLongitude(best->m_longitude); - swgMapItem->setAltitude(best->m_altitudeValid - ? Units::feetToMetres(best->m_altitudeFt) : 0.0f); - swgMapItem->setFixedPosition(1); - swgMapItem->setImage(new QString(QString("qrc:///map/%1").arg(recordImage))); - swgMapItem->setLabel(new QString(QString("%1 %2 km") - .arg(best->m_aircraft).arg(best->m_value, 0, 'f', 0))); - swgMapItem->setText(new QString(text.join("\n"))); - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); - messageQueue->push(msg); - } -} - -// Place the points of a filed route, dropping any that cannot be placed. -// -// A position the message itself gave is used in preference to anything else: a route -// insert places most of its fixes, which settles which of two identically named fixes -// was meant and covers fixes no database here holds. Failing that the name is looked up -// - airports are four characters, waypoints five, VOR and NDB idents three, and an -// oceanic position seven (5530N, i.e. 55 North 030 West), the same rules the ACARS -// demodulator applied to an oceanic clearance, since a route is written the same way. -// -// EVERY coordinate is given an altitude. QGeoCoordinate's two argument constructor -// leaves altitude as qQNaN() while still reporting isValid(), and Qt writes a non-finite -// double into the Map's CZML as null, which Cesium rejects outright - taking down the -// whole 3D map rather than misplacing one route. -void AircraftTracker::resolveRoute(QList& points, - QList& coords) const -{ - // A route names the airways between its fixes as well as the fixes: "BPK Q295 PAAVO - // M604 GIVPO". An airway is a letter or two and then digits, which no fix ident is, - // so this is what keeps Q295 from being looked up as an airport and drawn as one. - static const QRegularExpression airwayRe("^[A-Z]{1,2}[0-9]{1,4}$"); - // 5530N is 55 North 030 West - static const QRegularExpression oceanicRe("^([0-9][0-9])([NS])([0-9]?[0-9][0-9])([EW])$"); - - QMutableListIterator i(points); - while (i.hasNext()) - { - const AircraftReport::RouteWaypoint& point = i.next(); - const QString name = point.m_name; - - if (point.m_positionValid) - { - coords.append(QGeoCoordinate(point.m_latitude, point.m_longitude, 0.0)); - continue; - } - - bool found = false; - if (!airwayRe.match(name).hasMatch()) - { - if ((name.size() == 4) && m_airports) - { - const AirportInformation *airport = m_airports->value(name, nullptr); - if (airport) - { - found = true; - coords.append(QGeoCoordinate(airport->m_latitude, airport->m_longitude, 0.0)); - } - } - else if (name.size() == 5) - { - const Waypoint *waypoint = Waypoints::findWayPoint(name); - if (waypoint) - { - found = true; - coords.append(QGeoCoordinate(waypoint->m_latitude, waypoint->m_longitude, 0.0)); - } - } - else if ((name.size() == 3) && m_navAids) - { - for (int j = 0; j < m_navAids->size(); j++) - { - if (m_navAids->at(j)->m_ident == name) - { - const NavAid *navAid = m_navAids->at(j); - found = true; - coords.append(QGeoCoordinate(navAid->m_latitude, navAid->m_longitude, 0.0)); - break; // Idents are not globally unique; take the first - } - } - } - else if (name.size() == 7) - { - const QRegularExpressionMatch match = oceanicRe.match(name); - if (match.hasMatch()) - { - float latitude = match.captured(1).toInt(); - if (match.captured(2) == "S") { - latitude = -latitude; - } - float longitude = match.captured(3).toInt(); - if (match.captured(4) == "W") { - longitude = -longitude; - } - found = true; - coords.append(QGeoCoordinate(latitude, longitude, 0.0)); - } - } - } - - if (!found) { - i.remove(); - } - } -} - -// A route the aircraft has been given - a filed flight plan or an oceanic clearance - -// drawn on the Map as a line through the waypoints with a marker at each one. This used -// to live in the ACARS demodulator, for clearances only; it is here now so that both -// kinds are drawn the same way, and so that a route revealed by any protocol is drawn once -// however many demodulators heard it. -// -// The kind is part of every item name, so a flight with both a plan and a clearance -// shows both: the Map keys its items on the name, and identical names would have one -// quietly replacing the other. -// -// Not removed when the flight is archived, which is how clearances have always behaved: -// the route is a record of where the aircraft was going, and that stays interesting -// after it has landed. -void AircraftTracker::sendRouteToMap(TrackedFlight *flight, TrackedFlight::FiledRoute& route, - const QString& kind) -{ - if (route.m_waypoints.isEmpty()) { - route.m_pending = false; - return; - } - - // Nothing can be drawn until the flight has a name, since that is what the Map keys - // its items on - and on most protocols the route arrives before the identity does, - // an oceanic clearance naming the flight in a message the registration follows. - // This used to be tested AFTER the route was marked drawn, so a route filed before - // the identity was known was recorded as drawn and then never sent at all. - const QString name = flight->m_flight.isEmpty() - ? (flight->m_aircraft ? flight->m_aircraft->m_registration : QString()) : flight->m_flight; - // Both of the reasons a route cannot go out yet are things nothing tells the flight - // about when they change - the Map being opened, the identity arriving - so the - // route is remembered and retried from the flush timer. Without that, opening the - // Map after a clearance had been received left the route undrawn until another - // route-bearing message happened along, which on an oceanic flight can be an hour. - if (name.isEmpty()) - { - route.m_pending = true; - m_routesPending.insert(flight->m_id); - return; - } - - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - if (mapPipes.isEmpty()) - { - route.m_pending = true; - m_routesPending.insert(flight->m_id); - return; - } - route.m_pending = false; - - // The route field is the waypoints alone, so the airports it runs between are added - // here - which is what makes the drawn line start and finish somewhere recognisable - QList points; - // Not "name": that is the flight's, just above, and shadowing it here would read - // as though the route were being built out of it - auto named = [](const QString& waypoint) - { - AircraftReport::RouteWaypoint point; - point.m_name = waypoint; - return point; - }; - if (flight->m_departure.size() == 4) { - points.append(named(flight->m_departure)); - } - // The message's own positions where it gave them, its names alone where it did not - if (route.m_points.isEmpty()) - { - for (const QString& waypoint : route.m_waypoints.split(" ", Qt::SkipEmptyParts)) { - points.append(named(waypoint)); - } - } - else - { - points.append(route.m_points); - } - if (flight->m_arrival.size() == 4) { - points.append(named(flight->m_arrival)); - } - - QList coords; - resolveRoute(points, coords); - QStringList names; - for (const AircraftReport::RouteWaypoint& point : points) { - names.append(point.m_name); - } - // One resolvable point is not a route, and drawing a line through it draws nothing. - // Not pending: only a fuller message can change this, and that calls back in here. - if (coords.size() < 2) - { - // A route that has been re-filed onto waypoints we cannot place is still a - // different route from the one on the Map, so what is drawn there is now wrong. - // Returning without saying so left the previous line and its markers up. - removeDrawnRoute(route); - return; - } - - // What would actually be drawn, rather than the waypoint list it came from. Keying - // on the waypoints alone meant a route was drawn once and then never corrected, - // where everything else about it improves after the first filing: the departure and - // arrival airports that bookend the line arrive in a later message, a waypoint that - // could not be placed at first is placed once the aircraft names it with its - // position, and the text is fuller once the whole message has been reassembled. - QStringList signature; - signature.append(name); - signature.append(flight->m_departure); - signature.append(flight->m_arrival); - signature.append(route.m_text); - for (int i = 0; i < names.size(); i++) - { - signature.append(QString("%1@%2,%3").arg(names[i]) - .arg(coords[i].latitude(), 0, 'f', 5).arg(coords[i].longitude(), 0, 'f', 5)); - } - const QString drawn = signature.join(QChar(0x1f)); - if (drawn == route.m_drawn) { - return; - } - - // The Map keys its items on the name, and both the flight's name and the list of - // waypoints can change between drawings - a registration gives way to the callsign - // once it is known, and a re-filed route can be shorter than the one before it. What - // was drawn last time and will not be drawn this time has to be taken off by name, - // or the old line stays beside the new one and dropped waypoints stay on the map for - // the rest of the session. - const QString lineName = QString("%1 %2").arg(name).arg(kind); - QStringList waypointNames; - for (const QString& waypoint : names) { - waypointNames.append(QString("%1 %2 %3").arg(name).arg(kind).arg(waypoint)); - } - if (!route.m_drawnLine.isEmpty() && (route.m_drawnLine != lineName)) { - removeFromMap(route.m_drawnLine); - } - for (const QString& previous : route.m_drawnWaypoints) - { - if (!waypointNames.contains(previous)) { - removeFromMap(previous); - } - } - - QStringList text; - text.append(kind); - text.append(QString("Flight: %1").arg(name)); - if (!flight->m_departure.isEmpty() && !flight->m_arrival.isEmpty()) { - text.append(QString("Route: %1 to %2").arg(flight->m_departure).arg(flight->m_arrival)); - } - text.append("Waypoints: " + names.join(" ")); - // The message itself, which is where the clearance number, entry time, flight level - // and Mach are. The demodulator used to repeat those on every waypoint; one copy on - // the route says the same thing without covering the map in it. - if (!route.m_text.isEmpty()) - { - text.append(QString()); - text.append(route.m_text); - } - - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(lineName)); - swgMapItem->setLabel(new QString(name)); - swgMapItem->setText(new QString(text.join("\n"))); - swgMapItem->setLatitude(coords[0].latitude()); - swgMapItem->setLongitude(coords[0].longitude()); - swgMapItem->setAltitude(coords[0].altitude()); - swgMapItem->setImage(new QString("none")); - swgMapItem->setImageRotation(0); - swgMapItem->setFixedPosition(true); - swgMapItem->setAltitudeReference(3); // 1 - CLAMP_TO_GROUND, 3 - CLIP_TO_GROUND - - QList *line = new QList(); - for (const auto& coord : coords) - { - SWGSDRangel::SWGMapCoordinate *c = new SWGSDRangel::SWGMapCoordinate(); - c->setLatitude(coord.latitude()); - c->setLongitude(coord.longitude()); - c->setAltitude(coord.altitude()); - line->append(c); - } - swgMapItem->setCoordinates(line); - swgMapItem->setType(3); // Line - - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); - messageQueue->push(msg); - - // The waypoints themselves. The Map does not draw its own waypoint layer across - // the whole globe, and shows it only when zoomed well in, so the points of a - // route have to be sent explicitly to be visible with the line. - for (int i = 0; i < names.size(); i++) - { - swgMapItem = new SWGSDRangel::SWGMapItem(); - // Not the name the Map uses for the waypoint itself, which would replace it - swgMapItem->setName(new QString(waypointNames[i])); - swgMapItem->setLabel(new QString(names[i])); - - QStringList waypointText; - waypointText.append(QString("%1 waypoint").arg(kind)); - waypointText.append(QString("Flight: %1").arg(name)); - waypointText.append(QString("Waypoint: %1").arg(names[i])); - swgMapItem->setText(new QString(waypointText.join("\n"))); - - swgMapItem->setLatitude(coords[i].latitude()); - swgMapItem->setLongitude(coords[i].longitude()); - swgMapItem->setAltitude(coords[i].altitude()); - swgMapItem->setImage(new QString("waypoint.png")); - swgMapItem->setImageRotation(0); - swgMapItem->setFixedPosition(true); - swgMapItem->setAltitudeReference(3); - - msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); - messageQueue->push(msg); - } - } - - // Only once it has gone out. Marking it before anything had been sent is what let a - // route be recorded as drawn and then dropped. - route.m_drawn = drawn; - route.m_drawnLine = lineName; - route.m_drawnWaypoints = waypointNames; - route.m_pending = false; - if (!flight->m_flightPlan.m_pending && !flight->m_clearance.m_pending) { - m_routesPending.remove(flight->m_id); - } -} - -// Take a route off the Map, by the names it was drawn under. Only what was actually -// emitted is removed, so this cannot disturb another route that happens to share a name. -void AircraftTracker::removeDrawnRoute(TrackedFlight::FiledRoute& route) -{ - if (route.m_drawnLine.isEmpty() && route.m_drawnWaypoints.isEmpty()) { - return; - } - if (!route.m_drawnLine.isEmpty()) { - removeFromMap(route.m_drawnLine); - } - for (const QString& waypoint : route.m_drawnWaypoints) { - removeFromMap(waypoint); - } - route.m_drawnLine.clear(); - route.m_drawnWaypoints.clear(); - route.m_drawn.clear(); -} - -// Everything this feature draws is sent once and then only when it changes, which is -// what keeps a busy sky affordable - but it means a Map opened later, or closed and -// opened again, starts from nothing and is only ever told about changes. So when the -// number of Maps listening goes up, everything is offered again: the tracks, the routes -// and the record marker. Aircraft positions need no help, being re-sent as they arrive. -void AircraftTracker::checkMapConsumers() -{ - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - - QSet consumers; - bool arrived = false; - for (const ObjectPipe *pipe : mapPipes) - { - consumers.insert(pipe->m_pipeId); - if (!m_mapConsumers.contains(pipe->m_pipeId)) { - arrived = true; - } - } - m_mapConsumers = consumers; - if (!arrived) { - return; // The same Maps, which have what they need - } - - for (TrackedAircraft *item : m_aircraft) - { - if (item->m_active) - { - item->m_mapTrackChanged = true; - item->m_mapName.clear(); // Draw it again rather than assuming it is there - // Held until it has actually been sent. A pass-through aircraft whose ADS-B - // has gone quiet is skipped by flush() for a minute after its last item, and - // the dirty set is cleared either way - so without this the aircraft would - // simply never reach the new Map. - item->m_mapResync = true; - m_mapResyncPending.insert(item); - m_dirtyAircraft.insert(item); - } - - // Routes are drawn for archived aircraft too - they are a record of where the - // aircraft was going, and are deliberately left up - so unlike the aircraft - // itself they are re-sent whether or not it is still being heard - for (TrackedFlight *flight : item->m_flights) - { - for (TrackedFlight::FiledRoute *route : { &flight->m_flightPlan, &flight->m_clearance }) - { - if (!route->m_waypoints.isEmpty()) - { - // Not removeDrawnRoute(): the items are still on the Maps that - // already had them, and re-sending replaces them by name - route->m_drawn.clear(); - route->m_pending = true; - m_routesPending.insert(flight->m_id); - } - } - } - } - - // Sent again for the same reason, and by the same means: forget what was last drawn - m_recordMapKey.clear(); - m_recordOnMap = false; -} - -// A route held back for want of a Map to draw it on, or a name to draw it under. Neither -// is signalled, so this is polled - but only past the two tests that are cheap, so the -// expensive part, resolving each waypoint against the databases, is reached only when the -// route could actually be delivered. -void AircraftTracker::retryRoutes() -{ - if (m_routesPending.isEmpty()) { - return; - } - - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - if (mapPipes.isEmpty()) { - return; - } - - const QSet pending = m_routesPending; - for (quint64 id : pending) - { - TrackedFlight *flight = flightById(id); - if (!flight) - { - m_routesPending.remove(id); // Deleted, or merged into another flight - continue; - } - sendRouteToMap(flight, flight->m_flightPlan, "Flight plan"); - sendRouteToMap(flight, flight->m_clearance, "Oceanic clearance"); - if (!flight->m_flightPlan.m_pending && !flight->m_clearance.m_pending) { - m_routesPending.remove(id); - } - } -} - -void AircraftTracker::removeFromMap(const QString& name) -{ - QList mapPipes; - MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); - - for (const auto& pipe : mapPipes) - { - MessageQueue *messageQueue = qobject_cast(pipe->m_element); - SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); - swgMapItem->setName(new QString(name)); - swgMapItem->setImage(new QString("")); // An empty image removes the item - MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); - messageQueue->push(msg); - } -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "SWGMapItem.h" +#include "SWGMapCoordinate.h" +#include "SWGMapAnimation.h" + +#include "feature/feature.h" +#include "maincore.h" +#include "util/units.h" +#include "util/acarstextformat.h" + +#include "util/airlines.h" +#include "util/sidstar.h" +#include "channel/channelwebapiutils.h" +#include "util/aircraft3dmodels.h" +#include "util/aircraftenginesound.h" +#include "util/selcaldb.h" + +#include "aircrafttracker.h" + +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgConfigureTracker, Message) +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgSelect, Message) +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgReport, Message) + +AircraftTracker::MsgReport::~MsgReport() +{ + delete m_report.m_mapItem; +} +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgDeleteAll, Message) +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgAcarsBlock, Message) +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgResetStatistics, Message) +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgResync, Message) +MESSAGE_CLASS_DEFINITION(AircraftTracker::MsgWatchFlight, Message) + +AircraftTracker::AircraftTracker(Feature *feature) : + m_feature(feature) +{ + qRegisterMetaType("AircraftDisplay"); + qRegisterMetaType("FlightDisplay"); + qRegisterMetaType("DocumentEvent"); + qRegisterMetaType("AtcEvent"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType("WeatherEvent"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + + for (int i = 0; i < CHART_COUNTS; i++) { + m_chartCounts[i] = 0; + } + + connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &AircraftTracker::handleInputMessages); +} + +AircraftTracker::~AircraftTracker() +{ + saveDatabase(); + closeDatabase(); + qDeleteAll(m_aircraft); +} + +// Runs on the tracker thread once it starts +void AircraftTracker::startWork() +{ + // As in the ADS-B tracker: get the shared 3D model tables built off the critical path + Aircraft3DModels::instance(); + + m_statistics.m_sessionStart = QDateTime::currentDateTime(); + m_statistics.m_session = AircraftStatistics::Scope(); + m_allTimeSince = m_statistics.m_sessionStart; + m_sessionHeard.clear(); + m_sessionRecorded.clear(); + + m_aircraftInfo = OsnDB::getAircraftInformationByReg(); + m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); + m_routeInfo = OsnDB::getAircraftRouteInformation(); + m_selcalCodes = SELCALDB::getCodesByRegistration(); + m_navAids = OpenAIP::getNavAids(); + m_airports = OurAirportsDB::getAirportsByIdent(); + // The ACARS parser resolves ICAO codes to airport names through a table of its own, + // which the demodulator fills in when IT starts. Documents are re-rendered here, at + // load, which happens before any demodulator has run and would happen even with none + // present - so without this every re-rendered document would read EGLL where it once + // read EGLL (London Heathrow Airport). Through the library's once-only initialiser, + // never by assignment: ACARS demodulator workers read and set the same global from + // their own threads, and QSharedPointer assignment is not atomic. + acarsInitAirportInfo(); + m_waypoints = Waypoints::getWaypoints(); + + // On this thread, not in the constructor: a socket belongs to the thread that + // created it, and everything that touches these runs here + m_feedSocket = new QUdpSocket(this); + m_feedAirframesTcpSocket = new QTcpSocket(this); + m_feedAvdelphiTcpSocket = new QTcpSocket(this); + updateFeedConnections(); + + m_flushTimer = new QTimer(this); + connect(m_flushTimer, &QTimer::timeout, this, &AircraftTracker::flush); + m_flushTimer->start(300); + + m_removalTimer = new QTimer(this); + connect(m_removalTimer, &QTimer::timeout, this, &AircraftTracker::removeOldAircraft); + m_removalTimer->start(60*1000); + + m_chartTimer = new QTimer(this); + connect(m_chartTimer, &QTimer::timeout, this, &AircraftTracker::updateChartCounts); + m_chartTimer->start(10*1000); + m_chartRateTime = QDateTime::currentDateTime(); + + if (openDatabase()) + { + // Brings the all time records and the airframe count with it - see loadDatabase() + loadDatabase(); + } +} + +void AircraftTracker::handleInputMessages() +{ + Message* message; + while ((message = m_inputMessageQueue.pop())) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +bool AircraftTracker::handleMessage(const Message& message) +{ + if (MsgReport::match(message)) + { + MsgReport& report = (MsgReport&) message; + processReport(report.getReport()); + return true; + } + else if (MsgConfigureTracker::match(message)) + { + const MsgConfigureTracker& cfg = (const MsgConfigureTracker&) message; + applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce()); + return true; + } + else if (MsgAcarsBlock::match(message)) + { + const MsgAcarsBlock& block = (const MsgAcarsBlock&) message; + acarsBlockReceived(block.getBlock(), block.getDateTime(), block.getFrequency(), + block.getLevel(), block.getProtocol()); + return true; + } + else if (MsgDeleteAll::match(message)) + { + deleteAll(); + // Straight to disk rather than waiting for the periodic save. Nothing is left in + // memory to lose, the user has just asked for everything to go, and until the + // save runs the database still holds all of it - so the size the statistics + // report would be unchanged, and closing SDRangel in between would bring it all + // back. Not inside deleteAll(): that is also how changing database clears the + // old session out of memory, and saving there would write the emptied state over + // the database being left behind. + if (m_db && !m_loadingDatabase) { + saveDatabase(); + } + return true; + } + else if (MsgSelect::match(message)) + { + MsgSelect& msg = (MsgSelect&) message; + // Straight through to the GUI: what is selected is a property of the tables, + // which live there + emit selectRequested((int) msg.getKind(), msg.getValue()); + return true; + } + else if (MsgResetStatistics::match(message)) + { + MsgResetStatistics& msg = (MsgResetStatistics&) message; + if (msg.getAllTime()) + { + m_statistics.m_allTime = AircraftStatistics::Scope(); + m_statistics.m_firstStart = QDateTime::currentDateTime(); + m_allTimeSecondsBase = 0; + m_allTimeSince = m_statistics.m_firstStart; + // Without this the aircraft count would come straight back, since it is + // counted from the table rather than held as a number + resetSeen(); + // Anything heard since the reset still belongs to the new all time figures, + // so let this session's airframes be counted again + m_sessionRecorded.clear(); + // The records are rows now, so clearing them in memory is only half of it. + // saveStatistics() writes only valid records, so the next save empties the + // table; without the dirty flag that save might not happen at all. + m_dbDirty = true; + m_recordMapState = RecordUnreported; + } + else + { + m_statistics.m_session = AircraftStatistics::Scope(); + m_statistics.m_sessionStart = QDateTime::currentDateTime(); + m_sessionHeard.clear(); + } + m_statisticsDirty = true; + return true; + } + else if (MsgResync::match(message)) + { + resync(); + return true; + } + else if (MsgWatchFlight::match(message)) + { + const MsgWatchFlight& watch = (const MsgWatchFlight&) message; + TrackedFlight *previous = flightById(m_watchedFlight); + m_watchedFlight = watch.getFlightId(); + TrackedFlight *flight = flightById(m_watchedFlight); + // The map draws the watched flight's track rather than the current one, so both + // the aircraft that is no longer watched and the one now watched need theirs sent + for (TrackedFlight *f : { previous, flight }) + { + if (f && f->m_aircraft) + { + f->m_aircraft->m_mapTrackChanged = true; + m_dirtyAircraft.insert(f->m_aircraft); + } + } + // The routes follow the selection, so the flight being left has its taken off + // the map and the one now selected has its put on + if (previous != flight) + { + removeRoutes(previous); + sendRoutes(flight); + } + if (flight) { + emitProfile(flight); + } + return true; + } + return false; +} + +void AircraftTracker::applySettings(const AircraftSettings& settings, const QList& settingsKeys, bool force) +{ + bool atcLabelsChanged = settingsKeys.contains("atcLabels") && (settings.m_atcLabels != m_settings.m_atcLabels); + // The callsign style is part of the label too - atcLabel() writes the flight through + // flightLabel(), which is what turns BAW123 into SPEEDBIRD 123 - so switching it has + // to refresh the Map for exactly the same reason toggling the ATC button does + bool atcCallsignsChanged = settingsKeys.contains("atcCallsigns") + && (settings.m_atcCallsigns != m_settings.m_atcCallsigns); + bool liveryChanged = settingsKeys.contains("favourLivery") + && (settings.m_favourLivery != m_settings.m_favourLivery); + // The icon is part of the map item, so switching icon styles has to refresh the Map + // just like a label change does + bool liveryIconsChanged = settingsKeys.contains("useLiveryIcons") + && (settings.m_useLiveryIcons != m_settings.m_useLiveryIcons); + // A forced configuration replaces the settings wholesale and may carry no key list + // at all, which is how a preset arrives - and the database is opened in startWork() + // before that happens, on the default path. Comparing the values rather than trusting + // the key list is what lets a preset's own database be opened. + bool databaseChanged = (force || settingsKeys.contains("databaseFilename")) + && (settings.m_databaseFilename != m_settings.m_databaseFilename); + QString oldDatabasePath = databaseChanged ? databasePath(m_settings) : QString(); + + const bool statisticsArrived = settingsKeys.contains("statistics") || force; + // Which rule fired for an aircraft is remembered by its INDEX in the list, so + // editing the list silently changes what those indices mean: a new rule that lands + // on the index of one that has already fired would never fire itself. Compared by + // content rather than by the key list, because a forced configuration carries no + // keys at all, and re-firing every rule on an unchanged preset load would be its own + // bug - the aircraft would all announce themselves again. + const QString notificationsBefore = notificationSignature(m_settings); + const bool coverageWasShown = m_settings.m_displayCoverage; + if (force) { + m_settings = settings; + } else { + m_settings.applySettings(settingsKeys, settings); + } + // Drawn or taken off the Map as the button is toggled. Sent from here rather than + // waiting for the next flush, so the map responds to the click rather than to the + // next aircraft heard - which on a quiet band can be minutes. + if (m_settings.m_displayCoverage != coverageWasShown) + { + if (m_settings.m_displayCoverage) { + sendCoverageToMap(); + } else { + removeCoverageFromMap(); + } + } + if (notificationSignature(m_settings) != notificationsBefore) + { + for (TrackedAircraft *item : m_aircraft) { + item->m_notifiedRules.clear(); + } + } + + // A changed host invalidates the cached DNS resolution, or the feed would keep + // sending to the address it looked up for the previous one + m_feedAirframesResolvedHost.clear(); + m_feedAvdelphiResolvedHost.clear(); + updateFeedConnections(); + + // The records live in the database now. A preset written before that still carries + // them, so they are imported once - only when the database had none, which is what + // loadStatistics() reports through m_statisticsLoaded. After the next save they are + // in the database and the blob is never read again. + const bool resetRequested = settingsKeys.contains("statistics") + && settings.m_statistics.isEmpty(); + // Wait for a blob with something in it. The GUI's constructor forces a configuration + // through with default settings BEFORE the framework calls deserialize(), so keying + // this on "the first settings to arrive" consumed the one chance to load on an empty + // blob, and the stored records were then never read - the all time figures started + // again from nothing on every launch. + const bool haveStored = !m_settings.m_statistics.isEmpty(); + if (statisticsArrived && ((!m_statisticsLoaded && haveStored) || resetRequested)) + { + m_statisticsLoaded = haveStored; + if (haveStored) { + qDebug() << "AircraftTracker: importing the all time statistics from the preset" + << "into the session database, which is where they live now"; + } + AircraftStatistics stored = deserializeStatistics(m_settings.m_statistics); + // Only the all time side is stored, so keep everything this session has counted + stored.m_session = m_statistics.m_session; + stored.m_sessionStart = m_statistics.m_sessionStart; + if (!stored.m_firstStart.isValid()) + { + // Nothing stored: either this is the first run, or a reset has just set the + // moment the all time figures start from, which must not be discarded here + stored.m_firstStart = m_statistics.m_firstStart.isValid() + ? m_statistics.m_firstStart : m_statistics.m_sessionStart; + } + m_allTimeSecondsBase = stored.m_allTime.m_seconds; + m_allTimeSince = (m_allTimeSecondsBase == 0) && m_statistics.m_firstStart.isValid() + ? m_statistics.m_firstStart : m_statistics.m_sessionStart; + // The aircraft count is the one figure the blob cannot hold - see the note on + // AircraftStatistics. It comes from the database, which may not be open yet on + // the first pass, in which case the next flush picks it up + stored.m_allTime.m_distinctAircraft = seenCount(); + m_statistics = stored; + m_statisticsDirty = true; + m_dbDirty = true; // So the import is written out + } + + if (databaseChanged) { + changeDatabase(oldDatabasePath); + } + + // Refresh the labels of aircraft already on the Map. Only active aircraft are on + // it, so archived ones must not be sent here - that would put the whole history + // back on the Map every time settings are applied. + // + // Pass-through aircraft are included, which flush() deliberately does NOT do. The + // reasoning that holds there does not hold here. flush() runs on every report, and + // a basic item built by this feature would keep replacing the richer one ADS-B is + // sending, so while ADS-B is talking it stands back. This is a one-off refresh after + // the user toggled a setting, and skipping pass-through aircraft on the assumption + // that "their next ADS-B report will relabel them" is only true for aircraft ADS-B + // is STILL hearing. One that went quiet a few seconds ago gets skipped here and + // never receives another report, so its label stayed stale indefinitely - which is + // exactly the reported symptom of only some labels changing. + // + // The cost is small and self-correcting: an aircraft ADS-B is actively sending gets + // a plainer popup for one update, restored on its next report a fraction of a second + // later. The icon, the heading and the 3D model are all preserved, because + // sendToMap() re-sends the model remembered from the pass-through. + // Choosing again is only meaningful for models we picked ourselves; a pass-through + // model belongs to the demodulator, which will send its own next report anyway + if (liveryChanged) + { + for (TrackedAircraft *item : m_aircraft) + { + if (item->m_modelIsOurs) + { + item->m_model3D = ""; + item->m_modelIsOurs = false; + update3DModel(item); + } + } + } + + if (atcLabelsChanged || atcCallsignsChanged || liveryChanged || liveryIconsChanged || force) + { + for (TrackedAircraft *item : m_aircraft) + { + if (item->m_active && item->m_positionValid) { + sendToMap(item); + } + } + } +} + +QString AircraftTracker::regFor(const TrackedAircraft *item) const +{ + return !item->m_registration.isEmpty() ? item->m_registration + : (item->m_icao ? QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper() : QString()); +} + +// Identity keys are namespaced so an ICAO hex string can never collide with a +// registration or a flight number +static QString icaoKey(quint32 icao) { return QString("I%1").arg(icao, 6, 16, QChar('0')); } +static QString regKey(const QString& reg) { return "R" + reg; } +static QString flightKey(const QString& flight) { return "F" + flight; } + +// Give an identity to this aircraft, folding in any other record that already held it. +// A registration and an ICAO address each belong to exactly one airframe, so two records +// answering to the same one ARE the same airframe - an ACARS registration-only record and +// an ADS-B ICAO-only record, tied together the moment a message carries both. The key was +// simply re-pointed at the survivor before, leaving the other record in the list holding +// its flights, documents and messages, and unreachable by any key. +// +// Deliberately not used for a flight number, which is not an identity: it is reused day +// after day and by different airframes, and the caller has its own narrower rule for it. +void AircraftTracker::claimKey(TrackedAircraft *item, const QString& key) +{ + TrackedAircraft *other = m_byKey.value(key); + if (other && (other != item)) { + absorbAircraft(item, other); + } + m_byKey.insert(key, item); + // The identity has just strengthened, so what it is recognised by in the all time + // table may have changed with it - see recordSeen() + m_sessionRecorded.remove(item->m_id); +} + +// A flight key stays registered for as long as the aircraft does, so asking when the +// AIRCRAFT was last heard says nothing about the callsign: an airframe heard a minute ago +// under today's callsign would keep every historical one it has ever flown looking just +// as fresh, and claim a report belonging to whoever is flying that number now. +QDateTime AircraftTracker::flightLastSeen(const TrackedAircraft *item, const QString& flight) +{ + QDateTime when; + for (const TrackedFlight *f : item->m_flights) + { + if (!flightMatches(f, flight) || !f->m_lastSeen.isValid()) { + continue; + } + if (!when.isValid() || (f->m_lastSeen > when)) { + when = f->m_lastSeen; + } + } + return when; +} + +// Two flights of one airframe are the same operation when their times overlap, or when +// the gap between them is short enough that the aircraft never went away. The archive +// timeout is that boundary at run time - a gap longer than it starts a new flight - and +// using it here as well is what keeps a reload from rejoining what a session split. +bool AircraftTracker::sameOperation(const TrackedFlight *a, const TrackedFlight *b) const +{ + if (!a->m_firstSeen.isValid() || !a->m_lastSeen.isValid() + || !b->m_firstSeen.isValid() || !b->m_lastSeen.isValid()) + { + return true; // Nothing to separate them by, so behave as before + } + if ((a->m_firstSeen <= b->m_lastSeen) && (b->m_firstSeen <= a->m_lastSeen)) { + return true; // Overlapping + } + const qint64 gap = (a->m_lastSeen < b->m_firstSeen) + ? a->m_lastSeen.secsTo(b->m_firstSeen) : b->m_lastSeen.secsTo(a->m_firstSeen); + return gap <= (qint64) m_settings.m_removalMins * 60; +} + +AircraftTracker::TrackedAircraft *AircraftTracker::findOrCreateAircraft(const AircraftReport& report) +{ + TrackedAircraft *item = nullptr; + + // Strongest identity first + if (report.m_icao && m_byKey.contains(icaoKey(report.m_icao))) { + item = m_byKey.value(icaoKey(report.m_icao)); + } else if (!report.m_registration.isEmpty() && m_byKey.contains(regKey(report.m_registration))) { + item = m_byKey.value(regKey(report.m_registration)); + } + + // A flight number is NOT an identity - it is reused, day after day and by different + // airframes. Matching on one is only safe when the report offers nothing better: + // an unseen ICAO address arriving on a historical flight number would otherwise be + // folded in to the aircraft that flew it last, and then ignored, because the code + // below only adopts an identity the item does not already have. + // + // Even with nothing stronger it has to be recent. The key lives as long as the + // aircraft does, so without this a flight number seen days ago still claims today's. + if (!item && !report.m_flight.isEmpty() + && (report.m_icao == 0) && report.m_registration.isEmpty() + && m_byKey.contains(flightKey(report.m_flight))) + { + TrackedAircraft *candidate = m_byKey.value(flightKey(report.m_flight)); + const QDateTime when = report.m_received.isValid() ? report.m_received + : QDateTime::currentDateTime(); + // How recently this aircraft flew THIS callsign, not how recently it was heard. + // + // Bounded at both ends: secsTo() runs negative when the report is OLDER than what + // was last heard, and a negative number is less than any window - so a delayed + // report claiming a callsign since taken up by another airframe was matched to + // that airframe rather than rejected. + const QDateTime flownAt = flightLastSeen(candidate, report.m_flight); + const qint64 age = flownAt.secsTo(when); + if (flownAt.isValid() && (age >= 0) && (age < m_flightKeyValidSecs)) { + item = candidate; + } + } + + if (!item) + { + item = new TrackedAircraft(); + item->m_id = m_nextId++; + m_aircraft.append(item); + } + + // Adopt any stronger identities the report carries and register their keys + if (report.m_icao && (item->m_icao == 0)) + { + item->m_icao = report.m_icao; + claimKey(item, icaoKey(report.m_icao)); + } + if (!report.m_registration.isEmpty() && item->m_registration.isEmpty()) + { + item->m_registration = report.m_registration; + claimKey(item, regKey(report.m_registration)); + } + if (!report.m_flight.isEmpty()) + { + // If the flight key belongs to a weaker entry created before this + // airframe was identified, fold it in rather than orphaning it - but only when + // that entry was flying this callsign at about the same time. A callsign is + // flown again day after day, so an unbounded match folded a flight-only record + // of somebody else's operation into this airframe. + TrackedAircraft *other = m_byKey.value(flightKey(report.m_flight)); + if (other && (other != item) && (other->m_icao == 0) && other->m_registration.isEmpty()) + { + const QDateTime flownAt = flightLastSeen(other, report.m_flight); + const QDateTime when = report.m_received.isValid() ? report.m_received + : QDateTime::currentDateTime(); + const qint64 age = flownAt.isValid() ? flownAt.secsTo(when) : -1; + if (flownAt.isValid() && (age >= 0) && (age < m_flightKeyValidSecs)) { + absorbAircraft(item, other); + } + } + item->m_flight = report.m_flight; + m_byKey.insert(flightKey(report.m_flight), item); + } + + // Cross reference registration and ICAO through the OpenSky database + if (item->m_icao && item->m_registration.isEmpty() + && m_aircraftInfoByIcao && m_aircraftInfoByIcao->contains((int) item->m_icao)) + { + item->m_registration = m_aircraftInfoByIcao->value((int) item->m_icao)->m_registration; + if (!item->m_registration.isEmpty()) { + claimKey(item, regKey(item->m_registration)); + } + } + if ((item->m_icao == 0) && !item->m_registration.isEmpty() + && m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) + { + item->m_icao = (quint32) m_aircraftInfo->value(item->m_registration)->m_icao; + if (item->m_icao) { + claimKey(item, icaoKey(item->m_icao)); + } + } + + return item; +} + +// A location in a link management frame is a coarse handoff hint rather than a fix, so +// it is trusted least. Everything else that isn't ADS-B is a real position report +// A link management frame's altitude is both coarse and, on some aircraft, wrong - so +// it is only believed when nothing better has been heard lately, and never sets a record +int AircraftTracker::altitudeRank(const AircraftReport& report) +{ + if (report.m_protocol == AircraftReport::ADSB) { + return AltitudeAdsb; + } + if (report.m_documentKind == AircraftReport::Logon) { + return AltitudeCoarse; + } + return AltitudeReported; +} + +int AircraftTracker::positionRank(const AircraftReport& report) +{ + if (report.m_protocol == AircraftReport::ADSB) { + return PositionAdsb; + } + if (report.m_documentKind == AircraftReport::Logon) { + return PositionCoarse; + } + + return PositionReported; +} + +void AircraftTracker::processReport(AircraftReport& report) +{ + // A SELCAL call names a code rather than an aircraft. Only when it can be pinned on + // one aircraft does it go any further; otherwise it is logged and that is all. + if ((report.m_protocol == AircraftReport::SELCAL) && !attributeSelcal(report)) { + return; + } + + TrackedAircraft *item = findOrCreateAircraft(report); + + // A CSV file is a new observation run, even when it contains the same airframe and + // callsign as live traffic or a file replayed moments ago. Keeping the old current + // flight made the first historical position rewind the icon while the in-order + // track guard below quite correctly kept the old track. The Map then joined those + // two unrelated endpoints with its provisional point. + if (report.m_replayStart) + { + if (item->m_currentFlight) { + m_dirtyFlights.insert(item->m_currentFlight); + } + item->m_currentFlight = nullptr; + item->m_flight.clear(); + item->m_departure.clear(); + item->m_arrival.clear(); + item->m_route.clear(); + + item->m_positionValid = false; + item->m_positionDateTime = QDateTime(); + item->m_positionRank = PositionRanks; + for (QDateTime& time : item->m_positionRankTimes) { + time = QDateTime(); + } + + item->m_altitudeValid = false; + item->m_altitudeDateTime = QDateTime(); + item->m_prevAltitudeDateTime = QDateTime(); + for (QDateTime& time : item->m_altitudeRankTimes) { + time = QDateTime(); + } + + item->m_headingValid = false; + item->m_headingDateTime = QDateTime(); + item->m_speedValid = false; + item->m_speedDateTime = QDateTime(); + item->m_distanceValid = false; + item->m_mapTrackChanged = true; + } + + // Receiving data makes it active, which puts it in the active tables and on the map + setActive(item, true); + + // The LATEST report, not the last one to arrive. A replayed or delayed report can + // be hours old, and assigning it made a currently active aircraft look stale - at + // which point the removal timer archived it and took it off the Map. + if (report.m_received.isValid() + && (!item->m_lastSeen.isValid() || (report.m_received > item->m_lastSeen))) { + item->m_lastSeen = report.m_received; + } + item->m_messages++; + item->m_sources[qMakePair((int) report.m_protocol, report.m_frequency)]++; + + if (!report.m_documentText.isEmpty()) { + item->m_lastDocumentText = report.m_documentText; + } + + // For the message rate chart: one series per protocol then a total + if ((report.m_protocol >= 0) && (report.m_protocol < AircraftReport::ProtocolCount)) { + m_chartCounts[report.m_protocol]++; + } + m_chartCounts[AircraftReport::ProtocolCount]++; + + // Track the flight this report belongs to (route facts are collated there), + // and collect notable documents and ATC messages. The aircraft shows the + // flight's primary name, so it doesn't flap between the ACARS flight number + // and the ADS-B callsign forms. + TrackedFlight *flight = updateFlight(item, report); + // The same tally as the airframe's, but only for the flight it is on now + if (flight) { + flight->m_sources[qMakePair((int) report.m_protocol, report.m_frequency)]++; + } + if (flight) { + flight->m_messages++; + } + // The airframe's name is its current flight's. A late message filed against the + // flight before (see updateFlight()) is that flight's business, and copying its name + // across flipped the aircraft back to the old callsign until the next report. + if ((flight == item->m_currentFlight) && !flight->m_flight.isEmpty()) { + item->m_flight = flight->m_flight; + } + addDocument(item, flight, report); + addAtcMessage(item, flight, report); + if (report.m_protocol == AircraftReport::SELCAL) + { + item->m_selcalHeard = report.m_selcalCode; + logSelcalCall(item, flight, report, QStringList()); + } + recordDcduMessage(item, report); + addWeatherReport(item, report); + + checkNotifications(item, report); + + // Altitude is measured separately from position - on ADS-B by a different message + // entirely - so it is taken in on its own account. It used to be updated only + // alongside a position that had passed the ranking and plausibility checks, which + // meant a distant aircraft whose position was rejected lost its altitude with it, + // and a protocol that reports altitude without a position never set one at all. + // Whether THIS report's altitude is one worth recording - see altitudeRank() + bool reportAltitudeValid = false; + float reportAltitudeFt = 0.0f; + + if (report.m_altitudeValid) + { + // Not if we already hold a later observation - a stored record from a log dump + // arrives long after the altitude it describes + const bool stale = report.m_altitudeDateTime.isValid() + && item->m_altitudeDateTime.isValid() + && (report.m_altitudeDateTime < item->m_altitudeDateTime); + + const int altRank = altitudeRank(report); + // When each source was last heard, so it has to move forward only. A replayed or + // delayed report carries an older reception time, and writing it here made live + // ADS-B look as though it had gone quiet - at which point the coarser sources + // below were let through to replace an altitude that was perfectly good. + if (report.m_received.isValid() + && (!item->m_altitudeRankTimes[altRank].isValid() + || (report.m_received > item->m_altitudeRankTimes[altRank]))) { + item->m_altitudeRankTimes[altRank] = report.m_received; + } + + // Only fall back to a coarser source once the better ones have gone quiet, as + // positions already do. Without this a single bad XID octet replaced a good + // ADS-B altitude until the next ADS-B message arrived. + bool altSuperseded = false; + for (int better = 0; better < altRank; better++) + { + if (item->m_altitudeRankTimes[better].isValid() + && (item->m_altitudeRankTimes[better].secsTo(report.m_received) < m_positionRankTimeoutSecs)) { + altSuperseded = true; + } + } + + // The records take the altitude THIS report carried, and never a coarse one: + // an aircraft heard only on link management frames is better left without a + // highest-altitude record than given a wrong one, because a record is never + // corrected afterwards + reportAltitudeValid = (altRank != AltitudeCoarse); + reportAltitudeFt = report.m_altitudeFt; + + if (!stale && !altSuperseded) + { + // The one before it is kept as well, so a position timestamped between the + // two can have its altitude worked out rather than guessed - see altitudeAt() + if (report.m_altitudeDateTime.isValid() && item->m_altitudeDateTime.isValid() + && (report.m_altitudeDateTime > item->m_altitudeDateTime)) + { + item->m_prevAltitudeFt = item->m_altitudeFt; + item->m_prevAltitudeDateTime = item->m_altitudeDateTime; + } + item->m_altitudeFt = report.m_altitudeFt; + item->m_altitudeValid = true; + if (report.m_altitudeDateTime.isValid()) { + item->m_altitudeDateTime = report.m_altitudeDateTime; + } + } + } + + // Whether THIS report supplied the position we are now holding - see updateStatistics() + bool positionAccepted = false; + // How far away the position THIS report carried is, whether or not it was adopted + bool reportRangeValid = false; + float reportRangeKm = 0.0f; + + // Exactly 0N 0E is a zeroed-out field, not a position off the coast of Africa + bool positionValid = report.m_positionValid + && ((report.m_latitude != 0.0f) || (report.m_longitude != 0.0f)); + + if (positionValid) + { + // A report timestamped before the position we are already holding is a report + // of where the aircraft USED to be - a stored record from a log dump (seen with + // HFDL performance data), or simply out of order. Adopting one rewound the + // coordinates while the timestamp stayed where it was, so the two then described + // different moments, and appended a point to the track out of time order. + // + // The one exception is a held position that has itself gone stale: it is on its + // way off the Map, so an older fix is still an improvement on it. That exception + // is needed because the protocols timestamp differently - ADS-B stamps when we + // received the frame, an ACARS position report when the aircraft measured it, so + // an ACARS fix routinely looks minutes old the moment it arrives. Without it, an + // aircraft that had just left ADS-B coverage would refuse its own oceanic + // positions until their clock caught up with the last ADS-B one. + QDateTime posTime = report.m_positionDateTime.isValid() ? report.m_positionDateTime : report.m_received; + bool current = !item->m_positionDateTime.isValid() + || (item->m_positionDateTime.msecsTo(posTime) >= 0) + // A live report from a slower bearer may legitimately replace an expired + // ADS-B position. Historical replay has its own explicit boundary above; + // comparing its old timestamp with today's wall clock would make every + // position stale and silently allow the replay to run backwards. + || (!report.m_replay && positionStale(item, report.m_received)); + + const QGeoCoordinate reported(report.m_latitude, report.m_longitude); + const int rank = positionRank(report); + + // Only fall back to a less accurate source once the better ones have gone quiet + bool superseded = false; + for (int better = 0; better < rank; better++) + { + if (item->m_positionRankTimes[better].isValid() + && (item->m_positionRankTimes[better].secsTo(report.m_received) < m_positionRankTimeoutSecs)) { + superseded = true; + } + } + + // A position the aircraft could not have flown to since the last one is a report + // of where it used to be, or a bad decode - not where it is now. The tolerance + // covers the resolution of the position and any slop in the times + // A better source is always allowed to correct a worse one - otherwise a coarse + // position 11 km out could reject the ADS-B fix that would have put it right + bool plausible = true; + if (item->m_positionValid && item->m_positionDateTime.isValid() && (rank >= item->m_positionRank)) + { + const double km = QGeoCoordinate(item->m_latitude, item->m_longitude).distanceTo(reported) / 1000.0; + const double hours = std::abs((double) item->m_positionDateTime.msecsTo(posTime)) / 3600000.0; + plausible = km <= (m_maxGroundSpeedKn * 1.852 * hours) + m_positionToleranceKm; + } + + // The range record for a protocol asks how far away the aircraft was when we heard + // it on that protocol, so it uses the position THIS report carried - not the one we + // end up holding, which may have come from a better source. Gating it on the + // position being ADOPTED was wrong: an aircraft inside ADS-B coverage has every + // ACARS, VDL-2 and Aero position superseded within the rank timeout, so those + // protocols could never record a range at all however far away they heard it. A + // report carrying no position still measures nothing, which is what stopped + // ADS-B distances being credited to HFDL. + // + // Checked against the position we are holding whatever its rank - unlike the + // tracked position, a range record is never corrected later, so a bad decode + // would leave a wrong figure in it for ever. + bool rangePlausible = true; + if (item->m_positionValid && item->m_positionDateTime.isValid()) + { + const double km = QGeoCoordinate(item->m_latitude, item->m_longitude).distanceTo(reported) / 1000.0; + const double hours = std::abs((double) item->m_positionDateTime.msecsTo(posTime)) / 3600000.0; + rangePlausible = km <= (m_maxGroundSpeedKn * 1.852 * hours) + m_positionToleranceKm; + } + if (rangePlausible) + { + // Distance from the antenna that heard this report, not from "here" - a + // remote SDR is somewhere else entirely, and a range figure measured from + // the wrong end is worse than none + const QGeoCoordinate receiver = receiverPosition(report.m_deviceSetIndex); + if (receiver.isValid()) + { + reportRangeKm = (float) (receiver.distanceTo(reported) / 1000.0); + reportRangeValid = true; + // Which direction it was heard in, as well as how far, so the range + // pattern can be drawn rather than just the one furthest figure + updateCoverage(report.m_protocol, receiver, + (float) receiver.azimuthTo(reported), reportRangeKm); + } + } + + if (current && !superseded && plausible) + { + positionAccepted = true; + item->m_positionRankTimes[rank] = report.m_received; + item->m_positionRank = rank; + item->m_positionValid = true; + item->m_latitude = report.m_latitude; + item->m_longitude = report.m_longitude; + if (reportRangeValid) + { + item->m_distanceKm = reportRangeKm; + item->m_distanceValid = true; + } + // The position and the moment it describes always come from the same + // report. Keeping the newer of the two timestamps while taking an older + // report's coordinates is what made the pair disagree. + item->m_positionDateTime = posTime; + + // Accumulate the full track - it survives gaps between protocols + // The altitude that belongs with this fix is the altitude AT posTime, which + // on ADS-B is not the newest one received - see altitudeAt() + const float trackAltFt = report.m_altitudeValid + ? altitudeAt(item, posTime, report.m_altitudeFt) : 0.0f; + QGeoCoordinate coordinate(report.m_latitude, report.m_longitude, + report.m_altitudeValid ? Units::feetToMetres(trackAltFt) : 0.0f); + // Every reported position is kept. There is deliberately no distance + // threshold: a transponder reports at its own rate whatever the aircraft is + // doing, so a distance guard only ever discards points from SLOW aircraft - + // taxiing, on approach - which is precisely where the track needs detail, + // while doing nothing at all about a fast one. The only thing worth dropping + // is a position identical to the one before it, which carries nothing. + // Position only. An altitude report does not move the aircraft, and it + // arrives carrying the position and timestamp of the LAST position report, + // so appending on any change of altitude filled the track with points at a + // repeated place and time. The altitude recorded against a track point is + // the altitude when that position was reported, which is what it should be. + // ... and in time order. An older fix is adopted only when the position + // being held has gone stale, but appending it after a newer point would + // leave the track's times running backwards - and the Map's smoother divides + // by the difference between consecutive times, so a negative one gives inf + // and then nan, exactly as two identical times do - which is why a fix at + // the same time as the last point is not appended either. Minute-resolution + // ACARS and HFDL positions a few kilometres apart produced exactly that. + // Where the aircraft is now belongs to the flight it is flying now: a late + // message for the flight before still carries today's position, and adding + // it to the landed flight extended that leg past its landing. + TrackedFlight *flown = item->m_currentFlight ? item->m_currentFlight : flight; + // The stored points have to be in memory before anything is appended: until + // they are, m_trackSaved counts rows the list does not hold, and the save + // would append nothing at all + ensureTrackLoaded(flown); + const bool inOrder = flown && (flown->m_trackTimes.isEmpty() + || (posTime > flown->m_trackTimes.last())); + const bool moved = inOrder && (flown->m_track.isEmpty() + || (flown->m_track.last().latitude() != coordinate.latitude()) + || (flown->m_track.last().longitude() != coordinate.longitude())); + if (moved) + { + // Heading along the track when the report has none + if (!flown->m_track.isEmpty()) + { + float trackHeading = (float) flown->m_track.last().azimuthTo(coordinate); + if (!report.m_headingValid) + { + item->m_heading = trackHeading; + item->m_headingValid = true; + item->m_headingDateTime = posTime; + } + } + flown->m_track.append(coordinate); + flown->m_trackTimes.append(posTime); + item->m_mapTrackAppended = true; + + } + } + } + // Both only move forward, as the position, the altitude and the last seen time do: + // a delayed report describes what the aircraft was doing then, not now + const QDateTime observed = report.m_received.isValid() ? report.m_received + : QDateTime::currentDateTime(); + if (report.m_headingValid + && (!item->m_headingDateTime.isValid() || (observed >= item->m_headingDateTime))) + { + item->m_heading = report.m_heading; + item->m_headingValid = true; + item->m_headingDateTime = observed; + } + if (report.m_speedValid + && (!item->m_speedDateTime.isValid() || (observed >= item->m_speedDateTime))) + { + item->m_speedKts = report.m_speedKts; + item->m_speedValid = true; + item->m_speedDateTime = observed; + } + + // The GUI and basic map item are updated from the flush timer + update3DModel(item); + updateStatistics(report, item, reportRangeValid, reportRangeKm, + reportAltitudeValid, reportAltitudeFt); + m_dbDirty = true; + m_dirtyAircraft.insert(item); + + if (report.m_mapItem) + { + // ADS-B pass-through goes straight out - the item carries this + // report's aircraft state for the Map's PFD + forwardMapItem(item, report.m_mapItem); + report.m_mapItem = nullptr; // Ownership transferred + // Wall clock, not the report's time: this says whether pass-through is still + // FLOWING, which flush() tests against now. A CSV replay's reports are hours old, + // so stamping their time made every replayed item look abandoned and flush() + // replaced each one with a basic item 300 ms later. + item->m_lastMapItemTime = QDateTime::currentDateTime(); + } +} + +// Flush batched GUI notifications and basic map updates +void AircraftTracker::flush() +{ + if (!m_dirtyAircraft.isEmpty()) + { + const QDateTime now = QDateTime::currentDateTime(); + QList displays; + for (TrackedAircraft *item : m_dirtyAircraft) + { + displays.append(displayFor(item)); + + // While pass-through items are flowing, a basic item built here + // would replace the rich one, so only send when ADS-B is quiet. + // Only aircraft we are currently hearing are drawn. + bool passThroughActive = item->m_lastMapItemTime.isValid() + && (item->m_lastMapItemTime.secsTo(now) < 60); + if (item->m_active && item->m_positionValid && !passThroughActive) + { + sendToMap(item); + item->m_mapResync = false; + m_mapResyncPending.remove(item); + } + } + m_dirtyAircraft.clear(); + emit aircraftUpdated(displays); + } + + // Aircraft a Map that has just opened is still owed. They were not sendable when + // they were last looked at - typically their ADS-B pass-through had been quiet for + // less than a minute, so a basic item would have replaced a richer one - and the + // dirty set they came from is emptied every pass, so without a queue of their own a + // quiet aircraft would simply never reach that Map. + if (!m_mapResyncPending.isEmpty()) + { + const QDateTime now = QDateTime::currentDateTime(); + const QSet owed = m_mapResyncPending; + for (TrackedAircraft *item : owed) + { + const bool passThroughActive = item->m_lastMapItemTime.isValid() + && (item->m_lastMapItemTime.secsTo(now) < 60); + if (!item->m_active) + { + m_mapResyncPending.remove(item); // Archived, so not on any Map + } + else if (item->m_positionValid && !passThroughActive) + { + sendToMap(item); + item->m_mapResync = false; + m_mapResyncPending.remove(item); + } + } + } + + // After the aircraft loop above has emptied m_dirtyAircraft, so the aircraft it marks + // dirty go out on the next flush rather than being cleared unsent. The routes and the + // record marker below are re-sent within this one. + checkMapConsumers(); + + // All three are cheap unless something they depend on has changed + updateWatchedTrack(); + updateRecordMapItem(); + retryRoutes(); + + // The concurrent count has to be recomputed on a timer rather than only when a report + // arrives: aircraft leaving the window lower it, and nothing signals that. + const QDateTime stamp = QDateTime::currentDateTime(); + updateConcurrent(stamp); + + // Both elapsed figures advance whether or not anything is being received, so nudge + // the display once a minute rather than leaving the clocks frozen on a quiet band + if (m_statistics.m_sessionStart.isValid()) + { + const qint64 minute = m_statistics.m_sessionStart.secsTo(stamp) / 60; + if (minute != m_statisticsMinute) + { + m_statisticsMinute = minute; + m_statisticsDirty = true; + // On this tick rather than on every flush: it is a file stat, and the database + // only grows when it is saved, which is far less often than a flush + updateDatabaseSize(); + } + } + + if (m_statisticsDirty) + { + m_statisticsDirty = false; + if (m_statistics.m_sessionStart.isValid()) + { + m_statistics.m_session.m_seconds = m_statistics.m_sessionStart.secsTo(stamp); + m_statistics.m_allTime.m_seconds = m_allTimeSecondsBase + + (m_allTimeSince.isValid() ? m_allTimeSince.secsTo(stamp) + : m_statistics.m_session.m_seconds); + } + emit statisticsUpdated(m_statistics); + } + + if (!m_dirtyFlights.isEmpty()) + { + QList displays; + bool watchedDirty = false; + for (TrackedFlight *flight : m_dirtyFlights) + { + displays.append(displayFor(flight)); + watchedDirty = watchedDirty || (flight->m_id == m_watchedFlight); + } + m_dirtyFlights.clear(); + emit flightsUpdated(displays); + if (watchedDirty) + { + TrackedFlight *flight = flightById(m_watchedFlight); + if (flight) { + emitProfile(flight); + } + } + } + + if (!m_pendingDocuments.isEmpty()) + { + emit documentsAdded(m_pendingDocuments); + m_pendingDocuments.clear(); + } + if (!m_pendingAtc.isEmpty()) + { + emit atcMessages(m_pendingAtc); + m_pendingAtc.clear(); + } + if (!m_pendingWeather.isEmpty()) + { + emit weatherReports(m_pendingWeather); + m_pendingWeather.clear(); + } + + // Redrawn only when a bin actually grew, which on a busy day is a few times a minute + // rather than once per report + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + if (m_coverageDirty[i]) + { + sendCoverageToMap(i); + m_coverageDirty[i] = false; + m_coverageChanged = true; + } + } + + // For the web API's report, which reads it from another thread + updateTotals(); +} + +void AircraftTracker::updateChartCounts() +{ + const QDateTime now = QDateTime::currentDateTime(); + const qint64 elapsedMS = m_chartRateTime.msecsTo(now); + if (elapsedMS <= 0) { + return; + } + QList rates; + for (int i = 0; i < CHART_COUNTS; i++) + { + rates.append(m_chartCounts[i] / (elapsedMS / 1000.0f)); + m_chartCounts[i] = 0; + } + m_chartRateTime = now; + emit messageRates(rates); +} + +AircraftDisplay AircraftTracker::displayFor(const TrackedAircraft *item) const +{ + AircraftDisplay d; + d.m_id = item->m_id; + d.m_icao = item->m_icao; + d.m_registration = item->m_registration; + d.m_flight = item->m_flight; + // From the current flight where there is one, since that is what holds the other + // name; from the airframe's own last flight name otherwise, which leaves the + // callsign showing it and the number empty rather than showing nothing at all + flightNameForms(item->m_flight, + item->m_currentFlight ? item->m_currentFlight->m_aliases : QStringList(), + d.m_callsign, d.m_flightNumber); + d.m_positionValid = item->m_positionValid; + d.m_distanceValid = item->m_distanceValid; + d.m_distanceKm = item->m_distanceKm; + d.m_latitude = item->m_latitude; + d.m_longitude = item->m_longitude; + d.m_altitudeValid = item->m_altitudeValid; + d.m_altitudeFt = item->m_altitudeFt; + d.m_headingValid = item->m_headingValid; + d.m_heading = item->m_heading; + d.m_speedValid = item->m_speedValid; + d.m_speedKts = item->m_speedKts; + d.m_protocols = sourcesText(item->m_sources); + d.m_messages = item->m_messages; + d.m_lastSeen = item->m_lastSeen; + d.m_mapAvailableUntil = mapAvailableUntil(item); + d.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; + d.m_currentFlightId = item->m_currentFlight ? item->m_currentFlight->m_id : 0; + d.m_active = item->m_active; + if (!item->m_selcalHeard.isEmpty()) { + d.m_selcal = item->m_selcalHeard; + } else if (m_selcalCodes && !item->m_registration.isEmpty()) { + d.m_selcal = m_selcalCodes->value(item->m_registration); + } + return d; +} + +FlightDisplay AircraftTracker::displayFor(const TrackedFlight *flight) const +{ + FlightDisplay d; + d.m_id = flight->m_id; + d.m_aircraftId = flight->m_aircraft->m_id; + d.m_flight = flight->m_flight; + flightNameForms(flight->m_flight, flight->m_aliases, d.m_callsign, d.m_flightNumber); + d.m_aliases = flight->m_aliases.join(", "); + d.m_reg = regFor(flight->m_aircraft); + d.m_departure = flight->m_departure; + d.m_arrival = flight->m_arrival; + d.m_route = flight->m_route; + if (!flight->m_departure.isEmpty() || !flight->m_arrival.isEmpty()) + { + // Whichever end we hold; where both are held and disagree about where they + // came from, a message anywhere in the pair is what the column reports + d.m_departureFromMessage = + !flight->m_departure.isEmpty() && !flight->m_departureFromDatabase; + d.m_arrivalFromMessage = + !flight->m_arrival.isEmpty() && !flight->m_arrivalFromDatabase; + d.m_routeSource = (d.m_departureFromMessage || d.m_arrivalFromMessage) + ? "Message" : "Database"; + } + // Only worth comparing when something told us: a pair taken FROM the database + // trivially agrees with it and says nothing. Aliases are searched too, because the + // database is keyed on callsign and a flight answers to more than one - the entry + // may be filed under the ICAO form while the ACARS form is the primary here. + if (m_routeInfo && (d.m_routeSource == "Message")) + { + QStringList names; + names.append(flight->m_flight); + names.append(flight->m_aliases); + for (const QString& name : names) + { + if (name.isEmpty() || !m_routeInfo->contains(name)) { + continue; + } + const AircraftRouteInformation *route = m_routeInfo->value(name); + // Each end judged only where we hold one, so a flight known to be going to + // KJFK with no departure yet is not called a disagreement for the half that + // is simply not known + const bool departureAgrees = flight->m_departure.isEmpty() + || (route->m_dep == flight->m_departure); + const bool arrivalAgrees = flight->m_arrival.isEmpty() + || (route->m_arr == flight->m_arrival); + d.m_routeChecked = true; + d.m_routeAgrees = departureAgrees && arrivalAgrees; + break; + } + } + d.m_firstSeen = flight->m_firstSeen; + d.m_lastSeen = flight->m_lastSeen; + // Logons excluded: they are counted in the thousands where everything else is in + // the tens, so a count including them said nothing about whether a flight had + // anything worth opening. They have their own tab. + d.m_documents = 0; + for (const TrackedDocument *doc : flight->m_documents) + { + if (doc->m_kind != AircraftReport::Logon) { + d.m_documents++; + } + } + d.m_messages = flight->m_messages; + d.m_protocols = sourcesText(flight->m_sources); + d.m_out = flight->m_out; + d.m_off = flight->m_off; + d.m_on = flight->m_on; + d.m_in = flight->m_in; + for (const TrackedDocument *doc : flight->m_documents) + { + switch (doc->m_kind) + { + case AircraftReport::Loadsheet: d.m_hasLoadsheet = true; break; + case AircraftReport::Clearance: d.m_hasClearance = true; break; + case AircraftReport::DepartureClearance: d.m_hasClearance = true; break; + // Asking for one counts: it says the flight is going oceanic, which is what the + // column is read for + case AircraftReport::ClearanceRequest: d.m_hasClearance = true; break; + case AircraftReport::FlightPlan: d.m_hasFlightPlan = true; break; + default: break; + } + } + // Only the flight an active aircraft is currently flying counts as active + d.m_active = flight->m_aircraft->m_active && (flight->m_aircraft->m_currentFlight == flight); + return d; +} + +DocumentEvent AircraftTracker::documentEvent(const TrackedAircraft *item, const TrackedFlight *flight, const TrackedDocument *doc) const +{ + DocumentEvent e; + e.m_aircraftId = item->m_id; + e.m_flightId = flight->m_id; + e.m_received = doc->m_received; + e.m_flight = flight->m_flight; + e.m_reg = regFor(item); + e.m_kind = documentKindName(doc->m_kind); + e.m_title = doc->m_title; + e.m_text = doc->m_text; + e.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; + return e; +} + +AircraftTracker::TrackedFlight *AircraftTracker::flightById(quint64 id) const +{ + if (id == 0) { + return nullptr; + } + for (TrackedAircraft *item : m_aircraft) + { + for (TrackedFlight *flight : item->m_flights) + { + if (flight->m_id == id) { + return flight; + } + } + } + return nullptr; +} + +void AircraftTracker::emitProfile(const TrackedFlight *flight) +{ + // Fetched now if it never was. Const because everything else about emitting is, and + // reading the flight's own stored history does not change what the flight IS. + ensureProfileLoaded(const_cast(flight)); + emit profileUpdated(flight->m_id, flight->m_profileTimes, flight->m_profileAltFt, flight->m_profileSpeedKts); +} + +// Resend the complete state - the GUI has just connected +void AircraftTracker::resync() +{ + emit allCleared(); + + QList aircraft; + QList flights; + QList documents; + for (TrackedAircraft *item : m_aircraft) + { + aircraft.append(displayFor(item)); + for (TrackedFlight *flight : item->m_flights) + { + flights.append(displayFor(flight)); + for (TrackedDocument *doc : flight->m_documents) { + documents.append(documentEvent(item, flight, doc)); + } + } + } + std::sort(documents.begin(), documents.end(), + [](const DocumentEvent& a, const DocumentEvent& b) { return a.m_received < b.m_received; }); + + if (!aircraft.isEmpty()) { + emit aircraftUpdated(aircraft); + } + if (!flights.isEmpty()) { + emit flightsUpdated(flights); + } + if (!documents.isEmpty()) { + emit documentsAdded(documents); + } + if (!m_atcLog.isEmpty()) { + emit atcMessages(m_atcLog); + } + if (!m_weatherLog.isEmpty()) { + emit weatherReports(m_weatherLog); + } +} + +void AircraftTracker::deleteAll() +{ + for (TrackedAircraft *item : m_aircraft) + { + if (!item->m_mapName.isEmpty()) { + removeFromMap(item->m_mapName); + } + // The routes as well as the aircraft. They are named after the flight rather than + // the airframe, so removing the aircraft leaves the lines and their waypoint + // markers behind - and a moment later the flights holding the only record of what + // those items are called are deleted, so nothing can ever take them off. + for (TrackedFlight *flight : item->m_flights) { + removeRoutes(flight); + } + } + qDeleteAll(m_aircraft); + m_aircraft.clear(); + m_byKey.clear(); + m_atcLog.clear(); + m_dirtyAircraft.clear(); + m_mapResyncPending.clear(); + m_dirtyFlights.clear(); + m_pendingDocuments.clear(); + m_pendingAtc.clear(); + // The documents and ATC messages go with them, and the next save has to be told so: + // it will not empty those tables on its own initiative - see saveDatabase() + m_dbMessageWipe = true; + // The weather log is keyed on airports rather than aircraft, so it is easy to + // forget here - but the GUI clears its rows on allCleared(), and leaving the log + // behind put every report straight back on the next resync. Worse, the dedupe index + // survived too, so a report that arrived again after the clear was recognised as + // one already held and never re-emitted at all. + m_acarsBlocks.clear(); + m_pendingWeather.clear(); + m_weatherLog.clear(); + m_weatherIndex.clear(); + m_routesPending.clear(); + if (!m_watchedTrackName.isEmpty()) + { + removeFromMap(m_watchedTrackName); + m_watchedTrackName.clear(); + m_watchedTrackKey.clear(); + } + m_watchedFlight = 0; + forgetSavedHistory(); + m_dbDirty = true; + emit allCleared(); +} + +// Aircraft we have stopped hearing from are not discarded - they move to the archive +// tables and come off the map, so the session's history stays available +void AircraftTracker::removeOldAircraft() +{ + QDateTime currentDateTime = QDateTime::currentDateTime(); + + // The aircraft databases may have been downloaded since we last looked + m_aircraftInfo = OsnDB::getAircraftInformationByReg(); + m_aircraftInfoByIcao = OsnDB::getAircraftInformation(); + m_routeInfo = OsnDB::getAircraftRouteInformation(); + m_selcalCodes = SELCALDB::getCodesByRegistration(); + + // The timer that drives this also drives the periodic session save + if (m_db && !m_loadingDatabase) { + saveDatabase(); + } else if (!m_db) { + // Only a save empties them, and with no database there is never one + forgetPendingChanges(); + } + + for (TrackedAircraft *item : m_aircraft) + { + if (item->m_active + && item->m_lastSeen.isValid() + && (item->m_lastSeen.secsTo(currentDateTime) > m_settings.m_removalMins * 60)) + { + setActive(item, false); + continue; + } + + // A stale position comes off the Map while the aircraft stays in the tables. + // The 3D map drops the entity on its own when the availability interval ends, + // but nothing takes it off the 2D map, so it would sit at its last known + // position until the aircraft was archived - three hours later by default. + if (item->m_active && !item->m_mapReplay && !item->m_mapName.isEmpty() + && positionStale(item, currentDateTime)) + { + removeFromMap(item->m_mapName); + item->m_mapName = ""; // Re-sent in full if a fresh position arrives + item->m_mapTrackChanged = true; + } + } + + discardOldAircraft(); +} + +// Archived aircraft are kept for a while so their history is still there, but not for +// ever - the session database is rewritten in full on every save, so it has to be +// bounded. A retention of zero means the user wants to keep everything. +// What the weather log's dedupe index is keyed on +static size_t weatherKey(const WeatherEvent& e) +{ + // (qHashMulti would do this, but it is Qt 6 only) + return qHash(e.m_airport + QChar(0) + e.m_kind + QChar(0) + e.m_text); +} + +void AircraftTracker::discardOldAircraft() +{ + if (m_settings.m_retentionDays <= 0) { + return; + } + + const QDateTime cutoff = QDateTime::currentDateTime().addDays(-m_settings.m_retentionDays); + QList discardedAircraft; + QList discardedFlights; + + for (int i = m_aircraft.size() - 1; i >= 0; i--) + { + TrackedAircraft *item = m_aircraft[i]; + + if (item->m_active || !item->m_lastSeen.isValid() || (item->m_lastSeen >= cutoff)) { + continue; + } + + discardedAircraft.append(item->m_id); + for (TrackedFlight *flight : item->m_flights) + { + discardedFlights.append(flight->m_id); + m_flightsToDelete.insert(flight->m_id); + m_dirtyFlights.remove(flight); + // Before the flight is deleted, which is where the names its lines and + // waypoint markers were drawn under are held - after it, nothing could ever + // take them off the map again + removeRoutes(flight); + if (m_watchedFlight == flight->m_id) { + m_watchedFlight = 0; + } + } + for (const QString& key : m_byKey.keys(item)) { + m_byKey.remove(key); + } + m_dirtyAircraft.remove(item); + m_mapResyncPending.remove(item); + m_aircraft.removeAt(i); + delete item; + m_dbDirty = true; + } + + // The ATC and weather logs go by the same rule, or they grow for ever: a message goes + // with the aircraft it was from, and one with no aircraft once it is older than the + // retention period. That is an unattributed call (id 0), or a message from an aircraft + // that went before its messages were taken with it - which otherwise stayed for ever. + // A weather report is about an airport, so it goes by age alone. + const QSet discardedIds(discardedAircraft.begin(), discardedAircraft.end()); + QSet liveIds; + for (const TrackedAircraft *item : m_aircraft) { + liveIds.insert(item->m_id); + } + QList keptAtc; + bool atcPruned = false; + for (const AtcEvent& e : m_atcLog) + { + if (discardedIds.contains(e.m_aircraftId)) + { + atcPruned = true; + } + else if (!liveIds.contains(e.m_aircraftId) && e.m_received.isValid() && (e.m_received < cutoff)) + { + m_atcPrunedIds.insert(e.m_aircraftId); + atcPruned = true; + } + else + { + keptAtc.append(e); + } + } + if (atcPruned) + { + m_atcLog = keptAtc; + m_atcAircraftToDelete.unite(discardedIds); + m_atcPruneCutoff = cutoff; + m_dbDirty = true; + } + const int weatherBefore = m_weatherLog.size(); + m_weatherLog.erase(std::remove_if(m_weatherLog.begin(), m_weatherLog.end(), + [&](const WeatherEvent& e) { return e.m_received.isValid() && (e.m_received < cutoff); }), + m_weatherLog.end()); + if (m_weatherLog.size() != weatherBefore) + { + // The index holds positions in the log, which have all moved + m_weatherIndex.clear(); + for (int i = 0; i < m_weatherLog.size(); i++) { + m_weatherIndex.insert(weatherKey(m_weatherLog[i]), i); + } + } + + if (!discardedFlights.isEmpty()) { + emit flightsRemoved(discardedFlights); + } + if (!discardedAircraft.isEmpty()) + { + qDebug() << "AircraftTracker::discardOldAircraft: discarded" << discardedAircraft.size() + << "aircraft not heard for" << m_settings.m_retentionDays << "days"; + emit aircraftRemoved(discardedAircraft); + } +} + +// Moving an aircraft between the active and archive tables +void AircraftTracker::setActive(TrackedAircraft *item, bool active) +{ + if (item->m_active == active) { + return; + } + + item->m_active = active; + + if (!active && !item->m_mapName.isEmpty()) + { + removeFromMap(item->m_mapName); + item->m_mapTrackChanged = true; // The whole track is resent if it returns + } + + m_dirtyAircraft.insert(item); + for (TrackedFlight *flight : item->m_flights) { + m_dirtyFlights.insert(flight); + } + m_dbDirty = true; +} + +// Fold a weaker duplicate into an identified aircraft. A flight-only sighting +// (e.g. ACARS with no registration) creates an aircraft keyed only by its +// flight; when a later report ties that flight to a real airframe, the weak +// entry's data moves across instead of being orphaned. +void AircraftTracker::absorbAircraft(TrackedAircraft *item, TrackedAircraft *weak) +{ + item->m_messages += weak->m_messages; + QHashIterator, int> sourceIt(weak->m_sources); + while (sourceIt.hasNext()) + { + sourceIt.next(); + item->m_sources[sourceIt.key()] += sourceIt.value(); + } + // Which of the two is carrying the current state varies: the weak entry is usually + // the flight-only ACARS record and the survivor the ICAO-backed one, but it is just + // as often the other way round. Keeping the survivor's simply because it survives + // threw away a position, altitude, speed or heading it did not have - so each is + // merged on validity and then on time. + const bool takeWeakPosition = weak->m_positionValid + && (!item->m_positionValid + || (weak->m_positionDateTime.isValid() + && (!item->m_positionDateTime.isValid() + || (weak->m_positionDateTime > item->m_positionDateTime)))); + if (takeWeakPosition) + { + item->m_positionValid = true; + item->m_latitude = weak->m_latitude; + item->m_longitude = weak->m_longitude; + item->m_positionDateTime = weak->m_positionDateTime; + item->m_positionRank = weak->m_positionRank; + item->m_distanceValid = weak->m_distanceValid; + item->m_distanceKm = weak->m_distanceKm; + // The track moves with the flights, below + item->m_mapTrackChanged = true; + } + + // When a position or altitude of each rank was last heard is the union of the two. + // It is what decides whether a coarser source may overwrite a better one, so losing + // half of it would let a stale ACARS fix supersede live ADS-B. + for (int i = 0; i < PositionRanks; i++) + { + if (weak->m_positionRankTimes[i].isValid() + && (!item->m_positionRankTimes[i].isValid() + || (weak->m_positionRankTimes[i] > item->m_positionRankTimes[i]))) { + item->m_positionRankTimes[i] = weak->m_positionRankTimes[i]; + } + } + for (int i = 0; i < AltitudeRanks; i++) + { + if (weak->m_altitudeRankTimes[i].isValid() + && (!item->m_altitudeRankTimes[i].isValid() + || (weak->m_altitudeRankTimes[i] > item->m_altitudeRankTimes[i]))) { + item->m_altitudeRankTimes[i] = weak->m_altitudeRankTimes[i]; + } + } + + // Altitude is measured separately from position on ADS-B - a Mode S altitude reply + // carries no position - so it merges separately, and takes with it the pair of + // observations altitudeAt() interpolates a track point's height between. + // The two most recent samples of the four, rather than one record's pair. Taking a + // pair whole discards a newer sample the other record held, and altitudeAt() + // interpolates a track point's height BETWEEN these two - so the wrong pair does not + // merely lose detail, it interpolates over the wrong interval. + if (weak->m_altitudeValid) + { + QList> samples; + auto offer = [&samples](bool valid, const QDateTime& when, float value) + { + if (valid && when.isValid()) { + samples.append(qMakePair(when, value)); + } + }; + offer(item->m_altitudeValid, item->m_altitudeDateTime, item->m_altitudeFt); + offer(item->m_altitudeValid, item->m_prevAltitudeDateTime, item->m_prevAltitudeFt); + offer(true, weak->m_altitudeDateTime, weak->m_altitudeFt); + offer(true, weak->m_prevAltitudeDateTime, weak->m_prevAltitudeFt); + + std::sort(samples.begin(), samples.end(), + [](const QPair& a, const QPair& b) { + return a.first > b.first; + }); + // Both records usually hold the same newest observation, having both just heard + // it. Taking the top two of the sorted list would then take that one instant + // twice, throw away the real second newest, and leave altitudeAt() with a zero + // span to interpolate over - which it refuses, so the merge would cost exactly + // the interpolation it is meant to preserve. + for (int i = samples.size() - 1; i > 0; i--) + { + if (samples[i].first == samples[i - 1].first) { + samples.removeAt(i); + } + } + + if (samples.isEmpty()) + { + // Neither record timestamped its altitude, so there is nothing to order them + // by and the survivor's is kept unless it has none at all + if (!item->m_altitudeValid) + { + item->m_altitudeValid = true; + item->m_altitudeFt = weak->m_altitudeFt; + } + } + else + { + item->m_altitudeValid = true; + item->m_altitudeDateTime = samples[0].first; + item->m_altitudeFt = samples[0].second; + if (samples.size() > 1) + { + item->m_prevAltitudeDateTime = samples[1].first; + item->m_prevAltitudeFt = samples[1].second; + } + } + } + + // Neither speed nor heading is timestamped, so "whichever one of the two has it" is + // as far as this can honestly go + if (weak->m_speedValid + && (!item->m_speedValid + || (weak->m_speedDateTime.isValid() + && (!item->m_speedDateTime.isValid() + || (weak->m_speedDateTime > item->m_speedDateTime))))) + { + item->m_speedValid = true; + item->m_speedKts = weak->m_speedKts; + item->m_speedDateTime = weak->m_speedDateTime; + } + if (weak->m_headingValid + && (!item->m_headingValid + || (weak->m_headingDateTime.isValid() + && (!item->m_headingDateTime.isValid() + || (weak->m_headingDateTime > item->m_headingDateTime))))) + { + item->m_headingValid = true; + item->m_heading = weak->m_heading; + item->m_headingDateTime = weak->m_headingDateTime; + } + if (weak->m_lastSeen.isValid() + && (!item->m_lastSeen.isValid() || (weak->m_lastSeen > item->m_lastSeen))) { + item->m_lastSeen = weak->m_lastSeen; + } + if (item->m_departure.isEmpty()) { + item->m_departure = weak->m_departure; + } + if (item->m_arrival.isEmpty()) { + item->m_arrival = weak->m_arrival; + } + if (item->m_route.isEmpty()) { + item->m_route = weak->m_route; + } + if (item->m_lastDocumentText.isEmpty()) { + item->m_lastDocumentText = weak->m_lastDocumentText; + } + + // The weak entry's flight history moves across, oldest first + for (TrackedFlight *flight : weak->m_flights) { + flight->m_aircraft = item; + } + QList flights = weak->m_flights; + flights.append(item->m_flights); + item->m_flights = flights; + // The more recently heard of the two. Keeping the survivor's because it survives + // kept yesterday's flight current over the one the weak entry is hearing now - so the + // next report started a third flight, splitting today's in two. + if (weak->m_currentFlight + && (!item->m_currentFlight + || (weak->m_currentFlight->m_lastSeen > item->m_currentFlight->m_lastSeen))) { + item->m_currentFlight = weak->m_currentFlight; + } + weak->m_flights.clear(); + weak->m_currentFlight = nullptr; + + // What would otherwise be done again, or lost: a rule that has already fired for the + // weak entry fired for this airframe, and an ADS-B item it was receiving says the + // pass-through is live, which stops a basic item being sent over the top of it + item->m_notifiedRules.unite(weak->m_notifiedRules); + if (weak->m_lastMapItemTime.isValid() + && (!item->m_lastMapItemTime.isValid() || (weak->m_lastMapItemTime > item->m_lastMapItemTime))) { + item->m_lastMapItemTime = weak->m_lastMapItemTime; + } + if (item->m_selcalHeard.isEmpty()) { + item->m_selcalHeard = weak->m_selcalHeard; + } + if (weak->m_dcduMessage.m_received > item->m_dcduMessage.m_received) + { + // The sequence carries on from the survivor's, so the Map sees a new message + const int seq = std::max(item->m_dcduMessage.m_seq, weak->m_dcduMessage.m_seq) + 1; + item->m_dcduMessage = weak->m_dcduMessage; + item->m_dcduMessage.m_seq = seq; + } + + // ATC messages are held by id, so they are moved by hand - see mergeFlightInto() + if (moveMessages(true, weak->m_id, item->m_id)) { + m_atcAircraftMoves.append({weak->m_id, item->m_id}); + } + + for (const QString& key : m_byKey.keys(weak)) { + m_byKey.insert(key, item); + } + if (!weak->m_mapName.isEmpty()) { + removeFromMap(weak->m_mapName); + } + m_dirtyAircraft.remove(weak); + m_mapResyncPending.remove(weak); + // It was counted as an aircraft heard when it was created, and it has just turned + // out to be one already counted - so take it back off both the session set and the + // count, or identifying an airframe part way through inflates the figure by one + if (m_sessionHeard.remove(weak->m_id)) { + m_statistics.m_session.m_distinctAircraft = m_sessionHeard.size(); + m_statisticsDirty = true; + } + m_sessionRecorded.remove(weak->m_id); + emit aircraftMerged(weak->m_id, item->m_id); + emit aircraftRemoved(QList{weak->m_id}); + m_aircraft.removeAll(weak); + delete weak; + + // Merging histories can leave the same flight twice + mergeLoadedFlights(item); + m_dirtyAircraft.insert(item); + for (TrackedFlight *flight : item->m_flights) { + m_dirtyFlights.insert(flight); + } + m_dbDirty = true; +} + +// Re-point the messages held against one aircraft or flight id to another, saying +// whether the ATC log had any (which the database then has to be told about). The +// pending ATC messages and documents too: they are on their way to the GUI, which has +// already been told of the merge by the time they arrive, so they would reach it under +// an id that no longer exists. +bool AircraftTracker::moveMessages(bool aircraftId, quint64 from, quint64 to) +{ + auto move = [aircraftId, from, to](auto& e) { + quint64& id = aircraftId ? e.m_aircraftId : e.m_flightId; + if (id == from) + { + id = to; + return true; + } + return false; + }; + + bool moved = false; + for (AtcEvent& e : m_atcLog) { + moved |= move(e); + } + for (AtcEvent& e : m_pendingAtc) { + move(e); + } + for (DocumentEvent& e : m_pendingDocuments) { + move(e); + } + return moved; +} + +// Merge any of an aircraft's flights that are the same flight under different +// names - after loading a session saved before names were aliased, or after +// absorbing a duplicate aircraft +void AircraftTracker::mergeLoadedFlights(TrackedAircraft *item) +{ + for (int i = 0; i < item->m_flights.size(); i++) + { + TrackedFlight *dst = item->m_flights[i]; + for (int j = i + 1; j < item->m_flights.size(); ) + { + TrackedFlight *src = item->m_flights[j]; + bool matches = flightMatches(dst, src->m_flight); + for (const QString& alias : src->m_aliases) { + matches = matches || flightMatches(dst, alias); + } + // The name is not enough. One airframe flies the same callsign again and + // again - a daily rotation is the same number every day - and merging on the + // name alone put every one of those operations into a single flight holding + // days of track, several sets of OOOI times and several routes. Run time + // splits them on the archive timeout; this is the same rule, so a reload + // stops undoing it. + if (matches && sameOperation(dst, src)) { + mergeFlightInto(item, dst, src); // Removes src from the list + } else { + j++; + } + } + } + + // One airframe flies one flight at a time, so flights whose time spans + // overlap are the same flight under names that can't be matched textually + // (some airlines' callsigns are unrelated to the flight number) + for (int i = 0; i < item->m_flights.size(); i++) + { + TrackedFlight *dst = item->m_flights[i]; + for (int j = i + 1; j < item->m_flights.size(); ) + { + TrackedFlight *src = item->m_flights[j]; + if (dst->m_firstSeen.isValid() && dst->m_lastSeen.isValid() + && src->m_firstSeen.isValid() && src->m_lastSeen.isValid() + && (dst->m_firstSeen <= src->m_lastSeen) + && (src->m_firstSeen <= dst->m_lastSeen)) { + mergeFlightInto(item, dst, src); + } else { + j++; + } + } + } + + // Keep the current flight at the end of the history + if (item->m_currentFlight) + { + item->m_flights.removeAll(item->m_currentFlight); + item->m_flights.append(item->m_currentFlight); + } +} + +// Split a flight identity into the airline designator and the flight number: +// a 3-letter ICAO designator (BAW31) or a 2-character IATA one (BA0031), with +// leading zeros stripped from the number so the two forms compare equal +// Which of the names a flight is known by is the ICAO callsign and which the IATA +// flight number. The airline designator is what tells them apart - three letters for +// ICAO, two characters for IATA - which is the same split the aliasing itself is built +// on, so a pair that were matched as the same flight are classified consistently here. +// +// The callsign falls back to the primary name so the column is never empty: a flight +// heard only under its IATA number is still called something, and blanking it would +// lose from the table what the aircraft is actually being called. +void AircraftTracker::flightNameForms(const QString& primary, const QStringList& aliases, + QString& callsign, QString& flightNumber) +{ + callsign.clear(); + flightNumber.clear(); + + QStringList names; + if (!primary.isEmpty()) { + names.append(primary); + } + names.append(aliases); + + for (const QString& name : names) + { + QString airline, number; + if (!splitFlightName(name, airline, number)) { + continue; // Neither form - a registration flown as a callsign, say + } + QString& into = (airline.size() == 3) ? callsign : flightNumber; + if (into.isEmpty()) { + into = name; + } + } + if (callsign.isEmpty()) { + callsign = primary; + } +} + +bool AircraftTracker::splitFlightName(const QString& flight, QString& airline, QString& number) +{ + int prefixLen; + if ((flight.size() > 3) && flight[0].isLetter() && flight[1].isLetter() && flight[2].isLetter()) { + prefixLen = 3; + } else if ((flight.size() > 2) && !(flight[0].isDigit() && flight[1].isDigit())) { + prefixLen = 2; + } else { + return false; + } + airline = flight.left(prefixLen); + QString rest = flight.mid(prefixLen); + int i = 0; + while ((i < rest.size() - 1) && (rest[i] == '0')) { + i++; + } + number = rest.mid(i); + return !number.isEmpty(); +} + +// Whether two names are the same flight in its IATA and ICAO callsign forms, +// e.g. BA0031 and BAW31. Only used within one airframe, so matching on the +// flight number alone is safe. +bool AircraftTracker::sameFlightNumber(const QString& a, const QString& b) +{ + QString airlineA, numberA, airlineB, numberB; + if (!splitFlightName(a, airlineA, numberA) || !splitFlightName(b, airlineB, numberB)) { + return false; + } + return numberA == numberB; +} + +bool AircraftTracker::flightMatches(const TrackedFlight *flight, const QString& name) +{ + if ((flight->m_flight == name) || flight->m_aliases.contains(name)) { + return true; + } + if (sameFlightNumber(flight->m_flight, name)) { + return true; + } + for (const QString& alias : flight->m_aliases) + { + if (sameFlightNumber(alias, name)) { + return true; + } + } + return false; +} + +// Record another name for a flight. The ICAO callsign form (3-letter airline +// designator) is preferred as the primary name - it is what the route database +// is keyed on - with the other forms kept as aliases. +void AircraftTracker::addFlightAlias(TrackedAircraft *item, TrackedFlight *flight, const QString& name) +{ + // No name is not another name for it. Recorded, it showed as a trailing ", " in the + // Aliases column and put "F" in the key map - after which every unnamed flight + // matched this one by "name" and was merged into it. + if (name.isEmpty() || (flight->m_flight == name) || flight->m_aliases.contains(name)) { + return; + } + if (flight->m_flight.isEmpty()) + { + flight->m_flight = name; + m_byKey.insert("F" + name, item); + return; + } + + QString airline, number; + bool nameIsCallsign = splitFlightName(name, airline, number) && (airline.size() == 3); + bool primaryIsCallsign = splitFlightName(flight->m_flight, airline, number) && (airline.size() == 3); + + if (nameIsCallsign && !primaryIsCallsign) + { + flight->m_aliases.append(flight->m_flight); + flight->m_flight = name; + } + else + { + flight->m_aliases.append(name); + } + m_byKey.insert("F" + name, item); +} + +// Fold one flight into another - they are the same flight under different names +void AircraftTracker::mergeFlightInto(TrackedAircraft *item, TrackedFlight *dst, TrackedFlight *src) +{ + // Both histories have to be in memory BEFORE they are combined - see + // ensureTrackLoaded(). Loading afterwards did nothing: the merge below resets the + // saved counts to zero, which is what tells these there is nothing stored to read, so + // a restored flight's stored track and profile were dropped and then rewritten away. + ensureTrackLoaded(dst); + ensureTrackLoaded(src); + ensureProfileLoaded(dst); + ensureProfileLoaded(src); + + addFlightAlias(item, dst, src->m_flight); + for (const QString& alias : src->m_aliases) { + addFlightAlias(item, dst, alias); + } + if (src->m_firstSeen.isValid() && (!dst->m_firstSeen.isValid() || (src->m_firstSeen < dst->m_firstSeen))) { + dst->m_firstSeen = src->m_firstSeen; + } + if (src->m_lastSeen.isValid() && (src->m_lastSeen > dst->m_lastSeen)) { + dst->m_lastSeen = src->m_lastSeen; + } + // Keeping whatever dst already had meant a database guess beat a fact, because the + // two were indistinguishable once stored. These two flights are the same operation + // under its ACARS and ADS-B identities, and only one of them tends to carry the + // filed plan - so the side that was told wins over the side that guessed. + if (dst->m_departure.isEmpty() + || (dst->m_departureFromDatabase && !src->m_departureFromDatabase + && !src->m_departure.isEmpty())) + { + dst->m_departure = src->m_departure; + dst->m_departureFromDatabase = src->m_departureFromDatabase; + } + if (dst->m_arrival.isEmpty() + || (dst->m_arrivalFromDatabase && !src->m_arrivalFromDatabase + && !src->m_arrival.isEmpty())) + { + dst->m_arrival = src->m_arrival; + dst->m_arrivalFromDatabase = src->m_arrivalFromDatabase; + } + if (dst->m_route.isEmpty()) + { + dst->m_route = src->m_route; + // With the route, not separately: left to itself the time would end up claiming + // that whichever route dst kept was filed when src's was + dst->m_routeFiled = src->m_routeFiled; + } + QHashIterator, int> flightSourceIt(src->m_sources); + while (flightSourceIt.hasNext()) + { + flightSourceIt.next(); + dst->m_sources[flightSourceIt.key()] += flightSourceIt.value(); + } + dst->m_documents.append(src->m_documents); + src->m_documents.clear(); + + // Interleave the profile samples in time order + if (!src->m_profileTimes.isEmpty()) + { + QList times; + QList alts, speeds; + int i = 0, j = 0; + while ((i < dst->m_profileTimes.size()) || (j < src->m_profileTimes.size())) + { + bool takeDst = (j >= src->m_profileTimes.size()) + || ((i < dst->m_profileTimes.size()) && (dst->m_profileTimes[i] <= src->m_profileTimes[j])); + if (takeDst) + { + times.append(dst->m_profileTimes[i]); + alts.append(dst->m_profileAltFt[i]); + speeds.append(dst->m_profileSpeedKts[i]); + i++; + } + else + { + times.append(src->m_profileTimes[j]); + alts.append(src->m_profileAltFt[j]); + speeds.append(src->m_profileSpeedKts[j]); + j++; + } + } + dst->m_profileTimes = times; + dst->m_profileAltFt = alts; + dst->m_profileSpeedKts = speeds; + // Rebuilt, not appended to, so what is stored for this flight is now wrong + dst->m_profileSaved = 0; + m_profilesToRewrite.insert(dst->m_id); + } + + dst->m_messages += src->m_messages; + if (!dst->m_out.isValid()) { dst->m_out = src->m_out; } + if (!dst->m_off.isValid()) { dst->m_off = src->m_off; } + if (!dst->m_on.isValid()) { dst->m_on = src->m_on; } + if (!dst->m_in.isValid()) { dst->m_in = src->m_in; } + + if (!src->m_track.isEmpty()) + { + QList track; + QList times; + int i = 0, j = 0; + while ((i < dst->m_track.size()) || (j < src->m_track.size())) + { + const bool takeDst = (j >= src->m_track.size()) + || ((i < dst->m_track.size()) && (dst->m_trackTimes[i] <= src->m_trackTimes[j])); + if (takeDst) + { + track.append(dst->m_track[i]); + times.append(dst->m_trackTimes[i]); + i++; + } + else + { + track.append(src->m_track[j]); + times.append(src->m_trackTimes[j]); + j++; + } + } + dst->m_track = track; + dst->m_trackTimes = times; + dst->m_trackSaved = 0; + m_tracksToRewrite.insert(dst->m_id); + item->m_mapTrackChanged = true; + } + + // The routes move too, or they are lost with src while what was drawn from them + // stays on the Map with nothing left that knows how to take it off. Where dst has one + // of its own, src's drawing is removed rather than kept: two flights have become one, + // and only one route can be current. + for (auto pair : { qMakePair(&src->m_flightPlan, &dst->m_flightPlan), + qMakePair(&src->m_clearance, &dst->m_clearance) }) + { + TrackedFlight::FiledRoute *from = pair.first; + TrackedFlight::FiledRoute *to = pair.second; + // The newer route wins, not the destination's. Which flight is which here is + // not the order they were flown: reconciling two names for one flight merges the + // current flight INTO the alias it turns out to be, so keeping the destination's + // route would systematically keep the older of the two. + const bool takeFrom = !from->m_waypoints.isEmpty() + && (to->m_waypoints.isEmpty() + || (from->m_filed.isValid() + && (!to->m_filed.isValid() || (from->m_filed > to->m_filed)))); + if (takeFrom) + { + // What the destination had drawn comes off first: two flights have become + // one, and only one route can be current + removeDrawnRoute(*to); + // Taken whole, drawn names included, so a later redraw knows what to replace + *to = *from; + if (to->m_pending) { + m_routesPending.insert(dst->m_id); + } + } + else { + removeDrawnRoute(*from); + } + } + m_routesPending.remove(src->m_id); + + m_flightsToDelete.insert(src->m_id); + // The ATC log holds ids, not pointers, so its messages have to be moved by hand - or + // after the next resync or restart they belong to a flight that no longer exists, and + // selecting the survivor shows none of them + if (moveMessages(false, src->m_id, dst->m_id)) { + m_atcFlightMoves.append({src->m_id, dst->m_id}); + } + if (m_watchedFlight == src->m_id) { + m_watchedFlight = dst->m_id; + } + if (item->m_currentFlight == src) { + item->m_currentFlight = dst; + } + m_dirtyFlights.remove(src); + m_dirtyFlights.insert(dst); + // The route that moved was taken off the map above, under the name it was drawn + // under. If what survives is the flight being looked at, it goes back on under the + // survivor's - and the merge may be what made it the selected one, just above. + if (routeDrawn(dst)) { + sendRoutes(dst); + } + m_dbDirty = true; + // Logged because it is invisible otherwise, and it moves documents, ATC messages and + // the drawn route from one flight to another under the user - which is exactly the + // kind of thing to want in the log when a view goes empty on its own + qDebug() << "AircraftTracker::mergeFlights: flight" << src->m_id << src->m_flight + << "merged into" << dst->m_id << dst->m_flight + << "-" << dst->m_documents.size() << "documents now on it"; + // Before flightsRemoved, so that anything holding the old id has moved to the new one + // by the time the removal is announced - including the selection, which would + // otherwise be cleared for a flight that has not gone anywhere + emit flightsMerged(src->m_id, dst->m_id); + emit flightsRemoved(QList{src->m_id}); + item->m_flights.removeAll(src); + delete src; +} + +// The flight a report belongs to +AircraftTracker::TrackedFlight *AircraftTracker::updateFlight(TrackedAircraft *item, const AircraftReport& report) +{ + TrackedFlight *flight = item->m_currentFlight; + + // An airframe that comes back later on the same callsign is flying it again, not + // still flying it. Without this the second operation was appended to the first, so + // one flight held two days of track, two sets of OOOI times and two routes. The + // archive timeout is the boundary because it is already the answer to "has this + // aircraft gone away": if it was away long enough to be archived, its return is a + // new flight. + if (flight && flight->m_lastSeen.isValid() && report.m_received.isValid()) + { + const qint64 gap = flight->m_lastSeen.secsTo(report.m_received); + if (gap > (qint64) m_settings.m_removalMins * 60) + { + item->m_departure.clear(); + item->m_arrival.clear(); + item->m_route.clear(); + m_dirtyFlights.insert(flight); + item->m_currentFlight = nullptr; + flight = nullptr; + item->m_mapTrackChanged = true; // A different flight, a different track + } + } + + if (!flight) + { + flight = new TrackedFlight(); + flight->m_id = m_nextId++; + flight->m_aircraft = item; + flight->m_flight = report.m_flight; + flight->m_firstSeen = report.m_received; + item->m_flights.append(flight); + item->m_currentFlight = flight; + } + else if (!report.m_flight.isEmpty() && (flight->m_flight != report.m_flight) + && !flight->m_aliases.contains(report.m_flight)) + { + if (flight->m_flight.isEmpty()) + { + // The identity of the flight already under way became known + flight->m_flight = report.m_flight; + } + else if (flightMatches(flight, report.m_flight)) + { + // The same flight number in the other form, e.g. BA0031 vs BAW31 + addFlightAlias(item, flight, report.m_flight); + } + else + { + // Some airlines' callsigns are unrelated to the flight number + // (e.g. LS0232 vs EXS79HP), so the forms can't be matched by name + // alone. If the name matches the previous flight and that flight + // was seen moments ago, the two are the same flight alternating + // between its ACARS and ADS-B identities - reunite them. + TrackedFlight *previous = (item->m_flights.size() >= 2) + ? item->m_flights[item->m_flights.size() - 2] : nullptr; + // Bounded at both ends, as the flight key match is: a report older than the + // previous flight's last message is not evidence that the two are the same + // flight alternating between its identities + const qint64 sincePrevious = previous && previous->m_lastSeen.isValid() + ? previous->m_lastSeen.secsTo(report.m_received) : -1; + if (previous && flightMatches(previous, report.m_flight) + && previous->m_lastSeen.isValid() + && (sincePrevious >= 0) && (sincePrevious < 10*60)) + { + if (previous->m_on.isValid() || previous->m_in.isValid()) + { + // Except once the previous flight has landed: then the current one is + // the next operation, and a late message for the last one (the IN + // report, or a flight ID that lags the transponder) merged the two + // for good - both routes and both sets of OOOI times on one flight. + // The message is filed against the flight it names instead. + flight = previous; + } + else + { + mergeFlightInto(item, previous, flight); + flight = previous; + } + } + else + { + // A new flight by the same airframe: the old flight's route no + // longer describes the aircraft + item->m_departure.clear(); + item->m_arrival.clear(); + item->m_route.clear(); + flight = new TrackedFlight(); + flight->m_id = m_nextId++; + flight->m_aircraft = item; + flight->m_flight = report.m_flight; + flight->m_firstSeen = report.m_received; + item->m_flights.append(flight); + // The flight it was on is no longer the active one + if (item->m_currentFlight) { + m_dirtyFlights.insert(item->m_currentFlight); + } + item->m_currentFlight = flight; + item->m_mapTrackChanged = true; // A different flight, a different track + } + } + } + + // Another name for this flight, from a message that gave one. An alias rather than + // a rename: the two forms belong to the same operation and neither is more correct, + // and replacing the name would read as a different flight and start a second one. + if (!report.m_flightAlias.isEmpty() && (report.m_flightAlias != flight->m_flight) + && !flight->m_aliases.contains(report.m_flightAlias)) + { + addFlightAlias(item, flight, report.m_flightAlias); + } + + // A late message for the flight before the current one, filed against it above. It + // does not move that flight's last seen time past the start of the current one: the + // two would then overlap, and mergeLoadedFlights() - at the next start, or the next + // time this airframe absorbs a duplicate - merges overlapping flights as one. + TrackedFlight *current = item->m_currentFlight; + const bool lateForPrevious = (flight != current) && current + && current->m_firstSeen.isValid() && report.m_received.isValid() + && (report.m_received >= current->m_firstSeen); + + // The latest report, not the last to arrive - as on the aircraft above. A flight + // whose last seen time went backwards sorts wrongly and reads as finished. + if (!lateForPrevious && report.m_received.isValid() + && (!flight->m_lastSeen.isValid() || (report.m_received > flight->m_lastSeen))) { + flight->m_lastSeen = report.m_received; + } + + // An event happens once, so the first report of it is the one to keep - the same + // event is often re-sent, and a later copy is not a later event + if ((report.m_oooiEvent != AircraftReport::OooiNone) && report.m_oooiTime.isValid()) + { + switch (report.m_oooiEvent) + { + case AircraftReport::OooiOut: if (!flight->m_out.isValid()) { flight->m_out = report.m_oooiTime; } break; + case AircraftReport::OooiOff: if (!flight->m_off.isValid()) { flight->m_off = report.m_oooiTime; } break; + case AircraftReport::OooiOn: if (!flight->m_on.isValid()) { flight->m_on = report.m_oooiTime; } break; + case AircraftReport::OooiIn: if (!flight->m_in.isValid()) { flight->m_in = report.m_oooiTime; } break; + default: break; + } + } + + // Flight profile sample, at most one every 5 seconds. Like the position, the altitude + // and speed are the aircraft's now, so they go to the flight it is flying now. + TrackedFlight *flown = current ? current : flight; + if ((report.m_altitudeValid || report.m_speedValid) && report.m_received.isValid()) + { + qint64 ms = report.m_received.toMSecsSinceEpoch(); + // Loaded before the last sample is looked at - see ensureTrackLoaded() + ensureProfileLoaded(flown); + if (flown->m_profileTimes.isEmpty() || (ms - flown->m_profileTimes.last() >= 5000)) + { + flown->m_profileTimes.append(ms); + flown->m_profileAltFt.append(report.m_altitudeValid ? report.m_altitudeFt : std::numeric_limits::quiet_NaN()); + flown->m_profileSpeedKts.append(report.m_speedValid ? report.m_speedKts : std::numeric_limits::quiet_NaN()); + } + } + + // Route facts a message revealed. They move forward in time only, for the same + // reason the filed routes below do: a delayed message says where the flight was + // going earlier, not where it is going now. Without this the Route column could + // disagree with the route drawn on the Map, which does compare filing times. + // + // A fact we do not hold at all is still worth taking from an older message, since + // the alternative is nothing - but it does not move the clock forward, or the next + // genuinely newer message would be rejected by it. + const bool routeIsNewer = !flight->m_routeFiled.isValid() || !report.m_received.isValid() + || (report.m_received >= flight->m_routeFiled); + // What is held is only a guess from the callsign, so anything an aircraft actually + // said replaces it whatever the clock says. TOM3TW was the case: the route database + // had that callsign as East Midlands to Lanzarote, the aircraft's own FMC filed + // Bristol to Corfu, and the flight was listed as the former while showing the + // latter's flight plan. + const bool guessHeld = flight->m_departureFromDatabase || flight->m_arrivalFromDatabase; + + // A database entry is one route per callsign, filed as a whole. Where a message + // contradicts either end of it, the entry is describing a different operation and + // the other end of it is no more trustworthy than the end just disproved - so the + // whole guess goes, not just the half that was contradicted. + // + // That leaves a field empty where the message names only one end, which is the + // honest outcome: half of a wrong answer is still a wrong answer, and shown beside + // a corrected one it reads as though both had been confirmed. + if (guessHeld) + { + const bool contradicted = + (!report.m_departure.isEmpty() && !flight->m_departure.isEmpty() + && (report.m_departure != flight->m_departure)) + || (!report.m_arrival.isEmpty() && !flight->m_arrival.isEmpty() + && (report.m_arrival != flight->m_arrival)); + if (contradicted) + { + // Only the ends the database supplied - one already corrected by a message + // is not part of the guess being thrown away + if (flight->m_departureFromDatabase) + { + flight->m_departure.clear(); + flight->m_departureFromDatabase = false; + } + if (flight->m_arrivalFromDatabase) + { + flight->m_arrival.clear(); + flight->m_arrivalFromDatabase = false; + } + } + } + + bool routeFactTaken = false; + if (!report.m_departure.isEmpty() + && (routeIsNewer || flight->m_departure.isEmpty() || guessHeld)) + { + flight->m_departure = report.m_departure; + flight->m_departureFromDatabase = false; + routeFactTaken = true; + } + if (!report.m_arrival.isEmpty() + && (routeIsNewer || flight->m_arrival.isEmpty() || guessHeld)) + { + flight->m_arrival = report.m_arrival; + flight->m_arrivalFromDatabase = false; + routeFactTaken = true; + } + // A flight plan comes in parts: one route insert carries the en route path, the next + // only the approach - "ILS 19L" - and an approach is not a route. Newer is not better + // here, so a route that names nothing which can be placed does not replace one that + // does. Without this the second insert overwrote the first, the Route column read + // "ILS 19L", and the line already on the Map was erased as undrawable. + // Worked out once: placing a waypoint searches the navaid list, and a long route + // asked four times over would search it for every fix four times over + const int reportPlaceable = report.m_route.isEmpty() + ? 0 : routePlaceable(report.m_route, report.m_routeWaypoints); + const bool routeIsBetter = report.m_route.isEmpty() || (reportPlaceable >= 2) + || (routePlaceable(flight->m_route, QList()) < 2); + if (!report.m_route.isEmpty() && routeIsBetter && (routeIsNewer || flight->m_route.isEmpty())) + { + flight->m_route = report.m_route; + routeFactTaken = true; + } + if (routeFactTaken && routeIsNewer && report.m_received.isValid()) { + flight->m_routeFiled = report.m_received; + } + // A flight plan and an oceanic clearance both name a list of waypoints, and both + // are drawn. Nothing else that fills in m_route does - the route database fills it + // with the airport pair, which is not a route at all. + // + // ANY part of a plan, not only a path. The arrival end of a plan names no waypoints + // at all - just the STAR and the approach - so testing the route alone dropped that + // insert on the floor and the STAR never reached the plan being assembled. The + // demodulator already had to make this exact correction on its side when it decides + // what counts as a flight plan document; this is the same test, one layer up, and it + // was still the old one. + const bool carriesPlan = !report.m_route.isEmpty() || !report.m_routeRunway.isEmpty() + || !report.m_routeSid.isEmpty() || !report.m_routeStar.isEmpty() + || !report.m_routeApproach.isEmpty() || !report.m_routeAlternate.isEmpty(); + if (carriesPlan) + { + // A route filed before the one being held is a record of what the aircraft was + // cleared onto earlier, not what it is on now. Replacing on arrival rather than + // on filing time let a delayed message overwrite the current route, and redraw + // the Map with it. + // One plan, assembled from the inserts that carry it. An aircraft files the + // departure end - runway, SID and the en route path - in one message and the + // arrival end - STAR and approach - in another, so taking a message whole meant + // the second half replaced the first and the plan was never whole. Each part is + // taken from whichever message carried it instead. + auto file = [this, &report, reportPlaceable](TrackedFlight::FiledRoute& route) + { + if (route.m_filed.isValid() && report.m_received.isValid() + && (report.m_received < route.m_filed)) { + return false; + } + + // Assembled only where it IS the same plan. An insert naming a different + // departure or arrival is a re-file, and then nothing of the old one is + // worth keeping - including what was drawn from it, which has to come off + // the Map here, while the names it was drawn under are still known. + const bool samePlan = + (report.m_departure.isEmpty() || route.m_departure.isEmpty() + || (report.m_departure == route.m_departure)) + && (report.m_arrival.isEmpty() || route.m_arrival.isEmpty() + || (report.m_arrival == route.m_arrival)); + if (!samePlan) + { + removeDrawnRoute(route); + route = TrackedFlight::FiledRoute(); + } + + auto take = [](QString& into, const QString& from) + { + if (!from.isEmpty()) { + into = from; + } + }; + take(route.m_departure, report.m_departure); + take(route.m_arrival, report.m_arrival); + take(route.m_runway, report.m_routeRunway); + take(route.m_sid, report.m_routeSid); + take(route.m_star, report.m_routeStar); + take(route.m_approach, report.m_routeApproach); + take(route.m_alternate, report.m_routeAlternate); + if (report.m_routeFlightLevel > 0) { + route.m_flightLevel = report.m_routeFlightLevel; + } + if (report.m_routeMach > 0.0f) { + route.m_mach = report.m_routeMach; + } + + // The path only from a message that has one, and only when it places at + // least as much as what is held: the arrival end of a plan places nothing, + // and taking it because it is newer erased the line that was drawn + const bool takePath = !report.m_route.isEmpty() + && ((reportPlaceable >= 2) + || (routePlaceable(route.m_waypoints, route.m_points) < 2)); + if (takePath) + { + route.m_waypoints = report.m_route; + route.m_points = report.m_routeWaypoints; + } + + // The message that carried the path, since that is the substantive half and + // the two are otherwise near identical - both are position reports, so + // keeping both would show the same position, altitude and waypoints twice + if (takePath || route.m_text.isEmpty()) { + route.m_text = report.m_documentText; + } + route.m_filed = report.m_received; + return true; + }; + + // Stored either way; drawn only when this is the flight being looked at, which + // sendRouteToMap() decides + if ((report.m_documentKind == AircraftReport::FlightPlan) + || (report.m_documentKind == AircraftReport::DepartureClearance)) + { + if (file(flight->m_flightPlan)) + { + sendRouteToMap(flight, flight->m_flightPlan, "Flight plan"); + // So the plan reaches the ND without waiting for the next report + if (flight->m_aircraft) { + sendToMap(flight->m_aircraft); + } + } + } + else if (report.m_documentKind == AircraftReport::Clearance) + { + if (file(flight->m_clearance)) + { + sendRouteToMap(flight, flight->m_clearance, "Oceanic clearance"); + if (flight->m_aircraft) { + sendToMap(flight->m_aircraft); + } + } + } + } + + // Enrich from the callsign to route database when no message has revealed the + // route - the same database the ADS-B demodulator uses + if (!flight->m_flight.isEmpty() && flight->m_departure.isEmpty() && flight->m_arrival.isEmpty() + && m_routeInfo && m_routeInfo->contains(flight->m_flight)) + { + const AircraftRouteInformation *route = m_routeInfo->value(flight->m_flight); + flight->m_departure = route->m_dep; + flight->m_arrival = route->m_arr; + // Remembered, so that the first message to say otherwise can overturn it. A + // callsign is flown day after day and the database holds one route for it, so + // this is a reasonable guess and no more than that. + flight->m_departureFromDatabase = true; + flight->m_arrivalFromDatabase = true; + if (!route->m_stops.isEmpty()) { + flight->m_route = route->m_stops; + } + } + + // The aircraft-level route facts drive the Map label and popups, so they are the + // current flight's. Only filling them when empty kept the first value for the whole + // flight - a database guess that a flight plan then corrected stayed on the Map while + // the Flights table showed the filed route. + if (flight == item->m_currentFlight) + { + item->m_departure = flight->m_departure; + item->m_arrival = flight->m_arrival; + item->m_route = flight->m_route; + } + + m_dirtyFlights.insert(flight); + m_dirtyFlights.insert(flown); // Its profile, when that went to the current flight + + return flight; +} + +QString AircraftTracker::documentKindName(int kind) const +{ + switch (kind) + { + case AircraftReport::AcarsText: return "Text"; + case AircraftReport::PositionReport: return "Position report"; + case AircraftReport::OooiEvent: return "OOOI"; + case AircraftReport::Loadsheet: return "Loadsheet"; + case AircraftReport::FlightPlan: return "Flight plan"; + case AircraftReport::Clearance: return "Clearance"; + case AircraftReport::DepartureClearance: return "Departure clearance"; + case AircraftReport::ClearanceRequest: return "Clearance request"; + case AircraftReport::AtisRequest: return "ATIS request"; + case AircraftReport::WeatherRequest: return "Weather request"; + case AircraftReport::AirlineDownlink: return "Airline downlink"; + case AircraftReport::AircrewMessage: return "Aircrew message"; + case AircraftReport::EmergencyMessage: return "Emergency"; + case AircraftReport::Cpdlc: return "CPDLC"; + case AircraftReport::Logon: return "Logon"; + case AircraftReport::PerformanceReport: return "Performance"; + default: return ""; + } +} + +// Collect notable documents - flight plans, clearances, loadsheets, logons, +// OOOI events - against the flight they belong to. Plain ACARS messages would +// flood the log so they are not collected, and CPDLC goes to the ATC log. +void AircraftTracker::addDocument(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report) +{ + switch (report.m_documentKind) + { + case AircraftReport::Loadsheet: + case AircraftReport::FlightPlan: + case AircraftReport::Clearance: + case AircraftReport::DepartureClearance: + case AircraftReport::ClearanceRequest: + case AircraftReport::AtisRequest: + case AircraftReport::WeatherRequest: + case AircraftReport::AirlineDownlink: + case AircraftReport::AircrewMessage: + case AircraftReport::EmergencyMessage: + case AircraftReport::Logon: + case AircraftReport::OooiEvent: + break; + default: + return; + } + if (report.m_documentText.isEmpty()) { + return; + } + // Retransmissions produce identical documents back to back + if (!flight->m_documents.isEmpty() + && (flight->m_documents.last()->m_kind == (int) report.m_documentKind) + && (flight->m_documents.last()->m_text == report.m_documentText)) { + return; + } + + TrackedDocument *doc = new TrackedDocument(); + doc->m_kind = report.m_documentKind; + doc->m_title = report.m_documentTitle.isEmpty() ? documentKindName(report.m_documentKind) : report.m_documentTitle; + doc->m_text = report.m_documentText; + doc->m_received = report.m_received; + if (report.m_documentDerivable) + { + doc->m_raw = report.m_documentRaw; + doc->m_source = report.m_documentSource; + // Rendered here rather than taken from the report, so that what is shown live is + // produced by exactly the same call that will produce it after a reload. Taking + // the report's text would leave the two able to differ, and the difference would + // only appear the next time the session was opened. + const QString rendered = renderDocument(doc->m_raw, doc->m_source); + if (!rendered.isEmpty()) { + doc->m_text = rendered; + } + } + flight->m_documents.append(doc); + + m_pendingDocuments.append(documentEvent(item, flight, doc)); + m_dirtyFlights.insert(flight); + m_dbDirty = true; +} + +// Log of controller-pilot data link messages across all channels. Only the +// concise ATC message text (e.g. "WILCO") is kept, not the full decode. +QString AircraftTracker::weatherKindName(int kind) +{ + switch (kind) + { + case AircraftReport::Metar: return "METAR"; + case AircraftReport::Taf: return "TAF"; + case AircraftReport::Atis: return "D-ATIS"; + case AircraftReport::Twip: return "TWIP"; + case AircraftReport::Notam: return "NOTAM"; + case AircraftReport::Pirep: return "PIREP"; + case AircraftReport::Sigmet: return "SIGMET"; + default: return "Weather"; + } +} + +// Weather reaches us through whichever aircraft asked for it, but it describes an +// airport, so it is logged on its own rather than against that aircraft. +void AircraftTracker::addWeatherReport(TrackedAircraft *item, const AircraftReport& report) +{ + if ((report.m_weatherKind == AircraftReport::WeatherNone) + || report.m_weatherText.isEmpty()) { + return; + } + + WeatherEvent e; + e.m_received = report.m_received; + e.m_airport = report.m_weatherAirport; + e.m_kind = weatherKindName(report.m_weatherKind); + e.m_text = report.m_weatherText; + // The report is HTML, which a table cell shows as tags - the detail pane below + // the table renders it. One line of plain text is what the Report column wants + e.m_summary = QTextDocumentFragment::fromHtml(e.m_text).toPlainText() + .replace('\n', " ").simplified(); + e.m_from = !item->m_flight.isEmpty() ? item->m_flight : regFor(item); + + // The same METAR is sent to every aircraft that asks, so the identical report + // arrives again and again. Only a genuinely new one is worth a row. + // + // This used to scan the whole log, comparing the full text of every entry against + // every arrival - and since the log only grows, the cost per report grew with it, on + // the tracker thread, for exactly the traffic that produces the most repeats. + const size_t key = weatherKey(e); + for (auto it = m_weatherIndex.constFind(key); + (it != m_weatherIndex.constEnd()) && (it.key() == key); ++it) + { + // value() rather than at(): should the log ever be cleared without the index, + // a stale position then simply fails to match and the report is logged again, + // where at() would be undefined behaviour + const WeatherEvent seen = m_weatherLog.value(it.value()); + if ((seen.m_airport == e.m_airport) && (seen.m_kind == e.m_kind) + && (seen.m_text == e.m_text)) { + return; + } + } + + m_weatherIndex.insert(key, m_weatherLog.size()); + m_weatherLog.append(e); + m_pendingWeather.append(e); +} + +void AircraftTracker::addAtcMessage(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report) +{ + if ((report.m_documentKind != AircraftReport::Cpdlc) || report.m_atc.isEmpty()) { + return; + } + + QString flightName = !flight->m_flight.isEmpty() ? flight->m_flight : regFor(item); + + AtcEvent e; + e.m_aircraftId = item->m_id; + e.m_flightId = flight->m_id; + e.m_received = report.m_received; + e.m_protocol = documentKindName(report.m_documentKind); + e.m_link = sourceText(report.m_protocol, report.m_frequency); + e.m_uplink = report.m_uplink; + e.m_from = report.m_uplink ? report.m_station : flightName; + e.m_to = report.m_uplink ? flightName : report.m_station; + e.m_message = QString(report.m_atc).replace('\n', "; "); + e.m_tooltip = report.m_atc; + e.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; + + // Retransmissions produce identical messages back to back + if (!m_atcLog.isEmpty() + && (m_atcLog.last().m_message == e.m_message) + && (m_atcLog.last().m_from == e.m_from) + && (m_atcLog.last().m_to == e.m_to)) { + return; + } + + m_atcLog.append(e); + m_pendingAtc.append(e); + m_dbDirty = true; +} + +// Work out which aircraft a SELCAL call was for, and give the report its identity so it +// is processed like any other. A code is assigned to several aircraft, so it is only +// pinned on one when nothing else could have been meant: +// +// - exactly one of the aircraft holding the code is being heard now, or +// - the database gives the code to one aircraft only, and that one is in the archive. +// Being called on a voice channel means it is flying, so it is made active again. +// +// Anything else - several candidates in the air, or none being tracked - is logged +// against nobody. Guessing would make up an aircraft, and a made up aircraft is far +// harder to notice than an unattributed call. A call never creates an aircraft: with no +// identity and no position there would be nothing to show for it. +bool AircraftTracker::attributeSelcal(AircraftReport& report) +{ + const QString code = SELCALDB::normalizeCode(report.m_selcalCode); + if (code.isEmpty()) { + return false; + } + report.m_selcalCode = code; + + const QStringList registrations = SELCALDB::getRegistrations(code); + QList tracked; + + for (const QString& registration : registrations) + { + // By registration, and failing that by the ICAO address the aircraft database + // gives it, since an airframe heard only on ADS-B may not have a registration yet + TrackedAircraft *item = m_byKey.value(regKey(registration)); + if (!item && m_aircraftInfo && m_aircraftInfo->contains(registration)) + { + const quint32 icao = (quint32) m_aircraftInfo->value(registration)->m_icao; + if (icao) { + item = m_byKey.value(icaoKey(icao)); + } + } + if (item && !tracked.contains(item)) { + tracked.append(item); + } + } + + QList active; + for (TrackedAircraft *item : tracked) + { + if (item->m_active) { + active.append(item); + } + } + + TrackedAircraft *chosen = nullptr; + if (active.size() == 1) { + chosen = active.first(); + } else if (active.isEmpty() && (registrations.size() == 1) && (tracked.size() == 1)) { + chosen = tracked.first(); + } + + if (!chosen) + { + logSelcalCall(nullptr, nullptr, report, registrations); + + // Still a message heard on this protocol, so it counts towards the rates and + // totals - just with no aircraft to set a record or be counted as heard + m_chartCounts[AircraftReport::SELCAL]++; + m_chartCounts[AircraftReport::ProtocolCount]++; + const QDateTime when = report.m_received.isValid() ? report.m_received + : QDateTime::currentDateTime(); + for (AircraftStatistics::Scope *scope : { &m_statistics.m_session, &m_statistics.m_allTime }) { + scope->update(report.m_protocol, false, 0.0f, false, 0.0f, false, 0.0f, QString(), + when, false, 0.0f, 0.0f, report.m_frequency); + } + m_statisticsDirty = true; + return false; + } + + report.m_icao = chosen->m_icao; + report.m_registration = chosen->m_registration; + return true; +} + +// A SELCAL call in the ATC log, with the aircraft it was for where that is known. From +// is the frequency it was heard on: the call carries no station, and the frequency is +// what says which oceanic control or airline radio made it. +void AircraftTracker::logSelcalCall(TrackedAircraft *item, TrackedFlight *flight, + const AircraftReport& report, const QStringList& candidates) +{ + AtcEvent e; + e.m_aircraftId = item ? item->m_id : 0; + e.m_flightId = flight ? flight->m_id : 0; + e.m_received = report.m_received; + e.m_protocol = protocolName(AircraftReport::SELCAL); + e.m_uplink = true; + e.m_from = report.m_frequency + ? QString("%1 MHz").arg(report.m_frequency / 1e6, 0, 'f', 3) : QString(); + e.m_message = QString("SELCAL %1").arg(report.m_selcalCode); + + if (item) + { + e.m_to = (flight && !flight->m_flight.isEmpty()) ? flight->m_flight : regFor(item); + e.m_tooltip = QString("SELCAL %1 called %2").arg(report.m_selcalCode, regFor(item)); + e.m_mapName = item->m_mapName.isEmpty() ? mapItemName(item) : item->m_mapName; + } + else if (candidates.isEmpty()) + { + e.m_to = "Unknown"; + e.m_tooltip = QString("SELCAL %1 is not assigned to any aircraft in the SELCAL" + " database, or the database has not been downloaded").arg(report.m_selcalCode); + } + else + { + e.m_to = (candidates.size() == 1) ? candidates.first() + : QString("%1 aircraft").arg(candidates.size()); + e.m_tooltip = QString("SELCAL %1 is assigned to %2. None could be picked out as the" + " one called: either none is being heard, or more than one is") + .arg(report.m_selcalCode, candidates.join(", ")); + } + + // A ground station calls more than once when the crew is slow to answer, and the + // decoder can report one transmission twice. Calls close together are one event. + if (!m_atcLog.isEmpty()) + { + const AtcEvent& last = m_atcLog.last(); + if ((last.m_message == e.m_message) && (last.m_from == e.m_from) && (last.m_to == e.m_to) + && last.m_received.isValid() && e.m_received.isValid() + && (std::abs(last.m_received.secsTo(e.m_received)) < 30)) { + return; + } + } + + m_atcLog.append(e); + m_pendingAtc.append(e); + m_dbDirty = true; +} + +// Speech and command notifications for aircraft matching the user's rules. +// Each rule fires at most once per aircraft. Speech is passed to the GUI; +// commands run here, so they work in server mode too. +void AircraftTracker::checkNotifications(TrackedAircraft *item, const AircraftReport& report) +{ + for (int i = 0; i < m_settings.m_notificationSettings.size(); i++) + { + if (item->m_notifiedRules.contains(i)) { + continue; + } + const AircraftSettings::NotificationSettings *rule = m_settings.m_notificationSettings[i].data(); + + QString match; + switch (rule->m_matchColumn) + { + case AircraftSettings::MATCH_ICAO: + if (item->m_icao) { + match = QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper(); + } + break; + case AircraftSettings::MATCH_REG: + match = item->m_registration; + break; + case AircraftSettings::MATCH_FLIGHT: + match = item->m_flight; + break; + case AircraftSettings::MATCH_TYPE: + if (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) { + match = m_aircraftInfo->value(item->m_registration)->m_type; + } + break; + default: + break; + } + + if (!match.isEmpty() + && rule->m_regularExpression.isValid() + && rule->m_regularExpression.match(match).hasMatch()) + { + item->m_notifiedRules.insert(i); + if (!rule->m_speech.isEmpty()) { + emit speechNotification(subAircraftString(item, report, rule->m_speech)); + } + if (!rule->m_command.isEmpty()) { + commandNotification(item, report, rule->m_command); + } + } + } +} + +QString AircraftTracker::subAircraftString(TrackedAircraft *item, const AircraftReport& report, const QString& string) const +{ + QString type; + if (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) { + type = m_aircraftInfo->value(item->m_registration)->m_type; + } + const QHash values { + {"icao", item->m_icao ? QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper() : QString()}, + {"reg", item->m_registration}, + {"flight", item->m_flight}, + {"type", type}, + {"protocol", protocolName(report.m_protocol)} + }; + + // In one pass over the template, so a value is never searched for variables itself. + // Replacing them one after another did exactly that: a registration or flight number + // comes off the air, and one reading "${type}" was expanded again by the next step. + static const QRegularExpression variable(R"(\$\{(\w+)\})"); + QString s; + int last = 0; + QRegularExpressionMatchIterator it = variable.globalMatch(string); + while (it.hasNext()) + { + const QRegularExpressionMatch match = it.next(); + s += string.mid(last, match.capturedStart() - last); + auto value = values.constFind(match.captured(1)); + s += (value != values.constEnd()) ? value.value() : match.captured(0); + last = match.capturedEnd(); + } + s += string.mid(last); + return s; +} + +// The template is split into arguments BEFORE the aircraft's details go in. They come off +// the air - anyone transmitting chooses them - so substituting first let quotes and spaces +// in a received registration or flight number become argument boundaries, adding arguments +// to the user's program. Substituted per argument, a value stays within the one it was put in. +void AircraftTracker::commandNotification(TrackedAircraft *item, const AircraftReport& report, + const QString& command) +{ +#if QT_CONFIG(process) + QStringList allArgs = QProcess::splitCommand(command); + if (allArgs.size() > 0) + { + for (QString& arg : allArgs) { + arg = subAircraftString(item, report, arg); + } + QString program = allArgs[0]; + allArgs.pop_front(); + QProcess::startDetached(program, allArgs); + } +#else + (void) item; + (void) report; + qWarning() << "AircraftTracker::commandNotification: QProcess not supported. Can't run: " << command; +#endif +} + + +// The all time figures outlive the session that set them, so they travel in the settings +// as an opaque blob - a versioned stream rather than a settings key each, so that adding +// a statistic later does not need a new key and cannot collide with one. +// +// The session side is deliberately not written: it is defined by the run it describes. +// Nor is the all time aircraft count, which the database holds - see AircraftStatistics. +// +// Version 1 held the records alone. It still reads, and its records become the all time +// records, which is what they always were. Version 3 added where each record was set; +// records read from an older blob simply have no position, and are not drawn on the Map. +// Version 4 added the frequency it was heard on, which an older record likewise lacks. +QByteArray AircraftTracker::serializeStatistics(const AircraftStatistics& statistics) +{ + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly); + stream.setVersion(QDataStream::Qt_5_15); + + stream << (quint32) 4; // format version + stream << (quint32) AircraftReport::ProtocolCount; + + auto put = [&stream](const AircraftStatistics::Record& r) + { + stream << r.m_valid << r.m_value << r.m_aircraft << r.m_when; + // Added in version 3 + stream << r.m_positionValid << r.m_latitude << r.m_longitude + << r.m_altitudeValid << r.m_altitudeFt; + stream << r.m_frequency; // Added in version 4 + }; + + const AircraftStatistics::Scope& all = statistics.m_allTime; + for (int i = 0; i < AircraftReport::ProtocolCount; i++) { + put(all.m_maxRange[i]); + } + put(all.m_fastest); + put(all.m_highest); + stream << all.m_maxConcurrent << all.m_maxConcurrentWhen; + + // Added in version 2 + stream << all.m_totalMessages; + for (int i = 0; i < AircraftReport::ProtocolCount; i++) { + stream << all.m_messagesByProtocol[i]; + } + stream << all.m_seconds << statistics.m_firstStart; + return data; +} + +AircraftStatistics AircraftTracker::deserializeStatistics(const QByteArray& data) +{ + AircraftStatistics statistics; + if (data.isEmpty()) { + return statistics; + } + + QDataStream stream(data); + stream.setVersion(QDataStream::Qt_5_15); + + quint32 version = 0; + quint32 protocols = 0; + stream >> version >> protocols; + // The protocol count is bounded too: a corrupt blob could otherwise ask for four + // billion records from a stream that has already run dry. Far more than there will + // ever be protocols, but small enough that a nonsense count is caught. + if ((version < 1) || (version > 4) || (protocols > 256) || (stream.status() != QDataStream::Ok)) { + return statistics; // Written by something else, or truncated: start clean + } + + auto get = [&stream, version](AircraftStatistics::Record& r) + { + stream >> r.m_valid >> r.m_value >> r.m_aircraft >> r.m_when; + if (version >= 3) + { + stream >> r.m_positionValid >> r.m_latitude >> r.m_longitude + >> r.m_altitudeValid >> r.m_altitudeFt; + } + if (version >= 4) { + stream >> r.m_frequency; + } + }; + + AircraftStatistics::Scope& all = statistics.m_allTime; + + // Read what was written even if the protocol list has grown since; records for + // protocols that did not exist then simply stay unset + for (quint32 i = 0; i < protocols; i++) + { + AircraftStatistics::Record r; + get(r); + if (i < (quint32) AircraftReport::ProtocolCount) { + all.m_maxRange[i] = r; + } + } + get(all.m_fastest); + get(all.m_highest); + stream >> all.m_maxConcurrent >> all.m_maxConcurrentWhen; + + if (version >= 2) + { + stream >> all.m_totalMessages; + for (quint32 i = 0; i < protocols; i++) + { + quint64 n = 0; + stream >> n; + if (i < (quint32) AircraftReport::ProtocolCount) { + all.m_messagesByProtocol[i] = n; + } + } + stream >> all.m_seconds >> statistics.m_firstStart; + } + + if (stream.status() != QDataStream::Ok) { + return AircraftStatistics(); + } + return statistics; +} + + +// A 3D model for the map, for aircraft the ADS-B demodulator is not providing one for. +// +// This is the same matcher ADS-B uses - it moved to sdrbase so both can share it - and it +// works from the model name, manufacturer and operator in the OpenSky database, which is +// reached through the registration. So an aircraft heard only on ACARS, HFDL or Aero now +// gets a model too, which is most of the oceanic traffic ADS-B cannot see at all. +// +// Chosen ONCE and kept. The livery is picked at random where there is a choice, so asking +// again on every report would change the aircraft's appearance as it flew. +void AircraftTracker::update3DModel(TrackedAircraft *item) +{ + if (!item->m_model3D.isEmpty()) { + return; + } + + const AircraftInformation *info = nullptr; + if (m_aircraftInfo && !item->m_registration.isEmpty()) + { + auto it = m_aircraftInfo->find(item->m_registration); + if (it != m_aircraftInfo->end()) { + info = it.value(); + } + } + + QString model; + float altitudeOffset = 0.0f; + float labelOffset = 0.0f; + bool matched = info && Aircraft3DModels::instance().modelFor( + info, m_settings.m_favourLivery, false, model, altitudeOffset, labelOffset); + + if (!matched) + { + // Only a fraction of types have a model of their own, and an aircraft we know + // nothing about has none either. Rather than leave it as a flat billboard among + // modelled aircraft, stand in something of about the right shape and size + matched = Aircraft3DModels::instance().defaultModel( + info ? info->m_type : QString(), model, altitudeOffset, labelOffset); + } + + if (matched) + { + item->m_model3D = model; + item->m_modelAltitudeOffset = altitudeOffset; + item->m_labelAltitudeOffset = labelOffset; + item->m_modelIsOurs = true; + } +} + +// Where the receiver was for a report that arrived on this device set. +// +// A device can know where it is - a remote SDR reports the server's position - and that +// is the antenna that actually heard the aircraft, so it is preferred over My Position. +// getDevicePosition() leaves its arguments alone and returns false when the device has +// none, which makes the fallback a single call. +// +// It is cached because that helper builds an entire device report and parses it as JSON: +// far too expensive per message, but nothing here moves quickly, so a periodic refresh +// picks up a device that has just learned where it is. +QGeoCoordinate AircraftTracker::receiverPosition(int deviceSetIndex) +{ + const QDateTime now = QDateTime::currentDateTime(); + if (!m_devicePositionsRefreshed.isValid() + || (m_devicePositionsRefreshed.secsTo(now) > 60)) + { + m_devicePositions.clear(); + m_devicePositionsRefreshed = now; + } + + auto cached = m_devicePositions.find(deviceSetIndex); + if (cached != m_devicePositions.end()) { + return cached.value(); + } + + float latitude = MainCore::instance()->getSettings().getLatitude(); + float longitude = MainCore::instance()->getSettings().getLongitude(); + float altitude = MainCore::instance()->getSettings().getAltitude(); + + if (deviceSetIndex >= 0) { + ChannelWebAPIUtils::getDevicePosition((unsigned int) deviceSetIndex, latitude, longitude, altitude); + } + + QGeoCoordinate position(latitude, longitude, altitude); + m_devicePositions.insert(deviceSetIndex, position); + return position; +} + +// What the web API's report says. Counted on demand rather than kept, because it is +// asked for rarely and would otherwise be another thing to keep in step. +AircraftTracker::Totals AircraftTracker::totals() const +{ + QMutexLocker locker(&m_totalsMutex); + return m_totals; +} + +// On the tracker's thread, which is the only one that may walk the aircraft +void AircraftTracker::updateTotals() +{ + Totals totals; + totals.m_aircraft = m_aircraft.size(); + for (const TrackedAircraft *item : m_aircraft) + { + if (item->m_active) { + totals.m_activeAircraft++; + } + totals.m_flights += item->m_flights.size(); + } + totals.m_messages = m_statistics.m_session.m_totalMessages; + for (int i = 0; i < AircraftReport::ProtocolCount; i++) { + totals.m_messagesByProtocol[i] = m_statistics.m_session.m_messagesByProtocol[i]; + } + QMutexLocker locker(&m_totalsMutex); + m_totals = totals; +} + +// Records, counters and the concurrent aircraft window +void AircraftTracker::updateStatistics(const AircraftReport& report, TrackedAircraft *item, + bool rangeValid, float rangeKm, + bool altitudeValid, float altitudeFt) +{ + m_statisticsDirty = true; + + const QString who = !item->m_registration.isEmpty() ? item->m_registration + : (!item->m_flight.isEmpty() ? item->m_flight + : QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper()); + const QDateTime when = report.m_received.isValid() ? report.m_received + : QDateTime::currentDateTime(); + + // rangeValid/rangeKm describe the position THIS report carried - see the note where + // they are worked out. A report that carried none measures nothing, which is what + // keeps ADS-B distances from being credited to HFDL's text-only reports. + // + // The position stored with a record is the one THIS report carried, for the same + // reason: it is the fix the range was measured from, so it is where the record was + // set. Exactly 0N 0E is a zeroed field rather than a place, as it is on ingest. + const bool positionValid = report.m_positionValid + && ((report.m_latitude != 0.0f) || (report.m_longitude != 0.0f)); + + m_statistics.m_session.update(report.m_protocol, rangeValid, rangeKm, + item->m_speedValid, item->m_speedKts, altitudeValid, altitudeFt, who, when, + positionValid, report.m_latitude, report.m_longitude, report.m_frequency); + m_statistics.m_allTime.update(report.m_protocol, rangeValid, rangeKm, + item->m_speedValid, item->m_speedKts, altitudeValid, altitudeFt, who, when, + positionValid, report.m_latitude, report.m_longitude, report.m_frequency); + + // First time this airframe has been heard in this session - which is not the same as + // the first time it was tracked, because the tracked list is restored from the + // database at startup + if (!m_sessionHeard.contains(item->m_id)) + { + m_sessionHeard.insert(item->m_id); + m_statistics.m_session.m_distinctAircraft = m_sessionHeard.size(); + } + + // Counted into the all time figure separately, and only once it can be identified + // well enough to recognise again on another day + if (!m_sessionRecorded.contains(item->m_id)) + { + int countDelta = 0; + if (recordSeen(item, countDelta) >= 0) + { + m_sessionRecorded.insert(item->m_id); + if (countDelta != 0) + { + m_statistics.m_allTime.m_distinctAircraft = + std::max(0, m_statistics.m_allTime.m_distinctAircraft + countDelta); + m_statisticsDirty = true; + } + } + } +} + +// The most aircraft heard within any 15 minute window. Counted over what has actually +// been heard recently rather than over the tracked list, which holds aircraft for far +// longer than that and would only ever report the retention period's total. +void AircraftTracker::updateConcurrent(const QDateTime& now) +{ + int concurrent = 0; + for (const TrackedAircraft *item : m_aircraft) + { + if (item->m_lastSeen.isValid() + && (item->m_lastSeen.secsTo(now) <= AircraftStatistics::ConcurrentWindowMins * 60)) { + concurrent++; + } + } + for (AircraftStatistics::Scope *scope : { &m_statistics.m_session, &m_statistics.m_allTime }) + { + if (concurrent > scope->m_maxConcurrent) + { + scope->m_maxConcurrent = concurrent; + scope->m_maxConcurrentWhen = now; + m_statisticsDirty = true; + } + } +} + +// Everything a rule does, in the order the rules are held. Two lists with the same +// signature address the same aircraft in the same way, whatever else has changed in the +// settings, so the record of which have already fired still means what it says. +QString AircraftTracker::notificationSignature(const AircraftSettings& settings) +{ + QStringList parts; + for (const auto& rule : settings.m_notificationSettings) + { + if (rule) { + parts.append(QString("%1\x1f%2\x1f%3\x1f%4").arg(rule->m_matchColumn) + .arg(rule->m_regExp).arg(rule->m_speech).arg(rule->m_command)); + } + } + return parts.join(QChar(0x1e)); +} + +QString AircraftTracker::protocolName(int protocol) +{ + switch (protocol) + { + case AircraftReport::ADSB: return "ADS-B"; + case AircraftReport::ACARS: return "ACARS"; + case AircraftReport::VDL2: return "VDL2"; + case AircraftReport::HFDL: return "HFDL"; + case AircraftReport::AERO: return "Aero"; + case AircraftReport::SELCAL: return "SELCAL"; + case AircraftReport::IRIDIUM: return "Iridium"; + default: return "?"; + } +} + +// E.g: {"ADS-B", "ACARS 131.725", "HFDL 5.720"}. ADS-B has no frequency - it is +// always 1090 MHz. +QString AircraftTracker::sourceText(int protocol, qint64 frequency) +{ + QString text = protocolName(protocol); + + if ((frequency != 0) && (protocol != (int) AircraftReport::ADSB)) { + text += QString(" %1").arg(frequency / 1e6, 0, 'f', 3); + } + + return text; +} + +QStringList AircraftTracker::sourcesList(const QHash, int>& sources) const +{ + QStringList parts; + QList> keys = sources.keys(); + std::sort(keys.begin(), keys.end()); + for (const auto& key : keys) + { + QString part = sourceText(key.first, key.second); + if (!parts.contains(part)) { + parts.append(part); + } + } + return parts; +} + +QString AircraftTracker::sourcesText(const QHash, int>& sources) const +{ + return sourcesList(sources).join("; "); +} + +// Name on the Map: registration when known, otherwise flight, otherwise the ICAO +// address in hex, so successive reports update one item +// How a flight is written on the Map: either as flown (BAW123) or as ATC says it +// (SPEEDBIRD 123), which is what is heard on the radio +QString AircraftTracker::flightLabel(const QString& flight) const +{ + if (!m_settings.m_atcCallsigns || (flight.size() < 3)) { + return flight; + } + + const Airline *airline = Airline::getByICAO(flight.left(3)); + + if (airline && !airline->m_callsign.isEmpty()) { + return QString("%1 %2").arg(airline->m_callsign, flight.mid(3)); + } + return flight; +} + +QString AircraftTracker::mapItemName(const TrackedAircraft *item) const +{ + return aircraftMapItemName(item->m_registration, item->m_flight, item->m_icao); +} + +// ATC style Map label, like the ADS-B demodulator's: identity, route, flight +// level, then speed and type +QString AircraftTracker::atcLabel(const TrackedAircraft *item) const +{ + QStringList lines; + lines.append(!item->m_flight.isEmpty() ? flightLabel(item->m_flight) : mapItemName(item)); + if (!item->m_departure.isEmpty() && !item->m_arrival.isEmpty()) { + lines.append(QString("%1-%2").arg(item->m_departure).arg(item->m_arrival)); + } + if (item->m_altitudeValid && item->m_positionValid) + { + QChar c = item->m_altitudeFt >= 6000.0f ? 'F' : 'A'; + lines.append(QString("%1%2").arg(c).arg((int) (item->m_altitudeFt / 100.0f))); + } + QStringList row; + if (item->m_speedValid) { + row.append(QString("G%1").arg((int) item->m_speedKts)); + } + if (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) + { + const QString& type = m_aircraftInfo->value(item->m_registration)->m_type; + if (!type.isEmpty()) { + row.append(type); + } + } + if (!row.isEmpty()) { + lines.append(row.join(" ")); + } + return lines.join("
"); +} + +// Map icon by aircraft type, reusing the ADS-B demodulator's icon set (its qrc +// resources are process wide) +QString AircraftTracker::aircraftImage(const TrackedAircraft *item) const +{ + return aircraftImage(item->m_registration, item->m_model3D); +} + +QString AircraftTracker::aircraftImage(const QString& registration, const QString& model3D) const +{ + static const QStringList fourEngineTypes = { + "A388", "B741", "B742", "B743", "B744", "B748", "B74R", "B74S", "BLCF", + "A342", "A343", "A345", "A346", "C17", "K35R"}; + static const QStringList heavyTwinTypes = { + "B772", "B773", "B77L", "B77W", "B788", "B789", "B78X", + "A332", "A333", "A338", "A339", "A359", "A35K", + "B762", "B763", "B764", "MD11", "DC10"}; + static const QStringList smallTypes = { + "GLF4", "GLF5", "GLF6", "GLEX", "GL5T", "CL60", "C25A", "C25B", "C25C", + "C525", "C550", "C560", "C56X", "C680", "C68A", "C750", "E50P", "E55P", + "E545", "E550", "F2TH", "F900", "FA7X", "FA8X", "LJ35", "LJ45", "LJ60", + "PC24", "PRM1", "HDJT"}; + + // The livery icons are named after the 3D models they were rendered from + // (e.g. BB_Airbus_png/A320/A320_BAW.gltf -> A320_BAW.png), so an aircraft's icon + // follows its matched model's basename. Like the plain icons, they are the ADS-B + // demodulator's resources, so may not exist in every build + if (m_settings.m_useLiveryIcons && !model3D.isEmpty()) + { + QString image = QString("liveries/%1.png").arg(Aircraft3DModels::liveryIconName(model3D)); + if (QFile::exists(":/map/" + image)) { + return image; + } + } + + QString name = "aircraft_large.png"; + if (m_aircraftInfo && m_aircraftInfo->contains(registration)) + { + const QString& type = m_aircraftInfo->value(registration)->m_type; + if (fourEngineTypes.contains(type)) { + name = "aircraft_heavy_4engine.png"; + } else if (heavyTwinTypes.contains(type)) { + name = "aircraft_heavy_2engine.png"; + } else if (smallTypes.contains(type)) { + name = "aircraft_small.png"; + } + } + // No model match - use a white version of the plain icon, so the style stays + // consistent with the livery icons rather than dropping back to black + if (m_settings.m_useLiveryIcons && QFile::exists(":/map/liveries/" + name)) { + return "liveries/" + name; + } + return name; +} + +// A position is timestamped when it was measured, an altitude when IT was measured, +// and on ADS-B those are different messages - a Mode S altitude reply carries no +// position. Pairing a fix with whatever altitude arrived most recently therefore states +// a height the aircraft had at some other moment. With the two most recent altitude +// observations bracketing the fix, the right value is a linear interpolation between +// them; outside that, the nearest is the best available and is used unchanged. +float AircraftTracker::altitudeAt(const TrackedAircraft *item, const QDateTime& when, float fallbackFt) +{ + if (!when.isValid() || !item->m_altitudeDateTime.isValid() + || !item->m_prevAltitudeDateTime.isValid()) + { + return fallbackFt; // Nothing timestamped to work from + } + const qint64 span = item->m_prevAltitudeDateTime.msecsTo(item->m_altitudeDateTime); + const qint64 offset = item->m_prevAltitudeDateTime.msecsTo(when); + if ((span <= 0) || (offset < 0) || (offset > span)) { + return fallbackFt; // Not between the two, so nothing to interpolate + } + const float t = (float) offset / (float) span; + return item->m_prevAltitudeFt + t * (item->m_altitudeFt - item->m_prevAltitudeFt); +} + +// How long a position stays believable, as a CZML availability interval. Without one an +// entity is available for ever, and on the 3D map that means its model and every texture +// the model carries stay resident until something explicitly deletes it - which was +// enough to exhaust GPU texture memory and lose the WebGL context on a busy sky. +// +// The window has to match how often the protocol that gave us the position actually +// reports. ADS-B is about once a second, so the demodulator's 61 seconds is right for +// it; a position that came from ACARS, VDL-2 or HFDL can be the only one for many +// minutes, and expiring it that fast would make the aircraft flicker. +// How long the position we hold stays believable. ADS-B reports about once a second, +// so a position a minute old means we have stopped hearing the aircraft; a position +// from ACARS, VDL-2 or HFDL may be the only one for many minutes and expiring it as +// fast would leave the aircraft off the map almost always. +int AircraftTracker::positionTimeoutSecs(const TrackedAircraft *item) const +{ + const int mins = (item->m_positionRank == PositionAdsb) ? m_settings.m_adsbPositionMins + : m_settings.m_acarsPositionMins; + // The extra second is the demodulator's, for CesiumGS/cesium#12426 + return (mins * 60) + 1; +} + +bool AircraftTracker::positionStale(const TrackedAircraft *item, const QDateTime& now) const +{ + return item->m_positionDateTime.isValid() + && (item->m_positionDateTime.secsTo(now) > positionTimeoutSecs(item)); +} + +QDateTime AircraftTracker::mapAvailableUntil(const TrackedAircraft *item) const +{ + if (!item->m_positionDateTime.isValid()) { + return QDateTime(); + } + return item->m_positionDateTime.addSecs(positionTimeoutSecs(item)); +} + +// The whole collated track, so it survives gaps between protocols. Each +// coordinate must carry its time - the Map dereferences it unconditionally. +// Selecting one of an aircraft's past flights draws that flight's track instead of the +// one it is on now. The icon is left where the aircraft actually is - the track is +// history, the aircraft is not +// The flight whose track is drawn, with its stored points fetched. Everything that draws +// goes through here rather than trackFlight() directly, or a restored flight would be +// drawn as however much of it has been heard since - usually nothing. +AircraftTracker::TrackedFlight *AircraftTracker::trackFlightLoaded(TrackedAircraft *item) +{ + TrackedFlight *flight = const_cast(trackFlight(item)); + ensureTrackLoaded(flight); + return flight; +} + +const AircraftTracker::TrackedFlight *AircraftTracker::trackFlight(const TrackedAircraft *item) const +{ + if (m_watchedFlight != 0) + { + for (const TrackedFlight *flight : item->m_flights) + { + if (flight->m_id == m_watchedFlight) { + return flight; + } + } + } + return item->m_currentFlight; +} + +QList *AircraftTracker::buildTrack(const TrackedFlight *flight) const +{ + QList *track = new QList(); + if (!flight) { + return track; // An empty list, not null: null means "unchanged" to the Map + } + for (int i = 0; i < flight->m_track.size(); i++) + { + SWGSDRangel::SWGMapCoordinate *coord = new SWGSDRangel::SWGMapCoordinate(); + coord->setLatitude(flight->m_track[i].latitude()); + coord->setLongitude(flight->m_track[i].longitude()); + coord->setAltitude(flight->m_track[i].altitude()); + // WithMs, not Qt::ISODate: that is whole seconds, and two positions in the + // same second then reach the Map with identical times - which the Map's + // Whittaker-Eilers smoother divides by, giving inf and then nan + coord->setDateTime(new QString(flight->m_trackTimes[i].toString(Qt::ISODateWithMs))); + track->append(coord); + } + return track; +} + +void AircraftTracker::sendToMap(TrackedAircraft *item) +{ + // The Map shows what we are currently hearing. Archived aircraft are taken off it + // by setActive(), and must not be put back by any other path - nor may an aircraft + // whose position has gone stale, which keeps sending messages that carry no new one. + // Nor one with no position at all: positionStale() says no to that, having no time to + // go on, and an ACARS-only aircraft given a clearance at the gate was drawn at 0N 0E. + if (!item->m_active || !item->m_positionValid + || (!item->m_mapReplay && positionStale(item, QDateTime::currentDateTime()))) { + return; + } + // Nor while the ADS-B pass-through is supplying the item. The basic item built here + // replaced it whole - zeroing the PFD and dropping the altitude handling, so the model + // sank or floated - whenever a clearance or CPDLC message arrived. forwardMapItem() + // attaches the plan and the message to the next ADS-B item instead. + if (item->m_lastMapItemTime.isValid() + && (item->m_lastMapItemTime.secsTo(QDateTime::currentDateTime()) < 60)) { + return; + } + + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + + if (mapPipes.size() == 0) { + return; + } + + // When the name upgrades (a logon revealed the airframe), the old item is + // removed and the full track continues under the new name + QString name = mapItemName(item); + if (name.isEmpty()) { + return; + } + if (!item->m_mapName.isEmpty() && (item->m_mapName != name)) { + removeFromMap(item->m_mapName); + } + // Rebuilding the whole track for every report is expensive, so it is only + // sent when it has changed; the Map keeps its stored track otherwise + bool sendTrack = item->m_mapTrackChanged || item->m_mapTrackAppended + || (item->m_mapName != name); + item->m_mapName = name; + + const AircraftInformation *info = + (m_aircraftInfo && m_aircraftInfo->contains(item->m_registration)) + ? m_aircraftInfo->value(item->m_registration) : nullptr; + + QStringList text; + // The same picture header the ADS-B demodulator puts on its popups - a side view of + // the type in the operator's livery, or failing that the airline's logo, beside the + // country flag. An aircraft heard only on ACARS then reads the same as one heard on + // ADS-B, which is the point: the popup should not say which protocol found it. + if (info) + { + const QString sideview = AircraftInformation::resourcePathToURL( + AircraftInformation::getSideviewIconPath(info->m_registration, + info->m_operatorICAO, info->m_type)); + const QString airline = AircraftInformation::resourcePathToURL( + AircraftInformation::getAirlineIconPath(info->m_operatorICAO)); + const QString country = info->getFlag(); + const QString flag = country.isEmpty() + ? QString() : AircraftInformation::getFlagIconURL(country); + + if (!flag.isEmpty() && !sideview.isEmpty()) { + text.append(QString("
" + "
").arg(sideview).arg(flag)); + } else if (!flag.isEmpty() && !airline.isEmpty()) { + text.append(QString("
" + "
").arg(airline).arg(flag)); + } else if (!flag.isEmpty()) { + text.append(QString("").arg(flag)); + } else if (!sideview.isEmpty()) { + text.append(QString("").arg(sideview)); + } else if (!airline.isEmpty()) { + text.append(QString("").arg(airline)); + } + } + // The identities are links: clicking one selects that aircraft or flight in this + // feature, which is the question someone looking at the Map usually has next + if (item->m_icao) + { + text.append(QString("ICAO: %1").arg(aircraftMapLink("icao", + QString("%1").arg(item->m_icao, 6, 16, QChar('0')).toUpper()))); + } + if (!item->m_registration.isEmpty()) { + text.append(QString("Reg: %1").arg(aircraftMapLink("registration", item->m_registration))); + } + if (!item->m_flight.isEmpty()) { + text.append(QString("Flight: %1").arg(aircraftMapLink("flight", item->m_flight))); + } + if (info) + { + QString type = info->m_model.isEmpty() ? info->m_type + : (info->m_type.isEmpty() ? info->m_model + : QString("%1 (%2)").arg(info->m_model).arg(info->m_type)); + if (!type.isEmpty()) { + text.append(QString("Type: %1").arg(type)); + } + } + if (!item->m_departure.isEmpty()) { + text.append(QString("From: %1").arg(item->m_departure)); + } + if (!item->m_arrival.isEmpty()) { + text.append(QString("To: %1").arg(item->m_arrival)); + } + if (!item->m_route.isEmpty()) { + text.append(QString("Route: %1").arg(item->m_route)); + } + // The flight's list, not the airframe's: the Map is about what is being heard + // now, and an airframe's all time list names protocols and frequencies it was heard + // on weeks ago and is not being heard on at all + QStringList sources = item->m_currentFlight + ? sourcesList(item->m_currentFlight->m_sources) : QStringList(); + if (sources.size() == 1) + { + text.append(QString("Heard on: %1").arg(sources[0])); + } + else if (!sources.isEmpty()) + { + text.append("Heard on:"); + text.append(sources); + } + // The most recent decoded message used to go on the end. An ACARS message is often + // twenty lines of free text, which made the popup unreadable and pushed everything + // above it off screen. It is in the feature's own Documents tab, which is where a + // whole message belongs. + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(name)); + swgMapItem->setLatitude(item->m_latitude); + swgMapItem->setLongitude(item->m_longitude); + swgMapItem->setAltitude(item->m_altitudeValid ? Units::feetToMetres(item->m_altitudeFt) : 0.0f); + swgMapItem->setPositionDateTime(new QString(item->m_positionDateTime.toString(Qt::ISODateWithMs))); + const QDateTime until = mapAvailableUntil(item); + if (until.isValid()) { + swgMapItem->setAvailableUntil(new QString(until.toString(Qt::ISODateWithMs))); + } + if (item->m_altitudeDateTime.isValid()) { + swgMapItem->setAltitudeDateTime(new QString(item->m_altitudeDateTime.toString(Qt::ISODateWithMs))); + } + swgMapItem->setImage(new QString(QString("qrc:///map/%1").arg(aircraftImage(item)))); + if (item->m_headingValid) { + swgMapItem->setImageRotation((int) item->m_heading); + } + swgMapItem->setText(new QString(text.join("\n"))); + if (m_settings.m_atcLabels) { + swgMapItem->setLabel(new QString(atcLabel(item))); + } else { + swgMapItem->setLabel(new QString(item->m_flight.isEmpty() ? name : item->m_flight)); + } + if (sendTrack) { + swgMapItem->setTrack(buildTrack(trackFlightLoaded(item))); + } + + // Engine sound, looped by the 3D map, spatially located at the aircraft + const QString engineSound = AircraftEngineSound::engineSound( + info ? info->m_type : QString(), QString(), info ? info->m_model : QString()); + if (!engineSound.isEmpty()) { + swgMapItem->setLoopSound(new QString(engineSound)); + } + + // Keep using the 3D model a pass-through provided, so the 3D map shows + // the model rather than falling back to a flat billboard of the icon + if (!item->m_model3D.isEmpty()) + { + swgMapItem->setModel(new QString(item->m_model3D)); + // Without these the model sits half underground: 0,0,0 is the middle of the + // model rather than the bottom of its undercarriage. They were never sent + // from here, so even a pass-through model was at the wrong height whenever + // this feature re-sent it. + swgMapItem->setModelAltitudeOffset(item->m_modelAltitudeOffset); + swgMapItem->setLabelAltitudeOffset(item->m_labelAltitudeOffset); + if (item->m_headingValid) + { + swgMapItem->setOrientation(1); + swgMapItem->setHeading(item->m_heading); + } + } + + // A minimal aircraft state to carry the filed route for the Map's ND and the + // latest datalink message for its DCDU, built only when there is something to + // send - this path is for aircraft heard on protocols that do not build the + // full state the ADS-B pass-through has + SWGSDRangel::SWGMapFlightPlan *plan = buildFlightPlan(item); + SWGSDRangel::SWGMapDatalinkMessage *datalinkMessage = buildDatalinkMessage(item); + if (plan || datalinkMessage) + { + SWGSDRangel::SWGMapAircraftState *aircraftState = new SWGSDRangel::SWGMapAircraftState(); + aircraftState->setCallsign(new QString(item->m_flight.isEmpty() ? name : item->m_flight)); + if (info && !info->m_type.isEmpty()) { + aircraftState->setAircraftType(new QString(info->m_type)); + } + aircraftState->setOnSurface(-1); + if (item->m_altitudeValid) + { + aircraftState->setAltitude(item->m_altitudeFt); + if (item->m_altitudeDateTime.isValid()) { + aircraftState->setAltitudeDateTime(new QString(item->m_altitudeDateTime.toString(Qt::ISODateWithMs))); + } + } + if (item->m_headingValid) { + aircraftState->setTrack(item->m_heading); + } + if (item->m_speedValid) { + aircraftState->setGroundspeed(item->m_speedKts); + } + if (plan) { + aircraftState->setFlightPlan(plan); + } + if (datalinkMessage) { + aircraftState->setDatalinkMessage(datalinkMessage); + } + swgMapItem->setAircraftState(aircraftState); + } + + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + } + if (sendTrack) + { + item->m_mapTrackChanged = false; + item->m_mapTrackAppended = false; + item->m_mapTrackSentMs = QDateTime::currentMSecsSinceEpoch(); + } +} + +// Forward a fully-built map item from a demodulator (the ADS-B pass-through, which +// carries the 3D model and full aircraft state for the Map's PFD) to the Map, +// renamed to this feature's naming and enriched with the collated track and route +// facts. Takes ownership of the item. +template +static QList *cloneSWGList(QList *list) +{ + if (!list) { + return nullptr; + } + QList *copy = new QList(); + for (T *element : *list) + { + T *elementCopy = new T(); + QJsonObject *json = element->asJsonObject(); + elementCopy->fromJsonObject(*json); + delete json; + copy->append(elementCopy); + } + return copy; +} + +// A copy for each additional Map feature. The lists are not left to the JSON round trip: +// the default constructor leaves them null, which fromJsonObject dereferences as soon as +// the JSON has an array for them, and asJsonObject drops an empty list - which to the Map +// means "clear the track", where null means "unchanged". +static SWGSDRangel::SWGMapItem *cloneMapItem(SWGSDRangel::SWGMapItem *item) +{ + SWGSDRangel::SWGMapItem *copy = new SWGSDRangel::SWGMapItem(); + QJsonObject *json = item->asJsonObject(); + json->remove("track"); + json->remove("predictedTrack"); + json->remove("animations"); + json->remove("coordinates"); + copy->fromJsonObject(*json); + delete json; + copy->setTrack(cloneSWGList(item->getTrack())); + copy->setPredictedTrack(cloneSWGList(item->getPredictedTrack())); + copy->setAnimations(cloneSWGList(item->getAnimations())); + copy->setCoordinates(cloneSWGList(item->getCoordinates())); + return copy; +} + +void AircraftTracker::forwardMapItem(TrackedAircraft *item, SWGSDRangel::SWGMapItem *swgMapItem) +{ + // ADS-B marks every CSV replay state with its frame time. The tracked position is + // historical too, so comparing it with wall-clock time would discard the item here + // (and again in removeOldAircraft()) before either its track or PFD history reached + // the 3D Map. A later live pass-through has no state date and restores normal expiry. + SWGSDRangel::SWGMapAircraftState *aircraftState = swgMapItem->getAircraftState(); + const bool replay = aircraftState && aircraftState->getDateTime() + && !aircraftState->getDateTime()->isEmpty(); + item->m_mapReplay = replay; + + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + + QString name = mapItemName(item); + if ((mapPipes.size() == 0) || name.isEmpty() + || (!replay && positionStale(item, QDateTime::currentDateTime()))) + { + delete swgMapItem; + return; + } + if (!item->m_mapName.isEmpty() && (item->m_mapName != name)) { + removeFromMap(item->m_mapName); + } + // Rebuilding the whole track for every report is expensive, so it is only + // sent when it has changed; the Map keeps its stored track otherwise. Here, at ADS-B + // rates, a track that has merely grown is only sent every few seconds: building it + // for every position was O(n) per report and O(n^2) per flight. In between, the Map + // draws a provisional point from the last one sent to the live position, so the line + // still reaches the aircraft. + const qint64 nowMs = QDateTime::currentMSecsSinceEpoch(); + bool sendTrack = item->m_mapTrackChanged || (item->m_mapName != name) + || (item->m_mapTrackAppended && ((nowMs - item->m_mapTrackSentMs) >= 5000)); + + // A model from the pass-through is remembered for the items built here. It used to be + // removed and re-added when it replaced a billboard, since a CZML packet only adds to + // an entity and both would show - but the Map now hides the one it is not drawing, + // and the removal threw away the Map's history for the aircraft. + QString *model = swgMapItem->getModel(); + bool hasModel = (model != nullptr) && !model->isEmpty(); + if (hasModel) + { + item->m_model3D = *model; + // ... and what goes with it. Without these the item built here on the next quiet + // period, and the row written to the database, carry a zero offset or the offsets + // of whichever model this one replaced - so the aircraft sits at the wrong height + // as soon as the pass-through stops. + item->m_modelAltitudeOffset = swgMapItem->getModelAltitudeOffset(); + item->m_labelAltitudeOffset = swgMapItem->getLabelAltitudeOffset(); + item->m_modelIsOurs = false; + } + item->m_mapName = name; + item->m_mapResync = false; + m_mapResyncPending.remove(item); + + if (swgMapItem->getName()) { + *swgMapItem->getName() = name; + } else { + swgMapItem->setName(new QString(name)); + } + + // Both paths describe the same entity, so they must agree on how long it lives + const QDateTime until = mapAvailableUntil(item); + if (until.isValid()) + { + if (swgMapItem->getAvailableUntil()) { + *swgMapItem->getAvailableUntil() = until.toString(Qt::ISODateWithMs); + } else { + swgMapItem->setAvailableUntil(new QString(until.toString(Qt::ISODateWithMs))); + } + } + + // Add what other protocols have revealed to the popup + QStringList extra; + QString text = swgMapItem->getText() ? *swgMapItem->getText() : QString(); + if (!item->m_departure.isEmpty() && !text.contains(item->m_departure)) { + extra.append(QString("From: %1").arg(item->m_departure)); + } + if (!item->m_arrival.isEmpty() && !text.contains(item->m_arrival)) { + extra.append(QString("To: %1").arg(item->m_arrival)); + } + if (!item->m_route.isEmpty() && !text.contains(item->m_route)) { + extra.append(QString("Route: %1").arg(item->m_route)); + } + // The flight's list, for the same reason as in sendToMap() + QStringList sources = item->m_currentFlight + ? sourcesList(item->m_currentFlight->m_sources) : QStringList(); + if (sources.size() == 1) + { + extra.append(QString("Heard on: %1").arg(sources[0])); + } + else if (!sources.isEmpty()) + { + extra.append("Heard on:"); + extra.append(sources); + } + if (swgMapItem->getText()) { + swgMapItem->getText()->append("\n" + extra.join("\n")); + } else { + swgMapItem->setText(new QString(extra.join("\n"))); + } + + // The label is always ours, not the demodulator's: its own ATC labels + // setting would otherwise override this feature's on every update + QString label = m_settings.m_atcLabels ? atcLabel(item) + : (item->m_flight.isEmpty() ? name : item->m_flight); + if (swgMapItem->getLabel()) { + *swgMapItem->getLabel() = label; + } else { + swgMapItem->setLabel(new QString(label)); + } + + // The filed route and latest datalink message, for the Map's ND and DCDU, which + // the demodulator's state does not have - both come by ACARS and are collated here + if (swgMapItem->getAircraftState()) + { + SWGSDRangel::SWGMapFlightPlan *plan = buildFlightPlan(item); + if (plan) { + swgMapItem->getAircraftState()->setFlightPlan(plan); + } + SWGSDRangel::SWGMapDatalinkMessage *message = buildDatalinkMessage(item); + if (message) { + swgMapItem->getAircraftState()->setDatalinkMessage(message); + } + } + + if (sendTrack) + { + swgMapItem->setTrack(buildTrack(trackFlightLoaded(item))); + item->m_mapTrackChanged = false; + item->m_mapTrackAppended = false; + item->m_mapTrackSentMs = nowMs; + } + + // Each message takes ownership of its item, so additional Map features get a + // copy + QList items; + items.append(swgMapItem); + for (int i = 1; i < mapPipes.size(); i++) { + items.append(cloneMapItem(swgMapItem)); + } + for (int i = 0; i < mapPipes.size(); i++) + { + MessageQueue *messageQueue = qobject_cast(mapPipes[i]->m_element); + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, items[i]); + messageQueue->push(msg); + } +} + +// The furthest an aircraft has ever been heard, drawn at the position it was in when +// it set the record. Unlike everything else this feature puts on the Map this is not an +// aircraft that is flying now - it marks a place - so it is a fixed position with no +// track and no expiry, and it stays there until the record is beaten, the records are +// reset, or the option is turned off. +// +// Records set before version 3 of the statistics blob have no position stored, so the +// best record that CAN be drawn is used rather than the best overall - otherwise +// upgrading would leave the option doing nothing until the old record was beaten. +const char *AircraftTracker::RecordMapItemName = "Max range record"; +// Has to match a group the Map knows, or it falls back to this feature's own - see +// MapSettings::MapSettings() and MapItem.group in the API +const char *AircraftTracker::RouteMapGroup = "Aircraft Routes"; + +const char *AircraftTracker::CoverageMapGroup = "Aircraft Coverage"; + +// One colour per protocol, chosen to stay apart from each other and from the orange the +// aircraft themselves are drawn in. Alpha is low because the polygons overlap - VHF +// coverage sits inside HFDL's - and an opaque fill would hide whatever is underneath. +QRgb AircraftTracker::coverageColor(int protocol) +{ + switch (protocol) + { + case AircraftReport::ADSB: return qRgba(244, 151, 57, 80); // Orange + case AircraftReport::ACARS: return qRgba( 80, 200, 80, 80); // Green + case AircraftReport::VDL2: return qRgba( 70, 140, 255, 80); // Blue + case AircraftReport::HFDL: return qRgba(200, 80, 200, 80); // Magenta + case AircraftReport::AERO: return qRgba( 80, 220, 220, 80); // Cyan + default: return qRgba(200, 200, 200, 80); + } +} + +// The furthest this protocol has heard an aircraft on this bearing. Called with the +// range that was just measured, from the receiver that measured it. +void AircraftTracker::updateCoverage(int protocol, const QGeoCoordinate& receiver, + float azimuthDeg, float rangeKm) +{ + if ((protocol < 0) || (protocol >= AircraftReport::ProtocolCount) + || !receiver.isValid() || (rangeKm <= 0.0f)) { + return; + } + + if (m_coverageRangeKm[protocol].isEmpty()) { + m_coverageRangeKm[protocol].fill(0.0f, m_coverageBins); + } + // The receiver is remembered from the first report that measured anything, and then + // left alone: moving the centre would move every bin's endpoint with it, so a + // relocated receiver invalidates the pattern rather than shifting it. Clearing is + // the user's call - the button offers it. + if (!m_coverageOrigin[protocol].isValid()) { + m_coverageOrigin[protocol] = receiver; + } + + // azimuthTo() gives 0 to 360; 360 itself would index off the end + int bin = (int) (azimuthDeg / m_coverageBinDeg); + if (bin < 0) { + bin = 0; + } else if (bin >= m_coverageBins) { + bin = m_coverageBins - 1; + } + + if (rangeKm > m_coverageRangeKm[protocol][bin]) + { + m_coverageRangeKm[protocol][bin] = rangeKm; + m_coverageDirty[protocol] = true; + } +} + +// A polygon per protocol, two points per bin so each is a flat step at its own range +// rather than a line to the next bin's - the same shape the ADS-B demodulator draws. +// One shape per RUN of adjacent bearings that were actually measured, rather than one +// outline around the lot. +// +// Joining across bearings nothing was heard on cannot be done honestly. Taking the gap +// to zero draws a star of thin spikes back to the receiver; interpolating across it +// draws a smooth arc at roughly constant range through directions that were never +// listened to at all - which on HFDL, measured on a handful of bearings, claimed a +// clean 180 degree arc across the whole western sky. Both are inventions. A wedge per +// run says exactly what was heard and nothing about what was not: where every bearing +// has been measured, as ADS-B's have, the runs join up and it is a single filled shape +// again. +void AircraftTracker::sendCoverageToMap(int protocol) +{ + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + if (mapPipes.isEmpty()) { + return; + } + + const QVector& ranges = m_coverageRangeKm[protocol]; + + // Which bearings were measured, as runs of adjacent bins. Rotated so a run never + // straddles the start of the array, or the one covering north would come out as two. + QList> runs; // First bin, and how many + const int bins = ranges.size(); + int measured = 0; + for (int i = 0; i < bins; i++) + { + if (ranges[i] > 0.0f) { + measured++; + } + } + + if (measured && m_settings.m_displayCoverage && m_coverageOrigin[protocol].isValid()) + { + int first = 0; + if (measured < bins) + { + // Start at a bin whose predecessor is empty, so runs are whole + while (!((ranges[first] > 0.0f) + && (ranges[(first + bins - 1) % bins] <= 0.0f))) { + first++; + } + } + int i = 0; + while (i < bins) + { + const int bin = (first + i) % bins; + if (ranges[bin] <= 0.0f) + { + i++; + continue; + } + int length = 0; + while ((i + length < bins) && (ranges[(first + i + length) % bins] > 0.0f)) { + length++; + } + runs.append(qMakePair(bin, length)); + i += length; + } + } + + // Whatever was drawn last time and is not being drawn now has to come off - the + // number of runs changes as bearings fill in + QStringList drawn; + float furthest = 0.0f; + for (int i = 0; i < bins; i++) { + furthest = std::max(furthest, ranges[i]); + } + + for (int r = 0; r < runs.size(); r++) + { + const int firstBin = runs[r].first; + const int length = runs[r].second; + // Numbered, because one protocol can need many. The name is what the Map keys + // on, so it has to be stable for a given run index. + const QString name = QString("Coverage %1 %2").arg(protocolName(protocol)).arg(r); + drawn.append(name); + + QStringList text; + text.append(QString("%1 coverage").arg(protocolName(protocol))); + text.append(QString("Bearings: %1 to %2 degrees") + .arg(firstBin * m_coverageBinDeg) + .arg(((firstBin + length) % bins) * m_coverageBinDeg)); + float runFurthest = 0.0f; + for (int i = 0; i < length; i++) { + runFurthest = std::max(runFurthest, ranges[(firstBin + i) % bins]); + } + text.append(QString("Furthest here: %1 km").arg(runFurthest, 0, 'f', 1)); + text.append(QString("Furthest overall: %1 km").arg(furthest, 0, 'f', 1)); + text.append(QString("Measured from: %1, %2") + .arg(m_coverageOrigin[protocol].latitude(), 0, 'f', 4) + .arg(m_coverageOrigin[protocol].longitude(), 0, 'f', 4)); + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(name)); + swgMapItem->setGroup(new QString(CoverageMapGroup)); + swgMapItem->setLabel(new QString("")); + swgMapItem->setText(new QString(text.join("\n"))); + swgMapItem->setLatitude(m_coverageOrigin[protocol].latitude()); + swgMapItem->setLongitude(m_coverageOrigin[protocol].longitude()); + swgMapItem->setAltitude(0.0); + swgMapItem->setImage(new QString("none")); + swgMapItem->setImageRotation(0); + swgMapItem->setFixedPosition(true); + swgMapItem->setAltitudeReference(1); // Clamp to ground + swgMapItem->setColorValid(1); + swgMapItem->setColor(coverageColor(protocol)); + + QList *polygon = new QList(); + auto at = [&](double bearing, double km) + { + const QGeoCoordinate c = + m_coverageOrigin[protocol].atDistanceAndAzimuth(km * 1000.0, bearing); + SWGSDRangel::SWGMapCoordinate *p = new SWGSDRangel::SWGMapCoordinate(); + p->setLatitude(c.latitude()); + p->setLongitude(c.longitude()); + p->setAltitude(0.0); + polygon->append(p); + }; + + // A run short of the full circle is a wedge, so it starts and ends at the + // receiver; one that goes all the way round is a ring and must not, or the + // shape is slit open along one bearing. + // + // The two radial edges are stepped rather than drawn as one straight run out + // from the receiver. A constant bearing over thousands of miles is a curve on + // the 2D map, which draws a straight line between consecutive vertices - so a + // single segment cut visibly across where the edge should lie, worst on the + // longest wedges. The 3D map was right all along because Cesium draws polygon + // edges as geodesics whatever it is given. One step per 250 km, which puts the + // error well under the width of the line. + const bool wedge = (length < bins); + auto radial = [&](double bearing, float km, bool outward) + { + const int steps = qBound(1, (int) (km / 250.0f) + 1, 16); + for (int k = 0; k <= steps; k++) + { + const int step = outward ? k : (steps - k); + at(bearing, km * step / (float) steps); + } + }; + + if (wedge) { + radial(firstBin * m_coverageBinDeg, ranges[firstBin], true); + } + for (int i = 0; i < length; i++) + { + const int bin = (firstBin + i) % bins; + // Both edges of the bin at its own range, so each bearing is a flat step + at(bin * m_coverageBinDeg, ranges[bin]); + at((bin + 1) * m_coverageBinDeg, ranges[bin]); + } + if (wedge) + { + const int lastBin = (firstBin + length - 1) % bins; + radial((lastBin + 1) * m_coverageBinDeg, ranges[lastBin], false); + } + + swgMapItem->setCoordinates(polygon); + swgMapItem->setType(2); // Polygon + + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + } + } + + for (const QString& previous : m_coverageDrawnNames[protocol]) + { + if (!drawn.contains(previous)) { + removeFromMap(previous); + } + } + m_coverageDrawnNames[protocol] = drawn; +} + +void AircraftTracker::sendCoverageToMap() +{ + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + sendCoverageToMap(i); + m_coverageDirty[i] = false; + } +} + +void AircraftTracker::removeCoverageFromMap() +{ + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + for (const QString& name : m_coverageDrawnNames[i]) { + removeFromMap(name); + } + m_coverageDrawnNames[i].clear(); + } +} + +// Start again, which is what the button's right click offers - after moving the antenna, +// or when a stray position has thrown the outline out to somewhere it never reached +void AircraftTracker::clearCoverage() +{ + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + m_coverageRangeKm[i].fill(0.0f, m_coverageBins); + m_coverageOrigin[i] = QGeoCoordinate(); + m_coverageDirty[i] = true; + } + removeCoverageFromMap(); + m_coverageChanged = true; +} + + + + +// Selecting one of an aircraft's past flights draws that flight's track. Where the +// aircraft is still being heard that comes for free - trackFlight() hands the watched +// flight to the aircraft's own map item - but an ARCHIVED aircraft is not on the Map at +// all, so there was nothing to hang the track on and selecting one of its flights showed +// a profile and no track. +// +// So the track goes out on its own, as a line of its own, exactly as a filed route does. +// Not by relaxing the guard in sendToMap(): that guard is what keeps archived aircraft +// off the Map, and an icon sitting at a position from hours ago would say the aircraft is +// there, which a historic track does not. +void AircraftTracker::updateWatchedTrack() +{ + TrackedFlight *flight = m_watchedFlight ? flightById(m_watchedFlight) : nullptr; + TrackedAircraft *item = flight ? flight->m_aircraft : nullptr; + + // Only when the aircraft is not drawn itself, or its own item would carry the same + // track and the two would be drawn one on top of the other + const bool aircraftDrawn = item && item->m_active && item->m_positionValid + && (item->m_mapReplay || !positionStale(item, QDateTime::currentDateTime())); + + if (!flight || !item || aircraftDrawn) + { + if (!m_watchedTrackName.isEmpty()) + { + removeFromMap(m_watchedTrackName); + m_watchedTrackName.clear(); + m_watchedTrackKey.clear(); + } + return; + } + + ensureTrackLoaded(flight); + if (flight->m_track.size() < 2) + { + // One point is not a line, and drawing it draws nothing + if (!m_watchedTrackName.isEmpty()) + { + removeFromMap(m_watchedTrackName); + m_watchedTrackName.clear(); + m_watchedTrackKey.clear(); + } + return; + } + + const QString name = QString("%1 Track").arg( + flight->m_flight.isEmpty() ? regFor(item) : flight->m_flight); + // The flight and how much of it there is: the track only grows, so its length is + // enough to notice a change without comparing every point three times a second + const QString key = QString("%1|%2|%3").arg(name).arg(flight->m_id).arg(flight->m_track.size()); + if ((key == m_watchedTrackKey) && !m_watchedTrackName.isEmpty()) { + return; + } + + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + if (mapPipes.isEmpty()) { + return; // No Map open: try again when there is one + } + + // A rename means the old line is a different item, and the Map keys on the name + if (!m_watchedTrackName.isEmpty() && (m_watchedTrackName != name)) { + removeFromMap(m_watchedTrackName); + } + m_watchedTrackName = name; + m_watchedTrackKey = key; + + QStringList text; + text.append("Flight track"); + text.append(QString("Flight: %1").arg(flight->m_flight.isEmpty() ? regFor(item) : flight->m_flight)); + if (!flight->m_departure.isEmpty() && !flight->m_arrival.isEmpty()) { + text.append(QString("Route: %1 to %2").arg(flight->m_departure).arg(flight->m_arrival)); + } + if (flight->m_firstSeen.isValid() && flight->m_lastSeen.isValid()) + { + text.append(QString("Heard: %1 to %2") + .arg(flight->m_firstSeen.toString("yyyy-MM-dd hh:mm")) + .arg(flight->m_lastSeen.toString("hh:mm"))); + } + text.append(QString("Points: %1").arg(flight->m_track.size())); + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(name)); + swgMapItem->setLabel(new QString(name)); + swgMapItem->setText(new QString(text.join("\n"))); + swgMapItem->setLatitude(flight->m_track[0].latitude()); + swgMapItem->setLongitude(flight->m_track[0].longitude()); + swgMapItem->setAltitude(flight->m_track[0].altitude()); + swgMapItem->setImage(new QString("none")); + swgMapItem->setImageRotation(0); + swgMapItem->setFixedPosition(true); + // Absolute rather than clamped: unlike a filed route, a flown track has real + // altitudes and on the 3D map they are most of what makes it worth looking at + swgMapItem->setAltitudeReference(0); + + QList *line = new QList(); + for (const auto& coord : flight->m_track) + { + SWGSDRangel::SWGMapCoordinate *c = new SWGSDRangel::SWGMapCoordinate(); + c->setLatitude(coord.latitude()); + c->setLongitude(coord.longitude()); + // Every coordinate must carry a finite altitude: Qt writes a non-finite + // double into the Map's CZML as null, which Cesium rejects outright + c->setAltitude(std::isfinite(coord.altitude()) ? coord.altitude() : 0.0); + line->append(c); + } + swgMapItem->setCoordinates(line); + // A track rather than a plain line, so the Map colours it by altitude out of the + // group's palette, the way it colours the track under a live aircraft. A filed + // route stays a line: its waypoints carry no altitude to colour it by. + swgMapItem->setType(4); + + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + } +} + +void AircraftTracker::updateRecordMapItem() +{ + const AircraftStatistics::Record *best = nullptr; + int bestProtocol = -1; + + if (m_settings.m_displayMaxRangeOnMap) + { + // The record, not the furthest record that happens to be placeable. Skipping the + // unplaceable ones put a 301 km ACARS marker on the Map while the statistics + // table said the record was 7281 km on HFDL - two different answers to the same + // question, which is worse than no marker at all. + for (int i = 0; i < AircraftReport::ProtocolCount; i++) + { + const AircraftStatistics::Record& r = m_statistics.m_allTime.m_maxRange[i]; + if (r.m_valid && (!best || (r.m_value > best->m_value))) + { + best = &r; + bestProtocol = i; + } + } + } + + // A record set before the position was stored alongside it has nowhere to be drawn. + // Nothing is drawn until it is beaten, rather than something that contradicts the + // table - said once, since this is checked several times a second. + if (best && !best->m_positionValid) + { + if (m_recordMapState != RecordUnplaceable) + { + qDebug() << "AircraftTracker: the maximum range record -" << best->m_value + << "km, set by" << best->m_aircraft + << "on" << protocolName(bestProtocol) + << "- was set before positions were kept with records, so there is" + << "nowhere to draw it. It will appear once the record is beaten," + << "or reset the all time statistics to start again."; + m_recordMapState = RecordUnplaceable; + } + best = nullptr; + } + else if (!best && m_settings.m_displayMaxRangeOnMap && (m_recordMapState != RecordNone)) + { + qDebug() << "AircraftTracker: no maximum range record to draw on the Map yet"; + m_recordMapState = RecordNone; + } + + if (!best) + { + if (m_recordOnMap) + { + removeFromMap(RecordMapItemName); + m_recordOnMap = false; + m_recordMapKey.clear(); + } + return; + } + + // flush() runs three times a second, and the record changes perhaps twice a day + const QString key = QString("%1|%2|%3|%4|%5") + .arg(best->m_aircraft) + .arg(best->m_value, 0, 'f', 3) + .arg(best->m_latitude, 0, 'f', 5) + .arg(best->m_longitude, 0, 'f', 5) + .arg(bestProtocol); + if (m_recordOnMap && (key == m_recordMapKey)) { + return; + } + + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + if (mapPipes.isEmpty()) { + return; // No Map open: try again when there is one + } + m_recordMapKey = key; + m_recordOnMap = true; + if (m_recordMapState != RecordDrawn) + { + qDebug() << "AircraftTracker: drawing the maximum range record on the Map -" + << best->m_value << "km, set by" << best->m_aircraft + << "on" << protocolName(bestProtocol) + << "at" << best->m_latitude << best->m_longitude; + m_recordMapState = RecordDrawn; + } + + // The record names the aircraft as its registration where it had one, otherwise its + // flight number - both of which the key map is built on, so the airframe can be found + // again where it is still tracked and its own icon used, livery and all. Where it is + // not, the type still comes from the registration, and the icon is the plain one in + // white rather than the black it used to be - which is the same fallback a tracked + // aircraft with no model match gets. + const TrackedAircraft *holder = m_byKey.value(regKey(best->m_aircraft), nullptr); + if (!holder) { + holder = m_byKey.value(flightKey(best->m_aircraft), nullptr); + } + const QString recordImage = holder ? aircraftImage(holder) + : aircraftImage(best->m_aircraft, QString()); + + QStringList text; + text.append(QString("Maximum range record")); + text.append(QString("Aircraft: %1").arg(best->m_aircraft)); + text.append(QString("Range: %1 km").arg(best->m_value, 0, 'f', 1)); + text.append(QString("Protocol: %1").arg(protocolName(bestProtocol))); + if (best->m_frequency) { + text.append(QString("Frequency: %1 MHz").arg(best->m_frequency / 1e6, 0, 'f', 3)); + } + if (best->m_altitudeValid) { + text.append(QString("Altitude: %1 ft").arg((int) std::round(best->m_altitudeFt))); + } + if (best->m_when.isValid()) { + text.append(QString("When: %1").arg(best->m_when.toString("yyyy-MM-dd hh:mm:ss"))); + } + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(RecordMapItemName)); + swgMapItem->setLatitude(best->m_latitude); + swgMapItem->setLongitude(best->m_longitude); + swgMapItem->setAltitude(best->m_altitudeValid + ? Units::feetToMetres(best->m_altitudeFt) : 0.0f); + swgMapItem->setFixedPosition(1); + swgMapItem->setImage(new QString(QString("qrc:///map/%1").arg(recordImage))); + swgMapItem->setLabel(new QString(QString("%1 %2 km") + .arg(best->m_aircraft).arg(best->m_value, 0, 'f', 0))); + swgMapItem->setText(new QString(text.join("\n"))); + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + } +} + +// Place the points of a filed route, dropping any that cannot be placed. +// +// A position the message itself gave is used in preference to anything else: a route +// insert places most of its fixes, which settles which of two identically named fixes +// was meant and covers fixes no database here holds. Failing that the name is looked up +// - airports are four characters, waypoints five, VOR and NDB idents three, and an +// oceanic position seven (5530N, i.e. 55 North 030 West), the same rules the ACARS +// demodulator applied to an oceanic clearance, since a route is written the same way. +// +// EVERY coordinate is given an altitude. QGeoCoordinate's two argument constructor +// leaves altitude as qQNaN() while still reporting isValid(), and Qt writes a non-finite +// double into the Map's CZML as null, which Cesium rejects outright - taking down the +// whole 3D map rather than misplacing one route. +// Roughly where a run of route names is, taken from the first of them the waypoint +// database can place. Used to choose between navaids sharing an ident, which have no +// equivalent of findWayPoint()'s disambiguation - and one neighbour is enough, since the +// copies of an ident are hundreds of miles apart. +// +// The nearest placeable neighbour rather than an average of them: averaging longitudes +// puts a route either side of the antimeridian in the Gulf of Guinea. The names arrive +// nearest first, so the first hit is the closest one that could be placed. +// +// Waypoints only. An airway name is in no database, and looking a three letter ident up +// here would be the very ambiguity this exists to resolve. +// "58N030W" is 58 North 030 West, "5730N020W" is 57 degrees 30 minutes North. Written +// out once because the position is now read both to place the fix and, before that, to +// give the named fixes around it something to be judged against. +static QGeoCoordinate oceanicPosition(const QRegularExpressionMatch& match) +{ + float latitude = match.captured(1).toInt() + match.captured(2).toInt() / 60.0f; + if (match.captured(3) == "S") { + latitude = -latitude; + } + float longitude = match.captured(4).toInt() + match.captured(5).toInt() / 60.0f; + if (match.captured(6) == "W") { + longitude = -longitude; + } + return QGeoCoordinate(latitude, longitude, 0.0); +} + +QGeoCoordinate AircraftTracker::routeAnchor(const QStringList& names) +{ + for (const QString& name : names) + { + if (name.size() != 5) { + continue; + } + const Waypoint *waypoint = Waypoints::findWayPoint(name, names); + if (waypoint) { + return QGeoCoordinate(waypoint->m_latitude, waypoint->m_longitude); + } + } + return QGeoCoordinate(); // Nothing to choose by +} + +// The fixes a named departure or arrival procedure flies through, ready to be dropped +// into a route. +// +// A flight plan names its SID and STAR rather than listing them - "runway 26L, LAM1Z +// departure" - so the drawn line used to leave the departure airport straight for the +// first en route fix, which is not where the aircraft goes. A SID out of Gatwick turns +// through half a dozen fixes before it joins the airway. +// +// The database gives every point a position, so they are marked placed and never looked +// up by name. That matters as much as the shape: procedure fixes are named for their +// procedure - KKE02, KKN43 - and are in no en route waypoint database, so by name alone +// every one of them would be dropped. +// +// Empty when the procedure is not known, which includes the whole database being absent +// until it has been downloaded. Nothing else changes in that case: the route is drawn +// exactly as it was before. +// An altitude constraint as a procedure plate would read it, or empty where the fix +// carries none. Both bounds equal is a crossing altitude, one bound is a floor or a +// ceiling, and two different ones are a window. +QString AircraftTracker::altitudeConstraint(const AircraftReport::RouteWaypoint& point) +{ + if (point.m_hasMinimumAltitude && point.m_hasMaximumAltitude) + { + if (point.m_minimumAltitudeFt == point.m_maximumAltitudeFt) { + return QString("%1 ft").arg(point.m_minimumAltitudeFt); + } + return QString("%1 to %2 ft").arg(point.m_minimumAltitudeFt) + .arg(point.m_maximumAltitudeFt); + } + if (point.m_hasMinimumAltitude) { + return QString("%1 ft or above").arg(point.m_minimumAltitudeFt); + } + if (point.m_hasMaximumAltitude) { + return QString("%1 ft or below").arg(point.m_maximumAltitudeFt); + } + return QString(); +} + +QList AircraftTracker::procedurePoints( + const QString& procedure, const QString& airport, const QString& procedureType) +{ + QList points; + + // Four characters because the lookup is by ICAO code, and a plan can carry an IATA + // one or nothing at all + if (procedure.isEmpty() || (airport.size() != 4)) { + return points; + } + + // A plan often qualifies the procedure with the runway it starts on - LAM1Z/26L - + // and the database holds the procedure alone + QString name = procedure.trimmed().toUpper(); + const int slash = name.indexOf('/'); + if (slash > 0) { + name = name.left(slash); + } + + const QString icao = airport.trimmed().toUpper(); + QList procedureFixes = SidStar::getWaypoints(name, icao, procedureType); + + // The American form, which is most of the world's procedures: a base and a transition, + // written BASE.TRANSITION, held in the database as two entries. DSNEE6.HIMDU is the + // twelve fixes from HIMDU down to DSNEE, and DSNEE6 on its own is the three from DSNEE + // to the runway - the part every transition joins. Flown, it is one and then the + // other, so that is how it is drawn. They meet on the fix they share, which the + // duplicate collapse in sendRouteToMap() folds back into one. + // + // A SID is the same idea the other way round: the common part first and the transition + // off the end of it. + if (procedureFixes.isEmpty() && name.contains('.')) + { + const int dot = name.indexOf('.'); + const QString base = name.left(dot); + QString transition = name.mid(dot + 1); + + // Shortened a character at a time because the message can leave its own checksum + // stuck on the end of the last field it wrote - DSNEE6.HIMDU83CF is the HIMDU + // transition with 83CF after it. Longest first, so a transition that is a prefix + // of a longer one cannot win over the longer one, and it stops at the first that + // the database actually holds rather than guessing where the name ends. + while (transition.size() >= 2) + { + procedureFixes = SidStar::getWaypoints(base + "." + transition, icao, procedureType); + if (!procedureFixes.isEmpty()) { + break; + } + transition.chop(1); + } + + if (!procedureFixes.isEmpty()) + { + const QList common = SidStar::getWaypoints(base, icao, procedureType); + // Which end the transition attaches to. A runway transition - named RW05, + // RW13B - is the bit off the runway itself, so it comes before the common + // part whichever kind of procedure it belongs to. Anything else is an en + // route transition, which leads INTO an arrival and away from a departure. + // + // departure, runway transition : off the runway, then the common part + // departure, en route : the common part, then away to the airway + // arrival, en route : in off the airway, then the common part + // arrival, runway transition : the common part, then on to the runway + // + // which is transition first exactly when the two agree. + const bool runwayTransition = transition.startsWith("RW"); + const bool departure = procedureType.compare("SID", Qt::CaseInsensitive) == 0; + if (departure == runwayTransition) { + procedureFixes = procedureFixes + common; + } else { + procedureFixes = common + procedureFixes; + } + } + } + + for (const SidStarPoint& fix : procedureFixes) + { + AircraftReport::RouteWaypoint point; + point.m_name = fix.m_waypoint; + point.m_positionValid = true; + point.m_latitude = fix.m_latitude; + point.m_longitude = fix.m_longitude; + // Which procedure put it there, so the fix can say so on the Map - a procedure + // fix is named for its procedure and means nothing on its own + point.m_procedure = name; + point.m_procedureType = procedureType; + point.m_hasMinimumAltitude = fix.m_hasMinimumAltitude; + point.m_minimumAltitudeFt = fix.m_minimumAltitudeFt; + point.m_hasMaximumAltitude = fix.m_hasMaximumAltitude; + point.m_maximumAltitudeFt = fix.m_maximumAltitudeFt; + points.append(point); + } + + return points; +} + +void AircraftTracker::resolveRoute(QList& points, + QList& coords) const +{ + // A route names the airways between its fixes as well as the fixes: "BPK Q295 PAAVO + // M604 GIVPO". An airway is a letter or two and then digits, which no fix ident is, + // so this is what keeps Q295 from being looked up as an airport and drawn as one. + static const QRegularExpression airwayRe("^[A-Z]{1,2}[0-9]{1,4}$"); + // An oceanic position names itself: 58N030W is 58 North 030 West. The minutes are + // optional on either half, so the same fix appears as 58N030W, 5730N020W (57 degrees + // 30 minutes North, 020 West) or 5730N02030W - and a NAT track is routinely given on + // the half degree, so the longer forms are not unusual. Only the 7 character form + // used to be recognised, which dropped exactly those waypoints from the line. + static const QRegularExpression oceanicRe( + "^([0-9]{2})([0-9]{2})?([NS])([0-9]{3})([0-9]{2})?([EW])$"); + + // A fix ident is not unique. There is more than one BALAN, and asked for the name + // alone the databases can only hand back the first they hold - which is how one fix + // of a route across France came out on the far side of the world. What tells them + // apart is the company they keep, so every lookup is given the names around it. + // + // A WINDOW rather than the whole route: a candidate is scored on its mean distance + // to the names it is given, so on a long route the far end would pull the choice + // towards the middle of the span instead of towards the fixes either side of it. + // Three either way, which survives the airway names in between - they are in no + // database, so they contribute nothing and only take up room. + QStringList allNames; + allNames.reserve(points.size()); + for (const AircraftReport::RouteWaypoint& point : points) { + allNames.append(point.m_name); + } + // Where each name is, for every one that needs no disambiguating: an oceanic + // position states its own latitude and longitude, an ICAO airport ident is unique, + // and a fix that arrived carrying a position already has one. These are what the + // ambiguous names are then judged against, and they are worked out FIRST because a + // name cannot be judged against a neighbour that has not been placed yet. + // + // Without this an oceanic clearance had nothing to judge by at all. ETARI exists + // twice - once on the North Atlantic, once in Japan - and every fix around it on a + // Shanwick clearance is a bare latitude and longitude that no waypoint database + // holds. So the scoring found no neighbours it could look up, scored nothing, and + // fell through to the first ETARI in the file, which is the Japanese one. The + // 2000 km plausibility check could not catch it either, because it was anchored the + // same way and so had no anchor. + QList placed; + placed.reserve(points.size()); + for (const AircraftReport::RouteWaypoint& point : points) + { + const QRegularExpressionMatch oceanic = oceanicRe.match(point.m_name); + if (point.m_positionValid) { + placed.append(QGeoCoordinate(point.m_latitude, point.m_longitude)); + } else if (oceanic.hasMatch()) { + placed.append(oceanicPosition(oceanic)); + } else if ((point.m_name.size() == 4) && m_airports + && m_airports->contains(point.m_name)) { + const AirportInformation *airport = m_airports->value(point.m_name); + placed.append(QGeoCoordinate(airport->m_latitude, airport->m_longitude)); + } else { + placed.append(QGeoCoordinate()); // Needs a name lookup to be placed + } + } + + // The placed positions around a name, nearest first. The same window as the names + // below and for the same reason: a candidate is scored on its mean distance to + // these, so the far end of a long route would drag the choice towards the middle. + auto placedNear = [&placed](int index) + { + QList nearby; + for (int offset = 1; offset <= 3; offset++) + { + if ((index - offset >= 0) && placed[index - offset].isValid()) { + nearby.append(placed[index - offset]); + } + if ((index + offset < placed.size()) && placed[index + offset].isValid()) { + nearby.append(placed[index + offset]); + } + } + return nearby; + }; + + // The plausibility check needs only ONE position to measure from, so unlike the + // scoring window it looks as far along the route as it must to find one + auto placedAnchor = [&placed](int index) + { + for (int offset = 1; offset < placed.size(); offset++) + { + if ((index - offset >= 0) && placed[index - offset].isValid()) { + return placed[index - offset]; + } + if ((index + offset < placed.size()) && placed[index + offset].isValid()) { + return placed[index + offset]; + } + } + return QGeoCoordinate(); + }; + + // Nearest first, which is what lets routeAnchor() take the closest it can place + auto neighbours = [&allNames](int index) + { + QStringList nearby; + for (int offset = 1; offset <= 3; offset++) + { + if (index - offset >= 0) { + nearby.append(allNames[index - offset]); + } + if (index + offset < allNames.size()) { + nearby.append(allNames[index + offset]); + } + } + return nearby; + }; + + // Its own, because the iterator's position moves as unresolvable names are dropped + // while the window has to index the route as it was named + int index = -1; + + QMutableListIterator i(points); + while (i.hasNext()) + { + const AircraftReport::RouteWaypoint& point = i.next(); + const QString name = point.m_name; + index++; + + if (point.m_positionValid) + { + // A procedure fix is flown at the altitude the procedure requires, so draw it + // there rather than on the ground. The floor where there is one - an aircraft + // is at least that high - otherwise the ceiling. + double altitude = 0.0; + if (point.m_hasAltitude) { + altitude = Units::feetToMetres((float) point.m_altitudeFt); + } else if (point.m_hasMinimumAltitude) { + altitude = Units::feetToMetres((float) point.m_minimumAltitudeFt); + } else if (point.m_hasMaximumAltitude) { + altitude = Units::feetToMetres((float) point.m_maximumAltitudeFt); + } + coords.append(QGeoCoordinate(point.m_latitude, point.m_longitude, altitude)); + continue; + } + + // Where a placed fix would have to be, to be believed. Not disambiguation - the + // databases can hold exactly ONE fix of a name and still have the wrong one. + // + // ALR01 is the case that showed it up: a Stansted to Algiers route named it, and + // the only ALR01 any database here holds is at 2S 44W, off the coast of Brazil. + // The real one is a fix the aircraft's own FMS computed near the Alger VOR, which + // is in no database at all, so choosing better among candidates cannot help - + // there is only one and it is wrong. Drawn, it took the route across the Atlantic + // and back. + // + // 2000 km, measured from the nearest fix around it that could be placed. Legs are + // long on an oceanic route - a NAT track steps about 700 km between waypoints - + // so this has to be generous to avoid throwing away good fixes, and it still + // rejects a placement on the wrong continent by a wide margin. With nothing around + // it placeable there is nothing to judge against, and the fix is taken as it comes. + auto plausible = [&](const QGeoCoordinate& at) + { + QGeoCoordinate anchor = placedAnchor(index); + if (!anchor.isValid()) { + anchor = routeAnchor(neighbours(index)); + } + if (!anchor.isValid() || !at.isValid()) { + return true; + } + return anchor.distanceTo(at) <= 2000000.0; + }; + + bool found = false; + if (!airwayRe.match(name).hasMatch()) + { + if ((name.size() == 4) && m_airports) + { + const AirportInformation *airport = m_airports->value(name, nullptr); + if (airport) + { + found = true; + coords.append(QGeoCoordinate(airport->m_latitude, airport->m_longitude, 0.0)); + } + } + else if (name.size() == 5) + { + // Positions where the fixes around it could be placed without a + // lookup, names where they could not - an ordinary airway route names + // fixes that are themselves only in the database, and there the name + // form is all there is + const QList nearby = placedNear(index); + const Waypoint *waypoint = nearby.isEmpty() + ? Waypoints::findWayPoint(name, neighbours(index)) + : Waypoints::findWayPoint(name, nearby); + if (waypoint) + { + const QGeoCoordinate at(waypoint->m_latitude, waypoint->m_longitude, 0.0); + if (plausible(at)) + { + found = true; + placed[index] = at; // Now an anchor for the names after it + coords.append(at); + } + } + } + else if ((name.size() == 3) && m_navAids) + { + // Idents are no more unique than waypoint names, so the same rule + // applies: of the navaids carrying this one, take the one nearest the + // fixes around it. Where none of those can be placed there is nothing to + // choose by, and the first is as good as any - which is all this did. + QGeoCoordinate anchor = placedAnchor(index); + if (!anchor.isValid()) { + anchor = routeAnchor(neighbours(index)); + } + const NavAid *best = nullptr; + double bestDistance = 0.0; + + for (int j = 0; j < m_navAids->size(); j++) + { + const NavAid *navAid = m_navAids->at(j); + if (navAid->m_ident != name) { + continue; + } + if (!anchor.isValid()) + { + best = navAid; + break; + } + const double d = anchor.distanceTo( + QGeoCoordinate(navAid->m_latitude, navAid->m_longitude)); + if (!best || (d < bestDistance)) + { + best = navAid; + bestDistance = d; + } + } + if (best) + { + const QGeoCoordinate at(best->m_latitude, best->m_longitude, 0.0); + if (plausible(at)) + { + found = true; + placed[index] = at; // Now an anchor for the names after it + coords.append(at); + } + } + } + else + { + // Whatever length it is - the regex is what decides, since the minutes + // are optional on both halves + const QRegularExpressionMatch match = oceanicRe.match(name); + if (match.hasMatch()) + { + found = true; + coords.append(oceanicPosition(match)); + } + } + } + + if (!found) { + i.remove(); + } + } +} + +// A route the aircraft has been given - a filed flight plan or an oceanic clearance - +// drawn on the Map as a line through the waypoints with a marker at each one. This used +// to live in the ACARS demodulator, for clearances only; it is here now so that both +// kinds are drawn the same way, and so that a route revealed by any protocol is drawn once +// however many demodulators heard it. +// +// The kind is part of every item name, so a flight with both a plan and a clearance +// shows both: the Map keys its items on the name, and identical names would have one +// quietly replacing the other. +// +// Not removed when the flight is archived, which is how clearances have always behaved: +// the route is a record of where the aircraft was going, and that stays interesting +// after it has landed. +// Whose filed routes are on the map. Only the selected one's: every oceanic flight in +// earshot files a clearance, so drawing them all covered the map in lines that had +// nothing to do with what the user was looking at - and since the routes are stored, a +// reload put every one of them up at once. Selecting an aircraft watches its current +// flight, so this one test covers a selected aircraft and a selected flight alike. +// How many of a route's waypoints can actually be placed, which is what decides whether +// a new filing is worth anything against the one already held - see updateFlight() +int AircraftTracker::routePlaceable(const QString& waypoints, + const QList& given) const +{ + QList points = given; + + if (points.isEmpty()) + { + static const QRegularExpression separatorRe("[ .]+"); + for (const QString& name : waypoints.split(separatorRe, Qt::SkipEmptyParts)) + { + AircraftReport::RouteWaypoint point; + point.m_name = name; + points.append(point); + } + } + + QList coords; + resolveRoute(points, coords); // Drops what it cannot place + return coords.size(); +} + +bool AircraftTracker::routeDrawn(const TrackedFlight *flight) const +{ + return flight && (flight->m_id == m_watchedFlight); +} + +// Both of a flight's routes at once, which is always how they are drawn and undrawn - +// the selection moves to a flight, not to one of its two routes +// One ACARS block as received: archived, and fed on to the aggregators. +// +// The block is kept exactly as it came off the air. That is the point of doing it here: +// the parser lives in the library now, so a later decoder can be run over the whole +// archive, and everything already stored improves with it. A rendered document cannot - +// one written before the three character sublabel fix keeps its stray characters for +// good. +// Render a document from what it was decoded from, with whatever the parser does today. +// +// This is what makes a decoder improvement reach everything already stored. Documents +// used to be written as finished text, so a fix reached only messages received after it - +// a three character sublabel read as two put a stray character through the middle of long +// messages, and every document written before that was found kept it for good, as did a +// wind direction rendered with an HTML entity in a field that is shown as plain text. +// +// The block is decoded for its header - the registration, the label, which way it was +// going - and then decoded again with the text, which for a message that arrived in +// several blocks is the assembled whole rather than any one of them. That is exactly what +// the demodulator does on reception. +QString AircraftTracker::renderDocument(const QByteArray& raw, const QString& source) +{ + if (raw.isEmpty()) { + return QString(); + } + + // Decoded once, on the whole: decoding the block and then the whole into the same + // object doubles every list a decoder appends to + QScopedPointer message(source.isEmpty() ? AcarsMessage::decode(raw) : AcarsMessage::decode(raw, source)); + if (!message) { + return QString(); + } + return acarsDecodeToPlain(message->toString()); +} + +void AircraftTracker::acarsBlockReceived(const QByteArray& block, const QDateTime& dateTime, + qint64 frequency, double level, int protocol) +{ + AcarsBlockRecord record; + record.m_block = block; + record.m_dateTime = dateTime; + record.m_frequency = frequency; + record.m_level = level; + record.m_protocol = protocol; + // Only queued for a database to take them: the queue is emptied by a save, and with + // no database (it would not open - locked, or read only) it grew for the whole session + if (m_db) + { + m_acarsBlocks.append(record); + m_dbDirty = true; + } + + if (!m_settings.m_feedEnabled) { + return; + } + + // Decoded only for the feed, and only when there is one - the archive does not need + // it, and an aggregator wants the fields rather than the block + QScopedPointer message(AcarsMessage::decode(block)); + if (message) { + feedMessage(*message, dateTime, frequency, level); + } +} + +// Send one ACARS message on to the aggregators that are enabled, as one acarsdec style +// JSON object per UDP datagram - the format both airframes.io (port 5550) and +// avdelphi.com (vdlm2dec JSON, port 5556) ingest. +// +// Built here rather than in the demodulator so that the whole feed - the station identity, +// the connections and the format - is one thing in one place, set up once for the station +// however many demodulators are running. Messages from all three ACARS bearers arrive +// here over one set of connections. +void AircraftTracker::feedMessage(const AcarsMessage& message, const QDateTime& dateTime, + qint64 frequency, double level) +{ + if (!m_feedSocket) { + return; + } + + QJsonObject json; + json.insert("timestamp", dateTime.toMSecsSinceEpoch() / 1000.0); + if (!m_settings.m_feedStationId.isEmpty()) { + json.insert("station_id", m_settings.m_feedStationId); + } + json.insert("channel", 0); + json.insert("freq", frequency / 1e6); + json.insert("level", level); + json.insert("error", 0); + json.insert("mode", message.m_mode); + json.insert("label", message.m_label); + json.insert("block_id", QString(message.m_blockId)); + if ((message.m_ack == QChar(ASCII_NAK)) || message.m_ack.isNull()) { + json.insert("ack", false); + } else { + json.insert("ack", QString(message.m_ack)); + } + json.insert("tail", message.m_address); + if (!message.m_flight.isEmpty()) { + json.insert("flight", message.m_flight); + } + const QString msgNo = message.m_originator + message.m_messageNumber + message.m_blockSequence; + if (!msgNo.isEmpty()) { + json.insert("msgno", msgNo); + } + json.insert("text", message.m_text); + json.insert("end", !message.m_multiBlock); + // Identify the client, as the standalone decoders do - aggregators use this to + // recognise the source + QJsonObject app; + app.insert("name", "SDRangel"); + app.insert("ver", QCoreApplication::applicationVersion()); + json.insert("app", app); + + QByteArray datagram = QJsonDocument(json).toJson(QJsonDocument::Compact); + datagram.append('\n'); + + // UDP: host names are resolved once and cached; the cache invalidates when the + // setting changes, so a blocking DNS lookup happens at most once per host. A host + // that would not resolve is not tried again for a minute: the lookup blocks this + // thread, and with the network down it timed out again on every block received. + auto sendUdp = [this, &datagram](const QString& host, int port, QHostAddress& cache, + QString& cachedHost) + { + if (host.isEmpty()) { + return; + } + if (host != cachedHost) + { + const QDateTime now = QDateTime::currentDateTimeUtc(); + const QDateTime retry = m_feedResolveRetry.value(host); + if (retry.isValid() && (now < retry)) { + return; + } + const QHostInfo info = QHostInfo::fromName(host); + if (info.addresses().isEmpty()) + { + qWarning() << "AircraftTracker: feed cannot resolve host" << host; + m_feedResolveRetry.insert(host, now.addSecs(60)); + return; + } + m_feedResolveRetry.remove(host); + cache = info.addresses().first(); + cachedHost = host; + qDebug() << "AircraftTracker: feed sending UDP to" << host << "(" << cache << ") :" << port; + } + m_feedSocket->writeDatagram(datagram, cache, port); + }; + + // TCP: reconnect if the link has dropped, and drop this message rather than queue it - + // a feed that has been down is not helped by a burst of stale reports, which matches + // how the standalone feeder clients behave. + auto sendTcp = [this, &datagram](QTcpSocket& socket, const QString& host, int port, + const char *service) + { + if (host.isEmpty()) { + return; + } + if (socket.state() == QAbstractSocket::ConnectedState) + { + const qint64 written = socket.write(datagram); + socket.flush(); + qDebug() << "AircraftTracker: feed sent" << written << "bytes to" << service; + } + else if (socket.state() == QAbstractSocket::UnconnectedState) + { + qDebug() << "AircraftTracker: feed not connected to" << service + << "- reconnecting, message dropped"; + socket.abort(); + socket.connectToHost(host, port); + } + else + { + qDebug() << "AircraftTracker: feed still connecting to" << service + << "- message dropped"; + } + }; + + if (m_settings.m_feedAirframes) + { + if (m_settings.m_feedAirframesTcp) { + sendTcp(*m_feedAirframesTcpSocket, m_settings.m_feedAirframesHost, + m_settings.m_feedAirframesPort, "airframes.io"); + } else { + sendUdp(m_settings.m_feedAirframesHost, m_settings.m_feedAirframesPort, + m_feedAirframesAddr, m_feedAirframesResolvedHost); + } + } + if (m_settings.m_feedAvdelphi) + { + if (m_settings.m_feedAvdelphiTcp) { + sendTcp(*m_feedAvdelphiTcpSocket, m_settings.m_feedAvdelphiHost, + m_settings.m_feedAvdelphiPort, "avdelphi.com"); + } else { + sendUdp(m_settings.m_feedAvdelphiHost, m_settings.m_feedAvdelphiPort, + m_feedAvdelphiAddr, m_feedAvdelphiResolvedHost); + } + } +} + +// Open (or close) the aggregator connections to match the settings. Connections are also +// re-made on demand when a message needs sending, but connecting eagerly here means +// enabling the feed gives immediate feedback in the log rather than silently waiting for +// the first ACARS message. +void AircraftTracker::updateFeedConnections() +{ + if (!m_feedAirframesTcpSocket) { + return; // Not started yet; startWork() calls back in here + } + + auto update = [this](QTcpSocket& socket, bool enabled, bool tcp, const QString& host, int port) + { + bool want = m_settings.m_feedEnabled && enabled && tcp && !host.isEmpty(); + bool wrongPeer = (socket.peerName() != host) || (socket.peerPort() != port); + if (want) + { + if ((socket.state() == QAbstractSocket::UnconnectedState) || wrongPeer) + { + qDebug() << "AircraftTracker: feed connecting to" << host << ":" << port; + socket.abort(); + socket.connectToHost(host, port); + } + } + else if (socket.state() != QAbstractSocket::UnconnectedState) + { + socket.abort(); + } + }; + update(*m_feedAirframesTcpSocket, m_settings.m_feedAirframes, m_settings.m_feedAirframesTcp, + m_settings.m_feedAirframesHost, m_settings.m_feedAirframesPort); + update(*m_feedAvdelphiTcpSocket, m_settings.m_feedAvdelphi, m_settings.m_feedAvdelphiTcp, + m_settings.m_feedAvdelphiHost, m_settings.m_feedAvdelphiPort); +} + +void AircraftTracker::sendRoutes(TrackedFlight *flight) +{ + if (flight) + { + sendRouteToMap(flight, flight->m_flightPlan, "Flight plan"); + sendRouteToMap(flight, flight->m_clearance, "Oceanic clearance"); + } +} + +void AircraftTracker::removeRoutes(TrackedFlight *flight) +{ + if (flight) + { + removeDrawnRoute(flight->m_flightPlan); + removeDrawnRoute(flight->m_clearance); + } +} + +// Assemble a filed route into placed fixes: the airports it runs between, the departure +// and arrival procedures expanded, the path itself, altitudes stamped and duplicates +// collapsed, then everything resolved against the databases. Points and coords come out +// index aligned, resolveRoute() having dropped anything it could not place. Shared by +// the drawn route (sendRouteToMap()) and the ND flight plan (buildFlightPlan()). +QList AircraftTracker::assembleRoutePoints( + const TrackedFlight *flight, const TrackedFlight::FiledRoute& route, + QList& coords) const +{ + // The route field is the waypoints alone, so the airports it runs between are added + // here - which is what makes the drawn line start and finish somewhere recognisable + QList points; + auto named = [](const QString& waypoint) + { + AircraftReport::RouteWaypoint point; + point.m_name = waypoint; + return point; + }; + // The plan's own airports in preference to the flight's: a procedure belongs to the + // aerodrome the plan was filed against, and a flight that has been re-filed still + // carries the arrival it was first heard with. + const QString departure = route.m_departure.size() == 4 ? route.m_departure + : flight->m_departure; + const QString arrival = route.m_arrival.size() == 4 ? route.m_arrival + : flight->m_arrival; + + // The same airports as the procedures, so the line runs down the STAR to the airport + // it serves. Bookending with the flight's own let a re-file the flight had not taken + // on draw down the new STAR and then jump to the old arrival. + if (departure.size() == 4) { + points.append(named(departure)); + } + // The departure procedure, between the aerodrome and the route it joins + points.append(procedurePoints(route.m_sid, departure, "SID")); + // The message's own positions where it gave them, its names alone where it did not + if (route.m_points.isEmpty()) + { + // Both separators, because both forms reach here. A clearance names its waypoints + // with spaces - SUNOT 58N030W JANJO - while a flight plan is written as an ARINC + // 702A path, DVR.UL9.KONAN.UL607.KOK..KOMOB.., where a single dot joins a fix to + // the airway leaving it and a double dot means direct to the next fix. Split on + // spaces alone, the whole of a filed plan was one unresolvable name, and all that + // was left to draw was the line between the two airports. + static const QRegularExpression separatorRe("[ .]+"); + for (const QString& waypoint : route.m_waypoints.split(separatorRe, Qt::SkipEmptyParts)) { + points.append(named(waypoint)); + } + } + else + { + points.append(route.m_points); + } + // And the arrival procedure, between the route and the aerodrome + points.append(procedurePoints(route.m_star, arrival, "STAR")); + if (arrival.size() == 4) { + points.append(named(arrival)); + } + + // The level the route is flown at, which is what a clearance clears the aircraft to + // and what a filed plan cruises at. Applied to the FIXES, never to the airports it + // runs between, and never over an altitude something more specific already gave - a + // procedure fix has its own, and a predicted route gives one per fix. + // + // Identified by name rather than by position in the list: an airport is four + // characters where a waypoint is five, a navaid three and an oceanic position seven + // or more. Skipping the first and last entries instead looks equivalent and is not - + // the list does not always start or end with an airport, and doing it that way left + // the last fix of every route on the ground. + if (route.m_flightLevel > 0) + { + for (AircraftReport::RouteWaypoint& point : points) + { + // ANY altitude of its own, which is three separate fields: what a predicted + // route expects at the fix, and the floor and ceiling a procedure requires + // there. Testing only the first of them is a trap, because a procedure fix + // carries the other two and looks unconstrained - a SID that crosses BPK at + // 6000 ft had it stamped with the cruise level instead and drawn at FL390, + // which is where the aircraft is an hour later rather than on departure. + const bool hasOwn = point.m_hasAltitude + || point.m_hasMinimumAltitude + || point.m_hasMaximumAltitude; + if (!hasOwn && (point.m_name.size() != 4)) + { + point.m_hasAltitude = true; + point.m_altitudeFt = route.m_flightLevel * 100; + } + } + } + + // A fix named twice in a row is one fix. It happens: a clearance gives its entry + // point and then repeats it as the first waypoint of the route, and the departure + // airport prepended above can be the first waypoint too. Drawn as they come, they + // make a segment of no length and two markers under one name - and the Map keys its + // items on the name, so the second would quietly replace the first. + // + // Which of the two to keep is not arbitrary. A procedure and the route it joins name + // the same fix at the join, and only the procedure's copy knows what altitude to + // cross it at - so the one carrying something is kept and the bare one dropped, + // whichever came first. Dropping the later one always would have worked for a SID, + // which is spliced in BEFORE the route, and quietly discarded every STAR constraint, + // because a STAR is spliced in after it. + auto informative = [](const AircraftReport::RouteWaypoint& point) + { + return point.m_positionValid || point.m_hasAltitude + || point.m_hasMinimumAltitude || point.m_hasMaximumAltitude; + }; + for (int i = points.size() - 1; i > 0; i--) + { + if (points[i].m_name != points[i - 1].m_name) { + continue; + } + if (informative(points[i]) && !informative(points[i - 1])) { + points.removeAt(i - 1); + } else { + points.removeAt(i); + } + } + + resolveRoute(points, coords); + return points; +} + +// Build the flight plan attached to the aircraft's own map item, which is what the 3D +// map's ND (Navigation Display) draws. Unlike the drawn route this goes out for every +// aircraft with a filed route, not just the watched flight - the ND shows it only for +// the selected aircraft. Returns nullptr when there is nothing to send; otherwise the +// caller owns the object (typically handing it to SWGMapAircraftState::setFlightPlan()). +SWGSDRangel::SWGMapFlightPlan *AircraftTracker::buildFlightPlan(TrackedAircraft *item) const +{ + TrackedFlight *flight = item->m_currentFlight; + if (!flight) { + return nullptr; + } + + // Prefer the clearance when it has waypoints and is at least as recently filed as + // the plan - a clearance is what the aircraft is actually cleared to fly + const TrackedFlight::FiledRoute& plan = flight->m_flightPlan; + const TrackedFlight::FiledRoute& clearance = flight->m_clearance; + const bool planUsable = !plan.m_waypoints.isEmpty() + || !plan.m_sid.isEmpty() || !plan.m_star.isEmpty(); + const bool clearanceUsable = !clearance.m_waypoints.isEmpty(); + const TrackedFlight::FiledRoute *route; + if (clearanceUsable && (!planUsable || (clearance.m_filed >= plan.m_filed))) { + route = &clearance; + } else if (planUsable) { + route = &plan; + } else { + return nullptr; + } + + const QString departure = route->m_departure.size() == 4 ? route->m_departure + : flight->m_departure; + const QString arrival = route->m_arrival.size() == 4 ? route->m_arrival + : flight->m_arrival; + + // Everything assembleRoutePoints() depends on, so the assembly - database lookups + // per fix - runs only when the route actually changes, not per position report + const QString signature = QStringList({ + departure, arrival, route->m_waypoints, route->m_sid, route->m_star, + QString::number(route->m_flightLevel), + route->m_filed.toString(Qt::ISODateWithMs) + }).join(QChar(0x1f)); + if (signature != flight->m_ndPlanSignature) + { + flight->m_ndPlanCoords.clear(); + flight->m_ndPlanPoints = assembleRoutePoints(flight, *route, flight->m_ndPlanCoords); + flight->m_ndPlanSignature = signature; + } + const QList& points = flight->m_ndPlanPoints; + const QList& coords = flight->m_ndPlanCoords; + if (coords.size() < 2) { + return nullptr; + } + + SWGSDRangel::SWGMapFlightPlan *swgPlan = new SWGSDRangel::SWGMapFlightPlan(); + if (!departure.isEmpty()) { + swgPlan->setDeparture(new QString(departure)); + } + if (!arrival.isEmpty()) { + swgPlan->setArrival(new QString(arrival)); + } + if (!route->m_approach.isEmpty()) { + swgPlan->setApproach(new QString(route->m_approach)); + } + // The arrival runway, for the ND's approach annunciator. An FPN writes the + // departure runway with the arrival's in brackets - 27L(01R) - and the approach + // procedure name usually ends in the runway it serves, e.g. ILSY01R. The bare + // runway field is NOT used: on its own it is the departure runway. + static const QRegularExpression bracketedRunwayRe(R"(\(([0-9]{2}[LRC]?)\))"); + static const QRegularExpression approachRunwayRe(R"(([0-9]{2}[LRC]?)$)"); + QString arrivalRunway; + QRegularExpressionMatch runwayMatch = bracketedRunwayRe.match(route->m_runway); + if (runwayMatch.hasMatch()) { + arrivalRunway = runwayMatch.captured(1); + } + else + { + runwayMatch = approachRunwayRe.match(route->m_approach); + if (runwayMatch.hasMatch()) { + arrivalRunway = runwayMatch.captured(1); + } + } + if (!arrivalRunway.isEmpty()) { + swgPlan->setArrivalRunway(new QString(arrivalRunway)); + } + + // The waypoint being flown to: the one after the nearest, since past waypoints are + // behind the aircraft. Rough - an aircraft mid-leg far from both ends still picks + // its neighbours - but only leg colouring on the ND depends on it. + int active = -1; + if (item->m_positionValid) + { + const QGeoCoordinate position(item->m_latitude, item->m_longitude); + int nearest = -1; + double nearestDistance = 0.0; + for (int i = 0; i < coords.size(); i++) + { + const double distance = position.distanceTo(coords[i]); + if ((nearest == -1) || (distance < nearestDistance)) + { + nearest = i; + nearestDistance = distance; + } + } + active = std::min(nearest + 1, (int) (coords.size() - 1)); + } + swgPlan->setActiveWaypoint(active); + + QList *waypoints = new QList(); + for (int i = 0; i < points.size(); i++) + { + SWGSDRangel::SWGMapRouteWaypoint *waypoint = new SWGSDRangel::SWGMapRouteWaypoint(); + waypoint->setName(new QString(points[i].m_name)); + waypoint->setLatitude(coords[i].latitude()); + waypoint->setLongitude(coords[i].longitude()); + if (points[i].m_hasAltitude) { + waypoint->setAltitude(points[i].m_altitudeFt); + } else if (points[i].m_hasMinimumAltitude) { + waypoint->setAltitude(points[i].m_minimumAltitudeFt); + } else if (points[i].m_hasMaximumAltitude) { + waypoint->setAltitude(points[i].m_maximumAltitudeFt); + } + if (points[i].m_hasEta) { + waypoint->setEta(new QString(points[i].m_eta.toString("hh:mm:ss"))); + } + waypoints->append(waypoint); + } + swgPlan->setWaypoints(waypoints); + + return swgPlan; +} + +// Note the latest datalink ATC message, which the 3D map's DCDU pops up for the +// selected aircraft, and push it to the Map at once - these are events, and waiting +// for the next position report could sit on one for minutes +void AircraftTracker::recordDcduMessage(TrackedAircraft *item, const AircraftReport& report) +{ + TrackedAircraft::DcduMessage message; + + switch (report.m_documentKind) + { + case AircraftReport::Cpdlc: + // The concise expanded text rather than the full decode tree. The station is + // the ARINC 622 ground address (an ATC facility) on the ACARS path, and the + // VDL-2 ground station on the ATN path. + if (report.m_atc.isEmpty()) { + return; + } + message.m_text = report.m_atc; + message.m_station = report.m_station; + break; + case AircraftReport::DepartureClearance: + // The message as transmitted, which is what the real unit shows. A PDC never + // carries a station; the issuing facility is the departure airport. + message.m_text = report.m_documentSource.isEmpty() ? report.m_documentText + : report.m_documentSource; + message.m_station = report.m_departure; + break; + case AircraftReport::Clearance: + case AircraftReport::ClearanceRequest: + message.m_text = report.m_documentSource.isEmpty() ? report.m_documentText + : report.m_documentSource; + message.m_station = report.m_station; + break; + default: + return; + } + if (message.m_text.isEmpty()) { + return; + } + + message.m_seq = item->m_dcduMessage.m_seq + 1; + message.m_received = report.m_received; + message.m_uplink = report.m_uplink; + item->m_dcduMessage = message; + + sendToMap(item); +} + +// Build the datalink message attached to the aircraft's own map item, which the 3D +// map's DCDU displays. nullptr when the aircraft has never had one; otherwise the +// caller owns the object. +SWGSDRangel::SWGMapDatalinkMessage *AircraftTracker::buildDatalinkMessage(const TrackedAircraft *item) const +{ + const TrackedAircraft::DcduMessage& message = item->m_dcduMessage; + if (message.m_seq == 0) { + return nullptr; + } + + SWGSDRangel::SWGMapDatalinkMessage *swgMessage = new SWGSDRangel::SWGMapDatalinkMessage(); + swgMessage->setId(message.m_seq); + if (message.m_received.isValid()) { + swgMessage->setReceived(new QString(message.m_received.toUTC().toString(Qt::ISODateWithMs))); + } + swgMessage->setUplink(message.m_uplink ? 1 : 0); + if (!message.m_station.isEmpty()) { + swgMessage->setStation(new QString(message.m_station)); + } + swgMessage->setText(new QString(message.m_text)); + return swgMessage; +} + +void AircraftTracker::sendRouteToMap(TrackedFlight *flight, TrackedFlight::FiledRoute& route, + const QString& kind) +{ + if (!routeDrawn(flight)) + { + // Off the map, and not waiting to go on it: selecting the flight is what sends a + // route now, so nothing has to remember that this one wanted to be drawn. Cheap + // for the flight that was never drawn - removeDrawnRoute() returns straight away. + route.m_pending = false; + removeDrawnRoute(route); + return; + } + // Nothing to draw only when the plan names no path AND no procedure. A plan whose + // arrival end is all that has been heard has no waypoints of its own, but its STAR + // expands into a run of fixes, and the line from the departure airport through those + // to the arrival airport is worth drawing. + if (route.m_waypoints.isEmpty() && route.m_sid.isEmpty() && route.m_star.isEmpty()) { + route.m_pending = false; + return; + } + + // Nothing can be drawn until the flight has a name, since that is what the Map keys + // its items on - and on most protocols the route arrives before the identity does, + // an oceanic clearance naming the flight in a message the registration follows. + // This used to be tested AFTER the route was marked drawn, so a route filed before + // the identity was known was recorded as drawn and then never sent at all. + const QString name = flight->m_flight.isEmpty() + ? (flight->m_aircraft ? flight->m_aircraft->m_registration : QString()) : flight->m_flight; + // Both of the reasons a route cannot go out yet are things nothing tells the flight + // about when they change - the Map being opened, the identity arriving - so the + // route is remembered and retried from the flush timer. Without that, opening the + // Map after a clearance had been received left the route undrawn until another + // route-bearing message happened along, which on an oceanic flight can be an hour. + if (name.isEmpty()) + { + route.m_pending = true; + m_routesPending.insert(flight->m_id); + return; + } + + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + if (mapPipes.isEmpty()) + { + route.m_pending = true; + m_routesPending.insert(flight->m_id); + return; + } + route.m_pending = false; + + QList coords; + QList points = assembleRoutePoints(flight, route, coords); + QStringList names; + for (const AircraftReport::RouteWaypoint& point : points) { + names.append(point.m_name); + } + // One resolvable point is not a route, and drawing a line through it draws nothing. + // Not pending: only a fuller message can change this, and that calls back in here. + if (coords.size() < 2) + { + // A route that has been re-filed onto waypoints we cannot place is still a + // different route from the one on the Map, so what is drawn there is now wrong. + // Returning without saying so left the previous line and its markers up. + removeDrawnRoute(route); + return; + } + + // What would actually be drawn, rather than the waypoint list it came from. Keying + // on the waypoints alone meant a route was drawn once and then never corrected, + // where everything else about it improves after the first filing: the departure and + // arrival airports that bookend the line arrive in a later message, a waypoint that + // could not be placed at first is placed once the aircraft names it with its + // position, and the text is fuller once the whole message has been reassembled. + QStringList signature; + signature.append(name); + signature.append(flight->m_departure); + signature.append(flight->m_arrival); + signature.append(route.m_text); + // Or an insert that adds only the STAR would change the popup without redrawing it + signature.append(route.m_runway); + signature.append(route.m_sid); + signature.append(route.m_star); + signature.append(route.m_approach); + signature.append(route.m_alternate); + // The level the route is flown at, and the ALTITUDE of every fix with it. + // + // Without these a route already on the map is never redrawn when only its heights + // change, because nothing else about it has moved: the cruise level arrives in a + // later message than the path it applies to, so the fixes stayed on the ground while + // a SID or STAR - which changes m_sid or m_star, and so the signature - came out at + // its proper height. That asymmetry is exactly what it looked like from outside. + signature.append(QString::number(route.m_flightLevel)); + signature.append(QString::number(route.m_mach, 'f', 2)); + for (int i = 0; i < names.size(); i++) + { + signature.append(QString("%1@%2,%3,%4").arg(names[i]) + .arg(coords[i].latitude(), 0, 'f', 5).arg(coords[i].longitude(), 0, 'f', 5) + .arg(coords[i].altitude(), 0, 'f', 0)); + } + const QString drawn = signature.join(QChar(0x1f)); + if (drawn == route.m_drawn) { + return; + } + + // The Map keys its items on the name, and both the flight's name and the list of + // waypoints can change between drawings - a registration gives way to the callsign + // once it is known, and a re-filed route can be shorter than the one before it. What + // was drawn last time and will not be drawn this time has to be taken off by name, + // or the old line stays beside the new one and dropped waypoints stay on the map for + // the rest of the session. + const QString lineName = QString("%1 %2").arg(name).arg(kind); + QStringList waypointNames; + for (const QString& waypoint : names) { + waypointNames.append(QString("%1 %2 %3").arg(name).arg(kind).arg(waypoint)); + } + if (!route.m_drawnLine.isEmpty() && (route.m_drawnLine != lineName)) { + removeFromMap(route.m_drawnLine); + } + for (const QString& previous : route.m_drawnWaypoints) + { + if (!waypointNames.contains(previous)) { + removeFromMap(previous); + } + } + + QStringList text; + text.append(kind); + text.append(QString("Flight: %1").arg(name)); + if (!flight->m_departure.isEmpty() && !flight->m_arrival.isEmpty()) { + text.append(QString("Route: %1 to %2").arg(flight->m_departure).arg(flight->m_arrival)); + } + // In the order the flight is flown, and only the parts that were filed. A + // clearance has none of them; a plan assembled from its inserts has most. + if (!route.m_runway.isEmpty()) { + text.append(QString("Runway: %1").arg(route.m_runway)); + } + if (!route.m_sid.isEmpty()) { + text.append(QString("SID: %1").arg(route.m_sid)); + } + text.append("Waypoints: " + names.join(" ")); + if (!route.m_star.isEmpty()) { + text.append(QString("STAR: %1").arg(route.m_star)); + } + if (!route.m_approach.isEmpty()) { + text.append(QString("Approach: %1").arg(route.m_approach)); + } + if (!route.m_alternate.isEmpty()) { + text.append(QString("Alternate: %1").arg(route.m_alternate)); + } + if (route.m_flightLevel > 0) { + text.append(QString("Flight level: FL%1").arg(route.m_flightLevel)); + } + if (route.m_mach > 0.0f) { + text.append(QString("Mach: %1").arg(route.m_mach, 0, 'f', 2)); + } + // The message itself, which is where the clearance number, entry time, flight level + // and Mach are. The demodulator used to repeat those on every waypoint; one copy on + // the route says the same thing without covering the map in it. + if (!route.m_text.isEmpty()) + { + text.append(QString()); + text.append(route.m_text); + } + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(lineName)); + swgMapItem->setGroup(new QString(RouteMapGroup)); + swgMapItem->setLabel(new QString(name)); + swgMapItem->setText(new QString(text.join("\n"))); + swgMapItem->setLatitude(coords[0].latitude()); + swgMapItem->setLongitude(coords[0].longitude()); + swgMapItem->setAltitude(coords[0].altitude()); + swgMapItem->setImage(new QString("none")); + swgMapItem->setImageRotation(0); + swgMapItem->setFixedPosition(true); + swgMapItem->setAltitudeReference(3); // 1 - CLAMP_TO_GROUND, 3 - CLIP_TO_GROUND + + QList *line = new QList(); + for (const auto& coord : coords) + { + SWGSDRangel::SWGMapCoordinate *c = new SWGSDRangel::SWGMapCoordinate(); + c->setLatitude(coord.latitude()); + c->setLongitude(coord.longitude()); + c->setAltitude(coord.altitude()); + line->append(c); + } + swgMapItem->setCoordinates(line); + swgMapItem->setType(3); // Line + + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + + // The waypoints themselves. The Map does not draw its own waypoint layer across + // the whole globe, and shows it only when zoomed well in, so the points of a + // route have to be sent explicitly to be visible with the line. + for (int i = 0; i < names.size(); i++) + { + swgMapItem = new SWGSDRangel::SWGMapItem(); + // Not the name the Map uses for the waypoint itself, which would replace it + swgMapItem->setName(new QString(waypointNames[i])); + swgMapItem->setGroup(new QString(RouteMapGroup)); + swgMapItem->setLabel(new QString(names[i])); + + QStringList waypointText; + waypointText.append(QString("%1 waypoint").arg(kind)); + waypointText.append(QString("Flight: %1").arg(name)); + waypointText.append(QString("Waypoint: %1").arg(names[i])); + // Which procedure it came out of. Without this a procedure fix is an + // unexplained marker in the middle of nowhere - it is named for its + // procedure, so KKN43 says nothing unless the SID is named with it. + const AircraftReport::RouteWaypoint& point = points[i]; + if (!point.m_procedure.isEmpty()) + { + waypointText.append(QString("%1: %2") + .arg(point.m_procedureType.isEmpty() ? QString("Procedure") + : point.m_procedureType) + .arg(point.m_procedure)); + } + // A predicted fix says what the aircraft's own FMS expects there, which is + // a plain figure rather than the procedure's constraint + if (point.m_hasAltitude) { + waypointText.append(QString("Altitude: %1 ft").arg(point.m_altitudeFt)); + } + else + { + const QString constraint = altitudeConstraint(point); + if (!constraint.isEmpty()) { + waypointText.append(QString("Altitude: %1").arg(constraint)); + } + } + if (point.m_hasEta) { + waypointText.append(QString("ETA: %1").arg(point.m_eta.toString("hh:mm:ss"))); + } + // What the clearance said to fly the route at, on every fix of it + if (route.m_mach > 0.0f) { + waypointText.append(QString("Mach: %1").arg(route.m_mach, 0, 'f', 2)); + } + swgMapItem->setText(new QString(waypointText.join("\n"))); + + swgMapItem->setLatitude(coords[i].latitude()); + swgMapItem->setLongitude(coords[i].longitude()); + swgMapItem->setAltitude(coords[i].altitude()); + swgMapItem->setImage(new QString("waypoint.png")); + swgMapItem->setImageRotation(0); + swgMapItem->setFixedPosition(true); + // A fix with a real altitude is drawn AT it - clipping it to the ground would + // throw away the constraint that was the point of using it + swgMapItem->setAltitudeReference(coords[i].altitude() > 0.0 ? 0 : 3); + + msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + } + } + + // Only once it has gone out. Marking it before anything had been sent is what let a + // route be recorded as drawn and then dropped. + route.m_drawn = drawn; + route.m_drawnLine = lineName; + route.m_drawnWaypoints = waypointNames; + route.m_pending = false; + if (!flight->m_flightPlan.m_pending && !flight->m_clearance.m_pending) { + m_routesPending.remove(flight->m_id); + } +} + +// Take a route off the Map, by the names it was drawn under. Only what was actually +// emitted is removed, so this cannot disturb another route that happens to share a name. +void AircraftTracker::removeDrawnRoute(TrackedFlight::FiledRoute& route) +{ + if (route.m_drawnLine.isEmpty() && route.m_drawnWaypoints.isEmpty()) { + return; + } + if (!route.m_drawnLine.isEmpty()) { + removeFromMap(route.m_drawnLine); + } + for (const QString& waypoint : route.m_drawnWaypoints) { + removeFromMap(waypoint); + } + route.m_drawnLine.clear(); + route.m_drawnWaypoints.clear(); + route.m_drawn.clear(); +} + +// Everything this feature draws is sent once and then only when it changes, which is +// what keeps a busy sky affordable - but it means a Map opened later, or closed and +// opened again, starts from nothing and is only ever told about changes. So when the +// number of Maps listening goes up, everything is offered again: the tracks, the routes +// and the record marker. Aircraft positions need no help, being re-sent as they arrive. +void AircraftTracker::checkMapConsumers() +{ + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + + QSet consumers; + bool arrived = false; + for (const ObjectPipe *pipe : mapPipes) + { + consumers.insert(pipe->m_pipeId); + if (!m_mapConsumers.contains(pipe->m_pipeId)) { + arrived = true; + } + } + m_mapConsumers = consumers; + if (!arrived) { + return; // The same Maps, which have what they need + } + + for (TrackedAircraft *item : m_aircraft) + { + if (item->m_active) + { + // The whole track goes again. The name is kept: the Maps that already had + // the item need it to be told when it is renamed or taken off, and with it + // cleared, an item whose resend was then skipped (its position gone stale in + // the meantime) stayed on them as a ghost for the rest of the session. + item->m_mapTrackChanged = true; + // Held until it has actually been sent. A pass-through aircraft whose ADS-B + // has gone quiet is skipped by flush() for a minute after its last item, and + // the dirty set is cleared either way - so without this the aircraft would + // simply never reach the new Map. + item->m_mapResync = true; + m_mapResyncPending.insert(item); + m_dirtyAircraft.insert(item); + } + + } + + // Only the selected flight's routes are on a map at all, so only they have to be put + // on a new one. It is offered whether or not its aircraft is still being heard: a + // route is a record of where the aircraft was going, and is deliberately left up. + if (TrackedFlight *watched = flightById(m_watchedFlight)) + { + for (TrackedFlight::FiledRoute *route : { &watched->m_flightPlan, &watched->m_clearance }) + { + // The same test as sendRouteToMap(): a plan with only a SID or a STAR is + // drawn too, so it has to reach a new Map as well + if (!route->m_waypoints.isEmpty() || !route->m_sid.isEmpty() || !route->m_star.isEmpty()) + { + // Not removeDrawnRoute(): the items are still on the Maps that already + // had them, and re-sending replaces them by name + route->m_drawn.clear(); + route->m_pending = true; + m_routesPending.insert(watched->m_id); + } + } + } + + // Sent again for the same reason, and by the same means: forget what was last drawn + m_recordMapKey.clear(); + m_recordOnMap = false; + m_watchedTrackKey.clear(); + + // The coverage outline is otherwise only sent when a bin grows, which on HFDL can be + // hours away - and the one restored from the database at startup, before any Map + // existed, was never sent at all + if (m_settings.m_displayCoverage) { + sendCoverageToMap(); + } +} + +// A route held back for want of a Map to draw it on, or a name to draw it under. Neither +// is signalled, so this is polled - but only past the two tests that are cheap, so the +// expensive part, resolving each waypoint against the databases, is reached only when the +// route could actually be delivered. +void AircraftTracker::retryRoutes() +{ + if (m_routesPending.isEmpty()) { + return; + } + + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + if (mapPipes.isEmpty()) { + return; + } + + const QSet pending = m_routesPending; + for (quint64 id : pending) + { + TrackedFlight *flight = flightById(id); + if (!flight) + { + m_routesPending.remove(id); // Deleted, or merged into another flight + continue; + } + sendRouteToMap(flight, flight->m_flightPlan, "Flight plan"); + sendRouteToMap(flight, flight->m_clearance, "Oceanic clearance"); + if (!flight->m_flightPlan.m_pending && !flight->m_clearance.m_pending) { + m_routesPending.remove(id); + } + } +} + +void AircraftTracker::removeFromMap(const QString& name) +{ + QList mapPipes; + MainCore::instance()->getMessagePipes().getMessagePipes(m_feature, "mapitems", mapPipes); + + for (const auto& pipe : mapPipes) + { + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + SWGSDRangel::SWGMapItem *swgMapItem = new SWGSDRangel::SWGMapItem(); + swgMapItem->setName(new QString(name)); + swgMapItem->setImage(new QString("")); // An empty image removes the item + MainCore::MsgMapItem *msg = MainCore::MsgMapItem::create(m_feature, swgMapItem); + messageQueue->push(msg); + } +} diff --git a/plugins/feature/aircraft/aircrafttracker.h b/plugins/feature/aircraft/aircrafttracker.h index 5e3be487e..7c9ae7a9d 100644 --- a/plugins/feature/aircraft/aircrafttracker.h +++ b/plugins/feature/aircraft/aircrafttracker.h @@ -1,770 +1,1136 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_FEATURE_AIRCRAFTTRACKER_H_ -#define INCLUDE_FEATURE_AIRCRAFTTRACKER_H_ - -#include -#include -#include -#include -#include -#include -#include - -#include "util/message.h" -#include "util/messagequeue.h" -#include "util/aircraftreport.h" -#include "util/osndb.h" -// For the tables a filed route is resolved against - see resolveRoute() -#include "util/openaip.h" -#include "util/ourairportsdb.h" -#include "util/waypoints.h" - -#include "aircraftsettings.h" - -class Feature; -struct sqlite3; - -namespace SWGSDRangel { - class SWGMapItem; - class SWGMapCoordinate; -} - -// Snapshots of the tracker's state, sent to the GUI over queued signals so the -// GUI never touches the tracker thread's data -struct AircraftDisplay { - quint64 m_id = 0; - quint32 m_icao = 0; - QString m_registration; - QString m_flight; - bool m_positionValid = false; - // Distance from the antenna that heard the aircraft, in km - see TrackedAircraft - bool m_distanceValid = false; - float m_distanceKm = 0.0f; - float m_latitude = 0.0f; - float m_longitude = 0.0f; - bool m_altitudeValid = false; - float m_altitudeFt = 0.0f; - bool m_headingValid = false; - float m_heading = 0.0f; - bool m_speedValid = false; - float m_speedKts = 0.0f; - QString m_protocols; - int m_messages = 0; - QDateTime m_lastSeen; - QString m_mapName; - quint64 m_currentFlightId = 0; - bool m_active = false; // Data is arriving for this aircraft -}; - -struct FlightDisplay { - quint64 m_id = 0; - quint64 m_aircraftId = 0; - QString m_flight; - QString m_aliases; - QString m_reg; - QString m_departure; - QString m_arrival; - QString m_route; - QDateTime m_firstSeen; - QDateTime m_lastSeen; - int m_documents = 0; - int m_messages = 0; - QString m_protocols; // Protocols and frequencies THIS flight was heard on - QDateTime m_out; - QDateTime m_off; - QDateTime m_on; - QDateTime m_in; - // Whether the flight has produced each of the documents worth knowing about at a - // glance, so the table can say so without opening the flight - bool m_hasLoadsheet = false; - bool m_hasClearance = false; - bool m_hasFlightPlan = false; - bool m_active = false; // The flight an active aircraft is currently flying -}; - -struct DocumentEvent { - quint64 m_aircraftId = 0; - quint64 m_flightId = 0; - QDateTime m_received; - QString m_flight; - QString m_reg; - QString m_kind; - QString m_title; - QString m_text; - QString m_mapName; -}; - -struct AtcEvent { - quint64 m_aircraftId = 0; - quint64 m_flightId = 0; - QDateTime m_received; - QString m_protocol; - bool m_uplink = false; - QString m_from; - QString m_to; - QString m_message; - QString m_tooltip; - QString m_mapName; -}; - -Q_DECLARE_METATYPE(AircraftDisplay) -Q_DECLARE_METATYPE(FlightDisplay) -Q_DECLARE_METATYPE(DocumentEvent) -// A weather report is about an AIRPORT, not about the aircraft that happened to ask -// for it - so it outlives that aircraft and is kept in its own log -struct WeatherEvent { - QDateTime m_received; - QString m_airport; // ICAO code, empty if the report did not name one - QString m_kind; // METAR, TAF, ATIS, TWIP, NOTAM, PIREP, SIGMET - QString m_summary; // First line, for the table - QString m_text; // The report as sent - QString m_from; // Aircraft that carried it, for provenance -}; - -Q_DECLARE_METATYPE(AtcEvent) -Q_DECLARE_METATYPE(WeatherEvent) - -// Collates aircraft reports from the demodulators into aircraft, flights and -// documents, drives the Map and persists the session, all off the GUI thread. -// Runs on its own thread inside the Aircraft feature, in both GUI and server -// builds; the GUI, when there is one, is a view driven by this class's signals. -// Session and lifetime statistics shown on the Statistics tab. -// -// Every figure is kept twice: once for this session and once for all time. The two -// answer different questions - "is the aerial working as well as it did yesterday" -// wants the session, "how far have we ever heard" wants all time - and neither is -// recoverable from the other, so both are counted as reports arrive. -// -// The all time side persists. Most of it travels in the settings blob, as the records -// always have. The one exception is the aircraft count, which cannot be a running -// total: the same airframe heard on two days must count once, so it needs the set of -// who has been heard, not a number. That set is the database's "seen" table, which is -// also the only part of this that survives the retention period pruning the rest. -struct AircraftStatistics { - // A record holder: the value, who set it, when, and where they were at the time. - // The position is what lets the max range record be drawn on the Map at the point - // it was actually achieved rather than wherever the aircraft is now - which for an - // all time record is very probably nowhere, the aircraft having long since landed. - struct Record { - bool m_valid = false; - float m_value = 0.0f; - QString m_aircraft; // Registration, else flight, else ICAO address - QDateTime m_when; - bool m_positionValid = false; - float m_latitude = 0.0f; - float m_longitude = 0.0f; - bool m_altitudeValid = false; - float m_altitudeFt = 0.0f; - - // Returns true if this beat the record - bool update(float value, const QString& aircraft, const QDateTime& when, - bool positionValid, float latitude, float longitude, - bool altitudeValid, float altitudeFt) - { - if (m_valid && (value <= m_value)) { - return false; - } - m_valid = true; - m_value = value; - m_aircraft = aircraft; - m_when = when; - m_positionValid = positionValid; - m_latitude = latitude; - m_longitude = longitude; - m_altitudeValid = altitudeValid; - m_altitudeFt = altitudeFt; - return true; - } - }; - - // One complete set of figures, over whatever period the holder covers - struct Scope { - // Furthest heard on each protocol, indexed by AircraftReport::Protocol. Per - // protocol rather than one overall figure because the whole point of comparing - // them is that they are so different - line of sight VHF against HF skywave - // against a satellite. - Record m_maxRange[AircraftReport::ProtocolCount]; - Record m_fastest; // Ground speed, knots - Record m_highest; // Altitude, feet - - quint64 m_totalMessages = 0; // Reports of any kind - quint64 m_messagesByProtocol[AircraftReport::ProtocolCount] = {}; - int m_distinctAircraft = 0; // Different aircraft heard - int m_maxConcurrent = 0; // Most aircraft heard within any 15 minute window - QDateTime m_maxConcurrentWhen; - qint64 m_seconds = 0; // Time spent listening, filled in as it is emitted - - // Applies a report to every record this scope keeps - void update(int protocol, bool rangeValid, float rangeKm, bool speedValid, - float speedKts, bool altitudeValid, float altitudeFt, - const QString& who, const QDateTime& when, - bool positionValid, float latitude, float longitude) - { - m_totalMessages++; - if ((protocol >= 0) && (protocol < AircraftReport::ProtocolCount)) - { - m_messagesByProtocol[protocol]++; - if (rangeValid) { - m_maxRange[protocol].update(rangeKm, who, when, positionValid, - latitude, longitude, altitudeValid, altitudeFt); - } - } - if (speedValid) { - m_fastest.update(speedKts, who, when, positionValid, latitude, longitude, - altitudeValid, altitudeFt); - } - if (altitudeValid) { - m_highest.update(altitudeFt, who, when, positionValid, latitude, longitude, - altitudeValid, altitudeFt); - } - } - }; - - Scope m_session; - Scope m_allTime; - QDateTime m_sessionStart; - QDateTime m_firstStart; // When the all time figures began - - static const int ConcurrentWindowMins = 15; -}; - -Q_DECLARE_METATYPE(AircraftStatistics) - -class AircraftTracker : public QObject -{ - Q_OBJECT - -public: - class MsgConfigureTracker : public Message { - MESSAGE_CLASS_DECLARATION - public: - const AircraftSettings& getSettings() const { return m_settings; } - const QList& getSettingsKeys() const { return m_settingsKeys; } - bool getForce() const { return m_force; } - static MsgConfigureTracker* create(const AircraftSettings& settings, const QList& settingsKeys, bool force) { - return new MsgConfigureTracker(settings, settingsKeys, force); - } - private: - AircraftSettings m_settings; - QList m_settingsKeys; - bool m_force; - MsgConfigureTracker(const AircraftSettings& settings, const QList& settingsKeys, bool force) : - Message(), m_settings(settings), m_settingsKeys(settingsKeys), m_force(force) - {} - }; - - class MsgReport : public Message { - MESSAGE_CLASS_DECLARATION - public: - AircraftReport& getReport() { return m_report; } - static MsgReport* create(const AircraftReport& report) { return new MsgReport(report); } - ~MsgReport(); // Owns m_report.m_mapItem until processing transfers it - private: - AircraftReport m_report; - MsgReport(const AircraftReport& report) : Message(), m_report(report) {} - }; - - class MsgDeleteAll : public Message { - MESSAGE_CLASS_DECLARATION - public: - static MsgDeleteAll* create() { return new MsgDeleteAll(); } - private: - MsgDeleteAll() : Message() {} - }; - - // Zero one half of the statistics. The all time half also clears the record of - // which airframes have been heard, which is the only way its aircraft count can go - // back to nothing - class MsgResetStatistics : public Message { - MESSAGE_CLASS_DECLARATION - public: - bool getAllTime() const { return m_allTime; } - static MsgResetStatistics* create(bool allTime) { return new MsgResetStatistics(allTime); } - private: - bool m_allTime; - MsgResetStatistics(bool allTime) : Message(), m_allTime(allTime) {} - }; - - // GUI (re)connected: resend the complete state - class MsgResync : public Message { - MESSAGE_CLASS_DECLARATION - public: - static MsgResync* create() { return new MsgResync(); } - private: - MsgResync() : Message() {} - }; - - // Which flight's profile the GUI is charting; 0 for none - class MsgWatchFlight : public Message { - MESSAGE_CLASS_DECLARATION - public: - quint64 getFlightId() const { return m_flightId; } - static MsgWatchFlight* create(quint64 flightId) { return new MsgWatchFlight(flightId); } - private: - quint64 m_flightId; - MsgWatchFlight(quint64 flightId) : Message(), m_flightId(flightId) {} - }; - - explicit AircraftTracker(Feature *feature); - ~AircraftTracker(); - - MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } - -public: - // Used by the GUI, which owns persistence: it holds the blob ready for serialize() - static QByteArray serializeStatistics(const AircraftStatistics& statistics); - static AircraftStatistics deserializeStatistics(const QByteArray& data); - -public slots: - void startWork(); - -signals: - void aircraftUpdated(const QList& aircraft); - void aircraftRemoved(const QList& ids); - void flightsUpdated(const QList& flights); - void flightsRemoved(const QList& ids); - void documentsAdded(const QList& documents); - void atcMessages(const QList& messages); - void weatherReports(const QList& reports); - void profileUpdated(quint64 flightId, const QList& times, const QList& altitudeFt, const QList& speedKts); - void messageRates(const QList& ratesPerProtocolThenTotal); - void statisticsUpdated(const AircraftStatistics& statistics); - void speechNotification(const QString& speech); - void allCleared(); - //!< The database could not be changed, so the setting has been put back to the file - //!< actually in use. The GUI holds the settings that get serialised, so it has to - //!< hear about it or it would keep - and save - a path nothing is writing to. - void databaseFilenameReverted(const QString& filename); - -private: - struct TrackedAircraft; - - struct TrackedDocument { - int m_kind; - QString m_title; - QString m_text; - QDateTime m_received; - }; - - struct TrackedFlight { - quint64 m_id = 0; - QString m_flight; - QStringList m_aliases; - TrackedAircraft *m_aircraft = nullptr; - QDateTime m_firstSeen; - QDateTime m_lastSeen; - QString m_departure; - QString m_arrival; - QString m_route; - //!< When the message that revealed m_departure, m_arrival and m_route was - //!< received, so a delayed one cannot put back what a newer one has replaced. - //!< Invalid where the facts came from the callsign to route database, which is a - //!< standing guess rather than something the aircraft said. - QDateTime m_routeFiled; - // A route the aircraft has been given, drawn on the Map. Kept apart from - // m_route because the callsign to route database also fills that in, with the - // airport pair rather than a list of waypoints, and only a real waypoint list - // can be drawn. - struct FiledRoute { - QString m_waypoints; //!< The route as filed, names separated by spaces - //!< Where the message put those waypoints, when it said. Same order and - //!< length as m_waypoints, or empty when it named them without placing them. - QList m_points; - QString m_text; //!< The message that filed it, for the popup - QDateTime m_filed; //!< When, so a merge can tell two routes apart - QString m_drawn; //!< What was last sent, so it is only sent once - //!< Held back for want of a Map to send it to or a name to key it on - - //!< neither of which the flight is told about when it changes - bool m_pending = false; - //!< The Map item names last emitted, so that anything which will not be - //!< drawn again can be taken off. The Map keys on the name, so a route that - //!< has been renamed would otherwise be drawn twice over. - QString m_drawnLine; - QStringList m_drawnWaypoints; - }; - FiledRoute m_flightPlan; //!< An FPN plan, or a position report's route insert - FiledRoute m_clearance; //!< An oceanic clearance or its readback - //!< Protocols and frequencies THIS flight has been heard on, the same tally the - //!< airframe keeps but bounded to one flight. The Map shows this one: an - //!< airframe heard on HFDL over the Atlantic last month is not being heard on - //!< HFDL now, so naming it beside the aircraft on the Map is simply wrong. - QHash, int> m_sources; - QList m_documents; - QList m_profileTimes; - QList m_profileAltFt; - QList m_profileSpeedKts; - // The ground track belongs to the FLIGHT, not to the airframe. An aircraft is - // heard again days later on a different route, and drawing every track it has - // ever flown puts unrelated lines across the map - // How many of the points below are already in the database. The track and the - // profile only ever grow, so a save writes the tail rather than rewriting the - // whole history - see saveDatabase(). Reset to zero, and the flight added to - // m_flightsToRewrite, whenever the arrays are rebuilt rather than appended to. - int m_trackSaved = 0; - int m_profileSaved = 0; - QList m_track; - QList m_trackTimes; - int m_messages = 0; // Reports of any kind attributed to this flight - // The OOOI times, as the flight reported them. Out of gate, take off, landing, - // on gate - the four instants that describe a flight from the ground's point of - // view, and the ones an airline's own systems run on. - QDateTime m_out; - QDateTime m_off; - QDateTime m_on; - QDateTime m_in; - // The ground track belongs to the FLIGHT, not to the airframe. An aircraft is - // heard again days later on a different route, and drawing every track it has - // ever flown puts unrelated lines across the map - - ~TrackedFlight() { qDeleteAll(m_documents); } - }; - - // How much a position can be trusted, best first. A VDL-2 XID link management frame - // carries an aircraft location parameter with 0.1 degree resolution - about 11 km - - // which is enough for a ground station to decide a handoff, but drags an ADS-B track - // sideways every time one arrives - enum PositionRank { - PositionAdsb = 0, // ADS-B: metres, about once a second - PositionReported = 1, // A real position report, whatever protocol carried it - PositionCoarse = 2, // A location parameter from a link management frame - PositionRanks = 3 - }; - - static int positionRank(const AircraftReport& report); - - // Altitude is ranked separately from position, and for a different reason. An XID - // location parameter carries an altitude as a single octet of thousands of feet, and - // a minority of aircraft - overwhelmingly Boeing 737NGs - fill it with nonsense: - // 59000, 65000, 90000, 123000 ft have all been observed off air, from aircraft whose - // ADS-B put them at a normal cruise at the same moment. The value is not merely - // coarse, it is sometimes wrong, so it must not set a record and must not displace a - // real altitude. See the note above AcarsVdl2Atn's altitude handling for the - // measurements behind that. - enum AltitudeRank { - AltitudeAdsb = 0, // ADS-B: 25 ft, about once a second - AltitudeReported = 1, // A real position or performance report - AltitudeCoarse = 2, // A link management frame's location parameter - AltitudeRanks = 3 - }; - - static int altitudeRank(const AircraftReport& report); - - // A less accurate source is only used once the better ones have gone quiet for this long - static const int m_positionRankTimeoutSecs = 60; - // How long a flight number may still stand in for an identity. Long enough to cover - // a flight heard intermittently, far short of the same number returning tomorrow. - static const int m_flightKeyValidSecs = 12*60*60; - // Positions that would need a faster aircraft than this to reach are stale or wrong - static const int m_maxGroundSpeedKn = 700; - static constexpr double m_positionToleranceKm = 5.0; - - struct TrackedAircraft { - quint64 m_id = 0; - quint32 m_icao = 0; - QString m_registration; - QString m_flight; - bool m_positionValid = false; - float m_latitude = 0.0f; - float m_longitude = 0.0f; - float m_altitudeFt = 0.0f; - bool m_altitudeValid = false; - // The two most recent altitude observations, so an altitude can be worked out - // for the moment a position was measured rather than assuming they coincide - QDateTime m_altitudeDateTime; - float m_prevAltitudeFt = 0.0f; - QDateTime m_prevAltitudeDateTime; - float m_heading = 0.0f; - bool m_headingValid = false; - float m_speedKts = 0.0f; - bool m_speedValid = false; - //!< When each was observed. Neither is timestamped in its own right - a velocity - //!< message says what the aircraft is doing now, not when - so this is the - //!< report's reception time, which is enough to stop a delayed report putting - //!< back a heading or speed the aircraft has already left behind. - QDateTime m_headingDateTime; - QDateTime m_speedDateTime; - // Great circle distance from the receiver to the aircraft, in km. Measured from - // the position of the DEVICE the report arrived on where it has one - a remote - // SDR reports where it is - and from My Position otherwise, so a distance always - // means "from the antenna that heard it" rather than "from here". - bool m_distanceValid = false; - float m_distanceKm = 0.0f; - QDateTime m_positionDateTime; - QDateTime m_positionRankTimes[PositionRanks]; // When a position of each rank last arrived - int m_positionRank = PositionRanks; // Rank of the position we are holding - QDateTime m_altitudeRankTimes[AltitudeRanks]; // When an altitude of each rank last arrived - QDateTime m_lastSeen; - QString m_departure; - QString m_arrival; - QString m_route; - QString m_lastDocumentText; - // Every protocol and frequency this airframe has EVER been heard on, kept for - // as long as the airframe is. The flight has its own, which is what the Map - // shows: an airframe heard on HFDL over the Atlantic last month is not being - // heard on HFDL now, and saying so on the Map is simply wrong. - QHash, int> m_sources; - int m_messages = 0; - QString m_mapName; - QDateTime m_lastMapItemTime; - QString m_model3D; - float m_modelAltitudeOffset = 0.0f; // So the undercarriage is not underground - float m_labelAltitudeOffset = 0.0f; - // Whether we chose the model or the ADS-B pass-through brought one. Only ours may - // be thrown away and chosen again when the livery preference changes - replacing - // a pass-through model with our own would fight the demodulator for it. - bool m_modelIsOurs = false; - bool m_mapModelForm = false; - bool m_mapTrackChanged = true; - //!< Owed to a Map that has just appeared, and still owed until something has - //!< actually been sent - see checkMapConsumers() - bool m_mapResync = false; - QList m_flights; - TrackedFlight *m_currentFlight = nullptr; - // Set when a report arrives, cleared when the aircraft goes quiet. Aircraft - // restored from the session database start inactive, so a new session begins - // with empty active tables - bool m_active = false; - QSet m_notifiedRules; - - ~TrackedAircraft() { qDeleteAll(m_flights); } - }; - - Feature *m_feature; // Pipe source for the Map - AircraftSettings m_settings; - MessageQueue m_inputMessageQueue; - - QList m_aircraft; - QHash m_byKey; - quint64 m_nextId = 1; - - QSharedPointer> m_aircraftInfo; - QSharedPointer> m_aircraftInfoByIcao; - QSharedPointer> m_routeInfo; - // Used to turn the named waypoints of a filed route into coordinates. All three are - // process wide caches shared with the Map and the ACARS demodulator, so holding them - // here costs a pointer rather than another copy of the data. - QSharedPointer> m_navAids; - QSharedPointer> m_airports; - QSharedPointer> m_waypoints; - - QList m_atcLog; // Self-contained, outlives its aircraft - QList m_weatherLog; // Likewise, and keyed on airports not aircraft - // Which reports are already in the log, so a repeat is recognised without comparing - // it against every entry ever logged. Maps a hash of the report to its position; the - // full comparison still happens on a hash match, so a collision costs one comparison - // rather than silently dropping a report that was not really a duplicate. The log is - // only ever appended to, so the positions never move. - QMultiHash m_weatherIndex; - - // Batched GUI notifications - QSet m_dirtyAircraft; - QSet m_dirtyFlights; - QList m_pendingDocuments; - QList m_pendingAtc; - QList m_pendingWeather; - QTimer *m_flushTimer = nullptr; - QTimer *m_removalTimer = nullptr; - QTimer *m_chartTimer = nullptr; - // One counter per protocol plus a total - static const int CHART_COUNTS = AircraftReport::ProtocolCount + 1; - int m_chartCounts[CHART_COUNTS]; - QDateTime m_chartRateTime; - - quint64 m_watchedFlight = 0; // Flight whose profile the GUI charts - bool m_watchedFlightChanged = false; - - sqlite3 *m_db = nullptr; - // Flights whose stored track and profile no longer match what is in memory. Deleted - // flights have to be named, because the save no longer empties those tables and so - // would otherwise leave their rows behind for ever. - QSet m_flightsToDelete; - QSet m_flightsToRewrite; - bool m_dbTrackWipe = false; //!< Everything in track and profile is stale - bool m_dbDirty = false; - bool m_loadingDatabase = false; - - bool handleMessage(const Message& message); - void processReport(AircraftReport& report); - - TrackedAircraft *findOrCreateAircraft(const AircraftReport& report); - void absorbAircraft(TrackedAircraft *item, TrackedAircraft *weak); - TrackedFlight *updateFlight(TrackedAircraft *item, const AircraftReport& report); - void mergeFlightInto(TrackedAircraft *item, TrackedFlight *dst, TrackedFlight *src); - void mergeLoadedFlights(TrackedAircraft *item); - static bool splitFlightName(const QString& flight, QString& airline, QString& number); - static bool sameFlightNumber(const QString& a, const QString& b); - static bool flightMatches(const TrackedFlight *flight, const QString& name); - //!< When this aircraft was last heard flying this callsign, which is not when it was - //!< last heard: it is very likely flying something else by now - static QDateTime flightLastSeen(const TrackedAircraft *item, const QString& flight); - //!< Whether two of one airframe's flights are one operation rather than the same - //!< callsign flown again on another day - bool sameOperation(const TrackedFlight *a, const TrackedFlight *b) const; - void addFlightAlias(TrackedAircraft *item, TrackedFlight *flight, const QString& name); - void addDocument(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report); - void addAtcMessage(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report); - void addWeatherReport(TrackedAircraft *item, const AircraftReport& report); - static QString weatherKindName(int kind); - QString documentKindName(int kind) const; - QString protocolName(int protocol) const; - static QString notificationSignature(const AircraftSettings& settings); - void claimKey(TrackedAircraft *item, const QString& key); - void updateRecordMapItem(); - static const char *RecordMapItemName; - void resolveRoute(QList& points, - QList& coords) const; - void sendRouteToMap(TrackedFlight *flight, TrackedFlight::FiledRoute& route, - const QString& kind); - void removeDrawnRoute(TrackedFlight::FiledRoute& route); - - // What updateRecordMapItem() last put on the Map, so an unchanged record is not - // re-sent 3 times a second, and so it can be taken off again when the option is - // turned off or the record is reset - QString m_recordMapKey; - bool m_recordOnMap = false; - bool m_recordUnplaceableWarned = false; - - // Flights with a route that could not be delivered. Held by id rather than by - // pointer, so a flight deleted or merged away in the meantime simply fails to - // resolve rather than leaving this dangling. - QSet m_routesPending; - void retryRoutes(); - - // WHICH Map features were listening last time anything was sent, by pipe id rather - // than by count: closing one Map and opening another between flushes leaves the count - // where it was, and the replacement would never be caught up. Delivery is remembered - // per item rather than per Map - what has been drawn, what track was last sent - so a - // Map opened after the fact is given later positions but none of what went out before - // it existed. Saying it all again to everyone is the cheap answer; per consumer state - // would be the thorough one. - QSet m_mapConsumers; - // Aircraft owed to a Map that has just opened but not sendable yet: a basic item - // would replace a richer pass-through one for a minute after the last of those - // arrived. Kept here rather than in m_dirtyAircraft, which flush() empties every - // pass and which drives a GUI update for everything in it. - QSet m_mapResyncPending; - void checkMapConsumers(); - - // Statistics - void updateStatistics(const AircraftReport& report, TrackedAircraft *item, - bool rangeValid, float rangeKm, - bool altitudeValid, float altitudeFt); - - void updateConcurrent(const QDateTime& now); - QGeoCoordinate receiverPosition(int deviceSetIndex); - void update3DModel(TrackedAircraft *item); - - AircraftStatistics m_statistics; - bool m_statisticsDirty = false; - bool m_statisticsLoaded = false; - // Seconds carried in from previous sessions, so the all time clock can be reported - // as a live total rather than only advancing when the app is restarted - qint64 m_allTimeSecondsBase = 0; - // What m_allTimeSecondsBase is measured from. Normally the start of the session, but - // an all time reset moves it to the moment of the reset - otherwise the all time - // clock would restart at however long this session had already been running - QDateTime m_allTimeSince; - // Aircraft heard this session. The tracked list is restored from the database at - // startup, so "a TrackedAircraft was allocated" counts only aircraft that fell out - // of the retention period - which under-reported the session badly - QSet m_sessionHeard; - // Those of them already written to the all time table. Separate from the above - // because an aircraft can be heard before it is identified - an ACARS report can - // arrive with only a flight number and gain its registration later - and it must be - // counted under the identity it will keep, not the first one it happened to show - QSet m_sessionRecorded; - // Drives a statistics update once a minute so both elapsed clocks tick even when - // nothing is being received - qint64 m_statisticsMinute = -1; - // Receiver positions, cached by device set index: getDevicePosition() builds a whole - // device report and parses it as JSON, which is far too heavy to do per message - QHash m_devicePositions; - QDateTime m_devicePositionsRefreshed; - // Taking the tally rather than its owner, because both the airframe and the - // flight it is on keep one - QStringList sourcesList(const QHash, int>& sources) const; - QString sourcesText(const QHash, int>& sources) const; - QString mapItemName(const TrackedAircraft *item) const; - QString flightLabel(const QString& flight) const; - QString atcLabel(const TrackedAircraft *item) const; - QString aircraftImage(const TrackedAircraft *item) const; - //!< The same choice for an aircraft that is no longer tracked - all the record - //!< marker has is the name and, where the airframe is still known, its 3D model - QString aircraftImage(const QString& registration, const QString& model3D) const; - QList *buildTrack(const TrackedFlight *flight) const; - QDateTime mapAvailableUntil(const TrackedAircraft *item) const; - int positionTimeoutSecs(const TrackedAircraft *item) const; - bool positionStale(const TrackedAircraft *item, const QDateTime& now) const; - static float altitudeAt(const TrackedAircraft *item, const QDateTime& when, float fallbackFt); - // Which of an aircraft's flights the map should draw the track of - the one it is - // flying now, unless the GUI is looking at one of its past flights - const TrackedFlight *trackFlight(const TrackedAircraft *item) const; - void sendToMap(TrackedAircraft *item); - void forwardMapItem(TrackedAircraft *item, SWGSDRangel::SWGMapItem *swgMapItem); - - void removeFromMap(const QString& name); - void checkNotifications(TrackedAircraft *item, const AircraftReport& report); - QString subAircraftString(TrackedAircraft *item, const AircraftReport& report, const QString& string) const; - void commandNotification(const QString& command); - void deleteAll(); - void resync(); - void applySettings(const AircraftSettings& settings, const QList& settingsKeys, bool force); - AircraftDisplay displayFor(const TrackedAircraft *item) const; - FlightDisplay displayFor(const TrackedFlight *flight) const; - DocumentEvent documentEvent(const TrackedAircraft *item, const TrackedFlight *flight, const TrackedDocument *doc) const; - void emitProfile(const TrackedFlight *flight); - TrackedFlight *flightById(quint64 id) const; - QString regFor(const TrackedAircraft *item) const; - - // Implemented in aircraftdb.cpp - bool openDatabase(); - // Remembers that this airframe has been heard at all, for the all time aircraft - // count. Returns 1 if it had not been heard before, 0 if it had, and -1 if it cannot - // be identified yet - in which case the caller should try again on the next report - //!< Writes this airframe into the all time "seen" table, folding away a row left - //!< under an identity it has since outgrown. Returns 1 when the table was written, - //!< -1 when it could not be and the caller should ask again, and sets countDelta to - //!< the change in the number of distinct airframes the table holds: +1 for one not - //!< seen before, -1 where two rows turned out to be one airframe, 0 otherwise. - int recordSeen(TrackedAircraft *item, int& countDelta); - int seenCount(); - void resetSeen(); - void closeDatabase(); - //!< Returns false when nothing was written - the transaction rolled back, or there - //!< is no database. The session is then still only in memory, which is what makes it - //!< unsafe to switch databases: see changeDatabase(). - bool saveDatabase(); - void revertDatabaseFilename(const QString& path); - // The stored track and profile no longer relate to what is in memory at all - void forgetSavedTracks(); - void loadDatabase(); - -private slots: - void handleInputMessages(); - void flush(); - void removeOldAircraft(); - void setActive(TrackedAircraft *item, bool active); - void discardOldAircraft(); - void changeDatabase(const QString& oldPath); - static QString databasePath(const AircraftSettings& settings); - void updateChartCounts(); -}; - -#endif // INCLUDE_FEATURE_AIRCRAFTTRACKER_H_ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_AIRCRAFTTRACKER_H_ +#define INCLUDE_FEATURE_AIRCRAFTTRACKER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "util/acarsmessage.h" +#include + +#include "util/message.h" +#include "util/messagequeue.h" +#include "util/aircraftreport.h" +#include "util/osndb.h" +// For the tables a filed route is resolved against - see resolveRoute() +#include "util/openaip.h" +#include "util/ourairportsdb.h" +#include "util/waypoints.h" + +#include "aircraftsettings.h" + +class Feature; +struct sqlite3; + +namespace SWGSDRangel { + class SWGMapItem; + class SWGMapCoordinate; + class SWGMapFlightPlan; + class SWGMapDatalinkMessage; +} + +// Snapshots of the tracker's state, sent to the GUI over queued signals so the +// GUI never touches the tracker thread's data +struct AircraftDisplay { + quint64 m_id = 0; + quint32 m_icao = 0; + QString m_registration; + QString m_flight; + // The flight it is on now, under both of its names - see FlightDisplay and + // AircraftTracker::flightNameForms(). The aliases belong to the FLIGHT, so an + // airframe that is not on one has only the name it was last heard under. + QString m_callsign; + QString m_flightNumber; + bool m_positionValid = false; + // Distance from the antenna that heard the aircraft, in km - see TrackedAircraft + bool m_distanceValid = false; + float m_distanceKm = 0.0f; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + bool m_altitudeValid = false; + float m_altitudeFt = 0.0f; + bool m_headingValid = false; + float m_heading = 0.0f; + bool m_speedValid = false; + float m_speedKts = 0.0f; + QString m_protocols; + int m_messages = 0; + QDateTime m_lastSeen; + //!< When the Map stops holding this aircraft, which is the same instant the CZML + //!< availability interval ends. An expiry rather than a flag, so that a row the + //!< tracker has not touched since still answers correctly as time passes - the + //!< sweep that takes a stale aircraft off the Map does not refresh the tables. + //!< Invalid when there is no position, i.e. it was never placed at all. + QDateTime m_mapAvailableUntil; + QString m_mapName; + quint64 m_currentFlightId = 0; + bool m_active = false; // Data is arriving for this aircraft + //!< Its SELCAL code: the one it was heard called on, otherwise what the SELCAL + //!< database assigns it + QString m_selcal; +}; + +struct FlightDisplay { + quint64 m_id = 0; + quint64 m_aircraftId = 0; + QString m_flight; + // The same flight under its two names. An airline has an ICAO designator of three + // letters and an IATA one of two, and the aircraft is called by both: the transponder + // broadcasts TOM7BD while ACARS carries BY07BD, which is the same flight. They are + // held together as aliases; these say which of them is which, so the table can put + // them side by side rather than leaving you to match them up. + QString m_callsign; // ICAO form, or the primary name where none is known + QString m_flightNumber; // IATA form, empty until a message gives one + QString m_aliases; + QString m_reg; + QString m_departure; + QString m_arrival; + QString m_route; + QDateTime m_firstSeen; + QDateTime m_lastSeen; + int m_documents = 0; + int m_messages = 0; + QString m_protocols; // Protocols and frequencies THIS flight was heard on + QDateTime m_out; + QDateTime m_off; + QDateTime m_on; + QDateTime m_in; + // Whether the flight has produced each of the documents worth knowing about at a + // glance, so the table can say so without opening the flight + bool m_hasLoadsheet = false; + bool m_hasClearance = false; + bool m_hasFlightPlan = false; + bool m_active = false; // The flight an active aircraft is currently flying + // Where the airport pair came from, and what the callsign to route database makes of + // it. The database is a guess - one route per callsign, flown or not - so a message + // that disagrees with it is the message being right, as TOM3TW was. + QString m_routeSource; // "Database" or "Message", empty when neither end is known + bool m_routeChecked = false; // The database had an entry to compare against + bool m_routeAgrees = false; // ...and it says the same thing + // Whether each end was stated by a received message rather than guessed from the + // callsign. Per end, because they often arrive from different messages at different + // times, and the table colours each cell on its own. + bool m_departureFromMessage = false; + bool m_arrivalFromMessage = false; +}; + +struct DocumentEvent { + quint64 m_aircraftId = 0; + quint64 m_flightId = 0; + QDateTime m_received; + QString m_flight; + QString m_reg; + QString m_kind; + QString m_title; + QString m_text; + QString m_mapName; +}; + +struct AtcEvent { + quint64 m_aircraftId = 0; + quint64 m_flightId = 0; + QDateTime m_received; + QString m_protocol; + //!< The link the message came in on and its frequency, as "VDL2 136.975", in the + //!< same form as the Protocols column of the aircraft and flights tables. Empty for + //!< messages read back from a database written before this was recorded + QString m_link; + bool m_uplink = false; + QString m_from; + QString m_to; + QString m_message; + QString m_tooltip; + QString m_mapName; + bool m_stored = false; //!< Already in the database - only the rest are written +}; + +Q_DECLARE_METATYPE(AircraftDisplay) +Q_DECLARE_METATYPE(FlightDisplay) +Q_DECLARE_METATYPE(DocumentEvent) +// A weather report is about an AIRPORT, not about the aircraft that happened to ask +// for it - so it outlives that aircraft and is kept in its own log +struct WeatherEvent { + QDateTime m_received; + QString m_airport; // ICAO code, empty if the report did not name one + QString m_kind; // METAR, TAF, ATIS, TWIP, NOTAM, PIREP, SIGMET + QString m_summary; // First line, for the table + QString m_text; // The report as sent + QString m_from; // Aircraft that carried it, for provenance +}; + +Q_DECLARE_METATYPE(AtcEvent) +Q_DECLARE_METATYPE(WeatherEvent) + +// Collates aircraft reports from the demodulators into aircraft, flights and +// documents, drives the Map and persists the session, all off the GUI thread. +// Runs on its own thread inside the Aircraft feature, in both GUI and server +// builds; the GUI, when there is one, is a view driven by this class's signals. +// Session and lifetime statistics shown on the Statistics tab. +// +// Every figure is kept twice: once for this session and once for all time. The two +// answer different questions - "is the aerial working as well as it did yesterday" +// wants the session, "how far have we ever heard" wants all time - and neither is +// recoverable from the other, so both are counted as reports arrive. +// +// The all time side persists. Most of it travels in the settings blob, as the records +// always have. The one exception is the aircraft count, which cannot be a running +// total: the same airframe heard on two days must count once, so it needs the set of +// who has been heard, not a number. That set is the database's "seen" table, which is +// also the only part of this that survives the retention period pruning the rest. +struct AircraftStatistics { + // A record holder: the value, who set it, when, and where they were at the time. + // The position is what lets the max range record be drawn on the Map at the point + // it was actually achieved rather than wherever the aircraft is now - which for an + // all time record is very probably nowhere, the aircraft having long since landed. + struct Record { + bool m_valid = false; + float m_value = 0.0f; + QString m_aircraft; // Registration, else flight, else ICAO address + QDateTime m_when; + bool m_positionValid = false; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + bool m_altitudeValid = false; + float m_altitudeFt = 0.0f; + //!< The channel it was heard on, in Hz. Which protocol set the record is already + //!< known - there is a row per protocol - but not which of its frequencies, and + //!< on HFDL and Aero that is the interesting part of the answer. + qint64 m_frequency = 0; + + // Returns true if this beat the record + bool update(float value, const QString& aircraft, const QDateTime& when, + bool positionValid, float latitude, float longitude, + bool altitudeValid, float altitudeFt, qint64 frequency) + { + if (m_valid && (value <= m_value)) { + return false; + } + m_valid = true; + m_value = value; + m_aircraft = aircraft; + m_when = when; + m_positionValid = positionValid; + m_latitude = latitude; + m_longitude = longitude; + m_altitudeValid = altitudeValid; + m_altitudeFt = altitudeFt; + m_frequency = frequency; + return true; + } + }; + + // One complete set of figures, over whatever period the holder covers + struct Scope { + // Furthest heard on each protocol, indexed by AircraftReport::Protocol. Per + // protocol rather than one overall figure because the whole point of comparing + // them is that they are so different - line of sight VHF against HF skywave + // against a satellite. + Record m_maxRange[AircraftReport::ProtocolCount]; + Record m_fastest; // Ground speed, knots + Record m_highest; // Altitude, feet + + quint64 m_totalMessages = 0; // Reports of any kind + quint64 m_messagesByProtocol[AircraftReport::ProtocolCount] = {}; + int m_distinctAircraft = 0; // Different aircraft heard + int m_maxConcurrent = 0; // Most aircraft heard within any 15 minute window + QDateTime m_maxConcurrentWhen; + qint64 m_seconds = 0; // Time spent listening, filled in as it is emitted + + // Applies a report to every record this scope keeps + void update(int protocol, bool rangeValid, float rangeKm, bool speedValid, + float speedKts, bool altitudeValid, float altitudeFt, + const QString& who, const QDateTime& when, + bool positionValid, float latitude, float longitude, + qint64 frequency) + { + m_totalMessages++; + if ((protocol >= 0) && (protocol < AircraftReport::ProtocolCount)) + { + m_messagesByProtocol[protocol]++; + if (rangeValid) { + m_maxRange[protocol].update(rangeKm, who, when, positionValid, + latitude, longitude, altitudeValid, altitudeFt, + frequency); + } + } + if (speedValid) { + m_fastest.update(speedKts, who, when, positionValid, latitude, longitude, + altitudeValid, altitudeFt, frequency); + } + if (altitudeValid) { + m_highest.update(altitudeFt, who, when, positionValid, latitude, longitude, + altitudeValid, altitudeFt, frequency); + } + } + }; + + Scope m_session; + Scope m_allTime; + QDateTime m_sessionStart; + QDateTime m_firstStart; // When the all time figures began + // How much disk the session database is taking, including its write ahead log. + // Measured rather than stored, so it is not part of what is saved or restored. + qint64 m_databaseBytes = 0; + + static const int ConcurrentWindowMins = 15; +}; + +Q_DECLARE_METATYPE(AircraftStatistics) + +class AircraftTracker : public QObject +{ + Q_OBJECT + +public: + //!< Select an aircraft or a flight in the GUI. Sent by the web API, and so by the + //!< Map when one of the links in an aircraft's popup is clicked. + class MsgSelect : public Message { + MESSAGE_CLASS_DECLARATION + public: + enum Kind { Icao, Registration, Flight }; + Kind getKind() const { return m_kind; } + const QString& getValue() const { return m_value; } + static MsgSelect* create(Kind kind, const QString& value) { + return new MsgSelect(kind, value); + } + private: + Kind m_kind; + QString m_value; + MsgSelect(Kind kind, const QString& value) : + Message(), m_kind(kind), m_value(value) + { } + }; + + class MsgConfigureTracker : public Message { + MESSAGE_CLASS_DECLARATION + public: + const AircraftSettings& getSettings() const { return m_settings; } + const QList& getSettingsKeys() const { return m_settingsKeys; } + bool getForce() const { return m_force; } + static MsgConfigureTracker* create(const AircraftSettings& settings, const QList& settingsKeys, bool force) { + return new MsgConfigureTracker(settings, settingsKeys, force); + } + private: + AircraftSettings m_settings; + QList m_settingsKeys; + bool m_force; + MsgConfigureTracker(const AircraftSettings& settings, const QList& settingsKeys, bool force) : + Message(), m_settings(settings), m_settingsKeys(settingsKeys), m_force(force) + {} + }; + + class MsgReport : public Message { + MESSAGE_CLASS_DECLARATION + public: + AircraftReport& getReport() { return m_report; } + static MsgReport* create(const AircraftReport& report) { return new MsgReport(report); } + ~MsgReport(); // Owns m_report.m_mapItem until processing transfers it + private: + AircraftReport m_report; + MsgReport(const AircraftReport& report) : Message(), m_report(report) {} + }; + + // One ACARS block as received, to be archived and fed on + class MsgAcarsBlock : public Message { + MESSAGE_CLASS_DECLARATION + public: + const QByteArray& getBlock() const { return m_block; } + const QDateTime& getDateTime() const { return m_dateTime; } + qint64 getFrequency() const { return m_frequency; } + double getLevel() const { return m_level; } + int getProtocol() const { return m_protocol; } + static MsgAcarsBlock* create(const QByteArray& block, const QDateTime& dateTime, + qint64 frequency, double level, int protocol) + { return new MsgAcarsBlock(block, dateTime, frequency, level, protocol); } + private: + QByteArray m_block; + QDateTime m_dateTime; + qint64 m_frequency; + double m_level; + int m_protocol; + MsgAcarsBlock(const QByteArray& block, const QDateTime& dateTime, qint64 frequency, + double level, int protocol) : + Message(), m_block(block), m_dateTime(dateTime), m_frequency(frequency), + m_level(level), m_protocol(protocol) {} + }; + + class MsgDeleteAll : public Message { + MESSAGE_CLASS_DECLARATION + public: + static MsgDeleteAll* create() { return new MsgDeleteAll(); } + private: + MsgDeleteAll() : Message() {} + }; + + // Zero one half of the statistics. The all time half also clears the record of + // which airframes have been heard, which is the only way its aircraft count can go + // back to nothing + class MsgResetStatistics : public Message { + MESSAGE_CLASS_DECLARATION + public: + bool getAllTime() const { return m_allTime; } + static MsgResetStatistics* create(bool allTime) { return new MsgResetStatistics(allTime); } + private: + bool m_allTime; + MsgResetStatistics(bool allTime) : Message(), m_allTime(allTime) {} + }; + + // GUI (re)connected: resend the complete state + class MsgResync : public Message { + MESSAGE_CLASS_DECLARATION + public: + static MsgResync* create() { return new MsgResync(); } + private: + MsgResync() : Message() {} + }; + + // Which flight's profile the GUI is charting; 0 for none + class MsgWatchFlight : public Message { + MESSAGE_CLASS_DECLARATION + public: + quint64 getFlightId() const { return m_flightId; } + static MsgWatchFlight* create(quint64 flightId) { return new MsgWatchFlight(flightId); } + private: + quint64 m_flightId; + MsgWatchFlight(quint64 flightId) : Message(), m_flightId(flightId) {} + }; + + explicit AircraftTracker(Feature *feature); + ~AircraftTracker(); + + MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } + +public: + // Used by the GUI, which owns persistence: it holds the blob ready for serialize() + static QByteArray serializeStatistics(const AircraftStatistics& statistics); + static AircraftStatistics deserializeStatistics(const QByteArray& data); + +public slots: + void startWork(); + // Invoked from the GUI thread by the coverage button's right click, so it has + // to be a slot to cross to the tracker's own thread + void clearCoverage(); + +public: + //!< A snapshot of what is being tracked, for the web API's report. In a public + //!< section of its own: moc reads everything under "public slots:" as a slot + //!< declaration and rejects a type there. + struct Totals { + int m_aircraft = 0; + int m_activeAircraft = 0; + int m_flights = 0; + quint64 m_messages = 0; + quint64 m_messagesByProtocol[AircraftReport::ProtocolCount] = {}; + }; + //!< Safe to call from any thread: it returns a copy of a snapshot the tracker's own + //!< thread refreshes on every flush, rather than walking the aircraft list, which + //!< that thread is free to change and delete from at any moment + Totals totals() const; + //!< Public because the web API's report names each protocol, and the names belong + //!< with the protocol enum rather than being written out a second time there + static QString protocolName(int protocol); + //!< A protocol and the frequency it was heard on, as "VDL2 136.975". The + //!< frequency is left off when it is unknown, and for ADS-B, where it is always + //!< the same and says nothing + static QString sourceText(int protocol, qint64 frequency); + +signals: + void aircraftUpdated(const QList& aircraft); + //!< Asked to select an aircraft or flight from outside - see MsgSelect + void selectRequested(int kind, const QString& value); + void aircraftRemoved(const QList& ids); + void flightsUpdated(const QList& flights); + void flightsRemoved(const QList& ids); + //!< Two flights turned out to be one - the same flight under its ACARS and its ADS-B + //!< name - and everything that belonged to "from" now belongs to "to". Distinct from + //!< flightsRemoved, which means a flight is genuinely gone: anything the views hold + //!< against the old id has to be re-pointed rather than dropped. + void flightsMerged(quint64 from, quint64 to); + //!< The same for an aircraft absorbed into another: emitted before the aircraftRemoved + //!< for "from", whose flights now belong to "to" with their ids unchanged + void aircraftMerged(quint64 from, quint64 to); + void documentsAdded(const QList& documents); + void atcMessages(const QList& messages); + void weatherReports(const QList& reports); + void profileUpdated(quint64 flightId, const QList& times, const QList& altitudeFt, const QList& speedKts); + void messageRates(const QList& ratesPerProtocolThenTotal); + void statisticsUpdated(const AircraftStatistics& statistics); + void speechNotification(const QString& speech); + void allCleared(); + //!< The database could not be changed, so the setting has been put back to the file + //!< actually in use. The GUI holds the settings that get serialised, so it has to + //!< hear about it or it would keep - and save - a path nothing is writing to. + void databaseFilenameReverted(const QString& filename); + +private: + struct TrackedAircraft; + + struct TrackedDocument { + int m_kind; + QString m_title; + QString m_text; //!< Rendered from the two below when they are set + QDateTime m_received; + //!< What it was rendered FROM, so a later decoder renders it again rather than + //!< the text being frozen as it was first written - see renderDocument(). Empty + //!< for a document libacars or the ATN decoder produced, which cannot be re-run + //!< from here, and whose m_text is therefore what is stored. + QByteArray m_raw; + QString m_source; + }; + + struct TrackedFlight { + quint64 m_id = 0; + QString m_flight; + QStringList m_aliases; + TrackedAircraft *m_aircraft = nullptr; + QDateTime m_firstSeen; + QDateTime m_lastSeen; + QString m_departure; + QString m_arrival; + QString m_route; + //!< When the message that revealed m_departure, m_arrival and m_route was + //!< received, so a delayed one cannot put back what a newer one has replaced. + //!< Invalid where the facts came from the callsign to route database, which is a + //!< standing guess rather than something the aircraft said. + QDateTime m_routeFiled; + //!< Whether m_departure and m_arrival are a guess from the callsign to route + //!< database rather than something an aircraft said. Without it the two are + //!< indistinguishable once stored, and a guess planted first was then defended + //!< against the truth - see updateFlight() and mergeFlightInto(). + //!< Deliberately not persisted: it matters while a flight is being built up, and + //!< adding a column would mean recreating everyone's database to gain nothing on + //!< reload, where the stored airports are simply taken as they are. + //!< Per airport, not per flight: one end can be a database guess while the + //!< other has been stated by a message, and the table colours each on its own + bool m_departureFromDatabase = false; + bool m_arrivalFromDatabase = false; + // A route the aircraft has been given, drawn on the Map. Kept apart from + // m_route because the callsign to route database also fills that in, with the + // airport pair rather than a list of waypoints, and only a real waypoint list + // can be drawn. + struct FiledRoute { + QString m_waypoints; //!< The route as filed, names separated by spaces + //!< Where the message put those waypoints, when it said. Same order and + //!< length as m_waypoints, or empty when it named them without placing them. + QList m_points; + //!< The rest of the plan, each part taken from whichever insert carried + //!< it - see updateFlight(). A clearance leaves them empty. + QString m_runway; + QString m_sid; + QString m_star; + QString m_approach; + QString m_alternate; + //!< What an oceanic clearance cleared it to fly the route at + int m_flightLevel = 0; + float m_mach = 0.0f; + //!< The plan's own airports rather than the flight's, which is what tells a + //!< second insert of the same plan from a re-file to somewhere else + QString m_departure; + QString m_arrival; + QString m_text; //!< The message that filed it, for the popup + QDateTime m_filed; //!< When, so a merge can tell two routes apart + QString m_drawn; //!< What was last sent, so it is only sent once + //!< Held back for want of a Map to send it to or a name to key it on - + //!< neither of which the flight is told about when it changes + bool m_pending = false; + //!< The Map item names last emitted, so that anything which will not be + //!< drawn again can be taken off. The Map keys on the name, so a route that + //!< has been renamed would otherwise be drawn twice over. + QString m_drawnLine; + QStringList m_drawnWaypoints; + }; + FiledRoute m_flightPlan; //!< An FPN plan, or a position report's route insert + FiledRoute m_clearance; //!< An oceanic clearance or its readback + //!< Cache for the flight plan attached to map items for the Map's ND. + //!< Assembling a route is database lookups per fix, so it is rebuilt only when + //!< the signature - what the assembly depends on - changes. Points and coords + //!< are index aligned, resolveRoute() having dropped anything unplaceable. + QString m_ndPlanSignature; + QList m_ndPlanPoints; + QList m_ndPlanCoords; + //!< Protocols and frequencies THIS flight has been heard on, the same tally the + //!< airframe keeps but bounded to one flight. The Map shows this one: an + //!< airframe heard on HFDL over the Atlantic last month is not being heard on + //!< HFDL now, so naming it beside the aircraft on the Map is simply wrong. + QHash, int> m_sources; + QList m_documents; + QList m_profileTimes; + QList m_profileAltFt; + QList m_profileSpeedKts; + // The ground track belongs to the FLIGHT, not to the airframe. An aircraft is + // heard again days later on a different route, and drawing every track it has + // ever flown puts unrelated lines across the map + // How many of the points below are already in the database. The track and the + // profile only ever grow, so a save writes the tail rather than rewriting the + // whole history - see saveDatabase(). Reset to zero, and the flight added to + // m_tracksToRewrite or m_profilesToRewrite, whenever that array is rebuilt rather + // than appended to. + int m_trackSaved = 0; + int m_profileSaved = 0; + //!< Likewise for the documents, which are only ever appended to. Reset to zero, + //!< and the flight added to m_documentsToRewrite, when the list is cut down. + int m_documentsSaved = 0; + //!< Whether the stored track and profile have been read in. A flight created + //!< while running has nothing stored, so both start true; a restored one starts + //!< false. Between them they were nine million rows and eight of the ten seconds + //!< a season's database took to open, for history that is looked at one flight at + //!< a time if at all - see ensureTrackLoaded(). + bool m_trackLoaded = true; + bool m_profileLoaded = true; + QList m_track; + QList m_trackTimes; + int m_messages = 0; // Reports of any kind attributed to this flight + // The OOOI times, as the flight reported them. Out of gate, take off, landing, + // on gate - the four instants that describe a flight from the ground's point of + // view, and the ones an airline's own systems run on. + QDateTime m_out; + QDateTime m_off; + QDateTime m_on; + QDateTime m_in; + // The ground track belongs to the FLIGHT, not to the airframe. An aircraft is + // heard again days later on a different route, and drawing every track it has + // ever flown puts unrelated lines across the map + + ~TrackedFlight() { qDeleteAll(m_documents); } + }; + + // How much a position can be trusted, best first. A VDL-2 XID link management frame + // carries an aircraft location parameter with 0.1 degree resolution - about 11 km - + // which is enough for a ground station to decide a handoff, but drags an ADS-B track + // sideways every time one arrives + enum PositionRank { + PositionAdsb = 0, // ADS-B: metres, about once a second + PositionReported = 1, // A real position report, whatever protocol carried it + PositionCoarse = 2, // A location parameter from a link management frame + PositionRanks = 3 + }; + + static int positionRank(const AircraftReport& report); + + // Altitude is ranked separately from position, and for a different reason. An XID + // location parameter carries an altitude as a single octet of thousands of feet, and + // a minority of aircraft - overwhelmingly Boeing 737NGs - fill it with nonsense: + // 59000, 65000, 90000, 123000 ft have all been observed off air, from aircraft whose + // ADS-B put them at a normal cruise at the same moment. The value is not merely + // coarse, it is sometimes wrong, so it must not set a record and must not displace a + // real altitude. See the note above AcarsVdl2Atn's altitude handling for the + // measurements behind that. + enum AltitudeRank { + AltitudeAdsb = 0, // ADS-B: 25 ft, about once a second + AltitudeReported = 1, // A real position or performance report + AltitudeCoarse = 2, // A link management frame's location parameter + AltitudeRanks = 3 + }; + + static int altitudeRank(const AircraftReport& report); + + // A less accurate source is only used once the better ones have gone quiet for this long + static const int m_positionRankTimeoutSecs = 60; + // How long a flight number may still stand in for an identity. Long enough to cover + // a flight heard intermittently, far short of the same number returning tomorrow. + static const int m_flightKeyValidSecs = 12*60*60; + // Positions that would need a faster aircraft than this to reach are stale or wrong + static const int m_maxGroundSpeedKn = 700; + static constexpr double m_positionToleranceKm = 5.0; + + struct TrackedAircraft { + quint64 m_id = 0; + quint32 m_icao = 0; + QString m_registration; + QString m_flight; + bool m_positionValid = false; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + float m_altitudeFt = 0.0f; + bool m_altitudeValid = false; + // The two most recent altitude observations, so an altitude can be worked out + // for the moment a position was measured rather than assuming they coincide + QDateTime m_altitudeDateTime; + float m_prevAltitudeFt = 0.0f; + QDateTime m_prevAltitudeDateTime; + float m_heading = 0.0f; + bool m_headingValid = false; + float m_speedKts = 0.0f; + bool m_speedValid = false; + //!< When each was observed. Neither is timestamped in its own right - a velocity + //!< message says what the aircraft is doing now, not when - so this is the + //!< report's reception time, which is enough to stop a delayed report putting + //!< back a heading or speed the aircraft has already left behind. + QDateTime m_headingDateTime; + QDateTime m_speedDateTime; + // Great circle distance from the receiver to the aircraft, in km. Measured from + // the position of the DEVICE the report arrived on where it has one - a remote + // SDR reports where it is - and from My Position otherwise, so a distance always + // means "from the antenna that heard it" rather than "from here". + bool m_distanceValid = false; + float m_distanceKm = 0.0f; + QDateTime m_positionDateTime; + QDateTime m_positionRankTimes[PositionRanks]; // When a position of each rank last arrived + int m_positionRank = PositionRanks; // Rank of the position we are holding + QDateTime m_altitudeRankTimes[AltitudeRanks]; // When an altitude of each rank last arrived + QDateTime m_lastSeen; + QString m_departure; + QString m_arrival; + QString m_route; + QString m_lastDocumentText; + //!< The latest datalink ATC message (CPDLC/PDC/oceanic clearance), attached to + //!< map items for the Map's DCDU. The sequence number is what tells the Map a + //!< new message from a re-send of the last one. + struct DcduMessage { + int m_seq = 0; // 0 = never had one + QDateTime m_received; + bool m_uplink = false; + QString m_station; + QString m_text; + } m_dcduMessage; + // Every protocol and frequency this airframe has EVER been heard on, kept for + // as long as the airframe is. The flight has its own, which is what the Map + // shows: an airframe heard on HFDL over the Atlantic last month is not being + // heard on HFDL now, and saying so on the Map is simply wrong. + QHash, int> m_sources; + int m_messages = 0; + QString m_mapName; + QDateTime m_lastMapItemTime; + QString m_model3D; + float m_modelAltitudeOffset = 0.0f; // So the undercarriage is not underground + float m_labelAltitudeOffset = 0.0f; + // Whether we chose the model or the ADS-B pass-through brought one. Only ours may + // be thrown away and chosen again when the livery preference changes - replacing + // a pass-through model with our own would fight the demodulator for it. + bool m_modelIsOurs = false; + bool m_mapTrackChanged = true; + //!< The track has only grown since it was last sent. The ADS-B pass-through sends + //!< it at most every few seconds for that (see forwardMapItem()), where a change + //!< to what was already sent goes at once. + bool m_mapTrackAppended = false; + qint64 m_mapTrackSentMs = 0; + // A fully timestamped ADS-B map item came from CSV replay. Its position is + // deliberately historical, so wall-clock stale-position expiry must not + // remove it before the Map's historical clock can display the flight. + bool m_mapReplay = false; + //!< Owed to a Map that has just appeared, and still owed until something has + //!< actually been sent - see checkMapConsumers() + bool m_mapResync = false; + QList m_flights; + TrackedFlight *m_currentFlight = nullptr; + // Set when a report arrives, cleared when the aircraft goes quiet. Aircraft + // restored from the session database start inactive, so a new session begins + // with empty active tables + bool m_active = false; + QSet m_notifiedRules; + //!< The SELCAL code it was last called on this session. Only ever one the database + //!< assigns it - a call is not attributed otherwise - but where the database gives + //!< it several, this says which is in use. + QString m_selcalHeard; + + ~TrackedAircraft() { qDeleteAll(m_flights); } + }; + + Feature *m_feature; // Pipe source for the Map + AircraftSettings m_settings; + + //!< What totals() hands out - see there + mutable QMutex m_totalsMutex; + Totals m_totals; + void updateTotals(); + MessageQueue m_inputMessageQueue; + + QList m_aircraft; + QHash m_byKey; + quint64 m_nextId = 1; + + QSharedPointer> m_aircraftInfo; + QSharedPointer> m_aircraftInfoByIcao; + QSharedPointer> m_routeInfo; + // Used to turn the named waypoints of a filed route into coordinates. All three are + // process wide caches shared with the Map and the ACARS demodulator, so holding them + // here costs a pointer rather than another copy of the data. + QSharedPointer> m_navAids; + QSharedPointer> m_airports; + QSharedPointer> m_waypoints; + + QList m_atcLog; // Self-contained, outlives its aircraft + QList m_weatherLog; // Likewise, and keyed on airports not aircraft + // Which reports are already in the log, so a repeat is recognised without comparing + // it against every entry ever logged. Maps a hash of the report to its position; the + // full comparison still happens on a hash match, so a collision costs one comparison + // rather than silently dropping a report that was not really a duplicate. The log is + // only ever appended to, so the positions never move. + QMultiHash m_weatherIndex; + + // Batched GUI notifications + QSet m_dirtyAircraft; + QSet m_dirtyFlights; + QList m_pendingDocuments; + QList m_pendingAtc; + QList m_pendingWeather; + QTimer *m_flushTimer = nullptr; + QTimer *m_removalTimer = nullptr; + QTimer *m_chartTimer = nullptr; + // One counter per protocol plus a total + static const int CHART_COUNTS = AircraftReport::ProtocolCount + 1; + int m_chartCounts[CHART_COUNTS]; + QDateTime m_chartRateTime; + + quint64 m_watchedFlight = 0; // Flight whose profile the GUI charts + bool m_watchedFlightChanged = false; + + sqlite3 *m_db = nullptr; + // Flights whose stored track and profile no longer match what is in memory. Deleted + // flights have to be named, because the save no longer empties those tables and so + // would otherwise leave their rows behind for ever. + QSet m_flightsToDelete; + // Separate, because rewriting one must not delete the other's stored rows when only + // one of them was rebuilt - the other may not even be loaded + QSet m_tracksToRewrite; + QSet m_profilesToRewrite; + QSet m_documentsToRewrite; + bool m_dbTrackWipe = false; //!< Everything in track and profile is stale + // The ATC log is written incrementally too, so what changes in it after a message is + // stored has to be carried to the database: the aircraft and flights it belongs to + // when they are merged (from, to), and the messages that go with discarded aircraft + QList> m_atcAircraftMoves; + QList> m_atcFlightMoves; + QSet m_atcAircraftToDelete; + //!< Messages from before m_atcPruneCutoff whose aircraft no longer exists - or never + //!< did, id 0 being an unattributed call - by aircraft id + QSet m_atcPrunedIds; + QDateTime m_atcPruneCutoff; + bool m_dbDirty = false; + bool m_loadingDatabase = false; + + bool handleMessage(const Message& message); + void processReport(AircraftReport& report); + + TrackedAircraft *findOrCreateAircraft(const AircraftReport& report); + void absorbAircraft(TrackedAircraft *item, TrackedAircraft *weak); + TrackedFlight *updateFlight(TrackedAircraft *item, const AircraftReport& report); + void mergeFlightInto(TrackedAircraft *item, TrackedFlight *dst, TrackedFlight *src); + void mergeLoadedFlights(TrackedAircraft *item); + static bool splitFlightName(const QString& flight, QString& airline, QString& number); + static void flightNameForms(const QString& primary, const QStringList& aliases, + QString& callsign, QString& flightNumber); + static bool sameFlightNumber(const QString& a, const QString& b); + static bool flightMatches(const TrackedFlight *flight, const QString& name); + //!< When this aircraft was last heard flying this callsign, which is not when it was + //!< last heard: it is very likely flying something else by now + static QDateTime flightLastSeen(const TrackedAircraft *item, const QString& flight); + //!< Whether two of one airframe's flights are one operation rather than the same + //!< callsign flown again on another day + bool sameOperation(const TrackedFlight *a, const TrackedFlight *b) const; + void addFlightAlias(TrackedAircraft *item, TrackedFlight *flight, const QString& name); + void addDocument(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report); + void addAtcMessage(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report); + //!< Returns false when the call could not be pinned on one aircraft, having logged it + bool attributeSelcal(AircraftReport& report); + //!< item and flight are null for a call that was not attributed; candidates are then + //!< the registrations the database gives the code + void logSelcalCall(TrackedAircraft *item, TrackedFlight *flight, const AircraftReport& report, + const QStringList& candidates); + //!< The SELCAL codes assigned to each registration, for the table's SELCAL column. + //!< Refreshed with the other databases rather than per row: looking it up checks the + //!< file for a newer download. + QSharedPointer> m_selcalCodes; + void addWeatherReport(TrackedAircraft *item, const AircraftReport& report); + static QString weatherKindName(int kind); + QString documentKindName(int kind) const; + static QString notificationSignature(const AircraftSettings& settings); + void claimKey(TrackedAircraft *item, const QString& key); + void updateRecordMapItem(); + static const char *RecordMapItemName; + //!< The Map settings group a filed route is drawn under, instead of this feature's + //!< own. A route wants the opposite of what an aircraft wants from a minimum zoom - + //!< an icon has to be decluttered away when zoomed out, while a route drawn across + //!< an ocean is exactly what should still be visible there. + static const char *RouteMapGroup; + static const char *CoverageMapGroup; + //!< Aggregator feed. One set of connections for the whole station, however many + //!< ACARS demodulators are running - which is why this lives here and not in them. + QUdpSocket *m_feedSocket = nullptr; + QTcpSocket *m_feedAirframesTcpSocket = nullptr; + QTcpSocket *m_feedAvdelphiTcpSocket = nullptr; + QHostAddress m_feedAirframesAddr; //!< Cached DNS resolutions, for UDP + QString m_feedAirframesResolvedHost; + QHostAddress m_feedAvdelphiAddr; + QString m_feedAvdelphiResolvedHost; + QHash m_feedResolveRetry; //!< When a host that would not resolve is tried again + //!< ACARS blocks heard since the last save, exactly as received, waiting to be written + //!< to the archive. Raw so that a later decoder can be run over the whole archive - + //!< see MainCore::MsgAcarsBlock. Emptied by each save; the archive lives on disk only. + struct AcarsBlockRecord { + QByteArray m_block; + QDateTime m_dateTime; + qint64 m_frequency = 0; + double m_level = 0.0; + int m_protocol = 0; + }; + QList m_acarsBlocks; + static QGeoCoordinate routeAnchor(const QStringList& names); + static QString altitudeConstraint(const AircraftReport::RouteWaypoint& point); + static QList procedurePoints(const QString& procedure, + const QString& airport, + const QString& procedureType); + void resolveRoute(QList& points, + QList& coords) const; + QList assembleRoutePoints(const TrackedFlight *flight, + const TrackedFlight::FiledRoute& route, + QList& coords) const; + SWGSDRangel::SWGMapFlightPlan *buildFlightPlan(TrackedAircraft *item) const; + void recordDcduMessage(TrackedAircraft *item, const AircraftReport& report); + SWGSDRangel::SWGMapDatalinkMessage *buildDatalinkMessage(const TrackedAircraft *item) const; + void sendRouteToMap(TrackedFlight *flight, TrackedFlight::FiledRoute& route, + const QString& kind); + void removeDrawnRoute(TrackedFlight::FiledRoute& route); + bool routeDrawn(const TrackedFlight *flight) const; + int routePlaceable(const QString& waypoints, + const QList& given) const; + void sendRoutes(TrackedFlight *flight); + void removeRoutes(TrackedFlight *flight); + + // What updateRecordMapItem() last put on the Map, so an unchanged record is not + // re-sent 3 times a second, and so it can be taken off again when the option is + // turned off or the record is reset + //!< The Map item name and contents of the watched flight's track, drawn on its own + //!< when the aircraft itself is not on the Map - see updateWatchedTrack() + QString m_watchedTrackName; + QString m_watchedTrackKey; + void updateWatchedTrack(); + + QString m_recordMapKey; + bool m_recordOnMap = false; + //!< Which of the reasons the record marker is or is not on the Map has been + //!< reported. Said once each rather than several times a second, and reset when the + //!< situation changes, so the log explains a missing marker without filling up. + enum RecordMapState { RecordUnreported, RecordDrawn, RecordNone, RecordUnplaceable }; + int m_recordMapState = RecordUnreported; + + // Flights with a route that could not be delivered. Held by id rather than by + // pointer, so a flight deleted or merged away in the meantime simply fails to + // resolve rather than leaving this dangling. + QSet m_routesPending; + void retryRoutes(); + + // WHICH Map features were listening last time anything was sent, by pipe id rather + // than by count: closing one Map and opening another between flushes leaves the count + // where it was, and the replacement would never be caught up. Delivery is remembered + // per item rather than per Map - what has been drawn, what track was last sent - so a + // Map opened after the fact is given later positions but none of what went out before + // it existed. Saying it all again to everyone is the cheap answer; per consumer state + // would be the thorough one. + QSet m_mapConsumers; + // Aircraft owed to a Map that has just opened but not sendable yet: a basic item + // would replace a richer pass-through one for a minute after the last of those + // arrived. Kept here rather than in m_dirtyAircraft, which flush() empties every + // pass and which drives a GUI update for everything in it. + QSet m_mapResyncPending; + void checkMapConsumers(); + + // Statistics + void updateStatistics(const AircraftReport& report, TrackedAircraft *item, + bool rangeValid, float rangeKm, + bool altitudeValid, float altitudeFt); + + void updateConcurrent(const QDateTime& now); + void updateDatabaseSize(); + static QString renderDocument(const QByteArray& raw, const QString& source); + void acarsBlockReceived(const QByteArray& block, const QDateTime& dateTime, + qint64 frequency, double level, int protocol); + void feedMessage(const AcarsMessage& message, const QDateTime& dateTime, + qint64 frequency, double level); + void updateFeedConnections(); + QGeoCoordinate receiverPosition(int deviceSetIndex); + void update3DModel(TrackedAircraft *item); + + AircraftStatistics m_statistics; + bool m_statisticsDirty = false; + bool m_statisticsLoaded = false; + // Seconds carried in from previous sessions, so the all time clock can be reported + // as a live total rather than only advancing when the app is restarted + qint64 m_allTimeSecondsBase = 0; + // What m_allTimeSecondsBase is measured from. Normally the start of the session, but + // an all time reset moves it to the moment of the reset - otherwise the all time + // clock would restart at however long this session had already been running + QDateTime m_allTimeSince; + // Aircraft heard this session. The tracked list is restored from the database at + // startup, so "a TrackedAircraft was allocated" counts only aircraft that fell out + // of the retention period - which under-reported the session badly + QSet m_sessionHeard; + // Those of them already written to the all time table. Separate from the above + // because an aircraft can be heard before it is identified - an ACARS report can + // arrive with only a flight number and gain its registration later - and it must be + // counted under the identity it will keep, not the first one it happened to show + QSet m_sessionRecorded; + // Drives a statistics update once a minute so both elapsed clocks tick even when + // nothing is being received + qint64 m_statisticsMinute = -1; + // Receiver positions, cached by device set index: getDevicePosition() builds a whole + // device report and parses it as JSON, which is far too heavy to do per message + QHash m_devicePositions; + QDateTime m_devicePositionsRefreshed; + // Taking the tally rather than its owner, because both the airframe and the + // flight it is on keep one + QStringList sourcesList(const QHash, int>& sources) const; + QString sourcesText(const QHash, int>& sources) const; + QString mapItemName(const TrackedAircraft *item) const; + QString flightLabel(const QString& flight) const; + QString atcLabel(const TrackedAircraft *item) const; + QString aircraftImage(const TrackedAircraft *item) const; + //!< The same choice for an aircraft that is no longer tracked - all the record + //!< marker has is the name and, where the airframe is still known, its 3D model + QString aircraftImage(const QString& registration, const QString& model3D) const; + QList *buildTrack(const TrackedFlight *flight) const; + QDateTime mapAvailableUntil(const TrackedAircraft *item) const; + int positionTimeoutSecs(const TrackedAircraft *item) const; + bool positionStale(const TrackedAircraft *item, const QDateTime& now) const; + static float altitudeAt(const TrackedAircraft *item, const QDateTime& when, float fallbackFt); + // Which of an aircraft's flights the map should draw the track of - the one it is + // flying now, unless the GUI is looking at one of its past flights + const TrackedFlight *trackFlight(const TrackedAircraft *item) const; + //!< trackFlight() and then ensureTrackLoaded() on it, for the two places that draw + TrackedFlight *trackFlightLoaded(TrackedAircraft *item); + void sendToMap(TrackedAircraft *item); + void forwardMapItem(TrackedAircraft *item, SWGSDRangel::SWGMapItem *swgMapItem); + + void removeFromMap(const QString& name); + void checkNotifications(TrackedAircraft *item, const AircraftReport& report); + QString subAircraftString(TrackedAircraft *item, const AircraftReport& report, const QString& string) const; + void commandNotification(TrackedAircraft *item, const AircraftReport& report, const QString& command); + void deleteAll(); + void resync(); + void applySettings(const AircraftSettings& settings, const QList& settingsKeys, bool force); + AircraftDisplay displayFor(const TrackedAircraft *item) const; + FlightDisplay displayFor(const TrackedFlight *flight) const; + DocumentEvent documentEvent(const TrackedAircraft *item, const TrackedFlight *flight, const TrackedDocument *doc) const; + void emitProfile(const TrackedFlight *flight); + TrackedFlight *flightById(quint64 id) const; + QString regFor(const TrackedAircraft *item) const; + + // Implemented in aircraftdb.cpp + bool openDatabase(); + // Remembers that this airframe has been heard at all, for the all time aircraft + // count. Returns 1 if it had not been heard before, 0 if it had, and -1 if it cannot + // be identified yet - in which case the caller should try again on the next report + //!< Writes this airframe into the all time "seen" table, folding away a row left + //!< under an identity it has since outgrown. Returns 1 when the table was written, + //!< -1 when it could not be and the caller should ask again, and sets countDelta to + //!< the change in the number of distinct airframes the table holds: +1 for one not + //!< seen before, -1 where two rows turned out to be one airframe, 0 otherwise. + int recordSeen(TrackedAircraft *item, int& countDelta); + int seenCount(); + void resetSeen(); + void closeDatabase(); + //!< Returns false when nothing was written - the transaction rolled back, or there + //!< is no database. The session is then still only in memory, which is what makes it + //!< unsafe to switch databases: see changeDatabase(). + bool saveDatabase(); + //!< The all time records and counters, which live with the session they were measured + //!< from rather than in the preset. saveStatistics() runs inside saveDatabase()'s + //!< transaction; loadStatistics() returns false when there are none stored, which is + //!< what makes the one time import from an older preset happen. + bool saveStatistics(); + bool loadStatistics(); + //!< The coverage polygons, kept in their own table so that adding them did not mean + //!< recreating everyone's database - see loadCoverage() + bool saveCoverage(); + bool loadCoverage(); + + //!< How far out each protocol has ever heard an aircraft, in each direction. The + //!< ADS-B demodulator draws the same thing for itself; here there is one per + //!< protocol, in its own colour, so their ranges can be compared - HFDL and Aero + //!< reach thousands of miles where VHF is line of sight, and seeing that on one map + //!< is the point. + //!< + //!< Bins of 5 degrees, as the ADS-B one uses. The range is kept rather than the + //!< polygon: the polygon is derived, and a bin is a scalar that survives a change of + //!< receiver position. + static const int m_coverageBinDeg = 5; + static const int m_coverageBins = 360 / m_coverageBinDeg; + QVector m_coverageRangeKm[AircraftReport::ProtocolCount]; + //!< Where the receiver was when the bins were filled. Per protocol, because they can + //!< be different receivers - an HFDL dongle and an ADS-B one are not always in the + //!< same place, and a polygon drawn from the wrong centre is worse than none. + QGeoCoordinate m_coverageOrigin[AircraftReport::ProtocolCount]; + bool m_coverageDirty[AircraftReport::ProtocolCount] = {}; + //!< What is currently on the Map for each protocol. A list, because coverage is + //!< drawn as one shape per run of adjacent measured bearings and the number of + //!< them changes as the gaps fill in - so what to remove has to be remembered + //!< rather than derived. + QStringList m_coverageDrawnNames[AircraftReport::ProtocolCount]; + bool m_coverageLoaded = false; + //!< Set when a bin grows or the user clears, so the next database save writes + //!< the table and an idle session does not + bool m_coverageChanged = false; + void updateCoverage(int protocol, const QGeoCoordinate& receiver, float azimuthDeg, + float rangeKm); + void sendCoverageToMap(int protocol); + void sendCoverageToMap(); + void removeCoverageFromMap(); + static QRgb coverageColor(int protocol); + //!< Read a restored flight's track or profile in, if that has not happened already. + //!< Idempotent, so callers need not know which flights are which. MUST be called + //!< before appending to either: until the stored points are in memory, m_trackSaved + //!< counts rows the list does not yet hold, and the save would append nothing. + void ensureTrackLoaded(TrackedFlight *flight); + void ensureProfileLoaded(TrackedFlight *flight); + void ensureAllHistoryLoaded(); + void revertDatabaseFilename(const QString& path); + // The stored track and profile no longer relate to what is in memory at all + void forgetSavedHistory(); + bool saveMessageChanges(); + void forgetPendingChanges(); + void forgetAllTimeFigures(); + bool moveMessages(bool aircraftId, quint64 from, quint64 to); + void loadDatabase(); + +public: + // Where the session database lives, given the settings - which is not simply the + // filename, since an empty one means the default under AppData. Public because the + // GUI names the file beside the database size it reports. + static QString databasePath(const AircraftSettings& settings); + int tableCount(const char *table); + // Set by deleteAll(), so that emptying the documents and ATC tables is something the + // user asked for rather than something saveDatabase() has to infer from memory being + // empty - which is exactly the state it must not act on. Cleared after the commit. + bool m_dbMessageWipe = false; + // Set when what is stored no longer relates to what is held, so the documents and ATC + // tables are emptied and everything in memory written again. Unlike m_dbMessageWipe, + // the ACARS archive is left alone: it is not held in memory to be written back. + bool m_dbMessageRewrite = false; + +private slots: + void handleInputMessages(); + void flush(); + void removeOldAircraft(); + void setActive(TrackedAircraft *item, bool active); + void discardOldAircraft(); + void changeDatabase(const QString& oldPath); + void updateChartCounts(); +}; + +#endif // INCLUDE_FEATURE_AIRCRAFTTRACKER_H_ diff --git a/plugins/feature/aircraft/aircraftwebapiadapter.cpp b/plugins/feature/aircraft/aircraftwebapiadapter.cpp index e7e640bf1..965265bb0 100644 --- a/plugins/feature/aircraft/aircraftwebapiadapter.cpp +++ b/plugins/feature/aircraft/aircraftwebapiadapter.cpp @@ -16,6 +16,9 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include "SWGFeatureSettings.h" +#include "SWGAircraftSettings.h" +#include "aircraft.h" #include "aircraftwebapiadapter.h" AircraftWebAPIAdapter::AircraftWebAPIAdapter() @@ -30,9 +33,11 @@ int AircraftWebAPIAdapter::webapiSettingsGet( SWGSDRangel::SWGFeatureSettings& response, QString& errorMessage) { - (void) response; - errorMessage = "Not implemented"; - return 501; + (void) errorMessage; + response.setAircraftSettings(new SWGSDRangel::SWGAircraftSettings()); + response.getAircraftSettings()->init(); + Aircraft::webapiFormatFeatureSettings(response, m_settings); + return 200; } int AircraftWebAPIAdapter::webapiSettingsPutPatch( @@ -41,9 +46,8 @@ int AircraftWebAPIAdapter::webapiSettingsPutPatch( SWGSDRangel::SWGFeatureSettings& response, QString& errorMessage) { - (void) force; - (void) featureSettingsKeys; - (void) response; - errorMessage = "Not implemented"; - return 501; + (void) force; // Nothing to apply it to: this adapter holds settings, not a feature + (void) errorMessage; + Aircraft::webapiUpdateFeatureSettings(m_settings, featureSettingsKeys, response); + return 200; } diff --git a/plugins/feature/aircraft/aircraftwebapiadapter.h b/plugins/feature/aircraft/aircraftwebapiadapter.h index a80181f84..5125427de 100644 --- a/plugins/feature/aircraft/aircraftwebapiadapter.h +++ b/plugins/feature/aircraft/aircraftwebapiadapter.h @@ -22,9 +22,9 @@ #include "feature/featurewebapiadapter.h" #include "aircraftsettings.h" -// Standalone API adapter only for the settings. WebAPI settings access needs a -// generated SWGAircraftSettings class, which does not exist yet - until then the -// settings blob round-trips but the REST settings endpoints report unimplemented. +// Standalone API adapter for the settings of a feature that is not instantiated - the +// preset editor's view of them. The formatting is Aircraft's own, so the two cannot +// describe the same settings differently. class AircraftWebAPIAdapter : public FeatureWebAPIAdapter { public: AircraftWebAPIAdapter(); diff --git a/plugins/feature/aircraft/icons/coverage.png b/plugins/feature/aircraft/icons/coverage.png new file mode 100644 index 000000000..4a51fe4a2 Binary files /dev/null and b/plugins/feature/aircraft/icons/coverage.png differ diff --git a/plugins/feature/aircraft/readme.md b/plugins/feature/aircraft/readme.md index 5fc39f425..663466615 100644 --- a/plugins/feature/aircraft/readme.md +++ b/plugins/feature/aircraft/readme.md @@ -5,9 +5,10 @@ The Aircraft feature collates aircraft data from multiple demodulators into a single aircraft list, and sends the combined aircraft to the [Map feature](../map/readme.md). -Sightings are received from the [ADS-B demodulator](../../channelrx/demodadsb/readme.md) -and the [ACARS demodulator](../../channelrx/demodacars/readme.md) (VHF ACARS, VDL Mode 2 -HFDL and Aero modes), from any number of channels in any device set. +Sightings are received from the [ADS-B demodulator](../../channelrx/demodadsb/readme.md), +the [ACARS demodulator](../../channelrx/demodacars/readme.md) (VHF ACARS, VDL Mode 2 +HFDL and Aero modes) and the [SELCAL demodulator](../../channelrx/demodselcal/readme.md), +from any number of channels in any device set. Combining protocols matters because each sees a different slice of a flight: ADS-B gives continuous positions in VHF range, VDL-2 sees logons and CPDLC near airports, and HFDL/Aero @@ -34,49 +35,89 @@ The upper half of the window holds the traffic: under Interface below * **Old Aircraft** - airframes that have gone quiet for longer than the archive timeout. They are not forgotten, only no longer current, and they come off the Map + +![Aircraft Table](../../../doc/img/AircraftFeature_aircraft_table.png) + * **Flights** - the flights seen this session, current and past: flight number, aircraft, departure and arrival, the four OOOI times, when it was first and last heard, which documents it has produced, and which protocols heard it * **Old Flights** - flights that have finished, and those restored from the last session + +![Flights Table](../../../doc/img/AircraftFeature_flights_table.png) + * **Weather** - METARs, TAFs, D-ATIS, TWIPs, NOTAMs, PIREPs and SIGMETs carried by ACARS. They arrive through whichever aircraft asked for them but describe an **airport**, not that aircraft, so they are kept for the session rather than against a flight. Selecting - a row shows the full report + a row shows the full report. + + The aircraft's half of the exchange is not listed. A request names the airports it + wants and the report type - `EGKK LFPO LFBD LFBO-SA` - and says nothing about the + weather, so only uplinks are kept where a message is recognised by its label alone. + A body that actually contains a METAR, TAF, SIGMET or PIREP is kept whichever way it + was going, since a PIREP is a downlink by definition The lower half describes whatever is selected above: -* **Aircraft** - the photograph and the airframe's details. See Photo below -* **Documents** - flight plans, oceanic clearances, loadsheets, logons and OOOI events, - collected against the flight they belong to. Selecting one displays its full text - below the table. The log is kept even after the aircraft it came from has been - removed. Plain ACARS messages are not collected. CPDLC messages go to the ATC tab instead -* **ATC** - CPDLC (controller-pilot data link) messages across all channels, with the - protocol, direction (uplink from ATC, downlink from the aircraft), source and - recipient where known, and the concise message text (e.g. "WILCO") -* **Past Flights** - every flight the selected **aircraft** has operated. Shown only - while an aircraft is selected. Selecting one of its rows charts that flight's profile - and draws its track -* **Past Aircraft** - every airframe that has operated the selected **flight number**. - Shown only while a flight is selected -* **Flight Profile** - see below - -Selecting an aircraft or a flight filters the Documents and ATC tables to it. -Route information comes from messages - flight plans, OOOI events, oceanic -clearances - or, where none has revealed it, from the callsign-to-route database. - -

Flight profile

+

Aircraft

+ +Shows a photograph of the selected +aircraft from [planespotters.net](https://www.planespotters.net/) headed by its +registration and the country flag, with the airline's logo beneath it and a table of what +the aircraft database knows about the airframe beside it. Clicking the photograph opens it +on planespotters.net + +![Aircraft Tab](../../../doc/img/AircraftFeature_aircraft_tab.png) + +

Documents

+ +Flight plans, oceanic clearances, loadsheets, logons and OOOI events, +collected against the flight number. Selecting one displays its full text +below the table. Plain ACARS messages are not collected. + +![Flight plan](../../../doc/img/AircraftFeature_flight_plan.png) + +![Loadsheet](../../../doc/img/AircraftFeature_loadsheet.png) + +![Clearance](../../../doc/img/AircraftFeature_clearance.png) + +

ATC

+ +CPDLC (controller-pilot data link) messages across all channels, with the +protocol, direction (uplink from ATC, downlink from the aircraft), source and +recipient where known, and the concise message text (e.g. "WILCO"). SELCAL calls are +listed here too, with the frequency they were heard on as the source - see +[SELCAL](#selcal) below. With nothing selected, the table shows the SELCAL calls that +could not be attributed to an aircraft + +

Past Aircraft

+ +Every airframe that has operated the selected **flight number**. +Shown only while a flight is selected. + +

Past Flights

+ +Every flight the selected **aircraft** has operated. +Shown only while an aircraft is selected. +Selecting one of its rows charts that flight's profile and draws its track. + +

Flight profile

The Flight Profile tab charts the selected flight's altitude (left axis) and speed (right axis) against time, showing the flight profile - climb, cruise and descent - built -from all protocols and kept with the flight in the session database. +from all protocols. -

Photo

+![Flight Profile Tab](../../../doc/img/AircraftFeature_flight_profile.png) -The first of the message tabs, titled Aircraft, shows a photograph of the selected -aircraft from [planespotters.net](https://www.planespotters.net/) headed by its -registration and the country flag, with the airline's logo beneath it and a table of what -the OpenSky database knows about the airframe beside it. Clicking the photograph opens it -on planespotters.net +

SELCAL

+ +A SELCAL call is a ground station calling an aircraft on an HF or VHF voice channel. It +carries only a code, and a code can be shared by several aircraft. + +An attributed call counts as a message from the aircraft: it adds "SELCAL" and the +frequency to the aircraft's protocols and updates when it was last seen. It carries no +position, so nothing moves on the Map. Every call, attributed or not, is listed in the ATC +tab. A call never creates an aircraft, and calls the feature cannot attribute are listed +against no aircraft.

Chart

@@ -107,8 +148,7 @@ who set it and when. quiet today shows its reduced share against its long run one rather than against nothing * **Listening time** and **Messages per minute** -Ranges depend on the receiver position being right: see the Dist (km) column below for -where that comes from. +![Statistics](../../../doc/img/AircraftFeature_statistics.png)

Settings

@@ -170,14 +210,33 @@ per aircraft. The collated aircraft, flights, documents and ATC log are saved to a SQLite database (aircraft.db in the application data directory) every minute and on exit, and restored -when the feature is next opened. On restore, aircraft that have not been heard within +when the feature is next opened. + +Tracks and flight profiles are **not** read at startup - only how many points each flight +has, which is what lets the save go on appending to them. The points themselves are +fetched a flight at a time, when something wants to draw or chart one. On a season's +worth of history that is nine million rows not read, and about nine seconds off the time +the feature takes to open. The first time an existing database is opened after this +change it builds two indexes, which takes a couple of seconds and grows the file by about +a fifth; after that it is a no-op. On restore, aircraft that have not been heard within the removal timeout are pruned, while the document and ATC logs are restored in full; restored aircraft with positions reappear on the Map with their full tracks. -The all time figures are kept in the preset rather than in that database, because they -are a property of the receiving setup rather than of the traffic. - -The one exception is the all time aircraft count, which cannot be a running total: the +The all time figures are kept in that database too, and belong to it: a range is measured +from a particular antenna, so keeping a database per site gives that site its own records. +Like the aircraft count below they are never touched by clearing the aircraft or by the +retention period - they outlive the traffic they were measured from. + +They used to be kept in the preset instead, on the grounds that they describe the +receiving setup rather than the traffic. That was the wrong home: the database *is* the +per setup file, a preset gets copied to other machines where the ranges no longer mean +anything, and it left the records in one place and the airframe count that belongs beside +them in the other - so switching databases gave one database's count with another's +records. A preset written before the move still carries them, and they are imported into +the database once, the first time one is opened that has none of its own. + +The all time aircraft count is kept differently from the rest, because it cannot be a +running total: the same airframe heard on two days has to count once, so it needs the set of which airframes have been heard rather than a number. That set is a table in the database, and it is the only thing there that is never pruned - so the count keeps growing after the @@ -208,13 +267,12 @@ Right clicking a cell in any of the tables offers, as they apply to that cell: Aircraft with a position are sent to the Map feature, named by registration when known. -When an Aircraft feature is present, the ADS-B and ACARS demodulators stop sending -aircraft to the Map themselves - this feature is the single source, so each aircraft -appears once, with data combined from every demodulator that hears it. ADS-B sightings +When an Aircraft feature is present, the ADS-B demodulator stops sending +aircraft to the Map themselves. ADS-B sightings pass through the demodulator's fully-built map item, so the 3D model, animations and the complete aircraft state driving the Map's PFD display are preserved, with the combined track and route information added. Without an Aircraft feature, the -demodulators send to the Map directly, as before. +ADS-B demodulator sends to the Map directly. The map item carries: @@ -222,24 +280,115 @@ The map item carries: * The full track accumulated across all protocols - the whole history survives coverage gaps, so a flight tracked on ADS-B and picked up again hours later on HFDL shows one continuous track, +* A popup whose ICAO address, registration and flight number are **links**: clicking one + selects that aircraft or flight in this feature, which is usually the next question + someone looking at the Map has. They work on both the 2D and the 3D map, and appear + only where they can lead somewhere - an aircraft drawn by the ADS-B demodulator with no + Aircraft feature open gets plain text instead of a link that would do nothing, * A popup headed by a side view of the type in the operator's livery and the country flag, followed by registration, flight, aircraft type, departure/arrival airports and the route where messages have revealed them, and the protocols and frequencies the **current flight** has been heard on. -The routes an aircraft has been given are drawn too - a filed flight plan and an oceanic -clearance alike - as a line through the waypoints with a marker at each one. A flight +The routes an aircraft has been given are drawn too, but only for the aircraft or flight +**selected** in the tables - a filed flight plan and an oceanic clearance alike - as a +line through the waypoints with a marker at each one. Every oceanic flight in earshot +files a clearance, so drawing them all covered the Map in lines that had nothing to do +with what you were looking at. Selecting an aircraft draws the flight it is on now. A +flight plan comes from an FPN message or a position report's route insert; a clearance from an oceanic clearance or its readback. Both are bookended with the departure and arrival airports so the line starts and finishes somewhere recognisable, and the route's popup carries the message that filed it, which is where the clearance number, entry time, flight level and Mach are. +Routes are drawn in the Map's **Aircraft Routes** item group rather than the Aircraft one, +so that their colour, labels and above all their minimum zoom can be set independently of +the aircraft icons. An icon has to be decluttered away when the map is zoomed out, where a +route drawn across an ocean is exactly what you want to see at that zoom - one setting +could not do both. The group defaults to a minimum zoom of 0, so routes stay visible +however far out the map is zoomed. + +**A flight plan is assembled from the inserts that carry it.** An aircraft files the +departure end - runway, SID and the en route path - in one message and the arrival end - +STAR and approach - in another, so each part is taken from whichever message carried it +and the popup shows the whole plan in the order it is flown. The path is only replaced by +a message that has one, and only when it names at least as many waypoints that can be +placed - otherwise the insert carrying nothing but "ILS 19L" would erase the line drawn +from the one before it. An insert naming a different departure or arrival is a re-file +rather than another part, and replaces the plan outright. + +**A named SID or STAR is expanded into the fixes it flies through.** A plan names its +departure and arrival procedures rather than listing them - "runway 26L, LAM1Z departure" - +so the line used to leave the airport straight for the first en route fix, which is not +where the aircraft goes: a SID out of Gatwick turns through half a dozen fixes before it +joins the airway. Where the SID/STAR database holds the procedure, its fixes are drawn +between the aerodrome and the route, in the order they are flown. The procedure is looked +up against the plan's own departure or arrival airport, by ICAO code, and its type is +given as well as its name - the same name can be a departure at one airport and an +arrival at another, as LAM1Z is a SID at Gatwick and a STAR at Heathrow. A runway +qualifier is ignored, so LAM1Z and LAM1Z/26L both find it. + +A procedure fix names its procedure on the Map, and is drawn at the altitude the +procedure requires. A fix is named for the procedure it belongs to - KKE02, KKN43 - so on +its own it is an unexplained marker in the middle of nowhere; its popup now gives the SID +or STAR it came from. Where the procedure constrains the altitude, that is shown as the +plate reads it - "5000 ft" for a crossing altitude, "2000 ft or above" for a floor, +"5000 to 7000 ft" for a window - and the fix is drawn at that altitude rather than on the +ground, so a departure climbs on the 3D map instead of lying flat. + +The database gives every procedure fix a position, so they are never looked up by name - +which matters, because a procedure fix is named for its procedure (KKE02, KKN43) and is in +no en route waypoint database. A procedure usually ends on a fix the plan then names as +its first waypoint, and the two are collapsed into one. Coverage is partial: where the +procedure is not held, or the database has not been downloaded, the route is drawn exactly +as it was before. + +**A plan files a shorter name than the database holds, and both are matched.** An ARINC +424 procedure identifier is the significant fix, a validity digit and a route letter, and +it is limited to six characters - so a five letter fix is truncated to four and a plan +files ROXO1H where the procedure is really ROXOG1H. Both forms find it. The shortened +names are indexed only where they are unambiguous, which is checked rather than assumed: +an alias that shadowed a real procedure would draw the wrong route rather than none, which +is a worse failure than the one it fixes. On the current database all 1475 are +unambiguous. + +**A plan is assembled from any insert that carries part of it, not only one that carries +a path.** The arrival end of a plan names no waypoints at all - just the STAR and the +approach - so an insert carrying the STAR was being dropped whole, and the STAR never +reached the plan being assembled. That is the usual way a STAR arrives, so without this +most of them were never captured at all. A plan that has no path of its own is still +drawn when a procedure can be expanded into one. + +Plans stored before the runway, SID, STAR, approach and alternate were kept have those +parts recovered from the message that filed it, which is held with the plan. The text is +this application's own rendering, one "Label: value" a line, so it reads back reliably; +only a part that is empty is filled, so nothing a message actually filed is overwritten. +Once the flight is saved again the parts are stored properly. + +The database is downloaded from the **Map** feature's settings dialog, alongside the +airport, airspace, NAVAID and waypoint databases, and is picked up on the next route drawn +without needing a restart. It is a snapshot of one AIRAC cycle, and a procedure's name +carries its revision - a plan filing FRAN1M does not match a database holding FRANE1Z, +which is a different revision of the same departure, and nothing is drawn rather than a +route the aircraft is not flying. + Each name is resolved against the airport, waypoint and navaid databases - four -characters is an airport, five a waypoint, three a VOR or NDB ident, and seven an oceanic -position such as 5530N - and any that cannot be resolved is dropped. A route is drawn -once, when it is filed, and is left on the Map after the flight is archived: it is a -record of where the aircraft was going. +characters is an airport, five a waypoint, three a VOR or NDB ident, and anything of the +form 58N030W an oceanic position, with the minutes optional on either half so that +5730N020W and 5730N02030W are read too - and any that cannot be resolved is dropped. +Where the message gave a waypoint's position itself, that is used in preference, which is +what places the fixes no database holds. Selecting another +aircraft or flight moves the lines to it; they are kept for an archived flight, so +selecting one still shows where the aircraft was going. + +Selecting one of an aircraft's past flights draws that flight's track instead of the one +it is on now. Where the aircraft is still being heard the track is part of its own map +item; where it has been archived the aircraft is no longer on the Map at all, so the track +is drawn on its own, as a line named after the flight. Its popup gives the route, when the +flight was heard and how many points it has. The aircraft itself is deliberately not put +back: an icon at a position from hours ago would say it is still there, which a track of +where it went does not. Stale positions from stored performance log dumps (seen with HFDL) are ignored: a position timestamped well before the newest known position for that aircraft does not @@ -295,8 +444,11 @@ The table shows one row per aircraft: * ICAO - 24-bit ICAO address, when known * Reg - Aircraft registration -* Type - Aircraft type (ICAO type designator) from the OpenSky database -* Flight - Most recent flight number / callsign +* Type - Aircraft type (ICAO type designator) from the aircraft database +* Callsign, Flight No - The flight the airframe is on now, under its ICAO and IATA + names, as in the Flights table below. The two names belong to the FLIGHT, so an + airframe not currently on one shows the name it was last heard under as its callsign + and nothing as its number * Airline - Airline logo, or operator name when no logo is available * Sideview - Aircraft silhouette, coloured per airline where available * Country - Flag of the country of registration @@ -317,13 +469,23 @@ The table shows one row per aircraft: aircraft on the Map would be wrong. * Msgs - Number of messages received * Last seen - Time of the last report +* SELCAL - The aircraft's SELCAL code: the one it was heard called on, otherwise what the + SELCAL database assigns it, which can be more than one. The database is downloaded + from the SELCAL demodulator

Flights table

The table shows one row per flight, and the Old Flights table the same columns for flights that have finished: -* Flight - Flight number / callsign +* Callsign - The ICAO form, as the transponder broadcasts it (e.g. TOM7BD). Where the + flight has only ever been heard under its IATA number, that is shown here instead, so + the column always says what the aircraft is being called +* Flight No - The IATA form, as ACARS carries it (e.g. BY07BD). The two are the same + flight: an airline has a three letter ICAO designator and a two character IATA one, so + TUI Airways is TOM and BY, and 7BD is 07BD without the leading zero. They are matched + on the flight number alone - safe, because a match is only ever looked for within one + airframe - and either cell's tooltip lists every name the flight is known by * Reg - Registration of the airframe that flew it * From, To - Departure and arrival airports * Out, Off, On, In - The four OOOI times: off the gate, airborne, landed, on the gate @@ -339,8 +501,50 @@ Columns in either table can be reordered by dragging, hidden via the right-click menu, and either table sorted by clicking a header. Widths and order are saved with the preset. +

Web API

+ +The feature's settings can be read and written at +`/sdrangel/featureset/{featureSetIndex}/feature/{featureIndex}/settings`, and +`.../report` gives the number of aircraft held, how many of them are currently being +heard, the number of flights, and the messages received this session both in total and +per protocol. + +`.../actions` takes `selectIcao`, `selectRegistration` or `selectFlight`, each naming +one aircraft or flight to select in the tables - the same thing clicking a row does. +For example: + +``` +POST /sdrangel/featureset/0/feature/0/actions +{"featureType":"Aircraft","AircraftActions":{"selectFlight":"BAW123"}} +``` + +Where several flights have carried that number, the most recently heard is chosen. +

Attribution

+## Feeding aggregators + +The **Feed** button forwards every ACARS message the ACARS demodulators decode on to +community aggregators, as acarsdec-style JSON - one object per UDP datagram, or a +newline-delimited stream over TCP. Right click it for the settings: a station identifier +sent with every message, and per-service enables with host, port and protocol. + +It lives here rather than in the ACARS demodulator because a receiver runs one of those +per band - VHF, VDL-2, HFDL - and the feed had to be filled in identically in each, +opening three sets of connections to the same aggregator under the same station identity. +The station is a property of the receiver, so it is set up once and every demodulator +feeds through it. + +Note that airframes.io assigns the protocol **per station type**: their VDL2 (vdlm2dec) +wizard says TCP 5555, while the ACARS (acarsdec) station type ingests **UDP on 5550** and +shows no protocol box at all. SDRangel emits acarsdec-format JSON, so create an +ACARS/acarsdec station for this feed. A TCP connection to 5550 is refused, which shows up +as a "feed not connected ... reconnecting, message dropped" loop in the log. + +Unlike the aircraft tables, the feed is not filtered by the per-demodulator enables in the +settings dialog: those say which demodulators contribute to what is tracked, and a +receiver may reasonably want to feed a band it does not track. + Aircraft and route data from the [OpenSky Network](https://opensky-network.org/). Aircraft photographs from [PlaneSpotters](https://www.planespotters.net/). diff --git a/plugins/feature/map/CMakeLists.txt b/plugins/feature/map/CMakeLists.txt index 8ac23d922..a657182f4 100644 --- a/plugins/feature/map/CMakeLists.txt +++ b/plugins/feature/map/CMakeLists.txt @@ -3,6 +3,7 @@ project(map) set(map_SOURCES map.cpp mapsettings.cpp + mapviewcoordinator.cpp mapplugin.cpp mapwebapiadapter.cpp osmtemplateserver.cpp @@ -13,6 +14,7 @@ set(map_SOURCES set(map_HEADERS map.h mapsettings.h + mapviewcoordinator.h mapplugin.h mapreport.h mapwebapiadapter.h @@ -38,6 +40,8 @@ include_directories( ) if(NOT SERVER_MODE) + find_package(Threads REQUIRED) + set(map_SOURCES ${map_SOURCES} mapgui.cpp @@ -48,6 +52,18 @@ if(NOT SERVER_MODE) mapmaidenheaddialog.ui mapsettingsdialog.cpp mapsettingsdialog.ui + msfsassetconverter/batchconverter.cpp + msfsassetconverter/batchconverter.h + msfsassetconverter/bc7decoder.cpp + msfsassetconverter/bc7decoder.h + msfsassetconverter/converter.cpp + msfsassetconverter/converter.h + msfsassetconverter/ddsdecoder.cpp + msfsassetconverter/ddsdecoder.h + msfsassetconverter/fsltlresolver.cpp + msfsassetconverter/fsltlresolver.h + msfsassetconverter/ktx2writer.cpp + msfsassetconverter/ktx2writer.h mapbeacondialog.cpp mapbeacondialog.ui mapibpbeacondialog.cpp @@ -62,6 +78,7 @@ if(NOT SERVER_MODE) czml.cpp map.qrc mapicons.qrc + mapaudio.qrc cesium.qrc mapdata.qrc ) @@ -83,7 +100,7 @@ if(NOT SERVER_MODE) ) set(TARGET_NAME ${PLUGINS_PREFIX}map) - set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::Positioning Qt::Location) + set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::Positioning Qt::Location Threads::Threads) set(TARGET_LIB_GUI "sdrgui") set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) diff --git a/plugins/feature/map/Cesium/Cesium.js b/plugins/feature/map/Cesium/Cesium.js index 38f1d3ab5..791b59573 100644 --- a/plugins/feature/map/Cesium/Cesium.js +++ b/plugins/feature/map/Cesium/Cesium.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var Cesium=(()=>{var u1e=Object.create;var nN=Object.defineProperty;var m1e=Object.getOwnPropertyDescriptor;var f1e=Object.getOwnPropertyNames;var h1e=Object.getPrototypeOf,p1e=Object.prototype.hasOwnProperty;var iN=(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 ad=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),b1e=(e,t)=>{for(var n in t)nN(e,n,{get:t[n],enumerable:!0})},Tq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of f1e(t))!p1e.call(e,o)&&o!==n&&nN(e,o,{get:()=>t[o],enumerable:!(i=m1e(t,o))||i.enumerable});return e};var _=(e,t,n)=>(n=e!=null?u1e(h1e(e)):{},Tq(t||!e||!e.__esModule?nN(n,"default",{value:e,enumerable:!0}):n,e)),y1e=e=>Tq(nN({},"__esModule",{value:!0}),e);var T=ad(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFhTPU9iamVjdC5jcmVhdGU7dmFyIEJsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgWVM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgJFM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIFpTPU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dLG5bNl09dFs2XS1lWzZdLG5bN109dFs3XS1lWzddLG5bOF09dFs4XS1lWzhdLG59O1R0Lm11bHRpcGx5QnlWZWN0b3I9ZnVuY3Rpb24odCxlLG4pe3kudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pO2xldCBvPWUueCxyPWUueSxpPWUueixzPXRbMF0qbyt0WzNdKnIrdFs2XSppLGY9dFsxXSpvK3RbNF0qcit0WzddKmksdT10WzJdKm8rdFs1XSpyK3RbOF0qaTtyZXR1cm4gbi54PXMsbi55PWYsbi56PXUsbn07VHQubXVsdGlwbHlCeVNjYWxhcj1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxhciIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG5bMF09dFswXSplLG5bMV09dFsxXSplLG5bMl09dFsyXSplLG5bM109dFszXSplLG5bNF09dFs0XSplLG5bNV09dFs1XSplLG5bNl09dFs2XSplLG5bN109dFs3XSplLG5bOF09dFs4XSplLG59O1R0Lm11bHRpcGx5QnlTY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUueCxuWzFdPXRbMV0qZS54LG5bMl09dFsyXSplLngsblszXT10WzNdKmUueSxuWzRdPXRbNF0qZS55LG5bNV09dFs1XSplLnksbls2XT10WzZdKmUueixuWzddPXRbN10qZS56LG5bOF09dFs4XSplLnosbn07VHQubXVsdGlwbHlCeVVuaWZvcm1TY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdC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odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54L2UueCxuLnk9dC55L2UueSxuLno9dC56L2UueixuLnc9dC53L2UudyxufTt2dC5hZGQ9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54K2UueCxuLnk9dC55K2UueSxuLno9dC56K2UueixuLnc9dC53K2UudyxufTt2dC5zdWJ0cmFjdD1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG4ueD10LngtZS54LG4ueT10LnktZS55LG4uej10LnotZS56LG4udz10LnctZS53LG59O3Z0Lm11bHRpcGx5QnlTY2FsYXI9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsdCkseS50eXBlT2YubnVtYmVyKCJzY2FsYXIiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54KmUsbi55PXQueSplLG4uej10LnoqZSxuLnc9dC53KmUsbn07dnQuZGl2aWRlQnlTY2FsYXI9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImNhcnRlc2lhbiIsdCkseS50eXBlT2YubnVtYmVyKCJzY2FsYXIiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54L2Usbi55PXQueS9lLG4uej10LnovZSxuLnc9dC53L2Usbn07dnQubmVnYXRlPWZ1bmN0aW9uKHQsZSl7cmV0dXJu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X07T3QuYWRkPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJsZWZ0Iix0KSx5LnR5cGVPZi5vYmplY3QoInJpZ2h0IixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksbi54PXQueCtlLngsbi55PXQueStlLnksbi56PXQueitlLnosbi53PXQudytlLncsbn07T3Quc3VidHJhY3Q9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54LWUueCxuLnk9dC55LWUueSxuLno9dC56LWUueixuLnc9dC53LWUudyxufTtPdC5uZWdhdGU9ZnVuY3Rpb24odCxlKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJxdWF0ZXJuaW9uIix0KSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsZSksZS54PS10LngsZS55PS10LnksZS56PS10LnosZS53PS10LncsZX07T3QuZG90PWZ1bmN0aW9uKHQsZSl7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSksdC54KmUueCt0LnkqZS55K3QueiplLnordC53KmUud307T3QubXVsdGlwbHk9ZnVuY3Rpb24odCxlLG4pe3kudHlwZU9mLm9iamVjdCgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pO2xldCBvPXQueCxyPXQueSxpPXQueixzPXQudyxmPWUueCx1PWUueSxjPWUueixsPWUudyxwPXMqZitvKmwrcipjLWkqdSxkPXMqdS1vKmMrcipsK2kqZixtPXMqYytvKnUtcipmK2kqbCxfPXMqbC1vKmYtcip1LWkqYztyZXR1cm4gbi54PXAsbi55PWQsbi56PW0sbi53PV8sbn07T3QubXVsdGlwbHlC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W0sbj10Ll9tYXhpbXVtLG89dC5fdmVydGV4Rm9ybWF0O2lmKGEuZXF1YWxzKGUsbikpcmV0dXJuO2xldCByPW5ldyByZSxpLHM7aWYoby5wb3NpdGlvbiYmKG8uc3R8fG8ubm9ybWFsfHxvLnRhbmdlbnR8fG8uYml0YW5nZW50KSl7aWYoby5wb3NpdGlvbiYmKHM9bmV3IEZsb2F0NjRBcnJheSg2KjQqMyksc1swXT1lLngsc1sxXT1lLnksc1syXT1uLnosc1szXT1uLngsc1s0XT1lLnksc1s1XT1uLnosc1s2XT1uLngsc1s3XT1uLnksc1s4XT1uLnosc1s5XT1lLngsc1sxMF09bi55LHNbMTFdPW4ueixzWzEyXT1lLngsc1sxM109ZS55LHNbMTRdPWUueixzWzE1XT1uLngsc1sxNl09ZS55LHNbMTddPWUueixzWzE4XT1uLngsc1sxOV09bi55LHNbMjBdPWUueixzWzIxXT1lLngsc1syMl09bi55LHNbMjNdPWUueixzWzI0XT1uLngsc1syNV09ZS55LHNbMjZdPWUueixzWzI3XT1uLngsc1syOF09bi55LHNbMjldPWUueixzWzMwXT1uLngsc1szMV09bi55LHNbMzJdPW4ueixzWzMzXT1uLngsc1szNF09ZS55LHNbMzVdPW4ueixzWzM2XT1lLngsc1szN109ZS55LHNbMzhdPWUueixzWzM5XT1lLngsc1s0MF09bi55LHNbNDFdPWUueixzWzQyXT1lLngsc1s0M109bi55LHNbNDRdPW4ueixzWzQ1XT1lLngsc1s0Nl09ZS55LHNbNDddPW4ueixzWzQ4XT1lLngsc1s0OV09bi55LHNbNTBdPWUueixzWzUxXT1uLngsc1s1Ml09bi55LHNbNTNdPWUueixzWzU0XT1uLngsc1s1NV09bi55LHNbNTZdPW4ueixzWzU3XT1lLngsc1s1OF09bi55LHNbNTldPW4ueixzWzYwXT1lLngsc1s2MV09ZS55LHNbNjJdPWUueixzWzYzXT1uLngsc1s2NF09ZS55LHNbNjVdPWUueixzWzY2XT1uLngsc1s2N109ZS55LHNbNjhdPW4ueixzW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xlVG9HZW9kZXRpY1N1cmZhY2UocSxxKSxXPWEuY2xvbmUocSxfMCksRT1zLmdlb2RldGljU3VyZmFjZU5vcm1hbChxLEUpLGImJihUW3orU109LUUueCxUW2orU109LUUueSxUW2srU109LUUueik7bGV0IFI9YS5tdWx0aXBseUJ5U2NhbGFyKEUsZixiVCk7aWYocT1hLmFkZChxLFIscSksUj1hLm11bHRpcGx5QnlTY2FsYXIoRSx1LFIpLFc9YS5hZGQoVyxSLFcpLG4ucG9zaXRpb24mJihwW3orU109Vy54LHBbaitTXT1XLnkscFtrK1NdPVcueixwW3pdPXEueCxwW2pdPXEueSxwW2tdPXEueiksbi5ub3JtYWx8fG4udGFuZ2VudHx8bi5iaXRhbmdlbnQpe0M9YS5jbG9uZShFLEMpO2xldCBudD1hLmZyb21BcnJheSh0LCh6KzMpJVMsYlQpO2Euc3VidHJhY3QobnQscSxudCk7bGV0IGN0PWEuc3VidHJhY3QoVyxxLHkwKTtFPWEubm9ybWFsaXplKGEuY3Jvc3MoY3QsbnQsRSksRSksbi5ub3JtYWwmJihtW3pdPUUueCxtW2pdPUUueSxtW2tdPUUueixtW3orU109RS54LG1baitTXT1FLnksbVtrK1NdPUUueiksbi50YW5nZW50JiYodz1hLm5vcm1hbGl6ZShhLmNyb3NzKEMsRSx3KSx3KSxfW3pdPXcueCxfW2pdPXcueSxfW2tdPXcueixfW3orU109dy54LF9beisxK1NdPXcueSxfW3orMitTXT13LnopLG4uYml0YW5nZW50JiYoZ1t6XT1DLngsZ1tqXT1DLnksZ1trXT1DLnosZ1t6K1NdPUMueCxnW2orU109Qy55LGdbaytTXT1DLnopfX1pZihuLnN0KXtTPWQubGVuZ3RoO2ZvcihsZXQgej0wO3o8Uzt6Kz0yKWRbel09KGRbel0tQi54KS8oQS54LUIueCksZFt6KzFdPShkW3orMV0tQi55KS8oQS55LUIueSl9bGV0IEQ9bmV3IHJlO2lmKG4ucG9zaXRpb24mJihELnBvc2l0aW9uPW5ldyBydCh7Y29tcG9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yxpLCEwKSxsPXIuc3Q/bmV3IEZsb2F0MzJBcnJheSh1KjIpOnZvaWQgMCxwPXIubm9ybWFsP25ldyBGbG9hdDMyQXJyYXkodSozKTp2b2lkIDAsZD1yLnRhbmdlbnQ/bmV3IEZsb2F0MzJBcnJheSh1KjMpOnZvaWQgMCxtPXIuYml0YW5nZW50P25ldyBGbG9hdDMyQXJyYXkodSozKTp2b2lkIDAsXyxnPXIubm9ybWFsfHxyLnRhbmdlbnR8fHIuYml0YW5nZW50O2lmKGcpe2xldCBOPXIudGFuZ2VudHx8ci5iaXRhbmdlbnQsRj0wLEk9MCx2PTAsQj1NYXRoLmF0YW4yKG8tbixlKSxBPWFGO0Euej1NYXRoLnNpbihCKTtsZXQgUz1NYXRoLmNvcyhCKSx4PXVGLEQ9ZkY7Zm9yKF89MDtfPGk7XysrKXtsZXQgej1fL2kqUC5UV09fUEksaj1TKk1hdGguY29zKHopLGs9UypNYXRoLnNpbih6KTtnJiYoQS54PWosQS55PWssTiYmKHg9YS5ub3JtYWxpemUoYS5jcm9zcyhhLlVOSVRfWixBLHgpLHgpKSxyLm5vcm1hbCYmKHBbRisrXT1BLngscFtGKytdPUEueSxwW0YrK109QS56LHBbRisrXT1BLngscFtGKytdPUEueSxwW0YrK109QS56KSxyLnRhbmdlbnQmJihkW0krK109eC54LGRbSSsrXT14LnksZFtJKytdPXgueixkW0krK109eC54LGRbSSsrXT14LnksZFtJKytdPXgueiksci5iaXRhbmdlbnQmJihEPWEubm9ybWFsaXplKGEuY3Jvc3MoQSx4LEQpLEQpLG1bdisrXT1ELngsbVt2KytdPUQueSxtW3YrK109RC56LG1bdisrXT1ELngsbVt2KytdPUQueSxtW3YrK109RC56KSl9Zm9yKF89MDtfPGk7XysrKXIubm9ybWFsJiYocFtGKytdPTAscFtGKytdPTAscFtGKytdPS0xKSxyLnRhbmdlbnQmJihkW0krK109MSxkW0krK109MCxkW0krK109MCksci5iaXRhbmdlbnQmJihtW3YrK109MCxtW3YrK109LTEsbVt2KytdPTApO2ZvcihfPTA7XzxpO18rKylyLm5vcm1hbCYmKHBbRisrXT0wLHBbRisrXT0wLHBbRisrXT0xKSxyLnRhbmdlbnQmJihkW0krK109MSxkW0krK109MCxkW0krK109MCksci5iaXRhbmdlbnQmJihtW3YrK109MCxtW3YrK109MSxtW3YrK109MCl9bGV0IGI9MTIqaS0xMixUPUZ0LmNyZWF0ZVR5cGVkQXJyYXkodSxiKSxPPTAsRT0wO2ZvcihfPTA7XzxpLTE7XysrKVRbTysrXT1FLFRbTysrXT1FKzIsVFtPKytdPUUrMyxUW08rK109RSxUW08rK109RSszLFRbTysrXT1FKzEsRSs9Mjtmb3IoVFtPKytdPXMtMixUW08rK109MCxUW08rK109MSxUW08rK109cy0yLFRbTysrXT0xLFRbTysrXT1zLTEsXz0xO188aS0xO18rKylUW08rK109cytfKzEsVFtPKytdPXMrXyxUW08rK109cztmb3IoXz0xO188aS0xO18rKylUW08rK109ZixUW08rK109ZitfLFRbTysrXT1mK18rMTtsZXQgdz0wO2lmKHIuc3Qpe2xldCBOPU1hdGgubWF4KG4sbyk7Zm9yKF89MDtfPHU7XysrKXtsZXQgRj1hLmZyb21BcnJheShjLF8qMyxsRik7bFt3KytdPShGLngrTikvKDIqTiksbFt3KytdPShGLnkrTikvKDIqTil9fWxldCBDPW5ldyByZTtyLnBvc2l0aW9uJiYoQy5wb3NpdGlvbj1uZXcgcnQoe2NvbXBvbmVudERhdGF0eXBlOmV0LkRPVUJMRSxjb21wb25lbnRzUGVyQXR0cmlidXRlOjMsdmFsdWVzOmN9KSksci5ub3JtYWwmJihDLm5vcm1hbD1uZXcgcnQoe2NvbXBvbmVudERhdGF0eXBlOmV0LkZMT0FULGNvbXBvbmVudHNQZXJBdHRyaWJ1dGU6Myx2YWx1ZXM6cH0pKSxyLnRhbmdlbnQmJihDLnRhbmdlbnQ9bmV3IHJ0KHtjb21wb25lbnREYXRhdHlwZTpldC5GTE9BVCxjb21wb25lbnRzUGVyQXR0cmlidXRl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gQixBPTAsUz0xLyhwLWwtMSk7Zm9yKEI9MDtCPHA7KytCKXtsZXQgaz1CKjMscT1hLmZyb21BcnJheShjLGssX2cpLFc9YS5mcm9tQXJyYXkodSxrLG5tKTtpZihyLnBvc2l0aW9uJiYobVtPKytdPVcueCxtW08rK109Vy55LG1bTysrXT1XLnosbVtPKytdPXEueCxtW08rK109cS55LG1bTysrXT1xLnopLHIuc3QmJihUW00rK109QSxUW00rK109MCxUW00rK109QSxUW00rK109MSksci5ub3JtYWx8fHIudGFuZ2VudHx8ci5iaXRhbmdlbnQpe2xldCBSPWEuY2xvbmUoYS5aRVJPLGYyKSxudD1hLnN1YnRyYWN0KHEscy5nZW9kZXRpY1N1cmZhY2VOb3JtYWwocSxubSksbm0pO2lmKEIrMTxwJiYoUj1hLmZyb21BcnJheShjLGsrMyxmMikpLHYpe2xldCBjdD1hLnN1YnRyYWN0KFIscSxTVSksbHQ9YS5zdWJ0cmFjdChudCxxLF9nKTtOPWEubm9ybWFsaXplKGEuY3Jvc3MobHQsY3QsTiksTiksdj0hMX1hLmVxdWFsc0Vwc2lsb24ocSxSLFAuRVBTSUxPTjEwKT92PSEwOihBKz1TLHIudGFuZ2VudCYmKEY9YS5ub3JtYWxpemUoYS5zdWJ0cmFjdChSLHEsRiksRikpLHIuYml0YW5nZW50JiYoST1hLm5vcm1hbGl6ZShhLmNyb3NzKE4sRixJKSxJKSkpLHIubm9ybWFsJiYoX1tFKytdPU4ueCxfW0UrK109Ti55LF9bRSsrXT1OLnosX1tFKytdPU4ueCxfW0UrK109Ti55LF9bRSsrXT1OLnopLHIudGFuZ2VudCYmKGdbQysrXT1GLngsZ1tDKytdPUYueSxnW0MrK109Ri56LGdbQysrXT1GLngsZ1tDKytdPUYueSxnW0MrK109Ri56KSxyLmJpdGFuZ2VudCYmKGJbdysrXT1JLngsYlt3KytdPUkueSxiW3crK109SS56LGJbdysrXT1JLngsYlt3KytdPUkueSxiW3crK109SS56KX19bGV0IHg9bmV3IHJlO3I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kudGhlbigoKT0+aTEoKSl9O3JldHVybiBKUyhEayk7fSkoKTsK")});var oN=ad((oLt,Sq)=>{var rLt=_(T()),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>>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>>1^t[e&1];for(;n>>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)};Sq.exports=xp});var zq=ad((YS,HS)=>{var lGt=_(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof YS=="object"&&YS&&!YS.nodeType&&YS,n=typeof HS=="object"&&HS&&!HS.nodeType&&HS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,l=26,d=38,u=700,f=72,p=128,y="-",h=/^xn--/,g=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,S={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,Z=Math.floor,R=String.fromCharCode,E;function I(O){throw new RangeError(S[O])}function v(O,H){for(var U=O.length,K=[];U--;)K[U]=H(O[U]);return K}function P(O,H){var U=O.split("@"),K="";U.length>1&&(K=U[0]+"@",O=U[1]),O=O.replace(x,".");var Q=O.split("."),ie=v(Q,H).join(".");return K+ie}function F(O){for(var H=[],U=0,K=O.length,Q,ie;U=55296&&Q<=56319&&U65535&&(H-=65536,U+=R(H>>>10&1023|55296),H=56320|H&1023),U+=R(H),U}).join("")}function b(O){return O-48<10?O-22:O-65<26?O-65:O-97<26?O-97:s}function G(O,H){return O+22+75*(O<26)-((H!=0)<<5)}function X(O,H,U){var K=0;for(O=U?Z(O/u):O>>1,O+=Z(O/H);O>V*l>>1;K+=s)O=Z(O/V);return Z(K+(V+1)*O/(O+d))}function W(O){var H=[],U=O.length,K,Q=0,ie=p,j=f,$,ne,be,Ce,me,_e,Ve,Ie,Ze;for($=O.lastIndexOf(y),$<0&&($=0),ne=0;ne<$;++ne)O.charCodeAt(ne)>=128&&I("not-basic"),H.push(O.charCodeAt(ne));for(be=$>0?$+1:0;be=U&&I("invalid-input"),Ve=b(O.charCodeAt(be++)),(Ve>=s||Ve>Z((r-Q)/me))&&I("overflow"),Q+=Ve*me,Ie=_e<=j?a:_e>=j+l?l:_e-j,!(VeZ(r/Ze)&&I("overflow"),me*=Ze;K=H.length+1,j=X(Q-Ce,K,Ce==0),Z(Q/K)>r-ie&&I("overflow"),ie+=Z(Q/K),Q%=K,H.splice(Q++,0,ie)}return N(H)}function A(O){var H,U,K,Q,ie,j,$,ne,be,Ce,me,_e=[],Ve,Ie,Ze,De;for(O=F(O),Ve=O.length,H=p,U=0,ie=f,j=0;j=H&&me<$&&($=me);for(Ie=K+1,$-H>Z((r-U)/Ie)&&I("overflow"),U+=($-H)*Ie,H=$,j=0;jr&&I("overflow"),me==H){for(ne=U,be=s;Ce=be<=ie?a:be>=ie+l?l:be-ie,!(ne{var dGt=_(T());/*! +"use strict";var Cesium=(()=>{var TYe=Object.create;var kA=Object.defineProperty;var _Ye=Object.getOwnPropertyDescriptor;var SYe=Object.getOwnPropertyNames;var ZYe=Object.getPrototypeOf,RYe=Object.prototype.hasOwnProperty;var CYe=(e,t,n)=>t in e?kA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var j5=(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 Xs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var gm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},yle=(e,t)=>{for(var n in t)kA(e,n,{get:t[n],enumerable:!0})},xle=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of SYe(t))!RYe.call(e,o)&&o!==n&&kA(e,o,{get:()=>t[o],enumerable:!(i=_Ye(t,o))||i.enumerable});return e};var x=(e,t,n)=>(n=e!=null?TYe(ZYe(e)):{},xle(t||!e||!e.__esModule?kA(n,"default",{value:e,enumerable:!0}):n,e)),VYe=e=>xle(kA({},"__esModule",{value:!0}),e);var mt=(e,t,n)=>CYe(e,typeof t!="symbol"?t+"":t,n);var T=gm(()=>{"use strict";globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFlTPU9iamVjdC5jcmVhdGU7dmFyIGJmPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgSlM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgWlM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIFFTPU9iamVjdC5nZXRQcm90b3R5cGVPZiwkUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBlQz0obixlLHQpPT5lIGluIG4/YmYobixlLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTp0fSk6bltlXT10O3ZhciBsYT0obj0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkobix7Z2V0OihlLHQpPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6ZSlbdF19KTpuKShmdW5jdGlvbihuKXtpZih0eXBlb2YgcmVxdWlyZTwidSIpcmV0dXJuIHJlcXVpcmUuYXBwbHkodGhpcyxhcmd1bWVudHMpO3Rocm93IEVycm9yKCdEeW5hbWljIHJlcXVpcmUgb2YgIicrbisnIiBpcyBub3Qgc3VwcG9ydGVkJyl9KSxPMT1uPT5lPT57dmFyIHQ9bltlXTtpZih0KXJldHVybiB0KCk7dGhyb3cgbmV3IEVycm9yKCJNb2R1bGUgbm90IGZvdW5kIGluIGJ1bmRsZTogIitlKX07dmFyIFg9KG4sZSx0KT0+KCk9PntpZih0KXRocm93IHRbMF07dHJ5e3JldHVybiBuJi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cG9uZW50KGUsdCxvKXtyZXR1cm4gby54PU1hdGgubWluKGUueCx0LngpLG8ueT1NYXRoLm1pbihlLnksdC55KSxvLno9TWF0aC5taW4oZS56LHQueiksby53PU1hdGgubWluKGUudyx0LncpLG99c3RhdGljIG1heGltdW1CeUNvbXBvbmVudChlLHQsbyl7cmV0dXJuIG8ueD1NYXRoLm1heChlLngsdC54KSxvLnk9TWF0aC5tYXgoZS55LHQueSksby56PU1hdGgubWF4KGUueix0LnopLG8udz1NYXRoLm1heChlLncsdC53KSxvfXN0YXRpYyBjbGFtcChlLHQsbyxhKXtsZXQgcj1rLmNsYW1wKGUueCx0Lngsby54KSxpPWsuY2xhbXAoZS55LHQueSxvLnkpLGY9ay5jbGFtcChlLnosdC56LG8ueiksZD1rLmNsYW1wKGUudyx0Lncsby53KTtyZXR1cm4gYS54PXIsYS55PWksYS56PWYsYS53PWQsYX1zdGF0aWMgbWFnbml0dWRlU3F1YXJlZChlKXtyZXR1cm4gZS54KmUueCtlLnkqZS55K2UueiplLnorZS53KmUud31zdGF0aWMgbWFnbml0dWRlKGUpe3JldHVybiBNYXRoLnNxcnQobi5tYWduaXR1ZGVTcXVhcmVkKGUpKX1zdGF0aWMgZGlzdGFuY2UoZSx0KXtyZXR1cm4gbi5zdWJ0cmFjdChlLHQsY2wpLG4ubWFnbml0dWRlKGNsKX1zdGF0aWMgZGlzdGFuY2VTcXVhcmVkKGUsdCl7cmV0dXJuIG4uc3VidHJhY3QoZSx0LGNsKSxuLm1hZ25pdHVkZVNxdWFyZWQoY2wpfXN0YXRpYyBub3JtYWxpemUoZSx0KXtsZXQgbz1uLm1hZ25pdHVkZShlKTtyZXR1cm4gdC54PWUueC9vLHQueT1lLnkvbyx0Lno9ZS56L28sdC53PWUudy9vLHR9c3RhdGljIGRvdChlLHQpe3JldHVybiBlLngqdC54K2UueSp0LnkrZS56KnQueitlLncqdC53fXN0YXRpYyBtdWx0aXBseUNvbXBvbmVudHMoZSx0LG8pe3JldHVybiBvLng9ZS54KnQueCxvLnk9ZS55KnQueSxvLno9ZS56KnQueixvLnc9ZS53KnQudyxvfXN0YXRpYyBkaXZpZGVDb21wb25lbnRzKGUsdCxvKXtyZXR1cm4gby54PWUueC90Lngsby55PWUueS90Lnksby56PWUuei90Lnosby53PWUudy90Lncsb31zdGF0aWMgYWRkKGUsdCxvKXtyZXR1cm4gby54PWUueCt0Lngsby55PWUueSt0Lnksby56PWUueit0Lnosby53PWUudyt0Lncsb31zdGF0aWMgc3VidHJhY3QoZSx0LG8pe3JldHVybiBvLng9ZS54LXQueCxvLnk9ZS55LXQueSxvLno9ZS56LXQueixvLnc9ZS53LXQudyxvfXN0YXRpYyBtdWx0aXBseUJ5U2NhbGFyKGUsdCxvKXtyZXR1cm4gby54PWUueCp0LG8ueT1lLnkqdCxvLno9ZS56KnQsby53PWUudyp0LG99c3RhdGljIGRpdmlkZUJ5U2NhbGFyKGUsdCxvKXtyZXR1cm4gby54PWUueC90LG8ueT1lLnkvdCxvLno9ZS56L3Qsby53PWUudy90LG99c3RhdGljIG5lZ2F0ZShlLHQpe3JldHVybiB0Lng9LWUueCx0Lnk9LWUueSx0Lno9LWUueix0Lnc9LWUudyx0fXN0YXRpYyBhYnMoZSx0KXtyZXR1cm4gdC54PU1hdGguYWJzKGUueCksdC55PU1hdGguYWJzKGUueSksdC56PU1hdGguYWJzKGUueiksdC53PU1hdGguYWJzKGUudyksdH1zdGF0aWMgbGVycChlLHQsbyxhKXtyZXR1cm4gbi5tdWx0aXBseUJ5U2NhbGFyKHQsbyxMMSksYT1uLm11bHRpcGx5QnlTY2FsYXIoZSwxLW8sYSksbi5hZGQoTDEsYSxhKX1zdGF0aWMgbW9zdE9ydGhvZ29uYWxBeGlzKGUsdCl7bGV0IG89bi5ub3JtYWxpemUoZSxOQyk7cmV0dXJuIG4uYWJzKG8sbyksby54PD1vLnk/by54PD1vLno/by54PD1vLnc/dD1uLmNsb25lKG4uVU5JVF9YLHQpOnQ9bi5jbG9uZShuLlVOS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uX3ZlcnRleEZvcm1hdDtpZihzLmVxdWFscyhlLHQpKXJldHVybjtsZXQgYT1uZXcgUWUscixpO2lmKG8ucG9zaXRpb24mJihvLnN0fHxvLm5vcm1hbHx8by50YW5nZW50fHxvLmJpdGFuZ2VudCkpe2lmKG8ucG9zaXRpb24mJihpPW5ldyBGbG9hdDY0QXJyYXkoNzIpLGlbMF09ZS54LGlbMV09ZS55LGlbMl09dC56LGlbM109dC54LGlbNF09ZS55LGlbNV09dC56LGlbNl09dC54LGlbN109dC55LGlbOF09dC56LGlbOV09ZS54LGlbMTBdPXQueSxpWzExXT10LnosaVsxMl09ZS54LGlbMTNdPWUueSxpWzE0XT1lLnosaVsxNV09dC54LGlbMTZdPWUueSxpWzE3XT1lLnosaVsxOF09dC54LGlbMTldPXQueSxpWzIwXT1lLnosaVsyMV09ZS54LGlbMjJdPXQueSxpWzIzXT1lLnosaVsyNF09dC54LGlbMjVdPWUueSxpWzI2XT1lLnosaVsyN109dC54LGlbMjhdPXQueSxpWzI5XT1lLnosaVszMF09dC54LGlbMzFdPXQueSxpWzMyXT10LnosaVszM109dC54LGlbMzRdPWUueSxpWzM1XT10LnosaVszNl09ZS54LGlbMzddPWUueSxpWzM4XT1lLnosaVszOV09ZS54LGlbNDBdPXQueSxpWzQxXT1lLnosaVs0Ml09ZS54LGlbNDNdPXQueSxpWzQ0XT10LnosaVs0NV09ZS54LGlbNDZdPWUueSxpWzQ3XT10LnosaVs0OF09ZS54LGlbNDldPXQueSxpWzUwXT1lLnosaVs1MV09dC54LGlbNTJdPXQueSxpWzUzXT1lLnosaVs1NF09dC54LGlbNTVdPXQueSxpWzU2XT10LnosaVs1N109ZS54LGlbNThdPXQueSxpWzU5XT10LnosaVs2MF09ZS54LGlbNjFdPWUueSxpWzYyXT1lLnosaVs2M109dC54LGlbNjRdPWUueSxpWzY1XT1lLnosaVs2Nl09dC54LGlbNjddPWUueSxpWzY4XT10LnosaVs2OV09ZS54LGlbNzBdPWUueSxpWzcxXT10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vLXQpLGw9KG4tdCkvKGEtdCksci5wdXNoKDEpLHIucHVzaCgyKSxsIT09MSYmKHIucHVzaCgtMSksci5wdXNoKDApLHIucHVzaCgyKSxyLnB1c2gobCkpLHUhPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMCksci5wdXNoKDEpLHIucHVzaCh1KSkpOmY/KG09KG4tbykvKGEtbyksaD0obi1vKS8odC1vKSxyLnB1c2goMiksci5wdXNoKDApLGghPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMSksci5wdXNoKDApLHIucHVzaChoKSksbSE9PTEmJihyLnB1c2goLTEpLHIucHVzaCgxKSxyLnB1c2goMiksci5wdXNoKG0pKSk6ZCYmKGI9KG4tYSkvKHQtYSkscD0obi1hKS8oby1hKSxyLnB1c2goMCksci5wdXNoKDEpLHAhPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMiksci5wdXNoKDEpLHIucHVzaChwKSksYiE9PTEmJihyLnB1c2goLTEpLHIucHVzaCgyKSxyLnB1c2goMCksci5wdXNoKGIpKSk6Yz09PTI/IWkmJnQhPT1uPyhoPShuLW8pLyh0LW8pLGI9KG4tYSkvKHQtYSksci5wdXNoKDApLHIucHVzaCgtMSksci5wdXNoKDEpLHIucHVzaCgwKSxyLnB1c2goaCksci5wdXNoKC0xKSxyLnB1c2goMiksci5wdXNoKDApLHIucHVzaChiKSk6IWYmJm8hPT1uPyhwPShuLWEpLyhvLWEpLHU9KG4tdCkvKG8tdCksci5wdXNoKDEpLHIucHVzaCgtMSksci5wdXNoKDIpLHIucHVzaCgxKSxyLnB1c2gocCksci5wdXNoKC0xKSxyLnB1c2goMCksci5wdXNoKDEpLHIucHVzaCh1KSk6IWQmJmEhPT1uJiYobD0obi10KS8oYS10KSxtPShuLW8pLyhhLW8pLHIucHVzaCgyKSxyLnB1c2goLTEpLHIucHVzaCgwKSxyLnB1c2goMiksci5wdXNoKGwpLHIucHVzaCgtMSksci5wdXNoKDEpLHIucHVzaCgyKSxyLnB1c2gobSk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oKSl9LEFHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+UF8oKSl9LHdHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+UV8oKSl9LFRHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+dHkoKSl9LEVHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+YXkoKSl9LFJHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+Y3koKSl9LHhHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+bHkoKSl9LE9HPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+YnkoKSl9LFNHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+d3koKSl9LENHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+WXkoKSl9LE1HPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+ZTEoKSl9LE5HPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+cjEoKSl9LElHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+YzEoKSl9LFBHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+ZjEoKSl9LGtHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+bTEoKSl9LHZHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+YjEoKSl9LEZHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+ZzEoKSl9LERHPSgpPT57UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+eTEoKSl9O3JldHVybiB0QyhCRyk7fSkoKTsK")});var Q5=gm((P3t,Tle)=>{var X3t=x(T()),j0=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)};j0.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};j0.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};j0.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>>1^t[e&1];for(;n>>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};j0.prototype.random_int31=function(){return this.random_int()>>>1};j0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};j0.prototype.random=function(){return this.random_int()*(1/4294967296)};j0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};j0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Tle.exports=j0});var Xle=gm((KR,JR)=>{var Qzt=x(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof KR=="object"&&KR&&!KR.nodeType&&KR,n=typeof JR=="object"&&JR&&!JR.nodeType&&JR,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,m=72,p=128,b="-",f=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Z=s-a,R=Math.floor,C=String.fromCharCode,E;function A(w){throw new RangeError(S[w])}function L(w,O){for(var M=w.length,z=[];M--;)z[M]=O(w[M]);return z}function F(w,O){var M=w.split("@"),z="";M.length>1&&(z=M[0]+"@",w=M[1]),w=w.replace(_,".");var K=w.split("."),te=L(K,O).join(".");return z+te}function I(w){for(var O=[],M=0,z=w.length,K,te;M=55296&&K<=56319&&M65535&&(O-=65536,M+=C(O>>>10&1023|55296),O=56320|O&1023),M+=C(O),M}).join("")}function g(w){return w-48<10?w-22:w-65<26?w-65:w-97<26?w-97:s}function V(w,O){return w+22+75*(w<26)-((O!=0)<<5)}function G(w,O,M){var z=0;for(w=M?R(w/u):w>>1,w+=R(w/O);w>Z*c>>1;z+=s)w=R(w/Z);return R(z+(Z+1)*w/(w+d))}function v(w){var O=[],M=w.length,z,K=0,te=p,H=m,$,ee,le,_e,he,Ze,ye,Ge,Ae;for($=w.lastIndexOf(b),$<0&&($=0),ee=0;ee<$;++ee)w.charCodeAt(ee)>=128&&A("not-basic"),O.push(w.charCodeAt(ee));for(le=$>0?$+1:0;le=M&&A("invalid-input"),ye=g(w.charCodeAt(le++)),(ye>=s||ye>R((r-K)/he))&&A("overflow"),K+=ye*he,Ge=Ze<=H?a:Ze>=H+c?c:Ze-H,!(yeR(r/Ae)&&A("overflow"),he*=Ae;z=O.length+1,H=G(K-_e,z,_e==0),R(K/z)>r-te&&A("overflow"),te+=R(K/z),K%=z,O.splice(K++,0,te)}return N(O)}function X(w){var O,M,z,K,te,H,$,ee,le,_e,he,Ze=[],ye,Ge,Ae,Fe;for(w=I(w),ye=w.length,O=p,M=0,te=m,H=0;H=O&&he<$&&($=he);for(Ge=z+1,$-O>R((r-M)/Ge)&&A("overflow"),M+=($-O)*Ge,O=$,H=0;Hr&&A("overflow"),he==O){for(ee=M,le=s;_e=le<=te?a:le>=te+c?c:le-te,!(ee<_e);le+=s)Fe=ee-_e,Ae=s-_e,Ze.push(C(V(_e+Fe%Ae,0))),ee=R(Fe/Ae);Ze.push(C(V(ee,0))),te=G(M,Ge,z==K),M=0,++z}++M,++O}return Ze.join("")}function Y(w){return F(w,function(O){return f.test(O)?v(O.slice(4).toLowerCase()):O})}function D(w){return F(w,function(O){return y.test(O)?"xn--"+X(O):O})}if(o={version:"1.3.2",ucs2:{decode:I,encode:N},decode:v,encode:X,toASCII:D,toUnicode:Y},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(JR.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(KR)});var Yle=gm((Nle,rD)=>{var qzt=x(T());/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ var Cesium=(()=>{var u1e=Object.create;var nN=Object.defineProperty;var m1e=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof ZN=="object"&&ZN.exports?ZN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Kq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,l=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&&(l=7);var d;for(d=0;d1);p++)u.splice(0,1);s[f]=u.join("")}var y=-1,h=0,g=0,x=-1,S=!1;for(f=0;fh&&(y=x,h=g)):s[f]==="0"&&(S=!0,x=f,g=1);g>h&&(y=x,h=g),h>1&&s.splice(y,h,""),a=s.length;var V="";for(s[0]===""&&(V=":"),f=0;f{var uGt=_(T());/*! + */(function(e,t){"use strict";typeof rD=="object"&&rD.exports?rD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Nle,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;d1);p++)u.splice(0,1);s[m]=u.join("")}var b=-1,f=0,y=0,_=-1,S=!1;for(m=0;mf&&(b=_,f=y)):s[m]==="0"&&(S=!0,_=m,y=1);y>f&&(b=_,f=y),f>1&&s.splice(b,f,""),a=s.length;var Z="";for(s[0]===""&&(Z=":"),m=0;m{var $zt=x(T());/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ var Cesium=(()=>{var u1e=Object.create;var nN=Object.defineProperty;var m1e=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof RN=="object"&&RN.exports?RN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Qq,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 cd=ad((qq,GN)=>{var mGt=_(T());/*! + */(function(e,t){"use strict";typeof sD=="object"&&sD.exports?sD.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(wle,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 bu=gm((kle,aD)=>{var eHt=x(T());/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,2349 +58,2364 @@ var Cesium=(()=>{var u1e=Object.create;var nN=Object.defineProperty;var m1e=Obje * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof GN=="object"&&GN.exports?GN.exports=t(zq(),Jq(),jq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(qq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(G,X){var W=arguments.length>=1,A=arguments.length>=2;if(!(this instanceof r))return W?A?new r(G,X):new r(G):new r;if(G===void 0){if(W)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?G=location.href+"":G=""}if(G===null&&W)throw new TypeError("null is not a valid argument for URI");return this.href(G),X!==void 0?this.absoluteTo(X):this}function s(G){return/^[0-9]+$/.test(G)}r.version="1.19.11";var a=r.prototype,l=Object.prototype.hasOwnProperty;function d(G){return G.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(G){return G===void 0?"Undefined":String(Object.prototype.toString.call(G)).slice(8,-1)}function f(G){return u(G)==="Array"}function p(G,X){var W={},A,k;if(u(X)==="RegExp")W=null;else if(f(X))for(A=0,k=X.length;A]+|\(([^\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(G){if(!(!G||!G.nodeName)){var X=G.nodeName.toLowerCase();if(!(X==="input"&&G.type!=="image"))return r.domAttributes[X]}};function x(G){return escape(G)}function S(G){return encodeURIComponent(G).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}r.encode=S,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=S,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(G,X){var W=r.encode(G+"");return X===void 0&&(X=r.escapeQuerySpace),X?W.replace(/%20/g,"+"):W},r.decodeQuery=function(G,X){G+="",X===void 0&&(X=r.escapeQuerySpace);try{return r.decode(X?G.replace(/\+/g,"%20"):G)}catch{return G}};var V={encode:"encode",decode:"decode"},Z,R=function(G,X){return function(W){try{return r[X](W+"").replace(r.characters[G][X].expression,function(A){return r.characters[G][X].map[A]})}catch{return W}}};for(Z in V)r[Z+"PathSegment"]=R("pathname",V[Z]),r[Z+"UrnPathSegment"]=R("urnpath",V[Z]);var E=function(G,X,W){return function(A){var k;W?k=function(U){return r[X](r[W](U))}:k=r[X];for(var B=(A+"").split(G),O=0,H=B.length;O-1&&(X.fragment=G.substring(W+1)||null,G=G.substring(0,W)),W=G.indexOf("?"),W>-1&&(X.query=G.substring(W+1)||null,G=G.substring(0,W)),G=G.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),G=G.replace(/^[/\\]{2,}/i,"//"),G.substring(0,2)==="//"?(X.protocol=null,G=G.substring(2),G=r.parseAuthority(G,X)):(W=G.indexOf(":"),W>-1&&(X.protocol=G.substring(0,W)||null,X.protocol&&!X.protocol.match(r.protocol_expression)?X.protocol=void 0:G.substring(W+1,W+3).replace(/\\/g,"/")==="//"?(G=G.substring(W+3),G=r.parseAuthority(G,X)):(G=G.substring(W+1),X.urn=!0))),X.path=G,X},r.parseHost=function(G,X){G||(G=""),G=G.replace(/\\/g,"/");var W=G.indexOf("/"),A,k;if(W===-1&&(W=G.length),G.charAt(0)==="[")A=G.indexOf("]"),X.hostname=G.substring(1,A)||null,X.port=G.substring(A+2,W)||null,X.port==="/"&&(X.port=null);else{var B=G.indexOf(":"),O=G.indexOf("/"),H=G.indexOf(":",B+1);H!==-1&&(O===-1||H-1?k:G.length-1),O;return B>-1&&(k===-1||B-1?j=j.slice(0,$)+j.slice($).replace(B,""):j=j.replace(B,""),!(j.length<=U[0].length)&&!(W.ignore&&W.ignore.test(j))){ie=K+j.length;var Ce=X(j,K,ie,G);if(Ce===void 0){A.lastIndex=ie;continue}Ce=String(Ce),G=G.slice(0,K)+Ce+G.slice(ie),A.lastIndex=K+Ce.length}}return A.lastIndex=0,G},r.ensureValidHostname=function(G,X){var W=!!G,A=!!X,k=!1;if(A&&(k=y(r.hostProtocols,X)),k&&!W)throw new TypeError("Hostname cannot be empty, if protocol is "+X);if(G&&G.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(G).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(G){if(G){var X=Number(G);if(!(s(X)&&X>0&&X<65536))throw new TypeError('Port "'+G+'" is not a valid port')}},r.noConflict=function(G){if(G){var X={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(X.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(X.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(X.SecondLevelDomains=i.SecondLevelDomains.noConflict()),X}else i.URI===this&&(i.URI=o);return this},a.build=function(G){return G===!0?this._deferred_build=!0:(G===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(G){return function(X,W){return X===void 0?this._parts[G]||"":(this._parts[G]=X||null,this.build(!W),this)}}function v(G,X){return function(W,A){return W===void 0?this._parts[G]||"":(W!==null&&(W=W+"",W.charAt(0)===X&&(W=W.substring(1))),this._parts[G]=W,this.build(!A),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(G,X){var W=this.query(G,X);return typeof W=="string"&&W.length?"?"+W:W},a.hash=function(G,X){var W=this.fragment(G,X);return typeof W=="string"&&W.length?"#"+W:W},a.pathname=function(G,X){if(G===void 0||G===!0){var W=this._parts.path||(this._parts.hostname?"/":"");return G?(this._parts.urn?r.decodeUrnPath:r.decodePath)(W):W}else return this._parts.urn?this._parts.path=G?r.recodeUrnPath(G):"":this._parts.path=G?r.recodePath(G):"/",this.build(!X),this},a.path=a.pathname,a.href=function(G,X){var W;if(G===void 0)return this.toString();this._string="",this._parts=r._parts();var A=G instanceof r,k=typeof G=="object"&&(G.hostname||G.path||G.pathname);if(G.nodeName){var B=r.getDomAttribute(G);G=G[B]||"",k=!1}if(!A&&k&&G.pathname!==void 0&&(G=G.toString()),typeof G=="string"||G instanceof String)this._parts=r.parse(String(G),this._parts);else if(A||k){var O=A?G._parts:G;for(W in O)W!=="query"&&l.call(this._parts,W)&&(this._parts[W]=O[W]);O.query&&this.query(O.query,!1)}else throw new TypeError("invalid input");return this.build(!X),this},a.is=function(G){var X=!1,W=!1,A=!1,k=!1,B=!1,O=!1,H=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,W=r.ip4_expression.test(this._parts.hostname),A=r.ip6_expression.test(this._parts.hostname),X=W||A,k=!X,B=k&&n&&n.has(this._parts.hostname),O=k&&r.idn_expression.test(this._parts.hostname),H=k&&r.punycode_expression.test(this._parts.hostname)),G.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return k;case"sld":return B;case"ip":return X;case"ip4":case"ipv4":case"inet4":return W;case"ip6":case"ipv6":case"inet6":return A;case"idn":return O;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return H}return null};var P=a.protocol,F=a.port,N=a.hostname;a.protocol=function(G,X){if(G&&(G=G.replace(/:(\/\/)?$/,""),!G.match(r.protocol_expression)))throw new TypeError('Protocol "'+G+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,G,X)},a.scheme=a.protocol,a.port=function(G,X){return this._parts.urn?G===void 0?"":this:(G!==void 0&&(G===0&&(G=null),G&&(G+="",G.charAt(0)===":"&&(G=G.substring(1)),r.ensureValidPort(G))),F.call(this,G,X))},a.hostname=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G!==void 0){var W={preventInvalidHostname:this._parts.preventInvalidHostname},A=r.parseHost(G,W);if(A!=="/")throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-]');G=W.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(G,this._parts.protocol)}return N.call(this,G,X)},a.origin=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0){var W=this.protocol(),A=this.authority();return A?(W?W+"://":"")+this.authority():""}else{var k=r(G);return this.protocol(k.protocol()).authority(k.authority()).build(!X),this}},a.host=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var W=r.parseHost(G,this._parts);if(W!=="/")throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-]');return this.build(!X),this},a.authority=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var W=r.parseAuthority(G,this._parts);if(W!=="/")throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-]');return this.build(!X),this},a.userinfo=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0){var W=r.buildUserinfo(this._parts);return W&&W.substring(0,W.length-1)}else return G[G.length-1]!=="@"&&(G+="@"),r.parseUserinfo(G,this._parts),this.build(!X),this},a.resource=function(G,X){var W;return G===void 0?this.path()+this.search()+this.hash():(W=r.parse(G),this._parts.path=W.path,this._parts.query=W.query,this._parts.fragment=W.fragment,this.build(!X),this)},a.subdomain=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0){if(!this._parts.hostname||this.is("IP"))return"";var W=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,W)||""}else{var A=this._parts.hostname.length-this.domain().length,k=this._parts.hostname.substring(0,A),B=new RegExp("^"+d(k));if(G&&G.charAt(G.length-1)!=="."&&(G+="."),G.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return G&&r.ensureValidHostname(G,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(B,G),this.build(!X),this}},a.domain=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(typeof G=="boolean"&&(X=G,G=void 0),G===void 0){if(!this._parts.hostname||this.is("IP"))return"";var W=this._parts.hostname.match(/\./g);if(W&&W.length<2)return this._parts.hostname;var A=this._parts.hostname.length-this.tld(X).length-1;return A=this._parts.hostname.lastIndexOf(".",A-1)+1,this._parts.hostname.substring(A)||""}else{if(!G)throw new TypeError("cannot set domain empty");if(G.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(G,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=G;else{var k=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(k,G)}return this.build(!X),this}},a.tld=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(typeof G=="boolean"&&(X=G,G=void 0),G===void 0){if(!this._parts.hostname||this.is("IP"))return"";var W=this._parts.hostname.lastIndexOf("."),A=this._parts.hostname.substring(W+1);return X!==!0&&n&&n.list[A.toLowerCase()]&&n.get(this._parts.hostname)||A}else{var k;if(G)if(G.match(/[^a-zA-Z0-9-]/))if(n&&n.is(G))k=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,G);else throw new TypeError('TLD "'+G+'" 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");k=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,G)}else throw new TypeError("cannot set TLD empty");return this.build(!X),this}},a.directory=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0||G===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var W=this._parts.path.length-this.filename().length-1,A=this._parts.path.substring(0,W)||(this._parts.hostname?"/":"");return G?r.decodePath(A):A}else{var k=this._parts.path.length-this.filename().length,B=this._parts.path.substring(0,k),O=new RegExp("^"+d(B));return this.is("relative")||(G||(G="/"),G.charAt(0)!=="/"&&(G="/"+G)),G&&G.charAt(G.length-1)!=="/"&&(G+="/"),G=r.recodePath(G),this._parts.path=this._parts.path.replace(O,G),this.build(!X),this}},a.filename=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(typeof G!="string"){if(!this._parts.path||this._parts.path==="/")return"";var W=this._parts.path.lastIndexOf("/"),A=this._parts.path.substring(W+1);return G?r.decodePathSegment(A):A}else{var k=!1;G.charAt(0)==="/"&&(G=G.substring(1)),G.match(/\.?\//)&&(k=!0);var B=new RegExp(d(this.filename())+"$");return G=r.recodePath(G),this._parts.path=this._parts.path.replace(B,G),k?this.normalizePath(X):this.build(!X),this}},a.suffix=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0||G===!0){if(!this._parts.path||this._parts.path==="/")return"";var W=this.filename(),A=W.lastIndexOf("."),k,B;return A===-1?"":(k=W.substring(A+1),B=/^[a-z0-9%]+$/i.test(k)?k:"",G?r.decodePathSegment(B):B)}else{G.charAt(0)==="."&&(G=G.substring(1));var O=this.suffix(),H;if(O)G?H=new RegExp(d(O)+"$"):H=new RegExp(d("."+O)+"$");else{if(!G)return this;this._parts.path+="."+r.recodePath(G)}return H&&(G=r.recodePath(G),this._parts.path=this._parts.path.replace(H,G)),this.build(!X),this}},a.segment=function(G,X,W){var A=this._parts.urn?":":"/",k=this.path(),B=k.substring(0,1)==="/",O=k.split(A);if(G!==void 0&&typeof G!="number"&&(W=X,X=G,G=void 0),G!==void 0&&typeof G!="number")throw new Error('Bad segment "'+G+'", must be 0-based integer');if(B&&O.shift(),G<0&&(G=Math.max(O.length+G,0)),X===void 0)return G===void 0?O:O[G];if(G===null||O[G]===void 0)if(f(X)){O=[];for(var H=0,U=X.length;H{"use strict";var Kkn=_(T());mle.exports=mKe;var Dw=1e20;function mKe(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,l,d,u,f,p,y,h,g;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,l=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,f=p.getContext("2d"),r=p.width,s=p.height,y=f.getImageData(0,0,r,s),l=y.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,f=e,r=p.width,s=p.height,y=f.getImageData(0,0,r,s),l=y.data,u=4):window.ImageData&&e instanceof window.ImageData&&(y=e,r=e.width,s=e.height,l=y.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(d=l,l=Array(r*s),h=0,g=Math.floor(d.length/u);h{var pUn=_(T());function CKe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,l=8,d=9,u=10,f=11,p=12,y=13,h=14,g=15,x=16,S=17,V=0,Z=1,R=2,E=3,I=4;function v(b,G){return 55296<=b.charCodeAt(G)&&b.charCodeAt(G)<=56319&&56320<=b.charCodeAt(G+1)&&b.charCodeAt(G+1)<=57343}function P(b,G){G===void 0&&(G=0);var X=b.charCodeAt(G);if(55296<=X&&X<=56319&&G=1){var W=b.charCodeAt(G-1),A=X;return 55296<=W&&W<=56319?(W-55296)*1024+(A-56320)+65536:A}return X}function F(b,G,X){var W=[b].concat(G).concat([X]),A=W[W.length-2],k=X,B=W.lastIndexOf(h);if(B>1&&W.slice(1,B).every(function(U){return U==i})&&[i,y,S].indexOf(b)==-1)return R;var O=W.lastIndexOf(o);if(O>0&&W.slice(1,O).every(function(U){return U==o})&&[p,o].indexOf(A)==-1)return W.filter(function(U){return U==o}).length%2==1?E:I;if(A==e&&k==t)return V;if(A==n||A==e||A==t)return k==h&&G.every(function(U){return U==i})?R:Z;if(k==n||k==e||k==t)return Z;if(A==s&&(k==s||k==a||k==d||k==u))return V;if((A==d||A==a)&&(k==a||k==l))return V;if((A==u||A==l)&&k==l)return V;if(k==i||k==g)return V;if(k==r)return V;if(A==p)return V;var H=W.indexOf(i)!=-1?W.lastIndexOf(i)-1:W.length-2;return[y,S].indexOf(W[H])!=-1&&W.slice(H+1,-1).every(function(U){return U==i})&&k==h||A==g&&[x,S].indexOf(k)!=-1?V:G.indexOf(o)!=-1?R:A==o&&k==o?V:Z}this.nextBreak=function(b,G){if(G===void 0&&(G=0),G<0)return 0;if(G>=b.length-1)return b.length;for(var X=N(P(b,G)),W=[],A=G+1;A{var Jhi=_(T());(function(e,t){typeof NJ=="object"&&typeof kJ<"u"?kJ.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(NJ,function(){"use strict";function e(x,S,V,Z,R){(function E(I,v,P,F,N){for(;F>P;){if(F-P>600){var b=F-P+1,G=v-P+1,X=Math.log(b),W=.5*Math.exp(2*X/3),A=.5*Math.sqrt(X*W*(b-W)/b)*(G-b/2<0?-1:1),k=Math.max(P,Math.floor(v-G*W/b+A)),B=Math.min(F,Math.floor(v+(b-G)*W/b+A));E(I,v,k,B,N)}var O=I[v],H=P,U=F;for(t(I,P,v),N(I[F],O)>0&&t(I,P,F);H0;)U--}N(I[P],O)===0?t(I,P,U):t(I,++U,F),U<=v&&(P=U+1),v<=U&&(F=U-1)}})(x,S,V||0,Z||x.length-1,R||n)}function t(x,S,V){var Z=x[S];x[S]=x[V],x[V]=Z}function n(x,S){return xS?1:0}var i=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(x,S,V){if(!V)return S.indexOf(x);for(var Z=0;Z=x.minX&&S.maxY>=x.minY}function h(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(x,S,V,Z,R){for(var E=[S,V];E.length;)if(!((V=E.pop())-(S=E.pop())<=Z)){var I=S+Math.ceil((V-S)/Z/2)*Z;e(x,I,S,V,R),E.push(S,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var S=this.data,V=[];if(!y(x,S))return V;for(var Z=this.toBBox,R=[];S;){for(var E=0;E=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(Z,R,S)},i.prototype._split=function(x,S){var V=x[S],Z=V.children.length,R=this._minEntries;this._chooseSplitAxis(V,R,Z);var E=this._chooseSplitIndex(V,R,Z),I=h(V.children.splice(E,V.children.length-E));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),S?x[S-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(x,S){this.data=h([x,S]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,S,V){for(var Z,R,E,I,v,P,F,N=1/0,b=1/0,G=S;G<=V-S;G++){var X=s(x,0,G,this.toBBox),W=s(x,G,V,this.toBBox),A=(R=X,E=W,I=void 0,v=void 0,P=void 0,F=void 0,I=Math.max(R.minX,E.minX),v=Math.max(R.minY,E.minY),P=Math.min(R.maxX,E.maxX),F=Math.min(R.maxY,E.maxY),Math.max(0,P-I)*Math.max(0,F-v)),k=u(X)+u(W);A=S;N--){var b=x.children[N];a(I,x.leaf?R(b):b),v+=f(I)}return v},i.prototype._adjustParentBBoxes=function(x,S,V){for(var Z=V;Z>=0;Z--)a(S[Z],x)},i.prototype._condense=function(x){for(var S=x.length-1,V=void 0;S>=0;S--)x[S].children.length===0?S>0?(V=x[S-1].children).splice(V.indexOf(x[S]),1):this.clear():r(x[S],this.toBBox)},i})});var _7=ad((exports,module)=>{var _io=_(T());/*! - * protobuf.js v7.4.0 (c) 2016, daniel wirtz - * compiled thu, 22 aug 2024 20:30:39 utc + */(function(e,t){"use strict";typeof aD=="object"&&aD.exports?aD.exports=t(Xle(),Yle(),Mle()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(kle,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(V,G){var v=arguments.length>=1,X=arguments.length>=2;if(!(this instanceof r))return v?X?new r(V,G):new r(V):new r;if(V===void 0){if(v)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?V=location.href+"":V=""}if(V===null&&v)throw new TypeError("null is not a valid argument for URI");return this.href(V),G!==void 0?this.absoluteTo(G):this}function s(V){return/^[0-9]+$/.test(V)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(V){return V.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(V){return V===void 0?"Undefined":String(Object.prototype.toString.call(V)).slice(8,-1)}function m(V){return u(V)==="Array"}function p(V,G){var v={},X,Y;if(u(G)==="RegExp")v=null;else if(m(G))for(X=0,Y=G.length;X]+|\(([^\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(V){if(!(!V||!V.nodeName)){var G=V.nodeName.toLowerCase();if(!(G==="input"&&V.type!=="image"))return r.domAttributes[G]}};function _(V){return escape(V)}function S(V){return encodeURIComponent(V).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=S,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=S,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(V,G){var v=r.encode(V+"");return G===void 0&&(G=r.escapeQuerySpace),G?v.replace(/%20/g,"+"):v},r.decodeQuery=function(V,G){V+="",G===void 0&&(G=r.escapeQuerySpace);try{return r.decode(G?V.replace(/\+/g,"%20"):V)}catch{return V}};var Z={encode:"encode",decode:"decode"},R,C=function(V,G){return function(v){try{return r[G](v+"").replace(r.characters[V][G].expression,function(X){return r.characters[V][G].map[X]})}catch{return v}}};for(R in Z)r[R+"PathSegment"]=C("pathname",Z[R]),r[R+"UrnPathSegment"]=C("urnpath",Z[R]);var E=function(V,G,v){return function(X){var Y;v?Y=function(M){return r[G](r[v](M))}:Y=r[G];for(var D=(X+"").split(V),w=0,O=D.length;w-1&&(G.fragment=V.substring(v+1)||null,V=V.substring(0,v)),v=V.indexOf("?"),v>-1&&(G.query=V.substring(v+1)||null,V=V.substring(0,v)),V=V.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),V=V.replace(/^[/\\]{2,}/i,"//"),V.substring(0,2)==="//"?(G.protocol=null,V=V.substring(2),V=r.parseAuthority(V,G)):(v=V.indexOf(":"),v>-1&&(G.protocol=V.substring(0,v)||null,G.protocol&&!G.protocol.match(r.protocol_expression)?G.protocol=void 0:V.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(V=V.substring(v+3),V=r.parseAuthority(V,G)):(V=V.substring(v+1),G.urn=!0))),G.path=V,G},r.parseHost=function(V,G){V||(V=""),V=V.replace(/\\/g,"/");var v=V.indexOf("/"),X,Y;if(v===-1&&(v=V.length),V.charAt(0)==="[")X=V.indexOf("]"),G.hostname=V.substring(1,X)||null,G.port=V.substring(X+2,v)||null,G.port==="/"&&(G.port=null);else{var D=V.indexOf(":"),w=V.indexOf("/"),O=V.indexOf(":",D+1);O!==-1&&(w===-1||O-1?Y:V.length-1),w;return D>-1&&(Y===-1||D-1?H=H.slice(0,$)+H.slice($).replace(D,""):H=H.replace(D,""),!(H.length<=M[0].length)&&!(v.ignore&&v.ignore.test(H))){te=z+H.length;var _e=G(H,z,te,V);if(_e===void 0){X.lastIndex=te;continue}_e=String(_e),V=V.slice(0,z)+_e+V.slice(te),X.lastIndex=z+_e.length}}return X.lastIndex=0,V},r.ensureValidHostname=function(V,G){var v=!!V,X=!!G,Y=!1;if(X&&(Y=b(r.hostProtocols,G)),Y&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+G);if(V&&V.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(V).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(V){if(V){var G=Number(V);if(!(s(G)&&G>0&&G<65536))throw new TypeError('Port "'+V+'" is not a valid port')}},r.noConflict=function(V){if(V){var G={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(G.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(G.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(G.SecondLevelDomains=i.SecondLevelDomains.noConflict()),G}else i.URI===this&&(i.URI=o);return this},a.build=function(V){return V===!0?this._deferred_build=!0:(V===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 A(V){return function(G,v){return G===void 0?this._parts[V]||"":(this._parts[V]=G||null,this.build(!v),this)}}function L(V,G){return function(v,X){return v===void 0?this._parts[V]||"":(v!==null&&(v=v+"",v.charAt(0)===G&&(v=v.substring(1))),this._parts[V]=v,this.build(!X),this)}}a.protocol=A("protocol"),a.username=A("username"),a.password=A("password"),a.hostname=A("hostname"),a.port=A("port"),a.query=L("query","?"),a.fragment=L("fragment","#"),a.search=function(V,G){var v=this.query(V,G);return typeof v=="string"&&v.length?"?"+v:v},a.hash=function(V,G){var v=this.fragment(V,G);return typeof v=="string"&&v.length?"#"+v:v},a.pathname=function(V,G){if(V===void 0||V===!0){var v=this._parts.path||(this._parts.hostname?"/":"");return V?(this._parts.urn?r.decodeUrnPath:r.decodePath)(v):v}else return this._parts.urn?this._parts.path=V?r.recodeUrnPath(V):"":this._parts.path=V?r.recodePath(V):"/",this.build(!G),this},a.path=a.pathname,a.href=function(V,G){var v;if(V===void 0)return this.toString();this._string="",this._parts=r._parts();var X=V instanceof r,Y=typeof V=="object"&&(V.hostname||V.path||V.pathname);if(V.nodeName){var D=r.getDomAttribute(V);V=V[D]||"",Y=!1}if(!X&&Y&&V.pathname!==void 0&&(V=V.toString()),typeof V=="string"||V instanceof String)this._parts=r.parse(String(V),this._parts);else if(X||Y){var w=X?V._parts:V;for(v in w)v!=="query"&&c.call(this._parts,v)&&(this._parts[v]=w[v]);w.query&&this.query(w.query,!1)}else throw new TypeError("invalid input");return this.build(!G),this},a.is=function(V){var G=!1,v=!1,X=!1,Y=!1,D=!1,w=!1,O=!1,M=!this._parts.urn;switch(this._parts.hostname&&(M=!1,v=r.ip4_expression.test(this._parts.hostname),X=r.ip6_expression.test(this._parts.hostname),G=v||X,Y=!G,D=Y&&n&&n.has(this._parts.hostname),w=Y&&r.idn_expression.test(this._parts.hostname),O=Y&&r.punycode_expression.test(this._parts.hostname)),V.toLowerCase()){case"relative":return M;case"absolute":return!M;case"domain":case"name":return Y;case"sld":return D;case"ip":return G;case"ip4":case"ipv4":case"inet4":return v;case"ip6":case"ipv6":case"inet6":return X;case"idn":return w;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return O}return null};var F=a.protocol,I=a.port,N=a.hostname;a.protocol=function(V,G){if(V&&(V=V.replace(/:(\/\/)?$/,""),!V.match(r.protocol_expression)))throw new TypeError('Protocol "'+V+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return F.call(this,V,G)},a.scheme=a.protocol,a.port=function(V,G){return this._parts.urn?V===void 0?"":this:(V!==void 0&&(V===0&&(V=null),V&&(V+="",V.charAt(0)===":"&&(V=V.substring(1)),r.ensureValidPort(V))),I.call(this,V,G))},a.hostname=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V!==void 0){var v={preventInvalidHostname:this._parts.preventInvalidHostname},X=r.parseHost(V,v);if(X!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');V=v.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(V,this._parts.protocol)}return N.call(this,V,G)},a.origin=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){var v=this.protocol(),X=this.authority();return X?(v?v+"://":"")+this.authority():""}else{var Y=r(V);return this.protocol(Y.protocol()).authority(Y.authority()).build(!G),this}},a.host=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var v=r.parseHost(V,this._parts);if(v!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.authority=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var v=r.parseAuthority(V,this._parts);if(v!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.userinfo=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){var v=r.buildUserinfo(this._parts);return v&&v.substring(0,v.length-1)}else return V[V.length-1]!=="@"&&(V+="@"),r.parseUserinfo(V,this._parts),this.build(!G),this},a.resource=function(V,G){var v;return V===void 0?this.path()+this.search()+this.hash():(v=r.parse(V),this._parts.path=v.path,this._parts.query=v.query,this._parts.fragment=v.fragment,this.build(!G),this)},a.subdomain=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,v)||""}else{var X=this._parts.hostname.length-this.domain().length,Y=this._parts.hostname.substring(0,X),D=new RegExp("^"+d(Y));if(V&&V.charAt(V.length-1)!=="."&&(V+="."),V.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return V&&r.ensureValidHostname(V,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(D,V),this.build(!G),this}},a.domain=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V=="boolean"&&(G=V,V=void 0),V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.match(/\./g);if(v&&v.length<2)return this._parts.hostname;var X=this._parts.hostname.length-this.tld(G).length-1;return X=this._parts.hostname.lastIndexOf(".",X-1)+1,this._parts.hostname.substring(X)||""}else{if(!V)throw new TypeError("cannot set domain empty");if(V.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(V,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=V;else{var Y=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(Y,V)}return this.build(!G),this}},a.tld=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V=="boolean"&&(G=V,V=void 0),V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.lastIndexOf("."),X=this._parts.hostname.substring(v+1);return G!==!0&&n&&n.list[X.toLowerCase()]&&n.get(this._parts.hostname)||X}else{var Y;if(V)if(V.match(/[^a-zA-Z0-9-]/))if(n&&n.is(V))Y=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(Y,V);else throw new TypeError('TLD "'+V+'" 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");Y=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(Y,V)}else throw new TypeError("cannot set TLD empty");return this.build(!G),this}},a.directory=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0||V===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var v=this._parts.path.length-this.filename().length-1,X=this._parts.path.substring(0,v)||(this._parts.hostname?"/":"");return V?r.decodePath(X):X}else{var Y=this._parts.path.length-this.filename().length,D=this._parts.path.substring(0,Y),w=new RegExp("^"+d(D));return this.is("relative")||(V||(V="/"),V.charAt(0)!=="/"&&(V="/"+V)),V&&V.charAt(V.length-1)!=="/"&&(V+="/"),V=r.recodePath(V),this._parts.path=this._parts.path.replace(w,V),this.build(!G),this}},a.filename=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V!="string"){if(!this._parts.path||this._parts.path==="/")return"";var v=this._parts.path.lastIndexOf("/"),X=this._parts.path.substring(v+1);return V?r.decodePathSegment(X):X}else{var Y=!1;V.charAt(0)==="/"&&(V=V.substring(1)),V.match(/\.?\//)&&(Y=!0);var D=new RegExp(d(this.filename())+"$");return V=r.recodePath(V),this._parts.path=this._parts.path.replace(D,V),Y?this.normalizePath(G):this.build(!G),this}},a.suffix=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0||V===!0){if(!this._parts.path||this._parts.path==="/")return"";var v=this.filename(),X=v.lastIndexOf("."),Y,D;return X===-1?"":(Y=v.substring(X+1),D=/^[a-z0-9%]+$/i.test(Y)?Y:"",V?r.decodePathSegment(D):D)}else{V.charAt(0)==="."&&(V=V.substring(1));var w=this.suffix(),O;if(w)V?O=new RegExp(d(w)+"$"):O=new RegExp(d("."+w)+"$");else{if(!V)return this;this._parts.path+="."+r.recodePath(V)}return O&&(V=r.recodePath(V),this._parts.path=this._parts.path.replace(O,V)),this.build(!G),this}},a.segment=function(V,G,v){var X=this._parts.urn?":":"/",Y=this.path(),D=Y.substring(0,1)==="/",w=Y.split(X);if(V!==void 0&&typeof V!="number"&&(v=G,G=V,V=void 0),V!==void 0&&typeof V!="number")throw new Error('Bad segment "'+V+'", must be 0-based integer');if(D&&w.shift(),V<0&&(V=Math.max(w.length+V,0)),G===void 0)return V===void 0?w:w[V];if(V===null||w[V]===void 0)if(m(G)){w=[];for(var O=0,M=G.length;O{"use strict";var Sli=x(T());oTe.exports=Tat;var gX=1e20;function Tat(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,m,p,b,f,y;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,m=p.getContext("2d"),r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,u=4):window.ImageData&&e instanceof window.ImageData&&(b=e,r=e.width,s=e.height,c=b.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,y=Math.floor(d.length/u);f{var Uli=x(T());function Lat(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,m=11,p=12,b=13,f=14,y=15,_=16,S=17,Z=0,R=1,C=2,E=3,A=4;function L(g,V){return 55296<=g.charCodeAt(V)&&g.charCodeAt(V)<=56319&&56320<=g.charCodeAt(V+1)&&g.charCodeAt(V+1)<=57343}function F(g,V){V===void 0&&(V=0);var G=g.charCodeAt(V);if(55296<=G&&G<=56319&&V=1){var v=g.charCodeAt(V-1),X=G;return 55296<=v&&v<=56319?(v-55296)*1024+(X-56320)+65536:X}return G}function I(g,V,G){var v=[g].concat(V).concat([G]),X=v[v.length-2],Y=G,D=v.lastIndexOf(f);if(D>1&&v.slice(1,D).every(function(M){return M==i})&&[i,b,S].indexOf(g)==-1)return C;var w=v.lastIndexOf(o);if(w>0&&v.slice(1,w).every(function(M){return M==o})&&[p,o].indexOf(X)==-1)return v.filter(function(M){return M==o}).length%2==1?E:A;if(X==e&&Y==t)return Z;if(X==n||X==e||X==t)return Y==f&&V.every(function(M){return M==i})?C:R;if(Y==n||Y==e||Y==t)return R;if(X==s&&(Y==s||Y==a||Y==d||Y==u))return Z;if((X==d||X==a)&&(Y==a||Y==c))return Z;if((X==u||X==c)&&Y==c)return Z;if(Y==i||Y==y)return Z;if(Y==r)return Z;if(X==p)return Z;var O=v.indexOf(i)!=-1?v.lastIndexOf(i)-1:v.length-2;return[b,S].indexOf(v[O])!=-1&&v.slice(O+1,-1).every(function(M){return M==i})&&Y==f||X==y&&[_,S].indexOf(Y)!=-1?Z:V.indexOf(o)!=-1?C:X==o&&Y==o?Z:R}this.nextBreak=function(g,V){if(V===void 0&&(V=0),V<0)return 0;if(V>=g.length-1)return g.length;for(var G=N(F(g,V)),v=[],X=V+1;X{PBi=x(T(),1),wee=new Date(2107,11,31,23,59,58),iE=new Date(1980,0,1),ke=void 0,hZ=1/0,Qd="undefined",Yr="function",FCe="object",fZ="string",ICe="number",PCe="boolean",yo=new Uint8Array});function rE(e){if(e&&typeof e!=Yr)throw new Error(fVe);return e}function D3(e){if(e&&(typeof e.addEventListener!=Yr||typeof e.aborted!=PCe))throw new Error(pVe);return e||ke}function O3(e,t){if(e&&typeof e!=fZ||t&&!(t instanceof Uint8Array))throw new Error(Uee)}function Dee(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function sE(e,t,n){e!==ke&&Dee(e,t,n)}function pZ(e){return typeof e==fZ&&e.trim()?Number(e):e}var YBi,XCe,NCe,YCe,wCe,MCe,v3,F3,I3,P3,kCe,UCe,DCe,OCe,BCe,zCe,HCe,KCe,X3,N3,Y3,w3,JCe,jCe,QCe,qCe,$Ce,eVe,tVe,nVe,iVe,Mee,oVe,rVe,jY,oE,sVe,aVe,cVe,lVe,dVe,uVe,kee,mVe,hVe,M3,k3,$x,U3,Pg,fVe,pVe,Uee,QY=Xs(()=>{YBi=x(T(),1);bc();XCe="filenameEncoding",NCe="commentEncoding",YCe="decodeText",wCe="extractPrependedData",MCe="extractAppendedData",v3="password",F3="rawPassword",I3="passThrough",P3="signal",kCe="checkPasswordOnly",UCe="checkOverlappingEntryOnly",DCe="checkOverlappingEntry",OCe="checkAmbiguity",BCe="checkLocalDirectory",zCe="checkSignature",HCe="checkCrc32",KCe="checkAuthenticationCode",X3="useWebWorkers",N3="useCompressionStream",Y3="transferStreams",w3="preventClose",JCe="encryptionStrength",jCe="extendedTimestamp",QCe="ntfsTimestamp",qCe="keepOrder",$Ce="level",eVe="bufferedWrite",tVe="createTempStream",nVe="dataDescriptorSignature",iVe="useUnicodeFileNames",Mee="dataDescriptor",oVe="supportZip64SplitFile",rVe="encodeText",jY="offset",oE="usdz",sVe="unixExtraFieldType",aVe="localExtraField",cVe="centralExtraField",lVe="strictness",dVe="filenameValidation",uVe="normalizeFilename",kee="maxAppendedDataSize",mVe="decryptCentralDirectory",hVe="signCentralDirectory",M3="filename",k3="comment",$x="strict",U3="balanced",Pg="tolerant",fVe="Invalid option (must be a function)",pVe="Invalid signal (must be an AbortSignal instance)",Uee="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function Xg(){return Oee}function qY(e){return Bee(e.chunkSize)}function Bee(e){return e=pZ(e),Number.isInteger(e)&&e>=gVe?Math.max(e,jyt):bVe}function $Y(e){Object.assign(Oee,RVe(CVe(e)))}function RVe(e){let t={};for(let n of $yt){let i=e[n];i!==ke&&(t[n]=ext(n,i))}return t}function ext(e,t){if(SVe.includes(e)){if(t=pZ(t),e==_Ve&&(!Number.isInteger(t)||t{UBi=x(T(),1);bc();QY();bVe=64*1024,jyt=64,gVe=1,yVe="Invalid maxWorkers (must be an integer greater than 0)",xVe=2;try{typeof navigator!=Qd&&navigator.hardwareConcurrency&&(xVe=navigator.hardwareConcurrency)}catch{}TVe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:bVe,maxWorkers:xVe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=Qd&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Qd&&DecompressionStream},_Ve="maxWorkers",Qyt=["baseURI","wasmURI","workerURI"],qyt=["useCompressionStream","useWebWorkers","transferStreams"],SVe=["chunkSize",_Ve,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],ZVe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],$yt=[...Qyt,...qyt,...SVe,...ZVe],Oee={...TVe}});function uh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function B3(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function hi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var OBi,bZ=Xs(()=>{OBi=x(T(),1)});var zBi,ew,VVe,txt,nxt,ixt,oxt,rxt,sxt,axt,Mf,tw=Xs(()=>{zBi=x(T(),1),ew=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;ew[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=ew[t-1][e];ew[t][e]=n>>>8^ew[0][n&255]}[VVe,txt,nxt,ixt,oxt,rxt,sxt,axt]=ew,Mf=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,o=0;if(i>=8&&t.buffer){let r=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;o<=s;o+=8){let a=n^r.getInt32(o,!0),c=r.getInt32(o+4,!0);n=axt[a&255]^sxt[a>>>8&255]^rxt[a>>>16&255]^oxt[a>>>24&255]^ixt[c&255]^nxt[c>>>8&255]^txt[c>>>16&255]^VVe[c>>>24&255]}}for(;o>>8^VVe[(n^t[o])&255];this.crc=n}get(){return~this.crc}}});var JBi,nw,EVe=Xs(()=>{JBi=x(T(),1);tw();nw=class extends TransformStream{constructor(){let t,n=new Mf;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}}});function cE(e){if(typeof TextEncoder==Qd){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n{qBi=x(T(),1);bc()});var e3i,ud,iw,AVe,Hee,Kee,eT,GVe=Xs(()=>{e3i=x(T(),1),ud={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=ud.getPartial(n);return i===32?e.concat(t):ud._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+ud.getPartial(n)},clamp(e,t){if(e.length*320&&t&&(e[n-1]=ud.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>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=ud.getPartial(o);return i.push(ud.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},iw={bytes:{fromBits(e){let n=ud.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)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=ud.concat(t,[ud.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<>>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}};Hee={};Hee.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 m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[u]=m,i[m]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,b=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=b=b<<24^b>>>8,t[f][m]=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],m=e[0]^n[0],p=e[t?3:1]^n[1],b=e[2]^n[2],f=e[t?1:3]^n[3],y=4,_,S,Z;for(let R=0;R>>24]^a[p>>16&255]^c[b>>8&255]^d[f&255]^n[y],S=s[p>>>24]^a[b>>16&255]^c[f>>8&255]^d[m&255]^n[y+1],Z=s[b>>>24]^a[f>>16&255]^c[m>>8&255]^d[p&255]^n[y+2],f=s[f>>>24]^a[m>>16&255]^c[p>>8&255]^d[b&255]^n[y+3],y+=4,m=_,p=S,b=Z;for(let R=0;R<4;R++)o[t?3&-R:R]=u[m>>>24]<<24^u[p>>16&255]<<16^u[b>>8&255]<<8^u[f&255]^n[y++],_=m,m=p,p=b,b=f,f=_;return o}};Kee={};Kee.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=ud.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),m=new DataView(u),p=0,b=ud;for(t=iw.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(b.concat(t,[d])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;r{a3i=x(T(),1);bc();cxt=typeof crypto!=Qd&&typeof crypto.getRandomValues==Yr,h0="Invalid password",tT="Invalid signature",nT=tT,Ng="zipjs-abort-check-password",lE="Crypto API not supported"});function IVe(e,t,n,i){Object.assign(e,{ready:new Promise(o=>e.resolveReady=o),password:Sxt(t,n),strength:i-1,pendingInput:yo})}function PVe(e,t,n,i,o,r){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=uh(c,t));let d=t.length-o;n=Zxt(n,i+(d-d%dE));let u;for(u=0;u<=d-dE;u+=dE){let m=aw(f0,mh(t,u,u+dE));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(sw(f0,p),u+i)}return e.pendingInput=mh(t,u),n}async function yxt(e,t,n,i){let o=await XVe(e,t,n,mh(i,0,rw[t])),r=mh(i,rw[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(h0)}async function xxt(e,t,n){let i=z3(new Uint8Array(rw[t])),o=await XVe(e,t,n,i);return uh(i,o)}async function XVe(e,t,n,i){e.password=null;let o=await Txt(lxt,n,mxt,!1,hxt),r=await _xt(Object.assign({salt:i},Jee),o,8*(ow[t]*2+2)),s=new Uint8Array(r),a=aw(f0,mh(s,0,ow[t])),c=aw(f0,mh(s,ow[t],ow[t]*2)),d=mh(s,ow[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new bxt(new pxt(a),Array.from(fxt)),hmac:new gxt(c)}),d}async function Txt(e,t,n,i,o){if(LVe)try{return await cw.importKey(e,t,n,i,o)}catch{return LVe=!1,eT.importKey(t)}else return eT.importKey(t)}async function _xt(e,t,n){if(WVe)try{return await cw.deriveBits(e,t,n)}catch{return WVe=!1,eT.pbkdf2(t,e.salt,Jee.iterations,n)}else return eT.pbkdf2(t,e.salt,Jee.iterations,n)}function Sxt(e,t){return t===ke?cE(e):t}function Zxt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function mh(e,t,n){return e.subarray(t,n)}function sw(e,t){return e.fromBits(t)}function aw(e,t){return e.toBits(t)}var f3i,dE,lxt,vVe,dxt,uxt,mxt,Jee,hxt,rw,ow,Yg,fxt,j3,cw,FVe,f0,pxt,bxt,gxt,LVe,WVe,K3,J3,NVe=Xs(()=>{f3i=x(T(),1);bc();zee();bZ();GVe();H3();dE=16,lxt="raw",vVe={name:"PBKDF2"},dxt={name:"HMAC"},uxt="SHA-1",mxt=Object.assign({hash:dxt},vVe),Jee=Object.assign({iterations:1e3,hash:{name:uxt}},vVe),hxt=["deriveBits"],rw=[8,12,16],ow=[16,24,32],Yg=10,fxt=[0,0,0,0],j3=typeof crypto!=Qd,cw=j3&&crypto.subtle,FVe=j3&&typeof cw!=Qd,f0=iw.bytes,pxt=Hee.aes,bxt=Kee.ctrGladman,gxt=eT.hmacSha1,LVe=j3&&FVe&&typeof cw.importKey==Yr,WVe=j3&&FVe&&typeof cw.deriveBits==Yr,K3=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:o,checkAuthenticationCode:r=!0}){super({start(){IVe(this,t,n,i)},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await yxt(c,u,d,mh(s,0,rw[u]+2)),s=mh(s,rw[u]+2),o?a.error(new Error(Ng)):m()):await p;let b=new Uint8Array(s.length-Yg-(s.length-Yg)%dE);a.enqueue(PVe(c,s,b,0,Yg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:d,ready:u}=this;if(c&&a){await u;let m=mh(d,0,d.length-Yg),p=mh(d,d.length-Yg),b=yo;if(m.length){let _=aw(f0,m);c.update(_);let S=a.update(_);b=sw(f0,S)}let f=mh(sw(f0,c.digest()),0,Yg),y=d.length>>24]);let o=~e.crcKey2.get();e.keys=[i,n,o]}function UVe(e){let t=e.keys[2]|2;return DVe(Math.imul(t,t^1)>>>8)}function DVe(e){return e&255}function MVe(e){return e&4294967295}var y3i,uE,Q3,q3,OVe=Xs(()=>{y3i=x(T(),1);tw();H3();uE=12,Q3=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:o}){super({start(){kVe(this,t,n,i)},transform(r,s){let a=this;if(a.password||a.rawPassword){let c=YVe(a,r.subarray(0,uE));if(a.password=a.rawPassword=null,(c[uE-1]^a.passwordVerification)!=0)throw new Error(h0);r=r.subarray(uE)}o?s.error(new Error(Ng)):s.enqueue(YVe(a,r))}})}},q3=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){kVe(this,t,n,i)},transform(o,r){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let d=z3(new Uint8Array(uE));d[uE-1]=s.passwordVerification,a=new Uint8Array(o.length+d.length),a.set(wVe(s,d),0),c=uE}else a=new Uint8Array(o.length),c=0;a.set(wVe(s,o),c),r.enqueue(a)}})}}});function kf(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:o}=await t.read();o?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function p0(e,t){e=kf(e);let n=t?{type:t}:{};if(Cxt())return new Response(e).blob().then(o=>t?new Blob([o],n):o);let i=[];return e.pipeTo(new WritableStream({write(o){i.push(o)}})).then(()=>new Blob(i,n))}function Cxt(){return typeof Blob.prototype.stream!=Yr||new Blob([]).stream()instanceof ReadableStream}function BVe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var _3i,mE=Xs(()=>{_3i=x(T(),1);bc()});function ez(e){return Vxt.get(e)}function tz(e){return jee.get(e)}function Ext(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Yr&&typeof i!=Yr)throw new Error(zVe);jee.set(e,{CompressionStream:n,DecompressionStream:i})}async function HVe(e,t){!jee.has(e)&&t&&Ext(e,await import(t))}var R3i,zVe,Vxt,jee,yZ=Xs(()=>{R3i=x(T(),1);bc();zVe="Invalid codec module",Vxt=new Map,jee=new Map});function Wxt(e,t,n){let i=new Mf,o=0,r=!1,s,a,c,d=new Promise((f,y)=>{a=f,c=y});d.catch(()=>{}),n||a();let u=new TransformStream({start(f){let y=new Uint8Array(jVe);y.set(Gxt),f.enqueue(y)},transform(f,y){y.enqueue(f)},async flush(f){r=!0,p();try{await d}finally{b()}let y=new Uint8Array(Qee),_=hi(y);_.setUint32(0,i.get(),!0),_.setUint32(4,n,!0),f.enqueue(y)},cancel(f){c(f)}}),m=new TransformStream({transform(f,y){i.append(f),o+=f.length,o>=n?a():r&&p(),y.enqueue(f)},cancel(f){c(f)}});return e=Uf(e,u),e=fE(e,t),Uf(e,m);function p(){b(),s=setTimeout(()=>c(new Error(iT)),Lxt)}function b(){clearTimeout(s)}}function $ee(e,t){if(!e)return!1;let n=KVe.get(e);n||(n=new Map,KVe.set(e,n));let i=n.get(t);if(i===ke){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function rz(e){return $ee(e,qee)}function ete(e){return $ee(e,dw)}function QVe(e,t,n){t=Uf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function qVe(e,t,n){if(!e)throw new Error(Axt);return new e(t,n)}function $Ve(e,t,n,i,o){let r=t&&i?i:o||i,s=n.deflate64?JVe:qee,a;try{a=new r(s,n)}catch(c){if(t&&o&&r!=o)a=new o(s,n);else throw c}return fE(e,a)}function Uf(e,t){return kf(e).pipeThrough(t)}function fE(e,t){let n=t.writable.getWriter(),i=e.getReader();return o(),t.readable;async function o(){try{for(;;){await n.ready;let r=await i.read();if(r.done){await n.close();break}await n.write(r.value)}}catch(r){await vxt(n,r),await Fxt(i,r)}}}async function vxt(e,t){try{await e.abort(t)}catch{}}async function Fxt(e,t){try{await e.cancel(t)}catch{}}function Ixt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(pE);throw a.cause=s,a}let{value:o,done:r}=i;r?n.close():n.enqueue(o)},cancel(n){return t.cancel(n)}})}var P3i,iT,pE,bE,Axt,qee,JVe,dw,jVe,Qee,Gxt,Lxt,nz,iz,oz,KVe,tte=Xs(()=>{P3i=x(T(),1);tw();EVe();NVe();OVe();H3();bc();bZ();mE();yZ();iT="Invalid uncompressed size",pE="Invalid compressed data",bE=tT,Axt="Compression method not supported",qee="deflate-raw",JVe="deflate64-raw",dw="gzip",jVe=10,Qee=8,Gxt=[31,139,8],Lxt=5e3,nz=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:d,level:u,deflate64:m,format:p,compressionMethod:b,inputSize:f}=t,y=this,_,S,Z,R=super.readable,C=p&&tz(p),E=d&&r&&!m&&!C&&(!s||c)&&!!(a&&o);if((!s||c)&&d&&!E&&(_=new nw,R=Uf(R,_)),r)if(C)R=fE(R,qVe(C.CompressionStream,p,{level:u,chunkSize:n,compressionMethod:b,uncompressedSize:f}));else if(E)Z=new iz,R=fE(R,new o(dw)),R=Uf(R,Z);else try{R=$Ve(R,a,{level:u,chunkSize:n},o,i)}catch(A){let L;try{L=new o(dw)}catch{throw A}R=fE(R,L),R=Uf(R,new iz)}s&&(c?R=Uf(R,new q3(t)):(S=new J3(t),R=Uf(R,S))),QVe(y,R,()=>{(!s||c)&&d&&(y.crc32=E?Z.crc32:new DataView(_.value.buffer).getUint32(0))})}},iz=class extends TransformStream{constructor(){let t,n=jVe,i=new Uint8Array(0);super({transform(o,r){if(n){let d=Math.min(n,o.length);if(n-=d,o=o.subarray(d),!o.length)return}let s=i.length+o.length;if(s<=Qee){i=uh(i,o);return}let a=s-Qee,c=Math.min(a,i.length);r.enqueue(uh(i.subarray(0,c),o.subarray(0,a-c))),i=uh(i.subarray(c),o.subarray(a-c))},flush(){let o=hi(i);t.crc32=o.getUint32(0,!0),t.uncompressedSize=o.getUint32(4,!0)}}),t=this}};oz=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:s,checkCrc32:a,crc32:c,compressed:d,useCompressionStream:u,deflate64:m,format:p,compressionMethod:b,rawBitFlag:f,outputSize:y}=t,_,S,Z=super.readable;if(s&&(r?Z=Uf(Z,new Q3(t)):(S=new K3(t),Z=Uf(Z,S))),d){let R=p&&tz(p);if(R)Z=fE(Z,qVe(R.DecompressionStream,p,{chunkSize:n,compressionMethod:b,rawBitFlag:f,uncompressedSize:y}));else try{Z=$Ve(Z,u,{chunkSize:n,deflate64:m},o,i)}catch(C){if(m||y===ke)throw C;let E;try{E=new o(dw)}catch{throw C}Z=Wxt(Z,E,y)}Z=Ixt(Z)}a&&(_=new nw,Z=Uf(Z,_)),QVe(this,Z,()=>{if(a){let R=new DataView(_.value.buffer);if(c!=R.getUint32(0,!1))throw new Error(bE)}})}},KVe=new Map});var w3i,Pxt,eEe,tEe,nEe,nte,iEe,oEe,gE,az,sz,uw,cz=Xs(()=>{w3i=x(T(),1);bc();tte();Pxt=64*1024,eEe="message",tEe="start",nEe="pull",nte="data",iEe="ack",oEe="close",gE="deflate",az="inflate",sz=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(gE)?r=nz:o.startsWith(az)&&(r=oz),i.outputSize=0;let s=0,a=new r(t,n),c=super.readable,d=new TransformStream({transform(m,p){m&&m.length&&(s+=m.length,p.enqueue(m))},flush(){Object.assign(i,{inputSize:s})}}),u=new TransformStream({transform(m,p){if(m&&m.length&&(p.enqueue(m),i.outputSize+=m.length,t.outputSize!==ke&&i.outputSize>t.outputSize))throw new Error(iT)},flush(){let{crc32:m}=a;Object.assign(i,{crc32:m,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(d).pipeThrough(a).pipeThrough(u)}})}},uw=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=Pxt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(o())},flush(s){i&&s.enqueue(r(n,i))}});function o(){let s=new Uint8Array(t),a=0;for(;auz(e,t)}}async function uz({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(e.compressed&&!e.format){let d=e.codecType.startsWith(gE),u=d?o.CompressionStreamFallback:o.DecompressionStreamFallback,m=d?o.CompressionStream:o.DecompressionStream;if(e.useCompressionStream){if(u&&u.requiresModule&&!rz(m))try{await dz(o)}catch{}}else try{await dz(o)}catch{(!u||u.requiresModule)&&(e.useCompressionStream=!0)}}r=new sz(e,o),await t.pipeThrough(r).pipeThrough(new uw(qY(o))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=r;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw r&&(s.outputSize=r.outputSize),s}finally{i()}}var O3i,TZ,lz,rEe,ote,dz,xZ,rte,mw=Xs(()=>{O3i=x(T(),1);bc();m0();cz();TZ="Worker startup timeout",dz=()=>{};xZ=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:d,createWorker:u},m){let{signal:p}=s;return rEe&&(u=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new uw(qY(r))).pipeThrough(new rte(s),{signal:p}),writable:i,options:Object.assign({},o),workerURI:d,createWorker:u,transferStreams:c,terminate(){return new Promise(b=>{let{worker:f,busy:y}=t;f?(y?t.resolveTerminated=b:(f.terminate(),b()),t.interface=null):b()})},onTaskFinished(){if(t.busy){let{resolveTerminated:b}=t;b&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),b()),t.busy=!1,m(t)}}}),lz===ke&&(lz=typeof Worker!=Qd),(a&&ote&&(lz&&d||u)?ote:ate)(t,r)}},rte=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await ite(t,i)},async transform(s,a){r+=s.length,n&&await ite(n,r,i),a.enqueue(s)},async flush(){o&&await ite(o,r)}})}}});async function pz(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:d,encrypted:u,format:m,codecURI:p}=n,{workerURI:b,createWorker:f,maxWorkers:y}=i;m&&(p&&(n.codecURI=Uxt(p,i.baseURI)),await HVe(m,n.codecURI)),t.transferStreams=!m&&(o||o===ke&&i.transferStreams);let _=!a&&!c&&!d&&!u,S=m===ke||!!n.codecURI;return t.useWebWorkers=!_&&S&&(r||r===ke&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&b?b:ke,t.createWorker=t.useWebWorkers&&f?f:ke,n.useCompressionStream=s||s===ke&&i.useCompressionStream,(await Z()).run();async function Z(){let C=_Z.find(E=>!E.busy);if(C)return bEe(C),new xZ(C,e,t,R);if(_Z.length{yE.push({resolve:E,stream:e,workerOptions:t}),hz=i.workerStarvationTimeout,fz()})}function R(C){if(gEe(),yE.length){let[{resolve:E,stream:A,workerOptions:L}]=yE.splice(0,1);E(new xZ(C,A,L,R)),fz()}else C.worker?(bEe(C),Bxt(C,t)):_Z=_Z.filter(E=>E!=C)}}function Uxt(e,t){try{return new URL(e,t).toString()}catch{return e}}function fz(){!xE&&yE.length&&Number.isFinite(hz)&&hz>=0&&(xE=setTimeout(Dxt,hz))}function gEe(){xE&&(clearTimeout(xE),xE=null)}function Dxt(){if(xE=null,yE.length){let[{resolve:e,stream:t,workerOptions:n}]=yE.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new xZ({},t,i,Oxt)),fz()}}function Oxt(){gEe(),fz()}function Bxt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{_Z=_Z.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function bEe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var nzi,_Z,yE,xE,hz,pEe,bz=Xs(()=>{nzi=x(T(),1);bc();cz();yZ();mw();_Z=[],yE=[],pEe=0});function xEe(e){if(zxt){let t="";for(let n=0;n{ozi=x(T(),1),yEe="\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\xA0".split(""),zxt=yEe.length==256});function hw(e,t){return SEe(e,t,!0)}function _Ee(e,t){return SEe(e,t,!1)}function SEe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?xEe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var azi,hte=Xs(()=>{azi=x(T(),1);TEe()});function Kxt(){VEe=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();fte=n==1}catch{fte=!1}})()}function Tz(e){return!!(e&&e.getData)}async function Xc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function Jxt(e){return e=new wg(e),await Xc(e),(e.size===ke||!e.readUint8Array)&&(e=new qd(await p0(e.readable)),await Xc(e)),e}function wr(e,t,n){return e.readUint8Array(t,n)}function bte(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?_E.prototype.createReadable.call(e,t):e.readable}var bzi,REe,CEe,Hxt,hzi,fzi,pte,ZEe,TE,_E,gz,fw,fte,VEe,qd,SE,pw,bw,yz,xz,wg,ZE,_z=Xs(()=>{bzi=x(T(),1);bc();m0();bZ();mE();hte();REe="Writer iterator completed too soon",CEe="Writer not initialized",Hxt="text/plain",hzi=256*1024,fzi=16*1024*1024,pte="writable",ZEe=Symbol(),TE=class{constructor(){this.size=0}init(){this.initialized=!0}},_E=class extends TE{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=qY(Xg())}={}){let o=this,r=0;return i=Bee(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-r),c=await wr(o,t+r,a);c.length&&s.enqueue(c),r+i>=n||!c.length&&a?s.close():r+=i}})}},gz=class extends TE{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(CEe);return t.writeUint8Array(B3(i))}});Object.defineProperty(t,pte,{get(){return n}})}writeUint8Array(){}},fw=class extends gz{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,o=n.pendingCharacters,r=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i2?n.data+=btoa(o):n.pendingCharacters=o+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};qd=class extends _E{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),VEe||Kxt()}createReadable(t){let n=this,{sourceBlob:i,size:o}=n,{offset:r=0,size:s=o-r}=t||{};return!r&&s>=o?kf(i.stream()):fte?kf(i.slice(r,r+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,o=t+n,a=await(!t&&o>=i.size?i.sourceBlob:i.sourceBlob.slice(t,o)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,o)),new Uint8Array(a)}},SE=class extends TE{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,pte,{get(){return i.writable}}),n.contentType=t,n.blobPromise=p0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},pw=class extends qd{constructor(t){super(new Blob([t],{type:Hxt}))}},bw=class extends SE{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():_Ee(new Uint8Array(await i.arrayBuffer()),t)}},yz=class extends _E{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(Jxt));t.diskOffsets=n.map(i=>{let o=t.size;return t.size+=i.size,o}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,o=n[t];return o===ke?i:o}async readUint8Array(t,n){let i=this,{readers:o}=this,r,s=0,a=t;for(;o[s]&&a>=o[s].size;)a-=o[s].size,s++;let c=o[s];if(c){let d=c.size;if(a+n<=d)r=await wr(c,a,n);else{let u=d-a,m=await wr(c,a,u),p=await i.readUint8Array(t+u,n-u);r=uh(m,p)}}else r=yo;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),r}},xz=class extends TE{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(m){if(m===ZEe){s&&await d();return}let{availableSize:p}=i;if(s)m.length>=p?(await c(m.subarray(0,p)),await d(),m.length>p&&await this.write(m.subarray(p))):await c(m);else{let{value:b,done:f}=await t.next();if(f&&!b)throw new Error(REe);o=b,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Xc(o),r=b.writable,s=r.getWriter(),await this.write(m)}},async close(){s&&(await s.ready,await u())},async abort(m){s&&await s.abort(m)}});Object.defineProperty(i,pte,{get(){return a}});async function c(m){let p=m.length;p&&(await s.ready,await s.write(m),o.size+=p,i.availableSize-=p)}async function d(){await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function u(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(ZEe)}finally{t.releaseLock()}}},wg=class{constructor(t){return Array.isArray(t)&&(t=new yz(t)),(t instanceof ReadableStream||typeof t.getReader==Yr)&&(t={readable:kf(t)}),t}},ZE=class{constructor(t){return t.writable===ke&&typeof t.next==Yr&&(t=new xz(t)),(t instanceof WritableStream||typeof t.getWriter==Yr)&&(t={writable:BVe(t)}),t.size===ke&&(t.size=0),t}}});var yzi,gte,yte,gw,xte,yw,Tte,_te,Ste,RE,CE,xw,Zte,Tw,Rte,Cte,Vte,Sz,Zz,Ete,Ate,Gte,Rz,Lte,Wte,vte,Fte,SZ,Ite,jxt,Pte,Cz,Qxt,Vz,qxt,$xt,eTt,tTt,Xte,Nte,Yte,wte,nTt,iTt,oTt,rTt,sTt,aTt,cTt,lTt,dTt,uTt,mTt,hTt,fTt,pTt,bTt,gTt,oT,Mte=Xs(()=>{yzi=x(T(),1),gte="filename",yte="rawFilename",gw="comment",xte="rawComment",yw="uncompressedSize",Tte="compressedSize",_te="offset",Ste="diskNumberStart",RE="lastModDate",CE="rawLastModDate",xw="lastAccessDate",Zte="rawLastAccessDate",Tw="creationDate",Rte="rawCreationDate",Cte="internalFileAttributes",Vte="externalFileAttributes",Sz="internalFileAttribute",Zz="externalFileAttribute",Ete="msdosAttributesRaw",Ate="msdosAttributes",Gte="msDosCompatible",Rz="zip64",Lte="encrypted",Wte="version",vte="versionMadeBy",Fte="zipCrypto",SZ="directory",Ite="executable",jxt="symlink",Pte="compressionMethod",Cz="signature",Qxt="crc32",Vz="extraField",qxt="extraFieldInfoZip",$xt="extraFieldUnix",eTt="extraFieldUnixType1",tTt="extraFieldPkwareUnix",Xte="unixMode",Nte="setuid",Yte="setgid",wte="sticky",nTt="bitFlag",iTt="rawBitFlag",oTt="filenameLength",rTt="extraFieldLength",sTt="unixExternalUpper",aTt="filenameUTF8",cTt="commentUTF8",lTt="rawExtraField",dTt="extraFieldZip64",uTt="extraFieldUnicodePath",mTt="extraFieldUnicodeComment",hTt="extraFieldAES",fTt="extraFieldNTFS",pTt="extraFieldExtendedTimestamp",bTt="extraFieldUSDZ",gTt=[gte,yte,yw,Tte,RE,CE,gw,xte,xw,Zte,Tw,Rte,_te,Ste,Cte,Vte,Sz,Zz,Ete,Ate,Gte,Rz,Lte,Wte,vte,Fte,SZ,Ite,jxt,Pte,Cz,Qxt,Vz,$xt,qxt,eTt,tTt,"uid","gid",Xte,sTt,Nte,Yte,wte,nTt,iTt,oTt,rTt,aTt,cTt,lTt,dTt,uTt,mTt,hTt,fTt,pTt,bTt],oT=class{constructor(t){gTt.forEach(n=>this[n]=t[n])}}});var eAe={};yle(eAe,{ERR_AMBIGUOUS_ARCHIVE:()=>fne,ERR_BAD_FORMAT:()=>VE,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>cne,ERR_ENCRYPTED:()=>une,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>pne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>hne,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>ane,ERR_EOCDR_NOT_FOUND:()=>sne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>dne,ERR_INVALID_AUTHENTICATION_CODE:()=>nT,ERR_INVALID_COMPRESSED_DATA:()=>pE,ERR_INVALID_CRC32:()=>bE,ERR_INVALID_FILENAME_VALIDATION:()=>yne,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>xne,ERR_INVALID_PASSWORD:()=>h0,ERR_INVALID_SIGNATURE:()=>tT,ERR_INVALID_STRICTNESS:()=>gne,ERR_INVALID_UNCOMPRESSED_SIZE:()=>iT,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>lne,ERR_OVERLAPPING_ENTRY:()=>mne,ERR_SPLIT_ZIP_FILE:()=>Wz,ERR_UNSAFE_FILENAME:()=>bne,ERR_UNSUPPORTED_COMPRESSION:()=>Lz,ERR_UNSUPPORTED_ENCRYPTION:()=>Gz,ERR_UNSUPPORTED_UINT64:()=>Tne,ERR_WORKER_STARTUP_TIMEOUT:()=>TZ,WARNING_APPENDED_DATA:()=>Fz,WARNING_COMPRESSED_PATCHED_DATA:()=>Zne,WARNING_DUPLICATE_FILENAME:()=>Ene,WARNING_MALFORMED_EXTRA_FIELD:()=>zz,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Ane,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Gne,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Lne,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>EE,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Cne,WARNING_PREPENDED_DATA:()=>Iz,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Vne,WARNING_UNKNOWN_VERSION:()=>Sne,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Rne,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>_ne,WARNING_WRAPPED_ENTRIES_COUNT:()=>vz,ZipReader:()=>VZ,ZipReaderStream:()=>Xz,isZipFile:()=>BEe});async function BEe(e,t={}){if(e=new wg(e),await Xc(e),(e.size===ke||!e.readUint8Array)&&(e=new qd(await p0(e.readable)),await Xc(e)),e.size<22)return!1;let n=vne(t,{}),i=n!=Pg,o=jEe(t[kee],n),{endOfDirectoryInfo:r,endOfDirectoryReachingEndCount:s}=await QEe(e,i,o);if(!r||n==$x&&s>1)return!1;let a=xo(hi(r),20),c=r.offset+22+a;return e.size-c<=o}function kte(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n=6){let t=hi(e);if(Fi(t,0)==84233040){let n=xo(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function WTt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function vTt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=hi(e),i=xo(n,26);Object.assign(t,{compressionMethod:xo(n,0),compressedSize:qu(n,2),uncompressedSize:qu(n,10),encryptionAlgorithm:xo(n,18),bitLength:xo(n,20),flags:xo(n,22),hashAlgorithm:xo(n,24),hashData:e.subarray(28,28+i)})}return t}function zEe(e,t,n){let i=e.rawBitFlag=xo(t,n+2),o=(i&1)==1,r=Fi(t,n+6);Object.assign(e,{encrypted:o,version:xo(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:HTt(r),filenameLength:xo(t,n+22),extraFieldLength:xo(t,n+24)})}function HEe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=hi(r),c=0,d=!1;try{for(;cr.length&&(d=!0);let u=xo(n,i+4);Object.assign(t,{signature:Fi(n,i+10),crc32:Fi(n,i+10),compressedSize:Fi(n,i+14),uncompressedSize:Fi(n,i+18)});let m=s.get(1);m&&(FTt(m,t),t.extraFieldZip64=m);let p=s.get(28789);p&&(XEe(p,gte,yte,t,e),t.extraFieldUnicodePath=p);let b=s.get(25461);b&&(XEe(b,gw,xte,t,e),t.extraFieldUnicodeComment=b);let f=s.get(39169);f&&f.data.length>=7?(ITt(f,t,u),t.extraFieldAES=f):t.compressionMethod=u;let y=s.get(13);y&&(NEe(y,t),t.extraFieldPkwareUnix=y);let _=s.get(22613);_&&(NEe(_,t),t.extraFieldUnixType1=_);let S=s.get(10);S&&(PTt(S,t),t.extraFieldNTFS=S);let Z=s.get(30805),R;if(Z&&(R=YEe(Z,t,!1),t.extraFieldUnix=Z),!R){let A=s.get(30837);A&&(YEe(A,t,!0),t.extraFieldInfoZip=A)}let C=s.get(21589);C&&(XTt(C,t,o),t.extraFieldExtendedTimestamp=C);let E=s.get(6534);return E&&(t.extraFieldUSDZ=E),d}function FTt(e,t){t.zip64=!0;let n=hi(e.data),i=ETt.filter(([r,s])=>t[r]==s),o=i.reduce((r,[,s])=>r+FEe[s].bytes,0);if(e.data.length=12&&(r.uid=xo(n,8),r.gid=xo(n,10)),Object.assign(e,r),Object.assign(t,r)}function YEe(e,t,n){try{let i=hi(e.data),o,r;if(n){let s=0,a=sT(i,s++),c=sT(i,s++);o=wEe(e.data.subarray(s,s+c)),s+=c;let d=sT(i,s++);r=wEe(e.data.subarray(s,s+d)),Object.assign(e,{version:a,uid:o,gid:r})}else e.data.length>=4&&(o=xo(i,0),r=xo(i,2),Object.assign(e,{uid:o,gid:r}));return o!==ke&&(t.uid=o),r!==ke&&(t.gid=r),o!==ke||r!==ke}catch{}}function wEe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function XTt(e,t,n){if(!e.data.length)return;let i=hi(e.data),o=sT(i,0),r=[],s=[];n?((o&1)==1&&(r.push(RE),s.push(CE)),(o&2)==2&&(r.push(xw),s.push(Zte)),(o&4)==4&&(r.push(Tw),s.push(Rte))):e.data.length>=5&&(r.push(RE),s.push(CE));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=Fi(i,a);t[c]=e[c]=new Date((u|0)*1e3);let m=s[d];e[m]=u}a+=4})}async function NTt({reader:e,fileEntry:t,index:n,offset:i,crc32:o,compressedSize:r,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:d,readRanges:u}){let m=0;if(c&&(d?m=20:m=12),m){let b=await wr(e,a+r,m+4),f=hi(b),y=b.length==m+4&&Fi(f,0)==134695760;if(y){let _=MEe(f,4,d);(t.encrypted&&!t.zipCrypto||_.crc32==o)&&_.compressedSize==r&&_.uncompressedSize==s?m+=4:y=!1}if(b.length>=m){let _=MEe(f,y?4:0,d);_.signature=y,t.localDirectory.dataDescriptor=_}}let p={start:i,end:a+r+m,fileEntry:t};for(let[b,f]of u)if(b!=n&&p.start1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||CTt.test(e)?!0:t==$x&&(n.includes(".")||n.includes(""))}function jEe(e,t){if(e!==ke){let n=pZ(e);if(typeof n!=ICe||Number.isNaN(n)||n<0)throw new Error(xne);return n}return t==$x?0:t==Pg?1/0:65535}async function QEe(e,t,n){let{size:i}=e,o=Math.min(i,65557),r={count:GTt},s,a,c=0;for await(let[d,u,m,p,b]of qEe(e,o)){let f=xo(d,p+20);if(b+22+f==i){let y=await $Ee(e,d,u,p,b,i,r);if(y==Pz){if(s||(s=Bte(m,p,b)),c++,!t||c>1)break}else y==Wne&&!a&&(a=Bte(m,p,b))}}return s||(s=a),s||(s=await BTt(e,n,r)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function BTt(e,t,n){let{size:i}=e,o=Math.min(i,t==1/0?i:65557+t),r,s;for await(let[a,c,d,u,m]of qEe(e,o)){let p=Bte(d,u,m);r||(r=p);let b=await $Ee(e,a,c,u,m,i,n);if(b==Pz)return p;b==Wne&&!s&&(s=p)}return s||r}async function*qEe(e,t){let n=e.size-t,i=await wr(e,n,t),o=hi(i);for(let r=i.length-22;r>=0;r--)Fi(o,r)==101010256&&(yield[o,n,i,r,n+r])}function Bte(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function $Ee(e,t,n,i,o,r,s){let a=xo(t,i+10),c=Fi(t,i+12),d=Fi(t,i+16);if(a==65535||c==4294967295||d==4294967295)return await UEe(e,t,n,o-20,r,s)==117853008?Pz:IEe;if(!a&&!c)return Wne;let u=xo(t,i+6);for(let m of[o-c,AE(e,u)+d])if(await UEe(e,t,n,m,r,s)==33639248)return Pz;return IEe}async function UEe(e,t,n,i,o,r){if(i<0||i+4>o)return ke;if(i>=n)return Fi(t,i-n);if(r.count>0){r.count--;let s=await wr(e,i,4);return Fi(hi(s),0)}return ke}function zTt(e,t,n,i,o){let{rawFilename:r}=e,s=!o,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=r.length||n.some((c,d)=>c!=r[d]))&&y0(s,o,"mismatched local file header (filename)"),(t.rawBitFlag&vEe)!=(e.rawBitFlag&vEe)&&y0(s,o,Ane),t.compressionMethod!=e.compressionMethod&&y0(s,o,Gne),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&y0(s,o,Lne)}function y0(e,t,n){e?Ez(n):hh(t,n)}function hh(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function Ez(e){let t=new Error(fne);throw t.reason=e,t}function Gs(e,t,n){return t[n]===ke?e.options[n]:t[n]}function DEe(e,t,n){return rE(Gs(e,t,n))}function HTt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return iATt)throw new Error(Tne);return Number(n)}var Lzi,VE,sne,ane,cne,lne,dne,une,Gz,Lz,Wz,mne,hne,fne,pne,bne,gne,yne,xne,Tne,_ne,Sne,Zne,zz,Rne,vz,Fz,Iz,Cne,Vne,Ene,EE,Ane,Gne,Lne,RTt,CTt,LEe,VTt,WEe,vEe,OEe,ETt,FEe,ATt,GTt,LTt,IEe,Wne,Pz,VZ,Xz,Ote,Fne=Xs(()=>{Lzi=x(T(),1);bc();m0();yZ();bz();_z();hte();bZ();mE();tw();Mte();QY();VE="File format is not recognized",sne="End of central directory not found",ane="End of Zip64 central directory locator not found",cne="Central directory header not found",lne="Local file header not found",dne="Zip64 extra field not found",une="File contains encrypted entry",Gz="Encryption method not supported",Lz="Compression method not supported",Wz="Split zip file",mne="Overlapping entry found",hne="Entry data out of bounds",fne="Ambiguous archive",pne="Encrypted central directory is not supported",bne="Unsafe filename",gne="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",yne="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",xne="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Tne="64-bit value exceeds Number.MAX_SAFE_INTEGER",_ne="unsorted central directory",Sne="unknown version needed to extract",Zne="compressed patched data",zz="malformed extra field",Rne="unknown zip64 extensible data",vz="wrapped entries count",Fz="appended data",Iz="prepended data",Cne="prepended central directory",Vne="trailing central directory data",Ene="duplicate filename",EE="mismatched zip64 end of central directory record",Ane="mismatched local file header (general purpose bit flag)",Gne="mismatched local file header (compression method)",Lne="mismatched local file header (crc32 or sizes)",RTt=63,CTt=/^[a-zA-Z]:/,LEe="utf-8",VTt="UTF8",WEe="cp437",vEe=2057,OEe=1,ETt=[[yw,4294967295],[Tte,4294967295],[_te,4294967295],[Ste,65535]],FEe={65535:{getValue:Fi,bytes:4},4294967295:{getValue:qu,bytes:8}},ATt=BigInt(Number.MAX_SAFE_INTEGER),GTt=64,LTt=1032,IEe=0,Wne=1,Pz=2,VZ=class{constructor(t,n={}){Object.assign(this,{reader:new wg(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Xc(i),(i.size===ke||!i.readUint8Array)&&(i=new qd(await p0(i.readable)),await Xc(i)),i.size<22)throw new Error(VE);let o=n.warnings=[],r=vne(t,n.options),s=r==$x,a=r!=Pg,c=jEe(Gs(n,t,kee),r),d=DTt(Gs(n,t,dVe),r),u=Gs(n,t,uVe),{endOfDirectoryInfo:m,endOfDirectoryReachingEndCount:p}=await QEe(i,a,c);if(!m)throw await YTt(i)?new Error(Wz):new Error(sne);a&&p>1&&Ez("multiple end of central directory records");let b=hi(m),f=Fi(b,12),y=Fi(b,16),_=m.offset,S=xo(b,20),Z=_+22+S,R=i.size-Z;R>c&&Ez(Fz),R>0&&hh(o,Fz);let C=xo(b,4),E=i.lastDiskNumber||0,A=xo(b,6),L=xo(b,10),F=0,I,N,g,V,G=56,v,X=y==4294967295||f==4294967295||L==65535||A==65535;if(y!=4294967295&&A!=65535&&(y+=AE(i,A)),X){let Be=m.offset>=20?await wr(i,m.offset-20,20):yo,je=hi(Be);if(Be.length==20&&Fi(je,0)==117853008){y=AE(i,Fi(je,4))+qu(je,8);let qe=await wr(i,y,56),We=hi(qe),Ke=m.offset-20-56;if((qe.length<56||Fi(We,0)!=101075792)&&y!=Ke&&Ke>=0){let ct=y;y=Ke,y>ct&&(F=y-ct),qe=await wr(i,y,56),We=hi(qe)}if(qe.length<56||Fi(We,0)!=101075792)throw new Error(ane);if(g=!0,V=qu(We,4)>44,V){let ct=Math.min(qu(We,4)-44,i.size-y-56);if(ct>0){G+=ct;let Et=await wr(i,y+56,ct);v=vTt(Et)}}C==65535?C=Fi(We,16):C!=Fi(We,16)&&y0(s,o,EE),A==65535?A=Fi(We,20):A!=Fi(We,20)&&y0(s,o,EE),L==65535?L=qu(We,32):L!=qu(We,32)&&y0(s,o,EE),f==4294967295?f=qu(We,40):f!=qu(We,40)&&y0(s,o,EE),y=AE(i,A)+qu(We,48)+F}}let Y=f,D=m.offset-(g?G+20:0);if(y>=i.size&&(F=i.size-y-f-22,y=i.size-f-22),E!=C)throw new Error(Wz);if(y<0)throw new Error(VE);let w=0,O=await wr(i,y,f),M=hi(O);if(f){if(O.length<4)throw new Error(VE);let Be=D-f;if(y!=Be&&A==C){let je=Fi(M,w)==33639248||!!(v&&v.compressedSize)||kte(M),qe=!je;if(!qe&&Be>=0&&Be+4<=i.size){let We=await wr(i,Be,4);qe=Fi(hi(We),0)==33639248}if(qe){let We=y;y=Be,y>We&&(F+=y-We,I=je),O=await wr(i,y,f),M=hi(O)}}}let z=D-y;if(f!=z&&z>=0&&A==C&&(f=z,O=await wr(i,y,f),M=hi(O)),y<0||y>=i.size)throw new Error(VE);n.directoryOffset=y,n.directoryLength=Y;let K=DEe(n,t,mVe),te,H;if(K&&L&&O.length>=4&&Fi(M,0)!=33639248&&(V||kte(M))){let Be=WTt(v,Y,O.length);H=O.subarray(Be),O=await K(O.subarray(0,Be),v),M=hi(O),Y=O.length,te=!0}v&&!te&&(O.length<4||Fi(M,0)==33639248)&&hh(o,Rne),N=y;let $=Gs(n,t,XCe),ee=Gs(n,t,NCe),le=new Set,_e,he=-1,Ze=!s&&!g;!L&&Ze&&(L=PEe(M,O,w),L&&hh(o,vz));for(let Be=0;BeO.length||Fi(M,w)!=33639248)throw Be==0&&!te&&(V||kte(M))?new Error(pne):new Error(cne);zEe(je,M,w+6);let qe=!!je.bitFlag.languageEncodingFlag,We=w+46,Ke=We+je.filenameLength,ct=Ke+je.extraFieldLength,Et=xo(M,w+4),zt=Et>>8==0,ut=Et>>8==3,bt=O.subarray(We,Ke),ht=xo(M,w+32),jt=ct+ht,st=O.subarray(ct,jt),pt=qe,wi=qe,jn=Fi(M,w+38),_i=jn&255,Hi={readOnly:!!(_i&1),hidden:!!(_i&2),system:!!(_i&4),directory:!!(_i&16),archive:!!(_i&32)},Gi=Fi(M,w+42),fi=DEe(n,t,YCe)||hw,Si=pt?LEe:$||WEe,On=wi?LEe:ee||WEe,rn=fi(bt,Si,M3);if(rn===ke&&(rn=hw(bt,Si)),u){let Mi=u(rn);Mi!==ke&&(rn=Mi)}if(OTt(rn,d)){let Mi=new Error(bne);throw Mi.filename=rn,Mi}let Hn=fi(st,On,k3);Hn===ke&&(Hn=hw(st,On)),Object.assign(je,{index:Be,decryptedDirectory:te,versionMadeBy:Et,msDosCompatible:zt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ht,offset:Gi,diskNumberStart:xo(M,w+34),internalFileAttributes:xo(M,w+36),externalFileAttributes:jn,msdosAttributesRaw:_i,msdosAttributes:Hi,rawFilename:bt,filenameUTF8:pt,commentUTF8:wi,rawExtraField:O.subarray(Ke,ct),rawComment:st,filename:rn,comment:Hn}),HEe(je,je,M,w+6)&&hh(o,zz,rn),je.offset+=F;let $i=AE(i,je.diskNumberStart)+je.offset;N=Math.min($i,N),$iRTt&&hh(o,Sne,rn),(je.rawBitFlag&32)==32&&hh(o,Zne,rn),le.has(je.filename)&&(_e=!0),le.add(je.filename);let Po=je.externalFileAttributes>>16&65535;je.unixMode===ke&&(Po&16877)!=0&&(je.unixMode=Po);let hr=!!(je.unixMode&2048),Is=!!(je.unixMode&1024),Hs=!!(je.unixMode&512),bi=((je.unixMode===ke?Po:je.unixMode)&61440)==40960,fr=!bi&&(je.unixMode!==ke?(je.unixMode&73)!=0:ut&&(Po&73)!=0),mo=je.unixMode!==ke&&(je.unixMode&61440)==16384,Qr=(Po&61440)==16384;Object.assign(je,{setuid:hr,setgid:Is,sticky:Hs,symlink:bi,unixExternalUpper:Po,internalFileAttribute:je.internalFileAttributes,externalFileAttribute:je.externalFileAttributes,executable:fr,directory:mo||Qr||zt&&Hi.directory||je.filename.endsWith("/"),zipCrypto:je.encrypted&&!je.extraFieldAES});let wn=new oT(je);if(wn.getData=(Mi,Xo)=>je.getData(Mi,wn,n.readRanges,Xo),wn.arrayBuffer=async Mi=>{let Xo=new TransformStream,Dc=p0(Xo.readable).then(bm=>bm.arrayBuffer());return Dc.catch(()=>{}),await je.getData(Xo,wn,n.readRanges,Mi),Dc},w=jt,Be==L-1&&Ze){let Mi=PEe(M,O,w);Mi&&(L+=Mi,hh(o,vz))}let{onprogress:Ki}=t;if(Ki)try{await Ki(Be+1,L,new oT(je))}catch{}yield wn}let ye=w,Ge=Ute(O.subarray(w))||(te?Ute(H):ke);if(!Ge&&!te){let Be=y+w,je=Math.min(D-Be,65541);je>=6&&(Ge=Ute(await wr(i,Be,je)))}Ge&&(n.digitalSignature=Ge,ye=w+6+Ge.length),(w!=Y&&ye!=Y||!te&&w!=f&&ye!=f)&&y0(s,o,Vne),_e&&y0(s,o,Ene);let Ae=Gs(n,t,wCe),Fe=Gs(n,t,MCe),tt=(s||Ae)&&L&&N==4&&await wTt(i)?4:0;return s&&(F||L&&N>tt)&&Ez(Iz),(F||L&&N>4)&&hh(o,Iz),I&&hh(o,Cne),Ae&&(n.prependedData=N>tt?await wr(i,tt,N-tt):yo),n.comment=S?await wr(i,_+22,S):yo,Fe&&(n.appendedData=Z3))throw new Error(Gz);if(!N&&!g)throw new Error(une)}if(X+R>a.size)throw new Error(hne);let _e=R,he=kf(a.createReadable({offset:X,size:_e})),Ze=D3(Gs(r,o,P3)),ye=Gs(r,o,kCe),Ge=Gs(r,o,DCe),Ae=Gs(r,o,UCe);Ae&&(Ge=!0);let{onstart:Fe,onprogress:tt,onend:Be}=o,je=b!=0&&!V,qe=V?R:Z,We=b==9,Ke=Gs(r,o,N3);We&&(Ke=!1);let ct=Gs(r,o,HCe),Et=(ct===ke?Gs(r,o,zCe):ct)&&!V&&(!$||ee||m&&m.vendorVersion==OEe),zt={options:{codecType:az,password:N,rawPassword:g,zipCrypto:ee,encryptionStrength:m&&m.strength,checkCrc32:Et,checkAuthenticationCode:Gs(r,o,KCe),passwordVerification:ee&&(C?S>>>8&255:_>>>24&255),outputSize:qe,crc32:_,compressed:je,encrypted:$,useWebWorkers:Gs(r,o,X3),useCompressionStream:Ke,transferStreams:Gs(r,o,Y3),deflate64:We,format:le?le.format:ke,codecURI:le?le.codecURI:ke,compressionMethod:b,rawBitFlag:y,checkPasswordOnly:ye},config:s,streamOptions:{signal:Ze,size:_e,onstart:Fe,onprogress:tt,onend:Be}};Ge&&await NTt({reader:a,fileEntry:n,index:c,offset:L,crc32:_,compressedSize:R,uncompressedSize:Z,dataOffset:X,dataDescriptor:C||E.bitFlag.dataDescriptor,extraFieldZip64:p||E.extraFieldZip64,readRanges:i});let ut,bt;try{if(!Ae){ye&&(t=new WritableStream),t=new ZE(t),await Xc(t,MTt(qe,R,je)),{writable:ut}=t;let{outputSize:ht}=await pz({readable:he,writable:ut},zt);if(t.size+=ht,ht!=qe)throw new Error(iT)}}catch(ht){if(ht.outputSize!==ke&&(t.size+=ht.outputSize),!ye||ht.message!=Ng)throw bt=ht,ht}finally{if(!(!Tz(t)&&Gs(r,o,w3))&&ut&&!ut.locked){let jt=ut.getWriter();if(bt)try{await jt.abort(bt)}catch{}else await jt.close()}}return ye||Ae?ke:t.getData?t.getData():ut}}});var Noe=gm((cao,OM)=>{var lao=x(T());/*! + * protobuf.js v8.8.0 (c) 2016, daniel wirtz + * compiled thu, 27 aug 2026 00:01:05 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,l=2,d=!0;l1&&d.charAt(u)==="=";)++f;return Math.ceil(d.length*3)/4-f};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,f){for(var p=null,y=[],h=0,g=0,x;u>2],x=(S&3)<<4,g=1;break;case 1:y[h++]=o[x|S>>4],x=(S&15)<<2,g=2;break;case 2:y[h++]=o[x|S>>6],y[h++]=o[S&63],g=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,y)),h=0)}return g&&(y[h++]=o[x],y[h++]=61,g===1&&(y[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,y.slice(0,h))),p.join("")):String.fromCharCode.apply(String,y.slice(0,h))};var a="invalid encoding";i.decode=function(d,u,f){for(var p=f,y=0,h,g=0;g1)break;if((x=r[x])===undefined)throw Error(a);switch(y){case 0:h=x,y=1;break;case 1:u[f++]=h<<2|(x&48)>>4,h=x,y=2;break;case 2:u[f++]=(h&15)<<4|(x&60)>>2,h=x,y=3;break;case 3:u[f++]=(h&3)<<6|x,y=0;break}}if(y===1)throw Error(a);return f-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],l=0;l0?0:2147483648,y,h);else if(isNaN(p))f(2143289344,y,h);else if(p>34028234663852886e22)f((g<<31|2139095040)>>>0,y,h);else if(p<11754943508222875e-54)f((g<<31|Math.round(p/1401298464324817e-60))>>>0,y,h);else{var x=Math.floor(Math.log(p)/Math.LN2),S=Math.round(p*Math.pow(2,-x)*8388608)&8388607;f((g<<31|x+127<<23|S)>>>0,y,h)}}l.writeFloatLE=d.bind(null,o),l.writeFloatBE=d.bind(null,r);function u(f,p,y){var h=f(p,y),g=(h>>31)*2+1,x=h>>>23&255,S=h&8388607;return x===255?S?NaN:g*(1/0):x===0?g*1401298464324817e-60*S:g*Math.pow(2,x-150)*(S+8388608)}l.readFloatLE=u.bind(null,s),l.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),f=u[7]===128;function p(x,S,V){d[0]=x,S[V]=u[0],S[V+1]=u[1],S[V+2]=u[2],S[V+3]=u[3],S[V+4]=u[4],S[V+5]=u[5],S[V+6]=u[6],S[V+7]=u[7]}function y(x,S,V){d[0]=x,S[V]=u[7],S[V+1]=u[6],S[V+2]=u[5],S[V+3]=u[4],S[V+4]=u[3],S[V+5]=u[2],S[V+6]=u[1],S[V+7]=u[0]}l.writeDoubleLE=f?p:y,l.writeDoubleBE=f?y:p;function h(x,S){return u[0]=x[S],u[1]=x[S+1],u[2]=x[S+2],u[3]=x[S+3],u[4]=x[S+4],u[5]=x[S+5],u[6]=x[S+6],u[7]=x[S+7],d[0]}function g(x,S){return u[7]=x[S],u[6]=x[S+1],u[5]=x[S+2],u[4]=x[S+3],u[3]=x[S+4],u[2]=x[S+5],u[1]=x[S+6],u[0]=x[S+7],d[0]}l.readDoubleLE=f?h:g,l.readDoubleBE=f?g:h}():function(){function d(f,p,y,h,g,x){var S=h<0?1:0;if(S&&(h=-h),h===0)f(0,g,x+p),f(1/h>0?0:2147483648,g,x+y);else if(isNaN(h))f(0,g,x+p),f(2146959360,g,x+y);else if(h>17976931348623157e292)f(0,g,x+p),f((S<<31|2146435072)>>>0,g,x+y);else{var V;if(h<22250738585072014e-324)V=h/5e-324,f(V>>>0,g,x+p),f((S<<31|V/4294967296)>>>0,g,x+y);else{var Z=Math.floor(Math.log(h)/Math.LN2);Z===1024&&(Z=1023),V=h*Math.pow(2,-Z),f(V*4503599627370496>>>0,g,x+p),f((S<<31|Z+1023<<20|V*1048576&1048575)>>>0,g,x+y)}}}l.writeDoubleLE=d.bind(null,o,0,4),l.writeDoubleBE=d.bind(null,r,4,0);function u(f,p,y,h,g){var x=f(h,g+p),S=f(h,g+y),V=(S>>31)*2+1,Z=S>>>20&2047,R=4294967296*(S&1048575)+x;return Z===2047?R?NaN:V*(1/0):Z===0?V*5e-324*R:V*Math.pow(2,Z-1075)*(R+4503599627370496)}l.readDoubleLE=u.bind(null,s,0,4),l.readDoubleBE=u.bind(null,a,4,0)}(),l}function o(l,d,u){d[u]=l&255,d[u+1]=l>>>8&255,d[u+2]=l>>>16&255,d[u+3]=l>>>24}function r(l,d,u){d[u]=l>>>24,d[u+1]=l>>>16&255,d[u+2]=l>>>8&255,d[u+3]=l&255}function s(l,d){return(l[d]|l[d+1]<<8|l[d+2]<<16|l[d+3]<<24)>>>0}function a(l,d){return(l[d]<<24|l[d+1]<<16|l[d+2]<<8|l[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,l=a>>>1,d=null,u=a;return function(p){if(p<1||p>l)return o(p);u+p>a&&(d=o(a),u=0);var y=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),y}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,l=0;l191&&p<224?u[f++]=(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[f++]=55296+(p>>10),u[f++]=56320+(p&1023)):u[f++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,f>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),f=0);return d?(f&&d.push(String.fromCharCode.apply(String,u.slice(0,f))),d.join("")):String.fromCharCode.apply(String,u.slice(0,f))},i.write=function(r,s,a){for(var l=a,d,u,f=0;f>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(f+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++f,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-l}},{}],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=l;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(h,g){return RangeError("index out of range: "+h.pos+" + "+(g||1)+" > "+h.len)}function l(h){this.buf=h,this.pos=0,this.len=h.length}var d=typeof Uint8Array<"u"?function(g){if(g instanceof Uint8Array||Array.isArray(g))return new l(g);throw Error("illegal buffer")}:function(g){if(Array.isArray(g))return new l(g);throw Error("illegal buffer")},u=function(){return i.Buffer?function(x){return(l.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(x)}:d};l.create=u(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var g=4294967295;return function(){if(g=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(g=(g|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(g=(g|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(g=(g|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(g=(g|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return g;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return g}}(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var g=this.uint32();return g>>>1^-(g&1)|0};function f(){var h=new r(0,0),g=0;if(this.len-this.pos>4){for(;g<4;++g)if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;g=0}else{for(;g<3;++g){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<>>0,h}if(this.len-this.pos>4){for(;g<5;++g)if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}else for(;g<5;++g){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}l.prototype.bool=function(){return this.uint32()!==0};function p(h,g){return(h[g-4]|h[g-3]<<8|h[g-2]<<16|h[g-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function y(){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))}l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var g=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,g},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var g=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,g},l.prototype.bytes=function(){var g=this.uint32(),x=this.pos,S=this.pos+g;if(S>this.len)throw a(this,g);if(this.pos+=g,Array.isArray(this.buf))return this.buf.slice(x,S);if(x===S){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,x,S)},l.prototype.string=function(){var g=this.bytes();return s.read(g,0,g.length)},l.prototype.skip=function(g){if(typeof g=="number"){if(this.pos+g>this.len)throw a(this,g);this.pos+=g}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},l._configure=function(h){o=h,l.create=u(),o._configure();var g=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return f.call(this)[g](!1)},uint64:function(){return f.call(this)[g](!0)},sint64:function(){return f.call(this).zzDecode()[g](!1)},fixed64:function(){return y.call(this)[g](!0)},sfixed64:function(){return y.call(this)[g](!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,l,d,u){if(!d)throw TypeError("request must be specified");var f=this;if(!u)return i.asPromise(r,f,s,a,l,d);if(!f.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return f.rpcImpl(s,a[f.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(y,h){if(y)return f.emit("error",y,s),u(y);if(h===null)return f.end(!0),undefined;if(!(h instanceof l))try{h=l[f.responseDelimited?"decodeDelimited":"decode"](h)}catch(g){return f.emit("error",g,s),u(g)}return f.emit("data",h,s),u(null,h)})}catch(p){return f.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(l,d){this.lo=l>>>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 f=d>>>0,p=(d-f)/4294967296>>>0;return u&&(p=~p>>>0,f=~f>>>0,++f>4294967295&&(f=0,++p>4294967295&&(p=0))),new o(f,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,f=~this.hi>>>0;return u||(f=f+1>>>0),-(u+f*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,f=this.hi>>>24;return f===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:f<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,l){var d=a[l];return d!=null&&a.hasOwnProperty(l)?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,l){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,l):d.toNumber(!!l)};function o(s,a,l){for(var d=Object.keys(a),u=0;u-1;--f)if(l[u[f]]===1&&this[u[f]]!==undefined&&this[u[f]]!==null)return u[f]}},i.oneOfSetter=function(a){return function(l){for(var d=0;d127;)R[E++]=Z&127|128,Z>>>=7;R[E]=Z}function g(Z,R){this.len=Z,this.next=undefined,this.val=R}g.prototype=Object.create(l.prototype),g.prototype.fn=h,f.prototype.uint32=function(R){return this.len+=(this.tail=this.tail.next=new g((R=R>>>0)<128?1:R<16384?2:R<2097152?3:R<268435456?4:5,R)).len,this},f.prototype.int32=function(R){return R<0?this._push(x,10,r.fromNumber(R)):this.uint32(R)},f.prototype.sint32=function(R){return this.uint32((R<<1^R>>31)>>>0)};function x(Z,R,E){for(;Z.hi;)R[E++]=Z.lo&127|128,Z.lo=(Z.lo>>>7|Z.hi<<25)>>>0,Z.hi>>>=7;for(;Z.lo>127;)R[E++]=Z.lo&127|128,Z.lo=Z.lo>>>7;R[E++]=Z.lo}f.prototype.uint64=function(R){var E=r.from(R);return this._push(x,E.length(),E)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(R){var E=r.from(R).zzEncode();return this._push(x,E.length(),E)},f.prototype.bool=function(R){return this._push(y,1,R?1:0)};function S(Z,R,E){R[E]=Z&255,R[E+1]=Z>>>8&255,R[E+2]=Z>>>16&255,R[E+3]=Z>>>24}f.prototype.fixed32=function(R){return this._push(S,4,R>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(R){var E=r.from(R);return this._push(S,4,E.lo)._push(S,4,E.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(R){return this._push(i.float.writeFloatLE,4,R)},f.prototype.double=function(R){return this._push(i.float.writeDoubleLE,8,R)};var V=i.Array.prototype.set?function(R,E,I){E.set(R,I)}:function(R,E,I){for(var v=0;v>>0;if(!E)return this._push(y,1,0);if(i.isString(R)){var I=f.alloc(E=s.length(R));s.decode(R,I,0),R=I}return this.uint32(E)._push(V,E,R)},f.prototype.string=function(R){var E=a.length(R);return E?this.uint32(E)._push(a.write,E,R):this._push(y,1,0)},f.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(d,0,0),this.len=0,this},f.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 l(d,0,0),this.len=0),this},f.prototype.ldelim=function(){var R=this.head,E=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=R.next,this.tail=E,this.len+=I),this},f.prototype.finish=function(){for(var R=this.head.next,E=this.constructor.alloc(this.len),I=0;R;)R.fn(R.val,E,I),I+=R.len,R=R.next;return E},f._configure=function(Z){o=Z,f.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(l,d,u){d.set(l,u)}:function(l,d,u){if(l.copy)l.copy(d,u,0,l.length);else for(var f=0;f>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,l),this};function s(a,l,d){a.length<40?o.utf8.write(a,l,d):l.utf8Write?l.utf8Write(a,d):l.write(a,d)}r.prototype.string=function(l){var d=o.Buffer.byteLength(l);return this.uint32(d),d&&this._push(s,d,l),this},r._configure()},{15:15,16:16}]},{},[8])})()});var pCe=ad((Wmo,_B)=>{var wmo=_(T());/* 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,f){f=f||{};var p=f.encodedMaskData||f.encodedMaskData===null,y=l(u,f.inputOffset||0,p),h=f.noDataValue!==null?f.noDataValue:o.defaultNoDataValue,g=r(y,f.pixelType||Float32Array,f.encodedMaskData,h,f.returnMask),x={width:y.width,height:y.height,pixelData:g.resultPixels,minValue:g.minValue,maxValue:y.pixels.maxValue,noDataValue:h};return g.resultMask&&(x.maskData=g.resultMask),f.returnEncodedMask&&y.mask&&(x.encodedMaskData=y.mask.bitset?y.mask.bitset:null),f.returnFileInfo&&(x.fileInfo=s(y),f.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(y))),x};var r=function(u,f,p,y,h){var g=0,x=u.pixels.numBlocksX,S=u.pixels.numBlocksY,V=Math.floor(u.width/x),Z=Math.floor(u.height/S),R=2*u.maxZError,E=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new f(u.width*u.height),h&&p&&(P=new Uint8Array(u.width*u.height));for(var F=new Float32Array(V*Z),N,b,G=0;G<=S;G++){var X=G!==S?Z:u.height%S;if(X!==0)for(var W=0;W<=x;W++){var A=W!==x?V:u.width%x;if(A!==0){var k=G*u.width*Z+W*V,B=u.width-A,O=u.pixels.blocks[g],H,U,K;O.encoding<2?(O.encoding===0?H=O.rawData:(d(O.stuffedData,O.bitsPerPixel,O.numValidPixels,O.offset,R,F,u.pixels.maxValue),H=F),U=0):O.encoding===2?K=0:K=O.offset;var Q;if(p)for(b=0;b>3],Q<<=k&7),N=0;N>3]),Q&128?(P&&(P[k]=1),I=O.encoding<2?H[U++]:K,E=E>I?I:E,v[k++]=I):(P&&(P[k]=0),v[k++]=y),Q<<=1;k+=B}else if(O.encoding<2)for(b=0;bI?I:E,v[k++]=I;k+=B}else for(E=E>K?K:E,b=0;b0){var x=new Uint8Array(Math.ceil(y.width*y.height/8));g=new DataView(u,f,y.mask.numBytes);var S=g.getInt16(0,!0),V=2,Z=0;do{if(S>0)for(;S--;)x[Z++]=g.getUint8(V++);else{var R=g.getUint8(V++);for(S=-S;S--;)x[Z++]=R}S=g.getInt16(V,!0),V+=2}while(V0?1:0),P=I+(y.height%I>0?1:0);y.pixels.blocks=new Array(v*P);for(var F=0,N=0;N3)throw"Invalid block encoding ("+W.encoding+")";if(W.encoding===2){f++;continue}if(A!==0&&A!==2){if(A>>=6,W.offsetType=A,A===2)W.offset=g.getInt8(1),G++;else if(A===1)W.offset=g.getInt16(1,!0),G+=2;else if(A===0)W.offset=g.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(W.encoding===1)if(A=g.getUint8(G),G++,W.bitsPerPixel=A&63,A>>=6,W.numValidPixelsType=A,A===2)W.numValidPixels=g.getUint8(G),G++;else if(A===1)W.numValidPixels=g.getUint16(G,!0),G+=2;else if(A===0)W.numValidPixels=g.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(f+=G,W.encoding!==3){var k,B;if(W.encoding===0){var O=(y.pixels.numBytes-1)/4;if(O!==Math.floor(O))throw"uncompressed block has invalid length";k=new ArrayBuffer(O*4),B=new Uint8Array(k),B.set(new Uint8Array(u,f,O*4));var H=new Float32Array(k);W.rawData=H,f+=O*4}else if(W.encoding===1){var U=Math.ceil(W.numValidPixels*W.bitsPerPixel/8),K=Math.ceil(U/4);k=new ArrayBuffer(K*4),B=new Uint8Array(k),B.set(new Uint8Array(u,f,U)),W.stuffedData=new Uint32Array(k),f+=U}}}return y.eofOffset=f,y},d=function(u,f,p,y,h,g,x){var S=(1<=f)E=I>>>R-f&S,R-=f;else{var F=f-R;E=(I&S)<>>R}g[Z]=E=u?(R=E>>>Z-u&x,Z-=u):(I=u-Z,R=(E&x)<>>Z),d[V]=p[R];else for(v=Math.ceil((g-y)/h),V=0;V=u?(R=E>>>Z-u&x,Z-=u):(I=u-Z,R=(E&x)<>>Z),d[V]=R=d?(Z=R>>>V-d&h,V-=d):(S=d-V,Z=(R&h)<>>V),E[x]=Z=u?(E=I>>>R&x,Z-=u,R+=u):(v=u-Z,E=I>>>R&x,I=l[S++],Z=32-v,E|=(I&(1<=u?(E=I>>>R&x,Z-=u,R+=u):(v=u-Z,E=I>>>R&x,I=l[S++],Z=32-v,E|=(I&(1<=d?(Z=E>>>R&h,V-=d,R+=d):(S=d-V,Z=E>>>R&h,E=l[g++],V=32-S,Z|=(E&(1<=u?(x=S>>>g-u&p,g-=u):(V=u-g,x=(S&p)<>>g),d[h]=x;return d},originalUnstuff2:function(l,d,u,f){var p=(1<=u?(S=V>>>x&p,g-=u,x+=u):(Z=u-g,S=V>>>x&p,V=l[y++],g=32-Z,S|=(V&(1<=359?359:p;p-=h;do d+=l[y++]<<8,u+=d+=l[y++];while(--h);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return f&1&&(u+=d+=l[y]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(l,d){var u=d.ptr,f=new Uint8Array(l,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,f),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var y=new DataView(l,u,8),h=y.getInt32(0,!0);p.fileVersion=h,u+=4,h>=3&&(p.checksum=y.getUint32(4,!0),u+=4),y=new DataView(l,u,12),p.height=y.getUint32(0,!0),p.width=y.getUint32(4,!0),u+=8,h>=4?(p.numDims=y.getUint32(8,!0),u+=4):p.numDims=1,y=new DataView(l,u,40),p.numValidPixel=y.getUint32(0,!0),p.microBlockSize=y.getInt32(4,!0),p.blobSize=y.getInt32(8,!0),p.imageType=y.getInt32(12,!0),p.maxZError=y.getFloat64(16,!0),p.zMin=y.getFloat64(24,!0),p.zMax=y.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var g,x;if(h>=3&&(x=h>=4?52:48,g=this.computeChecksumFletcher32(new Uint8Array(l,u-x,p.blobSize-14)),g!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,d){var u=d.headerInfo,f=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),y=this.readSubArray(l,d.ptr,f,p),h=this.readSubArray(l,d.ptr+p,f,p);d.ptr+=2*p;var g,x=!0;for(g=0;g0){x=new Uint8Array(Math.ceil(p/8)),h=new DataView(l,u,g.numBytes);var V=h.getInt16(0,!0),Z=2,R=0,E=0;do{if(V>0)for(;V--;)x[R++]=h.getUint8(Z++);else for(E=h.getUint8(Z++),V=-V;V--;)x[R++]=E;V=h.getInt16(Z,!0),Z+=2}while(Z>3],I<<=v&7):I=x[v>>3],I&128&&(S[v]=1);d.pixels.resultMask=S,g.bitset=x,u+=g.numBytes}return d.ptr=u,d.mask=g,!0},readDataOneSweep:function(l,d,u){var f=d.ptr,p=d.headerInfo,y=p.numDims,h=p.width*p.height,g=p.imageType,x=p.numValidPixel*r.getDataTypeSize(g)*y,S,V=d.pixels.resultMask;if(u===Uint8Array)S=new Uint8Array(l,f,x);else{var Z=new ArrayBuffer(x),R=new Uint8Array(Z);R.set(new Uint8Array(l,f,x)),S=new u(Z)}if(S.length===h*y)d.pixels.resultPixels=S;else{d.pixels.resultPixels=new u(h*y);var E=0,I=0,v=0,P=0;if(y>1)for(v=0;v=g)return!1;var x=new Uint32Array(g-h);r.decodeBits(l,d,x);var S=[],V,Z,R,E;for(V=h;V0&&(S[Z].second=G<>>32-E,32-b>=E?(b+=E,b===32&&(b=0,X++,G=N[X])):(b+=E-32,X++,G=N[X],S[Z].second|=G>>>32-b));var W=0,A=0,k=new s;for(V=0;V=u?A=u:A=W,W>=30&&console.log("WARning, large NUM LUT BITS IS "+W);var B=[],O,H,U,K,Q,ie;for(V=h;V0)if(O=[E,Z],E<=A)for(H=S[Z].second<=0;K--)Q=H>>>K&1,Q?(ie.right||(ie.right=new s),ie=ie.right):(ie.left||(ie.left=new s),ie=ie.left),K===0&&!ie.val&&(ie.val=O[1]);return{decodeLut:B,numBitsLUTQick:A,numBitsLUT:W,tree:k,stuffedData:N,srcPtr:X,bitPos:b}},readHuffman:function(l,d,u){var f=d.headerInfo,p=f.numDims,y=d.headerInfo.height,h=d.headerInfo.width,g=h*y,x=this.readHuffmanTree(l,d),S=x.decodeLut,V=x.tree,Z=x.stuffedData,R=x.srcPtr,E=x.bitPos,I=x.numBitsLUTQick,v=x.numBitsLUT,P=d.headerInfo.imageType===0?128:0,F,N,b,G=d.pixels.resultMask,X,W,A,k,B,O,H,U=0;E>0&&(R++,E=0);var K=Z[R],Q=d.encodeMode===1,ie=new u(g*p),j=ie,$;for($=0;$1&&(j=new u(ie.buffer,g*$,g),U=0),d.headerInfo.numValidPixel===h*y)for(O=0,k=0;k>>32-I,W=X,32-E>>64-E-I,W=X),S[W])N=S[W][1],E+=S[W][0];else for(X=K<>>32-v,W=X,32-E>>64-E-v,W=X),F=V,H=0;H>>v-H-1&1,F=A?F.right:F.left,!(F.left||F.right)){N=F.val,E=E+H+1;break}E>=32&&(E-=32,R++,K=Z[R]),b=N-P,Q?(B>0?b+=U:k>0?b+=j[O-h]:b+=U,b&=255,j[O]=b,U=b):j[O]=b}else for(O=0,k=0;k>>32-I,W=X,32-E>>64-E-I,W=X),S[W])N=S[W][1],E+=S[W][0];else for(X=K<>>32-v,W=X,32-E>>64-E-v,W=X),F=V,H=0;H>>v-H-1&1,F=A?F.right:F.left,!(F.left||F.right)){N=F.val,E=E+H+1;break}E>=32&&(E-=32,R++,K=Z[R]),b=N-P,Q?(B>0&&G[O-1]?b+=U:k>0&&G[O-h]?b+=j[O-h]:b+=U,b&=255,j[O]=b,U=b):j[O]=b}d.ptr=d.ptr+(R+1)*4+(E>0?4:0)}d.pixels.resultPixels=ie},decodeBits:function(l,d,u,f,p){{var y=d.headerInfo,h=y.fileVersion,g=0,x=new DataView(l,d.ptr,5),S=x.getUint8(0);g++;var V=S>>6,Z=V===0?4:3-V,R=(S&32)>0,E=S&31,I=0;if(Z===1)I=x.getUint8(g),g++;else if(Z===2)I=x.getUint16(g,!0),g+=2;else if(Z===4)I=x.getUint32(g,!0),g+=4;else throw"Invalid valid pixel count type";var v=2*y.maxZError,P,F,N,b,G,X,W,A,k,B,O=y.numDims>1?y.maxValues[p]:y.zMax;if(R){for(d.counter.lut++,A=x.getUint8(g),k=E,g++,b=Math.ceil((A-1)*E/8),G=Math.ceil(b/4),F=new ArrayBuffer(G*4),N=new Uint8Array(F),d.ptr+=g,N.set(new Uint8Array(l,d.ptr,b)),W=new Uint32Array(F),d.ptr+=b,B=0;A-1>>>B;)B++;b=Math.ceil(I*B/8),G=Math.ceil(b/4),F=new ArrayBuffer(G*4),N=new Uint8Array(F),N.set(new Uint8Array(l,d.ptr,b)),P=new Uint32Array(F),d.ptr+=b,h>=3?X=o.unstuffLUT2(W,E,A-1,f,v,O):X=o.unstuffLUT(W,E,A-1,f,v,O),h>=3?o.unstuff2(P,u,B,I,X):o.unstuff(P,u,B,I,X)}else d.counter.bitstuffer++,B=E,d.ptr+=g,B>0&&(b=Math.ceil(I*B/8),G=Math.ceil(b/4),F=new ArrayBuffer(G*4),N=new Uint8Array(F),N.set(new Uint8Array(l,d.ptr,b)),P=new Uint32Array(F),d.ptr+=b,h>=3?f==null?o.originalUnstuff2(P,u,B,I):o.unstuff2(P,u,B,I,!1,f,v,O):f==null?o.originalUnstuff(P,u,B,I):o.unstuff(P,u,B,I,!1,f,v,O))}},readTiles:function(l,d,u){var f=d.headerInfo,p=f.width,y=f.height,h=f.microBlockSize,g=f.imageType,x=r.getDataTypeSize(g),S=Math.ceil(p/h),V=Math.ceil(y/h);d.pixels.numBlocksY=V,d.pixels.numBlocksX=S,d.pixels.ptr=0;var Z=0,R=0,E=0,I=0,v=0,P=0,F=0,N=0,b=0,G=0,X=0,W=0,A=0,k=0,B=0,O=0,H,U,K,Q,ie,j,$=new u(h*h),ne=y%h||h,be=p%h||h,Ce,me,_e=f.numDims,Ve,Ie=d.pixels.resultMask,Ze=d.pixels.resultPixels;for(E=0;E1&&(Ze=new u(d.pixels.resultPixels.buffer,p*y*Ve*x,p*y)),F=l.byteLength-d.ptr,H=new DataView(l,d.ptr,Math.min(10,F)),U={},O=0,N=H.getUint8(0),O++,b=N>>6&255,G=N>>2&15,G!==(I*h>>3&15))throw"integrity issue";if(j=N&3,j>3)throw d.ptr+=O,"Invalid block encoding ("+j+")";if(j===2){d.counter.constant++,d.ptr+=O;continue}else if(j===0){if(d.counter.uncompressed++,d.ptr+=O,A=v*P*x,k=l.byteLength-d.ptr,A=A1)for(y=0;y=-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(l){var d=0;switch(l){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=l}return d},getDataTypeUsed:function(l,d){var u=l;switch(l){case 2:case 4:u=l-d;break;case 3:case 5:u=l-2*d;break;case 6:d===0?u=l:d===1?u=2:u=1;break;case 7:d===0?u=l:u=l-2*d+1;break;default:u=l;break}return u},getOnePixel:function(l,d,u,f){var p=0;switch(u){case 0:p=f.getInt8(d);break;case 1:p=f.getUint8(d);break;case 2:p=f.getInt16(d,!0);break;case 3:p=f.getUint16(d,!0);break;case 4:p=f.getInt32(d,!0);break;case 5:p=f.getUInt32(d,!0);break;case 6:p=f.getFloat32(d,!0);break;case 7:p=f.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(l,d,u){this.val=l,this.left=d,this.right=u},a={decode:function(l,d){d=d||{};var u=d.noDataValue,f=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(l,p)){var y=p.headerInfo,h=y.fileVersion,g=r.getDataTypeArray(y.imageType);r.readMask(l,p),y.numValidPixel!==y.width*y.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var x=y.width*y.height;if(p.pixels.resultPixels=new g(x*y.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},y.numValidPixel!==0)if(y.zMax===y.zMin)r.constructConstantSurface(p);else if(h>=4&&r.checkMinMaxRanges(l,p))r.constructConstantSurface(p);else{var S=new DataView(l,p.ptr,2),V=S.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(l,p,g);else if(h>1&&y.imageType<=1&&Math.abs(y.maxZError-.5)<1e-5){var Z=S.getUint8(1);if(p.ptr++,p.encodeMode=Z,Z>2||h<4&&Z>1)throw"Invalid Huffman flag "+Z;Z?r.readHuffman(l,p,g):r.readTiles(l,p,g)}else r.readTiles(l,p,g)}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 E={width:y.width,height:y.height,pixelData:p.pixels.resultPixels,minValue:y.zMin,maxValue:y.zMax,validPixelCount:y.numValidPixel,dimCount:y.numDims,dimStats:{minValues:y.minValues,maxValues:y.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(y.imageType,u)){var I=p.pixels.resultMask;for(f=0;f1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&h.push(V.maskData),f++,S.pixels.push(V.pixelData),S.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var Z,R,E;if(u>1&&h.length>1){for(E=S.width*S.height,S.bandMasks=h,x=new Uint8Array(E),x.set(h[0]),Z=1;Z{var d9o=_(T());e1e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1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AAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var i1e=ad((u9o,n1e)=>{var m9o=_(T()),{webm:LVt,mp4:ZVt}=t1e(),cq=()=>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,lq=()=>"wakeLock"in navigator,dq=class{constructor(){if(this.enabled=!1,lq()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else cq()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",LVt),this._addSourceToVideo(this.noSleepVideo,"mp4",ZVt),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 lq()?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}):cq()?(this.disable(),console.warn(` + */(function(e){"use strict";(function(n,i,o){function r(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},r,c,c.exports),c.exports}var s=r(o[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof OM=="object"&&OM&&OM.exports&&(OM.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=o;function o(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=d;var o=t(12),r,s=o.LongBits,a=o.utf8;function c(R,C){return RangeError("index out of range: "+R.pos+" + "+(C||1)+" > "+R.len)}function d(R){this.buf=R,this.pos=0,this.len=R.length,this.view=null,this.discardUnknown=d.discardUnknown}function u(R){if(Array.isArray(R)&&(R=new Uint8Array(R)),R instanceof Uint8Array)return new d(R);throw Error("illegal buffer")}var m=function(){return o.Buffer?function(E){return(d.create=function(L){return o.Buffer.isBuffer(L)?new r(L):u(L)})(E)}:u};d.create=m(),d.prototype.raw=function(C,E){return this.buf.subarray(C,E)};function p(R){for(var C=0,E=0;E<4;++E){if(R.pos>=R.len)throw c(R);var A=R.buf[R.pos++];if(C=(C|(A&127)<>>0,A<128)return C}throw c(R)}d.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var C=this.buf,E=this.pos,A=(C[E]&127)>>>0;if(C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<7)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<14)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<21)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&15)<<28)>>>0,C[E++]<128)return this.pos=E,A;for(var L=0;L<5;++L){if(E>=this.len)throw this.pos=E,c(this);if(C[E++]<128)return this.pos=E,A}throw this.pos=E,Error("invalid varint encoding")},d.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var C=this.buf,E=this.pos,A=(C[E]&127)>>>0;if(C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<7)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<14)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<21)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&15)<<28)>>>0,C[E]<128&&(C[E]&112)===0)return this.pos=E+1,A;throw this.pos=E+1,Error("invalid tag encoding")},d.prototype.int32=function(){return this.uint32()|0},d.prototype.sint32=function(){var C=this.uint32();return C>>>1^-(C&1)|0};function b(){var R=new s(0,0),C=0;if(this.len-this.pos>4){for(;C<4;++C)if(R.lo=(R.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R;if(R.lo=(R.lo|(this.buf[this.pos]&127)<<28)>>>0,R.hi=(R.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return R;C=0}else{for(;C<4;++C){if(this.pos>=this.len)throw c(this);if(R.lo=(R.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}throw c(this)}if(this.len-this.pos>4){for(;C<5;++C)if(R.hi=(R.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}else for(;C<5;++C){if(this.pos>=this.len)throw c(this);if(R.hi=(R.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}throw Error("invalid varint encoding")}d.prototype.bool=function(){for(var C=!1,E,A=0;A<10;++A){if(this.pos>=this.len)throw c(this);if(E=this.buf[this.pos++],E&127&&(C=!0),E<128)return C}throw Error("invalid varint encoding")};function f(R,C){return(R[C-4]|R[C-3]<<8|R[C-2]<<16|R[C-1]<<24)>>>0}d.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return f(this.buf,this.pos+=4)},d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return f(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}d.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var C=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,C},d.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var C=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,C},d.prototype.uint32s=function(C){C===e&&(C=[]);var E=this.uint32()+this.pos,A=this.len,L=this.buf,F=this.pos,I;if(E>A)throw c(this,E-this.pos);for(this.len=E;FA)throw c(this,E-this.pos);for(this.len=E;FA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;Fthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,S);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,S);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,_);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>3,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,_);if(N)for(var g=0;gA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;this.posthis.len)throw c(this,E);var F=E>>>3;C.length=L+F;for(var I=0;Ithis.len)throw c(this,E);var F=E>>>3;C.length=L+F;for(var I=0;Ithis.len)throw c(this,C);return this.pos=A,this.raw(E,A)},d.prototype.string=function(){var C=this.uint32(),E=this.pos,A=this.pos+C;if(A>this.len)throw c(this,C);return this.pos=A,a.read(this.buf,E,A)},d.prototype.stringVerify=function(){var C=this.uint32(),E=this.pos,A=this.pos+C;if(A>this.len)throw c(this,C);return this.pos=A,a.readStrict(this.buf,E,A)},d.prototype.skip=function(C){if(typeof C=="number"){if(this.pos+C>this.len)throw c(this,C);this.pos+=C}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},d.recursionLimit=o.recursionLimit,d.discardUnknown=!0,d.prototype.skipType=function(R,C,E){if(C===e&&(C=0),C>d.recursionLimit)throw Error("max depth exceeded");if(E===0)throw Error("illegal tag: field number 0");switch(R){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var A=this.tag(),L=A>>>3;if(R=A&7,!L)throw Error("illegal tag: field number 0");if(R===4){if(E!==e&&L!==E)throw Error("invalid end group tag");break}this.skipType(R,C+1,L)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+R+" at offset "+this.pos)}return this},d._configure=function(R){r=R,d.create=m(),r._configure();var C=o.Long?"toLong":"toNumber";o.merge(d.prototype,{int64:function(){return b.call(this)[C](!1)},uint64:function(){return b.call(this)[C](!0)},sint64:function(){return b.call(this).zzDecode()[C](!1)},fixed64:function(){return y.call(this)[C](!0)},sfixed64:function(){return y.call(this)[C](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var o=t(2);s.prototype=Object.create(o.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var r=t(12);function s(a){o.call(this,a)}s._configure=function(){r.Buffer&&(s.prototype._slice=r.Buffer.prototype.slice)},s.prototype.raw=function(c,d){return this._slice.call(this.buf,c,d)},s.prototype.string=function(){var c=this.uint32(),d=this.pos,u=this.pos+c;if(u>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=u,this.buf.utf8Slice?this.buf.utf8Slice(d,u):this.buf.toString("utf-8",d,u)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var o=i;o.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=r;var o=t(12);r.prototype=Object.create(o.EventEmitter.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});function r(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}r.prototype.rpcCall=function s(a,c,d,u,m){if(!u)throw TypeError("request must be specified");var p=this;if(!m)return o.asPromise(s,p,a,c,d,u);if(!p.rpcImpl)return setTimeout(function(){m(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(f,y){if(f)return p.emit("error",f,a),m(f);if(y===null)return p.end(!0),e;if(!(y instanceof d))try{y=d[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(_){return p.emit("error",_,a),m(_)}return p.emit("data",y,a),m(null,y)})}catch(b){return p.emit("error",b,a),setTimeout(function(){m(b)},0),e}},r.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=o;function o(r,s){for(var a=new Array(arguments.length-1),c=0,d=2,u=!0;d0&&b.charAt(f-1)==="=";)--f;return Math.floor(f*3/4)};for(var r=new Array(64),s=new Array(123),a=0;a<64;)s[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,o.encode=function(b,f,y){for(var _=null,S=[],Z=0,R=0,C;f>2],C=(E&3)<<4,R=1;break;case 1:S[Z++]=r[C|E>>4],C=(E&15)<<2,R=2;break;case 2:S[Z++]=r[C|E>>6],S[Z++]=r[E&63],R=0;break}Z>8191&&((_||(_=[])).push(String.fromCharCode.apply(String,S)),Z=0)}return R&&(S[Z++]=r[C],S[Z++]=61,R===1&&(S[Z++]=61)),_?(Z&&_.push(String.fromCharCode.apply(String,S.slice(0,Z))),_.join("")):String.fromCharCode.apply(String,S.slice(0,Z))};var c="invalid encoding";o.decode=function(b,f,y){for(var _=y,S=0,Z,R=0;R1)break;if((C=s[C])===e)throw Error(c);switch(S){case 0:Z=C,S=1;break;case 1:f[y++]=Z<<2|(C&48)>>4,Z=C,S=2;break;case 2:f[y++]=(Z&15)<<4|(C&60)>>2,Z=C,S=3;break;case 3:f[y++]=(Z&3)<<6|C,S=0;break}}if(S===1)throw Error(c);return y-_};var d=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,u=/[-_]/,m=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;o.test=function(b){return d.test(b)||u.test(b)&&m.test(b)}},{}],9:[function(t,n,i){"use strict";n.exports=o;function o(){this._listeners=Object.create(null)}o.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},o.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var d=0;d0?0:2147483648,f,y);else if(isNaN(b))p(2143289344,f,y);else if(b>34028234663852886e22)p((_<<31|2139095040)>>>0,f,y);else if(b<11754943508222875e-54)p((_<<31|Math.round(b/1401298464324817e-60))>>>0,f,y);else{var S=Math.floor(Math.log(b)/Math.LN2),Z=Math.round(b*Math.pow(2,-S)*8388608)&8388607;p((_<<31|S+127<<23|Z)>>>0,f,y)}}d.writeFloatLE=u.bind(null,r),d.writeFloatBE=u.bind(null,s);function m(p,b,f){var y=p(b,f),_=(y>>31)*2+1,S=y>>>23&255,Z=y&8388607;return S===255?Z?NaN:_*(1/0):S===0?_*1401298464324817e-60*Z:_*Math.pow(2,S-150)*(Z+8388608)}d.readFloatLE=m.bind(null,a),d.readFloatBE=m.bind(null,c)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),m=new Uint8Array(u.buffer),p=m[7]===128;function b(S,Z,R){u[0]=S,Z[R]=m[0],Z[R+1]=m[1],Z[R+2]=m[2],Z[R+3]=m[3],Z[R+4]=m[4],Z[R+5]=m[5],Z[R+6]=m[6],Z[R+7]=m[7]}function f(S,Z,R){u[0]=S,Z[R]=m[7],Z[R+1]=m[6],Z[R+2]=m[5],Z[R+3]=m[4],Z[R+4]=m[3],Z[R+5]=m[2],Z[R+6]=m[1],Z[R+7]=m[0]}d.writeDoubleLE=p?b:f,d.writeDoubleBE=p?f:b;function y(S,Z){return m[0]=S[Z],m[1]=S[Z+1],m[2]=S[Z+2],m[3]=S[Z+3],m[4]=S[Z+4],m[5]=S[Z+5],m[6]=S[Z+6],m[7]=S[Z+7],u[0]}function _(S,Z){return m[7]=S[Z],m[6]=S[Z+1],m[5]=S[Z+2],m[4]=S[Z+3],m[3]=S[Z+4],m[2]=S[Z+5],m[1]=S[Z+6],m[0]=S[Z+7],u[0]}d.readDoubleLE=p?y:_,d.readDoubleBE=p?_:y})():(function(){function u(p,b,f,y,_,S){var Z=y<0?1:0;if(Z&&(y=-y),y===0)p(0,_,S+b),p(1/y>0?0:2147483648,_,S+f);else if(isNaN(y))p(0,_,S+b),p(2146959360,_,S+f);else if(y>17976931348623157e292)p(0,_,S+b),p((Z<<31|2146435072)>>>0,_,S+f);else{var R;if(y<22250738585072014e-324)R=y/5e-324,p(R>>>0,_,S+b),p((Z<<31|R/4294967296)>>>0,_,S+f);else{var C=Math.floor(Math.log(y)/Math.LN2);C===1024&&(C=1023),R=y*Math.pow(2,-C),p(R*4503599627370496>>>0,_,S+b),p((Z<<31|C+1023<<20|R*1048576&1048575)>>>0,_,S+f)}}}d.writeDoubleLE=u.bind(null,r,0,4),d.writeDoubleBE=u.bind(null,s,4,0);function m(p,b,f,y,_){var S=p(y,_+b),Z=p(y,_+f),R=(Z>>31)*2+1,C=Z>>>20&2047,E=4294967296*(Z&1048575)+S;return C===2047?E?NaN:R*(1/0):C===0?R*5e-324*E:R*Math.pow(2,C-1075)*(E+4503599627370496)}d.readDoubleLE=m.bind(null,a,0,4),d.readDoubleBE=m.bind(null,c,4,0)})(),d}function r(d,u,m){u[m]=d&255,u[m+1]=d>>>8&255,u[m+2]=d>>>16&255,u[m+3]=d>>>24}function s(d,u,m){u[m]=d>>>24,u[m+1]=d>>>16&255,u[m+2]=d>>>8&255,u[m+3]=d&255}function a(d,u){return(d[u]|d[u+1]<<8|d[u+2]<<16|d[u+3]<<24)>>>0}function c(d,u){return(d[u]<<24|d[u+1]<<16|d[u+2]<<8|d[u+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=r;var o;function r(d,u){this.lo=d>>>0,this.hi=u>>>0}var s=r.zero=new r(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return s;var m=u<0;m&&(u=-u);var p=u>>>0,b=(u-p)/4294967296>>>0;return m&&(b=~b>>>0,p=~p>>>0,++p>4294967295&&(p=0,++b>4294967295&&(b=0))),new r(p,b)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(typeof u=="string"||u instanceof String)if(o)u=o.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):s},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var m=~this.lo+1>>>0,p=~this.hi>>>0;return m||(p=p+1>>>0),-(m+p*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return o?new o(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var c=String.prototype.charCodeAt;r.fromHash=function(u){return u===a?s:new r((c.call(u,0)|c.call(u,1)<<8|c.call(u,2)<<16|c.call(u,3)<<24)>>>0,(c.call(u,4)|c.call(u,5)<<8|c.call(u,6)<<16|c.call(u,7)<<24)>>>0)},r.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)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,m=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?m===0?u<16384?u<128?1:2:u<2097152?3:4:m<16384?m<128?5:6:m<2097152?7:8:p<128?9:10},r._configure=function(d){o=d}},{}],12:[function(t,n,i){"use strict";var o=i;o.asPromise=t(7),o.base64=t(8),o.EventEmitter=t(9),o.float=t(10),o.utf8=t(14),o.pool=t(13),o.LongBits=t(11);function r(c){return c==="__proto__"||c==="prototype"||c==="constructor"}o.isUnsafeProperty=r,o.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),o.global=o.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d},o.isString=function(d){return typeof d=="string"||d instanceof String},o.isObject=function(d){return d&&typeof d=="object"},o.isset=o.isSet=function(d,u){var m=d[u];return m!=null&&Object.hasOwnProperty.call(d,u)?typeof m!="object"||(Array.isArray(m)?m.length:Object.keys(m).length)>0:!1},o.Buffer=(function(){try{var c=o.global.Buffer;return c.prototype.utf8Write||o.isNode?c:null}catch{return null}})(),o.newBuffer=function(d){var u=o.Buffer;return typeof d=="number"?u?u.allocUnsafe(d):new Uint8Array(d):u?u.from(d):new Uint8Array(d)},o.rawField=function(d,u,m){var p=[],b=d<<3|u;for(b>>>=0;b>127;)p.push(b&127|128),b>>>=7;p.push(b);for(var f=0;f-1;--b)if(u[p[b]]===1&&this[p[b]]!==e&&this[p[b]]!==null)return p[b]}},o.oneOfSetter=function(d){return function(u){for(var m=0;m>>1,u=null,m=c;return function(b){if(b<1||b>d)return r(b);m+b>c&&(u=r(c),m=0);var f=s.call(u,m,m+=b);return m&7&&(m=(m|7)+1),f}}},{}],14:[function(t,n,i){"use strict";var o=i,r=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=r}o.length=function(u){for(var m=0,p=0,b=0;b=a)return c(r,u,m,p);for(var b="",f=m,y,_,S,Z,R,C,E,A;f+7=a)return c(s,u,m,p);for(var b="",f=m,y,_,S,Z,R,C,E,A;f+7>6|192,m[p++]=f&63|128):(f&64512)===55296&&((y=u.charCodeAt(_+1))&64512)===56320?(f=65536+((f&1023)<<10)+(y&1023),++_,m[p++]=f>>18|240,m[p++]=f>>12&63|128,m[p++]=f>>6&63|128,m[p++]=f&63|128):(m[p++]=f>>12|224,m[p++]=f>>6&63|128,m[p++]=f&63|128);return p-b}},{}],15:[function(t,n,i){"use strict";n.exports=d;var o=t(12),r,s=o.LongBits,a=o.base64,c=o.utf8;function d(){this.pos=0,this.buf=this.constructor.alloc(d.initialBufferSize),this.view=null,this.states=null}d.initialBufferSize=128,Object.defineProperty(d.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var u=function(){return o.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=u(),d.alloc=function(C){return new Uint8Array(C)},d.alloc=o.pool(d.alloc,Uint8Array.prototype.subarray);function m(R){return R<128?1:R<16384?2:R<2097152?3:R<268435456?4:5}d.prototype._reserve=function(C){var E=this.pos+C;if(E>this.buf.length){var A=this.buf.length<<1;A127;)C[E++]=R&127|128,R>>>=7;return C[E]=R,E+1}d.prototype.uint32=function(C){C=C>>>0,this._reserve(5);var E=this.pos;return this.pos=b(C,this.buf,E),this},d.prototype.int32=function(C){return(C|=0)<0?(this._reserve(10),f(s.fromNumber(C),this.buf,this.pos),this.pos+=10,this):this.uint32(C)},d.prototype.sint32=function(C){return this.uint32((C<<1^C>>31)>>>0)};function f(R,C,E){for(var A=R.lo,L=R.hi;L;)C[E++]=A&127|128,A=(A>>>7|L<<25)>>>0,L>>>=7;for(;A>127;)C[E++]=A&127|128,A=A>>>7;return C[E]=A,E+1}d.prototype.uint64=function(C){var E=s.from(C);this._reserve(10);var A=this.pos;return this.pos=f(E,this.buf,A),this},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(C){var E=s.from(C).zzEncode();this._reserve(10);var A=this.pos;return this.pos=f(E,this.buf,A),this},d.prototype.bool=function(C){return this._reserve(1),this.buf[this.pos++]=C?1:0,this};function y(R,C,E){C[E]=R&255,C[E+1]=R>>>8&255,C[E+2]=R>>>16&255,C[E+3]=R>>>24}d.prototype.fixed32=function(C){return this._reserve(4),y(C>>>0,this.buf,this.pos),this.pos+=4,this},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(C){var E=s.from(C);return this._reserve(8),y(E.lo,this.buf,this.pos),y(E.hi,this.buf,this.pos+4),this.pos+=8,this},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(C){return this._reserve(4),o.float.writeFloatLE(C,this.buf,this.pos),this.pos+=4,this},d.prototype.double=function(C){return this._reserve(8),o.float.writeDoubleLE(C,this.buf,this.pos),this.pos+=8,this},d.prototype.bytes=function(C){var E=C.length>>>0;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(o.isString(C)){var A=d.alloc(E=a.length(C));a.decode(C,A,0),C=A}return this.uint32(E),this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this},d.prototype.raw=function(C){var E=C.length>>>0;return E?(this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this):this},d.prototype._delim=function(C,E){var A=m(E);return A>1&&this.buf.copyWithin(C+A,C+1,C+1+E),b(E,this.buf,C),this.pos=C+A+E,this},d.prototype.string=function(C){var E=C.length;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(E<128){this._reserve(E*3+5);var A=this.pos;return this._delim(A,c.write(C,this.buf,A+1))}var L=c.length(C);return this.uint32(L),this._reserve(L),L===C.length?p(C,this.buf,this.pos):c.write(C,this.buf,this.pos),this.pos+=L,this},d.prototype.uint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var A=this.buf,L=this.pos,F=L+1,I=0;I>>0,A,F);return this._delim(L,F-L-1)},d.prototype.int32s=function(C){var E=C.length;this._reserve(E*10+5);for(var A=this.buf,L=this.pos,F=L+1,I,N=0;N>31)>>>0,A,F);return this._delim(L,F-L-1)},d.prototype.uint64s=function(C){var E=C.length;this._reserve(E*10+5);for(var A=this.buf,L=this.pos,F=L+1,I=0;I>>0,!0),L+=4;else{var N=this.buf;for(F=0;F>>0,N,L),L+=4}return this.pos+=A,this},d.prototype.sfixed32s=d.prototype.fixed32s,d.prototype.fixed64s=function(C){var E=C.length,A=E*8;this.uint32(A),this._reserve(A);var L=this.pos,F,I,N=Z(this,E,S);if(N)for(F=0;F1?(this._reserve(A-1),this.buf.copyWithin(L+A,L+1,L+1+E),this.pos+=A-1,b(E,this.buf,L)):this.buf[L]=E}else E=this.pos,A=m(E),this._reserve(A),this.buf.copyWithin(A,0,E),b(E,this.buf,0),this.pos+=A;return this},d.prototype.finish=function(C){if(C)return this.buf.subarray(0,this.pos);var E=this.constructor.alloc(this.pos);return E.set(this.buf.subarray(0,this.pos),0),E},d.prototype.finishInto=function(C,E){return E===e&&(E=0),C.set(this.buf.subarray(0,this.pos),E),C},d._configure=function(R){r=R,d.create=u(),r._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var o=t(15);s.prototype=Object.create(o.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var r=t(12);function s(){o.call(this)}var a;s._configure=function(){s.alloc=r.Buffer&&r.Buffer.allocUnsafe,a=r.Buffer&&r.Buffer.prototype.utf8Write?function(d,u,m){return u.utf8Write(d,m)}:function(d,u,m){return u.write(d,m)}},s.prototype.bytes=function(d){r.isString(d)&&(d=r.Buffer.from(d,"base64"));var u=d.length>>>0;return this.uint32(u),u&&(this._reserve(u),this.buf.set(d,this.pos),this.pos+=u),this},s.prototype.string=function(d){var u=d.length;if(!u)return this._reserve(1),this.buf[this.pos++]=0,this;if(u<128){this._reserve(u*3+5);var m=this.pos,p=this.buf;return this._delim(m,u<40?r.utf8.write(d,p,m+1):a(d,p,m+1))}var b=r.Buffer.byteLength(d);return this.uint32(b),this._reserve(b),a(d,this.buf,this.pos),this.pos+=b,this},s._configure()},{12:12,15:15}]},{},[1])})()});var dPe=gm((uAo,KK)=>{var mAo=x(T());/* 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,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,b=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,y=r(b,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:b.width,height:b.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:b.pixels.maxValue,noDataValue:f};return y.resultMask&&(_.maskData=y.resultMask),m.returnEncodedMask&&b.mask&&(_.encodedMaskData=b.mask.bitset?b.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(b),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(b))),_};var r=function(u,m,p,b,f){var y=0,_=u.pixels.numBlocksX,S=u.pixels.numBlocksY,Z=Math.floor(u.width/_),R=Math.floor(u.height/S),C=2*u.maxZError,E=Number.MAX_VALUE,A;p=p||(u.mask?u.mask.bitset:null);var L,F;L=new m(u.width*u.height),f&&p&&(F=new Uint8Array(u.width*u.height));for(var I=new Float32Array(Z*R),N,g,V=0;V<=S;V++){var G=V!==S?R:u.height%S;if(G!==0)for(var v=0;v<=_;v++){var X=v!==_?Z:u.width%_;if(X!==0){var Y=V*u.width*R+v*Z,D=u.width-X,w=u.pixels.blocks[y],O,M,z;w.encoding<2?(w.encoding===0?O=w.rawData:(d(w.stuffedData,w.bitsPerPixel,w.numValidPixels,w.offset,C,I,u.pixels.maxValue),O=I),M=0):w.encoding===2?z=0:z=w.offset;var K;if(p)for(g=0;g>3],K<<=Y&7),N=0;N>3]),K&128?(F&&(F[Y]=1),A=w.encoding<2?O[M++]:z,E=E>A?A:E,L[Y++]=A):(F&&(F[Y]=0),L[Y++]=b),K<<=1;Y+=D}else if(w.encoding<2)for(g=0;gA?A:E,L[Y++]=A;Y+=D}else for(E=E>z?z:E,g=0;g0){var _=new Uint8Array(Math.ceil(b.width*b.height/8));y=new DataView(u,m,b.mask.numBytes);var S=y.getInt16(0,!0),Z=2,R=0;do{if(S>0)for(;S--;)_[R++]=y.getUint8(Z++);else{var C=y.getUint8(Z++);for(S=-S;S--;)_[R++]=C}S=y.getInt16(Z,!0),Z+=2}while(Z0?1:0),F=A+(b.height%A>0?1:0);b.pixels.blocks=new Array(L*F);for(var I=0,N=0;N3)throw"Invalid block encoding ("+v.encoding+")";if(v.encoding===2){m++;continue}if(X!==0&&X!==2){if(X>>=6,v.offsetType=X,X===2)v.offset=y.getInt8(1),V++;else if(X===1)v.offset=y.getInt16(1,!0),V+=2;else if(X===0)v.offset=y.getFloat32(1,!0),V+=4;else throw"Invalid block offset type";if(v.encoding===1)if(X=y.getUint8(V),V++,v.bitsPerPixel=X&63,X>>=6,v.numValidPixelsType=X,X===2)v.numValidPixels=y.getUint8(V),V++;else if(X===1)v.numValidPixels=y.getUint16(V,!0),V+=2;else if(X===0)v.numValidPixels=y.getUint32(V,!0),V+=4;else throw"Invalid valid pixel count type"}if(m+=V,v.encoding!==3){var Y,D;if(v.encoding===0){var w=(b.pixels.numBytes-1)/4;if(w!==Math.floor(w))throw"uncompressed block has invalid length";Y=new ArrayBuffer(w*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,w*4));var O=new Float32Array(Y);v.rawData=O,m+=w*4}else if(v.encoding===1){var M=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),z=Math.ceil(M/4);Y=new ArrayBuffer(z*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,M)),v.stuffedData=new Uint32Array(Y),m+=M}}}return b.eofOffset=m,b},d=function(u,m,p,b,f,y,_){var S=(1<=m)E=A>>>C-m&S,C-=m;else{var I=m-C;E=(A&S)<>>C}y[R]=E=u?(C=E>>>R-u&_,R-=u):(A=u-R,C=(E&_)<>>R),d[Z]=p[C];else for(L=Math.ceil((y-b)/f),Z=0;Z=u?(C=E>>>R-u&_,R-=u):(A=u-R,C=(E&_)<>>R),d[Z]=C=d?(R=C>>>Z-d&f,Z-=d):(S=d-Z,R=(C&f)<>>Z),E[_]=R=u?(E=A>>>C&_,R-=u,C+=u):(L=u-R,E=A>>>C&_,A=c[S++],R=32-L,E|=(A&(1<=u?(E=A>>>C&_,R-=u,C+=u):(L=u-R,E=A>>>C&_,A=c[S++],R=32-L,E|=(A&(1<=d?(R=E>>>C&f,Z-=d,C+=d):(S=d-Z,R=E>>>C&f,E=c[y++],Z=32-S,R|=(E&(1<=u?(_=S>>>y-u&p,y-=u):(Z=u-y,_=(S&p)<>>y),d[f]=_;return d},originalUnstuff2:function(c,d,u,m){var p=(1<=u?(S=Z>>>_&p,y-=u,_+=u):(R=u-y,S=Z>>>_&p,Z=c[b++],y=32-R,S|=(Z&(1<=359?359:p;p-=f;do d+=c[b++]<<8,u+=d+=c[b++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=d+=c[b]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,m=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var b=new DataView(c,u,8),f=b.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=b.getUint32(4,!0),u+=4),b=new DataView(c,u,12),p.height=b.getUint32(0,!0),p.width=b.getUint32(4,!0),u+=8,f>=4?(p.numDims=b.getUint32(8,!0),u+=4):p.numDims=1,b=new DataView(c,u,40),p.numValidPixel=b.getUint32(0,!0),p.microBlockSize=b.getInt32(4,!0),p.blobSize=b.getInt32(8,!0),p.imageType=b.getInt32(12,!0),p.maxZError=b.getFloat64(16,!0),p.zMin=b.getFloat64(24,!0),p.zMax=b.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var y,_;if(f>=3&&(_=f>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,m=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),b=this.readSubArray(c,d.ptr,m,p),f=this.readSubArray(c,d.ptr+p,m,p);d.ptr+=2*p;var y,_=!0;for(y=0;y0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,y.numBytes);var Z=f.getInt16(0,!0),R=2,C=0,E=0;do{if(Z>0)for(;Z--;)_[C++]=f.getUint8(R++);else for(E=f.getUint8(R++),Z=-Z;Z--;)_[C++]=E;Z=f.getInt16(R,!0),R+=2}while(R>3],A<<=L&7):A=_[L>>3],A&128&&(S[L]=1);d.pixels.resultMask=S,y.bitset=_,u+=y.numBytes}return d.ptr=u,d.mask=y,!0},readDataOneSweep:function(c,d,u){var m=d.ptr,p=d.headerInfo,b=p.numDims,f=p.width*p.height,y=p.imageType,_=p.numValidPixel*r.getDataTypeSize(y)*b,S,Z=d.pixels.resultMask;if(u===Uint8Array)S=new Uint8Array(c,m,_);else{var R=new ArrayBuffer(_),C=new Uint8Array(R);C.set(new Uint8Array(c,m,_)),S=new u(R)}if(S.length===f*b)d.pixels.resultPixels=S;else{d.pixels.resultPixels=new u(f*b);var E=0,A=0,L=0,F=0;if(b>1)for(L=0;L=y)return!1;var _=new Uint32Array(y-f);r.decodeBits(c,d,_);var S=[],Z,R,C,E;for(Z=f;Z0&&(S[R].second=V<>>32-E,32-g>=E?(g+=E,g===32&&(g=0,G++,V=N[G])):(g+=E-32,G++,V=N[G],S[R].second|=V>>>32-g));var v=0,X=0,Y=new s;for(Z=0;Z=u?X=u:X=v,v>=30&&console.log("WARning, large NUM LUT BITS IS "+v);var D=[],w,O,M,z,K,te;for(Z=f;Z0)if(w=[E,R],E<=X)for(O=S[R].second<=0;z--)K=O>>>z&1,K?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),z===0&&!te.val&&(te.val=w[1]);return{decodeLut:D,numBitsLUTQick:X,numBitsLUT:v,tree:Y,stuffedData:N,srcPtr:G,bitPos:g}},readHuffman:function(c,d,u){var m=d.headerInfo,p=m.numDims,b=d.headerInfo.height,f=d.headerInfo.width,y=f*b,_=this.readHuffmanTree(c,d),S=_.decodeLut,Z=_.tree,R=_.stuffedData,C=_.srcPtr,E=_.bitPos,A=_.numBitsLUTQick,L=_.numBitsLUT,F=d.headerInfo.imageType===0?128:0,I,N,g,V=d.pixels.resultMask,G,v,X,Y,D,w,O,M=0;E>0&&(C++,E=0);var z=R[C],K=d.encodeMode===1,te=new u(y*p),H=te,$;for($=0;$1&&(H=new u(te.buffer,y*$,y),M=0),d.headerInfo.numValidPixel===f*b)for(w=0,Y=0;Y>>32-A,v=G,32-E>>64-E-A,v=G),S[v])N=S[v][1],E+=S[v][0];else for(G=z<>>32-L,v=G,32-E>>64-E-L,v=G),I=Z,O=0;O>>L-O-1&1,I=X?I.right:I.left,!(I.left||I.right)){N=I.val,E=E+O+1;break}E>=32&&(E-=32,C++,z=R[C]),g=N-F,K?(D>0?g+=M:Y>0?g+=H[w-f]:g+=M,g&=255,H[w]=g,M=g):H[w]=g}else for(w=0,Y=0;Y>>32-A,v=G,32-E>>64-E-A,v=G),S[v])N=S[v][1],E+=S[v][0];else for(G=z<>>32-L,v=G,32-E>>64-E-L,v=G),I=Z,O=0;O>>L-O-1&1,I=X?I.right:I.left,!(I.left||I.right)){N=I.val,E=E+O+1;break}E>=32&&(E-=32,C++,z=R[C]),g=N-F,K?(D>0&&V[w-1]?g+=M:Y>0&&V[w-f]?g+=H[w-f]:g+=M,g&=255,H[w]=g,M=g):H[w]=g}d.ptr=d.ptr+(C+1)*4+(E>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,m,p){{var b=d.headerInfo,f=b.fileVersion,y=0,_=new DataView(c,d.ptr,5),S=_.getUint8(0);y++;var Z=S>>6,R=Z===0?4:3-Z,C=(S&32)>0,E=S&31,A=0;if(R===1)A=_.getUint8(y),y++;else if(R===2)A=_.getUint16(y,!0),y+=2;else if(R===4)A=_.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var L=2*b.maxZError,F,I,N,g,V,G,v,X,Y,D,w=b.numDims>1?b.maxValues[p]:b.zMax;if(C){for(d.counter.lut++,X=_.getUint8(y),Y=E,y++,g=Math.ceil((X-1)*E/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),d.ptr+=y,N.set(new Uint8Array(c,d.ptr,g)),v=new Uint32Array(I),d.ptr+=g,D=0;X-1>>>D;)D++;g=Math.ceil(A*D/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),N.set(new Uint8Array(c,d.ptr,g)),F=new Uint32Array(I),d.ptr+=g,f>=3?G=o.unstuffLUT2(v,E,X-1,m,L,w):G=o.unstuffLUT(v,E,X-1,m,L,w),f>=3?o.unstuff2(F,u,D,A,G):o.unstuff(F,u,D,A,G)}else d.counter.bitstuffer++,D=E,d.ptr+=y,D>0&&(g=Math.ceil(A*D/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),N.set(new Uint8Array(c,d.ptr,g)),F=new Uint32Array(I),d.ptr+=g,f>=3?m==null?o.originalUnstuff2(F,u,D,A):o.unstuff2(F,u,D,A,!1,m,L,w):m==null?o.originalUnstuff(F,u,D,A):o.unstuff(F,u,D,A,!1,m,L,w))}},readTiles:function(c,d,u){var m=d.headerInfo,p=m.width,b=m.height,f=m.microBlockSize,y=m.imageType,_=r.getDataTypeSize(y),S=Math.ceil(p/f),Z=Math.ceil(b/f);d.pixels.numBlocksY=Z,d.pixels.numBlocksX=S,d.pixels.ptr=0;var R=0,C=0,E=0,A=0,L=0,F=0,I=0,N=0,g=0,V=0,G=0,v=0,X=0,Y=0,D=0,w=0,O,M,z,K,te,H,$=new u(f*f),ee=b%f||f,le=p%f||f,_e,he,Ze=m.numDims,ye,Ge=d.pixels.resultMask,Ae=d.pixels.resultPixels;for(E=0;E1&&(Ae=new u(d.pixels.resultPixels.buffer,p*b*ye*_,p*b)),I=c.byteLength-d.ptr,O=new DataView(c,d.ptr,Math.min(10,I)),M={},w=0,N=O.getUint8(0),w++,g=N>>6&255,V=N>>2&15,V!==(A*f>>3&15))throw"integrity issue";if(H=N&3,H>3)throw d.ptr+=w,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=w;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=w,X=L*F*_,Y=c.byteLength-d.ptr,X=X1)for(b=0;b=-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,m){var p=0;switch(u){case 0:p=m.getInt8(d);break;case 1:p=m.getUint8(d);break;case 2:p=m.getInt16(d,!0);break;case 3:p=m.getUint16(d,!0);break;case 4:p=m.getInt32(d,!0);break;case 5:p=m.getUInt32(d,!0);break;case 6:p=m.getFloat32(d,!0);break;case 7:p=m.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,m=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var b=p.headerInfo,f=b.fileVersion,y=r.getDataTypeArray(b.imageType);r.readMask(c,p),b.numValidPixel!==b.width*b.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=b.width*b.height;if(p.pixels.resultPixels=new y(_*b.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},b.numValidPixel!==0)if(b.zMax===b.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var S=new DataView(c,p.ptr,2),Z=S.getUint8(0);if(p.ptr++,Z)r.readDataOneSweep(c,p,y);else if(f>1&&b.imageType<=1&&Math.abs(b.maxZError-.5)<1e-5){var R=S.getUint8(1);if(p.ptr++,p.encodeMode=R,R>2||f<4&&R>1)throw"Invalid Huffman flag "+R;R?r.readHuffman(c,p,y):r.readTiles(c,p,y)}else r.readTiles(c,p,y)}p.eofOffset=p.ptr;var C;d.inputOffset?(C=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(C)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(C=p.headerInfo.blobSize-p.ptr,Math.abs(C)>=1&&(p.eofOffset=p.headerInfo.blobSize));var E={width:b.width,height:b.height,pixelData:p.pixels.resultPixels,minValue:b.zMin,maxValue:b.zMax,validPixelCount:b.numValidPixel,dimCount:b.numDims,dimStats:{minValues:b.minValues,maxValues:b.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(b.imageType,u)){var A=p.pixels.resultMask;for(m=0;m<_;m++)A[m]||(E.pixelData[m]=u);E.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(E.fileInfo=r.formatFileInfo(p)),E}},getBandCount:function(c){var d=0,u=0,m={};for(m.ptr=0,m.pixels={};u1&&Z.fileInfo.mask&&Z.fileInfo.mask.numBytes>0&&f.push(Z.maskData),m++,S.pixels.push(Z.pixelData),S.statistics.push({minValue:Z.minValue,maxValue:Z.maxValue,noDataValue:Z.noDataValue,dimStats:Z.dimStats})}var R,C,E;if(u>1&&f.length>1){for(E=S.width*S.height,S.bandMasks=f,_=new Uint8Array(E),_.set(f[0]),R=1;R{var hfr=x(T());lYe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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BAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoq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A1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var mYe=gm((ffr,uYe)=>{var pfr=x(T()),{webm:FBt,mp4:IBt}=dYe(),ale=()=>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,cle=()=>"wakeLock"in navigator,lle=class{constructor(){if(this.enabled=!1,cle()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else ale()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",FBt),this._addSourceToVideo(this.noSleepVideo,"mp4",IBt),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 cle()?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}):ale()?(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(){lq()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):cq()?this.noSleepTimer&&(console.warn(` + `),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(){cle()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):ale()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};n1e.exports=dq});var YVt={};b1e(YVt,{AlphaMode:()=>Th,AlphaPipelineStage:()=>XW,AnchorPointDirect:()=>PI,AnchorPointIndirect:()=>vI,Animation:()=>bM,AnimationViewModel:()=>yM,Appearance:()=>no,ApproximateTerrainHeights:()=>ui,ArcGISTiledElevationTerrainProvider:()=>n7,ArcGisBaseMapType:()=>Mf,ArcGisMapServerImageryProvider:()=>l0,ArcGisMapService:()=>Jd,ArcType:()=>Kt,ArticulationStageType:()=>yc,AssociativeArray:()=>Zt,Atmosphere:()=>C_,AtmospherePipelineStage:()=>dW,AttributeCompression:()=>Fn,AttributeType:()=>rn,AutoExposure:()=>RA,AutomaticUniforms:()=>_p,Axis:()=>Po,AxisAlignedBoundingBox:()=>J0,B3dmLoader:()=>KI,B3dmParser:()=>YI,BaseLayerPicker:()=>xM,BaseLayerPickerViewModel:()=>gM,BatchTable:()=>Ix,BatchTableHierarchy:()=>t_,BatchTexture:()=>Qc,BatchTexturePipelineStage:()=>IW,Billboard:()=>co,BillboardCollection:()=>Gd,BillboardGraphics:()=>cc,BillboardLoadState:()=>is,BillboardTexture:()=>xb,BillboardVisualizer:()=>yE,BingMapsGeocoderService:()=>o7,BingMapsImageryProvider:()=>tF,BingMapsStyle:()=>JV,BlendEquation:()=>Pa,BlendFunction:()=>Co,BlendOption:()=>Lo,BlendingState:()=>un,BoundingRectangle:()=>je,BoundingSphere:()=>ue,BoundingSphereState:()=>ut,BoundingVolumeSemantics:()=>g_,BoxEmitter:()=>J7,BoxGeometry:()=>Wa,BoxGeometryUpdater:()=>EX,BoxGraphics:()=>Nx,BoxOutlineGeometry:()=>Fm,BrdfLutGenerator:()=>IF,Buffer:()=>_t,BufferLoader:()=>s_,BufferUsage:()=>Ne,CPUStylingPipelineStage:()=>vW,CallbackPositionProperty:()=>XX,CallbackProperty:()=>Om,Camera:()=>oo,CameraEventAggregator:()=>PA,CameraEventType:()=>Ni,CameraFlightPath:()=>wF,Cartesian2:()=>D,Cartesian3:()=>m,Cartesian4:()=>ce,Cartographic:()=>pe,CartographicGeocoderService:()=>s7,CatmullRomSpline:()=>a7,Cesium3DContentGroup:()=>e_,Cesium3DTile:()=>Ku,Cesium3DTileBatchTable:()=>zp,Cesium3DTileColorBlendMode:()=>Wl,Cesium3DTileContent:()=>Q7,Cesium3DTileContentFactory:()=>M_,Cesium3DTileContentState:()=>Ho,Cesium3DTileContentType:()=>Zs,Cesium3DTileFeature:()=>Us,Cesium3DTileFeatureTable:()=>of,Cesium3DTileOptimizationHint:()=>Du,Cesium3DTileOptimizations:()=>gP,Cesium3DTilePass:()=>Fo,Cesium3DTilePassState:()=>hm,Cesium3DTilePointFeature:()=>_b,Cesium3DTileRefine:()=>Bo,Cesium3DTileStyle:()=>RS,Cesium3DTileStyleEngine:()=>VP,Cesium3DTilesInspector:()=>LM,Cesium3DTilesInspectorViewModel:()=>VM,Cesium3DTilesVoxelProvider:()=>j7,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>XP,Cesium3DTilesetCache:()=>TP,Cesium3DTilesetGraphics:()=>Hx,Cesium3DTilesetHeatmap:()=>SP,Cesium3DTilesetMetadata:()=>K_,Cesium3DTilesetMostDetailedTraversal:()=>RP,Cesium3DTilesetSkipTraversal:()=>wP,Cesium3DTilesetStatistics:()=>pf,Cesium3DTilesetTraversal:()=>zs,Cesium3DTilesetVisualizer:()=>PP,CesiumInspector:()=>GM,CesiumInspectorViewModel:()=>RM,CesiumTerrainProvider:()=>_S,CesiumWidget:()=>G9,Check:()=>C,CheckerboardMaterialProperty:()=>X1,CircleEmitter:()=>O9,CircleGeometry:()=>f7,CircleOutlineGeometry:()=>h7,ClassificationModelDrawCommand:()=>Rw,ClassificationPipelineStage:()=>WW,ClassificationPrimitive:()=>bC,ClassificationType:()=>Un,ClearCommand:()=>ti,ClippingPlane:()=>x_,ClippingPlaneCollection:()=>hs,ClippingPolygon:()=>HC,ClippingPolygonCollection:()=>qm,Clock:()=>_f,ClockRange:()=>zr,ClockStep:()=>fo,ClockViewModel:()=>fM,CloudCollection:()=>i6,CloudType:()=>GS,Color:()=>Y,ColorBlendMode:()=>bc,ColorGeometryInstanceAttribute:()=>Yt,ColorMaterialProperty:()=>Ut,Command:()=>z6,ComponentDatatype:()=>q,Composite3DTileContent:()=>NX,CompositeEntityCollection:()=>AK,CompositeMaterialProperty:()=>W1,CompositePositionProperty:()=>ya,CompositeProperty:()=>Sc,CompressedTextureBuffer:()=>yZ,ComputeCommand:()=>vc,ComputeEngine:()=>bZ,ConditionsExpression:()=>M9,ConeEmitter:()=>r6,ConstantPositionProperty:()=>Oc,ConstantProperty:()=>Qn,ConstantSpline:()=>qI,ContentMetadata:()=>lP,Context:()=>lE,ContextLimits:()=>mt,CoplanarPolygonGeometry:()=>g2,CoplanarPolygonGeometryLibrary:()=>Eb,CoplanarPolygonOutlineGeometry:()=>zu,CornerType:()=>Fi,CorrelationGroup:()=>FI,CorridorGeometry:()=>eT,CorridorGeometryLibrary:()=>Bi,CorridorGeometryUpdater:()=>DP,CorridorGraphics:()=>Ux,CorridorOutlineGeometry:()=>OP,Credit:()=>Ct,CreditDisplay:()=>AF,CubeMap:()=>Uo,CubeMapFace:()=>RZ,CubicRealPolynomial:()=>bx,CullFace:()=>_i,CullingVolume:()=>fs,CumulusCloud:()=>au,CustomDataSource:()=>JP,CustomHeightmapTerrainProvider:()=>p7,CustomShader:()=>aS,CustomShaderMode:()=>bb,CustomShaderPipelineStage:()=>OW,CustomShaderTranslucencyMode:()=>Iy,CylinderGeometry:()=>QP,CylinderGeometryLibrary:()=>tT,CylinderGeometryUpdater:()=>qP,CylinderGraphics:()=>Ox,CylinderOutlineGeometry:()=>jP,CzmlDataSource:()=>c2,DataSource:()=>Hr,DataSourceClock:()=>Tf,DataSourceCollection:()=>l2,DataSourceDisplay:()=>z2,DebugAppearance:()=>d6,DebugCameraPrimitive:()=>op,DebugInspector:()=>OA,DebugModelMatrixPrimitive:()=>Y9,DefaultProxy:()=>y7,DepthFunction:()=>lc,DepthPlane:()=>DF,DequantizationPipelineStage:()=>BW,DerivedCommand:()=>rp,DeveloperError:()=>L,DeviceOrientationCameraController:()=>BF,DirectionalLight:()=>u6,DiscardEmptyTileImagePolicy:()=>QV,DiscardMissingTileImagePolicy:()=>$v,DistanceDisplayCondition:()=>vt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>mS,DoublyLinkedList:()=>_P,DracoLoader:()=>eb,DrawCommand:()=>et,DynamicAtmosphereLightingType:()=>rb,DynamicEnvironmentMapManager:()=>sb,DynamicGeometryBatch:()=>aT,DynamicGeometryUpdater:()=>ii,EarthOrientationParameters:()=>aZ,EarthOrientationParametersSample:()=>P0,EasingFunction:()=>Jr,EllipseGeometry:()=>cl,EllipseGeometryLibrary:()=>Yl,EllipseGeometryUpdater:()=>u2,EllipseGraphics:()=>Dx,EllipseOutlineGeometry:()=>Md,Ellipsoid:()=>re,EllipsoidGeodesic:()=>Fp,EllipsoidGeometry:()=>Js,EllipsoidGeometryUpdater:()=>f2,EllipsoidGraphics:()=>Bx,EllipsoidOutlineGeometry:()=>Id,EllipsoidPrimitive:()=>ZF,EllipsoidRhumbLine:()=>va,EllipsoidSurfaceAppearance:()=>m6,EllipsoidTangentPlane:()=>$r,EllipsoidTerrainProvider:()=>ep,EllipsoidalOccluder:()=>kb,Empty3DTileContent:()=>y1,EncodedCartesian3:()=>Bn,Entity:()=>$o,EntityCluster:()=>wd,EntityCollection:()=>Ks,EntityView:()=>J2,Event:()=>ye,EventHelper:()=>hr,Expression:()=>Iu,ExpressionNodeType:()=>gt,ExtrapolationType:()=>ol,FeatureDetection:()=>Ot,FeatureIdPipelineStage:()=>Xy,Fog:()=>YF,ForEach:()=>we,FrameRateMonitor:()=>K9,FrameState:()=>HF,Framebuffer:()=>Fr,FramebufferManager:()=>hi,Frozen:()=>z,FrustumCommands:()=>jF,FrustumGeometry:()=>NT,FrustumOutlineGeometry:()=>kF,Fullscreen:()=>_r,FullscreenButton:()=>XM,FullscreenButtonViewModel:()=>EM,GeoJsonDataSource:()=>gg,GeoJsonLoader:()=>JI,GeocodeType:()=>Bg,Geocoder:()=>PM,GeocoderService:()=>PL,GeocoderViewModel:()=>wM,GeographicProjection:()=>Xi,GeographicTilingScheme:()=>Ki,Geometry:()=>dt,Geometry3DTileContent:()=>DX,GeometryAttribute:()=>Ee,GeometryAttributes:()=>fn,GeometryFactory:()=>x7,GeometryInstance:()=>Rt,GeometryInstanceAttribute:()=>dc,GeometryOffsetAttribute:()=>$t,GeometryPipeline:()=>An,GeometryPipelineStage:()=>KW,GeometryType:()=>yu,GeometryUpdater:()=>oi,GeometryUpdaterSet:()=>gT,GeometryVisualizer:()=>v2,GetFeatureInfoFormat:()=>vT,Globe:()=>SF,GlobeDepth:()=>qF,GlobeSurfaceShaderSet:()=>qv,GlobeSurfaceTile:()=>um,GlobeSurfaceTileProvider:()=>mF,GlobeTranslucency:()=>fF,GlobeTranslucencyFramebuffer:()=>$F,GlobeTranslucencyState:()=>zF,GltfBufferViewLoader:()=>XC,GltfDracoLoader:()=>IC,GltfGpmLoader:()=>MI,GltfGpmLocal:()=>KC,GltfImageLoader:()=>WC,GltfIndexBufferLoader:()=>wC,GltfJsonLoader:()=>vC,GltfLoader:()=>nf,GltfLoaderUtil:()=>vl,GltfMeshPrimitiveGpmLoader:()=>OI,GltfStructuralMetadataLoader:()=>WI,GltfTextureLoader:()=>FC,GltfVertexBufferLoader:()=>AC,GoogleEarthEnterpriseImageryProvider:()=>h6,GoogleEarthEnterpriseMapsProvider:()=>oF,GoogleEarthEnterpriseMetadata:()=>G0,GoogleEarthEnterpriseTerrainData:()=>vL,GoogleEarthEnterpriseTerrainProvider:()=>R7,GoogleEarthEnterpriseTileInformation:()=>w9,GoogleGeocoderService:()=>E7,GoogleMaps:()=>CS,GpxDataSource:()=>xv,GregorianDate:()=>eh,GridImageryProvider:()=>p6,GridMaterialProperty:()=>O1,GroundGeometryUpdater:()=>Yn,GroundPolylineGeometry:()=>vx,GroundPolylinePrimitive:()=>Am,GroundPrimitive:()=>kc,GroupMetadata:()=>R1,HeadingPitchRange:()=>rm,HeadingPitchRoll:()=>Ea,Heap:()=>iZ,HeightReference:()=>ze,HeightmapEncoding:()=>cm,HeightmapTerrainData:()=>Da,HeightmapTessellator:()=>YV,HermitePolynomialApproximation:()=>$P,HermiteSpline:()=>Ry,HilbertOrder:()=>ZC,HomeButton:()=>WM,HomeButtonViewModel:()=>IM,HorizontalOrigin:()=>xi,I3SBuildingSceneLayerExplorer:()=>nq,I3SBuildingSceneLayerExplorerViewModel:()=>vM,I3SDataProvider:()=>jf,I3SDecoder:()=>J9,I3SFeature:()=>Q9,I3SField:()=>j9,I3SGeometry:()=>NL,I3SLayer:()=>wS,I3SNode:()=>kL,I3SStatistics:()=>eM,I3SSublayer:()=>nM,I3SSymbology:()=>$9,I3dmLoader:()=>jI,I3dmParser:()=>QI,ITwinData:()=>x6,ITwinPlatform:()=>as,Iau2000Orientation:()=>VF,Iau2006XysData:()=>cZ,Iau2006XysSample:()=>mx,IauOrientationAxes:()=>LF,IauOrientationParameters:()=>CF,ImageBasedLighting:()=>$x,ImageBasedLightingPipelineStage:()=>mW,ImageMaterialProperty:()=>$0,Imagery:()=>nL,ImageryLayer:()=>Ya,ImageryLayerCollection:()=>hF,ImageryLayerFeatureInfo:()=>Af,ImageryProvider:()=>fl,ImageryState:()=>ci,Implicit3DTileContent:()=>kC,ImplicitAvailabilityBitstream:()=>GC,ImplicitMetadataView:()=>EC,ImplicitSubdivisionScheme:()=>tr,ImplicitSubtree:()=>b_,ImplicitSubtreeCache:()=>k9,ImplicitSubtreeMetadata:()=>BX,ImplicitTileCoordinates:()=>j_,ImplicitTileset:()=>Q_,IndexDatatype:()=>Me,InfoBox:()=>AM,InfoBoxViewModel:()=>FM,InspectorShared:()=>sd,InstanceAttributeSemantic:()=>ns,InstancingPipelineStage:()=>ZW,InterpolationAlgorithm:()=>X7,InterpolationType:()=>ef,Intersect:()=>zt,IntersectionTests:()=>qn,Intersections2D:()=>Z0,Interval:()=>Ia,InvertClassification:()=>fL,Ion:()=>Ym,IonGeocodeProviderType:()=>E0,IonGeocoderService:()=>VS,IonImageryProvider:()=>d0,IonResource:()=>xd,IonWorldImageryStyle:()=>u0,Iso8601:()=>Ye,JobScheduler:()=>KF,JobType:()=>fa,JsonMetadataTable:()=>ab,JulianDate:()=>ee,KTX2Transcoder:()=>gZ,KeyboardEventModifier:()=>ia,KeyframeNode:()=>bo,KmlCamera:()=>_v,KmlDataSource:()=>XT,KmlLookAt:()=>Tv,KmlTour:()=>Sv,KmlTourFlyTo:()=>Vv,KmlTourWait:()=>Lv,Label:()=>Fy,LabelCollection:()=>Gh,LabelGraphics:()=>Nm,LabelStyle:()=>Yo,LabelVisualizer:()=>F2,LagrangePolynomialApproximation:()=>e2,LeapSecond:()=>Hi,Light:()=>_6,LightingModel:()=>Lh,LightingPipelineStage:()=>QW,LinearApproximation:()=>Qy,LinearSpline:()=>Zy,ManagedArray:()=>Jc,MapMode2D:()=>ed,MapProjection:()=>w7,MapboxImageryProvider:()=>rF,MapboxStyleImageryProvider:()=>T6,Material:()=>zi,MaterialAppearance:()=>so,MaterialPipelineStage:()=>qW,MaterialProperty:()=>qo,Math:()=>w,Matrix2:()=>Ii,Matrix3:()=>te,Matrix4:()=>M,Megatexture:()=>TL,MeshPrimitiveGpmLocal:()=>UI,MetadataClass:()=>Jm,MetadataClassProperty:()=>gh,MetadataComponentType:()=>At,MetadataEntity:()=>Nn,MetadataEnum:()=>dI,MetadataEnumValue:()=>lI,MetadataPicking:()=>JF,MetadataPickingPipelineStage:()=>Ld,MetadataPipelineStage:()=>Fu,MetadataSchema:()=>Cd,MetadataSchemaLoader:()=>MC,MetadataSemantic:()=>y_,MetadataTable:()=>Wu,MetadataTableProperty:()=>HX,MetadataType:()=>lt,MipmapHint:()=>_u,Model:()=>af,Model3DTileContent:()=>Rd,ModelAlphaOptions:()=>bw,ModelAnimation:()=>nW,ModelAnimationChannel:()=>tW,ModelAnimationCollection:()=>iW,ModelAnimationLoop:()=>Al,ModelAnimationState:()=>rf,ModelArticulation:()=>hW,ModelArticulationStage:()=>fW,ModelClippingPlanesPipelineStage:()=>yW,ModelClippingPolygonsPipelineStage:()=>_W,ModelColorPipelineStage:()=>Ey,ModelComponents:()=>Cn,ModelDrawCommand:()=>Gw,ModelDrawCommands:()=>Iw,ModelFeature:()=>oW,ModelFeatureTable:()=>sW,ModelGraphics:()=>Up,ModelLightingOptions:()=>Vw,ModelMatrixUpdateStage:()=>RW,ModelNode:()=>TW,ModelRenderResources:()=>yw,ModelRuntimeNode:()=>EW,ModelRuntimePrimitive:()=>hw,ModelSceneGraph:()=>Ww,ModelSilhouettePipelineStage:()=>_w,ModelSkin:()=>pw,ModelSplitterPipelineStage:()=>Sw,ModelStatistics:()=>ww,ModelType:()=>mr,ModelUtility:()=>qt,ModelVisualizer:()=>A2,Moon:()=>GF,MorphTargetsPipelineStage:()=>ew,MorphWeightSpline:()=>P7,MortonOrder:()=>Oy,Multiple3DTileContent:()=>mP,MultisampleFramebuffer:()=>dE,NavigationHelpButton:()=>DM,NavigationHelpButtonViewModel:()=>OM,NearFarScalar:()=>Nt,NeverTileDiscardPolicy:()=>C6,NodeRenderResources:()=>Cw,NodeStatisticsPipelineStage:()=>GW,NodeTransformationProperty:()=>Yx,OIT:()=>eA,Occluder:()=>EF,OffsetGeometryInstanceAttribute:()=>$i,OpenCageGeocoderService:()=>F7,OpenStreetMapImageryProvider:()=>I0,OrderedGroundPrimitiveCollection:()=>d2,OrientedBoundingBox:()=>Xn,OrthographicFrustum:()=>sn,OrthographicOffCenterFrustum:()=>Oo,Packable:()=>A7,PackableForInterpolation:()=>M7,Particle:()=>DL,ParticleBurst:()=>L6,ParticleEmitter:()=>Z6,ParticleSystem:()=>R6,Pass:()=>Xe,PassState:()=>sc,PathGraphics:()=>Op,PathVisualizer:()=>N2,PeliasGeocoderService:()=>v9,PerInstanceColorAppearance:()=>an,PerformanceDisplay:()=>p0,PerformanceWatchdog:()=>UM,PerformanceWatchdogViewModel:()=>kM,PerspectiveFrustum:()=>Ci,PerspectiveOffCenterFrustum:()=>hl,PickDepth:()=>QF,PickDepthFramebuffer:()=>nA,PickFramebuffer:()=>oA,PickedMetadataInfo:()=>b9,Picking:()=>cA,PickingPipelineStage:()=>tw,PinBuilder:()=>r0,PixelDatatype:()=>Ue,PixelFormat:()=>ke,Plane:()=>cn,PlaneGeometry:()=>h2,PlaneGeometryUpdater:()=>b2,PlaneGraphics:()=>SX,PlaneOutlineGeometry:()=>p2,PntsLoader:()=>vw,PntsParser:()=>I_,PointCloud:()=>Z9,PointCloudEyeDomeLighting:()=>lb,PointCloudShading:()=>Vh,PointCloudStylingPipelineStage:()=>iw,PointGraphics:()=>zx,PointPrimitive:()=>Gs,PointPrimitiveCollection:()=>A1,PointVisualizer:()=>U2,PolygonGeometry:()=>ob,PolygonGeometryLibrary:()=>Dn,PolygonGeometryUpdater:()=>_2,PolygonGraphics:()=>km,PolygonHierarchy:()=>Fa,PolygonOutlineGeometry:()=>x2,PolygonPipeline:()=>ai,Polyline:()=>ku,PolylineArrowMaterialProperty:()=>B1,PolylineCollection:()=>df,PolylineColorAppearance:()=>es,PolylineDashMaterialProperty:()=>H1,PolylineGeometry:()=>e0,PolylineGeometryUpdater:()=>B2,PolylineGlowMaterialProperty:()=>K1,PolylineGraphics:()=>uc,PolylineMaterialAppearance:()=>ua,PolylineOutlineMaterialProperty:()=>jy,PolylinePipeline:()=>vi,PolylineVisualizer:()=>H2,PolylineVolumeGeometry:()=>C2,PolylineVolumeGeometryLibrary:()=>bf,PolylineVolumeGeometryUpdater:()=>R2,PolylineVolumeGraphics:()=>Kx,PolylineVolumeOutlineGeometry:()=>Z2,PositionProperty:()=>Mm,PositionPropertyArray:()=>Bb,PostProcessStage:()=>mo,PostProcessStageCollection:()=>XA,PostProcessStageComposite:()=>nd,PostProcessStageLibrary:()=>$d,PostProcessStageSampleMode:()=>qd,PostProcessStageTextureCache:()=>jT,PpeMetadata:()=>kI,PpeSource:()=>D6,PpeTexture:()=>NI,Primitive:()=>In,PrimitiveCollection:()=>al,PrimitiveLoadPlan:()=>Z_,PrimitiveOutlineGenerator:()=>L_,PrimitiveOutlinePipelineStage:()=>sw,PrimitivePipeline:()=>Wx,PrimitiveRenderResources:()=>Lw,PrimitiveState:()=>Zr,PrimitiveStatisticsPipelineStage:()=>aw,PrimitiveType:()=>ve,ProjectionPicker:()=>NM,ProjectionPickerViewModel:()=>MM,Property:()=>J,PropertyArray:()=>Q1,PropertyAttribute:()=>V_,PropertyAttributeProperty:()=>GI,PropertyBag:()=>Bc,PropertyTable:()=>qc,PropertyTexture:()=>cb,PropertyTextureProperty:()=>RI,ProviderViewModel:()=>ls,Proxy:()=>k7,QuadraticRealPolynomial:()=>Fc,QuadtreeOccluders:()=>pF,QuadtreePrimitive:()=>TF,QuadtreeTile:()=>bF,QuadtreeTileLoadState:()=>$s,QuadtreeTileProvider:()=>G6,QuantizedMeshTerrainData:()=>xS,QuarticRealPolynomial:()=>TZ,Quaternion:()=>Fe,QuaternionSpline:()=>eW,Queue:()=>_y,Ray:()=>bn,Rectangle:()=>de,RectangleCollisionChecker:()=>_T,RectangleGeometry:()=>mT,RectangleGeometryLibrary:()=>Rs,RectangleGeometryUpdater:()=>G2,RectangleGraphics:()=>Um,RectangleOutlineGeometry:()=>U_,ReferenceFrame:()=>Ui,ReferenceProperty:()=>Yb,RenderState:()=>Oe,Renderbuffer:()=>md,RenderbufferFormat:()=>ac,Request:()=>Jo,RequestErrorEvent:()=>ih,RequestScheduler:()=>ic,RequestState:()=>jn,RequestType:()=>us,Resource:()=>Ge,ResourceCache:()=>Ri,ResourceCacheKey:()=>Fl,ResourceCacheStatistics:()=>fI,ResourceLoader:()=>Ji,ResourceLoaderState:()=>xt,Rotation:()=>qu,RuntimeError:()=>le,S2Cell:()=>Qp,SDFSettings:()=>Ys,SampledPositionProperty:()=>xa,SampledProperty:()=>Fd,Sampler:()=>en,ScaledPositionProperty:()=>Mh,Scene:()=>g9,SceneFramebuffer:()=>BT,SceneMode:()=>se,SceneMode2DPipelineStage:()=>cw,SceneModePicker:()=>KM,SceneModePickerViewModel:()=>zM,SceneTransforms:()=>Oi,SceneTransitioner:()=>wA,ScreenSpaceCameraController:()=>AA,ScreenSpaceEventHandler:()=>tu,ScreenSpaceEventType:()=>Vn,SelectedFeatureIdPipelineStage:()=>Wy,SelectionIndicator:()=>HM,SelectionIndicatorViewModel:()=>YM,SensorVolumePortionToDisplay:()=>eV,ShaderBuilder:()=>Lx,ShaderCache:()=>oE,ShaderDestination:()=>xe,ShaderFunction:()=>hE,ShaderProgram:()=>tn,ShaderSource:()=>Be,ShaderStruct:()=>fE,ShadowMap:()=>g0,ShadowMapShader:()=>cp,ShadowMode:()=>Sn,ShadowVolumeAppearance:()=>pd,ShowGeometryInstanceAttribute:()=>Tn,Simon1994PlanetaryPositions:()=>Y0,SimplePolylineGeometry:()=>U7,SingleTileImageryProvider:()=>sF,SkinningPipelineStage:()=>dw,SkyAtmosphere:()=>x9,SkyBox:()=>_9,SpatialNode:()=>f9,Spdcf:()=>AI,SpecularEnvironmentCubeMap:()=>Bm,SphereEmitter:()=>X6,SphereGeometry:()=>O7,SphereOutlineGeometry:()=>Ib,Spherical:()=>t2,Spline:()=>Pi,SplitDirection:()=>Ar,Splitter:()=>LL,StaticGeometryColorBatch:()=>nm,StaticGeometryPerMaterialBatch:()=>im,StaticGroundGeometryColorBatch:()=>gV,StaticGroundGeometryPerMaterialBatch:()=>P2,StaticGroundPolylinePerMaterialBatch:()=>Y2,StaticOutlineGeometryBatch:()=>TV,StencilConstants:()=>kt,StencilFunction:()=>On,StencilOperation:()=>ft,SteppedSpline:()=>$I,Stereographic:()=>pc,StorageType:()=>Ch,StripeMaterialProperty:()=>q1,StripeOrientation:()=>Sf,StructuralMetadata:()=>Ds,StyleCommandsNeeded:()=>sf,StyleExpression:()=>I6,Sun:()=>C9,SunLight:()=>Xp,SunPostProcess:()=>kA,SupportedImageFormats:()=>wI,SvgPathBindingHandler:()=>uM,TaskProcessor:()=>gi,Terrain:()=>sM,TerrainData:()=>Ff,TerrainEncoding:()=>Rc,TerrainFillMesh:()=>sL,TerrainMesh:()=>dm,TerrainOffsetProperty:()=>Jx,TerrainProvider:()=>rs,TerrainQuantization:()=>qs,TerrainState:()=>uo,Texture:()=>Pt,TextureAtlas:()=>Zx,TextureCache:()=>rE,TextureMagnificationFilter:()=>di,TextureManager:()=>c9,TextureMinificationFilter:()=>Jt,TexturePacker:()=>cC,TextureUniform:()=>U6,TextureWrap:()=>xn,TileAvailability:()=>Hf,TileBoundingRegion:()=>Xd,TileBoundingS2Cell:()=>bP,TileBoundingSphere:()=>Wb,TileBoundingVolume:()=>W6,TileCoordinatesImageryProvider:()=>cM,TileDiscardPolicy:()=>P6,TileEdge:()=>_n,TileImagery:()=>iL,TileMapServiceImageryProvider:()=>Rg,TileMetadata:()=>dP,TileOrientedBoundingBox:()=>Ol,TileProviderError:()=>Ro,TileReplacementQueue:()=>yF,TileSelectionResult:()=>Jn,TileState:()=>v6,Tileset3DTileContent:()=>Mw,TilesetMetadata:()=>yP,TilesetPipelineStage:()=>aW,TilingScheme:()=>D7,TimeConstants:()=>Kn,TimeDynamicImagery:()=>FT,TimeDynamicPointCloud:()=>RL,TimeInterval:()=>Zn,TimeIntervalCollection:()=>Yr,TimeIntervalCollectionPositionProperty:()=>Hb,TimeIntervalCollectionProperty:()=>zb,TimeStandard:()=>zn,Timeline:()=>jM,TimelineHighlightRange:()=>JM,TimelineTrack:()=>QM,Tipsify:()=>SZ,ToggleButtonViewModel:()=>Qg,Tonemapper:()=>_0,TrackingReferenceFrame:()=>vp,Transforms:()=>wt,TranslationRotationScale:()=>ey,TranslucentTileClassification:()=>rA,TridiagonalSystemSolver:()=>t1,TrustedServers:()=>JS,TweenCollection:()=>tS,UniformState:()=>cE,UniformType:()=>rS,UrlTemplateImageryProvider:()=>Ba,VERSION:()=>BVt,VRButton:()=>tN,VRButtonViewModel:()=>eN,VRTheWorldTerrainProvider:()=>Y7,VaryingType:()=>O6,Vector3DTileBatch:()=>bh,Vector3DTileClampedPolylines:()=>sP,Vector3DTileContent:()=>cP,Vector3DTileGeometry:()=>Jp,Vector3DTilePoints:()=>$w,Vector3DTilePolygons:()=>eP,Vector3DTilePolylines:()=>A_,Vector3DTilePrimitive:()=>o_,VelocityOrientationProperty:()=>i2,VelocityVectorProperty:()=>Kb,VertexArray:()=>ni,VertexArrayFacade:()=>Ip,VertexAttributeSemantic:()=>pt,VertexFormat:()=>We,VerticalExaggeration:()=>Lr,VerticalExaggerationPipelineStage:()=>mw,VerticalOrigin:()=>Mn,VideoSynchronizer:()=>B7,View:()=>zT,Viewer:()=>mq,ViewportQuad:()=>F6,Visibility:()=>yr,Visualizer:()=>Oj,VoxelBoxShape:()=>lS,VoxelCell:()=>DA,VoxelContent:()=>cS,VoxelCylinderShape:()=>dS,VoxelEllipsoidShape:()=>uS,VoxelInspector:()=>$M,VoxelInspectorViewModel:()=>qM,VoxelMetadataOrder:()=>gm,VoxelPrimitive:()=>Ng,VoxelProvider:()=>M6,VoxelRenderResources:()=>o9,VoxelShape:()=>N6,VoxelShapeType:()=>La,VoxelTraversal:()=>h9,VulkanConstants:()=>H7,WallGeometry:()=>X2,WallGeometryLibrary:()=>fT,WallGeometryUpdater:()=>w2,WallGraphics:()=>Dp,WallOutlineGeometry:()=>W2,WebGLConstants:()=>oe,WebMapServiceImageryProvider:()=>cF,WebMapTileServiceImageryProvider:()=>dF,WebMercatorProjection:()=>Wi,WebMercatorTilingScheme:()=>ss,WindingOrder:()=>qr,WireframeIndexGenerator:()=>l1,WireframePipelineStage:()=>fw,_shadersAcesTonemappingStage:()=>lA,_shadersAdditiveBlend:()=>MA,_shadersAdjustTranslucentFS:()=>kV,_shadersAllMaterialAppearanceFS:()=>_E,_shadersAllMaterialAppearanceVS:()=>TE,_shadersAmbientOcclusionGenerate:()=>dA,_shadersAmbientOcclusionModulate:()=>uA,_shadersAspectRampMaterial:()=>ZE,_shadersAtmosphereCommon:()=>$m,_shadersAtmosphereStageFS:()=>cW,_shadersAtmosphereStageVS:()=>lW,_shadersBasicMaterialAppearanceFS:()=>SE,_shadersBasicMaterialAppearanceVS:()=>CE,_shadersBillboardCollectionFS:()=>Nw,_shadersBillboardCollectionVS:()=>kw,_shadersBlackAndWhite:()=>mA,_shadersBloomComposite:()=>fA,_shadersBrdfLutGeneratorFS:()=>Ev,_shadersBrightPass:()=>NA,_shadersBrightness:()=>hA,_shadersBumpMapMaterial:()=>RE,_shadersCPUStylingStageFS:()=>PW,_shadersCPUStylingStageVS:()=>wW,_shadersCheckerboardMaterial:()=>GE,_shadersCloudCollectionFS:()=>Xv,_shadersCloudCollectionVS:()=>Iv,_shadersCloudNoiseFS:()=>Wv,_shadersCloudNoiseVS:()=>wv,_shadersCompareAndPackTranslucentDepth:()=>Pv,_shadersCompositeOITFS:()=>vv,_shadersCompositeTranslucentClassification:()=>HT,_shadersComputeIrradianceFS:()=>_I,_shadersComputeRadianceMapFS:()=>TI,_shadersContrastBias:()=>pA,_shadersConvolveSpecularMapFS:()=>SI,_shadersConvolveSpecularMapVS:()=>CI,_shadersCustomShaderStageFS:()=>AW,_shadersCustomShaderStageVS:()=>FW,_shadersCzmBuiltins:()=>Sx,_shadersDepthOfField:()=>bA,_shadersDepthPlaneFS:()=>Fv,_shadersDepthPlaneVS:()=>Av,_shadersDepthView:()=>yA,_shadersDepthViewPacked:()=>k6,_shadersDotMaterial:()=>EE,_shadersEdgeDetection:()=>gA,_shadersElevationBandMaterial:()=>XE,_shadersElevationContourMaterial:()=>IE,_shadersElevationRampMaterial:()=>WE,_shadersEllipsoidFS:()=>UV,_shadersEllipsoidSurfaceAppearanceFS:()=>H9,_shadersEllipsoidSurfaceAppearanceVS:()=>z9,_shadersEllipsoidVS:()=>OV,_shadersFXAA:()=>TA,_shadersFXAA3_11:()=>Mv,_shadersFadeMaterial:()=>wE,_shadersFeatureIdStageFS:()=>MW,_shadersFeatureIdStageVS:()=>NW,_shadersFilmicTonemapping:()=>xA,_shadersGaussianBlur1D:()=>vg,_shadersGeometryStageFS:()=>YW,_shadersGeometryStageVS:()=>HW,_shadersGlobeFS:()=>Nv,_shadersGlobeVS:()=>kv,_shadersGridMaterial:()=>PE,_shadersGroundAtmosphere:()=>DV,_shadersHSBToRGB:()=>iG,_shadersHSLToRGB:()=>oG,_shadersImageBasedLightingStageFS:()=>uW,_shadersInstancingStageCommon:()=>SW,_shadersInstancingStageVS:()=>CW,_shadersIntersectBox:()=>QA,_shadersIntersectClippingPlanes:()=>JA,_shadersIntersectCylinder:()=>jA,_shadersIntersectDepth:()=>KA,_shadersIntersectEllipsoid:()=>qA,_shadersIntersectLongitude:()=>xL,_shadersIntersection:()=>oS,_shadersIntersectionUtils:()=>zA,_shadersLegacyInstancingStageVS:()=>VW,_shadersLensFlare:()=>SA,_shadersLightingStageFS:()=>JW,_shadersMaterialStageFS:()=>jW,_shadersMegatexture:()=>i9,_shadersMetadataStageFS:()=>kW,_shadersMetadataStageVS:()=>UW,_shadersModelClippingPlanesStageFS:()=>bW,_shadersModelClippingPolygonsStageFS:()=>xW,_shadersModelClippingPolygonsStageVS:()=>gW,_shadersModelColorStageFS:()=>pW,_shadersModelFS:()=>Xw,_shadersModelSilhouetteStageFS:()=>gw,_shadersModelSilhouetteStageVS:()=>xw,_shadersModelSplitterStageFS:()=>Tw,_shadersModelVS:()=>Ew,_shadersModifiedReinhardTonemapping:()=>CA,_shadersMorphTargetsStageVS:()=>$W,_shadersNightVision:()=>VA,_shadersNormalMapMaterial:()=>vE,_shadersOctree:()=>n9,_shadersPassThrough:()=>td,_shadersPassThroughDepth:()=>Wg,_shadersPbrNeutralTonemapping:()=>_A,_shadersPerInstanceColorAppearanceFS:()=>HE,_shadersPerInstanceColorAppearanceVS:()=>zE,_shadersPerInstanceFlatColorAppearanceFS:()=>Xx,_shadersPerInstanceFlatColorAppearanceVS:()=>KE,_shadersPointCloudEyeDomeLighting:()=>DI,_shadersPointCloudStylingStageVS:()=>nw,_shadersPointPrimitiveCollectionFS:()=>Jy,_shadersPointPrimitiveCollectionVS:()=>BP,_shadersPolygonSignedDistanceFS:()=>gI,_shadersPolylineArrowMaterial:()=>FE,_shadersPolylineColorAppearanceVS:()=>lX,_shadersPolylineCommon:()=>bd,_shadersPolylineDashMaterial:()=>AE,_shadersPolylineFS:()=>Ax,_shadersPolylineGlowMaterial:()=>ME,_shadersPolylineMaterialAppearanceVS:()=>dX,_shadersPolylineOutlineMaterial:()=>NE,_shadersPolylineShadowVolumeFS:()=>rX,_shadersPolylineShadowVolumeMorphFS:()=>sX,_shadersPolylineShadowVolumeMorphVS:()=>aX,_shadersPolylineShadowVolumeVS:()=>cX,_shadersPolylineVS:()=>zw,_shadersPrimitiveOutlineStageFS:()=>rw,_shadersPrimitiveOutlineStageVS:()=>ow,_shadersRGBToHSB:()=>XG,_shadersRGBToHSL:()=>IG,_shadersRGBToXYZ:()=>WG,_shadersReinhardTonemapping:()=>LA,_shadersReprojectWebMercatorFS:()=>Uv,_shadersReprojectWebMercatorVS:()=>Ov,_shadersRimLightingMaterial:()=>kE,_shadersSelectedFeatureIdStageCommon:()=>c1,_shadersShadowVolumeAppearanceFS:()=>hC,_shadersShadowVolumeAppearanceVS:()=>jE,_shadersShadowVolumeFS:()=>Q0,_shadersSilhouette:()=>ZA,_shadersSkinningStageVS:()=>lw,_shadersSkyAtmosphereCommon:()=>BV,_shadersSkyAtmosphereFS:()=>Dv,_shadersSkyAtmosphereVS:()=>Bv,_shadersSkyBoxFS:()=>Yv,_shadersSkyBoxVS:()=>Hv,_shadersSlopeRampMaterial:()=>UE,_shadersStripeMaterial:()=>OE,_shadersSunFS:()=>zv,_shadersSunTextureFS:()=>Kv,_shadersSunVS:()=>Jv,_shadersTexturedMaterialAppearanceFS:()=>VE,_shadersTexturedMaterialAppearanceVS:()=>LE,_shadersVector3DTileClampedPolylinesFS:()=>oP,_shadersVector3DTileClampedPolylinesVS:()=>iP,_shadersVector3DTilePolylinesVS:()=>tP,_shadersVectorTileVS:()=>LC,_shadersVerticalExaggerationStageVS:()=>uw,_shadersViewportQuadFS:()=>Qv,_shadersViewportQuadVS:()=>fx,_shadersVoxelFS:()=>YA,_shadersVoxelUtils:()=>BA,_shadersVoxelVS:()=>HA,_shadersWater:()=>BE,_shadersWaterMaskMaterial:()=>DE,_shadersXYZToRGB:()=>nE,_shadersacesTonemapping:()=>TR,_shadersalphaWeight:()=>SR,_shadersantialias:()=>CR,_shadersapplyHSBShift:()=>VR,_shadersapproximateSphericalCoordinates:()=>LR,_shadersapproximateTanh:()=>ZR,_shadersbackFacing:()=>RR,_shadersbranchFreeTernary:()=>GR,_shaderscascadeColor:()=>ER,_shaderscascadeDistance:()=>XR,_shaderscascadeMatrix:()=>IR,_shaderscascadeWeights:()=>WR,_shadersclipPolygons:()=>wR,_shaderscolumbusViewMorph:()=>PR,_shaderscomputeAtmosphereColor:()=>vR,_shaderscomputeGroundAtmosphereScattering:()=>FR,_shaderscomputePosition:()=>AR,_shaderscomputeScattering:()=>MR,_shadersconvertUvToBox:()=>$A,_shadersconvertUvToCylinder:()=>e9,_shadersconvertUvToEllipsoid:()=>t9,_shaderscosineAndSine:()=>NR,_shadersdecompressTextureCoordinates:()=>kR,_shadersdegreesPerRadian:()=>EZ,_shadersdepthClamp:()=>UR,_shadersdepthRange:()=>XZ,_shadersdepthRangeStruct:()=>fR,_shaderseastNorthUpToEyeCoordinates:()=>OR,_shadersellipsoidContainsPoint:()=>DR,_shadersellipsoidTextureCoordinates:()=>BR,_shadersepsilon1:()=>IZ,_shadersepsilon2:()=>WZ,_shadersepsilon3:()=>wZ,_shadersepsilon4:()=>PZ,_shadersepsilon5:()=>vZ,_shadersepsilon6:()=>FZ,_shadersepsilon7:()=>AZ,_shadersequalsEpsilon:()=>YR,_shaderseyeOffset:()=>HR,_shaderseyeToWindowCoordinates:()=>zR,_shadersfastApproximateAtan:()=>KR,_shadersfog:()=>JR,_shadersgammaCorrect:()=>QR,_shadersgeodeticSurfaceNormal:()=>jR,_shadersgetDefaultMaterial:()=>qR,_shadersgetDynamicAtmosphereLightDirection:()=>$R,_shadersgetLambertDiffuse:()=>eG,_shadersgetSpecular:()=>tG,_shadersgetWaterNoise:()=>nG,_shadershue:()=>rG,_shadersinfinity:()=>MZ,_shadersinverseGamma:()=>sG,_shadersisEmpty:()=>aG,_shadersisFull:()=>cG,_shaderslatitudeToWebMercatorFraction:()=>lG,_shaderslineDistance:()=>uG,_shaderslinearToSrgb:()=>dG,_shadersluminance:()=>mG,_shadersmaterial:()=>hR,_shadersmaterialInput:()=>pR,_shadersmaximumComponent:()=>fG,_shadersmetersPerPixel:()=>hG,_shadersmodelMaterial:()=>bR,_shadersmodelToWindowCoordinates:()=>pG,_shadersmodelVertexOutput:()=>yR,_shadersmultiplyWithColorBalance:()=>bG,_shadersnearFarScalar:()=>yG,_shadersoctDecode:()=>gG,_shadersoneOverPi:()=>NZ,_shadersoneOverTwoPi:()=>kZ,_shaderspackDepth:()=>xG,_shaderspassCesium3DTile:()=>UZ,_shaderspassCesium3DTileClassification:()=>OZ,_shaderspassCesium3DTileClassificationIgnoreShow:()=>DZ,_shaderspassClassification:()=>BZ,_shaderspassCompute:()=>YZ,_shaderspassEnvironment:()=>HZ,_shaderspassGlobe:()=>zZ,_shaderspassOpaque:()=>KZ,_shaderspassOverlay:()=>JZ,_shaderspassTerrainClassification:()=>QZ,_shaderspassTranslucent:()=>jZ,_shaderspassVoxels:()=>qZ,_shaderspbrLighting:()=>_G,_shaderspbrNeutralTonemapping:()=>TG,_shadersphong:()=>SG,_shaderspi:()=>$Z,_shaderspiOverFour:()=>eR,_shaderspiOverSix:()=>tR,_shaderspiOverThree:()=>nR,_shaderspiOverTwo:()=>iR,_shadersplaneDistance:()=>CG,_shaderspointAlongRay:()=>VG,_shadersradiansPerDegree:()=>oR,_shadersray:()=>gR,_shadersrayEllipsoidIntersectionInterval:()=>LG,_shadersraySegment:()=>xR,_shadersraySphereIntersectionInterval:()=>ZG,_shadersreadDepth:()=>RG,_shadersreadNonPerspective:()=>GG,_shadersreverseLogDepth:()=>EG,_shadersround:()=>wG,_shaderssaturation:()=>PG,_shaderssceneMode2D:()=>rR,_shaderssceneMode3D:()=>sR,_shaderssceneModeColumbusView:()=>aR,_shaderssceneModeMorphing:()=>cR,_shadersshadowDepthCompare:()=>vG,_shadersshadowParameters:()=>_R,_shadersshadowVisibility:()=>FG,_shaderssignNotZero:()=>AG,_shaderssolarRadius:()=>lR,_shaderssphericalHarmonics:()=>MG,_shaderssrgbToLinear:()=>NG,_shaderstangentToEyeSpaceMatrix:()=>kG,_shaderstextureCube:()=>UG,_shadersthreePiOver2:()=>dR,_shaderstransformPlane:()=>OG,_shaderstranslateRelativeToEye:()=>DG,_shaderstranslucentPhong:()=>BG,_shaderstranspose:()=>YG,_shaderstwoPi:()=>uR,_shadersunpackClippingExtents:()=>HG,_shadersunpackDepth:()=>zG,_shadersunpackFloat:()=>KG,_shadersunpackUint:()=>JG,_shadersvalueTransform:()=>QG,_shadersvertexLogDepth:()=>jG,_shaderswebMercatorMaxLatitude:()=>mR,_shaderswindowToEyeCoordinates:()=>qG,_shaderswriteDepthClamp:()=>$G,_shaderswriteLogDepth:()=>eE,_shaderswriteNonPerspective:()=>tE,addBuffer:()=>tI,addDefaults:()=>zX,addExtensionsRequired:()=>qX,addExtensionsUsed:()=>wu,addPipelineExtras:()=>my,addToArray:()=>Vs,appendForwardSlash:()=>$L,arrayRemoveDuplicates:()=>xo,barycentricCoordinates:()=>px,binarySearch:()=>Wo,buildModuleUrl:()=>on,buildVoxelDrawCommands:()=>s9,clone:()=>He,combine:()=>St,computeFlyToLocationForRectangle:()=>WT,createBillboardPointCallback:()=>w_,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>_M,createDefaultTerrainProviderViewModels:()=>TM,createElevationBandMaterial:()=>s6,createGooglePhotorealistic3DTileset:()=>a6,createGuid:()=>Hn,createMaterialPropertyDescriptor:()=>wo,createOsmBuildingsAsync:()=>c6,createPropertyDescriptor:()=>fe,createRawPropertyDescriptor:()=>Dc,createTangentSpaceDebugPrimitive:()=>l6,createTaskProcessorWorker:()=>B6,createUniform:()=>fZ,createUniformArray:()=>hZ,createWorldBathymetryAsync:()=>I9,createWorldImageryAsync:()=>m0,createWorldTerrainAsync:()=>TS,decodeGoogleEarthEnterpriseData:()=>W9,decodeVectorPolylinePositions:()=>aP,defaultValue:()=>g7,defer:()=>Cl,defined:()=>c,demodernizeShader:()=>iE,deprecationWarning:()=>Cs,destroyObject:()=>he,exportKml:()=>jQ,findAccessorMinMax:()=>m_,findContentMetadata:()=>N_,findGroupMetadata:()=>k_,findTileMetadata:()=>uP,forEachTextureInMaterial:()=>PC,formatError:()=>qh,freezeRenderState:()=>mZ,getAbsoluteUri:()=>th,getAccessorByteStride:()=>Pl,getBaseUri:()=>eZ,getBinaryAccessor:()=>_d,getClipAndStyleCode:()=>V9,getClippingFunction:()=>c0,getComponentReader:()=>nb,getElement:()=>Wn,getExtensionFromUri:()=>ox,getFilenameFromUri:()=>Ob,getImageFromTypedArray:()=>a9,getImagePixels:()=>Rm,getJsonFromTypedArray:()=>er,getMagic:()=>Hm,getMetadataClassProperty:()=>p9,getMetadataProperty:()=>y9,getStringFromTypedArray:()=>Il,getTimestamp:()=>Ti,hasExtension:()=>ri,heightReferenceOnEntityPropertyChanged:()=>Bp,isBitSet:()=>Wc,isBlobUri:()=>rx,isCrossOriginUrl:()=>F0,isDataUri:()=>Sp,isLeapYear:()=>Lm,knockout:()=>Se,knockout_3_5_1:()=>vS,knockout_es5:()=>dM,loadAndExecuteScript:()=>sx,loadCubeMap:()=>mE,loadImageFromTypedArray:()=>l_,loadKTX2:()=>Ll,mergeSort:()=>h0,moveTechniqueRenderStates:()=>jX,moveTechniquesToExtension:()=>$X,numberOfComponentsForType:()=>Sd,objectToQuery:()=>ax,oneTimeWarning:()=>ht,parseBatchTable:()=>mb,parseFeatureMetadataLegacy:()=>II,parseGlb:()=>JX,parseResponseHeaders:()=>tZ,parseStructuralMetadata:()=>XI,pickModel:()=>m1,pointInsideTriangle:()=>N7,preprocess3DTileContent:()=>Gb,processVoxelProperties:()=>r9,queryToObject:()=>ld,readAccessorPacked:()=>nI,removeExtension:()=>f_,removeExtensionsRequired:()=>KX,removeExtensionsUsed:()=>u_,removePipelineExtras:()=>QX,removeUnusedElements:()=>eI,resizeImageToNextPowerOfTwo:()=>py,sampleTerrain:()=>jv,sampleTerrainMostDetailed:()=>IT,scaleToGeodeticSurface:()=>ix,srgbToLinear:()=>LS,subdivideArray:()=>qE,subscribeAndEvaluate:()=>Za,updateAccessorComponentTypes:()=>iI,updateVersion:()=>oI,usesExtension:()=>ur,viewerCesium3DTilesInspectorMixin:()=>fq,viewerCesiumInspectorMixin:()=>hq,viewerDragDropMixin:()=>bq,viewerPerformanceWatchdogMixin:()=>yq,viewerVoxelInspectorMixin:()=>gq,webGLConstantToGlslType:()=>z7,wrapFunction:()=>A9,writeTextToCanvas:()=>v_});var dNo=_(T(),1);var Spo=_(T(),1);var qLt=_(T(),1);var bLt=_(T(),1);var iLt=_(T(),1);var QVt=_(T(),1);function g1e(e){return e!=null}var c=g1e;var $Vt=_(T(),1);function tx(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(tx.prototype=Object.create(Error.prototype),tx.prototype.constructor=tx);tx.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` -${this.stack.toString()}`),e};tx.throwInstantiationError=function(){throw new tx("This function defines an interface and should not be called directly.")};var L=tx;var Ts={};Ts.typeOf={};function x1e(e){return`${e} is required, actual value was undefined`}function NS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ts.defined=function(e,t){if(!c(t))throw new L(x1e(e))};Ts.typeOf.func=function(e,t){if(typeof t!="function")throw new L(NS(typeof t,"function",e))};Ts.typeOf.string=function(e,t){if(typeof t!="string")throw new L(NS(typeof t,"string",e))};Ts.typeOf.number=function(e,t){if(typeof t!="number")throw new L(NS(typeof t,"number",e))};Ts.typeOf.number.lessThan=function(e,t,n){if(Ts.typeOf.number(e,t),t>=n)throw new L(`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 L(`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 L(`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),t0?1:-1};ct.signNotZero=function(e){return e<0?-1:1};ct.toSNorm=function(e,t){return t=t??255,Math.round((ct.clamp(e,-1,1)*.5+.5)*t)};ct.fromSNorm=function(e,t){return t=t??255,ct.clamp(e,0,t)/t*2-1};ct.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ct.clamp((e-t)/n,0,1)};ct.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};ct.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};ct.lerp=function(e,t,n){return(1-n)*e+n*t};ct.PI=Math.PI;ct.ONE_OVER_PI=1/Math.PI;ct.PI_OVER_TWO=Math.PI/2;ct.PI_OVER_THREE=Math.PI/3;ct.PI_OVER_FOUR=Math.PI/4;ct.PI_OVER_SIX=Math.PI/6;ct.THREE_PI_OVER_TWO=3*Math.PI/2;ct.TWO_PI=2*Math.PI;ct.ONE_OVER_TWO_PI=1/(2*Math.PI);ct.RADIANS_PER_DEGREE=Math.PI/180;ct.DEGREES_PER_RADIAN=180/Math.PI;ct.RADIANS_PER_ARCSECOND=ct.RADIANS_PER_DEGREE/3600;ct.toRadians=function(e){if(!c(e))throw new L("degrees is required.");return e*ct.RADIANS_PER_DEGREE};ct.toDegrees=function(e){if(!c(e))throw new L("radians is required.");return e*ct.DEGREES_PER_RADIAN};ct.convertLongitudeRange=function(e){if(!c(e))throw new L("angle is required.");let t=ct.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ct.clampToLatitudeRange=function(e){if(!c(e))throw new L("angle is required.");return ct.clamp(e,-1*ct.PI_OVER_TWO,ct.PI_OVER_TWO)};ct.negativePiToPi=function(e){if(!c(e))throw new L("angle is required.");return e>=-ct.PI&&e<=ct.PI?e:ct.zeroToTwoPi(e+ct.PI)-ct.PI};ct.zeroToTwoPi=function(e){if(!c(e))throw new L("angle is required.");if(e>=0&&e<=ct.TWO_PI)return e;let t=ct.mod(e,ct.TWO_PI);return Math.abs(t)ct.EPSILON14?ct.TWO_PI:t};ct.mod=function(e,t){if(!c(e))throw new L("m is required.");if(!c(t))throw new L("n is required.");if(t===0)throw new L("divisor cannot be 0.");return ct.sign(e)===ct.sign(t)&&Math.abs(e)n};ct.greaterThanOrEquals=function(e,t,n){if(!c(e))throw new L("first is required.");if(!c(t))throw new L("second is required.");if(!c(n))throw new L("absoluteEpsilon is required.");return e-t>-n};var rN=[1];ct.factorial=function(e){if(typeof e!="number"||e<0)throw new L("A number greater than or equal to 0 is required.");let t=rN.length;if(e>=t){let n=rN[t-1];for(let i=t;i<=e;i++){let o=n*i;rN.push(o),n=o}}return rN[e]};ct.incrementWrap=function(e,t,n){if(n=n??0,!c(e))throw new L("n is required.");if(t<=n)throw new L("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};ct.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new L("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};ct.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new L("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ct.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new L("A number between 0 and (2^32)-1 is required.");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};ct.clamp=function(e,t,n){return C.typeOf.number("value",e),C.typeOf.number("min",t),C.typeOf.number("max",n),en?n:e};var Cq=new JB.default;ct.setRandomNumberSeed=function(e){if(!c(e))throw new L("seed is required.");Cq=new JB.default(e)};ct.nextRandomNumber=function(){return Cq.random()};ct.randomBetween=function(e,t){return ct.nextRandomNumber()*(t-e)+e};ct.acosClamped=function(e){if(!c(e))throw new L("value is required.");return Math.acos(ct.clamp(e,-1,1))};ct.asinClamped=function(e){if(!c(e))throw new L("value is required.");return Math.asin(ct.clamp(e,-1,1))};ct.chordLength=function(e,t){if(!c(e))throw new L("angle is required.");if(!c(t))throw new L("radius is required.");return 2*t*Math.sin(e*.5)};ct.logBase=function(e,t){if(!c(e))throw new L("number is required.");if(!c(t))throw new L("base is required.");return Math.log(e)/Math.log(t)};ct.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};ct.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};ct.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ct.fastApproximateAtan=function(e){return C.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ct.fastApproximateAtan2=function(e,t){C.typeOf.number("x",e),C.typeOf.number("y",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;if(isNaN(r))throw new L("either x or y must be nonzero");return i=ct.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?ct.PI_OVER_TWO-i:i,i=e<0?ct.PI-i:i,i=t<0?-i:i,i};var w=ct;function tt(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}tt.fromSpherical=function(e,t){C.typeOf.object("spherical",e),c(t)||(t=new tt);let n=e.clock,i=e.cone,o=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};tt.fromElements=function(e,t,n,i){return c(i)?(i.x=e,i.y=t,i.z=n,i):new tt(e,t,n)};tt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new tt(e.x,e.y,e.z)};tt.fromCartesian4=tt.clone;tt.packedLength=3;tt.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};tt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new tt),n.x=e[t++],n.y=e[t++],n.z=e[t],n};tt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*3;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;oi&&(o=d,i=u)}let r=1,s=0,a=e3[o],l=t3[o];if(Math.abs(e[it.getElementIndex(l,a)])>n){let d=e[it.getElementIndex(l,l)],u=e[it.getElementIndex(a,a)],f=e[it.getElementIndex(l,a)],p=(d-u)/2/f,y;p<0?y=-1/(-p+Math.sqrt(1+p*p)):y=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+y*y),s=y*r}return t=it.clone(it.IDENTITY,t),t[it.getElementIndex(a,a)]=t[it.getElementIndex(l,l)]=r,t[it.getElementIndex(l,a)]=s,t[it.getElementIndex(a,l)]=-s,t}var lN=new it,Gq=new it;it.computeEigenDecomposition=function(e,t){C.typeOf.object("matrix",e);let n=w.EPSILON20,i=10,o=0,r=0;c(t)||(t={});let s=t.unitary=it.clone(it.IDENTITY,t.unitary),a=t.diagonal=it.clone(e,t.diagonal),l=n*G1e(a);for(;rl;)X1e(a,lN),it.transpose(lN,Gq),it.multiply(a,lN,a),it.multiply(Gq,a,a),it.multiply(s,lN,s),++o>2&&(++r,o=0);return t};it.abs=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),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};it.determinant=function(e){C.typeOf.object("matrix",e);let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],l=e[5],d=e[8];return t*(r*d-l*s)+o*(l*i-n*d)+a*(n*s-r*i)};it.inverse=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],d=e[7],u=e[8],f=it.determinant(e);if(Math.abs(f)<=w.EPSILON15)throw new L("matrix is not invertible");t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=l*a-r*u,t[4]=n*u-l*o,t[5]=r*o-n*a,t[6]=r*d-l*s,t[7]=l*i-n*d,t[8]=n*s-r*i;let p=1/f;return it.multiplyByScalar(t,p,t)};var I1e=new it;it.inverseTranspose=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),it.inverse(it.transpose(e,I1e),t)};it.equals=function(e,t){return e===t||c(e)&&c(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]};it.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};it.IDENTITY=Object.freeze(new it(1,0,0,0,1,0,0,0,1));it.ZERO=Object.freeze(new it(0,0,0,0,0,0,0,0,0));it.COLUMN0ROW0=0;it.COLUMN0ROW1=1;it.COLUMN0ROW2=2;it.COLUMN1ROW0=3;it.COLUMN1ROW1=4;it.COLUMN1ROW2=5;it.COLUMN2ROW0=6;it.COLUMN2ROW1=7;it.COLUMN2ROW2=8;Object.defineProperties(it.prototype,{length:{get:function(){return it.packedLength}}});it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.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]};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};uYe.exports=lle});var e3t={};yle(e3t,{AlphaMode:()=>wp,AlphaPipelineStage:()=>AI,AnchorPointDirect:()=>VF,AnchorPointIndirect:()=>EF,Animation:()=>d5,AnimationViewModel:()=>u5,Appearance:()=>Go,ApproximateTerrainHeights:()=>Pi,ArcGISTiledElevationTerrainProvider:()=>doe,ArcGisBaseMapType:()=>mf,ArcGisMapServerImageryProvider:()=>Bb,ArcGisMapService:()=>vu,ArcType:()=>un,ArticulationStageType:()=>cl,AssociativeArray:()=>Mt,Atmosphere:()=>nS,AtmospherePipelineStage:()=>rI,AttributeCompression:()=>dn,AttributeType:()=>Dt,AutoExposure:()=>ik,AutomaticUniforms:()=>ab,Axis:()=>Bi,AxisAlignedBoundingBox:()=>Tu,Azure2DImageryProvider:()=>dP,B3dmLoader:()=>OF,B3dmParser:()=>kF,BaseLayerPicker:()=>h5,BaseLayerPickerViewModel:()=>m5,BatchTable:()=>p_,BatchTableHierarchy:()=>M_,BatchTexture:()=>Bl,BatchTexturePipelineStage:()=>GI,Billboard:()=>wo,BillboardCollection:()=>wu,BillboardGraphics:()=>Oc,BillboardLoadState:()=>Os,BillboardTexture:()=>qb,BillboardVisualizer:()=>sG,BingMapsGeocoderService:()=>moe,BingMapsImageryProvider:()=>eP,BingMapsStyle:()=>CC,BlendEquation:()=>Ec,BlendFunction:()=>$o,BlendOption:()=>Yi,BlendingState:()=>on,BoundingRectangle:()=>nt,BoundingSphere:()=>de,BoundingSphereState:()=>Wt,BoundingVolumeSemantics:()=>ix,BoxEmitter:()=>Fre,BoxGeometry:()=>Vc,BoxGeometryUpdater:()=>y2,BoxGraphics:()=>Z_,BoxOutlineGeometry:()=>Yh,BrdfLutGenerator:()=>rk,Buffer:()=>ot,BufferLoader:()=>z_,BufferPoint:()=>Pc,BufferPointCollection:()=>Od,BufferPointMaterial:()=>Sf,BufferPolygon:()=>Ir,BufferPolygonCollection:()=>Ya,BufferPolygonMaterial:()=>Eu,BufferPolyline:()=>ga,BufferPolylineCollection:()=>ml,BufferPolylineMaterial:()=>Au,BufferPrimitive:()=>os,BufferPrimitiveCollection:()=>na,BufferPrimitiveMaterial:()=>Kl,BufferUsage:()=>Pe,CPUStylingPipelineStage:()=>FI,CallbackPositionProperty:()=>x2,CallbackProperty:()=>Jh,Camera:()=>Io,CameraEventAggregator:()=>Wk,CameraEventType:()=>lo,CameraFlightPath:()=>Ak,Cartesian2:()=>k,Cartesian3:()=>h,Cartesian4:()=>ce,CartesianRectangle:()=>NC,Cartographic:()=>pe,CartographicGeocoderService:()=>foe,CatmullRomSpline:()=>poe,Cesium3DContentGroup:()=>w_,Cesium3DTile:()=>eh,Cesium3DTileBatchTable:()=>$h,Cesium3DTileColorBlendMode:()=>Id,Cesium3DTileContent:()=>Jre,Cesium3DTileContentFactory:()=>LS,Cesium3DTileContentState:()=>Fo,Cesium3DTileContentType:()=>Za,Cesium3DTileFeature:()=>ea,Cesium3DTileFeatureTable:()=>cf,Cesium3DTileOptimizationHint:()=>jm,Cesium3DTileOptimizations:()=>mN,Cesium3DTilePass:()=>lr,Cesium3DTilePassState:()=>_h,Cesium3DTilePointFeature:()=>$b,Cesium3DTileRefine:()=>xr,Cesium3DTileStyle:()=>og,Cesium3DTileStyleEngine:()=>yN,Cesium3DTileVectorFeature:()=>ES,Cesium3DTilesInspector:()=>V5,Cesium3DTilesInspectorViewModel:()=>C5,Cesium3DTilesTerrainData:()=>PM,Cesium3DTilesTerrainGeometryProcessor:()=>$E,Cesium3DTilesTerrainProvider:()=>Soe,Cesium3DTilesVoxelProvider:()=>ise,Cesium3DTileset:()=>zr,Cesium3DTilesetBaseTraversal:()=>RN,Cesium3DTilesetCache:()=>pN,Cesium3DTilesetGraphics:()=>L_,Cesium3DTilesetHeatmap:()=>bN,Cesium3DTilesetMetadata:()=>MS,Cesium3DTilesetMostDetailedTraversal:()=>_N,Cesium3DTilesetSkipTraversal:()=>EN,Cesium3DTilesetStatistics:()=>Rf,Cesium3DTilesetTraversal:()=>Ba,Cesium3DTilesetVisualizer:()=>AN,CesiumInspector:()=>S5,CesiumInspectorViewModel:()=>_5,CesiumTerrainProvider:()=>OZ,CesiumWidget:()=>e5,Check:()=>Ko,CheckerboardMaterialProperty:()=>rV,CircleEmitter:()=>Nk,CircleGeometry:()=>Aoe,CircleOutlineGeometry:()=>Goe,ClassificationModelDrawCommand:()=>qP,ClassificationPipelineStage:()=>LI,ClassificationPrimitive:()=>g1,ClassificationType:()=>ti,ClearCommand:()=>ui,ClippingPlane:()=>ta,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>eC,ClippingPolygonCollection:()=>Wc,Clock:()=>Lf,ClockRange:()=>As,ClockStep:()=>Oo,ClockViewModel:()=>a5,CloudCollection:()=>cse,CloudType:()=>hA,Color:()=>U,ColorBlendMode:()=>al,ColorGeometryInstanceAttribute:()=>$t,ColorMaterialProperty:()=>Qt,Command:()=>zce,ComponentDatatype:()=>J,Composite3DTileContent:()=>A2,CompositeEntityCollection:()=>C$,CompositeMaterialProperty:()=>aV,CompositePositionProperty:()=>mc,CompositeProperty:()=>pl,CompressedTextureBuffer:()=>pG,ComputeCommand:()=>Gu,ComputeEngine:()=>qw,ConditionsExpression:()=>HX,ConeEmitter:()=>use,ConstantPositionProperty:()=>Ml,ConstantProperty:()=>gi,ConstantSpline:()=>KF,ContentMetadata:()=>iN,Context:()=>wZ,ContextLimits:()=>kt,Controller:()=>Wce,ControllerHost:()=>CU,CoplanarPolygonGeometry:()=>uY,CoplanarPolygonGeometryLibrary:()=>dg,CoplanarPolygonOutlineGeometry:()=>$m,CornerType:()=>ro,CorrelationGroup:()=>AF,CorridorGeometry:()=>OS,CorridorGeometryLibrary:()=>bo,CorridorGeometryUpdater:()=>NN,CorridorGraphics:()=>C_,CorridorOutlineGeometry:()=>XN,Credit:()=>Lt,CreditDisplay:()=>kk,CubeMap:()=>$r,CubeMapFace:()=>CG,CubeMapPanorama:()=>lR,CubicRealPolynomial:()=>o_,CullFace:()=>Di,CullingVolume:()=>$s,CumulusCloud:()=>lm,CustomDataSource:()=>UN,CustomHeightmapTerrainProvider:()=>Loe,CustomShader:()=>I0,CustomShaderMode:()=>Ob,CustomShaderPipelineStage:()=>MI,CustomShaderTranslucencyMode:()=>bx,CylinderGeometry:()=>DN,CylinderGeometryLibrary:()=>BS,CylinderGeometryUpdater:()=>BN,CylinderGraphics:()=>V_,CylinderOutlineGeometry:()=>ON,CzmlDataSource:()=>tY,DataSource:()=>Es,DataSourceClock:()=>Wf,DataSourceCollection:()=>nY,DataSourceDisplay:()=>HY,DebugAppearance:()=>bse,DebugCameraPrimitive:()=>X0,DebugInspector:()=>Bk,DebugModelMatrixPrimitive:()=>zk,DefaultProxy:()=>voe,DepthFunction:()=>rc,DepthPlane:()=>Qk,DequantizationPipelineStage:()=>UI,DerivedCommand:()=>rp,DeveloperError:()=>ge,DeviceOrientationCameraController:()=>qk,DirectionalLight:()=>Sse,DiscardEmptyTileImagePolicy:()=>VC,DiscardMissingTileImagePolicy:()=>qI,DistanceDisplayCondition:()=>Ot,DistanceDisplayConditionGeometryInstanceAttribute:()=>Qn,DoubleEndedPriorityQueue:()=>qg,DoublyLinkedList:()=>fN,DracoLoader:()=>Eb,DrawCommand:()=>lt,DynamicAtmosphereLightingType:()=>vb,DynamicEnvironmentMapManager:()=>Fb,DynamicGeometryBatch:()=>QS,DynamicGeometryUpdater:()=>Li,EarthOrientationParameters:()=>$A,EarthOrientationParametersSample:()=>Sy,EasingFunction:()=>vs,EdgeDetectionPipelineStage:()=>OI,EdgeDisplayMode:()=>Mm,EdgeFramebuffer:()=>$k,EdgeVisibilityPipelineStage:()=>HI,EllipseGeometry:()=>dd,EllipseGeometryLibrary:()=>Kd,EllipseGeometryUpdater:()=>oY,EllipseGraphics:()=>E_,EllipseOutlineGeometry:()=>Ju,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>mb,EllipsoidGeometry:()=>Ha,EllipsoidGeometryUpdater:()=>sY,EllipsoidGraphics:()=>A_,EllipsoidOutlineGeometry:()=>Uu,EllipsoidPrimitive:()=>e9,EllipsoidRhumbLine:()=>Ac,EllipsoidSurfaceAppearance:()=>Rse,EllipsoidTangentPlane:()=>ws,EllipsoidTerrainProvider:()=>G0,EllipsoidalOccluder:()=>Af,Empty3DTileContent:()=>Qp,EncodedCartesian3:()=>An,Entity:()=>er,EntityCluster:()=>Ou,EntityCollection:()=>za,EntityView:()=>JY,EquirectangularPanorama:()=>Cse,Event:()=>Se,EventHelper:()=>Hr,Expression:()=>vm,ExpressionNodeType:()=>Pt,ExtrapolationType:()=>ad,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>px,Fog:()=>o9,ForEach:()=>Me,FrameRateMonitor:()=>r9,FrameState:()=>vx,Framebuffer:()=>ps,FramebufferManager:()=>li,Frozen:()=>B,FrustumCommands:()=>s9,FrustumGeometry:()=>HZ,FrustumOutlineGeometry:()=>UM,Fullscreen:()=>qr,FullscreenButton:()=>g5,FullscreenButtonViewModel:()=>b5,GaussianSplat3DTileContent:()=>Ax,GaussianSplatPrimitive:()=>nN,GaussianSplatRenderResources:()=>QX,GaussianSplatSorter:()=>AS,GaussianSplatTextureGenerator:()=>jX,GeoJsonDataSource:()=>cT,GeoJsonLoader:()=>BF,GeoJsonPrimitive:()=>Lse,GeocodeType:()=>ST,Geocoder:()=>x5,GeocoderService:()=>oA,GeocoderViewModel:()=>y5,GeographicProjection:()=>ki,GeographicTilingScheme:()=>to,Geometry:()=>At,Geometry3DTileContent:()=>W2,GeometryAttribute:()=>Xe,GeometryAttributes:()=>Rn,GeometryFactory:()=>Xoe,GeometryInstance:()=>Yt,GeometryInstanceAttribute:()=>Qc,GeometryOffsetAttribute:()=>bn,GeometryPipeline:()=>zn,GeometryPipelineStage:()=>QI,GeometryType:()=>Zm,GeometryUpdater:()=>Wi,GeometryUpdaterSet:()=>cZ,GeometryVisualizer:()=>vY,GetFeatureInfoFormat:()=>hf,Globe:()=>_9,GlobeDepth:()=>S9,GlobeSurfaceShaderSet:()=>d9,GlobeSurfaceTile:()=>Zh,GlobeSurfaceTileProvider:()=>m9,GlobeTranslucency:()=>h9,GlobeTranslucencyFramebuffer:()=>Z9,GlobeTranslucencyState:()=>R9,GltfBufferViewLoader:()=>v1,GltfDracoLoader:()=>F1,GltfGpmLoader:()=>LF,GltfGpmLocal:()=>rC,GltfImageLoader:()=>I1,GltfIndexBufferLoader:()=>P1,GltfJsonLoader:()=>N1,GltfLoader:()=>Lu,GltfLoaderUtil:()=>Nd,GltfMeshPrimitiveGpmLoader:()=>IF,GltfSpzLoader:()=>J2,GltfStructuralMetadataLoader:()=>RF,GltfTextureLoader:()=>k1,GltfVertexBufferLoader:()=>U1,Google2DImageryProvider:()=>lP,GoogleEarthEnterpriseImageryProvider:()=>jse,GoogleEarthEnterpriseMapsProvider:()=>iP,GoogleEarthEnterpriseMetadata:()=>ey,GoogleEarthEnterpriseTerrainData:()=>rA,GoogleEarthEnterpriseTerrainProvider:()=>Doe,GoogleEarthEnterpriseTileInformation:()=>BM,GoogleGeocoderService:()=>Boe,GoogleMaps:()=>_a,GoogleStreetViewCubeMapPanoramaProvider:()=>Qse,GpxDataSource:()=>kw,GregorianDate:()=>vh,GridImageryProvider:()=>qse,GridMaterialProperty:()=>gV,GroundGeometryUpdater:()=>ri,GroundPolylineGeometry:()=>x_,GroundPolylinePrimitive:()=>Oh,GroundPrimitive:()=>Nl,GroupMetadata:()=>nV,HeadingPitchRange:()=>dh,HeadingPitchRoll:()=>Cc,Heap:()=>KA,HeightReference:()=>He,HeightmapEncoding:()=>gh,HeightmapTerrainData:()=>Mc,HeightmapTessellator:()=>KE,HermitePolynomialApproximation:()=>zN,HermiteSpline:()=>mx,HilbertOrder:()=>A1,HomeButton:()=>F5,HomeButtonViewModel:()=>v5,HorizontalOrigin:()=>Ui,HybridScreenSpacePanCameraController:()=>Xce,I3SBuildingSceneLayerExplorer:()=>tle,I3SBuildingSceneLayerExplorerViewModel:()=>E5,I3SDataProvider:()=>lp,I3SDecoder:()=>C9,I3SFeature:()=>V9,I3SField:()=>E9,I3SGeometry:()=>SA,I3SLayer:()=>TR,I3SNode:()=>ZA,I3SStatistics:()=>L9,I3SSublayer:()=>v9,I3SSymbology:()=>G9,I3dmLoader:()=>HF,I3dmParser:()=>zF,ITwinData:()=>nae,ITwinPlatform:()=>ca,Iau2000Orientation:()=>HM,Iau2006XysData:()=>eG,Iau2006XysSample:()=>n_,IauOrientationAxes:()=>KM,IauOrientationParameters:()=>zM,ImageBasedLighting:()=>Y_,ImageBasedLightingPipelineStage:()=>aI,ImageMaterialProperty:()=>Ny,Imagery:()=>PC,ImageryConfiguration:()=>cX,ImageryCoverage:()=>YC,ImageryFlags:()=>hP,ImageryInput:()=>pP,ImageryLayer:()=>Zs,ImageryLayerCollection:()=>kS,ImageryLayerFeatureInfo:()=>uf,ImageryPipelineStage:()=>bP,ImageryProvider:()=>Fu,ImageryState:()=>Dn,Implicit3DTileContent:()=>H1,ImplicitAvailabilityBitstream:()=>L1,ImplicitMetadataView:()=>W1,ImplicitSubdivisionScheme:()=>Us,ImplicitSubtree:()=>Lb,ImplicitSubtreeCache:()=>Fk,ImplicitSubtreeMetadata:()=>F2,ImplicitTileCoordinates:()=>e0,ImplicitTileset:()=>$p,IndexDatatype:()=>Oe,InfoBox:()=>G5,InfoBoxViewModel:()=>A5,InspectorShared:()=>hu,InstanceAttributeSemantic:()=>Pr,InstancingPipelineStage:()=>RI,InterpolationAlgorithm:()=>Koe,InterpolationType:()=>sf,Intersect:()=>qt,IntersectionTests:()=>yi,Intersections2D:()=>Qf,Interval:()=>Ns,InvertClassification:()=>CA,Ion:()=>Wd,IonGeocodeProviderType:()=>ty,IonGeocoderService:()=>JZ,IonImageryProvider:()=>$l,IonImageryProviderFactory:()=>FC,IonResource:()=>Ur,IonSnapGeometryType:()=>Qoe,IonSnapHeat:()=>qoe,IonSnapMode:()=>jM,IonSnapParentGeometryType:()=>$oe,IonSnapService:()=>ere,IonWorldImageryStyle:()=>Hb,Iso8601:()=>it,JobScheduler:()=>I9,JobType:()=>Lc,JsonMetadataTable:()=>Ib,JulianDate:()=>Q,KTX2Transcoder:()=>bG,KeyboardEventModifier:()=>ir,KeyframeNode:()=>zo,KmlCamera:()=>Uw,KmlDataSource:()=>XZ,KmlLookAt:()=>Dw,KmlTour:()=>Ow,KmlTourFlyTo:()=>zw,KmlTourWait:()=>Hw,Label:()=>Sx,LabelCollection:()=>Jp,LabelGraphics:()=>zh,LabelStyle:()=>Tr,LabelVisualizer:()=>FY,LagrangePolynomialApproximation:()=>HN,LeapSecond:()=>To,Light:()=>oae,LightingModel:()=>zp,LightingPipelineStage:()=>yP,LinearApproximation:()=>kx,LinearSpline:()=>ux,MVTDataProvider:()=>aae,ManagedArray:()=>Ol,MapMode2D:()=>fd,MapProjection:()=>nre,MapboxImageryProvider:()=>oP,MapboxStyleImageryProvider:()=>rae,MappedPositions:()=>fP,Material:()=>eo,MaterialAppearance:()=>Co,MaterialPipelineStage:()=>SP,MaterialProperty:()=>yr,Math:()=>W,Matrix2:()=>Ji,Matrix3:()=>q,Matrix4:()=>P,Megatexture:()=>X9,MeshPrimitiveGpmLocal:()=>FF,MetadataClass:()=>nf,MetadataClassProperty:()=>Xp,MetadataComponentType:()=>Nt,MetadataEntity:()=>Jn,MetadataEnum:()=>q2,MetadataEnumValue:()=>Q2,MetadataPicking:()=>N9,MetadataPickingPipelineStage:()=>Xu,MetadataPipelineStage:()=>km,MetadataSchema:()=>zl,MetadataSchemaLoader:()=>tx,MetadataSemantic:()=>Xm,MetadataTable:()=>Fm,MetadataTableProperty:()=>X2,MetadataType:()=>St,MipmapHint:()=>Vm,Model:()=>Nu,Model3DTileContent:()=>Yu,ModelAlphaOptions:()=>fS,ModelAnimation:()=>qF,ModelAnimationChannel:()=>QF,ModelAnimationCollection:()=>$F,ModelAnimationLoop:()=>Yd,ModelAnimationState:()=>lf,ModelArticulation:()=>lI,ModelArticulationStage:()=>cI,ModelClippingPlanesPipelineStage:()=>mI,ModelClippingPolygonsPipelineStage:()=>pI,ModelColorPipelineStage:()=>fx,ModelComponents:()=>Vn,ModelDrawCommand:()=>$P,ModelDrawCommands:()=>nX,ModelFeature:()=>eI,ModelFeatureTable:()=>tI,ModelGraphics:()=>gb,ModelImagery:()=>lX,ModelImageryMapping:()=>uS,ModelLightingOptions:()=>JP,ModelMatrixUpdateStage:()=>CI,ModelNode:()=>xI,ModelPrimitiveImagery:()=>mS,ModelReader:()=>xa,ModelRenderResources:()=>UP,ModelRuntimeNode:()=>EI,ModelRuntimePrimitive:()=>YP,ModelSceneGraph:()=>iX,ModelSilhouettePipelineStage:()=>BP,ModelSkin:()=>wP,ModelSplitterPipelineStage:()=>HP,ModelStatistics:()=>oX,ModelType:()=>Or,ModelUtility:()=>Zt,ModelVectorLookupPipelineStage:()=>yI,ModelVisualizer:()=>PY,Moon:()=>w9,MorphTargetsPipelineStage:()=>RP,MorphWeightSpline:()=>sre,MortonOrder:()=>Fx,MouseButton:()=>qa,Multiple3DTileContent:()=>sN,MultisampleFramebuffer:()=>NF,NavigationHelpButton:()=>W5,NavigationHelpButtonViewModel:()=>L5,NearFarScalar:()=>Kt,NeverTileDiscardPolicy:()=>lae,NodeRenderResources:()=>KP,NodeStatisticsPipelineStage:()=>VI,NodeTransformationProperty:()=>G_,OIT:()=>k9,Occluder:()=>QM,OffsetGeometryInstanceAttribute:()=>Zo,OpenCageGeocoderService:()=>lre,OpenStreetMapImageryProvider:()=>cy,OrderedGroundPrimitiveCollection:()=>iY,OrientedBoundingBox:()=>tn,OrthographicFrustum:()=>yn,OrthographicOffCenterFrustum:()=>bs,Packable:()=>dre,PackableForInterpolation:()=>ure,Panorama:()=>hae,PanoramaProvider:()=>fae,Particle:()=>EA,ParticleBurst:()=>bae,ParticleEmitter:()=>gae,ParticleSystem:()=>yae,Pass:()=>Le,PassState:()=>gc,PathGraphics:()=>yb,PathMode:()=>n0,PathVisualizer:()=>wY,PeliasGeocoderService:()=>JM,PerInstanceColorAppearance:()=>Tn,PerformanceDisplay:()=>ly,PerformanceWatchdog:()=>N5,PerformanceWatchdogViewModel:()=>X5,PerspectiveFrustum:()=>qi,PerspectiveOffCenterFrustum:()=>hd,PickDepth:()=>D9,PickDepthFramebuffer:()=>B9,PickFramebuffer:()=>H9,PickId:()=>$w,PickedMetadataInfo:()=>z9,Picking:()=>tU,PickingPipelineStage:()=>CP,PinBuilder:()=>Og,PixelDatatype:()=>Ue,PixelFormat:()=>Qe,PlanarFillIdFramebuffer:()=>K9,Plane:()=>cn,PlaneGeometry:()=>aY,PlaneGeometryUpdater:()=>lY,PlaneGraphics:()=>u2,PlaneOutlineGeometry:()=>cY,PntsLoader:()=>sX,PntsParser:()=>bS,PointCloud:()=>iU,PointCloudEyeDomeLighting:()=>Xb,PointCloudShading:()=>Up,PointCloudStylingPipelineStage:()=>EP,PointGraphics:()=>W_,PointPrimitive:()=>Ea,PointPrimitiveCollection:()=>mV,PointVisualizer:()=>kY,PolygonGeometry:()=>kp,PolygonGeometryLibrary:()=>oi,PolygonGeometryUpdater:()=>hY,PolygonGraphics:()=>Hh,PolygonHierarchy:()=>Gc,PolygonOutlineGeometry:()=>mY,PolygonPipeline:()=>mi,Polyline:()=>zm,PolylineArrowMaterialProperty:()=>xV,PolylineCollection:()=>xf,PolylineColorAppearance:()=>Ms,PolylineDashMaterialProperty:()=>_V,PolylineGeometry:()=>Ig,PolylineGeometryUpdater:()=>OY,PolylineGlowMaterialProperty:()=>ZV,PolylineGraphics:()=>qc,PolylineMaterialAppearance:()=>sc,PolylineOutlineMaterialProperty:()=>Ux,PolylinePipeline:()=>oo,PolylineVisualizer:()=>zY,PolylineVolumeGeometry:()=>bY,PolylineVolumeGeometryLibrary:()=>Cf,PolylineVolumeGeometryUpdater:()=>TY,PolylineVolumeGraphics:()=>v_,PolylineVolumeOutlineGeometry:()=>xY,PositionProperty:()=>Bh,PositionPropertyArray:()=>Rg,PostProcessStage:()=>Uo,PostProcessStageCollection:()=>RU,PostProcessStageComposite:()=>mu,PostProcessStageLibrary:()=>hm,PostProcessStageSampleMode:()=>mm,PostProcessStageTextureCache:()=>GR,PpeMetadata:()=>vF,PpeSource:()=>Uce,PpeTexture:()=>WF,Primitive:()=>In,PrimitiveCollection:()=>xl,PrimitiveLoadPlan:()=>sS,PrimitiveOutlineGenerator:()=>rS,PrimitiveOutlinePipelineStage:()=>LP,PrimitivePipeline:()=>b_,PrimitiveRenderResources:()=>jP,PrimitiveState:()=>ts,PrimitiveStatisticsPipelineStage:()=>WP,PrimitiveType:()=>Ie,ProjectionPicker:()=>U5,ProjectionPickerViewModel:()=>k5,Property:()=>j,PropertyArray:()=>CV,PropertyAttribute:()=>iS,PropertyAttributeProperty:()=>TF,PropertyBag:()=>Ul,PropertyTable:()=>Jl,PropertyTexture:()=>Pb,PropertyTextureProperty:()=>xF,ProviderViewModel:()=>mr,Proxy:()=>hre,QuadraticRealPolynomial:()=>Pl,QuadtreeOccluders:()=>f9,QuadtreePrimitive:()=>T9,QuadtreeTile:()=>p9,QuadtreeTileLoadState:()=>Qa,QuadtreeTileProvider:()=>wae,QuantizedMeshTerrainData:()=>DZ,QuarticRealPolynomial:()=>xG,Quaternion:()=>Ne,QuaternionSpline:()=>jF,Queue:()=>sx,Ray:()=>gn,Rectangle:()=>re,RectangleCollisionChecker:()=>dZ,RectangleGeometry:()=>nZ,RectangleGeometryLibrary:()=>Ca,RectangleGeometryUpdater:()=>_Y,RectangleGraphics:()=>Kh,RectangleOutlineGeometry:()=>FS,ReferenceFrame:()=>Oi,ReferenceProperty:()=>Cg,RenderState:()=>ze,Renderbuffer:()=>Wu,RenderbufferFormat:()=>ql,Request:()=>Ar,RequestErrorEvent:()=>Sp,RequestScheduler:()=>Hc,RequestState:()=>Ri,RequestType:()=>js,Resource:()=>ve,ResourceCache:()=>Ni,ResourceCacheKey:()=>Hl,ResourceCacheStatistics:()=>tF,ResourceLoader:()=>io,ResourceLoaderState:()=>Rt,Rotation:()=>oh,RuntimeError:()=>ae,S2Cell:()=>Rb,SDFSettings:()=>Da,SampledPositionProperty:()=>fc,SampledProperty:()=>Hu,Sampler:()=>Bt,ScaledPositionProperty:()=>l0,Scene:()=>DU,SceneFramebuffer:()=>RR,SceneMode:()=>se,SceneMode2DPipelineStage:()=>vP,SceneModePicker:()=>P5,SceneModePickerViewModel:()=>I5,SceneTransforms:()=>fo,SceneTransitioner:()=>EU,ScreenSpaceCameraController:()=>LU,ScreenSpaceElevatorCameraController:()=>t5,ScreenSpaceEventHandler:()=>la,ScreenSpaceEventType:()=>mn,ScreenSpaceInputBindings:()=>hp,ScreenSpaceMapCameraController:()=>n5,ScreenSpaceTiltOrbitCameraController:()=>Yce,ScreenSpaceZoomCameraController:()=>Mce,SelectedFeatureIdPipelineStage:()=>gx,SelectionIndicator:()=>M5,SelectionIndicatorViewModel:()=>w5,SensorVolumePortionToDisplay:()=>GV,ShaderBuilder:()=>Jb,ShaderCache:()=>eM,ShaderDestination:()=>fe,ShaderFunction:()=>kP,ShaderProgram:()=>nn,ShaderSource:()=>Je,ShaderStruct:()=>MP,ShadowMap:()=>uy,ShadowMapShader:()=>dp,ShadowMode:()=>vn,ShadowVolumeAppearance:()=>_u,SharedContext:()=>rM,ShowGeometryInstanceAttribute:()=>Wn,Simon1994PlanetaryPositions:()=>pT,SimplePolylineGeometry:()=>Rre,SingleTileImageryProvider:()=>rP,SkinningPipelineStage:()=>IP,SkyAtmosphere:()=>OU,SkyBox:()=>BU,SnapFramebuffer:()=>vU,SnapService:()=>Cre,Snapping:()=>IU,SpatialNode:()=>MU,Spdcf:()=>GF,SpecularEnvironmentCubeMap:()=>Qh,SphereEmitter:()=>bce,SphereGeometry:()=>tk,SphereOutlineGeometry:()=>mg,Spherical:()=>KN,Spline:()=>vo,SplitDirection:()=>Mr,Splitter:()=>GA,StaticGeometryColorBatch:()=>ch,StaticGeometryPerMaterialBatch:()=>lh,StaticGroundGeometryColorBatch:()=>JV,StaticGroundGeometryPerMaterialBatch:()=>WY,StaticGroundPolylinePerMaterialBatch:()=>BY,StaticOutlineGeometryBatch:()=>qV,StencilConstants:()=>Jt,StencilFunction:()=>ni,StencilOperation:()=>Ft,SteppedSpline:()=>JF,Stereographic:()=>rl,StorageType:()=>lx,StripeMaterialProperty:()=>EV,StripeOrientation:()=>vf,StructuralMetadata:()=>wa,StyleCommandsNeeded:()=>df,StyleExpression:()=>gce,Sun:()=>JU,SunLight:()=>Kg,SunPostProcess:()=>NU,SupportedImageFormats:()=>CF,SvgPathBindingHandler:()=>r5,Sync:()=>sM,TaskProcessor:()=>$n,Terrain:()=>jU,TerrainData:()=>ou,TerrainEncoding:()=>Cr,TerrainFillMesh:()=>xA,TerrainMesh:()=>yc,TerrainOffsetProperty:()=>F_,TerrainPicker:()=>LM,TerrainProvider:()=>Qo,TerrainQuantization:()=>Ka,TerrainState:()=>Mo,Texture:()=>vt,Texture3D:()=>aM,TextureAtlas:()=>gS,TextureCache:()=>tM,TextureMagnificationFilter:()=>ei,TextureManager:()=>ak,TextureMinificationFilter:()=>Ht,TexturePacker:()=>UC,TextureUniform:()=>lk,TextureWrap:()=>pn,TileAvailability:()=>jf,TileBoundingRegion:()=>ku,TileBoundingS2Cell:()=>dN,TileBoundingSphere:()=>hg,TileBoundingVolume:()=>yce,TileCoordinatesImageryProvider:()=>qU,TileDiscardPolicy:()=>Tce,TileEdge:()=>Gn,TileImagery:()=>XC,TileMapServiceImageryProvider:()=>yx,TileMetadata:()=>oN,TileOrientedBoundingBox:()=>Bd,TileProviderError:()=>tr,TileReplacementQueue:()=>b9,TileSelectionResult:()=>pi,TileState:()=>_ce,Tileset3DTileContent:()=>mX,TilesetMetadata:()=>uN,TilesetPipelineStage:()=>nI,TilingScheme:()=>Ere,TimeConstants:()=>Mn,TimeDynamicImagery:()=>dS,TimeDynamicPointCloud:()=>XA,TimeInterval:()=>Cn,TimeIntervalCollection:()=>Vs,TimeIntervalCollectionPositionProperty:()=>Vg,TimeIntervalCollectionProperty:()=>Eg,TimeStandard:()=>ci,Timeline:()=>B5,TimelineHighlightRange:()=>D5,TimelineTrack:()=>O5,Tipsify:()=>TG,ToggleButtonViewModel:()=>wT,Tonemapper:()=>fy,TrackingReferenceFrame:()=>ub,Transforms:()=>_t,TranslationRotationScale:()=>Yy,TranslucentTileClassification:()=>J9,TridiagonalSystemSolver:()=>hC,TrustedServers:()=>qR,TweenCollection:()=>vR,UniformState:()=>iM,UniformType:()=>F0,UrlTemplate3DTilesDataProvider:()=>M9,UrlTemplateImageryProvider:()=>Ss,VERSION:()=>$Bt,VRButton:()=>J5,VRButtonViewModel:()=>K5,VRTheWorldTerrainProvider:()=>Gre,VaryingType:()=>kce,Vector3DTileBatch:()=>Pp,Vector3DTileClampedPolylines:()=>IX,Vector3DTileContent:()=>XX,Vector3DTileGeometry:()=>Zb,Vector3DTilePoints:()=>EX,Vector3DTilePolygons:()=>AX,Vector3DTilePolylines:()=>RS,Vector3DTilePrimitive:()=>D_,VectorGltf3DTileContent:()=>Ex,VectorPipeline:()=>Ts,VectorProvider:()=>rg,VelocityOrientationProperty:()=>jN,VelocityVectorProperty:()=>Ag,VertexArray:()=>Un,VertexArrayFacade:()=>Qb,VertexAttributeSemantic:()=>dt,VertexFormat:()=>we,VerticalExaggeration:()=>_o,VerticalExaggerationPipelineStage:()=>XP,VerticalOrigin:()=>Bn,VideoSynchronizer:()=>Are,View:()=>VR,Viewer:()=>ule,ViewportQuad:()=>Rce,Visibility:()=>Jr,Visualizer:()=>Jie,VoxelBoundsCollection:()=>ny,VoxelBoxShape:()=>oR,VoxelCell:()=>YU,VoxelContent:()=>iR,VoxelCylinderShape:()=>rR,VoxelEllipsoidShape:()=>sR,VoxelInspector:()=>H5,VoxelInspectorViewModel:()=>z5,VoxelMetadataOrder:()=>P0,VoxelPrimitive:()=>NT,VoxelProvider:()=>Vce,VoxelRenderResources:()=>Ck,VoxelShape:()=>Ece,VoxelShapeType:()=>xc,VoxelTraversal:()=>kU,VulkanConstants:()=>Lre,WallGeometry:()=>ZY,WallGeometryLibrary:()=>iZ,WallGeometryUpdater:()=>VY,WallGraphics:()=>xb,WallOutlineGeometry:()=>CY,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>aP,WebMapTileServiceImageryProvider:()=>cP,WebMercatorProjection:()=>xi,WebMercatorTilingScheme:()=>Xr,WindingOrder:()=>qs,WireframeIndexGenerator:()=>wC,WireframePipelineStage:()=>NP,_shadersAcesTonemappingStage:()=>oU,_shadersAdditiveBlend:()=>PU,_shadersAdjustTranslucentFS:()=>DE,_shadersAllMaterialAppearanceFS:()=>lG,_shadersAllMaterialAppearanceVS:()=>dG,_shadersAmbientOcclusionGenerate:()=>rU,_shadersAmbientOcclusionModulate:()=>sU,_shadersAspectRampMaterial:()=>LG,_shadersAtmosphereCommon:()=>rf,_shadersAtmosphereStageFS:()=>iI,_shadersAtmosphereStageVS:()=>oI,_shadersBasicMaterialAppearanceFS:()=>uG,_shadersBasicMaterialAppearanceVS:()=>mG,_shadersBillboardCollectionFS:()=>hX,_shadersBillboardCollectionVS:()=>fX,_shadersBlackAndWhite:()=>aU,_shadersBloomComposite:()=>cU,_shadersBrdfLutGeneratorFS:()=>cM,_shadersBrightPass:()=>XU,_shadersBrightness:()=>lU,_shadersBufferPointMaterialFS:()=>YX,_shadersBufferPointMaterialVS:()=>NX,_shadersBufferPolygonMaterialFS:()=>cF,_shadersBufferPolygonMaterialVS:()=>aF,_shadersBufferPolylineMaterialFS:()=>DX,_shadersBufferPolylineMaterialVS:()=>UX,_shadersBumpMapMaterial:()=>WG,_shadersCPUStylingStageFS:()=>vI,_shadersCPUStylingStageVS:()=>WI,_shadersCheckerboardMaterial:()=>vG,_shadersCloudCollectionFS:()=>lM,_shadersCloudCollectionVS:()=>dM,_shadersCloudNoiseFS:()=>uM,_shadersCloudNoiseVS:()=>mM,_shadersCompareAndPackTranslucentDepth:()=>hM,_shadersCompositeOITFS:()=>fM,_shadersCompositeTranslucentClassification:()=>CR,_shadersComputeIrradianceFS:()=>fF,_shadersComputeRadianceMapFS:()=>pF,_shadersConstantLodStageFS:()=>_P,_shadersConstantLodStageVS:()=>TP,_shadersContrastBias:()=>dU,_shadersConvolveSpecularMapFS:()=>bF,_shadersConvolveSpecularMapVS:()=>gF,_shadersCubeMapPanoramaVS:()=>pM,_shadersCustomShaderStageFS:()=>PI,_shadersCustomShaderStageVS:()=>II,_shadersCzmBuiltins:()=>f_,_shadersDepthOfField:()=>uU,_shadersDepthPlaneFS:()=>bM,_shadersDepthPlaneVS:()=>gM,_shadersDepthView:()=>mU,_shadersDepthViewPacked:()=>Gce,_shadersDotMaterial:()=>FG,_shadersEdgeDetection:()=>hU,_shadersEdgeDetectionStageFS:()=>DI,_shadersEdgeVisibilityStageFS:()=>BI,_shadersEdgeVisibilityStageVS:()=>zI,_shadersElevationBandMaterial:()=>IG,_shadersElevationContourMaterial:()=>PG,_shadersElevationRampMaterial:()=>XG,_shadersEllipsoidFS:()=>OE,_shadersEllipsoidSurfaceAppearanceFS:()=>t9,_shadersEllipsoidSurfaceAppearanceVS:()=>n9,_shadersEllipsoidVS:()=>BE,_shadersFXAA:()=>bU,_shadersFXAA3_11:()=>yM,_shadersFadeMaterial:()=>NG,_shadersFeatureIdStageFS:()=>XI,_shadersFeatureIdStageVS:()=>NI,_shadersFilmicTonemapping:()=>fU,_shadersGaussianBlur1D:()=>PT,_shadersGeometryStageFS:()=>KI,_shadersGeometryStageVS:()=>JI,_shadersGlobeFS:()=>xM,_shadersGlobeVS:()=>TM,_shadersGridMaterial:()=>YG,_shadersGroundAtmosphere:()=>zE,_shadersHSBToRGB:()=>YW,_shadersHSLToRGB:()=>wW,_shadersImageBasedLightingStageFS:()=>sI,_shadersInstancingStageCommon:()=>TI,_shadersInstancingStageVS:()=>_I,_shadersIntersectBox:()=>gk,_shadersIntersectCylinder:()=>yk,_shadersIntersectDepth:()=>pk,_shadersIntersectEllipsoid:()=>xk,_shadersIntersectLongitude:()=>dA,_shadersIntersectPlane:()=>bk,_shadersIntersection:()=>nR,_shadersIntersectionUtils:()=>fk,_shadersLegacyInstancingStageVS:()=>SI,_shadersLensFlare:()=>gU,_shadersLightingStageFS:()=>gP,_shadersMaterialStageFS:()=>xP,_shadersMegatexture:()=>Rk,_shadersMetadataStageFS:()=>YI,_shadersMetadataStageVS:()=>wI,_shadersModelClippingPlanesStageFS:()=>uI,_shadersModelClippingPolygonsStageFS:()=>hI,_shadersModelClippingPolygonsStageVS:()=>fI,_shadersModelColorStageFS:()=>dI,_shadersModelFS:()=>tX,_shadersModelSilhouetteStageFS:()=>DP,_shadersModelSilhouetteStageVS:()=>OP,_shadersModelSplitterStageFS:()=>zP,_shadersModelVS:()=>eX,_shadersModelVectorLookupStageFS:()=>gI,_shadersModelVectorLookupStageVS:()=>bI,_shadersModifiedReinhardTonemapping:()=>yU,_shadersMorphTargetsStageVS:()=>ZP,_shadersNightVision:()=>xU,_shadersNormalMapMaterial:()=>wG,_shadersOctree:()=>Zk,_shadersPassThrough:()=>du,_shadersPassThroughDepth:()=>LT,_shadersPbrNeutralTonemapping:()=>pU,_shadersPerInstanceColorAppearanceFS:()=>jG,_shadersPerInstanceColorAppearanceVS:()=>QG,_shadersPerInstanceFlatColorAppearanceFS:()=>m_,_shadersPerInstanceFlatColorAppearanceVS:()=>qG,_shadersPointCloudEyeDomeLighting:()=>wF,_shadersPointCloudStylingStageVS:()=>VP,_shadersPointPrimitiveCollectionFS:()=>Mx,_shadersPointPrimitiveCollectionVS:()=>YN,_shadersPolylineArrowMaterial:()=>MG,_shadersPolylineColorAppearanceVS:()=>qv,_shadersPolylineCommon:()=>wl,_shadersPolylineDashMaterial:()=>kG,_shadersPolylineFS:()=>__,_shadersPolylineGlowMaterial:()=>UG,_shadersPolylineMaterialAppearanceVS:()=>$v,_shadersPolylineOutlineMaterial:()=>DG,_shadersPolylineShadowVolumeFS:()=>Kv,_shadersPolylineShadowVolumeMorphFS:()=>Jv,_shadersPolylineShadowVolumeMorphVS:()=>jv,_shadersPolylineShadowVolumeVS:()=>Qv,_shadersPolylineVS:()=>_X,_shadersPrimitiveGaussianSplatFS:()=>$X,_shadersPrimitiveGaussianSplatVS:()=>qX,_shadersPrimitiveOutlineStageFS:()=>GP,_shadersPrimitiveOutlineStageVS:()=>AP,_shadersRGBToHSB:()=>uv,_shadersRGBToHSL:()=>mv,_shadersRGBToXYZ:()=>hv,_shadersReinhardTonemapping:()=>TU,_shadersReprojectWebMercatorFS:()=>uP,_shadersReprojectWebMercatorVS:()=>mP,_shadersRimLightingMaterial:()=>OG,_shadersSelectedFeatureIdStageCommon:()=>SC,_shadersShadowVolumeAppearanceFS:()=>p1,_shadersShadowVolumeAppearanceVS:()=>wv,_shadersShadowVolumeFS:()=>Iy,_shadersSilhouette:()=>_U,_shadersSkinningStageVS:()=>FP,_shadersSkyAtmosphereCommon:()=>HE,_shadersSkyAtmosphereFS:()=>_M,_shadersSkyAtmosphereVS:()=>SM,_shadersSkyBoxFS:()=>ZM,_shadersSkyBoxVS:()=>RM,_shadersSlopeRampMaterial:()=>BG,_shadersStripeMaterial:()=>zG,_shadersSunFS:()=>CM,_shadersSunTextureFS:()=>VM,_shadersSunVS:()=>EM,_shadersTexturedMaterialAppearanceFS:()=>hG,_shadersTexturedMaterialAppearanceVS:()=>fG,_shadersVector3DTileClampedPolylinesFS:()=>vX,_shadersVector3DTileClampedPolylinesVS:()=>WX,_shadersVector3DTilePolylinesVS:()=>GX,_shadersVectorCommon:()=>Db,_shadersVectorTileVS:()=>E1,_shadersVerticalExaggerationStageVS:()=>PP,_shadersViewportQuadFS:()=>AM,_shadersViewportQuadVS:()=>NZ,_shadersVoxelFS:()=>mk,_shadersVoxelUtils:()=>uk,_shadersVoxelVS:()=>hk,_shadersWater:()=>KG,_shadersWaterMaskMaterial:()=>HG,_shadersXYZToRGB:()=>Nv,_shadersacesTonemapping:()=>eW,_shadersalphaWeight:()=>tW,_shadersantialias:()=>nW,_shadersapplyHSBShift:()=>iW,_shadersapproximateSphericalCoordinates:()=>oW,_shadersapproximateTanh:()=>rW,_shadersbackFacing:()=>sW,_shadersbranchFreeTernary:()=>aW,_shaderscascadeColor:()=>cW,_shaderscascadeDistance:()=>lW,_shaderscascadeMatrix:()=>dW,_shaderscascadeWeights:()=>uW,_shaderscolumbusViewMorph:()=>mW,_shaderscomputeAtmosphereColor:()=>hW,_shaderscomputeGroundAtmosphereScattering:()=>fW,_shaderscomputePosition:()=>pW,_shaderscomputeScattering:()=>bW,_shaderscomputeTextureTransform:()=>gW,_shadersconvertLocalToBoxUv:()=>Tk,_shadersconvertLocalToCylinderUv:()=>_k,_shadersconvertLocalToEllipsoidUv:()=>Sk,_shaderscosineAndSine:()=>yW,_shadersdecodeRGB8:()=>xW,_shadersdecompressTextureCoordinates:()=>TW,_shadersdegreesPerRadian:()=>oL,_shadersdepthClamp:()=>_W,_shadersdepthRange:()=>rL,_shadersdepthRangeStruct:()=>zL,_shaderseastNorthUpToEyeCoordinates:()=>SW,_shadersellipsoidContainsPoint:()=>ZW,_shadersellipsoidTextureCoordinates:()=>RW,_shadersepsilon1:()=>sL,_shadersepsilon2:()=>aL,_shadersepsilon3:()=>cL,_shadersepsilon4:()=>lL,_shadersepsilon5:()=>dL,_shadersepsilon6:()=>uL,_shadersepsilon7:()=>mL,_shadersequalsEpsilon:()=>CW,_shaderseyeOffset:()=>VW,_shaderseyeToCartographicDelta:()=>EW,_shaderseyeToWindowCoordinates:()=>AW,_shadersfastApproximateAtan:()=>GW,_shadersfog:()=>LW,_shadersgammaCorrect:()=>WW,_shadersgeodeticSurfaceNormal:()=>vW,_shadersgetDefaultMaterial:()=>FW,_shadersgetDynamicAtmosphereLightDirection:()=>IW,_shadersgetLambertDiffuse:()=>PW,_shadersgetSpecular:()=>XW,_shadersgetWaterNoise:()=>NW,_shadershue:()=>MW,_shadersinfinity:()=>hL,_shadersinverseGamma:()=>kW,_shadersisEmpty:()=>UW,_shadersisFull:()=>DW,_shaderslatitudeToWebMercatorFraction:()=>OW,_shaderslineDistance:()=>zW,_shaderslinearToSrgb:()=>BW,_shadersluminance:()=>HW,_shadersmaterial:()=>HL,_shadersmaterialInput:()=>KL,_shadersmaximumComponent:()=>KW,_shadersmetersPerPixel:()=>JW,_shadersmodelMaterial:()=>JL,_shadersmodelToWindowCoordinates:()=>jW,_shadersmodelVertexOutput:()=>jL,_shadersmultiplyWithColorBalance:()=>QW,_shadersnearFarScalar:()=>qW,_shadersoctDecode:()=>$W,_shadersoneOverPi:()=>fL,_shadersoneOverTwoPi:()=>pL,_shaderspackDepth:()=>ev,_shaderspassCesium3DTile:()=>bL,_shaderspassCesium3DTileClassification:()=>gL,_shaderspassCesium3DTileClassificationIgnoreShow:()=>yL,_shaderspassCesium3DTileEdges:()=>xL,_shaderspassCesium3DTileEdgesDirect:()=>TL,_shaderspassCesium3DTilePlanarFillId:()=>_L,_shaderspassClassification:()=>SL,_shaderspassCompute:()=>ZL,_shaderspassEnvironment:()=>RL,_shaderspassGaussianSplats:()=>CL,_shaderspassGlobe:()=>VL,_shaderspassOpaque:()=>EL,_shaderspassOverlay:()=>AL,_shaderspassTerrainClassification:()=>GL,_shaderspassTranslucent:()=>LL,_shaderspassVoxels:()=>WL,_shaderspbrLighting:()=>tv,_shaderspbrNeutralTonemapping:()=>nv,_shadersphong:()=>iv,_shaderspi:()=>vL,_shaderspiOverFour:()=>FL,_shaderspiOverSix:()=>IL,_shaderspiOverThree:()=>PL,_shaderspiOverTwo:()=>XL,_shadersplaneDistance:()=>ov,_shaderspointAlongRay:()=>rv,_shadersradiansPerDegree:()=>NL,_shadersray:()=>QL,_shadersrayEllipsoidIntersectionInterval:()=>sv,_shadersraySegment:()=>qL,_shadersraySphereIntersectionInterval:()=>av,_shadersreadDepth:()=>cv,_shadersreadNonPerspective:()=>lv,_shadersreverseLogDepth:()=>dv,_shadersround:()=>fv,_shaderssaturation:()=>pv,_shaderssceneMode2D:()=>YL,_shaderssceneMode3D:()=>wL,_shaderssceneModeColumbusView:()=>ML,_shaderssceneModeMorphing:()=>kL,_shadersshadowDepthCompare:()=>bv,_shadersshadowParameters:()=>$L,_shadersshadowVisibility:()=>gv,_shaderssignNotZero:()=>yv,_shaderssolarRadius:()=>UL,_shaderssphericalHarmonics:()=>xv,_shaderssrgbToLinear:()=>Tv,_shaderstangentToEyeSpaceMatrix:()=>_v,_shaderstextureCube:()=>Sv,_shadersthreePiOver2:()=>DL,_shaderstransformPlane:()=>Zv,_shaderstranslateRelativeToEye:()=>Rv,_shaderstranslucentPhong:()=>Cv,_shaderstranspose:()=>Vv,_shaderstwoPi:()=>OL,_shadersunpackDepth:()=>Ev,_shadersunpackFloat:()=>Av,_shadersunpackTexture:()=>Gv,_shadersunpackUint:()=>Lv,_shadersvalueTransform:()=>Wv,_shadersvertexLogDepth:()=>vv,_shaderswebMercatorMaxLatitude:()=>BL,_shaderswindowToEyeCoordinates:()=>Fv,_shaderswriteDepthClamp:()=>Iv,_shaderswriteLogDepth:()=>Pv,_shaderswriteNonPerspective:()=>Xv,addAllToArray:()=>ii,addBuffer:()=>B2,addDefaults:()=>Y2,addExtensionsRequired:()=>U2,addExtensionsUsed:()=>Im,addPipelineExtras:()=>Qy,addToArray:()=>pa,appendForwardSlash:()=>BA,arrayRemoveDuplicates:()=>Yo,assert:()=>P4,barycentricCoordinates:()=>i_,binarySearch:()=>Eo,buildModuleUrl:()=>en,buildVectorGltfFromMVT:()=>sk,buildVoxelCustomShader:()=>lA,buildVoxelDrawCommands:()=>Vk,clone:()=>$e,combine:()=>It,computeFlyToLocationForRectangle:()=>cR,createBillboardPointCallback:()=>TS,createColorRamp:()=>NM,createCommand:()=>Fn,createDefaultImageryProviderViewModels:()=>f5,createDefaultTerrainProviderViewModels:()=>p5,createElevationBandMaterial:()=>mse,createGooglePhotorealistic3DTileset:()=>hse,createGuid:()=>qn,createMaterialPropertyDescriptor:()=>sr,createOsmBuildingsAsync:()=>fse,createPropertyDescriptor:()=>be,createRawPropertyDescriptor:()=>kl,createTangentSpaceDebugPrimitive:()=>pse,createTaskProcessorWorker:()=>Dce,createUniform:()=>nL,createUniformArray:()=>iL,createVectorTileBuffersFromModelComponents:()=>KX,createWorldBathymetryAsync:()=>YM,createWorldImageryAsync:()=>Kb,createWorldTerrainAsync:()=>BZ,decodeGoogleEarthEnterpriseData:()=>wM,decodeMVT:()=>Kk,decodeVectorPolylinePositions:()=>PX,defaultPickWorldPosition:()=>mp,defer:()=>Zd,defined:()=>l,demodernizeShader:()=>Yv,deprecationWarning:()=>Jo,destroyObject:()=>me,exportKml:()=>qne,findAccessorMinMax:()=>q_,findContentMetadata:()=>WS,findGroupMetadata:()=>vS,findMeshoptExtension:()=>Jy,findTileMetadata:()=>rN,forEachTextureInMaterial:()=>X1,formatError:()=>Op,freezeRenderState:()=>U4,getAbsoluteUri:()=>xm,getAccessorByteStride:()=>Xd,getBaseUri:()=>zA,getBinaryAccessor:()=>Wm,getClipAndStyleCode:()=>a9,getClippingFunction:()=>hR,getComponentReader:()=>Gb,getElement:()=>Nn,getExtensionFromUri:()=>Q0,getFilenameFromUri:()=>Sg,getImageFromTypedArray:()=>DM,getImagePixels:()=>Fh,getJsonFromTypedArray:()=>vr,getMagic:()=>qh,getMeshPrimitives:()=>PF,getMetadataClassProperty:()=>c9,getMetadataProperty:()=>l9,getStringFromTypedArray:()=>Fd,getTimestamp:()=>Zn,hasExtension:()=>no,heightReferenceOnEntityPropertyChanged:()=>Tb,isBitSet:()=>_l,isBlobUri:()=>JT,isCrossOriginUrl:()=>Ry,isDataUri:()=>Ih,isLeapYear:()=>pu,knockout:()=>Ee,knockout_3_5_1:()=>wR,knockout_es5:()=>o5,loadAndExecuteScript:()=>jT,loadCubeMap:()=>oM,loadImageFromTypedArray:()=>Ab,loadKTX2:()=>Ed,mergeSort:()=>v0,mostDetailedSurfaceHeight:()=>Nh,moveTechniqueRenderStates:()=>k2,moveTechniquesToExtension:()=>D2,numberOfComponentsForType:()=>Vu,objectToQuery:()=>QT,oneTimeWarning:()=>xt,parseBatchTable:()=>wb,parseFeatureMetadataLegacy:()=>ZF,parseGlb:()=>Q_,parseResponseHeaders:()=>HA,parseStructuralMetadata:()=>SF,pickModel:()=>kC,pointInsideTriangle:()=>mre,positionForSurfaceHeight:()=>nb,preprocess3DTileContent:()=>lg,processVoxelProperties:()=>dk,queryToObject:()=>gu,readAccessorPacked:()=>z2,removeExtension:()=>$_,removeExtensionsRequired:()=>w2,removeExtensionsUsed:()=>j_,removePipelineExtras:()=>M2,removeUnusedElements:()=>O2,renderBufferPointCollection:()=>kX,renderBufferPolygonCollection:()=>uF,renderBufferPolylineCollection:()=>zX,resizeImageToNextPowerOfTwo:()=>ex,sampleTerrain:()=>qM,sampleTerrainMostDetailed:()=>jZ,scaleToGeodeticSurface:()=>KT,srgbToLinear:()=>qZ,subdivideArray:()=>Mv,subscribeAndEvaluate:()=>Sc,updateAccessorComponentTypes:()=>H2,updateVersion:()=>K2,usesExtension:()=>Dr,viewerCesium3DTilesInspectorMixin:()=>mle,viewerCesiumInspectorMixin:()=>hle,viewerDragDropMixin:()=>ple,viewerPerformanceWatchdogMixin:()=>ble,viewerVoxelInspectorMixin:()=>gle,webGLConstantToGlslType:()=>Wre,wrapFunction:()=>nk,writeTextToCanvas:()=>SS});var g0r=x(T(),1);var EOo=x(T(),1);var W3t=x(T(),1);var r3t=x(T(),1),ij={};ij.EMPTY_OBJECT=Object.freeze({});ij.EMPTY_ARRAY=Object.freeze([]);var B=ij;var a3t=x(T(),1);function EYe(e){return e!=null}var l=EYe;var d3t=x(T(),1);function HT(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(HT.prototype=Object.create(Error.prototype),HT.prototype.constructor=HT);HT.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};HT.throwInstantiationError=function(){throw new HT("This function defines an interface and should not be called directly.")};var ge=HT;var g3t=x(T(),1);var f3t=x(T(),1);var ma={};ma.typeOf={};function AYe(e){return`${e} is required, actual value was undefined`}function BR(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ma.defined=function(e,t){if(!l(t))throw new ge(AYe(e))};ma.typeOf.func=function(e,t){if(typeof t!="function")throw new ge(BR(typeof t,"function",e))};ma.typeOf.string=function(e,t){if(typeof t!="string")throw new ge(BR(typeof t,"string",e))};ma.typeOf.number=function(e,t){if(typeof t!="number")throw new ge(BR(typeof t,"number",e))};ma.typeOf.number.lessThan=function(e,t,n){if(ma.typeOf.number(e,t),t>=n)throw new ge(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ma.typeOf.number.lessThanOrEquals=function(e,t,n){if(ma.typeOf.number(e,t),t>n)throw new ge(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ma.typeOf.number.greaterThan=function(e,t,n){if(ma.typeOf.number(e,t),t<=n)throw new ge(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ma.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ma.typeOf.number(e,t),t0&&(this._hash={},t.length=0)}},Mt=sj;var Wjt=x(T(),1);var U3t=x(T(),1);var Y3t=x(T(),1),aj=x(Q5(),1);var Tt={};Tt.EPSILON1=.1;Tt.EPSILON2=.01;Tt.EPSILON3=.001;Tt.EPSILON4=1e-4;Tt.EPSILON5=1e-5;Tt.EPSILON6=1e-6;Tt.EPSILON7=1e-7;Tt.EPSILON8=1e-8;Tt.EPSILON9=1e-9;Tt.EPSILON10=1e-10;Tt.EPSILON11=1e-11;Tt.EPSILON12=1e-12;Tt.EPSILON13=1e-13;Tt.EPSILON14=1e-14;Tt.EPSILON15=1e-15;Tt.EPSILON16=1e-16;Tt.EPSILON17=1e-17;Tt.EPSILON18=1e-18;Tt.EPSILON19=1e-19;Tt.EPSILON20=1e-20;Tt.EPSILON21=1e-21;Tt.GRAVITATIONALPARAMETER=3986004418e5;Tt.SOLAR_RADIUS=6955e5;Tt.LUNAR_RADIUS=1737400;Tt.SIXTY_FOUR_KILOBYTES=64*1024;Tt.FOUR_GIGABYTES=4*1024*1024*1024;Tt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};Tt.signNotZero=function(e){return e<0?-1:1};Tt.toSNorm=function(e,t){return t=t??255,Math.round((Tt.clamp(e,-1,1)*.5+.5)*t)};Tt.fromSNorm=function(e,t){return t=t??255,Tt.clamp(e,0,t)/t*2-1};Tt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:Tt.clamp((e-t)/n,0,1)};Tt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};Tt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};Tt.lerp=function(e,t,n){return(1-n)*e+n*t};Tt.smoothDamp=function(e,t,n,i=0,o=Number.POSITIVE_INFINITY,r=1e-4,s={}){r=Math.max(1e-4,r);let a=2/r,c=a*i,d=1/(1+c+.48*c*c+.235*c*c*c),u=o*r,m=e-t;m=Tt.clamp(m,-u,u);let p=e-m,b=(n+a*m)*i;return n=(n-a*b)*d,s.value=p+(m+b)*d,s.velocity=n,s};Tt.PI=Math.PI;Tt.ONE_OVER_PI=1/Math.PI;Tt.PI_OVER_TWO=Math.PI/2;Tt.PI_OVER_THREE=Math.PI/3;Tt.PI_OVER_FOUR=Math.PI/4;Tt.PI_OVER_SIX=Math.PI/6;Tt.THREE_PI_OVER_TWO=3*Math.PI/2;Tt.TWO_PI=2*Math.PI;Tt.ONE_OVER_TWO_PI=1/(2*Math.PI);Tt.RADIANS_PER_DEGREE=Math.PI/180;Tt.DEGREES_PER_RADIAN=180/Math.PI;Tt.RADIANS_PER_ARCSECOND=Tt.RADIANS_PER_DEGREE/3600;Tt.toRadians=function(e){return e*Tt.RADIANS_PER_DEGREE};Tt.toDegrees=function(e){return e*Tt.DEGREES_PER_RADIAN};Tt.convertLongitudeRange=function(e){let t=Tt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};Tt.clampToLatitudeRange=function(e){return Tt.clamp(e,-1*Tt.PI_OVER_TWO,Tt.PI_OVER_TWO)};Tt.negativePiToPi=function(e){return e>=-Tt.PI&&e<=Tt.PI?e:Tt.zeroToTwoPi(e+Tt.PI)-Tt.PI};Tt.zeroToTwoPi=function(e){if(e>=0&&e<=Tt.TWO_PI)return e;let t=Tt.mod(e,Tt.TWO_PI);return Math.abs(t)Tt.EPSILON14?Tt.TWO_PI:t};Tt.mod=function(e,t){return Tt.sign(e)===Tt.sign(t)&&Math.abs(e)n};Tt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var q5=[1];Tt.factorial=function(e){let t=q5.length;if(e>=t){let n=q5[t-1];for(let i=t;i<=e;i++){let o=n*i;q5.push(o),n=o}}return q5[e]};Tt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};Tt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};Tt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};Tt.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};Tt.clamp=function(e,t,n){return en?n:e};var _le=new aj.default;Tt.setRandomNumberSeed=function(e){_le=new aj.default(e)};Tt.nextRandomNumber=function(){return _le.random()};Tt.randomBetween=function(e,t){return Tt.nextRandomNumber()*(t-e)+e};Tt.acosClamped=function(e){return Math.acos(Tt.clamp(e,-1,1))};Tt.asinClamped=function(e){return Math.asin(Tt.clamp(e,-1,1))};Tt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};Tt.logBase=function(e,t){return Math.log(e)/Math.log(t)};Tt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};Tt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};Tt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};Tt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};Tt.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=Tt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?Tt.PI_OVER_TWO-i:i,i=e<0?Tt.PI-i:i,i=t<0?-i:i,i};var W=Tt;var us=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,o=i*2;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;rW.EPSILON12);return l(o)?(o.x=r*I,o.y=s*N,o.z=a*g,o):new h(r*I,s*N,a*g)}var KT=XYe;var vl=class vl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,o){return i=i??0,l(o)?(o.longitude=t,o.latitude=n,o.height=i,o):new vl(t,n,i)}static fromDegrees(t,n,i,o){return t=W.toRadians(t),n=W.toRadians(n),vl.fromRadians(t,n,i,o)}static fromCartesian(t,n,i){let o=l(n)?n.oneOverRadii:vl._ellipsoidOneOverRadii,r=l(n)?n.oneOverRadiiSquared:vl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:vl._ellipsoidCenterToleranceSquared,a=KT(t,o,r,s,YYe);if(!l(a))return;let c=h.multiplyComponents(a,r,NYe);c=h.normalize(c,c);let d=h.subtract(t,a,wYe),u=Math.atan2(c.y,c.x),m=Math.asin(c.z),p=W.sign(h.dot(d,t))*h.magnitude(d);return l(i)?(i.longitude=u,i.latitude=m,i.height=p,i):new vl(u,m,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new vl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return vl.clone(this,t)}equals(t){return vl.equals(this,t)}equalsEpsilon(t,n){return vl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};mt(vl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),mt(vl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),mt(vl,"_ellipsoidCenterToleranceSquared",W.EPSILON1);var OA=vl;OA.ZERO=Object.freeze(new OA(0,0,0));var NYe=new h,YYe=new h,wYe=new h,pe=OA;var mzt=x(T(),1);function Vle(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(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)}var Fl=class e{constructor(t,n,i){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,Vle(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&Vle(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,pe._ellipsoidOneOverRadii=t.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let o=h.unpack(t,n);return e.fromCartesian3(o,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,o=t.latitude,r=Math.cos(o),s=r*Math.cos(i),a=r*Math.sin(i),c=Math.sin(o);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,W.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=MYe,o=kYe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,o);let r=Math.sqrt(h.dot(i,o));return h.divideByScalar(o,r,o),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(o,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let o=0;o=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new k);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,BYe),o=h.distance(t,i),r=this.minimumRadius*o/this.maximumRadius**2,s=o*r**2;return k.fromElements(1/o,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,o=t.south,r=t.north;for(;i0){o=r-1;continue}return r}return~(o+1)}var Eo=QYe;var Azt=x(T(),1);function qYe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Sy=qYe;var jzt=x(T(),1);var Pzt=x(T(),1);var Lzt=x(T(),1);function $Ye(e){return e%4===0&&e%100!==0||e%400===0}var pu=$Ye;var Wle=[31,28,31,30,31,30,31,31,30,31,30,31];function ewe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=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 y(){Ko.typeOf.number.greaterThanOrEquals("Year",e,1),Ko.typeOf.number.lessThanOrEquals("Year",e,9999),Ko.typeOf.number.greaterThanOrEquals("Month",t,1),Ko.typeOf.number.lessThanOrEquals("Month",t,12),Ko.typeOf.number.greaterThanOrEquals("Day",n,1),Ko.typeOf.number.lessThanOrEquals("Day",n,31),Ko.typeOf.number.greaterThanOrEquals("Hour",i,0),Ko.typeOf.number.lessThanOrEquals("Hour",i,23),Ko.typeOf.number.greaterThanOrEquals("Minute",o,0),Ko.typeOf.number.lessThanOrEquals("Minute",o,59),Ko.typeOf.bool("IsLeapSecond",a),Ko.typeOf.number.greaterThanOrEquals("Second",r,0),Ko.typeOf.number.lessThanOrEquals("Second",r,a?60:59),Ko.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Ko.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let S=t===2&&pu(e)?Wle[t-1]+1:Wle[t-1];if(n>S)throw new ge("Month and Day represents invalid date")}}var vh=ewe;var Nzt=x(T(),1);function twe(e,t){this.julianDate=e,this.offset=t}var To=twe;var wzt=x(T(),1),vle={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};Object.freeze(vle);var Mn=vle;var kzt=x(T(),1),Fle={UTC:0,TAI:1};Object.freeze(Fle);var ci=Fle;var Ile=new vh,uj=[31,28,31,30,31,30,31,31,30,31,30,31],mj=29;function fj(e,t){return Zi.compare(e.julianDate,t.julianDate)}var HR=new To;function iD(e){HR.julianDate=e;let t=Zi.leapSeconds,n=Eo(t,HR,fj);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Zi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Zi.addSeconds(e,i,e)}function Ple(e,t){HR.julianDate=e;let n=Zi.leapSeconds,i=Eo(n,HR,fj);if(i<0&&(i=~i),i===0)return Zi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Zi.addSeconds(e,-n[i-1].offset,t);let o=Zi.secondsDifference(n[i].julianDate,e);if(o===0)return Zi.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Zi.addSeconds(e,-n[i-1].offset,t)}function Zy(e,t,n){let i=t/Mn.SECONDS_PER_DAY|0;return e+=i,t-=Mn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Mn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function hj(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*Mn.SECONDS_PER_HOUR+o*Mn.SECONDS_PER_MINUTE+s*Mn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var nwe=/^(\d{4})$/,iwe=/^(\d{4})-(\d{2})$/,owe=/^(\d{4})-?(\d{3})$/,rwe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,swe=/^(\d{4})-?(\d{2})-?(\d{2})$/,pj=/([Z+\-])?(\d{2})?:?(\d{2})?$/,awe=/^(\d{2})(\.\d+)?/.source+pj.source,cwe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+pj.source,lwe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+pj.source;var Zi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ci.UTC;let o=t|0;n=n+(t-o)*Mn.SECONDS_PER_DAY,Zy(o,n,this),i===ci.UTC&&iD(this)}static fromGregorianDate(t,n){let i=hj(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Zy(i[0],i[1],n),iD(n),n):new e(i[0],i[1],ci.UTC)}static fromDate(t,n){let i=hj(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Zy(i[0],i[1],n),iD(n),n):new e(i[0],i[1],ci.UTC)}static fromIso8601(t,n){t=t.replace(",",".");let i=t.split("T"),o,r=1,s=1,a=0,c=0,d=0,u=0,m=i[0],p=i[1],b,f;if(i=m.match(swe),i!==null)o=+i[1],r=+i[2],s=+i[3];else if(i=m.match(iwe),i!==null)o=+i[1],r=+i[2];else if(i=m.match(nwe),i!==null)o=+i[1];else{let Z;if(i=m.match(owe),i!==null)o=+i[1],Z=+i[2],f=pu(o);else if(i=m.match(rwe),i!==null){o=+i[1];let R=+i[2],C=+i[3]||0,E=new Date(Date.UTC(o,0,4));Z=R*7+C-E.getUTCDay()-3}b=new Date(Date.UTC(o,0,1)),b.setUTCDate(Z),r=b.getUTCMonth()+1,s=b.getUTCDate()}f=pu(o);let y;if(l(p)){i=p.match(lwe),i!==null?(a=+i[1],c=+i[2],d=+i[3],u=+(i[4]||0)*1e3,y=5):(i=p.match(cwe),i!==null?(a=+i[1],c=+i[2],d=+(i[3]||0)*60,y=4):(i=p.match(awe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let Z=i[y],R=+i[y+1],C=+(i[y+2]||0);switch(Z){case"+":a=a-R,c=c-C;break;case"-":a=a+R,c=c+C;break;case"Z":break;default:c=c+new Date(Date.UTC(o,r-1,s,a,c)).getTimezoneOffset();break}}let _=d===60;for(_&&d--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(b=f&&r===2?mj:uj[r-1];s>b;)s-=b,r++,r>12&&(r-=12,o++),b=f&&r===2?mj:uj[r-1];for(;c<0;)c+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)r--,r<1&&(r+=12,o--),b=f&&r===2?mj:uj[r-1],s+=b;let S=hj(o,r,s,a,c,d,u);return l(n)?(Zy(S[0],S[1],n),iD(n)):n=new e(S[0],S[1],ci.UTC),_&&e.addSeconds(n,1,n),n}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,o=Ple(t,oD);l(o)||(e.addSeconds(t,-1,oD),o=Ple(oD,oD),i=!0);let r=o.dayNumber,s=o.secondsOfDay;s>=43200&&(r+=1);let a=r+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let u=80*a/2447|0,m=a-(2447*u/80|0)|0;a=u/11|0;let p=u+2-12*a|0,b=100*(c-49)+d+a|0,f=s/Mn.SECONDS_PER_HOUR|0,y=s-f*Mn.SECONDS_PER_HOUR,_=y/Mn.SECONDS_PER_MINUTE|0;y=y-_*Mn.SECONDS_PER_MINUTE;let S=y|0,Z=(y-S)/Mn.SECONDS_PER_MILLISECOND;return f+=12,f>23&&(f-=24),i&&(S+=1),l(n)?(n.year=b,n.month=p,n.day=m,n.hour=f,n.minute=_,n.second=S,n.millisecond=Z,n.isLeapSecond=i,n):new vh(b,p,m,f,_,S,Z,i)}static toDate(t){let n=e.toGregorianDate(t,Ile),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,Ile),o=i.year,r=i.month,s=i.day,a=i.hour,c=i.minute,d=i.second,u=i.millisecond;o===1e4&&r===1&&s===1&&a===0&&c===0&&d===0&&u===0&&(o=9999,r=12,s=31,a=24);let m;if(!l(n)&&u!==0){let p=u*.01;return m=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${m}Z`}return!l(n)||n===0?`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(m=(u*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${m}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ci.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/Mn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*Mn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,o=(t.secondsOfDay-n.secondsOfDay)/Mn.SECONDS_PER_DAY;return i+o}static computeTaiMinusUtc(t){HR.julianDate=t;let n=e.leapSeconds,i=Eo(n,HR,fj);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Zy(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let o=t.secondsOfDay+n*Mn.SECONDS_PER_MINUTE;return Zy(t.dayNumber,o,i)}static addHours(t,n,i){let o=t.secondsOfDay+n*Mn.SECONDS_PER_HOUR;return Zy(t.dayNumber,o,i)}static addDays(t,n,i){let o=t.dayNumber+n;return Zy(o,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},oD=new Zi(0,0,ci.TAI);Zi.leapSeconds=[new To(new Zi(2441317,43210,ci.TAI),10),new To(new Zi(2441499,43211,ci.TAI),11),new To(new Zi(2441683,43212,ci.TAI),12),new To(new Zi(2442048,43213,ci.TAI),13),new To(new Zi(2442413,43214,ci.TAI),14),new To(new Zi(2442778,43215,ci.TAI),15),new To(new Zi(2443144,43216,ci.TAI),16),new To(new Zi(2443509,43217,ci.TAI),17),new To(new Zi(2443874,43218,ci.TAI),18),new To(new Zi(2444239,43219,ci.TAI),19),new To(new Zi(2444786,43220,ci.TAI),20),new To(new Zi(2445151,43221,ci.TAI),21),new To(new Zi(2445516,43222,ci.TAI),22),new To(new Zi(2446247,43223,ci.TAI),23),new To(new Zi(2447161,43224,ci.TAI),24),new To(new Zi(2447892,43225,ci.TAI),25),new To(new Zi(2448257,43226,ci.TAI),26),new To(new Zi(2448804,43227,ci.TAI),27),new To(new Zi(2449169,43228,ci.TAI),28),new To(new Zi(2449534,43229,ci.TAI),29),new To(new Zi(2450083,43230,ci.TAI),30),new To(new Zi(2450630,43231,ci.TAI),31),new To(new Zi(2451179,43232,ci.TAI),32),new To(new Zi(2453736,43233,ci.TAI),33),new To(new Zi(2454832,43234,ci.TAI),34),new To(new Zi(2456109,43235,ci.TAI),35),new To(new Zi(2457204,43236,ci.TAI),36),new To(new Zi(2457754,43237,ci.TAI),37)];var Q=Zi;var MKt=x(T(),1),nde=x(bu(),1);var nHt=x(T(),1);function dwe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var BA=dwe;var oHt=x(T(),1);function Ule(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=Ule(o,t)),n[i]=o}return n}var $e=Ule;var aHt=x(T(),1);function Dle(e,t,n){n=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]=Dle(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 It=Dle;var lHt=x(T(),1);function uwe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Zd=uwe;var mHt=x(T(),1),Ole=x(bu(),1);function bj(e,t){let n;return typeof document<"u"&&(n=document),bj._implementation(e,t,n)}bj._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Ole.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var xm=bj;var fHt=x(T(),1),Ble=x(bu(),1);function mwe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Ble.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var zA=mwe;var bHt=x(T(),1),zle=x(bu(),1);function hwe(e){let t=new zle.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 Q0=hwe;var xHt=x(T(),1);var Hle={};function fwe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Hle[t];l(i)||(i={},Hle[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 Fh=fwe;var _Ht=x(T(),1);var pwe=/^blob:/i;function bwe(e){return pwe.test(e)}var JT=bwe;var RHt=x(T(),1);var _p;function gwe(e){l(_p)||(_p=document.createElement("a")),_p.href=window.location.href;let t=_p.host,n=_p.protocol;return _p.href=e,_p.href=_p.href,n!==_p.protocol||t!==_p.host}var Ry=gwe;var VHt=x(T(),1);var ywe=/^data:/i;function xwe(e){return ywe.test(e)}var Ih=xwe;var AHt=x(T(),1);function Twe(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 jT=Twe;var LHt=x(T(),1);function _we(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;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var HA=Zwe;function jle(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=HA(this.responseHeaders))}jle.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Sp=jle;var uKt=x(T(),1),lD=x(bu(),1);var qHt=x(T(),1);function qT(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(qT.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=0;--t)this.heapify(t)};qT.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};qT.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return gj(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var KA=qT;var tKt=x(T(),1);function JA(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(JA.prototype=Object.create(Error.prototype),JA.prototype.constructor=JA);JA.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var ae=JA;function Rwe(e,t){return e.priority-t.priority}var Ao={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},jR=20,zc=new KA({comparator:Rwe});zc.maximumLength=jR;zc.reserve(jR);var Zp=[],q0={},Cwe=typeof document<"u"?new lD.default(document.location.href):new lD.default,dD=new Se;function Gr(){}Gr.maximumRequests=50;Gr.maximumRequestsPerServer=18;Gr.requestsByServer={};Gr.throttleRequests=!0;Gr.debugShowStatistics=!1;Gr.requestCompletedEvent=dD;Object.defineProperties(Gr,{statistics:{get:function(){return Ao}},priorityHeapLength:{get:function(){return jR},set:function(e){if(ee;){let t=zc.pop();$T(t)}jR=e,zc.maximumLength=e,zc.reserve(e)}}});function Qle(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Gr.serverHasOpenSlots=function(e,t){t=t??1;let n=Gr.requestsByServer[e]??Gr.maximumRequestsPerServer;return q0[e]+t<=n};Gr.heapHasOpenSlots=function(e){return zc.length+e<=jR};function qle(e){return e.state===Ri.UNISSUED&&(e.state=Ri.ISSUED,e.deferred=Zd()),e.deferred.promise}function Vwe(e){return function(t){if(e.state===Ri.CANCELLED)return;let n=e.deferred;--Ao.numberOfActiveRequests,--q0[e.serverKey],dD.raiseEvent(),e.state=Ri.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Ewe(e){return function(t){e.state!==Ri.CANCELLED&&(++Ao.numberOfFailedRequests,--Ao.numberOfActiveRequests,--q0[e.serverKey],dD.raiseEvent(t),e.state=Ri.FAILED,e.deferred.reject(t))}}function $le(e){let t=qle(e);return e.state=Ri.ACTIVE,Zp.push(e),++Ao.numberOfActiveRequests,++Ao.numberOfActiveRequestsEver,++q0[e.serverKey],e.requestFunction().then(Vwe(e)).catch(Ewe(e)),t}function $T(e){let t=e.state===Ri.ACTIVE;if(e.state=Ri.CANCELLED,++Ao.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new ae(`Request cancelled: "${e.url}"`))}t&&(--Ao.numberOfActiveRequests,--q0[e.serverKey],++Ao.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Gr.update=function(){let e,t,n=0,i=Zp.length;for(e=0;e0&&(Zp[e-n]=t)}Zp.length-=n;let o=zc.internalArray,r=zc.length;for(e=0;e0;){if(t=zc.pop(),t.cancelled){$T(t);continue}if(t.throttleByServer&&!Gr.serverHasOpenSlots(t.serverKey)){$T(t);continue}$le(t),++a}Awe()};Gr.getServerKey=function(e){let t=new lD.default(e);t.scheme()===""&&(t=t.absoluteTo(Cwe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=q0[n];return l(i)||(q0[n]=0),n};Gr.request=function(e){if(Ih(e.url)||JT(e.url))return dD.raiseEvent(),e.state=Ri.RECEIVED,e.requestFunction();if(++Ao.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Gr.getServerKey(e.url)),Gr.throttleRequests&&e.throttleByServer&&!Gr.serverHasOpenSlots(e.serverKey))return;if(!Gr.throttleRequests||!e.throttle)return $le(e);if(Zp.length>=Gr.maximumRequests)return;Qle(e);let t=zc.insert(e);if(l(t)){if(t===e)return;$T(t)}return qle(e)};function Awe(){Gr.debugShowStatistics&&(Ao.numberOfActiveRequests===0&&Ao.lastNumberOfActiveRequests>0&&(Ao.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ao.numberOfAttemptedRequests}`),Ao.numberOfAttemptedRequests=0),Ao.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ao.numberOfCancelledRequests}`),Ao.numberOfCancelledRequests=0),Ao.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ao.numberOfCancelledActiveRequests}`),Ao.numberOfCancelledActiveRequests=0),Ao.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ao.numberOfFailedRequests}`),Ao.numberOfFailedRequests=0)),Ao.lastNumberOfActiveRequests=Ao.numberOfActiveRequests)}Gr.clearForSpecs=function(){for(;zc.length>0;){let t=zc.pop();$T(t)}let e=Zp.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});Ut.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ut.prototype.parseUrl=function(e,t,n,i){let o=new nde.default(e),r=Lwe(o.query());this._queryParameters=t?mD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(xm(i))),this._url=o.toString()};function Lwe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:gu(e)}function mD(e,t,n){if(!n)return It(e,t);let i=$e(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}Ut.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Wwe(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 Wwe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${QT(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=mD(this._queryParameters,e,!1):this._queryParameters=mD(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=mD(e,this._queryParameters,!0)};Ut.prototype.setTemplateValues=function(e,t){t?this._templateValues=It(this._templateValues,e):this._templateValues=It(e,this._templateValues)};Ut.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=It(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=It(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=It(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};Ut.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})};Ut.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=$e(this._queryParameters),e._templateValues=$e(this._templateValues),e.headers=$e(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Ut({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})};Ut.prototype.getBaseUri=function(e){return zA(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=BA(this._url)};Ut.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Ut.fetchArrayBuffer=function(e){return new Ut(e).fetchArrayBuffer()};Ut.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Ut.fetchBlob=function(e){return new Ut(e).fetchBlob()};Ut.prototype.fetchImage=function(e){e=e??B.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(yj(this.request),!ide||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Ut.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Ut.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Ut({url:m}),c._fetchImage({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)})};Ut.prototype._fetchImage=function(e){let t=this,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=Zd();return Ut._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Hc.request(r);if(l(s))return s.catch(function(a){return r.state!==Ri.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Ri.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})};Ut.fetchImage=function(e){return new Ut(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Ut.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Ut.fetchText=function(e){return new Ut(e).fetchText()};Ut.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)})};Ut.fetchJson=function(e){return new Ut(e).fetchJson()};Ut.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Ut.fetchXML=function(e){return new Ut(e).fetchXML()};Ut.prototype.fetchJsonp=function(e){e=e??"callback",yj(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return ode(this,e,t)};function ode(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=Zd();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Ut._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Hc.request(o);if(l(s))return s.catch(function(a){return o.state!==Ri.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Ri.UNISSUED,o.deferred=void 0,ode(e,t,n)):Promise.reject(a)})})}Ut.fetchJsonp=function(e){return new Ut(e).fetchJsonp(e.callbackParameterName)};Ut.prototype._makeRequest=function(e){let t=this;yj(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=It(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=Zd(),m=Ut._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=Hc.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!==Ri.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Ri.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function yj(e){if(e.state===Ri.ISSUED||e.state===Ri.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=Ri.UNISSUED,e.deferred=void 0}var vwe=/^data:(.*?)(;base64)?,(.*)$/;function uD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function tde(e,t){let n=uD(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Sp(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 Sp)})}var Pwe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=vwe.exec(e);if(a!==null){r.resolve(Fwe(a,t));return}if(Pwe){Iwe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(qR.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 Sp(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let b=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};b.forEach(function(y){let _=y.split(": "),S=_.shift();f[S]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||m===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(m===""||m==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Sp)},c.send(i),c};Ut._Implementations.loadAndExecuteScript=function(e,t,n){return jT(e,t).catch(function(i){n.reject(i)})};Ut._DefaultImplementations={};Ut._DefaultImplementations.createImage=Ut._Implementations.createImage;Ut._DefaultImplementations.loadWithXhr=Ut._Implementations.loadWithXhr;Ut._DefaultImplementations.loadAndExecuteScript=Ut._Implementations.loadAndExecuteScript;Ut.DEFAULT=Object.freeze(new Ut({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ve=Ut;function qA(e){e=e??B.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=e.addNewLeapSeconds??!0,l(e.data)?rde(this,e.data):rde(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}qA.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.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 qA({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};qA.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 Sy(0,0,0,0,0),t}});qA.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Sy(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,r;if(l(i)){let a=n[i],c=n[i+1],d=Q.lessThanOrEquals(a,e),u=!l(c),m=u||Q.greaterThanOrEquals(c,e);if(d&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,ade(this,n,this._samples,e,o,r,t),t}let s=Eo(n,e,Q.compare,this._dateColumn);return s>=0?(st.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 sde(e,n,o,a,s),s;if(i.equals(d))return sde(e,n,r,a,s),s;let u=Q.secondsDifference(i,c)/Q.secondsDifference(d,c),m=o*a,p=r*a,b=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],y=f-b;if(y>.5||y<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],S=n[p+e._taiMinusUtcSecondsColumn];_!==S&&(d.equals(i)?b=f:f-=S-_)}return s.xPoleWander=QA(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=QA(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=QA(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=QA(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=QA(u,b,f),s}var $A=qA;var nJt=x(T(),1);function Kc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Kc.fromQuaternion=function(e,t){l(t)||(t=new Kc);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};Kc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Kc),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};Kc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Kc(e.heading,e.pitch,e.roll)};Kc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Kc.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)};Kc.prototype.clone=function(e){return Kc.clone(this,e)};Kc.prototype.equals=function(e){return Kc.equals(this,e)};Kc.prototype.equalsEpsilon=function(e,t,n){return Kc.equalsEpsilon(this,e,t,n)};Kc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Cc=Kc;var xJt=x(T(),1);var aJt=x(T(),1);var cde={};var lde=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Nwe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(hD)||(hD=document.createElement("a")),hD.href=e,hD.href)}var e_;function ude(){if(l(e_))return e_;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(cde?.url)?e=xm(".",cde.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(j5.toUrl)?e=xm("..",t_("Core/buildModuleUrl.js")):e=Nwe(),e_=new ve({url:dde(e)}),e_.appendForwardSlash(),e_}function Ywe(e){return dde(j5.toUrl(`../${e}`))}function mde(e){return ude().getDerivedResource({url:e}).url}var fD;function t_(e){return l(fD)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(j5.toUrl)?fD=Ywe:fD=mde),fD(e)}t_._cesiumScriptRegex=lde;t_._buildModuleUrlFromBaseUrl=mde;t_._clearBaseResource=function(){e_=void 0};t_.setBaseUrl=function(e){e_=ve.DEFAULT.getDerivedResource({url:e})};t_.getCesiumBaseUrl=ude;var en=t_;var dJt=x(T(),1);function wwe(e,t,n){this.x=e,this.y=t,this.s=n}var n_=wwe;function pD(e){e=e??B.EMPTY_OBJECT,this._xysFileUrlTemplate=ve.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,ci.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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 Mwe=new Q(0,0,ci.TAI);function xj(e,t,n){let i=Mwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}pD.prototype.preload=function(e,t,n,i){let o=xj(this,e,t),r=xj(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 m=c;m<=d;++m)u.push(Tj(this,m));return Promise.all(u)};pD.prototype.computeXysRadians=function(e,t,n){let i=xj(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])||(Tj(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(Tj(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new n_(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,b=this._coef,f=this._xTable,y,_;for(y=0;y<=r;++y)m[y]=u-f[y];for(y=0;y<=r;++y){for(b[y]=1,_=0;_<=r;++_)_!==y&&(b[y]*=m[_]);b[y]*=p[y];let S=(s+y)*3;n.x+=b[y]*d[S++],n.y+=b[y]*d[S++],n.s+=b[y]*d[S]}return n};pD.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let o=0;od;)jwe(c,bD),e.transpose(bD,fde),e.multiply(c,bD,c),e.multiply(fde,c,c),e.multiply(a,bD,a),++r>2&&(++s,r=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],o=t[6],r=t[1],s=t[4],a=t[7],c=t[2],d=t[5],u=t[8];return n*(s*u-d*a)+r*(d*o-i*u)+c*(i*a-s*o)}static inverse(t,n){let i=t[0],o=t[1],r=t[2],s=t[3],a=t[4],c=t[5],d=t[6],u=t[7],m=t[8],p=e.determinant(t);n[0]=a*m-u*c,n[1]=u*r-o*m,n[2]=o*c-a*r,n[3]=d*c-s*m,n[4]=i*m-d*r,n[5]=s*r-i*c,n[6]=s*u-d*a,n[7]=d*o-i*u,n[8]=i*a-s*o;let b=1/p;return e.multiplyByScalar(n,b,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,Hwe),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var te=it;var PLt=_(T(),1);function QL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(QL.prototype=Object.create(Error.prototype),QL.prototype.constructor=QL);QL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` -${this.stack.toString()}`),e};var le=QL;function nt(e,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g){this[0]=e??0,this[1]=o??0,this[2]=l??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=d??0,this[7]=y??0,this[8]=n??0,this[9]=s??0,this[10]=u??0,this[11]=h??0,this[12]=i??0,this[13]=a??0,this[14]=f??0,this[15]=g??0}nt.packedLength=16;nt.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=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};nt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(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[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};nt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*16;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;oi&&(o=d,i=u)}let r=1,s=0,a=Sj[o],c=Zj[o];if(Math.abs(e[So.getElementIndex(c,a)])>n){let d=e[So.getElementIndex(c,c)],u=e[So.getElementIndex(a,a)],m=e[So.getElementIndex(c,a)],p=(d-u)/2/m,b;p<0?b=-1/(-p+Math.sqrt(1+p*p)):b=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+b*b),s=b*r}return t=So.clone(So.IDENTITY,t),t[So.getElementIndex(a,a)]=t[So.getElementIndex(c,c)]=r,t[So.getElementIndex(c,a)]=s,t[So.getElementIndex(a,c)]=-s,t}var q=So;var FJt=x(T(),1);var Qwe=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),gr=class e{constructor(t,n,i,o,r,s,a,c,d,u,m,p,b,f,y,_){let S=Reflect.construct(Array,Qwe,new.target);return S[0]=t??0,S[1]=r??0,S[2]=d??0,S[3]=b??0,S[4]=n??0,S[5]=s??0,S[6]=u??0,S[7]=f??0,S[8]=i??0,S[9]=a??0,S[10]=m??0,S[11]=y??0,S[12]=o??0,S[13]=c??0,S[14]=p??0,S[15]=_??0,S}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,o=i*16;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r=w.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Fs.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!c(e))throw new L("numberOfVertices is required.");if(!c(t))throw new L("sourceArray is required.");if(!c(n))throw new L("byteOffset is required.");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;throw new L("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var Me=Object.freeze(Fs);var mZt=_(T(),1);var dN={STREAM_DRAW:oe.STREAM_DRAW,STATIC_DRAW:oe.STATIC_DRAW,DYNAMIC_DRAW:oe.DYNAMIC_DRAW,validate:function(e){return e===dN.STREAM_DRAW||e===dN.STATIC_DRAW||e===dN.DYNAMIC_DRAW}},Ne=Object.freeze(dN);function pu(e){if(e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context),!c(e.typedArray)&&!c(e.sizeInBytes))throw new L("Either options.sizeInBytes or options.typedArray is required.");if(c(e.typedArray)&&c(e.sizeInBytes))throw new L("Cannot pass in both options.sizeInBytes and options.typedArray.");if(c(e.typedArray)&&(C.typeOf.object("options.typedArray",e.typedArray),C.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Ne.validate(e.usage))throw new L("usage is invalid.");let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=c(i);s&&(o=i.byteLength),C.typeOf.number.greaterThan("sizeInBytes",o,0);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}pu.createVertexBuffer=function(e){return C.defined("options.context",e.context),new pu({context:e.context,bufferTarget:oe.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};pu.createIndexBuffer=function(e){if(C.defined("options.context",e.context),!Me.validate(e.indexDatatype))throw new L("Invalid indexDatatype.");if(e.indexDatatype===Me.UNSIGNED_INT&&!e.context.elementIndexUint)throw new L("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");let t=e.context,n=e.indexDatatype,i=Me.getSizeInBytes(n),o=new pu({context:t,bufferTarget:oe.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(pu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});pu.prototype._getBuffer=function(){return this._buffer};pu.prototype.copyFromArrayView=function(e,t){t=t??0,C.defined("arrayView",e),C.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};pu.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new L("A WebGL 2 context is required.");if(!c(e))throw new L("readBuffer must be defined.");if(!c(i)||i<=0)throw new L("sizeInBytes must be defined and be greater than zero.");if(!c(t)||t<0||t+i>e._sizeInBytes)throw new L("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!c(n)||n<0||n+i>this._sizeInBytes)throw new L("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&nn&&ts)throw new L("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>s)throw new L("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new L("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*r>this._sizeInBytes)throw new L("sourceOffset + length must be less than the buffers size.");let a=this._gl,l=oe.COPY_READ_BUFFER;a.bindBuffer(l,this._buffer),a.getBufferSubData(l,t,e,n,i),a.bindBuffer(l,null)};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),he(this)};var _t=pu;var DZt=_(T(),1);var NZt=_(T(),1);var WZt=_(T(),1);var ZZt=_(T(),1);var w0,Pr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Sl={};Object.defineProperties(Sl,{element:{get:function(){if(Sl.supportsFullscreen())return document[Pr.fullscreenElement]}},changeEventName:{get:function(){if(Sl.supportsFullscreen())return Pr.fullscreenchange}},errorEventName:{get:function(){if(Sl.supportsFullscreen())return Pr.fullscreenerror}},enabled:{get:function(){if(Sl.supportsFullscreen())return document[Pr.fullscreenEnabled]}},fullscreen:{get:function(){if(Sl.supportsFullscreen())return Sl.element!==null}}});Sl.supportsFullscreen=function(){if(c(w0))return w0;w0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Pr.requestFullscreen="requestFullscreen",Pr.exitFullscreen="exitFullscreen",Pr.fullscreenEnabled="fullscreenEnabled",Pr.fullscreenElement="fullscreenElement",Pr.fullscreenchange="fullscreenchange",Pr.fullscreenerror="fullscreenerror",w0=!0,w0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){ec._result=t.width>0&&t.height>0,e(ec._result)},t.onerror=function(){ec._result=!1,e(ec._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ec._promise};Object.defineProperties(ec,{initialized:{get:function(){return c(ec._result)}}});var DS=[];typeof ArrayBuffer<"u"&&(DS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&DS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&DS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&DS.push(BigInt64Array),typeof BigUint64Array<"u"&&DS.push(BigUint64Array));var bu={isChrome:c3,chromeVersion:z1e,isSafari:Wq,safariVersion:K1e,isWebkit:wq,webkitVersion:J1e,isInternetExplorer:Pq,internetExplorerVersion:Q1e,isEdge:yN,edgeVersion:j1e,isFirefox:gN,firefoxVersion:eVe,isWindows:q1e,isIPadOrIOS:$1e,hardwareConcurrency:tc.hardwareConcurrency??3,supportsPointerEvents:tVe,supportsImageRenderingPixelated:Aq,supportsWebP:ec,imageRenderingValue:nVe,typedArrayTypes:DS};bu.supportsBasis=function(e){return bu.supportsWebAssembly()&&e.context.supportsBasis};bu.supportsFullscreen=function(){return _r.supportsFullscreen()};bu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bu.supportsBigInt=function(){return typeof BigInt<"u"};bu.supportsWebWorkers=function(){return typeof Worker<"u"};bu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bu.supportsWebgl2=function(e){return C.defined("scene",e),e.context.webgl2};bu.supportsEsmWebWorkers=function(){return!gN()||parseInt(l3)>=114};var Ot=bu;function d3(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 ae(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}ae.fromCartesian4=function(e,t){return C.typeOf.object("cartesian",e),c(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new ae(e.x,e.y,e.z,e.w)};ae.fromBytes=function(e,t,n,i,o){return e=ae.byteToFloat(e??255),t=ae.byteToFloat(t??255),n=ae.byteToFloat(n??255),i=ae.byteToFloat(i??255),c(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new ae(e,t,n,i)};ae.fromAlpha=function(e,t,n){return C.typeOf.object("color",e),C.typeOf.number("alpha",t),c(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new ae(e.red,e.green,e.blue,t)};var u3,m3,Tp;Ot.supportsTypedArrays()&&(u3=new ArrayBuffer(4),m3=new Uint32Array(u3),Tp=new Uint8Array(u3));ae.fromRgba=function(e,t){return m3[0]=e,ae.fromBytes(Tp[0],Tp[1],Tp[2],Tp[3],t)};ae.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;let d=2*n-l;r=d3(d,l,e+1/3),s=d3(d,l,e),a=d3(d,l,e-1/3)}return c(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new ae(r,s,a,i)};ae.fromRandom=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.red;if(!c(n)){let s=e.minimumRed??0,a=e.maximumRed??1;C.typeOf.number.lessThanOrEquals("minimumRed",s,a),n=s+w.nextRandomNumber()*(a-s)}let i=e.green;if(!c(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;C.typeOf.number.lessThanOrEquals("minimumGreen",s,a),i=s+w.nextRandomNumber()*(a-s)}let o=e.blue;if(!c(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;C.typeOf.number.lessThanOrEquals("minimumBlue",s,a),o=s+w.nextRandomNumber()*(a-s)}let r=e.alpha;if(!c(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;C.typeOf.number.lessThanOrEquals("minimumAlpha",s,a),r=s+w.nextRandomNumber()*(a-s)}return c(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ae(n,i,o,r)};var iVe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,oVe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,rVe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,sVe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;ae.fromCssColorString=function(e,t){C.typeOf.string("color",e),c(t)||(t=new ae),e=e.trim();let n=ae[e.toUpperCase()];if(c(n))return ae.clone(n,t),t;let i=iVe.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(i[4]??"f",16)/15,t):(i=oVe.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(i[4]??"ff",16)/255,t):(i=rVe.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(i[4]??"1.0"),t):(i=sVe.exec(e),i!==null?ae.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};ae.packedLength=4;ae.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};ae.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new ae),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};ae.byteToFloat=function(e){return e/255};ae.floatToByte=function(e){return e===1?255:e*256|0};ae.clone=function(e,t){if(c(e))return c(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new ae(e.red,e.green,e.blue,e.alpha)};ae.equals=function(e,t){return e===t||c(e)&&c(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};ae.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]};ae.prototype.clone=function(e){return ae.clone(this,e)};ae.prototype.equals=function(e){return ae.equals(this,e)};ae.prototype.equalsEpsilon=function(e,t){return this===e||c(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};ae.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};ae.prototype.toCssColorString=function(){let e=ae.floatToByte(this.red),t=ae.floatToByte(this.green),n=ae.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};ae.prototype.toCssHexString=function(){let e=ae.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=ae.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=ae.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=ae.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};ae.prototype.toBytes=function(e){let t=ae.floatToByte(this.red),n=ae.floatToByte(this.green),i=ae.floatToByte(this.blue),o=ae.floatToByte(this.alpha);return c(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ae.prototype.toRgba=function(){return Tp[0]=ae.floatToByte(this.red),Tp[1]=ae.floatToByte(this.green),Tp[2]=ae.floatToByte(this.blue),Tp[3]=ae.floatToByte(this.alpha),m3[0]};ae.prototype.brighten=function(e,t){return C.typeOf.number("magnitude",e),C.typeOf.number.greaterThanOrEquals("magnitude",e,0),C.typeOf.object("result",t),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};ae.prototype.darken=function(e,t){return C.typeOf.number("magnitude",e),C.typeOf.number.greaterThanOrEquals("magnitude",e,0),C.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ae.prototype.withAlpha=function(e,t){return ae.fromAlpha(this,e,t)};ae.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ae.subtract=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ae.multiply=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ae.divide=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ae.mod=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ae.lerp=function(e,t,n,i){return C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i),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};ae.multiplyByScalar=function(e,t,n){return C.typeOf.object("color",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};ae.divideByScalar=function(e,t,n){return C.typeOf.object("color",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};ae.ALICEBLUE=Object.freeze(ae.fromCssColorString("#F0F8FF"));ae.ANTIQUEWHITE=Object.freeze(ae.fromCssColorString("#FAEBD7"));ae.AQUA=Object.freeze(ae.fromCssColorString("#00FFFF"));ae.AQUAMARINE=Object.freeze(ae.fromCssColorString("#7FFFD4"));ae.AZURE=Object.freeze(ae.fromCssColorString("#F0FFFF"));ae.BEIGE=Object.freeze(ae.fromCssColorString("#F5F5DC"));ae.BISQUE=Object.freeze(ae.fromCssColorString("#FFE4C4"));ae.BLACK=Object.freeze(ae.fromCssColorString("#000000"));ae.BLANCHEDALMOND=Object.freeze(ae.fromCssColorString("#FFEBCD"));ae.BLUE=Object.freeze(ae.fromCssColorString("#0000FF"));ae.BLUEVIOLET=Object.freeze(ae.fromCssColorString("#8A2BE2"));ae.BROWN=Object.freeze(ae.fromCssColorString("#A52A2A"));ae.BURLYWOOD=Object.freeze(ae.fromCssColorString("#DEB887"));ae.CADETBLUE=Object.freeze(ae.fromCssColorString("#5F9EA0"));ae.CHARTREUSE=Object.freeze(ae.fromCssColorString("#7FFF00"));ae.CHOCOLATE=Object.freeze(ae.fromCssColorString("#D2691E"));ae.CORAL=Object.freeze(ae.fromCssColorString("#FF7F50"));ae.CORNFLOWERBLUE=Object.freeze(ae.fromCssColorString("#6495ED"));ae.CORNSILK=Object.freeze(ae.fromCssColorString("#FFF8DC"));ae.CRIMSON=Object.freeze(ae.fromCssColorString("#DC143C"));ae.CYAN=Object.freeze(ae.fromCssColorString("#00FFFF"));ae.DARKBLUE=Object.freeze(ae.fromCssColorString("#00008B"));ae.DARKCYAN=Object.freeze(ae.fromCssColorString("#008B8B"));ae.DARKGOLDENROD=Object.freeze(ae.fromCssColorString("#B8860B"));ae.DARKGRAY=Object.freeze(ae.fromCssColorString("#A9A9A9"));ae.DARKGREEN=Object.freeze(ae.fromCssColorString("#006400"));ae.DARKGREY=ae.DARKGRAY;ae.DARKKHAKI=Object.freeze(ae.fromCssColorString("#BDB76B"));ae.DARKMAGENTA=Object.freeze(ae.fromCssColorString("#8B008B"));ae.DARKOLIVEGREEN=Object.freeze(ae.fromCssColorString("#556B2F"));ae.DARKORANGE=Object.freeze(ae.fromCssColorString("#FF8C00"));ae.DARKORCHID=Object.freeze(ae.fromCssColorString("#9932CC"));ae.DARKRED=Object.freeze(ae.fromCssColorString("#8B0000"));ae.DARKSALMON=Object.freeze(ae.fromCssColorString("#E9967A"));ae.DARKSEAGREEN=Object.freeze(ae.fromCssColorString("#8FBC8F"));ae.DARKSLATEBLUE=Object.freeze(ae.fromCssColorString("#483D8B"));ae.DARKSLATEGRAY=Object.freeze(ae.fromCssColorString("#2F4F4F"));ae.DARKSLATEGREY=ae.DARKSLATEGRAY;ae.DARKTURQUOISE=Object.freeze(ae.fromCssColorString("#00CED1"));ae.DARKVIOLET=Object.freeze(ae.fromCssColorString("#9400D3"));ae.DEEPPINK=Object.freeze(ae.fromCssColorString("#FF1493"));ae.DEEPSKYBLUE=Object.freeze(ae.fromCssColorString("#00BFFF"));ae.DIMGRAY=Object.freeze(ae.fromCssColorString("#696969"));ae.DIMGREY=ae.DIMGRAY;ae.DODGERBLUE=Object.freeze(ae.fromCssColorString("#1E90FF"));ae.FIREBRICK=Object.freeze(ae.fromCssColorString("#B22222"));ae.FLORALWHITE=Object.freeze(ae.fromCssColorString("#FFFAF0"));ae.FORESTGREEN=Object.freeze(ae.fromCssColorString("#228B22"));ae.FUCHSIA=Object.freeze(ae.fromCssColorString("#FF00FF"));ae.GAINSBORO=Object.freeze(ae.fromCssColorString("#DCDCDC"));ae.GHOSTWHITE=Object.freeze(ae.fromCssColorString("#F8F8FF"));ae.GOLD=Object.freeze(ae.fromCssColorString("#FFD700"));ae.GOLDENROD=Object.freeze(ae.fromCssColorString("#DAA520"));ae.GRAY=Object.freeze(ae.fromCssColorString("#808080"));ae.GREEN=Object.freeze(ae.fromCssColorString("#008000"));ae.GREENYELLOW=Object.freeze(ae.fromCssColorString("#ADFF2F"));ae.GREY=ae.GRAY;ae.HONEYDEW=Object.freeze(ae.fromCssColorString("#F0FFF0"));ae.HOTPINK=Object.freeze(ae.fromCssColorString("#FF69B4"));ae.INDIANRED=Object.freeze(ae.fromCssColorString("#CD5C5C"));ae.INDIGO=Object.freeze(ae.fromCssColorString("#4B0082"));ae.IVORY=Object.freeze(ae.fromCssColorString("#FFFFF0"));ae.KHAKI=Object.freeze(ae.fromCssColorString("#F0E68C"));ae.LAVENDER=Object.freeze(ae.fromCssColorString("#E6E6FA"));ae.LAVENDAR_BLUSH=Object.freeze(ae.fromCssColorString("#FFF0F5"));ae.LAWNGREEN=Object.freeze(ae.fromCssColorString("#7CFC00"));ae.LEMONCHIFFON=Object.freeze(ae.fromCssColorString("#FFFACD"));ae.LIGHTBLUE=Object.freeze(ae.fromCssColorString("#ADD8E6"));ae.LIGHTCORAL=Object.freeze(ae.fromCssColorString("#F08080"));ae.LIGHTCYAN=Object.freeze(ae.fromCssColorString("#E0FFFF"));ae.LIGHTGOLDENRODYELLOW=Object.freeze(ae.fromCssColorString("#FAFAD2"));ae.LIGHTGRAY=Object.freeze(ae.fromCssColorString("#D3D3D3"));ae.LIGHTGREEN=Object.freeze(ae.fromCssColorString("#90EE90"));ae.LIGHTGREY=ae.LIGHTGRAY;ae.LIGHTPINK=Object.freeze(ae.fromCssColorString("#FFB6C1"));ae.LIGHTSEAGREEN=Object.freeze(ae.fromCssColorString("#20B2AA"));ae.LIGHTSKYBLUE=Object.freeze(ae.fromCssColorString("#87CEFA"));ae.LIGHTSLATEGRAY=Object.freeze(ae.fromCssColorString("#778899"));ae.LIGHTSLATEGREY=ae.LIGHTSLATEGRAY;ae.LIGHTSTEELBLUE=Object.freeze(ae.fromCssColorString("#B0C4DE"));ae.LIGHTYELLOW=Object.freeze(ae.fromCssColorString("#FFFFE0"));ae.LIME=Object.freeze(ae.fromCssColorString("#00FF00"));ae.LIMEGREEN=Object.freeze(ae.fromCssColorString("#32CD32"));ae.LINEN=Object.freeze(ae.fromCssColorString("#FAF0E6"));ae.MAGENTA=Object.freeze(ae.fromCssColorString("#FF00FF"));ae.MAROON=Object.freeze(ae.fromCssColorString("#800000"));ae.MEDIUMAQUAMARINE=Object.freeze(ae.fromCssColorString("#66CDAA"));ae.MEDIUMBLUE=Object.freeze(ae.fromCssColorString("#0000CD"));ae.MEDIUMORCHID=Object.freeze(ae.fromCssColorString("#BA55D3"));ae.MEDIUMPURPLE=Object.freeze(ae.fromCssColorString("#9370DB"));ae.MEDIUMSEAGREEN=Object.freeze(ae.fromCssColorString("#3CB371"));ae.MEDIUMSLATEBLUE=Object.freeze(ae.fromCssColorString("#7B68EE"));ae.MEDIUMSPRINGGREEN=Object.freeze(ae.fromCssColorString("#00FA9A"));ae.MEDIUMTURQUOISE=Object.freeze(ae.fromCssColorString("#48D1CC"));ae.MEDIUMVIOLETRED=Object.freeze(ae.fromCssColorString("#C71585"));ae.MIDNIGHTBLUE=Object.freeze(ae.fromCssColorString("#191970"));ae.MINTCREAM=Object.freeze(ae.fromCssColorString("#F5FFFA"));ae.MISTYROSE=Object.freeze(ae.fromCssColorString("#FFE4E1"));ae.MOCCASIN=Object.freeze(ae.fromCssColorString("#FFE4B5"));ae.NAVAJOWHITE=Object.freeze(ae.fromCssColorString("#FFDEAD"));ae.NAVY=Object.freeze(ae.fromCssColorString("#000080"));ae.OLDLACE=Object.freeze(ae.fromCssColorString("#FDF5E6"));ae.OLIVE=Object.freeze(ae.fromCssColorString("#808000"));ae.OLIVEDRAB=Object.freeze(ae.fromCssColorString("#6B8E23"));ae.ORANGE=Object.freeze(ae.fromCssColorString("#FFA500"));ae.ORANGERED=Object.freeze(ae.fromCssColorString("#FF4500"));ae.ORCHID=Object.freeze(ae.fromCssColorString("#DA70D6"));ae.PALEGOLDENROD=Object.freeze(ae.fromCssColorString("#EEE8AA"));ae.PALEGREEN=Object.freeze(ae.fromCssColorString("#98FB98"));ae.PALETURQUOISE=Object.freeze(ae.fromCssColorString("#AFEEEE"));ae.PALEVIOLETRED=Object.freeze(ae.fromCssColorString("#DB7093"));ae.PAPAYAWHIP=Object.freeze(ae.fromCssColorString("#FFEFD5"));ae.PEACHPUFF=Object.freeze(ae.fromCssColorString("#FFDAB9"));ae.PERU=Object.freeze(ae.fromCssColorString("#CD853F"));ae.PINK=Object.freeze(ae.fromCssColorString("#FFC0CB"));ae.PLUM=Object.freeze(ae.fromCssColorString("#DDA0DD"));ae.POWDERBLUE=Object.freeze(ae.fromCssColorString("#B0E0E6"));ae.PURPLE=Object.freeze(ae.fromCssColorString("#800080"));ae.RED=Object.freeze(ae.fromCssColorString("#FF0000"));ae.ROSYBROWN=Object.freeze(ae.fromCssColorString("#BC8F8F"));ae.ROYALBLUE=Object.freeze(ae.fromCssColorString("#4169E1"));ae.SADDLEBROWN=Object.freeze(ae.fromCssColorString("#8B4513"));ae.SALMON=Object.freeze(ae.fromCssColorString("#FA8072"));ae.SANDYBROWN=Object.freeze(ae.fromCssColorString("#F4A460"));ae.SEAGREEN=Object.freeze(ae.fromCssColorString("#2E8B57"));ae.SEASHELL=Object.freeze(ae.fromCssColorString("#FFF5EE"));ae.SIENNA=Object.freeze(ae.fromCssColorString("#A0522D"));ae.SILVER=Object.freeze(ae.fromCssColorString("#C0C0C0"));ae.SKYBLUE=Object.freeze(ae.fromCssColorString("#87CEEB"));ae.SLATEBLUE=Object.freeze(ae.fromCssColorString("#6A5ACD"));ae.SLATEGRAY=Object.freeze(ae.fromCssColorString("#708090"));ae.SLATEGREY=ae.SLATEGRAY;ae.SNOW=Object.freeze(ae.fromCssColorString("#FFFAFA"));ae.SPRINGGREEN=Object.freeze(ae.fromCssColorString("#00FF7F"));ae.STEELBLUE=Object.freeze(ae.fromCssColorString("#4682B4"));ae.TAN=Object.freeze(ae.fromCssColorString("#D2B48C"));ae.TEAL=Object.freeze(ae.fromCssColorString("#008080"));ae.THISTLE=Object.freeze(ae.fromCssColorString("#D8BFD8"));ae.TOMATO=Object.freeze(ae.fromCssColorString("#FF6347"));ae.TURQUOISE=Object.freeze(ae.fromCssColorString("#40E0D0"));ae.VIOLET=Object.freeze(ae.fromCssColorString("#EE82EE"));ae.WHEAT=Object.freeze(ae.fromCssColorString("#F5DEB3"));ae.WHITE=Object.freeze(ae.fromCssColorString("#FFFFFF"));ae.WHITESMOKE=Object.freeze(ae.fromCssColorString("#F5F5F5"));ae.YELLOW=Object.freeze(ae.fromCssColorString("#FFFF00"));ae.YELLOWGREEN=Object.freeze(ae.fromCssColorString("#9ACD32"));ae.TRANSPARENT=Object.freeze(new ae(0,0,0,0));var Y=ae;function xN(e){e=e??z.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}xN.ALL=Object.freeze(new xN({color:new Y(0,0,0,0),depth:1,stencil:0}));xN.prototype.execute=function(e,t){e.clear(this,t)};var ti=xN;var JZt=_(T(),1);var YZt=_(T(),1),aVe={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},Xe=Object.freeze(aVe);function Mq(e){e=e??z.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=e.persists??!1,this.pass=Xe.COMPUTE,this.owner=e.owner}Mq.prototype.execute=function(e){e.execute(this)};var vc=Mq;var Awt=_(T(),1);var DIt=_(T(),1);var tRt=_(T(),1);function Mt(e,t){this.x=e??0,this.y=t??0}Mt.fromElements=function(e,t,n){return c(n)?(n.x=e,n.y=t,n):new Mt(e,t)};Mt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t):new Mt(e.x,e.y)};Mt.fromCartesian3=Mt.clone;Mt.fromCartesian4=Mt.clone;Mt.packedLength=2;Mt.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n]=e.y,t};Mt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new Mt),n.x=e[t++],n.y=e[t],n};Mt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*2;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;ow.EPSILON12);return c(o)?(o.x=r*F,o.y=s*N,o.z=a*b,o):new m(r*F,s*N,a*b)}var ix=uVe;function Mo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}Mo.fromRadians=function(e,t,n,i){return C.typeOf.number("longitude",e),C.typeOf.number("latitude",t),n=n??0,c(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Mo(e,t,n)};Mo.fromDegrees=function(e,t,n,i){return C.typeOf.number("longitude",e),C.typeOf.number("latitude",t),e=w.toRadians(e),t=w.toRadians(t),Mo.fromRadians(e,t,n,i)};var mVe=new m,fVe=new m,hVe=new m;Mo._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);Mo._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Mo._ellipsoidCenterToleranceSquared=w.EPSILON1;Mo.fromCartesian=function(e,t,n){let i=c(t)?t.oneOverRadii:Mo._ellipsoidOneOverRadii,o=c(t)?t.oneOverRadiiSquared:Mo._ellipsoidOneOverRadiiSquared,r=c(t)?t._centerToleranceSquared:Mo._ellipsoidCenterToleranceSquared,s=ix(e,i,o,r,fVe);if(!c(s))return;let a=m.multiplyComponents(s,o,mVe);a=m.normalize(a,a);let l=m.subtract(e,s,hVe),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),f=w.sign(m.dot(l,e))*m.magnitude(l);return c(n)?(n.longitude=d,n.latitude=u,n.height=f,n):new Mo(d,u,f)};Mo.toCartesian=function(e,t,n){return C.defined("cartographic",e),m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Mo.clone=function(e,t){if(c(e))return c(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Mo(e.longitude,e.latitude,e.height)};Mo.equals=function(e,t){return e===t||c(e)&&c(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Mo.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Mo.ZERO=Object.freeze(new Mo(0,0,0));Mo.prototype.clone=function(e){return Mo.clone(this,e)};Mo.prototype.equals=function(e){return Mo.equals(this,e)};Mo.prototype.equalsEpsilon=function(e,t){return Mo.equalsEpsilon(this,e,t)};Mo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var pe=Mo;var VRt=_(T(),1);function Dq(e,t,n,i){t=t??0,n=n??0,i=i??0,C.typeOf.number.greaterThanOrEquals("x",t,0),C.typeOf.number.greaterThanOrEquals("y",n,0),C.typeOf.number.greaterThanOrEquals("z",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 yi(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,Dq(this,e,t,n)}Object.defineProperties(yi.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}}});yi.clone=function(e,t){if(!c(e))return;let n=e._radii;return c(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 yi(n.x,n.y,n.z)};yi.fromCartesian3=function(e,t){return c(t)||(t=new yi),c(e)&&Dq(t,e.x,e.y,e.z),t};yi.WGS84=Object.freeze(new yi(6378137,6378137,6356752314245179e-9));yi.UNIT_SPHERE=Object.freeze(new yi(1,1,1));yi.MOON=Object.freeze(new yi(w.LUNAR_RADIUS,w.LUNAR_RADIUS,w.LUNAR_RADIUS));yi._default=yi.WGS84;Object.defineProperties(yi,{default:{get:function(){return yi._default},set:function(e){C.typeOf.object("value",e),yi._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,pe._ellipsoidOneOverRadii=e.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});yi.prototype.clone=function(e){return yi.clone(this,e)};yi.packedLength=m.packedLength;yi.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,m.pack(e._radii,t,n),t};yi.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t);return yi.fromCartesian3(i,n)};yi.prototype.geocentricSurfaceNormal=m.normalize;yi.prototype.geodeticSurfaceNormalCartographic=function(e,t){C.typeOf.object("cartographic",e);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 c(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};yi.prototype.geodeticSurfaceNormal=function(e,t){if(C.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new L("cartesian has a NaN component");if(!m.equalsEpsilon(e,m.ZERO,w.EPSILON14))return c(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var pVe=new m,bVe=new m;yi.prototype.cartographicToCartesian=function(e,t){let n=pVe,i=bVe;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),c(t)||(t=new m),m.add(i,n,t)};yi.prototype.cartographicArrayToCartesianArray=function(e,t){C.defined("cartographics",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i=this._radii.z-t))return n};var _Ve=new m;yi.prototype.getLocalCurvature=function(e,t){C.typeOf.object("surfacePosition",e),c(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,_Ve),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 TVe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],SVe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Oq(e,t,n){C.typeOf.number("a",e),C.typeOf.number("b",t),C.typeOf.func("func",n);let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*TVe[s];r+=SVe[s]*(n(i+a)+n(i-a))}return r*=o,r}yi.prototype.surfaceArea=function(e){C.typeOf.object("rectangle",e);let t=e.west,n=e.east,i=e.south,o=e.north;for(;n0){o=r-1;continue}return r}return~(o+1)}var Wo=VVe;var MRt=_(T(),1);function LVe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var P0=LVe;var cGt=_(T(),1);var HRt=_(T(),1);var URt=_(T(),1);function ZVe(e){if(e===null||isNaN(e))throw new L("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var Lm=ZVe;var Bq=[31,28,31,30,31,30,31,31,30,31,30,31];function RVe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,g(),x(),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 g(){C.typeOf.number.greaterThanOrEquals("Year",e,1),C.typeOf.number.lessThanOrEquals("Year",e,9999),C.typeOf.number.greaterThanOrEquals("Month",t,1),C.typeOf.number.lessThanOrEquals("Month",t,12),C.typeOf.number.greaterThanOrEquals("Day",n,1),C.typeOf.number.lessThanOrEquals("Day",n,31),C.typeOf.number.greaterThanOrEquals("Hour",i,0),C.typeOf.number.lessThanOrEquals("Hour",i,23),C.typeOf.number.greaterThanOrEquals("Minute",o,0),C.typeOf.number.lessThanOrEquals("Minute",o,59),C.typeOf.bool("IsLeapSecond",a),C.typeOf.number.greaterThanOrEquals("Second",r,0),C.typeOf.number.lessThanOrEquals("Second",r,a?60:59),C.typeOf.number.greaterThanOrEquals("Millisecond",s,0),C.typeOf.number.lessThan("Millisecond",s,1e3)}function x(){let S=t===2&&Lm(e)?Bq[t-1]+1:Bq[t-1];if(n>S)throw new L("Month and Day represents invalid date")}}var eh=RVe;var KRt=_(T(),1);function GVe(e,t){this.julianDate=e,this.offset=t}var Hi=GVe;var QRt=_(T(),1),EVe={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(EVe);var qRt=_(T(),1),XVe={UTC:0,TAI:1},zn=Object.freeze(XVe);var Hq=new eh,SN=[31,28,31,30,31,30,31,31,30,31,30,31],CN=29;function f3(e,t){return Wt.compare(e.julianDate,t.julianDate)}var BS=new Hi;function LN(e){BS.julianDate=e;let t=Wt.leapSeconds,n=Wo(t,BS,f3);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 Yq(e,t){BS.julianDate=e;let n=Wt.leapSeconds,i=Wo(n,BS,f3);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 v0(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 h3(e,t,n,i,o,r,s){let a=(t-14)/12|0,l=e+4800+a,d=(1461*l/4|0)+(367*(t-2-12*a)/12|0)-(3*((l+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 IVe=/^(\d{4})$/,WVe=/^(\d{4})-(\d{2})$/,wVe=/^(\d{4})-?(\d{3})$/,PVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,vVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,p3=/([Z+\-])?(\d{2})?:?(\d{2})?$/,FVe=/^(\d{2})(\.\d+)?/.source+p3.source,AVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+p3.source,MVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+p3.source,Zm="Invalid ISO 8601 date.";function Wt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??zn.UTC;let i=e|0;t=t+(e-i)*Kn.SECONDS_PER_DAY,v0(i,t,this),n===zn.UTC&&LN(this)}Wt.fromGregorianDate=function(e,t){if(!(e instanceof eh))throw new L("date must be a valid GregorianDate.");let n=h3(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return c(t)?(v0(n[0],n[1],t),LN(t),t):new Wt(n[0],n[1],zn.UTC)};Wt.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new L("date must be a valid JavaScript Date.");let n=h3(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return c(t)?(v0(n[0],n[1],t),LN(t),t):new Wt(n[0],n[1],zn.UTC)};Wt.fromIso8601=function(e,t){if(typeof e!="string")throw new L(Zm);e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,l=0,d=0,u=n[0],f=n[1],p,y;if(!c(u))throw new L(Zm);let h;if(n=u.match(vVe),n!==null){if(h=u.split("-").length-1,h>0&&h!==2)throw new L(Zm);i=+n[1],o=+n[2],r=+n[3]}else if(n=u.match(WVe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(IVe),n!==null)i=+n[1];else{let V;if(n=u.match(wVe),n!==null){if(i=+n[1],V=+n[2],y=Lm(i),V<1||y&&V>366||!y&&V>365)throw new L(Zm)}else if(n=u.match(PVe),n!==null){i=+n[1];let Z=+n[2],R=+n[3]||0;if(h=u.split("-").length-1,h>0&&(!c(n[3])&&h!==1||c(n[3])&&h!==2))throw new L(Zm);let E=new Date(Date.UTC(i,0,4));V=Z*7+R-E.getUTCDay()-3}else throw new L(Zm);p=new Date(Date.UTC(i,0,1)),p.setUTCDate(V),o=p.getUTCMonth()+1,r=p.getUTCDate()}if(y=Lm(i),o<1||o>12||r<1||(o!==2||!y)&&r>SN[o-1]||y&&o===2&&r>CN)throw new L(Zm);let g;if(c(f)){if(n=f.match(MVe),n!==null){if(h=f.split(":").length-1,h>0&&h!==2&&h!==3)throw new L(Zm);s=+n[1],a=+n[2],l=+n[3],d=+(n[4]||0)*1e3,g=5}else if(n=f.match(AVe),n!==null){if(h=f.split(":").length-1,h>2)throw new L(Zm);s=+n[1],a=+n[2],l=+(n[3]||0)*60,g=4}else if(n=f.match(FVe),n!==null)s=+n[1],a=+(n[2]||0)*60,g=3;else throw new L(Zm);if(a>=60||l>=61||s>24||s===24&&(a>0||l>0||d>0))throw new L(Zm);let V=n[g],Z=+n[g+1],R=+(n[g+2]||0);switch(V){case"+":s=s-Z,a=a-R;break;case"-":s=s+Z,a=a+R;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=l===60;for(x&&l--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=y&&o===2?CN:SN[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=y&&o===2?CN:SN[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=y&&o===2?CN:SN[o-1],r+=p;let S=h3(i,o,r,s,a,l,d);return c(t)?(v0(S[0],S[1],t),LN(t)):t=new Wt(S[0],S[1],zn.UTC),x&&Wt.addSeconds(t,1,t),t};Wt.now=function(e){return Wt.fromDate(new Date,e)};var VN=new Wt(0,0,zn.TAI);Wt.toGregorianDate=function(e,t){if(!c(e))throw new L("julianDate is required.");let n=!1,i=Yq(e,VN);c(i)||(Wt.addSeconds(e,-1,VN),i=Yq(VN,VN),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 l=4e3*(s+1)/1461001|0;s=s-(1461*l/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let f=d+2-12*s|0,p=100*(a-49)+l+s|0,y=r/Kn.SECONDS_PER_HOUR|0,h=r-y*Kn.SECONDS_PER_HOUR,g=h/Kn.SECONDS_PER_MINUTE|0;h=h-g*Kn.SECONDS_PER_MINUTE;let x=h|0,S=(h-x)/Kn.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(x+=1),c(t)?(t.year=p,t.month=f,t.day=u,t.hour=y,t.minute=g,t.second=x,t.millisecond=S,t.isLeapSecond=n,t):new eh(p,f,u,y,g,x,S,n)};Wt.toDate=function(e){if(!c(e))throw new L("julianDate is required.");let t=Wt.toGregorianDate(e,Hq),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){if(!c(e))throw new L("julianDate is required.");let n=Wt.toGregorianDate(e,Hq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,l=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&l===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;if(!c(t)&&d!==0){let f=d*.01;return u=f<1e-6?f.toFixed(20).replace(".","").replace(/0+$/,""):f.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")}:${l.toString().padStart(2,"0")}.${u}Z`}return!c(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")}:${l.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")}:${l.toString().padStart(2,"0")}.${u}Z`)};Wt.clone=function(e,t){if(c(e))return c(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Wt(e.dayNumber,e.secondsOfDay,zn.TAI)};Wt.compare=function(e,t){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Wt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Wt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(Wt.secondsDifference(e,t))<=n};Wt.totalDays=function(e){if(!c(e))throw new L("julianDate is required.");return e.dayNumber+e.secondsOfDay/Kn.SECONDS_PER_DAY};Wt.secondsDifference=function(e,t){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");return(e.dayNumber-t.dayNumber)*Kn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Wt.daysDifference=function(e,t){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Kn.SECONDS_PER_DAY;return n+i};Wt.computeTaiMinusUtc=function(e){BS.julianDate=e;let t=Wt.leapSeconds,n=Wo(t,BS,f3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Wt.addSeconds=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("seconds is required.");if(!c(n))throw new L("result is required.");return v0(e.dayNumber,e.secondsOfDay+t,n)};Wt.addMinutes=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("minutes is required.");if(!c(n))throw new L("result is required.");let i=e.secondsOfDay+t*Kn.SECONDS_PER_MINUTE;return v0(e.dayNumber,i,n)};Wt.addHours=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("hours is required.");if(!c(n))throw new L("result is required.");let i=e.secondsOfDay+t*Kn.SECONDS_PER_HOUR;return v0(e.dayNumber,i,n)};Wt.addDays=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("days is required.");if(!c(n))throw new L("result is required.");let i=e.dayNumber+t;return v0(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 Hi(new Wt(2441317,43210,zn.TAI),10),new Hi(new Wt(2441499,43211,zn.TAI),11),new Hi(new Wt(2441683,43212,zn.TAI),12),new Hi(new Wt(2442048,43213,zn.TAI),13),new Hi(new Wt(2442413,43214,zn.TAI),14),new Hi(new Wt(2442778,43215,zn.TAI),15),new Hi(new Wt(2443144,43216,zn.TAI),16),new Hi(new Wt(2443509,43217,zn.TAI),17),new Hi(new Wt(2443874,43218,zn.TAI),18),new Hi(new Wt(2444239,43219,zn.TAI),19),new Hi(new Wt(2444786,43220,zn.TAI),20),new Hi(new Wt(2445151,43221,zn.TAI),21),new Hi(new Wt(2445516,43222,zn.TAI),22),new Hi(new Wt(2446247,43223,zn.TAI),23),new Hi(new Wt(2447161,43224,zn.TAI),24),new Hi(new Wt(2447892,43225,zn.TAI),25),new Hi(new Wt(2448257,43226,zn.TAI),26),new Hi(new Wt(2448804,43227,zn.TAI),27),new Hi(new Wt(2449169,43228,zn.TAI),28),new Hi(new Wt(2449534,43229,zn.TAI),29),new Hi(new Wt(2450083,43230,zn.TAI),30),new Hi(new Wt(2450630,43231,zn.TAI),31),new Hi(new Wt(2451179,43232,zn.TAI),32),new Hi(new Wt(2453736,43233,zn.TAI),33),new Hi(new Wt(2454832,43234,zn.TAI),34),new Hi(new Wt(2456109,43235,zn.TAI),35),new Hi(new Wt(2457204,43236,zn.TAI),36),new Hi(new Wt(2457754,43237,zn.TAI),37)];var ee=Wt;var mXt=_(T(),1),u$=_(cd(),1);var hGt=_(T(),1);function NVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var $L=NVe;var bGt=_(T(),1);function $q(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=$q(o,t)),n[i]=o}return n}var He=$q;var xGt=_(T(),1);function e$(e,t,n){n=n??!1;let i={},o=c(e),r=c(t),s,a,l;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(l=t[s],typeof l=="object"?i[s]=e$(a,l,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(l=t[s],i[s]=l);return i}var St=e$;var TGt=_(T(),1);function kVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Cl=kVe;var LGt=_(T(),1),t$=_(cd(),1);function b3(e,t){let n;return typeof document<"u"&&(n=document),b3._implementation(e,t,n)}b3._implementation=function(e,t,n){if(!c(e))throw new L("relative uri is required.");if(!c(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new t$.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var th=b3;var EGt=_(T(),1),n$=_(cd(),1);function UVe(e,t){if(!c(e))throw new L("uri is required.");let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new n$.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var eZ=UVe;var wGt=_(T(),1),i$=_(cd(),1);function OVe(e){if(!c(e))throw new L("uri is required.");let t=new i$.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 ox=OVe;var FGt=_(T(),1);var o$={};function DVe(e,t,n){c(t)||(t=e.width),c(n)||(n=e.height);let i=o$[t];c(i)||(i={},o$[t]=i);let o=i[n];if(!c(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=DVe;var NGt=_(T(),1);var BVe=/^blob:/i;function YVe(e){return C.typeOf.string("uri",e),BVe.test(e)}var rx=YVe;var OGt=_(T(),1);var nh;function HVe(e){c(nh)||(nh=document.createElement("a")),nh.href=window.location.href;let t=nh.host,n=nh.protocol;return nh.href=e,nh.href=nh.href,n!==nh.protocol||t!==nh.host}var F0=HVe;var YGt=_(T(),1);var zVe=/^data:/i;function KVe(e){return C.typeOf.string("uri",e),zVe.test(e)}var Sp=KVe;var zGt=_(T(),1);function JVe(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 sx=JVe;var jGt=_(T(),1);function QVe(e){if(!c(e))throw new L("obj is required.");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;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var tZ=eLe;function r$(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=tZ(this.responseHeaders))}r$.prototype.toString=function(){let e="Request has failed.";return c(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var ih=r$;var vEt=_(T(),1),XN=_(cd(),1);var TEt=_(T(),1);function nZ(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(nZ.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});nZ.prototype.addEventListener=function(e,t){C.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};nZ.prototype.removeEventListener=function(e,t){C.typeOf.func("listener",e);let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r0){for(o.sort(tLe),e=0;e=0;--t)this.heapify(t)};cx.prototype.insert=function(e){C.defined("element",e);let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};cx.prototype.pop=function(e){if(e=e??0,this._length===0)return;C.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return y3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var iZ=cx;function nLe(e,t){return e.priority-t.priority}var eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},zS=20,nc=new iZ({comparator:nLe});nc.maximumLength=zS;nc.reserve(zS);var oh=[],Cp={},iLe=typeof document<"u"?new XN.default(document.location.href):new XN.default,IN=new ye;function Qo(){}Qo.maximumRequests=50;Qo.maximumRequestsPerServer=18;Qo.requestsByServer={};Qo.throttleRequests=!0;Qo.debugShowStatistics=!1;Qo.requestCompletedEvent=IN;Object.defineProperties(Qo,{statistics:{get:function(){return eo}},priorityHeapLength:{get:function(){return zS},set:function(e){if(ee;){let t=nc.pop();lx(t)}zS=e,nc.maximumLength=e,nc.reserve(e)}}});function s$(e){c(e.priorityFunction)&&(e.priority=e.priorityFunction())}Qo.serverHasOpenSlots=function(e,t){t=t??1;let n=Qo.requestsByServer[e]??Qo.maximumRequestsPerServer;return Cp[e]+t<=n};Qo.heapHasOpenSlots=function(e){return nc.length+e<=zS};function a$(e){return e.state===jn.UNISSUED&&(e.state=jn.ISSUED,e.deferred=Cl()),e.deferred.promise}function oLe(e){return function(t){if(e.state===jn.CANCELLED)return;let n=e.deferred;--eo.numberOfActiveRequests,--Cp[e.serverKey],IN.raiseEvent(),e.state=jn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function rLe(e){return function(t){e.state!==jn.CANCELLED&&(++eo.numberOfFailedRequests,--eo.numberOfActiveRequests,--Cp[e.serverKey],IN.raiseEvent(t),e.state=jn.FAILED,e.deferred.reject(t))}}function c$(e){let t=a$(e);return e.state=jn.ACTIVE,oh.push(e),++eo.numberOfActiveRequests,++eo.numberOfActiveRequestsEver,++Cp[e.serverKey],e.requestFunction().then(oLe(e)).catch(rLe(e)),t}function lx(e){let t=e.state===jn.ACTIVE;if(e.state=jn.CANCELLED,++eo.numberOfCancelledRequests,c(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--eo.numberOfActiveRequests,--Cp[e.serverKey],++eo.numberOfCancelledActiveRequests),c(e.cancelFunction)&&e.cancelFunction()}Qo.update=function(){let e,t,n=0,i=oh.length;for(e=0;e0&&(oh[e-n]=t)}oh.length-=n;let o=nc.internalArray,r=nc.length;for(e=0;e0;){if(t=nc.pop(),t.cancelled){lx(t);continue}if(t.throttleByServer&&!Qo.serverHasOpenSlots(t.serverKey)){lx(t);continue}c$(t),++a}sLe()};Qo.getServerKey=function(e){C.typeOf.string("url",e);let t=new XN.default(e);t.scheme()===""&&(t=t.absoluteTo(iLe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Cp[n];return c(i)||(Cp[n]=0),n};Qo.request=function(e){if(C.typeOf.object("request",e),C.typeOf.string("request.url",e.url),C.typeOf.func("request.requestFunction",e.requestFunction),Sp(e.url)||rx(e.url))return IN.raiseEvent(),e.state=jn.RECEIVED,e.requestFunction();if(++eo.numberOfAttemptedRequests,c(e.serverKey)||(e.serverKey=Qo.getServerKey(e.url)),Qo.throttleRequests&&e.throttleByServer&&!Qo.serverHasOpenSlots(e.serverKey))return;if(!Qo.throttleRequests||!e.throttle)return c$(e);if(oh.length>=Qo.maximumRequests)return;s$(e);let t=nc.insert(e);if(c(t)){if(t===e)return;lx(t)}return a$(e)};function sLe(){Qo.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)}Qo.clearForSpecs=function(){for(;nc.length>0;){let t=nc.pop();lx(t)}let e=oh.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});Et.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Et.prototype.parseUrl=function(e,t,n,i){let o=new u$.default(e),r=cLe(o.query());this._queryParameters=t?wN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),c(i)&&o.scheme()===""&&(o=o.absoluteTo(th(i))),this._url=o.toString()};function cLe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ld(e)}function wN(e,t,n){if(!n)return St(e,t);let i=He(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];c(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Et.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${lLe(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 c(s)?encodeURIComponent(s):o})),t&&c(this.proxy)&&(n=this.proxy.getURL(n)),n};function lLe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!c(e[t[0]])?`?${t[0]}`:`?${ax(e)}`}Et.prototype.setQueryParameters=function(e,t){t?this._queryParameters=wN(this._queryParameters,e,!1):this._queryParameters=wN(e,this._queryParameters,!1)};Et.prototype.appendQueryParameters=function(e){this._queryParameters=wN(e,this._queryParameters,!0)};Et.prototype.setTemplateValues=function(e,t){t?this._templateValues=St(this._templateValues,e):this._templateValues=St(e,this._templateValues)};Et.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,c(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return c(e.queryParameters)&&(t._queryParameters=St(e.queryParameters,t.queryParameters)),c(e.templateValues)&&(t._templateValues=St(e.templateValues,t.templateValues)),c(e.headers)&&(t.headers=St(e.headers,t.headers)),c(e.proxy)&&(t.proxy=e.proxy),c(e.request)&&(t.request=e.request),c(e.retryCallback)&&(t.retryCallback=e.retryCallback),c(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Et.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})};Et.prototype.clone=function(e){return c(e)?(e._url=this._url,e._queryParameters=He(this._queryParameters),e._templateValues=He(this._templateValues),e.headers=He(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Et({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:c(this.credits)?this.credits.slice():void 0})};Et.prototype.getBaseUri=function(e){return eZ(this.getUrlComponent(e),e)};Et.prototype.appendForwardSlash=function(){this._url=$L(this._url)};Et.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Et.fetchArrayBuffer=function(e){return new Et(e).fetchArrayBuffer()};Et.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Et.fetchBlob=function(e){return new Et(e).fetchBlob()};Et.prototype.fetchImage=function(e){e=e??z.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(x3(this.request),!m$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return g3({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!c(r))return;let s,a,l,d;return Et.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!c(u))return;if(d=u,a)return Et.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let f=window.URL.createObjectURL(u);return l=new Et({url:f}),g3({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(c(u))return u.blob=d,a||window.URL.revokeObjectURL(l.url),u}).catch(function(u){return c(l)&&window.URL.revokeObjectURL(l.url),u.blob=d,Promise.reject(u)})};function g3(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 l=Cl();return Et._Implementations.createImage(r,a,l,n,i,o),l.promise};let s=ic.request(r);if(c(s))return s.catch(function(a){return r.state!==jn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(l){return l?(r.state=jn.UNISSUED,r.deferred=void 0,g3({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Et.fetchImage=function(e){return new Et(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Et.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Et.fetchText=function(e){return new Et(e).fetchText()};Et.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(c(e))return e.then(function(t){if(c(t))return JSON.parse(t)})};Et.fetchJson=function(e){return new Et(e).fetchJson()};Et.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Et.fetchXML=function(e){return new Et(e).fetchXML()};Et.prototype.fetchJsonp=function(e){e=e??"callback",x3(this.request);let t;do t=`loadJsonp${w.nextRandomNumber().toString().substring(2,8)}`;while(c(window[t]));return f$(this,e,t)};function f$(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=Cl();return window[n]=function(l){a.resolve(l);try{delete window[n]}catch{window[n]=void 0}},Et._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=ic.request(o);if(c(s))return s.catch(function(a){return o.state!==jn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(l){return l?(o.state=jn.UNISSUED,o.deferred=void 0,f$(e,t,n)):Promise.reject(a)})})}Et.fetchJsonp=function(e){return new Et(e).fetchJsonp(e.callbackParameterName)};Et.prototype._makeRequest=function(e){let t=this;x3(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,l=e.method,d=e.data,u=Cl(),f=Et._Implementations.loadWithXhr(i,r,l,d,s,u,a);return c(f)&&c(f.abort)&&(n.cancelFunction=function(){f.abort()}),u.promise};let o=ic.request(n);if(c(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 x3(e){if(e.state===jn.ISSUED||e.state===jn.ACTIVE)throw new le("The Resource is already being fetched.");e.state=jn.UNISSUED,e.deferred=void 0}var dLe=/^data:(.*?)(;base64)?,(.*)$/;function WN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function d$(e,t){let n=WN(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let l={};a.headers.forEach((d,u)=>{l[u]=d}),r.reject(new ih(a.status,a,l));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 ih)})}var fLe=typeof XMLHttpRequest>"u";Et._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=dLe.exec(e);if(a!==null){r.resolve(uLe(a,t));return}if(fLe){mLe(e,t,n,i,o,r,s);return}let l=new XMLHttpRequest;if(JS.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),c(s)&&c(l.overrideMimeType)&&l.overrideMimeType(s),c(o))for(let u in o)o.hasOwnProperty(u)&&l.setRequestHeader(u,o[u]);c(t)&&(l.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(d&&l.status===0)){r.reject(new ih(l.status,l.response,l.getAllResponseHeaders()));return}let u=l.response,f=l.responseType;if(n==="HEAD"||n==="OPTIONS"){let y=l.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};y.forEach(function(g){let x=g.split(": "),S=x.shift();h[S]=x.join(": ")}),r.resolve(h);return}if(l.status===204)r.resolve(void 0);else if(c(u)&&(!c(t)||f===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(f===""||f==="document")&&c(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(f===""||f==="text")&&c(l.responseText)?r.resolve(l.responseText):r.reject(new le("Invalid XMLHttpRequest response type."))},l.onerror=function(u){r.reject(new ih)},l.send(i),l};Et._Implementations.loadAndExecuteScript=function(e,t,n){return sx(e,t).catch(function(i){n.reject(i)})};Et._DefaultImplementations={};Et._DefaultImplementations.createImage=Et._Implementations.createImage;Et._DefaultImplementations.loadWithXhr=Et._Implementations.loadWithXhr;Et._DefaultImplementations.loadAndExecuteScript=Et._Implementations.loadAndExecuteScript;Et.DEFAULT=Object.freeze(new Et({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ge=Et;function sZ(e){e=e??z.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=e.addNewLeapSeconds??!0,c(e.data)?h$(this,e.data):h$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}sZ.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new le(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new sZ({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};sZ.NONE=Object.freeze({compute:function(e,t){return c(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new P0(0,0,0,0,0),t}});sZ.prototype.compute=function(e,t){if(!c(this._samples))return;if(c(t)||(t=new P0(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(c(i)){let a=n[i],l=n[i+1],d=ee.lessThanOrEquals(a,e),u=!c(l),f=u||ee.greaterThanOrEquals(l,e);if(d&&f)return o=i,!u&&l.equals(e)&&++o,r=o+1,b$(this,n,this._samples,e,o,r,t),t}let s=Wo(n,e,ee.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let l=t[o],d=t[r];if(l.equals(d)||i.equals(l))return p$(e,n,o,a,s),s;if(i.equals(d))return p$(e,n,r,a,s),s;let u=ee.secondsDifference(i,l)/ee.secondsDifference(d,l),f=o*a,p=r*a,y=n[f+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],g=h-y;if(g>.5||g<-.5){let x=n[f+e._taiMinusUtcSecondsColumn],S=n[p+e._taiMinusUtcSecondsColumn];x!==S&&(d.equals(i)?y=h:h-=S-x)}return s.xPoleWander=rZ(u,n[f+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=rZ(u,n[f+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=rZ(u,n[f+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=rZ(u,n[f+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=rZ(u,y,h),s}var aZ=sZ;var XXt=_(T(),1);function oc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}oc.fromQuaternion=function(e,t){if(!c(e))throw new L("quaternion is required");c(t)||(t=new oc);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};oc.fromDegrees=function(e,t,n,i){if(!c(e))throw new L("heading is required");if(!c(t))throw new L("pitch is required");if(!c(n))throw new L("roll is required");return c(i)||(i=new oc),i.heading=e*w.RADIANS_PER_DEGREE,i.pitch=t*w.RADIANS_PER_DEGREE,i.roll=n*w.RADIANS_PER_DEGREE,i};oc.clone=function(e,t){if(c(e))return c(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new oc(e.heading,e.pitch,e.roll)};oc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};oc.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(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)};oc.prototype.clone=function(e){return oc.clone(this,e)};oc.prototype.equals=function(e){return oc.equals(this,e)};oc.prototype.equalsEpsilon=function(e,t,n){return oc.equalsEpsilon(this,e,t,n)};oc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ea=oc;var KXt=_(T(),1);var FXt=_(T(),1);var y$={};var g$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function pLe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(c(PN)||(PN=document.createElement("a")),PN.href=e,PN.href)}var dx;function _$(){if(c(dx))return dx;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:c(y$?.url)?e=th(".",y$.url):typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(iN.toUrl)?e=th("..",ux("Core/buildModuleUrl.js")):e=pLe(),!c(e))throw new L("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return dx=new Ge({url:x$(e)}),dx.appendForwardSlash(),dx}function bLe(e){return x$(iN.toUrl(`../${e}`))}function T$(e){return _$().getDerivedResource({url:e}).url}var vN;function ux(e){return c(vN)||(typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(iN.toUrl)?vN=bLe:vN=T$),vN(e)}ux._cesiumScriptRegex=g$;ux._buildModuleUrlFromBaseUrl=T$;ux._clearBaseResource=function(){dx=void 0};ux.setBaseUrl=function(e){dx=Ge.DEFAULT.getDerivedResource({url:e})};ux.getCesiumBaseUrl=_$;var on=ux;var NXt=_(T(),1);function yLe(e,t,n){this.x=e,this.y=t,this.s=n}var mx=yLe;function S3(e){e=e??z.EMPTY_OBJECT,this._xysFileUrlTemplate=Ge.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,zn.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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 gLe=new ee(0,0,zn.TAI);function _3(e,t,n){let i=gLe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}S3.prototype.preload=function(e,t,n,i){let o=_3(this,e,t),r=_3(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 l=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let f=l;f<=d;++f)u.push(T3(this,f));return Promise.all(u)};S3.prototype.computeXysRadians=function(e,t,n){let i=_3(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 l=!1,d=this._samples;if(c(d[s*3])||(T3(this,s/this._samplesPerXysFile|0),l=!0),c(d[a*3])||(T3(this,a/this._samplesPerXysFile|0),l=!0),l)return;c(n)?(n.x=0,n.y=0,n.s=0):n=new mx(0,0,0);let u=i-s*this._stepSizeDays,f=this._work,p=this._denominators,y=this._coef,h=this._xTable,g,x;for(g=0;g<=r;++g)f[g]=u-h[g];for(g=0;g<=r;++g){for(y[g]=1,x=0;x<=r;++x)x!==g&&(y[g]*=f[x]);y[g]*=p[g];let S=(s+g)*3;n.x+=y[g]*d[S++],n.y+=y[g]*d[S++],n.s+=y[g]*d[S]}return n};function T3(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;c(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ge({url:on(`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,l=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[te.COLUMN1ROW2]-e[te.COLUMN2ROW1])*n,o=(e[te.COLUMN2ROW0]-e[te.COLUMN0ROW2])*n,r=(e[te.COLUMN0ROW1]-e[te.COLUMN1ROW0])*n;else{let f=xLe,p=0;l>a&&(p=1),d>a&&d>l&&(p=2);let y=f[p],h=f[y];n=Math.sqrt(e[te.getElementIndex(p,p)]-e[te.getElementIndex(y,y)]-e[te.getElementIndex(h,h)]+1);let g=_Le;g[p]=.5*n,n=.5/n,s=(e[te.getElementIndex(h,y)]-e[te.getElementIndex(y,h)])*n,g[y]=(e[te.getElementIndex(y,p)]+e[te.getElementIndex(p,y)])*n,g[h]=(e[te.getElementIndex(h,p)]+e[te.getElementIndex(p,h)])*n,i=-g[0],o=-g[1],r=-g[2]}return c(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var S$=new ot,C$=new ot,C3=new ot,V$=new ot;ot.fromHeadingPitchRoll=function(e,t){return C.typeOf.object("headingPitchRoll",e),V$=ot.fromAxisAngle(m.UNIT_X,e.roll,S$),C3=ot.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ot.multiply(C3,V$,C3),C$=ot.fromAxisAngle(m.UNIT_Z,-e.heading,S$),ot.multiply(C$,t,t)};var FN=new m,V3=new m,Gm=new ot,L$=new ot,AN=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=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 C.defined("array",e),t=t??0,c(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,AN),ot.conjugate(AN,AN);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,l=n*n,d=a*a;for(let y=7;y>=0;--y)Vp[y]=(MN[y]*l-NN[y])*s,Lp[y]=(MN[y]*d-NN[y])*s;let u=r*n*(1+Vp[0]*(1+Vp[1]*(1+Vp[2]*(1+Vp[3]*(1+Vp[4]*(1+Vp[5]*(1+Vp[6]*(1+Vp[7])))))))),f=a*(1+Lp[0]*(1+Lp[1]*(1+Lp[2]*(1+Lp[3]*(1+Lp[4]*(1+Lp[5]*(1+Lp[6]*(1+Lp[7])))))))),p=ot.multiplyByScalar(e,f,CLe);return ot.multiplyByScalar(t,u,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){C.typeOf.object("q0",e),C.typeOf.object("q1",t),C.typeOf.object("s0",n),C.typeOf.object("s1",i),C.typeOf.number("t",o),C.typeOf.object("result",r);let s=ot.fastSlerp(e,t,o,dZ),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||c(e)&&c(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=n??0,e===t||c(e)&&c(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 Fe=ot;var mi={},G3={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]},E3={},Vl={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;mi.localFrameToFixedFrameGenerator=function(e,t){if(!G3.hasOwnProperty(e)||!G3[e].hasOwnProperty(t))throw new L("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=G3[e][t],i,o=e+t;return c(E3[o])?i=E3[o]:(i=function(r,s,a){if(!c(r))throw new L("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new L("origin has a NaN component");if(c(a)||(a=new M),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 l=w.sign(r.z);m.unpack(qS[e],0,A0),e!=="east"&&e!=="west"&&m.multiplyByScalar(A0,l,A0),m.unpack(qS[t],0,M0),t!=="east"&&t!=="west"&&m.multiplyByScalar(M0,l,M0),m.unpack(qS[n],0,N0),n!=="east"&&n!=="west"&&m.multiplyByScalar(N0,l,N0)}else{s=s??re.default,s.geodeticSurfaceNormal(r,Vl.up);let l=Vl.up,d=Vl.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,Vl.east),m.cross(l,d,Vl.north),m.multiplyByScalar(Vl.up,-1,Vl.down),m.multiplyByScalar(Vl.east,-1,Vl.west),m.multiplyByScalar(Vl.north,-1,Vl.south),A0=Vl[e],M0=Vl[t],N0=Vl[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},E3[o]=i),i};mi.eastNorthUpToFixedFrame=mi.localFrameToFixedFrameGenerator("east","north");mi.northEastDownToFixedFrame=mi.localFrameToFixedFrameGenerator("north","east");mi.northUpEastToFixedFrame=mi.localFrameToFixedFrameGenerator("north","up");mi.northWestUpToFixedFrame=mi.localFrameToFixedFrameGenerator("north","west");var VLe=new Fe,LLe=new m(1,1,1),ZLe=new M;mi.headingPitchRollToFixedFrame=function(e,t,n,i,o){C.typeOf.object("HeadingPitchRoll",t),i=i??mi.eastNorthUpToFixedFrame;let r=Fe.fromHeadingPitchRoll(t,VLe),s=M.fromTranslationQuaternionRotationScale(m.ZERO,r,LLe,ZLe);return o=i(e,n,o),M.multiply(o,s,o)};var RLe=new M,GLe=new te;mi.headingPitchRollQuaternion=function(e,t,n,i,o){C.typeOf.object("HeadingPitchRoll",t);let r=mi.headingPitchRollToFixedFrame(e,t,n,i,RLe),s=M.getMatrix3(r,GLe);return Fe.fromRotationMatrix(s,o)};var ELe=new m(1,1,1),XLe=new m,G$=new M,ILe=new M,WLe=new te,wLe=new Fe;mi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){C.defined("transform",e),t=t??re.default,n=n??mi.eastNorthUpToFixedFrame,c(i)||(i=new Ea);let o=M.getTranslation(e,XLe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,G$),G$),s=M.setScale(e,ELe,ILe);s=M.setTranslation(s,m.ZERO,s),r=M.multiply(r,s,r);let a=Fe.fromRotationMatrix(M.getMatrix3(r,WLe),wLe);return a=Fe.normalize(a,a),Ea.fromQuaternion(a,i)};var PLe=6*3600+41*60+50.54841,vLe=8640184812866e-6,FLe=.093104,ALe=-62e-7,MLe=11772758384668e-32,NLe=72921158553e-15,kLe=w.TWO_PI/86400,kN=new ee;mi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=mi.computeIcrfToFixedMatrix(e,t);return c(n)||(n=mi.computeTemeToPseudoFixedMatrix(e,t)),n};mi.computeTemeToPseudoFixedMatrix=function(e,t){if(!c(e))throw new L("date is required.");kN=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),kN);let n=kN.dayNumber,i=kN.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=(PLe+o*(vLe+o*(FLe+o*ALe)))*kLe%w.TWO_PI,l=NLe+MLe*(n-24515455e-1),d=(i+Kn.SECONDS_PER_DAY*.5)%Kn.SECONDS_PER_DAY,u=a+l*d,f=Math.cos(u),p=Math.sin(u);return c(t)?(t[0]=f,t[1]=-p,t[2]=0,t[3]=p,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new te(f,p,0,-p,f,0,0,0,1)};mi.iau2006XysData=new cZ;mi.earthOrientationParameters=aZ.NONE;var W3=32.184,ULe=2451545;mi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+W3,i=e.stop.dayNumber,o=e.stop.secondsOfDay+W3;return mi.iau2006XysData.preload(t,n,i,o)};mi.computeIcrfToFixedMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=mi.computeFixedToIcrfMatrix(e,t);if(c(n))return te.transpose(n,t)};var OLe=32.184,DLe=2451545,UN=new Ea,BLe=new te,YLe=new ee;mi.computeMoonFixedToIcrfMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=ee.addSeconds(e,OLe,YLe),i=ee.totalDays(n)-DLe,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,l=w.toRadians(358)+w.toRadians(.9856)*i;return UN.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),UN.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),UN.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(l),te.fromHeadingPitchRoll(UN,BLe)};mi.computeIcrfToMoonFixedMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=mi.computeMoonFixedToIcrfMatrix(e,t);if(c(n))return te.transpose(n,t)};var HLe=new mx(0,0,0),zLe=new P0(0,0,0,0,0,0),X3=new te,I3=new te;mi.computeFixedToIcrfMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=mi.earthOrientationParameters.compute(e,zLe);if(!c(n))return;let i=e.dayNumber,o=e.secondsOfDay+W3,r=mi.iau2006XysData.computeXysRadians(i,o,HLe);if(!c(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-s*s-a*a)),d=X3;d[0]=1-l*s*s,d[3]=-l*s*a,d[6]=s,d[1]=-l*s*a,d[4]=1-l*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-l*(s*s+a*a);let u=te.fromRotationZ(-r.s,I3),f=te.multiply(d,u,X3),p=e.dayNumber,y=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,g=y/Kn.SECONDS_PER_DAY,x=.779057273264+g+.00273781191135448*(h+g);x=x%1*w.TWO_PI;let S=te.fromRotationZ(x,I3),V=te.multiply(f,S,X3),Z=Math.cos(n.xPoleWander),R=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),v=i-ULe+o/Kn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*w.RADIANS_PER_DEGREE/3600,F=Math.cos(P),N=Math.sin(P),b=I3;return b[0]=Z*F,b[1]=Z*N,b[2]=E,b[3]=-R*N+I*E*F,b[4]=R*F+I*E*N,b[5]=-I*Z,b[6]=-I*N-R*E*F,b[7]=I*F-R*E*N,b[8]=R*Z,te.multiply(V,b,t)};var KLe=new ce;mi.pointToWindowCoordinates=function(e,t,n,i){return i=mi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};mi.pointToGLWindowCoordinates=function(e,t,n,i){if(!c(e))throw new L("modelViewProjectionMatrix is required.");if(!c(t))throw new L("viewportTransformation is required.");if(!c(n))throw new L("point is required.");c(i)||(i=new D);let o=KLe;return M.multiplyByVector(e,ce.fromElements(n.x,n.y,n.z,1,o),o),ce.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var JLe=new m,QLe=new m,jLe=new m;mi.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!c(e))throw new L("position is required.");if(!c(t))throw new L("velocity is required.");let o=(n??re.default).geodeticSurfaceNormal(e,JLe),r=m.cross(t,o,QLe);m.equalsEpsilon(r,m.ZERO,w.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,jLe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),c(i)||(i=new te),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 E$=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),X$=new pe,w3=new m,qLe=new m,$Le=new te,P3=new M,I$=new M;mi.basisTo2D=function(e,t,n){if(!c(e))throw new L("projection is required.");if(!c(t))throw new L("matrix is required.");if(!c(n))throw new L("result is required.");let i=M.getTranslation(t,qLe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,w3);else{let u=o.cartesianToCartographic(i,X$);r=e.project(u,w3),m.fromElements(r.z,r.x,r.y,r)}let s=mi.eastNorthUpToFixedFrame(i,o,P3),a=M.inverseTransformation(s,I$),l=M.getMatrix3(t,$Le),d=M.multiplyByMatrix3(a,l,n);return M.multiply(E$,d,n),M.setTranslation(n,r,n),n};mi.ellipsoidTo2DModelMatrix=function(e,t,n){if(!c(e))throw new L("projection is required.");if(!c(t))throw new L("center is required.");if(!c(n))throw new L("result is required.");let i=e.ellipsoid,o=mi.eastNorthUpToFixedFrame(t,i,P3),r=M.inverseTransformation(o,I$),s=i.cartesianToCartographic(t,X$),a=e.project(s,w3);m.fromElements(a.z,a.x,a.y,a);let l=M.fromTranslation(a,P3);return M.multiply(E$,r,n),M.multiply(l,n,n),n};var wt=mi;function En(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=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 C.typeOf.object("value",e),C.defined("array",t),n=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 C.defined("array",e),t=t??0,c(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){C.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t=0?u.longitude:u.longitude+w.TWO_PI;o=Math.min(o,f),r=Math.max(r,f)}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)),c(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){C.defined("cartesians",e),t=t??re.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let d=0,u=e.length;d=0?f.longitude:f.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)),c(n)?(n.west=i,n.south=a,n.east=o,n.north=l,n):new En(i,a,o,l)};var eZe=new m,tZe=new m,nZe=new m,iZe=new m,oZe=new m,v3=new Array(5);for(let e=0;e0?i+=w.TWO_PI:r0&&(r+=w.TWO_PI),i=u))return c(n)?(n.west=a,n.south=d,n.east=l,n.north=u,n):new En(a,d,l,u)};En.simpleIntersection=function(e,t,n){C.typeOf.object("rectangle",e),C.typeOf.object("otherRectangle",t);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 c(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){C.typeOf.object("rectangle",e),C.typeOf.object("otherRectangle",t),c(n)||(n=new En);let i=e.east,o=e.west,r=t.east,s=t.west;i0?i+=w.TWO_PI:r0&&(r+=w.TWO_PI),io||w.equalsEpsilon(n,o,w.EPSILON14))&&(n=e.south&&i<=e.north};var rZe=new pe;En.subsample=function(e,t,n,i){C.typeOf.object("rectangle",e),t=t??re.default,n=n??0,c(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,l=e.west,d=rZe;d.height=n,d.longitude=l,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=l,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=l,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(C.typeOf.object("rectangle",e),C.typeOf.number.greaterThanOrEquals("westLerp",t,0),C.typeOf.number.lessThanOrEquals("westLerp",t,1),C.typeOf.number.greaterThanOrEquals("southLerp",n,0),C.typeOf.number.lessThanOrEquals("southLerp",n,1),C.typeOf.number.greaterThanOrEquals("eastLerp",i,0),C.typeOf.number.lessThanOrEquals("eastLerp",i,1),C.typeOf.number.greaterThanOrEquals("northLerp",o,0),C.typeOf.number.lessThanOrEquals("northLerp",o,1),C.typeOf.number.lessThanOrEquals("westLerp",t,i),C.typeOf.number.lessThanOrEquals("southLerp",n,o),c(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 de=En;function vr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}vr.packedLength=4;vr.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};vr.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new vr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};vr.fromPoints=function(e,t){if(c(t)||(t=new vr),!c(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;an.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};vr.intersect=function(e,t){C.typeOf.object("left",e),C.typeOf.object("right",t);let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?zt.OUTSIDE:zt.INTERSECTING};vr.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};vr.prototype.clone=function(e){return vr.clone(this,e)};vr.prototype.intersect=function(e){return vr.intersect(this,e)};vr.prototype.equals=function(e){return vr.equals(this,e)};var je=vr;var HIt=_(T(),1);var Xa={POINTS:oe.POINTS,LINES:oe.LINES,LINE_LOOP:oe.LINE_LOOP,LINE_STRIP:oe.LINE_STRIP,TRIANGLES:oe.TRIANGLES,TRIANGLE_STRIP:oe.TRIANGLE_STRIP,TRIANGLE_FAN:oe.TRIANGLE_FAN};Xa.isLines=function(e){return e===Xa.LINES||e===Xa.LINE_LOOP||e===Xa.LINE_STRIP};Xa.isTriangles=function(e){return e===Xa.TRIANGLES||e===Xa.TRIANGLE_STRIP||e===Xa.TRIANGLE_FAN};Xa.validate=function(e){return e===Xa.POINTS||e===Xa.LINES||e===Xa.LINE_LOOP||e===Xa.LINE_STRIP||e===Xa.TRIANGLES||e===Xa.TRIANGLE_STRIP||e===Xa.TRIANGLE_FAN};var ve=Object.freeze(Xa);var KIt=_(T(),1),fx=`in vec4 position; -in vec2 textureCoordinates; -out vec2 v_textureCoordinates; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};gr.packedLength=16;gr.fromArray=gr.unpack;gr.IDENTITY=new gr(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);gr.ZERO=new gr(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);gr.COLUMN0ROW0=0;gr.COLUMN0ROW1=1;gr.COLUMN0ROW2=2;gr.COLUMN0ROW3=3;gr.COLUMN1ROW0=4;gr.COLUMN1ROW1=5;gr.COLUMN1ROW2=6;gr.COLUMN1ROW3=7;gr.COLUMN2ROW0=8;gr.COLUMN2ROW1=9;gr.COLUMN2ROW2=10;gr.COLUMN2ROW3=11;gr.COLUMN3ROW0=12;gr.COLUMN3ROW1=13;gr.COLUMN3ROW2=14;gr.COLUMN3ROW3=15;var e1=new h,t1=new h,tG=new h,qwe=new h,$we=new h,Rj=new h,pde=new h,eMe=new h,tMe=new h,nMe=new q,iMe=new q,oMe=new ce,rMe=new ce(0,0,0,1),sMe=new gr,P=gr;var HJt=x(T(),1);var MJt=x(T(),1);var XJt=x(T(),1);var Cy,ms={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Rd={};Object.defineProperties(Rd,{element:{get:function(){if(Rd.supportsFullscreen())return document[ms.fullscreenElement]}},changeEventName:{get:function(){if(Rd.supportsFullscreen())return ms.fullscreenchange}},errorEventName:{get:function(){if(Rd.supportsFullscreen())return ms.fullscreenerror}},enabled:{get:function(){if(Rd.supportsFullscreen())return document[ms.fullscreenEnabled]}},fullscreen:{get:function(){if(Rd.supportsFullscreen())return Rd.element!==null}}});Rd.supportsFullscreen=function(){if(l(Cy))return Cy;Cy=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ms.requestFullscreen="requestFullscreen",ms.exitFullscreen="exitFullscreen",ms.fullscreenEnabled="fullscreenEnabled",ms.fullscreenElement="fullscreenElement",ms.fullscreenchange="fullscreenchange",ms.fullscreenerror="fullscreenerror",Cy=!0,Cy;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){Il._result=t.width>0&&t.height>0,e(Il._result)},t.onerror=function(){Il._result=!1,e(Il._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Il._promise};Object.defineProperties(Il,{initialized:{get:function(){return l(Il._result)}}});var n1=[];typeof ArrayBuffer<"u"&&(n1.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&n1.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&n1.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&n1.push(BigInt64Array),typeof BigUint64Array<"u"&&n1.push(BigUint64Array));var _m={isChrome:Gj,chromeVersion:aMe,isSafari:yde,safariVersion:cMe,isWebkit:xde,webkitVersion:lMe,isEdge:ZD,edgeVersion:dMe,isFirefox:RD,firefoxVersion:hMe,isWindows:uMe,isIPadOrIOS:mMe,hardwareConcurrency:Tm.hardwareConcurrency??3,supportsPointerEvents:fMe,supportsImageRenderingPixelated:Sde,supportsWebP:Il,imageRenderingValue:pMe,typedArrayTypes:n1};_m.supportsBasis=function(e){return _m.supportsWebAssembly()&&e.context.supportsBasis};_m.supportsFullscreen=function(){return qr.supportsFullscreen()};_m.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};_m.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};_m.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};_m.supportsBigInt=function(){return typeof BigInt<"u"};_m.supportsWebWorkers=function(){return typeof Worker<"u"};_m.supportsWebAssembly=function(){return typeof WebAssembly<"u"};_m.supportsWebgl2=function(e){return e.context.webgl2};_m.supportsEsmWebWorkers=function(){return!RD()||parseInt(Lj)>=114};var fn=_m;function ft(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var iG=new h;ft.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);iG=h.normalize(e,iG);let r=iG.x*o,s=iG.y*o,a=iG.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new ft(r,s,a,c)};var bMe=[1,2,0],gMe=new Array(3);ft.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[q.COLUMN0ROW0],c=e[q.COLUMN1ROW1],d=e[q.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[q.COLUMN1ROW2]-e[q.COLUMN2ROW1])*n,o=(e[q.COLUMN2ROW0]-e[q.COLUMN0ROW2])*n,r=(e[q.COLUMN0ROW1]-e[q.COLUMN1ROW0])*n;else{let m=bMe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let b=m[p],f=m[b];n=Math.sqrt(e[q.getElementIndex(p,p)]-e[q.getElementIndex(b,b)]-e[q.getElementIndex(f,f)]+1);let y=gMe;y[p]=.5*n,n=.5/n,s=(e[q.getElementIndex(f,b)]-e[q.getElementIndex(b,f)])*n,y[b]=(e[q.getElementIndex(b,p)]+e[q.getElementIndex(p,b)])*n,y[f]=(e[q.getElementIndex(f,p)]+e[q.getElementIndex(p,f)])*n,i=-y[0],o=-y[1],r=-y[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ft(i,o,r,s)};var Zde=new ft,Rde=new ft,Wj=new ft,Cde=new ft;ft.fromHeadingPitchRoll=function(e,t){return Cde=ft.fromAxisAngle(h.UNIT_X,e.roll,Zde),Wj=ft.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ft.multiply(Wj,Cde,Wj),Rde=ft.fromAxisAngle(h.UNIT_Z,-e.heading,Zde),ft.multiply(Rde,t,t)};var CD=new h,vj=new h,Ph=new ft,Vde=new ft,VD=new ft;ft.packedLength=4;ft.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ft.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ft),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ft.packedInterpolationLength=3;ft.convertPackedArrayForInterpolation=function(e,t,n,i){ft.unpack(e,n*4,VD),ft.conjugate(VD,VD);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let b=7;b>=0;--b)$0[b]=(ED[b]*c-AD[b])*s,eb[b]=(ED[b]*d-AD[b])*s;let u=r*n*(1+$0[0]*(1+$0[1]*(1+$0[2]*(1+$0[3]*(1+$0[4]*(1+$0[5]*(1+$0[6]*(1+$0[7])))))))),m=a*(1+eb[0]*(1+eb[1]*(1+eb[2]*(1+eb[3]*(1+eb[4]*(1+eb[5]*(1+eb[6]*(1+eb[7])))))))),p=ft.multiplyByScalar(e,m,TMe);return ft.multiplyByScalar(t,u,i),ft.add(p,i,i)};ft.fastSquad=function(e,t,n,i,o,r){let s=ft.fastSlerp(e,t,o,oG),a=ft.fastSlerp(n,i,o,i1);return ft.fastSlerp(s,a,2*o*(1-o),r)};ft.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};ft.equalsEpsilon=function(e,t,n){return n=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};ft.ZERO=Object.freeze(new ft(0,0,0,0));ft.IDENTITY=Object.freeze(new ft(0,0,0,1));ft.prototype.clone=function(e){return ft.clone(this,e)};ft.prototype.equals=function(e){return ft.equals(this,e)};ft.prototype.equalsEpsilon=function(e,t){return ft.equalsEpsilon(this,e,t)};ft.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ne=ft;var Ci={},Xj={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"}},o1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Nj={},Cd={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Vy=new h,Ey=new h,Ay=new h;Ci.localFrameToFixedFrameGenerator=function(e,t){if(!Xj.hasOwnProperty(e)||!Xj[e].hasOwnProperty(t))throw new ge("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=Xj[e][t],i,o=e+t;return l(Nj[o])?i=Nj[o]:(i=function(r,s,a){if(l(a)||(a=new P),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(o1[e],0,Vy),h.unpack(o1[t],0,Ey),h.unpack(o1[n],0,Ay);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(o1[e],0,Vy),e!=="east"&&e!=="west"&&h.multiplyByScalar(Vy,c,Vy),h.unpack(o1[t],0,Ey),t!=="east"&&t!=="west"&&h.multiplyByScalar(Ey,c,Ey),h.unpack(o1[n],0,Ay),n!=="east"&&n!=="west"&&h.multiplyByScalar(Ay,c,Ay)}else{s=s??ne.default,s.geodeticSurfaceNormal(r,Cd.up);let c=Cd.up,d=Cd.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,Cd.east),h.cross(c,d,Cd.north),h.multiplyByScalar(Cd.up,-1,Cd.down),h.multiplyByScalar(Cd.east,-1,Cd.west),h.multiplyByScalar(Cd.north,-1,Cd.south),Vy=Cd[e],Ey=Cd[t],Ay=Cd[n]}return a[0]=Vy.x,a[1]=Vy.y,a[2]=Vy.z,a[3]=0,a[4]=Ey.x,a[5]=Ey.y,a[6]=Ey.z,a[7]=0,a[8]=Ay.x,a[9]=Ay.y,a[10]=Ay.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},Nj[o]=i),i};Ci.eastNorthUpToFixedFrame=Ci.localFrameToFixedFrameGenerator("east","north");Ci.northEastDownToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","east");Ci.northUpEastToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","up");Ci.northWestUpToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","west");var _Me=new Ne,SMe=new h(1,1,1),ZMe=new P;Ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ci.eastNorthUpToFixedFrame;let r=Ne.fromHeadingPitchRoll(t,_Me),s=P.fromTranslationQuaternionRotationScale(h.ZERO,r,SMe,ZMe);return o=i(e,n,o),P.multiply(o,s,o)};var RMe=new P,CMe=new q;Ci.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ci.headingPitchRollToFixedFrame(e,t,n,i,RMe),s=P.getMatrix3(r,CMe);return Ne.fromRotationMatrix(s,o)};var VMe=new h(1,1,1),EMe=new h,Gde=new P,AMe=new P,GMe=new q,LMe=new Ne;Ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ne.default,n=n??Ci.eastNorthUpToFixedFrame,l(i)||(i=new Cc);let o=P.getTranslation(e,EMe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=P.inverseTransformation(n(o,t,Gde),Gde),s=P.setScale(e,VMe,AMe);s=P.setTranslation(s,h.ZERO,s),r=P.multiply(r,s,r);let a=Ne.fromRotationMatrix(P.getMatrix3(r,GMe),LMe);return a=Ne.normalize(a,a),Cc.fromQuaternion(a,i)};var WMe=6*3600+2460+50.54841,vMe=8640184812866e-6,FMe=.093104,IMe=-62e-7,PMe=11772758384668e-32,XMe=72921158553e-15,NMe=W.TWO_PI/86400,GD=new Q;Ci.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ci.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ci.computeTemeToPseudoFixedMatrix(e,t)),n};Ci.computeTemeToPseudoFixedMatrix=function(e,t){GD=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),GD);let n=GD.dayNumber,i=GD.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Mn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Mn.DAYS_PER_JULIAN_CENTURY;let a=(WMe+o*(vMe+o*(FMe+o*IMe)))*NMe%W.TWO_PI,c=XMe+PMe*(n-24515455e-1),d=(i+Mn.SECONDS_PER_DAY*.5)%Mn.SECONDS_PER_DAY,u=a+c*d,m=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new q(m,p,0,-p,m,0,0,0,1)};Ci.iau2006XysData=new eG;Ci.earthOrientationParameters=$A.NONE;var Mj=32.184,YMe=2451545;Ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Mj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Mj;return Ci.iau2006XysData.preload(t,n,i,o)};Ci.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new q);let n=Ci.computeFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var wMe=32.184,MMe=2451545,LD=new Cc,kMe=new q,UMe=new Q;Ci.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Q.addSeconds(e,wMe,UMe),i=Q.totalDays(n)-MMe,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 LD.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),LD.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),LD.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),q.fromHeadingPitchRoll(LD,kMe,t)};Ci.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new q);let n=Ci.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var DMe=new n_(0,0,0),OMe=new Sy(0,0,0,0,0,0),Yj=new q,wj=new q;Ci.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Ci.earthOrientationParameters.compute(e,OMe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+Mj,r=Ci.iau2006XysData.computeXysRadians(i,o,DMe);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=Yj;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=q.fromRotationZ(-r.s,wj),m=q.multiply(d,u,Yj),p=e.dayNumber,b=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,y=b/Mn.SECONDS_PER_DAY,_=.779057273264+y+.00273781191135448*(f+y);_=_%1*W.TWO_PI;let S=q.fromRotationZ(_,wj),Z=q.multiply(m,S,Yj),R=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),A=Math.sin(n.yPoleWander),L=i-YMe+o/Mn.SECONDS_PER_DAY;L/=36525;let F=-47e-6*L*W.RADIANS_PER_DEGREE/3600,I=Math.cos(F),N=Math.sin(F),g=wj;return g[0]=R*I,g[1]=R*N,g[2]=E,g[3]=-C*N+A*E*I,g[4]=C*I+A*E*N,g[5]=-A*R,g[6]=-A*N-C*E*I,g[7]=A*I-C*E*N,g[8]=C*R,q.multiply(Z,g,t)};var BMe=new ce;Ci.pointToWindowCoordinates=function(e,t,n,i){return i=Ci.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ci.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new k);let o=BMe;return P.multiplyByVector(e,ce.fromElements(n.x,n.y,n.z,1,o),o),ce.multiplyByScalar(o,1/o.w,o),P.multiplyByVector(t,o,o),k.fromCartesian4(o,i)};var zMe=new h,HMe=new h,KMe=new h;Ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ne.default).geodeticSurfaceNormal(e,zMe),r=h.cross(t,o,HMe);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,KMe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new q),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};Ci.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Lde=new pe,kj=new h,JMe=new h,jMe=new q,Uj=new P,Wde=new P;Ci.basisTo2D=function(e,t,n){let i=P.getTranslation(t,JMe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,kj);else{let u=o.cartesianToCartographic(i,Lde);r=e.project(u,kj),h.fromElements(r.z,r.x,r.y,r)}let s=Ci.eastNorthUpToFixedFrame(i,o,Uj),a=P.inverseTransformation(s,Wde),c=P.getMatrix3(t,jMe),d=P.multiplyByMatrix3(a,c,n);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,d,n),P.setTranslation(n,r,n),n};Ci.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Ci.eastNorthUpToFixedFrame(t,i,Uj),r=P.inverseTransformation(o,Wde),s=i.cartesianToCartographic(t,Lde),a=e.project(s,kj);h.fromElements(a.z,a.x,a.y,a);let c=P.fromTranslation(a,Uj);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,r,n),P.multiply(c,n,n),n};var _t=Ci;var r1=class e{constructor(t,n,i,o){this.west=t??0,this.south=n??0,this.east=i??0,this.north=o??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n=0?m.longitude:m.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 e(i,a,o,c)}static fromCartesianArray(t,n,i){n=n??ne.default;let o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let u=0,m=t.length;u=0?p.longitude:p.longitude+W.TWO_PI;s=Math.min(s,b),a=Math.max(a,b)}return r-o>a-s&&(o=s,r=a,r>W.PI&&(r=r-W.TWO_PI),o>W.PI&&(o=o-W.TWO_PI)),l(i)?(i.west=o,i.south=c,i.east=r,i.north=d,i):new e(o,c,r,d)}static fromBoundingSphere(t,n,i){let o=t.center,r=t.radius;if(l(n)||(n=ne.default),l(i)||(i=new e),h.equals(o,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=_t.eastNorthUpToFixedFrame(o,n,QMe),a=P.multiplyByPointAsVector(s,h.UNIT_X,qMe);h.normalize(a,a);let c=P.multiplyByPointAsVector(s,h.UNIT_Y,$Me);h.normalize(c,c),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,tke),u=h.negate(a,eke),m=Dj,p=m[0];return h.add(o,c,p),p=m[1],h.add(o,u,p),p=m[2],h.add(o,d,p),p=m[3],h.add(o,a,p),m[4]=o,e.fromCartesianArray(m,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new pe(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new pe(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new pe(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new pe(t.east,t.south)}static center(t,n){let i=t.east,o=t.west;i0?o+=W.TWO_PI:s0&&(s+=W.TWO_PI),o=m))return l(i)?(i.west=c,i.south=u,i.east=d,i.north=m,i):new e(c,u,d,m)}static simpleIntersection(t,n,i){let o=Math.max(t.west,n.west),r=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(r>=a||o>=s))return l(i)?(i.west=o,i.south=r,i.east=s,i.north=a,i):new e(o,r,s,a)}static union(t,n,i){l(i)||(i=new e);let o=t.east,r=t.west,s=n.east,a=n.west;o0?o+=W.TWO_PI:s0&&(s+=W.TWO_PI),or||W.equalsEpsilon(i,r,W.EPSILON14))&&(i=t.south&&o<=t.north}static subsample(t,n,i,o){n=n??ne.default,i=i??0,l(o)||(o=[]);let r=0,s=t.north,a=t.south,c=t.east,d=t.west,u=nke;u.height=i,u.longitude=d,u.latitude=s,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=c,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.latitude=a,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=d,o[r]=n.cartographicToCartesian(u,o[r]),r++,s<0?u.latitude=s:a>0?u.latitude=a:u.latitude=0;for(let m=1;m<8;++m)u.longitude=-Math.PI+m*W.PI_OVER_TWO,e.contains(t,u)&&(o[r]=n.cartographicToCartesian(u,o[r]),r++);return u.latitude===0&&(u.longitude=d,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=c,o[r]=n.cartographicToCartesian(u,o[r]),r++),o.length=r,o}static subsection(t,n,i,o,r,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+o*c}else{let c=W.TWO_PI+t.east-t.west;s.west=W.negativePiToPi(t.west+n*c),s.east=W.negativePiToPi(t.west+o*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+r*a,n===1&&(s.west=t.east),o===1&&(s.east=t.east),i===1&&(s.south=t.north),r===1&&(s.north=t.north),s}};r1.packedLength=4;var QMe=new P,qMe=new h,$Me=new h,eke=new h,tke=new h,Dj=new Array(5);for(let e=0;en.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};hs.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?qt.OUTSIDE:qt.INTERSECTING};hs.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};hs.prototype.clone=function(e){return hs.clone(this,e)};hs.prototype.intersect=function(e){return hs.intersect(this,e)};hs.prototype.equals=function(e){return hs.equals(this,e)};var nt=hs;var Njt=x(T(),1);function Oj(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}var xe=class e{constructor(t,n,i,o){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=o??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,o,r){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),o=e.byteToFloat(o??255),l(r)?(r.red=t,r.green=n,r.blue=i,r.alpha=o,r):new e(t,n,i,o)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return zj[0]=t,e.fromBytes(tb[0],tb[1],tb[2],tb[3],n)}static fromHsl(t,n,i,o,r){t=(t??0)%1,n=n??0,i=i??0,o=o??1;let s=i,a=i,c=i;if(n!==0){let d;i<.5?d=i*(1+n):d=i+n-i*n;let u=2*i-d;s=Oj(u,d,t+1/3),a=Oj(u,d,t),c=Oj(u,d,t-1/3)}return l(r)?(r.red=s,r.green=a,r.blue=c,r.alpha=o,r):new e(s,a,c,o)}static fromRandom(t,n){t=t??B.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+W.nextRandomNumber()*(c-a)}let o=t.green;if(!l(o)){let a=t.minimumGreen??0,c=t.maximumGreen??1;o=a+W.nextRandomNumber()*(c-a)}let r=t.blue;if(!l(r)){let a=t.minimumBlue??0,c=t.maximumBlue??1;r=a+W.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+W.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=o,n.blue=r,n.alpha=s,n):new e(i,o,r,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let o=rke.exec(t);return o!==null?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=parseInt(o[4]??"f",16)/15,n):(o=ske.exec(t),o!==null?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=parseInt(o[4]??"ff",16)/255,n):(o=ake.exec(t),o!==null?(n.red=parseFloat(o[1])/(o[1].substr(-1)==="%"?100:255),n.green=parseFloat(o[2])/(o[2].substr(-1)==="%"?100:255),n.blue=parseFloat(o[3])/(o[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(o[4]??"1.0"),n):(o=cke.exec(t),o!==null?e.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(o[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let o=e.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${t}${n}${i}${o}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),o=e.floatToByte(this.blue),r=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=o,t[3]=r,t):[n,i,o,r]}static bytesToRgba(t,n,i,o){return tb[0]=t,tb[1]=n,tb[2]=i,tb[3]=o,zj[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,o){return o.red=W.lerp(t.red,n.red,i),o.green=W.lerp(t.green,n.green,i),o.blue=W.lerp(t.blue,n.blue,i),o.alpha=W.lerp(t.alpha,n.alpha,i),o}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Bj,zj,tb;fn.supportsTypedArrays()&&(Bj=new ArrayBuffer(4),zj=new Uint32Array(Bj),tb=new Uint8Array(Bj));var rke=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,ske=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,ake=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,cke=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;xe.packedLength=4;xe.ALICEBLUE=Object.freeze(xe.fromCssColorString("#F0F8FF"));xe.ANTIQUEWHITE=Object.freeze(xe.fromCssColorString("#FAEBD7"));xe.AQUA=Object.freeze(xe.fromCssColorString("#00FFFF"));xe.AQUAMARINE=Object.freeze(xe.fromCssColorString("#7FFFD4"));xe.AZURE=Object.freeze(xe.fromCssColorString("#F0FFFF"));xe.BEIGE=Object.freeze(xe.fromCssColorString("#F5F5DC"));xe.BISQUE=Object.freeze(xe.fromCssColorString("#FFE4C4"));xe.BLACK=Object.freeze(xe.fromCssColorString("#000000"));xe.BLANCHEDALMOND=Object.freeze(xe.fromCssColorString("#FFEBCD"));xe.BLUE=Object.freeze(xe.fromCssColorString("#0000FF"));xe.BLUEVIOLET=Object.freeze(xe.fromCssColorString("#8A2BE2"));xe.BROWN=Object.freeze(xe.fromCssColorString("#A52A2A"));xe.BURLYWOOD=Object.freeze(xe.fromCssColorString("#DEB887"));xe.CADETBLUE=Object.freeze(xe.fromCssColorString("#5F9EA0"));xe.CHARTREUSE=Object.freeze(xe.fromCssColorString("#7FFF00"));xe.CHOCOLATE=Object.freeze(xe.fromCssColorString("#D2691E"));xe.CORAL=Object.freeze(xe.fromCssColorString("#FF7F50"));xe.CORNFLOWERBLUE=Object.freeze(xe.fromCssColorString("#6495ED"));xe.CORNSILK=Object.freeze(xe.fromCssColorString("#FFF8DC"));xe.CRIMSON=Object.freeze(xe.fromCssColorString("#DC143C"));xe.CYAN=Object.freeze(xe.fromCssColorString("#00FFFF"));xe.DARKBLUE=Object.freeze(xe.fromCssColorString("#00008B"));xe.DARKCYAN=Object.freeze(xe.fromCssColorString("#008B8B"));xe.DARKGOLDENROD=Object.freeze(xe.fromCssColorString("#B8860B"));xe.DARKGRAY=Object.freeze(xe.fromCssColorString("#A9A9A9"));xe.DARKGREEN=Object.freeze(xe.fromCssColorString("#006400"));xe.DARKGREY=xe.DARKGRAY;xe.DARKKHAKI=Object.freeze(xe.fromCssColorString("#BDB76B"));xe.DARKMAGENTA=Object.freeze(xe.fromCssColorString("#8B008B"));xe.DARKOLIVEGREEN=Object.freeze(xe.fromCssColorString("#556B2F"));xe.DARKORANGE=Object.freeze(xe.fromCssColorString("#FF8C00"));xe.DARKORCHID=Object.freeze(xe.fromCssColorString("#9932CC"));xe.DARKRED=Object.freeze(xe.fromCssColorString("#8B0000"));xe.DARKSALMON=Object.freeze(xe.fromCssColorString("#E9967A"));xe.DARKSEAGREEN=Object.freeze(xe.fromCssColorString("#8FBC8F"));xe.DARKSLATEBLUE=Object.freeze(xe.fromCssColorString("#483D8B"));xe.DARKSLATEGRAY=Object.freeze(xe.fromCssColorString("#2F4F4F"));xe.DARKSLATEGREY=xe.DARKSLATEGRAY;xe.DARKTURQUOISE=Object.freeze(xe.fromCssColorString("#00CED1"));xe.DARKVIOLET=Object.freeze(xe.fromCssColorString("#9400D3"));xe.DEEPPINK=Object.freeze(xe.fromCssColorString("#FF1493"));xe.DEEPSKYBLUE=Object.freeze(xe.fromCssColorString("#00BFFF"));xe.DIMGRAY=Object.freeze(xe.fromCssColorString("#696969"));xe.DIMGREY=xe.DIMGRAY;xe.DODGERBLUE=Object.freeze(xe.fromCssColorString("#1E90FF"));xe.FIREBRICK=Object.freeze(xe.fromCssColorString("#B22222"));xe.FLORALWHITE=Object.freeze(xe.fromCssColorString("#FFFAF0"));xe.FORESTGREEN=Object.freeze(xe.fromCssColorString("#228B22"));xe.FUCHSIA=Object.freeze(xe.fromCssColorString("#FF00FF"));xe.GAINSBORO=Object.freeze(xe.fromCssColorString("#DCDCDC"));xe.GHOSTWHITE=Object.freeze(xe.fromCssColorString("#F8F8FF"));xe.GOLD=Object.freeze(xe.fromCssColorString("#FFD700"));xe.GOLDENROD=Object.freeze(xe.fromCssColorString("#DAA520"));xe.GRAY=Object.freeze(xe.fromCssColorString("#808080"));xe.GREEN=Object.freeze(xe.fromCssColorString("#008000"));xe.GREENYELLOW=Object.freeze(xe.fromCssColorString("#ADFF2F"));xe.GREY=xe.GRAY;xe.HONEYDEW=Object.freeze(xe.fromCssColorString("#F0FFF0"));xe.HOTPINK=Object.freeze(xe.fromCssColorString("#FF69B4"));xe.INDIANRED=Object.freeze(xe.fromCssColorString("#CD5C5C"));xe.INDIGO=Object.freeze(xe.fromCssColorString("#4B0082"));xe.IVORY=Object.freeze(xe.fromCssColorString("#FFFFF0"));xe.KHAKI=Object.freeze(xe.fromCssColorString("#F0E68C"));xe.LAVENDER=Object.freeze(xe.fromCssColorString("#E6E6FA"));xe.LAVENDAR_BLUSH=Object.freeze(xe.fromCssColorString("#FFF0F5"));xe.LAWNGREEN=Object.freeze(xe.fromCssColorString("#7CFC00"));xe.LEMONCHIFFON=Object.freeze(xe.fromCssColorString("#FFFACD"));xe.LIGHTBLUE=Object.freeze(xe.fromCssColorString("#ADD8E6"));xe.LIGHTCORAL=Object.freeze(xe.fromCssColorString("#F08080"));xe.LIGHTCYAN=Object.freeze(xe.fromCssColorString("#E0FFFF"));xe.LIGHTGOLDENRODYELLOW=Object.freeze(xe.fromCssColorString("#FAFAD2"));xe.LIGHTGRAY=Object.freeze(xe.fromCssColorString("#D3D3D3"));xe.LIGHTGREEN=Object.freeze(xe.fromCssColorString("#90EE90"));xe.LIGHTGREY=xe.LIGHTGRAY;xe.LIGHTPINK=Object.freeze(xe.fromCssColorString("#FFB6C1"));xe.LIGHTSEAGREEN=Object.freeze(xe.fromCssColorString("#20B2AA"));xe.LIGHTSKYBLUE=Object.freeze(xe.fromCssColorString("#87CEFA"));xe.LIGHTSLATEGRAY=Object.freeze(xe.fromCssColorString("#778899"));xe.LIGHTSLATEGREY=xe.LIGHTSLATEGRAY;xe.LIGHTSTEELBLUE=Object.freeze(xe.fromCssColorString("#B0C4DE"));xe.LIGHTYELLOW=Object.freeze(xe.fromCssColorString("#FFFFE0"));xe.LIME=Object.freeze(xe.fromCssColorString("#00FF00"));xe.LIMEGREEN=Object.freeze(xe.fromCssColorString("#32CD32"));xe.LINEN=Object.freeze(xe.fromCssColorString("#FAF0E6"));xe.MAGENTA=Object.freeze(xe.fromCssColorString("#FF00FF"));xe.MAROON=Object.freeze(xe.fromCssColorString("#800000"));xe.MEDIUMAQUAMARINE=Object.freeze(xe.fromCssColorString("#66CDAA"));xe.MEDIUMBLUE=Object.freeze(xe.fromCssColorString("#0000CD"));xe.MEDIUMORCHID=Object.freeze(xe.fromCssColorString("#BA55D3"));xe.MEDIUMPURPLE=Object.freeze(xe.fromCssColorString("#9370DB"));xe.MEDIUMSEAGREEN=Object.freeze(xe.fromCssColorString("#3CB371"));xe.MEDIUMSLATEBLUE=Object.freeze(xe.fromCssColorString("#7B68EE"));xe.MEDIUMSPRINGGREEN=Object.freeze(xe.fromCssColorString("#00FA9A"));xe.MEDIUMTURQUOISE=Object.freeze(xe.fromCssColorString("#48D1CC"));xe.MEDIUMVIOLETRED=Object.freeze(xe.fromCssColorString("#C71585"));xe.MIDNIGHTBLUE=Object.freeze(xe.fromCssColorString("#191970"));xe.MINTCREAM=Object.freeze(xe.fromCssColorString("#F5FFFA"));xe.MISTYROSE=Object.freeze(xe.fromCssColorString("#FFE4E1"));xe.MOCCASIN=Object.freeze(xe.fromCssColorString("#FFE4B5"));xe.NAVAJOWHITE=Object.freeze(xe.fromCssColorString("#FFDEAD"));xe.NAVY=Object.freeze(xe.fromCssColorString("#000080"));xe.OLDLACE=Object.freeze(xe.fromCssColorString("#FDF5E6"));xe.OLIVE=Object.freeze(xe.fromCssColorString("#808000"));xe.OLIVEDRAB=Object.freeze(xe.fromCssColorString("#6B8E23"));xe.ORANGE=Object.freeze(xe.fromCssColorString("#FFA500"));xe.ORANGERED=Object.freeze(xe.fromCssColorString("#FF4500"));xe.ORCHID=Object.freeze(xe.fromCssColorString("#DA70D6"));xe.PALEGOLDENROD=Object.freeze(xe.fromCssColorString("#EEE8AA"));xe.PALEGREEN=Object.freeze(xe.fromCssColorString("#98FB98"));xe.PALETURQUOISE=Object.freeze(xe.fromCssColorString("#AFEEEE"));xe.PALEVIOLETRED=Object.freeze(xe.fromCssColorString("#DB7093"));xe.PAPAYAWHIP=Object.freeze(xe.fromCssColorString("#FFEFD5"));xe.PEACHPUFF=Object.freeze(xe.fromCssColorString("#FFDAB9"));xe.PERU=Object.freeze(xe.fromCssColorString("#CD853F"));xe.PINK=Object.freeze(xe.fromCssColorString("#FFC0CB"));xe.PLUM=Object.freeze(xe.fromCssColorString("#DDA0DD"));xe.POWDERBLUE=Object.freeze(xe.fromCssColorString("#B0E0E6"));xe.PURPLE=Object.freeze(xe.fromCssColorString("#800080"));xe.RED=Object.freeze(xe.fromCssColorString("#FF0000"));xe.ROSYBROWN=Object.freeze(xe.fromCssColorString("#BC8F8F"));xe.ROYALBLUE=Object.freeze(xe.fromCssColorString("#4169E1"));xe.SADDLEBROWN=Object.freeze(xe.fromCssColorString("#8B4513"));xe.SALMON=Object.freeze(xe.fromCssColorString("#FA8072"));xe.SANDYBROWN=Object.freeze(xe.fromCssColorString("#F4A460"));xe.SEAGREEN=Object.freeze(xe.fromCssColorString("#2E8B57"));xe.SEASHELL=Object.freeze(xe.fromCssColorString("#FFF5EE"));xe.SIENNA=Object.freeze(xe.fromCssColorString("#A0522D"));xe.SILVER=Object.freeze(xe.fromCssColorString("#C0C0C0"));xe.SKYBLUE=Object.freeze(xe.fromCssColorString("#87CEEB"));xe.SLATEBLUE=Object.freeze(xe.fromCssColorString("#6A5ACD"));xe.SLATEGRAY=Object.freeze(xe.fromCssColorString("#708090"));xe.SLATEGREY=xe.SLATEGRAY;xe.SNOW=Object.freeze(xe.fromCssColorString("#FFFAFA"));xe.SPRINGGREEN=Object.freeze(xe.fromCssColorString("#00FF7F"));xe.STEELBLUE=Object.freeze(xe.fromCssColorString("#4682B4"));xe.TAN=Object.freeze(xe.fromCssColorString("#D2B48C"));xe.TEAL=Object.freeze(xe.fromCssColorString("#008080"));xe.THISTLE=Object.freeze(xe.fromCssColorString("#D8BFD8"));xe.TOMATO=Object.freeze(xe.fromCssColorString("#FF6347"));xe.TURQUOISE=Object.freeze(xe.fromCssColorString("#40E0D0"));xe.VIOLET=Object.freeze(xe.fromCssColorString("#EE82EE"));xe.WHEAT=Object.freeze(xe.fromCssColorString("#F5DEB3"));xe.WHITE=Object.freeze(xe.fromCssColorString("#FFFFFF"));xe.WHITESMOKE=Object.freeze(xe.fromCssColorString("#F5F5F5"));xe.YELLOW=Object.freeze(xe.fromCssColorString("#FFFF00"));xe.YELLOWGREEN=Object.freeze(xe.fromCssColorString("#9ACD32"));xe.TRANSPARENT=Object.freeze(new xe(0,0,0,0));var U=xe;var wjt=x(T(),1);function lke(){return!0}function dke(e,t){t=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=lke}var me=dke;var Ujt=x(T(),1);function yu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(yu.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}}});yu.packedLength=2;yu.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};yu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new yu),n.near=e[t++],n.far=e[t],n};yu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};yu.clone=function(e,t){if(l(e))return l(t)||(t=new yu),t.near=e.near,t.far=e.far,t};yu.prototype.clone=function(e){return yu.clone(this,e)};yu.prototype.equals=function(e){return yu.equals(this,e)};var Ot=yu;var Bjt=x(T(),1);function Sm(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Sm.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 Sm(e.near,e.nearValue,e.far,e.farValue)};Sm.packedLength=4;Sm.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Sm.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Sm),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Sm.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};Sm.prototype.clone=function(e){return Sm.clone(this,e)};Sm.prototype.equals=function(e){return Sm.equals(this,e)};var Kt=Sm;var Hjt=x(T(),1),Gy={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,CLIP_TO_GROUND:7};Object.freeze(Gy);var He=Gy;function fs(e){return e===Gy.CLAMP_TO_GROUND||e===Gy.CLAMP_TO_3D_TILE||e===Gy.CLAMP_TO_TERRAIN}function Ly(e){return e===Gy.RELATIVE_TO_GROUND||e===Gy.RELATIVE_TO_3D_TILE||e===Gy.RELATIVE_TO_TERRAIN}var Jjt=x(T(),1),Fde={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Fde);var Ui=Fde;var Qjt=x(T(),1),Ide={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Ide);var Bn=Ide;var $jt=x(T(),1),uke=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Wt=uke;var i4t=x(T(),1);function Xh(){ge.throwInstantiationError()}Object.defineProperties(Xh.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});Xh.prototype.getValue=ge.throwInstantiationError;Xh.prototype.equals=ge.throwInstantiationError;Xh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Xh.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;imke&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==se.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ne.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){o()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){o()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Nh=hke;var p4t=x(T(),1);var fke=new pe;function pke(e,t,n,i,o){let r=i.cartesianToCartographic(e,fke);return n===He.CLIP_TO_GROUND?r.heightr.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=nb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};Wy.prototype.isDestroyed=function(){return!1};Wy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Wy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Xde(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 Xde(r)):(Hj(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Hj(s.get(r.id),r,a),s.remove(r.id)};function Hj(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var sG=Wy;var ASn=x(T(),1);var $Qt=x(T(),1);var q4t=x(T(),1);var w4t=x(T(),1);function Xke(e,t){this.start=e??0,this.stop=t??0}var Ns=Xke;var WD=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],e4),o=h.clone(i,Kj),r=h.clone(i,Jj),s=h.clone(i,jj),a=h.clone(i,Qj),c=h.clone(i,qj),d=h.clone(i,$j),u=t.length,m;for(m=1;ma.x&&h.clone(i,a),Nc.y&&h.clone(i,c),gd.z&&h.clone(i,d)}let p=h.magnitudeSquared(h.subtract(a,o,ec)),b=h.magnitudeSquared(h.subtract(c,r,ec)),f=h.magnitudeSquared(h.subtract(d,s,ec)),y=o,_=a,S=p;b>S&&(S=b,y=r,_=c),f>S&&(y=s,_=d);let Z=t4;Z.x=(y.x+_.x)*.5,Z.y=(y.y+_.y)*.5,Z.z=(y.z+_.z)*.5;let R=h.magnitudeSquared(h.subtract(_,Z,ec)),C=Math.sqrt(R),E=n4;E.x=o.x,E.y=r.y,E.z=s.z;let A=i4;A.x=a.x,A.y=c.y,A.z=d.z;let L=h.midpoint(E,A,o4),F=0;for(m=0;mF&&(F=I);let N=h.magnitudeSquared(h.subtract(i,Z,ec));if(N>R){let g=Math.sqrt(N);C=(C+g)*.5,R=C*C;let V=g-C;Z.x=(C*Z.x+V*i.x)/g,Z.y=(C*Z.y+V*i.y)/g,Z.z=(C*Z.z+V*i.z)/g}}return Cd.x&&h.clone(r,d),Vu.y&&h.clone(r,u),Gm.z&&h.clone(r,m)}let f=h.magnitudeSquared(h.subtract(d,s,ec)),y=h.magnitudeSquared(h.subtract(u,a,ec)),_=h.magnitudeSquared(h.subtract(m,c,ec)),S=s,Z=d,R=f;y>R&&(R=y,S=a,Z=u),_>R&&(S=c,Z=m);let C=t4;C.x=(S.x+Z.x)*.5,C.y=(S.y+Z.y)*.5,C.z=(S.z+Z.z)*.5;let E=h.magnitudeSquared(h.subtract(Z,C,ec)),A=Math.sqrt(E),L=n4;L.x=s.x,L.y=a.y,L.z=c.z;let F=i4;F.x=d.x,F.y=u.y,F.z=m.z;let I=h.midpoint(L,F,o4),N=0;for(b=0;bN&&(N=g);let V=h.magnitudeSquared(h.subtract(r,C,ec));if(V>E){let G=Math.sqrt(V);A=(A+G)*.5,E=A*A;let v=G-A;C.x=(A*C.x+v*r.x)/G,C.y=(A*C.y+v*r.y)/G,C.z=(A*C.z+v*r.z)/G}}return Ac.x&&h.clone(o,c),gd.y&&h.clone(o,d),Vu.z&&h.clone(o,u)}let b=h.magnitudeSquared(h.subtract(c,r,ec)),f=h.magnitudeSquared(h.subtract(d,s,ec)),y=h.magnitudeSquared(h.subtract(u,a,ec)),_=r,S=c,Z=b;f>Z&&(Z=f,_=s,S=d),y>Z&&(_=a,S=u);let R=t4;R.x=(_.x+S.x)*.5,R.y=(_.y+S.y)*.5,R.z=(_.z+S.z)*.5;let C=h.magnitudeSquared(h.subtract(S,R,ec)),E=Math.sqrt(C),A=n4;A.x=r.x,A.y=s.y,A.z=a.z;let L=i4;L.x=c.x,L.y=d.y,L.z=u.z;let F=h.midpoint(A,L,o4),I=0;for(p=0;pI&&(I=N);let g=h.magnitudeSquared(h.subtract(o,R,ec));if(g>C){let V=Math.sqrt(g);E=(E+V)*.5,C=E*E;let G=V-E;R.x=(E*R.x+G*o.x)/V,R.y=(E*R.y+G*o.y)/V,R.z=(E*R.z+G*o.z)/V}}return E=d+a)return t.clone(i),i;if(a>=d+r)return n.clone(i),i;let u=(r+d+a)*.5,m=h.multiplyByScalar(c,(-r+u)/d,Hke);return h.add(m,o,m),h.clone(m,i.center),i.radius=u,i}static expand(t,n,i){i=e.clone(t,i);let o=h.magnitude(h.subtract(n,i.center,Kke));return o>i.radius&&(i.radius=o),i}static intersectPlane(t,n){let i=t.center,o=t.radius,r=n.normal,s=h.dot(r,i)+n.distance;return s<-o?qt.OUTSIDE:si)throw new L("The number of color attachments exceeds the number supported.");for(let l=0;li)throw new L("The number of color attachments exceeds the number supported.");for(let l=0;l=this._colorTextures.length)throw new L("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]};Em.prototype.getColorRenderbuffer=function(e){if(!c(e)||e<0||e>=this._colorRenderbuffers.length)throw new L("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;nmt.maximumAliasedLineWidth)throw new L("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!qr.validate(this.frontFace))throw new L("Invalid renderState.frontFace.");if(!cZe(this.cull.face))throw new L("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new L("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new L("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new L("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new L("renderState.depthRange.far must be less than or equal to one.");if(!lZe(this.depthTest.func))throw new L("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new L("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!P$(this.blending.equationRgb))throw new L("Invalid renderState.blending.equationRgb.");if(!P$(this.blending.equationAlpha))throw new L("Invalid renderState.blending.equationAlpha.");if(!BN(this.blending.functionSourceRgb))throw new L("Invalid renderState.blending.functionSourceRgb.");if(!BN(this.blending.functionSourceAlpha))throw new L("Invalid renderState.blending.functionSourceAlpha.");if(!BN(this.blending.functionDestinationRgb))throw new L("Invalid renderState.blending.functionDestinationRgb.");if(!BN(this.blending.functionDestinationAlpha))throw new L("Invalid renderState.blending.functionDestinationAlpha.");if(!v$(this.stencilTest.frontFunction))throw new L("Invalid renderState.stencilTest.frontFunction.");if(!v$(this.stencilTest.backFunction))throw new L("Invalid renderState.stencilTest.backFunction.");if(!$S(this.stencilTest.frontOperation.fail))throw new L("Invalid renderState.stencilTest.frontOperation.fail.");if(!$S(this.stencilTest.frontOperation.zFail))throw new L("Invalid renderState.stencilTest.frontOperation.zFail.");if(!$S(this.stencilTest.frontOperation.zPass))throw new L("Invalid renderState.stencilTest.frontOperation.zPass.");if(!$S(this.stencilTest.backOperation.fail))throw new L("Invalid renderState.stencilTest.backOperation.fail.");if(!$S(this.stencilTest.backOperation.zFail))throw new L("Invalid renderState.stencilTest.backOperation.zFail.");if(!$S(this.stencilTest.backOperation.zPass))throw new L("Invalid renderState.stencilTest.backOperation.zPass.");if(c(this.viewport)){if(this.viewport.width<0)throw new L("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new L("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>mt.maximumViewportWidth)throw new L(`renderState.viewport.width must be less than or equal to the maximum viewport width (${mt.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>mt.maximumViewportHeight)throw new L(`renderState.viewport.height must be less than or equal to the maximum viewport height (${mt.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}var dZe=0,sh={};ah.fromCache=function(e){let t=JSON.stringify(e),n=sh[t];if(c(n))return++n.referenceCount,n.state;let i=new ah(e),o=JSON.stringify(i);return n=sh[o],c(n)||(i.id=dZe++,i=mZ(i),n={referenceCount:0,state:i},sh[o]=n),++n.referenceCount,sh[t]={referenceCount:1,state:n.state},n.state};ah.removeFromCache=function(e){let t=new ah(e),n=JSON.stringify(t),i=sh[n],o=JSON.stringify(e),r=sh[o];c(r)&&(--r.referenceCount,r.referenceCount===0&&(delete sh[o],c(i)&&--i.referenceCount)),c(i)&&i.referenceCount===0&&delete sh[n]};ah.getCache=function(){return sh};ah.clearCache=function(){sh={}};function hx(e,t,n){n?e.enable(t):e.disable(t)}function F$(e,t){e.frontFace(t.frontFace)}function A$(e,t){let n=t.cull,i=n.enabled;hx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function M$(e,t){e.lineWidth(t.lineWidth)}function N$(e,t){let n=t.polygonOffset,i=n.enabled;hx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function k$(e,t,n){let i=t.scissorTest,o=c(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(hx(e,e.SCISSOR_TEST,o),o){let r=c(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function U$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function O$(e,t){let n=t.depthTest,i=n.enabled;hx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function D$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function B$(e,t){e.depthMask(t.depthMask)}function Y$(e,t){e.stencilMask(t.stencilMask)}function uZe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function H$(e,t,n){let i=t.blending,o=c(n.blendingEnabled)?n.blendingEnabled:i.enabled;hx(e,e.BLEND,o),o&&(uZe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function z$(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 l=n.frontOperation,d=l.fail,u=l.zFail,f=l.zPass;e.stencilOpSeparate(e.FRONT,d,u,f);let p=n.backOperation,y=p.fail,h=p.zFail,g=p.zPass;e.stencilOpSeparate(e.BACK,y,h,g)}}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 mZe=new je;function J$(e,t,n){let i=t.viewport??n.viewport;c(i)||(i=mZe,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)}ah.apply=function(e,t,n){F$(e,t),A$(e,t),M$(e,t),N$(e,t),U$(e,t),O$(e,t),D$(e,t),B$(e,t),Y$(e,t),z$(e,t),K$(e,t),k$(e,t,n),H$(e,t,n),J$(e,t,n)};function fZe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(F$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(A$),e.lineWidth!==t.lineWidth&&n.push(M$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(N$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(U$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(O$),(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(D$),e.depthMask!==t.depthMask&&n.push(B$),e.stencilMask!==t.stencilMask&&n.push(Y$),(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(z$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(K$),n}ah.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];c(u)||(u=fZe(t,n),n._applyFunctions[t.id]=u);let f=u.length;for(let p=0;p0&&console.log(`${ch}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(r),c(l)&&l.length>0&&console.log(`${ch}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(s),c(l)&&l.length>0&&console.log(`${ch}Shader program link log: ${l}`)),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)?(l=e.getProgramInfoLog(s),console.error(`${ch}Shader program link log: ${l}`),f(o,"vertex"),f(r,"fragment"),d=`Program failed to link. Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${ch}Vertex shader compile log: ${l}`),console.error(`${ch} Vertex shader source: -${n}`),d=`Vertex shader failed to compile. Compile log: ${l}`):(l=e.getShaderInfoLog(r),console.error(`${ch}Fragment shader compile log: ${l}`),console.error(`${ch} Fragment shader source: -${i}`),d=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new le(d);function f(p,y){if(!c(u))return;let h=u.getTranslatedShaderSource(p);if(h===""){console.error(`${ch}${y} shader translation failed.`);return}console.error(`${ch}Translated ${y} shaderSource: -${h}`)}}function ZZe(e,t,n){let i={};for(let o=0;o=0){if(u=n[d.slice(0,h)],!c(u))continue;f=u._locations,f.length<=1&&(p=u.value,y=e.getUniformLocation(t,d),y!==null&&(f.push(y),p.push(e.getUniform(t,y))))}else{f=[];for(let g=0;g4)throw new L("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.values))throw new L("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ee=YZe;var MPt=_(T(),1);var wPt=_(T(),1);var pPt=_(T(),1);function eC(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(eC.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}}});eC.clone=function(e){if(c(e))return new eC(e._format,e._datatype,e._width,e._height,e._buffer)};eC.prototype.clone=function(){return eC.clone(this)};var yZ=eC;var ZPt=_(T(),1),Cee=_(cd(),1);function Vee(){if(!c(la._canTransferArrayBuffer)){let e=O3("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return la._canTransferArrayBuffer=!1,la._canTransferArrayBuffer}la._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=c(r)&&r[0]===t;i(s),e.terminate(),la._canTransferArrayBuffer=s}})}return la._canTransferArrayBuffer}var U3=new ye;function k3(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 O3(e){let t=new Cee.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=on(`${la._workerModulePrefix}/${i}.js`);F0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=k3(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${k3(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return r=k3(a),new Worker(r,o)}if(r=e,n||(r=on(`${la._workerModulePrefix+i}.js`)),!Ot.supportsEsmWebWorkers())throw new le("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function HZe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ot.supportsWebAssembly()){if(!c(t.fallbackModulePath))throw new le(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=on(t.fallbackModulePath),n}n.wasmBinaryFile=on(t.wasmBinaryFile);let i=await Ge.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function la(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var zZe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(c(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new le(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new L(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),U3.raiseEvent(s),i(s)}else U3.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},KZe=[];async function JZe(e,t,n){let i=await Promise.resolve(Vee());c(n)?i||(n.length=0):n=KZe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",zZe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:on.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function QZe(e,t,n){++e._activeTasks;try{let i=await JZe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}la.prototype.scheduleTask=function(e,t){if(c(this._worker)||(this._worker=O3(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return QZe(this,e,t)};la.prototype.initWebAssemblyModule=async function(e){if(c(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=O3(this._workerPath),i=await HZe(this,e),o=await Promise.resolve(Vee()),r,s=i.wasmBinary;c(s)&&o&&(r=[s]);let a=new Promise((l,d)=>{n.onmessage=function({data:u}){c(u)?l(u.result):d(new le("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};la.prototype.isDestroyed=function(){return!1};la.prototype.destroy=function(){return c(this._worker)&&this._worker.terminate(),he(this)};la.taskCompletedEvent=U3;la._defaultWorkerModulePrefix="Workers/";la._workerModulePrefix=la._defaultWorkerModulePrefix;la._canTransferArrayBuffer=void 0;var gi=la;function Rp(){}Rp._transcodeTaskProcessor=new gi("transcodeKTX2",Number.POSITIVE_INFINITY);Rp._readyPromise=void 0;function jZe(){let e=Rp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Rp._transcodeTaskProcessor;throw new le("KTX2 transcoder could not be initialized.")});Rp._readyPromise=e}Rp.transcode=function(e,t){return C.defined("supportedTargetFormats",t),c(Rp._readyPromise)||jZe(),Rp._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;rs.x&&m.clone(n,s),Fa.y&&m.clone(n,a),Nl.z&&m.clone(n,l)}let f=m.magnitudeSquared(m.subtract(s,i,da)),p=m.magnitudeSquared(m.subtract(a,o,da)),y=m.magnitudeSquared(m.subtract(l,r,da)),h=i,g=s,x=f;p>x&&(x=p,h=o,g=a),y>x&&(x=y,h=r,g=l);let S=q3;S.x=(h.x+g.x)*.5,S.y=(h.y+g.y)*.5,S.z=(h.z+g.z)*.5;let V=m.magnitudeSquared(m.subtract(g,S,da)),Z=Math.sqrt(V),R=$3;R.x=i.x,R.y=o.y,R.z=r.z;let E=eY;E.x=s.x,E.y=a.y,E.z=l.z;let I=m.midpoint(R,E,tY),v=0;for(u=0;uv&&(v=P);let F=m.magnitudeSquared(m.subtract(n,S,da));if(F>V){let N=Math.sqrt(F);Z=(Z+N)*.5,V=Z*Z;let b=N-Z;S.x=(Z*S.x+b*n.x)/N,S.y=(Z*S.y+b*n.y)/N,S.z=(Z*S.z+b*n.z)/N}}return Zl.x&&m.clone(o,l),bd.y&&m.clone(o,d),Gu.z&&m.clone(o,u)}let y=m.magnitudeSquared(m.subtract(l,r,da)),h=m.magnitudeSquared(m.subtract(d,s,da)),g=m.magnitudeSquared(m.subtract(u,a,da)),x=r,S=l,V=y;h>V&&(V=h,x=s,S=d),g>V&&(V=g,x=a,S=u);let Z=q3;Z.x=(x.x+S.x)*.5,Z.y=(x.y+S.y)*.5,Z.z=(x.z+S.z)*.5;let R=m.magnitudeSquared(m.subtract(S,Z,da)),E=Math.sqrt(R),I=$3;I.x=r.x,I.y=s.y,I.z=a.z;let v=eY;v.x=l.x,v.y=d.y,v.z=u.z;let P=m.midpoint(I,v,tY),F=0;for(p=0;pF&&(F=N);let b=m.magnitudeSquared(m.subtract(o,Z,da));if(b>R){let G=Math.sqrt(b);E=(E+G)*.5,R=E*E;let X=G-E;Z.x=(E*Z.x+X*o.x)/G,Z.y=(E*Z.y+X*o.y)/G,Z.z=(E*Z.z+X*o.z)/G}}return Ea.x&&m.clone(i,a),Nl.y&&m.clone(i,l),bd.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,da)),y=m.magnitudeSquared(m.subtract(l,r,da)),h=m.magnitudeSquared(m.subtract(d,s,da)),g=o,x=a,S=p;y>S&&(S=y,g=r,x=l),h>S&&(S=h,g=s,x=d);let V=q3;V.x=(g.x+x.x)*.5,V.y=(g.y+x.y)*.5,V.z=(g.z+x.z)*.5;let Z=m.magnitudeSquared(m.subtract(x,V,da)),R=Math.sqrt(Z),E=$3;E.x=o.x,E.y=r.y,E.z=s.z;let I=eY;I.x=a.x,I.y=l.y,I.z=d.z;let v=m.midpoint(E,I,tY),P=0;for(f=0;fP&&(P=F);let N=m.magnitudeSquared(m.subtract(i,V,da));if(N>Z){let b=Math.sqrt(N);R=(R+b)*.5,Z=R*R;let G=b-R;V.x=(R*V.x+G*i.x)/b,V.y=(R*V.y+G*i.y)/b,V.z=(R*V.z+G*i.z)/b}}return R=l+s)return e.clone(n),n;if(s>=l+o)return t.clone(n),n;let d=(o+l+s)*.5,u=m.multiplyByScalar(a,(-o+d)/l,dRe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var uRe=new m;pn.expand=function(e,t,n){C.typeOf.object("sphere",e),C.typeOf.object("point",t),n=pn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,uRe));return i>n.radius&&(n.radius=i),n};pn.intersectPlane=function(e,t){C.typeOf.object("sphere",e),C.typeOf.object("plane",t);let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?zt.OUTSIDE:rw.EPSILON6)throw new L("vector must be normalized.");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 o=n.x,r=n.y;n.x=(1-Math.abs(r))*w.signNotZero(o),n.y=(1-Math.abs(o))*w.signNotZero(r)}return n.x=w.toSNorm(n.x,t),n.y=w.toSNorm(n.y,t),n};go.octEncode=function(e,t){return go.octEncodeInRange(e,255,t)};var xZ=new D,Aee=new Uint8Array(1);function zN(e){return Aee[0]=e,Aee[0]}go.octEncodeToCartesian4=function(e,t){return go.octEncodeInRange(e,65535,xZ),t.x=zN(xZ.x*vee),t.y=zN(xZ.x),t.z=zN(xZ.y*vee),t.w=zN(xZ.y),t};go.octDecodeInRange=function(e,t,n,i){if(C.defined("result",i),e<0||e>n||t<0||t>n)throw new L(`x and y must be unsigned normalized integers between 0 and ${n}`);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)};go.octDecode=function(e,t,n){return go.octDecodeInRange(e,t,255,n)};go.octDecodeFromCartesian4=function(e,t){C.typeOf.object("encoded",e),C.typeOf.object("result",t);let n=e.x,i=e.y,o=e.z,r=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||r<0||r>255)throw new L("x, y, z, and w must be unsigned normalized integers between 0 and 255");let s=n*Fee+i,a=o*Fee+r;return go.octDecodeInRange(s,a,65535,t)};go.octPackFloat=function(e){return C.defined("encoded",e),256*e.x+e.y};var oY=new D;go.octEncodeFloat=function(e){return go.octEncode(e,oY),go.octPackFloat(oY)};go.octDecodeFloat=function(e,t){C.defined("value",e);let n=e/256,i=Math.floor(n),o=(n-i)*256;return go.octDecode(i,o,t)};go.octPack=function(e,t,n,i){C.defined("v1",e),C.defined("v2",t),C.defined("v3",n),C.defined("result",i);let o=go.octEncodeFloat(e),r=go.octEncodeFloat(t),s=go.octEncode(n,oY);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};go.octUnpack=function(e,t,n,i){C.defined("packed",e),C.defined("v1",t),C.defined("v2",n),C.defined("v3",i);let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),l=(o-a)*65536;go.octDecodeFloat(s,t),go.octDecodeFloat(l,n),go.octDecode(r,a,i)};go.compressTextureCoordinates=function(e){C.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};go.decompressTextureCoordinates=function(e,t){C.defined("compressed",e),C.defined("result",t);let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function iY(e){return e>>1^-(e&1)}go.zigZagDeltaDecode=function(e,t,n){C.defined("uBuffer",e),C.defined("vBuffer",t),C.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),c(n)&&C.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let i=e.length,o=0,r=0,s=0;for(let a=0;a>11,f=d>>5&r,p=d&o,y=3*l;t[y]=u*s,t[y+1]=f*a,t[y+2]=p*s}return t};var Fn=go;var q2t=_(T(),1);var Mee=new m,Nee=new m,kee=new m;function SRe(e,t,n,i,o){C.defined("point",e),C.defined("p0",t),C.defined("p1",n),C.defined("p2",i),c(o)||(o=new m);let r,s,a,l,d,u,f,p;if(c(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,Mee),s=m.subtract(i,t,Nee),a=m.subtract(e,t,kee),l=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),f=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,Mee),s=D.subtract(i,t,Nee),a=D.subtract(e,t,kee),l=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),f=D.dot(s,s),p=D.dot(s,a)}o.y=f*u-d*p,o.z=l*p-d*u;let y=l*f-d*d;if(y!==0)return o.y/=y,o.z/=y,o.x=1-o.y-o.z,o}var px=SRe;var ivt=_(T(),1);function lh(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}lh.encode=function(e,t){C.typeOf.number("value",e),c(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 Gp={high:0,low:0};lh.fromCartesian=function(e,t){C.typeOf.object("cartesian",e),c(t)||(t=new lh);let n=t.high,i=t.low;return lh.encode(e.x,Gp),n.x=Gp.high,i.x=Gp.low,lh.encode(e.y,Gp),n.y=Gp.high,i.y=Gp.low,lh.encode(e.z,Gp),n.z=Gp.high,i.z=Gp.low,t};var rY=new lh;lh.writeElements=function(e,t,n){C.defined("cartesianArray",t),C.typeOf.number("index",n),C.typeOf.number.greaterThanOrEquals("index",n,0),lh.fromCartesian(e,rY);let i=rY.high,o=rY.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 Bn=lh;var Pvt=_(T(),1);var avt=_(T(),1);var sY={};sY.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");return t*t-4*e*n};function Uee(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)))d&&d/l0?[a/e,n/a]:[n/a,a/e]};var Fc=sY;var yvt=_(T(),1);var uvt=_(T(),1);var cY={};cY.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");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 aY(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,l=o*s,d=r*a,u=r*r,f=s*s,p=o*s-u,y=o*a-r*s,h=r*a-f,g=4*p*h-y*y,x,S;if(g<0){let K,Q,ie;u*d>=l*f?(K=o,Q=p,ie=-2*r*p+o*y):(K=a,Q=h,ie=-a*y+2*s*h);let $=-(ie<0?-1:1)*Math.abs(K)*Math.sqrt(-g);S=-ie+$;let ne=S/2,be=ne<0?-Math.pow(-ne,1/3):Math.pow(ne,1/3),Ce=S===$?-be:-Q/be;return x=Q<=0?be+Ce:-ie/(be*be+Ce*Ce+Q),u*d>=l*f?[(x-r)/o]:[-a/(x+s)]}let V=p,Z=-2*r*p+o*y,R=h,E=-a*y+2*s*h,I=Math.sqrt(g),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-Z)/3);x=2*Math.sqrt(-V);let F=Math.cos(P);S=x*F;let N=x*(-F/2-v*Math.sin(P)),b=S+N>2*r?S-r:N-r,G=o,X=b/G;P=Math.abs(Math.atan2(a*I,-E)/3),x=2*Math.sqrt(-R),F=Math.cos(P),S=x*F,N=x*(-F/2-v*Math.sin(P));let W=-a,A=S+N<2*s?S+s:N+s,k=W/A,B=G*A,O=-b*A-G*W,H=b*W,U=(s*O-r*H)/(-r*O+s*B);return X<=U?X<=k?U<=k?[X,U,k]:[X,k,U]:[k,X,U]:X<=k?[U,X,k]:U<=k?[U,k,X]:[k,U,X]}cY.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");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 aY(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):aY(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 aY(e,t,n,i)};var bx=cY;var lY={};lY.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");if(typeof o!="number")throw new L("e is a required number.");let r=e*e,s=r*e,a=t*t,l=a*t,d=n*n,u=d*n,f=i*i,p=f*i,y=o*o,h=y*o;return a*d*f-4*l*p-4*e*u*f+18*e*t*n*p-27*r*f*f+256*s*h+o*(18*l*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*f+144*r*n*f)+y*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Xm(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,l=bx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(l.length>0){let d=-e/4,u=l[l.length-1];if(Math.abs(u)=0&&y>=0){let g=Math.sqrt(p),x=Math.sqrt(y);return[d-x,d-g,d+g,d+x]}else{if(p>=0&&y<0)return h=Math.sqrt(p),[d-h,d+h];if(p<0&&y>=0)return h=Math.sqrt(y),[d-h,d+h]}}return[]}else if(u>0){let f=Math.sqrt(u),p=(r+u-s/f)/2,y=(r+u+s/f)/2,h=Fc.computeRealRoots(1,f,p),g=Fc.computeRealRoots(1,-f,y);return h.length!==0?(h[0]+=d,h[1]+=d,g.length!==0?(g[0]+=d,g[1]+=d,h[1]<=g[0]?[h[0],h[1],g[0],g[1]]:g[1]<=h[0]?[g[0],g[1],h[0],h[1]]:h[0]>=g[0]&&h[1]<=g[1]?[g[0],h[0],h[1],g[1]]:g[0]>=h[0]&&g[1]<=h[1]?[h[0],g[0],g[1],h[1]]:h[0]>g[0]&&h[0]0){let f=u[0],p=t-f,y=p*p,h=e/2,g=p/2,x=y-4*i,S=y+4*Math.abs(i),V=s-4*f,Z=s+4*Math.abs(f),R,E;if(f<0||x*Z=b[0]&&N[1]<=b[1]?[b[0],N[0],N[1],b[1]]:b[0]>=N[0]&&b[1]<=N[1]?[N[0],b[0],b[1],N[1]]:N[0]>b[0]&&N[0]u)||(p=m.cross(f,a,Dee),h=m.dot(s,p),h<0||y+h>u))return;g=m.dot(l,p)/u}else{if(Math.abs(u)1||(p=m.cross(f,a,Dee),h=m.dot(s,p)*x,h<0||y+h>1))return;g=m.dot(l,p)*x}return g};No.rayTriangle=function(e,t,n,i,o,r){let s=No.rayTriangleParametric(e,t,n,i,o);if(!(!c(s)||s<0))return c(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var LRe=new bn;No.lineSegmentTriangle=function(e,t,n,i,o,r,s){if(!c(e))throw new L("v0 is required.");if(!c(t))throw new L("v1 is required.");if(!c(n))throw new L("p0 is required.");if(!c(i))throw new L("p1 is required.");if(!c(o))throw new L("p2 is required.");let a=LRe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let l=No.rayTriangleParametric(a,n,i,o,r);if(!(!c(l)||l<0||l>m.distance(e,t)))return c(s)||(s=new m),m.multiplyByScalar(a.direction,l,s),m.add(a.origin,s,s)};function ZRe(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),l=(-t+a)*s,d=(-t-a)*s;return ls))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var ERe=new m,XRe=new m;No.rayEllipsoid=function(e,t){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("ellipsoid is required.");let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,ERe),o=m.multiplyComponents(n,e.direction,XRe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,l,d,u,f;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,l=m.magnitudeSquared(o),d=l*a,pd){u=s*s-d,f=-s+Math.sqrt(u);let h=f/l,g=a/f;return h0?y.push(new m(i,o*F,o*-G)):G!==0?(y.push(new m(i,o*F,o*-G)),y.push(new m(i,o*F,o*G)),++P):y.push(new m(i,o*F,o*G))}return y};var dY=new m,Bee=new m,Yee=new m,JN=new m,IRe=new m,WRe=new te,wRe=new te,PRe=new te,vRe=new te,FRe=new te,Hee=new te,zee=new te,Kee=new m,ARe=new m,MRe=new pe;No.grazingAltitudeLocation=function(e,t){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("ellipsoid is required.");let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,dY);if(m.dot(i,I)>=0)return n}let o=c(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,dY),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,JN),l=m.normalize(m.cross(a,s,Bee),Bee),d=m.normalize(m.cross(s,l,Yee),Yee),u=WRe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=l.x,u[4]=l.y,u[5]=l.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let f=te.transpose(u,wRe),p=te.fromScale(t.radii,PRe),y=te.fromScale(t.oneOverRadii,vRe),h=FRe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let g=te.multiply(te.multiply(f,y,Hee),h,Hee),x=te.multiply(te.multiply(g,p,zee),u,zee),S=te.multiplyByVector(g,n,IRe),V=No.quadraticVectorExpression(x,m.negate(S,dY),0,0,1),Z,R,E=V.length;if(E>0){let I=m.clone(m.ZERO,ARe),v=Number.NEGATIVE_INFINITY;for(let F=0;Fv&&(v=b,I=m.clone(Z,I))}let P=t.cartesianToCartographic(I,MRe);return v=w.clamp(v,0,1),R=m.magnitude(m.subtract(I,n,JN))*Math.sqrt(1-v*v),R=o?-R:R,P.height=R,t.cartographicToCartesian(P,new m)}};var NRe=new m;No.lineSegmentPlane=function(e,t,n,i){if(!c(e))throw new L("endPoint0 is required.");if(!c(t))throw new L("endPoint1 is required.");if(!c(n))throw new L("plane is required.");c(i)||(i=new m);let o=m.subtract(t,e,NRe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)1))return m.multiplyByScalar(o,l,i),m.add(e,i,i),i};No.trianglePlaneIntersection=function(e,t,n,i){if(!c(e)||!c(t)||!c(n)||!c(i))throw new L("p0, p1, p2, and plane are required.");let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,l=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=l?1:0;let u,f;if((d===1||d===2)&&(u=new m,f=new m),d===1){if(s)return No.lineSegmentPlane(e,t,i,u),No.lineSegmentPlane(e,n,i,f),{positions:[e,t,n,u,f],indices:[0,3,4,1,2,4,1,4,3]};if(a)return No.lineSegmentPlane(t,n,i,u),No.lineSegmentPlane(t,e,i,f),{positions:[e,t,n,u,f],indices:[1,3,4,2,0,4,2,4,3]};if(l)return No.lineSegmentPlane(n,e,i,u),No.lineSegmentPlane(n,t,i,f),{positions:[e,t,n,u,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!l)return No.lineSegmentPlane(e,n,i,u),No.lineSegmentPlane(t,n,i,f),{positions:[e,t,n,u,f],indices:[0,1,4,0,4,3,2,3,4]}}else return No.lineSegmentPlane(n,t,i,u),No.lineSegmentPlane(e,t,i,f),{positions:[e,t,n,u,f],indices:[2,0,4,2,4,3,1,3,4]};else return No.lineSegmentPlane(t,e,i,u),No.lineSegmentPlane(n,e,i,f),{positions:[e,t,n,u,f],indices:[1,2,4,1,4,3,0,3,4]}};var qn=No;var Dvt=_(T(),1);function As(e,t){if(C.typeOf.object("normal",e),!w.equalsEpsilon(m.magnitude(e),1,w.EPSILON6))throw new L("normal must be normalized.");C.typeOf.number("distance",t),this.normal=m.clone(e),this.distance=t}As.fromPointNormal=function(e,t,n){if(C.typeOf.object("point",e),C.typeOf.object("normal",t),!w.equalsEpsilon(m.magnitude(t),1,w.EPSILON6))throw new L("normal must be normalized.");let i=-m.dot(t,e);return c(n)?(m.clone(t,n.normal),n.distance=i,n):new As(t,i)};var kRe=new m;As.fromCartesian4=function(e,t){C.typeOf.object("coefficients",e);let n=m.fromCartesian4(e,kRe),i=e.w;if(!w.equalsEpsilon(m.magnitude(n),1,w.EPSILON6))throw new L("normal must be normalized.");return c(t)?(m.clone(n,t.normal),t.distance=i,t):new As(n,i)};As.getPointDistance=function(e,t){return C.typeOf.object("plane",e),C.typeOf.object("point",t),m.dot(e.normal,t)+e.distance};var URe=new m;As.projectPointOntoPlane=function(e,t,n){C.typeOf.object("plane",e),C.typeOf.object("point",t),c(n)||(n=new m);let i=As.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,URe);return m.subtract(t,o,n)};var ORe=new M,DRe=new ce,BRe=new m;As.transform=function(e,t,n){C.typeOf.object("plane",e),C.typeOf.object("transform",t);let i=e.normal,o=e.distance,r=M.inverseTranspose(t,ORe),s=ce.fromElements(i.x,i.y,i.z,o,DRe);s=M.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,BRe);return s=ce.divideByScalar(s,m.magnitude(a),s),As.fromCartesian4(s,n)};As.clone=function(e,t){return C.typeOf.object("plane",e),c(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new As(e.normal,e.distance)};As.equals=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),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 cn=As;var Kvt=_(T(),1);var uY={};uY.calculateACMR=function(e){e=e??z.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24;if(!c(t))throw new L("indices is required.");let o=t.length;if(o<3||o%3!==0)throw new L("indices length must be a multiple of three.");if(n<=0)throw new L("maximumIndex must be greater than zero.");if(i<3)throw new L("cacheSize must be greater than two.");if(!c(n)){n=0;let a=0,l=t[a];for(;an&&(n=l),++a,l=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};uY.tipsify=function(e){e=e??z.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(b,G,X,W){for(;G.length>=1;){let A=G[G.length-1];if(G.splice(G.length-1,1),b[A].numLiveTriangles>0)return A}for(;o0)return++o,o-1;++o}return-1}function s(b,G,X,W,A,k,B){let O=-1,H,U=-1,K=0;for(;KU||U===-1)&&(U=H,O=Q)),++K}return O===-1?r(W,k,b,B):O}if(!c(t))throw new L("indices is required.");let a=t.length;if(a<3||a%3!==0)throw new L("indices length must be a multiple of three.");if(n<=0)throw new L("maximumIndex must be greater than zero.");if(i<3)throw new L("cacheSize must be greater than two.");let l=0,d=0,u=t[d],f=a;if(c(n))l=n+1;else{for(;dl&&(l=u),++d,u=t[d];if(l===-1)return 0;++l}let p=[],y;for(y=0;yi&&(Z.timeStamp=x,++x),++d}g=s(t,i,S,p,x,V,l)}return I};var SZ=uY;var Ac={};function n5(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function YRe(e){let t=e.length,n=t/3*6,i=Me.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Me.createTypedArray(t,n);n5(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Me.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=SZ.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function jee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){let i=e[n];t[n]=new Ee({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function KRe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];for(let r=0;r=w.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=jee(e.attributes),a=e.indices,l=a.length,d;e.primitiveType===ve.TRIANGLES?d=3:e.primitiveType===ve.LINES?d=2:e.primitiveType===ve.POINTS&&(d=1);for(let u=0;u=w.SIXTY_FOUR_KILOBYTES&&(t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=jee(e.attributes))}o.length!==0&&t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var qee=new m,JRe=new pe;Ac.projectTo2D=function(e,t,n,i,o){if(!c(e))throw new L("geometry is required.");if(!c(t))throw new L("attributeName is required.");if(!c(n))throw new L("attributeName3D is required.");if(!c(i))throw new L("attributeName2D is required.");if(!c(e.attributes[t]))throw new L(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==q.DOUBLE)throw new L("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t];o=c(o)?o:new Xi;let s=o.ellipsoid,a=r.values,l=new Float64Array(a.length),d=0;for(let u=0;ux&&(x=V)}return new dt({attributes:u,indices:h,primitiveType:d,boundingSphere:c(g)?new ue(g,x):void 0})}Ac.combineInstances=function(e){if(!c(e)||e.length<1)throw new L("instances is required and must have length greater than zero.");let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(pY(t,"geometry")),n.length>0&&(o.push(pY(n,"westHemisphereGeometry")),o.push(pY(n,"eastHemisphereGeometry"))),o};var gu=new m,CZ=new m,tC=new m,nC=new m;Ac.computeNormal=function(e){if(!c(e))throw new L("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new L("geometry.attributes.position.values is required.");if(!c(e.indices))throw new L("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new L("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==ve.TRIANGLES)throw new L("geometry.primitiveType must be PrimitiveType.TRIANGLES.");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),l=new Array(r),d;for(d=0;d0){for(u=0;u3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?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 nte=new m;function xu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,nte),e.y/(e.y-t.y),nte),n),m.clone(n,i),U0(n,!0),U0(i,!1)}var gx=new m,xx=new m,_x=new m,Tx=new m,bY={positions:new Array(7),indices:new Array(3*3)};function cGe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;aGe(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=bY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(xu(e,t,gx,_x),xu(e,n,xx,Tx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(xu(t,n,gx,_x),xu(t,e,xx,Tx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(xu(n,e,gx,_x),xu(n,t,xx,Tx),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||(xu(n,e,gx,_x),xu(n,t,xx,Tx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(xu(t,n,gx,_x),xu(t,e,xx,Tx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(xu(e,t,gx,_x),xu(e,n,xx,Tx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let l=bY.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(s===1||s===2)&&(l[3]=gx,l[4]=xx,l[5]=_x,l[6]=Tx,l.length=7),bY}function ite(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){let r=n[o];r.values=q.createTypedArray(r.componentDatatype,r.values)}let i=dt.computeNumberOfVertices(e);return e.indices=Me.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function oC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];n[i]=new Ee({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new dt({attributes:n,indices:[],primitiveType:e.primitiveType})}function _Y(e,t,n){let i=c(e.geometry.boundingSphere);t=ite(t,i),n=ite(n,i),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function TY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,l,d,u,f,p){let y=e.fromArray(d,r*t,n),h=e.fromArray(d,s*t,i),g=e.fromArray(d,a*t,o);e.multiplyByScalar(y,l.x,y),e.multiplyByScalar(h,l.y,h),e.multiplyByScalar(g,l.z,g);let x=e.add(y,h,y);e.add(x,g,x),p&&e.normalize(x,x),e.pack(x,u,f*t)}}var lGe=TY(ce,4),t5=TY(m,3),lte=TY(D,2),dGe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,l=o[t]*i.y,d=o[n]*i.z;r[s]=a+l+d>w.EPSILON6?1:0},LZ=new m,yY=new m,gY=new m,uGe=new m;function $N(e,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g){if(!c(r)&&!c(s)&&!c(a)&&!c(l)&&!c(d)&&y===0)return;let x=m.fromArray(o,e*3,LZ),S=m.fromArray(o,t*3,yY),V=m.fromArray(o,n*3,gY),Z=px(i,x,S,V,uGe);if(c(Z)){if(c(r)&&t5(e,t,n,Z,r,f.normal.values,g,!0),c(d)){let R=m.fromArray(d,e*3,LZ),E=m.fromArray(d,t*3,yY),I=m.fromArray(d,n*3,gY);m.multiplyByScalar(R,Z.x,R),m.multiplyByScalar(E,Z.y,E),m.multiplyByScalar(I,Z.z,I);let v;!m.equals(R,m.ZERO)||!m.equals(E,m.ZERO)||!m.equals(I,m.ZERO)?(v=m.add(R,E,R),m.add(v,I,v),m.normalize(v,v)):(v=LZ,v.x=0,v.y=0,v.z=0),m.pack(v,f.extrudeDirection.values,g*3)}if(c(u)&&dGe(e,t,n,Z,u,f.applyOffset.values,g),c(s)&&t5(e,t,n,Z,s,f.tangent.values,g,!0),c(a)&&t5(e,t,n,Z,a,f.bitangent.values,g,!0),c(l)&<e(e,t,n,Z,l,f.st.values,g),y>0)for(let R=0;R3){let W=X.positions,A=X.indices,k=A.length;for(let B=0;B0)continue;let l=m.unpack(i,s,mte);(a.y<0&&l.y>0||a.y>0&&l.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,xY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||ue.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==zt.INTERSECTING))return e;if(t.geometryType!==yu.NONE)switch(t.geometryType){case yu.POLYLINES:TGe(e);break;case yu.TRIANGLES:ote(e);break;case yu.LINES:rte(e);break}else sGe(t),t.primitiveType===ve.TRIANGLES?ote(e):t.primitiveType===ve.LINES&&rte(e);return e};var An=Ac;var RFt=_(T(),1);function ZZ(e,t,n,i,o,r,s,a,l,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=l,this._flipY=d,this._initialized=u}Object.defineProperties(ZZ.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});ZZ.prototype.copyFrom=function(e){C.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(C.defined("options.source",i),C.typeOf.number.greaterThanOrEquals("xOffset",t,0),C.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new L("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new L("yOffset + options.source.height must be less than or equal to height.");let{width:r,height:s}=i,a=this._context._gl,l=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture);let u=i.arrayBufferView,f=this._size,p=this._pixelFormat,y=this._internalFormat,h=this._pixelDatatype,g=this._preMultiplyAlpha,x=this._flipY,S=4;c(u)&&(S=ke.alignmentInBytes(p,h,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,S),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 Z;t===0&&n===0&&r===f&&s===f?(c(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ke.flipY(u,p,h,f,f)),Z=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),Z=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Z=ke.createTypedArray(p,h,f,f)),a.texImage2D(d,0,y,f,f,0,p,Ue.toWebGLConstant(h,this._context),Z),this._initialized=!0}V||(c(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ke.flipY(u,p,h,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,Ue.toWebGLConstant(h,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),a.texSubImage2D(d,0,t,n,p,Ue.toWebGLConstant(h,this._context),i))),a.bindTexture(l,null)};ZZ.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size,C.typeOf.number.greaterThanOrEquals("xOffset",e,0),C.typeOf.number.greaterThanOrEquals("yOffset",t,0),C.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),C.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new L("xOffset + source.width must be less than or equal to width.");if(t+r>this._size)throw new L("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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};ZZ.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){if(e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0,C.typeOf.number.greaterThanOrEquals("xOffset",e,0),C.typeOf.number.greaterThanOrEquals("yOffset",t,0),e+n>this._size)throw new L("xOffset + source.width must be less than or equal to width.");if(t+i>this._size)throw new L("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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 RZ=ZZ;var XFt=_(T(),1);var i5={DONT_CARE:oe.DONT_CARE,FASTEST:oe.FASTEST,NICEST:oe.NICEST,validate:function(e){return e===i5.DONT_CARE||e===i5.FASTEST||e===i5.NICEST}},_u=Object.freeze(i5);var KFt=_(T(),1);var wFt=_(T(),1);var o5={NEAREST:oe.NEAREST,LINEAR:oe.LINEAR};o5.validate=function(e){return e===o5.NEAREST||e===o5.LINEAR};var di=Object.freeze(o5);var FFt=_(T(),1);var O0={NEAREST:oe.NEAREST,LINEAR:oe.LINEAR,NEAREST_MIPMAP_NEAREST:oe.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:oe.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:oe.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:oe.LINEAR_MIPMAP_LINEAR};O0.validate=function(e){return e===O0.NEAREST||e===O0.LINEAR||e===O0.NEAREST_MIPMAP_NEAREST||e===O0.LINEAR_MIPMAP_NEAREST||e===O0.NEAREST_MIPMAP_LINEAR||e===O0.LINEAR_MIPMAP_LINEAR};var Jt=Object.freeze(O0);var NFt=_(T(),1);var r5={CLAMP_TO_EDGE:oe.CLAMP_TO_EDGE,REPEAT:oe.REPEAT,MIRRORED_REPEAT:oe.MIRRORED_REPEAT,validate:function(e){return e===r5.CLAMP_TO_EDGE||e===r5.REPEAT||e===r5.MIRRORED_REPEAT}},xn=Object.freeze(r5);function GZ(e){e=e??z.EMPTY_OBJECT;let{wrapS:t=xn.CLAMP_TO_EDGE,wrapT:n=xn.CLAMP_TO_EDGE,minificationFilter:i=Jt.LINEAR,magnificationFilter:o=di.LINEAR,maximumAnisotropy:r=1}=e;if(!xn.validate(t))throw new L("Invalid sampler.wrapS.");if(!xn.validate(n))throw new L("Invalid sampler.wrapT.");if(!Jt.validate(i))throw new L("Invalid sampler.minificationFilter.");if(!di.validate(o))throw new L("Invalid sampler.magnificationFilter.");C.typeOf.number.greaterThanOrEquals("maximumAnisotropy",r,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(GZ.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}}});GZ.equals=function(e,t){return e===t||c(e)&&c(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};GZ.NEAREST=Object.freeze(new GZ({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST}));var en=GZ;var lAt=_(T(),1);function SGe(e,t,n,i){let o=c(t.vertexBuffer),r=c(t.value),s=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!r)throw new L("attribute must have a vertexBuffer or a value.");if(o&&r)throw new L("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(s!==1&&s!==2&&s!==3&&s!==4)throw r?new L("attribute.value.length must be in the range [1, 4]."):new L("attribute.componentsPerAttribute must be in the range [1, 4].");if(c(t.componentDatatype)&&!q.validate(t.componentDatatype))throw new L("attribute must have a valid componentDatatype or not specify it.");if(c(t.strideInBytes)&&t.strideInBytes>255)throw new L("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new L("instanced arrays is not supported");if(c(t.instanceDivisor)&&t.instanceDivisor<0)throw new L("attribute must have an instanceDivisor greater than or equal to zero");if(c(t.instanceDivisor)&&r)throw new L("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new L("attribute zero cannot have an instanceDivisor greater than 0");let a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??q.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(l){let d=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(l){}}e.push(a)}function hte(e,t,n){for(let i=0;i0&&(l=!0),c(s[r].value)&&(d=!0);let f={};for(r=0;r0)for(r=fte(e[o[0]]),t=1;t0){let d=q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let f=r*a,p=new ArrayBuffer(f),y={};for(t=0;t=w.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=_t.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:Me.UNSIGNED_INT}):p=_t.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:Me.UNSIGNED_SHORT})),new Ep({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Ep.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ep.prototype.getAttribute=function(e){return C.defined("index",e),this._attributes[e]};function LGe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=mt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function ZGe(e,t){let n=e._attributes,i=n.length;for(let o=0;oc(n[Z])))throw new L(`options.source requires faces ${Object.values(So.FaceName).join(", ")}.`);({width:d,height:u}=n.positiveX);for(let Z of So.faceNames()){let R=n[Z];if(Number(R.width)!==d||Number(R.height)!==u)throw new L("Each face in options.source must have the same width and height.")}}let f=d;if(!c(d)||!c(u))throw new L("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(d!==u)throw new L("Width must equal height.");if(f<=0)throw new L("Width and height must be greater than zero.");if(f>mt.maximumCubeMapSize)throw new L(`Width and height must be less than or equal to the maximum cube map size (${mt.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ke.validate(i))throw new L("Invalid options.pixelFormat.");if(ke.isDepthFormat(i))throw new L("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Ue.validate(o))throw new L("Invalid options.pixelDatatype.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new L("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new L("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let p=ke.textureSizeInBytes(i,o,f,f)*6,y=ke.toInternalFormat(i,o,t),h=t._gl,g=h.TEXTURE_CUBE_MAP,x=h.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g,this._texture=x,this._pixelFormat=i,this._pixelDatatype=o,this._size=f,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=l,this._flipY=r;let S=c(n);function V(Z){return new RZ(t,x,g,Z,y,i,o,f,l,r,S)}this._positiveX=V(h.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=V(h.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=V(h.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=V(h.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=V(h.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=V(h.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,pte(this,a),h.activeTexture(h.TEXTURE0),h.bindTexture(g,x),s?h.pixelStorei(h.UNPACK_COLORSPACE_CONVERSION_WEBGL,h.NONE):h.pixelStorei(h.UNPACK_COLORSPACE_CONVERSION_WEBGL,h.BROWSER_DEFAULT_WEBGL);for(let Z of So.faceNames())SY(this[Z],n?.[Z],0);h.bindTexture(g,null)}So.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Fr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};So.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*RGe(){yield So.FaceName.POSITIVEX,yield So.FaceName.NEGATIVEX,yield So.FaceName.POSITIVEY,yield So.FaceName.NEGATIVEY,yield So.FaceName.POSITIVEZ,yield So.FaceName.NEGATIVEZ}So.faceNames=function(){return RGe()};function SY(e,t,n){n=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,l=e._flipY,d=e._preMultiplyAlpha,u=e._context,f=u._gl;if(!c(t)){f.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,y=4;c(p)&&(y=ke.alignmentInBytes(r,s,o)),f.pixelStorei(f.UNPACK_ALIGNMENT,y),c(p)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),l&&(p=ke.flipY(p,r,s,o,o)),f.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,u),p)):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,l),f.texImage2D(i,n,a,r,Ue.toWebGLConstant(s,u),t))}So.loadFace=SY;Object.defineProperties(So.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){pte(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}}});So.getDirection=function(e,t){switch(e){case So.FaceName.POSITIVEX:return m.clone(m.UNIT_X,t);case So.FaceName.NEGATIVEX:return m.negate(m.UNIT_X,t);case So.FaceName.POSITIVEY:return m.clone(m.UNIT_Y,t);case So.FaceName.NEGATIVEY:return m.negate(m.UNIT_Y,t);case So.FaceName.POSITIVEZ:return m.clone(m.UNIT_Z,t);case So.FaceName.NEGATIVEZ:return m.negate(m.UNIT_Z,t)}};function pte(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===Ue.FLOAT&&!r.textureFloatLinear||s===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Jt.NEAREST_MIPMAP_NEAREST:Jt.NEAREST,i=di.NEAREST);let a=r._gl,l=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,e._texture),a.texParameteri(l,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(l,a.TEXTURE_MAG_FILTER,i),a.texParameteri(l,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(l,a.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&a.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(l,null)}So.prototype.loadMipmaps=function(e,t){if(C.defined("source",e),!Array.isArray(e))throw new L("source must be an array");let n=Math.log2(this._size);if(e.length!==n)throw new L("all mip levels must be defined");t=t??!1;let i=this._context._gl,o=this._texture,r=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(r,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let s=0;s1&&!w.isPowerOfTwo(this._size))throw new L("width and height must be a power of two to call generateMipmap().");if(!_u.validate(e))throw new L("hint is invalid.");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)};So.createVertexArray=function(e){let t=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:We.POSITION_ONLY})),n=this._attributeLocations=An.createAttributeLocations(t);return ni.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW})};So.prototype.isDestroyed=function(){return!1};So.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=he(this._positiveX),this._negativeX=he(this._negativeX),this._positiveY=he(this._positiveY),this._negativeY=he(this._negativeY),this._positiveZ=he(this._positiveZ),this._negativeZ=he(this._negativeZ),he(this)};var Uo=So;var PAt=_(T(),1);function GGe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=GGe;var GDt=_(T(),1);var SDt=_(T(),1);var mDt=_(T(),1);var FAt=_(T(),1),EZ=`const float czm_degreesPerRadian = 57.29577951308232; -`;var MAt=_(T(),1),XZ=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var kAt=_(T(),1),IZ=`const float czm_epsilon1 = 0.1; -`;var OAt=_(T(),1),WZ=`const float czm_epsilon2 = 0.01; -`;var BAt=_(T(),1),wZ=`const float czm_epsilon3 = 0.001; -`;var HAt=_(T(),1),PZ=`const float czm_epsilon4 = 0.0001; -`;var KAt=_(T(),1),vZ=`const float czm_epsilon5 = 0.00001; -`;var QAt=_(T(),1),FZ=`const float czm_epsilon6 = 0.000001; -`;var qAt=_(T(),1),AZ=`const float czm_epsilon7 = 0.0000001; -`;var e9t=_(T(),1),MZ=`const float czm_infinity = 5906376272000.0; -`;var n9t=_(T(),1),NZ=`const float czm_oneOverPi = 0.3183098861837907; -`;var o9t=_(T(),1),kZ=`const float czm_oneOverTwoPi = 0.15915494309189535; -`;var s9t=_(T(),1),UZ=`const float czm_passCesium3DTile = 4.0; -`;var c9t=_(T(),1),OZ=`const float czm_passCesium3DTileClassification = 5.0; -`;var d9t=_(T(),1),DZ=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var m9t=_(T(),1),BZ=`const float czm_passClassification = 7.0; -`;var h9t=_(T(),1),YZ=`const float czm_passCompute = 1.0; -`;var b9t=_(T(),1),HZ=`const float czm_passEnvironment = 0.0; -`;var g9t=_(T(),1),zZ=`const float czm_passGlobe = 2.0; -`;var _9t=_(T(),1),KZ=`const float czm_passOpaque = 7.0; -`;var S9t=_(T(),1),JZ=`const float czm_passOverlay = 10.0; -`;var V9t=_(T(),1),QZ=`const float czm_passTerrainClassification = 3.0; -`;var Z9t=_(T(),1),jZ=`const float czm_passTranslucent = 8.0; -`;var G9t=_(T(),1),qZ=`const float czm_passVoxels = 9.0; -`;var X9t=_(T(),1),$Z=`const float czm_pi = 3.141592653589793; -`;var W9t=_(T(),1),eR=`const float czm_piOverFour = 0.7853981633974483; -`;var P9t=_(T(),1),tR=`const float czm_piOverSix = 0.5235987755982988; -`;var F9t=_(T(),1),nR=`const float czm_piOverThree = 1.0471975511965976; -`;var M9t=_(T(),1),iR=`const float czm_piOverTwo = 1.5707963267948966; -`;var k9t=_(T(),1),oR=`const float czm_radiansPerDegree = 0.017453292519943295; -`;var O9t=_(T(),1),rR=`const float czm_sceneMode2D = 2.0; -`;var B9t=_(T(),1),sR=`const float czm_sceneMode3D = 3.0; -`;var H9t=_(T(),1),aR=`const float czm_sceneModeColumbusView = 1.0; -`;var K9t=_(T(),1),cR=`const float czm_sceneModeMorphing = 0.0; -`;var Q9t=_(T(),1),lR=`const float czm_solarRadius = 695500000.0; -`;var q9t=_(T(),1),dR=`const float czm_threePiOver2 = 4.71238898038469; -`;var eMt=_(T(),1),uR=`const float czm_twoPi = 6.283185307179586; -`;var nMt=_(T(),1),mR=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var oMt=_(T(),1),fR=`struct czm_depthRangeStruct -{ -float near; -float far; -}; -`;var sMt=_(T(),1),hR=`struct czm_material +`;var z8t=x(T(),1),dG=`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() { -vec3 diffuse; -float specular; -float shininess; -vec3 normal; -vec3 emission; -float alpha; -}; -`;var cMt=_(T(),1),pR=`struct czm_materialInput +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_tangentEC = czm_normal * tangent; +v_bitangentEC = czm_normal * bitangent; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var K8t=x(T(),1),uG=`in vec3 v_positionEC; +in vec3 v_normalEC; +void main() { -float s; -vec2 st; -vec3 str; -vec3 normalEC; -mat3 tangentToEyeMatrix; -vec3 positionToEyeEC; -float height; -float slope; -float aspect; -float waterMask; -}; -`;var dMt=_(T(),1),bR=`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; +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); #endif -#ifdef USE_CLEARCOAT -float clearcoatFactor; -float clearcoatRoughness; -vec3 clearcoatNormal; +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 mMt=_(T(),1),yR=`struct czm_modelVertexOutput { -vec3 positionMC; -float pointSize; -}; -`;var hMt=_(T(),1),gR=`struct czm_ray -{ -vec3 origin; -vec3 direction; -}; -`;var bMt=_(T(),1),xR=`struct czm_raySegment +} +`;var j8t=x(T(),1),mG=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +void main() { -float start; -float stop; -}; -const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); -const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var gMt=_(T(),1),_R=`struct czm_shadowParameters +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var q8t=x(T(),1),hG=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; +void main() { -#ifdef USE_CUBE_MAP_SHADOW -vec3 texCoords; +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 -vec2 texCoords; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif -float depthBias; -float depth; -float nDotL; -vec2 texelStepSize; -float normalShadingSmooth; -float darkness; -}; -`;var _Mt=_(T(),1),TR=`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 SMt=_(T(),1),SR=`float czm_alphaWeight(float a) +`;var e6t=x(T(),1),fG=`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() { -float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; -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)))); +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var VMt=_(T(),1),CR=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var _6t=x(T(),1);var d6t=x(T(),1);var i6t=x(T(),1);var nue={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX};Object.freeze(nue);var Ec=nue;var s6t=x(T(),1);var iue={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};Object.freeze(iue);var $o=iue;var oue={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ec.ADD,equationAlpha:Ec.ADD,functionSourceRgb:$o.SOURCE_ALPHA,functionSourceAlpha:$o.ONE,functionDestinationRgb:$o.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ec.ADD,equationAlpha:Ec.ADD,functionSourceRgb:$o.ONE,functionSourceAlpha:$o.ONE,functionDestinationRgb:$o.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ec.ADD,equationAlpha:Ec.ADD,functionSourceRgb:$o.SOURCE_ALPHA,functionSourceAlpha:$o.ONE,functionDestinationRgb:$o.ONE,functionDestinationAlpha:$o.ONE})};Object.freeze(oue);var on=oue;var h6t=x(T(),1);var rue={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK};Object.freeze(rue);var Di=rue;function c1(e){e=e??B.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(c1.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}}});c1.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(` +`)};c1.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};c1.prototype.getRenderState=function(){let e=this.isTranslucent(),t=$e(this.renderState,!1);return e?(t.depthMask=!1,t.blending=on.ALPHA_BLEND):t.depthMask=!0,t};c1.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=on.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Di.BACK}),l(n)&&(i=It(n,i,!0)),i};var Go=c1;var Htn=x(T(),1);var Z6t=x(T(),1);function Z9e(){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 qn=Z9e;var H6t=x(T(),1);var D6t=x(T(),1);var V6t=x(T(),1);function l1(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(l1.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}}});l1.clone=function(e){if(l(e))return new l1(e._format,e._datatype,e._width,e._height,e._buffer)};l1.prototype.clone=function(){return l1.clone(this)};var pG=l1;var N6t=x(T(),1),sue=x(bu(),1);function aue(){if(!l(nc._canTransferArrayBuffer)){let e=u4("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return nc._canTransferArrayBuffer=!1,nc._canTransferArrayBuffer}nc._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),nc._canTransferArrayBuffer=s}})}return nc._canTransferArrayBuffer}var d4=new Se;function l4(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 u4(e){let t=new sue.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Ry(e))s=e;else if(!n){let a=en(`${nc._workerModulePrefix}/${i}.js`);Ry(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=l4(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${l4(CESIUM_WORKERS)}"); + CesiumWorkers["${i}"](); + `;return r=l4(a),new Worker(r,o)}if(r=e,n||(r=en(`${nc._workerModulePrefix+i}.js`)),!fn.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 R9e(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!fn.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=en(t.fallbackModulePath),n}n.wasmBinaryFile=en(t.wasmBinaryFile);let i=await ve.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function nc(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var C9e=(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 ge(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),d4.raiseEvent(s),i(s)}else d4.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},V9e=[];async function E9e(e,t,n){let i=await Promise.resolve(aue());l(n)?i||(n.length=0):n=V9e;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",C9e(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function A9e(e,t,n){++e._activeTasks;try{let i=await E9e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}nc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=u4(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return A9e(this,e,t)};nc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=u4(this._workerPath),i=await R9e(this,e),o=await Promise.resolve(aue()),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};nc.prototype.isDestroyed=function(){return!1};nc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};nc.taskCompletedEvent=d4;nc._defaultWorkerModulePrefix="Workers/";nc._workerModulePrefix=nc._defaultWorkerModulePrefix;nc._canTransferArrayBuffer=void 0;var $n=nc;function ib(){}ib._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);ib._readyPromise=void 0;function G9e(){let e=ib._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return ib._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});ib._readyPromise=e}ib.transcode=function(e,t){return l(ib._readyPromise)||G9e(),ib._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>1^-(e&1)}No.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};No.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>11,u=c>>5&o,m=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=m*r}return t};var dn=No;var p7t=x(T(),1);var mue=new h,hue=new h,fue=new h;function W9e(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,d,u,m,p;if(l(t.z)){if(h.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,mue),s=h.subtract(i,t,hue),a=h.subtract(e,t,fue),c=h.dot(r,r),d=h.dot(r,s),u=h.dot(r,a),m=h.dot(s,s),p=h.dot(s,a)}else{if(k.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(k.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(k.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=k.subtract(n,t,mue),s=k.subtract(i,t,hue),a=k.subtract(e,t,fue),c=k.dot(r,r),d=k.dot(r,s),u=k.dot(r,a),m=k.dot(s,s),p=k.dot(s,a)}o.y=m*u-d*p,o.z=c*p-d*u;let b=c*m-d*d;if(b!==0)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}var i_=W9e;var x7t=x(T(),1);function Vp(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Vp.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 ob={high:0,low:0};Vp.fromCartesian=function(e,t){l(t)||(t=new Vp);let n=t.high,i=t.low;return Vp.encode(e.x,ob),n.x=ob.high,i.x=ob.low,Vp.encode(e.y,ob),n.y=ob.high,i.y=ob.low,Vp.encode(e.z,ob),n.z=ob.high,i.z=ob.low,t};var p4=new Vp;Vp.writeElements=function(e,t,n){Vp.fromCartesian(e,p4);let i=p4.high,o=p4.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 An=Vp;var R7t=x(T(),1);var ha={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};ha.getSizeInBytes=function(e){switch(e){case ha.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ha.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ha.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ha.fromSizeInBytes=function(e){switch(e){case 2:return ha.UNSIGNED_SHORT;case 4:return ha.UNSIGNED_INT;case 1:return ha.UNSIGNED_BYTE}};ha.validate=function(e){return l(e)&&(e===ha.UNSIGNED_BYTE||e===ha.UNSIGNED_SHORT||e===ha.UNSIGNED_INT)};ha.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ha.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ha.fromTypedArray=function(e){if(e instanceof Uint8Array)return ha.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ha.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ha.UNSIGNED_INT};Object.freeze(ha);var Oe=ha;var j7t=x(T(),1);var E7t=x(T(),1);var b4={};b4.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function pue(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)))d&&d/c0?[a/e,n/a]:[n/a,a/e]};var Pl=b4;var P7t=x(T(),1);var L7t=x(T(),1);var y4={};y4.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 g4(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,m=s*s,p=o*s-u,b=o*a-r*s,f=r*a-m,y=4*p*f-b*b,_,S;if(y<0){let z,K,te;u*d>=c*m?(z=o,K=p,te=-2*r*p+o*b):(z=a,K=f,te=-a*b+2*s*f);let $=-(te<0?-1:1)*Math.abs(z)*Math.sqrt(-y);S=-te+$;let ee=S/2,le=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=S===$?-le:-K/le;return _=K<=0?le+_e:-te/(le*le+_e*_e+K),u*d>=c*m?[(_-r)/o]:[-a/(_+s)]}let Z=p,R=-2*r*p+o*b,C=f,E=-a*b+2*s*f,A=Math.sqrt(y),L=Math.sqrt(3)/2,F=Math.abs(Math.atan2(o*A,-R)/3);_=2*Math.sqrt(-Z);let I=Math.cos(F);S=_*I;let N=_*(-I/2-L*Math.sin(F)),g=S+N>2*r?S-r:N-r,V=o,G=g/V;F=Math.abs(Math.atan2(a*A,-E)/3),_=2*Math.sqrt(-C),I=Math.cos(F),S=_*I,N=_*(-I/2-L*Math.sin(F));let v=-a,X=S+N<2*s?S+s:N+s,Y=v/X,D=V*X,w=-g*X-V*v,O=g*v,M=(s*w-r*O)/(-r*w+s*D);return G<=M?G<=Y?M<=Y?[G,M,Y]:[G,Y,M]:[Y,G,M]:G<=Y?[M,G,Y]:M<=Y?[M,Y,G]:[Y,M,G]}y4.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Pl.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=Pl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return g4(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):g4(e,t,0,i);if(i===0)return o=Pl.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 g4(e,t,n,i)};var o_=y4;var x4={};x4.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,m=i*i,p=m*i,b=o*o,f=b*o;return a*d*m-4*c*p-4*e*u*m+18*e*t*n*p-27*r*m*m+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*m+144*r*n*m)+b*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function wh(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=o_.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)=0&&b>=0){let y=Math.sqrt(p),_=Math.sqrt(b);return[d-_,d-y,d+y,d+_]}else{if(p>=0&&b<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&b>=0)return f=Math.sqrt(b),[d-f,d+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,b=(r+u+s/m)/2,f=Pl.computeRealRoots(1,m,p),y=Pl.computeRealRoots(1,-m,b);return f.length!==0?(f[0]+=d,f[1]+=d,y.length!==0?(y[0]+=d,y[1]+=d,f[1]<=y[0]?[f[0],f[1],y[0],y[1]]:y[1]<=f[0]?[y[0],y[1],f[0],f[1]]:f[0]>=y[0]&&f[1]<=y[1]?[y[0],f[0],f[1],y[1]]:y[0]>=f[0]&&y[1]<=f[1]?[f[0],y[0],y[1],f[1]]:f[0]>y[0]&&f[0]0){let m=u[0],p=t-m,b=p*p,f=e/2,y=p/2,_=b-4*i,S=b+4*Math.abs(i),Z=s-4*m,R=s+4*Math.abs(m),C,E;if(m<0||_*R=g[0]&&N[1]<=g[1]?[g[0],N[0],N[1],g[1]]:g[0]>=N[0]&&g[1]<=N[1]?[N[0],g[0],g[1],N[1]]:N[0]>g[0]&&N[0]u)||(p=h.cross(m,a,gue),f=h.dot(s,p),f<0||b+f>u))return;y=h.dot(c,p)/u}else{if(Math.abs(u)1||(p=h.cross(m,a,gue),f=h.dot(s,p)*_,f<0||b+f>1))return;y=h.dot(c,p)*_}return y};rr.rayTriangle=function(e,t,n,i,o,r){let s=rr.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var I9e=new gn;rr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=I9e;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=rr.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function P9e(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 cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var Y9e=new h,w9e=new h;rr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,Y9e),o=h.multiplyComponents(n,e.direction,w9e),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,d,u,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),d=c*a,pd){u=s*s-d,m=-s+Math.sqrt(u);let f=m/c,y=a/m;return fo.start?i.start:o.start,n.stop=i.stopo.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop0?b.push(new h(i,o*I,o*-V)):V!==0?(b.push(new h(i,o*I,o*-V)),b.push(new h(i,o*I,o*V)),++F):b.push(new h(i,o*I,o*V))}return b};var S4=new h,yue=new h,xue=new h,ID=new h,D9e=new h,O9e=new q,B9e=new q,z9e=new q,H9e=new q,K9e=new q,Tue=new q,_ue=new q,Sue=new h,J9e=new h,j9e=new pe;rr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let A=t.geodeticSurfaceNormal(n,S4);if(h.dot(i,A)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,S4),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,ID),c=h.normalize(h.cross(a,s,yue),yue),d=h.normalize(h.cross(s,c,xue),xue),u=O9e;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 m=q.transpose(u,B9e),p=q.fromScale(t.radii,z9e),b=q.fromScale(t.oneOverRadii,H9e),f=K9e;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 y=q.multiply(q.multiply(m,b,Tue),f,Tue),_=q.multiply(q.multiply(y,p,_ue),u,_ue),S=q.multiplyByVector(y,n,D9e),Z=rr.quadraticVectorExpression(_,h.negate(S,S4),0,0,1),R,C,E=Z.length;if(E>0){let A=h.clone(h.ZERO,J9e),L=Number.NEGATIVE_INFINITY;for(let I=0;IL&&(L=g,A=h.clone(R,A))}let F=t.cartesianToCartographic(A,j9e);return L=W.clamp(L,0,1),C=h.magnitude(h.subtract(A,n,ID))*Math.sqrt(1-L*L),C=o?-C:C,F.height=C,t.cartographicToCartesian(F,new h)}};var Q9e=new h;rr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,Q9e),r=n.normal,s=h.dot(r,o);if(Math.abs(s)1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};rr.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,m;if((d===1||d===2)&&(u=new h,m=new h),d===1){if(s)return rr.lineSegmentPlane(e,t,i,u),rr.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return rr.lineSegmentPlane(t,n,i,u),rr.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return rr.lineSegmentPlane(n,e,i,u),rr.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,u,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return rr.lineSegmentPlane(e,n,i,u),rr.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return rr.lineSegmentPlane(n,t,i,u),rr.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return rr.lineSegmentPlane(t,e,i,u),rr.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var yi=rr;var nqt=x(T(),1);function Fa(e,t){this.normal=h.clone(e),this.distance=t}Fa.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Fa(t,i)};var q9e=new h;Fa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,q9e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Fa(n,i)};Fa.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var $9e=new h;Fa.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Fa.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,$9e);return h.subtract(t,o,n)};var eUe=new P,tUe=new ce,nUe=new h;Fa.transform=function(e,t,n){let i=e.normal,o=e.distance,r=P.inverseTranspose(t,eUe),s=ce.fromElements(i.x,i.y,i.z,o,tUe);s=P.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,nUe);return s=ce.divideByScalar(s,h.magnitude(a),s),Fa.fromCartesian4(s,n)};Fa.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Fa(e.normal,e.distance)};Fa.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Fa.ORIGIN_XY_PLANE=Object.freeze(new Fa(h.UNIT_Z,0));Fa.ORIGIN_YZ_PLANE=Object.freeze(new Fa(h.UNIT_X,0));Fa.ORIGIN_ZX_PLANE=Object.freeze(new Fa(h.UNIT_Y,0));var cn=Fa;var sqt=x(T(),1);var Z4={};Z4.calculateACMR=function(e){e=e??B.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};Z4.tipsify=function(e){e=e??B.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,V,G,v){for(;V.length>=1;){let X=V[V.length-1];if(V.splice(V.length-1,1),g[X].numLiveTriangles>0)return X}for(;o0)return++o,o-1;++o}return-1}function s(g,V,G,v,X,Y,D){let w=-1,O,M=-1,z=0;for(;zM||M===-1)&&(M=O,w=K)),++z}return w===-1?r(v,Y,g,D):w}let a=t.length,c=0,d=0,u=t[d],m=a;if(l(n))c=n+1;else{for(;dc&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],b;for(b=0;bi&&(R.timeStamp=_,++_),++d}y=s(t,i,S,p,_,Z,c)}return A};var TG=Z4;var Xl={};function kD(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function iUe(e){let t=e.length,n=t/3*6,i=Oe.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Oe.createTypedArray(t,n);kD(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Oe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=TG.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Cue(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 Xe({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function sUe(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=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Cue(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Ie.TRIANGLES?d=3:e.primitiveType===Ie.LINES?d=2:e.primitiveType===Ie.POINTS&&(d=1);for(let u=0;u=W.SIXTY_FOUR_KILOBYTES&&(t.push(new At({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Cue(e.attributes))}o.length!==0&&t.push(new At({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Vue=new h,aUe=new pe;Xl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new ki;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u_&&(_=Z)}return new At({attributes:u,indices:f,primitiveType:d,boundingSphere:l(y)?new de(y,_):void 0})}Xl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(E4(t,"geometry")),n.length>0&&(o.push(E4(n,"westHemisphereGeometry")),o.push(E4(n,"eastHemisphereGeometry"))),o};var Rm=new h,_G=new h,d1=new h,u1=new h;Xl.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;d0){for(u=0;u3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?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;vy(e,a),vy(t,a),vy(n,a)}var Lue=new h;function Cm(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Lue),e.y/(e.y-t.y),Lue),n),h.clone(n,i),vy(n,!0),vy(i,!1)}var s_=new h,a_=new h,c_=new h,l_=new h,A4={positions:new Array(7),indices:new Array(9)};function TUe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;xUe(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=A4.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Cm(e,t,s_,c_),Cm(e,n,a_,l_),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Cm(t,n,s_,c_),Cm(t,e,a_,l_),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Cm(n,e,s_,c_),Cm(n,t,a_,l_),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||(Cm(n,e,s_,c_),Cm(n,t,a_,l_),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Cm(t,n,s_,c_),Cm(t,e,a_,l_),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Cm(e,t,s_,c_),Cm(e,n,a_,l_),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=A4.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=s_,c[4]=a_,c[5]=c_,c[6]=l_,c.length=7),A4}function Wue(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=J.createTypedArray(r.componentDatatype,r.values)}let i=At.computeNumberOfVertices(e);return e.indices=Oe.createTypedArray(i,e.indices),t&&(e.boundingSphere=de.fromVertices(n.position.values)),e}function h1(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 Xe({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new At({attributes:n,indices:[],primitiveType:e.primitiveType})}function v4(e,t,n){let i=l(e.geometry.boundingSphere);t=Wue(t,i),n=Wue(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 F4(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,m,p){let b=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),y=e.fromArray(d,a*t,o);e.multiplyByScalar(b,c.x,b),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(y,c.z,y);let _=e.add(b,f,b);e.add(_,y,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var _Ue=F4(ce,4),MD=F4(h,3),Nue=F4(k,2),SUe=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},ZG=new h,G4=new h,L4=new h,ZUe=new h;function YD(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&b===0)return;let _=h.fromArray(o,e*3,ZG),S=h.fromArray(o,t*3,G4),Z=h.fromArray(o,n*3,L4),R=i_(i,_,S,Z,ZUe);if(l(R)){if(l(r)&&MD(e,t,n,R,r,m.normal.values,y,!0),l(d)){let C=h.fromArray(d,e*3,ZG),E=h.fromArray(d,t*3,G4),A=h.fromArray(d,n*3,L4);h.multiplyByScalar(C,R.x,C),h.multiplyByScalar(E,R.y,E),h.multiplyByScalar(A,R.z,A);let L;!h.equals(C,h.ZERO)||!h.equals(E,h.ZERO)||!h.equals(A,h.ZERO)?(L=h.add(C,E,C),h.add(L,A,L),h.normalize(L,L)):(L=ZG,L.x=0,L.y=0,L.z=0),h.pack(L,m.extrudeDirection.values,y*3)}if(l(u)&&SUe(e,t,n,R,u,m.applyOffset.values,y),l(s)&&MD(e,t,n,R,s,m.tangent.values,y,!0),l(a)&&MD(e,t,n,R,a,m.bitangent.values,y,!0),l(c)&&Nue(e,t,n,R,c,m.st.values,y),b>0)for(let C=0;C3){let v=G.positions,X=G.indices,Y=X.length;for(let D=0;D0)continue;let c=h.unpack(i,s,Mue);(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]):h.pack(a,i,s));let d=h.unpack(o,s,W4);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||de.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==Zm.NONE)switch(t.geometryType){case Zm.POLYLINES:FUe(e);break;case Zm.TRIANGLES:vue(e);break;case Zm.LINES:Fue(e);break}else yUe(t),t.primitiveType===Ie.TRIANGLES?vue(e):t.primitiveType===Ie.LINES&&Fue(e);return e};var zn=Xl;var Yqt=x(T(),1);var Iqt=x(T(),1);var Ii={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};Ii.toWebGLConstant=function(e,t){switch(e){case Ii.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case Ii.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case Ii.UNSIGNED_INT:return ie.UNSIGNED_INT;case Ii.FLOAT:return ie.FLOAT;case Ii.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case Ii.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case Ii.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case Ii.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case Ii.UNSIGNED_SHORT_5_6_5:return Ii.UNSIGNED_SHORT_5_6_5}};Ii.isPacked=function(e){return e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.sizeInBytes=function(e){switch(e){case Ii.UNSIGNED_BYTE:return 1;case Ii.UNSIGNED_SHORT:case Ii.UNSIGNED_SHORT_4_4_4_4:case Ii.UNSIGNED_SHORT_5_5_5_1:case Ii.UNSIGNED_SHORT_5_6_5:case Ii.HALF_FLOAT:return 2;case Ii.UNSIGNED_INT:case Ii.FLOAT:case Ii.UNSIGNED_INT_24_8:return 4}};Ii.validate=function(e){return e===Ii.UNSIGNED_BYTE||e===Ii.UNSIGNED_SHORT||e===Ii.UNSIGNED_INT||e===Ii.FLOAT||e===Ii.HALF_FLOAT||e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.getTypedArrayConstructor=function(e){let t=Ii.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Ii.FLOAT?Float32Array:Uint32Array};Object.freeze(Ii);var Ue=Ii;var at={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,RED_INTEGER:ie.RED_INTEGER,RG_INTEGER:ie.RG_INTEGER,RGB_INTEGER:ie.RGB_INTEGER,RGBA_INTEGER:ie.RGBA_INTEGER,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};at.componentsLength=function(e){switch(e){case at.RGB:case at.RGB_INTEGER:return 3;case at.RGBA:case at.RGBA_INTEGER:return 4;case at.LUMINANCE_ALPHA:case at.RG:case at.RG_INTEGER:return 2;case at.ALPHA:case at.RED:case at.RED_INTEGER:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.RED_INTEGER||e===at.RG_INTEGER||e===at.RGB_INTEGER||e===at.RGBA_INTEGER||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.RED||e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let o=at.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};at.texture3DSizeInBytes=function(e,t,n,i,o){let r=at.componentsLength(e);return Ue.isPacked(t)&&(r=1),r*Ue.sizeInBytes(t)*n*i*o};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=at.componentsLength(e)*n*i;return new o(r)};at.flipY=function(e,t,n,i,o){if(o===1)return e;let r=at.createTypedArray(t,n,i,o),s=at.componentsLength(t),a=i*s;for(let c=0;c0&&(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 Uue(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(d=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),Uue(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function kue(e){return e.values.length/e.componentsPerAttribute}function XUe(e){return J.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function NUe(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===J.DOUBLE&&(e[n].componentDatatype=J.FLOAT,e[n].values=J.createTypedArray(J.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=kue(e[o[0]]),t=1;t0){let d=J.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let m=r*a,p=new ArrayBuffer(m),b={};for(t=0;t=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=ot.createIndexBuffer({context:t,typedArray:new Uint32Array(b),usage:i,indexDatatype:Oe.UNSIGNED_INT}):p=ot.createIndexBuffer({context:t,typedArray:new Uint16Array(b),usage:i,indexDatatype:Oe.UNSIGNED_SHORT})),new Dh({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Dh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Dh.prototype.getAttribute=function(e){return this._attributes[e]};function YUe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=kt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function wUe(e,t){let n=e._attributes,i=n.length;for(let o=0;o czm_epsilon7 ? hsb.z + hsbShift.z : 0.0; -} else { -hsb.z = hsb.z + hsbShift.z; -} -hsb.z = clamp(hsb.z, 0.0, 1.0); -return czm_HSBToRGB(hsb); -} -`;var GMt=_(T(),1),LR=`vec2 czm_approximateSphericalCoordinates(vec3 normal) { -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); +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 XMt=_(T(),1),ZR=`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 Len=x(T(),1),vG=`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; +float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); +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 WMt=_(T(),1),RR=`bool czm_backFacing() +`;var ven=x(T(),1),FG=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return gl_FrontFacing == false; +czm_material material = czm_getDefaultMaterial(materialInput); +float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); +vec4 color = mix(lightColor, darkColor, b); +color = czm_gammaCorrect(color); +material.diffuse = color.rgb; +material.alpha = color.a; +return material; } -`;var PMt=_(T(),1),GR=`float czm_branchFreeTernary(bool comparison, float a, float b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); +`;var Ien=x(T(),1),IG=`uniform sampler2D heights; +uniform sampler2D colors; +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 } -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); +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); +if (height < minHeight || height > maxHeight) { +material.diffuse = vec3(0.0); +material.alpha = 0.0; +return material; } -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); +int idxBelow = 0; +int idxAbove = heightsDimensions.x; +float heightBelow = minHeight; +float heightAbove = maxHeight; +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; } -vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); } -`;var FMt=_(T(),1),ER=`vec4 czm_cascadeColor(vec4 weights) +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); +if (color.a > 0.0) { -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; +color.rgb /= color.a; } -`;var MMt=_(T(),1),XR=`uniform vec4 shadowMap_cascadeDistances; -float czm_cascadeDistance(vec4 weights) +color.rgb = czm_gammaCorrect(color.rgb); +material.diffuse = color.rgb; +material.alpha = color.a; +return material; +} +`;var Xen=x(T(),1),PG=`uniform vec4 color; +uniform float spacing; +uniform float width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return dot(shadowMap_cascadeDistances, weights); +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 +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 kMt=_(T(),1),IR=`uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +`;var Yen=x(T(),1),XG=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return shadowMap_cascadeMatrices[0] * weights.x + -shadowMap_cascadeMatrices[1] * weights.y + -shadowMap_cascadeMatrices[2] * weights.z + -shadowMap_cascadeMatrices[3] * weights.w; +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 OMt=_(T(),1),WR=`uniform vec4 shadowMap_cascadeSplits[2]; -vec4 czm_cascadeWeights(float depthEye) +`;var Men=x(T(),1),NG=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; +float getTime(float t, float coord) { -vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); -vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); -return near * far; +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); } -`;var BMt=_(T(),1),wR=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) { -float signedDistance = texture(clippingDistance, uv).r; -return (signedDistance - 0.5) * 2.0; +return clamp(q, 0.0, 1.0); } -void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) { -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; +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 Uen=x(T(),1),YG=`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; +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) +const float fuzz = 1.2; +vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; +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 +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 -return; +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; } -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))); +`;var Oen=x(T(),1),wG=`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; } -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; +`;var zen=x(T(),1),MG=`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 (signedDistance < 0.0) { -discard; -} +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); +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); } -`;var HMt=_(T(),1),PR=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +else { -vec3 p = mix(position2D.xyz, position3D.xyz, time); -return vec4(p, 1.0); +float d1 = czm_infinity; +if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +{ +d1 = abs(st.s - base); } -`;var KMt=_(T(),1),vR=`vec4 czm_computeAtmosphereColor( -vec3 positionWC, -vec3 lightDirection, -vec3 rayleighColor, -vec3 mieColor, -float opacity -) { -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; -float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); -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)); -vec3 rayleigh = rayleighPhase * rayleighColor; -vec3 mie = miePhase * mieColor; -vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity; -return vec4(color, opacity); +float d2 = abs(st.t - ptOnUpperLine); +float d3 = abs(st.t - ptOnLowerLine); +dist = min(min(d1, d2), d3); } -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; -float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); -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)); -vec3 rayleigh = rayleighPhase * rayleighColor; -vec3 mie = miePhase * mieColor; -vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity; -return vec4(color, opacity); +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 QMt=_(T(),1),FR=`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 Ken=x(T(),1),kG=`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 ); } -`;var qMt=_(T(),1),AR=`vec4 czm_computePosition(); -`;var eNt=_(T(),1),MR=`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; -const int PRIMARY_STEPS_MAX = 16; -const int LIGHT_STEPS_MAX = 4; -rayleighColor = vec3(0.0); -mieColor = vec3(0.0); -opacity = 0.0; -float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; -vec3 origin = vec3(0.0); -czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); -if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { -return; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; +float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(dashPattern / pow(2.0, maskIndex)); +vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; +if (fragColor.a < 0.005) { +discard; } -float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); -float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x)); -float start_0 = primaryRayAtmosphereIntersect.start; -primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); -primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); -float x_o_a = start_0 - ATMOSPHERE_THICKNESS; -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); -int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); -float rayPositionLength = primaryRayAtmosphereIntersect.start; -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); -for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { -if (i >= PRIMARY_STEPS) { -break; +fragColor = czm_gammaCorrect(fragColor); +material.emission = fragColor.rgb; +material.alpha = fragColor.a; +return material; } -vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); -float sampleHeight = length(samplePosition) - atmosphereInnerRadius; -vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; -opticalDepth += sampleDensity; -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); -for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { -if (j >= LIGHT_STEPS) { -break; +`;var jen=x(T(),1),UG=`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)); } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +vec4 fragColor; +fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); +fragColor.a = clamp(glow, 0.0, 1.0) * color.a; +fragColor = czm_gammaCorrect(fragColor); +material.emission = fragColor.rgb; +material.alpha = fragColor.a; +return material; } -vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); -rayleighAccumulation += sampleDensity.x * attenuation; -mieAccumulation += sampleDensity.y * attenuation; -rayPositionLength += (rayStepLength += rayStepLengthIncrease); +`;var qen=x(T(),1),DG=`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); +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; } -rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = czm_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); +`;var etn=x(T(),1),OG=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +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 nNt=_(T(),1),NR=`vec2 cordic(float angle) +`;var ntn=x(T(),1),BG=`uniform sampler2D image; +czm_material czm_getMaterial(czm_materialInput materialInput) { -vec2 vector = vec2(6.0725293500888267e-1, 0.0); -float sense = (angle < 0.0) ? -1.0 : 1.0; -mat2 rotation = mat2(1.0, sense, -sense, 1.0); -vector = rotation * vector; -angle -= sense * 7.8539816339744828e-1; -sense = (angle < 0.0) ? -1.0 : 1.0; -float factor = sense * 5.0e-1; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 4.6364760900080609e-1; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 2.5e-1; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 2.4497866312686414e-1; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.25e-1; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 1.2435499454676144e-1; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 6.25e-2; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 6.2418809995957350e-2; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 3.125e-2; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 3.1239833430268277e-2; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.5625e-2; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 1.5623728620476831e-2; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 7.8125e-3; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 7.8123410601011111e-3; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 3.90625e-3; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 3.9062301319669718e-3; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.953125e-3; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 1.9531225164788188e-3; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 9.765625e-4; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 9.7656218955931946e-4; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 4.8828125e-4; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 4.8828121119489829e-4; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 2.44140625e-4; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 2.4414062014936177e-4; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.220703125e-4; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 1.2207031189367021e-4; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 6.103515625e-5; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 6.1035156174208773e-5; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 3.0517578125e-5; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 3.0517578115526096e-5; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.52587890625e-5; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 1.5258789061315762e-5; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 7.62939453125e-6; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 7.6293945311019700e-6; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 3.814697265625e-6; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 3.8146972656064961e-6; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.9073486328125e-6; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 1.9073486328101870e-6; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 9.5367431640625e-7; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 9.5367431640596084e-7; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 4.76837158203125e-7; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 4.7683715820308884e-7; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 2.384185791015625e-7; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -angle -= sense * 2.3841857910155797e-7; -sense = (angle < 0.0) ? -1.0 : 1.0; -factor = sense * 1.1920928955078125e-7; -rotation[0][1] = factor; -rotation[1][0] = -factor; -vector = rotation * vector; -return vector; +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; } -vec2 czm_cosineAndSine(float angle) -{ -if (angle < -czm_piOverTwo || angle > czm_piOverTwo) -{ -if (angle < 0.0) +`;var otn=x(T(),1),zG=`uniform vec4 evenColor; +uniform vec4 oddColor; +uniform float offset; +uniform float repeat; +uniform bool horizontal; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle + czm_pi); +czm_material material = czm_getDefaultMaterial(materialInput); +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; } -else +`;var stn=x(T(),1),HG=`uniform vec4 waterColor; +uniform vec4 landColor; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle - czm_pi); -} +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; } -else +`;var ctn=x(T(),1),KG=`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) { -return cordic(angle); -} +czm_material material = czm_getDefaultMaterial(materialInput); +float time = czm_frameNumber * animationSpeed; +float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); +float specularMapValue = texture(specularMap, materialInput.st).r; +vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); +vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); +normalTangentSpace.xy /= fade; +normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); +normalTangentSpace = normalize(normalTangentSpace); +float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); +material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; +material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); +material.diffuse += (0.1 * tsPerturbationRatio); +material.diffuse = material.diffuse; +material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); +material.specular = specularIntensity; +material.shininess = 10.0; +return material; } -`;var oNt=_(T(),1),kR=`vec2 czm_decompressTextureCoordinates(float encoded) +`;function rt(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=e.minificationFilter??Ht.LINEAR,this._magnificationFilter=e.magnificationFilter??ei.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,this._initializationPromises=[],this._initializationError=void 0,BUe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(rt._uniformList[this.type])||(rt._uniformList[this.type]=Object.keys(this._uniforms))}rt._uniformList={};rt.fromType=function(e,t){let n=new rt({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};rt.fromTypeAsync=async function(e,t){let n=[],i=new rt({fabric:{type:e,uniforms:t}});if(jue(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function jue(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];jue(o,t)}}rt.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-1)return!0;return!1}function QUe(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) { -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); +`,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&&jUe(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 sNt=_(T(),1),UR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif -vec4 czm_depthClamp(vec4 coords) +`}}var Jue={mat2:Ji,mat3:q,mat4:P},qUe=/\.ktx2$/i;function $Ue(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===rt.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 m=new Bt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new vt({context:i,source:r,sampler:m}),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 m=n._textures[e];l(m)&&m!==n._defaultTexture&&m.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,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),!a){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}Que(n,e)}}}function Que(e,t){let i=e.uniforms[t];if(i===rt.DefaultImageId)return Promise.resolve();let o=ve.createIfNeeded(i);if(!(o instanceof ve))return Promise.resolve();let r=ve.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let a;return qUe.test(o.url)?a=Ed(o.url):a=o.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let d=e._textures[t];l(d)&&d!==e._defaultTexture&&d.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function e5e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof $r){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),que(t,e)}}function que(e,t){let i=e.uniforms[t];if(i===rt.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[ve.createIfNeeded(i.positiveX).fetchImage(),ve.createIfNeeded(i.negativeX).fetchImage(),ve.createIfNeeded(i.positiveY).fetchImage(),ve.createIfNeeded(i.negativeY).fetchImage(),ve.createIfNeeded(i.positiveZ).fetchImage(),ve.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(r);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=o,s}function t5e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&$ue(e,n)}function $ue(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=n5e(o),s;if(r==="channels")s=JG(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;o5e(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},$ue(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=JG(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push($Ue(t)),e._initializationPromises.push(Que(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(e5e(t)),e._initializationPromises.push(que(e,t));else if(r.indexOf("mat")!==-1){let d=new Jue[r];e._uniforms[c]=function(){return Jue[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function n5e(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 ve||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===rt.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 i5e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new rt({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=It(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;JG(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=JG(e,i,a)}}function JG(e,t,n,i){i=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 o5e(e,t,n){return JG(e,t,t,n)}rt._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};rt.DefaultImageId="czm_defaultImage";rt.DefaultCubeMapId="czm_defaultCubeMap";rt.ColorType="Color";rt._materialCache.addMaterial(rt.ColorType,{fabric:{type:rt.ColorType,uniforms:{color:new U(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});rt.ImageType="Image";rt._materialCache.addMaterial(rt.ImageType,{fabric:{type:rt.ImageType,uniforms:{image:rt.DefaultImageId,repeat:new k(1,1),color:new U(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}});rt.DiffuseMapType="DiffuseMap";rt._materialCache.addMaterial(rt.DiffuseMapType,{fabric:{type:rt.DiffuseMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});rt.AlphaMapType="AlphaMap";rt._materialCache.addMaterial(rt.AlphaMapType,{fabric:{type:rt.AlphaMapType,uniforms:{image:rt.DefaultImageId,channel:"a",repeat:new k(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});rt.SpecularMapType="SpecularMap";rt._materialCache.addMaterial(rt.SpecularMapType,{fabric:{type:rt.SpecularMapType,uniforms:{image:rt.DefaultImageId,channel:"r",repeat:new k(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});rt.EmissionMapType="EmissionMap";rt._materialCache.addMaterial(rt.EmissionMapType,{fabric:{type:rt.EmissionMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});rt.BumpMapType="BumpMap";rt._materialCache.addMaterial(rt.BumpMapType,{fabric:{type:rt.BumpMapType,uniforms:{image:rt.DefaultImageId,channel:"r",strength:.8,repeat:new k(1,1)},source:WG},translucent:!1});rt.NormalMapType="NormalMap";rt._materialCache.addMaterial(rt.NormalMapType,{fabric:{type:rt.NormalMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",strength:.8,repeat:new k(1,1)},source:wG},translucent:!1});rt.GridType="Grid";rt._materialCache.addMaterial(rt.GridType,{fabric:{type:rt.GridType,uniforms:{color:new U(0,1,0,1),cellAlpha:.1,lineCount:new k(8,8),lineThickness:new k(1,1),lineOffset:new k(0,0)},source:YG},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});rt.StripeType="Stripe";rt._materialCache.addMaterial(rt.StripeType,{fabric:{type:rt.StripeType,uniforms:{horizontal:!0,evenColor:new U(1,1,1,.5),oddColor:new U(0,0,1,.5),offset:0,repeat:5},source:zG},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});rt.CheckerboardType="Checkerboard";rt._materialCache.addMaterial(rt.CheckerboardType,{fabric:{type:rt.CheckerboardType,uniforms:{lightColor:new U(1,1,1,.5),darkColor:new U(0,0,0,.5),repeat:new k(5,5)},source:vG},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});rt.DotType="Dot";rt._materialCache.addMaterial(rt.DotType,{fabric:{type:rt.DotType,uniforms:{lightColor:new U(1,1,0,.75),darkColor:new U(0,1,1,.75),repeat:new k(5,5)},source:FG},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});rt.WaterType="Water";rt._materialCache.addMaterial(rt.WaterType,{fabric:{type:rt.WaterType,uniforms:{baseWaterColor:new U(.2,.3,.6,1),blendColor:new U(0,1,.699,1),specularMap:rt.DefaultImageId,normalMap:rt.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:KG},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});rt.RimLightingType="RimLighting";rt._materialCache.addMaterial(rt.RimLightingType,{fabric:{type:rt.RimLightingType,uniforms:{color:new U(1,0,0,.7),rimColor:new U(1,1,1,.4),width:.3},source:OG},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});rt.FadeType="Fade";rt._materialCache.addMaterial(rt.FadeType,{fabric:{type:rt.FadeType,uniforms:{fadeInColor:new U(1,0,0,1),fadeOutColor:new U(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new k(.5,.5)},source:NG},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});rt.PolylineArrowType="PolylineArrow";rt._materialCache.addMaterial(rt.PolylineArrowType,{fabric:{type:rt.PolylineArrowType,uniforms:{color:new U(1,1,1,1)},source:MG},translucent:!0});rt.PolylineDashType="PolylineDash";rt._materialCache.addMaterial(rt.PolylineDashType,{fabric:{type:rt.PolylineDashType,uniforms:{color:new U(1,0,1,1),gapColor:new U(0,0,0,0),dashLength:16,dashPattern:255},source:kG},translucent:!0});rt.PolylineGlowType="PolylineGlow";rt._materialCache.addMaterial(rt.PolylineGlowType,{fabric:{type:rt.PolylineGlowType,uniforms:{color:new U(0,.5,1,1),glowPower:.25,taperPower:1},source:UG},translucent:!0});rt.PolylineOutlineType="PolylineOutline";rt._materialCache.addMaterial(rt.PolylineOutlineType,{fabric:{type:rt.PolylineOutlineType,uniforms:{color:new U(1,1,1,1),outlineColor:new U(1,0,0,1),outlineWidth:1},source:DG},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});rt.ElevationContourType="ElevationContour";rt._materialCache.addMaterial(rt.ElevationContourType,{fabric:{type:rt.ElevationContourType,uniforms:{spacing:100,color:new U(1,0,0,1),width:1},source:PG},translucent:!1});rt.ElevationRampType="ElevationRamp";rt._materialCache.addMaterial(rt.ElevationRampType,{fabric:{type:rt.ElevationRampType,uniforms:{image:rt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:XG},translucent:!1});rt.SlopeRampMaterialType="SlopeRamp";rt._materialCache.addMaterial(rt.SlopeRampMaterialType,{fabric:{type:rt.SlopeRampMaterialType,uniforms:{image:rt.DefaultImageId},source:BG},translucent:!1});rt.AspectRampMaterialType="AspectRamp";rt._materialCache.addMaterial(rt.AspectRampMaterialType,{fabric:{type:rt.AspectRampMaterialType,uniforms:{image:rt.DefaultImageId},source:LG},translucent:!1});rt.ElevationBandType="ElevationBand";rt._materialCache.addMaterial(rt.ElevationBandType,{fabric:{type:rt.ElevationBandType,uniforms:{heights:rt.DefaultImageId,colors:rt.DefaultImageId},source:IG},translucent:!0});rt.WaterMaskType="WaterMask";rt._materialCache.addMaterial(rt.WaterMaskType,{fabric:{type:rt.WaterMaskType,source:HG,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var eo=rt;function u_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??u_.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(u_.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}}});u_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;u_.prototype.isTranslucent=Go.prototype.isTranslucent;u_.prototype.getRenderState=Go.prototype.getRenderState;u_.MaterialSupport={BASIC:Object.freeze({vertexFormat:we.POSITION_AND_NORMAL,vertexShaderSource:mG,fragmentShaderSource:uG}),TEXTURED:Object.freeze({vertexFormat:we.POSITION_NORMAL_AND_ST,vertexShaderSource:fG,fragmentShaderSource:hG}),ALL:Object.freeze({vertexFormat:we.ALL,vertexShaderSource:dG,fragmentShaderSource:lG})};var Co=u_;var Znn=x(T(),1);var cnn=x(T(),1),jG=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; +void main() { -#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 +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); #endif -return coords; -} -`;var cNt=_(T(),1),OR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) -{ -vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); -vec3 tangentEC = normalize(czm_normal3D * tangentMC); -vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); -return mat3( -tangentEC.x, tangentEC.y, tangentEC.z, -bitangentEC.x, bitangentEC.y, bitangentEC.z, -normalEC.x, normalEC.y, normalEC.z); -} -`;var dNt=_(T(),1),DR=`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 mNt=_(T(),1),BR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) -{ -return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;var hNt=_(T(),1),YR=`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); +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 bNt=_(T(),1),HR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +`;var dnn=x(T(),1),QG=`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 = positionEC; -vec4 zEyeOffset = normalize(p) * eyeOffset.z; -p.xy += eyeOffset.xy + zEyeOffset.xy; -p.z += zEyeOffset.z; -return p; +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var gNt=_(T(),1),zR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +`;var mnn=x(T(),1),m_=`in vec4 v_color; +void main() { -vec4 q = czm_projection * positionEC; -q.xyz /= q.w; -q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; -return q; -} -`;var _Nt=_(T(),1),KR=`float czm_fastApproximateAtan(float x) { -return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); -} -float czm_fastApproximateAtan(float x, float y) { -float t = abs(x); -float opposite = abs(y); -float adjacent = max(t, opposite); -opposite = min(t, opposite); -t = czm_fastApproximateAtan(opposite / adjacent); -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; +out_FragColor = czm_gammaCorrect(v_color); } -`;var SNt=_(T(),1),JR=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +`;var fnn=x(T(),1),qG=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() { -float scalar = distanceToCamera * czm_fogDensity; -float fog = 1.0 - exp(-(scalar * scalar)); -return mix(color, fogColor, fog); +vec4 p = czm_computePosition(); +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) +`;function sb(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?qG:QG,r=i?m_:jG,s=i?sb.FLAT_VERTEX_FORMAT:sb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(sb.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}}});sb.VERTEX_FORMAT=we.POSITION_AND_NORMAL;sb.FLAT_VERTEX_FORMAT=we.POSITION_ONLY;sb.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;sb.prototype.isTranslucent=Go.prototype.isTranslucent;sb.prototype.getRenderState=Go.prototype.getRenderState;var Tn=sb;var Wnn=x(T(),1);function f1(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(f1.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});f1.prototype.getType=function(e){return"Color"};var r5e=new Q;f1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(r5e)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};f1.prototype.equals=function(e){return this===e||e instanceof f1&&j.equals(this._color,e._color)};var Qt=f1;var g0n=x(T(),1);var jpn=x(T(),1);var qnn=x(T(),1);var Mnn=x(T(),1);var Y4=class{constructor(t){t=t??B.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ne.default,this._rectangle=t.rectangle??re.MAX_VALUE,this._projection=new ki(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<=r&&(u=r-1);let m=(o.north-t.latitude)/c|0;return m>=s&&(m=s-1),l(i)?(i.x=u,i.y=m,i):new k(u,m)}},to=Y4;var eme=new h,tme=new h,nme=new pe,w4=new h,s5e=new h,ime=new de,a5e=new to,$G=[new pe,new pe,new pe,new pe],eL=new k,Ys={};Ys.initialize=function(){let e=Ys._initPromise;return l(e)||(e=ve.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Ys._terrainHeights=t}),Ys._initPromise=e),e};Ys.getMinimumMaximumHeights=function(e,t){t=t??ne.default;let n=ome(e),i=Ys._defaultMinTerrainHeight,o=Ys._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ys._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(re.northeast(e,nme),eme),t.cartographicToCartesian(re.southwest(e,nme),tme),h.midpoint(tme,eme,w4);let a=t.scaleToGeodeticSurface(w4,s5e);if(l(a)){let c=h.distance(w4,a);i=Math.min(i,-c)}else i=Ys._defaultMinTerrainHeight}return i=Math.max(Ys._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Ys.getBoundingSphere=function(e,t){t=t??ne.default;let n=ome(e),i=Ys._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ys._terrainHeights[r];l(s)&&(i=s[1])}let o=de.fromRectangle3D(e,t,0);return de.fromRectangle3D(e,t,i,ime),de.union(o,ime,o)};function ome(e){pe.fromRadians(e.east,e.north,0,$G[0]),pe.fromRadians(e.west,e.north,0,$G[1]),pe.fromRadians(e.east,e.south,0,$G[2]),pe.fromRadians(e.west,e.south,0,$G[3]);let t=0,n=0,i=0,o=0,r=Ys._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=$G[c];if(a5e.positionToTileXY(d,s,eL),c===0)i=eL.x,o=eL.y;else if(i!==eL.x||o!==eL.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}}Ys._terrainHeightsMaxLevel=6;Ys._defaultMaxTerrainHeight=9e3;Ys._defaultMinTerrainHeight=-1e5;Ys._terrainHeights=void 0;Ys._initPromise=void 0;Object.defineProperties(Ys,{initialized:{get:function(){return l(Ys._terrainHeights)}}});var Pi=Ys;var vin=x(T(),1);var bin=x(T(),1);var iin=x(T(),1);function ic(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}ic.fromCorners=function(e,t,n){return l(n)||(n=new ic),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};ic.fromPoints=function(e,t){if(l(t)||(t=new ic),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.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 m=1;m0?qt.INSIDE:r+o<0?qt.OUTSIDE:qt.INTERSECTING};ic.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};ic.prototype.clone=function(e){return ic.clone(this,e)};ic.prototype.intersectPlane=function(e){return ic.intersectPlane(this,e)};ic.prototype.intersectAxisAlignedBoundingBox=function(e){return ic.intersectAxisAlignedBoundingBox(this,e)};ic.prototype.equals=function(e){return ic.equals(this,e)};var Tu=ic;var M4=new ce;function Ap(e,t){t=t??ne.default,e=t.scaleToGeodeticSurface(e);let n=_t.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(P.getColumn(n,0,M4)),this._yAxis=h.fromCartesian4(P.getColumn(n,1,M4));let i=h.fromCartesian4(P.getColumn(n,2,M4));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(Ap.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 c5e=new Tu;Ap.fromPoints=function(e,t){let n=Tu.fromPoints(e,c5e);return new Ap(n.center,t)};var rme=new gn,BD=new h;Ap.prototype.projectPointOntoPlane=function(e,t){let n=rme;n.origin=e,h.normalize(e,n.direction);let i=yi.rayPlane(n,this._plane,BD);if(l(i)||(h.negate(n.direction,n.direction),i=yi.rayPlane(n,this._plane,BD)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new k(r,s)}};Ap.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:L.latitude,V=pe.fromRadians(N,e.north,n,T5e),G=pe.fromRadians(e.west,e.north,n,_5e),v=pe.fromRadians(e.west,g,n,S5e),X=pe.fromRadians(e.west,e.south,n,Z5e),Y=pe.fromRadians(N,e.south,n,R5e),D=i.cartographicToCartesian(V,C5e),w=i.cartographicToCartesian(G,cme),O=i.cartographicToCartesian(v,V5e),M=i.cartographicToCartesian(X,lme),z=i.cartographicToCartesian(Y,E5e),K=I.projectPointToNearestOnPlane(D,A5e),te=I.projectPointToNearestOnPlane(w,G5e),H=I.projectPointToNearestOnPlane(O,L5e),$=I.projectPointToNearestOnPlane(M,W5e),ee=I.projectPointToNearestOnPlane(z,v5e);return r=Math.min(te.x,H.x,$.x),s=-r,c=Math.max(te.y,K.y),a=Math.min($.y,ee.y),G.height=X.height=t,w=i.cartographicToCartesian(G,cme),M=i.cartographicToCartesian(X,lme),d=Math.min(cn.getPointDistance(m,w),cn.getPointDistance(m,M)),u=n,sme(I.origin,I.xAxis,I.yAxis,I.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,b=e.north<0,f=p?e.south:b?e.north:0,y=re.center(e,ame).longitude,_=h.fromRadians(y,f,n,i,F5e);_.z=0;let Z=Math.abs(_.x)=c?qt.INSIDE:qt.INTERSECTING};var mme=new h,hme=new h,fme=new h,U5e=new h,dme=new h,D5e=new h;ho.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,ume),i=e.halfAxes,o=q.getColumn(i,0,mme),r=q.getColumn(i,1,hme),s=q.getColumn(i,2,fme),a=h.magnitude(o),c=h.magnitude(r),d=h.magnitude(s),u=!0,m=!0,p=!0;a>0?h.divideByScalar(o,a,o):u=!1,c>0?h.divideByScalar(r,c,r):m=!1,d>0?h.divideByScalar(s,d,s):p=!1;let b=!u+!m+!p,f,y,_;if(b===1){let C=o;f=r,y=s,m?p||(C=s,y=o):(C=r,f=o),_=h.cross(f,y,dme),C===o?o=_:C===r?r=_:C===s&&(s=_)}else if(b===2){f=o,m?f=r:p&&(f=s);let C=h.UNIT_Y;C.equalsEpsilon(f,W.EPSILON3)&&(C=h.UNIT_X),y=h.cross(f,C,U5e),h.normalize(y,y),_=h.cross(f,y,dme),h.normalize(_,_),f===o?(r=y,s=_):f===r?(s=y,o=_):f===s&&(o=y,r=_)}else b===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let S=D5e;S.x=h.dot(n,o),S.y=h.dot(n,r),S.z=h.dot(n,s);let Z=0,R;return S.x<-a?(R=S.x+a,Z+=R*R):S.x>a&&(R=S.x-a,Z+=R*R),S.y<-c?(R=S.y+c,Z+=R*R):S.y>c&&(R=S.y-c,Z+=R*R),S.z<-d?(R=S.z+d,Z+=R*R):S.z>d&&(R=S.z-d,Z+=R*R),Z};var O5e=new h,B5e=new h;ho.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ns);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=q.getColumn(a,0,mme),d=q.getColumn(a,1,hme),u=q.getColumn(a,2,fme),m=h.add(c,d,O5e);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,B5e),b=h.dot(n,p);return o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.add(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),i.start=o,i.stop=r,i};var z5e=new h,H5e=new h,K5e=new h;ho.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=q.getColumn(i,0,z5e),r=q.getColumn(i,1,H5e),s=q.getColumn(i,2,K5e);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var J5e=new q;ho.computeTransformation=function(e,t){l(t)||(t=new P);let n=e.center,i=q.multiplyByUniformScale(e.halfAxes,2,J5e);return P.fromRotationTranslation(i,n,t)};var j5e=new de;ho.isOccluded=function(e,t){let n=de.fromOrientedBoundingBox(e,j5e);return!t.isBoundingSphereVisible(n)};ho.prototype.intersectPlane=function(e){return ho.intersectPlane(this,e)};ho.prototype.distanceSquaredTo=function(e){return ho.distanceSquaredTo(this,e)};ho.prototype.computePlaneDistances=function(e,t,n){return ho.computePlaneDistances(this,e,t,n)};ho.prototype.computeCorners=function(e){return ho.computeCorners(this,e)};ho.prototype.computeTransformation=function(e){return ho.computeTransformation(this,e)};ho.prototype.isOccluded=function(e){return ho.isOccluded(this,e)};ho.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&q.equals(e.halfAxes,t.halfAxes)};ho.prototype.clone=function(e){return ho.clone(this,e)};ho.prototype.equals=function(e){return ho.equals(this,e)};var tn=ho;var Nin=x(T(),1);var zD={};zD.getHeight=function(e,t,n){return(e-n)*t+n};var Q5e=new pe;zD.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,Q5e);if(!l(r))return h.clone(e,o);let s=zD.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var _o=zD;var vpn=x(T(),1);var Uin=x(T(),1);var es={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},k4=class e{constructor(t=B.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Ie.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return jc(this,es.CULL)}set cull(t){jc(this,es.CULL)!==t&&(Fy(this,es.CULL,t),this.dirty=!0)}get occlude(){return jc(this,es.OCCLUDE)}set occlude(t){jc(this,es.OCCLUDE)!==t&&(Fy(this,es.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return jc(this,es.CAST_SHADOWS)}set castShadows(t){jc(this,es.CAST_SHADOWS)!==t&&(Fy(this,es.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return jc(this,es.RECEIVE_SHADOWS)}set receiveShadows(t){jc(this,es.RECEIVE_SHADOWS)!==t&&(Fy(this,es.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return jc(this,es.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){jc(this,es.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Fy(this,es.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return jc(this,es.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){jc(this,es.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Fy(this,es.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return jc(this,es.PICK_ONLY)}set pickOnly(t){jc(this,es.PICK_ONLY)!==t&&(Fy(this,es.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return jc(this,es.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){jc(this,es.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Fy(this,es.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function jc(e,t){return(e._flags&t)===t}function Fy(e,t,n){n?e._flags|=t:e._flags&=~t}var lt=k4;var Oin=x(T(),1),pme={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(pme);var Le=pme;var ion=x(T(),1);var Hin=x(T(),1);var tL={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};tL.validate=function(e){return e===tL.CLOCKWISE||e===tL.COUNTER_CLOCKWISE};Object.freeze(tL);var qs=tL;var Jin=x(T(),1);function bme(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i0&&console.log(`${Wp}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Wp}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Wp}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(`${Wp}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Wp}Vertex shader compile log: ${c}`),console.error(`${Wp} Vertex shader source: +${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Wp}Fragment shader compile log: ${c}`),console.error(`${Wp} 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 m(p,b){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${Wp}${b} shader translation failed.`);return}console.error(`${Wp}Translated ${b} shaderSource: +${f}`)}}function mDe(e,t,n){let i={};for(let o=0;o=0){if(u=n[d.slice(0,f)],!l(u))continue;m=u._locations,m.length<=1&&(p=u.value,b=e.getUniformLocation(t,d),b!==null&&(m.push(b),p.push(e.getUniform(t,b))))}else{m=[];for(let y=0;y0;){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=0;--o)i=`${i+t[o].glslSource} -`;return i.replace(n.glslSource,"")}function xte(e,t,n){let i,o,r="",s=e.sources;if(c(s))for(i=0,o=s.length;i-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(c(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 Be({sources:[r]})),typeof s=="string"&&(s=new Be({sources:[s]}));let l=this._context,d=r.createCombinedVertexShader(l),u=s.createCombinedFragmentShader(l),f=new tn({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:f,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),f._cachedShader=p,this._shaders[o]=p,f};function CY(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;omt.maximumTextureSize)throw new L(`Width must be less than or equal to the maximum texture size (${mt.maximumTextureSize}). Check maximumTextureSize.`);if(C.typeOf.number.greaterThan("height",d,0),d>mt.maximumTextureSize)throw new L(`Height must be less than or equal to the maximum texture size (${mt.maximumTextureSize}). Check maximumTextureSize.`);if(!ke.validate(i))throw new L("Invalid options.pixelFormat.");if(!p&&!Ue.validate(o))throw new L("Invalid options.pixelDatatype.");if(i===ke.DEPTH_COMPONENT&&o!==Ue.UNSIGNED_SHORT&&o!==Ue.UNSIGNED_INT)throw new L("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ke.DEPTH_STENCIL&&o!==Ue.UNSIGNED_INT_24_8)throw new L("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new L("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new L("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ke.isDepthFormat(i)){if(c(n))throw new L("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new L("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(p){if(!c(n)||!c(n.arrayBufferView))throw new L("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ke.isDXTFormat(f)&&!t.s3tc)throw new L("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ke.isPVRTCFormat(f)&&!t.pvrtc)throw new L("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ke.isASTCFormat(f)&&!t.astc)throw new L("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ke.isETC2Format(f)&&!t.etc)throw new L("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ke.isETC1Format(f)&&!t.etc1)throw new L("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ke.isBC7Format(f)&&!t.bc7)throw new L("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ke.compressedTextureSizeInBytes(f,l,d)!==n.arrayBufferView.byteLength)throw new L("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let y=t._gl,h=p?ke.compressedTextureSizeInBytes(i,l,d):ke.textureSizeInBytes(i,o,l,d);this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y.TEXTURE_2D,this._texture=y.createTexture(),this._internalFormat=f,this._pixelFormat=i,this._pixelDatatype=o,this._width=l,this._height=d,this._dimensions=new D(l,d),this._hasMipmap=!1,this._sizeInBytes=h,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Lte(this,a),y.activeTexture(y.TEXTURE0),y.bindTexture(this._textureTarget,this._texture),c(n)?(s?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),c(n.arrayBufferView)?ke.isCompressedFormat(f)?FGe(this,n):Ste(this,n):c(n.framebuffer)?MGe(this,n):Cte(this,n),this._initialized=!0):Vte(this),y.bindTexture(this._textureTarget,null)}function FGe(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),c(t.mipLevels)){let l=s,d=a;for(let u=0;un.drawingBufferWidth)throw new L("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>n.drawingBufferHeight)throw new L("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Pm({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:c(l)?l: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){Lte(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 Lte(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===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Jt.NEAREST_MIPMAP_NEAREST:Jt.NEAREST,i=di.NEAREST),r.webgl2&&ke.isDepthFormat(s)&&(n=Jt.NEAREST,i=di.NEAREST);let l=r._gl,d=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(d,e._texture),l.texParameteri(d,l.TEXTURE_MIN_FILTER,n),l.texParameteri(d,l.TEXTURE_MAG_FILTER,i),l.texParameteri(d,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(d,l.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&l.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(d,null)}Pm.prototype.copyFrom=function(e){C.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(C.defined("options.source",i),ke.isDepthFormat(this._pixelFormat))throw new L("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new L("Cannot call copyFrom with a compressed texture pixel format.");C.typeOf.number.greaterThanOrEquals("xOffset",t,0),C.typeOf.number.greaterThanOrEquals("yOffset",n,0),C.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),C.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:l,height:d}=i;c(i.videoWidth)&&c(i.videoHeight)?(l=i.videoWidth,d=i.videoHeight):c(i.naturalWidth)&&c(i.naturalHeight)&&(l=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&&l===this._width&&d===this._height?(c(i.arrayBufferView)?Ste(this,i):Cte(this,i),u=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Vte(this)),this._initialized=!0),u||(c(i.arrayBufferView)?AGe(this,i.arrayBufferView,t,n,l,d):NGe(this,i,t,n)),s.bindTexture(a,null)};Pm.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height,ke.isDepthFormat(this._pixelFormat))throw new L("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Ue.FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ke.isCompressedFormat(this._pixelFormat))throw new L("Cannot call copyFrom with a compressed texture pixel format.");C.typeOf.number.greaterThanOrEquals("xOffset",e,0),C.typeOf.number.greaterThanOrEquals("yOffset",t,0),C.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),C.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),C.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),C.typeOf.number.lessThanOrEquals("yOffset + height",t+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){if(e=e??_u.DONT_CARE,ke.isDepthFormat(this._pixelFormat))throw new L("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new L("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!w.isPowerOfTwo(this._width))throw new L("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!w.isPowerOfTwo(this._height))throw new L("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!_u.validate(e))throw new L("hint is invalid.");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),he(this)};var Pt=Pm;var JDt=_(T(),1);function Cx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Cx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Cx.prototype.getTexture=function(e){let t=this._textures[e];if(c(t))return delete this._texturesToRelease[e],++t.count,t.texture};Cx.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};Cx.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={}};Cx.prototype.isDestroyed=function(){return!1};Cx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return he(this)};var rE=Cx;var n3t=_(T(),1);var TBt=_(T(),1);var fBt=_(T(),1);var iBt=_(T(),1);function Tu(e){this.planes=e??[]}var sE=[new m,new m,new m];m.clone(m.UNIT_X,sE[0]);m.clone(m.UNIT_Y,sE[1]);m.clone(m.UNIT_Z,sE[2]);var D0=new m,kGe=new m,Zte=new cn(new m(1,0,0),0);Tu.fromBoundingSphere=function(e,t){if(!c(e))throw new L("boundingSphere is required.");c(t)||(t=new Tu);let n=sE.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;ae.right)throw new L("right must be greater than left.");if(e.bottom>e.top)throw new L("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new L("near must be greater than zero and less than 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=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(uh.prototype,{projectionMatrix:{get:function(){return Rte(this),this._orthographicMatrix}}});var UGe=new m,OGe=new m,DGe=new m,VY=new m;uh.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new L("position is required.");if(!c(t))throw new L("direction is required.");if(!c(n))throw new L("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,d=this.far,u=m.cross(t,n,UGe);m.normalize(u,u);let f=OGe;m.multiplyByScalar(t,l,f),m.add(e,f,f);let p=DGe;m.multiplyByScalar(u,a,p),m.add(f,p,p);let y=i[0];return c(y)||(y=i[0]=new ce),y.x=u.x,y.y=u.y,y.z=u.z,y.w=-m.dot(u,p),m.multiplyByScalar(u,s,p),m.add(f,p,p),y=i[1],c(y)||(y=i[1]=new ce),y.x=-u.x,y.y=-u.y,y.z=-u.z,y.w=-m.dot(m.negate(u,VY),p),m.multiplyByScalar(n,r,p),m.add(f,p,p),y=i[2],c(y)||(y=i[2]=new ce),y.x=n.x,y.y=n.y,y.z=n.z,y.w=-m.dot(n,p),m.multiplyByScalar(n,o,p),m.add(f,p,p),y=i[3],c(y)||(y=i[3]=new ce),y.x=-n.x,y.y=-n.y,y.z=-n.z,y.w=-m.dot(m.negate(n,VY),p),y=i[4],c(y)||(y=i[4]=new ce),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-m.dot(t,f),m.multiplyByScalar(t,d,p),m.add(e,p,p),y=i[5],c(y)||(y=i[5]=new ce),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-m.dot(m.negate(t,VY),p),this._cullingVolume};uh.prototype.getPixelDimensions=function(e,t,n,i,o){if(Rte(this),!c(e)||!c(t))throw new L("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new L("drawingBufferWidth must be greater than zero.");if(t<=0)throw new L("drawingBufferHeight must be greater than zero.");if(!c(n))throw new L("distance is required.");if(!c(i))throw new L("pixelRatio is required.");if(i<=0)throw new L("pixelRatio must be greater than zero.");if(!c(o))throw new L("A result object is required.");let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,l=i*s/t;return o.x=a,o.y=l,o};uh.prototype.clone=function(e){return c(e)||(e=new uh),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};uh.prototype.equals=function(e){return c(e)&&e instanceof uh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};uh.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof uh&&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 Oo=uh;function Zl(e){e=e??z.EMPTY_OBJECT,this._offCenterFrustum=new Oo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}Zl.packedLength=4;Zl.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Zl.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new Zl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B0(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new L("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new L("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new L("near must be greater than zero and less than 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(Zl.prototype,{projectionMatrix:{get:function(){return B0(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B0(this),this._offCenterFrustum}}});Zl.prototype.computeCullingVolume=function(e,t,n){return B0(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Zl.prototype.getPixelDimensions=function(e,t,n,i,o){return B0(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Zl.prototype.clone=function(e){return c(e)||(e=new Zl),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};Zl.prototype.equals=function(e){return!c(e)||!(e instanceof Zl)?!1:(B0(this),B0(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Zl.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof Zl)?!1:(B0(this),B0(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 sn=Zl;var IBt=_(T(),1);var LY={};function BGe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var YGe=32.184,HGe=2451545;function zte(e,t){t=ee.addSeconds(e,YGe,t);let n=ee.totalDays(t)-HGe;return t=ee.addSeconds(t,BGe(n),t),t}var a5=new ee(2451545,0,zn.TAI),zGe=1e3,Su=w.RADIANS_PER_DEGREE,ud=w.RADIANS_PER_ARCSECOND,wa=14959787e4,Gte=new te;function Kte(e,t,n,i,o,r,s){if(n<0&&(n=-n,o+=w.PI),n<0||n>w.PI)throw new L("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let a=e*(1-t),l=i-o,d=o,u=JGe(r-i,t);if(KGe(t,0)==="Hyperbolic"&&Math.abs(w.negativePiToPi(u))>=Math.acos(-1/t))throw new L("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");$Ge(l,n,d,Gte);let p=a*(1+t),y=Math.cos(u),h=Math.sin(u),g=1+t*y;if(g<=w.Epsilon10)throw new L("elements cannot be converted to cartesian");let x=p/g;return c(s)?(s.x=x*y,s.y=x*h,s.z=0):s=new m(x*y,x*h,0),te.multiplyByVector(Gte,s,s)}function KGe(e,t){if(e<0)throw new L("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function JGe(e,t){if(t<0||t>=1)throw new L("eccentricity out of range.");let n=jGe(e,t);return qGe(n,t)}var Ete=50,QGe=w.EPSILON8;function jGe(e,t){if(t<0||t>=1)throw new L("eccentricity out of range.");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;rQGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}if(r>=Ete)throw new L("Kepler equation did not converge");return o=i+n*w.TWO_PI,o}function qGe(e,t){if(t<0||t>=1)throw new L("eccentricity out of range.");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 $Ge(e,t,n,i){if(t<0||t>w.PI)throw new L("inclination out of range");let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),l=Math.cos(n),d=Math.sin(n);return c(i)?(i[0]=l*o-d*r*s,i[1]=d*o+l*r*s,i[2]=r*a,i[3]=-l*r-d*o*s,i[4]=-d*r+l*o*s,i[5]=o*a,i[6]=d*a,i[7]=-l*a,i[8]=s):i=new te(l*o-d*r*s,-l*r-d*o*s,d*a,d*o+l*r*s,-d*r+l*o*s,-l*a,r*a,o*a,s),i}var eEe=1.0000010178*wa,tEe=100.46645683*Su,nEe=129597742283429e-5*ud,Xte=16002,Ite=21863,Wte=32004,wte=10931,Pte=14529,vte=16368,Fte=15318,Ate=32794,iEe=64*1e-7*wa,oEe=-152*1e-7*wa,rEe=62*1e-7*wa,sEe=-8*1e-7*wa,aEe=32*1e-7*wa,cEe=-41*1e-7*wa,lEe=19*1e-7*wa,dEe=-11*1e-7*wa,uEe=-150*1e-7*wa,mEe=-46*1e-7*wa,fEe=68*1e-7*wa,hEe=54*1e-7*wa,pEe=14*1e-7*wa,bEe=24*1e-7*wa,yEe=-28*1e-7*wa,gEe=22*1e-7*wa,Mte=10,Nte=16002,kte=21863,Ute=10931,Ote=1473,Dte=32004,Bte=4387,Yte=73,xEe=-325*1e-7,_Ee=-322*1e-7,TEe=-79*1e-7,SEe=232*1e-7,CEe=-52*1e-7,VEe=97*1e-7,LEe=55*1e-7,ZEe=-41*1e-7,REe=-105*1e-7,GEe=-137*1e-7,EEe=258*1e-7,XEe=35*1e-7,IEe=-116*1e-7,WEe=-88*1e-7,wEe=-112*1e-7,PEe=-80*1e-7,rC=new ee(0,0,zn.TAI);function vEe(e,t){zte(e,rC);let i=(rC.dayNumber-a5.dayNumber+(rC.secondsOfDay-a5.secondsOfDay)/Kn.SECONDS_PER_DAY)/(Kn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=eEe+iEe*Math.cos(Xte*o)+uEe*Math.sin(Xte*o)+oEe*Math.cos(Ite*o)+mEe*Math.sin(Ite*o)+rEe*Math.cos(Wte*o)+fEe*Math.sin(Wte*o)+sEe*Math.cos(wte*o)+hEe*Math.sin(wte*o)+aEe*Math.cos(Pte*o)+pEe*Math.sin(Pte*o)+cEe*Math.cos(vte*o)+bEe*Math.sin(vte*o)+lEe*Math.cos(Fte*o)+yEe*Math.sin(Fte*o)+dEe*Math.cos(Ate*o)+gEe*Math.sin(Ate*o),s=tEe+nEe*i+xEe*Math.cos(Mte*o)+REe*Math.sin(Mte*o)+_Ee*Math.cos(Nte*o)+GEe*Math.sin(Nte*o)+TEe*Math.cos(kte*o)+EEe*Math.sin(kte*o)+SEe*Math.cos(Ute*o)+XEe*Math.sin(Ute*o)+CEe*Math.cos(Ote*o)+IEe*Math.sin(Ote*o)+VEe*Math.cos(Dte*o)+WEe*Math.sin(Dte*o)+LEe*Math.cos(Bte*o)+wEe*Math.sin(Bte*o)+ZEe*Math.cos(Yte*o)+PEe*Math.sin(Yte*o),a=.0167086342-.0004203654*i,l=102.93734808*Su+11612.3529*ud*i,d=469.97289*ud*i,u=174.87317577*Su-8679.27034*ud*i;return Kte(r,a,d,l,u,s,t)}function Jte(e,t){zte(e,rC);let i=(rC.dayNumber-a5.dayNumber+(rC.secondsOfDay-a5.secondsOfDay)/Kn.SECONDS_PER_DAY)/Kn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,l=.055545526-16e-9*i,d=5.15668983*Su,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,f=83.35324312*Su,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,y=125.04455501*Su,h=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,g=218.31664563*Su,x=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*Su+ud*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Su+ud*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),Z=134.96340251*Su+ud*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),R=357.52910918*Su+ud*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*Su-ud*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*S,v=4*S,P=6*S,F=2*Z,N=3*Z,b=4*Z,G=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-Z)-235.6*Math.cos(Z)+218.1*Math.cos(I-R)+181*Math.cos(I+Z),l+=.014216*Math.cos(I-Z)+.008551*Math.cos(I-F)-.001383*Math.cos(Z)+.001356*Math.cos(I+Z)-.001147*Math.cos(v-N)-914e-6*Math.cos(v-F)+869e-6*Math.cos(I-R-Z)-627e-6*Math.cos(I)-394e-6*Math.cos(v-b)+282e-6*Math.cos(I-R-F)-279e-6*Math.cos(S-Z)-236e-6*Math.cos(F)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(F-G),u+=486.26*Math.cos(I-G)-40.13*Math.cos(I)+37.51*Math.cos(G)+25.73*Math.cos(F-G)+19.97*Math.cos(I-R-G),p+=-55609*Math.sin(I-Z)-34711*Math.sin(I-F)-9792*Math.sin(Z)+9385*Math.sin(v-N)+7505*Math.sin(v-F)+5318*Math.sin(I+Z)+3484*Math.sin(v-b)-3417*Math.sin(I-R-Z)-2530*Math.sin(P-b)-2376*Math.sin(I)-2075*Math.sin(I-N)-1883*Math.sin(F)-1736*Math.sin(P-5*Z)+1626*Math.sin(R)-1370*Math.sin(P-N),h+=-5392*Math.sin(I-G)-540*Math.sin(R)-441*Math.sin(I)+423*Math.sin(G)-288*Math.sin(F-G),x+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-Z)-662.5*Math.sin(R)+396.3*Math.sin(Z)-218*Math.sin(I-R);let X=2*E,W=3*E;u+=46.997*Math.cos(E)*i-.614*Math.cos(I-G+E)*i+.614*Math.cos(I-G-E)*i-.0297*Math.cos(X)*o-.0335*Math.cos(E)*o+.0012*Math.cos(I-G+X)*o-16e-5*Math.cos(E)*r+4e-5*Math.cos(W)*r+4e-5*Math.cos(X)*r;let A=2.116*Math.sin(E)*i-.111*Math.sin(I-G-E)*i-.0015*Math.sin(E)*o;p+=A,x+=A,h+=-520.77*Math.sin(E)*i+13.66*Math.sin(I-G+E)*i+1.12*Math.sin(I-E)*i-1.06*Math.sin(G-E)*i+.66*Math.sin(X)*o+.371*Math.sin(E)*o-.035*Math.sin(I-G+X)*o-.015*Math.sin(I-G+E)*o+.0014*Math.sin(E)*r-.0011*Math.sin(W)*r-9e-4*Math.sin(X)*r,a*=zGe;let k=d+u*ud,B=f+p*ud,O=g+x*ud,H=y+h*ud;return Kte(a,l,k,B,H,O,t)}var Hte=.012300034,FEe=Hte/(Hte+1)*-1;function AEe(e,t){return t=Jte(e,t),m.multiplyByScalar(t,FEe,t)}var Qte=new te(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),aE=new m;LY.computeSunPositionInEarthInertialFrame=function(e,t){return c(e)||(e=ee.now()),c(t)||(t=new m),aE=vEe(e,aE),t=m.negate(aE,t),AEe(e,aE),m.subtract(t,aE,t),te.multiplyByVector(Qte,t,t),t};LY.computeMoonPositionInEarthInertialFrame=function(e,t){return c(e)||(e=ee.now()),t=Jte(e,t),te.multiplyByVector(Qte,t,t),t};var Y0=LY;var wBt=_(T(),1),c5={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};c5.getMorphTime=function(e){return e===c5.SCENE3D?1:e===c5.MORPHING?void 0:0};var se=Object.freeze(c5);var ABt=_(T(),1);function MEe(e){e=e??z.EMPTY_OBJECT,this.color=Y.clone(e.color??Y.WHITE),this.intensity=e.intensity??2}var Xp=MEe;function sC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new je,this._viewportCartesian4=new ce,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new ce,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=te.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new te,this._viewRotation=new te,this._inverseViewRotation=new te,this._viewRotation3D=new te,this._inverseViewRotation3D=new te,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new te,this._normal3DDirty=!0,this._normal3D=new te,this._inverseNormalDirty=!0,this._inverseNormal=new te,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new te,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Bn,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 M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Y,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(sC.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!je.equals(e,this._viewport)){je.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 qte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return qte(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.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,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),te.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return RY(this),this._view3D}},viewRotation:{get:function(){return RY(this),this._viewRotation}},viewRotation3D:{get:function(){return RY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return tne(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return tne(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return JEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return QEe(this),this._modelView}},modelView3D:{get:function(){return jEe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return iXe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return qEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return $Ee(this),this._inverseModelView3D}},viewProjection:{get:function(){return eXe(this),this._viewProjection}},inverseViewProjection:{get:function(){return tXe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return nXe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return oXe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return rXe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return sXe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return aXe(this),this._normal}},normal3D:{get:function(){return cXe(this),this._normal3D}},inverseNormal:{get:function(){return lXe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return dXe(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 ene(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return ene(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 this._ellipsoid??re.default}}});function NEe(e,t){M.clone(t,e._view),M.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 kEe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function UEe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function OEe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var jte=new m,DEe=new M;function BEe(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(c(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,jte)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,jte)),e._encodedCameraPositionMCDirty=!0,!c(i))return;e._eyeEllipsoidNormalEC=te.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=wt.eastNorthUpToFixedFrame(i,n,DEe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),w.equalsEpsilon(n._radii.x,n._radii.y,w.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var ZY=new te,YEe=new pe;function HEe(e,t){wt.computeIcrfToCentralBodyFixedMatrix(t.time,ZY);let n=Y0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);te.multiplyByVector(ZY,n,n),m.normalize(n,e._sunDirectionWC),n=te.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Y0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),te.multiplyByVector(ZY,n,n),te.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,YEe);i.project(r,e._sunPositionColumbusView)}sC.prototype.updateCamera=function(e){NEe(this,e.viewMatrix),kEe(this,e.inverseViewMatrix),BEe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==se.SCENE2D&&e.frustum instanceof sn};sC.prototype.updateFrustum=function(e){UEe(this,e.projectionMatrix),c(e.infiniteProjectionMatrix)&&OEe(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;c(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};sC.prototype.updatePass=function(e){this._pass=e};var zEe=[],KEe=new Xp;sC.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===se.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),HEe(this,e);let n=e.light??KEe;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=te.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=c(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??zEe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let l=e.atmosphere;c(l)&&(this._atmosphereHsbShift=m.fromElements(l.hueShift,l.saturationShift,l.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=l.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(l.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=l.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(l.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=l.mieScaleHeight,this._atmosphereMieAnisotropy=l.mieAnisotropy,this._atmosphereDynamicLighting=l.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=wt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,f;c(d)?u.height>u.width?f=Math.tan(.5*d)*2/u.height:f=Math.tan(.5*d)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,Y.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function qte(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function JEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==se.SCENE2D&&e._mode!==se.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function QEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function jEe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function qEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function $Ee(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function eXe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function tXe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function nXe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function iXe(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 oXe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function rXe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function sXe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function aXe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),te.transpose(t,t)}}function cXe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),te.transpose(t,t)}}function lXe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),te.transpose(t,t)}}function dXe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),te.transpose(t,t)}}var $te=new m;function ene(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,$te),Bn.fromCartesian($te,e._encodedCameraPositionMC))}var uXe=new m,mXe=new m,fXe=new m,hXe=new m,pXe=new pe,bXe=new m,yXe=new M;function gXe(e,t,n,i,o,r,s,a){let l=uXe;l.x=e.y,l.y=e.z,l.z=e.x;let d=mXe;d.x=n.y,d.y=n.z,d.z=n.x;let u=fXe;u.x=i.y,u.y=i.z,u.z=i.x;let f=hXe;f.x=t.y,f.y=t.z,f.z=t.x,r===se.SCENE2D&&(l.z=o*.5);let p=s.unproject(l,pXe);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 y=s.ellipsoid,h=y.cartographicToCartesian(p,bXe),g=wt.eastNorthUpToFixedFrame(h,y,yXe);return M.multiplyByPointAsVector(g,d,d),M.multiplyByPointAsVector(g,u,u),M.multiplyByPointAsVector(g,f,f),c(a)||(a=new M),a[0]=d.x,a[1]=u.x,a[2]=-f.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-f.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-f.z,a[11]=0,a[12]=-m.dot(d,h),a[13]=-m.dot(u,h),a[14]=m.dot(f,h),a[15]=1,a}function RY(e){e._view3DDirty&&(e._mode===se.SCENE3D?M.clone(e._view,e._view3D):gXe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function tne(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var cE=sC;function Cu(e,t){C.defined("canvas",e);let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let s=c(n)?n(e,o):xXe(e,o,i),l=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=l,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new oE(this),this._textureCache=new rE;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),mt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),mt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),mt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),mt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),mt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),mt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),mt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),mt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),mt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),mt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),mt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);mt._minimumAliasedLineWidth=u[0],mt._maximumAliasedLineWidth=u[1];let f=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);mt._minimumAliasedPointSize=f[0],mt._maximumAliasedPointSize=f[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);mt._maximumViewportWidth=p[0],mt._maximumViewportHeight=p[1];let y=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);mt._highpFloatSupported=y.precision!==0;let h=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);mt._highpIntSupported=h.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!Cr(d,["OES_standard_derivatives"]),this._blendMinmax=!!Cr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!Cr(d,["OES_element_index_uint"]),this._depthTexture=!!Cr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Cr(d,["EXT_frag_depth"]),this._debugShaders=Cr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!Cr(d,["OES_texture_float"]),this._textureHalfFloat=!!Cr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!Cr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Cr(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Cr(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Cr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Cr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Cr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!Cr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Cr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Cr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!Cr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!Cr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Cr(d,["EXT_texture_compression_bptc"]),Ll.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let g=r?Cr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=g,mt._maximumTextureFilterAnisotropy=c(g)?d.getParameter(g.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let x,S,V,Z,R,E,I,v,P,F;if(l){let X=this;x=function(){return X._gl.createVertexArray()},S=function(W){X._gl.bindVertexArray(W)},V=function(W){X._gl.deleteVertexArray(W)},Z=function(W,A,k,B,O){d.drawElementsInstanced(W,A,k,B,O)},R=function(W,A,k,B){d.drawArraysInstanced(W,A,k,B)},E=function(W,A){d.vertexAttribDivisor(W,A)},I=function(W){d.drawBuffers(W)}}else v=Cr(d,["OES_vertex_array_object"]),c(v)&&(x=function(){return v.createVertexArrayOES()},S=function(X){v.bindVertexArrayOES(X)},V=function(X){v.deleteVertexArrayOES(X)}),P=Cr(d,["ANGLE_instanced_arrays"]),c(P)&&(Z=function(X,W,A,k,B){P.drawElementsInstancedANGLE(X,W,A,k,B)},R=function(X,W,A,k){P.drawArraysInstancedANGLE(X,W,A,k)},E=function(X,W){P.vertexAttribDivisorANGLE(X,W)}),F=Cr(d,["WEBGL_draw_buffers"]),c(F)&&(I=function(X){F.drawBuffersWEBGL(X)});this.glCreateVertexArray=x,this.glBindVertexArray=S,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=Z,this.glDrawArraysInstanced=R,this.glVertexAttribDivisor=E,this.glDrawBuffers=I,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!F,mt._maximumDrawBuffers=this.drawBuffers?d.getParameter(oe.MAX_DRAW_BUFFERS):1,mt._maximumColorAttachments=this.drawBuffers?d.getParameter(oe.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Y(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new cE,b=new sc(this),G=Oe.fromCache();this._defaultPassState=b,this._defaultRenderState=G,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=G,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let X=0;X"u")throw new le("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(!c(r))throw new le("The browser supports WebGL, but initialization failed.");return r}function _Xe(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 TXe(e,t,n,i){let o=`${_Xe(e,i)}: ${t.name}(`;for(let r=0;r=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=VXe(this._originalGLContext,e?SXe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Pt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,0])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Pt({context:this,pixelFormat:ke.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 Pt({context:this,pixelFormat:ke.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 Uo({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 LXe}}});function ZXe(e){if(e.validateFramebuffer){let t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let i;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";break}throw new L(i)}}}function nne(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Oe.partialApply(e._gl,o,t,r,n,i)}var GY;typeof WebGLRenderingContext<"u"&&(GY=[oe.BACK]);function EY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=GY;if(c(t))t._bind(),ZXe(e),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var RXe=new ti;Cu.prototype.clear=function(e,t){e=e??RXe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;c(o)&&(Y.equals(this._clearColor,o)||(Y.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),c(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),c(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;nne(this,a,t,!0);let l=e.framebuffer??t.framebuffer;EY(this,l),n.clear(i)};function GXe(e,t,n,i,o){if(c(t)&&o.depthTest&&o.depthTest.enabled&&!t.hasDepthAttachment)throw new L("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");EY(e,t),nne(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function EXe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,l=t.instanceCount;if(!ve.validate(o))throw new L("drawCommand.primitiveType is required and must be valid.");if(C.defined("drawCommand.vertexArray",r),C.typeOf.number.greaterThanOrEquals("drawCommand.offset",s,0),c(a)&&C.typeOf.number.greaterThanOrEquals("drawCommand.count",a,0),C.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new L("Instanced arrays extension is not supported");e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;c(d)?(s=s*d.bytesPerIndex,c(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,l===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,l)):(c(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,l===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,l)),r._unBind()}Cu.prototype.draw=function(e,t,n,i){C.defined("drawCommand",e),C.defined("drawCommand.shaderProgram",e._shaderProgram),t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,GXe(this,o,t,n,r),EXe(this,e,n,i)};Cu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=GY;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype);let l=ke.createTypedArray(ke.RGBA,a,o,r);return EY(this,s),t.readPixels(n,i,o,r,ke.RGBA,Ue.toWebGLConstant(a,this),l),l};var ine={position:0,textureCoordinates:1};Cu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!c(e)){let t=new dt({attributes:{position:new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:ve.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:ine,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Cu.prototype.createViewportQuadCommand=function(e,t){return t=t??z.EMPTY_OBJECT,new et({vertexArray:this.getViewportQuadVertexArray(),primitiveType:ve.TRIANGLES,renderState:t.renderState,shaderProgram:tn.fromCache({context:this,vertexShaderSource:fx,fragmentShaderSource:e,attributeLocations:ine}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Cu.prototype.getObjectByPickColor=function(e){return C.defined("pickColor",e),this._pickObjects[e.toRgba()]};function XY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(XY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});XY.prototype.destroy=function(){delete this._pickObjects[this.key]};Cu.prototype.createPickId=function(e){C.defined("object",e),++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new le("Out of unique Pick IDs.");return this._pickObjects[t]=e,new XY(this._pickObjects,t,Y.fromRgba(t))};Cu.prototype.isDestroyed=function(){return!1};Cu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];c(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(),he(this)};var lE=Cu;var hYt=_(T(),1);var D3t=_(T(),1);function aC(e){e=e??z.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:l}=e;if(C.defined("options.context",t),C.defined("options.width",n),C.defined("options.height",i),this._width=n,this._height=i,c(o)!==c(r))throw new L("Both color renderbuffer and texture attachments must be provided.");if(c(s)!==c(a))throw new L("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Fr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:l}),this._colorFramebuffer=new Fr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:l})}aC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};aC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};aC.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),c(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)};aC.prototype.isDestroyed=function(){return!1};aC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),he(this)};var dE=aC;var tYt=_(T(),1);var H3t=_(T(),1);var Rl={RGBA4:oe.RGBA4,RGBA8:oe.RGBA8,RGBA16F:oe.RGBA16F,RGBA32F:oe.RGBA32F,RGB5_A1:oe.RGB5_A1,RGB565:oe.RGB565,DEPTH_COMPONENT16:oe.DEPTH_COMPONENT16,STENCIL_INDEX8:oe.STENCIL_INDEX8,DEPTH_STENCIL:oe.DEPTH_STENCIL,DEPTH24_STENCIL8:oe.DEPTH24_STENCIL8,validate:function(e){return e===Rl.RGBA4||e===Rl.RGBA8||e===Rl.RGBA16F||e===Rl.RGBA32F||e===Rl.RGB5_A1||e===Rl.RGB565||e===Rl.DEPTH_COMPONENT16||e===Rl.STENCIL_INDEX8||e===Rl.DEPTH_STENCIL||e===Rl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===oe.FLOAT?Rl.RGBA32F:e===oe.HALF_FLOAT_OES?Rl.RGBA16F:Rl.RGBA8}},ac=Object.freeze(Rl);function uE(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context);let n=e.context._gl,i=mt.maximumRenderbufferSize,o=e.format??ac.RGBA4,r=c(e.width)?e.width:n.drawingBufferWidth,s=c(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;if(!ac.validate(o))throw new L("Invalid format.");if(C.typeOf.number.greaterThan("width",r,0),r>i)throw new L(`Width must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);if(C.typeOf.number.greaterThan("height",s,0),s>i)throw new L(`Height must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);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(uE.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});uE.prototype._getRenderbuffer=function(){return this._renderbuffer};uE.prototype.isDestroyed=function(){return!1};uE.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),he(this)};var md=uE;function Ss(e){if(e=e??z.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,!this._color&&!this._depth&&!this._depthStencil)throw new L("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new L("Cannot have both a depth and depth-stencil attachment.");this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=c(i)&&this._pixelDatatype!==i||c(o)&&this._pixelFormat!==o,l=n===1?c(this._framebuffer):c(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!l||this._color&&!c(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(!c(t)||!c(n))throw new L("width and height must be defined.");if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ke.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;s1){let a=ac.getColorFormat(o);this._colorRenderbuffers[s]=new md({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Pt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:en.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new md({context:e,width:t,height:n,format:ac.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new md({context:e,width:t,height:n,format:ac.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Pt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:en.NEAREST}):this._depthRenderbuffer=new md({context:e,width:t,height:n,format:ac.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new dE({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 Fr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");return this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){if(t=t??0,this._createColorAttachments)throw new L("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){if(t=t??0,this._createColorAttachments)throw new L("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthStencilTexture is called.");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!c(t[r])))throw new L("urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ge.createIfNeeded(t.positiveX).fetchImage(i),Ge.createIfNeeded(t.negativeX).fetchImage(i),Ge.createIfNeeded(t.positiveY).fetchImage(i),Ge.createIfNeeded(t.negativeY).fetchImage(i),Ge.createIfNeeded(t.positiveZ).fetchImage(i),Ge.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Uo({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var mE=XXe;var kYt=_(T(),1);var VYt=_(T(),1);var Vx={VERTEX:0,FRAGMENT:1,BOTH:2};Vx.includesVertexShader=function(e){return C.typeOf.number("destination",e),e===Vx.VERTEX||e===Vx.BOTH};Vx.includesFragmentShader=function(e){return C.typeOf.number("destination",e),e===Vx.FRAGMENT||e===Vx.BOTH};var xe=Object.freeze(Vx);var ZYt=_(T(),1);function IY(e){this.name=e,this.fields=[]}IY.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};IY.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var fE=IY;var EYt=_(T(),1);function WY(e){this.signature=e,this.body=[]}WY.prototype.addLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new L(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;ia?(e.childNode1=new pE({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new pE({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new pE({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new pE({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 cC=wY;var one=16;function Gl(e){e=e??z.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new D(one,one);C.typeOf.number.greaterThanOrEquals("options.borderWidthInPixels",t,0),C.typeOf.number.greaterThan("options.initialSize.x",n.x,0),C.typeOf.number.greaterThan("options.initialSize.y",n.y,0),this._pixelFormat=e.pixelFormat??ke.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(Gl.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 c(this._texture)?this._texture.sizeInBytes:0}}});Gl.prototype.computeTextureCoordinates=function(e,t){C.typeOf.number.greaterThanOrEquals("index",e,0);let n=this._texture,i=this._rectangles[e];if(c(t)||(t=new je),!c(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,l=i.x,d=i.y,u=this._subRegions.get(e);if(c(u)){let f=this._rectangles[u];l+=f.x,d+=f.y}return t.x=l/o,t.y=d/r,t.width=s/o,t.height=a/r,t};Gl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Pt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,l=s._textureTarget,d=this._texture,u=new Fr({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(l,s._texture),u._bind();let f=this.rectangles,p=this._subRegions;for(let y=0;ynew rne({index:Z,image:V})).filter((V,Z)=>c(V.image)&&!c(l.get(Z))),u=0,f=0,p=0;for(let V=t;V=1;)h*=2,s>a?a*=h:s*=h;d.sort(({image:V},{image:Z})=>Z.height*Z.width-V.height*V.width);let g=new Array(this._nextIndex);for(let V of this._subRegions.keys())c(l.get(V))&&(g[V]=i[V]);let x,S=!1;for(;!S;){x=new cC({height:a,width:s,borderPadding:n});let V;for(V=0;Va?a*=2:s*=2;break}g[Z]=E.rectangle}S=V===d.length}this._texturePacker=x,this._texture=this._copyFromTexture(e,s,a,g),r.destroy(),this._rectangles=g,this._guid=Hn()};Gl.prototype.getImageIndex=function(e){return C.typeOf.string("id",e),this._indexById.get(e)};Gl.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}),c(n)&&n(e)}catch(s){if(c(i)){i(s);return}}};function rne({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Gl.prototype._addImage=function(e,t){return C.typeOf.number.greaterThanOrEquals("index",e,0),C.defined("image",t),new Promise((n,i)=>{this._imagesToAddQueue.push(new rne({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Gl.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=await PXe(t,e),C.defined("image",t),this.isDestroyed()||!c(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Gl.prototype.addImageSubRegion=function(e,t){C.typeOf.string("id",e),C.defined("subRegion",t);let n=this._indexById.get(e);if(!c(n))throw new le(`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(l=>l===-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 C.typeOf.number.lessThanOrEquals("subRegion.x",t.x,s.width),C.typeOf.number.lessThanOrEquals("subRegion.x + subRegion.width",t.x+t.width,s.width),C.typeOf.number.lessThanOrEquals("subRegion.y",t.y,s.height),C.typeOf.number.lessThanOrEquals("subRegion.y + subRegion.height",t.y+t.height,s.height),o})};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{c(e)&&e(-1)}),he(this)};var Zx=Gl;var gHt=_(T(),1);function Ns(e,t,n,i){if(C.defined("context",e),!t||t.length===0)throw new L("At least one attribute is required.");let o=Ns._verifyAttributes(t);n=n??0;let r=[],s={},a,l,d=o.length;for(let f=0;f0?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;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(c(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let l=0;l0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes=this._size)throw new L("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new L("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let n=this._allBuffers;for(let i=0,o=n.length;i0){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;t0&&(this._hash={},e.length=0)};var Zt=Rx;var UHt=_(T(),1);function fd(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(fd.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}}});fd.packedLength=2;fd.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,t[n++]=e.near,t[n]=e.far,t};fd.unpack=function(e,t,n){if(!c(e))throw new L("array is required");return t=t??0,c(n)||(n=new fd),n.near=e[t++],n.far=e[t],n};fd.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.far===t.far};fd.clone=function(e,t){if(c(e))return c(t)||(t=new fd),t.near=e.near,t.far=e.far,t};fd.prototype.clone=function(e){return fd.clone(this,e)};fd.prototype.equals=function(e){return fd.equals(this,e)};var vt=fd;var YHt=_(T(),1);function Vu(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Vu.clone=function(e,t){if(c(e))return c(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){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=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){if(!c(e))throw new L("array is required");return t=t??0,c(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||c(e)&&c(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 Nt=Vu;var zHt=_(T(),1),Gx={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,CLIP_TO_GROUND:7},ze=Object.freeze(Gx);function Lu(e){return e===Gx.CLAMP_TO_GROUND||e===Gx.CLAMP_TO_3D_TILE||e===Gx.CLAMP_TO_TERRAIN}function lC(e){return e===Gx.RELATIVE_TO_GROUND||e===Gx.RELATIVE_TO_3D_TILE||e===Gx.RELATIVE_TO_TERRAIN}var JHt=_(T(),1),UXe={CENTER:0,LEFT:1,RIGHT:-1},xi=Object.freeze(UXe);var jHt=_(T(),1),OXe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Mn=Object.freeze(OXe);var $Ht=_(T(),1),DXe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),ut=DXe;var izt=_(T(),1);function vm(){L.throwInstantiationError()}Object.defineProperties(vm.prototype,{isConstant:{get:L.throwInstantiationError},definitionChanged:{get:L.throwInstantiationError}});vm.prototype.getValue=L.throwInstantiationError;vm.prototype.equals=L.throwInstantiationError;vm.equals=function(e,t){return e===t||c(e)&&e.equals(t)};vm.arrayEquals=function(e,t){if(e===t)return!0;if(!c(e)||!c(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i-1;o--)r=t[o],c(r._billboard)&&c(r._position)&&s.set(r.id,new sne(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._billboard)&&c(r._position)?s.contains(r.id)||s.set(r.id,new sne(r)):(vY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],vY(s.get(r.id),r,a),s.remove(r.id)};function vY(e,t,n){c(e)&&(e.billboard=void 0,n.removeBillboard(t))}var yE=z0;var $rn=_(T(),1);var Azt=_(T(),1);var uIe=new m;function mh(e){e=e??z.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(C.typeOf.object("min",t),C.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}mh.fromDimensions=function(e){e=e??z.EMPTY_OBJECT;let t=e.dimensions;C.typeOf.object("dimensions",t),C.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),C.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),C.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new mh({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};mh.fromAxisAlignedBoundingBox=function(e){return C.typeOf.object("boundindBox",e),new mh({minimum:e.minimum,maximum:e.maximum})};mh.packedLength=2*m.packedLength+1;mh.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=e._offsetAttribute??-1,t};var cne=new m,lne=new m,ane={minimum:cne,maximum:lne,offsetAttribute:void 0};mh.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t,cne),o=m.unpack(e,t+m.packedLength,lne),r=e[t+m.packedLength*2];return c(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(ane.offsetAttribute=r===-1?void 0:r,new mh(ane))};mh.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new fn,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 Ee({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,uIe),a=m.magnitude(s)*.5;if(c(e._offsetAttribute)){let l=r.length,d=e._offsetAttribute===$t.NONE?0:1,u=new Uint8Array(l/3).fill(d);i.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new dt({attributes:i,indices:o,primitiveType:ve.LINES,boundingSphere:new ue(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var Fm=mh;var Dzt=_(T(),1);function dC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([Y.floatToByte(e),Y.floatToByte(t),Y.floatToByte(n),Y.floatToByte(i)])}Object.defineProperties(dC.prototype,{componentDatatype:{get:function(){return q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});dC.fromColor=function(e){if(!c(e))throw new L("color is required.");return new dC(e.red,e.green,e.blue,e.alpha)};dC.toValue=function(e,t){if(!c(e))throw new L("color is required.");return c(t)?e.toBytes(t):new Uint8Array(e.toBytes())};dC.equals=function(e,t){return e===t||c(e)&&c(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=dC;var Kzt=_(T(),1);function gE(e,t){if(e=e??0,t=t??Number.MAX_VALUE,t<=e)throw new L("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(gE.prototype,{componentDatatype:{get:function(){return q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});gE.fromDistanceDisplayCondition=function(e){if(!c(e))throw new L("distanceDisplayCondition is required.");if(e.far<=e.near)throw new L("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new gE(e.near,e.far)};gE.toValue=function(e,t){if(!c(e))throw new L("distanceDisplayCondition is required.");return c(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=gE;var eKt=_(T(),1);function mIe(e){if(e=e??z.EMPTY_OBJECT,!c(e.geometry))throw new L("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Rt=mIe;var uKt=_(T(),1);var aKt=_(T(),1);function jo(e){e=e??z.EMPTY_OBJECT,this.start=c(e.start)?ee.clone(e.start):new ee,this.stop=c(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var uC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){C.typeOf.object("options",e),C.typeOf.string("options.iso8601",e.iso8601);let n=e.iso8601.split("/");if(n.length!==2)throw new L("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return c(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(uC.start=i,uC.stop=o,uC.isStartIncluded=r,uC.isStopIncluded=s,uC.data=a,new jo(uC))};jo.toIso8601=function(e,t){return C.typeOf.object("timeInterval",e),`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(c(e))return c(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||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||c(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||c(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(C.typeOf.object("left",e),!c(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,l=ee.greaterThanOrEquals(s,o)&&ee.greaterThanOrEquals(r,s),d=!l&&ee.lessThanOrEquals(s,o)&&ee.lessThanOrEquals(o,a);if(!l&&!d)return jo.clone(jo.EMPTY,n);let u=e.isStartIncluded,f=e.isStopIncluded,p=t.isStartIncluded,y=t.isStopIncluded,h=ee.lessThan(r,a);return c(n)||(n=new jo),n.start=l?s:o,n.isStartIncluded=u&&p||!ee.equals(s,o)&&(l&&p||d&&u),n.stop=h?r:a,n.isStopIncluded=h?f:f&&y||!ee.equals(a,r)&&y,n.data=c(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(C.typeOf.object("timeInterval",e),C.typeOf.object("julianDate",t),e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.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 ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var Zn=jo;var dne=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),une=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),fIe=Object.freeze(new Zn({start:dne,stop:une})),hIe={MINIMUM_VALUE:dne,MAXIMUM_VALUE:une,MAXIMUM_INTERVAL:fIe},Ye=hIe;var bKt=_(T(),1);function xE(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(xE.prototype,{componentDatatype:{get:function(){return q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});xE.fromCartesian3=function(e){return C.defined("offset",e),new xE(e.x,e.y,e.z)};xE.toValue=function(e,t){return C.defined("offset",e),c(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=xE;var TKt=_(T(),1);function l5(e){e=e??!0,this.value=l5.toValue(e)}Object.defineProperties(l5.prototype,{componentDatatype:{get:function(){return q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});l5.toValue=function(e,t){if(!c(e))throw new L("show is required.");return c(t)?(t[0]=e,t):new Uint8Array([e])};var Tn=l5;var AQt=_(T(),1);var CKt=_(T(),1),_E=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; -void main() +} +} +`;var Kcn=x(T(),1),av=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) { -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 +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; } -`;var LKt=_(T(),1),TE=`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() +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 jcn=x(T(),1),cv=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_tangentEC = czm_normal * tangent; -v_bitangentEC = czm_normal * bitangent; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`;var RKt=_(T(),1),SE=`in vec3 v_positionEC; -in vec3 v_normalEC; -void main() +`;var qcn=x(T(),1),lv=`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 eln=x(T(),1),dv=`float czm_reverseLogDepth(float logZ) { -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); +#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 EKt=_(T(),1),CE=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -void main() +`;var nln=x(T(),1),uv=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec3 czm_RGBToHSB(vec3 rgb) { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +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 IKt=_(T(),1),VE=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; -void main() +`;var oln=x(T(),1),mv=`vec3 RGBtoHCV(vec3 rgb) { -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 +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); } -`;var wKt=_(T(),1),LE=`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() +vec3 czm_RGBToHSL(vec3 rgb) { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +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 eJt=_(T(),1);var DKt=_(T(),1);var FKt=_(T(),1);var pIe={ADD:oe.FUNC_ADD,SUBTRACT:oe.FUNC_SUBTRACT,REVERSE_SUBTRACT:oe.FUNC_REVERSE_SUBTRACT,MIN:oe.MIN,MAX:oe.MAX},Pa=Object.freeze(pIe);var NKt=_(T(),1);var bIe={ZERO:oe.ZERO,ONE:oe.ONE,SOURCE_COLOR:oe.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:oe.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:oe.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:oe.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:oe.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:oe.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:oe.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:oe.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:oe.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:oe.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:oe.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:oe.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:oe.SRC_ALPHA_SATURATE},Co=Object.freeze(bIe);var yIe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE,functionDestinationAlpha:Co.ONE})},un=Object.freeze(yIe);var HKt=_(T(),1);var gIe={FRONT:oe.FRONT,BACK:oe.BACK,FRONT_AND_BACK:oe.FRONT_AND_BACK},_i=Object.freeze(gIe);function mC(e){e=e??z.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(mC.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}}});mC.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),c(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};mC.prototype.isTranslucent=function(){return c(this.material)&&this.material.isTranslucent()||!c(this.material)&&this.translucent};mC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=He(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};mC.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:_i.BACK}),c(n)&&(i=St(n,i,!0)),i};var no=mC;var VQt=_(T(),1);var nJt=_(T(),1),ZE=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var sln=x(T(),1),hv=`vec3 czm_RGBToXYZ(vec3 rgb) { -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; +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 oJt=_(T(),1),RE=`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 cln=x(T(),1),fv=`float czm_round(float value) { +return floor(value + 0.5); } -`;var sJt=_(T(),1),GE=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +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 dln=x(T(),1),pv=`vec3 czm_saturation(vec3 rgb, float adjustment) { -czm_material material = czm_getDefaultMaterial(materialInput); -vec2 st = materialInput.st; -float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); -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; +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +vec3 intensity = vec3(dot(rgb, W)); +return mix(intensity, rgb, adjustment); } -`;var cJt=_(T(),1),EE=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var mln=x(T(),1),bv=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { -czm_material material = czm_getDefaultMaterial(materialInput); -float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); -vec4 color = mix(lightColor, darkColor, b); -color = czm_gammaCorrect(color); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; +return czm_unpackDepth(czm_textureCube(shadowMap, d)); } -`;var dJt=_(T(),1),XE=`uniform sampler2D heights; -uniform sampler2D colors; -float getHeight(int idx, float invTexSize) +float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) { -vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); -#ifdef OES_texture_float -return texture(heights, uv).x; +#ifdef USE_SHADOW_DEPTH_TEXTURE +return texture(shadowMap, uv).r; #else -return czm_unpackFloat(texture(heights, uv)); +return czm_unpackDepth(texture(shadowMap, uv)); #endif } -czm_material czm_getMaterial(czm_materialInput materialInput) +float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) { -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); -if (height < minHeight || height > maxHeight) { -material.diffuse = vec3(0.0); -material.alpha = 0.0; -return material; -} -int idxBelow = 0; -int idxAbove = heightsDimensions.x; -float heightBelow = minHeight; -float heightAbove = maxHeight; -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; +return step(depth, czm_sampleShadowMap(shadowMap, uv)); } +float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) +{ +return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -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); -if (color.a > 0.0) +`;var fln=x(T(),1),gv=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { -color.rgb /= color.a; +#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; } -color.rgb = czm_gammaCorrect(color.rgb); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; +#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); } -`;var mJt=_(T(),1),IE=`uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) +#else +float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) { -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; +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 alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; +float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); #endif -vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; +return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } -`;var hJt=_(T(),1),WE=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; -czm_material czm_getMaterial(czm_materialInput materialInput) +#endif +`;var bln=x(T(),1),yv=`float czm_signNotZero(float value) { -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; +return value >= 0.0 ? 1.0 : -1.0; } -`;var bJt=_(T(),1),wE=`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) +vec2 czm_signNotZero(vec2 value) { -float r = distance(t, coord + 1.0) * scalar; -float s = distance(t, coord - 1.0) * scalar; -q = min(min(r, s), q); +return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); } -return clamp(q, 0.0, 1.0); +vec3 czm_signNotZero(vec3 value) +{ +return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); } -czm_material czm_getMaterial(czm_materialInput materialInput) +vec4 czm_signNotZero(vec4 value) { -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; +return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -`;var gJt=_(T(),1),PE=`uniform vec4 color; -uniform float cellAlpha; -uniform vec2 lineCount; -uniform vec2 lineThickness; -uniform vec2 lineOffset; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var yln=x(T(),1),xv=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) { -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; -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -const float fuzz = 1.2; -vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; -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 -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 -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; +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 _Jt=_(T(),1),vE=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var Tln=x(T(),1),Tv=`vec3 czm_srgbToLinear(vec3 srgbIn) { -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; +return pow(srgbIn, vec3(2.2)); } -`;var SJt=_(T(),1),FE=`uniform vec4 color; -float getPointOnLine(vec2 p0, vec2 p1, float x) +vec4 czm_srgbToLinear(vec4 srgbIn) { -float slope = (p0.y - p1.y) / (p0.x - p1.x); -return slope * (x - p0.x) + p0.y; +vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); +return vec4(linearOut, srgbIn.a); } -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var Sln=x(T(),1),_v=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) { -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; +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 Rln=x(T(),1),Sv=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 +return texture(sampler, p); #else -float base = 0.975; +return textureCube(sampler, p); #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); -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; +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 VJt=_(T(),1),AE=`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 -); +`;var Vln=x(T(),1),Zv=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { +vec4 transformedPlane = transform * plane; +float normalMagnitude = length(transformedPlane.xyz); +return transformedPlane / normalMagnitude; } -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var Aln=x(T(),1),Rv=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { -czm_material material = czm_getDefaultMaterial(materialInput); -vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; -float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); -float maskIndex = floor(dashPosition * maskLength); -float maskTest = floor(dashPattern / pow(2.0, maskIndex)); -vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; -if (fragColor.a < 0.005) { -discard; +vec3 highDifference = high - czm_encodedCameraPositionMCHigh; +if (length(highDifference) == 0.0) { +highDifference = vec3(0); } -fragColor = czm_gammaCorrect(fragColor); -material.emission = fragColor.rgb; -material.alpha = fragColor.a; -return material; +vec3 lowDifference = low - czm_encodedCameraPositionMCLow; +return vec4(highDifference + lowDifference, 1.0); } -`;var ZJt=_(T(),1),ME=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var Lln=x(T(),1),Cv=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -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)); +float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); +if (czm_sceneMode == czm_sceneMode3D) { +diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); } -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; +diffuse = clamp(diffuse, 0.0, 1.0); +float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); +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 GJt=_(T(),1),NE=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var vln=x(T(),1),Vv=`mat2 czm_transpose(mat2 matrix) { -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); -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; +return mat2( +matrix[0][0], matrix[1][0], +matrix[0][1], matrix[1][1]); } -`;var XJt=_(T(),1),kE=`uniform vec4 color; -uniform vec4 rimColor; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) +mat3 czm_transpose(mat3 matrix) { -czm_material material = czm_getDefaultMaterial(materialInput); -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; +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]); } -`;var WJt=_(T(),1),UE=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) +mat4 czm_transpose(mat4 matrix) { -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; +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 PJt=_(T(),1),OE=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var Iln=x(T(),1),Ev=`float czm_unpackDepth(vec4 packedDepth) { -czm_material material = czm_getDefaultMaterial(materialInput); -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; +return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } -`;var FJt=_(T(),1),DE=`uniform vec4 waterColor; -uniform vec4 landColor; -czm_material czm_getMaterial(czm_materialInput materialInput) +`;var Xln=x(T(),1),Av=`float czm_unpackFloat(vec4 packedFloat) { -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 MJt=_(T(),1),BE=`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) +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) { -czm_material material = czm_getDefaultMaterial(materialInput); -float time = czm_frameNumber * animationSpeed; -float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); -float specularMapValue = texture(specularMap, materialInput.st).r; -vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); -vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); -normalTangentSpace.xy /= fade; -normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); -normalTangentSpace = normalize(normalTangentSpace); -float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); -material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; -material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); -material.diffuse += (0.1 * tsPerturbationRatio); -material.diffuse = material.diffuse; -material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); -material.specular = specularIntensity; -material.shininess = 10.0; -return material; +return 0.0; } -`;function Je(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=e.minificationFilter??Jt.LINEAR,this._magnificationFilter=e.magnificationFilter??di.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,xIe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),c(Je._uniformList[this.type])||(Je._uniformList[this.type]=Object.keys(this._uniforms))}Je._uniformList={};Je.fromType=function(e,t){if(!c(Je._materialCache.getMaterial(e)))throw new L(`material with type '${e}' does not exist.`);let n=new Je({fabric:{type:e}});if(c(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Je.prototype.isTranslucent=function(){if(c(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-1)return!0;return!1}function LIe(e){let t=e._template.components,n=e._template.source;if(c(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,c(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&&VIe(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; +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 fne={mat2:Ii,mat3:te,mat4:M},ZIe=/\.ktx2$/i;function RIe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!c(r)||r===Je.DefaultImageId;t=r;let l=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&c(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!c(l)||l===i.defaultTexture){let p=new en({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Pt({context:i,source:r,sampler:p}),n._textures[e]=l;return}l.copyFrom({source:r})}else c(l)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Pt&&r!==l){n._texturePaths[e]=void 0;let p=n._textures[e];c(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&&c(l)&&a&&(l!==n._defaultTexture&&l.destroy(),l=void 0),c(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=l._width,u.y=l._height)),a)return;let f=r instanceof Ge;if(!c(n._texturePaths[e])||f&&r.url!==n._texturePaths[e].url||!f&&r!==n._texturePaths[e]){if(typeof r=="string"||f){let p=f?r:Ge.createIfNeeded(r),y;ZIe.test(p.url)?y=Ll(p.url):y=p.fetchImage(),Promise.resolve(y).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){c(l)&&l!==n._defaultTexture&&l.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 GIe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Uo){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(c(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Je.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ge.createIfNeeded(i.positiveX).fetchImage(),Ge.createIfNeeded(i.negativeX).fetchImage(),Ge.createIfNeeded(i.positiveY).fetchImage(),Ge.createIfNeeded(i.negativeY).fetchImage(),Ge.createIfNeeded(i.positiveZ).fetchImage(),Ge.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function EIe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&hne(e,n)}function hne(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=XIe(o);if(!c(r))throw new L(`fabric: uniform '${t}' has invalid type.`);let s;if(r==="channels"){if(s=YE(e,t,o,!1),s===0&&n)throw new L(`strict: shader source does not use channels '${t}'.`)}else{if(r==="sampler2D"){let d=`${t}Dimensions`;WIe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},hne(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 l=`${t}_${e._count++}`;if(s=YE(e,t,l),s===1&&n)throw new L(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,r==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(RIe(t));else if(r==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(GIe(t));else if(r.indexOf("mat")!==-1){let d=new fne[r];e._uniforms[l]=function(){return fne[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function XIe(e){let t=e.type;if(!c(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ge||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Je.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 IIe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Je({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++}`;YE(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`;if(YE(e,i,a)===0&&t)throw new L(`strict: shader source does not use material '${i}'.`)}}function YE(e,t,n,i){i=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(l,d,u){return d||u?l:(o+=1,n)}),o}function WIe(e,t,n){return YE(e,t,t,n)}Je._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Je.DefaultImageId="czm_defaultImage";Je.DefaultCubeMapId="czm_defaultCubeMap";Je.ColorType="Color";Je._materialCache.addMaterial(Je.ColorType,{fabric:{type:Je.ColorType,uniforms:{color:new Y(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Je.ImageType="Image";Je._materialCache.addMaterial(Je.ImageType,{fabric:{type:Je.ImageType,uniforms:{image:Je.DefaultImageId,repeat:new D(1,1),color:new Y(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}});Je.DiffuseMapType="DiffuseMap";Je._materialCache.addMaterial(Je.DiffuseMapType,{fabric:{type:Je.DiffuseMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Je.AlphaMapType="AlphaMap";Je._materialCache.addMaterial(Je.AlphaMapType,{fabric:{type:Je.AlphaMapType,uniforms:{image:Je.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Je.SpecularMapType="SpecularMap";Je._materialCache.addMaterial(Je.SpecularMapType,{fabric:{type:Je.SpecularMapType,uniforms:{image:Je.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Je.EmissionMapType="EmissionMap";Je._materialCache.addMaterial(Je.EmissionMapType,{fabric:{type:Je.EmissionMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Je.BumpMapType="BumpMap";Je._materialCache.addMaterial(Je.BumpMapType,{fabric:{type:Je.BumpMapType,uniforms:{image:Je.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:RE},translucent:!1});Je.NormalMapType="NormalMap";Je._materialCache.addMaterial(Je.NormalMapType,{fabric:{type:Je.NormalMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:vE},translucent:!1});Je.GridType="Grid";Je._materialCache.addMaterial(Je.GridType,{fabric:{type:Je.GridType,uniforms:{color:new Y(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:PE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Je.StripeType="Stripe";Je._materialCache.addMaterial(Je.StripeType,{fabric:{type:Je.StripeType,uniforms:{horizontal:!0,evenColor:new Y(1,1,1,.5),oddColor:new Y(0,0,1,.5),offset:0,repeat:5},source:OE},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Je.CheckerboardType="Checkerboard";Je._materialCache.addMaterial(Je.CheckerboardType,{fabric:{type:Je.CheckerboardType,uniforms:{lightColor:new Y(1,1,1,.5),darkColor:new Y(0,0,0,.5),repeat:new D(5,5)},source:GE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Je.DotType="Dot";Je._materialCache.addMaterial(Je.DotType,{fabric:{type:Je.DotType,uniforms:{lightColor:new Y(1,1,0,.75),darkColor:new Y(0,1,1,.75),repeat:new D(5,5)},source:EE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Je.WaterType="Water";Je._materialCache.addMaterial(Je.WaterType,{fabric:{type:Je.WaterType,uniforms:{baseWaterColor:new Y(.2,.3,.6,1),blendColor:new Y(0,1,.699,1),specularMap:Je.DefaultImageId,normalMap:Je.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:BE},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Je.RimLightingType="RimLighting";Je._materialCache.addMaterial(Je.RimLightingType,{fabric:{type:Je.RimLightingType,uniforms:{color:new Y(1,0,0,.7),rimColor:new Y(1,1,1,.4),width:.3},source:kE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Je.FadeType="Fade";Je._materialCache.addMaterial(Je.FadeType,{fabric:{type:Je.FadeType,uniforms:{fadeInColor:new Y(1,0,0,1),fadeOutColor:new Y(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:wE},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Je.PolylineArrowType="PolylineArrow";Je._materialCache.addMaterial(Je.PolylineArrowType,{fabric:{type:Je.PolylineArrowType,uniforms:{color:new Y(1,1,1,1)},source:FE},translucent:!0});Je.PolylineDashType="PolylineDash";Je._materialCache.addMaterial(Je.PolylineDashType,{fabric:{type:Je.PolylineDashType,uniforms:{color:new Y(1,0,1,1),gapColor:new Y(0,0,0,0),dashLength:16,dashPattern:255},source:AE},translucent:!0});Je.PolylineGlowType="PolylineGlow";Je._materialCache.addMaterial(Je.PolylineGlowType,{fabric:{type:Je.PolylineGlowType,uniforms:{color:new Y(0,.5,1,1),glowPower:.25,taperPower:1},source:ME},translucent:!0});Je.PolylineOutlineType="PolylineOutline";Je._materialCache.addMaterial(Je.PolylineOutlineType,{fabric:{type:Je.PolylineOutlineType,uniforms:{color:new Y(1,1,1,1),outlineColor:new Y(1,0,0,1),outlineWidth:1},source:NE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Je.ElevationContourType="ElevationContour";Je._materialCache.addMaterial(Je.ElevationContourType,{fabric:{type:Je.ElevationContourType,uniforms:{spacing:100,color:new Y(1,0,0,1),width:1},source:IE},translucent:!1});Je.ElevationRampType="ElevationRamp";Je._materialCache.addMaterial(Je.ElevationRampType,{fabric:{type:Je.ElevationRampType,uniforms:{image:Je.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:WE},translucent:!1});Je.SlopeRampMaterialType="SlopeRamp";Je._materialCache.addMaterial(Je.SlopeRampMaterialType,{fabric:{type:Je.SlopeRampMaterialType,uniforms:{image:Je.DefaultImageId},source:UE},translucent:!1});Je.AspectRampMaterialType="AspectRamp";Je._materialCache.addMaterial(Je.AspectRampMaterialType,{fabric:{type:Je.AspectRampMaterialType,uniforms:{image:Je.DefaultImageId},source:ZE},translucent:!1});Je.ElevationBandType="ElevationBand";Je._materialCache.addMaterial(Je.ElevationBandType,{fabric:{type:Je.ElevationBandType,uniforms:{heights:Je.DefaultImageId,colors:Je.DefaultImageId},source:XE},translucent:!0});Je.WaterMaskType="WaterMask";Je._materialCache.addMaterial(Je.WaterMaskType,{fabric:{type:Je.WaterMaskType,source:DE,uniforms:{waterColor:new Y(1,1,1,1),landColor:new Y(0,0,0,0)}},translucent:!1});var zi=Je;function Ex(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Ex.MaterialSupport.TEXTURED;this.material=c(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(Ex.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}}});Ex.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Ex.prototype.isTranslucent=no.prototype.isTranslucent;Ex.prototype.getRenderState=no.prototype.getRenderState;Ex.MaterialSupport={BASIC:Object.freeze({vertexFormat:We.POSITION_AND_NORMAL,vertexShaderSource:CE,fragmentShaderSource:SE}),TEXTURED:Object.freeze({vertexFormat:We.POSITION_NORMAL_AND_ST,vertexShaderSource:LE,fragmentShaderSource:VE}),ALL:Object.freeze({vertexFormat:We.ALL,vertexShaderSource:TE,fragmentShaderSource:_E})};var so=Ex;var ejt=_(T(),1);var NQt=_(T(),1),HE=`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 Yln=x(T(),1),Gv=`uint czm_unpackTexture(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return uint(rounded); } -`;var UQt=_(T(),1),zE=`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; -v_normalEC = czm_normal * normal; -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +uint czm_unpackTexture(vec2 packedValue) { +vec2 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +return byte0 | (byte1 << 8); } -`;var DQt=_(T(),1),Xx=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); +uint czm_unpackTexture(vec3 packedValue) { +vec3 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +uint byte2 = uint(rounded.z); +return byte0 | (byte1 << 8) | (byte2 << 16); } -`;var YQt=_(T(),1),KE=`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; +uint czm_unpackTexture(vec4 packedValue) { +vec4 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +uint byte2 = uint(rounded.z); +uint byte3 = uint(rounded.w); +return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24); } -`;function Wp(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?KE:zE,r=i?Xx:HE,s=i?Wp.FLAT_VERTEX_FORMAT:Wp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Wp.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}}});Wp.VERTEX_FORMAT=We.POSITION_AND_NORMAL;Wp.FLAT_VERTEX_FORMAT=We.POSITION_ONLY;Wp.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Wp.prototype.isTranslucent=no.prototype.isTranslucent;Wp.prototype.getRenderState=no.prototype.getRenderState;var an=Wp;var cjt=_(T(),1);function fC(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(fC.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});fC.prototype.getType=function(e){return"Color"};var wIe=new ee;fC.prototype.getValue=function(e,t){return c(e)||(e=ee.now(wIe)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};fC.prototype.equals=function(e){return this===e||e instanceof fC&&J.equals(this._color,e._color)};var Ut=fC;var aqt=_(T(),1);var N6t=_(T(),1);var Wjt=_(T(),1);var gjt=_(T(),1);function K0(e){e=e??z.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??re.default,this._rectangle=e.rectangle??de.MAX_VALUE,this._projection=new Xi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(K0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});K0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),c(n)?(n.x=d,n.y=u,n):new D(d,u)};var Ki=K0;var pne=new m,bne=new m,yne=new pe,AY=new m,PIe=new m,gne=new ue,vIe=new Ki,JE=[new pe,new pe,new pe,new pe],QE=new D,Vr={};Vr.initialize=function(){let e=Vr._initPromise;return c(e)||(e=Ge.fetchJson(on("Assets/approximateTerrainHeights.json")).then(function(t){Vr._terrainHeights=t}),Vr._initPromise=e),e};Vr.getMinimumMaximumHeights=function(e,t){if(C.defined("rectangle",e),!c(Vr._terrainHeights))throw new L("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??re.default;let n=xne(e),i=Vr._defaultMinTerrainHeight,o=Vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Vr._terrainHeights[r];c(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(de.northeast(e,yne),pne),t.cartographicToCartesian(de.southwest(e,yne),bne),m.midpoint(bne,pne,AY);let a=t.scaleToGeodeticSurface(AY,PIe);if(c(a)){let l=m.distance(AY,a);i=Math.min(i,-l)}else i=Vr._defaultMinTerrainHeight}return i=Math.max(Vr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Vr.getBoundingSphere=function(e,t){if(C.defined("rectangle",e),!c(Vr._terrainHeights))throw new L("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??re.default;let n=xne(e),i=Vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Vr._terrainHeights[r];c(s)&&(i=s[1])}let o=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,gne),ue.union(o,gne,o)};function xne(e){pe.fromRadians(e.east,e.north,0,JE[0]),pe.fromRadians(e.west,e.north,0,JE[1]),pe.fromRadians(e.east,e.south,0,JE[2]),pe.fromRadians(e.west,e.south,0,JE[3]);let t=0,n=0,i=0,o=0,r=Vr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let l=0;l<4;++l){let d=JE[l];if(vIe.positionToTileXY(d,s,QE),l===0)i=QE.x,o=QE.y;else if(i!==QE.x||o!==QE.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}}Vr._terrainHeightsMaxLevel=6;Vr._defaultMaxTerrainHeight=9e3;Vr._defaultMinTerrainHeight=-1e5;Vr._terrainHeights=void 0;Vr._initPromise=void 0;Object.defineProperties(Vr,{initialized:{get:function(){return c(Vr._terrainHeights)}}});var ui=Vr;var y4t=_(T(),1);var $jt=_(T(),1);var Mjt=_(T(),1);function Nc(e,t,n){this.minimum=m.clone(e??m.ZERO),this.maximum=m.clone(t??m.ZERO),c(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Nc.fromCorners=function(e,t,n){return C.defined("minimum",e),C.defined("maximum",t),c(n)||(n=new Nc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Nc.fromPoints=function(e,t){if(c(t)||(t=new Nc),!c(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,l=e.length;for(let f=1;f0?zt.INSIDE:r+o<0?zt.OUTSIDE:zt.INTERSECTING};Nc.prototype.clone=function(e){return Nc.clone(this,e)};Nc.prototype.intersectPlane=function(e){return Nc.intersectPlane(this,e)};Nc.prototype.equals=function(e){return Nc.equals(this,e)};var J0=Nc;var MY=new ce;function fh(e,t){if(C.defined("origin",e),t=t??re.default,e=t.scaleToGeodeticSurface(e),!c(e))throw new L("origin must not be at the center of the ellipsoid.");let n=wt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(M.getColumn(n,0,MY)),this._yAxis=m.fromCartesian4(M.getColumn(n,1,MY));let i=m.fromCartesian4(M.getColumn(n,2,MY));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(fh.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 FIe=new J0;fh.fromPoints=function(e,t){C.defined("cartesians",e);let n=J0.fromPoints(e,FIe);return new fh(n.center,t)};var _ne=new bn,u5=new m;fh.prototype.projectPointOntoPlane=function(e,t){C.defined("cartesian",e);let n=_ne;n.origin=e,m.normalize(e,n.direction);let i=qn.rayPlane(n,this._plane,u5);if(c(i)||(m.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,u5)),c(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return c(t)?(t.x=r,t.y=s,t):new D(r,s)}};fh.prototype.projectPointsOntoPlane=function(e,t){C.defined("cartesians",e),c(t)||(t=[]);let n=0,i=e.length;for(let o=0;ow.TWO_PI)throw new L("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>w.PI)throw new L("Rectangle height must be between 0 and pi");if(c(i)&&!w.equalsEpsilon(i.radii.x,i.radii.y,w.EPSILON15))throw new L("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=t??0,n=n??0,i=i??re.default;let r,s,a,l,d,u,f;if(e.width<=w.PI){let v=de.center(e,Sne),P=i.cartographicToCartesian(v,zIe),F=new $r(P,i);f=F.plane;let N=v.longitude,b=e.south<0&&e.north>0?0:v.latitude,G=pe.fromRadians(N,e.north,n,KIe),X=pe.fromRadians(e.west,e.north,n,JIe),W=pe.fromRadians(e.west,b,n,QIe),A=pe.fromRadians(e.west,e.south,n,jIe),k=pe.fromRadians(N,e.south,n,qIe),B=i.cartographicToCartesian(G,$Ie),O=i.cartographicToCartesian(X,Cne),H=i.cartographicToCartesian(W,eWe),U=i.cartographicToCartesian(A,Vne),K=i.cartographicToCartesian(k,tWe),Q=F.projectPointToNearestOnPlane(B,nWe),ie=F.projectPointToNearestOnPlane(O,iWe),j=F.projectPointToNearestOnPlane(H,oWe),$=F.projectPointToNearestOnPlane(U,rWe),ne=F.projectPointToNearestOnPlane(K,sWe);return r=Math.min(ie.x,j.x,$.x),s=-r,l=Math.max(ie.y,Q.y),a=Math.min($.y,ne.y),X.height=A.height=t,O=i.cartographicToCartesian(X,Cne),U=i.cartographicToCartesian(A,Vne),d=Math.min(cn.getPointDistance(f,O),cn.getPointDistance(f,U)),u=n,Tne(F.origin,F.xAxis,F.yAxis,F.zAxis,r,s,a,l,d,u,o)}let p=e.south>0,y=e.north<0,h=p?e.south:y?e.north:0,g=de.center(e,Sne).longitude,x=m.fromRadians(g,h,n,i,aWe);x.z=0;let V=Math.abs(x.x)=l?zt.INSIDE:zt.INTERSECTING};var Rne=new m,Gne=new m,Ene=new m,bWe=new m,Lne=new m,yWe=new m;ki.distanceSquaredTo=function(e,t){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("cartesian is required.");let n=m.subtract(t,e.center,Zne),i=e.halfAxes,o=te.getColumn(i,0,Rne),r=te.getColumn(i,1,Gne),s=te.getColumn(i,2,Ene),a=m.magnitude(o),l=m.magnitude(r),d=m.magnitude(s),u=!0,f=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,l>0?m.divideByScalar(r,l,r):f=!1,d>0?m.divideByScalar(s,d,s):p=!1;let y=!u+!f+!p,h,g,x;if(y===1){let R=o;h=r,g=s,f?p||(R=s,g=o):(R=r,h=o),x=m.cross(h,g,Lne),R===o?o=x:R===r?r=x:R===s&&(s=x)}else if(y===2){h=o,f?h=r:p&&(h=s);let R=m.UNIT_Y;R.equalsEpsilon(h,w.EPSILON3)&&(R=m.UNIT_X),g=m.cross(h,R,bWe),m.normalize(g,g),x=m.cross(h,g,Lne),m.normalize(x,x),h===o?(r=g,s=x):h===r?(s=g,o=x):h===s&&(o=g,r=x)}else y===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let S=yWe;S.x=m.dot(n,o),S.y=m.dot(n,r),S.z=m.dot(n,s);let V=0,Z;return S.x<-a?(Z=S.x+a,V+=Z*Z):S.x>a&&(Z=S.x-a,V+=Z*Z),S.y<-l?(Z=S.y+l,V+=Z*Z):S.y>l&&(Z=S.y-l,V+=Z*Z),S.z<-d?(Z=S.z+d,V+=Z*Z):S.z>d&&(Z=S.z-d,V+=Z*Z),V};var gWe=new m,xWe=new m;ki.computePlaneDistances=function(e,t,n,i){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("position is required.");if(!c(n))throw new L("direction is required.");c(i)||(i=new Ia);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,l=te.getColumn(a,0,Rne),d=te.getColumn(a,1,Gne),u=te.getColumn(a,2,Ene),f=m.add(l,d,gWe);m.add(f,u,f),m.add(f,s,f);let p=m.subtract(f,t,xWe),y=m.dot(n,p);return o=Math.min(y,o),r=Math.max(y,r),m.add(s,l,f),m.add(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.add(s,l,f),m.subtract(f,d,f),m.add(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.add(s,l,f),m.subtract(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.add(f,d,f),m.add(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.add(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.subtract(f,d,f),m.add(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.subtract(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),i.start=o,i.stop=r,i};var _We=new m,TWe=new m,SWe=new m;ki.computeCorners=function(e,t){C.typeOf.object("box",e),c(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=te.getColumn(i,0,_We),r=te.getColumn(i,1,TWe),s=te.getColumn(i,2,SWe);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 CWe=new te;ki.computeTransformation=function(e,t){C.typeOf.object("box",e),c(t)||(t=new M);let n=e.center,i=te.multiplyByUniformScale(e.halfAxes,2,CWe);return M.fromRotationTranslation(i,n,t)};var VWe=new ue;ki.isOccluded=function(e,t){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("occluder is required.");let n=ue.fromOrientedBoundingBox(e,VWe);return!t.isBoundingSphereVisible(n)};ki.prototype.intersectPlane=function(e){return ki.intersectPlane(this,e)};ki.prototype.distanceSquaredTo=function(e){return ki.distanceSquaredTo(this,e)};ki.prototype.computePlaneDistances=function(e,t,n){return ki.computePlaneDistances(this,e,t,n)};ki.prototype.computeCorners=function(e){return ki.computeCorners(this,e)};ki.prototype.computeTransformation=function(e){return ki.computeTransformation(this,e)};ki.prototype.isOccluded=function(e){return ki.isOccluded(this,e)};ki.equals=function(e,t){return e===t||c(e)&&c(t)&&m.equals(e.center,t.center)&&te.equals(e.halfAxes,t.halfAxes)};ki.prototype.clone=function(e){return ki.clone(this,e)};ki.prototype.equals=function(e){return ki.equals(this,e)};var Xn=ki;var C4t=_(T(),1);var m5={};m5.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new L("scale must be a finite number.");if(!Number.isFinite(n))throw new L("relativeHeight must be a finite number.");return(e-n)*t+n};var LWe=new pe;m5.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,LWe);if(!c(r))return m.clone(e,o);let s=m5.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Lr=m5;var x6t=_(T(),1);var L4t=_(T(),1),jE=`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 +`;var Mln=x(T(),1),Lv=`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 Uln=x(T(),1),Wv=`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 Oln=x(T(),1),vv=`#ifdef LOG_DEPTH +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 +coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; +#endif +return coords; +} +void czm_vertexLogDepth() +{ +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; +gl_Position = czm_updatePositionDepth(gl_Position); +#endif +} +void czm_vertexLogDepth(vec4 clipCoords) +{ +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; +czm_updatePositionDepth(clipCoords); +#endif +} +`;var zln=x(T(),1),Fv=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +{ +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); +q /= screenCoordinate.w; +if (!(czm_inverseProjection == mat4(0.0))) +{ +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; +} +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) +{ +#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; +#else +vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); +vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +#endif +return eyeCoordinate; +} +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +{ +vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; +return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); +} +`;var Kln=x(T(),1),Iv=`#if !defined(LOG_DEPTH) +in float v_WindowZ; +#endif +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 jln=x(T(),1),Pv=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; +#endif +#endif +void czm_writeLogDepth(float depth) +{ +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) +if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { +discard; +} +#ifdef POLYGON_OFFSET +float factor = u_polygonOffset[0]; +float units = u_polygonOffset[1]; +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) +if (factor != 0.0) { +float x = dFdx(depth); +float y = dFdy(depth); +float m = sqrt(x * x + y * y); +depth += m * factor; +} +#endif +#endif +gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; +#ifdef POLYGON_OFFSET +gl_FragDepth += czm_epsilon7 * units; +#endif +#endif +} +void czm_writeLogDepth() { +#ifdef LOG_DEPTH +czm_writeLogDepth(v_depthFromNearPlusOne); +#endif +} +`;var qln=x(T(),1),Xv=`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 edn=x(T(),1),Nv=`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 f_={czm_degreesPerRadian:oL,czm_depthRange:rL,czm_epsilon1:sL,czm_epsilon2:aL,czm_epsilon3:cL,czm_epsilon4:lL,czm_epsilon5:dL,czm_epsilon6:uL,czm_epsilon7:mL,czm_infinity:hL,czm_oneOverPi:fL,czm_oneOverTwoPi:pL,czm_passCesium3DTile:bL,czm_passCesium3DTileClassification:gL,czm_passCesium3DTileClassificationIgnoreShow:yL,czm_passCesium3DTileEdges:xL,czm_passCesium3DTileEdgesDirect:TL,czm_passCesium3DTilePlanarFillId:_L,czm_passClassification:SL,czm_passCompute:ZL,czm_passEnvironment:RL,czm_passGaussianSplats:CL,czm_passGlobe:VL,czm_passOpaque:EL,czm_passOverlay:AL,czm_passTerrainClassification:GL,czm_passTranslucent:LL,czm_passVoxels:WL,czm_pi:vL,czm_piOverFour:FL,czm_piOverSix:IL,czm_piOverThree:PL,czm_piOverTwo:XL,czm_radiansPerDegree:NL,czm_sceneMode2D:YL,czm_sceneMode3D:wL,czm_sceneModeColumbusView:ML,czm_sceneModeMorphing:kL,czm_solarRadius:UL,czm_threePiOver2:DL,czm_twoPi:OL,czm_webMercatorMaxLatitude:BL,czm_depthRangeStruct:zL,czm_material:HL,czm_materialInput:KL,czm_modelMaterial:JL,czm_modelVertexOutput:jL,czm_ray:QL,czm_raySegment:qL,czm_shadowParameters:$L,czm_acesTonemapping:eW,czm_alphaWeight:tW,czm_antialias:nW,czm_applyHSBShift:iW,czm_approximateSphericalCoordinates:oW,czm_approximateTanh:rW,czm_backFacing:sW,czm_branchFreeTernary:aW,czm_cascadeColor:cW,czm_cascadeDistance:lW,czm_cascadeMatrix:dW,czm_cascadeWeights:uW,czm_columbusViewMorph:mW,czm_computeAtmosphereColor:hW,czm_computeGroundAtmosphereScattering:fW,czm_computePosition:pW,czm_computeScattering:bW,czm_computeTextureTransform:gW,czm_cosineAndSine:yW,czm_decodeRGB8:xW,czm_decompressTextureCoordinates:TW,czm_depthClamp:_W,czm_eastNorthUpToEyeCoordinates:SW,czm_ellipsoidContainsPoint:ZW,czm_ellipsoidTextureCoordinates:RW,czm_equalsEpsilon:CW,czm_eyeOffset:VW,czm_eyeToCartographicDelta:EW,czm_eyeToWindowCoordinates:AW,czm_fastApproximateAtan:GW,czm_fog:LW,czm_gammaCorrect:WW,czm_geodeticSurfaceNormal:vW,czm_getDefaultMaterial:FW,czm_getDynamicAtmosphereLightDirection:IW,czm_getLambertDiffuse:PW,czm_getSpecular:XW,czm_getWaterNoise:NW,czm_HSBToRGB:YW,czm_HSLToRGB:wW,czm_hue:MW,czm_inverseGamma:kW,czm_isEmpty:UW,czm_isFull:DW,czm_latitudeToWebMercatorFraction:OW,czm_linearToSrgb:BW,czm_lineDistance:zW,czm_luminance:HW,czm_maximumComponent:KW,czm_metersPerPixel:JW,czm_modelToWindowCoordinates:jW,czm_multiplyWithColorBalance:QW,czm_nearFarScalar:qW,czm_octDecode:$W,czm_packDepth:ev,czm_pbrLighting:tv,czm_pbrNeutralTonemapping:nv,czm_phong:iv,czm_planeDistance:ov,czm_pointAlongRay:rv,czm_rayEllipsoidIntersectionInterval:sv,czm_raySphereIntersectionInterval:av,czm_readDepth:cv,czm_readNonPerspective:lv,czm_reverseLogDepth:dv,czm_RGBToHSB:uv,czm_RGBToHSL:mv,czm_RGBToXYZ:hv,czm_round:fv,czm_saturation:pv,czm_shadowDepthCompare:bv,czm_shadowVisibility:gv,czm_signNotZero:yv,czm_sphericalHarmonics:xv,czm_srgbToLinear:Tv,czm_tangentToEyeSpaceMatrix:_v,czm_textureCube:Sv,czm_transformPlane:Zv,czm_translateRelativeToEye:Rv,czm_translucentPhong:Cv,czm_transpose:Vv,czm_unpackDepth:Ev,czm_unpackFloat:Av,czm_unpackTexture:Gv,czm_unpackUint:Lv,czm_valueTransform:Wv,czm_vertexLogDepth:vv,czm_windowToEyeCoordinates:Fv,czm_writeDepthClamp:Iv,czm_writeLogDepth:Pv,czm_writeNonPerspective:Xv,czm_XYZToRGB:Nv};var Ymn=x(T(),1);function bDe(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 Yv=bDe;function Fme(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;o0;){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=0;--o)i=`${i+t[o].glslSource} +`;return i.replace(n.glslSource,"")}function Xme(e,t,n){let i="",o=e.sources;if(l(o))for(let b=0;b=this._numberOfInstances)throw new L("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new L("attributeIndex is out of range");let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?a=IWe(this._batchValues,s,Ine):a=ce.unpack(this._batchValues,s,Ine);let l=Wne(i,t);return c(l.fromCartesian4)?l.fromCartesian4(a,n):c(l.clone)?l.clone(a,n):a.x};var wWe=[void 0,void 0,new D,new m,new ce],PWe=new ce;wp.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new L("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new L("attributeIndex is out of range");if(!c(n))throw new L("value is required.");let i=this._attributes,o=wWe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Wne(this._attributes,t);if(c(s.equals)?s.equals(r,n):r===n)return;let l=PWe;l.x=c(n.x)?n.x:n,l.y=c(n.y)?n.y:0,l.z=c(n.z)?n.z:0,l.w=c(n.w)?n.w:0;let d=this._offsets[t],f=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?WWe(l,this._batchValues,f):ce.pack(l,this._batchValues,f),this._batchValuesDirty=!0};function vWe(e,t){let n=e._textureDimensions;e._texture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:en.NEAREST,flipY:!1})}function FWe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}wp.prototype.update=function(e){c(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,c(this._texture)||vWe(this,e.context),FWe(this))};wp.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 AWe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +`;var Qmn=x(T(),1),mQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};mQ.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(mQ);var ti=mQ;var ehn=x(T(),1);var wme={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};Object.freeze(wme);var rc=wme;var Gfn=x(T(),1);var nhn=x(T(),1);function SDe(e,t){let n=[],i=e.length,o=0;for(;oEl.MaximumLatitude?e=El.MaximumLatitude:e<-El.MaximumLatitude&&(e=-El.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};El.MaximumLatitude=El.mercatorAngleToGeodeticLatitude(Math.PI);El.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=El.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};El.prototype.unproject=function(e,t){if(!c(e))throw new L("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=El.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new pe(i,o,r)};var Wi=El;function UWe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=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 l=e.length;for(let d=0;dr&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function BWe(e,t){let n=[];return kY(e,"geometry",t,n),kY(e,"westHemisphereGeometry",t,n),kY(e,"eastHemisphereGeometry",t,n),n}var Pp={};Pp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=DWe(e),t.length>0&&(n=An.createAttributeLocations(t[0]),e.createPickOffsets&&(r=BWe(i,t))),c(i[0].attributes)&&c(i[0].attributes.offset)&&(s=new Array(o),a=!0));let l=new Array(o),d=new Array(o);for(let u=0;u0&&(n.set(l.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};Pp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let E=x.length/S;for(R=Me.createTypedArray(E,g),i=0;ie.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,o=t.longitude*i,r=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=o,n.y=r,n.z=s,n):new h(o,r,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,o=t.x*i,r=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=o,n.latitude=r,n.height=s,n):new pe(o,r,s)}};Uv.MaximumLatitude=Uv.mercatorAngleToGeodeticLatitude(Math.PI);var xi=Uv;function XDe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=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;dr&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function wDe(e,t){let n=[];return fQ(e,"geometry",t,n),fQ(e,"westHemisphereGeometry",t,n),fQ(e,"eastHemisphereGeometry",t,n),n}var db={};db.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=YDe(e),t.length>0&&(n=zn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=wDe(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;u0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};db.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let E=_.length/S;for(C=Oe.createTypedArray(E,y),i=0;i= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} -${o}`};function Ane(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",l="compressedAttributes",d=`in ${a} ${l};`,u="",f="";if(i){u+=`vec2 st; -`;let h=s>1?`${l}.x`:l;f+=` st = czm_decompressTextureCoordinates(${h}); +${o}`};function Hme(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="",m="";if(i){u+=`vec2 st; +`;let f=s>1?`${c}.x`:c;m+=` st = czm_decompressTextureCoordinates(${f}); `}n&&o&&r?(u+=`vec3 normal; vec3 tangent; vec3 bitangent; -`,f+=` czm_octDecode(${l}.${i?"yz":"xy"}, normal, tangent, bitangent); +`,m+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); `):(n&&(u+=`vec3 normal; -`,f+=` normal = czm_octDecode(${l}${s>1?`.${i?"y":"x"}`:""}); +`,m+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); `),o&&(u+=`vec3 tangent; -`,f+=` tangent = czm_octDecode(${l}.${i&&n?"z":"y"}); +`,m+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); `),r&&(u+=`vec3 bitangent; -`,f+=` bitangent = czm_octDecode(${l}.${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=Be.replaceMain(p,"czm_non_compressed_main");let y=`void main() +`,m+=` 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=Je.replaceMain(p,"czm_non_compressed_main");let b=`void main() { -${f} czm_non_compressed_main(); -}`;return[d,u,p,y].join(` -`)}function rwe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +${m} czm_non_compressed_main(); +}`;return[d,u,p,b].join(` +`)}function $De(e){let t=Je.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} -`,t}function swe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`,t}function eOe(e){let t=Je.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); @@ -2643,7 +2658,7 @@ ${f} czm_non_compressed_main(); czm_writeDepthClamp(); #endif } -`,t}function Mne(e,t){let n=e.vertexAttributes;for(let i in n)if(n.hasOwnProperty(i)&&!c(t[i]))throw new L(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function awe(e,t){return function(){return e[t]}}var UY=Math.max(Ot.hardwareConcurrency-1,1),f5,cwe=new gi("combineGeometry");function lwe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Zr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,l=[],d=[];for(o=0;o0){let g=new Float64Array(f);for(h=[g.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=Zr.COMBINED):tX(e,t,Zr.FAILED,void 0)}).catch(function(f){tX(e,t,Zr.FAILED,f)})}}function dwe(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,l=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=Zr.COMBINED):tX(e,t,Zr.FAILED,void 0)}function uwe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!c(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!c(a)){for(a=new Array(s),i=0;i0||ue.intersectPlane(g,cn.ORIGIN_ZX_PLANE)!==zt.INTERSECTING?l.push(g):(d.push(g),u.push(g))}let f=l[0],p=u[0],y=d[0];for(i=1;i0){if(mt.maximumVertexTextureImageUnits===0)throw new le("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!==Zr.COMPLETE&&this._state!==Zr.COMBINED&&(this.asynchronous?lwe(this,e):dwe(this,e)),this._state===Zr.COMBINED&&(mwe(this,e),kne(this,e),hwe(this,e)),!this.show||this._state!==Zr.COMPLETE)return;this._batchTableOffsetsUpdated||kne(this,e),this._recomputeBoundingSpheres&&uwe(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=c(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 l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),c(this._material)&&this._material.update(t);let d=n.closed&&l;o&&(this._createRenderStatesFunction??pwe)(this,t,n,d),r&&(this._createShaderProgramFunction??bwe)(this,e,n),(o||r)&&(this._createCommandsFunction??ywe)(this,n,i,l,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??gwe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var xwe=new ue,_we=new ue;function Kne(e,t,n){if(n===$t.TOP){let i=ue.clone(e,xwe),o=ue.clone(e,_we);o.center=m.add(o.center,t,o.center),e=ue.union(i,o,e)}else n===$t.ALL&&(e.center=m.add(e.center,t,e.center));return e}function Twe(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 c(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function Swe(e,t,n,i,o){return function(r){if(!c(r)||!c(r.length)||r.length<1||r.length>4)throw new L("value must be and array with length between 1 and 4.");let s=Bne(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var Cwe=new m;function Vwe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(c(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;c(r)&&Kne(i,m.fromArray(r.get(),0,Cwe),e._offsetInstanceExtend[n]),c(o)&&(i=ue.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function Lwe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Rr.prototype.getGeometryInstanceAttributes=function(e){if(!c(e))throw new L("id is required");if(!c(this._batchTable))throw new L("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(c(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d4)throw new L("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.value))throw new L("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var dc=Zwe;var _7t=_(T(),1),hC=`#ifdef TEXTURE_COORDINATES +`,t}function Kme(e,t){let n=e.vertexAttributes}function tOe(e,t){return function(){return e[t]}}var pQ=Math.max(fn.hardwareConcurrency-1,1),JD,nOe=new $n("combineGeometry");function iOe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===ts.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o0){let y=new Float64Array(m);for(f=[y.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=ts.COMBINED):Ov(e,t,ts.FAILED,void 0)}).catch(function(m){Ov(e,t,ts.FAILED,m)})}}function oOe(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;a0?(e._recomputeBoundingSpheres=!0,e._state=ts.COMBINED):Ov(e,t,ts.FAILED,void 0)}function rOe(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;i0||de.intersectPlane(y,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING?c.push(y):(d.push(y),u.push(y))}let m=c[0],p=u[0],b=d[0];for(i=1;i0){if(kt.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!==ts.COMPLETE&&this._state!==ts.COMBINED&&(this.asynchronous?iOe(this,e):oOe(this,e)),this._state===ts.COMBINED&&(sOe(this,e),jme(this,e),cOe(this,e)),!this.show||this._state!==ts.COMPLETE)return;this._batchTableOffsetsUpdated||jme(this,e),this._recomputeBoundingSpheres&&rOe(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&&(this._createRenderStatesFunction??lOe)(this,t,n,d),r&&(this._createShaderProgramFunction??dOe)(this,e,n),(o||r)&&(this._createCommandsFunction??uOe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??mOe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var hOe=new de,fOe=new de;function ohe(e,t,n){if(n===bn.TOP){let i=de.clone(e,hOe),o=de.clone(e,fOe);o.center=h.add(o.center,t,o.center),e=de.union(i,o,e)}else n===bn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function pOe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=J.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function bOe(e,t,n,i,o){return function(r){let s=ehe(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var gOe=new h;function yOe(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)&&ohe(i,h.fromArray(r.get(),0,gOe),e._offsetInstanceExtend[n]),l(o)&&(i=de.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function xOe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}ns.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;dd&&(u=w.PI-s,s=-w.PI,d+=u),r-=w.EPSILON5,s-=w.EPSILON5,l+=w.EPSILON5,d+=w.EPSILON5;let f=1/(d-s),p=1/(l-r),y={sphericalExtents:new dc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,f]}),longitudeRotation:new dc({componentDatatype:q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return iie(y,t),sie(e,i,y),y};Zu.hasAttributesForTextureCoordinatePlanes=function(e){return c(e.southWest_HIGH)&&c(e.southWest_LOW)&&c(e.northward)&&c(e.eastward)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};Zu.hasAttributesForSphericalExtents=function(e){return c(e.sphericalExtents)&&c(e.longitudeRotation)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};function Nwe(e){return Math.max(e.width,e.height)>Zu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Zu.shouldUseSphericalCoordinates=function(e){return C.typeOf.object("rectangle",e),Nwe(e)};Zu.MAX_WIDTH_FOR_PLANAR_EXTENTS=w.toRadians(1);var pd=Zu;var z7t=_(T(),1);var k7t=_(T(),1);var kwe={NEVER:oe.NEVER,LESS:oe.LESS,EQUAL:oe.EQUAL,LESS_OR_EQUAL:oe.LEQUAL,GREATER:oe.GREATER,NOT_EQUAL:oe.NOTEQUAL,GREATER_OR_EQUAL:oe.GEQUAL,ALWAYS:oe.ALWAYS},On=Object.freeze(kwe);var D7t=_(T(),1);var Uwe={ZERO:oe.ZERO,KEEP:oe.KEEP,REPLACE:oe.REPLACE,INCREMENT:oe.INCR,DECREMENT:oe.DECR,INVERT:oe.INVERT,INCREMENT_WRAP:oe.INCR_WRAP,DECREMENT_WRAP:oe.DECR_WRAP},ft=Object.freeze(Uwe);var p5={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};p5.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:On.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:On.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:p5.CESIUM_3D_TILE_MASK,mask:p5.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(p5);function wx(e){e=e??z.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(wx.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}}});wx.isSupported=function(e){return e.context.stencilBuffer};function pC(e,t){let n=t?On.EQUAL:On.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},depthMask:!1}}function YY(e){return{stencilTest:{enabled:e,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var Owe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Dwe(e,t,n,i){if(c(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Oe.fromCache(pC(o,!1)),e._rsStencilDepthPass3DTiles=Oe.fromCache(pC(o,!0)),e._rsColorPass=Oe.fromCache(YY(o,!1)),e._rsPickPass=Oe.fromCache(Owe)}function Bwe(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; +`;function Am(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new gQ;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new gQ;if(o.requiresTextureCoordinates=e,n instanceof Tn)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}Am.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 Tn&&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 Tn||(o=t.material.shaderSource),new Je({defines:i,sources:[o,p1]})};Am.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 Je({defines:n,sources:[p1],pickColorQualifier:"in"})};Am.prototype.createVertexShader=function(e,t,n,i){return mhe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Am.prototype.createPickVertexShader=function(e,t,n,i){return mhe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var rhe=new h,she=new pe,ahe={high:0,low:0};function mhe(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=she;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,rhe),m=An.encode(u.x,ahe);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`;let p=she;p.longitude=-W.PI,p.latitude=0,p.height=0;let b=s.project(p,rhe);m=An.encode(b.x,ahe),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${m.low.toFixed(`${m.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 Tn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Je({defines:c,sources:[o]})}function gQ(){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(gQ.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 che(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)/k.distance(t,e)}var _Oe=[new k,new k,new k,new k];function hhe(e,t){let n=_Oe,i=k.unpack(t,0,n[0]),o=k.unpack(t,2,n[1]),r=k.unpack(t,4,n[2]);e.uMaxVmax=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/che(i,o,r),a=1/che(i,r,o);e.uvMinAndExtents=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var fhe=new pe,phe=new h,SOe=new h,ZOe=new h,jD={high:0,low:0};function bhe(e,t,n){let i=fhe;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,phe);i.latitude=e.north;let r=t.project(i,SOe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,ZOe),a=[0,0,0,0],c=[0,0,0,0],d=An.encode(o.x,jD);a[0]=d.high,c[0]=d.low,d=An.encode(o.y,jD),a[1]=d.high,c[1]=d.low,d=An.encode(r.y,jD),a[2]=d.high,c[2]=d.low,d=An.encode(s.x,jD),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var ROe=new P,COe=new P,lhe=new h,VOe=new pe,EOe=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe];function AOe(e,t,n,i,o,r){let s=re.center(e,VOe);s.height=n;let a=pe.toCartesian(s,t,lhe),c=_t.eastNorthUpToFixedFrame(a,t,ROe),d=P.inverse(c,COe),u=e.west,m=e.east,p=e.north,b=e.south,f=EOe;f[0].latitude=b,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=m,f[3].latitude=b,f[3].longitude=m;let y=(u+m)*.5,_=(p+b)*.5;f[4].latitude=b,f[4].longitude=y,f[5].latitude=p,f[5].longitude=y,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=m;let S=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,R=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let F=0;F<8;F++){f[F].height=n;let I=pe.toCartesian(f[F],t,lhe);P.multiplyByPoint(d,I,I),I.z=0,S=Math.min(S,I.x),Z=Math.max(Z,I.x),R=Math.min(R,I.y),C=Math.max(C,I.y)}let E=i;E.x=S,E.y=R,E.z=0,P.multiplyByPoint(c,E,E);let A=o;A.x=Z,A.y=R,A.z=0,P.multiplyByPoint(c,A,A),h.subtract(A,E,o);let L=r;L.x=S,L.y=C,L.z=0,P.multiplyByPoint(c,L,L),h.subtract(L,E,r)}var GOe=new h,LOe=new h,WOe=new An;Am.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=phe,s=GOe,a=LOe;AOe(e,n,o??0,r,s,a);let c={};hhe(c,t);let d=An.fromCartesian(r,WOe);return c.southWest_HIGH=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.high,[0,0,0])}),c.southWest_LOW=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.low,[0,0,0])}),c.eastward=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),bhe(e,i,c),c};var vOe=new h;function dhe(e,t,n,i){let o=fhe;o.latitude=e,o.longitude=t,o.height=0;let r=pe.toCartesian(o,n,vOe),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 uhe=new k;Am.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=dhe(e.south,e.west,n,uhe),r=o.x,s=o.y,a=dhe(e.north,e.east,n,uhe),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 m=1/(d-s),p=1/(c-r),b={sphericalExtents:new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return hhe(b,t),bhe(e,i,b),b};Am.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)};Am.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 FOe(e){return Math.max(e.width,e.height)>Am.MAX_WIDTH_FOR_PLANAR_EXTENTS}Am.shouldUseSphericalCoordinates=function(e){return FOe(e)};Am.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var _u=Am;var spn=x(T(),1);var $fn=x(T(),1);var ghe={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};Object.freeze(ghe);var ni=ghe;var npn=x(T(),1);var yhe={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};Object.freeze(yhe);var Ft=yhe;var QD={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};QD.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ni.ALWAYS,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.REPLACE},backFunction:ni.ALWAYS,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.REPLACE},reference:QD.CESIUM_3D_TILE_MASK,mask:QD.CESIUM_3D_TILE_MASK}};var Jt=Object.freeze(QD);function g_(e){e=e??B.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(g_.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}}});g_.isSupported=function(e){return e.context.stencilBuffer};function b1(e,t){let n=t?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:n,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL},depthMask:!1}}function xQ(e){return{stencilTest:{enabled:e,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND}}var IOe={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function POe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(b1(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(b1(o,!0)),e._rsColorPass=ze.fromCache(xQ(o,!1)),e._rsPickPass=ze.fromCache(IOe)}function XOe(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=Be.replaceMain(s,"czm_non_compressed_main");let a=`void main() +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Je.replaceMain(s,"czm_non_compressed_main");let a=`void main() { ${r} czm_non_compressed_main(); }`;return[i,o,s,a].join(` -`)}}function Ywe(e,t){let n=t.context,i=e._primitive,o=jE;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=Bwe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",l=new Be({defines:[a],sources:[o]}),d=new Be({sources:[Q0]}),u=e._primitive._attributeLocations,f=new pd(s,r,e.appearance);if(e._spStencil=tn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let h=Be.createPickVertexShaderSource(o);h=In._appendShowToShader(i,h),h=In._updatePickColorAttribute(h);let g=f.createPickFragmentShader(!1),x=f.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=tn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:g,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!c(S)){let V=f.createPickFragmentShader(!0),Z=f.createPickVertexShader([a],h,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:Z,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=S}}else e._spPick=tn.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),l=new Be({defines:[a],sources:[o]}),e._sp=tn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:u});let p=f.createFragmentShader(!1),y=f.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=tn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:y,fragmentShaderSource:p,attributeLocations:u}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!c(h)){let g=f.createFragmentShader(!0),x=f.createVertexShader([a],o,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:g,attributeLocations:u})}e._spColor2D=h}}function Hwe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o0&&(l=o[0].attributes,p=pd.hasAttributesForSphericalExtents(l),y=pd.hasAttributesForTextureCoordinatePlanes(l),f=l.color),s=0;s{c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};wx.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new L("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};wx.prototype.isDestroyed=function(){return!1};wx.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,he(this)};var bC=wx;var Qwe={u_globeMinimumAltitude:function(){return 55e3}};function Xl(e){e=e??z.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!c(t)&&c(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s{!this._ready&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Xl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Xl.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new L("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Xl.prototype.isDestroyed=function(){return!1};Xl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};Xl._supportsMaterials=function(e){return e.depthTexture};Xl.supportsMaterials=function(e){return C.typeOf.object("scene",e),Xl._supportsMaterials(e.frameState.context)};var kc=Xl;var H6t=_(T(),1);function yC(){L.throwInstantiationError()}Object.defineProperties(yC.prototype,{isConstant:{get:L.throwInstantiationError},definitionChanged:{get:L.throwInstantiationError}});yC.prototype.getType=L.throwInstantiationError;yC.prototype.getValue=L.throwInstantiationError;yC.prototype.equals=L.throwInstantiationError;var rPe=new ee;yC.getValue=function(e,t,n){let i;return c(e)||(e=ee.now(rPe)),c(t)&&(i=t.getType(e),c(i))?((!c(n)||n.type!==i)&&(n=zi.fromType(i)),t.getValue(e,n.uniforms),n):((!c(n)||n.type!==zi.ColorType)&&(n=zi.fromType(zi.ColorType)),Y.clone(Y.WHITE,n.uniforms.color),n)};var qo=yC;function Px(e,t,n){C.defined("geometryUpdater",e),C.defined("primitives",t),C.defined("orderedGroundPrimitives",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}Px.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!J.getValueOrDefault(t.show,n,!0)};Px.prototype._setOptions=L.throwInstantiationError;Px.prototype.update=function(e){C.defined("time",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),l=this._options;if(!c(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Ut,f,p=t._getIsClosed(l);if(u)f=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let y=qo.getValue(e,d,this._material);this._material=y,f=new so({material:y,translucent:y.isTranslucent(),closed:p})}if(n)l.vertexFormat=an.VERTEX_FORMAT,this._primitive=o.add(new kc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:f,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),J.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=f.vertexFormat;let y=this._geometryUpdater.createFillGeometryInstance(e);u&&(f.translucent=y.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:y,appearance:f,asynchronous:!1,shadows:a}))}}if(!n&&c(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 an({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};Px.prototype.getBoundingSphere=function(e){if(!c(e))throw new L("result is required.");let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return c(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(ue.clone(o.boundingSphere,e),ut.DONE):c(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(ue.clone(o.boundingSphere,e),ut.DONE):c(n)&&!n.ready||c(i)&&!i.ready?ut.PENDING:ut.FAILED};Px.prototype.isDestroyed=function(){return!1};Px.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),he(this)};var ii=Px;var orn=_(T(),1);var uqt=_(T(),1);var mie={};function nX(e,t){if(!c(e))throw new L("identifier is required.");c(mie[e])||(mie[e]=!0,console.warn(t??e))}nX.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.";nX.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";nX.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";nX.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ht=nX;var Uon=_(T(),1);var fqt=_(T(),1),sPe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},vp=Object.freeze(sPe);var Sen=_(T(),1);var d$t=_(T(),1);var pqt=_(T(),1),aPe={NONE:0,GEODESIC:1,RHUMB:2},Kt=Object.freeze(aPe);var _qt=_(T(),1);var fie=w.EPSILON10;function cPe(e,t,n,i){if(C.defined("equalsEpsilon",t),!c(e))return;n=n??!1;let o=c(i),r=e.length;if(r<2)return e;let s,a=e[0],l,d,u=0,f=-1;for(s=1;sw.EPSILON12);let G=N*(t*t-n*n)/(n*n),X=1+G*(4096+G*(G*(320-175*G)-768))/16384,W=G*(256+G*(G*(74-47*G)-128))/1024,A=b*b,k=W*F*(b+W*(P*(2*A-1)-W*b*(4*F*F-3)*(4*A-3)/6)/4),B=n*X*(v-k),O=Math.atan2(y*I,x-V*E),H=Math.atan2(f*I,x*E-V);e._distance=B,e._startHeading=O,e._endHeading=H,e._uSquared=G}var mPe=new m,KY=new m;function pie(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,KY),mPe),r=m.normalize(i.cartographicToCartesian(n,KY),KY);C.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(m.angleBetween(o,r))-Math.PI),.0125),uPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=pe.clone(t,e._start),e._end=pe.clone(n,e._end),e._start.height=0,e._end.height=0,lPe(e)}function iX(e,t,n){let i=n??re.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,c(e)&&c(t)&&pie(this,e,t,i)}Object.defineProperties(iX.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return C.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return C.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return C.defined("distance",this._distance),this._endHeading}}});iX.prototype.setEndPoints=function(e,t){C.defined("start",e),C.defined("end",t),pie(this,e,t,this._ellipsoid)};iX.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};iX.prototype.interpolateUsingSurfaceDistance=function(e,t){C.defined("distance",this._distance);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),l=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),f=i*i,p=i*f,y=n.u8Over256,h=n.u2Over4,g=n.u6Over64,x=n.u4Over16,S=2*p*y*o/3+i*(1-h+7*x/4-15*g/4+579*y/64-(x-15*g/4+187*y/16)*o-(5*g/4-115*y/16)*r-29*y*s/16)+(h/2-x+71*g/32-85*y/16)*a+(5*x/16-5*g/4+383*y/96)*l-f*((g-11*y/2)*a+5*y*l/2)+(29*g/96-29*y/16)*d+539*y*u/1536,V=Math.asin(Math.sin(S)*n.cosineAlpha),Z=Math.atan(n.a/n.b*Math.tan(V));S=S-n.sigma;let R=Math.cos(2*n.sigma+S),E=Math.sin(S),I=Math.cos(S),v=n.cosineU*I,P=n.sineU*E,N=Math.atan2(E*n.sineHeading,v-P*n.cosineHeading)-hie(n.f,n.sineAlpha,n.cosineSquaredAlpha,S,E,I,R);return c(t)?(t.longitude=this._start.longitude+N,t.latitude=Z,t.height=0,t):new pe(this._start.longitude+N,Z,0)};var Fp=iX;var Aqt=_(T(),1);function QY(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,l=a*i,d=n,u=Math.sin(2*d),f=Math.sin(4*d),p=Math.sin(6*d),y=Math.sin(8*d),h=Math.sin(10*d),g=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*l/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*l/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*l/8388608)*f-(35*r/3072+175*s/12288+3675*a/262144+13475*l/1048576)*p+(315*s/131072+2205*a/524288+43659*l/8388608)*y-(693*a/1310720+6237*l/5242880)*h+1001*l/8388608*g)}function fPe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,l=a*a,d=l*l,u=d*l,f=u*l,p=f*l,y=p*l,h=Math.sin(2*i),g=Math.cos(2*i),x=Math.sin(4*i),S=Math.cos(4*i),V=Math.sin(6*i),Z=Math.cos(6*i),R=Math.sin(8*i),E=Math.cos(8*i),I=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*l/4+7*i*d/64+15*i*u/256+579*i*f/16384+1515*i*p/65536+16837*i*y/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*f/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*y/5242880)*g+(21*i*u/256+483*i*f/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*y/1048576)*S+(151*i*f/4096+4681*i*p/65536+1479*i*y/16384-453*r*y/32768)*Z+(1097*i*p/65536+42783*i*y/1048576)*E+8011*i*y/1048576*v+(3*l/8+3*d/16+213*u/2048-3*o*u/64+255*f/4096-33*o*f/512+20861*p/524288-33*o*p/512+s*p/1024+28273*y/1048576-471*o*y/8192+9*s*y/4096)*h+(21*d/256+21*u/256+533*f/8192-21*o*f/512+197*p/4096-315*o*p/4096+584039*y/16777216-12517*o*y/131072+7*s*y/2048)*x+(151*u/6144+151*f/4096+5019*p/131072-453*o*p/16384+26965*y/786432-8607*o*y/131072)*V+(1097*f/131072+1097*p/65536+225797*y/10485760-1097*o*y/65536)*R+(8011*p/2621440+8011*y/1048576)*I+293393*y/251658240*P}function gC(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 hPe(e,t,n,i,o){let r=gC(e._ellipticity,n),s=gC(e._ellipticity,o);return Math.atan2(w.negativePiToPi(i-t),s-r)}function pPe(e,t,n,i,o,r,s){let a=e._heading,l=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(l);else{let u=Math.sin(o);d=t*Math.cos(o)*w.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=QY(e._ellipticity,t,o);d=(QY(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var bPe=new m,JY=new m;function bie(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,JY),bPe),r=m.normalize(i.cartographicToCartesian(n,JY),JY);C.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(m.angleBetween(o,r))-Math.PI),.0125);let s=i.maximumRadius,a=i.minimumRadius,l=s*s,d=a*a;e._ellipticitySquared=(l-d)/l,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=pe.clone(t,e._start),e._start.height=0,e._end=pe.clone(n,e._end),e._end.height=0,e._heading=hPe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=pPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function yie(e,t,n,i,o,r){if(n===0)return pe.clone(e,r);let s=o*o,a,l,d;if(Math.abs(w.PI_OVER_TWO-Math.abs(t))>w.EPSILON8){let u=QY(o,i,e.latitude),f=n*Math.cos(t),p=u+f;if(l=fPe(p,o,i),Math.abs(t)0?a=w.negativePiToPi(e.longitude+d):a=w.negativePiToPi(e.longitude-d)}return c(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new pe(a,l,0)}function Ap(e,t,n){let i=n??re.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,c(e)&&c(t)&&bie(this,e,t,i)}Object.defineProperties(Ap.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return C.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return C.defined("distance",this._distance),this._heading}}});Ap.fromStartHeadingDistance=function(e,t,n,i,o){C.defined("start",e),C.defined("heading",t),C.defined("distance",n),C.typeOf.number.greaterThan("distance",n,0);let r=i??re.default,s=r.maximumRadius,a=r.minimumRadius,l=s*s,d=a*a,u=Math.sqrt((l-d)/l);t=w.negativePiToPi(t);let f=yie(e,t,n,r.maximumRadius,u);return!c(o)||c(i)&&!i.equals(o.ellipsoid)?new Ap(e,f,r):(o.setEndPoints(e,f),o)};Ap.prototype.setEndPoints=function(e,t){C.defined("start",e),C.defined("end",t),bie(this,e,t,this._ellipsoid)};Ap.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Ap.prototype.interpolateUsingSurfaceDistance=function(e,t){if(C.typeOf.number("distance",e),!c(this._distance)||this._distance===0)throw new L("EllipsoidRhumbLine must have distinct start and end set.");return yie(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Ap.prototype.findIntersectionWithLongitude=function(e,t){if(C.typeOf.number("intersectionLongitude",e),!c(this._distance)||this._distance===0)throw new L("EllipsoidRhumbLine must have distinct start and end set.");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),c(t)||(t=new pe),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),l=Math.tan(.5*(w.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,f;do{f=u;let p=n*Math.sin(f),y=(1+p)/(1-p);u=2*Math.atan(l*Math.pow(y/d,n/2))-w.PI_OVER_TWO}while(!w.equalsEpsilon(u,f,w.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};Ap.prototype.findIntersectionWithLatitude=function(e,t){if(C.typeOf.number("intersectionLatitude",e),!c(this._distance)||this._distance===0)throw new L("EllipsoidRhumbLine must have distinct start and end set.");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=gC(n,o.latitude),s=gC(n,e),a=Math.tan(i)*(s-r),l=w.negativePiToPi(o.longitude+a);return c(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new pe(l,e,0)};var va=Ap;var oH=[Xi,Wi],yPe=oH.length,Aie=Math.cos(w.toRadians(30)),gie=Math.cos(w.toRadians(150)),Mie=0,Nie=1e3;function q0(e){e=e??z.EMPTY_OBJECT;let t=e.positions;if(!c(t)||t.length<2)throw new L("At least two positions are required.");if(c(e.arcType)&&e.arcType!==Kt.GEODESIC&&e.arcType!==Kt.RHUMB)throw new L("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??Kt.GEODESIC,this._ellipsoid=re.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(q0.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});q0.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iAie||rw.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,Zie),d=l.cartesianToCartographic(s,Lie)),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 APe=new m,Rie=new m;function Gie(e,t,n,i,o,r){let s=m.subtract(t,e,APe);m.normalize(s,s);let a=n-Mie,l=m.multiplyByScalar(s,a,Rie);m.add(e,l,o);let d=i-Nie;l=m.multiplyByScalar(s,d,Rie),m.add(t,l,r)}var MPe=new m;function x5(e,t){let n=cn.getPointDistance(_5,e),i=cn.getPointDistance(_5,t),o=MPe;w.equalsEpsilon(n,0,w.EPSILON2)?(o=Mp(t,e,o),m.multiplyByScalar(o,w.EPSILON2,o),m.add(e,o,e)):w.equalsEpsilon(i,0,w.EPSILON2)&&(o=Mp(e,t,o),m.multiplyByScalar(o,w.EPSILON2,o),m.add(t,o,t))}function NPe(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 Uie=new pe,Oie=new pe,Eie=new m,eH=new m,Xie=new m,Iie=new m,kPe=new m,Wie=new m,UPe=[Uie,Oie],OPe=new de,DPe=new m,BPe=new m,YPe=new m,HPe=new m,zPe=new m,KPe=new m,tH=new m,nH=new m,JPe=new m,QPe=new m,jPe=new m,wie=new m,qPe=new m,$Pe=new m,e2e=new Bn,t2e=new Bn,Pie=new m,n2e=new m,vie=new m,i2e=[new ue,new ue],Die=[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],Fie=Die.length;function o2e(e,t,n,i,o,r,s){let a,l,d=t._ellipsoid,u=n.length/3-1,f=u*8,p=f*4,y=u*36,h=f>65535?new Uint32Array(y):new Uint16Array(y),g=new Float64Array(f*3),x=new Float32Array(p),S=new Float32Array(p),V=new Float32Array(p),Z=new Float32Array(p),R=new Float32Array(p),E,I,v,P;s&&(E=new Float32Array(p),I=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(f*2));let F=r.length/2,N=0,b=Uie;b.height=0;let G=Oie;G.height=0;let X=Eie,W=eH;if(s)for(l=0,a=1;aAie?(Ht=oX(t,b,Ke,rt,tH),qe=oX(t,G,$,Xt,nH)):bi===1?(qe=oX(t,G,$,Xt,nH),Ht.x=0,Ht.y=w.sign(b.longitude-Math.abs(G.longitude)),Ht.z=0):(Ht=oX(t,b,Ke,rt,tH),qe.x=0,qe.y=w.sign(b.longitude-G.longitude),qe.z=0)}let mn=m.distance(De,j),Dt=Bn.fromCartesian(Ze,e2e),Lt=m.subtract(ie,Ze,JPe),Vi=m.normalize(Lt,wie),ln=m.subtract(De,Ze,QPe);ln=m.normalize(ln,ln);let ge=m.cross(Vi,ln,wie);ge=m.normalize(ge,ge);let Le=m.cross(ln,Ke,qPe);Le=m.normalize(Le,Le);let yn=m.subtract(j,ie,jPe);yn=m.normalize(yn,yn);let bt=m.cross($,yn,$Pe);bt=m.normalize(bt,bt);let ro=mn/k,Xo=ne/k,ra=0,Wr,_s,Ae,st=0,Qe=0;if(s){ra=m.distance(rt,Xt),Wr=Bn.fromCartesian(rt,t2e),_s=m.subtract(Xt,rt,Pie),Ae=m.normalize(_s,n2e);let bi=Ae.x;Ae.x=Ae.y,Ae.y=-bi,st=ra/N,Qe=be/N}for(B=0;B<8;B++){let bi=K+B*4,sa=H+B*2,Qr=bi+3,xl=B<4?1:-1,yo=B===2||B===3||B===6||B===7?1:-1;m.pack(Dt.high,x,bi),x[Qr]=Lt.x,m.pack(Dt.low,S,bi),S[Qr]=Lt.y,m.pack(Le,V,bi),V[Qr]=Lt.z,m.pack(bt,Z,bi),Z[Qr]=ro*xl,m.pack(ge,R,bi);let wr=Xo*yo;wr===0&&yo<0&&(wr=9),R[Qr]=wr,s&&(E[bi]=Wr.high.x,E[bi+1]=Wr.high.y,E[bi+2]=Wr.low.x,E[bi+3]=Wr.low.y,v[bi]=-Ht.y,v[bi+1]=Ht.x,v[bi+2]=qe.y,v[bi+3]=-qe.x,I[bi]=_s.x,I[bi+1]=_s.y,I[bi+2]=Ae.x,I[bi+3]=Ae.y,P[sa]=st*xl,wr=Qe*yo,wr===0&&yo<0&&(wr=9),P[sa+1]=wr)}let $e=YPe,yt=HPe,Bt=DPe,Ln=BPe,Io=de.fromCartographicArray(UPe,OPe),To=ui.getMinimumMaximumHeights(Io,d),Ka=To.minimumTerrainHeight,Ja=To.maximumTerrainHeight;Ce+=Math.abs(Ka),Ce+=Math.abs(Ja),Gie(Ze,De,Ka,Ja,$e,Bt),Gie(ie,j,Ka,Ja,yt,Ln);let Li=m.multiplyByScalar(ge,w.EPSILON5,vie);m.add($e,Li,$e),m.add(yt,Li,yt),m.add(Bt,Li,Bt),m.add(Ln,Li,Ln),x5($e,yt),x5(Bt,Ln),m.pack($e,g,U),m.pack(yt,g,U+3),m.pack(Ln,g,U+6),m.pack(Bt,g,U+9),Li=m.multiplyByScalar(ge,-2*w.EPSILON5,vie),m.add($e,Li,$e),m.add(yt,Li,yt),m.add(Bt,Li,Bt),m.add(Ln,Li,Ln),x5($e,yt),x5(Bt,Ln),m.pack($e,g,U+12),m.pack(yt,g,U+15),m.pack(Ln,g,U+18),m.pack(Bt,g,U+21),O+=2,l+=3,H+=16,U+=24,K+=32,ne+=mn,be+=ra}l=0;let me=0;for(a=0;a0&&(c=o[0].attributes,p=_u.hasAttributesForSphericalExtents(c),b=_u.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};g_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};g_.prototype.isDestroyed=function(){return!1};g_.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 g1=g_;var UOe={u_globeMinimumAltitude:function(){return 55e3}};function Gd(e){e=e??B.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{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Gd.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Gd.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Gd.prototype.isDestroyed=function(){return!1};Gd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Gd._supportsMaterials=function(e){return e.depthTexture};Gd.supportsMaterials=function(e){return Gd._supportsMaterials(e.frameState.context)};var Nl=Gd;var i0n=x(T(),1);function y1(){ge.throwInstantiationError()}Object.defineProperties(y1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});y1.prototype.getType=ge.throwInstantiationError;y1.prototype.getValue=ge.throwInstantiationError;y1.prototype.equals=ge.throwInstantiationError;var QOe=new Q;y1.getValue=function(e,t,n){let i;return l(e)||(e=Q.now(QOe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=eo.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==eo.ColorType)&&(n=eo.fromType(eo.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var yr=y1;function y_(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}y_.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};y_.prototype._setOptions=ge.throwInstantiationError;y_.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 Qt,m,p=t._getIsClosed(c);if(u)m=new Tn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let b=yr.getValue(e,d,this._material);this._material=b,m=new Co({material:b,translucent:b.isTranslucent(),closed:p})}if(n)c.vertexFormat=Tn.VERTEX_FORMAT,this._primitive=o.add(new Nl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),j.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let b=this._geometryUpdater.createFillGeometryInstance(e);u&&(m.translucent=b.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:b,appearance:m,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 Tn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};y_.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))?(de.clone(o.boundingSphere,e),Wt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(de.clone(o.boundingSphere,e),Wt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Wt.PENDING:Wt.FAILED};y_.prototype.isDestroyed=function(){return!1};y_.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 Li=y_;var N_n=x(T(),1);var T0n=x(T(),1);var Rhe={};function Bv(e,t){l(Rhe[e])||(Rhe[e]=!0,console.warn(t??e))}Bv.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.";Bv.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Bv.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Bv.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var xt=Bv;var __n=x(T(),1);var S0n=x(T(),1),Che={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(Che);var ub=Che;var Zgn=x(T(),1);var hbn=x(T(),1);var R0n=x(T(),1),Vhe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Vhe);var un=Vhe;var A0n=x(T(),1);var Ehe=W.EPSILON10;function qOe(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,m=-1;for(s=1;sW.EPSILON12);let V=N*(t*t-n*n)/(n*n),G=1+V*(4096+V*(V*(320-175*V)-768))/16384,v=V*(256+V*(V*(74-47*V)-128))/1024,X=g*g,Y=v*I*(g+v*(F*(2*X-1)-v*g*(4*I*I-3)*(4*X-3)/6)/4),D=n*G*(L-Y),w=Math.atan2(b*A,_-Z*E),O=Math.atan2(m*A,_*E-Z);e._distance=D,e._startHeading=w,e._endHeading=O,e._uSquared=V}var nBe=new h,SQ=new h;function Ghe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,SQ),nBe),r=h.normalize(i.cartographicToCartesian(n,SQ),SQ);tBe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=pe.clone(t,e._start),e._end=pe.clone(n,e._end),e._start.height=0,e._end.height=0,$Oe(e)}function zv(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Ghe(this,e,t,i)}Object.defineProperties(zv.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}}});zv.prototype.setEndPoints=function(e,t){Ghe(this,e,t,this._ellipsoid)};zv.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};zv.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),m=i*i,p=i*m,b=n.u8Over256,f=n.u2Over4,y=n.u6Over64,_=n.u4Over16,S=2*p*b*o/3+i*(1-f+7*_/4-15*y/4+579*b/64-(_-15*y/4+187*b/16)*o-(5*y/4-115*b/16)*r-29*b*s/16)+(f/2-_+71*y/32-85*b/16)*a+(5*_/16-5*y/4+383*b/96)*c-m*((y-11*b/2)*a+5*b*c/2)+(29*y/96-29*b/16)*d+539*b*u/1536,Z=Math.asin(Math.sin(S)*n.cosineAlpha),R=Math.atan(n.a/n.b*Math.tan(Z));S=S-n.sigma;let C=Math.cos(2*n.sigma+S),E=Math.sin(S),A=Math.cos(S),L=n.cosineU*A,F=n.sineU*E,N=Math.atan2(E*n.sineHeading,L-F*n.cosineHeading)-Ahe(n.f,n.sineAlpha,n.cosineSquaredAlpha,S,E,A,C);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=R,t.height=0,t):new pe(this._start.longitude+N,R,0)};var mb=zv;var U0n=x(T(),1);function RQ(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),m=Math.sin(4*d),p=Math.sin(6*d),b=Math.sin(8*d),f=Math.sin(10*d),y=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)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*b-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*y)}function iBe(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,m=u*c,p=m*c,b=p*c,f=Math.sin(2*i),y=Math.cos(2*i),_=Math.sin(4*i),S=Math.cos(4*i),Z=Math.sin(6*i),R=Math.cos(6*i),C=Math.sin(8*i),E=Math.cos(8*i),A=Math.sin(10*i),L=Math.cos(10*i),F=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*m/16384+1515*i*p/65536+16837*i*b/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*b/5242880)*y+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*b/1048576)*S+(151*i*m/4096+4681*i*p/65536+1479*i*b/16384-453*r*b/32768)*R+(1097*i*p/65536+42783*i*b/1048576)*E+8011*i*b/1048576*L+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*b/1048576-471*o*b/8192+9*s*b/4096)*f+(21*d/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*b/16777216-12517*o*b/131072+7*s*b/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*b/786432-8607*o*b/131072)*Z+(1097*m/131072+1097*p/65536+225797*b/10485760-1097*o*b/65536)*C+(8011*p/2621440+8011*b/1048576)*A+293393*b/251658240*F}function x1(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 oBe(e,t,n,i,o){let r=x1(e._ellipticity,n),s=x1(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function rBe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d;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=RQ(e._ellipticity,t,o);d=(RQ(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var sBe=new h,ZQ=new h;function Lhe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,ZQ),sBe),r=h.normalize(i.cartographicToCartesian(n,ZQ),ZQ),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=pe.clone(t,e._start),e._start.height=0,e._end=pe.clone(n,e._end),e._end.height=0,e._heading=oBe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=rBe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Whe(e,t,n,i,o,r){if(n===0)return pe.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=RQ(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=iBe(p,o,i),Math.abs(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 pe(a,c,0)}function hb(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Lhe(this,e,t,i)}Object.defineProperties(hb.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}}});hb.fromStartHeadingDistance=function(e,t,n,i,o){let r=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 m=Whe(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new hb(e,m,r):(o.setEndPoints(e,m),o)};hb.prototype.setEndPoints=function(e,t){Lhe(this,e,t,this._ellipsoid)};hb.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};hb.prototype.interpolateUsingSurfaceDistance=function(e,t){return Whe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};hb.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 pe),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,m;do{m=u;let p=n*Math.sin(m),b=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(b/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,m,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};hb.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=x1(n,o.latitude),s=x1(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 pe(c,e,0)};var Ac=hb;var vQ=[ki,xi],aBe=vQ.length,Qhe=Math.cos(W.toRadians(30)),vhe=Math.cos(W.toRadians(150)),qhe=0,$he=1e3;function Xy(e){e=e??B.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??un.GEODESIC,this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Xy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});Xy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iQhe||rW.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,Mhe),d=c.cartesianToCartographic(s,whe)),d.height=0;let u=e.project(d,o);return o=h.subtract(u,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var EBe=new h,khe=new h;function Uhe(e,t,n,i,o,r){let s=h.subtract(t,e,EBe);h.normalize(s,s);let a=n-qhe,c=h.multiplyByScalar(s,a,khe);h.add(e,c,o);let d=i-$he;c=h.multiplyByScalar(s,d,khe),h.add(t,c,r)}var ABe=new h;function tO(e,t){let n=cn.getPointDistance(nO,e),i=cn.getPointDistance(nO,t),o=ABe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=fb(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=fb(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function GBe(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 tfe=new pe,nfe=new pe,Dhe=new h,AQ=new h,Ohe=new h,Bhe=new h,LBe=new h,zhe=new h,WBe=[tfe,nfe],vBe=new re,FBe=new h,IBe=new h,PBe=new h,XBe=new h,NBe=new h,YBe=new h,GQ=new h,LQ=new h,wBe=new h,MBe=new h,kBe=new h,Hhe=new h,UBe=new h,DBe=new h,OBe=new An,BBe=new An,Khe=new h,zBe=new h,Jhe=new h,HBe=[new de,new de],ife=[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],jhe=ife.length;function KBe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,b=u*36,f=m>65535?new Uint32Array(b):new Uint16Array(b),y=new Float64Array(m*3),_=new Float32Array(p),S=new Float32Array(p),Z=new Float32Array(p),R=new Float32Array(p),C=new Float32Array(p),E,A,L,F;s&&(E=new Float32Array(p),A=new Float32Array(p),L=new Float32Array(p),F=new Float32Array(m*2));let I=r.length/2,N=0,g=tfe;g.height=0;let V=nfe;V.height=0;let G=Dhe,v=AQ;if(s)for(c=0,a=1;aQhe?(qe=Hv(t,g,tt,Be,GQ),We=Hv(t,V,$,je,LQ)):bi===1?(We=Hv(t,V,$,je,LQ),qe.x=0,qe.y=W.sign(g.longitude-Math.abs(V.longitude)),qe.z=0):(qe=Hv(t,g,tt,Be,GQ),We.x=0,We.y=W.sign(g.longitude-V.longitude),We.z=0)}let Ke=h.distance(Fe,H),ct=An.fromCartesian(Ae,OBe),Et=h.subtract(te,Ae,wBe),zt=h.normalize(Et,Hhe),ut=h.subtract(Fe,Ae,MBe);ut=h.normalize(ut,ut);let bt=h.cross(zt,ut,Hhe);bt=h.normalize(bt,bt);let ht=h.cross(ut,tt,UBe);ht=h.normalize(ht,ht);let jt=h.subtract(H,te,kBe);jt=h.normalize(jt,jt);let st=h.cross($,jt,DBe);st=h.normalize(st,st);let pt=Ke/Y,wi=ee/Y,jn=0,_i,Hi,Gi,fi=0,Si=0;if(s){jn=h.distance(Be,je),_i=An.fromCartesian(Be,BBe),Hi=h.subtract(je,Be,Khe),Gi=h.normalize(Hi,zBe);let bi=Gi.x;Gi.x=Gi.y,Gi.y=-bi,fi=jn/N,Si=le/N}for(D=0;D<8;D++){let bi=z+D*4,fr=O+D*2,mo=bi+3,Qr=D<4?1:-1,wn=D===2||D===3||D===6||D===7?1:-1;h.pack(ct.high,_,bi),_[mo]=Et.x,h.pack(ct.low,S,bi),S[mo]=Et.y,h.pack(ht,Z,bi),Z[mo]=Et.z,h.pack(st,R,bi),R[mo]=pt*Qr,h.pack(bt,C,bi);let Ki=wi*wn;Ki===0&&wn<0&&(Ki=9),C[mo]=Ki,s&&(E[bi]=_i.high.x,E[bi+1]=_i.high.y,E[bi+2]=_i.low.x,E[bi+3]=_i.low.y,L[bi]=-qe.y,L[bi+1]=qe.x,L[bi+2]=We.y,L[bi+3]=-We.x,A[bi]=Hi.x,A[bi+1]=Hi.y,A[bi+2]=Gi.x,A[bi+3]=Gi.y,F[fr]=fi*Qr,Ki=Si*wn,Ki===0&&wn<0&&(Ki=9),F[fr+1]=Ki)}let On=PBe,rn=XBe,Hn=FBe,$i=IBe,Po=re.fromCartographicArray(WBe,vBe),hr=Pi.getMinimumMaximumHeights(Po,d),Is=hr.minimumTerrainHeight,Hs=hr.maximumTerrainHeight;_e+=Math.abs(Is),_e+=Math.abs(Hs),Uhe(Ae,Fe,Is,Hs,On,Hn),Uhe(te,H,Is,Hs,rn,$i);let or=h.multiplyByScalar(bt,W.EPSILON5,Jhe);h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),tO(On,rn),tO(Hn,$i),h.pack(On,y,M),h.pack(rn,y,M+3),h.pack($i,y,M+6),h.pack(Hn,y,M+9),or=h.multiplyByScalar(bt,-2*W.EPSILON5,Jhe),h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),tO(On,rn),tO(Hn,$i),h.pack(On,y,M+12),h.pack(rn,y,M+15),h.pack($i,y,M+18),h.pack(Hn,y,M+21),w+=2,c+=3,O+=16,M+=24,z+=32,ee+=Ke,le+=jn}c=0;let he=0;for(a=0;a{!this._ready&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Np.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new L("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Np.isSupported=function(e){return e.frameState.context.depthTexture};Np.prototype.isDestroyed=function(){return!1};Np.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,he(this)};var Am=Np;var Ken=_(T(),1);var ken=_(T(),1);var Wen=_(T(),1);var d2e=new D(1,1),u2e=!1,m2e=Y.WHITE;function xC(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(xC.prototype,{isConstant:{get:function(){return J.isConstant(this._image)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:fe("image"),repeat:fe("repeat"),color:fe("color"),transparent:fe("transparent")});xC.prototype.getType=function(e){return"Image"};var f2e=new ee;xC.prototype.getValue=function(e,t){return c(e)||(e=ee.now(f2e)),c(t)||(t={}),t.image=J.getValueOrUndefined(this._image,e),t.repeat=J.getValueOrClonedDefault(this._repeat,e,d2e,t.repeat),t.color=J.getValueOrClonedDefault(this._color,e,m2e,t.color),J.getValueOrDefault(this._transparent,e,u2e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};xC.prototype.equals=function(e){return this===e||e instanceof xC&&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 $0=xC;function h2e(e){if(e instanceof Y)return new Ut(e);if(typeof e=="string"||e instanceof Ge||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new $0;return t.image=e,t}throw new L(`Unable to infer material type: ${e}`)}function p2e(e,t){return fe(e,t,h2e)}var wo=p2e;function uX(e){this._definitionChanged=new ye,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(e??z.EMPTY_OBJECT)}Object.defineProperties(uX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),dimensions:fe("dimensions"),heightReference:fe("heightReference"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});uX.prototype.clone=function(e){return c(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 uX(this)};uX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Nx=uX;var ftn=_(T(),1);var Qen=_(T(),1),b2e={FIXED:0,INERTIAL:1},Ui=Object.freeze(b2e);var otn=_(T(),1);function _C(){L.throwInstantiationError()}Object.defineProperties(_C.prototype,{isConstant:{get:L.throwInstantiationError},definitionChanged:{get:L.throwInstantiationError},referenceFrame:{get:L.throwInstantiationError}});_C.prototype.getValue=L.throwInstantiationError;_C.prototype.getValueInReferenceFrame=L.throwInstantiationError;_C.prototype.equals=L.throwInstantiationError;var Hie=new te;_C.convertToReferenceFrame=function(e,t,n,i,o){if(!c(t))return t;if(c(o)||(o=new m),n===i)return m.clone(t,o);let r=wt.computeIcrfToCentralBodyFixedMatrix(e,Hie);if(n===Ui.INERTIAL)return te.multiplyByVector(r,t,o);if(n===Ui.FIXED)return te.multiplyByVector(te.transpose(r,Hie),t,o)};var Mm=_C;function kx(e,t){this._definitionChanged=new ye,this._value=m.clone(e),this._referenceFrame=t??Ui.FIXED}Object.defineProperties(kx.prototype,{isConstant:{get:function(){return!c(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var y2e=new ee;kx.prototype.getValue=function(e,t){return c(e)||(e=ee.now(y2e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};kx.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),c(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};kx.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");return Mm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};kx.prototype.equals=function(e){return this===e||e instanceof kx&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Oc=kx;var Ttn=_(T(),1);function mX(e){this._definitionChanged=new ye,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(e??z.EMPTY_OBJECT)}Object.defineProperties(mX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});mX.prototype.clone=function(e){return c(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 mX(this)};mX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Ux=mX;var Vtn=_(T(),1);function g2e(e){return e}function x2e(e,t){return fe(e,t,g2e)}var Dc=x2e;var Wtn=_(T(),1);function fX(e){this._definitionChanged=new ye,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(e??z.EMPTY_OBJECT)}Object.defineProperties(fX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),length:fe("length"),topRadius:fe("topRadius"),bottomRadius:fe("bottomRadius"),heightReference:fe("heightReference"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),slices:fe("slices"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});fX.prototype.clone=function(e){return c(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 fX(this)};fX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Ox=fX;var ktn=_(T(),1);function hX(e){this._definitionChanged=new ye,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(e??z.EMPTY_OBJECT)}Object.defineProperties(hX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),semiMajorAxis:fe("semiMajorAxis"),semiMinorAxis:fe("semiMinorAxis"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});hX.prototype.clone=function(e){return c(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 hX(this)};hX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Dx=hX;var Ktn=_(T(),1);function pX(e){this._definitionChanged=new ye,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(e??z.EMPTY_OBJECT)}Object.defineProperties(pX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),radii:fe("radii"),innerRadii:fe("innerRadii"),minimumClock:fe("minimumClock"),maximumClock:fe("maximumClock"),minimumCone:fe("minimumCone"),maximumCone:fe("maximumCone"),heightReference:fe("heightReference"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),stackPartitions:fe("stackPartitions"),slicePartitions:fe("slicePartitions"),subdivisions:fe("subdivisions"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});pX.prototype.clone=function(e){return c(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 pX(this)};pX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Bx=pX;var tnn=_(T(),1);function bX(e){this._definitionChanged=new ye,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(e??z.EMPTY_OBJECT)}Object.defineProperties(bX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),text:fe("text"),font:fe("font"),style:fe("style"),scale:fe("scale"),showBackground:fe("showBackground"),backgroundColor:fe("backgroundColor"),backgroundPadding:fe("backgroundPadding"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),fillColor:fe("fillColor"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),scaleByDistance:fe("scaleByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance")});bX.prototype.clone=function(e){return c(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 bX(this)};bX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Nm=bX;var wnn=_(T(),1);var pnn=_(T(),1);var snn=_(T(),1);var _2e=new m(1,1,1),T2e=m.ZERO,S2e=Fe.IDENTITY;function zie(e,t,n){this.translation=m.clone(e??T2e),this.rotation=Fe.clone(t??S2e),this.scale=m.clone(n??_2e)}zie.prototype.equals=function(e){return this===e||c(e)&&m.equals(this.translation,e.translation)&&Fe.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var ey=zie;var aH=new ey;function yX(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(yX.prototype,{isConstant:{get:function(){return J.isConstant(this._translation)&&J.isConstant(this._rotation)&&J.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:fe("translation"),rotation:fe("rotation"),scale:fe("scale")});var C2e=new ee;yX.prototype.getValue=function(e,t){return c(e)||(e=ee.now(C2e)),c(t)||(t=new ey),t.translation=J.getValueOrClonedDefault(this._translation,e,aH.translation,t.translation),t.rotation=J.getValueOrClonedDefault(this._rotation,e,aH.rotation,t.rotation),t.scale=J.getValueOrClonedDefault(this._scale,e,aH.scale,t.scale),t};yX.prototype.equals=function(e){return this===e||e instanceof yX&&J.equals(this._translation,e._translation)&&J.equals(this._rotation,e._rotation)&&J.equals(this._scale,e._scale)};var Yx=yX;var Vnn=_(T(),1);function kp(e,t){this._propertyNames=[],this._definitionChanged=new ye,c(e)&&this.merge(e,t)}Object.defineProperties(kp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var B2e=new ee;SC.prototype.getValue=function(e,t){c(e)||(e=ee.now(B2e));let n=J.getValueOrDefault(this._heightReference,e,ze.NONE),i=J.getValueOrDefault(this._extrudedHeightReference,e,ze.NONE);if(n===ze.NONE&&!lC(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant&&n!==ze.CLIP_TO_GROUND)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,qie);if(!c(r)||m.equals(r,m.ZERO)||!c(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,w.EPSILON10)&&n!==ze.CLIP_TO_GROUND)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);if(n===ze.CLIP_TO_GROUND){let l=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=l.height?m.multiplyByScalar(s,this._terrainHeight-l.height,t):m.clone(m.ZERO,t)}return m.multiplyByScalar(s,this._terrainHeight,t)};SC.prototype.isDestroyed=function(){return!1};SC.prototype.destroy=function(){return c(this._removeEventListener)&&this._removeEventListener(),c(this._removeModeListener)&&this._removeModeListener(),c(this._removeCallbackFunc)&&this._removeCallbackFunc(),he(this)};var Jx=SC;function Y2e(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(c(r)){let s=new Om(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Jx(this._scene,s,r)}}var Bp=Y2e;var $ie=m.ZERO,eoe=new m,H2e=new m,toe=new Y;function z2e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function yd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new z2e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}c(Object.create)&&(yd.prototype=Object.create(oi.prototype),yd.prototype.constructor=yd);Object.defineProperties(yd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});yd.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,toe)),c(a)||(a=Y.WHITE),s.color=Yt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,$ie,eoe))),new Rt({id:t,geometry:Wa.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};yd.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,toe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,$ie,eoe))),new Rt({id:t,geometry:Fm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};yd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};yd.prototype._isHidden=function(e,t){return!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};yd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};yd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ye.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==ze.NONE?$t.ALL:void 0};yd.prototype._onEntityPropertyChanged=Bp;yd.DynamicGeometryUpdater=CC;function CC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(CC.prototype=Object.create(ii.prototype),CC.prototype.constructor=CC);CC.prototype._isHidden=function(e,t,n){let i=J.getValueOrUndefined(e.position,n,H2e),o=this._options.dimensions;return!c(i)||!c(o)||ii.prototype._isHidden.call(this,e,t,n)};CC.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,ze.NONE),o=this._options;o.dimensions=J.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==ze.NONE?$t.ALL:void 0};var EX=yd;var asn=_(T(),1);function Qx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Ui.FIXED,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(Qx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var K2e=new ee;Qx.prototype.getValue=function(e,t){return c(e)||(e=ee.now(K2e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Qx.prototype.setCallback=function(e,t){if(!c(e))throw new L("callback is required.");if(!c(t))throw new L("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Qx.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._callback(e,n);return Mm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Qx.prototype.equals=function(e){return this===e||e instanceof Qx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var XX=Qx;var m4n=_(T(),1);var e4n=_(T(),1);var hsn=_(T(),1);var lsn=_(T(),1);/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */var{entries:uoe,setPrototypeOf:noe,isFrozen:J2e,getPrototypeOf:Q2e,getOwnPropertyDescriptor:j2e}=Object,{freeze:zc,seal:Gu,create:moe}=Object,{apply:pH,construct:bH}=typeof Reflect<"u"&&Reflect;zc||(zc=function(t){return t});Gu||(Gu=function(t){return t});pH||(pH=function(t,n,i){return t.apply(n,i)});bH||(bH=function(t,n){return new t(...n)});var T5=gd(Array.prototype.forEach),ioe=gd(Array.prototype.pop),IX=gd(Array.prototype.push),C5=gd(String.prototype.toLowerCase),dH=gd(String.prototype.toString),ooe=gd(String.prototype.match),WX=gd(String.prototype.replace),q2e=gd(String.prototype.indexOf),$2e=gd(String.prototype.trim),Dm=gd(Object.prototype.hasOwnProperty),Hc=gd(RegExp.prototype.test),wX=eve(TypeError);function gd(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:C5;noe&&noe(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(J2e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function tve(e){for(let t=0;t/gm),sve=Gu(/\$\{[\w\W]*}/gm),ave=Gu(/^data-[\-\w.\u00B7-\uFFFF]+$/),cve=Gu(/^aria-[\-\w]+$/),foe=Gu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lve=Gu(/^(?:\w+script|data):/i),dve=Gu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hoe=Gu(/^html$/i),uve=Gu(/^[a-z][.\w]*(-[.\w]+)+$/i),loe=Object.freeze({__proto__:null,ARIA_ATTR:cve,ATTR_WHITESPACE:dve,CUSTOM_ELEMENT:uve,DATA_ATTR:ave,DOCTYPE_NAME:hoe,ERB_EXPR:rve,IS_ALLOWED_URI:foe,IS_SCRIPT_OR_DATA:lve,MUSTACHE_EXPR:ove,TMPLIT_EXPR:sve}),vX={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mve=function(){return typeof window>"u"?null:window},fve=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}},doe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function poe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mve(),t=dn=>poe(dn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==vX.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:y}=e,h=l.prototype,g=PX(h,"cloneNode"),x=PX(h,"remove"),S=PX(h,"nextSibling"),V=PX(h,"childNodes"),Z=PX(h,"parentNode");if(typeof s=="function"){let dn=n.createElement("template");dn.content&&dn.content.ownerDocument&&(n=dn.content.ownerDocument)}let R,E="",{implementation:I,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:F}=n,{importNode:N}=i,b=doe();t.isSupported=typeof uoe=="function"&&typeof Z=="function"&&I&&I.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:G,ERB_EXPR:X,TMPLIT_EXPR:W,DATA_ATTR:A,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:H}=loe,{IS_ALLOWED_URI:U}=loe,K=null,Q=wi({},[...roe,...uH,...mH,...fH,...soe]),ie=null,j=wi({},[...aoe,...hH,...coe,...S5]),$=Object.seal(moe(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}})),ne=null,be=null,Ce=!0,me=!0,_e=!1,Ve=!0,Ie=!1,Ze=!0,De=!1,Ke=!1,rt=!1,Xt=!1,Ht=!1,qe=!1,mn=!0,Dt=!1,Lt="user-content-",Vi=!0,ln=!1,ge={},Le=null,yn=wi({},["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"]),bt=null,ro=wi({},["audio","video","img","source","image","track"]),Xo=null,ra=wi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wr="http://www.w3.org/1998/Math/MathML",_s="http://www.w3.org/2000/svg",Ae="http://www.w3.org/1999/xhtml",st=Ae,Qe=!1,$e=null,yt=wi({},[Wr,_s,Ae],dH),Bt=wi({},["mi","mo","mn","ms","mtext"]),Ln=wi({},["annotation-xml"]),Io=wi({},["title","style","font","a","script"]),To=null,Ka=["application/xhtml+xml","text/html"],Ja="text/html",Li=null,bi=null,sa=n.createElement("form"),Qr=function(Re){return Re instanceof RegExp||Re instanceof Function},xl=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(bi&&bi===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=jx(Re),To=Ka.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Ja:Re.PARSER_MEDIA_TYPE,Li=To==="application/xhtml+xml"?dH:C5,K=Dm(Re,"ALLOWED_TAGS")?wi({},Re.ALLOWED_TAGS,Li):Q,ie=Dm(Re,"ALLOWED_ATTR")?wi({},Re.ALLOWED_ATTR,Li):j,$e=Dm(Re,"ALLOWED_NAMESPACES")?wi({},Re.ALLOWED_NAMESPACES,dH):yt,Xo=Dm(Re,"ADD_URI_SAFE_ATTR")?wi(jx(ra),Re.ADD_URI_SAFE_ATTR,Li):ra,bt=Dm(Re,"ADD_DATA_URI_TAGS")?wi(jx(ro),Re.ADD_DATA_URI_TAGS,Li):ro,Le=Dm(Re,"FORBID_CONTENTS")?wi({},Re.FORBID_CONTENTS,Li):yn,ne=Dm(Re,"FORBID_TAGS")?wi({},Re.FORBID_TAGS,Li):{},be=Dm(Re,"FORBID_ATTR")?wi({},Re.FORBID_ATTR,Li):{},ge=Dm(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,Ce=Re.ALLOW_ARIA_ATTR!==!1,me=Re.ALLOW_DATA_ATTR!==!1,_e=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ve=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Re.SAFE_FOR_TEMPLATES||!1,Ze=Re.SAFE_FOR_XML!==!1,De=Re.WHOLE_DOCUMENT||!1,Xt=Re.RETURN_DOM||!1,Ht=Re.RETURN_DOM_FRAGMENT||!1,qe=Re.RETURN_TRUSTED_TYPE||!1,rt=Re.FORCE_BODY||!1,mn=Re.SANITIZE_DOM!==!1,Dt=Re.SANITIZE_NAMED_PROPS||!1,Vi=Re.KEEP_CONTENT!==!1,ln=Re.IN_PLACE||!1,U=Re.ALLOWED_URI_REGEXP||foe,st=Re.NAMESPACE||Ae,Bt=Re.MATHML_TEXT_INTEGRATION_POINTS||Bt,Ln=Re.HTML_INTEGRATION_POINTS||Ln,$=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&Qr(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&Qr(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(me=!1),Ht&&(Xt=!0),ge&&(K=wi({},soe),ie=[],ge.html===!0&&(wi(K,roe),wi(ie,aoe)),ge.svg===!0&&(wi(K,uH),wi(ie,hH),wi(ie,S5)),ge.svgFilters===!0&&(wi(K,mH),wi(ie,hH),wi(ie,S5)),ge.mathMl===!0&&(wi(K,fH),wi(ie,coe),wi(ie,S5))),Re.ADD_TAGS&&(K===Q&&(K=jx(K)),wi(K,Re.ADD_TAGS,Li)),Re.ADD_ATTR&&(ie===j&&(ie=jx(ie)),wi(ie,Re.ADD_ATTR,Li)),Re.ADD_URI_SAFE_ATTR&&wi(Xo,Re.ADD_URI_SAFE_ATTR,Li),Re.FORBID_CONTENTS&&(Le===yn&&(Le=jx(Le)),wi(Le,Re.FORBID_CONTENTS,Li)),Vi&&(K["#text"]=!0),De&&wi(K,["html","head","body"]),K.table&&(wi(K,["tbody"]),delete ne.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw wX('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wX('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=Re.TRUSTED_TYPES_POLICY,E=R.createHTML("")}else R===void 0&&(R=fve(y,o)),R!==null&&typeof E=="string"&&(E=R.createHTML(""));zc&&zc(Re),bi=Re}},yo=wi({},[...uH,...mH,...nve]),wr=wi({},[...fH,...ive]),gp=function(Re){let It=Z(Re);(!It||!It.tagName)&&(It={namespaceURI:st,tagName:"template"});let gn=C5(Re.tagName),xr=C5(It.tagName);return $e[Re.namespaceURI]?Re.namespaceURI===_s?It.namespaceURI===Ae?gn==="svg":It.namespaceURI===Wr?gn==="svg"&&(xr==="annotation-xml"||Bt[xr]):!!yo[gn]:Re.namespaceURI===Wr?It.namespaceURI===Ae?gn==="math":It.namespaceURI===_s?gn==="math"&&Ln[xr]:!!wr[gn]:Re.namespaceURI===Ae?It.namespaceURI===_s&&!Ln[xr]||It.namespaceURI===Wr&&!Bt[xr]?!1:!wr[gn]&&(Io[gn]||!yo[gn]):!!(To==="application/xhtml+xml"&&$e[Re.namespaceURI]):!1},jr=function(Re){IX(t.removed,{element:Re});try{Z(Re).removeChild(Re)}catch{x(Re)}},du=function(Re,It){try{IX(t.removed,{attribute:It.getAttributeNode(Re),from:It})}catch{IX(t.removed,{attribute:null,from:It})}if(It.removeAttribute(Re),Re==="is")if(Xt||Ht)try{jr(It)}catch{}else try{It.setAttribute(Re,"")}catch{}},Qa=function(Re){let It=null,gn=null;if(rt)Re=""+Re;else{let Ga=ooe(Re,/^[\r\n\t ]+/);gn=Ga&&Ga[0]}To==="application/xhtml+xml"&&st===Ae&&(Re=''+Re+"");let xr=R?R.createHTML(Re):Re;if(st===Ae)try{It=new p().parseFromString(xr,To)}catch{}if(!It||!It.documentElement){It=I.createDocument(st,"template",null);try{It.documentElement.innerHTML=Qe?E:xr}catch{}}let qa=It.body||It.documentElement;return Re&&gn&&qa.insertBefore(n.createTextNode(gn),qa.childNodes[0]||null),st===Ae?F.call(It,De?"html":"body")[0]:De?It.documentElement:qa},ex=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)},aa=function(Re){return Re instanceof f&&(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")},_l=function(Re){return typeof a=="function"&&Re instanceof a};function ja(dn,Re,It){T5(dn,gn=>{gn.call(t,Re,It,bi)})}let ds=function(Re){let It=null;if(ja(b.beforeSanitizeElements,Re,null),aa(Re))return jr(Re),!0;let gn=Li(Re.nodeName);if(ja(b.uponSanitizeElement,Re,{tagName:gn,allowedTags:K}),Re.hasChildNodes()&&!_l(Re.firstElementChild)&&Hc(/<[/\w]/g,Re.innerHTML)&&Hc(/<[/\w]/g,Re.textContent)||Re.nodeType===vX.progressingInstruction||Ze&&Re.nodeType===vX.comment&&Hc(/<[/\w]/g,Re.data))return jr(Re),!0;if(!K[gn]||ne[gn]){if(!ne[gn]&&mu(gn)&&($.tagNameCheck instanceof RegExp&&Hc($.tagNameCheck,gn)||$.tagNameCheck instanceof Function&&$.tagNameCheck(gn)))return!1;if(Vi&&!Le[gn]){let xr=Z(Re)||Re.parentNode,qa=V(Re)||Re.childNodes;if(qa&&xr){let Ga=qa.length;for(let Tl=Ga-1;Tl>=0;--Tl){let $f=g(qa[Tl],!0);$f.__removalCount=(Re.__removalCount||0)+1,xr.insertBefore($f,S(Re))}}}return jr(Re),!0}return Re instanceof l&&!gp(Re)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&Hc(/<\/no(script|embed|frames)/i,Re.innerHTML)?(jr(Re),!0):(Ie&&Re.nodeType===vX.text&&(It=Re.textContent,T5([G,X,W],xr=>{It=WX(It,xr," ")}),Re.textContent!==It&&(IX(t.removed,{element:Re.cloneNode()}),Re.textContent=It)),ja(b.afterSanitizeElements,Re,null),!1)},uu=function(Re,It,gn){if(mn&&(It==="id"||It==="name")&&(gn in n||gn in sa))return!1;if(!(me&&!be[It]&&Hc(A,It))){if(!(Ce&&Hc(k,It))){if(!ie[It]||be[It]){if(!(mu(Re)&&($.tagNameCheck instanceof RegExp&&Hc($.tagNameCheck,Re)||$.tagNameCheck instanceof Function&&$.tagNameCheck(Re))&&($.attributeNameCheck instanceof RegExp&&Hc($.attributeNameCheck,It)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(It))||It==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Hc($.tagNameCheck,gn)||$.tagNameCheck instanceof Function&&$.tagNameCheck(gn))))return!1}else if(!Xo[It]){if(!Hc(U,WX(gn,O,""))){if(!((It==="src"||It==="xlink:href"||It==="href")&&Re!=="script"&&q2e(gn,"data:")===0&&bt[Re])){if(!(_e&&!Hc(B,WX(gn,O,"")))){if(gn)return!1}}}}}}return!0},mu=function(Re){return Re!=="annotation-xml"&&ooe(Re,H)},fu=function(Re){ja(b.beforeSanitizeAttributes,Re,null);let{attributes:It}=Re;if(!It||aa(Re))return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ie,forceKeepAttr:void 0},xr=It.length;for(;xr--;){let qa=It[xr],{name:Ga,namespaceURI:Tl,value:$f}=qa,JL=Li(Ga),Pc=Ga==="value"?$f:$2e($f);if(gn.attrName=JL,gn.attrValue=Pc,gn.keepAttr=!0,gn.forceKeepAttr=void 0,ja(b.uponSanitizeAttribute,Re,gn),Pc=gn.attrValue,Dt&&(JL==="id"||JL==="name")&&(du(Ga,Re),Pc=Lt+Pc),Ze&&Hc(/((--!?|])>)|<\/(style|title)/i,Pc)){du(Ga,Re);continue}if(gn.forceKeepAttr||(du(Ga,Re),!gn.keepAttr))continue;if(!Ve&&Hc(/\/>/i,Pc)){du(Ga,Re);continue}Ie&&T5([G,X,W],_q=>{Pc=WX(Pc,_q," ")});let xq=Li(Re.nodeName);if(uu(xq,JL,Pc)){if(R&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Tl)switch(y.getAttributeType(xq,JL)){case"TrustedHTML":{Pc=R.createHTML(Pc);break}case"TrustedScriptURL":{Pc=R.createScriptURL(Pc);break}}try{Tl?Re.setAttributeNS(Tl,Ga,Pc):Re.setAttribute(Ga,Pc),aa(Re)?jr(Re):ioe(t.removed)}catch{}}}ja(b.afterSanitizeAttributes,Re,null)},Ao=function dn(Re){let It=null,gn=ex(Re);for(ja(b.beforeSanitizeShadowDOM,Re,null);It=gn.nextNode();)ja(b.uponSanitizeShadowNode,It,null),ds(It),fu(It),It.content instanceof r&&dn(It.content);ja(b.afterSanitizeShadowDOM,Re,null)};return t.sanitize=function(dn){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},It=null,gn=null,xr=null,qa=null;if(Qe=!dn,Qe&&(dn=""),typeof dn!="string"&&!_l(dn))if(typeof dn.toString=="function"){if(dn=dn.toString(),typeof dn!="string")throw wX("dirty is not a string, aborting")}else throw wX("toString is not a function");if(!t.isSupported)return dn;if(Ke||xl(Re),t.removed=[],typeof dn=="string"&&(ln=!1),ln){if(dn.nodeName){let $f=Li(dn.nodeName);if(!K[$f]||ne[$f])throw wX("root node is forbidden and cannot be sanitized in-place")}}else if(dn instanceof a)It=Qa(""),gn=It.ownerDocument.importNode(dn,!0),gn.nodeType===vX.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?It=gn:It.appendChild(gn);else{if(!Xt&&!Ie&&!De&&dn.indexOf("<")===-1)return R&&qe?R.createHTML(dn):dn;if(It=Qa(dn),!It)return Xt?null:qe?E:""}It&&rt&&jr(It.firstChild);let Ga=ex(ln?dn:It);for(;xr=Ga.nextNode();)ds(xr),fu(xr),xr.content instanceof r&&Ao(xr.content);if(ln)return dn;if(Xt){if(Ht)for(qa=P.call(It.ownerDocument);It.firstChild;)qa.appendChild(It.firstChild);else qa=It;return(ie.shadowroot||ie.shadowrootmode)&&(qa=N.call(i,qa,!0)),qa}let Tl=De?It.outerHTML:It.innerHTML;return De&&K["!doctype"]&&It.ownerDocument&&It.ownerDocument.doctype&&It.ownerDocument.doctype.name&&Hc(hoe,It.ownerDocument.doctype.name)&&(Tl=" -`+Tl),Ie&&T5([G,X,W],$f=>{Tl=WX(Tl,$f," ")}),R&&qe?R.createHTML(Tl):Tl},t.setConfig=function(){let dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xl(dn),Ke=!0},t.clearConfig=function(){bi=null,Ke=!1},t.isValidAttribute=function(dn,Re,It){bi||xl({});let gn=Li(dn),xr=Li(Re);return uu(gn,xr,It)},t.addHook=function(dn,Re){typeof Re=="function"&&IX(b[dn],Re)},t.removeHook=function(dn){return ioe(b[dn])},t.removeHooks=function(dn){b[dn]=[]},t.removeAllHooks=function(){b=doe()},t}var boe=poe();var hve=0,yH={};function hh(e,t){C.typeOf.string("html",e);let n,i=e;c(yH[i])?n=yH[i]:(n=hve++,yH[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(hh.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(!c(this._element)){let e=boe.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{u[f]=void 0});for(let f=r;f0||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 c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function bve(e,t){if(Bm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),c(e._specularEnvironmentMaps)){let n=new Bm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}FX.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||c(this._previousSphericalHarmonicCoefficients)!==c(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(bve(this,t),this._specularEnvironmentCubeMapDirty=!1),c(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!c(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!c(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)};FX.prototype.isDestroyed=function(){return!1};FX.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),he(this)};var $x=FX;var $sn=_(T(),1),_H=_(cd(),1);var Bsn=_(T(),1);var xH,yoe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",V5={};V5.defaultAccessToken=yoe;V5.defaultServer=new Ge({url:"https://api.cesium.com/"});V5.getDefaultTokenCredit=function(e){if(e===yoe){if(!c(xH)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;xH=new Ct(t,!0)}return xH}};var Ym=V5;function Kc(e,t){C.defined("endpoint",e),C.defined("endpointResource",t);let n,i=e.externalType,o=c(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:yve};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new le("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ge.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new _H.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}c(Object.create)&&(Kc.prototype=Object.create(Ge.prototype),Kc.prototype.constructor=Kc);Kc.fromAssetId=function(e,t){let n=Kc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Kc(i,n)})};Object.defineProperties(Kc.prototype,{credits:{get:function(){return c(this._ionRoot)?this._ionRoot.credits:c(this._credits)?this._credits:(this._credits=Kc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Kc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Ct.getIonCredit),i=Ym.getDefaultTokenCredit(t.queryParameters.access_token);return c(i)&&n.push(Ct.clone(i)),n};Kc.prototype.clone=function(e){let t=this._ionRoot??this;return c(e)||(e=new Kc(t._ionEndpoint,t._ionEndpointResource)),e=Ge.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Kc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},c(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ge.prototype.fetchImage.call(this,e)};Kc.prototype._makeRequest=function(e){return this._isExternal||new _H.default(this.url).authority()!==this._ionEndpointDomain?Ge.prototype._makeRequest.call(this,e):(c(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),Ge.prototype._makeRequest.call(this,e))};Kc._createEndpointResource=function(e,t){C.defined("assetId",e),t=t??z.EMPTY_OBJECT;let n=t.server??Ym.defaultServer,i=t.accessToken??Ym.defaultAccessToken;n=Ge.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return c(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function yve(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!c(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(c(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 xd=Kc;var nan=_(T(),1);function ph(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(ph.prototype,{length:{get:function(){return this._length},set:function(e){C.typeOf.number.greaterThanOrEquals("length",e,0);let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});ph.prototype.get=function(e){return C.typeOf.number.lessThan("index",e,this._array.length),this._array[e]};ph.prototype.set=function(e,t){C.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t};ph.prototype.peek=function(){return this._array[this._length-1]};ph.prototype.push=function(e){let t=this.length++;this._array[t]=e};ph.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};ph.prototype.reserve=function(e){C.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)};ph.prototype.resize=function(e){C.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e};ph.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Jc=ph;var aan=_(T(),1);var Yp={X:0,Y:1,Z:2};Yp.Y_UP_TO_Z_UP=M.fromRotationTranslation(te.fromArray([1,0,0,0,0,1,0,-1,0]));Yp.Z_UP_TO_Y_UP=M.fromRotationTranslation(te.fromArray([1,0,0,0,0,-1,0,1,0]));Yp.X_UP_TO_Z_UP=M.fromRotationTranslation(te.fromArray([0,0,1,0,1,0,-1,0,0]));Yp.Z_UP_TO_X_UP=M.fromRotationTranslation(te.fromArray([0,0,-1,0,1,0,1,0,0]));Yp.X_UP_TO_Y_UP=M.fromRotationTranslation(te.fromArray([0,1,0,-1,0,0,0,0,1]));Yp.Y_UP_TO_X_UP=M.fromRotationTranslation(te.fromArray([0,-1,0,1,0,0,0,0,1]));Yp.fromName=function(e){return C.typeOf.string("name",e),Yp[e]};var Po=Object.freeze(Yp);var oJn=_(T(),1);var uan=_(T(),1);function goe(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties(goe.prototype,{metadata:{get:function(){return this._metadata}}});var e_=goe;var S3n=_(T(),1);var Zan=_(T(),1);var xan=_(T(),1);var ban=_(T(),1);function ty(e,t,n){if(!c(e))throw new L("uint8Array is required.");if(t<0)throw new L("byteOffset cannot be negative.");if(n<0)throw new L("byteLength cannot be negative.");if(t+n>e.byteLength)throw new L("sub-region exceeds array bounds.");return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),ty.decode(e)}ty.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};ty.decodeWithFromCharCode=function(e){let t="",n=gve(e),i=n.length;for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function AX(e,t,n){return t<=e&&e<=n}function gve(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let l=0;l0){let o=Math.min(t,mt.maximumTextureSize),r=Math.ceil(t/mt.maximumTextureSize),s=1/o,a=s*.5,l=1/r,d=l*.5;n=new D(o,r),i=new ce(s,a,l,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(mc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return c(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),c(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}}});mc.DEFAULT_COLOR_VALUE=Y.WHITE;mc.DEFAULT_SHOW_VALUE=!0;function xoe(e){let t=e._textureDimensions;return t.x*t.y*4}function _oe(e){if(!c(e._batchValues)){let t=xoe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Toe(e){if(!c(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function kX(e,t){if(!c(e)||e<0||e>=t)throw new L(`batchId is required and between zero and featuresLength - 1 (${t}`-+").")}mc.prototype.setShow=function(e,t){if(kX(e,this._featuresLength),C.typeOf.bool("show",t),t&&!c(this._showAlphaProperties))return;let n=Toe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=_oe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};mc.prototype.setAllShow=function(e){C.typeOf.bool("show",e);let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=xoe(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l=a)throw new L(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new L("Circular dependency detected in the batch table hierarchy.");n.push(t);let l=c(i)?i[t]:1,d=c(i)?r[t]:t;for(let u=0;u0;){if(t=u.pop(),l[t]===d)continue;l[t]=d;let f=n(e,t);if(c(f))return f;let p=o[t],y=s[t];for(let h=0;h=t)throw new L(`batchId is required and must be between zero and featuresLength - 1 (${t}`-+").")}_o.prototype.isClass=function(e,t){VC(e,this.featuresLength),C.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};_o.prototype.isExactClass=function(e,t){return C.typeOf.string("className",t),this.getExactClassName(e)===t};_o.prototype.getExactClassName=function(e){VC(e,this.featuresLength);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};_o.prototype.hasProperty=function(e,t){return VC(e,this.featuresLength),C.typeOf.string("name",t),c(this._properties[t])||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};_o.prototype.hasPropertyBySemantic=function(){return!1};_o.prototype.getPropertyIds=function(e,t){VC(e,this.featuresLength),t=c(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};_o.prototype.getPropertyBySemantic=function(e,t){};_o.prototype.getProperty=function(e,t){if(VC(e,this.featuresLength),C.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(c(i))return Bve(i,e)}let n=this._properties[t];if(c(n))return He(n[e],!0);if(c(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(c(i))return i}};_o.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(VC(e,i),C.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(c(r)){Yve(r,e,n);return}}if(c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];c(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=He(n,!0)};function Hve(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +`;var QBe=`#define CLIP_POLYLINE +${wl} +${$v}`,qBe=__;function S_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=S_.VERTEX_FORMAT;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??QBe,this._fragmentShaderSource=e.fragmentShaderSource??qBe,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(S_.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}}});S_.VERTEX_FORMAT=we.POSITION_AND_ST;S_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;S_.prototype.isTranslucent=Go.prototype.isTranslucent;S_.prototype.getRenderState=Go.prototype.getRenderState;var sc=S_;function pb(e){e=e??B.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new sc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=ofe(!1),this._renderState3DTiles=ofe(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},depthTest:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(pb.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}}});pb.initializeTerrainHeights=function(){return Pi.initialize()};function $Be(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(Qv);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(jv);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Kv),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",m="";l(n.material)?(m=l(n.material)?n.material.shaderSource:"",m.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),m.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],b=new Je({defines:d,sources:[s]}),f=new Je({defines:p,sources:[m,c]});e._sp=nn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:b,fragmentShaderSource:f,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let S=new Je({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:S,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=y;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let S=new Je({defines:d.concat([`MAX_TERRAIN_HEIGHT ${Pi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(Jv);let Z=new Je({defines:p,sources:[m,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:S,fragmentShaderSource:Z,attributeLocations:r})}e._spMorph=_}function ofe(e){return ze.fromCache({cull:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function e3e(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof Ms?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let m=0;m{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};pb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};pb.isSupported=function(e){return e.frameState.context.depthTexture};pb.prototype.isDestroyed=function(){return!1};pb.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 Oh=pb;var Hgn=x(T(),1);var Mgn=x(T(),1);var Fgn=x(T(),1);var n3e=new k(1,1),i3e=!1,o3e=U.WHITE;function T1(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(T1.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:be("image"),repeat:be("repeat"),color:be("color"),transparent:be("transparent")});T1.prototype.getType=function(e){return"Image"};var r3e=new Q;T1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(r3e)),l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,n3e,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,o3e,t.color),j.getValueOrDefault(this._transparent,e,i3e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};T1.prototype.equals=function(e){return this===e||e instanceof T1&&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 Ny=T1;function s3e(e){if(e instanceof U)return new Qt(e);if(typeof e=="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Ny;return t.image=e,t}}function a3e(e,t){return be(e,t,s3e)}var sr=a3e;function e2(e){this._definitionChanged=new Se,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(e??B.EMPTY_OBJECT)}Object.defineProperties(e2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),dimensions:be("dimensions"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});e2.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 e2(this)};e2.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Z_=e2;var uyn=x(T(),1);var Jgn=x(T(),1),sfe={FIXED:0,INERTIAL:1};Object.freeze(sfe);var Oi=sfe;var iyn=x(T(),1);function _1(){ge.throwInstantiationError()}Object.defineProperties(_1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError},referenceFrame:{get:ge.throwInstantiationError}});_1.prototype.getValue=ge.throwInstantiationError;_1.prototype.getValueInReferenceFrame=ge.throwInstantiationError;_1.prototype.equals=ge.throwInstantiationError;var afe=new q;_1.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=_t.computeIcrfToCentralBodyFixedMatrix(e,afe);if(n===Oi.INERTIAL)return q.multiplyByVector(r,t,o);if(n===Oi.FIXED)return q.multiplyByVector(q.transpose(r,afe),t,o)};var Bh=_1;function R_(e,t){this._definitionChanged=new Se,this._value=h.clone(e),this._referenceFrame=t??Oi.FIXED}Object.defineProperties(R_.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Oi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var c3e=new Q;R_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(c3e)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};R_.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.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 Bh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};R_.prototype.equals=function(e){return this===e||e instanceof R_&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Ml=R_;var yyn=x(T(),1);function t2(e){this._definitionChanged=new Se,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(e??B.EMPTY_OBJECT)}Object.defineProperties(t2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),positions:be("positions"),width:be("width"),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),cornerType:be("cornerType"),granularity:be("granularity"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});t2.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 t2(this)};t2.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var C_=t2;var _yn=x(T(),1);function l3e(e){return e}function d3e(e,t){return be(e,t,l3e)}var kl=d3e;var Ayn=x(T(),1);function n2(e){this._definitionChanged=new Se,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(e??B.EMPTY_OBJECT)}Object.defineProperties(n2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),length:be("length"),topRadius:be("topRadius"),bottomRadius:be("bottomRadius"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),slices:be("slices"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});n2.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 n2(this)};n2.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var V_=n2;var Pyn=x(T(),1);function i2(e){this._definitionChanged=new Se,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(e??B.EMPTY_OBJECT)}Object.defineProperties(i2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),semiMajorAxis:be("semiMajorAxis"),semiMinorAxis:be("semiMinorAxis"),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),rotation:be("rotation"),stRotation:be("stRotation"),granularity:be("granularity"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});i2.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 i2(this)};i2.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var E_=i2;var Uyn=x(T(),1);function o2(e){this._definitionChanged=new Se,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(e??B.EMPTY_OBJECT)}Object.defineProperties(o2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),radii:be("radii"),innerRadii:be("innerRadii"),minimumClock:be("minimumClock"),maximumClock:be("maximumClock"),minimumCone:be("minimumCone"),maximumCone:be("maximumCone"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),stackPartitions:be("stackPartitions"),slicePartitions:be("slicePartitions"),subdivisions:be("subdivisions"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});o2.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 o2(this)};o2.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var A_=o2;var Kyn=x(T(),1);function r2(e){this._definitionChanged=new Se,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(e??B.EMPTY_OBJECT)}Object.defineProperties(r2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),text:be("text"),font:be("font"),style:be("style"),scale:be("scale"),showBackground:be("showBackground"),backgroundColor:be("backgroundColor"),backgroundPadding:be("backgroundPadding"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),fillColor:be("fillColor"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),scaleByDistance:be("scaleByDistance"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance")});r2.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 r2(this)};r2.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var zh=r2;var Rxn=x(T(),1);var cxn=x(T(),1);var $yn=x(T(),1);var u3e=new h(1,1,1),m3e=h.ZERO,h3e=Ne.IDENTITY;function cfe(e,t,n){this.translation=h.clone(e??m3e),this.rotation=Ne.clone(t??h3e),this.scale=h.clone(n??u3e)}cfe.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Ne.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Yy=cfe;var FQ=new Yy;function s2(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(s2.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:be("translation"),rotation:be("rotation"),scale:be("scale")});var f3e=new Q;s2.prototype.getValue=function(e,t){return l(e)||(e=Q.now(f3e)),l(t)||(t=new Yy),t.translation=j.getValueOrClonedDefault(this._translation,e,FQ.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,FQ.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,FQ.scale,t.scale),t};s2.prototype.equals=function(e){return this===e||e instanceof s2&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var G_=s2;var bxn=x(T(),1);function bb(e,t){this._propertyNames=[],this._definitionChanged=new Se,l(e)&&this.merge(e,t)}Object.defineProperties(bb.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var P3e=new Q;Z1.prototype.getValue=function(e,t){l(e)||(e=Q.now(P3e));let n=j.getValueOrDefault(this._heightReference,e,He.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,He.NONE);if(n===He.NONE&&!Ly(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==He.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,hfe);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,W.EPSILON10)&&n!==He.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===He.CLIP_TO_GROUND){let c=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};Z1.prototype.isDestroyed=function(){return!1};Z1.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var F_=Z1;function X3e(e,t,n,i){if(Wi.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 Jh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new F_(this._scene,s,r)}}var Tb=X3e;var ffe=h.ZERO,pfe=new h,N3e=new h,bfe=new U;function Y3e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Su(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new Y3e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Su.prototype=Object.create(Wi.prototype),Su.prototype.constructor=Su);Object.defineProperties(Su.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Su.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Qn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,bfe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,ffe,pfe))),new Yt({id:t,geometry:Vc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Su.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,bfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,ffe,pfe))),new Yt({id:t,geometry:Yh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Su.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Su.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Wi.prototype._isHidden.call(this,e,t)};Su.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};Su.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(it.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};Su.prototype._onEntityPropertyChanged=Tb;Su.DynamicGeometryUpdater=R1;function R1(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(R1.prototype=Object.create(Li.prototype),R1.prototype.constructor=R1);R1.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,N3e),o=this._options.dimensions;return!l(i)||!l(o)||Li.prototype._isHidden.call(this,e,t,n)};R1.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,He.NONE),o=this._options;o.dimensions=j.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==He.NONE?bn.ALL:void 0};var y2=Su;var PSn=x(T(),1);function I_(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Oi.FIXED,this._definitionChanged=new Se,this.setCallback(e,t)}Object.defineProperties(I_.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var w3e=new Q;I_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(w3e)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};I_.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};I_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Bh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};I_.prototype.equals=function(e){return this===e||e instanceof I_&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var x2=I_;var HRi=x(T(),1);var XRi=x(T(),1);var kSn=x(T(),1);var NSn=x(T(),1);/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function gfe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n2?i-2:0),r=2;r1?n-1:0),o=1;o"u"?null:fa(BigInt.prototype.toString),Zfe=typeof Symbol>"u"?null:fa(Symbol.prototype.toString),Ld=fa(Object.prototype.hasOwnProperty),S2=fa(Object.prototype.toString),$c=fa(RegExp.prototype.test),P_=$3e(TypeError);function fa(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Z2;if(yfe&&yfe(e,null),!V1(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(B3e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function eze(e){for(let t=0;t/g),aze=ac(/\${[\w\W]*/g),cze=ac(/^data-[\-\w.\u00B7-\uFFFF]+$/),lze=ac(/^aria-[\-\w]+$/),Afe=ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dze=ac(/^(?:\w+script|data):/i),uze=ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mze=ac(/^html$/i),hze=ac(/^[a-z][.\w]*(-[.\w]+)+$/i),Gfe=ac(/<[/\w!]/g),Lfe=ac(/<[/\w]/g),fze=ac(/<\/no(script|embed|frames)/i),pze=ac(/\/>/i),Zu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ife=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],bze=Xa(Lo({},Ife)),gze=(function(){let e={};return X_(Ife,t=>{e[t]=ac(new RegExp("])","i"))}),Xa(e)})(),yze=function(){return typeof window>"u"?null:window},xze=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}},Wfe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},wy=function(t,n,i,o){return Ld(t,n)&&V1(t[n])?Lo(o.base?Ru(o.base):{},t[n],o.transform):i},kQ=function(t,n,i){let o=Ld(t,n)?t[n]:void 0;return o&&typeof o=="object"?Ru(o):i()};function Pfe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yze(),t=Vt=>Pfe(Vt);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Zu.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,o=i.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,d=e.NamedNodeMap;d===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,m=e.trustedTypes,p=a.prototype,b=jh(p,"cloneNode"),f=jh(p,"remove"),y=jh(p,"nextSibling"),_=jh(p,"childNodes"),S=jh(p,"parentNode"),Z=jh(p,"shadowRoot"),R=jh(p,"attributes"),C=s&&s.prototype?jh(s.prototype,"nodeType"):null,E=s&&s.prototype?jh(s.prototype,"nodeName"):null,A=s&&s.prototype?jh(s.prototype,"ownerDocument"):null,L=function(Te){return C?C(Te):Te.nodeType},F=function(Te){return E?E(Te):Te.nodeName};if(typeof r=="function"){let Vt=n.createElement("template");Vt.content&&Vt.content.ownerDocument&&(n=Vt.content.ownerDocument)}let I,N="",g,V=!1,G=0,v=function(){if(G>0)throw P_('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},X=function(Te){v(),G++;try{return I.createHTML(Te)}finally{G--}},Y=function(Te){v(),G++;try{return I.createScriptURL(Te)}finally{G--}},D=function(){return V||(g=xze(m,o),V=!0),g},w=n,O=w.implementation,M=w.createNodeIterator,z=w.createDocumentFragment,K=w.getElementsByTagName,te=i.importNode,H=Wfe();t.isSupported=typeof vfe=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;let $=rze,ee=sze,le=aze,_e=cze,he=lze,Ze=dze,ye=uze,Ge=hze,Ae=Afe,Fe=null,tt=Lo({},[...Rfe,...NQ,...YQ,...wQ,...Cfe]),Be=null,je=Lo({},[...Vfe,...MQ,...Efe,...iO]),qe=Object.seal(C1(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}})),We=null,Ke=null,ct=Object.seal(C1(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Et=!0,zt=!0,ut=!1,bt=!0,ht=!1,jt=!0,st=!1,pt=!1,wi=null,jn=null,_i=!1,Hi=!1,Gi=!1,fi=!1,Si=!0,On=!1,rn="user-content-",Hn=!0,$i=!1,Po={},hr=null,Is=Lo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Hs=null,or=Lo({},["audio","video","img","source","image","track"]),bi=null,fr=Lo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mo="http://www.w3.org/1998/Math/MathML",Qr="http://www.w3.org/2000/svg",wn="http://www.w3.org/1999/xhtml",Ki=wn,Mi=!1,Xo=null,Dc=Lo({},[mo,Qr,wn],XQ),bm=Xa(["mi","mo","mn","ms","mtext"]),bp=Lo({},bm),Lh=Xa(["annotation-xml"]),ua=Lo({},Lh),gp=Lo({},["title","style","font","a","script"]),Ps=null,$a=["application/xhtml+xml","text/html"],DT="text/html",si=null,qo=null,Gl=n.createElement("form"),K0=function(Te){return Te instanceof RegExp||Te instanceof Function},va=function(){let Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qo&&qo===Te)return;(!Te||typeof Te!="object")&&(Te={}),Te=Ru(Te),Ps=$a.indexOf(Te.PARSER_MEDIA_TYPE)===-1?DT:Te.PARSER_MEDIA_TYPE,si=Ps==="application/xhtml+xml"?XQ:Z2,Fe=wy(Te,"ALLOWED_TAGS",tt,{transform:si}),Be=wy(Te,"ALLOWED_ATTR",je,{transform:si}),Xo=wy(Te,"ALLOWED_NAMESPACES",Dc,{transform:XQ}),bi=wy(Te,"ADD_URI_SAFE_ATTR",fr,{transform:si,base:fr}),Hs=wy(Te,"ADD_DATA_URI_TAGS",or,{transform:si,base:or}),hr=wy(Te,"FORBID_CONTENTS",Is,{transform:si}),We=wy(Te,"FORBID_TAGS",Ru({}),{transform:si}),Ke=wy(Te,"FORBID_ATTR",Ru({}),{transform:si}),Po=Ld(Te,"USE_PROFILES")?Te.USE_PROFILES&&typeof Te.USE_PROFILES=="object"?Ru(Te.USE_PROFILES):Te.USE_PROFILES:!1,Et=Te.ALLOW_ARIA_ATTR!==!1,zt=Te.ALLOW_DATA_ATTR!==!1,ut=Te.ALLOW_UNKNOWN_PROTOCOLS||!1,bt=Te.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=Te.SAFE_FOR_TEMPLATES||!1,jt=Te.SAFE_FOR_XML!==!1,st=Te.WHOLE_DOCUMENT||!1,Hi=Te.RETURN_DOM||!1,Gi=Te.RETURN_DOM_FRAGMENT||!1,fi=Te.RETURN_TRUSTED_TYPE||!1,_i=Te.FORCE_BODY||!1,Si=Te.SANITIZE_DOM!==!1,On=Te.SANITIZE_NAMED_PROPS||!1,Hn=Te.KEEP_CONTENT!==!1,$i=Te.IN_PLACE||!1,Ae=nze(Te.ALLOWED_URI_REGEXP)?Te.ALLOWED_URI_REGEXP:Afe,Ki=typeof Te.NAMESPACE=="string"?Te.NAMESPACE:wn,bp=kQ(Te,"MATHML_TEXT_INTEGRATION_POINTS",()=>Lo({},bm)),ua=kQ(Te,"HTML_INTEGRATION_POINTS",()=>Lo({},Lh));let Ye=kQ(Te,"CUSTOM_ELEMENT_HANDLING",()=>C1(null));if(qe=C1(null),Ld(Ye,"tagNameCheck")&&K0(Ye.tagNameCheck)&&(qe.tagNameCheck=Ye.tagNameCheck),Ld(Ye,"attributeNameCheck")&&K0(Ye.attributeNameCheck)&&(qe.attributeNameCheck=Ye.attributeNameCheck),Ld(Ye,"allowCustomizedBuiltInElements")&&typeof Ye.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=Ye.allowCustomizedBuiltInElements),ac(qe),ht&&(zt=!1),Gi&&(Hi=!0),Po&&(Fe=Lo({},Cfe),Be=C1(null),Po.html===!0&&(Lo(Fe,Rfe),Lo(Be,Vfe)),Po.svg===!0&&(Lo(Fe,NQ),Lo(Be,MQ),Lo(Be,iO)),Po.svgFilters===!0&&(Lo(Fe,YQ),Lo(Be,MQ),Lo(Be,iO)),Po.mathMl===!0&&(Lo(Fe,wQ),Lo(Be,Efe),Lo(Be,iO))),ct.tagCheck=null,ct.attributeCheck=null,Ld(Te,"ADD_TAGS")&&(typeof Te.ADD_TAGS=="function"?ct.tagCheck=Te.ADD_TAGS:V1(Te.ADD_TAGS)&&(Fe===tt&&(Fe=Ru(Fe)),Lo(Fe,Te.ADD_TAGS,si))),Ld(Te,"ADD_ATTR")&&(typeof Te.ADD_ATTR=="function"?ct.attributeCheck=Te.ADD_ATTR:V1(Te.ADD_ATTR)&&(Be===je&&(Be=Ru(Be)),Lo(Be,Te.ADD_ATTR,si))),Ld(Te,"ADD_FORBID_CONTENTS")&&V1(Te.ADD_FORBID_CONTENTS)&&(hr===Is&&(hr=Ru(hr)),Lo(hr,Te.ADD_FORBID_CONTENTS,si)),Hn&&(Fe["#text"]=!0),st&&Lo(Fe,["html","head","body"]),Fe.table&&(Lo(Fe,["tbody"]),delete We.tbody),Te.TRUSTED_TYPES_POLICY){if(typeof Te.TRUSTED_TYPES_POLICY.createHTML!="function")throw P_('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw P_('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let yt=I;I=Te.TRUSTED_TYPES_POLICY;try{N=X("")}catch(an){throw I=yt,an}}else Te.TRUSTED_TYPES_POLICY===null?(I=void 0,N=""):(I===void 0&&(I=D()),I&&typeof N=="string"&&(N=X("")));Xa&&Xa(Te),qo=Te},yp=Lo({},[...NQ,...YQ,...ize]),xy=Lo({},[...wQ,...oze]),QJ=function(Te,Ye,yt){return Ye.namespaceURI===wn?Te==="svg":Ye.namespaceURI===mo?Te==="svg"&&(yt==="annotation-xml"||bp[yt]):!!yp[Te]},qJ=function(Te,Ye,yt){return Ye.namespaceURI===wn?Te==="math":Ye.namespaceURI===Qr?Te==="math"&&ua[yt]:!!xy[Te]},$J=function(Te,Ye,yt){return Ye.namespaceURI===Qr&&!ua[yt]||Ye.namespaceURI===mo&&!bp[yt]?!1:!xy[Te]&&(gp[Te]||!yp[Te])},ej=function(Te){let Ye=S(Te);(!Ye||!Ye.tagName)&&(Ye={namespaceURI:Ki,tagName:"template"});let yt=Z2(Te.tagName),an=Z2(Ye.tagName);return Xo[Te.namespaceURI]?Te.namespaceURI===Qr?QJ(yt,Ye,an):Te.namespaceURI===mo?qJ(yt,Ye,an):Te.namespaceURI===wn?$J(yt,Ye,an):!!(Ps==="application/xhtml+xml"&&Xo[Te.namespaceURI]):!1},xp=function(Te){T2(t.removed,{element:Te});try{S(Te).removeChild(Te)}catch{if(f(Te),!S(Te))throw P_("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},UR=function(Te,Ye,yt){try{Te.removeAttributeNode(Ye)}catch{try{Te.removeAttribute(yt)}catch{}}},OT=function(Te){BT(Te);let Ye=_(Te);if(Ye){let an=[];X_(Ye,Ln=>{T2(an,Ln)}),X_(an,Ln=>{try{f(Ln)}catch{}})}let yt=R(Te);if(yt)for(let an=yt.length-1;an>=0;--an){let Ln=yt[an],ai=Ln&&Ln.name;typeof ai=="string"&&UR(Te,Ln,ai)}},Wh=function(Te,Ye,yt){if(!yt)try{yt=Ye.getAttributeNode(Te)}catch{yt=null}T2(t.removed,{attribute:yt||null,from:Ye});try{yt?Ye.removeAttributeNode(yt):Ye.removeAttribute(Te)}catch{try{Ye.removeAttribute(Te)}catch{}}if(Te==="is")if(Hi||Gi)try{xp(Ye)}catch{}else try{Ye.setAttribute(Te,"")}catch{}},tj=function(Te){let Ye=R(Te);if(Ye)for(let yt=Ye.length-1;yt>=0;--yt){let an=Ye[yt],Ln=an&&an.name;typeof Ln!="string"||Be[si(Ln)]||UR(Te,an,Ln)}},BT=function(Te){let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop();L(yt)===Zu.element&&tj(yt);let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},DR=function(Te,Ye){return jt?Te==="patchsrc"?!0:Te==="for"&&Ye!=="label"&&Ye!=="output":!1},Tp=function(Te){if(!jt)return;let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop(),an=L(yt);if(an===Zu.processingInstruction||an===Zu.comment&&$c(Lfe,yt.data)){try{f(yt)}catch{}continue}if(an===Zu.element){let ai=yt,Er=si(F(yt));try{ai.hasAttribute&&ai.hasAttribute("patchsrc")&&ai.removeAttribute("patchsrc"),ai.hasAttribute&&ai.hasAttribute("for")&&DR("for",Er)&&ai.removeAttribute("for")}catch{}}let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},zT=function(Te){let Ye=null,yt=null;if(_i)Te=""+Te;else{let ai=Tfe(Te,/^[\r\n\t ]+/);yt=ai&&ai[0]}Ps==="application/xhtml+xml"&&Ki===wn&&(Te=''+Te+"");let an=I?X(Te):Te;if(Ki===wn)try{Ye=new u().parseFromString(an,Ps)}catch{}if(!Ye||!Ye.documentElement){Ye=O.createDocument(Ki,"template",null);try{Ye.documentElement.innerHTML=Mi?N:an}catch{}}let Ln=Ye.body||Ye.documentElement;return Te&&yt&&Ln.insertBefore(n.createTextNode(yt),Ln.childNodes[0]||null),Ki===wn?K.call(Ye,st?"html":"body")[0]:st?Ye.documentElement:Ln},MA=function(Te){let Ye=A?A(Te):Te.ownerDocument;return M.call(Ye||Te,Te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},OR=function(Te){return Te=_2(Te,$," "),Te=_2(Te,ee," "),Te=_2(Te,le," "),Te},Ty=function(Te){var Ye;Te.normalize();let yt=A?A(Te):Te.ownerDocument,an=M.call(yt||Te,Te,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Ln=an.nextNode();for(;Ln;)Ln.data=OR(Ln.data),Ln=an.nextNode();let ai=(Ye=Te.querySelectorAll)===null||Ye===void 0?void 0:Ye.call(Te,"template");ai&&X_(ai,Er=>{oe(Er.content)&&Ty(Er.content)})},ue=function(Te){let Ye=E?E(Te):null;return typeof Ye!="string"||si(Ye)!=="form"?!1:typeof Te.nodeName!="string"||typeof Te.textContent!="string"||typeof Te.removeChild!="function"||Te.attributes!==R(Te)||typeof Te.removeAttribute!="function"||typeof Te.setAttribute!="function"||typeof Te.namespaceURI!="string"||typeof Te.insertBefore!="function"||typeof Te.hasChildNodes!="function"||Te.nodeType!==C(Te)||Te.childNodes!==_(Te)},oe=function(Te){if(!C||typeof Te!="object"||Te===null)return!1;try{return C(Te)===Zu.documentFragment}catch{return!1}},Re=function(Te){if(!C||typeof Te!="object"||Te===null)return!1;try{return typeof C(Te)=="number"}catch{return!1}};function Ve(Vt,Te,Ye){Vt.length!==0&&X_(Vt,yt=>{yt.call(t,Te,Ye,qo)})}let et=function(Te,Ye){return!!(jt&&Te.hasChildNodes()&&!Re(Te.firstElementChild)&&$c(Gfe,Te.textContent)&&$c(Gfe,Te.innerHTML)||jt&&Te.namespaceURI===wn&&bze[Ye]&&(Re(Te.firstElementChild)||typeof Te.textContent=="string"&&$c(gze[Ye],Te.textContent))||Te.nodeType===Zu.processingInstruction||jt&&Te.nodeType===Zu.comment&&$c(Lfe,Te.data))},Ct=function(Te,Ye){if(Te instanceof RegExp)return $c(Te,Ye);if(Te instanceof Function){for(var yt=arguments.length,an=new Array(yt>2?yt-2:0),Ln=2;Ln=0;--Er){let ds=Te===yt?b(Ln[Er],!0):Ln[Er];an.insertBefore(ds,y(Te))}}}return xp(Te),!0},Gt=function(Te,Ye,yt,an){return Te.length===0?Ye:Ye===yt||Ye===an?Ru(Ye):Ye},Sn=function(Te,Ye){return Te===Ye||S(Te)!==null?!1:($i&&BT(Te),!0)},Kn=function(Te,Ye){if(Ve(H.beforeSanitizeElements,Te,null),Sn(Te,Ye))return!0;if(ue(Te))return xp(Te),!0;let yt=si(F(Te));if(Fe=Gt(H.uponSanitizeElement,Fe,tt,wi),Ve(H.uponSanitizeElement,Te,{tagName:yt,allowedTags:Fe}),Sn(Te,Ye))return!0;if(et(Te,yt))return xp(Te),!0;if(We[yt]||!(ct.tagCheck instanceof Function&&ct.tagCheck(yt))&&!Fe[yt]){let Ln=gt(Te,yt,Ye);return Ln===!1&&Ve(H.afterSanitizeElements,Te,null),Ln}if(L(Te)===Zu.element&&!ej(Te)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&&$c(fze,Te.innerHTML))return xp(Te),!0;if(ht&&Te.nodeType===Zu.text){let Ln=OR(Te.textContent);Te.textContent!==Ln&&(T2(t.removed,{element:Te.cloneNode()}),Te.textContent=Ln)}return Ve(H.afterSanitizeElements,Te,null),!1},xn=function(Te,Ye,yt){if(Ke[Ye]||DR(Ye,Te)||Si&&(Ye==="id"||Ye==="name")&&(yt in n||yt in Gl))return!1;let an=Be[Ye]||ct.attributeCheck instanceof Function&&ct.attributeCheck(Ye,Te);return zt&&$c(_e,Ye)||Et&&$c(he,Ye)?!0:an?bi[Ye]||$c(Ae,_2(yt,ye,""))||(Ye==="src"||Ye==="xlink:href"||Ye==="href")&&Te!=="script"&&_fe(yt,"data:")===0&&Hs[Te]||ut&&!$c(Ze,_2(yt,ye,""))?!0:!yt:pr(Te)&&Ct(qe.tagNameCheck,Te)&&Ct(qe.attributeNameCheck,Ye,Te)||Ye==="is"&&qe.allowCustomizedBuiltInElements&&Ct(qe.tagNameCheck,yt)},Vr=Lo({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pr=function(Te){return!Vr[Z2(Te)]&&$c(Ge,Te)},Ks=function(Te,Ye,yt,an){if(I&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!yt)switch(m.getAttributeType(Te,Ye)){case"TrustedHTML":return X(an);case"TrustedScriptURL":return Y(an)}return an},Rc=function(Te,Ye,yt,an){try{yt?Te.setAttributeNS(yt,Ye,an):Te.setAttribute(Ye,an),ue(Te)?xp(Te):xfe(t.removed)}catch{Wh(Ye,Te)}},Ll=function(Te){Ve(H.beforeSanitizeAttributes,Te,null);let Ye=Te.attributes;if(!Ye||ue(Te))return;Be=Gt(H.uponSanitizeAttribute,Be,je,jn);let yt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Be,forceKeepAttr:void 0},an=Ye.length,Ln=si(Te.nodeName);for(;an--;){let ai=Ye[an],Er=ai.name,ds=ai.namespaceURI,_d=ai.value,Sd=si(Er),nj=_d,Wl=Er==="value"?nj:j3e(nj);if(yt.attrName=Sd,yt.attrValue=Wl,yt.keepAttr=!0,yt.forceKeepAttr=void 0,Ve(H.uponSanitizeAttribute,Te,yt),Wl=yt.attrValue,On&&(Sd==="id"||Sd==="name")&&_fe(Wl,rn)!==0&&(Wh(Er,Te,ai),Wl=rn+Wl),jt&&$c(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wl)){Wh(Er,Te,ai);continue}if(Sd==="attributename"&&Tfe(Wl,"href")){Wh(Er,Te,ai);continue}if(!yt.forceKeepAttr){if(!yt.keepAttr){Wh(Er,Te,ai);continue}if(!bt&&$c(pze,Wl)){Wh(Er,Te,ai);continue}if(ht&&(Wl=OR(Wl)),!xn(Ln,Sd,Wl)){Wh(Er,Te,ai);continue}Wl=Ks(Ln,Sd,ds,Wl),Wl!==nj&&Rc(Te,Er,ds,Wl)}}Ve(H.afterSanitizeAttributes,Te,null)},Td=function(Te){let Ye=null,yt=MA(Te);for(Ve(H.beforeSanitizeShadowDOM,Te,null);Ye=yt.nextNode();)if(Ve(H.uponSanitizeShadowNode,Ye,null),Kn(Ye,Te),Ll(Ye),oe(Ye.content)&&Td(Ye.content),L(Ye)===Zu.element){let an=Z(Ye);oe(an)&&(J0(an),Td(an))}Ve(H.afterSanitizeShadowDOM,Te,null)},J0=function(Te){let Ye=[{node:Te,shadow:null}];for(;Ye.length>0;){let yt=Ye.pop();if(yt.shadow){Td(yt.shadow);continue}let an=yt.node,ai=L(an)===Zu.element,Er=_(an);if(Er)for(let ds=Er.length-1;ds>=0;--ds)Ye.push({node:Er[ds],shadow:null});if(ai){let ds=E?E(an):null;if(typeof ds=="string"&&si(ds)==="template"){let _d=an.content;oe(_d)&&Ye.push({node:_d,shadow:null})}}if(ai){let ds=Z(an);oe(ds)&&Ye.push({node:null,shadow:ds},{node:ds,shadow:null})}}};return t.sanitize=function(Vt){let Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=null,yt=null,an=null,Ln=null;if(Mi=!Vt,Mi&&(Vt=""),typeof Vt!="string"&&!Re(Vt)&&(Vt=tze(Vt),typeof Vt!="string"))throw P_("dirty is not a string, aborting");if(!t.isSupported)return Vt;pt?(Fe=wi,Be=jn):va(Te),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(Fe=Ru(Fe)),H.uponSanitizeAttribute.length>0&&(Be=Ru(Be)),t.removed=[];let ai=$i&&typeof Vt!="string"&&Re(Vt);if(ai){Tp(Vt);let _d=F(Vt);if(typeof _d=="string"){let Sd=si(_d);if(!Fe[Sd]||We[Sd])throw OT(Vt),P_("root node is forbidden and cannot be sanitized in-place")}if(ue(Vt))throw OT(Vt),P_("root node is clobbered and cannot be sanitized in-place");try{J0(Vt)}catch(Sd){throw OT(Vt),Sd}}else if(Re(Vt))Ye=zT(""),yt=Ye.ownerDocument.importNode(Vt,!0),yt.nodeType===Zu.element&&yt.nodeName==="BODY"||yt.nodeName==="HTML"?Ye=yt:Ye.appendChild(yt),J0(yt);else{if(!Hi&&!ht&&!st&&Vt.indexOf("<")===-1)return I&&fi?X(Vt):Vt;if(Ye=zT(Vt),!Ye)return Hi?null:fi?N:""}Ye&&_i&&xp(Ye.firstChild);let Er=ai?Vt:Ye;try{let _d=MA(Er);for(;an=_d.nextNode();)Kn(an,Er),Ll(an),oe(an.content)&&Td(an.content)}catch(_d){throw ai&&(OT(Vt),X_(t.removed,Sd=>{Sd.element&&BT(Sd.element)})),_d}if(ai)return X_(t.removed,_d=>{_d.element&&BT(_d.element)}),ht&&Ty(Vt),Vt;if(Hi){if(ht&&Ty(Ye),Gi)for(Ln=z.call(Ye.ownerDocument);Ye.firstChild;)Ln.appendChild(Ye.firstChild);else Ln=Ye;return(Be.shadowroot||Be.shadowrootmode)&&(Ln=te.call(i,Ln,!0)),Ln}let ds=st?Ye.outerHTML:Ye.innerHTML;return st&&Fe["!doctype"]&&Ye.ownerDocument&&Ye.ownerDocument.doctype&&Ye.ownerDocument.doctype.name&&$c(mze,Ye.ownerDocument.doctype.name)&&(ds=" +`+ds),ht&&(ds=OR(ds)),I&&fi?X(ds):ds},t.setConfig=function(){let Vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(Vt),pt=!0,wi=Fe,jn=Be},t.clearConfig=function(){qo=null,pt=!1,wi=null,jn=null,I=g,N=""},t.isValidAttribute=function(Vt,Te,Ye){qo||va({});let yt=si(Vt),an=si(Te);return xn(yt,an,Ye)},t.addHook=function(Vt,Te){typeof Te=="function"&&Ld(H,Vt)&&T2(H[Vt],Te)},t.removeHook=function(Vt,Te){if(Ld(H,Vt)){if(Te!==void 0){let Ye=K3e(H[Vt],Te);return Ye===-1?void 0:J3e(H[Vt],Ye,1)[0]}return xfe(H[Vt])}},t.removeHooks=function(Vt){Ld(H,Vt)&&(H[Vt]=[])},t.removeAllHooks=function(){H=Wfe()},t}var Xfe=Pfe();var Tze=0,OQ={},BQ=class e{constructor(t,n){let i,o=t;l(OQ[o])?i=OQ[o]:(i=Tze++,OQ[o]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=Xfe.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let o=0;o{u[m]=void 0});for(let m=r;m0||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 Sze(e,t){if(Qh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Qh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}R2.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;k.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=k.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&&(Sze(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)};R2.prototype.isDestroyed=function(){return!1};R2.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var Y_=R2;var _Zn=x(T(),1),KQ=x(bu(),1);var hZn=x(T(),1);var HQ,Nfe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",oO={};oO.defaultAccessToken=Nfe;oO.defaultServer=new ve({url:"https://api.cesium.com/"});oO.getDefaultTokenCredit=function(e){if(e===Nfe){if(!l(HQ)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;HQ=new Lt(t,!0)}return HQ}};var Wd=oO;function el(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Zze};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.");ve.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new KQ.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(el.prototype=Object.create(ve.prototype),el.prototype.constructor=el);el.fromAssetId=function(e,t){let n=el._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new el(i,n)})};Object.defineProperties(el.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=el.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});el.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Lt.getIonCredit),i=Wd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Lt.clone(i)),n};el.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(el.prototype),ve.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=ve.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};el.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return ve.prototype.fetchImage.call(this,e)};el.prototype._makeRequest=function(e){return this._isExternal||new KQ.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(e.headers=JQ(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,ve.prototype._makeRequest.call(this,e))};el._createEndpointResource=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.server??Wd.defaultServer,i=t.accessToken??Wd.defaultAccessToken;n=ve.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=JQ(o.headers),n.getDerivedResource(o)};function JQ(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}el._addClientHeaders=JQ;function Zze(e,t){let n=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){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var Ur=el;var ZZn=x(T(),1);function vp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(vp.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});vp.prototype.get=function(e){return this._array[e]};vp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};vp.prototype.peek=function(){return this._array[this._length-1]};vp.prototype.push=function(e){let t=this.length++;this._array[t]=e};vp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};vp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};vp.prototype.resize=function(e){this.length=e};vp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Ol=vp;var EZn=x(T(),1);function rO(e){e=e??B.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}rO.ALL=Object.freeze(new rO({color:new U(0,0,0,0),depth:1,stencil:0}));rO.prototype.execute=function(e,t){e.clear(this,t)};var ui=rO;var WZn=x(T(),1);var Fp={X:0,Y:1,Z:2};Fp.Y_UP_TO_Z_UP=P.fromRotationTranslation(q.fromArray([1,0,0,0,0,1,0,-1,0]));Fp.Z_UP_TO_Y_UP=P.fromRotationTranslation(q.fromArray([1,0,0,0,0,-1,0,1,0]));Fp.X_UP_TO_Z_UP=P.fromRotationTranslation(q.fromArray([0,0,1,0,1,0,-1,0,0]));Fp.Z_UP_TO_X_UP=P.fromRotationTranslation(q.fromArray([0,0,-1,0,1,0,1,0,0]));Fp.X_UP_TO_Y_UP=P.fromRotationTranslation(q.fromArray([0,1,0,-1,0,0,0,0,1]));Fp.Y_UP_TO_X_UP=P.fromRotationTranslation(q.fromArray([0,-1,0,1,0,0,0,0,1]));Fp.fromName=function(e){return Fp[e]};Object.freeze(Fp);var Bi=Fp;var P_i=x(T(),1);var YZn=x(T(),1);function Lm(e){this.planes=e??[]}var C2=[new h,new h,new h];h.clone(h.UNIT_X,C2[0]);h.clone(h.UNIT_Y,C2[1]);h.clone(h.UNIT_Z,C2[2]);var My=new h,Rze=new h,Yfe=new cn(new h(1,0,0),0);function wfe(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Lm.fromBoundingSphere=function(e,t){l(t)||(t=new Lm);let n=C2.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a>10)+55296,(r&1023)+56320))}return t};function V2(e,t,n){return t<=e&&e<=n}function Aze(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c0){let o=Math.min(t,kt.maximumTextureSize),r=Math.ceil(t/kt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new k(o,r),i=new ce(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(tl.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}}});tl.DEFAULT_COLOR_VALUE=U.WHITE;tl.DEFAULT_SHOW_VALUE=!0;function Ufe(e){let t=e._textureDimensions;return t.x*t.y*4}function Dfe(e){if(!l(e._batchValues)){let t=Ufe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Ofe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}tl.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Ofe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Dfe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};tl.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=Ufe(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let m=n(e,t);if(l(m))return m;let p=o[t],b=s[t];for(let f=0;f0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`}jo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Jfe(o,n,!1),s;return kt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; `),s+=`uniform sampler2D tile_batchTexture; out vec4 tile_featureColor; out vec2 tile_featureSt; @@ -3318,7 +3330,7 @@ void main() tile_color(vec4(1.0)); tile_featureSt = computeSt(${t}); }`,`${r} -${Hve(i)}${s}`}};function Voe(e,t){return e=Be.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +${$ze(i)}${s}`}};function Hfe(e,t){return e=Je.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; void tile_color(vec4 tile_featureColor) { tile_main(); @@ -3331,7 +3343,7 @@ void tile_color(vec4 tile_featureColor) { tile_main(); } -`}function zve(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-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; +${d}`,n&&(e+=c),e+=`} +`,e}jo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Jfe(i,t,!0),kt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; in vec2 tile_featureSt; in vec4 tile_featureColor; void main() @@ -3392,116 +3404,1108 @@ void main() `),i+=` tile_color(featureProperties); `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; `),i+=`} -`),i}};function Kve(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Wl.HIGHLIGHT)return 0;if(n===Wl.REPLACE)return 1;if(n===Wl.MIX)return w.clamp(i,w.EPSILON4,1);throw new L(`Invalid color blend mode "${n}".`)}_o.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return St(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return Kve(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};_o.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ny={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};_o.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,l=Jve(this);for(let d=t;d>>kt.SKIP_LOD_BIT_SHIFT}function iFe(e){let t=He(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Oe.fromCache(t)}function oFe(e){let t=He(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Oe.fromCache(t)}_o.prototype.update=function(e,t){this._batchTexture.update(e,t)};_o.prototype.isDestroyed=function(){return!1};_o.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),he(this)};var zp=_o;var $ln=_(T(),1);var Ucn=_(T(),1);function rFe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var bh=rFe;var Uln=_(T(),1);var Dcn=_(T(),1),LC=`in vec3 position; +`),i}};function tHe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Id.HIGHLIGHT)return 0;if(n===Id.REPLACE)return 1;if(n===Id.MIX)return W.clamp(i,W.EPSILON4,1)}jo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return It(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return tHe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Dy={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jo.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=nHe(this);for(let d=t;d>>Jt.SKIP_LOD_BIT_SHIFT}function dHe(e){let t=$e(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=on.ALPHA_BLEND,t.stencilTest=Jt.setCesium3DTileBit(),t.stencilMask=Jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function uHe(e){let t=$e(e,!0);return t.stencilTest=Jt.setCesium3DTileBit(),t.stencilMask=Jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}jo.prototype.update=function(e,t){this._batchTexture.update(e,t)};jo.prototype.isDestroyed=function(){return!1};jo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var $h=jo;var YCn=x(T(),1);var A1n=x(T(),1);function mHe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Pp=mHe;var VCn=x(T(),1);var L1n=x(T(),1),E1=`in vec3 position; in float a_batchId; uniform mat4 u_modifiedModelViewProjection; void main() { gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -`;var zcn=_(T(),1);function Xu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Xu.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 c(this._color)||(this._color=new Y),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(c(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)}}});Xu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Xu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Xu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Xu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(c(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(c(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(c(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(c(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),c(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let l=c(e.group)?e.group.metadata:void 0;if(c(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}let d=e.tileset.metadata;if(c(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};Xu.prototype.getPropertyInherited=function(e){return Xu.getPropertyInherited(this._content,this._batchId,e)};Xu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Xu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Xu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Xu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Us=Xu;var uln=_(T(),1);var Qcn=_(T(),1),CH=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)})}},VH=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)})}},wl=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.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&f.right_a?i>f.prec:i<=f.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(l=o.length-1,t=o[l];l>1;)t={type:e.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=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=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":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"});wl.max_unop_len=wl.getMaxKeyLen(wl.unary_ops);wl.max_binop_len=wl.getMaxKeyLen(wl.binary_ops);var iy=e=>new wl(e).parse(),aFe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(wl).filter(e=>!aFe.includes(e)&&iy[e]===void 0).forEach(e=>{iy[e]=wl[e]});iy.Jsep=wl;var cFe="ConditionalExpression",lFe={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:cFe,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 :")}})}};iy.plugins.register(lFe);var qcn=_(T(),1),dFe={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(dFe);function zm(e,t){C.typeOf.string("expression",e),this._expression=e,e=CFe(e,t),e=LFe(VFe(e)),iy.addBinaryOp("=~",0),iy.addBinaryOp("!~",0);let n;try{n=iy(e)}catch(i){throw new le(i)}this._runtimeAst=Zi(this,n)}Object.defineProperties(zm.prototype,{expression:{get:function(){return this._expression}}});var Pn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new m],cartesian4Array:[new ce],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 ce),this.cartesian4Array[this.cartesian4Index++]}};zm.prototype.evaluate=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof Y&&n instanceof ce?Y.fromCartesian4(n,t):n instanceof D||n instanceof m||n instanceof ce?n.clone(t):n};zm.prototype.evaluateColor=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return Y.fromCartesian4(n,t)};zm.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +`;var I1n=x(T(),1);var e8=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new U),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,o=t.batchTable){if(l(o)){if(o.hasPropertyBySemantic(n,i))return o.getPropertyBySemantic(n,i);if(o.hasProperty(n,i))return o.getProperty(n,i)}let r=t.metadata;if(l(r)){if(r.hasPropertyBySemantic(i))return r.getPropertyBySemantic(i);if(r.hasProperty(i))return r.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let d=l(t.group)?t.group.metadata:void 0;if(l(d)){if(d.hasPropertyBySemantic(i))return d.getPropertyBySemantic(i);if(d.hasProperty(i))return d.getProperty(i)}let u=t.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},ea=e8;var j1n=x(T(),1);var N1n=x(T(),1),t8=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)})}},n8=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)})}},Pd=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.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&m.right_a?i>m.prec:i<=m.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=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":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"});Pd.max_unop_len=Pd.getMaxKeyLen(Pd.unary_ops);Pd.max_binop_len=Pd.getMaxKeyLen(Pd.binary_ops);var Oy=e=>new Pd(e).parse(),fHe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Pd).filter(e=>!fHe.includes(e)&&Oy[e]===void 0).forEach(e=>{Oy[e]=Pd[e]});Oy.Jsep=Pd;var pHe="ConditionalExpression",bHe={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:pHe,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 :")}})}};Oy.plugins.register(bHe);var w1n=x(T(),1),jfe={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};Object.freeze(jfe);var Pt=jfe;function ef(e,t){this._expression=e,e=GHe(e,t),e=WHe(LHe(e)),Oy.addBinaryOp("=~",0),Oy.addBinaryOp("!~",0);let n;try{n=Oy(e)}catch(i){throw new ae(i)}this._runtimeAst=ji(this,n)}Object.defineProperties(ef.prototype,{expression:{get:function(){return this._expression}}});var kn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new k],cartesian3Array:[new h],cartesian4Array:[new ce],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 k),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ce),this.cartesian4Array[this.cartesian4Index++]}};ef.prototype.evaluate=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof ce?U.fromCartesian4(n,t):n instanceof k||n instanceof h||n instanceof ce?n.clone(t):n};ef.prototype.evaluateColor=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};ef.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} { return ${o}; } -`,o};zm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};zm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var uFe=["!","-","+"],Roe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],OX=/\${(.*?)}/g,mFe=/\\/g,fFe="@#%",hFe=/@#%/g,R5=new Y,G5={abs:Os(Math.abs),sqrt:Os(Math.sqrt),cos:Os(Math.cos),sin:Os(Math.sin),tan:Os(Math.tan),acos:Os(Math.acos),asin:Os(Math.asin),atan:Os(Math.atan),radians:Os(w.toRadians),degrees:Os(w.toDegrees),sign:Os(w.sign),floor:Os(Math.floor),ceil:Os(Math.ceil),round:Os(Math.round),exp:Os(Math.exp),exp2:Os(bFe),log:Os(Math.log),log2:Os(yFe),fract:Os(pFe),length:gFe,normalize:xFe},E5={atan2:L5(Math.atan2,!1),pow:L5(Math.pow,!1),min:L5(Math.min,!0),max:L5(Math.max,!0),distance:_Fe,dot:TFe,cross:SFe},RH={clamp:Goe(w.clamp,!0),mix:Goe(w.lerp,!0)};function pFe(e){return e-Math.floor(e)}function bFe(e){return Math.pow(2,e)}function yFe(e){return w.log2(e)}function Os(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),Pn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Pn.getCartesian3());if(n instanceof ce)return ce.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Pn.getCartesian4());throw new le(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function L5(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),Pn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Pn.getCartesian3());if(i instanceof ce)return ce.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Pn.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),Pn.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),Pn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Pn.getCartesian4());throw new le(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Goe(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),Pn.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),Pn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.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),Pn.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),Pn.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),Pn.getCartesian3());if(i instanceof ce&&o instanceof ce&&r instanceof ce)return ce.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),Pn.getCartesian4());throw new le(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function gFe(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 ce)return ce.magnitude(t);throw new le(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function xFe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,Pn.getCartesian2());if(t instanceof m)return m.normalize(t,Pn.getCartesian3());if(t instanceof ce)return ce.normalize(t,Pn.getCartesian4());throw new le(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function _Fe(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 ce&&n instanceof ce)return ce.distance(t,n);throw new le(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function TFe(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 ce&&n instanceof ce)return ce.dot(t,n);throw new le(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function SFe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Pn.getCartesian3());throw new le(`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,vFe(this)}function CFe(e,t){if(!c(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;c(o)&&(e=e.replace(i,o))}return e}function VFe(e){return e.replace(mFe,fFe)}function ZH(e){return e.replace(hFe,"\\")}function LFe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new Vt(gt.VARIABLE_IN_STRING,e.value):new Vt(gt.LITERAL_STRING,ZH(e.value))}function RFe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let l=t.callee.object;if(o==="test"||o==="exec"){if(!c(l.callee)||l.callee.name!=="regExp")throw new le(`${o} is not a function.`);return i===0?o==="test"?new Vt(gt.LITERAL_BOOLEAN,!1):new Vt(gt.LITERAL_NULL,null):(s=Zi(e,l),a=Zi(e,n[0]),new Vt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Zi(e,l),new Vt(gt.FUNCTION_CALL,o,r);throw new le(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Vt(gt.LITERAL_COLOR,o);if(r=Zi(e,n[0]),c(n[1])){let l=Zi(e,n[1]);return new Vt(gt.LITERAL_COLOR,o,[r,l])}return new Vt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new le(`${o} requires three arguments.`);return r=[Zi(e,n[0]),Zi(e,n[1]),Zi(e,n[2])],new Vt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new le(`${o} requires four arguments.`);return r=[Zi(e,n[0]),Zi(e,n[1]),Zi(e,n[2]),Zi(e,n[3])],new Vt(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let l=0;l1)throw new le(`${o} requires exactly one argument.`);return r=Zi(e,n[0]),new Vt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new le(`${o} does not take any argument.`);return new Vt(gt.UNARY,o)}else if(c(G5[o])){if(i!==1)throw new le(`${o} requires exactly one argument.`);return r=Zi(e,n[0]),new Vt(gt.UNARY,o,r)}else if(c(E5[o])){if(i!==2)throw new le(`${o} requires exactly two arguments.`);return s=Zi(e,n[0]),a=Zi(e,n[1]),new Vt(gt.BINARY,o,s,a)}else if(c(RH[o])){if(i!==3)throw new le(`${o} requires exactly three arguments.`);s=Zi(e,n[0]),a=Zi(e,n[1]);let l=Zi(e,n[2]);return new Vt(gt.TERNARY,o,s,a,l)}else{if(o==="Boolean")return i===0?new Vt(gt.LITERAL_BOOLEAN,!1):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="Number")return i===0?new Vt(gt.LITERAL_NUMBER,0):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="String")return i===0?new Vt(gt.LITERAL_STRING,""):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="regExp")return GFe(e,t)}}throw new le(`Unexpected function call "${o}".`)}function GFe(e,t){let n=t.arguments;if(n.length===0)return new Vt(gt.LITERAL_REGEX,new RegExp);let i=Zi(e,n[0]),o;if(n.length>1){let r=Zi(e,n[1]);if(LH(i)&&LH(r)){try{o=new RegExp(ZH(String(i._value)),r._value)}catch(s){throw new le(s)}return new Vt(gt.LITERAL_REGEX,o)}return new Vt(gt.REGEX,i,r)}if(LH(i)){try{o=new RegExp(ZH(String(i._value)))}catch(r){throw new le(r)}return new Vt(gt.LITERAL_REGEX,o)}return new Vt(gt.REGEX,i)}function EFe(e){if(wFe(e.name)){let t=PFe(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 le(`${e.name} is not defined.`)}function XFe(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 IFe(e){if(e.property.name==="POSITIVE_INFINITY")return new Vt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function WFe(e,t){if(t.object.name==="Math")return XFe(t);if(t.object.name==="Number")return IFe(t);let n,i=Zi(e,t.object);return t.computed?(n=Zi(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 LH(e){return e._type>=gt.LITERAL_NULL}function wFe(e){return e.substr(0,4)==="czm_"}function PFe(e){return e.substr(4)}function Zi(e,t){let n,i,o,r;if(t.type==="Literal")n=ZFe(t);else if(t.type==="CallExpression")n=RFe(e,t);else if(t.type==="Identifier")n=EFe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Zi(e,t.argument);if(uFe.indexOf(i)>-1)n=new Vt(gt.UNARY,i,s);else throw new le(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Zi(e,t.left),r=Zi(e,t.right),Roe.indexOf(i)>-1)n=new Vt(gt.BINARY,i,o,r);else throw new le(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Zi(e,t.left),r=Zi(e,t.right),Roe.indexOf(i)>-1&&(n=new Vt(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Zi(e,t.test);o=Zi(e,t.consequent),r=Zi(e,t.alternate),n=new Vt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=WFe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?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:c(E5[e._value])&&(e.evaluate=MFe(e._value)):e._type===gt.TERNARY?e.evaluate=NFe(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=FFe):e.evaluate=e._evaluateLiteral}function FFe(e){return c(e)?e.content.tileset.timeSinceLoad:0}function AFe(e){let t=G5[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function MFe(e){let t=E5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function NFe(e){let t=RH[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 X5(e,t){if(c(e))return e.getPropertyInherited(t)}Vt.prototype._evaluateLiteral=function(){return this._value};Vt.prototype._evaluateLiteralColor=function(e){let t=R5,n=this._left;if(this._value==="color")c(n)?n.length>1?(Y.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):Y.fromCssColorString(n[0].evaluate(e),t):Y.fromBytes(255,255,255,255,t);else if(this._value==="rgb")Y.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;Y.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ce.fromColor(t,Pn.getCartesian4())};Vt.prototype._evaluateLiteralVector=function(e){let t=Pn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new le(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new le(`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,Pn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Pn.getCartesian3());if(n==="vec4")return ce.fromArray(t,0,Pn.getCartesian4())};Vt.prototype._evaluateLiteralString=function(){return this._value};Vt.prototype._evaluateVariableString=function(e){let t=this._value,n=OX.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=X5(e,o);c(r)||(r=""),t=t.replace(i,r),OX.lastIndex+=r.length-i.length,n=OX.exec(t)}return t};Vt.prototype._evaluateVariable=function(e){return X5(e,this._value)};function n_(e){return e._value==="feature"}Vt.prototype._evaluateMemberDot=function(e){if(n_(this._left))return X5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof ce){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(n_(this._left))return X5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof ce){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" 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 le(`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 le(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new le(`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 le(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new le(`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,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.add(t,n,Pn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new le(`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,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.subtract(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new le(`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,Pn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,Pn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Pn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Pn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.multiplyComponents(t,n,Pn.getCartesian4());if(n instanceof ce&&typeof t=="number")return ce.multiplyByScalar(n,t,Pn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.multiplyByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new le(`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,Pn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Pn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.divideComponents(t,n,Pn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.divideByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new le(`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,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new le(`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 ce&&t instanceof ce?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 ce&&t instanceof ce?!t.equals(n):t!==n};Vt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new le(`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 c(e)?e.isExactClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateIsClass=function(e){return c(e)?e.isClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateGetExactClassName=function(e){if(c(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="";c(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new le(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 le(`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 le(`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 le(`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 le(`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 c(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 ce)return String(t);throw new le(`Unexpected function call "${this._value}".`)};function Eoe(e){let t=e._left,n=t.length;for(let a=0;a1){let p=d[0],y=d[1];return y!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${y})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(l==="rgb")return i=Xoe(this),c(i)?Z5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(l==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=Xoe(this),c(i)?Z5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(l==="hsl")return i=Eoe(this),c(i)?Z5(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(l==="hsla")return i=Eoe(this),c(i)?(i.alpha!==1&&(t.translucent=!0),Z5(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:if(!c(o))throw new L("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");u=o.length,f=`${l}(`;for(let p=0;p",">=","<","<=","&&","||","!~","=~"],L2=/\${(.*?)}/g,yHe=/\\/g,xHe="@#%",THe=/@#%/g,cO=new U,lO={abs:Na(Math.abs),sqrt:Na(Math.sqrt),cos:Na(Math.cos),sin:Na(Math.sin),tan:Na(Math.tan),acos:Na(Math.acos),asin:Na(Math.asin),atan:Na(Math.atan),radians:Na(W.toRadians),degrees:Na(W.toDegrees),sign:Na(W.sign),floor:Na(Math.floor),ceil:Na(Math.ceil),round:Na(Math.round),exp:Na(Math.exp),exp2:Na(SHe),log:Na(Math.log),log2:Na(ZHe),fract:Na(_He),length:RHe,normalize:CHe},dO={atan2:sO(Math.atan2,!1),pow:sO(Math.pow,!1),min:sO(Math.min,!0),max:sO(Math.max,!0),distance:VHe,dot:EHe,cross:AHe},r8={clamp:qfe(W.clamp,!0),mix:qfe(W.lerp,!0)};function _He(e){return e-Math.floor(e)}function SHe(e){return Math.pow(2,e)}function ZHe(e){return W.log2(e)}function Na(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof k)return k.fromElements(e(n.x),e(n.y),kn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),kn.getCartesian3());if(n instanceof ce)return ce.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),kn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function sO(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof k)return k.fromElements(e(i.x,o),e(i.y,o),kn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),kn.getCartesian3());if(i instanceof ce)return ce.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof k&&o instanceof k)return k.fromElements(e(i.x,o.x),e(i.y,o.y),kn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),kn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),kn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function qfe(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 k&&o instanceof k)return k.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),kn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),kn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.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),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof k&&o instanceof k&&r instanceof k)return k.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),kn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),kn.getCartesian3());if(i instanceof ce&&o instanceof ce&&r instanceof ce)return ce.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),kn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function RHe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof k)return k.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof ce)return ce.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function CHe(e,t){if(typeof t=="number")return 1;if(t instanceof k)return k.normalize(t,kn.getCartesian2());if(t instanceof h)return h.normalize(t,kn.getCartesian3());if(t instanceof ce)return ce.normalize(t,kn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function VHe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof k&&n instanceof k)return k.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof ce&&n instanceof ce)return ce.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function EHe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof k&&n instanceof k)return k.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof ce&&n instanceof ce)return ce.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function AHe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,kn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function wt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,kHe(this)}function GHe(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 LHe(e){return e.replace(yHe,xHe)}function o8(e){return e.replace(THe,"\\")}function WHe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new wt(Pt.VARIABLE_IN_STRING,e.value):new wt(Pt.LITERAL_STRING,o8(e.value))}function FHe(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 wt(Pt.LITERAL_BOOLEAN,!1):new wt(Pt.LITERAL_NULL,null):(s=ji(e,c),a=ji(e,n[0]),new wt(Pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=ji(e,c),new wt(Pt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new wt(Pt.LITERAL_COLOR,o);if(r=ji(e,n[0]),l(n[1])){let c=ji(e,n[1]);return new wt(Pt.LITERAL_COLOR,o,[r,c])}return new wt(Pt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[ji(e,n[0]),ji(e,n[1]),ji(e,n[2])],new wt(Pt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[ji(e,n[0]),ji(e,n[1]),ji(e,n[2]),ji(e,n[3])],new wt(Pt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new wt(Pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new wt(Pt.UNARY,o)}else if(l(lO[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new wt(Pt.UNARY,o,r)}else if(l(dO[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=ji(e,n[0]),a=ji(e,n[1]),new wt(Pt.BINARY,o,s,a)}else if(l(r8[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=ji(e,n[0]),a=ji(e,n[1]);let c=ji(e,n[2]);return new wt(Pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new wt(Pt.LITERAL_BOOLEAN,!1):(r=ji(e,n[0]),new wt(Pt.UNARY,o,r));if(o==="Number")return i===0?new wt(Pt.LITERAL_NUMBER,0):(r=ji(e,n[0]),new wt(Pt.UNARY,o,r));if(o==="String")return i===0?new wt(Pt.LITERAL_STRING,""):(r=ji(e,n[0]),new wt(Pt.UNARY,o,r));if(o==="regExp")return IHe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function IHe(e,t){let n=t.arguments;if(n.length===0)return new wt(Pt.LITERAL_REGEX,new RegExp);let i=ji(e,n[0]),o;if(n.length>1){let r=ji(e,n[1]);if(i8(i)&&i8(r)){try{o=new RegExp(o8(String(i._value)),r._value)}catch(s){throw new ae(s)}return new wt(Pt.LITERAL_REGEX,o)}return new wt(Pt.REGEX,i,r)}if(i8(i)){try{o=new RegExp(o8(String(i._value)))}catch(r){throw new ae(r)}return new wt(Pt.LITERAL_REGEX,o)}return new wt(Pt.REGEX,i)}function PHe(e){if(wHe(e.name)){let t=MHe(e.name);return t.substr(0,8)==="tiles3d_"?new wt(Pt.BUILTIN_VARIABLE,t):new wt(Pt.VARIABLE,t)}else{if(e.name==="NaN")return new wt(Pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new wt(Pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new wt(Pt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function XHe(e){let t=e.property.name;if(t==="PI")return new wt(Pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new wt(Pt.LITERAL_NUMBER,Math.E)}function NHe(e){if(e.property.name==="POSITIVE_INFINITY")return new wt(Pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function YHe(e,t){if(t.object.name==="Math")return XHe(t);if(t.object.name==="Number")return NHe(t);let n,i=ji(e,t.object);return t.computed?(n=ji(e,t.property),new wt(Pt.MEMBER,"brackets",i,n)):(n=new wt(Pt.LITERAL_STRING,t.property.name),new wt(Pt.MEMBER,"dot",i,n))}function i8(e){return e._type>=Pt.LITERAL_NULL}function wHe(e){return e.substr(0,4)==="czm_"}function MHe(e){return e.substr(4)}function ji(e,t){let n,i,o,r;if(t.type==="Literal")n=vHe(t);else if(t.type==="CallExpression")n=FHe(e,t);else if(t.type==="Identifier")n=PHe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=ji(e,t.argument);if(gHe.indexOf(i)>-1)n=new wt(Pt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=ji(e,t.left),r=ji(e,t.right),Qfe.indexOf(i)>-1)n=new wt(Pt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=ji(e,t.left),r=ji(e,t.right),Qfe.indexOf(i)>-1&&(n=new wt(Pt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=ji(e,t.test);o=ji(e,t.consequent),r=ji(e,t.alternate),n=new wt(Pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=YHe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?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(dO[e._value])&&(e.evaluate=OHe(e._value)):e._type===Pt.TERNARY?e.evaluate=BHe(e._value):e._type===Pt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Pt.ARRAY?e.evaluate=e._evaluateArray:e._type===Pt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Pt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Pt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Pt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Pt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Pt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Pt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=UHe):e.evaluate=e._evaluateLiteral}function UHe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function DHe(e){let t=lO[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function OHe(e){let t=dO[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function BHe(e){let t=r8[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 uO(e,t){if(l(e))return e.getPropertyInherited(t)}wt.prototype._evaluateLiteral=function(){return this._value};wt.prototype._evaluateLiteralColor=function(e){let t=cO,n=this._left;if(this._value==="color")l(n)?n.length>1?(U.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):U.fromCssColorString(n[0].evaluate(e),t):U.fromBytes(255,255,255,255,t);else if(this._value==="rgb")U.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;U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ce.fromColor(t,kn.getCartesian4())};wt.prototype._evaluateLiteralVector=function(e){let t=kn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)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 k.fromArray(t,0,kn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,kn.getCartesian3());if(n==="vec4")return ce.fromArray(t,0,kn.getCartesian4())};wt.prototype._evaluateLiteralString=function(){return this._value};wt.prototype._evaluateVariableString=function(e){let t=this._value,n=L2.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=uO(e,o);l(r)||(r=""),t=t.replace(i,r),L2.lastIndex+=r.length-i.length,n=L2.exec(t)}return t};wt.prototype._evaluateVariable=function(e){return uO(e,this._value)};function k_(e){return e._value==="feature"}wt.prototype._evaluateMemberDot=function(e){if(k_(this._left))return uO(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ce){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]};wt.prototype._evaluateMemberBrackets=function(e){if(k_(this._left))return uO(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ce){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]};wt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};wt.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};wt.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};wt.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};wt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.add(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.add(t,n,kn.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}.`)};wt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.subtract(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.subtract(t,n,kn.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}.`)};wt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.multiplyComponents(t,n,kn.getCartesian2());if(n instanceof k&&typeof t=="number")return k.multiplyByScalar(n,t,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.multiplyByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,kn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.multiplyComponents(t,n,kn.getCartesian4());if(n instanceof ce&&typeof t=="number")return ce.multiplyByScalar(n,t,kn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.multiplyByScalar(t,n,kn.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}.`)};wt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.divideComponents(t,n,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.divideByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.divideComponents(t,n,kn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.divideByScalar(t,n,kn.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}.`)};wt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.fromElements(t.x%n.x,t.y%n.y,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,kn.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}.`)};wt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ce&&t instanceof ce?t.equals(n):t===n};wt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ce&&t instanceof ce?!t.equals(n):t!==n};wt.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)};wt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};wt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};wt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};wt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};wt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};wt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};wt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};wt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};wt.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};wt.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)};wt.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}.`)};wt.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}.`)};wt.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};wt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof k||t instanceof h||t instanceof ce)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function $fe(e){let t=e._left,n=t.length;for(let a=0;a1){let p=d[0],b=d[1];return b!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${b})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=epe(this),l(i)?aO(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=epe(this),l(i)?aO(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=$fe(this),l(i)?aO(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=$fe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),aO(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case Pt.LITERAL_VECTOR:u=o.length,m=`${c}(`;for(let p=0;p0;){let u=t.pop();if(Y.equals(u.color,a.color))d=GH(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let f=d;d=GH(n,s,d,i,o,u.batchIds,r),u.offset=f,u.count=d-f,l.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=l}function EH(e,t,n,i,o,r,s){let a=e.bytesPerIndex,l=r.length;for(let d=0;d0;){let f=t.pop();if(Y.equals(f.color,r.color))d=EH(a,l,d,n,i,f.batchIds,o),r.batchIds=r.batchIds.concat(f.batchIds),r.count=d-r.offset;else{let p=d;d=EH(a,l,d,n,i,f.batchIds,o),f.offset=p,f.count=d-p,s.push(f),r=f}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function QFe(e,t){return t.color.toRgba()-e.color.toRgba()}function jFe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=g&&s{e.isDestroyed()||(e._error=h)}):void 0}}function fAe(e){c(e._primitive)||(e._primitive=new o_({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: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)}Td.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Td.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Td.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Td.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Td.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=mAe(this)),c(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)};Td.prototype.isDestroyed=function(){return!1};Td.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};var Jp=Td;function yh(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,bAe(this,i,o)}Object.defineProperties(yh.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return c(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return c(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 hAe(e){return function(t,n){c(e._geometries)&&e._geometries.updateCommands(t,n)}}function pAe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,l=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=e.SPHERES_LENGTH??0;if(a>0&&c(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(l>0&&c(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,l)}if(d>0&&c(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,d)}if(u>0&&c(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,u)}let f=c(n)||c(i)||c(o)||c(r),p=a>0&&!c(n)||l>0&&!c(i)||d>0&&!c(o)||u>0&&!c(r);if(f&&p)throw new le("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)&&!c(r)){let h=0;if(!c(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(l),s=0;s0)for(o=new Uint16Array(d),s=0;s0)for(r=new Uint16Array(u),s=0;s0&&(y=er(i,n,d),n+=d,u>0&&(h=new Uint8Array(t,n,u),h=new Uint8Array(h)));let g=f.BOXES_LENGTH??0,x=f.CYLINDERS_LENGTH??0,S=f.ELLIPSOIDS_LENGTH??0,V=f.SPHERES_LENGTH??0,Z=g+x+S+V,R=new zp(e,Z,y,h,hAe(e));if(e._batchTable=R,Z===0)return;let E=e.tile.computedTransform,I;c(f.RTC_CENTER)&&(I=m.unpack(f.RTC_CENTER),M.multiplyByPoint(E,I,I));let v=pAe(f,p);if(g>0||x>0||S>0||V>0){let P,F,N,b;if(g>0){let G=p.byteOffset+f.BOXES.byteOffset;P=new Float32Array(p.buffer,G,Jp.packedBoxLength*g)}if(x>0){let G=p.byteOffset+f.CYLINDERS.byteOffset;F=new Float32Array(p.buffer,G,Jp.packedCylinderLength*x)}if(S>0){let G=p.byteOffset+f.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,G,Jp.packedEllipsoidLength*S)}if(V>0){let G=p.byteOffset+f.SPHERES.byteOffset;b=new Float32Array(p.buffer,G,Jp.packedSphereLength*V)}return e._geometries=new Jp({boxes:P,boxBatchIds:v.boxes,cylinders:F,cylinderBatchIds:v.cylinders,ellipsoids:N,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:I,modelMatrix:E,batchTable:R,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Foe(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}yh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};yh.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new L(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return Foe(this),this._features[e]};yh.prototype.applyDebugSettings=function(e,t){c(this._geometries)&&this._geometries.applyDebugSettings(e,t)};yh.prototype.applyStyle=function(e){Foe(this),c(this._geometries)&&this._geometries.applyStyle(e,this._features)};yh.prototype.update=function(e,t){c(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),c(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};yh.prototype.pick=function(e,t,n){};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),he(this)};var DX=yh;var Mgn=_(T(),1);var hdn=_(T(),1);var XH={};XH.encode2D=function(e,t,n){let i=Math.pow(2,e);if(C.typeOf.number("level",e),C.typeOf.number("x",t),C.typeOf.number("y",n),e<1)throw new L("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new L("Invalid coordinates for given level.");let o={x:t,y:n},r,s,a,l=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,l+=BigInt((3*r^s)*a*a),Aoe(i,o,r,s);return l};XH.decode2D=function(e,t){if(C.typeOf.number("level",e),C.typeOf.bigint("index",t),e<1)throw new L("Hilbert level cannot be less than 1.");if(t=BigInt(Math.pow(4,e)))throw new L("Hilbert index exceeds valid maximum for given level.");let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s>>0,IH=2*cy+1,ry=4,koe=[],Uoe=[],xAe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],sy=1,RC=2,I5=[sy,0,0,sy|RC];function dr(e){if(!Ot.supportsBigInt())throw new le("S2 required BigInt support");if(!c(e))throw new L("cell ID is required.");if(!dr.isValidId(e))throw new L("cell ID is invalid.");this._cellId=e,this._level=dr.getLevel(e)}dr.fromToken=function(e){if(C.typeOf.string("token",e),!dr.isValidToken(e))throw new L("token is invalid.");return new dr(dr.getIdFromToken(e))};dr.isValidId=function(e){return C.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(IH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};dr.isValidToken=function(e){return C.typeOf.string("token",e),/^[0-9a-fA-F]{1,16}$/.test(e)?dr.isValidId(dr.getIdFromToken(e)):!1};dr.getIdFromToken=function(e){return C.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))};dr.getTokenFromId=function(e){C.typeOf.bigint("cellId",e);let t=Math.floor(EAe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};dr.getLevel=function(e){if(C.typeOf.bigint("cellId",e),!dr.isValidId(e))throw new L;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return cy-(t>>1)};dr.prototype.getChild=function(e){if(C.typeOf.number("index",e),e<0||e>3)throw new L("child index must be in the range [0-3].");if(this._level===30)throw new L("cannot get child of leaf cell.");let t=Boe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new dr(n)};dr.prototype.getParent=function(){if(this._level===0)throw new L("cannot get parent of root cell.");let e=Boe(this._cellId)<3)throw new L("vertex index must be in the range [0-3].");t=t??re.WGS84;let n=TAe(this._cellId,this._level,e);n=m.normalize(n,n);let i=new pe.fromCartesian(n,re.UNIT_SPHERE);return pe.toCartesian(i,t,new m)};dr.fromFacePositionLevel=function(e,t,n){if(C.typeOf.bigint("position",t),e<0||e>5)throw new L("Invalid S2 Face (must be within 0-5)");if(n<0||n>cy)throw new L("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new L("Invalid Hilbert position for level");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(IH-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new dr(a)};function _Ae(e,t){let n=SAe(e,t);return CAe(n[0],n[1],n[2])}function TAe(e,t,n){let i=Ooe(e,t),o=VAe([i[1],i[2]],t),r=n>>1&1;return Doe(i[0],o[0][r^n&1],o[1][r])}function SAe(e,t){let n=Ooe(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),l=s?1:a?2:0,d=(o<<1)+l,u=(r<<1)+l;return[i,d,u]}function Ooe(e){koe.length===0&&ZAe();let t=Number(e>>BigInt(IH)),n=t&sy,i=(1<=0;s--){let l=(1<<2*(s===7?cy-7*ry:ry))-1;n+=Number(e>>BigInt(s*2*ry+1)&BigInt(l))<<2,n=Uoe[n];let d=s*ry;o+=n>>ry+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Moe(e){return 1/gAe*e}function VAe(e,t){let n=[[],[]],i=LAe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=W5(Noe(r)),n[o][1]=W5(Noe(s))}return n}function LAe(e){return 1<>>0}function Noe(e){return 1/yAe*e}function ay(e,t,n,i,o,r){if(e===ry){let s=(t<>1),n+(s[0]&1),i,o,r^I5[0]),ay(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^I5[1]),ay(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^I5[2]),ay(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^I5[3])}}function ZAe(){ay(0,0,0,0,0,0),ay(0,0,0,sy,0,sy),ay(0,0,0,RC,0,RC),ay(0,0,0,sy|RC,0,sy|RC)}function Boe(e){return e&~e+BigInt(1)}function RAe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(WH.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});WH.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new L("Bit index out of bounds.");if(c(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var GC=WH;var Adn=_(T(),1);function jp(e){e=e??z.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;C.typeOf.object("options.metadataTable",t),C.typeOf.object("options.class",n),C.typeOf.number("options.entityId",i),C.typeOf.object("options.propertyTableJson",o),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var EC=jp;var kdn=_(T(),1);var w5={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};w5.getBranchingFactor=function(e){switch(e){case w5.OCTREE:return 8;case w5.QUADTREE:return 4;default:throw new L("subdivisionScheme is not a valid value.")}};var tr=Object.freeze(w5);var qdn=_(T(),1);var Hdn=_(T(),1);function ma(){}Object.defineProperties(ma.prototype,{class:{get:function(){L.throwInstantiationError()}}});ma.prototype.hasProperty=function(e){L.throwInstantiationError()};ma.prototype.hasPropertyBySemantic=function(e){L.throwInstantiationError()};ma.prototype.getPropertyIds=function(e){L.throwInstantiationError()};ma.prototype.getProperty=function(e){L.throwInstantiationError()};ma.prototype.setProperty=function(e,t){L.throwInstantiationError()};ma.prototype.getPropertyBySemantic=function(e){L.throwInstantiationError()};ma.prototype.setPropertyBySemantic=function(e,t){L.throwInstantiationError()};ma.hasProperty=function(e,t,n){if(C.typeOf.string("propertyId",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n),c(t[e]))return!0;let i=n.properties;if(!c(i))return!1;let o=i[e];return!!(c(o)&&c(o.default))};ma.hasPropertyBySemantic=function(e,t,n){C.typeOf.string("semantic",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return!1;let o=i[e];return c(o)};ma.getPropertyIds=function(e,t,n){C.typeOf.object("properties",e),C.typeOf.object("classDefinition",t),n=c(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&c(e[o])&&n.push(o);let i=t.properties;if(c(i))for(let o in i)i.hasOwnProperty(o)&&!c(e[o])&&c(i[o].default)&&n.push(o);return n};ma.getProperty=function(e,t,n){if(C.typeOf.string("propertyId",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n),!c(n.properties[e]))throw new L(`Class definition missing property ${e}`);let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!c(o)&&c(i.default))return o=He(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(c(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ma.setProperty=function(e,t,n,i){if(C.typeOf.string("propertyId",e),C.defined("value",t),C.typeOf.object("properties",n),C.typeOf.object("classDefinition",i),!c(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return c(r)&&(o=r[e]),c(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ma.getPropertyBySemantic=function(e,t,n){C.typeOf.string("semantic",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return;let o=i[e];if(c(o))return ma.getProperty(o.id,t,n)};ma.setPropertyBySemantic=function(e,t,n,i){C.typeOf.string("semantic",e),C.defined("value",t),C.typeOf.object("properties",n),C.typeOf.object("classDefinition",i);let o=i.propertiesBySemantic;if(!c(o))return!1;let r=i.propertiesBySemantic[e];return c(r)?ma.setProperty(r.id,t,n,i):!1};var Nn=ma;function qp(e){e=e??z.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class;C.typeOf.object("options.subtreeMetadata",t),C.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});qp.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};qp.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};qp.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};qp.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};qp.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};qp.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};qp.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var BX=qp;var qun=_(T(),1);var Bun=_(T(),1);var run=_(T(),1);var Ft={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Ft.getMinimum=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:return-128;case Ft.UINT8:return 0;case Ft.INT16:return-32768;case Ft.UINT16:return 0;case Ft.INT32:return-2147483648;case Ft.UINT32:return 0;case Ft.INT64:return Ot.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Ft.UINT64:return Ot.supportsBigInt()?BigInt(0):0;case Ft.FLOAT32:return-34028234663852886e22;case Ft.FLOAT64:return-Number.MAX_VALUE}};Ft.getMaximum=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:return 127;case Ft.UINT8:return 255;case Ft.INT16:return 32767;case Ft.UINT16:return 65535;case Ft.INT32:return 2147483647;case Ft.UINT32:return 4294967295;case Ft.INT64:return Ot.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Ft.UINT64:return Ot.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Ft.FLOAT32:return 34028234663852886e22;case Ft.FLOAT64:return Number.MAX_VALUE}};Ft.isIntegerType=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.INT64:case Ft.UINT64:return!0;default:return!1}};Ft.isUnsignedIntegerType=function(e){switch(C.typeOf.string("type",e),e){case Ft.UINT8:case Ft.UINT16:case Ft.UINT32:case Ft.UINT64:return!0;default:return!1}};Ft.isVectorCompatible=function(e){switch(C.typeOf.string("type",e),e){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!0;default:return!1}};Ft.normalize=function(e,t){if(typeof e!="number"&&typeof e!="bigint")throw new L("value must be a number or a BigInt");if(!Ft.isIntegerType(t))throw new L("type must be an integer type");return Math.max(Number(e)/Number(Ft.getMaximum(t)),-1)};Ft.unnormalize=function(e,t){if(C.typeOf.number("value",e),!Ft.isIntegerType(t))throw new L("type must be an integer type");let n=Ft.getMaximum(t),i=Ft.isUnsignedIntegerType(t)?0:-n;return e=w.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Ft.INT64||t===Ft.UINT64)&&Ot.supportsBigInt()&&(e=BigInt(e)),e>n?n:e1;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(!c(t))return e;if(!Koe(e,t))return e};function Koe(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n1;return c(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=t??!1;let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return c(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(!(!c(e)&&c(this._default)))return this._required&&!c(e)?"required property must have a value":this._isArray?PAe(this,e):Joe(this,e)};function PAe(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;i1?Yoe(e,t,n):void 0}if(eAt.getMaximum(t))return Yoe(e,t,n)}function zoe(e,t){return`value ${e} of type ${t} must be finite`}function wH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i=n){let i=n-1;throw new L(`index is required and between zero and count - 1. Actual value: ${i}`)}}function UAe(e,t){$oe(e)&&ere(e);let n=e._classProperty,i=n.isArray,o=n.type,r=lt.getComponentCount(o);if(c(e._unpackedValues)){let s=e._unpackedValues[t];return i?He(s,!0):s}return!i&&r===1?e._getValue(t):qoe(e,n,t)}function qoe(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=lt.getComponentCount(t.type);i*=s,o*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function YAe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=l*Math.pow(256,a)}return r&&(o=-o),o}function zAe(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=BigInt(l)*(BigInt(1)<0;){let u=t.pop();if(U.equals(u.color,a.color))d=s8(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let m=d;d=s8(n,s,d,i,o,u.batchIds,r),u.offset=m,u.count=d-m,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function a8(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d0;){let m=t.pop();if(U.equals(m.color,r.color))d=a8(a,c,d,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=d-r.offset;else{let p=d;d=a8(a,c,d,n,i,m.batchIds,o),m.offset=p,m.count=d-p,s.push(m),r=m}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function nKe(e,t){return t.color.toRgba()-e.color.toRgba()}function iKe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=y&&s{e.isDestroyed()||(e._error=f)}):void 0}}function xKe(e){l(e._primitive)||(e._primitive=new D_({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: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)}Cu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Cu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Cu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Cu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Cu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=yKe(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)};Cu.prototype.isDestroyed=function(){return!1};Cu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var Zb=Cu;var c8=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,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,SKe(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return spe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){spe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)}};function TKe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function _Ke(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=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 m=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(m&&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;s0)for(i=new Uint16Array(c),s=0;s0)for(o=new Uint16Array(d),s=0;s0)for(r=new Uint16Array(u),s=0;s0&&(b=vr(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let y=m.BOXES_LENGTH??0,_=m.CYLINDERS_LENGTH??0,S=m.ELLIPSOIDS_LENGTH??0,Z=m.SPHERES_LENGTH??0,R=y+_+S+Z,C=new $h(e,R,b,f,TKe(e));if(e._batchTable=C,R===0)return;let E=e.tile.computedTransform,A;l(m.RTC_CENTER)&&(A=h.unpack(m.RTC_CENTER),P.multiplyByPoint(E,A,A));let L=_Ke(m,p);if(y>0||_>0||S>0||Z>0){let F,I,N,g;if(y>0){let V=p.byteOffset+m.BOXES.byteOffset;F=new Float32Array(p.buffer,V,Zb.packedBoxLength*y)}if(_>0){let V=p.byteOffset+m.CYLINDERS.byteOffset;I=new Float32Array(p.buffer,V,Zb.packedCylinderLength*_)}if(S>0){let V=p.byteOffset+m.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,V,Zb.packedEllipsoidLength*S)}if(Z>0){let V=p.byteOffset+m.SPHERES.byteOffset;g=new Float32Array(p.buffer,V,Zb.packedSphereLength*Z)}return e._geometries=new Zb({boxes:F,boxBatchIds:L.boxes,cylinders:I,cylinderBatchIds:L.cylinders,ellipsoids:N,ellipsoidBatchIds:L.ellipsoids,spheres:g,sphereBatchIds:L.spheres,center:A,modelMatrix:E,batchTable:C,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function spe(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}}var W2=c8;var HFn=x(T(),1);var jCn=x(T(),1);var l8={};l8.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),ape(i,o,r,s);return c};l8.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>>0,d8=2*B_+1,zy=4,dpe=[],upe=[],CKe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Hy=1,G1=2,mO=[Hy,0,0,Hy|G1];function ks(e){if(!fn.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=ks.getLevel(e)}ks.fromToken=function(e){return new ks(ks.getIdFromToken(e))};ks.isValidId=function(e){return!(e<=0||e>>BigInt(d8)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ks.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ks.isValidId(ks.getIdFromToken(e)):!1};ks.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ks.getTokenFromId=function(e){let t=Math.floor(PKe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ks.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return B_-(t>>1)};ks.prototype.getChild=function(e){let t=fpe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ks(n)};ks.prototype.getParent=function(){let e=fpe(this._cellId)<>1&1;return hpe(i[0],o[0][r^n&1],o[1][r])}function AKe(e,t){let n=mpe(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 mpe(e){dpe.length===0&&vKe();let t=Number(e>>BigInt(d8)),n=t&Hy,i=(1<=0;s--){let c=(1<<2*(s===7?B_-7*zy:zy))-1;n+=Number(e>>BigInt(s*2*zy+1)&BigInt(c))<<2,n=upe[n];let d=s*zy;o+=n>>zy+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function cpe(e){return 1/RKe*e}function LKe(e,t){let n=[[],[]],i=WKe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=hO(lpe(r)),n[o][1]=hO(lpe(s))}return n}function WKe(e){return 1<>>0}function lpe(e){return 1/ZKe*e}function Ky(e,t,n,i,o,r){if(e===zy){let s=(t<>1),n+(s[0]&1),i,o,r^mO[0]),Ky(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^mO[1]),Ky(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^mO[2]),Ky(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^mO[3])}}function vKe(){Ky(0,0,0,0,0,0),Ky(0,0,0,Hy,0,Hy),Ky(0,0,0,G1,0,G1),Ky(0,0,0,Hy|G1,0,Hy|G1)}function fpe(e){return e&~e+BigInt(1)}function FKe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(u8.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});u8.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 L1=u8;var hVn=x(T(),1);function Cb(e){e=e??B.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(Cb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Cb.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Cb.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Cb.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Cb.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Cb.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Cb.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Cb.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var W1=Cb;var pVn=x(T(),1);var v2={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};v2.getBranchingFactor=function(e){switch(e){case v2.OCTREE:return 8;case v2.QUADTREE:return 4}};Object.freeze(v2);var Us=v2;var CVn=x(T(),1);var TVn=x(T(),1);function cc(){}Object.defineProperties(cc.prototype,{class:{get:function(){ge.throwInstantiationError()}}});cc.prototype.hasProperty=function(e){ge.throwInstantiationError()};cc.prototype.hasPropertyBySemantic=function(e){ge.throwInstantiationError()};cc.prototype.getPropertyIds=function(e){ge.throwInstantiationError()};cc.prototype.getProperty=function(e){ge.throwInstantiationError()};cc.prototype.setProperty=function(e,t){ge.throwInstantiationError()};cc.prototype.getPropertyBySemantic=function(e){ge.throwInstantiationError()};cc.prototype.setPropertyBySemantic=function(e,t){ge.throwInstantiationError()};cc.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))};cc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};cc.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};cc.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&l(o.slice)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=$e(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};cc.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(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};cc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return cc.getProperty(o.id,t,n)};cc.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?cc.setProperty(r.id,t,n,i):!1};var Jn=cc;function Vb(e){e=e??B.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(Vb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Vb.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};Vb.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};Vb.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};Vb.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};Vb.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};Vb.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};Vb.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var F2=Vb;var yEn=x(T(),1);var uEn=x(T(),1);var WVn=x(T(),1);var hn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},nl={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};hn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:nl.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:nl.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:nl.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:nl.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:nl.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:nl.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:nl.INTEGER,downcastFunction:e=>hn.clampToLimits(e,hn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:nl.UNSIGNED_INTEGER,downcastFunction:e=>hn.clampToLimits(e,hn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:nl.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:nl.FLOAT,downcastFunction:e=>Math.fround(e)}};hn.getMinimum=function(e){return hn.typeInfo[e].minimumValue};hn.getMaximum=function(e){return hn.typeInfo[e].maximumValue};hn.isIntegerType=function(e){return hn.typeInfo[e].category!==nl.FLOAT};hn.isUnsignedIntegerType=function(e){return hn.typeInfo[e].category===nl.UNSIGNED_INTEGER};hn.isVectorCompatible=function(e){return hn.typeInfo[e].vectorCompatible};hn.category=function(e){return hn.typeInfo[e].category};hn.gpuComponentType=function(e){switch(e){case hn.INT64:return"INT32";case hn.UINT64:return"UINT32";case hn.FLOAT64:return"FLOAT32";default:return e}};hn.normalize=function(e,t){return Math.max(Number(e)/Number(hn.getMaximum(t)),-1)};hn.unnormalize=function(e,t){let n=hn.getMaximum(t),i=hn.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===hn.INT64||t===hn.UINT64)&&fn.supportsBigInt()&&(e=BigInt(e)),e>n?n:er?i:Number(e)}return Math.max(n,Math.min(i,e))};hn.downcastFunction=function(e){let n=hn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};hn.fromComponentDatatype=function(e){switch(e){case J.BYTE:return hn.INT8;case J.UNSIGNED_BYTE:return hn.UINT8;case J.SHORT:return hn.INT16;case J.UNSIGNED_SHORT:return hn.UINT16;case J.INT:return hn.INT32;case J.UNSIGNED_INT:return hn.UINT32;case J.FLOAT:return hn.FLOAT32;case J.DOUBLE:return hn.FLOAT64}};hn.toComponentDatatype=function(e){switch(e){case hn.INT8:return J.BYTE;case hn.UINT8:return J.UNSIGNED_BYTE;case hn.INT16:return J.SHORT;case hn.UINT16:return J.UNSIGNED_SHORT;case hn.INT32:return J.INT;case hn.UINT32:return J.UNSIGNED_INT;case hn.FLOAT32:return J.FLOAT;case hn.FLOAT64:return J.DOUBLE}};hn.getDataViewAccessors=function(e,t){return{[hn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[hn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[hn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,o)=>e.setUint16(i,o,!0)},[hn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,o)=>e.setInt16(i,o,!0)},[hn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,o)=>e.setUint32(i,o,!0)},[hn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,o)=>e.setInt32(i,o,!0)},[hn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,o)=>e.setFloat32(i,o,!0)},[hn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,o)=>e.setFloat64(i,o,!0)},[hn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,o)=>e.setBigUint64(i,BigInt(o),!0)},[hn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,o)=>e.setBigInt64(i,BigInt(o),!0)}}[t]};Object.freeze(hn);var Nt=hn;var qVn=x(T(),1);var wVn=x(T(),1);var ar={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};ar.isVectorType=function(e){switch(e){case ar.VEC2:case ar.VEC3:case ar.VEC4:return!0;default:return!1}};ar.isMatrixType=function(e){switch(e){case ar.MAT2:case ar.MAT3:case ar.MAT4:return!0;default:return!1}};ar.getComponentCount=function(e){switch(e){case ar.SCALAR:case ar.STRING:case ar.ENUM:case ar.BOOLEAN:return 1;case ar.VEC2:return 2;case ar.VEC3:return 3;case ar.VEC4:return 4;case ar.MAT2:return 4;case ar.MAT3:return 9;case ar.MAT4:return 16}};ar.getMathType=function(e){switch(e){case ar.VEC2:return k;case ar.VEC3:return h;case ar.VEC4:return ce;case ar.MAT2:return Ji;case ar.MAT3:return q;case ar.MAT4:return P;default:return}};Object.freeze(ar);var St=ar;function is(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&(e.normalized??!1)&&Nt.isIntegerType(i);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=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=$e(e.min,!0),this._max=$e(e.max,!0),this._normalized=r;let s=$e(e.offset,!0),a=$e(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=$e(e.noData,!0),this._default=$e(e.default,!0),this._required=e.required??!0,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}is.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.property,i=YKe(n),o=wKe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new is({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(is.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 YKe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===St.SCALAR||St.isMatrixType(t)||St.isVectorType(t))return!1;if(l(Nt[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 wKe(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===St.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===St.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===St.SCALAR||St.isMatrixType(n)||St.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===St.BOOLEAN||n===St.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===St.BOOLEAN||i===St.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Nt[i]))return{type:St.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Nt[n]))return{type:St.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}is.prototype.normalize=function(e){return this._normalized?m8(e,this._valueType,Nt.normalize):e};is.prototype.unnormalize=function(e){return this._normalized?m8(e,this._valueType,Nt.unnormalize):e};is.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:is.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};is.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:is.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};is.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=St.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)};is.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!ype(e,t))return e};function I2(e){return Array.isArray(e)&&!(e instanceof Ji)&&!(e instanceof q)&&!(e instanceof P)}function ype(e,t){if(!I2(e))return e===t;if(!I2(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};is.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=St.getMathType(this._type),i=this._isArray,o=St.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};is.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?MKe(this,e):xpe(this,e)};function MKe(e,t){if(!I2(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;i1?ppe(e,t,n):void 0}if(eNt.getMaximum(t))return ppe(e,t,n)}function gpe(e,t){return`value ${e} of type ${t} must be finite`}function m8(e,t,n){if(!I2(e))return n(e,t);for(let i=0;ie)};var h8=[void 0,"float","vec2","vec3","vec4"],_pe=[void 0,"int","ivec2","ivec3","ivec4"],HKe=[void 0,"uint","uvec2","uvec3","uvec4"],KKe={[nl.FLOAT]:"uintBitsToFloat",[nl.INTEGER]:"int",[nl.UNSIGNED_INTEGER]:""};is.prototype.getGlslTypeWebGL1=function(){let e=St.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?h8[e]:_pe[e]};is.prototype.getGlslType=function(){let e=this.valueType,t=St.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Nt.isIntegerType(e)||this.normalized?h8[t]:Nt.isUnsignedIntegerType(e)?HKe[t]:_pe[t]};is.prototype.unpackTextureInShader=function(e,t,n,i){let o=this.getGlslType(),r=Nt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=St.getComponentCount(a)*(this.isArray?this.arrayLength:1),d=Math.floor(s/c),u=`${n}_rawChannels`,m=`${n}_rawBits`,p=`${n}_unpackedValue`,b=`${o} ${p};`,f=`uint ${m};`;i.push(b),i.push(f);let y=`${h8[s]} ${u} = ${e};`;i.push(y);let _=KKe[Nt.category(r)],S=c>1;for(let Z=0;Z1?`.${R}`:"",E=`${m} = czm_unpackTexture(${u}${C});`,A="";S&&(A=`[${Z}]`);let L="",F="";if(this.normalized){let N=Nt.getMaximum(r);L=` * ${1/Number(N)}`,F="float"}let I=`${p}${A} = ${F}(${_}(${m}))${L};`;i.push(E),i.push(I)}return p};is.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Xp=is;function P2(e){e=e??B.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===St.STRING,m=r===St.BOOLEAN,p=0,b;if(a){let g=n.arrayOffsetType??n.offsetType;g=Nt[g]??Nt.UINT32;let V=n.arrayOffsets??n.arrayOffsetBufferView;b=new f8(o[V],g,t+1),p+=b.typedArray.byteLength}let f=St.getComponentCount(r),y;a?y=b.get(t)-b.get(0):s?y=t*i.arrayLength:y=t;let _=f*y,S;if(u){let g=n.stringOffsetType??n.offsetType;g=Nt[g]??Nt.UINT32;let V=n.stringOffsets??n.stringOffsetBufferView;S=new f8(o[V],g,_+1),p+=S.typedArray.byteLength}(u||m)&&(c=Nt.UINT8);let Z;u?Z=S.get(_)-S.get(0):m?Z=Math.ceil(_/8):Z=_;let R=n.values??n.bufferView,C=new f8(o[R],c,Z);p+=C.typedArray.byteLength;let E=n.offset,A=n.scale,L=i.hasValueTransform||l(E)||l(A);E=E??i.offset,A=A??i.scale,E=Spe(E),A=Spe(A);let F,I,N=this;u?F=function(g){return QKe(g,N._values,N._stringOffsets)}:m?(F=function(g){return qKe(g,N._values)},I=function(g,V){$Ke(g,N._values,V)}):l(d)?(F=function(g){let V=N._values.get(g);return d.namesByValue[V]},I=function(g,V){let G=d.valuesByName[V];N._values.set(g,G)}):(F=function(g){return N._values.get(g)},I=function(g,V){N._values.set(g,V)}),this._arrayOffsets=b,this._stringOffsets=S,this._values=C,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=E,this._scale=A,this._hasValueTransform=L,this._getValue=F,this._setValue=I,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(P2.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}},classProperty:{get:function(){return this._classProperty}}});P2.prototype.get=function(e){let t=JKe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=aJe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};P2.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=cJe(this,t),t=n.unnormalize(t),jKe(this,e,t)};P2.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Spe(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function $Ke(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<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 tJe(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)<96?x-97:x>64?x-39:x+4}for(var S=0,g=0;g=3),l(n.exports.meshopt_spatialSortRemap,y,y.length/h,h*4)},encodeVertexBuffer:function(y,h,g){r(g>0&&g<=256),r(g%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(h,g);return d(n.exports.meshopt_encodeVertexBuffer,x,y,h,g)},encodeIndexBuffer:function(y,h,g){r(g==2||g==4),r(h%3==0);var x=f(y,g),S=n.exports.meshopt_encodeIndexBufferBound(h,u(x)+1);return d(n.exports.meshopt_encodeIndexBuffer,S,x,h,4)},encodeIndexSequence:function(y,h,g){r(g==2||g==4);var x=f(y,g),S=n.exports.meshopt_encodeIndexSequenceBound(h,u(x)+1);return d(n.exports.meshopt_encodeIndexSequence,S,x,h,4)},encodeGltfBuffer:function(y,h,g,x){var S={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(S[x]),S[x](y,h,g)},encodeFilterOct:function(y,h,g,x){return r(g==4||g==8),r(x>=1&&x<=16),p(n.exports.meshopt_encodeFilterOct,y,h,g,x,16)},encodeFilterQuat:function(y,h,g,x){return r(g==8),r(x>=4&&x<=16),p(n.exports.meshopt_encodeFilterQuat,y,h,g,x,16)},encodeFilterExp:function(y,h,g,x,S){r(g>0&&g%4==0),r(x>=1&&x<=24);var V={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,y,h,g,x,g,S?V[S]:1)}}}();var xmn=_(T()),tre=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(S){r=S.instance,r.exports.__wasm_call_ctors()});function a(S){for(var V=new Uint8Array(S.length),Z=0;Z96?R-97:R>64?R-39:R+4}for(var E=0,Z=0;Z0?g(S,V,Z,u[R],d[E]):s.then(function(){var I=new Uint8Array(S*V);return l(r,r.exports[u[R]],I,S,V,Z,r.exports[d[E]]),I})}}}();var Smn=_(T()),_mn=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;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgR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aaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadal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KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz: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(h){n=h.instance,n.exports.__wasm_call_ctors()});function o(h){for(var g=new Uint8Array(h.length),x=0;x96?S-97:S>64?S-39:S+4}for(var V=0,x=0;x=3),r(S>=0&&S<=h.length),r(S%3==0),r(V>=0);for(var R=0,E=0;E<(Z?Z.length:0);++E)r(Z[E]in y),r(this.useExperimentalFeatures||Z[E]!="Prune"),R|=y[Z[E]];var I=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h),v=d(n.exports.meshopt_simplify,I,h.length,g,g.length/x,x*4,S,V,R);return v[0]=h instanceof Uint32Array?v[0]:new h.constructor(v[0]),v},simplifyWithAttributes:function(h,g,x,S,V,Z,R,E,I,v){r(this.useExperimentalFeatures),r(h instanceof Uint32Array||h instanceof Int32Array||h instanceof Uint16Array||h instanceof Int16Array),r(h.length%3==0),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length%V==0),r(V>=0),r(R==null||R instanceof Uint8Array),r(R==null||R.length==g.length/x),r(E>=0&&E<=h.length),r(E%3==0),r(I>=0),r(Array.isArray(Z)),r(V>=Z.length),r(Z.length<=32);for(var P=0;P=0);for(var F=0,P=0;P<(v?v.length:0);++P)r(v[P]in y),F|=y[v[P]];var N=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h),b=u(n.exports.meshopt_simplifyWithAttributes,N,h.length,g,g.length/x,x*4,S,V*4,new Float32Array(Z),R?new Uint8Array(R):null,E,I,F);return b[0]=h instanceof Uint32Array?b[0]:new h.constructor(b[0]),b},getScale:function(h,g){return r(h instanceof Float32Array),r(h.length%g==0),r(g>=3),f(n.exports.meshopt_simplifyScale,h,h.length/g,g*4)},simplifyPoints:function(h,g,x,S,V,Z){return r(this.useExperimentalFeatures),r(h instanceof Float32Array),r(h.length%g==0),r(g>=3),r(x>=0&&x<=h.length/g),S?(r(S instanceof Float32Array),r(S.length%V==0),r(V>=3),r(h.length/g==S.length/V),p(n.exports.meshopt_simplifyPoints,h,h.length/g,g*4,S,V*4,Z,x)):p(n.exports.meshopt_simplifyPoints,h,h.length/g,g*4,void 0,0,0,x)}}}();var Lmn=_(T()),Cmn=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh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bbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz: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(h){n=h.instance,n.exports.__wasm_call_ctors()});function o(h){for(var g=new Uint8Array(h.length),x=0;x96?S-97:S>64?S-39:S+4}for(var V=0,x=0;x=3),r(S<=255||S>0),r(V<=512),r(V%4==0),Z=Z||0;var R=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return u(R,g,g.length/x,x*4,S,V,Z)},computeClusterBounds:function(h,g,x){r(h.length%3==0),r(h.length/3<=512),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3);var S=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return y(S,g,g.length/x,x*4)},computeMeshletBounds:function(h,g,x){return r(h.meshletCount!=0),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3),p(h,g,g.length/x,x*4)},extractMeshlet:function(h,g){return r(g>=0&&g{Mr._error=t}),Mr._decoderTaskProcessor=e}return Mr._decoderTaskProcessor};Mr.decodePointCloud=function(e){let t=Mr._getDecoderTaskProcessor();if(c(Mr._error))throw Mr._error;if(Mr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Mr.decodeBufferView=function(e){let t=Mr._getDecoderTaskProcessor();if(c(Mr._error))throw Mr._error;if(Mr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var eb=Mr;var jmn=_(T(),1);var si={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function s9e(e){switch(e){case si.POSITION:return"positionMC";case si.NORMAL:return"normalMC";case si.TANGENT:return"tangentMC";case si.TEXCOORD:return"texCoord";case si.COLOR:return"color";case si.JOINTS:return"joints";case si.WEIGHTS:return"weights";case si.FEATURE_ID:return"featureId";default:throw new L("semantic is not a valid value.")}}si.hasSetIndex=function(e){switch(C.typeOf.string("semantic",e),e){case si.POSITION:case si.NORMAL:case si.TANGENT:return!1;case si.TEXCOORD:case si.COLOR:case si.JOINTS:case si.WEIGHTS:case si.FEATURE_ID:return!0;default:throw new L("semantic is not a valid value.")}};si.fromGltfSemantic=function(e){C.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return si.POSITION;case"NORMAL":return si.NORMAL;case"TANGENT":return si.TANGENT;case"TEXCOORD":return si.TEXCOORD;case"COLOR":return si.COLOR;case"JOINTS":return si.JOINTS;case"WEIGHTS":return si.WEIGHTS;case"_FEATURE_ID":return si.FEATURE_ID}};si.fromPntsSemantic=function(e){switch(C.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return si.POSITION;case"RGBA":case"RGB":case"RGB565":return si.COLOR;case"NORMAL":case"NORMAL_OCT16P":return si.NORMAL;case"BATCH_ID":return si.FEATURE_ID;default:throw new L("pntsSemantic is not a valid value.")}};si.getGlslType=function(e){switch(C.typeOf.string("semantic",e),e){case si.POSITION:case si.NORMAL:case si.TANGENT:return"vec3";case si.TEXCOORD:return"vec2";case si.COLOR:return"vec4";case si.JOINTS:return"ivec4";case si.WEIGHTS:return"vec4";case si.FEATURE_ID:return"int";default:throw new L("semantic is not a valid value.")}};si.getVariableName=function(e,t){C.typeOf.string("semantic",e);let n=s9e(e);return c(t)&&(n+=`_${t}`),n};var pt=Object.freeze(si);function dy(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.object("options.primitive",i),C.typeOf.object("options.draco",o),C.typeOf.object("options.gltfResource",r),C.typeOf.object("options.baseResource",s),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=xt.UNLOADED,this._promise=void 0,this._dracoError=void 0}c(Object.create)&&(dy.prototype=Object.create(Ji.prototype),dy.prototype.constructor=dy);Object.defineProperties(dy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function a9e(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=xt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;nre(e,n)}}dy.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,this._promise=a9e(this),this._promise)};function nre(e,t){throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load Draco",t)}async function c9e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=xt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var c_={};c_[pt.POSITION]="POSITION";c_[pt.NORMAL]="NORMAL";c_[pt.COLOR]="COLOR";c_[pt.TEXCOORD]="TEX_COORD";function l9e(e){for(let t in c_)if(c_.hasOwnProperty(t)&&e.startsWith(t))return c_[t]}dy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.PROCESSING||(c(this._dracoError)&&nre(this,this._dracoError),!c(this._bufferViewTypedArray))||c(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,l=[];for(let f in n.attributes)if(n.attributes.hasOwnProperty(f)){let p=l9e(f);c(p)&&i.accessors[n.attributes[f]].componentType===q.FLOAT&&(l.includes(p)||l.push(p))}let d={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:l},u=eb.decodeBufferView(d);if(!c(u))return!1;this._decodePromise=c9e(this,u)};dy.prototype.unload=function(){c(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 IC=dy;var Sfn=_(T(),1);var mfn=_(T(),1);function d9e(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1;C.typeOf.object("uint8Array",t),C.typeOf.string("format",n);let s=new Blob([t],{type:n}),a;return Ge.supportsImageBitmapOptions().then(function(l){return l?Promise.resolve(Ge.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ge({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(l){return c(a)&&window.URL.revokeObjectURL(a),l}).catch(function(l){return c(a)&&window.URL.revokeObjectURL(a),Promise.reject(l)})}var l_=d9e;function tb(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.number("options.imageId",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r);let a=n.images[i],l=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=l,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(tb.prototype=Object.create(Ji.prototype),tb.prototype.constructor=tb);Object.defineProperties(tb.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});tb.prototype.load=function(){return c(this._promise)?this._promise:c(this._bufferViewId)?(this._promise=u9e(this),this._promise):(this._promise=m9e(this),this._promise)};function ire(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 u9e(e){e._state=xt.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 h9e(i);if(e.isDestroyed())return;let r=ire(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=xt.READY,e}catch(n){return e.isDestroyed()?void 0:ore(e,n,"Failed to load embedded image")}}async function m9e(e){e._state=xt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await b9e(i);if(e.isDestroyed())return;let r=ire(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=xt.READY,e}catch(o){return e.isDestroyed()?void 0:ore(e,o,`Failed to load image: ${n}`)}}function ore(e,t,n){return e.unload(),e._state=xt.FAILED,Promise.reject(e.getError(n,t))}function f9e(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 le("Image format is not recognized")}async function h9e(e){let t=f9e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ll(n)}return tb._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var p9e=/(^data:image\/ktx2)|(\.ktx2$)/i;function b9e(e){let t=e.getUrlComponent(!1,!0);return p9e.test(t)?Ll(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}tb.prototype.unload=function(){c(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};tb._loadImageFromTypedArray=l_;var WC=tb;var Mfn=_(T(),1);var Vfn=_(T(),1),y9e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},fa=Object.freeze(y9e);function uy(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,l=e.cacheKey,d=e.asynchronous??!0,u=e.loadBuffer??!1,f=e.loadTypedArray??!1;if(C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.number("options.accessorId",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r),!u&&!f)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let 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=l,this._asynchronous=d,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(uy.prototype=Object.create(Ji.prototype),uy.prototype.constructor=uy);Object.defineProperties(uy.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 g9e=new FH;uy.prototype.load=async function(){return c(this._promise)?this._promise:c(this._draco)?(this._promise=x9e(this),this._promise):(this._promise=_9e(this),this._promise)};async function x9e(e){e._state=xt.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=xt.LOADED,e)}catch(n){if(e.isDestroyed())return;vH(e,n)}}async function _9e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=xt.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=T9e(e,a),e._state=xt.PROCESSING,e}catch(s){if(e.isDestroyed())return;vH(e,s)}}function T9e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Me.getSizeInBytes(s),l=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let f=r*a,p=new Uint8Array(l,d,f);l=new Uint8Array(p).buffer,d=0,Cs("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Me.UNSIGNED_BYTE?u=new Uint8Array(l,d,r):s===Me.UNSIGNED_SHORT?u=new Uint16Array(l,d,r):s===Me.UNSIGNED_INT&&(u=new Uint32Array(l,d,r)),u}function vH(e,t){throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load index buffer",t)}function FH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}FH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};FH.prototype.execute=function(){this.buffer=rre(this.typedArray,this.indexDatatype,this.context)};function rre(e,t,n){let i=_t.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}uy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.LOADED&&this._state!==xt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(c(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){vH(this,o)}if(!c(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=g9e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,fa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=rre(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=xt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};uy.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 wC=uy;var Dbn=_(T(),1);var chn=_(T(),1);var kfn=_(T(),1);function S9e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Vs=S9e;var zfn=_(T(),1);var Dfn=_(T(),1);function C9e(e,t){return c(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var ur=C9e;function Qt(){}Qt.objectLegacy=function(e,t){if(c(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}}};Qt.object=function(e,t){if(c(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return q.getSizeInBytes(t.componentType)*Sd(t.type)}var Pl=L9e;function Z9e(e){we.accessor(e,function(n){c(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),we.bufferView(e,function(n){c(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),we.mesh(e,function(n){we.meshPrimitive(n,function(i){if(i.mode=i.mode??oe.TRIANGLES,!c(i.material)){c(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Vs(e.materials,o)}})}),we.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,c(o)){let r=e.bufferViews[o];r.byteStride=Pl(e,i),r.target=oe.ARRAY_BUFFER}}),we.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(c(o)){let r=e.bufferViews[o];r.target=oe.ELEMENT_ARRAY_BUFFER}}),we.material(e,function(n){let i=n.extensions??z.EMPTY_OBJECT,o=i.KHR_materials_common;if(c(o)){let l=o.technique,d=c(o.values)?o.values:{};o.values=d,d.ambient=c(d.ambient)?d.ambient:[0,0,0,1],d.emission=c(d.emission)?d.emission:[0,0,0,1],d.transparency=d.transparency??1,l!=="CONSTANT"&&(d.diffuse=c(d.diffuse)?d.diffuse:[0,0,0,1],l!=="LAMBERT"&&(d.specular=c(d.specular)?d.specular:[0,0,0,1],d.shininess=d.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;c(r)&&we.materialValue(n,function(l){c(l.index)&&d_(l)}),d_(n.emissiveTexture),d_(n.normalTexture),d_(n.occlusionTexture);let s=n.pbrMetallicRoughness;c(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,d_(s.baseColorTexture),d_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;c(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,d_(a.specularGlossinessTexture))}),we.animation(e,function(n){we.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=R9e(e);return we.node(e,function(n,i){c(t[i])||c(n.translation)||c(n.rotation)||c(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=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=n.wrapS??oe.REPEAT,n.wrapT=n.wrapT??oe.REPEAT}),c(e.scenes)&&!c(e.scene)&&(e.scene=0),e}function R9e(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 d_(e){c(e)&&(e.texCoord=e.texCoord??0)}var zX=Z9e;var mhn=_(T(),1);function G9e(e){return we.shader(e,function(t){v5(t)}),we.buffer(e,function(t){v5(t)}),we.image(e,function(t){v5(t)}),v5(e),e}function v5(e){e.extras=c(e.extras)?e.extras:{},e.extras._pipeline=c(e.extras._pipeline)?e.extras._pipeline:{}}var my=G9e;var Rhn=_(T(),1);var xhn=_(T(),1);var phn=_(T(),1);function E9e(e,t){let n=e.extensionsRequired;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var KX=E9e;function X9e(e,t){let n=e.extensionsUsed;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),KX(e,t),n.length===0&&delete e.extensionsUsed}}var u_=X9e;var I9e=4;function W9e(e){if(Hm(e)!=="glTF")throw new le("File is not valid binary glTF");let n=sre(e,0,5),i=n[1];if(i!==1&&i!==2)throw new le("Binary glTF version is not 1 or 2");return i===1?w9e(e,n):P9e(e,n)}function sre(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let f=u.binary_glTF??u.KHR_binary_glTF;c(f)&&(f.extras._pipeline.source=d,delete f.uri)}return u_(l,"KHR_binary_glTF"),l}function P9e(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var JX=W9e;var Ihn=_(T(),1);function v9e(e){return we.shader(e,function(t){F5(t)}),we.buffer(e,function(t){F5(t)}),we.image(e,function(t){F5(t)}),F5(e),e}function F5(e){c(e.extras)&&(c(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var QX=v9e;var dbn=_(T(),1);var vhn=_(T(),1);function F9e(e,t){let n=e.extensionsUsed;c(n)||(n=[],e.extensionsUsed=n),Vs(n,t,!0)}var wu=F9e;var Yhn=_(T(),1);var Mhn=_(T(),1);function A9e(e){switch(e){case q.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var U9e=[oe.ZERO,oe.ONE,oe.SRC_COLOR,oe.ONE_MINUS_SRC_COLOR,oe.SRC_ALPHA,oe.ONE_MINUS_SRC_ALPHA,oe.DST_ALPHA,oe.ONE_MINUS_DST_ALPHA,oe.DST_COLOR,oe.ONE_MINUS_DST_COLOR];function O9e(e,t){if(!c(e))return t;for(let n=0;n<4;n++)if(U9e.indexOf(e[n])===-1)return t;return e}function D9e(e){let t={},n={},i=e.techniques;return c(i)&&(we.technique(e,function(o,r){let s=o.states;if(c(s)){let a=n[r]={};if(are(s,oe.BLEND)){a.alphaMode="BLEND";let l=s.functions;c(l)&&(c(l.blendEquationSeparate)||c(l.blendFuncSeparate))&&(t[r]={blendEquation:l.blendEquationSeparate??N9e,blendFactors:O9e(l.blendFuncSeparate,k9e)})}are(s,oe.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(c(e.extensions)||(e.extensions={}),wu(e,"KHR_blend")),we.material(e,function(o){if(c(o.technique)){let r=n[o.technique];we.objectLegacy(r,function(a,l){o[l]=a});let s=t[o.technique];c(s)&&(c(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var jX=D9e;var lpn=_(T(),1);var npn=_(T(),1);function B9e(e,t){let n=e.extensionsRequired;c(n)||(n=[],e.extensionsRequired=n),Vs(n,t,!0),wu(e,t)}var qX=B9e;function Y9e(e){let t=e.techniques,n={},i={},o={};if(c(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,we.technique(e,function(a,l){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(we.techniqueAttribute(a,function(f,p){u=a.parameters[f],d.attributes[p]={semantic:u.semantic}}),we.techniqueUniform(a,function(f,p){u=a.parameters[f],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},c(n[l])||(n[l]={}),n[l][f]=p}),c(o[a.program]))d.program=o[a.program];else{let f=e.programs[a.program],p={name:f.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},y=e.shaders[f.fragmentShader];p.fragmentShader=Vs(r.shaders,y,!0);let h=e.shaders[f.vertexShader];p.vertexShader=Vs(r.shaders,h,!0),d.program=Vs(r.programs,p),o[a.program]=d.program}i[l]=Vs(r.techniques,d)}),r.techniques.length>0&&(c(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,wu(e,"KHR_techniques_webgl"),qX(e,"KHR_techniques_webgl"))}return we.material(e,function(r){if(c(r.technique)){let s={technique:i[r.technique]};we.objectLegacy(r.values,function(a,l){c(s.values)||(s.values={});let d=n[r.technique][l];c(d)&&(s.values[d]=a)}),c(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 $X=Y9e;var _pn=_(T(),1);var hpn=_(T(),1);function H9e(e,t){C.typeOf.object("material",e),C.defined("handler",t);let n=e.pbrMetallicRoughness;if(c(n)){if(c(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(c(s))return s}if(c(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(c(s))return s}}let{extensions:i}=e;if(c(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(c(r)){if(c(r.diffuseTexture)){let l=r.diffuseTexture,d=t(l.index,l);if(c(d))return d}if(c(r.specularGlossinessTexture)){let l=r.specularGlossinessTexture,d=t(l.index,l);if(c(d))return d}}let s=i.KHR_materials_specular;if(c(s)){let{specularTexture:l,specularColorTexture:d}=s;if(c(l)){let u=t(l.index,l);if(c(u))return u}if(c(d)){let u=t(d.index,d);if(c(u))return u}}let a=i.KHR_materials_common;if(c(a)&&c(a.values)){let{diffuse:l,ambient:d,emission:u,specular:f}=a.values;if(c(l)&&c(l.index)){let p=t(l.index,l);if(c(p))return p}if(c(d)&&c(d.index)){let p=t(d.index,d);if(c(p))return p}if(c(u)&&c(u.index)){let p=t(u.index,u);if(c(p))return p}if(c(f)&&c(f.index)){let p=t(f.index,f);if(c(p))return p}}}let o=we.materialValue(e,function(r){if(c(r.index)){let s=t(r.index,r);if(c(s))return s}});if(c(o))return o;if(c(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(c(s))return s}if(c(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(c(s))return s}if(c(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(c(s))return s}}var PC=H9e;var cre=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function z9e(e,t){return t=t??cre,cre.forEach(function(n){t.indexOf(n)>-1&&J9e(e,n)}),e}var K9e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function J9e(e,t){let n=K9e[t],i=e[n];if(c(i)){let o=0,r=_h[t](e),s=i.length;for(let a=0;at&&o.attributes[l]--}),we.meshPrimitiveTarget(o,function(a){we.meshPrimitiveTargetAttribute(a,function(l,d){l>t&&a[d]--})});let r=o.indices;c(r)&&r>t&&o.indices--;let s=o.extensions;c(s)&&c(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),we.skin(e,function(i){c(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),we.animation(e,function(i){we.animationSampler(i,function(o){c(o.input)&&o.input>t&&o.input--,c(o.output)&&o.output>t&&o.output--})})};xh.buffer=function(e,t){e.buffers.splice(t,1),we.bufferView(e,function(i){c(i.buffer)&&i.buffer>t&&i.buffer--,c(i.extensions)&&c(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};xh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),we.accessor(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.shader(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.image(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ur(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){c(o.extensions)&&c(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),ur(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(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let d=a[l];c(d.bufferView)&&d.bufferView>t&&d.bufferView--,c(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,c(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(ur(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(c(o)){let r=o.length;for(let s=0;st&&u.values--,c(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,c(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};xh.image=function(e,t){e.images.splice(t,1),we.texture(e,function(i){c(i.source)&&i.source>t&&--i.source;let o=i.extensions;c(o)&&c(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:c(o)&&c(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};xh.mesh=function(e,t){e.meshes.splice(t,1),we.node(e,function(i){c(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};xh.node=function(e,t){e.nodes.splice(t,1),we.skin(e,function(i){c(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){c(o.target)&&c(o.target.node)&&o.target.node>t&&o.target.node--})}),we.technique(e,function(i){we.techniqueUniform(i,function(o){c(o.node)&&o.node>t&&o.node--})}),we.node(e,function(i){c(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})})};xh.material=function(e,t){e.materials.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){c(o.material)&&o.material>t&&o.material--})})};xh.sampler=function(e,t){e.samplers.splice(t,1),we.texture(e,function(i){c(i.sampler)&&i.sampler>t&&--i.sampler})};xh.texture=function(e,t){if(e.textures.splice(t,1),we.material(e,function(i){PC(i,function(o,r){r.index>t&&--r.index})}),ur(e,"EXT_feature_metadata")){we.mesh(e,function(r){we.meshPrimitive(r,function(s){let a=s.extensions;if(c(a)&&c(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(c(d)){let u=d.length;for(let f=0;ft&&--y.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let u=a[l].texture;u.index>t&&--u.index}}}}if(ur(e,"EXT_mesh_features")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){let r=o.extensions;if(c(r)&&c(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(c(a)){let l=a.length;for(let d=0;dt&&--u.texture.index}}}})}),ur(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(c(o)){let r=o.length;for(let s=0;st&&--u.index}}}}};function _h(){}_h.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;c(o)&&(t[o]=!0)})}),we.skin(e,function(n){c(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),we.animation(e,function(n){we.animationSampler(n,function(i){c(i.input)&&(t[i.input]=!0),c(i.output)&&(t[i.output]=!0)})}),ur(e,"EXT_mesh_gpu_instancing")&&we.node(e,function(n){c(n.extensions)&&c(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})}),ur(e,"CESIUM_primitive_outline")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;c(s)&&(t[s]=!0)}})}),t};_h.buffer=function(e){let t={};return we.bufferView(e,function(n){c(n.buffer)&&(t[n.buffer]=!0),c(n.extensions)&&c(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};_h.bufferView=function(e){let t={};if(we.accessor(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),we.shader(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),we.image(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),ur(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){c(i.extensions)&&c(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ur(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(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a];c(l.bufferView)&&(t[l.bufferView]=!0),c(l.arrayOffsetBufferView)&&(t[l.arrayOffsetBufferView]=!0),c(l.stringOffsetBufferView)&&(t[l.stringOffsetBufferView]=!0)}}}}if(ur(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(c(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function lre(e,t,n){let i=e.nodes[t];return c(i.mesh)||c(i.camera)||c(i.skin)||c(i.weights)||c(i.extras)||c(i.extensions)&&Object.keys(i.extensions).length!==0||c(n[t])?!1:!c(i.children)||i.children.filter(function(o){return!lre(e,o,n)}).length===0}_h.node=function(e){let t={};return we.skin(e,function(n){c(n.skeleton)&&(t[n.skeleton]=!0),we.skinJoint(n,function(i){t[i]=!0})}),we.animation(e,function(n){we.animationChannel(n,function(i){c(i.target)&&c(i.target.node)&&(t[i.target.node]=!0)})}),we.technique(e,function(n){we.techniqueUniform(n,function(i){c(i.node)&&(t[i.node]=!0)})}),we.node(e,function(n,i){lre(e,i,t)||(t[i]=!0)}),t};_h.material=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){c(i.material)&&(t[i.material]=!0)})}),t};_h.texture=function(e){let t={};if(we.material(e,function(n){PC(n,function(i){t[i]=!0})}),ur(e,"EXT_feature_metadata")){we.mesh(e,function(o){we.meshPrimitive(o,function(r){let s=r.extensions;if(c(s)&&c(s.EXT_feature_metadata)){let l=s.EXT_feature_metadata.featureIdTextures;if(c(l)){let d=l.length;for(let u=0;u0)for(s.mesh=n.meshes[l[0]],t=1;t0&&c(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[l[0]]}delete s.skeletons}c(s.jointName)&&delete s.jointName}),we.skin(e,function(s){c(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(c(a)){let l=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),l=r.substring(s));let d,u=gMe[a];c(u)?(d=u+l,t[r]=d):c(yMe[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];c(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),we.technique(e,function(n){we.techniqueParameter(n,function(i){let o=t[i.semantic];c(o)&&(i.semantic=o)})})}function _Me(e){we.camera(e,function(t){let n=t.perspective;if(c(n)){let i=n.aspectRatio;c(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;c(o)&&o===0&&(n.yfov=1)}})}function NH(e,t){return c(t.byteStride)&&t.byteStride!==0?t.byteStride:Pl(e,t)}function TMe(e){we.buffer(e,function(t){c(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),we.accessor(e,function(t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n],o=NH(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function SMe(e){let t,n,i,o=e.bufferViews,r={};we.accessorContainingVertexAttributeData(e,function(a){let l=e.accessors[a];c(l.bufferView)&&(r[l.bufferView]=!0)});let s={};we.accessor(e,function(a){c(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let l=s[a];l.sort(function(p,y){return p.byteOffset-y.byteOffset});let d=0,u=0,f=l.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),we.node(e,function(n,i){if(c(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),fre(n)&&hre(e,i))}}),delete e.nodes[t]}function VMe(e){return we.node(e,function(t,n){fre(t)&&hre(e,n)}),e}function LMe(e){we.animation(e,function(t){we.animationSampler(t,function(n){let i=e.accessors[n.input];if(!c(i.min)||!c(i.max)){let o=m_(e,i);i.min=o.min,i.max=o.max}})})}function ZMe(e){we.accessor(e,function(t){if(c(t.min)||c(t.max)){let n=m_(e,t);c(t.min)&&(t.min=n.min),c(t.max)&&(t.max=n.max)}})}function RMe(e){e.asset=e.asset??{},e.asset.version="2.0",mre(e),aMe(e),VMe(e),cMe(e),lMe(e),uMe(e),fMe(e),TMe(e),SMe(e),CMe(e),LMe(e),ZMe(e),hMe(e),pMe(e),bMe(e),xMe(e),iI(e),_Me(e),jX(e),$X(e),dMe(e)}var GMe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],EMe=["u_diffuse","u_diffuse_mat"];function kH(e){e.pbrMetallicRoughness=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function UH(e){return c(e.index)}function OH(e){return Array.isArray(e)&&e.length===4}function pre(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 XMe(e,t){t=t??z.EMPTY_OBJECT;let n=t.baseColorTextureNames??GMe,i=t.baseColorFactorNames??EMe;we.material(e,function(o){we.materialValue(o,function(r,s){n.indexOf(s)!==-1&&UH(r)?(kH(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&OH(r)&&(kH(o),o.pbrMetallicRoughness.baseColorFactor=pre(r))})}),f_(e,"KHR_techniques_webgl"),f_(e,"KHR_blend")}function MH(e,t){c(t)&&(OH(t)?e.pbrMetallicRoughness.baseColorFactor=pre(t):UH(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function ure(e,t){c(t)&&(OH(t)?e.emissiveFactor=t.slice(0,3):UH(t)&&(e.emissiveTexture=t))}function IMe(e){we.material(e,function(t){let n=(t.extensions??z.EMPTY_OBJECT).KHR_materials_common;if(!c(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,l=n.doubleSided,d=n.transparent;kH(t),n.technique==="CONSTANT"?(wu(e,"KHR_materials_unlit"),t.extensions=c(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},MH(t,s),MH(t,o)):(MH(t,r),ure(t,o),ure(t,s)),c(l)&&(t.doubleSided=l),c(a)&&(c(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),c(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),f_(e,"KHR_materials_common")}var oI=tMe;var Cbn=_(T(),1);function fc(){}fc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;c(n)&&c(n.message)&&(i+=` -${n.message}`);let o=new le(i);return c(n)&&(o.stack=`Original stack: +${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),me(this)}},io=p8;var VEn=x(T(),1),Vpe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(Vpe);var Rt=Vpe;var pO=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,o=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=o,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=dJe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function dJe(e){let t=e._resource;e._state=Rt.LOADING;try{let n=await pO._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Rt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Rt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var z_=pO;var dAn=x(T(),1);var PEn=x(T(),1);function uJe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var Jy=uJe;var QEn=x(T(),1);var YEn=x(T(),1),XEn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo: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;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb: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:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(b){n=b.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function o(b){for(var f=new Uint8Array(b.length),y=0;y96?_-97:_>64?_-39:_+4}for(var S=0,y=0;y=3),c(n.exports.meshopt_spatialSortRemap,b,b.length/f,f*4)},encodeVertexBuffer:function(b,f,y){r(y>0&&y<=256),r(y%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBuffer,_,b,f,y)},encodeVertexBufferLevel:function(b,f,y,_,S){r(y>0&&y<=256),r(y%4==0),r(_>=0&&_<=3),r(S===void 0||S==0||S==1);var Z=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBufferLevel,Z,b,f,y,_,S===void 0?-1:S)},encodeIndexBuffer:function(b,f,y){r(y==2||y==4),r(f%3==0);var _=m(b,y),S=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,S,_,f,4)},encodeIndexSequence:function(b,f,y){r(y==2||y==4);var _=m(b,y),S=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,S,_,f,4)},encodeGltfBuffer:function(b,f,y,_,S){var Z={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(Z[_]),Z[_](b,f,y,2,S===void 0?0:S)},encodeFilterOct:function(b,f,y,_){return r(y==4||y==8),r(_>=2&&_<=16),p(n.exports.meshopt_encodeFilterOct,b,f,y,_,16)},encodeFilterQuat:function(b,f,y,_){return r(y==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,b,f,y,_,16)},encodeFilterExp:function(b,f,y,_,S){r(y>0&&y%4==0),r(_>=1&&_<=24);var Z={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return r(!S||S in Z),p(n.exports.meshopt_encodeFilterExp,b,f,y,_,y,S?Z[S]:1)},encodeFilterColor:function(b,f,y,_){return r(y==4||y==8),r(_>=2&&_<=16),p(n.exports.meshopt_encodeFilterColor,b,f,y,_,16)}}})();var MEn=x(T(),1),jy=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaoh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cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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(S){r=S.instance,r.exports.__wasm_call_ctors()});function a(S){for(var Z=new Uint8Array(S.length),R=0;R96?C-97:C>64?C-39:C+4}for(var E=0,R=0;R0?y(S,Z,R,u[C],d[E]):s.then(function(){var A=new Uint8Array(S*Z);return c(r,r.exports[u[C]],A,S,Z,R,r.exports[d[E]]),A})}}})();var DEn=x(T(),1),kEn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:H:cjbHjjjjbbh8Masc:Cefasyd;8egHcdtfa8MBdbasaHcefBd;8ea8Mcbaez:tjjjb8AkdnadTmbcbhKabhHina8NaHclfydbg8Fcx2fgeIdba8NaHydbgacx2fgAIdbg8S:tgRa8NaHcwfydbghcx2fgXIdlaAIdlg8U:tg8VNaeIdla8U:tg8WaXIdba8S:tg8XN:tg8Ya8YNa8WaXIdwaAIdwg8Z:tg80NaeIdwa8Z:tg8Wa8VN:tg81a81Na8W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clfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85Jbbbb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AydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka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fydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86a8XN:tg85a8SaBa8WN:ta8Za8XN:tgB:vg8S:mh8Za86a8Y:vg9c:mhJdnJbbbbaRaRa81:vg9eN:ta86a9cN:ta85a8SN:tg86:la87J:983:g81NgR9ETmba8Za83NaJa8UNa9ea80Nax:tMMa86:vhnka81:laR9ETmba8Y:laR9ETmbaB:laR9ETmba9e:manNa8W:ma8ZanNa83aB:vMgBNa8V:maJanNa8X:maBNa8Ua8Y:vMMg85Na80:ma81:vMMMh87aLa8FfgeclfydbgHaeydbge9RhhaEaecitfh8FJbbbbhRdnaHaeSgDmbJbbbbhRa8FheahhAina8Naeclfydbcx2fgHIdwa88:tg8Va8VNaHIdba8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h8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndna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FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(Z){n=Z.instance,n.exports.__wasm_call_ctors()});function o(Z){for(var R=new Uint8Array(Z.length),C=0;C96?E-97:E>64?E-39:E+4}for(var A=0,C=0;C=3),a(n.exports.meshopt_generatePositionRemap,Z,Z.length/R,R)},simplify:function(Z,R,C,E,A,L){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E>=0&&E<=Z.length),r(E%3==0),r(A>=0);for(var F=0,I=0;I<(L?L.length:0);++I)r(L[I]in S),F|=S[L[I]];var N=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),g=u(n.exports.meshopt_simplify,N,Z.length,R,R.length/C,C*4,E,A,F);return g[0]=Z instanceof Uint32Array?g[0]:new Z.constructor(g[0]),g},simplifyWithAttributes:function(Z,R,C,E,A,L,F,I,N,g){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E instanceof Float32Array),r(E.length==A*(R.length/C)),r(A>=0),r(F==null||F instanceof Uint8Array),r(F==null||F.length==R.length/C),r(I>=0&&I<=Z.length),r(I%3==0),r(N>=0),r(Array.isArray(L)),r(A>=L.length),r(L.length<=32);for(var V=0;V=0);for(var G=0,V=0;V<(g?g.length:0);++V)r(g[V]in S),G|=S[g[V]];var v=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),X=m(n.exports.meshopt_simplifyWithAttributes,v,Z.length,R,R.length/C,C*4,E,A*4,new Float32Array(L),F,I,N,G);return X[0]=Z instanceof Uint32Array?X[0]:new Z.constructor(X[0]),X},simplifyWithUpdate:function(Z,R,C,E,A,L,F,I,N,g){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E instanceof Float32Array),r(E.length==A*(R.length/C)),r(A>=0),r(F==null||F instanceof Uint8Array),r(F==null||F.length==R.length/C),r(I>=0&&I<=Z.length),r(I%3==0),r(N>=0),r(Array.isArray(L)),r(A>=L.length),r(L.length<=32);for(var V=0;V=0);for(var G=0,V=0;V<(g?g.length:0);++V)r(g[V]in S),G|=S[g[V]];var v=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),X=p(n.exports.meshopt_simplifyWithUpdate,v,Z.length,R,R.length/C,C*4,E,A*4,new Float32Array(L),F,I,N,G);if(Z!==v)for(var V=0;V=3),b(n.exports.meshopt_simplifyScale,Z,Z.length/R,R*4)},simplifyPoints:function(Z,R,C,E,A,L){return r(Z instanceof Float32Array),r(Z.length%R==0),r(R>=3),r(C>=0&&C<=Z.length/R),E?(r(E instanceof Float32Array),r(E.length%A==0),r(A>=3),r(Z.length/R==E.length/A),f(n.exports.meshopt_simplifyPoints,Z,Z.length/R,R*4,E,A*4,L||0,C)):f(n.exports.meshopt_simplifyPoints,Z,Z.length/R,R*4,void 0,0,0,C)},simplifySloppy:function(Z,R,C,E,A,L){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E==null||E instanceof Uint8Array),r(E==null||E.length==R.length/C),r(A>=0&&A<=Z.length),r(A%3==0),r(L>=0);var F=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),I=y(n.exports.meshopt_simplifySloppy,F,Z.length,R,R.length/C,C*4,E,A,L);return I[0]=Z instanceof Uint32Array?I[0]:new Z.constructor(I[0]),I},simplifyPrune:function(Z,R,C,E){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E>=0);var A=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),L=_(n.exports.meshopt_simplifyPrune,A,Z.length,R,R.length/C,C*4,E);return L=Z instanceof Uint32Array?L:new Z.constructor(L),L}}})();var zEn=x(T(),1),OEn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbaz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r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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(y){n=y.instance,n.exports.__wasm_call_ctors()});function o(y){for(var _=new Uint8Array(y.length),S=0;S96?Z-97:Z>64?Z-39:Z+4}for(var R=0,S=0;S=3),r(Z>=3&&Z<=256),r(R>=1&&R<=512),C=C||0;var E=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsFlex,E,_,_.length/S,S*4,Z,R,R,C,0)},buildMeshletsFlex:function(y,_,S,Z,R,C,E,A){r(y.length%3==0),r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),r(Z>=3&&Z<=256),r(R>=1&&C<=512),r(R<=C),E=E||0,A=A||0;var L=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsFlex,L,_,_.length/S,S*4,Z,R,C,E,A)},buildMeshletsSpatial:function(y,_,S,Z,R,C,E){r(y.length%3==0),r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),r(Z>=3&&Z<=256),r(R>=1&&C<=512),r(R<=C),E=E||0;var A=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsSpatial,A,_,_.length/S,S*4,Z,R,C,E)},extractMeshlet:function(y,_){return r(_>=0&&_=3);var Z=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return b(Z,_,_.length/S,S*4)},computeMeshletBounds:function(y,_,S){return r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),p(y,_,_.length/S,S*4)},computeSphereBounds:function(y,_,S,Z){return r(y instanceof Float32Array),r(y.length%_==0),r(_>=3),r(!S||S instanceof Float32Array),r(!S||S.length%Z==0),r(!S||Z>=1),r(!S||y.length/_==S.length/Z),Z=Z||0,f(y,y.length/_,_*4,S,Z*4)}}})();var JEn=x(T(),1),HEn=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydb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9hmbkkaYcxfhYa3cxfh3a8Vcifh8Va8Wcefg8WaP9hmbkcbhrinarhzdnaravarcdtfgsydbgHSmbinasavaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkaKarc8W2fgHc3fJbbjZJbbj:;a8AazfRbbceGEg8KUdbaHc8Sfa8KUdbaHa8KUdxarcefgraP9hmbkkaqcdGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",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(d){n=d.instance,n.exports.__wasm_call_ctors()});function o(d){for(var u=new Uint8Array(d.length),m=0;m96?p-97:p>64?p-39:p+4}for(var b=0,m=0;m=3),r(p instanceof Float32Array),r(p.length%b==0),r(b>=3),r(f instanceof Float32Array),r(f.length%y==0),r(y>=2),r(u.length/m==p.length/b),r(u.length/m==f.length/y),r(d!==null||u.length/m%3==0);for(var S=0,Z=0;Z<(_?_.length:0);++Z)r(_[Z]in c),S|=c[_[Z]];var R=u.length/m,C=d?d.length:R,E=d===null||d.BYTES_PER_ELEMENT==4?d:new Uint32Array(d);return a(E,C,u,R,m,p,b,f,y,S)}}})();var b8=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.bufferViewId,r=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[o],d=c.buffer,u=c.byteOffset,m=c.byteLength,p=!1,b,f,y,_,S=Jy(c);l(S)&&(d=S.buffer,u=S.byteOffset??0,m=S.byteLength,p=!0,b=S.byteStride,f=S.count,y=S.mode,_=S.filter??"NONE");let Z=i.buffers[d];this._hasMeshopt=p,this._meshoptByteStride=b,this._meshoptCount=f,this._meshoptMode=y,this._meshoptFilter=_,this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._buffer=Z,this._bufferId=d,this._byteOffset=u,this._byteLength=m,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=mJe(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function mJe(e){try{let t=hJe(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);jy.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Rt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load buffer view",t)}}function hJe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var v1=b8;var AAn=x(T(),1);var bAn=x(T(),1);var H_=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new ae("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};H_._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);H_._decoderTaskProcessor=void 0;H_._taskProcessorReady=!1;H_._error=void 0;var Eb=H_;var xAn=x(T(),1);var Pn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function fJe(e){switch(e){case Pn.POSITION:return"positionMC";case Pn.NORMAL:return"normalMC";case Pn.TANGENT:return"tangentMC";case Pn.TEXCOORD:return"texCoord";case Pn.COLOR:return"color";case Pn.JOINTS:return"joints";case Pn.WEIGHTS:return"weights";case Pn.FEATURE_ID:return"featureId";case Pn.SCALE:return"scale";case Pn.ROTATION:return"rotation";case Pn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Pn.hasSetIndex=function(e){switch(e){case Pn.POSITION:case Pn.NORMAL:case Pn.TANGENT:case Pn.CUMULATIVE_DISTANCE:return!1;case Pn.TEXCOORD:case Pn.COLOR:case Pn.JOINTS:case Pn.WEIGHTS:case Pn.FEATURE_ID:case Pn.SCALE:case Pn.ROTATION:return!0}};Pn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Pn.POSITION;case"NORMAL":return Pn.NORMAL;case"TANGENT":return Pn.TANGENT;case"TEXCOORD":return Pn.TEXCOORD;case"COLOR":return Pn.COLOR;case"JOINTS":return Pn.JOINTS;case"WEIGHTS":return Pn.WEIGHTS;case"_FEATURE_ID":return Pn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Pn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Pn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Pn.CUMULATIVE_DISTANCE}};Pn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Pn.POSITION;case"RGBA":case"RGB":case"RGB565":return Pn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Pn.NORMAL;case"BATCH_ID":return Pn.FEATURE_ID}};Pn.getGlslType=function(e){switch(e){case Pn.POSITION:case Pn.NORMAL:case Pn.TANGENT:return"vec3";case Pn.TEXCOORD:return"vec2";case Pn.COLOR:return"vec4";case Pn.JOINTS:return"ivec4";case Pn.WEIGHTS:return"vec4";case Pn.FEATURE_ID:return"int";case Pn.SCALE:return"vec3";case Pn.ROTATION:return"vec4";case Pn.CUMULATIVE_DISTANCE:return"float";case Pn.OPACITY:return"float"}};Pn.getVariableName=function(e,t){let n=fJe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Pn);var dt=Pn;var g8=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=o,this._draco=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=pJe(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._dracoError)&&Epe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,o=this._gltf,r=o.bufferViews,s=n.bufferView,a=r[s],c=n.attributes,d=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let b=gJe(p);l(b)&&o.accessors[i.attributes[p]].componentType===J.FLOAT&&(d.includes(b)||d.push(b))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:d},m=Eb.decodeBufferView(u);if(!l(m))return!1;this._decodePromise=bJe(this,m)}unload(){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}};async function pJe(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=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Epe(e,n)}}function Epe(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load Draco",t)}async function bJe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var K_={};K_[dt.POSITION]="POSITION";K_[dt.NORMAL]="NORMAL";K_[dt.COLOR]="COLOR";K_[dt.TEXCOORD]="TEX_COORD";function gJe(e){for(let t in K_)if(K_.hasOwnProperty(t)&&e.startsWith(t))return K_[t]}var F1=g8;var kAn=x(T(),1);var vAn=x(T(),1);function yJe(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return ve.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(ve.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new ve({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 Ab=yJe;var N2=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.imageId,r=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[o],d=c.bufferView,u=c.uri;this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._gltf=i,this._bufferViewId=d,this._uri=u,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=xJe(this),this._promise):(this._promise=TJe(this),this._promise)}unload(){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}};function Ape(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 xJe(e){e._state=Rt.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 SJe(i);if(e.isDestroyed())return;let r=Ape(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(n){return e.isDestroyed()?void 0:Gpe(e,n,"Failed to load embedded image")}}async function TJe(e){e._state=Rt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await RJe(i);if(e.isDestroyed())return;let r=Ape(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(o){return e.isDestroyed()?void 0:Gpe(e,o,`Failed to load image: ${n}`)}}function Gpe(e,t,n){return e.unload(),e._state=Rt.FAILED,Promise.reject(e.getError(n,t))}function _Je(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 SJe(e){let t=_Je(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ed(n)}return N2._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var ZJe=/(^data:image\/ktx2)|(\.ktx2$)/i;function RJe(e){let t=e.getUrlComponent(!1,!0);return ZJe.test(t)?Ed(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}N2._loadImageFromTypedArray=Ab;var I1=N2;var tGn=x(T(),1);var DAn=x(T(),1),Lpe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Lpe);var Lc=Lpe;var y8=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.accessorId,r=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,d=t.cacheKey,u=t.asynchronous??!0,m=t.loadBuffer??!1,p=t.loadTypedArray??!1,b=i.accessors[o].componentType;this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._gltf=i,this._accessorId=o,this._indexDatatype=b,this._primitive=a,this._draco=c,this._cacheKey=d,this._asynchronous=u,this._loadBuffer=m,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=VJe(this),this._promise):(this._promise=EJe(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED&&this._state!==Rt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=J.fromTypedArray(n),this._indexDatatype=i)}catch(r){T8(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=CJe;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Lc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=Wpe(n,i,t.context));return this.unload(),this._buffer=o,this._typedArray=this._loadTypedArray?n:void 0,this._state=Rt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.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}},x8=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Wpe(this.typedArray,this.indexDatatype,this.context)}};function Wpe(e,t,n){let i=ot.createIndexBuffer({typedArray:e,context:n,usage:Pe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var CJe=new x8;async function VJe(e){e._state=Rt.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=Rt.LOADED,e)}catch(n){if(e.isDestroyed())return;T8(e,n)}}async function EJe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=Rt.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=AJe(e,a),e._state=Rt.PROCESSING,e}catch(s){if(e.isDestroyed())return;T8(e,s)}}function AJe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Oe.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let m=r*a,p=new Uint8Array(c,d,m);c=new Uint8Array(p).buffer,d=0,Jo("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Oe.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Oe.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Oe.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function T8(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load index buffer",t)}var P1=y8;var ivn=x(T(),1);var RGn=x(T(),1);var iGn=x(T(),1);function GJe(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var pa=GJe;var dGn=x(T(),1);var sGn=x(T(),1);function LJe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Dr=LJe;function sn(){}sn.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}}};sn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return J.getSizeInBytes(t.componentType)*Vu(t.type)}var Xd=vJe;function FJe(e){Me.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Me.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){if(i.mode=i.mode??ie.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=pa(e.materials,o)}})}),Me.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=Xd(e,i),r.target=ie.ARRAY_BUFFER}}),Me.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),Me.material(e,function(n){let i=n.extensions??{},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=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=d.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&Me.materialValue(n,function(c){l(c.index)&&J_(c)}),J_(n.emissiveTexture),J_(n.normalTexture),J_(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,J_(s.baseColorTexture),J_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,J_(a.specularGlossinessTexture))}),Me.animation(e,function(n){Me.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=IJe(e);return Me.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Me.sampler(e,function(n){n.wrapS=n.wrapS??ie.REPEAT,n.wrapT=n.wrapT??ie.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function IJe(e){let t={};return Me.animation(e,function(n){Me.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 J_(e){l(e)&&(e.texCoord=e.texCoord??0)}var Y2=FJe;var AGn=x(T(),1);function PJe(e){return Me.shader(e,function(t){bO(t)}),Me.buffer(e,function(t){bO(t)}),Me.image(e,function(t){bO(t)}),bO(e),e}function bO(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Qy=PJe;var DGn=x(T(),1);var PGn=x(T(),1);var WGn=x(T(),1);function XJe(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 w2=XJe;function NJe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),w2(e,t),n.length===0&&delete e.extensionsUsed}}var j_=NJe;var YJe=4;function wJe(e){if(qh(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=vpe(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?MJe(e,n):kJe(e,n)}function vpe(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let m=u.binary_glTF??u.KHR_binary_glTF;l(m)&&(m.extras._pipeline.source=d,delete m.uri)}return j_(c,"KHR_binary_glTF"),c}function kJe(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var Q_=wJe;var HGn=x(T(),1);function UJe(e){return Me.shader(e,function(t){gO(t)}),Me.buffer(e,function(t){gO(t)}),Me.image(e,function(t){gO(t)}),gO(e),e}function gO(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var M2=UJe;var CWn=x(T(),1);var QGn=x(T(),1);function DJe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),pa(n,t,!0)}var Im=DJe;var aLn=x(T(),1);var eLn=x(T(),1);function OJe(e){switch(e){case J.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var KJe=[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 JJe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(KJe.indexOf(e[n])===-1)return t;return e}function jJe(e){let t={},n={},i=e.techniques;return l(i)&&(Me.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Fpe(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??zJe,blendFactors:JJe(c.blendFuncSeparate,HJe)})}Fpe(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Im(e,"KHR_blend")),Me.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Me.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 k2=jJe;var CLn=x(T(),1);var yLn=x(T(),1);function QJe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),pa(n,t,!0),Im(e,t)}var U2=QJe;function qJe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Me.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(Me.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),Me.techniqueUniform(a,function(m,p){u=a.parameters[m],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][m]=p}),l(o[a.program]))d.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},b=e.shaders[m.fragmentShader];p.fragmentShader=pa(r.shaders,b,!0);let f=e.shaders[m.vertexShader];p.vertexShader=pa(r.shaders,f,!0),d.program=pa(r.programs,p),o[a.program]=d.program}i[c]=pa(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Im(e,"KHR_techniques_webgl"),U2(e,"KHR_techniques_webgl"))}return Me.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Me.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 D2=qJe;var XLn=x(T(),1);var LLn=x(T(),1);function $Je(e,t){Ko.typeOf.object("material",e),Ko.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 d=r.diffuseTexture,u=t(d.index,d);if(l(u))return u}if(l(r.specularGlossinessTexture)){let d=r.specularGlossinessTexture,u=t(d.index,d);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:d,specularColorTexture:u}=s;if(l(d)){let m=t(d.index,d);if(l(m))return m}if(l(u)){let m=t(u.index,u);if(l(m))return m}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let d=a.transmissionTexture,u=t(d.index,d);if(l(u))return u}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:d,ambient:u,emission:m,specular:p}=c.values;if(l(d)&&l(d.index)){let b=t(d.index,d);if(l(b))return b}if(l(u)&&l(u.index)){let b=t(u.index,u);if(l(b))return b}if(l(m)&&l(m.index)){let b=t(m.index,m);if(l(b))return b}if(l(p)&&l(p.index)){let b=t(p.index,p);if(l(b))return b}}}let o=Me.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 X1=$Je;var Ipe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function eje(e,t){return t=t??Ipe,Ipe.forEach(function(n){t.indexOf(n)>-1&&nje(e,n)}),e}var tje={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function nje(e,t){let n=tje[t],i=e[n];if(l(i)){let o=0,r=Yp[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),Me.meshPrimitiveTarget(o,function(a){Me.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})}),Me.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Me.animation(e,function(i){Me.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Np.buffer=function(e,t){e.buffers.splice(t,1),Me.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let o=i.extensions;if(l(o)){let r=o.EXT_meshopt_compression;l(r)&&r.buffer>t&&r.buffer--;let s=o.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};Np.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Me.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Me.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Me.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Dr(e,"KHR_draco_mesh_compression")&&Me.mesh(e,function(i){Me.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--})}),Dr(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(Dr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};Np.image=function(e,t){e.images.splice(t,1),Me.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})};Np.mesh=function(e,t){e.meshes.splice(t,1),Me.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Np.node=function(e,t){e.nodes.splice(t,1),Me.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})}),Me.animation(e,function(i){Me.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Me.technique(e,function(i){Me.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Me.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}))}),Me.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Np.material=function(e,t){e.materials.splice(t,1),Me.mesh(e,function(i){Me.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Np.sampler=function(e,t){e.samplers.splice(t,1),Me.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Np.texture=function(e,t){if(e.textures.splice(t,1),Me.material(e,function(i){X1(i,function(o,r){r.index>t&&--r.index})}),Dr(e,"EXT_feature_metadata")){Me.mesh(e,function(r){Me.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 m=0;mt&&--b.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(Dr(e,"EXT_mesh_features")&&Me.mesh(e,function(i){Me.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;dt&&--u.texture.index}}}})}),Dr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--u.index}}}}};function Yp(){}Yp.accessor=function(e){let t={};return Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){Me.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Me.meshPrimitiveTarget(i,function(r){Me.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Me.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Me.animation(e,function(n){Me.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Dr(e,"EXT_mesh_gpu_instancing")&&Me.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})}),Dr(e,"CESIUM_primitive_outline")&&Me.mesh(e,function(n){Me.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};Yp.buffer=function(e){let t={};return Me.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let o=i.EXT_meshopt_compression;l(o)&&(t[o.buffer]=!0);let r=i.KHR_meshopt_compression;l(r)&&(t[r.buffer]=!0)}}),t};Yp.bufferView=function(e){let t={};if(Me.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Me.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Me.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Dr(e,"KHR_draco_mesh_compression")&&Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Dr(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(Dr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function Ppe(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!Ppe(e,o,n)}).length===0}Yp.node=function(e){let t={};return Me.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Me.skinJoint(n,function(i){t[i]=!0})}),Me.animation(e,function(n){Me.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Me.technique(e,function(n){Me.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Me.node(e,function(n,i){Ppe(e,i,t)||(t[i]=!0)}),t};Yp.material=function(e){let t={};return Me.mesh(e,function(n){Me.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Yp.texture=function(e){let t={};if(Me.material(e,function(n){X1(n,function(i){t[i]=!0})}),Dr(e,"EXT_feature_metadata")){Me.mesh(e,function(o){Me.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;u0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Me.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=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=Cje[a];l(u)?(d=u+c,t[r]=d):l(Rje[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)}})}),Me.technique(e,function(n){Me.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function Eje(e){Me.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 Z8(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Xd(e,t)}function Aje(e){Me.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Me.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=Z8(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function Gje(e){let t,n,i,o=e.bufferViews,r={};Me.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Me.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=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,b){return p.byteOffset-b.byteOffset});let d=0,u=0,m=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Me.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),wpe(n)&&Mpe(e,i))}}),delete e.nodes[t]}function Wje(e){return Me.node(e,function(t,n){wpe(t)&&Mpe(e,n)}),e}function vje(e){Me.animation(e,function(t){Me.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 Fje(e){Me.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 Ije(e){e.asset=e.asset??{},e.asset.version="2.0",Ype(e),fje(e),Wje(e),pje(e),bje(e),yje(e),Tje(e),Aje(e),Gje(e),Lje(e),vje(e),Fje(e),_je(e),Sje(e),Zje(e),Vje(e),H2(e),Eje(e),k2(e),D2(e),gje(e)}var Pje=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Xje=["u_diffuse","u_diffuse_mat"];function R8(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function C8(e){return l(e.index)}function V8(e){return Array.isArray(e)&&e.length===4}function kpe(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 Nje(e,t){t=t??{};let n=t.baseColorTextureNames??Pje,i=t.baseColorFactorNames??Xje;Me.material(e,function(o){Me.materialValue(o,function(r,s){n.indexOf(s)!==-1&&C8(r)?(R8(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&V8(r)&&(R8(o),o.pbrMetallicRoughness.baseColorFactor=kpe(r))})}),$_(e,"KHR_techniques_webgl"),$_(e,"KHR_blend")}function S8(e,t){l(t)&&(V8(t)?e.pbrMetallicRoughness.baseColorFactor=kpe(t):C8(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Npe(e,t){l(t)&&(V8(t)?e.emissiveFactor=t.slice(0,3):C8(t)&&(e.emissiveTexture=t))}function Yje(e){Me.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;R8(t),n.technique==="CONSTANT"?(Im(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},S8(t,s),S8(t,o)):(S8(t,r),Npe(t,o),Npe(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")}),$_(e,"KHR_materials_common")}var K2=cje;var YWn=x(T(),1);function il(){}il.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};fc.getNodeTransform=function(e){return c(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(c(e.translation)?e.translation:m.ZERO,c(e.rotation)?e.rotation:Fe.IDENTITY,c(e.scale)?e.scale:m.ONE)};fc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r=this._contentAvailabilityBitstreams.length)throw new L("contentIndex out of bounds.");return 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===tr.OCTREE&&(t=3),e>>t};ha.fromSubtreeJson=async function(e,t,n,i,o){if(C.typeOf.object("resource",e),c(t)===c(n))throw new L("One of json and subtreeView must be defined.");C.typeOf.object("implicitTileset",i),C.typeOf.object("implicitCoordinates",o);let r=new ha(e,i,o),s;c(t)?s={json:t,binary:void 0}:s=SNe(n);let a=s.json;r._subtreeJson=a;let l;if(ri(a,"3DTILES_metadata"))l=a.extensions["3DTILES_metadata"];else if(c(a.tileMetadata)){let V=a.tileMetadata;l=a.propertyTables[V]}let d=[];if(c(a.contentMetadata)){let V=a.contentMetadata.length;for(let Z=0;Z0;u=u||f;for(let p=0;p>BigInt(61)),d=l%2===0?ZC.encode2D(i,o,r):ZC.encode2D(i,r,o),u=Qp.fromFacePositionLevel(l,BigInt(d),i),f,p;if(c(s)){let y=(a.maximumHeight+a.minimumHeight)/2;f=n<4?a.minimumHeight:y,p=n<4?y:a.maximumHeight}else f=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(u._cellId),minimumHeight:f,maximumHeight:p}}}}var BNe=new m,YNe=new m,QH=new m,HNe=new te;function Xre(e,t,n,i,o){if(C.typeOf.object("rootBox",e),C.typeOf.number("level",t),C.typeOf.number("x",n),C.typeOf.number("y",i),c(o)&&C.typeOf.number("z",o),t===0)return e;let r=m.unpack(e,0,YNe),s=te.unpack(e,3,HNe),a=Math.pow(2,-t),l=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,f=m.fromElements(a,a,1,BNe);c(o)&&(u=-1+(2*o+1)*a,f.z=a);let p=m.fromElements(l,d,u,QH);p=te.multiplyByVector(s,p,QH),p=m.add(p,r,QH);let y=te.clone(s);y=te.multiplyByScale(y,f,y);let h=new Array(12);return m.pack(p,h),te.pack(y,h,3),h}var zNe=new de;function Ire(e,t,n,i,o){if(C.typeOf.object("rootRegion",e),C.typeOf.number("level",t),C.typeOf.number("x",n),C.typeOf.number("y",i),c(o)&&C.typeOf.number("z",o),t===0)return e.slice();let r=de.unpack(e,0,zNe),s=e[4],a=e[5],l=Math.pow(2,-t),d=l*r.width,u=w.negativePiToPi(r.west+n*d),f=w.negativePiToPi(u+d),p=l*r.height,y=w.negativePiToPi(r.south+i*p),h=w.negativePiToPi(y+p),g=s,x=a;if(c(o)){let S=l*(a-s);g+=o*S,x=g+S}return[u,y,f,h,g,x]}function KNe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Gre(i,o,n,!1,t),s=Rre(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,l={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=Wre(e,i.baseResource,l,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function Wre(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}jc.prototype.hasProperty=function(e,t){return!1};jc.prototype.getFeature=function(e){};jc.prototype.applyDebugSettings=function(e,t){};jc.prototype.applyStyle=function(e){};jc.prototype.update=function(e,t){};jc.prototype.pick=function(e,t,n){};jc.prototype.isDestroyed=function(){return!1};jc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),he(this)};jc._deriveBoundingBox=Xre;jc._deriveBoundingRegion=Ire;jc._deriveBoundingVolumeS2=Ere;var kC=jc;var o5n=_(T(),1);var kgn=_(T(),1),JNe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Al=Object.freeze(JNe);var zNn=_(T(),1);var fxn=_(T(),1);var Ygn=_(T(),1);function UC(e,t){C.typeOf.object("normal",e),C.typeOf.number("distance",t),this._distance=t,this._normal=new wre(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(UC.prototype,{distance:{get:function(){return this._distance},set:function(e){C.typeOf.number("value",e),c(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){C.typeOf.object("value",e),c(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});UC.fromPlane=function(e,t){return C.typeOf.object("plane",e),c(t)?(t.normal=e.normal,t.distance=e.distance):t=new UC(e.normal,e.distance),t};UC.clone=function(e,t){return c(t)?(t.normal=e.normal,t.distance=e.distance,t):new UC(e.normal,e.distance)};function wre(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(wre.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){C.typeOf.number("value",e),c(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){C.typeOf.number("value",e),c(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){C.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var x_=UC;function hc(e){e=e??z.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=Y.clone(e.edgeColor??Y.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new ye,this.planeRemoved=new ye,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Mre:Nre,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(c(n)){let i=n.length;for(let o=0;o0&&(r=zt.OUTSIDE);for(let s=0;s80*n){a=1/0,l=1/0;let u=-1/0,f=-1/0;for(let p=n;pu&&(u=y),h>f&&(f=h)}d=Math.max(u-a,f-l),d=d!==0?32767/d:0}return pI(r,s,n,a,l,d,0),s}function Dre(e,t,n,i,o){let r;if(o===p5e(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=Ore(s/i|0,e[s],e[s+1],r);return r&&OC(r,r.next)&&(yI(r),r=r.next),r}function __(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(OC(n,n.next)||Nr(n.prev,n,n.next)===0)){if(yI(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function pI(e,t,n,i,o,r,s){if(!e)return;!s&&r&&l5e(e,i,o,r);let a=e;for(;e.prev!==e.next;){let l=e.prev,d=e.next;if(r?t5e(e,i,o,r):e5e(e)){t.push(l.i,e.i,d.i),yI(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=n5e(__(e),t),pI(e,t,n,i,o,r,2)):s===2&&i5e(e,t,n,i,o,r):pI(__(e),t,n,i,o,r,1);break}}}function e5e(e){let t=e.prev,n=e,i=e.next;if(Nr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,l=n.y,d=i.y,u=Math.min(o,r,s),f=Math.min(a,l,d),p=Math.max(o,r,s),y=Math.max(a,l,d),h=i.next;for(;h!==t;){if(h.x>=u&&h.x<=p&&h.y>=f&&h.y<=y&&hI(o,a,r,l,s,d,h.x,h.y)&&Nr(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function t5e(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Nr(o,r,s)>=0)return!1;let a=o.x,l=r.x,d=s.x,u=o.y,f=r.y,p=s.y,y=Math.min(a,l,d),h=Math.min(u,f,p),g=Math.max(a,l,d),x=Math.max(u,f,p),S=qH(y,h,t,n,i),V=qH(g,x,t,n,i),Z=e.prevZ,R=e.nextZ;for(;Z&&Z.z>=S&&R&&R.z<=V;){if(Z.x>=y&&Z.x<=g&&Z.y>=h&&Z.y<=x&&Z!==o&&Z!==s&&hI(a,u,l,f,d,p,Z.x,Z.y)&&Nr(Z.prev,Z,Z.next)>=0||(Z=Z.prevZ,R.x>=y&&R.x<=g&&R.y>=h&&R.y<=x&&R!==o&&R!==s&&hI(a,u,l,f,d,p,R.x,R.y)&&Nr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;Z&&Z.z>=S;){if(Z.x>=y&&Z.x<=g&&Z.y>=h&&Z.y<=x&&Z!==o&&Z!==s&&hI(a,u,l,f,d,p,Z.x,Z.y)&&Nr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;R&&R.z<=V;){if(R.x>=y&&R.x<=g&&R.y>=h&&R.y<=x&&R!==o&&R!==s&&hI(a,u,l,f,d,p,R.x,R.y)&&Nr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function n5e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!OC(i,o)&&Yre(i,n,n.next,o)&&bI(i,o)&&bI(o,i)&&(t.push(i.i,n.i,o.i),yI(n),yI(n.next),n=e=o),n=n.next}while(n!==e);return __(n)}function i5e(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&m5e(s,a)){let l=Hre(s,a);s=__(s,s.next),l=__(l,l.next),pI(s,t,n,i,o,r,0),pI(l,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function o5e(e,t,n,i){let o=[];for(let r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){let f=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=i&&f>r&&(r=f,s=n.x=n.x&&n.x>=l&&i!==n.x&&Bre(os.x||n.x===s.x&&c5e(s,n)))&&(s=n,u=f)}n=n.next}while(n!==a);return s}function c5e(e,t){return Nr(e.prev,e,t.prev)<0&&Nr(t.next,e,e.next)<0}function l5e(e,t,n,i){let o=e;do o.z===0&&(o.z=qH(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,d5e(o)}function d5e(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;d0||l>0&&s;)a!==0&&(l===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,l--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function qH(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 u5e(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function hI(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Bre(e,t,n,i,o,r,s,a)}function m5e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!f5e(e,t)&&(bI(e,t)&&bI(t,e)&&h5e(e,t)&&(Nr(e.prev,e,t.prev)||Nr(e,t.prev,t))||OC(e,t)&&Nr(e.prev,e,e.next)>0&&Nr(t.prev,t,t.next)>0)}function Nr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function OC(e,t){return e.x===t.x&&e.y===t.y}function Yre(e,t,n,i){let o=H5(Nr(e,t,n)),r=H5(Nr(e,t,i)),s=H5(Nr(n,i,e)),a=H5(Nr(n,i,t));return!!(o!==r&&s!==a||o===0&&Y5(e,n,t)||r===0&&Y5(e,i,t)||s===0&&Y5(n,e,i)||a===0&&Y5(n,t,i))}function Y5(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 H5(e){return e>0?1:e<0?-1:0}function f5e(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&&Yre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function bI(e,t){return Nr(e.prev,e,e.next)<0?Nr(e,t,e.next)>=0&&Nr(e,e.prev,t)>=0:Nr(e,t,e.prev)<0||Nr(e,e.next,t)<0}function h5e(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 Hre(e,t){let n=$H(e.i,e.x,e.y),i=$H(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 Ore(e,t,n,i){let o=$H(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 yI(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 $H(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function p5e(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?qr.COUNTER_CLOCKWISE:qr.CLOCKWISE};gy.triangulate=function(e,t){C.defined("positions",e);let n=D.packArray(e);return ez(n,t,2)};var Qre=new m,jre=new m,qre=new m,zre=new m,Kre=new m,Jre=new m,ib=new m,$re=new D,ese=new D,tse=new D,DC=new D;gy.computeSubdivision=function(e,t,n,i,o){o=o??w.RADIANS_PER_DEGREE;let r=c(i);C.typeOf.object("ellipsoid",e),C.defined("positions",t),C.defined("indices",n),C.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),C.typeOf.number.equals("indices.length % 3","0",n.length%3,0),C.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,d=new Array(l*3),u=new Array(l*2),f=0,p=0;for(a=0;a0;){let Z=s.pop(),R=s.pop(),E=s.pop(),I=m.fromArray(d,E*3,Qre),v=m.fromArray(d,R*3,jre),P=m.fromArray(d,Z*3,qre),F,N,b;r&&(F=D.fromArray(u,E*2,$re),N=D.fromArray(u,R*2,ese),b=D.fromArray(u,Z*2,tse));let G=m.multiplyByScalar(m.normalize(I,zre),g,zre),X=m.multiplyByScalar(m.normalize(v,Kre),g,Kre),W=m.multiplyByScalar(m.normalize(P,Jre),g,Jre),A=m.magnitudeSquared(m.subtract(G,X,ib)),k=m.magnitudeSquared(m.subtract(X,W,ib)),B=m.magnitudeSquared(m.subtract(W,G,ib)),O=Math.max(A,k,B),H,U,K;O>S?A===O?(H=`${Math.min(E,R)} ${Math.max(E,R)}`,a=h[H],c(a)||(U=m.add(I,v,ib),m.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,h[H]=a,r&&(K=D.add(F,N,DC),D.multiplyByScalar(K,.5,K),u.push(K.x,K.y))),s.push(E,a,Z),s.push(a,R,Z)):k===O?(H=`${Math.min(R,Z)} ${Math.max(R,Z)}`,a=h[H],c(a)||(U=m.add(v,P,ib),m.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,h[H]=a,r&&(K=D.add(N,b,DC),D.multiplyByScalar(K,.5,K),u.push(K.x,K.y))),s.push(R,a,E),s.push(a,Z,E)):B===O&&(H=`${Math.min(Z,E)} ${Math.max(Z,E)}`,a=h[H],c(a)||(U=m.add(P,I,ib),m.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,h[H]=a,r&&(K=D.add(b,F,DC),D.multiplyByScalar(K,.5,K),u.push(K.x,K.y))),s.push(Z,a,R),s.push(a,E,R)):(y.push(E),y.push(R),y.push(Z))}let V={attributes:{position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:d})},indices:y,primitiveType:ve.TRIANGLES};return r&&(V.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})),new dt(V)};var g5e=new pe,x5e=new pe,_5e=new pe,tz=new pe;gy.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??w.RADIANS_PER_DEGREE;let r=c(i);C.typeOf.object("ellipsoid",e),C.defined("positions",t),C.defined("indices",n),C.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),C.typeOf.number.equals("indices.length % 3","0",n.length%3,0),C.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,d=new Array(l*3),u=new Array(l*2),f=0,p=0;for(a=0;a0;){let E=s.pop(),I=s.pop(),v=s.pop(),P=m.fromArray(d,v*3,Qre),F=m.fromArray(d,I*3,jre),N=m.fromArray(d,E*3,qre),b,G,X;r&&(b=D.fromArray(u,v*2,$re),G=D.fromArray(u,I*2,ese),X=D.fromArray(u,E*2,tse));let W=e.cartesianToCartographic(P,g5e),A=e.cartesianToCartographic(F,x5e),k=e.cartesianToCartographic(N,_5e);S.setEndPoints(W,A);let B=S.surfaceDistance;V.setEndPoints(A,k);let O=V.surfaceDistance;Z.setEndPoints(k,W);let H=Z.surfaceDistance,U=Math.max(B,O,H),K,Q,ie,j,$;U>x?B===U?(K=`${Math.min(v,I)} ${Math.max(v,I)}`,a=h[K],c(a)||(Q=S.interpolateUsingFraction(.5,tz),ie=(W.height+A.height)*.5,j=m.fromRadians(Q.longitude,Q.latitude,ie,e,ib),d.push(j.x,j.y,j.z),a=d.length/3-1,h[K]=a,r&&($=D.add(b,G,DC),D.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(v,a,E),s.push(a,I,E)):O===U?(K=`${Math.min(I,E)} ${Math.max(I,E)}`,a=h[K],c(a)||(Q=V.interpolateUsingFraction(.5,tz),ie=(A.height+k.height)*.5,j=m.fromRadians(Q.longitude,Q.latitude,ie,e,ib),d.push(j.x,j.y,j.z),a=d.length/3-1,h[K]=a,r&&($=D.add(G,X,DC),D.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(I,a,v),s.push(a,E,v)):H===U&&(K=`${Math.min(E,v)} ${Math.max(E,v)}`,a=h[K],c(a)||(Q=Z.interpolateUsingFraction(.5,tz),ie=(k.height+W.height)*.5,j=m.fromRadians(Q.longitude,Q.latitude,ie,e,ib),d.push(j.x,j.y,j.z),a=d.length/3-1,h[K]=a,r&&($=D.add(X,b,DC),D.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(E,a,I),s.push(a,v,I)):(y.push(v),y.push(I),y.push(E))}let R={attributes:{position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:d})},indices:y,primitiveType:ve.TRIANGLES};return r&&(R.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})),new dt(R)};gy.scaleToGeodeticHeight=function(e,t,n,i){n=n??re.default;let o=b5e,r=y5e;if(t=t??0,i=i??!0,c(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};xy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};xy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};xy.prototype.clear=function(){this._array.length=this._offset=this._length=0};xy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var _y=xy;var nr={};nr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!c(o))continue;n+=2;let r=o.positions,s=o.holes;if(c(r)&&r.length>0&&(n+=r.length*t.packedLength),c(s)){let a=s.length;for(let l=0;l0;){let r=o.pop();if(!c(r))continue;let s=r.positions,a=r.holes;if(t[n++]=c(s)?s.length:0,t[n++]=c(a)?a.length:0,c(s)){let l=s.length;for(let d=0;d0?new Array(o):void 0;for(let a=0;aw.PI){let l=s;s=a,a=l}if(!(r.longitudea))return n.cartographicToCartesian(r)}function X5e(e,t,n,i){if(i===Kt.RHUMB)return E5e(e,t,n);let o=qn.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(c(o))return n.scaleToGeodeticSurface(o,o)}var I5e=new pe;function W5e(e,t,n){let i=[],o,r,s,a,l,d=0;for(;dt.cartesianToCartographic(f,I5e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(l=X5e(o,r,t,n),++d,!c(l))continue;e.splice(d,0,l),i.push({position:d,type:s,visited:!1,next:a,theta:u(l)})}++d}return i}function rse(e,t,n,i,o,r,s){let a=[],l=r,d=f=>p=>p.position===f,u=[];do{let f=n[l];a.push(f);let p=i.findIndex(d(l)),y=i[p];if(!c(y)){++l;continue}let{visited:h,type:g,next:x}=y;if(y.visited=!0,g===0){if(x===0){let R=i[p-(s?1:-1)];if(R?.position===l+1)R.visited=!0;else{++l;continue}}if(!h&&s&&x>0||r===l&&!s&&x<0){++l;continue}}if(!(s?g>=0:g<=0)){++l;continue}h||u.push(l);let V=p+(s?1:-1),Z=i[V];if(!c(Z)){++l;continue}l=Z.position}while(l=0&&l!==r&&a.lengthd.theta-u.theta);let l=s[0].z>=0;o=rse(i,o,s,a,1,0,l)}return i};nr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],l=new _y;l.enqueue(e);let d=c(r);for(;l.length!==0;){let u=l.dequeue(),f=u.positions,p=u.holes,y,h;if(i)for(h=f.length,y=0;y1){for(let v of I)l.enqueue(new Fa(v,p));continue}}let V=f.slice(),Z=c(p)?p.length:0,R=[],E;for(y=0;yMath.PI&&(e-=w.TWO_PI),e}}});var BC=new pe,N5e=new m;kr.prototype.getLatitude=function(e){c(e)||(e=re.default),BC.latitude=this.conformalLatitude,BC.longitude=this.longitude,BC.height=0;let t=this.ellipsoid.cartographicToCartesian(BC,N5e);return e.cartesianToCartographic(t,BC),BC.latitude};var k5e=new bn,U5e=new m,O5e=new m;kr.fromCartesian=function(e,t){C.defined("cartesian",e);let n=w.signNotZero(e.z),i=kr.NORTH_POLE_TANGENT_PLANE,o=kr.SOUTH_POLE;n<0&&(i=kr.SOUTH_POLE_TANGENT_PLANE,o=kr.NORTH_POLE);let r=k5e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,U5e),m.normalize(r.direction,r.direction);let s=qn.rayPlane(r,i.plane,O5e),a=m.subtract(s,o,s),l=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return c(t)?(t.position=new D(l,d),t.tangentPlane=i,t):new kr(new D(l,d),i)};kr.fromCartesianArray=function(e,t){C.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i=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 l=e.getLatitude(n),d=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),i!==Kt.RHUMB){let p=D.subtract(t.position,e.position,ske),y=D.dot(t.position,p)/D.dot(p,p);if(y>0&&y<1){let h=D.add(t.position,D.multiplyByScalar(p,-y,p),ake),g=pc.clone(t,cke);g.position=h;let x=g.getLatitude(n);r.south=Math.min(r.south,x),r.north=Math.max(r.north,x),Math.abs(l)>Math.abs(x)&&(d=x)}}let u=t.x*e.y-e.x*t.y,f=Math.sign(u);f!==0&&(f*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=f),d<=0&&(o.southAngle+=f)}var use=new pc,lke=new pc,Pu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};vu.computeRectangleFromPositions=function(e,t,n,i){if(C.defined("positions",e),c(i)||(i=new de),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,Pu.northAngle=0,Pu.southAngle=0,Pu.westOverIdl=Number.POSITIVE_INFINITY,Pu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=pc.fromCartesian(e[0],lke);for(let s=1;sPu.eastOverIdl-Pu.westOverIdl&&(i.west=Pu.westOverIdl,i.east=Pu.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(Pu.northAngle),w.TWO_PI,w.EPSILON10)&&(i.north=w.PI_OVER_TWO,i.east=w.PI,i.west=-w.PI),w.equalsEpsilon(Math.abs(Pu.southAngle),w.TWO_PI,w.EPSILON10)&&(i.south=-w.PI_OVER_TWO,i.east=w.PI,i.west=-w.PI),i};var dke=new pc;function uke(e,t,n){return e.height>=w.PI||e.width>=w.PI?pc.fromCartesian(t[0],dke).tangentPlane:$r.fromPoints(t,n)}var mse=new pe;function mke(e,t,n){return(i,o)=>{if(e.height>=w.PI||e.width>=w.PI){if(e.south<0&&e.north>0){c(o)||(o=[]);for(let s=0;s=w.PI||e.width>=w.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,mse);return c(r)||(r=new D),r.x=s.longitude/w.PI,r.y=s.latitude/w.PI_OVER_TWO,r}return pc.fromCartesian(o,r)};let i=$r.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function hke(e,t,n,i){return(o,r)=>!i&&(e.height>=w.PI_OVER_TWO||e.width>=2*w.PI_OVER_THREE)?Dn.splitPolygonsOnEquator(o,t,n,r):o}function pke(e,t,n,i){if(t.height>=w.PI||t.width>=w.PI)return je.fromRectangle(t,void 0,ase);let o=e,r=$r.fromPoints(o,n);return Dn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,ase)}vu.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,l=e._closeBottom,d=e._arcType,u=e._textureCoordinates,f=c(u),p=r.positions;if(p.length<3)return;let y=e.rectangle,h=Dn.polygonsFromHierarchy(r,f,mke(y,p,n),!s,n,hke(y,n,d,s)),g=h.hierarchy,x=h.polygons,S=function(W){return W},V=f?Dn.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(g.length===0)return;let Z=g[0].outerRing,R=pke(Z,y,n,o),E=[],I=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!w.equalsEpsilon(I,v,0,w.EPSILON2),F={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:uke(y,Z,n).plane.normal,projectTo2d:fke(y,Z,n),boundingRectangle:R,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},N;if(P)for(F.extrude=!0,F.top=a,F.bottom=l,F.shadowVolume=e._shadowVolume,F.offsetAttribute=e._offsetAttribute,N=0;N 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; -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; -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); -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; -} -} -vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; -out_FragColor = min(out_FragColor, result); -} -lastPolygonIndex += positionsLength; -} -} -`;function ts(e){e=e??z.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new ye,this.polygonRemoved=new ye,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(c(t)){let n=t.length;for(let i=0;iHC.equals(t,e))};ts.prototype.remove=function(e){C.typeOf.object("polygon",e);let t=this._polygons,n=t.findIndex(i=>HC.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var gke=new de;function xke(e){let t=[],n=[],i=e.length;for(let r=0;rde.union(e[x].computeSphericalExtents(gke),g,g),a),t[p]=void 0,n[p]=void 0,l=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=de.clone(a,u),u.south-=l,u.west-=d,u.north+=l,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(f)}let o=new Map;return n.filter(c).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(c),extentsIndexByPolygon:o}}ts.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;ns+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(c(i)){let s=i.width*i.height;(s{e._signedDistanceComputeCommand=void 0}})}var hse=new de,Ske=new de;ts.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=zt.OUTSIDE;this.inverse&&(o=zt.INSIDE);for(let r=0;rm4e);var d=ue(Hpe.url)}var u="./this.program",m=Hpe.url;if(c)d("node:fs"),m.startsWith("file:")&&d("node:path").dirname(d("node:url").fileURLToPath(m)),1>8&et;return Ve}var _,S,Z,R,C,E,A,L,F,I,N,g,V=!1;function G(){var ue=zT.buffer;Z=new Int8Array(ue),C=new Int16Array(ue),r.HEAPU8=R=new Uint8Array(ue),E=new Uint16Array(ue),A=new Int32Array(ue),L=new Uint32Array(ue),r.HEAPF32=F=new Float32Array(ue),I=new Float64Array(ue),N=new BigInt64Array(ue),g=new BigUint64Array(ue)}function v(ue){var oe;throw(oe=r.onAbort)==null||oe.call(r,ue),ue="Aborted("+ue+")",b(ue),f=!0,ue=new WebAssembly.RuntimeError(ue+". Build with -sASSERTIONS for more info."),S?.(ue),ue}var X;async function Y(ue){return ue}async function D(ue){var oe=X;try{var Re=await Y(oe);return await WebAssembly.instantiate(Re,ue)}catch(Ve){b(`failed to asynchronously prepare wasm: ${Ve}`),v(Ve)}}async function w(ue){return D(ue)}var O=ue=>{for(;0{var ue=r.preRun.shift();z.push(ue)},te={},H=ue=>{for(;ue.length;){var oe=ue.pop();ue.pop()(oe)}};function $(ue){return this.O(L[ue>>2])}var ee={},le={},_e={},he=class extends Error{constructor(ue){super(ue),this.name="InternalError"}},Ze=(ue,oe,Re)=>{function Ve(Gt){if(Gt=Re(Gt),Gt.length!==ue.length)throw new he("Mismatched type converter count");for(var Sn=0;Sn_e[Gt]=oe);var et=Array(oe.length),Ct=[],gt=0;for(let[Gt,Sn]of oe.entries())le.hasOwnProperty(Sn)?et[Gt]=le[Sn]:(Ct.push(Sn),ee.hasOwnProperty(Sn)||(ee[Sn]=[]),ee[Sn].push(()=>{et[Gt]=le[Sn],++gt,gt===Ct.length&&Ve(et)}));Ct.length===0&&Ve(et)},ye=ue=>{for(var oe="";;){var Re=R[ue++];if(!Re)return oe;oe+=String.fromCharCode(Re)}},Ge=class extends Error{constructor(ue){super(ue),this.name="BindingError"}},Ae=ue=>{throw new Ge(ue)};function Fe(ue,oe,Re={}){var Ve=oe.name;if(!ue)throw new Ge(`type "${Ve}" must have a positive integer typeid pointer`);if(le.hasOwnProperty(ue)){if(Re.Aa)return;throw new Ge(`Cannot register type '${Ve}' twice`)}le[ue]=oe,delete _e[ue],ee.hasOwnProperty(ue)&&(oe=ee[ue],delete ee[ue],oe.forEach(et=>et()))}function tt(ue,oe,Re={}){return Fe(ue,oe,Re)}var Be=(ue,oe,Re)=>{switch(oe){case 1:return Re?Ve=>Z[Ve]:Ve=>R[Ve];case 2:return Re?Ve=>C[Ve>>1]:Ve=>E[Ve>>1];case 4:return Re?Ve=>A[Ve>>2]:Ve=>L[Ve>>2];case 8:return Re?Ve=>N[Ve>>3]:Ve=>g[Ve>>3];default:throw new TypeError(`invalid integer width (${oe}): ${ue}`)}},je=ue=>{throw new Ge(ue.M.R.N.name+" instance already deleted")},qe=!1,We=()=>{},Ke=ue=>globalThis.FinalizationRegistry?(qe=new FinalizationRegistry(oe=>{oe=oe.M,--oe.count.value,oe.count.value===0&&(oe.V?oe.Y.Z(oe.V):oe.R.N.Z(oe.P))}),Ke=oe=>{var Re=oe.M;return Re.V&&qe.register(oe,{M:Re},oe),oe},We=oe=>{qe.unregister(oe)},Ke(ue)):(Ke=oe=>oe,ue);function ct(){}var Et=(ue,oe)=>Object.defineProperty(oe,"name",{value:ue}),zt={},ut=(ue,oe,Re)=>{if(ue[oe].U===void 0){var Ve=ue[oe];ue[oe]=function(...et){if(!ue[oe].U.hasOwnProperty(et.length))throw new Ge(`Function '${Re}' called with an invalid number of arguments (${et.length}) - expects one of (${ue[oe].U})!`);return ue[oe].U[et.length].apply(this,et)},ue[oe].U=[],ue[oe].U[Ve.$]=Ve}},bt=(ue,oe,Re)=>{if(r.hasOwnProperty(ue)){if(Re===void 0||r[ue].U!==void 0&&r[ue].U[Re]!==void 0)throw new Ge(`Cannot register public name '${ue}' twice`);if(ut(r,ue,ue),r[ue].U.hasOwnProperty(Re))throw new Ge(`Cannot register multiple overloads of a function with the same number of arguments (${Re})!`);r[ue].U[Re]=oe}else r[ue]=oe,r[ue].$=Re},ht=ue=>{ue=ue.replace(/[^a-zA-Z0-9_]/g,"$");var oe=ue.charCodeAt(0);return 48<=oe&&57>=oe?`_${ue}`:ue};function jt(ue,oe,Re,Ve,et,Ct,gt,Gt){this.name=ue,this.constructor=oe,this.ba=Re,this.Z=Ve,this.W=et,this.va=Ct,this.fa=gt,this.ta=Gt,this.Ca=[]}var st=(ue,oe,Re)=>{for(;oe!==Re;){if(!oe.fa)throw new Ge(`Expected null or instance of ${Re.name}, got an instance of ${oe.name}`);ue=oe.fa(ue),oe=oe.W}return ue},pt=ue=>{if(ue===null)return"null";var oe=typeof ue;return oe==="object"||oe==="array"||oe==="function"?ue.toString():""+ue};function wi(ue,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);return 0}if(!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);return st(oe.M.P,oe.M.R.N,this.N)}function jn(ue,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);if(this.ha){var Re=this.ka();return ue!==null&&ue.push(this.Z,Re),Re}return 0}if(!oe||!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&oe.M.R.ga)throw new Ge(`Cannot convert argument of type ${oe.M.Y?oe.M.Y.name:oe.M.R.name} to parameter type ${this.name}`);if(Re=st(oe.M.P,oe.M.R.N,this.N),this.ha){if(oe.M.V===void 0)throw new Ge("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(oe.M.Y===this)Re=oe.M.V;else throw new Ge(`Cannot convert argument of type ${oe.M.Y?oe.M.Y.name:oe.M.R.name} to parameter type ${this.name}`);break;case 1:Re=oe.M.V;break;case 2:if(oe.M.Y===this)Re=oe.M.V;else{var Ve=oe.clone();Re=this.Da(Re,Ki(()=>Ve.delete())),ue!==null&&ue.push(this.Z,Re)}break;default:throw new Ge("Unsupported sharing policy")}}return Re}function _i(ue,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);return 0}if(!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);if(oe.M.R.ga)throw new Ge(`Cannot convert argument of type ${oe.M.R.name} to parameter type ${this.name}`);return st(oe.M.P,oe.M.R.N,this.N)}var Hi=(ue,oe,Re)=>oe===Re?ue:Re.W===void 0?null:(ue=Hi(ue,oe,Re.W),ue===null?null:Re.ta(ue)),Gi={},fi=(ue,oe)=>{if(oe===void 0)throw new Ge("ptr should not be undefined");for(;ue.W;)oe=ue.fa(oe),ue=ue.W;return Gi[oe]},Si=(ue,oe)=>{if(!oe.R||!oe.P)throw new he("makeClassHandle requires ptr and ptrType");if(!!oe.Y!=!!oe.V)throw new he("Both smartPtrType and smartPtr must be specified");return oe.count={value:1},Ke(Object.create(ue,{M:{value:oe,writable:!0}}))};function On(ue,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn){this.name=ue,this.N=oe,this.ia=Re,this.ga=Ve,this.ha=et,this.Ba=Ct,this.Ha=gt,this.pa=Gt,this.ka=Sn,this.Da=Kn,this.Z=xn,et||oe.W!==void 0?this.S=jn:(this.S=Ve?wi:_i,this.T=null)}var rn=(ue,oe,Re)=>{if(!r.hasOwnProperty(ue))throw new he("Replacing nonexistent public symbol");r[ue].U!==void 0&&Re!==void 0?r[ue].U[Re]=oe:(r[ue]=oe,r[ue].$=Re)},Hn=(ue,oe)=>{ue=ye(ue);var Re=MA.get(oe);if(typeof Re!="function")throw new Ge(`unknown function pointer with signature ${ue}: ${oe}`);return Re};class $i extends Error{}var Po=ue=>{ue=BT(ue);var oe=ye(ue);return Tp(ue),oe},hr=(ue,oe)=>{function Re(Ct){et[Ct]||le[Ct]||(_e[Ct]?_e[Ct].forEach(Re):(Ve.push(Ct),et[Ct]=!0))}var Ve=[],et={};throw oe.forEach(Re),new $i(`${ue}: `+Ve.map(Po).join([", "]))},Is=(ue,oe)=>{for(var Re=[],Ve=0;Ve>2]);return Re};function Hs(ue){for(var oe=1;oegt)throw new Ge("argTypes array size mismatch! Must at least get return value and 'this' types!");var Gt=oe[1]!==null&&Re!==null,Sn=Hs(oe);Re=!oe[0].oa;var Kn=oe[0],xn=oe[1];for(Ve=[ue,Ae,Ve,et,H,Kn.O.bind(Kn),xn?.S.bind(xn)],et=2;et{ue=ue.trim();let oe=ue.indexOf("(");return oe===-1?ue:ue.slice(0,oe)},fr=[],mo=[0,1,,1,null,1,!0,1,!1,1],Qr=ue=>{9{if(!ue)throw new Ge(`Cannot use deleted val. handle = ${ue}`);return mo[ue]},Ki=ue=>{switch(ue){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let oe=fr.pop()||mo.length;return mo[oe]=ue,mo[oe+1]=1,oe}},Mi={name:"emscripten::val",O:ue=>{var oe=wn(ue);return Qr(ue),oe},S:(ue,oe)=>Ki(oe),X:$,T:null},Xo=(ue,oe,Re)=>{switch(oe){case 1:return Re?function(Ve){return this.O(Z[Ve])}:function(Ve){return this.O(R[Ve])};case 2:return Re?function(Ve){return this.O(C[Ve>>1])}:function(Ve){return this.O(E[Ve>>1])};case 4:return Re?function(Ve){return this.O(A[Ve>>2])}:function(Ve){return this.O(L[Ve>>2])};default:throw new TypeError(`invalid integer width (${oe}): ${ue}`)}},Dc=(ue,oe)=>{var Re=le[ue];if(Re===void 0)throw ue=`${oe} has unknown type ${Po(ue)}`,new Ge(ue);return Re},bm=(ue,oe)=>{switch(oe){case 4:return function(Re){return this.O(F[Re>>2])};case 8:return function(Re){return this.O(I[Re>>3])};default:throw new TypeError(`invalid float width (${oe}): ${ue}`)}},bp=(ue,oe,Re)=>{let Ve=(et,Ct)=>{let gt=0;return{next(){if(gt>=et)return{done:!0};let Gt=gt;return gt++,{value:Ct(Gt),done:!1}},[Symbol.iterator](){return this}}};ue[Symbol.iterator]||(ue[Symbol.iterator]=function(){let et=this[oe]();return Ve(et,Ct=>this[Re](Ct))})},Lh=Object.assign({optional:!0},Mi),ua=(ue,oe,Re)=>{var Ve=R;if(!(0=gt){if(oe>=Re)break;Ve[oe++]=gt}else if(2047>=gt){if(oe+1>=Re)break;Ve[oe++]=192|gt>>6,Ve[oe++]=128|gt&63}else if(65535>=gt){if(oe+2>=Re)break;Ve[oe++]=224|gt>>12,Ve[oe++]=128|gt>>6&63,Ve[oe++]=128|gt&63}else{if(oe+3>=Re)break;Ve[oe++]=240|gt>>18,Ve[oe++]=128|gt>>12&63,Ve[oe++]=128|gt>>6&63,Ve[oe++]=128|gt&63,Ct++}}return Ve[oe]=0,oe-et},gp=ue=>{for(var oe=0,Re=0;Re=Ve?oe++:2047>=Ve?oe+=2:55296<=Ve&&57343>=Ve?(oe+=4,++Re):oe+=3}return oe},Ps=new TextDecoder,$a=(ue,oe,Re,Ve)=>{if(Re=oe+Re,Ve)return Re;for(;ue[oe]&&!(oe>=Re);)++oe;return oe},DT=new TextDecoder("utf-16le"),si=(ue,oe,Re)=>(ue>>=1,DT.decode(E.subarray(ue,$a(E,ue,oe/2,Re)))),qo=(ue,oe,Re)=>{if(Re??(Re=2147483647),2>Re)return 0;Re-=2;var Ve=oe;Re=Re<2*ue.length?Re/2:ue.length;for(var et=0;et>1]=ue.charCodeAt(et),oe+=2;return C[oe>>1]=0,oe-Ve},Gl=ue=>2*ue.length,K0=(ue,oe,Re)=>{var Ve="";ue>>=2;for(var et=0;!(et>=oe/4);et++){var Ct=L[ue+et];if(!Ct&&!Re)break;Ve+=String.fromCodePoint(Ct)}return Ve},va=(ue,oe,Re)=>{if(Re??(Re=2147483647),4>Re)return 0;var Ve=oe;Re=Ve+Re-4;for(var et=0;et>2]=Ct,oe+=4,oe+4>Re)break}return A[oe>>2]=0,oe-Ve},yp=ue=>{for(var oe=0,Re=0;Re{var oe=xy.length;return xy.push(ue),oe},qJ=(ue,oe)=>{for(var Re=Array(ue),Ve=0;Ve>2],`parameter ${Ve}`);return Re},$J=(ue,oe,Re)=>{var Ve=[];return ue=ue(Ve,Re),Ve.length&&(L[oe>>2]=Ki(Ve)),ue},ej={},xp=ue=>{var oe=ej[ue];return oe===void 0?ye(ue):oe},UR={},OT=()=>{var ue;if(!Wh){var oe={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ue=globalThis.navigator)==null?void 0:ue.language)??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},Re;for(Re in UR)UR[Re]===void 0?delete oe[Re]:oe[Re]=UR[Re];var Ve=[];for(Re in oe)Ve.push(`${Re}=${oe[Re]}`);Wh=Ve}return Wh},Wh,tj=[null,[],[]];if((()=>{let ue=ct.prototype;Object.assign(ue,{isAliasOf:function(Re){if(!(this instanceof ct&&Re instanceof ct))return!1;var Ve=this.M.R.N,et=this.M.P;Re.M=Re.M;var Ct=Re.M.R.N;for(Re=Re.M.P;Ve.W;)et=Ve.fa(et),Ve=Ve.W;for(;Ct.W;)Re=Ct.fa(Re),Ct=Ct.W;return Ve===Ct&&et===Re},clone:function(){if(this.M.P||je(this),this.M.ea)return this.M.count.value+=1,this;var Re=Ke,Ve=Object,et=Ve.create,Ct=Object.getPrototypeOf(this),gt=this.M;return Re=Re(et.call(Ve,Ct,{M:{value:{count:gt.count,da:gt.da,ea:gt.ea,P:gt.P,R:gt.R,V:gt.V,Y:gt.Y}}})),Re.M.count.value+=1,Re.M.da=!1,Re},delete(){if(this.M.P||je(this),this.M.da&&!this.M.ea)throw new Ge("Object already scheduled for deletion");We(this);var Re=this.M;--Re.count.value,Re.count.value===0&&(Re.V?Re.Y.Z(Re.V):Re.R.N.Z(Re.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||je(this),this.M.da&&!this.M.ea)throw new Ge("Object already scheduled for deletion");return this.M.da=!0,this}});let oe=Symbol.dispose;oe&&(ue[oe]=ue.delete)})(),Object.assign(On.prototype,{wa(ue){return this.pa&&(ue=this.pa(ue)),ue},ma(ue){var oe;(oe=this.Z)==null||oe.call(this,ue)},X:$,O:function(ue){function oe(){return this.ha?Si(this.N.ba,{R:this.Ba,P:Re,Y:this,V:ue}):Si(this.N.ba,{R:this,P:ue})}var Re=this.wa(ue);if(!Re)return this.ma(ue),null;var Ve=fi(this.N,Re);if(Ve!==void 0)return Ve.M.count.value===0?(Ve.M.P=Re,Ve.M.V=ue,Ve.clone()):(Ve=Ve.clone(),this.ma(ue),Ve);if(Ve=this.N.va(Re),Ve=zt[Ve],!Ve)return oe.call(this);Ve=this.ga?Ve.sa:Ve.pointerType;var et=Hi(Re,this.N,Ve.N);return et===null?oe.call(this):this.ha?Si(Ve.N.ba,{R:Ve,P:et,Y:this,V:ue}):Si(Ve.N.ba,{R:Ve,P:et})}}),r.print&&(p=r.print),r.printErr&&(b=r.printErr),r.thisProgram&&(u=r.thisProgram),r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0v(""),r:ue=>{var oe=te[ue];delete te[ue];var Re=oe.ka,Ve=oe.Z,et=oe.na,Ct=et.map(gt=>gt.za).concat(et.map(gt=>gt.Fa));Ze([ue],Ct,gt=>{var Gt={},Sn,Kn;for([Sn,Kn]of et.entries()){let xn=gt[Sn],Vr=Kn.xa,pr=Kn.ya,Ks=gt[Sn+et.length],Rc=Kn.Ea,Ll=Kn.Ga;Gt[Kn.ua]={read:Td=>xn.O(Vr(pr,Td)),write:(Td,J0)=>{var Vt=[];Rc(Ll,Td,Ks.S(Vt,J0)),H(Vt)},optional:xn.optional}}return[{name:oe.name,O:xn=>{var Vr={},pr;for(pr in Gt)Vr[pr]=Gt[pr].read(xn);return Ve(xn),Vr},S:(xn,Vr)=>{for(var pr in Gt)if(!(pr in Vr||Gt[pr].optional))throw new TypeError(`Missing field: "${pr}"`);var Ks=Re();for(pr in Gt)Gt[pr].write(Ks,Vr[pr]);return xn!==null&&xn.push(Ve,Ks),Ks},X:$,T:Ve}]})},o:(ue,oe,Re,Ve,et)=>{oe=ye(oe),Ve=Ve===0n;let Ct=gt=>gt;if(Ve){let gt=8*Re;Ct=Gt=>BigInt.asUintN(gt,Gt),et=Ct(et)}tt(ue,{name:oe,O:Ct,S:(gt,Gt)=>(typeof Gt=="number"&&(Gt=BigInt(Gt)),Gt),X:Be(oe,Re,!Ve),T:null})},C:(ue,oe,Re,Ve)=>{oe=ye(oe),tt(ue,{name:oe,O:function(et){return!!et},S:function(et,Ct){return Ct?Re:Ve},X:function(et){return this.O(R[et])},T:null})},k:(ue,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn,Vr,pr)=>{xn=ye(xn),Ct=Hn(et,Ct),Gt&&(Gt=Hn(gt,Gt)),Kn&&(Kn=Hn(Sn,Kn)),pr=Hn(Vr,pr);var Ks=ht(xn);bt(Ks,function(){hr(`Cannot construct ${xn} due to unbound types`,[Ve])}),Ze([ue,oe,Re],Ve?[Ve]:[],Rc=>{if(Rc=Rc[0],Ve)var Ll=Rc.N,Td=Ll.ba;else Td=ct.prototype;Rc=Et(xn,function(...Ye){if(Object.getPrototypeOf(this)!==J0)throw new Ge(`Use 'new' to construct ${xn}`);if(Vt.aa===void 0)throw new Ge(`${xn} has no accessible constructor`);var yt=Vt.aa[Ye.length];if(yt===void 0)throw new Ge(`Tried to invoke ctor of ${xn} with invalid number of parameters (${Ye.length}) - expected (${Object.keys(Vt.aa).toString()}) parameters instead!`);return yt.apply(this,Ye)});var J0=Object.create(Td,{constructor:{value:Rc}});Rc.prototype=J0;var Vt=new jt(xn,Rc,J0,pr,Ll,Ct,Gt,Kn);if(Vt.W){var Te;(Te=Vt.W).la??(Te.la=[]),Vt.W.la.push(Vt)}return Ll=new On(xn,Vt,!0,!1,!1),Te=new On(xn+"*",Vt,!1,!1,!1),Td=new On(xn+" const*",Vt,!1,!0,!1),zt[ue]={pointerType:Te,sa:Td},rn(Ks,Rc),[Ll,Te,Td]})},g:(ue,oe,Re,Ve,et,Ct)=>{var gt=Is(oe,Re);et=Hn(Ve,et),Ze([],[ue],Gt=>{Gt=Gt[0];var Sn=`constructor ${Gt.name}`;if(Gt.N.aa===void 0&&(Gt.N.aa=[]),Gt.N.aa[oe-1]!==void 0)throw new Ge(`Cannot register multiple constructors with identical number of parameters (${oe-1}) for class '${Gt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Gt.N.aa[oe-1]=()=>{hr(`Cannot construct ${Gt.name} due to unbound types`,gt)},Ze([],gt,Kn=>(Kn.splice(1,0,null),Gt.N.aa[oe-1]=or(Sn,Kn,null,et,Ct),[])),[]})},b:(ue,oe,Re,Ve,et,Ct,gt,Gt,Sn)=>{var Kn=Is(Re,Ve);oe=ye(oe),oe=bi(oe),Ct=Hn(et,Ct),Ze([],[ue],xn=>{function Vr(){hr(`Cannot call ${pr} due to unbound types`,Kn)}xn=xn[0];var pr=`${xn.name}.${oe}`;oe.startsWith("@@")&&(oe=Symbol[oe.substring(2)]),Gt&&xn.N.Ca.push(oe);var Ks=xn.N.ba,Rc=Ks[oe];return Rc===void 0||Rc.U===void 0&&Rc.className!==xn.name&&Rc.$===Re-2?(Vr.$=Re-2,Vr.className=xn.name,Ks[oe]=Vr):(ut(Ks,oe,pr),Ks[oe].U[Re-2]=Vr),Ze([],Kn,Ll=>(Ll=or(pr,Ll,xn,Ct,gt,Sn),Ks[oe].U===void 0?(Ll.$=Re-2,Ks[oe]=Ll):Ks[oe].U[Re-2]=Ll,[])),[]})},A:ue=>tt(ue,Mi),s:(ue,oe,Re,Ve,et)=>{switch(oe=ye(oe),et=et===0?"object":et===1?"number":"string",et){case"object":let gt=function(){};gt.values={},tt(ue,{name:oe,constructor:gt,valueType:et,O:function(Gt){return this.constructor.values[Gt]},S:(Gt,Sn)=>Sn.value,X:Xo(oe,Re,Ve),T:null}),bt(oe,gt);break;case"number":var Ct={};tt(ue,{name:oe,ja:Ct,valueType:et,O:Gt=>Gt,S:(Gt,Sn)=>Sn,X:Xo(oe,Re,Ve),T:null}),bt(oe,Ct),delete r[oe].$;break;case"string":Ct={},tt(ue,{name:oe,ra:{},qa:{},ja:Ct,valueType:et,O:function(Gt){return this.qa[Gt]},S:function(Gt,Sn){return this.ra[Sn]},X:Xo(oe,Re,Ve),T:null}),bt(oe,Ct),delete r[oe].$}},d:(ue,oe,Re)=>{var Ve=Dc(ue,"enum");switch(oe=ye(oe),Ve.valueType){case"object":ue=Ve.constructor,Ve=Object.create(Ve.constructor.prototype,{value:{value:Re},constructor:{value:Et(`${Ve.name}_${oe}`,function(){})}}),ue.values[Re]=Ve,ue[oe]=Ve;break;case"number":Ve.ja[oe]=Re;break;case"string":Ve.ra[oe]=Re,Ve.qa[Re]=oe,Ve.ja[oe]=oe}},n:(ue,oe,Re)=>{oe=ye(oe),tt(ue,{name:oe,O:Ve=>Ve,S:(Ve,et)=>et,X:bm(oe,Re),T:null})},m:(ue,oe,Re,Ve,et,Ct,gt)=>{var Gt=Is(oe,Re);ue=ye(ue),ue=bi(ue),et=Hn(Ve,et),bt(ue,function(){hr(`Cannot call ${ue} due to unbound types`,Gt)},oe-1),Ze([],Gt,Sn=>(Sn=[Sn[0],null].concat(Sn.slice(1)),rn(ue,or(ue,Sn,null,et,Ct,gt),oe-1),[]))},c:(ue,oe,Re,Ve,et)=>{oe=ye(oe);let Ct=Gt=>Gt;if(Ve===0){var gt=32-8*Re;Ct=Gt=>Gt<>>gt,et=Ct(et)}tt(ue,{name:oe,O:Ct,S:(Gt,Sn)=>Sn,X:Be(oe,Re,Ve!==0),T:null})},j:(ue,oe,Re,Ve)=>{Re=ye(Re),Ve=ye(Ve),Ze([],[ue,oe],et=>(bp(et[0].N.ba,Re,Ve),[]))},a:(ue,oe,Re)=>{function Ve(Ct){return new et(Z.buffer,L[Ct+4>>2],L[Ct>>2])}var et=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][oe];Re=ye(Re),tt(ue,{name:Re,O:Ve,X:Ve},{Aa:!0})},h:ue=>{tt(ue,Lh)},B:(ue,oe)=>{oe=ye(oe),tt(ue,{name:oe,O(Re){var Ve=(Ve=Re+4)?Ps.decode(R.subarray(Ve,$a(R,Ve,L[Re>>2],!0))):"";return Tp(Re),Ve},S(Re,Ve){Ve instanceof ArrayBuffer&&(Ve=new Uint8Array(Ve));var et=typeof Ve=="string";if(!(et||ArrayBuffer.isView(Ve)&&Ve.BYTES_PER_ELEMENT==1))throw new Ge("Cannot pass non-string to std::string");var Ct=et?gp(Ve):Ve.length,gt=DR(4+Ct+1),Gt=gt+4;return L[gt>>2]=Ct,et?ua(Ve,Gt,Ct+1):R.set(Ve,Gt),Re!==null&&Re.push(Tp,gt),gt},X:$,T(Re){Tp(Re)}})},f:(ue,oe,Re)=>{if(Re=ye(Re),oe===2)var Ve=si,et=qo,Ct=Gl;else Ve=K0,et=va,Ct=yp;tt(ue,{name:Re,O:gt=>{var Gt=Ve(gt+4,L[gt>>2]*oe,!0);return Tp(gt),Gt},S:(gt,Gt)=>{if(typeof Gt!="string")throw new Ge(`Cannot pass non-string to C++ string type ${Re}`);var Sn=Ct(Gt),Kn=DR(4+Sn+oe);return L[Kn>>2]=Sn/oe,et(Gt,Kn+4,Sn+oe),gt!==null&>.push(Tp,Kn),Kn},X:$,T(gt){Tp(gt)}})},i:(ue,oe,Re,Ve,et,Ct)=>{te[ue]={name:ye(oe),ka:Hn(Re,Ve),Z:Hn(et,Ct),na:[]}},e:(ue,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn)=>{te[ue].na.push({ua:ye(oe),za:Re,xa:Hn(Ve,et),ya:Ct,Fa:gt,Ea:Hn(Gt,Sn),Ga:Kn})},D:(ue,oe)=>{oe=ye(oe),tt(ue,{oa:!0,name:oe,O:()=>{},S:()=>{}})},q:(ue,oe,Re)=>{var[Ve,...et]=qJ(ue,oe);oe=Ve.S.bind(Ve);var Ct=et.map(Sn=>Sn.X.bind(Sn));ue--;var gt={toValue:wn};switch(ue=Ct.map((Sn,Kn)=>{var xn=`argFromPtr${Kn}`;return gt[xn]=Sn,`${xn}(args${Kn?"+"+8*Kn:""})`}),Re){case 0:var Gt="toValue(handle)";break;case 2:Gt="new (toValue(handle))";break;case 3:Gt="";break;case 1:gt.getStringOrSymbol=xp,Gt="toValue(handle)[getStringOrSymbol(methodName)]"}return Gt+=`(${ue})`,Ve.oa||(gt.toReturnWire=oe,gt.emval_returnValue=$J,Gt=`return emval_returnValue(toReturnWire, destructorsRef, ${Gt})`),Gt=`return function (handle, methodName, destructorsRef, args) { +${Gt} +}`,Re=new Function(Object.keys(gt),Gt)(...Object.values(gt)),Gt=`methodCaller<(${et.map(Sn=>Sn.name)}) => ${Ve.name}>`,QJ(Et(Gt,Re))},F:Qr,p:(ue,oe,Re,Ve,et)=>xy[ue](oe,Re,Ve,et),E:ue=>{var oe=wn(ue);H(oe),Qr(ue)},t:(ue,oe,Re,Ve)=>{var et=new Date().getFullYear(),Ct=new Date(et,0,1).getTimezoneOffset();et=new Date(et,6,1).getTimezoneOffset(),L[ue>>2]=60*Math.max(Ct,et),A[oe>>2]=+(Ct!=et),oe=gt=>{var Gt=Math.abs(gt);return`UTC${0<=gt?"-":"+"}${String(Math.floor(Gt/60)).padStart(2,"0")}${String(Gt%60).padStart(2,"0")}`},ue=oe(Ct),oe=oe(et),et{var oe=R.length;if(ue>>>=0,2147483648=Re;Re*=2){var Ve=oe*(1+.2/Re);Ve=Math.min(Ve,ue+100663296);e:{Ve=(Math.min(2147483648,65536*Math.ceil(Math.max(ue,Ve)/65536))-zT.buffer.byteLength+65535)/65536|0;try{zT.grow(Ve),G();var et=1;break e}catch{}et=void 0}if(et)return!0}return!1},u:(ue,oe)=>{var Re=0,Ve=0,et;for(et of OT()){var Ct=oe+Re;L[ue+Ve>>2]=Ct,Re+=ua(et,Ct,1/0)+1,Ve+=4}return 0},v:(ue,oe)=>{var Re=OT();L[ue>>2]=Re.length,ue=0;for(var Ve of Re)ue+=gp(Ve)+1;return L[oe>>2]=ue,0},w:()=>52,x:function(){return 70},l:(ue,oe,Re,Ve)=>{for(var et=0,Ct=0;Ct>2],Gt=L[oe+4>>2];oe+=8;for(var Sn=0;Sn>2]=et,0}},Ty;return Ty=await(async function(){function ue(Re){return Re=Ty=Re.exports,BT=Re.J,DR=r._malloc=Re.K,Tp=r._free=Re.L,zT=Re.G,MA=Re.I,G(),Ty}var oe={a:OR};return r.instantiateWasm?new Promise(Re=>{r.instantiateWasm(oe,(Ve,et)=>{Re(ue(Ve))})}):(X??(X=y(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\0\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~~~\0\`\0\x7F\` +\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F~\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~\x7F\0\`\x7F~\x7F~\`\x7F\x7F~\x7F\x7F\0\` +\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\f\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F~\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\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\x84\xD8A\x84\xD8(\0 \0j"\x006\0  \0Ar6 \0 j \x006\0\v Axq \0j!\0 (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!\b  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v  A~q6  \0Ar6 \0 j \x006\0\f\vA\0!\v \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  \b(F@ \b 6\f\v \b 6\v E\r\v  \b6 ("@  6  6\v ("E\r\0  6  6\v  \0Ar6 \0 j \x006\0  \x07G\r\0A\x84\xD8 \x006\0\v \0A\xFFM@ \0A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A \0Avt"\0qE@A\xFC\xD7 \0 r6\0 \f\v (\b\v!\0  6\b \0 6\f  6\f  \x006\b\vA! \0A\xFF\xFF\xFF\x07M@ \0A& \0A\bvg"kvAq AtrA>s!\v  6 B\x007 AtA\xAC\xDAj!\x7F@\x7FA\x80\xD8(\0"A t"qE@A\x80\xD8  r6\0  6\0A!A\b\f\v \0A AvkA\0 AG\x1Bt! (\0!@ "(Axq \0F\r Av! At!  Aqj"("\r\0\v  6A! !A\b\v!\0 "\f\v (\b" 6\f  6\bA!\0A\b!A\0\v!  j 6\0  6\f \0 j 6\0A\x9C\xD8A\x9C\xD8(\0Ak"\0A\x7F \0\x1B6\0\v\v\xA0\x7F \0( \0,\0\v" A\0H\x1B" I@  k"@\x7F  \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA + \0,\0\v"A\0H"\x1B" \0(  \x1B"kM@ Av\f\v \0   j k  \xA4 \0-\0\v\v! \0(\0 \0 \xC0A\0H\x1B" j! !@ @ A\0:\0\0 Ak! Aj!\f\v\v  j!@ \0,\0\vA\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v  j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\x90\xDCAhE\rA/"E\r\v  )7  )7\b  )\b7\0\f\vA\0!\v A j$\0A\xE8\xDEA:\0\0A\xE4\xDE 6\0 \v\xCB +\x7F ~#\0A\xE0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83"\fB \x88! B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq" A\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"\rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v !\f\v  \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\vB\0!\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \r\x84B\0!P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\v\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\v\f\v  \r\x84P@B\0!\f\v  \x84P@B\0!\f\v \rB\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xD0\0j  \f  \f \fP"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )X"\fB \x88! )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A@k  +  + +P"\b\x1ByB\xC0\0B\0 \b\x1B|\xA7"\bAk6  \bkAj! )H! + )@!\v \x07 j jA\xFF\xFF\0k!@ +B\x86"B \x88B\x80\x80\x80\x80\b\x84" B \x88"~" B\x86"B \x88" + B\x80\x80\x84"\r~|" T\xAD  B1\x88 \x84B\xFF\xFF\xFF\xFF\x83" \fB\xFF\xFF\xFF\xFF\x83"\f~|" T\xAD|  \r~|   B\x80\x80\xFE\xFF\x83" \f~"  +~|" T\xAD    B\xFF\xFF\xFF\xFF\x83"~|"V\xAD||"V\xAD|  \r~"  \f~|" T\xADB \x86 B \x88\x84|   B \x86|"V\xAD|  \r ~"\r + \f~|"\f  ~|"  ~|"B \x88  V\xAD \f \rT\xAD  \fT\xAD||B \x86\x84|" T\xAD|    ~"\f  +~|"B \x88  \fT\xADB \x86\x84|" + T\xAD + B \x86|" +T\xAD||" + T\xAD| +  B \x86"  ~|" T\xAD|" T\xAD|" +T\xAD|"B\x80\x80\x80\x80\x80\x80\xC0\0\x83PE@ Aj!\f\v B?\x88 B\x86 B?\x88\x84! B\x86 B?\x88\x84! B\x86! B\x86\x84!\v A\xFF\xFFN@ \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v~ A\0L@A k"\x07A\xFF\0M@ A0j   A\xFF\0j"6 A j   6 Aj   \x07g    \x07g )0 )8\x84B\0R\xAD ) )\x84\x84! )( )\x84! )\0! )\b\f\vB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84\v \v\x84!\v P B\0Y B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FQ\x1BE@ \v B|"P\xAD|!\v\f\v  B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84PE@ !\f\v \v  B\x83|" T\xAD|!\v\v \0 7\0 \0 \v7\b A\xE0\0j$\0\v\0 \0!\vr\x7F#\0Ak"$\0  \x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D7A06\0A\0!\0\f\v \0 6\0 \0 \0( j6 Ax kA\x07qj"\b Ar6 Ax kA\x07qj"  \bj"k!\x07@A\x94\xD8(\0 F@A\x94\xD8 6\0A\x88\xD8A\x88\xD8(\0 \x07j"\x006\0  \0Ar6\f\vA\x90\xD8(\0 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \x07j"\x006\0  \0Ar6 \0 j \x006\0\f\v ("\0AqAF@ \0Axq! (\f!@ \0A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ \0Avwq6\0\f\v  6\f  6\b\f\v (!@  G@ (\b"\0 6\f  \x006\b\f\v@ ("\0\x7F Aj ("\0E\r Aj\v!@ ! \0"Aj! \0("\0\r\0 Aj! ("\0\r\0\v A\x006\0\f\vA\0!\v E\r\0@ ("\0At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ \0wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("\0@  \x006 \0 6\v ("\0E\r\0  \x006 \0 6\v \x07 j!\x07  j"(!\0\v  \0A~q6  \x07Ar6  \x07j \x076\0 \x07A\xFFM@ \x07A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A \x07Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA! \x07A\xFF\xFF\xFF\x07M@ \x07A& \x07A\bvg"\0kvAq \0AtrA>s!\v  6 B\x007 AtA\xAC\xDAj!\0@@A\x80\xD8(\0"A t"qE@A\x80\xD8  r6\0 \0 6\0\f\v \x07A AvkA\0 AG\x1Bt! \0(\0!@ "\0(Axq \x07F\r Av! At! \0 Aqj"("\r\0\v  6\v  \x006  6\f  6\b\f\v \0(\b" 6\f \0 6\b A\x006  \x006\f  6\b\v \bA\bj!\0\f\v@ \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \x07A~ wq"\x076\0\f\v@  \b(F@ \b \x006\f\v \b \x006\v \0E\r\v \0 \b6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v  \x006 B\x007 \0AtA\xAC\xDAj!@@ \x07A \0t"qE@A\x80\xD8  \x07r6\0  6\0  6\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"\x07("\r\0\v \x07 6  6\v  6\f  6\b\f\v (\b"\0 6\f  6\b A\x006  6\f  \x006\b\v A\bj!\0\f\v@ E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \vA~ wq6\0\f\v@  (F@ \x006\f\v \x006\v \0E\r\v \0 6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 \b@ \bAxqA\xA4\xD8j!\0A\x90\xD8(\0!\x7FA \bAvt"\x07 qE@A\xFC\xD7  \x07r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\vA\x90\xD8 6\0A\x84\xD8 6\0\v A\bj!\0\v +Aj$\0 \0\v\0\x9C\0\v;\x7F#\0Ak"$\0  \x006\f (\f"\0(\0"@ \0 6 \0(\b !\v Aj$\0\vu~ \0  ~  ~| B \x88" B \x88"~| B\xFF\xFF\xFF\xFF\x83" B\xFF\xFF\xFF\xFF\x83"~"B \x88  ~|"B \x88|  ~ B\xFF\xFF\xFF\xFF\x83|"B \x88|7\b \0 B\xFF\xFF\xFF\xFF\x83 B \x86\x847\0\v\xC1\x7F \0-\0\0A qE@@ \0("\x7F  \0\xC9\r \0(\v \0("k I@ \0   \0($\0\f\v@@ E \0(PA\0Hr\r\0 !@  j"Ak-\0\0A +G@ Ak"\r\f\v\v \0   \0($\0 I\r  k! \0(!\f\v !\v   Y \0 \0( j6\v\v\v\x7FA9" \0(\x006\0 \v\xC0\x7F@  kAH\r\0 \0( \0,\0\v" A\0H\x1BE\r\0  \x8F \0(\0 \0 \0,\0\v"A\0H"\x1B" \0(  \x1Bj! Ak!\0@@@ -\0\0"Ak! \0 M\r\0 A\xFFqA\xFD\0M@ (\0 G\r\v Aj!   kAJj!\f\v\v A\xFFqA\xFD\0K\r \0(\0Ak I\r\v A6\0\v\vP~@ A\xC0\0q@  A@j\xAD\x86!B\0!\f\v E\r\0  \xAD"\x86 A\xC0\0 k\xAD\x88\x84!  \x86!\v \0 7\0 \0 7\b\vi\x7F#\0A\x80k"$\0 A\x80\xC0q  LrE@    k"A\x80 A\x80I"\x1B\xC6 E@@ \0 A\x803 A\x80k"A\xFFK\r\0\v\v \0  3\v A\x80j$\0\v\0A\0\v<\x7FA \0 \0AM\x1B!@@ /"\0\r\0A\xB4\xEC(\0"E\r\0 \r\0\f\v\v \0E@0\0\v \0\v \0 \0(\0C\v +\0 \0(\0A\xC0\v\xCD \x7F~#\0A\xF0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83! @@ P" B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}B\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FT +P\x1BE@ B\0R B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}"\vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FV \vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FQ\x1B\r\v  +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84! !\f\v P B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\v  +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0   \x85  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84P"\x1B!B\0  \x1B!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P\r  +\x84P@  \x84B\0R\r  \x83!  \x83!\f\v  \x84PE\r\0 ! !\f\v    T +V +Q\x1B"\b\x1B! +   \b\x1B"\fB\xFF\xFF\xFF\xFF\xFF\xFF?\x83!   \b\x1B"\vB0\x88\xA7A\xFF\xFFq!\x07 \fB0\x88\xA7A\xFF\xFFq"E@ A\xE0\0j + + P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6 )h! )\`! +A k!\v   \b\x1B! \vB\xFF\xFF\xFF\xFF\xFF\xFF?\x83! \x07~  A\xD0\0j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B|\xA7"\x07Ak6A \x07k!\x07 )P! )X\vB\x86 B=\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84! B\x86 +B=\x88\x84  \x85!~ B\x86"  \x07F\r\0  \x07k"\x07A\xFF\0K@B\0!B\f\v A@k  A\x80 \x07k6 A0j   \x07g )8! )0 )@ )H\x84B\0R\xAD\x84\v! B\x80\x80\x80\x80\x80\x80\x80\x84!\v +B\x86! +@ B\0S@B\0!B\0! +\x85  \v\x85\x84P\r + }! \v } +V\xAD}"B\xFF\xFF\xFF\xFF\xFF\xFF\xFFV\r A j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B\x84\xA7A\fk"\x076  \x07k! )(! ) !\f\v +|" T\xAD  \v||"B\x80\x80\x80\x80\x80\x80\x80\b\x83P\r\0 B\x83 B?\x86 B\x88\x84\x84! Aj! B\x88!\v \fB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83! A\xFF\xFFN@ B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!B\0!\f\vA\0!\x07@ A\0J@ !\x07\f\v Aj   A\xFF\0j6   A kg )\0 ) )\x84B\0R\xAD\x84! )\b!\v B=\x86 B\x88\x84! B\x88B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \x07\xADB0\x86\x84 \x84!@@ \xA7A\x07q"AG@    AK\xAD|"V\xAD|!\f\v    B\x83|"V\xAD|!\f\v E\r\v\v \0 7\0 \0 7\b A\xF0\0j$\0\v +\0 \0A\x9C\xE0^\v +\0 \0A\xA4\xE0^\v\x84\x7F~#\0Ak"$\0 \0~ E@B\0\f\v   Au"s k"\xADB\0 g"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\0 A\0H\x1B\x84! )\0\v7\0 \0 7\b Aj$\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v -\0\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v -\0\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v (\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v (\0\v\xAA\f\b\x7F\x7FA\0 E\r\0 \0A\x7Fs! AO@@ AqE\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Aj! Ak!\f\v \0! !\f\v \0! !\f\v \0! !\v An"\bAll! +@ \bAk" E@A\0!\f\v !\0A\0!@ \0( \x07s"\x07AvA\xFC\x07q(\xE0S \x07AvA\xFC\x07q(\xE0K \x07AvA\xFC\x07q(\xE0C \x07A\xFFqAt(\xE0;sss!\x07 \0(\f s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\b s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0( s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\0 s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0Aj!\0 Ak" \r\0\v  \bAljAk!\v  +j! ( (\f (\b ( (\0 s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\xFFqAt(\xE03 \x07ss \0A\bvs"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s"\0A\bv \0A\xFFqAt(\xE03s! Aj!\v A\x07K@@ -\0\0 sA\xFFqAt(\xE03 A\bvs"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0 \0sA\xFFqAt(\xE03s"\0A\bv -\0\x07 \0sA\xFFqAt(\xE03s! A\bj! A\bk"A\x07K\r\0\v\v@ E\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs!\v A\x7Fs\v\v\x97\x7F#\0A@j"$\0 \0 \0(\0"A\bk(\0"j!@ Ak(\0"( (F@A\0  \x1B!\0\f\v \0 N@ B\x007 A\x006  6\f  \x006\b  6 B\x007 B\x007$ B\x007, A\x006< B\x81\x80\x80\x80\x80\x80\x80\x8074  Aj  AA\0 (\0(\v\0 (\r\v B\x007 A\x006 A\x98\xC46\f  \x006\b  6 B\x007 B\x007$ B\x007, B\x007\x003 A\x006< A:\0;  Aj AA\0 (\0( +\0A\0!\0@@ ((\0\v (A\0 ($AF\x1BA\0 ( AF\x1BA\0 (,AF\x1B!\0\f\v (AG@ (,\r ( AG\r ($AG\r\v (!\0\v A@k$\0 \0\v\0 \0A\x006\b \0B\x007\0\vc\0 (A\xB0q"A F@ \v@ AG\r\0@@ \0-\0\0"A+k\0\0\v \0Aj\v A0G  \0kAHr\r\0 \0-\0A rA\xF8\0G\r\0 \0Aj!\0\v \0\v1\x7FA\xCC\xCF(\0! \0@A\xCC\xCFA\xD4\xCE \0 \0A\x7FF\x1B6\0\vA\x7F  A\xD4\xCEF\x1B\v\0 \0(\0"\0@ \0H\v\vA\x7F \0 7p \0 \0(, \0("k\xAC7x \0 P  \0(\b"\0 k\xACYr\x7F \0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\0 \0(\0@ \0\v\xCE~\x7F#\0Ak"$\0 \xBD"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07\x83! \0~ B4\x88B\xFF\x83"PE@ B\xFFR@ B\x88! B\x80\xF8\0|! B<\x86\f\v B\x88!B\xFF\xFF! B<\x86\f\v P@B\0!B\0\f\v  B\0 y\xA7"\x07A1j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85!A\x8C\xF8\0 \x07k\xAD! )\0\v7\0 \0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83 B0\x86\x84 \x847\b Aj$\0\v\0 \0A\x80\x80\x80\x80O@A\xBFA\0\xDC\0\v \0At9\v\x85\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ =! \b(# A\x006\0A\0!@@  \x07F r\r@ \bA\fj \bA\bj(\r\0@ (\0A\0 (\0(4\0A%F@ Aj \x07F\rA\0!\x7F@ (A\0 (\0(4\0"A\xC5\0F\r\0A! + A\xFFqA0F\r\0 \f\v A\bj \x07F\rA\b! + ! (\bA\0 (\0(4\0\v! \b \0 \b(\f \b(\b      \0(\0($\f\x006\f  +jAj!\f\v A (\0 (\0(\f\0@@ \x07 Aj"G@ A (\0 (\0(\f\0\r\v\v@ \bA\fj \bA\bj(\r A \b(\fC (\0(\f\0E\r \b(\fB\f\0\v\0\v \b(\fC (\0(\0 (\0 (\0(\0F@ \b(\fB Aj!\f\v A6\0\v (\0!\f\v\v A6\0\v \bA\fj \bA\bj(@  (\0Ar6\0\v \b(\f \bAj$\0\v\xB1\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ >! \b(# A\x006\0A\0!@@  \x07F r\r@ \bA\fj \bA\bj)\r\0@ ,\0\0A\0 (\0($\0A%F@ Aj \x07F\rA\0!\x7F@ ,\0A\0 (\0($\0"A\xC5\0F\r\0A! + A\xFFqA0F\r\0 \f\v Aj \x07F\rA! + ! ,\0A\0 (\0($\0\v! \b \0 \b(\f \b(\b      \0(\0($\f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"   I\x1B \0A\xFC\xFF\xFF\xFF\x07O\x1B\v?\x7F \0(! \0(\b!@  G@ \0 Ak"6\b\f\v\v \0(\0"@ \0(\f !\v\vI\x7F \0("A\bu! \0(\0"\0  Aq\x7F (\0 j(\0 \v j A Aq\x1B  \0(\0( +\0\v\xF1\x7FA\xF6\xFF\xFF\xFF\x07 k O@A\xF7\xFF\xFF\xFF\x07!\b \0(\0 \0 \0,\0\vA\0H\x1B! A\xF2\xFF\xFF\xFFM@A\v  j" At"\b  \bK\x1B"A\x07rAj A\vI\x1B!\b\v \b9! @  \xFC +\0\0\v @  j \x07 \xFC +\0\0\v   j" +k"\x07E  +FrE@  j j  j j \x07\xFC +\0\0\v A +G@ !\v \0 6\0 \0 \bA\x80\x80\x80\x80xr6\b \0  j \x07j"\x006 \0 jA\0:\0\0\vi\0\v,\x7F \0 A\xC0\x84=n"At/\xC0\xBB;\0\0 \0Aj  A\xC0\x84=lk\xAB\v\0A\v;\0 \0 6 \0 \x7F 9A\0\v"6\0 \0  j"6\b \0  j6\f \0 6 \0\v\b\0A\xFF\xFF\xFF\xFF\x07\v\0A\xFF\0\v?\x7F@ \0 F\r\0@ \0 Ak"O\r \0(\0! \0 (\x006\0  6\0 \0Aj!\0\f\0\v\0\v\v\xCB \x7F#\0Ak" $\0 =! + Aj n" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@ + \0   +(\0(0\0    \0kAtj"6\0\f\v  6\0@@ \0"\x07-\0\0"\bA+k\0\0\v + \b\xC0 +(\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 \0Aj!\x07\v@  \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0 +A0 +(\0(,\0!\b  (\0"\vAj6\0 \v \b6\0 + \x07,\0 +(\0(,\0!\b  (\0"\vAj6\0 \v \b6\0 \x07Aj!\x07\v \x07 c  (\0(\0\0!A\0!\vA\0!\b \x07!\x7F  M\x7F  \x07 \0kAtj (\0\x8F (\0@ ("\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\x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0 +A0 +(\0(\0!\b  (\0"\vAj6\0 \v \b:\0\0 + \x07,\0 +(\0(\0!\b  (\0"\vAj6\0 \v \b:\0\0 \x07Aj!\x07\v \x07 c  (\0(\0\0!A\0!\vA\0!\b \x07!\x7F  M\x7F  \x07 \0kj (\0c (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0  (\0"\vAj6\0 \v :\0\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v + ,\0\0 +(\0(\0!\f  (\0"\rAj6\0 \r \f:\0\0 Aj! \vAj!\v\f\v\v!\v     \0kj  F\x1B6\0 Aj  Aj$\0\v\x9A\x7F@@@@@@ AkAw\b\0\v \0\x7F  k"A L@A= A ArgkA\xD1 lA\fv"  At(\x90\xBBIkAjH\r\v  \xAD!A\0\v6\f\v \0A Argk"  kJ\x7FA=  j"!\x7F AI\x7F@ Ak" Aq-\0\x91:\0\0 Av"\r\0\vA\0 Ak" AtA"\rE\rA!\v\f\v (\0\v!\bA\0!\r \x07/<@A!\v\f\v \x07/:@A\r!\v\f\v \x07/8@A\f!\v\f\v \x07/6@A\v!\v\f\v \x07/4@A +!\v\f\v \x07/2@A !\v\f\v \x07/0@A\b!\v\f\v \x07/.@A\x07!\v\f\v \x07/,@A!\v\f\v \x07/*@A!\v\f\v \x07/(@A!\v\f\v \x07/&@A!\v\f\v \x07/$@A!\v\f\v \x07/"@A!\fA!\vA!\bA\0\f\v  (\0"\0Aj6\0 \0A\xC06\0  (\0"\0Aj6\0 \0A\xC06\0A!\f\f\v \b \v \b \vI\x1B!A!\b@@ \x07A j \bAtj/\0\r \bAj"\b \vG\r\0\v \v!\b\v  \b  \bK\x1B!\fA\v! A\x7F! + \x07/""AK\rA AtkA\xFE\xFFq \x07/$"k"A\0H\r At \x07/&"k"A\0H\r At \x07/("k"A\0H\r At \x07/*"k"A\0H\r At \x07/,"k"A\0H\r At \x07/."k"A\0H\r At \x07/0"k"A\0H\r At \x07/2"k"A\0H\r At \x07/4"k"A\0H\r At \x07/6"\x1Bk"A\0H\r At \x07/8"k"A\0H\r At \x07/:"k"A\0H\r At \x07/<"k"A\0H\r At" \rI  \rGA\0 \0E r\x1Br\rA\0! + \x07A\0; \x07 ; \x07  j"; \x07  j";\b \x07  j"; + \x07  j";\f \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  \x1Bj"; \x07  j"; \x07  j"; \x07  j;@ E\r\0 AG@ Aq A~q!A\0! @  +Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj +;\0\v  +Ar"Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj ;\0\v +Aj! + Aj" G\r\0\vE\r\v  +Atj/\0"E\r\0 \x07 Atj" /\0"Aj;\0  Atj +;\0\vA!A\0! "!A\0!@@@ \0\0\vA! + \fA K\rA\x81!A\xD0\xED\0!A\x90\xED\0!A!\f\v \0AF!A\0!A\xD0\xEE\0!A\x90\xEE\0! \0AG@\f\vA! + \fA K\r\vA \ft"Ak! (\0!A\0! \f! A\0!A\0!\rA\x7F!@A t!@@\x7FA\0   Atj/\0" AjK\r\0 I@A\0! A\xE0\0\f\v  kAt"\0j/\0! \0 j-\0\0\v!\0A\x7F \b k"t!\x1B  \r vAtj! ! +@  + \x1Bj" +Atj" ;  :\0  \0:\0\0 +\r\0\vA \bAkt! @ "\0Av! \0 \rq\r\0\v \x07A j \bAtj" /\0Ak" ;\0 \0Ak \rq \0jA\0 \0\x1B!\r Aj! A\xFF\xFFqE@ \b \vF\r   Atj/\0Atj/\0!\b\v \b \fM\r\0 \r q"\0 F\r\0\vA \b  \f \x1B"k" t! \b \vI@ \v k! \b! +@@  \x07A j +Atj/\0k"A\0L\r At! Aj" j" + \vI\r\0\v ! \vA t!\vA! +   j"A\xD4Kq  A\xD0Kqr\r (\0" \0Atj" + \f:\0 + :\0\0 +  Atj" kAv; \0!\f\v\v \r@  \rAtj"\0A\0; \0 :\0 \0A\xC0\0:\0\0\v  (\0 Atj6\0\v  \f6\0A\0! +\v +\v\x9C\x7F ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\v (\0!@@@ ("A +M@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFF\x07O\r A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v Aj"@ \0  \xFC +\0\0\v\f\vi\0\v\v\xCC\x7F@A\xF6\xFF\xFF\xFF\x07 k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF\x07! A\xF2\xFF\xFF\xFFM@A\v  j" At"  K\x1B"A\x07rAj A\vI\x1B!\v \0 \x1B! 9! @   \xFC +\0\0\v@  F\r\0  k"\x07E\r\0  j  j \x07\xFC +\0\0\v A +G@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\vi\0\v \0 6\v\0 \0 \0(\0A\fk(\0j"\0 jK \0\vK\x7F \0("A\bu!\x07 \0(\0"\0   Aq\x7F (\0 \x07j(\0 \x07\v j A Aq\x1B  \0(\0(\v\0\v\x9A\0 \0A:\x005@  \0(G\r\0 \0A:\x004@ \0("E@ \0A6$ \0 6 \0 6 AG\r \0(0AF\r\f\v  F@ \0("AF@ \0 6 !\v \0(0AG\r AF\r\f\v \0 \0($Aj6$\v \0A:\x006\v\vv\x7F \0($"E@ \0 6 \0 6 \0A6$ \0 \0(86\v@@ \0( \0(8G\r\0 \0( G\r\0 \0(AG\r \0 6\v \0A:\x006 \0A6 \0 Aj6$\v\v\x8D\x7F ( \0(\0" \0("kj!  k"@   \xFC +\0\0\v  6 \0 \0(\0"6 \0 (6\0  6 \0(! \0 (\b6  6\b \0(\b! \0 (\f6\b  6\f  (6\0\v\x85\x7F@@@ \0,\0\v"A\0N@A +! A +F\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xA4 !\v \0 Aj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\x8C\xC6E"E\r\0 (\b \0(\bA\x7Fsq\r\0 \0(\f( (\f(G\r\0 \0(( ((F!\v \v{\x7F \0("Aq!\x7F -\x007AF@ A\bu" E\r (\0 j(\0\f\v A\bu E\r\0  \0(\0(68A\0!A\0\v! \0(\0"\0   j A Aq\x1B \0(\0(\b\0\v\r\0 \0( (F\v\xF6\x7F#\0Ak"$\0  6\fA\x94\xC4(\0" \0 \xCB \0y \0jAk-\0\0A +G@@@ (L"\0A\0N@ \0E\rA\x84\xCF(\0 \0A\xFF\xFF\xFF\xFFqG\r\v@ (PA +F\r\0 ("\0 (F\r\0  \0Aj6 \0A +:\0\0\f\v \x9F\f\v  (L"\0A\xFF\xFF\xFF\xFF \0\x1B6L@@ (PA +F\r\0 ("\0 (F\r\0  \0Aj6 \0A +:\0\0\f\v \x9F\v (L A\x006L\v\v\x9C\0\v\x88\x7F@@@ \0,\0\v"A\0N@A! AF\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xFF !\v \0 Aj6 \0(\0!\0\v \0 Atj"\0A\x006 \0 6\0\v\x9B\x7FA\xF6\xFF\xFF\xFF k O@A\xF7\xFF\xFF\xFF! \0(\0 \0 \0,\0\vA\0H\x1B! + A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj! \v U!@ E\r\0 At"\bE\r\0  + \b\xFC +\0\0\v@ E\r\0 At"\bE\r\0  Atj \x07 \b\xFC +\0\0\v   j"\bk!\x07@  \bF\r\0 \x07At"E\r\0  At"\bj Atj \b +j Atj \xFC +\0\0\v AG@ +!\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b \0  j \x07j"\x006  \0AtjA\x006\0\v0\0\v\x8A\x7F A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @  6\0 Ak! Aj!\f\v\v \0 AtjA\x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0(\0  6\0@@ \0"\b-\0\0"A+k\0\0\v \xC0 (\0(\0!  (\0"\x07Aj6\0 \x07 :\0\0 \0Aj!\b\v@@  \b"kAL\r\0 -\0\0A0G\r\0 -\0A rA\xF8\0G\r\0 A0 (\0(\0!\x07  (\0"\bAj6\0 \b \x07:\0\0 ,\0 (\0(\0!\x07  (\0"\bAj6\0 \b \x07:\0\0 Aj"\b!@  M\r ,\0\0*!\xB8E\r Aj!\f\0\v\0\v@  M\r ,\0\0*!\xB7E\r Aj!\f\0\v\0\v@ +(\b +,\0"\x07 \x07A\0H\x1BE@ \b  (\0 (\0( \0  (\0  \bkj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@  \x07M@  \b \0kj (\0c@ +(" +Aj" +,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v   \x1B \rj,\0\0G\r\0  (\0"\vAj6\0 \v :\0\0A\0!\v \r \r +(\b +,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(\0!  (\0"Aj6\0  :\0\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@  M@ !\x07\f\v Aj!\x07 ,\0\0"A.G\r \f \f(\0(\f\0\0!  (\0"\bAj6\0 \b :\0\0\v \x07  (\0 (\0( \0  (\0  \x07kj"6\0     \0kj  F\x1B6\0 +Aj  +Aj$\0\v  (\0(\0!  (\0"\bAj6\0 \b :\0\0 \x07!\f\0\v\0\v\xB9\x7F#\0A@j"$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A3j!@ E A\x80qEr\r\0 \b@ A0:\x003 A4j!\f\v \x07A\bG\r\0 A0:\x003 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\x004 A5j!\v A(j  A@k  \x94 ((!@ A\x88\x80qA\x88\x80G\r\0@  F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A3j"  G! Aj"\x07 $    Aj" A\fj A\bj \x07\x93 (# \0  (\f (\b  Z A@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!\0@ \0A +l j"\0A\x99\xB3\xE6\xCCI\x7F (" (hG@  Aj6 -\0\0\f\v %\vA0k"A Mq\r\0\v \0\xAD!\v A K\r B +~! \xAD!@@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A0k"A M  |"B\x9A\xB3\xE6\xCC\x99\xB3\xE6\xCCTqE@ A M\r\f\v B +~" \xAD"B\x7F\x85X\r\v\vA +!\f\v@@  Akq@  \0A\xF1\x81j-\0\0"K\r\f\v  \0A\xF1\x81j-\0\0"M\r AlAvA\x07q,\0\xF1\x83!@   t"r! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\x80\x80\x80\xC0\0Iq\r\0\v \xAD! \rB\x7F \xAD"\x88" T\r@ \xADB\xFF\x83  \x86\x84! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r  X\r\0\v\f\v@   lj! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\xC7\xE3\xF18Iq\r\0\v \xAD! \r \xAD!@  ~" \xADB\xFF\x83"B\x7F\x85V\r  |! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r \b B\0 B\02 \b)\bP\r\0\v\v\v  \0A\xF1\x81j-\0\0M\r\0@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\vA\xF1\x81j-\0\0K\r\0\vA\xF8\xD7A\xC4\x006\0A\0!B\x7F!\v )pB\0Y@  (Ak6\v ArE B\x7FQq@A\xF8\xD7A\xC4\x006\0B~!\f\v  \xAC"\x85 }!\v \bAj$\0 )xB\0 ( (,k\xAC}Q\r \x07E \fA\xF0\0GrE@ \x07 >\0\f\v \x07  \xAA\f\v \x07  \xAB8\0\f\v \x07  \xC49\0\f\v \x07 7\0 \x07 7\b\f\vA Aj \fA\xE3\0G"\x1B!\b\x7F AF@ \x07! \v@ \bAt/"E\r\v B\x007\xA8A\0!@@@ !\0@ \x7F (" (hG@  Aj6 -\0\0\f\v %\v"j-\0!E\r  :\0\x1B Aj A\x1BjA A\xA8j\x98"A~F\r\0 A\x7FF@A\0! \f\v \0@ \0 Atj (6\0 Aj!\v \vE  \bGr\r\0\v \0 \bAtAr"\bAt\x9D"\r\0\vA\0! \0! +A!\v\f\b\vA\0! \0 A\xA8j\x7F (\xA8A\0\vE\r\v \0! +\f\v \v@A\0! \b/"E\r@ !\0@ \x7F (" (hG@  Aj6 -\0\0\f\v %\v"j-\0!E@ \0! A\0\f\v \0 j :\0\0 Aj" \bG\r\0\v \0 \bAtAr"\b\x9D"\r\0\vA\0! + \0! A!\v\f\vA\0! \x07@@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0j-\0!@  \x07j \0:\0\0 Aj!\f \x07"\0! A\0\f\v\0\v\0\v@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v j-\0!\r\0\vA\0!\0A\0! A\0\v! + (! )pB\0Y@  Ak"6\v )x  (,k\xAC|"P   QrEr\r \v@ \x07 \x006\0\v \fA\xE3\0F\r\0 +@ + AtjA\x006\0\v E@A\0! \f\v  jA\0:\0\0\v ( (,k\xAC )x ||! \r \x07A\0Gj!\r\v Aj! -\0"\r\f\v\vA!\vA\0! A\0! +\v \rA\x7F \r\x1B!\r\v \vE\r ! +!\f\vA\x7F!\r\v A\xB0j$\0 A\x90j$\0 \r\vC\0@ \0E\r\0@@@@ Aj\0\v \0 <\0\0\v \0 =\0\v \0 >\0\v \0 7\0\v\v\xE4\x7F~#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\x07@ B0\x88B\xFF\xFF\x83"\b\xA7"A\x81\xFF\0kA\xFDM@ \x07B\x88\xA7!@ \0P B\xFF\xFF\xFF\x83"\x07B\x80\x80\x80\bT \x07B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \0 \x07B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\vA\0  A\xFF\xFF\xFFK"\x1B!A\x81\x81\x7FA\x80\x81\x7F \x1B j!\f\v \0 \x07\x84P \bB\xFF\xFFRrE@ \x07B\x88\xA7A\x80\x80\x80r!A\xFF!\f\v A\xFE\x80K@A\xFF!\f\vA\x80\xFF\0A\x81\xFF\0 \bP"\x1B" k"A\xF0\0J@A\0!A\0!\f\v \x07 \x07B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!\x07A\0!  G@ Aj \0 \x07A\x80 k6 ) )\x84B\0R!\v  \0 \x07 g )\b"\0B\x88\xA7!@ )\0 \xAD\x84"\x07P \0B\xFF\xFF\xFF\x83"\0B\x80\x80\x80\bT \0B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \x07 \0B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\v A\x80\x80\x80s  A\xFF\xFF\xFFK"\x1B!\v A j$\0 B \x88\xA7A\x80\x80\x80\x80xq Atr r\xBE\v\x89\x7F~@@\x7F@@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A+k\0\0\v A-F E\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A:k"AuKr\r \0)pB\0S\r \0 \0(Ak6\f\v A:k! !A\0\v! AvI\r\0@ A0kA +O\r\0A\0!@  A +lj\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v!A0k! A\xCC\x99\xB3\xE6\0H A0k"A Mq\r\0\v \xAC! A +O\r\0@ \xAD B +~|!\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A0k"A M B0}"B\xAE\x8F\x85\xD7\xC7\xC2\xEB\xA3Sq\r\0\v A +O\r\0@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\vA0kA +I\r\0\v\v \0)pB\0Y@ \0 \0(Ak6\vB\0 }  \x1B!\f\vB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F! \0)pB\0S\r\0 \0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y@  (Ak6\vA\xF8\xD7A6\0\v B\0J\f\v@ A0G\r\0\x7F (" (hG@  Aj6 -\0\0\f\v %\vA_qA\xD8\0F@#\0A\xB0k"$\0\x7F (" (hG@  Aj6 -\0\0\f\v %\v!@\x7F@ A0G@@ A.G\r (" (hF\r\0  Aj6 -\0\0\f\v (" (hG\x7FA!  Aj6 -\0\0A! %\v!\f\v\v %\v"A0G@A!\v\f\v@ B}!\x7F (" (hG@  Aj6 -\0\0\f\v %\v"A0F\r\0\vA!\vA!\vB\x80\x80\x80\x80\x80\x80\xC0\xFF?!@@ !@@ A0k"\x07A +I\r\0 A.G"\f A r"A\xE1\0kAKq\r \f\r\0 \v\rA!\v !\f\v A\xD7\0k \x07 A9J\x1B!@ B\x07W@  Atj! \f\v BX@ A0j ? A j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFD?+ Aj )0 )8 ) " )("+  ) )  < )\b! )\0!\f\v E +r\r\0 A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ A@k )P )X  \0 \b \b \b \v B\0R\x1B \v \bAkA\xFFq"G\x1B  \vF\x1B! \vAk!  \vG\r\0\v Ak! \b! E\r\0\v AkA\xFFq" F@ A\x90j"\b A\xFEjA\xFFqAtj" (\0 At \bj(\0r6\0 !\v +A j! + A\x90j Atj 6\0\f\v\v@@ AjA\xFFq!\b A\x90j AkA\xFFqAtj!@A A +A-J\x1B!@@ !A\0!@@@  jA\xFFq" F\r\0 A\x90j Atj(\0" At(\xA0\x81"I\r\0  I\r Aj"AG\r\v\v +A$G\r\0B\0!A\0!B\0!@   jA\xFFq"F@ AjA\xFFq"At jA\x006\x8C\v A\x80j A\x90j Atj(\0r A\xF0j  B\0B\x80\x80\x80\x80\xE5\x9A\xB7\x8E\xC0\0+ A\xE0j )\xF0 )\xF8 )\x80 )\x88< )\xE8! )\xE0! Aj"AG\r\0\v A\xD0j \f? A\xC0j   )\xD0 )\xD8+B\0! )\xC8! )\xC0! A\xF1\0j" k" A\0 A\0J\x1B  H"\b\x1B"\x07A\xF0\0M\r\f\v  j! !  F\r\0\vA\x80\x94\xEB\xDC v!\vA\x7F tA\x7Fs!A\0! !@ A\x90j"\x07 Atj"  (\0" vj"6\0 AjA\xFFq  E  Fq"\x1B! +A k + \x1B! + q \vl! AjA\xFFq" G\r\0\v E\r  \bG@ At \x07j 6\0 \b!\f\v  (\0Ar6\0\f\v\v\v A\x90jA\xE1 \x07k\xC8T A\xB0j )\x90 )\x98 \xB1 )\xB8! )\xB0! A\x80jA\xF1\0 \x07k\xC8T A\xA0j   )\x80 )\x88\xAE A\xF0j   )\xA0" )\xA8"\xBC A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\v@ AjA\xFFq" F\r\0@ A\x90j Atj(\0"A\xFF\xC9\xB5\xEEM@ E AjA\xFFq Fq\r A\xF0j \f\xB7D\0\0\0\0\0\0\xD0?\xA2T A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\f\v A\x80\xCA\xB5\xEEG@ A\xD0j \f\xB7D\0\0\0\0\0\0\xE8?\xA2T A\xC0j   )\xD0 )\xD8< )\xC8! )\xC0!\f\v \f\xB7!\x1B  AjA\xFFqF@ A\x90j \x1BD\0\0\0\0\0\0\xE0?\xA2T A\x80j   )\x90 )\x98< )\x88! )\x80!\f\v A\xB0j \x1BD\0\0\0\0\0\0\xE8?\xA2T A\xA0j   )\xB0 )\xB8< )\xA8! )\xA0!\v \x07A\xEF\0K\r\0 A\xD0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?\xAE )\xD0 )\xD8B\0B\0d\r\0 A\xC0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?< )\xC8! )\xC0!\v A\xB0j    < A\xA0j )\xB0 )\xB8  \xBC )\xA8! )\xA0!@ Ak A\xFF\xFF\xFF\xFF\x07qN\r\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x837\x98  7\x90 A\x80j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ )\x90 )\x98B\x80\x80\x80\x80\x80\x80\x80\xB8\xC0\0\xB2! )\x88  A\0N"\x1B! )\x80  \x1B! \b \x07 G A\0Hrq  B\0B\0dA\0GqE   j"A\xEE\0jNq\r\0A\xF8\xD7A\xC4\x006\0\v A\xF0j   \xB0 )\xF8! )\xF0\v! \r 7( \r 7 A\x90\xC6\0j$\0 \r)(! \r) !\f\vB\0!\f\vB\0!\v \0 7\0 \0 7\b \rA0j$\0\v\xC0\x7F~#\0A\x80k"$\0@@@  B\0B\0dE\r\0\x7F B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +\x7F B0\x88\xA7A\xFF\xFFq"\x07A\xFF\xFFG@A \x07\rAA  +\x84P\x1B\f\v  +\x84P\v\vE\r\0 B0\x88\xA7"\bA\xFF\xFFq"A\xFF\xFFG\r\v Aj    +  )" )"  \xAF )\b! )\0!\f\v  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" +  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" dA\0L@  +  d@ !\f\v A\xF0\0j  B\0B\0+ )x! )p!\f\v B0\x88\xA7A\xFF\xFFq!\x07 ~  A\xE0\0j  +B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )h" +B0\x88\xA7A\xF8\0k! )\`\v! \x07E@ A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )X" B0\x88\xA7A\xF8\0k!\x07 )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!\v +B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84! +  \x07J@@~ + \v}  V\xAD}" B\0Y@  }"\x84P@ A j  B\0B\0+ )(! ) !\f\v B\x86 B?\x88\x84\f\v +B\x86 B?\x88\x84\v! + B\x86! Ak" \x07J\r\0\v \x07!\v@ + \v}  V\xAD}" B\0S@ +! \f\v  }"\x84B\0R\r\0 A0j  B\0B\0+ )8! )0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@@ B?\x88 Ak! B\x86! B\x86\x84" B\x80\x80\x80\x80\x80\x80\xC0\0T\r\0\v\v \bA\x80\x80q!\x07 A\0L@ A@k  B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 A\xF8\0j \x07r\xADB0\x86\x84B\0B\x80\x80\x80\x80\x80\x80\xC0\xC3?+ )H! )@!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83  \x07r\xADB0\x86\x84!\v \0 7\0 \0 7\b A\x80j$\0\v\x87\x7F~#\0A\xD0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\f B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq"\bA\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f !\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\f\f\v \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!\f\v  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0 \f  \x84P\x1B!\fB\0!\f\v  \x84P@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xC0j  +  + +P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )\xC8! + )\xC0!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A\xB0j  \v  \v \vP" \x1ByB\xC0\0B\0 \x1B|\xA7" Ak6  jAk! )\xB8!\v )\xB0!\v A\xA0j \vB\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86 B1\x88\x84"B\0B\x80\x80\x80\x80\xB0\xE6\xBC\x82\xF5\0 }"B\02 A\x90jB\0 )\xA8}B\0 B\02 A\x80j )\x98B\x86 )\x90B?\x88\x84"B\0 B\02 A\xF0j B\0B\0 )\x88}B\02 A\xE0j )\xF8B\x86 )\xF0B?\x88\x84"B\0 B\02 A\xD0j B\0B\0 )\xE8}B\02 A\xC0j )\xD8B\x86 )\xD0B?\x88\x84"B\0 B\02 A\xB0j B\0B\0 )\xC8}B\02 A\xA0j B\0 )\xB8B\x86 )\xB0B?\x88\x84B}"B\02 A\x90j B\x86B\0 B\02 A\xF0\0j B\0B\0 )\xA8 )\xA0" )\x98|" T\xAD| BV\xAD|}B\02 A\x80jB }B\0 B\02  \b \x07kj"\bA\xFF\xFF\0j!~ )p"B\x86"\r )\x88"B\x86 )\x80B?\x88\x84|"B\xE7\xEC\0}"B \x88" +B\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86"B \x88"~" B\x86"B \x88"\v  V\xAD \r V\xAD )xB\x86 B?\x88\x84 B?\x88|||B}"B \x88"~|"\r T\xAD \r \r B\xFF\xFF\xFF\xFF\x83" B?\x88" +B\x86\x84B\xFF\xFF\xFF\xFF\x83" +~|"\rV\xAD|  ~|  ~" + ~|" T\xADB \x86 B \x88\x84| \r B \x86|" \rT\xAD|   B\xFF\xFF\xFF\xFF\x83" +~"\r  \v~|" \rT\xAD    B\xFE\xFF\xFF\xFF\x83"\r~|"V\xAD||"V\xAD|   ~" \r ~|"  +~|" + \v ~|"B \x88 + V\xAD  T\xAD  +V\xAD||B \x86\x84|" T\xAD|     \r~" + \v ~|"B \x88  +T\xADB \x86\x84|" + T\xAD + + B \x86|" +V\xAD||"V\xAD|   + B \x86" \r ~| T\xADB\x7F\x85"V  +Rq\xAD|"V\xAD|"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0X@  \x84! A\xD0\0j  B\x80\x80\x80\x80\x80\x80\xC0\0T"\x07\xAD"\v\x86" +  \v\x86 B\x88 \x07A?s\xAD\x88\x84"  2 \bA\xFE\xFF\0j  \x07\x1BAk! B1\x86 )X} )P"B\0R\xAD}!\vB\0 }\f\v A\xE0\0j B?\x86 B\x88\x84" + B\x88"  2 B0\x86 )h} )\`"B\0R\xAD}!\v !B\0 }\v! A\xFF\xFFN@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v~ A\0J@ \vB\x86 B?\x88\x84! B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84!\v B\x86\f\v A\x8F\x7FL@B\0!\f\v A@k + A kg A0j   A\xF0\0j6 A j   )@" + )H"\v2 )8 )(B\x86 ) "B?\x88\x84} )0" B\x86"T\xAD}!  }\v! Aj  BB\02   BB\02 \v +  +B\x83" |"T   T\xAD|" V  Q\x1B\xAD|" +T\xAD|"   B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )V  )"V  Q\x1Bq\xAD|"V\xAD|"  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )\0V  )\b"V  Q\x1Bq\xAD|" T\xAD| \f\x84!\f\v \0 7\0 \0 \f7\b A\xD0j$\0\v\xBF\x7F#\0A\xD0\0k"$\0@ A\x80\x80N@ A j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+ )(! ) ! A\xFF\xFFI@ A\xFF\xFF\0k!\f\v Aj  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+A\xFD\xFF  A\xFD\xFFO\x1BA\xFE\xFFk! )! )!\f\v A\x81\x80\x7FJ\r\0 A@k  B\0B\x80\x80\x80\x80\x80\x80\x809+ )H! )@! A\xF4\x80~K@ A\x8D\xFF\0j!\f\v A0j  B\0B\x80\x80\x80\x80\x80\x80\x809+A\xE8\x81}  A\xE8\x81}M\x1BA\x9A\xFEj! )8! )0!\v   B\0 A\xFF\xFF\0j\xADB0\x86+ \0 )\b7\b \0 )\x007\0 A\xD0\0j$\0\v<\0 \0 7\0 \0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x83B0\x88\xA7 B0\x88\xA7A\x80\x80qr\xADB0\x86\x847\b\v\xC0\x7F~A\x7F!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Rq\r\0 \0  \x84\x84P@A\0\v  \x83B\0Y@  R  Sq\r \0  \x85\x84B\0R\v \0B\0R  U  Q\x1B\r\0 \0  \x85\x84B\0R!\v \v8\0 \0A\xD0k \0 \0A\x93\xF1\xFF\xFF\x07J\x1B"\0Aq@A\0\v \0A\xECj"\0A\xE4\0o@A\v \0A\x90oE\v\x85\x7F~#\0A\x80k"\b$\0 @\x7F@@\x7F@@@ -\0\0"A%G@ \r +\f\x07\vA\0!A! @ -\0"\x07A-k\0\v \x07A\xDF\0F\r \x07\r\v \0 +j :\0\0 +Aj\f\v \x07! -\0!\x07A! \vA\0!@\x7F  j \x07"A+Fj" ,\0\0A0kA M@ \bA\fjA +B\xFF\xFF\xFF\xFF\xBE\xA7! \b(\f\f\v \b 6\fA\0! \v"\x07-\0\0"A\xC3\0k"\vAKA \vtA\x99\x80\x80qEr\r\0 "\r\0 \x07 G!\v A\xCF\0F A\xC5\0Fr\x7F \x07-\0! \x07Aj \x07\v! \bAj!\x07 ! A\0!#\0A\xD0\0k"\v$\0A\x8A !\rA0!A\xA8\x80\b!\f@ \b\x7F@@@@@@@\x7F@@@@@@@@@~@@@@@@@@@@@@@@@@@@@@@@@@@@ \xC0"A%kV!---------------------------'-\x07\b +---\r---- ------\0&-\b-\v--\f--%-\x1B-\v ("AM\r"\f*\v ("AK\r) A\x87\x80\bj\f"\v ("A\vK\r( A\x8E\x80\bj\f!\v ("A\vK\r' A\x9A\x80\bj\f \v 4B\xEC|B\xE4\0\x7F!\f#\vA\xDF\0!\v 4\f!\f!\vA\xD2!\r\f\v 4"B\xEC|!@ ("AL@  B\xEB| \xBDAF\x1B!\f\v A\xE9I\r\0 B\xED|  \xBDAF\x1B!\v A\xE7\0F\r\f \v 4\b!\f\vA! (\b"E@B\f!\f \v \xAC"B\f}  A\fJ\x1B!\f\v (Aj\xAC!A!\f\v (Aj\xAC!\f\x1B\v 4!\f\v \bA6|A\xD4!\f\vA\xA7\x80\bA\xA6\x80\b (\bA\vJ\x1B\f\vA\xF7!\r\f\vA\0!\fA\0!#\0Ak"$\0 4!~ ("\rA\fO@ \r \rA\fm"A\flk"A\fj  A\0H\x1B!\r  Auj\xAC |!\v A\fj! B}B\x88X@ \xA7"\fA\xC4\0kAu!@ \x7F \fAqE@ Ak! E\rA\f\v E\rA\0\v6\0\v \fA\x80\xE7\x84l A\x80\xA3ljA\x80\xD6\xAF\xE3\x07j\xAC\f\v B\xE4\0}" B\x90\x7F"B\x90~}"B?\x87\xA7 \xA7j!@@@ \xA7"A\x90j  B\0S\x1B"\x7F\x7F A\xC8N@ A\xACO@A!\f A\xACk\f\vA!\f A\xC8k\f\v A\xE4\0k  A\xE3\0J"\f\x1B\v"\rA\0A\v! \r\f\v Av! AqE! E\r\v  6\0\v B\x80\xE7\x84~  \fAl A\xE1\0ljj k\xACB\x80\xA3~|B\x80\xAA\xBA\xC3|\v! \rAtA\x80\xFE\0j(\0"A\x80\xA3j  (\f\x1B  \rAJ\x1B! (\f! 4\b! 4! 4\0 Aj$\0  \xAC| Ak\xACB\x80\xA3~| B\x90~| B<~|| 4$}\f\b\v 4\0!\f\v \bA6|A\xD6!\f\vA\xE4!\r\f\v ("A\x07 \x1B\xAC\f\v ( (kA\x07jA\x07n\xAD!\f\v ( (AjA\x07pkA\x07jA\x07n\xAD!\f\v \xBD\xAD!\f\v 4\v!A!\f\vA\xA9\x80\b!\f\f +\vA\xAA\x80\b!\f\f \v 4B\xEC|B\xE4\0\x81" B?\x87"\x85 }!\f +\v 4"B\xEC|! B\xA4?S\r + \v 70 \b \x07A\x9B \vA0je6| \x07!\f\v ( A\0H@ \bA\x006|A\xD7!\f\v \v ($"A\x90m"A\xE4\0l  A\x90lk\xC1As!\v \0 6 \0B\x007 AtA\xAC\xDAj!@@A\x80\xD8(\0"A t"\x07qE@A\x80\xD8  \x07r6\0  \x006\0 \0 6\f\v A AvkA\0 AG\x1Bt! (\0!@ "(Axq F\r Av! At!  Aqj"\x07("\r\0\v \x07 \x006 \0 6\v \0 \x006\f \0 \x006\b\v (\b" \x006\f  \x006\b \0A\x006 \0 6\f \0 6\b\v\v\0 \0E@A\0\v \0 \xC5\v\0 \0  A4A5\xD0\v-\0 \0A\xCC\0j1 \0A@k1 \0A4j1 \0A(j1 \0Aj1 \0Aj1\v\xBC\0@@@@@@@@@@@ A k\0\b +\b  + + +\b \x07\v  (\0"Aj6\0 \0 (\x006\0\v  (\0"Aj6\0 \0 2\x007\0\v  (\0"Aj6\0 \0 3\x007\0\v  (\0"Aj6\0 \0 0\0\x007\0\v  (\0"Aj6\0 \0 1\0\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 +\x009\0\v \0  \0\v\v  (\0"Aj6\0 \0 4\x007\0\v  (\0"Aj6\0 \0 5\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 )\x007\0\vo\x7F \0(\0",\0\0A0k"A K@A\0\v@A\x7F! A\xCC\x99\xB3\xE6\0M@A\x7F  A +l"j  A\xFF\xFF\xFF\xFF\x07sK\x1B!\v \0 Aj"6\0 ,\0 ! !A0k"A +I\r\0\v \v\xF5\x7F~#\0A@j"\b$\0 \b 6< \bA)j! \bA'j! \bA(j!@@@@@A\0!\x07@ !\r \x07 A\xFF\xFF\xFF\xFF\x07sJ\r \x07 j!@@@@ "\x07-\0\0"\v@@@@ \vA\xFFq"E@ \x07!\f\v A%G\r \x07!\v@ \v-\0A%G@ \v!\f\v \x07Aj!\x07 \v-\0 \vAj"!\vA%F\r\0\v\v \x07 \rk"\x07 A\xFF\xFF\xFF\xFF\x07s"J\r \0@ \0 \r \x073\v \x07\r\x07 \b 6< Aj!\x07A\x7F!@ ,\0A0k" +A K\r\0 -\0A$G\r\0 Aj!\x07A! +!\v \b \x076\b \b \bA\bj"\x0760A\x7F! \x07\v!\vA\0!\x07@@ \v(\0"\rE\r\0 \bAj \r\xCA"\rA\0H\r \r \x07kK\r\0 \vAj!\v \x07 \rj"\x07 I\r\v\vA=! + \x07A\0H\r\f \0A  \x07 \f7 \x07E@A\0!\x07\f\vA\0! + \b(0!\v@ \v(\0"\rE\r \bAj" \r\xCA"\r +j" + \x07K\r \0 \r3 \vAj!\v \x07 +K\r\0\v\v \0A  \x07 \fA\x80\xC0\0s7  \x07 \x07 H\x1B!\x07\f\b\v  A\0Hq\r A=! + \0 \b+0  \f \x07 \0"\x07A\0N\r\x07\f +\v \x07-\0!\v \x07Aj!\x07\f\0\v\0\v \0\r E\rA!\x07@  \x07Atj(\0"\0@  \x07Atj \0  \xCDA! \x07Aj"\x07A +G\r\f\v\v\v \x07A +O@A!\f +\v@  \x07Atj(\0\rA! \x07Aj"\x07A +G\r\0\v\f \vA! +\f\v \b \x07:\0'A! !\r \v!\f\v + \rk"\v \vJ\x1B" A\xFF\xFF\xFF\xFF\x07sJ\rA=! +   j" H\x1B"\x07 K\r \0A \x07 \f7 \0  3 \0A0 \x07 \fA\x80\x80s7 \0A0  \vA\07 \0 \r \v3 \0A \x07 \fA\x80\xC0\0s7 \b(! + ( ,\0\v"\0 \0A\0H"\0\x1B@ (\0  \0\x1B-\0\0 +A- +(\0(\0A\xFFqF!\x07\v A\x006\xA0 B\x007\x98 A\x006\x90 B\x007\x88 A\x006\x80 B\x007x  \x07 A\xACj A\xA8j A\xA7j A\xA6j A\x98j A\x88j A\xF8\0j A\xF4\0j\xFC@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (t" J@ \0 kAtj (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\f\v (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0  \b\xC0A\0H"\x1B"\f \f \v \b \x1Bj + \x07 A\xA8j ,\0\xA7 ,\0\xA6 A\x98j" A\x88j"\x07 A\xF8\0j"\b \xFB  \0 (\f (\b  Z ! \b  \x07    (\xAC# A\xB0j$\0\v0\0\v\xDB\b\x7F#\0A\xB0k"\0$\0 \0 7 \0 7 \0 \0A\xC0j"\x076\xBC \0A\xD0j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xBCj \x07A\xE3 \0P"\x07A\x7FF\r \0(\xBC!\r \x07/"\v! \vE\r\v \0A\xCCj"\b $ \b>" \0(\xBC"\b \x07 \bj (\0( \0 \x07A\0J@ \0(\xBC-\0\0A-F! +\v \0A\x006\xC0 \0B\x007\xB8 \0A\x006\xB0 \0B\x007\xA8 \0A\x006\xA0 \0B\x007\x98  + \0A\xCCj \0A\xC8j \0A\xC7j \0A\xC6j \0A\xB8j \0A\xA8j \0A\x98j \0A\x94j\xFC@\x7F \0(\x94"\b \x07H@ \b \x07 \bkAtj \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\f\v \b \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v /"\f! \fE\r\v  \0A,j \0A(j ( \x07 j  + \0A\xC8j \0,\0\xC7 \0,\0\xC6 \0A\xB8j" + \0A\xA8j"\x07 \0A\x98j" \b\xFB   \0(, \0((  Z \f!   \x07  +  \0(\xCC# \v! \r! \0A\xB0j$\0\v0\0\v\xC0\x7F#\0A\xC0k"\0$\0 \0 6\xB8 \0 6\xBC \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07=! \0A\0:\0 \0A\xBCj   \x07 (  \0Aj  \0Aj \0Aj \0A\xB0j\x80@@ ,\0\vA\0H@ (\0A\x006\0 A\x006\f\v A\0:\0\v A\x006\0\v \0-\0AF@  A- (\0(,\0\xDD\v A0 (\0(,\0! \0("Ak! \0(!@@  O\r\0 (\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H" +\x1B"\vO  \v ( +\x1BAtjAjIqE@ \x07  A\0H" \x1B"  k"Au" +j!\x07 + \bA\xFF\xFF\xFF\xFF\x07qAkA \x1B"\b kK@  \b \x07 \bk  \xFF\v At (\0  ,\0\vA\0H\x1Bj! @   \xFC +\0\0\v  jA\x006\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xA2 ( \x07 ,\0"A\0H" +\x1B!@ (\b  +\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b At" @ \b Atj  \xFC +\0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v \b AtjA\x006\0\f\v   j k  A\0  \xDE\v \x07 \v Aj$\0\v \0A\xBCj \0A\xB8j(@  (\0Ar6\0\v \0(\xBC \0(# \0(! \0A\x006 @  \0(\0\v \0A\xC0j$\0\v\xDD\x7F#\0A\xF0k"\x07$\0 \x07 6\xE8 \x07 6\xEC \x07A\xE3\x006\xCC \x07 \x07A\xD0j6\xC8 \x07A\xC0j" $ =!\0 \x07A\0:\0\xBF@ \x07A\xECj    (  \x07A\xBFj \0 \x07A\xC8j \x07A\xC4j \x07A\xE0j\x80E\r\0 \x07A\xEE\x1B(\0\x006\0\xB7 \x07A\xE7\x1B)\0\x007\xB0 \0 \x07A\xB0j \x07A\xBAj \x07A\x80j \0(\0(0\0 \x07Aj!\0@ \x07(\xC4" \x07(\xC8"k"A\x89N@ AvAj/"\0!\b \0E\r\v \0! \x07-\0\xBFAF@ \0A-:\0\0 \0Aj!\v \x07A\xA8j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xB0j \x07A\x80j"  \xB1 kAuj-\0\0:\0\0 Aj! Aj! \x07(\xC4!\f\v\v0\0\v0\0\v \x07A\xECj \x07A\xE8j(@  (\0Ar6\0\v \x07(\xEC \x07(\xC0# \x07(\xC8!\0 \x07A\x006\xC8 \0@ \0 \x07(\xCC\0\v \x07A\xF0j$\0\v\xAE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07>! \0A\0:\0 \0A\x8Cj   \x07 (  \0Aj  \0Aj \0Aj \0A\x84j\x85@@ ,\0\vA\0H@ (\0A\0:\0\0 A\x006\f\v A\0:\0\v A\0:\0\0\v \0-\0AF@  A- (\0(\0\xAA\v A0 (\0(\0 \0("Ak! \0(!A\xFFq!@@  O\r\0 -\0\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H" +\x1B"\vO  \v ( +\x1BjAjIqE@ \x07  A\0H" \x1B"  k"j!\x07  \bA\xFF\xFF\xFF\xFF\x07qAkA + \x1B"\b kK@  \b \x07 \bk  \xA4\v (\0  ,\0\vA\0H\x1B j! @   \xFC +\0\0\v  jA\0:\0\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xCE ( \x07 ,\0"A\0H" +\x1B!@ (\b  +\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA + ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b @  \bj  \xFC +\0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v  \bjA\0:\0\0\f\v   j k  A\0  \x89\v \x07 \v Aj$\0\v \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0(# \0(! \0A\x006 @  \0(\0\v \0A\x90j$\0\v\xD1\x7F#\0A\x90k"\x07$\0 \x07 6\x88 \x07 6\x8C \x07A\xE3\x006\x9C \x07 \x07A\xA0j6\x98 \x07A\x90j" $ >!\0 \x07A\0:\0\x8F@ \x07A\x8Cj    (  \x07A\x8Fj \0 \x07A\x98j \x07A\x94j \x07A\x84j\x85E\r\0 \x07A\xEE\x1B(\0\x006\0\x87 \x07A\xE7\x1B)\0\x007\x80 \0 \x07A\x80j \x07A\x8Aj \x07A\xF6\0j \0(\0( \0 \x07Aj!\0@ \x07(\x94" \x07(\x98"k"A\xE3\0N@ Aj/"\0!\b \0E\r\v \0! \x07-\0\x8FAF@ \0A-:\0\0 \0Aj!\v \x07A\x80j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xF6\0j  \xB4 \x07k \x07j-\0 +:\0\0 Aj! Aj! \x07(\x94!\f\v\v0\0\v0\0\v \x07A\x8Cj \x07A\x88j)@  (\0Ar6\0\v \x07(\x8C \x07(\x90# \x07(\x98!\0 \x07A\x006\x98 \0@ \0 \x07(\x9C\0\v \x07A\x90j$\0\v\0A\xFC \v\xC7\x7F#\0A\xA0k"\b$\0 \b \bA\xA0j"6\f#\0A\x90k"\x07$\0 \x07 \x07A\x84j6 \0A\bj \x07A j" \x07Aj   \x88 \x07B\x007 \x07 6\f \b(\f \bAj"kAu! \0(\b!\0#\0Ak"$\0  \0H6\f  \x07A\fj  \x07Aj\xA4!\0 A\fjI Aj$\0 \0A\x7FF@0\0\v \b  \0Atj6\f \x07A\x90j$\0 \b(\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj (\0\xBE Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 $\0\v\xB8\0#\0A\x80k"$\0  A\xF4\0j6\f \0A\bj Aj" A\fj   \x88 (\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj ,\0\0\xC0 Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 A\x80j$\0\v\xB8\r\x7F#\0A0k"\x07$\0 \x07 6, A\x006\0 \x07 $ \x07=!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07 +\0\b \v\f\r\v\v \0 Aj \x07A,j   \b\x8B\f\v \0 Aj \x07A,j   \b\x8A\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07A\xA8\x86)\x007 \x07A\xA0\x86)\x007 \x07A\x98\x86)\x007\b \x07A\x90\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A\xC8\x86)\x007 \x07A\xC0\x86)\x007 \x07A\xB8\x86)\x007\b \x07A\xB0\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j!\0#\0Ak"$\0  6\f@@ \0 A\fj(\r\0 \bA \0: \b(\0(\f\0E\r\0 \0Q\f\v\v \0 A\fj(@  (\0Ar6\0\v Aj$\0\f\r\v \x07A,j!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x95" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xD0\x86A,\xFC +\0\0 \x07 \0      \x07 \x07A,jV6,\f\v\v \x07A\x90\x87(\x006 \x07A\x88\x87)\x007\b \x07A\x80\x87)\x007\0 \x07 \0      \x07 \x07AjV6,\f +\v \x07A,j   \bAN!\0@ (\0"Aq \0A!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07 +\0\b \v\f\r\v\v \0 Aj \x07A\fj   \b\x8E\f\v \0 Aj \x07A\fj   \b\x8D\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07B\xA5\xDA\xBD\xA9\xC2\xEC\xCB\x92\xF9\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07B\xA5\xB2\xB5\xA9\xD2\xAD\xCB\x92\xE4\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj!\0#\0Ak"$\0  6\f@@ \0 A\fj)\r\0 \0;"A\0H\r\0 \b(\b Atj-\0\0AqE\r\0 \0S\f\v\v \0 A\fj)@  (\0Ar6\0\v Aj$\0\f\r\v \x07A\fj!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x97" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xF8\x85(\0\x006\0\x07 \x07A\xF1\x85)\0\x007\0 \x07 \0      \x07 \x07A\vjW6\f\f\v\v \x07A\x80\x86-\0\0:\0 \x07A\xFC\x85(\0\x006\0 \x07 \0      \x07 \x07AjW6\f\f +\v \x07A\fj   \bAO!\0@ (\0"Aq \0A! (\b# Aj A\fj   \x8C (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8D (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8E (\f Aj$\0\vC\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BjW\v;\x7F#\0Ak"$\0 B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\b \0      A\bj Aj"W $\0\v+\x7F  ("A\xB5\xFB~qA\x88r6    \x91  6\v\xB7\x07\x7F\x7F#\0A\x90k"\0$\0 \0B%7\x88 \0A\x88j"\x07ArA\x82 (\x91!\b \0 \0A\xE0j" 6\xDC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xE0j  \0A\x88j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xDCj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xDCj  \0A\x88j \0P\v"A\x7FF\r \0(\xDC\f\vA\0\v \0(\xDC"\x07  \x07j" + G!\v@ \0A\xE0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v +  \0A\xEC\0j \0A\xE8\0j \f\x90 \0(d#   \0(l \0(h  \\! \b!! \0A\x90j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xF0k"\0$\0 \0B%7\xE8 \0A\xE8j"ArA\xD7 (\x91!\x07 \0 \0A\xC0j"\b6\xBC*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\xC0j  \0A\xE8j" \0A0j]"AL\r*! \0 9 \0A\xBCj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\xBCj  \0A\xE8j \0P\v"A\x7FF\r \0(\xBC\f\vA\0\v \0(\xBC"  j" G! +@ \0A\xC0j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $  +  \0A\xCC\0j \0A\xC8\0j \v\x90 \0(D#   \0(L \0(H  \\! \x07!! \0A\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0\0F" +r A\x80qE A\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA + \b\x1B +\x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xF8\0j \0 A\x90j \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (x"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (x!\v A\x83j"\0  G! Aj"\x07 $ \0   Aj"\0 A\fj A\bj \x07\x90 (#  \0 (\f (\b  \\ A\x90j$\0\v\xDE\x7F#\0Ak"$\0  6\f@ -\0AqE@ \0     \0(\0( \0!\f\v  $ n!\0 (\0#  \0 \0(\0AA \x1Bj(\0\0 (\0"  ,\0\v"A\0H\x1B!@   \xC0A\0H"\0\x1B ( A\xFFq \0\x1BAtj F@ (\f!   A\fj (\0\xBE Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v+\x7F  ("A\xB5\xFB~qA\x88r6    \x94  6\v\xB7\x07\x7F\x7F#\0A\xE0k"\0$\0 \0B%7\xD8 \0A\xD8j"\x07ArA\x82 (\x91!\b \0 \0A\xB0j" 6\xAC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xB0j  \0A\xD8j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xACj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xACj  \0A\xD8j \0P\v"A\x7FF\r \0(\xAC\f\vA\0\v \0(\xAC"\x07  \x07j" + G!\v@ \0A\xB0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v +  \0A\xEC\0j \0A\xE8\0j \f\x93 \0(d#   \0(l \0(h  Z! \b!! \0A\xE0j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xC0k"\0$\0 \0B%7\xB8 \0A\xB8j"ArA\xD7 (\x91!\x07 \0 \0A\x90j"\b6\x8C*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\x90j  \0A\xB8j" \0A0j]"AL\r*! \0 9 \0A\x8Cj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\x8Cj  \0A\xB8j \0P\v"A\x7FF\r \0(\x8C\f\vA\0\v \0(\x8C"  j" G! +@ \0A\x90j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $  +  \0A\xCC\0j \0A\xC8\0j \v\x93 \0(D#   \0(L \0(H  Z! \x07!! \0A\xC0j$\0 \f\v0\0\v\v\xC3\x7F#\0A\xF0\0k"\0$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0\0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0P Ar!\f\v \x07A\bG\r\0 \0A0:\0P \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0Q \0A\xD0\0jAr!\v \0A\xC8\0j  \0A\xE8\0j  \x92 \0(H!\x07@ A\x88\x80qA\x88\x80G\r\0@  \x07F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0\0j" \x07 G! \0Aj"\b $   \x07 \0Aj" \0A\fj \0A\bj \b\x93 \0(#   \0(\f \0(\b  Z \0A\xF0\0j$\0\v\r\0    \x94\v\xA5\x7F~#\0A\xF0\0k"$\0 A\xD0\0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@  \x07A\xC0\0F\r A-:\0P \0Ar!\0B\0 }\f\v \v! + \b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA + \b\x1B \x1B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8j  \0A\xC4j  \0A\xD0j$\0\v\x99\x8B.\x7F}|#\0Ak"$\0  6\f A\x006\b B\x007\0    j"  k\xC2#\0A\xE0\0k"%$\0 %A\bj! (\0"! ( k!#\0A\xC0k"$\0 A\x006\xA0 B\x007\x98 A\x006\xB0 B\x007\xA8 A\xB4j"A\x006\b B\x007\0 A\x80\xC0\0\xB6 A\x80\xC0\0\x96 A\fjA\0A0\xFC\v\0  6\b  6@\x7F Aj!\v\x7FAzA\x94-\0\0A1G\r\0A~ \vE\r \vA\x006 \v( "E@ \vA\x006( \vA/6 A/!\v \v($E@ \vA06$\vA| \v((AA\xD07 \0"E\r \v 6 A\x0068  \v6\0 A\xB4\xFE\x006A~!@ \vE\r\0 \v( E\r\0 \v($"E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0@@ (8"@ ((AG\r\v A6( A6\f\f\v \v((  \0 A\x0068 \v( A6( A6\fE\r\v \v($E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0A\0! A\x0064 B\x007, A\x006 \vA\x006\b \vB\x007 (\f"@ \v Aq60\v B\x007< A\x006$ A\x80\x806 B\x80\x80\x80\x80p7 B\xB4\xFE\x007 B\x81\x80\x80\x80p7\xC47  A\xB4 +j"6p  6T  6P\vA\0 E\r\0 \v((  \v($\0 \vA\x006 \v\vE@ A\x006\xAC@@  (\0"6  ( k6A\0!\v#\0Ak"$\0A~!\x1B@ Aj"\rE\r\0 \r( E\r\0 \r($E\r\0 \r("\x07E\r\0 \x07(\0 \rG\r\0 \x07("A\xB4\xFE\0kAK\r\0 \r(\f"E\r\0 \r(\0"E@ \r(\r\v A\xBF\xFE\0F@ \x07A\xC0\xFE\x006A\xC0\xFE\0!\v \x07A\xDC\0j!- \x07A\xF2\0j!. \x07A\xF4j!" \x07A\xD8\0j!& \x07A\xF0\0j!# \x07A\xB4 +j! \x07A\xF4\0j! \x07(@! \x07(\x958\0 \fAj!\f\f\v\v  \fAt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@  \x07 Y  (\0 j"6\0  ( k"6\v    K\x1B"@   Y  (\0 j"6\0  ( k6\v A\0:\0\0 \0 \0(,"6 \0 6 \v\b\0 \0K!\v\0 \0 \0(\0A\fk(\0j\xC0\v\0 \0 \0(\0A\fk(\0j\x81\v +\0 \0A\bk\xC0\v +\0 \0A\bk\x81\v\0 \0  )\bA\0  (\0(\0\v \0 \0\xB0!\v\x95\x7F~ (," ("I@  6, !\vB\x7F! +@ Aq"\x07E AF \x07AFqr\r\0 @  ( A j ,\0+A\0H\x1Bk\xAC! \v@@@ \0\v A\bq@ (\f (\bk\xAC!\b\f\v  (k\xAC!\b\f\v !\b\v  \b|"B\0S  Ur\r\0 A\bq!@ P\r\0 @ (\fE\r\v AqE\r\0 E\r\v @  6  (\b \xA7j6\f\v Aq@  ( \xA7j6\v ! +\v \0 +7\b \0B\x007\0\v\x99\b\x7F A\x7FF@A\0\v \0(\b! \0(\f! \0\x7F \0(" \0(G@ \0(,\f\v \0-\x000AqE@A\x7F\v \0(,!\x07 \0(! \0A j"A\0\xAA A + \0((A\xFF\xFF\xFF\xFF\x07qAk \0,\0+A\0N\x1B" \0 \0(  \0,\0+"\bA\0H" \x1B"6 \0  \0($ \b \x1Bj6 \0   kj"6  \x07 kj\v" Aj"  I\x1B"6, \0-\x000A\bq@ \0 6 \0 \0( \0A j \0,\0+A\0H\x1B"6\b \0   kj6\f\v \0 \xC0\xC3\v\x8E\x7F \0(," \0("I@ \0 6, !\v\x7FA\x7F \0(\f" \0(\bM\r\0 A\x7FF@ \0 6 \0 Ak6\fA\0\v \0-\x000AqE@A\x7F Ak-\0\0 A\xFFqG\r\v \0 6 \0 Ak"\x006\f \0 :\0\0 \v\v_\x7F \0(," \0("I@ \0 6, !\vA\x7F!@ \0-\x000A\bqE\r\0  \0("K\x7F \0 6  \v \0(\f"\0M\r\0 \0-\0\0!\v \v\0 \0 \0(\0A\fk(\0j\xC1\v +\0 \0A\bk\xC1\v \0 \0A\f\xA5\v\0 \0AjK \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0\0\0\xB0A\xA2!\vA  A\0H\x1B! + \vA0jA\xA0A\0 \fA\0N\x1Bj"!\x07@ \x07 \xFC"6\0 \x07Aj!\x07  \xB8\xA1D\0\0\0\0e\xCD\xCDA\xA2"D\0\0\0\0\0\0\0\0b\r\0\v@ \fA\0L@ \f! \x07! !\b\f\v !\b \f! @A AO\x1B!@ \x07Ak" \bI\r\0 \xAD!\x1BB\0!@  5\0 \x1B\x86 |" B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}>\0 Ak" \bO\r\0\v B\x80\x94\xEB\xDCT\r\0 \bAk"\b >\0\v@ \b \x07"I@ Ak"\x07(\0E\r\v\v \v \v(, k" 6, !\x07 A\0J\r\0\v\v A\0H@ +AjA nAj! A\xE6\0F!@A A\0 k" A O\x1B!\r@  \bM@A\0A \b(\0\x1B!\x07\f\vA\x80\x94\xEB\xDC \rv!A\x7F \rtA\x7Fs!A\0! \b!\x07@ \x07 \x07(\0" \rv j6\0  q l! \x07Aj"\x07 I\r\0\vA\0A \b(\0\x1B!\x07 E\r\0  6\0 Aj!\v \v \v(, \rj" 6,  \x07 \bj"\b \x1B" Atj   kAu J\x1B! A\0H\r\0\v\vA\0! @  \bM\r\0  \bkAuA l! A +!\x07 \b(\0"A +I\r\0@ Aj!  \x07A +l"\x07O\r\0\v\v + A\0 A\xE6\0G\x1Bk A\xE7\0F +A\0Gqk"  kAuA lA kH@ \vA0jA\x84\`A\xA4b \fA\0H\x1Bj A\x80\xC8\0j"\fA m"Atj!\rA +!\x07 \f A lk"A\x07L@@ \x07A +l!\x07 Aj"A\bG\r\0\v\v@ \r(\0"\f \f \x07n" \x07lk"E \rAj" Fq\r\0@ AqE@D\0\0\0\0\0\0@C! \x07A\x80\x94\xEB\xDCG \b \rOr\r \rAk-\0\0AqE\r\vD\0\0\0\0\0@C!\vD\0\0\0\0\0\0\xE0?D\0\0\0\0\0\0\xF0?D\0\0\0\0\0\0\xF8?  F\x1BD\0\0\0\0\0\0\xF8?  \x07Av"F\x1B  K\x1B!@ \r\0 -\0\0A-G\r\0 \x9A! \x9A!\v \r \f k"6\0  \xA0 a\r\0 \r  \x07j"6\0 A\x80\x94\xEB\xDCO@@ \rA\x006\0 \b \rAk"\rK@ \bAk"\bA\x006\0\v \r \r(\0Aj"6\0 A\xFF\x93\xEB\xDCK\r\0\v\v  \bkAuA l! A +!\x07 \b(\0"A +I\r\0@ Aj!  \x07A +l"\x07O\r\0\v\v \rAj"   I\x1B!\v@ "\f \bM"\x07E@ Ak"(\0E\r\v\v@ A\xE7\0G@ A\bq!\f\v A\x7FsA\x7F +A +\x1B" J A{Jq"\x1B j! +A\x7FA~ \x1B j! A\bq"\r\0Aw!@ \x07\r\0 \fAk(\0"E\r\0A +!A\0! A +p\r\0@ "\x07Aj!  A +l"pE\r\0\v \x07A\x7Fs!\v \f kAuA l! A_qA\xC6\0F@A\0! +  jA k"A\0 A\0J\x1B"  +J\x1B! +\f\vA\0! +  j jA k"A\0 A\0J\x1B"  +J\x1B! +\vA\x7F!\r +A\xFD\xFF\xFF\xFF\x07A\xFE\xFF\xFF\xFF\x07 + r"\x1BJ\r + A\0GjAj!@ A_q"\x07A\xC6\0F@ A\xFF\xFF\xFF\xFF\x07sJ\r A\0 A\0J\x1B!\f\v  Au"s k\xAD x"kAL@@ Ak"A0:\0\0  kAH\r\0\v\v Ak" :\0\0 AkA-A+ A\0H\x1B:\0\0  k" A\xFF\xFF\xFF\xFF\x07sJ\r\v  j" A\xFF\xFF\xFF\xFF\x07sJ\r \0A   j" 7 \0  3 \0A0  A\x80\x80s7@@@ \x07A\xC6\0F@ \vAjA r!  \b \b K\x1B"!\b@ \b5\0 x!@  \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v  G\r\0 Ak"A0:\0\0\v \0   k3 \bAj"\b M\r\0\v @ \0A\x9AA3\v +A\0L \b \fOr\r@ \b5\0 x" \vAjK@@ Ak"A0:\0\0  \vAjK\r\0\v\v \0 A + +A N\x1B3 +A k! \bAj"\b \fO\r +A J ! +\r\0\v\f\v@ +A\0H\r\0 \f \bAj \b \fI\x1B! \vAjA r!\f \b!\x07@ \f \x075\0 \fx"F@ Ak"A0:\0\0\v@ \x07 \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v \0 A3 Aj! + rE\r\0 \0A\x9AA3\v \0  \f k" +  +H\x1B3 + k! + \x07Aj"\x07 O\r +A\0N\r\0\v\v \0A0 +AjAA\07 \0   k3\f\v +!\v \0A0 A jA A\07\v \0A  A\x80\xC0\0s7   J\x1B!\r\f\v  AtAuA qj! @ A\vK\r\0A\f k!D\0\0\0\0\0\x000@!@ D\0\0\0\0\0\x000@\xA2! Ak"\r\0\v -\0\0A-F@  \x9A \xA1\xA0\x9A!\f\v  \xA0 \xA1!\v  \v(,"\x07 \x07Au"s k\xAD x"F@ Ak"A0:\0\0 \v(,!\x07\v Ar! + A q!\f Ak" Aj:\0\0 AkA-A+ \x07A\0H\x1B:\0\0 A\bqE A\0Lq!\b \vAj!\x07@ \x07" \xFC"A\x90\xF5\0j-\0\0 \fr:\0\0  \xB7\xA1D\0\0\0\0\0\x000@\xA2"D\0\0\0\0\0\0\0\0a \bq \x07Aj"\x07 \vAjkAGrE@ A.:\0 Aj!\x07\v D\0\0\0\0\0\0\0\0b\r\0\vA\x7F!\r A\xFD\xFF\xFF\xFF\x07 +  k"\bj"kJ\r\0 \0A   Aj \x07 \vAj"k"\x07 \x07Ak H\x1B \x07 \x1B"j" 7 \0 +3 \0A0   A\x80\x80s7 \0  \x073 \0A0  \x07kA\0A\07 \0  \b3 \0A   A\x80\xC0\0s7    J\x1B!\r\v \vA\xB0j$\0 \r\v\0B\0\v\xD6\x07\x7F#\0A k"$\0  \0("6 \0(!  6  6   k"6  j! Aj!A!\x07\x7F@@@ \0(< A A\fj\v\x9E@ !\f\v@  (\f"F\r A\0H@ !\f\v A\bA\0  ("\bK" \x1Bj"  \bA\0 \x1Bk"\b (\0j6\0 A\fA \x1Bj" (\0 \bk6\0  k! \0(< " \x07 k"\x07 A\fj\v\x9EE\r\0\v\v A\x7FG\r\v \0 \0(,"6 \0 6 \0  \0(0j6 \f\v \0A\x006 \0B\x007 \0 \0(\0A r6\0A\0 \x07AF\r\0  (k\v A j$\0\v\x89\x7F#\0Ak"\0$\0@ \0A\fj \0A\bj\r\0A\xEC\xDB \0(\fAtAj/"6\0 E\r\0 \0(\b/"@A\xEC\xDB(\0" \0(\fAtjA\x006\0  E\r\vA\xEC\xDBA\x006\0\v \0Aj$\0A\x84\xCEA\x006\0A\x80\xCEA6\0\x95A\x84\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\x80\xCE6\0A\xA4\xCEA.6\0A\xA8\xCEA\x006\0\xCCA\xA8\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\xA4\xCE6\0A\xCC\xCFA\xD4\xCE6\0A\xA4\xCFA\x80\x806\0A\xA0\xCFA\xC0\xEC6\0A\x84\xCFA*6\0A\xA8\xCFA\xB0\xCB(\x006\0\v\v\xBF\xBE(\0A\x80\b\v\x940123456789abcdefghijklmnopqrstuvwxyz\0load_spz\0infinity\0February\0January\0July\0Thursday\0Tuesday\0Wednesday\0Saturday\0Sunday\0Monday\0Friday\0May\0%m/%d/%y\0-+ 0X0x\0-0X+0X 0X-0x+0x 0x\0Nov\0Thu\0August\0unsigned short\0unsigned int\0invalid literal/lengths set\0invalid code lengths set\0unknown header flags set\0invalid distances set\0get\0Oct\0float\0invalid bit length repeat\0Sat\0numPoints\0colors\0UnpackOptions\0positions\0rotations\0too many length or distance symbols\0invalid stored block lengths\0scales\0alphas\0[SPZ: ERROR] Check failed: %s:%d: %s\0vf32_ptr\0Apr\0vector\0money_get error\0[SPZ ERROR] deserializePackedGaussians: read error\0October\0November\0September\0December\0unsigned char\0Mar\0/emsdk/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp\0Sep\0%I:%M:%S %p\0Sun\0Jun\0Mon\0nan\0Jan\0coordinateSystem\0CoordinateSystem\0Jul\0bool\0April\0invalid code -- missing end-of-block\0incorrect header check\0incorrect length check\0incorrect data check\0push_back\0invalid distance too far back\0Fri\0sh\0header crc mismatch\0March\0Aug\0unsigned long long\0unsigned long\0std::wstring\0basic_string\0std::string\0std::u16string\0std::u32string\0inf\x000123456789abcdef\0%.0Lf\0%Lf\0resize\0invalid window size\0true\0Tue\0false\0invalid block type\0June\0double\0shDegree\0bad_array_new_length was thrown in -fno-exceptions mode\0invalid literal/length code\0invalid distance code\0RawGaussianCloud\0unknown compression method\0[SPZ ERROR] deserializePackedGaussians: header not found\0%0*lld\0%*lld\0+%lld\0%+.4ld\0void\0locale not supported\0antialiased\0Wed\0%Y-%m-%d\0[SPZ ERROR] deserializePackedGaussians: Too many points: %d\0[SPZ ERROR] deserializePackedGaussians: Unsupported SH degree: %d\0[SPZ ERROR] deserializePackedGaussians: version not supported: %d\0Dec\0./spz/src/cc/load-spz.cc\0Feb\0%a %b %d %H:%M:%S %Y\0POSIX\0VectorUInt8T\0%H:%M:%S\0NAN\0PM\0AM\0%H:%M\0LC_ALL\0ASCII\0LANG\0RUF\0LUF\0INF\0RDF\0LDF\0UNSPECIFIED\0C\0RUB\0LUB\0RDB\0LDB\0catching a class without an object?\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\0emscripten::memory_view\x000123456789\0C.UTF-8\x0001234567\0VectorFloat32\x0001\x001.3.1\0.\0-\0(packed.alphas.size()) == (numPoints)\0(null)\0(packed.colors.size()) == (numPoints * 3)\0(packed.scales.size()) == (numPoints * 3)\0(packed.sh.size()) == (numPoints * shDim * 3)\0(packed.rotations.size()) == (numPoints * (packed.usesQuaternionSmallestThree ? 4 : 3))\0(packed.positions.size()) == (numPoints * 3 * (usesFloat16 ? 2 : 3))\0%\0length_error was thrown in -fno-exceptions mode with message "%s"\0[SPZ: ERROR] Unsupported SH degree: %d +\0 \0\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0A\xA0 \v\xB60\0\0\xF0c\0\0\xF0c\0\0P\0\0\xA4d\0\x008\0\0N3spz13GaussianCloudE\0\0\0\xA4d\0\0X\0\0N3spz13UnpackOptionsE\0ppiip\0\xF0c\0\0|\0\0\xA4d\0\0\x84\0\0NSt3__26vectorIfNS_9allocatorIfEEEE\0ipp\0(e\0\0\xD4\0\0\0\0\0\0\0\0\0\xEC\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIfEE\0\0\0\0\xCCd\0\0\xF8\0\0(\0\0NSt3__227__optional_move_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\x004\0\0d\0\0NSt3__227__optional_copy_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\0p\0\0\x98\0\0NSt3__220__optional_move_baseIfLb1EEE\0\0\0\xCCd\0\0\xA4\0\0\xCC\0\0NSt3__220__optional_copy_baseIfLb1EEE\0\0\0\xCCd\0\0\xD8\0\0\0\0NSt3__223__optional_storage_baseIfLb0EEE\0\0\0\0\xA4d\0\0\f\0\0NSt3__224__optional_destruct_baseIfLb1EEE\0\0\0\xA4d\0\0@\0\0NSt3__218__sfinae_ctor_baseILb1ELb1EEE\0\0\xA4d\0\0p\0\0NSt3__220__sfinae_assign_baseILb1ELb1EEE\0\0\0\0\x84e\0\0\xAC\0\0\0\0\0\0|\0\0PNSt3__26vectorIfNS_9allocatorIfEEEE\0\0\0\0\x84e\0\0\xE4\0\0\0\0\0|\0\0PKNSt3__26vectorIfNS_9allocatorIfEEEE\0pp\0v\0vp\0\0\0\x9C\0\0pp\0\0\x98c\0\0|\0\x008d\0\0vppf\0\0\0\0\x98c\0\0|\0\0\xFCc\0\x008d\0\0vppif\0\0\0\xFCc\0\0|\0\0ipp\0\\\0\x008d\0\0\xA4d\0\0d\0\0N10emscripten3valE\0\0\xAC\0\0|\0\0\xFCc\0\0pppi\0\0\0\0\0\0\0\0\xA8c\0\0|\0\0\xFCc\0\x008d\0\0ippif\0\0\0(e\0\0\xD0\0\0\0\0\0\0\0\0\0\xE8\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIhEE\0\0\0\0\xCCd\0\0\xF4\0\0$\0\0NSt3__227__optional_move_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\x000\0\0\`\0\0NSt3__227__optional_copy_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\0l\0\0\x94\0\0NSt3__220__optional_move_baseIhLb1EEE\0\0\0\xCCd\0\0\xA0\0\0\xC8\0\0NSt3__220__optional_copy_baseIhLb1EEE\0\0\0\xCCd\0\0\xD4\0\0\0\0\0NSt3__223__optional_storage_baseIhLb0EEE\0\0\0\0\xA4d\0\0\b\0\0NSt3__224__optional_destruct_baseIhLb1EEE\0\0\0\xA4d\0\0<\0\0NSt3__26vectorIhNS_9allocatorIhEEEE\0\x84e\0\0p\0\0\0\0\0\x004\0\0PNSt3__26vectorIhNS_9allocatorIhEEEE\0\0\0\0\x84e\0\0\xA8\0\0\0\0\x004\0\0PKNSt3__26vectorIhNS_9allocatorIhEEEE\0pp\0vp\0\`\0\0pp\0\0\x98c\0\x004\0\0\xC0c\0\0vppi\0\0\0\0\x98c\0\x004\0\0\xFCc\0\0\xC0c\0\0vppii\0\0\0\xFCc\0\x004\0\0ipp\0\\\0\0\xC0c\0\0\xA8\0\x004\0\0\xFCc\0\0pppi\0\0\0\0\xA8c\0\x004\0\0\xFCc\0\0\xC0c\0\0ippii\0p\0vp\0ipp\0vppi\0ipp\0vppi\0ppp\0vppp\0\0\0Xd\0\0p\0\0N3spz16CoordinateSystemE\0p\0vp\0ipp\0vppi\0\0\0\0\0\0\0\0\0\b\0\0\0\0\0\0\xA4d\0\0\xB0\0\0NSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\xA4d\0\0\xF8\0\0NSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE\0\0\xA4d\0\0@\0\0NSt3__212basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE\0\0\0\xA4d\0\0\x8C\0\0NSt3__212basic_stringIDiNS_11char_traitsIDiEENS_9allocatorIDiEEEE\0\0\0\xA4d\0\0\xD8\0\0N10emscripten11memory_viewIcEE\0\0\xA4d\0\0\0\0\0N10emscripten11memory_viewIaEE\0\0\xA4d\0\0(\0\0N10emscripten11memory_viewIhEE\0\0\xA4d\0\0P\0\0N10emscripten11memory_viewIsEE\0\0\xA4d\0\0x\0\0N10emscripten11memory_viewItEE\0\0\xA4d\0\0\xA0\0\0N10emscripten11memory_viewIiEE\0\0\xA4d\0\0\xC8\0\0N10emscripten11memory_viewIjEE\0\0\xA4d\0\0\xF0\0\0N10emscripten11memory_viewIlEE\0\0\xA4d\0\0\0\0N10emscripten11memory_viewImEE\0\0\xA4d\0\0@\0\0N10emscripten11memory_viewIxEE\0\0\xA4d\0\0h\0\0N10emscripten11memory_viewIyEE\0\0\xA4d\0\0\x90\0\0N10emscripten11memory_viewIfEE\0\0\xA4d\0\0\xB8\0\0N10emscripten11memory_viewIdEE\0A\xE43\v\xA1(\x960\x07w,a\xEE\xBAQ \x99\xC4m\x07\x8F\xF4jp5\xA5c\xE9\xA3\x95d\x9E2\x88\xDB\xA4\xB8\xDCy\xE9\xD5\xE0\x88\xD9\xD2\x97+L\xB6 \xBD|\xB1~\x07-\xB8\xE7\x91\xBF\x90d\xB7\xF2 \xB0jHq\xB9\xF3\xDEA\xBE\x84}\xD4\xDA\xEB\xE4\xDDmQ\xB5\xD4\xF4\xC7\x85\xD3\x83V\x98l\xC0\xA8kd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\0\0\0E\0\0\x008\0\0\x009\0\0\0F\0\0\0G\0\0\0<\0\0\0=\0\0\0>\0\0\0H\0\0\0@\0\0\0I\0\0\0B\0\0\0J\0\0\0\xCCd\0\0,;\0\0>\0\0NSt3__29basic_iosIcNS_11char_traitsIcEEEE\0\0\0\xA4d\0\0\`;\0\0NSt3__215basic_streambufIcNS_11char_traitsIcEEEE\0\0\0\0(e\0\0\xAC;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_istreamIcNS_11char_traitsIcEEEE\0\0(e\0\0\xF4;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE\0\0(e\0\0D<\0\0\0\0\0\0\0\0\x94;\0\0\0\0\0\xDC;\0\0\b\0\0NSt3__214basic_iostreamIcNS_11char_traitsIcEEEE\0\xCCd\0\0\x80<\0\0X;\0\0NSt3__215basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0@\0\0\0\0\0\0\0\xB4=\0\0K\0\0\0L\0\0\x008\0\0\0\xF8\xFF\xFF\xFF\xB4=\0\0M\0\0\0N\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\xB4=\0\0O\0\0\0P\0\0\0\xD0<\0\x004=\0\0p=\0\0\x84=\0\0\x98=\0\0\xAC=\0\0\\=\0\0H=\0\0\xF8<\0\0\xE4<\0\0@\0\0\0\0\0\0\0$<\0\0Q\0\0\0R\0\0\x008\0\0\0\xF8\xFF\xFF\xFF$<\0\0S\0\0\0T\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF$<\0\0U\0\0\0V\0\0\0@\0\0\0\0\0\0\0\x94;\0\0W\0\0\0X\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\x94;\0\0Y\0\0\0Z\0\0\x008\0\0\0\0\0\0\0\xDC;\0\0[\0\0\0\\\0\0\0\xC8\xFF\xFF\xFF\xC8\xFF\xFF\xFF\xDC;\0\0]\0\0\0^\0\0\0\xCCd\0\0\xC0=\0\0$<\0\0NSt3__218basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0\0\0\0\0\0>\0\0_\0\0\0\`\0\0\0\xA4d\0\0 >\0\0NSt3__28ios_baseE\0A\xC0\xFC\0\v#\xDE\x95\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF@>\0\0\0\0\0C.UTF-8\0A\x90\xFD\0\vT>\0A\xB0\xFD\0\vGLC_CTYPE\0\0\0\0LC_NUMERIC\0\0LC_TIME\0\0\0\0\0LC_COLLATE\0\0LC_MONETARY\0LC_MESSAGES\0A\x84\xFE\0\v-\x80\xDE(\0\x80\xC8M\0\0\xA7v\0\x004\x9E\0\x80\xC7\0\x80\x9F\xEE\0\0~\x80\\@\x80\xE9g\0\xC8\x90\0U\xB8.\0A\xC0\xFE\0\v\xD2Sun\0Mon\0Tue\0Wed\0Thu\0Fri\0Sat\0Sunday\0Monday\0Tuesday\0Wednesday\0Thursday\0Friday\0Saturday\0Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec\0January\0February\0March\0April\0May\0June\0July\0August\0September\0October\0November\0December\0AM\0PM\0%a %b %e %T %Y\0%m/%d/%y\0%H:%M:%S\0%I:%M:%S %p\0\0\0%m/%d/%y\x000123456789\0%a %b %e %T %Y\0%H:%M:%S\0\0\0\0\0^[yY]\0^[nN]\0yes\0no\0A\xA0\x81\v\xE1\xD1t\x9E\0W\x9D\xBD*\x80pR\xFF\xFF>' +\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\0\x005\0\0\0q\0\0\0k\xFF\xFF\xFF\xCE\xFB\xFF\xFF\x92\xBF\xFF\xFF\0\0\0\0\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x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\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb0EEE\0\0\0\0\0pV\0\0\x98\0\0\0G\0\0v\0\0\0H\0\0I\0\0J\0\0K\0\0L\0\0M\0\0N\0\0O\0\0P\0\0(e\0\0\x90V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb1EEE\0\0\0\0\0\xC8V\0\0\x98\0\0\0Q\0\0v\0\0\0R\0\0S\0\0(e\0\0\xE8V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000W\0\0\0\0\0\0NSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\x008W\0\0NSt3__211__money_getIcEE\0\0\0\0\0\0\0\0pW\0\0\x98\0\0\0T\0\0v\0\0\0U\0\0V\0\0(e\0\0\x90W\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xD8W\0\0\0\0\0\0NSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\0\xE0W\0\0NSt3__211__money_getIwEE\0\0\0\0\0\0\0\0X\0\0\x98\0\0\0W\0\0v\0\0\0X\0\0Y\0\0(e\0\x008X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x80X\0\0\0\0\0\0NSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\0\x88X\0\0NSt3__211__money_putIcEE\0\0\0\0\0\0\0\0\xC0X\0\0\x98\0\0\0Z\0\0v\0\0\0[\0\0\\\0\0(e\0\0\xE0X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0(Y\0\0\0\0\0\0NSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\x000Y\0\0NSt3__211__money_putIwEE\0\0\0\0\0\0\0\0lY\0\0\x98\0\0\0]\0\0v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h\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0i\0\0\0l\0\0\0\0\0\0\0M\0\0\0a\0\0\0y\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0e\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0y\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0u\0\0\0s\0\0\0t\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0t\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0o\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0J\0\0\0a\0\0\0n\0\0\0\0\0\0\0F\0\0\0e\0\0\0b\0\0\0\0\0\0\0M\0\0\0a\0\0\0r\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0\0\0\0\0A\0\0\0M\0\0\0\0\0\0\0P\0\0\0M\0A\x94\xBB\v\x98 +\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0 +\0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb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\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v +2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ue((await w(oe)).instance))})(),(function(){function ue(){var oe;if(r.calledRun=!0,!f){if(V=!0,Ty.H(),_?.(r),(oe=r.onRuntimeInitialized)==null||oe.call(r),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var Re=r.postRun.shift();M.push(Re)}O(M)}}if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)K();O(z),r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),ue()},1)):ue()})(),V?o=r:o=new Promise((ue,oe)=>{_=ue,S=oe}),o}var D1=(e,t,n)=>{let i=e.vf32_ptr(t),o=t.size(),r=i>>2,s=e.HEAPF32.slice(r,r+o);if(n!==void 0)for(let a=0;a1/(1+Math.exp(-e)),l4e=e=>t=>t*e+.5,d4e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:D1(e,t.positions),scales:D1(e,t.scales,Math.exp),rotations:D1(e,t.rotations),alphas:D1(e,t.alphas,c4e),colors:D1(e,t.colors,l4e(i)),sh:D1(e,t.sh)}},u4e=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},Kpe=async(e,t)=>{var n;let i=await a4e(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(r,o.length,{coordinateSystem:s}),c=d4e(i,a,t);return u4e(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var m4e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var h4e=[0,9,24,45],f4e=14,p4e=1.6*1024*1024*1024;function b4e(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let o=e?.accessors?.[i];if(!l(o)||o.count<=0)return;let r=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(r=Math.max(r,parseInt(a[1],10)))}return{numPoints:o.count,shDegree:r}}function g4e(e,t){let n=f4e+(h4e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var c6=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=o,this._spz=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=y4e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._spzError)&&l6(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=b4e(this._gltf,this._primitive);if(l(n)){let o=g4e(n.numPoints,n.shDegree);if(o>p4e){let r=Math.round(o/1048576);return l6(this,new ae(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${r} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=Kpe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=x4e(this,i)}unload(){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}};async function y4e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;l6(e,n)}}function l6(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load SPZ",t)}async function x4e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var J2=c6;var k2n=x(T(),1);var I2n=x(T(),1);var g2n=x(T(),1);function j2(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=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=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}j2.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Xp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new j2({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(j2.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}}});j2.BATCH_TABLE_CLASS_NAME="_batchTable";var nf=j2;var E2n=x(T(),1);var _2n=x(T(),1);function VO(e){e=e??B.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}VO.fromJson=function(e){return new VO({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(VO.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 Q2=VO;function EO(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a>t};lc.fromSubtreeJson=async function(e,t,n,i,o){let r=new lc(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=R4e(n);let a=s.json;r._subtreeJson=a;let c;if(no(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let Z=a.tileMetadata;c=a.propertyTables[Z]}let d=[];if(l(a.contentMetadata)){let Z=a.contentMetadata.length;for(let R=0;R0;u=u||m;for(let p=0;p0){let g=t.getContentMetadataView(a,E);I=ix.parseAllBoundingVolumeSemantics("CONTENT",g)}let N=O4e(b,I);l(N)&&(F.boundingVolume=N),f.push(It(F,s.contentHeaders[E]))}let y=n0e(c,s,a),_={boundingVolume:b,geometricError:y,refine:s.refine,contents:f},S=!0,Z=$e(s.tileHeader,S);delete Z.boundingVolume,delete Z.transform,delete Z.metadata;let R=It(_,Z,S),C=a0e(e,s.baseResource,R,n);return C.implicitCoordinates=a,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function GO(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(no(e,"3DTILES_bounding_volume_S2")||l(e.region))}function f6(e,t){l(t)&&(no(e,"3DTILES_bounding_volume_S2")?U4e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&k4e(e.region,t.minimumHeight,t.maximumHeight))}function k4e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function U4e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function D4e(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!GO(r.boundingVolume,r)&&GO(e.boundingVolume,r)?s=i0e(e,t,n,i??!1,o):s=r.boundingVolume,f6(s,r),s}function O4e(e,t){let n;return l(t)&&(n=t.boundingVolume),GO(n,t)?f6(n,t):GO(e,t)&&(n=$e(e,!0),f6(n,t)),n}function i0e(e,t,n,i,o){let r=e.boundingVolume;return no(r,"3DTILES_bounding_volume_S2")?o0e(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:s0e(r.region,t.level,t.x,t.y,t.z)}:{box:r0e(r.box,t.level,t.x,t.y,t.z)}}function o0e(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Rb.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?A1.encode2D(i,o,r):A1.encode2D(i,r,o),u=Rb.fromFacePositionLevel(c,BigInt(d),i),m,p;if(l(s)){let b=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:b,p=n<4?b:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Rb.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var B4e=new h,z4e=new h,h6=new h,H4e=new q;function r0e(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,z4e),s=q.unpack(e,3,H4e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,m=h.fromElements(a,a,1,B4e);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,h6);p=q.multiplyByVector(s,p,h6),p=h.add(p,r,h6);let b=q.clone(s);b=q.multiplyByScale(b,m,b);let f=new Array(12);return h.pack(p,f),q.pack(b,f,3),f}var K4e=new re;function s0e(e,t,n,i,o){if(t===0)return e.slice();let r=re.unpack(e,0,K4e),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),m=W.negativePiToPi(u+d),p=c*r.height,b=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(b+p),y=s,_=a;if(l(o)){let S=c*(a-s);y+=o*S,_=y+S}return[u,b,m,f,y,_]}function J4e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=i0e(i,o,n,!1,t),s=n0e(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=a0e(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function a0e(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}z1._deriveBoundingBox=r0e;z1._deriveBoundingRegion=s0e;z1._deriveBoundingVolumeS2=o0e;var H1=z1;var sai=x(T(),1);var JFn=x(T(),1),c0e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(c0e);var Yd=c0e;var jsi=x(T(),1);var xIn=x(T(),1);var $Fn=x(T(),1);function K1(e,t){this._distance=t,this._normal=new l0e(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(K1.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});K1.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new K1(e.normal,e.distance),t};K1.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new K1(e.normal,e.distance)};function l0e(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(l0e.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 ta=K1;function ol(e){e=e??B.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.edgeColor=U.clone(e.edgeColor??U.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new Se,this.planeRemoved=new Se,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?f0e:p0e,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;o0&&(r=qt.OUTSIDE);for(let s=0;s80*n){a=e[0],c=e[1];let u=a,m=c;for(let p=n;pu&&(u=b),f>m&&(m=f)}d=Math.max(u-a,m-c),d=d!==0?32767/d:0}return iF(r,s,n,a,c,d,0),s}function x0e(e,t,n,i,o){let r;if(o===pQe(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=y0e(s/i|0,e[s],e[s+1],r);return r&&J1(r,r.next)&&(rF(r),r=r.next),r}function eS(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(J1(n,n.next)||ys(n.prev,n,n.next)===0)){if(rF(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function iF(e,t,n,i,o,r,s){if(!e)return;!s&&r&&lQe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?tQe(e,i,o,r):eQe(e)){t.push(c.i,e.i,d.i),rF(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=nQe(eS(e),t),iF(e,t,n,i,o,r,2)):s===2&&iQe(e,t,n,i,o,r):iF(eS(e),t,n,i,o,r,1);break}}}function eQe(e){let t=e.prev,n=e,i=e.next;if(ys(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),m=Math.min(a,c,d),p=Math.max(o,r,s),b=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=b&&nF(o,a,r,c,s,d,f.x,f.y)&&ys(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function tQe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(ys(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,m=r.y,p=s.y,b=Math.min(a,c,d),f=Math.min(u,m,p),y=Math.max(a,c,d),_=Math.max(u,m,p),S=p6(b,f,t,n,i),Z=p6(y,_,t,n,i),R=e.prevZ,C=e.nextZ;for(;R&&R.z>=S&&C&&C.z<=Z;){if(R.x>=b&&R.x<=y&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&nF(a,u,c,m,d,p,R.x,R.y)&&ys(R.prev,R,R.next)>=0||(R=R.prevZ,C.x>=b&&C.x<=y&&C.y>=f&&C.y<=_&&C!==o&&C!==s&&nF(a,u,c,m,d,p,C.x,C.y)&&ys(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;R&&R.z>=S;){if(R.x>=b&&R.x<=y&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&nF(a,u,c,m,d,p,R.x,R.y)&&ys(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;C&&C.z<=Z;){if(C.x>=b&&C.x<=y&&C.y>=f&&C.y<=_&&C!==o&&C!==s&&nF(a,u,c,m,d,p,C.x,C.y)&&ys(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function nQe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!J1(i,o)&&_0e(i,n,n.next,o)&&oF(i,o)&&oF(o,i)&&(t.push(i.i,n.i,o.i),rF(n),rF(n.next),n=e=o),n=n.next}while(n!==e);return eS(n)}function iQe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&mQe(s,a)){let c=S0e(s,a);s=eS(s,s.next),c=eS(c,c.next),iF(s,t,n,i,o,r,0),iF(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function oQe(e,t,n,i){let o=[];for(let r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){let m=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=i&&m>r&&(r=m,s=n.x=n.x&&n.x>=c&&i!==n.x&&T0e(os.x||n.x===s.x&&cQe(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function cQe(e,t){return ys(e.prev,e,t.prev)<0&&ys(t.next,e,e.next)<0}function lQe(e,t,n,i){let o=e;do o.z===0&&(o.z=p6(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,dQe(o)}function dQe(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;d0||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 p6(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 uQe(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function nF(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&T0e(e,t,n,i,o,r,s,a)}function mQe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!hQe(e,t)&&(oF(e,t)&&oF(t,e)&&fQe(e,t)&&(ys(e.prev,e,t.prev)||ys(e,t.prev,t))||J1(e,t)&&ys(e.prev,e,e.next)>0&&ys(t.prev,t,t.next)>0)}function ys(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function J1(e,t){return e.x===t.x&&e.y===t.y}function _0e(e,t,n,i){let o=WO(ys(e,t,n)),r=WO(ys(e,t,i)),s=WO(ys(n,i,e)),a=WO(ys(n,i,t));return!!(o!==r&&s!==a||o===0&&LO(e,n,t)||r===0&&LO(e,i,t)||s===0&&LO(n,e,i)||a===0&&LO(n,t,i))}function LO(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 WO(e){return e>0?1:e<0?-1:0}function hQe(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&&_0e(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function oF(e,t){return ys(e.prev,e,e.next)<0?ys(e,t,e.next)>=0&&ys(e,e.prev,t)>=0:ys(e,t,e.prev)<0||ys(e,e.next,t)<0}function fQe(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 S0e(e,t){let n=b6(e.i,e.x,e.y),i=b6(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 y0e(e,t,n,i){let o=b6(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 rF(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 b6(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function pQe(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?qs.COUNTER_CLOCKWISE:qs.CLOCKWISE};ox.triangulate=function(e,t){let n=k.packArray(e);return g6(n,t,2)};var V0e=new h,E0e=new h,A0e=new h,Z0e=new h,R0e=new h,C0e=new h,Wb=new h,G0e=new k,L0e=new k,W0e=new k,j1=new k;ox.computeSubdivision=function(e,t,n,i,o){o=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),m=0,p=0;for(a=0;a0;){let R=s.pop(),C=s.pop(),E=s.pop(),A=h.fromArray(d,E*3,V0e),L=h.fromArray(d,C*3,E0e),F=h.fromArray(d,R*3,A0e),I,N,g;r&&(I=k.fromArray(u,E*2,G0e),N=k.fromArray(u,C*2,L0e),g=k.fromArray(u,R*2,W0e));let V=h.multiplyByScalar(h.normalize(A,Z0e),y,Z0e),G=h.multiplyByScalar(h.normalize(L,R0e),y,R0e),v=h.multiplyByScalar(h.normalize(F,C0e),y,C0e),X=h.magnitudeSquared(h.subtract(V,G,Wb)),Y=h.magnitudeSquared(h.subtract(G,v,Wb)),D=h.magnitudeSquared(h.subtract(v,V,Wb)),w=Math.max(X,Y,D),O,M,z;w>S?X===w?(O=`${Math.min(E,C)} ${Math.max(E,C)}`,a=f[O],l(a)||(M=h.add(A,L,Wb),h.multiplyByScalar(M,.5,M),d.push(M.x,M.y,M.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(I,N,j1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(E,a,R),s.push(a,C,R)):Y===w?(O=`${Math.min(C,R)} ${Math.max(C,R)}`,a=f[O],l(a)||(M=h.add(L,F,Wb),h.multiplyByScalar(M,.5,M),d.push(M.x,M.y,M.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(N,g,j1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(C,a,E),s.push(a,R,E)):D===w&&(O=`${Math.min(R,E)} ${Math.max(R,E)}`,a=f[O],l(a)||(M=h.add(F,A,Wb),h.multiplyByScalar(M,.5,M),d.push(M.x,M.y,M.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(g,I,j1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(R,a,C),s.push(a,E,C)):(b.push(E),b.push(C),b.push(R))}let Z={attributes:{position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:b,primitiveType:Ie.TRIANGLES};return r&&(Z.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new At(Z)};var yQe=new pe,xQe=new pe,TQe=new pe,y6=new pe;ox.computeRhumbLineSubdivision=function(e,t,n,i,o){o=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),m=0,p=0;for(a=0;a0;){let E=s.pop(),A=s.pop(),L=s.pop(),F=h.fromArray(d,L*3,V0e),I=h.fromArray(d,A*3,E0e),N=h.fromArray(d,E*3,A0e),g,V,G;r&&(g=k.fromArray(u,L*2,G0e),V=k.fromArray(u,A*2,L0e),G=k.fromArray(u,E*2,W0e));let v=e.cartesianToCartographic(F,yQe),X=e.cartesianToCartographic(I,xQe),Y=e.cartesianToCartographic(N,TQe);S.setEndPoints(v,X);let D=S.surfaceDistance;Z.setEndPoints(X,Y);let w=Z.surfaceDistance;R.setEndPoints(Y,v);let O=R.surfaceDistance,M=Math.max(D,w,O),z,K,te,H,$;M>_?D===M?(z=`${Math.min(L,A)} ${Math.max(L,A)}`,a=f[z],l(a)||(K=S.interpolateUsingFraction(.5,y6),te=(v.height+X.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Wb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(g,V,j1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(L,a,E),s.push(a,A,E)):w===M?(z=`${Math.min(A,E)} ${Math.max(A,E)}`,a=f[z],l(a)||(K=Z.interpolateUsingFraction(.5,y6),te=(X.height+Y.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Wb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(V,G,j1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(A,a,L),s.push(a,E,L)):O===M&&(z=`${Math.min(E,L)} ${Math.max(E,L)}`,a=f[z],l(a)||(K=R.interpolateUsingFraction(.5,y6),te=(Y.height+v.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Wb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(G,g,j1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(E,a,A),s.push(a,L,A)):(b.push(L),b.push(A),b.push(E))}let C={attributes:{position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:b,primitiveType:Ie.TRIANGLES};return r&&(C.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new At(C)};ox.scaleToGeodeticHeight=function(e,t,n,i){n=n??ne.default;let o=bQe,r=gQe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};rx.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};rx.prototype.contains=function(e){return this._array.indexOf(e)!==-1};rx.prototype.clear=function(){this._array.length=this._offset=this._length=0};rx.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var sx=rx;var Fr={};Fr.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;c0;){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;d0?new Array(o):void 0;for(let a=0;aW.PI){let c=s;s=a,a=c}if(!(r.longitudea))return n.cartographicToCartesian(r)}function LQe(e,t,n,i){if(i===un.RHUMB)return GQe(e,t,n);let o=yi.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var WQe=new pe;function vQe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(m,WQe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=LQe(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 P0e(e,t,n,i,o,r,s){let a=[],c=r,d=m=>p=>p.position===m,u=[];do{let m=n[c];a.push(m);let p=i.findIndex(d(c)),b=i[p];if(!l(b)){++c;continue}let{visited:f,type:y,next:_}=b;if(b.visited=!0,y===0){if(_===0){let C=i[p-(s?1:-1)];if(C?.position===c+1)C.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}f||u.push(c);let Z=p+(s?1:-1),R=i[Z];if(!l(R)){++c;continue}c=R.position}while(c=0&&c!==r&&a.lengthd.theta-u.theta);let c=s[0].z>=0;o=P0e(i,o,s,a,1,0,c)}return i};Fr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new sx;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,b,f;if(i)for(f=m.length,b=0;b1){for(let L of A)c.enqueue(new Gc(L,p));continue}}let Z=m.slice(),R=l(p)?p.length:0,C=[],E;for(b=0;bMath.PI&&(e-=W.TWO_PI),e}}});var Q1=new pe,wQe=new h;xs.prototype.getLatitude=function(e){l(e)||(e=ne.default),Q1.latitude=this.conformalLatitude,Q1.longitude=this.longitude,Q1.height=0;let t=this.ellipsoid.cartographicToCartesian(Q1,wQe);return e.cartesianToCartographic(t,Q1),Q1.latitude};var MQe=new gn,kQe=new h,UQe=new h;xs.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=xs.NORTH_POLE_TANGENT_PLANE,o=xs.SOUTH_POLE;n<0&&(i=xs.SOUTH_POLE_TANGENT_PLANE,o=xs.NORTH_POLE);let r=MQe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,kQe),h.normalize(r.direction,r.direction);let s=yi.rayPlane(r,i.plane,UQe),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),d=n*h.dot(i.yAxis,a);return l(t)?(t.position=new k(c,d),t.tangentPlane=i,t):new xs(new k(c,d),i)};xs.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=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!==un.RHUMB){let p=k.subtract(t.position,e.position,s8e),b=k.dot(t.position,p)/k.dot(p,p);if(b>0&&b<1){let f=k.add(t.position,k.multiplyByScalar(p,-b,p),a8e),y=rl.clone(t,c8e);y.position=f;let _=y.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,m=Math.sign(u);m!==0&&(m*=k.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=m),d<=0&&(o.southAngle+=m)}var k0e=new rl,l8e=new rl,Nm={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Ym.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new re),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,Nm.northAngle=0,Nm.southAngle=0,Nm.westOverIdl=Number.POSITIVE_INFINITY,Nm.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=rl.fromCartesian(e[0],l8e);for(let s=1;sNm.eastOverIdl-Nm.westOverIdl&&(i.west=Nm.westOverIdl,i.east=Nm.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(Nm.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Nm.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var d8e=new rl;function u8e(e,t,n){return e.height>=W.PI||e.width>=W.PI?rl.fromCartesian(t[0],d8e).tangentPlane:ws.fromPoints(t,n)}var U0e=new pe;function m8e(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=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,U0e);return l(r)||(r=new k),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return rl.fromCartesian(o,r)};let i=ws.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function f8e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?oi.splitPolygonsOnEquator(o,t,n,r):o}function p8e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return nt.fromRectangle(t,void 0,N0e);let o=e,r=ws.fromPoints(o,n);return oi.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,N0e)}Ym.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,m=l(u),p=r.positions;if(p.length<3)return;let b=e.rectangle,f=oi.polygonsFromHierarchy(r,m,m8e(b,p,n),!s,n,f8e(b,n,d,s)),y=f.hierarchy,_=f.polygons,S=function(v){return v},Z=m?oi.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(y.length===0)return;let R=y[0].outerRing,C=p8e(R,b,n,o),E=[],A=e._height,L=e._extrudedHeight,F=e._perPositionHeightExtrude||!W.equalsEpsilon(A,L,0,W.EPSILON2),I={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:u8e(b,R,n).plane.normal,projectTo2d:h8e(b,R,n),boundingRectangle:C,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},N;if(F)for(I.extrude=!0,I.top=a,I.bottom=c,I.shadowVolume=e._shadowVolume,I.offsetAttribute=e._offsetAttribute,N=0;N<_.length;N++){let v=n8e(n,_[N],m?Z[N]:void 0,i,y[N],s,a,c,t,d),X;a&&c?(X=v.topAndBottom,I.geometry=oi.scaleToGeodeticHeightExtruded(X.geometry,A,L,n,s)):a?(X=v.topAndBottom,X.geometry.attributes.position.values=mi.scaleToGeodeticHeight(X.geometry.attributes.position.values,A,n,!s),I.geometry=X.geometry):c&&(X=v.topAndBottom,X.geometry.attributes.position.values=mi.scaleToGeodeticHeight(X.geometry.attributes.position.values,L,n,!0),I.geometry=X.geometry),(a||c)&&(I.wall=!1,X.geometry=x6(I),E.push(X));let Y=v.walls;I.wall=!0;for(let D=0;Dt(this.get(u,s),this.get(m,a)));for(let u=0;uthis._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==se.SCENE3D&&xt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!fs(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let o=0;o0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(wm.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(wm.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:o}=this,r=this._collection._holeIndexView;if(!l(n)){let s=r.byteOffset+i*r.BYTES_PER_ELEMENT,a=r.constructor;return new a(r.buffer,s,o)}for(let s=0;s0){let{attributeArrays:c}=n,{_dirtyOffset:d,_dirtyCount:u}=e,m=c.positionHigh,p=c.positionLow,b=n.indexArray,f=c.pickColor,y=c.showColorAlpha;for(let _=d,S=d+u;_0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=T8e(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,d);for(let p in r)if(Object.hasOwn(r,p)){let b=p;n.vertexArray.copyAttributeFromRange(r[b],n.attributeArrays[b],u,m)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Un({context:i,indexBuffer:ot.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:R6.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:R6.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:B0e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:ot.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Yi.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=nn.fromCache({context:i,vertexShaderSource:new Je({sources:[aF],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[cF]}),attributeLocations:r}));let s=e.triangleCount*3;l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Yi.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function T8e(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ba);let i=ba.vertexOffset,o=ba.triangleOffset*3;e.get(t+n-1,ba);let r=ba.vertexOffset+ba.vertexCount-i,s=(ba.triangleOffset+ba.triangleCount)*3-o;return{indexOffset:o,indexCount:s,vertexOffset:i,vertexCount:r}}function _8e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var uF=x8e;var{ERR_CAPACITY:CNn}=na.Error,E6=class e extends na{constructor(t=B.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??na.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??na.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Ir}_getMaterialClass(){return Eu}_allocateHoleIndexBuffer(){this._holeIndexView=Oe.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Oe.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Ir){super.add(t,n);let i=this._positionCount;n._setUint32(Ir.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ir.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(Ir.Layout.HOLE_OFFSET_U32,o),n._setUint32(Ir.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(Ir.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(Ir.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=uF(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},Ya=E6;var oYn=x(T(),1);var INn=x(T(),1);var{ERR_RESIZE:WNn,ERR_CAPACITY:vNn}=na.Error,tC=class tC extends os{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(tC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(tC.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:o}=this,r=this._collection._positionView;if(!l(n)){let s=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,a=r.constructor;return new a(r.buffer,s,o*3)}for(let s=0;s0&&(o.hasPixelWidths||(o.hasPixelWidths=!n.widthInMeters),o.hasMeterWidths||(o.hasMeterWidths=n.widthInMeters)),o.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,o=Math.max(1,Math.ceil(Math.sqrt(n.length/H0e))),r=new Array(o*o);for(let _=0;_=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function L8e(e,t,n,i){let o=e.x,r=t.x;r=o+W.negativePiToPi(r-o);let s=n.west+i*.5,a=s+W.negativePiToPi(o-s)-o;o+=a,r+=a;let c=n.north-n.south;e.x=(o-n.west)/i,e.y=(e.y-n.south)/c,t.x=(r-n.west)/i,t.y=(t.y-n.south)/c}function W8e(e,t,n){let i=-n,o=1+n,r=0,s=1,a=e.x,c=e.y,d=t.x,u=t.y,m=d-a,p=u-c,b=[-m,m,-p,p],f=[a-i,o-a,c-i,o-c];for(let y=0;y<4;y++){if(Math.abs(b[y])<1e-12){if(f[y]<0)return!1;continue}let _=f[y]/b[y];if(b[y]<0?r=Math.max(r,_):s=Math.min(s,_),r>s)return!1}return e.x=a+r*m,e.y=c+r*p,t.x=a+s*m,t.y=c+s*p,!0}function cx(e,t){return Math.max(0,Math.min(t-1,e))}var L6=new Float64Array(512),q0e=new Float64Array(512),$0e={positions:new Float64Array(512),vertexCount:0};function v8e(e,t,n,i,o){L6.length>1,m=(d&1)===0?1:-1,p=d===0?n:d===1?i:d===2?o:r,b=c*4+4,f=(d&1)===0,y=f?q0e:s.positions;y.length=0;for(let C=0;C=0;if(L!==R){let F=u===0?(p-S)/(E-S):(p-Z)/(A-Z);y[_*2]=u===0?p:S+F*(E-S),y[_*2+1]=u===0?Z+F*(A-Z):p,_++}L&&(y[_*2]=E,y[_*2+1]=A,_++),S=E,Z=A,R=L}if(_===0)return s.vertexCount=0,s;a=y,c=_}return s.vertexCount=c,s}function MO(e){let t=W.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=W.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function tbe(e,t){let[n,i]=MO(t.length),o=new Float32Array(n*i);return o.set(t),new vt({context:e,pixelFormat:Qe.RED,pixelDatatype:Ue.FLOAT,source:{width:n,height:i,arrayBufferView:o},sampler:Bt.NEAREST,flipY:!1})}function nbe(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,o=e.modelMatrix;for(let r=0;r0?2*i:0,triangleCountMax:0});for(let o=0;od.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let d=e._polygons;for(let u=0;ueC.equals(t.clippingPolygon,e))};sl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(o=>eC.equals(o.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return rbe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};sl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n{if($n._activeComputeCommandCount>=$n._maximumComputeCommandCount){$n._nextFrameCommandQueue.push(e);return}t.commandList.push(e),$n._activeComputeCommandCount++};$n._updateCommandQueue=e=>{if($n._maximumComputeCommandCount=Math.log2(mt.maximumCubeMapSize),$n._nextFrameCommandQueue.length>0&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount){let t=$n._nextFrameCommandQueue.shift();for(;c(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()}c(t)&&$n._nextFrameCommandQueue.push(t)}};$n.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new L("DynamicEnvironmentMapManager should only be assigned to one object");e._owner=t,t[n]=e}};$n.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;ts,u_enuToFixedFrame:()=>l,u_faceDirection:()=>Uo.getDirection(f,bse),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Gke)},owner:e});h.postExecute=()=>{if(e.isDestroyed()||h.canceled){$n._activeComputeCommandCount--;return}let g=e._radianceMapComputeCommands;g[y]=void 0;let x=new Fr({context:n,colorTextures:[e._radianceMapTextures[y]]});x._bind(),e._radianceCubeMap[f].copyFromFramebuffer(),x._unBind(),x.destroy(),$n._activeComputeCommandCount--,g.some(c)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=h,$n._queueCommand(h,t),u++}e._radianceCommandsDirty=!1}}function Xke(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,l=0,d=(f,p,y,h,g)=>()=>{if(e.isDestroyed()||f.canceled){$n._activeComputeCommandCount--;return}let x=e._convolutionComputeCommands;x[p]=void 0,n.copyFace(t,y,h,g),l++,$n._activeComputeCommandCount--,y.destroy(),e._specularMapTextures[p]=void 0;let S=e._specularMapTextures.length;l>=S&&(e._irradianceCommandDirty=!0,n.sampler=new en({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 f=1;ff/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Uo.getDirection(p,bse)}});x.postExecute=d(x,u,y,p,f),e._convolutionComputeCommands[u]=x,$n._queueCommand(x,t),++u}r/=2,s/=2}}var yse=new D(3,3);function Ike(e,t){let n=t.context,i=yse,o=e._irradianceMapTexture;c(o)&&!o.isDestroyed()&&o.destroy(),o=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;c(r)||(r=new Be({sources:[_I]}),e._irradianceMapFS=r);let s=new vc({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 Wke(e,t){let n=t.context;if(!c(e._irradianceMapTexture))return;let i=new Fr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=yse,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||!c(this._position)||t===se.MORPHING){this._shouldRegenerateShaders=!1;return}$n._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=Lke(this,e)||i===rb.SUNLIGHT&&!ee.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=ee.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Eke(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Xke(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(Ike(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Wke(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=this._count)throw new L(`index must be in the range [0, ${this._count})`);let n=this._properties[t];if(c(n))return He(n[e],!0)};LI.prototype.setProperty=function(e,t,n){if(C.typeOf.number("index",e),C.typeOf.string("propertyId",t),e<0||e>=this._count)throw new L(`index must be in the range [0, ${this._count})`);let i=this._properties[t];c(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=He(n,!0)};var ab=LI;function gc(e){e=e??z.EMPTY_OBJECT,C.typeOf.number("options.count",e.count),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(gc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(c(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 c(this._metadataTable)&&(e+=this._metadataTable.byteLength),c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});gc.prototype.hasProperty=function(e,t){return C.typeOf.number("index",e),C.typeOf.string("propertyId",t),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(t)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};gc.prototype.hasPropertyBySemantic=function(e,t){return C.typeOf.number("index",e),C.typeOf.string("semantic",t),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};gc.prototype.propertyExists=function(e){return C.typeOf.string("propertyId",e),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(e)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};gc.prototype.propertyExistsBySemantic=function(e){return C.typeOf.string("semantic",e),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var oz=[];gc.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,c(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(oz)),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,oz)),c(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(oz)),t};gc.prototype.getProperty=function(e,t){let n;if(c(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),c(n))||c(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),c(n))||c(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),c(n)))return n};gc.prototype.setProperty=function(e,t,n){c(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(c(this._jsonMetadataTable)||(this._jsonMetadataTable=new ab({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};gc.prototype.getPropertyBySemantic=function(e,t){if(c(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};gc.prototype.setPropertyBySemantic=function(e,t,n){return c(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};gc.prototype.getPropertyTypedArray=function(e){if(C.typeOf.string("propertyId",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};gc.prototype.getPropertyTypedArrayBySemantic=function(e){if(C.typeOf.string("semantic",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};function rz(e,t){if(!c(e)||e<0||e>=t)throw new L(`featureId is required and must be between zero and featuresLength - 1 (${t}`-+").")}gc.prototype.isClass=function(e,t){rz(e,this.count),C.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};gc.prototype.isExactClass=function(e,t){return rz(e,this.count),C.typeOf.string("className",t),this.getExactClassName(e)===t};gc.prototype.getExactClassName=function(e){rz(e,this.count);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};var qc=gc;var sCn=_(T(),1);var eCn=_(T(),1);function ZI(e){e=e??z.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures;C.typeOf.object("options.property",t),C.typeOf.object("options.classProperty",n),C.typeOf.object("options.textures",i);let o=c(t.channels)?t.channels:[0],r=t,s=vl.createModelTextureReader({textureInfo:r,channels:Ake(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,l=t.scale,d=n.hasValueTransform||c(a)||c(l);a=a??n.offset,l=l??n.scale,a=n.unpackVectorAndMatrixTypes(a),l=n.unpackVectorAndMatrixTypes(l),this._offset=a,this._scale=l,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(ZI.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}}});ZI.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(ht(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(ht(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==lt.SCALAR?(ht(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==At.UINT8?(ht(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:lt.isVectorType(t)||t===lt.SCALAR?n!==At.UINT8?(ht(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(ht(`Property texture property ${e.id} has an unsupported type`),!1)};var vke=[void 0,"float","vec2","vec3","vec4"],Fke=[void 0,"int","ivec2","ivec3","ivec4"];ZI.prototype.getGlslType=function(){let e=this._classProperty,t=lt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?vke[t]:Fke[t]};ZI.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function Ake(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var RI=ZI;function sz(e){e=e??z.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures;C.typeOf.object("options.propertyTexture",t),C.typeOf.object("options.class",n),C.typeOf.object("options.textures",i);let o=t.extensions,r=t.extras,s={};if(c(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new RI({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(sz.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}}});sz.prototype.getProperty=function(e){return C.typeOf.string("propertyId",e),this._properties[e]};var cb=sz;var yCn=_(T(),1);var uCn=_(T(),1);function xse(e){e=e??z.EMPTY_OBJECT;let t=e.property,n=e.classProperty;C.typeOf.object("options.property",t),C.typeOf.object("options.classProperty",n),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||c(i)||c(o);i=i??n.offset,o=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(xse.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 GI=xse;function az(e){e=e??z.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class;C.typeOf.object("options.propertyAttribute",t),C.typeOf.object("options.class",n);let i={};if(c(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new GI({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(az.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}}});az.prototype.getProperty=function(e){return C.typeOf.string("propertyId",e),this._properties[e]};var V_=az;var SCn=_(T(),1);function EI(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=c(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(EI.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(!c(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n=r;)S=o[S-r];o.push(S),s[g]=x}x>tUe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>nUe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),g===l?(l=x,t[a]=x):g===d?(d=x,t[a+1]=x):(u=x,t[a+2]=x),g=Tse(i,l,d,u,p,y,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Tse(e,t,n,i,o,r,s){let a=s?1:0,l=o?1:0,d=0,u=cz(e,t,a,l,d);if(u===0)return t;let f=0,p=o?1:0,y=r?1:0,h=cz(e,n,f,p,y);if(h===0)return n;let g=s?1:0,x=0,S=r?1:0,V=cz(e,i,g,x,S);if(V===0)return i;let Z=u&h&V,R,E,I;if(Z&1)R=0,E=1,I=2;else if(Z&2)R=0,I=1,E=2;else if(Z&4)E=0,R=1,I=2;else if(Z&8)E=0,I=1,R=2;else if(Z&16)I=0,R=1,E=2;else if(Z&32)I=0,E=1,R=2;else{let N=lz(u),b=lz(h),G=lz(V);return N>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}j5.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;a1;)i>>=1,r.push(Sse(i));let s=new Pt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ke.LUMINANCE,sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR_MIPMAP_LINEAR,magnificationFilter:di.LINEAR})});return t.outlineTexture=s,s};function Sse(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 Cse(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),c(this._processError)){this._state=vo.FAILED;let o=this._processError;this._processError=void 0,$5(this,o)}let t=this._textureErrors.pop();if(c(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,$5(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=vo.FAILED,$5(this,o)}return this._incrementallyLoadTextures?n:n&&i};function OUe(e,t,n,i,o,r,s,a){let l=e.gltfJson,u=l.accessors[t].bufferView;return Ri.getVertexBufferLoader({gltf:l,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 DUe(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 BUe(e,t){let n=Ri.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Ase(e,t,n){let i=t.byteOffset,o=Pl(e,t),r=t.count,s=Sd(t.type),a=t.componentType,l=q.getSizeInBytes(a),d=l*s,u=r*s;if(o===d)return n=new Uint8Array(n),q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let f=q.createTypedArray(a,u),p=new DataView(n.buffer),y=new Array(s),h=nb(t.componentType);i=n.byteOffset+i;for(let g=0;g{c(o)&&c(o.attributes)&&c(o.attributes[f])?nOe(x,S,r,s):iOe(l,d,x,S,r,s)},x}function kse(e,t,n,i,o,r,s,a){let l=n.modelSemantic,d=l===pt.POSITION,u=l===pt.FEATURE_ID,f=d&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=d&&e._enablePick&&!a.context.webgl2,y=e._loadForClassification&&u,h=e._loadAttributesAsTypedArray,g=!h,x=h||f||p||y,Z=Nse(e,t,n,i,o,s?!1:g,s?!0:x,a),R=new Z_.AttributeLoadPlan(Z);return R.loadBuffer=g,R.loadTypedArray=x,R}function oOe(e,t,n,i,o){let r=e.gltfJson.accessors,s=c(n.ROTATION),a=c(n.TRANSLATION)&&c(r[n.TRANSLATION].min)&&c(r[n.TRANSLATION].max),l=mz(e,ns,i),d=l.modelSemantic,u=d===ns.TRANSLATION||d===ns.ROTATION||d===ns.SCALE,f=d===ns.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,y=e._enablePick&&!o.context.webgl2,h=!p,g=e._loadAttributesFor2D&&!o.scene3DOnly;return Nse(e,t,l,void 0,void 0,h,p||f&&(!a||g||y),o)}function rOe(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],l=a.bufferView;if(!c(i)&&!c(l))return;let d=new yUe;d.count=a.count;let u=e._loadAttributesAsTypedArray,f=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,h=!u,g=u||f||p,V=DUe(e,t,n,i,r?!1:h,r?!0:g,s),Z=e._geometryLoaders.length;e._geometryLoaders.push(V);let R=V.load();e._loaderPromises.push(R),e._geometryCallbacks[Z]=()=>{d.indexDatatype=V.indexDatatype,d.buffer=V.buffer,d.typedArray=V.typedArray};let E=new Z_.IndicesLoadPlan(d);return E.loadBuffer=h,E.loadTypedArray=g,E}function $c(e,t,n,i){let o=e.gltfJson,r=vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!c(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=vl.createModelTextureReader({textureInfo:t}),l=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[l]=()=>{a.texture=s.texture,c(i)&&(a.texture.sampler=i)},a}function sOe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,l=new PUe;return c(i)&&(l.diffuseTexture=$c(e,i,n)),c(o)&&(l.specularGlossinessTexture=$c(e,o,n)),l.diffuseFactor=Vd(ce,r),l.specularFactor=Vd(m,s),l.glossinessFactor=a,l}function aOe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,l=new wUe;return c(i)&&(l.baseColorTexture=$c(e,i,n)),c(o)&&(l.metallicRoughnessTexture=$c(e,o,n)),l.baseColorFactor=Vd(ce,r),l.metallicFactor=s,l.roughnessFactor=a,l}function cOe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new vUe;return c(o)&&(a.specularTexture=$c(e,o,n)),c(s)&&(a.specularColorTexture=$c(e,s,n)),a.specularFactor=i,a.specularColorFactor=Vd(m,r),a}function lOe(e,t,n){let{anisotropyStrength:i=dz.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=dz.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new dz;return c(r)&&(s.anisotropyTexture=$c(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function dOe(e,t,n){let{clearcoatFactor:i=uz.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=uz.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,l=new uz;return c(o)&&(l.clearcoatTexture=$c(e,o,n)),c(s)&&(l.clearcoatRoughnessTexture=$c(e,s,n)),c(a)&&(l.clearcoatNormalTexture=$c(e,a,n)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function uOe(e,t,n){let i=new FUe,o=t.extensions??z.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=c(o.KHR_materials_unlit),c(r)?i.specularGlossiness=sOe(e,r,n):(c(d)&&(i.metallicRoughness=aOe(e,d,n)),c(s)&&!i.unlit&&(i.specular=cOe(e,s,n)),c(a)&&!i.unlit&&(i.anisotropy=lOe(e,a,n)),c(l)&&!i.unlit&&(i.clearcoat=dOe(e,l,n))),c(t.emissiveTexture)&&(i.emissiveTexture=$c(e,t.emissiveTexture,n)),c(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=$c(e,t.normalTexture,n)),c(t.occlusionTexture)&&(i.occlusionTexture=$c(e,t.occlusionTexture,n)),i.emissiveFactor=Vd(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Use(e,t){let n=new Pse;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 Ose(e,t,n,i){let o=new Pse,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Mse(r.attribute),o.positionalLabel=i,o}function Dse(e,t){let n=new Fse;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 Bse(e,t,n,i){let o=new Fse,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function mOe(e,t,n,i){let o=new vse;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=$c(e,r,n,en.NEAREST);let a=(c(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function fOe(e,t,n,i,o,r){let s=new vse,a=t.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=$c(e,l,i,en.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function hOe(e,t,n,i,o){let r=new gUe,s=void 0,a=void 0,l=!1;for(let d in t){if(!t.hasOwnProperty(d))continue;let u=t[d],f=mz(e,pt,d),p=kse(e,u,f,s,a,l,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function pOe(e,t,n,i){let o=new xUe,r=new Z_(o);e._primitiveLoadPlans.push(r);let s=t.material;c(s)&&(o.material=uOe(e,e.gltfJson.materials[s],i));let a=t.extensions??z.EMPTY_OBJECT,l=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&c(d)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=bOe(e,d,r));let u=e._loadForClassification,f=a.KHR_draco_mesh_compression,p=!1,y=t.attributes;if(c(y))for(let E in y){if(!y.hasOwnProperty(E))continue;let I=y[E],v=mz(e,pt,E),P=v.modelSemantic;if(u&&!tOe(P))continue;P===pt.FEATURE_ID&&(p=!0);let F=kse(e,I,v,t,f,n,l,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}let h=t.targets;if(c(h)&&!u)for(let E=0;En[s]);let r=t.inverseBindMatrices;if(c(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=ek(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function ROe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!c(n))return[];let i=n.map(function(r,s){let a=ZOe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r{if(Vi._activeComputeCommandCount>=Vi._maximumComputeCommandCount){Vi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Vi._activeComputeCommandCount++};Vi._updateCommandQueue=e=>{if(Vi._maximumComputeCommandCount=Math.log2(kt.maximumCubeMapSize),Vi._nextFrameCommandQueue.length>0&&Vi._activeComputeCommandCounts,u_enuToFixedFrame:()=>c,u_faceDirection:()=>$r.getDirection(m,cbe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,U8e)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){Vi._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[b]=void 0;let _=new ps({context:n,colorTextures:[e._radianceMapTextures[b]]});_._bind(),e._radianceCubeMap[m].copyFromFramebuffer(),_._unBind(),_.destroy(),Vi._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,Vi._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function O8e(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=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Bt({minificationFilter:Ht.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},u=(p,b,f,y,_)=>()=>{if(e.isDestroyed()||p.canceled){Vi._activeComputeCommandCount--;return}let S=e._convolutionComputeCommands;S[b]=void 0,n.copyFace(t,f,y,_),c++,Vi._activeComputeCommandCount--,f.destroy(),e._specularMapTextures[b]=void 0,d()},m=0;for(let p=1;pp/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>$r.getDirection(b,cbe)}});S.postExecute=u(S,m,f,b,p),e._convolutionComputeCommands[m]=S,Vi._queueCommand(S,t),++m}r/=2,s/=2}d()}var lbe=new k(3,3);function B8e(e,t){let n=t.context,i=lbe,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new vt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Je({sources:[fF]}),e._irradianceMapFS=r);let s=new Gu({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Vi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Vi._activeComputeCommandCount--},e._irradianceComputeCommand=s,Vi._queueCommand(s,t),e._irradianceTextureDirty=!0}function z8e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new ps({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=lbe,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]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Vi.prototype.update=function(e){let t=e.mode;if(!(Vi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===se.MORPHING){this._shouldRegenerateShaders=!1;return}Vi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=w8e(this,e)||i===vb.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&&(D8e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(O8e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(B8e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){z8e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Vi.prototype.isDestroyed=function(){return!1};Vi.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;tkt.maximumTextureSize||a>kt.maximumTextureSize){xt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${kt.maximumTextureSize}.`);return}let c=q8e(s,r),d=new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:ei.NEAREST});return vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:d,flipY:!1,source:{width:r,height:a,arrayBufferView:c}})}function j8e(e,t,n,i){let o=[],r=n.properties;for(let[s,a]of Object.entries(r)){if(!a.isGpuCompatible(_F))continue;let c=e[s],d=l(c)?t[c.values]:Q8e(a,i),u=d.length,m=a.cpuBytesPerElement(),p=u/m;if(p!==i)throw new ae(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);o.push({view:d,classProperty:a})}return o}function Q8e(e,t){let n=e.noData,i=St.getComponentCount(e.type),o=e.isArray?e.arrayLength:1;e.type===St.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),o===1&&(n=[n]);let r=e.cpuBytesPerElement(),s=Nt.getSizeInBytes(e.valueType),a=new ArrayBuffer(r*t),c=new DataView(a),d=Nt.getDataViewAccessors(c,e.valueType);for(let u=0;u=r;)S=o[S-r];o.push(S),s[y]=_}_>g6e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>y6e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=_,t[a]=_):y===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),y=gbe(i,c,d,u,p,b,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function gbe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=w6(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,b=r?1:0,f=w6(e,n,m,p,b);if(f===0)return n;let y=s?1:0,_=0,S=r?1:0,Z=w6(e,i,y,_,S);if(Z===0)return i;let R=u&f&Z,C,E,A;if(R&1)C=0,E=1,A=2;else if(R&2)C=0,A=1,E=2;else if(R&4)E=0,C=1,A=2;else if(R&8)E=0,A=1,C=2;else if(R&16)A=0,C=1,E=2;else if(R&32)A=0,E=1,C=2;else{let N=M6(u),g=M6(f),V=M6(Z);return N>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}kO.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;a1;)i>>=1,r.push(ybe(i));let s=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:Qe.LUMINANCE,sampler:new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR_MIPMAP_LINEAR,magnificationFilter:ei.LINEAR})});return t.outlineTexture=s,s};function ybe(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 xbe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=cr.FAILED;let r=this._processError;this._processError=void 0,DO(this,r)}let n=this._textureErrors.pop();if(l(n)){let r=this.getError("Failed to load glTF texture",n);throw r.name="TextureError",r}if(this._state===cr.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=cr.FAILED,DO(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=cr.FAILED,DO(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===cr.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ni.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,xqe(this),Wbe(this),Tqe(this),_qe(this),Sqe(this),Zqe(this),this._components=void 0,this._typedArray=void 0,this._state=cr.UNLOADED}};async function o7e(e){e._state=cr.LOADING,e._textureState=cr.LOADING;try{let t=Ni.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=cr.LOADED,e._textureState=cr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=cr.FAILED,e._textureState=cr.FAILED,DO(e,t)}}async function r7e(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new CF({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=yqe(e,t);return e._state=cr.PROCESSING,e._textureState=cr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ni.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function DO(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function s7e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s{if(e.isDestroyed())return;let s=O6(o,t,i.typedArray);n.set(s)});return e._loaderPromises.push(r),n}function wd(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function f7e(e){return e===Number?0:new e}function p7e(e){switch(e){case J.BYTE:return 127;case J.UNSIGNED_BYTE:return 255;case J.SHORT:return 32767;case J.UNSIGNED_SHORT:return 65535;default:return 1}}var b7e={VEC2:new k(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function g7e(e,t){let n=p7e(e.componentDatatype),i=b7e[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 y7e(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 Vn.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 k(i[6],i[7]),s.quantizedVolumeStepSize=new k(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ce(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ce(i[0],i[6],i[12],i[18])),t.quantization=s}function x7e(e,t,n,i,o){let r=e.accessors[t],s=Dt.getMathType(r.type),a=r.normalized??!1,c=new F6e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=f7e(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=Xd(e,r),no(r,"WEB3D_quantized_attributes")&&y7e(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===dt.POSITION||c.semantic===dt.NORMAL||c.semantic===dt.TANGENT||c.semantic===dt.TEXCOORD||c.semantic===dt.FEATURE_ID||c.semantic===dt.SCALE||c.semantic===dt.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&g7e(c,s),c}function Xbe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var T7e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function B6(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=T7e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function _7e(e){let t=e===dt.POSITION,n=e===dt.FEATURE_ID,i=e===dt.TEXCOORD;return t||n||i}function S7e(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=J.createArrayBufferView(o,t.typedArray.buffer)}}function Z7e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=J.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===dt.POSITION){let o=s=>{let a=1/0,c=-1/0,d=1/0,u=-1/0,m=1/0,p=-1/0;for(let b=0;b{l(o)&&l(o.attributes)&&l(o.attributes[p])?S7e(S,Z,s,a):l(r)?Z7e(S,Z,s,a):R7e(d,u,S,Z,s,a)},S}function Ybe(e,t,n,i,o,r,s,a,c){let d=n.modelSemantic,u=d===dt.POSITION,m=d===dt.FEATURE_ID,p=u&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,b=u&&e._enablePick&&!c.context.webgl2,f=e._loadForClassification&&m,y=e._loadAttributesAsTypedArray,_=!y,S=y||p||b||f,C=Nbe(e,t,n,i,o,r,a?!1:_,a?!0:S,c),E=new sS.AttributeLoadPlan(C);return E.loadBuffer=_,E.loadTypedArray=S,E}function C7e(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=B6(e,Pr,i),d=c.modelSemantic,u=d===Pr.TRANSLATION||d===Pr.ROTATION||d===Pr.SCALE,m=d===Pr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,b=e._enablePick&&!o.context.webgl2,f=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Nbe(e,t,c,void 0,void 0,void 0,f,p||m&&(!a||y||b),o)}function V7e(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??B.EMPTY_OBJECT,d=c.KHR_draco_mesh_compression,u=l(c.EXT_mesh_primitive_edge_visibility);if(!l(d)&&!l(a))return;let m=new I6e;m.count=s.count;let p=e._loadAttributesAsTypedArray,b=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,f=e._loadForClassification&&i,_=!p,S=p||b||f||u,C=d7e(e,t,n,d,o?!1:_,o?!0:S,r),E=e._geometryLoaders.length;e._geometryLoaders.push(C);let A=C.load();e._loaderPromises.push(A),e._geometryCallbacks[E]=()=>{m.indexDatatype=C.indexDatatype,m.buffer=C.buffer,m.typedArray=C.typedArray};let L=new sS.IndicesLoadPlan(m);return L.loadBuffer=_,L.loadTypedArray=S,L}function E7e(e,t,n){return new Bt({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function jl(e,t,n,i,o){let r=e.gltfJson,s=Nd.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Ni.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Nd.createModelTextureReader({textureInfo:t}),d=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(m=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw m;e._textureState=cr.FAILED,e._textureErrors.push(m)}});return e._texturesPromises.push(u),e._textureCallbacks[d]=()=>{let m=a.texture;c.texture=m,(l(i)||l(o))&&(m.sampler=E7e(m.sampler,i,o))},c}function A7e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new Q6e;return l(i)&&(c.diffuseTexture=jl(e,i,n)),l(o)&&(c.specularGlossinessTexture=jl(e,o,n)),c.diffuseFactor=wd(ce,r),c.specularFactor=wd(h,s),c.glossinessFactor=a,c}function G7e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new j6e;return l(i)&&(c.baseColorTexture=jl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=jl(e,o,n)),c.baseColorFactor=wd(ce,r),c.metallicFactor=s,c.roughnessFactor=a,c}function L7e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new q6e;return l(o)&&(a.specularTexture=jl(e,o,n)),l(s)&&(a.specularColorTexture=jl(e,s,n)),a.specularFactor=i,a.specularColorFactor=wd(h,r),a}function W7e(e,t,n){let{anisotropyStrength:i=k6.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=k6.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new k6;return l(r)&&(s.anisotropyTexture=jl(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function v7e(e,t,n){let{clearcoatFactor:i=U6.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=U6.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new U6;return l(o)&&(c.clearcoatTexture=jl(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=jl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=jl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function F7e(e){return new $6e(e)}function I7e(e){if(!l(e))return;let t=new e7e;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function P7e(e,t,n){let i=new t7e,o=t.extensions??B.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,u=o.BENTLEY_materials_planar_fill;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=A7e(e,r,n):(l(d)&&(i.metallicRoughness=G7e(e,d,n)),l(s)&&!i.unlit&&(i.specular=L7e(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=W7e(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=v7e(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=jl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=jl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=jl(e,t.occlusionTexture,n)),i.emissiveFactor=wd(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(u)&&(i.planarFill=F7e(u));let m=o.BENTLEY_materials_point_style;if(l(m)&&l(m.diameter)){let p=m.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=I7e(o.BENTLEY_materials_line_style),i}function wbe(e,t){let n=new vbe;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 Mbe(e,t,n,i){let o=new vbe,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Xbe(r.attribute),o.positionalLabel=i,o}function kbe(e,t){let n=new Ibe;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 Ube(e,t,n,i){let o=new Ibe,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function X7e(e,t,n,i){let o=new Fbe;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=jl(e,r,n,Ht.NEAREST,ei.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function N7e(e,t,n,i,o,r){let s=new Fbe,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=jl(e,c,i,Ht.NEAREST,ei.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function Y7e(e,t,n,i,o){let r=new P6e,s=void 0,a=void 0,c=void 0,d=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let m=t[u],p=B6(e,dt,u),b=Ybe(e,m,p,s,a,c,d,n,o);r.attributes.push(b.attribute),i.attributePlans.push(b)}return r}function w7e(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Dbe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let o=i.pbrMetallicRoughness??B.EMPTY_OBJECT,r=wd(ce,o.baseColorFactor);return l(r)?r:new ce(1,1,1,1)}function M7e(e){switch(e){case J.UNSIGNED_BYTE:return 255;case J.UNSIGNED_SHORT:return 65535;case J.UNSIGNED_INT:return 4294967295;default:throw new ae("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function k7e(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;on[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=XF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(P.IDENTITY);return i}function oqe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=iqe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r0&&(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)};aC.prototype.isDestroyed=function(){return!1};aC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var NF=aC;var gUn=x(T(),1);var dUn=x(T(),1);var Ql={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===Ql.RGBA4||e===Ql.RGBA8||e===Ql.RGBA16F||e===Ql.RGBA32F||e===Ql.RGB5_A1||e===Ql.RGB565||e===Ql.DEPTH_COMPONENT16||e===Ql.STENCIL_INDEX8||e===Ql.DEPTH_STENCIL||e===Ql.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Ql.RGBA32F:e===ie.HALF_FLOAT_OES?Ql.RGBA16F:Ql.RGBA8}};Object.freeze(Ql);var ql=Ql;function YF(e){e=e??B.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumRenderbufferSize,o=e.format??ql.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=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(YF.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});YF.prototype._getRenderbuffer=function(){return this._renderbuffer};YF.prototype.isDestroyed=function(){return!1};YF.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var Wu=YF;function ya(e){e=e??B.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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(ya.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}}});ya.prototype.isDirty=function(e,t,n,i,o){n=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])};ya.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??Qe.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;s1){let a=ql.getColorFormat(o);this._colorRenderbuffers[s]=new Wu({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:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Bt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Wu({context:e,width:t,height:n,format:ql.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Wu({context:e,width:t,height:n,format:ql.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new vt({context:e,width:t,height:n,pixelFormat:Qe.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Bt.NEAREST}):this._depthRenderbuffer=new Wu({context:e,width:t,height:n,format:ql.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new NF({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 ps({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ya.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};ya.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ya.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};ya.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ya.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ya.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ya.prototype.getDepthTexture=function(){return this._depthTexture};ya.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ya.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ya.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ya.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ya.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ya.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ya.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ya.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ya.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n=s.clientWidth)d=!0;else{if(Z.x>s.clientWidth*.5){a.width=Z.x,l.frustum.right=p.x-S,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,hz),a.x+=Z.x,l.position.x=-l.position.x;let R=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-R,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,pz)}else{a.x+=Z.x,a.width-=Z.x,l.frustum.left=-p.x-S,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,hz),a.x=a.x-a.width,l.position.x=-l.position.x;let R=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-R,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,pz)}m.clone(y,l.position),l.frustum=h.clone(),i=D.clone(hz,i),(i.x<0||i.x>s.clientWidth)&&(i.x=pz.x)}}if(o.mode!==se.SCENE2D||d){if(xc=BI(r,n,l,xc),xc.z<0&&!(l.frustum instanceof sn)&&!(l.frustum instanceof Oo))return;i=Ma.clipToGLWindowCoordinates(a,xc,i)}return i.y=s.clientHeight-i.y,i};Ma.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ma.worldToWindowCoordinates(e,t,n),!!c(n))return Ma.transformWindowToDrawingBuffer(e,n,n)};var db=new m,nDe=new pe;Ma.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===se.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,nDe);if(!c(r))return;if(o.project(r,db),i===se.COLUMBUS_VIEW)return m.fromElements(db.z,db.x,db.y,n);if(i===se.SCENE2D)return m.fromElements(0,db.x,db.y,n);let s=e.morphTime;return m.fromElements(w.lerp(db.z,t.x,s),w.lerp(db.x,t.y,s),w.lerp(db.y,t.z,s),n)};var Qse=new m,jse=new m,qse=new M;Ma.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Qse),M.computeViewportTransformation(e,0,1,qse),M.multiplyByPoint(qse,Qse,jse),D.fromCartesian3(jse,n)};Ma.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 iDe=new ce,$se=new ce;Ma.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,l=s.y;if(e.frameState.useLogDepth){let y=n*r.log2FarDepthFromNearPlusOne,h=Math.pow(2,y)-1;n=l*(1-a/(h+a))/(l-a)}let d=e.view.passState.viewport,u=ce.clone(ce.UNIT_W,iDe);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 f,p=e.camera.frustum;if(c(p.fovy)){f=M.multiplyByVector(r.inverseViewProjection,u,$se);let y=1/f.w;m.multiplyByScalar(f,y,f)}else{let y=p.offCenterFrustum;c(y)&&(p=y),f=$se,f.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,f.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,f.z=(u.z*(a-l)-a-l)*.5,f.w=1,f=M.multiplyByVector(r.inverseView,f,f)}return m.fromCartesian4(f,i)};var Oi=Ma;var OZn=_(T(),1);var qLn=_(T(),1);var jC={};jC._deprecationWarning=Cs;var ub=Uint32Array.BYTES_PER_ELEMENT;jC.parse=function(e,t){let n=t??0;C.defined("arrayBuffer",e),t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ub;let r=o.getUint32(t,!0);if(r!==1)throw new le(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=ub;let s=o.getUint32(t,!0);t+=ub;let a=o.getUint32(t,!0);t+=ub;let l=o.getUint32(t,!0);t+=ub;let d=o.getUint32(t,!0);t+=ub;let u=o.getUint32(t,!0);t+=ub;let f;d>=570425344?(t-=ub*2,f=a,d=l,u=0,a=0,l=0,jC._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-=ub,f=d,d=a,u=l,a=0,l=0,jC._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:f??0}:(p=er(i,t,a),t+=a);let y=new Uint8Array(e,t,l);t+=l;let h,g;d>0&&(h=er(i,t,d),t+=d,u>0&&(g=new Uint8Array(e,t,u),g=new Uint8Array(g),t+=u));let x=n+s-t;if(x===0)throw new le("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,x):(jC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+x))),{batchLength:f,featureTableJson:p,featureTableBinary:y,batchTableJson:h,batchTableBinary:g,gltf:S}};var YI=jC;var nZn=_(T(),1);function HI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function eae(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return c(a)||(a=q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function oDe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return c(r)||(r=q.createTypedArray(n,i),o[t]=r),r}HI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(t=t??q.UNSIGNED_INT,n=n??1,eae(this,e,t,n,1,i.byteOffset)):i};HI.prototype.hasProperty=function(e){return c(this.json[e])};HI.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(c(i.componentType)&&(t=q.fromName(i.componentType)),eae(this,e,t,n,this.featuresLength,i.byteOffset)):oDe(this,e,t,i)};HI.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!c(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(h=er(i,t,d),t+=d,u>0&&(g=new Uint8Array(e,t,u),g=new Uint8Array(g),t+=u));let x=n+s-t;if(x===0)throw new le("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,x):(nk._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:f,featureTableJson:p,featureTableBinary:y,batchTableJson:h,batchTableBinary:g,gltf:S}};var QI=nk;var fb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},ik=Cn.Attribute,LDe=Cn.FeatureIdAttribute,sae=Cn.Instances;function hb(e){e=e??z.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Po.Y,d=e.forwardAxis??Po.X,u=e.loadAttributesAsTypedArray??!1,f=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,y=e.enablePick??!1;C.typeOf.object("options.i3dmResource",t),C.typeOf.object("options.arrayBuffer",n),i=c(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=l,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=f,this._loadPrimitiveOutline=p,this._enablePick=y,this._state=fb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}c(Object.create)&&(hb.prototype=Object.create(Ji.prototype),hb.prototype.constructor=hb);Object.defineProperties(hb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});hb.prototype.load=function(){if(c(this._promise))return this._promise;let e=QI.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new of(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!c(a))throw new le("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let l=s.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(l)&&(this._transform=M.fromTranslation(m.fromArray(l))),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 f=Il(e.gltf);f=f.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:f});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new nf(d);return this._gltfLoader=u,this._state=fb.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=fb.PROCESSING,this}).catch(f=>{if(!this.isDestroyed())throw ZDe(this,f)}),this._promise};function ZDe(e,t){return e.unload(),e._state=fb.FAILED,e.getError("Failed to load i3dm",t)}hb.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===fb.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===fb.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),EDe(this,i,e),RDe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=fb.READY,!0};function RDe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(c(n.json))o=mb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new qc({name:Jm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ds({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var ok=new m,gz=new Array(4),GDe=new M;function EDe(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"),l=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=IDe(o,r),f;l&&(f=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let y=new Float32Array(r),h=m.unpackArray(u),g=new m,x=new m,S=new m,V=new m,Z=new te,R=new Fe,E=new Array(4),I=new m,v=new Array(3),P=new M;if(!c(s)||m.equals(m.unpack(s),m.ZERO)){let O=ue.fromPoints(h);for(i=0;i0&&(O.instances=B?XDe(F):F,B=!0)}}function XDe(e){let t=new sae;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;on[i-1])throw new L("time is out of range.");if(t=t??0,e>=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};qC.prototype.clampTime=function(e){C.typeOf.number("time",e);let t=this.times;return w.clamp(e,t[0],t[t.length-1])};var Pi=qC;function $C(e){this._value=e,this._valueType=Pi.getPointType(e)}Object.defineProperties($C.prototype,{value:{get:function(){return this._value}}});$C.prototype.findTimeInterval=function(e){throw new L("findTimeInterval cannot be called on a ConstantSpline.")};$C.prototype.wrapTime=function(e){return C.typeOf.number("time",e),0};$C.prototype.clampTime=function(e){return C.typeOf.number("time",e),0};$C.prototype.evaluate=function(e,t){C.typeOf.number("time",e);let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var qI=$C;var IGn=_(T(),1);var pGn=_(T(),1);function e1(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new L("points and times are required.");if(t.length<2)throw new L("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new L("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Pi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(e1.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});e1.prototype.findTimeInterval=Pi.prototype.findTimeInterval;e1.prototype.wrapTime=Pi.prototype.wrapTime;e1.prototype.clampTime=Pi.prototype.clampTime;e1.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]:(c(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var Zy=e1;var _Gn=_(T(),1);var aae={};aae.solve=function(e,t,n,i){if(!c(e)||!(e instanceof Array))throw new L("The array lower is required.");if(!c(t)||!(t instanceof Array))throw new L("The array diagonal is required.");if(!c(n)||!(n instanceof Array))throw new L("The array upper is required.");if(!c(i)||!(i instanceof Array))throw new L("The array right is required.");if(t.length!==i.length)throw new L("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new L("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new L("lower and upper must be one less than the length of diagonal.");let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var t1=aae;var cae=[],lae=[],dae=[],uae=[];function FDe(e,t,n){let i=cae,o=dae,r=lae,s=uae;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let l=s[0];for(c(l)||(l=s[0]=new m),m.clone(t,l),a=1;a=n.length||e.index<0))throw new L("options.index must be a valid animation index.");let i=e.index;if(c(i))return Tz(this,n[i],e);let o=n.length;for(let r=0;r=this._runtimeAnimations.length||e<0)throw new L("index must be valid within the range of the collection");return this._runtimeAnimations[e]};var rk=[];function HDe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}pb.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Al.REPEAT)y=y-Math.floor(y);else if(a.loop===Al.MIRRORED_REPEAT){let V=Math.floor(y),Z=y-V;y=V%2===1?1-Z:Z}let x=a.startOffset;a.reverse&&(y=1-y,x=-x);let S=y*d*a.multiplier+x;S=w.clamp(S,a.localStartTime,a.localStopTime),a.animate(S),a.update.numberOfListeners>0&&(a._updateEventTime=S,e.afterRender.push(a._raiseUpdateEvent)),i=!0,g||(a._state=rf.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&rk.push(a))}}n=rk.length;for(let s=0;s=s.clientWidth)d=!0;else{if(R.x>s.clientWidth*.5){a.width=R.x,c.frustum.right=p.x-S,ll=MF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,H6),a.x+=R.x,c.position.x=-c.position.x;let C=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-C,ll=MF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,K6)}else{a.x+=R.x,a.width-=R.x,c.frustum.left=-p.x-S,ll=MF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,H6),a.x=a.x-a.width,c.position.x=-c.position.x;let C=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-C,ll=MF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,K6)}h.clone(b,c.position),c.frustum=f.clone(),i=k.clone(H6,i),(i.x<0||i.x>s.clientWidth)&&(i.x=K6.x)}}if(o.mode!==se.SCENE2D||d){if(ll=MF(r,n,c,ll),ll.z<0&&!(c.frustum instanceof yn)&&!(c.frustum instanceof bs))return;i=Fc.clipToGLWindowCoordinates(a,ll,i)}return i.y=s.clientHeight-i.y,i};Fc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Fc.worldToWindowCoordinates(e,t,n),!!l(n))return Fc.transformWindowToDrawingBuffer(e,n,n)};var Nb=new h,Fqe=new pe;Fc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===se.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,Fqe);if(!l(r))return;if(o.project(r,Nb),i===se.COLUMBUS_VIEW)return h.fromElements(Nb.z,Nb.x,Nb.y,n);if(i===se.SCENE2D)return h.fromElements(0,Nb.x,Nb.y,n);let s=e.morphTime;return h.fromElements(W.lerp(Nb.z,t.x,s),W.lerp(Nb.x,t.y,s),W.lerp(Nb.y,t.z,s),n)};var Kbe=new h,Jbe=new h,jbe=new P;Fc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Kbe),P.computeViewportTransformation(e,0,1,jbe),P.multiplyByPoint(jbe,Kbe,Jbe),k.fromCartesian3(Jbe,n)};Fc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return k.fromElements(t.x*o,t.y*r,n)};var Iqe=new ce,Qbe=new ce;Fc.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 b=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,b)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=ce.clone(ce.UNIT_W,Iqe);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 m,p=e.camera.frustum;if(l(p.fovy)){m=P.multiplyByVector(r.inverseViewProjection,u,Qbe);let b=1/m.w;h.multiplyByScalar(m,b,m)}else{let b=p.offCenterFrustum;l(b)&&(p=b),m=Qbe,m.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(u.z*(a-c)-a-c)*.5,m.w=1,m=P.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var fo=Fc;var nDn=x(T(),1);var p5n=x(T(),1);var lC={};lC._deprecationWarning=Jo;var Yb=Uint32Array.BYTES_PER_ELEMENT;lC.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Yb;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+=Yb;let s=o.getUint32(t,!0);t+=Yb;let a=o.getUint32(t,!0);t+=Yb;let c=o.getUint32(t,!0);t+=Yb;let d=o.getUint32(t,!0);t+=Yb;let u=o.getUint32(t,!0);t+=Yb;let m;d>=570425344?(t-=Yb*2,m=a,d=c,u=0,a=0,c=0,lC._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-=Yb,m=d,d=a,u=c,a=0,c=0,lC._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:m??0}:(p=vr(i,t,a),t+=a);let b=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=vr(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,_):(lC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:b,batchTableJson:f,batchTableBinary:y,gltf:S}};var kF=lC;var x5n=x(T(),1);function UF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function qbe(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=J.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function Pqe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=J.createTypedArray(n,i),o[t]=r),r}UF.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??J.UNSIGNED_INT,n=n??1,qbe(this,e,t,n,1,i.byteOffset)):i};UF.prototype.hasProperty=function(e){return l(this.json[e])};UF.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=J.fromName(i.componentType)),qbe(this,e,t,n,this.featuresLength,i.byteOffset)):Pqe(this,e,t,i)};UF.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;a0&&(f=vr(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,_):(BO._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:b,batchTableJson:f,batchTableBinary:y,gltf:S}};var zF=BO;var Mb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},zO=Vn.Attribute,n$e=Vn.FeatureIdAttribute,oge=Vn.Instances,$6=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,o=t.baseResource,r=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,d=t.upAxis??Bi.Y,u=t.forwardAxis??Bi.X,m=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,b=t.loadPrimitiveOutline??!0,f=t.enablePick??!1;o=l(o)?o:n.clone(),this._i3dmResource=n,this._baseResource=o,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=d,this._forwardAxis=u,this._loadAttributesAsTypedArray=m,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=b,this._enablePick=f,this._state=Mb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=zF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,s=t.gltfFormat,a=new cf(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let d=a.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(d)&&(this._transform=P.fromTranslation(h.fromArray(d))),this._batchTable={json:o,binary:r};let u={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(s===0){let p=Fd(t.gltf);p=p.replace(/[\s\0]+$/,"");let b=this._baseResource.getDerivedResource({url:p});u.gltfResource=b,u.baseResource=b}else u.gltfResource=this._i3dmResource,u.typedArray=t.gltf;let m=new Lu(u);return this._gltfLoader=m,this._state=Mb.LOADING,this._promise=m.load().then(()=>{if(!this.isDestroyed())return this._state=Mb.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw i$e(this,p)}),this._promise}process(t){if(this._state===Mb.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Mb.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=P.multiplyTransformation(this._transform,o.transform,o.transform),s$e(this,o,t),o$e(this,o),this._components=o,this._arrayBuffer=void 0,this._state=Mb.READY,!0}isUnloaded(){return this._state===Mb.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),u$e(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Mb.UNLOADED}};function i$e(e,t){return e.unload(),e._state=Mb.FAILED,e.getError("Failed to load i3dm",t)}function o$e(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 Jl({name:nf.BATCH_TABLE_CLASS_NAME,count:i});o=new wa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var HO=new h,e7=new Array(4),r$e=new P;function s$e(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",J.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=c$e(o,r),m;c&&(m=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let b=new Float32Array(r),f=h.unpackArray(u),y,_=new h,S=new h,Z=new h,R=new q,C=new Ne,E=new Array(4),A=new h,L=new Array(3),F=new P;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let w=de.fromPoints(f);for(i=0;i0&&(w.instances=D?a$e(I):I,D=!0)}}function a$e(e){let t=new oge;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(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 vo=dC;function uC(e){this._value=e,this._valueType=vo.getPointType(e)}Object.defineProperties(uC.prototype,{value:{get:function(){return this._value}}});uC.prototype.findTimeInterval=function(e){};uC.prototype.wrapTime=function(e){return 0};uC.prototype.clampTime=function(e){return 0};uC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var KF=uC;var XOn=x(T(),1);var ZOn=x(T(),1);function mC(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=vo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(mC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});mC.prototype.findTimeInterval=vo.prototype.findTimeInterval;mC.prototype.wrapTime=vo.prototype.wrapTime;mC.prototype.clampTime=vo.prototype.clampTime;mC.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 h),h.lerp(n[o],n[o+1],r,t))};var ux=mC;var VOn=x(T(),1);var sge={};sge.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=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var hC=sge;var age=[],cge=[],lge=[],dge=[];function m$e(e,t,n){let i=age,o=lge,r=cge,s=dge;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 h),h.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Yd.REPEAT)b=b-Math.floor(b);else if(a.loop===Yd.MIRRORED_REPEAT){let Z=Math.floor(b),R=b-Z;b=Z%2===1?1-R:R}let _=a.startOffset;a.reverse&&(b=1-b,_=-_);let S=b*d*a.multiplier+_;S=W.clamp(S,a.localStartTime,a.localStopTime),a.animate(S),a.update.numberOfListeners>0&&(a._updateEventTime=S,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=lf.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&KO.push(a))}}n=KO.length;for(let s=0;sw.EPSILON3}};var dW=hae;var yXn=_(T(),1);var lXn=_(T(),1),uW=`#ifdef DIFFUSE_IBL +`;var hge={name:"AtmospherePipelineStage"};hge.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,fe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,fe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([oI]),i.addFragmentLines([iI]),i.addUniform("bool","u_isInFog",fe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return W.fog(o,n.fog.density)>W.EPSILON3}};var rI=hge;var g3n=x(T(),1);var l3n=x(T(),1),sI=`#ifdef DIFFUSE_IBL vec3 sampleDiffuseEnvironment(vec3 cubeDir) { #ifdef CUSTOM_SPHERICAL_HARMONICS @@ -4034,14 +5038,14 @@ vec3 specularContribution = vec3(0.0); return diffuseContribution + specularContribution; } #endif -`;var pae={name:"ImageBasedLightingPipelineStage"},JDe=new D;pae.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;c(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,xe.FRAGMENT),r.addUniform("vec2","model_iblFactor",xe.FRAGMENT),Bm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",xe.FRAGMENT),c(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,xe.BOTH),c(a)&&c(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,xe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,xe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",xe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,xe.FRAGMENT),c(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||c(s)?(r.addDefine("SPECULAR_IBL",void 0,xe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,xe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",xe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",xe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,xe.FRAGMENT)),r.addFragmentLines(uW);let l={model_iblFactor:function(){return D.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,JDe)},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}};c(s)&&(l.model_specularEnvironmentMaps=function(){return s},l.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=St(l,e.uniformMap)};var mW=pae;var wXn=_(T(),1);var ZXn=_(T(),1);var QDe=w.EPSILON16;function Cz(e){e=e??z.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;C.typeOf.object("options.stage",t),C.typeOf.object("options.runtimeArticulation",n),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(Cz.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){C.typeOf.number("value",e),e=w.clamp(e,this.minimumValue,this.maximumValue),w.equalsEpsilon(this._currentValue,e,QDe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var jDe=new m,Sz=new te;Cz.prototype.applyStageToMatrix=function(e){C.typeOf.object("result",e);let t=this.type,n=this.currentValue,i=jDe,o;switch(t){case yc.XROTATE:o=te.fromRotationX(w.toRadians(n),Sz),e=M.multiplyByMatrix3(e,o,e);break;case yc.YROTATE:o=te.fromRotationY(w.toRadians(n),Sz),e=M.multiplyByMatrix3(e,o,e);break;case yc.ZROTATE:o=te.fromRotationZ(w.toRadians(n),Sz),e=M.multiplyByMatrix3(e,o,e);break;case yc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case yc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case yc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case yc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case yc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case yc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case yc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var fW=Cz;function sk(e){e=e??z.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;C.typeOf.object("options.articulation",t),C.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,qDe(this)}Object.defineProperties(sk.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 qDe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } -`;var bae={name:"ModelClippingPlanesPipelineStage"},tBe=new D;bae.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,xe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,xe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,xe.FRAGMENT),hs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,xe.FRAGMENT);let s=hs.getTextureResolution(i,o,tBe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,xe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,xe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",xe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",xe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",xe.FRAGMENT),r.addFragmentLines(bW);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let l=Y.clone(i.edgeColor);return l.alpha=i.edgeWidth,l},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=St(a,e.uniformMap)};var yW=bae;var cIn=_(T(),1);var eIn=_(T(),1),gW=`void modelClippingPolygonsStage(ProcessedAttributes attributes) +`;var pge={name:"ModelClippingPlanesPipelineStage"},W$e=new k,v$e=new P,F$e=new P;pge.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,fe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,fe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,fe.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,fe.FRAGMENT);let s=gs.getTextureResolution(i,o,W$e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,fe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,fe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",fe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",fe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",fe.FRAGMENT),r.addFragmentLines(uI);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=U.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=P.transpose(o.uniformState.inverseView3D,v$e);return P.multiply(c,t._clippingPlanesMatrix,F$e)}};e.uniformMap=It(a,e.uniformMap)};var mI=pge;var hzn=x(T(),1);var $3n=x(T(),1),hI=`void modelClippingPolygonsStage() { -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; +bool insideAny = vectorClip(v_clippingUv); +#ifdef CLIPPING_INVERSE +if (!insideAny) +{ +discard; +} +#else +if (insideAny) +{ +discard; +} +#endif +} +`;var tzn=x(T(),1),fI=`void modelClippingPolygonsStage() +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; +} +`;var izn=x(T(),1),Db=`uniform highp sampler2D u_vectorColorTexture; +uniform highp sampler2D u_vectorPickColorTexture; +int vectorPickPrimitiveIndex = -1; +#ifdef HAS_VECTOR_POLYLINES +uniform highp sampler2D u_vectorSegmentTexture; +uniform highp sampler2D u_vectorWidthTexture; +uniform highp sampler2D u_vectorSegmentPrimitiveIndicesTexture; +uniform highp sampler2D u_vectorGridCellIndicesTexture; +#ifdef VECTOR_WIDTH_IN_METERS +uniform vec2 u_vectorMetersPerUv; +#endif +#endif +#ifdef HAS_VECTOR_POLYGONS +uniform highp sampler2D u_vectorPolygonEdgeTexture; +uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture; +uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture; +#endif +uniform highp sampler2D u_clippingEdgeTexture; +uniform highp sampler2D u_clippingEdgePrimitiveIndicesTexture; +uniform highp sampler2D u_clippingGridCellIndicesTexture; +vec2 vectorOffsetToLine(vec2 p, vec4 line) +{ +vec2 a = line.xy; +vec2 b = line.zw; +vec2 ab = b - a; +float abLengthSquared = dot(ab, ab); +if (abLengthSquared < 1.0e-8) +{ +return p - a; +} +float t = clamp(dot(p - a, ab) / abLengthSquared, 0.0, 1.0); +return p - (a + t * ab); +} +ivec2 vectorIndexToUv(int index, ivec2 size) +{ +int v = index / size.x; +int u = index - v * size.x; +return ivec2(u, v); +} +ivec2 vectorCellRange(vec2 uv, highp sampler2D gridCellIndicesTexture) +{ +ivec2 headerSize = textureSize(gridCellIndicesTexture, 0); +if (headerSize.x * headerSize.y < 3) +{ +return ivec2(0); +} +int gridWidth = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r); +int gridHeight = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r); +int cellX = clamp(int(uv.x * float(gridWidth)), 0, gridWidth - 1); +int cellY = clamp(int(uv.y * float(gridHeight)), 0, gridHeight - 1); +int cellIndex = cellX + cellY * gridWidth; +int indexEnd = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r); +int indexStart = cellIndex == 0 +? 0 +: int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r); +return ivec2(indexStart, indexEnd); +} +#ifdef VECTOR_ANTIALIAS +const float vectorCoverageRadius = 0.5; +#else +const float vectorCoverageRadius = 0.0; +#endif +vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor) +{ +#ifdef HAS_VECTOR_POLYLINES +mat2 screenFromUv = inverse(mat2(dFdx(vectorUv), dFdy(vectorUv))); +#ifdef VECTOR_WIDTH_IN_METERS +mat2 metersFromUv = mat2(u_vectorMetersPerUv.x, 0.0, 0.0, u_vectorMetersPerUv.y); +float pixelsPerMeter = 1.0 / max( +length(metersFromUv * dFdx(vectorUv)), +length(metersFromUv * dFdy(vectorUv))); +#endif +ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0); +if (headerSize.x * headerSize.y < 3) +{ +return baseColor; +} +ivec2 range = vectorCellRange(vectorUv, u_vectorGridCellIndicesTexture); +ivec2 segmentTextureSize = textureSize(u_vectorSegmentTexture, 0); +ivec2 primitiveTextureSize = textureSize(u_vectorWidthTexture, 0); +float nearestEdgeDistance = 1.0e30; +int nearestPrimitiveIndex = -1; +for (int i = range.x; i < range.y; i++) +{ +ivec2 segmentUv = vectorIndexToUv(i, segmentTextureSize); +vec4 segment = texelFetch(u_vectorSegmentTexture, segmentUv, 0); +int primitiveIndex = int(texelFetch(u_vectorSegmentPrimitiveIndicesTexture, segmentUv, 0).r); +ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize); +float width = texelFetch(u_vectorWidthTexture, primitiveUv, 0).r; +float halfWidth = abs(width) * 0.5; +vec2 offsetToLine = vectorOffsetToLine(vectorUv, segment); +#if defined(VECTOR_WIDTH_MIXED_UNITS) +float edgeDistance = width < 0.0 +? (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter +: length(screenFromUv * offsetToLine) - halfWidth; +#elif defined(VECTOR_WIDTH_IN_METERS) +float edgeDistance = (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter; +#else +float edgeDistance = length(screenFromUv * offsetToLine) - halfWidth; +#endif +if (edgeDistance < nearestEdgeDistance) +{ +nearestEdgeDistance = edgeDistance; +nearestPrimitiveIndex = primitiveIndex; +} +if (nearestEdgeDistance <= -vectorCoverageRadius) +{ +break; +} +} +if (nearestEdgeDistance > vectorCoverageRadius) +{ +return baseColor; +} +#ifdef VECTOR_ANTIALIAS +float coverage = 1.0 - smoothstep(-vectorCoverageRadius, vectorCoverageRadius, nearestEdgeDistance); +#else +float coverage = 1.0; +#endif +vectorPickPrimitiveIndex = nearestPrimitiveIndex; +ivec2 primitiveUv = vectorIndexToUv(nearestPrimitiveIndex, primitiveTextureSize); +vec4 vectorColor = texelFetch(u_vectorColorTexture, primitiveUv, 0); +vectorColor.a *= coverage; +return vectorColor * vec4(vectorColor.aaa, 1.0) + baseColor * (1.0 - vectorColor.a); +#else +return baseColor; +#endif +} +vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize) +{ +if (!inside || primitiveIndex < 0) +{ +return baseColor; +} +vectorPickPrimitiveIndex = primitiveIndex; +ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize); +vec4 fillColor = texelFetch(u_vectorColorTexture, primitiveUv, 0); +return fillColor * vec4(fillColor.aaa, 1.0) + baseColor * (1.0 - fillColor.a); +} +bool vectorEdgeCrossesRay(vec4 edge, vec2 p) +{ +if ((edge.y > p.y) == (edge.w > p.y)) +{ +return false; } -float threshold = 0.01; -if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { -v_regionIndex = regionIndex; +float t = (p.y - edge.y) / (edge.w - edge.y); +float xIntersect = edge.x + t * (edge.z - edge.x); +return p.x < xIntersect; } +vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor) +{ +#ifdef HAS_VECTOR_POLYGONS +ivec2 range = vectorCellRange(vectorUv, u_vectorPolygonGridCellIndicesTexture); +ivec2 edgeTextureSize = textureSize(u_vectorPolygonEdgeTexture, 0); +ivec2 primitiveTextureSize = textureSize(u_vectorColorTexture, 0); +int currentPrimitive = -1; +bool inside = false; +for (int i = range.x; i < range.y; i++) +{ +ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); +vec4 edge = texelFetch(u_vectorPolygonEdgeTexture, edgeUv, 0); +int primitiveIndex = int(texelFetch(u_vectorPolygonEdgePrimitiveIndicesTexture, edgeUv, 0).r); +if (primitiveIndex != currentPrimitive) +{ +baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); +currentPrimitive = primitiveIndex; +inside = false; +} +if (vectorEdgeCrossesRay(edge, vectorUv)) +{ +inside = !inside; +} +} +baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); +return baseColor; +#else +return baseColor; +#endif +} +vec4 vectorPickColorOver(vec4 surfacePickColor) +{ +if (vectorPickPrimitiveIndex < 0) +{ +return surfacePickColor; +} +ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0); +return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0); +} +bool vectorClip(vec2 uv) +{ +uv = clamp(uv, vec2(0.0), vec2(1.0)); +ivec2 range = vectorCellRange(uv, u_clippingGridCellIndicesTexture); +ivec2 edgeTextureSize = textureSize(u_clippingEdgeTexture, 0); +int currentPrimitive = -1; +bool inside = false; +for (int i = range.x; i < range.y; i++) +{ +ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); +int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r); +if (primitiveIndex != currentPrimitive) +{ +if (inside) +{ +return true; +} +currentPrimitive = primitiveIndex; +inside = false; +} +vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0); +if (vectorEdgeCrossesRay(edge, uv)) +{ +inside = !inside; +} +} +return inside; } +`;var gge={name:"ModelClippingPolygonsPipelineStage"},I$e=new k,P$e=new k,bge=re.MAX_VALUE;gge.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,fe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,fe.FRAGMENT),o.addVarying("vec2","v_clippingUv"),o.addUniform("vec2","u_clippingCameraUv",fe.VERTEX),o.addUniform("vec2","u_clippingRectangleInverseSize",fe.VERTEX),o.addVertexLines(fI),o.addFragmentLines(Db),o.addFragmentLines(hI);let r={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??bge,a=s.width*.5,c=s.west+a,d=n.camera.positionCartographic,u=W.negativePiToPi(d.longitude-c)+a;return k.fromElements(u/s.width,(d.latitude-s.south)/s.height,I$e)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??bge;return k.fromElements(1/s.width,1/s.height,P$e)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=It(r,e.uniformMap)};var pI=gge;var Vzn=x(T(),1);var pzn=x(T(),1),bI=`void modelVectorLookupStage(ProcessedAttributes attributes) +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; } -`;var nIn=_(T(),1),xW=`void modelClippingPolygonsStage() +`;var gzn=x(T(),1),gI=`void modelVectorLookupStage(inout vec4 color) { -vec2 clippingPosition = v_clippingPosition; -int regionIndex = v_regionIndex; -czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +color = vectorPolygonRender(v_vectorUv, color); +color = vectorPolylineRender(v_vectorUv, color); } -`;var yae={name:"ModelClippingPolygonsPipelineStage"};yae.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,xe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,xe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,xe.BOTH),o.addUniform("sampler2D","model_clippingDistance",xe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",xe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(gW),o.addFragmentLines(xW);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=St(r,e.uniformMap)};var _W=yae;var mIn=_(T(),1);function gae(e,t){C.typeOf.object("model",e),C.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties(gae.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){c(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 TW=gae;var aWn=_(T(),1);var kIn=_(T(),1);var hIn=_(T(),1),SW=`mat4 getInstancingTransform() +`;var X$e={name:"ModelVectorLookupPipelineStage",process:w$e},N$e=new k,Y$e=new k;function w$e(e,t,n){let i=e.shaderBuilder,o=t._vectorData,r=o.hasPolylines,s=o.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,fe.BOTH),r&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,fe.FRAGMENT),o.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,fe.FRAGMENT),o.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,fe.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",fe.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,fe.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",fe.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",fe.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(bI),i.addFragmentLines(Db),i.addFragmentLines(gI);let a=o.rectangle,c=function(){return n.context.defaultTexture},d={u_vectorCameraUv:function(){let u=t._vectorData?.rectangle??a,m=n.camera.positionCartographic,p=u.width*.5,b=u.west+p,f=W.negativePiToPi(m.longitude-b)+p;return k.fromElements(f/u.width,(m.latitude-u.south)/u.height,N$e)},u_vectorRectangleInverseSize:function(){let u=t._vectorData?.rectangle??a;return k.fromElements(1/u.width,1/u.height,Y$e)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};r&&(d.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},d.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},d.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},d.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},o.hasMeterWidths&&(d.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(d.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},d.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},d.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=It(d,e.uniformMap)}var yI=X$e;var Gzn=x(T(),1);function yge(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(yge.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 xI=yge;var RHn=x(T(),1);var oHn=x(T(),1);var Wzn=x(T(),1),TI=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES @@ -4206,7 +5428,7 @@ translation2D.x, translation2D.y, translation2D.z, 1.0 return instancingTransform2D; } #endif -`;var bIn=_(T(),1),CW=`void instancingStage(inout ProcessedAttributes attributes) +`;var Fzn=x(T(),1),_I=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); @@ -4220,7 +5442,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var gIn=_(T(),1),VW=`void legacyInstancingStage( +`;var Pzn=x(T(),1),SI=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) @@ -4236,7 +5458,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var ak=new M,nBe=new M,iBe=new M,_ae={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Lae,_transformsToTypedArray:Lz};_ae.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(SW);let s=e.model,a=s.sceneGraph,l=e.runtimeNode,d=n.mode!==se.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,f=[];gBe(e,n,i,f,d,u),TBe(e,n,i,f);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,xe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",xe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",xe.VERTEX),p.u_instance_modifiedModelView=function(){let y=M.multiplyTransformation(s.modelMatrix,a.components.transform,ak);return d?M.multiplyTransformation(n.context.uniformState.view3D,y,ak):(n.mode!==se.SCENE3D&&(y=wt.basisTo2D(n.mapProjection,y,ak)),M.multiplyTransformation(n.context.uniformState.view,y,ak))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,l.computedTransform,nBe)},r.addVertexLines(VW)):r.addVertexLines(CW),d){r.addDefine("USE_2D_INSTANCING",void 0,xe.VERTEX),r.addUniform("mat4","u_modelView2D",xe.VERTEX);let y=n.context,h=M.fromTranslation(l.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(y.uniformState.view,h,iBe)}}e.uniformMap=St(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,f)};var LW=new M,oBe=new m;function rBe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,LW);return r=M.multiplyTransformation(r,n,LW),o=wt.basisTo2D(i.mapProjection,r,o),o}function sBe(e,t,n,i,o){let r=M.fromTranslation(e,LW),s=M.multiplyTransformation(t,r,LW);s=M.multiplyTransformation(s,n,LW);let a=M.getTranslation(s,oBe);return o=Oi.computeActualEllipsoidPosition(i,a,o),o}function Tae(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var Sae=new M,Cae=new M,aBe=new M,cBe=new m;function lBe(e,t,n,i){let o=Sae,r=Cae;Tae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let d=0;d=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:rn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var ZW=_ae;var YIn=_(T(),1);var Rz={};Rz.name="ModelMatrixUpdateStage";Rz.update=function(e,t,n){let i=n.mode!==se.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Zae(e,t,o,e.transformToRoot),e._transformDirty=!1}};function SBe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=qt.getCullFace(e.modelMatrix,e.primitiveType)}function Zae(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o=this.children.length)throw new L("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]};a1.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,c(e.instances)&&t.push(ZW),t.push(GW),n.push(RW)};a1.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};a1.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!c(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=St(o,e.uniformMap)};var IW=Iae;var CWn=_(T(),1);var Wae={name:"ClassificationPipelineStage"};Wae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,xe.BOTH);let o=e.runtimePrimitive;c(o.batchLengths)||VBe(t,o)};function VBe(e,t){let n=qt.getAttributeBySemantic(e,pt.POSITION);if(!c(n))throw new le("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=c(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=qt.getAttributeBySemantic(e,pt.FEATURE_ID,0);if(!c(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let l=a.typedArray;a.typedArray=void 0;let d=[],u=[0],f=r?i[0]:0,p=l[f],y=0;for(let g=1;g=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Dt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var RI=Tge;var dHn=x(T(),1);var Vge=[],l7={};l7.name="ModelMatrixUpdateStage";l7.update=function(e,t,n){let i=n.mode!==se.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Ege(e,t,o,e.transformToRoot,0),e._transformDirty=!1}};function set(e,t,n){e.modelMatrix=P.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Zt.getCullFace(e.modelMatrix,e.primitiveType)}function Ege(e,t,n,i,o){let r,s=Vge[o];l(s)||(s=Vge[o]=new P),i=P.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(r=0;r1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=It(o,e.uniformMap)};var GI=vge;var MHn=x(T(),1);var Fge={name:"ClassificationPipelineStage"};Fge.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,fe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||cet(t,o)};function cet(e,t){let n=Zt.getAttributeBySemantic(e,dt.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=Zt.getAttributeBySemantic(e,dt.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],m=r?i[0]:0,p=c[m],b=0;for(let y=1;yPBe(i,t,n)):[]}function PBe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=qt,s=e.class.id,a=n?.classes[s],l=Object.entries(e.properties),d=new Array(l.length);for(let u=0;uFBe(n,t)):[]}function FBe(e,t){let{sanitizeGlslIdentifier:n}=qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,l])=>l.isGpuCompatible()),s=new Array(r.length);for(let a=0;au),n.addStructField(Gi.STRUCT_ID_METADATA_FS,r,o);let y=`attributes.texCoord_${a}`,h=y;if(c(f)&&!te.equals(f,te.IDENTITY)){let Z=`${p}Transform`;n.addUniform("mat3",Z,xe.FRAGMENT),i[Z]=function(){return f},h=`vec2(${Z} * vec3(${y}, 1.0))`}let g=`texture(${p}, ${h}).${l}`,x=s.unpackInShader(g),S=kae({valueExpression:x,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:xe.FRAGMENT,property:s}),V=`metadata.${o} = ${S};`;n.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function Aae(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Nae(Gi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Gi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),xe.includesVertexShader(r)&&(e.addStructField(Gi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Mae(e,t){let{propertyStatistics:n}=t;if(!c(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===lt.ENUM)return;let s=Gi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,l=Nae(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Gi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,l),xe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Gi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_VS,l))}function Nae(e,t,n,i){function o(r){let s=t[r.specName];if(c(s))return`${n}.${r.shaderName} = ${i}(${s});`}return c(t)?e.map(o).filter(c):[]}function kae(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:l,shaderDestination:d}=e;s.addUniform(l,o,d),s.addUniform(l,r,d);let{offset:u,scale:f}=n;return a[o]=()=>u,a[r]=()=>f,`czm_valueTransform(${o}, ${r}, ${t})`}var Fu=Gi;var _wn=_(T(),1),YBe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Iy=Object.freeze(YBe);var pa={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:ht};pa.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:l}=s;c(a)&&(e.lightingOptions.lightingModel=a),l===Iy.TRANSLUCENT?r.pass=Xe.TRANSLUCENT:l===Iy.OPAQUE&&(r.pass=void 0);let d=$Be(s,t);if(!d.customShaderEnabled)return;if(i3e(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,xe.BOTH),c(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,xe.VERTEX),c(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,xe.FRAGMENT);let p=bb.getDefineName(s.mode);i.addDefine(p,void 0,xe.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let y=u[p];i.addUniform(y.type,p)}let f=s.varyings;for(let p in f)if(f.hasOwnProperty(p)){let y=f[p];i.addVarying(y,p)}e.uniformMap=St(e.uniformMap,s.uniformMap)};function HBe(e){let t={};for(let n=0;nxet(i,t,n)):[]}function xet(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Zt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;u_et(n,t)):[]}function _et(e,t){let{sanitizeGlslIdentifier:n}=Zt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>{let d=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(d)}),s=new Array(r.length);for(let a=0;al(s.class)&&r.has(String(s.id))).flatMap(s=>Cet(s,r,i,o))}function Cet(e,t,n,i){let{sanitizeGlslIdentifier:o}=Zt,r=e.class,s=n?.classes[r.id],a=t.get(String(e.id))??{},c=a.shaderDestination??fe.BOTH,d=e.properties,u=r.properties,m=[],p=0;for(let[b,f]of Object.entries(u)){if(!f.isGpuCompatible(Zet))continue;let y=d[b],_=fe.intersection(Met(b,i),c);if(_===fe.NONE){p++;continue}m.push({metadataVariable:o(b),property:y,classProperty:f,type:f.type,glslType:f.getGlslType(),propertyStatistics:s?.properties[b],shaderDestination:_,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return m}function Vet(e,t){let n=new Map;function i(a,c){let d=a?.propertyTableId;if(!l(d))return;let u=String(d),m={variableName:a.positionalLabel,shaderDestination:c},p=n.get(u);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${d} in primitive. Only one will be used.`),n.set(u,m)}let o=t?.featureIds??[];for(let a=0;am),i.addStructField(vi.STRUCT_ID_METADATA_FS,s,r);let y=`attributes.texCoord_${c}`,_=y;if(l(p)&&!q.equals(p,q.IDENTITY)){let A=`${b}Transform`;i.addUniform("mat3",A,fe.FRAGMENT),o[A]=function(){return p},_=`vec2(${A} * vec3(${y}, 1.0))`}let S=`texture(${b}, ${_}).${d}`,Z=a.classProperty,R;n?R=Z.unpackTextureInShader(S,d,r,f):R=Z.unpackTextureInShaderWebGL1(S);let C=f7({valueExpression:R,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:fe.FRAGMENT,property:a}),E=`metadata.${r} = ${C};`;f.push(E),i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,f)}function m7(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Nge(vi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(vi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),fe.includesVertexShader(r)&&(e.addStructField(vi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function h7(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===St.ENUM)return;let s=vi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Nge(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),fe.includesVertexShader(t.shaderDestination)&&(e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Pet(e,t,n){Xet(e,t,n),m7(e.shaderBuilder,t),h7(e.shaderBuilder,t)}function Xet(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:s,property:a,featureIdVariableName:c,propertyTable:d,propertyInfoIndex:u}=t;if(!n){xt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(d.texture))return;let m=`u_propertyTableTexture_${d.id}`,p=[];o.hasOwnProperty(m)||(i.addUniform("sampler2D",m,fe.BOTH),o[m]=()=>d.texture);let b=t.shaderDestination;fe.includesVertexShader(b)&&i.addStructField(vi.STRUCT_ID_METADATA_VS,s,r),fe.includesFragmentShader(b)&&i.addStructField(vi.STRUCT_ID_METADATA_FS,s,r);let y=`ivec2(${`featureIds.${c}`}, ${u})`,_=`texelFetch(${m}, ${y}, 0)`,S=t.classProperty,Z=S.unpackTextureInShader(_,"rgba",r,p),R=f7({valueExpression:Z,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:b,property:a??S}),C=`metadata.${r} = ${R};`;p.push(C),fe.includesVertexShader(b)&&i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,p),fe.includesFragmentShader(b)&&i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function Nge(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 f7(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:m}=n;return a[o]=()=>u,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}function Net(e,t){let n=new Set,i=new Set;return Yet(e,n,i),wet(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Yet(e,t,n){let i=e.customShader;if(!l(i))return;let o=i.usedVariablesFragment?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&n.add(s);let r=i.usedVariablesVertex?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&t.add(s)}function wet(e,t,n,i){let o=e.style;if(!(l(o)&&t.primitiveType===Ie.POINTS))return;let s=o.color?.getVariables?.()??[];for(let d of s)n.add(d),i.add(d);let a=o.show?.getVariables?.()??[];for(let d of a)n.add(d),i.add(d);let c=o.pointSize?.getVariables?.()??[];for(let d of c)n.add(d)}function Met(e,t){let n=t.usedInFragment.has(e)?fe.FRAGMENT:fe.NONE,i=t.usedInVertex.has(e)?fe.VERTEX:fe.NONE;return fe.union(n,i)}var km=vi;var wKn=x(T(),1),Yge={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Yge);var bx=Yge;var Ma={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:xt};Ma.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===bx.TRANSLUCENT?r.pass=Le.TRANSLUCENT:c===bx.OPAQUE&&(r.pass=void 0);let d=Ket(s,t,e);if(!d.customShaderEnabled)return;if(qet(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,fe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,fe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,fe.FRAGMENT);let p=Ob.getDefineName(s.mode);i.addDefine(p,void 0,fe.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let b=u[p];i.addUniform(b.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let b=m[p];i.addVarying(b,p)}e.uniformMap=It(e.uniformMap,s.uniformMap)};function ket(e){let t={};for(let n=0;na.propertyTableId):[],r=new Set;function s(a,c){for(let d of a){let m=c[d].class.properties;Object.keys(m).forEach(p=>r.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(o,t.propertyTables),r}function Uge(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Ma._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var MI=Ma;var sJn=x(T(),1);var kI={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};kI.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,fe.VERTEX),i.addFunction(kI.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,kI.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,fe.VERTEX);let s=t.attributes;for(let a=0;a 0.0) { +#ifdef HAS_EDGE_FEATURE_ID +float edgeFeatureId = edgeId.g; +float currentFeatureId = float(featureIds.featureId_0); +#endif +float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); +bool isBackground = geomDepthLinear > globeDepth; +bool drawEdge = isBackground; +#ifdef HAS_EDGE_FEATURE_ID +bool hasEdgeFeature = edgeFeatureId > 0.0; +bool hasCurrentFeature = currentFeatureId > 0.0; +bool featuresMatch = edgeFeatureId == currentFeatureId; +drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch; +#else +drawEdge = true; +#endif +if (drawEdge) { +color = edgeColor; +} +} +} +`;var Oge={name:"EdgeDetectionPipelineStage"};Oge.process=function(e){e.shaderBuilder.addFragmentLines([DI])};var OI=Oge;var QJn=x(T(),1);var hJn=x(T(),1),BI=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +layout(location = 1) out vec4 out_id; +layout(location = 2) out vec4 out_edgeDepth; +#endif +void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds) +{ +#ifdef HAS_EDGE_VISIBILITY +if (!u_isEdgePass) { +return; +} +float edgeTypeInt = v_edgeType * 255.0; +if (edgeTypeInt < 0.5) { +discard; +} +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +if (v_shouldDiscard > 0.5) { +discard; +} +} +vec4 finalColor = color; +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +if (v_edgeColor.a >= 0.0) { +finalColor = v_edgeColor; +} +#endif +#ifdef HAS_LINE_PATTERN +const float maskLength = 16.0; +float dashPosition = fract(v_lineCoord / maskLength); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(u_linePattern / pow(2.0, maskIndex)); +if (mod(maskTest, 2.0) < 1.0) { +discard; +} +#endif +color = finalColor; +#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +out_id = vec4(0.0); +out_id.r = edgeTypeInt; +#ifdef HAS_EDGE_FEATURE_ID +out_id.g = float(featureIds.featureId_0); +#else +out_id.g = 0.0; +#endif +out_edgeDepth = czm_packDepth(gl_FragCoord.z); +#endif +#endif +} +`;var pJn=x(T(),1),zI=`#ifdef HAS_EDGE_VISIBILITY +void edgeVisibilityStageVS() { +if (!u_isEdgePass) { +return; +} +v_edgeType = a_edgeType; +v_faceNormalAView = czm_normal * a_faceNormalA; +v_faceNormalBView = czm_normal * a_faceNormalB; +v_edgeOffset = a_edgeOffset; +v_shouldDiscard = 0.0; +float edgeTypeInt = a_edgeType * 255.0; +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +vec3 normalA = normalize(v_faceNormalAView); +vec3 normalB = normalize(v_faceNormalBView); +const float perpTol = 2.5e-4; +vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0); +vec3 toEye1 = normalize(-currentPosEC.xyz); +float dotA1 = dot(normalA, toEye1); +float dotB1 = dot(normalB, toEye1); +vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0); +vec3 toEye2 = normalize(-otherPosEC.xyz); +float dotA2 = dot(normalA, toEye2); +float dotB2 = dot(normalB, toEye2); +if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) { +v_shouldDiscard = 1.0; +} +} +#ifdef HAS_EDGE_FEATURE_ID +v_featureId_0 = a_edgeFeatureId; +#endif +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +v_edgeColor = a_edgeColor; +#endif +#ifdef HAS_LINE_PATTERN +#ifdef HAS_EDGE_CUMULATIVE_DISTANCE +v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld; +#else +vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0); +vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw; +vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0); +vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw; +vec2 windowDir = otherScreen - currentScreen; +const float textureCoordinateBase = 8192.0; +if (abs(windowDir.x) > abs(windowDir.y)) { +v_lineCoord = textureCoordinateBase + currentScreen.x; +} else { +v_lineCoord = textureCoordinateBase + currentScreen.y; +} +#endif +#endif +vec4 posClip = gl_Position; +if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) { +vec4 currentClip = posClip; +vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0); +vec2 currentNDC = currentClip.xy / currentClip.w; +vec2 otherNDC = otherClip.xy / otherClip.w; +vec2 edgeDirNDC = otherNDC - currentNDC; +if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) { +edgeDirNDC = -edgeDirNDC; +} +edgeDirNDC = normalize(edgeDirNDC); +vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x); +float lineWidthPixels = u_lineWidth; +vec2 viewportSize = czm_viewport.zw; +vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w; +vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset; +posClip.xy += offsetClip; +} +gl_Position = posClip; +} +#endif +`;var FJn=x(T(),1);var p7=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,o=t.quantization;if(!l(o)&&!i)return n;let r=t.type,s=t.count,a=n;return i&&(a=dn.dequantize(n,t.componentDatatype,r,s)),l(o)?e.dequantize(a,s,r,o):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,o=Dt.getNumberOfComponents(n),r=i*o,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,d=t.byteOffset,u=t.byteStride,m=J.getSizeInBytes(s),p=o*m,b=!l(u)||u===p;if(l(t.typedArray))return t.typedArray;if(b){let E=J.createTypedArray(s,r);return c.getBufferData(E,d),E}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let _=J.createTypedArray(s,r),S=u??p,Z=new DataView(y.buffer,y.byteOffset,y.byteLength),R=new Array(o),C=e.createComponentsReader(s);for(let E=0;E0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[d*3]=c.x,a[d*3+1]=c.y,a[d*3+2]=c.z;for(let d=0;d=a.length)continue;let b=p*3,f=(p+1)*3,y=d*6;o[y]=a[b],o[y+1]=a[b+1],o[y+2]=a[b+2],o[y+3]=a[f],o[y+4]=a[f+1],o[y+5]=a[f+2]}return o}function rtt(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,o=t.lineStrings,r=e.attributes,s=l(r)&&r.length>0?r[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(o)&&o.length>0;if(!a&&!c)return[];let d=a?i.typedArray:void 0,u=[],m=[],p=new Set,b=0,f=t.materialColor;if(a){let y=0,_=d.length,S=n;for(let Z=0;Z+2<_;Z+=3){let R=d[Z],C=d[Z+1],E=d[Z+2];for(let A=0;A<3;A++){let L,F;A===0?(L=R,F=C):A===1?(L=C,F=E):(L=E,F=R);let I=Math.floor(y/4),N=y%4*2;if(y++,I>=S.length)break;let V=S[I]>>N&3;if(V===_C.HIDDEN)continue;let G=Math.min(L,F),v=Math.max(L,F),X=`${G},${v}`;if(p.has(X))continue;p.add(X),u.push(L,F);let Y=-1;V===_C.SILHOUETTE&&(Y=b,b++),m.push({edgeType:V===_C.REPEATED_HARD?_C.HARD:V,silhouetteEdgeIndex:Y,color:f})}}}if(c)for(let y=0;y0&&(L<0||L>=s||F<0||F>=s))continue;let I=Math.min(L,F),N=Math.max(L,F),g=`${I},${N}`;p.has(g)||(p.add(g),u.push(L,F),m.push({edgeType:_C.HARD,silhouetteEdgeIndex:-1,color:l(R)?R:void 0}))}}return{edgeIndices:u,edgeData:m,silhouetteEdgeCount:b}}function stt(e){if(!l(e))return;let t=Zt.getAttributeBySemantic(e,dt.COLOR);if(!l(t))return;let n=Dt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=xa.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length=w){O(qe);return}let Ke=We*4,ct=qe*4;Y[ct]=D[Ke],Y[ct+1]=D[Ke+1],Y[ct+2]=D[Ke+2],Y[ct+3]=D[Ke+3]}for(let qe=0;qe<_;qe++){let We=e[qe*2],Ke=e[qe*2+1],Et=t[qe].edgeType/255,zt=E[We*3],ut=E[We*3+1],bt=E[We*3+2],ht=E[Ke*3],jt=E[Ke*3+1],st=E[Ke*3+2],pt=qe*4;A[pt*3]=zt,A[pt*3+1]=ut,A[pt*3+2]=bt,N[pt*3]=ht,N[pt*3+1]=jt,N[pt*3+2]=st,g[pt]=-1,L[pt]=Et,A[(pt+1)*3]=zt,A[(pt+1)*3+1]=ut,A[(pt+1)*3+2]=bt,N[(pt+1)*3]=ht,N[(pt+1)*3+1]=jt,N[(pt+1)*3+2]=st,g[pt+1]=1,L[pt+1]=Et,A[(pt+2)*3]=ht,A[(pt+2)*3+1]=jt,A[(pt+2)*3+2]=st,N[(pt+2)*3]=zt,N[(pt+2)*3+1]=ut,N[(pt+2)*3+2]=bt,g[pt+2]=1,L[pt+2]=Et,A[(pt+3)*3]=ht,A[(pt+3)*3+1]=jt,A[(pt+3)*3+2]=st,N[(pt+3)*3]=zt,N[(pt+3)*3+1]=ut,N[(pt+3)*3+2]=bt,g[pt+3]=-1,L[pt+3]=Et;let wi=t[qe].color;if(l(wi))for(let rn=0;rn<4;rn++)M(pt+rn,wi);else if(l(D))for(let rn=0;rn<4;rn++)z(pt+rn,We);else for(let rn=0;rn<4;rn++)O(pt+rn);if(V){let rn=v[We],Hn=v[Ke];G[pt]=rn,G[pt+1]=rn,G[pt+2]=Hn,G[pt+3]=Hn}let jn=qe*6,_i=b[jn],Hi=b[jn+1],Gi=b[jn+2],fi=b[jn+3],Si=b[jn+4],On=b[jn+5];for(let rn=0;rn<4;rn++)F[(pt+rn)*3]=_i,F[(pt+rn)*3+1]=Hi,F[(pt+rn)*3+2]=Gi,I[(pt+rn)*3]=fi,I[(pt+rn)*3+1]=Si,I[(pt+rn)*3+2]=On}let K=ot.createVertexBuffer({context:i,typedArray:A,usage:Pe.STATIC_DRAW}),te=ot.createVertexBuffer({context:i,typedArray:L,usage:Pe.STATIC_DRAW}),H=ot.createVertexBuffer({context:i,typedArray:F,usage:Pe.STATIC_DRAW}),$=ot.createVertexBuffer({context:i,typedArray:I,usage:Pe.STATIC_DRAW}),ee=ot.createVertexBuffer({context:i,typedArray:N,usage:Pe.STATIC_DRAW}),le=ot.createVertexBuffer({context:i,typedArray:g,usage:Pe.STATIC_DRAW}),_e=X?ot.createVertexBuffer({context:i,typedArray:Y,usage:Pe.STATIC_DRAW}):void 0,he=V?ot.createVertexBuffer({context:i,typedArray:G,usage:Pe.STATIC_DRAW}):void 0,ye=_*2*3,Ge=Z>65534,Ae=Ge?new Uint32Array(ye):new Uint16Array(ye);for(let qe=0;qe<_;qe++){let We=qe*4,Ke=qe*6;Ae[Ke]=We,Ae[Ke+1]=We+1,Ae[Ke+2]=We+2,Ae[Ke+3]=We,Ae[Ke+4]=We+2,Ae[Ke+5]=We+3}let Fe=ot.createIndexBuffer({context:i,typedArray:Ae,usage:Pe.STATIC_DRAW,indexDatatype:Ge?Oe.UNSIGNED_INT:Oe.UNSIGNED_SHORT}),tt=[{index:R,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:o,vertexBuffer:te,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1},{index:r,vertexBuffer:H,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:s,vertexBuffer:$,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:d,vertexBuffer:ee,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:u,vertexBuffer:le,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1}];X&&tt.push({index:c,vertexBuffer:_e,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1}),V&&tt.push({index:y,vertexBuffer:he,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1});let Be=n.runtimePrimitive.primitive;if(l(Be.featureIds)&&Be.featureIds.length>0){let qe=Be.featureIds[0];if(l(qe.setIndex)){let We=Be.attributes.find(Ke=>Ke.semantic===dt.FEATURE_ID&&Ke.setIndex===qe.setIndex);if(l(We)){let Ke=l(We.typedArray)?We.typedArray:xa.readAttributeAsTypedArray(We),ct=new Float32Array(Z);for(let zt=0;zt<_;zt++){let ut=e[zt*2],bt=ut0}}var HI=Bge;var Rjn=x(T(),1);var $Jn=x(T(),1),KI=`void geometryStage(out ProcessedAttributes attributes) { attributes.positionMC = v_positionMC; attributes.positionEC = v_positionEC; @@ -4377,7 +5758,7 @@ attributes.bitangentEC = normalize(v_bitangentEC); #endif setDynamicVaryings(attributes); } -`;var Ywn=_(T(),1),HW=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +`;var tjn=x(T(),1),JI=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { vec4 computedPosition; vec3 positionMC = attributes.positionMC; @@ -4405,7 +5786,7 @@ v_bitangentEC = normalize(normal * attributes.bitangentMC); setDynamicVaryings(attributes); return computedPosition; } -`;var ePn=_(T(),1);var zwn=_(T(),1),c1=`vec2 computeSt(float featureId) +`;var djn=x(T(),1);var ijn=x(T(),1),SC=`vec2 computeSt(float featureId) { float stepX = model_textureStep.x; float centerX = model_textureStep.y; @@ -4443,7 +5824,23 @@ feature.color = vec4(1.0); } #endif } -`;var zW={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};zW.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=c3e(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),l3e(i);let l=s.featureIds.nullFeatureId,d=e.uniformMap;c(l)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return l}),s.shaderDestination===xe.BOTH&&i.addVertexLines(c1),i.addFragmentLines(c1)};function Yae(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Hae(e){return e instanceof Cn.FeatureIdTexture?xe.FRAGMENT:xe.BOTH}function c3e(e,t,n){let i,o;return c(t.instances)&&(o=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Hae(o),featureIdDefine:Yae(o)}):(o=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Hae(o),featureIdDefine:Yae(o)})}function l3e(e){e.addStructField(zW.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(zW.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(zW.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Wy=zW;var Bs={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)"};Bs.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",xe.VERTEX),i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",xe.FRAGMENT),i.addStruct(Wy.STRUCT_ID_SELECTED_FEATURE,Wy.STRUCT_NAME_SELECTED_FEATURE,xe.BOTH),i.addFunction(Bs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Bs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,xe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,xe.VERTEX),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,xe.FRAGMENT),o.type===mr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,xe.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=c(e.runtimeNode.node.instances),a=r&&!s,l=t.attributes.length;for(let d=0;d1?(y=e.attributeIndex,e.attributeIndex+=f):p&&!a?y=0:y=e.attributeIndex++,d3e(e,u,y,f,r,s)}x3e(i,t.attributes),t.primitiveType===ve.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(HW),i.addFragmentLines(YW)};function d3e(e,t,n,i,o,r){let s=e.shaderBuilder,a=qt.getAttributeInfo(t),l=o&&!r;i>1?f3e(e,t,n,i):m3e(e,t,n,l),p3e(s,a,l),h3e(s,a),c(t.semantic)&&u3e(s,t),b3e(s,a,o),y3e(s,a,l),g3e(s,a)}function u3e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case pt.NORMAL:e.addDefine("HAS_NORMALS");break;case pt.TANGENT:e.addDefine("HAS_TANGENTS");break;case pt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case pt.TEXCOORD:case pt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function m3e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:l}=c(o)?o:t;r===pt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===pt.POSITION,u=d?0:n,f=rn.getNumberOfComponents(a),p={index:u,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:f,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let y=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:y,count:t.count,componentsPerAttribute:f,componentDatatype:q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function f3e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=c(o)?o:t,d=rn.getNumberOfComponents(s)/i,u=q.getSizeInBytes(a),f=d*u,p=t.byteStride;for(let y=0;y1?(b=e.attributeIndex,e.attributeIndex+=m):p&&!a?b=0:b=e.attributeIndex++;let f=!p&&t.primitiveType===Ie.POINTS&&n.context.webgl2?"flat":void 0;dtt(e,u,b,m,r,s,f)}xtt(i,t.attributes),t.primitiveType===Ie.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(JI),i.addFragmentLines(KI)};function dtt(e,t,n,i,o,r,s){let a=e.shaderBuilder,c=Zt.getAttributeInfo(t),d=o&&!r;i>1?htt(e,t,n,i):mtt(e,t,n,d),ptt(a,c,d),ftt(a,c,s),l(t.semantic)&&utt(a,t),btt(a,c,o),gtt(a,c,d),ytt(a,c)}function utt(e,t){let{semantic:n,setIndex:i}=t;switch(n){case dt.NORMAL:e.addDefine("HAS_NORMALS");break;case dt.TANGENT:e.addDefine("HAS_TANGENTS");break;case dt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case dt.TEXCOORD:case dt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function mtt(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===dt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===dt.POSITION,u=d?0:n,m=Dt.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let b=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:b,count:t.count,componentsPerAttribute:m,componentDatatype:J.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function htt(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=Dt.getNumberOfComponents(s)/i,u=J.getSizeInBytes(a),m=d*u,p=t.byteStride;for(let b=0;b=r&&(y=r-1);let _=f/u|0;return _>=s&&(_=s-1),l(i)?(i.x=y,i.y=_,i):new k(y,_)}},Xr=y7;var Mjn=x(T(),1);var x7,jge="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",ZC={};ZC.defaultAccessToken=jge;ZC.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});ZC.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});ZC.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});ZC.getDefaultTokenCredit=function(e){if(e===jge){if(!l(x7)){let t=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken 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 https://developers.arcgis.com/.';x7=new Lt(t,!0)}return x7}};var vu=ZC;var zjn=x(T(),1);function T7(e){e=e??B.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=ve.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Fh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,m=d.length;a&&u0&&(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)}T7.prototype.isReady=function(){return this._isReady};T7.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=Fh(e),o=e.width;for(let r=0,s=t.length;r1&&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])};_7.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=``:i+=``)}return i+="
${o}${t(r)}
${o}${r}
",i}this.description=t(e)};var uf=_7;var t4n=x(T(),1);function RC(){ge.throwInstantiationError()}Object.defineProperties(RC.prototype,{rectangle:{get:ge.throwInstantiationError},tileWidth:{get:ge.throwInstantiationError},tileHeight:{get:ge.throwInstantiationError},maximumLevel:{get:ge.throwInstantiationError},minimumLevel:{get:ge.throwInstantiationError},tilingScheme:{get:ge.throwInstantiationError},tileDiscardPolicy:{get:ge.throwInstantiationError},errorEvent:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError},proxy:{get:ge.throwInstantiationError},hasAlphaChannel:{get:ge.throwInstantiationError}});RC.prototype.getTileCredits=function(e,t,n){ge.throwInstantiationError()};RC.prototype.requestImage=function(e,t,n,i){ge.throwInstantiationError()};RC.prototype.pickFeatures=function(e,t,n,i,o){ge.throwInstantiationError()};var Ttt=/\.ktx2$/i;RC.loadImage=function(e,t){let n=ve.createIfNeeded(t);return Ttt.test(n.url)?Ed(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Fu=RC;var i4n=x(T(),1),Qge={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Qge);var mf=Qge;function qge(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new to({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Lt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}qge.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 qI({missingImageUrl:$ge(e,0,0,this.maximumLevel).url,pixelsToCheck:[new k(0,0),new k(200,20),new k(20,200),new k(80,110),new k(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function _tt(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 Xr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new to({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 xi,o=e.fullExtent,r=i.unproject(new h(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 h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new re(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=re.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 Lt(e.copyrightText)]:t.credit=new Lt(e.copyrightText))}function Stt(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 Ztt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();_tt(i,t)}catch(i){Stt(e,i)}}function Dp(e){e=e??B.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new to({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new Se}Dp.fromBasemapType=async function(e,t){t=t??B.EMPTY_OBJECT;let n,i,o;switch(e){case mf.SATELLITE:{n=t.token??vu.defaultAccessToken,i=ve.createIfNeeded(vu.defaultWorldImageryServer),i.appendForwardSlash();let r=vu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case mf.OCEANS:{n=t.token??vu.defaultAccessToken,i=ve.createIfNeeded(vu.defaultWorldOceanServer),i.appendForwardSlash();let r=vu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case mf.HILLSHADE:{n=t.token??vu.defaultAccessToken,i=ve.createIfNeeded(vu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=vu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;default:}return Dp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function $ge(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 ki?(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(Dp.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}}});Dp.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Dp(t);i._resource=n;let o=new qge(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Ztt(n,o),o.build(i),i};Dp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Dp.prototype.requestImage=function(e,t,n,i){return Fu.loadImage(this,$ge(this,e,t,n,i))};Dp.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 ki)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new pe(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 b=[],f=p.results;if(!l(f))return b;for(let y=0;y0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Op(i)}`),c};QO.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var tr=QO;var I4n=x(T(),1),eye={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"};Object.freeze(eye);var CC=eye;var N4n=x(T(),1);function $I(e){}$I.prototype.isReady=function(){return!0};$I.prototype.shouldDiscardImage=function(e){return $I.EMPTY_IMAGE===e};var qO;Object.defineProperties($I,{EMPTY_IMAGE:{get:function(){return l(qO)||(qO=new Image,qO.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),qO}}});var VC=$I;function tye(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}tye.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;no.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function Vtt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function Ett(e,t,n){let i=e.url,o=Ta._metadataCache[i];l(o)||(o=e.fetchJson(),Ta._metadataCache[i]=o);try{let r=await o;return Ctt(r,t)}catch(r){Vtt(e,r,n)}}function Ta(e){e=e??B.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=e.mapStyle??CC.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new VC),this._proxy=e.proxy,this._credit=new Lt(``),this._tilingScheme=new Xr({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 Se}Object.defineProperties(Ta.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)}}});Ta.fromUrl=async function(e,t){t=t??B.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=t.mapStyle??CC.AERIAL,o=ve.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 Ta(t);a._resource=o;let c=new tye(t);return await Ett(s,c),c.build(a),a};var Att=new re;Ta.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Att);return Wtt(this._attributionList,n,i)};Ta.prototype.requestImage=function(e,t,n,i){let o=Fu.loadImage(this,Gtt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?VC.EMPTY_IMAGE:Promise.reject(r)})};Ta.prototype.pickFeatures=function(e,t,n,i,o){};Ta.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<=m.zoomMin&&t<=m.zoomMax){let p=re.intersection(n,m.bbox,Ltt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ta._metadataCache={};var eP=Ta;var LQn=x(T(),1);var pQn=x(T(),1);var nye=/{[^}]+}/g,iye={x:Ptt,y:Ntt,z:Mtt,s:ktt,reverseX:Xtt,reverseY:Ytt,reverseZ:wtt,westDegrees:Utt,southDegrees:Dtt,eastDegrees:Ott,northDegrees:Btt,westProjected:ztt,southProjected:Htt,eastProjected:Ktt,northProjected:Jtt,width:jtt,height:Qtt},vtt=It(iye,{i:qtt,j:$tt,reverseI:ent,reverseJ:tnt,longitudeDegrees:int,latitudeDegrees:ont,longitudeProjected:rnt,latitudeProjected:snt,format:cnt});function tP(e){e=e??B.EMPTY_OBJECT,this._errorEvent=new Se;let t=ve.createIfNeeded(e.url),n=ve.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Xr({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=re.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Lt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=It(iye,r),a=It(vtt,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=e.enablePickFeatures??!0}Object.defineProperties(tP.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}}});tP.prototype.getTileCredits=function(e,t,n){};tP.prototype.requestImage=function(e,t,n,i){return Fu.loadImage(this,Ftt(this,e,t,n,i))};tP.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=Itt(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 $O=!1,Iu=new re,eB=!1,nP=new re;function Ftt(e,t,n,i,o){$O=!1,eB=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(nye);return l(d)&&d.forEach(function(u){let m=u.substring(1,u.length-1);l(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var S7=!1,AC=new k,Z7=!1;function Itt(e,t,n,i,o,r,s){$O=!1,eB=!1,S7=!1,Z7=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(nye);return l(m)&&m.forEach(function(p){let b=p.substring(1,p.length-1);l(d[b])&&(u[b]=d[b](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function GC(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 Ptt(e,t,n,i){return GC(e,"{x}",t)}function Xtt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return GC(e,"{reverseX}",o)}function Ntt(e,t,n,i){return GC(e,"{y}",n)}function Ytt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return GC(e,"{reverseY}",o)}function wtt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&it.rectangle.east&&(e.east=t.rectangle.east),e.southt.rectangle.north&&(e.north=t.rectangle.north),e}function rye(e,t,n){let i=e.positionToTileXY(re.southwest(t),n),o=e.positionToTileXY(re.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Um._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,m,p=[],b=e.childNodes[0].childNodes;for(let F=0;F`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new Se}Object.defineProperties(kd.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}}});kd.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=ve.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 sye(n);s.channel=t,await unt(r,s);let a=new kd(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};kd.prototype.getTileCredits=function(e,t,n){};kd.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 Fu.loadImage(this,o)};kd.prototype.pickFeatures=function(e,t,n,i,o){};kd._logoUrl=void 0;Object.defineProperties(kd,{logoUrl:{get:function(){return l(kd._logoUrl)||(kd._logoUrl=en("Assets/Images/google_earth_credit.png")),kd._logoUrl},set:function(e){kd._logoUrl=e}}});var iP=kd;var jQn=x(T(),1);var mnt=/\/$/,aye=new Lt('© Mapbox © OpenStreetMap Improve this map');function LC(e){e=e??B.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=ve.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();mnt.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 Lt(s))):s=aye,this._resource=i,this._imageryProvider=new Ss({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(LC.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}}});LC.prototype.getTileCredits=function(e,t,n){};LC.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};LC.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};LC._defaultCredit=aye;var oP=LC;var c8n=x(T(),1);function lS(e){e=e??B.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=e.rectangle??re.MAX_VALUE,n=new to({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 Se;let i=e.credit;typeof i=="string"&&(i=new Lt(i)),this._credit=i;let o=ve.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(lS.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 hnt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=tr.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return C7(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function C7(e,t,n){try{return await Fu.loadImage(null,e)}catch(i){return hnt(e,i,t,n)}}lS.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await C7(n);t=t??B.EMPTY_OBJECT;let o=new lS({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};lS.prototype.getTileCredits=function(e,t,n){};lS.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await C7(this._resource,this);return this._image=o,tr.reportSuccess(this._errorEvent),o}return this._image};lS.prototype.pickFeatures=function(e,t,n,i,o){};var rP=lS;var v8n=x(T(),1);var f8n=x(T(),1);function fnt(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=pnt:e==="xml"?n=xnt:(e==="html"||e==="text")&&(n=cye)),this.callback=n}function pnt(e){let t=[],n=e.features;for(let i=0;i0)for(let r=0;r\s*<\/body>/im,Vnt=//im,Ent=/([\s\S]*)<\/title>/im;function cye(e){if(Cnt.test(e)||Vnt.test(e))return;let t,n=Ent.exec(e);n&&n.length>1&&(t=n[1]);let i=new uf;return i.name=t,i.description=e,i.data=e,[i]}var hf=fnt;var _8n=x(T(),1);function sP(e){e=e??B.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(sP.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)}}});sP.prototype.getFromCache=function(e,t,n,i){let o=lye(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};sP.prototype.checkApproachingInterval=function(e,t,n,i){let o=lye(e,t,n),r=this._tilesRequestedForInterval,s=dye(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!uye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};sP.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=dye(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=uye(this,c,r),a||s.push(c)}}};function lye(e,t,n){return`${e}-${t}-${n}`}function Ant(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function dye(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 uye(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=Ant(s),c=new Ar({throttle:!1,throttleByServer:!0,type:js.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 dS=sP;var Gnt=[3034,3035,3042,3043,3044],Lnt=[4471,4559];function ff(e){if(e=e??B.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new ge("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=e.getFeatureInfoUrl??e.url;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(ff.DefaultParameters,!0),n.setQueryParameters(ff.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(mye(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(mye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new dS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return hye(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=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof xi?"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&&!Lnt.includes(a)||Gnt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof xi?"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 Ss({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new to({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:e.getFeatureInfoFormats??ff.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function hye(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 Wnt(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(ff.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}}});ff.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};ff.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=hye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};ff.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Wnt(this,e,t,n,i,o,s)};ff.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});ff.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});ff.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new hf("json","application/json")),Object.freeze(new hf("xml","text/xml")),Object.freeze(new hf("text","text/html"))]);function mye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var aP=ff;var D8n=x(T(),1);function Pu(e){e=e??B.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._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl),i=e.style,o=e.tileMatrixSetID,r=t.url,s=e.format??"image/jpeg",a=r.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(r)?(t.setQueryParameters(Pu.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Pu.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Pu.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(fye(e.getFeatureInfoParameters));let u={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(u,!0)}else n.setTemplateValues(Pu.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(fye(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=o;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=o,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let d=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new dS({clock:e.clock,times:e.times,requestImageFunction:function(u,m,p,b,f){return pye(d,u,m,p,b,f)},reloadFunction:function(){l(d._reload)&&d._reload()}})),this._errorEvent=new Se,this._tileProvider=new Ss({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Xr({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:e.getFeatureInfoFormats??Pu.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Fnt(this)})}function pye(e,t,n,i,o,r){let s=e._tileProvider;return bye(e,s._resource,r),s.requestImage(t,n,i,o)}function vnt(e,t,n,i,o,r,s){let a=e._tileProvider;return bye(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,o,r)}Object.defineProperties(Pu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Pu.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Pu.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=pye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Pu.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return vnt(this,e,t,n,i,o,s)};Pu.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Pu.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Pu.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new hf("json","application/json")),Object.freeze(new hf("xml","text/xml")),Object.freeze(new hf("text","text/html"))]);function bye(e,t,n){let i=e._dimensions,o=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(o)&&t.setTemplateValues(o);else{let r={};l(i)&&(r=It(r,i)),l(o)&&(r=It(r,o)),t.setQueryParameters(r)}}function Fnt(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,o,r){return t(r)},tilematrix:function(n,i,o,r){return t(r)},TileRow:function(n,i,o){return o.toString()},tilerow:function(n,i,o){return o.toString()},TileCol:function(n,i,o){return i.toString()},tilecol:function(n,i,o){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function fye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var cP=Pu;var i6n=x(T(),1);var H8n=x(T(),1);var WC={};WC.defaultApiKey=void 0;WC.mapTilesApiEndpoint=new ve({url:"https://tile.googleapis.com/"});WC.defaultStreetViewStaticApiKey=void 0;WC.streetViewStaticApiEndpoint=new ve({url:"https://maps.googleapis.com/maps/api/streetview"});WC.getDefaultCredit=function(){return new Lt('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var _a=WC;var gye=/\/$/;function zb(e){e=e??B.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Ur?e.url:ve.createIfNeeded(e.url??_a.mapTilesApiEndpoint),n=t.getUrlComponent();gye.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new Lt(o)));let r=new Ss({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(zb.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}}});zb.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=yye(e),i=Ur._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),s=r.options.url;return delete r.options.url,r.options={...r.options,...o},A7(s,r,i)};zb.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??_a.mapTilesApiEndpoint,e.key=e.key??_a.defaultApiKey;let t=e.overlayLayerType,n=await Pnt(e);return new zb({...n,...e,credit:e.credit??_a.getDefaultCredit()})};zb.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};zb.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};zb.prototype.pickFeatures=function(e,t,n,i,o){};zb.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(Int(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o];if(s){let a=new Lt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function Int(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(B.EMPTY_OBJECT)}).fetchJson()).copyright}function yye(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function Pnt(e){let{language:t,region:n,key:i,url:o}=e,r=yye(e),s=o.url??o;gye.test(s)||(s+="/");let a=await ve.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(a)}var lP=zb;var u6n=x(T(),1);var Xnt=/\/$/;function vC(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Ur?e.url:ve.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Xnt.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new Lt(r)));let s=new Ss({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(vC.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}}});vC.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};vC.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};vC.prototype.pickFeatures=function(e,t,n,i,o){};vC.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(Nnt(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o].join(",");if(s){let a=new Lt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function Nnt(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(B.EMPTY_OBJECT)}).fetchJson()).copyrights}var dP=vC;var Ynt=async(e,t,n)=>yx.fromUrl(new Ur(t,n)),wnt=async(e,{options:t})=>Bb.fromUrl(e,t),Mnt=async(e,{options:t})=>eP.fromUrl(e,t),knt=async(e,{options:t})=>{let n=t.channel;return delete t.channel,iP.fromUrl(e,n,t)},Unt=async(e,{options:t})=>new oP({url:e,...t}),Dnt=async(e,{options:t})=>rP.fromUrl(e,t),Ont=async(e,{options:t})=>yx.fromUrl(e,t),Bnt=async(e,{options:t})=>new Ss({url:e,...t}),znt=async(e,{options:t})=>new aP({url:e,...t}),Hnt=async(e,{options:t})=>new cP({url:e,...t}),A7=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ur(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=o,new lP({...t.options,url:i})},Knt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ur(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=o,new dP({...t.options,url:i})},Jnt={ARCGIS_MAPSERVER:wnt,BING:Mnt,GOOGLE_EARTH:knt,MAPBOX:Unt,SINGLE_TILE:Dnt,TMS:Ont,URL_TEMPLATE:Bnt,WMS:znt,WMTS:Hnt,GOOGLE_2D_MAPS:A7,AZURE_MAPS:Knt,defaultFactoryCallback:Ynt},FC=Object.freeze(Jnt);function Bp(){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 Se}Object.defineProperties(Bp.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(){}}});Bp.fromAssetId=async function(e,t){t=t??B.EMPTY_OBJECT;let n=Ur._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Bp._endpointCache[i];l(o)||(o=n.fetchJson(),Bp._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=r.externalType,a=FC.defaultFactoryCallback;r=$e(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=FC[s],!l(a)))throw new ae(`Unrecognized Cesium ion imagery type: ${s}`);let d=await a(c,r,n),u=new Bp(t);return d.errorEvent.addEventListener(function(m){m.provider=u,u._errorEvent.raiseEvent(m)}),u._tileCredits=Ur.getCreditsFromEndpoint(r,n),u._imageryProvider=d,u};Bp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Bp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Bp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Bp._endpointCache={};var $l=Bp;var X6n=x(T(),1),xye={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(xye);var Hb=xye;function jnt(e){e=e??B.EMPTY_OBJECT;let t=e.style??Hb.AERIAL;return $l.fromAssetId(t)}var Kb=jnt;var H6n=x(T(),1);function Ds(){ge.throwInstantiationError()}Object.defineProperties(Ds.prototype,{errorEvent:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError},tilingScheme:{get:ge.throwInstantiationError},hasWaterMask:{get:ge.throwInstantiationError},hasVertexNormals:{get:ge.throwInstantiationError},availability:{get:ge.throwInstantiationError}});var Tye=[];Ds.getRegularGridIndices=function(e,t){let n=Tye[e];l(n)||(Tye[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),Rye(e,t,i,0)),i};var _ye=[];Ds.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=_ye[e];l(n)||(_ye[e]=n=[]);let i=n[t];if(!l(i)){let o=Ds.getRegularGridIndices(e,t),r=Zye(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 Sye=[];Ds.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Sye[e];l(n)||(Sye[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=Zye(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,b=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,y=Oe.createTypedArray(c,d);Rye(e,t,y,0),Ds.addSkirtIndices(m,p,b,f,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Ds.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ds.getSkirtIndexCount=function(e){return(e-4)*2*3};Ds.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ds.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=rB(e,a,r,s),a+=e.length,s=rB(t,a,r,s),a+=t.length,s=rB(n,a,r,s),a+=n.length,rB(i,a,r,s)};Ds.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,s){Ds.addSkirtIndices(e,t,n,i,o,r,s);let a=Ds.getSkirtVertexCount(e,t,n,i),c=Ds.getSkirtIndexCount(a),d=s+c,u=e[0],m=i[0],p=n[0],b=t[0],f=o,y=f+e.length-1,_=y+1,S=_+t.length-1,Z=S+1,R=Z+n.length-1,C=R+1,E=C+i.length-1;r[d+0]=u,r[d+1]=f,r[d+2]=S,r[d+3]=b,r[d+4]=_,r[d+5]=R,r[d+6]=p,r[d+7]=Z,r[d+8]=E,r[d+9]=m,r[d+10]=C,r[d+11]=y};function Zye(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 Rye(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 rB(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}Ds.heightmapTerrainQuality=.25;Ds.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ds.heightmapTerrainQuality/(t*n)};Ds.prototype.requestTileGeometry=ge.throwInstantiationError;Ds.prototype.getLevelMaximumGeometricError=ge.throwInstantiationError;Ds.prototype.getTileDataAvailable=ge.throwInstantiationError;Ds.prototype.loadTileDataAvailability=ge.throwInstantiationError;var Qo=Ds;var J6n=x(T(),1),uP=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var Q6n=x(T(),1),mP=`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 o7n=x(T(),1);var $6n=x(T(),1),Cye={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(Cye);var Dn=Cye;function IC(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=Dn.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}IC.createPlaceholder=function(e){let t=new IC(e,0,0,0);return t.addReference(),t.state=Dn.PLACEHOLDER,t};IC.prototype.addReference=function(){++this.referenceCount};IC.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};IC.prototype.processStateMachine=function(e,t,n){this.state===Dn.UNLOADED&&!n&&(this.state=Dn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Dn.RECEIVED&&(this.state=Dn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Dn.READY&&t&&!this.texture;(this.state===Dn.TEXTURE_LOADED||i)&&(this.state=Dn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var PC=IC;var c7n=x(T(),1);function G7(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}G7.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};G7.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Dn.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!==Dn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Dn.FAILED&&r.state!==Dn.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===Dn.FAILED||i.state===Dn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var XC=G7;function zi(e,t){this._imageryProvider=e,this._readyEvent=new Se,this._errorEvent=new Se,t=t??B.EMPTY_OBJECT,e=e??B.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??zi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??zi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??zi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??zi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??zi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??zi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??zi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??zi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??re.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new XC(PC.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=t.colorToAlphaThreshold??zi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(zi.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}}});zi.DEFAULT_BRIGHTNESS=1;zi.DEFAULT_CONTRAST=1;zi.DEFAULT_HUE=0;zi.DEFAULT_SATURATION=1;zi.DEFAULT_GAMMA=1;zi.DEFAULT_SPLIT=Mr.NONE;zi.DEFAULT_MINIFICATION_FILTER=Ht.LINEAR;zi.DEFAULT_MAGNIFICATION_FILTER=ei.LINEAR;zi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;zi.fromProviderAsync=function(e,t){let n=new zi(void 0,t);return tit(n,Promise.resolve(e)),n};zi.fromWorldImagery=function(e){return e=e??B.EMPTY_OBJECT,zi.fromProviderAsync(Kb({style:e.style}),e)};zi.prototype.isBaseLayer=function(){return this._isBaseLayer};zi.prototype.isDestroyed=function(){return!1};zi.prototype.destroy=function(){return me(this)};var Aye=new re,Vye=new re,L7=new re,Gye=new re;zi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return re.intersection(e.rectangle,t)};zi.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 xi&&e.rectangle.north<xi.MaximumLatitude&&e.rectangle.south>-xi.MaximumLatitude,s=re.intersection(o.rectangle,this._rectangle,Aye),a=re.intersection(e.rectangle,s,Vye);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,v=e.rectangle;a=Vye,v.south>=G.north?a.north=a.south=G.north:v.north<=G.south?a.north=a.south=G.south:(a.south=Math.max(v.south,G.south),a.north=Math.min(v.north,G.north)),v.west>=G.east?a.west=a.east=G.east:v.east<=G.west?a.west=a.east=G.west:(a.west=Math.max(v.west,G.west),a.east=Math.min(v.east,G.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=$nt(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let G=o.minimumLevel;m<G&&(m=G)}let b=o.tilingScheme,f=b.positionToTileXY(re.northwest(a),m),y=b.positionToTileXY(re.southeast(a),m),_=e.rectangle.width/512,S=e.rectangle.height/512,Z=b.tileXYToRectangle(f.x,f.y,m);Math.abs(Z.south-e.rectangle.north)<S&&f.y<y.y&&++f.y,Math.abs(Z.east-e.rectangle.west)<_&&f.x<y.x&&++f.x;let R=b.tileXYToRectangle(y.x,y.y,m);Math.abs(R.north-e.rectangle.south)<S&&y.y>f.y&&--y.y,Math.abs(R.west-e.rectangle.east)<_&&y.x>f.x&&--y.x;let C=re.clone(e.rectangle,Gye),E=b.tileXYToRectangle(f.x,f.y,m),A=re.intersection(E,s,L7),L;r?(b.rectangleToNativeRectangle(C,C),b.rectangleToNativeRectangle(E,E),b.rectangleToNativeRectangle(A,A),b.rectangleToNativeRectangle(s,s),L=b.tileXYToNativeRectangle.bind(b),_=C.width/512,S=C.height/512):L=b.tileXYToRectangle.bind(b);let F,I=0,N=1,g;!this.isBaseLayer()&&Math.abs(A.west-C.west)>=_&&(I=Math.min(1,(A.west-C.west)/C.width)),!this.isBaseLayer()&&Math.abs(A.north-C.north)>=S&&(N=Math.max(0,(A.north-C.south)/C.height));let V=N;for(let G=f.x;G<=y.x;G++)if(F=I,E=L(G,f.y,m),A=re.simpleIntersection(E,s,L7),!!l(A)){I=Math.min(1,(A.east-C.west)/C.width),G===y.x&&(this.isBaseLayer()||Math.abs(A.east-C.east)<_)&&(I=1),N=V;for(let v=f.y;v<=y.y;v++){if(g=N,E=L(G,v,m),A=re.simpleIntersection(E,s,L7),!l(A))continue;N=Math.max(0,(A.south-C.south)/C.height),v===y.y&&(this.isBaseLayer()||Math.abs(A.south-C.south)<S)&&(N=0);let X=new ce(F,N,I,g),Y=this.getImageryFromCache(G,v,m);i.imagery.splice(n,0,new XC(Y,X,r)),++n}}return!0};zi.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,Aye),i=c.rectangleToNativeRectangle(i,Gye)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ce(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};zi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=Dn.RECEIVED,e.request=void 0,tr.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Ri.CANCELLED){e.state=Dn.UNLOADED,e.request=void 0;return}e.state=Dn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=tr.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ar({throttle:!1,throttleByServer:!0,type:js.IMAGERY});e.request=s,e.state=Dn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Dn.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()};zi.prototype._createTextureWebGL=function(e,t){let n=new Bt({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?Qe.RGBA:Qe.RGB,sampler:n})};zi.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=Dn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Dn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof xi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Dn.TEXTURE_LOADED};function Eye(e,t,n){return`${e}:${t}:${n}`}zi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Ht.LINEAR&&i===ei.LINEAR&&!Qe.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=Ht.LINEAR_MIPMAP_LINEAR;let r=kt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Eye(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Vm.NICEST),t.sampler=d}else{let r=Eye(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};zi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ki)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Gu({persists:!0,owner:this,preExecute:function(c){qnt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=Dn.READY,t.releaseReference()},canceled:function(){t.state=Dn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Dn.READY};zi.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};zi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};zi.prototype.getImageryFromCache=function(e,t,n,i){let o=Lye(e,t,n),r=this._imageryCache[o];return l(r)||(r=new PC(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};zi.prototype.removeImageryFromCache=function(e){let t=Lye(e.x,e.y,e.level);delete this._imageryCache[t]};function Lye(e,t,n){return JSON.stringify([e,t,n])}var sB={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},Qnt=fn.supportsTypedArrays()?new Float32Array(128):void 0;function qnt(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(256),S=0;for(let A=0;A<64;++A){let L=A/63;_[S++]=0,_[S++]=L,_[S++]=1,_[S++]=L}let Z={position:0,webMercatorT:1},R=Qo.getRegularGridIndices(2,64),C=ot.createIndexBuffer({context:t,typedArray:R,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});o.vertexArray=new Un({context:t,attributes:[{index:Z.position,vertexBuffer:ot.createVertexBuffer({context:t,typedArray:_,usage:Pe.STATIC_DRAW}),componentsPerAttribute:2},{index:Z.webMercatorT,vertexBuffer:ot.createVertexBuffer({context:t,sizeInBytes:512,usage:Pe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:C});let E=new Je({sources:[mP]});o.shaderProgram=nn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:uP,attributeLocations:Z}),o.sampler=new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:ei.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;sB.textureDimensions.x=r,sB.textureDimensions.y=s,sB.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),m=new vt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&m.generateMipmap(Vm.NICEST);let p=i.south,b=i.north,f=Qnt,y=0;for(let _=0;_<64;++_){let S=_/63,Z=W.lerp(p,b,S);a=Math.sin(Z);let C=(.5*Math.log((1+a)/(1-a))-c)*u;f[y++]=C,f[y++]=C}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=sB,e.vertexArray=o.vertexArray}function $nt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof ki?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 eit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function tit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){eit(e._errorEvent,i)}}var Zs=zi;var j7n=x(T(),1),W7=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},hP=W7;var Wqn=x(T(),1);var iqn=x(T(),1);var q7n=x(T(),1),v7=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},NC=v7;var nit=new re,Wye=new re,iit=new re,oit=new re,rit=new re,sit=new re,F7=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),s=re.intersection(o.rectangle,n.rectangle,nit),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),d=oit;a.rectangleToNativeRectangle(t,d);let u=rit;a.rectangleToNativeRectangle(s,u);let m=(b,f,y)=>{let _=a.tileXYToRectangle(b,f,y),S=re.intersection(_,s,iit);if(!l(S))return;let Z=sit;return a.rectangleToNativeRectangle(S,Z),Z};return e._computeImageryCoverages(n,c,r,d,m)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(re.northwest(r),o),a=i.positionToTileXY(re.southeast(r),o),c=new NC;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let d=t.width/512,u=t.height/512,m=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(m.south-t.north)<u&&c.minY<c.maxY&&++c.minY,Math.abs(m.east-t.west)<d&&c.minX<c.maxX&&++c.minX;let f=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(f.north-t.south)<u&&c.maxY>c.minY&&--c.maxY,Math.abs(f.west-t.east)<d&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new re),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=re.intersection(t,n,Wye);return l(i)?i:e._clampRectangle(t,n,Wye)}static _computeImageryCoverages(t,n,i,o,r){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=r(a,n.maxY,i);if(l(c))for(let d=n.minY;d<=n.maxY;d++){let u=r(a,d,i);if(!l(u))continue;let m=e._localizeToCartesianRectangle(u,o,void 0),p=t.getImageryFromCache(a,d,i),b=new e(a,d,i,m,p);s.push(b)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new NC);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},YC=F7;var bqn=x(T(),1);var I7=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new nt;nt.fromRectangle(i,o,r);let s=e.createProjectedPositions(t,o),a=e.computeTexCoords(s,r);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=xa.readAttributeAsTypedArray(t),r=t.type,s=Dt.getNumberOfComponents(r),a=e.createIterableCartesian3FromTypedArray(o,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,o=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<o;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new re);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),o=Math.min(o,a.latitude),r=Math.max(r,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=o,n.east=r,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,r=>(P.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new pe;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new k,o=1/n.width,r=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*o,d=(a.y-n.y)*r,u=Math.min(Math.max(c,0),1),m=Math.min(Math.max(d,0),1);return i.x=u,i.y=m,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:dt.TEXCOORD,setIndex:0,componentDatatype:J.FLOAT,type:Dt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new k(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},uS=I7;var yqn=x(T(),1);var P7=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},fP=P7;var X7=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new P,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new ge("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new ge("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],s=t[o];this._deleteCoverages(r,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=ot.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!P.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),d=c.length;for(let u=0;u<d;u++){let m=c[u],p=uS.createCartographicPositions(o,s,m),b=uS.computeCartographicBoundingRectangle(p),f=new fP(p,r,b,m);a.push(f)}return P.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getEllipsoid(r);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getProjection(r);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=uS.createTextureCoordinatesAttributeForMappedPositions(a,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let s=0;s<r;s++){let a=o.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return YC.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,s=1,a=n.width,c=r.width;n.height>n.width&&(a=n.height,c=r.height);let d=Math.log2(s*c/a);return YC._clampImageryLevel(i,d)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let s=0;s<o;s++){let a=i[s],c=a.length;for(let d=0;d<c;d++){let m=a[d].imagery;m.state===Dn.READY||m.state===Dn.FAILED||m.state===Dn.INVALID||(r=!1,m.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new ge("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new ge(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new ge("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),me(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new P);let o=t.sceneGraph;return P.clone(P.IDENTITY,i),P.multiply(i,t.modelMatrix,i),P.multiply(i,o.components.transform,i),P.multiply(i,o.axisCorrectionMatrix,i),P.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=Zt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new ge("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},mS=X7;var Fqn=x(T(),1),N7=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},pP=N7;var ait=!1,cit=new re,lit=new re,Y7=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let s=o.imageryLayers,a=mS._extractProjections(s),c=[...new Set(a)],d=e._computeIndexMapping(a,c),u=e._createImageryInputs(s,r,d);if(u.length===0)return;u.length>10&&(xt("imagery-texture-units",`Warning: Draped imagery requires ${u.length} texture units, truncating`),u.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let m=[];for(let p=0;p<s.length;p++)m.push(s.get(p));e._processImageryInputs(m,t,u,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Dt.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(r,o),e._defineUniforms(r,s),e._buildSampleAndBlendFunction(r,s),e._createMainImageryShader(r,i,s);let c=n.uniformMap,d=e._createImageryUniforms(i);e._setImageryUniforms(c,d)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,fe.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new hP;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==Zs.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==Zs.DEFAULT_CONTRAST,n.hue|=o.hue!==Zs.DEFAULT_HUE,n.saturation|=o.saturation!==Zs.DEFAULT_SATURATION,n.gamma|=o.gamma!==Zs.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,fe.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),ait&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",fe.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let a=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],s=r.imageryLayer,a=r.texture,c=r.textureCoordinateRectangle,d=r.textureTranslationAndScale;i.imageryTextures[o]=a,i.imageryTextureTranslationAndScale[o]=d,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=s.alpha,i.imageryTextureBrightness[o]=s.brightness,i.imageryTextureContrast[o]=s.contrast,i.imageryTextureHue[o]=s.hue,i.imageryTextureSaturation[o]=s.saturation,i.imageryTextureOneOverGamma[o]=1/s.gamma;let u=i.imageryTextureColorToAlpha[o];if(l(u)||(u=new ce,i.imageryTextureColorToAlpha[o]=u),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;u.x=p.red,u.y=p.green,u.z=p.blue,u.w=s.colorToAlphaThreshold}else u.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let s=t.get(r);if(!s.show)continue;let a=i[r],d=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,u=n.coveragesForImageryLayer(s);for(let m=0;m<u.length;m++){let p=u[m],b=e._createImageryInput(s,p,d,a);l(b)&&o.push(b)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Dn.FAILED||r.state===Dn.INVALID)return;let s=r.textureWebMercator;if(!l(s)&&(s=r.texture,!l(s))){r.state===Dn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,d=new ce(c.minX,c.minY,c.maxX,c.maxY);return new pP(t,s,a,d,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,cit),s=o.rectangleToNativeRectangle(i,lit);return e._computeTextureTranslationAndScaleFromNative(r,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,s=t.south-n.south,a=r*i,c=s*o,d=t.width*i,u=t.height*o;return new ce(a,c,d,u)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let s=t[r],a=n.indexOf(s);i.push(a)}return i}},bP=Y7;var n$n=x(T(),1);var Kqn=x(T(),1),gP=`#ifdef USE_IBL_LIGHTING vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) @@ -4524,7 +5921,7 @@ color = czm_linearToSrgb(color); #endif material.diffuse = color; } -`;var xPn=_(T(),1),_3e={UNLIT:0,PBR:1},Lh=Object.freeze(_3e);var zae={name:"LightingPipelineStage"};zae.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(c(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,xe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",xe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Lh.PBR?o.addDefine("LIGHTING_PBR",void 0,xe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,xe.FRAGMENT),o.addFragmentLines(JW)};var QW=zae;var UPn=_(T(),1);var RPn=_(T(),1),jW=`bool isDefaultStyleColor(vec3 color) +`;var jqn=x(T(),1),vye={UNLIT:0,PBR:1};Object.freeze(vye);var zp=vye;var Fye={name:"LightingPipelineStage"};Fye.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,fe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",fe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===zp.PBR?o.addDefine("LIGHTING_PBR",void 0,fe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,fe.FRAGMENT),o.addFragmentLines(gP)};var yP=Fye;var E$n=x(T(),1);var o$n=x(T(),1),xP=`bool isDefaultStyleColor(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -4534,16 +5931,12 @@ 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)); +texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); #endif return texCoord; } @@ -4581,7 +5974,16 @@ vec3 bitangent = normalize(cross(geometryNormal, tangent)); #endif #ifdef HAS_NORMAL_TEXTURE mat3 tbn = mat3(tangent, bitangent, geometryNormal); -vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; +vec3 normalSample; +#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb; +#else +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb; +#endif +#else +normalSample = texture(u_normalTexture, normalTexCoords).rgb; +#endif normalSample = 2.0 * normalSample - 1.0; #ifdef HAS_NORMAL_TEXTURE_SCALE normalSample.xy *= u_normalTextureScale; @@ -4619,7 +6021,16 @@ 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; +vec3 normalSample; +#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb; +#else +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb; +#endif +#else +normalSample = texture(u_normalTexture, normalTexCoords).rgb; +#endif normalSample = 2.0 * normalSample - 1.0; #ifdef HAS_NORMAL_TEXTURE_SCALE normalSample.xy *= u_normalTextureScale; @@ -4671,9 +6082,18 @@ vec4 getBaseColorFromTexture() { vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM -baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); +baseColorTexCoords = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); +#endif +vec4 baseColorWithAlpha; +#if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform)); +#else +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); +#endif +#else +baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); #endif -vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); #ifdef HAS_BASE_COLOR_FACTOR baseColorWithAlpha *= u_baseColorFactor; #endif @@ -4685,7 +6105,7 @@ vec3 getEmissiveFromTexture() { vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM -emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); +emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); #endif vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); #ifdef HAS_EMISSIVE_FACTOR @@ -4700,7 +6120,7 @@ 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); +specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); #endif vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); vec3 specular = specularGlossiness.rgb; @@ -4726,7 +6146,7 @@ float glossiness = 1.0; #ifdef HAS_DIFFUSE_TEXTURE vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM -diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); +diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); #endif vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); #ifdef HAS_DIFFUSE_FACTOR @@ -4748,7 +6168,7 @@ 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); +metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); #endif vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; float metalness = clamp(metallicRoughness.b, 0.0, 1.0); @@ -4784,7 +6204,7 @@ 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); +specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); #endif float specularWeight = texture(u_specularTexture, specularTexCoords).a; #ifdef HAS_SPECULAR_FACTOR @@ -4800,7 +6220,7 @@ float specularWeight = 1.0; #ifdef HAS_SPECULAR_COLOR_TEXTURE vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM -specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); +specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); #endif vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); @@ -4829,7 +6249,7 @@ 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); +anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); #endif vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; direction = anisotropySample.rg * 2.0 - vec2(1.0); @@ -4850,7 +6270,7 @@ void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attri #ifdef HAS_CLEARCOAT_TEXTURE vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM -clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); +clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); #endif float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; #ifdef HAS_CLEARCOAT_FACTOR @@ -4866,7 +6286,7 @@ float clearcoatFactor = 0.0; #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM -clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); +clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); #endif float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR @@ -4898,11 +6318,16 @@ material.normalEC = normalInfo.normal; material.normalEC = computeNormal(attributes); #endif vec4 baseColorWithAlpha = vec4(1.0); -#ifdef HAS_BASE_COLOR_TEXTURE +#ifdef HAS_BACKGROUND_FILL +baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor); +#elif defined(HAS_BASE_COLOR_TEXTURE) baseColorWithAlpha = getBaseColorFromTexture(); #elif defined(HAS_BASE_COLOR_FACTOR) baseColorWithAlpha = u_baseColorFactor; #endif +#ifdef HAS_IMAGERY +baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha); +#endif // HAS_IMAGERY #ifdef HAS_POINT_CLOUD_COLOR_STYLE baseColorWithAlpha = v_pointCloudColor; #elif defined(HAS_COLOR_0) @@ -4921,7 +6346,7 @@ material.alpha = baseColorWithAlpha.a; #ifdef HAS_OCCLUSION_TEXTURE vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM -occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); +occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; #endif @@ -4945,7 +6370,87 @@ setClearcoat(material, attributes); #endif #endif } -`;var{Material:T3e,MetallicRoughness:Ez,SpecularGlossiness:Xz,Specular:Kae,Clearcoat:Jae}=Cn,Qae={name:"MaterialPipelineStage",_processTexture:Nl,_processTextureTransform:jae};Qae.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=c(o.classificationType),l=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:f}=n.context;C3e(i,r,s,d,u,f,l),c(i.specularGlossiness)?V3e(i.specularGlossiness,r,s,d,l):(c(i.specular)&&qt.supportedExtensions.KHR_materials_specular&&L3e(i.specular,r,s,d,l),c(i.anisotropy)&&qt.supportedExtensions.KHR_materials_anisotropy&&R3e(i.anisotropy,r,s,d,l),c(i.clearcoat)&&qt.supportedExtensions.KHR_materials_clearcoat&&G3e(i.clearcoat,r,s,d,l),E3e(i.metallicRoughness,r,s,d,l));let p=qt.getAttributeBySemantic(t,pt.NORMAL),y=e.lightingOptions;i.unlit||!p||a?y.lightingModel=Lh.UNLIT:y.lightingModel=Lh.PBR;let h=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let g=e.alphaOptions;i.alphaMode===Th.BLEND?g.pass=Xe.TRANSLUCENT:i.alphaMode===Th.MASK&&(g.alphaCutoff=i.alphaCutoff),s.addFragmentLines(jW),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,xe.BOTH)};function jae(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,xe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,xe.FRAGMENT),t[s]=function(){return n.transform}}function S3e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,xe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,xe.FRAGMENT),t[s]=function(){return n.scale}}function Nl(e,t,n,i,o,r){e.addUniform("sampler2D",i,xe.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,xe.FRAGMENT);let l=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,l,xe.FRAGMENT);let u=n.transform;c(u)&&!te.equals(u,te.IDENTITY)&&jae(e,t,n,i,o);let{scale:f}=n;c(f)&&f!==1&&S3e(e,t,n,i,o)}function C3e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:l,normalTexture:d,occlusionTexture:u}=e;c(a)&&!m.equals(a,T3e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",xe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,xe.FRAGMENT),c(l)&&!s&&Nl(n,t,l,"u_emissiveTexture","EMISSIVE",r)),c(d)&&!s&&Nl(n,t,d,"u_normalTexture","NORMAL",o),c(u)&&!s&&Nl(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function V3e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:l,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,xe.FRAGMENT),c(r)&&!o&&Nl(n,t,r,"u_diffuseTexture","DIFFUSE",i),c(s)&&!ce.equals(s,Xz.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",xe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,xe.FRAGMENT)),c(a)&&!o&&Nl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),c(l)&&!m.equals(l,Xz.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",xe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,xe.FRAGMENT)),c(d)&&d!==Xz.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",xe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,xe.FRAGMENT))}function L3e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:l}=e;n.addDefine("USE_SPECULAR",void 0,xe.FRAGMENT),c(r)&&!o&&Nl(n,t,r,"u_specularTexture","SPECULAR",i),c(s)&&s!==Kae.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",xe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,xe.FRAGMENT)),c(a)&&!o&&Nl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),c(l)&&!m.equals(l,Kae.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",xe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,xe.FRAGMENT))}var Z3e=new m;function R3e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,xe.FRAGMENT),c(a)&&!o&&Nl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let l=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",xe.FRAGMENT),t.u_anisotropy=function(){return m.fromElements(l,d,r,Z3e)}}function G3e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:l,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,xe.FRAGMENT),c(r)&&r!==Jae.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",xe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,xe.FRAGMENT)),c(s)&&!o&&Nl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),c(a)&&r!==Jae.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",xe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,xe.FRAGMENT)),c(l)&&!o&&Nl(n,t,l,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),c(d)&&!o&&Nl(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function E3e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,xe.FRAGMENT);let r=e.baseColorTexture;c(r)&&!o&&Nl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;c(s)&&!ce.equals(s,Ez.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",xe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,xe.FRAGMENT));let a=e.metallicRoughnessTexture;c(a)&&!o&&Nl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=e.metallicFactor;c(l)&&l!==Ez.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",xe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,xe.FRAGMENT));let d=e.roughnessFactor;c(d)&&d!==Ez.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",xe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,xe.FRAGMENT))}var qW=Qae;var BPn=_(T(),1);var el={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"};el.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(el.METADATA_PICKING_VALUE_TYPE,"float",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_STRING,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",xe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",xe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${el.METADATA_PICKING_VALUE_TYPE} value = ${el.METADATA_PICKING_VALUE_TYPE}(${el.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${el.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${el.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${el.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${el.METADATA_PICKING_VALUE_COMPONENT_W};`],xe.FRAGMENT)};var Ld=el;var e2n=_(T(),1);var HPn=_(T(),1),$W=`void morphTargetsStage(inout ProcessedAttributes attributes) +`;var s$n=x(T(),1),TP=`#ifdef HAS_CONSTANT_LOD +float modelScaleX = length(czm_model[0].xyz); +float modelScaleY = length(czm_model[1].xyz); +float modelScaleZ = length(czm_model[2].xyz); +float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0; +vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz; +v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale; +v_constantLodUvCustom.z = u_constantLodDistance / modelScale; +#endif +`;var c$n=x(T(),1),_P=`#ifdef HAS_CONSTANT_LOD +vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) { +bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; +bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; +bool atClampBoundary = atMaxClamp || atMinClamp; +float effectiveDistance = atMaxClamp ? constantLodParams.y : +(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z); +float logDepth = log2(effectiveDistance); +logDepth = clamp(logDepth, -10.0, 20.0); +float f = fract(logDepth); +float p = floor(logDepth); +if (atClampBoundary) { +float clampedP = ceil(logDepth); +vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z; +return texture(textureSampler, tc); +} +vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z; +vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z; +return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); +} +vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) { +bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; +bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; +bool atClampBoundary = atMaxClamp || atMinClamp; +float effectiveDistance = atMaxClamp ? constantLodParams.y : +(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z); +float logDepth = log2(effectiveDistance); +logDepth = clamp(logDepth, -10.0, 20.0); +float f = fract(logDepth); +float p = floor(logDepth); +if (atClampBoundary) { +float clampedP = ceil(logDepth); +vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z; +tc = czm_computeTextureTransform(tc, textureTransform); +return texture(textureSampler, tc); +} +vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z; +vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z; +tc1 = czm_computeTextureTransform(tc1, textureTransform); +tc2 = czm_computeTextureTransform(tc2, textureTransform); +return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); +} +#endif +`;var{Material:dit,MetallicRoughness:w7,SpecularGlossiness:M7,Specular:Iye,Clearcoat:Pye}=Vn,Xye={name:"MaterialPipelineStage",_processTexture:Ud,_processTextureTransform:Nye};Xye.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e;l(r.u_constantLodDistance)||(r.u_constantLodDistance=function(){let Z=o.boundingSphere,R=n.camera;if(l(Z)&&l(R)){let C=h.distance(R.positionWC,Z.center);return Math.max(C,.1)}return 1});let a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:m}=n.context;pit(i,r,s,d,u,m,c,e),l(i.specularGlossiness)?bit(i.specularGlossiness,r,s,d,c,e):(l(i.specular)&&Zt.supportedExtensions.KHR_materials_specular&&git(i.specular,r,s,d,c),l(i.anisotropy)&&Zt.supportedExtensions.KHR_materials_anisotropy&&xit(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Zt.supportedExtensions.KHR_materials_clearcoat&&Tit(i.clearcoat,r,s,d,c),_it(i.metallicRoughness,r,s,d,c,e));let p=Zt.getAttributeBySemantic(t,dt.NORMAL),b=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading;l(i.planarFill)&&uit(i.planarFill,t,e,n);let f=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||b||f?y.lightingModel=zp.UNLIT:y.lightingModel=zp.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let S=e.alphaOptions;i.alphaMode===wp.BLEND?S.pass=Le.TRANSLUCENT:i.alphaMode===wp.MASK&&(S.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,fe.BOTH),s.addUniform("float","u_pointDiameter",fe.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&hit(i.lineStyle,t,n,r,s),s.addFragmentLines(xP),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,fe.BOTH)};function uit(e,t,n,i){let{uniformMap:o,shaderBuilder:r}=n;if(i.planarFillRequested=!0,r.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,fe.FRAGMENT),e.backgroundFill&&r.addDefine("HAS_BACKGROUND_FILL",void 0,fe.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;r.addDefine("PLANAR_FILL_FEATURE_ID",a,fe.FRAGMENT),e.behind?r.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,fe.FRAGMENT):(n.planarFillIdPass=!0,r.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,fe.FRAGMENT),r.addUniform("bool","u_isPlanarFillIdPass",fe.FRAGMENT),o.u_isPlanarFillIdPass=function(){return!1})}function mit(e,t,n,i,o,r){let s=n.constantLod;if(!l(s)||!l(r))return;let a=`HAS_${o}_CONSTANT_LOD`;if(e.addDefine(a,void 0,fe.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,fe.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",fe.VERTEX),e.addUniform("float","u_constantLodDistance",fe.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",fe.VERTEX),e.addFragmentLines(_P);let d=TP.split(` +`).filter(u=>!u.trim().startsWith("//")||u.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",d)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,fe.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let d=P.clone(P.IDENTITY),u=!1;t.u_constantLodWorldToEnu=function(){if(!u){let m=r.model.boundingSphere;if(l(m)){let p=m.center,b=_t.eastNorthUpToFixedFrame(p);P.inverse(b,d),u=!0}}return u?d:P.IDENTITY}}}function hit(e,t,n,i,o){let{width:r,pattern:s}=e;l(r)&&(o.addUniform("float","u_lineWidth",fe.VERTEX),i.u_lineWidth=function(){return r*n.pixelRatio}),l(s)&&(o.addDefine("HAS_LINE_PATTERN",void 0,fe.BOTH),o.addUniform("float","u_linePattern",fe.FRAGMENT),o.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=Zt.getAttributeBySemantic(t,dt.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Ie.LINES||t.primitiveType===Ie.TRIANGLE_STRIP)){o.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,fe.VERTEX),a.normalized&&o.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,fe.VERTEX),o.addUniform("float","u_cumulativeDistanceMax",fe.VERTEX),o.addUniform("float","u_pixelsPerWorld",fe.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let u=n.camera.frustum,m=1,p;return l(u.right)&&l(u.left)?p=u.right-u.left:l(u.width)&&(p=u.width),l(p)&&p>0&&(m=n.context.drawingBufferWidth/p),m};let d=Zt.getAttributeInfo(a).variableName;o.addVertexLines(` +#ifdef HAS_LINE_CUMULATIVE_DISTANCE +void lineStyleStageVS(in ProcessedAttributes attributes) +{ + float cumDist = attributes.${d}; +#ifdef LINE_CUM_DIST_NORMALIZED + cumDist *= u_cumulativeDistanceMax; +#endif + const float textureCoordinateBase = 8192.0; + v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; +} +#endif +`)}else l(s)&&o.addVertexLines(` +#ifdef HAS_LINE_PATTERN +void lineStyleStageVS(in ProcessedAttributes attributes) +{ + vec4 posClip = gl_Position; + vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw; + + const float textureCoordinateBase = 8192.0; + if (czm_viewport.z > czm_viewport.w) { + v_lineCoord = textureCoordinateBase + screenPos.x; + } else { + v_lineCoord = textureCoordinateBase + screenPos.y; + } +} +#endif +`)}function Nye(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,fe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,fe.FRAGMENT),t[s]=function(){return n.transform}}function fit(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,fe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,fe.FRAGMENT),t[s]=function(){return n.scale}}function Ud(e,t,n,i,o,r,s){e.addUniform("sampler2D",i,fe.FRAGMENT),t[i]=function(){return n.texture??r};let a=`HAS_${o}_TEXTURE`;e.addDefine(a,void 0,fe.FRAGMENT);let d=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,d,fe.FRAGMENT);let m=n.transform;l(m)&&!q.equals(m,q.IDENTITY)&&Nye(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&fit(e,t,n,i,o),mit(e,t,n,i,o,s)}function pit(e,t,n,i,o,r,s,a){let{emissiveFactor:c,emissiveTexture:d,normalTexture:u,occlusionTexture:m}=e;l(c)&&!h.equals(c,dit.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",fe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,fe.FRAGMENT),l(d)&&!s&&Ud(n,t,d,"u_emissiveTexture","EMISSIVE",r));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(u)&&!s){let b=u;l(u.constantLod)&&l(p)&&(b=Object.create(Object.getPrototypeOf(u)),Object.assign(b,u),b.constantLod=p),Ud(n,t,b,"u_normalTexture","NORMAL",o,a)}l(m)&&!s&&Ud(n,t,m,"u_occlusionTexture","OCCLUSION",i)}function bit(e,t,n,i,o,r){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:d,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,fe.FRAGMENT),l(s)&&!o&&Ud(n,t,s,"u_diffuseTexture","DIFFUSE",i,r),l(a)&&!ce.equals(a,M7.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",fe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,fe.FRAGMENT)),l(c)&&!o&&Ud(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(d)&&!h.equals(d,M7.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",fe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,fe.FRAGMENT)),l(u)&&u!==M7.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",fe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,fe.FRAGMENT))}function git(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,fe.FRAGMENT),l(r)&&!o&&Ud(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Iye.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",fe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,fe.FRAGMENT)),l(a)&&!o&&Ud(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,Iye.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",fe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,fe.FRAGMENT))}var yit=new h;function xit(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,fe.FRAGMENT),l(a)&&!o&&Ud(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",fe.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,d,r,yit)}}function Tit(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,fe.FRAGMENT),l(r)&&r!==Pye.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",fe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,fe.FRAGMENT)),l(s)&&!o&&Ud(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Pye.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",fe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,fe.FRAGMENT)),l(c)&&!o&&Ud(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Ud(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function _it(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,fe.FRAGMENT);let s=e.baseColorTexture;l(s)&&!o&&Ud(n,t,s,"u_baseColorTexture","BASE_COLOR",i,r);let a=e.baseColorFactor;l(a)&&!ce.equals(a,w7.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",fe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,fe.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!o&&Ud(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let d=e.metallicFactor;l(d)&&d!==w7.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",fe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,fe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==w7.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",fe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,fe.FRAGMENT))}var SP=Xye;var L$n=x(T(),1);var ed={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"};ed.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ed.METADATA_PICKING_VALUE_TYPE,"float",fe.FRAGMENT),i.addDefine(ed.METADATA_PICKING_VALUE_STRING,"0.0",fe.FRAGMENT),i.addDefine(ed.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",fe.FRAGMENT),i.addDefine(ed.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",fe.FRAGMENT),i.addDefine(ed.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",fe.FRAGMENT),i.addDefine(ed.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",fe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",fe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${ed.METADATA_PICKING_VALUE_TYPE} value = ${ed.METADATA_PICKING_VALUE_TYPE}(${ed.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ed.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ed.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ed.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ed.METADATA_PICKING_VALUE_COMPONENT_W};`],fe.FRAGMENT)};var Xu=ed;var M$n=x(T(),1);var v$n=x(T(),1),ZP=`void morphTargetsStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; attributes.positionMC = getMorphedPosition(positionMC); @@ -4958,7 +6463,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = getMorphedTangent(tangentMC); #endif } -`;var Na={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)"};Na.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,xe.VERTEX),v3e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let l=t.morphTargets[a].attributes,d=l.length;for(let u=0;u<d;u++){let f=l[u],p=f.semantic;p!==pt.POSITION&&p!==pt.NORMAL&&p!==pt.TANGENT||(I3e(e,f,e.attributeIndex,a),e.attributeIndex++)}}F3e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,xe.VERTEX),n.addVertexLines($W);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=St(s,e.uniformMap)};var X3e={attributeString:void 0,functionId:void 0};function I3e(e,t,n,i){let o=e.shaderBuilder;W3e(e,t,n);let r=w3e(t,X3e);P3e(o,r,i)}function W3e(e,t,n){let i={index:n,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:rn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function w3e(e,t){switch(e.semantic){case pt.POSITION:t.attributeString="Position",t.functionId=Na.FUNCTION_ID_GET_MORPHED_POSITION;break;case pt.NORMAL:t.attributeString="Normal",t.functionId=Na.FUNCTION_ID_GET_MORPHED_NORMAL;break;case pt.TANGENT:t.attributeString="Tangent",t.functionId=Na.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function P3e(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 v3e(e){e.addFunction(Na.FUNCTION_ID_GET_MORPHED_POSITION,Na.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,xe.VERTEX),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Na.FUNCTION_ID_GET_MORPHED_NORMAL,Na.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,xe.VERTEX),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Na.FUNCTION_ID_GET_MORPHED_TANGENT,Na.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,xe.VERTEX),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function F3e(e){e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var ew=Na;var d2n=_(T(),1);var qae={name:"PickingPipelineStage"};qae.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)A3e(e,t,a,i);else if(c(a))M3e(e,i);else{let l=$ae(e),d=i.createPickId(l);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",xe.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function $ae(e,t){let n=e.model;if(c(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(mr.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,c(t)&&(o.instanceId=t),o}function A3e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;c(i.featureTableId)?o=i.featureTableId:c(n)?(r=qt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=qt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let l=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",xe.FRAGMENT);let u=l.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function M3e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let f=0;f<n;f++){let p=$ae(e,f),y=t.createPickId(p);s.push(y),i[f]=y;let h=y.color;o[f*4+0]=Y.floatToByte(h.red),o[f*4+1]=Y.floatToByte(h.green),o[f*4+2]=Y.floatToByte(h.blue),o[f*4+3]=Y.floatToByte(h.alpha)}r._pickIds=i;let a=_t.createVertexBuffer({context:t,typedArray:o,usage:Ne.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,xe.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var tw=qae;var W2n=_(T(),1);var m2n=_(T(),1),N3e={ADD:0,REPLACE:1},Bo=Object.freeze(N3e);var h2n=_(T(),1),nw=`float getPointSizeFromAttenuation(vec3 positionEC) { +`;var Ic={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)"};Ic.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,fe.VERTEX),Eit(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 m=c[u],p=m.semantic;p!==dt.POSITION&&p!==dt.NORMAL&&p!==dt.TANGENT||(Zit(e,m,e.attributeIndex,a),e.attributeIndex++)}}Ait(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,fe.VERTEX),n.addVertexLines(ZP);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=It(s,e.uniformMap)};var Sit={attributeString:void 0,functionId:void 0};function Zit(e,t,n,i){let o=e.shaderBuilder;Rit(e,t,n);let r=Cit(t,Sit);Vit(o,r,i)}function Rit(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Dt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Cit(e,t){switch(e.semantic){case dt.POSITION:t.attributeString="Position",t.functionId=Ic.FUNCTION_ID_GET_MORPHED_POSITION;break;case dt.NORMAL:t.attributeString="Normal",t.functionId=Ic.FUNCTION_ID_GET_MORPHED_NORMAL;break;case dt.TANGENT:t.attributeString="Tangent",t.functionId=Ic.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Vit(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 Eit(e){e.addFunction(Ic.FUNCTION_ID_GET_MORPHED_POSITION,Ic.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,fe.VERTEX),e.addFunctionLines(Ic.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ic.FUNCTION_ID_GET_MORPHED_NORMAL,Ic.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,fe.VERTEX),e.addFunctionLines(Ic.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ic.FUNCTION_ID_GET_MORPHED_TANGENT,Ic.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,fe.VERTEX),e.addFunctionLines(Ic.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Ait(e){e.addFunctionLines(Ic.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ic.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ic.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var RP=Ic;var j$n=x(T(),1);var Yye={name:"PickingPipelineStage"};function k7(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}Yye.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)Git(e,t,a,i);else if(l(a))Lit(e,i);else{let c=wye(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",fe.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor",e.snapId=k7(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function wye(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(Or.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 Git(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Zt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Zt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",fe.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=k7(e.pickId)}function Lit(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let m=0;m<n;m++){let p=wye(e,m),b=t.createPickId(p);s.push(b),i[m]=b;let f=b.color;o[m*4+0]=U.floatToByte(f.red),o[m*4+1]=U.floatToByte(f.green),o[m*4+2]=U.floatToByte(f.blue),o[m*4+3]=U.floatToByte(f.alpha)}r._pickIds=i;let a=ot.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,fe.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=k7(e.pickId)}var CP=Yye;var yei=x(T(),1);var q$n=x(T(),1),Mye={ADD:0,REPLACE:1};Object.freeze(Mye);var xr=Mye;var eei=x(T(),1),VP=`float getPointSizeFromAttenuation(vec3 positionEC) { float pointSize = model_pointCloudParameters.x; float geometricError = model_pointCloudParameters.y; float depthMultiplier = model_pointCloudParameters.z; @@ -4996,10 +6501,10 @@ return 1.0; #endif } #endif -`;var k3e=new ce,tce={name:"PointCloudStylingPipelineStage"};tce.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=c(s)?s.propertyAttributes:void 0,l=c(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!c(a)&&l;if(c(r)&&!d){let g=B3e(a),x=Y3e(r,g);H3e(i,x);let V=z3e(x).indexOf("normalMC")>=0,Z=qt.getAttributeBySemantic(t,pt.NORMAL);if(V&&!Z)throw new le("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,xe.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=Xe.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,xe.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,xe.VERTEX);let f,p,y;mr.is3DTiles(o.type)&&(p=!0,f=o.content,y=f.tile.refine===Bo.ADD),i.addUniform("vec4","model_pointCloudParameters",xe.VERTEX),i.addVertexLines(nw);let h=e.uniformMap;h.model_pointCloudParameters=function(){let g=k3e,x=1;p&&(x=y?5:f.tileset.memoryAdjustedScreenSpaceError),g.x=u.maximumAttenuation??x,g.x*=n.pixelRatio;let S=U3e(e,t,u,f);g.y=S*u.geometricErrorScale;let V=n.context,Z=n.camera.frustum,R;return n.mode===se.SCENE2D||Z instanceof sn?R=Number.POSITIVE_INFINITY:R=V.drawingBufferHeight/n.camera.frustum.sseDenominator,g.z=R,p&&(g.w=f.tileset.timeSinceLoad),g}};var ece=new m;function U3e(e,t,n,i){if(c(i)){let u=i.tile.geometricError;if(u>0)return u}if(c(n.baseResolution))return n.baseResolution;let o=qt.getAttributeBySemantic(t,pt.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,ece);a=M.multiplyByPointAsVector(s,a,ece);let l=a.x*a.y*a.z;return w.cbrt(l/r)}var O3e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},D3e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function B3e(e){let t=He(D3e);if(!c(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 Iz="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Y3e(e,t){let n=O3e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Iz})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Iz})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Iz})`,t,i),n.styleTranslucent=c(n.colorStyleFunction)&&i.translucent,n}function H3e(e,t){let n=t.colorStyleFunction;c(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,xe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;c(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,xe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;c(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,xe.VERTEX),e.addVertexLines(o))}function Wz(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 z3e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return c(t)&&Wz(t,o),c(n)&&Wz(n,o),c(i)&&Wz(i,o),o}var iw=tce;var D2n=_(T(),1);var P2n=_(T(),1),ow=`void primitiveOutlineStage() { +`;var Wit=new ce,Uye={name:"PointCloudStylingPipelineStage"};Uye.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 y=Pit(a),_=Xit(r,y);Nit(i,_);let Z=Yit(_).indexOf("normalMC")>=0,R=Zt.getAttributeBySemantic(t,dt.NORMAL);if(Z&&!R)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,fe.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Le.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,fe.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,fe.VERTEX);let m,p,b;Or.is3DTiles(o.type)&&(p=!0,m=o.content,b=m.tile.refine===xr.ADD),i.addUniform("vec4","model_pointCloudParameters",fe.VERTEX),i.addVertexLines(VP);let f=e.uniformMap;f.model_pointCloudParameters=function(){let y=Wit,_=1;p&&(_=b?5:m.tileset.memoryAdjustedScreenSpaceError),y.x=u.maximumAttenuation??_,y.x*=n.pixelRatio;let S=vit(e,t,u,m);y.y=S*u.geometricErrorScale;let Z=n.context,R=n.camera.frustum,C;return n.mode===se.SCENE2D||R instanceof yn?C=Number.POSITIVE_INFINITY:C=Z.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=C,p&&(y.w=m.tileset.timeSinceLoad),y}};var kye=new h;function vit(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=Zt.getAttributeBySemantic(t,dt.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,kye);a=P.multiplyByPointAsVector(s,a,kye);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var Fit={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Iit={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Pit(e){let t=$e(Iit);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 U7="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Xit(e,t){let n=Fit,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${U7})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${U7})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${U7})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Nit(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,fe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,fe.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,fe.VERTEX),e.addVertexLines(o))}function D7(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 Yit(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&D7(t,o),l(n)&&D7(n,o),l(i)&&D7(i,o),o}var EP=Uye;var Gei=x(T(),1);var Tei=x(T(),1),AP=`void primitiveOutlineStage() { v_outlineCoordinates = a_outlineCoordinates; } -`;var F2n=_(T(),1),rw=`void primitiveOutlineStage(inout czm_modelMaterial material) { +`;var Sei=x(T(),1),GP=`void primitiveOutlineStage(inout czm_modelMaterial material) { if (!model_showOutline) { return; } @@ -5012,7 +6517,7 @@ 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 nce={name:"PrimitiveOutlinePipelineStage"};nce.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,xe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:rn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",xe.FRAGMENT);let a=L_.createTexture(n.context);o.model_outlineTexture=function(){return a};let l=e.model;i.addUniform("vec4","model_outlineColor",xe.FRAGMENT),o.model_outlineColor=function(){return l.outlineColor},i.addUniform("bool","model_showOutline",xe.FRAGMENT),o.model_showOutline=function(){return l.showOutline},i.addVertexLines(ow),i.addFragmentLines(rw)};var sw=nce;var J2n=_(T(),1);var ice={name:"PrimitiveStatisticsPipelineStage",_countGeometry:oce,_count2DPositions:rce,_countMorphTargetAttributes:sce,_countMaterialTextures:ace,_countFeatureIdTextures:cce,_countBinaryMetadata:lce};ice.process=function(e,t,n){let i=e.model,o=i.statistics;oce(o,t),rce(o,e.runtimePrimitive),sce(o,t),ace(o,t.material),cce(o,t.featureIds),lce(o,i)};function oce(e,t){let n=c(t.indices)?t.indices.count:qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===ve.POINTS?e.pointsLength+=n:ve.isTriangles(i)&&(e.trianglesLength+=K3e(i,n));let o=t.attributes,r=o.length;for(let l=0;l<r;l++){let d=o[l];if(c(d.buffer)){let u=c(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;c(s)&&c(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(c(a)&&c(a.buffer)){let l=c(a.typedArray);e.addBuffer(a.buffer,l)}}function K3e(e,t){switch(e){case ve.TRIANGLES:return t/3;case ve.TRIANGLE_STRIP:case ve.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function rce(e,t){let n=t.positionBuffer2D;c(n)&&e.addBuffer(n,!0)}function sce(e,t){let n=t.morphTargets;if(!c(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 l=0;l<a;l++){let d=s[l];c(d.buffer)&&e.addBuffer(d.buffer,i)}}}function ace(e,t){let n=J3e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r)&&c(r.texture)&&e.addTexture(r.texture)}}function J3e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return c(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function cce(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Cn.FeatureIdTexture){let r=o.textureReader;c(r.texture)&&e.addTexture(r.texture)}}}function lce(e,t){let n=t.structuralMetadata;c(n)&&(Q3e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!c(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function Q3e(e,t){let n=t.propertyTextures;if(!c(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;c(d.texture)&&e.addTexture(d.texture)}}}var aw=ice;var dvn=_(T(),1);var j3e=new M,q3e=new M,dce={name:"SceneMode2DPipelineStage"};dce.process=function(e,t,n){let i=qt.getAttributeBySemantic(t,pt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,l=M.multiplyTransformation(s,a,j3e),d=tYe(e,l,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let f=e.runtimeNode.node.instances;if(c(f))return;if(c(i.typedArray)){let g=oYe(i,l,d,n);u.positionBuffer2D=g,r._modelResources.push(g),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,xe.VERTEX),o.addUniform("mat4","u_modelView2D",xe.VERTEX);let p=M.fromTranslation(d.center,new M),y=n.context,h={u_modelView2D:function(){return M.multiplyTransformation(y.uniformState.view,p,q3e)}};e.uniformMap=St(h,e.uniformMap)};var $3e=new m,eYe=new m;function tYe(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,$3e),o=Oi.computeActualEllipsoidPosition(n,i,i),r=M.multiplyByPoint(t,e.positionMax,eYe),s=Oi.computeActualEllipsoidPosition(n,r,r);return ue.fromCornerPoints(o,s,new ue)}var uce=new m;function nYe(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,uce),l=m.multiplyComponents(a,r,a),d=m.add(l,o,l);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function iYe(e,t,n,i){let o;c(e.quantization)?o=nYe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=c(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let l=r;l<s;l+=a){let d=m.fromArray(o,l,uce);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=M.multiplyByPoint(t,d,d),f=Oi.computeActualEllipsoidPosition(i,u,u),p=m.subtract(f,n,f);o[l]=p.x,o[l+1]=p.y,o[l+2]=p.z}return o}function oYe(e,t,n,i){let o=He(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=iYe(e,t,r,o),a=_t.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var cw=dce;var gvn=_(T(),1);var mvn=_(T(),1),lw=`void skinningStage(inout ProcessedAttributes attributes) +`;var Dye={name:"PrimitiveOutlinePipelineStage"};Dye.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,fe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:Dt.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",fe.FRAGMENT);let a=rS.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",fe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",fe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(AP),i.addFragmentLines(GP)};var LP=Dye;var Pei=x(T(),1);var Oye={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Bye,_count2DPositions:zye,_countMorphTargetAttributes:Hye,_countMaterialTextures:Kye,_countFeatureIdTextures:Jye,_countBinaryMetadata:jye};Oye.process=function(e,t,n){let i=e.model,o=i.statistics;Bye(o,t),zye(o,e.runtimePrimitive),Hye(o,t),Kye(o,t.material),Jye(o,t.featureIds),jye(o,i)};function Bye(e,t){let n=l(t.indices)?t.indices.count:Zt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Ie.POINTS?e.pointsLength+=n:Ie.isTriangles(i)&&(e.trianglesLength+=wit(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 wit(e,t){switch(e){case Ie.TRIANGLES:return t/3;case Ie.TRIANGLE_STRIP:case Ie.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function zye(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Hye(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 Kye(e,t){let n=Mit(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 Mit(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 Jye(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Vn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function jye(e,t){let n=t.structuralMetadata;l(n)&&(kit(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 kit(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 WP=Oye;var jei=x(T(),1);var Uit=new P,Dit=new P,Qye={name:"SceneMode2DPipelineStage"};Qye.process=function(e,t,n){let i=Zt.getAttributeBySemantic(t,dt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=P.multiplyTransformation(s,a,Uit),d=zit(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let m=e.runtimeNode.node.instances;if(l(m))return;if(l(i.typedArray)){let y=Jit(i,c,d,n);u.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,fe.VERTEX),o.addUniform("mat4","u_modelView2D",fe.VERTEX);let p=P.fromTranslation(d.center,new P),b=n.context,f={u_modelView2D:function(){return P.multiplyTransformation(b.uniformState.view,p,Dit)}};e.uniformMap=It(f,e.uniformMap)};var Oit=new h,Bit=new h;function zit(e,t,n){let i=P.multiplyByPoint(t,e.positionMin,Oit),o=fo.computeActualEllipsoidPosition(n,i,i),r=P.multiplyByPoint(t,e.positionMax,Bit),s=fo.computeActualEllipsoidPosition(n,r,r);return de.fromCornerPoints(o,s,new de)}var qye=new h;function Hit(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=h.fromArray(e,s,qye),c=h.multiplyComponents(a,r,a),d=h.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function Kit(e,t,n,i){let o;l(e.quantization)?o=Hit(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=h.fromArray(o,c,qye);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=P.multiplyByPoint(t,d,d),m=fo.computeActualEllipsoidPosition(i,u,u),p=h.subtract(m,n,m);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function Jit(e,t,n,i){let o=$e(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=Kit(e,t,r,o),a=ot.createVertexBuffer({context:i.context,typedArray:s,usage:Pe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var vP=Qye;var oti=x(T(),1);var qei=x(T(),1),FP=`void skinningStage(inout ProcessedAttributes attributes) { mat4 skinningMatrix = getSkinningMatrix(); mat3 skinningMatrixMat3 = mat3(skinningMatrix); @@ -5027,7 +6532,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = skinningMatrixMat3 * tangentMC; #endif } -`;var E_={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};E_.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,xe.VERTEX),sYe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,xe.VERTEX),n.addVertexLines(lw);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=St(r,e.uniformMap)};function rYe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===pt.JOINTS||r.semantic===pt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function sYe(e,t){e.addFunction(E_.FUNCTION_ID_GET_SKINNING_MATRIX,E_.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,xe.VERTEX),e.addFunctionLines(E_.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=rYe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let l=r[o],d=`skinnedMatrix += a_weights_${i}.${l} * u_jointMatrices[int(a_joints_${i}.${l})];`;e.addFunctionLines(E_.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(E_.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var dw=E_;var Lvn=_(T(),1);var _vn=_(T(),1),uw=`void verticalExaggerationStage( +`;var hS={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};hS.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,fe.VERTEX),Qit(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,fe.VERTEX),n.addVertexLines(FP);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=It(r,e.uniformMap)};function jit(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===dt.JOINTS||r.semantic===dt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function Qit(e,t){e.addFunction(hS.FUNCTION_ID_GET_SKINNING_MATRIX,hS.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,fe.VERTEX),e.addFunctionLines(hS.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=jit(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(hS.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(hS.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var IP=hS;var uti=x(T(),1);var sti=x(T(),1),PP=`void verticalExaggerationStage( inout ProcessedAttributes attributes ) { vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); @@ -5036,29 +6541,30 @@ float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCu float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; -vec3 vertexNormal = normalize(centerToVertex); +vec3 vertexEllipsoidNormalEC = normalize(centerToVertex); 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; -float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); +float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexEllipsoidNormalEC); float smallAngleVersine = 0.5 * sinTheta * sinTheta; float versine = isSmallAngle ? smallAngleVersine : exactVersine; -float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; +float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; float vertexHeight = czm_eyeHeight + dHeight; -vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; -vertexNormalMC = normalize(vertexNormalMC); +vec3 exaggerationDirectionScaledMC = (czm_inverseModelView * vec4(vertexEllipsoidNormalEC, 0.0)).xyz; float stretch = u_verticalExaggerationAndRelativeHeight.x; float shift = u_verticalExaggerationAndRelativeHeight.y; float exaggeration = (vertexHeight - shift) * (stretch - 1.0); -attributes.positionMC += exaggeration * vertexNormalMC; +attributes.positionMC += exaggeration * exaggerationDirectionScaledMC; } -`;var mce={name:"VerticalExaggerationPipelineStage"},aYe=new D;mce.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(uw),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,xe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",xe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return D.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,aYe)}};var mw=mce;var Uvn=_(T(),1);var Xvn=_(T(),1);var wz={};function cYe(e){let t=Me.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 lYe(e,t){let n=t.length,i=Me.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],l=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=l,i[o++]=l,i[o++]=s}return i}function dYe(e){let t=e-2,n=2+t*4,i=Me.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 uYe(e,t){let i=t.length-2,o=2+i*4,r=Me.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let l=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=l}return r}function mYe(e){let t=e-2,n=2+t*4,i=Me.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 fYe(e,t){let i=t.length-2,o=2+i*4,r=Me.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let l=0;l<i;l++){let d=t[l+1],u=t[l+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}wz.createWireframeIndices=function(e,t,n){let i=c(n);if(e===ve.TRIANGLES)return i?lYe(t,n):cYe(t);if(e===ve.TRIANGLE_STRIP)return i?uYe(t,n):dYe(t);if(e===ve.TRIANGLE_FAN)return i?fYe(t,n):mYe(t)};wz.getWireframeIndicesCount=function(e,t){return e===ve.TRIANGLES?t*2:e===ve.TRIANGLE_STRIP||e===ve.TRIANGLE_FAN?2+(t-2)*4:t};var l1=wz;var fce={name:"WireframePipelineStage"};fce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,xe.FRAGMENT);let o=e.model,r=hYe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,l=e.count;e.primitiveType=ve.LINES,e.count=l1.getWireframeIndicesCount(a,l)};function hYe(e,t,n){let o=qt.getAttributeBySemantic(e,pt.POSITION).count,r=n.context.webgl2,s;if(c(t)){let u=t.buffer,f=t.count;c(u)&&r?(s=u.sizeInBytes===f?new Uint8Array(f):Me.createTypedArray(o,f),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,l=l1.createWireframeIndices(a,o,s),d=Me.fromSizeInBytes(l.BYTES_PER_ELEMENT);return _t.createIndexBuffer({context:n.context,typedArray:l,usage:Ne.STATIC_DRAW,indexDatatype:d})}var fw=fce;function hce(e){e=e??z.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;C.typeOf.object("options.primitive",t),C.typeOf.object("options.node",n),C.typeOf.object("options.model",i),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=[]}hce.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!==se.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,f=c(n.morphTargets)&&n.morphTargets.length>0,p=c(i.skin),y=c(r),g=!(y&&c(r.fragmentShaderText))||r.mode!==bb.REPLACE_MATERIAL,x=qt.hasQuantizedAttributes(n.attributes),S=o.debugWireframe&&ve.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,Z=c(V)&&V.attenuation,R=c(V)&&V.backFaceCulling,E=n.primitiveType===ve.POINTS&&(c(s)||Z||R),I=o._enableShowOutline&&c(n.outlineCoordinates),v=pYe(o,i,n),P=c(o.classificationType);d&&t.push(cw),t.push(KW),S&&t.push(fw),P&&t.push(WW),f&&t.push(ew),p&&t.push(dw),E&&t.push(iw),x&&t.push(BW),g&&t.push(qW),t.push(Xy),t.push(Fu),t.push(Ld),v.hasPropertyTable&&(t.push(Wy),t.push(IW),t.push(vW)),u&&t.push(mw),y&&t.push(OW),t.push(QW),o.allowPicking&&t.push(tw),I&&t.push(sw),t.push(XW),t.push(aw)};function pYe(e,t,n){let i;return c(t.instances)&&(i=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(i))?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:(i=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),c(i)?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var hw=hce;var CFn=_(T(),1);function Pz(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.skin",e.skin),C.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],bYe(this)}Object.defineProperties(Pz.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 bYe(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 l=0;l<o;l++){let d=i[l].index,u=r[d];s.push(u);let f=n[l],p=pce(u,f,new M);a.push(p)}}function pce(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}Pz.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]=pce(i,o,e[n])}};var pw=Pz;var WFn=_(T(),1);var LFn=_(T(),1);function yYe(){this.pass=void 0,this.alphaCutoff=void 0}var bw=yYe;function gYe(e){C.typeOf.object("model",e),this.shaderBuilder=new Lx,this.model=e,this.uniformMap={},this.alphaOptions=new bw,this.renderStateOptions=Oe.getState(Oe.fromCache({depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var yw=gYe;var DFn=_(T(),1);var PFn=_(T(),1),gw=`void silhouetteStage(inout vec4 color) { +`;var $ye={name:"VerticalExaggerationPipelineStage"},qit=new k;$ye.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(PP),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,fe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",fe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return k.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,qit)}};var XP=$ye;var Eti=x(T(),1);var bti=x(T(),1);var O7={};function $it(e){let t=Oe.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 eot(e,t){let n=t.length,i=Oe.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 tot(e){let t=e-2,n=2+t*4,i=Oe.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 not(e,t){let i=t.length-2,o=2+i*4,r=Oe.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 iot(e){let t=e-2,n=2+t*4,i=Oe.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 oot(e,t){let i=t.length-2,o=2+i*4,r=Oe.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}O7.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ie.TRIANGLES)return i?eot(t,n):$it(t);if(e===Ie.TRIANGLE_STRIP)return i?not(t,n):tot(t);if(e===Ie.TRIANGLE_FAN)return i?oot(t,n):iot(t)};O7.getWireframeIndicesCount=function(e,t){return e===Ie.TRIANGLES?t*2:e===Ie.TRIANGLE_STRIP||e===Ie.TRIANGLE_FAN?2+(t-2)*4:t};var wC=O7;var exe={name:"WireframePipelineStage"};exe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,fe.FRAGMENT);let o=e.model,r=rot(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=Ie.LINES,e.count=wC.getWireframeIndicesCount(a,c)};function rot(e,t,n){let o=Zt.getAttributeBySemantic(e,dt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,m=t.count;l(u)&&r?(s=u.sizeInBytes===m?new Uint8Array(m):Oe.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=wC.createWireframeIndices(a,o,s),d=Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return ot.createIndexBuffer({context:n.context,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:d})}var NP=exe;function txe(e){e=e??B.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=[]}txe.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!==se.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,m=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),b=l(o.imageryLayers)&&o.imageryLayers.length>0,f=l(r),_=!(f&&l(r.fragmentShaderText))||r.mode!==Ob.REPLACE_MATERIAL,S=Zt.hasQuantizedAttributes(n.attributes),Z=o.debugWireframe&&Ie.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),R=o.pointCloudShading,C=l(R)&&R.attenuation,E=l(R)&&R.backFaceCulling,A=n.primitiveType===Ie.POINTS&&(l(s)||C||E),L=o._enableShowOutline&&l(n.outlineCoordinates),F=l(n.edgeVisibility),I=sot(o,i,n),N=l(o.classificationType);d&&t.push(vP),t.push(QI),Z&&t.push(NP),N&&t.push(LI),m&&t.push(RP),p&&t.push(IP),A&&t.push(EP),S&&t.push(UI),b&&(L?xt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(bP)),_&&t.push(SP),t.push(px),t.push(km),t.push(Xu),I.hasPropertyTable&&(t.push(gx),t.push(GI),t.push(FI)),u&&t.push(XP),f&&t.push(MI),t.push(yP),o.allowPicking&&t.push(CP),L&&t.push(LP),F&&(e.edgeVisibilityRequested=!0,t.push(HI),t.push(OI)),t.push(AI),t.push(WP)};function sot(e,t,n){let i;return l(t.instances)&&(i=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var YP=txe;var uni=x(T(),1);function B7(e){e=e??B.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],aot(this)}Object.defineProperties(B7.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 aot(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 m=n[c],p=nxe(u,m,new P);a.push(p)}}function nxe(e,t,n){let i=P.multiplyTransformation(e.transformToRoot,e.transform,n);return n=P.multiplyTransformation(i,t,n),n}B7.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]=nxe(i,o,e[n])}};var wP=B7;var Fni=x(T(),1);var hni=x(T(),1);function cot(){this.pass=void 0,this.alphaCutoff=void 0}var fS=cot;var Eni=x(T(),1);var pni=x(T(),1);function z7(e){this.name=e,this.fields=[]}z7.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};z7.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var MP=z7;var gni=x(T(),1);function H7(e){this.signature=e,this.body=[]}H7.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}`)};H7.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var kP=H7;function td(){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(td.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});td.prototype.addDefine=function(e,t,n){n=n??fe.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),fe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),fe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};td.prototype.addStruct=function(e,t,n){this._structs[e]=new MP(t),fe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),fe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};td.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};td.prototype.addFunction=function(e,t,n){this._functions[e]=new kP(t),fe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),fe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};td.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};td.prototype.addUniform=function(e,t,n){n=n??fe.BOTH;let i=`uniform ${e} ${t};`;fe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),fe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};td.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};td.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+=dot(e),i};td.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}`)};td.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?ii(t,e):t.push(e)};td.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?ii(t,e):t.push(e)};td.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=lot(this),i=uot(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +`),r=new Je({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` +`),a=new Je({defines:this._fragmentShaderParts.defineLines,sources:[s]});return nn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};td.prototype.clone=function(){return $e(this,!0)};function lot(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(),ii(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),ii(n,a);return{vertexLines:t,fragmentLines:n}}function dot(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function uot(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(),ii(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),ii(n,a);return{vertexLines:t,fragmentLines:n}}var Jb=td;function mot(e){this.shaderBuilder=new Jb,this.model=e,this.uniformMap={},this.alphaOptions=new fS,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var UP=mot;var Oni=x(T(),1);var Pni=x(T(),1),DP=`void silhouetteStage(inout vec4 color) { if(model_silhouettePass) { color = czm_gammaCorrect(model_silhouetteColor); } } -`;var FFn=_(T(),1),xw=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +`;var Nni=x(T(),1),OP=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { #ifdef HAS_NORMALS if(model_silhouettePass) { vec3 normal = normalize(czm_normal3D * attributes.normalMC); @@ -5068,14 +6574,14 @@ positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixel } #endif } -`;var ck={name:"ModelSilhouettePipelineStage"};ck.silhouettesLength=0;ck.process=function(e,t,n){c(t._silhouetteId)||(t._silhouetteId=++ck.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,xe.BOTH),i.addVertexLines(xw),i.addFragmentLines(gw),i.addUniform("vec4","model_silhouetteColor",xe.FRAGMENT),i.addUniform("float","model_silhouetteSize",xe.VERTEX),i.addUniform("bool","model_silhouettePass",xe.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 _w=ck;var QFn=_(T(),1);var YFn=_(T(),1),Tw=`void modelSplitterStage() +`;var aB={name:"ModelSilhouettePipelineStage"};aB.silhouettesLength=0;aB.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++aB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,fe.BOTH),i.addVertexLines(OP),i.addFragmentLines(DP),i.addUniform("vec4","model_silhouetteColor",fe.FRAGMENT),i.addUniform("float","model_silhouetteSize",fe.VERTEX),i.addUniform("bool","model_silhouettePass",fe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=It(o,e.uniformMap),e.hasSilhouette=!0};var BP=aB;var Qni=x(T(),1);var zni=x(T(),1),zP=`void modelSplitterStage() { #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 lk={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};lk.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,xe.FRAGMENT),i.addFragmentLines(Tw);let o={};i.addUniform("float",lk.SPLIT_DIRECTION_UNIFORM_NAME,xe.FRAGMENT),o[lk.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=St(o,e.uniformMap)};var Sw=lk;var eAn=_(T(),1);function xYe(e,t){C.typeOf.object("modelRenderResources",e),C.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=He(e.uniformMap),this.alphaOptions=He(e.alphaOptions),this.renderStateOptions=He(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 Cw=xYe;var fAn=_(T(),1);var oAn=_(T(),1);function _Ye(e){e=e??z.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Lh.UNLIT}var Vw=_Ye;function TYe(e,t){C.typeOf.object("nodeRenderResources",e),C.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=He(e.uniformMap),this.alphaOptions=He(e.alphaOptions),this.renderStateOptions=He(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=c(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=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new Vw,this.pickId=void 0}var Lw=TYe;var y9n=_(T(),1);var GAn=_(T(),1);function Fz(e){e=e??z.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;C.typeOf.object("options.command",t),C.typeOf.object("options.primitiveRenderResources",n);let 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!==Un.CESIUM_3D_TILE,this._classifies3DTiles=o!==Un.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],LYe(this)}function SYe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},depthMask:!1}}var CYe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},VYe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},gce=[];function LYe(e){let t=e._command,n=gce;if(e._useDebugWireframe){t.pass=Xe.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=Zw(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let l=r[a];l.count*=2,l.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Xe.TERRAIN_CLASSIFICATION,s=vz(t,r),a=bce(t,r);n.length=0,n.push(s,a),e._commandListTerrain=Zw(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=yce(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Xe.CESIUM_3D_TILE_CLASSIFICATION,s=vz(t,r),a=bce(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=Zw(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=yce(e,n,e._commandList3DTilesPicking))}}function Zw(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let l=0;l<s;l++){let d=o[l],u=r[l];for(let f=0;f<a;f++){let p=t[f],y=et.shallowClone(p);y.count=d,y.offset=u,n.push(y)}}return n}function vz(e,t){let n=et.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Xe.TERRAIN_CLASSIFICATION?On.ALWAYS:On.EQUAL,o=SYe(i);return n.renderState=Oe.fromCache(o),n}function bce(e,t){let n=et.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Oe.fromCache(CYe),n}var ZYe=[];function yce(e,t,n){let i=Oe.fromCache(VYe),o=t[0],r=t[1],s=et.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=et.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let l=ZYe;return l.length=0,l.push(s,a),Zw(e,l,n)}Object.defineProperties(Fz.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=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});Fz.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=Xe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=vz(this._command,o),s=gce;s.length=0,s.push(r),this._commandListIgnoreShow=Zw(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 Rw=Fz;var QAn=_(T(),1);function dk(e){e=e??z.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;C.typeOf.object("options.command",t),C.typeOf.object("options.primitiveRenderResources",n);let i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Xe.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,l=n.hasSilhouette,d=!r&&!l,u=n.hasSkipLevelOfDetail&&!r,f=l;this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new ue,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=f,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,RYe(this)}function yb(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}yb.clone=function(e){return new yb({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function RYe(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 yb({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new yb({command:PYe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new yb({command:kYe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new yb({command:UYe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new yb({command:vYe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new yb({command:FYe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(dk.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=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ue.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,EYe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,XYe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,IYe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,WYe(this))}}});function GYe(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=w.sign(n[13])*2*w.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function EYe(e){let t=e.shadows,n=Sn.castShadows(t),i=Sn.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 XYe(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=He(r.renderState,!0);s.cull.enabled=t,r.renderState=Oe.fromCache(s)}}}function IYe(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=He(r.renderState,!0);s.cull.face=t,r.renderState=Oe.fromCache(s)}}}function WYe(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}}}dk.prototype.pushCommands=function(e,t){let n=xce(this,e);n&&!this._has2DCommands&&(wYe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(GYe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&c(i)&&(i!==sf.ALL_OPAQUE&&u1(t,this._translucentCommand,n),i===sf.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||u1(o._backfaceCommands,this._skipLodBackfaceCommand,n),AYe(this,r,n),u1(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){u1(t,this._silhouetteModelCommand,n);return}return u1(t,this._originalCommand,n),t}};dk.prototype.pushSilhouetteCommands=function(e,t){let n=xce(this,e);return u1(t,this._silhouetteColorCommand,n),t};function u1(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function xce(e,t){if(t.mode!==se.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 d1(e,t){if(!c(t))return;let n=yb.clone(t),i=et.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 wYe(e){d1(e,e._originalCommand),d1(e,e._translucentCommand),d1(e,e._skipLodBackfaceCommand),d1(e,e._skipLodStencilCommand),d1(e,e._silhouetteModelCommand),d1(e,e._silhouetteColorCommand)}function PYe(e){let t=et.shallowClone(e);t.pass=Xe.TRANSLUCENT;let n=He(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Oe.fromCache(n),t}function vYe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),o=He(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:oe.ALWAYS,backFunction:oe.ALWAYS,reference:n,mask:-1,frontOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.REPLACE},backOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Oe.fromCache(o),i}function FYe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),o=He(e.renderState,!0);o.cull.enabled=!1,(e.pass===Xe.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Xe.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:oe.NOTEQUAL,backFunction:oe.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.KEEP},backOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.KEEP}};let s=He(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Oe.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function AYe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=MYe(o);if(r!==s){let a=NYe(r),l=He(o.renderState,!0);l.stencilTest.reference=a,o.renderState=Oe.fromCache(l),n&&(i.derivedCommand2D.renderState=l)}}function MYe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function NYe(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function kYe(e){let t=et.shallowClone(e),n=He(e.renderState,!0);n.cull.enabled=!0,n.cull.face=_i.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=He(t.uniformMap),o=new D(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Oe.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function UYe(e){let t=et.shallowClone(e),n=He(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=On.GREATER_OR_EQUAL,i.frontOperation.zPass=ft.REPLACE,i.backFunction=On.GREATER_OR_EQUAL,i.backOperation.zPass=ft.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=Oe.fromCache(n),t}var Gw=dk;var qAn=_(T(),1),Ew=`precision highp float; +`;var cB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};cB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,fe.FRAGMENT),i.addFragmentLines(zP);let o={};i.addUniform("float",cB.SPLIT_DIRECTION_UNIFORM_NAME,fe.FRAGMENT),o[cB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=It(o,e.uniformMap)};var HP=cB;var eii=x(T(),1);function hot(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(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,this.primitiveRenderResources=[]}var KP=hot;var mii=x(T(),1);var oii=x(T(),1);function fot(e){e=e??B.EMPTY_OBJECT,this.lightingModel=e.lightingModel??zp.UNLIT}var JP=fot;function pot(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=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Zt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Zt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=de.fromCornerPoints(this.positionMin,this.positionMax,new de),this.lightingOptions=new JP,this.pickId=void 0,this.snapId=void 0}var jP=pot;var poi=x(T(),1);var Eii=x(T(),1);function J7(e){e=e??B.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!==ti.CESIUM_3D_TILE,this._classifies3DTiles=o!==ti.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],xot(this)}function bot(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:e,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL},depthMask:!1}}var got={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND},yot={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},rxe=[];function xot(e){let t=e._command,n=rxe;if(e._useDebugWireframe){t.pass=Le.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=QP(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=Le.TERRAIN_CLASSIFICATION,s=K7(t,r),a=ixe(t,r);n.length=0,n.push(s,a),e._commandListTerrain=QP(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=oxe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Le.CESIUM_3D_TILE_CLASSIFICATION,s=K7(t,r),a=ixe(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=QP(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=oxe(e,n,e._commandList3DTilesPicking))}}function QP(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 m=0;m<a;m++){let p=t[m],b=lt.shallowClone(p);b.count=d,b.offset=u,n.push(b)}}return n}function K7(e,t){let n=lt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Le.TERRAIN_CLASSIFICATION?ni.ALWAYS:ni.EQUAL,o=bot(i);return n.renderState=ze.fromCache(o),n}function ixe(e,t){let n=lt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(got),n}var Tot=[];function oxe(e,t,n){let i=ze.fromCache(yot),o=t[0],r=t[1],s=lt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=lt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=Tot;return c.length=0,c.push(s,a),QP(e,c,n)}Object.defineProperties(J7.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=P.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=de.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});J7.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ii(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ii(t,this._commandListTerrain),this._classifies3DTiles&&ii(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=K7(this._command,o),s=rxe;s.length=0,s.push(r),this._commandListIgnoreShow=QP(this,s,this._commandListIgnoreShow)}ii(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ii(t,this._commandListTerrainPicking),this._classifies3DTiles&&ii(t,this._commandList3DTilesPicking)),t};var qP=J7;var Jii=x(T(),1);function MC(e){e=e??B.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Le.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=P.clone(t.modelMatrix),this._boundingVolume=de.clone(t.boundingVolume),this._modelMatrix2D=new P,this._boundingVolume2D=new de,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=m,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,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._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,_ot(this)}function Dm(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Dm.clone=function(e){return new Dm({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function _ot(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new Dm({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Dm({command:Aot(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Dm({command:Pot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Dm({command:Xot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Dm({command:Got(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Dm({command:Lot(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources,s=r.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new Dm({command:sxe(t,r,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Dm({command:sxe(t,r,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand),o.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Dm({command:Wot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._planarFillIdCommand))}Object.defineProperties(MC.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=P.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=de.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,Zot(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Rot(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Cot(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Vot(this))}}});function Sot(e,t){let n=e._modelMatrix;e._modelMatrix2D=P.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=de.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Zot(e){let t=e.shadows,n=vn.castShadows(t),i=vn.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 Rot(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=$e(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function Cot(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=$e(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function Vot(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}}}MC.prototype.pushCommands=function(e,t){let n=lB(this,e);n&&!this._has2DCommands&&(Eot(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Sot(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==df.ALL_OPAQUE&&Hp(t,this._translucentCommand,n),i===df.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||Hp(o._backfaceCommands,this._skipLodBackfaceCommand,n),vot(this,r,n),Hp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Hp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Mm.EDGES_ONLY&&this._needsEdgeCommands||Hp(t,this._originalCommand,n),t}};MC.prototype.pushSilhouetteCommands=function(e,t){let n=lB(this,e);return Hp(t,this._silhouetteColorCommand,n),t};MC.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,o=lB(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT),Hp(t,s,o),t}if(i.pick){if(n!==Mm.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT),Hp(t,s,o),t}if(n===Mm.SURFACES_ONLY)return t;let r=n===Mm.EDGES_ONLY?Le.CESIUM_3D_TILE_EDGES_DIRECT:Le.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=r,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=r),Hp(t,this._edgeCommand,o),t};MC.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=lB(this,e);return Hp(t,this._planarFillIdCommand,n),t};function Hp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function lB(e,t){if(t.mode!==se.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 jb(e,t){if(!l(t))return;let n=Dm.clone(t),i=lt.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 Eot(e){jb(e,e._originalCommand),jb(e,e._translucentCommand),jb(e,e._skipLodBackfaceCommand),jb(e,e._skipLodStencilCommand),jb(e,e._silhouetteModelCommand),jb(e,e._silhouetteColorCommand),jb(e,e._edgeCommand),jb(e,e._edgeSnapCommand),jb(e,e._planarFillIdCommand)}function Aot(e){let t=lt.shallowClone(e);t.pass=Le.TRANSLUCENT;let n=$e(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=on.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function Got(e,t){let n=t._silhouetteId%255,i=lt.shallowClone(e),o=$e(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=ze.fromCache(o),i}function Lot(e,t){let n=t._silhouetteId%255,i=lt.shallowClone(e),o=$e(e.renderState,!0);o.cull.enabled=!1,(e.pass===Le.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Le.TRANSLUCENT,o.depthMask=!1,o.blending=on.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=$e(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function sxe(e,t,n){let i=t.edgeGeometry,o=lt.shallowClone(e);o.vertexArray=i.vertexArray,o.primitiveType=i.primitiveType,o.count=i.indexCount,l(i.shaderProgram)&&(o.shaderProgram=i.shaderProgram),o.pass=i.pass;let r=$e(e.uniformMap);return r.u_isEdgePass=function(){return!0},r.u_lineWidth=function(){return n},o.uniformMap=r,o.castShadows=!1,o.receiveShadows=!1,o}function Wot(e){let t=lt.shallowClone(e);t.pass=Le.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=$e(e.renderState,!0);n.blending.enabled=!1,t.renderState=ze.fromCache(n);let i=$e(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function vot(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=Fot(o);if(r!==s){let a=Iot(r),c=$e(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Fot(e){return(e.renderState.stencilTest.reference&Jt.SKIP_LOD_MASK)>>>Jt.SKIP_LOD_BIT_SHIFT}function Iot(e){return Jt.CESIUM_3D_TILE_MASK|e<<Jt.SKIP_LOD_BIT_SHIFT}function Pot(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Di.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=$e(t.uniformMap),o=new k(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Xot(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Jt.SKIP_LOD_MASK,i.reference=Jt.CESIUM_3D_TILE_MASK,i.frontFunction=ni.GREATER_OR_EQUAL,i.frontOperation.zPass=Ft.REPLACE,i.backFunction=ni.GREATER_OR_EQUAL,i.backOperation.zPass=Ft.REPLACE,n.stencilMask=Jt.CESIUM_3D_TILE_MASK|Jt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var $P=MC;var Qii=x(T(),1),eX=`precision highp float; czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { czm_modelVertexOutput vsOutput; vsOutput.positionMC = positionMC; @@ -5086,6 +6592,9 @@ void main() { ProcessedAttributes attributes; initializeAttributes(attributes); +#ifdef HAS_IMAGERY +initializeImageryAttributes(); +#endif #ifdef USE_DEQUANTIZATION dequantizationStage(attributes); #endif @@ -5132,7 +6641,7 @@ v_pickColor = a_pickColor; Metadata metadata; MetadataClass metadataClass; MetadataStatistics metadataStatistics; -metadataStage(metadata, metadataClass, metadataStatistics, attributes); +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); #ifdef HAS_VERTICAL_EXAGGERATION verticalExaggerationStage(attributes); #endif @@ -5141,11 +6650,17 @@ czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); #endif vec4 positionClip = geometryStage(attributes, modelView, normal); +#ifdef ENABLE_CLIPPING_POLYGONS +modelClippingPolygonsStage(); +#endif +#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN) +lineStyleStageVS(attributes); +#endif #ifdef HAS_ATMOSPHERE atmosphereStage(attributes); #endif -#ifdef ENABLE_CLIPPING_POLYGONS -modelClippingPolygonsStage(attributes); +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(attributes); #endif #ifdef HAS_SILHOUETTE silhouetteStage(attributes, positionClip); @@ -5166,17 +6681,26 @@ v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); gl_PointSize = vsOutput.pointSize; #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); +#elif defined(HAS_POINT_DIAMETER) +gl_PointSize = u_pointDiameter; #else gl_PointSize = 1.0; #endif gl_PointSize *= show; #endif gl_Position = positionClip; +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStageVS(); +#endif #ifdef HAS_POINT_CLOUD_SHOW_STYLE v_pointCloudShow = show; #endif } -`;var e9n=_(T(),1),Xw=`precision highp float; +`;var $ii=x(T(),1),tX=`precision highp float; +const float PLANAR_DEPTH_PULL = 0.9995; +const float BEHIND_DEPTH_PUSH = 1.0002; +const float FEATURE_ID_TOLERANCE = 0.5; +const float FEATURE_ID_OFFSET = 1.0; czm_modelMaterial defaultModelMaterial() { czm_modelMaterial material; @@ -5198,9 +6722,28 @@ discard; #endif return vec4(color, alpha); } +void lineStyleStage() +{ +#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY) +const float maskLength = 16.0; +float dashPosition = fract(v_lineCoord / maskLength); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(u_linePattern / pow(2.0, maskIndex)); +if (mod(maskTest, 2.0) < 1.0) { +discard; +} +#endif +} SelectedFeature selectedFeature; +bool isEdge = false; void main() { +#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER) +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +if (distanceToCenter > 0.5) { +discard; +} +#endif #ifdef HAS_POINT_CLOUD_SHOW_STYLE if (v_pointCloudShow == 0.0) { @@ -5215,10 +6758,20 @@ ProcessedAttributes attributes; geometryStage(attributes); FeatureIds featureIds; featureIdStage(featureIds, attributes); +#ifdef HAS_PLANAR_FILL_ID_PASS +if (u_isPlanarFillIdPass) { +float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET; +out_FragColor = vec4(fid, 0.0, 0.0, 1.0); +#ifdef LOG_DEPTH +czm_writeLogDepth(); +#endif +return; +} +#endif Metadata metadata; MetadataClass metadataClass; MetadataStatistics metadataStatistics; -metadataStage(metadata, metadataClass, metadataStatistics, attributes); +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); #ifndef METADATA_PICKING_ENABLED #ifdef HAS_SELECTED_FEATURE_ID selectedFeatureIdStage(selectedFeature, featureIds); @@ -5245,12 +6798,16 @@ vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); metadataPickingStage(metadata, metadataClass, metadataValues); vec4 color = metadataValues; #endif +lineStyleStage(); #ifdef HAS_CLIPPING_PLANES modelClippingPlanesStage(color); #endif #ifdef ENABLE_CLIPPING_POLYGONS modelClippingPolygonsStage(); #endif +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(color); +#endif #ifndef METADATA_PICKING_ENABLED #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) silhouetteStage(color); @@ -5258,41 +6815,52 @@ silhouetteStage(color); #ifdef HAS_ATMOSPHERE atmosphereStage(color, attributes); #endif +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStage(color, featureIds); +edgeDetectionStage(color, featureIds); +if (u_isEdgePass) { +isEdge = true; +} +#endif #endif out_FragColor = color; +#ifdef LOG_DEPTH +czm_writeLogDepth(); +#endif +#ifdef HAS_PLANAR_FILL_DEPTH +gl_FragDepth *= PLANAR_DEPTH_PULL; +#endif +#ifdef HAS_PLANAR_FILL_BEHIND +{ +vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw; +float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r; +float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET; +float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID); +if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) { +gl_FragDepth *= BEHIND_DEPTH_PUSH; +} } -`;function _ce(){}_ce.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=OYe(e,n,t),o=DYe(e,i,t),r=e.model;return c(r.classificationType)?new Rw({primitiveRenderResources:e,command:o}):new Gw({primitiveRenderResources:e,command:o})};function OYe(e,t,n){t.addVertexLines(Ew),t.addFragmentLines(Xw);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function DYe(e,t,n){let i=BYe(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,l=n.mode===se.SCENE3D,d,u;if(!l&&!n.scene3DOnly&&r._projectTo2D)d=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),u=e.runtimePrimitive.boundingSphere2D;else{let S=l?a._computedModelMatrix:a._computedModelMatrix2D;d=M.multiplyTransformation(S,e.runtimeNode.computedTransform,new M),u=ue.transform(e.boundingSphere,d)}let f=He(Oe.fromCache(e.renderStateOptions),!0);f.cull.face=qt.getCullFace(d,e.primitiveType),f=Oe.fromCache(f);let p=c(r.classificationType),y=p?!1:Sn.castShadows(r.shadows),h=p?!1:Sn.receiveShadows(r.shadows),g=p?void 0:e.pickId;return new et({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:f,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:g,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:y,receiveShadows:h})}function BYe(e){let t=e.wireframeIndexBuffer;if(c(t))return t;let n=e.indices;if(c(n)){if(!c(n.buffer))throw new L("Indices must be provided as a Buffer");return n.buffer}}var Iw=_ce;function Zd(e){e=e??z.EMPTY_OBJECT;let t=e.modelComponents;C.typeOf.object("options.model",e.model),C.typeOf.object("options.modelComponents",t),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=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},YYe(this)}Object.defineProperties(Zd.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 YYe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Tce(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V<s;V++){let Z=r[V],R=new hW({articulation:Z,sceneGraph:e}),E=R.name;a[E]=R}let l=t.nodes,d=l.length;e._runtimeNodes=new Array(d);let f=n.nodes.length,p=M.IDENTITY;for(let V=0;V<f;V++){let Z=n.nodes[V],R=Sce(e,Z,p);e._rootNodes.push(R)}let y=t.skins,h=e._runtimeSkins,g=y.length;for(let V=0;V<g;V++){let Z=y[V];h.push(new pw({skin:Z,sceneGraph:e}))}let x=e._skinnedNodes,S=x.length;for(let V=0;V<S;V++){let Z=x[V],R=e._runtimeNodes[Z],I=l[Z].skin.index;R._runtimeSkin=h[I],R.updateJointMatrices()}e.applyArticulations()}function Tce(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var HYe=new m;function zYe(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,HYe);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=wt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=wt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Sce(e,t,n){let i=[],o=qt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let f=t.children[u],p=M.multiplyTransformation(n,o,new M),y=Sce(e,f,p);i.push(y)}let s=new EW({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 hw({primitive:t.primitives[u],node:t,model:e._model}));let l=t.index;e._runtimeNodes[l]=s,c(t.skin)&&e._skinnedNodes.push(l);let d=t.name;if(c(d)){let u=e._model,f=new TW(u,s);u._nodesByName[d]=f}return l}var KYe=new m,JYe=new m,QYe=new m,jYe=new m;Zd.prototype.buildDrawCommands=function(e){let t=this._model,n=new yw(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,KYe),l=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,JYe);for(o=0;o<this._runtimeNodes.length;o++){let d=this._runtimeNodes[o];if(!c(d))continue;d.configurePipeline();let u=d.pipelineStages,f=new Cw(n,d);for(r=0;r<u.length;r++)u[r].process(f,d.node,e);let p=d.computedTransform;for(r=0;r<d.runtimePrimitives.length;r++){let y=d.runtimePrimitives[r];y.configurePipeline(e);let h=y.pipelineStages,g=new Lw(f,y);for(s=0;s<h.length;s++)h[s].process(g,y.primitive,e);y.boundingSphere=ue.clone(g.boundingSphere,new ue);let x=M.multiplyByPoint(p,g.positionMin,QYe),S=M.multiplyByPoint(p,g.positionMax,jYe);m.minimumByComponent(a,x,a),m.minimumByComponent(a,S,a),m.maximumByComponent(l,S,l),m.maximumByComponent(l,x,l);let V=Iw.buildModelDrawCommand(g,e);y.drawCommand=V}}this._boundingSphere=ue.fromCornerPoints(a,l,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Zd.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;c(n.color)&&t.push(Ey),!c(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(mW),n.isClippingEnabled()&&t.push(yW),n.isClippingPolygonsEnabled()&&t.push(_W),n.hasSilhouette(e)&&t.push(_w),c(n.splitDirection)&&n.splitDirection!==Ar.NONE&&t.push(Sw),mr.is3DTiles(n.type)&&t.push(aW),i&&t.push(dW))};Zd.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!c(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==se.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)}}};Zd.prototype.updateModelMatrix=function(e,t){Tce(this,e),t.mode!==se.SCENE3D&&zYe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Zd.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 Cce(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let l=0;l<r;l++){let d=t.getChild(l);Cce(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let l=0;l<a;l++){let d=s[l];i(d,o)}}function uk(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],l=e._runtimeNodes[a];Cce(e,l,t,n,i)}}var qYe={backFaceCulling:void 0};Zd.prototype.updateBackFaceCulling=function(e){let t=qYe;t.backFaceCulling=e,uk(this,!1,$Ye,t)};function $Ye(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var eHe={shadowMode:void 0};Zd.prototype.updateShadows=function(e){let t=eHe;t.shadowMode=e,uk(this,!1,tHe,t)};function tHe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var nHe={debugShowBoundingVolume:void 0};Zd.prototype.updateShowBoundingVolume=function(e){let t=nHe;t.debugShowBoundingVolume=e,uk(this,!1,iHe,t)};function iHe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Vce=[],oHe={frameState:void 0,hasSilhouette:void 0};Zd.prototype.pushDrawCommands=function(e){let t=Vce;t.length=0;let n=oHe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,uk(this,!0,rHe,n),e.commandList.push.apply(e.commandList,t)};function rHe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Vce,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Zd.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];c(r)&&r.setArticulationStage(o,t)};Zd.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var Ww=Zd;var j9n=_(T(),1);function wy(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Zt}Object.defineProperties(wy.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}}});wy.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()};wy.prototype.addBuffer=function(e,t){if(C.typeOf.object("buffer",e),C.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};wy.prototype.addTexture=function(e){C.typeOf.object("texture",e),this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};wy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};wy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};wy.prototype.addBatchTexture=function(e){C.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var ww=wy;var FMn=_(T(),1);var Gce=_(oN(),1);var dMn=_(T(),1);var Lce={},X_=Uint32Array.BYTES_PER_ELEMENT;Lce.parse=function(e,t){t=t??0,C.defined("arrayBuffer",e);let n=new Uint8Array(e),i=new DataView(e);t+=X_;let o=i.getUint32(t,!0);if(o!==1)throw new le(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=X_,t+=X_;let r=i.getUint32(t,!0);if(r===0)throw new le("Feature table must have a byte length greater than zero");t+=X_;let s=i.getUint32(t,!0);t+=X_;let a=i.getUint32(t,!0);t+=X_;let l=i.getUint32(t,!0);t+=X_;let d=er(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let f,p;a>0&&(f=er(n,t,a),t+=a,l>0&&(p=new Uint8Array(e,t,l),t+=l));let y=new of(d,u),h=y.getGlobalProperty("POINTS_LENGTH");if(y.featuresLength=h,!c(h))throw new le("Feature table global property: POINTS_LENGTH must be defined");let g=y.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(g)&&(g=m.unpack(g));let x=sHe(y,f);if(x.rtcCenter=g,x.pointsLength=h,!x.hasPositions){let S=aHe(y);x.positions=S,x.hasPositions=x.hasPositions||c(S)}if(!x.hasPositions)throw new le("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let S=lHe(y);x.normals=S,x.hasNormals=x.hasNormals||c(S)}if(!x.hasColors){let S=cHe(y);x.colors=S,x.hasColors=x.hasColors||c(S),x.hasConstantColor=c(x.constantColor),x.isTranslucent=c(S)&&S.isTranslucent}if(!x.hasBatchIds){let S=dHe(y);x.batchIds=S,x.hasBatchIds=x.hasBatchIds||c(S)}if(x.hasBatchIds){let S=y.getGlobalProperty("BATCH_LENGTH");if(!c(S))throw new le("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=S}return c(p)&&(p=new Uint8Array(p),x.batchTableJson=f,x.batchTableBinary=p),x};function sHe(e,t){let n=e.json,i,o,r,s=c(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=c(t)&&c(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;c(a)&&(r=a.properties);let l,d,u,f,p;if(c(s)){o=s.properties;let h=s.byteOffset,g=s.byteLength;if(!c(o)||!c(h)||!c(g))throw new le("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+g),l=c(o.POSITION),d=c(o.RGB)||c(o.RGBA),u=c(o.NORMAL),f=c(o.BATCH_ID),p=c(o.RGBA)}let y;return c(i)&&(y={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:St(o,r),dequantizeInShader:!0}),{draco:y,hasPositions:l,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:f}}function aHe(e){let t=e.json,n;if(c(t.POSITION))return n=e.getPropertyArray("POSITION",q.FLOAT,3),{name:pt.POSITION,semantic:pt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:q.FLOAT,type:rn.VEC3};if(c(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",q.FLOAT,3);if(!c(i))throw new le("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",q.FLOAT,3);if(!c(r))throw new le("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:pt.POSITION,semantic:pt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:q.FLOAT,type:rn.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:q.UNSIGNED_SHORT,quantizedType:rn.VEC3}}}function cHe(e){let t=e.json,n;if(c(t.RGBA))return n=e.getPropertyArray("RGBA",q.UNSIGNED_BYTE,4),{name:pt.COLOR,semantic:pt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(c(t.RGB))return n=e.getPropertyArray("RGB",q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(c(t.RGB565))return n=e.getPropertyArray("RGB565",q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.FLOAT,type:rn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(c(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",q.UNSIGNED_BYTE,4),o=i[3],r=Y.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:pt.COLOR,semantic:pt.COLOR,setIndex:0,constantColor:r,componentDatatype:q.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:s}}}function lHe(e){let t=e.json,n;if(c(t.NORMAL))return n=e.getPropertyArray("NORMAL",q.FLOAT,3),{name:pt.NORMAL,semantic:pt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:q.FLOAT,type:rn.VEC3};if(c(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",q.UNSIGNED_BYTE,2),{name:pt.NORMAL,semantic:pt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:rn.VEC2,quantizedComponentDatatype:q.UNSIGNED_BYTE,componentDatatype:q.FLOAT,type:rn.VEC3}}function dHe(e){let t=e.json;if(c(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",q.UNSIGNED_SHORT,1);return{name:pt.FEATURE_ID,semantic:pt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:q.fromTypedArray(n),type:rn.SCALAR}}}var I_=Lce;var uHe=Cn.Components,mHe=Cn.Scene,fHe=Cn.Node,hHe=Cn.Primitive,pHe=Cn.Attribute,Zce=Cn.Quantization,bHe=Cn.FeatureIdAttribute,yHe=Cn.Material,gHe=Cn.MetallicRoughness;function Py(e){e=e??z.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;C.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=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=xt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}c(Object.create)&&(Py.prototype=Object.create(Ji.prototype),Py.prototype.constructor=Py);Object.defineProperties(Py.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Py.prototype.load=function(){if(c(this._promise))return this._promise;this._parsedContent=I_.parse(this._arrayBuffer,this._byteOffset),this._state=xt.PROCESSING,this._promise=Promise.resolve(this)};Py.prototype.process=function(e){if(c(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===xt.READY)return!0;if(this._state===xt.PROCESSING){if(c(this._decodePromise))return!1;this._decodePromise=xHe(this,e.context)}return!1};function xHe(e,t){let i=e._parsedContent.draco,o;if(c(i)?o=eb.decodePointCloud(i,t):o=Promise.resolve(),!!c(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return c(r)&&_He(e,i,r),IHe(e,t),e._state=xt.READY,e}).catch(function(r){e.unload(),e._state=xt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function _He(e,t,n){e._state=xt.READY;let i=e._parsedContent,o;if(c(n.POSITION)){if(o={name:"POSITION",semantic:pt.POSITION,typedArray:n.POSITION.array,componentDatatype:q.FLOAT,type:rn.VEC3,isQuantized:!1},c(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,l=a.range,d=m.fromElements(l,l,l),u=m.unpack(a.minValues),f=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=f,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=f<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT,o.quantizedType=rn.VEC3}i.positions=o}if(c(n.NORMAL)){if(o={name:"NORMAL",semantic:pt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:q.FLOAT,type:rn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},c(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=rn.VEC2}i.normals=o}if(c(n.RGBA)?i.colors={name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isTranslucent:!0}:c(n.RGB)&&(i.colors={name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isTranslucent:!1}),c(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:pt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:q.fromTypedArray(a),type:rn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let l=n[a];c(r)||(r={}),i.hasDracoBatchTable=!0;let d=l.data;r[a]={byteOffset:d.byteOffset,type:THe(d.componentsPerAttribute),componentType:SHe(d.componentDatatype),typedArray:l.array}}i.batchTableJson=r}function THe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new L("componentsPerAttribute must be a number from 1-4")}}function SHe(e){switch(e){case oe.BYTE:return"BYTE";case oe.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case oe.SHORT:return"SHORT";case oe.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case oe.INT:return"INT";case oe.UNSIGNED_INT:return"UNSIGNED_INT";case oe.DOUBLE:return"DOUBLE";case oe.FLOAT:return"FLOAT";default:throw new L("value is not a valid WebGL constant")}}function Pw(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Zce,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Zce;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=m.ZERO;let l=t.quantizedVolumeScale;o.quantizedVolumeDimensions=l,o.quantizedVolumeStepSize=m.divideByScalar(l,a,new m),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new pHe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Fn.decodeRGB565(i)),c(t.constantColor)){let a=new Array(4);r.constant=Y.pack(t.constantColor,a)}else{let a=_t.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===pt.POSITION&&s&&(r.typedArray=i),r}var Rce,mk;function CHe(e){if(!c(mk)){Rce=new Gce.default(0),mk=new Array(e);for(let t=0;t<e;++t)mk[t]=Rce.random()}return mk}var VHe=new m,LHe=new m,ZHe=new m;function RHe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=CHe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=m.fromElements(s,s,s,VHe),d=m.fromElements(a,a,a,LHe),u,f,p;if(e.isQuantized)l=m.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)f=Math.floor(r[u]*i),p=m.unpack(t,f*3,ZHe),m.minimumByComponent(l,p,l),m.maximumByComponent(d,p,d);e.min=m.clone(l),e.max=m.clone(d)}var GHe={name:pt.COLOR,semantic:pt.COLOR,setIndex:0,constantColor:Y.DARKGRAY,componentDatatype:q.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:!1};function EHe(e,t,n){let i=[],o,r=t.positions;return c(r)&&(RHe(r),o=Pw(e,r,n),o.count=t.pointsLength,i.push(o)),c(t.normals)&&(o=Pw(e,t.normals,n),i.push(o)),c(t.colors)?(o=Pw(e,t.colors,n),i.push(o)):(o=Pw(e,GHe,n),i.push(o)),c(t.batchIds)&&(o=Pw(e,t.batchIds,n),i.push(o)),i}function XHe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!c(e.batchIds);return c(o)||e.hasDracoBatchTable?mb({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new Ds({schema:{},propertyTables:[]})}function IHe(e,t){let n=e._parsedContent,i=new gHe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new yHe;o.metallicRoughness=i;let r=n.colors;c(r)&&r.isTranslucent&&(o.alphaMode=Th.BLEND);let s=!c(n.normals);o.unlit=s;let a=new hHe;if(a.attributes=EHe(e,n,t),a.primitiveType=ve.POINTS,a.material=o,c(n.batchIds)){let y=new bHe;y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0",a.featureIds.push(y)}let l=new fHe;l.index=0,l.primitives=[a];let d=new mHe;d.nodes=[l],d.upAxis=Po.Z,d.forwardAxis=Po.X;let u=new uHe;u.scene=d,u.nodes=[l];let f=[];u.structuralMetadata=XHe(n,f),f.length>0&&WHe(e,a,f,t),c(n.rtcCenter)&&(u.transform=M.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;c(p)&&p.isQuantized&&(u.transform=M.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function WHe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=_t.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});l.vertexArrayDestroyable=!1,e._buffers.push(l),a.buffer=l,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Py.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 vw=Py;var nNn=_(T(),1);var wHe=new m,PHe=new m,vHe=new m,FHe=new M,AHe=new M,MHe=new M,NHe=new pe,kHe=new ue;function m1(e,t,n,i,o,r,s){if(C.typeOf.object("model",e),C.typeOf.object("ray",t),C.typeOf.object("frameState",n),!e._ready||n.mode===se.MORPHING)return;let a=Number.MAX_VALUE,l=e.sceneGraph,d=l._runtimeNodes;for(let u=0;u<d.length;u++){let f=d[u],p=f.node,y=M.clone(f.computedTransform,FHe),h=M.clone(l.computedModelMatrix,AHe),g=p.instances;c(g)&&g.transformInWorldSpace&&(h=M.multiplyTransformation(e.modelMatrix,l.components.transform,h),y=M.multiplyTransformation(l.axisCorrectionMatrix,f.computedTransform,y));let x=M.multiplyTransformation(h,y,MHe);n.mode!==se.SCENE3D&&(x=wt.basisTo2D(n.mapProjection,x,x));let S=[];if(c(g)){let Z=g.attributes[0].count,R=g.attributes[0].componentDatatype,E=12,I=f.transformsTypedArray;if(!c(I)){let v=f.instancingTransformsBuffer;c(v)&&n.context.webgl2&&(I=q.createTypedArray(R,Z*E),v.getBufferData(I))}if(c(I))for(let v=0;v<Z;v++){let P=v*E,F=new M(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);g.transformInWorldSpace?(M.multiplyTransformation(F,y,F),M.multiplyTransformation(h,F,F)):M.multiplyTransformation(F,x,F),S.push(F)}}S.length===0&&S.push(x);let V=f.runtimePrimitives.length;for(let Z=0;Z<V;Z++){let R=f.runtimePrimitives[Z],E=R.primitive;if(c(R.boundingSphere)&&!c(g)){let Q=ue.transform(R.boundingSphere,x,kHe),ie=qn.raySphere(t,Q);if(!c(ie))continue}let I=qt.getAttributeBySemantic(E,pt.POSITION),v=I.byteOffset,P=I.byteStride,F=I.count;if(!c(E.indices))continue;let N=E.indices.typedArray;if(!c(N)){let Q=E.indices.buffer,ie=E.indices.count,j=E.indices.indexDatatype;c(Q)&&n.context.webgl2&&(j===Me.UNSIGNED_BYTE?N=new Uint8Array(ie):j===Me.UNSIGNED_SHORT?N=new Uint16Array(ie):j===Me.UNSIGNED_INT&&(N=new Uint32Array(ie)),Q.getBufferData(N))}let b=I.typedArray,G=I.componentDatatype,X=I.type,W=I.quantization;c(W)&&(G=I.quantization.componentDatatype,X=I.quantization.type);let A=rn.getNumberOfComponents(X),k=q.getSizeInBytes(G),B=!c(b)&&c(P)&&P!==A*k,O=A,H=0;B&&(O=P/k,H=v/k);let U=F*O;if(!c(b)){let Q=I.buffer;c(Q)&&n.context.webgl2&&(b=q.createTypedArray(G,U),Q.getBufferData(b,B?0:v,0,U)),W&&I.normalized&&(b=Fn.dequantize(b,G,X,F))}if(!c(N)||!c(b))return;r=r??re.default,i=i??1,o=o??0;let K=N.length;for(let Q=0;Q<K;Q+=3){let ie=N[Q],j=N[Q+1],$=N[Q+2];for(let ne of S){let be=Az(b,ie,H,O,W,ne,i,o,r,wHe),Ce=Az(b,j,H,O,W,ne,i,o,r,PHe),me=Az(b,$,H,O,W,ne,i,o,r,vHe),_e=qn.rayTriangleParametric(t,be,Ce,me,e.backFaceCulling??!0);c(_e)&&_e<a&&_e>=0&&(a=_e)}}}}if(a!==Number.MAX_VALUE){if(s=bn.getPoint(t,a,s),n.mode!==se.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,p=u.unproject(s,NHe);f.cartographicToCartesian(p,s)}return s}}function Az(e,t,n,i,o,r,s,a,l,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],c(o))if(o.octEncoded){if(d=Fn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let f=d.x;d.x=d.z,d.z=d.y,d.y=f}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=M.multiplyByPoint(r,d,d),s!==1&&Lr.getPosition(d,l,s,a,d),d}function ao(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.loader",e.loader),C.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=e.type??mr.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=c(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=te.clone(te.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 iW(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=Y.clone(e.color),this._colorBlendMode=e.colorBlendMode??bc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??Y.RED;this._silhouetteColor=Y.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Xe.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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 ue,this._initialRadius=void 0,this._heightReference=e.heightReference??ze.NONE,this._heightDirty=this._heightReference!==ze.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;c(o)&&c(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Vh(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;c(s)&&s.owner===void 0?hs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;c(a)&&a.owner===void 0?qm.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=c(e.imageBasedLighting)?e.imageBasedLighting:new $x,this._shouldDestroyImageBasedLighting=!c(e.imageBasedLighting),this._environmentMapManager=void 0;let l=new sb(e.environmentMapOptions);sb.setOwner(l,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Sn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===mr.GLTF&&ht("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=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Ar.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??Y.BLACK,this._classificationType=e.classificationType,this._statistics=new ww,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new ye,this._readyEvent=new ye,this._texturesReadyEvent=new ye,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function Mz(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function UHe(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 sW({model:e,propertyTable:s});n.push(a)}return n}function OHe(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],c(a.instances)&&(s=qt.getFeatureIdsByLabel(a.instances.featureIds,i),c(s)&&c(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 l=a.primitives[r],d=qt.getFeatureIdsByLabel(l.featureIds,n);if(c(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function Uz(e,t){if(!c(e)&&!c(t))return!1;if(c(e)!==c(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(ao.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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){C.defined("pointCloudShading",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){if(c(e)&&e.far<=e.near)throw new L("far must be greater than near");this._distanceDisplayCondition=vt.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){Uz(e,this._color)&&this.resetDrawCommands(),this._color=Y.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(!Y.equals(e,this._silhouetteColor)){let t=Uz(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=Y.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(){if(!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");let e=c(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Ice(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===mr.GLTF&&ht("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}`),C.typeOf.string("value",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}`),C.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(hs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(qm.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){c(e)!==c(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){C.typeOf.object("imageBasedLighting",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){C.typeOf.object("environmentMapManager",e),e!==this.environmentMapManager&&(sb.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}}});ao.prototype.getNode=function(e){if(!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return C.typeOf.string("name",e),this._nodesByName[e]};ao.prototype.setArticulationStage=function(e,t){if(C.typeOf.number("value",t),!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)};ao.prototype.applyArticulations=function(){if(!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()};ao.prototype.getExtension=function(e){if(C.typeOf.string("extensionName",e),!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return this._loader.components.extensions[e]};ao.prototype.makeStyleDirty=function(){this._styleDirty=!0};ao.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var DHe=new M,BHe=new te,YHe=new M;ao.prototype.update=function(e){let t=!1;try{t=HHe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")Mz(this,n);else{let i=qt.getError("model",this._resource,n);Mz(this,i)}}if(zHe(this,e),KHe(this,e),JHe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!c(n)){if(this._loader.isUnloaded())return;let r=qt.getError("model",this._resource,new le("Failed to load model."));Mz(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;c(i)&&i.propertyTableCount>0&&UHe(this,i);let o=new Ww({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===se.MORPHING)){if(QHe(this),jHe(this),qHe(this,e),$He(this),eze(this,e),tze(this,e),nze(this,e),ize(this,e),oze(this,e),rze(this,e),sze(this,e),this._defaultTexture=e.context.defaultTexture,aze(this,e),cze(this,e),lze(this),dze(this,e),hze(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)),mze(this),pze(this,e),bze(this),yze(this,e)}};function HHe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function zHe(e,t){c(e._customShader)&&e._customShader.update(t)}function KHe(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=!c(e._imageBasedLighting.sphericalHarmonicCoefficients)||!c(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function JHe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function QHe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;c(n)&&n.propertyTableCount>0&&(e.featureTableId=OHe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function jHe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function qHe(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&&Xce(e)}function Xce(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=sf.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function $He(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 eze(e,t){e._silhouetteDirty&&(Wce(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function tze(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function nze(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 ize(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 oze(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function rze(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function sze(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 aze(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function cze(e,t){if(!M.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==se.SCENE3D&&e._projectTo2D)throw new L("Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix)}}var vy=new m,Nz=new pe;function lze(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;c(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!c(t)||e.heightReference===ze.NONE){if(e.heightReference!==ze.NONE)throw new L("Height reference is not supported without a scene.");e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??re.default,i=e.modelMatrix;vy.x=i[12],vy.y=i[13],vy.z=i[14];let o=n.cartesianToCartographic(vy);c(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M)),e._removeUpdateHeightCallback=t.updateHeight(o,Ece(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(c(r)){let s=Ece(e,n,o);pe.clone(o,Nz),Nz.height=r,s(Nz)}e._heightDirty=!1,e._updateModelMatrix=!0}function dze(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Ice(e,n),uze(e,n,t)}function Ice(e,t){e._clampedScale=c(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=ue.transform(e._boundingSphere,t,e._boundingSphere)}function uze(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);M.getTranslation(t,vy),e._sceneMode!==se.SCENE3D&&Oi.computeActualEllipsoidPosition(n,vy,vy);let s=e._boundingSphere.radius,a=gze(vy,s,n),l=1/a;Math.min(l*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=c(e.maximumScale)?Math.min(e.maximumScale,i):i}function mze(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 fze=new te(1,0,0,0,0,1,0,-1,0);function hze(e,t){let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=BHe,s=DHe;if(s=M.multiply(o.uniformState.view3D,i,s),r=M.getRotation(s,r),r=te.transpose(r,r),e._iblReferenceFrameMatrix=te.multiply(fze,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=YHe;a=M.multiply(o.uniformState.view3D,i,a),a=M.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function pze(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=c(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;c(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function bze(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(c(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 yze(e,t){let n=_ze(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&&(Tze(e,t),e._sceneGraph.pushDrawCommands(t))}var kz=new ue;function gze(e,t,n){return kz.center=e,kz.radius=t,n.camera.getPixelSize(kz,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var fk=new m;function Ece(e,t,n){return function(i){e.heightReference===ze.CLIP_TO_GROUND?n.height>=i.height&&(i.height=n.height):lC(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,fk);let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=fk.x,o[13]=fk.y,o[14]=fk.z,e._heightDirty=!0}}var xze=new m;function _ze(e,t){let n=e.distanceDisplayCondition;if(!c(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===se.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=M.getTranslation(e.modelMatrix,xze);Oi.computeActualEllipsoidPosition(t,s,s),r=m.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Tze(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}ao.prototype.isTranslucent=function(){let e=this.color;return c(e)&&e.alpha>0&&e.alpha<1};ao.prototype.isInvisible=function(){let e=this.color;return c(e)&&e.alpha===0};function Wce(e){return e.context.stencilBuffer}ao.prototype.hasSilhouette=function(e){return Wce(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!c(this._classificationType)};ao.prototype.hasSkipLevelOfDetail=function(e){if(!mr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};ao.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return c(e)&&e.enabled&&e.length!==0};ao.prototype.pick=function(e,t,n,i,o){return m1(this,e,t,n,i,o)};ao.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return c(e)&&e.enabled&&e.length!==0};ao.prototype.isDestroyed=function(){return!1};ao.prototype.destroy=function(){let e=this._loader;c(e)&&e.destroy();let t=this._featureTables;if(c(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),c(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;c(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;c(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,he(this)};ao.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};ao.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};ao.fromGltfAsync=async function(e){if(e=e??z.EMPTY_OBJECT,!c(e.url)&&!c(e.gltf))throw new L("options.url is required.");let t=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:c(e.classificationType)},i=e.basePath??"",o=Ge.createIfNeeded(i);c(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=Ge.createIfNeeded(t);let r=new nf(n),a=c(e.content)?mr.TILE_GLTF:mr.GLTF,l=n.gltfResource,d=Fw(r,a,e);d.resource=l,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(y){throw r.destroy(),qt.getError("model",l,y)}let u=e.gltfCallback;c(u)&&(C.typeOf.func("options.gltfCallback",u),u(r.gltfJson));let f=new ao(d),p=f._resource.credits;if(c(p)){let y=p.length;for(let h=0;h<y;h++)f._resourceCredits.push(Ct.clone(p[h]))}return f};ao.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:c(e.classificationType)},n=new KI(t);try{await n.load();let i=Fw(n,mr.TILE_B3DM,e);return new ao(i)}catch(i){throw n.destroy(),i}};ao.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new vw(t);try{await n.load();let i=Fw(n,mr.TILE_PNTS,e);return new ao(i)}catch(i){throw n.destroy(),i}};ao.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 jI(t);try{await n.load();let i=Fw(n,mr.TILE_I3DM,e);return new ao(i)}catch(i){throw n.destroy(),i}};ao.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new JI(t),i=Fw(n,mr.TILE_GEOJSON,e);return new ao(i)};var Sze=new Y;ao.prototype.applyColorAndShow=function(e){let t=Y.clone(this._color,Sze),n=c(e)&&c(e.color),i=c(e)&&c(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):Y.clone(Y.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,Uz(t,this._color)&&this.resetDrawCommands()};ao.prototype.applyStyle=function(e){let t=this.type===mr.TILE_PNTS,n=c(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=c(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=c(i)&&c(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Xce(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function Fw(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 af=ao;function Or(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(Or.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return c(t)&&c(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(c(t)&&c(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}}});Or.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Or.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Or.prototype.getExtension=function(e){return this._model.getExtension(e)};Or.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;if(!c(n))throw new L("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let i=t.featureTables[n];if(!c(i))throw new L("No feature table found for the selected feature ID set");let o=i.featuresLength;if(!c(e)||e<0||e>=o)throw new L(`featureId is required and must be between 0 and featuresLength - 1 (${o-1}).`);return i.getFeature(e)};Or.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return c(i)?n.featureTables[i].hasProperty(e,t):!1};Or.prototype.applyDebugSettings=function(e,t){t=e?t:Y.WHITE,this.featuresLength===0?this._model.color=t:c(this.batchTable)&&this.batchTable.setAllColor(t)};Or.prototype.applyStyle=function(e){this._model.style=e};Or.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,c(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),c(o)&&c(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;c(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),c(s)&&c(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Al.REPEAT}),this._ready=!0)};Or.prototype.isDestroyed=function(){return!1};Or.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),he(this)};Or.fromGltf=async function(e,t,n,i){let o=new Or(e,t,n),s=Aw(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let l=await af.fromGltfAsync(s);return o._model=l,o};Or.fromB3dm=async function(e,t,n,i,o){let r=new Or(e,t,n),a=Aw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=l;let d=await af.fromB3dm(a);return r._model=d,r};Or.fromI3dm=async function(e,t,n,i,o){let r=new Or(e,t,n),a=Aw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await af.fromI3dm(a);return r._model=l,r};Or.fromPnts=async function(e,t,n,i,o){let r=new Or(e,t,n),a=Aw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await af.fromPnts(a);return r._model=l,r};Or.fromGeoJson=async function(e,t,n,i){let o=new Or(e,t,n),s=Aw(e,t,o,{geoJson:i,resource:n}),a=await af.fromGeoJson(s);return o._model=a,o};Or.prototype.pick=function(e,t,n){if(!c(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,re.WGS84,n)};function Aw(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Xe.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 Rd=Or;var a5n=_(T(),1);function Au(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(Au.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}}});Au.fromJson=function(e,t,n,i){let o=new Au(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Au.prototype.hasProperty=function(e,t){return!1};Au.prototype.getFeature=function(e){};Au.prototype.applyDebugSettings=function(e,t){};Au.prototype.applyStyle=function(e){};Au.prototype.update=function(e,t){};Au.prototype.pick=function(e,t,n){};Au.prototype.isDestroyed=function(){return!1};Au.prototype.destroy=function(){return he(this)};var Mw=Au;var f3n=_(T(),1);var pDn=_(T(),1);var Ikn=_(T(),1);var l5n=_(T(),1),Nw=`uniform sampler2D u_atlas; +#endif +} +`;function axe(){}axe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=Not(e,n,t),o=Yot(e,i,t),r=e.model;return l(r.classificationType)?new qP({primitiveRenderResources:e,command:o}):new $P({primitiveRenderResources:e,command:o})};function Not(e,t,n){t.addVertexLines(eX),t.addFragmentLines(tX);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function Yot(e,t,n){let i=wot(e),o=new Un({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===se.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=P.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new P),u=e.runtimePrimitive.boundingSphere2D;else{let Z=c?a._computedModelMatrix:a._computedModelMatrix2D;d=P.multiplyTransformation(Z,e.runtimeNode.computedTransform,new P),u=de.transform(e.boundingSphere,d)}let m=$e(ze.fromCache(e.renderStateOptions),!0);m.cull.face=Zt.getCullFace(d,e.primitiveType),m=ze.fromCache(m);let p=l(r.classificationType),b=p?!1:vn.castShadows(r.shadows),f=p?!1:vn.receiveShadows(r.shadows),y=p?void 0:e.pickId,_=p?void 0:e.snapId;return new lt({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:m,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,snapId:_,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:b,receiveShadows:f})}function wot(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var nX=axe;function dl(e){e=e??B.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._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=P.clone(P.IDENTITY),this._computedModelMatrix2D=P.clone(P.IDENTITY),this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P),this._runtimeArticulations={},Mot(this)}Object.defineProperties(dl.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 Mot(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;cxe(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let Z=0;Z<s;Z++){let R=r[Z],C=new lI({articulation:R,sceneGraph:e}),E=C.name;a[E]=C}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let m=n.nodes.length,p=P.IDENTITY;for(let Z=0;Z<m;Z++){let R=n.nodes[Z],C=lxe(e,R,p);e._rootNodes.push(C)}let b=t.skins,f=e._runtimeSkins,y=b.length;for(let Z=0;Z<y;Z++){let R=b[Z];f.push(new wP({skin:R,sceneGraph:e}))}let _=e._skinnedNodes,S=_.length;for(let Z=0;Z<S;Z++){let R=_[Z],C=e._runtimeNodes[R],A=c[R].skin.index;C._runtimeSkin=f[A],C.updateJointMatrices()}e.applyArticulations()}function cxe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=P.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=P.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=P.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var kot=new h;function Uot(e,t){let n=e._computedModelMatrix,i=P.getTranslation(n,kot);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=_t.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=_t.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=P.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=de.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function lxe(e,t,n){let i=[],o=Zt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=P.multiplyTransformation(n,o,new P),b=lxe(e,m,p);i.push(b)}let s=new EI({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 YP({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,m=new xI(u,s);u._nodesByName[d]=m}return c}var Dot=new h,Oot=new h,Bot=new h,zot=new h;dl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};dl.prototype.buildRenderResources=function(e){let t=this._model,n=new UP(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let s=r.pipelineStages,a=new KP(n,r);n.nodeRenderResources[o]=a;for(let c=0;c<s.length;c++)s[c].process(a,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c];d.configurePipeline(e);let u=d.pipelineStages,m=new jP(a,d);a.primitiveRenderResources[c]=m;for(let p=0;p<u.length;p++)u[p].process(m,d.primitive,e)}}return n};dl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Dot),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Oot);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let s=e.nodeRenderResources[o],a=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c],u=s.primitiveRenderResources[c];d.boundingSphere=de.clone(u.boundingSphere,new de);let m=P.multiplyByPoint(a,u.positionMin,Bot),p=P.multiplyByPoint(a,u.positionMax,zot);h.minimumByComponent(n,m,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,m,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=de.fromCornerPoints(n,i,new de),this._boundingSphere=de.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=de.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=de.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};dl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let s=i.runtimePrimitives[r],a=o.primitiveRenderResources[r],c=nX.buildModelDrawCommand(a,t);s.drawCommand=c}}};dl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(fx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(aI),n.isClippingEnabled()&&t.push(mI);let o=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&o&&t.push(pI),n.hasDrapedVectors()&&t.push(yI),n.hasSilhouette(e)&&t.push(BP),l(n.splitDirection)&&n.splitDirection!==Mr.NONE&&t.push(HP),Or.is3DTiles(n.type)&&t.push(nI),i&&t.push(rI)};dl.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!==se.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)}}};dl.prototype.updateModelMatrix=function(e,t){cxe(this,e),t.mode!==se.SCENE3D&&Uot(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};dl.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 dxe(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);dxe(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 dB(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];dxe(e,c,t,n,i)}}var Hot={backFaceCulling:void 0};dl.prototype.updateBackFaceCulling=function(e){let t=Hot;t.backFaceCulling=e,dB(this,!1,Kot,t)};function Kot(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Jot={shadowMode:void 0};dl.prototype.updateShadows=function(e){let t=Jot;t.shadowMode=e,dB(this,!1,jot,t)};function jot(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var Qot={debugShowBoundingVolume:void 0};dl.prototype.updateShowBoundingVolume=function(e){let t=Qot;t.debugShowBoundingVolume=e,dB(this,!1,qot,t)};function qot(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var uxe=[],mxe=[],hxe=[],$ot={frameState:void 0,hasSilhouette:void 0};dl.prototype.pushDrawCommands=function(e){let t=uxe;t.length=0;let n=mxe;n.length=0;let i=hxe;i.length=0;let o=$ot;o.hasSilhouette=this._model.hasSilhouette(e),o.frameState=e,dB(this,!0,ert,o),ii(e.commandList,t),ii(e.commandList,n),ii(e.commandList,i)};function ert(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=uxe,s=mxe,a=hxe,c=e.drawCommand;c.pushCommands(n,n.commandList);let d=e.primitive.material;l(d)&&l(d.planarFill)&&(n.planarFillRequested=!0),i&&!o.pick&&c.pushSilhouetteCommands(n,r),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}dl.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)};dl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var iX=dl;var Joi=x(T(),1);function xx(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Mt}Object.defineProperties(xx.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}}});xx.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()};xx.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};xx.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};xx.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};xx.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};xx.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var oX=xx;var vri=x(T(),1);var gxe=x(Q5(),1);var cri=x(T(),1);var fxe={},pS=Uint32Array.BYTES_PER_ELEMENT;fxe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=pS;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+=pS,t+=pS;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=pS;let s=i.getUint32(t,!0);t+=pS;let a=i.getUint32(t,!0);t+=pS;let c=i.getUint32(t,!0);t+=pS;let d=vr(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=vr(n,t,a),Object.keys(m).length===0&&(m=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let b=new cf(d,u),f=b.getGlobalProperty("POINTS_LENGTH");if(b.featuresLength=f,!l(f))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=b.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(y)&&(y=h.unpack(y));let _=nrt(b,m);if(_.rtcCenter=y,_.pointsLength=f,!_.hasPositions){let S=irt(b);_.positions=S,_.hasPositions=_.hasPositions||l(S)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let S=rrt(b);_.normals=S,_.hasNormals=_.hasNormals||l(S)}if(!_.hasColors){let S=ort(b);_.colors=S,_.hasColors=_.hasColors||l(S),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(S)&&S.isTranslucent}if(!_.hasBatchIds){let S=srt(b);_.batchIds=S,_.hasBatchIds=_.hasBatchIds||l(S)}if(_.hasBatchIds){let S=b.getGlobalProperty("BATCH_LENGTH");if(!l(S))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=S}return(l(m)||l(p))&&(_.batchTableJson=m,_.batchTableBinary=p),trt(_),_};function trt(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let a=t[r].byteOffset;l(a)&&(i.includes(r)||o.push(r))}for(let r of o)xt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function nrt(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,m,p;if(l(s)){o=s.properties;let f=s.byteOffset,y=s.byteLength;if(!l(o)||!l(f)||!l(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+y),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),m=l(o.BATCH_ID),p=l(o.RGBA)}let b;return l(i)&&(b={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:It(o,r),dequantizeInShader:!0}),{draco:b,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function irt(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",J.FLOAT,3),{name:dt.POSITION,semantic:dt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:J.FLOAT,type:Dt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",J.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",J.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",J.FLOAT,3);if(!l(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:dt.POSITION,semantic:dt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:J.FLOAT,type:Dt.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:J.UNSIGNED_SHORT,quantizedType:Dt.VEC3}}}function ort(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",J.UNSIGNED_BYTE,4),{name:dt.COLOR,semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",J.UNSIGNED_BYTE,3),{name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",J.UNSIGNED_SHORT,1),{name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.FLOAT,type:Dt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",J.UNSIGNED_BYTE,4),o=i[3],r=U.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:r,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:s}}}function rrt(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",J.FLOAT,3),{name:dt.NORMAL,semantic:dt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:J.FLOAT,type:Dt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",J.UNSIGNED_BYTE,2),{name:dt.NORMAL,semantic:dt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Dt.VEC2,quantizedComponentDatatype:J.UNSIGNED_BYTE,componentDatatype:J.FLOAT,type:Dt.VEC3}}function srt(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",J.UNSIGNED_SHORT,1);return{name:dt.FEATURE_ID,semantic:dt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:J.fromTypedArray(n),type:Dt.SCALAR}}}var bS=fxe;var art=Vn.Components,crt=Vn.Scene,lrt=Vn.Node,drt=Vn.Primitive,urt=Vn.Attribute,pxe=Vn.Quantization,mrt=Vn.FeatureIdAttribute,hrt=Vn.Material,frt=Vn.MetallicRoughness,j7=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Rt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=bS.parse(this._arrayBuffer,this._byteOffset),this._state=Rt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Rt.READY)return!0;if(this._state===Rt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=prt(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function prt(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Eb.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&brt(e,i,r),Ert(e,t),e._state=Rt.READY,e}).catch(function(r){e.unload(),e._state=Rt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function brt(e,t,n){e._state=Rt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:dt.POSITION,typedArray:n.POSITION.array,componentDatatype:J.FLOAT,type:Dt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=h.fromElements(c,c,c),u=h.unpack(a.minValues),m=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=m,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=m<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT,o.quantizedType=Dt.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:dt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:J.FLOAT,type:Dt.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=J.UNSIGNED_BYTE,o.quantizedType=Dt.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:dt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:J.fromTypedArray(a),type:Dt.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:grt(d.componentsPerAttribute),componentType:yrt(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function grt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function yrt(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 rX(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new pxe,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new pxe;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new urt;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=dn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=U.pack(t.constantColor,a)}else{let a=ot.createVertexBuffer({typedArray:i,context:n,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===dt.POSITION&&s&&(r.typedArray=i),r}var bxe,uB;function xrt(e){if(!l(uB)){bxe=new gxe.default(0),uB=new Array(e);for(let t=0;t<e;++t)uB[t]=bxe.random()}return uB}var Trt=new h,_rt=new h,Srt=new h;function Zrt(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=xrt(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Trt),d=h.fromElements(a,a,a,_rt),u,m,p;if(e.isQuantized)c=h.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)m=Math.floor(r[u]*i),p=h.unpack(t,m*3,Srt),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var Rrt={name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:!1};function Crt(e,t,n){let i=[],o,r=t.positions;return l(r)&&(Zrt(r),o=rX(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=rX(e,t.normals,n),o.count=t.pointsLength,i.push(o)),l(t.colors)?(o=rX(e,t.colors,n),o.count=t.pointsLength,i.push(o)):(o=rX(e,Rrt,n),o.count=t.pointsLength,i.push(o)),l(t.batchIds)&&(o=rX(e,t.batchIds,n),o.count=t.pointsLength,i.push(o)),i}function Vrt(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,s=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?wb({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:s,customAttributeOutput:t}):new wa({schema:{},propertyTables:[]})}function Ert(e,t){let n=e._parsedContent,i=new frt;i.metallicFactor=0,i.roughnessFactor=.9;let o=new hrt;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=wp.BLEND);let s=!l(n.normals);o.unlit=s;let a=new drt;if(a.attributes=Crt(e,n,t),a.primitiveType=Ie.POINTS,a.material=o,l(n.batchIds)){let b=new mrt;b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0",a.featureIds.push(b)}let c=new lrt;c.index=0,c.primitives=[a];let d=new crt;d.nodes=[c],d.upAxis=Bi.Z,d.forwardAxis=Bi.X;let u=new art;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=Vrt(n,m),m.length>0&&Art(e,a,m,t),l(n.rtcCenter)&&(u.transform=P.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=P.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function Art(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=ot.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Pe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}var sX=j7;var Jri=x(T(),1);var mB=new h,yxe=new h,xxe=new h,aX=new h,Grt=new h,Lrt=new h,Wrt=new pe,vrt=new de;function hB(e,t,n,i){let o=t*n;return i.x=e[o],i.y=e[o+1],i.z=e[o+2],i}var Frt=32,Q7=new Map,q7=[];function Irt(e,t,n,i,o,r){let s=e.origin.x,a=e.origin.y,c=e.origin.z,d=e.direction.x,u=e.direction.y,m=e.direction.z,p=W.EPSILON6;for(let b=0;b<i;b+=3){let f=n[b]*3,y=n[b+1]*3,_=n[b+2]*3,S=t[f],Z=t[f+1],R=t[f+2],C=t[y]-S,E=t[y+1]-Z,A=t[y+2]-R,L=t[_]-S,F=t[_+1]-Z,I=t[_+2]-R,N=u*I-m*F,g=m*L-d*I,V=d*F-u*L,G=C*N+E*g+A*V,v=s-S,X=a-Z,Y=c-R,D;if(o){if(G<p)continue;let w=v*N+X*g+Y*V;if(w<0||w>G)continue;let O=X*A-Y*E,M=Y*C-v*A,z=v*E-X*C,K=d*O+u*M+m*z;if(K<0||w+K>G)continue;D=(L*O+F*M+I*z)/G}else{if(Math.abs(G)<p)continue;let w=1/G,O=(v*N+X*g+Y*V)*w;if(O<0||O>1)continue;let M=X*A-Y*E,z=Y*C-v*A,K=v*E-X*C,te=(d*M+u*z+m*K)*w;if(te<0||O+te>1)continue;D=(L*M+F*z+I*K)*w}D>=0&&D<r&&(r=D)}return r}function kC(e,t,n,i,o,r,s){if(!e._ready||n.mode===se.MORPHING)return;let a=Number.MAX_VALUE;r=r??ne.default,i=i??1,o=o??0;let c=n.mode!==se.SCENE3D?n.mapProjection:void 0;if(xa.forEachPrimitive(e,{mapProjection:c},function(d,u,m,p){if(l(d.boundingSphere)&&m.length===1){let R=de.transform(d.boundingSphere,p,vrt),C=yi.raySphere(t,R);if(!l(C))return}if(!l(u.indices))return;let b,f,y=Zt.getAttributeBySemantic(u,dt.POSITION),_=Q7.get(u);l(_)||(_={},l(y)&&(_.vertices=xa.readAttributeAsTypedArray(y)),l(u.indices)&&(_.indices=xa.readIndicesAsTypedArray(u.indices)),Q7.set(u,_),q7.push(u),q7.length>Frt&&Q7.delete(q7.shift())),l(y)&&(f=Dt.getNumberOfComponents(y.type),b=_.vertices);let S=_.indices;if(!l(S)||!l(b))return;let Z=S.length;if(m.length===1&&i===1){let R=m[0].transform;if(!l(_.world)||!P.equals(_.worldTransform,R)){let L=b.length/f,F=new Float64Array(L*3);for(let I=0;I<L;I++)hB(b,I,f,mB),P.multiplyByPoint(R,mB,aX),F[I*3]=aX.x,F[I*3+1]=aX.y,F[I*3+2]=aX.z;_.world=F,_.worldTransform=P.clone(R,_.worldTransform)}let C=_.world,E=e.backFaceCulling??!0,A=Irt(t,C,S,Z,E,a);A<a&&(a=A);return}for(let R=0;R<Z;R+=3){let C=S[R],E=S[R+1],A=S[R+2];hB(b,C,f,mB),hB(b,E,f,yxe),hB(b,A,f,xxe);for(let L of m){let F=P.multiplyByPoint(L.transform,mB,aX),I=P.multiplyByPoint(L.transform,yxe,Grt),N=P.multiplyByPoint(L.transform,xxe,Lrt);i!==1&&(_o.getPosition(F,r,i,o,F),_o.getPosition(I,r,i,o,I),_o.getPosition(N,r,i,o,N));let g=yi.rayTriangleParametric(t,F,I,N,e.backFaceCulling??!0);l(g)&&g<a&&g>=0&&(a=g)}}}),a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==se.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let d=n.mapProjection,u=d.ellipsoid,m=d.unproject(s,Wrt);u.cartographicToCartesian(m,s)}return s}}var osi=x(T(),1);var Qri=x(T(),1),$7=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},cX=$7;var eq=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let s=n[r],a=s.runtimeNode,c=s.runtimePrimitive,d=new mS(t,a,c);c.primitive.modelPrimitiveImagery=d,i.push(d)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let s=i[r];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];o.push({runtimeNode:s,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new ge("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),s=i[o];if(r.show!==s.show||r.alpha!==s.alpha||r.brightness!==s.brightness||r.contrast!==s.contrast||r.hue!==s.hue||r.saturation!==s.saturation||r.gamma!==s.gamma||r.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new cX(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),me(this)}},lX=eq;function Vo(e){e=e??B.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Or.GLTF,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=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=q.clone(q.IDENTITY),this._clippingPlanesMatrix=P.clone(P.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 $F(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=U.clone(e.color),this._colorBlendMode=e.colorBlendMode??al.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??U.RED;this._silhouetteColor=U.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Le.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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 de,this._initialRadius=void 0,this._heightReference=e.heightReference??He.NONE,this._heightDirty=this._heightReference!==He.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;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 Up(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Wc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,_xe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new re,this._modelImagery=new lX(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Y_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Fb(e.environmentMapOptions);Fb.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??vn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Mm.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Or.GLTF&&xt("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 Lt(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Mr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new oX,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new Se,this._readyEvent=new Se,this._texturesReadyEvent=new Se,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function tq(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Prt(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 tI({model:e,propertyTable:s});n.push(a)}return n}function Xrt(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=Zt.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=Zt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function oq(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(Vo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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=Ot.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){oq(e,this._color)&&this.resetDrawCommands(),this._color=U.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(!U.equals(e,this._silhouetteColor)){let t=oq(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=U.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}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Zxe(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===Or.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},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&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Wc.setOwner(e,this,"_clippingPolygons"),_xe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Wc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.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&&(Fb.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}}});Vo.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ne.default,re.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};Vo.prototype.getNode=function(e){return this._nodesByName[e]};Vo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Vo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Vo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Vo.prototype.makeStyleDirty=function(){this._styleDirty=!0};Vo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Nrt=new P,Yrt=new q,wrt=new P;Vo.prototype.update=function(e){let t=!1;try{t=Mrt(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")tq(this,i);else{let o=Zt.getError("model",this._resource,i);tq(this,o)}}if(krt(this,e),Urt(this,e),Drt(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=Zt.getError("model",this._resource,new ae("Failed to load model."));tq(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&Prt(this,o);let r=new iX({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===se.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(Ort(this),Brt(this),zrt(this,e),Hrt(this),Krt(this,e),Jrt(this,e),jrt(this,e),Qrt(this,e),est(this,e),tst(this,e),nst(this,e),ist(this,e),this._defaultTexture=e.context.defaultTexture,ost(this,e),rst(this,e),lst(this),dst(this,e),fst(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)),mst(this),pst(this,e),bst(this),yst(this,e)}};function Mrt(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function krt(e,t){l(e._customShader)&&e._customShader.update(t)}function Urt(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 Drt(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Ort(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Xrt(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Brt(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function zrt(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&&Txe(e)}function Txe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=df.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Hrt(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 Krt(e,t){e._silhouetteDirty&&(Rxe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Jrt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function jrt(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 _xe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function Qrt(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),o=0;i&&(n.owner===e&&n.update(t),o=n.clippingPolygonsState),o!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=o);let r=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(Wc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;r!==s&&e.resetDrawCommands()}var qrt=new re;function Sxe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function $rt(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function est(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===se.SCENE3D){let r=e._content?.tile?.contentBoundingVolume.rectangle??re.fromBoundingSphere(e.boundingSphere,n.ellipsoid,qrt);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(r,t.context,e._vectorData,He.CLAMP_TO_3D_TILE):n.requestDataForRectangle(r,t.context,He.CLAMP_TO_3D_TILE)}else Sxe(e);let o=$rt(e._vectorData);o!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=o)}function tst(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function nst(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function ist(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 ost(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function rst(e,t){P.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=P.clone(e.modelMatrix,e._modelMatrix))}var Tx=new h,nq=new pe,sst=new pe,ast=200,cst=30;function lst(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)){e._updateModelMatrix=!0;return}let t=e._scene;if(!l(t)||e.heightReference===He.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ne.default,i=e.modelMatrix;Tx.x=i[12],Tx.y=i[13],Tx.z=i[14];let o=n.cartesianToCartographic(Tx,sst);l(e._clampedModelMatrix)||(e._clampedModelMatrix=P.clone(i,new P));let r=t.frameState.frameNumber,s=e.heightReference===He.CLIP_TO_GROUND,a=r-e._lastSurfaceQueryFrame<cst,c=s&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+ast,d=c&&a,u=s&&a&&e._lastSurfaceQueryMissed,m=u&&l(e._removeUpdateHeightCallback),p=Rst(e,n,o);c?l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0):m||(l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=t.updateHeight(o,f=>{e._lastSurfaceHeight=f.height,p(f)},e.heightReference));let b;d||u?b=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=r,b=t.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(b),l(b)?e._lastSurfaceHeight=b:b=e._lastSurfaceHeight),l(b)?(pe.clone(o,nq),nq.height=b,p(nq)):P.clone(i,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function dst(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Zxe(e,n),ust(e,n,t)}function Zxe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=de.transform(e._boundingSphere,t,e._boundingSphere)}function ust(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);P.getTranslation(t,Tx),e._sceneMode!==se.SCENE3D&&fo.computeActualEllipsoidPosition(n,Tx,Tx);let s=e._boundingSphere.radius,a=xst(Tx,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 mst(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 hst=new q(1,0,0,0,0,1,0,-1,0);function fst(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=Yrt,s=Nrt;if(s=P.multiply(o.uniformState.view3D,i,s),r=P.getRotation(s,r),r=q.transpose(r,r),e._iblReferenceFrameMatrix=q.multiply(hst,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=P.multiply(i,e._clippingPlanes.modelMatrix,wrt);e._clippingPlanesMatrix=P.inverseTranspose(a,e._clippingPlanesMatrix)}}function pst(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&&(e._clippingPolygonsNeedRebake=!0),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)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function bst(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Lt.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=Lt.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=Lt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function gst(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function yst(e,t){let n=Vst(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o)&&!gst(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Est(e,t),e._sceneGraph.pushDrawCommands(t))}var iq=new de;function xst(e,t,n){return iq.center=e,iq.radius=t,n.camera.getPixelSize(iq,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var fB=new h,Tst=new h,pB=new h,_st=new h,Sst=new P;function Zst(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let o=i._positionMin,r=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,_st),a=P.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Sst),c=e._computedScale,d=e.modelMatrix,u=0;for(let m=0;m<8;m++){let p=h.fromElements(m&1?r.x:o.x,m&2?r.y:o.y,m&4?r.z:o.z,Tst);h.multiplyByScalar(p,c,p),P.multiplyByPoint(a,p,pB),P.multiplyByPointAsVector(d,pB,pB);let b=h.dot(pB,s);b<u&&(u=b)}return-u}function Rst(e,t,n){return function(i){if(e.heightReference===He.CLIP_TO_GROUND){let r=i.height+Zst(e,t,i);e._heightAboveSurface=Math.max(0,n.height-r),i.height=Math.max(n.height,r)}else Ly(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,fB);let o=e._clampedModelMatrix;P.clone(e.modelMatrix,o),o[12]=fB.x,o[13]=fB.y,o[14]=fB.z,e._heightDirty=!0}}var Cst=new h;function Vst(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===se.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=P.getTranslation(e.modelMatrix,Cst);fo.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Est(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Vo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Vo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Rxe(e){return e.context.stencilBuffer}Vo.prototype.hasSilhouette=function(e){return Rxe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Vo.prototype.hasSkipLevelOfDetail=function(e){if(!Or.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Vo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Vo.prototype.pick=function(e,t,n,i,o){return kC(this,e,t,n,i,o)};Vo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Vo.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Vo.prototype.isDestroyed=function(){return!1};Vo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let o=t.length;for(let r=0;r<o;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),Sxe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&Wc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,me(this)};Vo.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};Vo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Vo.fromGltfAsync=async function(e){e=e??B.EMPTY_OBJECT;let t=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=e.basePath??"",o=ve.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=ve.createIfNeeded(t);let r=new Lu(n),a=l(e.content)?Or.TILE_GLTF:Or.GLTF,c=n.gltfResource,d=dX(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(b){throw r.destroy(),Zt.getError("model",c,b)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let m=new Vo(d),p=m._resource.credits;if(l(p)){let b=p.length;for(let f=0;f<b;f++)m._resourceCredits.push(Lt.clone(p[f]))}return m};Vo.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 OF(t);try{await n.load();let i=dX(n,Or.TILE_B3DM,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new sX(t);try{await n.load();let i=dX(n,Or.TILE_PNTS,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.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 HF(t);try{await n.load();let i=dX(n,Or.TILE_I3DM,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new BF(t),i=dX(n,Or.TILE_GEOJSON,e);return new Vo(i)};var Ast=new U;Vo.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,Ast),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):U.clone(U.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,oq(t,this._color)&&this.resetDrawCommands()};Vo.prototype.applyStyle=function(e){let t=this.type===Or.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),Txe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function dX(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,edgeDisplayMode:n.edgeDisplayMode,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 Nu=Vo;var rq=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,o=i.featureTableId;return l(o)?i.featureTables[o].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:U.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,o=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=o.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let r=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(r)&&o.clippingPlanesDirty&&(i._clippingPlanes=r.enabled&&o._isClipped?r:void 0);let s=t.environmentMapManager;i.environmentMapManager!==r&&(i._environmentMapManager=s),l(r)&&l(i._clippingPlanes)&&i._clippingPlanes!==r&&(i._clippingPlanes=r,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&o.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&o._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),o.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:Yd.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),me(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=uX(t,n,r,{gltf:o,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let d=await Nu.fromGltfAsync(a);return r._model=d,r}static async fromB3dm(t,n,i,o,r){let s=new e(t,n,i),c=uX(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=d;let u=await Nu.fromB3dm(c);return s._model=u,s}static async fromI3dm(t,n,i,o,r){let s=new e(t,n,i),c=uX(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=await Nu.fromI3dm(c);return s._model=d,s}static async fromPnts(t,n,i,o,r){let s=new e(t,n,i),c=uX(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=await Nu.fromPnts(c);return s._model=d,s}static async fromGeoJson(t,n,i,o){let r=new e(t,n,i),a=uX(t,n,r,{geoJson:o,resource:i}),c=await Nu.fromGeoJson(a);return r._model=c,r}pick(t,n,i){if(!l(this._model)||!this._ready)return;let o=n.verticalExaggeration,r=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,o,r,ne.WGS84,i)}};function uX(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Le.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,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 It(i,o)}var Yu=rq;var lai=x(T(),1);var sq=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,o){let r=new e(t,n,i);return r._tileset.loadTileset(r._resource,o,r._tile),r._ready=!0,r}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return me(this)}},mX=sq;var Fhi=x(T(),1);var Yui=x(T(),1);var rli=x(T(),1);var yai=x(T(),1);function Ua(e,t,n,i){let o=Ua._verifyAttributes(t);n=n??0;let r=[],s={},a,c,d=o.length;for(let m=0;m<d;++m){let p=o[m];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function u(m,p){return J.getSizeInBytes(p.componentDatatype)-J.getSizeInBytes(m.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let m=Ua._vertexSizeInBytes(a),p=a[0].usage,b={vertexSizeInBytes:m,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ua._createArrayViews(a,m)};this._allBuffers.push(b)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ua._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??J.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Pe.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};Ua._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*J.getSizeInBytes(a.componentDatatype)}let i=n>0?J.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ua._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/J.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*J.getSizeInBytes(a)}return n};Ua.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];Ua._resize(o,this._size),Ua._appendWriters(this.writers,o)}aq(this)};Ua._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=J.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var Gst=[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}}];Ua._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]=Gst[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ua.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=Lst(this,i)||t;if(t||!l(this.va)){aq(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 m=d*(i.vertexSizeInBytes*a);Ua._appendAttributes(u,i,m,this._instanced)}u=u.concat(this._precreated),s.push({va:new Un({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function Lst(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=ot.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ua._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})}};Ua.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)Wst(n[i],e,t)};function Wst(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)}}Ua.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function aq(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}Ua.prototype.isDestroyed=function(){return!1};Ua.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 aq(this),me(this)};var Qb=Ua;var Tai=x(T(),1),hX=`uniform sampler2D u_atlas; +uniform float u_coarseDepthTestDistance; +uniform float u_threePointDepthTestDistance; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_textureCoordinates; in vec4 v_pickColor; in vec4 v_color; -in float v_splitDirection; +flat in vec2 v_splitDirectionAndEllipsoidDepthEC; #ifdef SDF in vec4 v_outlineColor; in float v_outlineWidth; #endif -#ifdef FRAGMENT_DEPTH_CHECK -in vec4 v_textureCoordinateBounds; -in vec4 v_originTextureCoordinateAndTranslate; in vec4 v_compressed; -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)); -vec2 translation = v_originTextureCoordinateAndTranslate.zw; -if (applyTranslate) +float getGlobeDepthAtCoords(vec2 st) { -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) { @@ -5301,7 +6869,6 @@ return 0.0; vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); return eyeCoordinate.z / eyeCoordinate.w; } -#endif #ifdef SDF float getDistance(vec2 position) { @@ -5325,11 +6892,68 @@ return vec4(v_color.rgb, v_color.a * alpha); } } #endif +bool getDepthTestEnabled() { +float temp = v_compressed.y; +temp = temp * SHIFT_RIGHT1; +float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; +return temp2 != 0.0; +} +float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) { +float depthDifferential = eyeDepth - distanceToEllipsoid; +float depthRatio = abs(depthDifferential / distanceToEllipsoid); +if (depthRatio < epsilon) { +return 0.0; +} +return depthDifferential; +} +void doDepthTest(float eyeDepth, float globeDepth) { +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (eyeDepth > -u_threePointDepthTestDistance) { +if (eyeDepth == 0.0) { +discard; +} +return; +} +#endif +bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; +if (useGlobeDepth && globeDepth == 0.0) { +return; +} +if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { +discard; +} +} +#ifdef LOG_DEPTH +void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) { +float depthArg = v_depthFromNearPlusOne; +if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) { +float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0; +float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7); +float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge); +depthArg = min(depthArg, globeOnTop); +} +czm_writeLogDepth(depthArg); +} +#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); +if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { +discard; +} +if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) { +discard; +} +if (getDepthTestEnabled()) { +vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw; +float eyeDepth = v_compressed.x; +float globeDepth = getGlobeDepthAtCoords(fragSt); +float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y; +doDepthTest(eyeDepth, globeDepth); +#ifdef LOG_DEPTH +writeDepth(eyeDepth, globeDepth, distanceToEllipsoid); +#endif +} +vec4 color = texture(u_atlas, v_textureCoordinates); #ifdef SDF float outlineWidth = v_outlineWidth; vec4 outlineColor = v_outlineColor; @@ -5374,48 +6998,9 @@ discard; 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); -if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) -{ -float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) -{ -float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) -{ -discard; -} } -} -} -#endif -} -`;var u5n=_(T(),1),kw=`#ifdef INSTANCED +`;var Sai=x(T(),1),fX=`uniform float u_threePointDepthTestDistance; in vec2 direction; -#endif in vec4 positionHighAndScale; in vec4 positionLowAndRotation; in vec4 compressedAttribute0; @@ -5427,22 +7012,17 @@ in vec4 pixelOffsetScaleByDistance; in vec4 compressedAttribute3; in vec2 sdf; in float splitDirection; -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) +#ifdef VS_THREE_POINT_DEPTH_CHECK in vec4 textureCoordinateBoundsOrLabelTranslate; #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; -out mat2 v_rotationMatrix; -#endif out vec4 v_pickColor; out vec4 v_color; -out float v_splitDirection; +flat out vec2 v_splitDirectionAndEllipsoidDepthEC; #ifdef SDF out vec4 v_outlineColor; out float v_outlineWidth; @@ -5493,7 +7073,7 @@ positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMete positionEC.xy += (translate + pixelOffset) * mpp; return positionEC; } -#ifdef VERTEX_DEPTH_CHECK +#ifdef VS_THREE_POINT_DEPTH_CHECK float getGlobeDepth(vec4 positionEC) { vec4 posWC = czm_eyeToWindowCoordinates(positionEC); @@ -5526,44 +7106,25 @@ 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.x *= SHIFT_RIGHT2; translate.y += (temp - floor(temp)) * SHIFT_LEFT8; translate.y -= UPPER_BOUND; +translate.y *= SHIFT_RIGHT2; 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) -{ -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; @@ -5572,7 +7133,7 @@ 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) +#ifdef VS_THREE_POINT_DEPTH_CHECK temp = compressedAttribute3.w; temp = temp * SHIFT_RIGHT12; vec2 dimensions; @@ -5587,32 +7148,17 @@ bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; 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); +vec4 color = czm_decodeRGB8(compressedAttribute2.x); +vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y); 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; +pickColor.a /= 255.0; color.a = floor(temp); -color /= 255.0; +color.a /= 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) @@ -5657,22 +7203,45 @@ positionEC.xyz = vec3(0.0); #endif mat2 rotationMatrix; float mpp; +float enableDepthCheck = 1.0; #ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = compressedAttribute3.z; +float disableDepthTestDistanceSq = compressedAttribute3.z; +if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; +} +if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) +{ +enableDepthCheck = 0.0; +} #endif -#ifdef VERTEX_DEPTH_CHECK -if (lengthSq < disableDepthTestDistance) { +v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity; +vec3 ellipsoidCenter = czm_view[3].xyz; +vec3 rayDirection = normalize(positionEC.xyz); +czm_ray ray = czm_ray(vec3(0.0), rayDirection); +vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii; +czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); +if (!czm_isEmpty(intersection)) +{ +v_splitDirectionAndEllipsoidDepthEC.y = intersection.start; +} +v_compressed.y = enableDepthCheck; +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) { 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); +vec2 depthOrigin; +depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); +depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0); +depthOrigin.y = origin.y; +vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), 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); +vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), depthOrigin, vec2(0.0), 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); +vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth3 = getGlobeDepth(pEC3); if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) { @@ -5682,6 +7251,7 @@ positionEC.xyz = vec3(0.0); } } #endif +v_compressed.x = positionEC.z; positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); gl_Position = czm_projection * positionEC; v_textureCoordinates = textureCoordinates; @@ -5689,15 +7259,11 @@ v_textureCoordinates = textureCoordinates; czm_vertexLogDepth(); #endif #ifdef DISABLE_DEPTH_DISTANCE -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) +if (disableDepthTestDistanceSq != 0.0) { 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))) +if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) { gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH @@ -5706,50 +7272,16 @@ v_depthFromNearPlusOne = 1.0; } } #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; +vec4 outlineColor = czm_decodeRGB8(sdf.x); 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; +outlineColor.a /= 255.0; v_outlineWidth = outlineWidth / 255.0; v_outlineColor = outlineColor; v_outlineColor.a *= translucency; @@ -5757,21 +7289,21 @@ v_outlineColor.a *= translucency; v_pickColor = pickColor; v_color = color; v_color.a *= translucency; -v_splitDirection = splitDirection; +v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; } -`;var D5n=_(T(),1);var g5n=_(T(),1);var f5n=_(T(),1),Cze=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),is=Cze;function gb(e){C.defined("billboardCollection",e),this._billboardCollection=e,this._id=void 0,this._loadState=is.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(gb.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===is.LOADED}},hasImage:{get:function(){return this._loadState!==is.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});gb.prototype.unload=async function(){this._loadState!==is.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=is.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};gb.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(c(o)&&t.loadState===is.LOADING||t.loadState===is.LOADED){gb.clone(o,this);return}c(o)||(o=new gb(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=is.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(l){if(o._loadState=is.ERROR,o._loadError=l,this._id!==e)return;this._loadState=is.ERROR,this._loadError=l;return}if(!c(r)||r===-1){if(o._loadState=is.FAILED,o._index=-1,this._id!==e)return;this._loadState=is.FAILED,this._index=-1;return}o._index=r,o._loadState=is.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=is.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};gb.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=is.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=is.ERROR,this._loadError=o;return}if(!c(n)||n===-1){this._loadState=is.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=is.LOADED,this.dirty=!0};gb.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};gb.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 xb=gb;function pi(e,t){if(e=e??z.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new L("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Nt.clone(n)}if(c(i)){if(i.far<=i.near)throw new L("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Nt.clone(i)}if(c(o)){if(o.far<=o.near)throw new L("scaleByDistance.far must be greater than scaleByDistance.near.");o=Nt.clone(o)}if(c(r)){if(r.far<=r.near)throw new L("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=vt.clone(r)}this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._pixelOffset=D.clone(e.pixelOffset??D.ZERO),this._translate=new D(0,0),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._heightReference=e.heightReference??ze.NONE,this._verticalOrigin=e.verticalOrigin??Mn.CENTER,this._horizontalOrigin=e.horizontalOrigin??xi.CENTER,this._scale=e.scale??1,this._color=Y.clone(e.color??Y.WHITE),this._rotation=e.rotation??0,this._alignedAxis=m.clone(e.alignedAxis??m.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new xb(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;c(s)&&(c(a)||(typeof s=="string"?a=s:c(s.src)?a=s.src:a=Hn()),this._imageTexture.loadImage(a,s)),c(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=se.SCENE3D,this._clusterShow=!0,this._outlineColor=Y.clone(e.outlineColor??Y.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Ar.NONE}var wce=pi.SHOW_INDEX=0,pk=pi.POSITION_INDEX=1,Mce=pi.PIXEL_OFFSET_INDEX=2,Vze=pi.EYE_OFFSET_INDEX=3,Lze=pi.HORIZONTAL_ORIGIN_INDEX=4,Zze=pi.VERTICAL_ORIGIN_INDEX=5,Rze=pi.SCALE_INDEX=6,Pce=pi.IMAGE_INDEX_INDEX=7,vce=pi.COLOR_INDEX=8,Gze=pi.ROTATION_INDEX=9,Eze=pi.ALIGNED_AXIS_INDEX=10,Xze=pi.SCALE_BY_DISTANCE_INDEX=11,Ize=pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Wze=pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,wze=pi.DISTANCE_DISPLAY_CONDITION=14,Pze=pi.DISABLE_DEPTH_DISTANCE=15;pi.TEXTURE_COORDINATE_BOUNDS=16;var Fce=pi.SDF_INDEX=17,vze=pi.SPLIT_DIRECTION_INDEX=18;pi.NUMBER_OF_PROPERTIES=19;function ir(e,t){let n=e._billboardCollection;c(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(pi.prototype,{show:{get:function(){return this._show},set:function(e){C.typeOf.bool("value",e),this._show!==e&&(this._show=e,ir(this,wce))}},position:{get:function(){return this._position},set:function(e){C.typeOf.object("value",e);let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),ir(this,pk))}},heightReference:{get:function(){return this._heightReference},set:function(e){C.typeOf.number("value",e);let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),ir(this,pk))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){C.typeOf.object("value",e);let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),ir(this,Mce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");let t=this._scaleByDistance;Nt.equals(t,e)||(this._scaleByDistance=Nt.clone(e,t),ir(this,Xze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");let t=this._translucencyByDistance;Nt.equals(t,e)||(this._translucencyByDistance=Nt.clone(e,t),ir(this,Ize))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;Nt.equals(t,e)||(this._pixelOffsetScaleByDistance=Nt.clone(e,t),ir(this,Wze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){C.typeOf.object("value",e);let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),ir(this,Vze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){C.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,ir(this,Lze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){C.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,ir(this,Zze))}},scale:{get:function(){return this._scale},set:function(e){C.typeOf.number("value",e),this._scale!==e&&(this._scale=e,ir(this,Rze))}},color:{get:function(){return this._color},set:function(e){C.typeOf.object("value",e);let t=this._color;Y.equals(t,e)||(Y.clone(e,t),ir(this,vce))}},rotation:{get:function(){return this._rotation},set:function(e){C.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,ir(this,Gze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){C.typeOf.object("value",e);let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),ir(this,Eze))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){c(e)&&C.typeOf.number("width",e),this._width!==e&&(this._width=e,ir(this,Pce))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){c(e)&&C.typeOf.number("height",e),this._height!==e&&(this._height=e,ir(this,Pce))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){C.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,ir(this,vce))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!vt.equals(e,this._distanceDisplayCondition)){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition),ir(this,wze)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(c(e)&&(C.typeOf.number("value",e),e<0))throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,ir(this,Pze))}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,c(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!c(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof Ge?t=e._url:c(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),ir(this,pk)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,ir(this,wce))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),ir(this,Fce))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,ir(this,Fce))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,ir(this,vze))}}});pi.prototype.getPickId=function(e){return c(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 Uw=new pe;pi._updateClamping=function(e,t){if(!c(e)||!c(e._scene)){if(t._heightReference!==ze.NONE)throw new L("Height reference is not supported without a scene.");return}let n=e._scene,i=n.ellipsoid??re.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===ze.NONE||r)&&c(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===ze.NONE||!c(t._position))return;c(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!c(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);if(lC(t._heightReference))t._mode===se.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height;else if(t._heightReference===ze.CLIP_TO_GROUND)if(t._mode===se.SCENE3D){let f=i.cartesianToCartographic(d,Uw);s.height>=f.height&&(f.height=s.height),i.cartographicToCartesian(f,d)}else s.height>=d.x&&(d.x=s.height);t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),pe.clone(s,Uw);let l=n.getHeight(s,t._heightReference);c(l)&&(Uw.height=l),a(Uw)};pi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};pi.prototype.setImage=function(e,t){C.typeOf.string("id",e),C.defined("image",t),this._imageTexture.loadImage(e,t)};pi.prototype.setImageTexture=function(e){C.defined("billboardTexture",e),xb.clone(e,this._imageTexture)};pi.prototype.setImageSubRegion=function(e,t){C.typeOf.string("id",e),C.defined("subRegion",t),this._imageTexture.addImageSubRegion(e,t)};pi.prototype._setTranslate=function(e){if(!c(e))throw new L("value is required.");let t=this._translate;D.equals(t,e)||(D.clone(e,t),ir(this,Mce))};pi.prototype._getActualPosition=function(){return c(this._clampedPosition)?this._clampedPosition:this._actualPosition};pi.prototype._setActualPosition=function(e){c(this._clampedPosition)||m.clone(e,this._actualPosition),ir(this,pk)};var Ace=new ce;pi._computeActualPosition=function(e,t,n,i){return c(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===se.SCENE3D?t:(M.multiplyByPoint(i,t,Ace),Oi.computeActualEllipsoidPosition(n,Ace))};var Nce=new m;pi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,Nce),a=Oi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(c(a))return D.add(a,i,a),a};var hk=new D(0,0);pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;if(c(t)||(t=new D),!c(n))throw new L("Billboard must be in a collection. Was it removed?");if(!c(e))throw new L("scene is required.");D.clone(this._pixelOffset,hk),D.add(hk,this._translate,hk);let i=n.modelMatrix,o=this._position;if(c(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==se.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,l=s.unproject(o,Uw);o=a.cartographicToCartesian(l,Nce),i=M.IDENTITY}return pi._computeScreenSpacePosition(i,o,this._eyeOffset,hk,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===xi.RIGHT?s-=i:e.horizontalOrigin===xi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?a-=o:e.verticalOrigin===Mn.CENTER&&(a-=o*.5),c(n)||(n=new je),n.x=s,n.y=a,n.width=i,n.height=o,n};pi.prototype.equals=function(e){return this===e||c(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&&Y.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Nt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&vt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};pi.prototype._destroy=function(){c(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),c(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var co=pi;var Y5n=_(T(),1),Fze={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Lo=Object.freeze(Fze);var z5n=_(T(),1),Aze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ys=Object.freeze(Aze);var Mze=co.SHOW_INDEX,Ow=co.POSITION_INDEX,kce=co.PIXEL_OFFSET_INDEX,Uce=co.EYE_OFFSET_INDEX,Nze=co.HORIZONTAL_ORIGIN_INDEX,kze=co.VERTICAL_ORIGIN_INDEX,Uze=co.SCALE_INDEX,W_=co.IMAGE_INDEX_INDEX,Oce=co.COLOR_INDEX,Oze=co.ROTATION_INDEX,Dze=co.ALIGNED_AXIS_INDEX,Dce=co.SCALE_BY_DISTANCE_INDEX,Bce=co.TRANSLUCENCY_BY_DISTANCE_INDEX,Yce=co.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Hce=co.DISTANCE_DISPLAY_CONDITION,Bze=co.DISABLE_DEPTH_DISTANCE,Yze=co.TEXTURE_COORDINATE_BOUNDS,zce=co.SDF_INDEX,Kce=co.SPLIT_DIRECTION_INDEX,Kz=co.NUMBER_OF_PROPERTIES,lo,Hze={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},zze={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 Nu(e){e=e??z.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;c(t)||(t=new Zx),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(Kz),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Lo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=Y.clone(Y.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;c(n)&&c(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)c(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Nu.prototype,{length:{get:function(){return Jz(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){C.defined("textureAtlas",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 Jce(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Nu.prototype.add=function(e){let t=new co(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Nu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Nu.prototype.removeAll=function(){Jce(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Jz(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];c(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Nu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Nu.prototype.contains=function(e){return c(e)&&e._billboardCollection===this};Nu.prototype.get=function(e){return C.typeOf.number("index",e),Jz(this),this._billboards[e]};var Oz;function Kze(e){let n=e.cache.billboardCollection_indexBufferBatched;if(c(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=_t.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function Jze(e){let t=e.cache.billboardCollection_indexBufferInstanced;return c(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Qze(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return c(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Nu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Kz;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function jze(e,t,n,i,o,r){let s=[{index:lo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Ow]},{index:lo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Ow]},{index:lo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[kce]},{index:lo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Bce]},{index:lo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Oce]},{index:lo.eyeOffset,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Uce]},{index:lo.scaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Dce]},{index:lo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Yce]},{index:lo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Hce]},{index:lo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Yze]},{index:lo.splitDirection,componentsPerAttribute:1,componentDatatype:q.FLOAT,usage:n[Kce]}];i&&s.push({index:lo.direction,componentsPerAttribute:2,componentDatatype:q.FLOAT,vertexBuffer:Qze(e)}),c(o)&&s.push({index:lo.a_batchId,componentsPerAttribute:1,componentDatatype:q.FLOAT,bufferUsage:Ne.STATIC_DRAW}),r&&s.push({index:lo.sdf,componentsPerAttribute:2,componentDatatype:q.FLOAT,usage:n[zce]});let a=i?t:4*t;return new Ip(e,s,a,i)}var Dz=new Bn;function Qce(e,t,n,i){let o,r=n[lo.positionHighAndScale],s=n[lo.positionLowAndRotation],a=i._getActualPosition();e._mode===se.SCENE3D&&(ue.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Bn.fromCartesian(a,Dz);let l=i.scale,d=i.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let u=Dz.high,f=Dz.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,l),s(o,f.x,f.y,f.z,d)):(o=i._index*4,r(o+0,u.x,u.y,u.z,l),r(o+1,u.x,u.y,u.z,l),r(o+2,u.x,u.y,u.z,l),r(o+3,u.x,u.y,u.z,l),s(o+0,f.x,f.y,f.z,d),s(o+1,f.x,f.y,f.z,d),s(o+2,f.x,f.y,f.z,d),s(o+3,f.x,f.y,f.z,d))}var kl=new D,Mu=32768,f1=65536,Bz=4096,Zh=256,qze=128,$ze=32,eKe=8,jce=4,tKe=1/256,qce=0,$ce=2,ele=3,tle=1,Qz=new je;function nle(e,t,n,i){let o,r=n[lo.compressedAttribute0],s=i.pixelOffset,a=s.x,l=s.y,d=i._translate,u=d.x,f=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-l+f));let p=i.horizontalOrigin,y=i._verticalOrigin,h=i.show&&i.clusterShow;i.color.alpha===0&&(h=!1),y===Mn.BASELINE&&(y=Mn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===xi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&y===Mn.CENTER;let g=0,x=0,S=0,V=0;if(i.ready){let A=i.computeTextureCoordinates(Qz);g=A.x,x=A.y,S=A.width,V=A.height}let Z=g+S,R=x+V,E=Math.floor(w.clamp(a,-Mu,Mu)+Mu)*qze;E+=(p+1)*$ze,E+=(y+1)*eKe,E+=(h?1:0)*jce;let I=Math.floor(w.clamp(l,-Mu,Mu)+Mu)*Zh,v=Math.floor(w.clamp(u,-Mu,Mu)+Mu)*Zh,P=(w.clamp(f,-Mu,Mu)+Mu)*tKe,F=Math.floor(P),N=Math.floor((P-F)*Zh);I+=F,v+=N,kl.x=g,kl.y=x;let b=Fn.compressTextureCoordinates(kl);kl.x=Z;let G=Fn.compressTextureCoordinates(kl);kl.y=R;let X=Fn.compressTextureCoordinates(kl);kl.x=g;let W=Fn.compressTextureCoordinates(kl);e._instanced?(o=i._index,r(o,E,I,v,b)):(o=i._index*4,r(o+0,E+qce,I,v,b),r(o+1,E+$ce,I,v,G),r(o+2,E+ele,I,v,X),r(o+3,E+tle,I,v,W))}function ile(e,t,n,i){let o,r=n[lo.compressedAttribute1],s=i.alignedAxis;m.equals(s,m.ZERO)||(e._shaderAlignedAxis=!0);let a=0,l=1,d=1,u=1,f=i.translucencyByDistance;c(f)&&(a=f.near,l=f.nearValue,d=f.far,u=f.farValue,(l!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let y=w.clamp(p,0,f1),h=0;Math.abs(m.magnitudeSquared(s)-1)<w.EPSILON6&&(h=Fn.octEncodeFloat(s)),l=w.clamp(l,0,1),l=l===1?255:l*255|0,y=y*Zh+l,u=w.clamp(u,0,1),u=u===1?255:u*255|0,h=h*Zh+u,e._instanced?(o=i._index,r(o,y,h,a,d)):(o=i._index*4,r(o+0,y,h,a,d),r(o+1,y,h,a,d),r(o+2,y,h,a,d),r(o+3,y,h,a,d))}function Hz(e,t,n,i){let o,r=n[lo.compressedAttribute2],s=i.color,a=c(e._batchTable)?Y.WHITE:i.getPickId(t.context).color,l=i.sizeInMeters?1:0,d=Math.abs(m.magnitudeSquared(i.alignedAxis)-1)<w.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let f=i._labelHorizontalOrigin??-2;f+=2;let p=u*jce+f,y=Y.floatToByte(s.red),h=Y.floatToByte(s.green),g=Y.floatToByte(s.blue),x=y*f1+h*Zh+g;y=Y.floatToByte(a.red),h=Y.floatToByte(a.green),g=Y.floatToByte(a.blue);let S=y*f1+h*Zh+g,V=Y.floatToByte(s.alpha)*f1+Y.floatToByte(a.alpha)*Zh;V+=l*2+d,e._instanced?(o=i._index,r(o,x,S,V,p)):(o=i._index*4,r(o+0,x,S,V,p),r(o+1,x,S,V,p),r(o+2,x,S,V,p),r(o+3,x,S,V,p))}function zz(e,t,n,i){let o,r=n[lo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==ze.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(kl.x=0,kl.y=0,i.ready){let d=i.computeTextureCoordinates(Qz);kl.x=d.width,kl.y=d.height}let l=Fn.compressTextureCoordinates(kl);o=i._index,r(o,s.x,s.y,a,l)}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 ole(e,t,n,i){let o,r=n[lo.scaleByDistance],s=0,a=1,l=1,d=1,u=i.scaleByDistance;c(u)&&(s=u.near,a=u.nearValue,l=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,d)):(o=i._index*4,r(o+0,s,a,l,d),r(o+1,s,a,l,d),r(o+2,s,a,l,d),r(o+3,s,a,l,d))}function rle(e,t,n,i){let o,r=n[lo.pixelOffsetScaleByDistance],s=0,a=1,l=1,d=1,u=i.pixelOffsetScaleByDistance;c(u)&&(s=u.near,a=u.nearValue,l=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,d)):(o=i._index*4,r(o+0,s,a,l,d),r(o+1,s,a,l,d),r(o+2,s,a,l,d),r(o+3,s,a,l,d))}function sle(e,t,n,i){let o,r=n[lo.compressedAttribute3],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance,u=Lu(i.heightReference)&&t.context.depthTexture;c(d)||(d=u?5e3:0),d*=d,(u||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let f,p;c(i._labelDimensions)?(p=i._labelDimensions.x,f=i._labelDimensions.y):(p=i.width??0,f=i.height??0);let y=Math.floor(w.clamp(p,0,Bz)),h=Math.floor(w.clamp(f,0,Bz)),g=y*Bz+h;e._instanced?(o=i._index,r(o,s,a,d,g)):(o=i._index*4,r(o+0,s,a,d,g),r(o+1,s,a,d,g),r(o+2,s,a,d,g),r(o+3,s,a,d,g))}function ale(e,t,n,i){if(Lu(i.heightReference)){let p=e._scene,y=t.context,h=t.globeTranslucencyState.translucent,g=c(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=y.depthTexture&&!h&&g}let o,r=n[lo.textureCoordinateBoundsOrLabelTranslate];if(mt.maximumVertexTextureImageUnits>0){let p=0,y=0;c(i._labelTranslate)&&(p=i._labelTranslate.x,y=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,y,0,0)):(o=i._index*4,r(o+0,p,y,0,0),r(o+1,p,y,0,0),r(o+2,p,y,0,0),r(o+3,p,y,0,0));return}let s=0,a=0,l=0,d=0;if(i.ready){let p=i.computeTextureCoordinates(Qz);s=p.x,a=p.y,l=p.width,d=p.height}let u=s+l,f=a+d;e._instanced?(o=i._index,r(o,s,a,u,f)):(o=i._index*4,r(o+0,s,a,u,f),r(o+1,s,a,u,f),r(o+2,s,a,u,f),r(o+3,s,a,u,f))}function nKe(e,t,n,i){if(!c(e._batchTable))return;let o=n[lo.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 cle(e,t,n,i){if(!e._sdf)return;let o,r=n[lo.sdf],s=i.outlineColor,a=i.outlineWidth,l=Y.floatToByte(s.red),d=Y.floatToByte(s.green),u=Y.floatToByte(s.blue),f=l*f1+d*Zh+u,p=a/Ys.RADIUS,y=Y.floatToByte(s.alpha)*f1+Y.floatToByte(p)*Zh;e._instanced?(o=i._index,r(o,f,y)):(o=i._index*4,r(o+0,f+qce,y),r(o+1,f+$ce,y),r(o+2,f+ele,y),r(o+3,f+tle,y))}function lle(e,t,n,i){let o=n[lo.splitDirection],r=0,s=i.splitDirection;c(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 iKe(e,t,n,i){Qce(e,t,n,i),nle(e,t,n,i),ile(e,t,n,i),Hz(e,t,n,i),zz(e,t,n,i),ole(e,t,n,i),rle(e,t,n,i),sle(e,t,n,i),ale(e,t,n,i),nKe(e,t,n,i),cle(e,t,n,i),lle(e,t,n,i)}function Yz(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l<n;++l){let d=t[l],u=d.position,f=co._computeActualPosition(d,u,i,o);c(f)&&(d._setActualPosition(f),r?a.push(f):ue.expand(s,f,s))}r&&ue.fromPoints(a,s)}function oKe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&Yz(e,i,i.length,t,r,!0)):n===se.MORPHING?Yz(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&Yz(e,o,e._billboardsToUpdateIndex,t,r,!1)}function rKe(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 sKe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +`;var $ai=x(T(),1);var Aai=x(T(),1);var Rai=x(T(),1),vst=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Os=vst;function pf(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(pf.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}}});pf.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)};pf.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,s=r.get(e);if(l(s)&&t.loadState===Os.LOADING||t.loadState===Os.LOADED){pf.clone(s,this);return}l(s)||(s=new pf(o),r.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Os.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let u=c.addImage(e,t,n,i);typeof u=="number"?a=u:a=await u}catch(u){if(s._loadState=Os.ERROR,s._loadError=u,this._id!==e)return;this._loadState=Os.ERROR,this._loadError=u;return}if(!l(a)||a===-1){if(s._loadState=Os.FAILED,s._index=-1,this._id!==e)return;this._loadState=Os.FAILED,this._index=-1;return}s._index=a,s._loadState=Os.LOADED;let d=c.rectangles[a];s._width=d.width,s._height=d.height,this._id===e&&(this._index=a,this._loadState=Os.LOADED,this._width=d.width,this._height=d.height,this.dirty=!0)};pf.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};pf.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Os.LOADING,i=await n}catch(o){this._loadState=Os.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=Os.LOADED,this.setImageSubRegion(i,t))};pf.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-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=e,this.dirty=!0}};pf.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};pf.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 qb=pf;function Xi(e,t){e=e??B.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=Ot.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._translate=new k(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??He.NONE,this._verticalOrigin=e.verticalOrigin??Bn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Ui.CENTER,this._scale=e.scale??1,this._color=U.clone(e.color??U.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new qb(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._mode=se.SCENE3D,this._clusterShow=!0,this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Mr.NONE,this._positionFromParent=!1}var Cxe=Xi.SHOW_INDEX=0,gB=Xi.POSITION_INDEX=1,Wxe=Xi.PIXEL_OFFSET_INDEX=2,Fst=Xi.EYE_OFFSET_INDEX=3,Ist=Xi.HORIZONTAL_ORIGIN_INDEX=4,Pst=Xi.VERTICAL_ORIGIN_INDEX=5,Xst=Xi.SCALE_INDEX=6,Vxe=Xi.IMAGE_INDEX_INDEX=7,Exe=Xi.COLOR_INDEX=8,Nst=Xi.ROTATION_INDEX=9,Yst=Xi.ALIGNED_AXIS_INDEX=10,wst=Xi.SCALE_BY_DISTANCE_INDEX=11,Mst=Xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,kst=Xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Ust=Xi.DISTANCE_DISPLAY_CONDITION=14,Dst=Xi.DISABLE_DEPTH_DISTANCE=15;Xi.TEXTURE_COORDINATE_BOUNDS=16;var Axe=Xi.SDF_INDEX=17,Ost=Xi.SPLIT_DIRECTION_INDEX=18;Xi.NUMBER_OF_PROPERTIES=19;function Nr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nr(this,Cxe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Nr(this,gB))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Nr(this,gB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),Nr(this,Wxe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),Nr(this,wst))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),Nr(this,Mst))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Kt.equals(t,e)||(this._pixelOffsetScaleByDistance=Kt.clone(e,t),Nr(this,kst))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Nr(this,Fst))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Nr(this,Ist))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Nr(this,Pst))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Nr(this,Xst))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Nr(this,Exe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Nr(this,Nst))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Nr(this,Yst))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Nr(this,Vxe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Nr(this,Vxe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Nr(this,Exe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ot.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ot.clone(e,this._distanceDisplayCondition),Nr(this,Ust))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Nr(this,Dst))}},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}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},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=h.clone(e,this._actualClampedPosition),Nr(this,gB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Nr(this,Cxe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Nr(this,Axe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Nr(this,Axe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Nr(this,Ost))}}});Xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Xi.prototype._updateClamping=function(){Xi._updateClamping(this._billboardCollection,this)};var yB=new pe,Bst=200,zst=30;Xi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ne.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===He.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===He.NONE||t._positionFromParent||!l(t._position))return;let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(_){let S=i.cartographicToCartesian(_,t._clampedPosition);Ly(t._heightReference)?t._mode===se.SCENE3D?(_.height+=s.height,i.cartographicToCartesian(_,S)):S.x+=s.height:t._heightReference===He.CLIP_TO_GROUND&&s.height>_.height&&(t._mode===se.SCENE3D?(_.height=s.height,i.cartographicToCartesian(_,S)):S.x=s.height),t._clampedPosition=S}let c=n.frameState.frameNumber,d=t._heightReference===He.CLIP_TO_GROUND,u=c-t._lastSurfaceQueryFrame<zst,m=d&&l(t._lastSurfaceHeight)&&s.height>t._lastSurfaceHeight+Bst,p=m&&u,b=d&&u&&t._lastSurfaceQueryMissed,f=b&&l(t._removeCallbackFunc);m?l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0):f||(l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=n.updateHeight(s,_=>{t._lastSurfaceHeight=_.height,t._clampedToSurface=!0,a(_)},t._heightReference)),pe.clone(s,yB);let y;p||b?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=c,y=n.getHeight(s,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(yB.height=y),a(yB)};Xi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Xi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Xi.prototype.setImageTexture=function(e){qb.clone(e,this._imageTexture)};var Gxe=512;Xi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=qn();return}let n;typeof t=="string"?n=t:t instanceof ve?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??qn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&Hst(n)&&(this._imageWidth=Math.min(this._width,Gxe),this._imageHeight=Math.min(this._height,Gxe))};function Hst(e){return l(e)?Ih(e)?e.startsWith("data:image/svg+xml"):Q0(e)==="svg":!1}Xi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Xi.prototype._setTranslate=function(e){let t=this._translate;k.equals(t,e)||(k.clone(e,t),Nr(this,Wxe))};Xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Nr(this,gB)};var Lxe=new ce;Xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===se.SCENE3D?t:(P.multiplyByPoint(i,t,Lxe),fo.computeActualEllipsoidPosition(n,Lxe))};var vxe=new h;Xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=P.multiplyByPoint(e,t,vxe),a=fo.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return k.add(a,i,a),a};var bB=new k(0,0);Xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,bB),k.add(bB,this._translate,bB);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==se.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,yB);o=a.cartographicToCartesian(c,vxe),i=P.IDENTITY}return Xi._computeScreenSpacePosition(i,o,this._eyeOffset,bB,e,t)};Xi.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===Ui.RIGHT?s-=i:e.horizontalOrigin===Ui.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?a-=o:e.verticalOrigin===Bn.CENTER&&(a-=o*.5),l(n)||(n=new nt),n.x=s,n.y=a,n.width=i,n.height=o,n};Xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.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&&U.equals(this._color,e._color)&&k.equals(this._pixelOffset,e._pixelOffset)&&k.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ot.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Xi.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 wo=Xi;var tci=x(T(),1),Kst={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Da=Object.freeze(Kst);var Tci=x(T(),1);var rci=x(T(),1);function pX({x:e,y:t,width:n,height:i}){this.rectangle=new nt(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function cq({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new pX({x:n,y:n,width:e-2*n,height:t-2*n})}cq.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};cq.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;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new pX({x:i.x,y:i.y,width:t,height:r});let u=s-c;return u>0&&(e.childNode2=new pX({x:i.x+t+c,y:i.y,width:u,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new pX({x:i.x,y:i.y,width:o,height:n});let d=a-c;return d>0&&(e.childNode2=new pX({x:i.x,y:i.y+n+c,width:o,height:d})),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 UC=cq;var Fxe=16;function nd(e){e=e??B.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k(Fxe,Fxe);this._pixelFormat=e.pixelFormat??Qe.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=qn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(nd.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}}});nd.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new nt),!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 m=this._rectangles[u];c+=m.x,d+=m.y}return t.x=c/o,t.y=d/r,t.width=s/o,t.height=a/r,t};nd.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 ps({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),u._bind();let m=this.rectangles,p=this._subRegions;for(let b=0;b<m.length;++b){let f=i[b],y=m[b];if(!l(f)||!l(y)||l(p.get(b)))continue;let{x:_,y:S,width:Z,height:R}=f;a.copyTexSubImage2D(c,0,_,S,y.x,y.y,Z,R)}return a.bindTexture(c,null),s._initialized=!0,u._unBind(),u.destroy(),s};nd.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((_,S)=>new Ixe({index:S,image:_})).filter((_,S)=>l(_.image)&&!l(c.get(S))),u=0,m=0,p=0;for(let _=t;_<o.length;++_){let{width:S,height:Z}=o[_].image;u=Math.max(u,S),m=Math.max(m,Z),p+=S*Z,d.push(o[_])}for(s=W.nextPowerOfTwo(Math.max(u,s)),a=W.nextPowerOfTwo(Math.max(m,a));p>=s*a;)s>a?a*=2:s*=2;d.sort(({image:_},{image:S})=>S.height*S.width-_.height*_.width);let b=new Array(this._nextIndex);for(let _ of this._subRegions.keys())l(c.get(_))&&(b[_]=i[_]);let f,y=!1;for(;!y;){f=new UC({height:a,width:s,borderPadding:n});let _;for(_=0;_<d.length;++_){let{index:S,image:Z}=d[_];if(!l(Z))continue;let R=f.pack(S,Z);if(!l(R)){s>a?a*=2:s*=2;break}b[S]=R.rectangle}y=_===d.length}this._texturePacker=f,this._texture=this._copyFromTexture(e,s,a,b),r.destroy(),this._rectangles=b,this._guid=qn()};nd.prototype.getImageIndex=function(e){return this._indexById.get(e)};nd.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 Ixe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}nd.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Ixe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};nd.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};nd.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 UC({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function Jst(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof ve)&&(e=ve.createIfNeeded(e).fetchImage()),e}nd.prototype.addImage=function(e,t,n,i){let o=this._indexPromiseById.get(e),r=this._indexById.get(e);return l(o)?o:l(r)?r:(r=this._nextIndex++,this._indexById.set(e,r),o=(async()=>{let a=await Jst(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(r,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};nd.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(a=>a===-1?-1:o):o};nd.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.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return i}))};nd.prototype.isDestroyed=function(){return!1};nd.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),me(this)};var gS=nd;var jst=wo.SHOW_INDEX,bX=wo.POSITION_INDEX,Xxe=wo.PIXEL_OFFSET_INDEX,Nxe=wo.EYE_OFFSET_INDEX,Qst=wo.HORIZONTAL_ORIGIN_INDEX,qst=wo.VERTICAL_ORIGIN_INDEX,$st=wo.SCALE_INDEX,yS=wo.IMAGE_INDEX_INDEX,Yxe=wo.COLOR_INDEX,eat=wo.ROTATION_INDEX,tat=wo.ALIGNED_AXIS_INDEX,wxe=wo.SCALE_BY_DISTANCE_INDEX,Mxe=wo.TRANSLUCENCY_BY_DISTANCE_INDEX,kxe=wo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Uxe=wo.DISTANCE_DISPLAY_CONDITION,nat=wo.DISABLE_DEPTH_DISTANCE,iat=wo.TEXTURE_COORDINATE_BOUNDS,Dxe=wo.SDF_INDEX,Oxe=wo.SPLIT_DIRECTION_INDEX,fq=wo.NUMBER_OF_PROPERTIES,Do={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 Bm(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new gS),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(fq),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new de,this._baseVolumeWC=new de,this._baseVolume2D=new de,this._boundingVolume=new de,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Yi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._buffersUsage=[Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW],this._highlightColor=U.clone(U.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ne.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ne.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};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(Bm.prototype,{length:{get:function(){return pq(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}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function Bxe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Bm.prototype.add=function(e){let t=new wo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Bm.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Bm.prototype.removeAll=function(){Bxe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function pq(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}}Bm.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Bm.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Bm.prototype.get=function(e){return pq(this),this._billboards[e]};function Pxe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=ot.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function oat(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=ot.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Pe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Bm.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<fq;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function rat(e,t,n,i,o){let r=[{index:Do.positionHighAndScale,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[bX]},{index:Do.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[bX]},{index:Do.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Xxe]},{index:Do.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Mxe]},{index:Do.compressedAttribute2,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Yxe]},{index:Do.eyeOffset,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Nxe]},{index:Do.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[wxe]},{index:Do.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[kxe]},{index:Do.compressedAttribute3,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Uxe]},{index:Do.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[iat]},{index:Do.splitDirection,componentsPerAttribute:1,componentDatatype:J.FLOAT,usage:n[Oxe]},{index:Do.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:oat(e)}];return l(i)&&r.push({index:Do.a_batchId,componentsPerAttribute:1,componentDatatype:J.FLOAT,bufferUsage:Pe.STATIC_DRAW}),o&&r.push({index:Do.sdf,componentsPerAttribute:2,componentDatatype:J.FLOAT,usage:n[Dxe]}),new Qb(e,r,t,!0)}var lq=new An;function zxe(e,t,n,i){let o=n[Do.positionHighAndScale],r=n[Do.positionLowAndRotation],s=i._getActualPosition();e._mode===se.SCENE3D&&(de.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),An.fromCartesian(s,lq);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let d=lq.high,u=lq.low;o(i._index,d.x,d.y,d.z,a),r(i._index,u.x,u.y,u.z,c)}var _x=new k,Om=32768,bq=65536,dq=4096,xS=256,sat=128,aat=32,cat=8,xB=4,lat=1/256,Hxe=new nt;function Kxe(e,t,n,i){let o=n[Do.compressedAttribute0],r=i.pixelOffset,s=r.x,a=r.y,c=i._translate,d=c.x,u=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+d),Math.abs(-a+u));let m=i.horizontalOrigin,p=i._verticalOrigin,b=i.show&&i.clusterShow;i.color.alpha===0&&(b=!1),p===Bn.BASELINE&&(p=Bn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&m===Ui.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Bn.CENTER;let f=0,y=0;if(i.ready){let L=i.computeTextureCoordinates(Hxe);f=L.x,y=L.y}let _=Math.floor(W.clamp(s,-Om,Om)+Om)*sat;_+=(m+1)*aat,_+=(p+1)*cat,_+=(b?1:0)*xB;let S=Math.floor(W.clamp(a,-Om,Om)+Om)*xS,Z=Math.floor(W.clamp(d*xB,-Om,Om)+Om)*xS,R=(W.clamp(u*xB,-Om,Om)+Om)*lat,C=Math.floor(R),E=Math.floor((R-C)*xS);S+=C,Z+=E,_x.x=f,_x.y=y;let A=dn.compressTextureCoordinates(_x);o(i._index,_,S,Z,A)}function Jxe(e,t,n,i){let o=n[Do.compressedAttribute1],r=i.alignedAxis;h.equals(r,h.ZERO)||(r=h.normalize(r,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,d=1,u=i.translucencyByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let m=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,m);let p=W.clamp(m,0,bq),b=0;Math.abs(h.magnitudeSquared(r)-1)<W.EPSILON6&&(b=dn.octEncodeFloat(r)),a=W.clamp(a,0,1),a=a===1?255:a*255|0,p=p*xS+a,d=W.clamp(d,0,1),d=d===1?255:d*255|0,b=b*xS+d,o(i._index,p,b,s,c)}function mq(e,t,n,i){let o=n[Do.compressedAttribute2],r=i.color,s=l(e._batchTable)?U.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,d=h.equals(c,h.ZERO)?c:h.normalize(c,new h),u=Math.abs(h.magnitudeSquared(d)-1)<W.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let m=i.height??0;e._maxSize=Math.max(e._maxSize,m);let p=i._labelHorizontalOrigin??-2;p+=2;let b=dn.encodeRGB8(r),f=dn.encodeRGB8(s),y=U.floatToByte(r.alpha)*bq+U.floatToByte(s.alpha)*xS+(a*2+u),_=m*xB+p;o(i._index,b,f,y,_)}function hq(e,t,n,i){let o=n[Do.eyeOffset],r=i.eyeOffset,s=r.z;if(i._heightReference!==He.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(r.x),Math.abs(r.y),Math.abs(s)),_x.x=0,_x.y=0,i.ready){let c=i.computeTextureCoordinates(Hxe);_x.x=c.width,_x.y=c.height}let a=dn.compressTextureCoordinates(_x);o(i._index,r.x,r.y,s,a)}function jxe(e,t,n,i){let o=n[Do.scaleByDistance],r=0,s=1,a=1,c=1,d=i.scaleByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),o(i._index,r,s,a,c)}function Qxe(e,t,n,i){let o=n[Do.pixelOffsetScaleByDistance],r=0,s=1,a=1,c=1,d=i.pixelOffsetScaleByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),o(i._index,r,s,a,c)}function qxe(e,t,n,i){let o=n[Do.compressedAttribute3],r=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(r=a.near,s=a.far,r*=r,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,d=fs(i.heightReference)&&t.context.depthTexture;c*=c,(d||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let u,m;l(i._labelDimensions)?(m=i._labelDimensions.x,u=i._labelDimensions.y):(m=i.width??0,u=i.height??0);let p=Math.floor(W.clamp(m,0,dq)),b=Math.floor(W.clamp(u,0,dq)),f=p*dq+b;o(i._index,r,s,c,f)}function $xe(e,t,n,i){if(fs(i.heightReference)){let a=e._scene,c=t.context,d=t.globeTranslucencyState.translucent,u=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!d&&u}let o=n[Do.textureCoordinateBoundsOrLabelTranslate],r=0,s=0;l(i._labelTranslate)&&(r=i._labelTranslate.x,s=i._labelTranslate.y),o(i._index,r,s,0,0)}function dat(e,t,n,i){if(!l(e._batchTable))return;let o=n[Do.a_batchId],r=i._batchIndex;o(i._index,r)}function eTe(e,t,n,i){if(!e._sdf)return;let o=n[Do.sdf],r=i.outlineColor,s=i.outlineWidth,a=dn.encodeRGB8(r),c=s/Da.RADIUS,d=U.floatToByte(r.alpha)*bq+U.floatToByte(c)*xS;o(i._index,a,d)}function tTe(e,t,n,i){let o=n[Do.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s),o(i._index,r)}function uat(e,t,n,i){zxe(e,t,n,i),Kxe(e,t,n,i),Jxe(e,t,n,i),mq(e,t,n,i),hq(e,t,n,i),jxe(e,t,n,i),Qxe(e,t,n,i),qxe(e,t,n,i),$xe(e,t,n,i),dat(e,t,n,i),eTe(e,t,n,i),tTe(e,t,n,i)}function uq(e,t,n,i,o,r){let s;i.mode===se.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,m=wo._computeActualPosition(d,u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):de.expand(s,m,s))}r&&de.fromPoints(a,s)}function mat(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!P.equals(r,e.modelMatrix)?(e._mode=n,P.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&uq(e,i,i.length,t,r,!0)):n===se.MORPHING?uq(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&uq(e,o,e._billboardsToUpdateIndex,t,r,!1)}function hat(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 fat(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=Xe.OVERLAY,i}var aKe=[];Nu.prototype.update=function(e){if(Jz(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,lo=this._instanced?zze:Hze,Oz=this._instanced?Jze:Kze;let n=this._billboards,i=n.length,o=!0;for(let P=0;P<i;++P){let F=n[P];c(F.loadError)&&(console.error(`Error loading image for billboard: ${F.loadError}`),F.image=void 0),F.textureDirty&&this._updateBillboard(F,W_),F.show&&(o=o&&F.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!c(r.texture))return;oKe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,l=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let f,p=e.passes,y=p.pick;if(u||!y&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Kz;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=jze(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),f=this._vaf.writers;for(let P=0;P<i;++P){let F=this._billboards[P];F._dirty=!1,F.textureDirty=!1,iKe(this,e,f,F)}this._vaf.commit(Oz(t))}this._billboardsToUpdateIndex=0}else if(a>0){let P=aKe;P.length=0,(l[Ow]||l[Oze]||l[Uze])&&P.push(Qce),(l[W_]||l[kce]||l[Nze]||l[kze]||l[Mze])&&(P.push(nle),this._instanced&&P.push(zz)),(l[W_]||l[Dze]||l[Bce])&&(P.push(ile),P.push(Hz)),(l[W_]||l[Oce])&&P.push(Hz),(l[W_]||l[Uce])&&P.push(zz),l[Dce]&&P.push(ole),l[Yce]&&P.push(rle),(l[Hce]||l[Bze]||l[W_]||l[Ow])&&P.push(sle),(l[W_]||l[Ow])&&P.push(ale),l[zce]&&P.push(cle),l[Kce]&&P.push(lle);let F=P.length;if(f=this._vaf.writers,a/i>.1){for(let N=0;N<a;++N){let b=s[N];b._dirty=!1,b.textureDirty=!1;for(let G=0;G<F;++G)P[G](this,e,f,b)}this._vaf.commit(Oz(t))}else{for(let N=0;N<a;++N){let b=s[N];b._dirty=!1,b.textureDirty=!1;for(let G=0;G<F;++G)P[G](this,e,f,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),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,g=M.IDENTITY;e.mode===se.SCENE3D?(g=this.modelMatrix,h=ue.clone(this._baseVolumeWC,this._boundingVolume)):h=ue.clone(this._baseVolume2D,this._boundingVolume),rKe(this,e,h);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Oe.fromCache({depthTest:{enabled:!0,func:oe.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Lo.TRANSLUCENT;this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Oe.fromCache({depthTest:{enabled:!0,func:P?oe.LEQUAL:oe.LESS},depthMask:P,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let S,V,Z,R,E,I=mt.maximumVertexTextureImageUnits>0;if(x||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){S=kw,V=Nw,E=[],c(this._batchTable)&&(E.push("VECTOR_TILE"),S=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(S),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),Z=new Be({defines:E,sources:[S]}),this._instanced&&Z.defines.push("INSTANCED"),this._shaderRotation&&Z.defines.push("ROTATION"),this._shaderAlignedAxis&&Z.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Z.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Z.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Z.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Z.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Z.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Ys.CUTOFF;this._sdf&&Z.defines.push("SDF");let F=c(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(R=new Be({defines:["OPAQUE",F],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=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo}),R=new Be({defines:["TRANSLUCENT",F],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=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo})),this._blendOption===Lo.OPAQUE&&(R=new Be({defines:[F],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=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo})),this._blendOption===Lo.TRANSLUCENT&&(R=new Be({defines:[F],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=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo})),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,F=this._blendOption===Lo.OPAQUE,N=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,G=b.length,X=this._uniforms,W;c(this._batchTable)?(X=this._batchTable.getUniformMapCallback()(X),W=this._batchTable.getPickId()):W="v_pickColor",P.length=G;let A=N?G*2:G;for(let k=0;k<A;++k){let B=P[k];c(B)||(B=P[k]=new et);let O=F||N&&k%2===0;B.pass=O||!N?Xe.OPAQUE:Xe.TRANSLUCENT,B.owner=this;let H=N?Math.floor(k/2):k;B.boundingVolume=h,B.modelMatrix=g,B.count=b[H].indicesCount,B.shaderProgram=O?this._sp:this._spTranslucent,B.uniformMap=X,B.vertexArray=b[H].va,B.renderState=O?this._rsOpaque:this._rsTranslucent,B.debugShowBoundingVolume=this.debugShowBoundingVolume,B.pickId=W,this._instanced&&(B.count=6,B.instanceCount=i),v.push(B)}this.debugShowTextureAtlas&&(c(this.debugCommand)||(this.debugCommand=sKe(this,e.context)),v.push(this.debugCommand))}this._allBillboardsReady=o};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){return c(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(),Jce(this._billboards),he(this)};var Gd=Nu;var kkn=_(T(),1);var wkn=_(T(),1);function cKe(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 w_=cKe;function ba(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),h1(this)}var lKe=new pe;Object.defineProperties(ba.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=Y.clone(e,this._color),h1(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,h1(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Y.clone(e,this._pointOutlineColor),h1(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,h1(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){c(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=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,lKe);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=Y.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&&h1(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}}});ba.defaultColor=Y.WHITE;ba.defaultPointOutlineColor=Y.BLACK;ba.defaultPointOutlineWidth=0;ba.defaultPointSize=8;function h1(e){let t=e._billboard;if(c(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(c(e._billboardImage))return;let n=e._color??ba.defaultColor,i=e._pointOutlineColor??ba.defaultPointOutlineColor,o=e._pointOutlineWidth??ba.defaultPointOutlineWidth,r=e._pointSize??ba.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,l=e._billboardOutlineWidth,d=e._billboardSize;if(Y.equals(n,s)&&Y.equals(i,a)&&o===l&&r===d)return;e._billboardColor=Y.clone(n,e._billboardColor),e._billboardOutlineColor=Y.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,f=n.toCssColorString(),p=i.toCssColorString(),y=JSON.stringify([f,r,p,o]);t.setImage(y,w_(u,f,p,o,r))}ba.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ba.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ba.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ba.prototype.getPropertyInherited=function(e){return Us.getPropertyInherited(this._content,this._batchId,e)};ba.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ba.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ba.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ba.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var _b=ba;var FUn=_(T(),1);var Hkn=_(T(),1);function dKe(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",""),l=document.createElement("canvas"),d=100,u=r.width+d|0,f=3*a,p=f/2;l.width=u,l.height=f;let y=l.getContext("2d");y.font=n,y.fillStyle="white",y.fillRect(0,0,l.width+1,l.height+1),i&&(y.strokeStyle="black",y.lineWidth=e.lineWidth,y.strokeText(t,d/2,p)),o&&(y.fillStyle="black",y.fillText(t,d/2,p));let h=y.getImageData(0,0,u,f).data,g=h.length,x=u*4,S,V,Z,R;for(S=0;S<g;++S)if(h[S]!==255){Z=S/x|0;break}for(S=g-1;S>=0;--S)if(h[S]!==255){R=S/x|0;break}let E=-1;for(S=0;S<u&&E===-1;++S)for(V=0;V<f;++V){let I=S*4+V*x;if(h[I]!==255||h[I+1]!==255||h[I+2]!==255||h[I+3]!==255){E=S;break}}return{width:r.width,height:R-Z,ascent:p-Z,descent:R-p,minx:E-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var P_;function uKe(e,t){if(!c(e))throw new L("text is required.");if(e==="")return;t=t??z.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??Y.TRANSPARENT,a=t.padding??0,l=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});c(P_)||(c(u.imageSmoothingEnabled)?P_="imageSmoothingEnabled":c(u.mozImageSmoothingEnabled)?P_="mozImageSmoothingEnabled":c(u.webkitImageSmoothingEnabled)?P_="webkitImageSmoothingEnabled":c(u.msImageSmoothingEnabled)&&(P_="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[P_]=!1,d.style.visibility="hidden",document.body.appendChild(d);let f=dKe(u,e,n,i,o);d.dimensions=f,document.body.removeChild(d),d.style.visibility="";let p=-f.minx,y=Math.ceil(f.width)+p+l,h=f.height+l,g=h-f.ascent+a,x=h-g+l;if(d.width=y,d.height=h,u.font=n,u.lineJoin="round",u.lineWidth=r,u[P_]=!1,s!==Y.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let S=t.strokeColor??Y.BLACK;u.strokeStyle=S.toCssColorString(),u.strokeText(e,p+a,x)}if(o){let S=t.fillColor??Y.WHITE;u.fillStyle=S.toCssColorString(),u.fillText(e,p+a,x)}return d}var v_=uKe;var Tle=_(fle(),1);var fUn=_(T(),1);var Qkn=_(T(),1),fKe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Yo=Object.freeze(fKe);var hle={},ple=0,hKe=256,pKe=new Y(.165,.165,.165,.8),bKe=new D(7,5),ps=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function F_(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Bw(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Yw(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function yle(e){let t=hle[e._font];if(!c(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(Yw(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Yw(n,"font-family"),size:Yw(n,"font-size").replace("px",""),style:Yw(n,"font-style"),weight:Yw(n,"font-weight"),lineHeight:i},document.body.removeChild(n),ple<hKe&&(hle[e._font]=t,ple++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function cf(e,t){if(e=e??z.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new L("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new L("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Nt.clone(n)}if(c(i)){if(i.far<=i.near)throw new L("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Nt.clone(i)}if(c(o)){if(o.far<=o.near)throw new L("scaleByDistance.far must be greater than scaleByDistance.near.");o=Nt.clone(o)}if(c(r)){if(r.far<=r.near)throw new L("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=vt.clone(r)}this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=Y.clone(e.fillColor??Y.WHITE),this._outlineColor=Y.clone(e.outlineColor??Y.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=Y.clone(e.backgroundColor??pKe),this._backgroundPadding=D.clone(e.backgroundPadding??bKe),this._style=e.style??Yo.FILL,this._verticalOrigin=e.verticalOrigin??Mn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??xi.LEFT,this._pixelOffset=D.clone(e.pixelOffset??D.ZERO),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._position=m.clone(e.position??m.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??ze.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=e.text??"",this._relativeSize=1,yle(this),this._updateClamping()}Object.defineProperties(cf.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");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;c(r)&&(r.show=e)}let n=this._backgroundBillboard;c(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new L("value is required.");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;c(s)&&(s.position=e)}let i=this._backgroundBillboard;c(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!c(e))throw new L("value is required.");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;c(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;c(n)&&(n.heightReference=e),Bw(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!c(e))throw new L("value is required.");if(this._text!==e){this._text=e;let t=cf.filterUnsupportedCharacters(e);this._renderedText=cf.enableRightToLeftDetection?SKe(t):t,F_(this)}}},font:{get:function(){return this._font},set:function(e){if(!c(e))throw new L("value is required.");this._font!==e&&(this._font=e,F_(this),yle(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._fillColor;Y.equals(t,e)||(Y.clone(e,t),F_(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),F_(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new L("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,F_(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!c(e))throw new L("value is required.");this._showBackground!==e&&(this._showBackground=e,F_(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._backgroundColor;if(!Y.equals(t,e)){Y.clone(e,t);let n=this._backgroundBillboard;c(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!c(e))throw new L("value is required.");let t=this._backgroundPadding;D.equals(t,e)||(D.clone(e,t),Bw(this))}},style:{get:function(){return this._style},set:function(e){if(!c(e))throw new L("value is required.");this._style!==e&&(this._style=e,F_(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!c(e))throw new L("value is required.");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];c(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._translucencyByDistance;if(!Nt.equals(t,e)){this._translucencyByDistance=Nt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;if(!Nt.equals(t,e)){this._pixelOffsetScaleByDistance=Nt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._scaleByDistance;if(!Nt.equals(t,e)){this._scaleByDistance=Nt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!c(e))throw new L("value is required.");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];c(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!c(e))throw new L("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Bw(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!c(e))throw new L("value is required.");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];c(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;c(n)&&(n.verticalOrigin=e),Bw(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!c(e))throw new L("value is required.");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];c(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;c(n)&&(n.scale=e*this._relativeSize),Bw(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far must be greater than near");if(!vt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;c(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(c(e)&&e<0)throw new L("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;c(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!c(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];c(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;c(n)&&(n.clusterShow=e)}}}});cf.prototype._updateClamping=function(){co._updateClamping(this._labelCollection,this)};cf.prototype.computeScreenSpacePosition=function(e,t){if(!c(e))throw new L("scene is required.");c(t)||(t=new D);let i=this._labelCollection.modelMatrix,o=c(this._actualClampedPosition)?this._actualClampedPosition:this._position;return co._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};cf.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,l=e._backgroundBillboard;if(c(l))i=t.x+l._translate.x,o=t.y-l._translate.y,r=l.width*a,s=l.height*a,e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?o-=s:e.verticalOrigin===Mn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,f=e._glyphs,p=f.length;for(let y=0;y<p;++y){let h=f[y],g=h.billboard;if(!c(g))continue;let x=t.x+g._translate.x,S=t.y-g._translate.y,V=h.dimensions.width*a,Z=h.dimensions.height*a;e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?S-=Z:e.verticalOrigin===Mn.CENTER&&(S-=Z*.5),e._verticalOrigin===Mn.TOP?S+=Ys.PADDING*a:(e._verticalOrigin===Mn.BOTTOM||e._verticalOrigin===Mn.BASELINE)&&(S-=Ys.PADDING*a),i=Math.min(i,x),o=Math.min(o,S),d=Math.max(d,x+V),u=Math.max(u,S+Z)}r=d-i,s=u-o}return c(n)||(n=new je),n.x=i,n.y=o,n.width=r,n.height=s,n};cf.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};cf.prototype.equals=function(e){return this===e||c(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)&&Y.equals(this._fillColor,e._fillColor)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._backgroundColor,e._backgroundColor)&&D.equals(this._backgroundPadding,e._backgroundPadding)&&D.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Nt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&vt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};cf.prototype.isDestroyed=function(){return!1};cf.enableRightToLeftDetection=!1;function yKe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ps.LTR,a="",l=e.length;for(let d=0;d<l;++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 gKe(e){return e.split("").reverse().join("")}function Hw(e,t,n){return e.slice(0,t)+n+e.slice(t)}function xKe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var _Ke="\u05D0-\u05EA",TKe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",ble=new RegExp(`[${_Ke}${TKe}]`);function SKe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=ble.test(o.charAt(0)),s=yKe(o,ble),a=0,l="";for(let d=0;d<s.length;++d){let u=s[d],f=u.Type===ps.BRACKETS?xKe(u.Word):gKe(u.Word);r?u.Type===ps.RTL?(l=f+l,a=0):u.Type===ps.LTR?(l=Hw(l,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?l=f+l:s[d-1].Type===ps.RTL?(l=f+l,a=0):s.length>d+1?s[d+1].Type===ps.RTL?(l=f+l,a=0):(l=Hw(l,a,u.Word),a+=u.Word.length):l=Hw(l,0,f)):u.Type===ps.RTL?l=Hw(l,a,f):u.Type===ps.LTR?(l+=u.Word,a=l.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?l=Hw(l,a,f):(l+=u.Word,a=l.length):l+=u.Word:(l+=u.Word,a=l.length))}n+=l,i<t.length-1&&(n+=` -`)}return n}var Fy=cf;var Sle=_(gle(),1);function VKe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var LKe=1.2,xle="ID_WHITE_PIXEL",jz=new D(4,4),ZKe=new je(1,1,1,1);function RKe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=jz.x,o.height=jz.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(xle,o),n.addImageSubRegion(xle,ZKe)}let i=e.add({collection:t});return i.setImageTexture(n),i}var Tb={};function GKe(e,t,n,i,o,r){return Tb.font=t,Tb.fillColor=n,Tb.strokeColor=i,Tb.strokeWidth=o,Tb.padding=Ys.PADDING,Tb.fill=r===Yo.FILL||r===Yo.FILL_AND_OUTLINE,Tb.stroke=r===Yo.OUTLINE||r===Yo.FILL_AND_OUTLINE,Tb.backgroundColor=Y.BLACK,v_(e,Tb)}function qz(e,t){let n=t.billboard;c(n)&&(n.show=!1,c(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var EKe=new Sle.default,XKe=/\s/;function IKe(e,t){let n=t._renderedText,i=EKe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Ys.FONT_SIZE,o<s)for(let y=o;y<s;++y)qz(e,r[y]);r.length=o;let a=t.show&&t._showBackground&&n.split(` -`).join("").length>0,l=t._backgroundBillboard,d=e._backgroundBillboardCollection;a?(c(l)||(l=RKe(d,e),t._backgroundBillboard=l),l.color=t._backgroundColor,l.show=t._show,l.position=t._position,l.eyeOffset=t._eyeOffset,l.pixelOffset=t._pixelOffset,l.horizontalOrigin=xi.LEFT,l.verticalOrigin=t._verticalOrigin,l.heightReference=t._heightReference,l.scale=t.totalScale,l.pickPrimitive=t,l.id=t._id,l.translucencyByDistance=t._translucencyByDistance,l.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,l.scaleByDistance=t._scaleByDistance,l.distanceDisplayCondition=t._distanceDisplayCondition,l.disableDepthTestDistance=t._disableDepthTestDistance,l.clusterShow=t.clusterShow):c(l)&&(d.remove(l),t._backgroundBillboard=l=void 0);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,p=e._textDimensionsCache;for(let y=0;y<o;++y){let h=i[y],g=t._verticalOrigin,x=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+g]),S=p[x],V=f.get(x);if(!c(V)||!c(S)){V=new xb(u),f.set(x,V);let I=`${t._fontStyle} ${t._fontWeight} ${Ys.FONT_SIZE}px ${t._fontFamily}`,v=GKe(h,I,Y.WHITE,Y.WHITE,0,Yo.FILL);if(S=v.dimensions,p[x]=S,v.width>0&&v.height>0&&!XKe.test(h)){let P=(0,Tle.default)(v,{cutoff:Ys.CUTOFF,radius:Ys.RADIUS}),F=v.getContext("2d"),N=v.width,b=v.height,G=F.getImageData(0,0,N,b);for(let X=0;X<N;X++)for(let W=0;W<b;W++){let A=W*N+X,k=P[A]*255,B=A*4;G.data[B+0]=k,G.data[B+1]=k,G.data[B+2]=k,G.data[B+3]=k}F.putImageData(G,0,0),V.loadImage(x,v)}}let Z=r[y];if(c(Z)||(Z=new VKe,Z.dimensions=S,Z.billboardTexture=V,r[y]=Z),Z.billboardTexture.id!==x&&(Z.billboardTexture=V,Z.dimensions=S),!V.hasImage){qz(e,Z);continue}let R=Z.billboard,E=e._spareBillboards;c(R)||(E.length>0?R=E.pop():(R=u.add({collection:e}),R._labelDimensions=new D,R._labelTranslate=new D),Z.billboard=R),R.setImageTexture(V),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=xi.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===Yo.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===Yo.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===Yo.OUTLINE&&(R.color=Y.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function _le(e,t,n){return t===xi.CENTER?-e/2:t===xi.RIGHT?-(e+n.x):n.x}var fr=new D,WKe=new D;function wKe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,l=1,d=t.length,u=e._backgroundBillboard,f=D.clone(c(u)?e._backgroundPadding:D.ZERO,WKe);f.x/=e._relativeSize,f.y/=e._relativeSize;for(let F=0;F<d;++F){if(n.charAt(F)===` -`){r.push(i),++l,i=0;continue}let b=t[F].dimensions;c(b)&&(a=Math.max(a,b.height-b.descent),s=Math.max(s,b.descent),i+=b.width-b.minx,F<d-1&&(i+=t[F+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,y=e.totalScale,h=e._horizontalOrigin,g=e._verticalOrigin,x=0,S=r[x],V=_le(S,h,f),Z=(c(e._lineHeight)?e._lineHeight:LKe*e._fontSize)/e._relativeSize,R=Z*(l-1),E=o,I=p+R;c(u)&&(E+=f.x*2,I+=f.y*2,u._labelHorizontalOrigin=h),fr.x=V*y,fr.y=0;let v=!0,P=0;for(let F=0;F<d;++F){if(n.charAt(F)===` -`){++x,P+=Z,S=r[x],V=_le(S,h,f),fr.x=V*y,v=!0;continue}let N=t[F],b=N.dimensions;if(c(b)&&(g===Mn.TOP?(fr.y=b.height-a-f.y,fr.y+=Ys.PADDING):g===Mn.CENTER?fr.y=(R+b.height-a)/2:g===Mn.BASELINE?(fr.y=R,fr.y-=Ys.PADDING):(fr.y=R+s+f.y,fr.y-=Ys.PADDING),fr.y=(fr.y-b.descent-P)*y,v&&(fr.x-=Ys.PADDING*y,v=!1),c(N.billboard)&&(N.billboard._setTranslate(fr),N.billboard._labelDimensions.x=E,N.billboard._labelDimensions.y=I,N.billboard._labelHorizontalOrigin=h),F<d-1)){let G=t[F+1];fr.x+=(b.width-b.minx+G.dimensions.minx)*y}}if(c(u)&&n.split(` -`).join("").length>0&&(h===xi.CENTER?V=-o/2-f.x:h===xi.RIGHT?V=-(o+f.x*2):V=0,fr.x=V*y,g===Mn.TOP?fr.y=p-a-s:g===Mn.CENTER?fr.y=(p-a)/2-s:g===Mn.BASELINE?fr.y=-f.y-s:fr.y=0,fr.y=fr.y*y,u.width=E,u.height=I,u._setTranslate(fr),u._labelTranslate=D.clone(fr,u._labelTranslate)),Lu(e.heightReference))for(let F=0;F<d;++F){let b=t[F].billboard;c(b)&&(b._labelTranslate=D.clone(fr,b._labelTranslate))}}function Cle(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)qz(e,n[i]);c(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,c(t._removeCallbackFunc)&&t._removeCallbackFunc(),he(t)}function Rh(e){e=e??z.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Gd({scene:this._scene,textureAtlas:new Zx({initialSize:jz})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new xb(t),this._glyphBillboardCollection=new Gd({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=Y.clone(Y.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Lo.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Rh.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 c(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});Rh.prototype.add=function(e){let t=new Fy(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Rh.prototype.remove=function(e){if(c(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Cle(this,e),!0}return!1};Rh.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Cle(this,e[t]);e.length=0};Rh.prototype.contains=function(e){return c(e)&&e._labelCollection===this};Rh.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._labels[e]};Rh.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&&(IKe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(wKe(s),s._repositionAllGlyphs=!1);let l=s._glyphs.length-a;this._totalGlyphCount+=l}let o=n.length>0?Lo.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)};Rh.prototype.isDestroyed=function(){return!1};Rh.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),he(this)};var Gh=Rh;var QOn=_(T(),1);var MUn=_(T(),1),zw=`in vec3 position3DHigh; +`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Le.OVERLAY,i}var pat=[];Bm.prototype.update=function(e){if(pq(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(kt.maximumVertexTextureImageUnits>0))throw new ge("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,o=!0;for(let L=0;L<i;++L){let F=n[L];l(F.loadError)&&(console.error(`Error loading image for billboard: ${F.loadError}`),F.image=void 0),F.textureDirty&&this._updateBillboard(F,yS),F.show&&(o=o&&F.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;mat(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 m,p=e.passes,b=p.pick;if(u||!b&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let L=0;L<fq;++L)c[L]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=rat(t,i,this._buffersUsage,this._batchTable,this._sdf),m=this._vaf.writers;for(let L=0;L<i;++L){let F=this._billboards[L];F._dirty=!1,F.textureDirty=!1,uat(this,e,m,F)}this._vaf.commit(Pxe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let L=pat;L.length=0,(c[bX]||c[eat]||c[$st])&&L.push(zxe),(c[yS]||c[Xxe]||c[Qst]||c[qst]||c[jst])&&(L.push(Kxe),L.push(hq)),(c[yS]||c[tat]||c[Mxe])&&(L.push(Jxe),L.push(mq)),(c[yS]||c[Yxe])&&L.push(mq),(c[yS]||c[Nxe])&&L.push(hq),c[wxe]&&L.push(jxe),c[kxe]&&L.push(Qxe),(c[Uxe]||c[nat]||c[yS]||c[bX])&&L.push(qxe),(c[yS]||c[bX])&&L.push($xe),c[Dxe]&&L.push(eTe),c[Oxe]&&L.push(tTe);let F=L.length;if(m=this._vaf.writers,a/i>.1){for(let I=0;I<a;++I){let N=s[I];N._dirty=!1,N.textureDirty=!1;for(let g=0;g<F;++g)L[g](this,e,m,N)}this._vaf.commit(Pxe(t))}else{for(let I=0;I<a;++I){let N=s[I];N._dirty=!1,N.textureDirty=!1;for(let g=0;g<F;++g)L[g](this,e,m,N);this._vaf.subCommit(N._index,1)}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,de.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,y=P.IDENTITY;e.mode===se.SCENE3D?(y=this.modelMatrix,f=de.clone(this._baseVolumeWC,this._boundingVolume)):f=de.clone(this._baseVolume2D,this._boundingVolume),hat(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Yi.OPAQUE||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let L=this._blendOption===Yi.TRANSLUCENT;this._blendOption===Yi.TRANSLUCENT||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:L?ie.LEQUAL:ie.LESS},depthMask:L,blending:on.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let S,Z,R,C,E;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){S=fX,Z=hX,E=["INSTANCED"],l(this._batchTable)&&(E.push("VECTOR_TILE"),S=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(S),Z=this._batchTable.getFragmentShaderCallback(!1,void 0)(Z)),R=new Je({defines:E,sources:[S]}),this._shaderRotation&&R.defines.push("ROTATION"),this._shaderAlignedAxis&&R.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&R.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&R.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&R.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&R.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&R.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&R.defines.push("VS_THREE_POINT_DEPTH_CHECK");let L=1-Da.CUTOFF;this._sdf&&R.defines.push("SDF");let F=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT&&(C=new Je({defines:["OPAQUE",F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._sp=nn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do}),C=new Je({defines:["TRANSLUCENT",F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._spTranslucent=nn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._blendOption===Yi.OPAQUE&&(C=new Je({defines:[F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._sp=nn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._blendOption===Yi.TRANSLUCENT&&(C=new Je({defines:[F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._spTranslucent=nn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),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 A=e.commandList;if(p.render||p.pick){let L=this._colorCommands,F=this._blendOption===Yi.OPAQUE,I=this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT,N=this._vaf.va,g=N.length,V=this._uniforms,G;l(this._batchTable)?(V=this._batchTable.getUniformMapCallback()(V),G=this._batchTable.getPickId()):G="v_pickColor",L.length=g;let v=I?g*2:g;for(let X=0;X<v;++X){let Y=L[X];l(Y)||(Y=L[X]=new lt);let D=F||I&&X%2===0;Y.pass=D||!I?Le.OPAQUE:Le.TRANSLUCENT,Y.owner=this;let w=I?Math.floor(X/2):X;Y.boundingVolume=f,Y.modelMatrix=y,Y.count=N[w].indicesCount,Y.shaderProgram=D?this._sp:this._spTranslucent,Y.uniformMap=V,Y.vertexArray=N[w].va,Y.renderState=D?this._rsOpaque:this._rsTranslucent,Y.debugShowBoundingVolume=this.debugShowBoundingVolume,Y.pickId=G,Y.count=6,Y.instanceCount=i,A.push(Y)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=fat(this,e.context)),A.push(this.debugCommand))}this._allBillboardsReady=o};Bm.prototype.isDestroyed=function(){return!1};Bm.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(),Bxe(this._billboards),me(this)};var wu=Bm;var fli=x(T(),1);var ali=x(T(),1);function bat(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 TS=bat;var gat=new pe,bf=class{constructor(t,n,i,o,r){this._content=t,this._billboard=i,this._label=o,this._polyline=r,this._batchId=n,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),DC(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=U.clone(t,this._color),DC(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,DC(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),DC(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,DC(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,o=i.cartesianToCartographic(this._billboard.position,gat);o.height=o.height-n+t;let r=i.cartographicToCartesian(o);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=U.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&DC(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ea.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};mt(bf,"defaultColor",U.WHITE),mt(bf,"defaultPointOutlineColor",U.BLACK),mt(bf,"defaultPointOutlineWidth",0),mt(bf,"defaultPointSize",8);function DC(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=e._color??bf.defaultColor,i=e._pointOutlineColor??bf.defaultPointOutlineColor,o=e._pointOutlineWidth??bf.defaultPointOutlineWidth,r=e._pointSize??bf.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(U.equals(n,s)&&U.equals(i,a)&&o===c&&r===d)return;e._billboardColor=U.clone(n,e._billboardColor),e._billboardOutlineColor=U.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),b=JSON.stringify([m,r,p,o]);t.setImage(b,TS(u,m,p,o,r))}var $b=bf;var cdi=x(T(),1);var Tli=x(T(),1);function yat(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let o=Math.round(n.actualBoundingBoxAscent),r=Math.round(n.actualBoundingBoxDescent),s=Math.max(o+r,1);return{width:n.width,height:s,ascent:o,descent:r,minx:-Math.round(n.actualBoundingBoxLeft)}}var _S;function xat(e,t){if(e==="")return;t=t??B.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??U.TRANSPARENT,a=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(_S)||(l(u.imageSmoothingEnabled)?_S="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?_S="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?_S="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(_S="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[_S]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=yat(u,e);d.dimensions=m,document.body.removeChild(d),d.style.visibility="";let p=!/\S/.test(e),b=i&&!p?Math.ceil(r/2):0,f=b*2,y=-m.minx+b,_=Math.ceil(m.width)+y+c+b,S=m.height+c+f,Z=m.ascent+a+b;if(d.width=_,d.height=S,u.font=n,u.lineJoin="round",u.lineWidth=r,u[_S]=!1,s!==U.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let R=t.strokeColor??U.BLACK;u.strokeStyle=R.toCssColorString(),u.strokeText(e,y+a,Z)}if(o){let R=t.fillColor??U.WHITE;u.fillStyle=R.toCssColorString(),u.fillText(e,y+a,Z)}return d}var SS=xat;var fTe=x(rTe(),1);var Mli=x(T(),1);var Rli=x(T(),1),sTe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(sTe);var Tr=sTe;var aTe={},cTe=0,_at=256,Sat=new U(.165,.165,.165,.8),Zat=new k(7,5),ia=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function ZS(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function yX(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function xX(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function dTe(e){let t=aTe[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(xX(n,"line-height"));isNaN(i)&&(i=void 0),t={family:xX(n,"font-family"),size:xX(n,"font-size").replace("px",""),style:xX(n,"font-style"),weight:xX(n,"font-weight"),lineHeight:i},document.body.removeChild(n),cTe<_at&&(aTe[e._font]=t,cTe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function gf(e,t){e=e??B.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=Ot.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=U.clone(e.fillColor??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=U.clone(e.backgroundColor??Sat),this._backgroundPadding=k.clone(e.backgroundPadding??Zat),this._style=e.style??Tr.FILL,this._verticalOrigin=e.verticalOrigin??Bn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Ui.LEFT,this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??He.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._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,dTe(this),this._updateClamping()}Object.defineProperties(gf.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(!h.equals(t,e)){h.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),yX(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=gf.filterUnsupportedCharacters(e);this._renderedText=gf.enableRightToLeftDetection?Gat(t):t,ZS(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,ZS(this),dTe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),ZS(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),ZS(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,ZS(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,ZS(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!U.equals(t,e)){U.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;k.equals(t,e)||(k.clone(e,t),yX(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,ZS(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!k.equals(t,e)){k.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(!h.equals(t,e)){h.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,yX(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),yX(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),yX(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Ot.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Ot.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=h.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)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});gf.prototype._updateClamping=function(){wo._updateClamping(this._labelCollection,this)};gf.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new k);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return wo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};gf.getScreenSpaceBoundingBox=function(e,t,n){let i,o,r,s,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===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?o-=s:e.verticalOrigin===Bn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,m=e._glyphs,p=m.length;for(let b=0;b<p;++b){let f=m[b],y=f.billboard;if(!l(y))continue;let _=t.x+y._translate.x,S=t.y-y._translate.y,Z=f.dimensions.width*a,R=f.dimensions.height*a;e.verticalOrigin===Bn.BOTTOM||e.verticalOrigin===Bn.BASELINE?S-=R:e.verticalOrigin===Bn.CENTER&&(S-=R*.5),e._verticalOrigin===Bn.TOP?S+=Da.PADDING*a:(e._verticalOrigin===Bn.BOTTOM||e._verticalOrigin===Bn.BASELINE)&&(S-=Da.PADDING*a),i=Math.min(i,_),o=Math.min(o,S),d=Math.max(d,_+Z),u=Math.max(u,S+R)}r=d-i,s=u-o}return l(n)||(n=new nt),n.x=i,n.y=o,n.width=r,n.height=s,n};gf.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};gf.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&&h.equals(this._position,e._position)&&U.equals(this._fillColor,e._fillColor)&&U.equals(this._outlineColor,e._outlineColor)&&U.equals(this._backgroundColor,e._backgroundColor)&&k.equals(this._backgroundPadding,e._backgroundPadding)&&k.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Ot.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};gf.prototype.isDestroyed=function(){return!1};gf.enableRightToLeftDetection=!1;function Rat(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ia.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=ia.RTL:n.test(u)?a=ia.LTR:i.test(u)?a=ia.BRACKETS:a=ia.WEAK,d===0&&(s=a),s===a&&a!==ia.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function Cat(e){return e.split("").reverse().join("")}function TX(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Vat(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Eat="\u05D0-\u05EA",Aat="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",lTe=new RegExp(`[${Eat}${Aat}]`);function Gat(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=lTe.test(o.charAt(0)),s=Rat(o,lTe),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===ia.BRACKETS?Vat(u.Word):Cat(u.Word);r?u.Type===ia.RTL?(c=m+c,a=0):u.Type===ia.LTR?(c=TX(c,a,u.Word),a+=u.Word.length):(u.Type===ia.WEAK||u.Type===ia.BRACKETS)&&(u.Type===ia.WEAK&&s[d-1].Type===ia.BRACKETS?c=m+c:s[d-1].Type===ia.RTL?(c=m+c,a=0):s.length>d+1?s[d+1].Type===ia.RTL?(c=m+c,a=0):(c=TX(c,a,u.Word),a+=u.Word.length):c=TX(c,0,m)):u.Type===ia.RTL?c=TX(c,a,m):u.Type===ia.LTR?(c+=u.Word,a=c.length):(u.Type===ia.WEAK||u.Type===ia.BRACKETS)&&(d>0&&s[d-1].Type===ia.RTL?s.length>d+1?s[d+1].Type===ia.RTL?c=TX(c,a,m):(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 Sx=gf;var pTe=x(uTe(),1);function Wat(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var vat=1.2,mTe="ID_WHITE_PIXEL",gq=new k(4,4),Fat=new nt(1,1,1,1);function Iat(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=gq.x,o.height=gq.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(mTe,o),n.addImageSubRegion(mTe,Fat)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new k,i}var eg={};function Pat(e,t,n,i,o,r){return eg.font=t,eg.fillColor=n,eg.strokeColor=i,eg.strokeWidth=o,eg.padding=Da.PADDING,eg.fill=r===Tr.FILL||r===Tr.FILL_AND_OUTLINE,eg.stroke=r===Tr.OUTLINE||r===Tr.FILL_AND_OUTLINE,eg.backgroundColor=U.BLACK,SS(e,eg)}function yq(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var Xat=new pTe.default,Nat=/\s/;function Yat(e,t){let n=t._renderedText,i=Xat.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Da.FONT_SIZE,o<s)for(let p=o;p<s;++p)yq(e,r[p]);r.length=o;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=Iat(c,e),t._backgroundBillboard=a),wat(c,t,a);let d=e._glyphBillboardCollection,u=d.billboardTextureCache,m=e._textDimensionsCache;for(let p=0;p<o;++p){let b=i[p],f=t._verticalOrigin,y=JSON.stringify([b,t._fontFamily,t._fontStyle,t._fontWeight,+f]),_=m[y],S=u.get(y);if(!l(S)||!l(_)){S=new qb(d),u.set(y,S);let E=`${t._fontStyle} ${t._fontWeight} ${Da.FONT_SIZE}px ${t._fontFamily}`,A=Pat(b,E,U.WHITE,U.WHITE,0,Tr.FILL);if(_=A.dimensions,m[y]=_,A.width>0&&A.height>0&&!Nat.test(b)){let L=(0,fTe.default)(A,{cutoff:Da.CUTOFF,radius:Da.RADIUS}),F=A.getContext("2d"),I=A.width,N=A.height,g=F.getImageData(0,0,I,N);for(let V=0;V<I;V++)for(let G=0;G<N;G++){let v=G*I+V,X=L[v]*255,Y=v*4;g.data[Y+0]=X,g.data[Y+1]=X,g.data[Y+2]=X,g.data[Y+3]=X}F.putImageData(g,0,0),S.loadImage(y,A)}}let Z=r[p];if(l(Z)||(Z=new Wat,Z.dimensions=_,Z.billboardTexture=S,r[p]=Z),Z.billboardTexture.id!==y&&(Z.billboardTexture=S,Z.dimensions=_),!S.hasImage){yq(e,Z);continue}let R=Z.billboard,C=e._spareBillboards;l(R)||(C.length>0?R=C.pop():(R=d.add({collection:e}),R._labelDimensions=new k,R._labelTranslate=new k,R._positionFromParent=!0),Z.billboard=R),R.setImageTexture(S),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=Ui.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,l(t._clampedPosition)&&(R._clampedPosition=t._clampedPosition),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===Tr.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===Tr.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===Tr.OUTLINE&&(R.color=U.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function wat(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` +`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Ui.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function hTe(e,t,n){return t===Ui.CENTER?-e/2:t===Ui.RIGHT?-(e+n.x):n.x}var Br=new k,Mat=new k;function kat(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,m=k.clone(l(u)?e._backgroundPadding:k.ZERO,Mat);m.x/=e._relativeSize,m.y/=e._relativeSize;for(let I=0;I<d;++I){if(n.charAt(I)===` +`){r.push(i),++c,i=0;continue}let g=t[I].dimensions;l(g)&&(a=Math.max(a,g.height-g.descent),s=Math.max(s,g.descent),i+=g.width-g.minx,I<d-1&&(i+=t[I+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,b=e.totalScale,f=e._horizontalOrigin,y=e._verticalOrigin,_=0,S=r[_],Z=hTe(S,f,m),R=(l(e._lineHeight)?e._lineHeight:vat*e._fontSize)/e._relativeSize,C=R*(c-1),E=o,A=p+C;l(u)&&(E+=m.x*2,A+=m.y*2,u._labelHorizontalOrigin=f),Br.x=Z*b,Br.y=0;let L=!0,F=0;for(let I=0;I<d;++I){if(n.charAt(I)===` +`){++_,F+=R,S=r[_],Z=hTe(S,f,m),Br.x=Z*b,L=!0;continue}let N=t[I],g=N.dimensions;if(l(g)&&(y===Bn.TOP?(Br.y=g.height-a-m.y,Br.y+=Da.PADDING):y===Bn.CENTER?Br.y=(C+g.height-a)/2:y===Bn.BASELINE?(Br.y=C,Br.y-=Da.PADDING):(Br.y=C+s+m.y,Br.y-=Da.PADDING),Br.y=(Br.y-g.descent-F)*b,L&&(Br.x-=Da.PADDING*b,L=!1),l(N.billboard)&&(N.billboard._setTranslate(Br),N.billboard._labelDimensions.x=E,N.billboard._labelDimensions.y=A,N.billboard._labelHorizontalOrigin=f,fs(e.heightReference)&&(N.billboard._labelTranslate=k.clone(Br,N.billboard._labelTranslate))),I<d-1)){let V=t[I+1];Br.x+=(g.width-g.minx+V.dimensions.minx)*b}}l(u)&&n.split(` +`).join("").length>0&&(f===Ui.CENTER?Z=-o/2-m.x:f===Ui.RIGHT?Z=-(o+m.x*2):Z=0,Br.x=Z*b,y===Bn.TOP?Br.y=p-a-s:y===Bn.CENTER?Br.y=(p-a)/2-s:y===Bn.BASELINE?Br.y=-m.y-s:Br.y=0,Br.y=Br.y*b,u.width=E,u.height=A,u._setTranslate(Br),u._labelTranslate=k.clone(Br,u._labelTranslate))}function bTe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)yq(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 Kp(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new wu({scene:this._scene,textureAtlas:new gS({initialSize:gq}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new qb(t),this._glyphBillboardCollection=new wu({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=U.clone(U.WHITE),this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Yi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Kp.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}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});Kp.prototype.add=function(e){let t=new Sx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Kp.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),bTe(this,e),!0}return!1};Kp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)bTe(this,e[t]);e.length=0};Kp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Kp.prototype.get=function(e){return this._labels[e]};Kp.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&&(Yat(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(kat(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Yi.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)};Kp.prototype.isDestroyed=function(){return!1};Kp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),me(this)};var Jp=Kp;var yui=x(T(),1);var ddi=x(T(),1),_X=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 position2DHigh; in vec3 position2DLow; @@ -5862,8 +7394,8 @@ v_width = width; v_pickColor = pickColor; v_polylineAngle = polylineAngle; } -`;var dOn=_(T(),1);var jUn=_(T(),1);var tl={};tl.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};tl.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 PKe=new pe;tl.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,PKe).height}return i};var vKe=new M,FKe=new m,Vle=new m,AKe=new cn(m.UNIT_X,0),Lle=new m,MKe=new cn(m.UNIT_X,0),NKe=new m,kKe=new m,eK=[];function Rle(e,t,n){let i=eK;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 gk=new pe,yk=new pe,Ay=new m,tK=new m,UKe=new m,$z=new Fp,Kw=new va;function OKe(e,t,n,i,o,r,s,a){let l=i.scaleToGeodeticSurface(e,tK),d=i.scaleToGeodeticSurface(t,UKe),u=tl.numberOfPoints(e,t,n),f=i.cartesianToCartographic(l,gk),p=i.cartesianToCartographic(d,yk),y=Rle(u,o,r);$z.setEndPoints(f,p);let h=$z.surfaceDistance/u,g=a;f.height=o;let x=i.cartographicToCartesian(f,Ay);m.pack(x,s,g),g+=3;for(let S=1;S<u;S++){let V=$z.interpolateUsingSurfaceDistance(S*h,yk);V.height=y[S],x=i.cartographicToCartesian(V,Ay),m.pack(x,s,g),g+=3}return g}function DKe(e,t,n,i,o,r,s,a){let l=i.cartesianToCartographic(e,gk),d=i.cartesianToCartographic(t,yk),u=tl.numberOfPointsRhumbLine(l,d,n);l.height=0,d.height=0;let f=Rle(u,o,r);Kw.ellipsoid.equals(i)||(Kw=new va(void 0,void 0,i)),Kw.setEndPoints(l,d);let p=Kw.surfaceDistance/u,y=a;l.height=o;let h=i.cartographicToCartesian(l,Ay);m.pack(h,s,y),y+=3;for(let g=1;g<u;g++){let x=Kw.interpolateUsingSurfaceDistance(g*p,yk);x.height=f[g],h=i.cartographicToCartesian(x,Ay),m.pack(h,s,y),y+=3}return y}tl.wrapLongitude=function(e,t){let n=[],i=[];if(c(e)&&e.length>0){t=t??M.IDENTITY;let o=M.inverseTransformation(t,vKe),r=M.multiplyByPoint(o,m.ZERO,FKe),s=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_Y,Vle),Vle),a=cn.fromPointNormal(r,s,AKe),l=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_X,Lle),Lle),d=cn.fromPointNormal(r,l,MKe),u=1;n.push(m.clone(e[0]));let f=n[0],p=e.length;for(let y=1;y<p;++y){let h=e[y];if(cn.getPointDistance(d,f)<0||cn.getPointDistance(d,h)<0){let g=qn.lineSegmentPlane(f,h,a,NKe);if(c(g)){let x=m.multiplyByScalar(s,5e-9,kKe);cn.getPointDistance(a,f)<0&&m.negate(x,x),n.push(m.add(g,x,new m)),i.push(u+1),m.negate(x,x),n.push(m.add(g,x,new m)),u=1}}n.push(m.clone(e[y])),u++,f=h}i.push(u)}return{positions:n,lengths:i}};tl.generateArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n=t.length,i=e.ellipsoid??re.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let g=i.scaleToGeodeticSurface(t[0],tK);if(o=r?o[0]:o,o!==0){let x=i.geodeticSurfaceNormal(g,Ay);m.multiplyByScalar(x,o,x),m.add(g,x,g)}return[g.x,g.y,g.z]}let s=e.minDistance;if(!c(s)){let g=e.granularity??w.RADIANS_PER_DEGREE;s=w.chordLength(g,i.maximumRadius)}let a=0,l;for(l=0;l<n-1;l++)a+=tl.numberOfPoints(t[l],t[l+1],s);let d=(a+1)*3,u=new Array(d),f=0;for(l=0;l<n-1;l++){let g=t[l],x=t[l+1],S=r?o[l]:o,V=r?o[l+1]:o;f=OKe(g,x,s,i,S,V,u,f)}eK.length=0;let p=t[n-1],y=i.cartesianToCartographic(p,gk);y.height=r?o[n-1]:o;let h=i.cartographicToCartesian(y,Ay);return m.pack(h,u,d-3),u};var Zle=new pe,BKe=new pe;tl.generateRhumbArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n=t.length,i=e.ellipsoid??re.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let S=i.scaleToGeodeticSurface(t[0],tK);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(S,Ay);m.multiplyByScalar(V,o,V),m.add(S,V,S)}return[S.x,S.y,S.z]}let s=e.granularity??w.RADIANS_PER_DEGREE,a=0,l,d=i.cartesianToCartographic(t[0],Zle),u;for(l=0;l<n-1;l++)u=i.cartesianToCartographic(t[l+1],BKe),a+=tl.numberOfPointsRhumbLine(d,u,s),d=pe.clone(u,Zle);let f=(a+1)*3,p=new Array(f),y=0;for(l=0;l<n-1;l++){let S=t[l],V=t[l+1],Z=r?o[l]:o,R=r?o[l+1]:o;y=DKe(S,V,s,i,Z,R,p,y)}eK.length=0;let h=t[n-1],g=i.cartesianToCartographic(h,gk);g.height=r?o[n-1]:o;let x=i.cartographicToCartesian(g,Ay);return m.pack(x,p,f-3),p};tl.generateCartesianArc=function(e){let t=tl.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};tl.generateCartesianRhumbArc=function(e){let t=tl.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=tl;function Ed(e,t){e=e??z.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,c(this._material)||(this._material=zi.fromType(zi.ColorType,{color:new Y(1,1,1,1)}));let n=e.positions;c(n)||(n=[]),this._positions=n,this._actualPositions=xo(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;c(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=vi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Ele),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var Gle=Ed.POSITION_INDEX=0,YKe=Ed.SHOW_INDEX=1,HKe=Ed.WIDTH_INDEX=2,zKe=Ed.MATERIAL_INDEX=3,Jw=Ed.POSITION_SIZE_INDEX=4,KKe=Ed.DISTANCE_DISPLAY_CONDITION=5,Ele=Ed.NUMBER_OF_PROPERTIES=6;function Sb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;c(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ed.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");e!==this._show&&(this._show=e,Sb(this,YKe))}},positions:{get:function(){return this._positions},set:function(e){if(!c(e))throw new L("value is required.");let t=xo(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)&&Sb(this,Jw),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Sb(this,Gle),this.update()}},material:{get:function(){return this._material},set:function(e){if(!c(e))throw new L("material is required.");this._material!==e&&(this._material=e,Sb(this,zKe))}},width:{get:function(){return this._width},set:function(e){if(!c(e))throw new L("value is required.");let t=this._width;e!==t&&(this._width=e,Sb(this,HKe))}},loop:{get:function(){return this._loop},set:function(e){if(!c(e))throw new L("value is required.");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,Sb(this,Jw)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!c(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");vt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition),Sb(this,KKe))}}});Ed.prototype.update=function(){let e=M.IDENTITY;c(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Gle]>0||this._propertiesChanged[Jw]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=vi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)Sb(this,Jw);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Sb(this,Jw);break}}};Ed.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ed.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Ele-1;++t)e[t]=0};Ed.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var ku=Ed;var JKe=ku.SHOW_INDEX,QKe=ku.WIDTH_INDEX,iK=ku.POSITION_INDEX,jKe=ku.MATERIAL_INDEX,Xle=ku.POSITION_SIZE_INDEX,qKe=ku.DISTANCE_DISPLAY_CONDITION,Ale=ku.NUMBER_OF_PROPERTIES,Ul={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 lf(e){e=e??z.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=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(Ale),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.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=Y.clone(Y.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(lf.prototype,{length:{get:function(){return oK(this),this._polylines.length}}});lf.prototype.add=function(e){let t=new ku(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};lf.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,c(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};lf.prototype.removeAll=function(){rK(this),Ole(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};lf.prototype.contains=function(e){return c(e)&&e._polylineCollection===this};lf.prototype.get=function(e){if(!c(e))throw new L("index is required.");return oK(this),this._polylines[e]};function $Ke(e,t){c(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 Ix(t,n,e._polylines.length)}var Mle=new Bn,Nle=new ce,kle=new D;lf.prototype.update=function(e){if(oK(this),this._polylines.length===0||!this.show)return;rJe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(mt.maximumVertexTextureImageUnits===0)throw new le("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");$Ke(this,t),this._createBatchTable=!1}if(this._createVertexArray||tJe(this))wle(this,t,n);else if(this._polylinesUpdated){let l=this._polylinesToUpdate;if(this._mode!==se.SCENE3D){let d=l.length;for(let u=0;u<d;++u)i=l[u],i.update()}if(o[Xle]||o[jKe])wle(this,t,n);else{let d=l.length,u=this._polylineBuckets;for(let f=0;f<d;++f){i=l[f],o=i._propertiesChanged;let p=i._bucket,y=0;for(let h in u)if(u.hasOwnProperty(h)){if(u[h]===p){o[iK]&&p.writeUpdate(y,i,this._positionBuffer,n);break}y+=u[h].lengthOfPositions}if((o[JKe]||o[QKe])&&this._batchTable.setBatchedAttribute(i._index,0,new D(i._width,i._show)),this._batchTable.attributes.length>2){if(o[iK]||o[Xle]){let h=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,g=Bn.fromCartesian(h.center,Mle),x=ce.fromElements(g.low.x,g.low.y,g.low.z,h.radius,Nle);this._batchTable.setBatchedAttribute(i._index,2,g.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(o[qKe]){let h=kle;h.x=0,h.y=Number.MAX_VALUE;let g=i.distanceDisplayCondition;c(g)&&(h.x=g.near,h.y=g.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}l.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let l=0;l<Ale;++l)o[l]=0;let r=M.IDENTITY;e.mode===se.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!c(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Oe.fromCache({depthMask:a,depthTest:{enabled:a}})),(!c(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Oe.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let l=this._colorCommands;eJe(this,e,l,r)}};var Qw=new ue,Ile=new ue;function eJe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,l=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),y=d.length;for(let h=0;h<y;++h){let g=d[h],x=g.buckets,S=x.length;for(let V=0;V<S;++V){let Z=x[V],R=Z.offset,E=Z.bucket.shaderProgram,I=Z.bucket.polylines,v=I.length,P,F,N=0,b,G;for(let X=0;X<v;++X){let W=I[X],A=iJe(W._material);if(A!==P){if(c(P)&&N>0){let H=F.isTranslucent();a>=s?(b=new et({owner:e}),n.push(b)):b=n[a],++a,G=St(p(F._uniforms),e._uniformMap),b.boundingVolume=ue.clone(Qw,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=E,b.vertexArray=g.va,b.renderState=H?e._translucentRS:e._opaqueRS,b.pass=H?Xe.TRANSLUCENT:Xe.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=G,b.count=N,b.offset=R,R+=N,N=0,l=!0,r.push(b)}F=W._material,F.update(o),P=A}let k=W._locatorBuckets,B=k.length;for(let H=0;H<B;++H){let U=k[H];U.locator===Z&&(N+=U.count)}let O;t.mode===se.SCENE3D?O=W._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?O=W._boundingVolume2D:t.mode===se.SCENE2D?c(W._boundingVolume2D)&&(O=ue.clone(W._boundingVolume2D,Ile),O.center.x=0):c(W._boundingVolumeWC)&&c(W._boundingVolume2D)&&(O=ue.union(W._boundingVolumeWC,W._boundingVolume2D,Ile)),l?(l=!1,ue.clone(O,Qw)):ue.union(O,Qw,Qw)}c(P)&&N>0&&(a>=s?(b=new et({owner:e}),n.push(b)):b=n[a],++a,G=St(p(F._uniforms),e._uniformMap),b.boundingVolume=ue.clone(Qw,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=E,b.vertexArray=g.va,b.renderState=F.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=F.isTranslucent()?Xe.TRANSLUCENT:Xe.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=G,b.count=N,b.offset=R,l=!0,r.push(b)),P=void 0}}n.length=a}lf.prototype.isDestroyed=function(){return!1};lf.prototype.destroy=function(){return Ule(this),rK(this),Ole(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),he(this)};function tJe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[iK]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var Wle=[0,0,0];function wle(e,t,n){e._createVertexArray=!1,rK(e),Ule(e),oJe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],l=0,d=[[]],u=0,f=e._polylineBuckets,p,y;for(p in f)f.hasOwnProperty(p)&&(y=f[p],y.updateShader(t,r,s),u+=y.lengthOfPositions);if(u>0){let h=e._mode,g=new Float32Array(6*u*3),x=new Float32Array(u*4),S,V=0,Z=0,R=0;for(p in f)if(f.hasOwnProperty(p)){y=f[p],y.write(g,x,V,Z,R,r,t,n),h===se.MORPHING&&(c(S)||(S=new Float32Array(6*u*3)),y.writeForMorph(S,V));let G=y.lengthOfPositions;V+=6*G*3,Z+=G*4,R+=G*4,l=y.updateIndices(i,a,d,l)}let E=e._positionBufferUsage.bufferUsage,I=Ne.STATIC_DRAW;e._positionBuffer=_t.createVertexBuffer({context:t,typedArray:g,usage:E});let v;c(S)&&(v=_t.createVertexBuffer({context:t,typedArray:S,usage:E})),e._texCoordExpandAndBatchIndexBuffer=_t.createVertexBuffer({context:t,typedArray:x,usage:I});let P=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,N=0,b=i.length;for(let G=0;G<b;++G)if(o=i[G],o.length>0){let X=new Uint16Array(o),W=_t.createIndexBuffer({context:t,typedArray:X,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT});N+=a[G];let A=6*(G*(P*w.SIXTY_FOUR_KILOBYTES)-N*P),k=P+A,B=P+k,O=P+B,H=P+O,U=P+H,K=G*(F*w.SIXTY_FOUR_KILOBYTES)-N*F,Q=[{index:Ul.position3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Ul.position3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Ul.position2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Ul.position2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Ul.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:Ul.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Ul.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:Ul.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Ul.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:H,strideInBytes:6*P},{index:Ul.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Ul.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:H,strideInBytes:6*P},{index:Ul.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Ul.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:K}],ie,j,$,ne;h===se.SCENE3D?(j=e._positionBuffer,ie="vertexBuffer",$=Wle,ne="value"):h===se.SCENE2D||h===se.COLUMBUS_VIEW?(j=Wle,ie="value",$=e._positionBuffer,ne="vertexBuffer"):(j=v,ie="vertexBuffer",$=e._positionBuffer,ne="vertexBuffer"),Q[0][ie]=j,Q[1][ie]=j,Q[2][ne]=$,Q[3][ne]=$,Q[4][ie]=j,Q[5][ie]=j,Q[6][ne]=$,Q[7][ne]=$,Q[8][ie]=j,Q[9][ie]=j,Q[10][ne]=$,Q[11][ne]=$;let be=new ni({context:t,attributes:Q,indexBuffer:W});e._vertexArrays.push({va:be,buckets:d[G]})}}}function nJe(e,t){return t instanceof Pt?t.id:t}var xk=[];function iJe(e){let t=zi._uniformList[e.type],n=t.length;xk.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];xk[i]=r,xk[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(xk,nJe)}`}function oJe(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 l=a.material,d=i[l.type];c(d)||(d=i[l.type]=new Eh(l,t,n)),d.addPolyline(a)}}}function rJe(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function oK(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 rK(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;c(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Ule(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}lf.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Ole(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function nK(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Eh(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Eh.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Eh.prototype.updateShader=function(e,t,n){if(c(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"),Ot.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Be({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,Ax]}),r=t.getVertexShaderCallback()(zw),s=new Be({defines:i,sources:[bd,r]});this.shaderProgram=tn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Ul})};function Dle(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===zt.INTERSECTING}Eh.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!Dle(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 Ls=new m,Uu=new m,Ou=new m,_k=new m,sJe=new ce,aJe=new D;Eh.prototype.write=function(e,t,n,i,o,r,s,a){let l=this.mode,d=a.ellipsoid.maximumRadius*w.PI,u=this.polylines,f=u.length;for(let p=0;p<f;++p){let y=u[p],h=y.width,g=y.show&&h>0,x=y._index,S=this.getSegments(y,a),V=S.positions,Z=S.lengths,R=V.length,E=y.getPickId(s).color,I=0,v=0,P;for(let B=0;B<R;++B){B===0?y._loop?P=V[R-2]:(P=_k,m.subtract(V[0],V[1],P),m.add(V[0],P,P)):P=V[B-1],m.clone(P,Uu),m.clone(V[B],Ls),B===R-1?y._loop?P=V[1]:(P=_k,m.subtract(V[R-1],V[R-2],P),m.add(V[R-1],P,P)):P=V[B+1],m.clone(P,Ou);let O=Z[I];B===v+O&&(v+=O,++I);let H=B-v===0,U=B===v+Z[I]-1;l===se.SCENE2D&&(Uu.z=0,Ls.z=0,Ou.z=0),(l===se.SCENE2D||l===se.MORPHING)&&(H||U)&&d-Math.abs(Ls.x)<1&&((Ls.x<0&&Uu.x>0||Ls.x>0&&Uu.x<0)&&m.clone(Ls,Uu),(Ls.x<0&&Ou.x>0||Ls.x>0&&Ou.x<0)&&m.clone(Ls,Ou));let K=H?2:0,Q=U?2:4;for(let ie=K;ie<Q;++ie){Bn.writeElements(Ls,e,n),Bn.writeElements(Uu,e,n+6),Bn.writeElements(Ou,e,n+12);let j=ie-2<0?-1:1;t[o]=B/(R-1),t[o+1]=2*(ie%2)-1,t[o+2]=j,t[o+3]=x,n+=6*3,o+=4}}let F=sJe;F.x=Y.floatToByte(E.red),F.y=Y.floatToByte(E.green),F.z=Y.floatToByte(E.blue),F.w=Y.floatToByte(E.alpha);let N=aJe;N.x=h,N.y=g?1:0;let b=l===se.SCENE2D?y._boundingVolume2D:y._boundingVolumeWC,G=Bn.fromCartesian(b.center,Mle),X=G.high,W=ce.fromElements(G.low.x,G.low.y,G.low.z,b.radius,Nle),A=kle;A.x=0,A.y=Number.MAX_VALUE;let k=y.distanceDisplayCondition;c(k)&&(A.x=k.near,A.y=k.far),r.setBatchedAttribute(x,0,N),r.setBatchedAttribute(x,1,F),r.attributes.length>2&&(r.setBatchedAttribute(x,2,X),r.setBatchedAttribute(x,3,W),r.setBatchedAttribute(x,4,A))}};var cJe=new m,lJe=new m,dJe=new m,Ple=new m;Eh.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,l=s._segments.lengths,d=a.length,u=0,f=0;for(let p=0;p<d;++p){let y;p===0?s._loop?y=a[d-2]:(y=Ple,m.subtract(a[0],a[1],y),m.add(a[0],y,y)):y=a[p-1],y=M.multiplyByPoint(n,y,lJe);let h=M.multiplyByPoint(n,a[p],cJe),g;p===d-1?s._loop?g=a[1]:(g=Ple,m.subtract(a[d-1],a[d-2],g),m.add(a[d-1],g,g)):g=a[p+1],g=M.multiplyByPoint(n,g,dJe);let x=l[u];p===f+x&&(f+=x,++u);let S=p-f===0,V=p===f+l[u]-1,Z=S?2:0,R=V?2:4;for(let E=Z;E<R;++E)Bn.writeElements(h,e,t),Bn.writeElements(y,e,t+6),Bn.writeElements(g,e,t+12),t+=6*3}}};var uJe=new Array(1);Eh.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new nK(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],l=0;a.length>0&&(l=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let f=0;f<u;++f){let p=d[f];p._locatorBuckets=[];let y;if(this.mode===se.SCENE3D){y=uJe;let g=p._actualPositions.length;if(g>0)y[0]=g;else continue}else y=p._segments.lengths;let h=y.length;if(h>0){let g=0;for(let x=0;x<h;++x){let S=y[x]-1;for(let V=0;V<S;++V)l+4>w.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:g}),g=0,t.push(4),a=[],e.push(a),l=0,r.count=s,s=0,i=0,r=new nK(0,0,this),n[++o]=[r]),a.push(l,l+2,l+1),a.push(l+1,l+2,l+3),g+=6,s+=6,i+=6,l+=4}p._locatorBuckets.push({locator:r,count:g}),l+4>w.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),l=0,r.count=s,i=0,s=0,r=new nK(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Eh.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 p1={positions:void 0,lengths:void 0},vle=new Array(1),mJe=new m,fJe=new pe;Eh.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return vle[0]=n.length,p1.positions=n,p1.lengths=vle,p1;Dle(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,l=mJe;for(let d=0;d<s;++d)a=n[d],l=M.multiplyByPoint(r,a,l),o.push(t.project(i.cartesianToCartographic(l,fJe)));if(o.length>0){e._boundingVolume2D=ue.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return p1.positions=o,p1.lengths=e._segments.lengths,p1};var Fle;Eh.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=Fle,l=6*s*3;!c(a)||a.length<l?a=Fle=new Float32Array(l):a.length>l&&(a=new Float32Array(a.buffer,0,l));let d=this.getSegments(t,i),u=d.positions,f=d.lengths,p=0,y=0,h=0,g;s=u.length;for(let x=0;x<s;++x){x===0?t._loop?g=u[s-2]:(g=_k,m.subtract(u[0],u[1],g),m.add(u[0],g,g)):g=u[x-1],m.clone(g,Uu),m.clone(u[x],Ls),x===s-1?t._loop?g=u[1]:(g=_k,m.subtract(u[s-1],u[s-2],g),m.add(u[s-1],g,g)):g=u[x+1],m.clone(g,Ou);let S=f[y];x===h+S&&(h+=S,++y);let V=x-h===0,Z=x===h+f[y]-1;o===se.SCENE2D&&(Uu.z=0,Ls.z=0,Ou.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(V||Z)&&r-Math.abs(Ls.x)<1&&((Ls.x<0&&Uu.x>0||Ls.x>0&&Uu.x<0)&&m.clone(Ls,Uu),(Ls.x<0&&Ou.x>0||Ls.x>0&&Ou.x<0)&&m.clone(Ls,Ou));let R=V?2:0,E=Z?2:4;for(let I=R;I<E;++I)Bn.writeElements(Ls,a,p),Bn.writeElements(Uu,a,p+6),Bn.writeElements(Ou,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var df=lf;function My(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 Gd({batchTable:e.batchTable}),this._labelCollection=new Gh({batchTable:e.batchTable}),this._polylineCollection=new df,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(My.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 hJe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+de.packedLength+re.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,de.pack(n,s,a),a+=de.packedLength,re.pack(t,s,a),s}var pJe=new gi("createVectorTilePoints",5),bJe=new m;function yJe(e,t){let n=e._positions,i=e._packedBuffer;c(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=hJe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=pJe.scheduleTask(r,o);if(c(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let l=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let f=e._batchIds,p=n.length/3;for(let y=0;y<p;++y){let h=f[y],g=m.unpack(n,y*3,bJe),x=l.add();x.position=g,x._batchIndex=h;let S=d.add();S.text=" ",S.position=g,S._batchIndex=h;let V=u.add();V.positions=[m.clone(g),m.clone(g)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}My.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 l=r[a],d=n.get(a),u=i.get(a),f=o.get(a);t[l]=new _b(e,l,d,u,f)}};My.prototype.applyDebugSettings=function(e,t){e?(Y.clone(t,this._billboardCollection._highlightColor),Y.clone(t,this._labelCollection._highlightColor),Y.clone(t,this._polylineCollection._highlightColor)):(Y.clone(Y.WHITE,this._billboardCollection._highlightColor),Y.clone(Y.WHITE,this._labelCollection._highlightColor),Y.clone(Y.WHITE,this._polylineCollection._highlightColor))};function gJe(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=_b.defaultPointSize,s.color=_b.defaultColor,s.pointOutlineColor=_b.defaultPointOutlineColor,s.pointOutlineWidth=_b.defaultPointOutlineWidth,s.labelColor=Y.WHITE,s.labelOutlineColor=Y.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Yo.FILL,s.labelText=void 0,s.backgroundColor=new Y(.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=Y.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=xi.CENTER,s.verticalOrigin=Mn.CENTER,s.labelHorizontalOrigin=xi.RIGHT,s.labelVerticalOrigin=Mn.BASELINE}}var xJe=new Y,_Je=new Y,TJe=new Y,SJe=new Y,CJe=new Y,VJe=new Y,jw=new Nt,qw=new Nt,sK=new vt;My.prototype.applyStyle=function(e,t){if(!c(e)){gJe(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(c(e.show)&&(s.show=e.show.evaluate(s)),c(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),c(e.color)&&(s.color=e.color.evaluateColor(s,xJe)),c(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,_Je)),c(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),c(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,TJe)),c(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,SJe)),c(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),c(e.font)&&(s.font=e.font.evaluate(s)),c(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),c(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,c(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,CJe)),c(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),c(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),c(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);c(a)?(jw.near=a.x,jw.nearValue=a.y,jw.far=a.z,jw.farValue=a.w,s.scaleByDistance=jw):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(c(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);c(a)?(qw.near=a.x,qw.nearValue=a.y,qw.far=a.z,qw.farValue=a.w,s.translucencyByDistance=qw):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(c(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);c(a)?(sK.near=a.x,sK.far=a.y,s.distanceDisplayCondition=sK):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;c(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),c(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),c(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,VJe)),c(e.image)?s.image=e.image.evaluate(s):s.image=void 0,c(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),c(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),c(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),c(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),c(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};My.prototype.update=function(e){if(!this._ready&&(c(this._promise)||(this._promise=yJe(this,e.mapProjection.ellipsoid)),c(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};My.prototype.isDestroyed=function(){return!1};My.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(),he(this)};var $w=My;var EDn=_(T(),1);function Cb(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=e.ellipsoid??re.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=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=Un.BOTH}Object.defineProperties(Cb.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function LJe(e){let t=new Float64Array(3+m.packedLength+re.packedLength+de.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,re.pack(e._ellipsoid,t,n),n+=re.packedLength,de.pack(e._rectangle,t,n),t}function ZJe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Xn.unpack(t,n),n+=Xn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let l=Y.unpack(t,n);n+=Y.packedLength;let d=t[n++],u=t[n++],f=t[n++],p=new Array(f);for(let y=0;y<f;++y)p[y]=t[n++];s[a]=new bh({color:l,offset:d,count:u,batchIds:p})}}var RJe=new gi("createVectorTilePolygons",5),GJe=new Y;function EJe(e){if(c(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(!c(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(de.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let y=e._batchTable,h=s.length;for(let g=0;g<h;++g){let x=y.getColor(g,GJe);s[g]=x.toRgba()}a=e._packedBuffer=LJe(e)}let l=[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,f=e._polygonMaximumHeights;c(u)&&c(f)&&(u=u.slice(),f=f.slice(),l.push(u.buffer,f.buffer),d.minimumHeights=u,d.maximumHeights=f);let p=RJe.scheduleTask(d,l);if(c(p))return p.then(y=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(y.packedBuffer),g=h[0];ZJe(e,h),e._indices=Me.getSizeInBytes(g)===2?new Uint16Array(y.indices):new Uint32Array(y.indices),e._indexOffsets=new Uint32Array(y.indexOffsets),e._indexCounts=new Uint32Array(y.indexCounts),e._batchedPositions=new Float32Array(y.positions),e._vertexBatchIds=new Uint16Array(y.batchIds),XJe(e),e._ready=!0}).catch(y=>{e.isDestroyed()||(e._error=y)})}function XJe(e){c(e._primitive)||(e._primitive=new o_({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)}Cb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Cb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Cb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Cb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Cb.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=EJe(this)),c(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)};Cb.prototype.isDestroyed=function(){return!1};Cb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};var eP=Cb;var nBn=_(T(),1);var IDn=_(T(),1),tP=`in vec4 currentPosition; +`;var Idi=x(T(),1);var Sdi=x(T(),1);var id={};id.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};id.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 Uat=new pe;id.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,Uat).height}return i};var Dat=new P,Oat=new h,gTe=new h,Bat=new cn(h.UNIT_X,0),yTe=new h,zat=new cn(h.UNIT_X,0),Hat=new h,Kat=new h,Tq=[];function TTe(e,t,n){let i=Tq;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 SB=new pe,_B=new pe,Zx=new h,_q=new h,Jat=new h,xq=new mb,SX=new Ac;function jat(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,_q),d=i.scaleToGeodeticSurface(t,Jat),u=id.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,SB),p=i.cartesianToCartographic(d,_B),b=TTe(u,o,r);xq.setEndPoints(m,p);let f=xq.surfaceDistance/u,y=a;m.height=o;let _=i.cartographicToCartesian(m,Zx);h.pack(_,s,y),y+=3;for(let S=1;S<u;S++){let Z=xq.interpolateUsingSurfaceDistance(S*f,_B);Z.height=b[S],_=i.cartographicToCartesian(Z,Zx),h.pack(_,s,y),y+=3}return y}function Qat(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,SB),d=i.cartesianToCartographic(t,_B),u=id.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=TTe(u,o,r);SX.ellipsoid.equals(i)||(SX=new Ac(void 0,void 0,i)),SX.setEndPoints(c,d);let p=SX.surfaceDistance/u,b=a;c.height=o;let f=i.cartographicToCartesian(c,Zx);h.pack(f,s,b),b+=3;for(let y=1;y<u;y++){let _=SX.interpolateUsingSurfaceDistance(y*p,_B);_.height=m[y],f=i.cartographicToCartesian(_,Zx),h.pack(f,s,b),b+=3}return b}id.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??P.IDENTITY;let o=P.inverseTransformation(t,Dat),r=P.multiplyByPoint(o,h.ZERO,Oat),s=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_Y,gTe),gTe),a=cn.fromPointNormal(r,s,Bat),c=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_X,yTe),yTe),d=cn.fromPointNormal(r,c,zat),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let b=1;b<p;++b){let f=e[b];if(cn.getPointDistance(d,m)<0||cn.getPointDistance(d,f)<0){let y=yi.lineSegmentPlane(m,f,a,Hat);if(l(y)){let _=h.multiplyByScalar(s,5e-9,Kat);cn.getPointDistance(a,m)<0&&h.negate(_,_),n.push(h.add(y,_,new h)),i.push(u+1),h.negate(_,_),n.push(h.add(y,_,new h)),u=1}}n.push(h.clone(e[b])),u++,m=f}i.push(u)}return{positions:n,lengths:i}};id.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ne.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],_q);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(y,Zx);h.multiplyByScalar(_,o,_),h.add(y,_,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??W.RADIANS_PER_DEGREE;s=W.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=id.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),m=0;for(c=0;c<n-1;c++){let y=t[c],_=t[c+1],S=r?o[c]:o,Z=r?o[c+1]:o;m=jat(y,_,s,i,S,Z,u,m)}Tq.length=0;let p=t[n-1],b=i.cartesianToCartographic(p,SB);b.height=r?o[n-1]:o;let f=i.cartographicToCartesian(b,Zx);return h.pack(f,u,d-3),u};var xTe=new pe,qat=new pe;id.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ne.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let S=i.scaleToGeodeticSurface(t[0],_q);if(o=r?o[0]:o,o!==0){let Z=i.geodeticSurfaceNormal(S,Zx);h.multiplyByScalar(Z,o,Z),h.add(S,Z,S)}return[S.x,S.y,S.z]}let s=e.granularity??W.RADIANS_PER_DEGREE,a=0,c,d=i.cartesianToCartographic(t[0],xTe),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],qat),a+=id.numberOfPointsRhumbLine(d,u,s),d=pe.clone(u,xTe);let m=(a+1)*3,p=new Array(m),b=0;for(c=0;c<n-1;c++){let S=t[c],Z=t[c+1],R=r?o[c]:o,C=r?o[c+1]:o;b=Qat(S,Z,s,i,R,C,p,b)}Tq.length=0;let f=t[n-1],y=i.cartesianToCartographic(f,SB);y.height=r?o[n-1]:o;let _=i.cartographicToCartesian(y,Zx);return h.pack(_,p,m-3),p};id.generateCartesianArc=function(e){let t=id.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};id.generateCartesianRhumbArc=function(e){let t=id.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var oo=id;function Mu(e,t){e=e??B.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=eo.fromType(eo.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Yo(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=P.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=oo.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(STe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=de.fromPoints(this._actualPositions),this._boundingVolumeWC=de.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new de}var _Te=Mu.POSITION_INDEX=0,$at=Mu.SHOW_INDEX=1,ect=Mu.WIDTH_INDEX=2,tct=Mu.MATERIAL_INDEX=3,ZX=Mu.POSITION_SIZE_INDEX=4,nct=Mu.DISTANCE_DISPLAY_CONDITION=5,STe=Mu.NUMBER_OF_PROPERTIES=6;function tg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Mu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,tg(this,$at))}},positions:{get:function(){return this._positions},set:function(e){let t=Yo(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&tg(this,ZX),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=de.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=de.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),tg(this,_Te),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,tg(this,tct))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,tg(this,ect))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,tg(this,ZX)}}},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){Ot.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ot.clone(e,this._distanceDisplayCondition),tg(this,nct))}}});Mu.prototype.update=function(){let e=P.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[_Te]>0||this._propertiesChanged[ZX]>0;if((!P.equals(e,this._modelMatrix)||i)&&(this._segments=oo.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=de.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=P.clone(e,this._modelMatrix),this._segments.positions.length!==t)tg(this,ZX);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){tg(this,ZX);break}}};Mu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Mu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<STe-1;++t)e[t]=0};Mu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var zm=Mu;var ict=zm.SHOW_INDEX,oct=zm.WIDTH_INDEX,Zq=zm.POSITION_INDEX,rct=zm.MATERIAL_INDEX,ZTe=zm.POSITION_SIZE_INDEX,sct=zm.DISTANCE_DISPLAY_CONDITION,LTe=zm.NUMBER_OF_PROPERTIES,Dd={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 yf(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=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(LTe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Pe.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=U.clone(U.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(yf.prototype,{length:{get:function(){return Rq(this),this._polylines.length}}});yf.prototype.add=function(e){let t=new zm(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};yf.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};yf.prototype.removeAll=function(){Cq(this),PTe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};yf.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};yf.prototype.get=function(e){return Rq(this),this._polylines[e]};function act(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:J.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:J.FLOAT,componentsPerAttribute:2}];e._batchTable=new p_(t,n,e._polylines.length)}var WTe=new An,vTe=new ce,FTe=new k;yf.prototype.update=function(e){if(Rq(this),this._polylines.length===0||!this.show)return;hct(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(kt.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.");act(this,t),this._createBatchTable=!1}if(this._createVertexArray||lct(this))VTe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==se.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[ZTe]||o[rct])VTe(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let m=0;m<d;++m){i=c[m],o=i._propertiesChanged;let p=i._bucket,b=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[Zq]&&p.writeUpdate(b,i,this._positionBuffer,n);break}b+=u[f].lengthOfPositions}if((o[ict]||o[oct])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Zq]||o[ZTe]){let f=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=An.fromCartesian(f.center,WTe),_=ce.fromElements(y.low.x,y.low.y,y.low.z,f.radius,vTe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[sct]){let f=FTe;f.x=0,f.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(f.x=y.near,f.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<LTe;++c)o[c]=0;let r=P.IDENTITY;e.mode===se.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;cct(this,e,c,r)}};var RX=new de,RTe=new de;function cct(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(),b=d.length;for(let f=0;f<b;++f){let y=d[f],_=y.buckets,S=_.length;for(let Z=0;Z<S;++Z){let R=_[Z],C=R.offset,E=R.bucket.shaderProgram,A=R.bucket.polylines,L=A.length,F,I,N=0,g,V;for(let G=0;G<L;++G){let v=A[G],X=uct(v._material);if(X!==F){if(l(F)&&N>0){let O=I.isTranslucent();a>=s?(g=new lt({owner:e}),n.push(g)):g=n[a],++a,V=It(p(I._uniforms),e._uniformMap),g.boundingVolume=de.clone(RX,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=E,g.vertexArray=y.va,g.renderState=O?e._translucentRS:e._opaqueRS,g.pass=O?Le.TRANSLUCENT:Le.OPAQUE,g.debugShowBoundingVolume=u,g.pickId="v_pickColor",g.uniformMap=V,g.count=N,g.offset=C,C+=N,N=0,c=!0,r.push(g)}I=v._material,I.update(o),F=X}let Y=v._locatorBuckets,D=Y.length;for(let O=0;O<D;++O){let M=Y[O];M.locator===R&&(N+=M.count)}let w;t.mode===se.SCENE3D?w=v._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?w=v._boundingVolume2D:t.mode===se.SCENE2D?l(v._boundingVolume2D)&&(w=de.clone(v._boundingVolume2D,RTe),w.center.x=0):l(v._boundingVolumeWC)&&l(v._boundingVolume2D)&&(w=de.union(v._boundingVolumeWC,v._boundingVolume2D,RTe)),c?(c=!1,de.clone(w,RX)):de.union(w,RX,RX)}l(F)&&N>0&&(a>=s?(g=new lt({owner:e}),n.push(g)):g=n[a],++a,V=It(p(I._uniforms),e._uniformMap),g.boundingVolume=de.clone(RX,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=E,g.vertexArray=y.va,g.renderState=I.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=I.isTranslucent()?Le.TRANSLUCENT:Le.OPAQUE,g.debugShowBoundingVolume=u,g.pickId="v_pickColor",g.uniformMap=V,g.count=N,g.offset=C,c=!0,r.push(g)),F=void 0}}n.length=a}yf.prototype.isDestroyed=function(){return!1};yf.prototype.destroy=function(){return ITe(this),Cq(this),PTe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function lct(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Zq]?(i.bufferUsage!==Pe.STREAM_DRAW&&(t=!0,i.bufferUsage=Pe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Pe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Pe.STATIC_DRAW):i.frameCount--),t}var CTe=[0,0,0];function VTe(e,t,n){e._createVertexArray=!1,Cq(e),ITe(e),mct(e);let i=[[]],o,r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,m=e._polylineBuckets,p,b;for(p in m)m.hasOwnProperty(p)&&(b=m[p],b.updateShader(t,r,s),u+=b.lengthOfPositions);if(u>0){let f=e._mode,y=new Float32Array(6*u*3),_=new Float32Array(u*4),S,Z=0,R=0,C=0;for(p in m)if(m.hasOwnProperty(p)){b=m[p],b.write(y,_,Z,R,C,r,t,n),f===se.MORPHING&&(l(S)||(S=new Float32Array(6*u*3)),b.writeForMorph(S,Z));let V=b.lengthOfPositions;Z+=6*V*3,R+=V*4,C+=V*4,c=b.updateIndices(i,a,d,c)}let E=e._positionBufferUsage.bufferUsage,A=Pe.STATIC_DRAW;e._positionBuffer=ot.createVertexBuffer({context:t,typedArray:y,usage:E});let L;l(S)&&(L=ot.createVertexBuffer({context:t,typedArray:S,usage:E})),e._texCoordExpandAndBatchIndexBuffer=ot.createVertexBuffer({context:t,typedArray:_,usage:A});let F=3*Float32Array.BYTES_PER_ELEMENT,I=4*Float32Array.BYTES_PER_ELEMENT,N=0,g=i.length;for(let V=0;V<g;++V)if(o=i[V],o.length>0){let G=new Uint16Array(o),v=ot.createIndexBuffer({context:t,typedArray:G,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});N+=a[V];let X=6*(V*(F*W.SIXTY_FOUR_KILOBYTES)-N*F),Y=F+X,D=F+Y,w=F+D,O=F+w,M=F+O,z=V*(I*W.SIXTY_FOUR_KILOBYTES)-N*I,K=[{index:Dd.position3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Dd.position3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Dd.position2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Dd.position2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Dd.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Dd.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Dd.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Dd.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Dd.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Dd.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Dd.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Dd.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Dd.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:J.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:z}],te,H,$,ee;f===se.SCENE3D?(H=e._positionBuffer,te="vertexBuffer",$=CTe,ee="value"):f===se.SCENE2D||f===se.COLUMBUS_VIEW?(H=CTe,te="value",$=e._positionBuffer,ee="vertexBuffer"):(H=L,te="vertexBuffer",$=e._positionBuffer,ee="vertexBuffer"),K[0][te]=H,K[1][te]=H,K[2][ee]=$,K[3][ee]=$,K[4][te]=H,K[5][te]=H,K[6][ee]=$,K[7][ee]=$,K[8][te]=H,K[9][te]=H,K[10][ee]=$,K[11][ee]=$;let le=new Un({context:t,attributes:K,indexBuffer:v});e._vertexArrays.push({va:le,buckets:d[V]})}}}function dct(e,t){return t instanceof vt?t.id:t}var ZB=[];function uct(e){let t=eo._uniformList[e.type],n=t.length;ZB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];ZB[i]=r,ZB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(ZB,dct)}`}function mct(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 jp(c,t,n)),d.addPolyline(a)}}}function hct(e,t){let n=t.mode;(e._mode!==n||!P.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=P.clone(e.modelMatrix),e._createVertexArray=!0)}function Rq(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 Cq(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 ITe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}yf.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function PTe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Sq(e,t,n){this.count=e,this.offset=t,this.bucket=n}function jp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}jp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};jp.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"),i.push("CLIP_POLYLINE");let o=new Je({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,__]}),r=t.getVertexShaderCallback()(_X),s=new Je({defines:i,sources:[wl,r]});this.shaderProgram=nn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Dd})};function XTe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===qt.INTERSECTING}jp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!XTe(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 Sa=new h,Hm=new h,Km=new h,RB=new h,fct=new ce,pct=new k;jp.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,m=u.length;for(let p=0;p<m;++p){let b=u[p],f=b.width,y=b.show&&f>0,_=b._index,S=this.getSegments(b,a),Z=S.positions,R=S.lengths,C=Z.length,E=b.getPickId(s).color,A=0,L=0,F;for(let D=0;D<C;++D){D===0?b._loop?F=Z[C-2]:(F=RB,h.subtract(Z[0],Z[1],F),h.add(Z[0],F,F)):F=Z[D-1],h.clone(F,Hm),h.clone(Z[D],Sa),D===C-1?b._loop?F=Z[1]:(F=RB,h.subtract(Z[C-1],Z[C-2],F),h.add(Z[C-1],F,F)):F=Z[D+1],h.clone(F,Km);let w=R[A];D===L+w&&(L+=w,++A);let O=D-L===0,M=D===L+R[A]-1;c===se.SCENE2D&&(Hm.z=0,Sa.z=0,Km.z=0),(c===se.SCENE2D||c===se.MORPHING)&&(O||M)&&d-Math.abs(Sa.x)<1&&((Sa.x<0&&Hm.x>0||Sa.x>0&&Hm.x<0)&&h.clone(Sa,Hm),(Sa.x<0&&Km.x>0||Sa.x>0&&Km.x<0)&&h.clone(Sa,Km));let z=O?2:0,K=M?2:4;for(let te=z;te<K;++te){An.writeElements(Sa,e,n),An.writeElements(Hm,e,n+6),An.writeElements(Km,e,n+12);let H=te-2<0?-1:1;t[o]=D/(C-1),t[o+1]=2*(te%2)-1,t[o+2]=H,t[o+3]=_,n+=18,o+=4}}let I=fct;I.x=U.floatToByte(E.red),I.y=U.floatToByte(E.green),I.z=U.floatToByte(E.blue),I.w=U.floatToByte(E.alpha);let N=pct;N.x=f,N.y=y?1:0;let g=c===se.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,V=An.fromCartesian(g.center,WTe),G=V.high,v=ce.fromElements(V.low.x,V.low.y,V.low.z,g.radius,vTe),X=FTe;X.x=0,X.y=Number.MAX_VALUE;let Y=b.distanceDisplayCondition;l(Y)&&(X.x=Y.near,X.y=Y.far),r.setBatchedAttribute(_,0,N),r.setBatchedAttribute(_,1,I),r.attributes.length>2&&(r.setBatchedAttribute(_,2,G),r.setBatchedAttribute(_,3,v),r.setBatchedAttribute(_,4,X))}};var bct=new h,gct=new h,yct=new h,ETe=new h;jp.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,m=0;for(let p=0;p<d;++p){let b;p===0?s._loop?b=a[d-2]:(b=ETe,h.subtract(a[0],a[1],b),h.add(a[0],b,b)):b=a[p-1],b=P.multiplyByPoint(n,b,gct);let f=P.multiplyByPoint(n,a[p],bct),y;p===d-1?s._loop?y=a[1]:(y=ETe,h.subtract(a[d-1],a[d-2],y),h.add(a[d-1],y,y)):y=a[p+1],y=P.multiplyByPoint(n,y,yct);let _=c[u];p===m+_&&(m+=_,++u);let S=p-m===0,Z=p===m+c[u]-1,R=S?2:0,C=Z?2:4;for(let E=R;E<C;++E)An.writeElements(f,e,t),An.writeElements(b,e,t+6),An.writeElements(y,e,t+12),t+=18}}};var xct=new Array(1);jp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Sq(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 m=0;m<u;++m){let p=d[m];p._locatorBuckets=[];let b;if(this.mode===se.SCENE3D){b=xct;let y=p._actualPositions.length;if(y>0)b[0]=y;else continue}else b=p._segments.lengths;let f=b.length;if(f>0){let y=0;for(let _=0;_<f;++_){let S=b[_]-1;for(let Z=0;Z<S;++Z)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new Sq(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:y}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Sq(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};jp.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 OC={positions:void 0,lengths:void 0},ATe=new Array(1),Tct=new h,_ct=new pe;jp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return ATe[0]=n.length,OC.positions=n,OC.lengths=ATe,OC;XTe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=Tct;for(let d=0;d<s;++d)a=n[d],c=P.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,_ct)));if(o.length>0){e._boundingVolume2D=de.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return OC.positions=o,OC.lengths=e._segments.lengths,OC};var GTe;jp.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=GTe,c=6*s*3;!l(a)||a.length<c?a=GTe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,m=d.lengths,p=0,b=0,f=0,y;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?y=u[s-2]:(y=RB,h.subtract(u[0],u[1],y),h.add(u[0],y,y)):y=u[_-1],h.clone(y,Hm),h.clone(u[_],Sa),_===s-1?t._loop?y=u[1]:(y=RB,h.subtract(u[s-1],u[s-2],y),h.add(u[s-1],y,y)):y=u[_+1],h.clone(y,Km);let S=m[b];_===f+S&&(f+=S,++b);let Z=_-f===0,R=_===f+m[b]-1;o===se.SCENE2D&&(Hm.z=0,Sa.z=0,Km.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(Z||R)&&r-Math.abs(Sa.x)<1&&((Sa.x<0&&Hm.x>0||Sa.x>0&&Hm.x<0)&&h.clone(Sa,Hm),(Sa.x<0&&Km.x>0||Sa.x>0&&Km.x<0)&&h.clone(Sa,Km));let C=Z?2:0,E=R?2:4;for(let A=C;A<E;++A)An.writeElements(Sa,a,p),An.writeElements(Hm,a,p+6),An.writeElements(Km,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var xf=yf;function Rx(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._heightReference=e.heightReference,this._billboardCollection=new wu({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Jp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new xf,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Rx.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 Sct(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+re.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,re.pack(n,s,a),a+=re.packedLength,ne.pack(t,s,a),s}var Zct=new $n("createVectorTilePoints",5),Rct=new h;function Cct(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Sct(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=Zct.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 m=e._batchIds,p=n.length/3,b=e._heightReference??He.NONE;for(let f=0;f<p;++f){let y=m[f],_=h.unpack(n,f*3,Rct),S=c.add();S.position=_,S._batchIndex=y,S.heightReference=b;let Z=d.add();Z.text=" ",Z.position=_,Z._batchIndex=y,Z.heightReference=b;let R=u.add();R.positions=[h.clone(_),h.clone(_)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Rx.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),m=o.get(a);t[c]=new $b(e,c,d,u,m)}};Rx.prototype.applyDebugSettings=function(e,t){e?(U.clone(t,this._billboardCollection._highlightColor),U.clone(t,this._labelCollection._highlightColor),U.clone(t,this._polylineCollection._highlightColor)):(U.clone(U.WHITE,this._billboardCollection._highlightColor),U.clone(U.WHITE,this._labelCollection._highlightColor),U.clone(U.WHITE,this._polylineCollection._highlightColor))};function Vct(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=$b.defaultPointSize,s.color=$b.defaultColor,s.pointOutlineColor=$b.defaultPointOutlineColor,s.pointOutlineWidth=$b.defaultPointOutlineWidth,s.labelColor=U.WHITE,s.labelOutlineColor=U.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Tr.FILL,s.labelText=void 0,s.backgroundColor=new U(.165,.165,.165,.8),s.backgroundPadding=new k(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=U.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Ui.CENTER,s.verticalOrigin=Bn.CENTER,s.labelHorizontalOrigin=Ui.RIGHT,s.labelVerticalOrigin=Bn.BASELINE}}var Ect=new U,Act=new U,Gct=new U,Lct=new U,Wct=new U,vct=new U,CX=new Kt,VX=new Kt,Vq=new Ot;Rx.prototype.applyStyle=function(e,t){if(!l(e)){Vct(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,Ect)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Act)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Gct)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Lct)),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,Wct)),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)?(CX.near=a.x,CX.nearValue=a.y,CX.far=a.z,CX.farValue=a.w,s.scaleByDistance=CX):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(VX.near=a.x,VX.nearValue=a.y,VX.far=a.z,VX.farValue=a.w,s.translucencyByDistance=VX):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Vq.near=a.x,Vq.far=a.y,s.distanceDisplayCondition=Vq):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,vct)),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))}};Rx.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Cct(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)};Rx.prototype.isDestroyed=function(){return!1};Rx.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 EX=Rx;var qui=x(T(),1);function ng(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=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.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=ti.BOTH}Object.defineProperties(ng.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 Fct(e){let t=new Float64Array(3+h.packedLength+ne.packedLength+re.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,re.pack(e._rectangle,t,n),t}function Ict(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=tn.unpack(t,n),n+=tn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=U.unpack(t,n);n+=U.packedLength;let d=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let b=0;b<m;++b)p[b]=t[n++];s[a]=new Pp({color:c,offset:d,count:u,batchIds:p})}}var Pct=new $n("createVectorTilePolygons",5),Xct=new U;function Nct(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(re.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let b=e._batchTable,f=s.length;for(let y=0;y<f;++y){let _=b.getColor(y,Xct);s[y]=_.toRgba()}a=e._packedBuffer=Fct(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,m=e._polygonMaximumHeights;l(u)&&l(m)&&(u=u.slice(),m=m.slice(),c.push(u.buffer,m.buffer),d.minimumHeights=u,d.maximumHeights=m);let p=Pct.scheduleTask(d,c);if(l(p))return p.then(b=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(b.packedBuffer),y=f[0];Ict(e,f),e._indices=Oe.getSizeInBytes(y)===2?new Uint16Array(b.indices):new Uint32Array(b.indices),e._indexOffsets=new Uint32Array(b.indexOffsets),e._indexCounts=new Uint32Array(b.indexCounts),e._batchedPositions=new Float32Array(b.positions),e._vertexBatchIds=new Uint16Array(b.batchIds),Yct(e),e._ready=!0}).catch(b=>{e.isDestroyed()||(e._error=b)})}function Yct(e){l(e._primitive)||(e._primitive=new D_({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)}ng.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};ng.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};ng.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};ng.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};ng.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Nct(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)};ng.prototype.isDestroyed=function(){return!1};ng.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var AX=ng;var Rmi=x(T(),1);var emi=x(T(),1),GX=`in vec4 currentPosition; in vec4 previousPosition; in vec4 nextPosition; in vec2 expandAndWidth; @@ -5881,12 +7413,12 @@ float angle; vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; } -`;function uf(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??re.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=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(uf.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function IJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,de.pack(t,a,l),l+=de.packedLength,re.pack(o,a,l),l+=re.packedLength,m.pack(r,a,l),a}var WJe=new gi("createVectorTilePolylines",5),b1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function wJe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=IJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=WJe.scheduleTask(l,a);if(c(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 f=u.indexDatatype;e._indices=f===Me.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),PJe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function PJe(e,t){if(!c(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,l=i.byteLength+n.byteLength+o.byteLength;l+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=l;let d=_t.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),u=_t.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),f=_t.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),y=_t.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),h=_t.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Me.UNSIGNED_SHORT:Me.UNSIGNED_INT}),g=[{index:b1.previousPosition,vertexBuffer:d,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:b1.currentPosition,vertexBuffer:u,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:b1.nextPosition,vertexBuffer:f,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:b1.expandAndWidth,vertexBuffer:p,componentDatatype:q.FLOAT,componentsPerAttribute:2},{index:b1.a_batchId,vertexBuffer:y,componentDatatype:q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:g,indexBuffer:h}),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 nP=new M,Ble=new m;function vJe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,nP),M.multiplyByPoint(nP,e._center,Ble),M.setTranslation(nP,Ble,nP),nP},u_highlightColor:function(){return e._highlightColor}})}function FJe(e){if(c(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Oe.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var AJe=`uniform vec4 u_highlightColor; +`;function Tf(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Tf.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function wct(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+re.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,re.pack(t,a,c),c+=re.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var Mct=new $n("createVectorTilePolylines",5),BC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function kct(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=wct(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=Mct.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 m=u.indexDatatype;e._indices=m===Oe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),Uct(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function Uct(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=ot.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),u=ot.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),m=ot.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),p=ot.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),b=ot.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),f=ot.createIndexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),y=[{index:BC.previousPosition,vertexBuffer:d,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:BC.currentPosition,vertexBuffer:u,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:BC.nextPosition,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:BC.expandAndWidth,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:2},{index:BC.a_batchId,vertexBuffer:b,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Un({context:t,attributes:y,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 LX=new P,NTe=new h;function Dct(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,LX),P.multiplyByPoint(LX,e._center,NTe),P.setTranslation(LX,NTe,LX),LX},u_highlightColor:function(){return e._highlightColor}})}function Oct(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Bct=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } -`;function MJe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(tP),o=n.getFragmentShaderCallback(!1,void 0,!1)(AJe),r=new Be({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[bd,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:b1})}function NJe(e,t){if(!c(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new et({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Xe.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}uf.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!c(n)||!c(i))return;let r,s,a=n.length,l=0,d=0;for(r=0;r<a;++r)n[r]===t&&(l+=o[r+1]-o[r]);if(l===0)return;let u=new Float64Array(l*3);for(r=0;r<a;++r)if(n[r]===t){let f=o[r],p=o[r+1]-f;for(s=0;s<p;++s){let y=(f+s)*3;u[d++]=i[y],u[d++]=i[y+1],u[d++]=i[y+2]}}return u};uf.prototype.getPositions=function(e){return uf.getPolylinePositions(this,e)};uf.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 Us(e,r)}};uf.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function kJe(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=Y.WHITE}}var UJe=new Y,OJe=Y.WHITE,DJe=!0;uf.prototype.applyStyle=function(e,t){if(!c(e)){kJe(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=c(e.color)?e.color.evaluateColor(s,UJe):OJe,s.show=c(e.show)?e.show.evaluate(s):DJe}};uf.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=wJe(this,t)),c(this._error)){let i=this._error;throw this._error=void 0,i}return}vJe(this,t),MJe(this,t),FJe(this);let n=e.passes;(n.render||n.pick)&&NJe(this,e)};uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),he(this)};var A_=uf;var UBn=_(T(),1);var oBn=_(T(),1),iP=`in vec3 startEllipsoidNormal; +`;function zct(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(GX),o=n.getFragmentShaderCallback(!1,void 0,!1)(Bct),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[wl,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=nn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:BC})}function Hct(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new lt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Le.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Tf.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 m=o[r],p=o[r+1]-m;for(s=0;s<p;++s){let b=(m+s)*3;u[d++]=i[b],u[d++]=i[b+1],u[d++]=i[b+2]}}return u};Tf.prototype.getPositions=function(e){return Tf.getPolylinePositions(this,e)};Tf.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 ea(e,r)}};Tf.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Kct(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=U.WHITE}}var Jct=new U,jct=U.WHITE,Qct=!0;Tf.prototype.applyStyle=function(e,t){if(!l(e)){Kct(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,Jct):jct,s.show=l(e.show)?e.show.evaluate(s):Qct}};Tf.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=kct(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Dct(this,t),zct(this,t),Oct(this);let n=e.passes;(n.render||n.pick)&&Hct(this,e)};Tf.prototype.isDestroyed=function(){return!1};Tf.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var RS=Tf;var chi=x(T(),1);var Vmi=x(T(),1),WX=`in vec3 startEllipsoidNormal; in vec3 endEllipsoidNormal; in vec4 startPositionAndHeight; in vec4 endPositionAndHeight; @@ -5932,7 +7464,7 @@ vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); v_halfWidth = endFaceNormalAndHalfWidth.w; } -`;var sBn=_(T(),1),oP=`in vec4 v_startPlaneEC; +`;var Ami=x(T(),1),vX=`in vec4 v_startPlaneEC; in vec4 v_endPlaneEC; in vec4 v_rightPlaneEC; in float v_halfWidth; @@ -5967,19 +7499,313 @@ discard; out_FragColor = u_highlightColor; czm_writeDepthClamp(); } -`;function Vb(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??re.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(ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight),this._boundingVolume=Xn.fromRectangle(e.rectangle,ui._defaultMinTerrainHeight,ui._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=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Vb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function BJe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,l=e._rectangle;Xn.fromRectangle(l,o,r,n,a)}function YJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,de.pack(t,a,l),l+=de.packedLength,re.pack(o,a,l),l+=re.packedLength,m.pack(r,a,l),a}var HJe=new gi("createVectorTileClampedPolylines"),Ny={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function zJe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=YJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=HJe.scheduleTask(l,a);if(c(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 f=u.indexDatatype;e._indices=f===Me.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),KJe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function KJe(e,t){if(!c(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=l.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let f=_t.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),y=_t.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),h=_t.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),g=_t.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),x=_t.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),S=_t.createVertexBuffer({context:t,typedArray:l,usage:Ne.STATIC_DRAW}),V=_t.createIndexBuffer({context:t,typedArray:d,usage:Ne.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Me.UNSIGNED_SHORT:Me.UNSIGNED_INT}),Z=[{index:Ny.startEllipsoidNormal,vertexBuffer:f,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:Ny.endEllipsoidNormal,vertexBuffer:p,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:Ny.startPositionAndHeight,vertexBuffer:y,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.endPositionAndHeight,vertexBuffer:h,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.startFaceNormalAndVertexCorner,vertexBuffer:g,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.a_batchId,vertexBuffer:S,componentDatatype:q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:Z,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 rP=new M,Yle=new m;function JJe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,rP),M.multiplyByPoint(rP,e._center,Yle),M.setTranslation(rP,Yle,rP),rP},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Hle(e){return Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function QJe(e){c(e._rs)||(e._rs=Hle(!1),e._rs3DTiles=Hle(!0))}function jJe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(iP),o=n.getFragmentShaderCallback(!1,void 0,!0)(oP),r=new Be({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[bd,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Ny})}function qJe(e,t){let n=e._command;if(!c(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new et({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Xe.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=et.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Un.TERRAIN||i===Un.BOTH)&&t.commandList.push(n),(i===Un.CESIUM_3D_TILE||i===Un.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Vb.prototype.getPositions=function(e){return A_.getPolylinePositions(this,e)};Vb.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 Us(e,r)}};Vb.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function $Je(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=Y.WHITE}}var eQe=new Y,tQe=Y.WHITE,nQe=!0;Vb.prototype.applyStyle=function(e,t){if(!c(e)){$Je(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=c(e.color)?e.color.evaluateColor(s,eQe):tQe,s.show=c(e.show)?e.show.evaluate(s):nQe}};function iQe(e){return ui.initialize().then(function(){BJe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Vb.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=iQe(this).then(zJe(this,t))),c(this._error)){let i=this._error;throw this._error=void 0,i}return}JJe(this,t),jJe(this,t),QJe(this);let n=e.passes;(n.render||n.pick)&&qJe(this,e)};Vb.prototype.isDestroyed=function(){return!1};Vb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),he(this)};var sP=Vb;var zBn=_(T(),1);var aK=32767,oQe=new pe,rQe=new m;function sQe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),l=e.subarray(2*r,3*r);Fn.zigZagDeltaDecode(s,a,l);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let f=s[u],p=a[u],y=l[u],h=w.lerp(t.west,t.east,f/aK),g=w.lerp(t.south,t.north,p/aK),x=w.lerp(n,i,y/aK),S=pe.fromRadians(h,g,x,oQe),V=o.cartographicToCartesian(S,rQe);m.pack(V,d,u*3)}return d}var aP=sQe;function ff(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,uQe(this,i,o)}Object.defineProperties(ff.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return c(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.trianglesLength),c(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.geometryByteLength),c(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return c(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return c(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 aQe(e){return function(t,n){c(e._polygons)&&e._polygons.updateCommands(t,n)}}function cQe(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,l=e.POINTS_LENGTH??0;if(s>0&&c(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&c(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(l>0&&c(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,l)}let d=c(n)||c(i)||c(o),u=s>0&&!c(n)||a>0&&!c(i)||l>0&&!c(o);if(d&&u)throw new le("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)){let p=0;if(!c(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!c(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!c(o)&&l>0)for(o=new Uint16Array(l),r=0;r<l;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var mf=Uint32Array.BYTES_PER_ELEMENT;function lQe(e){return new A_(e)}function dQe(e){return new sP(e)}function uQe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=mf;let r=o.getUint32(n,!0);if(r!==1)throw new le(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=mf;let s=o.getUint32(n,!0);if(n+=mf,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=mf,a===0)throw new le("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=mf;let d=o.getUint32(n,!0);n+=mf;let u=o.getUint32(n,!0);n+=mf;let f=o.getUint32(n,!0);n+=mf;let p=o.getUint32(n,!0);n+=mf;let y=o.getUint32(n,!0);n+=mf;let h=o.getUint32(n,!0);n+=mf;let g=er(i,n,a);n+=a;let x=new Uint8Array(t,n,l);n+=l;let S,V;d>0&&(S=er(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let Z=g.POLYGONS_LENGTH??0,R=g.POLYLINES_LENGTH??0,E=g.POINTS_LENGTH??0,I=Z+R+E,v=new zp(e,I,S,V,aQe(e));if(e._batchTable=v,I===0)return;let P=new of(g,x),F=P.getGlobalProperty("REGION");if(!c(F))throw new le("Feature table global property: REGION must be defined");let N=de.unpack(F),b=F[4],G=F[5],X=e._tile.computedTransform,W=P.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(W)?(W=m.unpack(W),M.multiplyByPoint(X,W,W)):(W=de.center(N),W.height=w.lerp(b,G,.5),W=re.WGS84.cartographicToCartesian(W));let A=cQe(g,x);if(n+=(4-n%4)%4,Z>0){P.featuresLength=Z;let k=P.getPropertyArray("POLYGON_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_COUNT",q.UNSIGNED_INT,1);if(!c(k))throw new le("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=P.getPropertyArray("POLYGON_INDEX_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_INDEX_COUNT",q.UNSIGNED_INT,1);if(!c(B))throw new le("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=k.reduce(function(j,$){return j+$*2},0),H=B.reduce(function(j,$){return j+$},0),U=new Uint32Array(t,n,H);n+=f;let K=new Uint16Array(t,n,O);n+=p;let Q,ie;c(g.POLYGON_MINIMUM_HEIGHTS)&&c(g.POLYGON_MAXIMUM_HEIGHTS)&&(Q=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",q.FLOAT,1),ie=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",q.FLOAT,1)),e._polygons=new eP({positions:K,counts:k,indexCounts:B,indices:U,minimumHeight:b,maximumHeight:G,polygonMinimumHeights:Q,polygonMaximumHeights:ie,center:W,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:A.polygons,modelMatrix:X})}if(R>0){P.featuresLength=R;let k=P.getPropertyArray("POLYLINE_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYLINE_COUNT",q.UNSIGNED_INT,1);if(!c(k))throw new le("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let B=P.getPropertyArray("POLYLINE_WIDTHS",q.UNSIGNED_SHORT,1);if(!c(B)){B=new Uint16Array(R);for(let ie=0;ie<R;++ie)B[ie]=2}let O=k.reduce(function(ie,j){return ie+j*3},0),H=new Uint16Array(t,n,O);n+=y;let U=e._tileset,K=U.examineVectorLinesFunction;if(c(K)){let ie=aP(new Uint16Array(H),N,b,G,re.WGS84);mQe(ie,k,A.polylines,v,e.url,K)}let Q=lQe;c(U.classificationType)&&(Q=dQe),e._polylines=Q({positions:H,widths:B,counts:k,batchIds:A.polylines,minimumHeight:b,maximumHeight:G,center:W,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(E>0){let k=new Uint16Array(t,n,E*3);n+=h,e._points=new $w({positions:k,batchIds:A.points,minimumHeight:b,maximumHeight:G,rectangle:N,batchTable:v})}}function cK(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._polygons)&&e._polygons.createFeatures(e,n),c(e._polylines)&&e._polylines.createFeatures(e,n),c(e._points)&&e._points.createFeatures(e,n),e._features=n}}ff.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ff.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new L(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return c(this._features)||cK(this),this._features[e]};ff.prototype.applyDebugSettings=function(e,t){c(this._polygons)&&this._polygons.applyDebugSettings(e,t),c(this._polylines)&&this._polylines.applyDebugSettings(e,t),c(this._points)&&this._points.applyDebugSettings(e,t)};ff.prototype.applyStyle=function(e){c(this._features)||cK(this),c(this._polygons)&&this._polygons.applyStyle(e,this._features),c(this._polylines)&&this._polylines.applyStyle(e,this._features),c(this._points)&&this._points.applyStyle(e,this._features)};ff.prototype.update=function(e,t){let n=!0;c(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),c(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),c(this._points)&&(this._points.update(t),n=n&&this._points.ready),c(this._batchTable)&&n&&(c(this._features)||cK(this),this._batchTable.update(e,t),this._ready=!0)};ff.prototype.pick=function(e,t,n){};ff.prototype.getPolylinePositions=function(e){let t=this._polylines;if(c(t))return t.getPositions(e)};ff.prototype.isDestroyed=function(){return!1};ff.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(),he(this)};function mQe(e,t,n,i,o,r){let s=t.length,a=0;for(let l=0;l<s;l++){let d=t[l]*3,u=e.slice(a,a+d);a+=d,r(u,n[l],o,i)}}var cP=ff;var zle={b3dm:function(e,t,n,i,o){return Rd.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Rd.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Rd.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return NX.fromTileType(e,t,n,i,o,zle)},externalTileset:function(e,t,n,i){return Mw.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new DX(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new cP(e,t,n,i,o)},subt:function(e,t,n,i,o){return kC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return kC.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new le("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),l=new Uint8Array(i,o,a);return Rd.fromGltf(e,t,n,l)},gltf:function(e,t,n,i){return Rd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Rd.fromGeoJson(e,t,n,i)}},M_=zle;var V3n=_(T(),1),fQe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Ho=Object.freeze(fQe);var Z3n=_(T(),1),hf={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"};hf.isBinaryFormat=function(e){switch(e){case hf.BATCHED_3D_MODEL:case hf.INSTANCED_3D_MODEL:case hf.COMPOSITE:case hf.POINT_CLOUD:case hf.VECTOR:case hf.GEOMETRY:case hf.IMPLICIT_SUBTREE:case hf.VOXEL_BINARY:case hf.GLTF_BINARY:return!0;default:return!1}};var Zs=Object.freeze(hf);var G3n=_(T(),1),hQe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Du=Object.freeze(hQe);var X3n=_(T(),1),Hs={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},Lb=new Array(Hs.NUMBER_OF_PASSES);Lb[Hs.RENDER]=Object.freeze({pass:Hs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Lb[Hs.PICK]=Object.freeze({pass:Hs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Lb[Hs.SHADOW]=Object.freeze({pass:Hs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Lb[Hs.PRELOAD]=Object.freeze({pass:Hs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.PRELOAD_FLIGHT]=Object.freeze({pass:Hs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Hs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Hs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.MOST_DETAILED_PICK]=Object.freeze({pass:Hs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Hs.getPassOptions=function(e){return Lb[e]};var Fo=Object.freeze(Hs);var P3n=_(T(),1);function Xh(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Xh.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){throw new L("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new L("Empty3DTileContent cannot have group metadata")}}});Xh.prototype.hasProperty=function(e,t){return!1};Xh.prototype.getFeature=function(e){};Xh.prototype.applyDebugSettings=function(e,t){};Xh.prototype.applyStyle=function(e){};Xh.prototype.update=function(e,t){};Xh.prototype.pick=function(e,t,n){};Xh.prototype.isDestroyed=function(){return!1};Xh.prototype.destroy=function(){return he(this)};var y1=Xh;var H3n=_(T(),1);var N3n=_(T(),1);function Zb(e){e=e??z.EMPTY_OBJECT;let t=e.content,n=e.class;C.typeOf.object("options.content",t),C.typeOf.object("options.class",n),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 lP=Zb;function lK(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){lK._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=e.schema.classes??z.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new lP({content:n,class:o})}}lK._oneTimeWarning=ht;var N_=lK;var Q3n=_(T(),1);function pQe(e,t){let n=e.metadataExtension;if(!c(n))return;let i=n.groups,o=ri(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 k_=pQe;var cYn=_(T(),1);var tYn=_(T(),1);function Rb(e){e=e??z.EMPTY_OBJECT;let t=e.tile,n=e.class;C.typeOf.object("options.tile",t),C.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Rb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Rb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Rb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Rb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Rb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Rb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Rb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Rb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var dP=Rb;function dK(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){dK._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=e.schema.classes??z.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new dP({tile:n,class:o})}}dK._oneTimeWarning=ht;var uP=dK;var IYn=_(T(),1);var pYn=_(T(),1);function bQe(e){let t=new Uint8Array(e),n=Hm(t);if(n==="glTF"&&(n="glb"),Zs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=yQe(t);if(c(i.root))return{contentType:Zs.EXTERNAL_TILESET,jsonPayload:i};if(c(i.asset))return{contentType:Zs.GLTF,jsonPayload:i};if(c(i.tileAvailability))return{contentType:Zs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(c(i.type))return{contentType:Zs.GEOJSON,jsonPayload:i};if(c(i.voxelTable))return{contentType:Zs.VOXEL_JSON,jsonPayload:i};throw new le("Invalid tile content.")}function yQe(e){let t;try{t=er(e)}catch{throw new le("Invalid tile content.")}return t}var Gb=bQe;function Bu(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=c(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}),l=ic.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=l}}Object.defineProperties(Bu.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(){throw new L("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new L("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function uK(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Kle(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)}Bu.prototype.requestInnerContents=function(){if(!gQe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;uK(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=xQe(this,n,t,this._tile._contentState);return _Qe(this)};function gQe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];c(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!ic.serverHasOpenSlots(n,t[n]))return!1;return ic.heapHasOpenSlots(e.length)}function xQe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],l=new Jo({throttle:!0,throttleByServer:!0,type:us.TILES3D,priorityFunction:s,serverKey:a});o.request=l,e._requests[t]=l;let d=o.fetchArrayBuffer();if(c(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Kle(e,i);return}return uK(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Kle(e,i);return}uK(e,-1),Jle(e,t,u)}})}async function _Qe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>TQe(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(c),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function TQe(e,t,n){if(c(t))try{let i=Gb(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Zs.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Zs.GEOMETRY||i.contentType===Zs.VECTOR;let a,l=M_[i.contentType];c(i.binaryPayload)?a=await Promise.resolve(l(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(l(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let f=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=f.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=N_(o,d));let u=k_(o,d);return c(u)&&(a.group=new e_({metadata:u})),a}catch(i){Jle(e,n,i)}}function Jle(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=c(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}`))}Bu.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];c(t)&&t.cancel()}};Bu.prototype.hasProperty=function(e,t){return!1};Bu.prototype.getFeature=function(e){};Bu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Bu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Bu.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)};Bu.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 l=r[a].pick(e,t,n);if(!c(l))continue;let d=m.distance(e.origin,l);d<o&&(i=l,o=d)}if(c(i))return n};Bu.prototype.isDestroyed=function(){return!1};Bu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return he(this)};var mP=Bu;var GHn=_(T(),1);var cHn=_(T(),1);var OYn=_(T(),1);var Qle=Math.cos,jle=Math.sin,SQe=Math.sqrt,mK={};mK.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,l=e.nwCorner,d=e.boundingRectangle,u=l.latitude-e.granYCos*i+o*e.granXSin,f=Qle(u),p=jle(u),y=a.z*p,h=l.longitude+i*e.granYSin+o*e.granXCos,g=f*Qle(h),x=f*jle(h),S=a.x*g,V=a.y*x,Z=SQe(S*g+V*x+y*p);if(r.x=S/Z,r.y=V/Z,r.z=y/Z,n){let R=e.stNwCorner;c(R)?(u=R.latitude-e.stGranYCos*i+o*e.stGranXSin,h=R.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(h-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(h-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var CQe=new Ii,Yu=new m,VQe=new pe,Tk=new m,fP=new Xi;function qle(e,t,n,i,o,r,s){let a=Math.cos(t),l=i*a,d=n*a,u=Math.sin(t),f=i*u,p=n*u;fP._ellipsoid=re.default,Yu=fP.project(e,Yu),Yu=m.subtract(Yu,Tk,Yu);let y=Ii.fromRotation(t,CQe);Yu=Ii.multiplyByVector(y,Yu,Yu),Yu=m.add(Yu,Tk,Yu),e=fP.unproject(Yu,e),r-=1,s-=1;let h=e.latitude,g=h+r*p,x=h-l*s,S=h-l*s+r*p,V=Math.max(h,g,x,S),Z=Math.min(h,g,x,S),R=e.longitude,E=R+r*d,I=R+s*f,v=R+s*f+r*d,P=Math.max(R,E,I,v),F=Math.min(R,E,I,v);return{north:V,south:Z,east:P,west:F,granYCos:l,granYSin:f,granXCos:d,granXSin:p,nwCorner:e}}mK.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,l=e.west,d=e.north,u=e.south,f=!1,p=!1;d===w.PI_OVER_TWO&&(f=!0),u===-w.PI_OVER_TWO&&(p=!0);let y,h=d-u;l>a?y=w.TWO_PI-l+a:y=a-l;let g=Math.ceil(y/t)+1,x=Math.ceil(h/t)+1,S=y/(g-1),V=h/(x-1),Z=de.northwest(e,r),R=de.center(e,VQe);(n!==0||i!==0)&&(R.longitude<Z.longitude&&(R.longitude+=w.TWO_PI),fP._ellipsoid=re.default,Tk=fP.project(R,Tk));let E=V,I=S,v=0,P=0,F=de.clone(e,o),N={granYCos:E,granYSin:v,granXCos:I,granXSin:P,nwCorner:Z,boundingRectangle:F,width:g,height:x,northCap:f,southCap:p};if(n!==0){let b=qle(Z,n,S,V,R,g,x);if(d=b.north,u=b.south,a=b.east,l=b.west,d<-w.PI_OVER_TWO||d>w.PI_OVER_TWO||u<-w.PI_OVER_TWO||u>w.PI_OVER_TWO)throw new L("Rotated rectangle is invalid. It crosses over either the north or south pole.");N.granYCos=b.granYCos,N.granYSin=b.granYSin,N.granXCos=b.granXCos,N.granXSin=b.granXSin,F.north=d,F.south=u,F.east=a,F.west=l}if(i!==0){n=n-i;let b=de.northwest(F,s),G=qle(b,n,S,V,R,g,x);N.stGranYCos=G.granYCos,N.stGranXCos=G.granXCos,N.stGranYSin=G.granYSin,N.stGranXSin=G.granXSin,N.stNwCorner=b,N.stWest=G.west,N.stSouth=G.south}return N};var Rs=mK;var LQe=new ue,ZQe=new ue,RQe=new m,GQe=new de;function $le(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,l=2,d=0,u=4;r&&(l-=1,a-=1,d+=1,u-=2),s&&(l-=1,a-=1,d+=1,u-=2),d+=l*o+2*a-u;let f=new Float64Array(d*3),p=0,y=0,h,g=RQe;if(r)Rs.computePosition(t,n,!1,y,0,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;else for(h=0;h<o;h++)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;for(h=o-1,y=1;y<i;y++)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;if(y=i-1,!s)for(h=o-2;h>=0;h--)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;for(h=0,y=i-2;y>0;y--)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;let x=f.length/3*2,S=Me.createTypedArray(f.length/3,x),V=0;for(let R=0;R<f.length/3-1;R++)S[V++]=R,S[V++]=R+1;S[V++]=f.length/3-1,S[V++]=0;let Z=new dt({attributes:new fn,primitiveType:ve.LINES});return Z.attributes.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f}),Z.indices=S,Z}function EQe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=$le(e,t),s=t.height,a=t.width,l=ai.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=l.length,u=new Float64Array(d*2);u.set(l);let f=ai.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(f,d),r.attributes.position.values=u;let p=t.northCap,y=t.southCap,h=4;p&&(h-=1),y&&(h-=1);let g=(u.length/3+h)*2,x=Me.createTypedArray(u.length/3,g);d=u.length/6;let S=0;for(let Z=0;Z<d-1;Z++)x[S++]=Z,x[S++]=Z+1,x[S++]=Z+d,x[S++]=Z+d+1;x[S++]=d-1,x[S++]=0,x[S++]=d+d-1,x[S++]=d,x[S++]=0,x[S++]=d;let V;if(p)V=s-1;else{let Z=a-1;x[S++]=Z,x[S++]=Z+d,V=a+s-2}if(x[S++]=V,x[S++]=V+d,!y){let Z=a+V-1;x[S++]=Z,x[S]=Z+d}return r.indices=x,r}function x1(e){e=e??z.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??w.RADIANS_PER_DEGREE,i=e.ellipsoid??re.default,o=e.rotation??0;if(!c(t))throw new L("rectangle is required.");if(de._validate(t),t.north<t.south)throw new L("options.rectangle.north must be greater than options.rectangle.south");let r=e.height??0,s=e.extrudedHeight??r;this._rectangle=de.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"}x1.packedLength=de.packedLength+re.packedLength+5;x1.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,de.pack(e._rectangle,t,n),n+=de.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var ede=new de,tde=re.clone(re.UNIT_SPHERE),g1={rectangle:ede,ellipsoid:tde,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};x1.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=de.unpack(e,t,ede);t+=de.packedLength;let o=re.unpack(e,t,tde);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],d=e[t];return c(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=re.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=l,n._offsetAttribute=d===-1?void 0:d,n):(g1.granularity=r,g1.height=s,g1.rotation=a,g1.extrudedHeight=l,g1.offsetAttribute=d===-1?void 0:d,new x1(g1))};var XQe=new pe;x1.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Rs.computeOptions(t,e._granularity,e._rotation,0,GQe,XQe),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,l=!w.equalsEpsilon(s,a,0,w.EPSILON2),d;if(l){if(o=EQe(e,i),c(e._offsetAttribute)){let p=o.attributes.position.values.length/3,y=new Uint8Array(p);e._offsetAttribute===$t.TOP?y=y.fill(1,0,p/2):(d=e._offsetAttribute===$t.NONE?0:1,y=y.fill(d)),o.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}let u=ue.fromRectangle3D(t,n,s,ZQe),f=ue.fromRectangle3D(t,n,a,LQe);r=ue.union(u,f)}else{if(o=$le(e,i),o.attributes.position.values=ai.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),c(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===$t.NONE?0:1;let f=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}r=ue.fromRectangle3D(t,n,s)}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:ve.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var U_=x1;function T1(e){C.typeOf.object("options",e),C.typeOf.object("options.rectangle",e.rectangle),this.rectangle=de.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=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=e.ellipsoid??re.WGS84;vQe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(T1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});T1.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Xn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var nde=new m,Sk=new m,ide=new m,IQe=new m,WQe=new m,wQe=new m,PQe=new m,Hu=new pe,ode=new cn(m.UNIT_X,0),_1=new bn;function vQe(e,t,n){n.cartographicToCartesian(de.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(de.northeast(t),e.northeastCornerCartesian),Hu.longitude=t.west,Hu.latitude=(t.south+t.north)*.5,Hu.height=0;let i=n.cartographicToCartesian(Hu,wQe),o=m.cross(i,m.UNIT_Z,IQe);m.normalize(o,e.westNormal),Hu.longitude=t.east;let r=n.cartographicToCartesian(Hu,PQe),s=m.cross(m.UNIT_Z,r,nde);m.normalize(s,e.eastNormal);let a=m.subtract(i,r,nde);m.magnitude(a)===0&&(a=m.clone(o,a));let l=m.normalize(a,WQe),d=t.south,u;if(d>0){Hu.longitude=(t.west+t.east)*.5,Hu.latitude=d;let g=n.cartographicToCartesian(Hu,_1.origin);m.clone(l,_1.direction);let x=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,ode);qn.rayPlane(_1,x,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(g,Sk)}else u=n.geodeticSurfaceNormalCartographic(de.southeast(t),Sk);let f=m.cross(u,a,ide);m.normalize(f,e.southNormal);let p=t.north,y;if(p<0){Hu.longitude=(t.west+t.east)*.5,Hu.latitude=p;let g=n.cartographicToCartesian(Hu,_1.origin);m.negate(l,_1.direction);let x=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,ode);qn.rayPlane(_1,x,e.northeastCornerCartesian),y=n.geodeticSurfaceNormal(g,Sk)}else y=n.geodeticSurfaceNormalCartographic(de.northwest(t),Sk);let h=m.cross(a,y,ide);m.normalize(h,e.northNormal)}var FQe=new m,AQe=new m,MQe=new m(0,-1,0),NQe=new m(0,0,-1),rde=new m;function kQe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!de.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,f=e.westNormal,p=e.southNormal,y=e.eastNormal,h=e.northNormal;t.mode!==se.SCENE3D&&(d=t.mapProjection.project(de.southwest(e.rectangle),FQe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(de.northeast(e.rectangle),AQe),u.z=u.y,u.y=u.x,u.x=0,f=MQe,y=m.UNIT_Y,p=NQe,h=m.UNIT_Z);let g=m.subtract(i,d,rde),x=m.dot(g,f),S=m.dot(g,p),V=m.subtract(i,u,rde),Z=m.dot(V,y),R=m.dot(V,h);x>0?r+=x*x:Z>0&&(r+=Z*Z),S>0?r+=S*S:R>0&&(r+=R*R)}let s,a,l;if(t.mode===se.SCENE3D?(s=o.height,a=e.minimumHeight,l=e.maximumHeight):(s=i.x,a=0,l=0),s>l){let d=s-l;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}T1.prototype.distanceToCamera=function(e){C.defined("frameState",e);let t=kQe(this,e);if(e.mode===se.SCENE3D&&c(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};T1.prototype.intersectPlane=function(e){return C.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};T1.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new M.clone(M.IDENTITY),n=new U_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Rt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Xd=T1;var yzn=_(T(),1);var $Hn=_(T(),1);var vHn=_(T(),1);var hP={},UQe=new m,sde=new m,ade=new m,cde=new m,lde=new Xn;hP.validOutline=function(e){C.defined("positions",e);let n=Xn.fromPoints(e,lde).halfAxes,i=te.getColumn(n,0,sde),o=te.getColumn(n,1,ade),r=te.getColumn(n,2,cde),s=m.magnitude(i),a=m.magnitude(o),l=m.magnitude(r);return!(s===0&&(a===0||l===0)||a===0&&l===0)};hP.computeProjectTo2DArguments=function(e,t,n,i){C.defined("positions",e),C.defined("centerResult",t),C.defined("planeAxis1Result",n),C.defined("planeAxis2Result",i);let o=Xn.fromPoints(e,lde),r=o.halfAxes,s=te.getColumn(r,0,sde),a=te.getColumn(r,1,ade),l=te.getColumn(r,2,cde),d=m.magnitude(s),u=m.magnitude(a),f=m.magnitude(l),p=Math.min(d,u,f);if(d===0&&(u===0||f===0)||u===0&&f===0)return!1;let y,h;return(p===u||p===f)&&(y=s),p===d?y=a:p===f&&(h=a),(p===d||p===u)&&(h=l),m.normalize(y,n),m.normalize(h,i),m.clone(o.center,t),!0};function dde(e,t,n,i,o){let r=m.subtract(e,t,UQe),s=m.dot(n,r),a=m.dot(i,r);return D.fromElements(s,a,o)}hP.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=dde(i[r],e,t,n);return o}};hP.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return dde(i,e,t,n,o)}};var Eb=hP;function OQe(e){let t=e.length,n=new Float64Array(t*3),i=Me.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let l=e[a];n[o++]=l.x,n[o++]=l.y,n[o++]=l.z,i[r++]=a,i[r++]=(a+1)%t}let s=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:n})});return new dt({attributes:s,indices:i,primitiveType:ve.LINES})}function O_(e){e=e??z.EMPTY_OBJECT;let t=e.polygonHierarchy;C.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,m)+1}O_.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions}};return new O_(t)};O_.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var DQe={polygonHierarchy:{}};O_.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=e[t];return c(n)||(n=new O_(DQe)),n._polygonHierarchy=i,n.packedLength=o,n};O_.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,m.equalsEpsilon,!0),n.length<3||!Eb.validOutline(n))return;let o=Dn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let l=0;l<o.length;l++){let d=new Rt({geometry:OQe(o[l])});r.push(d)}let s=An.combineInstances(r)[0],a=ue.fromPoints(t.positions);return new dt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var zu=O_;var Ck=new pe;function pP(e){C.typeOf.object("options",e),C.typeOf.string("options.token",e.token);let t=Qp.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??re.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=qQe(t,n,i,o);this._boundingPlanes=r;let s=nje(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=_K(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]=_K(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=_K(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 l=t.getCenter();Ck=o.cartesianToCartographic(l,Ck),Ck.height=(i+n)/2,this.center=o.cartographicToCartesian(Ck,l),this._boundingSphere=ue.fromPoints(s)}var BQe=new m,YQe=new pe,HQe=new m,zQe=new pe,KQe=new m,JQe=new m,QQe=new m,jQe=new m;function qQe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,BQe),a=i.cartesianToCartographic(r,YQe);a.height=n;let l=i.cartographicToCartesian(a,HQe),d=cn.fromPointNormal(l,s);o[0]=d;let u=0,f,p=[],y,h;for(f=0;f<4;f++){y=e.getVertex(f),p[f]=y,h=i.cartesianToCartographic(y,zQe),h.height=t;let x=cn.getPointDistance(d,i.cartographicToCartesian(h,KQe));x<u&&(u=x)}let g=cn.clone(d);for(g.normal=m.negate(g.normal,g.normal),g.distance=g.distance*-1+u,o[1]=g,f=0;f<4;f++){y=p[f];let x=p[(f+1)%4],S=i.geodeticSurfaceNormal(y,JQe),V=m.subtract(x,y,jQe),Z=m.cross(V,S,QQe);Z=m.normalize(Z,Z),o[2+f]=cn.fromPointNormal(y,Z)}return o}var D_=new m,B_=new m,Y_=new m,fK=new m,hK=new m,pK=new m,$Qe=new m,eje=new m,tje=new m,bK=new m,yK=new m,gK=new m,ky=new m,Ih=new te;function ude(e,t,n){D_=e.normal,B_=t.normal,Y_=n.normal,fK=m.multiplyByScalar(e.normal,-e.distance,fK),hK=m.multiplyByScalar(t.normal,-t.distance,hK),pK=m.multiplyByScalar(n.normal,-n.distance,pK),bK=m.multiplyByScalar(m.cross(B_,Y_,$Qe),m.dot(fK,D_),bK),yK=m.multiplyByScalar(m.cross(Y_,D_,eje),m.dot(hK,B_),yK),gK=m.multiplyByScalar(m.cross(D_,B_,tje),m.dot(pK,Y_),gK),Ih[0]=D_.x,Ih[1]=B_.x,Ih[2]=Y_.x,Ih[3]=D_.y,Ih[4]=B_.y,Ih[5]=Y_.y,Ih[6]=D_.z,Ih[7]=B_.z,Ih[8]=Y_.z;let i=te.determinant(Ih);return ky=m.add(bK,yK,ky),ky=m.add(ky,gK,ky),new m(ky.x/i,ky.y/i,ky.z/i)}function nje(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=ude(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=ude(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var xK=new m,S1=new m;function _K(e,t){let n=[];for(let i=0;i<4;i++)xK=m.subtract(t[(i+1)%4],t[i],xK),S1=m.cross(e.normal,xK,S1),S1=m.normalize(S1,S1),n[i]=m.clone(S1);return n}Object.defineProperties(pP.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var TK=new m;pP.prototype.distanceToCamera=function(e){C.defined("frameState",e);let t=e.camera.positionWC,n=[],i=[],o;cn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):cn.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,cn.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,l;if(n.length===1)return l=this._boundingPlanes[n[0]],a=SK(cn.projectPointOntoPlane(l,t,TK),i[0],l,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=mde(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,f;for(r=0;r<2;r++)l=this._boundingPlanes[n[r]],a=SK(cn.projectPointOntoPlane(l,t,TK),i[r],l,this._edgeNormals[n[r]]),f=m.distanceSquared(a,t),f<u&&(u=f);return Math.sqrt(u)}else if(n.length>3)return a=SK(cn.projectPointOntoPlane(this._boundingPlanes[1],t,TK),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 ije=new m,oje=new m;function mde(e,t,n){let i=m.subtract(n,t,ije),o=m.subtract(e,t,oje),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 rje=new cn(m.UNIT_X,0);function SK(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let l=0;l<t.length;l++){let d=cn.fromPointNormal(t[l],i[l],rje);cn.getPointDistance(d,e)<0||(a=mde(e,t[l],t[(l+1)%4]),r=m.distance(e,a),r<o&&(o=r,s=a))}return c(s)?s:e}pP.prototype.intersectPlane=function(e){C.defined("plane",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?zt.INSIDE:n===this._vertices.length?zt.OUTSIDE:zt.INTERSECTING};pP.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new M.clone(M.IDENTITY),n=new zu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=zu.createGeometry(n),o=new Rt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),r=new zu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=zu.createGeometry(r),a=new Rt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),l=[];for(let d=0;d<4;d++){let u=new zu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),f=zu.createGeometry(u);l[d]=new Rt({geometry:f,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}})}return new In({geometryInstances:[l[0],l[1],l[2],l[3],a,o],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var bP=pP;var jzn=_(T(),1);var Nzn=_(T(),1);var wzn=_(T(),1);var sje=new m(1,1,1),Vk=Math.cos,Lk=Math.sin;function C1(e){e=e??z.EMPTY_OBJECT;let t=e.radii??sje,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??w.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??w.PI,a=Math.round(e.stackPartitions??10),l=Math.round(e.slicePartitions??8),d=Math.round(e.subdivisions??128);if(a<1)throw new L("options.stackPartitions cannot be less than 1");if(l<0)throw new L("options.slicePartitions cannot be less than 0");if(d<0)throw new L("options.subdivisions must be greater than or equal to zero.");if(c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");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=l,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}C1.packedLength=2*m.packedLength+8;C1.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=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]=e._offsetAttribute??-1,t};var fde=new m,hde=new m,Xb={radii:fde,innerRadii:hde,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};C1.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=m.unpack(e,t,fde);t+=m.packedLength;let o=m.unpack(e,t,hde);t+=m.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t];return c(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=l,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=f,n._offsetAttribute=p===-1?void 0:p,n):(Xb.minimumClock=r,Xb.maximumClock=s,Xb.minimumCone=a,Xb.maximumCone=l,Xb.stackPartitions=d,Xb.slicePartitions=u,Xb.subdivisions=f,Xb.offsetAttribute=p===-1?void 0:p,new C1(Xb))};C1.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,l=re.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 f=0,p=1,y=n.x!==t.x||n.y!==t.y||n.z!==t.z,h=!1,g=!1;y&&(p=2,r>0&&(h=!0,f+=d),s<Math.PI&&(g=!0,f+=d));let x=a*p*(u+d),S=new Float64Array(x*3),V=2*(x+f-(d+u)*p),Z=Me.createTypedArray(x,V),R,E,I,v,P=0,F=new Array(u),N=new Array(u);for(R=0;R<u;R++)v=r+R*(s-r)/(u-1),F[R]=Lk(v),N[R]=Vk(v);let b=new Array(a),G=new Array(a);for(R=0;R<a;R++)I=i+R*(o-i)/(a-1),b[R]=Lk(I),G[R]=Vk(I);for(R=0;R<u;R++)for(E=0;E<a;E++)S[P++]=t.x*F[R]*G[E],S[P++]=t.y*F[R]*b[E],S[P++]=t.z*N[R];if(y)for(R=0;R<u;R++)for(E=0;E<a;E++)S[P++]=n.x*F[R]*G[E],S[P++]=n.y*F[R]*b[E],S[P++]=n.z*N[R];for(F.length=a,N.length=a,R=0;R<a;R++)v=r+R*(s-r)/(a-1),F[R]=Lk(v),N[R]=Vk(v);for(b.length=d,G.length=d,R=0;R<d;R++)I=i+R*(o-i)/(d-1),b[R]=Lk(I),G[R]=Vk(I);for(R=0;R<a;R++)for(E=0;E<d;E++)S[P++]=t.x*F[R]*G[E],S[P++]=t.y*F[R]*b[E],S[P++]=t.z*N[R];if(y)for(R=0;R<a;R++)for(E=0;E<d;E++)S[P++]=n.x*F[R]*G[E],S[P++]=n.y*F[R]*b[E],S[P++]=n.z*N[R];for(P=0,R=0;R<u*p;R++){let A=R*a;for(E=0;E<a-1;E++)Z[P++]=A+E,Z[P++]=A+E+1}let X=u*a*p;for(R=0;R<d;R++)for(E=0;E<a-1;E++)Z[P++]=X+R+E*d,Z[P++]=X+R+(E+1)*d;if(y)for(X=u*a*p+d*a,R=0;R<d;R++)for(E=0;E<a-1;E++)Z[P++]=X+R+E*d,Z[P++]=X+R+(E+1)*d;if(y){let A=u*a*p,k=A+a*d;if(h)for(R=0;R<d;R++)Z[P++]=A+R,Z[P++]=k+R;if(g)for(A+=a*d-d,k+=a*d-d,R=0;R<d;R++)Z[P++]=A+R,Z[P++]=k+R}let W=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:S})});if(c(e._offsetAttribute)){let A=S.length,k=e._offsetAttribute===$t.NONE?0:1,B=new Uint8Array(A/3).fill(k);W.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new dt({attributes:W,indices:Z,primitiveType:ve.LINES,boundingSphere:ue.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})};var Id=C1;function V1(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Id(i),this._workerName="createSphereOutlineGeometry"}V1.packedLength=Id.packedLength;V1.pack=function(e,t,n){return C.typeOf.object("value",e),Id.pack(e._ellipsoidGeometry,t,n)};var aje=new Id,H_={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};V1.unpack=function(e,t,n){let i=Id.unpack(e,t,aje);return H_.stackPartitions=i._stackPartitions,H_.slicePartitions=i._slicePartitions,H_.subdivisions=i._subdivisions,c(n)?(m.clone(i._radii,H_.radii),n._ellipsoidGeometry=new Id(H_),n):(H_.radius=i._radii.x,new V1(H_))};V1.createGeometry=function(e){return Id.createGeometry(e._ellipsoidGeometry)};var Ib=V1;function L1(e,t){t===0&&(t=w.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(L1.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}}});L1.prototype.distanceToCamera=function(e){C.defined("frameState",e);let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};L1.prototype.intersectPlane=function(e){return C.defined("plane",e),ue.intersectPlane(this._boundingSphere,e)};L1.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};L1.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new Ib({radius:this.radius}),n=M.fromTranslation(this.center,new M.clone(M.IDENTITY)),i=new Rt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Wb=L1;var uKn=_(T(),1);var cje=new m,lje=new m,dje=new m,uje=new m;function z_(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,w.EPSILON7/i,n)}function CK(e,t){let n=m.normalize(e,uje),i=m.equalsEpsilon(n,m.UNIT_X,w.EPSILON6)?m.UNIT_Y:m.UNIT_X;return z_(e,i,t)}function pde(e){let t=te.getColumn(e,0,cje),n=te.getColumn(e,1,lje),i=te.getColumn(e,2,dje),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=z_(n,i,t):!o&&r&&!s?n=z_(t,i,n):!o&&!r&&s?i=z_(n,t,i):o?r?s||(t=CK(i,t),n=z_(i,t,n)):(t=CK(n,t),i=z_(n,t,i)):(n=CK(t,n),i=z_(n,t,i)),te.setColumn(e,0,t,e),te.setColumn(e,1,n,e),te.setColumn(e,2,i,e),e)}function Z1(e,t){t=pde(t),this._orientedBoundingBox=new Xn(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Z1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Z1.prototype.distanceToCamera=function(e){return C.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};Z1.prototype.intersectPlane=function(e){return C.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};Z1.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=pde(t),te.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};Z1.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new Fm({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Rt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Ol=Z1;function or(e,t,n,i){this._tileset=e,this._header=n;let o=c(n.contents),r=o&&n.contents.length>1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=c(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=c(i)?i.computedTransform:e.modelMatrix,l=M.multiply(a,this.transform,new M),d=c(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(d,this.transform,new M),this.computedTransform=l,this.metadata=uP(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,l),this._boundingVolume2D=void 0;let u;c(s)&&c(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,l)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let f;c(n.viewerRequestVolume)&&(f=this.createBoundingVolume(n.viewerRequestVolume,l)),this._viewerRequestVolume=f,this.geometricError=n.geometricError,this._geometricError=n.geometricError,c(this._geometricError)||(this._geometricError=c(i)?i._geometricError:e._geometricError,or._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;c(n.refine)?((n.refine==="replace"||n.refine==="add")&&or._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Bo.REPLACE:Bo.ADD):c(i)?p=i.refine:p=Bo.REPLACE,this.refine=p,this.children=[],this.parent=i;let y,h=!1,g,x,S;if(t=Ge.createIfNeeded(t),r)g=Ho.UNLOADED,x=t.clone();else if(c(s)){let E=s.uri;c(s.url)&&(or._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(or._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),y=new y1(e,this),h=!0,g=Ho.READY):(g=Ho.UNLOADED,x=t.getDerivedResource({url:E}),S=ic.getServerKey(x.getUrlComponent()))}else y=new y1(e,this),h=!0,g=Ho.READY;this._content=y,this._contentResource=x,this._contentState=g,this._expiredContent=void 0,this._serverKey=S,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!h,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,Z,R;c(V)&&(Z=V.duration,c(V.date)&&(R=ee.fromIso8601(V.date))),this.expireDuration=Z,this.expireDate=R,this.lastStyleTime=0,this._optimChildrenWithinParent=Du.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=Y.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 ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}or._deprecationWarning=Cs;Object.defineProperties(or.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 c(this._color)||(this._color=new Y),Y.clone(this._color)},set:function(e){this._color=Y.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||c(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Ho.READY}},contentUnloaded:{get:function(){return this._contentState===Ho.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Ho.EXPIRED}},contentFailed:{get:function(){return this._contentState===Ho.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Uy=new m;function mje(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,Uy),l=m.add(s.positionWC,a,Uy),d=m.subtract(l,r,Uy);if(m.magnitude(d)>o){let R=m.normalize(d,Uy),E=m.multiplyByScalar(R,o,Uy),I=m.add(r,E,Uy),v=m.subtract(I,s.positionWC,Uy),P=m.normalize(v,Uy);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Bo.REPLACE,y=n.isSkippingLevelOfDetail;if(p&&!y||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&y||n._pass===Fo.PRELOAD_FLIGHT||n._pass===Fo.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),g=n.foveatedConeSize*h;if(e._foveatedFactor<=g)return!1;let x=h-g,S=w.clamp((e._foveatedFactor-g)/x,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,S),Z=e._screenSpaceError===0&&c(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=Z}var _de=new ee;or.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=c(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:l}=e,d=a.frustum,u=l.drawingBufferWidth,f=l.drawingBufferHeight*o,p;if(e.mode===se.SCENE2D||d instanceof sn){let y=d.offCenterFrustum;c(y)&&(d=y);let h=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,f);p=s/h}else{let y=Math.max(this._distanceToCamera,w.EPSILON7),h=d.sseDenominator;if(p=s*f/(y*h),i.dynamicScreenSpaceError){let g=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,S=w.fog(y,g)*x;p-=S}}return p/=e.pixelRatio,p};function fje(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=c(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function hje(e,t){let n=t.parent,o=c(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}or.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=c(t)?t.computedTransform:n.modelMatrix,o=c(t)?t._visibilityPlaneMask:fs.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!==fs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=hje(n,this),this._priorityProgressiveResolution=fje(n,this),this.priorityDeferred=mje(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};or.prototype.updateExpiration=function(){if(c(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(_de);ee.lessThan(this.expireDate,e)&&(this._contentState=Ho.EXPIRED,this._expiredContent=this._content)}};function pje(e){if(!c(e.expireDuration))return;let t=ee.now(_de);ee.addSeconds(t,e.expireDuration,t),c(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function bje(e){return function(){return e._priority}}or.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?yje(this):xje(this)};function yje(e){let t=e._content,n=e._tileset;if(!c(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new mP(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(c(i))return e._contentState=Ho.LOADING,i.then(o=>{if(!e.isDestroyed()&&c(o))return e._contentState=Ho.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Ho.FAILED,o})}async function gje(e,t,n,i,o){let r=e._contentState;e._contentState=Ho.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=Ho.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 _je(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Ho.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Ho.FAILED,a}}function xje(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Jo({throttle:!0,throttleByServer:!0,type:us.TILES3D,priorityFunction:bje(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!c(r)){++o.statistics.numberOfAttemptedRequests;return}return gje(e,o,i,n,r)}async function _je(e,t){let n=Gb(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Zs.GEOMETRY||n.contentType===Zs.VECTOR,(n.contentType===Zs.IMPLICIT_SUBTREE||n.contentType===Zs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Zs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=M_[n.contentType];if(e.isDestroyed())return;c(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 l=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=l.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=N_(i,s));let a=k_(i,s);return c(a)&&(o.group=new e_({metadata:a})),o}or.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};or.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Ho.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 Tde=new ue;function LK(e,t){if(t.mode!==se.SCENE3D&&!c(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Tde);e._boundingVolume2D=new Wb(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Tje(e,t){if(t.mode!==se.SCENE3D&&!c(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Tde);e._contentBoundingVolume2D=new Wb(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}or.prototype.visibility=function(e,t){let n=e.cullingVolume,i=LK(this,e),o=this._tileset,r=o.clippingPlanes;if(c(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==zt.INSIDE,a===zt.OUTSIDE)return fs.MASK_OUTSIDE}let s=o.clippingPolygons;if(c(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==zt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};or.prototype.contentVisibility=function(e){if(!c(this._contentBoundingVolume))return zt.INSIDE;if(this._visibilityPlaneMask===fs.MASK_INSIDE)return zt.INSIDE;let t=e.cullingVolume,n=Tje(this,e),i=this._tileset,o=i.clippingPlanes;if(c(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==zt.INSIDE,s===zt.OUTSIDE)return zt.OUTSIDE}let r=i.clippingPolygons;if(c(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==zt.OUTSIDE,s===zt.INSIDE)return zt.OUTSIDE}return t.computeVisibility(n)};or.prototype.distanceToTile=function(e){return LK(this,e).distanceToCamera(e)};var Sje=new m;or.prototype.distanceToTileCenter=function(e){let n=LK(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,Sje);return m.dot(e.camera.directionWC,i)};or.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!c(t)||t.distanceToCamera(e)===0};var Sde=new te,Cde=new m,Cje=new te,ZK=new m,Vde=new de,Lde=new Xn,VK=new M;function Vje(e,t,n){let i=m.fromElements(e[0],e[1],e[2],ZK),o=te.fromArray(e,3,Cje);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,Sde);return o=te.multiply(r,o,o),c(n)?(n.update(i,o),n):new Ol(i,o)}function bde(e,t,n,i){let o=de.unpack(e,0,Vde),r=e[4],s=e[5],a=Xn.fromRectangle(o,r,s,re.WGS84,Lde),l=a.center,d=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,VK),VK),l=M.multiplyByPoint(t,l,l);let u=M.getMatrix3(t,Sde);return d=te.multiply(u,d,d),c(i)&&i instanceof Ol?(i.update(l,d),i):new Ol(l,d)}function Lje(e,t,n,i){if(!M.equalsEpsilon(t,n,w.EPSILON8))return i instanceof Ol?bde(e,t,n,i):bde(e,t,n,void 0);let o=de.unpack(e,0,Vde);return i instanceof Xd?(i.rectangle=de.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(re.WGS84),i):new Xd({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Zje(e,t,n){let i=m.fromElements(e[0],e[1],e[2],ZK),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,Cde),s=m.maximumComponent(r);return o*=s,c(n)?(n.update(i,o),n):new Wb(i,o)}or.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(c(i)&&(o=g_.parseBoundingVolumeSemantic("TILE",i)),c(o)&&(e=o),!c(e))throw new le("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new bP(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(c(r)){let l=Vje(r,t,n);return this._verticalExaggeration!==1&&yde(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l}if(c(s)){let l=Lje(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(l instanceof Ol?yde(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(l.minimumHeight=Lr.getHeight(l.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.maximumHeight=Lr.getHeight(l.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.computeBoundingVolumes(re.WGS84))),l}if(c(a)){let l=Zje(a,t,n);if(this._verticalExaggeration!==1){let d=Lr.getPosition(l.center,re.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,ZK),u=l.radius*this._verticalExaggeration;l.update(d,u)}return l}throw new le("boundingVolume must contain a sphere, region, or box")};var Rje=m.unpackArray(new Array(8*3).fill(0));function yde(e,t,n){let i=e.boundingVolume.computeCorners(Rje).map(r=>Lr.getPosition(r,re.WGS84,t,n,r)),o=Xn.fromPoints(i,Lde);e.update(o.center,o.halfAxes)}or.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,VK),i=!M.equals(n,this.computedTransform),o=c(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.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),c(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),c(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()};or.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,Cde),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!c(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Gje(e,t,n,i){if(!i.isRender)return;let o=c(e._contentHeader)&&c(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let l;e._finalResolution?e.hasRenderableContent?l=Y.WHITE:l=Y.DARKGRAY:l=Y.YELLOW,c(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(l)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Yt.toValue(l,d.color)}else!r&&c(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(c(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Y.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&c(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&c(e._viewerRequestVolume)?(c(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(Y.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&c(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||c(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=Y.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Eje(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&c(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(c(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Ho.FAILED,o}}function Xje(e,t){let n=t.clippingPlanes,i=0;c(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Ije(e,t){let n=t.clippingPolygons,i=0;c(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}or.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Xje(this,e),Ije(this,e),Gje(this,e,t,n),Eje(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],l=a.pass===Xe.TRANSLUCENT;a.depthForTranslucentClassification=l}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var gde=[];or.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(pje(this),this._selectedFrame=0,this.lastStyleTime=0,ee.now(this._loadTimestamp),this._contentState=Ho.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=gde;try{this._content.update(e,t)}catch(i){throw this._contentState=Ho.FAILED,i}gde.length=0,t.commandList=n};function xde(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Zk(e,t,n){return Math.max(w.normalize(e,t,n)-w.EPSILON7,0)}or.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,l=s+a,d=o,u=l+d,f=r,p=Math.pow(10,u),y=u+f,h=r,g=Math.pow(10,y),x=y+h,S=Math.pow(10,x),V=Zk(this._depth,n.depth,i.depth);V=t?1-V:V;let R=!e.isSkippingLevelOfDetail&&this.refine===Bo.REPLACE?Zk(this._priorityHolder._distanceToCamera,n.distance,i.distance):Zk(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=xde(R,a,s),I=this._priorityProgressiveResolution?0:p,v=Zk(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=xde(v,d,l),F=this.priorityDeferred?g:0,N=e._pass===Fo.PRELOAD_FLIGHT?0:S;this._priority=V+E+I+P+F+N};or.prototype.isDestroyed=function(){return!1};or.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(),he(this)};var Ku=or;var CJn=_(T(),1);var dJn=_(T(),1);function wb(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class;C.typeOf.object("options.group",n),C.typeOf.object("options.class",i);let o=c(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(wb.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}}});wb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};wb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};wb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};wb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};wb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};wb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};wb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var R1=wb;var bJn=_(T(),1);function Pb(e){e=e??z.EMPTY_OBJECT;let t=e.tileset,n=e.class;C.typeOf.object("options.tileset",t),C.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Pb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Pb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Pb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Pb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Pb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Pb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Pb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Pb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var yP=Pb;function Zde(e){e=e??z.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema;C.typeOf.object("options.metadataJson",t),C.typeOf.object("options.schema",n);let i=t.metadata??t.tileset,o;c(i)&&(o=new yP({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let l=a.length;for(let d=0;d<l;d++){let u=a[d];s.push(new R1({group:u,class:n.classes[u.class]}))}}else if(c(a)){r=Object.keys(a).sort();let l=r.length;for(let d=0;d<l;d++){let u=r[d];if(a.hasOwnProperty(u)){let f=a[u];s.push(new R1({id:u,group:a[u],class:n.classes[f.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(Zde.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 K_=Zde;var XJn=_(T(),1);var Rde={},Wje=new m;Rde.checkChildrenWithinParent=function(e){C.typeOf.object("tile",e);let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Ol||i instanceof Xd){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Du.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Ol||a instanceof Xd)){e._optimChildrenWithinParent=Du.SKIP_OPTIMIZATION;break}let l=a._orientedBoundingBox,d=m.subtract(l.center,o.center,Wje),u=m.magnitude(d);m.divideByScalar(d,u,d);let f=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(l.halfAxes[0]*d.x)+Math.abs(l.halfAxes[1]*d.y)+Math.abs(l.halfAxes[2]*d.z)+Math.abs(l.halfAxes[3]*d.x)+Math.abs(l.halfAxes[4]*d.y)+Math.abs(l.halfAxes[5]*d.z)+Math.abs(l.halfAxes[6]*d.x)+Math.abs(l.halfAxes[7]*d.y)+Math.abs(l.halfAxes[8]*d.z);if(f<=p+u){e._optimChildrenWithinParent=Du.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Du.USE_OPTIMIZATION};var gP=Rde;var AJn=_(T(),1);var wJn=_(T(),1);function xP(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(xP.prototype,{length:{get:function(){return this._length}}});function wje(e,t,n){this.item=e,this.previous=t,this.next=n}xP.prototype.add=function(e){let t=new wje(e,this.tail,void 0);return c(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Gde(e,t){c(t.previous)&&c(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):c(t.previous)?(t.previous.next=void 0,e.tail=t.previous):c(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}xP.prototype.remove=function(e){c(e)&&(Gde(this,e),--this._length)};xP.prototype.splice=function(e,t){if(e===t)return;Gde(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 _P=xP;function J_(){this._list=new _P,this._sentinel=this._list.add(),this._trimTiles=!1}J_.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};J_.prototype.touch=function(e){let t=e.cacheNode;c(t)&&this._list.splice(this._sentinel,t)};J_.prototype.add=function(e){c(e.cacheNode)||(e.cacheNode=this._list.add(e))};J_.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;c(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};J_.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)}};J_.prototype.trim=function(){this._trimTiles=!0};var TP=J_;var DJn=_(T(),1);function Rk(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 GK(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}Rk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=GK(e,n),this._referenceMaximum[n]=GK(t,n)};function Pje(e,t){let n=e.tilePropertyName;if(c(n)){let i=GK(t[n],n);return c(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var RK=[new Y(.1,.1,.1,1),new Y(.153,.278,.878,1),new Y(.827,.231,.49,1),new Y(.827,.188,.22,1),new Y(1,.592,.259,1),new Y(1,.843,0,1)];Rk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!c(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Pje(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+w.EPSILON7,l=w.clamp(i-o,0,s)/s,d=RK.length-1,u=l*d,f=Math.floor(u),p=Math.ceil(u),y=u-f,h=RK[f],g=RK[p],x=Y.clone(Y.WHITE);x.red=w.lerp(h.red,g.red,y),x.green=w.lerp(h.green,g.green,y),x.blue=w.lerp(h.blue,g.blue,y),e._debugColor=x};Rk.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(c(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=c(t)&&c(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var SP=Rk;var zJn=_(T(),1);function G1(){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}G1.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};G1.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};G1.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Rd))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};G1.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Rd))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};G1.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 pf=G1;var QJn=_(T(),1);function CP(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(CP.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});CP.prototype.makeDirty=function(){this._styleDirty=!0};CP.prototype.resetDirty=function(){this._styleDirty=!1};CP.prototype.applyStyle=function(e){if(!c(e.root)||c(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 l=a.content;a.lastStyleTime=n,l.applyStyle(this._style),i.numberOfFeaturesStyled+=l.featuresLength,++i.numberOfTilesStyled}}};var VP=CP;var rQn=_(T(),1);function vje(e,t,n){let i=ri(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;C.typeOf.object("implicitTiling",i),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!c(o.box)&&!c(o.region)&&!ri(o,"3DTILES_bounding_volume_S2")&&!ri(o,"3DTILES_bounding_volume_cylinder"))throw new le("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 Ge({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Fje(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(He(a,!0));let l=new Ge({url:a.uri});this.contentUriTemplates.push(l)}this.contentCount=this.contentHeaders.length,this.tileHeader=Aje(t),this.subdivisionScheme=tr[i.subdivisionScheme],this.branchingFactor=tr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,c(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Fje(e){if(ri(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return c(t.contents)?t.contents:t.content}return c(e.contents)?e.contents:c(e.content)?[e.content]:[]}function Aje(e){let t=He(e,!0);return c(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 Q_=vje;var yQn=_(T(),1);var dQn=_(T(),1);var LP={};function Ede(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function EK(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Xde(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 XK(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}LP.encode2D=function(e,t){if(C.typeOf.number("x",e),C.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new L("inputs must be 16-bit unsigned integers");return(Ede(e)|Ede(t)<<1)>>>0};LP.decode2D=function(e,t){if(C.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new L("input must be a 32-bit unsigned integer");return c(t)||(t=new Array(2)),t[0]=Xde(e),t[1]=Xde(e>>1),t};LP.encode3D=function(e,t,n){if(C.typeOf.number("x",e),C.typeOf.number("y",t),C.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new L("inputs must be 10-bit unsigned integers");return EK(e)|EK(t)<<1|EK(n)<<2};LP.decode3D=function(e,t){if(C.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new L("input must be a 30-bit unsigned integer");return c(t)||(t=new Array(3)),t[0]=XK(e),t[1]=XK(e>>1),t[2]=XK(e>>2),t};var Oy=LP;function zo(e){if(C.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),C.typeOf.number("options.subtreeLevels",e.subtreeLevels),C.typeOf.number("options.level",e.level),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),e.subdivisionScheme===tr.OCTREE&&C.typeOf.number("options.z",e.z),e.level<0)throw new L("level must be non-negative");if(e.x<0)throw new L("x must be non-negative");if(e.y<0)throw new L("y must be non-negative");if(e.subdivisionScheme===tr.OCTREE&&e.z<0)throw new L("z must be non-negative");let t=1<<e.level;if(e.x>=t)throw new L("x is out of range");if(e.y>=t)throw new L("y is out of range");if(e.subdivisionScheme===tr.OCTREE&&e.z>=t)throw new L("z is out of range");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===tr.OCTREE&&(this.z=e.z)}Object.defineProperties(zo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===tr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===tr.OCTREE?Oy.encode3D(this.x,this.y,this.z):Oy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===tr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});function IK(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new L("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new L("coordinates must have same subtreeLevels")}zo.prototype.getDescendantCoordinates=function(e){C.typeOf.object("offsetCoordinates",e),IK(this,e);let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===tr.OCTREE){let o=(this.z<<e.level)+e.z;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};zo.prototype.getAncestorCoordinates=function(e){if(C.typeOf.number("offsetLevels",e),e<0)throw new L("offsetLevels must be non-negative");if(e>this.level)throw new L("ancestor cannot be above the tileset root");let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===tr.OCTREE){let r=Math.floor(this.z/t);return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};zo.prototype.getOffsetCoordinates=function(e){if(C.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new L("this is not an ancestor of descendant");IK(this,e);let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===tr.OCTREE){let r=e.z%n;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};zo.prototype.getChildCoordinates=function(e){C.typeOf.number("childIndex",e);let t=tr.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new L(`childIndex must be at least 0 and less than ${t}`);let n=this.level+1,i=2*this.x+e%2,o=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===tr.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};zo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};zo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};zo.prototype.isAncestor=function(e){C.typeOf.object("descendantCoordinates",e),IK(this,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===tr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};zo.prototype.isEqual=function(e){return C.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===tr.OCTREE?this.z===e.z:!0)};zo.prototype.isImplicitTilesetRoot=function(){return this.level===0};zo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};zo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};zo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===tr.OCTREE&&(e.z=this.z),e};var Ide=[0,0,0];zo.fromMortonIndex=function(e,t,n,i){let o;return e===tr.OCTREE?(o=Oy.decode3D(i,Ide),new zo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Oy.decode2D(i,Ide),new zo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};zo.fromTileIndex=function(e,t,n){let i,o,r;return e===tr.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),zo.fromMortonIndex(e,t,i,r)};var j_=zo;var XQn=_(T(),1);var VQn=_(T(),1);function vb(){}vb.selectTiles=function(e,t){L.throwInstantiationError()};vb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};vb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};vb.selectTile=function(e,t){if(e.contentVisibility(t)===zt.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)};vb.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};vb.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};vb.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Mje(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Mje(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}vb.updateTile=function(e,t){Wde(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Uje(e),e._shouldSelect=!1,e._finalResolution=!0};function Wde(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];Wde(r,t),e._visible=r._visible;return}if(Nje(e,t)){e._visible=!1;return}let i=e.refine===Bo.REPLACE,o=e._optimChildrenWithinParent===Du.USE_OPTIMIZATION;if(i&&o&&n&&!kje(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Nje(e,t){let{parent:n,tileset:i}=e;return!c(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Bo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function kje(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 Uje(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 zs=vb;function wde(){}var ZP={stack:new Jc,stackMaximumLength:0};wde.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}=zs,s=ZP.stack;for(s.push(i);s.length>0;){ZP.stackMaximumLength=Math.max(ZP.stackMaximumLength,s.length);let a=s.pop(),l=a.refine===Bo.ADD,d=a.refine===Bo.REPLACE,u=Oje(a);u&&Dje(a,s,t),(l||d&&!u)&&(Bje(e,a),o(a,t),Yje(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return ZP.stack.trim(ZP.stackMaximumLength),n};function Oje(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Dje(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 Bje(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Yje(e,t){e.contentAvailable&&e.contentVisibility(t)!==zt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var RP=wde;var FQn=_(T(),1);function Pde(){}var GP={stack:new Jc,stackMaximumLength:0},EP={stack:new Jc,stackMaximumLength:0};Pde.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(zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;zje(n,t),GP.stack.trim(GP.stackMaximumLength),EP.stack.trim(EP.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function WK(e,t){e.contentAvailable&&zs.selectTile(e,t)}function Hje(e,t,n){let i=e.refine===Bo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:l}=zs;for(let h=0;h<r.length;++h)s(r[h],n);r.sort(zs.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,f=!1,p=-1,y=Number.MAX_VALUE;for(let h=0;h<r.length;++h){let g=r[h];if(g.isVisible?(t.push(g),g._foveatedFactor<y&&(p=h,y=g._foveatedFactor),f=!0):(d||o.loadSiblings)&&(g._foveatedFactor<y&&(p=h,y=g._foveatedFactor),a(g,n),l(g,n)),d){let x;g._inRequestVolume?g.hasRenderableContent?x=g.contentAvailable:x=Kje(g,n):x=!1,u=u&&x}}if(f||(u=!1),p!==-1&&i){let h=r[p];h._wasMinPriorityChild=!0;let g=(e._wasMinPriorityChild||e===o.root)&&y<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;g._foveatedFactor=Math.min(h._foveatedFactor,g._foveatedFactor),g._distanceToCamera=Math.min(h._distanceToCamera,g._distanceToCamera);for(let x=0;x<r.length;++x)r[x]._priorityHolder=g}return u}function zje(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=zs,a=GP.stack;for(a.push(e);a.length>0;){GP.stackMaximumLength=Math.max(GP.stackMaximumLength,a.length);let l=a.pop(),d=l.parent,u=!c(d)||d._refines;l._refines=i(l)?Hje(l,a,t)&&u:!1;let f=!l._refines&&u;l.hasRenderableContent?l.refine===Bo.ADD?(WK(l,t),o(l,t)):l.refine===Bo.REPLACE&&(o(l,t),f&&WK(l,t)):(n._emptyTiles.push(l),o(l,t),f&&WK(l,t)),r(l,t),s(l,t)}}function Kje(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=zs,s=!0,a=EP.stack;for(a.push(e);a.length>0;){EP.stackMaximumLength=Math.max(EP.stackMaximumLength,a.length);let l=a.pop(),d=l.children,u=d.length,f=!l.hasRenderableContent&&n(l);if(!f&&!l.contentAvailable&&(s=!1),i(l,t),l.isVisible||(o(l,t),r(l,t)),f)for(let p=0;p<u;++p){let y=d[p];a.push(y)}}return e.hasEmptyContent||s}var XP=Pde;var OQn=_(T(),1);function vde(){}var IP={stack:new Jc,stackMaximumLength:0},WP={stack:new Jc,stackMaximumLength:0},Fb={stack:new Jc,stackMaximumLength:0,ancestorStack:new Jc,ancestorStackMaximumLength:0},Jje=2;vde.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(zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;t4e(n,t),n4e(n,t),IP.stack.trim(IP.stackMaximumLength),WP.stack.trim(WP.stackMaximumLength),Fb.stack.trim(Fb.stackMaximumLength),Fb.ancestorStack.trim(Fb.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Qje(e,t){let{updateTile:n,touchTile:i,selectTile:o}=zs,r=WP.stack;for(r.push(e);r.length>0;){WP.stackMaximumLength=Math.max(WP.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;l<a.length;++l){let d=a[l];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<Jje&&r.push(d))}}}function Gk(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;c(n)?n._shouldSelect=!0:Qje(e,t)}function jje(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!c(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function qje(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||c(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function $je(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=zs;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(zs.sortChildrenByDistanceToCamera);let l=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),l=!0):i.loadSiblings&&(s(u,n),a(u,n))}return l}function e4e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:c(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function t4e(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}=zs,l=IP.stack;for(l.push(e);l.length>0;){IP.stackMaximumLength=Math.max(IP.stackMaximumLength,l.length);let d=l.pop();jje(d,t);let u=d.parent,f=!c(u)||u._refines;d._refines=o(d)?$je(d,l,t)&&f:!1;let p=!d._refines&&f;d.hasRenderableContent?d.refine===Bo.ADD?(Gk(d,t),r(d,t)):d.refine===Bo.REPLACE&&(e4e(d,i)?(r(d,t),p&&Gk(d,t)):p?(Gk(d,t),r(d,t)):qje(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&Gk(d,t)),s(d,t),a(d,t)}}function n4e(e,t){let{selectTile:n,canTraverse:i}=zs,{stack:o,ancestorStack:r}=Fb,s;for(o.push(e);o.length>0||r.length>0;){if(Fb.stackMaximumLength=Math.max(Fb.stackMaximumLength,o.length),Fb.ancestorStackMaximumLength=Math.max(Fb.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(!c(a))continue;let l=i(a);if(a._shouldSelect)if(a.refine===Bo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!l){n(a,t);continue}r.push(a),a._stackLength=o.length}if(l){let d=a.children;for(let u=0;u<d.length;++u){let f=d[u];f.isVisible&&o.push(f)}}}}var wP=vde;function rr(e){e=e??z.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 TP,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Jc,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024,C.typeOf.number.greaterThanOrEquals("cacheBytes",this._cacheBytes,0);let t=e.maximumCacheOverflowBytes??512*1024*1024;C.typeOf.number.greaterThanOrEquals("maximumCacheOverflowBytes",t,0),this._maximumCacheOverflowBytes=t,this._styleEngine=new VP,this._styleApplied=!1,this._modelMatrix=c(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new pf,this._statisticsLast=new pf,this._statisticsPerPass=new Array(Fo.NUMBER_OF_PASSES);for(let o=0;o<Fo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new pf;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 SP(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=w.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=e.ellipsoid??re.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??w.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Sn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Wl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Vh(e.pointCloudShading),this._pointCloudEyeDomeLighting=new lb,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye,this.tileLoad=new ye,this.tileUnload=new ye,this.tileFailed=new ye,this.tileVisible=new ye,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,c(e.clippingPlanes)&&hs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,c(e.clippingPolygons)&&qm.setOwner(e.clippingPolygons,this,"_clippingPolygons"),c(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new $x,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new sb(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??Y.BLACK,this.splitDirection=e.splitDirection??Ar.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&ht("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(rr.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){hs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){qm.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 Cs("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){C.typeOf.bool("value",e),this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!c(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){C.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){C.defined("pointCloudShading",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=M.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 c(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.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){C.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),C.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){C.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),C.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){C.typeOf.object("imageBasedLighting",this._imageBasedLighting),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,Dde(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),C.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),C.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}});rr.fromIonAssetId=async function(e,t){C.defined("assetId",e);let n=await xd.fromAssetId(e);return rr.fromUrl(n,t)};rr.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await rr.loadJson(n),r=await i4e(n,o),s=new rr(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,Dde(s);let l=c(o.asset.gltfUpAxis)?Po.fromName(o.asset.gltfUpAxis):Po.Y,d=t.modelUpAxis??l,u=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,M.IDENTITY).boundingSphere.center,y=s._ellipsoid.cartesianToCartographic(p);return c(y)&&y.height>ui._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=wt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};rr.loadJson=function(e){return Ge.createIfNeeded(e).fetchJson()};rr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};rr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!c(i))throw new le("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new le("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");c(t.extensionsRequired)&&rr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;c(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Fde(this,e,t.root,n);c(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let l=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===Bo.ADD;let d=l._header.children;if(c(d))for(let u=0;u<d.length;++u){let f=d[u],p=Fde(this,e,f,l);l.children.push(p),p._depth=l._depth+1,a.push(p)}this._cullWithChildrenBounds&&gP.checkChildrenWithinParent(l)}return s};function Fde(e,t,n,i){if(!(c(n.implicitTiling)||ri(n,"3DTILES_implicit_tiling")))return new Ku(e,t,n,i);let r=e.schema,s=new Q_(t,n,r),a=new j_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),l=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=He(n,!0);u.contents=[{uri:l}],delete u.content,delete u.extensions;let f=new Ku(e,t,u,i);return f.implicitTileset=s,f.implicitCoordinates=a,f}async function i4e(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(c(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ri.getSchemaLoader({resource:e});else if(c(n.schema))i=Ri.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new K_({schema:i.schema,metadataJson:n});return Ri.unload(i),o}var Ade=new m,o4e=new pe,r4e=new M,s4e=new m,a4e=new m,c4e=new m,l4e=new m;function d4e(e,t){let n,i,o,r,s,a=t.camera,l=e._root,d=l.contentBoundingVolume;if(d instanceof Xd)n=m.normalize(a.positionWC,Ade),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let g=M.inverseTransformation(l.computedTransform,r4e),x=t.mapProjection.ellipsoid,S=d.boundingVolume,V=M.multiplyByPoint(g,S.center,s4e);if(m.magnitude(V)>x.minimumRadius){let Z=pe.fromCartesian(V,x,o4e);n=m.normalize(a.positionWC,Ade),i=a.directionWC,o=a.positionCartographic.height,r=0,s=Z.height*2}else{let Z=M.multiplyByPoint(g,a.positionWC,a4e);if(n=m.UNIT_Z,i=M.multiplyByPointAsVector(g,a.directionWC,c4e),i=m.normalize(i,i),o=Z.z,d instanceof Ol){let R=te.getColumn(S.halfAxes,2,l4e),E=m.magnitude(R);r=V.z-E,s=V.z+E}else if(d instanceof Wb){let R=S.radius;r=V.z-R,s=V.z+R}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,f=r+(s-r)*u,p=s,y=w.clamp((o-f)/(p-f),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-y),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function u4e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();c(o)&&(o.then(r=>{!c(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{kde(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?L4e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Nde(e,t){return e._priority-t._priority}rr.prototype.postPassesUpdate=function(e){c(this._root)&&(m4e(this,e),R4e(this,e),this._cache.unloadTiles(this,Ode),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};rr.prototype.prePassesUpdate=function(e){if(!c(this._root))return;x4e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,c(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;c(n)&&n.enabled&&n.update(e),c(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&d4e(this,e),e.newFrame&&this._cache.reset()};function m4e(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!==Ho.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function f4e(e){let t=e._requestedTiles;t.sort(Nde);for(let n=0;n<t.length;++n)u4e(e,t[n])}function kde(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=c(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 h4e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Ho.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var p4e=new pe,b4e=new pe,y4e=new m;function g4e(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=pe.clone(r.positionCartographic,p4e),l=pe.fromCartesian(o.center,s,b4e);c(l)&&(a.height=l.height);let d=pe.toCartesian(a,s,y4e);m.distance(d,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{c(r.callback)&&r.callback(),r.invoked=!1}))}}function x4e(e,t){h4e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let l=0;l<n.length;++l){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[l];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,kde(u,e,d)}}e.totalMemoryUsageInBytes<i?T4e(e):a&&n.length>0&&_4e(e)}function _4e(e){ht("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset. - The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError). - Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Nde)}function T4e(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Ek=new m,S4e={maximumFractionDigits:3};function Mde(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,S4e):Math.round(t).toLocaleString()}function wK(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=m.clone(i,Ek);if(c(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(c(n)){let r=m.normalize(i,Ek);r=m.multiplyByScalar(r,.75*n,Ek),o=m.add(r,i,Ek)}return o}function PK(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` +`;function ig(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=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 k(Pi._defaultMinTerrainHeight,Pi._defaultMaxTerrainHeight),this._boundingVolume=tn.fromRectangle(e.rectangle,Pi._defaultMinTerrainHeight,Pi._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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ig.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function qct(e,t,n){let i=Pi.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;tn.fromRectangle(c,o,r,n,a)}function $ct(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+re.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,re.pack(t,a,c),c+=re.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var elt=new $n("createVectorTileClampedPolylines"),Cx={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function tlt(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=$ct(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=elt.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 m=u.indexDatatype;e._indices=m===Oe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),nlt(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function nlt(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 m=ot.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),p=ot.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),b=ot.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),f=ot.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),y=ot.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),_=ot.createVertexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW}),S=ot.createVertexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW}),Z=ot.createIndexBuffer({context:t,typedArray:d,usage:Pe.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),R=[{index:Cx.startEllipsoidNormal,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Cx.endEllipsoidNormal,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Cx.startPositionAndHeight,vertexBuffer:b,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Cx.endPositionAndHeight,vertexBuffer:f,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Cx.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Cx.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Cx.a_batchId,vertexBuffer:S,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Un({context:t,attributes:R,indexBuffer:Z}),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 FX=new P,YTe=new h;function ilt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,FX),P.multiplyByPoint(FX,e._center,YTe),P.setTranslation(FX,YTe,FX),FX},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function wTe(e){return ze.fromCache({cull:{enabled:!0,face:Di.FRONT},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function olt(e){l(e._rs)||(e._rs=wTe(!1),e._rs3DTiles=wTe(!0))}function rlt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(WX),o=n.getFragmentShaderCallback(!1,void 0,!0)(vX),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[wl,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=nn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Cx})}function slt(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new lt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Le.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=lt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===ti.TERRAIN||i===ti.BOTH)&&t.commandList.push(n),(i===ti.CESIUM_3D_TILE||i===ti.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}ig.prototype.getPositions=function(e){return RS.getPolylinePositions(this,e)};ig.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 ea(e,r)}};ig.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function alt(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=U.WHITE}}var clt=new U,llt=U.WHITE,dlt=!0;ig.prototype.applyStyle=function(e,t){if(!l(e)){alt(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,clt):llt,s.show=l(e.show)?e.show.evaluate(s):dlt}};function ult(e){return Pi.initialize().then(function(){qct(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}ig.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=ult(this).then(tlt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}ilt(this,t),rlt(this,t),olt(this);let n=e.passes;(n.render||n.pick)&&slt(this,e)};ig.prototype.isDestroyed=function(){return!1};ig.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var IX=ig;var fhi=x(T(),1);var Eq=32767,mlt=new pe,hlt=new h;function flt(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);dn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],b=c[u],f=W.lerp(t.west,t.east,m/Eq),y=W.lerp(t.south,t.north,p/Eq),_=W.lerp(n,i,b/Eq),S=pe.fromRadians(f,y,_,mlt),Z=o.cartographicToCartesian(S,hlt);h.pack(Z,d,u*3)}return d}var PX=flt;var Gq=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,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,xlt(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||Aq(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||Aq(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||Aq(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){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 plt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function blt(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=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 _f=Uint32Array.BYTES_PER_ELEMENT;function glt(e){return new RS(e)}function ylt(e){return new IX(e)}function xlt(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=_f;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=_f;let s=o.getUint32(n,!0);if(n+=_f,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=_f,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=_f;let d=o.getUint32(n,!0);n+=_f;let u=o.getUint32(n,!0);n+=_f;let m=o.getUint32(n,!0);n+=_f;let p=o.getUint32(n,!0);n+=_f;let b=o.getUint32(n,!0);n+=_f,n+=_f;let f=vr(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let _,S;d>0&&(_=vr(i,n,d),n+=d,u>0&&(S=new Uint8Array(t,n,u),S=new Uint8Array(S),n+=u));let Z=f.POLYGONS_LENGTH??0,R=f.POLYLINES_LENGTH??0,C=f.POINTS_LENGTH??0,E=Z+R+C,A=new $h(e,E,_,S,plt(e));if(e._batchTable=A,E===0)return;let L=new cf(f,y),F=L.getGlobalProperty("REGION");if(!l(F))throw new ae("Feature table global property: REGION must be defined");let I=re.unpack(F),N=F[4],g=F[5],V=e._tile.computedTransform,G=L.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(G)?(G=h.unpack(G),P.multiplyByPoint(V,G,G)):(G=re.center(I),G.height=W.lerp(N,g,.5),G=ne.WGS84.cartographicToCartesian(G));let v=blt(f,y);if(n+=(4-n%4)%4,Z>0){L.featuresLength=Z;let Y=L.getPropertyArray("POLYGON_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYGON_COUNT",J.UNSIGNED_INT,1);if(!l(Y))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let D=L.getPropertyArray("POLYGON_INDEX_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYGON_INDEX_COUNT",J.UNSIGNED_INT,1);if(!l(D))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let w=Y.reduce(function(H,$){return H+$*2},0),O=D.reduce(function(H,$){return H+$},0),M=new Uint32Array(t,n,O);n+=m;let z=new Uint16Array(t,n,w);n+=p;let K,te;l(f.POLYGON_MINIMUM_HEIGHTS)&&l(f.POLYGON_MAXIMUM_HEIGHTS)&&(K=L.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",J.FLOAT,1),te=L.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",J.FLOAT,1)),e._polygons=new AX({positions:z,counts:Y,indexCounts:D,indices:M,minimumHeight:N,maximumHeight:g,polygonMinimumHeights:K,polygonMaximumHeights:te,center:G,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:A,batchIds:v.polygons,modelMatrix:V})}let X=e._tileset;if(R>0){L.featuresLength=R;let Y=L.getPropertyArray("POLYLINE_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYLINE_COUNT",J.UNSIGNED_INT,1);if(!l(Y))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let D=L.getPropertyArray("POLYLINE_WIDTHS",J.UNSIGNED_SHORT,1);if(!l(D)){D=new Uint16Array(R);for(let K=0;K<R;++K)D[K]=2}let w=Y.reduce(function(K,te){return K+te*3},0),O=new Uint16Array(t,n,w);n+=b;let M=X.examineVectorLinesFunction;if(l(M)){let K=PX(new Uint16Array(O),I,N,g,ne.WGS84);Tlt(K,Y,v.polylines,A,e.url,M)}let z=glt;l(X.classificationType)&&(z=ylt),e._polylines=z({positions:O,widths:D,counts:Y,batchIds:v.polylines,minimumHeight:N,maximumHeight:g,center:G,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:A,classificationType:X.classificationType,keepDecodedPositions:X.vectorKeepDecodedPositions})}if(C>0){let Y=new Uint16Array(t,n,C*3);e._points=new EX({positions:Y,batchIds:v.points,minimumHeight:N,maximumHeight:g,rectangle:I,batchTable:A,heightReference:X.heightReference,scene:X.scene})}}function Aq(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}}function Tlt(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 XX=Gq;var X0i=x(T(),1);var whi=x(T(),1);var{ERR_CAPACITY:Nhi}=na.Error,_lt=new h,CB=class CB extends os{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(_lt)),i}get vertexOffset(){return this._getUint32(CB.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,o=this.vertexOffset;i._positionView[o*3]=n.x,i._positionView[o*3+1]=n.y,i._positionView[o*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};mt(CB,"Layout",{...os.Layout,POSITION_OFFSET_U32:os.Layout.__BYTE_LENGTH,__BYTE_LENGTH:os.Layout.__BYTE_LENGTH+4});var Lq=CB,Pc=Lq;var Vfi=x(T(),1);var yfi=x(T(),1);var Uhi=x(T(),1),NX=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +#else +in vec3 position; +#endif +in vec4 pickColor; +in vec4 showPixelSizeColorAlpha; +in vec3 outlineWidthColorAlpha; +out vec4 v_pickColor; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerRadiusFrac; +void main() +{ +float show = showPixelSizeColorAlpha.x; +float pixelSize = showPixelSizeColorAlpha.y; +vec4 color = czm_decodeRGB8(showPixelSizeColorAlpha.z); +float alpha = showPixelSizeColorAlpha.w; +float outlineWidth = outlineWidthColorAlpha.x; +vec4 outlineColor = czm_decodeRGB8(outlineWidthColorAlpha.y); +float outlineAlpha = outlineWidthColorAlpha.z; +float innerRadius = 0.5 * pixelSize * czm_pixelRatio; +float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio; +#ifdef USE_FLOAT64 +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +#endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha * show; +v_outlineColor = outlineColor; +v_outlineColor.a *= outlineAlpha * show; +v_innerRadiusFrac = innerRadius / outerRadius; +gl_PointSize = 2.0 * outerRadius * show; +gl_Position *= show; +} +`;var Ohi=x(T(),1),YX=`in vec4 v_pickColor; +in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerRadiusFrac; +void main() +{ +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +float delta = fwidth(distanceToCenter); +float outerLimit = 0.5; +float innerLimit = 0.5 * v_innerRadiusFrac; +float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter); +float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter); +vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha); +color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha); +if (color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); +} +`;var Khi=x(T(),1);var wX=class wX extends Kl{constructor(t=B.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};mt(wX,"Layout",{...Kl.Layout,SIZE_U8:Kl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Kl.Layout.__BYTE_LENGTH+4}),mt(wX,"DEFAULT_MATERIAL",Object.freeze(new wX));var Wq=wX,Sf=Wq;var vq={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},MTe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},CS=new Pc,Zf=new Sf,MX=new U,kTe=new h,Fq=new An;function Slt(e,t,n){let i=t.context;n=n||{destroy:Zlt};let o=e._positionDatatype===J.DOUBLE,r=o?vq:MTe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...o?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,d=a.positionLow,u=a.pickColor,m=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:b,_dirtyCount:f}=e;for(let y=b,_=b+f;y<_;y++)e.get(y,CS),CS._dirty&&(o&&(CS.getPosition(kTe),An.fromCartesian(kTe,Fq),h.pack(Fq.high,c,y*3),h.pack(Fq.low,d,y*3)),CS.getMaterial(Zf),U.fromRgba(CS._pickId,MX),u[y*4]=U.floatToByte(MX.red),u[y*4+1]=U.floatToByte(MX.green),u[y*4+2]=U.floatToByte(MX.blue),u[y*4+3]=U.floatToByte(MX.alpha),m[y*4]=CS.show?1:0,m[y*4+1]=Zf.size,m[y*4+2]=dn.encodeRGB8(Zf.color),m[y*4+3]=Zf.color.alpha,p[y*3]=Zf.outlineWidth,p[y*3+1]=dn.encodeRGB8(Zf.outlineWidth>0?Zf.outlineColor:Zf.color),p[y*3+2]=Zf.outlineWidth>0?Zf.outlineColor.alpha:Zf.color.alpha,CS._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in r)if(Object.hasOwn(r,a)){let c=a;n.vertexArray.copyAttributeFromRange(r[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new Un({context:i,attributes:[...o?[{index:vq.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:vq.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:MTe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:e._positionView,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:ot.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showSizeColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:ot.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Pe.STATIC_DRAW})},{index:r.outlineWidthColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Yi.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=nn.fromCache({context:i,vertexShaderSource:new Je({sources:[NX],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[YX]}),attributeLocations:r})),l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.POINTS,pass:e._blendOption===Yi.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function Zlt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var kX=Slt;var Iq=class e extends na{constructor(t=B.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Pc}_getMaterialClass(){return Sf}_cloneEmpty(t=B.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Pc){return super.add(t,n),n._setUint32(Pc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=kX(this,t,this._renderContext))}},Od=Iq;var lpi=x(T(),1);var tpi=x(T(),1);var Afi=x(T(),1),UX=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +in vec3 prevPositionHigh; +in vec3 prevPositionLow; +in vec3 nextPositionHigh; +in vec3 nextPositionLow; +#else +in vec3 position; +in vec3 prevPosition; +in vec3 nextPosition; +#endif +in vec4 pickColor; +in vec4 showColorWidthAndTexCoord; +in float alpha; +out vec4 v_pickColor; +out vec4 v_color; +out vec2 v_st; +out float v_width; +out float v_polylineAngle; +void main() +{ +float show = showColorWidthAndTexCoord.x; +vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y); +float signedWidth = showColorWidthAndTexCoord.z; +float texCoord = showColorWidthAndTexCoord.w; +bool usePrevious = texCoord == 1.0; +float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0; +float polylineAngle; +#ifdef USE_FLOAT64 +vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow); +vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow); +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0); +vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0); +#endif +float width = abs(signedWidth); +if (signedWidth < 0.0) +{ +width /= max(czm_metersPerPixel(positionEC), czm_epsilon7); +} +#ifdef USE_FLOAT64 +vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); +#else +vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); +#endif +gl_Position = czm_viewportOrthographic * positionWC * show; +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha / 255.0 * show; +v_st.s = texCoord; +v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); +v_width = width; +v_polylineAngle = polylineAngle; +} +`;var Lfi=x(T(),1),DX=`in vec4 v_pickColor; +in vec4 v_color; +void main() +{ +if (v_color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var VS={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},VB={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},ul=new ga,OX=new Au,BX=new U,UTe=new h,DTe=new h,OTe=new h,Pq=new An,Xq=new An,Nq=new An;function Rlt(e,t,n){let i=t.context;n=n||{destroy:Elt};let o=e._positionDatatype===J.DOUBLE,r=o?VS:VB;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,d=e.vertexCountMax*2;n.indexArray=Oe.createTypedArray(d,c*6),n.attributeArrays={...o?{positionHigh:new Float32Array(d*3),positionLow:new Float32Array(d*3),prevPositionHigh:new Float32Array(d*3),prevPositionLow:new Float32Array(d*3),nextPositionHigh:new Float32Array(d*3),nextPositionLow:new Float32Array(d*3)}:{position:J.createTypedArray(e._positionDatatype,d*3),prevPosition:J.createTypedArray(e._positionDatatype,d*3),nextPosition:J.createTypedArray(e._positionDatatype,d*3)},pickColor:new Uint8Array(d*4),showColorWidthAndTexCoord:new Float32Array(d*4),alpha:new Uint8Array(d)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:d}=e,u=e.widthUnits==="meters",m=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:b,alpha:f,position:y,prevPosition:_,nextPosition:S,positionHigh:Z,positionLow:R,prevPositionHigh:C,prevPositionLow:E,nextPositionHigh:A,nextPositionLow:L}=n.attributeArrays;for(let F=c,I=c+d;F<I;F++){if(e.get(F,ul),!ul._dirty)continue;ul.getMaterial(OX);let N=dn.encodeRGB8(OX.color),g=OX.color.alpha,V=u?-OX.width:OX.width;U.fromRgba(ul._pickId,BX);let G=ul.show,v=ul.vertexOffset*2,X=(ul.vertexOffset-F)*6,Y=e._positionView,D=ul.vertexOffset*3;for(let w=0,O=ul.vertexCount;w<O;w++){let M=w===0,z=w===O-1,K=Y[D+w*3],te=Y[D+w*3+1],H=Y[D+w*3+2],$,ee,le,_e,he,Ze;M?(_e=Y[D+3],he=Y[D+3+1],Ze=Y[D+3+2],$=2*K-_e,ee=2*te-he,le=2*H-Ze):z?($=Y[D+(w-1)*3],ee=Y[D+(w-1)*3+1],le=Y[D+(w-1)*3+2],_e=2*K-$,he=2*te-ee,Ze=2*H-le):($=Y[D+(w-1)*3],ee=Y[D+(w-1)*3+1],le=Y[D+(w-1)*3+2],_e=Y[D+(w+1)*3],he=Y[D+(w+1)*3+1],Ze=Y[D+(w+1)*3+2]),z||(m[X]=v,m[X+1]=v+1,m[X+2]=v+2,m[X+3]=v+2,m[X+4]=v+1,m[X+5]=v+3,X+=6),o&&(h.fromElements(K,te,H,UTe),h.fromElements($,ee,le,DTe),h.fromElements(_e,he,Ze,OTe),An.fromCartesian(UTe,Pq),An.fromCartesian(DTe,Xq),An.fromCartesian(OTe,Nq));for(let ye=0;ye<2;ye++)o?(h.pack(Pq.high,Z,v*3),h.pack(Pq.low,R,v*3),h.pack(Xq.high,C,v*3),h.pack(Xq.low,E,v*3),h.pack(Nq.high,A,v*3),h.pack(Nq.low,L,v*3)):(y[v*3]=K,y[v*3+1]=te,y[v*3+2]=H,_[v*3]=$,_[v*3+1]=ee,_[v*3+2]=le,S[v*3]=_e,S[v*3+1]=he,S[v*3+2]=Ze),p[v*4]=U.floatToByte(BX.red),p[v*4+1]=U.floatToByte(BX.green),p[v*4+2]=U.floatToByte(BX.blue),p[v*4+3]=U.floatToByte(BX.alpha),b[v*4]=G?1:0,b[v*4+1]=N,b[v*4+2]=V,b[v*4+3]=w/(O-1),f[v]=g*255,v++}ul._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=Vlt(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,d);for(let p in r)if(Object.hasOwn(r,p)){let b=p;n.vertexArray.copyAttributeFromRange(r[b],n.attributeArrays[b],u,m)}}}else{let c=n.attributeArrays;n.vertexArray=new Un({context:i,indexBuffer:ot.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:VS.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:VS.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})},{index:VS.prevPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:VS.prevPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Pe.STATIC_DRAW})},{index:VS.nextPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:VS.nextPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:VB.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})},{index:VB.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Pe.STATIC_DRAW})},{index:VB.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:ot.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorWidthAndTexCoord,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:ot.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Pe.STATIC_DRAW})},{index:r.alpha,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:ot.createVertexBuffer({typedArray:c.alpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Yi.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=nn.fromCache({context:i,vertexShaderSource:new Je({sources:[wl,UX],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[DX]}),attributeLocations:r}));let s=Clt(e);l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Yi.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function Clt(e){return(e.vertexCount-e.primitiveCount)*6}function Vlt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ul);let i=ul.vertexOffset*2,r=(ul.vertexOffset-t)*6;e.get(t+n-1,ul);let s=(ul.vertexOffset+ul.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:s}}function Elt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var zX=Rlt;var Yq=class e extends na{constructor(t=B.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return ga}_getMaterialClass(){return Au}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new ga){super.add(t,n);let i=this._positionCount;return n._setUint32(ga.Layout.POSITION_OFFSET_U32,i),n._setUint32(ga.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=zX(this,t,this._renderContext))}},ml=Yq;var Rpi=x(T(),1);var ppi=x(T(),1);function zC(e,t){this._conditionsExpression=$e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Glt(this,t)}Object.defineProperties(zC.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Alt(e,t){this.condition=e,this.expression=t}function Glt(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 Alt(new vm(a,t),new vm(c,t)))}e._runtimeConditions=n}zC.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)}};zC.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)}};zC.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};zC.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];ii(e,o.condition.getVariables()),ii(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var HX=zC;function Vx(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._lineWidth=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,Llt(this,e)}function Llt(e,t){t=$e(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,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??B.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new vm(o[r],i))}e._meta=n,e._ready=!0}function _r(e,t){let n=(e._style??B.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new vm(String(t));if(typeof t=="string")return new vm(t,n);if(l(t.conditions))return new HX(t,n)}else return;return t}function Sr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return $e(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Vx.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=_r(this,e),this._style.show=Sr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=_r(this,e),this._style.color=Sr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=_r(this,e),this._style.pointSize=Sr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=_r(this,e),this._style.pointOutlineColor=Sr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=_r(this,e),this._style.pointOutlineWidth=Sr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=_r(this,e),this._style.labelColor=Sr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=_r(this,e),this._style.labelOutlineColor=Sr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=_r(this,e),this._style.labelOutlineWidth=Sr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=_r(this,e),this._style.font=Sr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=_r(this,e),this._style.labelStyle=Sr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=_r(this,e),this._style.labelText=Sr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=_r(this,e),this._style.backgroundColor=Sr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=_r(this,e),this._style.backgroundPadding=Sr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=_r(this,e),this._style.backgroundEnabled=Sr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=_r(this,e),this._style.scaleByDistance=Sr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=_r(this,e),this._style.translucencyByDistance=Sr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=_r(this,e),this._style.distanceDisplayCondition=Sr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=_r(this,e),this._style.heightOffset=Sr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=_r(this,e),this._style.anchorLineEnabled=Sr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=_r(this,e),this._style.anchorLineColor=Sr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=_r(this,e),this._style.image=Sr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=_r(this,e),this._style.disableDepthTestDistance=Sr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=_r(this,e),this._style.horizontalOrigin=Sr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=_r(this,e),this._style.verticalOrigin=Sr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=_r(this,e),this._style.labelHorizontalOrigin=Sr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=_r(this,e),this._style.labelVerticalOrigin=Sr(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=_r(this,e),this._style.lineWidth=Sr(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Vx.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new Vx(n)})};Vx.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)};Vx.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)};Vx.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)};Vx.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ii(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ii(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ii(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var og=Vx;var Ipi=x(T(),1);var HTe=new re,BTe=new re,wq=new re,EB=new Map;EB.set(ml,{packCollectionData:Ts.packPolylineCollectionData,packTilePrimitives:Ts.packPolylineSegments});EB.set(Ya,{packCollectionData:Ts.packPolygonCollectionData,packTilePrimitives:Ts.packPolygonRings});var Mq=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return EB.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=re.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new re);this._dirtyRectangles.push(n)}requestTileData(t,n,i,o,r){let s=this._tilingScheme.tileXYToRectangle(t,n,i,HTe);return this.requestDataForRectangle(s,o,r)}requestDataForRectangle(t,n,i){let o=this._tilingScheme,r=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:re.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:Wlt(t,o.ellipsoid)};for(let[d,u]of r){if(!zTe(u,i))continue;let m=re.fromBoundingSphere(d.boundingVolume,o.ellipsoid,BTe);if(!!!re.intersection(t,m,wq))continue;let b=EB.get(d.constructor),f=this._getCollectionDataCached(d,b.packCollectionData);s.collectionVersions.set(d,f.version),b.packTilePrimitives(d,f,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Ts.packPolylineGrid(s),Ts.packPolylineTextures(n,s)),c&&(Ts.packPolygonGrid(s),Ts.packPolygonTextures(n,s)),Ts.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ts.freeResources(t)}updateTileData(t,n,i,o,r,s){let a=this._dirtyRectangles,c=this._tilingScheme;return vlt(t,n,i,a,c)?(this.releaseTileData(r),this.requestTileData(t,n,i,o,s)):r}updateDataForRectangle(t,n,i,o){return this._isStale(i,t,o)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,o)):i}_isStale(t,n,i){if(!re.equals(t.rectangle,n))return!0;let o=t.collectionVersions,r=this._heightReferenceByCollection,s=0;for(let[a,c]of r){if(!zTe(c,i))continue;let d=re.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,BTe),u=!!re.intersection(n,d,wq),m=o.get(a);if(!u){if(l(m))return!0;continue}if(!l(m)||(s++,a._dirtyCount>0||m!==a._version))return!0}return s!==o.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(re.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),o=t._dirtyCount>0,r=i?.version!==t._version;if(l(i)&&!o&&!r)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(o?1:0),a.rectangle=re.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function zTe(e,t){return e===He.CLAMP_TO_GROUND||e===t}function Wlt(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new k(e.width*n*Math.cos(i),e.height*n)}function vlt(e,t,n,i,o){if(i.length===0)return!1;let r=o.tileXYToRectangle(e,t,n,HTe);for(let s=0;s<i.length;s++)if(re.intersection(r,i[s],wq))return!0;return!1}var rg=Mq;var f0i=x(T(),1);var Jpi=x(T(),1);var KTe=new Pc,JTe=new ga,jTe=new Ir,Flt=new Sf,Ilt=new Au,Plt=new Eu,kq=class{constructor(t,n,i=0){mt(this,"_color",new U);mt(this,"_outlineColor",new U);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return U.clone(t.color,this._color);return U.clone(U.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())U.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())U.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())U.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())U.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ea.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new ge("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(Od,KTe),yield*this._iteratePrimitivesWith(ml,JTe),yield*this._iteratePrimitivesWith(Ya,jTe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let o=0;o<i.length;o++){let r=i[o],s=this._primitivesByCollection.get(o);if(s&&r instanceof t)for(let a of s)r.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(Od,KTe,Flt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ml,JTe,Ilt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Ya,jTe,Plt)}*_iterateMaterialsWith(t,n,i){for(let o of this._iteratePrimitivesWith(t,n))o.getMaterial(i),yield i,o.setMaterial(i)}},ES=kq;var QTe=new h,Xlt=new Pc,Nlt=new ga,$Te=new Ir;function Ylt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let o=0;o<n.length;o++)e_e(e,n[o],P.IDENTITY,i);return i}function AB(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function wlt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,o=e.primitiveType,s=Zt.getAttributeBySemantic(e,dt.POSITION).count,a=e.indices?xa.readIndicesAsTypedArray(e.indices):void 0;if(o===Ie.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(o===Ie.LINE_STRIP){let c=n?n.count:qTe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(o===Ie.TRIANGLES||o===Ie.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let d=0;d<c.length;d++)t.polygonHoleCount+=c[d]}else{let c=qTe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new ae(`Unexpected primitive type: ${o}`);return t}function qTe(e){let t=AB(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Mlt(e,t,n,i,o){let r=Zt.getAttributeBySemantic(t,dt.POSITION),s=r.typedArray??(n.positionNormalized?xa.readAttributeAsRawCompactTypedArray(r):xa.readAttributeAsTypedArray(r)),a=t.indices?xa.readIndicesAsTypedArray(t.indices):void 0,c=klt(e,t,o);n instanceof Od?Ult(n,i,s,a,c):n instanceof ml?Dlt(n,i,s,a,c):n instanceof Ya&&(l(t.vector)?Olt(n,i,s,a,c,t.vector):Blt(n,i,s,c,t.polygon))}function klt(e,t,n){let i=e.tileset.featureIdLabel,o=Zt.getFeatureIdsByLabel(t.featureIds,i);if(!(o instanceof Vn.FeatureIdAttribute))return()=>{};let r=Zt.getAttributeBySemantic(t,dt.FEATURE_ID,o.setIndex),s=r.typedArray??xa.readAttributeAsTypedArray(r);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let d=new ES(e,c,o.propertyTableId);n.set(c,d)}}return function(c){let d=s[c];if(d!==o.nullFeatureId)return n.get(d)}}function Ult(e,t,n,i,o){let r=n.length/3;for(let s=0,a=i?i.length:r;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,QTe);let d=o(c);d&&d.addPrimitiveByCollection(t,s),e.add({position:QTe,pickObject:d,featureId:d?.featureId},Xlt)}}function Dlt(e,t,n,i,o){let r=AB(i),s=0,a=0,c=0;for(let d=0;d<i.length;d++){if(i[d]===r?a=d-s:d+1===i.length&&(a=d+1-s),a===0)continue;let m=s+a,p=i.subarray(s,m),b=t_e(n,p,3),f=o(i[s]);f&&f.addPrimitiveByCollection(t,c),e.add({positions:b,pickObject:f,featureId:f?.featureId},Nlt),s=d+1,a=0,c++}}function Olt(e,t,n,i,o,r){let s=r.polygonAttributeOffsets,a=r.polygonIndicesOffsets,c=r.polygonHoleCounts,d=r.polygonHoleOffsets,u=n.length/3,m=s.length;for(let p=0;p<m;p++){let b=s[p],f=p+1<m?s[p+1]:u,y=n.subarray(b*3,f*3),_;if(l(c)&&c[p]>0){let E=c[p];_=d.slice(p,p+E);for(let A=0;A<E;A++)_[A]-=b}let S=a[p],Z=p+1<m?a[p+1]:i.length,R=i.slice(S,Z);for(let E=0;E<R.length;E++)R[E]-=b;let C=o(b);C&&C.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:R,holes:_,pickObject:C,featureId:C?.featureId},$Te)}}function Blt(e,t,n,i,o){let r=o.loopIndices.constructor,s=new r(o.loopIndices.length),a=AB(o.loopIndices);for(let c=0;c<o.count;c++){let d=c+1===o.count,u=o.loopIndicesOffsets[c],m=d?o.loopIndices.length:o.loopIndicesOffsets[c+1],p=o.loopIndices.subarray(u,m),b=t_e(n,p,3,s),f=[];for(let Z=0;Z<p.length;Z++){let R=Z+1===p.length;p[Z]===a&&!R&&f.push(Z)}let y=new r(f),_;if(l(o.triangleIndices)){let Z=o.triangleIndicesOffsets[c],R=d?o.triangleIndices.length:o.triangleIndicesOffsets[c+1];_=o.triangleIndices.subarray(Z,R);for(let C=0;C<_.length;C++)_[C]=s[_[C]]}else throw new Error("Runtime triangulation not yet supported.");let S=i(p[0]);S&&S.addPrimitiveByCollection(t,c),e.add({positions:b,triangles:_,holes:y,pickObject:S,featureId:S?.featureId},$Te)}}function e_e(e,t,n,i){let o=Zt.getNodeTransform(t),r=P.multiplyTransformation(n,o,new P),s=t.primitives;for(let c=0;c<s.length;c++){let d=s[c],u=d.primitiveType,m,p=wlt(d),b=Zt.getAttributeBySemantic(d,dt.POSITION),f=b.normalized??!1,y=b.componentDatatype;u===Ie.POINTS?m=new Od({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):u===Ie.LINE_STRIP?m=new ml({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):(u===Ie.TRIANGLES||u===Ie.LINE_LOOP)&&(m=new Ya({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}));let S=d.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(S)||i.featuresByTableId.set(S,new Map),i.collections.push(m),i.collectionLocalMatrices.push(P.clone(r)),i.collectionFeatureTableIds.set(m,S),Mlt(e,d,m,i.collections.length-1,i.featuresByTableId.get(S))}let a=t.children;for(let c=0;c<a.length;c++)e_e(e,a[c],r,i)}function t_e(e,t,n,i){let o=AB(t),r=0;for(let d=0;d<t.length;d++)t[d]!==o&&r++;let s=e.constructor,a=new s(r*n),c=0;for(let d=0;d<t.length;d++){let u=t[d];if(i&&(i[u]=u===o?o:c),u!==o){for(let m=0;m<n;m++)a[c*n+m]=e[u*n+m];c++}}return a}var KX=Ylt;var GB=new Pc,LB=new ga,WB=new Ir,JX=new Sf,Uq=new Au,n_e=new Eu,i_e=new P,Dq=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=P.clone(P.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof Od).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Ya?t+n.triangleCount:n instanceof ml?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new ge("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let o=this.getFeature(t,i);return o?o.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new og({color:i}))}applyStyle(t){let n=r=>r instanceof Od,i=r=>r instanceof ml,o=r=>r instanceof Ya;for(let r of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,GB);let d=this.getFeature(GB.featureId,s);l(t.show)&&(GB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,JX.color),l(t.pointSize)&&(JX.size=t.pointSize.evaluate(d)),l(t.pointOutlineWidth)&&(JX.outlineWidth=t.pointOutlineWidth.evaluate(d)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(d,JX.outlineColor),GB.setMaterial(JX)}}for(let r of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,LB);let d=this.getFeature(LB.featureId,s);l(t.show)&&(LB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,Uq.color),l(t.lineWidth)&&(Uq.width=t.lineWidth.evaluate(d)),LB.setMaterial(Uq)}}for(let r of this._collections.filter(o)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,WB);let d=this.getFeature(WB.featureId,s);l(t.show)&&(WB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,n_e.color),WB.setMaterial(n_e)}}}update(t,n){let i=this._tileset,o=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(Hlt(this),this._ready=!0)}P.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,i_e);let r=l(o)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];P.multiplyTransformation(i_e,this._collectionLocalMatrices[s],a.modelMatrix),!fs(i._heightReference)||!rg.isSupported(a)?a.update(n):r&&o.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,me(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),s=zlt(t,n,r,o),a=await Nu.fromGltfAsync(s);return a.show=!1,r._model=a,r}};function zlt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Le.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function Hlt(e){let t=e._model.sceneGraph.components,n=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P);P.multiplyTransformation(t.transform,n,e._modelMatrix);let i=KX(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Ex=Dq;var ngi=x(T(),1);var Obi=x(T(),1);var U0i=x(T(),1);function dc(){}dc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);dc._sorterTaskProcessor=void 0;dc._taskProcessorReady=!1;dc._error=void 0;dc._getSorterTaskProcessor=function(){if(!l(dc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",dc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?dc._taskProcessorReady=!0:dc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{dc._error=t}),dc._sorterTaskProcessor=e}return dc._sorterTaskProcessor};dc.radixSortIndexes=function(e){let t=dc._getSorterTaskProcessor();if(l(dc._error))throw dc._error;if(dc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var AS=dc;var K0i=x(T(),1);function uc(){}uc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);uc._textureTaskProcessor=void 0;uc._taskProcessorReady=!1;uc._error=void 0;uc._getTextureTaskProcessor=function(){if(!l(uc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",uc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?uc._taskProcessorReady=!0:uc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{uc._error=t}),uc._textureTaskProcessor=e}return uc._textureTaskProcessor};uc.generateFromAttributes=function(e){let t=uc._getTextureTaskProcessor();if(l(uc._error))throw uc._error;if(!uc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var jX=uc;var tbi=x(T(),1);function Klt(e){let t=new Jb;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL}})),this.alphaOptions=new fS,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT)}var QX=Klt;var ibi=x(T(),1),qX=`#if defined(HAS_SPHERICAL_HARMONICS) +const uint coefficientCount[3] = uint[3](3u,8u,15u); +const float SH_C1 = 0.48860251; +const float SH_C2[5] = float[5]( +1.092548430, +-1.09254843, +0.315391565, +-1.09254843, +0.546274215 +); +const float SH_C3[7] = float[7]( +-0.59004358, +2.890611442, +-0.45704579, +0.373176332, +-0.45704579, +1.445305721, +-0.59004358 +); +uvec2 loadSHCoeff(uint splatID, int index) { +ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0); +uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u]; +uint splatsPerRow = uint(shTexSize.x) / dims; +uint shIndex = (splatID%splatsPerRow) * dims + uint(index); +ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow); +return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg; +} +vec3 halfToVec3(uvec2 packed) { +return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x); +} +vec3 loadAndExpandSHCoeff(uint splatID, int index) { +uvec2 coeff = loadSHCoeff(splatID, index); +return halfToVec3(coeff); +} +vec3 evaluateSH(uint splatID, vec3 viewDir) { +vec3 result = vec3(0.0); +int coeffIndex = 0; +float x = viewDir.x, y = viewDir.y, z = viewDir.z; +if (u_sphericalHarmonicsDegree >= 1.) { +vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3; +if (u_sphericalHarmonicsDegree >= 2.) { +float xx = x * x; +float yy = y * y; +float zz = z * z; +float xy = x * y; +float yz = y * z; +float xz = x * z; +vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += SH_C2[0] * xy * sh4 + +SH_C2[1] * yz * sh5 + +SH_C2[2] * (2.0f * zz - xx - yy) * sh6 + +SH_C2[3] * xz * sh7 + +SH_C2[4] * (xx - yy) * sh8; +if (u_sphericalHarmonicsDegree >= 3.) { +vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 + +SH_C3[1] * xy * z * sh10 + +SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 + +SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 + +SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 + +SH_C3[5] * z * (xx - yy) * sh14 + +SH_C3[6] * x * (xx - 3.0f * yy) * sh15; +} +} +} +return result; +} +#endif +vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) { +vec4 t = vec4(viewPos, 1.0); +vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w); +vec2 J1 = focal / t.z; +vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z); +mat3 J = mat3( +J1.x, 0.0, J2.x, +0.0, J1.y, J2.y, +0.0, 0.0, 0.0 +); +mat3 R = mat3(czm_modelView); +mat3 Vrk_view = R * Vrk * transpose(R); +mat3 cov = transpose(J) * Vrk_view * J; +float diagonal1 = cov[0][0] + .3; +float offDiagonal = cov[0][1]; +float diagonal2 = cov[1][1] + .3; +float mid = 0.5 * (diagonal1 + diagonal2); +float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal)); +float lambda1 = mid + radius; +float lambda2 = max(mid - radius, 0.1); +vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1)); +return vec4( +min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector, +min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x) +); +} +highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0); +void main() { +uint texIdx = uint(a_splatIndex); +uint rowMask = uint(u_splatRowMask); +uint rowShift = uint(u_splatRowShift); +ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift)); +vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) ); +vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0); +vec4 clipPosition = czm_projection * splatViewPos; +float clip = 1.2 * clipPosition.w; +if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip || +clipPosition.y < -clip || clipPosition.y > clip) { +gl_Position = vec4(0.0, 0.0, 2.0, 1.0); +return; +} +ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift)); +uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0)); +gl_Position = clipPosition; +vec2 u1 = unpackHalf2x16(covariance.x) ; +vec2 u2 = unpackHalf2x16(covariance.y); +vec2 u3 = unpackHalf2x16(covariance.z); +mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y); +vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk); +if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) { +gl_Position = discardVec; +return; +} +vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.; +gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0); +gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w)); +v_vertPos = corner ; +v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0; +#if defined(HAS_SPHERICAL_HARMONICS) +vec4 splatWC = czm_inverseView * splatViewPos; +vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz)); +v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb; +#endif +v_splitDirection = u_splitDirection; +} +`;var rbi=x(T(),1),$X=`void main() { +if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; +if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +float A = -dot(v_vertPos, v_vertPos); +if (A < -4.) { +discard; +} +float B = exp(A * 4.) * v_splatColor.a ; +out_FragColor = vec4(v_splatColor.rgb * B , B); +} +`;var GS=new P,l_e=new P,eN=new P,Ei=new q,tN=new Ne,Jlt=new h,jlt=new Ne,Qlt=new h,qlt=1e-12,vB=1e-5,Oq=1e-7,Oa={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Bs={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},$lt=2,edt=30,tdt=3,ndt=.008726646259971648,idt=1;function odt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<tdt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=idt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=ndt:!1}function o_e(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function rdt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function r_e(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function Bq(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function s_e(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function sdt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let o=0;o<n.length;o++){let r=n[o];t-r.frameNumber>0?r.texture.destroy():i.push(r)}e._retiredTextures=i}function adt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function cdt(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=adt(e._snapshot,t);for(let a=0;a<o.length;a++){let c=o[a];if(c.length>=i&&c.buffer!==r)return c}let s=J.createTypedArray(n,i);return o.push(s),s}function ldt(e,t){return e.length===t?e:e.subarray(0,t)}function ddt(e,t,n){if(!l(t.indexes)||t.state!==Bs.READY)throw new ge("Committing snapshot before it is READY.");let i=n.frameNumber,o=e._snapshot,r=l(o)?o.gaussianSplatTexture:e.gaussianSplatTexture;l(r)&&r!==t.gaussianSplatTexture&&s_e(e,r,i);let s=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&s_e(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Oa.IDLE,e._dirty=!1}async function udt(e,t,n,i){try{let o=await i,r=kt.maximumTextureSize,s=r,a=Math.ceil(n.numSplats/(r/2)),c=Math.log2(r/2),d=r/2-1;if(a>r){let b=n.numSplats;a=r;let f=s/2;if(n.numSplats=r*f,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/b;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=b/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${b} splats exceed the maximum texture capacity (${r}\xD7${f} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let u=s*a*4,m;u<=o.data.length?m=o.data.subarray(0,u):(m=new Uint32Array(u),m.set(o.data));let p={width:s,height:a,data:m};if(n.splatRowMask=d,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Bs.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=c_e(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let b=n.gaussianSplatTexture;n.gaussianSplatTexture=c_e(t.context,p),b.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let b=n.sphericalHarmonicsTexture,f=kt.maximumTextureSize,y=n.shCoefficientCount/3,_=Math.floor(f/y),S=_*(y*2),Z=Math.ceil(n.numSplats/_);if(Z>f)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${Z} > maxTex ${f}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(b)&&b.destroy(),n.sphericalHarmonicsTexture=void 0;else{let R=new Uint32Array(f*Z*2),C=0;for(let E=0;C<n.shData.length;E+=f*2)R.set(n.shData.subarray(C,C+S),E),C+=S;n.sphericalHarmonicsTexture=hdt(t.context,{data:R,width:f,height:Z}),l(b)&&b.destroy()}}n.state=Bs.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=Bs.BUILDING}}async function mdt(e,t,n,i){try{let o=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let r=n.expectedCount,s=r,a=o?.length;if(r!==s||a!==r){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=Bs.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,ddt(e,c,t),e._pendingSnapshot=void 0,od.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY),e._sorterState=Oa.ERROR,e._sorterError=o}}async function a_e(e,t,n){try{let i=await n,o=r_e(e,t),r=t?.expectedCount,s=r,a=i?.length;if(!o||(r!==s||a!==r)){o&&(e._sorterPromise=void 0,e._sorterState=Oa.IDLE);return}e._indexes=i,e._sorterState=Oa.SORTED}catch(i){if(!r_e(e,t))return;e._sorterState=Oa.ERROR,e._sorterError=i}}function hdt(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Qe.RG_INTEGER,pixelDatatype:Ue.UNSIGNED_INT,flipY:!1,sampler:Bt.NEAREST})}function c_e(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Qe.RGBA_INTEGER,pixelDatatype:Ue.UNSIGNED_INT,flipY:!1,sampler:Bt.NEAREST})}function od(e){e=e??B.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new P,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Mr.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new P,this._rootTransform=void 0,this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(Bi.Y,Bi.X,new P),this._shInverseRotation=new q,this._isDestroyed=!1,this._sorterState=Oa.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(od.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Bs.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});od.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};od.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,Bq(this._pendingSnapshot),Bq(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),me(this)};od.prototype.isDestroyed=function(){return this._isDestroyed};od.prototype.onTileLoad=function(e){this._dirty=!0};od.prototype.onTileVisible=function(e){};od.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=_t.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=P.multiplyTransformation(t,i._axisCorrectionMatrix,GS);P.multiplyTransformation(r,e.content.worldTransform,r);let s=P.inverse(o,l_e),a=P.multiplyTransformation(s,r,GS),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&P.equalsEpsilon(a,c,qlt))return;let d=e.content.positions,u=e.content.rotations,m=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),b=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),f=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);Ei[0]=a[0]/p,Ei[1]=a[1]/p,Ei[2]=a[2]/p,Ei[3]=a[4]/b,Ei[4]=a[5]/b,Ei[5]=a[6]/b,Ei[6]=a[8]/f,Ei[7]=a[9]/f,Ei[8]=a[10]/f;let y=Ei[0]*Ei[3]+Ei[1]*Ei[4]+Ei[2]*Ei[5],_=Ei[0]*Ei[6]+Ei[1]*Ei[7]+Ei[2]*Ei[8],S=Ei[3]*Ei[6]+Ei[4]*Ei[7]+Ei[5]*Ei[8],Z=Math.abs(p-1)<=Oq&&Math.abs(b-1)<=Oq&&Math.abs(f-1)<=Oq,R=Math.abs(y)<=vB&&Math.abs(_)<=vB&&Math.abs(S)<=vB,C=Ei[0]*(Ei[4]*Ei[8]-Ei[5]*Ei[7])-Ei[3]*(Ei[1]*Ei[8]-Ei[2]*Ei[7])+Ei[6]*(Ei[1]*Ei[5]-Ei[2]*Ei[4]),E=Z&&R&&Math.abs(C-1)<=vB;Ne.fromRotationMatrix(Ei,tN),Ne.normalize(tN,tN);let A=Zt.getAttributeBySemantic(n,dt.POSITION).typedArray,L=Zt.getAttributeBySemantic(n,dt.ROTATION).typedArray,F=Zt.getAttributeBySemantic(n,dt.SCALE).typedArray,I=Jlt,N=jlt,g=Qlt;for(let V=0;V<A.length/3;++V)I.x=A[V*3],I.y=A[V*3+1],I.z=A[V*3+2],N.x=L[V*4],N.y=L[V*4+1],N.z=L[V*4+2],N.w=L[V*4+3],g.x=F[V*3],g.y=F[V*3+1],g.z=F[V*3+2],E?(P.multiplyByPoint(a,I,I),Ne.multiply(tN,N,N),Ne.normalize(N,N)):(P.fromTranslationQuaternionRotationScale(I,N,g,eN),P.multiplyTransformation(a,eN,eN),P.getTranslation(eN,I),P.getScale(eN,g),Ne.multiply(tN,N,N),Ne.normalize(N,N)),d[V*3]=I.x,d[V*3+1]=I.y,d[V*3+2]=I.z,u[V*4]=N.x,u[V*4+1]=N.y,u[V*4+2]=N.z,u[V*4+3]=N.w,m[V*3]=g.x,m[V*3+1]=g.y,m[V*3+2]=g.z;e.content._lastSplatTransform=P.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};od.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Bs.BUILDING)return;n.state=Bs.TEXTURE_PENDING;let i=jX.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Bs.BUILDING;return}udt(e,t,n,i)};od.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new QX(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=on.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Le.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",fe.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",fe.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",fe.VERTEX),o.addUniform("float","u_splatScale",fe.VERTEX),o.addUniform("vec3","u_cameraPositionWC",fe.VERTEX),o.addUniform("mat3","u_inverseModelRotation",fe.VERTEX);let s=i.uniformMap;o.addUniform("int","u_splatRowMask",fe.VERTEX),o.addUniform("int","u_splatRowShift",fe.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",fe.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",fe.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Ie.TRIANGLE_STRIP,o.addVertexLines(qX),o.addFragmentLines($X);let d=o.buildShaderProgram(t.context),u=$e(ze.fromCache(i.renderStateOptions),!0);u.cull.face=Zt.getCullFace(n.modelMatrix,Ie.TRIANGLE_STRIP),u=ze.fromCache(u);let m={screenQuadPosition:0,splatIndex:2},p=new Vn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=J.UNSIGNED_INT,p.type=Dt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let S=new At({attributes:{screenQuadPosition:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Ie.TRIANGLE_STRIP});e._vertexArray=Un.fromGeometry({context:t.context,geometry:S,attributeLocations:m,bufferUsage:Pe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let f=P.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,_=new lt({boundingVolume:n.boundingSphere,modelMatrix:f,uniformMap:s,renderState:u,vertexArray:y,shaderProgram:d,cull:r.cull.enabled,pass:Le.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Ie.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=_};od.prototype.update=function(e){let t=this._tileset;if(sdt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Oa.IDLE){let o=t._selectedTiles.length!==0&&rdt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):o?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(o||this._dirty)&&(this._needsSnapshotRebuild=!0);let r=this._selectedTilesStableFrames>=$lt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=r||s||this._snapshotRebuildStallFrames>=edt;if(!(this._dirty||this._needsSnapshotRebuild||o||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&P.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Oa.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&Bq(this._pendingSnapshot);let d=t._selectedTiles;this._rootTransform=_t.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=d[0],E=P.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,l_e);P.multiplyTransformation(E,C.content.worldTransform??P.IDENTITY,E),P.getRotation(P.inverse(E,E),this._shInverseRotation)}for(let C of d)od.transformTile(C);let u=d.reduce((C,E)=>C+E.content.pointsLength,0),m=(C,E,A,L)=>{let F,I=0,N=0;for(let g of d){let V=A(g.content),G=l(L)?L:Dt.getNumberOfComponents(V.type),v=l(V.typedArray)?V.typedArray:V;N+=v.length,l(F)||(F=cdt(this,C,E,u*G))}if(!l(F))return J.createTypedArray(E,0);for(let g of d){let V=g.content,G=A(V),v=l(G.typedArray)?G.typedArray:G;F.set(v,I),I+=v.length}return ldt(F,N)},p=()=>{let C=0;for(let F of d)if(F.content.sphericalHarmonicsDegree>0){switch(F.content.sphericalHarmonicsDegree){case 1:C=9;break;case 2:C=24;break;case 3:C=45;break}break}if(C===0)return;let E=u*(C*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<E)&&(this._scratchAggregateShBuffer=new Uint32Array(E));let A=this._scratchAggregateShBuffer,L=0;for(let F of d){let I=F.content.packedSphericalHarmonicsData;F.content.sphericalHarmonicsDegree>0&&(A.set(I,L),L+=I.length)}return L<A.length?A.subarray(0,L):A},b=m("positions",J.FLOAT,C=>C.positions,3),f=m("scales",J.FLOAT,C=>C.scales,3),y=m("rotations",J.FLOAT,C=>C.rotations,4),_=m("colors",J.UNSIGNED_BYTE,C=>Zt.getAttributeBySemantic(C.gltfPrimitive,dt.COLOR)),S=d[0].content.sphericalHarmonicsDegree,Z=S>0?d[0].content.sphericalHarmonicsCoefficientCount:0,R=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:b,rotations:y,scales:f,colors:_,shData:R,sphericalHarmonicsDegree:S,shCoefficientCount:Z,numSplats:u,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Bs.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let d=this._pendingSnapshot;if(d.state===Bs.BUILDING){od.generateSplatTexture(this,e,d);return}if(d.state===Bs.TEXTURE_PENDING||d.state===Bs.TEXTURE_READY&&!l(d.gaussianSplatTexture)||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,GS),d.state===Bs.TEXTURE_READY&&!l(this._pendingSortPromise)){let u=++this._sortRequestId,m=this._splatDataGeneration;this._pendingSort={requestId:u,dataGeneration:m,expectedCount:d.numSplats,snapshot:d};let p=AS.radixSortIndexes({primitive:{positions:new Float32Array(d.positions),modelView:Float32Array.from(GS),count:d.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,d.state=Bs.TEXTURE_READY;return}this._pendingSortPromise=p,d.state=Bs.SORTING;let b=this._pendingSort;mdt(this,e,b,p);return}if(!l(this._pendingSortPromise)){d.state===Bs.SORTING&&(d.state=Bs.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,GS),!l(this._sorterPromise)){if(!odt(this,e))return;let d=++this._sortRequestId,u=this._splatDataGeneration,m=this._numSplats;this._activeSort={requestId:d,dataGeneration:u,expectedCount:m};let p=AS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(GS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){o_e(this,e);let b=this._activeSort;this._sorterState=Oa.SORTING,a_e(this,b,p);return}}if(!l(this._sorterPromise)){this._sorterState=Oa.WAITING;return}this._sorterState=Oa.SORTING;return}else if(this._sorterState===Oa.WAITING){if(!l(this._sorterPromise)){let o=++this._sortRequestId,r=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:o,dataGeneration:r,expectedCount:s};let a=AS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(GS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){o_e(this,e);let c=this._activeSort;this._sorterState=Oa.SORTING,a_e(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Oa.WAITING;return}this._sorterState=Oa.SORTING;return}else{if(this._sorterState===Oa.SORTING)return;if(this._sorterState===Oa.SORTED)od.buildGSplatDrawCommand(this,e),this._sorterState=Oa.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Oa.ERROR)throw this._sorterError}this._dirty=!1}};var nN=od;var Hq=class e{constructor(t,n,i,o){this._tileset=n,this._tile=i,this._resource=o,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new nN({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Jo("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions + +Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,o){let r=i,s=ve.createIfNeeded(r),a={releaseGltfJson:!1,upAxis:Bi.Y,forwardAxis:Bi.Z};l(o.asset)?(a.gltfJson=o,a.baseResource=s,a.gltfResource=s):o instanceof Uint8Array?(a.typedArray=o,a.baseResource=s,a.gltfResource=s):a.gltfResource=ve.createIfNeeded(o);let c=new Lu(a);try{await c.load()}catch(d){throw c.destroy(),new ae(`Failed to load glTF: ${d.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.POSITION).typedArray.slice(),this._rotations=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.ROTATION).typedArray.slice(),this._scales=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.SCALE).typedArray.slice();let{l:o,n:r}=pdt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=o,this._sphericalHarmonicsCoefficientCount=r,this._packedSphericalHarmonicsData=xdt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),me(this)}};function fdt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function pdt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var d_e=new ArrayBuffer(4),bdt=new Float32Array(d_e),gdt=new Uint32Array(d_e);function zq(e){bdt[0]=e;let t=gdt[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let s=i-127+15;s>=31?r=n<<15|31744:s<=0?r=n<<15:r=n<<15|s<<10|o>>>13}return r}function ydt(e){let t=fdt(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),s=parseInt(e.slice(o+n.length),10);return{l:r,n:s}}function xdt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(d=>d.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}r.sort((d,u)=>d.name<u.name?-1:d.name>u.name?1:0);let c=s*(2/3);for(let d=0;d<r.length;d++){let{l:u,n:m}=ydt(r[d].name);for(let p=0;p<e.pointsLength;p++){let b=a[u-1]*2/3,f=p*c+b+m*2,y=p*3;o[f]=zq(r[d].typedArray[y])|zq(r[d].typedArray[y+1])<<16,o[f+1]=zq(r[d].typedArray[y+2])}}return o}var Ax=Hq;var u_e={b3dm:function(e,t,n,i,o){return Yu.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Yu.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Yu.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return A2.fromTileType(e,t,n,i,o,u_e)},externalTileset:function(e,t,n,i){return mX.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new W2(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new XX(e,t,n,i,o)},subt:function(e,t,n,i,o){return H1.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return H1.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 Ax.tilesetRequiresGaussianSplattingExt(e)?Ax.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ex.fromGltf(e,t,n,c):Yu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Ax.tilesetRequiresGaussianSplattingExt(e)?Ax.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ex.fromGltf(e,t,n,i):Yu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Yu.fromGeoJson(e,t,n,i)}},LS=u_e;var pgi=x(T(),1),m_e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(m_e);var Fo=m_e;var ggi=x(T(),1),Jm={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"};Jm.isBinaryFormat=function(e){switch(e){case Jm.BATCHED_3D_MODEL:case Jm.INSTANCED_3D_MODEL:case Jm.COMPOSITE:case Jm.POINT_CLOUD:case Jm.VECTOR:case Jm.GEOMETRY:case Jm.IMPLICIT_SUBTREE:case Jm.VOXEL_BINARY:case Jm.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Jm);var Za=Jm;var xgi=x(T(),1),h_e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(h_e);var jm=h_e;var _gi=x(T(),1),Ra={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},sg=new Array(Ra.NUMBER_OF_PASSES);sg[Ra.RENDER]=Object.freeze({pass:Ra.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});sg[Ra.PICK]=Object.freeze({pass:Ra.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});sg[Ra.SHADOW]=Object.freeze({pass:Ra.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});sg[Ra.PRELOAD]=Object.freeze({pass:Ra.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});sg[Ra.PRELOAD_FLIGHT]=Object.freeze({pass:Ra.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});sg[Ra.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ra.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});sg[Ra.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ra.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});sg[Ra.MOST_DETAILED_PICK]=Object.freeze({pass:Ra.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ra.getPassOptions=function(e){return sg[e]};Object.freeze(Ra);var lr=Ra;var Rgi=x(T(),1);var Kq=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return me(this)}},Qp=Kq;var Pgi=x(T(),1);var Agi=x(T(),1);function ag(e){e=e??B.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(ag.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});ag.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};ag.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};ag.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};ag.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};ag.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};ag.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};ag.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var iN=ag;function Jq(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Jq._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=e.schema.classes??B.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new iN({content:n,class:o})}}Jq._oneTimeWarning=xt;var WS=Jq;var wgi=x(T(),1);function Tdt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=no(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 vS=Tdt;var jgi=x(T(),1);var Dgi=x(T(),1);function cg(e){e=e??B.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(cg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});cg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};cg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};cg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};cg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};cg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};cg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};cg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var oN=cg;function jq(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){jq._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=e.schema.classes??B.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new oN({tile:n,class:o})}}jq._oneTimeWarning=xt;var rN=jq;var yyi=x(T(),1);var iyi=x(T(),1);function _dt(e){let t=new Uint8Array(e),n=qh(t);if(n==="glTF"&&(n="glb"),Za.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Sdt(t);if(l(i.root))return{contentType:Za.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Za.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Za.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Za.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Za.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function Sdt(e){let t;try{t=vr(e)}catch{throw new ae("Invalid tile content.")}return t}var lg=_dt;var Qq=class{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let r=l(o.contents)?o.contents:o.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:r[a].uri}),d=Hc.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=d}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!Zdt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;qq(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Rdt(this,i,n,this._tile._contentState);return Cdt(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,o=i.length;for(let r=0;r<o;++r)i[r].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyStyle(t)}update(t,n){let i=this._contents,o=i.length,r=!0;for(let s=0;s<o;++s)i[s].update(t,n),r=r&&i[s].ready;!this._ready&&r&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let o,r=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let d=s[c].pick(t,n,i);if(!l(d))continue;let u=h.distance(t.origin,d);u<r&&(o=d,r=u)}if(l(o))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return me(this)}};function qq(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function f_e(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)}function Zdt(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)&&!Hc.serverHasOpenSlots(n,t[n]))return!1;return Hc.heapHasOpenSlots(e.length)}function Rdt(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Ar({throttle:!0,throttleByServer:!0,type:js.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===Ri.CANCELLED){f_e(e,i);return}return qq(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){f_e(e,i);return}qq(e,-1),p_e(e,t,u)}})}async function Cdt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>Vdt(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 Vdt(e,t,n){if(l(t))try{let i=lg(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Za.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Za.GEOMETRY||i.contentType===Za.VECTOR;let a,c=LS[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 m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=WS(o,d));let u=vS(o,d);return l(u)&&(a.group=new w_({metadata:u})),a}catch(i){p_e(e,n,i)}}function p_e(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}`))}var sN=Qq;var mxi=x(T(),1);var Hyi=x(T(),1);var Ayi=x(T(),1);var b_e=Math.cos,g_e=Math.sin,Edt=Math.sqrt,$q={};$q.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,m=b_e(u),p=g_e(u),b=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,y=m*b_e(f),_=m*g_e(f),S=a.x*y,Z=a.y*_,R=Edt(S*y+Z*_+b*p);if(r.x=S/R,r.y=Z/R,r.z=b/R,n){let C=e.stNwCorner;l(C)?(u=C.latitude-e.stGranYCos*i+o*e.stGranXSin,f=C.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 Adt=new Ji,Qm=new h,Gdt=new pe,FB=new h,aN=new ki;function y_e(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),m=i*u,p=n*u;aN._ellipsoid=ne.default,Qm=aN.project(e,Qm),Qm=h.subtract(Qm,FB,Qm);let b=Ji.fromRotation(t,Adt);Qm=Ji.multiplyByVector(b,Qm,Qm),Qm=h.add(Qm,FB,Qm),e=aN.unproject(Qm,e),r-=1,s-=1;let f=e.latitude,y=f+r*p,_=f-c*s,S=f-c*s+r*p,Z=Math.max(f,y,_,S),R=Math.min(f,y,_,S),C=e.longitude,E=C+r*d,A=C+s*m,L=C+s*m+r*d,F=Math.max(C,E,A,L),I=Math.min(C,E,A,L);return{north:Z,south:R,east:F,west:I,granYCos:c,granYSin:m,granXCos:d,granXSin:p,nwCorner:e}}$q.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,m=!1,p=!1;d===W.PI_OVER_TWO&&(m=!0),u===-W.PI_OVER_TWO&&(p=!0);let b,f=d-u;c>a?b=W.TWO_PI-c+a:b=a-c;let y=Math.ceil(b/t)+1,_=Math.ceil(f/t)+1,S=b/(y-1),Z=f/(_-1),R=re.northwest(e,r),C=re.center(e,Gdt);(n!==0||i!==0)&&(C.longitude<R.longitude&&(C.longitude+=W.TWO_PI),aN._ellipsoid=ne.default,FB=aN.project(C,FB));let E=Z,A=S,L=0,F=0,I=re.clone(e,o),N={granYCos:E,granYSin:L,granXCos:A,granXSin:F,nwCorner:R,boundingRectangle:I,width:y,height:_,northCap:m,southCap:p};if(n!==0){let g=y_e(R,n,S,Z,C,y,_);d=g.north,u=g.south,a=g.east,c=g.west,N.granYCos=g.granYCos,N.granYSin=g.granYSin,N.granXCos=g.granXCos,N.granXSin=g.granXSin,I.north=d,I.south=u,I.east=a,I.west=c}if(i!==0){n=n-i;let g=re.northwest(I,s),V=y_e(g,n,S,Z,C,y,_);N.stGranYCos=V.granYCos,N.stGranXCos=V.granXCos,N.stGranYSin=V.granYSin,N.stGranXSin=V.granXSin,N.stNwCorner=g,N.stWest=V.west,N.stSouth=V.south}return N};var Ca=$q;var Ldt=new de,Wdt=new de,vdt=new h,Fdt=new re;function x_e(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 m=new Float64Array(d*3),p=0,b=0,f,y=vdt;if(r)Ca.computePosition(t,n,!1,b,0,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;else for(f=0;f<o;f++)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;for(f=o-1,b=1;b<i;b++)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;if(b=i-1,!s)for(f=o-2;f>=0;f--)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;for(f=0,b=i-2;b>0;b--)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;let _=m.length/3*2,S=Oe.createTypedArray(m.length/3,_),Z=0;for(let C=0;C<m.length/3-1;C++)S[Z++]=C,S[Z++]=C+1;S[Z++]=m.length/3-1,S[Z]=0;let R=new At({attributes:new Rn,primitiveType:Ie.LINES});return R.attributes.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m}),R.indices=S,R}function Idt(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=x_e(e,t),s=t.height,a=t.width,c=mi.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let m=mi.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(m,d),r.attributes.position.values=u;let p=t.northCap,b=t.southCap,f=4;p&&(f-=1),b&&(f-=1);let y=(u.length/3+f)*2,_=Oe.createTypedArray(u.length/3,y);d=u.length/6;let S=0;for(let R=0;R<d-1;R++)_[S++]=R,_[S++]=R+1,_[S++]=R+d,_[S++]=R+d+1;_[S++]=d-1,_[S++]=0,_[S++]=d+d-1,_[S++]=d,_[S++]=0,_[S++]=d;let Z;if(p)Z=s-1;else{let R=a-1;_[S++]=R,_[S++]=R+d,Z=a+s-2}if(_[S++]=Z,_[S++]=Z+d,!b){let R=a+Z-1;_[S++]=R,_[S]=R+d}return r.indices=_,r}function KC(e){e=e??B.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??W.RADIANS_PER_DEGREE,i=e.ellipsoid??ne.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=re.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"}KC.packedLength=re.packedLength+ne.packedLength+5;KC.pack=function(e,t,n){return n=n??0,re.pack(e._rectangle,t,n),n+=re.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]=e._offsetAttribute??-1,t};var T_e=new re,__e=ne.clone(ne.UNIT_SPHERE),HC={rectangle:T_e,ellipsoid:__e,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};KC.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,T_e);t+=re.packedLength;let o=ne.unpack(e,t,__e);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=re.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 KC(HC))};var Pdt=new pe;KC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ca.computeOptions(t,e._granularity,e._rotation,0,Fdt,Pdt),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=Idt(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,b=new Uint8Array(p);e._offsetAttribute===bn.TOP?b=b.fill(1,0,p/2):(d=e._offsetAttribute===bn.NONE?0:1,b=b.fill(d)),o.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let u=de.fromRectangle3D(t,n,s,Wdt),m=de.fromRectangle3D(t,n,a,Ldt);r=de.union(u,m)}else{if(o=x_e(e,i),o.attributes.position.values=mi.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===bn.NONE?0:1;let m=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}r=de.fromRectangle3D(t,n,s)}return new At({attributes:o.attributes,indices:o.indices,primitiveType:Ie.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var FS=KC;function jC(e){this.rectangle=re.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ne.WGS84;Mdt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(jC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});jC.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=tn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox)};var S_e=new h,IB=new h,Z_e=new h,Xdt=new h,Ndt=new h,Ydt=new h,wdt=new h,qm=new pe,R_e=new cn(h.UNIT_X,0),JC=new gn;function Mdt(e,t,n){n.cartographicToCartesian(re.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(re.northeast(t),e.northeastCornerCartesian),qm.longitude=t.west,qm.latitude=(t.south+t.north)*.5,qm.height=0;let i=n.cartographicToCartesian(qm,Ydt),o=h.cross(i,h.UNIT_Z,Xdt);h.normalize(o,e.westNormal),qm.longitude=t.east;let r=n.cartographicToCartesian(qm,wdt),s=h.cross(h.UNIT_Z,r,S_e);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,S_e);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,Ndt),d=t.south,u;if(d>0){qm.longitude=(t.west+t.east)*.5,qm.latitude=d;let y=n.cartographicToCartesian(qm,JC.origin);h.clone(c,JC.direction);let _=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,R_e);yi.rayPlane(JC,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(y,IB)}else u=n.geodeticSurfaceNormalCartographic(re.southeast(t),IB);let m=h.cross(u,a,Z_e);h.normalize(m,e.southNormal);let p=t.north,b;if(p<0){qm.longitude=(t.west+t.east)*.5,qm.latitude=p;let y=n.cartographicToCartesian(qm,JC.origin);h.negate(c,JC.direction);let _=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,R_e);yi.rayPlane(JC,_,e.northeastCornerCartesian),b=n.geodeticSurfaceNormal(y,IB)}else b=n.geodeticSurfaceNormalCartographic(re.northwest(t),IB);let f=h.cross(a,b,Z_e);h.normalize(f,e.northNormal)}var kdt=new h,Udt=new h,Ddt=new h(0,-1,0),Odt=new h(0,0,-1),C_e=new h;function Bdt(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!re.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,b=e.eastNormal,f=e.northNormal;t.mode!==se.SCENE3D&&(d=t.mapProjection.project(re.southwest(e.rectangle),kdt),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(re.northeast(e.rectangle),Udt),u.z=u.y,u.y=u.x,u.x=0,m=Ddt,b=h.UNIT_Y,p=Odt,f=h.UNIT_Z);let y=h.subtract(i,d,C_e),_=h.dot(y,m),S=h.dot(y,p),Z=h.subtract(i,u,C_e),R=h.dot(Z,b),C=h.dot(Z,f);_>0?r+=_*_:R>0&&(r+=R*R),S>0?r+=S*S:C>0&&(r+=C*C)}let s,a,c;if(t.mode===se.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)}jC.prototype.distanceToCamera=function(e){let t=Bdt(this,e);if(e.mode===se.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};jC.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};jC.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new FS({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Yt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var ku=jC;var qxi=x(T(),1);var Pxi=x(T(),1);var yxi=x(T(),1);var cN={},zdt=new h,V_e=new h,E_e=new h,A_e=new h,G_e=new tn;cN.validOutline=function(e){let n=tn.fromPoints(e,G_e).halfAxes,i=q.getColumn(n,0,V_e),o=q.getColumn(n,1,E_e),r=q.getColumn(n,2,A_e),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};cN.computeProjectTo2DArguments=function(e,t,n,i){let o=tn.fromPoints(e,G_e),r=o.halfAxes,s=q.getColumn(r,0,V_e),a=q.getColumn(r,1,E_e),c=q.getColumn(r,2,A_e),d=h.magnitude(s),u=h.magnitude(a),m=h.magnitude(c),p=Math.min(d,u,m);if(d===0&&(u===0||m===0)||u===0&&m===0)return!1;let b,f;return(p===u||p===m)&&(b=s),p===d?b=a:p===m&&(f=a),(p===d||p===u)&&(f=c),h.normalize(b,n),h.normalize(f,i),h.clone(o.center,t),!0};function L_e(e,t,n,i,o){let r=h.subtract(e,t,zdt),s=h.dot(n,r),a=h.dot(i,r);return k.fromElements(s,a,o)}cN.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=L_e(i[r],e,t,n);return o}};cN.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return L_e(i,e,t,n,o)}};var dg=cN;function Hdt(e){let t=e.length,n=new Float64Array(t*3),i=Oe.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 Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:n})});return new At({attributes:s,indices:i,primitiveType:Ie.LINES})}function IS(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=oi.computeHierarchyPackedLength(t,h)+1}IS.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new IS(t)};IS.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var Kdt={polygonHierarchy:{}};IS.unpack=function(e,t,n){t=t??0;let i=oi.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new IS(Kdt)),n._polygonHierarchy=i,n.packedLength=o,n};IS.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Yo(n,h.equalsEpsilon,!0),n.length<3||!dg.validOutline(n))return;let o=oi.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Yt({geometry:Hdt(o[c])});r.push(d)}let s=zn.combineInstances(r)[0],a=de.fromPoints(t.positions);return new At({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var $m=IS;var PB=new pe;function lN(e){let t=Rb.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ne.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=iut(t,n,i,o);this._boundingPlanes=r;let s=aut(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=a$(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=a$(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=a$(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();PB=o.cartesianToCartographic(c,PB),PB.height=(i+n)/2,this.center=o.cartographicToCartesian(PB,c),this._boundingSphere=de.fromPoints(s)}var Jdt=new h,jdt=new pe,Qdt=new h,qdt=new pe,$dt=new h,eut=new h,tut=new h,nut=new h;function iut(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,Jdt),a=i.cartesianToCartographic(r,jdt);a.height=n;let c=i.cartographicToCartesian(a,Qdt),d=cn.fromPointNormal(c,s);o[0]=d;let u=0,m,p=[],b,f;for(m=0;m<4;m++){b=e.getVertex(m),p[m]=b,f=i.cartesianToCartographic(b,qdt),f.height=t;let _=cn.getPointDistance(d,i.cartographicToCartesian(f,$dt));_<u&&(u=_)}let y=cn.clone(d);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+u,o[1]=y,m=0;m<4;m++){b=p[m];let _=p[(m+1)%4],S=i.geodeticSurfaceNormal(b,eut),Z=h.subtract(_,b,nut),R=h.cross(Z,S,tut);R=h.normalize(R,R),o[2+m]=cn.fromPointNormal(b,R)}return o}var PS=new h,XS=new h,NS=new h,e$=new h,t$=new h,n$=new h,out=new h,rut=new h,sut=new h,i$=new h,o$=new h,r$=new h,Gx=new h,qp=new q;function W_e(e,t,n){PS=e.normal,XS=t.normal,NS=n.normal,e$=h.multiplyByScalar(e.normal,-e.distance,e$),t$=h.multiplyByScalar(t.normal,-t.distance,t$),n$=h.multiplyByScalar(n.normal,-n.distance,n$),i$=h.multiplyByScalar(h.cross(XS,NS,out),h.dot(e$,PS),i$),o$=h.multiplyByScalar(h.cross(NS,PS,rut),h.dot(t$,XS),o$),r$=h.multiplyByScalar(h.cross(PS,XS,sut),h.dot(n$,NS),r$),qp[0]=PS.x,qp[1]=XS.x,qp[2]=NS.x,qp[3]=PS.y,qp[4]=XS.y,qp[5]=NS.y,qp[6]=PS.z,qp[7]=XS.z,qp[8]=NS.z;let i=q.determinant(qp);return Gx=h.add(i$,o$,Gx),Gx=h.add(Gx,r$,Gx),new h(Gx.x/i,Gx.y/i,Gx.z/i)}function aut(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=W_e(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=W_e(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var s$=new h,QC=new h;function a$(e,t){let n=[];for(let i=0;i<4;i++)s$=h.subtract(t[(i+1)%4],t[i],s$),QC=h.cross(e.normal,s$,QC),QC=h.normalize(QC,QC),n[i]=h.clone(QC);return n}Object.defineProperties(lN.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var c$=new h;lN.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;cn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):cn.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,cn.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=l$(cn.projectPointOntoPlane(c,t,c$),i[0],c,o),h.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=v_e(t,p[0],p[1]),h.distance(a,t)}let u=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=l$(cn.projectPointOntoPlane(c,t,c$),i[r],c,this._edgeNormals[n[r]]),m=h.distanceSquared(a,t),m<u&&(u=m);return Math.sqrt(u)}else if(n.length>3)return a=l$(cn.projectPointOntoPlane(this._boundingPlanes[1],t,c$),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+d)%4]):h.distance(t,this._vertices[4+(n[1]-2+d)%4])};var cut=new h,lut=new h;function v_e(e,t,n){let i=h.subtract(n,t,cut),o=h.subtract(e,t,lut),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var dut=new cn(h.UNIT_X,0);function l$(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=cn.fromPointNormal(t[c],i[c],dut);cn.getPointDistance(d,e)<0||(a=v_e(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}lN.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?qt.INSIDE:n===this._vertices.length?qt.OUTSIDE:qt.INTERSECTING};lN.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new $m({polygonHierarchy:{positions:this._planeVertices[0]}}),i=$m.createGeometry(n),o=new Yt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),r=new $m({polygonHierarchy:{positions:this._planeVertices[1]}}),s=$m.createGeometry(r),a=new Yt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new $m({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=$m.createGeometry(u);c[d]=new Yt({geometry:m,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var dN=lN;var GTi=x(T(),1);var yTi=x(T(),1);var hTi=x(T(),1);var uut=new h(1,1,1),XB=Math.cos,NB=Math.sin;function qC(e){e=e??B.EMPTY_OBJECT;let t=e.radii??uut,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??W.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??W.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),d=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.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"}qC.packedLength=2*h.packedLength+8;qC.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.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]=e._offsetAttribute??-1,t};var F_e=new h,I_e=new h,ug={radii:F_e,innerRadii:I_e,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};qC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,F_e);t+=h.packedLength;let o=h.unpack(e,t,I_e);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=m,n._offsetAttribute=p===-1?void 0:p,n):(ug.minimumClock=r,ug.maximumClock=s,ug.minimumCone=a,ug.maximumCone=c,ug.stackPartitions=d,ug.slicePartitions=u,ug.subdivisions=m,ug.offsetAttribute=p===-1?void 0:p,new qC(ug))};qC.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 m=0,p=1,b=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,y=!1;b&&(p=2,r>0&&(f=!0,m+=d),s<Math.PI&&(y=!0,m+=d));let _=a*p*(u+d),S=new Float64Array(_*3),Z=2*(_+m-(d+u)*p),R=Oe.createTypedArray(_,Z),C,E,A,L,F=0,I=new Array(u),N=new Array(u);for(C=0;C<u;C++)L=r+C*(s-r)/(u-1),I[C]=NB(L),N[C]=XB(L);let g=new Array(a),V=new Array(a);for(C=0;C<a;C++)A=i+C*(o-i)/(a-1),g[C]=NB(A),V[C]=XB(A);for(C=0;C<u;C++)for(E=0;E<a;E++)S[F++]=t.x*I[C]*V[E],S[F++]=t.y*I[C]*g[E],S[F++]=t.z*N[C];if(b)for(C=0;C<u;C++)for(E=0;E<a;E++)S[F++]=n.x*I[C]*V[E],S[F++]=n.y*I[C]*g[E],S[F++]=n.z*N[C];for(I.length=a,N.length=a,C=0;C<a;C++)L=r+C*(s-r)/(a-1),I[C]=NB(L),N[C]=XB(L);for(g.length=d,V.length=d,C=0;C<d;C++)A=i+C*(o-i)/(d-1),g[C]=NB(A),V[C]=XB(A);for(C=0;C<a;C++)for(E=0;E<d;E++)S[F++]=t.x*I[C]*V[E],S[F++]=t.y*I[C]*g[E],S[F++]=t.z*N[C];if(b)for(C=0;C<a;C++)for(E=0;E<d;E++)S[F++]=n.x*I[C]*V[E],S[F++]=n.y*I[C]*g[E],S[F++]=n.z*N[C];for(F=0,C=0;C<u*p;C++){let X=C*a;for(E=0;E<a-1;E++)R[F++]=X+E,R[F++]=X+E+1}let G=u*a*p;for(C=0;C<d;C++)for(E=0;E<a-1;E++)R[F++]=G+C+E*d,R[F++]=G+C+(E+1)*d;if(b)for(G=u*a*p+d*a,C=0;C<d;C++)for(E=0;E<a-1;E++)R[F++]=G+C+E*d,R[F++]=G+C+(E+1)*d;if(b){let X=u*a*p,Y=X+a*d;if(f)for(C=0;C<d;C++)R[F++]=X+C,R[F++]=Y+C;if(y)for(X+=a*d-d,Y+=a*d-d,C=0;C<d;C++)R[F++]=X+C,R[F++]=Y+C}let v=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S})});if(l(e._offsetAttribute)){let X=S.length,Y=e._offsetAttribute===bn.NONE?0:1,D=new Uint8Array(X/3).fill(Y);v.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}return new At({attributes:v,indices:R,primitiveType:Ie.LINES,boundingSphere:de.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Uu=qC;function $C(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Uu(i),this._workerName="createSphereOutlineGeometry"}$C.packedLength=Uu.packedLength;$C.pack=function(e,t,n){return Uu.pack(e._ellipsoidGeometry,t,n)};var mut=new Uu,YS={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};$C.unpack=function(e,t,n){let i=Uu.unpack(e,t,mut);return YS.stackPartitions=i._stackPartitions,YS.slicePartitions=i._slicePartitions,YS.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,YS.radii),n._ellipsoidGeometry=new Uu(YS),n):(YS.radius=i._radii.x,new $C(YS))};$C.createGeometry=function(e){return Uu.createGeometry(e._ellipsoidGeometry)};var mg=$C;function eV(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new de(e,t)}Object.defineProperties(eV.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}}});eV.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};eV.prototype.intersectPlane=function(e){return de.intersectPlane(this._boundingSphere,e)};eV.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};eV.prototype.createDebugVolume=function(e){let t=new mg({radius:this.radius}),n=P.fromTranslation(this.center,P.clone(P.IDENTITY)),i=new Yt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var hg=eV;var UTi=x(T(),1);var hut=new h,fut=new h,put=new h,but=new h;function wS(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function d$(e,t){let n=h.normalize(e,but),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return wS(e,i,t)}function P_e(e){let t=q.getColumn(e,0,hut),n=q.getColumn(e,1,fut),i=q.getColumn(e,2,put),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.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=wS(n,i,t):!o&&r&&!s?n=wS(t,i,n):!o&&!r&&s?i=wS(n,t,i):o?r?s||(t=d$(i,t),n=wS(i,t,n)):(t=d$(n,t),i=wS(n,t,i)):(n=d$(t,n),i=wS(n,t,i)),q.setColumn(e,0,t,e),q.setColumn(e,1,n,e),q.setColumn(e,2,i,e),e)}function tV(e,t){t=P_e(t),this._orientedBoundingBox=new tn(e,t),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(tV.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});tV.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};tV.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};tV.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=P_e(t),q.clone(t,this._orientedBoundingBox.halfAxes),de.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};tV.prototype.createDebugVolume=function(e){let t=new Yh({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=P.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Yt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var Bd=tV;function dr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||no(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?P.unpack(n.transform):P.clone(P.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=P.multiply(a,this.transform,new P),d=l(i)?i._initialTransform:P.IDENTITY;this._initialTransform=P.multiply(d,this.transform,new P),this.computedTransform=c,this.metadata=rN(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 m;l(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,dr._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")&&dr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?xr.REPLACE:xr.ADD):l(i)?p=i.refine:p=xr.REPLACE,this.refine=p,this.children=[],this.parent=i;let b,f=!1,y,_,S;if(t=ve.createIfNeeded(t),r)y=Fo.UNLOADED,_=t.clone();else if(l(s)){let E=s.uri;l(s.url)&&(dr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(dr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),b=new Qp(e,this),f=!0,y=Fo.READY):(y=Fo.UNLOADED,_=t.getDerivedResource({url:E}),S=Hc.getServerKey(_.getUrlComponent()))}else b=new Qp(e,this),f=!0,y=Fo.READY;this._content=b,this._contentResource=_,this._contentState=y,this._expiredContent=void 0,this._serverKey=S,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!f,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let Z=n.expire,R,C;l(Z)&&(R=Z.duration,l(Z.date)&&(C=Q.fromIso8601(Z.date))),this.expireDuration=R,this.expireDate=C,this.lastStyleTime=0,this._optimChildrenWithinParent=jm.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!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=U.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}dr._deprecationWarning=Jo;Object.defineProperties(dr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 U),U.clone(this._color)},set:function(e){this._color=U.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===Fo.READY}},contentUnloaded:{get:function(){return this._contentState===Fo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Fo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Fo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Lx=new h;function gut(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Lx),c=h.add(s.positionWC,a,Lx),d=h.subtract(c,r,Lx);if(h.magnitude(d)>o){let C=h.normalize(d,Lx),E=h.multiplyByScalar(C,o,Lx),A=h.add(r,E,Lx),L=h.subtract(A,s.positionWC,Lx),F=h.normalize(L,Lx);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,F))}else e._foveatedFactor=0;let p=e.refine===xr.REPLACE,b=n.isSkippingLevelOfDetail;if(p&&!b||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&b||n._pass===lr.PRELOAD_FLIGHT||n._pass===lr.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*f;if(e._foveatedFactor<=y)return!1;let _=f-y,S=W.clamp((e._foveatedFactor-y)/_,0,1),Z=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,S),R=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-Z<=R}var k_e=new Q;dr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=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,m=c.drawingBufferHeight*o,p;if(e.mode===se.SCENE2D||d instanceof yn){let b=d.offCenterFrustum;l(b)&&(d=b);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,m);p=s/f}else{let b=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*m/(b*f),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,S=W.fog(b,y)*_;p-=S}}return p/=e.pixelRatio,p};function yut(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 xut(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}dr.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:$s.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!==$s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=xut(n,this),this._priorityProgressiveResolution=yut(n,this),this.priorityDeferred=gut(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};dr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(k_e);Q.lessThan(this.expireDate,e)&&(this._contentState=Fo.EXPIRED,this._expiredContent=this._content)}};function Tut(e){if(!l(e.expireDuration))return;let t=Q.now(k_e);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 _ut(e){return function(){return e._priority}}dr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Sut(this):Rut(this)};function Sut(e){let t=e._content,n=e._tileset;if(!l(t)){let o=no(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new sN(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Fo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Fo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Fo.FAILED,o})}async function Zut(e,t,n,i,o){let r=e._contentState;e._contentState=Fo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ri.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}if(U_e(e,a))return i&&(e.expireDate=void 0),e._content=new Qp(t,e),X_e(e),e._contentState=Fo.PROCESSING,e._content;throw e._contentState=Fo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ri.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await Cut(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof Qp&&X_e(e),e._contentState=Fo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Fo.FAILED,a}}function Rut(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ar({throttle:!0,throttleByServer:!0,type:js.TILES3D,priorityFunction:_ut(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 Zut(e,o,i,n,r)}function U_e(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function X_e(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}dr._isEmptyTile=U_e;async function Cut(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let d=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:d}let o=lg(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||o.contentType===Za.GEOMETRY||o.contentType===Za.VECTOR,(o.contentType===Za.IMPLICIT_SUBTREE||o.contentType===Za.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),o.contentType===Za.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let r,s=LS[o.contentType];if(e.isDestroyed())return;l(o.binaryPayload)?r=await Promise.resolve(s(n,e,e._contentResource,o.binaryPayload.buffer,0)):r=await Promise.resolve(s(n,e,e._contentResource,o.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let d=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=d.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=WS(n,a));let c=vS(n,a);return l(c)&&(r.group=new w_({metadata:c})),r}dr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};dr.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Fo.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};dr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Fo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,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 D_e=new de;function m$(e,t){if(t.mode!==se.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=de.projectTo2D(n,t.mapProjection,D_e);e._boundingVolume2D=new hg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Vut(e,t){if(t.mode!==se.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=de.projectTo2D(n,t.mapProjection,D_e);e._contentBoundingVolume2D=new hg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}dr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=m$(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==qt.INSIDE,a===qt.OUTSIDE)return $s.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==qt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};dr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===$s.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=Vut(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==qt.INSIDE,s===qt.OUTSIDE)return qt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==qt.OUTSIDE,s===qt.INSIDE)return qt.OUTSIDE}return t.computeVisibility(n)};dr.prototype.distanceToTile=function(e){return m$(this,e).distanceToCamera(e)};var Eut=new h;dr.prototype.distanceToTileCenter=function(e){let n=m$(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Eut);return h.dot(e.camera.directionWC,i)};dr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var O_e=new q,B_e=new h,Aut=new q,h$=new h,z_e=new re,H_e=new tn,u$=new P;function Gut(e,t,n){let i=h.fromElements(e[0],e[1],e[2],h$),o=q.fromArray(e,3,Aut);i=P.multiplyByPoint(t,i,i);let r=P.getMatrix3(t,O_e);return o=q.multiply(r,o,o),l(n)?(n.update(i,o),n):new Bd(i,o)}function N_e(e,t,n,i){let o=re.unpack(e,0,z_e),r=e[4],s=e[5],a=tn.fromRectangle(o,r,s,ne.WGS84,H_e),c=a.center,d=a.halfAxes;t=P.multiplyTransformation(t,P.inverseTransformation(n,u$),u$),c=P.multiplyByPoint(t,c,c);let u=P.getMatrix3(t,O_e);return d=q.multiply(u,d,d),l(i)&&i instanceof Bd?(i.update(c,d),i):new Bd(c,d)}function Lut(e,t,n,i){if(!P.equalsEpsilon(t,n,W.EPSILON8))return i instanceof Bd?N_e(e,t,n,i):N_e(e,t,n,void 0);let o=re.unpack(e,0,z_e);return i instanceof ku?(i.rectangle=re.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new ku({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Wut(e,t,n){let i=h.fromElements(e[0],e[1],e[2],h$),o=e[3];i=P.multiplyByPoint(t,i,i);let r=P.getScale(t,B_e),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new hg(i,o)}dr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=ix.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(no(e,"3DTILES_bounding_volume_S2"))return new dN(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=Gut(r,t,n);return this._verticalExaggeration!==1&&Y_e(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Lut(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Bd?Y_e(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=_o.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=_o.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=Wut(a,t,n);if(this._verticalExaggeration!==1){let d=_o.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,h$),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var vut=h.unpackArray(new Array(24).fill(0));function Y_e(e,t,n){let i=e.boundingVolume.computeCorners(vut).map(r=>_o.getPosition(r,ne.WGS84,t,n,r)),o=tn.fromPoints(i,H_e);e.update(o.center,o.halfAxes)}dr.prototype.updateTransform=function(e,t){e=e??P.IDENTITY;let n=P.multiplyTransformation(e,this.transform,u$),i=!P.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&P.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()};dr.prototype.updateGeometricErrorScale=function(){let e=P.getScale(this.computedTransform,B_e),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Fut(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=U.WHITE:c=U.DARKGRAY:c=U.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=$t.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(U.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(U.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=U.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Iut(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=Fo.FAILED,o}}function Put(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 Xut(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)}dr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Put(this,e),Xut(this,e),Fut(this,e,t,n),Iut(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===Le.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var w_e=[];dr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Tut(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=Fo.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=w_e;try{this._content.update(e,t)}catch(i){throw this._contentState=Fo.FAILED,i}w_e.length=0,t.commandList=n};function M_e(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function YB(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}dr.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,m=r,p=Math.pow(10,u),b=u+m,f=r,y=Math.pow(10,b),_=b+f,S=Math.pow(10,_),Z=YB(this._depth,n.depth,i.depth);Z=t?1-Z:Z;let C=!e.isSkippingLevelOfDetail&&this.refine===xr.REPLACE?YB(this._priorityHolder._distanceToCamera,n.distance,i.distance):YB(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=M_e(C,a,s),A=this._priorityProgressiveResolution?0:p,L=YB(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),F=M_e(L,d,c),I=this.priorityDeferred?y:0,N=e._pass===lr.PRELOAD_FLIGHT?0:S;this._priority=Z+E+A+F+I+N};dr.prototype.isDestroyed=function(){return!1};dr.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 eh=dr;var Q_i=x(T(),1);var M_i=x(T(),1);function fg(e){e=e??B.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(fg.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}}});fg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};fg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};fg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};fg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};fg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};fg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};fg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var nV=fg;var B_i=x(T(),1);function pg(e){e=e??B.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(pg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});pg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};pg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};pg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};pg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};pg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};pg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};pg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var uN=pg;function K_e(e){e=e??B.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new uN({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 nV({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 m=a[u];s.push(new nV({id:u,group:a[u],class:n.classes[m.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(K_e.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 MS=K_e;var iSi=x(T(),1);var J_e={},Nut=new h;J_e.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Bd||i instanceof ku){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=jm.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Bd||a instanceof ku)){e._optimChildrenWithinParent=jm.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,Nut),u=h.magnitude(d);h.divideByScalar(d,u,d);let m=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(m<=p+u){e._optimChildrenWithinParent=jm.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===jm.USE_OPTIMIZATION};var mN=J_e;var dSi=x(T(),1);var sSi=x(T(),1);function hN(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(hN.prototype,{length:{get:function(){return this._length}}});function Yut(e,t,n){this.item=e,this.previous=t,this.next=n}hN.prototype.add=function(e){let t=new Yut(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 j_e(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}hN.prototype.remove=function(e){l(e)&&(j_e(this,e),--this._length)};hN.prototype.splice=function(e,t){if(e===t)return;j_e(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 fN=hN;function Wx(){this._list=new fN,this._sentinel=this._list.add(),this._trimTiles=!1}Wx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Wx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Wx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Wx.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Wx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Wx.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)}};Wx.prototype.trim=function(){this._trimTiles=!0};var pN=Wx;var bSi=x(T(),1);function wB(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 p$(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}wB.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=p$(e,n),this._referenceMaximum[n]=p$(t,n)};function wut(e,t){let n=e.tilePropertyName;if(l(n)){let i=p$(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 f$=[new U(.1,.1,.1,1),new U(.153,.278,.878,1),new U(.827,.231,.49,1),new U(.827,.188,.22,1),new U(1,.592,.259,1),new U(1,.843,0,1)];wB.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=wut(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=f$.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),b=u-m,f=f$[m],y=f$[p],_=U.clone(U.WHITE);_.red=W.lerp(f.red,y.red,b),_.green=W.lerp(f.green,y.green,b),_.blue=W.lerp(f.blue,y.blue,b),e._debugColor=_};wB.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 bN=wB;var TSi=x(T(),1);function iV(){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}iV.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};iV.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])}};iV.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Yu))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])}};iV.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Yu))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])}};iV.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.batchTableByteLength=e.batchTableByteLength};var Rf=iV;var ZSi=x(T(),1);function gN(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(gN.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});gN.prototype.makeDirty=function(){this._styleDirty=!0};gN.prototype.resetDirty=function(){this._styleDirty=!1};gN.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 yN=gN;var VSi=x(T(),1);function Q_e(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=se.SCENE3D,this.morphTime=se.getMorphTime(se.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,snap:!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,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}Q_e.maximumFrameNumber=15e6;var vx=Q_e;var ISi=x(T(),1);function Mut(e,t,n){let i=no(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)&&!no(o,"3DTILES_bounding_volume_S2")&&!no(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 ve({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=kut(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push($e(a,!0));let c=new ve({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Uut(t),this.subdivisionScheme=Us[i.subdivisionScheme],this.branchingFactor=Us.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function kut(e){if(no(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 Uut(e){let t=$e(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 $p=Mut;var USi=x(T(),1);var NSi=x(T(),1);var xN={};function q_e(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function b$(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function $_e(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 g$(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}xN.encode2D=function(e,t){return(q_e(e)|q_e(t)<<1)>>>0};xN.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=$_e(e),t[1]=$_e(e>>1),t};xN.encode3D=function(e,t,n){return b$(e)|b$(t)<<1|b$(n)<<2};xN.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=g$(e),t[1]=g$(e>>1),t[2]=g$(e>>2),t};var Fx=xN;function Zr(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===Us.OCTREE&&(this.z=e.z)}Object.defineProperties(Zr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Us.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Us.OCTREE?Fx.encode3D(this.x,this.y,this.z):Fx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Us.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Zr.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===Us.OCTREE){let o=(this.z<<e.level)+e.z;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Zr.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===Us.OCTREE){let r=Math.floor(this.z/t);return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Zr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Us.OCTREE){let r=e.z%n;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Zr.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===Us.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Zr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Zr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Zr.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===Us.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Zr.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===Us.OCTREE?this.z===e.z:!0)};Zr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Zr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Zr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Zr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Us.OCTREE&&(e.z=this.z),e};var eSe=[0,0,0];Zr.fromMortonIndex=function(e,t,n,i){let o;return e===Us.OCTREE?(o=Fx.decode3D(i,eSe),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Fx.decode2D(i,eSe),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Zr.fromTileIndex=function(e,t,n){let i,o,r;return e===Us.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),Zr.fromMortonIndex(e,t,i,r)};var e0=Zr;var tZi=x(T(),1);var JSi=x(T(),1);function bg(){}bg.selectTiles=function(e,t){ge.throwInstantiationError()};bg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};bg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};bg.selectTile=function(e,t){if(e.contentVisibility(t)===qt.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)};bg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};bg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};bg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Dut(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Dut(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}bg.updateTile=function(e,t){tSe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,zut(e),e._shouldSelect=!1,e._finalResolution=!0};function tSe(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];tSe(r,t),e._visible=r._visible;return}if(Out(e,t)){e._visible=!1;return}let i=e.refine===xr.REPLACE,o=e._optimChildrenWithinParent===jm.USE_OPTIMIZATION;if(i&&o&&n&&!But(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Out(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==xr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function But(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 zut(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 Ba=bg;function nSe(){}var TN={stack:new Ol,stackMaximumLength:0};nSe.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}=Ba,s=TN.stack;for(s.push(i);s.length>0;){TN.stackMaximumLength=Math.max(TN.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===xr.ADD,d=a.refine===xr.REPLACE,u=Hut(a);u&&Kut(a,s,t),(c||d&&!u)&&(Jut(e,a),o(a,t),jut(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return TN.stack.trim(TN.stackMaximumLength),n};function Hut(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Kut(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 Jut(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function jut(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var _N=nSe;var aZi=x(T(),1);function iSe(){}var SN={stack:new Ol,stackMaximumLength:0},ZN={stack:new Ol,stackMaximumLength:0};iSe.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(Ba.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;qut(n,t),SN.stack.trim(SN.stackMaximumLength),ZN.stack.trim(ZN.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function y$(e,t){e.contentAvailable&&Ba.selectTile(e,t)}function Qut(e,t,n){let i=e.refine===xr.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ba;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Ba.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,b=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let y=r[f];if(y.isVisible?(t.push(y),y._foveatedFactor<b&&(p=f,b=y._foveatedFactor),m=!0):(d||o.loadSiblings)&&(y._foveatedFactor<b&&(p=f,b=y._foveatedFactor),a(y,n),c(y,n)),d){let _;y._inRequestVolume?y.hasRenderableContent?_=y.contentAvailable:_=$ut(y,n):_=!1,u=u&&_}}if(m||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&b<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(f._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(f._distanceToCamera,y._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=y}return u}function qut(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ba,a=SN.stack;for(a.push(e);a.length>0;){SN.stackMaximumLength=Math.max(SN.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?Qut(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===xr.ADD?(y$(c,t),o(c,t)):c.refine===xr.REPLACE&&(o(c,t),m&&y$(c,t)):(n._emptyTiles.push(c),o(c,t),m&&y$(c,t)),r(c,t),s(c,t)}}function $ut(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ba,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=ZN.stack;for(c.push(e);c.length>0;){ZN.stackMaximumLength=Math.max(ZN.stackMaximumLength,c.length);let d=c.pop(),u=d.children,m=u.length,p=!d.hasRenderableContent&&n(d);if((s?d.hasRenderableContent:!p)&&!d.contentAvailable&&(a=!1),i(d,t),d.isVisible||(o(d,t),r(d,t)),p)for(let f=0;f<m;++f){let y=u[f];c.push(y)}}return e.hasEmptyContent||a}var RN=iSe;var hZi=x(T(),1);function oSe(){}var CN={stack:new Ol,stackMaximumLength:0},VN={stack:new Ol,stackMaximumLength:0},gg={stack:new Ol,stackMaximumLength:0,ancestorStack:new Ol,ancestorStackMaximumLength:0},emt=2;oSe.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(Ba.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;smt(n,t),amt(n,t),CN.stack.trim(CN.stackMaximumLength),VN.stack.trim(VN.stackMaximumLength),gg.stack.trim(gg.stackMaximumLength),gg.ancestorStack.trim(gg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function tmt(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ba,r=VN.stack;for(r.push(e);r.length>0;){VN.stackMaximumLength=Math.max(VN.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<emt&&r.push(d))}}}function MB(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:tmt(e,t)}function nmt(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 imt(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 omt(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ba;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Ba.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 rmt(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 smt(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}=Ba,c=CN.stack;for(c.push(e);c.length>0;){CN.stackMaximumLength=Math.max(CN.stackMaximumLength,c.length);let d=c.pop();nmt(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?omt(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===xr.ADD?(MB(d,t),r(d,t)):d.refine===xr.REPLACE&&(rmt(d,i)?(r(d,t),p&&MB(d,t)):p?(MB(d,t),r(d,t)):imt(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&MB(d,t)),s(d,t),a(d,t)}}function amt(e,t){let{selectTile:n,canTraverse:i}=Ba,{stack:o,ancestorStack:r}=gg,s;for(o.push(e);o.length>0||r.length>0;){if(gg.stackMaximumLength=Math.max(gg.stackMaximumLength,o.length),gg.ancestorStackMaximumLength=Math.max(gg.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===xr.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 m=d[u];m.isVisible&&o.push(m)}}}}var EN=oSe;var CZi=x(T(),1);function Va(){this._layers=[],this.layerAdded=new Se,this.layerRemoved=new Se,this.layerMoved=new Se,this.layerShownOrHidden=new Se}Object.defineProperties(Va.prototype,{length:{get:function(){return this._layers.length}}});Va.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()})};Va.prototype.addImageryProvider=function(e,t){let n=new Zs(e);return this.add(n,t),n};Va.prototype.remove=function(e,t){t=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};Va.prototype.removeAll=function(e){e=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=[]};Va.prototype.contains=function(e){return this.indexOf(e)!==-1};Va.prototype.indexOf=function(e){return this._layers.indexOf(e)};Va.prototype.get=function(e){return this._layers[e]};function kB(e,t){return e.indexOf(t)}function rSe(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)}Va.prototype.raise=function(e){let t=kB(this._layers,e);rSe(this,t,t+1)};Va.prototype.lower=function(e){let t=kB(this._layers,e);rSe(this,t,t-1)};Va.prototype.raiseToTop=function(e){let t=kB(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))};Va.prototype.lowerToBottom=function(e){let t=kB(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 sSe=new re;function aSe(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];re.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)||!re.contains(d.rectangle,t))continue;let m=sSe,p=1/1024;m.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),re.contains(m,t)&&i(d)}}Va.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(aSe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};var cmt=new re,lmt=new re,x$=new k,T$=new k,dmt=new pe,umt=new pe;function mmt(e,t,n,i){let o=n.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(e,cmt),s=1/1024,a=lmt;a.west=W.lerp(r.west,r.east,t.minX-s),a.east=W.lerp(r.west,r.east,t.maxX+s),a.south=W.lerp(r.south,r.north,t.minY-s),a.north=W.lerp(r.south,r.north,t.maxY+s),l(i)||(i=new re);let c=o.projection;if(c instanceof ki)return i.west=W.toRadians(a.west),i.south=W.toRadians(a.south),i.east=W.toRadians(a.east),i.north=W.toRadians(a.north),i;x$.x=a.west,x$.y=a.south,T$.x=a.east,T$.y=a.north;let d=c.unproject(x$,dmt),u=c.unproject(T$,umt);return i.west=d.longitude,i.south=d.latitude,i.east=u.longitude,i.north=u.latitude,i}function hmt(e,t,n){let i=e._modelImagery;if(!l(i))return;let o=i._modelPrimitiveImageries;if(l(o))for(let r=0;r<o.length;r++){let s=o[r],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let d=a[c];for(let u=0;u<d.length;u++){let m=d[u],p=m.imagery,b=p.imageryLayer,f=b.imageryProvider;if(!l(f.pickFeatures)||!l(p)||p.state!==Dn.READY||!re.contains(p.rectangle,t))continue;let _=s.mappedPositionsForImageryLayer(b).cartographicBoundingRectangle,S=mmt(_,m.textureCoordinateRectangle,b,sSe);re.contains(S,t)&&n(p)}}}}Va.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let o=t.ellipsoid.cartesianToCartographic(n),r=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let u=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,o.longitude,o.latitude);l(u)&&(r.push(u),s.push(c.imageryLayer))}if(l(t.globe)&&aSe(t,o,!0,function(c){a(c)}),l(i)&&hmt(i,o,function(c){a(c)}),r.length!==0)return Promise.all(r).then(function(c){let d=[];for(let u=0;u<c.length;++u){let m=c[u],p=s[u];if(l(m)&&m.length>0)for(let b=0;b<m.length;++b){let f=m[b];f.imageryLayer=p,l(f.position)||(f.position=o),d.push(f)}}return d})};Va.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Va.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){return this.removeAll(!0),me(this)};Va.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 kS=Va;function ur(e){e=e??B.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 pN,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Ol,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new yN,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?P.clone(e.modelMatrix):P.clone(P.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Rf,this._statisticsLast=new Rf,this._statisticsPerPass=new Array(lr.NUMBER_OF_PASSES);for(let o=0;o<lr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Rf;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 bN(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=W.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ne.WGS84,this._initialClippingPlanesOriginMatrix=P.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new kS(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??W.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??vn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Id.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Up(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Xb,this.loadProgress=new Se,this.allTilesLoaded=new Se,this.initialTilesLoaded=new Se,this.tileLoad=new Se,this.tileUnload=new Se,this.tileFailed=new Se,this.tileVisible=new Se,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&gs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Wc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),mSe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Y_,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Fb(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this.splitDirection=e.splitDirection??Mr.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&xt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Mm.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(ur.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){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Wc.setOwner(e,this,"_clippingPolygons"),mSe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Jo("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}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=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=P.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&&(P.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):P.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},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,gSe(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}}});ur.fromIonAssetId=async function(e,t){let n=await Ur.fromAssetId(e);return ur.fromUrl(n,t)};ur.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ur.loadJson(n),r=await fmt(n,o),s=new ur(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,gSe(s);let c=l(o.asset.gltfUpAxis)?Bi.fromName(o.asset.gltfUpAxis):Bi.Y,d=t.modelUpAxis??c,u=t.modelForwardAxis??Bi.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,P.IDENTITY).boundingSphere.center,b=s._ellipsoid.cartesianToCartographic(p);return l(b)&&b.height>Pi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=_t.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=P.clone(s._initialClippingPlanesOriginMatrix),s};ur.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};ur.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ur.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)&&ur.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=cSe(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===xr.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=cSe(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&mN.checkChildrenWithinParent(c)}return s};function cSe(e,t,n,i){if(!(l(n.implicitTiling)||no(n,"3DTILES_implicit_tiling")))return new eh(e,t,n,i);let r=e.schema,s=new $p(t,n,r),a=new e0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=$e(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new eh(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function fmt(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ni.getSchemaLoader({resource:e});else if(l(n.schema))i=Ni.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new MS({schema:i.schema,metadataJson:n});return Ni.unload(i),o}var lSe=new h,pmt=new pe,bmt=new P,gmt=new h,ymt=new h,xmt=new h,Tmt=new h;function _mt(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof ku)n=h.normalize(a.positionWC,lSe),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let y=P.inverseTransformation(c.computedTransform,bmt),_=t.mapProjection.ellipsoid,S=d.boundingVolume,Z=P.multiplyByPoint(y,S.center,gmt);if(h.magnitude(Z)>_.minimumRadius){let R=pe.fromCartesian(Z,_,pmt);n=h.normalize(a.positionWC,lSe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=R.height*2}else{let R=P.multiplyByPoint(y,a.positionWC,ymt);if(n=h.UNIT_Z,i=P.multiplyByPointAsVector(y,a.directionWC,xmt),i=h.normalize(i,i),o=R.z,d instanceof Bd){let C=q.getColumn(S.halfAxes,2,Tmt),E=h.magnitude(C);r=Z.z-E,s=Z.z+E}else if(d instanceof hg){let C=S.radius;r=Z.z-C,s=Z.z+C}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,b=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-b),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function Smt(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=>{hSe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?pSe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function uSe(e,t){return e._priority-t._priority}ur.prototype.postPassesUpdate=function(e){l(this._root)&&(Zmt(this,e),kmt(this,e),this._cache.unloadTiles(this,bSe),wmt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function mSe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}ur.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Lmt(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),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&_mt(this,e),e.newFrame&&this._cache.reset()};function Zmt(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!==Fo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function Rmt(e){let t=e._requestedTiles;t.sort(uSe);for(let n=0;n<t.length;++n)Smt(e,t[n])}function hSe(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 Cmt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Fo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var Vmt=new pe,Emt=new pe,Amt=new h;function Gmt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,o=t.boundingSphere,r=i.length;for(let s=0;s<r;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,d=pe.clone(a.positionCartographic,Vmt),u=pe.fromCartesian(o.center,c,Emt);l(u)&&(d.height=u.height);let m=pe.toCartesian(d,c,Amt);h.distance(m,o.center)<=o.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Lmt(e,t){Cmt(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,hSe(u,e,d)}}e.totalMemoryUsageInBytes<i?vmt(e):a&&n.length>0&&Wmt(e)}function Wmt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(uSe)}function vmt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var UB=new h,Fmt={maximumFractionDigits:3};function dSe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Fmt):Math.round(t).toLocaleString()}function _$(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,UB);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=h.normalize(i,UB);r=h.multiplyByScalar(r,.75*n,UB),o=h.add(r,i,UB)}return o}function S$(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: ${Mde(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${Mde(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Texture Memory: ${dSe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${dSe(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 C4e(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(c(e.debugPickedTile)){let s=c(e.debugPickPosition)?e.debugPickPosition:wK(e.debugPickedTile),a=PK(e.debugPickedTile,e,s);a.pixelOffset=new D(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];PK(a,e,wK(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&PK(a,e,wK(a))}}e._tileDebugLabels.update(t)}function V4e(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&&(c(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:Xe.CESIUM_3D_TILE,renderState:Oe.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:l,tileVisible:d}=e,u=n.isRender,f=i.length;for(let h=0;h<s.length;++h){let g=s[h];u&&d.raiseEvent(g),g4e(e,g,t),g.update(e,t,n),l.incrementSelectionCounts(g.content),++l.selected}let p=e._emptyTiles;for(let h=0;h<p.length;++h)p[h].update(e,t,n);let y=i.length-f;if(e._backfaceCommands.trim(),a){let h=e._backfaceCommands.values,g=h.length;i.length+=g;for(let x=y-1;x>=0;--x)i[f+g+x]=i[f+x];for(let x=0;x<g;++x)i[f+x]=h[x]}y=i.length-r,l.numberOfCommands=y,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&y>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(c(e._tileDebugLabels)||(e._tileDebugLabels=new Gh),C4e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Ude=[];function L4e(e,t){let n=t,i=Ude;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&&(Z4e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Ode(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Z4e(e,t){e._cache.unloadTile(e,t,Ode),t.destroy()}rr.prototype.trimLoadedTiles=function(){this._cache.trim()};function R4e(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;pf.clone(n,i);let l=o!==s||r!==a;l&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,l&&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 G4e(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 E4e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&c(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function X4e(e,t,n,i){if(t.mode===se.MORPHING||!c(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,G4e(e),E4e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&f4e(e),V4e(e,t,i),pf.clone(o,n),i.isRender){let s=e._credits;if(c(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let l=s[a];t.creditDisplay.addCreditToNextFrame(l)}}return r}function Dde(e){let t=e._credits;c(t)||(t=[]),t.length=0,c(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Ct.clone(i))});let n=e.asset.extras;if(c(n)&&c(n.cesium)&&c(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}rr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Fo.MOST_DETAILED_PRELOAD||t===Fo.MOST_DETAILED_PICK?RP:this.isSkippingLevelOfDetail?wP:XP};rr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};rr.prototype.updateForPass=function(e,t){C.typeOf.object("frameState",e),C.typeOf.object("tilesetPassState",t);let n=t.pass;if(n===Fo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Fo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Fo.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=Fo.getPassOptions(n),a=s.ignoreCommands,l=t.commandList??i,d=l.length;if(e.commandList=l,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;c(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;c(u)&&u.enabled&&u.queueCommands(e);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=X4e(this,e,f,s)),a&&(l.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};rr.prototype.hasExtension=function(e){return c(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};rr.prototype.isDestroyed=function(){return!1};rr.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(),c(this._root)){let e=Ude;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,he(this)};rr.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};rr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!rr.supportedExtensions[e[t]])throw new le(`Unsupported 3D Tiles Extension: ${e[t]}`)};var I4e=new bn,W4e=new m,w4e=new pe;rr.prototype.getHeight=function(e,t){C.typeOf.object("cartographic",e),C.typeOf.object("scene",t);let n=t.ellipsoid;c(n)||(n=re.WGS84);let i=I4e,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,W4e);if(c(r))return n.cartesianToCartographic(r,w4e)?.height};rr.prototype.updateHeight=function(e,t,n){n=n??re.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 P4e=new Ia,v4e=new m;rr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let l=0;l<o;++l){let d=i[l],u=qn.raySphere(e,d.contentBoundingVolume.boundingSphere,P4e);!c(u)||!c(d.content)||r.push(d)}let s=r.length;r.sort((l,d)=>{let u=ue.distanceSquaredTo(l.contentBoundingVolume.boundingSphere,e.origin),f=ue.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-f});let a;for(let l=0;l<s;++l){let u=r[l].content.pick(e,t,v4e);if(c(u))return a=m.clone(u,n),a}};var bs=rr;var F4e=new M;function Dy(e,t){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(Dy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}Dy.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;u&&(f=s.computeModelMatrix(e,F4e),l=Ge.createIfNeeded(J.getValueOrUndefined(a._uri,e)));let p=c(d)?d.tilesetPrimitive:void 0;if(!u){c(p)&&(p.show=!1);continue}(!c(d)||l.url!==d.url)&&(c(p)&&i.removeAndDestroy(p),delete n[s.id],A4e(l,n,s,i)),c(p)&&(p.show=!0,c(f)&&(p.modelMatrix=f),p.maximumScreenSpaceError=J.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Dy.prototype.isDestroyed=function(){return!1};Dy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)vK(this,e[i],t,n);return he(this)};Dy.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._tilesetHash[e.id];if(!c(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return c(i)?i.show?(ue.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};Dy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._tileset)?s.set(r.id,r):(vK(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],vK(this,r,a,l),s.remove(r.id)};function vK(e,t,n,i){let o=n[t.id];c(o)&&(c(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function A4e(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),!c(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var PP=Dy;var S4n=_(T(),1);var M4e=Y.WHITE,N4e=Y.BLACK,k4e=new D(2,2);function E1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(E1.prototype,{isConstant:{get:function(){return J.isConstant(this._evenColor)&&J.isConstant(this._oddColor)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:fe("evenColor"),oddColor:fe("oddColor"),repeat:fe("repeat")});E1.prototype.getType=function(e){return"Checkerboard"};var U4e=new ee;E1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(U4e)),c(t)||(t={}),t.lightColor=J.getValueOrClonedDefault(this._evenColor,e,M4e,t.lightColor),t.darkColor=J.getValueOrClonedDefault(this._oddColor,e,N4e,t.darkColor),t.repeat=J.getValueOrDefault(this._repeat,e,k4e),t};E1.prototype.equals=function(e){return this===e||e instanceof E1&&J.equals(this._evenColor,e._evenColor)&&J.equals(this._oddColor,e._oddColor)&&J.equals(this._repeat,e._repeat)};var X1=E1;var U4n=_(T(),1);var w4n=_(T(),1);var Bde={id:void 0};function vP(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 _c(e){this._owner=e,this._entities=new Zt,this._addedEntities=new Zt,this._removedEntities=new Zt,this._changedEntities=new Zt,this._suspendCount=0,this._collectionChanged=new ye,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}_c.prototype.suspendEvents=function(){this._suspendCount++};_c.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new L("resumeEvents can not be called before suspendEvents.");this._suspendCount--,vP(this)};Object.defineProperties(_c.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(!c(e))throw new L("value is required.");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}}});_c.prototype.computeAvailability=function(){let e=Ye.MAXIMUM_VALUE,t=Ye.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(c(s)){let a=s.start,l=s.stop;ee.lessThan(a,e)&&!a.equals(Ye.MINIMUM_VALUE)&&(e=a),ee.greaterThan(l,t)&&!l.equals(Ye.MAXIMUM_VALUE)&&(t=l)}}return Ye.MAXIMUM_VALUE.equals(e)&&(e=Ye.MINIMUM_VALUE),Ye.MINIMUM_VALUE.equals(t)&&(t=Ye.MAXIMUM_VALUE),new Zn({start:e,stop:t})};_c.prototype.add=function(e){if(!c(e))throw new L("entity is required.");e instanceof $o||(e=new $o(e));let t=e.id,n=this._entities;if(n.contains(t))throw new L(`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(_c.prototype._onEntityDefinitionChanged,this),vP(this),e};_c.prototype.remove=function(e){return c(e)?this.removeById(e.id):!1};_c.prototype.contains=function(e){if(!c(e))throw new L("entity is required");return this._entities.get(e.id)===e};_c.prototype.removeById=function(e){if(!c(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(_c.prototype._onEntityDefinitionChanged,this),vP(this),!0):!1};_c.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,l=i.get(a);c(l)||(s.definitionChanged.removeEventListener(_c.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),vP(this)};_c.prototype.getById=function(e){if(!c(e))throw new L("id is required.");return this._entities.get(e)};_c.prototype.getOrCreateEntity=function(e){if(!c(e))throw new L("id is required.");let t=this._entities.get(e);return c(t)||(Bde.id=e,t=new $o(Bde),this.add(t)),t};_c.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),vP(this)};var Ks=_c;var Xk={id:void 0},I1=new Array(2);function FK(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 Yde(e,t,n,i){I1[0]=n,I1[1]=i.id,t[JSON.stringify(I1)]=i.definitionChanged.addEventListener(Dr.prototype._onDefinitionChanged,e)}function Hde(e,t,n,i){I1[0]=n,I1[1]=i.id;let o=JSON.stringify(I1);t[o](),t[o]=void 0}function By(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,l,d,u=e._composite,f=new Ks(e),p=e._eventHash,y;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Dr.prototype._onCollectionChanged,e),a=d.values,y=d.id,l=a.length-1;l>-1;l--)s=a[l],Hde(e,p,y,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Dr.prototype._onCollectionChanged,e),a=d.values,y=d.id,l=a.length-1;l>-1;l--){s=a[l],Yde(e,p,y,s);let g=f.getById(s.id);c(g)||(g=u.getById(s.id),c(g)?FK(g):(Xk.id=s.id,g=new $o(Xk)),f.add(g)),g.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let h=f.values;for(r=0;r<h.length;r++)u.add(h[r]);u.resumeEvents()}function Dr(e,t){this._owner=t,this._composite=new Ks(this),this._suspendCount=0,this._collections=c(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},By(this),this._shouldRecomposite=!1}Object.defineProperties(Dr.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}}});Dr.prototype.addCollection=function(e,t){let n=c(t);if(!c(e))throw new L("collection is required.");if(n){if(t<0)throw new L("index must be greater than or equal to zero.");if(t>this._collections.length)throw new L("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),By(this)};Dr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),By(this),!0):!1};Dr.prototype.removeAllCollections=function(){this._collections.length=0,By(this)};Dr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Dr.prototype.contains=function(e){return this._composite.contains(e)};Dr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Dr.prototype.getCollection=function(e){if(!c(e))throw new L("index is required.","index");return this._collections[e]};Dr.prototype.getCollectionsLength=function(){return this._collections.length};function Ik(e,t){if(!c(t))throw new L("collection is required.");let n=e.indexOf(t);if(n===-1)throw new L("collection is not in this composite.");return n}function zde(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,By(e)}Dr.prototype.raiseCollection=function(e){let t=Ik(this._collections,e);zde(this,t,t+1)};Dr.prototype.lowerCollection=function(e){let t=Ik(this._collections,e);zde(this,t,t-1)};Dr.prototype.raiseCollectionToTop=function(e){let t=Ik(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),By(this))};Dr.prototype.lowerCollectionToBottom=function(e){let t=Ik(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),By(this))};Dr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Dr.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new L("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(By(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Dr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Dr.prototype.getById=function(e){return this._composite.getById(e)};Dr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,l,d,u=n.length,f=this._eventHash,p=e.id;for(s=0;s<u;s++){let h=n[s];Hde(this,f,p,h);let g=h.id;for(a=o-1;a>=0;a--)l=i[a].getById(g),c(l)&&(c(d)||(d=r.getById(g),FK(d)),d.merge(l));c(d)||r.removeById(g),d=void 0}let y=t.length;for(s=0;s<y;s++){let h=t[s];Yde(this,f,p,h);let g=h.id;for(a=o-1;a>=0;a--)l=i[a].getById(g),c(l)&&(c(d)||(d=r.getById(g),c(d)?FK(d):(Xk.id=g,d=new $o(Xk),r.add(d))),d.merge(l));d=void 0}r.resumeEvents()};Dr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,l=r.getById(a),d=l[t],u=!c(d),f=!0;for(let p=s-1;p>=0;p--){let y=o[p].getById(e.id);if(c(y)){let h=y[t];if(c(h)){if(f)if(f=!1,c(h.merge)&&c(h.clone))d=h.clone(d);else{d=h;break}d.merge(h)}}}u&&l.propertyNames.indexOf(t)===-1&&l.addProperty(t),l[t]=d};var AK=Dr;var x8n=_(T(),1);var u8n=_(T(),1);var Y4n=_(T(),1);function MK(){this._removalFunctions=[]}MK.prototype.add=function(e,t,n){if(!c(e))throw new L("event is required");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)}};MK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var hr=MK;var i8n=_(T(),1);function UK(e,t){return ee.compare(e.start,t.start)}function Br(e){if(this._intervals=[],this._changedEvent=new ye,c(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Br.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}}});Br.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Br))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(!Zn.equals(n[r],i[r],t))return!1;return!0};Br.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._intervals[e]};Br.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Br.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Br.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Br.prototype.contains=function(e){return this.indexOf(e)>=0};var NK=new Zn;Br.prototype.indexOf=function(e){if(!c(e))throw new L("date is required");let t=this._intervals;NK.start=e,NK.stop=e;let n=Wo(t,NK,UK);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&&Zn.contains(t[n-1],e)?n-1:~n)};Br.prototype.findInterval=function(e){e=e??z.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 l=r[s];if((!c(t)||l.start.equals(t))&&(!c(n)||l.stop.equals(n))&&(!c(i)||l.isStartIncluded===i)&&(!c(o)||l.isStopIncluded===o))return r[s]}};Br.prototype.addInterval=function(e,t){if(!c(e))throw new L("interval is required");if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Wo(n,e,UK);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=ee.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((c(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new Zn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Zn({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=ee.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Zn({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 Zn({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=ee.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(c(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Zn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Zn({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)};Br.prototype.removeInterval=function(e){if(!c(e))throw new L("interval is required");if(e.isEmpty)return!1;let t=this._intervals,n=Wo(t,e,UK);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.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 Zn({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 Zn({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 Zn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.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 Zn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Zn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Zn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Br.prototype.intersect=function(e,t,n){if(!c(e))throw new L("other is required.");let i=new Br,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let l=s[o],d=a[r];if(ee.lessThan(l.stop,d.start))++o;else if(ee.lessThan(d.stop,l.start))++r;else{if(c(n)||c(t)&&t(l.data,d.data)||!c(t)&&d.data===l.data){let u=Zn.intersect(l,d,new Zn,n);u.isEmpty||i.addInterval(u,t)}ee.lessThan(l.stop,d.stop)||l.stop.equals(d.stop)&&!l.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Br.fromJulianDateArray=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.julianDates))throw new L("options.iso8601Array is required.");c(t)||(t=new Br);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,l=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Zn({start:Ye.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=c(o)?o(d,t.length):t.length,t.addInterval(d));for(let f=0;f<i-1;++f){let p=n[f],y=n[f+1];d=new Zn({start:p,stop:y,isStartIncluded:t.length===u?r:!0,isStopIncluded:f===i-2?s:!1}),d.data=c(o)?o(d,t.length):t.length,t.addInterval(d),p=y}return l&&(d=new Zn({start:n[i-1],stop:Ye.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=c(o)?o(d,t.length):t.length,t.addInterval(d)),t};var Tc=new eh,FP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function kK(e,t,n){c(n)||(n=new ee),ee.toGregorianDate(e,Tc);let i=Tc.millisecond+t.millisecond,o=Tc.second+t.second,r=Tc.minute+t.minute,s=Tc.hour+t.hour,a=Tc.day+t.day,l=Tc.month+t.month,d=Tc.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),FP[2]=Lm(d)?29:28;a>FP[l]||l>=13;)a>FP[l]&&(a-=FP[l],++l),l>=13&&(--l,d+=Math.floor(l/12),l=l%12,++l),FP[2]=Lm(d)?29:28;return Tc.millisecond=i,Tc.second=o,Tc.minute=r,Tc.hour=s,Tc.day=a,Tc.month=l,Tc.year=d,ee.fromGregorianDate(Tc,n)}var O4e=new ee,D4e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Kde(e,t){if(!c(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(D4e);if(!c(n))return!1;if(c(n[1])&&(t.year=Number(n[1].replace(",","."))),c(n[2])&&(t.month=Number(n[2].replace(",","."))),c(n[3])&&(t.day=Number(n[3].replace(",","."))*7),c(n[4])&&(t.day+=Number(n[4].replace(",","."))),c(n[5])&&(t.hour=Number(n[5].replace(",","."))),c(n[6])&&(t.minute=Number(n[6].replace(",","."))),c(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"),ee.toGregorianDate(ee.fromIso8601(e,O4e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var AP=new eh;Br.fromIso8601=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.iso8601))throw new L("options.iso8601 is required.");let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=[];if(!Kde(n[2],AP))r.push(i,o);else{let s=ee.clone(i);for(r.push(s);ee.compare(s,o)<0;)s=kK(s,AP),ee.compare(o,s)<=0&&ee.clone(o,s),r.push(s)}return Br.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Br.fromIso8601DateArray=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.iso8601Dates))throw new L("options.iso8601Dates is required.");return Br.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Br.fromIso8601DurationArray=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.epoch))throw new L("options.epoch is required.");if(!c(e.iso8601Durations))throw new L("options.iso8601Durations is required.");let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,l=i.length;for(let d=0;d<l;++d)(Kde(i[d],AP)||d===0)&&(o&&c(a)?s=kK(a,AP):s=kK(n,AP),r.push(s),a=s);return Br.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Yr=Br;function B4e(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 l=i.get(a);c(l.data)&&r.indexOf(l.data)===-1&&t.add(l.data.definitionChanged,o)}}function q_(){this._eventHelper=new hr,this._definitionChanged=new ye,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(q_.prototype._intervalsChanged,this)}Object.defineProperties(q_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Y4e=new ee;q_.prototype.getValue=function(e,t){c(e)||(e=ee.now(Y4e));let n=this._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};q_.prototype.equals=function(e){return this===e||e instanceof q_&&this._intervals.equals(e._intervals,J.equals)};q_.prototype._intervalsChanged=function(){B4e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Sc=q_;function Yy(){this._definitionChanged=new ye,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Yy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Yy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Yy.prototype.getType=function(e){if(!c(e))throw new L("time is required");let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(t))return t.getType(e)};var H4e=new ee;Yy.prototype.getValue=function(e,t){c(e)||(e=ee.now(H4e));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};Yy.prototype.equals=function(e){return this===e||e instanceof Yy&&this._composite.equals(e._composite,J.equals)};Yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var W1=Yy;var G8n=_(T(),1);function Hy(e){this._referenceFrame=e??Ui.FIXED,this._definitionChanged=new ye,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Hy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Hy.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 z4e=new ee;Hy.prototype.getValue=function(e,t){return c(e)||(e=ee.now(z4e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Hy.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(i))return i.getValueInReferenceFrame(e,t,n)};Hy.prototype.equals=function(e){return this===e||e instanceof Hy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,J.equals)};Hy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ya=Hy;var G6n=_(T(),1);var V7n=_(T(),1);var X8n=_(T(),1),K4e={ROUNDED:0,MITERED:1,BEVELED:2},Fi=Object.freeze(K4e);var t7n=_(T(),1);var Y8n=_(T(),1);var ga=[new m,new m],J4e=new m,Q4e=new m,j4e=new m,q4e=new m,$4e=new m,e8e=new m,t8e=new m,n8e=new m,i8e=new m,w1=new m,Wk=new m,MP={},OK=new pe;function o8e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];OK=t.cartesianToCartographic(o,OK),n[i]=OK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function DK(e,t,n,i){let o=e[0],r=e[1],s=m.angleBetween(o,r),a=Math.ceil(s/i),l=new Array(a),d;if(t===n){for(d=0;d<a;d++)l[d]=t;return l.push(n),l}let f=(n-t)/a;for(d=1;d<a;d++){let p=t+d*f;l[d]=p}return l[0]=t,l.push(n),l}var wk=new m,Pk=new m;function r8e(e,t,n,i){let o=new $r(n,i),r=o.projectPointOntoPlane(m.add(n,e,wk),wk),s=o.projectPointOntoPlane(m.add(n,t,Pk),Pk),a=D.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var s8e=new m(-1,0,0),$_=new M,a8e=new M,BK=new te,c8e=te.IDENTITY.clone(),l8e=new m,d8e=new ce,Jde=new m;function Ab(e,t,n,i,o,r,s,a){let l=l8e,d=d8e;$_=wt.eastNorthUpToFixedFrame(e,o,$_),l=M.multiplyByPointAsVector($_,s8e,l),l=m.normalize(l,l);let u=r8e(l,t,e,o);BK=te.fromRotationZ(u,BK),Jde.z=r,$_=M.multiplyTransformation($_,M.fromRotationTranslation(BK,Jde,a8e),$_);let f=c8e;f[0]=s;for(let p=0;p<a;p++)for(let y=0;y<n.length;y+=3)d=m.fromArray(n,y,d),d=te.multiplyByVector(f,d,d),d=M.multiplyByPoint($_,d,d),i.push(d.x,d.y,d.z);return i}var u8e=new m;function YK(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let l=m.fromArray(e,a,u8e);i=Ab(l,t,n,i,o,r[a/3],s,1)}return i}function m8e(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 l=1;l<n;l++){a=e[l];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 Qde(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 jde=new Fe,qde=new m,$de=new te;function eue(e,t,n,i,o,r,s,a,l,d){let u=m.angleBetween(m.subtract(t,e,w1),m.subtract(n,e,Wk)),f=i===Fi.BEVELED?0:Math.ceil(u/w.toRadians(5)),p;o?p=te.fromQuaternion(Fe.fromAxisAngle(m.negate(e,w1),u/(f+1),jde),$de):p=te.fromQuaternion(Fe.fromAxisAngle(e,u/(f+1),jde),$de);let y,h;if(t=m.clone(t,qde),f>0){let g=d?2:1;for(let x=0;x<f;x++)t=te.multiplyByVector(p,t,t),y=m.subtract(t,e,w1),y=m.normalize(y,y),o||(y=m.negate(y,y)),h=r.scaleToGeodeticSurface(t,Wk),s=Ab(h,y,a,s,r,l,1,g)}else y=m.subtract(t,e,w1),y=m.normalize(y,y),o||(y=m.negate(y,y)),h=r.scaleToGeodeticSurface(t,Wk),s=Ab(h,y,a,s,r,l,1,1),n=m.clone(n,qde),y=m.subtract(n,e,w1),y=m.normalize(y,y),o||(y=m.negate(y,y)),h=r.scaleToGeodeticSurface(n,Wk),s=Ab(h,y,a,s,r,l,1,1);return s}MP.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};MP.angleIsGreaterThanPi=function(e,t,n,i){let o=new $r(n,i),r=o.projectPointOntoPlane(m.add(n,e,wk),wk),s=o.projectPointOntoPlane(m.add(n,t,Pk),Pk);return s.x*r.y-s.y*r.x>=0};var f8e=new m,h8e=new m;MP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=o8e(e,r),a=i._granularity,l=i._cornerType,d=o?m8e(t,n):Qde(t,n),u=o?Qde(t,n):void 0,f=n.height/2,p=n.width/2,y=e.length,h=[],g=o?[]:void 0,x=J4e,S=Q4e,V=j4e,Z=q4e,R=$4e,E=e8e,I=t8e,v=n8e,P=i8e,F=e[0],N=e[1];Z=r.geodeticSurfaceNormal(F,Z),x=m.subtract(N,F,x),x=m.normalize(x,x),v=m.cross(Z,x,v),v=m.normalize(v,v);let b=s[0],G=s[1];o&&(g=Ab(F,v,u,g,r,b+f,1,1)),P=m.clone(F,P),F=N,S=m.negate(x,S);let X,W;for(let B=1;B<y-1;B++){let O=o?2:1;if(N=e[B+1],F.equals(N)){ht("Positions are too close and are considered equivalent with rounding error.");continue}x=m.subtract(N,F,x),x=m.normalize(x,x),Z=r.geodeticSurfaceNormal(F,Z);let H=m.multiplyByScalar(Z,m.dot(x,Z),f8e);m.subtract(x,H,H),m.normalize(H,H);let U=m.multiplyByScalar(Z,m.dot(S,Z),h8e);if(m.subtract(S,U,U),m.normalize(U,U),!w.equalsEpsilon(Math.abs(m.dot(H,U)),1,w.EPSILON7)){V=m.add(x,S,V),V=m.normalize(V,V),V=m.cross(V,Z,V),V=m.cross(Z,V,V),V=m.normalize(V,V);let Q=1/Math.max(.25,m.magnitude(m.cross(V,S,w1))),ie=MP.angleIsGreaterThanPi(x,S,F,r);ie?(R=m.add(F,m.multiplyByScalar(V,Q*p,V),R),E=m.add(R,m.multiplyByScalar(v,p,E),E),ga[0]=m.clone(P,ga[0]),ga[1]=m.clone(E,ga[1]),X=DK(ga,b+f,G+f,a),W=vi.generateArc({positions:ga,granularity:a,ellipsoid:r}),h=YK(W,v,d,h,r,X,1),v=m.cross(Z,x,v),v=m.normalize(v,v),I=m.add(R,m.multiplyByScalar(v,p,I),I),l===Fi.ROUNDED||l===Fi.BEVELED?eue(R,E,I,l,ie,r,h,d,G+f,o):(V=m.negate(V,V),h=Ab(F,V,d,h,r,G+f,Q,O)),P=m.clone(I,P)):(R=m.add(F,m.multiplyByScalar(V,Q*p,V),R),E=m.add(R,m.multiplyByScalar(v,-p,E),E),ga[0]=m.clone(P,ga[0]),ga[1]=m.clone(E,ga[1]),X=DK(ga,b+f,G+f,a),W=vi.generateArc({positions:ga,granularity:a,ellipsoid:r}),h=YK(W,v,d,h,r,X,1),v=m.cross(Z,x,v),v=m.normalize(v,v),I=m.add(R,m.multiplyByScalar(v,-p,I),I),l===Fi.ROUNDED||l===Fi.BEVELED?eue(R,E,I,l,ie,r,h,d,G+f,o):h=Ab(F,V,d,h,r,G+f,Q,O),P=m.clone(I,P)),S=m.negate(x,S)}else h=Ab(P,v,d,h,r,b+f,1,1),P=F;b=G,G=s[B+1],F=N}ga[0]=m.clone(P,ga[0]),ga[1]=m.clone(F,ga[1]),X=DK(ga,b+f,G+f,a),W=vi.generateArc({positions:ga,granularity:a,ellipsoid:r}),h=YK(W,v,d,h,r,X,1),o&&(g=Ab(F,v,u,g,r,G+f,1,1)),y=h.length;let A=o?y+g.length:y,k=new Float64Array(A);return k.set(h),o&&k.set(g,y),k};var bf=MP;var zK={},P1=new m,rue=new m,p8e=new m,tue=new m,nl=[new m,new m],sue=new m,aue=new m,cue=new m,b8e=new m,y8e=new m,g8e=new m,x8e=new m,_8e=new m,T8e=new m,S8e=new m,nue=new Fe,iue=new te;function vk(e,t,n,i,o){let r=m.angleBetween(m.subtract(t,e,P1),m.subtract(n,e,rue)),s=i===Fi.BEVELED?1:Math.ceil(r/w.toRadians(5))+1,a=s*3,l=new Array(a);l[a-3]=n.x,l[a-2]=n.y,l[a-1]=n.z;let d;o?d=te.fromQuaternion(Fe.fromAxisAngle(m.negate(e,P1),r/s,nue),iue):d=te.fromQuaternion(Fe.fromAxisAngle(e,r/s,nue),iue);let u=0;t=m.clone(t,P1);for(let f=0;f<s;f++)t=te.multiplyByVector(d,t,t),l[u++]=t.x,l[u++]=t.y,l[u++]=t.z;return l}function C8e(e){let t=sue,n=aue,i=cue,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=vk(t,n,i,Fi.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 l=vk(t,n,i,Fi.ROUNDED,!1);return[r,l]}function oue(e,t,n,i){let o=P1;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 HK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=m.multiplyByScalar(t,n,P1),a=m.negate(s,rue),l=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let f=m.fromArray(e,u,p8e),p=m.add(f,a,tue);o[l++]=p.x,o[l++]=p.y,o[l++]=p.z;let y=m.add(f,s,tue);r[d--]=y.z,r[d--]=y.y,r[d--]=y.x}return i.push(o,r),i}zK.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;c(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),c(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var V8e=new m,L8e=new m;zK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=sue,l=aue,d=cue,u=b8e,f=y8e,p=g8e,y=x8e,h=_8e,g=T8e,x=S8e,S=[],V=s?[]:void 0,Z=s?[]:void 0,R=n[0],E=n[1];l=m.normalize(m.subtract(E,R,l),l),a=i.geodeticSurfaceNormal(R,a),u=m.normalize(m.cross(a,l,u),u),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z)),y=m.clone(R,y),R=E,d=m.negate(l,d);let I,v=[],P,F=n.length;for(P=1;P<F-1;P++){a=i.geodeticSurfaceNormal(R,a),E=n[P+1],l=m.normalize(m.subtract(E,R,l),l);let b=m.multiplyByScalar(a,m.dot(l,a),V8e);m.subtract(l,b,b),m.normalize(b,b);let G=m.multiplyByScalar(a,m.dot(d,a),L8e);if(m.subtract(d,G,G),m.normalize(G,G),!w.equalsEpsilon(Math.abs(m.dot(b,G)),1,w.EPSILON7)){f=m.normalize(m.add(l,d,f),f),f=m.cross(f,a,f),f=m.cross(a,f,f),f=m.normalize(f,f);let W=o/Math.max(.25,m.magnitude(m.cross(f,d,P1))),A=bf.angleIsGreaterThanPi(l,d,R,i);f=m.multiplyByScalar(f,W,f),A?(h=m.add(R,f,h),x=m.add(h,m.multiplyByScalar(u,o,x),x),g=m.add(h,m.multiplyByScalar(u,o*2,g),g),nl[0]=m.clone(y,nl[0]),nl[1]=m.clone(x,nl[1]),I=vi.generateArc({positions:nl,granularity:t,ellipsoid:i}),S=HK(I,u,o,S),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z)),p=m.clone(g,p),u=m.normalize(m.cross(a,l,u),u),g=m.add(h,m.multiplyByScalar(u,o*2,g),g),y=m.add(h,m.multiplyByScalar(u,o,y),y),r===Fi.ROUNDED||r===Fi.BEVELED?v.push({leftPositions:vk(h,p,g,r,A)}):v.push({leftPositions:oue(R,m.negate(f,f),g,A)})):(g=m.add(R,f,g),x=m.add(g,m.negate(m.multiplyByScalar(u,o,x),x),x),h=m.add(g,m.negate(m.multiplyByScalar(u,o*2,h),h),h),nl[0]=m.clone(y,nl[0]),nl[1]=m.clone(x,nl[1]),I=vi.generateArc({positions:nl,granularity:t,ellipsoid:i}),S=HK(I,u,o,S),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z)),p=m.clone(h,p),u=m.normalize(m.cross(a,l,u),u),h=m.add(g,m.negate(m.multiplyByScalar(u,o*2,h),h),h),y=m.add(g,m.negate(m.multiplyByScalar(u,o,y),y),y),r===Fi.ROUNDED||r===Fi.BEVELED?v.push({rightPositions:vk(g,p,h,r,A)}):v.push({rightPositions:oue(R,f,h,A)})),d=m.negate(l,d)}R=E}a=i.geodeticSurfaceNormal(R,a),nl[0]=m.clone(y,nl[0]),nl[1]=m.clone(R,nl[1]),I=vi.generateArc({positions:nl,granularity:t,ellipsoid:i}),S=HK(I,u,o,S),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z));let N;return r===Fi.ROUNDED&&(N=C8e(S)),{positions:S,corners:v,lefts:V,normals:Z,endPositions:N}};var Bi=zK;var uue=new m,mue=new m,Fk=new m,Ak=new m,Z8e=new m,fue=new m,zy=new m,v1=new m;function hue(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function yf(e,t,n,i,o,r){let s=e.normals,a=e.tangents,l=e.bitangents,d=m.normalize(m.cross(n,t,zy),zy);r.normal&&Bi.addAttribute(s,t,i,o),r.tangent&&Bi.addAttribute(a,d,i,o),r.bitangent&&Bi.addAttribute(l,n,i,o)}function pue(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,l=new fn,d,u=0,f=0,p,y=0,h;for(p=0;p<i.length;p+=2)h=i[p].length-3,u+=h,y+=h*2,f+=i[p+1].length-3;for(u+=3,f+=3,p=0;p<o.length;p++){d=o[p];let ne=o[p].leftPositions;c(ne)?(h=ne.length,u+=h,y+=h):(h=o[p].rightPositions.length,f+=h,y+=h)}let g=c(r),x;g&&(x=r[0].length-3,u+=x,f+=x,x/=3,y+=x*6);let S=u+f,V=new Float64Array(S),Z=t.normal?new Float32Array(S):void 0,R=t.tangent?new Float32Array(S):void 0,E=t.bitangent?new Float32Array(S):void 0,I={normals:Z,tangents:R,bitangents:E},v=0,P=S-1,F,N,b,G,X=uue,W=mue,A,k,B=x/2,O=Me.createTypedArray(S/3,y),H=0;if(g){k=Fk,A=Ak;let ne=r[0];for(X=m.fromArray(a,0,X),W=m.fromArray(s,0,W),p=0;p<B;p++)k=m.fromArray(ne,(B-1-p)*3,k),A=m.fromArray(ne,(B+p)*3,A),Bi.addAttribute(V,A,v),Bi.addAttribute(V,k,void 0,P),yf(I,X,W,v,P,t),N=v/3,G=N+1,F=(P-2)/3,b=F-1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3}let U=0,K=0,Q=i[U++],ie=i[U++];V.set(Q,v),V.set(ie,P-ie.length+1),W=m.fromArray(s,K,W);let j,$;for(h=ie.length-3,p=0;p<h;p+=3)j=n.geodeticSurfaceNormal(m.fromArray(Q,p,zy),zy),$=n.geodeticSurfaceNormal(m.fromArray(ie,h-p,v1),v1),X=m.normalize(m.add(j,$,X),X),yf(I,X,W,v,P,t),N=v/3,G=N+1,F=(P-2)/3,b=F-1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3;for(j=n.geodeticSurfaceNormal(m.fromArray(Q,h,zy),zy),$=n.geodeticSurfaceNormal(m.fromArray(ie,h,v1),v1),X=m.normalize(m.add(j,$,X),X),K+=3,p=0;p<o.length;p++){let ne;d=o[p];let be=d.leftPositions,Ce=d.rightPositions,me,_e,Ve=fue,Ie=Fk,Ze=Ak;if(X=m.fromArray(a,K,X),c(be)){for(yf(I,X,W,void 0,P,t),P-=3,me=G,_e=b,ne=0;ne<be.length/3;ne++)Ve=m.fromArray(be,ne*3,Ve),O[H++]=me,O[H++]=_e-ne-1,O[H++]=_e-ne,Bi.addAttribute(V,Ve,void 0,P),Ie=m.fromArray(V,(_e-ne-1)*3,Ie),Ze=m.fromArray(V,me*3,Ze),W=m.normalize(m.subtract(Ie,Ze,W),W),yf(I,X,W,void 0,P,t),P-=3;Ve=m.fromArray(V,me*3,Ve),Ie=m.subtract(m.fromArray(V,_e*3,Ie),Ve,Ie),Ze=m.subtract(m.fromArray(V,(_e-ne)*3,Ze),Ve,Ze),W=m.normalize(m.add(Ie,Ze,W),W),yf(I,X,W,v,void 0,t),v+=3}else{for(yf(I,X,W,v,void 0,t),v+=3,me=b,_e=G,ne=0;ne<Ce.length/3;ne++)Ve=m.fromArray(Ce,ne*3,Ve),O[H++]=me,O[H++]=_e+ne,O[H++]=_e+ne+1,Bi.addAttribute(V,Ve,v),Ie=m.fromArray(V,me*3,Ie),Ze=m.fromArray(V,(_e+ne)*3,Ze),W=m.normalize(m.subtract(Ie,Ze,W),W),yf(I,X,W,v,void 0,t),v+=3;Ve=m.fromArray(V,me*3,Ve),Ie=m.subtract(m.fromArray(V,(_e+ne)*3,Ie),Ve,Ie),Ze=m.subtract(m.fromArray(V,_e*3,Ze),Ve,Ze),W=m.normalize(m.negate(m.add(Ze,Ie,W),W),W),yf(I,X,W,void 0,P,t),P-=3}for(Q=i[U++],ie=i[U++],Q.splice(0,3),ie.splice(ie.length-3,3),V.set(Q,v),V.set(ie,P-ie.length+1),h=ie.length-3,K+=3,W=m.fromArray(s,K,W),ne=0;ne<ie.length;ne+=3)j=n.geodeticSurfaceNormal(m.fromArray(Q,ne,zy),zy),$=n.geodeticSurfaceNormal(m.fromArray(ie,h-ne,v1),v1),X=m.normalize(m.add(j,$,X),X),yf(I,X,W,v,P,t),G=v/3,N=G-1,b=(P-2)/3,F=b+1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3;v-=3,P+=3}if(X=m.fromArray(a,a.length-3,X),yf(I,X,W,v,P,t),g){v+=3,P-=3,k=Fk,A=Ak;let ne=r[1];for(p=0;p<B;p++)k=m.fromArray(ne,(x-p-1)*3,k),A=m.fromArray(ne,p*3,A),Bi.addAttribute(V,k,void 0,P),Bi.addAttribute(V,A,v),yf(I,X,W,v,P,t),G=v/3,N=G-1,b=(P-2)/3,F=b+1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3}if(l.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let ne=new Float32Array(S/3*2),be,Ce,me=0;if(g){u/=3,f/=3;let _e=Math.PI/(x+1);Ce=1/(u-x+1),be=1/(f-x+1);let Ve,Ie=x/2;for(p=Ie+1;p<x+1;p++)Ve=w.PI_OVER_TWO+_e*p,ne[me++]=be*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve));for(p=1;p<f-x+1;p++)ne[me++]=p*be,ne[me++]=0;for(p=x;p>Ie;p--)Ve=w.PI_OVER_TWO-p*_e,ne[me++]=1-be*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve));for(p=Ie;p>0;p--)Ve=w.PI_OVER_TWO-_e*p,ne[me++]=1-Ce*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve));for(p=u-x;p>0;p--)ne[me++]=p*Ce,ne[me++]=1;for(p=1;p<Ie+1;p++)Ve=w.PI_OVER_TWO+_e*p,ne[me++]=Ce*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve))}else{for(u/=3,f/=3,Ce=1/(u-1),be=1/(f-1),p=0;p<f;p++)ne[me++]=p*be,ne[me++]=0;for(p=u;p>0;p--)ne[me++]=(p-1)*Ce,ne[me++]=1}l.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:ne})}return t.normal&&(l.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(l.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(l.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:l,indices:O}}function R8e(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,l=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,f=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,y=uue,h=mue,g=Fk,x=Ak,S=Z8e,V=fue,Z=l;for(d=0;d<s;d+=3){let R=Z+l;y=m.fromArray(n,d,y),h=m.fromArray(n,d+s,h),g=m.fromArray(n,(d+3)%s,g),h=m.subtract(h,y,h),g=m.subtract(g,y,g),x=m.normalize(m.cross(h,g,x),x),t.normal&&(Bi.addAttribute(u,x,R),Bi.addAttribute(u,x,R+3),Bi.addAttribute(u,x,Z),Bi.addAttribute(u,x,Z+3)),(t.tangent||t.bitangent)&&(V=m.fromArray(i,d,V),t.bitangent&&(Bi.addAttribute(p,V,R),Bi.addAttribute(p,V,R+3),Bi.addAttribute(p,V,Z),Bi.addAttribute(p,V,Z+3)),t.tangent&&(S=m.normalize(m.cross(V,x,S),S),Bi.addAttribute(f,S,R),Bi.addAttribute(f,S,R+3),Bi.addAttribute(f,S,Z),Bi.addAttribute(f,S,Z+3))),Z+=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;f.set(R),f.set(R,s),e.tangent.values=f}}if(t.st){let u=e.st.values,f=new Float32Array(a*6);f.set(u),f.set(u,a);let p=a*2;for(let y=0;y<2;y++){for(f[p++]=u[0],f[p++]=u[1],d=2;d<a;d+=2){let h=u[d],g=u[d+1];f[p++]=h,f[p++]=g,f[p++]=h,f[p++]=g}f[p++]=u[0],f[p++]=u[1]}e.st.values=f}return e}function KK(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 G8e(e,t){let n=new We({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=Bi.computePositions(e),r=pue(o,n,i),s=e.height,a=e.extrudedHeight,l=r.attributes,d=r.indices,u=l.position.values,f=u.length,p=new Float64Array(f*6),y=new Float64Array(f);y.set(u);let h=new Float64Array(f*4);u=ai.scaleToGeodeticHeight(u,s,i),h=KK(u,0,h),y=ai.scaleToGeodeticHeight(y,a,i),h=KK(y,f*2,h),p.set(u),p.set(y,f),p.set(h,f*2),l.position.values=p,l=R8e(l,t);let g,x=f/3;if(e.shadowVolume){let F=l.normal.values;f=F.length;let N=new Float32Array(f*6);for(g=0;g<f;g++)F[g]=-F[g];N.set(F,f),N=KK(F,f*4,N),l.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(l.normal=void 0)}if(c(e.offsetAttribute)){let F=new Uint8Array(x*6);if(e.offsetAttribute===$t.TOP)F=F.fill(1,0,x).fill(1,x*2,x*4);else{let N=e.offsetAttribute===$t.NONE?0:1;F=F.fill(N)}l.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}let S=d.length,V=x+x,Z=Me.createTypedArray(p.length/3,S*2+V*3);Z.set(d);let R=S;for(g=0;g<S;g+=3){let F=d[g],N=d[g+1],b=d[g+2];Z[R++]=b+x,Z[R++]=N+x,Z[R++]=F+x}let E,I,v,P;for(g=0;g<V;g+=2)E=g+V,I=E+V,v=E+1,P=I+1,Z[R++]=E,Z[R++]=I,Z[R++]=v,Z[R++]=v,Z[R++]=I,Z[R++]=P;return{attributes:l,indices:Z}}var lue=new m,NP=new m,Qu=new pe;function due(e,t,n,i,o,r){let s=m.subtract(t,e,lue);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,NP),l=m.cross(s,a,lue);m.multiplyByScalar(l,i,l);let d=o.latitude,u=o.longitude,f=r.latitude,p=r.longitude;m.add(e,l,NP),n.cartesianToCartographic(NP,Qu);let y=Qu.latitude,h=Qu.longitude;d=Math.min(d,y),u=Math.min(u,h),f=Math.max(f,y),p=Math.max(p,h),m.subtract(e,l,NP),n.cartesianToCartographic(NP,Qu),y=Qu.latitude,h=Qu.longitude,d=Math.min(d,y),u=Math.min(u,h),f=Math.max(f,y),p=Math.max(p,h),o.latitude=d,o.longitude=u,r.latitude=f,r.longitude=p}var Ju=new m,kP=new m,Dl=new pe,Bl=new pe;function bue(e,t,n,i,o){e=hue(e,t);let r=xo(e,m.equalsEpsilon),s=r.length;if(s<2||n<=0)return new de;let a=n*.5;Dl.latitude=Number.POSITIVE_INFINITY,Dl.longitude=Number.POSITIVE_INFINITY,Bl.latitude=Number.NEGATIVE_INFINITY,Bl.longitude=Number.NEGATIVE_INFINITY;let l,d;if(i===Fi.ROUNDED){let p=r[0];m.subtract(p,r[1],Ju),m.normalize(Ju,Ju),m.multiplyByScalar(Ju,a,Ju),m.add(p,Ju,kP),t.cartesianToCartographic(kP,Qu),l=Qu.latitude,d=Qu.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,d),Bl.latitude=Math.max(Bl.latitude,l),Bl.longitude=Math.max(Bl.longitude,d)}for(let p=0;p<s-1;++p)due(r[p],r[p+1],t,a,Dl,Bl);let u=r[s-1];m.subtract(u,r[s-2],Ju),m.normalize(Ju,Ju),m.multiplyByScalar(Ju,a,Ju),m.add(u,Ju,kP),due(u,kP,t,a,Dl,Bl),i===Fi.ROUNDED&&(t.cartesianToCartographic(kP,Qu),l=Qu.latitude,d=Qu.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,d),Bl.latitude=Math.max(Bl.latitude,l),Bl.longitude=Math.max(Bl.longitude,d));let f=c(o)?o:new de;return f.north=Bl.latitude,f.south=Dl.latitude,f.east=Bl.longitude,f.west=Dl.longitude,f}function Nb(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.width;C.defined("options.positions",t),C.defined("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Fi.ROUNDED,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+re.packedLength+We.packedLength+7}Nb.pack=function(e,t,n){C.defined("value",e),C.defined("array",t),n=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 re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.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]=e._offsetAttribute??-1,t};var yue=re.clone(re.UNIT_SPHERE),gue=new We,Mb={positions:void 0,ellipsoid:yue,vertexFormat:gue,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Nb.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let h=0;h<i;++h,t+=m.packedLength)o[h]=m.unpack(e,t);let r=re.unpack(e,t,yue);t+=re.packedLength;let s=We.unpack(e,t,gue);t+=We.packedLength;let a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t++]===1,y=e[t];return c(n)?(n._positions=o,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=We.clone(s,n._vertexFormat),n._width=a,n._height=l,n._extrudedHeight=d,n._cornerType=u,n._granularity=f,n._shadowVolume=p,n._offsetAttribute=y===-1?void 0:y,n):(Mb.positions=o,Mb.width=a,Mb.height=l,Mb.extrudedHeight=d,Mb.cornerType=u,Mb.granularity=f,Mb.shadowVolume=p,Mb.offsetAttribute=y===-1?void 0:y,new Nb(Mb))};Nb.computeRectangle=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.positions,i=e.width;C.defined("options.positions",n),C.defined("options.width",i);let o=e.ellipsoid??re.default,r=e.cornerType??Fi.ROUNDED;return bue(n,o,i,r,t)};Nb.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=hue(t,i);let o=xo(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),l=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=G8e(d,l);else{let y=Bi.computePositions(d);if(u=pue(y,l,i),u.attributes.position.values=ai.scaleToGeodeticHeight(u.attributes.position.values,r,i),c(e._offsetAttribute)){let h=e._offsetAttribute===$t.NONE?0:1,g=u.attributes.position.values.length,x=new Uint8Array(g/3).fill(h);u.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,p=ue.fromVertices(f.position.values,void 0,3);return l.position||(u.attributes.position.values=void 0),new dt({attributes:f,indices:u.indices,primitiveType:ve.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Nb.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Nb({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Nb.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=bue(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var eT=Nb;var B7n=_(T(),1);var xue=new m,_ue=new m,E8e=new m;function X8e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Tue(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new fn,a,l=0,d=0,u,f=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,l+=p,f+=p/3*4,d+=i[u+1].length-3;for(l+=3,d+=3,u=0;u<o.length;u++){a=o[u];let A=o[u].leftPositions;c(A)?(p=A.length,l+=p,f+=p/3*2):(p=o[u].rightPositions.length,d+=p,f+=p/3*2)}let y=c(r),h;y&&(h=r[0].length-3,l+=h,d+=h,h/=3,f+=h*4);let g=l+d,x=new Float64Array(g),S=0,V=g-1,Z,R,E,I,v,P,F=h/2,N=Me.createTypedArray(g/3,f+4),b=0;if(N[b++]=S/3,N[b++]=(V-2)/3,y){n.push(S/3),P=xue,v=_ue;let A=r[0];for(u=0;u<F;u++)P=m.fromArray(A,(F-1-u)*3,P),v=m.fromArray(A,(F+u)*3,v),Bi.addAttribute(x,v,S),Bi.addAttribute(x,P,void 0,V),R=S/3,I=R+1,Z=(V-2)/3,E=Z-1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3}let G=0,X=i[G++],W=i[G++];for(x.set(X,S),x.set(W,V-W.length+1),p=W.length-3,n.push(S/3,(V-2)/3),u=0;u<p;u+=3)R=S/3,I=R+1,Z=(V-2)/3,E=Z-1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3;for(u=0;u<o.length;u++){let A;a=o[u];let k=a.leftPositions,B=a.rightPositions,O,H=E8e;if(c(k)){for(V-=3,O=E,n.push(I),A=0;A<k.length/3;A++)H=m.fromArray(k,A*3,H),N[b++]=O-A-1,N[b++]=O-A,Bi.addAttribute(x,H,void 0,V),V-=3;n.push(O-Math.floor(k.length/6)),t===Fi.BEVELED&&n.push((V-2)/3+1),S+=3}else{for(S+=3,O=I,n.push(E),A=0;A<B.length/3;A++)H=m.fromArray(B,A*3,H),N[b++]=O+A,N[b++]=O+A+1,Bi.addAttribute(x,H,S),S+=3;n.push(O+Math.floor(B.length/6)),t===Fi.BEVELED&&n.push(S/3-1),V-=3}for(X=i[G++],W=i[G++],X.splice(0,3),W.splice(W.length-3,3),x.set(X,S),x.set(W,V-W.length+1),p=W.length-3,A=0;A<W.length;A+=3)I=S/3,R=I-1,E=(V-2)/3,Z=E+1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3;S-=3,V+=3,n.push(S/3,(V-2)/3)}if(y){S+=3,V-=3,P=xue,v=_ue;let A=r[1];for(u=0;u<F;u++)P=m.fromArray(A,(h-u-1)*3,P),v=m.fromArray(A,u*3,v),Bi.addAttribute(x,P,void 0,V),Bi.addAttribute(x,v,S),I=S/3,R=I-1,E=(V-2)/3,Z=E+1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3;n.push(S/3)}else n.push(S/3,(V-2)/3);return N[b++]=S/3,N[b++]=(V-2)/3,s.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:x}),{attributes:s,indices:N,wallIndices:n}}function I8e(e){let t=e.ellipsoid,n=Bi.computePositions(e),i=Tue(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,l=i.indices,d=a.position.values,u=d.length,f=new Float64Array(u);f.set(d);let p=new Float64Array(u*2);if(d=ai.scaleToGeodeticHeight(d,r,t),f=ai.scaleToGeodeticHeight(f,s,t),p.set(d),p.set(f,u),a.position.values=p,u/=3,c(e.offsetAttribute)){let Z=new Uint8Array(u*2);if(e.offsetAttribute===$t.TOP)Z=Z.fill(1,0,u);else{let R=e.offsetAttribute===$t.NONE?0:1;Z=Z.fill(R)}a.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z})}let y,h=l.length,g=Me.createTypedArray(p.length/3,(h+o.length)*2);g.set(l);let x=h;for(y=0;y<h;y+=2){let Z=l[y],R=l[y+1];g[x++]=Z+u,g[x++]=R+u}let S,V;for(y=0;y<o.length;y++)S=o[y],V=S+u,g[x++]=S,g[x++]=V;return{attributes:a,indices:g}}function UP(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.width;C.typeOf.object("options.positions",t),C.typeOf.number("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Fi.ROUNDED,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+re.packedLength+6}UP.pack=function(e,t,n){C.typeOf.object("value",e),C.typeOf.object("array",t),n=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 re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var Sue=re.clone(re.UNIT_SPHERE),Ky={positions:void 0,ellipsoid:Sue,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};UP.unpack=function(e,t,n){C.typeOf.object("array",e),t=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=re.unpack(e,t,Sue);t+=re.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t];return c(n)?(n._positions=o,n._ellipsoid=re.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=l,n._cornerType=d,n._granularity=u,n._offsetAttribute=f===-1?void 0:f,n):(Ky.positions=o,Ky.width=s,Ky.height=a,Ky.extrudedHeight=l,Ky.cornerType=d,Ky.granularity=u,Ky.offsetAttribute=f===-1?void 0:f,new UP(Ky))};UP.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=X8e(t,i);let o=xo(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),l={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)l.height=r,l.extrudedHeight=s,l.offsetAttribute=e._offsetAttribute,d=I8e(l);else{let p=Bi.computePositions(l);if(d=Tue(p,l.cornerType),d.attributes.position.values=ai.scaleToGeodeticHeight(d.attributes.position.values,r,i),c(e._offsetAttribute)){let y=d.attributes.position.values.length,h=e._offsetAttribute===$t.NONE?0:1,g=new Uint8Array(y/3).fill(h);d.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}}let u=d.attributes,f=ue.fromVertices(u.position.values,void 0,3);return new dt({attributes:u,indices:d.indices,primitiveType:ve.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var OP=UP;var i6n=_(T(),1);var W8e=new Qn(0);function il(e){oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}c(Object.create)&&(il.prototype=Object.create(oi.prototype),il.prototype.constructor=il);Object.defineProperties(il.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});il.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!c(t.height)&&!c(t.extrudedHeight)&&kc.isSupported(this._scene)};il.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||c(n)&&n!==t};il.prototype._computeCenter=L.throwInstantiationError;il.prototype._onEntityPropertyChanged=function(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(o.zIndex)&&(c(o.height)||c(o.extrudedHeight))&&ht(ht.geometryZIndex),this._zIndex=o.zIndex??W8e,c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(c(r)||c(s)){let a=new Om(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Jx(this._scene,a,r,s)}};il.prototype.destroy=function(){c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),oi.prototype.destroy.call(this)};il.getGeometryHeight=function(e,t){if(C.defined("heightReference",t),!c(e)){t!==ze.NONE&&ht(ht.geometryHeightReference);return}return Lu(t)?0:e};il.getGeometryExtrudedHeight=function(e,t){if(C.defined("extrudedHeightReference",t),!c(e)){t!==ze.NONE&&ht(ht.geometryExtrudedHeightReference);return}return Lu(t)?il.CLAMP_TO_GROUND:e};il.CLAMP_TO_GROUND="clamp";il.computeGeometryOffsetAttribute=function(e,t,n,i){(!c(e)||!c(t))&&(t=ze.NONE),(!c(n)||!c(i))&&(i=ze.NONE);let o=0;if(t!==ze.NONE&&o++,i===ze.RELATIVE_TO_GROUND&&o++,o===2)return $t.ALL;if(o===1)return $t.TOP};var Yn=il;var Cue=new Y,Vue=m.ZERO,Lue=new m,Zue=new de;function w8e(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 gf(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new w8e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}c(Object.create)&&(gf.prototype=Object.create(Yn.prototype),gf.prototype.constructor=gf);gf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Cue)),c(o)||(o=Y.WHITE),i.color=Yt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vue,Lue))),new Rt({id:t,geometry:new eT(this._options),attributes:i})};gf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Cue),o={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return c(this._options.offsetAttribute)&&(o.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vue,Lue))),new Rt({id:t,geometry:new OP(this._options),attributes:o})};gf.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!c(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};gf.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.width)||oi.prototype._isHidden.call(this,e,t)};gf.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 Ut)};gf.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ye.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ye.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),s.cornerType=J.getValueOrUndefined(t.cornerType,Ye.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=ui.getMinimumMaximumHeights(eT.computeRectangle(s,Zue)).minimumTerrainHeight),s.extrudedHeight=o};gf.DynamicGeometryUpdater=F1;function F1(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(F1.prototype=Object.create(ii.prototype),F1.prototype.constructor=F1);F1.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.positions)||!c(i.width)||ii.prototype._isHidden.call(this,e,t,n)};F1.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,ze.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);c(s)&&!c(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=ui.getMinimumMaximumHeights(eT.computeRectangle(i,Zue)).minimumTerrainHeight),i.extrudedHeight=s};var DP=gf;var a$n=_(T(),1);var I6n=_(T(),1);function Mk(){L.throwInstantiationError()}Object.defineProperties(Mk.prototype,{name:{get:L.throwInstantiationError},clock:{get:L.throwInstantiationError},entities:{get:L.throwInstantiationError},isLoading:{get:L.throwInstantiationError},changedEvent:{get:L.throwInstantiationError},errorEvent:{get:L.throwInstantiationError},loadingEvent:{get:L.throwInstantiationError},show:{get:L.throwInstantiationError},clustering:{get:L.throwInstantiationError}});Mk.prototype.update=function(e){L.throwInstantiationError()};Mk.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Hr=Mk;var $qn=_(T(),1);var N6n=_(T(),1);function Wh(e,t){C.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,c(t)&&(this.cameraPosition=t)}Object.defineProperties(Wh.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 Rue=new m;Wh.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Rue);return QK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Wh.prototype.isScaledSpacePointVisible=function(e){return QK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var P8e=new m;Wh.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return c(t)&&t<0&&n.minimumRadius>-t?(o=P8e,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),QK(e,o,i)};Wh.prototype.computeHorizonCullingPoint=function(e,t,n){return Xue(this._ellipsoid,e,t,n)};var Gue=re.clone(re.UNIT_SPHERE);Wh.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Eue(this._ellipsoid,n,Gue);return Xue(o,e,t,i)};Wh.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Iue(this._ellipsoid,e,t,n,i,o)};Wh.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Eue(this._ellipsoid,o,Gue);return Iue(s,e,t,n,i,r)};var v8e=[];Wh.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){C.typeOf.object("rectangle",e);let i=de.subsample(e,t,0,v8e),o=ue.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var F8e=new m;function Eue(e,t,n){if(c(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,F8e);e=re.fromCartesian3(i,n)}return e}function Xue(e,t,n,i){C.typeOf.object("directionToPoint",t),C.defined("positions",n),c(i)||(i=new m);let o=Pue(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let l=n[s],d=Wue(e,l,o);if(d<0)return;r=Math.max(r,d)}return wue(o,r,i)}var Nk=new m;function Iue(e,t,n,i,o,r){C.typeOf.object("directionToPoint",t),C.defined("vertices",n),C.typeOf.number("stride",i),c(r)||(r=new m),i=i??3,o=o??m.ZERO;let s=Pue(e,t),a=0;for(let l=0,d=n.length;l<d;l+=i){Nk.x=n[l]+o.x,Nk.y=n[l+1]+o.y,Nk.z=n[l+2]+o.z;let u=Wue(e,Nk,s);if(u<0)return;a=Math.max(a,u)}return wue(s,a,r)}function QK(e,t,n){let i=t,o=n,r=m.subtract(e,i,Rue),s=-m.dot(r,i);return!(o<0?s>0:s>o&&s*s/m.magnitudeSquared(r)>o)}var A8e=new m,M8e=new m;function Wue(e,t,n){let i=e.transformPositionToScaledSpace(t,A8e),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,M8e);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),l=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-l*u)}function wue(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var JK=new m;function Pue(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,JK),m.normalize(JK,JK))}var kb=Wh;var tqn=_(T(),1);function Er(e,t){if(e=e??z.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new L("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Nt.clone(n)}if(c(i)){if(i.far<=i.near)throw new L("scaleByDistance.far must be greater than scaleByDistance.near.");i=Nt.clone(i)}if(c(o)){if(o.far<=o.near)throw new L("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=vt.clone(o)}this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._color=Y.clone(e.color??Y.WHITE),this._outlineColor=Y.clone(e.outlineColor??Y.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Ar.NONE}var vue=Er.SHOW_INDEX=0,Mue=Er.POSITION_INDEX=1,N8e=Er.COLOR_INDEX=2,k8e=Er.OUTLINE_COLOR_INDEX=3,U8e=Er.OUTLINE_WIDTH_INDEX=4,O8e=Er.PIXEL_SIZE_INDEX=5,D8e=Er.SCALE_BY_DISTANCE_INDEX=6,B8e=Er.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Y8e=Er.DISTANCE_DISPLAY_CONDITION_INDEX=8,H8e=Er.DISABLE_DEPTH_DISTANCE_INDEX=9,z8e=Er.SPLIT_DIRECTION_INDEX=10;Er.NUMBER_OF_PROPERTIES=11;function Wd(e,t){let n=e._pointPrimitiveCollection;c(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Er.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");this._show!==e&&(this._show=e,Wd(this,vue))}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new L("value is required.");let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Wd(this,Mue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._scaleByDistance;Nt.equals(t,e)||(this._scaleByDistance=Nt.clone(e,t),Wd(this,D8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._translucencyByDistance;Nt.equals(t,e)||(this._translucencyByDistance=Nt.clone(e,t),Wd(this,B8e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!c(e))throw new L("value is required.");this._pixelSize!==e&&(this._pixelSize=e,Wd(this,O8e))}},color:{get:function(){return this._color},set:function(e){if(!c(e))throw new L("value is required.");let t=this._color;Y.equals(t,e)||(Y.clone(e,t),Wd(this,N8e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),Wd(this,k8e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new L("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Wd(this,U8e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far must be greater than near");vt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition),Wd(this,Y8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!c(e)||e<0)throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,Wd(this,H8e)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(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,Wd(this,vue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Wd(this,z8e))}}});Er.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Er.prototype._getActualPosition=function(){return this._actualPosition};Er.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Wd(this,Mue)};var Fue=new ce;Er._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(M.multiplyByPoint(n,e,Fue),Oi.computeActualEllipsoidPosition(t,Fue))};var Aue=new ce;Er._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,Aue),Aue);return Oi.worldToWindowCoordinates(n,o,i)};Er.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;if(c(t)||(t=new D),!c(n))throw new L("PointPrimitive must be in a collection.");if(!c(e))throw new L("scene is required.");let i=n.modelMatrix,o=Er._computeScreenSpacePosition(i,this._actualPosition,e,t);if(c(o))return o.y=e.canvas.clientHeight-o.y,o};Er.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,l=i;return c(n)||(n=new je),n.x=r,n.y=s,n.width=a,n.height=l,n};Er.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&m.equals(this._position,e._position)&&Y.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&Y.equals(this._outlineColor,e._outlineColor)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&vt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Er.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Gs=Er;var wqn=_(T(),1);var iqn=_(T(),1),Jy=`in vec4 v_color; +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 Imt(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:_$(e.debugPickedTile),a=S$(e.debugPickedTile,e,s);a.pixelOffset=new k(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];S$(a,e,_$(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&S$(a,e,_$(a))}}e._tileDebugLabels.update(t)}function Pmt(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 ui({stencil:0,pass:Le.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:Jt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,m=i.length;for(let f=0;f<s.length;++f){let y=s[f];u&&d.raiseEvent(y),Gmt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let b=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,y=f.length;i.length+=y;for(let _=b-1;_>=0;--_)i[m+y+_]=i[m+_];for(let _=0;_<y;++_)i[m+_]=f[_]}b=i.length-r,c.numberOfCommands=b,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&b>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Jp),Imt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var fSe=[],Xmt=[];function pSe(e,t){let n=t,i=fSe;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&&(Mmt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function bSe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function DB(e,t){let n=e-t;return n<0?n+vx.maximumFrameNumber:n}var Nmt=64;function Ymt(e,t,n){let i=Xmt;for(i.length=0,i.push(e);i.length>0;){let o=i.pop(),r=o._contentState;if(r===Fo.LOADING||r===Fo.PROCESSING||!o.hasEmptyContent&&!o.hasTilesetContent&&r!==Fo.UNLOADED&&r!==Fo.FAILED||l(o.cacheNode)||Math.min(DB(t,o._visitedFrame),DB(t,o._touchedFrame),DB(t,o._selectedFrame),DB(t,o._requestedFrame))<n)return i.length=0,!0;let c=o.children;for(let d=0;d<c.length;++d)i.push(c[d])}return!1}function wmt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,o=e._externalTilesetIdleFrames,r=e._externalTilesetSweepCount,s=0,a=0;for(;s<r&&a<Nmt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,d=n[c];if(d.isDestroyed()||!d.hasTilesetContent||d.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!Ymt(d,i,o)&&(pSe(e,d),d.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function Mmt(e,t){e._cache.unloadTile(e,t,bSe),t.destroy()}ur.prototype.trimLoadedTiles=function(){this._cache.trim()};function kmt(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Rf.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 Umt(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 Dmt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!P.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=P.clone(e.modelMatrix,e._previousModelMatrix)))}function Omt(e,t,n,i){if(t.mode===se.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,Umt(e),Dmt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Rmt(e),Pmt(e,t,i),Rf.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 gSe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Lt.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 Lt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ur.prototype.getTraversal=function(e){let{pass:t}=e;return t===lr.MOST_DETAILED_PRELOAD||t===lr.MOST_DETAILED_PICK?_N:this.isSkippingLevelOfDetail?EN:RN};ur.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ur.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===lr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===lr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===lr.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=lr.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,d=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let m=this._environmentMapManager;l(this._root)&&(m.position=this.boundingSphere.center),m.update(e)}let u=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=Omt(this,e,u,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};ur.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ur.prototype.isDestroyed=function(){return!1};ur.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=fSe;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,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,me(this)};ur.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ur.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ur.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Bmt=new gn,zmt=new h,Hmt=new h,Kmt=new pe;ur.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=Bmt,o=n.cartographicToCartesian(e,zmt),r=n.geodeticSurfaceNormal(o,i.direction);i.origin=h.add(o,h.multiplyByScalar(r,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(r,i.direction);let s=this.pick(i,t.frameState,Hmt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,Kmt)?.height};ur.prototype.updateHeight=function(e,t,n){n=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 Jmt=new h;ur.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let o=this._selectedTiles,r=o.length,s=[],a=e.origin.x,c=e.origin.y,d=e.origin.z,u=e.direction.x,m=e.direction.y,p=e.direction.z,b=u*u+m*m+p*p;for(let S=0;S<r;++S){let Z=o[S];if(l(i)&&Z.geometricError>i||!l(Z.content))continue;let R=Z.contentBoundingVolume.boundingSphere,C=R.center,E=a-C.x,A=c-C.y,L=d-C.z,F=2*(u*E+m*A+p*L),I=E*E+A*A+L*L-R.radius*R.radius;F*F-4*b*I<0||s.push(Z)}let f=s.length,y,_=Number.POSITIVE_INFINITY;for(let S=0;S<f;++S){let R=s[S].content.pick(e,t,Jmt);if(l(R)){let C=h.distanceSquared(R,e.origin);C<_&&(_=C,y=h.clone(R,n))}}return y};ur.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ur.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var zr=ur;var jmt=new P;function Ix(e,t){t.collectionChanged.addEventListener(Ix.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Mt,this._onCollectionChanged(t,t.values,[],[])}Ix.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),m;u&&(m=s.computeModelMatrix(e,jmt),c=ve.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],Qmt(c,n,s,i)),l(p)&&(p.show=!0,l(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=j.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Ix.prototype.isDestroyed=function(){return!1};Ix.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ix.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Z$(this,e[i],t,n);return me(this)};Ix.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Wt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(de.clone(i.boundingSphere,t),Wt.DONE):Wt.FAILED:Wt.PENDING};Ix.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):(Z$(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Z$(this,r,a,c),s.remove(r.id)};function Z$(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function Qmt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await zr.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 AN=Ix;var i1i=x(T(),1);var qmt=U.WHITE,$mt=U.BLACK,eht=new k(2,2);function oV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(oV.prototype,{isConstant:{get:function(){return j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:be("evenColor"),oddColor:be("oddColor"),repeat:be("repeat")});oV.prototype.getType=function(e){return"Checkerboard"};var tht=new Q;oV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(tht)),l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,qmt,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,$mt,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,eht),t};oV.prototype.equals=function(e){return this===e||e instanceof oV&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var rV=oV;var _1i=x(T(),1);var f1i=x(T(),1);var ySe={id:void 0};function GN(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 hl(e){this._owner=e,this._entities=new Mt,this._addedEntities=new Mt,this._removedEntities=new Mt,this._changedEntities=new Mt,this._suspendCount=0,this._collectionChanged=new Se,this._id=qn(),this._show=!0,this._firing=!1,this._refire=!1}hl.prototype.suspendEvents=function(){this._suspendCount++};hl.prototype.resumeEvents=function(){this._suspendCount--,GN(this)};Object.defineProperties(hl.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}}});hl.prototype.computeAvailability=function(){let e=it.MAXIMUM_VALUE,t=it.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(it.MINIMUM_VALUE)&&(e=a),Q.greaterThan(c,t)&&!c.equals(it.MAXIMUM_VALUE)&&(t=c)}}return it.MAXIMUM_VALUE.equals(e)&&(e=it.MINIMUM_VALUE),it.MINIMUM_VALUE.equals(t)&&(t=it.MAXIMUM_VALUE),new Cn({start:e,stop:t})};hl.prototype.add=function(e){e instanceof er||(e=new er(e));let t=e.id,n=this._entities;if(n.contains(t))throw new ge(`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(hl.prototype._onEntityDefinitionChanged,this),GN(this),e};hl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};hl.prototype.contains=function(e){return this._entities.get(e.id)===e};hl.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(hl.prototype._onEntityDefinitionChanged,this),GN(this),!0):!1};hl.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(hl.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),GN(this)};hl.prototype.getById=function(e){return this._entities.get(e)};hl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(ySe.id=e,t=new er(ySe),this.add(t)),t};hl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),GN(this)};var za=hl;var OB={id:void 0},sV=new Array(2);function R$(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 xSe(e,t,n,i){sV[0]=n,sV[1]=i.id,t[JSON.stringify(sV)]=i.definitionChanged.addEventListener(Rs.prototype._onDefinitionChanged,e)}function TSe(e,t,n,i){sV[0]=n,sV[1]=i.id;let o=JSON.stringify(sV);t[o](),t[o]=void 0}function Px(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,m=new za(e),p=e._eventHash,b;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Rs.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--)s=a[c],TSe(e,p,b,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Rs.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--){s=a[c],xSe(e,p,b,s);let y=m.getById(s.id);l(y)||(y=u.getById(s.id),l(y)?R$(y):(OB.id=s.id,y=new er(OB)),m.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=m.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Rs(e,t){this._owner=t,this._composite=new za(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=qn(),this._eventHash={},Px(this),this._shouldRecomposite=!1}Object.defineProperties(Rs.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}}});Rs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),Px(this)};Rs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Px(this),!0):!1};Rs.prototype.removeAllCollections=function(){this._collections.length=0,Px(this)};Rs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Rs.prototype.contains=function(e){return this._composite.contains(e)};Rs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Rs.prototype.getCollection=function(e){return this._collections[e]};Rs.prototype.getCollectionsLength=function(){return this._collections.length};function BB(e,t){return e.indexOf(t)}function _Se(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,Px(e)}Rs.prototype.raiseCollection=function(e){let t=BB(this._collections,e);_Se(this,t,t+1)};Rs.prototype.lowerCollection=function(e){let t=BB(this._collections,e);_Se(this,t,t-1)};Rs.prototype.raiseCollectionToTop=function(e){let t=BB(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Px(this))};Rs.prototype.lowerCollectionToBottom=function(e){let t=BB(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Px(this))};Rs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Rs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Px(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Rs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Rs.prototype.getById=function(e){return this._composite.getById(e)};Rs.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,m=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];TSe(this,m,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),R$(d)),d.merge(c));l(d)||r.removeById(y),d=void 0}let b=t.length;for(s=0;s<b;s++){let f=t[s];xSe(this,m,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),l(d)?R$(d):(OB.id=y,d=new er(OB),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Rs.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),m=!0;for(let p=s-1;p>=0;p--){let b=o[p].getById(e.id);if(l(b)){let f=b[t];if(l(f)){if(m)if(m=!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 C$=Rs;var J1i=x(T(),1);var U1i=x(T(),1);var Z1i=x(T(),1);function V$(){this._removalFunctions=[]}V$.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)}};V$.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Hr=V$;var I1i=x(T(),1);function G$(e,t){return Q.compare(e.start,t.start)}function Cs(e){if(this._intervals=[],this._changedEvent=new Se,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Cs.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}}});Cs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Cs))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(!Cn.equals(n[r],i[r],t))return!1;return!0};Cs.prototype.get=function(e){return this._intervals[e]};Cs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Cs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Cs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Cs.prototype.contains=function(e){return this.indexOf(e)>=0};var E$=new Cn;Cs.prototype.indexOf=function(e){let t=this._intervals;E$.start=e,E$.stop=e;let n=Eo(t,E$,G$);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&&Cn.contains(t[n-1],e)?n-1:~n)};Cs.prototype.findInterval=function(e){e=e??B.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]}};Cs.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=Eo(n,e,G$);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 Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({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 Cn({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 Cn({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 Cn({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 Cn({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)};Cs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Eo(t,e,G$);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 Cn({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 Cn({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 Cn({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 Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({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 Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Cs.prototype.intersect=function(e,t,n){let i=new Cs,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=Cn.intersect(c,d,new Cn,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};Cs.fromJulianDateArray=function(e,t){l(t)||(t=new Cs);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Cn({start:it.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let m=0;m<i-1;++m){let p=n[m],b=n[m+1];d=new Cn({start:p,stop:b,isStartIncluded:t.length===u?r:!0,isStopIncluded:m===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)}return c&&(d=new Cn({start:n[i-1],stop:it.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var fl=new vh,LN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function A$(e,t,n){l(n)||(n=new Q),Q.toGregorianDate(e,fl);let i=fl.millisecond+t.millisecond,o=fl.second+t.second,r=fl.minute+t.minute,s=fl.hour+t.hour,a=fl.day+t.day,c=fl.month+t.month,d=fl.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),LN[2]=pu(d)?29:28;a>LN[c]||c>=13;)a>LN[c]&&(a-=LN[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),LN[2]=pu(d)?29:28;return fl.millisecond=i,fl.second=o,fl.minute=r,fl.hour=s,fl.day=a,fl.month=c,fl.year=d,Q.fromGregorianDate(fl,n)}var nht=new Q,iht=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function SSe(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(iht);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,nht),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var WN=new vh;Cs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!SSe(n[2],WN))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=A$(s,WN),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Cs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Cs.fromIso8601DateArray=function(e,t){return Cs.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)};Cs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let d=0;d<c;++d)(SSe(i[d],WN)||d===0)&&(o&&l(a)?s=A$(a,WN):s=A$(n,WN),r.push(s),a=s);return Cs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Vs=Cs;function oht(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 US(){this._eventHelper=new Hr,this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(US.prototype._intervalsChanged,this)}Object.defineProperties(US.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var rht=new Q;US.prototype.getValue=function(e,t){l(e)||(e=Q.now(rht));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};US.prototype.equals=function(e){return this===e||e instanceof US&&this._intervals.equals(e._intervals,j.equals)};US.prototype._intervalsChanged=function(){oht(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var pl=US;function Xx(){this._definitionChanged=new Se,this._composite=new pl,this._composite.definitionChanged.addEventListener(Xx.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Xx.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Xx.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var sht=new Q;Xx.prototype.getValue=function(e,t){l(e)||(e=Q.now(sht));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Xx.prototype.equals=function(e){return this===e||e instanceof Xx&&this._composite.equals(e._composite,j.equals)};Xx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var aV=Xx;var iCi=x(T(),1);function Nx(e){this._referenceFrame=e??Oi.FIXED,this._definitionChanged=new Se,this._composite=new pl,this._composite.definitionChanged.addEventListener(Nx.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Nx.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 aht=new Q;Nx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(aht)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Nx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Nx.prototype.equals=function(e){return this===e||e instanceof Nx&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};Nx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var mc=Nx;var qVi=x(T(),1);var qCi=x(T(),1);var rCi=x(T(),1),ZSe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(ZSe);var ro=ZSe;var LCi=x(T(),1);var TCi=x(T(),1);var hc=[new h,new h],cht=new h,lht=new h,dht=new h,uht=new h,mht=new h,hht=new h,fht=new h,pht=new h,bht=new h,cV=new h,zB=new h,vN={},L$=new pe;function ght(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];L$=t.cartesianToCartographic(o,L$),n[i]=L$.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function W$(e,t,n,i){let o=e[0],r=e[1],s=h.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 m=(n-t)/a;for(d=1;d<a;d++){let p=t+d*m;c[d]=p}return c[0]=t,c.push(n),c}var HB=new h,KB=new h;function yht(e,t,n,i){let o=new ws(n,i),r=o.projectPointOntoPlane(h.add(n,e,HB),HB),s=o.projectPointOntoPlane(h.add(n,t,KB),KB),a=k.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var xht=new h(-1,0,0),DS=new P,Tht=new P,v$=new q,_ht=q.IDENTITY.clone(),Sht=new h,Zht=new ce,RSe=new h;function yg(e,t,n,i,o,r,s,a){let c=Sht,d=Zht;DS=_t.eastNorthUpToFixedFrame(e,o,DS),c=P.multiplyByPointAsVector(DS,xht,c),c=h.normalize(c,c);let u=yht(c,t,e,o);v$=q.fromRotationZ(u,v$),RSe.z=r,DS=P.multiplyTransformation(DS,P.fromRotationTranslation(v$,RSe,Tht),DS);let m=_ht;m[0]=s;for(let p=0;p<a;p++)for(let b=0;b<n.length;b+=3)d=h.fromArray(n,b,d),d=q.multiplyByVector(m,d,d),d=P.multiplyByPoint(DS,d,d),i.push(d.x,d.y,d.z);return i}var Rht=new h;function F$(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,Rht);i=yg(c,t,n,i,o,r[a/3],s,1)}return i}function Cht(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 CSe(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 VSe=new Ne,ESe=new h,ASe=new q;function GSe(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,cV),h.subtract(n,e,zB)),m=i===ro.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=q.fromQuaternion(Ne.fromAxisAngle(h.negate(e,cV),u/(m+1),VSe),ASe):p=q.fromQuaternion(Ne.fromAxisAngle(e,u/(m+1),VSe),ASe);let b,f;if(t=h.clone(t,ESe),m>0){let y=d?2:1;for(let _=0;_<m;_++)t=q.multiplyByVector(p,t,t),b=h.subtract(t,e,cV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,zB),s=yg(f,b,a,s,r,c,1,y)}else b=h.subtract(t,e,cV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,zB),s=yg(f,b,a,s,r,c,1,1),n=h.clone(n,ESe),b=h.subtract(n,e,cV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(n,zB),s=yg(f,b,a,s,r,c,1,1);return s}vN.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];k.equals(r,s)||n.push(s)}return n};vN.angleIsGreaterThanPi=function(e,t,n,i){let o=new ws(n,i),r=o.projectPointOntoPlane(h.add(n,e,HB),HB),s=o.projectPointOntoPlane(h.add(n,t,KB),KB);return s.x*r.y-s.y*r.x>=0};var Vht=new h,Eht=new h;vN.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=ght(e,r),a=i._granularity,c=i._cornerType,d=o?Cht(t,n):CSe(t,n),u=o?CSe(t,n):void 0,m=n.height/2,p=n.width/2,b=e.length,f=[],y=o?[]:void 0,_=cht,S=lht,Z=dht,R=uht,C=mht,E=hht,A=fht,L=pht,F=bht,I=e[0],N=e[1];R=r.geodeticSurfaceNormal(I,R),_=h.subtract(N,I,_),_=h.normalize(_,_),L=h.cross(R,_,L),L=h.normalize(L,L);let g=s[0],V=s[1];o&&(y=yg(I,L,u,y,r,g+m,1,1)),F=h.clone(I,F),I=N,S=h.negate(_,S);let G,v;for(let D=1;D<b-1;D++){let w=o?2:1;if(N=e[D+1],I.equals(N)){xt("Positions are too close and are considered equivalent with rounding error.");continue}_=h.subtract(N,I,_),_=h.normalize(_,_),R=r.geodeticSurfaceNormal(I,R);let O=h.multiplyByScalar(R,h.dot(_,R),Vht);h.subtract(_,O,O),h.normalize(O,O);let M=h.multiplyByScalar(R,h.dot(S,R),Eht);if(h.subtract(S,M,M),h.normalize(M,M),!W.equalsEpsilon(Math.abs(h.dot(O,M)),1,W.EPSILON7)){Z=h.add(_,S,Z),Z=h.normalize(Z,Z),Z=h.cross(Z,R,Z),Z=h.cross(R,Z,Z),Z=h.normalize(Z,Z);let K=1/Math.max(.25,h.magnitude(h.cross(Z,S,cV))),te=vN.angleIsGreaterThanPi(_,S,I,r);te?(C=h.add(I,h.multiplyByScalar(Z,K*p,Z),C),E=h.add(C,h.multiplyByScalar(L,p,E),E),hc[0]=h.clone(F,hc[0]),hc[1]=h.clone(E,hc[1]),G=W$(hc,g+m,V+m,a),v=oo.generateArc({positions:hc,granularity:a,ellipsoid:r}),f=F$(v,L,d,f,r,G,1),L=h.cross(R,_,L),L=h.normalize(L,L),A=h.add(C,h.multiplyByScalar(L,p,A),A),c===ro.ROUNDED||c===ro.BEVELED?GSe(C,E,A,c,te,r,f,d,V+m,o):(Z=h.negate(Z,Z),f=yg(I,Z,d,f,r,V+m,K,w)),F=h.clone(A,F)):(C=h.add(I,h.multiplyByScalar(Z,K*p,Z),C),E=h.add(C,h.multiplyByScalar(L,-p,E),E),hc[0]=h.clone(F,hc[0]),hc[1]=h.clone(E,hc[1]),G=W$(hc,g+m,V+m,a),v=oo.generateArc({positions:hc,granularity:a,ellipsoid:r}),f=F$(v,L,d,f,r,G,1),L=h.cross(R,_,L),L=h.normalize(L,L),A=h.add(C,h.multiplyByScalar(L,-p,A),A),c===ro.ROUNDED||c===ro.BEVELED?GSe(C,E,A,c,te,r,f,d,V+m,o):f=yg(I,Z,d,f,r,V+m,K,w),F=h.clone(A,F)),S=h.negate(_,S)}else f=yg(F,L,d,f,r,g+m,1,1),F=I;g=V,V=s[D+1],I=N}hc[0]=h.clone(F,hc[0]),hc[1]=h.clone(I,hc[1]),G=W$(hc,g+m,V+m,a),v=oo.generateArc({positions:hc,granularity:a,ellipsoid:r}),f=F$(v,L,d,f,r,G,1),o&&(y=yg(I,L,u,y,r,V+m,1,1)),b=f.length;let X=o?b+y.length:b,Y=new Float64Array(X);return Y.set(f),o&&Y.set(y,b),Y};var Cf=vN;var P$={},lV=new h,ISe=new h,Aht=new h,LSe=new h,rd=[new h,new h],PSe=new h,XSe=new h,NSe=new h,Ght=new h,Lht=new h,Wht=new h,vht=new h,Fht=new h,Iht=new h,Pht=new h,WSe=new Ne,vSe=new q;function JB(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,lV),h.subtract(n,e,ISe)),s=i===ro.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=q.fromQuaternion(Ne.fromAxisAngle(h.negate(e,lV),r/s,WSe),vSe):d=q.fromQuaternion(Ne.fromAxisAngle(e,r/s,WSe),vSe);let u=0;t=h.clone(t,lV);for(let m=0;m<s;m++)t=q.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function Xht(e){let t=PSe,n=XSe,i=NSe,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=JB(t,n,i,ro.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=JB(t,n,i,ro.ROUNDED,!1);return[r,c]}function FSe(e,t,n,i){let o=lV;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function I$(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,lV),a=h.negate(s,ISe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,Aht),p=h.add(m,a,LSe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let b=h.add(m,s,LSe);r[d--]=b.z,r[d--]=b.y,r[d--]=b.x}return i.push(o,r),i}P$.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 Nht=new h,Yht=new h;P$.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=PSe,c=XSe,d=NSe,u=Ght,m=Lht,p=Wht,b=vht,f=Fht,y=Iht,_=Pht,S=[],Z=s?[]:void 0,R=s?[]:void 0,C=n[0],E=n[1];c=h.normalize(h.subtract(E,C,c),c),a=i.geodeticSurfaceNormal(C,a),u=h.normalize(h.cross(a,c,u),u),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z)),b=h.clone(C,b),C=E,d=h.negate(c,d);let A,L=[],F,I=n.length;for(F=1;F<I-1;F++){a=i.geodeticSurfaceNormal(C,a),E=n[F+1],c=h.normalize(h.subtract(E,C,c),c);let g=h.multiplyByScalar(a,h.dot(c,a),Nht);h.subtract(c,g,g),h.normalize(g,g);let V=h.multiplyByScalar(a,h.dot(d,a),Yht);if(h.subtract(d,V,V),h.normalize(V,V),!W.equalsEpsilon(Math.abs(h.dot(g,V)),1,W.EPSILON7)){m=h.normalize(h.add(c,d,m),m),m=h.cross(m,a,m),m=h.cross(a,m,m),m=h.normalize(m,m);let v=o/Math.max(.25,h.magnitude(h.cross(m,d,lV))),X=Cf.angleIsGreaterThanPi(c,d,C,i);m=h.multiplyByScalar(m,v,m),X?(f=h.add(C,m,f),_=h.add(f,h.multiplyByScalar(u,o,_),_),y=h.add(f,h.multiplyByScalar(u,o*2,y),y),rd[0]=h.clone(b,rd[0]),rd[1]=h.clone(_,rd[1]),A=oo.generateArc({positions:rd,granularity:t,ellipsoid:i}),S=I$(A,u,o,S),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z)),p=h.clone(y,p),u=h.normalize(h.cross(a,c,u),u),y=h.add(f,h.multiplyByScalar(u,o*2,y),y),b=h.add(f,h.multiplyByScalar(u,o,b),b),r===ro.ROUNDED||r===ro.BEVELED?L.push({leftPositions:JB(f,p,y,r,X)}):L.push({leftPositions:FSe(C,h.negate(m,m),y,X)})):(y=h.add(C,m,y),_=h.add(y,h.negate(h.multiplyByScalar(u,o,_),_),_),f=h.add(y,h.negate(h.multiplyByScalar(u,o*2,f),f),f),rd[0]=h.clone(b,rd[0]),rd[1]=h.clone(_,rd[1]),A=oo.generateArc({positions:rd,granularity:t,ellipsoid:i}),S=I$(A,u,o,S),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z)),p=h.clone(f,p),u=h.normalize(h.cross(a,c,u),u),f=h.add(y,h.negate(h.multiplyByScalar(u,o*2,f),f),f),b=h.add(y,h.negate(h.multiplyByScalar(u,o,b),b),b),r===ro.ROUNDED||r===ro.BEVELED?L.push({rightPositions:JB(y,p,f,r,X)}):L.push({rightPositions:FSe(C,m,f,X)})),d=h.negate(c,d)}C=E}a=i.geodeticSurfaceNormal(C,a),rd[0]=h.clone(b,rd[0]),rd[1]=h.clone(C,rd[1]),A=oo.generateArc({positions:rd,granularity:t,ellipsoid:i}),S=I$(A,u,o,S),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z));let N;return r===ro.ROUNDED&&(N=Xht(S)),{positions:S,corners:L,lefts:Z,normals:R,endPositions:N}};var bo=P$;var MSe=new h,kSe=new h,jB=new h,QB=new h,wht=new h,USe=new h,Yx=new h,dV=new h;function DSe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Vf(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=h.normalize(h.cross(n,t,Yx),Yx);r.normal&&bo.addAttribute(s,t,i,o),r.tangent&&bo.addAttribute(a,d,i,o),r.bitangent&&bo.addAttribute(c,n,i,o)}function OSe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new Rn,d=0,u=0,m,p=0,b;for(m=0;m<i.length;m+=2)b=i[m].length-3,d+=b,p+=b*2,u+=i[m+1].length-3;for(d+=3,u+=3,m=0;m<o.length;m++){let $=o[m].leftPositions;l($)?(b=$.length,d+=b,p+=b):(b=o[m].rightPositions.length,u+=b,p+=b)}let f=l(r),y;f&&(y=r[0].length-3,d+=y,u+=y,y/=3,p+=y*6);let _=d+u,S=new Float64Array(_),Z=t.normal?new Float32Array(_):void 0,R=t.tangent?new Float32Array(_):void 0,C=t.bitangent?new Float32Array(_):void 0,E={normals:Z,tangents:R,bitangents:C},A=0,L=_-1,F,I,N,g,V=MSe,G=kSe,v,X,Y=y/2,D=Oe.createTypedArray(_/3,p),w=0;if(f){X=jB,v=QB;let $=r[0];for(V=h.fromArray(a,0,V),G=h.fromArray(s,0,G),m=0;m<Y;m++)X=h.fromArray($,(Y-1-m)*3,X),v=h.fromArray($,(Y+m)*3,v),bo.addAttribute(S,v,A),bo.addAttribute(S,X,void 0,L),Vf(E,V,G,A,L,t),I=A/3,g=I+1,F=(L-2)/3,N=F-1,D[w++]=F,D[w++]=I,D[w++]=N,D[w++]=N,D[w++]=I,D[w++]=g,A+=3,L-=3}let O=0,M=0,z=i[O++],K=i[O++];S.set(z,A),S.set(K,L-K.length+1),G=h.fromArray(s,M,G);let te,H;for(b=K.length-3,m=0;m<b;m+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,m,Yx),Yx),H=n.geodeticSurfaceNormal(h.fromArray(K,b-m,dV),dV),V=h.normalize(h.add(te,H,V),V),Vf(E,V,G,A,L,t),I=A/3,g=I+1,F=(L-2)/3,N=F-1,D[w++]=F,D[w++]=I,D[w++]=N,D[w++]=N,D[w++]=I,D[w++]=g,A+=3,L-=3;for(te=n.geodeticSurfaceNormal(h.fromArray(z,b,Yx),Yx),H=n.geodeticSurfaceNormal(h.fromArray(K,b,dV),dV),V=h.normalize(h.add(te,H,V),V),M+=3,m=0;m<o.length;m++){let $,ee=o[m],le=ee.leftPositions,_e=ee.rightPositions,he,Ze,ye=USe,Ge=jB,Ae=QB;if(V=h.fromArray(a,M,V),l(le)){for(Vf(E,V,G,void 0,L,t),L-=3,he=g,Ze=N,$=0;$<le.length/3;$++)ye=h.fromArray(le,$*3,ye),D[w++]=he,D[w++]=Ze-$-1,D[w++]=Ze-$,bo.addAttribute(S,ye,void 0,L),Ge=h.fromArray(S,(Ze-$-1)*3,Ge),Ae=h.fromArray(S,he*3,Ae),G=h.normalize(h.subtract(Ge,Ae,G),G),Vf(E,V,G,void 0,L,t),L-=3;ye=h.fromArray(S,he*3,ye),Ge=h.subtract(h.fromArray(S,Ze*3,Ge),ye,Ge),Ae=h.subtract(h.fromArray(S,(Ze-$)*3,Ae),ye,Ae),G=h.normalize(h.add(Ge,Ae,G),G),Vf(E,V,G,A,void 0,t),A+=3}else{for(Vf(E,V,G,A,void 0,t),A+=3,he=N,Ze=g,$=0;$<_e.length/3;$++)ye=h.fromArray(_e,$*3,ye),D[w++]=he,D[w++]=Ze+$,D[w++]=Ze+$+1,bo.addAttribute(S,ye,A),Ge=h.fromArray(S,he*3,Ge),Ae=h.fromArray(S,(Ze+$)*3,Ae),G=h.normalize(h.subtract(Ge,Ae,G),G),Vf(E,V,G,A,void 0,t),A+=3;ye=h.fromArray(S,he*3,ye),Ge=h.subtract(h.fromArray(S,(Ze+$)*3,Ge),ye,Ge),Ae=h.subtract(h.fromArray(S,Ze*3,Ae),ye,Ae),G=h.normalize(h.negate(h.add(Ae,Ge,G),G),G),Vf(E,V,G,void 0,L,t),L-=3}for(z=i[O++],K=i[O++],z.splice(0,3),K.splice(K.length-3,3),S.set(z,A),S.set(K,L-K.length+1),b=K.length-3,M+=3,G=h.fromArray(s,M,G),$=0;$<K.length;$+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,$,Yx),Yx),H=n.geodeticSurfaceNormal(h.fromArray(K,b-$,dV),dV),V=h.normalize(h.add(te,H,V),V),Vf(E,V,G,A,L,t),g=A/3,I=g-1,N=(L-2)/3,F=N+1,D[w++]=F,D[w++]=I,D[w++]=N,D[w++]=N,D[w++]=I,D[w++]=g,A+=3,L-=3;A-=3,L+=3}if(V=h.fromArray(a,a.length-3,V),Vf(E,V,G,A,L,t),f){A+=3,L-=3,X=jB,v=QB;let $=r[1];for(m=0;m<Y;m++)X=h.fromArray($,(y-m-1)*3,X),v=h.fromArray($,m*3,v),bo.addAttribute(S,X,void 0,L),bo.addAttribute(S,v,A),Vf(E,V,G,A,L,t),g=A/3,I=g-1,N=(L-2)/3,F=N+1,D[w++]=F,D[w++]=I,D[w++]=N,D[w++]=N,D[w++]=I,D[w++]=g,A+=3,L-=3}if(c.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S}),t.st){let $=new Float32Array(_/3*2),ee,le,_e=0;if(f){d/=3,u/=3;let he=Math.PI/(y+1);le=1/(d-y+1),ee=1/(u-y+1);let Ze,ye=y/2;for(m=ye+1;m<y+1;m++)Ze=W.PI_OVER_TWO+he*m,$[_e++]=ee*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=1;m<u-y+1;m++)$[_e++]=m*ee,$[_e++]=0;for(m=y;m>ye;m--)Ze=W.PI_OVER_TWO-m*he,$[_e++]=1-ee*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=ye;m>0;m--)Ze=W.PI_OVER_TWO-he*m,$[_e++]=1-le*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=d-y;m>0;m--)$[_e++]=m*le,$[_e++]=1;for(m=1;m<ye+1;m++)Ze=W.PI_OVER_TWO+he*m,$[_e++]=le*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze))}else{for(d/=3,u/=3,le=1/(d-1),ee=1/(u-1),m=0;m<u;m++)$[_e++]=m*ee,$[_e++]=0;for(m=d;m>0;m--)$[_e++]=(m-1)*le,$[_e++]=1}c.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:$})}return t.normal&&(c.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.normals})),t.tangent&&(c.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.tangents})),t.bitangent&&(c.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.bitangents})),{attributes:c,indices:D}}function Mht(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,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,b=MSe,f=kSe,y=jB,_=QB,S=wht,Z=USe,R=c;for(d=0;d<s;d+=3){let C=R+c;b=h.fromArray(n,d,b),f=h.fromArray(n,d+s,f),y=h.fromArray(n,(d+3)%s,y),f=h.subtract(f,b,f),y=h.subtract(y,b,y),_=h.normalize(h.cross(f,y,_),_),t.normal&&(bo.addAttribute(u,_,C),bo.addAttribute(u,_,C+3),bo.addAttribute(u,_,R),bo.addAttribute(u,_,R+3)),(t.tangent||t.bitangent)&&(Z=h.fromArray(i,d,Z),t.bitangent&&(bo.addAttribute(p,Z,C),bo.addAttribute(p,Z,C+3),bo.addAttribute(p,Z,R),bo.addAttribute(p,Z,R+3)),t.tangent&&(S=h.normalize(h.cross(Z,_,S),S),bo.addAttribute(m,S,C),bo.addAttribute(m,S,C+3),bo.addAttribute(m,S,R),bo.addAttribute(m,S,R+3))),R+=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 C=e.tangent.values;m.set(C),m.set(C,s),e.tangent.values=m}}if(t.st){let u=e.st.values,m=new Float32Array(a*6);m.set(u),m.set(u,a);let p=a*2;for(let b=0;b<2;b++){for(m[p++]=u[0],m[p++]=u[1],d=2;d<a;d+=2){let f=u[d],y=u[d+1];m[p++]=f,m[p++]=y,m[p++]=f,m[p++]=y}m[p++]=u[0],m[p++]=u[1]}e.st.values=m}return e}function X$(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 kht(e,t){let n=new we({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=bo.computePositions(e),r=OSe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,m=u.length,p=new Float64Array(m*6),b=new Float64Array(m);b.set(u);let f=new Float64Array(m*4);u=mi.scaleToGeodeticHeight(u,s,i),f=X$(u,0,f),b=mi.scaleToGeodeticHeight(b,a,i),f=X$(b,m*2,f),p.set(u),p.set(b,m),p.set(f,m*2),c.position.values=p,c=Mht(c,t);let y,_=m/3;if(e.shadowVolume){let I=c.normal.values;m=I.length;let N=new Float32Array(m*6);for(y=0;y<m;y++)I[y]=-I[y];N.set(I,m),N=X$(I,m*4,N),c.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let I=new Uint8Array(_*6);if(e.offsetAttribute===bn.TOP)I=I.fill(1,0,_).fill(1,_*2,_*4);else{let N=e.offsetAttribute===bn.NONE?0:1;I=I.fill(N)}c.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}let S=d.length,Z=_+_,R=Oe.createTypedArray(p.length/3,S*2+Z*3);R.set(d);let C=S;for(y=0;y<S;y+=3){let I=d[y],N=d[y+1],g=d[y+2];R[C++]=g+_,R[C++]=N+_,R[C++]=I+_}let E,A,L,F;for(y=0;y<Z;y+=2)E=y+Z,A=E+Z,L=E+1,F=A+1,R[C++]=E,R[C++]=A,R[C++]=L,R[C++]=L,R[C++]=A,R[C++]=F;return{attributes:c,indices:R}}var YSe=new h,FN=new h,nh=new pe;function wSe(e,t,n,i,o,r){let s=h.subtract(t,e,YSe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,FN),c=h.cross(s,a,YSe);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,FN),n.cartesianToCartographic(FN,nh);let b=nh.latitude,f=nh.longitude;d=Math.min(d,b),u=Math.min(u,f),m=Math.max(m,b),p=Math.max(p,f),h.subtract(e,c,FN),n.cartesianToCartographic(FN,nh),b=nh.latitude,f=nh.longitude,d=Math.min(d,b),u=Math.min(u,f),m=Math.max(m,b),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=m,r.longitude=p}var th=new h,IN=new h,zd=new pe,Hd=new pe;function BSe(e,t,n,i,o){e=DSe(e,t);let r=Yo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new re;let a=n*.5;zd.latitude=Number.POSITIVE_INFINITY,zd.longitude=Number.POSITIVE_INFINITY,Hd.latitude=Number.NEGATIVE_INFINITY,Hd.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===ro.ROUNDED){let p=r[0];h.subtract(p,r[1],th),h.normalize(th,th),h.multiplyByScalar(th,a,th),h.add(p,th,IN),t.cartesianToCartographic(IN,nh),c=nh.latitude,d=nh.longitude,zd.latitude=Math.min(zd.latitude,c),zd.longitude=Math.min(zd.longitude,d),Hd.latitude=Math.max(Hd.latitude,c),Hd.longitude=Math.max(Hd.longitude,d)}for(let p=0;p<s-1;++p)wSe(r[p],r[p+1],t,a,zd,Hd);let u=r[s-1];h.subtract(u,r[s-2],th),h.normalize(th,th),h.multiplyByScalar(th,a,th),h.add(u,th,IN),wSe(u,IN,t,a,zd,Hd),i===ro.ROUNDED&&(t.cartesianToCartographic(IN,nh),c=nh.latitude,d=nh.longitude,zd.latitude=Math.min(zd.latitude,c),zd.longitude=Math.min(zd.longitude,d),Hd.latitude=Math.max(Hd.latitude,c),Hd.longitude=Math.max(Hd.longitude,d));let m=l(o)?o:new re;return m.north=Hd.latitude,m.south=zd.latitude,m.east=Hd.longitude,m.west=zd.longitude,m}function Tg(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ro.ROUNDED,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ne.packedLength+we.packedLength+7}Tg.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.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]=e._offsetAttribute??-1,t};var zSe=ne.clone(ne.UNIT_SPHERE),HSe=new we,xg={positions:void 0,ellipsoid:zSe,vertexFormat:HSe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Tg.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=h.packedLength)o[f]=h.unpack(e,t);let r=ne.unpack(e,t,zSe);t+=ne.packedLength;let s=we.unpack(e,t,HSe);t+=we.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++]===1,b=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._vertexFormat=we.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=m,n._shadowVolume=p,n._offsetAttribute=b===-1?void 0:b,n):(xg.positions=o,xg.width=a,xg.height=c,xg.extrudedHeight=d,xg.cornerType=u,xg.granularity=m,xg.shadowVolume=p,xg.offsetAttribute=b===-1?void 0:b,new Tg(xg))};Tg.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??ne.default,r=e.cornerType??ro.ROUNDED;return BSe(n,o,i,r,t)};Tg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=DSe(t,i);let o=Yo(t,h.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=kht(d,c);else{let b=bo.computePositions(d);if(u=OSe(b,c,i),u.attributes.position.values=mi.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===bn.NONE?0:1,y=u.attributes.position.values.length,_=new Uint8Array(y/3).fill(f);u.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let m=u.attributes,p=de.fromVertices(m.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new At({attributes:m,indices:u.indices,primitiveType:Ie.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Tg.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Tg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Tg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=BSe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var OS=Tg;var gVi=x(T(),1);var KSe=new h,JSe=new h,Uht=new h;function Dht(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function jSe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new Rn,a,c=0,d=0,u,m=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,m+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){let X=o[u].leftPositions;l(X)?(p=X.length,c+=p,m+=p/3*2):(p=o[u].rightPositions.length,d+=p,m+=p/3*2)}let b=l(r),f;b&&(f=r[0].length-3,c+=f,d+=f,f/=3,m+=f*4);let y=c+d,_=new Float64Array(y),S=0,Z=y-1,R,C,E,A,L,F,I=f/2,N=Oe.createTypedArray(y/3,m+4),g=0;if(N[g++]=S/3,N[g++]=(Z-2)/3,b){n.push(S/3),F=KSe,L=JSe;let X=r[0];for(u=0;u<I;u++)F=h.fromArray(X,(I-1-u)*3,F),L=h.fromArray(X,(I+u)*3,L),bo.addAttribute(_,L,S),bo.addAttribute(_,F,void 0,Z),C=S/3,A=C+1,R=(Z-2)/3,E=R-1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3}let V=0,G=i[V++],v=i[V++];for(_.set(G,S),_.set(v,Z-v.length+1),p=v.length-3,n.push(S/3,(Z-2)/3),u=0;u<p;u+=3)C=S/3,A=C+1,R=(Z-2)/3,E=R-1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3;for(u=0;u<o.length;u++){let X;a=o[u];let Y=a.leftPositions,D=a.rightPositions,w,O=Uht;if(l(Y)){for(Z-=3,w=E,n.push(A),X=0;X<Y.length/3;X++)O=h.fromArray(Y,X*3,O),N[g++]=w-X-1,N[g++]=w-X,bo.addAttribute(_,O,void 0,Z),Z-=3;n.push(w-Math.floor(Y.length/6)),t===ro.BEVELED&&n.push((Z-2)/3+1),S+=3}else{for(S+=3,w=A,n.push(E),X=0;X<D.length/3;X++)O=h.fromArray(D,X*3,O),N[g++]=w+X,N[g++]=w+X+1,bo.addAttribute(_,O,S),S+=3;n.push(w+Math.floor(D.length/6)),t===ro.BEVELED&&n.push(S/3-1),Z-=3}for(G=i[V++],v=i[V++],G.splice(0,3),v.splice(v.length-3,3),_.set(G,S),_.set(v,Z-v.length+1),X=0;X<v.length;X+=3)A=S/3,C=A-1,E=(Z-2)/3,R=E+1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3;S-=3,Z+=3,n.push(S/3,(Z-2)/3)}if(b){S+=3,Z-=3,F=KSe,L=JSe;let X=r[1];for(u=0;u<I;u++)F=h.fromArray(X,(f-u-1)*3,F),L=h.fromArray(X,u*3,L),bo.addAttribute(_,F,void 0,Z),bo.addAttribute(_,L,S),A=S/3,C=A-1,E=(Z-2)/3,R=E+1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3;n.push(S/3)}else n.push(S/3,(Z-2)/3);return N[g++]=S/3,N[g]=(Z-2)/3,s.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:s,indices:N,wallIndices:n}}function Oht(e){let t=e.ellipsoid,n=bo.computePositions(e),i=jSe(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,m=new Float64Array(u);m.set(d);let p=new Float64Array(u*2);if(d=mi.scaleToGeodeticHeight(d,r,t),m=mi.scaleToGeodeticHeight(m,s,t),p.set(d),p.set(m,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let R=new Uint8Array(u*2);if(e.offsetAttribute===bn.TOP)R=R.fill(1,0,u);else{let C=e.offsetAttribute===bn.NONE?0:1;R=R.fill(C)}a.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}let b,f=c.length,y=Oe.createTypedArray(p.length/3,(f+o.length)*2);y.set(c);let _=f;for(b=0;b<f;b+=2){let R=c[b],C=c[b+1];y[_++]=R+u,y[_++]=C+u}let S,Z;for(b=0;b<o.length;b++)S=o[b],Z=S+u,y[_++]=S,y[_++]=Z;return{attributes:a,indices:y}}function PN(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ro.ROUNDED,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ne.packedLength+6}PN.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.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]=e._offsetAttribute??-1,t};var QSe=ne.clone(ne.UNIT_SPHERE),wx={positions:void 0,ellipsoid:QSe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};PN.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=ne.unpack(e,t,QSe);t+=ne.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=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=m===-1?void 0:m,n):(wx.positions=o,wx.width=s,wx.height=a,wx.extrudedHeight=c,wx.cornerType=d,wx.granularity=u,wx.offsetAttribute=m===-1?void 0:m,new PN(wx))};PN.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Dht(t,i);let o=Yo(t,h.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=Oht(c);else{let p=bo.computePositions(c);if(d=jSe(p,c.cornerType),d.attributes.position.values=mi.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let b=d.attributes.position.values.length,f=e._offsetAttribute===bn.NONE?0:1,y=new Uint8Array(b/3).fill(f);d.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let u=d.attributes,m=de.fromVertices(u.position.values,void 0,3);return new At({attributes:u,indices:d.indices,primitiveType:Ie.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var XN=PN;var GVi=x(T(),1);var Bht=new gi(0);function sd(e){Wi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(sd.prototype=Object.create(Wi.prototype),sd.prototype.constructor=sd);Object.defineProperties(sd.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});sd.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Nl.isSupported(this._scene)};sd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};sd.prototype._computeCenter=ge.throwInstantiationError;sd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Wi.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))&&xt(xt.geometryZIndex),this._zIndex=o.zIndex??Bht,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 Jh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new F_(this._scene,a,r,s)}};sd.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Wi.prototype.destroy.call(this)};sd.getGeometryHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryHeightReference);return}return fs(t)?0:e};sd.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryExtrudedHeightReference);return}return fs(t)?sd.CLAMP_TO_GROUND:e};sd.CLAMP_TO_GROUND="clamp";sd.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=He.NONE),(!l(n)||!l(i))&&(i=He.NONE);let o=0;if(t!==He.NONE&&o++,i===He.RELATIVE_TO_GROUND&&o++,o===2)return bn.ALL;if(o===1)return bn.TOP};var ri=sd;var qSe=new U,$Se=h.ZERO,eZe=new h,tZe=new re;function zht(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 Ef(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new zht(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Ef.prototype=Object.create(ri.prototype),Ef.prototype.constructor=Ef);Ef.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,qSe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,$Se,eZe))),new Yt({id:t,geometry:new OS(this._options),attributes:i})};Ef.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,qSe),o={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,$Se,eZe))),new Yt({id:t,geometry:new XN(this._options),attributes:o})};Ef.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Ef.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Wi.prototype._isHidden.call(this,e,t)};Ef.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 Qt)};Ef.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,it.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),o=j.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,He.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(it.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(it.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),s.cornerType=j.getValueOrUndefined(t.cornerType,it.MINIMUM_VALUE),s.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),s.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=Pi.getMinimumMaximumHeights(OS.computeRectangle(s,tZe)).minimumTerrainHeight),s.extrudedHeight=o};Ef.DynamicGeometryUpdater=uV;function uV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(uV.prototype=Object.create(Li.prototype),uV.prototype.constructor=uV);uV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Li.prototype._isHidden.call(this,e,t,n)};uV.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,He.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=ri.computeGeometryOffsetAttribute(o,r,s,a),i.height=ri.getGeometryHeight(o,r),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND&&(s=Pi.getMinimumMaximumHeights(OS.computeRectangle(i,tZe)).minimumTerrainHeight),i.extrudedHeight=s};var NN=Ef;var EAi=x(T(),1);var tEi=x(T(),1);function qB(){ge.throwInstantiationError()}Object.defineProperties(qB.prototype,{name:{get:ge.throwInstantiationError},clock:{get:ge.throwInstantiationError},entities:{get:ge.throwInstantiationError},isLoading:{get:ge.throwInstantiationError},changedEvent:{get:ge.throwInstantiationError},errorEvent:{get:ge.throwInstantiationError},loadingEvent:{get:ge.throwInstantiationError},show:{get:ge.throwInstantiationError},clustering:{get:ge.throwInstantiationError}});qB.prototype.update=function(e){ge.throwInstantiationError()};qB.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Es=qB;var _Ai=x(T(),1);var cEi=x(T(),1);function t0(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(t0.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=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var nZe=new h;t0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,nZe);return Y$(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};t0.prototype.isScaledSpacePointVisible=function(e){return Y$(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var Hht=new h;t0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=Hht,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),Y$(e,o,i)};t0.prototype.computeHorizonCullingPoint=function(e,t,n){return rZe(this._ellipsoid,e,t,n)};var iZe=ne.clone(ne.UNIT_SPHERE);t0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=oZe(this._ellipsoid,n,iZe);return rZe(o,e,t,i)};t0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return sZe(this._ellipsoid,e,t,n,i,o)};t0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=oZe(this._ellipsoid,o,iZe);return sZe(s,e,t,n,i,r)};var Kht=[];t0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=re.subsample(e,t,0,Kht),o=de.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var Jht=new h;function oZe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,Jht);e=ne.fromCartesian3(i,n)}return e}function rZe(e,t,n,i){l(i)||(i=new h);let o=lZe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=aZe(e,c,o);if(d<0)return;r=Math.max(r,d)}return cZe(o,r,i)}var $B=new h;function sZe(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let s=lZe(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){$B.x=n[c]+o.x,$B.y=n[c+1]+o.y,$B.z=n[c+2]+o.z;let u=aZe(e,$B,s);if(u<0)return;a=Math.max(a,u)}return cZe(s,a,r)}function Y$(e,t,n){let i=t,o=n,r=h.subtract(e,i,nZe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var jht=new h,Qht=new h;function aZe(e,t,n){let i=e.transformPositionToScaledSpace(t,jht),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,Qht);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function cZe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var N$=new h;function lZe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,N$),h.normalize(N$,N$))}var Af=t0;var ZEi=x(T(),1);function ss(e,t){e=e??B.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=Ot.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=U.clone(e.color??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Mr.NONE}var dZe=ss.SHOW_INDEX=0,hZe=ss.POSITION_INDEX=1,qht=ss.COLOR_INDEX=2,$ht=ss.OUTLINE_COLOR_INDEX=3,eft=ss.OUTLINE_WIDTH_INDEX=4,tft=ss.PIXEL_SIZE_INDEX=5,nft=ss.SCALE_BY_DISTANCE_INDEX=6,ift=ss.TRANSLUCENCY_BY_DISTANCE_INDEX=7,oft=ss.DISTANCE_DISPLAY_CONDITION_INDEX=8,rft=ss.DISABLE_DEPTH_DISTANCE_INDEX=9,sft=ss.SPLIT_DIRECTION_INDEX=10;ss.NUMBER_OF_PROPERTIES=11;function Du(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ss.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Du(this,dZe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Du(this,hZe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),Du(this,nft))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),Du(this,ift))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Du(this,tft))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Du(this,qht))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Du(this,$ht))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Du(this,eft))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ot.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ot.clone(e,this._distanceDisplayCondition),Du(this,oft))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Du(this,rft))}},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,Du(this,dZe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Du(this,sft))}}});ss.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};ss.prototype._getActualPosition=function(){return this._actualPosition};ss.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Du(this,hZe)};var uZe=new ce;ss._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(P.multiplyByPoint(n,e,uZe),fo.computeActualEllipsoidPosition(t,uZe))};var mZe=new ce;ss._computeScreenSpacePosition=function(e,t,n,i){let o=P.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,mZe),mZe);return fo.worldToWindowCoordinates(n,o,i)};ss.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new k);let i=n.modelMatrix,o=ss._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};ss.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 nt),n.x=r,n.y=s,n.width=a,n.height=c,n};ss.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&U.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&U.equals(this._outlineColor,e._outlineColor)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ot.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};ss.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ea=ss;var tAi=x(T(),1);var CEi=x(T(),1),Mx=`in vec4 v_color; in vec4 v_outlineColor; in float v_innerPercent; in float v_pixelDistance; @@ -6016,7 +7842,7 @@ discard; out_FragColor = czm_gammaCorrect(color); czm_writeLogDepth(); } -`;var rqn=_(T(),1),BP=`uniform float u_maxTotalPointSize; +`;var EEi=x(T(),1),YN=`uniform float u_maxTotalPointSize; in vec4 positionHighAndSize; in vec4 positionLowAndOutline; in vec4 compressedAttribute0; @@ -6049,32 +7875,13 @@ 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; -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); -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); -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); -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 color = czm_decodeRGB8(compressedAttribute0.x); +vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y); +vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z); +vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w); +color.a = alphaPacked.x; +outlineColor.a = alphaPacked.y; +pickColor.a = alphaPacked.z; 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) @@ -6147,7 +7954,15 @@ gl_Position *= show; v_pickColor = pickColor; v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var K8e=Gs.SHOW_INDEX,$K=Gs.POSITION_INDEX,Nue=Gs.COLOR_INDEX,J8e=Gs.OUTLINE_COLOR_INDEX,Q8e=Gs.OUTLINE_WIDTH_INDEX,j8e=Gs.PIXEL_SIZE_INDEX,kue=Gs.SCALE_BY_DISTANCE_INDEX,Uue=Gs.TRANSLUCENCY_BY_DISTANCE_INDEX,Oue=Gs.DISTANCE_DISPLAY_CONDITION_INDEX,q8e=Gs.DISABLE_DEPTH_DISTANCE_INDEX,$8e=Gs.SPLIT_DIRECTION_INDEX,eJ=Gs.NUMBER_OF_PROPERTIES,Cc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ju(e){e=e??z.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(eJ),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Lo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ju.prototype,{length:{get:function(){return tJ(this),this._pointPrimitives.length}}});function Due(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 Gs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ju.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ju.prototype.removeAll=function(){Due(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function tJ(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}}ju.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ju.prototype.contains=function(e){return c(e)&&e._pointPrimitiveCollection===this};ju.prototype.get=function(e){if(!c(e))throw new L("index is required.");return tJ(this),this._pointPrimitives[e]};ju.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<eJ;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function e7e(e,t,n){return new Ip(e,[{index:Cc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[$K]},{index:Cc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[$K]},{index:Cc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Nue]},{index:Cc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Uue]},{index:Cc.scaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[kue]},{index:Cc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Oue]}],t)}var jK=new Bn;function Bue(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(ue.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Bn.fromCartesian(r,jK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let l=n[Cc.positionHighAndSize],d=jK.high;l(o,d.x,d.y,d.z,s);let u=n[Cc.positionLowAndOutline],f=jK.low;u(o,f.x,f.y,f.z,a)}var kk=65536,YP=256;function Yue(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,l=Y.floatToByte(r.red),d=Y.floatToByte(r.green),u=Y.floatToByte(r.blue),f=l*kk+d*YP+u;l=Y.floatToByte(a.red),d=Y.floatToByte(a.green),u=Y.floatToByte(a.blue);let p=l*kk+d*YP+u;l=Y.floatToByte(s.red),d=Y.floatToByte(s.green),u=Y.floatToByte(s.blue);let y=l*kk+d*YP+u,h=Y.floatToByte(r.alpha)*kk+Y.floatToByte(a.alpha)*YP+Y.floatToByte(s.alpha),g=n[Cc.compressedAttribute0];g(o,f,p,y,h)}function Hue(e,t,n,i){let o=i._index,r=0,s=1,a=1,l=1,d=i.translucencyByDistance;c(d)&&(r=d.near,s=d.nearValue,a=d.far,l=d.farValue,(s!==1||l!==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 f=(u?1:0)*YP+s;l=w.clamp(l,0,1),l=l===1?255:l*255|0;let p=l,y=n[Cc.compressedAttribute1];y(o,f,p,r,a)}function zue(e,t,n,i){let o=i._index,r=n[Cc.scaleByDistance],s=0,a=1,l=1,d=1,u=i.scaleByDistance;c(u)&&(s=u.near,a=u.nearValue,l=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,l,d)}function Kue(e,t,n,i){let o=i._index,r=n[Cc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.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,f=i.splitDirection;c(f)&&(u=f),r(o,s,a,d,u)}function t7e(e,t,n,i){Bue(e,t,n,i),Yue(e,t,n,i),Hue(e,t,n,i),zue(e,t,n,i),Kue(e,t,n,i)}function qK(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l<n;++l){let d=t[l],u=d.position,f=Gs._computeActualPosition(u,i,o);c(f)&&(d._setActualPosition(f),r?a.push(f):ue.expand(s,f,s))}r&&ue.fromPoints(a,s)}function n7e(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&qK(e,i,i.length,t,r,!0)):n===se.MORPHING?qK(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&qK(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function i7e(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var o7e=[];ju.prototype.update=function(e){if(tJ(this),!this.show)return;this._maxTotalPointSize=mt.maximumAliasedPointSize,n7e(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,l=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let E=0;E<eJ;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=e7e(l,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let I=this._pointPrimitives[E];I._dirty=!1,t7e(this,l,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=o7e;E.length=0,(r[$K]||r[Q8e]||r[j8e])&&E.push(Bue),(r[Nue]||r[J8e])&&E.push(Yue),(r[K8e]||r[Uue])&&E.push(Hue),r[kue]&&E.push(zue),(r[Oue]||r[q8e]||r[$8e])&&E.push(Kue);let I=E.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 F=0;F<I;++F)E[F](this,l,a,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let F=0;F<I;++F)E[F](this,l,a,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,p=M.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,f=ue.clone(this._baseVolumeWC,this._boundingVolume)):f=ue.clone(this._baseVolume2D,this._boundingVolume),i7e(this,e,f);let y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Oe.fromCache({depthTest:{enabled:!0,func:oe.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Oe.fromCache({depthTest:{enabled:!0,func:oe.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,g;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new Be({sources:[BP]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(g=new Be({defines:["OPAQUE"],sources:[Jy]}),this._sp=tn.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc}),g=new Be({defines:["TRANSLUCENT"],sources:[Jy]}),this._spTranslucent=tn.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc})),this._blendOption===Lo.OPAQUE&&(g=new Be({sources:[Jy]}),this._sp=tn.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc})),this._blendOption===Lo.TRANSLUCENT&&(g=new Be({sources:[Jy]}),this._spTranslucent=tn.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,S,V,Z,R=e.commandList;if(d.render||u){let E=this._colorCommands,I=this._blendOption===Lo.OPAQUE,v=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,S=x.length,E.length=S;let P=v?S*2:S;for(Z=0;Z<P;++Z){let F=I||v&&Z%2===0;V=E[Z],c(V)||(V=E[Z]=new et),V.primitiveType=ve.POINTS,V.pass=F||!v?Xe.OPAQUE:Xe.TRANSLUCENT,V.owner=this;let N=v?Math.floor(Z/2):Z;V.boundingVolume=f,V.modelMatrix=p,V.shaderProgram=F?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=x[N].va,V.renderState=F?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",R.push(V)}}};ju.prototype.isDestroyed=function(){return!1};ju.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(),Due(this._pointPrimitives),he(this)};var A1=ju;var vqn=_(T(),1),Jue=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],nJ=1,HP=8,KP=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!==nJ)throw new Error(`Got v${o} data when expected v${nJ}.`);let r=Jue[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=Jue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(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,HP,t),this.coords=new this.ArrayType(this.data,HP+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(HP+s+a+l),this.ids=new this.IndexArrayType(this.data,HP,t),this.coords=new this.ArrayType(this.data,HP+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(nJ<<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 oJ(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,l=[0,r.length-1,0],d=[];for(;l.length;){let u=l.pop()||0,f=l.pop()||0,p=l.pop()||0;if(f-p<=a){for(let x=p;x<=f;x++){let S=s[2*x],V=s[2*x+1];S>=t&&S<=i&&V>=n&&V<=o&&d.push(r[x])}continue}let y=p+f>>1,h=s[2*y],g=s[2*y+1];h>=t&&h<=i&&g>=n&&g<=o&&d.push(r[y]),(u===0?t<=h:n<=g)&&(l.push(p),l.push(y-1),l.push(1-u)),(u===0?i>=h:o>=g)&&(l.push(y+1),l.push(f),l.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],l=[],d=i*i;for(;a.length;){let u=a.pop()||0,f=a.pop()||0,p=a.pop()||0;if(f-p<=s){for(let x=p;x<=f;x++)Que(r[2*x],r[2*x+1],t,n)<=d&&l.push(o[x]);continue}let y=p+f>>1,h=r[2*y],g=r[2*y+1];Que(h,g,t,n)<=d&&l.push(o[y]),(u===0?t-i<=h:n-i<=g)&&(a.push(p),a.push(y-1),a.push(1-u)),(u===0?t+i>=h:n+i>=g)&&(a.push(y+1),a.push(f),a.push(1-u))}return l}};function oJ(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;jue(e,t,s,i,o,r),oJ(e,t,n,i,s-1,1-r),oJ(e,t,n,s+1,o,1-r)}function jue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,f=Math.log(d),p=.5*Math.exp(2*f/3),y=.5*Math.sqrt(f*p*(d-p)/d)*(u-d/2<0?-1:1),h=Math.max(i,Math.floor(n-u*p/d+y)),g=Math.min(o,Math.floor(n+(d-u)*p/d+y));jue(e,t,n,h,g,r)}let s=t[2*n+r],a=i,l=o;for(zP(e,t,i,n),t[2*o+r]>s&&zP(e,t,i,o);a<l;){for(zP(e,t,a,l),a++,l--;t[2*a+r]<s;)a++;for(;t[2*l+r]>s;)l--}t[2*i+r]===s?zP(e,t,i,l):(l++,zP(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function zP(e,t,n,i){iJ(e,n,i),iJ(t,2*n,2*i),iJ(t,2*n+1,2*i+1)}function iJ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Que(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function xf(e){e=e??z.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 ye,this.show=e.show??!0}function que(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var r7e=new je;function $ue(e,t,n,i,o){if(c(e._labelCollection)&&i._clusterLabels?o=Fy.getScreenSpaceBoundingBox(e,t,o):c(e._billboardCollection)&&i._clusterBillboards?o=co.getScreenSpaceBoundingBox(e,t,o):c(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Gs.getScreenSpaceBoundingBox(e,t,o)),que(o,n),i._clusterLabels&&!c(e._labelCollection)&&c(e.id)&&tme(i,e.id.id)&&c(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Fy.getScreenSpaceBoundingBox(s,t,r7e);que(a,n),o=je.union(o,a,o)}return o}function s7e(e,t){if(e.clusterShow=!0,!c(e._labelCollection)&&c(e.id)&&tme(t,e.id.id)&&c(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function eme(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 tme(e,t){return c(e)&&c(e._collectionIndicesByEntity[t])&&c(e._collectionIndicesByEntity[t].labelIndex)}function rJ(e,t,n,i,o){if(!c(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===se.SCENE3D&&!i.isPointVisible(a.position))continue;let l=o._clusterLabels&&c(a._labelCollection),d=o._clusterBillboards&&c(a.id._billboard),u=o._clusterPoints&&c(a.id._point);if(l&&(u||d))continue;let f=a.computeScreenSpacePosition(n);c(f)&&t.push({index:s,collection:e,clustered:!1,coord:f})}}var a7e=new je,c7e=new je,l7e=new je;function d7e(e){return function(t){if(c(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!c(i)&&!c(o)&&!c(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,l=e._clusterPointCollection;c(s)?s.removeAll():s=e._clusterLabelCollection=new Gh({scene:n}),c(a)?a.removeAll():a=e._clusterBillboardCollection=new Gd({scene:n}),c(l)?l.removeAll():l=e._clusterPointCollection=new A1;let d=e._pixelRange,u=e._minimumClusterSize,f=e._previousClusters,p=[],y=e._previousHeight,h=n.camera.positionCartographic.height,g=n.ellipsoid,x=n.camera.positionWC,S=new kb(g,x),V=[];e._clusterLabels&&rJ(i,V,n,S,e),e._clusterBillboards&&rJ(o,V,n,S,e),e._clusterPoints&&rJ(r,V,n,S,e);let Z,R,E,I,v,P,F,N,b,G,X,W;if(V.length>0){let A=new KP(V.length,64,Uint32Array);for(let k=0;k<V.length;++k)A.add(V[k].coord.x,V[k].coord.y);if(A.finish(),h<y)for(E=f.length,Z=0;Z<E;++Z){let k=f[Z];if(!S.isPointVisible(k.position))continue;let B=co._computeScreenSpacePosition(M.IDENTITY,k.position,m.ZERO,D.ZERO,n);if(!c(B))continue;let O=1-h/y,H=k.width=k.width*O,U=k.height=k.height*O;H=Math.max(H,k.minimumWidth),U=Math.max(U,k.minimumHeight);let K=B.x-H*.5,Q=B.y-U*.5,ie=B.x+H,j=B.y+U;for(v=A.range(K,Q,ie,j),P=v.length,G=0,b=[],R=0;R<P;++R)F=v[R],N=V[F],N.clustered||(++G,X=N.collection,W=N.index,b.push(X.get(W).id));if(G>=u)for(eme(k.position,G,b,e),p.push(k),R=0;R<P;++R)V[v[R]].clustered=!0}for(E=V.length,Z=0;Z<E;++Z){let k=V[Z];if(k.clustered)continue;k.clustered=!0,X=k.collection,W=k.index;let B=X.get(W);I=$ue(B,k.coord,d,e,a7e);let O=je.clone(I,c7e);v=A.range(I.x,I.y,I.x+I.width,I.y+I.height),P=v.length;let H=m.clone(B.position);for(G=1,b=[B.id],R=0;R<P;++R)if(F=v[R],N=V[F],!N.clustered){let U=N.collection.get(N.index),K=$ue(U,N.coord,d,e,l7e);m.add(U.position,H,H),je.union(O,K,O),++G,b.push(U.id)}if(G>=u){let U=m.multiplyByScalar(H,1/G,H);for(eme(U,G,b,e),p.push({position:U,width:O.width,height:O.height,minimumWidth:I.width,minimumHeight:I.height}),R=0;R<P;++R)V[v[R]].clustered=!0}else s7e(B,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=h}}xf.prototype._initialize=function(e){this._scene=e;let t=d7e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(xf.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&&(!c(this._billboardCollection)||this._billboardCollection.ready)&&(!c(this._labelCollection)||this._labelCollection.ready)}}});function aJ(e,t,n,i){return function(o){let r=this[e];c(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(c(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),c(r)&&c(s[i]))return r.get(s[i]);c(r)||(r=this[e]=new t({scene:this._scene}));let a,l,d=this[n];d.length>0?(a=d.shift(),l=r.get(a)):(l=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),l}}function cJ(e,t){let n=e._collectionIndicesByEntity[t];!c(n.billboardIndex)&&!c(n.labelIndex)&&!c(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}xf.prototype.getLabel=aJ("_labelCollection",Gh,"_unusedLabelIndices","labelIndex");xf.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._labelCollection)||!c(t)||!c(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,cJ(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};xf.prototype.getBillboard=aJ("_billboardCollection",Gd,"_unusedBillboardIndices","billboardIndex");xf.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._billboardCollection)||!c(t)||!c(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,cJ(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};xf.prototype.getPoint=aJ("_pointCollection",A1,"_unusedPointIndices","pointIndex");xf.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._pointCollection)||!c(t)||!c(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,cJ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function sJ(e){if(!c(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function u7e(e){e.enabled||(c(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),c(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),c(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,sJ(e._labelCollection),sJ(e._billboardCollection),sJ(e._pointCollection))}xf.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;c(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;c(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,u7e(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=c(n)&&!n.ready||c(i)&&!i.ready),c(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),c(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),c(this._clusterPointCollection)&&this._clusterPointCollection.update(e),c(n)&&n.update(e),c(i)&&i.update(e),c(this._pointCollection)&&this._pointCollection.update(e)};xf.prototype.destroy=function(){c(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 wd=xf;function lJ(e){this._name=e,this._clock=void 0,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Ks(this),this._entityCluster=new wd}Object.defineProperties(lJ.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){Hr.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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}}});lJ.prototype.update=function(e){return!0};var JP=lJ;var pei=_(T(),1);var G$n=_(T(),1);var d$n=_(T(),1);var nme={};nme.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,l=o?2*a:a,d=new Float64Array(l*3),u,f=0,p=0,y=o?a*3:0,h=o?(a+i)*3:i*3;for(u=0;u<i;u++){let g=u/i*w.TWO_PI,x=Math.cos(g),S=Math.sin(g),V=x*n,Z=S*n,R=x*t,E=S*t;d[p+y]=V,d[p+y+1]=Z,d[p+y+2]=s,d[p+h]=R,d[p+h+1]=E,d[p+h+2]=r,p+=3,o&&(d[f++]=V,d[f++]=Z,d[f++]=s,d[f++]=R,d[f++]=E,d[f++]=r)}return d};var tT=nme;var dJ=new D,m7e=new m,f7e=new m,h7e=new m,p7e=new m;function Ub(e){e=e??z.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??We.DEFAULT,r=e.slices??128;if(!c(t))throw new L("options.length must be defined.");if(!c(n))throw new L("options.topRadius must be defined.");if(!c(i))throw new L("options.bottomRadius must be defined.");if(r<3)throw new L("options.slices must be greater than or equal to 3.");if(c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=We.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Ub.packedLength=We.packedLength+5;Ub.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var ime=new We,M1={vertexFormat:ime,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Ub.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=We.unpack(e,t,ime);t+=We.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=l===-1?void 0:l,n):(M1.length=o,M1.topRadius=r,M1.bottomRadius=s,M1.slices=a,M1.offsetAttribute=l===-1?void 0:l,new Ub(M1))};Ub.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,l=s+s,d=tT.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(l*2):void 0,f=o.normal?new Float32Array(l*3):void 0,p=o.tangent?new Float32Array(l*3):void 0,y=o.bitangent?new Float32Array(l*3):void 0,h,g=o.normal||o.tangent||o.bitangent;if(g){let v=o.tangent||o.bitangent,P=0,F=0,N=0,b=Math.atan2(i-n,t),G=m7e;G.z=Math.sin(b);let X=Math.cos(b),W=h7e,A=f7e;for(h=0;h<r;h++){let k=h/r*w.TWO_PI,B=X*Math.cos(k),O=X*Math.sin(k);g&&(G.x=B,G.y=O,v&&(W=m.normalize(m.cross(m.UNIT_Z,G,W),W)),o.normal&&(f[P++]=G.x,f[P++]=G.y,f[P++]=G.z,f[P++]=G.x,f[P++]=G.y,f[P++]=G.z),o.tangent&&(p[F++]=W.x,p[F++]=W.y,p[F++]=W.z,p[F++]=W.x,p[F++]=W.y,p[F++]=W.z),o.bitangent&&(A=m.normalize(m.cross(G,W,A),A),y[N++]=A.x,y[N++]=A.y,y[N++]=A.z,y[N++]=A.x,y[N++]=A.y,y[N++]=A.z))}for(h=0;h<r;h++)o.normal&&(f[P++]=0,f[P++]=0,f[P++]=-1),o.tangent&&(p[F++]=1,p[F++]=0,p[F++]=0),o.bitangent&&(y[N++]=0,y[N++]=-1,y[N++]=0);for(h=0;h<r;h++)o.normal&&(f[P++]=0,f[P++]=0,f[P++]=1),o.tangent&&(p[F++]=1,p[F++]=0,p[F++]=0),o.bitangent&&(y[N++]=0,y[N++]=1,y[N++]=0)}let x=12*r-12,S=Me.createTypedArray(l,x),V=0,Z=0;for(h=0;h<r-1;h++)S[V++]=Z,S[V++]=Z+2,S[V++]=Z+3,S[V++]=Z,S[V++]=Z+3,S[V++]=Z+1,Z+=2;for(S[V++]=s-2,S[V++]=0,S[V++]=1,S[V++]=s-2,S[V++]=1,S[V++]=s-1,h=1;h<r-1;h++)S[V++]=s+h+1,S[V++]=s+h,S[V++]=s;for(h=1;h<r-1;h++)S[V++]=a,S[V++]=a+h,S[V++]=a+h+1;let R=0;if(o.st){let v=Math.max(n,i);for(h=0;h<l;h++){let P=m.fromArray(d,h*3,p7e);u[R++]=(P.x+v)/(2*v),u[R++]=(P.y+v)/(2*v)}}let E=new fn;o.position&&(E.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(E.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(E.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(E.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(E.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})),dJ.x=t*.5,dJ.y=Math.max(i,n);let I=new ue(m.ZERO,D.magnitude(dJ));if(c(e._offsetAttribute)){t=d.length;let v=e._offsetAttribute===$t.NONE?0:1,P=new Uint8Array(t/3).fill(v);E.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new dt({attributes:E,indices:S,primitiveType:ve.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var uJ;Ub.getUnitCylinder=function(){return c(uJ)||(uJ=Ub.createGeometry(new Ub({topRadius:1,bottomRadius:1,length:1,vertexFormat:We.POSITION_ONLY}))),uJ};var QP=Ub;var Y$n=_(T(),1);var mJ=new D;function N1(e){e=e??z.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);if(C.typeOf.number("options.positions",t),C.typeOf.number("options.topRadius",n),C.typeOf.number("options.bottomRadius",i),C.typeOf.number.greaterThanOrEquals("options.slices",o,3),c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}N1.packedLength=6;N1.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var nT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};N1.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=l===-1?void 0:l,n):(nT.length=i,nT.topRadius=o,nT.bottomRadius=r,nT.slices=s,nT.numberOfVerticalLines=a,nT.offsetAttribute=l===-1?void 0:l,new N1(nT))};N1.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=tT.computePositions(t,n,i,o,!1),l=o*2,d;if(r>0){let g=Math.min(r,o);d=Math.round(o/g),l+=g}let u=Me.createTypedArray(s,l*2),f=0,p;for(p=0;p<o-1;p++)u[f++]=p,u[f++]=p+1,u[f++]=p+o,u[f++]=p+1+o;if(u[f++]=o-1,u[f++]=0,u[f++]=o+o-1,u[f++]=o,r>0)for(p=0;p<o;p+=d)u[f++]=p,u[f++]=p+o;let y=new fn;y.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:a}),mJ.x=t*.5,mJ.y=Math.max(i,n);let h=new ue(m.ZERO,D.magnitude(mJ));if(c(e._offsetAttribute)){t=a.length;let g=e._offsetAttribute===$t.NONE?0:1,x=new Uint8Array(t/3).fill(g);y.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}return new dt({attributes:y,indices:u,primitiveType:ve.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var jP=N1;var ome=m.ZERO,rme=new m,b7e=new m,sme=new Y;function y7e(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 Pd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new y7e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}c(Object.create)&&(Pd.prototype=Object.create(oi.prototype),Pd.prototype.constructor=Pd);Object.defineProperties(Pd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Pd.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,sme)),c(a)||(a=Y.WHITE),s.color=Yt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ome,rme))),new Rt({id:t,geometry:new QP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Pd.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,sme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ome,rme))),new Rt({id:t,geometry:new jP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Pd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Pd.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.length)||!c(t.topRadius)||!c(t.bottomRadius)||oi.prototype._isHidden.call(this,e,t)};Pd.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)};Pd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ye.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ye.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ye.MINIMUM_VALUE),i.slices=J.getValueOrUndefined(t.slices,Ye.MINIMUM_VALUE),i.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Ye.MINIMUM_VALUE),i.offsetAttribute=n!==ze.NONE?$t.ALL:void 0};Pd.prototype._onEntityPropertyChanged=Bp;Pd.DynamicGeometryUpdater=k1;function k1(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(k1.prototype=Object.create(ii.prototype),k1.prototype.constructor=k1);k1.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,b7e);return!c(o)||!c(i.length)||!c(i.topRadius)||!c(i.bottomRadius)||ii.prototype._isHidden.call(this,e,t,n)};k1.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,ze.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!==ze.NONE?$t.ALL:void 0};var qP=Pd;var Iri=_(T(),1);var yei=_(T(),1),g7e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},zr=Object.freeze(g7e);var xei=_(T(),1),x7e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},fo=Object.freeze(x7e);var Tei=_(T(),1),_7e={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3},ol=Object.freeze(_7e);var Lei=_(T(),1),ame=_(cd(),1);function T7e(e){if(!c(e))throw new L("uri is required.");let t=new ame.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Ob=T7e;var Xei=_(T(),1);var S7e=w.factorial;function fJ(e,t,n,i,o,r){let s=0,a,l,d;if(i>0){for(l=0;l<o;l++){for(a=!1,d=0;d<r.length&&!a;d++)l===r[d]&&(a=!0);a||(r.push(l),s+=fJ(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,l=0;l<o;l++){for(a=!1,d=0;d<r.length&&!a;d++)l===r[d]&&(a=!0);a||(s*=e-n[t[l]])}return s}var Uk={type:"Hermite"};Uk.getRequiredDataPoints=function(e,t){if(t=t??0,!c(e))throw new L("degree is required.");if(e<0)throw new L("degree must be 0 or greater.");if(t<0)throw new L("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)};Uk.interpolateOrderZero=function(e,t,n,i,o){c(o)||(o=new Array(i));let r,s,a,l,d,u,f=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let x=new Array(f);for(p[r]=x,s=0;s<f;s++)x[s]=[]}let y=f,h=new Array(y);for(r=0;r<y;r++)h[r]=r;let g=f-1;for(l=0;l<i;l++){for(s=0;s<y;s++)u=h[s]*i+l,p[l][0].push(n[u]);for(r=1;r<y;r++){let x=!1;for(s=0;s<y-r;s++){let S=t[h[s]],V=t[h[s+r]],Z;V-S<=0?(u=h[s]*i+i*r+l,Z=n[u],p[l][r].push(Z/S7e(r))):(Z=p[l][r-1][s+1]-p[l][r-1][s],p[l][r].push(Z/(V-S))),x=x||Z!==0}x||(g=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=g;r++){let x=fJ(e,h,t,a,r,[]);for(l=0;l<i;l++){let S=p[l][r][0];o[l+a*i]+=S*x}}return o};var C7e=[];Uk.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);c(s)||(s=new Array(a));for(let S=0;S<a;S++)s[S]=0;let l=t.length,d=new Array(l*(o+1)),u;for(u=0;u<l;u++)for(let S=0;S<o+1;S++)d[u*(o+1)+S]=u;let f=d.length,p=C7e,y=V7e(p,d,t,n,i,o),h=[],g=f*(f+1)/2,x=Math.min(y,r);for(let S=0;S<=x;S++)for(u=S;u<=y;u++){h.length=0;let V=fJ(e,d,t,S,u,h),Z=Math.floor(u*(1-u)/2)+f*u;for(let R=0;R<i;R++){let E=Math.floor(R*g),I=p[E+Z];s[R+S*i]+=I*V}}return s};function V7e(e,t,n,i,o,r){let s,a,l=-1,d=t.length,u=d*(d+1)/2;for(let f=0;f<o;f++){let p=Math.floor(f*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+f,e[p+s]=i[a];for(let y=1;y<d;y++){let h=0,g=Math.floor(y*(1-y)/2)+d*y,x=!1;for(s=0;s<d-y;s++){let S=n[t[s]],V=n[t[s+y]],Z,R;if(V-S<=0)a=t[s]*o*(r+1)+o*y+f,Z=i[a],R=Z/w.factorial(y),e[p+g+h]=R,h++;else{let E=Math.floor((y-1)*(2-y)/2)+d*(y-1);Z=e[p+E+s+1]-e[p+E+s],R=Z/(V-S),e[p+g+h]=R,h++}x=x||Z!==0}x&&(l=Math.max(l,y))}}return l}var $P=Uk;var wei=_(T(),1);var hJ={type:"Lagrange"};hJ.getRequiredDataPoints=function(e){return Math.max(e+1,2)};hJ.interpolateOrderZero=function(e,t,n,i,o){c(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 l=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];l*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=l*n[r*i+s]}return o};var e2=hJ;var Aei=_(T(),1);var pJ={type:"Linear"};pJ.getRequiredDataPoints=function(e){return 2};pJ.interpolateOrderZero=function(e,t,n,i,o){if(t.length!==2)throw new L("The xTable provided to the linear interpolator must have exactly two elements.");if(i<=0)throw new L("There must be at least 1 dependent variable for each independent variable.");c(o)||(o=new Array(i));let r,s,a,l=t[0],d=t[1];if(l===d)throw new L("Divide by zero error: xTable[0] and xTable[1] are equal");for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-l*a)/(d-l);return o};var Qy=pJ;var Uei=_(T(),1);function Vc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Vc.fromCartesian3=function(e,t){C.typeOf.object("cartesian3",e);let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return c(t)||(t=new Vc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Vc.clone=function(e,t){if(c(e))return c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Vc(e.clock,e.cone,e.magnitude)};Vc.normalize=function(e,t){return C.typeOf.object("spherical",e),c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Vc(e.clock,e.cone,1)};Vc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Vc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Vc.prototype.equals=function(e){return Vc.equals(this,e)};Vc.prototype.clone=function(e){return Vc.clone(this,e)};Vc.prototype.equalsEpsilon=function(e,t){return Vc.equalsEpsilon(this,e,t)};Vc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var t2=Vc;var s2=_(cd(),1);var ati=_(T(),1);var $ei=_(T(),1);var Dei=_(T(),1),bJ;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?bJ=function(){return performance.now()}:bJ=function(){return Date.now()};var Ti=bJ;function yJ(e){e=e??z.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;if(c(t)?t=ee.clone(t):c(n)?t=ee.clone(n):c(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),c(n)?n=ee.clone(n):n=ee.clone(t),c(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),ee.greaterThan(n,i))throw new L("startTime must come before stopTime.");this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??zr.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new ye,this.onStop=new ye,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ti(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??fo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(yJ.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.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=ee.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)}}});yJ.prototype.tick=function(){let e=Ti(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===fo.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===fo.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===zr.CLAMPED)ee.lessThan(t,r)?t=ee.clone(r,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(o===zr.LOOP_STOP)for(ee.lessThan(t,r)&&(t=ee.clone(r,t));ee.greaterThan(t,s);)t=ee.addSeconds(r,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var _f=yJ;function iT(){this._definitionChanged=new ye,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:Dc("startTime"),stopTime:Dc("stopTime"),currentTime:Dc("currentTime"),clockRange:Dc("clockRange"),clockStep:Dc("clockStep"),multiplier:Dc("multiplier")});iT.prototype.clone=function(e){return c(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||c(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};iT.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};iT.prototype.getValue=function(e){return c(e)||(e=new _f),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Tf=iT;var yti=_(T(),1);var L7e=Y.WHITE,Z7e=.1,R7e=new D(8,8),G7e=new D(0,0),E7e=new D(1,1);function U1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(U1.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:fe("color"),cellAlpha:fe("cellAlpha"),lineCount:fe("lineCount"),lineThickness:fe("lineThickness"),lineOffset:fe("lineOffset")});U1.prototype.getType=function(e){return"Grid"};var X7e=new ee;U1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(X7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,L7e,t.color),t.cellAlpha=J.getValueOrDefault(this._cellAlpha,e,Z7e),t.lineCount=J.getValueOrClonedDefault(this._lineCount,e,R7e,t.lineCount),t.lineThickness=J.getValueOrClonedDefault(this._lineThickness,e,E7e,t.lineThickness),t.lineOffset=J.getValueOrClonedDefault(this._lineOffset,e,G7e,t.lineOffset),t};U1.prototype.equals=function(e){return this===e||e instanceof U1&&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 O1=U1;var Lti=_(T(),1);function D1(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(D1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});D1.prototype.getType=function(e){return"PolylineArrow"};var I7e=new ee;D1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(I7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};D1.prototype.equals=function(e){return this===e||e instanceof D1&&J.equals(this._color,e._color)};var B1=D1;var Pti=_(T(),1);var W7e=Y.WHITE,w7e=Y.TRANSPARENT,P7e=16,v7e=255;function Y1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(Y1.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:fe("color"),gapColor:fe("gapColor"),dashLength:fe("dashLength"),dashPattern:fe("dashPattern")});Y1.prototype.getType=function(e){return"PolylineDash"};var F7e=new ee;Y1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(F7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,W7e,t.color),t.gapColor=J.getValueOrClonedDefault(this._gapColor,e,w7e,t.gapColor),t.dashLength=J.getValueOrDefault(this._dashLength,e,P7e,t.dashLength),t.dashPattern=J.getValueOrDefault(this._dashPattern,e,v7e,t.dashPattern),t};Y1.prototype.equals=function(e){return this===e||e instanceof Y1&&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 H1=Y1;var Dti=_(T(),1);var A7e=Y.WHITE,M7e=.25,N7e=1;function z1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(z1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),glowPower:fe("glowPower"),taperPower:fe("taperPower")});z1.prototype.getType=function(e){return"PolylineGlow"};var k7e=new ee;z1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(k7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,A7e,t.color),t.glowPower=J.getValueOrDefault(this._glowPower,e,M7e,t.glowPower),t.taperPower=J.getValueOrDefault(this._taperPower,e,N7e,t.taperPower),t};z1.prototype.equals=function(e){return this===e||e instanceof z1&&J.equals(this._color,e._color)&&J.equals(this._glowPower,e._glowPower)&&J.equals(this._taperPower,e._taperPower)};var K1=z1;var qti=_(T(),1);var U7e=Y.WHITE,O7e=Y.BLACK,D7e=1;function J1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(J1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._outlineColor)&&J.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth")});J1.prototype.getType=function(e){return"PolylineOutline"};var B7e=new ee;J1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(B7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,U7e,t.color),t.outlineColor=J.getValueOrClonedDefault(this._outlineColor,e,O7e,t.outlineColor),t.outlineWidth=J.getValueOrDefault(this._outlineWidth,e,D7e),t};J1.prototype.equals=function(e){return this===e||e instanceof J1&&J.equals(this._color,e._color)&&J.equals(this._outlineColor,e._outlineColor)&&J.equals(this._outlineWidth,e._outlineWidth)};var jy=J1;var ani=_(T(),1);function Db(e,t){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new hr,this._referenceFrame=t??Ui.FIXED,this.setValue(e)}Object.defineProperties(Db.prototype,{isConstant:{get:function(){let e=this._value;if(!c(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 Y7e=new ee;Db.prototype.getValue=function(e,t){return c(e)||(e=ee.now(Y7e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Db.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._value;if(!c(i))return;let o=i.length;c(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let l=i[r].getValueInReferenceFrame(e,t,n[r]);c(l)&&(n[s]=l,s++),r++}return n.length=s,n};Db.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,Db.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Db.prototype.equals=function(e){return this===e||e instanceof Db&&this._referenceFrame===e._referenceFrame&&J.arrayEquals(this._value,e._value)};Db.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Bb=Db;var hni=_(T(),1);function qy(e){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new hr,this.setValue(e)}Object.defineProperties(qy.prototype,{isConstant:{get:function(){let e=this._value;if(!c(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 H7e=new ee;qy.prototype.getValue=function(e,t){c(e)||(e=ee.now(H7e));let n=this._value;if(!c(n))return;let i=n.length;c(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);c(a)&&(t[r]=a,r++),o++}return t.length=r,t};qy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,qy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};qy.prototype.equals=function(e){return this===e||e instanceof qy&&J.arrayEquals(this._value,e._value)};qy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Q1=qy;var Tni=_(T(),1);function oT(e){let t=e._targetProperty;if(!c(t)){let n=e._targetEntity;if(!c(n)){if(n=e._targetCollection.getById(e._targetId),!c(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(vd.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&c(t);++o)t=t[i[o]];e._targetProperty=t}return t}function vd(e,t,n){if(!c(e))throw new L("targetCollection is required.");if(!c(t)||t==="")throw new L("targetId is required.");if(!c(n)||n.length===0)throw new L("targetPropertyNames is required.");for(let i=0;i<n.length;i++){let o=n[i];if(!c(o)||o==="")throw new L("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new ye,e.collectionChanged.addEventListener(vd.prototype._onCollectionChanged,this)}Object.defineProperties(vd.prototype,{isConstant:{get:function(){return J.isConstant(oT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=oT(this);return c(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 oT(this)}}});vd.fromString=function(e,t){if(!c(e))throw new L("targetCollection is required.");if(!c(t))throw new L("referenceString is required.");let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let l=t.charAt(a);r?(s+=l,r=!1):l==="\\"?r=!0:o&&l==="#"?(n=s,o=!1,s=""):!o&&l==="."?(i.push(s),s=""):s+=l}return i.push(s),new vd(e,n,i)};var z7e=new ee;vd.prototype.getValue=function(e,t){let n=oT(this);return c(e)||(e=ee.now(z7e)),c(n)?n.getValue(e,t):void 0};vd.prototype.getValueInReferenceFrame=function(e,t,n){let i=oT(this);return c(i)?i.getValueInReferenceFrame(e,t,n):void 0};vd.prototype.getType=function(e){let t=oT(this);return c(t)?t.getType(e):void 0};vd.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};vd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){c(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};vd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;c(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(vd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):c(i)||(i=oT(this),c(i)&&this._definitionChanged.raiseEvent(this))};var Yb=vd;var Zni=_(T(),1);var K7e={packedLength:1,pack:function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,t[n]=e,t},unpack:function(e,t,n){if(!c(e))throw new L("array is required");return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){if(!c(e))throw new L("packedArray is required");c(i)||(i=[]),t=t??0,n=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){if(!c(e))throw new L("array is required");if(!c(t))throw new L("sourceArray is required");return o=e[0],o<0?o+w.TWO_PI:o}},qu=K7e;var Kni=_(T(),1);var Fni=_(T(),1);var cme={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function lme(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 dme(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var gJ=[],xJ=[];function Ok(e,t,n,i,o){let r=0,s,a,l,d,u,f;for(;r<i.length;){u=dme(i[r],e),l=Wo(t,u,ee.compare);let p=0,y=0;if(l<0){for(l=~l,d=l*o,a=void 0,f=t[l];r<i.length&&(u=dme(i[r],e),!(c(a)&&ee.compare(a,u)>=0||c(f)&&ee.compare(u,f)>=0));){for(gJ[p++]=u,r=r+1,s=0;s<o;s++)xJ[y++]=i[r],r=r+1;a=u}p>0&&(xJ.length=y,lme(n,d,xJ),gJ.length=p,lme(t,l,gJ))}else{for(s=0;s<o;s++)r++,n[l*o+s]=i[r];r++}}}function $u(e,t){C.defined("type",e);let n=e;n===Number&&(n=cme);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(c(t)){let a=t.length;s=new Array(a);for(let l=0;l<a;l++){let d=t[l];d===Number&&(d=cme);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[l]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Qy,this._lastInterpolationAlgorithm=Qy,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 ye,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=ol.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ol.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties($u.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 J7e=new ee;$u.prototype.getValue=function(e,t){c(e)||(e=ee.now(J7e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Wo(n,e,ee.compare);var l=!1;if(a<0){if(a=~a,a===0){let I=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ol.NONE||o!==0&&ee.secondsDifference(I,e)>o)return;if(this._backwardExtrapolationType===ol.HOLD)return r.unpack(s,0,t);l=this._backwardExtrapolationType===ol.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let I=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ol.NONE||o!==0&&ee.secondsDifference(e,I)>o)return;if(this._forwardExtrapolationType===ol.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);l=this._forwardExtrapolationType===ol.LINEAR_EXTRAPOLATE}let f=this._xTable,p=this._yTable;var d,u;l?(d=Cesium.LinearApproximation,u=1):(d=this._interpolationAlgorithm,u=this._interpolationDegree),this._lastInterpolationAlgorithm!=d&&(this._lastInterpolationAlgorithm=d,this._updateTableLength=!0);let y=this._packedInterpolationLength,h=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let I=Math.min(d.getRequiredDataPoints(u,h),i);I!==this._numberOfPoints&&(this._numberOfPoints=I,f.length=I,p.length=I*y)}let g=this._numberOfPoints-1;if(g<1)return;let x=0,S=i-1;if(S-x+1>=g+1){let I=a-(g/2|0)-1;I<x&&(I=x);let v=I+g;v>S&&(v=S,I=v-g,I<x&&(I=x)),x=I,S=v}let Z=S-x+1;for(let I=0;I<Z;++I)f[I]=ee.secondsDifference(n[x+I],n[S]);if(c(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,x,S,p);else{let I=0,v=this._packedLength,P=x*v,F=(S+1)*v;for(;P<F;)p[I]=s[P],P++,I++}let R=ee.secondsDifference(e,n[S]),E;if(h===0||!c(d.interpolate))E=d.interpolateOrderZero(R,f,p,y,this._interpolationResult);else{let I=Math.floor(y/(h+1));E=d.interpolate(R,f,p,I,h,h,this._interpolationResult)}return c(r.unpackInterpolationResult)?r.unpackInterpolationResult(E,s,x,S,t):r.unpack(E,0,t)}return r.unpack(s,a*this._packedLength,t)};$u.prototype.setInterpolationOptions=function(e){if(!c(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;c(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),c(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};$u.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);C.defined("time",e),C.defined("value",t),o&&C.defined("derivatives",n);let r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let l=0;l<a;l++)i[l].pack(n[l],s,s.length)}Ok(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};$u.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);if(C.defined("times",e),C.defined("values",t),e.length!==t.length)throw new L("times and values must be the same length.");if(o&&(!c(n)||n.length!==e.length))throw new L("times and derivativeValues must be the same length.");let r=this._innerType,s=e.length,a=[];for(let l=0;l<s;l++)if(a.push(e[l]),r.pack(t[l],a,a.length),o){let d=n[l],u=i.length;for(let f=0;f<u;f++)i[f].pack(d[f],a,a.length)}Ok(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};$u.prototype.getSample=function(e){C.typeOf.number("index",e);let t=this._times,n=t.length;if(c(n))return e<0&&(e+=n),t[e]};$u.prototype.addSamplesPackedArray=function(e,t){C.defined("packedSamples",e),Ok(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};$u.prototype.removeSample=function(e){C.defined("time",e);let t=Wo(this._times,e,ee.compare);return t<0?!1:(ume(this,t,1),!0)};function ume(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)}$u.prototype.removeSamples=function(e){C.defined("timeInterval",e);let t=this._times,n=Wo(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Wo(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,ume(this,n,i-n)};$u.prototype.equals=function(e){if(this===e)return!0;if(!c(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=c(t),i=e._derivativeTypes,o=c(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,l=e._times;if(s=a.length,s!==l.length)return!1;for(r=0;r<s;r++)if(!ee.equals(a[r],l[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};$u._mergeNewSamples=Ok;var Fd=$u;function em(e,t){t=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 Fd(m,n),this._definitionChanged=new ye,this._referenceFrame=e??Ui.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(em.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 Q7e=new ee;em.prototype.getValue=function(e,t){return c(e)||(e=ee.now(Q7e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};em.prototype.getValueInReferenceFrame=function(e,t,n){if(C.defined("time",e),C.defined("referenceFrame",t),n=this._property.getValue(e,n),c(n))return Mm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};em.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};em.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;if(i>0&&(!c(n)||n.length!==i))throw new L("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)};em.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};em.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};em.prototype.removeSample=function(e){return this._property.removeSample(e)};em.prototype.removeSamples=function(e){this._property.removeSamples(e)};em.prototype.equals=function(e){return this===e||e instanceof em&&J.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var xa=em;var sii=_(T(),1);var Qni=_(T(),1),j7e={HORIZONTAL:0,VERTICAL:1},Sf=Object.freeze(j7e);var q7e=Sf.HORIZONTAL,$7e=Y.WHITE,e6e=Y.BLACK,t6e=0,n6e=1;function j1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(j1.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:fe("orientation"),evenColor:fe("evenColor"),oddColor:fe("oddColor"),offset:fe("offset"),repeat:fe("repeat")});j1.prototype.getType=function(e){return"Stripe"};var i6e=new ee;j1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(i6e)),c(t)||(t={}),t.horizontal=J.getValueOrDefault(this._orientation,e,q7e)===Sf.HORIZONTAL,t.evenColor=J.getValueOrClonedDefault(this._evenColor,e,$7e,t.evenColor),t.oddColor=J.getValueOrClonedDefault(this._oddColor,e,e6e,t.oddColor),t.offset=J.getValueOrDefault(this._offset,e,t6e),t.repeat=J.getValueOrDefault(this._repeat,e,n6e),t};j1.prototype.equals=function(e){return this===e||e instanceof j1&&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 q1=j1;var bii=_(T(),1);function $y(e){this._definitionChanged=new ye,this._intervals=new Yr,this._intervals.changedEvent.addEventListener($y.prototype._intervalsChanged,this),this._referenceFrame=e??Ui.FIXED}Object.defineProperties($y.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 o6e=new ee;$y.prototype.getValue=function(e,t){return c(e)||(e=ee.now(o6e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};$y.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._intervals.findDataForIntervalContainingDate(e);if(c(i))return Mm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};$y.prototype.equals=function(e){return this===e||e instanceof $y&&this._intervals.equals(e._intervals,J.equals)&&this._referenceFrame===e._referenceFrame};$y.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Hb=$y;var Cii=_(T(),1);function rT(){this._definitionChanged=new ye,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(rT.prototype._intervalsChanged,this)}Object.defineProperties(rT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var r6e=new ee;rT.prototype.getValue=function(e,t){c(e)||(e=ee.now(r6e));let n=this._intervals.findDataForIntervalContainingDate(e);return c(n)&&typeof n.clone=="function"?n.clone(t):n};rT.prototype.equals=function(e){return this===e||e instanceof rT&&this._intervals.equals(e._intervals,J.equals)};rT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var zb=rT;var Oii=_(T(),1);var Xii=_(T(),1);function $1(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new ye,this._normalize=t??!0,this.position=e}Object.defineProperties($1.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&&(c(t)&&this._subscription(),this._position=e,c(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 s6e=new m,mme=new m,fme=new ee,a6e=new ee,_J=1/60;$1.prototype.getValue=function(e,t){return this._getValue(e,t)};$1.prototype._getValue=function(e,t,n){c(e)||(e=ee.now(a6e)),c(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,s6e),r=i.getValue(ee.addSeconds(e,_J,fme),mme);if(!c(o)||!c(r)&&(r=o,o=i.getValue(ee.addSeconds(e,-_J,fme),mme),!c(o)))return;if(m.equals(o,r))return this._normalize?void 0:m.clone(m.ZERO,t);c(n)&&o.clone(n);let s=m.subtract(r,o,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,_J,t)};$1.prototype.equals=function(e){return this===e||e instanceof $1&&J.equals(this._position,e._position)};var Kb=$1;function n2(e,t){this._velocityVectorProperty=new Kb(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new ye,this.ellipsoid=t??re.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(n2.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 hme=new m,c6e=new m,pme=new te,l6e=new ee;n2.prototype.getValue=function(e,t){c(e)||(e=ee.now(l6e));let n=this._velocityVectorProperty._getValue(e,c6e,hme);if(c(n))return wt.rotationMatrixFromPositionVelocity(hme,n,this._ellipsoid,pme),Fe.fromRotationMatrix(pme,t)};n2.prototype.equals=function(e){return this===e||e instanceof n2&&J.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var i2=n2;var Yii=_(T(),1);var Jb={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Jb.validate=function(e){return e===Jb.COMPLETE||e===Jb.BELOW_ELLIPSOID_HORIZON||e===Jb.ABOVE_ELLIPSOID_HORIZON};Jb.toString=function(e){switch(e){case Jb.COMPLETE:return"COMPLETE";case Jb.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Jb.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new L("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var eV=Jb;function eg(){}eg.packedLength=m.packedLength;eg.unpack=m.unpack;eg.pack=m.pack;var TJ;function o2(e,t){return t[0]==="#"&&(t=TJ+t),Yb.fromString(e,t)}function bme(e,t,n){if(c(n.reference))return o2(t,n.reference);if(c(n.velocityReference)){let i=o2(t,n.velocityReference);switch(e){case m:case eg:return new Kb(i,e===eg);case Fe:return new i2(i)}}throw new le(`${JSON.stringify(n)} is not valid CZML.`)}function d6e(e,t){return new Om(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Yi=new m,rl=new t2,Lc=new pe,sT=new Zn,Dk=new Fe;function u6e(e){let t=e.rgbaf;if(c(t))return t;let n=e.rgba;if(!c(n))return;let i=n.length;if(i===Y.packedLength)return[Y.byteToFloat(n[0]),Y.byteToFloat(n[1]),Y.byteToFloat(n[2]),Y.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=Y.byteToFloat(n[o+1]),t[o+2]=Y.byteToFloat(n[o+2]),t[o+3]=Y.byteToFloat(n[o+3]),t[o+4]=Y.byteToFloat(n[o+4]);return t}function yme(e,t){let n=e.uri??e;return c(t)?t.getDerivedResource({url:n}):Ge.createIfNeeded(n)}function m6e(e){let t=e.wsen;if(c(t))return t;let n=e.wsenDegrees;if(!c(n))return;let i=n.length;if(i===de.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 f6e(e){let t=e.length;if(rl.magnitude=1,t===2)return rl.clock=e[0],rl.cone=e[1],m.fromSpherical(rl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],rl.clock=e[i+1],rl.cone=e[i+2],m.fromSpherical(rl,Yi),n[o+1]=Yi.x,n[o+2]=Yi.y,n[o+3]=Yi.z;return n}function h6e(e){let t=e.length;if(t===3)return rl.clock=e[0],rl.cone=e[1],rl.magnitude=e[2],m.fromSpherical(rl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],rl.clock=e[i+1],rl.cone=e[i+2],rl.magnitude=e[i+3],m.fromSpherical(rl,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function p6e(e){let t=e.length;if(t===3)return Lc.longitude=e[0],Lc.latitude=e[1],Lc.height=e[2],re.default.cartographicToCartesian(Lc,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Lc.longitude=e[i+1],Lc.latitude=e[i+2],Lc.height=e[i+3],re.default.cartographicToCartesian(Lc,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function b6e(e){let t=e.length;if(t===3)return Lc.longitude=w.toRadians(e[0]),Lc.latitude=w.toRadians(e[1]),Lc.height=e[2],re.default.cartographicToCartesian(Lc,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Lc.longitude=w.toRadians(e[i+1]),Lc.latitude=w.toRadians(e[i+2]),Lc.height=e[i+3],re.default.cartographicToCartesian(Lc,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function SJ(e){let t=e.cartesian;if(c(t))return t;let n=e.cartesianVelocity;if(c(n))return n;let i=e.unitCartesian;if(c(i))return i;let o=e.unitSpherical;if(c(o))return f6e(o);let r=e.spherical;if(c(r))return h6e(r);let s=e.cartographicRadians;if(c(s))return p6e(s);let a=e.cartographicDegrees;if(c(a))return b6e(a);throw new le(`${JSON.stringify(e)} is not a valid CZML interval.`)}function gme(e,t){m.unpack(e,t,Yi),m.normalize(Yi,Yi),m.pack(Yi,e,t)}function y6e(e){let t=SJ(e);if(t.length===3)return gme(t,0),t;for(let n=1;n<t.length;n+=4)gme(t,n);return t}function xme(e,t){Fe.unpack(e,t,Dk),Fe.normalize(Dk,Dk),Fe.pack(Dk,e,t)}function g6e(e){let t=e.unitQuaternion;if(c(t)){if(t.length===4)return xme(t,0),t;for(let n=1;n<t.length;n+=5)xme(t,n)}return t}function _me(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")?je:e.hasOwnProperty("cartesian2")?D:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?eg:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?Y:e.hasOwnProperty("arcType")?Kt:e.hasOwnProperty("classificationType")?Un:e.hasOwnProperty("colorBlendMode")?bc:e.hasOwnProperty("cornerType")?Fi:e.hasOwnProperty("heightReference")?ze:e.hasOwnProperty("horizontalOrigin")?xi:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?Yo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Nt:e.hasOwnProperty("distanceDisplayCondition")?vt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Fe:e.hasOwnProperty("shadowMode")?Sn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Sf:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?de:e.hasOwnProperty("uri")?s2.default:e.hasOwnProperty("verticalOrigin")?Mn:Object}function x6e(e,t,n){switch(e){case Kt:return Kt[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case je:return t.boundingRectangle;case D:return t.cartesian2;case m:return SJ(t);case eg:return y6e(t);case Y:return u6e(t);case Un:return Un[t.classificationType??t];case bc:return bc[t.colorBlendMode??t];case Fi:return Fi[t.cornerType??t];case ze:return ze[t.heightReference??t];case xi:return xi[t.horizontalOrigin??t];case Image:return yme(t,n);case ee:return ee.fromIso8601(t.date??t);case Yo:return Yo[t.labelStyle??t];case Number:return t.number??t;case Nt:return t.nearFarScalar;case vt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Fe:return g6e(t);case qu:return t.number??t;case eV:return eV[t.portionToDisplay??t];case Sn:return Sn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Sf:return Sf[t.stripeOrientation??t];case de:return m6e(t);case s2.default:return yme(t,n);case Mn:return Mn[t.verticalOrigin??t];default:throw new le(`Unknown CzmlDataSource interval type: ${e}`)}}var _6e={HERMITE:$P,LAGRANGE:e2,LINEAR:Qy};function Bk(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(c(n)||c(i))&&t.setInterpolationOptions({interpolationAlgorithm:_6e[n],interpolationDegree:i});let o=e.forwardExtrapolationType;c(o)&&(t.forwardExtrapolationType=ol[o]);let r=e.forwardExtrapolationDuration;c(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;c(s)&&(t.backwardExtrapolationType=ol[s]);let a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}var Tme={iso8601:void 0};function pr(e){if(c(e))return Tme.iso8601=e,Zn.fromIso8601(Tme)}function CJ(e){let t=Ye.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Sme(e){let t=new Sc;return t.intervals.addInterval(CJ(e)),t}function Cme(e){let t=new ya(e.referenceFrame);return t.intervals.addInterval(CJ(e)),t}function Yk(e,t,n,i,o,r,s){let a=pr(i.interval);c(o)&&(c(a)?a=Zn.intersect(a,o,sT):a=o);let l,d,u,f=!c(i.reference)&&!c(i.velocityReference),p=c(a)&&!a.equals(Ye.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Pme(t[n],a)}let y=!1;if(f){if(d=x6e(e,i,r),!c(d))return;l=e.packedLength??1,u=d.length??1,y=!c(i.array)&&typeof d!="string"&&u>l&&e!==Object}let h=typeof e.unpack=="function"&&e!==qu;if(!y&&!p){f?t[n]=new Qn(h?e.unpack(d,0):d):t[n]=bme(e,s,i);return}let g=t[n],x,S=i.epoch;if(c(S)&&(x=ee.fromIso8601(S)),y&&!p){g instanceof Fd||(t[n]=g=new Fd(e)),g.addSamplesPackedArray(d,x),Bk(i,g);return}let V;if(!y&&p){a=a.clone(),f?a.data=h?e.unpack(d,0):d:a.data=bme(e,s,i),c(g)||(t[n]=g=f?new zb:new Sc),f&&g instanceof zb?g.intervals.addInterval(a):g instanceof Sc?(f&&(a.data=new Qn(a.data)),g.intervals.addInterval(a)):(t[n]=g=Sme(g),f&&(a.data=new Qn(a.data)),g.intervals.addInterval(a));return}c(g)||(t[n]=g=new Sc),g instanceof Sc||(t[n]=g=Sme(g));let Z=g.intervals;V=Z.findInterval(a),(!c(V)||!(V.data instanceof Fd))&&(V=a.clone(),V.data=new Fd(e),Z.addInterval(V)),V.data.addSamplesPackedArray(d,x),Bk(i,V.data)}function Pme(e,t){if(e instanceof Fd){e.removeSamples(t);return}else if(e instanceof zb){e.intervals.removeInterval(t);return}else if(e instanceof Sc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Zn.intersect(n.get(i),t,sT);o.isEmpty||Pme(o.data,t)}n.removeInterval(t);return}}function Te(e,t,n,i,o,r,s){if(c(i))if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)Yk(e,t,n,i[a],o,r,s);else Yk(e,t,n,i,o,r,s)}function Vme(e,t,n,i,o,r){let s=pr(n.interval);c(i)&&(c(s)?s=Zn.intersect(s,i,sT):s=i);let a=c(n.cartesianVelocity)?1:0,l=m.packedLength*(a+1),d,u,f=!c(n.reference),p=c(s)&&!s.equals(Ye.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return vme(e[t],s)}let y,h=!1;if(f&&(c(n.referenceFrame)&&(y=Ui[n.referenceFrame]),y=y??Ui.FIXED,d=SJ(n),u=d.length??1,h=u>l),!h&&!p){f?e[t]=new Oc(m.unpack(d),y):e[t]=o2(r,n.reference);return}let g=e[t],x,S=n.epoch;if(c(S)&&(x=ee.fromIso8601(S)),h&&!p){(!(g instanceof xa)||c(y)&&g.referenceFrame!==y)&&(e[t]=g=new xa(y,a)),g.addSamplesPackedArray(d,x),Bk(n,g);return}let V;if(!h&&p){s=s.clone(),f?s.data=m.unpack(d):s.data=o2(r,n.reference),c(g)||(f?g=new Hb(y):g=new ya(y),e[t]=g),f&&g instanceof Hb&&c(y)&&g.referenceFrame===y?g.intervals.addInterval(s):g instanceof ya?(f&&(s.data=new Oc(s.data,y)),g.intervals.addInterval(s)):(e[t]=g=Cme(g),f&&(s.data=new Oc(s.data,y)),g.intervals.addInterval(s));return}c(g)?g instanceof ya||(e[t]=g=Cme(g)):e[t]=g=new ya(y);let Z=g.intervals;V=Z.findInterval(s),(!c(V)||!(V.data instanceof xa)||c(y)&&V.data.referenceFrame!==y)&&(V=s.clone(),V.data=new xa(y,a),Z.addInterval(V)),V.data.addSamplesPackedArray(d,x),Bk(n,V.data)}function vme(e,t){if(e instanceof xa){e.removeSamples(t);return}else if(e instanceof Hb){e.intervals.removeInterval(t);return}else if(e instanceof ya){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Zn.intersect(n.get(i),t,sT);o.isEmpty||vme(o.data,t)}n.removeInterval(t);return}}function Fme(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Vme(e,t,n[s],i,o,r);else Vme(e,t,n,i,o,r)}function Lme(e,t,n,i){c(n.references)?Hk(e,t,n.references,n.interval,i,Q1,Sc):(c(n.cartesian2)?n.array=D.unpackArray(n.cartesian2):c(n.cartesian)&&(n.array=D.unpackArray(n.cartesian)),c(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function Zme(e,t,n,i,o,r){let s=pr(n.interval);c(i)&&(c(s)?s=Zn.intersect(s,i,sT):s=i);let a=e[t],l,d;if(c(s)){a instanceof W1||(a=new W1,e[t]=a);let f=a.intervals;d=f.findInterval({start:s.start,stop:s.stop}),c(d)?l=d.data:(d=s.clone(),f.addInterval(d))}else l=a;let u;c(n.solidColor)?(l instanceof Ut||(l=new Ut),u=n.solidColor,Te(Y,l,"color",u.color,void 0,void 0,r)):c(n.grid)?(l instanceof O1||(l=new O1),u=n.grid,Te(Y,l,"color",u.color,void 0,o,r),Te(Number,l,"cellAlpha",u.cellAlpha,void 0,o,r),Te(D,l,"lineCount",u.lineCount,void 0,o,r),Te(D,l,"lineThickness",u.lineThickness,void 0,o,r),Te(D,l,"lineOffset",u.lineOffset,void 0,o,r)):c(n.image)?(l instanceof $0||(l=new $0),u=n.image,Te(Image,l,"image",u.image,void 0,o,r),Te(D,l,"repeat",u.repeat,void 0,o,r),Te(Y,l,"color",u.color,void 0,o,r),Te(Boolean,l,"transparent",u.transparent,void 0,o,r)):c(n.stripe)?(l instanceof q1||(l=new q1),u=n.stripe,Te(Sf,l,"orientation",u.orientation,void 0,o,r),Te(Y,l,"evenColor",u.evenColor,void 0,o,r),Te(Y,l,"oddColor",u.oddColor,void 0,o,r),Te(Number,l,"offset",u.offset,void 0,o,r),Te(Number,l,"repeat",u.repeat,void 0,o,r)):c(n.polylineOutline)?(l instanceof jy||(l=new jy),u=n.polylineOutline,Te(Y,l,"color",u.color,void 0,o,r),Te(Y,l,"outlineColor",u.outlineColor,void 0,o,r),Te(Number,l,"outlineWidth",u.outlineWidth,void 0,o,r)):c(n.polylineGlow)?(l instanceof K1||(l=new K1),u=n.polylineGlow,Te(Y,l,"color",u.color,void 0,o,r),Te(Number,l,"glowPower",u.glowPower,void 0,o,r),Te(Number,l,"taperPower",u.taperPower,void 0,o,r)):c(n.polylineArrow)?(l instanceof B1||(l=new B1),u=n.polylineArrow,Te(Y,l,"color",u.color,void 0,void 0,r)):c(n.polylineDash)?(l instanceof H1||(l=new H1),u=n.polylineDash,Te(Y,l,"color",u.color,void 0,void 0,r),Te(Y,l,"gapColor",u.gapColor,void 0,void 0,r),Te(Number,l,"dashLength",u.dashLength,void 0,o,r),Te(Number,l,"dashPattern",u.dashPattern,void 0,o,r)):c(n.checkerboard)&&(l instanceof X1||(l=new X1),u=n.checkerboard,Te(Y,l,"evenColor",u.evenColor,void 0,o,r),Te(Y,l,"oddColor",u.oddColor,void 0,o,r),Te(D,l,"repeat",u.repeat,void 0,o,r)),c(d)?d.data=l:e[t]=l}function Ad(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Zme(e,t,n[s],i,o,r);else Zme(e,t,n,i,o,r)}function T6e(e,t,n,i){let o=t.name;c(o)&&(e.name=t.name)}function S6e(e,t,n,i){let o=t.description;c(o)&&Te(String,e,"description",o,void 0,i,n)}function C6e(e,t,n,i){let o=t.position;c(o)&&Fme(e,"position",o,void 0,i,n)}function V6e(e,t,n,i){let o=t.viewFrom;c(o)&&Te(m,e,"viewFrom",o,void 0,i,n)}function L6e(e,t,n,i){let o=t.orientation;c(o)&&Te(Fe,e,"orientation",o,void 0,i,n)}function Z6e(e,t,n,i){let o=t.properties;if(c(o)){c(e.properties)||(e.properties=new Bc);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,l=s.length;a<l;++a)Yk(_me(s[a]),e.properties,r,s[a],void 0,i,n);else Yk(_me(s),e.properties,r,s,void 0,i,n)}}}function Hk(e,t,n,i,o,r,s){let a=n.map(function(l){return o2(o,l)});if(c(i)){i=pr(i);let l=e[t];if(!(l instanceof s)){let d=new s;d.intervals.addInterval(CJ(l)),e[t]=l=d}i.data=new r(a),l.intervals.addInterval(i)}else e[t]=new r(a)}function Rme(e,t,n,i){let o=n.references;c(o)?Hk(e,t,o,n.interval,i,Q1,Sc):Te(Array,e,t,n,void 0,void 0,i)}function Gme(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Rme(e,t,n[o],i);else Rme(e,t,n,i)}function Eme(e,t,n,i){let o=n.references;c(o)?Hk(e,t,o,n.interval,i,Bb,ya):(c(n.cartesian)?n.array=m.unpackArray(n.cartesian):c(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians,re.default):c(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees,re.default)),c(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function a2(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Eme(e,t,n[o],i);else Eme(e,t,n,i)}function R6e(e){return m.unpackArray(e)}function G6e(e){return m.fromRadiansArrayHeights(e,re.default)}function E6e(e){return m.fromDegreesArrayHeights(e,re.default)}function Xme(e,t,n,i){let o=n.references;if(c(o)){let r=o.map(function(s){let a={};return Hk(a,"positions",s,n.interval,i,Bb,ya),a.positions});e[t]=new Bb(r)}else c(n.cartesian)?n.array=n.cartesian.map(R6e):c(n.cartographicRadians)?n.array=n.cartographicRadians.map(G6e):c(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(E6e)),c(n.array)&&Te(Array,e,t,n,void 0,void 0,i)}function X6e(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Xme(e,t,n[o],i);else Xme(e,t,n,i)}function I6e(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Lme(e,t,n[o],i);else Lme(e,t,n,i)}function W6e(e,t,n,i){let o=t.availability;if(!c(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)c(r)||(r=new Yr),r.addInterval(pr(o[s]));else r=new Yr,r.addInterval(pr(o));e.availability=r}function w6e(e,t,n,i,o){c(t)&&Te(eg,e,"alignedAxis",t,n,i,o)}function P6e(e,t,n,i){let o=t.billboard;if(!c(o))return;let r=pr(o.interval),s=e.billboard;c(s)||(e.billboard=s=new cc),Te(Boolean,s,"show",o.show,r,i,n),Te(Image,s,"image",o.image,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(D,s,"pixelOffset",o.pixelOffset,r,i,n),Te(m,s,"eyeOffset",o.eyeOffset,r,i,n),Te(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"color",o.color,r,i,n),Te(qu,s,"rotation",o.rotation,r,i,n),w6e(s,o.alignedAxis,r,i,n),Te(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Nt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(je,s,"imageSubRegion",o.imageSubRegion,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function v6e(e,t,n,i){let o=t.box;if(!c(o))return;let r=pr(o.interval),s=e.box;c(s)||(e.box=s=new Nx),Te(Boolean,s,"show",o.show,r,i,n),Te(m,s,"dimensions",o.dimensions,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function F6e(e,t,n,i){let o=t.corridor;if(!c(o))return;let r=pr(o.interval),s=e.corridor;c(s)||(e.corridor=s=new Ux),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"positions",o.positions,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Fi,s,"cornerType",o.cornerType,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function A6e(e,t,n,i){let o=t.cylinder;if(!c(o))return;let r=pr(o.interval),s=e.cylinder;c(s)||(e.cylinder=s=new Ox),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"length",o.length,r,i,n),Te(Number,s,"topRadius",o.topRadius,r,i,n),Te(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Number,s,"slices",o.slices,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function M6e(e,t){let n=e.version;if(c(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new le("Cesium only supports CZML version 1.");t._version=n}}if(!c(t._version))throw new le("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;c(e.name)&&(i.name=e.name);let o=e.clock;if(c(o)){let r=i.clock;c(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function N6e(e,t,n,i){let o=t.ellipse;if(!c(o))return;let r=pr(o.interval),s=e.ellipse;c(s)||(e.ellipse=s=new Dx),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Te(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(qu,s,"rotation",o.rotation,r,i,n),Te(qu,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function k6e(e,t,n,i){let o=t.ellipsoid;if(!c(o))return;let r=pr(o.interval),s=e.ellipsoid;c(s)||(e.ellipsoid=s=new Bx),Te(Boolean,s,"show",o.show,r,i,n),Te(m,s,"radii",o.radii,r,i,n),Te(m,s,"innerRadii",o.innerRadii,r,i,n),Te(Number,s,"minimumClock",o.minimumClock,r,i,n),Te(Number,s,"maximumClock",o.maximumClock,r,i,n),Te(Number,s,"minimumCone",o.minimumCone,r,i,n),Te(Number,s,"maximumCone",o.maximumCone,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Te(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Te(Number,s,"subdivisions",o.subdivisions,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function U6e(e,t,n,i){let o=t.label;if(!c(o))return;let r=pr(o.interval),s=e.label;c(s)||(e.label=s=new Nm),Te(Boolean,s,"show",o.show,r,i,n),Te(String,s,"text",o.text,r,i,n),Te(String,s,"font",o.font,r,i,n),Te(Yo,s,"style",o.style,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(Boolean,s,"showBackground",o.showBackground,r,i,n),Te(Y,s,"backgroundColor",o.backgroundColor,r,i,n),Te(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),Te(D,s,"pixelOffset",o.pixelOffset,r,i,n),Te(m,s,"eyeOffset",o.eyeOffset,r,i,n),Te(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"fillColor",o.fillColor,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Nt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function O6e(e,t,n,i){let o=t.model;if(!c(o))return;let r=pr(o.interval),s=e.model;c(s)||(e.model=s=new Up),Te(Boolean,s,"show",o.show,r,i,n),Te(s2.default,s,"uri",o.gltf,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Te(Number,s,"maximumScale",o.maximumScale,r,i,n),Te(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Te(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Te(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"silhouetteColor",o.silhouetteColor,r,i,n),Te(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Te(Y,s,"color",o.color,r,i,n),Te(bc,s,"colorBlendMode",o.colorBlendMode,r,i,n),Te(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,l,d=o.nodeTransformations;if(c(d))if(Array.isArray(d))for(a=0,l=d.length;a<l;++a)Ime(s,d[a],r,i,n);else Ime(s,d,r,i,n);let u=o.articulations;if(c(u))if(Array.isArray(u))for(a=0,l=u.length;a<l;++a)Wme(s,u[a],r,i,n);else Wme(s,u,r,i,n)}function Ime(e,t,n,i,o){let r=pr(t.interval);c(n)&&(c(r)?r=Zn.intersect(r,n,sT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let l=0,d=a.length;l<d;++l){let u=a[l];if(u==="interval")continue;let f=t[u];if(!c(f))continue;c(s)||(e.nodeTransformations=s=new Bc),s.hasProperty(u)||s.addProperty(u);let p=s[u];c(p)||(s[u]=p=new Yx),Te(m,p,"translation",f.translation,r,i,o),Te(Fe,p,"rotation",f.rotation,r,i,o),Te(m,p,"scale",f.scale,r,i,o)}}function Wme(e,t,n,i,o){let r=pr(t.interval);c(n)&&(c(r)?r=Zn.intersect(r,n,sT):r=n);let s=e.articulations,a=Object.keys(t);for(let l=0,d=a.length;l<d;++l){let u=a[l];if(u==="interval")continue;let f=t[u];c(f)&&(c(s)||(e.articulations=s=new Bc),s.hasProperty(u)||s.addProperty(u),Te(Number,s,u,f,r,i,o))}}function D6e(e,t,n,i){let o=t.path;if(!c(o))return;let r=pr(o.interval),s=e.path;c(s)||(e.path=s=new Op),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"leadTime",o.leadTime,r,i,n),Te(Number,s,"trailTime",o.trailTime,r,i,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"resolution",o.resolution,r,i,n),Ad(s,"material",o.material,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function B6e(e,t,n,i){let o=t.point;if(!c(o))return;let r=pr(o.interval),s=e.point;c(s)||(e.point=s=new zx),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"pixelSize",o.pixelSize,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"color",o.color,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function r2(e){this.polygon=e,this._definitionChanged=new ye}Object.defineProperties(r2.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!c(e)||e.isConstant)&&(!c(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});r2.prototype.getValue=function(e,t){let n;c(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return c(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),c(i)&&(i=i.map(function(o){return new Fa(o)}))),c(t)?(t.positions=n,t.holes=i,t):new Fa(n,i)};r2.prototype.equals=function(e){return this===e||e instanceof r2&&J.equals(this.polygon._positions,e.polygon._positions)&&J.equals(this.polygon._holes,e.polygon._holes)};function Y6e(e,t,n,i){let o=t.polygon;if(!c(o))return;let r=pr(o.interval),s=e.polygon;c(s)||(e.polygon=s=new km),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"_positions",o.positions,n),X6e(s,"_holes",o.holes,n),(c(s._positions)||c(s._holes))&&(s.hierarchy=new r2(s)),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(qu,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Te(Boolean,s,"closeTop",o.closeTop,r,i,n),Te(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Te(Kt,s,"arcType",o.arcType,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function H6e(e){return e?Kt.GEODESIC:Kt.NONE}function z6e(e,t,n,i){let o=t.polyline;if(!c(o))return;let r=pr(o.interval),s=e.polyline;if(c(s)||(e.polyline=s=new uc),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"positions",o.positions,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Ad(s,"material",o.material,r,i,n),Ad(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Te(Kt,s,"arcType",o.arcType,r,i,n),Te(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n),c(o.followSurface)&&!c(o.arcType)){let a={};Te(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=d6e(a.followSurface,H6e)}}function K6e(e,t,n,i){let o=t.polylineVolume;if(!c(o))return;let r=pr(o.interval),s=e.polylineVolume;c(s)||(e.polylineVolume=s=new Kx),a2(s,"positions",o.positions,n),I6e(s,"shape",o.shape,n),Te(Boolean,s,"show",o.show,r,i,n),Te(Fi,s,"cornerType",o.cornerType,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function J6e(e,t,n,i){let o=t.rectangle;if(!c(o))return;let r=pr(o.interval),s=e.rectangle;c(s)||(e.rectangle=s=new Um),Te(Boolean,s,"show",o.show,r,i,n),Te(de,s,"coordinates",o.coordinates,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(qu,s,"rotation",o.rotation,r,i,n),Te(qu,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function Q6e(e,t,n,i){let o=t.tileset;if(!c(o))return;let r=pr(o.interval),s=e.tileset;c(s)||(e.tileset=s=new Hx),Te(Boolean,s,"show",o.show,r,i,n),Te(s2.default,s,"uri",o.uri,r,i,n),Te(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function j6e(e,t,n,i){let o=t.wall;if(!c(o))return;let r=pr(o.interval),s=e.wall;c(s)||(e.wall=s=new Dp),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"positions",o.positions,n),Gme(s,"minimumHeights",o.minimumHeights,n),Gme(s,"maximumHeights",o.maximumHeights,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function wme(e,t,n,i,o){let r=e.id;if(c(r)||(r=Hn()),TJ=r,!c(o._version)&&r!=="document")throw new le("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")M6e(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;c(a)&&(s.parent=t.getOrCreateEntity(a));for(let l=n.length-1;l>-1;l--)n[l](s,e,t,i)}TJ=void 0}function q6e(e){let t,n=e._documentPacket.clock;if(!c(n)){if(!c(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ye.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=ee.secondsDifference(s,r),l=Math.round(a/120);return t=new Tf,t.startTime=ee.clone(r),t.stopTime=ee.clone(s),t.clockRange=zr.LOOP_STOP,t.multiplier=l,t.currentTime=ee.clone(r),t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}c(e._clock)?t=e._clock.clone():(t=new Tf,t.startTime=Ye.MINIMUM_VALUE.clone(),t.stopTime=Ye.MAXIMUM_VALUE.clone(),t.currentTime=Ye.MINIMUM_VALUE.clone(),t.clockRange=zr.LOOP_STOP,t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=pr(n.interval);return c(i)&&(t.startTime=i.start,t.stopTime=i.stop),c(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),c(n.range)&&(t.clockRange=zr[n.range]??zr.LOOP_STOP),c(n.step)&&(t.clockStep=fo[n.step]??fo.SYSTEM_CLOCK_MULTIPLIER),c(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Ame(e,t,n,i){if(!c(t))throw new L("czml is required.");n=n??z.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 Ge){t=Ge.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,l=t.credits;if(c(l)){let d=l.length;for(let u=0;u<d;u++)a.push(l[u])}}return r=Ge.createIfNeeded(r),Hr.setLoading(e,!0),Promise.resolve(o).then(function(a){return $6e(e,a,r,i)}).catch(function(a){return Hr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function $6e(e,t,n,i){Hr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Mme,o.removeAll()),ys._processCzml(t,o,n,void 0,e);let r=q6e(e),s=e._documentPacket;return c(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!c(e._name)&&c(n)&&(e._name=Ob(n.getUrlComponent()),r=!0),Hr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function Mme(){this.name=void 0,this.clock=void 0}function ys(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._clock=void 0,this._documentPacket=new Mme,this._version=void 0,this._entityCollection=new Ks(this),this._entityCluster=new wd,this._credit=void 0,this._resourceCredits=[]}ys.load=function(e,t){return new ys().load(e,t)};Object.defineProperties(ys.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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});ys.updaters=[P6e,v6e,F6e,A6e,N6e,k6e,U6e,O6e,T6e,S6e,D6e,B6e,Y6e,z6e,K6e,Z6e,J6e,C6e,Q6e,V6e,j6e,L6e,W6e];ys.registerUpdater=function(e){ys.updaters.includes(e)||ys.updaters.push(e)};ys.unregisterUpdater=function(e){if(ys.updaters.includes(e)){let t=ys.updaters.indexOf(e);ys.updaters.splice(t,1)}};ys.prototype.process=function(e,t){return Ame(this,e,t,!1)};ys.prototype.load=function(e,t){return Ame(this,e,t,!0)};ys.prototype.update=function(e){return!0};ys.processPacketData=Te;ys.processPositionPacketData=Fme;ys.processMaterialPacketData=Ad;ys._processCzml=function(e,t,n,i,o){if(i=i??ys.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)wme(e[r],t,i,n,o);else wme(e,t,i,n,o)};var c2=ys;var Mri=_(T(),1);function sl(){this._dataSources=[],this._dataSourceAdded=new ye,this._dataSourceRemoved=new ye,this._dataSourceMoved=new ye}Object.defineProperties(sl.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}}});sl.prototype.add=function(e){if(!c(e))throw new L("dataSource is required.");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})};sl.prototype.remove=function(e,t){t=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};sl.prototype.removeAll=function(e){e=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=[]};sl.prototype.contains=function(e){return this.indexOf(e)!==-1};sl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};sl.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._dataSources[e]};sl.prototype.getByName=function(e){if(!c(e))throw new L("name is required.");return this._dataSources.filter(function(t){return t.name===e})};function zk(e,t){if(!c(t))throw new L("dataSource is required.");let n=e.indexOf(t);if(n===-1)throw new L("dataSource is not in this collection.");return n}function Nme(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)}sl.prototype.raise=function(e){let t=zk(this._dataSources,e);Nme(this,t,t+1)};sl.prototype.lower=function(e){let t=zk(this._dataSources,e);Nme(this,t,t-1)};sl.prototype.raiseToTop=function(e){let t=zk(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))};sl.prototype.lowerToBottom=function(e){let t=zk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};sl.prototype.isDestroyed=function(){return!1};sl.prototype.destroy=function(){return this.removeAll(!0),he(this)};var l2=sl;var Ugi=_(T(),1);var qri=_(T(),1);var Hri=_(T(),1);function _a(e){e=e??z.EMPTY_OBJECT,this._primitives=[],this._guid=Hn(),this._primitiveAdded=new ye,this._primitiveRemoved=new ye,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(_a.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});_a.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new L("primitive is required.");if(n){if(t<0)throw new L("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new L("index must be less than or equal to the number of primitives.")}let 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};_a.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};_a.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};_a.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=[]};_a.prototype.contains=function(e){return!!(c(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function Kk(e,t){if(!e.contains(t))throw new L("primitive is not in this collection.");return e._primitives.indexOf(t)}_a.prototype.raise=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};_a.prototype.raiseToTop=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};_a.prototype.lower=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};_a.prototype.lowerToBottom=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};_a.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._primitives[e]};_a.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};_a.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.prePassesUpdate)&&i.prePassesUpdate(e)}};_a.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];c(o.updateForPass)&&o.updateForPass(e,t)}};_a.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.postPassesUpdate)&&i.postPassesUpdate(e)}};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return this.removeAll(),he(this)};var al=_a;function wh(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(wh.prototype,{length:{get:function(){return this._length}}});wh.prototype.add=function(e,t){C.defined("primitive",e),c(t)&&C.typeOf.number("zIndex",t),t=t??0;let n=this._collections[t];if(!c(n)){n=new al({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};wh.prototype.set=function(e,t){return C.defined("primitive",e),C.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};wh.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};wh.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};wh.prototype.contains=function(e){if(!c(e))return!1;let t=this._collections[e._zIndex];return c(t)&&t.contains(e)};wh.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};wh.prototype.isDestroyed=function(){return!1};wh.prototype.destroy=function(){return this.removeAll(),he(this)};var d2=wh;var abi=_(T(),1);var isi=_(T(),1);function tV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Zt}tV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};tV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);c(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};tV.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};tV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};tV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),c(e)&&c(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var aT=tV;var bhi=_(T(),1);var Vai=_(T(),1);var Fsi=_(T(),1);var lsi=_(T(),1);var LJ={},Jk=new m,kme=new m,Ume=new Fe,Ome=new te;function nV(e,t,n,i,o,r,s,a,l,d){let u=e+t;m.multiplyByScalar(i,Math.cos(u),Jk),m.multiplyByScalar(n,Math.sin(u),kme),m.add(Jk,kme,Jk);let f=Math.cos(e);f=f*f;let p=Math.sin(e);p=p*p;let h=r/Math.sqrt(s*f+o*p)/a;return Fe.fromAxisAngle(Jk,h,Ume),te.fromQuaternion(Ume,Ome),te.multiplyByVector(Ome,l,d),m.normalize(d,d),m.multiplyByScalar(d,a,d),d}var Dme=new m,Bme=new m,VJ=new m,eqe=new m;LJ.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),l=e.length,d=n?l:0;for(let u=0;u<l;u+=3){let f=u+1,p=u+2,y=m.fromArray(e,u,Dme);i.scaleToGeodeticSurface(y,y);let h=m.clone(y,Bme),g=i.geodeticSurfaceNormal(y,eqe),x=m.multiplyByScalar(g,o,VJ);m.add(y,x,y),n&&(m.multiplyByScalar(g,r,x),m.add(h,x,h),a[u+d]=h.x,a[f+d]=h.y,a[p+d]=h.z),a[u]=y.x,a[f]=y.y,a[p]=y.z}return a};var tqe=new m,nqe=new m,iqe=new m;LJ.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,l=i*i,d=o*o,u=o*i,f=m.magnitude(s),p=m.normalize(s,tqe),y=m.cross(m.UNIT_Z,s,nqe);y=m.normalize(y,y);let h=m.cross(p,y,iqe),g=1+Math.ceil(w.PI_OVER_TWO/a),x=w.PI_OVER_TWO/(g-1),S=w.PI_OVER_TWO-g*x;S<0&&(g-=Math.ceil(Math.abs(S)/x));let V=2*(g*(g+2)),Z=t?new Array(V*3):void 0,R=0,E=Dme,I=Bme,v=g*4*3,P=v-1,F=0,N=n?new Array(v):void 0,b,G,X,W,A;for(S=w.PI_OVER_TWO,E=nV(S,r,h,y,l,u,d,f,p,E),t&&(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z),n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x),S=w.PI_OVER_TWO-x,b=1;b<g+1;++b){if(E=nV(S,r,h,y,l,u,d,f,p,E),I=nV(Math.PI-S,r,h,y,l,u,d,f,p,I),t){for(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z,X=2*b+2,G=1;G<X-1;++G)W=G/(X-1),A=m.lerp(E,I,W,VJ),Z[R++]=A.x,Z[R++]=A.y,Z[R++]=A.z;Z[R++]=I.x,Z[R++]=I.y,Z[R++]=I.z}n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x,N[F++]=I.x,N[F++]=I.y,N[F++]=I.z),S=w.PI_OVER_TWO-(b+1)*x}for(b=g;b>1;--b){if(S=w.PI_OVER_TWO-(b-1)*x,E=nV(-S,r,h,y,l,u,d,f,p,E),I=nV(S+Math.PI,r,h,y,l,u,d,f,p,I),t){for(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z,X=2*(b-1)+2,G=1;G<X-1;++G)W=G/(X-1),A=m.lerp(E,I,W,VJ),Z[R++]=A.x,Z[R++]=A.y,Z[R++]=A.z;Z[R++]=I.x,Z[R++]=I.y,Z[R++]=I.z}n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x,N[F++]=I.x,N[F++]=I.y,N[F++]=I.z)}S=w.PI_OVER_TWO,E=nV(-S,r,h,y,l,u,d,f,p,E);let k={};return t&&(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z,k.positions=Z,k.numPts=g),n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x,k.outerPositions=N),k};var Yl=LJ;var iV=new m,ZJ=new m,RJ=new m,Yme=new m,Es=new D,Hme=new te,oqe=new te,GJ=new Fe,zme=new m,Kme=new m,Jme=new m,qk=new pe,Qme=new m,jme=new D,qme=new D;function $me(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,l=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,f=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,y=i.tangent?new Float32Array(d*3):void 0,h=i.bitangent?new Float32Array(d*3):void 0,g=u?new Float32Array(d*3):void 0,x=0,S=zme,V=Kme,Z=Jme,R=new Xi(a),E=R.project(a.cartesianToCartographic(o,qk),Qme),I=a.scaleToGeodeticSurface(o,iV);a.geodeticSurfaceNormal(I,I);let v=Hme,P=oqe;if(l!==0){let A=Fe.fromAxisAngle(I,l,GJ);v=te.fromQuaternion(A,v),A=Fe.fromAxisAngle(I,-l,GJ),P=te.fromQuaternion(A,P)}else v=te.clone(te.IDENTITY,v),P=te.clone(te.IDENTITY,P);let F=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jme),N=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qme),b=e.length,G=n?b:0,X=G/3*2;for(let A=0;A<b;A+=3){let k=A+1,B=A+2,O=m.fromArray(e,A,iV);if(i.st){let H=te.multiplyByVector(v,O,ZJ),U=R.project(a.cartesianToCartographic(H,qk),RJ);m.subtract(U,E,U),Es.x=(U.x+r)/(2*r),Es.y=(U.y+s)/(2*s),F.x=Math.min(Es.x,F.x),F.y=Math.min(Es.y,F.y),N.x=Math.max(Es.x,N.x),N.y=Math.max(Es.y,N.y),n&&(f[x+X]=Es.x,f[x+1+X]=Es.y),f[x++]=Es.x,f[x++]=Es.y}(i.normal||i.tangent||i.bitangent||u)&&(S=a.geodeticSurfaceNormal(O,S),u&&(g[A+G]=-S.x,g[k+G]=-S.y,g[B+G]=-S.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=m.normalize(m.cross(m.UNIT_Z,S,V),V),te.multiplyByVector(P,V,V)),i.normal&&(p[A]=S.x,p[k]=S.y,p[B]=S.z,n&&(p[A+G]=-S.x,p[k+G]=-S.y,p[B+G]=-S.z)),i.tangent&&(y[A]=V.x,y[k]=V.y,y[B]=V.z,n&&(y[A+G]=-V.x,y[k+G]=-V.y,y[B+G]=-V.z)),i.bitangent&&(Z=m.normalize(m.cross(S,V,Z),Z),h[A]=Z.x,h[k]=Z.y,h[B]=Z.z,n&&(h[A+G]=Z.x,h[k+G]=Z.y,h[B+G]=Z.z))))}if(i.st){b=f.length;for(let A=0;A<b;A+=2)f[A]=(f[A]-F.x)/(N.x-F.x),f[A+1]=(f[A+1]-F.y)/(N.y-F.y)}let W=new fn;if(i.position){let A=Yl.raisePositionsToHeight(e,t,n);W.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:A})}if(i.st&&(W.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:f})),i.normal&&(W.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(W.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),i.bitangent&&(W.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),u&&(W.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),n&&c(t.offsetAttribute)){let A=new Uint8Array(d);if(t.offsetAttribute===$t.TOP)A=A.fill(1,0,d/2);else{let k=t.offsetAttribute===$t.NONE?0:1;A=A.fill(k)}W.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return W}function efe(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 cT=new m;function rqe(e){let t=e.center;cT=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,cT),e.height,cT),cT=m.add(t,cT,cT);let n=new ue(cT,e.semiMajorAxis),i=Yl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=$me(o,e,!1),a=efe(r);return a=Me.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function sqe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,l=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,f=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,y=n.normal?new Float32Array(u*3):void 0,h=n.tangent?new Float32Array(u*3):void 0,g=n.bitangent?new Float32Array(u*3):void 0,x=t.shadowVolume,S=x?new Float32Array(u*3):void 0,V=0,Z=zme,R=Kme,E=Jme,I=new Xi(s),v=I.project(s.cartesianToCartographic(i,qk),Qme),P=s.scaleToGeodeticSurface(i,iV);s.geodeticSurfaceNormal(P,P);let F=Fe.fromAxisAngle(P,d,GJ),N=te.fromQuaternion(F,Hme),b=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jme),G=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qme),X=e.length,W=X/3*2;for(let k=0;k<X;k+=3){let B=k+1,O=k+2,H=m.fromArray(e,k,iV),U;if(n.st){let Q=te.multiplyByVector(N,H,ZJ),ie=I.project(s.cartesianToCartographic(Q,qk),RJ);m.subtract(ie,v,ie),Es.x=(ie.x+o)/(2*o),Es.y=(ie.y+r)/(2*r),b.x=Math.min(Es.x,b.x),b.y=Math.min(Es.y,b.y),G.x=Math.max(Es.x,G.x),G.y=Math.max(Es.y,G.y),p[V+W]=Es.x,p[V+1+W]=Es.y,p[V++]=Es.x,p[V++]=Es.y}H=s.scaleToGeodeticSurface(H,H),U=m.clone(H,ZJ),Z=s.geodeticSurfaceNormal(H,Z),x&&(S[k+X]=-Z.x,S[B+X]=-Z.y,S[O+X]=-Z.z);let K=m.multiplyByScalar(Z,a,Yme);if(H=m.add(H,K,H),K=m.multiplyByScalar(Z,l,K),U=m.add(U,K,U),n.position&&(f[k+X]=U.x,f[B+X]=U.y,f[O+X]=U.z,f[k]=H.x,f[B]=H.y,f[O]=H.z),n.normal||n.tangent||n.bitangent){E=m.clone(Z,E);let Q=m.fromArray(e,(k+3)%X,Yme);m.subtract(Q,H,Q);let ie=m.subtract(U,H,RJ);Z=m.normalize(m.cross(ie,Q,Z),Z),n.normal&&(y[k]=Z.x,y[B]=Z.y,y[O]=Z.z,y[k+X]=Z.x,y[B+X]=Z.y,y[O+X]=Z.z),n.tangent&&(R=m.normalize(m.cross(E,Z,R),R),h[k]=R.x,h[B]=R.y,h[O]=R.z,h[k+X]=R.x,h[k+1+X]=R.y,h[k+2+X]=R.z),n.bitangent&&(g[k]=E.x,g[B]=E.y,g[O]=E.z,g[k+X]=E.x,g[B+X]=E.y,g[O+X]=E.z)}}if(n.st){X=p.length;for(let k=0;k<X;k+=2)p[k]=(p[k]-b.x)/(G.x-b.x),p[k+1]=(p[k+1]-b.y)/(G.y-b.y)}let A=new fn;if(n.position&&(A.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})),n.st&&(A.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(A.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),n.tangent&&(A.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(A.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),x&&(A.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:S})),c(t.offsetAttribute)){let k=new Uint8Array(u);if(t.offsetAttribute===$t.TOP)k=k.fill(1,0,u/2);else{let B=t.offsetAttribute===$t.NONE?0:1;k=k.fill(B)}A.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return A}function aqe(e){let t=e.length/3,n=Me.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,l=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=l}return n}var Qk=new ue,jk=new ue;function cqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,iV),e.height,iV);Qk.center=m.add(t,o,Qk.center),Qk.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),jk.center=m.add(t,o,jk.center),jk.radius=i;let r=Yl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,l=r.outerPositions,d=ue.union(Qk,jk),u=$me(s,e,!0),f=efe(a),p=f.length;f.length=p*2;let y=s.length/3;for(let R=0;R<p;R+=3)f[R+p]=f[R+2]+y,f[R+1+p]=f[R+1]+y,f[R+2+p]=f[R]+y;let h=Me.createTypedArray(y*2/3,f),g=new dt({attributes:u,indices:h,primitiveType:ve.TRIANGLES}),x=sqe(l,e);f=aqe(l);let S=Me.createTypedArray(l.length*2/3,f),V=new dt({attributes:x,indices:S,primitiveType:ve.TRIANGLES}),Z=An.combineInstances([new Rt({geometry:g}),new Rt({geometry:V})]);return{boundingSphere:d,attributes:Z[0].attributes,indices:Z[0].indices}}function tfe(e,t,n,i,o,r,s){let l=Yl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=l.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=m.fromArray(l,p*3);let f=de.fromCartesianArray(u,r,s);return f.width>w.PI&&(f.north=f.north>0?w.PI_OVER_TWO-w.EPSILON7:f.north,f.south=f.south<0?w.EPSILON7-w.PI_OVER_TWO:f.south,f.east=w.PI,f.west=-w.PI),f}function vh(e){e=e??z.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??re.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE,s=e.vertexFormat??We.DEFAULT;if(C.defined("options.center",t),C.typeOf.number("options.semiMajorAxis",i),C.typeOf.number("options.semiMinorAxis",o),i<o)throw new L("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new L("granularity must be greater than zero.");let a=e.height??0,l=e.extrudedHeight??a;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=re.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(l,a),this._granularity=r,this._vertexFormat=We.clone(s),this._extrudedHeight=Math.min(l,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}vh.packedLength=m.packedLength+re.packedLength+We.packedLength+9;vh.pack=function(e,t,n){return C.defined("value",e),C.defined("array",t),n=n??0,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.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]=e._offsetAttribute??-1,t};var nfe=new m,ife=new re,ofe=new We,Ph={center:nfe,ellipsoid:ife,vertexFormat:ofe,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};vh.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t,nfe);t+=m.packedLength;let o=re.unpack(e,t,ife);t+=re.packedLength;let r=We.unpack(e,t,ofe);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t++],y=e[t++]===1,h=e[t];return c(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=l,n._stRotation=d,n._height=u,n._granularity=f,n._extrudedHeight=p,n._shadowVolume=y,n._offsetAttribute=h===-1?void 0:h,n):(Ph.height=u,Ph.extrudedHeight=p,Ph.granularity=f,Ph.stRotation=d,Ph.rotation=l,Ph.semiMajorAxis=s,Ph.semiMinorAxis=a,Ph.shadowVolume=y,Ph.offsetAttribute=h===-1?void 0:h,new vh(Ph))};vh.computeRectangle=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??re.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??w.RADIANS_PER_DEGREE,a=e.rotation??0;if(C.defined("options.center",n),C.typeOf.number("options.semiMajorAxis",o),C.typeOf.number("options.semiMinorAxis",r),o<r)throw new L("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(s<=0)throw new L("granularity must be greater than zero.");return tfe(n,o,r,a,s,i,t)};vh.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=cqe(o);else if(r=rqe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===$t.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:ve.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};vh.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new vh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};function lqe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Yl.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 l=0;l<o;++l)r[l]=m.fromArray(i,l*3);let s=e._ellipsoid,a=e.rectangle;return dt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(vh.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=tfe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=lqe(this)),this._textureCoordinateRotationPoints}}});var cl=vh;var $si=_(T(),1);var rfe=new m,lT=new m;function dqe(e){let t=e.center;lT=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,lT),e.height,lT),lT=m.add(t,lT,lT);let n=new ue(lT,e.semiMajorAxis),i=Yl.computeEllipsePositions(e,!1,!0).outerPositions,o=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:Yl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Me.createTypedArray(r,r*2),a=0;for(let l=0;l<r;++l)s[a++]=l,s[a++]=(l+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var $k=new ue,eU=new ue;function uqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,rfe),e.height,rfe);$k.center=m.add(t,o,$k.center),$k.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),eU.center=m.add(t,o,eU.center),eU.radius=i;let r=Yl.computeEllipsePositions(e,!1,!0).outerPositions,s=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:Yl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ue.union($k,eU),l=r.length/3;if(c(e.offsetAttribute)){let h=new Uint8Array(l);if(e.offsetAttribute===$t.TOP)h=h.fill(1,0,l/2);else{let g=e.offsetAttribute===$t.NONE?0:1;h=h.fill(g)}s.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}let d=e.numberOfVerticalLines??16;d=w.clamp(d,0,l/2);let u=Me.createTypedArray(l,l*2+d*2);l/=2;let f=0,p;for(p=0;p<l;++p)u[f++]=p,u[f++]=(p+1)%l,u[f++]=p+l,u[f++]=(p+1)%l+l;let y;if(d>0){let h=Math.min(d,l);y=Math.round(l/h);let g=Math.min(y*d,l);for(p=0;p<g;p+=y)u[f++]=p,u[f++]=p+l}return{boundingSphere:a,attributes:s,indices:u}}function oV(e){e=e??z.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??re.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!c(t))throw new L("center is required.");if(!c(i))throw new L("semiMajorAxis is required.");if(!c(o))throw new L("semiMinorAxis is required.");if(i<o)throw new L("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new L("granularity must be greater than zero.");let s=e.height??0,a=e.extrudedHeight??s;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=re.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}oV.packedLength=m.packedLength+re.packedLength+8;oV.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.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]=e._offsetAttribute??-1,t};var sfe=new m,afe=new re,Qb={center:sfe,ellipsoid:afe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};oV.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=m.unpack(e,t,sfe);t+=m.packedLength;let o=re.unpack(e,t,afe);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t];return c(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=l,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=f,n._offsetAttribute=p===-1?void 0:p,n):(Qb.height=l,Qb.extrudedHeight=u,Qb.granularity=d,Qb.rotation=a,Qb.semiMajorAxis=r,Qb.semiMinorAxis=s,Qb.numberOfVerticalLines=f,Qb.offsetAttribute=p===-1?void 0:p,new oV(Qb))};oV.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=uqe(o);else if(r=dqe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===$t.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:ve.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Md=oV;var cfe=new Y,lfe=m.ZERO,dfe=new m,ufe=new de;function mqe(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 Cf(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new mqe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}c(Object.create)&&(Cf.prototype=Object.create(Yn.prototype),Cf.prototype.constructor=Cf);Cf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,cfe)),c(o)||(o=Y.WHITE),i.color=Yt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,lfe,dfe))),new Rt({id:t,geometry:new cl(this._options),attributes:i})};Cf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,cfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,lfe,dfe))),new Rt({id:t,geometry:new Md(this._options),attributes:r})};Cf.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Cf.prototype._isHidden=function(e,t){let n=e.position;return!c(n)||!c(t.semiMajorAxis)||!c(t.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t)};Cf.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 Ut)};Cf.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ye.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ye.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ye.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=J.getValueOrUndefined(t.rotation,Ye.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),s.stRotation=J.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),s.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Ye.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=ui.getMinimumMaximumHeights(cl.computeRectangle(s,ufe)).minimumTerrainHeight),s.extrudedHeight=o};Cf.DynamicGeometryUpdater=rV;function rV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(rV.prototype=Object.create(ii.prototype),rV.prototype.constructor=rV);rV.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.center)||!c(i.semiMajorAxis)||!c(i.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t,n)};rV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,ze.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);c(s)&&!c(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=ui.getMinimumMaximumHeights(cl.computeRectangle(i,ufe)).minimumTerrainHeight),i.extrudedHeight=s};var u2=Cf;var bci=_(T(),1);var Oai=_(T(),1);var fqe=new m,hqe=new m,pqe=new m,bqe=new m,yqe=new m,gqe=new m(1,1,1),mfe=Math.cos,ffe=Math.sin;function jb(e){e=e??z.EMPTY_OBJECT;let t=e.radii??gqe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??w.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??w.PI,a=Math.round(e.stackPartitions??64),l=Math.round(e.slicePartitions??64),d=e.vertexFormat??We.DEFAULT;if(l<3)throw new L("options.slicePartitions cannot be less than three.");if(a<3)throw new L("options.stackPartitions cannot be less than three.");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=l,this._vertexFormat=We.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}jb.packedLength=2*m.packedLength+We.packedLength+7;jb.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,We.pack(e._vertexFormat,t,n),n+=We.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._offsetAttribute??-1,t};var hfe=new m,pfe=new m,bfe=new We,tg={radii:hfe,innerRadii:pfe,vertexFormat:bfe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};jb.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=m.unpack(e,t,hfe);t+=m.packedLength;let o=m.unpack(e,t,pfe);t+=m.packedLength;let r=We.unpack(e,t,bfe);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t];return c(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._vertexFormat=We.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=l,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=f,n._offsetAttribute=p===-1?void 0:p,n):(tg.minimumClock=s,tg.maximumClock=a,tg.minimumCone=l,tg.maximumCone=d,tg.stackPartitions=u,tg.slicePartitions=f,tg.offsetAttribute=p===-1?void 0:p,new jb(tg))};jb.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,l=e._slicePartitions+1,d=e._stackPartitions+1;l=Math.round(l*Math.abs(o-i)/w.TWO_PI),d=Math.round(d*Math.abs(s-r)/w.PI),l<2&&(l=2),d<2&&(d=2);let u,f,p=0,y=[r],h=[i];for(u=0;u<d;u++)y.push(r+u*(s-r)/(d-1));for(y.push(s),f=0;f<l;f++)h.push(i+f*(o-i)/(l-1));h.push(o);let g=y.length,x=h.length,S=0,V=1,Z=n.x!==t.x||n.y!==t.y||n.z!==t.z,R=!1,E=!1,I=!1;Z&&(V=2,r>0&&(R=!0,S+=l-1),s<Math.PI&&(E=!0,S+=l-1),(o-i)%w.TWO_PI?(I=!0,S+=(d-1)*2+1):S+=1);let v=x*g*V,P=new Float64Array(v*3),F=new Array(v).fill(!1),N=new Array(v).fill(!1),b=l*d*V,G=6*(b+S+1-(l+d)*V),X=Me.createTypedArray(b,G),W=a.normal?new Float32Array(v*3):void 0,A=a.tangent?new Float32Array(v*3):void 0,k=a.bitangent?new Float32Array(v*3):void 0,B=a.st?new Float32Array(v*2):void 0,O=new Array(g),H=new Array(g);for(u=0;u<g;u++)O[u]=ffe(y[u]),H[u]=mfe(y[u]);let U=new Array(x),K=new Array(x);for(f=0;f<x;f++)K[f]=mfe(h[f]),U[f]=ffe(h[f]);for(u=0;u<g;u++)for(f=0;f<x;f++)P[p++]=t.x*O[u]*K[f],P[p++]=t.y*O[u]*U[f],P[p++]=t.z*H[u];let Q=v/2;if(Z)for(u=0;u<g;u++)for(f=0;f<x;f++)P[p++]=n.x*O[u]*K[f],P[p++]=n.y*O[u]*U[f],P[p++]=n.z*H[u],F[Q]=!0,u>0&&u!==g-1&&f!==0&&f!==x-1&&(N[Q]=!0),Q++;p=0;let ie,j;for(u=1;u<g-2;u++)for(ie=u*x,j=(u+1)*x,f=1;f<x-2;f++)X[p++]=j+f,X[p++]=j+f+1,X[p++]=ie+f+1,X[p++]=j+f,X[p++]=ie+f+1,X[p++]=ie+f;if(Z){let rt=g*x;for(u=1;u<g-2;u++)for(ie=rt+u*x,j=rt+(u+1)*x,f=1;f<x-2;f++)X[p++]=j+f,X[p++]=ie+f,X[p++]=ie+f+1,X[p++]=j+f,X[p++]=ie+f+1,X[p++]=j+f+1}let $,ne;if(Z){if(R)for(ne=g*x,u=1;u<x-2;u++)X[p++]=u,X[p++]=u+1,X[p++]=ne+u+1,X[p++]=u,X[p++]=ne+u+1,X[p++]=ne+u;if(E)for($=g*x-x,ne=g*x*V-x,u=1;u<x-2;u++)X[p++]=$+u+1,X[p++]=$+u,X[p++]=ne+u,X[p++]=$+u+1,X[p++]=ne+u,X[p++]=ne+u+1}if(I){for(u=1;u<g-2;u++)ne=x*g+x*u,$=x*u,X[p++]=ne,X[p++]=$+x,X[p++]=$,X[p++]=ne,X[p++]=ne+x,X[p++]=$+x;for(u=1;u<g-2;u++)ne=x*g+x*(u+1)-1,$=x*(u+1)-1,X[p++]=$+x,X[p++]=ne,X[p++]=$,X[p++]=$+x,X[p++]=ne+x,X[p++]=ne}let be=new fn;a.position&&(be.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:P}));let Ce=0,me=0,_e=0,Ve=0,Ie=v/2,Ze,De=re.fromCartesian3(t),Ke=re.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<v;u++){Ze=F[u]?Ke:De;let rt=m.fromArray(P,u*3,fqe),Xt=Ze.geodeticSurfaceNormal(rt,hqe);if(N[u]&&m.negate(Xt,Xt),a.st){let Ht=D.negate(Xt,yqe);B[Ce++]=Math.atan2(Ht.y,Ht.x)/w.TWO_PI+.5,B[Ce++]=Math.asin(Xt.z)/Math.PI+.5}if(a.normal&&(W[me++]=Xt.x,W[me++]=Xt.y,W[me++]=Xt.z),a.tangent||a.bitangent){let Ht=pqe,qe=0,mn;if(F[u]&&(qe=Ie),!R&&u>=qe&&u<qe+x*2?mn=m.UNIT_X:mn=m.UNIT_Z,m.cross(mn,Xt,Ht),m.normalize(Ht,Ht),a.tangent&&(A[_e++]=Ht.x,A[_e++]=Ht.y,A[_e++]=Ht.z),a.bitangent){let Dt=m.cross(Xt,Ht,bqe);m.normalize(Dt,Dt),k[Ve++]=Dt.x,k[Ve++]=Dt.y,k[Ve++]=Dt.z}}}a.st&&(be.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:B})),a.normal&&(be.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:W})),a.tangent&&(be.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A})),a.bitangent&&(be.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:k}))}if(c(e._offsetAttribute)){let rt=P.length,Xt=e._offsetAttribute===$t.NONE?0:1,Ht=new Uint8Array(rt/3).fill(Xt);be.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ht})}return new dt({attributes:be,indices:X,primitiveType:ve.TRIANGLES,boundingSphere:ue.fromEllipsoid(De),offsetAttribute:e._offsetAttribute})};var EJ;jb.getUnitEllipsoid=function(){return c(EJ)||(EJ=jb.createGeometry(new jb({radii:new m(1,1,1),vertexFormat:We.POSITION_ONLY}))),EJ};var Js=jb;var xqe=new Ut(Y.WHITE),XJ=m.ZERO,IJ=new m,_qe=new m,Tqe=new m,WJ=new Y,Sqe=new m(1,1,1);function Cqe(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 Nd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Cqe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}c(Object.create)&&(Nd.prototype=Object.create(oi.prototype),Nd.prototype.constructor=Nd);Object.defineProperties(Nd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Nd.prototype.createFillGeometryInstance=function(e,t,n){C.defined("time",e);let i=this._entity,o=i.isAvailable(e),r,s=new Tn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),l=kn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:l,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let u;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,WJ)),c(u)||(u=Y.WHITE),r=Yt.fromColor(u),d.color=r}return c(this._options.offsetAttribute)&&(d.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,XJ,IJ))),new Rt({id:i,geometry:new Js(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};Nd.prototype.createOutlineGeometryInstance=function(e,t,n){C.defined("time",e);let i=this._entity,o=i.isAvailable(e),r=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,WJ),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Tn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return c(this._options.offsetAttribute)&&(a.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,XJ,IJ))),new Rt({id:i,geometry:new Id(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Nd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Nd.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.radii)||oi.prototype._isHidden.call(this,e,t)};Nd.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)};Nd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ye.MINIMUM_VALUE,i.radii),i.innerRadii=J.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=J.getValueOrUndefined(t.minimumClock,Ye.MINIMUM_VALUE),i.maximumClock=J.getValueOrUndefined(t.maximumClock,Ye.MINIMUM_VALUE),i.minimumCone=J.getValueOrUndefined(t.minimumCone,Ye.MINIMUM_VALUE),i.maximumCone=J.getValueOrUndefined(t.maximumCone,Ye.MINIMUM_VALUE),i.stackPartitions=J.getValueOrUndefined(t.stackPartitions,Ye.MINIMUM_VALUE),i.slicePartitions=J.getValueOrUndefined(t.slicePartitions,Ye.MINIMUM_VALUE),i.subdivisions=J.getValueOrUndefined(t.subdivisions,Ye.MINIMUM_VALUE),i.offsetAttribute=n!==ze.NONE?$t.ALL:void 0};Nd.prototype._onEntityPropertyChanged=Bp;Nd.DynamicGeometryUpdater=m2;function m2(e,t,n){ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,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={}}c(Object.create)&&(m2.prototype=Object.create(ii.prototype),m2.prototype.constructor=m2);m2.prototype.update=function(e){C.defined("time",e);let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!J.getValueOrDefault(n.show,e,!0)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=J.getValueOrUndefined(n.radii,e,_qe),o=c(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!c(o)||!c(i)){c(this._primitive)&&(this._primitive.show=!1),c(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,Y.BLACK,WJ),l=qo.getValue(e,n.material??xqe,this._material),d=J.getValueOrUndefined(n.innerRadii,e,Tqe),u=J.getValueOrUndefined(n.minimumClock,e),f=J.getValueOrUndefined(n.maximumClock,e),p=J.getValueOrUndefined(n.minimumCone,e),y=J.getValueOrUndefined(n.maximumCone,e),h=J.getValueOrUndefined(n.stackPartitions,e),g=J.getValueOrUndefined(n.slicePartitions,e),x=J.getValueOrUndefined(n.subdivisions,e),S=J.getValueOrDefault(n.outlineWidth,e,1),V=J.getValueOrDefault(n.heightReference,e,ze.NONE),Z=V!==ze.NONE?$t.ALL:void 0,R=this._scene.mode,E=R===se.SCENE3D&&V===ze.NONE,I=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),F=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=J.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,XJ,IJ);if(!E||this._lastSceneMode!==R||!c(this._primitive)||I.stackPartitions!==h||I.slicePartitions!==g||c(d)&&!m.equals(I.innerRadii!==d)||I.minimumClock!==u||I.maximumClock!==f||I.minimumCone!==p||I.maximumCone!==y||I.subdivisions!==x||this._lastOutlineWidth!==S||I.offsetAttribute!==Z){let G=this._primitives;G.removeAndDestroy(this._primitive),G.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=S,I.stackPartitions=h,I.slicePartitions=g,I.subdivisions=x,I.offsetAttribute=Z,I.radii=m.clone(E?Sqe:i,I.radii),c(d)?E?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=f,I.minimumCone=p,I.maximumCone=y;let X=new so({material:l,translucent:l.isTranslucent(),closed:!0});I.vertexFormat=X.vertexFormat;let W=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=G.add(new In({geometryInstances:W,appearance:X,asynchronous:!1,shadows:v}));let A=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=G.add(new In({geometryInstances:A,appearance:new an({flat:!0,translucent:A.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(S)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=Y.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=F,this._lastOffset=m.clone(N,this._lastOffset)}else if(this._primitive.ready){let G=this._primitive,X=this._outlinePrimitive;G.show=!0,X.show=!0,G.appearance.material=l;let W=this._attributes;c(W)||(W=G.getGeometryInstanceAttributes(t),this._attributes=W),r!==this._lastShow&&(W.show=Tn.toValue(r,W.show),this._lastShow=r);let A=this._outlineAttributes;c(A)||(A=X.getGeometryInstanceAttributes(t),this._outlineAttributes=A),s!==this._lastOutlineShow&&(A.show=Tn.toValue(s,A.show),this._lastOutlineShow=s),Y.equals(a,this._lastOutlineColor)||(A.color=Yt.toValue(a,A.color),Y.clone(a,this._lastOutlineColor)),vt.equals(F,this._lastDistanceDisplayCondition)||(W.distanceDisplayCondition=kn.toValue(F,W.distanceDisplayCondition),A.distanceDisplayCondition=kn.toValue(F,A.distanceDisplayCondition),vt.clone(F,this._lastDistanceDisplayCondition)),m.equals(N,this._lastOffset)||(W.offset=$i.toValue(N,W.offset),A.offset=$i.toValue(N,W.offset),m.clone(N,this._lastOffset))}E&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=M.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var f2=Nd;var lli=_(T(),1);var Eci=_(T(),1);function sV(e){e=e??z.EMPTY_OBJECT;let t=e.vertexFormat??We.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}sV.packedLength=We.packedLength;sV.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,We.pack(e._vertexFormat,t,n),t};var yfe=new We,Vqe={vertexFormat:yfe};sV.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=We.unpack(e,t,yfe);return c(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n):new sV(Vqe)};var tU=new m(-.5,-.5,0),nU=new m(.5,.5,0);sV.createGeometry=function(e){let t=e._vertexFormat,n=new fn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=tU.x,o[1]=tU.y,o[2]=0,o[3]=nU.x,o[4]=tU.y,o[5]=0,o[6]=nU.x,o[7]=nU.y,o[8]=0,o[9]=tU.x,o[10]=nU.y,o[11]=0,n.position=new Ee({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 Ee({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 Ee({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 Ee({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 Ee({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 dt({attributes:n,indices:i,primitiveType:ve.TRIANGLES,boundingSphere:new ue(m.ZERO,Math.sqrt(2))})};var h2=sV;var kci=_(T(),1);function aV(){this._workerName="createPlaneOutlineGeometry"}aV.packedLength=0;aV.pack=function(e,t){return C.defined("value",e),C.defined("array",t),t};aV.unpack=function(e,t,n){return C.defined("array",e),c(n)?n:new aV};var ng=new m(-.5,-.5,0),iU=new m(.5,.5,0);aV.createGeometry=function(){let e=new fn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=ng.x,n[1]=ng.y,n[2]=ng.z,n[3]=iU.x,n[4]=ng.y,n[5]=ng.z,n[6]=iU.x,n[7]=iU.y,n[8]=ng.z,n[9]=ng.x,n[10]=iU.y,n[11]=ng.z,e.position=new Ee({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 dt({attributes:e,indices:t,primitiveType:ve.LINES,boundingSphere:new ue(m.ZERO,Math.sqrt(2))})};var p2=aV;var Lqe=new m,gfe=new Y;function Zqe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function tm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Zqe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}c(Object.create)&&(tm.prototype=Object.create(oi.prototype),tm.prototype.constructor=tm);tm.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let y;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(y=this._materialProperty.color.getValue(e,gfe)),c(y)||(y=Y.WHITE),o=Yt.fromColor(y),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let l=t.plane,d=this._options,u=t.computeModelMatrix(e),f=J.getValueOrDefault(l.plane,e,d.plane),p=J.getValueOrUndefined(l.dimensions,e,d.dimensions);return d.plane=f,d.dimensions=p,u=wJ(f,p,u,u),new Rt({id:t,geometry:new h2(this._options),modelMatrix:u,attributes:i})};tm.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,gfe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),l=J.getValueOrDefault(r.plane,e,s.plane),d=J.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=l,s.dimensions=d,a=wJ(l,d,a,a),new Rt({id:t,geometry:new p2,modelMatrix:a,attributes:{show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};tm.prototype._isHidden=function(e,t){return!c(t.plane)||!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};tm.prototype._getIsClosed=function(e){return!1};tm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};tm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ye.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ye.MINIMUM_VALUE,i.dimensions)};tm.DynamicGeometryUpdater=cV;function cV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(cV.prototype=Object.create(ii.prototype),cV.prototype.constructor=cV);cV.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,Lqe);return!c(o)||!c(i.plane)||!c(i.dimensions)||ii.prototype._isHidden.call(this,e,t,n)};cV.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 Rqe=new m,Gqe=new m,Eqe=new m,Xqe=new m,Iqe=new te,Wqe=new te,wqe=new M;function wJ(e,t,n,i){let o=e.normal,r=e.distance,s=m.multiplyByScalar(o,-r,Eqe),a=m.clone(m.UNIT_Z,Gqe);w.equalsEpsilon(Math.abs(m.dot(a,o)),1,w.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let l=m.cross(a,o,Rqe);a=m.cross(o,l,a),m.normalize(l,l),m.normalize(a,a);let d=Iqe;te.setColumn(d,0,l,d),te.setColumn(d,1,a,d),te.setColumn(d,2,o,d);let u=m.fromElements(t.x,t.y,1,Xqe),f=te.multiplyByScale(d,u,Wqe),p=M.fromRotationTranslation(f,s,wqe);return M.multiplyTransformation(n,p,i)}tm.createPrimitiveMatrix=wJ;var b2=tm;var Fdi=_(T(),1);var vli=_(T(),1);var Pqe=new m,vqe=new je,Fqe=new D,Aqe=new D,Mqe=new m,Nqe=new m,kqe=new m,y2=new m,Uqe=new m,Oqe=new m,xfe=new Fe,Dqe=new te,Bqe=new te,Yqe=new m;function Hqe(e,t,n,i,o,r,s,a,l){let d=e.positions,u=ai.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let f=Me.createTypedArray(d.length,u.length);f.set(u);let p=Dqe;if(i!==0){let b=Fe.fromAxisAngle(s,i,xfe);if(p=te.fromQuaternion(b,p),t.tangent||t.bitangent){b=Fe.fromAxisAngle(s,-i,xfe);let G=te.fromQuaternion(b,Bqe);a=m.normalize(te.multiplyByVector(G,a,a),a),t.bitangent&&(l=m.normalize(m.cross(s,a,l),l))}}else p=te.clone(te.IDENTITY,p);let y=Aqe;t.st&&(y.x=n.x,y.y=n.y);let h=d.length,g=h*3,x=new Float64Array(g),S=t.normal?new Float32Array(g):void 0,V=t.tangent?new Float32Array(g):void 0,Z=t.bitangent?new Float32Array(g):void 0,R=t.st?new Float32Array(h*2):void 0,E=0,I=0,v=0,P=0,F=0;for(let b=0;b<h;b++){let G=d[b];if(x[E++]=G.x,x[E++]=G.y,x[E++]=G.z,t.st)if(c(o)&&o.positions.length===h)R[F++]=o.positions[b].x,R[F++]=o.positions[b].y;else{let X=te.multiplyByVector(p,G,Pqe),W=r(X,Fqe);D.subtract(W,y,W);let A=w.clamp(W.x/n.width,0,1),k=w.clamp(W.y/n.height,0,1);R[F++]=A,R[F++]=k}t.normal&&(S[I++]=s.x,S[I++]=s.y,S[I++]=s.z),t.tangent&&(V[P++]=a.x,V[P++]=a.y,V[P++]=a.z),t.bitangent&&(Z[v++]=l.x,Z[v++]=l.y,Z[v++]=l.z)}let N=new fn;return t.position&&(N.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:x})),t.normal&&(N.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:S})),t.tangent&&(N.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(N.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:Z})),t.st&&(N.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:R})),new dt({attributes:N,indices:f,primitiveType:ve.TRIANGLES})}function dT(e){e=e??z.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates;C.defined("options.polygonHierarchy",t);let i=e.vertexFormat??We.DEFAULT;this._vertexFormat=We.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Dn.computeHierarchyPackedLength(t,m)+We.packedLength+re.packedLength+(c(n)?Dn.computeHierarchyPackedLength(n,D):1)+2}dT.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new dT(t)};dT.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._stRotation,c(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var zqe=re.clone(re.UNIT_SPHERE),Kqe=new We,Jqe={polygonHierarchy:{}};dT.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,zqe);t+=re.packedLength;let r=We.unpack(e,t,Kqe);t+=We.packedLength;let s=e[t++],a=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);c(a)?(t=a.startingIndex,delete a.startingIndex):t++;let l=e[t++];return c(n)||(n=new dT(Jqe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=l,n};dT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=c(o),s=n.positions;if(s=xo(s,m.equalsEpsilon,!0),s.length<3)return;let a=Mqe,l=Nqe,d=kqe,u=Uqe,f=Oqe;if(!Eb.computeProjectTo2DArguments(s,y2,u,f))return;if(a=m.cross(u,f,a),a=m.normalize(a,a),!m.equalsEpsilon(y2,m.ZERO,w.EPSILON6)){let F=e._ellipsoid.geodeticSurfaceNormal(y2,Yqe);m.dot(a,F)<0&&(a=m.negate(a,a),u=m.negate(u,u))}let y=Eb.createProjectPointsTo2DFunction(y2,u,f),h=Eb.createProjectPointTo2DFunction(y2,u,f);t.tangent&&(l=m.clone(u,l)),t.bitangent&&(d=m.clone(f,d));let g=Dn.polygonsFromHierarchy(n,r,y,!1),x=g.hierarchy,S=g.polygons,V=function(F){return F},Z=r?Dn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(x.length===0)return;s=x[0].outerRing;let R=ue.fromPoints(s),E=Dn.computeBoundingRectangle(a,h,s,i,vqe),I=[];for(let F=0;F<S.length;F++){let N=new Rt({geometry:Hqe(S[F],t,E,i,r?Z[F]:void 0,h,a,l,d)});I.push(N)}let v=An.combineInstances(I)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Me.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new dt({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:R})};var g2=dT;var rdi=_(T(),1);var _fe=[],oU=[];function Qqe(e,t,n,i,o){let s=$r.fromPoints(t,e).projectPointsOntoPlane(t,_fe);ai.computeWindingOrder2D(s)===qr.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,d,u=t.length,f=0;if(i)for(l=new Float64Array(u*2*3),d=0;d<u;d++){let h=t[d],g=t[(d+1)%u];l[f++]=h.x,l[f++]=h.y,l[f++]=h.z,l[f++]=g.x,l[f++]=g.y,l[f++]=g.z}else{let h=0;if(o===Kt.GEODESIC)for(d=0;d<u;d++)h+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===Kt.RHUMB)for(d=0;d<u;d++)h+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(l=new Float64Array(h*3),d=0;d<u;d++){let g;o===Kt.GEODESIC?g=Dn.subdivideLine(t[d],t[(d+1)%u],n,oU):o===Kt.RHUMB&&(g=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,oU));let x=g.length;for(let S=0;S<x;++S)l[f++]=g[S]}}u=l.length/3;let p=u*2,y=Me.createTypedArray(u,p);for(f=0,d=0;d<u-1;d++)y[f++]=d,y[f++]=d+1;return y[f++]=u-1,y[f++]=0,new Rt({geometry:new dt({attributes:new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l})}),indices:y,primitiveType:ve.LINES})})}function jqe(e,t,n,i,o){let s=$r.fromPoints(t,e).projectPointsOntoPlane(t,_fe);ai.computeWindingOrder2D(s)===qr.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,d,u=t.length,f=new Array(u),p=0;if(i)for(l=new Float64Array(u*2*3*2),d=0;d<u;++d){f[d]=p/3;let x=t[d],S=t[(d+1)%u];l[p++]=x.x,l[p++]=x.y,l[p++]=x.z,l[p++]=S.x,l[p++]=S.y,l[p++]=S.z}else{let x=0;if(o===Kt.GEODESIC)for(d=0;d<u;d++)x+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===Kt.RHUMB)for(d=0;d<u;d++)x+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(l=new Float64Array(x*3*2),d=0;d<u;++d){f[d]=p/3;let S;o===Kt.GEODESIC?S=Dn.subdivideLine(t[d],t[(d+1)%u],n,oU):o===Kt.RHUMB&&(S=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,oU));let V=S.length;for(let Z=0;Z<V;++Z)l[p++]=S[Z]}}u=l.length/(3*2);let y=f.length,h=(u*2+y)*2,g=Me.createTypedArray(u+y,h);for(p=0,d=0;d<u;++d)g[p++]=d,g[p++]=(d+1)%u,g[p++]=d+u,g[p++]=(d+1)%u+u;for(d=0;d<y;d++){let x=f[d];g[p++]=x,g[p++]=x+u}return new Rt({geometry:new dt({attributes:new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l})}),indices:g,primitiveType:ve.LINES})})}function uT(e){if(C.typeOf.object("options",e),C.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&c(e.height))throw new L("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==Kt.GEODESIC&&e.arcType!==Kt.RHUMB)throw new L("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.ellipsoid??re.default,i=e.granularity??w.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&c(e.extrudedHeight),s=e.arcType??Kt.GEODESIC,a=e.height??0,l=e.extrudedHeight??a;if(!r){let d=Math.max(a,l);l=Math.min(a,l),a=d}this._ellipsoid=re.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=l,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,m)+re.packedLength+8}uT.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var qqe=re.clone(re.UNIT_SPHERE),$qe={polygonHierarchy:{}};uT.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,qqe);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++]===1,d=e[t++]===1,u=e[t++],f=e[t++],p=e[t];return c(n)||(n=new uT($qe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=l,n._arcType=u,n._offsetAttribute=f===-1?void 0:f,n.packedLength=p,n};uT.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);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 uT(t)};uT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Dn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,l=[],d=w.chordLength(n,t.maximumRadius),u=e._height,f=e._extrudedHeight,p=e._perPositionHeightExtrude||!w.equalsEpsilon(u,f,0,w.EPSILON2),y,h;if(p)for(h=0;h<s.length;h++){if(a=jqe(t,s[h],d,o,r),a.geometry=Dn.scaleToGeodeticHeightExtruded(a.geometry,u,f,t,o),c(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length/3,V=new Uint8Array(S);e._offsetAttribute===$t.TOP?V=V.fill(1,0,S/2):(y=e._offsetAttribute===$t.NONE?0:1,V=V.fill(y)),a.geometry.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}l.push(a)}else for(h=0;h<s.length;h++){if(a=Qqe(t,s[h],d,o,r),a.geometry.attributes.position.values=ai.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),c(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length;y=e._offsetAttribute===$t.NONE?0:1;let V=new Uint8Array(S/3).fill(y);a.geometry.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}l.push(a)}let g=An.combineInstances(l)[0],x=ue.fromVertices(g.attributes.position.values);return new dt({attributes:g.attributes,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:x,offsetAttribute:e._offsetAttribute})};var x2=uT;var Tfe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Sfe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Cfe=new Y,Vfe=m.ZERO,Lfe=new m,Zfe=new de,e$e=[],t$e=new D;function n$e(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 kd(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new n$e(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}c(Object.create)&&(kd.prototype=Object.create(Yn.prototype),kd.prototype.constructor=kd);kd.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Cfe)),c(s)||(s=Y.WHITE),o.color=Yt.fromColor(s)}c(i.offsetAttribute)&&(o.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vfe,Lfe)));let r;return i.perPositionHeight&&!c(i.extrudedHeight)?r=new g2(i):r=new ob(i),new Rt({id:t,geometry:r,attributes:o})};kd.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Cfe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};c(i.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vfe,Lfe)));let a;return i.perPositionHeight&&!c(i.extrudedHeight)?a=new zu(i):a=new x2(i),new Rt({id:t,geometry:a,attributes:s})};kd.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!c(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=$r.fromPoints(i,o),s=r.projectPointsOntoPlane(i,e$e),a=s.length,l=0,d=a-1,u=new D;for(let p=0;p<a;d=p++){let y=s[p],h=s[d],g=y.x*h.y-h.x*y.y,x=D.add(y,h,t$e);x=D.multiplyByScalar(x,g,x),u=D.add(u,x,u),l+=g}let f=1/(l*3);return u=D.multiplyByScalar(u,f,u),r.projectPointOntoEllipsoid(u,t)};kd.prototype._isHidden=function(e,t){return!c(t.hierarchy)||oi.prototype._isHidden.call(this,e,t)};kd.prototype._isOnTerrain=function(e,t){let n=Yn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=c(i)&&(i.isConstant?i.getValue(Ye.MINIMUM_VALUE):!0);return n&&!o};kd.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 Ut)};kd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ye.MINIMUM_VALUE),r=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),s=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),a=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),l=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE),d=J.getValueOrDefault(t.perPositionHeight,Ye.MINIMUM_VALUE,!1);r=Yn.getGeometryHeight(r,s);let u;if(d?(c(r)&&(r=void 0,ht(Tfe)),s!==ze.NONE&&d&&(r=void 0,ht(Sfe))):(c(a)&&!c(r)&&(r=0),u=Yn.computeGeometryOffsetAttribute(r,s,a,l)),i.polygonHierarchy=o,i.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),i.stRotation=J.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=J.getValueOrDefault(t.closeTop,Ye.MINIMUM_VALUE,!0),i.closeBottom=J.getValueOrDefault(t.closeBottom,Ye.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=J.getValueOrDefault(t.arcType,Ye.MINIMUM_VALUE,Kt.GEODESIC),i.textureCoordinates=J.getValueOrUndefined(t.textureCoordinates,Ye.MINIMUM_VALUE),a=Yn.getGeometryExtrudedHeight(a,l),a===Yn.CLAMP_TO_GROUND){let f=ob.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Zfe);a=ui.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};kd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=c(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};kd.DynamicGeometryUpdater=lV;function lV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(lV.prototype=Object.create(ii.prototype),lV.prototype.constructor=lV);lV.prototype._isHidden=function(e,t,n){return!c(this._options.polygonHierarchy)||ii.prototype._isHidden.call(this,e,t,n)};lV.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,ze.NONE),s=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE),a=J.getValueOrUndefined(t.extrudedHeight,n),l=J.getValueOrUndefined(t.perPositionHeight,n);o=Yn.getGeometryHeight(o,s);let d;if(l?(c(o)&&(o=void 0,ht(Tfe)),r!==ze.NONE&&l&&(o=void 0,ht(Sfe))):(c(a)&&!c(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,Kt.GEODESIC),a=Yn.getGeometryExtrudedHeight(a,s),a===Yn.CLAMP_TO_GROUND){let u=ob.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Zfe);a=ui.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var _2=kd;var Kui=_(T(),1);var aui=_(T(),1);function i$e(e,t,n,i){let o=new fn;i.position&&(o.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),l=ai.triangulate(t),d=(a-1)*r*6+l.length*2,u=Me.createTypedArray(s,d),f,p,y,h,g,x,S=r*2,V=0;for(f=0;f<a-1;f++){for(p=0;p<r-1;p++)y=p*2+f*r*2,x=y+S,h=y+1,g=h+S,u[V++]=h,u[V++]=y,u[V++]=g,u[V++]=g,u[V++]=y,u[V++]=x;y=r*2-2+f*r*2,h=y+1,g=h+S,x=y+S,u[V++]=h,u[V++]=y,u[V++]=g,u[V++]=g,u[V++]=y,u[V++]=x}if(i.st||i.tangent||i.bitangent){let E=new Float32Array(s*2),I=1/(a-1),v=1/n.height,P=n.height/2,F,N,b=0;for(f=0;f<a;f++){for(F=f*I,N=v*(t[0].y+P),E[b++]=F,E[b++]=N,p=1;p<r;p++)N=v*(t[p].y+P),E[b++]=F,E[b++]=N,E[b++]=F,E[b++]=N;N=v*(t[0].y+P),E[b++]=F,E[b++]=N}for(p=0;p<r;p++)F=0,N=v*(t[p].y+P),E[b++]=F,E[b++]=N;for(p=0;p<r;p++)F=(a-1)*I,N=v*(t[p].y+P),E[b++]=F,E[b++]=N;o.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}let Z=s-r*2;for(f=0;f<l.length;f+=3){let E=l[f]+Z,I=l[f+1]+Z,v=l[f+2]+Z;u[V++]=E,u[V++]=I,u[V++]=v,u[V++]=v+r,u[V++]=I+r,u[V++]=E+r}let R=new dt({attributes:o,indices:u,boundingSphere:ue.fromVertices(e),primitiveType:ve.TRIANGLES});if(i.normal&&(R=An.computeNormal(R)),i.tangent||i.bitangent){try{R=An.computeTangentAndBitangent(R)}catch{ht("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 S2(e){e=e??z.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new L("options.polylinePositions is required.");if(!c(n))throw new L("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._cornerType=e.cornerType??Fi.ROUNDED,this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._granularity=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+re.packedLength+We.packedLength+2}S2.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=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 re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Rfe=re.clone(re.UNIT_SPHERE),Gfe=new We,T2={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Rfe,vertexFormat:Gfe,cornerType:void 0,granularity:void 0};S2.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=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=re.unpack(e,t,Rfe);t+=re.packedLength;let l=We.unpack(e,t,Gfe);t+=We.packedLength;let d=e[t++],u=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=We.clone(l,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(T2.polylinePositions=r,T2.shapePositions=s,T2.cornerType=d,T2.granularity=u,new S2(T2))};var o$e=new je;S2.createGeometry=function(e){let t=e._positions,n=xo(t,m.equalsEpsilon),i=e._shape;if(i=bf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ai.computeWindingOrder2D(i)===qr.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,o$e),r=bf.computePositions(n,i,o,e,!0);return i$e(r,i,o,e._vertexFormat)};var C2=S2;var Eui=_(T(),1);function r$e(e,t){let n=new fn;n.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Me.createTypedArray(o,2*i*(s+1)),l,d,u=0;l=0;let f=l*i;for(d=0;d<i-1;d++)a[u++]=d+f,a[u++]=d+f+1;for(a[u++]=i-1+f,a[u++]=f,l=s-1,f=l*i,d=0;d<i-1;d++)a[u++]=d+f,a[u++]=d+f+1;for(a[u++]=i-1+f,a[u++]=f,l=0;l<s-1;l++){let y=i*l,h=y+i;for(d=0;d<i;d++)a[u++]=d+y,a[u++]=d+h}return new dt({attributes:n,indices:Me.createTypedArray(o,a),boundingSphere:ue.fromVertices(e),primitiveType:ve.LINES})}function L2(e){e=e??z.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new L("options.polylinePositions is required.");if(!c(n))throw new L("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._cornerType=e.cornerType??Fi.ROUNDED,this._granularity=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+re.packedLength+2}L2.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=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 re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Efe=re.clone(re.UNIT_SPHERE),V2={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Efe,height:void 0,cornerType:void 0,granularity:void 0};L2.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=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=re.unpack(e,t,Efe);t+=re.packedLength;let l=e[t++],d=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._cornerType=l,n._granularity=d,n):(V2.polylinePositions=r,V2.shapePositions=s,V2.cornerType=l,V2.granularity=d,new L2(V2))};var s$e=new je;L2.createGeometry=function(e){let t=e._positions,n=xo(t,m.equalsEpsilon),i=e._shape;if(i=bf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ai.computeWindingOrder2D(i)===qr.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,s$e),r=bf.computePositions(n,i,o,e,!1);return r$e(r,i)};var Z2=L2;var Xfe=new Y;function a$e(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 Fh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new a$e(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}c(Object.create)&&(Fh.prototype=Object.create(oi.prototype),Fh.prototype.constructor=Fh);Fh.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,Xfe)),c(l)||(l=Y.WHITE),o=Yt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Rt({id:t,geometry:new C2(this._options),attributes:i})};Fh.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Xfe),o=this._distanceDisplayConditionProperty.getValue(e);return new Rt({id:t,geometry:new Z2(this._options),attributes:{show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Fh.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.shape)||oi.prototype._isHidden.call(this,e,t)};Fh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!J.isConstant(t.granularity)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.cornerType)};Fh.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ye.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ye.MINIMUM_VALUE,o.shape),o.granularity=c(n)?n.getValue(Ye.MINIMUM_VALUE):void 0,o.cornerType=c(i)?i.getValue(Ye.MINIMUM_VALUE):void 0};Fh.DynamicGeometryUpdater=dV;function dV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(dV.prototype=Object.create(ii.prototype),dV.prototype.constructor=dV);dV.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.polylinePositions)||!c(i.shapePositions)||ii.prototype._isHidden.call(this,e,t,n)};dV.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 R2=Fh;var Jmi=_(T(),1);var Smi=_(T(),1);var PJ=new m,wfe=new m,Pfe=new m,vfe=new m,Ffe=new de,c$e=new D,l$e=new ue,d$e=new ue;function Afe(e,t){let n=new dt({attributes:new fn,primitiveType:ve.TRIANGLES});return n.attributes.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function u$e(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,l=0,d=vfe,u=Pfe,f=wfe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let y=m.fromArray(e,p,PJ),h=l+1,g=l+2;f=n.geodeticSurfaceNormal(y,f),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,f,u),te.multiplyByVector(i,u,u),m.normalize(u,u),t.bitangent&&m.normalize(m.cross(f,u,d),d)),t.normal&&(r[l]=f.x,r[h]=f.y,r[g]=f.z),t.tangent&&(s[l]=u.x,s[h]=u.y,s[g]=u.z),t.bitangent&&(a[l]=d.x,a[h]=d.y,a[g]=d.z),l+=3}return Afe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var vJ=new m,Mfe=new m;function m$e(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,l=0,d=0,u=!0,f=vfe,p=Pfe,y=wfe;if(t.normal||t.tangent||t.bitangent)for(let h=0;h<i;h+=6){let g=m.fromArray(e,h,PJ),x=m.fromArray(e,(h+6)%i,vJ);if(u){let S=m.fromArray(e,(h+3)%i,Mfe);m.subtract(x,g,x),m.subtract(S,g,S),y=m.normalize(m.cross(S,x,y),y),u=!1}m.equalsEpsilon(x,g,w.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(f=n.geodeticSurfaceNormal(g,f),t.tangent&&(p=m.normalize(m.cross(f,y,p),p))),t.normal&&(o[a++]=y.x,o[a++]=y.y,o[a++]=y.z,o[a++]=y.x,o[a++]=y.y,o[a++]=y.z),t.tangent&&(r[l++]=p.x,r[l++]=p.y,r[l++]=p.z,r[l++]=p.x,r[l++]=p.y,r[l++]=p.z),t.bitangent&&(s[d++]=f.x,s[d++]=f.y,s[d++]=f.z,s[d++]=f.x,s[d++]=f.y,s[d++]=f.z)}return Afe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Nfe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,l=0,d=o,u=o,f=0;s&&(l=1,u-=1,f+=1),a&&(d-=1,u-=1,f+=1),f+=r*u;let p=n.position?new Float64Array(f*3):void 0,y=n.st?new Float32Array(f*2):void 0,h=0,g=0,x=PJ,S=c$e,V=Number.MAX_VALUE,Z=Number.MAX_VALUE,R=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let G=l;G<d;++G)for(let X=0;X<r;++X)Rs.computePosition(t,i,n.st,G,X,x,S),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(y[g++]=S.x,y[g++]=S.y,V=Math.min(V,S.x),Z=Math.min(Z,S.y),R=Math.max(R,S.x),E=Math.max(E,S.y));if(s&&(Rs.computePosition(t,i,n.st,0,0,x,S),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(y[g++]=S.x,y[g++]=S.y,V=S.x,Z=S.y,R=S.x,E=S.y)),a&&(Rs.computePosition(t,i,n.st,o-1,0,x,S),p[h++]=x.x,p[h++]=x.y,p[h]=x.z,n.st&&(y[g++]=S.x,y[g]=S.y,V=Math.min(V,S.x),Z=Math.min(Z,S.y),R=Math.max(R,S.x),E=Math.max(E,S.y))),n.st&&(V<0||Z<0||R>1||E>1))for(let G=0;G<y.length;G+=2)y[G]=(y[G]-V)/(R-V),y[G+1]=(y[G+1]-Z)/(E-Z);let I=u$e(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(u-1);s&&(v+=3*(r-1)),a&&(v+=3*(r-1));let P=Me.createTypedArray(f,v),F=0,N=0,b;for(b=0;b<u-1;++b){for(let G=0;G<r-1;++G){let X=F,W=X+r,A=W+1,k=X+1;P[N++]=X,P[N++]=W,P[N++]=k,P[N++]=k,P[N++]=W,P[N++]=A,++F}++F}if(s||a){let G=f-1,X=f-1;s&&a&&(G=f-2);let W,A;if(F=0,s)for(b=0;b<r-1;b++)W=F,A=W+1,P[N++]=G,P[N++]=W,P[N++]=A,++F;if(a)for(F=(u-1)*r,b=0;b<r-1;b++)W=F,A=W+1,P[N++]=W,P[N++]=X,P[N++]=A,++F}return I.indices=P,n.st&&(I.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:y})),I}function uV(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 mV(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 FJ=new We;function f$e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,l=t.height,d=t.width,u;if(n){let qe=We.clone(o,FJ);qe.normal=!0,e._vertexFormat=qe}let f=Nfe(e,t);n&&(e._vertexFormat=o);let p=ai.scaleToGeodeticHeight(f.attributes.position.values,s,a,!1);p=new Float64Array(p);let y=p.length,h=y*2,g=new Float64Array(h);g.set(p);let x=ai.scaleToGeodeticHeight(f.attributes.position.values,r,a);g.set(x,y),f.attributes.position.values=g;let S=o.normal?new Float32Array(h):void 0,V=o.tangent?new Float32Array(h):void 0,Z=o.bitangent?new Float32Array(h):void 0,R=o.st?new Float32Array(h/3*2):void 0,E,I;if(o.normal){for(I=f.attributes.normal.values,S.set(I),u=0;u<y;u++)I[u]=-I[u];S.set(I,y),f.attributes.normal.values=S}if(n){I=f.attributes.normal.values,o.normal||(f.attributes.normal=void 0);let qe=new Float32Array(h);for(u=0;u<y;u++)I[u]=-I[u];qe.set(I,y),f.attributes.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:qe})}let v,P=c(i);if(P){let qe=y/3*2,mn=new Uint8Array(qe);i===$t.TOP?mn=mn.fill(1,0,qe/2):(v=i===$t.NONE?0:1,mn=mn.fill(v)),f.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:mn})}if(o.tangent){let qe=f.attributes.tangent.values;for(V.set(qe),u=0;u<y;u++)qe[u]=-qe[u];V.set(qe,y),f.attributes.tangent.values=V}if(o.bitangent){let qe=f.attributes.bitangent.values;Z.set(qe),Z.set(qe,y),f.attributes.bitangent.values=Z}o.st&&(E=f.attributes.st.values,R.set(E),R.set(E,y/3*2),f.attributes.st.values=R);let F=f.indices,N=F.length,b=y/3,G=Me.createTypedArray(h/3,N*2);for(G.set(F),u=0;u<N;u+=3)G[u+N]=F[u+2]+b,G[u+1+N]=F[u+1]+b,G[u+2+N]=F[u]+b;f.indices=G;let X=t.northCap,W=t.southCap,A=l,k=2,B=0,O=4,H=4;X&&(k-=1,A-=1,B+=1,O-=2,H-=1),W&&(k-=1,A-=1,B+=1,O-=2,H-=1),B+=k*d+2*A-O;let U=(B+H)*2,K=new Float64Array(U*3),Q=n?new Float32Array(U*3):void 0,ie=P?new Uint8Array(U):void 0,j=o.st?new Float32Array(U*2):void 0,$=i===$t.TOP;P&&!$&&(v=i===$t.ALL?1:0,ie=ie.fill(v));let ne=0,be=0,Ce=0,me=0,_e=d*A,Ve;for(u=0;u<_e;u+=d)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);if(W){let qe=X?_e+1:_e;for(Ve=qe*3,u=0;u<2;u++)K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,qe*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1)}else for(u=_e-d;u<_e;u++)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);for(u=_e-1;u>0;u-=d)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);if(X){let qe=_e;for(Ve=qe*3,u=0;u<2;u++)K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,qe*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1)}else for(u=d-1;u>=0;u--)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);let Ie=m$e(K,o,a);o.st&&(Ie.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:j})),n&&(Ie.attributes.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:Q})),P&&(Ie.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:ie}));let Ze=Me.createTypedArray(U,B*6),De,Ke,rt,Xt;y=K.length/3;let Ht=0;for(u=0;u<y-1;u+=2){De=u,Xt=(De+2)%y;let qe=m.fromArray(K,De*3,vJ),mn=m.fromArray(K,Xt*3,Mfe);m.equalsEpsilon(qe,mn,w.EPSILON10)||(Ke=(De+1)%y,rt=(Ke+2)%y,Ze[Ht++]=De,Ze[Ht++]=Ke,Ze[Ht++]=Xt,Ze[Ht++]=Xt,Ze[Ht++]=Ke,Ze[Ht++]=rt)}return Ie.indices=Ze,Ie=An.combineInstances([new Rt({geometry:f}),new Rt({geometry:Ie})]),Ie[0]}var h$e=[new m,new m,new m,new m],kfe=new pe,p$e=new pe;function AJ(e,t,n,i,o){if(n===0)return de.clone(e,o);let r=Rs.computeOptions(e,t,n,0,Ffe,kfe),s=r.height,a=r.width,l=h$e;return Rs.computePosition(r,i,!1,0,0,l[0]),Rs.computePosition(r,i,!1,0,a-1,l[1]),Rs.computePosition(r,i,!1,s-1,0,l[2]),Rs.computePosition(r,i,!1,s-1,a-1,l[3]),de.fromCartesianArray(l,i,o)}function Ah(e){e=e??z.EMPTY_OBJECT;let t=e.rectangle;if(C.typeOf.object("rectangle",t),de._validate(t),t.north<t.south)throw new L("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=e.height??0,i=e.extrudedHeight??n;this._rectangle=de.clone(t),this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Ah.packedLength=de.packedLength+re.packedLength+We.packedLength+7;Ah.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,de.pack(e._rectangle,t,n),n+=de.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.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]=e._offsetAttribute??-1,t};var Ufe=new de,Ofe=re.clone(re.UNIT_SPHERE),ig={rectangle:Ufe,ellipsoid:Ofe,vertexFormat:FJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Ah.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=de.unpack(e,t,Ufe);t+=de.packedLength;let o=re.unpack(e,t,Ofe);t+=re.packedLength;let r=We.unpack(e,t,FJ);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++]===1,p=e[t];return c(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=l,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=f,n._offsetAttribute=p===-1?void 0:p,n):(ig.granularity=s,ig.height=a,ig.rotation=l,ig.stRotation=d,ig.extrudedHeight=u,ig.shadowVolume=f,ig.offsetAttribute=p===-1?void 0:p,new Ah(ig))};Ah.computeRectangle=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.rectangle;if(C.typeOf.object("rectangle",n),de._validate(n),n.north<n.south)throw new L("options.rectangle.north must be greater than or equal to options.rectangle.south");let i=e.granularity??w.RADIANS_PER_DEGREE,o=e.ellipsoid??re.default,r=e.rotation??0;return AJ(n,i,r,o,t)};var b$e=new te,Ife=new Fe,y$e=new pe;Ah.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=Rs.computeOptions(t,e._granularity,i,o,Ffe,kfe,p$e),a=b$e;if(o!==0||i!==0){let y=de.center(t,y$e),h=n.geodeticSurfaceNormalCartographic(y,vJ);Fe.fromAxisAngle(h,-o,Ife),te.fromQuaternion(Ife,a)}else te.clone(te.IDENTITY,a);let l=e._surfaceHeight,d=e._extrudedHeight,u=!w.equalsEpsilon(l,d,0,w.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let f,p;if(t=e._rectangle,u){f=f$e(e,s);let y=ue.fromRectangle3D(t,n,l,d$e),h=ue.fromRectangle3D(t,n,d,l$e);p=ue.union(y,h)}else{if(f=Nfe(e,s),f.attributes.position.values=ai.scaleToGeodeticHeight(f.attributes.position.values,l,n,!1),c(e._offsetAttribute)){let y=f.attributes.position.values.length,h=e._offsetAttribute===$t.NONE?0:1,g=new Uint8Array(y/3).fill(h);f.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}p=ue.fromRectangle3D(t,n,l)}return r.position||delete f.attributes.position,new dt({attributes:f.attributes,indices:f.indices,primitiveType:f.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Ah.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Ah({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};var Wfe=new de,g$e=[new D,new D,new D],x$e=new Ii,_$e=new pe;function T$e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=de.clone(e._rectangle,Wfe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=AJ(t,n,o,i,Wfe),s=g$e;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,l=Ii.fromRotation(e._stRotation,x$e),d=de.center(a,_$e);for(let h=0;h<3;++h){let g=s[h];g.x-=d.longitude,g.y-=d.latitude,Ii.multiplyByVector(l,g,g),g.x+=d.longitude,g.y+=d.latitude,g.x=(g.x-a.west)/a.width,g.y=(g.y-a.south)/a.height}let u=s[0],f=s[1],p=s[2],y=new Array(6);return D.pack(u,y),D.pack(f,y,2),D.pack(p,y,4),y}Object.defineProperties(Ah.prototype,{rectangle:{get:function(){return c(this._rotatedRectangle)||(this._rotatedRectangle=AJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=T$e(this)),this._textureCoordinateRotationPoints}}});var mT=Ah;var Dfe=new Y,Bfe=m.ZERO,Yfe=new m,Hfe=new de,S$e=new de,C$e=new pe;function V$e(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 Vf(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new V$e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}c(Object.create)&&(Vf.prototype=Object.create(Yn.prototype),Vf.prototype.constructor=Vf);Vf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Dfe)),c(o)||(o=Y.WHITE),i.color=Yt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Bfe,Yfe))),new Rt({id:t,geometry:new mT(this._options),attributes:i})};Vf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Dfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Bfe,Yfe))),new Rt({id:t,geometry:new U_(this._options),attributes:r})};Vf.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.rectangle.coordinates,e,S$e);if(!c(n))return;let i=de.center(n,C$e);return pe.toCartesian(i,re.default,t)};Vf.prototype._isHidden=function(e,t){return!c(t.coordinates)||oi.prototype._isHidden.call(this,e,t)};Vf.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 Ut)};Vf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),o=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),r=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),s=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE);c(r)&&!c(i)&&(i=0);let a=this._options;a.vertexFormat=n?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ye.MINIMUM_VALUE,a.rectangle),a.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),a.stRotation=J.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),a.rotation=J.getValueOrUndefined(t.rotation,Ye.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=ui.getMinimumMaximumHeights(mT.computeRectangle(a,Hfe)).minimumTerrainHeight),a.extrudedHeight=r};Vf.DynamicGeometryUpdater=fV;function fV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(fV.prototype=Object.create(ii.prototype),fV.prototype.constructor=fV);fV.prototype._isHidden=function(e,t,n){return!c(this._options.rectangle)||ii.prototype._isHidden.call(this,e,t,n)};fV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,ze.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);c(s)&&!c(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=ui.getMinimumMaximumHeights(mT.computeRectangle(i,Hfe)).minimumTerrainHeight),i.extrudedHeight=s};var G2=Vf;var thi=_(T(),1);var _fi=_(T(),1);var ifi=_(T(),1);var zfe={};function L$e(e,t){return w.equalsEpsilon(e.latitude,t.latitude,w.EPSILON10)&&w.equalsEpsilon(e.longitude,t.longitude,w.EPSILON10)}var Z$e=new pe,R$e=new pe;function G$e(e,t,n,i){t=xo(t,m.equalsEpsilon);let o=t.length;if(o<2)return;let r=c(i),s=c(n),a=new Array(o),l=new Array(o),d=new Array(o),u=t[0];a[0]=u;let f=e.cartesianToCartographic(u,Z$e);s&&(f.height=n[0]),l[0]=f.height,r?d[0]=i[0]:d[0]=0;let p=l[0],y=d[0],h=p===y,g=1;for(let x=1;x<o;++x){let S=t[x],V=e.cartesianToCartographic(S,R$e);s&&(V.height=n[x]),h=h&&V.height===0,L$e(f,V)?f.height<V.height&&(l[g-1]=V.height):(a[g]=S,l[g]=V.height,r?d[g]=i[x]:d[g]=0,h=h&&l[g]===d[g],pe.clone(V,f),++g)}if(!(h||g<2))return a.length=g,l.length=g,d.length=g,{positions:a,topHeights:l,bottomHeights:d}}var E$e=new Array(2),X$e=new Array(2),I$e={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};zfe.computePositions=function(e,t,n,i,o,r){let s=G$e(e,t,n,i);if(!c(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,l=a-2,d,u,f=w.chordLength(o,e.maximumRadius),p=I$e;if(p.minDistance=f,p.ellipsoid=e,r){let y=0,h;for(h=0;h<a-1;h++)y+=vi.numberOfPoints(t[h],t[h+1],f)+1;d=new Float64Array(y*3),u=new Float64Array(y*3);let g=E$e,x=X$e;p.positions=g,p.height=x;let S=0;for(h=0;h<a-1;h++){g[0]=t[h],g[1]=t[h+1],x[0]=n[h],x[1]=n[h+1];let V=vi.generateArc(p);d.set(V,S),x[0]=i[h],x[1]=i[h+1],u.set(vi.generateArc(p),S),S+=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:l}};var fT=zfe;var MJ=new m,rU=new m,W$e=new m,Kfe=new m,w$e=new m,P$e=new m,v$e=new m;function hT(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new L("options.positions is required.");if(c(n)&&n.length!==t.length)throw new L("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new L("options.positions and options.minimumHeights must have the same length.");let o=e.vertexFormat??We.DEFAULT,r=e.granularity??w.RADIANS_PER_DEGREE,s=e.ellipsoid??re.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=We.clone(o),this._granularity=r,this._ellipsoid=re.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;c(i)&&(a+=i.length),c(n)&&(a+=n.length),this.packedLength=a+re.packedLength+We.packedLength+1}hT.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=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=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._granularity,t};var Jfe=re.clone(re.UNIT_SPHERE),Qfe=new We,E2={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Jfe,vertexFormat:Qfe,granularity:void 0};hT.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=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 l=re.unpack(e,t,Jfe);t+=re.packedLength;let d=We.unpack(e,t,Qfe);t+=We.packedLength;let u=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(l,n._ellipsoid),n._vertexFormat=We.clone(d,n._vertexFormat),n._granularity=u,n):(E2.positions=r,E2.minimumHeights=s,E2.maximumHeights=a,E2.granularity=u,new hT(E2))};hT.fromConstantHeights=function(e){e=e??z.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(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 l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new hT(l)};hT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=fT.computePositions(s,t,i,n,r,!0);if(!c(a))return;let l=a.bottomPositions,d=a.topPositions,u=a.numCorners,f=d.length,p=f*2,y=o.position?new Float64Array(p):void 0,h=o.normal?new Float32Array(p):void 0,g=o.tangent?new Float32Array(p):void 0,x=o.bitangent?new Float32Array(p):void 0,S=o.st?new Float32Array(p/3*2):void 0,V=0,Z=0,R=0,E=0,I=0,v=v$e,P=P$e,F=w$e,N=!0;f/=3;let b,G=0,X=1/(f-u-1);for(b=0;b<f;++b){let O=b*3,H=m.fromArray(d,O,MJ),U=m.fromArray(l,O,rU);if(o.position&&(y[V++]=U.x,y[V++]=U.y,y[V++]=U.z,y[V++]=H.x,y[V++]=H.y,y[V++]=H.z),o.st&&(S[I++]=G,S[I++]=0,S[I++]=G,S[I++]=1),o.normal||o.tangent||o.bitangent){let K=m.clone(m.ZERO,Kfe),Q=m.subtract(H,s.geodeticSurfaceNormal(H,rU),rU);if(b+1<f&&(K=m.fromArray(d,O+3,Kfe)),N){let ie=m.subtract(K,H,W$e),j=m.subtract(Q,H,MJ);v=m.normalize(m.cross(j,ie,v),v),N=!1}m.equalsEpsilon(H,K,w.EPSILON10)?N=!0:(G+=X,o.tangent&&(P=m.normalize(m.subtract(K,H,P),P)),o.bitangent&&(F=m.normalize(m.cross(v,P,F),F))),o.normal&&(h[Z++]=v.x,h[Z++]=v.y,h[Z++]=v.z,h[Z++]=v.x,h[Z++]=v.y,h[Z++]=v.z),o.tangent&&(g[E++]=P.x,g[E++]=P.y,g[E++]=P.z,g[E++]=P.x,g[E++]=P.y,g[E++]=P.z),o.bitangent&&(x[R++]=F.x,x[R++]=F.y,x[R++]=F.z,x[R++]=F.x,x[R++]=F.y,x[R++]=F.z)}}let W=new fn;o.position&&(W.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:y})),o.normal&&(W.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(W.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),o.bitangent&&(W.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:x})),o.st&&(W.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:S}));let A=p/3;p-=6*(u+1);let k=Me.createTypedArray(A,p),B=0;for(b=0;b<A-2;b+=2){let O=b,H=b+2,U=m.fromArray(y,O*3,MJ),K=m.fromArray(y,H*3,rU);if(m.equalsEpsilon(U,K,w.EPSILON10))continue;let Q=b+1,ie=b+3;k[B++]=Q,k[B++]=O,k[B++]=ie,k[B++]=ie,k[B++]=O,k[B++]=H}return new dt({attributes:W,indices:k,primitiveType:ve.TRIANGLES,boundingSphere:new ue.fromVertices(y)})};var X2=hT;var Ffi=_(T(),1);var jfe=new m,qfe=new m;function pT(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new L("options.positions is required.");if(c(n)&&n.length!==t.length)throw new L("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new L("options.positions and options.minimumHeights must have the same length.");let o=e.granularity??w.RADIANS_PER_DEGREE,r=e.ellipsoid??re.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=re.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;c(i)&&(s+=i.length),c(n)&&(s+=n.length),this.packedLength=s+re.packedLength+1}pT.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=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=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n]=e._granularity,t};var $fe=re.clone(re.UNIT_SPHERE),I2={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:$fe,granularity:void 0};pT.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=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 l=re.unpack(e,t,$fe);t+=re.packedLength;let d=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(l,n._ellipsoid),n._granularity=d,n):(I2.positions=r,I2.minimumHeights=s,I2.maximumHeights=a,I2.granularity=d,new pT(I2))};pT.fromConstantHeights=function(e){e=e??z.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(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 l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new pT(l)};pT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=fT.computePositions(r,t,i,n,o,!1);if(!c(s))return;let a=s.bottomPositions,l=s.topPositions,d=l.length,u=d*2,f=new Float64Array(u),p=0;d/=3;let y;for(y=0;y<d;++y){let V=y*3,Z=m.fromArray(l,V,jfe),R=m.fromArray(a,V,qfe);f[p++]=R.x,f[p++]=R.y,f[p++]=R.z,f[p++]=Z.x,f[p++]=Z.y,f[p++]=Z.z}let h=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),g=u/3;u=2*g-4+g;let x=Me.createTypedArray(g,u),S=0;for(y=0;y<g-2;y+=2){let V=y,Z=y+2,R=m.fromArray(f,V*3,jfe),E=m.fromArray(f,Z*3,qfe);if(m.equalsEpsilon(R,E,w.EPSILON10))continue;let I=y+1,v=y+3;x[S++]=I,x[S++]=V,x[S++]=I,x[S++]=v,x[S++]=V,x[S++]=Z}return x[S++]=g-2,x[S++]=g-1,new dt({attributes:h,indices:x,primitiveType:ve.LINES,boundingSphere:new ue.fromVertices(f)})};var W2=pT;var ehe=new Y;function F$e(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 Lf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new F$e(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}c(Object.create)&&(Lf.prototype=Object.create(oi.prototype),Lf.prototype.constructor=Lf);Lf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,ehe)),c(l)||(l=Y.WHITE),o=Yt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Rt({id:t,geometry:new X2(this._options),attributes:i})};Lf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,ehe),o=this._distanceDisplayConditionProperty.getValue(e);return new Rt({id:t,geometry:new W2(this._options),attributes:{show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Lf.prototype._isHidden=function(e,t){return!c(t.positions)||oi.prototype._isHidden.call(this,e,t)};Lf.prototype._getIsClosed=function(e){return!1};Lf.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)};Lf.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ye.MINIMUM_VALUE,s.positions),s.minimumHeights=c(n)?n.getValue(Ye.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=c(i)?i.getValue(Ye.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=c(o)?o.getValue(Ye.MINIMUM_VALUE):void 0};Lf.DynamicGeometryUpdater=hV;function hV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(hV.prototype=Object.create(ii.prototype),hV.prototype.constructor=hV);hV.prototype._isHidden=function(e,t,n){return!c(this._options.positions)||ii.prototype._isHidden.call(this,e,t,n)};hV.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 w2=Lf;var bT=[EX,qP,DP,u2,f2,b2,_2,R2,G2,w2];function yT(e,t){this.entity=e,this.scene=t;let n=new Array(bT.length),i=new ye,o=new hr;for(let r=0;r<n.length;r++){let s=new bT[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(yT.prototype._onEntityPropertyChanged,this)}yT.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)};yT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};yT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),he(this)};yT.registerUpdater=function(e){bT.includes(e)||bT.push(e)};yT.unregisterUpdater=function(e){if(bT.includes(e)){let t=bT.indexOf(e);bT.splice(t,1)}};var gT=yT;var Whi=_(T(),1);var the=new Y,A$e=new vt,M$e=new vt,N$e=m.ZERO,k$e=new m;function Zf(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 Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.subscriptions=new Zt,this.showsUpdated=new Zt,this.itemsToRemove=[],this.invalidated=!1;let a;c(o)&&(a=o.definitionChanged.addEventListener(Zf.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Zf.prototype.onMaterialChanged=function(){this.invalidated=!0};Zf.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:c(t)?t.equals(n):!1};Zf.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)}))}};Zf.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Zf.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){c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let l;c(this.depthFailAppearanceType)&&(c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),l=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:l,shadows:this.shadows}),o.add(i),t=!1}else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),f=this.attributes.get(u.id.id);if(c(f)||(f=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!d.fillMaterialProperty.isConstant||l){let x=d.fillMaterialProperty.color,S=J.getValueOrDefault(x,e,Y.WHITE,the);Y.equals(f._lastColor,S)||(f._lastColor=Y.clone(S,f._lastColor),f.color=Yt.toValue(S,f.color),(this.translucent&&f.color[3]===255||!this.translucent&&f.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(c(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Ut&&(!d.depthFailMaterialProperty.isConstant||l)){let x=d.depthFailMaterialProperty.color,S=J.getValueOrDefault(x,e,Y.WHITE,the);Y.equals(f._lastDepthFailColor,S)||(f._lastDepthFailColor=Y.clone(S,f._lastDepthFailColor),f.depthFailColor=Yt.toValue(S,f.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=d.distanceDisplayConditionProperty;if(!J.isConstant(h)){let x=J.getValueOrDefault(h,e,M$e,A$e);vt.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(x,f.distanceDisplayCondition))}let g=d.terrainOffsetProperty;if(!J.isConstant(g)){let x=J.getValueOrDefault(g,e,N$e,k$e);m.equals(x,f._lastOffset)||(f._lastOffset=m.clone(x,f._lastOffset),f.offset=$i.toValue(x,f.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Zf.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=Tn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Zf.prototype.contains=function(e){return this.updaters.contains(e.id)};Zf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Zf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),c(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function pV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}pV.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 l=n[a];if(l.isMaterial(t)){l.add(t,o);return}}let s=new Zf(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function nhe(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}pV.prototype.remove=function(e){nhe(this._solidItems,e)||nhe(this._translucentItems,e)};function ihe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,l=a.length;if(l>0)for(r=0;r<l;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function sU(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,l=a.length;for(let d=0;d<l;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}pV.prototype.update=function(e){let t=sU(this,this._solidItems,e,!0);t=sU(this,this._translucentItems,e,t)&&t;let n=ihe(this,this._solidItems,e),i=ihe(this,this._translucentItems,e);return(n||i)&&(t=sU(this,this._solidItems,e,t)&&t,t=sU(this,this._translucentItems,e,t)&&t),t};function ohe(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 ut.FAILED}pV.prototype.getBoundingSphere=function(e,t){let n=ohe(this._solidItems,e,t);return n===ut.FAILED?ohe(this._translucentItems,e,t):n};function rhe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}pV.prototype.removeAllPrimitives=function(){rhe(this._solidItems),rhe(this._translucentItems)};var nm=pV;var Khi=_(T(),1);var U$e=new vt,O$e=new vt,D$e=m.ZERO,B$e=new m;function Rf(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 Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Rf.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt}Rf.prototype.onMaterialChanged=function(){this.invalidated=!0};Rf.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=c(t)&&t.equals(n);return r=(!c(i)&&!c(o)||c(i)&&i.equals(o))&&r,r};Rf.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};Rf.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Y$e=new Y;Rf.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){c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material);let a;c(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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(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,c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(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 l=s[r],d=l.entity,u=this.geometry.get(l.id),f=this.attributes.get(u.id.id);if(c(f)||(f=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),c(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!l.depthFailMaterialProperty.isConstant){let x=l.depthFailMaterialProperty.color,S=J.getValueOrDefault(x,e,Y.WHITE,Y$e);Y.equals(f._lastDepthFailColor,S)||(f._lastDepthFailColor=Y.clone(S,f._lastDepthFailColor),f.depthFailColor=Yt.toValue(S,f.depthFailColor))}let p=d.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=l.distanceDisplayConditionProperty;if(!J.isConstant(h)){let x=J.getValueOrDefault(h,e,O$e,U$e);vt.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(x,f.distanceDisplayCondition))}let g=l.terrainOffsetProperty;if(!J.isConstant(g)){let x=J.getValueOrDefault(g,e,D$e,B$e);m.equals(x,f._lastOffset)||(f._lastOffset=m.clone(x,f._lastOffset),f.offset=$i.toValue(x,f.offset))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Rf.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,d=a.show[0]===1;l!==d&&(a.show=Tn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Rf.prototype.contains=function(e){return this.updaters.contains(e.id)};Rf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Rf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function bV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}bV.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 Rf(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};bV.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}}};bV.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};bV.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 ut.FAILED};bV.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 im=bV;var upi=_(T(),1);var qhi=_(T(),1),ahe=_(she(),1);function aU(){this._tree=new ahe.default}function xT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}xT.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};aU.prototype.insert=function(e,t){C.typeOf.string("id",e),C.typeOf.object("rectangle",t);let n=xT.fromRectangleAndId(e,t,new xT);this._tree.insert(n)};function H$e(e,t){return e.id===t.id}var z$e=new xT;aU.prototype.remove=function(e,t){C.typeOf.string("id",e),C.typeOf.object("rectangle",t);let n=xT.fromRectangleAndId(e,t,z$e);this._tree.remove(n,H$e)};var K$e=new xT;aU.prototype.collides=function(e){C.typeOf.object("rectangle",e);let t=xT.fromRectangleAndId("",e,K$e);return this._tree.collides(t)};var _T=aU;var J$e=new Y,Q$e=new vt,j$e=new vt;function qb(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 Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.subscriptions=new Zt,this.showsUpdated=new Zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new _T}qb.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};qb.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)}))}};qb.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 c(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};qb.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new kc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),f=this.attributes.get(u.id.id);if(c(f)||(f=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!d.fillMaterialProperty.isConstant||l){let g=d.fillMaterialProperty.color,x=J.getValueOrDefault(g,e,Y.WHITE,J$e);Y.equals(f._lastColor,x)||(f._lastColor=Y.clone(x,f._lastColor),f.color=Yt.toValue(x,f.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=d.distanceDisplayConditionProperty;if(!J.isConstant(h)){let g=J.getValueOrDefault(h,e,j$e,Q$e);vt.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(g,f.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};qb.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=Tn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};qb.prototype.contains=function(e){return this.updaters.contains(e.id)};qb.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return c(i)?(i.clone(t),ut.DONE):ut.FAILED};qb.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function yV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}yV.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 l=i[a];if(l.zIndex===o&&!l.overlapping(n.geometry.rectangle)){r=l;break}}return c(r)||(r=new qb(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};yV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};yV.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,l=a.length;for(let d=0;d<l;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};yV.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 ut.FAILED};yV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var gV=yV;var Lpi=_(T(),1);var q$e=new vt,$$e=new vt;function om(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(om.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new _T}om.prototype.onMaterialChanged=function(){this.invalidated=!0};om.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};om.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};om.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,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};om.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 c(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};om.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material),n=new kc({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(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 l=s[r],d=l.entity,u=this.geometry.get(l.id),f=this.attributes.get(u.id.id);c(f)||(f=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f));let p=d.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=l.distanceDisplayConditionProperty;if(!J.isConstant(h)){let g=J.getValueOrDefault(h,e,$$e,q$e);vt.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(g,f.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};om.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,d=a.show[0]===1;l!==d&&(a.show=Tn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};om.prototype.contains=function(e){return this.updaters.contains(e.id)};om.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};om.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function xV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}xV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=pd.shouldUseSphericalCoordinates(o.geometry.rectangle),s=J.getValueOrDefault(t.zIndex,0);for(let l=0;l<i;++l){let d=n[l];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new om(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};xV.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}}};xV.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};xV.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 ut.FAILED};xV.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 P2=xV;var kpi=_(T(),1);var eet=new Y,tet=new vt,net=new vt,iet=m.ZERO,oet=new m;function $b(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 Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.itemsToRemove=[],this.subscriptions=new Zt,this.showsUpdated=new Zt}$b.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)}))}};$b.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};$b.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),f=this.attributes.get(u.id.id);if(c(f)||(f=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!d.outlineColorProperty.isConstant||l){let x=d.outlineColorProperty,S=J.getValueOrDefault(x,e,Y.WHITE,eet);Y.equals(f._lastColor,S)||(f._lastColor=Y.clone(S,f._lastColor),f.color=Yt.toValue(S,f.color),(this.translucent&&f.color[3]===255||!this.translucent&&f.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=d.distanceDisplayConditionProperty;if(!J.isConstant(h)){let x=J.getValueOrDefault(h,e,net,tet);vt.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(x,f.distanceDisplayCondition))}let g=d.terrainOffsetProperty;if(!J.isConstant(g)){let x=J.getValueOrDefault(g,e,iet,oet);m.equals(x,f._lastOffset)||(f._lastOffset=m.clone(x,f._lastOffset),f.offset=$i.toValue(x,f.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};$b.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=Tn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};$b.prototype.contains=function(e){return this.updaters.contains(e.id)};$b.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};$b.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function _V(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Zt,this._translucentBatches=new Zt}_V.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),c(r)||(r=new $b(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),c(r)||(r=new $b(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};_V.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};_V.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,l=a.length,d,u=!0,f=!1;do{for(f=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(f=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<l;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(f=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(f);return u};_V.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 ut.FAILED};_V.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 TV=_V;var ret=[];function Hl(e,t,n,i){C.defined("scene",e),C.defined("entityCollection",t),n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Zt,this._removedObjects=new Zt,this._changedObjects=new Zt;let o=Sn.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 TV(n,e,s,!1),this._outlineBatches[o+s]=new TV(n,e,s,!0),this._closedColorBatches[s]=new nm(n,an,void 0,!0,s,!0),this._closedColorBatches[o+s]=new nm(n,an,void 0,!0,s,!1),this._closedMaterialBatches[s]=new im(n,so,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new im(n,so,void 0,!0,s,!1),this._openColorBatches[s]=new nm(n,an,void 0,!1,s,!0),this._openColorBatches[o+s]=new nm(n,an,void 0,!1,s,!1),this._openMaterialBatches[s]=new im(n,so,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new im(n,so,void 0,!1,s,!1);let a=Un.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new P2(i,s,so)),l[s]=new gV(i,s);else for(s=0;s<a;++s)l[s]=new gV(i,s);this._groundColorBatches=l,this._groundMaterialBatches=d,this._dynamicBatch=new aT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Zt,this._updaterSets=new Zt,this._entityCollection=t,t.collectionChanged.addEventListener(Hl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ret)}Hl.registerUpdater=function(e){gT.registerUpdater(e)};Hl.unregisterUpdater=function(e){gT.unregisterUpdater(e)};Hl.prototype.update=function(e){C.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,d,u,f=this;for(a=s.length-1;a>-1;a--)l=s[a],d=l.id,u=this._updaterSets.get(d),u.entity===l?u.forEach(function(g){f._removeUpdater(g),f._insertUpdaterIntoBatch(e,g)}):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],d=l.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--)l=n[a],d=l.id,u=new gT(l,this._scene),this._updaterSets.set(d,u),u.forEach(function(g){f._insertUpdaterIntoBatch(e,g)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Hl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,y=this._batches,h=y.length;for(a=0;a<h;a++)p=y[a].update(e)&&p;return p};var set=[],aet=new ue;Hl.prototype.getBoundingSphere=function(e,t){C.defined("entity",e),C.defined("result",t);let n=set,i=aet,o=0,r=ut.DONE,s=this._batches,a=s.length,l=e.id,d=this._updaterSets.get(l).updaters;for(let u=0;u<d.length;u++){let f=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(f,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ue.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,ue.fromBoundingSpheres(n,t),ut.DONE)};Hl.prototype.isDestroyed=function(){return!1};Hl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hl.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(),he(this)};Hl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Hl.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=Sn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(c(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 Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Hl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Hl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var v2=Hl;var Vbi=_(T(),1);var cet=1,det="30px sans-serif",uet=Yo.FILL,met=Y.WHITE,fet=Y.BLACK,het=1,pet=!1,bet=new Y(.165,.165,.165,.8),yet=new D(7,5),get=D.ZERO,xet=m.ZERO,_et=ze.NONE,Tet=xi.CENTER,Cet=Mn.CENTER,Vet=new m,Let=new Y,Zet=new Y,Ret=new Y,Get=new D,Eet=new m,Xet=new D,Iet=new Nt,Wet=new Nt,wet=new Nt,Pet=new vt;function che(e){this.entity=e,this.label=void 0,this.index=void 0}function og(e,t){if(!c(e))throw new L("entityCluster is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(og.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}og.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=r.label,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;if(u&&(f=J.getValueOrUndefined(s._position,e,Vet),l=J.getValueOrUndefined(a._text,e),u=c(f)&&c(l)),!u){UJ(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,y=J.getValueOrDefault(a._heightReference,e,_et);c(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=m.equals(d.position,f)&&d.heightReference===y),d.show=!0,d.position=f,d.text=l,d.scale=J.getValueOrDefault(a._scale,e,cet),d.font=J.getValueOrDefault(a._font,e,det),d.style=J.getValueOrDefault(a._style,e,uet),d.fillColor=J.getValueOrDefault(a._fillColor,e,met,Let),d.outlineColor=J.getValueOrDefault(a._outlineColor,e,fet,Zet),d.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,het),d.showBackground=J.getValueOrDefault(a._showBackground,e,pet),d.backgroundColor=J.getValueOrDefault(a._backgroundColor,e,bet,Ret),d.backgroundPadding=J.getValueOrDefault(a._backgroundPadding,e,yet,Get),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,get,Xet),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,xet,Eet),d.heightReference=y,d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,Tet),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,Cet),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Iet),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Wet),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,wet),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,Pet),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};og.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.label))return ut.FAILED;let i=n.label;return t.center=m.clone(i._clampedPosition??i.position,t.center),t.radius=0,ut.DONE};og.prototype.isDestroyed=function(){return!1};og.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(og.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return he(this)};og.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],c(r._label)&&c(r._position)&&s.set(r.id,new che(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._label)&&c(r._position)?s.contains(r.id)||s.set(r.id,new che(r)):(UJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],UJ(s.get(r.id),r,a),s.remove(r.id)};function UJ(e,t,n){c(e)&&(e.label=void 0,n.removeLabel(t))}var F2=og;var Hbi=_(T(),1);var vet=1,Fet=!0,Aet=0,Met=!0,Net=!0,ket=Sn.ENABLED,Uet=ze.NONE,Oet=Y.RED,Det=0,Bet=Y.WHITE,Yet=bc.HIGHLIGHT,Het=.5,zet=new D(1,1),lhe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Ket=new M,Jet=new M,dhe=new Y,uhe=new Array(4),Qet=new m;function rg(e,t){C.typeOf.object("scene",e),C.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(rg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}async function jet(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await af.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!c(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(l=>{c(s[t.id])&&(console.log(l),l.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!c(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}rg.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;if(u&&(f=s.computeModelMatrix(e,Ket),l=Ge.createIfNeeded(J.getValueOrUndefined(a._uri,e)),u=c(f)&&c(l)),!u){c(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!c(d)||l.url!==d.url){c(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:l.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...lhe}},n[s.id]=d;let h=J.getValueOrDefault(a._incrementallyLoadTextures,e,Met),g=J.getValueOrDefault(a._environmentMapOptions,e,lhe,d.environmentMapOptionsScratch);jet(this,s,l,h,g)}let p=d.modelPrimitive;if(!c(p))continue;p.show=!0,p.scale=J.getValueOrDefault(a._scale,e,vet),p.enableVerticalExaggeration=J.getValueOrDefault(a._enableVerticalExaggeration,e,Fet),p.minimumPixelSize=J.getValueOrDefault(a._minimumPixelSize,e,Aet),p.maximumScale=J.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=M.clone(f,p.modelMatrix),p.shadows=J.getValueOrDefault(a._shadows,e,ket),p.heightReference=J.getValueOrDefault(a._heightReference,e,Uet),p.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=J.getValueOrDefault(a._silhouetteColor,e,Oet,dhe),p.silhouetteSize=J.getValueOrDefault(a._silhouetteSize,e,Det),p.color=J.getValueOrDefault(a._color,e,Bet,dhe),p.colorBlendMode=J.getValueOrDefault(a._colorBlendMode,e,Yet),p.colorBlendAmount=J.getValueOrDefault(a._colorBlendAmount,e,Het),p.clippingPlanes=J.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=J.getValueOrDefault(a._clampAnimations,e,Net),p.imageBasedLighting.imageBasedLightingFactor=J.getValueOrDefault(a._imageBasedLightingFactor,e,zet);let y=J.getValueOrUndefined(a._lightColor,e);if(c(y)&&(Y.pack(y,uhe,0),y=m.unpack(uhe,0,Qet)),p.lightColor=y,p.customShader=J.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let h=J.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==h&&(h?p.activeAnimations.addAll({loop:Al.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=h);let g=J.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(c(g)){let V=Object.keys(g);for(let Z=0,R=V.length;Z<R;++Z){let E=V[Z],I=g[E];if(!c(I))continue;let v=p.getNode(E);if(!c(v))continue;let P=M.fromTranslationRotationScale(I,Jet);v.matrix=M.multiply(v.originalMatrix,P,P)}}let x=!1,S=J.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(c(S)){let V=Object.keys(S);for(let Z=0,R=V.length;Z<R;++Z){let E=V[Z],I=S[E];c(I)&&(x=!0,p.setArticulationStage(E,I))}}x&&p.applyArticulations()}}return!0};rg.prototype.isDestroyed=function(){return!1};rg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(rg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)OJ(this,e[i],t,n);return he(this)};var cU=new m,qet=new pe;rg.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._modelHash[e.id];if(!c(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!c(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let o=this._scene,r=o.ellipsoid??re.default;if(i.heightReference!==ze.NONE){let a=i.modelMatrix;cU.x=a[12],cU.y=a[13],cU.z=a[14];let l=r.cartesianToCartographic(cU,qet),d=o.getHeight(l,i.heightReference);return c(d)&&(Lu(i.heightReference)?l.height=d:l.height+=d),ue.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(l),ut.DONE}return ue.clone(i.boundingSphere,t),ut.DONE};rg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._model)&&c(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._model)&&c(r._position)?($et(r,a),s.set(r.id,r)):(OJ(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],OJ(this,r,a,l),s.remove(r.id)};function OJ(e,t,n,i){let o=n[t.id];c(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function $et(e,t){let n=t[e.id];c(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var A2=rg;var L0i=_(T(),1);var t0i=_(T(),1);function sg(e){this._definitionChanged=new ye,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(sg.prototype,{isConstant:{get:function(){return J.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return c(this._value)?this._value.referenceFrame:Ui.FIXED}}});var ett=new ee;sg.prototype.getValue=function(e,t){return c(e)||(e=ee.now(ett)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};sg.prototype.setValue=function(e){this._value!==e&&(this._value=e,c(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),c(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};sg.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");if(c(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),c(n)?re.default.scaleToGeodeticSurface(n,n):void 0};sg.prototype.equals=function(e){return this===e||e instanceof sg&&this._value===e._value};sg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Mh=sg;var ttt=60,ntt=1,fhe=new Zn,DJ=new Zn,BJ=new Zn;function mhe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function itt(e,t,n,i,o,r,s,a,l){let d=a,u;u=e.getValueInReferenceFrame(t,r,l[d]),c(u)&&(l[d++]=u);let f=!c(o)||ee.lessThanOrEquals(o,t)||ee.greaterThanOrEquals(o,n),p=0,y=i.length,h=i[p],g=n,x=!1,S,V,Z;for(;p<y;){if(!f&&ee.greaterThanOrEquals(h,o)&&(u=e.getValueInReferenceFrame(o,r,l[d]),c(u)&&(l[d++]=u),f=!0),ee.greaterThan(h,t)&&ee.lessThan(h,g)&&!h.equals(o)&&(u=e.getValueInReferenceFrame(h,r,l[d]),c(u)&&(l[d++]=u)),p<y-1){if(s>0&&!x){let R=i[p+1],E=ee.secondsDifference(R,h);x=E>s,x&&(S=Math.ceil(E/s),V=0,Z=E/Math.max(S,2),S=Math.max(S-1,1))}if(x&&V<S){h=ee.addSeconds(h,Z,new ee),V++;continue}}x=!1,p++,h=i[p]}return u=e.getValueInReferenceFrame(n,r,l[d]),c(u)&&(l[d++]=u),d}function ott(e,t,n,i,o,r,s,a){let l,d=0,u=s,f=t,p=!c(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(f,n);)!p&&ee.greaterThanOrEquals(f,i)&&(p=!0,l=e.getValueInReferenceFrame(i,o,a[u]),c(l)&&(a[u]=l,u++)),l=e.getValueInReferenceFrame(f,o,a[u]),c(l)&&(a[u]=l,u++),d++,f=ee.addSeconds(t,r*d,new ee);return l=e.getValueInReferenceFrame(n,o,a[u]),c(l)&&(a[u]=l,u++),u}function rtt(e,t,n,i,o,r,s,a){let l,d=0,u=s,f=t,p=Math.max(r,60),y=!c(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(f,n);)!y&&ee.greaterThanOrEquals(f,i)&&(y=!0,l=e.getValueInReferenceFrame(i,o,a[u]),c(l)&&(a[u]=l,u++)),l=e.getValueInReferenceFrame(f,o,a[u]),c(l)&&(a[u]=l,u++),d++,f=ee.addSeconds(t,p*d,new ee);return l=e.getValueInReferenceFrame(n,o,a[u]),c(l)&&(a[u]=l,u++),u}function stt(e,t,n,i,o,r,s,a){BJ.start=t,BJ.stop=n;let l=s,d=e.intervals;for(let u=0;u<d.length;u++){let f=d.get(u);if(!Zn.intersect(f,BJ,fhe).isEmpty){let p=f.start;f.isStartIncluded||(f.isStopIncluded?p=f.stop:p=ee.addSeconds(f.start,ee.secondsDifference(f.stop,f.start)/2,new ee));let y=e.getValueInReferenceFrame(p,o,a[l]);c(y)&&(a[l]=y,l++)}}return l}function att(e,t,n,i,o,r,s,a){let l=e.getValueInReferenceFrame(t,o,a[s]);return c(l)&&(a[s++]=l),s}function ctt(e,t,n,i,o,r,s,a){DJ.start=t,DJ.stop=n;let l=s,d=e.intervals;for(let u=0;u<d.length;u++){let f=d.get(u);if(!Zn.intersect(f,DJ,fhe).isEmpty){let p=f.start,y=f.stop,h=t;ee.greaterThan(p,h)&&(h=p);let g=n;ee.lessThan(y,g)&&(g=y),l=hhe(f.data,h,g,i,o,r,l,a)}}return l}function hhe(e,t,n,i,o,r,s,a){for(;e instanceof Yb;)e=e.resolvedProperty;if(e instanceof xa){let l=e._property._times;s=itt(e,t,n,l,i,o,r,s,a)}else e instanceof XX?s=ott(e,t,n,i,o,r,s,a):e instanceof ya?s=ctt(e,t,n,i,o,r,s,a):e instanceof Hb?s=stt(e,t,n,i,o,r,s,a):e instanceof Oc||e instanceof Mh&&J.isConstant(e)?s=att(e,t,n,i,o,r,s,a):s=rtt(e,t,n,i,o,r,s,a);return s}function phe(e,t,n,i,o,r,s){c(s)||(s=[]);let a=hhe(e,t,n,i,o,r,0,s);return s.length=a,s}var ltt=new te;function M2(e,t){this._unusedIndexes=[],this._polylineCollection=new df,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}M2.prototype.update=function(e){if(this._referenceFrame===Ui.INERTIAL){let t=wt.computeIcrfToCentralBodyFixedMatrix(e,ltt);M.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};M2.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,l=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!c(a)||a.getValue(e));if(d){let f=J.getValueOrUndefined(i._leadTime,e),p=J.getValueOrUndefined(i._trailTime,e),y=n._availability,h=c(y),g=c(f),x=c(p);if(d=h||g&&x,d){if(x&&(r=ee.addSeconds(e,-p,new ee)),g&&(s=ee.addSeconds(e,f,new ee)),h){let S=y.start,V=y.stop;(!x||ee.greaterThan(S,r))&&(r=S),(!g||ee.lessThan(V,s))&&(s=V)}d=ee.lessThan(r,s)}}if(!d){c(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0);return}if(!c(l)){let f=this._unusedIndexes;if(f.length>0){let y=f.pop();l=this._polylineCollection.get(y),t.index=y}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}let u=J.getValueOrDefault(i._resolution,e,ttt);l.show=!0,l.positions=phe(o,r,s,e,this._referenceFrame,u,l.positions.slice()),l.material=qo.getValue(e,i._material,l.material),l.width=J.getValueOrDefault(i._width,e,ntt),l.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,l.distanceDisplayCondition)};M2.prototype.removeObject=function(e){let t=e.polyline;c(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};M2.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),he(this)};function ag(e,t){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(ag.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}ag.prototype.update=function(e){if(!c(e))throw new L("time is required.");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&&c(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,l=r.updater,d=Ui.FIXED;this._scene.mode===se.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(l===u&&c(u)){u.updateObject(e,r);continue}c(l)&&l.removeObject(r),c(u)||(u=new M2(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,c(u)&&u.updateObject(e,r)}return!0};ag.prototype.isDestroyed=function(){return!1};ag.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ag.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return he(this)};ag.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],c(r._path)&&c(r._position)&&a.set(r.id,new mhe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._path)&&c(r._position)?a.contains(r.id)||a.set(r.id,new mhe(r)):(s=a.get(r.id),c(s)&&(c(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),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};ag._subSample=phe;var N2=ag;var k0i=_(T(),1);var bhe=Y.WHITE,yhe=Y.BLACK,ghe=0,xhe=1,_he=0,The=Ar.NONE,She=new Y,dtt=new m,Che=new Y,Vhe=new Nt,Lhe=new Nt,Zhe=new vt;function Rhe(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 cg(e,t){if(!c(e))throw new L("entityCluster is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(cg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}cg.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l=r.pointPrimitive,d=r.billboard,u=J.getValueOrDefault(a._heightReference,e,ze.NONE),f=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),p;if(f&&(p=J.getValueOrUndefined(s._position,e,dtt),f=c(p)),!f){k2(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let y=!1,h=!1;if(u!==ze.NONE&&!c(d)?(c(l)&&(k2(r,s,n),l=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,y=!0,h=m.equals(d.position,p)&&d.heightReference===u):u===ze.NONE&&!c(l)&&(c(d)&&(k2(r,s,n),d=void 0),l=n.getPoint(s),l.id=s,r.pointPrimitive=l),c(l))l.show=!0,l.position=p,l.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,Vhe),l.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Lhe),l.color=J.getValueOrDefault(a._color,e,bhe,She),l.outlineColor=J.getValueOrDefault(a._outlineColor,e,yhe,Che),l.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,ghe),l.pixelSize=J.getValueOrDefault(a._pixelSize,e,xhe),l.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,Zhe),l.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,_he),l.splitDirection=J.getValueOrDefault(a._splitDirection,e,The);else if(c(d)){d.show=!0,d.position=p,d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,Vhe),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Lhe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,Zhe),d.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,_he),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,The),d.heightReference=u;let g=J.getValueOrDefault(a._color,e,bhe,She),x=J.getValueOrDefault(a._outlineColor,e,yhe,Che),S=Math.round(J.getValueOrDefault(a._outlineWidth,e,ghe)),V=Math.max(1,Math.round(J.getValueOrDefault(a._pixelSize,e,xhe)));if(S>0?(d.scale=1,y=y||S!==r.outlineWidth||V!==r.pixelSize||!Y.equals(g,r.color)||!Y.equals(x,r.outlineColor)):(d.scale=V/50,V=50,y=y||S!==r.outlineWidth||!Y.equals(g,r.color)||!Y.equals(x,r.outlineColor)),y){r.color=Y.clone(g,r.color),r.outlineColor=Y.clone(x,r.outlineColor),r.pixelSize=V,r.outlineWidth=S;let Z=g.alpha,R=g.toCssColorString(),E=x.toCssColorString(),I=JSON.stringify([R,V,E,S]);d.setImage(I,w_(Z,R,E,S,V))}h&&d._updateClamping()}}return!0};cg.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._items.get(e.id);if(!c(n)||!(c(n.pointPrimitive)||c(n.billboard)))return ut.FAILED;if(c(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!c(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return he(this)};cg.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],c(r._point)&&c(r._position)&&s.set(r.id,new Rhe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._point)&&c(r._position)?s.contains(r.id)||s.set(r.id,new Rhe(r)):(k2(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],k2(s.get(r.id),r,a),s.remove(r.id)};function k2(e,t,n){if(c(e)){let i=e.pointPrimitive;if(c(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;c(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var U2=cg;var xgi=_(T(),1);var Nyi=_(T(),1);var ayi=_(T(),1);var Whe=[];function utt(e,t,n,i,o){let r=Whe;r.length=o;let s,a=n.red,l=n.green,d=n.blue,u=n.alpha,f=i.red,p=i.green,y=i.blue,h=i.alpha;if(Y.equals(n,i)){for(s=0;s<o;s++)r[s]=Y.clone(n);return r}let g=(f-a)/o,x=(p-l)/o,S=(y-d)/o,V=(h-u)/o;for(s=0;s<o;s++)r[s]=new Y(a+s*g,l+s*x,d+s*S,u+s*V);return r}function O2(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new L("At least two positions are required.");if(typeof i!="number")throw new L("width must be a number");if(c(n)&&(o&&n.length<t.length||!o&&n.length<t.length-1))throw new L("colors has an invalid length.");this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._arcType=e.arcType??Kt.GEODESIC,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._workerName="createPolylineGeometry";let r=1+t.length*m.packedLength;r+=c(n)?1+n.length*Y.packedLength:1,this.packedLength=r+re.packedLength+We.packedLength+4}O2.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=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=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=Y.packedLength)Y.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var whe=re.clone(re.UNIT_SPHERE),Phe=new We,TT={positions:void 0,colors:void 0,ellipsoid:whe,vertexFormat:Phe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};O2.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=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+=Y.packedLength)s[i]=Y.unpack(e,t);let a=re.unpack(e,t,whe);t+=re.packedLength;let l=We.unpack(e,t,Phe);t+=We.packedLength;let d=e[t++],u=e[t++]===1,f=e[t++],p=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=We.clone(l,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=f,n._granularity=p,n):(TT.positions=r,TT.colors=s,TT.width=d,TT.colorsPerVertex=u,TT.arcType=f,TT.granularity=p,new O2(TT))};var Ghe=new m,Ehe=new m,Xhe=new m,Ihe=new m;O2.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,l,d,u,f=[],p=xo(e._positions,m.equalsEpsilon,!1,f);if(c(i)&&f.length>0){let A=0,k=f[0];i=i.filter(function(B,O){let H=!1;return o?H=O===k||O===0&&k===1:H=O+1===k,H?(A++,k=f[A],!1):!0})}let y=p.length;if(y<2||t<=0)return;if(r===Kt.GEODESIC||r===Kt.RHUMB){let A,k;r===Kt.GEODESIC?(A=w.chordLength(s,a.maximumRadius),k=vi.numberOfPoints):(A=s,k=vi.numberOfPointsRhumbLine);let B=vi.extractHeights(p,a);if(c(i)){let O=1;for(l=0;l<y-1;++l)O+=k(p[l],p[l+1],A);let H=new Array(O),U=0;for(l=0;l<y-1;++l){let K=p[l],Q=p[l+1],ie=i[l],j=k(K,Q,A);if(o&&l<O){let $=i[l+1],ne=utt(K,Q,ie,$,j),be=ne.length;for(d=0;d<be;++d)H[U++]=ne[d]}else for(d=0;d<j;++d)H[U++]=Y.clone(ie)}H[U]=Y.clone(i[i.length-1]),i=H,Whe.length=0}r===Kt.GEODESIC?p=vi.generateCartesianArc({positions:p,minDistance:A,ellipsoid:a,height:B}):p=vi.generateCartesianRhumbArc({positions:p,granularity:A,ellipsoid:a,height:B})}y=p.length;let h=y*4-4,g=new Float64Array(h*3),x=new Float64Array(h*3),S=new Float64Array(h*3),V=new Float32Array(h*2),Z=n.st?new Float32Array(h*2):void 0,R=c(i)?new Uint8Array(h*4):void 0,E=0,I=0,v=0,P=0,F;for(d=0;d<y;++d){d===0?(F=Ghe,m.subtract(p[0],p[1],F),m.add(p[0],F,F)):F=p[d-1],m.clone(F,Xhe),m.clone(p[d],Ehe),d===y-1?(F=Ghe,m.subtract(p[y-1],p[y-2],F),m.add(p[y-1],F,F)):F=p[d+1],m.clone(F,Ihe);let A,k;c(R)&&(d!==0&&!o?A=i[d-1]:A=i[d],d!==y-1&&(k=i[d]));let B=d===0?2:0,O=d===y-1?2:4;for(u=B;u<O;++u){m.pack(Ehe,g,E),m.pack(Xhe,x,E),m.pack(Ihe,S,E),E+=3;let H=u-2<0?-1:1;if(V[I++]=2*(u%2)-1,V[I++]=H*t,n.st&&(Z[v++]=d/(y-1),Z[v++]=Math.max(V[I-2],0)),c(R)){let U=u<2?A:k;R[P++]=Y.floatToByte(U.red),R[P++]=Y.floatToByte(U.green),R[P++]=Y.floatToByte(U.blue),R[P++]=Y.floatToByte(U.alpha)}}}let N=new fn;N.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:g}),N.prevPosition=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:x}),N.nextPosition=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:S}),N.expandAndWidth=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:V}),n.st&&(N.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:Z})),c(R)&&(N.color=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));let b=Me.createTypedArray(h,y*6-6),G=0,X=0,W=y-1;for(d=0;d<W;++d)b[X++]=G,b[X++]=G+2,b[X++]=G+1,b[X++]=G+1,b[X++]=G+2,b[X++]=G+3,G+=4;return new dt({attributes:N,indices:b,primitiveType:ve.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:yu.POLYLINES})};var e0=O2;var mtt=new Qn(0),lU={},vhe=new Y,ftt=new Ut(Y.WHITE),htt=new Qn(!0),ptt=new Qn(Sn.DISABLED),btt=new Qn(new vt),ytt=new Qn(Un.BOTH);function gtt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function xtt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Gf(e,t){if(!c(e))throw new L("entity is required");if(!c(t))throw new L("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Gf.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new ye,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 gtt,this._groundGeometryOptions=new xtt,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(Gf.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||!c(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}}});Gf.prototype.isOutlineVisible=function(e){return!1};Gf.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Gf.prototype.createFillGeometryInstance=function(e){if(!c(e))throw new L("time is required.");if(!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,vhe)),c(a)||(a=Y.WHITE),s.color=Yt.fromColor(a)),this.clampToGround?new Rt({id:t,geometry:new vx(this._groundGeometryOptions),attributes:s}):(c(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(c(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,vhe)),c(a)||(a=Y.WHITE),s.depthFailColor=Yt.fromColor(a)),new Rt({id:t,geometry:new e0(this._geometryOptions),attributes:s}))};Gf.prototype.createOutlineGeometryInstance=function(e){throw new L("This instance does not represent an outlined geometry.")};Gf.prototype.isDestroyed=function(){return!1};Gf.prototype.destroy=function(){this._entitySubscription(),he(this)};Gf.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!c(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(c(s)&&s.isConstant&&!s.getValue(Ye.MINIMUM_VALUE)||!c(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,l=o.material??ftt,d=l instanceof Ut;this._materialProperty=l,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??htt,this._shadowsProperty=o.shadows??ptt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??btt,this._classificationTypeProperty=o.classificationType??ytt,this._fillEnabled=!0,this._zIndex=a??mtt;let u=o.width,f=o.arcType,p=o.clampToGround,y=o.granularity;if(!r.isConstant||!J.isConstant(u)||!J.isConstant(f)||!J.isConstant(y)||!J.isConstant(p)||!J.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let h=this._geometryOptions,g=r.getValue(Ye.MINIMUM_VALUE,h.positions);if(!c(g)||g.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x;d&&(!c(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?x=es.VERTEX_FORMAT:x=ua.VERTEX_FORMAT,h.vertexFormat=x,h.positions=g,h.width=c(u)?u.getValue(Ye.MINIMUM_VALUE):void 0,h.arcType=c(f)?f.getValue(Ye.MINIMUM_VALUE):void 0,h.granularity=c(y)?y.getValue(Ye.MINIMUM_VALUE):void 0;let S=this._groundGeometryOptions;S.positions=g,S.width=h.width,S.arcType=h.arcType,S.granularity=h.granularity,this._clampToGround=c(p)?p.getValue(Ye.MINIMUM_VALUE):!1,!this._clampToGround&&c(a)&&ht("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Gf.prototype.createDynamicUpdater=function(e,t){if(C.defined("primitives",e),C.defined("groundPrimitives",t),!this._dynamic)throw new L("This instance does not represent dynamic geometry.");return new D2(e,t,this)};var SV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function D2(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 Fhe(e){if(c(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=lU[n];!c(i)||i.isDestroyed()?(i=new df,lU[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}D2.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,Kt.GEODESIC),t._groundGeometryOptions.granularity=J.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(c(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)||!c(r)||r.length<2)return;let f=t.fillMaterialProperty,p;if(f instanceof Ut)p=new es;else{let y=qo.getValue(e,f,this._material);p=new ua({material:y,translucent:y.isTranslucent()}),this._material=y}this._groundPolylinePrimitive=s.add(new Am({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),J.getValueOrUndefined(t.zIndex,e)),c(this._line)&&(this._line.show=!1);return}let a=Fhe(this);if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!c(r)||r.length<2){a.show=!1;return}let l=Kt.GEODESIC;l=J.getValueOrDefault(i._arcType,e,l);let d=t._scene.globe,u=t._scene.ellipsoid;l!==Kt.NONE&&c(d)&&(SV.ellipsoid=u,SV.positions=r,SV.granularity=J.getValueOrUndefined(i._granularity,e),SV.height=vi.extractHeights(r,u),l===Kt.GEODESIC?r=vi.generateCartesianArc(SV):r=vi.generateCartesianRhumbArc(SV)),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)};D2.prototype.getBoundingSphere=function(e){if(C.defined("result",e),this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(c(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(c(n)&&c(n.boundingSphere))return ue.clone(n.boundingSphere,e),ut.DONE}return c(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=Fhe(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};D2.prototype.isDestroyed=function(){return!1};D2.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=lU[t];c(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete lU[t])),c(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),he(this)};var B2=Gf;var tgi=_(T(),1);var _tt=new Y,Ttt=new vt,Stt=new vt;function Ef(e,t,n,i,o){let r;n instanceof Ut?r=es:r=ua,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ef.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.zIndex=i,this._asynchronous=o}Ef.prototype.onMaterialChanged=function(){this.invalidated=!0};Ef.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Ef.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,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ef.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 c(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Ef.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Am({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(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 l=s[r],d=l.entity,u=this.geometry.get(l.id),f=this.attributes.get(u.id.id);if(c(f)||(f=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!l.fillMaterialProperty.isConstant){let g=l.fillMaterialProperty.color,x=J.getValueOrDefault(g,e,Y.WHITE,_tt);Y.equals(f._lastColor,x)||(f._lastColor=Y.clone(x,f._lastColor),f.color=Yt.toValue(x,f.color))}let p=d.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=l.distanceDisplayConditionProperty;if(!J.isConstant(h)){let g=J.getValueOrDefault(h,e,Stt,Ttt);vt.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(g,f.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Ef.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,d=a.show[0]===1;l!==d&&(a.show=Tn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ef.prototype.contains=function(e){return this.updaters.contains(e.id)};Ef.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Ef.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function CV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}CV.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 l=n[a];if(l.isMaterial(t)&&l.zIndex===r){l.add(e,t,o);return}}let s=new Ef(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};CV.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}}};CV.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};CV.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 ut.FAILED};CV.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 Y2=CV;var Ctt=[];function Ahe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Mhe(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;c(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;c(i)&&(r=i+o*Sn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Nh(e,t,n,i){C.defined("scene",e),C.defined("entityCollection",t),i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Zt,this._removedObjects=new Zt,this._changedObjects=new Zt;let o,r=Sn.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 nm(n,es,void 0,!1,o),this._materialBatches[o]=new im(n,ua,void 0,!1,o),this._colorBatches[o+r]=new nm(n,es,es,!1,o),this._materialBatches[o+r]=new im(n,ua,es,!1,o),this._colorBatches[o+r*2]=new nm(n,es,ua,!1,o),this._materialBatches[o+r*2]=new im(n,ua,ua,!1,o);this._dynamicBatch=new aT(n,i);let s=Un.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new Y2(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Zt,this._updaters=new Zt,this._entityCollection=t,t.collectionChanged.addEventListener(Nh.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Ctt)}Nh.prototype.update=function(e){C.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,d,u;for(a=s.length-1;a>-1;a--)l=s[a],d=l.id,u=this._updaters.get(d),u.entity===l?(Ahe(this,u),Mhe(this,e,u)):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],d=l.id,u=this._updaters.get(d),Ahe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)l=n[a],d=l.id,u=new B2(l,this._scene),this._updaters.set(d,u),Mhe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Nh._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let f=!0,p=this._batches,y=p.length;for(a=0;a<y;a++)f=p[a].update(e)&&f;return f};var Vtt=[],Ltt=new ue;Nh.prototype.getBoundingSphere=function(e,t){C.defined("entity",e),C.defined("result",t);let n=Vtt,i=Ltt,o=0,r=ut.DONE,s=this._batches,a=s.length,l=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(l,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ue.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,ue.fromBoundingSpheres(n,t),ut.DONE)};Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Nh.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(),he(this)};Nh._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Nh.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var H2=Nh;function zl(e){C.typeOf.object("options",e),C.typeOf.object("options.scene",e.scene),C.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),kc.initializeTerrainHeights(),Am.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new hr,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=e.visualizersCallback??zl.defaultVisualizersCallback;let i=!1,o=new al,r=new al;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 JP;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,l;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),l(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),l=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=l,this._ready=!1}var VV=[];zl.registerVisualizer=function(e){VV.includes(e)||VV.push(e)};zl.unregisterVisualizer=function(e){if(VV.includes(e)){let t=VV.indexOf(e);VV.splice(t,1)}};zl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new yE(t,i),new v2(e,i,n._primitives,n._groundPrimitives),new F2(t,i),new A2(e,i),new PP(e,i),new U2(t,i),new N2(e,i),new H2(e,i,n._primitives,n._groundPrimitives),...VV.map(o=>new o(e,i))]};Object.defineProperties(zl.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}}});zl.prototype.isDestroyed=function(){return!1};zl.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),c(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),he(this)};zl.prototype.update=function(e){if(C.defined("time",e),!ui.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 l=s.get(n);for(c(l.update)&&(t=l.update(e)&&t),o=l._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};zl.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;c(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)e.creditDisplay.addCreditToNextFrame(s[l])}}};var Ztt=[],Rtt=new ue;zl.prototype.getBoundingSphere=function(e,t,n){if(C.defined("entity",e),C.typeOf.bool("allowPartial",t),C.defined("result",n),!this._ready)return ut.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 y=p.get(i);if(y.entities.contains(e)){r=y;break}}}if(!c(r))return ut.FAILED;let s=Ztt,a=Rtt,l=0,d=ut.DONE,u=r._visualizers,f=u.length;for(i=0;i<f;i++){let p=u[i];if(c(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===ut.PENDING)return ut.PENDING;d===ut.DONE&&(s[l]=ue.clone(a,s[l]),l++)}}return l===0?ut.FAILED:(s.length=l,ue.fromBoundingSpheres(s,n),ut.DONE)};zl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new al),s=o.add(new d2);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};zl.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,l=a.length;for(let d=0;d<l;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};zl.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 z2=zl;var sxi=_(T(),1);var Bgi=_(T(),1);function YJ(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}YJ.clone=function(e,t){if(c(e))return c(t)||(t=new YJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var rm=YJ;var Nhe=new te,khe=new te,Uhe=new te,Gtt=new M,dU=new m,Ohe=new m,HJ=new m,zJ=new m,Dhe=new m,Bhe=new m,Ett=new Fe,Xtt=new m,Itt=new te,LV=new ee,Wtt=1.25;function wtt(e,t,n,i,o,r,s,a,l,d){let u=e.scene.mode,f=o.getValue(l,e._lastCartesian);if(c(f)){let p=!1,y=!1,h,g,x;if(u===se.SCENE3D){ee.addSeconds(l,.001,LV);let v=o.getValue(LV,dU);if(c(v)||(ee.addSeconds(l,-.001,LV),v=o.getValue(LV,dU),y=!0),c(v)){let P=wt.computeFixedToIcrfMatrix(l,Nhe),F=wt.computeFixedToIcrfMatrix(LV,khe),N;!c(P)||!c(F)?(N=wt.computeTemeToPseudoFixedMatrix(l,Uhe),P=te.transpose(N,Nhe),F=wt.computeTemeToPseudoFixedMatrix(LV,khe),te.transpose(F,F)):N=te.transpose(P,Uhe);let b=te.multiplyByVector(P,f,Dhe),G=te.multiplyByVector(F,v,Bhe);m.subtract(b,G,zJ);let X=m.magnitude(zJ)*1e3,W=w.GRAVITATIONALPARAMETER,A=-W/(X*X-2*W/m.magnitude(b));A<0||A>Wtt*d.maximumRadius?(h=Ohe,m.normalize(f,h),m.negate(h,h),x=m.clone(m.UNIT_Z,HJ),g=m.cross(x,h,dU),m.magnitude(g)>w.EPSILON7&&(m.normalize(h,h),m.normalize(g,g),x=m.cross(h,g,HJ),m.normalize(x,x),p=!0)):m.equalsEpsilon(f,v,w.EPSILON7)||(x=Ohe,m.normalize(b,x),m.normalize(G,G),g=m.cross(x,G,HJ),y&&(g=m.multiplyByScalar(g,-1,g)),m.equalsEpsilon(g,m.ZERO,w.EPSILON7)||(h=m.cross(g,x,dU),te.multiplyByVector(N,h,h),te.multiplyByVector(N,g,g),te.multiplyByVector(N,x,x),m.normalize(h,h),m.normalize(g,g),m.normalize(x,x),p=!0))}}c(e.boundingSphere)&&(f=e.boundingSphere.center);let S,V,Z;i&&(S=m.clone(t.position,zJ),V=m.clone(t.direction,Dhe),Z=m.clone(t.up,Bhe));let R=Gtt,E;c(s)&&(E=s.getValue(l,Ett));let I=r.getValue(l,Xtt);if(a===vp.INERTIAL&&c(E))M.fromTranslationQuaternionRotationScale(f,E,m.ONE,R);else if(a===vp.VELOCITY&&c(I)){let v=wt.rotationMatrixFromPositionVelocity(f,I,d,Itt);M.fromRotationTranslation(v,f,R)}else a===vp.ENU||!p?wt.eastNorthUpToFixedFrame(f,d,R):(R[0]=h.x,R[1]=h.y,R[2]=h.z,R[3]=0,R[4]=g.x,R[5]=g.y,R[6]=g.z,R[7]=0,R[8]=x.x,R[9]=x.y,R[10]=x.z,R[11]=0,R[12]=f.x,R[13]=f.y,R[14]=f.z,R[15]=0);t._setTransform(R),i&&(m.clone(S,t.position),m.clone(V,t.direction),m.clone(Z,t.up),m.cross(V,Z,t.right))}if(n){let p=u===se.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function K2(e,t,n){C.defined("entity",e),C.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=n??re.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new Kb(e.position,!0),this._offset3D=new m}Object.defineProperties(K2,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});K2.defaultOffset3D=new m(-14e3,3500,3500);var uU=new rm,Ptt=new m;K2.prototype.update=function(e,t){C.defined("time",e);let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===se.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!c(a))return;let l=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,f=o!==this._mode,p=n.camera,y=u||f,h=!0;if(u){let g=r.viewFrom,x=c(g);if(!x&&c(t)){uU.pitch=-w.PI_OVER_FOUR,uU.range=0;let S=a.getValue(e,Ptt);if(c(S)){let V=2-1/Math.max(1,m.magnitude(S)/i.maximumRadius);uU.pitch*=V}p.viewBoundingSphere(t,uU),this.boundingSphere=t,y=!1,h=!1}else(!x||!c(g.getValue(e,this._offset3D)))&&m.clone(K2._defaultOffset3D,this._offset3D)}else!f&&this._mode!==se.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,wtt(this,p,y,h,a,l,d,s,e,i)};var J2=K2;var ETi=_(T(),1);var J_i=_(T(),1);var cxi=_(T(),1);function gU(e){return xU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function xU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?xU(n):n),[])}var Yhe=[0,1,2,3].concat(...gU([[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 br(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,f,p,y,h,g,x=0;for(y=0;y<=15;y++)o.bl_count[y]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)f=o.heap[u],y=r[r[f*2+1]*2+1]+1,y>d&&(y=d,x++),r[f*2+1]=y,!(f>e.max_code)&&(o.bl_count[y]++,h=0,f>=l&&(h=a[f-l]),g=r[f*2],o.opt_len+=g*(y+h),s&&(o.static_len+=g*(s[f*2+1]+h)));if(x!==0){do{for(y=d-1;o.bl_count[y]===0;)y--;o.bl_count[y]--,o.bl_count[y+1]+=2,o.bl_count[d]--,x-=2}while(x>0);for(y=d;y!==0;y--)for(f=o.bl_count[y];f!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=y&&(o.opt_len+=(y-r[p*2+1])*r[p*2],r[p*2+1]=y),f--)}}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=[],l=0,d,u,f;for(d=1;d<=15;d++)a[d]=l=l+s[d-1]<<1;for(u=0;u<=r;u++)f=o[u*2+1],f!==0&&(o[u*2]=n(a[f]++,f))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,l,d,u=-1,f;for(o.heap_len=0,o.heap_max=573,l=0;l<a;l++)r[l*2]!==0?(o.heap[++o.heap_len]=u=l,o.depth[l]=0):r[l*2+1]=0;for(;o.heap_len<2;)f=o.heap[++o.heap_len]=u<2?++u:0,r[f*2]=1,o.depth[f]=0,o.opt_len--,s&&(o.static_len-=s[f*2+1]);for(e.max_code=u,l=Math.floor(o.heap_len/2);l>=1;l--)o.pqdownheap(r,l);f=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=d,r[f*2]=r[l*2]+r[d*2],o.depth[f]=Math.max(o.depth[l],o.depth[d])+1,r[l*2+1]=r[d*2+1]=f,o.heap[1]=f++,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)}}br._length_code=[0,1,2,3,4,5,6,7].concat(...gU([[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]]));br.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];br.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];br.d_code=function(e){return e<256?Yhe[e]:Yhe[256+(e>>>7)]};br.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];br.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];br.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];br.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function ka(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 vtt=[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],Ftt=gU([[144,8],[112,9],[24,7],[8,8]]);ka.static_ltree=xU(vtt.map((e,t)=>[e,Ftt[t]]));var Att=[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],Mtt=gU([[30,5]]);ka.static_dtree=xU(Att.map((e,t)=>[e,Mtt[t]]));ka.static_l_desc=new ka(ka.static_ltree,br.extra_lbits,257,286,15);ka.static_d_desc=new ka(ka.static_dtree,br.extra_dbits,0,30,15);ka.static_bl_desc=new ka(null,br.extra_blbits,0,19,7);var Ntt=9,ktt=8;function kh(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 zhe=0,bU=1,ST=2,Xf=[new kh(0,0,0,0,zhe),new kh(4,4,8,4,bU),new kh(4,5,16,8,bU),new kh(4,6,32,32,bU),new kh(4,4,16,16,ST),new kh(8,16,32,32,ST),new kh(8,16,128,128,ST),new kh(8,32,128,256,ST),new kh(32,128,258,1024,ST),new kh(32,258,258,4096,ST)],mU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],sm=0,fU=1,Q2=2,hU=3,Utt=32,KJ=42,pU=113,j2=666,JJ=8,Ott=0,QJ=1,Dtt=2,Xr=3,yU=258,Ud=yU+Xr+1;function Hhe(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Btt(){let e=this,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g,x,S,V,Z,R,E,I,v,P,F,N,b,G,X,W,A,k,B,O=new br,H=new br,U=new br;e.depth=[];let K,Q,ie,j,$,ne;e.bl_count=[],e.heap=[],A=[],k=[],B=[];function be(){d=2*r,f[y-1]=0;for(let Ae=0;Ae<y-1;Ae++)f[Ae]=0;N=Xf[b].max_lazy,X=Xf[b].good_length,W=Xf[b].nice_length,F=Xf[b].max_chain,E=0,S=0,v=0,V=P=Xr-1,R=0,p=0}function Ce(){let Ae;for(Ae=0;Ae<286;Ae++)A[Ae*2]=0;for(Ae=0;Ae<30;Ae++)k[Ae*2]=0;for(Ae=0;Ae<19;Ae++)B[Ae*2]=0;A[256*2]=1,e.opt_len=e.static_len=0,Q=ie=0}function me(){O.dyn_tree=A,O.stat_desc=ka.static_l_desc,H.dyn_tree=k,H.stat_desc=ka.static_d_desc,U.dyn_tree=B,U.stat_desc=ka.static_bl_desc,$=0,ne=0,j=8,Ce()}e.pqdownheap=function(Ae,st){let Qe=e.heap,$e=Qe[st],yt=st<<1;for(;yt<=e.heap_len&&(yt<e.heap_len&&Hhe(Ae,Qe[yt+1],Qe[yt],e.depth)&&yt++,!Hhe(Ae,$e,Qe[yt],e.depth));)Qe[st]=Qe[yt],st=yt,yt<<=1;Qe[st]=$e};function _e(Ae,st){let Qe=-1,$e,yt=Ae[0*2+1],Bt=0,Ln=7,Io=4;yt===0&&(Ln=138,Io=3),Ae[(st+1)*2+1]=65535;for(let To=0;To<=st;To++)$e=yt,yt=Ae[(To+1)*2+1],!(++Bt<Ln&&$e==yt)&&(Bt<Io?B[$e*2]+=Bt:$e!==0?($e!=Qe&&B[$e*2]++,B[16*2]++):Bt<=10?B[17*2]++:B[18*2]++,Bt=0,Qe=$e,yt===0?(Ln=138,Io=3):$e==yt?(Ln=6,Io=3):(Ln=7,Io=4))}function Ve(){let Ae;for(_e(A,O.max_code),_e(k,H.max_code),U.build_tree(e),Ae=18;Ae>=3&&B[br.bl_order[Ae]*2+1]===0;Ae--);return e.opt_len+=3*(Ae+1)+5+5+4,Ae}function Ie(Ae){e.pending_buf[e.pending++]=Ae}function Ze(Ae){Ie(Ae&255),Ie(Ae>>>8&255)}function De(Ae){Ie(Ae>>8&255),Ie(Ae&255&255)}function Ke(Ae,st){let Qe,$e=st;ne>16-$e?(Qe=Ae,$|=Qe<<ne&65535,Ze($),$=Qe>>>16-ne,ne+=$e-16):($|=Ae<<ne&65535,ne+=$e)}function rt(Ae,st){let Qe=Ae*2;Ke(st[Qe]&65535,st[Qe+1]&65535)}function Xt(Ae,st){let Qe,$e=-1,yt,Bt=Ae[0*2+1],Ln=0,Io=7,To=4;for(Bt===0&&(Io=138,To=3),Qe=0;Qe<=st;Qe++)if(yt=Bt,Bt=Ae[(Qe+1)*2+1],!(++Ln<Io&&yt==Bt)){if(Ln<To)do rt(yt,B);while(--Ln!==0);else yt!==0?(yt!=$e&&(rt(yt,B),Ln--),rt(16,B),Ke(Ln-3,2)):Ln<=10?(rt(17,B),Ke(Ln-3,3)):(rt(18,B),Ke(Ln-11,7));Ln=0,$e=yt,Bt===0?(Io=138,To=3):yt==Bt?(Io=6,To=3):(Io=7,To=4)}}function Ht(Ae,st,Qe){let $e;for(Ke(Ae-257,5),Ke(st-1,5),Ke(Qe-4,4),$e=0;$e<Qe;$e++)Ke(B[br.bl_order[$e]*2+1],3);Xt(A,Ae-1),Xt(k,st-1)}function qe(){ne==16?(Ze($),$=0,ne=0):ne>=8&&(Ie($&255),$>>>=8,ne-=8)}function mn(){Ke(QJ<<1,3),rt(256,ka.static_ltree),qe(),1+j+10-ne<9&&(Ke(QJ<<1,3),rt(256,ka.static_ltree),qe()),j=7}function Dt(Ae,st){let Qe,$e,yt;if(e.dist_buf[Q]=Ae,e.lc_buf[Q]=st&255,Q++,Ae===0?A[st*2]++:(ie++,Ae--,A[(br._length_code[st]+256+1)*2]++,k[br.d_code(Ae)*2]++),!(Q&8191)&&b>2){for(Qe=Q*8,$e=E-S,yt=0;yt<30;yt++)Qe+=k[yt*2]*(5+br.extra_dbits[yt]);if(Qe>>>=3,ie<Math.floor(Q/2)&&Qe<Math.floor($e/2))return!0}return Q==K-1}function Lt(Ae,st){let Qe,$e,yt=0,Bt,Ln;if(Q!==0)do Qe=e.dist_buf[yt],$e=e.lc_buf[yt],yt++,Qe===0?rt($e,Ae):(Bt=br._length_code[$e],rt(Bt+256+1,Ae),Ln=br.extra_lbits[Bt],Ln!==0&&($e-=br.base_length[Bt],Ke($e,Ln)),Qe--,Bt=br.d_code(Qe),rt(Bt,st),Ln=br.extra_dbits[Bt],Ln!==0&&(Qe-=br.base_dist[Bt],Ke(Qe,Ln)));while(yt<Q);rt(256,Ae),j=Ae[256*2+1]}function Vi(){ne>8?Ze($):ne>0&&Ie($&255),$=0,ne=0}function ln(Ae,st,Qe){Vi(),j=8,Qe&&(Ze(st),Ze(~st)),e.pending_buf.set(l.subarray(Ae,Ae+st),e.pending),e.pending+=st}function ge(Ae,st,Qe){Ke((Ott<<1)+(Qe?1:0),3),ln(Ae,st,!0)}function Le(Ae,st,Qe){let $e,yt,Bt=0;b>0?(O.build_tree(e),H.build_tree(e),Bt=Ve(),$e=e.opt_len+3+7>>>3,yt=e.static_len+3+7>>>3,yt<=$e&&($e=yt)):$e=yt=st+5,st+4<=$e&&Ae!=-1?ge(Ae,st,Qe):yt==$e?(Ke((QJ<<1)+(Qe?1:0),3),Lt(ka.static_ltree,ka.static_dtree)):(Ke((Dtt<<1)+(Qe?1:0),3),Ht(O.max_code+1,H.max_code+1,Bt+1),Lt(A,k)),Ce(),Qe&&Vi()}function yn(Ae){Le(S>=0?S:-1,E-S,Ae),S=E,t.flush_pending()}function bt(){let Ae,st,Qe,$e;do{if($e=d-v-E,$e===0&&E===0&&v===0)$e=r;else if($e==-1)$e--;else if(E>=r+r-Ud){l.set(l.subarray(r,r+r),0),I-=r,E-=r,S-=r,Ae=y,Qe=Ae;do st=f[--Qe]&65535,f[Qe]=st>=r?st-r:0;while(--Ae!==0);Ae=r,Qe=Ae;do st=u[--Qe]&65535,u[Qe]=st>=r?st-r:0;while(--Ae!==0);$e+=r}if(t.avail_in===0)return;Ae=t.read_buf(l,E+v,$e),v+=Ae,v>=Xr&&(p=l[E]&255,p=(p<<x^l[E+1]&255)&g)}while(v<Ud&&t.avail_in!==0)}function ro(Ae){let st=65535,Qe;for(st>i-5&&(st=i-5);;){if(v<=1){if(bt(),v===0&&Ae==0)return sm;if(v===0)break}if(E+=v,v=0,Qe=S+st,(E===0||E>=Qe)&&(v=E-Qe,E=Qe,yn(!1),t.avail_out===0)||E-S>=r-Ud&&(yn(!1),t.avail_out===0))return sm}return yn(Ae==4),t.avail_out===0?Ae==4?Q2:sm:Ae==4?hU:fU}function Xo(Ae){let st=F,Qe=E,$e,yt,Bt=P,Ln=E>r-Ud?E-(r-Ud):0,Io=W,To=a,Ka=E+yU,Ja=l[Qe+Bt-1],Li=l[Qe+Bt];P>=X&&(st>>=2),Io>v&&(Io=v);do if($e=Ae,!(l[$e+Bt]!=Li||l[$e+Bt-1]!=Ja||l[$e]!=l[Qe]||l[++$e]!=l[Qe+1])){Qe+=2,$e++;do;while(l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&Qe<Ka);if(yt=yU-(Ka-Qe),Qe=Ka-yU,yt>Bt){if(I=Ae,Bt=yt,yt>=Io)break;Ja=l[Qe+Bt-1],Li=l[Qe+Bt]}}while((Ae=u[Ae&To]&65535)>Ln&&--st!==0);return Bt<=v?Bt:v}function ra(Ae){let st=0,Qe;for(;;){if(v<Ud){if(bt(),v<Ud&&Ae==0)return sm;if(v===0)break}if(v>=Xr&&(p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E),st!==0&&(E-st&65535)<=r-Ud&&G!=2&&(V=Xo(st)),V>=Xr)if(Qe=Dt(E-I,V-Xr),v-=V,V<=N&&v>=Xr){V--;do E++,p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E;while(--V!==0);E++}else E+=V,V=0,p=l[E]&255,p=(p<<x^l[E+1]&255)&g;else Qe=Dt(0,l[E]&255),v--,E++;if(Qe&&(yn(!1),t.avail_out===0))return sm}return yn(Ae==4),t.avail_out===0?Ae==4?Q2:sm:Ae==4?hU:fU}function Wr(Ae){let st=0,Qe,$e;for(;;){if(v<Ud){if(bt(),v<Ud&&Ae==0)return sm;if(v===0)break}if(v>=Xr&&(p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E),P=V,Z=I,V=Xr-1,st!==0&&P<N&&(E-st&65535)<=r-Ud&&(G!=2&&(V=Xo(st)),V<=5&&(G==1||V==Xr&&E-I>4096)&&(V=Xr-1)),P>=Xr&&V<=P){$e=E+v-Xr,Qe=Dt(E-1-Z,P-Xr),v-=P-1,P-=2;do++E<=$e&&(p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E);while(--P!==0);if(R=0,V=Xr-1,E++,Qe&&(yn(!1),t.avail_out===0))return sm}else if(R!==0){if(Qe=Dt(0,l[E-1]&255),Qe&&yn(!1),E++,v--,t.avail_out===0)return sm}else R=1,E++,v--}return R!==0&&(Qe=Dt(0,l[E-1]&255),R=0),yn(Ae==4),t.avail_out===0?Ae==4?Q2:sm:Ae==4?hU:fU}function _s(Ae){return Ae.total_in=Ae.total_out=0,Ae.msg=null,e.pending=0,e.pending_out=0,n=pU,o=0,me(),be(),0}e.deflateInit=function(Ae,st,Qe,$e,yt,Bt){return $e||($e=JJ),yt||(yt=ktt),Bt||(Bt=0),Ae.msg=null,st==-1&&(st=6),yt<1||yt>Ntt||$e!=JJ||Qe<9||Qe>15||st<0||st>9||Bt<0||Bt>2?-2:(Ae.dstate=e,s=Qe,r=1<<s,a=r-1,h=yt+7,y=1<<h,g=y-1,x=Math.floor((h+Xr-1)/Xr),l=new Uint8Array(r*2),u=[],f=[],K=1<<yt+6,e.pending_buf=new Uint8Array(K*4),i=K*4,e.dist_buf=new Uint16Array(K),e.lc_buf=new Uint8Array(K),b=st,G=Bt,_s(Ae))},e.deflateEnd=function(){return n!=KJ&&n!=pU&&n!=j2?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,f=null,u=null,l=null,e.dstate=null,n==pU?-3:0)},e.deflateParams=function(Ae,st,Qe){let $e=0;return st==-1&&(st=6),st<0||st>9||Qe<0||Qe>2?-2:(Xf[b].func!=Xf[st].func&&Ae.total_in!==0&&($e=Ae.deflate(1)),b!=st&&(b=st,N=Xf[b].max_lazy,X=Xf[b].good_length,W=Xf[b].nice_length,F=Xf[b].max_chain),G=Qe,$e)},e.deflateSetDictionary=function(Ae,st,Qe){let $e=Qe,yt,Bt=0;if(!st||n!=KJ)return-2;if($e<Xr)return 0;for($e>r-Ud&&($e=r-Ud,Bt=Qe-$e),l.set(st.subarray(Bt,Bt+$e),0),E=$e,S=$e,p=l[0]&255,p=(p<<x^l[1]&255)&g,yt=0;yt<=$e-Xr;yt++)p=(p<<x^l[yt+(Xr-1)]&255)&g,u[yt&a]=f[p],f[p]=yt;return 0},e.deflate=function(Ae,st){let Qe,$e,yt,Bt,Ln;if(st>4||st<0)return-2;if(!Ae.next_out||!Ae.next_in&&Ae.avail_in!==0||n==j2&&st!=4)return Ae.msg=mU[4],-2;if(Ae.avail_out===0)return Ae.msg=mU[7],-5;if(t=Ae,Bt=o,o=st,n==KJ&&($e=JJ+(s-8<<4)<<8,yt=(b-1&255)>>1,yt>3&&(yt=3),$e|=yt<<6,E!==0&&($e|=Utt),$e+=31-$e%31,n=pU,De($e)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&st<=Bt&&st!=4)return t.msg=mU[7],-5;if(n==j2&&t.avail_in!==0)return Ae.msg=mU[7],-5;if(t.avail_in!==0||v!==0||st!=0&&n!=j2){switch(Ln=-1,Xf[b].func){case zhe:Ln=ro(st);break;case bU:Ln=ra(st);break;case ST:Ln=Wr(st);break;default:}if((Ln==Q2||Ln==hU)&&(n=j2),Ln==sm||Ln==Q2)return t.avail_out===0&&(o=-1),0;if(Ln==fU){if(st==1)mn();else if(ge(0,0,!1),st==3)for(Qe=0;Qe<y;Qe++)f[Qe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return st!=4?0:1}}function Khe(){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}Khe.prototype={deflateInit(e,t){let n=this;return n.dstate=new Btt,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 Jhe(e){let t=this,n=new Khe,i=Ytt(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,l){let d,u,f=0,p=0,y=0,h=[];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?h.push(new Uint8Array(r)):h.push(r.subarray(0,n.next_out_index))),y+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=f&&(l(n.next_in_index),f=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(u=new Uint8Array(y),h.forEach(function(g){u.set(g,p),p+=g.length})):u=h[0]?new Uint8Array(h[0]):new Uint8Array,u}},t.flush=function(){let a,l,d=0,u=0,f=[];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&&f.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(),l=new Uint8Array(u),f.forEach(function(p){l.set(p,d),d+=p.length}),l}}function Ytt(e){return e+5*(Math.floor(e/16383)+1)}var dxi=_(T(),1);var Od=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ppe=1440,Htt=0,ztt=4,Ktt=9,Jtt=5,Qtt=[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],jtt=[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],qtt=[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],$tt=[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],ent=[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],tnt=[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],lg=15;function eQ(){let e=this,t,n,i,o,r,s;function a(d,u,f,p,y,h,g,x,S,V,Z){let R,E,I,v,P,F,N,b,G,X,W,A,k,B,O;X=0,P=f;do i[d[u+X]]++,X++,P--;while(P!==0);if(i[0]==f)return g[0]=-1,x[0]=0,0;for(b=x[0],F=1;F<=lg&&i[F]===0;F++);for(N=F,b<F&&(b=F),P=lg;P!==0&&i[P]===0;P--);for(I=P,b>P&&(b=P),x[0]=b,B=1<<F;F<P;F++,B<<=1)if((B-=i[F])<0)return-3;if((B-=i[P])<0)return-3;for(i[P]+=B,s[1]=F=0,X=1,k=2;--P!==0;)s[k]=F+=i[X],k++,X++;P=0,X=0;do(F=d[u+X])!==0&&(Z[s[F]++]=P),X++;while(++P<f);for(f=s[I],s[0]=P=0,X=0,v=-1,A=-b,r[0]=0,W=0,O=0;N<=I;N++)for(R=i[N];R--!==0;){for(;N>A+b;){if(v++,A+=b,O=I-A,O=O>b?b:O,(E=1<<(F=N-A))>R+1&&(E-=R+1,k=N,F<O))for(;++F<O&&!((E<<=1)<=i[++k]);)E-=i[k];if(O=1<<F,V[0]+O>ppe)return-3;r[v]=W=V[0],V[0]+=O,v!==0?(s[v]=P,o[0]=F,o[1]=b,F=P>>>A-b,o[2]=W-r[v-1]-F,S.set(o,(r[v-1]+F)*3)):g[0]=W}for(o[1]=N-A,X>=f?o[0]=192:Z[X]<p?(o[0]=Z[X]<256?0:96,o[2]=Z[X++]):(o[0]=h[Z[X]-p]+16+64,o[2]=y[Z[X++]-p]),E=1<<N-A,F=P>>>A;F<O;F+=E)S.set(o,(W+F)*3);for(F=1<<N-1;P&F;F>>>=1)P^=F;for(P^=F,G=(1<<A)-1;(P&G)!=s[v];)v--,A-=b,G=(1<<A)-1}return B!==0&&I!=1?-5:0}function l(d){let u;for(t||(t=[],n=[],i=new Int32Array(lg+1),o=[],r=new Int32Array(lg),s=new Int32Array(lg+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<lg+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,lg),0),s.set(i.subarray(0,lg+1),0)}e.inflate_trees_bits=function(d,u,f,p,y){let h;return l(19),t[0]=0,h=a(d,0,19,19,null,null,f,u,p,t,n),h==-3?y.msg="oversubscribed dynamic bit lengths tree":(h==-5||u[0]===0)&&(y.msg="incomplete dynamic bit lengths tree",h=-3),h},e.inflate_trees_dynamic=function(d,u,f,p,y,h,g,x,S){let V;return l(288),t[0]=0,V=a(f,0,d,257,qtt,$tt,h,p,x,t,n),V!=0||p[0]===0?(V==-3?S.msg="oversubscribed literal/length tree":V!=-4&&(S.msg="incomplete literal/length tree",V=-3),V):(l(288),V=a(f,d,u,0,ent,tnt,g,y,x,t,n),V!=0||y[0]===0&&d>257?(V==-3?S.msg="oversubscribed distance tree":V==-5?(S.msg="incomplete distance tree",V=-3):V!=-4&&(S.msg="empty distance tree with lengths",V=-3),V):0)}}eQ.inflate_trees_fixed=function(e,t,n,i){return e[0]=Ktt,t[0]=Jtt,n[0]=Qtt,i[0]=jtt,0};var _U=0,Qhe=1,jhe=2,qhe=3,$he=4,epe=5,tpe=6,jJ=7,npe=8,TU=9;function nnt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,l=0,d=0,u=0,f,p=0,y,h=0;function g(x,S,V,Z,R,E,I,v){let P,F,N,b,G,X,W,A,k,B,O,H,U,K,Q,ie;W=v.next_in_index,A=v.avail_in,G=I.bitb,X=I.bitk,k=I.write,B=k<I.read?I.read-k-1:I.end-k,O=Od[x],H=Od[S];do{for(;X<20;)A--,G|=(v.read_byte(W++)&255)<<X,X+=8;if(P=G&O,F=V,N=Z,ie=(N+P)*3,(b=F[ie])===0){G>>=F[ie+1],X-=F[ie+1],I.win[k++]=F[ie+2],B--;continue}do{if(G>>=F[ie+1],X-=F[ie+1],b&16){for(b&=15,U=F[ie+2]+(G&Od[b]),G>>=b,X-=b;X<15;)A--,G|=(v.read_byte(W++)&255)<<X,X+=8;P=G&H,F=R,N=E,ie=(N+P)*3,b=F[ie];do if(G>>=F[ie+1],X-=F[ie+1],b&16){for(b&=15;X<b;)A--,G|=(v.read_byte(W++)&255)<<X,X+=8;if(K=F[ie+2]+(G&Od[b]),G>>=b,X-=b,B-=U,k>=K)Q=k-K,k-Q>0&&2>k-Q?(I.win[k++]=I.win[Q++],I.win[k++]=I.win[Q++],U-=2):(I.win.set(I.win.subarray(Q,Q+2),k),k+=2,Q+=2,U-=2);else{Q=k-K;do Q+=I.end;while(Q<0);if(b=I.end-Q,U>b){if(U-=b,k-Q>0&&b>k-Q)do I.win[k++]=I.win[Q++];while(--b!==0);else I.win.set(I.win.subarray(Q,Q+b),k),k+=b,Q+=b,b=0;Q=0}}if(k-Q>0&&U>k-Q)do I.win[k++]=I.win[Q++];while(--U!==0);else I.win.set(I.win.subarray(Q,Q+U),k),k+=U,Q+=U,U=0;break}else if(!(b&64))P+=F[ie+2],P+=G&Od[b],ie=(N+P)*3,b=F[ie];else return v.msg="invalid distance code",U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,-3;while(!0);break}if(b&64)return b&32?(U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,1):(v.msg="invalid literal/length code",U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,-3);if(P+=F[ie+2],P+=G&Od[b],ie=(N+P)*3,(b=F[ie])===0){G>>=F[ie+1],X-=F[ie+1],I.win[k++]=F[ie+2],B--;break}}while(!0)}while(B>=258&&A>=10);return U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,0}e.init=function(x,S,V,Z,R,E){t=_U,d=x,u=S,f=V,p=Z,y=R,h=E,i=null},e.proc=function(x,S,V){let Z,R,E,I=0,v=0,P=0,F,N,b,G;for(P=S.next_in_index,F=S.avail_in,I=x.bitb,v=x.bitk,N=x.write,b=N<x.read?x.read-N-1:x.end-N;;)switch(t){case _U:if(b>=258&&F>=10&&(x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,V=g(d,u,f,p,y,h,x,S),P=S.next_in_index,F=S.avail_in,I=x.bitb,v=x.bitk,N=x.write,b=N<x.read?x.read-N-1:x.end-N,V!=0)){t=V==1?jJ:TU;break}r=d,i=f,o=p,t=Qhe;case Qhe:for(Z=r;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}if(R=(o+(I&Od[Z]))*3,I>>>=i[R+1],v-=i[R+1],E=i[R],E===0){s=i[R+2],t=tpe;break}if(E&16){a=E&15,n=i[R+2],t=jhe;break}if(!(E&64)){r=E,o=R/3+i[R+2];break}if(E&32){t=jJ;break}return t=TU,S.msg="invalid literal/length code",V=-3,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);case jhe:for(Z=a;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}n+=I&Od[Z],I>>=Z,v-=Z,r=u,i=y,o=h,t=qhe;case qhe:for(Z=r;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}if(R=(o+(I&Od[Z]))*3,I>>=i[R+1],v-=i[R+1],E=i[R],E&16){a=E&15,l=i[R+2],t=$he;break}if(!(E&64)){r=E,o=R/3+i[R+2];break}return t=TU,S.msg="invalid distance code",V=-3,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);case $he:for(Z=a;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}l+=I&Od[Z],I>>=Z,v-=Z,t=epe;case epe:for(G=N-l;G<0;)G+=x.end;for(;n!==0;){if(b===0&&(N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0&&(x.write=N,V=x.inflate_flush(S,V),N=x.write,b=N<x.read?x.read-N-1:x.end-N,N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0)))return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);x.win[N++]=x.win[G++],b--,G==x.end&&(G=0),n--}t=_U;break;case tpe:if(b===0&&(N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0&&(x.write=N,V=x.inflate_flush(S,V),N=x.write,b=N<x.read?x.read-N-1:x.end-N,N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0)))return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);V=0,x.win[N++]=s,b--,t=_U;break;case jJ:if(v>7&&(v-=8,F++,P--),x.write=N,V=x.inflate_flush(S,V),N=x.write,b=N<x.read?x.read-N-1:x.end-N,x.read!=x.write)return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);t=npe;case npe:return V=1,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);case TU:return V=-3,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);default:return V=-2,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V)}},e.free=function(){}}var ipe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ZV=0,qJ=1,ope=2,rpe=3,spe=4,ape=5,SU=6,CU=7,cpe=8,CT=9;function int(e,t){let n=this,i=ZV,o=0,r=0,s=0,a,l=[0],d=[0],u=new nnt,f=0,p=new Int32Array(ppe*3),y=0,h=new eQ;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(g,x){x&&(x[0]=y),i==SU&&u.free(g),i=ZV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(g,x){let S,V,Z;return V=g.next_out_index,Z=n.read,S=(Z<=n.write?n.write:n.end)-Z,S>g.avail_out&&(S=g.avail_out),S!==0&&x==-5&&(x=0),g.avail_out-=S,g.total_out+=S,g.next_out.set(n.win.subarray(Z,Z+S),V),V+=S,Z+=S,Z==n.end&&(Z=0,n.write==n.end&&(n.write=0),S=n.write-Z,S>g.avail_out&&(S=g.avail_out),S!==0&&x==-5&&(x=0),g.avail_out-=S,g.total_out+=S,g.next_out.set(n.win.subarray(Z,Z+S),V),V+=S,Z+=S),g.next_out_index=V,n.read=Z,x},n.proc=function(g,x){let S,V,Z,R,E,I,v,P;for(R=g.next_in_index,E=g.avail_in,V=n.bitb,Z=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I;;){let F,N,b,G,X,W,A,k;switch(i){case ZV:for(;Z<3;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}switch(S=V&7,f=S&1,S>>>1){case 0:V>>>=3,Z-=3,S=Z&7,V>>>=S,Z-=S,i=qJ;break;case 1:F=[],N=[],b=[[]],G=[[]],eQ.inflate_trees_fixed(F,N,b,G),u.init(F[0],N[0],b[0],0,G[0],0),V>>>=3,Z-=3,i=SU;break;case 2:V>>>=3,Z-=3,i=rpe;break;case 3:return V>>>=3,Z-=3,i=CT,g.msg="invalid block type",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x)}break;case qJ:for(;Z<32;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if((~V>>>16&65535)!=(V&65535))return i=CT,g.msg="invalid stored block lengths",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);o=V&65535,V=Z=0,i=o!==0?ope:f!==0?CU:ZV;break;case ope:if(E===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,x=n.inflate_flush(g,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=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);if(x=0,S=o,S>E&&(S=E),S>v&&(S=v),n.win.set(g.read_buf(R,S),I),R+=S,E-=S,I+=S,v-=S,(o-=S)!==0)break;i=f!==0?CU:ZV;break;case rpe:for(;Z<14;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if(r=S=V&16383,(S&31)>29||(S>>5&31)>29)return i=CT,g.msg="too many length or distance symbols",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);if(S=258+(S&31)+(S>>5&31),!a||a.length<S)a=[];else for(P=0;P<S;P++)a[P]=0;V>>>=14,Z-=14,s=0,i=spe;case spe:for(;s<4+(r>>>10);){for(;Z<3;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}a[ipe[s++]]=V&7,V>>>=3,Z-=3}for(;s<19;)a[ipe[s++]]=0;if(l[0]=7,S=h.inflate_trees_bits(a,l,d,p,g),S!=0)return x=S,x==-3&&(a=null,i=CT),n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);s=0,i=ape;case ape:for(;S=r,!(s>=258+(S&31)+(S>>5&31));){let B,O;for(S=l[0];Z<S;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if(S=p[(d[0]+(V&Od[S]))*3+1],O=p[(d[0]+(V&Od[S]))*3+2],O<16)V>>>=S,Z-=S,a[s++]=O;else{for(P=O==18?7:O-14,B=O==18?11:3;Z<S+P;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if(V>>>=S,Z-=S,B+=V&Od[P],V>>>=P,Z-=P,P=s,S=r,P+B>258+(S&31)+(S>>5&31)||O==16&&P<1)return a=null,i=CT,g.msg="invalid bit length repeat",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);O=O==16?a[P-1]:0;do a[P++]=O;while(--B!==0);s=P}}if(d[0]=-1,X=[],W=[],A=[],k=[],X[0]=9,W[0]=6,S=r,S=h.inflate_trees_dynamic(257+(S&31),1+(S>>5&31),a,X,W,A,k,p,g),S!=0)return S==-3&&(a=null,i=CT),x=S,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);u.init(X[0],W[0],p,A[0],p,k[0]),i=SU;case SU:if(n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,(x=u.proc(n,g,x))!=1)return n.inflate_flush(g,x);if(x=0,u.free(g),R=g.next_in_index,E=g.avail_in,V=n.bitb,Z=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I,f===0){i=ZV;break}i=CU;case CU:if(n.write=I,x=n.inflate_flush(g,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=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);i=cpe;case cpe:return x=1,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);case CT:return x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);default:return x=-2,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x)}}},n.free=function(g){n.reset(g,null),n.win=null,p=null},n.set_dictionary=function(g,x,S){n.win.set(g.subarray(x,x+S),0),n.read=n.write=S},n.sync_point=function(){return i==qJ?1:0}}var ont=32,rnt=8,snt=0,lpe=1,dpe=2,upe=3,mpe=4,fpe=5,$J=6,q2=7,hpe=12,dg=13,ant=[0,0,255,255];function cnt(){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=q2,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 int(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==ztt?-5:0,o=-5;;)switch(s.mode){case snt: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)!=rnt){s.mode=dg,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=dg,n.msg="invalid win size",s.marker=5;break}s.mode=lpe;case lpe: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=dg,n.msg="incorrect header check",s.marker=5;break}if(!(r&ont)){s.mode=q2;break}s.mode=dpe;case dpe: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=upe;case upe: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=mpe;case mpe: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=fpe;case fpe: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=$J,2);case $J:return s.mode=dg,n.msg="need dictionary",s.marker=0,-2;case q2:if(o=s.blocks.proc(n,o),o==-3){s.mode=dg,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=hpe;case hpe:return n.avail_in=0,1;case dg:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=$J)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=q2,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let l=n.istate;if(l.mode!=dg&&(l.mode=dg,l.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=l.marker;i!==0&&r<4;)n.read_byte(o)==ant[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,l.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,l.mode=q2,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function bpe(){}bpe.prototype={inflateInit(e){let t=this;return t.istate=new cnt,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 ype(e){let t=this,n=new bpe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Htt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,l){let d=[],u,f,p=0,y=0,h=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))),h+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=p&&(l(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(f=new Uint8Array(h),d.forEach(function(g){f.set(g,y),y+=g.length})):f=d[0]?new Uint8Array(d[0]):new Uint8Array,f}},t.flush=function(){n.inflateEnd()}}var xxi=_(T(),1);var mxi=_(T(),1);var RV="/",tQ=new Date(2107,11,31),nQ=new Date(1980,0,1),Ei=void 0,Dd="undefined",t0="function";var hxi=_(T(),1);var $2=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 lnt=64,gpe=2;try{typeof navigator!=Dd&&navigator.hardwareConcurrency&&(gpe=navigator.hardwareConcurrency)}catch{}var dnt={chunkSize:512*1024,maxWorkers:gpe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Ei,CompressionStreamNative:typeof CompressionStream!=Dd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Dd&&DecompressionStream},mg=Object.assign({},dnt);function ev(){return mg}function VU(e){return Math.max(e.chunkSize,lnt)}function GV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:d,DecompressionStream:u,workerScripts:f}=e;if(ug("baseURL",t),ug("chunkSize",n),ug("maxWorkers",i),ug("terminateWorkerTimeout",o),ug("useCompressionStream",r),ug("useWebWorkers",s),a&&(mg.CompressionStream=new $2(a)),l&&(mg.DecompressionStream=new $2(l)),ug("CompressionStream",d),ug("DecompressionStream",u),f!==Ei){let{deflate:p,inflate:y}=f;if((p||y)&&(mg.workerScripts||(mg.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");mg.workerScripts.deflate=p}if(y){if(!Array.isArray(y))throw new Error("workerScripts.inflate must be an array");mg.workerScripts.inflate=y}}}function ug(e,t){t!==Ei&&(mg[e]=t)}var Txi=_(T(),1);var f_i=_(T(),1);var o_i=_(T(),1);var t_i=_(T(),1);var Zxi=_(T(),1);var Cxi=_(T(),1),xpe=[];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;xpe[e]=t}var n0=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^xpe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var tv=class extends TransformStream{constructor(){let t,n=new n0;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 Yxi=_(T(),1);var Exi=_(T(),1);function EV(e){if(typeof TextEncoder==Dd){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 Ixi=_(T(),1),ll={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=ll.getPartial(n);return i===32?e.concat(t):ll._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+ll.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]=ll.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=ll.getPartial(o);return i.push(ll.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},nv={bytes:{fromBits(e){let n=ll.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(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(ll.partial(8*(n&3),i)),t}}},_pe={};_pe.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=nv.utf8String.toBits(e));let n=t._buffer=ll.concat(t._buffer,e),i=t._length,o=t._length=i+ll.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=ll.concat(t,[ll.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],l=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)+l+i[d]+t._key[Math.floor(d/20)]|0;l=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]+l|0}};var iQ={};iQ.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,l=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^l<<24,l=l<<1^(l>>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,l,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 f=s^s<<1^s<<2^s<<3^s<<4;f=f>>8^f&255^99,n[u]=f,i[f]=u,d=o[l=o[a=o[u]]];let p=d*16843009^l*65537^a*257^u*16843008,y=o[f]*257^f*16843008;for(let h=0;h<4;h++)e[h][u]=y=y<<24^y>>>8,t[h][f]=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],l=r[2],d=r[3],u=r[4],f=e[0]^n[0],p=e[t?3:1]^n[1],y=e[2]^n[2],h=e[t?1:3]^n[3],g=4,x,S,V;for(let Z=0;Z<i;Z++)x=s[f>>>24]^a[p>>16&255]^l[y>>8&255]^d[h&255]^n[g],S=s[p>>>24]^a[y>>16&255]^l[h>>8&255]^d[f&255]^n[g+1],V=s[y>>>24]^a[h>>16&255]^l[f>>8&255]^d[p&255]^n[g+2],h=s[h>>>24]^a[f>>16&255]^l[p>>8&255]^d[y&255]^n[g+3],g+=4,f=x,p=S,y=V;for(let Z=0;Z<4;Z++)o[t?3&-Z:Z]=u[f>>>24]<<24^u[p>>16&255]<<16^u[y>>8&255]<<8^u[h&255]^n[g++],x=f,f=p,p=y,y=h,h=x;return o}};var Tpe={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}},oQ={};oQ.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=ll.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 ll.clamp(t,o)}};var fg={importKey(e){return new fg.hmacSha1(nv.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,l,d,u=new ArrayBuffer(o),f=new DataView(u),p=0,y=ll;for(t=nv.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(y.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),l=0;l<s.length;l++)r[l]^=s[l];for(a=0;p<(o||1)&&a<r.length;a++)f.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};fg.hmacSha1=class{constructor(e){let t=this,n=t._hash=_pe.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 Nxi=_(T(),1);var unt=typeof crypto!=Dd&&typeof crypto.getRandomValues==t0,hg="Invalid password",VT="Invalid signature",i0="zipjs-abort-check-password";function LU(e){return unt?crypto.getRandomValues(e):Tpe.getRandomValues(e)}var XV=16,mnt="raw",Vpe={name:"PBKDF2"},fnt={name:"HMAC"},hnt="SHA-1",pnt=Object.assign({hash:fnt},Vpe),rQ=Object.assign({iterations:1e3,hash:{name:hnt}},Vpe),bnt=["deriveBits"],ov=[8,12,16],iv=[16,24,32],pg=10,ynt=[0,0,0,0],GU=typeof crypto!=Dd,av=GU&&crypto.subtle,Lpe=GU&&typeof av!=Dd,Uh=nv.bytes,gnt=iQ.aes,xnt=oQ.ctrGladman,_nt=fg.hmacSha1,Spe=GU&&Lpe&&typeof av.importKey==t0,Cpe=GU&&Lpe&&typeof av.deriveBits==t0,ZU=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:Gpe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let l=this,{password:d,strength:u,resolveReady:f,ready:p}=l;d?(await Tnt(l,u,d,am(s,0,ov[u]+2)),s=am(s,ov[u]+2),r?a.error(new Error(i0)):f()):await p;let y=new Uint8Array(s.length-pg-(s.length-pg)%XV);a.enqueue(Zpe(l,s,y,0,pg,!0))},async flush(s){let{signed:a,ctr:l,hmac:d,pending:u,ready:f}=this;if(d&&l){await f;let p=am(u,0,u.length-pg),y=am(u,u.length-pg),h=new Uint8Array;if(p.length){let g=sv(Uh,p);d.update(g);let x=l.update(g);h=rv(Uh,x)}if(a){let g=am(rv(Uh,d.digest()),0,pg);for(let x=0;x<pg;x++)if(g[x]!=y[x])throw new Error(VT)}s.enqueue(h)}}})}},RU=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:Gpe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:l,strength:d,resolveReady:u,ready:f}=a,p=new Uint8Array;l?(p=await Snt(a,d,l),u()):await f;let y=new Uint8Array(p.length+r.length-r.length%XV);y.set(p,0),s.enqueue(Zpe(a,r,y,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:l,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(l.length){let f=s.update(sv(Uh,l));a.update(f),u=rv(Uh,f)}o.signature=rv(Uh,a.digest()).slice(0,pg),r.enqueue(sQ(u,o.signature))}}}),o=this}};function Zpe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:l}=e,d=t.length-o;l.length&&(t=sQ(l,t),n=Lnt(n,d-d%XV));let u;for(u=0;u<=d-XV;u+=XV){let f=sv(Uh,am(t,u,u+XV));r&&a.update(f);let p=s.update(f);r||a.update(p),n.set(rv(Uh,p),u+i)}return e.pending=am(t,u),n}async function Tnt(e,t,n,i){let o=await Rpe(e,t,n,am(i,0,ov[t])),r=am(i,ov[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(hg)}async function Snt(e,t,n){let i=LU(new Uint8Array(ov[t])),o=await Rpe(e,t,n,i);return sQ(i,o)}async function Rpe(e,t,n,i){e.password=null;let o=await Cnt(mnt,n,pnt,!1,bnt),r=await Vnt(Object.assign({salt:i},rQ),o,8*(iv[t]*2+2)),s=new Uint8Array(r),a=sv(Uh,am(s,0,iv[t])),l=sv(Uh,am(s,iv[t],iv[t]*2)),d=am(s,iv[t]*2);return Object.assign(e,{keys:{key:a,authentication:l,passwordVerification:d},ctr:new xnt(new gnt(a),Array.from(ynt)),hmac:new _nt(l)}),d}async function Cnt(e,t,n,i,o){if(Spe)try{return await av.importKey(e,t,n,i,o)}catch{return Spe=!1,fg.importKey(t)}else return fg.importKey(t)}async function Vnt(e,t,n){if(Cpe)try{return await av.deriveBits(e,t,n)}catch{return Cpe=!1,fg.pbkdf2(t,e.salt,rQ.iterations,n)}else return fg.pbkdf2(t,e.salt,rQ.iterations,n)}function Gpe(e,t){return t===Ei?EV(e):t}function sQ(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 Lnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function am(e,t,n){return e.subarray(t,n)}function rv(e,t){return e.fromBits(t)}function sv(e,t){return e.toBits(t)}var Jxi=_(T(),1);var IV=12,EU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Wpe(this,t)},transform(o,r){let s=this;if(s.password){let a=Epe(s,o.subarray(0,IV));if(s.password=null,a[IV-1]!=s.passwordVerification)throw new Error(hg);o=o.subarray(IV)}i?r.error(new Error(i0)):r.enqueue(Epe(s,o))}})}},XU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Wpe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let l=LU(new Uint8Array(IV));l[IV-1]=r.passwordVerification,s=new Uint8Array(i.length+l.length),s.set(Xpe(r,l),0),a=IV}else s=new Uint8Array(i.length),a=0;s.set(Xpe(r,i),a),o.enqueue(s)}})}};function Epe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=wpe(e)^t[i],aQ(e,n[i]);return n}function Xpe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=wpe(e)^t[i],aQ(e,t[i]);return n}function Wpe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new n0(n[0]),crcKey2:new n0(n[2])});for(let i=0;i<t.length;i++)aQ(e,t.charCodeAt(i))}function aQ(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Ipe(Math.imul(Ipe(i+Ppe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function wpe(e){let t=e.keys[2]|2;return Ppe(Math.imul(t,t^1)>>>8)}function Ppe(e){return e&255}function Ipe(e){return e&4294967295}var vpe="deflate-raw",IU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:d,level:u}=t,f=this,p,y,h=Fpe(super.readable);(!s||l)&&d&&(p=new tv,h=Oh(h,p)),r&&(h=Mpe(h,a,{level:u,chunkSize:n},o,i)),s&&(l?h=Oh(h,new XU(t)):(y=new RU(t),h=Oh(h,y))),Ape(f,h,()=>{let g;s&&!l&&(g=y.signature),(!s||l)&&d&&(g=new DataView(p.value.buffer).getUint32(0)),f.signature=g})}},WU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:d,useCompressionStream:u}=t,f,p,y=Fpe(super.readable);s&&(r?y=Oh(y,new EU(t)):(p=new ZU(t),y=Oh(y,p))),d&&(y=Mpe(y,u,{chunkSize:n},o,i)),(!s||r)&&a&&(f=new tv,y=Oh(y,f)),Ape(this,y,()=>{if((!s||r)&&a){let h=new DataView(f.value.buffer);if(l!=h.getUint32(0,!1))throw new Error(VT)}})}};function Fpe(e){return Oh(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Ape(e,t,n){t=Oh(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Mpe(e,t,n,i,o){try{let r=t&&i?i:o;e=Oh(e,new r(vpe,n))}catch{if(t)try{e=Oh(e,new o(vpe,n))}catch{return e}else return e}return e}function Oh(e,t){return e.pipeThrough(t)}var Npe="message",kpe="start",Upe="pull",cQ="data",Ope="ack",lQ="close",vU="deflate",FU="inflate";var wU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(vU)?r=IU:o.startsWith(FU)&&(r=WU);let s=0,a=0,l=new r(t,n),d=super.readable,u=new TransformStream({transform(p,y){p&&p.length&&(a+=p.length,y.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),f=new TransformStream({transform(p,y){p&&p.length&&(s+=p.length,y.enqueue(p))},flush(){let{signature:p}=l;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(l).pipeThrough(f)}})}},PU=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 c_i=_(T(),1);var Ype=typeof Worker!=Dd;var WV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:d},u){let{signal:f}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new PU(r.chunkSize)).pipeThrough(new uQ(n,s),{signal:f}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:l,terminate(){return new Promise(p=>{let{worker:y,busy:h}=t;y?(h?t.resolveTerminated=p:(y.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&&Ype?Znt:Hpe)(t,r)}},uQ=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await dQ(n,o)},async transform(a,l){s+=a.length,i&&await dQ(i,s,o),l.enqueue(a)},async flush(){t.size=s,r&&await dQ(r,s)}})}};async function dQ(e,...t){try{await e(...t)}catch{}}function Hpe(e,t){return{run:()=>Rnt(e,t)}}function Znt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Xnt(e.scripts[0],n,e)}catch{return Ype=!1,Hpe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Gnt(e,{chunkSize:i})}})}return e.interface}async function Rnt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new wU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{i()}}async function Gnt(e,t){let n,i,o=new Promise((p,y)=>{n=p,i=y});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:l,closed:d}=Ent(e.writable),u=AU({type:kpe,scripts:a.slice(1),options:s,config:t,readable:r,writable:l},e);u||Object.assign(e,{reader:r.getReader(),writer:l.getWriter()});let f=await o;return u||await l.getWriter().close(),await d,f}function Ent(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 Dpe=!0,Bpe=!0;function Xnt(e,t,n){let i={type:"module"},o,r;typeof e==t0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Dpe)try{r=new Worker(o)}catch{Dpe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Npe,s=>Int(s,n)),r}function AU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,l=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,l.push(e.value)),o&&Bpe?(s&&l.push(s),a&&l.push(a)):e.readable=e.writable=null,l.length)try{return t.postMessage(e,l),!0}catch{Bpe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Int({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:l,resolveResult:d,rejectResult:u,onTaskFinished:f}=t;try{if(s){let{message:y,stack:h,code:g,name:x}=s,S=new Error(y);Object.assign(S,{stack:h,code:g,name:x}),p(S)}else{if(n==Upe){let{value:y,done:h}=await a.read();AU({type:cQ,value:y,done:h,messageId:o},t)}n==cQ&&(await l.ready,await l.write(new Uint8Array(i)),AU({type:Ope,messageId:o},t)),n==lQ&&p(null,r)}}catch(y){AU({type:lQ,messageId:o},t),p(y)}function p(y,h){y?u(y):d(h),l&&l.releaseLock(),f()}}var LT=[],mQ=[];var zpe=0;async function MU(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:l,signed:d,encrypted:u}=n,{workerScripts:f,maxWorkers:p}=i;t.transferStreams=o||o===Ei;let y=!l&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!y&&(r||r===Ei&&i.useWebWorkers),t.scripts=t.useWebWorkers&&f?f[a]:[],n.useCompressionStream=s||s===Ei&&i.useCompressionStream,(await h()).run();async function h(){let x=LT.find(S=>!S.busy);if(x)return Kpe(x),new WV(x,e,t,g);if(LT.length<p){let S={indexWorker:zpe};return zpe++,LT.push(S),new WV(S,e,t,g)}else return new Promise(S=>mQ.push({resolve:S,stream:e,workerOptions:t}))}function g(x){if(mQ.length){let[{resolve:S,stream:V,workerOptions:Z}]=mQ.splice(0,1);S(new WV(x,V,Z,g))}else x.worker?(Kpe(x),Wnt(x,t)):LT=LT.filter(S=>S!=x)}}function Wnt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{LT=LT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Kpe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var y_i=_(T(),1);var wnt="Writer iterator completed too soon",Pnt="text/plain";var vnt="Content-Type";var Fnt=64*1024,pQ="writable",wV=class{constructor(){this.size=0}init(){this.initialized=!0}},NU=class extends wV{get readable(){let t=this,{chunkSize:n=Fnt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:l}=this;o.enqueue(await Ua(t,r+l,Math.min(n,s-l),a)),l+n>s?o.close():this.chunkOffset+=n}});return i}},fQ=class extends wV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,pQ,{get(){return n}})}writeUint8Array(){}};var kU=class extends fQ{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)}},o0=class extends NU{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)}},cv=class extends wV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([vnt,t]),Object.defineProperty(n,pQ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},UU=class extends o0{constructor(t){super(new Blob([t],{type:Pnt}))}},OU=class extends cv{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 hQ=class extends NU{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 l=t;for(;l>=r[a].size;)l-=r[a].size,a++;let d=r[a],u=d.size;if(l+n<=u)s=await Ua(d,l,n);else{let f=u-l;s=new Uint8Array(n),s.set(await Ua(d,l,f)),s.set(await o.readUint8Array(t+f,n-f,i),f)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},DU=class extends wV{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:f}=i;if(s)u.length>=f?(await l(u.slice(0,f)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(f))):await l(u);else{let{value:p,done:y}=await t.next();if(y&&!p)throw new Error(wnt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Bh(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,pQ,{get(){return a}});async function l(u){let f=u.length;f&&(await s.ready,await s.write(u),o.size+=f,i.size+=f,i.availableSize-=f)}async function d(){r.size=o.size,await s.close()}}};async function Bh(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function BU(e){return Array.isArray(e)&&(e=new hQ(e)),e instanceof ReadableStream&&(e={readable:e}),e}function YU(e){e.writable===Ei&&typeof e.next==t0&&(e=new DU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Ei&&(t.size=0),e instanceof DU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ua(e,t,n,i){return e.readUint8Array(t,n,i)}var w_i=_(T(),1);var S_i=_(T(),1);var x_i=_(T(),1),Jpe="\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(""),Ant=Jpe.length==256;function Qpe(e){if(Ant){let t="";for(let n=0;n<e.length;n++)t+=Jpe[e[n]];return t}else return new TextDecoder().decode(e)}function lv(e,t){return t&&t.trim().toLowerCase()=="cp437"?Qpe(e):new TextDecoder(t).decode(e)}var V_i=_(T(),1),bQ="filename",yQ="rawFilename",gQ="comment",xQ="rawComment",_Q="uncompressedSize",TQ="compressedSize",SQ="offset",HU="diskNumberStart",PV="lastModDate",zU="rawLastModDate",dv="lastAccessDate",jpe="rawLastAccessDate",uv="creationDate",qpe="rawCreationDate",CQ="internalFileAttribute",VQ="externalFileAttribute",LQ="msDosCompatible",KU="zip64",ZQ="encrypted",RQ="version",GQ="versionMadeBy",EQ="zipCrypto",Mnt=[bQ,yQ,TQ,_Q,PV,zU,gQ,xQ,dv,uv,SQ,HU,HU,CQ,VQ,LQ,KU,ZQ,RQ,GQ,EQ,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],bg=class{constructor(t){Mnt.forEach(n=>this[n]=t[n])}};var XQ="File format is not recognized",Ont="End of central directory not found",Dnt="End of Zip64 central directory locator not found",Bnt="Central directory header not found",Ynt="Local file header not found",Hnt="Zip64 extra field not found",znt="File contains encrypted entry",Knt="Encryption method not supported",$pe="Compression method not supported",ebe="Split zip file",tbe="utf-8",nbe="cp437",Jnt=[[_Q,4294967295],[TQ,4294967295],[SQ,4294967295],[HU,65535]],Qnt={[65535]:{getValue:gs,bytes:4},[4294967295]:{getValue:JU,bytes:8}},nO=class{constructor(t,n={}){Object.assign(this,{reader:BU(t),options:n,config:ev()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Bh(i),(i.size===Ei||!i.readUint8Array)&&(i=new o0(await new Response(i.readable).blob()),await Bh(i)),i.size<22)throw new Error(XQ);i.chunkSize=VU(o);let r=await tit(i,101010256,i.size,22,65535*16);if(!r){let N=await Ua(i,0,4),b=Sa(N);throw gs(b)==134695760?new Error(ebe):new Error(Ont)}let s=Sa(r),a=gs(s,12),l=gs(s,16),d=r.offset,u=Ta(s,20),f=d+22+u,p=Ta(s,4),y=i.lastDiskNumber||0,h=Ta(s,6),g=Ta(s,8),x=0,S=0;if(l==4294967295||a==4294967295||g==65535||h==65535){let N=await Ua(i,r.offset-20,20),b=Sa(N);if(gs(b,0)==117853008){l=JU(b,8);let G=await Ua(i,l,56,-1),X=Sa(G),W=r.offset-20-56;if(gs(X,0)!=101075792&&l!=W){let A=l;l=W,x=l-A,G=await Ua(i,l,56,-1),X=Sa(G)}if(gs(X,0)!=101075792)throw new Error(Dnt);p==65535&&(p=gs(X,16)),h==65535&&(h=gs(X,20)),g==65535&&(g=JU(X,32)),a==4294967295&&(a=JU(X,40)),l-=a}}if(l>=i.size&&(x=i.size-l-a-22,l=i.size-a-22),y!=p)throw new Error(ebe);if(l<0)throw new Error(XQ);let V=0,Z=await Ua(i,l,a,h),R=Sa(Z);if(a){let N=r.offset-a;if(gs(R,V)!=33639248&&l!=N){let b=l;l=N,x+=l-b,Z=await Ua(i,l,a,h),R=Sa(Z)}}let E=r.offset-l-(i.lastDiskOffset||0);if(a!=E&&E>=0&&(a=E,Z=await Ua(i,l,a,h),R=Sa(Z)),l<0||l>=i.size)throw new Error(XQ);let I=dl(n,t,"filenameEncoding"),v=dl(n,t,"commentEncoding");for(let N=0;N<g;N++){let b=new WQ(i,o,n.options);if(gs(R,V)!=33639248)throw new Error(Bnt);obe(b,R,V+6);let G=!!b.bitFlag.languageEncodingFlag,X=V+46,W=X+b.filenameLength,A=W+b.extraFieldLength,k=Ta(R,V+4),B=(k&0)==0,O=Z.subarray(X,W),H=Ta(R,V+32),U=A+H,K=Z.subarray(A,U),Q=G,ie=G,j=B&&(vV(R,V+38)&16)==16,$=gs(R,V+42)+x;Object.assign(b,{versionMadeBy:k,msDosCompatible:B,compressedSize:0,uncompressedSize:0,commentLength:H,directory:j,offset:$,diskNumberStart:Ta(R,V+34),internalFileAttribute:Ta(R,V+36),externalFileAttribute:gs(R,V+38),rawFilename:O,filenameUTF8:Q,commentUTF8:ie,rawExtraField:Z.subarray(W,A)});let ne=dl(n,t,"decodeText")||lv,be=Q?tbe:I||nbe,Ce=ie?tbe:v||nbe,me=ne(O,be);me===Ei&&(me=lv(O,be));let _e=ne(K,Ce);_e===Ei&&(_e=lv(K,Ce)),Object.assign(b,{rawComment:K,filename:me,comment:_e,directory:j||me.endsWith(RV)}),S=Math.max($,S),rbe(b,b,R,V+6),b.zipCrypto=b.encrypted&&!b.extraFieldAES;let Ve=new bg(b);Ve.getData=(Ze,De)=>b.getData(Ze,Ve,De),V=U;let{onprogress:Ie}=t;if(Ie)try{await Ie(N+1,g,new bg(b))}catch{}yield Ve}let P=dl(n,t,"extractPrependedData"),F=dl(n,t,"extractAppendedData");return P&&(n.prependedData=S>0?await Ua(i,0,S):new Uint8Array),n.comment=u?await Ua(i,d+22,u):new Uint8Array,F&&(n.appendedData=f<i.size?await Ua(i,f,i.size-f):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var WQ=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:l,compressionMethod:d,config:u,bitFlag:f,signature:p,rawLastModDate:y,uncompressedSize:h,compressedSize:g}=o,x=n.localDirectory={},S=await Ua(r,s,30,a),V=Sa(S),Z=dl(o,i,"password"),R=dl(o,i,"rawPassword"),E=dl(o,i,"passThrough");if(Z=Z&&Z.length&&Z,R=R&&R.length&&R,l&&l.originalCompressionMethod!=99)throw new Error($pe);if(d!=0&&d!=8&&!E)throw new Error($pe);if(gs(V,0)!=67324752)throw new Error(Ynt);obe(x,V,4),x.rawExtraField=x.extraFieldLength?await Ua(r,s+30+x.filenameLength,x.extraFieldLength,a):new Uint8Array,rbe(o,x,V,4,!0),Object.assign(n,{lastAccessDate:x.lastAccessDate,creationDate:x.creationDate});let I=o.encrypted&&x.encrypted&&!E,v=I&&!l;if(E||(n.zipCrypto=v),I){if(!v&&l.strength===Ei)throw new Error(Knt);if(!Z&&!R)throw new Error(znt)}let P=s+30+x.filenameLength+x.extraFieldLength,F=g,N=r.readable;Object.assign(N,{diskNumberStart:a,offset:P,size:F});let b=dl(o,i,"signal"),G=dl(o,i,"checkPasswordOnly");G&&(t=new WritableStream),t=YU(t),await Bh(t,E?g:h);let{writable:X}=t,{onstart:W,onprogress:A,onend:k}=i,B={options:{codecType:FU,password:Z,rawPassword:R,zipCrypto:v,encryptionStrength:l&&l.strength,signed:dl(o,i,"checkSignature")&&!E,passwordVerification:v&&(f.dataDescriptor?y>>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!E,encrypted:o.encrypted&&!E,useWebWorkers:dl(o,i,"useWebWorkers"),useCompressionStream:dl(o,i,"useCompressionStream"),transferStreams:dl(o,i,"transferStreams"),checkPasswordOnly:G},config:u,streamOptions:{signal:b,size:F,onstart:W,onprogress:A,onend:k}},O=0;try{({outputSize:O}=await MU({readable:N,writable:X},B))}catch(H){if(!G||H.message!=i0)throw H}finally{let H=dl(o,i,"preventClose");X.size+=O,!H&&!X.locked&&await X.getWriter().close()}return G?Ei:t.getData?t.getData():X}};function obe(e,t,n){let i=e.rawBitFlag=Ta(t,n+2),o=(i&1)==1,r=gs(t,n+6);Object.assign(e,{encrypted:o,version:Ta(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:nit(r),filenameLength:Ta(t,n+22),extraFieldLength:Ta(t,n+24)})}function rbe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Sa(new Uint8Array(r)),l=0;try{for(;l<r.length;){let S=Ta(a,l),V=Ta(a,l+2);s.set(S,{type:S,data:r.slice(l+4,l+4+V)}),l+=4+V}}catch{}let d=Ta(n,i+4);Object.assign(t,{signature:gs(n,i+10),uncompressedSize:gs(n,i+18),compressedSize:gs(n,i+14)});let u=s.get(1);u&&(jnt(u,t),t.extraFieldZip64=u);let f=s.get(28789);f&&(ibe(f,bQ,yQ,t,e),t.extraFieldUnicodePath=f);let p=s.get(25461);p&&(ibe(p,gQ,xQ,t,e),t.extraFieldUnicodeComment=p);let y=s.get(39169);y?(qnt(y,t,d),t.extraFieldAES=y):t.compressionMethod=d;let h=s.get(10);h&&($nt(h,t),t.extraFieldNTFS=h);let g=s.get(21589);g&&(eit(g,t,o),t.extraFieldExtendedTimestamp=g);let x=s.get(6534);x&&(t.extraFieldUSDZ=x)}function jnt(e,t){t.zip64=!0;let n=Sa(e.data),i=Jnt.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 l=Qnt[a];t[s]=e[s]=l.getValue(n,r),r+=l.bytes}else if(e[s])throw new Error(Hnt)}}function ibe(e,t,n,i,o){let r=Sa(e.data),s=new n0;s.append(o[n]);let a=Sa(new Uint8Array(4));a.setUint32(0,s.get(),!0);let l=gs(r,1);Object.assign(e,{version:vV(r,0),[t]:lv(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==gs(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function qnt(e,t,n){let i=Sa(e.data),o=vV(i,4);Object.assign(e,{vendorVersion:vV(i,0),vendorId:vV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:Ta(i,5)}),t.compressionMethod=e.compressionMethod}function $nt(e,t){let n=Sa(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=Ta(n,i),s=Ta(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=Sa(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});let d=IQ(s),u=IQ(a),f=IQ(l),p={lastModDate:d,lastAccessDate:u,creationDate:f};Object.assign(e,p),Object.assign(t,p)}}catch{}}function eit(e,t,n){let i=Sa(e.data),o=vV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(PV),s.push(zU)),(o&2)==2&&(r.push(dv),s.push(jpe)),(o&4)==4&&(r.push(uv),s.push(qpe))):e.data.length>=5&&(r.push(PV),s.push(zU));let a=1;r.forEach((l,d)=>{if(e.data.length>=a+4){let u=gs(i,a);t[l]=e[l]=new Date(u*1e3);let f=s[d];e[f]=u}a+=4})}async function tit(e,t,n,i,o){let r=new Uint8Array(4),s=Sa(r);iit(s,0,t);let a=i+o;return await l(i)||await l(Math.min(a,n));async function l(d){let u=n-d,f=await Ua(e,u,d);for(let p=f.length-i;p>=0;p--)if(f[p]==r[0]&&f[p+1]==r[1]&&f[p+2]==r[2]&&f[p+3]==r[3])return{offset:u+p,buffer:f.slice(p,p+i).buffer}}}function dl(e,t,n){return t[n]===Ei?e.options[n]:t[n]}function nit(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 IQ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function vV(e,t){return e.getUint8(t)}function Ta(e,t){return e.getUint16(t,!0)}function gs(e,t){return e.getUint32(t,!0)}function JU(e,t){return Number(e.getBigUint64(t,!0))}function iit(e,t,n){e.setUint32(t,n,!0)}function Sa(e){return new DataView(e.buffer)}var U_i=_(T(),1);var ait="File already exists",cit="Zip file comment exceeds 64KB",lit="File entry comment exceeds 64KB",dit="File entry name exceeds 64KB",cbe="Version exceeds 65535",uit="The strength must equal 1, 2, or 3",mit="Extra field type exceeds 65535",fit="Extra field data exceeds 64KB",HQ="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",hit="Undefined uncompressed size",lbe=new Uint8Array([7,0,2,0,65,69,3,0,0]),BQ=0,dbe=[],rO=class{constructor(t,n={}){t=YU(t);let i=t.availableSize!==Ei&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Ei&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:ev(),files:new Map,filenames:new Set,offset:n.offset===Ei?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;BQ<s.maxWorkers?BQ++:await new Promise(l=>dbe.push(l));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(ait);return o.filenames.add(t),a=pit(o,t,n,i),r.add(a),await a}catch(l){throw o.filenames.delete(t),l}finally{r.delete(a);let l=dbe.shift();l?l():BQ--}}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 Vit(this,t,n),ho(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function pit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(RV)?t+=RV:i.directory=t.endsWith(RV);let o=ho(e,i,"encodeText",EV),r=o(t);if(r===Ei&&(r=EV(t)),ji(r)>65535)throw new Error(dit);let s=i.comment||"",a=o(s);if(a===Ei&&(a=EV(s)),ji(a)>65535)throw new Error(lit);let l=ho(e,i,RQ,20);if(l>65535)throw new Error(cbe);let d=ho(e,i,GQ,20);if(d>65535)throw new Error(cbe);let u=ho(e,i,PV,new Date),f=ho(e,i,dv),p=ho(e,i,uv),y=ho(e,i,LQ,!0),h=ho(e,i,CQ,0),g=ho(e,i,VQ,0),x=ho(e,i,"passThrough"),S,V;x||(S=ho(e,i,"password"),V=ho(e,i,"rawPassword"));let Z=ho(e,i,"encryptionStrength",3),R=ho(e,i,EQ),E=ho(e,i,"extendedTimestamp",!0),I=ho(e,i,"keepOrder",!0),v=ho(e,i,"level"),P=ho(e,i,"useWebWorkers"),F=ho(e,i,"bufferedWrite"),N=ho(e,i,"dataDescriptorSignature",!1),b=ho(e,i,"signal"),G=ho(e,i,"useUnicodeFileNames",!0),X=ho(e,i,"useCompressionStream"),W=ho(e,i,"compressionMethod"),A=ho(e,i,"dataDescriptor",!0),k=ho(e,i,KU);if(!R&&(S!==Ei||V!==Ei)&&!(Z>=1&&Z<=3))throw new Error(uit);let B=new Uint8Array,{extraField:O}=i;if(O){let Xt=0,Ht=0;O.forEach(qe=>Xt+=4+ji(qe)),B=new Uint8Array(Xt),O.forEach((qe,mn)=>{if(mn>65535)throw new Error(mit);if(ji(qe)>65535)throw new Error(fit);Xs(B,new Uint16Array([mn]),Ht),Xs(B,new Uint16Array([ji(qe)]),Ht+2),Xs(B,qe,Ht+4),Ht+=4+ji(qe)})}let H=0,U=0,K=0;if(x&&({uncompressedSize:K}=i,K===Ei))throw new Error(hit);let Q=k===!0;n&&(n=BU(n),await Bh(n),x?H=ube(K):n.size===Ei?(A=!0,(k||k===Ei)&&(k=!0,K=H=4294967296)):(K=n.size,H=ube(K)));let{diskOffset:ie,diskNumber:j,maxSize:$}=e.writer,ne=Q||K>4294967295,be=Q||H>4294967295,Ce=Q||e.offset+e.pendingEntriesSize-ie>4294967295,_e=ho(e,i,"supportZip64SplitFile",!0)&&Q||j+Math.ceil(e.pendingEntriesSize/$)>65535;if(Ce||ne||be||_e){if(k===!1||!I)throw new Error(HQ);k=!0}k=k||!1;let Ve=ho(e,i,ZQ),{signature:Ie}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:l,versionMadeBy:d,lastModDate:u,lastAccessDate:f,creationDate:p,rawExtraField:B,zip64:k,zip64UncompressedSize:ne,zip64CompressedSize:be,zip64Offset:Ce,zip64DiskNumberStart:_e,password:S,rawPassword:V,level:!X&&e.config.CompressionStream===Ei&&e.config.CompressionStreamNative===Ei?0:v,useWebWorkers:P,encryptionStrength:Z,extendedTimestamp:E,zipCrypto:R,bufferedWrite:F,keepOrder:I,useUnicodeFileNames:G,dataDescriptor:A,dataDescriptorSignature:N,signal:b,msDosCompatible:y,internalFileAttribute:h,externalFileAttribute:g,useCompressionStream:X,passThrough:x,encrypted:!!(S&&ji(S)||V&&ji(V))||x&&Ve,signature:Ie,compressionMethod:W});let Ze=git(i),De=_it(i),Ke=ji(Ze.localHeaderArray,De.dataDescriptorArray);U=Ke+H,e.options.usdz&&(U+=U+64),e.pendingEntriesSize+=U;let rt;try{rt=await bit(e,t,n,{headerInfo:Ze,dataDescriptorInfo:De,metadataSize:Ke},i)}finally{e.pendingEntriesSize-=U}return Object.assign(rt,{name:t,comment:s,extraField:O}),new bg(rt)}async function bit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:l,signal:d}=o,{headerInfo:u}=i,{usdz:f}=e.options,p=Array.from(r.values()).pop(),y={},h,g,x,S,V,Z,R;r.set(t,y);try{let P;a&&(P=p&&p.lock,E()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!l)&&!f?(Z=new TransformStream,R=new Response(Z.readable).blob(),Z.writable.size=0,h=!0,e.bufferedWrites++,await Bh(s)):(Z=s,await I()),await Bh(Z);let{writable:F}=s,{diskOffset:N}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let G=new Uint8Array(4),X=Oa(G);Qi(X,0,134695760),await Yh(F,G),e.offset+=4}f&&xit(i,e.offset-N),h||(await P,await v(F));let{diskNumber:b}=s;if(V=!0,y.diskNumberStart=b,y=await yit(n,Z,y,i,e.config,o),V=!1,r.set(t,y),y.filename=t,h){await Z.writable.getWriter().close();let G=await R;await P,await I(),S=!0,l||(G=await Sit(y,G,F,o)),await v(F),y.diskNumberStart=s.diskNumber,N=s.diskOffset,await G.stream().pipeTo(F,{preventClose:!0,preventAbort:!0,signal:d}),F.size+=G.size,S=!1}if(y.offset=e.offset-N,y.zip64)Cit(y,o);else if(y.offset>4294967295)throw new Error(HQ);return e.offset+=y.size,y}catch(P){if(h&&S||!h&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}h?e.offset+=Z.writable.size:e.offset=Z.writable.size}throw r.delete(t),P}finally{h&&e.bufferedWrites--,x&&x(),g&&g()}function E(){y.lock=new Promise(P=>x=P)}async function I(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(F=>g=()=>{e.writerLocked=!1,F()}),await P}async function v(P){ji(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Yh(P,new Uint8Array))}}async function yit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:l,metadataSize:d}=o,{localHeaderArray:u,headerArray:f,lastModDate:p,rawLastModDate:y,encrypted:h,compressed:g,version:x,compressionMethod:S,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:Z,rawExtraFieldNTFS:R,rawExtraFieldAES:E}=a,{dataDescriptorArray:I}=l,{rawFilename:v,lastAccessDate:P,creationDate:F,password:N,rawPassword:b,level:G,zip64:X,zip64UncompressedSize:W,zip64CompressedSize:A,zip64Offset:k,zip64DiskNumberStart:B,zipCrypto:O,dataDescriptor:H,directory:U,versionMadeBy:K,rawComment:Q,rawExtraField:ie,useWebWorkers:j,onstart:$,onprogress:ne,onend:be,signal:Ce,encryptionStrength:me,extendedTimestamp:_e,msDosCompatible:Ve,internalFileAttribute:Ie,externalFileAttribute:Ze,useCompressionStream:De,passThrough:Ke}=s,rt={lock:i,versionMadeBy:K,zip64:X,directory:!!U,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:Q,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:R,rawExtraFieldAES:E,rawExtraField:ie,extendedTimestamp:_e,msDosCompatible:Ve,internalFileAttribute:Ie,externalFileAttribute:Ze,diskNumberStart:n},{signature:Xt,uncompressedSize:Ht}=s,qe=0;Ke||(Ht=0);let{writable:mn}=t;if(e){e.chunkSize=VU(r),await Yh(mn,u);let Lt=e.readable,Vi=Lt.size=e.size,ln={options:{codecType:vU,level:G,rawPassword:b,password:N,encryptionStrength:me,zipCrypto:h&&O,passwordVerification:h&&O&&y>>8&255,signed:!Ke,compressed:g&&!Ke,encrypted:h&&!Ke,useWebWorkers:j,useCompressionStream:De,transferStreams:!1},config:r,streamOptions:{signal:Ce,size:Vi,onstart:$,onprogress:ne,onend:be}},ge=await MU({readable:Lt,writable:mn},ln);qe=ge.outputSize,Ke||(Ht=ge.inputSize,Xt=ge.signature),mn.size+=Ht}else await Yh(mn,u);let Dt;if(X){let Lt=4;W&&(Lt+=8),A&&(Lt+=8),k&&(Lt+=8),B&&(Lt+=4),Dt=new Uint8Array(Lt)}else Dt=new Uint8Array;return Tit({signature:Xt,rawExtraFieldZip64:Dt,compressedSize:qe,uncompressedSize:Ht,headerInfo:a,dataDescriptorInfo:l},s),H&&await Yh(mn,I),Object.assign(rt,{uncompressedSize:Ht,compressedSize:qe,lastModDate:p,rawLastModDate:y,creationDate:F,lastAccessDate:P,encrypted:h,zipCrypto:O,size:d+qe,compressionMethod:S,version:x,headerArray:f,signature:Xt,rawExtraFieldZip64:Dt,extraFieldExtendedTimestampFlag:Z,zip64UncompressedSize:W,zip64CompressedSize:A,zip64Offset:k,zip64DiskNumberStart:B}),rt}function git(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:l,dataDescriptor:d,directory:u,rawExtraField:f,encryptionStrength:p,extendedTimestamp:y,encrypted:h}=e,{version:g,compressionMethod:x}=e,S=!u&&(r>0||r===Ei&&x!==0),V;if(h&&!a){V=new Uint8Array(ji(lbe)+2);let k=Oa(V);io(k,0,39169),Xs(V,lbe,2),sO(k,8,p)}else V=new Uint8Array;let Z,R,E;if(y){R=new Uint8Array(9+(i?4:0)+(o?4:0));let k=Oa(R);io(k,0,21589),io(k,2,ji(R)-4),E=1+(i?2:0)+(o?4:0),sO(k,4,E);let B=5;Qi(k,B,Math.floor(n.getTime()/1e3)),B+=4,i&&(Qi(k,B,Math.floor(i.getTime()/1e3)),B+=4),o&&Qi(k,B,Math.floor(o.getTime()/1e3));try{Z=new Uint8Array(36);let O=Oa(Z),H=YQ(n);io(O,0,10),io(O,2,32),io(O,8,1),io(O,10,24),Kl(O,12,H),Kl(O,20,YQ(i)||H),Kl(O,28,YQ(o)||H)}catch{Z=new Uint8Array}}else Z=R=new Uint8Array;let I=0;l&&(I=I|2048),d&&(I=I|8),x===Ei&&(x=S?8:0),x==8&&(r>=1&&r<3&&(I=I|6),r>=3&&r<5&&(I=I|1),r===9&&(I=I|2)),s&&(g=g>45?g:45),h&&(I=I|1,a||(g=g>51?g:51,V[9]=x,x=99));let v=new Uint8Array(26),P=Oa(v);io(P,0,g),io(P,2,I),io(P,4,x);let F=new Uint32Array(1),N=Oa(F),b;n<nQ?b=nQ:n>tQ?b=tQ:b=n,io(N,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),io(N,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let G=F[0];Qi(P,6,G),io(P,22,ji(t));let X=ji(V,R,Z,f);io(P,24,X);let W=new Uint8Array(30+ji(t)+X),A=Oa(W);return Qi(A,0,67324752),Xs(W,v,4),Xs(W,t,30),Xs(W,V,30+ji(t)),Xs(W,R,30+ji(t,V)),Xs(W,Z,30+ji(t,V,R)),Xs(W,f,30+ji(t,V,R,Z)),{localHeaderArray:W,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:G,encrypted:h,compressed:S,version:g,compressionMethod:x,extraFieldExtendedTimestampFlag:E,rawExtraFieldExtendedTimestamp:R,rawExtraFieldNTFS:Z,rawExtraFieldAES:V,extraFieldLength:X}}function xit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Oa(i),s=64-(t+ji(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),l=Oa(a);io(l,0,6534),io(l,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(ji(d)+s),Xs(i,d),Xs(i,a,ji(d)),r=Oa(i),io(r,28,o+s),e.metadataSize+=s}function _it(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=Oa(o),i&&(s=4,Qi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Tit(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:l,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:f}=a,{zip64:p,zip64UncompressedSize:y,zip64CompressedSize:h,zipCrypto:g,dataDescriptor:x}=t;if((!d||g)&&n!==Ei&&(Qi(l,10,n),x&&Qi(u,f,n)),p){let S=Oa(i);io(S,0,1),io(S,2,ji(i)-4);let V=4;y&&(Qi(l,18,4294967295),Kl(S,V,BigInt(r)),V+=8),h&&(Qi(l,14,4294967295),Kl(S,V,BigInt(o))),x&&(Kl(u,f+4,BigInt(o)),Kl(u,f+12,BigInt(r)))}else Qi(l,14,o),Qi(l,18,r),x&&(Qi(u,f+4,o),Qi(u,f+8,r))}async function Sit(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 Yh(n,new Uint8Array(o)),t.slice(o.byteLength)}function Cit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:l}=t,d=Oa(n),u=4;r&&(u+=8),s&&(u+=8),a&&(Kl(d,u,BigInt(i)),u+=8),l&&Qi(d,u,o)}async function Vit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,l=0,d=0,u=e.offset-r,f=i.size;for(let[,E]of i){let{rawFilename:I,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:F,rawExtraFieldNTFS:N,rawExtraField:b,extendedTimestamp:G,extraFieldExtendedTimestampFlag:X,lastModDate:W}=E,A;if(G){A=new Uint8Array(9);let k=Oa(A);io(k,0,21589),io(k,2,5),sO(k,4,X),Qi(k,5,Math.floor(W.getTime()/1e3))}else A=new Uint8Array;E.rawExtraFieldCDExtendedTimestamp=A,d+=46+ji(I,F,v,P,N,A,b)}let p=new Uint8Array(d),y=Oa(p);await Bh(o);let h=0;for(let[E,I]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:F,rawExtraFieldAES:N,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:G,rawExtraField:X,rawComment:W,versionMadeBy:A,headerArray:k,directory:B,zip64:O,zip64UncompressedSize:H,zip64CompressedSize:U,zip64DiskNumberStart:K,zip64Offset:Q,msDosCompatible:ie,internalFileAttribute:j,externalFileAttribute:$,diskNumberStart:ne,uncompressedSize:be,compressedSize:Ce}=I,me=ji(F,N,b,G,X);Qi(y,l,33639248),io(y,l+4,A);let _e=Oa(k);H||Qi(_e,18,be),U||Qi(_e,14,Ce),Xs(p,k,l+6),io(y,l+30,me),io(y,l+32,ji(W)),io(y,l+34,O&&K?65535:ne),io(y,l+36,j),$?Qi(y,l+38,$):B&&ie&&sO(y,l+38,16),Qi(y,l+42,O&&Q?4294967295:v),Xs(p,P,l+46),Xs(p,F,l+46+ji(P)),Xs(p,N,l+46+ji(P,F)),Xs(p,b,l+46+ji(P,F,N)),Xs(p,G,l+46+ji(P,F,N,b)),Xs(p,X,l+46+ji(P,F,N,b,G)),Xs(p,W,l+46+ji(P)+me);let Ve=46+ji(P,W)+me;if(l-h>o.availableSize&&(o.availableSize=0,await Yh(s,p.slice(h,l)),h=l),l+=Ve,n.onprogress)try{await n.onprogress(E+1,i.size,new bg(I))}catch{}}await Yh(s,h?p.slice(h):p);let g=o.diskNumber,{availableSize:x}=o;x<22&&g++;let S=ho(e,n,KU);if(u>4294967295||d>4294967295||f>65535||g>65535){if(S===!1)throw new Error(HQ);S=!0}let V=new Uint8Array(S?98:22),Z=Oa(V);l=0,S&&(Qi(Z,0,101075792),Kl(Z,4,BigInt(44)),io(Z,12,45),io(Z,14,45),Qi(Z,16,g),Qi(Z,20,a),Kl(Z,24,BigInt(f)),Kl(Z,32,BigInt(f)),Kl(Z,40,BigInt(d)),Kl(Z,48,BigInt(u)),Qi(Z,56,117853008),Kl(Z,64,BigInt(u)+BigInt(d)),Qi(Z,72,g+1),ho(e,n,"supportZip64SplitFile",!0)&&(g=65535,a=65535),f=65535,u=4294967295,d=4294967295,l+=76),Qi(Z,l,101010256),io(Z,l+4,g),io(Z,l+6,a),io(Z,l+8,f),io(Z,l+10,f),Qi(Z,l+12,d),Qi(Z,l+16,u);let R=ji(t);if(R)if(R<=65535)io(Z,l+20,R);else throw new Error(cit);await Yh(s,V),R&&await Yh(s,t)}async function Yh(e,t){let n=e.getWriter();try{await n.ready,e.size+=ji(t),await n.write(t)}finally{n.releaseLock()}}function YQ(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ho(e,t,n,i){let o=t[n]===Ei?e.options[n]:t[n];return o===Ei?i:o}function ube(e){return e+5*(Math.floor(e/16383)+1)}function sO(e,t,n){e.setUint8(t,n)}function io(e,t,n){e.setUint16(t,n,!0)}function Qi(e,t,n){e.setUint32(t,n,!0)}function Kl(e,t,n){e.setBigUint64(t,n,!0)}function Xs(e,t,n){e.set(t,n)}function Oa(e){return new DataView(e.buffer)}function ji(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}GV({Deflate:Jhe,Inflate:ype});var zQ=32,Lit="http://www.opengis.net/kml/2.2",Wf="http://www.google.com/kml/ext/2.2",Zit="http://www.w3.org/2000/xmlns/";function aO(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Rit=/^data:image\/([^,;]+)/;aO.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ge){if(e=Ge.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Rit);n=`texture_${++this._count}`,c(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 Git(e,t){return function(n){e._files[t]=n}}aO.prototype.model=function(e,t){let n=this._modelCallback;if(!c(n))throw new le("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(Git(this,r))}return o};Object.defineProperties(aO.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function cO(e){this._time=e}cO.prototype.get=function(e,t,n){let i;return c(e)&&(i=c(e.getValue)?e.getValue(this._time,n):e),i??t};cO.prototype.getColor=function(e,t){let n=this.get(e,t);if(c(n))return RT(n)};cO.prototype.getMaterialType=function(e){if(c(e))return e.getType(this._time)};function KQ(){this._ids={},this._styles={},this._count=0}KQ.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(c(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};KQ.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 pbe(){this._ids={}}pbe.prototype.get=function(e){if(!c(e))return this.get(Hn());let t=this._ids;return c(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function JQ(e){e=e??z.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1;if(!c(t))throw new L("entities is required.");let i=JQ._createState(e),o=t.values.filter(function(d){return!c(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Zit,"xmlns:gx",Wf);let a=r.createElement("Document");s.appendChild(a),ybe(i,a,o),i.styleCache.save(a);let l=i.externalFileHandler;return l.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?Eit(u,l.files):{kml:u,externalFiles:l.files}})}function Eit(e,t){let n=on("ThirdParty/Workers/z-worker-pako.js");GV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new cv,o=new rO(i);return o.add("doc.kml",new UU(e)).then(function(){let r=Object.keys(t);return bbe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function bbe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new o0(n[o])).then(function(){return bbe(e,t,n,i+1)})}JQ._createState=function(e){let t=e.entities,n=new KQ,i=t.computeAvailability(),o=c(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ye.MINIMUM_VALUE?r.stop===Ye.MAXIMUM_VALUE?r=new Zn:ee.addSeconds(r.stop,-10*s,r.start):r.stop===Ye.MAXIMUM_VALUE&&ee.addSeconds(r.start,10*s,r.stop);let a=new aO(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Lit,"kml"),ellipsoid:e.ellipsoid??re.default,idManager:new pbe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new cO(o),sampleDuration:s,defaultAvailability:new Yr([r])}};function ybe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,l,d,u;for(let f=0;f<a;++f){let p=n[f];l=[],d=[],u=[],Xit(e,p,d,u),Iit(e,p.polyline,d,u),hbe(e,p.rectangle,d,u,l),hbe(e,p.polygon,d,u,l),vit(e,p,p.model,d,u);let y,h=p.availability;c(h)&&(y=i.createElement("TimeSpan"),ee.equals(h.start,Ye.MINIMUM_VALUE)||y.appendChild(hn(i,"begin",ee.toIso8601(h.start))),ee.equals(h.stop,Ye.MAXIMUM_VALUE)||y.appendChild(hn(i,"end",ee.toIso8601(h.stop))));for(let S=0;S<l.length;++S){let V=l[S];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)),c(y)&&V.appendChild(y),t.appendChild(V)}let g=d.length;if(g>0){let S=i.createElement("Placemark");S.setAttribute("id",s.get(p.id));let V=p.name,Z=p.label;if(c(Z)){let E=i.createElement("LabelStyle"),I=r.get(Z.text);V=c(I)&&I.length>0?I:V;let v=r.getColor(Z.fillColor);c(v)&&(E.appendChild(hn(i,"color",v)),E.appendChild(hn(i,"colorMode","normal")));let P=r.get(Z.scale);c(P)&&E.appendChild(hn(i,"scale",P)),u.push(E)}S.appendChild(hn(i,"name",V)),S.appendChild(hn(i,"visibility",p.show)),S.appendChild(hn(i,"description",p.description)),c(y)&&S.appendChild(y),t.appendChild(S);let R=u.length;if(R>0){let E=i.createElement("Style");for(let I=0;I<R;++I)E.appendChild(u[I]);S.appendChild(hn(i,"styleUrl",o.get(E)))}if(d.length===1)S.appendChild(d[0]);else if(d.length>1){let E=i.createElement("MultiGeometry");for(let I=0;I<g;++I)E.appendChild(d[I]);S.appendChild(E)}}let x=p._children;if(x.length>0){let S=i.createElement("Folder");S.setAttribute("id",s.get(p.id)),S.appendChild(hn(i,"name",p.name)),S.appendChild(hn(i,"visibility",p.show)),S.appendChild(hn(i,"description",p.description)),t.appendChild(S),ybe(e,S,x)}}}var Jl=new m,ul=new pe,If=new ee;function Xit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!c(a)&&!c(t.path))return;let l=t.position;if(!l.isConstant){gbe(e,t,a,n,i);return}s.get(l,void 0,Jl);let d=hn(o,"coordinates",ZT(Jl,r)),u=o.createElement("Point"),f=o.createElement("altitudeMode");f.appendChild(GT(e,a.heightReference)),u.appendChild(f),u.appendChild(d),n.push(u);let p=a instanceof cc?_be(e,a):xbe(e,a);i.push(p)}function gbe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,l,d=t.position,u=!0;d instanceof ya?(l=d.intervals,u=!1):l=t.availability??e.defaultAvailability;let f=n instanceof Up,p,y,h,g=[];for(p=0;p<l.length;++p){let S=l.get(p),V=u?d:S.data,Z=r.createElement("altitudeMode");V instanceof Mh?(V=V._value,Z.appendChild(GT(e,ze.CLAMP_TO_GROUND))):c(n)?Z.appendChild(GT(e,n.heightReference)):Z.appendChild(GT(e,ze.NONE));let R=[],E=[];if(V.isConstant){a.get(V,void 0,Jl);let v=hn(r,"coordinates",ZT(Jl,s));R.push(ee.toIso8601(S.start)),E.push(v),R.push(ee.toIso8601(S.stop)),E.push(v)}else if(V instanceof xa)for(h=V._property._times,y=0;y<h.length;++y)R.push(ee.toIso8601(h[y])),V.getValueInReferenceFrame(h[y],Ui.FIXED,Jl),E.push(ZT(Jl,s));else if(V instanceof Fd){h=V._times;let v=V._values;for(y=0;y<h.length;++y)R.push(ee.toIso8601(h[y])),m.fromArray(v,y*3,Jl),E.push(ZT(Jl,s))}else{let v=e.sampleDuration;S.start.clone(If),S.isStartIncluded||ee.addSeconds(If,v,If);let P=S.stop;for(;ee.lessThan(If,P);)V.getValue(If,Jl),R.push(ee.toIso8601(If)),E.push(ZT(Jl,s)),ee.addSeconds(If,v,If);S.isStopIncluded&&ee.equals(If,P)&&(V.getValue(If,Jl),R.push(ee.toIso8601(If)),E.push(ZT(Jl,s)))}let I=r.createElementNS(Wf,"Track");I.appendChild(Z);for(let v=0;v<R.length;++v){let P=hn(r,"when",R[v]),F=hn(r,"coord",E[v],Wf);I.appendChild(P),I.appendChild(F)}f&&I.appendChild(Tbe(e,n)),g.push(I)}if(g.length===1)i.push(g[0]);else if(g.length>1){let S=r.createElementNS(Wf,"MultiTrack");for(p=0;p<g.length;++p)S.appendChild(g[p]);i.push(S)}if(c(n)&&!f){let S=n instanceof cc?_be(e,n):xbe(e,n);o.push(S)}let x=t.path;if(c(x)){let S=a.get(x.width),V=x.material;if(c(V)||c(S)){let Z=r.createElement("LineStyle");c(S)&&Z.appendChild(hn(r,"width",S)),QQ(e,V,Z),o.push(Z)}}}function xbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);c(r)&&(o.appendChild(hn(n,"color",r)),o.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return c(s)&&o.appendChild(hn(n,"scale",s/zQ)),o}function _be(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(c(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(hn(n,"href",s));let y=i.get(t.imageSubRegion);c(y)&&(p.appendChild(hn(n,"x",y.x,Wf)),p.appendChild(hn(n,"y",y.y,Wf)),p.appendChild(hn(n,"w",y.width,Wf)),p.appendChild(hn(n,"h",y.height,Wf))),r.appendChild(p)}let a=i.getColor(t.color);c(a)&&(r.appendChild(hn(n,"color",a)),r.appendChild(hn(n,"colorMode","normal")));let l=i.get(t.scale);c(l)&&r.appendChild(hn(n,"scale",l));let d=i.get(t.pixelOffset);if(c(d)){l=l??1,D.divideByScalar(d,l,d);let p=i.get(t.width,zQ),y=i.get(t.height,zQ),h=i.get(t.horizontalOrigin,xi.CENTER);h===xi.CENTER?d.x-=p*.5:h===xi.RIGHT&&(d.x-=p);let g=i.get(t.verticalOrigin,Mn.CENTER);g===Mn.TOP?d.y+=y:g===Mn.CENTER&&(d.y+=y*.5);let x=n.createElement("hotSpot");x.setAttribute("x",-d.x),x.setAttribute("y",d.y),x.setAttribute("xunits","pixels"),x.setAttribute("yunits","pixels"),r.appendChild(x)}let u=i.get(t.rotation),f=i.get(t.alignedAxis);return c(u)&&m.equals(m.UNIT_Z,f)&&(u=w.toDegrees(-u),u===0&&(u=360),r.appendChild(hn(n,"heading",u))),r}function Iit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!c(t))return;let a=o.createElement("LineString"),l=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"),l.appendChild(u),a.appendChild(l);let f=t.positions,p=s.get(f),y=hn(o,"coordinates",ZT(p,r));a.appendChild(y);let h=s.get(t.zIndex);d&&c(h)&&a.appendChild(hn(o,"drawOrder",h,Wf)),n.push(a);let g=o.createElement("LineStyle"),x=s.get(t.width);c(x)&&g.appendChild(hn(o,"width",x)),QQ(e,t.material,g),i.push(g)}function Wit(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),l=[],d=[de.northeast,de.southeast,de.southwest,de.northwest];for(let y=0;y<4;++y)d[y](a,ul),l.push(`${w.toDegrees(ul.longitude)},${w.toDegrees(ul.latitude)},${r}`);let u=hn(i,"coordinates",l.join(" ")),f=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),f.appendChild(p),[f]}function fbe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)pe.fromCartesian(t[u],r,ul),s.push(`${w.toDegrees(ul.longitude)},${w.toDegrees(ul.latitude)},${i?ul.height:n}`);let l=hn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(l),d}function wit(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=[],l=t.hierarchy,d=o.get(l),u=Array.isArray(d)?d:d.positions,f=i.createElement("outerBoundaryIs");f.appendChild(fbe(e,u,r,s)),a.push(f);let p=d.holes;if(c(p)){let y=p.length;for(let h=0;h<y;++h){let g=i.createElement("innerBoundaryIs");g.appendChild(fbe(e,p[h].positions,r,s)),a.push(g)}}return a}function hbe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!c(t))return;let a=t instanceof Um;if(a&&s.getMaterialType(t.material)==="Image"){Pit(e,t,o);return}let l=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&l.appendChild(hn(r,"extrude",!0));let u=a?Wit(e,t,d):wit(e,t,d),f=u.length;for(let x=0;x<f;++x)l.appendChild(u[x]);let p=r.createElement("altitudeMode");p.appendChild(GT(e,t.heightReference)),l.appendChild(p),n.push(l);let y=r.createElement("PolyStyle"),h=s.get(t.fill,!1);h&&y.appendChild(hn(r,"fill",h)),QQ(e,t.material,y);let g=s.get(t.outline,!1);if(g){y.appendChild(hn(r,"outline",g));let x=r.createElement("LineStyle"),S=s.get(t.outlineWidth,1);x.appendChild(hn(r,"width",S));let V=s.getColor(t.outlineColor,Y.BLACK);x.appendChild(hn(r,"color",V)),x.appendChild(hn(r,"colorMode","normal")),i.push(x)}i.push(y)}function Pit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(GT(e,t.heightReference)),s.appendChild(a);let l=o.get(t.height);c(l)&&s.appendChild(hn(i,"altitude",l));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 f=o.get(t.material),p=r.texture(f.image),y=i.createElement("Icon");y.appendChild(hn(i,"href",p)),s.appendChild(y);let h=f.color;c(h)&&s.appendChild(hn(i,"color",RT(f.color))),n.push(s)}function Tbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(c(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"),l=o.model(t,e.time);return a.appendChild(hn(n,"href",l)),r.appendChild(a),r}function vit(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!c(n))return;let l=t.position;if(!l.isConstant){gbe(e,t,n,i,o);return}let d=Tbe(e,n),u=r.createElement("altitudeMode");u.appendChild(GT(e,n.heightReference)),d.appendChild(u),a.get(l,void 0,Jl),pe.fromCartesian(Jl,s,ul);let f=r.createElement("Location");f.appendChild(hn(r,"longitude",w.toDegrees(ul.longitude))),f.appendChild(hn(r,"latitude",w.toDegrees(ul.latitude))),f.appendChild(hn(r,"altitude",ul.height)),d.appendChild(f),i.push(d)}function QQ(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!c(t))return;let r=o.get(t);if(!c(r))return;let s,a=o.getMaterialType(t),l,d;switch(a){case"Image":s=RT(Y.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=RT(r.color);break;case"PolylineOutline":s=RT(r.color),l=RT(r.outlineColor),d=r.outlineWidth,n.appendChild(hn(i,"outerColor",l,Wf)),n.appendChild(hn(i,"outerWidth",d,Wf));break;case"Stripe":s=RT(r.oddColor);break}c(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function GT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,ze.NONE),r;switch(o){case ze.NONE:r=n.createTextNode("absolute");break;case ze.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case ze.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function ZT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,ul),i.push(`${w.toDegrees(ul.longitude)},${w.toDegrees(ul.latitude)},${ul.height}`);return i.join(" ")}function hn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=c(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 RT(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 jQ=JQ;var lCi=_(T(),1);var ATi=_(T(),1);function pv(){this._cache={}}pv.prototype.fromColor=function(e,t){if(!c(e))throw new L("color is required");if(!c(t))throw new L("size is required");return lO(void 0,void 0,e,t,this._cache)};pv.prototype.fromUrl=function(e,t,n){if(!c(e))throw new L("url is required");if(!c(t))throw new L("color is required");if(!c(n))throw new L("size is required");return lO(e,void 0,t,n,this._cache)};pv.prototype.fromMakiIconId=function(e,t,n){if(!c(e))throw new L("id is required");if(!c(t))throw new L("color is required");if(!c(n))throw new L("size is required");return lO(on(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};pv.prototype.fromText=function(e,t,n){if(!c(e))throw new L("text is required");if(!c(t))throw new L("color is required");if(!c(n))throw new L("size is required");return lO(void 0,e,t,n,this._cache)};var Fit=new Y;function Ait(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Fit).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 Sbe(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=Y.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=Y.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var hv=new Array(4);function lO(e,t,n,i,o){hv[0]=e,hv[1]=t,hv[2]=n,hv[3]=i;let r=JSON.stringify(hv),s=o[r];if(c(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let l=a.getContext("2d");if(Ait(l,n,i),c(e)){let u=Ge.createIfNeeded(e).fetchImage().then(function(f){return Sbe(l,f,i),o[r]=a,a});return o[r]=u,u}else if(c(t)){let d=v_(t,{font:`bold ${i}px sans-serif`});Sbe(l,d,i)}return o[r]=a,a}var r0=pv;var RSi=_(T());var YTi=_(T());var OTi=_(T());var NTi=_(T());function qQ(e){return e}function dO(e){if(e==null)return qQ;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var d=2,u=a.length,f=new Array(u);for(f[0]=(t+=a[0])*i+r,f[1]=(n+=a[1])*o+s;d<u;)f[d]=a[d],++d;return f}}var jTi=_(T());var zTi=_(T());function Cbe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function $Q(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Vbe(e,n)})}:Vbe(e,t)}function Vbe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=ej(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 ej(e,t){var n=dO(e.transform),i=e.arcs;function o(u,f){f.length&&f.pop();for(var p=i[u<0?~u:u],y=0,h=p.length;y<h;++y)f.push(n(p[y],y));u<0&&Cbe(f,h)}function r(u){return n(u)}function s(u){for(var f=[],p=0,y=u.length;p<y;++p)o(u[p],f);return f.length<2&&f.push(f[0]),f}function a(u){for(var f=s(u);f.length<4;)f.push(f[0]);return f}function l(u){return u.map(a)}function d(u){var f=u.type,p;switch(f){case"GeometryCollection":return{type:f,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=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:f,coordinates:p}}return d(t)}var iSi=_(T());var $Ti=_(T());var aSi=_(T());var fSi=_(T());var lSi=_(T());var _Si=_(T());var bSi=_(T());function uO(e){return m.fromDegrees(e[0],e[1],e[2])}var tj={"urn:ogc:def:crs:OGC:1.3:CRS84":uO,"EPSG:4326":uO,"urn:ogc:def:crs:EPSG::4326":uO},Lbe={},Zbe={},nj=48,ij,oj=Y.ROYALBLUE,rj=Y.YELLOW,sj=2,aj=Y.fromBytes(255,255,0,100),cj=!1,Oit={small:24,medium:48,large:64},Dit=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Rbe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Dit.indexOf(i)!==-1)continue;let o=e[i];c(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Rbe(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 Bit(e,t,n){let i;return function(o,r){return c(i)||(i=e(t,n)),i}}function Yit(e,t){return new Om(Bit(Rbe,e,t),!0)}function mO(e,t,n){let i=e.id;if(!c(i)||e.type!=="Feature")i=Hn();else{let s=2,a=i;for(;c(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(c(r)){o.properties=r;let s,a=r.title;if(c(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let f=u.toLowerCase();if(d>1&&f==="title"){d=1,s=u;break}else d>2&&f==="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)}c(s)&&(o.name=r[s])}let l=r.description;l!==null&&(o.description=c(l)?new Qn(l):n(r,s))}return o}function lj(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Gbe={Feature:Xbe,FeatureCollection:Hit,GeometryCollection:Ibe,LineString:Fbe,MultiLineString:Abe,MultiPoint:Pbe,MultiPolygon:kbe,Point:wbe,Polygon:Nbe,Topology:Ube},Ebe={GeometryCollection:Ibe,LineString:Fbe,MultiLineString:Abe,MultiPoint:Pbe,MultiPolygon:kbe,Point:wbe,Polygon:Nbe,Topology:Ube};function Xbe(e,t,n,i,o){if(t.geometry===null){mO(t,e._entityCollection,o.describe);return}if(!c(t.geometry))throw new le("feature.geometry is required.");let r=t.geometry.type,s=Ebe[r];if(!c(s))throw new le(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Hit(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Xbe(e,r[s],void 0,i,o)}function Ibe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let l=r[s],d=l.type,u=Ebe[d];if(!c(u))throw new le(`Unknown geometry type: ${d}`);u(e,t,l,i,o)}}function Wbe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,l=t.properties;if(c(l)){let y=l["marker-color"];c(y)&&(s=Y.fromCssColorString(y)),a=Oit[l["marker-size"]]??a;let h=l["marker-symbol"];c(h)&&(r=h)}let d;c(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 cc;u.verticalOrigin=new Qn(Mn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=ze.CLAMP_TO_GROUND);let f=mO(t,e._entityCollection,o.describe);f.billboard=u,f.position=new Oc(n(i));let p=Promise.resolve(d).then(function(y){u.image=new Qn(y)}).catch(function(){u.image=new Qn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function wbe(e,t,n,i,o){Wbe(e,t,i,n.coordinates,o)}function Pbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Wbe(e,t,i,r[s],o)}function vbe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(c(a)){let u=a["stroke-width"];c(u)&&(s=new Qn(u));let f,p=a.stroke;c(p)&&(f=Y.fromCssColorString(p));let y=a["stroke-opacity"];c(y)&&y!==1&&(c(f)||(f=r.color.getValue().clone()),f.alpha=y),c(f)&&(r=new Ut(f))}let l=mO(t,e._entityCollection,o.describe),d=new uc;l.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new Qn(lj(i,n)),d.arcType=Kt.RHUMB}function Fbe(e,t,n,i,o){vbe(e,t,i,n.coordinates,o)}function Abe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)vbe(e,t,i,r[s],o)}function Mbe(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,l=t.properties;if(c(l)){let y=l["stroke-width"];c(y)&&(a=new Qn(y));let h,g=l.stroke;c(g)&&(h=Y.fromCssColorString(g));let x=l["stroke-opacity"];c(x)&&x!==1&&(c(h)||(h=r.getValue().clone()),h.alpha=x),c(h)&&(r=new Qn(h));let S,V=l.fill,Z=s.color.getValue();c(V)&&(S=Y.fromCssColorString(V),S.alpha=Z.alpha),x=l["fill-opacity"],c(x)&&x!==Z.alpha&&(c(S)||(S=Z.clone()),S.alpha=x),c(S)&&(s=new Ut(S))}let d=new km;d.outline=new Qn(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=Kt.RHUMB;let u=[];for(let y=1,h=i.length;y<h;y++)u.push(new Fa(lj(i[y],n)));let f=i[0];d.hierarchy=new Qn(new Fa(lj(f,n),u)),f[0].length>2?d.perPositionHeight=new Qn(!0):o.clampToGround||(d.height=0);let p=mO(t,e._entityCollection,o.describe);p.polygon=d}function Nbe(e,t,n,i,o){Mbe(e,t,i,n.coordinates,o)}function kbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Mbe(e,t,i,r[s],o)}function Ube(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=$Q(n,n.objects[r]),a=Gbe[s.type];a(e,s,s,i,o)}}function yg(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Ks(this),this._promises=[],this._pinBuilder=new r0,this._entityCluster=new wd,this._credit=void 0,this._resourceCredits=[]}yg.load=function(e,t){return new yg().load(e,t)};Object.defineProperties(yg,{markerSize:{get:function(){return nj},set:function(e){nj=e}},markerSymbol:{get:function(){return ij},set:function(e){ij=e}},markerColor:{get:function(){return oj},set:function(e){oj=e}},stroke:{get:function(){return rj},set:function(e){rj=e}},strokeWidth:{get:function(){return sj},set:function(e){sj=e}},fill:{get:function(){return aj},set:function(e){aj=e}},clampToGround:{get:function(){return cj},set:function(e){cj=e}},crsNames:{get:function(){return tj}},crsLinkHrefs:{get:function(){return Lbe}},crsLinkTypes:{get:function(){return Zbe}}});Object.defineProperties(yg.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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});yg.prototype.load=function(e,t){return Obe(this,e,t,!0)};yg.prototype.process=function(e,t){return Obe(this,e,t,!1)};function Obe(e,t,n,i){if(!c(t))throw new L("data is required.");Hr.setLoading(e,!0),n=n??z.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 Ge){t=Ge.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,l=t.credits;if(c(l)){let d=l.length;for(let u=0;u<d;u++)a.push(l[u])}}return n={describe:n.describe??Yit,markerSize:n.markerSize??nj,markerSymbol:n.markerSymbol??ij,markerColor:n.markerColor??oj,strokeWidthProperty:new Qn(n.strokeWidth??sj),strokeMaterialProperty:new Ut(n.stroke??rj),fillMaterialProperty:new Ut(n.fill??aj),clampToGround:n.clampToGround??cj},Promise.resolve(r).then(function(a){return zit(e,a,n,s,i)}).catch(function(a){throw Hr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}yg.prototype.update=function(e){return!0};function zit(e,t,n,i,o){let r;c(i)&&(r=Ob(i)),c(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Gbe[t.type];if(!c(s))throw new le(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,l=a!==null?uO:null;if(c(a)){if(!c(a.properties))throw new le("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(l=tj[d.name],!c(l))throw new le(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Lbe[d.href];if(c(u)||(u=Zbe[d.type]),!c(u))throw new le(`Unable to resolve crs link: ${JSON.stringify(d)}`);l=u(d)}else if(a.type==="EPSG"){if(l=tj[`EPSG:${d.code}`],!c(l))throw new le(`Unknown crs EPSG code: ${d.code}`)}else throw new le(`Unknown crs type: ${a.type}`)}return Promise.resolve(l).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,Hr.setLoading(e,!1),e})})}var gg=yg;var mCi=_(T(),1);function Kit(e){if(typeof e=="string"){let t=document.getElementById(e);if(t===null)throw new L(`Element with id "${e}" does not exist in the document.`);e=t}return e}var Wn=Kit;var nLi=_(T(),1);var bVi=_(T());var eVi=_(T());var hCi=_(T()),Dbe="4.1.0";var bCi=_(T());function Jit(e){return e===void 0}function Bd(e){return typeof e=="boolean"}function Bbe(e,t){for(var n in t)t.hasOwnProperty(n)&&Jit(e[n])&&(e[n]=t[n]);return e}function Ybe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Ko(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function xg(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Hh(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var vCi=_(T());var SCi=_(T());var xCi=_(T()),_g=/[A-Za-z]/,Qs=/[\d]/;var Yd=/\s/,fO=/['"]/,Hbe=/[\x00-\x1F\x7F]/,zbe=/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,Qit=/\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,jit=/\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,qit=zbe+Qit+jit,Kbe=/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,yCi=new RegExp("[".concat(zbe+Kbe,"]")),dj=qit+Kbe,wf=new RegExp("[".concat(dj,"]"));var hO=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(Yd):[],o=t.split(Yd),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(Yd):[],o=t.split(Yd),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 VCi=_(T());function Jbe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var Z={},R=V,E=R.match(/^([a-z]+):\/\//i);return E&&(Z.scheme=E[1],R=R.substr(E[0].length)),E=R.match(/^(.*?)(?=(\?|#|\/|$))/i),E&&(Z.host=E[1],R=R.substr(E[0].length)),E=R.match(/^\/(.*?)(?=(\?|#|$))/i),E&&(Z.path=E[1],R=R.substr(E[0].length)),E=R.match(/^\?(.*?)(?=(#|$))/i),E&&(Z.query=E[1],R=R.substr(E[0].length)),E=R.match(/^#(.*?)$/i),E&&(Z.fragment=E[1]),Z},s=function(V){var Z="";return V.scheme&&V.host&&(Z+=V.scheme+"://"),V.host&&(Z+=V.host),V.path&&(Z+="/"+V.path),V.query&&(Z+="?"+V.query),V.fragment&&(Z+="#"+V.fragment),Z},a=function(V,Z){var R=Z/2,E=Math.ceil(R),I=-1*Math.floor(R),v="";return I<0&&(v=V.substr(I)),V.substr(0,E)+n+v};if(e.length<=t)return e;var l=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 f="";if(d.host&&(f+=d.host),f.length>=l)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,l+i):a(f,l).substr(0,l+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((f+p).length>=l){if((f+p).length==t)return(f+p).substr(0,t);var y=l-f.length;return(f+a(p,y)).substr(0,l+i)}else f+=p;if(d.fragment){var h="#"+d.fragment;if((f+h).length>=l){if((f+h).length==t)return(f+h).substr(0,t);var g=l-f.length;return(f+a(h,g)).substr(0,l+i)}else f+=h}if(d.scheme&&d.host){var x=d.scheme+"://";if((f+x).length<l)return(x+f).substr(0,t)}if(f.length<=t)return f;var S="";return l>0&&(S=f.substr(-1*Math.floor(l/2))),(f.substr(0,Math.ceil(l/2))+n+S).substr(0,l+i)}var ZCi=_(T());function Qbe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",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 ECi=_(T());function jbe(e,t,n){return Ybe(e,t,n)}var qbe=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 hO({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"?Jbe(t,i):o==="middle"?Qbe(t,i):jbe(t,i)},e}();var N1i=_(T());var QCi=_(T());var ACi=_(T(),1),uj=function(e,t){return uj=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])},uj(e,t)};function zh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");uj(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var js=function(){return js=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},js.apply(this,arguments)};var NCi=_(T()),Kh=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 YCi=_(T());var UCi=_(T()),$it="(?: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)",$be=new RegExp("^"+$it+"$");var eot=/[\/?#]/,tot=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,e0e=/[?!:,.;^]/,mj=/https?:\/\//i,t0e=new RegExp("^"+mj.source,"i"),n0e=new RegExp(e0e.source+"$"),not=/^(javascript|vbscript):/i,iot=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,oot=/^(?:\/\/)?([^/#?:]+)/;function FV(e){return _g.test(e)}function fj(e){return _g.test(e)||Qs.test(e)||e==="+"||e==="-"||e==="."}function s0(e){return wf.test(e)}function pO(e){return e==="_"||s0(e)}function hj(e){return wf.test(e)||tot.test(e)||e0e.test(e)}function bO(e){return eot.test(e)}function pj(e){return $be.test(e.toLowerCase())}function i0e(e){if(not.test(e))return!1;var t=e.match(iot);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!_g.test(i))}function o0e(e){var t=e.match(oot);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!pj(o)}var rot=/^(?:(?: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]?)$/,sot=/[:/?#]/;function r0e(e){var t=e.split(sot,1)[0];return rot.test(t)}var aot=/^(https?:\/\/)?(www\.)?/i,cot=/^\/\//,s0e=function(e){zh(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=uot(n)),this.stripPrefix.scheme&&(n=lot(n)),this.stripPrefix.www&&(n=dot(n)),this.stripTrailingSlash&&(n=mot(n)),this.decodePercentEncoding&&(n=fot(n)),n},t}(Kh);function lot(e){return e.replace(t0e,"")}function dot(e){return e.replace(aot,"$1")}function uot(e){return e.replace(cot,"")}function mot(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function fot(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var e1i=_(T());var a0e=/^mailto:/i,hot=new RegExp("[".concat(dj,"!#$%&'*+/=?^_`{|}~-]"));function c0e(e){return wf.test(e)}function yO(e){return hot.test(e)}function l0e(e){var t=e.split(".").pop()||"";return pj(t)}var o1i=_(T());var d0e=function(e){zh(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}(Kh);var a1i=_(T());function bj(e){return e==="_"||wf.test(e)}function u0e(e){return e.length<=140}var m0e=["twitter","facebook","instagram","tiktok","youtube"];var m1i=_(T());var f0e=function(e){zh(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 Hh(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}(Kh);var h1i=_(T()),pot={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},bot=/[-\w.]/;function yj(e){return bot.test(e)}function h0e(e,t){var n=pot[t];return n.test(e)}var p0e=["twitter","instagram","soundcloud","tiktok","youtube"];var x1i=_(T());var b0e=function(e){zh(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 Hh(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}(Kh);var T1i=_(T()),yot=/[-. ]/,got=/[-. ()]/,xot=/[,;]/,_ot=/(?:(?:(?:(\+)?\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]+#?)*/,Tot=/(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})/,Sot=new RegExp("^".concat(_ot.source,"|").concat(Tot.source,"$"));function gj(e){return yot.test(e)}function gO(e){return xot.test(e)}function y0e(e){var t=e.charAt(0)==="+"||got.test(e);return t&&Sot.test(e)}var L1i=_(T());var g0e=function(e){zh(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}(Kh);function T0e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,l=[],d=e.length,u=[],f=0;f<d;f++){var p=e.charAt(f);if(u.length===0)S(p);else{for(var y=u.length-1;y>=0;y--){var h=u[y];switch(h.state){case 11:v(h,p);break;case 12:P(h,p);break;case 0:V(h,p);break;case 1:Z(h,p);break;case 2:R(h,p);break;case 3:E(h,p);break;case 4:I(h,p);break;case 5:F(h,p);break;case 6:N(h,p);break;case 7:b(h,p);break;case 13:G(h,p);break;case 14:X(h,p);break;case 8:W(h,p);break;case 9:A(h,p);break;case 10:k(h,p);break;case 15:B(h,p);break;case 16:O(h,p);break;case 17:H(h,p);break;case 18:U(h,p);break;case 19:K(h,p);break;case 20:Q(h,p);break;case 21:ie(h,p);break;case 22:j(h,p);break;case 23:$(h,p);break;case 24:ne(h,p);break;case 25:be(h,p);break;case 26:Ce(h,p);break;case 27:me(h,p);break;case 28:_e(h,p);break;case 29:Ve(h,p);break;case 30:Ie(h,p);break;case 31:Ze(h,p);break;case 32:Ke(h,p);break;case 33:rt(h,p);break;case 34:Xt(h,p);break;case 35:Ht(h,p);break;case 36:qe(h,p);break;case 37:De(h,p);break;case 38:mn(h,p);break;case 39:Dt(h,p);break;case 40:Lt(h,p);break;case 41:Vi(h,p);break;default:Hh(h.state)}}if(f>0&&FV(p)){var g=e.charAt(f-1);!FV(g)&&!u.some(Eot)&&u.push(xO(f,0))}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(ge){return ln(ge)});return l;function S(ge){if(ge==="#")u.push(Rot(f,28));else if(ge==="@")u.push(Got(f,30));else if(ge==="/")u.push(xj(f,11));else if(ge==="+")u.push(_j(f,37));else if(ge==="(")u.push(_j(f,32));else{if(Qs.test(ge)&&(u.push(_j(f,38)),u.push(Lot(f,13))),c0e(ge)){var Le=ge.toLowerCase()==="m"?15:22;u.push(Zot(f,Le))}FV(ge)&&u.push(xO(f,0)),wf.test(ge)&&u.push(xj(f,5))}}function V(ge,Le){Le===":"?ge.state=2:Le==="-"?ge.state=1:fj(Le)||Ko(u,ge)}function Z(ge,Le){Le==="-"||(Le==="/"?(Ko(u,ge),u.push(xj(f,11))):fj(Le)?ge.state=0:Ko(u,ge))}function R(ge,Le){Le==="/"?ge.state=3:Le==="."?Ko(u,ge):s0(Le)?(ge.state=5,FV(Le)&&u.push(xO(f,0))):Ko(u,ge)}function E(ge,Le){Le==="/"?ge.state=4:hj(Le)?(ge.state=10,ge.acceptStateReached=!0):ln(ge)}function I(ge,Le){Le==="/"?ge.state=10:s0(Le)?(ge.state=5,ge.acceptStateReached=!0):Ko(u,ge)}function v(ge,Le){Le==="/"?ge.state=12:Ko(u,ge)}function P(ge,Le){s0(Le)?ge.state=5:Ko(u,ge)}function F(ge,Le){Le==="."?ge.state=7:Le==="-"?ge.state=6:Le===":"?ge.state=8:bO(Le)?ge.state=10:pO(Le)||ln(ge)}function N(ge,Le){Le==="-"||(Le==="."?ln(ge):s0(Le)?ge.state=5:ln(ge))}function b(ge,Le){Le==="."?ln(ge):s0(Le)?(ge.state=5,ge.acceptStateReached=!0):ln(ge)}function G(ge,Le){Le==="."?ge.state=14:Le===":"?ge.state=8:Qs.test(Le)||(bO(Le)?ge.state=10:wf.test(Le)?Ko(u,ge):ln(ge))}function X(ge,Le){Qs.test(Le)?(ge.octetsEncountered++,ge.octetsEncountered===4&&(ge.acceptStateReached=!0),ge.state=13):ln(ge)}function W(ge,Le){Qs.test(Le)?ge.state=9:ln(ge)}function A(ge,Le){Qs.test(Le)||(bO(Le)?ge.state=10:ln(ge))}function k(ge,Le){hj(Le)||ln(ge)}function B(ge,Le){Le.toLowerCase()==="a"?ge.state=16:j(ge,Le)}function O(ge,Le){Le.toLowerCase()==="i"?ge.state=17:j(ge,Le)}function H(ge,Le){Le.toLowerCase()==="l"?ge.state=18:j(ge,Le)}function U(ge,Le){Le.toLowerCase()==="t"?ge.state=19:j(ge,Le)}function K(ge,Le){Le.toLowerCase()==="o"?ge.state=20:j(ge,Le)}function Q(ge,Le){Le.toLowerCase()===":"?ge.state=21:j(ge,Le)}function ie(ge,Le){yO(Le)?ge.state=22:Ko(u,ge)}function j(ge,Le){Le==="."?ge.state=23:Le==="@"?ge.state=24:yO(Le)?ge.state=22:Ko(u,ge)}function $(ge,Le){Le==="."?Ko(u,ge):Le==="@"?Ko(u,ge):yO(Le)?ge.state=22:Ko(u,ge)}function ne(ge,Le){s0(Le)?ge.state=25:Ko(u,ge)}function be(ge,Le){Le==="."?ge.state=27:Le==="-"?ge.state=26:pO(Le)||ln(ge)}function Ce(ge,Le){Le==="-"||Le==="."?ln(ge):pO(Le)?ge.state=25:ln(ge)}function me(ge,Le){Le==="."||Le==="-"?ln(ge):s0(Le)?(ge.state=25,ge.acceptStateReached=!0):ln(ge)}function _e(ge,Le){bj(Le)?(ge.state=29,ge.acceptStateReached=!0):Ko(u,ge)}function Ve(ge,Le){bj(Le)||ln(ge)}function Ie(ge,Le){yj(Le)?(ge.state=31,ge.acceptStateReached=!0):Ko(u,ge)}function Ze(ge,Le){yj(Le)||(wf.test(Le)?Ko(u,ge):ln(ge))}function De(ge,Le){Qs.test(Le)?ge.state=38:(Ko(u,ge),S(Le))}function Ke(ge,Le){Qs.test(Le)?ge.state=33:Ko(u,ge),S(Le)}function rt(ge,Le){Qs.test(Le)?ge.state=34:Ko(u,ge)}function Xt(ge,Le){Qs.test(Le)?ge.state=35:Ko(u,ge)}function Ht(ge,Le){Le===")"?ge.state=36:Ko(u,ge)}function qe(ge,Le){Qs.test(Le)?ge.state=38:gj(Le)?ge.state=39:Ko(u,ge)}function mn(ge,Le){ge.acceptStateReached=!0,gO(Le)?ge.state=40:Le==="#"?ge.state=41:Qs.test(Le)||(Le==="("?ge.state=32:gj(Le)?ge.state=39:(ln(ge),FV(Le)&&u.push(xO(f,0))))}function Dt(ge,Le){Qs.test(Le)?ge.state=38:Le==="("?ge.state=32:(ln(ge),S(Le))}function Lt(ge,Le){gO(Le)||(Le==="#"?ge.state=41:Qs.test(Le)?ge.state=38:ln(ge))}function Vi(ge,Le){gO(Le)?ge.state=40:Qs.test(Le)?Ko(u,ge):ln(ge)}function ln(ge){if(Ko(u,ge),!!ge.acceptStateReached){var Le=ge.startIdx,yn=e.slice(ge.startIdx,f);if(yn=Vot(yn),ge.type==="url"){var bt=e.charAt(ge.startIdx-1);if(bt==="@")return;var ro=ge.matchType;if(ro==="scheme"){var Xo=mj.exec(yn);if(Xo&&(Le=Le+Xo.index,yn=yn.slice(Xo.index)),!i0e(yn))return}else if(ro==="tld"){if(!o0e(yn))return}else if(ro==="ipV4"){if(!r0e(yn))return}else Hh(ro);l.push(new s0e({tagBuilder:n,matchedText:yn,offset:Le,urlMatchType:ro,url:yn,protocolRelativeMatch:yn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(ge.type==="email")l0e(yn)&&l.push(new d0e({tagBuilder:n,matchedText:yn,offset:Le,email:yn.replace(a0e,"")}));else if(ge.type==="hashtag")u0e(yn)&&l.push(new f0e({tagBuilder:n,matchedText:yn,offset:Le,serviceName:s,hashtag:yn.slice(1)}));else if(ge.type==="mention")h0e(yn,a)&&l.push(new b0e({tagBuilder:n,matchedText:yn,offset:Le,serviceName:a,mention:yn.slice(1)}));else if(ge.type==="phone"){if(yn=yn.replace(/ +$/g,""),y0e(yn)){var ra=yn.replace(/[^0-9,;#]/g,"");l.push(new g0e({tagBuilder:n,matchedText:yn,offset:Le,number:ra,plusSign:yn.charAt(0)==="+"}))}}else Hh(ge)}}}var Cot=/[\(\{\[]/,x0e=/[\)\}\]]/,_0e={")":"(","}":"{","]":"["};function Vot(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Cot.test(i)?t[i]++:x0e.test(i)&&t[_0e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),x0e.test(r)){var s=_0e[r];if(t[s]<0)t[s]++,o--;else break}else if(n0e.test(r))o--;else break;return e.slice(0,o+1)}function xO(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function xj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Lot(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Zot(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Rot(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Got(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function _j(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Eot(e){return e.type==="url"&&e.matchType==="scheme"}var B1i=_(T());function S0e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Jh,l=0,d=e.length,u=0,f=0,p=a;l<d;){var y=e.charAt(l);switch(u){case 0:h(y);break;case 1:g(y);break;case 2:S(y);break;case 3:x(y);break;case 4:V(y);break;case 5:Z(y);break;case 6:R(y);break;case 7:E(y);break;case 8:I(y);break;case 9:v(y);break;case 10:P(y);break;case 11:F(y);break;case 12:N(y);break;case 13:b(y);break;case 14:G(y);break;case 15:X(y);break;case 16:W(y);break;case 17:A(y);break;case 18:k(y);break;case 19:B(y);break;case 20:O(y);break;default:Hh(u)}l++}f<l&&Q();function h($){$==="<"&&U()}function g($){$==="!"?u=13:$==="/"?(u=2,p=new Jh(js(js({},p),{isClosing:!0}))):$==="<"?U():_g.test($)?(u=3,p=new Jh(js(js({},p),{isOpening:!0}))):(u=0,p=a)}function x($){Yd.test($)?(p=new Jh(js(js({},p),{name:ie()})),u=4):$==="<"?U():$==="/"?(p=new Jh(js(js({},p),{name:ie()})),u=12):$===">"?(p=new Jh(js(js({},p),{name:ie()})),K()):!_g.test($)&&!Qs.test($)&&$!==":"&&H()}function S($){$===">"?H():_g.test($)?u=3:H()}function V($){Yd.test($)||($==="/"?u=12:$===">"?K():$==="<"?U():$==="="||fO.test($)||Hbe.test($)?H():u=5)}function Z($){Yd.test($)?u=6:$==="/"?u=12:$==="="?u=7:$===">"?K():$==="<"?U():fO.test($)&&H()}function R($){Yd.test($)||($==="/"?u=12:$==="="?u=7:$===">"?K():$==="<"?U():fO.test($)?H():u=5)}function E($){Yd.test($)||($==='"'?u=8:$==="'"?u=9:/[>=`]/.test($)?H():$==="<"?U():u=10)}function I($){$==='"'&&(u=11)}function v($){$==="'"&&(u=11)}function P($){Yd.test($)?u=4:$===">"?K():$==="<"&&U()}function F($){Yd.test($)?u=4:$==="/"?u=12:$===">"?K():$==="<"?U():(u=4,j())}function N($){$===">"?(p=new Jh(js(js({},p),{isClosing:!0})),K()):u=4}function b($){e.substr(l,2)==="--"?(l+=2,p=new Jh(js(js({},p),{type:"comment"})),u=14):e.substr(l,7).toUpperCase()==="DOCTYPE"?(l+=7,p=new Jh(js(js({},p),{type:"doctype"})),u=20):H()}function G($){$==="-"?u=15:$===">"?H():u=16}function X($){$==="-"?u=18:$===">"?H():u=16}function W($){$==="-"&&(u=17)}function A($){$==="-"?u=18:u=16}function k($){$===">"?K():$==="!"?u=19:$==="-"||(u=16)}function B($){$==="-"?u=17:$===">"?K():u=16}function O($){$===">"?K():$==="<"&&U()}function H(){u=0,p=a}function U(){u=1,p=new Jh({idx:l})}function K(){var $=e.slice(f,p.idx);$&&o($,f),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)),H(),f=l+1}function Q(){var $=e.slice(f,l);o($,f),f=l+1}function ie(){var $=p.idx+(p.isClosing?2:1);return e.slice($,l).toLowerCase()}function j(){l--}}var Jh=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 Xot=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=Iot(t.urls),this.email=Bd(t.email)?t.email:this.email,this.phone=Bd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Bd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Wot(t.stripPrefix),this.stripTrailingSlash=Bd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Bd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&p0e.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&m0e.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=wot(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 S0e(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var l=/( | |<|<|>|>|"|"|')/gi,d=s.split(l),u=a;d.forEach(function(f,p){if(p%2===0){var y=n.parseText(f,u);r.push.apply(r,y)}u+=f.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(l,d){return l.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||xg(t,function(n){return n.getType()==="hashtag"}),this.email||xg(t,function(n){return n.getType()==="email"}),this.phone||xg(t,function(n){return n.getType()==="phone"}),this.mention||xg(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||xg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||xg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||xg(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=T0e(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,"<").replace(/>/g,">"));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 hO)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new qbe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Dbe,e}(),C0e=Xot;function Iot(e){return e==null&&(e=!0),Bd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Bd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Bd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Bd(e.ipV4Matches)?e.ipV4Matches:!0}}function Wot(e){return e==null&&(e=!0),Bd(e)?{scheme:e,www:e}:{scheme:Bd(e.scheme)?e.scheme:!0,www:Bd(e.www)?e.www:!0}}function wot(e){return typeof e=="number"?{length:e,location:"end"}:Bbe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var iVi=_(T());var tVi=_(T());var mVi=_(T());var _O=C0e;var W0e;typeof DOMParser<"u"&&(W0e=new DOMParser);var Pot=new _O({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),TO=32,V0e=2414016,L0e=1,Z0e=16093e3,R0e=.1,vot=[null,void 0,"http://www.topografix.com/GPX/1/1"],Zo={gpx:vot};function Fot(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 Tj(e,t){let n=gv(e,"id");return n=c(n)?n:Hn(),t.getOrCreateEntity(n)}function Sj(e){let t=G0e(e,"lon"),n=G0e(e,"lat"),i=bv(e,"ele",Zo.gpx);return m.fromDegrees(t,n,i)}function G0e(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function gv(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Tg(e,t,n){if(!c(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 Cj(e,t,n){if(!c(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 bv(e,t,n){let i=Tg(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Ql(e,t,n){let i=Tg(e,t,n);if(c(i))return i.textContent.trim()}function w0e(e){let t=new cc;return t.width=TO,t.height=TO,t.scaleByDistance=new Nt(V0e,L0e,Z0e,R0e),t.pixelOffsetScaleByDistance=new Nt(V0e,L0e,Z0e,R0e),t.verticalOrigin=new Qn(Mn.BOTTOM),t.image=e,t}function Aot(){let e=new Nm;return e.translucencyByDistance=new Nt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function P0e(e){let t=new uc;return t.width=4,t.material=new jy,t.material.color=c(e)?e:Y.RED,t.material.outlineWidth=2,t.material.outlineColor=Y.BLACK,t}var E0e={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"}},yv;typeof document<"u"&&(yv=document.createElement("div"));function Vj(e,t){let n,i="",o=Object.keys(E0e),r=o.length;for(n=0;n<r;n++){let u=o[n],f=E0e[u];f.value=Ql(e,f.tag,Zo.gpx)??"",c(f.value)&&f.value!==""&&(i=`${i}<p>${f.text}: ${f.value}</p>`)}if(!c(i)||i==="")return;i=Pot.link(i),yv.innerHTML=i;let s=yv.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=Y.WHITE,l=Y.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:${l.toCssColorString()};`,d+='">',d+=`${yv.innerHTML}</div>`,yv.innerHTML="",d}function v0e(e,t,n,i){let o=Sj(t),r=Tj(t,n);r.position=o;let s=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,TO);r.billboard=w0e(s);let a=Ql(t,"name",Zo.gpx);r.name=a,r.label=Aot(),r.label.text=a,r.description=Vj(t,r),i.clampToGround&&(r.billboard.heightReference=ze.CLAMP_TO_GROUND,r.label.heightReference=ze.CLAMP_TO_GROUND)}function Mot(e,t,n,i){let o=Tj(t,n);o.description=Vj(t,o);let r=Cj(t,"rtept",Zo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)v0e(e,r[a],n,i),s[a]=Sj(r[a]);o.polyline=P0e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Not(e,t,n,i){let o=Tj(t,n);o.description=Vj(t,o);let r=Cj(t,"trkseg",Zo.gpx),s=[],a=[],l,d=!0,u=new xa;for(let f=0;f<r.length;f++)l=kot(r[f]),s=s.concat(l.positions),l.times.length>0?(a=a.concat(l.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let f=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,TO);o.billboard=w0e(f),o.position=u,i.clampToGround&&(o.billboard.heightReference=ze.CLAMP_TO_GROUND),o.availability=new Yr,o.availability.addInterval(new Zn({start:a[0],stop:a[a.length-1]}))}o.polyline=P0e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function kot(e){let t={positions:[],times:[]},n=Cj(e,"trkpt",Zo.gpx),i;for(let o=0;o<n.length;o++){let r=Sj(n[o]);t.positions.push(r),i=Ql(n[o],"time",Zo.gpx),c(i)&&t.times.push(ee.fromIso8601(i))}return t}function Uot(e){let t=Tg(e,"metadata",Zo.gpx);if(c(t)){let n={name:Ql(t,"name",Zo.gpx),desc:Ql(t,"desc",Zo.gpx),author:Oot(t),copyright:Bot(t),link:F0e(t),time:Ql(t,"time",Zo.gpx),keywords:Ql(t,"keywords",Zo.gpx),bounds:Yot(t)};if(c(n.name)||c(n.desc)||c(n.author)||c(n.copyright)||c(n.link)||c(n.time)||c(n.keywords)||c(n.bounds))return n}}function Oot(e){let t=Tg(e,"author",Zo.gpx);if(c(t)){let n={name:Ql(t,"name",Zo.gpx),email:Dot(t),link:F0e(t)};if(c(n.name)||c(n.email)||c(n.link))return n}}function Dot(e){let t=Tg(e,"email",Zo.gpx);if(c(t)){let n=Ql(t,"id",Zo.gpx),i=Ql(t,"domain",Zo.gpx);return`${n}@${i}`}}function F0e(e){let t=Tg(e,"link",Zo.gpx);if(c(t)){let n={href:gv(t,"href"),text:Ql(t,"text",Zo.gpx),mimeType:Ql(t,"type",Zo.gpx)};if(c(n.href)||c(n.text)||c(n.mimeType))return n}}function Bot(e){let t=Tg(e,"copyright",Zo.gpx);if(c(t)){let n={author:gv(t,"author"),year:Ql(t,"year",Zo.gpx),license:Ql(t,"license",Zo.gpx)};if(c(n.author)||c(n.year)||c(n.license))return n}}function Yot(e){let t=Tg(e,"bounds",Zo.gpx);if(c(t)){let n={minLat:bv(t,"minlat",Zo.gpx),maxLat:bv(t,"maxlat",Zo.gpx),minLon:bv(t,"minlon",Zo.gpx),maxLon:bv(t,"maxlon",Zo.gpx)};if(c(n.minLat)||c(n.maxLat)||c(n.minLon)||c(n.maxLon))return n}}var X0e={wpt:v0e,rte:Mot,trk:Not};function Hot(e,t,n,i){let o=Object.keys(X0e),r=o.length;for(let s=0;s<r;s++){let a=o[s],l=X0e[a],d=t.childNodes,u=d.length;for(let f=0;f<u;f++){let p=d[f];p.localName===a&&Zo.gpx.indexOf(p.namespaceURI)!==-1&&l(e,p,n,i)}}}function I0e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=gv(o,"version"),s=gv(o,"creator"),a,l=Uot(o);c(l)&&(a=l.name),o.localName==="gpx"?Hot(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),f=u.start,p=u.stop,y=ee.equals(f,Ye.MINIMUM_VALUE),h=ee.equals(p,Ye.MAXIMUM_VALUE);if(!y||!h){let x;y&&(x=new Date,x.setHours(0,0,0,0),f=ee.fromDate(x)),h&&(x=new Date,x.setHours(24,0,0,0),p=ee.fromDate(x)),d=new Tf,d.startTime=f,d.stopTime=p,d.currentTime=ee.clone(f),d.clockRange=zr.LOOP_STOP,d.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,f)/60,1),31556900))}let g=!1;return e._name!==a&&(e._name=a,g=!0),e._creator!==s&&(e._creator=s,g=!0),zot(e._metadata,l)&&(e._metadata=l,g=!0),e._version!==r&&(e._version=r,g=!0),d!==e._clock&&(g=!0,e._clock=d),g&&e._changed.raiseEvent(e),Hr.setLoading(e,!1),e}function zot(e,t){return!c(e)&&!c(t)?!1:c(e)&&c(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 Kot(e,t,n,i){i=i??z.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Ge){n=Ge.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)r.push(s[l])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Fot(r).then(function(s){let a,l;try{a=W0e.parseFromString(s,"application/xml")}catch(d){l=d.toString()}if(c(l)||a.body||a.documentElement.tagName==="parsererror"){let d=c(l)?l:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new le(d)}return I0e(e,a,i)}):I0e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function AV(){this._changed=new ye,this._error=new ye,this._loading=new ye,this._clock=void 0,this._entityCollection=new Ks(this),this._entityCluster=new wd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new r0}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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}}});AV.prototype.update=function(e){return!0};AV.prototype.load=function(e,t){if(!c(e))throw new L("data is required.");t=t??z.EMPTY_OBJECT,Hr.setLoading(this,!0);let n=this._name,i=this;return Kot(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=ee.equals(s,Ye.MINIMUM_VALUE),d=ee.equals(a,Ye.MAXIMUM_VALUE);if(!l||!d){let f;l&&(f=new Date,f.setHours(0,0,0,0),s=ee.fromDate(f)),d&&(f=new Date,f.setHours(24,0,0,0),a=ee.fromDate(f)),o=new Tf,o.startTime=s,o.stopTime=a,o.currentTime=ee.clone(s),o.clockRange=zr.LOOP_STOP,o.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(ee.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),Hr.setLoading(i,!1),i}).catch(function(o){return Hr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var xv=AV;var oLi=_(T(),1);function Jot(e,t){this.position=e,this.headingPitchRoll=t}var _v=Jot;var YZi=_(T(),1);var Zv=_(cd(),1);var sLi=_(T(),1);function Qot(e,t){this.position=e,this.headingPitchRange=t}var Tv=Qot;var dLi=_(T(),1);function SO(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ye,this.tourEnd=new ye,this.entryStart=new ye,this.entryEnd=new ye,this._activeEntries=[]}SO.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};SO.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;M0e.call(this,e,t,function(i){n.playlistIndex=0,i||A0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};SO.prototype.stop=function(){A0e(this._activeEntries)};function A0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function M0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=jot.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 c(n)&&n(!1)}function jot(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++,M0e.call(this,e,t,n)}}var Sv=SO;var RLi=_(T(),1);var TLi=_(T(),1);var gLi=_(T(),1),Ai=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-Ai.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?Ai.Bounce.In(e*2)*.5:Ai.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}}}}),Cv=function(){return performance.now()},qot=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=Cv()),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}(),MV={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=MV.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=MV.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=MV.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=MV.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,l=o*a;return(2*t-2*n+r+s)*l+(-3*t+3*n-2*r-s)*a+r*o+t}}},N0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Lj=new qot,k0e=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=Ai.Linear.None,this._interpolationFunction=MV.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=N0e.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=Lj,Lj.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=Cv()),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],l=Array.isArray(a),d=l?"array":typeof a,u=!l&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var f=i[s];if(f.length===0)continue;for(var p=[a],y=0,h=f.length;y<h;y+=1){var g=this._handleRelativeValue(a,f[y]);if(isNaN(g)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(g)}u&&(i[s]=p)}if((d==="object"||l)&&a&&!u){n[s]=l?[]:{};var x=a;for(var S in x)n[s][S]=x[S];o[s]=l?[]:{};var f=i[s];if(!this._isDynamic){var V={};for(var S in f)V[S]=f[S];i[s]=f=V}this._setupProperties(x,n[s],f,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),l||(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=Cv()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Cv()),!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=Ai.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=MV.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=Cv()),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),l=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>l)return 1;var g=Math.trunc(s/a),x=s-g*a,S=Math.min(x/i._duration,1);return S===0&&s===i._duration?1:S},u=d(),f=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),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 y=0,h=this._chainedTweens.length;y<h;y++)this._chainedTweens[y].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],l=Array.isArray(t[r]),d=Array.isArray(a),u=!l&&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 uLi=N0e.nextId,Qh=Lj,mLi=Qh.getAll.bind(Qh),fLi=Qh.removeAll.bind(Qh),hLi=Qh.add.bind(Qh),pLi=Qh.remove.bind(Qh),bLi=Qh.update.bind(Qh);var $ot={LINEAR_NONE:Ai.Linear.None,QUADRATIC_IN:Ai.Quadratic.In,QUADRATIC_OUT:Ai.Quadratic.Out,QUADRATIC_IN_OUT:Ai.Quadratic.InOut,CUBIC_IN:Ai.Cubic.In,CUBIC_OUT:Ai.Cubic.Out,CUBIC_IN_OUT:Ai.Cubic.InOut,QUARTIC_IN:Ai.Quartic.In,QUARTIC_OUT:Ai.Quartic.Out,QUARTIC_IN_OUT:Ai.Quartic.InOut,QUINTIC_IN:Ai.Quintic.In,QUINTIC_OUT:Ai.Quintic.Out,QUINTIC_IN_OUT:Ai.Quintic.InOut,SINUSOIDAL_IN:Ai.Sinusoidal.In,SINUSOIDAL_OUT:Ai.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ai.Sinusoidal.InOut,EXPONENTIAL_IN:Ai.Exponential.In,EXPONENTIAL_OUT:Ai.Exponential.Out,EXPONENTIAL_IN_OUT:Ai.Exponential.InOut,CIRCULAR_IN:Ai.Circular.In,CIRCULAR_OUT:Ai.Circular.Out,CIRCULAR_IN_OUT:Ai.Circular.InOut,ELASTIC_IN:Ai.Elastic.In,ELASTIC_OUT:Ai.Elastic.Out,ELASTIC_IN_OUT:Ai.Elastic.InOut,BACK_IN:Ai.Back.In,BACK_OUT:Ai.Back.Out,BACK_IN_OUT:Ai.Back.InOut,BOUNCE_IN:Ai.Bounce.In,BOUNCE_OUT:Ai.Bounce.Out,BOUNCE_IN_OUT:Ai.Bounce.InOut},Jr=Object.freeze($ot);function CO(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}CO.prototype.play=function(e,t,n){if(this.activeCamera=t,c(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(c(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ue(this.view.position);t.flyToBoundingSphere(o,i)}};CO.prototype.stop=function(){c(this.activeCamera)&&this.activeCamera.cancelFlight(),c(this.activeCallback)&&this.activeCallback(!0)};CO.prototype.getCameraOptions=function(e){let t={duration:this.duration};return c(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Jr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),c(e)&&(t=St(t,e)),t};var Vv=CO;var XLi=_(T(),1);function Zj(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Zj.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Zj.prototype.stop=function(){clearTimeout(this.timeout),c(this.activeCallback)&&this.activeCallback(!0)};var Lv=Zj;var Q0e={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=ox(t),Q0e[t]}},wj;typeof DOMParser<"u"&&(wj=new DOMParser);var ert=new _O({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Sg=32,U0e=2414016,O0e=1,D0e=16093e3,B0e=.1,Y0e=[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"],H0e=["http://www.google.com/kml/ext/2.2"],trt=["http://www.w3.org/2005/Atom"],Pe={kml:Y0e,gx:H0e,atom:trt,kmlgx:Y0e.concat(H0e)},Pj={Document:sye,Folder:_rt,Placemark:Trt,NetworkLink:Xrt,GroundOverlay:Rrt,PhotoOverlay:lye,ScreenOverlay:Zrt,Tour:Crt};function jh(e){this._dataSource=e,this._deferred=Cl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(jh.prototype,{dataSource:{get:function(){return this._dataSource}}});jh.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};jh.prototype.addPromise=function(e){this._promises.push(e)};jh.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};jh.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Kd._getTimestamp()),this._process(e)};jh.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Kd._getTimestamp(),e._process(!0)},0)};jh.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]};jh.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};jh.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;c(i);){let o=Pj[i.localName];if(c(o)&&(Pe.kml.indexOf(i.namespaceURI)!==-1||Pe.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Kd._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function nrt(e){let t=e.slice(0,Math.min(4,e.size)),n=Cl(),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 irt(e){let t=Cl(),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 j0e(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&&(c(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return c(n)&&(e=n+i),e}function q0e(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 ort(e,t){return Promise.resolve(e.getData(new OU)).then(function(n){n=j0e(n),n=q0e(n),t.kml=wj.parseFromString(n,"application/xml")})}function Rj(e,t){let n=Q0e.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new kU(n))).then(function(i){t[e.filename]=i})}function Hd(e,t,n,i){let o=i.keys,r=new Zv.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let l=s[a],d=l.getAttribute(n);if(c(d)){let f=new Zv.default(d).absoluteTo(r).toString(),p=o.indexOf(f);if(p!==-1){let y=o[p];l.setAttribute(n,i[y]),t==="a"&&l.getAttribute("download")===null&&l.setAttribute("download",y)}}}}function zd(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),l=vj(a,i);c(l)&&s.setAttribute(n,l.url)}}function $0e(e,t,n){let i=Is(e,"id");i=c(i)&&i.length!==0?i:Hn(),c(n)&&(i=n+i);let o=t.getById(i);return c(o)&&(i=Hn(),c(n)&&(i=n+i)),o=t.add(new $o({id:i})),c(o.kml)||(o.addProperty("kml"),o.kml=new Prt),o}function Rv(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function RO(e,t){if(!c(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!c(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 VO(e,t){if(!c(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!c(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=RO(n[s],t);return o}function Cg(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Is(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Mi(e,t,n){if(!c(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 z0e(e,t,n){if(!c(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 Pf(e,t,n){if(!c(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=Mi(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function wn(e,t,n){let i=Mi(e,t,n);if(c(i))return i.textContent.trim()}function vf(e,t,n){let i=Mi(e,t,n);if(c(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function vj(e,t,n){if(!c(e))return;let i;if(c(n)){e=e.replace(/\\/g,"/");let o=n[e];if(c(o))i=new Ge({url:o});else{let r=new Zv.default(t.getUrlComponent()),s=new Zv.default(e);o=n[s.absoluteTo(r)],c(o)&&(i=new Ge({url:o}))}}return c(i)||(i=t.getDerivedResource({url:e})),i}var jl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Ij(e,t){if(!c(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?(jl.maximumRed=r,jl.red=void 0):(jl.maximumRed=void 0,jl.red=0),o>0?(jl.maximumGreen=o,jl.green=void 0):(jl.maximumGreen=void 0,jl.green=0),i>0?(jl.maximumBlue=i,jl.blue=void 0):(jl.maximumBlue=void 0,jl.blue=0),jl.alpha=n,Y.fromRandom(jl)):new Y(r,o,i,n)}function ET(e,t,n){let i=wn(e,t,n);if(c(i))return Ij(i,wn(e,"colorMode",n)==="random")}function rrt(e){let t=Mi(e,"TimeStamp",Pe.kmlgx),n=wn(t,"when",Pe.kmlgx);if(!c(t)||!c(n)||n.length===0)return;let i=ee.fromIso8601(n),o=new Yr;return o.addInterval(new Zn({start:i,stop:Ye.MAXIMUM_VALUE})),o}function srt(e){let t=Mi(e,"TimeSpan",Pe.kmlgx);if(!c(t))return;let n,i=Mi(t,"begin",Pe.kmlgx),o=c(i)?ee.fromIso8601(i.textContent):void 0,r=Mi(t,"end",Pe.kmlgx),s=c(r)?ee.fromIso8601(r.textContent):void 0;if(c(o)&&c(s)){if(ee.lessThan(s,o)){let a=o;o=s,s=a}n=new Yr,n.addInterval(new Zn({start:o,stop:s}))}else c(o)?(n=new Yr,n.addInterval(new Zn({start:o,stop:Ye.MAXIMUM_VALUE}))):c(s)&&(n=new Yr,n.addInterval(new Zn({start:Ye.MINIMUM_VALUE,stop:s})));return n}function eye(){let e=new cc;return e.width=Sg,e.height=Sg,e.scaleByDistance=new Nt(U0e,O0e,D0e,B0e),e.pixelOffsetScaleByDistance=new Nt(U0e,O0e,D0e,B0e),e}function Fj(){let e=new km;return e.outline=!0,e.outlineColor=Y.WHITE,e}function tye(){let e=new Nm;return e.translucencyByDistance=new Nt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function Aj(e,t,n,i,o){let r=wn(e,"href",Pe.kml);if(!c(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),l=ei(e,"x",Pe.gx)??0,d=ei(e,"y",Pe.gx)??0;l=Math.min(l/32,7),d=7-Math.min(d/32,7);let u=8*d+l;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=vj(r,n,i);if(o){let a=wn(e,"refreshMode",Pe.kml),l=wn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?ht(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(l==="onStop"||l==="onRegion")&&ht(`kml-refreshMode-${l}`,`KML - Unsupported Icon viewRefreshMode: ${l}`);let d=wn(e,"viewBoundScale",Pe.kml)??1,u=l==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",f=wn(e,"viewFormat",Pe.kml)??u,p=wn(e,"httpQuery",Pe.kml);c(f)&&s.setQueryParameters(ld(ZO(f))),c(p)&&s.setQueryParameters(ld(ZO(p)));let y=t._ellipsoid;return Nj(s,t.camera,t.canvas,d,t._lastCameraView.bbox,y),s}return s}function art(e,t,n,i,o){let r=ei(t,"scale",Pe.kml),s=ei(t,"heading",Pe.kml),a=ET(t,"color",Pe.kml),l=Mi(t,"Icon",Pe.kml),d=Aj(l,e,i,o,!1);c(l)&&!c(d)&&(d=!1);let u=ei(l,"x",Pe.gx),f=ei(l,"y",Pe.gx),p=ei(l,"w",Pe.gx),y=ei(l,"h",Pe.gx),h=Mi(t,"hotSpot",Pe.kml),g=Cg(h,"x"),x=Cg(h,"y"),S=Is(h,"xunits"),V=Is(h,"yunits"),Z=n.billboard;c(Z)||(Z=eye(),n.billboard=Z),Z.image=d,Z.scale=r,Z.color=a,(c(u)||c(f)||c(p)||c(y))&&(Z.imageSubRegion=new je(u,f,p,y)),c(s)&&s!==0&&(Z.rotation=w.toRadians(-s),Z.alignedAxis=m.UNIT_Z),r=r??1;let R,E;c(g)&&(S==="pixels"?R=-g*r:S==="insetPixels"?R=(g-Sg)*r:S==="fraction"&&(R=-g*Sg*r),R+=Sg*.5*r),c(x)&&(V==="pixels"?E=x*r:V==="insetPixels"?E=(-x+Sg)*r:V==="fraction"&&(E=x*Sg*r),E-=Sg*.5*r),(c(R)||c(E))&&(Z.pixelOffset=new D(R,E))}function LO(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")art(e,a,n,i,o);else if(a.localName==="LabelStyle"){let l=n.label;c(l)||(l=tye(),n.label=l),l.scale=ei(a,"scale",Pe.kml)??l.scale,l.fillColor=ET(a,"color",Pe.kml)??l.fillColor,l.text=n.name}else if(a.localName==="LineStyle"){let l=n.polyline;c(l)||(l=new uc,n.polyline=l),l.width=ei(a,"width",Pe.kml),l.material=ET(a,"color",Pe.kml),c(ET(a,"outerColor",Pe.gx))&&ht("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c(ei(a,"outerWidth",Pe.gx))&&ht("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c(ei(a,"physicalWidth",Pe.gx))&&ht("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(vf(a,"labelVisibility",Pe.gx))&&ht("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let l=n.polygon;c(l)||(l=Fj(),n.polygon=l),l.material=ET(a,"color",Pe.kml)??l.material,l.fill=vf(a,"fill",Pe.kml)??l.fill,l.outline=vf(a,"outline",Pe.kml)??l.outline}else if(a.localName==="BalloonStyle"){let l=Ij(wn(a,"bgColor",Pe.kml))??Y.WHITE,d=Ij(wn(a,"textColor",Pe.kml))??Y.BLACK,u=wn(a,"text",Pe.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:l,textColor:d,text:u}}else if(a.localName==="ListStyle"){let l=wn(a,"listItemType",Pe.kml);(l==="radioFolder"||l==="checkOffOnly")&&ht(`kml-listStyle-${l}`,`KML - Unsupported ListStyle with listItemType: ${l}`)}}}function crt(e,t,n,i,o){let r=new $o,s,a=-1,l=t.childNodes,d=l.length;for(let f=0;f<d;f++){let p=l[f];(p.localName==="Style"||p.localName==="StyleMap")&&(a=f)}if(a!==-1){let f=l[a];if(f.localName==="Style")LO(e,f,r,i,o);else{let p=Pf(f,"Pair",Pe.kml);for(let y=0;y<p.length;y++){let h=p[y],g=wn(h,"key",Pe.kml);if(g==="normal"){let x=wn(h,"styleUrl",Pe.kml);if(c(x))s=n.getById(x),c(s)||(s=n.getById(`#${x}`)),c(s)&&r.merge(s);else{let S=Mi(h,"Style",Pe.kml);LO(e,S,r,i,o)}}else ht(`kml-styleMap-${g}`,`KML - Unsupported StyleMap key: ${g}`)}}}let u=wn(t,"styleUrl",Pe.kml);if(c(u)){let f=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),y=p[0];f=`${i.getDerivedResource({url:y}).getUrlComponent()}#${p[1]}`}s=n.getById(f),c(s)||(s=n.getById(`#${f}`)),c(s)&&r.merge(s)}return r}function lrt(e,t,n){return t.fetchXML().then(function(i){return nye(e,i,n,t,!0)})}function nye(e,t,n,i,o,r){let s,a,l,d,u=z0e(t,"Style",Pe.kml);if(c(u)){let g=u.length;for(s=0;s<g;s++)d=u[s],a=Is(d,"id"),c(a)&&(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),c(n.getById(a))||(l=new $o({id:a}),n.add(l),LO(e,d,l,i,r)))}let f=z0e(t,"StyleMap",Pe.kml);if(c(f)){let g=f.length;for(s=0;s<g;s++){let x=f[s];if(a=Is(x,"id"),c(a)){let S=Pf(x,"Pair",Pe.kml);for(let V=0;V<S.length;V++){let Z=S[V],R=wn(Z,"key",Pe.kml);if(R==="normal"){if(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),!c(n.getById(a))){l=n.getOrCreateEntity(a);let E=wn(Z,"styleUrl",Pe.kml);if(c(E)){E[0]!=="#"&&(E=`#${E}`),o&&c(i)&&(E=i.getUrlComponent()+E);let I=n.getById(E);c(I)&&l.merge(I)}else d=Mi(Z,"Style",Pe.kml),LO(e,d,l,i,r)}}else ht(`kml-styleMap-${R}`,`KML - Unsupported StyleMap key: ${R}`)}}}}let p=[],y=t.getElementsByTagName("styleUrl"),h=y.length;for(s=0;s<h;s++){let g=y[s].textContent;if(g[0]!=="#"){let x=g.split("#");if(x.length===2){let S=x[0],V=i.getDerivedResource({url:S});p.push(lrt(e,V,n))}}}return p}function Mj(e,t,n){let i=new Yb(e,t.id,["position"]),o=new Mh(t.position);t.polyline=c(n.polyline)?n.polyline.clone():new uc,t.polyline.positions=new Bb([i,o])}function iye(e,t){return!c(e)&&!c(t)||e==="clampToGround"?ze.CLAMP_TO_GROUND:e==="relativeToGround"?ze.RELATIVE_TO_GROUND:e==="absolute"?ze.NONE:t==="clampToSeaFloor"?(ht("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),ze.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(ht("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),ze.RELATIVE_TO_GROUND):(c(e)?ht("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):ht("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),ze.CLAMP_TO_GROUND)}function drt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Mh(e))}function urt(e,t,n,i){if(!c(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function GO(e,t,n,i){let o=t.label;c(o)||(o=c(n.label)?n.label.clone():tye(),t.label=o),o.text=t.name;let r=t.billboard;c(r)||(r=c(n.billboard)?n.billboard.clone():eye(),t.billboard=r),c(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(Y.YELLOW,64);let s=1;c(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new D(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function oye(e,t){let n=e.path;c(n)||(n=new Op,n.leadTime=0,e.path=n);let i=t.polyline;c(i)&&(n.material=i.material,n.width=i.width)}function mrt(e,t,n,i,o){let r=wn(n,"coordinates",Pe.kml),s=wn(n,"altitudeMode",Pe.kml),a=wn(n,"altitudeMode",Pe.gx),l=vf(n,"extrude",Pe.kml),d=e._ellipsoid,u=RO(r,d);return i.position=u,GO(e,i,o,iye(s,a)),l&&Rv(s,a)&&Mj(t,i,o),!0}function K0e(e,t,n,i,o){let r=Mi(n,"coordinates",Pe.kml),s=wn(n,"altitudeMode",Pe.kml),a=wn(n,"altitudeMode",Pe.gx),l=vf(n,"extrude",Pe.kml),d=vf(n,"tessellate",Pe.kml),u=Rv(s,a),f=ei(n,"drawOrder",Pe.gx),p=e._ellipsoid,y=VO(r,p),h=o.polyline;if(u&&l){let g=new Dp;i.wall=g,g.positions=y;let x=o.polygon;c(x)&&(g.fill=x.fill,g.material=x.material),g.outline=!0,c(h)?(g.outlineColor=c(h.material)?h.material.color:Y.WHITE,g.outlineWidth=h.width):c(x)&&(g.outlineColor=c(x.material)?x.material.color:Y.WHITE)}else if(e._clampToGround&&!u&&d){let g=new uc;g.clampToGround=!0,i.polyline=g,g.positions=y,c(h)?(g.material=c(h.material)?h.material.color.getValue(Ye.MINIMUM_VALUE):Y.WHITE,g.width=h.width??1):(g.material=Y.WHITE,g.width=1),g.zIndex=f}else c(f)&&ht("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&ht("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),h=c(h)?h.clone():new uc,i.polyline=h,h.positions=urt(y,s,a,p),(!d||u)&&(h.arcType=Kt.NONE);return!0}function frt(e,t,n,i,o){let r=Mi(n,"outerBoundaryIs",Pe.kml),s=Mi(r,"LinearRing",Pe.kml),a=Mi(s,"coordinates",Pe.kml),l=e._ellipsoid,d=VO(a,l),u=vf(n,"extrude",Pe.kml),f=wn(n,"altitudeMode",Pe.kml),p=wn(n,"altitudeMode",Pe.gx),y=Rv(f,p),h=c(o.polygon)?o.polygon.clone():Fj(),g=o.polyline;if(c(g)&&(h.outlineColor=c(g.material)?g.material.color:Y.WHITE,h.outlineWidth=g.width),i.polygon=h,y?(h.perPositionHeight=!0,h.extrudedHeight=u?0:void 0):e._clampToGround||(h.height=0),c(d)){let x=new Fa(d),S=Pf(n,"innerBoundaryIs",Pe.kml);for(let V=0;V<S.length;V++){s=Pf(S[V],"LinearRing",Pe.kml);for(let Z=0;Z<s.length;Z++)a=Mi(s[Z],"coordinates",Pe.kml),d=VO(a,l),c(d)&&x.holes.push(new Fa(d))}h.hierarchy=x}return!0}function hrt(e,t,n,i,o){let r=wn(n,"altitudeMode",Pe.kml),s=wn(n,"altitudeMode",Pe.gx),a=Pf(n,"coord",Pe.gx),l=Pf(n,"angles",Pe.gx),d=Pf(n,"when",Pe.kml),u=vf(n,"extrude",Pe.kml),f=Rv(r,s),p=e._ellipsoid;l.length>0&&ht("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let y=Math.min(a.length,d.length),h=[],g=[];for(let S=0;S<y;S++){let V=RO(a[S].textContent,p);h.push(V),g.push(ee.fromIso8601(d[S].textContent))}let x=new xa;return x.addSamples(g,h),i.position=x,GO(e,i,o,iye(r,s)),oye(i,o),i.availability=new Yr,d.length>0&&i.availability.addInterval(new Zn({start:g[0],stop:g[g.length-1]})),f&&u&&Mj(t,i,o),!0}function J0e(e,t,n,i,o,r,s,a,l){let d=e[0],u=e[e.length-1],f=new xa;f.addSamples(e,t),n.intervals.addInterval(new Zn({start:d,stop:u,isStartIncluded:l,isStopIncluded:l,data:drt(f,s,a)})),i.addInterval(new Zn({start:d,stop:u,isStartIncluded:l,isStopIncluded:l})),o.intervals.addInterval(new Zn({start:d,stop:u,isStartIncluded:l,isStopIncluded:l,data:r}))}function prt(e,t,n,i,o){let r=vf(n,"interpolate",Pe.gx),s=Pf(n,"Track",Pe.gx),a,l,d,u=!1,f=new zb,p=new Yr,y=new ya,h=e._ellipsoid;for(let g=0,x=s.length;g<x;g++){let S=s[g],V=Pf(S,"when",Pe.kml),Z=Pf(S,"coord",Pe.gx),R=wn(S,"altitudeMode",Pe.kml),E=wn(S,"altitudeMode",Pe.gx),I=Rv(R,E),v=vf(S,"extrude",Pe.kml),P=Math.min(Z.length,V.length),F=[];a=[];for(let N=0;N<P;N++){let b=RO(Z[N].textContent,h);F.push(b),a.push(ee.fromIso8601(V[N].textContent))}r&&(c(l)&&J0e([l,a[0]],[d,F[0]],y,p,f,!1,"absolute",void 0,!1),l=a[P-1],d=F[F.length-1]),J0e(a,F,y,p,f,I&&v,R,E,!0),u=u||I&&v}return i.availability=p,i.position=y,GO(e,i,o),oye(i,o),u&&(Mj(t,i,o),i.polyline.show=f),!0}var rye={Point:mrt,LineString:K0e,LinearRing:K0e,Polygon:frt,Track:hrt,MultiTrack:prt,MultiGeometry:brt,Model:yrt};function brt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let l=0,d=s.length;l<d;l++){let u=s.item(l),f=rye[u.localName];if(c(f)){let p=$0e(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,f(e,t,u,p,o)&&(a=!0)}}return a}function yrt(e,t,n,i,o){return ht("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function grt(e,t){let n=Mi(e,"ExtendedData",Pe.kml);if(!c(n))return;c(Mi(n,"SchemaData",Pe.kml))&&ht("kml-schemaData","KML - SchemaData is unsupported"),c(Is(n,"xmlns:prefix"))&&ht("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Pf(n,"Data",Pe.kml);if(c(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],l=Is(a,"name");c(l)&&(i[l]={displayName:wn(a,"displayName",Pe.kml),value:wn(a,"value",Pe.kml)})}}t.kml.extendedData=i}var po;typeof document<"u"&&(po=document.createElement("div"));function xrt(e,t,n,i,o){let r,s,a,l=t.kml,d=l.extendedData,u=wn(e,"description",Pe.kml),f=t.balloonStyle??n.balloonStyle,p=Y.WHITE,y=Y.BLACK,h=u;c(f)&&(p=f.bgColor??Y.WHITE,y=f.textColor??Y.BLACK,h=f.text??u);let g;if(c(h)){if(h=h.replace("$[name]",t.name??""),h=h.replace("$[description]",u??""),h=h.replace("$[address]",l.address??""),h=h.replace("$[Snippet]",l.snippet??""),h=h.replace("$[id]",t.id),h=h.replace("$[geDirections]",""),c(d)){let V=h.match(/\$\[.+?\]/g);if(V!==null)for(r=0;r<V.length;r++){let Z=V[r],R=Z.substr(2,Z.length-3),E=/\/displayName$/.test(R);R=R.replace(/\/displayName$/,""),g=d[R],c(g)&&(g=E?g.displayName:g.value),c(g)&&(h=h.replace(Z,g??""))}}}else if(c(d)&&(a=Object.keys(d),a.length>0)){for(h='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],g=d[s],h+=`<tr><th>${g.displayName??s}</th><td>${g.value??""}</td></tr>`;h+="</tbody></table>"}if(!c(h))return;h=ert.link(h),po.innerHTML=h;let x=po.querySelectorAll("a");for(r=0;r<x.length;r++)x[r].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(Hd(po,"a","href",i),Hd(po,"link","href",i),Hd(po,"area","href",i),Hd(po,"img","src",i),Hd(po,"iframe","src",i),Hd(po,"video","src",i),Hd(po,"audio","src",i),Hd(po,"source","src",i),Hd(po,"track","src",i),Hd(po,"input","src",i),Hd(po,"embed","src",i),Hd(po,"script","src",i),Hd(po,"video","poster",i)),zd(po,"a","href",o),zd(po,"link","href",o),zd(po,"area","href",o),zd(po,"img","src",o),zd(po,"iframe","src",o),zd(po,"video","src",o),zd(po,"audio","src",o),zd(po,"source","src",o),zd(po,"track","src",o),zd(po,"input","src",o),zd(po,"embed","src",o),zd(po,"script","src",o),zd(po,"video","poster",o);let S='<div class="cesium-infoBox-description-lighter" style="';S+="overflow:auto;",S+="word-wrap:break-word;",S+=`background-color:${p.toCssColorString()};`,S+=`color:${y.toCssColorString()};`,S+='">',S+=`${po.innerHTML}</div>`,po.innerHTML="",t.description=S}function EO(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=$0e(t,i,n.context),l=a.kml,d=crt(e,t,n.styleCollection,r,s),u=wn(t,"name",Pe.kml);a.name=u,a.parent=o;let f=srt(t);c(f)||(f=rrt(t)),a.availability=f,Uj(a);function p(Z){return Z?Z.show&&p(Z.parent):!0}let y=vf(t,"visibility",Pe.kml);a.show=p(o)&&(y??!0);let h=Mi(t,"author",Pe.atom),g=l.author;g.name=wn(h,"name",Pe.atom),g.uri=wn(h,"uri",Pe.atom),g.email=wn(h,"email",Pe.atom);let x=Mi(t,"link",Pe.atom),S=l.link;S.href=Is(x,"href"),S.hreflang=Is(x,"hreflang"),S.rel=Is(x,"rel"),S.type=Is(x,"type"),S.title=Is(x,"title"),S.length=Is(x,"length"),l.address=wn(t,"address",Pe.kml),l.phoneNumber=wn(t,"phoneNumber",Pe.kml),l.snippet=wn(t,"Snippet",Pe.kml),grt(t,a),xrt(t,a,d,s,r);let V=e._ellipsoid;return cye(t,a,V),aye(t,a,V),c(Mi(t,"Region",Pe.kml))&&ht("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function sye(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function _rt(e,t,n,i){let o=EO(e,t,n),r=He(n);r.parentEntity=o.entity,sye(e,t,r,i)}function Trt(e,t,n,i){let o=EO(e,t,n),r=o.entity,s=o.styleEntity,a=!1,l=t.childNodes;for(let d=0,u=l.length;d<u&&!a;d++){let f=l.item(d),p=rye[f.localName];c(p)&&(p(e,n.entityCollection,f,r,s,r.id),a=!0)}a||(r.merge(s),GO(e,r,s))}var Srt={FlyTo:Lrt,Wait:Vrt,SoundCue:Gj,AnimatedUpdate:Gj,TourControl:Gj};function Crt(e,t,n,i){let o=wn(t,"name",Pe.kml),r=Is(t,"id"),s=new Sv(o,r),a=Mi(t,"Playlist",Pe.gx);if(a){let l=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let f=d[u];if(f.localName){let p=Srt[f.localName];p?p(s,f,l):console.log(`Unknown KML Tour playlist entry type ${f.localName}`)}}}e._kmlTours.push(s)}function Gj(e,t){ht(`KML Tour unsupported node ${t.localName}`)}function Vrt(e,t){let n=ei(t,"duration",Pe.gx);e.addPlaylistEntry(new Lv(n))}function Lrt(e,t,n){let i=ei(t,"duration",Pe.gx),o=wn(t,"flyToMode",Pe.gx),r={kml:{}};cye(t,r,n),aye(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new Vv(i,o,s);e.addPlaylistEntry(a)}function aye(e,t,n){let i=Mi(e,"Camera",Pe.kml);if(c(i)){let o=ei(i,"longitude",Pe.kml)??0,r=ei(i,"latitude",Pe.kml)??0,s=ei(i,"altitude",Pe.kml)??0,a=ei(i,"heading",Pe.kml)??0,l=ei(i,"tilt",Pe.kml)??0,d=ei(i,"roll",Pe.kml)??0,u=m.fromDegrees(o,r,s,n),f=Ea.fromDegrees(a,l-90,d);t.kml.camera=new _v(u,f)}}function cye(e,t,n){let i=Mi(e,"LookAt",Pe.kml);if(c(i)){let o=ei(i,"longitude",Pe.kml)??0,r=ei(i,"latitude",Pe.kml)??0,s=ei(i,"altitude",Pe.kml)??0,a=ei(i,"heading",Pe.kml),l=ei(i,"tilt",Pe.kml),d=ei(i,"range",Pe.kml)??0;l=w.toRadians(l??0),a=w.toRadians(a??0);let u=new rm(a,l-w.PI_OVER_TWO,d),f=m.fromDegrees(o,r,s,n);t.kml.lookAt=new Tv(f,u)}}function Zrt(e,t,n,i){let o=n.screenOverlayContainer;if(!c(o))return;let r=n.sourceResource,s=n.uriResolver,a=Mi(t,"Icon",Pe.kml),l=Aj(a,e,r,s,!1);if(!c(l))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=l.url,d.onload=function(){let u=["position: absolute"],f=Mi(t,"screenXY",Pe.kml),p=Mi(t,"overlayXY",Pe.kml),y=Mi(t,"size",Pe.kml),h,g,x,S,V,Z;c(y)&&(h=Cg(y,"x"),g=Cg(y,"y"),x=Is(y,"xunits"),S=Is(y,"yunits"),c(h)&&h!==-1&&h!==0&&(x==="fraction"?V=`width: ${Math.floor(h*100)}%`:x==="pixels"&&(V=`width: ${h}px`),u.push(V)),c(g)&&g!==-1&&g!==0&&(S==="fraction"?Z=`height: ${Math.floor(g*100)}%`:S==="pixels"&&(Z=`height: ${g}px`),u.push(Z))),d.style=u.join(";");let R=0,E=d.height;c(p)&&(h=Cg(p,"x"),g=Cg(p,"y"),x=Is(p,"xunits"),S=Is(p,"yunits"),c(h)&&(x==="fraction"?R=h*d.width:(x==="pixels"||x==="insetPixels")&&(R=h)),c(g)&&(S==="fraction"?E=g*d.height:(S==="pixels"||S==="insetPixels")&&(E=g))),c(f)&&(h=Cg(f,"x"),g=Cg(f,"y"),x=Is(f,"xunits"),S=Is(f,"yunits"),c(h)&&(x==="fraction"?V=`left: calc(${Math.floor(h*100)}% - ${R}px)`:x==="pixels"?V=`left: ${h-R}px`:x==="insetPixels"&&(V=`right: ${h-R}px`),u.push(V)),c(g)&&(S==="fraction"?Z=`bottom: calc(${Math.floor(g*100)}% - ${E}px)`:S==="pixels"?Z=`bottom: ${g-E}px`:S==="insetPixels"&&(Z=`top: ${g-E}px`),u.push(Z))),d.style=u.join(";")},o.appendChild(d)}function Rrt(e,t,n,i){let r=EO(e,t,n).entity,s,a=!1,l=e._ellipsoid,d=VO(Mi(t,"LatLonQuad",Pe.gx),l),u=ei(t,"drawOrder",Pe.kml);if(c(d))s=Fj(),s.hierarchy=new Fa(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Um,s.zIndex=u,r.rectangle=s;let h=Mi(t,"LatLonBox",Pe.kml);if(c(h)){let g=ei(h,"west",Pe.kml),x=ei(h,"south",Pe.kml),S=ei(h,"east",Pe.kml),V=ei(h,"north",Pe.kml);c(g)&&(g=w.negativePiToPi(w.toRadians(g))),c(x)&&(x=w.clampToLatitudeRange(w.toRadians(x))),c(S)&&(S=w.negativePiToPi(w.toRadians(S))),c(V)&&(V=w.clampToLatitudeRange(w.toRadians(V))),s.coordinates=new de(g,x,S,V);let Z=ei(h,"rotation",Pe.kml);if(c(Z)){let R=w.toRadians(Z);s.rotation=R,s.stRotation=R}}}let f=Mi(t,"Icon",Pe.kml),p=Aj(f,e,n.sourceResource,n.uriResolver,!0);if(c(p)){a&&ht("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let h=ei(f,"x",Pe.gx),g=ei(f,"y",Pe.gx),x=ei(f,"w",Pe.gx),S=ei(f,"h",Pe.gx);(c(h)||c(g)||c(x)||c(S))&&ht("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=ET(t,"color",Pe.kml),s.material.transparent=!0}else s.material=ET(t,"color",Pe.kml);let y=wn(t,"altitudeMode",Pe.kml);c(y)?y==="absolute"?(s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):y!=="clampToGround"&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`):(y=wn(t,"altitudeMode",Pe.gx),y==="relativeToSeaFloor"?(ht("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):y==="clampToSeaFloor"?ht("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(y)&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`))}function lye(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),ht(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Vg={INTERVAL:0,EXPIRE:1,STOP:2};function ZO(e){if(!c(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Grt=new de,NV=new pe,Ej=new D,Ert=new m;function Nj(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 l=ax(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??Grt,c(n)&&(Ej.x=n.clientWidth*.5,Ej.y=n.clientHeight*.5,d=t.pickEllipsoid(Ej,r,Ert)),c(d)?u=r.cartesianToCartographic(d,NV):(u=de.center(o,NV),d=r.cartographicToCartesian(u)),c(i)&&!w.equalsEpsilon(i,1,w.EPSILON9)){let S=o.width*i*.5,V=o.height*i*.5;o=new de(a(u.longitude-S),s(u.latitude-V),a(u.longitude+S),s(u.latitude+V))}l=l.replace("[bboxWest]",w.toDegrees(o.west).toString()),l=l.replace("[bboxSouth]",w.toDegrees(o.south).toString()),l=l.replace("[bboxEast]",w.toDegrees(o.east).toString()),l=l.replace("[bboxNorth]",w.toDegrees(o.north).toString());let f=w.toDegrees(u.longitude).toString(),p=w.toDegrees(u.latitude).toString();l=l.replace("[lookatLon]",f),l=l.replace("[lookatLat]",p),l=l.replace("[lookatTilt]",w.toDegrees(t.pitch).toString()),l=l.replace("[lookatHeading]",w.toDegrees(t.heading).toString()),l=l.replace("[lookatRange]",m.distance(t.positionWC,d)),l=l.replace("[lookatTerrainLon]",f),l=l.replace("[lookatTerrainLat]",p),l=l.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,NV),l=l.replace("[cameraLon]",w.toDegrees(NV.longitude).toString()),l=l.replace("[cameraLat]",w.toDegrees(NV.latitude).toString()),l=l.replace("[cameraAlt]",w.toDegrees(NV.height).toString());let y=t.frustum,h=y.aspectRatio,g="",x="";if(c(h)){let S=w.toDegrees(y.fov);h>1?(g=S,x=S/h):(x=S,g=S*h)}l=l.replace("[horizFov]",g.toString()),l=l.replace("[vertFov]",x.toString())}else l=l.replace("[bboxWest]","-180"),l=l.replace("[bboxSouth]","-90"),l=l.replace("[bboxEast]","180"),l=l.replace("[bboxNorth]","90"),l=l.replace("[lookatLon]",""),l=l.replace("[lookatLat]",""),l=l.replace("[lookatRange]",""),l=l.replace("[lookatTilt]",""),l=l.replace("[lookatHeading]",""),l=l.replace("[lookatTerrainLon]",""),l=l.replace("[lookatTerrainLat]",""),l=l.replace("[lookatTerrainAlt]",""),l=l.replace("[cameraLon]",""),l=l.replace("[cameraLat]",""),l=l.replace("[cameraAlt]",""),l=l.replace("[horizFov]",""),l=l.replace("[vertFov]","");c(n)?(l=l.replace("[horizPixels]",n.clientWidth),l=l.replace("[vertPixels]",n.clientHeight)):(l=l.replace("[horizPixels]",""),l=l.replace("[vertPixels]","")),l=l.replace("[terrainEnabled]","1"),l=l.replace("[clientVersion]","1"),l=l.replace("[kmlVersion]","2.2"),l=l.replace("[clientName]","Cesium"),l=l.replace("[language]","English"),e.setQueryParameters(ld(l))}function Xrt(e,t,n,i){let r=EO(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,l=Mi(t,"Link",Pe.kml);if(c(l)||(l=Mi(t,"Url",Pe.kml)),c(l)){let d=wn(l,"href",Pe.kml),u,f;if(c(d)){let p=d;if(d=vj(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(l,"viewRefreshMode",Pe.kml),u==="onRegion"){ht("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}f=wn(l,"viewBoundScale",Pe.kml)??1;let x=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=wn(l,"viewFormat",Pe.kml)??x,V=wn(l,"httpQuery",Pe.kml);c(S)&&d.setQueryParameters(ld(ZO(S))),c(V)&&d.setQueryParameters(ld(ZO(V)));let Z=e._ellipsoid;Nj(d,e.camera,e.canvas,f,e._lastCameraView.bbox,Z)}let y={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},h=new Ks,g=kj(e,h,d,y).then(function(x){let S=e._entityCollection,V=h.values;S.suspendEvents();for(let E=0;E<V.length;E++){let I=V[E];c(I.parent)||(I.parent=r,Uj(I)),S.add(I)}S.resumeEvents();let Z=wn(l,"refreshMode",Pe.kml),R=ei(l,"refreshInterval",Pe.kml)??0;if(Z==="onInterval"&&R>0||Z==="onExpire"||u==="onStop"){let E=Mi(x,"NetworkLinkControl",Pe.kml),I=c(E),v=ee.now(),P={id:Hn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:f,needsUpdate:!1,cameraUpdateTime:v},F=0;if(I&&(P.cookie=ld(wn(E,"cookie",Pe.kml)??""),F=ei(E,"minRefreshPeriod",Pe.kml)??0),Z==="onInterval")I&&(R=Math.max(F,R)),P.refreshMode=Vg.INTERVAL,P.time=R;else if(Z==="onExpire"){let N;if(I&&(N=wn(E,"expires",Pe.kml)),c(N))try{let b=ee.fromIso8601(N),G=ee.secondsDifference(b,v);G>0&&G<F&&ee.addSeconds(v,F,b),P.refreshMode=Vg.EXPIRE,P.time=b}catch{ht("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else ht("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else c(e.camera)?(P.refreshMode=Vg.STOP,P.time=ei(l,"viewRefreshTime",Pe.kml)??0):ht("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");c(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(x){ht(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,x)});i.addPromise(g)}}}function Irt(e,t,n,i){let o=Pj[t.localName];return c(o)?o(e,t,n,i):lye(e,t,n,i)}function Wj(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,l=a.localName==="Document"?a:Mi(a,"Document",Pe.kml),d=wn(l,"name",Pe.kml);c(d)||(d=Ob(i.getUrlComponent())),c(e._name)||(e._name=d);let u=new Kd._DeferredLoading(e),f=new Ks(e);return Promise.all(nye(e,n,f,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let h=p.childNodes;for(let g=0;g<h.length;g++){let x=h[g];if(c(Pj[x.localName])){p=x;break}}}let y={parentEntity:void 0,entityCollection:t,styleCollection:f,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Irt(e,p,y,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function Wrt(e,t,n,i,o){let r=on("ThirdParty/Workers/z-worker-pako.js");GV({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new nO(new o0(n));return Promise.resolve(s.getEntries()).then(function(a){let l=[],d={},u;for(let f=0;f<a.length;f++){let p=a[f];p.directory||(/\.kml$/i.test(p.filename)&&(!c(u)||!/\//i.test(p.filename))?(c(u)&&l.push(Rj(u,d)),u=p):l.push(Rj(p,d)))}return c(u)&&l.push(ort(u,d)),Promise.all(l).then(function(){if(s.close(),!c(d.kml))throw new le("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),Wj(e,t,d.kml,i,d,o)})})}function kj(e,t,n,i){i=i??z.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,l=n;if(typeof n=="string"||n instanceof Ge){n=Ge.createIfNeeded(n),l=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(c(u)){let f=u.length;for(let p=0;p<f;p++)d.push(u[p])}}else o=o??Ge.DEFAULT.clone();return o=Ge.createIfNeeded(o),c(a)&&(a=Wn(a)),Promise.resolve(l).then(function(d){return d instanceof Blob?nrt(d).then(function(u){return u?Wrt(e,t,d,o,a):irt(d).then(function(f){f=j0e(f),f=q0e(f);let p,y;try{p=wj.parseFromString(f,"application/xml")}catch(h){y=h.toString()}if(c(y)||p.body||p.documentElement.tagName==="parsererror"){let h=c(y)?y:p.documentElement.firstChild.nodeValue;throw h||(h=p.body.innerText),new le(h)}return Wj(e,t,p,o,r,a,s)})}):Wj(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function Kd(e){e=e??z.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new ye,this._error=new ye,this._loading=new ye,this._refresh=new ye,this._unsupportedNode=new ye,this._clock=void 0,this._entityCollection=new Ks(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new r0,this._networkLinks=new Zt,this._entityCluster=new wd,this.canvas=n,this.camera=t,this._lastCameraView={position:c(t)?m.clone(t.positionWC):void 0,direction:c(t)?m.clone(t.directionWC):void 0,up:c(t)?m.clone(t.upWC):void 0,bbox:c(t)?t.computeViewRectangle():de.clone(de.MAX_VALUE)},this._ellipsoid=e.ellipsoid??re.default;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Kd.load=function(e,t){return t=t??z.EMPTY_OBJECT,new Kd(t).load(e,t)};Object.defineProperties(Kd.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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Kd.prototype.load=function(e,t){if(!c(e))throw new L("data is required.");t=t??z.EMPTY_OBJECT,Hr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return kj(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=ee.equals(s,Ye.MINIMUM_VALUE),d=ee.equals(a,Ye.MAXIMUM_VALUE);if(!l||!d){let f;l&&(f=new Date,f.setHours(0,0,0,0),s=ee.fromDate(f)),d&&(f=new Date,f.setHours(24,0,0,0),a=ee.fromDate(f)),o=new Tf,o.startTime=s,o.stopTime=a,o.currentTime=ee.clone(s),o.clockRange=zr.LOOP_STOP,o.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(ee.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),Hr.setLoading(i,!1),i}).catch(function(o){return Hr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Kd.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function Uj(e){let t=e.parent;if(c(t)){let n=t.availability;if(c(n)){let i=e.availability;c(i)?i.intersect(n):e.availability=n}}}function wrt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Mi(r,"NetworkLinkControl",Pe.kml),l=c(a),d=0;if(l){if(c(Mi(a,"Update",Pe.kml))){ht("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=ld(wn(a,"cookie",Pe.kml)??""),d=ei(a,"minRefreshPeriod",Pe.kml)??0}let u=ee.now(),f=t.refreshMode;if(f===Vg.INTERVAL)c(a)&&(t.time=Math.max(d,t.time));else if(f===Vg.EXPIRE){let v;if(c(a)&&(v=wn(a,"expires",Pe.kml)),c(v))try{let P=ee.fromIso8601(v),F=ee.secondsDifference(P,u);F>0&&F<d&&ee.addSeconds(u,d,P),t.time=P}catch{ht("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else ht("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,y=e._entityCollection,h=n.values;function g(v){y.remove(v);let P=v._children,F=P.length;for(let N=0;N<F;++N)g(P[N])}y.suspendEvents();let x=y.values.slice(),S;for(S=0;S<x.length;++S){let v=x[S];v.parent===p&&(v.parent=void 0,g(v))}for(y.resumeEvents(),y.suspendEvents(),S=0;S<h.length;S++){let v=h[S];c(v.parent)||(v.parent=p,Uj(v)),y.add(v)}y.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=y.computeAvailability(),Z=V.start,R=V.stop,E=ee.equals(Z,Ye.MINIMUM_VALUE),I=ee.equals(R,Ye.MAXIMUM_VALUE);if(!E||!I){let v=e._clock;(v.startTime!==Z||v.stopTime!==R)&&(v.startTime=Z,v.stopTime=R,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var Xj=new Zt;Kd.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;Xj.removeAll();function o(u){let f=u._children,p=f.length;for(let y=0;y<p;++y){let h=f[y];Xj.set(h.id,h),o(h)}}let r=!1,s=this._lastCameraView,a=this.camera;c(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 l=new Zt,d=!1;return t.values.forEach(function(u){let f=u.entity;if(!Xj.contains(f.id)){if(!u.updating){let p=!1;if(u.refreshMode===Vg.INTERVAL?ee.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===Vg.EXPIRE?ee.greaterThan(n,u.time)&&(p=!0):u.refreshMode===Vg.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&ee.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(f),u.updating=!0;let y=new Ks,h=u.href.clone();h.setQueryParameters(u.cookie);let g=i._ellipsoid??re.default;Nj(h,i.camera,i.canvas,u.viewBoundScale,s.bbox,g),kj(i,y,h,{context:f.id}).then(wrt(i,u,y,l,h)).catch(function(x){let S=`NetworkLink ${u.href} refresh failed: ${x}`;console.log(S),i._error.raiseEvent(i,S)}),d=!0}}l.set(u.id,u)}}),d&&(this._networkLinks=l,this._changed.raiseEvent(this)),!0};function Prt(){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}Kd._DeferredLoading=jh;Kd._getTimestamp=Ti;var XT=Kd;var KZi=_(T(),1);function Gv(){L.throwInstantiationError()}Gv.prototype.update=L.throwInstantiationError;Gv.prototype.getBoundingSphere=L.throwInstantiationError;Gv.prototype.isDestroyed=L.throwInstantiationError;Gv.prototype.destroy=L.throwInstantiationError;var Oj=Gv;var QZi=_(T(),1),kV=`#ifdef MRT +`;var aft=Ea.SHOW_INDEX,k$=Ea.POSITION_INDEX,fZe=Ea.COLOR_INDEX,cft=Ea.OUTLINE_COLOR_INDEX,lft=Ea.OUTLINE_WIDTH_INDEX,dft=Ea.PIXEL_SIZE_INDEX,pZe=Ea.SCALE_BY_DISTANCE_INDEX,bZe=Ea.TRANSLUCENCY_BY_DISTANCE_INDEX,gZe=Ea.DISTANCE_DISPLAY_CONDITION_INDEX,uft=Ea.DISABLE_DEPTH_DISTANCE_INDEX,mft=Ea.SPLIT_DIRECTION_INDEX,U$=Ea.NUMBER_OF_PROPERTIES,bl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ih(e){e=e??B.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(U$),this._maxPixelSize=1,this._baseVolume=new de,this._baseVolumeWC=new de,this._baseVolume2D=new de,this._boundingVolume=new de,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Yi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ih.prototype,{length:{get:function(){return D$(this),this._pointPrimitives.length}}});function yZe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ih.prototype.add=function(e){let t=new Ea(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ih.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ih.prototype.removeAll=function(){yZe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function D$(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}}ih.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ih.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};ih.prototype.get=function(e){return D$(this),this._pointPrimitives[e]};ih.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<U$;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function hft(e,t,n){return new Qb(e,[{index:bl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[k$]},{index:bl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[k$]},{index:bl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[fZe]},{index:bl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[bZe]},{index:bl.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[pZe]},{index:bl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[gZe]}],t)}var w$=new An,e3=new U;function xZe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(de.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),An.fromCartesian(r,w$);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[bl.positionHighAndSize],d=w$.high;c(o,d.x,d.y,d.z,s);let u=n[bl.positionLowAndOutline],m=w$.low;u(o,m.x,m.y,m.z,a)}var fft=256;function TZe(e,t,n,i){let o=i._index,r=i.color,s=i.outlineColor,a=i.getPickId(t).color;e3.red=r.alpha,e3.green=s.alpha,e3.blue=a.alpha;let c=n[bl.compressedAttribute0];c(o,dn.encodeRGB8(r),dn.encodeRGB8(s),dn.encodeRGB8(a),dn.encodeRGB8(e3))}function _Ze(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 m=(u?1:0)*fft+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,b=n[bl.compressedAttribute1];b(o,m,p,r,a)}function SZe(e,t,n,i){let o=i._index,r=n[bl.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 ZZe(e,t,n,i){let o=i._index,r=n[bl.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,m=i.splitDirection;l(m)&&(u=m),r(o,s,a,d,u)}function pft(e,t,n,i){xZe(e,t,n,i),TZe(e,t,n,i),_Ze(e,t,n,i),SZe(e,t,n,i),ZZe(e,t,n,i)}function M$(e,t,n,i,o,r){let s;i.mode===se.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,m=Ea._computeActualPosition(u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):de.expand(s,m,s))}r&&de.fromPoints(a,s)}function bft(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!P.equals(r,e.modelMatrix)?(e._mode=n,P.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&M$(e,i,i.length,t,r,!0)):n===se.MORPHING?M$(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&M$(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function gft(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var yft=[];ih.prototype.update=function(e){if(D$(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,bft(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 E=0;E<U$;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=hft(c,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let A=this._pointPrimitives[E];A._dirty=!1,pft(this,c,a,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=yft;E.length=0,(r[k$]||r[lft]||r[dft])&&E.push(xZe),(r[fZe]||r[cft])&&E.push(TZe),(r[aft]||r[bZe])&&E.push(_Ze),r[pZe]&&E.push(SZe),(r[gZe]||r[uft]||r[mft])&&E.push(ZZe);let A=E.length;if(a=this._vaf.writers,o/n>.1){for(let L=0;L<o;++L){let F=i[L];F._dirty=!1;for(let I=0;I<A;++I)E[I](this,c,a,F)}this._vaf.commit()}else{for(let L=0;L<o;++L){let F=i[L];F._dirty=!1;for(let I=0;I<A;++I)E[I](this,c,a,F);this._vaf.subCommit(F._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,de.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=P.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,m=de.clone(this._baseVolumeWC,this._boundingVolume)):m=de.clone(this._baseVolume2D,this._boundingVolume),gft(this,e,m);let b=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,b&&(this._blendOption===Yi.OPAQUE||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Yi.TRANSLUCENT||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:on.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,y;(b||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new Je({sources:[YN]}),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===Yi.OPAQUE_AND_TRANSLUCENT&&(y=new Je({defines:["OPAQUE"],sources:[Mx]}),this._sp=nn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl}),y=new Je({defines:["TRANSLUCENT"],sources:[Mx]}),this._spTranslucent=nn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._blendOption===Yi.OPAQUE&&(y=new Je({sources:[Mx]}),this._sp=nn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._blendOption===Yi.TRANSLUCENT&&(y=new Je({sources:[Mx]}),this._spTranslucent=nn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,S,Z,R,C=e.commandList;if(d.render||u){let E=this._colorCommands,A=this._blendOption===Yi.OPAQUE,L=this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,S=_.length,E.length=S;let F=L?S*2:S;for(R=0;R<F;++R){let I=A||L&&R%2===0;Z=E[R],l(Z)||(Z=E[R]=new lt),Z.primitiveType=Ie.POINTS,Z.pass=I||!L?Le.OPAQUE:Le.TRANSLUCENT,Z.owner=this;let N=L?Math.floor(R/2):R;Z.boundingVolume=m,Z.modelMatrix=p,Z.shaderProgram=I?this._sp:this._spTranslucent,Z.uniformMap=this._uniforms,Z.vertexArray=_[N].va,Z.renderState=I?this._rsOpaque:this._rsTranslucent,Z.debugShowBoundingVolume=this.debugShowBoundingVolume,Z.pickId="v_pickColor",C.push(Z)}}};ih.prototype.isDestroyed=function(){return!1};ih.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(),yZe(this._pointPrimitives),me(this)};var mV=ih;var iAi=x(T(),1),RZe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],O$=1,wN=8,as=new Uint32Array(96),kN=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");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!==O$)throw new Error(`Got v${o} data when expected v${O$}.`);let r=RZe[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,void 0,t)}constructor(t,n=64,i=Float64Array,o=ArrayBuffer,r){if(isNaN(t)||t<0)throw new Error(`Unexpected 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 s=RZe.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,d=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(r)this.data=r,this.ids=new this.IndexArrayType(r,wN,t),this.coords=new i(r,wN+c+d,t*2),this._pos=t*2,this._finished=!0;else{let u=this.data=new o(wN+a+c+d);this.ids=new this.IndexArrayType(u,wN,t),this.coords=new i(u,wN+c+d,t*2),this._pos=0,this._finished=!1,new Uint8Array(u,0,2).set([219,(O$<<4)+s]),new Uint16Array(u,2,1)[0]=n,new Uint32Array(u,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 z$(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;as[0]=0,as[1]=r.length-1,as[2]=0;let c=3,d=[];for(;c>0;){let u=as[--c],m=as[--c],p=as[--c];if(m-p<=a){for(let _=p;_<=m;_++){let S=s[2*_],Z=s[2*_+1];S>=t&&S<=i&&Z>=n&&Z<=o&&d.push(r[_])}continue}let b=p+m>>1,f=s[2*b],y=s[2*b+1];f>=t&&f<=i&&y>=n&&y<=o&&d.push(r[b]),(u===0?t<=f:n<=y)&&(as[c++]=p,as[c++]=b-1,as[c++]=1-u),(u===0?i>=f:o>=y)&&(as[c++]=b+1,as[c++]=m,as[c++]=1-u)}return d}within(t,n,i){let o=[];return this.withinInto(t,n,i,o),o}withinInto(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;as[0]=0,as[1]=r.length-1,as[2]=0;let c=3,d=0,u=i*i;for(;c>0;){let m=as[--c],p=as[--c],b=as[--c];if(p-b<=a){for(let S=b;S<=p;S++)CZe(s[2*S],s[2*S+1],t,n)<=u&&(o[d++]=r[S]);continue}let f=b+p>>1,y=s[2*f],_=s[2*f+1];CZe(y,_,t,n)<=u&&(o[d++]=r[f]),(m===0?t-i<=y:n-i<=_)&&(as[c++]=b,as[c++]=f-1,as[c++]=1-m),(m===0?t+i>=y:n+i>=_)&&(as[c++]=f+1,as[c++]=p,as[c++]=1-m)}return d}};function z$(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;VZe(e,t,s,i,o,r),z$(e,t,n,i,s-1,1-r),z$(e,t,n,s+1,o,1-r)}function VZe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,m=Math.log(d),p=.5*Math.exp(2*m/3),b=.5*Math.sqrt(m*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+b)),y=Math.min(o,Math.floor(n+(d-u)*p/d+b));VZe(e,t,n,f,y,r)}let s=t[2*n+r],a=i,c=o;for(MN(e,t,i,n),t[2*o+r]>s&&MN(e,t,i,o);a<c;){for(MN(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?MN(e,t,i,c):(c++,MN(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function MN(e,t,n,i){B$(e,n,i),B$(t,2*n,2*i),B$(t,2*n+1,2*i+1)}function B$(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function CZe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Gf(e){e=e??B.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 Se,this.show=e.show??!0}function EZe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var xft=new nt;function AZe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Sx.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=wo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ea.getScreenSpaceBoundingBox(e,t,o)),EZe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&LZe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Sx.getScreenSpaceBoundingBox(s,t,xft);EZe(a,n),o=nt.union(o,a,o)}return o}function Tft(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&LZe(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 GZe(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 LZe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function H$(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===se.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 m=a.computeScreenSpacePosition(n);l(m)&&t.push({index:s,collection:e,clustered:!1,coord:m})}}var _ft=new nt,Sft=new nt,Zft=new nt;function Rft(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 Jp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new wu({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new mV;let d=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],b=e._previousHeight,f=n.camera.positionCartographic.height,y=n.ellipsoid,_=n.camera.positionWC,S=new Af(y,_),Z=[];e._clusterLabels&&H$(i,Z,n,S,e),e._clusterBillboards&&H$(o,Z,n,S,e),e._clusterPoints&&H$(r,Z,n,S,e);let R,C,E,A,L,F,I,N,g,V,G,v;if(Z.length>0){let X=new kN(Z.length,64,Float64Array);for(let Y=0;Y<Z.length;++Y)X.add(Z[Y].coord.x,Z[Y].coord.y);if(X.finish(),f<b)for(E=m.length,R=0;R<E;++R){let Y=m[R];if(!S.isPointVisible(Y.position))continue;let D=wo._computeScreenSpacePosition(P.IDENTITY,Y.position,h.ZERO,k.ZERO,n);if(!l(D))continue;let w=1-f/b,O=Y.width=Y.width*w,M=Y.height=Y.height*w;O=Math.max(O,Y.minimumWidth),M=Math.max(M,Y.minimumHeight);let z=D.x-O*.5,K=D.y-M*.5,te=D.x+O,H=D.y+M;for(L=X.range(z,K,te,H),F=L.length,V=0,g=[],C=0;C<F;++C)I=L[C],N=Z[I],N.clustered||(++V,G=N.collection,v=N.index,g.push(G.get(v).id));if(V>=u)for(GZe(Y.position,V,g,e),p.push(Y),C=0;C<F;++C)Z[L[C]].clustered=!0}for(E=Z.length,R=0;R<E;++R){let Y=Z[R];if(Y.clustered)continue;Y.clustered=!0,G=Y.collection,v=Y.index;let D=G.get(v);A=AZe(D,Y.coord,d,e,_ft);let w=nt.clone(A,Sft);L=X.range(A.x,A.y,A.x+A.width,A.y+A.height),F=L.length;let O=h.clone(D.position);for(V=1,g=[D.id],C=0;C<F;++C)if(I=L[C],N=Z[I],!N.clustered){let M=N.collection.get(N.index),z=AZe(M,N.coord,d,e,Zft);h.add(M.position,O,O),nt.union(w,z,w),++V,g.push(M.id)}if(V>=u){let M=h.multiplyByScalar(O,1/V,O);for(GZe(M,V,g,e),p.push({position:M,width:w.width,height:w.height,minimumWidth:A.width,minimumHeight:A.height}),C=0;C<F;++C)Z[L[C]].clustered=!0}else Tft(D,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}}Gf.prototype._initialize=function(e){this._scene=e;let t=Rft(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Gf.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 J$(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 j$(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Gf.prototype.getLabel=J$("_labelCollection",Jp,"_unusedLabelIndices","labelIndex");Gf.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,j$(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};Gf.prototype.getBillboard=J$("_billboardCollection",wu,"_unusedBillboardIndices","billboardIndex");Gf.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,j$(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};Gf.prototype.getPoint=J$("_pointCollection",mV,"_unusedPointIndices","pointIndex");Gf.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,j$(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function K$(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Cft(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,K$(e._labelCollection),K$(e._billboardCollection),K$(e._pointCollection))}Gf.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,Cft(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)};Gf.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 Ou=Gf;function Q$(e){this._name=e,this._clock=void 0,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._entityCollection=new za(this),this._entityCluster=new Ou}Object.defineProperties(Q$.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){Es.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}}});Q$.prototype.update=function(e){return!0};var UN=Q$;var LGi=x(T(),1);var HAi=x(T(),1);var LAi=x(T(),1);var WZe={};WZe.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,m=0,p=0,b=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let y=u/i*W.TWO_PI,_=Math.cos(y),S=Math.sin(y),Z=_*n,R=S*n,C=_*t,E=S*t;d[p+b]=Z,d[p+b+1]=R,d[p+b+2]=s,d[p+f]=C,d[p+f+1]=E,d[p+f+2]=r,p+=3,o&&(d[m++]=Z,d[m++]=R,d[m++]=s,d[m++]=C,d[m++]=E,d[m++]=r)}return d};var BS=WZe;var q$=new k,Vft=new h,Eft=new h,Aft=new h,Gft=new h;function _g(e){e=e??B.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??we.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=we.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}_g.packedLength=we.packedLength+5;_g.pack=function(e,t,n){return n=n??0,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var vZe=new we,hV={vertexFormat:vZe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};_g.unpack=function(e,t,n){t=t??0;let i=we.unpack(e,t,vZe);t+=we.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=we.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(hV.length=o,hV.topRadius=r,hV.bottomRadius=s,hV.slices=a,hV.offsetAttribute=c===-1?void 0:c,new _g(hV))};_g.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=BS.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,m=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,b=o.bitangent?new Float32Array(c*3):void 0,f,y=o.normal||o.tangent||o.bitangent;if(y){let L=o.tangent||o.bitangent,F=0,I=0,N=0,g=Math.atan2(i-n,t),V=Vft;V.z=Math.sin(g);let G=Math.cos(g),v=Aft,X=Eft;for(f=0;f<r;f++){let Y=f/r*W.TWO_PI,D=G*Math.cos(Y),w=G*Math.sin(Y);y&&(V.x=D,V.y=w,L&&(v=h.normalize(h.cross(h.UNIT_Z,V,v),v)),o.normal&&(m[F++]=V.x,m[F++]=V.y,m[F++]=V.z,m[F++]=V.x,m[F++]=V.y,m[F++]=V.z),o.tangent&&(p[I++]=v.x,p[I++]=v.y,p[I++]=v.z,p[I++]=v.x,p[I++]=v.y,p[I++]=v.z),o.bitangent&&(X=h.normalize(h.cross(V,v,X),X),b[N++]=X.x,b[N++]=X.y,b[N++]=X.z,b[N++]=X.x,b[N++]=X.y,b[N++]=X.z))}for(f=0;f<r;f++)o.normal&&(m[F++]=0,m[F++]=0,m[F++]=-1),o.tangent&&(p[I++]=1,p[I++]=0,p[I++]=0),o.bitangent&&(b[N++]=0,b[N++]=-1,b[N++]=0);for(f=0;f<r;f++)o.normal&&(m[F++]=0,m[F++]=0,m[F++]=1),o.tangent&&(p[I++]=1,p[I++]=0,p[I++]=0),o.bitangent&&(b[N++]=0,b[N++]=1,b[N++]=0)}let _=12*r-12,S=Oe.createTypedArray(c,_),Z=0,R=0;for(f=0;f<r-1;f++)S[Z++]=R,S[Z++]=R+2,S[Z++]=R+3,S[Z++]=R,S[Z++]=R+3,S[Z++]=R+1,R+=2;for(S[Z++]=s-2,S[Z++]=0,S[Z++]=1,S[Z++]=s-2,S[Z++]=1,S[Z++]=s-1,f=1;f<r-1;f++)S[Z++]=s+f+1,S[Z++]=s+f,S[Z++]=s;for(f=1;f<r-1;f++)S[Z++]=a,S[Z++]=a+f,S[Z++]=a+f+1;let C=0;if(o.st){let L=Math.max(n,i);for(f=0;f<c;f++){let F=h.fromArray(d,f*3,Gft);u[C++]=(F.x+L)/(2*L),u[C++]=(F.y+L)/(2*L)}}let E=new Rn;o.position&&(E.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(E.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(E.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(E.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(E.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),q$.x=t*.5,q$.y=Math.max(i,n);let A=new de(h.ZERO,k.magnitude(q$));if(l(e._offsetAttribute)){t=d.length;let L=e._offsetAttribute===bn.NONE?0:1,F=new Uint8Array(t/3).fill(L);E.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return new At({attributes:E,indices:S,primitiveType:Ie.TRIANGLES,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var $$;_g.getUnitCylinder=function(){return l($$)||($$=_g.createGeometry(new _g({topRadius:1,bottomRadius:1,length:1,vertexFormat:we.POSITION_ONLY}))),$$};var DN=_g;var cGi=x(T(),1);var eee=new k;function fV(e){e=e??B.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(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"}fV.packedLength=6;fV.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var zS={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};fV.unpack=function(e,t,n){t=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):(zS.length=i,zS.topRadius=o,zS.bottomRadius=r,zS.slices=s,zS.numberOfVerticalLines=a,zS.offsetAttribute=c===-1?void 0:c,new fV(zS))};fV.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=BS.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let y=Math.min(r,o);d=Math.round(o/y),c+=y}let u=Oe.createTypedArray(s,c*2),m=0,p;for(p=0;p<o-1;p++)u[m++]=p,u[m++]=p+1,u[m++]=p+o,u[m++]=p+1+o;if(u[m++]=o-1,u[m++]=0,u[m++]=o+o-1,u[m++]=o,r>0)for(p=0;p<o;p+=d)u[m++]=p,u[m++]=p+o;let b=new Rn;b.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:a}),eee.x=t*.5,eee.y=Math.max(i,n);let f=new de(h.ZERO,k.magnitude(eee));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===bn.NONE?0:1,_=new Uint8Array(t/3).fill(y);b.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new At({attributes:b,indices:u,primitiveType:Ie.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var ON=fV;var FZe=h.ZERO,IZe=new h,Lft=new h,PZe=new U;function Wft(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 Bu(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new Wft(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Bu.prototype=Object.create(Wi.prototype),Bu.prototype.constructor=Bu);Object.defineProperties(Bu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Bu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Qn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,PZe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,FZe,IZe))),new Yt({id:t,geometry:new DN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Bu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,PZe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,FZe,IZe))),new Yt({id:t,geometry:new ON(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Bu.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Bu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Wi.prototype._isHidden.call(this,e,t)};Bu.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)};Bu.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(it.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(it.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(it.MINIMUM_VALUE),i.slices=j.getValueOrUndefined(t.slices,it.MINIMUM_VALUE),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,it.MINIMUM_VALUE),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};Bu.prototype._onEntityPropertyChanged=Tb;Bu.DynamicGeometryUpdater=pV;function pV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(pV.prototype=Object.create(Li.prototype),pV.prototype.constructor=pV);pV.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,Lft);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Li.prototype._isHidden.call(this,e,t,n)};pV.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,He.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!==He.NONE?bn.ALL:void 0};var BN=Bu;var FFi=x(T(),1);var vGi=x(T(),1),XZe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(XZe);var As=XZe;var IGi=x(T(),1),NZe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(NZe);var Oo=NZe;var XGi=x(T(),1),YZe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(YZe);var ad=YZe;var YGi=x(T(),1),wZe=x(bu(),1);function vft(e){let t=new wZe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Sg=vft;var UGi=x(T(),1);var Fft=W.factorial;function tee(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+=tee(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 Ift=[],nee=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c,d,u,m,p=n.length,b=new Array(o);for(s=0;s<o;s++){r[s]=0;let S=new Array(p);for(b[s]=S,a=0;a<p;a++)S[a]=[]}let f=p,y=new Array(f);for(s=0;s<f;s++)y[s]=s;let _=p-1;for(d=0;d<o;d++){for(a=0;a<f;a++)m=y[a]*o+d,b[d][0].push(i[m]);for(s=1;s<f;s++){let S=!1;for(a=0;a<f-s;a++){let Z=n[y[a]],R=n[y[a+s]],C;R-Z<=0?(m=y[a]*o+o*s+d,C=i[m],b[d][s].push(C/Fft(s))):(C=b[d][s-1][a+1]-b[d][s-1][a],b[d][s].push(C/(R-Z))),S=S||C!==0}S||(_=s-1)}}for(c=0,u=0;c<=u;c++)for(s=c;s<=_;s++){let S=tee(t,y,n,c,s,[]);for(d=0;d<o;d++){let Z=b[d][s][0];r[d+c*o]+=Z*S}}return r}static interpolate(t,n,i,o,r,s,a){let c=o*(s+1);l(a)||(a=new Array(c));for(let Z=0;Z<c;Z++)a[Z]=0;let d=n.length,u=new Array(d*(r+1)),m;for(m=0;m<d;m++)for(let Z=0;Z<r+1;Z++)u[m*(r+1)+Z]=m;let p=u.length,b=Ift,f=Pft(b,u,n,i,o,r),y=[],_=p*(p+1)/2,S=Math.min(f,s);for(let Z=0;Z<=S;Z++)for(m=Z;m<=f;m++){y.length=0;let R=tee(t,u,n,Z,m,y),C=Math.floor(m*(1-m)/2)+p*m;for(let E=0;E<o;E++){let A=Math.floor(E*_),L=b[A+C];a[E+Z*o]+=L*R}}return a}};function Pft(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let m=0;m<o;m++){let p=Math.floor(m*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+m,e[p+s]=i[a];for(let b=1;b<d;b++){let f=0,y=Math.floor(b*(1-b)/2)+d*b,_=!1;for(s=0;s<d-b;s++){let S=n[t[s]],Z=n[t[s+b]],R,C;if(Z-S<=0)a=t[s]*o*(r+1)+o*b+m,R=i[a],C=R/W.factorial(b),e[p+y+f]=C,f++;else{let E=Math.floor((b-1)*(2-b)/2)+d*(b-1);R=e[p+E+s+1]-e[p+E+s],C=R/(Z-S),e[p+y+f]=C,f++}_=_||R!==0}_&&(c=Math.max(c,b))}}return c}var zN=nee;var BGi=x(T(),1);var iee=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c=n.length;for(s=0;s<o;s++)r[s]=0;for(s=0;s<c;s++){let d=1;for(a=0;a<c;a++)if(a!==s){let u=n[s]-n[a];d*=(t-n[a])/u}for(a=0;a<o;a++)r[a]+=d*i[s*o+a]}return r}},HN=iee;var KGi=x(T(),1);var oee=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c,d=n[0],u=n[1];for(s=0;s<o;s++)a=i[s],c=i[s+o],r[s]=((c-a)*t+u*a-d*c)/(u-d);return r}},kx=oee;var QGi=x(T(),1);function gl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}gl.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new gl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};gl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new gl(e.clock,e.cone,e.magnitude)};gl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new gl(e.clock,e.cone,1)};gl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};gl.equalsEpsilon=function(e,t,n){return n=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};gl.prototype.equals=function(e){return gl.equals(this,e)};gl.prototype.clone=function(e){return gl.clone(this,e)};gl.prototype.equalsEpsilon=function(e,t){return gl.equalsEpsilon(this,e,t)};gl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var KN=gl;var $N=x(bu(),1);var pLi=x(T(),1);var cLi=x(T(),1);var $Gi=x(T(),1),ree;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?ree=function(){return performance.now()}:ree=function(){return Date.now()};var Zn=ree;function see(e){e=e??B.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=e.clockRange??As.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new Se,this.onStop=new Se,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Zn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Oo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(see.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===Oo.SYSTEM_CLOCK&&(this._clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Oo.SYSTEM_CLOCK&&(this._clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Oo.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===Oo.SYSTEM_CLOCK&&(this._clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});see.prototype.tick=function(){let e=Zn(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Oo.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===Oo.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===As.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===As.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 Lf=see;function HS(){this._definitionChanged=new Se,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(HS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:kl("startTime"),stopTime:kl("stopTime"),currentTime:kl("currentTime"),clockRange:kl("clockRange"),clockStep:kl("clockStep"),multiplier:kl("multiplier")});HS.prototype.clone=function(e){return l(e)||(e=new HS),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};HS.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};HS.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};HS.prototype.getValue=function(e){return l(e)||(e=new Lf),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Wf=HS;var CLi=x(T(),1);var Xft=U.WHITE,Nft=.1,Yft=new k(8,8),wft=new k(0,0),Mft=new k(1,1);function bV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(bV.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:be("color"),cellAlpha:be("cellAlpha"),lineCount:be("lineCount"),lineThickness:be("lineThickness"),lineOffset:be("lineOffset")});bV.prototype.getType=function(e){return"Grid"};var kft=new Q;bV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(kft)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,Xft,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,Nft),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,Yft,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,Mft,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,wft,t.lineOffset),t};bV.prototype.equals=function(e){return this===e||e instanceof bV&&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 gV=bV;var ELi=x(T(),1),MZe={WHOLE:0,PORTIONS:1};Object.freeze(MZe);var n0=MZe;var PLi=x(T(),1);function yV(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(yV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});yV.prototype.getType=function(e){return"PolylineArrow"};var Uft=new Q;yV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Uft)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};yV.prototype.equals=function(e){return this===e||e instanceof yV&&j.equals(this._color,e._color)};var xV=yV;var OLi=x(T(),1);var Dft=U.WHITE,Oft=U.TRANSPARENT,Bft=16,zft=255;function TV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(TV.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:be("color"),gapColor:be("gapColor"),dashLength:be("dashLength"),dashPattern:be("dashPattern")});TV.prototype.getType=function(e){return"PolylineDash"};var Hft=new Q;TV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Hft)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,Dft,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,Oft,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,Bft,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,zft,t.dashPattern),t};TV.prototype.equals=function(e){return this===e||e instanceof TV&&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 _V=TV;var $Li=x(T(),1);var Kft=U.WHITE,Jft=.25,jft=1;function SV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(SV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),glowPower:be("glowPower"),taperPower:be("taperPower")});SV.prototype.getType=function(e){return"PolylineGlow"};var Qft=new Q;SV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Qft)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,Kft,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,Jft,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,jft,t.taperPower),t};SV.prototype.equals=function(e){return this===e||e instanceof SV&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var ZV=SV;var cWi=x(T(),1);var qft=U.WHITE,$ft=U.BLACK,ept=1;function RV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(RV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._outlineColor)&&j.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth")});RV.prototype.getType=function(e){return"PolylineOutline"};var tpt=new Q;RV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(tpt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,qft,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,$ft,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,ept),t};RV.prototype.equals=function(e){return this===e||e instanceof RV&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var Ux=RV;var bWi=x(T(),1);function Zg(e,t){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Hr,this._referenceFrame=t??Oi.FIXED,this.setValue(e)}Object.defineProperties(Zg.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 npt=new Q;Zg.prototype.getValue=function(e,t){return l(e)||(e=Q.now(npt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Zg.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};Zg.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,Zg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Zg.prototype.equals=function(e){return this===e||e instanceof Zg&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};Zg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Rg=Zg;var ZWi=x(T(),1);function Dx(e){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Hr,this.setValue(e)}Object.defineProperties(Dx.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 ipt=new Q;Dx.prototype.getValue=function(e,t){l(e)||(e=Q.now(ipt));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};Dx.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,Dx.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Dx.prototype.equals=function(e){return this===e||e instanceof Dx&&j.arrayEquals(this._value,e._value)};Dx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var CV=Dx;var GWi=x(T(),1);function KS(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(zu.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 zu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Se,e.collectionChanged.addEventListener(zu.prototype._onCollectionChanged,this)}Object.defineProperties(zu.prototype,{isConstant:{get:function(){return j.isConstant(KS(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=KS(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 KS(this)}}});zu.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 zu(e,n,i)};var opt=new Q;zu.prototype.getValue=function(e,t){let n=KS(this);return l(e)||(e=Q.now(opt)),l(n)?n.getValue(e,t):void 0};zu.prototype.getValueInReferenceFrame=function(e,t,n){let i=KS(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};zu.prototype.getType=function(e){let t=KS(this);return l(t)?t.getType(e):void 0};zu.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};zu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};zu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(zu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=KS(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Cg=zu;var FWi=x(T(),1);var rpt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=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}},oh=rpt;var QWi=x(T(),1);var kWi=x(T(),1);var kZe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function UZe(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 DZe(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var aee=[],cee=[];function t3(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=DZe(i[r],e),c=Eo(t,u,Q.compare);let p=0,b=0;if(c<0){for(c=~c,d=c*o,a=void 0,m=t[c];r<i.length&&(u=DZe(i[r],e),!(l(a)&&Q.compare(a,u)>=0||l(m)&&Q.compare(u,m)>=0));){for(aee[p++]=u,r=r+1,s=0;s<o;s++)cee[b++]=i[r],r=r+1;a=u}p>0&&(cee.length=b,UZe(n,d,cee),aee.length=p,UZe(t,c,aee))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function rh(e,t){let n=e;n===Number&&(n=kZe);let i=n.packedLength,o=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=kZe);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=kx,this._lastInterpolationAlgorithm=kx,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 Se,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=ad.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ad.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(rh.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 spt=new Q;rh.prototype.getValue=function(e,t){l(e)||(e=Q.now(spt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Eo(n,e,Q.compare);var c=!1;if(a<0){if(a=~a,a===0){let A=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ad.NONE||o!==0&&Q.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===ad.HOLD)return r.unpack(s,0,t);c=this._backwardExtrapolationType===ad.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ad.NONE||o!==0&&Q.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===ad.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);c=this._forwardExtrapolationType===ad.LINEAR_EXTRAPOLATE}let m=this._xTable,p=this._yTable;var d,u;c?(d=Cesium.LinearApproximation,u=1):(d=this._interpolationAlgorithm,u=this._interpolationDegree),this._lastInterpolationAlgorithm!=d&&(this._lastInterpolationAlgorithm=d,this._updateTableLength=!0);let b=this._packedInterpolationLength,f=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let A=Math.min(d.getRequiredDataPoints(u,f),i);A!==this._numberOfPoints&&(this._numberOfPoints=A,m.length=A,p.length=A*b)}let y=this._numberOfPoints-1;if(y<1)return;let _=0,S=i-1;if(S-_+1>=y+1){let A=a-(y/2|0)-1;A<_&&(A=_);let L=A+y;L>S&&(L=S,A=L-y,A<_&&(A=_)),_=A,S=L}let R=S-_+1;for(let A=0;A<R;++A)m[A]=Q.secondsDifference(n[_+A],n[S]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,_,S,p);else{let A=0,L=this._packedLength,F=_*L,I=(S+1)*L;for(;F<I;)p[A]=s[F],F++,A++}let C=Q.secondsDifference(e,n[S]),E;if(f===0||!l(d.interpolate))E=d.interpolateOrderZero(C,m,p,b,this._interpolationResult);else{let A=Math.floor(b/(f+1));E=d.interpolate(C,m,p,A,f,f,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(E,s,_,S,t):r.unpack(E,0,t)}return r.unpack(s,a*this._packedLength,t)};rh.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))};rh.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)}t3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};rh.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 m=0;m<u;m++)i[m].pack(d[m],a,a.length)}t3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};rh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};rh.prototype.addSamplesPackedArray=function(e,t){t3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};rh.prototype.removeSample=function(e){let t=Eo(this._times,e,Q.compare);return t<0?!1:(OZe(this,t,1),!0)};function OZe(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)}rh.prototype.removeSamples=function(e){let t=this._times,n=Eo(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Eo(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,OZe(this,n,i-n)};rh.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};rh._mergeNewSamples=t3;var Hu=rh;function sh(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Hu(h,n),this._definitionChanged=new Se,this._referenceFrame=e??Oi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(sh.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 apt=new Q;sh.prototype.getValue=function(e,t){return l(e)||(e=Q.now(apt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};sh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Bh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};sh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};sh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};sh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};sh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};sh.prototype.removeSample=function(e){return this._property.removeSample(e)};sh.prototype.removeSamples=function(e){this._property.removeSamples(e)};sh.prototype.equals=function(e){return this===e||e instanceof sh&&j.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var fc=sh;var lvi=x(T(),1);var $Wi=x(T(),1),BZe={HORIZONTAL:0,VERTICAL:1};Object.freeze(BZe);var vf=BZe;var cpt=vf.HORIZONTAL,lpt=U.WHITE,dpt=U.BLACK,upt=0,mpt=1;function VV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,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(VV.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:be("orientation"),evenColor:be("evenColor"),oddColor:be("oddColor"),offset:be("offset"),repeat:be("repeat")});VV.prototype.getType=function(e){return"Stripe"};var hpt=new Q;VV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(hpt)),l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,cpt)===vf.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,lpt,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,dpt,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,upt),t.repeat=j.getValueOrDefault(this._repeat,e,mpt),t};VV.prototype.equals=function(e){return this===e||e instanceof VV&&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 EV=VV;var yvi=x(T(),1);function Ox(e){this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(Ox.prototype._intervalsChanged,this),this._referenceFrame=e??Oi.FIXED}Object.defineProperties(Ox.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 fpt=new Q;Ox.prototype.getValue=function(e,t){return l(e)||(e=Q.now(fpt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Ox.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Bh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ox.prototype.equals=function(e){return this===e||e instanceof Ox&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};Ox.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Vg=Ox;var Cvi=x(T(),1);function JS(){this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(JS.prototype._intervalsChanged,this)}Object.defineProperties(JS.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var ppt=new Q;JS.prototype.getValue=function(e,t){l(e)||(e=Q.now(ppt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};JS.prototype.equals=function(e){return this===e||e instanceof JS&&this._intervals.equals(e._intervals,j.equals)};JS.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Eg=JS;var Ovi=x(T(),1);var vvi=x(T(),1);function AV(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Se,this._normalize=t??!0,this.position=e}Object.defineProperties(AV.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 bpt=new h,zZe=new h,HZe=new Q,gpt=new Q,lee=1/60;AV.prototype.getValue=function(e,t){return this._getValue(e,t)};AV.prototype._getValue=function(e,t,n){l(e)||(e=Q.now(gpt)),l(t)||(t=new h);let i=this._position;if(j.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,bpt),r=i.getValue(Q.addSeconds(e,lee,HZe),zZe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-lee,HZe),zZe),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,lee,t)};AV.prototype.equals=function(e){return this===e||e instanceof AV&&j.equals(this._position,e._position)};var Ag=AV;function JN(e,t){this._velocityVectorProperty=new Ag(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new Se,this.ellipsoid=t??ne.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(JN.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 KZe=new h,ypt=new h,JZe=new q,xpt=new Q;JN.prototype.getValue=function(e,t){l(e)||(e=Q.now(xpt));let n=this._velocityVectorProperty._getValue(e,ypt,KZe);if(l(n))return _t.rotationMatrixFromPositionVelocity(KZe,n,this._ellipsoid,JZe),Ne.fromRotationMatrix(JZe,t)};JN.prototype.equals=function(e){return this===e||e instanceof JN&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var jN=JN;var Hvi=x(T(),1);var Gg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Gg.validate=function(e){return e===Gg.COMPLETE||e===Gg.BELOW_ELLIPSOID_HORIZON||e===Gg.ABOVE_ELLIPSOID_HORIZON};Gg.toString=function(e){switch(e){case Gg.COMPLETE:return"COMPLETE";case Gg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Gg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new ge("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var GV=Gg;function Bx(){}Bx.packedLength=h.packedLength;Bx.unpack=h.unpack;Bx.pack=h.pack;var dee;function QN(e,t){return t[0]==="#"&&(t=dee+t),Cg.fromString(e,t)}function jZe(e,t,n){if(l(n.reference))return QN(t,n.reference);if(l(n.velocityReference)){let i=QN(t,n.velocityReference);switch(e){case h:case Bx:return new Ag(i,e===Bx);case Ne:return new jN(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function Tpt(e,t){return new Jh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var go=new h,cd=new KN,yl=new pe,jS=new Cn,n3=new Ne;function _pt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===U.packedLength)return[U.byteToFloat(n[0]),U.byteToFloat(n[1]),U.byteToFloat(n[2]),U.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=U.byteToFloat(n[o+1]),t[o+2]=U.byteToFloat(n[o+2]),t[o+3]=U.byteToFloat(n[o+3]),t[o+4]=U.byteToFloat(n[o+4]);return t}function QZe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function Spt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===re.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 Zpt(e){let t=e.length;if(cd.magnitude=1,t===2)return cd.clock=e[0],cd.cone=e[1],h.fromSpherical(cd,go),[go.x,go.y,go.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],cd.clock=e[i+1],cd.cone=e[i+2],h.fromSpherical(cd,go),n[o+1]=go.x,n[o+2]=go.y,n[o+3]=go.z;return n}function Rpt(e){let t=e.length;if(t===3)return cd.clock=e[0],cd.cone=e[1],cd.magnitude=e[2],h.fromSpherical(cd,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],cd.clock=e[i+1],cd.cone=e[i+2],cd.magnitude=e[i+3],h.fromSpherical(cd,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function Cpt(e){let t=e.length;if(t===3)return yl.longitude=e[0],yl.latitude=e[1],yl.height=e[2],ne.default.cartographicToCartesian(yl,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],yl.longitude=e[i+1],yl.latitude=e[i+2],yl.height=e[i+3],ne.default.cartographicToCartesian(yl,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function Vpt(e){let t=e.length;if(t===3)return yl.longitude=W.toRadians(e[0]),yl.latitude=W.toRadians(e[1]),yl.height=e[2],ne.default.cartographicToCartesian(yl,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],yl.longitude=W.toRadians(e[i+1]),yl.latitude=W.toRadians(e[i+2]),yl.height=e[i+3],ne.default.cartographicToCartesian(yl,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function uee(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 Zpt(o);let r=e.spherical;if(l(r))return Rpt(r);let s=e.cartographicRadians;if(l(s))return Cpt(s);let a=e.cartographicDegrees;if(l(a))return Vpt(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function qZe(e,t){h.unpack(e,t,go),h.normalize(go,go),h.pack(go,e,t)}function Ept(e){let t=uee(e);if(t.length===3)return qZe(t,0),t;for(let n=1;n<t.length;n+=4)qZe(t,n);return t}function $Ze(e,t){Ne.unpack(e,t,n3),Ne.normalize(n3,n3),Ne.pack(n3,e,t)}function Apt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return $Ze(t,0),t;for(let n=1;n<t.length;n+=5)$Ze(t,n)}return t}function eRe(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")?nt:e.hasOwnProperty("cartesian2")?k:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Bx:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?un:e.hasOwnProperty("classificationType")?ti:e.hasOwnProperty("colorBlendMode")?al:e.hasOwnProperty("cornerType")?ro:e.hasOwnProperty("heightReference")?He:e.hasOwnProperty("horizontalOrigin")?Ui:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?Tr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Kt:e.hasOwnProperty("distanceDisplayCondition")?Ot:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ne:e.hasOwnProperty("pathMode")?n0:e.hasOwnProperty("shadowMode")?vn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?vf:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?re:e.hasOwnProperty("uri")?$N.default:e.hasOwnProperty("verticalOrigin")?Bn:Object}function Gpt(e,t,n){switch(e){case un:return un[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case nt:return t.boundingRectangle;case k:return t.cartesian2;case h:return uee(t);case Bx:return Ept(t);case U:return _pt(t);case ti:return ti[t.classificationType??t];case al:return al[t.colorBlendMode??t];case ro:return ro[t.cornerType??t];case He:return He[t.heightReference??t];case Ui:return Ui[t.horizontalOrigin??t];case Image:return QZe(t,n);case Q:return Q.fromIso8601(t.date??t);case Tr:return Tr[t.labelStyle??t];case Number:return t.number??t;case Kt:return t.nearFarScalar;case Ot:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case n0:return n0[t.pathMode??t];case Ne:return Apt(t);case oh:return t.number??t;case GV:return GV[t.portionToDisplay??t];case vn:return vn[t.shadowMode??t.shadows??t];case String:return t.string??t;case vf:return vf[t.stripeOrientation??t];case re:return Spt(t);case $N.default:return QZe(t,n);case Bn:return Bn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var Lpt={HERMITE:zN,LAGRANGE:HN,LINEAR:kx};function i3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Lpt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=ad[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=ad[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var tRe={iso8601:void 0};function Kr(e){if(l(e))return tRe.iso8601=e,Cn.fromIso8601(tRe)}function mee(e){let t=it.MAXIMUM_INTERVAL.clone();return t.data=e,t}function nRe(e){let t=new pl;return t.intervals.addInterval(mee(e)),t}function iRe(e){let t=new mc(e.referenceFrame);return t.intervals.addInterval(mee(e)),t}function o3(e,t,n,i,o,r,s){let a=Kr(i.interval);l(o)&&(l(a)?a=Cn.intersect(a,o,jS):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(it.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return fRe(t[n],a)}let b=!1;if(m){if(d=Gpt(e,i,r),!l(d))return;c=e.packedLength??1,u=d.length??1,b=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==oh;if(!b&&!p){m?t[n]=new gi(f?e.unpack(d,0):d):t[n]=jZe(e,s,i);return}let y=t[n],_,S=i.epoch;if(l(S)&&(_=Q.fromIso8601(S)),b&&!p){y instanceof Hu||(t[n]=y=new Hu(e)),y.addSamplesPackedArray(d,_),i3(i,y);return}let Z;if(!b&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=jZe(e,s,i),l(y)||(t[n]=y=m?new Eg:new pl),m&&y instanceof Eg?y.intervals.addInterval(a):y instanceof pl?(m&&(a.data=new gi(a.data)),y.intervals.addInterval(a)):(t[n]=y=nRe(y),m&&(a.data=new gi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new pl),y instanceof pl||(t[n]=y=nRe(y));let R=y.intervals;Z=R.findInterval(a),(!l(Z)||!(Z.data instanceof Hu))&&(Z=a.clone(),Z.data=new Hu(e),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),i3(i,Z.data)}function fRe(e,t){if(e instanceof Hu){e.removeSamples(t);return}else if(e instanceof Eg){e.intervals.removeInterval(t);return}else if(e instanceof pl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Cn.intersect(n.get(i),t,jS);o.isEmpty||fRe(o.data,t)}n.removeInterval(t);return}}function Ce(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)o3(e,t,n,i[a],o,r,s);else o3(e,t,n,i,o,r,s)}function oRe(e,t,n,i,o,r){let s=Kr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,jS):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),d,u,m=!l(n.reference),p=l(s)&&!s.equals(it.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return pRe(e[t],s)}let b,f=!1;if(m&&(l(n.referenceFrame)&&(b=Oi[n.referenceFrame]),b=b??Oi.FIXED,d=uee(n),u=d.length??1,f=u>c),!f&&!p){m?e[t]=new Ml(h.unpack(d),b):e[t]=QN(r,n.reference);return}let y=e[t],_,S=n.epoch;if(l(S)&&(_=Q.fromIso8601(S)),f&&!p){(!(y instanceof fc)||l(b)&&y.referenceFrame!==b)&&(e[t]=y=new fc(b,a)),y.addSamplesPackedArray(d,_),i3(n,y);return}let Z;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=QN(r,n.reference),l(y)||(m?y=new Vg(b):y=new mc(b),e[t]=y),m&&y instanceof Vg&&l(b)&&y.referenceFrame===b?y.intervals.addInterval(s):y instanceof mc?(m&&(s.data=new Ml(s.data,b)),y.intervals.addInterval(s)):(e[t]=y=iRe(y),m&&(s.data=new Ml(s.data,b)),y.intervals.addInterval(s));return}l(y)?y instanceof mc||(e[t]=y=iRe(y)):e[t]=y=new mc(b);let R=y.intervals;Z=R.findInterval(s),(!l(Z)||!(Z.data instanceof fc)||l(b)&&Z.data.referenceFrame!==b)&&(Z=s.clone(),Z.data=new fc(b,a),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),i3(n,Z.data)}function pRe(e,t){if(e instanceof fc){e.removeSamples(t);return}else if(e instanceof Vg){e.intervals.removeInterval(t);return}else if(e instanceof mc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Cn.intersect(n.get(i),t,jS);o.isEmpty||pRe(o.data,t)}n.removeInterval(t);return}}function bRe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)oRe(e,t,n[s],i,o,r);else oRe(e,t,n,i,o,r)}function rRe(e,t,n,i){l(n.references)?r3(e,t,n.references,n.interval,i,CV,pl):(l(n.cartesian2)?n.array=k.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=k.unpackArray(n.cartesian)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i))}function sRe(e,t,n,i,o,r){let s=Kr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,jS):s=i);let a=e[t],c,d;if(l(s)){a instanceof aV||(a=new aV,e[t]=a);let m=a.intervals;d=m.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),m.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Qt||(c=new Qt),u=n.solidColor,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof gV||(c=new gV),u=n.grid,Ce(U,c,"color",u.color,void 0,o,r),Ce(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),Ce(k,c,"lineCount",u.lineCount,void 0,o,r),Ce(k,c,"lineThickness",u.lineThickness,void 0,o,r),Ce(k,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Ny||(c=new Ny),u=n.image,Ce(Image,c,"image",u.image,void 0,o,r),Ce(k,c,"repeat",u.repeat,void 0,o,r),Ce(U,c,"color",u.color,void 0,o,r),Ce(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof EV||(c=new EV),u=n.stripe,Ce(vf,c,"orientation",u.orientation,void 0,o,r),Ce(U,c,"evenColor",u.evenColor,void 0,o,r),Ce(U,c,"oddColor",u.oddColor,void 0,o,r),Ce(Number,c,"offset",u.offset,void 0,o,r),Ce(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof Ux||(c=new Ux),u=n.polylineOutline,Ce(U,c,"color",u.color,void 0,o,r),Ce(U,c,"outlineColor",u.outlineColor,void 0,o,r),Ce(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof ZV||(c=new ZV),u=n.polylineGlow,Ce(U,c,"color",u.color,void 0,o,r),Ce(Number,c,"glowPower",u.glowPower,void 0,o,r),Ce(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof xV||(c=new xV),u=n.polylineArrow,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof _V||(c=new _V),u=n.polylineDash,Ce(U,c,"color",u.color,void 0,void 0,r),Ce(U,c,"gapColor",u.gapColor,void 0,void 0,r),Ce(Number,c,"dashLength",u.dashLength,void 0,o,r),Ce(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof rV||(c=new rV),u=n.checkerboard,Ce(U,c,"evenColor",u.evenColor,void 0,o,r),Ce(U,c,"oddColor",u.oddColor,void 0,o,r),Ce(k,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Ku(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)sRe(e,t,n[s],i,o,r);else sRe(e,t,n,i,o,r)}function Wpt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function vpt(e,t,n,i){let o=t.description;l(o)&&Ce(String,e,"description",o,void 0,i,n)}function Fpt(e,t,n,i){let o=t.position;l(o)&&bRe(e,"position",o,void 0,i,n)}function Ipt(e,t,n,i){let o=t.viewFrom;l(o)&&Ce(h,e,"viewFrom",o,void 0,i,n)}function Ppt(e,t,n,i){let o=t.orientation;l(o)&&Ce(Ne,e,"orientation",o,void 0,i,n)}function Xpt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Ul);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)o3(eRe(s[a]),e.properties,r,s[a],void 0,i,n);else o3(eRe(s),e.properties,r,s,void 0,i,n)}}}function r3(e,t,n,i,o,r,s){let a=n.map(function(c){return QN(o,c)});if(l(i)){i=Kr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(mee(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function aRe(e,t,n,i){let o=n.references;l(o)?r3(e,t,o,n.interval,i,CV,pl):Ce(Array,e,t,n,void 0,void 0,i)}function cRe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)aRe(e,t,n[o],i);else aRe(e,t,n,i)}function lRe(e,t,n,i){let o=n.references;l(o)?r3(e,t,o,n.interval,i,Rg,mc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i))}function eY(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)lRe(e,t,n[o],i);else lRe(e,t,n,i)}function Npt(e){return h.unpackArray(e)}function Ypt(e){return h.fromRadiansArrayHeights(e,ne.default)}function wpt(e){return h.fromDegreesArrayHeights(e,ne.default)}function dRe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return r3(a,"positions",s,n.interval,i,Rg,mc),a.positions});e[t]=new Rg(r)}else l(n.cartesian)?n.array=n.cartesian.map(Npt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Ypt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(wpt)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i)}function Mpt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)dRe(e,t,n[o],i);else dRe(e,t,n,i)}function kpt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)rRe(e,t,n[o],i);else rRe(e,t,n,i)}function Upt(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 Vs),r.addInterval(Kr(o[s]));else r=new Vs,r.addInterval(Kr(o));e.availability=r}function Dpt(e,t,n,i,o){l(t)&&Ce(Bx,e,"alignedAxis",t,n,i,o)}function Opt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Kr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new Oc),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Image,s,"image",o.image,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(k,s,"pixelOffset",o.pixelOffset,r,i,n),Ce(h,s,"eyeOffset",o.eyeOffset,r,i,n),Ce(Ui,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ce(Bn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(oh,s,"rotation",o.rotation,r,i,n),Dpt(s,o.alignedAxis,r,i,n),Ce(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ce(nt,s,"imageSubRegion",o.imageSubRegion,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Bpt(e,t,n,i){let o=t.box;if(!l(o))return;let r=Kr(o.interval),s=e.box;l(s)||(e.box=s=new Z_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(h,s,"dimensions",o.dimensions,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function zpt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Kr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new C_),Ce(Boolean,s,"show",o.show,r,i,n),eY(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(ro,s,"cornerType",o.cornerType,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function Hpt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Kr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new V_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"length",o.length,r,i,n),Ce(Number,s,"topRadius",o.topRadius,r,i,n),Ce(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ce(Number,s,"slices",o.slices,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Kpt(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=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Jpt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Kr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new E_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Ce(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(oh,s,"rotation",o.rotation,r,i,n),Ce(oh,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function jpt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Kr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new A_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(h,s,"radii",o.radii,r,i,n),Ce(h,s,"innerRadii",o.innerRadii,r,i,n),Ce(Number,s,"minimumClock",o.minimumClock,r,i,n),Ce(Number,s,"maximumClock",o.maximumClock,r,i,n),Ce(Number,s,"minimumCone",o.minimumCone,r,i,n),Ce(Number,s,"maximumCone",o.maximumCone,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Ce(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Ce(Number,s,"subdivisions",o.subdivisions,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Qpt(e,t,n,i){let o=t.label;if(!l(o))return;let r=Kr(o.interval),s=e.label;l(s)||(e.label=s=new zh),Ce(Boolean,s,"show",o.show,r,i,n),Ce(String,s,"text",o.text,r,i,n),Ce(String,s,"font",o.font,r,i,n),Ce(Tr,s,"style",o.style,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(Boolean,s,"showBackground",o.showBackground,r,i,n),Ce(U,s,"backgroundColor",o.backgroundColor,r,i,n),Ce(k,s,"backgroundPadding",o.backgroundPadding,r,i,n),Ce(k,s,"pixelOffset",o.pixelOffset,r,i,n),Ce(h,s,"eyeOffset",o.eyeOffset,r,i,n),Ce(Ui,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ce(Bn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"fillColor",o.fillColor,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function qpt(e,t,n,i){let o=t.model;if(!l(o))return;let r=Kr(o.interval),s=e.model;l(s)||(e.model=s=new gb),Ce(Boolean,s,"show",o.show,r,i,n),Ce($N.default,s,"uri",o.gltf,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Ce(Number,s,"maximumScale",o.maximumScale,r,i,n),Ce(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Ce(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Ce(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"silhouetteColor",o.silhouetteColor,r,i,n),Ce(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(al,s,"colorBlendMode",o.colorBlendMode,r,i,n),Ce(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ce(Ot,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)uRe(s,d[a],r,i,n);else uRe(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)mRe(s,u[a],r,i,n);else mRe(s,u,r,i,n)}function uRe(e,t,n,i,o){let r=Kr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,jS):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 m=t[u];if(!l(m))continue;l(s)||(e.nodeTransformations=s=new Ul),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new G_),Ce(h,p,"translation",m.translation,r,i,o),Ce(Ne,p,"rotation",m.rotation,r,i,o),Ce(h,p,"scale",m.scale,r,i,o)}}function mRe(e,t,n,i,o){let r=Kr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,jS):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 m=t[u];l(m)&&(l(s)||(e.articulations=s=new Ul),s.hasProperty(u)||s.addProperty(u),Ce(Number,s,u,m,r,i,o))}}function $pt(e,t,n,i){let o=t.path;if(!l(o))return;let r=Kr(o.interval),s=e.path;l(s)||(e.path=s=new yb),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"leadTime",o.leadTime,r,i,n),Ce(Number,s,"trailTime",o.trailTime,r,i,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"resolution",o.resolution,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(String,s,"relativeTo",o.relativeTo,r,i,n),Ce(n0,s,"materialMode",o.materialMode,r,i,n)}function e0t(e,t,n,i){let o=t.point;if(!l(o))return;let r=Kr(o.interval),s=e.point;l(s)||(e.point=s=new W_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"pixelSize",o.pixelSize,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function qN(e){this.polygon=e,this._definitionChanged=new Se}Object.defineProperties(qN.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}}});qN.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 Gc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Gc(n,i)};qN.prototype.equals=function(e){return this===e||e instanceof qN&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function t0t(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Kr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Hh),Ce(Boolean,s,"show",o.show,r,i,n),eY(s,"_positions",o.positions,n),Mpt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new qN(s)),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(oh,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Ce(Boolean,s,"closeTop",o.closeTop,r,i,n),Ce(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Ce(un,s,"arcType",o.arcType,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function n0t(e){return e?un.GEODESIC:un.NONE}function i0t(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Kr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new qc),Ce(Boolean,s,"show",o.show,r,i,n),eY(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ku(s,"material",o.material,r,i,n),Ku(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ce(un,s,"arcType",o.arcType,r,i,n),Ce(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};Ce(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Tpt(a.followSurface,n0t)}}function o0t(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Kr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new v_),eY(s,"positions",o.positions,n),kpt(s,"shape",o.shape,n),Ce(Boolean,s,"show",o.show,r,i,n),Ce(ro,s,"cornerType",o.cornerType,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function r0t(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Kr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Kh),Ce(Boolean,s,"show",o.show,r,i,n),Ce(re,s,"coordinates",o.coordinates,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(oh,s,"rotation",o.rotation,r,i,n),Ce(oh,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function s0t(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Kr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new L_),Ce(Boolean,s,"show",o.show,r,i,n),Ce($N.default,s,"uri",o.uri,r,i,n),Ce(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function a0t(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Kr(o.interval),s=e.wall;l(s)||(e.wall=s=new xb),Ce(Boolean,s,"show",o.show,r,i,n),eY(s,"positions",o.positions,n),cRe(s,"minimumHeights",o.minimumHeights,n),cRe(s,"maximumHeights",o.maximumHeights,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ku(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Ot,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function hRe(e,t,n,i,o){let r=e.id;if(l(r)||(r=qn()),dee=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")Kpt(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)}dee=void 0}function c0t(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(it.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),c=Math.round(a/120);return t=new Wf,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=As.LOOP_STOP,t.multiplier=c,t.currentTime=Q.clone(r),t.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Wf,t.startTime=it.MINIMUM_VALUE.clone(),t.stopTime=it.MAXIMUM_VALUE.clone(),t.currentTime=it.MINIMUM_VALUE.clone(),t.clockRange=As.LOOP_STOP,t.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Kr(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=As[n.range]??As.LOOP_STOP),l(n.step)&&(t.clockStep=Oo[n.step]??Oo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function gRe(e,t,n,i){n=n??B.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Lt(s)),e._credit=s,typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),o=t.fetchJson(),r=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=ve.createIfNeeded(r),Es.setLoading(e,!0),Promise.resolve(o).then(function(a){return l0t(e,a,r,i)}).catch(function(a){return Es.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function l0t(e,t,n,i){Es.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new yRe,o.removeAll()),oa._processCzml(t,o,n,void 0,e);let r=c0t(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=Sg(n.getUrlComponent()),r=!0),Es.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function yRe(){this.name=void 0,this.clock=void 0}function oa(e){this._name=e,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._clock=void 0,this._documentPacket=new yRe,this._version=void 0,this._entityCollection=new za(this),this._entityCluster=new Ou,this._credit=void 0,this._resourceCredits=[]}oa.load=function(e,t){return new oa().load(e,t)};Object.defineProperties(oa.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}}});oa.updaters=[Opt,Bpt,zpt,Hpt,Jpt,jpt,Qpt,qpt,Wpt,vpt,$pt,e0t,t0t,i0t,o0t,Xpt,r0t,Fpt,s0t,Ipt,a0t,Ppt,Upt];oa.registerUpdater=function(e){oa.updaters.includes(e)||oa.updaters.push(e)};oa.unregisterUpdater=function(e){if(oa.updaters.includes(e)){let t=oa.updaters.indexOf(e);oa.updaters.splice(t,1)}};oa.prototype.process=function(e,t){return gRe(this,e,t,!1)};oa.prototype.load=function(e,t){return gRe(this,e,t,!0)};oa.prototype.update=function(e){return!0};oa.processPacketData=Ce;oa.processPositionPacketData=bRe;oa.processMaterialPacketData=Ku;oa._processCzml=function(e,t,n,i,o){if(i=i??oa.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)hRe(e[r],t,i,n,o);else hRe(e,t,i,n,o)};var tY=oa;var YFi=x(T(),1);function ld(){this._dataSources=[],this._dataSourceAdded=new Se,this._dataSourceRemoved=new Se,this._dataSourceMoved=new Se}Object.defineProperties(ld.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}}});ld.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})};ld.prototype.remove=function(e,t){t=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};ld.prototype.removeAll=function(e){e=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=[]};ld.prototype.contains=function(e){return this.indexOf(e)!==-1};ld.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ld.prototype.get=function(e){return this._dataSources[e]};ld.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function s3(e,t){return e.indexOf(t)}function xRe(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)}ld.prototype.raise=function(e){let t=s3(this._dataSources,e);xRe(this,t,t+1)};ld.prototype.lower=function(e){let t=s3(this._dataSources,e);xRe(this,t,t-1)};ld.prototype.raiseToTop=function(e){let t=s3(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))};ld.prototype.lowerToBottom=function(e){let t=s3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ld.prototype.isDestroyed=function(){return!1};ld.prototype.destroy=function(){return this.removeAll(!0),me(this)};var nY=ld;var pBi=x(T(),1);var jFi=x(T(),1);var BFi=x(T(),1);function pc(e){e=e??B.EMPTY_OBJECT,this._primitives=[],this._guid=qn(),this._primitiveAdded=new Se,this._primitiveRemoved=new Se,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(pc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});pc.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._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};pc.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._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};pc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};pc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};pc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function a3(e,t){return e._primitives.indexOf(t)}pc.prototype.raise=function(e){if(l(e)){let t=a3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};pc.prototype.raiseToTop=function(e){if(l(e)){let t=a3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};pc.prototype.lower=function(e){if(l(e)){let t=a3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};pc.prototype.lowerToBottom=function(e){if(l(e)){let t=a3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};pc.prototype.get=function(e){return this._primitives[e]};pc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};pc.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)}};pc.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)}};pc.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)}};pc.prototype.isDestroyed=function(){return!1};pc.prototype.destroy=function(){return this.removeAll(),me(this)};var xl=pc;function i0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(i0.prototype,{length:{get:function(){return this._length}}});i0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new xl({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};i0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};i0.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};i0.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};i0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};i0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){return this.removeAll(),me(this)};var iY=i0;var IUi=x(T(),1);var tIi=x(T(),1);function LV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Mt}LV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};LV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};LV.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};LV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};LV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Wt.FAILED};var QS=LV;var Mki=x(T(),1);var gPi=x(T(),1);var vIi=x(T(),1);var aIi=x(T(),1);var fee={},c3=new h,TRe=new h,_Re=new Ne,SRe=new q;function WV(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),c3),h.multiplyByScalar(n,Math.sin(u),TRe),h.add(c3,TRe,c3);let m=Math.cos(e);m=m*m;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*m+o*p)/a;return Ne.fromAxisAngle(c3,f,_Re),q.fromQuaternion(_Re,SRe),q.multiplyByVector(SRe,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var ZRe=new h,RRe=new h,hee=new h,d0t=new h;fee.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 m=u+1,p=u+2,b=h.fromArray(e,u,ZRe);i.scaleToGeodeticSurface(b,b);let f=h.clone(b,RRe),y=i.geodeticSurfaceNormal(b,d0t),_=h.multiplyByScalar(y,o,hee);h.add(b,_,b),n&&(h.multiplyByScalar(y,r,_),h.add(f,_,f),a[u+d]=f.x,a[m+d]=f.y,a[p+d]=f.z),a[u]=b.x,a[m]=b.y,a[p]=b.z}return a};var u0t=new h,m0t=new h,h0t=new h;fee.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,m=h.magnitude(s),p=h.normalize(s,u0t),b=h.cross(h.UNIT_Z,s,m0t);b=h.normalize(b,b);let f=h.cross(p,b,h0t),y=1+Math.ceil(W.PI_OVER_TWO/a),_=W.PI_OVER_TWO/(y-1),S=W.PI_OVER_TWO-y*_;S<0&&(y-=Math.ceil(Math.abs(S)/_));let Z=2*(y*(y+2)),R=t?new Array(Z*3):void 0,C=0,E=ZRe,A=RRe,L=y*4*3,F=L-1,I=0,N=n?new Array(L):void 0,g,V,G,v,X;for(S=W.PI_OVER_TWO,E=WV(S,r,f,b,c,u,d,m,p,E),t&&(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z),n&&(N[F--]=E.z,N[F--]=E.y,N[F--]=E.x),S=W.PI_OVER_TWO-_,g=1;g<y+1;++g){if(E=WV(S,r,f,b,c,u,d,m,p,E),A=WV(Math.PI-S,r,f,b,c,u,d,m,p,A),t){for(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z,G=2*g+2,V=1;V<G-1;++V)v=V/(G-1),X=h.lerp(E,A,v,hee),R[C++]=X.x,R[C++]=X.y,R[C++]=X.z;R[C++]=A.x,R[C++]=A.y,R[C++]=A.z}n&&(N[F--]=E.z,N[F--]=E.y,N[F--]=E.x,N[I++]=A.x,N[I++]=A.y,N[I++]=A.z),S=W.PI_OVER_TWO-(g+1)*_}for(g=y;g>1;--g){if(S=W.PI_OVER_TWO-(g-1)*_,E=WV(-S,r,f,b,c,u,d,m,p,E),A=WV(S+Math.PI,r,f,b,c,u,d,m,p,A),t){for(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z,G=2*(g-1)+2,V=1;V<G-1;++V)v=V/(G-1),X=h.lerp(E,A,v,hee),R[C++]=X.x,R[C++]=X.y,R[C++]=X.z;R[C++]=A.x,R[C++]=A.y,R[C++]=A.z}n&&(N[F--]=E.z,N[F--]=E.y,N[F--]=E.x,N[I++]=A.x,N[I++]=A.y,N[I++]=A.z)}S=W.PI_OVER_TWO,E=WV(-S,r,f,b,c,u,d,m,p,E);let Y={};return t&&(R[C++]=E.x,R[C++]=E.y,R[C]=E.z,Y.positions=R,Y.numPts=y),n&&(N[F--]=E.z,N[F--]=E.y,N[F]=E.x,Y.outerPositions=N),Y};var Kd=fee;var vV=new h,pee=new h,bee=new h,CRe=new h,Aa=new k,VRe=new q,f0t=new q,gee=new Ne,ERe=new h,ARe=new h,GRe=new h,u3=new pe,LRe=new h,WRe=new k,vRe=new k;function FRe(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,m=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,b=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,y=u?new Float32Array(d*3):void 0,_=0,S=ERe,Z=ARe,R=GRe,C=new ki(a),E=C.project(a.cartesianToCartographic(o,u3),LRe),A=a.scaleToGeodeticSurface(o,vV);a.geodeticSurfaceNormal(A,A);let L=VRe,F=f0t;if(c!==0){let X=Ne.fromAxisAngle(A,c,gee);L=q.fromQuaternion(X,L),X=Ne.fromAxisAngle(A,-c,gee),F=q.fromQuaternion(X,F)}else L=q.clone(q.IDENTITY,L),F=q.clone(q.IDENTITY,F);let I=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,WRe),N=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,vRe),g=e.length,V=n?g:0,G=V/3*2;for(let X=0;X<g;X+=3){let Y=X+1,D=X+2,w=h.fromArray(e,X,vV);if(i.st){let O=q.multiplyByVector(L,w,pee),M=C.project(a.cartesianToCartographic(O,u3),bee);h.subtract(M,E,M),Aa.x=(M.x+r)/(2*r),Aa.y=(M.y+s)/(2*s),I.x=Math.min(Aa.x,I.x),I.y=Math.min(Aa.y,I.y),N.x=Math.max(Aa.x,N.x),N.y=Math.max(Aa.y,N.y),n&&(m[_+G]=Aa.x,m[_+1+G]=Aa.y),m[_++]=Aa.x,m[_++]=Aa.y}(i.normal||i.tangent||i.bitangent||u)&&(S=a.geodeticSurfaceNormal(w,S),u&&(y[X+V]=-S.x,y[Y+V]=-S.y,y[D+V]=-S.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(Z=h.normalize(h.cross(h.UNIT_Z,S,Z),Z),q.multiplyByVector(F,Z,Z)),i.normal&&(p[X]=S.x,p[Y]=S.y,p[D]=S.z,n&&(p[X+V]=-S.x,p[Y+V]=-S.y,p[D+V]=-S.z)),i.tangent&&(b[X]=Z.x,b[Y]=Z.y,b[D]=Z.z,n&&(b[X+V]=-Z.x,b[Y+V]=-Z.y,b[D+V]=-Z.z)),i.bitangent&&(R=h.normalize(h.cross(S,Z,R),R),f[X]=R.x,f[Y]=R.y,f[D]=R.z,n&&(f[X+V]=R.x,f[Y+V]=R.y,f[D+V]=R.z))))}if(i.st){g=m.length;for(let X=0;X<g;X+=2)m[X]=(m[X]-I.x)/(N.x-I.x),m[X+1]=(m[X+1]-I.y)/(N.y-I.y)}let v=new Rn;if(i.position){let X=Kd.raisePositionsToHeight(e,t,n);v.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:X})}if(i.st&&(v.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(v.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(v.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),i.bitangent&&(v.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),u&&(v.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let X=new Uint8Array(d);if(t.offsetAttribute===bn.TOP)X=X.fill(1,0,d/2);else{let Y=t.offsetAttribute===bn.NONE?0:1;X=X.fill(Y)}v.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:X})}return v}function IRe(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 qS=new h;function p0t(e){let t=e.center;qS=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,qS),e.height,qS),qS=h.add(t,qS,qS);let n=new de(qS,e.semiMajorAxis),i=Kd.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=FRe(o,e,!1),a=IRe(r);return a=Oe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function b0t(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,m=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,b=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,y=n.bitangent?new Float32Array(u*3):void 0,_=t.shadowVolume,S=_?new Float32Array(u*3):void 0,Z=0,R=ERe,C=ARe,E=GRe,A=new ki(s),L=A.project(s.cartesianToCartographic(i,u3),LRe),F=s.scaleToGeodeticSurface(i,vV);s.geodeticSurfaceNormal(F,F);let I=Ne.fromAxisAngle(F,d,gee),N=q.fromQuaternion(I,VRe),g=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,WRe),V=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,vRe),G=e.length,v=G/3*2;for(let Y=0;Y<G;Y+=3){let D=Y+1,w=Y+2,O=h.fromArray(e,Y,vV),M;if(n.st){let K=q.multiplyByVector(N,O,pee),te=A.project(s.cartesianToCartographic(K,u3),bee);h.subtract(te,L,te),Aa.x=(te.x+o)/(2*o),Aa.y=(te.y+r)/(2*r),g.x=Math.min(Aa.x,g.x),g.y=Math.min(Aa.y,g.y),V.x=Math.max(Aa.x,V.x),V.y=Math.max(Aa.y,V.y),p[Z+v]=Aa.x,p[Z+1+v]=Aa.y,p[Z++]=Aa.x,p[Z++]=Aa.y}O=s.scaleToGeodeticSurface(O,O),M=h.clone(O,pee),R=s.geodeticSurfaceNormal(O,R),_&&(S[Y+G]=-R.x,S[D+G]=-R.y,S[w+G]=-R.z);let z=h.multiplyByScalar(R,a,CRe);if(O=h.add(O,z,O),z=h.multiplyByScalar(R,c,z),M=h.add(M,z,M),n.position&&(m[Y+G]=M.x,m[D+G]=M.y,m[w+G]=M.z,m[Y]=O.x,m[D]=O.y,m[w]=O.z),n.normal||n.tangent||n.bitangent){E=h.clone(R,E);let K=h.fromArray(e,(Y+3)%G,CRe);h.subtract(K,O,K);let te=h.subtract(M,O,bee);R=h.normalize(h.cross(te,K,R),R),n.normal&&(b[Y]=R.x,b[D]=R.y,b[w]=R.z,b[Y+G]=R.x,b[D+G]=R.y,b[w+G]=R.z),n.tangent&&(C=h.normalize(h.cross(E,R,C),C),f[Y]=C.x,f[D]=C.y,f[w]=C.z,f[Y+G]=C.x,f[Y+1+G]=C.y,f[Y+2+G]=C.z),n.bitangent&&(y[Y]=E.x,y[D]=E.y,y[w]=E.z,y[Y+G]=E.x,y[D+G]=E.y,y[w+G]=E.z)}}if(n.st){G=p.length;for(let Y=0;Y<G;Y+=2)p[Y]=(p[Y]-g.x)/(V.x-g.x),p[Y+1]=(p[Y+1]-g.y)/(V.y-g.y)}let X=new Rn;if(n.position&&(X.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m})),n.st&&(X.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(X.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),n.tangent&&(X.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(X.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:y})),_&&(X.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:S})),l(t.offsetAttribute)){let Y=new Uint8Array(u);if(t.offsetAttribute===bn.TOP)Y=Y.fill(1,0,u/2);else{let D=t.offsetAttribute===bn.NONE?0:1;Y=Y.fill(D)}X.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}return X}function g0t(e){let t=e.length/3,n=Oe.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 l3=new de,d3=new de;function y0t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,vV),e.height,vV);l3.center=h.add(t,o,l3.center),l3.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),d3.center=h.add(t,o,d3.center),d3.radius=i;let r=Kd.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=de.union(l3,d3),u=FRe(s,e,!0),m=IRe(a),p=m.length;m.length=p*2;let b=s.length/3;for(let C=0;C<p;C+=3)m[C+p]=m[C+2]+b,m[C+1+p]=m[C+1]+b,m[C+2+p]=m[C]+b;let f=Oe.createTypedArray(b*2/3,m),y=new At({attributes:u,indices:f,primitiveType:Ie.TRIANGLES}),_=b0t(c,e);m=g0t(c);let S=Oe.createTypedArray(c.length*2/3,m),Z=new At({attributes:_,indices:S,primitiveType:Ie.TRIANGLES}),R=zn.combineInstances([new Yt({geometry:y}),new Yt({geometry:Z})]);return{boundingSphere:d,attributes:R[0].attributes,indices:R[0].indices}}function PRe(e,t,n,i,o,r,s){let c=Kd.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]=h.fromArray(c,p*3);let m=re.fromCartesianArray(u,r,s);return m.width>W.PI&&(m.north=m.north>0?W.PI_OVER_TWO-W.EPSILON7:m.north,m.south=m.south<0?W.EPSILON7-W.PI_OVER_TWO:m.south,m.east=W.PI,m.west=-W.PI),m}function r0(e){e=e??B.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.vertexFormat??we.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=we.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}r0.packedLength=h.packedLength+ne.packedLength+we.packedLength+9;r0.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.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]=e._offsetAttribute??-1,t};var XRe=new h,NRe=new ne,YRe=new we,o0={center:XRe,ellipsoid:NRe,vertexFormat:YRe,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};r0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,XRe);t+=h.packedLength;let o=ne.unpack(e,t,NRe);t+=ne.packedLength;let r=we.unpack(e,t,YRe);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++],b=e[t++]===1,f=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=b,n._offsetAttribute=f===-1?void 0:f,n):(o0.height=u,o0.extrudedHeight=p,o0.granularity=m,o0.stRotation=d,o0.rotation=c,o0.semiMajorAxis=s,o0.semiMinorAxis=a,o0.shadowVolume=b,o0.offsetAttribute=f===-1?void 0:f,new r0(o0))};r0.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ne.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??W.RADIANS_PER_DEGREE,a=e.rotation??0;return PRe(n,o,r,a,s,i,t)};r0.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=y0t(o);else if(r=p0t(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===bn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Ie.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};r0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new r0({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};function x0t(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Kd.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]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return At._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(r0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=PRe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=x0t(this)),this._textureCoordinateRotationPoints}}});var dd=r0;var KIi=x(T(),1);var wRe=new h,$S=new h;function T0t(e){let t=e.center;$S=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,$S),e.height,$S),$S=h.add(t,$S,$S);let n=new de($S,e.semiMajorAxis),i=Kd.computeEllipsePositions(e,!1,!0).outerPositions,o=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:Kd.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Oe.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 m3=new de,h3=new de;function _0t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,wRe),e.height,wRe);m3.center=h.add(t,o,m3.center),m3.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),h3.center=h.add(t,o,h3.center),h3.radius=i;let r=Kd.computeEllipsePositions(e,!1,!0).outerPositions,s=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:Kd.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=de.union(m3,h3),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===bn.TOP)f=f.fill(1,0,c/2);else{let y=e.offsetAttribute===bn.NONE?0:1;f=f.fill(y)}s.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=e.numberOfVerticalLines??16;d=W.clamp(d,0,c/2);let u=Oe.createTypedArray(c,c*2+d*2);c/=2;let m=0,p;for(p=0;p<c;++p)u[m++]=p,u[m++]=(p+1)%c,u[m++]=p+c,u[m++]=(p+1)%c+c;let b;if(d>0){let f=Math.min(d,c);b=Math.round(c/f);let y=Math.min(b*d,c);for(p=0;p<y;p+=b)u[m++]=p,u[m++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function FV(e){e=e??B.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}FV.packedLength=h.packedLength+ne.packedLength+8;FV.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.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]=e._offsetAttribute??-1,t};var MRe=new h,kRe=new ne,Lg={center:MRe,ellipsoid:kRe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};FV.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,MRe);t+=h.packedLength;let o=ne.unpack(e,t,kRe);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._center=h.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=m,n._offsetAttribute=p===-1?void 0:p,n):(Lg.height=c,Lg.extrudedHeight=u,Lg.granularity=d,Lg.rotation=a,Lg.semiMajorAxis=r,Lg.semiMinorAxis=s,Lg.numberOfVerticalLines=m,Lg.offsetAttribute=p===-1?void 0:p,new FV(Lg))};FV.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=_0t(o);else if(r=T0t(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===bn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Ie.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Ju=FV;var URe=new U,DRe=h.ZERO,ORe=new h,BRe=new re;function S0t(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 Ff(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new S0t(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Ff.prototype=Object.create(ri.prototype),Ff.prototype.constructor=Ff);Ff.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,URe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,DRe,ORe))),new Yt({id:t,geometry:new dd(this._options),attributes:i})};Ff.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,URe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,DRe,ORe))),new Yt({id:t,geometry:new Ju(this._options),attributes:r})};Ff.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Ff.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Wi.prototype._isHidden.call(this,e,t)};Ff.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 Qt)};Ff.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,it.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),o=j.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,He.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(it.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(it.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(it.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=j.getValueOrUndefined(t.rotation,it.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),s.stRotation=j.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),s.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,it.MINIMUM_VALUE),s.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),s.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=Pi.getMinimumMaximumHeights(dd.computeRectangle(s,BRe)).minimumTerrainHeight),s.extrudedHeight=o};Ff.DynamicGeometryUpdater=IV;function IV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(IV.prototype=Object.create(Li.prototype),IV.prototype.constructor=IV);IV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Li.prototype._isHidden.call(this,e,t,n)};IV.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,He.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=ri.computeGeometryOffsetAttribute(o,r,s,a),i.height=ri.getGeometryHeight(o,r),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND&&(s=Pi.getMinimumMaximumHeights(dd.computeRectangle(i,BRe)).minimumTerrainHeight),i.extrudedHeight=s};var oY=Ff;var aXi=x(T(),1);var IPi=x(T(),1);var Z0t=new h,R0t=new h,C0t=new h,V0t=new h,E0t=new h,A0t=new h(1,1,1),zRe=Math.cos,HRe=Math.sin;function Wg(e){e=e??B.EMPTY_OBJECT;let t=e.radii??A0t,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??W.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??W.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),d=e.vertexFormat??we.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=we.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Wg.packedLength=2*h.packedLength+we.packedLength+7;Wg.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,we.pack(e._vertexFormat,t,n),n+=we.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._offsetAttribute??-1,t};var KRe=new h,JRe=new h,jRe=new we,zx={radii:KRe,innerRadii:JRe,vertexFormat:jRe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Wg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,KRe);t+=h.packedLength;let o=h.unpack(e,t,JRe);t+=h.packedLength;let r=we.unpack(e,t,jRe);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=we.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=m,n._offsetAttribute=p===-1?void 0:p,n):(zx.minimumClock=s,zx.maximumClock=a,zx.minimumCone=c,zx.maximumCone=d,zx.stackPartitions=u,zx.slicePartitions=m,zx.offsetAttribute=p===-1?void 0:p,new Wg(zx))};Wg.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,m,p=0,b=[r],f=[i];for(u=0;u<d;u++)b.push(r+u*(s-r)/(d-1));for(b.push(s),m=0;m<c;m++)f.push(i+m*(o-i)/(c-1));f.push(o);let y=b.length,_=f.length,S=0,Z=1,R=n.x!==t.x||n.y!==t.y||n.z!==t.z,C=!1,E=!1,A=!1;R&&(Z=2,r>0&&(C=!0,S+=c-1),s<Math.PI&&(E=!0,S+=c-1),(o-i)%W.TWO_PI?(A=!0,S+=(d-1)*2+1):S+=1);let L=_*y*Z,F=new Float64Array(L*3),I=new Array(L).fill(!1),N=new Array(L).fill(!1),g=c*d*Z,V=6*(g+S+1-(c+d)*Z),G=Oe.createTypedArray(g,V),v=a.normal?new Float32Array(L*3):void 0,X=a.tangent?new Float32Array(L*3):void 0,Y=a.bitangent?new Float32Array(L*3):void 0,D=a.st?new Float32Array(L*2):void 0,w=new Array(y),O=new Array(y);for(u=0;u<y;u++)w[u]=HRe(b[u]),O[u]=zRe(b[u]);let M=new Array(_),z=new Array(_);for(m=0;m<_;m++)z[m]=zRe(f[m]),M[m]=HRe(f[m]);for(u=0;u<y;u++)for(m=0;m<_;m++)F[p++]=t.x*w[u]*z[m],F[p++]=t.y*w[u]*M[m],F[p++]=t.z*O[u];let K=L/2;if(R)for(u=0;u<y;u++)for(m=0;m<_;m++)F[p++]=n.x*w[u]*z[m],F[p++]=n.y*w[u]*M[m],F[p++]=n.z*O[u],I[K]=!0,u>0&&u!==y-1&&m!==0&&m!==_-1&&(N[K]=!0),K++;p=0;let te,H;for(u=1;u<y-2;u++)for(te=u*_,H=(u+1)*_,m=1;m<_-2;m++)G[p++]=H+m,G[p++]=H+m+1,G[p++]=te+m+1,G[p++]=H+m,G[p++]=te+m+1,G[p++]=te+m;if(R){let Be=y*_;for(u=1;u<y-2;u++)for(te=Be+u*_,H=Be+(u+1)*_,m=1;m<_-2;m++)G[p++]=H+m,G[p++]=te+m,G[p++]=te+m+1,G[p++]=H+m,G[p++]=te+m+1,G[p++]=H+m+1}let $,ee;if(R){if(C)for(ee=y*_,u=1;u<_-2;u++)G[p++]=u,G[p++]=u+1,G[p++]=ee+u+1,G[p++]=u,G[p++]=ee+u+1,G[p++]=ee+u;if(E)for($=y*_-_,ee=y*_*Z-_,u=1;u<_-2;u++)G[p++]=$+u+1,G[p++]=$+u,G[p++]=ee+u,G[p++]=$+u+1,G[p++]=ee+u,G[p++]=ee+u+1}if(A){for(u=1;u<y-2;u++)ee=_*y+_*u,$=_*u,G[p++]=ee,G[p++]=$+_,G[p++]=$,G[p++]=ee,G[p++]=ee+_,G[p++]=$+_;for(u=1;u<y-2;u++)ee=_*y+_*(u+1)-1,$=_*(u+1)-1,G[p++]=$+_,G[p++]=ee,G[p++]=$,G[p++]=$+_,G[p++]=ee+_,G[p++]=ee}let le=new Rn;a.position&&(le.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:F}));let _e=0,he=0,Ze=0,ye=0,Ge=L/2,Ae,Fe=ne.fromCartesian3(t),tt=ne.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<L;u++){Ae=I[u]?tt:Fe;let Be=h.fromArray(F,u*3,Z0t),je=Ae.geodeticSurfaceNormal(Be,R0t);if(N[u]&&h.negate(je,je),a.st){let qe=k.negate(je,E0t);D[_e++]=Math.atan2(qe.y,qe.x)/W.TWO_PI+.5,D[_e++]=Math.asin(je.z)/Math.PI+.5}if(a.normal&&(v[he++]=je.x,v[he++]=je.y,v[he++]=je.z),a.tangent||a.bitangent){let qe=C0t,We=0,Ke;if(I[u]&&(We=Ge),!C&&u>=We&&u<We+_*2?Ke=h.UNIT_X:Ke=h.UNIT_Z,h.cross(Ke,je,qe),h.normalize(qe,qe),a.tangent&&(X[Ze++]=qe.x,X[Ze++]=qe.y,X[Ze++]=qe.z),a.bitangent){let ct=h.cross(je,qe,V0t);h.normalize(ct,ct),Y[ye++]=ct.x,Y[ye++]=ct.y,Y[ye++]=ct.z}}}a.st&&(le.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:D})),a.normal&&(le.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:v})),a.tangent&&(le.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:X})),a.bitangent&&(le.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:Y}))}if(l(e._offsetAttribute)){let Be=F.length,je=e._offsetAttribute===bn.NONE?0:1,qe=new Uint8Array(Be/3).fill(je);le.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}return new At({attributes:le,indices:G,primitiveType:Ie.TRIANGLES,boundingSphere:de.fromEllipsoid(Fe),offsetAttribute:e._offsetAttribute})};var yee;Wg.getUnitEllipsoid=function(){return l(yee)||(yee=Wg.createGeometry(new Wg({radii:new h(1,1,1),vertexFormat:we.POSITION_ONLY}))),yee};var Ha=Wg;var G0t=new Qt(U.WHITE),xee=h.ZERO,Tee=new h,L0t=new h,W0t=new h,_ee=new U,v0t=new h(1,1,1);function F0t(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 ju(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new F0t(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(ju.prototype=Object.create(Wi.prototype),ju.prototype.constructor=ju);Object.defineProperties(ju.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ju.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new Wn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Qn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,_ee)),l(u)||(u=U.WHITE),r=$t.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,xee,Tee))),new Yt({id:i,geometry:new Ha(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};ju.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,_ee),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Wn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(r),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,xee,Tee))),new Yt({id:i,geometry:new Uu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};ju.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};ju.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Wi.prototype._isHidden.call(this,e,t)};ju.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)};ju.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(it.MINIMUM_VALUE,i.radii),i.innerRadii=j.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=j.getValueOrUndefined(t.minimumClock,it.MINIMUM_VALUE),i.maximumClock=j.getValueOrUndefined(t.maximumClock,it.MINIMUM_VALUE),i.minimumCone=j.getValueOrUndefined(t.minimumCone,it.MINIMUM_VALUE),i.maximumCone=j.getValueOrUndefined(t.maximumCone,it.MINIMUM_VALUE),i.stackPartitions=j.getValueOrUndefined(t.stackPartitions,it.MINIMUM_VALUE),i.slicePartitions=j.getValueOrUndefined(t.slicePartitions,it.MINIMUM_VALUE),i.subdivisions=j.getValueOrUndefined(t.subdivisions,it.MINIMUM_VALUE),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};ju.prototype._onEntityPropertyChanged=Tb;ju.DynamicGeometryUpdater=rY;function rY(e,t,n){Li.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new P,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 h,this._material={}}l(Object.create)&&(rY.prototype=Object.create(Li.prototype),rY.prototype.constructor=rY);rY.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,L0t),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,U.BLACK,_ee),c=yr.getValue(e,n.material??G0t,this._material),d=j.getValueOrUndefined(n.innerRadii,e,W0t),u=j.getValueOrUndefined(n.minimumClock,e),m=j.getValueOrUndefined(n.maximumClock,e),p=j.getValueOrUndefined(n.minimumCone,e),b=j.getValueOrUndefined(n.maximumCone,e),f=j.getValueOrUndefined(n.stackPartitions,e),y=j.getValueOrUndefined(n.slicePartitions,e),_=j.getValueOrUndefined(n.subdivisions,e),S=j.getValueOrDefault(n.outlineWidth,e,1),Z=j.getValueOrDefault(n.heightReference,e,He.NONE),R=Z!==He.NONE?bn.ALL:void 0,C=this._scene.mode,E=C===se.SCENE3D&&Z===He.NONE,A=this._options,L=this._geometryUpdater.shadowsProperty.getValue(e),I=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=j.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,xee,Tee);if(!E||this._lastSceneMode!==C||!l(this._primitive)||A.stackPartitions!==f||A.slicePartitions!==y||l(d)&&!h.equals(A.innerRadii!==d)||A.minimumClock!==u||A.maximumClock!==m||A.minimumCone!==p||A.maximumCone!==b||A.subdivisions!==_||this._lastOutlineWidth!==S||A.offsetAttribute!==R){let V=this._primitives;V.removeAndDestroy(this._primitive),V.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=C,this._lastOutlineWidth=S,A.stackPartitions=f,A.slicePartitions=y,A.subdivisions=_,A.offsetAttribute=R,A.radii=h.clone(E?v0t:i,A.radii),l(d)?E?A.innerRadii=h.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,A.innerRadii):A.innerRadii=h.clone(d,A.innerRadii):A.innerRadii=void 0,A.minimumClock=u,A.maximumClock=m,A.minimumCone=p,A.maximumCone=b;let G=new Co({material:c,translucent:c.isTranslucent(),closed:!0});A.vertexFormat=G.vertexFormat;let v=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=V.add(new In({geometryInstances:v,appearance:G,asynchronous:!1,shadows:L}));let X=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=V.add(new In({geometryInstances:X,appearance:new Tn({flat:!0,translucent:X.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(S)}}),asynchronous:!1,shadows:L})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=U.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=I,this._lastOffset=h.clone(N,this._lastOffset)}else if(this._primitive.ready){let V=this._primitive,G=this._outlinePrimitive;V.show=!0,G.show=!0,V.appearance.material=c;let v=this._attributes;l(v)||(v=V.getGeometryInstanceAttributes(t),this._attributes=v),r!==this._lastShow&&(v.show=Wn.toValue(r,v.show),this._lastShow=r);let X=this._outlineAttributes;l(X)||(X=G.getGeometryInstanceAttributes(t),this._outlineAttributes=X),s!==this._lastOutlineShow&&(X.show=Wn.toValue(s,X.show),this._lastOutlineShow=s),U.equals(a,this._lastOutlineColor)||(X.color=$t.toValue(a,X.color),U.clone(a,this._lastOutlineColor)),Ot.equals(I,this._lastDistanceDisplayCondition)||(v.distanceDisplayCondition=Qn.toValue(I,v.distanceDisplayCondition),X.distanceDisplayCondition=Qn.toValue(I,X.distanceDisplayCondition),Ot.clone(I,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(v.offset=Zo.toValue(N,v.offset),X.offset=Zo.toValue(N,v.offset),h.clone(N,this._lastOffset))}E&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=P.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var sY=ju;var jXi=x(T(),1);var xXi=x(T(),1);function PV(e){e=e??B.EMPTY_OBJECT;let t=e.vertexFormat??we.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}PV.packedLength=we.packedLength;PV.pack=function(e,t,n){return n=n??0,we.pack(e._vertexFormat,t,n),t};var QRe=new we,I0t={vertexFormat:QRe};PV.unpack=function(e,t,n){t=t??0;let i=we.unpack(e,t,QRe);return l(n)?(n._vertexFormat=we.clone(i,n._vertexFormat),n):new PV(I0t)};var f3=new h(-.5,-.5,0),p3=new h(.5,.5,0);PV.createGeometry=function(e){let t=e._vertexFormat,n=new Rn,i,o;if(t.position){if(o=new Float64Array(12),o[0]=f3.x,o[1]=f3.y,o[2]=0,o[3]=p3.x,o[4]=f3.y,o[5]=0,o[6]=p3.x,o[7]=p3.y,o[8]=0,o[9]=f3.x,o[10]=p3.y,o[11]=0,n.position=new Xe({componentDatatype:J.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 Xe({componentDatatype:J.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 Xe({componentDatatype:J.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 Xe({componentDatatype:J.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 Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new At({attributes:n,indices:i,primitiveType:Ie.TRIANGLES,boundingSphere:new de(h.ZERO,Math.sqrt(2))})};var aY=PV;var GXi=x(T(),1);function XV(){this._workerName="createPlaneOutlineGeometry"}XV.packedLength=0;XV.pack=function(e,t){return t};XV.unpack=function(e,t,n){return l(n)?n:new XV};var Hx=new h(-.5,-.5,0),b3=new h(.5,.5,0);XV.createGeometry=function(){let e=new Rn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=Hx.x,n[1]=Hx.y,n[2]=Hx.z,n[3]=b3.x,n[4]=Hx.y,n[5]=Hx.z,n[6]=b3.x,n[7]=b3.y,n[8]=Hx.z,n[9]=Hx.x,n[10]=b3.y,n[11]=Hx.z,e.position=new Xe({componentDatatype:J.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 At({attributes:e,indices:t,primitiveType:Ie.LINES,boundingSphere:new de(h.ZERO,Math.sqrt(2))})};var cY=XV;var P0t=new h,qRe=new U;function X0t(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function ah(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new X0t(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(ah.prototype=Object.create(Wi.prototype),ah.prototype.constructor=ah);ah.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let b;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(b=this._materialProperty.color.getValue(e,qRe)),l(b)||(b=U.WHITE),o=$t.fromColor(b),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),m=j.getValueOrDefault(c.plane,e,d.plane),p=j.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=m,d.dimensions=p,u=See(m,p,u,u),new Yt({id:t,geometry:new aY(this._options),modelMatrix:u,attributes:i})};ah.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,qRe),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=See(c,d,a,a),new Yt({id:t,geometry:new cY,modelMatrix:a,attributes:{show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o)}})};ah.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Wi.prototype._isHidden.call(this,e,t)};ah.prototype._getIsClosed=function(e){return!1};ah.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};ah.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=this._options;i.vertexFormat=n?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(it.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(it.MINIMUM_VALUE,i.dimensions)};ah.DynamicGeometryUpdater=NV;function NV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(NV.prototype=Object.create(Li.prototype),NV.prototype.constructor=NV);NV.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,P0t);return!l(o)||!l(i.plane)||!l(i.dimensions)||Li.prototype._isHidden.call(this,e,t,n)};NV.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 N0t=new h,Y0t=new h,w0t=new h,M0t=new h,k0t=new q,U0t=new q,D0t=new P;function See(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,w0t),a=h.clone(h.UNIT_Z,Y0t);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,N0t);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=k0t;q.setColumn(d,0,c,d),q.setColumn(d,1,a,d),q.setColumn(d,2,o,d);let u=h.fromElements(t.x,t.y,1,M0t),m=q.multiplyByScale(d,u,U0t),p=P.fromRotationTranslation(m,s,D0t);return P.multiplyTransformation(n,p,i)}ah.createPrimitiveMatrix=See;var lY=ah;var yYi=x(T(),1);var _Ni=x(T(),1);var O0t=new h,B0t=new nt,z0t=new k,H0t=new k,K0t=new h,J0t=new h,j0t=new h,dY=new h,Q0t=new h,q0t=new h,$Re=new Ne,$0t=new q,ebt=new q,tbt=new h;function nbt(e,t,n,i,o,r,s,a,c){let d=e.positions,u=mi.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let m=Oe.createTypedArray(d.length,u.length);m.set(u);let p=$0t;if(i!==0){let g=Ne.fromAxisAngle(s,i,$Re);if(p=q.fromQuaternion(g,p),t.tangent||t.bitangent){g=Ne.fromAxisAngle(s,-i,$Re);let V=q.fromQuaternion(g,ebt);a=h.normalize(q.multiplyByVector(V,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=q.clone(q.IDENTITY,p);let b=H0t;t.st&&(b.x=n.x,b.y=n.y);let f=d.length,y=f*3,_=new Float64Array(y),S=t.normal?new Float32Array(y):void 0,Z=t.tangent?new Float32Array(y):void 0,R=t.bitangent?new Float32Array(y):void 0,C=t.st?new Float32Array(f*2):void 0,E=0,A=0,L=0,F=0,I=0;for(let g=0;g<f;g++){let V=d[g];if(_[E++]=V.x,_[E++]=V.y,_[E++]=V.z,t.st)if(l(o)&&o.positions.length===f)C[I++]=o.positions[g].x,C[I++]=o.positions[g].y;else{let G=q.multiplyByVector(p,V,O0t),v=r(G,z0t);k.subtract(v,b,v);let X=W.clamp(v.x/n.width,0,1),Y=W.clamp(v.y/n.height,0,1);C[I++]=X,C[I++]=Y}t.normal&&(S[A++]=s.x,S[A++]=s.y,S[A++]=s.z),t.tangent&&(Z[F++]=a.x,Z[F++]=a.y,Z[F++]=a.z),t.bitangent&&(R[L++]=c.x,R[L++]=c.y,R[L++]=c.z)}let N=new Rn;return t.position&&(N.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_})),t.normal&&(N.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:S})),t.tangent&&(N.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:Z})),t.bitangent&&(N.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:R})),t.st&&(N.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:C})),new At({attributes:N,indices:m,primitiveType:Ie.TRIANGLES})}function eZ(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??we.DEFAULT;this._vertexFormat=we.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=oi.computeHierarchyPackedLength(t,h)+we.packedLength+ne.packedLength+(l(n)?oi.computeHierarchyPackedLength(n,k):1)+2}eZ.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new eZ(t)};eZ.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=oi.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n]=e.packedLength,t};var ibt=ne.clone(ne.UNIT_SPHERE),obt=new we,rbt={polygonHierarchy:{}};eZ.unpack=function(e,t,n){t=t??0;let i=oi.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,ibt);t+=ne.packedLength;let r=we.unpack(e,t,obt);t+=we.packedLength;let s=e[t++],a=e[t]===-1?void 0:oi.unpackPolygonHierarchy(e,t,k);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new eZ(rbt)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};eZ.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Yo(s,h.equalsEpsilon,!0),s.length<3)return;let a=K0t,c=J0t,d=j0t,u=Q0t,m=q0t;if(!dg.computeProjectTo2DArguments(s,dY,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(dY,h.ZERO,W.EPSILON6)){let I=e._ellipsoid.geodeticSurfaceNormal(dY,tbt);h.dot(a,I)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let b=dg.createProjectPointsTo2DFunction(dY,u,m),f=dg.createProjectPointTo2DFunction(dY,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(d=h.clone(m,d));let y=oi.polygonsFromHierarchy(n,r,b,!1),_=y.hierarchy,S=y.polygons,Z=function(I){return I},R=r?oi.polygonsFromHierarchy(o,!0,Z,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let C=de.fromPoints(s),E=oi.computeBoundingRectangle(a,f,s,i,B0t),A=[];for(let I=0;I<S.length;I++){let N=new Yt({geometry:nbt(S[I],t,E,i,r?R[I]:void 0,f,a,c,d)});A.push(N)}let L=zn.combineInstances(A)[0];L.attributes.position.values=new Float64Array(L.attributes.position.values),L.indices=Oe.createTypedArray(L.attributes.position.values.length/3,L.indices);let F=L.attributes;return t.position||delete F.position,new At({attributes:F,indices:L.indices,primitiveType:L.primitiveType,boundingSphere:C})};var uY=eZ;var DNi=x(T(),1);var e1e=[],g3=[];function sbt(e,t,n,i,o){let s=ws.fromPoints(t,e).projectPointsOntoPlane(t,e1e);mi.computeWindingOrder2D(s)===qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],y=t[(d+1)%u];c[m++]=f.x,c[m++]=f.y,c[m++]=f.z,c[m++]=y.x,c[m++]=y.y,c[m++]=y.z}else{let f=0;if(o===un.GEODESIC)for(d=0;d<u;d++)f+=oi.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===un.RHUMB)for(d=0;d<u;d++)f+=oi.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let y;o===un.GEODESIC?y=oi.subdivideLine(t[d],t[(d+1)%u],n,g3):o===un.RHUMB&&(y=oi.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,g3));let _=y.length;for(let S=0;S<_;++S)c[m++]=y[S]}}u=c.length/3;let p=u*2,b=Oe.createTypedArray(u,p);for(m=0,d=0;d<u-1;d++)b[m++]=d,b[m++]=d+1;return b[m++]=u-1,b[m]=0,new Yt({geometry:new At({attributes:new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:b,primitiveType:Ie.LINES})})}function abt(e,t,n,i,o){let s=ws.fromPoints(t,e).projectPointsOntoPlane(t,e1e);mi.computeWindingOrder2D(s)===qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){m[d]=p/3;let _=t[d],S=t[(d+1)%u];c[p++]=_.x,c[p++]=_.y,c[p++]=_.z,c[p++]=S.x,c[p++]=S.y,c[p++]=S.z}else{let _=0;if(o===un.GEODESIC)for(d=0;d<u;d++)_+=oi.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===un.RHUMB)for(d=0;d<u;d++)_+=oi.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(_*3*2),d=0;d<u;++d){m[d]=p/3;let S;o===un.GEODESIC?S=oi.subdivideLine(t[d],t[(d+1)%u],n,g3):o===un.RHUMB&&(S=oi.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,g3));let Z=S.length;for(let R=0;R<Z;++R)c[p++]=S[R]}}u=c.length/6;let b=m.length,f=(u*2+b)*2,y=Oe.createTypedArray(u+b,f);for(p=0,d=0;d<u;++d)y[p++]=d,y[p++]=(d+1)%u,y[p++]=d+u,y[p++]=(d+1)%u+u;for(d=0;d<b;d++){let _=m[d];y[p++]=_,y[p++]=_+u}return new Yt({geometry:new At({attributes:new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Ie.LINES})})}function tZ(e){let t=e.polygonHierarchy,n=e.ellipsoid??ne.default,i=e.granularity??W.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??un.GEODESIC,a=e.height??0,c=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=oi.computeHierarchyPackedLength(t,h)+ne.packedLength+8}tZ.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var cbt=ne.clone(ne.UNIT_SPHERE),lbt={polygonHierarchy:{}};tZ.unpack=function(e,t,n){t=t??0;let i=oi.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,cbt);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],m=e[t++],p=e[t];return l(n)||(n=new tZ(lbt)),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=m===-1?void 0:m,n.packedLength=p,n};tZ.fromPositions=function(e){e=e??B.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 tZ(t)};tZ.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=oi.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=W.chordLength(n,t.maximumRadius),u=e._height,m=e._extrudedHeight,p=e._perPositionHeightExtrude||!W.equalsEpsilon(u,m,0,W.EPSILON2),b,f;if(p)for(f=0;f<s.length;f++){if(a=abt(t,s[f],d,o,r),a.geometry=oi.scaleToGeodeticHeightExtruded(a.geometry,u,m,t,o),l(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length/3,Z=new Uint8Array(S);e._offsetAttribute===bn.TOP?Z=Z.fill(1,0,S/2):(b=e._offsetAttribute===bn.NONE?0:1,Z=Z.fill(b)),a.geometry.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z})}c.push(a)}else for(f=0;f<s.length;f++){if(a=sbt(t,s[f],d,o,r),a.geometry.attributes.position.values=mi.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length;b=e._offsetAttribute===bn.NONE?0:1;let Z=new Uint8Array(S/3).fill(b);a.geometry.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z})}c.push(a)}let y=zn.combineInstances(c)[0],_=de.fromVertices(y.attributes.position.values);return new At({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var mY=tZ;var t1e="Entity polygons cannot have both height and perPositionHeight. height will be ignored",n1e="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",i1e=new U,o1e=h.ZERO,r1e=new h,s1e=new re,dbt=[],ubt=new k;function mbt(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 Qu(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new mbt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Qu.prototype=Object.create(ri.prototype),Qu.prototype.constructor=Qu);Qu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,i1e)),l(s)||(s=U.WHITE),o.color=$t.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,o1e,r1e)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new uY(i):r=new kp(i),new Yt({id:t,geometry:r,attributes:o})};Qu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,i1e),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(o),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,o1e,r1e)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new $m(i):a=new mY(i),new Yt({id:t,geometry:a,attributes:s})};Qu.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=ws.fromPoints(i,o),s=r.projectPointsOntoPlane(i,dbt),a=s.length,c=0,d=a-1,u=new k;for(let p=0;p<a;d=p++){let b=s[p],f=s[d],y=b.x*f.y-f.x*b.y,_=k.add(b,f,ubt);_=k.multiplyByScalar(_,y,_),u=k.add(u,_,u),c+=y}let m=1/(c*3);return u=k.multiplyByScalar(u,m,u),r.projectPointOntoEllipsoid(u,t)};Qu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Wi.prototype._isHidden.call(this,e,t)};Qu.prototype._isOnTerrain=function(e,t){let n=ri.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(it.MINIMUM_VALUE):!0);return n&&!o};Qu.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 Qt)};Qu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=this._options;i.vertexFormat=n?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(it.MINIMUM_VALUE),r=j.getValueOrUndefined(t.height,it.MINIMUM_VALUE),s=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),a=j.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),c=j.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,He.NONE),d=j.getValueOrDefault(t.perPositionHeight,it.MINIMUM_VALUE,!1);r=ri.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,xt(t1e)),s!==He.NONE&&d&&(r=void 0,xt(n1e))):(l(a)&&!l(r)&&(r=0),u=ri.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=j.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),i.stRotation=j.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=j.getValueOrDefault(t.closeTop,it.MINIMUM_VALUE,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,it.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=j.getValueOrDefault(t.arcType,it.MINIMUM_VALUE,un.GEODESIC),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,it.MINIMUM_VALUE),a=ri.getGeometryExtrudedHeight(a,c),a===ri.CLAMP_TO_GROUND){let m=kp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,s1e);a=Pi.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};Qu.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)};Qu.DynamicGeometryUpdater=YV;function YV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(YV.prototype=Object.create(Li.prototype),YV.prototype.constructor=YV);YV.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Li.prototype._isHidden.call(this,e,t,n)};YV.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,He.NONE),s=j.getValueOrDefault(t.extrudedHeightReference,n,He.NONE),a=j.getValueOrUndefined(t.extrudedHeight,n),c=j.getValueOrUndefined(t.perPositionHeight,n);o=ri.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,xt(t1e)),r!==He.NONE&&c&&(o=void 0,xt(n1e))):(l(a)&&!l(o)&&(o=0),d=ri.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,un.GEODESIC),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND){let u=kp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,s1e);a=Pi.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var hY=Qu;var Vwi=x(T(),1);var UYi=x(T(),1);function hbt(e,t,n,i){let o=new Rn;i.position&&(o.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=mi.triangulate(t),d=(a-1)*r*6+c.length*2,u=Oe.createTypedArray(s,d),m,p,b,f,y,_,S=r*2,Z=0;for(m=0;m<a-1;m++){for(p=0;p<r-1;p++)b=p*2+m*r*2,_=b+S,f=b+1,y=f+S,u[Z++]=f,u[Z++]=b,u[Z++]=y,u[Z++]=y,u[Z++]=b,u[Z++]=_;b=r*2-2+m*r*2,f=b+1,y=f+S,_=b+S,u[Z++]=f,u[Z++]=b,u[Z++]=y,u[Z++]=y,u[Z++]=b,u[Z++]=_}if(i.st||i.tangent||i.bitangent){let E=new Float32Array(s*2),A=1/(a-1),L=1/n.height,F=n.height/2,I,N,g=0;for(m=0;m<a;m++){for(I=m*A,N=L*(t[0].y+F),E[g++]=I,E[g++]=N,p=1;p<r;p++)N=L*(t[p].y+F),E[g++]=I,E[g++]=N,E[g++]=I,E[g++]=N;N=L*(t[0].y+F),E[g++]=I,E[g++]=N}for(p=0;p<r;p++)I=0,N=L*(t[p].y+F),E[g++]=I,E[g++]=N;for(p=0;p<r;p++)I=(a-1)*A,N=L*(t[p].y+F),E[g++]=I,E[g++]=N;o.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}let R=s-r*2;for(m=0;m<c.length;m+=3){let E=c[m]+R,A=c[m+1]+R,L=c[m+2]+R;u[Z++]=E,u[Z++]=A,u[Z++]=L,u[Z++]=L+r,u[Z++]=A+r,u[Z++]=E+r}let C=new At({attributes:o,indices:u,boundingSphere:de.fromVertices(e),primitiveType:Ie.TRIANGLES});if(i.normal&&(C=zn.computeNormal(C)),i.tangent||i.bitangent){try{C=zn.computeTangentAndBitangent(C)}catch{xt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(C.attributes.tangent=void 0),i.bitangent||(C.attributes.bitangent=void 0),i.st||(C.attributes.st=void 0)}return C}function pY(e){e=e??B.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._cornerType=e.cornerType??ro.ROUNDED,this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+ne.packedLength+we.packedLength+2}pY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=k.packedLength)k.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var a1e=ne.clone(ne.UNIT_SPHERE),c1e=new we,fY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:a1e,vertexFormat:c1e,cornerType:void 0,granularity:void 0};pY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=k.packedLength)s[i]=k.unpack(e,t);let a=ne.unpack(e,t,a1e);t+=ne.packedLength;let c=we.unpack(e,t,c1e);t+=we.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=we.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(fY.polylinePositions=r,fY.shapePositions=s,fY.cornerType=d,fY.granularity=u,new pY(fY))};var fbt=new nt;pY.createGeometry=function(e){let t=e._positions,n=Yo(t,h.equalsEpsilon),i=e._shape;if(i=Cf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,fbt),r=Cf.computePositions(n,i,o,e,!0);return hbt(r,i,o,e._vertexFormat)};var bY=pY;var lwi=x(T(),1);function pbt(e,t){let n=new Rn;n.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Oe.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let m=c*i;for(d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=s-1,m=c*i,d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=0;c<s-1;c++){let b=i*c,f=b+i;for(d=0;d<i;d++)a[u++]=d+b,a[u++]=d+f}return new At({attributes:n,indices:Oe.createTypedArray(o,a),boundingSphere:de.fromVertices(e),primitiveType:Ie.LINES})}function yY(e){e=e??B.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._cornerType=e.cornerType??ro.ROUNDED,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+ne.packedLength+2}yY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=k.packedLength)k.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 l1e=ne.clone(ne.UNIT_SPHERE),gY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:l1e,height:void 0,cornerType:void 0,granularity:void 0};yY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=k.packedLength)s[i]=k.unpack(e,t);let a=ne.unpack(e,t,l1e);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):(gY.polylinePositions=r,gY.shapePositions=s,gY.cornerType=c,gY.granularity=d,new yY(gY))};var bbt=new nt;yY.createGeometry=function(e){let t=e._positions,n=Yo(t,h.equalsEpsilon),i=e._shape;if(i=Cf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,bbt),r=Cf.computePositions(n,i,o,e,!1);return pbt(r,i)};var xY=yY;var d1e=new U;function gbt(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 s0(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new gbt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(s0.prototype=Object.create(Wi.prototype),s0.prototype.constructor=s0);s0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,d1e)),l(c)||(c=U.WHITE),o=$t.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Yt({id:t,geometry:new bY(this._options),attributes:i})};s0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,d1e),o=this._distanceDisplayConditionProperty.getValue(e);return new Yt({id:t,geometry:new xY(this._options),attributes:{show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o)}})};s0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Wi.prototype._isHidden.call(this,e,t)};s0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!j.isConstant(t.granularity)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)};s0.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Qt;o.vertexFormat=r?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(it.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(it.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(it.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(it.MINIMUM_VALUE):void 0};s0.DynamicGeometryUpdater=wV;function wV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(wV.prototype=Object.create(Li.prototype),wV.prototype.constructor=wV);wV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Li.prototype._isHidden.call(this,e,t,n)};wV.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 TY=s0;var ZMi=x(T(),1);var qwi=x(T(),1);var Zee=new h,h1e=new h,f1e=new h,p1e=new h,b1e=new re,ybt=new k,xbt=new de,Tbt=new de;function g1e(e,t){let n=new At({attributes:new Rn,primitiveType:Ie.TRIANGLES});return n.attributes.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function _bt(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=p1e,u=f1e,m=h1e;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let b=h.fromArray(e,p,Zee),f=c+1,y=c+2;m=n.geodeticSurfaceNormal(b,m),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,m,u),q.multiplyByVector(i,u,u),h.normalize(u,u),t.bitangent&&h.normalize(h.cross(m,u,d),d)),t.normal&&(r[c]=m.x,r[f]=m.y,r[y]=m.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[y]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[y]=d.z),c+=3}return g1e(t,{positions:e,normals:r,tangents:s,bitangents:a})}var Ree=new h,y1e=new h;function Sbt(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,m=p1e,p=f1e,b=h1e;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let y=h.fromArray(e,f,Zee),_=h.fromArray(e,(f+6)%i,Ree);if(u){let S=h.fromArray(e,(f+3)%i,y1e);h.subtract(_,y,_),h.subtract(S,y,S),b=h.normalize(h.cross(S,_,b),b),u=!1}h.equalsEpsilon(_,y,W.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(m=n.geodeticSurfaceNormal(y,m),t.tangent&&(p=h.normalize(h.cross(m,b,p),p))),t.normal&&(o[a++]=b.x,o[a++]=b.y,o[a++]=b.z,o[a++]=b.x,o[a++]=b.y,o[a++]=b.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++]=m.x,s[d++]=m.y,s[d++]=m.z,s[d++]=m.x,s[d++]=m.y,s[d++]=m.z)}return g1e(t,{positions:e,normals:o,tangents:r,bitangents:s})}function x1e(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,m=0;s&&(c=1,u-=1,m+=1),a&&(d-=1,u-=1,m+=1),m+=r*u;let p=n.position?new Float64Array(m*3):void 0,b=n.st?new Float32Array(m*2):void 0,f=0,y=0,_=Zee,S=ybt,Z=Number.MAX_VALUE,R=Number.MAX_VALUE,C=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let V=c;V<d;++V)for(let G=0;G<r;++G)Ca.computePosition(t,i,n.st,V,G,_,S),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(b[y++]=S.x,b[y++]=S.y,Z=Math.min(Z,S.x),R=Math.min(R,S.y),C=Math.max(C,S.x),E=Math.max(E,S.y));if(s&&(Ca.computePosition(t,i,n.st,0,0,_,S),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(b[y++]=S.x,b[y++]=S.y,Z=S.x,R=S.y,C=S.x,E=S.y)),a&&(Ca.computePosition(t,i,n.st,o-1,0,_,S),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(b[y++]=S.x,b[y]=S.y,Z=Math.min(Z,S.x),R=Math.min(R,S.y),C=Math.max(C,S.x),E=Math.max(E,S.y))),n.st&&(Z<0||R<0||C>1||E>1))for(let V=0;V<b.length;V+=2)b[V]=(b[V]-Z)/(C-Z),b[V+1]=(b[V+1]-R)/(E-R);let A=_bt(p,n,i,t.tangentRotationMatrix),L=6*(r-1)*(u-1);s&&(L+=3*(r-1)),a&&(L+=3*(r-1));let F=Oe.createTypedArray(m,L),I=0,N=0,g;for(g=0;g<u-1;++g){for(let V=0;V<r-1;++V){let G=I,v=G+r,X=v+1,Y=G+1;F[N++]=G,F[N++]=v,F[N++]=Y,F[N++]=Y,F[N++]=v,F[N++]=X,++I}++I}if(s||a){let V=m-1,G=m-1;s&&a&&(V=m-2);let v,X;if(I=0,s)for(g=0;g<r-1;g++)v=I,X=v+1,F[N++]=V,F[N++]=v,F[N++]=X,++I;if(a)for(I=(u-1)*r,g=0;g<r-1;g++)v=I,X=v+1,F[N++]=v,F[N++]=G,F[N++]=X,++I}return A.indices=F,n.st&&(A.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:b})),A}function MV(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 kV(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 Cee=new we;function Zbt(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 We=we.clone(o,Cee);We.normal=!0,e._vertexFormat=We}let m=x1e(e,t);n&&(e._vertexFormat=o);let p=mi.scaleToGeodeticHeight(m.attributes.position.values,s,a,!1);p=new Float64Array(p);let b=p.length,f=b*2,y=new Float64Array(f);y.set(p);let _=mi.scaleToGeodeticHeight(m.attributes.position.values,r,a);y.set(_,b),m.attributes.position.values=y;let S=o.normal?new Float32Array(f):void 0,Z=o.tangent?new Float32Array(f):void 0,R=o.bitangent?new Float32Array(f):void 0,C=o.st?new Float32Array(f/3*2):void 0,E,A;if(o.normal){for(A=m.attributes.normal.values,S.set(A),u=0;u<b;u++)A[u]=-A[u];S.set(A,b),m.attributes.normal.values=S}if(n){A=m.attributes.normal.values,o.normal||(m.attributes.normal=void 0);let We=new Float32Array(f);for(u=0;u<b;u++)A[u]=-A[u];We.set(A,b),m.attributes.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:We})}let L,F=l(i);if(F){let We=b/3*2,Ke=new Uint8Array(We);i===bn.TOP?Ke=Ke.fill(1,0,We/2):(L=i===bn.NONE?0:1,Ke=Ke.fill(L)),m.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}if(o.tangent){let We=m.attributes.tangent.values;for(Z.set(We),u=0;u<b;u++)We[u]=-We[u];Z.set(We,b),m.attributes.tangent.values=Z}if(o.bitangent){let We=m.attributes.bitangent.values;R.set(We),R.set(We,b),m.attributes.bitangent.values=R}o.st&&(E=m.attributes.st.values,C.set(E),C.set(E,b/3*2),m.attributes.st.values=C);let I=m.indices,N=I.length,g=b/3,V=Oe.createTypedArray(f/3,N*2);for(V.set(I),u=0;u<N;u+=3)V[u+N]=I[u+2]+g,V[u+1+N]=I[u+1]+g,V[u+2+N]=I[u]+g;m.indices=V;let G=t.northCap,v=t.southCap,X=c,Y=2,D=0,w=4,O=4;G&&(Y-=1,X-=1,D+=1,w-=2,O-=1),v&&(Y-=1,X-=1,D+=1,w-=2,O-=1),D+=Y*d+2*X-w;let M=(D+O)*2,z=new Float64Array(M*3),K=n?new Float32Array(M*3):void 0,te=F?new Uint8Array(M):void 0,H=o.st?new Float32Array(M*2):void 0,$=i===bn.TOP;F&&!$&&(L=i===bn.ALL?1:0,te=te.fill(L));let ee=0,le=0,_e=0,he=0,Ze=d*X,ye;for(u=0;u<Ze;u+=d)ye=u*3,z=MV(z,ee,ye,p,_),ee+=6,o.st&&(H=kV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);if(v){let We=G?Ze+1:Ze;for(ye=We*3,u=0;u<2;u++)z=MV(z,ee,ye,p,_),ee+=6,o.st&&(H=kV(H,le,We*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1)}else for(u=Ze-d;u<Ze;u++)ye=u*3,z=MV(z,ee,ye,p,_),ee+=6,o.st&&(H=kV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);for(u=Ze-1;u>0;u-=d)ye=u*3,z=MV(z,ee,ye,p,_),ee+=6,o.st&&(H=kV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);if(G){let We=Ze;for(ye=We*3,u=0;u<2;u++)z=MV(z,ee,ye,p,_),ee+=6,o.st&&(H=kV(H,le,We*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1)}else for(u=d-1;u>=0;u--)ye=u*3,z=MV(z,ee,ye,p,_),ee+=6,o.st&&(H=kV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);let Ge=Sbt(z,o,a);o.st&&(Ge.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:H})),n&&(Ge.attributes.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:K})),F&&(Ge.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ae=Oe.createTypedArray(M,D*6),Fe,tt,Be,je;b=z.length/3;let qe=0;for(u=0;u<b-1;u+=2){Fe=u,je=(Fe+2)%b;let We=h.fromArray(z,Fe*3,Ree),Ke=h.fromArray(z,je*3,y1e);h.equalsEpsilon(We,Ke,W.EPSILON10)||(tt=(Fe+1)%b,Be=(tt+2)%b,Ae[qe++]=Fe,Ae[qe++]=tt,Ae[qe++]=je,Ae[qe++]=je,Ae[qe++]=tt,Ae[qe++]=Be)}return Ge.indices=Ae,Ge=zn.combineInstances([new Yt({geometry:m}),new Yt({geometry:Ge})]),Ge[0]}var Rbt=[new h,new h,new h,new h],T1e=new pe,Cbt=new pe;function Vee(e,t,n,i,o){if(n===0)return re.clone(e,o);let r=Ca.computeOptions(e,t,n,0,b1e,T1e),s=r.height,a=r.width,c=Rbt;return Ca.computePosition(r,i,!1,0,0,c[0]),Ca.computePosition(r,i,!1,0,a-1,c[1]),Ca.computePosition(r,i,!1,s-1,0,c[2]),Ca.computePosition(r,i,!1,s-1,a-1,c[3]),re.fromCartesianArray(c,i,o)}function a0(e){e=e??B.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=re.clone(t),this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}a0.packedLength=re.packedLength+ne.packedLength+we.packedLength+7;a0.pack=function(e,t,n){return n=n??0,re.pack(e._rectangle,t,n),n+=re.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.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]=e._offsetAttribute??-1,t};var _1e=new re,S1e=ne.clone(ne.UNIT_SPHERE),Kx={rectangle:_1e,ellipsoid:S1e,vertexFormat:Cee,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};a0.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,_1e);t+=re.packedLength;let o=ne.unpack(e,t,S1e);t+=ne.packedLength;let r=we.unpack(e,t,Cee);t+=we.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++]===1,p=e[t];return l(n)?(n._rectangle=re.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=we.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=m,n._offsetAttribute=p===-1?void 0:p,n):(Kx.granularity=s,Kx.height=a,Kx.rotation=c,Kx.stRotation=d,Kx.extrudedHeight=u,Kx.shadowVolume=m,Kx.offsetAttribute=p===-1?void 0:p,new a0(Kx))};a0.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??W.RADIANS_PER_DEGREE,o=e.ellipsoid??ne.default,r=e.rotation??0;return Vee(n,i,r,o,t)};var Vbt=new q,u1e=new Ne,Ebt=new pe;a0.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=Ca.computeOptions(t,e._granularity,i,o,b1e,T1e,Cbt),a=Vbt;if(o!==0||i!==0){let b=re.center(t,Ebt),f=n.geodeticSurfaceNormalCartographic(b,Ree);Ne.fromAxisAngle(f,-o,u1e),q.fromQuaternion(u1e,a)}else q.clone(q.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 m,p;if(t=e._rectangle,u){m=Zbt(e,s);let b=de.fromRectangle3D(t,n,c,Tbt),f=de.fromRectangle3D(t,n,d,xbt);p=de.union(b,f)}else{if(m=x1e(e,s),m.attributes.position.values=mi.scaleToGeodeticHeight(m.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let b=m.attributes.position.values.length,f=e._offsetAttribute===bn.NONE?0:1,y=new Uint8Array(b/3).fill(f);m.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=de.fromRectangle3D(t,n,c)}return r.position||delete m.attributes.position,new At({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};a0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new a0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};var m1e=new re,Abt=[new k,new k,new k],Gbt=new Ji,Lbt=new pe;function Wbt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=re.clone(e._rectangle,m1e),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=Vee(t,n,o,i,m1e),s=Abt;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=Ji.fromRotation(e._stRotation,Gbt),d=re.center(a,Lbt);for(let f=0;f<3;++f){let y=s[f];y.x-=d.longitude,y.y-=d.latitude,Ji.multiplyByVector(c,y,y),y.x+=d.longitude,y.y+=d.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let u=s[0],m=s[1],p=s[2],b=new Array(6);return k.pack(u,b),k.pack(m,b,2),k.pack(p,b,4),b}Object.defineProperties(a0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=Vee(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Wbt(this)),this._textureCoordinateRotationPoints}}});var nZ=a0;var Z1e=new U,R1e=h.ZERO,C1e=new h,V1e=new re,vbt=new re,Fbt=new pe;function Ibt(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 If(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Ibt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(If.prototype=Object.create(ri.prototype),If.prototype.constructor=If);If.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Z1e)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,R1e,C1e))),new Yt({id:t,geometry:new nZ(this._options),attributes:i})};If.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Z1e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,R1e,C1e))),new Yt({id:t,geometry:new FS(this._options),attributes:r})};If.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.rectangle.coordinates,e,vbt);if(!l(n))return;let i=re.center(n,Fbt);return pe.toCartesian(i,ne.default,t)};If.prototype._isHidden=function(e,t){return!l(t.coordinates)||Wi.prototype._isHidden.call(this,e,t)};If.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 Qt)};If.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=j.getValueOrUndefined(t.height,it.MINIMUM_VALUE),o=j.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,He.NONE),r=j.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),s=j.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,He.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(it.MINIMUM_VALUE,a.rectangle),a.granularity=j.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),a.stRotation=j.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),a.rotation=j.getValueOrUndefined(t.rotation,it.MINIMUM_VALUE),a.offsetAttribute=ri.computeGeometryOffsetAttribute(i,o,r,s),a.height=ri.getGeometryHeight(i,o),r=ri.getGeometryExtrudedHeight(r,s),r===ri.CLAMP_TO_GROUND&&(r=Pi.getMinimumMaximumHeights(nZ.computeRectangle(a,V1e)).minimumTerrainHeight),a.extrudedHeight=r};If.DynamicGeometryUpdater=UV;function UV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(UV.prototype=Object.create(Li.prototype),UV.prototype.constructor=UV);UV.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Li.prototype._isHidden.call(this,e,t,n)};UV.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,He.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=ri.computeGeometryOffsetAttribute(o,r,s,a),i.height=ri.getGeometryHeight(o,r),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND&&(s=Pi.getMinimumMaximumHeights(nZ.computeRectangle(i,V1e)).minimumTerrainHeight),i.extrudedHeight=s};var _Y=If;var Cki=x(T(),1);var HMi=x(T(),1);var WMi=x(T(),1);var E1e={};function Pbt(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var Xbt=new pe,Nbt=new pe;function Ybt(e,t,n,i){t=Yo(t,h.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 m=e.cartesianToCartographic(u,Xbt);s&&(m.height=n[0]),c[0]=m.height,r?d[0]=i[0]:d[0]=0;let p=c[0],b=d[0],f=p===b,y=1;for(let _=1;_<o;++_){let S=t[_],Z=e.cartesianToCartographic(S,Nbt);s&&(Z.height=n[_]),f=f&&Z.height===0,Pbt(m,Z)?m.height<Z.height&&(c[y-1]=Z.height):(a[y]=S,c[y]=Z.height,r?d[y]=i[_]:d[y]=0,f=f&&c[y]===d[y],pe.clone(Z,m),++y)}if(!(f||y<2))return a.length=y,c.length=y,d.length=y,{positions:a,topHeights:c,bottomHeights:d}}var wbt=new Array(2),Mbt=new Array(2),kbt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};E1e.computePositions=function(e,t,n,i,o,r){let s=Ybt(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,m=W.chordLength(o,e.maximumRadius),p=kbt;if(p.minDistance=m,p.ellipsoid=e,r){let b=0,f;for(f=0;f<a-1;f++)b+=oo.numberOfPoints(t[f],t[f+1],m)+1;d=new Float64Array(b*3),u=new Float64Array(b*3);let y=wbt,_=Mbt;p.positions=y,p.height=_;let S=0;for(f=0;f<a-1;f++){y[0]=t[f],y[1]=t[f+1],_[0]=n[f],_[1]=n[f+1];let Z=oo.generateArc(p);d.set(Z,S),_[0]=i[f],_[1]=i[f+1],u.set(oo.generateArc(p),S),S+=Z.length}}else p.positions=t,p.height=n,d=new Float64Array(oo.generateArc(p)),p.height=i,u=new Float64Array(oo.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var iZ=E1e;var Eee=new h,y3=new h,Ubt=new h,A1e=new h,Dbt=new h,Obt=new h,Bbt=new h;function oZ(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??we.DEFAULT,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=we.clone(o),this._granularity=r,this._ellipsoid=ne.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ne.packedLength+we.packedLength+1}oZ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.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,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n]=e._granularity,t};var G1e=ne.clone(ne.UNIT_SPHERE),L1e=new we,SY={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G1e,vertexFormat:L1e,granularity:void 0};oZ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.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,G1e);t+=ne.packedLength;let d=we.unpack(e,t,L1e);t+=we.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=we.clone(d,n._vertexFormat),n._granularity=u,n):(SY.positions=r,SY.minimumHeights=s,SY.maximumHeights=a,SY.granularity=u,new oZ(SY))};oZ.fromConstantHeights=function(e){e=e??B.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 oZ(c)};oZ.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=iZ.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,m=d.length,p=m*2,b=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,_=o.bitangent?new Float32Array(p):void 0,S=o.st?new Float32Array(p/3*2):void 0,Z=0,R=0,C=0,E=0,A=0,L=Bbt,F=Obt,I=Dbt,N=!0;m/=3;let g,V=0,G=1/(m-u-1);for(g=0;g<m;++g){let w=g*3,O=h.fromArray(d,w,Eee),M=h.fromArray(c,w,y3);if(o.position&&(b[Z++]=M.x,b[Z++]=M.y,b[Z++]=M.z,b[Z++]=O.x,b[Z++]=O.y,b[Z++]=O.z),o.st&&(S[A++]=V,S[A++]=0,S[A++]=V,S[A++]=1),o.normal||o.tangent||o.bitangent){let z=h.clone(h.ZERO,A1e),K=h.subtract(O,s.geodeticSurfaceNormal(O,y3),y3);if(g+1<m&&(z=h.fromArray(d,w+3,A1e)),N){let te=h.subtract(z,O,Ubt),H=h.subtract(K,O,Eee);L=h.normalize(h.cross(H,te,L),L),N=!1}h.equalsEpsilon(O,z,W.EPSILON10)?N=!0:(V+=G,o.tangent&&(F=h.normalize(h.subtract(z,O,F),F)),o.bitangent&&(I=h.normalize(h.cross(L,F,I),I))),o.normal&&(f[R++]=L.x,f[R++]=L.y,f[R++]=L.z,f[R++]=L.x,f[R++]=L.y,f[R++]=L.z),o.tangent&&(y[E++]=F.x,y[E++]=F.y,y[E++]=F.z,y[E++]=F.x,y[E++]=F.y,y[E++]=F.z),o.bitangent&&(_[C++]=I.x,_[C++]=I.y,_[C++]=I.z,_[C++]=I.x,_[C++]=I.y,_[C++]=I.z)}}let v=new Rn;o.position&&(v.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:b})),o.normal&&(v.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(v.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(v.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(v.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:S}));let X=p/3;p-=6*(u+1);let Y=Oe.createTypedArray(X,p),D=0;for(g=0;g<X-2;g+=2){let w=g,O=g+2,M=h.fromArray(b,w*3,Eee),z=h.fromArray(b,O*3,y3);if(h.equalsEpsilon(M,z,W.EPSILON10))continue;let K=g+1,te=g+3;Y[D++]=K,Y[D++]=w,Y[D++]=te,Y[D++]=te,Y[D++]=w,Y[D++]=O}return new At({attributes:v,indices:Y,primitiveType:Ie.TRIANGLES,boundingSphere:de.fromVertices(b)})};var ZY=oZ;var cki=x(T(),1);var W1e=new h,v1e=new h;function rZ(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??W.RADIANS_PER_DEGREE,r=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*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ne.packedLength+1}rZ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.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 F1e=ne.clone(ne.UNIT_SPHERE),RY={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:F1e,granularity:void 0};rZ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.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,F1e);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):(RY.positions=r,RY.minimumHeights=s,RY.maximumHeights=a,RY.granularity=d,new rZ(RY))};rZ.fromConstantHeights=function(e){e=e??B.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 rZ(c)};rZ.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=iZ.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,m=new Float64Array(u),p=0;d/=3;let b;for(b=0;b<d;++b){let Z=b*3,R=h.fromArray(c,Z,W1e),C=h.fromArray(a,Z,v1e);m[p++]=C.x,m[p++]=C.y,m[p++]=C.z,m[p++]=R.x,m[p++]=R.y,m[p++]=R.z}let f=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m})}),y=u/3;u=2*y-4+y;let _=Oe.createTypedArray(y,u),S=0;for(b=0;b<y-2;b+=2){let Z=b,R=b+2,C=h.fromArray(m,Z*3,W1e),E=h.fromArray(m,R*3,v1e);if(h.equalsEpsilon(C,E,W.EPSILON10))continue;let A=b+1,L=b+3;_[S++]=A,_[S++]=Z,_[S++]=A,_[S++]=L,_[S++]=Z,_[S++]=R}return _[S++]=y-2,_[S]=y-1,new At({attributes:f,indices:_,primitiveType:Ie.LINES,boundingSphere:de.fromVertices(m)})};var CY=rZ;var I1e=new U;function zbt(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 Pf(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new zbt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Pf.prototype=Object.create(Wi.prototype),Pf.prototype.constructor=Pf);Pf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,I1e)),l(c)||(c=U.WHITE),o=$t.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Yt({id:t,geometry:new ZY(this._options),attributes:i})};Pf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,I1e),o=this._distanceDisplayConditionProperty.getValue(e);return new Yt({id:t,geometry:new CY(this._options),attributes:{show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o)}})};Pf.prototype._isHidden=function(e,t){return!l(t.positions)||Wi.prototype._isHidden.call(this,e,t)};Pf.prototype._getIsClosed=function(e){return!1};Pf.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)};Pf.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Qt,s=this._options;s.vertexFormat=r?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(it.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(it.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(it.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(it.MINIMUM_VALUE):void 0};Pf.DynamicGeometryUpdater=DV;function DV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(DV.prototype=Object.create(Li.prototype),DV.prototype.constructor=DV);DV.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Li.prototype._isHidden.call(this,e,t,n)};DV.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 VY=Pf;var sZ=[y2,BN,NN,oY,sY,lY,hY,TY,_Y,VY];function aZ(e,t){this.entity=e,this.scene=t;let n=new Array(sZ.length),i=new Se,o=new Hr;for(let r=0;r<n.length;r++){let s=new sZ[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(aZ.prototype._onEntityPropertyChanged,this)}aZ.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)};aZ.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};aZ.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)};aZ.registerUpdater=function(e){sZ.includes(e)||sZ.push(e)};aZ.unregisterUpdater=function(e){if(sZ.includes(e)){let t=sZ.indexOf(e);sZ.splice(t,1)}};var cZ=aZ;var n9i=x(T(),1);var P1e=new U,Hbt=new Ot,Kbt=new Ot,Jbt=h.ZERO,jbt=new h;function Xf(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 Mt,this.updaters=new Mt,this.updatersWithAttributes=new Mt,this.attributes=new Mt,this.subscriptions=new Mt,this.showsUpdated=new Mt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Xf.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Xf.prototype.onMaterialChanged=function(){this.invalidated=!0};Xf.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Xf.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)}))}};Xf.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};Xf.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;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let u=this.depthFailAppearanceType;c=new u({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let d=this.appearanceType;i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new d({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 Qt)&&(this.depthFailMaterial=yr.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),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let _=d.fillMaterialProperty.color,S=j.getValueOrDefault(_,e,U.WHITE,P1e);U.equals(m._lastColor,S)||(m._lastColor=U.clone(S,m._lastColor),m.color=$t.toValue(S,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Qt&&(!d.depthFailMaterialProperty.isConstant||c)){let _=d.depthFailMaterialProperty.color,S=j.getValueOrDefault(_,e,U.WHITE,P1e);U.equals(m._lastDepthFailColor,S)||(m._lastDepthFailColor=U.clone(S,m._lastDepthFailColor),m.depthFailColor=$t.toValue(S,m.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,Kbt,Hbt);Ot.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Ot.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Qn.toValue(_,m.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,Jbt,jbt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Zo.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Xf.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=Wn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Xf.prototype.contains=function(e){return this.updaters.contains(e.id)};Xf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Xf.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 OV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}OV.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 Xf(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function X1e(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}OV.prototype.remove=function(e){X1e(this._solidItems,e)||X1e(this._translucentItems,e)};function N1e(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 x3(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}OV.prototype.update=function(e){let t=x3(this,this._solidItems,e,!0);t=x3(this,this._translucentItems,e,t)&&t;let n=N1e(this,this._solidItems,e),i=N1e(this,this._translucentItems,e);return(n||i)&&(t=x3(this,this._solidItems,e,t)&&t,t=x3(this,this._translucentItems,e,t)&&t),t};function Y1e(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 Wt.FAILED}OV.prototype.getBoundingSphere=function(e,t){let n=Y1e(this._solidItems,e,t);return n===Wt.FAILED?Y1e(this._translucentItems,e,t):n};function w1e(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}OV.prototype.removeAllPrimitives=function(){w1e(this._solidItems),w1e(this._translucentItems)};var ch=OV;var y9i=x(T(),1);var Qbt=new Ot,qbt=new Ot,$bt=h.ZERO,egt=new h;function Nf(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 Mt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Mt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Mt,this.attributes=new Mt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Nf.prototype.onMaterialChanged,this),this.subscriptions=new Mt,this.showsUpdated=new Mt}Nf.prototype.onMaterialChanged=function(){this.invalidated=!0};Nf.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};Nf.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};Nf.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 tgt=new U;Nf.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=yr.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let d=this.depthFailAppearanceType;a=new d({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new c({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=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Qt)&&(this.depthFailMaterial=yr.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),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Qt&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,S=j.getValueOrDefault(_,e,U.WHITE,tgt);U.equals(m._lastDepthFailColor,S)||(m._lastDepthFailColor=U.clone(S,m._lastDepthFailColor),m.depthFailColor=$t.toValue(S,m.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,qbt,Qbt);Ot.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Ot.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Qn.toValue(_,m.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,$bt,egt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Zo.toValue(_,m.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Nf.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=Wn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Nf.prototype.contains=function(e){return this.updaters.contains(e.id)};Nf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Nf.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 BV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}BV.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 Nf(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};BV.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}}};BV.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};BV.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 Wt.FAILED};BV.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 lh=BV;var w9i=x(T(),1);var V9i=x(T(),1);var Z9i=x(T(),1);var T9i=x(T(),1);function T3(e,t,n=0,i=e.length-1,o=ngt){for(;i>n;){if(i-n>600){let c=i-n+1,d=t-n+1,u=Math.log(c),m=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*m*(c-m)/c)*(d-c/2<0?-1:1),b=Math.max(n,Math.floor(t-d*m/c+p)),f=Math.min(i,Math.floor(t+(c-d)*m/c+p));T3(e,t,b,f,o)}let r=e[t],s=n,a=i;for(EY(e,n,t),o(e[i],r)>0&&EY(e,n,i);s<a;){for(EY(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?EY(e,n,a):(a++,EY(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function EY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function ngt(e,t){return e<t?-1:e>t?1:0}var LY=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!S3(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?o(a):a;S3(t,c)&&(n.leaf?i.push(a):Gee(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!S3(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],s=n.leaf?this.toBBox(r):r;if(S3(t,s)){if(n.leaf||Gee(t,s))return!0;i.push(r)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=HV([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],s=[],a,c,d;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],a=s.pop(),d=!0),i.leaf){let u=igt(t,i.children,n);if(u!==-1)return i.children.splice(u,1),r.push(i),this._condense(r),this}!d&&!i.leaf&&Gee(i,o)?(r.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],d=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,o){let r=i-n+1,s=this._maxEntries,a;if(r<=s)return a=HV(t.slice(n,i+1)),zV(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=HV([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),d=c*Math.ceil(Math.sqrt(s));M1e(t,n,i,d,this.compareMinX);for(let u=n;u<=i;u+=d){let m=Math.min(u+d-1,i);M1e(t,u,m,c,this.compareMinY);for(let p=u;p<=m;p+=c){let b=Math.min(p+c-1,m);a.children.push(this._build(t,p,b,o-1))}}return zV(a,this.toBBox),a}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let d=n.children[c],u=Aee(d),m=sgt(t,d)-u;m<s?(s=m,r=u<r?u:r,a=d):m===s&&u<r&&(r=u,a=d)}n=a||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(o,this.data,n,r);for(s.children.push(t),GY(s,o);n>=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let s=this._chooseSplitIndex(i,r,o),a=HV(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,zV(i,this.toBBox),zV(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=HV([t,n]),this.data.height=t.height+1,this.data.leaf=!1,zV(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=AY(t,0,a,this.toBBox),d=AY(t,a,i,this.toBBox),u=agt(c,d),m=Aee(c)+Aee(d);u<r?(r=u,o=a,s=m<s?m:s):u===r&&m<s&&(s=m,o=a)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:ogt,r=t.leaf?this.compareMinY:rgt,s=this._allDistMargin(t,n,i,o),a=this._allDistMargin(t,n,i,r);s<a&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,s=AY(t,0,n,r),a=AY(t,i-n,i,r),c=_3(s)+_3(a);for(let d=n;d<i-n;d++){let u=t.children[d];GY(s,t.leaf?r(u):u),c+=_3(s)}for(let d=i-n-1;d>=n;d--){let u=t.children[d];GY(a,t.leaf?r(u):u),c+=_3(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)GY(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():zV(t[n],this.toBBox)}};function igt(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function zV(e,t){AY(e,0,e.children.length,t,e)}function AY(e,t,n,i,o){o||(o=HV(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r=t;r<n;r++){let s=e.children[r];GY(o,e.leaf?i(s):s)}return o}function GY(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function ogt(e,t){return e.minX-t.minX}function rgt(e,t){return e.minY-t.minY}function Aee(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function _3(e){return e.maxX-e.minX+(e.maxY-e.minY)}function sgt(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function agt(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),o=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function Gee(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function S3(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function HV(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function M1e(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;T3(e,s,t,n,o),r.push(t,s,s,n)}}function Z3(){this._tree=new LY}function lZ(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}lZ.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};Z3.prototype.insert=function(e,t){let n=lZ.fromRectangleAndId(e,t,new lZ);this._tree.insert(n)};function cgt(e,t){return e.id===t.id}var lgt=new lZ;Z3.prototype.remove=function(e,t){let n=lZ.fromRectangleAndId(e,t,lgt);this._tree.remove(n,cgt)};var dgt=new lZ;Z3.prototype.collides=function(e){let t=lZ.fromRectangleAndId("",e,dgt);return this._tree.collides(t)};var dZ=Z3;var ugt=new U,mgt=new Ot,hgt=new Ot;function vg(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 Mt,this.updaters=new Mt,this.updatersWithAttributes=new Mt,this.attributes=new Mt,this.subscriptions=new Mt,this.showsUpdated=new Mt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new dZ}vg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};vg.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)}))}};vg.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};vg.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 Nl({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),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let y=d.fillMaterialProperty.color,_=j.getValueOrDefault(y,e,U.WHITE,ugt);U.equals(m._lastColor,_)||(m._lastColor=U.clone(_,m._lastColor),m.color=$t.toValue(_,m.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,hgt,mgt);Ot.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Ot.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Qn.toValue(y,m.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};vg.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=Wn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};vg.prototype.contains=function(e){return this.updaters.contains(e.id)};vg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Wt.DONE):Wt.FAILED};vg.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 KV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}KV.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 vg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};KV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};KV.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};KV.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 Wt.FAILED};KV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var JV=KV;var $9i=x(T(),1);var fgt=new Ot,pgt=new Ot;function c0(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Mt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Mt,this.material=void 0,this.updatersWithAttributes=new Mt,this.attributes=new Mt,this.subscriptions=new Mt,this.showsUpdated=new Mt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new dZ}c0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};c0.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Qt&&t instanceof Qt?!0:l(t)&&t.equals(n)};c0.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};c0.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};c0.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=yr.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Nl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new a({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=yr.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),m=this.attributes.get(u.id.id);l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,pgt,fgt);Ot.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Ot.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Qn.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return 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=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=Wn.toValue(c,a.show),s.attributes.show.value[0]=a.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 Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};c0.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function jV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}jV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=_u.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 c0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};jV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};jV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};jV.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 Wt.FAILED};jV.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 WY=jV;var fUi=x(T(),1);var bgt=new U,ggt=new Ot,ygt=new Ot,xgt=h.ZERO,Tgt=new h;function Fg(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 Mt,this.updaters=new Mt,this.updatersWithAttributes=new Mt,this.attributes=new Mt,this.itemsToRemove=[],this.subscriptions=new Mt,this.showsUpdated=new Mt}Fg.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)}))}};Fg.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};Fg.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 Tn({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),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.outlineColorProperty.isConstant||c){let _=d.outlineColorProperty,S=j.getValueOrDefault(_,e,U.WHITE,bgt);U.equals(m._lastColor,S)||(m._lastColor=U.clone(S,m._lastColor),m.color=$t.toValue(S,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,ygt,ggt);Ot.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Ot.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Qn.toValue(_,m.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,xgt,Tgt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Zo.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Fg.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=Wn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Fg.prototype.contains=function(e){return this.updaters.contains(e.id)};Fg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Fg.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 QV(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Mt,this._translucentBatches=new Mt}QV.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 Fg(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 Fg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};QV.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};QV.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,m;do{for(m=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!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(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(m);return u};QV.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 Wt.FAILED};QV.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 qV=QV;var _gt=[];function Jd(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Mt,this._removedObjects=new Mt,this._changedObjects=new Mt;let o=vn.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=er.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new qV(n,e,s,!1),this._outlineBatches[o+s]=new qV(n,e,s,!0),this._closedColorBatches[s]=new ch(n,Tn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new ch(n,Tn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new lh(n,Co,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new lh(n,Co,void 0,!0,s,!1),this._openColorBatches[s]=new ch(n,Tn,void 0,!1,s,!0),this._openColorBatches[o+s]=new ch(n,Tn,void 0,!1,s,!1),this._openMaterialBatches[s]=new lh(n,Co,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new lh(n,Co,void 0,!1,s,!1);let a=ti.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new WY(i,s,Co)),c[s]=new JV(i,s);else for(s=0;s<a;++s)c[s]=new JV(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new QS(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Mt,this._updaterSets=new Mt,this._entityCollection=t,t.collectionChanged.addEventListener(Jd.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,_gt)}Jd.registerUpdater=function(e){cZ.registerUpdater(e)};Jd.unregisterUpdater=function(e){cZ.unregisterUpdater(e)};Jd.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,m=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(y){m._removeUpdater(y),m._insertUpdaterIntoBatch(e,y)}):(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 cZ(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(y){m._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Jd._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,b=this._batches,f=b.length;for(a=0;a<f;a++)p=b[a].update(e)&&p;return p};var Sgt=[],Zgt=new de;Jd.prototype.getBoundingSphere=function(e,t){let n=Sgt,i=Zgt,o=0,r,s=this._batches,a=s.length,c=e.id,d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let m=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(m,i),r===Wt.PENDING)return Wt.PENDING;r===Wt.DONE&&(n[o]=de.clone(i,n[o]),o++)}}return o===0?Wt.FAILED:(n.length=o,de.fromBoundingSpheres(n,t),Wt.DONE)};Jd.prototype.isDestroyed=function(){return!1};Jd.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Jd.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)};Jd.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Jd.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=vn.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 Qt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Qt?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 Qt?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)};Jd._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)};Jd.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 vY=Jd;var $Ui=x(T(),1);var Rgt=1,Cgt="30px sans-serif",Vgt=Tr.FILL,Egt=U.WHITE,Agt=U.BLACK,Ggt=1,Lgt=!1,Wgt=new U(.165,.165,.165,.8),vgt=new k(7,5),Fgt=k.ZERO,Igt=h.ZERO,Pgt=He.NONE,Xgt=Ui.CENTER,Ngt=Bn.CENTER,Ygt=new h,wgt=new U,Mgt=new U,kgt=new U,Ugt=new k,Dgt=new h,Ogt=new k,Bgt=new Kt,zgt=new Kt,Hgt=new Kt,Kgt=new Ot;function k1e(e){this.entity=e,this.label=void 0,this.index=void 0}function Jx(e,t){t.collectionChanged.addEventListener(Jx.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Mt,this._onCollectionChanged(t,t.values,[],[])}Jx.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),m;if(u&&(m=j.getValueOrUndefined(s._position,e,Ygt),c=j.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){Lee(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,b=j.getValueOrDefault(a._heightReference,e,Pgt);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=h.equals(d.position,m)&&d.heightReference===b),d.show=!0,d.position=m,d.text=c,d.scale=j.getValueOrDefault(a._scale,e,Rgt),d.font=j.getValueOrDefault(a._font,e,Cgt),d.style=j.getValueOrDefault(a._style,e,Vgt),d.fillColor=j.getValueOrDefault(a._fillColor,e,Egt,wgt),d.outlineColor=j.getValueOrDefault(a._outlineColor,e,Agt,Mgt),d.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,Ggt),d.showBackground=j.getValueOrDefault(a._showBackground,e,Lgt),d.backgroundColor=j.getValueOrDefault(a._backgroundColor,e,Wgt,kgt),d.backgroundPadding=j.getValueOrDefault(a._backgroundPadding,e,vgt,Ugt),d.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,Fgt,Ogt),d.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,Igt,Dgt),d.heightReference=b,d.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,Xgt),d.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,Ngt),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,Bgt),d.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,zgt),d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,Hgt),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,Kgt),d.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};Jx.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Wt.FAILED;let i=n.label;if(i.heightReference===He.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let o=this._cluster._scene,r=this._items,s=Nh(o,n,i.position,[i],()=>r.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=nb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};Jx.prototype.isDestroyed=function(){return!1};Jx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Jx.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return me(this)};Jx.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 k1e(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 k1e(r)):(Lee(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Lee(s.get(r.id),r,a),s.remove(r.id)};function Lee(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var FY=Jx;var T5i=x(T(),1);var Jgt=1,jgt=!0,Qgt=0,qgt=!0,$gt=!0,eyt=vn.ENABLED,tyt=He.NONE,nyt=U.RED,iyt=0,oyt=U.WHITE,ryt=al.HIGHLIGHT,syt=.5,ayt=new k(1,1),U1e={maximumPositionEpsilon:Number.POSITIVE_INFINITY},cyt=new P,lyt=new P,D1e=new U,O1e=new Array(4),dyt=new h;function jx(e,t){t.collectionChanged.addEventListener(jx.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Mt,this._onCollectionChanged(t,t.values,[],[])}async function uyt(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await Nu.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}}jx.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),m;if(u&&(m=s.computeModelMatrix(e,cyt),c=ve.createIfNeeded(j.getValueOrUndefined(a._uri,e)),u=l(m)&&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:{...U1e}},n[s.id]=d;let f=j.getValueOrDefault(a._incrementallyLoadTextures,e,qgt),y=j.getValueOrDefault(a._environmentMapOptions,e,U1e,d.environmentMapOptionsScratch);uyt(this,s,c,f,y)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=j.getValueOrDefault(a._scale,e,Jgt),p.enableVerticalExaggeration=j.getValueOrDefault(a._enableVerticalExaggeration,e,jgt),p.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,Qgt),p.maximumScale=j.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=P.clone(m,p.modelMatrix),p.shadows=j.getValueOrDefault(a._shadows,e,eyt),p.heightReference=j.getValueOrDefault(a._heightReference,e,tyt),p.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,nyt,D1e),p.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,iyt),p.color=j.getValueOrDefault(a._color,e,oyt,D1e),p.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,ryt),p.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,syt),p.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,$gt),p.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,ayt);let b=j.getValueOrUndefined(a._lightColor,e);if(l(b)&&(U.pack(b,O1e,0),b=h.unpack(O1e,0,dyt)),p.lightColor=b,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:Yd.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let y=j.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(y)){let Z=Object.keys(y);for(let R=0,C=Z.length;R<C;++R){let E=Z[R],A=y[E];if(!l(A))continue;let L=p.getNode(E);if(!l(L))continue;let F=P.fromTranslationRotationScale(A,lyt);L.matrix=P.multiply(L.originalMatrix,F,F)}}let _=!1,S=j.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(S)){let Z=Object.keys(S);for(let R=0,C=Z.length;R<C;++R){let E=Z[R],A=S[E];l(A)&&(_=!0,p.setArticulationStage(E,A))}}_&&p.applyArticulations()}}return!0};jx.prototype.isDestroyed=function(){return!1};jx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(jx.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Wee(this,e[i],t,n);return me(this)};var IY=new h,myt=new pe;jx.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Wt.FAILED;if(n.loadFailed)return Wt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Wt.PENDING;if(!i.ready||!n.modelUpdated)return Wt.PENDING;let o=this._scene,r=o.ellipsoid??ne.default;if(i.heightReference!==He.NONE){let a=i.modelMatrix;IY.x=a[12],IY.y=a[13],IY.z=a[14];let c=r.cartesianToCartographic(IY,myt),d=o.getHeight(c,i.heightReference);if(l(d)||(d=i._lastSurfaceHeight),!l(d)){let u=this._modelHash,m=Nh(o,n,IY,[i],()=>u[e.id]===n);if(m===void 0)return Wt.PENDING;m!==null&&(d=m)}return l(d)&&(i.heightReference===He.CLIP_TO_GROUND?c.height<d&&(c.height=d):fs(i.heightReference)?c.height=d:c.height+=d),de.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Wt.DONE}return de.clone(i.boundingSphere,t),Wt.DONE};jx.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)?(hyt(r,a),s.set(r.id,r)):(Wee(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Wee(this,r,a,c),s.remove(r.id)};function Wee(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function hyt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var PY=jx;var nDi=x(T(),1);var A5i=x(T(),1);function Qx(e){this._definitionChanged=new Se,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Qx.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:Oi.FIXED}}});var fyt=new Q;Qx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(fyt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Qx.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))};Qx.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};Qx.prototype.equals=function(e){return this===e||e instanceof Qx&&this._value===e._value};Qx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var l0=Qx;var B1e=new q,z1e=new q,H1e=new q,pyt=new h,K1e=new h,byt=new h,gyt=new h,R3=new Ne,C3=new P,V3=new q;function NY(e,t,n,i,o){if(!(!l(t)||!l(n))){if(h.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,R3)&&(Ne.conjugate(R3,R3),q.fromQuaternion(R3,V3),q.multiplyByVector(V3,o,o));else if(l(Iee(e,i.position,C3)))P.inverse(C3,C3),P.getRotation(C3,V3),q.multiplyByVector(V3,o,o);else return;return o}}function Iee(e,t,n){let i=t.getValue(e,pyt);if(l(i)){let o=Q.addSeconds(e,.01,new Q),r=t.getValue(o,K1e);if(l(r)&&!h.equalsEpsilon(i,r,W.EPSILON16)){let s=_t.computeFixedToIcrfMatrix(e,B1e),a=_t.computeFixedToIcrfMatrix(o,z1e),c;!l(s)||!l(a)?(c=_t.computeTemeToPseudoFixedMatrix(e,H1e),s=q.transpose(c,B1e),a=_t.computeTemeToPseudoFixedMatrix(o,z1e),q.transpose(a,a)):c=q.transpose(s,H1e);let d=byt;h.normalize(i,d),h.normalize(r,r),q.multiplyByVector(s,d,d),q.multiplyByVector(a,r,r);let u=h.cross(d,r,gyt);if(!h.equalsEpsilon(u,h.ZERO,W.EPSILON16)){let m=h.cross(u,d,K1e);return q.multiplyByVector(c,m,m),q.multiplyByVector(c,u,u),q.multiplyByVector(c,d,d),h.normalize(m,m),h.normalize(u,u),h.normalize(d,d),l(n)||(n=new P),n[0]=m.x,n[1]=m.y,n[2]=m.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=d.x,n[9]=d.y,n[10]=d.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var J1e=60,tCe=1,nCe=new Cn,vee=new Cn,Fee=new Cn;function j1e(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var E3=new h;function yyt(e,t,n,i,o,r,s,a,c){let d,u,m=!1;r instanceof er&&(d=r,u=d.position,r=Oi.FIXED,m=!0);let p=a,b,f;b=e.getValueInReferenceFrame(t,r,c[p]),m?(f=u.getValueInReferenceFrame(t,r,E3),b=NY(t,b,f,d,b),l(b)&&(c[p++]=b)):l(b)&&(c[p++]=b);let y=!l(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),_=0,S=i.length,Z=i[_],R=n,C=!1,E,A,L;for(;_<S;){if(!y&&Q.greaterThanOrEquals(Z,o)&&(b=e.getValueInReferenceFrame(o,r,c[p]),m?(f=u.getValueInReferenceFrame(o,r,E3),l(b)&&l(f)&&(b=NY(o,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),y=!0),Q.greaterThan(Z,t)&&Q.lessThan(Z,R)&&!Z.equals(o)&&(b=e.getValueInReferenceFrame(Z,r,c[p]),m?(f=u.getValueInReferenceFrame(Z,r,E3),l(b)&&l(f)&&(b=NY(Z,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b)),_<S-1){if(s>0&&!C){let F=i[_+1],I=Q.secondsDifference(F,Z);C=I>s,C&&(E=Math.ceil(I/s),A=0,L=I/Math.max(E,2),E=Math.max(E-1,1))}if(C&&A<E){Z=Q.addSeconds(Z,L,new Q),A++;continue}}C=!1,_++,Z=i[_]}return b=e.getValueInReferenceFrame(n,r,c[p]),m?(f=u.getValueInReferenceFrame(n,r,E3),l(b)&&l(f)&&(b=NY(n,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),p}function xyt(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(m,n);)!p&&Q.greaterThanOrEquals(m,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=Q.addSeconds(t,r*d,new Q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function Tyt(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=Math.max(r,60),b=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(m,n);)!b&&Q.greaterThanOrEquals(m,i)&&(b=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=Q.addSeconds(t,p*d,new Q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function _yt(e,t,n,i,o,r,s,a){Fee.start=t,Fee.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Cn.intersect(m,Fee,nCe).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=Q.addSeconds(m.start,Q.secondsDifference(m.stop,m.start)/2,new Q));let b=e.getValueInReferenceFrame(p,o,a[c]);l(b)&&(a[c]=b,c++)}}return c}function Syt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Zyt(e,t,n,i,o,r,s,a){vee.start=t,vee.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Cn.intersect(m,vee,nCe).isEmpty){let p=m.start,b=m.stop,f=t;Q.greaterThan(p,f)&&(f=p);let y=n;Q.lessThan(b,y)&&(y=b),c=iCe(m.data,f,y,i,o,r,c,a)}}return c}function iCe(e,t,n,i,o,r,s,a){for(;e instanceof Cg;)e=e.resolvedProperty;if(e instanceof fc){let c=e._property._times;s=yyt(e,t,n,c,i,o,r,s,a)}else e instanceof x2?s=xyt(e,t,n,i,o,r,s,a):e instanceof mc?s=Zyt(e,t,n,i,o,r,s,a):e instanceof Vg?s=_yt(e,t,n,i,o,r,s,a):e instanceof Ml||e instanceof l0&&j.isConstant(e)?s=Syt(e,t,n,i,o,r,s,a):s=Tyt(e,t,n,i,o,r,s,a);return s}function Pee(e,t,n,i,o,r,s){l(s)||(s=[]);let a=iCe(e,t,n,i,o,r,0,s);return s.length=a,s}var Q1e=new q,q1e=new Ne,$1e=new q,XY=new Cn,A3=new Cn,uZ=new Cn;function Ryt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!j.isConstant(i)&&t.push(i)}return t}function eCe(e,t,n,i,o,r,s,a,c,d,u){e.sort(Q.compare),e=Yo(e,Q.equalsEpsilon);let m=u;for(let p=0;p<e.length-1;p++){let b=e[p],f=e[p+1];if(!Q.lessThan(b,f))continue;let y=Q.addSeconds(b,Q.secondsDifference(f,b)/2,new Q),_=Pee(t,b,f,n,c,a,[]);if(_.length<2)continue;let S=r.segmentPolylines[m];l(S)||(S=s.add(),S.id=o,r.segmentPolylines[m]=S),S.show=!0,S.positions=_,S.material=yr.getValue(y,d,S.material),S.width=j.getValueOrDefault(i._width,n,tCe),m++}return m}function YY(e,t){this._unusedIndexes=[],this._polylineCollection=new xf,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}YY.prototype.update=function(e){let t=this._referenceFrame;if(t===Oi.INERTIAL){let n=_t.computeIcrfToFixedMatrix(e,Q1e);l(n)||(n=_t.computeTemeToPseudoFixedMatrix(e,Q1e)),P.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof er){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,q1e))&&(q.fromQuaternion(q1e,$1e),P.fromRotationTranslation($1e,n,this._polylineCollection.modelMatrix)):Iee(e,t.position,this._polylineCollection.modelMatrix)}};YY.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 f=j.getValueOrUndefined(i._leadTime,e),y=j.getValueOrUndefined(i._trailTime,e),_=n._availability,S=l(_),Z=l(f),R=l(y);if(d=S||Z&&R,d){if(R&&(r=Q.addSeconds(e,-y,new Q)),Z&&(s=Q.addSeconds(e,f,new Q)),S){let C=_.start,E=_.stop;(!R||Q.greaterThan(C,r))&&(r=C),(!Z||Q.lessThan(E,s))&&(s=E)}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);for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;return}if(!l(c)){let f=this._unusedIndexes;if(f.length>0){let _=f.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=j.getValueOrDefault(i._resolution,e,J1e),m=Pee(o,r,s,e,this._referenceFrame,u,c.positions.slice());if(m.length<2){c.show=!1;for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;return}c.show=!0,c.positions=m,c.material=yr.getValue(e,i.material,c.material);let p=j.getValueOrUndefined(i.materialMode,e),b=i.material;if(p===n0.PORTIONS&&!b.isConstant){l(c)&&(c.show=!1);let f=u>0?u:J1e,y=b.intervals,_=0;if(l(y)){XY.start=r,XY.stop=s,XY.isStartIncluded=!0,XY.isStopIncluded=!0;for(let S=0;S<y.length;S++){let Z=y.get(S);if(!Cn.intersect(Z,XY,A3))continue;let R=A3.start,C=A3.stop;if(Q.greaterThanOrEquals(R,C))continue;let E=Ryt(Z.data),A=[Q.clone(R),Q.clone(C)];for(let L=0;L<E.length;L++){let F=E[L],I=F.intervals;if(l(I))for(let N=0;N<I.length;N++){let g=I.get(N);Cn.intersect(g,A3,uZ)&&(Q.greaterThan(uZ.start,R)&&Q.lessThan(uZ.start,C)&&A.push(Q.clone(uZ.start)),Q.greaterThan(uZ.stop,R)&&Q.lessThan(uZ.stop,C)&&A.push(Q.clone(uZ.stop)))}else if(!j.isConstant(F)){let N=Q.clone(R);for(;Q.lessThan(N,C);)A.push(Q.clone(N)),N=Q.addSeconds(N,f,new Q)}}_=eCe(A,o,e,i,n,t,this._polylineCollection,f,this._referenceFrame,Z.data,_)}}else{let S=[Q.clone(r),Q.clone(s)],Z=Q.addSeconds(r,f,new Q);for(;Q.lessThan(Z,s);)S.push(Q.clone(Z)),Z=Q.addSeconds(Z,f,new Q);_=eCe(S,o,e,i,n,t,this._polylineCollection,f,this._referenceFrame,i.material,_)}for(let S=_;S<t.segmentPolylines.length;S++)l(t.segmentPolylines[S])&&(t.segmentPolylines[S].show=!1)}else for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;c.width=j.getValueOrDefault(i._width,e,tCe),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};YY.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);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};YY.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function d0(e,t){t.collectionChanged.addEventListener(d0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Mt,this._onCollectionChanged(t,t.values,[],[])}d0.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],s=r.entity,a=s._position,c=s._path,d=r.updater,u=!1,m=Oi.FIXED,p=m.toString();if(this._scene.mode===se.SCENE3D){let f=j.getValueOrUndefined(c.relativeTo,e);l(f)?f==="FIXED"?(m=Oi.FIXED,p=m.toString()):f==="INERTIAL"?(m=Oi.INERTIAL,p=m.toString()):(u=!0,m=this._entityCollection.getById(f),p=f):(m=a.referenceFrame,p=m.toString())}let b=this._updaters[p];if(d===b&&l(b)){b.updateObject(e,r);continue}l(d)&&d.removeObject(r),!(u&&!l(m))&&(l(b)||(b=new YY(this._scene,m),b.update(e),this._updaters[p]=b),r.updater=b,l(b)&&b.updateObject(e,r))}return!0};d0.prototype.isDestroyed=function(){return!1};d0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return me(this)};d0.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 j1e(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 j1e(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))};d0._subSample=Pee;d0._computeVvlhTransform=Iee;d0._transformToEntityFrame=NY;var wY=d0;var xDi=x(T(),1);var oCe=U.WHITE,rCe=U.BLACK,sCe=0,aCe=1,cCe=0,lCe=Mr.NONE,dCe=new U,Cyt=new h,uCe=new U,mCe=new Kt,hCe=new Kt,fCe=new Ot;function pCe(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 qx(e,t){t.collectionChanged.addEventListener(qx.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Mt,this._onCollectionChanged(t,t.values,[],[])}qx.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,He.NONE),m=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),p;if(m&&(p=j.getValueOrUndefined(s._position,e,Cyt),m=l(p)),!m){MY(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let b=!1,f=!1;if(u!==He.NONE&&!l(d)?(l(c)&&(MY(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,b=!0,f=h.equals(d.position,p)&&d.heightReference===u):u===He.NONE&&!l(c)&&(l(d)&&(MY(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,mCe),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,hCe),c.color=j.getValueOrDefault(a._color,e,oCe,dCe),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,rCe,uCe),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,sCe),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,aCe),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,fCe),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,cCe),c.splitDirection=j.getValueOrDefault(a._splitDirection,e,lCe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,mCe),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,hCe),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,fCe),d.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,cCe),d.splitDirection=j.getValueOrDefault(a._splitDirection,e,lCe),d.heightReference=u;let y=j.getValueOrDefault(a._color,e,oCe,dCe),_=j.getValueOrDefault(a._outlineColor,e,rCe,uCe),S=Math.round(j.getValueOrDefault(a._outlineWidth,e,sCe)),Z=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,aCe)));if(S>0?(d.scale=1,b=b||S!==r.outlineWidth||Z!==r.pixelSize||!U.equals(y,r.color)||!U.equals(_,r.outlineColor)):(d.scale=Z/50,Z=50,b=b||S!==r.outlineWidth||!U.equals(y,r.color)||!U.equals(_,r.outlineColor)),b){r.color=U.clone(y,r.color),r.outlineColor=U.clone(_,r.outlineColor),r.pixelSize=Z,r.outlineWidth=S;let R=y.alpha,C=y.toCssColorString(),E=_.toCssColorString(),A=JSON.stringify([C,Z,E,S]);d.setImage(A,TS(R,C,E,S,Z))}f&&d._updateClamping()}}return!0};qx.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Wt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let o=this._cluster._scene,r=this._items,s=Nh(o,n,i.position,[i],()=>r.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=nb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}}return t.radius=0,Wt.DONE};qx.prototype.isDestroyed=function(){return!1};qx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qx.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return me(this)};qx.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 pCe(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 pCe(r)):(MY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],MY(s.get(r.id),r,a),s.remove(r.id)};function MY(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 kY=qx;var KOi=x(T(),1);var pOi=x(T(),1);var wDi=x(T(),1);var TCe=[];function Vyt(e,t,n,i,o){let r=TCe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,m=i.red,p=i.green,b=i.blue,f=i.alpha;if(U.equals(n,i)){for(s=0;s<o;s++)r[s]=U.clone(n);return r}let y=(m-a)/o,_=(p-c)/o,S=(b-d)/o,Z=(f-u)/o;for(s=0;s<o;s++)r[s]=new U(a+s*y,c+s*_,d+s*S,u+s*Z);return r}function UY(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=we.clone(e.vertexFormat??we.DEFAULT),this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*U.packedLength:1,this.packedLength=r+ne.packedLength+we.packedLength+4}UY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.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+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var _Ce=ne.clone(ne.UNIT_SPHERE),SCe=new we,mZ={positions:void 0,colors:void 0,ellipsoid:_Ce,vertexFormat:SCe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};UY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t,_Ce);t+=ne.packedLength;let c=we.unpack(e,t,SCe);t+=we.packedLength;let d=e[t++],u=e[t++]===1,m=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=we.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(mZ.positions=r,mZ.colors=s,mZ.width=d,mZ.colorsPerVertex=u,mZ.arcType=m,mZ.granularity=p,new UY(mZ))};var bCe=new h,gCe=new h,yCe=new h,xCe=new h;UY.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,m=[],p=Yo(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let X=0,Y=m[0];i=i.filter(function(D,w){let O;return o?O=w===Y||w===0&&Y===1:O=w+1===Y,O?(X++,Y=m[X],!1):!0})}let b=p.length;if(b<2||t<=0)return;if(r===un.GEODESIC||r===un.RHUMB){let X,Y;r===un.GEODESIC?(X=W.chordLength(s,a.maximumRadius),Y=oo.numberOfPoints):(X=s,Y=oo.numberOfPointsRhumbLine);let D=oo.extractHeights(p,a);if(l(i)){let w=1;for(c=0;c<b-1;++c)w+=Y(p[c],p[c+1],X);let O=new Array(w),M=0;for(c=0;c<b-1;++c){let z=p[c],K=p[c+1],te=i[c],H=Y(z,K,X);if(o&&c<w){let $=i[c+1],ee=Vyt(z,K,te,$,H),le=ee.length;for(d=0;d<le;++d)O[M++]=ee[d]}else for(d=0;d<H;++d)O[M++]=U.clone(te)}O[M]=U.clone(i[i.length-1]),i=O,TCe.length=0}r===un.GEODESIC?p=oo.generateCartesianArc({positions:p,minDistance:X,ellipsoid:a,height:D}):p=oo.generateCartesianRhumbArc({positions:p,granularity:X,ellipsoid:a,height:D})}b=p.length;let f=b*4-4,y=new Float64Array(f*3),_=new Float64Array(f*3),S=new Float64Array(f*3),Z=new Float32Array(f*2),R=n.st?new Float32Array(f*2):void 0,C=l(i)?new Uint8Array(f*4):void 0,E=0,A=0,L=0,F=0,I;for(d=0;d<b;++d){d===0?(I=bCe,h.subtract(p[0],p[1],I),h.add(p[0],I,I)):I=p[d-1],h.clone(I,yCe),h.clone(p[d],gCe),d===b-1?(I=bCe,h.subtract(p[b-1],p[b-2],I),h.add(p[b-1],I,I)):I=p[d+1],h.clone(I,xCe);let X,Y;l(C)&&(d!==0&&!o?X=i[d-1]:X=i[d],d!==b-1&&(Y=i[d]));let D=d===0?2:0,w=d===b-1?2:4;for(u=D;u<w;++u){h.pack(gCe,y,E),h.pack(yCe,_,E),h.pack(xCe,S,E),E+=3;let O=u-2<0?-1:1;if(Z[A++]=2*(u%2)-1,Z[A++]=O*t,n.st&&(R[L++]=d/(b-1),R[L++]=Math.max(Z[A-2],0)),l(C)){let M=u<2?X:Y;C[F++]=U.floatToByte(M.red),C[F++]=U.floatToByte(M.green),C[F++]=U.floatToByte(M.blue),C[F++]=U.floatToByte(M.alpha)}}}let N=new Rn;N.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:y}),N.prevPosition=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_}),N.nextPosition=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S}),N.expandAndWidth=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:Z}),n.st&&(N.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:R})),l(C)&&(N.color=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0}));let g=Oe.createTypedArray(f,b*6-6),V=0,G=0,v=b-1;for(d=0;d<v;++d)g[G++]=V,g[G++]=V+2,g[G++]=V+1,g[G++]=V+1,g[G++]=V+2,g[G++]=V+3,V+=4;return new At({attributes:N,indices:g,primitiveType:Ie.TRIANGLES,boundingSphere:de.fromPoints(p),geometryType:Zm.POLYLINES})};var Ig=UY;var Eyt=new gi(0),G3={},ZCe=new U,Ayt=new Qt(U.WHITE),Gyt=new gi(!0),Lyt=new gi(vn.DISABLED),Wyt=new gi(new Ot),vyt=new gi(ti.BOTH);function Fyt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Iyt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Yf(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Yf.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Se,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 Fyt,this._groundGeometryOptions=new Iyt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=er.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Yf.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}}});Yf.prototype.isOutlineVisible=function(e){return!1};Yf.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Yf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Qn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Qt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,ZCe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)),this.clampToGround?new Yt({id:t,geometry:new x_(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Qt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,ZCe)),l(a)||(a=U.WHITE),s.depthFailColor=$t.fromColor(a)),new Yt({id:t,geometry:new Ig(this._geometryOptions),attributes:s}))};Yf.prototype.createOutlineGeometryInstance=function(e){};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){this._entitySubscription(),me(this)};Yf.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(it.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??Ayt,d=c instanceof Qt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??Gyt,this._shadowsProperty=o.shadows??Lyt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Wyt,this._classificationTypeProperty=o.classificationType??vyt,this._fillEnabled=!0,this._zIndex=a??Eyt;let u=o.width,m=o.arcType,p=o.clampToGround,b=o.granularity;if(!r.isConstant||!j.isConstant(u)||!j.isConstant(m)||!j.isConstant(b)||!j.isConstant(p)||!j.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,y=r.getValue(it.MINIMUM_VALUE,f.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Qt)?_=Ms.VERTEX_FORMAT:_=sc.VERTEX_FORMAT,f.vertexFormat=_,f.positions=y,f.width=l(u)?u.getValue(it.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(it.MINIMUM_VALUE):void 0,f.granularity=l(b)?b.getValue(it.MINIMUM_VALUE):void 0;let S=this._groundGeometryOptions;S.positions=y,S.width=f.width,S.arcType=f.arcType,S.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(it.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&xt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Yf.prototype.createDynamicUpdater=function(e,t){return new DY(e,t,this)};var $V={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function DY(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 RCe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=G3[n];!l(i)||i.isDestroyed()?(i=new xf,G3[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}DY.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,un.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 m=t.fillMaterialProperty,p;if(m instanceof Qt)p=new Ms;else{let b=yr.getValue(e,m,this._material);p=new sc({material:b,translucent:b.isTranslucent()}),this._material=b}this._groundPolylinePrimitive=s.add(new Oh({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=RCe(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=un.GEODESIC;c=j.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==un.NONE&&l(d)&&($V.ellipsoid=u,$V.positions=r,$V.granularity=j.getValueOrUndefined(i._granularity,e),$V.height=oo.extractHeights(r,u),c===un.GEODESIC?r=oo.generateCartesianArc($V):r=oo.generateCartesianRhumbArc($V)),a.show=!0,a.positions=r.slice(),a.material=yr.getValue(e,t.fillMaterialProperty,a.material),a.width=j.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};DY.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 de.clone(n.boundingSphere,e),Wt.DONE}return l(t)&&!t.ready?Wt.PENDING:Wt.DONE}else{let t=RCe(this);if(t.show&&t.positions.length>0)return de.fromPoints(t.positions,e),Wt.DONE}return Wt.FAILED};DY.prototype.isDestroyed=function(){return!1};DY.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=G3[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete G3[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var OY=Yf;var WOi=x(T(),1);var Pyt=new U,Xyt=new Ot,Nyt=new Ot;function wf(e,t,n,i,o){let r;n instanceof Qt?r=Ms:r=sc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Mt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Mt,this.material=void 0,this.updatersWithAttributes=new Mt,this.attributes=new Mt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(wf.prototype.onMaterialChanged,this),this.subscriptions=new Mt,this.showsUpdated=new Mt,this.zIndex=i,this._asynchronous=o}wf.prototype.onMaterialChanged=function(){this.invalidated=!0};wf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Qt&&t instanceof Qt?!0:l(t)&&t.equals(n)};wf.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};wf.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};wf.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);let a=this.appearanceType;n=new Oh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===sc&&(this.material=yr.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===sc&&(this.material=yr.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),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,_=j.getValueOrDefault(y,e,U.WHITE,Pyt);U.equals(m._lastColor,_)||(m._lastColor=U.clone(_,m._lastColor),m.color=$t.toValue(_,m.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,Nyt,Xyt);Ot.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Ot.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Qn.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};wf.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=Wn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};wf.prototype.contains=function(e){return this.updaters.contains(e.id)};wf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};wf.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 eE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}eE.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 wf(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};eE.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}}};eE.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};eE.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 Wt.FAILED};eE.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 BY=eE;var Yyt=[];function CCe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function VCe(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 Qt?1:2);let r;l(i)&&(r=i+o*vn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Qt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function u0(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Mt,this._removedObjects=new Mt,this._changedObjects=new Mt;let o,r=vn.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 ch(n,Ms,void 0,!1,o),this._materialBatches[o]=new lh(n,sc,void 0,!1,o),this._colorBatches[o+r]=new ch(n,Ms,Ms,!1,o),this._materialBatches[o+r]=new lh(n,sc,Ms,!1,o),this._colorBatches[o+r*2]=new ch(n,Ms,sc,!1,o),this._materialBatches[o+r*2]=new lh(n,sc,sc,!1,o);this._dynamicBatch=new QS(n,i);let s=ti.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new BY(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Mt,this._updaters=new Mt,this._entityCollection=t,t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Yyt)}u0.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?(CCe(this,u),VCe(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),CCe(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 OY(c,this._scene),this._updaters.set(d,u),VCe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(u0._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,b=p.length;for(a=0;a<b;a++)m=p[a].update(e)&&m;return m};var wyt=[],Myt=new de;u0.prototype.getBoundingSphere=function(e,t){let n=wyt,i=Myt,o=0,r,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===Wt.PENDING)return Wt.PENDING;r===Wt.DONE&&(n[o]=de.clone(i,n[o]),o++)}return o===0?Wt.FAILED:(n.length=o,de.fromBoundingSpheres(n,t),Wt.DONE)};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(u0.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)};u0._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)};u0.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 zY=u0;function jd(e){Nl.initializeTerrainHeights(),Oh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Hr,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=e.visualizersCallback??jd.defaultVisualizersCallback;let i=!1,o=new xl,r=new xl;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 UN;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 tE=[];jd.registerVisualizer=function(e){tE.includes(e)||tE.push(e)};jd.unregisterVisualizer=function(e){if(tE.includes(e)){let t=tE.indexOf(e);tE.splice(t,1)}};jd.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new sG(t,i),new vY(e,i,n._primitives,n._groundPrimitives),new FY(t,i),new PY(e,i),new AN(e,i),new kY(t,i),new wY(e,i),new zY(e,i,n._primitives,n._groundPrimitives),...tE.map(o=>new o(e,i))]};Object.defineProperties(jd.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}}});jd.prototype.isDestroyed=function(){return!1};jd.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)};jd.prototype.update=function(e){if(!Pi.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};jd.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 kyt=[],Uyt=new de;jd.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Wt.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 b=p.get(i);if(b.entities.contains(e)){r=b;break}}}if(!l(r))return Wt.FAILED;let s=kyt,a=Uyt,c=0,d,u=r._visualizers,m=u.length;for(i=0;i<m;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===Wt.PENDING)return Wt.PENDING;d===Wt.DONE&&(s[c]=de.clone(a,s[c]),c++)}}return c===0?Wt.FAILED:(s.length=c,de.fromBoundingSpheres(s,n),Wt.DONE)};jd.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new xl),s=o.add(new iY);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};jd.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};jd.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 HY=jd;var FBi=x(T(),1);var yBi=x(T(),1);function Xee(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}Xee.clone=function(e,t){if(l(e))return l(t)||(t=new Xee),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var dh=Xee;var ECe=new q,ACe=new q,GCe=new q,Dyt=new P,L3=new h,LCe=new h,Nee=new h,Yee=new h,WCe=new h,vCe=new h,Oyt=new Ne,Byt=new h,zyt=new q,nE=new Q,Hyt=1.25;function Kyt(e,t,n,i,o,r,s,a,c,d){let u=e.scene.mode,m=o.getValue(c,e._lastCartesian);if(l(m)){let p=!1,b=!1,f,y,_;if(u===se.SCENE3D){Q.addSeconds(c,.001,nE);let L=o.getValue(nE,L3);if(l(L)||(Q.addSeconds(c,-.001,nE),L=o.getValue(nE,L3),b=!0),l(L)){let F=_t.computeFixedToIcrfMatrix(c,ECe),I=_t.computeFixedToIcrfMatrix(nE,ACe),N;!l(F)||!l(I)?(N=_t.computeTemeToPseudoFixedMatrix(c,GCe),F=q.transpose(N,ECe),I=_t.computeTemeToPseudoFixedMatrix(nE,ACe),q.transpose(I,I)):N=q.transpose(F,GCe);let g=q.multiplyByVector(F,m,WCe),V=q.multiplyByVector(I,L,vCe);h.subtract(g,V,Yee);let G=h.magnitude(Yee)*1e3,v=W.GRAVITATIONALPARAMETER,X=-v/(G*G-2*v/h.magnitude(g));X<0||X>Hyt*d.maximumRadius?(f=LCe,h.normalize(m,f),h.negate(f,f),_=h.clone(h.UNIT_Z,Nee),y=h.cross(_,f,L3),h.magnitude(y)>W.EPSILON7&&(h.normalize(f,f),h.normalize(y,y),_=h.cross(f,y,Nee),h.normalize(_,_),p=!0)):h.equalsEpsilon(m,L,W.EPSILON7)||(_=LCe,h.normalize(g,_),h.normalize(V,V),y=h.cross(_,V,Nee),b&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,W.EPSILON7)||(f=h.cross(y,_,L3),q.multiplyByVector(N,f,f),q.multiplyByVector(N,y,y),q.multiplyByVector(N,_,_),h.normalize(f,f),h.normalize(y,y),h.normalize(_,_),p=!0))}}l(e.boundingSphere)&&(m=e.boundingSphere.center);let S,Z,R;i&&(S=h.clone(t.position,Yee),Z=h.clone(t.direction,WCe),R=h.clone(t.up,vCe));let C=Dyt,E;l(s)&&(E=s.getValue(c,Oyt));let A=r.getValue(c,Byt);if(a===ub.INERTIAL&&l(E))P.fromTranslationQuaternionRotationScale(m,E,h.ONE,C);else if(a===ub.VELOCITY&&l(A)){let L=_t.rotationMatrixFromPositionVelocity(m,A,d,zyt);P.fromRotationTranslation(L,m,C)}else a===ub.ENU||!p?_t.eastNorthUpToFixedFrame(m,d,C):(C[0]=f.x,C[1]=f.y,C[2]=f.z,C[3]=0,C[4]=y.x,C[5]=y.y,C[6]=y.z,C[7]=0,C[8]=_.x,C[9]=_.y,C[10]=_.z,C[11]=0,C[12]=m.x,C[13]=m.y,C[14]=m.z,C[15]=0);t._setTransform(C),i&&(h.clone(S,t.position),h.clone(Z,t.direction),h.clone(R,t.up),h.cross(Z,R,t.right))}if(n){let p=u===se.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function KY(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ne.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Ag(e.position,!0),this._offset3D=new h}Object.defineProperties(KY,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});KY.defaultOffset3D=new h(-14e3,3500,3500);var W3=new dh,Jyt=new h;KY.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===se.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,m=o!==this._mode,p=n.camera,b=u||m,f=!0;if(u){let y=r.viewFrom,_=l(y);if(!_&&l(t)){W3.pitch=-W.PI_OVER_FOUR,W3.range=0;let S=a.getValue(e,Jyt);if(l(S)){let Z=2-1/Math.max(1,h.magnitude(S)/i.maximumRadius);W3.pitch*=Z}p.viewBoundingSphere(t,W3),this.boundingSphere=t,b=!1,f=!1}else(!_||!l(y.getValue(e,this._offset3D)))&&h.clone(KY._defaultOffset3D,this._offset3D)}else!m&&this._mode!==se.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Kyt(this,p,b,f,a,c,d,s,e,i)};var JY=KY;var oJi=x(T(),1);var CKi=x(T(),1);var UHi=x(T(),1);m0();var Fzi=x(T(),1);var J3i=x(T(),1);bc();bZ();cz();mw();var lEe={type:"module"},lte="error",Xxt="messageerror",dEe,cte,uEe,dte=!0;try{dte=typeof structuredClone==Yr&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}aEe(Nxt);function Nxt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:o}=t,{wasmURI:r}=t;if(!e.interface){typeof r==Yr&&(r=r());let s;try{s=mz(e.workerURI,n,e)}catch{return ste(e),ate(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await Yxt(e,{chunkSize:i,wasmURI:r,baseURI:n,workerStartupTimeout:o})}catch(a){if(a&&a.workerStartupFailed)return ste(e),mEe(e),uz(e,t);if(a&&a.codecImportFailed){if(e.reader)return mEe(e),uz(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function Yxt(e,t){if(!e.worker){let{startupError:b}=e;e.startupError=null;let f=b||new Error(TZ);throw f.workerStartupFailed=!0,f}let n,i,o=new Promise((b,f)=>{n=b,i=f});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s}=e,{writable:a,closed:c,abortPipe:d}=wxt(e.writable),u;try{u=ute({type:tEe,options:s,config:t,readable:r,writable:a},e)}catch(b){d();try{await c}catch{}throw e.onTaskFinished(),b}u||Object.assign(e,{reader:r.getReader(),writer:a.getWriter()});let{workerStartupTimeout:m}=t;!e.workerAlive&&Number.isFinite(m)&&m>=0&&(e.startupTimeout=setTimeout(()=>Mxt(e),m));try{let b=await o;return await p(),await c,b}catch(b){await p(),d();try{await c}catch{}throw b}async function p(){if(!u&&!a.locked)try{await a.getWriter().close()}catch{}}}function wxt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,o=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return o.catch(()=>{}),{writable:n,closed:o,abortPipe:()=>t.abort()}}function mEe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function mte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function mz(e,t,n,i,o=!0){let{createWorker:r}=n,s,a,c;if(r)s=r();else if(cte===ke||dEe!==e){let d=typeof e==Yr;d?a=e(o):a=e;let u=a.startsWith("data:"),m=a.startsWith("blob:");if(u||m){i===ke&&(i=!1),i&&(c=lEe);try{s=new Worker(a,c)}catch(p){if(m)try{URL.revokeObjectURL(a)}catch{}if(d&&m)return mz(e,t,n,i,!1);if(i)throw p;return mz(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=lEe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return mz(e,t,n,!1,o);throw p}}dEe=e,cte=a,uEe=c}else s=new Worker(cte,uEe);return s.addEventListener(eEe,d=>{n.workerAlive=!0,fEe(n),kxt(d,n)}),s.addEventListener(lte,d=>hEe(d,n)),s.addEventListener(Xxt,d=>hEe(d,n)),s}function Mxt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(mte(e),e.worker=null,t){let i=new Error(TZ);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function fEe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function hEe(e,t){e.preventDefault&&e.preventDefault(),fEe(t);let{workerAlive:n,rejectResult:i,writer:o,onTaskFinished:r}=t;mte(t),n||(t.worker=null);let s=e.error||new Error(e.message||lte);n||(s=Object.assign(new Error(s.message||lte),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),o&&o.releaseLock(),n&&r())}function ute(e,{worker:t,writer:n,transferStreams:i,workerAlive:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(e.value=B3(r),c.push(e.value.buffer)),i&&dte&&o?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{dte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function kxt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:m,generation:p}=t,b=()=>t.generation!=p;try{if(s){let{message:y,stack:_,code:S,name:Z,outputSize:R,cause:C,codecImportFailed:E}=s,A=new Error(y);Object.assign(A,{stack:_,code:S,name:Z,outputSize:R}),C&&(A.cause=Object.assign(new Error(C.message),{name:C.name})),E&&(A.codecImportFailed=!0),f(A)}else{if(n==nEe){let{value:y,done:_}=await a.read();b()||ute({type:nte,value:y,done:_,messageId:o},t)}n==nte&&(await c.ready,await c.write(new Uint8Array(i)),b()||ute({type:iEe,messageId:o},t)),n==oEe&&f(null,r)}}catch(y){b()||(mte(t),f(y))}function f(y,_){b()||(y?u(y):d(_),c&&c.releaseLock(),y&&y.codecImportFailed||m())}}Fne();var qzi=x(T(),1);var Hzi=x(T(),1);bc();m0();yZ();mw();bz();_z();zee();bZ();mE();Mte();QY();var Bne="File already exists",zne="Zip file comment exceeds 64KB",fAe="Invalid zip file comment (must be a Uint8Array)",pAe="File entry comment exceeds 64KB",bAe="Invalid file entry comment (must be a string)",gAe="Invalid date (must be a valid Date instance)",yAe="File entry name exceeds 64KB",Hne="Version exceeds 65535",xAe="The strength must equal 1, 2, or 3",TAe="Encryption is not supported in USDZ files",_Ae="Encryption is not supported when the 'passThrough' option is set",SAe="Invalid extra field (must be a Map)",ZAe="Invalid extra field type (must be integer 0..65535)",RAe="Invalid extra field data (must be a Uint8Array)",Qz="Extra field data exceeds 64KB",s_t="Compression method not supported",CAe=-2147483648,VAe=2147483647,oAe=BigInt(0),rAe=BigInt("0x7fffffffffffffff"),qz="Zip64 is not supported (set the 'zip64' option to 'true')",EAe="Undefined uncompressed size",AAe="Undefined compression method";var GAe="Undefined reader",LAe="Zip file not empty",WAe="Invalid uid (must be integer 0..2^32-1)",vAe="Invalid gid (must be integer 0..2^32-1)",FAe="Invalid UNIX mode (must be integer 0..65535)",IAe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",PAe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",XAe="Invalid msdosAttributesRaw (must be integer 0..255)",NAe="Invalid msdosAttributes (must be an object with boolean flags)",YAe="Invalid level (must be integer 0..9)",wAe="Signature data exceeds 64KB",sAe=new Uint8Array([7,0,2,0,65,69,3,0,0]),a_t=4,c_t=9,l_t=67,d_t=1,Mne="infozip",kne="unix",u_t=9,Ine=0,aAe=[],Aw=class{constructor(t,n={}){t=new ZE(t);let{availableSize:i=hZ,maxSize:o=hZ}=t,r=i>0&&i!==hZ&&o>0&&o!==hZ;Object.assign(this,{writer:t,addSplitZipSignature:r,options:n,fileEntries:new Map,filenames:new Set,offset:n[jY]===ke?t.size||t.writable.size||0:n[jY],initialOffset:n[jY]===ke?0:n[jY]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Pne(this,m_t(this,t))}appendZip(t){return Pne(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:o,fileEntries:r}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(u=>s=u);i.add(a);let c=[],d;try{t=new wg(t),await Xc(t),(t.size===ke||!t.readUint8Array)&&(t=new qd(await p0(t.readable)),await Xc(t));let{ZipReader:u}=await Promise.resolve().then(()=>(Fne(),eAe)),m=new u(t),p=await m.getEntries();await m.close(),await Xc(n.writer);let{directoryOffset:b}=m;p.forEach(({filename:_})=>{if(o.has(_))throw new Error(Bne);o.add(_),c.push(_)}),n.writerLocked=!0;let{lockWriter:f}=n;n.lockWriter=new Promise(_=>d=()=>{n.writerLocked=!1,_()}),await f,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await W_t(t)||(await T0(n.writer,kAe()),n.offset+=4));let y=await v_t(n,t,p,b);p.forEach(_=>{let{version:S,rawLastModDate:Z,rawFilename:R,bitFlag:C,encrypted:E,uncompressedSize:A,compressedSize:L,extraFieldZip64:F}=_,{compressionMethod:I,rawExtraField:N}=_,{level:g,languageEncodingFlag:V,dataDescriptor:G}=C;N=MAe(N||yo),_.extraFieldAES&&(I=99);let v=so(N),X=!!F&&F.uncompressedSize!==ke,Y=!!F&&F.compressedSize!==ke,D=zAe(g,V,G,E,I)&-7|g<<1,{headerArray:w,headerView:O}=BAe({version:S,bitFlag:D,compressionMethod:I,uncompressedSize:A,compressedSize:L,rawLastModDate:Z,rawFilename:R,zip64CompressedSize:Y,zip64UncompressedSize:X,extraFieldLength:v}),{crc32:M}=_;M!==ke&&Nc(O,10,M);let{offset:z,diskNumberStart:K}=y.get(_);Object.assign(_,{zip64UncompressedSize:X,zip64CompressedSize:Y,offset:z,diskNumberStart:K,zip64DiskNumberStart:!1,rawExtraFieldZip64:yo,rawExtraFieldAES:yo,rawExtraFieldExtendedTimestamp:yo,rawExtraFieldNTFS:yo,rawExtraFieldUnix:yo,rawExtraField:N,rawCentralExtraField:yo,extendedTimestamp:!1,headerArray:w,headerView:O}),r.set(_.filename,_)})}catch(u){throw c.forEach(m=>o.delete(m)),u}finally{s(),i.delete(a),d&&d()}}add(t="",n,i={}){let o=this,{pendingAddFileCalls:r}=o,s=h_t(o,t,n,i);r.add(s);let a=()=>r.delete(s);return Promise.prototype.then.call(s,a,a),Pne(o,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==fZ&&(t=i.get(t)),t&&t.filename!==ke){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=yo,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;if(!(t instanceof Uint8Array))throw new Error(fAe);if(so(t)>65535)throw new Error(zne);for(;o.size;)await Promise.allSettled(Array.from(o));await Promise.allSettled(i.pendingErrors.map(d=>d.recorded));let a=i.pendingErrors.filter(d=>d.error&&!d.observed);if(a.length){let d=a.map(m=>m.error);a.forEach(m=>m.observed=!0);let[u]=d;try{u.entryErrors=d}catch{}throw u}return await V_t(i,t,n),!Tz(r)&&Qi(i,n,w3)||await s.getWriter().close(),r.getData?r.getData():s}};var Une=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Pne(e,t){let n=new Une((o,r)=>Promise.prototype.then.call(t,o,r)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,ke,o=>i.error=o),e.pendingErrors.push(i),n}async function m_t(e,t){if(e.filenames.size)throw new Error(LAe);await e.appendZipEntries(t)}async function h_t(e,t,n,i){if(i=Object.assign({},i),Qi(e,i,SZ)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Bne);e.filenames.add(t),Ine<Xg().maxWorkers?Ine++:await new Promise(o=>aAe.push(o));try{return await f_t(e,t,n,i)}catch(o){throw e.filenames.delete(t),o}finally{let o=aAe.shift();o?o():Ine--}}async function f_t(e,t,n,i){let o=p_t(e,t,i);({name:t}=o);let r=b_t(e,t,i),{comment:s}=r,a=i[Vz];e.fileEntries.set(t,ke);let c=e.lastFileEntry,d={},u;r.resolvedOptions.keepOrder&&(d.lockFileEntry=new Promise(p=>u=p)),e.lastFileEntry=d;let m;try{let{resolvedOptions:p}=r;p.level!=0&&p.compressionMethod===ke&&!p.passThrough&&!await cEe(Xg())&&(p.level=0);let b=await g_t(e,n,r,i);({reader:n}=b);let f=Gw(e.writer),y=Ug(e.writer);i=Object.assign({},i,o.resolvedOptions,r.resolvedOptions,b.resolvedOptions,{signature:i[Cz],crc32:i.crc32===ke?i[Cz]:i.crc32,offset:e.offset-f,diskNumberStart:y,[oE]:e.options[oE]});let _=__t(i),S=Z_t(i),Z=so(_.localHeaderArray,S.dataDescriptorArray);m=await x_t(e,t,n,{headerInfo:_,dataDescriptorInfo:S,metadataSize:Z,fileEntry:d,previousFileEntry:c,releaseLockFileEntry:u},i)}catch(p){throw e.fileEntries.delete(t),p}finally{u&&u(c&&c.lockFileEntry)}return Object.assign(m,{name:t,comment:s,extraField:a,[Sz]:m.internalFileAttributes,[Zz]:m.externalFileAttributes}),new oT(m)}function p_t(e,t,n){let i=Qi(e,n,Gte),o=Qi(e,n,vte,i?20:768),r=Qi(e,n,Ite),s=IE(e,n,"uid"),a=IE(e,n,"gid"),c=IE(e,n,Xte),d=Qi(e,n,sVe),u=Qi(e,n,Nte),m=Qi(e,n,Yte),p=Qi(e,n,wte);if(sE(s,4294967295,WAe),sE(a,4294967295,vAe),sE(c,65535,FAe),d!==ke&&d!==Mne&&d!==kne)throw new Error(IAe);if(d===kne&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(PAe);d===ke&&(s!==ke||a!==ke)&&(d=Mne);let b=IE(e,n,Ete),f=Qi(e,n,Ate),y=s!==ke||a!==ke||c!==ke||d||r,_=b!==ke||f!==ke;if(y?(i=!1,o=o&255|768):_&&(i=!0,o=o&255),sE(b,255,XAe),f&&(typeof f!==FCe||Array.isArray(f)))throw new Error(NAe);if(o>65535)throw new Error(Hne);let S=OAe(e,n,Vte,Zz),Z=S!==ke;Z||(S=0),!n[SZ]&&t.endsWith("/")&&(n[SZ]=!0);let R=Qi(e,n,SZ);if(R?(t.endsWith("/")||(t+="/"),Z||(S=16,i||(S|=16877<<16))):!i&&!Z&&(r?S=493<<16:S=420<<16),!i){let A=c!==ke||!!(u||m||p),L=S>>16&65535;c=c===ke?L:c&65535,u?c|=2048:u=!!(c&2048),m?c|=1024:m=!!(c&1024),p?c|=512:p=!!(c&512),(!Z||A)&&(R?c=c&-61441|16384:c&61440||(c|=32768),S=(c&65535)<<16|S&65535)}({msdosAttributesRaw:b,msdosAttributes:f}=S_t(b,f)),_&&(S=S&4294967295|b&255);let C=S>>16&65535,E=c!==ke&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:o,msDosCompatible:!!i,externalFileAttributes:S,unixExternalUpper:C,uid:s,gid:a,unixMode:c,unixExtraFieldType:d,symlink:E,setuid:u,setgid:m,sticky:p,msdosAttributesRaw:b,msdosAttributes:f}}}function b_t(e,t,n){let i=Dne(e,n,rVe)||cE,o=i(t,M3);if(o===ke&&(o=cE(t)),so(o)>65535)throw new Error(yAe);let r=n[gw]||"";if(typeof r!=fZ)throw new Error(bAe);let s=i(r,k3);if(s===ke&&(s=cE(r)),so(s)>65535)throw new Error(pAe);let a=Qi(e,n,Wte);if(a!==ke&&a>65535)throw new Error(Hne);let c=wne(e,n,RE,new Date),d=Qi(e,n,CE),u=wne(e,n,xw),m=wne(e,n,Tw),p=OAe(e,n,Cte,Sz,0),b=Qi(e,n,I3),f=Qi(e,n,v3),y=Qi(e,n,F3);O3(f,y);let _=IE(e,n,JCe,3),S=Qi(e,n,Fte),Z=Qi(e,n,jCe,!0),R=Qi(e,n,QCe),C=Qi(e,n,qCe,!0),E=Qi(e,n,X3),A=Qi(e,n,Y3),L=Qi(e,n,eVe),F=Dne(e,n,tVe),I=Qi(e,n,nVe,!0),N=D3(Qi(e,n,P3)),g=Qi(e,n,iVe,!0),V=Qi(e,n,Pte),G=b||V===ke?ke:ez(V);if(!b&&V!==ke&&V!==0&&V!==8&&!G)throw new Error(s_t);let v=IE(e,n,$Ce);if(sE(v,u_t,YAe),e.options[oE]){if(f!==ke||y!==ke)throw new Error(TAe);v===ke&&V===ke&&(v=0)}b&&(v=ke);let X=Qi(e,n,N3),Y=Qi(e,n,Mee);L&&Y===ke&&(Y=!1),(Y===ke||S&&!b)&&(Y=!0),v!==ke&&v!=6&&(X=!1);let D=Qi(e,n,Rz);if(!S&&(f!==ke||y!==ke)&&!(Number.isInteger(_)&&_>=1&&_<=3))throw new Error(xAe);let w=Xne(n[Vz]),O=Xne(n[aVe]),M=Xne(n[cVe]);return{comment:r,resolvedOptions:{rawFilename:o,rawComment:s,version:a,lastModDate:c,rawLastModDate:d,lastAccessDate:u,creationDate:m,internalFileAttributes:p,passThrough:b,password:f,rawPassword:y,encryptionStrength:_,zipCrypto:S,extendedTimestamp:Z,ntfsTimestamp:R,keepOrder:C,useWebWorkers:E,transferStreams:A,bufferedWrite:L,createTempStream:F,dataDescriptorSignature:I,signal:N,useUnicodeFileNames:g,compressionMethod:V,format:G?G.format:ke,codecURI:G?G.codecURI:ke,codecVersionNeeded:G?G.versionNeeded:ke,level:v,useCompressionStream:X,dataDescriptor:Y,zip64:D,rawExtraField:w,rawLocalExtraField:O,rawCentralExtraField:M}}}function Xne(e){if(!e)return yo;if(!(e instanceof Map))throw new Error(SAe);let t=0,n=0;e.forEach((r,s)=>{if(Dee(s,65535,ZAe),!(r instanceof Uint8Array))throw new Error(RAe);if(so(r)>65535)throw new Error(Qz);t+=4+so(r)});let i=new Uint8Array(t),o=hi(i);return e.forEach((r,s)=>{x0(o,n,s),x0(o,n+2,so(r)),vw(i,r,n+4),n+=4+so(r)}),i}async function g_t(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Qi(e,i,SZ))throw new Error(GAe);let o;return t&&(t=new wg(t),await Xc(t),{size:o}=t),Object.assign({reader:t},y_t(e,!!t,o,n,i))}function y_t(e,t,n,i,o){let{passThrough:r,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:d}=i,{dataDescriptor:u,zip64:m,level:p,compressionMethod:b}=i,f=0,y=0;if(r&&t){if(y=o[yw],y===ke)throw new Error(EAe);if(b===ke)throw new Error(AAe)}let _=m===!0,S=Qi(e,o,Lte);if(t&&r&&!S&&so(a,c))throw new Error(_Ae);let Z=t&&(!!(a&&so(a)||c&&so(c))||r&&S);t||(p=0,b=0);let R=Z?s?12:16+d*4:0;t&&(r?(o.uncompressedSize=y,f=n===ke?hAe(y)+R:n):n===ke?(u=!0,(m||m===ke)&&(m=!0,y=f=4294967296)):(o.uncompressedSize=y=n,f=(One(b,p)?hAe(y):y)+R));let C=!Z&&(!t||n===0&&!r)&&!One(b,p);C&&!s&&Qi(e,o,Mee)===ke&&(u=!1);let E=_||y>=4294967295,A=_||f>=4294967295;if(E||A){if(m===!1)throw new Error(qz);m=!0}return m=m||!1,{maximumCompressedSize:f,resolvedOptions:{dataDescriptor:u,emptyEntry:C,zip64:m,zip64UncompressedSize:E,zip64CompressedSize:A,uncompressedSize:y,level:p,compressionMethod:b,encrypted:Z}}}async function x_t(e,t,n,i,o){let{fileEntries:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:d,signal:u}=o,{headerInfo:m,fileEntry:p,previousFileEntry:b,releaseLockFileEntry:f}=i,y=e.options[oE],_=p,S,Z,R,C,E,A=0,L,F=a&&b?b.lockFileEntry:ke;r.set(t,_);try{o.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!d?(S=!0,e.bufferedWrites++,o.createTempStream?L=await o.createTempStream():L=new TransformStream(ke,ke,{highWaterMark:hZ}),L.size=0,await Xc(s)):(L=s,await F,await I()),await Xc(L);let g=Gw(s);e.addSplitZipSignature&&!S&&await dAe(e,s),y&&!S&&cAe(i,e.offset-g);let{localHeaderArray:V}=m;S||await N();let G=Ug(s),v=Lw(e,s);if(_.diskNumberStart=G,S||(C=!0,E=s.size,await T0(L,V)),_=await T_t(n,L,_,i,Xg(),o),S||(C=!1),r.set(t,_),_.filename=t,S){if(await Promise.all([L.writable.getWriter().close(),F]),await I(),e.addSplitZipSignature&&await dAe(e,s),R=!0,E=s.size,await N(),_.diskNumberStart=Ug(s),_.offset=Lw(e,s),y){let X=i.metadataSize;cAe(i,e.offset-Gw(s)),_.size+=i.metadataSize-X}C_t(_,m.localHeaderView,o),await T0(s,m.localHeaderArray),await UAe(L.readable,s,u,X=>A+=X),s.size+=L.size,R=!1}else _.diskNumberStart=G,_.offset=v;return e.offset+=_.size,_}catch(g){if(R||C){if(e.hasCorruptedEntries=!0,g)try{g.corruptedEntry=!0}catch{}e.offset+=s.size-E,S&&(e.offset+=A)}throw r.delete(t),g}finally{if(S&&e.bufferedWrites--,f&&f(F),Z&&Z(),S&&L&&L.dispose)try{await L.dispose()}catch{}}async function I(){e.writerLocked=!0;let{lockWriter:g}=e;e.lockWriter=new Promise(V=>Z=()=>{e.writerLocked=!1,V()}),await g}async function N(){PE(s,so(m.localHeaderArray))&&await s.closeDisk()}}async function T_t(e,t,{diskNumberStart:n,lockFileEntry:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{headerArray:u,headerView:m,lastModDate:p,rawLastModDate:b,encrypted:f,compressed:y,version:_,compressionMethod:S,rawExtraFieldZip64:Z,localExtraFieldZip64Length:R,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:E,rawExtraFieldNTFS:A,rawExtraFieldUnix:L,rawExtraFieldAES:F}=a,{dataDescriptorArray:I}=c,{rawFilename:N,lastAccessDate:g,creationDate:V,password:G,rawPassword:v,level:X,zip64:Y,zip64UncompressedSize:D,zip64CompressedSize:w,zipCrypto:O,dataDescriptor:M,directory:z,executable:K,versionMadeBy:te,rawComment:H,rawExtraField:$,rawCentralExtraField:ee,useWebWorkers:le,transferStreams:_e,onstart:he,onprogress:Ze,onend:ye,signal:Ge,encryptionStrength:Ae,extendedTimestamp:Fe,msDosCompatible:tt,internalFileAttributes:Be,externalFileAttributes:je,uid:qe,gid:We,unixMode:Ke,symlink:ct,setuid:Et,setgid:zt,sticky:ut,unixExternalUpper:bt,msdosAttributesRaw:ht,msdosAttributes:jt,useCompressionStream:st,passThrough:pt,format:wi,codecURI:jn}=s,_i={lockFileEntry:i,versionMadeBy:te,zip64:Y,directory:!!z,executable:!!K,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:H,rawExtraFieldZip64:Z,localExtraFieldZip64Length:R,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:A,rawExtraFieldUnix:L,rawExtraFieldAES:F,rawExtraField:$,rawCentralExtraField:ee,extendedTimestamp:Fe,msDosCompatible:tt,internalFileAttributes:Be,externalFileAttributes:je,diskNumberStart:n,uid:qe,gid:We,unixMode:Ke,symlink:!!ct,setuid:Et,setgid:zt,sticky:ut,unixExternalUpper:bt,msdosAttributesRaw:ht,msdosAttributes:jt},{crc32:Hi,uncompressedSize:Gi}=s,fi=0;pt||(Gi=0);let{writable:Si}=t;if(e){let On=kf(bte(e)),rn=e.size,Hn={options:{codecType:gE,inputSize:rn,level:X,rawPassword:v,password:G,encryptionStrength:Ae,zipCrypto:f&&O,passwordVerification:f&&O&&b>>8&255,computeCrc32:!pt,compressed:y&&!pt,encrypted:f&&!pt,useWebWorkers:le,useCompressionStream:st,transferStreams:_e,format:wi,codecURI:jn,compressionMethod:S},config:r,streamOptions:{signal:Ge,size:rn,onstart:he,onprogress:Ze,onend:ye}};try{let $i=await pz({readable:On,writable:Si},Hn);if(fi=$i.outputSize,t.size+=fi,pt||(Gi=$i.inputSize,(!f||O)&&(Hi=$i.crc32)),!w&&fi>=4294967295||!D&&Gi>=4294967295)throw new Error(qz)}catch($i){throw $i.outputSize!==ke&&(t.size+=$i.outputSize),$i}}return R_t({crc32:Hi,compressedSize:fi,uncompressedSize:Gi,headerInfo:a,dataDescriptorInfo:c},s),M&&await T0(t,I),Object.assign(_i,{uncompressedSize:Gi,compressedSize:fi,lastModDate:p,rawLastModDate:b,creationDate:V,lastAccessDate:g,encrypted:!!f,zipCrypto:!!O,size:d+fi,compressionMethod:S,version:_,headerArray:u,headerView:m,signature:Hi,crc32:f&&!O&&!pt?ke:Hi,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:D,zip64CompressedSize:w}),_i}function __t(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:o,creationDate:r,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:d,dataDescriptor:u,directory:m,rawExtraField:p,rawLocalExtraField:b,encryptionStrength:f,extendedTimestamp:y,ntfsTimestamp:_,passThrough:S,encrypted:Z,zip64UncompressedSize:R,zip64CompressedSize:C,uncompressedSize:E,crc32:A}=e,{version:L,compressionMethod:F}=e,I=!m&&One(F,s),N,g=S||!I,V=a&&(e.bufferedWrite||!u||!R&&!C||g),G=V||a&&u&&(R||C);if(a&&(R||C)){let ye=$u(20);if(ye.writeUint16(1),ye.writeUint16(16),N=ye.array,V&&(ye.writeUint64(E),g)){let Ge=Z?c?12:16+f*4:0;ye.writeUint64(S?0:E+Ge)}}else N=yo;let v;if(Z&&!c){let Ze=$u(so(sAe)+2);Ze.writeUint16(39169),Ze.writeBytes(sAe),v=Ze.array,v[8]=f}else v=yo;let X,Y,D;if(y){let Ze=Kz(n),ye=DAe(Ze);if(ye){let Ae=9+(o?4:0)+(r?4:0),Fe=$u(Ae);D=1+(o?2:0)+(r?4:0),Fe.writeUint16(21589),Fe.writeUint16(Ae-4),Fe.writeUint8(D),Fe.writeUint32(Ze),o&&Fe.writeUint32(uAe(Kz(o))),r&&Fe.writeUint32(uAe(Kz(r))),Y=Fe.array}else Y=yo;if(_===ke?!ye||!!(o||r):_)try{let Ae=Yne(n),Fe=$u(36);Fe.writeUint16(10),Fe.writeUint16(32),Fe.skip(4),Fe.writeUint16(1),Fe.writeUint16(24),Fe.writeUint64(Ae),Fe.writeUint64(o?Yne(o):Ae),Fe.writeUint64(r?Yne(r):Ae),X=Fe.array}catch{X=yo}else X=yo}else X=Y=yo;let w;try{let{uid:Ze,gid:ye,unixExtraFieldType:Ge}=e;if(Ge==Mne&&(Ze!==ke||ye!==ke)){let Ae=lAe(Ze===ke?0:Ze),Fe=lAe(ye===ke?0:ye),tt=3+Ae.length+Fe.length,Be=$u(4+tt);Be.writeUint16(30837),Be.writeUint16(tt),Be.writeUint8(1),Be.writeUint8(Ae.length),Be.writeBytes(Ae),Be.writeUint8(Fe.length),Be.writeBytes(Fe),w=Be.array}else if(Ge==kne&&(Ze!==ke||ye!==ke)){let Ae=$u(8);Ae.writeUint16(30805),Ae.writeUint16(4),Ae.writeUint16((Ze===ke?0:Ze)&65535),Ae.writeUint16((ye===ke?0:ye)&65535),w=Ae.array}else w=yo}catch{w=yo}F===ke&&(F=I?8:0),L===ke&&(L=F==0&&!m&&!Z?10:20);let{codecVersionNeeded:O}=e;I&&O!==ke&&(L=L>O?L:O),a&&(L=L>45?L:45),Z&&!c&&(L=L>51?L:51,S&&A!==ke&&(v[a_t]=d_t),x0(hi(v),c_t,F),F=99);let M=G?so(N):0,z=M+so(v,Y,X,w,p,b),K=e[oE]?l_t:0;if(z+K>65535)throw new Error(Qz);let te=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:H,headerView:$,rawLastModDate:ee}=BAe({version:L,bitFlag:zAe(s,d,u,Z,F),compressionMethod:F,uncompressedSize:E,lastModDate:te<iE?iE:te>wee?wee:te,rawLastModDate:i,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:R,extraFieldLength:z}),le=$u(30+so(t)+z),_e=le.array,he=hi(_e);return le.writeUint32(67324752),le.writeBytes(H),le.writeBytes(t),G&&le.writeBytes(N),le.writeBytes(v),le.writeBytes(Y),le.writeBytes(X),le.writeBytes(w),le.writeBytes(p),le.writeBytes(b),u&&(C||Nc(he,18,0),R||Nc(he,22,0)),{localHeaderArray:_e,localHeaderView:he,headerArray:H,headerView:$,lastModDate:n,rawLastModDate:ee,encrypted:Z,compressed:I,version:L,compressionMethod:F,extraFieldExtendedTimestampFlag:D,rawExtraFieldZip64:yo,localExtraFieldZip64Length:M,rawExtraFieldExtendedTimestamp:Y,rawExtraFieldNTFS:X,rawExtraFieldUnix:w,rawExtraFieldAES:v,extraFieldLength:z}}function cAe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=64-(t+so(i))%64;r<4&&(r+=64);let s=new Uint8Array(r),a=hi(s);x0(a,0,6534),x0(a,2,r-4);let c=i;n.localHeaderArray=i=new Uint8Array(so(c)+r),vw(i,c),vw(i,s,so(c));let d=hi(i);x0(d,28,o+r),n.localHeaderView=d,e.metadataSize+=r}function lAe(e){let t=new Uint8Array(4);hi(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function S_t(e,t){if(e!==ke)e=e&255;else if(t!==ke){let{readOnly:n,hidden:i,system:o,directory:r,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),o&&(a|=4),r&&(a|=16),s&&(a|=32),e=a&255}return t===ke&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function Z_t({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=yo,o,r=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),o=hi(i),n&&(r=4,Nc(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function R_t({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:d,encrypted:u}=i,{dataDescriptorView:m,dataDescriptorOffset:p}=o;(!u||s||a)&&e!==ke&&(Nc(d,10,e),c&&Nc(m,p,e)),r?c&&(Ww(m,p+4,BigInt(t)),Ww(m,p+12,BigInt(n))):(Nc(d,14,t),Nc(d,18,n),c&&(Nc(m,p+4,t),Nc(m,p+8,n)))}function C_t({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:o,compressedSize:r,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},d,{dataDescriptor:u,passThrough:m}){if(u||((!t||m&&o!==ke)&&Nc(d,14,o),c||Nc(d,18,r),a||Nc(d,22,s)),n&&i){let p=30+so(e)+4;Ww(d,p,BigInt(s)),Ww(d,p+8,BigInt(r))}}async function V_t(e,t,n){let i=E_t(e.fileEntries),{directoryStart:o,directoryEnd:r,directoryArray:s}=await A_t(e,i,n),a=await G_t(e,s,n);await L_t(e,t,n,{directoryStart:o,directoryEnd:r,directoryDataLength:i,signatureLength:a})}function E_t(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:o,rawComment:r,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:d,extendedTimestamp:u,extraFieldExtendedTimestampFlag:m,lastModDate:p,zip64UncompressedSize:b,zip64CompressedSize:f,uncompressedSize:y,compressedSize:_}=n,S=n.offset>=4294967295,Z=n.diskNumberStart>=65535,R;if(S||Z||b||f){let L=4+(b?8:0)+(f?8:0)+(S?8:0)+(Z?4:0),F=$u(L);F.writeUint16(1),F.writeUint16(L-4),b&&F.writeUint64(y),f&&F.writeUint64(_),S&&F.writeUint64(n.offset),Z&&F.writeUint32(n.diskNumberStart),R=F.array}else R=yo;n.rawExtraFieldZip64=R,n.zip64Offset=S,n.zip64DiskNumberStart=Z;let C,E=Kz(p);if(u&&DAe(E)){let L=$u(9);L.writeUint16(21589),L.writeUint16(5),L.writeUint8(m),L.writeUint32(E),C=L.array}else C=yo;n.rawExtraFieldExtendedTimestamp=C;let A=so(R,o,s,a,C,c,d);if(A>65535)throw new Error(Qz);t+=46+so(i,r)+A}return t}async function A_t(e,t,n){let{fileEntries:i,writer:o}=e,r=new Uint8Array(t);await Xc(o);let s=0,a=0,c=Ug(o),d=Gw(o),u=0;for(let[m,p]of Array.from(i.values()).entries()){let{offset:b,rawFilename:f,rawExtraFieldZip64:y,rawExtraFieldAES:_,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:Z,rawExtraFieldUnix:R,rawExtraField:C,rawCentralExtraField:E,rawComment:A,versionMadeBy:L,headerArray:F,headerView:I,zip64UncompressedSize:N,zip64CompressedSize:g,zip64DiskNumberStart:V,zip64Offset:G,internalFileAttributes:v,externalFileAttributes:X,diskNumberStart:Y,uncompressedSize:D,compressedSize:w}=p,O=so(y,_,S,Z,R,C,E),M=46+so(f,A)+O;PE(o,s+M-a)&&(await T0(o,r.slice(a,s)),a=s,u=0,await o.closeDisk()),m==0&&(c=Ug(o),d=Gw(o)),N||Nc(I,18,D),g||Nc(I,14,w),(G||V)&&p.version<45&&x0(I,0,45);let z=$u(M);if(z.writeUint32(33639248),z.writeUint16(L),z.writeBytes(F.subarray(0,24)),z.writeUint16(O),z.writeUint16(so(A)),z.writeUint16(V?65535:Y),z.writeUint16(v),z.writeUint32(X),z.writeUint32(G?4294967295:b),z.writeBytes(f),z.writeBytes(y),z.writeBytes(_),z.writeBytes(S),z.writeBytes(Z),z.writeBytes(R),z.writeBytes(C),z.writeBytes(E),z.writeBytes(A),vw(r,z.array,s),s+=M,u++,n.onprogress)try{await n.onprogress(m+1,i.size,new oT(p))}catch{}}return await T0(o,a?r.slice(a):r),{directoryStart:{diskNumber:c,diskOffset:d},directoryEnd:{diskNumber:Ug(o),entriesLength:u},directoryArray:r}}async function G_t(e,t,n){let i=Dne(e,n,hVe);if(i){let o=await i(t),r=so(o);if(r>65535)throw new Error(wAe);let s=$u(6+r);s.writeUint32(84233040),s.writeUint16(r),s.writeBytes(o);let{writer:a}=e;return PE(a,so(s.array))&&await a.closeDisk(),await T0(a,s.array),6+r}return 0}async function L_t(e,t,n,i){let{writer:o}=e,{directoryStart:r,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,d=e.fileEntries.size,u=r.diskNumber,m=Lw(e,r),p=so(t);if(p>65535)throw new Error(zne);let b=Qi(e,n,Rz),f=Ug(o);if(PE(o,(b?98:22)+p)&&f++,m>=4294967295||c>=4294967295||d>=65535||f>=65535){if(b===!1)throw new Error(qz);b=!0}let y=$u(b?98:22);PE(o,so(y.array)+p)&&await o.closeDisk(),f=Ug(o);let _=f==s.diskNumber?s.entriesLength:0;b&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(f),y.writeUint32(u),y.writeUint64(_),y.writeUint64(d),y.writeUint64(c),y.writeUint64(m),y.writeUint32(117853008),y.writeUint32(f),y.writeUint64(BigInt(Lw(e,o))+BigInt(c)+BigInt(a)),y.writeUint32(f+1),Qi(e,n,oVe,!0)&&(f=65535,u=65535),_=65535,d=65535,m=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(f),y.writeUint16(u),y.writeUint16(_),y.writeUint16(d),y.writeUint32(c),y.writeUint32(m),y.writeUint16(p),await T0(o,y.array),p&&await T0(o,t)}function $u(e){let t=new Uint8Array(e),n=hi(t),i=0;return{array:t,writeUint8:o=>{P_t(n,i,o),i+=1},writeUint16:o=>{x0(n,i,o),i+=2},writeUint32:o=>{Nc(n,i,o),i+=4},writeUint64:o=>{Ww(n,i,BigInt(o)),i+=8},writeBytes:o=>{vw(t,o,i),i+=so(o)},skip:o=>i+=o}}function Ug(e){let{diskNumber:t=0}=e;return t}function Gw(e){let{diskOffset:t=0}=e;return t}function PE(e,t){let{availableSize:n=hZ}=e;return t>n}function Lw(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function W_t(e){let t=await wr(e,0,4);return I_t(hi(t),0)==134695760}function MAe(e){let t=hi(e),n=0;for(;n+4<=so(e);){let i=4+jz(t,n+2);if(jz(t,n)==1)return MAe(uh(e.subarray(0,n),e.subarray(Math.min(n+i,so(e)))));n+=i}return e}async function v_t(e,t,n,i){let{writer:o}=e,r=new Map;if(o.closeDisk){let s=Array.from(n).sort((c,d)=>Hz(t,c)-Hz(t,d)),a=0;for(let c of s){let d=Hz(t,c);await Nne(e,t,a,d-a),PE(o,await F_t(t,d))&&await o.closeDisk(),r.set(c,{offset:Lw(e,o),diskNumberStart:Ug(o)}),a=d}await Nne(e,t,a,i-a)}else{let s=e.offset;await Nne(e,t,0,i),n.forEach(a=>r.set(a,{offset:s+Hz(t,a),diskNumberStart:0}))}return r}async function Nne(e,t,n,i){if(i>0){let{writer:o}=e,r=0;try{await UAe(bte(t,{offset:n,size:i}),o,ke,s=>r+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{o.size+=r,e.offset+=r}}}async function F_t(e,t){let n=await wr(e,t,30);if(so(n)<30)return 30;let i=hi(n);return 30+jz(i,26)+jz(i,28)}function Hz(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function kAe(){let e=new Uint8Array(4);return Nc(hi(e),0,134695760),e}async function dAe(e,t){delete e.addSplitZipSignature,await T0(t,kAe()),e.offset+=4}async function T0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=so(t),await i.write(t)}finally{i.releaseLock()}}async function UAe(e,t,n,i){let o=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(r){await o.ready,await o.write(r),i(so(r))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function Yne(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<oAe?oAe:t>rAe?rAe:t}}function Kz(e){return Math.floor(e.getTime()/1e3)}function DAe(e){return e>=CAe&&e<=VAe}function uAe(e){return Math.min(VAe,Math.max(CAe,e))}function Qi(e,t,n,i){let o=t[n]===ke?e.options[n]:t[n];return o===ke?i:o}function wne(e,t,n,i){let o=Qi(e,t,n,i);if(o===null)return i;if(o!==ke&&(typeof o.getTime!=Yr||Number.isNaN(o.getTime())))throw new Error(gAe);return o}function Dne(e,t,n){return rE(Qi(e,t,n))}function OAe(e,t,n,i,o){let r=mAe(t,n,i),s=r===ke?mAe(e.options,n,i):r;return s===ke?o:s}function mAe(e,t,n){return e[t]===ke?e[n]:e[t]}function IE(e,t,n,i){return pZ(Qi(e,t,n,i))}function hAe(e){return e+5*(Math.floor(e/16383)+1)}function One(e,t){return e===ke?t===ke||t>0:e!==0}function jz(e,t){return e.getUint16(t,!0)}function I_t(e,t){return e.getUint32(t,!0)}function P_t(e,t,n){e.setUint8(t,n)}function x0(e,t,n){e.setUint16(t,n,!0)}function Nc(e,t,n){e.setUint32(t,n,!0)}function Ww(e,t,n){e.setBigUint64(t,n,!0)}function vw(e,t,n){e.set(t,n)}function so(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function BAe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:d,extraFieldLength:u}){let m=$u(26),p=m.array,b=hi(p);if(m.writeUint16(e),m.writeUint16(t),m.writeUint16(n),s===ke){let f=new Uint32Array(1),y=hi(f);x0(y,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),x0(y,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate()),s=f[0]}return m.writeUint32(s),m.skip(4),c||o!==ke?m.writeUint32(c?4294967295:o):m.skip(4),d||i!==ke?m.writeUint32(d?4294967295:i):m.skip(4),m.writeUint16(so(a)),m.writeUint16(u),{headerArray:p,headerView:b,rawLastModDate:s}}function zAe(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}_z();QY();var tHi=x(T(),1);m0();yZ();var aHi=x(T(),1);bc();m0();yZ();tte();var lHi=x(T(),1);var mHi=x(T(),1);var dHi=1024*1024;var bHi=x(T(),1);mE();var fHi=1024*1024;var THi=x(T(),1);var gHi=1024*1024;var yHi=512*1024;var N_t={};try{aE({baseURI:N_t.url})}catch{}var SKi=x(T(),1);m0();var nKi=x(T(),1),Y_t=[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],w_t=[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],M_t=[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],k_t=[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],U_t=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Iw=new Uint8Array(288);Iw.fill(8,0,144),Iw.fill(9,144,256),Iw.fill(7,256,280),Iw.fill(8,280,288);var D_t=new Uint8Array(30).fill(5);function Fw(e){let t=new Uint16Array(16);for(let o of e)t[o]++;t[0]=0;let n=new Uint16Array(17);for(let o=1;o<=15;o++)n[o+1]=n[o]+t[o];let i=new Uint16Array(e.length);for(let o=0;o<e.length;o++)e[o]&&(i[n[e[o]]++]=o);return{l:t,symbols:i}}var em="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function HAe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",o=n.length,r=0;for(;r+2<o;r+=3){let a=n[r]<<16|n[r+1]<<8|n[r+2];i+=em[a>>18&63]+em[a>>12&63]+em[a>>6&63]+em[63&a]}let s=o-r;if(s===1){let a=n[r]<<16;i+=em[a>>18&63]+em[a>>12&63]+"=="}else if(s===2){let a=n[r]<<16|n[r+1]<<8;i+=em[a>>18&63]+em[a>>12&63]+em[a>>6&63]+"="}return i})((function(n){let i=0,o=0,r=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=u(1);let _=u(2);if(_==0)m();else if(_==1)p(Fw(Iw),Fw(D_t));else{if(_!=2)throw new Error("invalid deflate block type");p(...b())}}return s.subarray(0,a);function d(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function u(_){for(;r<_;)o|=d()<<r,r+=8;let S=o&(1<<_)-1;return o>>>=_,r-=_,S}function m(){o=0,r=0;let _=d()|d()<<8;i+=2,y(a+_);for(let S=0;S<_;S++)s[a++]=d()}function p(_,S){let Z=f(_);for(;Z!=256;){if(Z<256)y(a+1),s[a++]=Z;else{let R=Z-257,C=Y_t[R]+u(w_t[R]),E=f(S),A=M_t[E]+u(k_t[E]);y(a+C);let L=a-A;for(let F=0;F<C;F++)s[a++]=s[L+F]}Z=f(_)}}function b(){let _=u(5)+257,S=u(5)+1,Z=u(4)+4,R=new Uint8Array(19);for(let L=0;L<Z;L++)R[U_t[L]]=u(3);let C=Fw(R),E=new Uint8Array(_+S),A=0;for(;A<E.length;){let L=f(C);if(L<16)E[A++]=L;else if(L==16){let F=E[A-1],I=u(2)+3;for(;I--;)E[A++]=F}else A+=L==17?u(3)+3:u(7)+11}return[Fw(E.subarray(0,_)),Fw(E.subarray(_))]}function f(_){let{l:S,symbols:Z}=_,R=0,C=0,E=0;for(let A=1;A<=15;A++){R|=u(1);let L=S[A];if(R-C<L)return Z[E+(R-C)];E+=L,C=C+L<<1,R<<=1}throw new Error("invalid huffman code")}function y(_){if(s.length<_){let S=2*s.length;for(;S<_;)S*=2;let Z=new Uint8Array(S);Z.set(s.subarray(0,a)),s=Z}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,o=[];for(let r=0;r<i;r+=4){let s=em.indexOf(n[r])<<18|em.indexOf(n[r+1])<<12|(63&em.indexOf(n[r+2]))<<6|63&em.indexOf(n[r+3]);o.push(s>>16&255),n[r+2]!=="="&&o.push(s>>8&255),n[r+3]!=="="&&o.push(255&s)}return new Uint8Array(o)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNtEURRp5axyShkXWxfpx3S7HcVaP2WeMnGqh9pf+u0oS37DHY4f3Xz0wtYXjOqcPf/wudODzY8/cH7z8yqZG12ePX928MDW6c+rNJ+6p9rF6PqxrQtnNre3VTauZfP8Q2rm4Ojy3OntwQNnLpzf/tyjmw+p2Sw8kMaar6Teopi85Kbn5qZuffZXzj6m9s0290atj2rlxg80V7vbfmhzsu3mitveX0xectvzc1O3uO0Ds829pu2Do1rR9oJ7eGtzU5kDzc1dIMSPnj537sIZpTOu9Ozpc2d/ZVOpGx944Oz5h85ubZ4ZPPDw586fGZy9cP6BwenPnNvU6sYHNh/dPrN19rHB5vkHtgenz/Qe2NrcHlzY2lTR4SsefXZz8MCZz21tbZ4fqLh64IEzj59+4Oz5M1ubj26eHzyw+fiZzce48q3Nh89c+Nz5gbq9NauV11lLHep2bvj4LR9dbv/9PzF3GpV95/06G75H+aJXtY8qs3LlHyn/U33SrfhnDiwaVVlfkPJZ7f/a9lHY6FaxtxcrdbHS3vYdvtB+uO11n1RdGW8HlfbfPFBXivSieelApRdNWkVrXCNZ/wSZz/eXjerojCJSy6ZDiqJlk2akfVqXijRxLcbbrWXjc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hz5+mRzdMPbW7Rw+dOf3b6i4fObg9Onz+zOX33M2cHoRra2nxs8/RADS5coEdPn/9Cc/vC1uhT2v7Co5+5cG579PX24MLW5kP0mXMXzvQaaNRnPvfww5tbtLm1dWFLbQ+2Nk8/Gi6mgF9aokfPbm+fPf9Z2jz/0NKFh5e4GnX2/JkLW1ubZwZNV848sjl1O8C1+/ZDpwenRzenu0zo08Ont+gzp8/0VFPt1hkA8OjpwZlHRl98/uz5hy58nrbP/srmGEXcu8EXHtu8yshwf65slO82w3LmwqOPbW1ub5+9cJ4e3Rw8cuEhJf8Vak7tU0qlKlEtFau2ilSmnOooq3Jl1IzSalb5VzvZHzqrnIpUrBKVqpZqq0zlalbNqf3qBtVVR9R71AfVR9Wd6pfUf6HOqG31tPqH6s/U/6GMbtqa/psLf/vC3/7wNx/+DoS/Qm2o7/LOmVECA2DN1Zy6UZXqw8qr0+pJ9SdK6yeRpspqp2Od6o4u9IImfYte0Q9Ott+02bSFNg6qg+oGdYNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}var yKi=x(T(),1);bc();m0();mw();bz();var cKi=x(T(),1);var oKi=x(T(),1),tH="deflate",$z="deflate-raw",KAe="deflate64-raw",eH="gzip",Ls,XE,Dg,Pw,JAe;function jAe(e){if(Ls=e,{malloc:XE,free:Dg,memory:Pw}=Ls,typeof XE!="function"||typeof Dg!="function"||!Pw)throw Ls=XE=Dg=Pw=null,new Error("Invalid WASM module")}function QAe(e){JAe=e}function qAe(e,t,n={}){if(!Ls){let a=new Error("WASM module not loaded");throw a.cause=JAe,a}let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let a;if(this.out=XE(o),this.in=XE(r),this.inBufferSize=r,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(o),e?(this._process=Ls.deflate_process,this._last_consumed=Ls.deflate_last_consumed,this._end=Ls.deflate_end,this.streamHandle=Ls.deflate_new(),t===eH?a=Ls.deflate_init_gzip(this.streamHandle,i):t===$z?a=Ls.deflate_init_raw(this.streamHandle,i):a=Ls.deflate_init(this.streamHandle,i)):t===KAe?(this._process=Ls.inflate9_process,this._last_consumed=Ls.inflate9_last_consumed,this._end=Ls.inflate9_end,this.streamHandle=Ls.inflate9_new(),a=Ls.inflate9_init_raw(this.streamHandle)):(this._process=Ls.inflate_process,this._last_consumed=Ls.inflate_last_consumed,this._end=Ls.inflate_end,this.streamHandle=Ls.inflate_new(),t===$z?a=Ls.inflate_init_raw(this.streamHandle):t===eH?a=Ls.inflate_init_gzip(this.streamHandle):a=Ls.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let d=a,u=new Uint8Array(Pw.buffer),m=this._process,p=this._last_consumed,b=this.out,f=this._scratch,y=0;for(;y<d.length;){let _=Math.min(d.length-y,32768);if((!this.in||this.inBufferSize<_)&&(this.in&&Dg&&(Dg(this.in),this.in=0),this.in=XE(_),this.inBufferSize=_,!this.in))throw new Error("allocation failed");u.set(d.subarray(y,y+_),this.in);let S=m(this.streamHandle,this.in,_,b,o,0),Z=S&16777215;if(Z&&(f.set(u.subarray(b,b+Z),0),c.enqueue(f.slice(0,Z))),!e){let C=S>>24&255,E=C&128?C-256:C;if(E<0)throw new Error("process error:"+E)}let R=p(this.streamHandle);if(R===0)break;y+=R}}catch(d){s(this),c.error(d)}},flush(a){try{let c=new Uint8Array(Pw.buffer),d=this._process,u=this.out,m=this._scratch;for(;;){let p=d(this.streamHandle,0,0,u,o,4),b=p&16777215,f=p>>24&255;if(!e){let y=f&128?f-256:f;if(y<0)throw new Error("process error:"+y)}if(b&&(m.set(c.subarray(u,u+b),0),a.enqueue(m.slice(0,b))),f===1||b===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&Dg&&Dg(a.in),a.in=0,a.out&&Dg&&Dg(a.out),a.out=0,c}}var GZ=class{constructor(t=tH,n){return qAe(!0,t,n)}},LZ=class{constructor(t=tH,n){return qAe(!1,t,n)}};GZ.requiresModule=!0;LZ.requiresModule=!0;GZ.supportedFormats=[tH,$z,eH];LZ.supportedFormats=[tH,$z,eH,KAe];var $Ae=!1;async function eGe(e,{baseURI:t}){if(!$Ae)try{await O_t(e,t),$Ae=!0}catch(n){throw QAe(n),n}}async function O_t(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=B_t(e);else throw r}let o=await WebAssembly.instantiate(n);jAe(o.instance.exports)}function B_t(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var nH;sEe({initModule:e=>{if(!nH){let{wasmURI:t}=e;typeof t==Yr&&(t=t()),nH=eGe(t,e).catch(n=>{throw nH=null,n})}return nH}});aE({CompressionStreamFallback:GZ,DecompressionStreamFallback:LZ});HAe(aE);var Kne=32,z_t="http://www.opengis.net/kml/2.2",Of="http://www.google.com/kml/ext/2.2",H_t="http://www.w3.org/2000/xmlns/";function iH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var K_t=/^data:image\/([^,;]+)/;iH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof ve){if(e=ve.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(K_t);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 J_t(e,t){return function(n){e._files[t]=n}}iH.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(J_t(this,r))}return o};Object.defineProperties(iH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function oH(e){this._time=e}oH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};oH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return vZ(n)};oH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Jne(){this._ids={},this._styles={},this._count=0}Jne.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};Jne.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 iGe(){this._ids={}}iGe.prototype.get=function(e){if(!l(e))return this.get(qn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function jne(e){e=e??B.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=jne._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(H_t,"xmlns:gx",Of);let a=r.createElement("Document");s.appendChild(a),rGe(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?j_t(u,c.files):{kml:u,externalFiles:c.files}})}async function j_t(e,t){let n=en("ThirdParty/Workers/zip-web-worker.js"),i=en("ThirdParty/zip-module.wasm");$Y({workerURI:n,wasmURI:i});let o=new SE("application/vnd.google-earth.kmz"),r=new Aw(o);await r.add("doc.kml",new pw(e));let s=Object.keys(t);return await oGe(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function oGe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new qd(n[o])),oGe(e,t,n,i+1)}jne._createState=function(e){let t=e.entities,n=new Jne,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===it.MINIMUM_VALUE?r.stop===it.MAXIMUM_VALUE?r=new Cn:Q.addSeconds(r.stop,-10*s,r.start):r.stop===it.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new iH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(z_t,"kml"),ellipsoid:e.ellipsoid??ne.default,idManager:new iGe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new oH(o),sampleDuration:s,defaultAvailability:new Vs([r])}};function rGe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let m=0;m<a;++m){let p=n[m];c=[],d=[],u=[],Q_t(e,p,d,u),q_t(e,p.polyline,d,u),nGe(e,p.rectangle,d,u,c),nGe(e,p.polygon,d,u,c),nSt(e,p,p.model,d,u);let b,f=p.availability;l(f)&&(b=i.createElement("TimeSpan"),Q.equals(f.start,it.MINIMUM_VALUE)||b.appendChild(En(i,"begin",Q.toIso8601(f.start))),Q.equals(f.stop,it.MAXIMUM_VALUE)||b.appendChild(En(i,"end",Q.toIso8601(f.stop))));for(let S=0;S<c.length;++S){let Z=c[S];Z.setAttribute("id",s.get(p.id)),Z.appendChild(En(i,"name",p.name)),Z.appendChild(En(i,"visibility",p.show)),Z.appendChild(En(i,"description",p.description)),l(b)&&Z.appendChild(b),t.appendChild(Z)}let y=d.length;if(y>0){let S=i.createElement("Placemark");S.setAttribute("id",s.get(p.id));let Z=p.name,R=p.label;if(l(R)){let E=i.createElement("LabelStyle"),A=r.get(R.text);Z=l(A)&&A.length>0?A:Z;let L=r.getColor(R.fillColor);l(L)&&(E.appendChild(En(i,"color",L)),E.appendChild(En(i,"colorMode","normal")));let F=r.get(R.scale);l(F)&&E.appendChild(En(i,"scale",F)),u.push(E)}S.appendChild(En(i,"name",Z)),S.appendChild(En(i,"visibility",p.show)),S.appendChild(En(i,"description",p.description)),l(b)&&S.appendChild(b),t.appendChild(S);let C=u.length;if(C>0){let E=i.createElement("Style");for(let A=0;A<C;++A)E.appendChild(u[A]);S.appendChild(En(i,"styleUrl",o.get(E)))}if(d.length===1)S.appendChild(d[0]);else if(d.length>1){let E=i.createElement("MultiGeometry");for(let A=0;A<y;++A)E.appendChild(d[A]);S.appendChild(E)}}let _=p._children;if(_.length>0){let S=i.createElement("Folder");S.setAttribute("id",s.get(p.id)),S.appendChild(En(i,"name",p.name)),S.appendChild(En(i,"visibility",p.show)),S.appendChild(En(i,"description",p.description)),t.appendChild(S),rGe(e,S,_)}}}var eu=new h,md=new pe,Df=new Q;function Q_t(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){sGe(e,t,a,n,i);return}s.get(c,void 0,eu);let d=En(o,"coordinates",WZ(eu,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(FZ(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof Oc?cGe(e,a):aGe(e,a);i.push(p)}function sGe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof mc?(c=d.intervals,u=!1):c=t.availability??e.defaultAvailability;let m=n instanceof gb,p,b,f,y=[];for(p=0;p<c.length;++p){let S=c.get(p),Z=u?d:S.data,R=r.createElement("altitudeMode");Z instanceof l0?(Z=Z._value,R.appendChild(FZ(e,He.CLAMP_TO_GROUND))):l(n)?R.appendChild(FZ(e,n.heightReference)):R.appendChild(FZ(e,He.NONE));let C=[],E=[];if(Z.isConstant){a.get(Z,void 0,eu);let L=En(r,"coordinates",WZ(eu,s));C.push(Q.toIso8601(S.start)),E.push(L),C.push(Q.toIso8601(S.stop)),E.push(L)}else if(Z instanceof fc)for(f=Z._property._times,b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),Z.getValueInReferenceFrame(f[b],Oi.FIXED,eu),E.push(WZ(eu,s));else if(Z instanceof Hu){f=Z._times;let L=Z._values;for(b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),h.fromArray(L,b*3,eu),E.push(WZ(eu,s))}else{let L=e.sampleDuration;S.start.clone(Df),S.isStartIncluded||Q.addSeconds(Df,L,Df);let F=S.stop;for(;Q.lessThan(Df,F);)Z.getValue(Df,eu),C.push(Q.toIso8601(Df)),E.push(WZ(eu,s)),Q.addSeconds(Df,L,Df);S.isStopIncluded&&Q.equals(Df,F)&&(Z.getValue(Df,eu),C.push(Q.toIso8601(Df)),E.push(WZ(eu,s)))}let A=r.createElementNS(Of,"Track");A.appendChild(R);for(let L=0;L<C.length;++L){let F=En(r,"when",C[L]),I=En(r,"coord",E[L],Of);A.appendChild(F),A.appendChild(I)}m&&A.appendChild(lGe(e,n)),y.push(A)}if(y.length===1)i.push(y[0]);else if(y.length>1){let S=r.createElementNS(Of,"MultiTrack");for(p=0;p<y.length;++p)S.appendChild(y[p]);i.push(S)}if(l(n)&&!m){let S=n instanceof Oc?cGe(e,n):aGe(e,n);o.push(S)}let _=t.path;if(l(_)){let S=a.get(_.width),Z=_.material;if(l(Z)||l(S)){let R=r.createElement("LineStyle");l(S)&&R.appendChild(En(r,"width",S)),Qne(e,Z,R),o.push(R)}}}function aGe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(En(n,"color",r)),o.appendChild(En(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(En(n,"scale",s/Kne)),o}function cGe(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(En(n,"href",s));let b=i.get(t.imageSubRegion);l(b)&&(p.appendChild(En(n,"x",b.x,Of)),p.appendChild(En(n,"y",b.y,Of)),p.appendChild(En(n,"w",b.width,Of)),p.appendChild(En(n,"h",b.height,Of))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(En(n,"color",a)),r.appendChild(En(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(En(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=c??1,k.divideByScalar(d,c,d);let p=i.get(t.width,Kne),b=i.get(t.height,Kne),f=i.get(t.horizontalOrigin,Ui.CENTER);f===Ui.CENTER?d.x-=p*.5:f===Ui.RIGHT&&(d.x-=p);let y=i.get(t.verticalOrigin,Bn.CENTER);y===Bn.TOP?d.y+=b:y===Bn.CENTER&&(d.y+=b*.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),m=i.get(t.alignedAxis);return l(u)&&h.equals(h.UNIT_Z,m)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(En(n,"heading",u))),r}function q_t(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(En(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let m=t.positions,p=s.get(m),b=En(o,"coordinates",WZ(p,r));a.appendChild(b);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(En(o,"drawOrder",f,Of)),n.push(a);let y=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&y.appendChild(En(o,"width",_)),Qne(e,t.material,y),i.push(y)}function $_t(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=[re.northeast,re.southeast,re.southwest,re.northwest];for(let b=0;b<4;++b)d[b](a,md),c.push(`${W.toDegrees(md.longitude)},${W.toDegrees(md.latitude)},${r}`);let u=En(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function tGe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)pe.fromCartesian(t[u],r,md),s.push(`${W.toDegrees(md.longitude)},${W.toDegrees(md.latitude)},${i?md.height:n}`);let c=En(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function eSt(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,m=i.createElement("outerBoundaryIs");m.appendChild(tGe(e,u,r,s)),a.push(m);let p=d.holes;if(l(p)){let b=p.length;for(let f=0;f<b;++f){let y=i.createElement("innerBoundaryIs");y.appendChild(tGe(e,p[f].positions,r,s)),a.push(y)}}return a}function nGe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Kh;if(a&&s.getMaterialType(t.material)==="Image"){tSt(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(En(r,"extrude",!0));let u=a?$_t(e,t,d):eSt(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(FZ(e,t.heightReference)),c.appendChild(p),n.push(c);let b=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&b.appendChild(En(r,"fill",f)),Qne(e,t.material,b);let y=s.get(t.outline,!1);if(y){b.appendChild(En(r,"outline",y));let _=r.createElement("LineStyle"),S=s.get(t.outlineWidth,1);_.appendChild(En(r,"width",S));let Z=s.getColor(t.outlineColor,U.BLACK);_.appendChild(En(r,"color",Z)),_.appendChild(En(r,"colorMode","normal")),i.push(_)}i.push(b)}function tSt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(FZ(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(En(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(En(i,"north",W.toDegrees(d.north))),u.appendChild(En(i,"south",W.toDegrees(d.south))),u.appendChild(En(i,"east",W.toDegrees(d.east))),u.appendChild(En(i,"west",W.toDegrees(d.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),b=i.createElement("Icon");b.appendChild(En(i,"href",p)),s.appendChild(b);let f=m.color;l(f)&&s.appendChild(En(i,"color",vZ(m.color))),n.push(s)}function lGe(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(En(n,"x",s)),d.appendChild(En(n,"y",s)),d.appendChild(En(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(En(n,"href",c)),r.appendChild(a),r}function nSt(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){sGe(e,t,n,i,o);return}let d=lGe(e,n),u=r.createElement("altitudeMode");u.appendChild(FZ(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,eu),pe.fromCartesian(eu,s,md);let m=r.createElement("Location");m.appendChild(En(r,"longitude",W.toDegrees(md.longitude))),m.appendChild(En(r,"latitude",W.toDegrees(md.latitude))),m.appendChild(En(r,"altitude",md.height)),d.appendChild(m),i.push(d)}function Qne(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=vZ(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=vZ(r.color);break;case"PolylineOutline":s=vZ(r.color),c=vZ(r.outlineColor),d=r.outlineWidth,n.appendChild(En(i,"outerColor",c,Of)),n.appendChild(En(i,"outerWidth",d,Of));break;case"Stripe":s=vZ(r.oddColor);break}l(s)&&(n.appendChild(En(i,"color",s)),n.appendChild(En(i,"colorMode","normal")))}function FZ(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,He.NONE),r;switch(o){case He.NONE:r=n.createTextNode("absolute");break;case He.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case He.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function WZ(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,md),i.push(`${W.toDegrees(md.longitude)},${W.toDegrees(md.latitude)},${md.height}`);return i.join(" ")}function En(e,t,n,i){n=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 vZ(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 qne=jne;var Xji=x(T(),1);var uJi=x(T(),1);function Nw(){this._cache={}}Nw.prototype.fromColor=function(e,t){return rH(void 0,void 0,e,t,this._cache)};Nw.prototype.fromUrl=function(e,t,n){return rH(e,void 0,t,n,this._cache)};Nw.prototype.fromMakiIconId=function(e,t,n){return rH(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};Nw.prototype.fromText=function(e,t,n){return rH(void 0,e,t,n,this._cache)};var iSt=new U;function oSt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,iSt).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 dGe(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=U.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=U.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var Xw=new Array(4);function rH(e,t,n,i,o){Xw[0]=e,Xw[1]=t,Xw[2]=n,Xw[3]=i;let r=JSON.stringify(Xw),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(oSt(c,n,i),l(e)){let u=ve.createIfNeeded(e).fetchImage().then(function(m){return dGe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=SS(t,{font:`bold ${i}px sans-serif`});dGe(c,d,i)}return o[r]=a,a}var Og=Nw;var tji=x(T());var xJi=x(T());var bJi=x(T());var hJi=x(T());function $ne(e){return e}function sH(e){if(e==null)return $ne;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,m=new Array(u);for(m[0]=(t+=a[0])*i+r,m[1]=(n+=a[1])*o+s;d<u;)m[d]=a[d],++d;return m}}var CJi=x(T());var _Ji=x(T());function uGe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function eie(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return mGe(e,n)})}:mGe(e,t)}function mGe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=tie(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 tie(e,t){var n=sH(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],b=0,f=p.length;b<f;++b)m.push(n(p[b],b));u<0&&uGe(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,b=u.length;p<b;++p)o(u[p],m);return m.length<2&&m.push(m[0]),m}function a(u){for(var m=s(u);m.length<4;)m.push(m[0]);return m}function c(u){return u.map(a)}function d(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,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:m,coordinates:p}}return d(t)}var WJi=x(T());var EJi=x(T());var PJi=x(T());var kJi=x(T());var NJi=x(T());var KJi=x(T());var OJi=x(T());function aH(e){return h.fromDegrees(e[0],e[1],e[2])}var nie={"urn:ogc:def:crs:OGC:1.3:CRS84":aH,"EPSG:4326":aH,"urn:ogc:def:crs:EPSG::4326":aH},hGe={},fGe={},iie=48,oie,rie=U.ROYALBLUE,sie=U.YELLOW,aie=2,cie=U.fromBytes(255,255,0,100),lie=!1,lSt={small:24,medium:48,large:64},dSt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function pGe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||dSt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${pGe(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 uSt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function mSt(e,t){return new Jh(uSt(pGe,e,t),!0)}function cH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=qn();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 m=u.toLowerCase();if(d>1&&m==="title"){s=u;break}else d>2&&m==="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 gi(c):n(r,s))}return o}function die(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var bGe={Feature:yGe,FeatureCollection:hSt,GeometryCollection:xGe,LineString:RGe,MultiLineString:CGe,MultiPoint:SGe,MultiPolygon:AGe,Point:_Ge,Polygon:EGe,Topology:GGe},gGe={GeometryCollection:xGe,LineString:RGe,MultiLineString:CGe,MultiPoint:SGe,MultiPolygon:AGe,Point:_Ge,Polygon:EGe,Topology:GGe};function yGe(e,t,n,i,o){if(t.geometry===null){cH(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=gGe[r];if(!l(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function hSt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)yGe(e,r[s],void 0,i,o)}function xGe(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=gGe[d];if(!l(u))throw new ae(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function TGe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let b=c["marker-color"];l(b)&&(s=U.fromCssColorString(b)),a=lSt[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 Oc;u.verticalOrigin=new gi(Bn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=He.CLAMP_TO_GROUND);let m=cH(t,e._entityCollection,o.describe);m.billboard=u,m.position=new Ml(n(i));let p=Promise.resolve(d).then(function(b){u.image=new gi(b)}).catch(function(){u.image=new gi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function _Ge(e,t,n,i,o){TGe(e,t,i,n.coordinates,o)}function SGe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)TGe(e,t,i,r[s],o)}function ZGe(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 gi(u));let m,p=a.stroke;l(p)&&(m=U.fromCssColorString(p));let b=a["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.color.getValue().clone()),m.alpha=b),l(m)&&(r=new Qt(m))}let c=cH(t,e._entityCollection,o.describe),d=new qc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new gi(die(i,n)),d.arcType=un.RHUMB}function RGe(e,t,n,i,o){ZGe(e,t,i,n.coordinates,o)}function CGe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ZGe(e,t,i,r[s],o)}function VGe(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 b=c["stroke-width"];l(b)&&(a=new gi(b));let f,y=c.stroke;l(y)&&(f=U.fromCssColorString(y));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new gi(f));let S,Z=c.fill,R=s.color.getValue();l(Z)&&(S=U.fromCssColorString(Z),S.alpha=R.alpha),_=c["fill-opacity"],l(_)&&_!==R.alpha&&(l(S)||(S=R.clone()),S.alpha=_),l(S)&&(s=new Qt(S))}let d=new Hh;d.outline=new gi(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=un.RHUMB;let u=[];for(let b=1,f=i.length;b<f;b++)u.push(new Gc(die(i[b],n)));let m=i[0];d.hierarchy=new gi(new Gc(die(m,n),u)),m[0].length>2?d.perPositionHeight=new gi(!0):o.clampToGround||(d.height=0);let p=cH(t,e._entityCollection,o.describe);p.polygon=d}function EGe(e,t,n,i,o){VGe(e,t,i,n.coordinates,o)}function AGe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)VGe(e,t,i,r[s],o)}function GGe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=eie(n,n.objects[r]),a=bGe[s.type];a(e,s,s,i,o)}}function aT(e){this._name=e,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._entityCollection=new za(this),this._promises=[],this._pinBuilder=new Og,this._entityCluster=new Ou,this._credit=void 0,this._resourceCredits=[]}aT.load=function(e,t){return new aT().load(e,t)};Object.defineProperties(aT,{markerSize:{get:function(){return iie},set:function(e){iie=e}},markerSymbol:{get:function(){return oie},set:function(e){oie=e}},markerColor:{get:function(){return rie},set:function(e){rie=e}},stroke:{get:function(){return sie},set:function(e){sie=e}},strokeWidth:{get:function(){return aie},set:function(e){aie=e}},fill:{get:function(){return cie},set:function(e){cie=e}},clampToGround:{get:function(){return lie},set:function(e){lie=e}},crsNames:{get:function(){return nie}},crsLinkHrefs:{get:function(){return hGe}},crsLinkTypes:{get:function(){return fGe}}});Object.defineProperties(aT.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}}});aT.prototype.load=function(e,t){return LGe(this,e,t,!0)};aT.prototype.process=function(e,t){return LGe(this,e,t,!1)};function LGe(e,t,n,i){Es.setLoading(e,!0),n=n??B.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Lt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),r=t.fetchJson(),s=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:n.describe??mSt,markerSize:n.markerSize??iie,markerSymbol:n.markerSymbol??oie,markerColor:n.markerColor??rie,strokeWidthProperty:new gi(n.strokeWidth??aie),strokeMaterialProperty:new Qt(n.stroke??sie),fillMaterialProperty:new Qt(n.fill??cie),clampToGround:n.clampToGround??lie},Promise.resolve(r).then(function(a){return fSt(e,a,n,s,i)}).catch(function(a){throw Es.setLoading(e,!1),e._error.raiseEvent(e,a),a})}aT.prototype.update=function(e){return!0};function fSt(e,t,n,i,o){let r;l(i)&&(r=Sg(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=bGe[t.type];if(!l(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?aH: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=nie[d.name],!l(c))throw new ae(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=hGe[d.href];if(l(u)||(u=fGe[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=nie[`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,Es.setLoading(e,!1),e})})}var cT=aT;var Yji=x(T(),1);function pSt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Nn=pSt;var G8i=x(T(),1);var DQi=x(T());var EQi=x(T());var Mji=x(T(),1),uie=function(e,t){return uie=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])},uie(e,t)};function _0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");uie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ra=function(){return ra=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},ra.apply(this,arguments)};function WGe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function vGe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var Uji=x(T()),FGe="4.1.5";var Oji=x(T()),IGe=Object.prototype.hasOwnProperty;function tm(e){return typeof e=="boolean"}function PGe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function lT(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Bf(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var s4i=x(T());var Hji=x(T());var lH=/\s+/,dH=(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},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(lH):[],o=t.split(lH),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(lH):[],o=t.split(lH),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(){var t=this.getAttrs(),n=[];for(var i in t)IGe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();var Jji=x(T());function NGe(e,t,n){var i,o;if(n==null?(n="…",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,s=bSt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=XGe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=XGe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=r)return s.host.length===t?(s.host.substr(0,t-o)+n).substr(0,r+i):mie(c,r,n).substr(0,r+i);var d="";if(s.path&&(d+="/"+s.path),s.query&&(d+="?"+s.query),d)if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var u=r-c.length;return(c+mie(d,u,n)).substr(0,r+i)}else c+=d;if(s.fragment){var m="#"+s.fragment;if((c+m).length>=r){if((c+m).length==t)return(c+m).substr(0,t);var p=r-c.length;return(c+mie(m,p,n)).substr(0,r+i)}else c+=m}if(s.scheme&&s.host){var b=s.scheme+"://";if((c+b).length<r)return(b+c).substr(0,t)}if(c.length<=t)return c;var f="";return r>0&&(f=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+f).substr(0,r+i)}function bSt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function XGe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function mie(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),s="";return r<0&&(s=e.substr(r)),e.substr(0,o)+n+s}var Qji=x(T());function YGe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",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 e4i=x(T());function wGe(e,t,n){return PGe(e,t,n)}var MGe=(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 dH({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.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.length)return t;var i=n.length,o=n.location;return o==="smart"?NGe(t,i):o==="middle"?YGe(t,i):wGe(t,i)},e})();var uQi=x(T());var _4i=x(T());var c4i=x(T()),S0=(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 b4i=x(T());var d4i=x(T());function kGe(e){return e>=0&&e<=31||e==127}function Bg(e){return e>=65&&e<=90||e>=97&&e<=122}function sa(e){return e>=48&&e<=57}function uH(e){return e==34||e==39}function dT(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function zf(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function UGe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function DGe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function mH(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function OGe(e){return e<91?e==40:e==91||e==123}function hie(e){return e<93?e==41:e==93||e==125}var m4i=x(T()),BGe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|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|சிங்கப்பூர்|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|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|موريتانيا|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|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|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|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|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|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|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|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|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|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|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|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var fie=/https?:\/\//i,zGe=new RegExp("^"+fie.source,"i"),gSt=/^(javascript|vbscript):/i,ySt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,xSt=/^(?:\/\/)?([^/#?:]+)/,NE=Bg;function pie(e){return Bg(e)||sa(e)||e===43||e===45||e===46}var zg=zf;function hH(e){return e===95||zg(e)}function bie(e){return zf(e)||DGe(e)||mH(e)}function fH(e){return e===47||e===63||e===35}function gie(e){return BGe.test(e.toLowerCase())}function HGe(e){if(gSt.test(e))return!1;var t=e.match(ySt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function KGe(e){var t=e.match(xSt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!gie(o)}var TSt=/^(?:(?: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]?)$/,_St=/[:/?#]/;function JGe(e){var t=e.split(_St,1)[0];return TSt.test(t)}var SSt=/^(https?:\/\/)?(?:www\.)?/i,ZSt=/^\/\//,jGe=(function(e){_0(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=VSt(n)),this.stripPrefix.scheme&&(n=RSt(n)),this.stripPrefix.www&&(n=CSt(n)),this.stripTrailingSlash&&(n=ESt(n)),this.decodePercentEncoding&&(n=ASt(n)),n},t})(S0);function RSt(e){return e.replace(zGe,"")}function CSt(e){return e.includes("www.")?e.replace(SSt,"$1"):e}function VSt(e){return e.replace(ZSt,"")}function ESt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function ASt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var C4i=x(T());var QGe=/^mailto:/i,yie=zf;function pH(e){return yie(e)||UGe(e)}function qGe(e){var t=e.split(".").pop();return gie(t)}var G4i=x(T());var $Ge=(function(e){_0(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})(S0);var v4i=x(T());function xie(e){return e===95||zf(e)}function eLe(e){return e.length<=140}var tLe=["twitter","facebook","instagram","tiktok","youtube"];var N4i=x(T());var nLe=(function(e){_0(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:Bf(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})(S0);var M4i=x(T());var GSt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Tie(e){return e===45||e===46||e===95||Bg(e)||sa(e)}function iLe(e,t){var n=GSt[t];return n.test(e)}var oLe=["twitter","instagram","soundcloud","tiktok","youtube"];var B4i=x(T());var rLe=(function(e){_0(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:Bf(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})(S0);var H4i=x(T()),LSt=/[-. ()]/,WSt=/(?:(?:(?:(\+)?\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]+#?)*/,vSt=/(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})/,FSt=new RegExp("^".concat(WSt.source,"|").concat(vSt.source,"$"));function _ie(e){return e===45||e===46||e===32}function bH(e){return e===44||e===59}function sLe(e){var t=e.charAt(0)==="+"||LSt.test(e);return t&&FSt.test(e)}var Q4i=x(T());var aLe=(function(e){_0(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})(S0);var ISt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),lLe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),lLe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function dLe(e,t){for(var n=new ISt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)gH(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:MSt(n,s,o);break;case 12:kSt(n,s,o);break;case 0:PSt(n,s,o);break;case 1:XSt(n,s,o);break;case 2:NSt(n,s,o);break;case 3:YSt(n,s,o);break;case 4:wSt(n,s,i,o);break;case 5:USt(n,s,o);break;case 6:DSt(n,s,i,o);break;case 7:OSt(n,s,i,o);break;case 13:BSt(n,s,o);break;case 14:zSt(n,s,o);break;case 8:HSt(n,s,o);break;case 9:KSt(n,s,o);break;case 10:JSt(n,s,o);break;case 15:jSt(n,s,i,o);break;case 16:QSt(n,s,i,o);break;case 17:qSt(n,s,i,o);break;case 18:$St(n,s,i,o);break;case 19:eZt(n,s,i,o);break;case 20:tZt(n,s,o);break;case 21:nZt(n,s,o);break;case 22:IZ(n,s,o);break;case 23:iZt(n,s,o);break;case 24:oZt(n,s,o);break;case 25:rZt(n,s,o);break;case 26:sZt(n,s,o);break;case 27:aZt(n,s,o);break;case 28:cZt(n,s,o);break;case 29:lZt(n,s,o);break;case 30:dZt(n,s,o);break;case 31:uZt(n,s,o);break;case 32:hZt(n,s,i,o);break;case 33:fZt(n,s,o);break;case 34:pZt(n,s,o);break;case 35:bZt(n,s,o);break;case 36:gZt(n,s,i,o);break;case 37:mZt(n,s,i,o);break;case 38:yZt(n,s,i,o);break;case 39:xZt(n,s,i,o);break;case 40:TZt(n,s,o);break;case 41:_Zt(n,s,o);break;default:Bf(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&NE(o)){var a=n.text.charCodeAt(n.charIdx-1);NE(a)||n.addMachine(yH(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(d){return Ws(n,d)});return n.matches}function gH(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(VZt(i,28));else if(n===64)e.addMachine(EZt(i,30));else if(n===47)e.addMachine(Zie(i,11));else if(n===43)e.addMachine(Sie(i,37));else if(n===40)e.addMachine(Sie(i,32));else{if(sa(n)&&(e.addMachine(Sie(i,38)),e.addMachine(RZt(i,13))),yie(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(CZt(i,o))}NE(n)&&e.addMachine(yH(i,0)),zf(n)&&e.addMachine(Zie(i,5))}}function PSt(e,t,n){n===58?t.state=2:n===45?t.state=1:pie(n)||e.removeMachine(t)}function XSt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Zie(i,11))):pie(n)?t.state=0:e.removeMachine(t))}function NSt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):zg(n)?(t.state=5,NE(n)&&e.addMachine(yH(i,0))):e.removeMachine(t)}function YSt(e,t,n){n===47?t.state=4:bie(n)?(t.state=10,t.acceptStateReached=!0):Ws(e,t)}function wSt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):zg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function MSt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function kSt(e,t,n){zg(n)?t.state=5:e.removeMachine(t)}function USt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:fH(n)?t.state=10:hH(n)||Ws(e,t)}function DSt(e,t,n,i){i===45||(i===46?Ws(e,t):zg(i)?t.state=5:Ws(e,t))}function OSt(e,t,n,i){i===46?Ws(e,t):zg(i)?(t.state=5,t.acceptStateReached=!0):Ws(e,t)}function BSt(e,t,n){n===46?t.state=14:n===58?t.state=8:sa(n)||(fH(n)?t.state=10:zf(n)?e.removeMachine(t):Ws(e,t))}function zSt(e,t,n){sa(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Ws(e,t)}function HSt(e,t,n){sa(n)?t.state=9:Ws(e,t)}function KSt(e,t,n){sa(n)||(fH(n)?t.state=10:Ws(e,t))}function JSt(e,t,n){bie(n)||Ws(e,t)}function jSt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:IZ(e,t,i)}function QSt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:IZ(e,t,i)}function qSt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:IZ(e,t,i)}function $St(e,t,n,i){n.toLowerCase()==="t"?t.state=19:IZ(e,t,i)}function eZt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:IZ(e,t,i)}function tZt(e,t,n){n===58?t.state=21:IZ(e,t,n)}function nZt(e,t,n){pH(n)?t.state=22:e.removeMachine(t)}function IZ(e,t,n){n===46?t.state=23:n===64?t.state=24:pH(n)?t.state=22:e.removeMachine(t)}function iZt(e,t,n){n===46||n===64?e.removeMachine(t):pH(n)?t.state=22:e.removeMachine(t)}function oZt(e,t,n){zg(n)?t.state=25:e.removeMachine(t)}function rZt(e,t,n){n===46?t.state=27:n===45?t.state=26:hH(n)||Ws(e,t)}function sZt(e,t,n){n===45||n===46?Ws(e,t):hH(n)?t.state=25:Ws(e,t)}function aZt(e,t,n){n===46||n===45?Ws(e,t):zg(n)?(t.state=25,t.acceptStateReached=!0):Ws(e,t)}function cZt(e,t,n){xie(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function lZt(e,t,n){xie(n)||Ws(e,t)}function dZt(e,t,n){Tie(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function uZt(e,t,n){Tie(n)||(zf(n)?e.removeMachine(t):Ws(e,t))}function mZt(e,t,n,i){sa(i)?t.state=38:(e.removeMachine(t),gH(e,n,i))}function hZt(e,t,n,i){sa(i)?t.state=33:e.removeMachine(t),gH(e,n,i)}function fZt(e,t,n){sa(n)?t.state=34:e.removeMachine(t)}function pZt(e,t,n){sa(n)?t.state=35:e.removeMachine(t)}function bZt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function gZt(e,t,n,i){sa(i)?t.state=38:_ie(i)?t.state=39:e.removeMachine(t)}function yZt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,bH(i)?t.state=40:i===35?t.state=41:sa(i)||(i===40?t.state=32:_ie(i)?t.state=39:(Ws(e,t),NE(i)&&e.addMachine(yH(o,0))))}function xZt(e,t,n,i){sa(i)?t.state=38:i===40?t.state=32:(Ws(e,t),gH(e,n,i))}function TZt(e,t,n){bH(n)||(n===35?t.state=41:sa(n)?t.state=38:Ws(e,t))}function _Zt(e,t,n){bH(n)?t.state=40:sa(n)?e.removeMachine(t):Ws(e,t)}function Ws(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,d=e.hashtagServiceName,u=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var m=t.startIdx,p=i.slice(t.startIdx,o);switch(p=ZZt(p),t.type){case 0:{var b=i.charCodeAt(t.startIdx-1);if(b===64)return;switch(t.matchType){case 0:{var f=fie.exec(p);if(f&&(m=m+f.index,p=p.slice(f.index)),!HGe(p))return;break}case 1:{if(!KGe(p))return;break}case 2:{if(!JGe(p))return;break}default:Bf(t)}n.push(new jGe({tagBuilder:r,matchedText:p,offset:m,urlMatchType:SZt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{qGe(p)&&n.push(new $Ge({tagBuilder:r,matchedText:p,offset:m,email:p.replace(QGe,"")}));break}case 2:{eLe(p)&&n.push(new nLe({tagBuilder:r,matchedText:p,offset:m,serviceName:d,hashtag:p.slice(1)}));break}case 3:{iLe(p,u)&&n.push(new rLe({tagBuilder:r,matchedText:p,offset:m,serviceName:u,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),sLe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new aLe({tagBuilder:r,matchedText:p,offset:m,number:y,plusSign:p.charAt(0)==="+"}))}break}default:Bf(t)}}}function SZt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:Bf(e)}}var cLe={")":"(","}":"{","]":"["};function ZZt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);OGe(o)?t[i]++:hie(o)&&t[cLe[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(hie(o)){var s=cLe[i];if(t[s]<0)t[s]++,r--;else break}else if(mH(o))r--;else break}return e.slice(0,r+1)}function yH(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Zie(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function RZt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function CZt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function VZt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function EZt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Sie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function lLe(e){return e.type===0&&e.matchType===0}var bQi=x(T());var Z0=(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})(),Cie=new Z0,AZt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Cie,this.html=t,this.callbacks=n}return e})();function uLe(e,t){for(var n=new AZt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:GZt(n,o);break;case 1:LZt(n,o,r);break;case 2:vZt(n,o,r);break;case 3:WZt(n,o,r);break;case 4:FZt(n,o,r);break;case 5:IZt(n,o,r);break;case 6:PZt(n,o,r);break;case 7:XZt(n,o,r);break;case 8:NZt(n,o);break;case 9:YZt(n,o);break;case 10:wZt(n,o,r);break;case 11:MZt(n,o,r);break;case 12:kZt(n,o);break;case 13:UZt(n);break;case 14:DZt(n,o);break;case 15:OZt(n,o);break;case 16:BZt(n,o);break;case 17:zZt(n,o);break;case 18:HZt(n,o);break;case 19:KZt(n,o);break;case 20:JZt(n,o);break;default:Bf(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&jZt(n)}function GZt(e,t){t==="<"&&R0(e)}function LZt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Z0(ra(ra({},e.currentTag),{isClosing:!0}))):t==="<"?R0(e):Bg(n)?(e.state=3,e.currentTag=new Z0(ra(ra({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Cie)}function WZt(e,t,n){dT(n)?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Rie(e)})),e.state=4):t==="<"?R0(e):t==="/"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Rie(e)})),e.state=12):t===">"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Rie(e)})),C0(e)):!Bg(n)&&!sa(n)&&t!==":"&&ph(e)}function vZt(e,t,n){t===">"?ph(e):Bg(n)?e.state=3:ph(e)}function FZt(e,t,n){dT(n)||(t==="/"?e.state=12:t===">"?C0(e):t==="<"?R0(e):t==="="||uH(n)||kGe(n)?ph(e):e.state=5)}function IZt(e,t,n){dT(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?C0(e):t==="<"?R0(e):uH(n)&&ph(e)}function PZt(e,t,n){dT(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?C0(e):t==="<"?R0(e):uH(n)?ph(e):e.state=5)}function XZt(e,t,n){dT(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?ph(e):t==="<"?R0(e):e.state=10)}function NZt(e,t){t==='"'&&(e.state=11)}function YZt(e,t){t==="'"&&(e.state=11)}function wZt(e,t,n){dT(n)?e.state=4:t===">"?C0(e):t==="<"&&R0(e)}function MZt(e,t,n){dT(n)?e.state=4:t==="/"?e.state=12:t===">"?C0(e):t==="<"?R0(e):(e.state=4,QZt(e))}function kZt(e,t){t===">"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{isClosing:!0})),C0(e)):ph(e)}function UZt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Z0(ra(ra({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Z0(ra(ra({},e.currentTag),{type:"doctype"})),e.state=20):ph(e)}function DZt(e,t){t==="-"?e.state=15:t===">"?ph(e):e.state=16}function OZt(e,t){t==="-"?e.state=18:t===">"?ph(e):e.state=16}function BZt(e,t){t==="-"&&(e.state=17)}function zZt(e,t){t==="-"?e.state=18:e.state=16}function HZt(e,t){t===">"?C0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function KZt(e,t){t==="-"?e.state=17:t===">"?C0(e):e.state=16}function JZt(e,t){t===">"?C0(e):t==="<"&&R0(e)}function ph(e){e.state=0,e.currentTag=Cie}function R0(e){e.state=1,e.currentTag=new Z0({idx:e.charIdx})}function C0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),ph(e),e.currentDataIdx=e.charIdx+1}function jZt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Rie(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function QZt(e){e.charIdx--}var qZt=(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=$Zt(t.urls),this.email=tm(t.email)?t.email:this.email,this.phone=tm(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=tm(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=eRt(t.stripPrefix),this.stripTrailingSlash=tm(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=tm(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&oLe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&tLe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=tRt(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 uLe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,d=s.split(c),u=a;d.forEach(function(m,p){if(p%2===0){var b=n.parseText(m,u);r.push.apply(r,vGe([],WGe(b),!1))}u+=m.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(nRt);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||lT(t,function(n){return n.getType()==="hashtag"}),this.email||lT(t,function(n){return n.getType()==="email"}),this.phone||lT(t,function(n){return n.getType()==="phone"}),this.mention||lT(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||lT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||lT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||lT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=dLe(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,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),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 dH)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new MGe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=FGe,e})(),mLe=qZt;function $Zt(e){return e==null&&(e=!0),tm(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:tm(e.schemeMatches)?e.schemeMatches:!0,tldMatches:tm(e.tldMatches)?e.tldMatches:!0,ipV4Matches:tm(e.ipV4Matches)?e.ipV4Matches:!0}}function eRt(e){return e==null&&(e=!0),tm(e)?{scheme:e,www:e}:{scheme:tm(e.scheme)?e.scheme:!0,www:tm(e.www)?e.www:!0}}function tRt(e){return typeof e=="number"?{length:e,location:"end"}:ra({length:Number.POSITIVE_INFINITY,location:"end"},e)}function nRt(e,t){return e.getOffset()-t.getOffset()}var LQi=x(T());var AQi=x(T());var wQi=x(T());var xH=mLe;var _Le;typeof DOMParser<"u"&&(_Le=new DOMParser);var iRt=new xH({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),TH=32,hLe=2414016,fLe=1,pLe=16093e3,bLe=.1,oRt=[null,void 0,"http://www.topografix.com/GPX/1/1"],nr={gpx:oRt};function rRt(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 Vie(e,t){let n=Mw(e,"id");return n=l(n)?n:qn(),t.getOrCreateEntity(n)}function Eie(e){let t=gLe(e,"lon"),n=gLe(e,"lat"),i=Yw(e,"ele",nr.gpx);return h.fromDegrees(t,n,i)}function gLe(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 Mw(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function uT(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 Aie(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 Yw(e,t,n){let i=uT(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function tu(e,t,n){let i=uT(e,t,n);if(l(i))return i.textContent.trim()}function SLe(e){let t=new Oc;return t.width=TH,t.height=TH,t.scaleByDistance=new Kt(hLe,fLe,pLe,bLe),t.pixelOffsetScaleByDistance=new Kt(hLe,fLe,pLe,bLe),t.verticalOrigin=new gi(Bn.BOTTOM),t.image=e,t}function sRt(){let e=new zh;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Ui.LEFT,e.font="16px sans-serif",e.style=Tr.FILL_AND_OUTLINE,e}function ZLe(e){let t=new qc;return t.width=4,t.material=new Ux,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var yLe={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"}},ww;typeof document<"u"&&(ww=document.createElement("div"));function Gie(e,t){let n,i="",o=Object.keys(yLe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=yLe[u];m.value=tu(e,m.tag,nr.gpx)??"",l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=iRt.link(i),ww.innerHTML=i;let s=ww.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=U.WHITE,c=U.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+=`${ww.innerHTML}</div>`,ww.innerHTML="",d}function RLe(e,t,n,i){let o=Eie(t),r=Vie(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,TH);r.billboard=SLe(s);let a=tu(t,"name",nr.gpx);r.name=a,r.label=sRt(),r.label.text=a,r.description=Gie(t,r),i.clampToGround&&(r.billboard.heightReference=He.CLAMP_TO_GROUND,r.label.heightReference=He.CLAMP_TO_GROUND)}function aRt(e,t,n,i){let o=Vie(t,n);o.description=Gie(t,o);let r=Aie(t,"rtept",nr.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)RLe(e,r[a],n,i),s[a]=Eie(r[a]);o.polyline=ZLe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function cRt(e,t,n,i){let o=Vie(t,n);o.description=Gie(t,o);let r=Aie(t,"trkseg",nr.gpx),s=[],a=[],c,d=!0,u=new fc;for(let m=0;m<r.length;m++)c=lRt(r[m]),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 m=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,TH);o.billboard=SLe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=He.CLAMP_TO_GROUND),o.availability=new Vs,o.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}o.polyline=ZLe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function lRt(e){let t={positions:[],times:[]},n=Aie(e,"trkpt",nr.gpx),i;for(let o=0;o<n.length;o++){let r=Eie(n[o]);t.positions.push(r),i=tu(n[o],"time",nr.gpx),l(i)&&t.times.push(Q.fromIso8601(i))}return t}function dRt(e){let t=uT(e,"metadata",nr.gpx);if(l(t)){let n={name:tu(t,"name",nr.gpx),desc:tu(t,"desc",nr.gpx),author:uRt(t),copyright:hRt(t),link:CLe(t),time:tu(t,"time",nr.gpx),keywords:tu(t,"keywords",nr.gpx),bounds:fRt(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 uRt(e){let t=uT(e,"author",nr.gpx);if(l(t)){let n={name:tu(t,"name",nr.gpx),email:mRt(t),link:CLe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function mRt(e){let t=uT(e,"email",nr.gpx);if(l(t)){let n=tu(t,"id",nr.gpx),i=tu(t,"domain",nr.gpx);return`${n}@${i}`}}function CLe(e){let t=uT(e,"link",nr.gpx);if(l(t)){let n={href:Mw(t,"href"),text:tu(t,"text",nr.gpx),mimeType:tu(t,"type",nr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function hRt(e){let t=uT(e,"copyright",nr.gpx);if(l(t)){let n={author:Mw(t,"author"),year:tu(t,"year",nr.gpx),license:tu(t,"license",nr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function fRt(e){let t=uT(e,"bounds",nr.gpx);if(l(t)){let n={minLat:Yw(t,"minlat",nr.gpx),maxLat:Yw(t,"maxlat",nr.gpx),minLon:Yw(t,"minlon",nr.gpx),maxLon:Yw(t,"maxlon",nr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var xLe={wpt:RLe,rte:aRt,trk:cRt};function pRt(e,t,n,i){let o=Object.keys(xLe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=xLe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&nr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function TLe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=Mw(o,"version"),s=Mw(o,"creator"),a,c=dRt(o);l(c)&&(a=c.name),o.localName==="gpx"?pRt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),m=u.start,p=u.stop,b=Q.equals(m,it.MINIMUM_VALUE),f=Q.equals(p,it.MAXIMUM_VALUE);if(!b||!f){let _;b&&(_=new Date,_.setHours(0,0,0,0),m=Q.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=Q.fromDate(_)),d=new Wf,d.startTime=m,d.stopTime=p,d.currentTime=Q.clone(m),d.clockRange=As.LOOP_STOP,d.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,m)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),bRt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==r&&(e._version=r,y=!0),d!==e._clock&&(y=!0,e._clock=d),y&&e._changed.raiseEvent(e),Es.setLoading(e,!1),e}function bRt(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 gRt(e,t,n,i){i=i??B.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof ve){n=ve.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?rRt(r).then(function(s){let a,c;try{a=_Le.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 TLe(e,a,i)}):TLe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function YE(){this._changed=new Se,this._error=new Se,this._loading=new Se,this._clock=void 0,this._entityCollection=new za(this),this._entityCluster=new Ou,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Og}YE.load=function(e,t){return new YE().load(e,t)};Object.defineProperties(YE.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}}});YE.prototype.update=function(e){return!0};YE.prototype.load=function(e,t){if(!l(e))throw new ge("data is required.");t=t??B.EMPTY_OBJECT,Es.setLoading(this,!0);let n=this._name,i=this;return gRt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Q.equals(s,it.MINIMUM_VALUE),d=Q.equals(a,it.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=Q.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=Q.fromDate(m)),o=new Wf,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=As.LOOP_STOP,o.clockStep=Oo.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),Es.setLoading(i,!1),i}).catch(function(o){return Es.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var kw=YE;var W8i=x(T(),1);function yRt(e,t){this.position=e,this.headingPitchRoll=t}var Uw=yRt;var y7i=x(T(),1);var Kw=x(bu(),1);var F8i=x(T(),1);function xRt(e,t){this.position=e,this.headingPitchRange=t}var Dw=xRt;var N8i=x(T(),1);function _H(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Se,this.tourEnd=new Se,this.entryStart=new Se,this.entryEnd=new Se,this._activeEntries=[]}_H.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};_H.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;ELe.call(this,e,t,function(i){n.playlistIndex=0,i||VLe(n._activeEntries),n.tourEnd.raiseEvent(i)})};_H.prototype.stop=function(){VLe(this._activeEntries)};function VLe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function ELe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=TRt.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 TRt(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++,ELe.call(this,e,t,n)}}var Ow=_H;var e6i=x(T(),1);var K8i=x(T(),1);var B8i=x(T(),1),ao=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-ao.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?ao.Bounce.In(e*2)*.5:ao.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}}}}),Bw=function(){return performance.now()},_Rt=(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=Bw()),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})(),wE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=wE.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=wE.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=wE.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=wE.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}}},ALe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Lie=new _Rt,GLe=(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=ao.Linear.None,this._interpolationFunction=wE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ALe.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=Lie,Lie.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=Bw()),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 m=i[s];if(m.length===0)continue;for(var p=[a],b=0,f=m.length;b<f;b+=1){var y=this._handleRelativeValue(a,m[b]);if(isNaN(y)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var S in _)n[s][S]=_[S];o[s]=c?[]:{};var m=i[s];if(!this._isDynamic){var Z={};for(var S in m)Z[S]=m[S];i[s]=m=Z}this._setupProperties(_,n[s],m,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=Bw()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Bw()),!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=ao.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=wE.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=Bw()),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 y=Math.trunc(s/a),_=s-y*a,S=Math.min(_/i._duration,1);return S===0&&s===i._duration?1:S},u=d(),m=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),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 b=0,f=this._chainedTweens.length;b<f;b++)this._chainedTweens[b].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 Y8i=ALe.nextId,V0=Lie,w8i=V0.getAll.bind(V0),M8i=V0.removeAll.bind(V0),k8i=V0.add.bind(V0),U8i=V0.remove.bind(V0),D8i=V0.update.bind(V0);var SRt={LINEAR_NONE:ao.Linear.None,QUADRATIC_IN:ao.Quadratic.In,QUADRATIC_OUT:ao.Quadratic.Out,QUADRATIC_IN_OUT:ao.Quadratic.InOut,CUBIC_IN:ao.Cubic.In,CUBIC_OUT:ao.Cubic.Out,CUBIC_IN_OUT:ao.Cubic.InOut,QUARTIC_IN:ao.Quartic.In,QUARTIC_OUT:ao.Quartic.Out,QUARTIC_IN_OUT:ao.Quartic.InOut,QUINTIC_IN:ao.Quintic.In,QUINTIC_OUT:ao.Quintic.Out,QUINTIC_IN_OUT:ao.Quintic.InOut,SINUSOIDAL_IN:ao.Sinusoidal.In,SINUSOIDAL_OUT:ao.Sinusoidal.Out,SINUSOIDAL_IN_OUT:ao.Sinusoidal.InOut,EXPONENTIAL_IN:ao.Exponential.In,EXPONENTIAL_OUT:ao.Exponential.Out,EXPONENTIAL_IN_OUT:ao.Exponential.InOut,CIRCULAR_IN:ao.Circular.In,CIRCULAR_OUT:ao.Circular.Out,CIRCULAR_IN_OUT:ao.Circular.InOut,ELASTIC_IN:ao.Elastic.In,ELASTIC_OUT:ao.Elastic.Out,ELASTIC_IN_OUT:ao.Elastic.InOut,BACK_IN:ao.Back.In,BACK_OUT:ao.Back.Out,BACK_IN_OUT:ao.Back.InOut,BOUNCE_IN:ao.Bounce.In,BOUNCE_OUT:ao.Bounce.Out,BOUNCE_IN_OUT:ao.Bounce.InOut},vs=Object.freeze(SRt);function SH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}SH.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 de(this.view.position);t.flyToBoundingSphere(o,i)}};SH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};SH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=vs.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=It(t,e)),t};var zw=SH;var i6i=x(T(),1);function Wie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Wie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Wie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var Hw=Wie;var wLe={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=Q0(t),wLe[t]}},kie;typeof DOMParser<"u"&&(kie=new DOMParser);var ZRt=new xH({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),mT=32,LLe=2414016,WLe=1,vLe=16093e3,FLe=.1,ILe=[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"],PLe=["http://www.google.com/kml/ext/2.2"],RRt=["http://www.w3.org/2005/Atom"],De={kml:ILe,gx:PLe,atom:RRt,kmlgx:ILe.concat(PLe)},Uie={Document:JLe,Folder:DRt,Placemark:ORt,NetworkLink:$Rt,GroundOverlay:jRt,PhotoOverlay:qLe,ScreenOverlay:JRt,Tour:zRt},Xie=class{constructor(t){this._dataSource=t,this._deferred=Zd(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=Hg._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=Hg._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,o=n.nodes;if(i!==o.length)return++n.index,o[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,o=this._nextNode();for(;l(o);){let r=Uie[o.localName];if(l(r)&&(De.kml.indexOf(o.namespaceURI)!==-1||De.gx.indexOf(o.namespaceURI)!==-1)&&(r(n,o,i,this),this._timeoutSet||Hg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}o=this._nextNode()}this._pop()&&t&&this._process(!0)}};function CRt(e){let t=e.slice(0,Math.min(4,e.size)),n=Zd(),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 VRt(e){let t=Zd(),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 MLe(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 kLe(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}async function ERt(e,t){let n=await e.getData(new bw);n=MLe(n),n=kLe(n),t.kml=kie.parseFromString(n,"application/xml")}async function vie(e,t){let n=wLe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new fw(n));t[e.filename]=i}function nm(e,t,n,i){let o=i.keys,r=new Kw.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 m=new Kw.default(d).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let b=o[p];c.setAttribute(n,i[b]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",b)}}}}function im(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=Die(a,i);l(c)&&s.setAttribute(n,c.url)}}function ULe(e,t,n){let i=Ga(e,"id");i=l(i)&&i.length!==0?i:qn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=qn(),l(n)&&(i=n+i)),o=t.add(new er({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Mie),o}function Jw(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function VH(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.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,h.fromDegrees(i,o,r,t)}function ZH(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++]=VH(n[s],t);return o}function hT(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 Ga(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function co(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 XLe(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 Hf(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 Ai(e,t,n){let i=co(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Yn(e,t,n){let i=co(e,t,n);if(l(i))return i.textContent.trim()}function Kf(e,t,n){let i=co(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function Die(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 ve({url:o});else{let r=new Kw.default(t.getUrlComponent()),s=new Kw.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new ve({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var nu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Nie(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?(nu.maximumRed=r,nu.red=void 0):(nu.maximumRed=void 0,nu.red=0),o>0?(nu.maximumGreen=o,nu.green=void 0):(nu.maximumGreen=void 0,nu.green=0),i>0?(nu.maximumBlue=i,nu.blue=void 0):(nu.maximumBlue=void 0,nu.blue=0),nu.alpha=n,U.fromRandom(nu)):new U(r,o,i,n)}function PZ(e,t,n){let i=Yn(e,t,n);if(l(i))return Nie(i,Yn(e,"colorMode",n)==="random")}function ARt(e){let t=co(e,"TimeStamp",De.kmlgx),n=Yn(t,"when",De.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Vs;return o.addInterval(new Cn({start:i,stop:it.MAXIMUM_VALUE})),o}function GRt(e){let t=co(e,"TimeSpan",De.kmlgx);if(!l(t))return;let n,i=co(t,"begin",De.kmlgx),o=l(i)?Q.fromIso8601(i.textContent):void 0,r=co(t,"end",De.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 Vs,n.addInterval(new Cn({start:o,stop:s}))}else l(o)?(n=new Vs,n.addInterval(new Cn({start:o,stop:it.MAXIMUM_VALUE}))):l(s)&&(n=new Vs,n.addInterval(new Cn({start:it.MINIMUM_VALUE,stop:s})));return n}function DLe(){let e=new Oc;return e.width=mT,e.height=mT,e.scaleByDistance=new Kt(LLe,WLe,vLe,FLe),e.pixelOffsetScaleByDistance=new Kt(LLe,WLe,vLe,FLe),e}function Oie(){let e=new Hh;return e.outline=!0,e.outlineColor=U.WHITE,e}function OLe(){let e=new zh;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Ui.LEFT,e.font="16px sans-serif",e.style=Tr.FILL_AND_OUTLINE,e}function Bie(e,t,n,i,o){let r=Yn(e,"href",De.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=Ai(e,"x",De.gx)??0,d=Ai(e,"y",De.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=Die(r,n,i);if(o){let a=Yn(e,"refreshMode",De.kml),c=Yn(e,"viewRefreshMode",De.kml);a==="onInterval"||a==="onExpire"?xt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&xt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=Yn(e,"viewBoundScale",De.kml)??1,u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=Yn(e,"viewFormat",De.kml)??u,p=Yn(e,"httpQuery",De.kml);l(m)&&s.setQueryParameters(gu(CH(m))),l(p)&&s.setQueryParameters(gu(CH(p)));let b=t._ellipsoid;return Hie(s,t.camera,t.canvas,d,t._lastCameraView.bbox,b),s}return s}function LRt(e,t,n,i,o){let r=Ai(t,"scale",De.kml),s=Ai(t,"heading",De.kml),a=PZ(t,"color",De.kml),c=co(t,"Icon",De.kml),d=Bie(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=Ai(c,"x",De.gx),m=Ai(c,"y",De.gx),p=Ai(c,"w",De.gx),b=Ai(c,"h",De.gx),f=co(t,"hotSpot",De.kml),y=hT(f,"x"),_=hT(f,"y"),S=Ga(f,"xunits"),Z=Ga(f,"yunits"),R=n.billboard;l(R)||(R=DLe(),n.billboard=R),R.image=d,R.scale=r,R.color=a,(l(u)||l(m)||l(p)||l(b))&&(R.imageSubRegion=new nt(u,m,p,b)),l(s)&&s!==0&&(R.rotation=W.toRadians(-s),R.alignedAxis=h.UNIT_Z),r=r??1;let C,E;l(y)&&(S==="pixels"?C=-y*r:S==="insetPixels"?C=(y-mT)*r:S==="fraction"&&(C=-y*mT*r),C+=mT*.5*r),l(_)&&(Z==="pixels"?E=_*r:Z==="insetPixels"?E=(-_+mT)*r:Z==="fraction"&&(E=_*mT*r),E-=mT*.5*r),(l(C)||l(E))&&(R.pixelOffset=new k(C,E))}function RH(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")LRt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=OLe(),n.label=c),c.scale=Ai(a,"scale",De.kml)??c.scale,c.fillColor=PZ(a,"color",De.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new qc,n.polyline=c),c.width=Ai(a,"width",De.kml),c.material=PZ(a,"color",De.kml),l(PZ(a,"outerColor",De.gx))&&xt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Ai(a,"outerWidth",De.gx))&&xt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Ai(a,"physicalWidth",De.gx))&&xt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Kf(a,"labelVisibility",De.gx))&&xt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Oie(),n.polygon=c),c.material=PZ(a,"color",De.kml)??c.material,c.fill=Kf(a,"fill",De.kml)??c.fill,c.outline=Kf(a,"outline",De.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Nie(Yn(a,"bgColor",De.kml))??U.WHITE,d=Nie(Yn(a,"textColor",De.kml))??U.BLACK,u=Yn(a,"text",De.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Yn(a,"listItemType",De.kml);(c==="radioFolder"||c==="checkOffOnly")&&xt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function WRt(e,t,n,i,o){let r=new er,s,a=-1,c=t.childNodes,d=c.length;for(let m=0;m<d;m++){let p=c[m];(p.localName==="Style"||p.localName==="StyleMap")&&(a=m)}if(a!==-1){let m=c[a];if(m.localName==="Style")RH(e,m,r,i,o);else{let p=Hf(m,"Pair",De.kml);for(let b=0;b<p.length;b++){let f=p[b],y=Yn(f,"key",De.kml);if(y==="normal"){let _=Yn(f,"styleUrl",De.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let S=co(f,"Style",De.kml);RH(e,S,r,i,o)}}else xt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let u=Yn(t,"styleUrl",De.kml);if(l(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),b=p[0];m=`${i.getDerivedResource({url:b}).getUrlComponent()}#${p[1]}`}s=n.getById(m),l(s)||(s=n.getById(`#${m}`)),l(s)&&r.merge(s)}return r}function vRt(e,t,n){return t.fetchXML().then(function(i){return BLe(e,i,n,t,!0)})}function BLe(e,t,n,i,o,r){let s,a,c,d,u=XLe(t,"Style",De.kml);if(l(u)){let y=u.length;for(s=0;s<y;s++)d=u[s],a=Ga(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new er({id:a}),n.add(c),RH(e,d,c,i,r)))}let m=XLe(t,"StyleMap",De.kml);if(l(m)){let y=m.length;for(s=0;s<y;s++){let _=m[s];if(a=Ga(_,"id"),l(a)){let S=Hf(_,"Pair",De.kml);for(let Z=0;Z<S.length;Z++){let R=S[Z],C=Yn(R,"key",De.kml);if(C==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let E=Yn(R,"styleUrl",De.kml);if(l(E)){E[0]!=="#"&&(E=`#${E}`),o&&l(i)&&(E=i.getUrlComponent()+E);let A=n.getById(E);l(A)&&c.merge(A)}else d=co(R,"Style",De.kml),RH(e,d,c,i,r)}}else xt(`kml-styleMap-${C}`,`KML - Unsupported StyleMap key: ${C}`)}}}}let p=[],b=t.getElementsByTagName("styleUrl"),f=b.length;for(s=0;s<f;s++){let y=b[s].textContent;if(y[0]!=="#"){let _=y.split("#");if(_.length===2){let S=_[0],Z=i.getDerivedResource({url:S});p.push(vRt(e,Z,n))}}}return p}function zie(e,t,n){let i=new Cg(e,t.id,["position"]),o=new l0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new qc,t.polyline.positions=new Rg([i,o])}function zLe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?He.CLAMP_TO_GROUND:e==="relativeToGround"?He.RELATIVE_TO_GROUND:e==="absolute"?He.NONE:t==="clampToSeaFloor"?(xt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),He.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(xt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),He.RELATIVE_TO_GROUND):(l(e)?xt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):xt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),He.CLAMP_TO_GROUND)}function FRt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new l0(e))}function IRt(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")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function EH(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():OLe(),t.label=o),o.text=t.name;let r=t.billboard;if(l(r)||(r=l(n.billboard)?n.billboard.clone():DLe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(U.YELLOW,64),l(r.scale)){let s=r.scale.getValue();s!==0?o.pixelOffset=new k(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function HLe(e,t){let n=e.path;l(n)||(n=new yb,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function PRt(e,t,n,i,o){let r=Yn(n,"coordinates",De.kml),s=Yn(n,"altitudeMode",De.kml),a=Yn(n,"altitudeMode",De.gx),c=Kf(n,"extrude",De.kml),d=e._ellipsoid,u=VH(r,d);return i.position=u,EH(e,i,o,zLe(s,a)),c&&Jw(s,a)&&zie(t,i,o),!0}function NLe(e,t,n,i,o){let r=co(n,"coordinates",De.kml),s=Yn(n,"altitudeMode",De.kml),a=Yn(n,"altitudeMode",De.gx),c=Kf(n,"extrude",De.kml),d=Kf(n,"tessellate",De.kml),u=Jw(s,a),m=Ai(n,"drawOrder",De.gx),p=e._ellipsoid,b=ZH(r,p),f=o.polyline;if(u&&c){let y=new xb;i.wall=y,y.positions=b;let _=o.polygon;l(_)&&(y.fill=_.fill,y.material=_.material),y.outline=!0,l(f)?(y.outlineColor=l(f.material)?f.material.color:U.WHITE,y.outlineWidth=f.width):l(_)&&(y.outlineColor=l(_.material)?_.material.color:U.WHITE)}else if(e._clampToGround&&!u&&d){let y=new qc;y.clampToGround=!0,i.polyline=y,y.positions=b,l(f)?(y.material=l(f.material)?f.material.color.getValue(it.MINIMUM_VALUE):U.WHITE,y.width=f.width??1):(y.material=U.WHITE,y.width=1),y.zIndex=m}else l(m)&&xt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&xt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new qc,i.polyline=f,f.positions=IRt(b,s,a,p),(!d||u)&&(f.arcType=un.NONE);return!0}function XRt(e,t,n,i,o){let r=co(n,"outerBoundaryIs",De.kml),s=co(r,"LinearRing",De.kml),a=co(s,"coordinates",De.kml),c=e._ellipsoid,d=ZH(a,c),u=Kf(n,"extrude",De.kml),m=Yn(n,"altitudeMode",De.kml),p=Yn(n,"altitudeMode",De.gx),b=Jw(m,p),f=l(o.polygon)?o.polygon.clone():Oie(),y=o.polyline;if(l(y)&&(f.outlineColor=l(y.material)?y.material.color:U.WHITE,f.outlineWidth=y.width),i.polygon=f,b?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new Gc(d),S=Hf(n,"innerBoundaryIs",De.kml);for(let Z=0;Z<S.length;Z++){s=Hf(S[Z],"LinearRing",De.kml);for(let R=0;R<s.length;R++)a=co(s[R],"coordinates",De.kml),d=ZH(a,c),l(d)&&_.holes.push(new Gc(d))}f.hierarchy=_}return!0}function NRt(e,t,n,i,o){let r=Yn(n,"altitudeMode",De.kml),s=Yn(n,"altitudeMode",De.gx),a=Hf(n,"coord",De.gx),c=Hf(n,"angles",De.gx),d=Hf(n,"when",De.kml),u=Kf(n,"extrude",De.kml),m=Jw(r,s),p=e._ellipsoid;c.length>0&&xt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let b=Math.min(a.length,d.length),f=[],y=[];for(let S=0;S<b;S++){let Z=VH(a[S].textContent,p);f.push(Z),y.push(Q.fromIso8601(d[S].textContent))}let _=new fc;return _.addSamples(y,f),i.position=_,EH(e,i,o,zLe(r,s)),HLe(i,o),i.availability=new Vs,d.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),m&&u&&zie(t,i,o),!0}function YLe(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new fc;m.addSamples(e,t),n.intervals.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:FRt(m,s,a)})),i.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function YRt(e,t,n,i,o){let r=Kf(n,"interpolate",De.gx),s=Hf(n,"Track",De.gx),a,c,d,u=!1,m=new Eg,p=new Vs,b=new mc,f=e._ellipsoid;for(let y=0,_=s.length;y<_;y++){let S=s[y],Z=Hf(S,"when",De.kml),R=Hf(S,"coord",De.gx),C=Yn(S,"altitudeMode",De.kml),E=Yn(S,"altitudeMode",De.gx),A=Jw(C,E),L=Kf(S,"extrude",De.kml),F=Math.min(R.length,Z.length),I=[];a=[];for(let N=0;N<F;N++){let g=VH(R[N].textContent,f);I.push(g),a.push(Q.fromIso8601(Z[N].textContent))}r&&(l(c)&&YLe([c,a[0]],[d,I[0]],b,p,m,!1,"absolute",void 0,!1),c=a[F-1],d=I[I.length-1]),YLe(a,I,b,p,m,A&&L,C,E,!0),u=u||A&&L}return i.availability=p,i.position=b,EH(e,i,o),HLe(i,o),u&&(zie(t,i,o),i.polyline.show=m),!0}var KLe={Point:PRt,LineString:NLe,LinearRing:NLe,Polygon:XRt,Track:NRt,MultiTrack:YRt,MultiGeometry:wRt,Model:MRt};function wRt(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),m=KLe[u.localName];if(l(m)){let p=ULe(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,m(e,t,u,p,o)&&(a=!0)}}return a}function MRt(e,t,n,i,o){return xt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function kRt(e,t){let n=co(e,"ExtendedData",De.kml);if(!l(n))return;l(co(n,"SchemaData",De.kml))&&xt("kml-schemaData","KML - SchemaData is unsupported"),l(Ga(n,"xmlns:prefix"))&&xt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Hf(n,"Data",De.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ga(a,"name");l(c)&&(i[c]={displayName:Yn(a,"displayName",De.kml),value:Yn(a,"value",De.kml)})}}t.kml.extendedData=i}var Bo;typeof document<"u"&&(Bo=document.createElement("div"));function URt(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Yn(e,"description",De.kml),m=t.balloonStyle??n.balloonStyle,p=U.WHITE,b=U.BLACK,f=u;l(m)&&(p=m.bgColor??U.WHITE,b=m.textColor??U.BLACK,f=m.text??u);let y;if(l(f)){if(f=f.replace("$[name]",t.name??""),f=f.replace("$[description]",u??""),f=f.replace("$[address]",c.address??""),f=f.replace("$[Snippet]",c.snippet??""),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let Z=f.match(/\$\[.+?\]/g);if(Z!==null)for(r=0;r<Z.length;r++){let R=Z[r],C=R.substr(2,R.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),y=d[C],l(y)&&(y=E?y.displayName:y.value),l(y)&&(f=f.replace(R,y??""))}}}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],y=d[s],f+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=ZRt.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&&(nm(Bo,"a","href",i),nm(Bo,"link","href",i),nm(Bo,"area","href",i),nm(Bo,"img","src",i),nm(Bo,"iframe","src",i),nm(Bo,"video","src",i),nm(Bo,"audio","src",i),nm(Bo,"source","src",i),nm(Bo,"track","src",i),nm(Bo,"input","src",i),nm(Bo,"embed","src",i),nm(Bo,"script","src",i),nm(Bo,"video","poster",i)),im(Bo,"a","href",o),im(Bo,"link","href",o),im(Bo,"area","href",o),im(Bo,"img","src",o),im(Bo,"iframe","src",o),im(Bo,"video","src",o),im(Bo,"audio","src",o),im(Bo,"source","src",o),im(Bo,"track","src",o),im(Bo,"input","src",o),im(Bo,"embed","src",o),im(Bo,"script","src",o),im(Bo,"video","poster",o);let S='<div class="cesium-infoBox-description-lighter" style="';S+="overflow:auto;",S+="word-wrap:break-word;",S+=`background-color:${p.toCssColorString()};`,S+=`color:${b.toCssColorString()};`,S+='">',S+=`${Bo.innerHTML}</div>`,Bo.innerHTML="",t.description=S}function AH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=ULe(t,i,n.context),c=a.kml,d=WRt(e,t,n.styleCollection,r,s),u=Yn(t,"name",De.kml);a.name=u,a.parent=o;let m=GRt(t);l(m)||(m=ARt(t)),a.availability=m,Kie(a);function p(R){return R?R.show&&p(R.parent):!0}let b=Kf(t,"visibility",De.kml);a.show=p(o)&&(b??!0);let f=co(t,"author",De.atom),y=c.author;y.name=Yn(f,"name",De.atom),y.uri=Yn(f,"uri",De.atom),y.email=Yn(f,"email",De.atom);let _=co(t,"link",De.atom),S=c.link;S.href=Ga(_,"href"),S.hreflang=Ga(_,"hreflang"),S.rel=Ga(_,"rel"),S.type=Ga(_,"type"),S.title=Ga(_,"title"),S.length=Ga(_,"length"),c.address=Yn(t,"address",De.kml),c.phoneNumber=Yn(t,"phoneNumber",De.kml),c.snippet=Yn(t,"Snippet",De.kml),kRt(t,a),URt(t,a,d,s,r);let Z=e._ellipsoid;return QLe(t,a,Z),jLe(t,a,Z),l(co(t,"Region",De.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function JLe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function DRt(e,t,n,i){let o=AH(e,t,n),r=$e(n);r.parentEntity=o.entity,JLe(e,t,r,i)}function ORt(e,t,n,i){let o=AH(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 m=c.item(d),p=KLe[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),EH(e,r,s))}var BRt={FlyTo:KRt,Wait:HRt,SoundCue:Fie,AnimatedUpdate:Fie,TourControl:Fie};function zRt(e,t,n,i){let o=Yn(t,"name",De.kml),r=Ga(t,"id"),s=new Ow(o,r),a=co(t,"Playlist",De.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let m=d[u];if(m.localName){let p=BRt[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function Fie(e,t){xt(`KML Tour unsupported node ${t.localName}`)}function HRt(e,t){let n=Ai(t,"duration",De.gx);e.addPlaylistEntry(new Hw(n))}function KRt(e,t,n){let i=Ai(t,"duration",De.gx),o=Yn(t,"flyToMode",De.gx),r={kml:{}};QLe(t,r,n),jLe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new zw(i,o,s);e.addPlaylistEntry(a)}function jLe(e,t,n){let i=co(e,"Camera",De.kml);if(l(i)){let o=Ai(i,"longitude",De.kml)??0,r=Ai(i,"latitude",De.kml)??0,s=Ai(i,"altitude",De.kml)??0,a=Ai(i,"heading",De.kml)??0,c=Ai(i,"tilt",De.kml)??0,d=Ai(i,"roll",De.kml)??0,u=h.fromDegrees(o,r,s,n),m=Cc.fromDegrees(a,c-90,d);t.kml.camera=new Uw(u,m)}}function QLe(e,t,n){let i=co(e,"LookAt",De.kml);if(l(i)){let o=Ai(i,"longitude",De.kml)??0,r=Ai(i,"latitude",De.kml)??0,s=Ai(i,"altitude",De.kml)??0,a=Ai(i,"heading",De.kml),c=Ai(i,"tilt",De.kml),d=Ai(i,"range",De.kml)??0;c=W.toRadians(c??0),a=W.toRadians(a??0);let u=new dh(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new Dw(m,u)}}function JRt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=co(t,"Icon",De.kml),c=Bie(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"],m=co(t,"screenXY",De.kml),p=co(t,"overlayXY",De.kml),b=co(t,"size",De.kml),f,y,_,S,Z,R;l(b)&&(f=hT(b,"x"),y=hT(b,"y"),_=Ga(b,"xunits"),S=Ga(b,"yunits"),l(f)&&f!==-1&&f!==0&&(_==="fraction"?Z=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(Z=`width: ${f}px`),u.push(Z)),l(y)&&y!==-1&&y!==0&&(S==="fraction"?R=`height: ${Math.floor(y*100)}%`:S==="pixels"&&(R=`height: ${y}px`),u.push(R))),d.style=u.join(";");let C=0,E=d.height;l(p)&&(f=hT(p,"x"),y=hT(p,"y"),_=Ga(p,"xunits"),S=Ga(p,"yunits"),l(f)&&(_==="fraction"?C=f*d.width:(_==="pixels"||_==="insetPixels")&&(C=f)),l(y)&&(S==="fraction"?E=y*d.height:(S==="pixels"||S==="insetPixels")&&(E=y))),l(m)&&(f=hT(m,"x"),y=hT(m,"y"),_=Ga(m,"xunits"),S=Ga(m,"yunits"),l(f)&&(_==="fraction"?Z=`left: calc(${Math.floor(f*100)}% - ${C}px)`:_==="pixels"?Z=`left: ${f-C}px`:_==="insetPixels"&&(Z=`right: ${f-C}px`),u.push(Z)),l(y)&&(S==="fraction"?R=`bottom: calc(${Math.floor(y*100)}% - ${E}px)`:S==="pixels"?R=`bottom: ${y-E}px`:S==="insetPixels"&&(R=`top: ${y-E}px`),u.push(R))),d.style=u.join(";")},o.appendChild(d)}function jRt(e,t,n,i){let r=AH(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=ZH(co(t,"LatLonQuad",De.gx),c),u=Ai(t,"drawOrder",De.kml);if(l(d))s=Oie(),s.hierarchy=new Gc(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Kh,s.zIndex=u,r.rectangle=s;let f=co(t,"LatLonBox",De.kml);if(l(f)){let y=Ai(f,"west",De.kml),_=Ai(f,"south",De.kml),S=Ai(f,"east",De.kml),Z=Ai(f,"north",De.kml);l(y)&&(y=W.negativePiToPi(W.toRadians(y))),l(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),l(S)&&(S=W.negativePiToPi(W.toRadians(S))),l(Z)&&(Z=W.clampToLatitudeRange(W.toRadians(Z))),s.coordinates=new re(y,_,S,Z);let R=Ai(f,"rotation",De.kml);if(l(R)){let C=W.toRadians(R);s.rotation=C,s.stRotation=C}}}let m=co(t,"Icon",De.kml),p=Bie(m,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&xt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=Ai(m,"x",De.gx),y=Ai(m,"y",De.gx),_=Ai(m,"w",De.gx),S=Ai(m,"h",De.gx);(l(f)||l(y)||l(_)||l(S))&&xt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=PZ(t,"color",De.kml),s.material.transparent=!0}else s.material=PZ(t,"color",De.kml);let b=Yn(t,"altitudeMode",De.kml);l(b)?b==="absolute"?(s.height=Ai(t,"altitude",De.kml),s.zIndex=void 0):b!=="clampToGround"&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${b}`):(b=Yn(t,"altitudeMode",De.gx),b==="relativeToSeaFloor"?(xt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Ai(t,"altitude",De.kml),s.zIndex=void 0):b==="clampToSeaFloor"?xt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(b)&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${b}`))}function qLe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),xt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var fT={INTERVAL:0,EXPIRE:1,STOP:2};function CH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var QRt=new re,ME=new pe,Iie=new k,qRt=new h;function Hie(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=QT(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??QRt,l(n)&&(Iie.x=n.clientWidth*.5,Iie.y=n.clientHeight*.5,d=t.pickEllipsoid(Iie,r,qRt)),l(d)?u=r.cartesianToCartographic(d,ME):(u=re.center(o,ME),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let S=o.width*i*.5,Z=o.height*i*.5;o=new re(a(u.longitude-S),s(u.latitude-Z),a(u.longitude+S),s(u.latitude+Z))}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 m=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",m),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]",h.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,ME),c=c.replace("[cameraLon]",W.toDegrees(ME.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(ME.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(ME.height).toString());let b=t.frustum,f=b.aspectRatio,y="",_="";if(l(f)){let S=W.toDegrees(b.fov);f>1?(y=S,_=S/f):(_=S,y=S*f)}c=c.replace("[horizFov]",y.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(gu(c))}function $Rt(e,t,n,i){let r=AH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=co(t,"Link",De.kml);if(l(c)||(c=co(t,"Url",De.kml)),l(c)){let d=Yn(c,"href",De.kml),u,m;if(l(d)){let p=d;if(d=Die(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Yn(c,"viewRefreshMode",De.kml),u==="onRegion"){xt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=Yn(c,"viewBoundScale",De.kml)??1;let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=Yn(c,"viewFormat",De.kml)??_,Z=Yn(c,"httpQuery",De.kml);l(S)&&d.setQueryParameters(gu(CH(S))),l(Z)&&d.setQueryParameters(gu(CH(Z)));let R=e._ellipsoid;Hie(d,e.camera,e.canvas,m,e._lastCameraView.bbox,R)}let b={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new za,y=wie(e,f,d,b).then(function(_){let S=e._entityCollection,Z=f.values;S.suspendEvents();for(let E=0;E<Z.length;E++){let A=Z[E];l(A.parent)||(A.parent=r,Kie(A)),S.add(A)}S.resumeEvents();let R=Yn(c,"refreshMode",De.kml),C=Ai(c,"refreshInterval",De.kml)??0;if(R==="onInterval"&&C>0||R==="onExpire"||u==="onStop"){let E=co(_,"NetworkLinkControl",De.kml),A=l(E),L=Q.now(),F={id:qn(),href:d,cookie:{},lastUpdated:L,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:L},I=0;if(A&&(F.cookie=gu(Yn(E,"cookie",De.kml)??""),I=Ai(E,"minRefreshPeriod",De.kml)??0),R==="onInterval")A&&(C=Math.max(I,C)),F.refreshMode=fT.INTERVAL,F.time=C;else if(R==="onExpire"){let N;if(A&&(N=Yn(E,"expires",De.kml)),l(N))try{let g=Q.fromIso8601(N),V=Q.secondsDifference(g,L);V>0&&V<I&&Q.addSeconds(L,I,g),F.refreshMode=fT.EXPIRE,F.time=g}catch{xt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(F.refreshMode=fT.STOP,F.time=Ai(c,"viewRefreshTime",De.kml)??0):xt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(F.refreshMode)&&e._networkLinks.set(F.id,F)}}).catch(function(_){xt(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(y)}}}function e1t(e,t,n,i){let o=Uie[t.localName];return l(o)?o(e,t,n,i):qLe(e,t,n,i)}function Yie(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:co(a,"Document",De.kml),d=Yn(c,"name",De.kml);l(d)||(d=Sg(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Hg._DeferredLoading(e),m=new za(e);return Promise.all(BLe(e,n,m,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let y=0;y<f.length;y++){let _=f[y];if(l(Uie[_.localName])){p=_;break}}}let b={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),e1t(e,p,b,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}async function t1t(e,t,n,i,o){let r=en("ThirdParty/Workers/zip-web-worker.js"),s=en("ThirdParty/zip-module.wasm");$Y({workerURI:r,wasmURI:s});let a=new VZ(new qd(n)),c=await a.getEntries(),d=[],u={},m;for(let p=0;p<c.length;p++){let b=c[p];b.directory||(/\.kml$/i.test(b.filename)&&(!l(m)||!/\//i.test(b.filename))?(l(m)&&d.push(vie(m,u)),m=b):d.push(vie(b,u)))}if(l(m)&&d.push(ERt(m,u)),await Promise.all(d),a.close(),!l(u.kml))throw new ae("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),Yie(e,t,u.kml,i,u,o)}function wie(e,t,n,i){i=i??B.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(l(u)){let m=u.length;for(let p=0;p<m;p++)d.push(u[p])}}else o=o??ve.DEFAULT.clone();return o=ve.createIfNeeded(o),l(a)&&(a=Nn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?CRt(d).then(function(u){return u?t1t(e,t,d,o,a):VRt(d).then(function(m){m=MLe(m),m=kLe(m);let p,b;try{p=kie.parseFromString(m,"application/xml")}catch(f){b=f.toString()}if(l(b)||p.body||p.documentElement.tagName==="parsererror"){let f=l(b)?b:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new ae(f)}return Yie(e,t,p,o,r,a,s)})}):Yie(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}var Hg=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new Se,this._error=new Se,this._loading=new Se,this._refresh=new Se,this._unsupportedNode=new Se,this._clock=void 0,this._entityCollection=new za(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Og,this._networkLinks=new Mt,this._entityCluster=new Ou,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():re.clone(re.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ne.default;let o=t.credit;typeof o=="string"&&(o=new Lt(o)),this._credit=o,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??B.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??B.EMPTY_OBJECT,Es.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let o=this;return wie(this,this._entityCollection,t,n).then(function(){let r,s=o._entityCollection.computeAvailability(),a=s.start,c=s.stop,d=Q.equals(a,it.MINIMUM_VALUE),u=Q.equals(c,it.MAXIMUM_VALUE);if(!d||!u){let p;d&&(p=new Date,p.setHours(0,0,0,0),a=Q.fromDate(p)),u&&(p=new Date,p.setHours(24,0,0,0),c=Q.fromDate(p)),r=new Wf,r.startTime=a,r.stopTime=c,r.currentTime=Q.clone(a),r.clockRange=As.LOOP_STOP,r.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(c,a)/60,1),31556900))}let m=!1;return r!==o._clock&&(o._clock=r,m=!0),i!==o._name&&(m=!0),m&&o._changed.raiseEvent(o),Es.setLoading(o,!1),o}).catch(function(r){return Es.setLoading(o,!1),o._error.raiseEvent(o,r),console.log(r),Promise.reject(r)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=Q.now(),o=this;Pie.removeAll();function r(m){let p=m._children,b=p.length;for(let f=0;f<b;++f){let y=p[f];Pie.set(y.id,y),r(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,W.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,W.EPSILON7)&&c.upWC.equalsEpsilon(a.up,W.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let d=new Mt,u=!1;return n.values.forEach(function(m){let p=m.entity;if(!Pie.contains(p.id)){if(!m.updating){let b=!1;if(m.refreshMode===fT.INTERVAL?Q.secondsDifference(i,m.lastUpdated)>m.time&&(b=!0):m.refreshMode===fT.EXPIRE?Q.greaterThan(i,m.time)&&(b=!0):m.refreshMode===fT.STOP&&(s&&(m.needsUpdate=!0,m.cameraUpdateTime=i),m.needsUpdate&&Q.secondsDifference(i,m.cameraUpdateTime)>=m.time&&(b=!0)),b){r(p),m.updating=!0;let f=new za,y=m.href.clone();y.setQueryParameters(m.cookie);let _=o._ellipsoid??ne.default;Hie(y,o.camera,o.canvas,m.viewBoundScale,a.bbox,_),wie(o,f,y,{context:p.id}).then(n1t(o,m,f,d,y)).catch(function(S){let Z=`NetworkLink ${m.href} refresh failed: ${S}`;console.log(Z),o._error.raiseEvent(o,Z)}),u=!0}}d.set(m.id,m)}}),u&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0}};function Kie(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 n1t(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=co(r,"NetworkLinkControl",De.kml),c=l(a),d=0;if(c){if(l(co(a,"Update",De.kml))){xt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=gu(Yn(a,"cookie",De.kml)??""),d=Ai(a,"minRefreshPeriod",De.kml)??0}let u=Q.now(),m=t.refreshMode;if(m===fT.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===fT.EXPIRE){let L;if(l(a)&&(L=Yn(a,"expires",De.kml)),l(L))try{let F=Q.fromIso8601(L),I=Q.secondsDifference(F,u);I>0&&I<d&&Q.addSeconds(u,d,F),t.time=F}catch{xt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,b=e._entityCollection,f=n.values;function y(L){b.remove(L);let F=L._children,I=F.length;for(let N=0;N<I;++N)y(F[N])}b.suspendEvents();let _=b.values.slice(),S;for(S=0;S<_.length;++S){let L=_[S];L.parent===p&&(L.parent=void 0,y(L))}for(b.resumeEvents(),b.suspendEvents(),S=0;S<f.length;S++){let L=f[S];l(L.parent)||(L.parent=p,Kie(L)),b.add(L)}b.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let Z=b.computeAvailability(),R=Z.start,C=Z.stop,E=Q.equals(R,it.MINIMUM_VALUE),A=Q.equals(C,it.MAXIMUM_VALUE);if(!E||!A){let L=e._clock;(L.startTime!==R||L.stopTime!==C)&&(L.startTime=R,L.stopTime=C,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var Pie=new Mt,Mie=class{constructor(){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}};Hg._DeferredLoading=Xie;Hg._getTimestamp=Zn;var XZ=Hg;var _7i=x(T(),1);function jw(){ge.throwInstantiationError()}jw.prototype.update=ge.throwInstantiationError;jw.prototype.getBoundingSphere=ge.throwInstantiationError;jw.prototype.isDestroyed=ge.throwInstantiationError;jw.prototype.destroy=ge.throwInstantiationError;var Jie=jw;var X7i=x(T(),1);var Z7i=x(T(),1),NZ=`in vec4 position; +in vec2 textureCoordinates; +out vec2 v_textureCoordinates; +void main() +{ +gl_Position = position; +v_textureCoordinates = textureCoordinates; +} +`;function GH(e){this._context=e}var Qw,i1t=new lt({primitiveType:Ie.TRIANGLES}),o1t=new ui({color:new U(0,0,0,0)});function r1t(e,t){return new ps({context:e,colorTextures:[t],destroyAttachments:!1})}function s1t(e,t){return nn.fromCache({context:e,vertexShaderSource:NZ,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function a1t(e,t){return(!l(Qw)||Qw.viewport.width!==e||Qw.viewport.height!==t)&&(Qw=ze.fromCache({viewport:new nt(0,0,e,t)})),Qw}GH.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:s1t(o,e.fragmentShaderSource),a=r1t(o,t),c=a1t(n,i),d=e.uniformMap,u=o1t;u.framebuffer=a,u.renderState=c,u.execute(o);let m=i1t;m.vertexArray=r,m.renderState=c,m.shaderProgram=s,m.uniformMap=d,m.framebuffer=a,m.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};GH.prototype.isDestroyed=function(){return!1};GH.prototype.destroy=function(){return me(this)};var qw=GH;var c$i=x(T(),1);var Y7i=x(T(),1);function c1t(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var gc=c1t;var M7i=x(T(),1),jie=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},$w=jie;var z7i=x(T(),1);function Jf(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Jf.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Jf.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function l1t(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Jf.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Je({sources:[t]})),typeof n=="string"&&(n=new Je({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?l1t(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),m=n.createCombinedFragmentShader(d),p=new nn({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:m,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};Jf.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){Qie(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Jf.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Jf.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 Je({sources:[r]})),typeof s=="string"&&(s=new Je({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),m=new nn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function Qie(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];Qie(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Jf.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Qie(this,n),--this._numberOfShaders}this._shadersToRelease={}};Jf.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Jf.prototype.isDestroyed=function(){return!1};Jf.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return me(this)};var eM=Jf;var j7i=x(T(),1);function YZ(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(YZ.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});YZ.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};YZ.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};YZ.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={}};YZ.prototype.isDestroyed=function(){return!1};YZ.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return me(this)};var tM=YZ;var Aqi=x(T(),1);var rqi=x(T(),1);var qie={};function d1t(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var u1t=32.184,m1t=2451545;function gWe(e,t){t=Q.addSeconds(e,u1t,t);let n=Q.totalDays(t)-m1t;return t=Q.addSeconds(t,d1t(n),t),t}var LH=new Q(2451545,0,ci.TAI),h1t=1e3,bh=W.RADIANS_PER_DEGREE,om=W.RADIANS_PER_ARCSECOND,Yc=14959787e4,$Le=new q;function yWe(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=p1t(r-i,t),m=f1t(t,0);T1t(c,n,d,$Le);let p=a*(1+t),b=Math.cos(u),f=Math.sin(u),y=1+t*b,_=p/y;return l(s)?(s.x=_*b,s.y=_*f,s.z=0):s=new h(_*b,_*f,0),q.multiplyByVector($Le,s,s)}function f1t(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function p1t(e,t){let n=y1t(e,t);return x1t(n,t)}var b1t=50,g1t=W.EPSILON8;function y1t(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<b1t&&Math.abs(o-i)>g1t;++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 x1t(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 T1t(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 q(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 _1t=1.0000010178*Yc,S1t=100.46645683*bh,Z1t=129597742283429e-5*om,eWe=16002,tWe=21863,nWe=32004,iWe=10931,oWe=14529,rWe=16368,sWe=15318,aWe=32794,R1t=64*1e-7*Yc,C1t=-152*1e-7*Yc,V1t=62*1e-7*Yc,E1t=-8*1e-7*Yc,A1t=32*1e-7*Yc,G1t=-41*1e-7*Yc,L1t=19*1e-7*Yc,W1t=-11*1e-7*Yc,v1t=-150*1e-7*Yc,F1t=-46*1e-7*Yc,I1t=68*1e-7*Yc,P1t=54*1e-7*Yc,X1t=14*1e-7*Yc,N1t=24*1e-7*Yc,Y1t=-28*1e-7*Yc,w1t=22*1e-7*Yc,cWe=10,lWe=16002,dWe=21863,uWe=10931,mWe=1473,hWe=32004,fWe=4387,pWe=73,M1t=-325*1e-7,k1t=-322*1e-7,U1t=-79*1e-7,D1t=232*1e-7,O1t=-52*1e-7,B1t=97*1e-7,z1t=55*1e-7,H1t=-41*1e-7,K1t=-105*1e-7,J1t=-137*1e-7,j1t=258*1e-7,Q1t=35*1e-7,q1t=-116*1e-7,$1t=-88*1e-7,eCt=-112*1e-7,tCt=-80*1e-7,kE=new Q(0,0,ci.TAI);function nCt(e,t){gWe(e,kE);let i=(kE.dayNumber-LH.dayNumber+(kE.secondsOfDay-LH.secondsOfDay)/Mn.SECONDS_PER_DAY)/(Mn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=_1t+R1t*Math.cos(eWe*o)+v1t*Math.sin(eWe*o)+C1t*Math.cos(tWe*o)+F1t*Math.sin(tWe*o)+V1t*Math.cos(nWe*o)+I1t*Math.sin(nWe*o)+E1t*Math.cos(iWe*o)+P1t*Math.sin(iWe*o)+A1t*Math.cos(oWe*o)+X1t*Math.sin(oWe*o)+G1t*Math.cos(rWe*o)+N1t*Math.sin(rWe*o)+L1t*Math.cos(sWe*o)+Y1t*Math.sin(sWe*o)+W1t*Math.cos(aWe*o)+w1t*Math.sin(aWe*o),s=S1t+Z1t*i+M1t*Math.cos(cWe*o)+K1t*Math.sin(cWe*o)+k1t*Math.cos(lWe*o)+J1t*Math.sin(lWe*o)+U1t*Math.cos(dWe*o)+j1t*Math.sin(dWe*o)+D1t*Math.cos(uWe*o)+Q1t*Math.sin(uWe*o)+O1t*Math.cos(mWe*o)+q1t*Math.sin(mWe*o)+B1t*Math.cos(hWe*o)+$1t*Math.sin(hWe*o)+z1t*Math.cos(fWe*o)+eCt*Math.sin(fWe*o)+H1t*Math.cos(pWe*o)+tCt*Math.sin(pWe*o),a=.0167086342-.0004203654*i,c=102.93734808*bh+11612.3529*om*i,d=469.97289*om*i,u=174.87317577*bh-8679.27034*om*i;return yWe(r,a,d,c,u,s,t)}function xWe(e,t){gWe(e,kE);let i=(kE.dayNumber-LH.dayNumber+(kE.secondsOfDay-LH.secondsOfDay)/Mn.SECONDS_PER_DAY)/Mn.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*bh,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*bh,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,b=125.04455501*bh,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*bh,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*bh+om*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),Z=93.27209062*bh+om*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),R=134.96340251*bh+om*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),C=357.52910918*bh+om*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*bh-om*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),A=2*S,L=4*S,F=6*S,I=2*R,N=3*R,g=4*R,V=2*Z;a+=3400.4*Math.cos(A)-635.6*Math.cos(A-R)-235.6*Math.cos(R)+218.1*Math.cos(A-C)+181*Math.cos(A+R),c+=.014216*Math.cos(A-R)+.008551*Math.cos(A-I)-.001383*Math.cos(R)+.001356*Math.cos(A+R)-.001147*Math.cos(L-N)-914e-6*Math.cos(L-I)+869e-6*Math.cos(A-C-R)-627e-6*Math.cos(A)-394e-6*Math.cos(L-g)+282e-6*Math.cos(A-C-I)-279e-6*Math.cos(S-R)-236e-6*Math.cos(I)+231e-6*Math.cos(L)+229e-6*Math.cos(F-g)-201e-6*Math.cos(I-V),u+=486.26*Math.cos(A-V)-40.13*Math.cos(A)+37.51*Math.cos(V)+25.73*Math.cos(I-V)+19.97*Math.cos(A-C-V),p+=-55609*Math.sin(A-R)-34711*Math.sin(A-I)-9792*Math.sin(R)+9385*Math.sin(L-N)+7505*Math.sin(L-I)+5318*Math.sin(A+R)+3484*Math.sin(L-g)-3417*Math.sin(A-C-R)-2530*Math.sin(F-g)-2376*Math.sin(A)-2075*Math.sin(A-N)-1883*Math.sin(I)-1736*Math.sin(F-5*R)+1626*Math.sin(C)-1370*Math.sin(F-N),f+=-5392*Math.sin(A-V)-540*Math.sin(C)-441*Math.sin(A)+423*Math.sin(V)-288*Math.sin(I-V),_+=-3332.9*Math.sin(A)+1197.4*Math.sin(A-R)-662.5*Math.sin(C)+396.3*Math.sin(R)-218*Math.sin(A-C);let G=2*E,v=3*E;u+=46.997*Math.cos(E)*i-.614*Math.cos(A-V+E)*i+.614*Math.cos(A-V-E)*i-.0297*Math.cos(G)*o-.0335*Math.cos(E)*o+.0012*Math.cos(A-V+G)*o-16e-5*Math.cos(E)*r+4e-5*Math.cos(v)*r+4e-5*Math.cos(G)*r;let X=2.116*Math.sin(E)*i-.111*Math.sin(A-V-E)*i-.0015*Math.sin(E)*o;p+=X,_+=X,f+=-520.77*Math.sin(E)*i+13.66*Math.sin(A-V+E)*i+1.12*Math.sin(A-E)*i-1.06*Math.sin(V-E)*i+.66*Math.sin(G)*o+.371*Math.sin(E)*o-.035*Math.sin(A-V+G)*o-.015*Math.sin(A-V+E)*o+.0014*Math.sin(E)*r-.0011*Math.sin(v)*r-9e-4*Math.sin(G)*r,a*=h1t;let Y=d+u*om,D=m+p*om,w=y+_*om,O=b+f*om;return yWe(a,c,Y,D,O,w,t)}var bWe=.012300034,iCt=bWe/(bWe+1)*-1;function oCt(e,t){return t=xWe(e,t),h.multiplyByScalar(t,iCt,t)}var TWe=new q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),nM=new h;qie.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),l(t)||(t=new h),nM=nCt(e,nM),t=h.negate(nM,t),oCt(e,nM),h.subtract(t,nM,t),q.multiplyByVector(TWe,t,t),t};qie.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),t=xWe(e,t),q.multiplyByVector(TWe,t,t),t};var pT=qie;var lqi=x(T(),1);function rCt(e){e=e??B.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var Kg=rCt;function UE(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new nt,this._viewportCartesian4=new ce,this._viewportDirty=!1,this._viewportOrthographicMatrix=P.clone(P.IDENTITY),this._viewportTransformation=P.clone(P.IDENTITY),this._model=P.clone(P.IDENTITY),this._view=P.clone(P.IDENTITY),this._inverseView=P.clone(P.IDENTITY),this._projection=P.clone(P.IDENTITY),this._infiniteProjection=P.clone(P.IDENTITY),this._entireFrustum=new k,this._currentFrustum=new k,this._frustumPlanes=new ce,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=q.clone(P.IDENTITY),this._view3DDirty=!0,this._view3D=new P,this._inverseView3DDirty=!0,this._inverseView3D=new P,this._inverseModelDirty=!0,this._inverseModel=new P,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new q,this._viewRotation=new q,this._inverseViewRotation=new q,this._viewRotation3D=new q,this._inverseViewRotation3D=new q,this._inverseProjectionDirty=!0,this._inverseProjection=new P,this._modelViewDirty=!0,this._modelView=new P,this._modelView3DDirty=!0,this._modelView3D=new P,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new P,this._inverseModelViewDirty=!0,this._inverseModelView=new P,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new P,this._viewProjectionDirty=!0,this._viewProjection=new P,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new P,this._modelViewProjectionDirty=!0,this._modelViewProjection=new P,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new P,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new P,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new P,this._normalDirty=!0,this._normal=new q,this._normal3DDirty=!0,this._normal3D=new q,this._inverseNormalDirty=!0,this._inverseNormal=new q,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new q,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new An,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new k,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new k,this._eyeToEnu=new q,this._modelToEnu=new P,this._enuToModel=new P,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new U,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 h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,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(UE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!nt.equals(e,this._viewport)){nt.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 ZWe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return ZWe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){P.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,P.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,P.getMatrix3(this.inverseModel,e),q.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return eoe(this),this._view3D}},viewRotation:{get:function(){return eoe(this),this._viewRotation}},viewRotation3D:{get:function(){return eoe(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return VWe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return VWe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return bCt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return gCt(this),this._modelView}},modelView3D:{get:function(){return yCt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return RCt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return xCt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return TCt(this),this._inverseModelView3D}},viewProjection:{get:function(){return _Ct(this),this._viewProjection}},inverseViewProjection:{get:function(){return SCt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return ZCt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return CCt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return VCt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return ECt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return ACt(this),this._normal}},normal3D:{get:function(){return GCt(this),this._normal3D}},inverseNormal:{get:function(){return LCt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return WCt(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}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},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 CWe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return CWe(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 this._ellipsoid??ne.default}}});function sCt(e,t){P.clone(t,e._view),P.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 aCt(e,t){P.clone(t,e._inverseView),P.getMatrix3(t,e._inverseViewRotation)}function cCt(e,t){P.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function lCt(e,t){P.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var _We=new h,dCt=new P,SWe=new q;function uCt(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeCartographic=h.fromElements(o.longitude,o.latitude,o.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,_We)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,_We)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=q.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=_t.eastNorthUpToFixedFrame(i,n,dCt);e._enuToModel=P.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=P.inverseTransformation(e._enuToModel,e._modelToEnu);let s=P.getRotation(r,SWe),a=q.multiply(e._viewRotation,s,SWe);e._eyeToEnu=q.transpose(a,e._eyeToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var $ie=new q,mCt=new pe;function hCt(e,t){_t.computeIcrfToCentralBodyFixedMatrix(t.time,$ie);let n=pT.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);q.multiplyByVector($ie,n,n),h.normalize(n,e._sunDirectionWC),n=q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=pT.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),q.multiplyByVector($ie,n,n),q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,mCt);i.project(r,e._sunPositionColumbusView)}UE.prototype.updateCamera=function(e){sCt(this,e.viewMatrix),aCt(this,e.inverseViewMatrix),uCt(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==se.SCENE2D&&e.frustum instanceof yn};UE.prototype.updateFrustum=function(e){cCt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&lCt(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};UE.prototype.updatePass=function(e){this._pass=e};var fCt=[],pCt=new Kg;UE.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===se.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),hCt(this,e);let n=e.light??pCt;n instanceof Kg?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=q.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??fCt,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=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.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=_t.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,m;l(d)?u.height>u.width?m=Math.tan(.5*d)*2/u.height:m=Math.tan(.5*d)*2/u.width:m=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=m*e.maximumScreenSpaceError,U.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function ZWe(e){if(e._viewportDirty){let t=e._viewport;P.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),P.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function bCt(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==se.SCENE2D&&e._mode!==se.MORPHING&&!e._orthographicIn3D?P.inverse(e._projection,e._inverseProjection):P.clone(P.ZERO,e._inverseProjection))}function gCt(e){e._modelViewDirty&&(e._modelViewDirty=!1,P.multiplyTransformation(e._view,e._model,e._modelView))}function yCt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,P.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function xCt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,P.inverse(e.modelView,e._inverseModelView))}function TCt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,P.inverse(e.modelView3D,e._inverseModelView3D))}function _Ct(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,P.multiply(e._projection,e._view,e._viewProjection))}function SCt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,P.inverse(e.viewProjection,e._inverseViewProjection))}function ZCt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,P.multiply(e._projection,e.modelView,e._modelViewProjection))}function RCt(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 CCt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,P.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function VCt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,P.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function ECt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,P.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function ACt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;P.getMatrix3(e.inverseModelView,t),q.transpose(t,t)}}function GCt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;P.getMatrix3(e.inverseModelView3D,t),q.transpose(t,t)}}function LCt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;P.getMatrix3(e.modelView,t),q.transpose(t,t)}}function WCt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;P.getMatrix3(e.modelView3D,t),q.transpose(t,t)}}var RWe=new h;function CWe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,P.multiplyByPoint(e.inverseModel,e._cameraPosition,RWe),An.fromCartesian(RWe,e._encodedCameraPositionMC))}var vCt=new h,FCt=new h,ICt=new h,PCt=new h,XCt=new pe,NCt=new h,YCt=new P;function wCt(e,t,n,i,o,r,s,a){let c=vCt;c.x=e.y,c.y=e.z,c.z=e.x;let d=FCt;d.x=n.y,d.y=n.z,d.z=n.x;let u=ICt;u.x=i.y,u.y=i.z,u.z=i.x;let m=PCt;m.x=t.y,m.y=t.z,m.z=t.x,r===se.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,XCt);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 b=s.ellipsoid,f=b.cartographicToCartesian(p,NCt),y=_t.eastNorthUpToFixedFrame(f,b,YCt);return P.multiplyByPointAsVector(y,d,d),P.multiplyByPointAsVector(y,u,u),P.multiplyByPointAsVector(y,m,m),l(a)||(a=new P),a[0]=d.x,a[1]=u.x,a[2]=-m.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-m.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-m.z,a[11]=0,a[12]=-h.dot(d,f),a[13]=-h.dot(u,f),a[14]=h.dot(m,f),a[15]=1,a}function eoe(e){e._view3DDirty&&(e._mode===se.SCENE3D?P.clone(e._view,e._view3D):wCt(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),P.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function VWe(e){e._inverseView3DDirty&&(P.inverseTransformation(e.view3D,e._inverseView3D),P.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var iM=UE;function iu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0,transparentDefaultTexture:s=!1}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let a=l(n)?n(e,o):MCt(e,o,i),d=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=d,this._id=qn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new eM(this),this._textureCache=new tM,this._transparentDefaultTexture=s;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),kt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),kt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),kt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),kt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),kt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),kt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),kt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),kt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),kt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),kt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),kt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),kt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let m=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);kt._minimumAliasedLineWidth=m[0],kt._maximumAliasedLineWidth=m[1];let p=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);kt._minimumAliasedPointSize=p[0],kt._maximumAliasedPointSize=p[1];let b=u.getParameter(u.MAX_VIEWPORT_DIMS);kt._maximumViewportWidth=b[0],kt._maximumViewportHeight=b[1];let f=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);kt._highpFloatSupported=f.precision!==0;let y=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);kt._highpIntSupported=y.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!cs(u,["OES_standard_derivatives"]),this._blendMinmax=!!cs(u,["EXT_blend_minmax"]),this._elementIndexUint=!!cs(u,["OES_element_index_uint"]),this._depthTexture=!!cs(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!cs(u,["EXT_frag_depth"]),this._debugShaders=cs(u,["WEBGL_debug_shaders"]),this._textureFloat=!!cs(u,["OES_texture_float"]),this._textureHalfFloat=!!cs(u,["OES_texture_half_float"]),this._textureFloatLinear=!!cs(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!cs(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!cs(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!cs(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!cs(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!cs(u,["EXT_color_buffer_half_float"]),this._s3tc=!!cs(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!cs(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!cs(u,["WEBGL_compressed_texture_astc"]),this._etc=!!cs(u,["WEBG_compressed_texture_etc"]),this._etc1=!!cs(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!cs(u,["EXT_texture_compression_bptc"]),Ed.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?cs(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,kt._maximumTextureFilterAnisotropy=l(_)?u.getParameter(_.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let S,Z,R,C,E,A,L,F,I,N;if(d){let v=this;S=function(){return v._gl.createVertexArray()},Z=function(X){v._gl.bindVertexArray(X)},R=function(X){v._gl.deleteVertexArray(X)},C=function(X,Y,D,w,O){u.drawElementsInstanced(X,Y,D,w,O)},E=function(X,Y,D,w){u.drawArraysInstanced(X,Y,D,w)},A=function(X,Y){u.vertexAttribDivisor(X,Y)},L=function(X){u.drawBuffers(X)}}else F=cs(u,["OES_vertex_array_object"]),l(F)&&(S=function(){return F.createVertexArrayOES()},Z=function(v){F.bindVertexArrayOES(v)},R=function(v){F.deleteVertexArrayOES(v)}),I=cs(u,["ANGLE_instanced_arrays"]),l(I)&&(C=function(v,X,Y,D,w){I.drawElementsInstancedANGLE(v,X,Y,D,w)},E=function(v,X,Y,D){I.drawArraysInstancedANGLE(v,X,Y,D)},A=function(v,X){I.vertexAttribDivisorANGLE(v,X)}),N=cs(u,["WEBGL_draw_buffers"]),l(N)&&(L=function(v){N.drawBuffersWEBGL(v)});this.glCreateVertexArray=S,this.glBindVertexArray=Z,this.glDeleteVertexArray=R,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=E,this.glVertexAttribDivisor=A,this.glDrawBuffers=L,this._vertexArrayObject=!!F,this._instancedArrays=!!I,this._drawBuffers=!!N,kt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ie.MAX_DRAW_BUFFERS):1,kt._maximumColorAttachments=this.drawBuffers?u.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new U(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let g=new iM,V=new gc(this),G=ze.fromCache();this._defaultPassState=V,this._defaultRenderState=G,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=g,this._currentRenderState=G,this._currentPassState=V,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v<kt._maximumVertexAttributes;v++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r,transparentDefaultTexture:s},this.cache={},ze.apply(u,G,V)}function MCt(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 kCt(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 UCt(e,t,n,i){let o=`${kCt(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function DCt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(UCt(e,t,n,i))}function OCt(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 BCt(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,OCt(e,o,t))}return i}function cs(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var zCt={};Object.defineProperties(iu.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=BCt(this._originalGLContext,e?DCt:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=vt.defaultColor;this._defaultTexture=new vt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new vt({context:this,pixelFormat:Qe.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:Qe.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 $r({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 zCt}}});function EWe(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var toe;typeof WebGLRenderingContext<"u"&&(toe=[ie.BACK]);function WH(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=toe;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var HCt=new ui;iu.prototype.clear=function(e,t){e=e??HCt,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(U.equals(this._clearColor,o)||(U.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=e.renderState??this._defaultRenderState;EWe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;WH(this,c),n.clear(i)};function KCt(e,t,n,i,o){WH(e,t),EWe(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function JCt(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??P.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()}iu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,KCt(this,o,t,n,r),JCt(this,e,n,i)};iu.prototype.beginFrame=function(){};iu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=toe;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)};iu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??B.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new ge("A WebGL 2 context is required to read pixels using a PBO.");let a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=ot.createPixelBuffer({context:this,sizeInBytes:Qe.textureSizeInBytes(c,a,o,r),usage:Pe.DYNAMIC_READ});return WH(this,s),d._bind(),t.readPixels(n,i,o,r,c,Ue.toWebGLConstant(a,this),0),d._unBind(),d};iu.prototype.readPixels=function(e){let t=this._gl;e=e??B.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,s=e.framebuffer,a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=Qe.createTypedArray(c,a,o,r);return WH(this,s),t.readPixels(n,i,o,r,Qe.RGBA,Ue.toWebGLConstant(a,this),d),d};var AWe={position:0,textureCoordinates:1};iu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new At({attributes:{position:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Ie.TRIANGLES});e=Un.fromGeometry({context:this,geometry:t,attributeLocations:AWe,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};iu.prototype.createViewportQuadCommand=function(e,t){return t=t??B.EMPTY_OBJECT,new lt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ie.TRIANGLES,renderState:t.renderState,shaderProgram:nn.fromCache({context:this,vertexShaderSource:NZ,fragmentShaderSource:e,attributeLocations:AWe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};iu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};iu.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.set(t,e),new $w(this._pickObjects,t,U.fromRgba(t))};iu.prototype.isDestroyed=function(){return!1};iu.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 wZ=iu;var m$i=x(T(),1);function jCt(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[ve.createIfNeeded(t.positiveX).fetchImage(i),ve.createIfNeeded(t.negativeX).fetchImage(i),ve.createIfNeeded(t.positiveY).fetchImage(i),ve.createIfNeeded(t.negativeY).fetchImage(i),ve.createIfNeeded(t.positiveZ).fetchImage(i),ve.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new $r({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var oM=jCt;var g$i=x(T(),1);function vH(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new wZ(this._canvas,$e(e?.contextOptions)),this._canvases=[]}vH.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,o=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},r=function(){let c=n._context.canvas,d=this.drawingBufferWidth;c.width<d&&(c.width=d);let u=this.drawingBufferHeight;c.height<u&&(c.height=u)},s=function(){let c=this.drawingBufferWidth,d=this.drawingBufferHeight,u=n._context.canvas.height-d;t.drawImage(n._context.canvas,0,u,c,d,0,0,c,d),n._context.endFrame()};return new Proxy(this._context,{get(c,d,u){if(d==="isDestroyed")return function(){return i};switch(d){case"_canvas":return e;case"destroy":return o;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return r;case"endFrame":return s;default:return Reflect.get(c,d,u)}}})};vH.prototype.destroy=function(){this._context.destroy(),me(this)};vH.prototype.isDestroyed=function(){return!1};var rM=vH;var R$i=x(T(),1);function MZ(e){e=e??B.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new ge("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(ie.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}MZ.create=function(e){return new MZ(e)};MZ.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ie.SYNC_STATUS)};MZ.prototype.isDestroyed=function(){return!1};MZ.prototype.destroy=function(){return this._gl.deleteSync(this._sync),me(this)};MZ.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(o,r,s){return()=>{n.getStatus()===ie.SIGNALED?o():s<=0?r(new ae("Wait for signal timeout")):e(i(o,r,s-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var sM=MZ;var Y$i=x(T(),1);function bT(e){e=e??B.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Qe.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Bt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new ge("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:d,depth:u}=e;l(n)&&(l(c)||(c=n.width),l(d)||(d=n.height),l(u)||(u=n.depth));let m=e.preMultiplyAlpha||i===Qe.RGB||i===Qe.LUMINANCE,p=Qe.toInternalFormat(i,o,t),b=Qe.isCompressedFormat(p),f=t._gl,y=Qe.texture3DSizeInBytes(i,o,c,d,u);if(this._id=e.id??qn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f.TEXTURE_3D,this._texture=f.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._depth=u,this._dimensions=new h(c,d,u),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=m,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,WWe(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(this._textureTarget,this._texture),l(n)){if(s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new ge("For Texture3D, options.source.arrayBufferView must be defined");GWe(this,n),this._initialized=!0}else LWe(this);f.bindTexture(this._textureTarget,null)}function GWe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:d,pixelDatatype:u,flipY:m}=e,p=Qe.alignmentInBytes(d,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:b}=t;m&&console.warn("texture3D.flipY is not supported.");let f=1;if(t.mipLevels&&t.mipLevels.length&&(f=t.mipLevels.length+1),i.texStorage3D(o,f,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,d,Ue.toWebGLConstant(u,n),b),f>1){let y=s,_=a,S=c;for(let Z=0;Z<t.mipLevels.length;++Z)y=noe(y),_=noe(_),S=noe(S),i.texSubImage3D(o,Z+1,0,0,0,y,_,S,d,Ue.toWebGLConstant(u,n),t.mipLevels[Z])}}bT.prototype.copyFrom=function(e){e=e??B.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:o=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d,depth:u}=t,m=!1;this._initialized||(n===0&&i===0&&o===0&&c===this._width&&d===this._height&&u===this._depth?(GWe(this,t),m=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),LWe(this)),this._initialized=!0),m||QCt(this,t.arrayBufferView,n,i,o,c,d,u),s.bindTexture(a,null)};function QCt(e,t,n,i,o,r,s,a){let c=e._context,d=c._gl,{pixelFormat:u,pixelDatatype:m}=e,p=Qe.alignmentInBytes(u,m,r);d.pixelStorei(d.UNPACK_ALIGNMENT,p),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),d.texSubImage3D(e._textureTarget,0,n,i,o,r,s,a,u,Ue.toWebGLConstant(m,c),t)}function noe(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function LWe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,Ue.toWebGLConstant(e._pixelDatatype,t),null)}bT.create=function(e){return new bT(e)};Object.defineProperties(bT.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){WWe(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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function WWe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Ht.NEAREST_MIPMAP_NEAREST,Ht.NEAREST_MIPMAP_LINEAR,Ht.LINEAR_MIPMAP_NEAREST,Ht.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Ht.NEAREST_MIPMAP_NEAREST:Ht.NEAREST,i=ei.NEAREST),Qe.isDepthFormat(s)&&(n=Ht.NEAREST,i=ei.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_R,t.wrapR),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)}bT.prototype.generateMipmap=function(e){e=e??Vm.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)};bT.prototype.isDestroyed=function(){return!1};bT.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),me(this)};var aM=bT;var M$i=x(T(),1),DE=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -6170,7 +7985,7 @@ return; } discard; } -`;var qZi=_(T(),1),Ev=`in vec2 v_textureCoordinates; +`;var U$i=x(T(),1),cM=`in vec2 v_textureCoordinates; const float M_PI = 3.141592653589793; float vdcRadicalInverse(int i) { @@ -6250,7 +8065,7 @@ void main() { out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } -`;var eRi=_(T(),1),Xv=`uniform sampler2D u_noiseTexture; +`;var O$i=x(T(),1),lM=`uniform sampler2D u_noiseTexture; uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; in vec2 v_offset; @@ -6433,7 +8248,7 @@ out_FragColor = cloud; #endif #endif } -`;var nRi=_(T(),1),Iv=`#ifdef INSTANCED +`;var z$i=x(T(),1),dM=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScaleX; @@ -6473,7 +8288,7 @@ v_color = color; v_slice = slice; v_brightness = brightness; } -`;var oRi=_(T(),1),Wv=`uniform vec3 u_noiseTextureDimensions; +`;var K$i=x(T(),1),uM=`uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; uniform vec3 u_noiseOffset; in vec2 v_position; @@ -6550,7 +8365,7 @@ 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 sRi=_(T(),1),wv=`uniform vec3 u_noiseTextureDimensions; +`;var j$i=x(T(),1),mM=`uniform vec3 u_noiseTextureDimensions; in vec2 position; out vec2 v_position; void main() @@ -6565,7 +8380,7 @@ transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; transformedPos.y *= noiseTextureRows; v_position = transformedPos; } -`;var cRi=_(T(),1),Pv=`uniform sampler2D u_opaqueDepthTexture; +`;var q$i=x(T(),1),hM=`uniform sampler2D u_opaqueDepthTexture; uniform sampler2D u_translucentDepthTexture; in vec2 v_textureCoordinates; void main() @@ -6575,7 +8390,7 @@ float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); out_FragColor = czm_packDepth(translucentDepth); } -`;var dRi=_(T(),1),vv=`uniform sampler2D u_opaque; +`;var eeo=x(T(),1),fM=`uniform sampler2D u_opaque; uniform sampler2D u_accumulation; uniform sampler2D u_revealage; in vec2 v_textureCoordinates; @@ -6595,7 +8410,16 @@ if (opaque != czm_backgroundColor) out_FragColor.a = 1.0; } } -`;var mRi=_(T(),1),Fv=`in vec4 positionEC; +`;var neo=x(T(),1),pM=`uniform mat3 u_cubeMapPanoramaTransform; +in vec3 position; +out vec3 v_texCoord; +void main() +{ +vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; +} +`;var oeo=x(T(),1),bM=`in vec4 positionEC; void main() { vec3 position; @@ -6626,7 +8450,7 @@ discard; } czm_writeLogDepth(); } -`;var hRi=_(T(),1),Av=`in vec4 position; +`;var seo=x(T(),1),gM=`in vec4 position; out vec4 positionEC; void main() { @@ -6634,7 +8458,7 @@ positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); } -`;var bRi=_(T(),1),UV=`uniform vec3 u_radii; +`;var ceo=x(T(),1),OE=`uniform vec3 u_radii; uniform vec3 u_oneOverEllipsoidRadiiSquared; in vec3 v_positionEC; vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) @@ -6707,18 +8531,19 @@ gl_FragDepth = (z * (f - n) + f + n) * 0.5; #endif #endif } -`;var gRi=_(T(),1),OV=`in vec3 position; +`;var deo=x(T(),1),BE=`in vec3 position; uniform vec3 u_radii; out vec3 v_positionEC; void main() { vec4 p = vec4(u_radii * position, 1.0); -v_positionEC = (czm_modelView * p).xyz; -gl_Position = czm_modelViewProjection * p; +vec4 pEC = czm_modelView * p; +v_positionEC = pEC.xyz; +gl_Position = czm_projection * pEC; gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); czm_vertexLogDepth(); } -`;var _Ri=_(T(),1);/** +`;var meo=x(T(),1);/** * @license * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * @@ -6745,7 +8570,7 @@ czm_vertexLogDepth(); * 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 Mv=`#if (FXAA_QUALITY_PRESET == 10) + */var yM=`#if (FXAA_QUALITY_PRESET == 10) #define FXAA_QUALITY_PS 3 #define FXAA_QUALITY_P0 1.5 #define FXAA_QUALITY_P1 3.0 @@ -7215,7 +9040,7 @@ if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); } -`;var SRi=_(T(),1),Nv=`uniform vec4 u_initialColor; +`;var feo=x(T(),1),xM=`uniform vec4 u_initialColor; #if TEXTURE_UNITS > 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; @@ -7275,11 +9100,6 @@ 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 @@ -7548,9 +9368,16 @@ finalColor = clippingPlanesEdgeColor; } #endif #ifdef ENABLE_CLIPPING_POLYGONS -vec2 clippingPosition = v_clippingPosition; -int regionIndex = v_regionIndex; -clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +bool insideAny = vectorClip(v_textureCoordinates.xy); +#ifdef CLIPPING_INVERSE +if (!insideAny) { +discard; +} +#else +if (insideAny) { +discard; +} +#endif #endif #ifdef HIGHLIGHT_FILL_TILE finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); @@ -7637,6 +9464,10 @@ vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blen finalColor = alphaBlend(undergroundColor, finalColor); } #endif +#ifdef HAS_VECTOR_LAYER +finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); +finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); +#endif #ifdef TRANSLUCENT if (inTranslucencyRectangle()) { @@ -7712,7 +9543,7 @@ vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specula return vec4(color, imageryColor.a); } #endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var VRi=_(T(),1),kv=`#ifdef QUANTIZATION_BITS12 +`;var beo=x(T(),1),TM=`#ifdef QUANTIZATION_BITS12 in vec4 compressed0; in float compressed1; #else @@ -7749,11 +9580,6 @@ 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 vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); float get2DYPositionFraction(vec2 textureCoordinates); vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) @@ -7800,7 +9626,8 @@ 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; +vec4 morphPositionEC = czm_modelView * morphPosition; +return czm_projection * morphPositionEC; } #ifdef QUANTIZATION_BITS12 uniform vec2 u_minMaxHeight; @@ -7822,7 +9649,7 @@ 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) +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) float webMercatorT = textureCoordinates.y; float encodedNormal = compressed0.w; #else @@ -7878,27 +9705,6 @@ normalMC = normalize(projection + rejection * exaggeration); 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)) @@ -7936,7 +9742,7 @@ v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect v_height = height; #endif } -`;var ZRi=_(T(),1),DV=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var yeo=x(T(),1),zE=`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); @@ -7951,22 +9757,7 @@ mieColor, opacity ); } -`;var GRi=_(T(),1),Uv=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(u_texture, v_textureCoordinates); -} -`;var XRi=_(T(),1),Ov=`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 WRi=_(T(),1),BV=`float interpolateByDistance(vec4 nearFarScalar, float distance) +`;var Teo=x(T(),1),HE=`float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; @@ -8019,7 +9810,7 @@ opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; opacity *= pow(nightAlpha, 0.5); } -`;var PRi=_(T(),1),Dv=`in vec3 v_outerPositionWC; +`;var Seo=x(T(),1),_M=`in vec3 v_outerPositionWC; uniform vec3 u_hsbShift; #ifndef PER_FRAGMENT_ATMOSPHERE in vec3 v_mieColor; @@ -8064,7 +9855,7 @@ color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } -`;var FRi=_(T(),1),Bv=`in vec4 position; +`;var Reo=x(T(),1),SM=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; @@ -8088,16 +9879,17 @@ v_translucent ); #endif v_outerPositionWC = positionWC.xyz; -gl_Position = czm_modelViewProjection * position; +vec4 positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; } -`;var MRi=_(T(),1),Yv=`uniform samplerCube u_cubeMap; +`;var Veo=x(T(),1),ZM=`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 kRi=_(T(),1),Hv=`in vec3 position; +`;var Aeo=x(T(),1),RM=`in vec3 position; out vec3 v_texCoord; void main() { @@ -8105,14 +9897,14 @@ vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * posi gl_Position = czm_projection * vec4(p, 1.0); v_texCoord = position.xyz; } -`;var ORi=_(T(),1),zv=`uniform sampler2D u_texture; +`;var Leo=x(T(),1),CM=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } -`;var BRi=_(T(),1),Kv=`uniform float u_radiusTS; +`;var veo=x(T(),1),VM=`uniform float u_radiusTS; in vec2 v_textureCoordinates; vec2 rotate(vec2 p, vec2 direction) { @@ -8144,7 +9936,7 @@ burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); } -`;var HRi=_(T(),1),Jv=`in vec2 direction; +`;var Ieo=x(T(),1),EM=`in vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() @@ -8165,7 +9957,7 @@ halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); v_textureCoordinates = direction; } -`;var KRi=_(T(),1),Qv=`in vec2 v_textureCoordinates; +`;var Xeo=x(T(),1),AM=`in vec2 v_textureCoordinates; void main() { czm_materialInput materialInput; @@ -8176,2711 +9968,2756 @@ 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 Ceo=_(T(),1);var jRi=_(T(),1);function vrt(e){let t,n=e.name,i=e.message;c(n)&&c(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return c(o)&&(t+=` -${o}`),t}var qh=vrt;var fGi=_(T(),1);var aGi=_(T(),1);var tGi=_(T(),1);async function Frt(e,t,n,i){return c(i)||(i=!1),C.typeOf.object("terrainProvider",e),C.typeOf.number("level",t),C.typeOf.bool("rejectOnTileFail",i),C.defined("positions",n),Nrt(e,t,n,i)}function Art(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(uye(i)):r=o.then(uye(i)).catch(krt(i)),e.shift(),t.push(r),!0}function Mrt(e){return new Promise(function(t){setTimeout(t,e)})}function Dj(e,t,n){return e.length?Art(e,t,n)?Dj(e,t,n):Mrt(100).then(()=>Dj(e,t,n)):Promise.resolve()}function Nrt(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(!c(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let f={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=f,s.push(f)}a[u].positions.push(n[r])}let l=[];return Dj(s,l,i).then(function(){return Promise.all(l).then(function(){return n})})}function dye(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function uye(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(!dye(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];dye(s,i,n)}}):Promise.resolve()}}function krt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var jv=Frt;var Bj=new D;async function mye(e,t,n){if(c(n)||(n=!1),!c(e))throw new L("terrainProvider is required.");if(!c(t))throw new L("positions is required.");let i=[],o=[],r=e.availability;if(!c(r))throw new L("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");let s=[];for(let l=0;l<t.length;++l){let d=t[l],u=r.computeMaximumLevelAtPosition(d);if(o[l]=u,u===0){e.tilingScheme.positionToTileXY(d,1,Bj);let p=e.loadTileDataAvailability(Bj.x,Bj.y,1);c(p)&&s.push(p)}let f=i[u];c(f)||(i[u]=f=[]),f.push(d)}await Promise.all(s),await Promise.all(i.map(function(l,d){if(c(l))return jv(e,d,l,n)}));let a=[];for(let l=0;l<t.length;++l){let d=t[l];r.computeMaximumLevelAtPosition(d)!==o[l]&&a.push(d)}return a.length>0&&await mye(e,a,n),t}var IT=mye;async function Yj(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===se.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!c(n))return r;let a=n.availability;if(!c(a)||t.mode===se.SCENE2D)return r;let l=[de.center(e),de.southeast(e),de.southwest(e),de.northeast(e),de.northwest(e)],d=await Yj._sampleTerrainMostDetailed(n,l),u=!1,f=d.reduce(function(y,h){return c(h.height)?(u=!0,Math.max(h.height,y)):y},-Number.MAX_VALUE),p=r;return u&&(p.height+=f),p}Yj._sampleTerrainMostDetailed=IT;var WT=Yj;var CAi=_(T(),1);var XEi=_(T(),1);var TEi=_(T(),1);var pGi=_(T(),1),Urt={NONE:0,LERC:1},cm=Object.freeze(Urt);var YGi=_(T(),1);var GGi=_(T(),1);var yGi=_(T(),1),Ort={NONE:0,BITS12:1},qs=Object.freeze(Ort);var wT=new m,Drt=new m,lm=new D,XO=new M,Brt=new M,Yrt=Math.pow(2,12);function Zc(e,t,n,i,o,r,s,a,l,d){let u=qs.NONE,f,p;if(c(t)&&c(n)&&c(i)&&c(o)){let y=t.minimum,h=t.maximum,g=m.subtract(h,y,Drt),x=i-n;Math.max(m.maximumComponent(g),x)<Yrt-1?u=qs.BITS12:u=qs.NONE,f=M.inverseTransformation(o,new M);let V=m.negate(y,wT);M.multiply(M.fromTranslation(V,XO),f,f);let Z=wT;Z.x=1/g.x,Z.y=1/g.y,Z.z=1/g.z,M.multiply(M.fromScale(Z,XO),f,f),p=M.clone(o),M.setTranslation(p,m.ZERO,p),o=M.clone(o,new M);let R=M.fromTranslation(y,XO),E=M.fromScale(g,Brt),I=M.multiply(R,E,XO);M.multiply(o,I,o),M.multiply(p,I,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=f,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=l??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Zc.prototype.encode=function(e,t,n,i,o,r,s,a){let l=i.x,d=i.y;if(this.quantization===qs.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,wT),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,f=w.clamp((o-this.minimumHeight)/u,0,1);D.fromElements(n.x,n.y,lm);let p=Fn.compressTextureCoordinates(lm);D.fromElements(n.z,f,lm);let y=Fn.compressTextureCoordinates(lm);D.fromElements(l,d,lm);let h=Fn.compressTextureCoordinates(lm);if(e[t++]=p,e[t++]=y,e[t++]=h,this.hasWebMercatorT){D.fromElements(s,0,lm);let g=Fn.compressTextureCoordinates(lm);e[t++]=g}}else m.subtract(n,this.center,wT),e[t++]=wT.x,e[t++]=wT.y,e[t++]=wT.z,e[t++]=o,e[t++]=l,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Fn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Hrt=new m,fye=new m;Zc.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 f=s*i+u,p=s*r+u;t[p]=e[f]}let a=this.decodePosition(t,s,Hrt),l=n.geodeticSurfaceNormal(a,fye),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=l.x,t[d+1]=l.y,t[d+2]=l.z}};Zc.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,l=r*o+s;t[l]=e[a]}};Zc.prototype.decodePosition=function(e,t,n){if(c(n)||(n=new m),t*=this.stride,this.quantization===qs.BITS12){let i=Fn.decompressTextureCoordinates(e[t],lm);n.x=i.x,n.y=i.y;let o=Fn.decompressTextureCoordinates(e[t+1],lm);return n.z=o.x,M.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)};Zc.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,fye),a=this.decodeHeight(e,t),l=Lr.getHeight(a,i,o)-a;n.x+=s.x*l,n.y+=s.y*l,n.z+=s.z*l}return n};Zc.prototype.decodeTextureCoordinates=function(e,t,n){return c(n)||(n=new D),t*=this.stride,this.quantization===qs.BITS12?Fn.decompressTextureCoordinates(e[t+2],n):D.fromElements(e[t+4],e[t+5],n)};Zc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===qs.BITS12?Fn.decompressTextureCoordinates(e[t+1],lm).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Zc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===qs.BITS12?Fn.decompressTextureCoordinates(e[t+3],lm).x:e[t+6]};Zc.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)};Zc.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};Zc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case qs.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 IO={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},WO={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Zc.prototype.getAttributes=function(e){let t=q.FLOAT,n=q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,l){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:l,offsetInBytes:o,strideInBytes:i}),o+=l*n}if(this.quantization===qs.NONE){s(IO.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(IO.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(IO.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,l=this.hasWebMercatorT&&this.hasVertexNormals;s(WO.compressed0,a?4:3),l&&s(WO.compressed1,1),this.hasGeodeticSurfaceNormals&&s(WO.geodeticSurfaceNormal,3)}return r};Zc.prototype.getAttributeLocations=function(){return this.quantization===qs.NONE?IO:WO};Zc.clone=function(e,t){if(c(e))return c(t)||(t=new Zc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.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 Rc=Zc;var $h={};$h.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Hj=new m,zrt=new M,Krt=new m,Jrt=new m;$h.computeVertices=function(e){if(!c(e)||!c(e.heightmap))throw new L("options.heightmap is required.");if(!c(e.width)||!c(e.height))throw new L("options.width and options.height are required.");if(!c(e.nativeRectangle))throw new L("options.nativeRectangle is required.");if(!c(e.skirtHeight))throw new L("options.skirtHeight is required.");let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=w.PI_OVER_TWO,a=w.toRadians,l=e.heightmap,d=e.width,u=e.height,f=e.skirtHeight,p=f>0,y=e.isGeographic??!0,h=e.ellipsoid??re.default,g=1/h.maximumRadius,x=de.clone(e.nativeRectangle),S=de.clone(e.rectangle),V,Z,R,E;c(S)?(V=S.west,Z=S.south,R=S.east,E=S.north):y?(V=a(x.west),Z=a(x.south),R=a(x.east),E=a(x.north)):(V=x.west*g,Z=s-2*o(r(-x.south*g)),R=x.east*g,E=s-2*o(r(-x.north*g)));let I=e.relativeToCenter,v=c(I);I=v?I:m.ZERO;let P=e.includeWebMercatorT??!1,F=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,G=F!==1,X=e.structure??$h.DEFAULT_STRUCTURE,W=X.heightScale??$h.DEFAULT_STRUCTURE.heightScale,A=X.heightOffset??$h.DEFAULT_STRUCTURE.heightOffset,k=X.elementsPerHeight??$h.DEFAULT_STRUCTURE.elementsPerHeight,B=X.stride??$h.DEFAULT_STRUCTURE.stride,O=X.elementMultiplier??$h.DEFAULT_STRUCTURE.elementMultiplier,H=X.isBigEndian??$h.DEFAULT_STRUCTURE.isBigEndian,U=de.computeWidth(x),K=de.computeHeight(x),Q=U/(d-1),ie=K/(u-1);y||(U*=g,K*=g);let j=h.radiiSquared,$=j.x,ne=j.y,be=j.z,Ce=65536,me=-65536,_e=wt.eastNorthUpToFixedFrame(I,h),Ve=M.inverseTransformation(_e,zrt),Ie,Ze;P&&(Ie=Wi.geodeticLatitudeToMercatorAngle(Z),Ze=1/(Wi.geodeticLatitudeToMercatorAngle(E)-Ie));let De=Krt;De.x=Number.POSITIVE_INFINITY,De.y=Number.POSITIVE_INFINITY,De.z=Number.POSITIVE_INFINITY;let Ke=Jrt;Ke.x=Number.NEGATIVE_INFINITY,Ke.y=Number.NEGATIVE_INFINITY,Ke.z=Number.NEGATIVE_INFINITY;let rt=Number.POSITIVE_INFINITY,Xt=d*u,Ht=f>0?d*2+u*2:0,qe=Xt+Ht,mn=new Array(qe),Dt=new Array(qe),Lt=new Array(qe),Vi=P?new Array(qe):[],ln=G?new Array(qe):[],ge=0,Le=u,yn=0,bt=d;p&&(--ge,++Le,--yn,++bt);let ro=1e-5;for(let $e=ge;$e<Le;++$e){let yt=$e;yt<0&&(yt=0),yt>=u&&(yt=u-1);let Bt=x.north-ie*yt;y?Bt=a(Bt):Bt=s-2*o(r(-Bt*g));let Ln=(Bt-Z)/(E-Z);Ln=w.clamp(Ln,0,1);let Io=$e===ge,To=$e===Le-1;f>0&&(Io?Bt+=ro*K:To&&(Bt-=ro*K));let Ka=t(Bt),Ja=n(Bt),Li=be*Ja,bi;P&&(bi=(Wi.geodeticLatitudeToMercatorAngle(Bt)-Ie)*Ze);for(let sa=yn;sa<bt;++sa){let Qr=sa;Qr<0&&(Qr=0),Qr>=d&&(Qr=d-1);let xl=yt*(d*B)+Qr*B,yo;if(k===1)yo=l[xl];else{yo=0;let Ao;if(H)for(Ao=0;Ao<k;++Ao)yo=yo*O+l[xl+Ao];else for(Ao=k-1;Ao>=0;--Ao)yo=yo*O+l[xl+Ao]}yo=yo*W+A,me=Math.max(me,yo),Ce=Math.min(Ce,yo);let wr=x.west+Q*Qr;y?wr=a(wr):wr=wr*g;let gp=(wr-V)/(R-V);gp=w.clamp(gp,0,1);let jr=yt*d+Qr;if(f>0){let Ao=sa===yn,dn=sa===bt-1,Re=Io||To||Ao||dn;if((Io||To)&&(Ao||dn))continue;Re&&(yo-=f,Ao?(jr=Xt+(u-yt-1),wr-=ro*U):To?jr=Xt+u+(d-Qr-1):dn?(jr=Xt+u+d+yt,wr+=ro*U):Io&&(jr=Xt+u+d+u+Qr))}let du=Ka*t(wr),Qa=Ka*n(wr),ex=$*du,aa=ne*Qa,ja=1/i(ex*du+aa*Qa+Li*Ja),ds=ex*ja,uu=aa*ja,mu=Li*ja,fu=new m;fu.x=ds+du*yo,fu.y=uu+Qa*yo,fu.z=mu+Ja*yo,M.multiplyByPoint(Ve,fu,Hj),m.minimumByComponent(Hj,De,De),m.maximumByComponent(Hj,Ke,Ke),rt=Math.min(rt,yo),mn[jr]=fu,Lt[jr]=new D(gp,Ln),Dt[jr]=yo,P&&(Vi[jr]=bi),G&&(ln[jr]=h.geodeticSurfaceNormal(fu))}}let Xo=ue.fromPoints(mn),ra;c(S)&&(ra=Xn.fromRectangle(S,Ce,me,h));let Wr;v&&(Wr=new kb(h).computeHorizonCullingPointPossiblyUnderEllipsoid(I,mn,Ce));let _s=new J0(De,Ke,I),Ae=new Rc(I,_s,rt,me,_e,!1,P,G,F,N),st=new Float32Array(qe*Ae.stride),Qe=0;for(let $e=0;$e<qe;++$e)Qe=Ae.encode(st,Qe,mn[$e],Lt[$e],Dt[$e],void 0,Vi[$e],ln[$e]);return{vertices:st,maximumHeight:me,minimumHeight:Ce,encoding:Ae,boundingSphere3D:Xo,orientedBoundingBox:ra,occludeePointInScaledSpace:Wr}};var YV=$h;var KGi=_(T(),1);function Lg(){L.throwInstantiationError()}Object.defineProperties(Lg.prototype,{credits:{get:L.throwInstantiationError},waterMask:{get:L.throwInstantiationError}});Lg.prototype.interpolateHeight=L.throwInstantiationError;Lg.prototype.isChildAvailable=L.throwInstantiationError;Lg.prototype.createMesh=L.throwInstantiationError;Lg.prototype.upsample=L.throwInstantiationError;Lg.prototype.wasCreatedByUpsampling=L.throwInstantiationError;Lg.maximumAsynchronousTasks=5;var Ff=Lg;var QGi=_(T(),1);function Qrt(e,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g){this.center=e,this.vertices=t,this.stride=d??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=u,this.encoding=f,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=y,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=g}var dm=Qrt;var nEi=_(T(),1);function ml(){L.throwInstantiationError()}Object.defineProperties(ml.prototype,{errorEvent:{get:L.throwInstantiationError},credit:{get:L.throwInstantiationError},tilingScheme:{get:L.throwInstantiationError},hasWaterMask:{get:L.throwInstantiationError},hasVertexNormals:{get:L.throwInstantiationError},availability:{get:L.throwInstantiationError}});var hye=[];ml.getRegularGridIndices=function(e,t){if(e*t>=w.FOUR_GIGABYTES)throw new L("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=hye[e];c(n)||(hye[e]=n=[]);let i=n[t];return c(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),gye(e,t,i,0)),i};var pye=[];ml.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=w.FOUR_GIGABYTES)throw new L("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=pye[e];c(n)||(pye[e]=n=[]);let i=n[t];if(!c(i)){let o=ml.getRegularGridIndices(e,t),r=yye(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,l=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:l,northIndicesWestToEast:d}}return i};var bye=[];ml.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=w.FOUR_GIGABYTES)throw new L("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=bye[e];c(n)||(bye[e]=n=[]);let i=n[t];if(!c(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,l=o+s,d=r+a,u=yye(e,t),f=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,y=u.eastIndicesNorthToSouth,h=u.northIndicesWestToEast,g=Me.createTypedArray(l,d);gye(e,t,g,0),ml.addSkirtIndices(f,p,y,h,o,g,r),i=n[t]={indices:g,westIndicesSouthToNorth:f,southIndicesEastToWest:p,eastIndicesNorthToSouth:y,northIndicesWestToEast:h,indexCountWithoutSkirts:r}}return i};ml.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=wO(e,a,r,s),a+=e.length,s=wO(t,a,r,s),a+=t.length,s=wO(n,a,r,s),a+=n.length,wO(i,a,r,s)};function yye(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 gye(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,l=a+e,d=l+1,u=a+1;n[i++]=a,n[i++]=l,n[i++]=u,n[i++]=u,n[i++]=l,n[i++]=d,++o}++o}}function wO(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}ml.heightmapTerrainQuality=.25;ml.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*ml.heightmapTerrainQuality/(t*n)};ml.prototype.requestTileGeometry=L.throwInstantiationError;ml.prototype.getLevelMaximumGeometricError=L.throwInstantiationError;ml.prototype.getTileDataAvailable=L.throwInstantiationError;ml.prototype.loadTileDataAvailability=L.throwInstantiationError;var rs=ml;function a0(e){if(!c(e)||!c(e.buffer))throw new L("options.buffer is required.");if(!c(e.width))throw new L("options.width is required.");if(!c(e.height))throw new L("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??cm.NONE;let t=YV.DEFAULT_STRUCTURE,n=e.structure;c(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===cm.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(a0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var xye="createVerticesFromHeightmap",jrt=new gi(xye),qrt=new gi(xye,Ff.maximumAsynchronousTasks);a0.prototype.createMesh=function(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=l.cartographicToCartesian(de.center(u)),p=this._structure,h=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(h*4,1e3);let x=(a?qrt:jrt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:f,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Xi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!c(x))return;let S=this;return Promise.resolve(x).then(function(V){let Z;S._skirtHeight>0?Z=rs.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):Z=rs.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let R=V.gridWidth*V.gridHeight;return S._mesh=new dm(f,new Float32Array(V.vertices),Z.indices,Z.indexCountWithoutSkirts,R,V.minimumHeight,V.maximumHeight,ue.clone(V.boundingSphere3D),m.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Xn.clone(V.orientedBoundingBox),Rc.clone(V.encoding),Z.westIndicesSouthToNorth,Z.southIndicesEastToWest,Z.eastIndicesNorthToSouth,Z.northIndicesWestToEast),S._buffer=void 0,S._mesh})};a0.prototype._createMeshSync=function(e){C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(de.center(d)),f=this._structure,y=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(y*4,1e3);let h=YV.computeVertices({heightmap:this._buffer,structure:f,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Xi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let g;this._skirtHeight>0?g=rs.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):g=rs.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=h.gridWidth*h.gridHeight;return this._mesh=new dm(u,h.vertices,g.indices,g.indexCountWithoutSkirts,x,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),this._mesh};a0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,l=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,f=r.heightScale,p=c(this._mesh),y=this._encoding===cm.LERC;if(!p&&y)return;let g;if(p){let x=this._mesh.vertices,S=this._mesh.encoding;g=_ye(x,S,u,f,e,i,o,t,n)}else g=$rt(this._buffer,a,l,s,d,e,i,o,t,n),g=g*f+u;return g};a0.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new L("tilingScheme is required.");if(!c(t))throw new L("thisX is required.");if(!c(n))throw new L("thisY is required.");if(!c(i))throw new L("thisLevel is required.");if(!c(o))throw new L("descendantX is required.");if(!c(r))throw new L("descendantY is required.");if(!c(s))throw new L("descendantLevel is required.");if(s-i>1)throw new L("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(l))return;let d=this._width,u=this._height,f=this._structure,p=f.stride,y=new this._bufferType(d*u*p),h=l.vertices,g=l.encoding,x=e.tileXYToRectangle(t,n,i),S=e.tileXYToRectangle(o,r,s),V=f.heightOffset,Z=f.heightScale,R=f.elementsPerHeight,E=f.elementMultiplier,I=f.isBigEndian,v=Math.pow(E,R-1);for(let P=0;P<u;++P){let F=w.lerp(S.north,S.south,P/(u-1));for(let N=0;N<d;++N){let b=w.lerp(S.west,S.east,N/(d-1)),G=_ye(h,g,V,Z,x,d,u,b,F);G=G<f.lowestEncodedHeight?f.lowestEncodedHeight:G,G=G>f.highestEncodedHeight?f.highestEncodedHeight:G,est(y,R,E,v,p,I,P*d+N,G)}}return Promise.resolve(new a0({buffer:y,width:d,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};a0.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new L("thisX is required.");if(!c(t))throw new L("thisY is required.");if(!c(n))throw new L("childX is required.");if(!c(i))throw new L("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};a0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function $rt(e,t,n,i,o,r,s,a,l,d){let u=(l-r.west)*(s-1)/(r.east-r.west),f=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,y=p+1;y>=s&&(y=s-1,p=s-2);let h=f|0,g=h+1;g>=a&&(g=a-1,h=a-2);let x=u-p,S=f-h;h=a-1-h,g=a-1-g;let V=PO(e,t,n,i,o,h*s+p),Z=PO(e,t,n,i,o,h*s+y),R=PO(e,t,n,i,o,g*s+p),E=PO(e,t,n,i,o,g*s+y);return Tye(x,S,V,Z,R,E)}function _ye(e,t,n,i,o,r,s,a,l){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(l-o.south)*(s-1)/(o.north-o.south),f=d|0,p=f+1;p>=r&&(p=r-1,f=r-2);let y=u|0,h=y+1;h>=s&&(h=s-1,y=s-2);let g=d-f,x=u-y;y=s-1-y,h=s-1-h;let S=(t.decodeHeight(e,y*r+f)-n)/i,V=(t.decodeHeight(e,y*r+p)-n)/i,Z=(t.decodeHeight(e,h*r+f)-n)/i,R=(t.decodeHeight(e,h*r+p)-n)/i;return Tye(g,x,S,V,Z,R)}function Tye(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function PO(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 est(e,t,n,i,o,r,s,a){s*=o;let l;if(r)for(l=0;l<t-1;++l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;else for(l=t-1;l>0;--l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;e[s+l]=a}var Da=a0;function HV(e){e=e??z.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??re.default})),this._levelZeroMaximumGeometricError=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye}Object.defineProperties(HV.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(){}}});HV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Da({buffer:new Uint8Array(16*16),width:16,height:16}))};HV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};HV.prototype.getTileDataAvailable=function(e,t,n){};HV.prototype.loadTileDataAvailability=function(e,t,n){};var ep=HV;var DEi=_(T(),1);var vEi=_(T(),1);var tst=new D;function nst(e,t){C.typeOf.object("clippingPlaneCollection",e),C.typeOf.object("context",t);let n=e.unionClippingRegions,i=e.length,o=hs.useFloatTexture(t),r=hs.getTextureResolution(e,t,tst),s=r.x,a=r.y,l=o?rst(s,a):sst(s,a);return l+=` -`,l+=n?ist(i):ost(i),l}function ist(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 ost(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 rst(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 sst(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 c0=nst;function ast(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 zj(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function cst(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 se.SCENE3D:o=t;break;case se.SCENE2D:case se.COLUMBUS_VIEW:o=n;break;case se.MORPHING:o=i;break}return o}function lst(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 dst(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 ust(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}zj.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,l=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,f=e.applySplit,p=e.hasWaterMask,y=e.showReflectiveOcean,h=e.showOceanWaves,g=e.enableLighting,x=e.dynamicAtmosphereLighting,S=e.dynamicAtmosphereLightingFromSun,V=e.showGroundAtmosphere,Z=e.perFragmentGroundAtmosphere,R=e.hasVertexNormals,E=e.useWebMercatorProjection,I=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,F=e.enableClippingPolygons,N=e.clippingPolygons,b=e.clippedByBoundaries,G=e.hasImageryLayerCutout,X=e.colorCorrect,W=e.highlightFillTile,A=e.colorToAlpha,k=e.hasGeodeticSurfaceNormals,B=e.hasExaggeration,O=e.showUndergroundColor,H=e.translucent,U=0,K="",ie=n.renderedMesh.encoding;ie.quantization===qs.BITS12&&(U=1,K="QUANTIZATION_BITS12");let $=0,ne="";b&&($=1,ne="TILE_LIMIT_RECTANGLE");let be=0,Ce="";G&&(be=1,Ce="APPLY_IMAGERY_CUTOUT");let me=t.mode,_e=me|o<<2|r<<3|s<<4|a<<5|l<<6|d<<7|p<<8|y<<9|h<<10|g<<11|x<<12|S<<13|V<<14|Z<<15|R<<16|E<<17|I<<18|U<<19|f<<20|v<<21|F<<22|$<<23|be<<24|X<<25|W<<26|A<<27|k<<28|B<<29|O<<30|H<<31|u<<32,Ve=0;c(P)&&P.length>0&&(Ve=v?P.clippingPlanesState:0);let Ie=0;c(N)&&N.length>0&&(Ie=F?N.clippingPolygonsState:0);let Ze=n.surfaceShader;if(c(Ze)&&Ze.numberOfDayTextures===i&&Ze.flags===_e&&Ze.material===this.material&&Ze.clippingShaderState===Ve&&Ze.clippingPolygonShaderState===Ie)return Ze.shaderProgram;let De=this._shadersByTexturesFlags[i];if(c(De)||(De=this._shadersByTexturesFlags[i]=[]),Ze=De[_e],!c(Ze)||Ze.material!==this.material||Ze.clippingShaderState!==Ve||Ze.clippingPolygonShaderState!==Ie){let Ke=this.baseVertexShaderSource.clone(),rt=this.baseFragmentShaderSource.clone();Ve!==0&&rt.sources.unshift(c0(P,t.context)),Ie!==0&&(rt.sources.unshift(lst(t.context)),Ke.sources.unshift(dst(t.context))),Ke.defines.push(K),rt.defines.push(`TEXTURE_UNITS ${i}`,ne,Ce),o&&rt.defines.push("APPLY_BRIGHTNESS"),r&&rt.defines.push("APPLY_CONTRAST"),s&&rt.defines.push("APPLY_HUE"),a&&rt.defines.push("APPLY_SATURATION"),l&&rt.defines.push("APPLY_GAMMA"),d&&rt.defines.push("APPLY_ALPHA"),u&&rt.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&rt.defines.push("HAS_WATER_MASK"),y&&(rt.defines.push("SHOW_REFLECTIVE_OCEAN"),Ke.defines.push("SHOW_REFLECTIVE_OCEAN")),h&&rt.defines.push("SHOW_OCEAN_WAVES"),A&&rt.defines.push("APPLY_COLOR_TO_ALPHA"),O&&(Ke.defines.push("UNDERGROUND_COLOR"),rt.defines.push("UNDERGROUND_COLOR")),H&&(Ke.defines.push("TRANSLUCENT"),rt.defines.push("TRANSLUCENT")),g&&(R?(Ke.defines.push("ENABLE_VERTEX_LIGHTING"),rt.defines.push("ENABLE_VERTEX_LIGHTING")):(Ke.defines.push("ENABLE_DAYNIGHT_SHADING"),rt.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),rt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),S&&(Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),rt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Ke.defines.push("GROUND_ATMOSPHERE"),rt.defines.push("GROUND_ATMOSPHERE"),Z&&(Ke.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),rt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ke.defines.push("INCLUDE_WEB_MERCATOR_Y"),rt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Ke.defines.push("FOG"),rt.defines.push("FOG")),f&&rt.defines.push("APPLY_SPLIT"),v&&rt.defines.push("ENABLE_CLIPPING_PLANES"),F&&(rt.defines.push("ENABLE_CLIPPING_POLYGONS"),Ke.defines.push("ENABLE_CLIPPING_POLYGONS"),N.inverse&&rt.defines.push("CLIPPING_INVERSE"),rt.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`),Ke.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`)),X&&rt.defines.push("COLOR_CORRECT"),W&&rt.defines.push("HIGHLIGHT_FILL_TILE"),k&&Ke.defines.push("GEODETIC_SURFACE_NORMALS"),B&&Ke.defines.push("EXAGGERATION");let Xt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;G&&(Xt+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let qe=0;qe<i;++qe)G?Xt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${qe}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Xt+=` color = sampleAndBlend( -`,Xt+=` color, - u_dayTextures[${qe}], - u_dayTextureUseWebMercatorT[${qe}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${qe}], - u_dayTextureTranslationAndScale[${qe}], - ${d?`u_dayTextureAlpha[${qe}]`:"1.0"}, - ${u?`u_dayTextureNightAlpha[${qe}]`:"1.0"}, -${u?`u_dayTextureDayAlpha[${qe}]`:"1.0"}, -${o?`u_dayTextureBrightness[${qe}]`:"0.0"}, - ${r?`u_dayTextureContrast[${qe}]`:"0.0"}, - ${s?`u_dayTextureHue[${qe}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${qe}]`:"0.0"}, - ${l?`u_dayTextureOneOverGamma[${qe}]`:"0.0"}, - ${f?`u_dayTextureSplit[${qe}]`:"0.0"}, - ${A?`u_colorsToAlpha[${qe}]`:"vec4(0.0)"}, - nightBlend ); -`,G&&(Xt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Xt+=` return color; - }`,rt.sources.push(Xt),Ke.sources.push(cst(me)),Ke.sources.push(ust(E));let Ht=tn.fromCache({context:t.context,vertexShaderSource:Ke,fragmentShaderSource:rt,attributeLocations:ie.getAttributeLocations()});Ze=De[_e]=new ast(i,_e,this.material,Ht,Ve,Ie)}return n.surfaceShader=Ze,Ze.shaderProgram};zj.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!c(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],c(t)&&t.shaderProgram.destroy())}return he(this)};var qv=zj;var Kvi=_(T(),1);var YEi=_(T(),1),mst={NONE:-1,PARTIAL:0,FULL:1},yr=Object.freeze(mst);var XXi=_(T(),1);var JEi=_(T(),1);function vO(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}vO.reportError=function(e,t,n,i,o,r,s,a){let l=e;return c(e)?(l.provider=t,l.message=i,l.x=o,l.y=r,l.level=s,l.retry=!1,l.error=a,++l.timesRetried):l=new vO(t,i,o,r,s,0,a),c(n)&&n.numberOfListeners>0?n.raiseEvent(l):c(t)&&console.log(`An error occurred in "${t.constructor.name}": ${qh(i)}`),l};vO.reportSuccess=function(e){c(e)&&(e.timesRetried=-1)};var Ro=vO;var jEi=_(T(),1),fst={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ci=Object.freeze(fst);var $Ei=_(T(),1),hst={START:0,LOADING:1,DONE:2,FAILED:3},$s=Object.freeze(hst);var tXi=_(T(),1),pst={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},uo=Object.freeze(pst);function sr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce(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=uo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(sr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===uo.RECEIVING||e===uo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!c(s.loadingImagery)||s.loadingImagery.state!==ci.TRANSITIONING}return n}},renderedMesh:{get:function(){if(c(this.vertexArray))return this.mesh;if(c(this.fill))return this.fill.mesh}}});var bst=new pe;function Kj(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(c(t)&&t!==se.SCENE3D){let l=n.ellipsoid.cartesianToCartographic(s,bst);s=n.project(l,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var yst=new m,gst=new m,xst=new m;sr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!c(r))return;let s=r.vertices,a=r.indices,l=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let f=0;f<d;f+=3){let p=a[f],y=a[f+1],h=a[f+2],g=Kj(l,t,n,s,p,yst),x=Kj(l,t,n,s,y,gst),S=Kj(l,t,n,s,h,xst),V=qn.rayTriangleParametric(e,g,x,S,i);c(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?bn.getPoint(e,u,o):void 0};sr.prototype.freeResources=function(){c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=uo.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()};sr.prototype.freeVertexArray=function(){sr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,sr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};sr.initialize=function(e,t,n){let i=e.data;c(i)||(i=e.data=new sr),e.state===$s.START&&(_st(e,t,n),e.state=$s.LOADING)};sr.processStateMachine=function(e,t,n,i,o,r,s){sr.initialize(e,n,i);let a=e.data;if(e.state===$s.LOADING&&Tst(e,t,n,i,o,r),s)return;let l=e.renderable;e.renderable=c(a.vertexArray);let d=a.terrainState===uo.READY;e.upsampledFromParent=c(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let f=e._loadedCallbacks,p={};for(let y in f)f.hasOwnProperty(y)&&(f[y](e)||(p[y]=f[y]));e._loadedCallbacks=p,e.state=$s.DONE}l&&(e.renderable=!0)};sr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,l=o.imagery,d,u;for(d=0,u=l.length;d<u;++d){let f=l[d];if(!c(f.loadingImagery)){r=!1;continue}if(f.loadingImagery.state===ci.PLACEHOLDER){let y=f.loadingImagery.imageryLayer;if(y.ready){f.freeResources(),l.splice(d,1),y._createTileImagerySkeletons(e,t,d),--d,u=l.length;continue}else r=!1}let p=f.processStateMachine(e,n,i);a=a&&p,s=s||p||c(f.readyImagery),r=r&&c(f.loadingImagery)&&(f.loadingImagery.state===ci.FAILED||f.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,l=Rc.clone(s);l.hasGeodeticSurfaceNormals=t,l=Rc.clone(l);let d=l.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?(sr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=sr._createVertexArrayForMesh(i.context,o)):(sr._freeVertexArray(e.vertexArray),e.vertexArray=sr._createVertexArrayForMesh(i.context,o)),sr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}sr.prototype.addGeodeticSurfaceNormals=function(e,t){Sye(this,!0,e,t)};sr.prototype.removeGeodeticSurfaceNormals=function(e){Sye(this,!1,void 0,e)};sr.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,l=o.encoding,d=l.exaggeration!==r,u=l.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!l.hasGeodeticSurfaceNormals){let f=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(f,t)}else!a&&l.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(l.exaggeration=r,l.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let f=e.customData,p=f.length;for(let y=0;y<p;y++){let h=f[y];h.level=-1}}}};function _st(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!c(i)&&c(e.parent)){let o=e.parent,r=o.data;c(r)&&c(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=uo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Tst(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===uo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||sr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===uo.FAILED&&Sst(s,e,t,n,e.x,e.y,e.level),s.terrainState===uo.UNLOADED&&Cst(s,n,e.x,e.y,e.level),s.terrainState===uo.RECEIVED&&Lst(s,t,n,e.x,e.y,e.level),s.terrainState===uo.TRANSFORMED&&(Zst(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=uo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Gst(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);c(d)&&c(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Sst(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=$s.FAILED;return}let l=a.data.terrainData,d=a.x,u=a.y,f=a.level;if(!c(l))return;let p=l.upsample(i.tilingScheme,d,u,f,o,r,s);c(p)&&(e.terrainState=uo.RECEIVING,Promise.resolve(p).then(function(y){c(y)&&(e.terrainData=y,e.terrainState=uo.RECEIVED)}).catch(function(){e.terrainState=uo.FAILED}))}function Cst(e,t,n,i,o){function r(l){if(!c(l)){e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainData=l,e.terrainState=uo.RECEIVED,e.request=void 0}function s(l){if(e.request.state===jn.CANCELLED){e.terrainData=void 0,e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainState=uo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${l}"`;t._requestError=Ro.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let l=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN});e.request=l;let d=t.requestTileGeometry(n,i,o,l);c(d)?(e.terrainState=uo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=uo.UNLOADED,e.request=void 0)}a()}var Vst={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Lst(e,t,n,i,o,r){let s=n.tilingScheme,a=Vst;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);c(d)&&(e.terrainState=uo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=uo.TRANSFORMED}).catch(function(){e.terrainState=uo.FAILED}))}sr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=_t.createVertexBuffer({context:e,typedArray:n,usage:Ne.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!c(s)||s.isDestroyed()){let a=t.indices;s=_t.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:Me.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})};sr._freeVertexArray=function(e){if(c(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),c(t)&&!t.isDestroyed()&&c(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Zst(e,t,n,i,o,r,s){e.vertexArray=sr._createVertexArrayForMesh(t,e.mesh),e.terrainState=uo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Rst(e){let t=e.cache.tile_waterMaskData;if(!c(t)){let n=Pt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Gst(e,t){let n=t.terrainData.waterMask,i=Rst(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Pt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ce.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}sr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;c(t)&&(!c(t.data)||!c(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};sr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,l=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=l*(o.south-i.south)/s,n.z=a,n.w=l,n};var um=sr;var T2i=_(T(),1);var VPi=_(T(),1);var yPi=_(T(),1);var WIi=_(T(),1);var MXi=_(T(),1);function Zg(e){if(e=e??z.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??re.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Wi(this._ellipsoid),c(e.rectangleSouthwestInMeters)&&c(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 de(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Zg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Zg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Zg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Zg.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(de.southwest(e)),o=n.project(de.northeast(e));return c(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new de(i.x,i.y,o.x,o.y)};Zg.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,l=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,f=this._rectangleNortheastInMeters.y-(t+1)*d;return c(i)?(i.west=a,i.south=f,i.east=l,i.north=u,i):new de(a,f,l,u)};Zg.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};Zg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.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,f=this._projection.project(e),p=f.x-this._rectangleSouthwestInMeters.x,y=this._rectangleNortheastInMeters.y-f.y,h=p/a|0;h>=o&&(h=o-1);let g=y/d|0;return g>=r&&(g=r-1),c(n)?(n.x=h,n.y=g,n):new D(h,g)};var ss=Zg;var DXi=_(T(),1);var Jj,Cye="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",zV={};zV.defaultAccessToken=Cye;zV.defaultWorldImageryServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});zV.defaultWorldHillshadeServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});zV.defaultWorldOceanServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});zV.getDefaultTokenCredit=function(e){if(e===Cye){if(!c(Jj)){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>';Jj=new Ct(t,!0)}return Jj}};var Jd=zV;var QXi=_(T(),1);function Qj(e){if(e=e??z.EMPTY_OBJECT,!c(e.missingImageUrl))throw new L("options.missingImageUrl is required.");if(!c(e.pixelsToCheck))throw new L("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ge.createIfNeeded(e.missingImageUrl),n=this;function i(r){c(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Rm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,l=r.width,d=e.pixelsToCheck;for(let u=0,f=d.length;a&&u<f;++u){let p=d[u],y=p.x*4+p.y*l;s[y+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)}Qj.prototype.isReady=function(){return this._isReady};Qj.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new L("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,n=this._missingImagePixels;if(!c(n)||c(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],l=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=l+d;if(i[u]!==n[u])return!1}}return!0};var $v=Qj;var $Xi=_(T(),1);function jj(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}jj.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)}c(n)&&(this.name=e[n])};jj.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];c(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 Af=jj;var sIi=_(T(),1);function KV(){L.throwInstantiationError()}Object.defineProperties(KV.prototype,{rectangle:{get:L.throwInstantiationError},tileWidth:{get:L.throwInstantiationError},tileHeight:{get:L.throwInstantiationError},maximumLevel:{get:L.throwInstantiationError},minimumLevel:{get:L.throwInstantiationError},tilingScheme:{get:L.throwInstantiationError},tileDiscardPolicy:{get:L.throwInstantiationError},errorEvent:{get:L.throwInstantiationError},credit:{get:L.throwInstantiationError},proxy:{get:L.throwInstantiationError},hasAlphaChannel:{get:L.throwInstantiationError}});KV.prototype.getTileCredits=function(e,t,n){L.throwInstantiationError()};KV.prototype.requestImage=function(e,t,n,i){L.throwInstantiationError()};KV.prototype.pickFeatures=function(e,t,n,i,o){L.throwInstantiationError()};var Est=/\.ktx2$/i;KV.loadImage=function(e,t){C.defined("url",t);let n=Ge.createIfNeeded(t);return Est.test(n.url)?Ll(n):c(e)&&c(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var fl=KV;var cIi=_(T(),1),Xst={SATELLITE:1,OCEANS:2,HILLSHADE:3},Mf=Object.freeze(Xst);function Vye(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=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=e.tileWidth??256,this.tileHeight=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&&!c(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new $v({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 Ist(e,t){let n=e.tileInfo;if(!c(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 ss({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new le(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,c(e.fullExtent)){if(c(e.fullExtent.spatialReference)&&c(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 de(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=de.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 le(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}c(e.copyrightText)&&e.copyrightText.length>0&&(c(t.credit)?t.tileCredits=[new Ct(e.copyrightText)]:t.credit=new Ct(e.copyrightText))}function Wst(e,t){let n=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(n+=`: ${t.message}`),new le(n)}async function wst(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Ist(i,t)}catch(i){Wst(e,i)}}function tp(e){e=e??z.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=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=e.enablePickFeatures??!0,this._errorEvent=new ye}tp.fromBasemapType=async function(e,t){C.defined("style",e),t=t??z.EMPTY_OBJECT;let n,i,o;switch(e){case Mf.SATELLITE:{n=t.token??Jd.defaultAccessToken,i=Ge.createIfNeeded(Jd.defaultWorldImageryServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);c(r)&&(o=Ct.clone(r))}break;case Mf.OCEANS:{n=t.token??Jd.defaultAccessToken,i=Ge.createIfNeeded(Jd.defaultWorldOceanServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);c(r)&&(o=Ct.clone(r))}break;case Mf.HILLSHADE:{n=t.token??Jd.defaultAccessToken,i=Ge.createIfNeeded(Jd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);c(r)&&(o=Ct.clone(r))}break;default:throw new L(`Unsupported basemap type: ${e}`)}return tp.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),l={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Xi?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:l})}return r}Object.defineProperties(tp.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}}});tp.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&n.setQueryParameters({token:t.token});let i=new tp(t);i._resource=n;let o=new Vye(t);return(t.usePreCachedTilesIfAvailable??!0)&&await wst(n,o),o.build(i),i};tp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};tp.prototype.requestImage=function(e,t,n,i){return fl.loadImage(this,Lye(this,e,t,n,i))};tp.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,l;if(this._tilingScheme.projection instanceof Xi)s=w.toDegrees(i),a=w.toDegrees(o),l="4326";else{let p=this._tilingScheme.projection.project(new pe(i,o,0));s=p.x,a=p.y,l="3857"}let d="visible";c(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:l,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let y=[],h=p.results;if(!c(h))return y;for(let g=0;g<h.length;++g){let x=h[g],S=new Af;if(S.data=x,S.name=x.value,S.properties=x.attributes,S.configureDescriptionFromProperties(x.attributes),x.geometryType==="esriGeometryPoint"&&x.geometry){let V=x.geometry.spatialReference&&x.geometry.spatialReference.wkid?x.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)S.position=pe.fromDegrees(x.geometry.x,x.geometry.y,x.geometry.z);else if(V===102100||V===900913||V===3857){let Z=new Wi;S.position=Z.unproject(new m(x.geometry.x,x.geometry.y,x.geometry.z))}}y.push(S)}return y})};tp._metadataCache={};var l0=tp;var eWi=_(T(),1);var PIi=_(T(),1),Pst={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(Pst);var AIi=_(T(),1);function eF(e){}eF.prototype.isReady=function(){return!0};eF.prototype.shouldDiscardImage=function(e){return eF.EMPTY_IMAGE===e};var FO;Object.defineProperties(eF,{EMPTY_IMAGE:{get:function(){return c(FO)||(FO=new Image,FO.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),FO}}});var QV=eF;function Zye(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}Zye.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 l=r[s],d=l.bbox;l.bbox=new de(w.toRadians(d[1]),w.toRadians(d[0]),w.toRadians(d[3]),w.toRadians(d[2]))}}};function vst(e,t){if(e.resourceSets.length!==1)throw new le("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;c(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>c(r.bbox)))),t.attributionList=i}function Fst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i+=`: ${t.message}`),Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new le(i)}async function Ast(e,t,n){let i=e.url,o=Ws._metadataCache[i];c(o)||(o=e.fetchJsonp("jsonp"),Ws._metadataCache[i]=o);try{let r=await o;return vst(r,t)}catch(r){Fst(e,r,n)}}function Ws(e){e=e??z.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=e.mapStyle??JV.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,c(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="${Ws.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new ss({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 ye}Object.defineProperties(Ws.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 c(this.mapLayer)}}});Ws.fromUrl=async function(e,t){t=t??z.EMPTY_OBJECT,C.defined("url",e),C.defined("options.key",t.key);let n=t.tileProtocol;c(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??JV.AERIAL,o=Ge.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};c(t.mapLayer)&&(r.mapLayer=t.mapLayer),c(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ws(t);a._resource=o;let l=new Zye(t);return await Ast(s,l),l.build(a),a};var Mst=new de;Ws.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Mst);return Ust(this._attributionList,n,i)};Ws.prototype.requestImage=function(e,t,n,i){let o=fl.loadImage(this,Nst(this,e,t,n,i));if(c(o))return o.catch(function(r){return c(r.blob)&&r.blob.size===0?QV.EMPTY_IMAGE:Promise.reject(r)})};Ws.prototype.pickFeatures=function(e,t,n,i,o){};Ws.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Ws.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&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Ws._logoUrl=void 0;Object.defineProperties(Ws,{logoUrl:{get:function(){return c(Ws._logoUrl)||(Ws._logoUrl=on("Assets/Images/bing_maps_credit.png")),Ws._logoUrl},set:function(e){C.defined("value",e),Ws._logoUrl=e}}});function Nst(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:Ws.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var kst=new de;function Ust(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,l=!1;for(let d=0,u=s.coverageAreas.length;!l&&d<u;++d){let f=a[d];if(t>=f.zoomMin&&t<=f.zoomMax){let p=de.intersection(n,f.bbox,kst);c(p)&&(l=!0)}}l&&i.push(s.credit)}return i}Ws._metadataCache={};var tF=Ws;var wWi=_(T(),1);var yWi=_(T(),1);var Rye=/{[^}]+}/g,Gye={x:Yst,y:zst,z:Qst,s:jst,reverseX:Hst,reverseY:Kst,reverseZ:Jst,westDegrees:qst,southDegrees:$st,eastDegrees:eat,northDegrees:tat,westProjected:nat,southProjected:iat,eastProjected:oat,northProjected:rat,width:sat,height:aat},Ost=St(Gye,{i:cat,j:lat,reverseI:dat,reverseJ:uat,longitudeDegrees:fat,latitudeDegrees:hat,longitudeProjected:pat,latitudeProjected:bat,format:gat});function nF(e){e=e??z.EMPTY_OBJECT,this._errorEvent=new ye,C.defined("options.url",e.url);let t=Ge.createIfNeeded(e.url),n=Ge.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():c(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new ss({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=de.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=e.hasAlphaChannel??!0;let r=e.customTags,s=St(Gye,r),a=St(Ost,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=e.enablePickFeatures??!0}Object.defineProperties(nF.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}}});nF.prototype.getTileCredits=function(e,t,n){};nF.prototype.requestImage=function(e,t,n,i){return fl.loadImage(this,Dst(this,e,t,n,i))};nF.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!c(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function l(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=Bst(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(l):d.type==="xml"?u.fetchXML().then(d.callback).catch(l):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(l):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(l)}return l()};var AO=!1,Qd=new de,MO=!1,iF=new de;function Dst(e,t,n,i,o){AO=!1,MO=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,l={},d=s.match(Rye);return c(d)&&d.forEach(function(u){let f=u.substring(1,u.length-1);c(a[f])&&(l[f]=a[f](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:l})}var qj=!1,qV=new D,$j=!1;function Bst(e,t,n,i,o,r,s){AO=!1,MO=!1,qj=!1,$j=!1;let a=e._pickFeaturesResource,l=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},f=l.match(Rye);return c(f)&&f.forEach(function(p){let y=p.substring(1,p.length-1);c(d[y])&&(u[y]=d[y](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function $V(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 Yst(e,t,n,i){return $V(e,"{x}",t)}function Hst(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return $V(e,"{reverseX}",o)}function zst(e,t,n,i){return $V(e,"{y}",n)}function Kst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return $V(e,"{reverseY}",o)}function Jst(e,t,n,i){let o=e.maximumLevel,r=c(o)&&i<o?o-i-1:i;return $V(e,"{reverseZ}",r)}function Qst(e,t,n,i){return $V(e,"{z}",i)}function jst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function NO(e,t,n,i){AO||(e.tilingScheme.tileXYToRectangle(t,n,i,Qd),Qd.west=w.toDegrees(Qd.west),Qd.south=w.toDegrees(Qd.south),Qd.east=w.toDegrees(Qd.east),Qd.north=w.toDegrees(Qd.north),AO=!0)}function qst(e,t,n,i){return NO(e,t,n,i),Qd.west}function $st(e,t,n,i){return NO(e,t,n,i),Qd.south}function eat(e,t,n,i){return NO(e,t,n,i),Qd.east}function tat(e,t,n,i){return NO(e,t,n,i),Qd.north}function kO(e,t,n,i){MO||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,iF),MO=!0)}function nat(e,t,n,i){return kO(e,t,n,i),iF.west}function iat(e,t,n,i){return kO(e,t,n,i),iF.south}function oat(e,t,n,i){return kO(e,t,n,i),iF.east}function rat(e,t,n,i){return kO(e,t,n,i),iF.north}function sat(e,t,n,i){return e.tileWidth}function aat(e,t,n,i){return e.tileHeight}function cat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),qV.x}function lat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),qV.y}function dat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),e.tileWidth-qV.x-1}function uat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),e.tileHeight-qV.y-1}var mat=new de,jV=new m;function UO(e,t,n,i,o,r,s){if(qj)return;e4(e,t,n,i,o,r);let a=jV,l=e.tilingScheme.tileXYToNativeRectangle(t,n,i,mat);qV.x=e.tileWidth*(a.x-l.west)/l.width|0,qV.y=e.tileHeight*(l.north-a.y)/l.height|0,qj=!0}function fat(e,t,n,i,o,r,s){return w.toDegrees(o)}function hat(e,t,n,i,o,r,s){return w.toDegrees(r)}function pat(e,t,n,i,o,r,s){return e4(e,t,n,i,o,r),jV.x}function bat(e,t,n,i,o,r,s){return e4(e,t,n,i,o,r),jV.y}var yat=new pe;function e4(e,t,n,i,o,r,s){if(!$j){if(e.tilingScheme.projection instanceof Xi)jV.x=w.toDegrees(o),jV.y=w.toDegrees(r);else{let a=yat;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,jV)}$j=!0}}function gat(e,t,n,i,o,r,s){return s}var Ba=nF;function mm(e){Ba.call(this,e)}mm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return mm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof ih)return mm._metadataFailure(e,t);throw o}};mm.fromUrl=async function(e,t){C.defined("url",e);let n=Ge.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??z.EMPTY_OBJECT;let r=await mm._requestMetadata(t,i,o);return new mm(r)};c(Object.create)&&(mm.prototype=Object.create(Ba.prototype),mm.prototype.constructor=mm);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 Xye(e,t,n){let i=e.positionToTileXY(de.southwest(t),n),o=e.positionToTileXY(de.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}mm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,l=/boundingbox/i,d,u,f,p=[],y=e.childNodes[0].childNodes;for(let P=0;P<y.length;P++)if(r.test(y.item(P).nodeName))d=y.item(P);else if(a.test(y.item(P).nodeName)){f=y.item(P);let F=y.item(P).childNodes;for(let N=0;N<F.length;N++)s.test(F.item(N).nodeName)&&p.push(F.item(N))}else l.test(y.item(P).nodeName)&&(u=y.item(P));let h;if(!c(f)||!c(u))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,c(o)&&Ro.reportError(void 0,o,o.errorEvent,h),new le(h);let g=t.fileExtension??d.getAttribute("extension"),x=t.tileWidth??parseInt(d.getAttribute("width"),10),S=t.tileHeight??parseInt(d.getAttribute("height"),10),V=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),Z=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),R=f.getAttribute("profile"),E=t.tilingScheme;if(!c(E))if(R==="geodetic"||R==="global-geodetic")E=new Ki({ellipsoid:t.ellipsoid});else if(R==="mercator"||R==="global-mercator")E=new ss({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${R}.`,c(o)&&Ro.reportError(void 0,o,o.errorEvent,h),new le(h);let I=de.clone(t.rectangle);if(!c(I)){let P,F,N,b;t.flipXY??!1?(N=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(N=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let X=R==="geodetic"||R==="mercator";if(E.projection instanceof Xi||X)P=pe.fromDegrees(N.x,N.y),F=pe.fromDegrees(b.x,b.y);else{let W=E.projection;P=W.unproject(N),F=W.unproject(b)}I=new de(P.longitude,P.latitude,F.longitude,F.latitude)}return I=Eye(I,E),V=Xye(E,I,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${g}`}),tilingScheme:E,rectangle:I,tileWidth:x,tileHeight:S,minimumLevel:V,maximumLevel:Z,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};mm._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=c(e.tilingScheme)?e.tilingScheme:new ss({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Eye(a,s);let l=Xye(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:l,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Rg=mm;var zWi=_(T(),1);function Iye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Iye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function xat(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(!c(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new le(o)}if(!c(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new le(o)}if(t.version=i.version,c(n.projection)&&n.projection==="flat")t.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!c(n.projection)||n.projection==="mercator")t.tilingScheme=new ss({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new le(o)}return!0}function _at(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw c(e)&&c(e.message)&&(i+=`: ${e.message}`),Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new le(i)}async function Tat(e,t,n){try{let i=await e.fetchText();xat(i,t)}catch(i){_at(i,e,n)}}function ql(e){e=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="${ql.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 ye}Object.defineProperties(ql.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}}});ql.fromUrl=async function(e,t,n){C.defined("url",e),C.defined("channel",t),n=n??{};let i=n.path??"/default_map",o=Ge.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 Iye(n);s.channel=t,await Tat(r,s);let a=new ql(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};ql.prototype.getTileCredits=function(e,t,n){};ql.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 fl.loadImage(this,o)};ql.prototype.pickFeatures=function(e,t,n,i,o){};ql._logoUrl=void 0;Object.defineProperties(ql,{logoUrl:{get:function(){return c(ql._logoUrl)||(ql._logoUrl=on("Assets/Images/google_earth_credit.png")),ql._logoUrl},set:function(e){C.defined("value",e),ql._logoUrl=e}}});var oF=ql;var twi=_(T(),1);var Sat=/\/$/,Wye=new Ct('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function eL(e){e=e??z.EMPTY_OBJECT;let t=e.mapId;if(!c(t))throw new L("options.mapId is required.");let n=e.accessToken;if(!c(n))throw new L("options.accessToken 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;let i=Ge.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Sat.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;c(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Ct(s))):s=Wye,this._resource=i,this._imageryProvider=new Ba({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(eL.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}}});eL.prototype.getTileCredits=function(e,t,n){};eL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};eL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};eL._defaultCredit=Wye;var rF=eL;var hwi=_(T(),1);function PT(e){e=e??z.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=e.rectangle??de.MAX_VALUE,n=new Ki({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 ye;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i,C.defined("options.url",e.url);let o=Ge.createIfNeeded(e.url);this._resource=o,C.typeOf.number("options.tileWidth",e.tileWidth),C.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(PT.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 Cat(e,t,n,i){let o=`Failed to load image ${e.url}`;c(t)&&c(t.message)&&(o+=`: ${t.message}`);let r=Ro.reportError(i,n,c(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return t4(e,n,r);throw c(n)&&(n._hasError=!0),new le(o)}async function t4(e,t,n){try{return await fl.loadImage(null,e)}catch(i){return Cat(e,i,t,n)}}PT.fromUrl=async function(e,t){C.defined("url",e);let n=Ge.createIfNeeded(e),i=await t4(n);t=t??z.EMPTY_OBJECT;let o=new PT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};PT.prototype.getTileCredits=function(e,t,n){};PT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!c(this._image)){let o=await t4(this._resource,this);return this._image=o,Ro.reportSuccess(this._errorEvent),o}return this._image};PT.prototype.pickFeatures=function(e,t,n,i,o){};var sF=PT;var Uwi=_(T(),1);var Twi=_(T(),1);function Vat(e,t,n){if(!c(e))throw new L("type is required.");if(this.type=e,!c(t))if(e==="json")t="application/json";else if(e==="xml")t="text/xml";else if(e==="html")t="text/html";else if(e==="text")t="text/plain";else throw new L('format is required when type is not "json", "xml", "html", or "text".');if(this.format=t,!c(n))if(e==="json")n=Lat;else if(e==="xml")n=Eat;else if(e==="html")n=wye;else if(e==="text")n=wye;else throw new L('callback is required when type is not "json", "xml", "html", or "text".');this.callback=n}function Lat(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Af;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),c(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=pe.fromDegrees(s,a)}t.push(r)}return t}var n4="http://www.mapinfo.com/mxp",Zat="http://www.esri.com/wms",Rat="http://www.opengis.net/wfs",Gat="http://www.opengis.net/gml";function Eat(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===n4)return Xat(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Zat)return Iat(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Rat)return Wat(e);if(t.localName==="ServiceExceptionReport")throw new le(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?wat(e):Pat(e)}function Xat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(n4,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(n4,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let f=u.getAttribute("ref"),p=u.textContent.trim();s[f]=p}}let l=new Af;l.data=r,l.properties=s,l.configureNameFromProperties(s),l.configureDescriptionFromProperties(s),t.push(l)}return t}function Iat(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 l=0;l<a.length;++l){let d=a[l];i[d.name]=d.value}n.push(OO(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let l=a.childNodes;for(let d=0;d<l.length;++d){let u=l[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(OO(a,i))}}return n}function Wat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Gat,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};i4(r,s),t.push(OO(r,s))}return t}function wat(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(!c(n))throw new le("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={};i4(s,a),t.push(OO(s,a))}}return t}function i4(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()&&i4(o,t)&&(t[o.localName]=o.textContent)}return n}function OO(e,t){let n=new Af;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Pat(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Af;return o.data=e,o.description=n.innerHTML,[o]}var vat=/<body>\s*<\/body>/im,Fat=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Aat=/<title>([\s\S]*)<\/title>/im;function wye(e){if(vat.test(e)||Fat.test(e))return;let t,n=Aat.exec(e);n&&n.length>1&&(t=n[1]);let i=new Af;return i.name=t,i.description=e,i.data=e,[i]}var vT=Vat;var Xwi=_(T(),1);function aF(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.clock",e.clock),C.typeOf.object("options.times",e.times),C.typeOf.func("options.requestImageFunction",e.requestImageFunction),C.typeOf.func("options.reloadFunction",e.reloadFunction),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(aF.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!c(e))throw new L("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!c(e))throw new L("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});aF.prototype.getFromCache=function(e,t,n,i){let o=Pye(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(c(s)&&c(s[o])){let a=s[o];r=a.promise.catch(function(l){throw i.state=a.request.state,l}),delete s[o]}return r};aF.prototype.checkApproachingInterval=function(e,t,n,i){let o=Pye(e,t,n),r=this._tilesRequestedForInterval,s=vye(this),a={key:o,priorityFunction:i.priorityFunction};(!c(s)||!Fye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};aF.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=vye(this);if(c(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let l=s.pop();a=Fye(this,l,r),a||s.push(l)}}};function Pye(e,t,n){return`${e}-${t}-${n}`}function Mat(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function vye(e){let t=e._times;if(!c(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 l=t.get(a);return r>0?(s=ee.secondsDifference(l.stop,i),++a):(s=ee.secondsDifference(l.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];c(r)||(r=o[i]={});let s=t.key;if(c(r[s]))return!0;let a=Mat(s),l=new Jo({throttle:!1,throttleByServer:!0,type:us.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,l,n);return c(d)?(r[s]={promise:d,request:l},!0):!1}var FT=aF;var Nat=[3034,3035,3042,3043,3044],kat=[4471,4559];function Nf(e){if(e=e??z.EMPTY_OBJECT,!c(e.url))throw new L("options.url is required.");if(!c(e.layers))throw new L("options.layers is required.");if(c(e.times)&&!c(e.clock))throw new L("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=e.getFeatureInfoUrl??e.url;let t=Ge.createIfNeeded(e.url),n=Ge.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Nf.DefaultParameters,!0),n.setQueryParameters(Nf.GetFeatureInfoDefaultParameters,!0),c(e.parameters)&&t.setQueryParameters(Aye(e.parameters)),c(e.getFeatureInfoParameters)&&n.setQueryParameters(Aye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new FT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,l,d,u){return Mye(i,s,a,l,d,u)},reloadFunction:function(){c(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=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&&!kat.includes(a)||Nat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=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 Ba({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({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:e.getFeatureInfoFormats??Nf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Mye(e,t,n,i,o,r){let s=c(r)?r.data:void 0,a=e._tileProvider;return c(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Uat(e,t,n,i,o,r,s){let a=c(s)?s.data:void 0,l=e._tileProvider;return c(a)&&l._pickFeaturesResource.setQueryParameters(a),l.pickFeatures(t,n,i,o,r)}Object.defineProperties(Nf.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}}});Nf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Nf.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=Mye(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};Nf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=c(r)?r.currentInterval:void 0;return Uat(this,e,t,n,i,o,s)};Nf.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Nf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Nf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new vT("json","application/json")),Object.freeze(new vT("xml","text/xml")),Object.freeze(new vT("text","text/html"))]);function Aye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var cF=Nf;var ePi=_(T(),1);var Oat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function lF(e){if(e=e??z.EMPTY_OBJECT,!c(e.url))throw new L("options.url is required.");if(!c(e.layer))throw new L("options.layer is required.");if(!c(e.style))throw new L("options.style is required.");if(!c(e.tileMatrixSetID))throw new L("options.tileMatrixSetID is required.");if(c(e.times)&&!c(e.clock))throw new L("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;let t=Ge.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!c(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Oat),this._useKvp=!0;else{let f={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(f),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new ss({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new FT({clock:e.clock,times:e.times,requestImageFunction:function(f,p,y,h,g){return Nye(s,f,p,y,h,g)},reloadFunction:function(){c(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(de.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(de.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(l.x-a.x)+1)*(Math.abs(l.y-a.y)+1);if(d>4)throw new L(`The imagery provider's rectangle and minimumLevel indicate that there are ${d} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new ye;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():c(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=c(s)?s[i]:i.toString(),l=e._subdomains,d=e._dimensions,u=c(r)?r.data:void 0,f,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:l[(t+n+i)%l.length]},f=e._resource.getDerivedResource({request:o}),f.setTemplateValues(p),c(d)&&f.setTemplateValues(d),c(u)&&f.setTemplateValues(u);else{let y={};y.tilematrix=a,y.layer=e._layer,y.style=e._style,y.tilerow=n,y.tilecol=t,y.tilematrixset=e._tileMatrixSetID,y.format=e._format,c(d)&&(y=St(y,d)),c(u)&&(y=St(y,u)),p={s:l[(t+n+i)%l.length]},f=e._resource.getDerivedResource({queryParameters:y,request:o}),f.setTemplateValues(p)}return fl.loadImage(e,f)}Object.defineProperties(lF.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,c(this._reload)&&this._reload())}}});lF.prototype.getTileCredits=function(e,t,n){};lF.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=Nye(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};lF.prototype.pickFeatures=function(e,t,n,i,o){};var dF=lF;var Dat={ARCGIS_MAPSERVER:l0.fromUrl,BING:async(e,t)=>tF.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,oF.fromUrl(e,n,t)},MAPBOX:(e,t)=>new rF({url:e,...t}),SINGLE_TILE:sF.fromUrl,TMS:Rg.fromUrl,URL_TEMPLATE:(e,t)=>new Ba({url:e,...t}),WMS:(e,t)=>new cF({url:e,...t}),WMTS:(e,t)=>new dF({url:e,...t})};function np(e){e=e??z.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 ye}Object.defineProperties(np.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(){}}});np.fromAssetId=async function(e,t){C.typeOf.number("assetId",e),t=t??z.EMPTY_OBJECT;let n=xd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=np._endpointCache[i];c(o)||(o=n.fetchJson(),np._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new le(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!c(a))s=await Rg.fromUrl(new xd(r,n));else{let d=Dat[a];if(!c(d))throw new le(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},f=u.url;delete u.url,s=await d(f,u)}let l=new np(t);return s.errorEvent.addEventListener(function(d){d.provider=l,l._errorEvent.raiseEvent(d)}),l._tileCredits=xd.getCreditsFromEndpoint(r,n),l._imageryProvider=s,l};np.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return c(i)?this._tileCredits.concat(i):this._tileCredits};np.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};np.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};np._endpointCache={};var d0=np;var xPi=_(T(),1),Bat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},u0=Object.freeze(Bat);function Yat(e){e=e??z.EMPTY_OBJECT;let t=e.style??u0.AERIAL;return d0.fromAssetId(t)}var m0=Yat;var EPi=_(T(),1);function tL(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,!c(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}tL.createPlaceholder=function(e){let t=new tL(e,0,0,0);return t.addReference(),t.state=ci.PLACEHOLDER,t};tL.prototype.addReference=function(){++this.referenceCount};tL.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),c(this.parent)&&this.parent.releaseReference(),c(this.image)&&c(this.image.destroy)&&this.image.destroy(),c(this.texture)&&this.texture.destroy(),c(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),he(this),0):this.referenceCount};tL.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 nL=tL;var wPi=_(T(),1);function o4(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}o4.prototype.freeResources=function(){c(this.readyImagery)&&this.readyImagery.releaseReference(),c(this.loadingImagery)&&this.loadingImagery.releaseReference()};o4.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 c(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(;c(r)&&(r.state!==ci.READY||!this.useWebMercatorT&&!c(r.texture));)r.state!==ci.FAILED&&r.state!==ci.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,c(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ci.FAILED||i.state===ci.INVALID?c(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var iL=o4;function Si(e,t){this._imageryProvider=e,this._readyEvent=new ye,this._errorEvent=new ye,t=t??z.EMPTY_OBJECT,e=e??z.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Si.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Si.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Si.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Si.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Si.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Si.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Si.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Si.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??de.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new iL(nL.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=t.colorToAlphaThreshold??Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Si.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return c(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=Ar.NONE;Si.DEFAULT_MINIFICATION_FILTER=Jt.LINEAR;Si.DEFAULT_MAGNIFICATION_FILTER=di.LINEAR;Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Si.fromProviderAsync=function(e,t){C.typeOf.object("imageryProviderPromise",e);let n=new Si(void 0,t);return Qat(n,Promise.resolve(e)),n};Si.fromWorldImagery=function(e){return e=e??z.EMPTY_OBJECT,Si.fromProviderAsync(m0({style:e.style}),e)};Si.prototype.isBaseLayer=function(){return this._isBaseLayer};Si.prototype.isDestroyed=function(){return!1};Si.prototype.destroy=function(){return he(this)};var Oye=new de,kye=new de,r4=new de,Dye=new de;Si.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return de.intersection(e.rectangle,t)};Si.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!c(t)||c(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||c(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;c(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=de.intersection(o.rectangle,this._rectangle,Oye),a=de.intersection(e.rectangle,s,kye);if(!c(a)){if(!this.isBaseLayer())return!1;let X=s,W=e.rectangle;a=kye,W.south>=X.north?a.north=a.south=X.north:W.north<=X.south?a.north=a.south=X.south:(a.south=Math.max(W.south,X.south),a.north=Math.min(W.north,X.north)),W.west>=X.east?a.west=a.east=X.east:W.east<=X.west?a.west=a.east=X.west:(a.west=Math.max(W.west,X.west),a.east=Math.min(W.east,X.east))}let l=0;a.south>0?l=a.south:a.north<0&&(l=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),f=Kat(this,u,l);f=Math.max(0,f);let p=o.maximumLevel;if(f>p&&(f=p),c(o.minimumLevel)){let X=o.minimumLevel;f<X&&(f=X)}let y=o.tilingScheme,h=y.positionToTileXY(de.northwest(a),f),g=y.positionToTileXY(de.southeast(a),f),x=e.rectangle.width/512,S=e.rectangle.height/512,V=y.tileXYToRectangle(h.x,h.y,f);Math.abs(V.south-e.rectangle.north)<S&&h.y<g.y&&++h.y,Math.abs(V.east-e.rectangle.west)<x&&h.x<g.x&&++h.x;let Z=y.tileXYToRectangle(g.x,g.y,f);Math.abs(Z.north-e.rectangle.south)<S&&g.y>h.y&&--g.y,Math.abs(Z.west-e.rectangle.east)<x&&g.x>h.x&&--g.x;let R=de.clone(e.rectangle,Dye),E=y.tileXYToRectangle(h.x,h.y,f),I=de.intersection(E,s,r4),v;r?(y.rectangleToNativeRectangle(R,R),y.rectangleToNativeRectangle(E,E),y.rectangleToNativeRectangle(I,I),y.rectangleToNativeRectangle(s,s),v=y.tileXYToNativeRectangle.bind(y),x=R.width/512,S=R.height/512):v=y.tileXYToRectangle.bind(y);let P,F=0,N=1,b;!this.isBaseLayer()&&Math.abs(I.west-R.west)>=x&&(F=Math.min(1,(I.west-R.west)/R.width)),!this.isBaseLayer()&&Math.abs(I.north-R.north)>=S&&(N=Math.max(0,(I.north-R.south)/R.height));let G=N;for(let X=h.x;X<=g.x;X++)if(P=F,E=v(X,h.y,f),I=de.simpleIntersection(E,s,r4),!!c(I)){F=Math.min(1,(I.east-R.west)/R.width),X===g.x&&(this.isBaseLayer()||Math.abs(I.east-R.east)<x)&&(F=1),N=G;for(let W=h.y;W<=g.y;W++){if(b=N,E=v(X,W,f),I=de.simpleIntersection(E,s,r4),!c(I))continue;N=Math.max(0,(I.south-R.south)/R.height),W===g.y&&(this.isBaseLayer()||Math.abs(I.south-R.south)<S)&&(N=0);let A=new ce(P,N,F,b),k=this.getImageryFromCache(X,W,f);i.imagery.splice(n,0,new iL(k,A,r)),++n}}return!0};Si.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let l=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=l.rectangleToNativeRectangle(n,Oye),i=l.rectangleToNativeRectangle(i,Dye)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ce(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(!c(s))return o();e.image=s,e.state=ci.RECEIVED,e.request=void 0,Ro.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=Ro.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Jo({throttle:!1,throttleByServer:!0,type:us.IMAGERY});e.request=s,e.state=ci.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!c(a)){e.state=ci.UNLOADED,e.request=void 0;return}c(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(l){i(l)}).catch(function(l){o(l)})}r()};Si.prototype._createTextureWebGL=function(e,t){let n=new en({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return c(i.internalFormat)?new Pt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Pt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ke.RGBA:ke.RGB,sampler:n})};Si.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(c(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(c(r)){if(!r.isReady()){t.state=ci.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ci.INVALID;return}}}if(this.minificationFilter!==Jt.NEAREST&&this.minificationFilter!==Jt.LINEAR)throw new L("ImageryLayer minification filter must be NEAREST or LINEAR");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===di.LINEAR&&!ke.isCompressedFormat(t.pixelFormat)&&w.isPowerOfTwo(t.width)&&w.isPowerOfTwo(t.height)){n=Jt.LINEAR_MIPMAP_LINEAR;let r=mt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Uye(n,i,s),l=e.cache.imageryLayerMipmapSamplers;c(l)||(l={},e.cache.imageryLayerMipmapSamplers=l);let d=l[a];c(d)||(d=l[a]=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(_u.NICEST),t.sampler=d}else{let r=Uye(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;c(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];c(a)||(a=s[r]=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.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=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Xi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new vc({persists:!0,owner:this,preExecute:function(l){zat(l,r,i,t.rectangle)},postExecute:function(l){t.texture=l,s._finalizeReprojectTexture(r,l),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){c(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Si.prototype.getImageryFromCache=function(e,t,n,i){let o=Bye(e,t,n),r=this._imageryCache[o];return c(r)||(r=new nL(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Si.prototype.removeImageryFromCache=function(e){let t=Bye(e.x,e.y,e.level);delete this._imageryCache[t]};function Bye(e,t,n){return JSON.stringify([e,t,n])}var DO={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},Hat=Ot.supportsTypedArrays()?new Float32Array(2*64):void 0;function zat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!c(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){c(this.framebuffer)&&this.framebuffer.destroy(),c(this.vertexArray)&&this.vertexArray.destroy(),c(this.shaderProgram)&&this.shaderProgram.destroy()}};let x=new Float32Array(2*64*2),S=0;for(let I=0;I<64;++I){let v=I/63;x[S++]=0,x[S++]=v,x[S++]=1,x[S++]=v}let V={position:0,webMercatorT:1},Z=rs.getRegularGridIndices(2,64),R=_t.createIndexBuffer({context:t,typedArray:Z,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:V.position,vertexBuffer:_t.createVertexBuffer({context:t,typedArray:x,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:_t.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:R});let E=new Be({sources:[Ov]});o.shaderProgram=tn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:Uv,attributeLocations:V}),o.sampler=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;DO.textureDimensions.x=r,DO.textureDimensions.y=s,DO.texture=n;let a=Math.sin(i.south),l=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-l),f=new Pt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});w.isPowerOfTwo(r)&&w.isPowerOfTwo(s)&&f.generateMipmap(_u.NICEST);let p=i.south,y=i.north,h=Hat,g=0;for(let x=0;x<64;++x){let S=x/63,V=w.lerp(p,y,S);a=Math.sin(V);let R=(.5*Math.log((1+a)/(1-a))-l)*u;h[g++]=R,h[g++]=R}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=o.shaderProgram,e.outputTexture=f,e.uniformMap=DO,e.vertexArray=o.vertexArray}function Kat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Xi?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 Jat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Qat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Jat(e._errorEvent,i)}}var Ya=Si;var z2i=_(T(),1);var C2i=_(T(),1),jat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},_n=jat;var L2i=_(T(),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 rL(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 ce}rL.prototype.update=function(e,t,n){this.changedThisFrame&&(qye(e,t,this.tile,n),this.changedThisFrame=!1)};rL.prototype.destroy=function(e){this._destroyVertexArray(e),c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};rL.prototype._destroyVertexArray=function(e){c(this.vertexArray)&&(c(e)?e.push(this.vertexArray):um._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var qat=new _y;rL.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=qat;a.clear();for(let d=0;d<t.length;++d){let u=t[d];c(u.data.vertexArray)&&a.enqueue(t[d])}let l=a.dequeue();for(;l!==void 0;){let d=l.findTileToWest(r),u=l.findTileToSouth(r),f=l.findTileToEast(r),p=l.findTileToNorth(r);ws(e,n,l,d,s,_n.EAST,!1,a,i),ws(e,n,l,u,s,_n.NORTH,!1,a,i),ws(e,n,l,f,s,_n.WEST,!1,a,i),ws(e,n,l,p,s,_n.SOUTH,!1,a,i);let y=d.findTileToNorth(r),h=d.findTileToSouth(r),g=f.findTileToNorth(r),x=f.findTileToSouth(r);ws(e,n,l,y,s,_n.SOUTHEAST,!1,a,i),ws(e,n,l,g,s,_n.SOUTHWEST,!1,a,i),ws(e,n,l,h,s,_n.NORTHEAST,!1,a,i),ws(e,n,l,x,s,_n.NORTHWEST,!1,a,i),l=a.dequeue()}};function ws(e,t,n,i,o,r,s,a,l){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>=_n.NORTHWEST&&u!==void 0)switch(r){case _n.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case _n.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case _n.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case _n.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Jn.RENDERED){if(c(d.data.vertexArray))return;$at(e,t,n,d,r,o,a,l);return}if(Jn.originalResult(i._lastSelectionResult)!==Jn.CULLED)switch(r){case _n.WEST:ws(e,t,n,i.northwestChild,o,r,!0,a,l),ws(e,t,n,i.southwestChild,o,r,!0,a,l);break;case _n.EAST:ws(e,t,n,i.southeastChild,o,r,!0,a,l),ws(e,t,n,i.northeastChild,o,r,!0,a,l);break;case _n.SOUTH:ws(e,t,n,i.southwestChild,o,r,!0,a,l),ws(e,t,n,i.southeastChild,o,r,!0,a,l);break;case _n.NORTH:ws(e,t,n,i.northeastChild,o,r,!0,a,l),ws(e,t,n,i.northwestChild,o,r,!0,a,l);break;case _n.NORTHWEST:ws(e,t,n,i.northwestChild,o,r,!0,a,l);break;case _n.NORTHEAST:ws(e,t,n,i.northeastChild,o,r,!0,a,l);break;case _n.SOUTHWEST:ws(e,t,n,i.southwestChild,o,r,!0,a,l);break;case _n.SOUTHEAST:ws(e,t,n,i.southeastChild,o,r,!0,a,l);break;default:throw new L("Invalid edge")}}}function $at(e,t,n,i,o,r,s,a){let l=i.data;if(l.fill===void 0)l.fill=new rL(i);else if(l.fill.visitedFrame===r)return;l.fill.enqueuedFrame!==r&&(l.fill.enqueuedFrame=r,l.fill.changedThisFrame=!1,s.enqueue(i)),ect(e,t,n,i,o,a)}function ect(e,t,n,i,o,r){let s=i.data.fill,a,l=n.data.fill;c(l)?(l.visitedFrame=t.frameNumber,l.changedThisFrame&&(qye(e,t,n,r),l.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case _n.WEST:d=s.westMeshes,u=s.westTiles;break;case _n.SOUTH:d=s.southMeshes,u=s.southTiles;break;case _n.EAST:d=s.eastMeshes,u=s.eastTiles;break;case _n.NORTH:d=s.northMeshes,u=s.northTiles;break;case _n.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case _n.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case _n.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case _n.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 f,p,y,h,g=n.rectangle,x,S=i.rectangle;switch(o){case _n.WEST:for(x=(S.north-S.south)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.greaterThan(g.north,h.south,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.greaterThanOrEquals(g.south,h.north,x));++p);break;case _n.SOUTH:for(x=(S.east-S.west)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.lessThan(g.west,h.east,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.lessThanOrEquals(g.east,h.west,x));++p);break;case _n.EAST:for(x=(S.north-S.south)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.lessThan(g.south,h.north,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.lessThanOrEquals(g.north,h.south,x));++p);break;case _n.NORTH:for(x=(S.east-S.west)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.greaterThan(g.east,h.west,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.greaterThanOrEquals(g.west,h.east,x));++p);break}p-f===1?(s.changedThisFrame=s.changedThisFrame||d[f]!==a,d[f]=a,u[f]=n):(s.changedThisFrame=!0,d.splice(f,p-f,a),u.splice(f,p-f,n))}var AT=new pe,tct=new pe,oL=new m,l4=new m,s4=new D,a4=new D,jd=new D;function QO(){this.height=0,this.encodedNormal=new D}function BO(e,t,n,i,o,r,s,a,l){if(c(o))return o;let d;if(c(r)&&c(s))d=(r.height+s.height)*.5;else if(c(r))d=r.height;else if(c(s))d=s.height;else if(c(a))d=a.height;else{let f=e.tile.data.tileBoundingRegion,p=0,y=0;c(f)&&(p=f.minimumHeight,y=f.maximumHeight),d=(p+y)*.5}return $ye(e,t,n,i,d,l),l}var nct={minimumHeight:0,maximumHeight:0},ict=new m,Hye=new QO,zye=new QO,Kye=new QO,Jye=new QO,oct=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,rct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function qye(e,t,n,i){um.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,l=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,f=HO(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Kye),p=HO(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,Hye),y=HO(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,zye),h=HO(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Jye);f=BO(r,u,0,1,f,p,h,y,Kye),p=BO(r,u,0,0,p,f,y,h,Hye),y=BO(r,u,1,1,y,p,h,f,zye),h=BO(r,u,1,1,h,y,f,p,Jye);let g=p.height,x=y.height,S=f.height,V=h.height,Z=Math.min(g,x,S,V),R=Math.max(g,x,S,V),E=(Z+R)*.5,I,v,P=e.getLevelMaximumGeometricError(n.level),F=u.maximumRadius-P,N=Math.acos(F/u.maximumRadius)*4;if(N*=1.5,s.width>N&&R-Z<=P){let X=new Da({width:9,height:9,buffer:oct,structure:{heightOffset:R}}),W=rct;W.tilingScheme=n.tilingScheme,W.x=n.x,W.y=n.y,W.level=n.level,W.exaggeration=a,W.exaggerationRelativeHeight=l,r.mesh=X._createMeshSync(W)}else{let X=d,W=de.center(s,tct);W.height=E;let A=u.cartographicToCartesian(W,ict),k=new Rc(A,void 0,void 0,void 0,void 0,!0,!0,X,a,l),B=5,O;for(O=r.westMeshes,I=0,v=O.length;I<v;++I)B+=O[I].eastIndicesNorthToSouth.length;for(O=r.southMeshes,I=0,v=O.length;I<v;++I)B+=O[I].northIndicesWestToEast.length;for(O=r.eastMeshes,I=0,v=O.length;I<v;++I)B+=O[I].westIndicesSouthToNorth.length;for(O=r.northMeshes,I=0,v=O.length;I<v;++I)B+=O[I].southIndicesEastToWest.length;let H=nct;H.minimumHeight=Z,H.maximumHeight=R;let U=k.stride,K=new Float32Array(B*U),Q=0,ie=Q;Q=YO(u,s,k,K,Q,0,1,f.height,f.encodedNormal,1,H),Q=KO(r,u,k,K,Q,r.westTiles,r.westMeshes,_n.EAST,H);let j=Q;Q=YO(u,s,k,K,Q,0,0,p.height,p.encodedNormal,0,H),Q=KO(r,u,k,K,Q,r.southTiles,r.southMeshes,_n.NORTH,H);let $=Q;Q=YO(u,s,k,K,Q,1,0,y.height,y.encodedNormal,0,H),Q=KO(r,u,k,K,Q,r.eastTiles,r.eastMeshes,_n.WEST,H);let ne=Q;Q=YO(u,s,k,K,Q,1,1,h.height,h.encodedNormal,1,H),Q=KO(r,u,k,K,Q,r.northTiles,r.northMeshes,_n.SOUTH,H),Z=H.minimumHeight,R=H.maximumHeight;let be=Xn.fromRectangle(s,Z,R,n.tilingScheme.ellipsoid),Ce=Wi.geodeticLatitudeToMercatorAngle(s.south),me=1/(Wi.geodeticLatitudeToMercatorAngle(s.north)-Ce),_e=(Wi.geodeticLatitudeToMercatorAngle(W.latitude)-Ce)*me,Ve=u.geodeticSurfaceNormalCartographic(AT,l4),Ie=Fn.octEncode(Ve,s4),Ze=Q;k.encode(K,Q*U,be.center,D.fromElements(.5,.5,jd),E,Ie,_e,Ve),++Q;let De=Q,Ke=De<256?1:2,rt=(De-1)*3,Xt=rt*Ke,Ht=(K.length-De*U)*Float32Array.BYTES_PER_ELEMENT,qe;if(Ht>=Xt){let ge=De*U*Float32Array.BYTES_PER_ELEMENT;qe=De<256?new Uint8Array(K.buffer,ge,rt):new Uint16Array(K.buffer,ge,rt)}else qe=De<256?new Uint8Array(rt):new Uint16Array(rt);K=new Float32Array(K.buffer,0,De*U);let mn=0;for(I=0;I<De-2;++I)qe[mn++]=Ze,qe[mn++]=I,qe[mn++]=I+1;qe[mn++]=Ze,qe[mn++]=I,qe[mn++]=0;let Dt=[];for(I=j;I>=ie;--I)Dt.push(I);let Lt=[];for(I=$;I>=j;--I)Lt.push(I);let Vi=[];for(I=ne;I>=$;--I)Vi.push(I);let ln=[];for(ln.push(0),I=Ze-1;I>=ne;--I)ln.push(I);r.mesh=new dm(k.center,K,qe,rt,De,Z,R,ue.fromOrientedBoundingBox(be),mct(e,be.center,s,Z,R),k.stride,be,k,Dt,Lt,Vi,ln)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=um._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let G=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let X=o._findAncestorTileWithTerrainData(n);c(X)&&c(X.data.waterMaskTexture)&&(r.waterMaskTexture=X.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,X,r.waterMaskTranslationAndScale))}c(G)&&(--G.referenceCount,G.referenceCount===0&&G.destroy())}function YO(e,t,n,i,o,r,s,a,l,d,u){let f=AT;f.longitude=w.lerp(t.west,t.east,r),f.latitude=w.lerp(t.south,t.north,s),f.height=a;let p=e.cartographicToCartesian(f,oL),y;n.hasGeodeticSurfaceNormals&&(y=e.geodeticSurfaceNormal(p,l4));let h=a4;return h.x=r,h.y=s,n.encode(i,o*n.stride,p,h,a,l,d,y),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var JO=new de;function uF(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=de.clone(e.rectangle,JO),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=de.clone(e.rectangle,JO),o.west+=w.TWO_PI,o.east+=w.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,l=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,f=(r.north-o.south)/d,p=(n.x-a)/(l-a),y=(n.y-u)/(f-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(y)<Math.EPSILON5?y=0:Math.abs(y-1)<Math.EPSILON5&&(y=1),i.x=p,i.y=y,i}var sct=new D;function c4(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 act=new D,cct=new m;function lct(e,t,n,i,o,r,s,a,l,d){let u=i.encoding,f=i.vertices,p=uF(t,n,u.decodeTextureCoordinates(f,o,jd),jd),y=uF(t,n,u.decodeTextureCoordinates(f,r,a4),a4),h;l?h=(s-p.x)/(y.x-p.x):h=(a-p.y)/(y.y-p.y);let g=u.decodeHeight(f,o),x=u.decodeHeight(f,r),S=n.rectangle;AT.longitude=w.lerp(S.west,S.east,s),AT.latitude=w.lerp(S.south,S.north,a),d.height=AT.height=w.lerp(g,x,h);let V;if(u.hasVertexNormals){let Z=u.getOctEncodedNormal(f,o,sct),R=u.getOctEncodedNormal(f,r,act),E=Fn.octDecode(Z.x,Z.y,oL),I=Fn.octDecode(R.x,R.y,cct);V=m.lerp(E,I,h,oL),m.normalize(V,V),Fn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(AT,oL),Fn.octEncode(V,d.encodedNormal)}function $ye(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(AT,oL);Fn.octEncode(s,r.encodedNormal)}function HO(e,t,n,i,o,r,s,a,l,d,u){if(jye(e,t,a,s,!1,n,i,u)||jye(e,t,d,l,!0,n,i,u))return u;let p;if(d4(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],c4(r,p,n,i,u),u;let y;if(n===0?i===0?y=zO(e.westMeshes,e.westTiles,_n.EAST,e.southMeshes,e.southTiles,_n.NORTH,n,i):y=zO(e.northMeshes,e.northTiles,_n.SOUTH,e.westMeshes,e.westTiles,_n.EAST,n,i):i===0?y=zO(e.southMeshes,e.southTiles,_n.NORTH,e.eastMeshes,e.eastTiles,_n.WEST,n,i):y=zO(e.eastMeshes,e.eastTiles,_n.WEST,e.northMeshes,e.northTiles,_n.SOUTH,n,i),c(y))return $ye(e,t,n,i,y,u),u}function zO(e,t,n,i,o,r,s,a){let l=Qye(e,t,!1,n,s,a),d=Qye(i,o,!0,r,s,a);return c(l)&&c(d)?(l+d)*.5:c(l)?l:d}function KO(e,t,n,i,o,r,s,a,l){for(let d=0;d<r.length;++d)o=dct(e,t,n,i,o,r[d],s[d],a,l);return o}function dct(e,t,n,i,o,r,s,a,l){let d=r.rectangle;a===_n.EAST&&e.tile.x===0?(d=de.clone(r.rectangle,JO),d.west-=w.TWO_PI,d.east-=w.TWO_PI):a===_n.WEST&&r.x===0&&(d=de.clone(r.rectangle,JO),d.west+=w.TWO_PI,d.east+=w.TWO_PI);let u=e.tile.rectangle,f,p;o>0&&(n.decodeTextureCoordinates(i,o-1,jd),f=jd.x,p=jd.y);let y,h;switch(a){case _n.WEST:y=s.westIndicesSouthToNorth,h=!1;break;case _n.NORTH:y=s.northIndicesWestToEast,h=!0;break;case _n.EAST:y=s.eastIndicesNorthToSouth,h=!1;break;case _n.SOUTH:y=s.southIndicesEastToWest,h=!0;break}let g=r,x=e.tile,S=s.encoding,V=s.vertices,Z=n.stride,R,E;S.hasWebMercatorT&&(R=Wi.geodeticLatitudeToMercatorAngle(u.south),E=1/(Wi.geodeticLatitudeToMercatorAngle(u.north)-R));for(let I=0;I<y.length;++I){let v=y[I],P=S.decodeTextureCoordinates(V,v,jd);uF(g,x,P,P);let F=P.x,N=P.y,b=h?F:N;if(b<0||b>1||Math.abs(F-f)<w.EPSILON5&&Math.abs(N-p)<w.EPSILON5)continue;let G=Math.abs(F)<w.EPSILON5||Math.abs(F-1)<w.EPSILON5,X=Math.abs(N)<w.EPSILON5||Math.abs(N-1)<w.EPSILON5;if(G&&X)continue;let W=S.decodePosition(V,v,oL),A=S.decodeHeight(V,v),k;S.hasVertexNormals?k=S.getOctEncodedNormal(V,v,s4):(k=s4,k.x=0,k.y=0);let B=N;if(S.hasWebMercatorT){let H=w.lerp(u.south,u.north,N);B=(Wi.geodeticLatitudeToMercatorAngle(H)-R)*E}let O;n.hasGeodeticSurfaceNormals&&(O=t.geodeticSurfaceNormal(W,l4)),n.encode(i,o*Z,W,P,A,k,B,O),l.minimumHeight=Math.min(l.minimumHeight,A),l.maximumHeight=Math.max(l.maximumHeight,A),++o}return o}function Qye(e,t,n,i,o,r){let s,a,l;n?(s=0,a=e.length,l=1):(s=e.length-1,a=-1,l=-1);for(let d=s;d!==a;d+=l){let u=e[d],f=t[d];if(!d4(f,u))continue;let p;switch(i){case _n.WEST:p=u.westIndicesSouthToNorth;break;case _n.SOUTH:p=u.southIndicesEastToWest;break;case _n.EAST:p=u.eastIndicesNorthToSouth;break;case _n.NORTH:p=u.northIndicesWestToEast;break}let y=p[n?0:p.length-1];if(c(y))return u.encoding.decodeHeight(u.vertices,y)}}function d4(e,t){return c(t)&&(!c(e.data.fill)||!e.data.fill.changedThisFrame)}function jye(e,t,n,i,o,r,s,a){let l,d,u,f,p,y=i[o?0:n.length-1],h=n[o?0:n.length-1];if(d4(y,h)&&(r===0?s===0?(l=o?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,d=o,u=o):(l=o?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,d=!o,u=!1):s===0?(l=o?h.westIndicesSouthToNorth:h.northIndicesWestToEast,d=!o,u=!0):(l=o?h.southIndicesEastToWest:h.westIndicesSouthToNorth,d=o,u=!o),l.length>0)){f=o?0:l.length-1,p=l[f],h.encoding.decodeTextureCoordinates(h.vertices,p,jd);let g=uF(y,e.tile,jd,jd);if(g.x===r&&g.y===s)return c4(h,p,r,s,a),!0;if(f=Wo(l,d?r:s,function(x,S){h.encoding.decodeTextureCoordinates(h.vertices,x,jd);let V=uF(y,e.tile,jd,jd);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),f<0){if(f=~f,f>0&&f<l.length)return lct(t,y,e.tile,h,l[f-1],l[f],r,s,d,a),!0}else return c4(h,l[f],r,s,a),!0}return!1}var uct=[new m,new m,new m,new m];function mct(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=uct;return m.fromRadians(n.west,n.south,o,a,l[0]),m.fromRadians(n.east,n.south,o,a,l[1]),m.fromRadians(n.west,n.north,o,a,l[2]),m.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}var sL=rL;function ar(e){if(!c(e))throw new L("options is required.");if(c(e.terrainProvider))if(c(e.imageryLayers)){if(!c(e.surfaceShaderSet))throw new L("options.surfaceShaderSet is required.")}else throw new L("options.imageryLayers is required.");else throw new L("options.terrainProvider is required.");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=Sn.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 ye,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(ar.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(ar.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(ar.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(ar.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ye,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 Y(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=de.clone(de.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(ar.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!c(e))throw new L("value is required.");this._baseColor=e,this._firstPassInitialColor=ce.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!c(e))throw new L("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if(c(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,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){qm.setOwner(e,this,"_clippingPolygons")}}});function fct(e,t){let n=e.loadingImagery;c(n)||(n=e.readyImagery);let i=t.loadingImagery;return c(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}ar.prototype.update=function(e){this._imageryLayers._update()};function hct(e,t){let n=t.creditDisplay,i=e._terrainProvider;c(i)&&c(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&&c(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}ar.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(fct)})),hct(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)um._freeVertexArray(t[i]);t.length=0};ar.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];c(s)&&(s.length=0)}let n=this._clippingPlanes;c(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;c(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};ar.prototype.endUpdate=function(e){if(!c(this._renderState)){this._renderState=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:lc.LESS}}),this._blendRenderState=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=He(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Oe.fromCache(s),s=He(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Oe.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&sL.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 l=r[s];if(c(l))for(let d=0,u=l.length;d<u;++d){let f=l[d],p=f.data.tileBoundingRegion;Mct(this,f,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function oge(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)}ar.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)oge(t[n],e)};ar.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};ar.prototype.getLevelMaximumGeometricError=function(e){return c(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};ar.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;c(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Jn.CULLED_BUT_NEEDED,o=n.terrainState),um.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)!==yr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,um.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var pct=new ue,rge=new de,bct=new de,yct=new pe;function qO(e,t){if(t.west<t.east)return t;let n=de.clone(t,bct);return de.center(e,yct).longitude>0?n.east=w.PI:n.west=-w.PI,n}function sge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(c(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(c(i)&&i.enabled||!de.equals(e.cartographicLimitRectangle,de.MAX_VALUE))}ar.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=sge(this,t);if(t.fog.enabled&&!o&&w.fog(i,t.fog.density)>=1)return yr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return yr.PARTIAL;let a=t.cullingVolume,l=s.boundingVolume;c(l)||(l=s.boundingSphere),r.clippedByBoundaries=!1;let d=qO(e.rectangle,this.cartographicLimitRectangle),u=de.simpleIntersection(d,e.rectangle,rge);if(!c(u))return yr.NONE;if(de.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==se.SCENE3D&&(l=pct,ue.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,l),m.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===se.MORPHING&&c(r.renderedMesh)&&(l=ue.union(s.boundingSphere,l,l))),!c(l))return yr.PARTIAL;let f=this._clippingPlanes;if(c(f)&&f.enabled){let x=f.computeIntersectionWithBoundingVolume(l);if(e.isClipped=x!==zt.INSIDE,x===zt.OUTSIDE)return yr.NONE}let p=this._clippingPolygons;if(c(p)&&p.enabled){let x=p.computeIntersectionWithBoundingVolume(s);e.isClipped=x!==zt.OUTSIDE}let y,h=a.computeVisibility(l);if(h===zt.OUTSIDE?y=yr.NONE:h===zt.INTERSECTING?y=yr.PARTIAL:h===zt.INSIDE&&(y=yr.FULL),y===yr.NONE)return y;let g=t.mode===se.SCENE3D&&t.camera.frustum instanceof sn;if(t.mode===se.SCENE3D&&!g&&c(n)&&!o){let x=r.occludeePointInScaledSpace;return!c(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?y:yr.NONE}return y};ar.prototype.canRefine=function(e){return c(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var gct=[],xct=[];ar.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=gct;i.length=this._imageryLayers.length;let o=!1,r=!1,s;c(n)&&(o=n.terrainState===uo.READY,r=!0,s=n.imagery);let a,l;for(a=0,l=i.length;a<l;++a)i[a]=r;if(c(s))for(a=0,l=s.length;a<l;++a){let f=s[a],p=f.loadingImagery,y=!c(p)||p.state===ci.FAILED||p.state===ci.INVALID,h=(f.loadingImagery||f.readyImagery).imageryLayer._layerIndex;i[h]=y&&i[h]}let d=this.quadtree._lastSelectionFrameNumber,u=xct;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let f=u.pop(),p=f._lastSelectionResultFrame===d?f._lastSelectionResult:Jn.NONE;if(p===Jn.RENDERED){let y=f.data;if(!c(y))continue;if(!o&&f.data.terrainState===uo.READY)return!1;let h=f.data.imagery;for(a=0,l=h.length;a<l;++a){let g=h[a],x=g.loadingImagery,S=!c(x)||x.state===ci.FAILED||x.state===ci.INVALID,V=(g.loadingImagery||g.readyImagery).imageryLayer._layerIndex;if(S&&!i[V])return!1}}else p===Jn.REFINED&&u.push(f.southwestChild,f.southeastChild,f.northwestChild,f.northeastChild)}return!0};var _ct=new m;ar.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,_ct),a=m.magnitude(s);return a<w.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var ege=new M,jO=new M,Tct=new ce,Sct=new ce,Cct=new ce,Vct=new m,tge=new m,Lct=new m,Zct=new m;ar.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,l=i.length;a<l;++a){let d=i[a];c(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];c(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;c(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Rct=[new m,new m,new m,new m];function nge(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Rct;return m.fromRadians(n.west,n.south,o,a,l[0]),m.fromRadians(n.east,n.south,o,a,l[1]),m.fromRadians(n.west,n.north,o,a,l[2]),m.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}ar.prototype.computeDistanceToTile=function(e,t){Gct(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 l=t.camera.positionCartographic.height,d=Math.abs(l-r),u=Math.abs(l-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 Gct(e,t,n){let i=e.data;i===void 0&&(i=e.data=new um);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Xd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,l=!1,d=e,u=i.mesh,f=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,l=!0;else if(f!==void 0&&f._minimumHeight!==void 0&&f._maximumHeight!==void 0)r.minimumHeight=f._minimumHeight,r.maximumHeight=f._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let y=p.data;if(y!==void 0){let h=y.mesh,g=y.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0){r.minimumHeight=h.minimumHeight,r.maximumHeight=h.maximumHeight;break}else if(g!==void 0&&g._minimumHeight!==void 0&&g._maximumHeight!==void 0){r.minimumHeight=g._minimumHeight,r.maximumHeight=g._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,y=n.verticalExaggerationRelativeHeight;if(p!==1&&(l=!1,r.minimumHeight=Lr.getHeight(r.minimumHeight,p,y),r.maximumHeight=Lr.getHeight(r.maximumHeight,p,y)),l)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Xn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ue.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),c(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=nge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let g=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||g)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=nge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=l}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}ar.prototype.isDestroyed=function(){return!1};ar.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(),he(this)};function Ect(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,l=a.length,d;for(d=0;d<l;++d)if(o=a[d],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=c(o)?o.readyImagery??o.loadingImagery:void 0,!c(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}}ar.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(c(s._loadedCallbacks[e._layerIndex]))return;let a,l=s.data.imagery,d=l.length,u=-1,f=0;for(a=0;a<d;++a){let y=l[a];if((y.readyImagery??y.loadingImagery).imageryLayer===e)u===-1&&(u=a),++f;else if(u!==-1)break}if(u===-1)return;let p=u+f;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Ect(f,e,n),s.state=$s.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=$s.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Jn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};ar.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 l=i[s],d=l.loadingImagery;if(c(d)||(d=l.readyImagery),d.imageryLayer===e)o===-1&&(o=s),l.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};ar.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};ar.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Xct=new M,Ict=new M;function ige(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=M.multiplyByPoint(i,this.properties.rtc,tge);return M.setTranslation(i,o,ege),ege},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,tge);return M.setTranslation(i,r,jO),M.multiply(o,jO,jO),jO},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 c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=c(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,Xct):M.IDENTITY;return M.inverseTranspose(o,Ict)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return c(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return c(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 ce(0,0,.5,1),fillHighlightColor:new Y(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 M,tileRectangle:new ce,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 ce,minMaxHeight:new D,scaleAndBias:new M,clippingPlanesEdgeColor:Y.clone(Y.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ce,frontFaceAlphaByDistance:new ce,backFaceAlphaByDistance:new ce,localizedTranslucencyRectangle:new ce,undergroundColor:Y.clone(Y.TRANSPARENT),undergroundColorAlphaByDistance:new ce,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return c(t.materialUniformMap)?St(n,t.materialUniformMap):n}function Wct(e,t,n){let i=n.data,o,r;if(c(i.vertexArray)?(o=i.mesh,r=i.vertexArray):c(i.fill)&&c(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!c(o)||!c(r))){if(c(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=wct(e,r,o),i.wireframeVertexArray.mesh=o}}function wct(e,t,n){let o={indices:n.indices,primitiveType:ve.TRIANGLES};An.toWireframe(o);let r=o.indices,s=_t.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Me.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var age,cge,$O;(function(){let e=new Rt({geometry:Fm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Rt({geometry:new Ib({radius:1})}),n=new M,i,o;function r(s){return new In({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}age=function(s,a){return s===i||($O(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(a),o=r(e)),o},cge=function(s,a){return s===i||($O(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(a),o=r(t)),o},$O=function(){c(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Pct=new ce(0,0,0,0),vct={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},Fct=Y.TRANSPARENT,Act=new Nt;function Mct(e,t,n){let i=t.data;c(i.vertexArray)||(i.fill===void 0&&(i.fill=new sL(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(c(r)&&c(r.credits)){let ge=r.credits;for(let Le=0,yn=ge.length;Le<yn;++Le)o.addCreditToNextFrame(ge[Le])}let s=mt.maximumTextureImageUnits,a=i.waterMaskTexture,l=i.waterMaskTranslationAndScale;!c(a)&&c(i.fill)&&(a=i.fill.waterMaskTexture,l=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,f=u.translucent,p=u.frontFaceAlphaByDistance,y=u.backFaceAlphaByDistance,h=u.rectangle,g=e.undergroundColor??Fct,x=e.undergroundColorAlphaByDistance??Act,S=sge(e,n)&&n.mode===se.SCENE3D&&g.alpha>0&&(x.nearValue>0||x.farValue>0),V=e.lambertDiffuseMultiplier,Z=e.vertexShadowDarkness,R=e.hasWaterMask&&c(a),E=R&&e.showWaterEffect,I=e.oceanNormalMap,v=E&&c(I),P=e.terrainProvider,F=c(P)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===se.SCENE3D,G=Sn.castShadows(e.shadows)&&!f,X=Sn.receiveShadows(e.shadows)&&!f,W=e.hueShift,A=e.saturationShift,k=e.brightnessShift,B=!(w.equalsEpsilon(W,0,w.EPSILON7)&&w.equalsEpsilon(A,0,w.EPSILON7)&&w.equalsEpsilon(k,0,w.EPSILON7)),O=!1;if(b){let ge=m.magnitude(n.camera.positionWC),Le=e.nightFadeOutDistance;O=ge>Le}R&&--s,v&&--s,c(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,c(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,c(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let H=i.renderedMesh,U=H.center,K=H.encoding,Q=i.tileBoundingRegion,ie=n.verticalExaggeration,j=n.verticalExaggerationRelativeHeight,$=ie!==1,ne=K.hasGeodeticSurfaceNormals,be=Tct,Ce=0,me=0,_e=0,Ve=0,Ie=!1;if(n.mode!==se.SCENE3D){let ge=n.mapProjection,Le=ge.project(de.southwest(t.rectangle),Lct),yn=ge.project(de.northeast(t.rectangle),Zct);if(be.x=Le.x,be.y=Le.y,be.z=yn.x,be.w=yn.y,n.mode!==se.MORPHING&&(U=Vct,U.x=0,U.y=(be.z+be.x)*.5,U.z=(be.w+be.y)*.5,be.x-=U.y,be.y-=U.z,be.z-=U.y,be.w-=U.z),n.mode===se.SCENE2D&&K.quantization===qs.BITS12){let bt=1/(Math.pow(2,12)-1)*.5,ro=(be.z-be.x)*bt,Xo=(be.w-be.y)*bt;be.x-=ro,be.y-=Xo,be.z+=ro,be.w+=Xo}ge instanceof Wi&&(Ce=t.rectangle.south,me=t.rectangle.north,_e=Wi.geodeticLatitudeToMercatorAngle(Ce),Ve=1/(Wi.geodeticLatitudeToMercatorAngle(me)-_e),Ie=!0)}let Ze=vct;Ze.frameState=n,Ze.surfaceTile=i,Ze.hasWaterMask=R,Ze.showReflectiveOcean=E,Ze.showOceanWaves=v,Ze.enableLighting=e.enableLighting,Ze.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ze.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ze.showGroundAtmosphere=b,Ze.atmosphereLightIntensity=e.atmosphereLightIntensity,Ze.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ze.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ze.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ze.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ze.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ze.perFragmentGroundAtmosphere=O,Ze.hasVertexNormals=F,Ze.useWebMercatorProjection=Ie,Ze.clippedByBoundaries=i.clippedByBoundaries,Ze.hasGeodeticSurfaceNormals=ne,Ze.hasExaggeration=$;let De=i.imagery,Ke=0,rt=De.length,Xt=e.showSkirts&&!d&&!f,Ht=e.backFaceCulling&&!d&&!f,qe=Ht?e._renderState:e._disableCullingRenderState,mn=Ht?e._blendRenderState:e._disableCullingBlendRenderState,Dt=qe,Lt=e._firstPassInitialColor,Vi=n.context;if(c(e._debug.boundingSphereTile)||$O(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ge=e._drawCommands.length;for(let Le=0;Le<ge;++Le)e._uniformMaps[Le]=ige(n,e)}do{let ge=0,Le,yn;if(e._drawCommands.length<=e._usedDrawCommands?(Le=new et,Le.owner=t,Le.cull=!1,Le.boundingVolume=new ue,Le.orientedBoundingBox=void 0,yn=ige(n,e),e._drawCommands.push(Le),e._uniformMaps.push(yn)):(Le=e._drawCommands[e._usedDrawCommands],yn=e._uniformMaps[e._usedDrawCommands]),Le.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let aa=Q.boundingVolume,_l=Q.boundingSphere;c(aa)?age(aa,Y.RED).update(n):c(_l)&&cge(_l,Y.RED).update(n)}let bt=yn.properties;ce.clone(Lt,bt.initialColor),bt.oceanNormalMap=I,bt.lightingFadeDistance.x=e.lightingFadeOutDistance,bt.lightingFadeDistance.y=e.lightingFadeInDistance,bt.nightFadeDistance.x=e.nightFadeOutDistance,bt.nightFadeDistance.y=e.nightFadeInDistance,bt.atmosphereLightIntensity=e.atmosphereLightIntensity,bt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,bt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,bt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,bt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,bt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,bt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ro=d?y:p,Xo=d?p:y;c(ro)&&(ce.fromElements(ro.near,ro.nearValue,ro.far,ro.farValue,bt.frontFaceAlphaByDistance),ce.fromElements(Xo.near,Xo.nearValue,Xo.far,Xo.farValue,bt.backFaceAlphaByDistance)),ce.fromElements(x.near,x.nearValue,x.far,x.farValue,bt.undergroundColorAlphaByDistance),Y.clone(g,bt.undergroundColor),bt.lambertDiffuseMultiplier=V,bt.vertexShadowDarkness=Z;let ra=!c(i.vertexArray)&&c(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ra&&Y.clone(e.fillHighlightColor,bt.fillHighlightColor),bt.verticalExaggerationAndRelativeHeight.x=ie,bt.verticalExaggerationAndRelativeHeight.y=j,bt.center3D=H.center,m.clone(U,bt.rtc),ce.clone(be,bt.tileRectangle),bt.southAndNorthLatitude.x=Ce,bt.southAndNorthLatitude.y=me,bt.southMercatorYAndOneOverHeight.x=_e,bt.southMercatorYAndOneOverHeight.y=Ve;let Wr=Sct,_s=qO(t.rectangle,e.cartographicLimitRectangle),Ae=Cct,st=qO(t.rectangle,h);m.fromElements(W,A,k,bt.hsbShift);let Qe=t.rectangle,$e=1/Qe.width,yt=1/Qe.height;Wr.x=(_s.west-Qe.west)*$e,Wr.y=(_s.south-Qe.south)*yt,Wr.z=(_s.east-Qe.west)*$e,Wr.w=(_s.north-Qe.south)*yt,ce.clone(Wr,bt.localizedCartographicLimitRectangle),Ae.x=(st.west-Qe.west)*$e,Ae.y=(st.south-Qe.south)*yt,Ae.z=(st.east-Qe.west)*$e,Ae.w=(st.north-Qe.south)*yt,ce.clone(Ae,bt.localizedTranslucencyRectangle);let Bt=N&&w.fog(t._distance,n.fog.density)>w.EPSILON3;B=B&&(Bt||b);let Ln=!1,Io=!1,To=!1,Ka=!1,Ja=!1,Li=!1,bi=!1,sa=!1,Qr=!1,xl=!1;for(;ge<s&&Ke<rt;){let aa=De[Ke],_l=aa.readyImagery;if(++Ke,!c(_l)||_l.imageryLayer.alpha===0)continue;let ja=aa.useWebMercatorT?_l.textureWebMercator:_l.texture;if(!c(ja))throw new L("readyImagery is not actually ready!");let ds=_l.imageryLayer;c(aa.textureTranslationAndScale)||(aa.textureTranslationAndScale=ds._calculateTextureTranslationAndScale(t,aa)),bt.dayTextures[ge]=ja,bt.dayTextureTranslationAndScale[ge]=aa.textureTranslationAndScale,bt.dayTextureTexCoordsRectangle[ge]=aa.textureCoordinateRectangle,bt.dayTextureUseWebMercatorT[ge]=aa.useWebMercatorT,bt.dayTextureAlpha[ge]=ds.alpha,Li=Li||bt.dayTextureAlpha[ge]!==1,bt.dayTextureNightAlpha[ge]=ds.nightAlpha,bi=bi||bt.dayTextureNightAlpha[ge]!==1,bt.dayTextureDayAlpha[ge]=ds.dayAlpha,bi=bi||bt.dayTextureDayAlpha[ge]!==1,bt.dayTextureBrightness[ge]=ds.brightness,Ln=Ln||bt.dayTextureBrightness[ge]!==Ya.DEFAULT_BRIGHTNESS,bt.dayTextureContrast[ge]=ds.contrast,Io=Io||bt.dayTextureContrast[ge]!==Ya.DEFAULT_CONTRAST,bt.dayTextureHue[ge]=ds.hue,To=To||bt.dayTextureHue[ge]!==Ya.DEFAULT_HUE,bt.dayTextureSaturation[ge]=ds.saturation,Ka=Ka||bt.dayTextureSaturation[ge]!==Ya.DEFAULT_SATURATION,bt.dayTextureOneOverGamma[ge]=1/ds.gamma,Ja=Ja||bt.dayTextureOneOverGamma[ge]!==1/Ya.DEFAULT_GAMMA,bt.dayTextureSplit[ge]=ds.splitDirection,sa=sa||bt.dayTextureSplit[ge]!==0;let uu=bt.dayTextureCutoutRectangles[ge];if(c(uu)||(uu=bt.dayTextureCutoutRectangles[ge]=new ce),ce.clone(ce.ZERO,uu),c(ds.cutoutRectangle)){let Ao=qO(Qe,ds.cutoutRectangle),dn=de.simpleIntersection(Ao,Qe,rge);Qr=c(dn)||Qr,uu.x=(Ao.west-Qe.west)*$e,uu.y=(Ao.south-Qe.south)*yt,uu.z=(Ao.east-Qe.west)*$e,uu.w=(Ao.north-Qe.south)*yt}let mu=bt.colorsToAlpha[ge];c(mu)||(mu=bt.colorsToAlpha[ge]=new ce);let fu=c(ds.colorToAlpha)&&ds.colorToAlphaThreshold>0;if(xl=xl||fu,fu){let Ao=ds.colorToAlpha;mu.x=Ao.red,mu.y=Ao.green,mu.z=Ao.blue,mu.w=ds.colorToAlphaThreshold}else mu.w=-1;if(c(_l.credits)){let Ao=_l.credits;for(let dn=0,Re=Ao.length;dn<Re;++dn)o.addCreditToNextFrame(Ao[dn])}++ge}bt.dayTextures.length=ge,bt.waterMask=a,ce.clone(l,bt.waterMaskTranslationAndScale),bt.minMaxHeight.x=K.minimumHeight,bt.minMaxHeight.y=K.maximumHeight,M.clone(K.matrix,bt.scaleAndBias);let yo=e._clippingPlanes,wr=c(yo)&&yo.enabled&&t.isClipped;wr&&(bt.clippingPlanesEdgeColor=Y.clone(yo.edgeColor,bt.clippingPlanesEdgeColor),bt.clippingPlanesEdgeWidth=yo.edgeWidth);let gp=e._clippingPolygons,jr=c(gp)&&gp.enabled&&t.isClipped;Ze.numberOfDayTextures=ge,Ze.applyBrightness=Ln,Ze.applyContrast=Io,Ze.applyHue=To,Ze.applySaturation=Ka,Ze.applyGamma=Ja,Ze.applyAlpha=Li,Ze.applyDayNightAlpha=bi,Ze.applySplit=sa,Ze.enableFog=Bt,Ze.enableClippingPlanes=wr,Ze.clippingPlanes=yo,Ze.enableClippingPolygons=jr,Ze.clippingPolygons=gp,Ze.hasImageryLayerCutout=Qr,Ze.colorCorrect=B,Ze.highlightFillTile=ra,Ze.colorToAlpha=xl,Ze.showUndergroundColor=S,Ze.translucent=f;let du=i.renderedMesh.indices.length;Xt||(du=i.renderedMesh.indexCountWithoutSkirts),Le.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ze),Le.castShadows=G,Le.receiveShadows=X,Le.renderState=Dt,Le.primitiveType=ve.TRIANGLES,Le.vertexArray=i.vertexArray||i.fill.vertexArray,Le.count=du,Le.uniformMap=yn,Le.pass=Xe.GLOBE,e._debug.wireframe&&(Wct(Vi,e,t),c(i.wireframeVertexArray)&&(Le.vertexArray=i.wireframeVertexArray,Le.primitiveType=ve.LINES,Le.count=du*2));let Qa=Le.boundingVolume,ex=Le.orientedBoundingBox;n.mode!==se.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Q.minimumHeight,Q.maximumHeight,Qa),m.fromElements(Qa.center.z,Qa.center.x,Qa.center.y,Qa.center),n.mode===se.MORPHING&&(Qa=ue.union(Q.boundingSphere,Qa,Qa))):(Le.boundingVolume=ue.clone(Q.boundingSphere,Qa),Le.orientedBoundingBox=Xn.clone(Q.boundingVolume,ex)),Le.dirty=!0,f&&u.updateDerivedCommands(Le,n),oge(Le,n),Dt=mn,Lt=Pct}while(Ke<rt)}var mF=ar;var tFi=_(T(),1);function lge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=de.clone(de.MAX_VALUE)}Object.defineProperties(lge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){C.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){C.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),C.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new L("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=Nt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){C.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),C.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new L("far distance must be greater than near distance.");this._backFaceAlphaByDistance=Nt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){c(e)||(e=de.clone(de.MAX_VALUE)),de.clone(e,this._rectangle)}}});var fF=lge;var dFi=_(T(),1);function Ps(){this._layers=[],this.layerAdded=new ye,this.layerRemoved=new ye,this.layerMoved=new ye,this.layerShownOrHidden=new ye}Object.defineProperties(Ps.prototype,{length:{get:function(){return this._layers.length}}});Ps.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new L("layer is required.");if(n){if(t<0)throw new L("index must be greater than or equal to zero.");if(t>this._layers.length)throw new L("index must be less than or equal to the number of layers.")}n?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()})};Ps.prototype.addImageryProvider=function(e,t){if(!c(e))throw new L("imageryProvider is required.");let n=new Ya(e);return this.add(n,t),n};Ps.prototype.remove=function(e,t){t=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};Ps.prototype.removeAll=function(e){e=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=[]};Ps.prototype.contains=function(e){return this.indexOf(e)!==-1};Ps.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ps.prototype.get=function(e){if(!c(e))throw new L("index is required.","index");return this._layers[e]};function eD(e,t){if(!c(t))throw new L("layer is required.");let n=e.indexOf(t);if(n===-1)throw new L("layer is not in this collection.");return n}function dge(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)}Ps.prototype.raise=function(e){let t=eD(this._layers,e);dge(this,t,t+1)};Ps.prototype.lower=function(e){let t=eD(this._layers,e);dge(this,t,t-1)};Ps.prototype.raiseToTop=function(e){let t=eD(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))};Ps.prototype.lowerToBottom=function(e){let t=eD(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 Nct=new de;function uge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!c(r)&&a<o.length;++a){let l=o[a];de.contains(l.rectangle,t)&&(r=l)}if(!c(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let l=s[a],d=l.readyImagery;if(!c(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!c(u.pickFeatures)||!de.contains(d.rectangle,t))continue;let f=Nct,p=1/1024;f.west=w.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.x-p),f.east=w.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.z+p),f.south=w.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.y-p),f.north=w.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.w+p),de.contains(f,t)&&i(d)}}Ps.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(uge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ps.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(uge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let l=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);c(l)&&(o.push(l),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let l=0;l<s.length;++l){let d=s[l],u=r[l];if(c(d)&&d.length>0)for(let f=0;f<d.length;++f){let p=d[f];p.imageryLayer=u,c(p.position)||(p.position=i),a.push(p)}}return a})};Ps.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ps.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ps.prototype.isDestroyed=function(){return!1};Ps.prototype.destroy=function(){return this.removeAll(!0),he(this)};Ps.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&&(c(i._show)&&(c(n)||(n=[]),n.push(i)),i._show=i.show);if(c(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var hF=Ps;var YFi=_(T(),1);var hFi=_(T(),1);function mge(e){this._ellipsoid=new kb(e.ellipsoid,m.ZERO)}Object.defineProperties(mge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var pF=mge;var TFi=_(T(),1);var u4=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}clear(){this.cache.clear()}},kct=1e3;function ea(e){if(!c(e))throw new L("options is required.");if(c(e.x))if(c(e.y)){if(e.x<0||e.y<0)throw new L("options.x and options.y must be greater than or equal to zero.")}else throw new L("options.y is required.");else throw new L("options.x is required.");if(!c(e.level))throw new L("options.level is required and must be greater than or equal to zero.");if(!c(e.tilingScheme))throw new L("options.tilingScheme is required.");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._positionCache=new u4(kct),this.state=$s.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}ea.createLevelZeroTiles=function(e){if(!c(e))throw new L("tilingScheme is required.");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 ea({tilingScheme:e,x:s,y:r,level:0});return i};var Uct=256;function Oct(e,t,n,i){let o=n.width/Uct*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}ea.prototype._getCacheKey=function(e,t){return Oct(e.longitude,e.latitude,this._rectangle,t)};ea.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};ea.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};ea.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};ea.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(c(t)&&c(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],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(c(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let l=a.customData;for(o=0;o<l.length;++o)r=l[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(ea.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 c(this._southwestChild)||(this._southwestChild=new ea({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return c(this._southeastChild)||(this._southeastChild=new ea({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 c(this._northwestChild)||(this._northwestChild=new ea({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return c(this._northeastChild)||(this._northeastChild=new ea({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<$s.DONE}},eligibleForUnloading:{get:function(){let e=!0;return c(this.data)&&(e=this.data.eligibleForUnloading,c(e)||(e=!0)),e}}});ea.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]};ea.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};ea.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};ea.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};ea.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};ea.prototype.freeResources=function(){this.clearPositionCache(),this.state=$s.START,this.renderable=!1,this.upsampledFromParent=!1,c(this.data)&&c(this.data.freeResources)&&this.data.freeResources(),tD(this._southwestChild),this._southwestChild=void 0,tD(this._southeastChild),this._southeastChild=void 0,tD(this._northwestChild),this._northwestChild=void 0,tD(this._northeastChild),this._northeastChild=void 0};function tD(e){c(e)&&e.freeResources()}var bF=ea;var VFi=_(T(),1);function nD(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}nD.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};nD.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&c(this._lastBeforeStartOfFrame)&&this.count>e&&c(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),fge(this,t)),t=i}};function fge(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}nD.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!c(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(c(e.replacementPrevious)||c(e.replacementNext))&&fge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var yF=nD;function fm(e){if(!c(e)||!c(e.tileProvider))throw new L("options.tileProvider is required.");if(c(e.tileProvider.quadtree))throw new L("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");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 yF,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=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new pF({ellipsoid:n}),this._tileLoadProgressEvent=new ye,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(fm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});fm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Dct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,pge(e);let n=e._levelZeroTiles;if(c(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 l=r[a];l.level=0,e._addHeightCallbacks.push(l)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}fm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;c(t);)t.state!==$s.START&&e(t),t=t.replacementNext};fm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};fm.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};fm.prototype.update=function(e){c(this._tileProvider.update)&&this._tileProvider.update(e)};function pge(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}fm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Dct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),pge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};fm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),zct(this,e),ilt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Bct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=ye.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))}fm.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||($ct(this,e),nlt(this,e),Bct(this,e))};fm.prototype.isDestroyed=function(){return!1};fm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var xF,hge=new pe;function Yct(e,t){let n=de.center(e.rectangle,hge),i=n.longitude-xF.longitude,o=n.latitude-xF.latitude;n=de.center(t.rectangle,hge);let r=n.longitude-xF.longitude,s=n.latitude-xF.latitude;return i*i+o*o-(r*r+s*s)}var Hct=new m,gF=[];function zct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!c(e._levelZeroTiles)){let g=r.tilingScheme;if(c(g)){let x=r.tilingScheme;e._levelZeroTiles=bF.createLevelZeroTiles(x);let S=e._levelZeroTiles.length;if(gF.length<S)for(gF=new Array(S),o=0;o<S;++o)gF[o]===void 0&&(gF[o]=new _F)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,l=a.length>1?e._occluders:void 0;xF=t.camera.positionCartographic,a.sort(Yct);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,f=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(f,d,u);d.length=0,u.length=0}let y=t.camera;e._cameraPositionCartographic=y.positionCartographic;let h=M.getTranslation(y.transform,Hct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ha(e,s,r,t,l,!1,gF[o]):(f0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=f}function f0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function _F(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function bge(){this.southwest=new _F,this.southeast=new _F,this.northwest=new _F,this.northeast=new _F}bge.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 f4=new Array(31);for(let e=0;e<f4.length;++e)f4[e]=new bge;function Kct(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=jct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,l=n.southeastChild,d=n.northwestChild,u=n.northeastChild,f=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===f?n._lastSelectionResult:Jn.NONE,y=e.tileProvider;if(s||i){let h=Jn.originalResult(p)===Jn.RENDERED,g=Jn.originalResult(p)===Jn.CULLED||p===Jn.NONE,x=n.state===$s.DONE,S=h||g||x;if(S||c(y.canRenderWithoutLosingDetail)&&(S=y.canRenderWithoutLosingDetail(n)),S){s&&f0(e,e._tileLoadQueueMedium,n,t),iD(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&&f0(e,e._tileLoadQueueHigh,n,t)}if(y.canRefine(n)){if(a.upsampledFromParent&&l.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){iD(e,n),f0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(l),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 g=e._tilesToRender.length,x=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,Z=e._tileToUpdateHeights.length;if(Jct(e,a,l,d,u,t,i,o),g!==e._tilesToRender.length){let R=o.allAreRenderable,E=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,v=!1;if(!R&&!E){let P=e._tilesToRender;for(let N=g;N<P.length;++N){let b=P[N];for(;b!==void 0&&b._lastSelectionResult!==Jn.KICKED&&b!==n;)b._lastSelectionResult=Jn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=g,e._tileToUpdateHeights.length=Z,iD(e,n),n._lastSelectionResult=Jn.RENDERED;let F=p===Jn.RENDERED;!F&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=V,f0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=F,F||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&f0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,iD(e,n),f0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Jct(e,t,n,i,o,r,s,a){let l=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,f=f4[t.level],p=f.southwest,y=f.southeast,h=f.northwest,g=f.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(Ha(e,t,d,r,u,s,p),Ha(e,n,d,r,u,s,y),Ha(e,i,d,r,u,s,h),Ha(e,o,d,r,u,s,g)):(Ha(e,i,d,r,u,s,h),Ha(e,t,d,r,u,s,p),Ha(e,o,d,r,u,s,g),Ha(e,n,d,r,u,s,y)):l.latitude<t.rectangle.north?(Ha(e,n,d,r,u,s,y),Ha(e,t,d,r,u,s,p),Ha(e,o,d,r,u,s,g),Ha(e,i,d,r,u,s,h)):(Ha(e,o,d,r,u,s,g),Ha(e,i,d,r,u,s,h),Ha(e,n,d,r,u,s,y),Ha(e,t,d,r,u,s,p)),f.combine(a)}function Qct(e,t){let n=t.rectangle;return c(e._cameraPositionCartographic)&&de.contains(n,e._cameraPositionCartographic)||c(e._cameraReferenceFrameOriginCartographic)&&de.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ha(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==yr.NONE)return Kct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Qct(e,t)){(!c(t.data)||!c(t.data.vertexArray))&&f0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===a?t._lastSelectionResult:Jn.NONE;l!==Jn.CULLED_BUT_NEEDED&&l!==Jn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Jn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(f0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Jn.CULLED):t._lastSelectionResult=Jn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function jct(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof sn||t.camera.frustum instanceof Oo)return qct(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 qct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;c(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,l=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,l),f=d/u;return t.fog.enabled&&t.mode!==se.SCENE2D&&(f-=w.fog(n._distance,t.fog.density)*t.fog.sse),f/=t.pixelRatio,f}function iD(e,t){e._tilesToRender.push(t)}function $ct(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=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=m4(e,t,s,r,n,!1);a=m4(e,t,s,r,i,a),m4(e,t,s,r,o,a)}function elt(e,t){return e._loadPriority-t._loadPriority}function m4(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(elt);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let l=o[s];e._tileReplacementQueue.markTileRendered(l),n.loadTile(t,l),r=!0}return r}var aL=new bn,oD=new pe,Gg=new m,tlt=[];function nlt(e,t){if(!c(e.tileProvider.tilingScheme))return;let n=tlt;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,l=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let f=i[0];if(!c(f.data)||!c(f.data.mesh)){let g=f._lastSelectionResultFrame===e._lastSelectionFrameNumber?f._lastSelectionResult:Jn.NONE;(g===Jn.RENDERED||g===Jn.CULLED_BUT_NEEDED)&&n.push(f),f.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=f.customData,y=p.length,h=!1;for(u=e._lastTileIndex;u<y;++u){let g=p[u],x=f.data.terrainData,S=c(x)&&x.wasCreatedByUpsampling();if(f.level>g.level&&!S){let V,Z=f.getPositionCacheEntry(g.positionCartographic,e.maximumScreenSpaceError);if(c(Z))V=Z;else{if(c(g.positionOnEllipsoidSurface)||(g.positionOnEllipsoidSurface=m.fromRadians(g.positionCartographic.longitude,g.positionCartographic.latitude,0,d)),a===se.SCENE3D){let R=d.geodeticSurfaceNormal(g.positionOnEllipsoidSurface,aL.direction),E=d.getSurfaceNormalIntersectionWithZAxis(g.positionOnEllipsoidSurface,11500,aL.origin);if(!c(E)){let I=0;c(f.data.tileBoundingRegion)&&(I=f.data.tileBoundingRegion.minimumHeight);let v=Math.min(I,-11500),P=m.multiplyByScalar(R,Math.abs(v)+1,Gg);m.subtract(g.positionOnEllipsoidSurface,P,aL.origin)}}else pe.clone(g.positionCartographic,oD),oD.height=-11500,l.project(oD,Gg),m.fromElements(Gg.z,Gg.x,Gg.y,Gg),m.clone(Gg,aL.origin),m.clone(m.UNIT_X,aL.direction);V=f.data.pick(aL,a,l,!1,Gg),c(V)&&f.setPositionCacheEntry(g.positionCartographic,e.maximumScreenSpaceError,V)}if(c(V)){if(c(g.callback)){let R=d.cartesianToCartographic(V,oD);g.callback(R)}g.level=f.level}}if(Ti()>=s){h=!0;break}}if(h){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function ilt(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 TF=fm;function kf(e){e=e??re.default;let t=new ep({ellipsoid:e}),n=new hF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new qv,this._material=void 0,this._surface=new TF({tileProvider:new mF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ye,this._undergroundColor=Y.clone(Y.BLACK),this._undergroundColorAlphaByDistance=new Nt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new fF,p4(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ge({url:on("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=re.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=Sn.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(kf.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 c(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){c(e)||(e=de.clone(de.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),c(this._material)&&p4(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,p4(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Y.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new L("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=Nt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function p4(e){let t=[],n=c(e._material)&&(c(e._material.shaderSource.match(/slope/))||c(e._material.shaderSource.match("normalEC"))),i=[$m,DV];c(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(Nv),e._surfaceShaderSet.baseVertexShaderSource=new Be({sources:[$m,DV,kv],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Be({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function olt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),o=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var rlt=[],slt={start:0,stop:0};kf.prototype.pickWorldCoordinates=function(e,t,n,i){if(!c(e))throw new L("ray is required");if(!c(t))throw new L("scene is required");n=n??!0;let o=t.mode,r=t.mapProjection,s=rlt;s.length=0;let a=this._surface._tilesToRender,l=a.length,d,u;for(u=0;u<l;++u){d=a[u];let p=d.data;if(!c(p))continue;let y=p.pickBoundingSphere;if(o!==se.SCENE3D)p.pickBoundingSphere=y=ue.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,y),m.fromElements(y.center.z,y.center.x,y.center.y,y.center);else if(c(p.renderedMesh))ue.clone(p.tileBoundingRegion.boundingSphere,y);else continue;let h=qn.raySphere(e,y,slt);c(h)&&s.push(p)}s.sort(olt(e.origin));let f;for(l=s.length,u=0;u<l&&(f=s[u].pick(e,t.mode,t.mapProjection,n,i),!c(f));++u);return f};var alt=new pe;kf.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),c(n)&&t.mode!==se.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,alt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var clt=new m,yge=new m,llt=new pe,dlt=new bn;function h4(e,t){return c(e)&&de.contains(e.rectangle,t)?e:void 0}kf.prototype.getHeight=function(e){if(!c(e))throw new L("cartographic is required");let t=this._surface._levelZeroTiles;if(!c(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!de.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;c(n);)n=h4(n._southwestChild,e)||h4(n._southeastChild,e)||h4(n._northwestChild,e)||n._northeastChild,c(n)&&c(n.data)&&c(n.data.renderedMesh)&&(r=n);if(n=r,!c(n)||!c(n.data)||!c(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,l=m.fromRadians(e.longitude,e.latitude,0,a,clt),d=dlt,u=a.geodeticSurfaceNormal(l,d.direction),f=a.getSurfaceNormalIntersectionWithZAxis(l,11500,d.origin);if(!c(f)){let y;c(n.data.tileBoundingRegion)&&(y=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y??0,-11500),g=m.multiplyByScalar(u,Math.abs(h)+1,yge);m.subtract(l,g,d.origin)}let p=n.data.pick(d,void 0,s,!1,yge);if(c(p))return a.cartesianToCartographic(p,llt).height};kf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};kf.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=c(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,l=a.url;if(c(l)){let d=this;a.fetchImage().then(function(u){l===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new Pt({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===se.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))};kf.prototype.render=function(e){this.show&&(c(this._material)&&this._material.update(e.context),this._surface.render(e))};kf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};kf.prototype.isDestroyed=function(){return!1};kf.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(),he(this)};var SF=kf;var R9i=_(T(),1);var UAi=_(T(),1);var WAi=_(T(),1);var LAi=_(T(),1);function ult(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var CF=ult;var Ige={},mlt=32.184,flt=2451545,gge=-.0529921,xge=-.1059842,_ge=13.0120009,Tge=13.3407154,Sge=.9856003,Cge=26.4057084,Vge=13.064993,Lge=.3287146,Zge=1.7484877,Rge=-.1589763,Gge=.0036096,Ege=.1643573,Xge=12.9590088,b4=new ee;Ige.ComputeMoon=function(e,t){c(e)||(e=ee.now()),b4=ee.addSeconds(e,mlt,b4);let n=ee.totalDays(b4)-flt,i=n/Kn.DAYS_PER_JULIAN_CENTURY,o=(125.045+gge*n)*w.RADIANS_PER_DEGREE,r=(250.089+xge*n)*w.RADIANS_PER_DEGREE,s=(260.008+_ge*n)*w.RADIANS_PER_DEGREE,a=(176.625+Tge*n)*w.RADIANS_PER_DEGREE,l=(357.529+Sge*n)*w.RADIANS_PER_DEGREE,d=(311.589+Cge*n)*w.RADIANS_PER_DEGREE,u=(134.963+Vge*n)*w.RADIANS_PER_DEGREE,f=(276.617+Lge*n)*w.RADIANS_PER_DEGREE,p=(34.226+Zge*n)*w.RADIANS_PER_DEGREE,y=(15.134+Rge*n)*w.RADIANS_PER_DEGREE,h=(119.743+Gge*n)*w.RADIANS_PER_DEGREE,g=(239.961+Ege*n)*w.RADIANS_PER_DEGREE,x=(25.053+Xge*n)*w.RADIANS_PER_DEGREE,S=Math.sin(o),V=Math.sin(r),Z=Math.sin(s),R=Math.sin(a),E=Math.sin(l),I=Math.sin(d),v=Math.sin(u),P=Math.sin(f),F=Math.sin(p),N=Math.sin(y),b=Math.sin(h),G=Math.sin(g),X=Math.sin(x),W=Math.cos(o),A=Math.cos(r),k=Math.cos(s),B=Math.cos(a),O=Math.cos(l),H=Math.cos(d),U=Math.cos(u),K=Math.cos(f),Q=Math.cos(p),ie=Math.cos(y),j=Math.cos(h),$=Math.cos(g),ne=Math.cos(x),be=(269.9949+.0031*i-3.8787*S-.1204*V+.07*Z-.0172*R+.0072*I-.0052*N+.0043*X)*w.RADIANS_PER_DEGREE,Ce=(66.5392+.013*i+1.5419*W+.0239*A-.0278*k+.0068*B-.0029*H+9e-4*U+8e-4*ie-9e-4*ne)*w.RADIANS_PER_DEGREE,me=(38.3213+13.17635815*n-14e-13*n*n+3.561*S+.1208*V-.0642*Z+.0158*R+.0252*E-.0066*I-.0047*v-.0046*P+.0028*F+.0052*N+.004*b+.0019*G-.0044*X)*w.RADIANS_PER_DEGREE,_e=(13.17635815-14e-13*(2*n)+3.561*W*gge+.1208*A*xge-.0642*k*_ge+.0158*B*Tge+.0252*O*Sge-.0066*H*Cge-.0047*U*Vge-.0046*K*Lge+.0028*Q*Zge+.0052*ie*Rge+.004*j*Gge+.0019*$*Ege-.0044*ne*Xge)/86400*w.RADIANS_PER_DEGREE;return c(t)||(t=new CF),t.rightAscension=be,t.declination=Ce,t.rotation=me,t.rotationRate=_e,t};var VF=Ige;function Wge(e){(!c(e)||typeof e!="function")&&(e=VF.ComputeMoon),this._computeFunction=e}var hlt=new m,plt=new m,blt=new m;function ylt(e,t,n){let i=hlt;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=blt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,plt);return c(n)||(n=new te),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 glt=new te,xlt=new Fe;Wge.prototype.evaluate=function(e,t){c(e)||(e=ee.now());let n=this._computeFunction(e),i=ylt(n.rightAscension,n.declination,t),o=w.zeroToTwoPi(n.rotation),r=Fe.fromAxisAngle(m.UNIT_Z,o,xlt),s=te.fromQuaternion(Fe.conjugate(r,r),glt);return te.multiply(s,i,i)};var LF=Wge;var m9i=_(T(),1);var y4={position:0};function rD(e){e=e??z.EMPTY_OBJECT,this.center=m.clone(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 ue,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??zi.fromType(zi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 et({owner:e._owner??this}),this._pickCommand=new et({owner: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 _lt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(c(t))return t;let n=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:We.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:y4,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}rD.prototype.update=function(e){if(!this.show||e.mode!==se.SCENE3D||!c(this.center)||!c(this.radii))return;if(!c(this.material))throw new L("this.material must be defined.");let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!c(this._rs)||i)&&(this._translucent=n,this._rs=Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),c(this._va)||(this._va=_lt(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let g=this._oneOverEllipsoidRadiiSquared;g.x=1/(r.x*r.x),g.y=1/(r.y*r.y),g.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),ue.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 l=e.useLogDepth,d=this._useLogDepth!==l;this._useLogDepth=l;let u=this._colorCommand,f,p;(s||a||i||d)&&(f=new Be({sources:[OV]}),p=new Be({sources:[this.material.shaderSource,UV]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(f.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:y4}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=St(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let y=e.commandList,h=e.passes;if(h.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Xe.TRANSLUCENT:Xe.OPAQUE,y.push(u)),h.pick){let g=this._pickCommand;(!c(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||!c(this._pickSP)||d)&&(f=new Be({sources:[OV]}),p=new Be({sources:[this.material.shaderSource,UV],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(f.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=tn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:y4}),g.vertexArray=this._va,g.renderState=this._rs,g.shaderProgram=this._pickSP,g.uniformMap=St(St(this._uniforms,this._pickUniforms),this.material._uniforms),g.executeInClosestFrustum=n),g.boundingVolume=this._boundingSphere,g.modelMatrix=this._computedModelMatrix,g.pass=n?Xe.TRANSLUCENT:Xe.OPAQUE,y.push(g)}};rD.prototype.isDestroyed=function(){return!1};rD.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(),he(this)};var ZF=rD;function RF(e){e=e??z.EMPTY_OBJECT;let t=e.textureUrl;c(t)||(t=on("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??re.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new ZF({radii:this.ellipsoid.radii,material:zi.fromType(zi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new LF}Object.defineProperties(RF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var sD=new te,Tlt=new te,Slt=new m,aD=[];RF.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;c(wt.computeIcrfToFixedMatrix(n,sD))||wt.computeTemeToPseudoFixedMatrix(n,sD);let i=this._axes.evaluate(n,Tlt);te.transpose(i,i),te.multiply(sD,i,i);let o=Y0.computeMoonPositionInEarthInertialFrame(n,Slt);te.multiplyByVector(sD,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=aD,aD.length=0,t.update(e),e.commandList=r,aD.length===1?aD[0]:void 0};RF.prototype.isDestroyed=function(){return!1};RF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),he(this)};var GF=RF;var c6i=_(T(),1);var I9i=_(T(),1);var g4=[],x4=[];function Clt(e,t,n,i,o,r){let s=o-i+1,a=r-o,l=g4,d=x4,u,f;for(u=0;u<s;++u)l[u]=e[i+u];for(f=0;f<a;++f)d[f]=e[o+f+1];u=0,f=0;for(let p=i;p<=r;++p){let y=l[u],h=d[f];u<s&&(f>=a||t(y,h,n)<=0)?(e[p]=y,++u):f<a&&(e[p]=h,++f)}}function _4(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);_4(e,t,n,i,r),_4(e,t,n,r+1,o),Clt(e,t,n,i,r,o)}function Vlt(e,t,n){if(!c(e))throw new L("array is required.");if(!c(t))throw new L("comparator is required.");let i=e.length,o=Math.ceil(i*.5);g4.length=o,x4.length=o,_4(e,t,n,0,i-1),g4.length=0,x4.length=0}var h0=Vlt;var U9i=_(T(),1);function Gc(e,t){if(!c(e))throw new L("occluderBoundingSphere is required.");if(!c(t))throw new L("camera position is required.");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 cD=new m;Object.defineProperties(Gc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!c(e))throw new L("cameraPosition is required.");e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,cD),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,cD);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,cD),cD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Gc.fromBoundingSphere=function(e,t,n){if(!c(e))throw new L("occluderBoundingSphere is required.");if(!c(t))throw new L("camera position is required.");return c(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Gc(e,t)};var Pge=new m;Gc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,Pge),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 Llt=new m;Gc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,Llt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Pge),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 Zlt=new m;Gc.prototype.computeVisibility=function(e){if(!c(e))throw new L("occludeeBS is required.");let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return yr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Zlt),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?yr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?yr.FULL:yr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?yr.PARTIAL:yr.FULL))}}return yr.NONE};var lD=new m;Gc.computeOccludeePoint=function(e,t,n){if(!c(e))throw new L("occluderBoundingSphere is required.");if(!c(n))throw new L("positions is required.");if(n.length===0)throw new L("positions must contain at least one element");let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length;if(m.equals(o,t))throw new L("occludeePosition must be different than occluderBoundingSphere.center");let a=m.normalize(m.subtract(i,o,lD),lD),l=-m.dot(a,o),d=Gc._anyRotationVector(o,a,l),u=Gc._horizonToPlaneNormalDotProduct(e,a,l,d,n[0]);if(!u)return;let f;for(let y=1;y<s;++y){if(f=Gc._horizonToPlaneNormalDotProduct(e,a,l,d,n[y]),!f)return;f<u&&(u=f)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,lD),lD)};var Rlt=[];Gc.computeOccludeePointFromRectangle=function(e,t){if(!c(e))throw new L("rectangle is required.");t=t??re.default;let n=de.subsample(e,t,0,Rlt),i=ue.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return Gc.computeOccludeePoint(new ue(o,t.minimumRadius),i.center,n)};var Glt=new m;Gc._anyRotationVector=function(e,t,n){let i=m.abs(t,Glt),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 Elt=new m;Gc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,Elt);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 T4=new m,Xlt=new m,dD=new m,wge=new m;Gc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,T4),s=m.clone(e.center,Xlt),a=e.radius,l=m.subtract(s,r,dD),d=m.magnitudeSquared(l),u=a*a;if(d<u)return!1;let f=d-u,p=Math.sqrt(f),h=1/Math.sqrt(d),x=p*h*p;l=m.normalize(l,l);let S=m.add(r,m.multiplyByScalar(l,x,wge),wge),V=Math.sqrt(f-x*x),Z=this._rotationVector(s,t,n,r,i),R=m.fromElements(Z.x*Z.x*l.x+(Z.x*Z.y-Z.z)*l.y+(Z.x*Z.z+Z.y)*l.z,(Z.x*Z.y+Z.z)*l.x+Z.y*Z.y*l.y+(Z.y*Z.z-Z.x)*l.z,(Z.x*Z.z-Z.y)*l.x+(Z.y*Z.z+Z.x)*l.y+Z.z*Z.z*l.z,T4);R=m.normalize(R,R);let E=m.multiplyByScalar(R,V,T4);Z=m.normalize(m.subtract(m.add(S,E,dD),s,dD),dD);let I=m.dot(t,Z);Z=m.normalize(m.subtract(m.subtract(S,E,Z),s,Z),Z);let v=m.dot(t,Z);return I<v?I:v};var EF=Gc;var rMi=_(T(),1);var j9i=_(T(),1);function ip(e){e=e??z.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new fs,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function S4(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new L("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;if(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new L("near must be greater than zero and less than far.");e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective)}}Object.defineProperties(ip.prototype,{projectionMatrix:{get:function(){return S4(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return S4(this),this._infinitePerspective}}});var Ilt=new m,Wlt=new m,wlt=new m,Plt=new m;ip.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new L("position is required.");if(!c(t))throw new L("direction is required.");if(!c(n))throw new L("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,d=this.far,u=m.cross(t,n,Ilt),f=Wlt;m.multiplyByScalar(t,l,f),m.add(e,f,f);let p=wlt;m.multiplyByScalar(t,d,p),m.add(e,p,p);let y=Plt;m.multiplyByScalar(u,a,y),m.add(f,y,y),m.subtract(y,e,y),m.normalize(y,y),m.cross(y,n,y),m.normalize(y,y);let h=i[0];return c(h)||(h=i[0]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),m.multiplyByScalar(u,s,y),m.add(f,y,y),m.subtract(y,e,y),m.cross(n,y,y),m.normalize(y,y),h=i[1],c(h)||(h=i[1]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),m.multiplyByScalar(n,r,y),m.add(f,y,y),m.subtract(y,e,y),m.cross(u,y,y),m.normalize(y,y),h=i[2],c(h)||(h=i[2]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),m.multiplyByScalar(n,o,y),m.add(f,y,y),m.subtract(y,e,y),m.cross(y,u,y),m.normalize(y,y),h=i[3],c(h)||(h=i[3]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),h=i[4],c(h)||(h=i[4]=new ce),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-m.dot(t,f),m.negate(t,y),h=i[5],c(h)||(h=i[5]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,p),this._cullingVolume};ip.prototype.getPixelDimensions=function(e,t,n,i,o){if(S4(this),!c(e)||!c(t))throw new L("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new L("drawingBufferWidth must be greater than zero.");if(t<=0)throw new L("drawingBufferHeight must be greater than zero.");if(!c(n))throw new L("distance is required.");if(!c(i))throw new L("pixelRatio is required");if(i<=0)throw new L("pixelRatio must be greater than zero.");if(!c(o))throw new L("A result object is required.");let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let l=2*i*n*s/e;return o.x=l,o.y=a,o};ip.prototype.clone=function(e){return c(e)||(e=new ip),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};ip.prototype.equals=function(e){return c(e)&&e instanceof ip&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};ip.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof ip&&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 hl=ip;function $l(e){e=e??z.EMPTY_OBJECT,this._offCenterFrustum=new hl,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}$l.packedLength=6;$l.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=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};$l.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new $l),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 Uf(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new L("fov, aspectRatio, near, or far parameters are not set.");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;if(C.typeOf.number.greaterThanOrEquals("fov",e.fov,0),C.typeOf.number.lessThan("fov",e.fov,Math.PI),C.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),C.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new L("near must be less than far.");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($l.prototype,{projectionMatrix:{get:function(){return Uf(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Uf(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Uf(this),this._fovy}},sseDenominator:{get:function(){return Uf(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Uf(this),this._offCenterFrustum}}});$l.prototype.computeCullingVolume=function(e,t,n){return Uf(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};$l.prototype.getPixelDimensions=function(e,t,n,i,o){return Uf(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};$l.prototype.clone=function(e){return c(e)||(e=new $l),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};$l.prototype.equals=function(e){return!c(e)||!(e instanceof $l)?!1:(Uf(this),Uf(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};$l.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof $l)?!1:(Uf(this),Uf(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 Ci=$l;var yMi=_(T(),1);function XF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(XF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function vlt(e,t,n){let i=t.createViewportQuadCommand(Ev,{framebuffer:n,renderState:Oe.fromCache({viewport:new je(0,0,256,256)})});e._drawCommand=i}XF.prototype.update=function(e){if(!c(this._colorTexture)){let t=e.context,n=new Pt({context:t,width:256,height:256,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.NEAREST});this._colorTexture=n;let i=new Fr({context:t,colorTextures:[n],destroyAttachments:!1});vlt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};XF.prototype.isDestroyed=function(){return!1};XF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),he(this)};var IF=XF;var dNi=_(T(),1);var XMi=_(T(),1);var Mge={};function Flt(e,t,n){let i,o,r;if(e instanceof Ci){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 hl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Alt=new m,vge=new m;function Nge(e,t,n,i){if(c(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,l=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 f=(u-r)/l;return w.lerp(-w.PI_OVER_TWO,t,1-f)}}return function(o){return w.lerp(e,t,o)}}function V4(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!c(r)){let a=e.position,l=t,d=e.up,u=e.right,f=e.frustum,p=m.subtract(a,l,Alt),y=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),vge)),h=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),vge));r=Math.min(Flt(f,y,h)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(f){let p=f*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return w.lerp(n,i,a)}}function WF(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 kge=new m;function Mlt(e,t,n,i,o,r,s,a){let l=e.camera,d=m.clone(l.position,kge),u=l.pitch,f=WF(l.heading,i),p=WF(l.roll,r),y=V4(l,n,d.z,n.z,s),h=Nge(u,o,y,a);function g(x){let S=x.time/t;l.setView({orientation:{heading:w.lerp(f,i,S),pitch:h(S),roll:w.lerp(p,r,S)}}),D.lerp(d,n,S,l.position),l.position.z=y(S)}return g}function Nlt(e,t){e.longitude<t.longitude?e.longitude+=w.TWO_PI:t.longitude+=w.TWO_PI}function klt(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 Ult=new pe,Olt=new pe;function Dlt(e,t,n,i,o,r,s,a,l,d){let u=e.camera,p=e.mapProjection.ellipsoid,y=pe.clone(u.positionCartographic,Ult),h=u.pitch,g=WF(u.heading,i),x=WF(u.roll,r),S=p.cartesianToCartographic(n,Olt);y.longitude=w.zeroToTwoPi(y.longitude),S.longitude=w.zeroToTwoPi(S.longitude);let V=!1;if(c(a)){let I=w.zeroToTwoPi(a),v=Math.min(y.longitude,S.longitude),P=Math.max(y.longitude,S.longitude),F=I>=v&&I<=P;if(c(l)){let N=Math.abs(y.longitude-S.longitude),b=w.TWO_PI-N;(F?N:b)<(F?b:N)*l&&!F&&(V=!0)}else F||(V=!0)}V?Nlt(y,S):klt(y,S);let Z=V4(u,n,y.height,S.height,s),R=Nge(h,o,Z,d);function E(){let I=y.longitude,v=S.longitude,P=y.latitude,F=S.latitude;return function(b){let G=b.time/t,X=m.fromRadians(w.lerp(I,v,G),w.lerp(P,F,G),Z(G),p);u.setView({destination:X,orientation:{heading:w.lerp(g,i,G),pitch:R(G),roll:w.lerp(x,r,G)}})}}return E()}function Blt(e,t,n,i,o,r,s){let a=e.camera,l=m.clone(a.position,kge),d=WF(a.heading,i),u=a.frustum.right-a.frustum.left,f=V4(a,n,u,n.z,s);function p(y){let h=y.time/t;a.setView({orientation:{heading:w.lerp(d,i,h)}}),D.lerp(l,n,h,a.position);let g=f(h),x=a.frustum,S=x.top/x.right,V=(g-(x.right-x.left))*.5;x.right+=V,x.left-=V,x.top=S*x.right,x.bottom=-x.top}return p}var Fge=new pe,Ylt=new m;function C4(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Age(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Mge.createTween=function(e,t){t=t??z.EMPTY_OBJECT;let n=t.destination;if(!c(e))throw new L("scene is required.");if(!c(n))throw new L("destination is required.");let i=e.mode;if(i===se.MORPHING)return C4();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,l=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,f=t.easingFunction;o&&i!==se.SCENE3D&&(s.cartesianToCartographic(n,Fge),n=r.project(Fge,Ylt));let p=e.camera,y=t.endTransform;c(y)&&p._setTransform(y);let h=t.duration;c(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let g=t.heading??0,x=t.pitch??-w.PI_OVER_TWO,S=t.roll??0,V=e.screenSpaceCameraController;V.enableInputs=!1;let Z=Age(V,t.complete),R=Age(V,t.cancel),E=p.frustum,I=e.mode===se.SCENE2D;if(I=I&&D.equalsEpsilon(p.position,n,w.EPSILON6),I=I&&w.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,w.EPSILON6),I=I||e.mode!==se.SCENE2D&&m.equalsEpsilon(n,p.position,w.EPSILON10),I=I&&w.equalsEpsilon(w.negativePiToPi(g),w.negativePiToPi(p.heading),w.EPSILON10)&&w.equalsEpsilon(w.negativePiToPi(x),w.negativePiToPi(p.pitch),w.EPSILON10)&&w.equalsEpsilon(w.negativePiToPi(S),w.negativePiToPi(p.roll),w.EPSILON10),I)return C4(Z,R);let v=new Array(4);if(v[se.SCENE2D]=Blt,v[se.SCENE3D]=Dlt,v[se.COLUMBUS_VIEW]=Mlt,h<=0)return C4(function(){v[i](e,1,n,g,x,S,a,l,d,u)({time:1}),typeof Z=="function"&&Z()},R);let P=v[i](e,h,n,g,x,S,a,l,d,u);if(!c(f)){let F=p.positionCartographic.height,N=i===se.SCENE3D?s.cartesianToCartographic(n).height:n.z;F>N&&F>11500?f=Jr.CUBIC_OUT:f=Jr.QUINTIC_IN_OUT}return{duration:h,easingFunction:f,startObject:{time:0},stopObject:{time:h},update:P,complete:Z,cancel:R}};var wF=Mge;var WMi=_(T(),1),Hlt={ROTATE:0,INFINITE_SCROLL:1},ed=Object.freeze(Hlt);function nn(e){if(!c(e))throw new L("scene is required.");this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new m,this._position=new m,this._positionWC=new m,this._positionCartographic=new pe,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 Ci,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 ye,this._moveEnd=new ye,this._changed=new ye,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 M,this._invViewMatrix=new M,Kge(this),this._mode=se.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new pe(Math.PI,w.PI_OVER_TWO)),this._max2Dfrustum=void 0,sxe(this,nn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*nn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}nn.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);nn.TRANSFORM_2D_INVERSE=M.inverseTransformation(nn.TRANSFORM_2D,new M);nn.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-95,-20,-70,90);nn.DEFAULT_VIEW_FACTOR=.5;nn.DEFAULT_OFFSET=new rm(0,-w.PI_OVER_FOUR,0);function Kge(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function zlt(e){if(!c(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=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}nn.prototype.canPreloadFlight=function(){return c(this._currentFlight)&&this._mode!==se.SCENE2D};nn.prototype._updateCameraChanged=function(){let e=this;if(zlt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;c(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;c(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===se.SCENE2D){if(!c(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,y=e._changedPosition,h=e.frustum,g=e._changedFrustum,x=p.x+h.left,S=p.x+h.right,V=y.x+g.left,Z=y.x+g.right,R=p.y+h.bottom,E=p.y+h.top,I=y.y+g.bottom,v=y.y+g.top,P=Math.max(x,V),F=Math.min(S,Z),N=Math.max(R,I),b=Math.min(E,v),G;if(P>=F||N>=E)G=1;else{let X=g;x<V&&S>Z&&R<I&&E>v&&(X=h),G=1-(F-P)*(b-N)/((X.right-X.left)*(X.top-X.bottom))}G>t&&(e._changed.raiseEvent(G),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!c(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let l=w.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;c(e.frustum.fovy)?d=l/(e.frustum.fovy*.5):d=l;let f=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||f>t)&&(e._changed.raiseEvent(Math.max(d,f)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Klt(e){wt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Jlt=new pe,Qlt=new m,uD=new m,jlt=new ce,qlt=new ce,$lt=new ce,edt=new ce,tdt=new ce;function ndt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,jlt),o=n.cartesianToCartographic(i,Jlt),r=t.project(o,Qlt),s=qlt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,tdt),l=ce.add(M.getColumn(e._transform,0,uD),i,uD);n.cartesianToCartographic(l,o),t.project(o,r);let d=$lt;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=edt;if(m.magnitudeSquared(d)>w.EPSILON10)m.cross(a,d,u);else{let f=ce.add(M.getColumn(e._transform,1,uD),i,uD);n.cartesianToCartographic(f,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&&(ce.clone(ce.UNIT_Y,d),ce.clone(ce.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),M.setColumn(e._actualTransform,0,d,e._actualTransform),M.setColumn(e._actualTransform,1,u,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var L4=new m;function Xc(e){let t=e._mode,n=!1,i=0;t===se.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 l=e._up,d=!m.equals(l,e.up);d&&(m.normalize(e.up,e.up),l=m.clone(e.up,e._up));let u=e._right,f=!m.equals(u,e.right);f&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===se.COLUMBUS_VIEW||e._mode===se.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(nn.TRANSFORM_2D,e._actualTransform):e._mode===se.COLUMBUS_VIEW?Klt(e):ndt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let y=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(y,o,e._positionWC),t===se.SCENE3D||t===se.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=L4;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===se.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||d||f){let h=m.dot(s,m.cross(l,u,L4));if(Math.abs(1-h)>w.EPSILON2){let g=1/m.magnitudeSquared(l),x=m.dot(l,s)*g,S=m.multiplyByScalar(s,x,L4);l=m.normalize(m.subtract(l,S,e._up),e._up),m.clone(l,e.up),u=m.cross(s,l,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(y,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=M.multiplyByPointAsVector(y,l,e._upWC),m.normalize(e._upWC,e._upWC)),(f||p)&&(e._rightWC=M.multiplyByPointAsVector(y,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||f||p)&&Kge(e)}function Jge(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 Qge(e){return w.PI_OVER_TWO-w.acosClamped(e.z)}function jge(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 hD=new M,pD=new M;Object.defineProperties(nn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Xc(this),this._invTransform}},viewMatrix:{get:function(){return Xc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Xc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Xc(this),this._positionCartographic}},positionWC:{get:function(){return Xc(this),this._positionWC}},directionWC:{get:function(){return Xc(this),this._directionWC}},upWC:{get:function(){return Xc(this),this._upWC}},rightWC:{get:function(){return Xc(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,hD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,pD);this._setTransform(n);let i=Jge(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,hD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,pD);this._setTransform(n);let i=Qge(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,hD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,pD);this._setTransform(n);let i=jge(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}}});nn.prototype.update=function(e){if(!c(e))throw new L("mode is required.");if(e===se.SCENE2D&&!(this.frustum instanceof Oo))throw new L("An OrthographicOffCenterFrustum is required in 2D.");if((e===se.SCENE3D||e===se.COLUMBUS_VIEW)&&!(this.frustum instanceof Ci)&&!(this.frustum instanceof sn))throw new L("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==se.MORPHING,t=this._mode===se.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone();if(!(n instanceof Oo))throw new L("The camera frustum is expected to be orthographic for 2D camera control.");let 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===se.SCENE2D&&txe(this,this.position)};var idt=new m,odt=new m,rdt=new m;nn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,idt),n=m.clone(this.upWC,odt),i=m.clone(this.directionWC,rdt);M.clone(e,this._transform),this._transformChanged=!0,Xc(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),Xc(this)};var sdt=new D,adt=new bn,cdt=new m,ldt=new m;function qge(e){if(!M.equals(M.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=sdt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(c(n)){let a=e.getPickRay(i,adt);o=n.pickWorldCoordinates(a,t,!0,cdt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,ldt));let s;if(c(o)||c(r)){let a=c(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,l=c(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,l)}else s=Math.max(e.positionCartographic.height,0);return s}nn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof sn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=qge(this)))};var bD=new m,X4=new M,ddt=new M,I4=new Fe,W4=new te,$ge=new pe;function udt(e,t,n){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new L("position has a NaN component");let i=M.clone(e.transform,X4),o=wt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,ddt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-w.PI_OVER_TWO;let r=Fe.fromHeadingPitchRoll(n,I4),s=te.fromQuaternion(r,W4);te.getColumn(s,0,e.direction),te.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function mdt(e,t,n,i){let o=M.clone(e.transform,X4);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,l=a.ellipsoid.cartesianToCartographic(t,$ge);t=a.project(l,bD)}m.clone(t,e.position)}n.heading=n.heading-w.PI_OVER_TWO;let r=Fe.fromHeadingPitchRoll(n,I4),s=te.fromQuaternion(r,W4);te.getColumn(s,0,e.direction),te.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function fdt(e,t,n,i){let o=M.clone(e.transform,X4);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let l=e._projection,d=l.ellipsoid.cartesianToCartographic(t,$ge);t=l.project(d,bD)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let l=a.top/a.right;a.right=s,a.left=r,a.top=a.right*l,a.bottom=-a.top}}if(e._scene.mapMode2D===ed.ROTATE){n.heading=n.heading-w.PI_OVER_TWO,n.pitch=-w.PI_OVER_TWO,n.roll=0;let r=Fe.fromHeadingPitchRoll(n,I4),s=te.fromQuaternion(r,W4);te.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var hdt=new m,pdt=new m,bdt=new m;function exe(e,t,n,i){let o=m.clone(n.direction,hdt),r=m.clone(n.up,pdt);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,l=wt.eastNorthUpToFixedFrame(t,a,hD),d=M.inverseTransformation(l,pD);M.multiplyByPointAsVector(d,o,o),M.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,bdt);return i.heading=Jge(o,r),i.pitch=Qge(o),i.roll=jge(o,r,s),i}var E4={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},cL=new Ea;nn.prototype.setView=function(e){e=e??z.EMPTY_OBJECT;let t=e.orientation??z.EMPTY_OBJECT,n=this._mode;if(n===se.MORPHING)return;c(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??m.clone(this.positionWC,bD);if(c(o)&&c(o.west)){if(o=this.getRectangleCameraCoordinates(o,bD),isNaN(o.x)||isNaN(o.y))throw new L("destination has a NaN component");i=!1}c(t.direction)&&(t=exe(this,o,t,E4.orientation)),cL.heading=t.heading??0,cL.pitch=t.pitch??-w.PI_OVER_TWO,cL.roll=t.roll??0,n===se.SCENE3D?udt(this,o,cL):n===se.SCENE2D?fdt(this,o,cL,i):mdt(this,o,cL,i)};var ydt=new m;nn.prototype.flyHome=function(e){let t=this._mode;if(t===se.MORPHING&&this._scene.completeMorph(),t===se.SCENE2D)this.flyTo({destination:nn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===se.SCENE3D){let n=this.getRectangleCameraCoordinates(nn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*nn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===se.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,ydt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};nn.prototype.worldToCameraCoordinates=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new ce),Xc(this),M.multiplyByVector(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesVector=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};nn.prototype.cameraToWorldCoordinates=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new ce),Xc(this),M.multiplyByVector(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPoint(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function txe(e,t){let n=e._scene.mapMode2D===ed.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 Uge=new m;nn.prototype.move=function(e,t){if(!c(e))throw new L("direction is required.");let n=this.position;m.multiplyByScalar(e,t,Uge),m.add(n,Uge,n),this._mode===se.SCENE2D&&txe(this,n),this._adjustOrthographicFrustum(!0)};nn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?yD(this,e):this.move(this.direction,e)};nn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?yD(this,-e):this.move(this.direction,-e)};nn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};nn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};nn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};nn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};nn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,-e)};nn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,e)};nn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,-e)};nn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,e)};var gdt=new Fe,xdt=new te;nn.prototype.look=function(e,t){if(!c(e))throw new L("axis is required.");let n=t??this.defaultLookAmount,i=Fe.fromAxisAngle(e,-n,gdt),o=te.fromQuaternion(i,xdt),r=this.direction,s=this.up,a=this.right;te.multiplyByVector(o,r,r),te.multiplyByVector(o,s,s),te.multiplyByVector(o,a,a)};nn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};nn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var _dt=new Fe,Tdt=new te;nn.prototype.rotate=function(e,t){if(!c(e))throw new L("axis is required.");let n=t??this.defaultRotateAmount,i=Fe.fromAxisAngle(e,-n,_dt),o=te.fromQuaternion(i,Tdt);te.multiplyByVector(o,this.position,this.position),te.multiplyByVector(o,this.direction,this.direction),te.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)};nn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,nxe(this,e)};nn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,nxe(this,-e)};var Sdt=new m,Cdt=new m,Vdt=new m,Oge=new m;function nxe(e,t){let n=e.position;if(c(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,w.EPSILON2)){let i=m.normalize(n,Sdt),o=m.equalsEpsilon(i,e.constrainedAxis,w.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,Oge),w.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,Cdt),a=m.dot(i,s),l=w.acosClamped(a);t>0&&t>l&&(t=l-w.EPSILON4),a=m.dot(i,m.negate(s,Oge)),l=w.acosClamped(a),t<0&&-t>l&&(t=-l+w.EPSILON4);let d=m.cross(s,i,Vdt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}nn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,ixe(this,-e)};nn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,ixe(this,e)};function ixe(e,t){c(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function yD(e,t){let n=e.frustum;if(!(n instanceof Oo)||!c(n.left)||!c(n.right)||!c(n.bottom)||!c(n.top))throw new L("The camera frustum is expected to be orthographic for 2D camera control.");let 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===ed.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===ed.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 oxe(e,t){e.move(e.direction,t)}nn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?yD(this,e):oxe(this,e)};nn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?yD(this,-e):oxe(this,-e)};nn.prototype.getMagnitude=function(){if(this._mode===se.SCENE3D)return m.magnitude(this.position);if(this._mode===se.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===se.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Ldt=new M;nn.prototype.lookAt=function(e,t){if(!c(e))throw new L("target is required");if(!c(t))throw new L("offset is required");if(this._mode===se.MORPHING)throw new L("lookAt is not supported while morphing.");let i=this._scene.ellipsoid??re.default,o=wt.eastNorthUpToFixedFrame(e,i,Ldt);this.lookAtTransform(o,t)};var Zdt=new m,Rdt=new Fe,Gdt=new Fe,Edt=new te;function rxe(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=Fe.fromAxisAngle(m.UNIT_Y,-t,Rdt),o=Fe.fromAxisAngle(m.UNIT_Z,-e,Gdt),r=Fe.multiply(o,i,o),s=te.fromQuaternion(r,Edt),a=m.clone(m.UNIT_X,Zdt);return te.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}nn.prototype.lookAtTransform=function(e,t){if(!c(e))throw new L("transform is required");if(this._mode===se.MORPHING)throw new L("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!c(t))return;let n;if(c(t.heading)?n=rxe(t.heading,t.pitch,t.range):n=t,this._mode===se.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(M.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 PF=new pe,Xdt=new pe,Idt=new m,Wdt=new m,wdt=new m,Pdt=new m,vdt=new m,Fdt=new m,Adt=new m,Z4=new m,Mdt={direction:new m,right:new m,up:new m},Dge;function Ec(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function sxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Mdt,{north:s,south:a,west:l}=t,{east:d}=t;l>d&&(d+=w.TWO_PI);let u=(l+d)*.5,f;if(a<-w.PI_OVER_TWO+w.RADIANS_PER_DEGREE&&s>w.PI_OVER_TWO-w.RADIANS_PER_DEGREE)f=0;else{let F=PF;F.longitude=u,F.latitude=s,F.height=0;let N=Xdt;N.longitude=u,N.latitude=a,N.height=0;let b=Dge;(!c(b)||b.ellipsoid!==o)&&(Dge=b=new Fp(void 0,void 0,o)),b.setEndPoints(F,N),f=b.interpolateUsingFraction(.5,PF).latitude}let p=PF;p.longitude=u,p.latitude=f,p.height=0;let y=o.cartographicToCartesian(p,Adt),h=PF;h.longitude=d,h.latitude=s;let g=o.cartographicToCartesian(h,Idt);h.longitude=l;let x=o.cartographicToCartesian(h,wdt);h.longitude=u;let S=o.cartographicToCartesian(h,vdt);h.latitude=a;let V=o.cartographicToCartesian(h,Fdt);h.longitude=d;let Z=o.cartographicToCartesian(h,Pdt);h.longitude=l;let R=o.cartographicToCartesian(h,Wdt);m.subtract(x,y,x),m.subtract(Z,y,Z),m.subtract(g,y,g),m.subtract(R,y,R),m.subtract(S,y,S),m.subtract(V,y,V);let E=o.geodeticSurfaceNormal(y,r.direction);m.negate(E,E);let I=m.cross(E,m.UNIT_Z,r.right);m.normalize(I,I);let v=m.cross(I,E,r.up),P;if(e.frustum instanceof sn){let F=Math.max(m.distance(g,x),m.distance(Z,R)),N=Math.max(m.distance(g,Z),m.distance(x,R)),b,G,X=e.frustum._offCenterFrustum,W=X.right/X.top,A=N*W;F>A?(b=F,G=b/W):(G=N,b=A),P=Math.max(b,G)}else{let F=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*F;if(P=Math.max(Ec(E,v,x,F),Ec(E,v,Z,F),Ec(E,v,g,F),Ec(E,v,R,F),Ec(E,v,S,F),Ec(E,v,V,F),Ec(E,I,x,N),Ec(E,I,Z,N),Ec(E,I,g,N),Ec(E,I,R,N),Ec(E,I,S,N),Ec(E,I,V,N)),a<0&&s>0){let b=PF;b.longitude=l,b.latitude=0,b.height=0;let G=o.cartographicToCartesian(b,Z4);m.subtract(G,y,G),P=Math.max(P,Ec(E,v,G,F),Ec(E,I,G,N)),b.longitude=d,G=o.cartographicToCartesian(b,Z4),m.subtract(G,y,G),P=Math.max(P,Ec(E,v,G,F),Ec(E,I,G,N))}}return m.add(y,m.multiplyByScalar(E,-P,Z4),n)}var Ndt=new pe,kdt=new m,Udt=new m;function Odt(e,t,n){let i=e._projection;t.west>t.east&&(t=de.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Ndt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,kdt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let l=i.project(s,Udt);if(M.multiplyByPoint(o,l,l),M.multiplyByPoint(r,l,l),n.x=(a.x-l.x)*.5+l.x,n.y=(a.y-l.y)*.5+l.y,c(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-l.x)/u,(a.y-l.y)/d)*.5}else{let d=a.x-l.x,u=a.y-l.y;n.z=Math.max(d,u)}return n}var Ddt=new pe,Bdt=new m,Ydt=new m;function Hdt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===ed.INFINITE_SCROLL?o+=w.TWO_PI:(t=de.MAX_VALUE,o=t.east));let r=Ddt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Bdt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Ydt),l=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,f,p=e.frustum.right/e.frustum.top,y=d*p;return l>y?(u=l,f=u/p):(f=d,u=y),d=Math.max(2*u,2*f),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}nn.prototype.getRectangleCameraCoordinates=function(e,t){if(!c(e))throw new L("rectangle is required");let n=this._mode;if(c(t)||(t=new m),n===se.SCENE3D)return sxe(this,e,t);if(n===se.COLUMBUS_VIEW)return Odt(this,e,t);if(n===se.SCENE2D)return Hdt(this,e,t)};var zdt=new bn;function Kdt(e,t,n,i){n=n??re.default;let o=e.getPickRay(t,zdt),r=qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return bn.getPoint(o,s,i)}var Jdt=new bn;function Qdt(e,t,n,i){let r=e.getPickRay(t,Jdt).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 jdt=new bn;function qdt(e,t,n,i){let o=e.getPickRay(t,jdt),r=-o.origin.x/o.direction.x;bn.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)}nn.prototype.pickEllipsoid=function(e,t,n){if(!c(e))throw new L("windowPosition is required.");let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(c(n)||(n=new m),t=t??re.default,this._mode===se.SCENE3D)n=Kdt(this,e,t,n);else if(this._mode===se.SCENE2D)n=Qdt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=qdt(this,e,this._projection,n);else return;return n}};var $dt=new m,eut=new m,tut=new m;function nut(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,l=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,f=e.positionWC;m.clone(f,n.origin);let p=m.multiplyByScalar(e.directionWC,l,$dt);m.add(f,p,p);let y=m.multiplyByScalar(e.rightWC,d*l*a,eut),h=m.multiplyByScalar(e.upWC,u*l*s,tut),g=m.add(p,y,n.direction);return m.add(g,h,g),m.subtract(g,f,g),m.normalize(g,g),n}var mD=new m;function iut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2/o*t.x-1;l*=(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.positionWC,u),m.multiplyByScalar(e.rightWC,l,mD),m.add(mD,u,u),m.multiplyByScalar(e.upWC,d,mD),m.add(mD,u,u),m.clone(e.directionWC,n.direction),n}nn.prototype.getPickRay=function(e,t){if(!c(e))throw new L("windowPosition is required.");c(t)||(t=new bn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return c(i.aspectRatio)&&c(i.fov)&&c(i.near)?nut(this,e,t):iut(this,e,t)};var out=new m,rut=new m;nn.prototype.distanceToBoundingSphere=function(e){if(!c(e))throw new L("boundingSphere is required.");let t=m.subtract(this.positionWC,e.center,out),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),rut);return Math.max(0,m.magnitude(n)-e.radius)};var sut=new D;nn.prototype.getPixelSize=function(e,t,n){if(!c(e))throw new L("boundingSphere is required.");if(!c(t))throw new L("drawingBufferWidth is required.");if(!c(n))throw new L("drawingBufferHeight is required.");let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,sut);return Math.max(o.x,o.y)};function aut(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(l){let d=m.lerp(t,s,l.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Jr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var cut=new m,Bge=new m,lut=new m,dut=new m;function uut(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,cut),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,Bge),Bge);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,lut);let a=Math.tan(e.frustum.fovy*.5),l=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,dut)),u=l*d,f=a*d,p=e._maxCoord.x,y=e._maxCoord.y,h=Math.max(u-p,p),g=Math.max(f-y,y);if(n.z<-h||n.z>h||n.y<-g||n.y>g){let x=s.y<-h||s.y>h,S=s.z<-g||s.z>g;if(x||S)return aut(e,n,s,h,g,t)}}nn.prototype.createCorrectPositionTween=function(e){if(!c(e))throw new L("duration is required.");if(this._mode===se.COLUMBUS_VIEW)return uut(this,e)};var mut=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};nn.prototype.cancelFlight=function(){c(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};nn.prototype.completeFlight=function(){if(c(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),c(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};nn.prototype.flyTo=function(e){e=e??z.EMPTY_OBJECT;let t=e.destination;if(!c(t))throw new L("destination is required.");if(this._mode===se.MORPHING)return;this.cancelFlight();let i=t instanceof de;i&&(t=this.getRectangleCameraCoordinates(t,mut));let o=e.orientation??z.EMPTY_OBJECT;if(c(o.direction)&&(o=exe(this,t,o,E4.orientation)),c(e.duration)&&e.duration<=0){let u=E4;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),c(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,l=wF.createTween(a,ta);if(l.duration===0){typeof l.complete=="function"&&l.complete();return}s=a.tweens.add(l),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==se.SCENE2D&&(c(d)||(d=nn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function fut(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function hut(e,t){let n=e.frustum,i=n.offCenterFrustum;c(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 put=100;function axe(e,t,n){n=rm.clone(c(n)?n:nn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!c(r)||r===0){let s=t.radius;s===0?n.range=put:e.frustum instanceof sn||e._mode===se.SCENE2D?n.range=hut(e,s):n.range=fut(e,s),n.range=w.clamp(n.range,i,o)}return n}nn.prototype.viewBoundingSphere=function(e,t){if(!c(e))throw new L("boundingSphere is required.");if(this._mode===se.MORPHING)throw new L("viewBoundingSphere is not supported while morphing.");t=axe(this,e,t),this.lookAt(e.center,t)};var but=new M,yut=new m,gut=new m,xut=new m,_ut=new m,Tut=new ce,Sut=new Fe,Cut=new te;nn.prototype.flyToBoundingSphere=function(e,t){if(!c(e))throw new L("boundingSphere is required.");t=t??z.EMPTY_OBJECT;let n=this._mode===se.SCENE2D||this._mode===se.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=axe(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,yut):o=rxe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??re.default,a=wt.eastNorthUpToFixedFrame(e.center,s,but);M.multiplyByPoint(a,o,o);let l,d;if(!n){if(l=m.subtract(e.center,o,gut),m.normalize(l,l),d=M.multiplyByPointAsVector(a,m.UNIT_Z,xut),1-Math.abs(m.dot(l,d))<w.EPSILON6){let f=Fe.fromAxisAngle(l,i.heading,Sut),p=te.fromQuaternion(f,Cut);m.fromCartesian4(M.getColumn(a,1,Tut),d),te.multiplyByVector(p,d,d)}let u=m.cross(l,d,_ut);m.cross(u,l,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:l,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 Yge=new m,Hge=new m,R4=new m,zge=new m,vF=[new m,new m,new m,new m];function Vut(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,Yge),r=m.magnitude(o),s=m.normalize(o,Hge),a,l;m.equalsEpsilon(s,m.UNIT_Z,w.EPSILON10)?(a=new m(0,1,0),l=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,R4),R4),l=m.normalize(m.cross(s,a,zge),zge));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,Yge),f=d/r,p=m.multiplyByScalar(a,f,Hge),y=m.multiplyByScalar(l,f,R4),h=m.add(u,y,vF[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let g=m.subtract(u,y,vF[1]);m.subtract(g,p,g),m.multiplyComponents(n,g,g);let x=m.subtract(u,y,vF[2]);m.add(x,p,x),m.multiplyComponents(n,x,x);let S=m.add(u,y,vF[3]);return m.add(S,p,S),m.multiplyComponents(n,S,S),vF}var G4=new D,Lut=new m,Eg=[new pe,new pe,new pe,new pe];function fD(e,t,n,i,o,r){G4.x=e,G4.y=t;let s=i.pickEllipsoid(G4,o,Lut);return c(s)?(Eg[n]=o.cartesianToCartographic(s,Eg[n]),1):(Eg[n]=o.cartesianToCartographic(r[n],Eg[n]),0)}nn.prototype.computeViewRectangle=function(e,t){e=e??re.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===zt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,l=0,d=Vut(this,e);if(l+=fD(0,0,0,this,e,d),l+=fD(0,a,1,this,e,d),l+=fD(s,a,2,this,e,d),l+=fD(s,0,3,this,e,d),l<2)return de.MAX_VALUE;t=de.fromCartographicArray(Eg,t);let u=0,f=Eg[3].longitude;for(let p=0;p<4;++p){let y=Eg[p].longitude,h=Math.abs(y-f);h>w.PI?u+=w.TWO_PI-h:u+=h,f=y}return w.equalsEpsilon(Math.abs(u),w.TWO_PI,w.EPSILON9)&&(t.west=-w.PI,t.east=w.PI,Eg[0].latitude>=0?t.north=w.PI_OVER_TWO:t.south=-w.PI_OVER_TWO),t};nn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof Ci)return;let e=this._scene;this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=w.toRadians(60)};nn.prototype.switchToOrthographicFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof sn)return;let e=qge(this),t=this._scene;this.frustum=new sn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};nn.clone=function(e,t){return c(t)||(t=new nn(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),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var oo=nn;var fNi=_(T(),1);function Zut(e){C.typeOf.object("options",e),C.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var hm=Zut;var TNi=_(T(),1);var mxe=_(cd(),1),cxe=576,Rut=100,FF="#ffffff",gD="#48b";function fxe(e,t){this.credit=e,this.count=t??1}function Gut(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 Eut(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Ct.equals(n,t)||(c(t)&&e._cesiumCreditContainer.removeChild(t.element),c(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var hxe="cesium-credit-delimiter";function lxe(e){let t=document.createElement("span");return t.textContent=e,t.className=hxe,t}function dxe(e,t){if(c(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function uxe(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(c(a)){if(r=s,c(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(lxe(n));else{let u=o[d];u.className!==hxe&&e.replaceChild(lxe(n),u)}}let l=a.element;if(o.length<=r)e.appendChild(dxe(l,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(dxe(l,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Xut(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<cxe?(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>=cxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Iut(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); -} +`;var vno=x(T(),1);var Yeo=x(T(),1),vWe={NONE:0,LERC:1};Object.freeze(vWe);var gh=vWe;var rno=x(T(),1);var hto=x(T(),1);var Qeo=x(T(),1);var Meo=x(T(),1),FWe={NONE:0,BITS12:1};Object.freeze(FWe);var Ka=FWe;var GM=new h,qCt=new h,yh=new k,$Ct=new P,eVt=new P,tVt=Math.pow(2,12);function wc(e,t,n,i,o,r,s,a,c,d){let u=Ka.NONE,m,p;if(l(t)&&l(n)&&l(i)&&l(o)){let b=t.minimum,f=t.maximum,y=h.subtract(f,b,qCt),_=i-n;Math.max(h.maximumComponent(y),_)<tVt-1?u=Ka.BITS12:u=Ka.NONE;let Z=P.fromScale(y,$Ct);Z=P.setTranslation(Z,b,Z);let R=P.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,GM),eVt);R=P.multiplyByTranslation(R,h.negate(b,GM),R),p=P.clone(o,new P);let C=P.getTranslation(o,GM);C=h.subtract(C,e,GM),p=P.setTranslation(p,C,p),p=P.multiply(p,Z,p),m=P.inverseTransformation(o,new P),m=P.multiply(R,m,m),o=P.multiply(o,Z,new P)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=m,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}wc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Ka.BITS12){n=P.multiplyByPoint(this.toScaledENU,n,GM),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,m=W.clamp((o-this.minimumHeight)/u,0,1);k.fromElements(n.x,n.y,yh);let p=dn.compressTextureCoordinates(yh);k.fromElements(n.z,m,yh);let b=dn.compressTextureCoordinates(yh);k.fromElements(c,d,yh);let f=dn.compressTextureCoordinates(yh);if(e[t++]=p,e[t++]=b,e[t++]=f,this.hasWebMercatorT){k.fromElements(s,0,yh);let y=dn.compressTextureCoordinates(yh);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=dn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var nVt=new h,IWe=new h;wc.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 m=s*i+u,p=s*r+u;t[p]=e[m]}let a=this.decodePosition(t,s,nVt),c=n.geodeticSurfaceNormal(a,IWe),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};wc.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]}};wc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ka.BITS12){let i=dn.decompressTextureCoordinates(e[t],yh);n.x=i.x,n.y=i.y;let o=dn.decompressTextureCoordinates(e[t+1],yh);return n.z=o.x,P.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};wc.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,IWe),a=this.decodeHeight(e,t),c=_o.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};wc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new k),t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+2],n):k.fromElements(e[t+4],e[t+5],n)};wc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+1],yh).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};wc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+3],yh).x:e[t+6]};wc.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 k.fromElements(o,r,n)};wc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return dn.octDecodeFloat(e[i],n)};wc.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};wc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===Ka.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var FH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},IH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};wc.prototype.getAttributes=function(e){let t=J.FLOAT,n=J.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===Ka.NONE){s(FH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(FH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(FH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(IH.compressed0,a?4:3),c&&s(IH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(IH.geodeticSurfaceNormal,3)}return r};wc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?FH:IH};wc.clone=function(e,t){if(l(e))return l(t)||(t=new wc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=P.clone(e.toScaledENU),t.fromScaledENU=P.clone(e.fromScaledENU),t.matrix=P.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 Cr=wc;var E0={};E0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var ioe=new h,iVt=new P,oVt=new h,rVt=new h;E0.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,m=e.skirtHeight,p=m>0,b=e.isGeographic??!0,f=e.ellipsoid??ne.default,y=1/f.maximumRadius,_=re.clone(e.nativeRectangle),S=re.clone(e.rectangle),Z,R,C,E;l(S)?(Z=S.west,R=S.south,C=S.east,E=S.north):b?(Z=a(_.west),R=a(_.south),C=a(_.east),E=a(_.north)):(Z=_.west*y,R=s-2*o(r(-_.south*y)),C=_.east*y,E=s-2*o(r(-_.north*y)));let A=e.relativeToCenter,L=l(A);A=L?A:h.ZERO;let F=e.includeWebMercatorT??!1,I=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,V=I!==1,G=e.structure??E0.DEFAULT_STRUCTURE,v=G.heightScale??E0.DEFAULT_STRUCTURE.heightScale,X=G.heightOffset??E0.DEFAULT_STRUCTURE.heightOffset,Y=G.elementsPerHeight??E0.DEFAULT_STRUCTURE.elementsPerHeight,D=G.stride??E0.DEFAULT_STRUCTURE.stride,w=G.elementMultiplier??E0.DEFAULT_STRUCTURE.elementMultiplier,O=G.isBigEndian??E0.DEFAULT_STRUCTURE.isBigEndian,M=re.computeWidth(_),z=re.computeHeight(_),K=M/(d-1),te=z/(u-1);b||(M*=y,z*=y);let H=f.radiiSquared,$=H.x,ee=H.y,le=H.z,_e=65536,he=-65536,Ze=_t.eastNorthUpToFixedFrame(A,f),ye=P.inverseTransformation(Ze,iVt),Ge,Ae;F&&(Ge=xi.geodeticLatitudeToMercatorAngle(R),Ae=1/(xi.geodeticLatitudeToMercatorAngle(E)-Ge));let Fe=oVt;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let tt=rVt;tt.x=Number.NEGATIVE_INFINITY,tt.y=Number.NEGATIVE_INFINITY,tt.z=Number.NEGATIVE_INFINITY;let Be=Number.POSITIVE_INFINITY,je=d*u,qe=m>0?d*2+u*2:0,We=je+qe,Ke=new Array(We),ct=new Array(We),Et=new Array(We),zt=F?new Array(We):[],ut=V?new Array(We):[],bt=0,ht=u,jt=0,st=d;p&&(--bt,++ht,--jt,++st);let pt=1e-5;for(let On=bt;On<ht;++On){let rn=On;rn<0&&(rn=0),rn>=u&&(rn=u-1);let Hn=_.north-te*rn;b?Hn=a(Hn):Hn=s-2*o(r(-Hn*y));let $i=(Hn-R)/(E-R);$i=W.clamp($i,0,1);let Po=On===bt,hr=On===ht-1;m>0&&(Po?Hn+=pt*z:hr&&(Hn-=pt*z));let Is=t(Hn),Hs=n(Hn),or=le*Hs,bi;F&&(bi=(xi.geodeticLatitudeToMercatorAngle(Hn)-Ge)*Ae);for(let fr=jt;fr<st;++fr){let mo=fr;mo<0&&(mo=0),mo>=d&&(mo=d-1);let Qr=rn*(d*D)+mo*D,wn;if(Y===1)wn=c[Qr];else{wn=0;let qo;if(O)for(qo=0;qo<Y;++qo)wn=wn*w+c[Qr+qo];else for(qo=Y-1;qo>=0;--qo)wn=wn*w+c[Qr+qo]}wn=wn*v+X,he=Math.max(he,wn),_e=Math.min(_e,wn);let Ki=_.west+K*mo;b?Ki=a(Ki):Ki=Ki*y;let Mi=(Ki-Z)/(C-Z);Mi=W.clamp(Mi,0,1);let Xo=rn*d+mo;if(m>0){let qo=fr===jt,Gl=fr===st-1,K0=Po||hr||qo||Gl;if((Po||hr)&&(qo||Gl))continue;K0&&(wn-=m,qo?(Xo=je+(u-rn-1),Ki-=pt*M):hr?Xo=je+u+(d-mo-1):Gl?(Xo=je+u+d+rn,Ki+=pt*M):Po&&(Xo=je+u+d+u+mo))}let Dc=Is*t(Ki),bm=Is*n(Ki),bp=$*Dc,Lh=ee*bm,gp=1/i(bp*Dc+Lh*bm+or*Hs),Ps=bp*gp,$a=Lh*gp,DT=or*gp,si=new h;si.x=Ps+Dc*wn,si.y=$a+bm*wn,si.z=DT+Hs*wn,P.multiplyByPoint(ye,si,ioe),h.minimumByComponent(ioe,Fe,Fe),h.maximumByComponent(ioe,tt,tt),Be=Math.min(Be,wn),Ke[Xo]=si,Et[Xo]=new k(Mi,$i),ct[Xo]=wn,F&&(zt[Xo]=bi),V&&(ut[Xo]=f.geodeticSurfaceNormal(si))}}let wi=de.fromPoints(Ke),jn;l(S)&&(jn=tn.fromRectangle(S,_e,he,f));let _i;L&&(_i=new Af(f).computeHorizonCullingPointPossiblyUnderEllipsoid(A,Ke,_e));let Hi=new Tu(Fe,tt,A),Gi=new Cr(A,Hi,Be,he,Ze,!1,F,V,I,N),fi=new Float32Array(We*Gi.stride),Si=0;for(let On=0;On<We;++On)Si=Gi.encode(fi,Si,Ke[On],Et[On],ct[On],void 0,zt[On],ut[On]);return{vertices:fi,maximumHeight:he,minimumHeight:_e,encoding:Gi,boundingSphere3D:wi,orientedBoundingBox:jn,occludeePointInScaledSpace:_i}};var KE=E0;var bto=x(T(),1);function gT(){ge.throwInstantiationError()}Object.defineProperties(gT.prototype,{credits:{get:ge.throwInstantiationError},waterMask:{get:ge.throwInstantiationError}});gT.prototype.interpolateHeight=ge.throwInstantiationError;gT.prototype.isChildAvailable=ge.throwInstantiationError;gT.prototype.createMesh=ge.throwInstantiationError;gT.prototype.upsample=ge.throwInstantiationError;gT.prototype.wasCreatedByUpsampling=ge.throwInstantiationError;gT.maximumAsynchronousTasks=5;var ou=gT;var Uto=x(T(),1);var Gto=x(T(),1);var sVt=3,roe=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new soe}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,o,r){this._needsRebuild&&lVt(this,n);let s=this._inverseTransform,a=cVt;a.origin=P.multiplyByPoint(s,t.origin,a.origin),a.direction=P.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return XWe(this._rootNode,a,c),fVt(this,c,t,i,o,r)}},aVt=new $n("incrementallyBuildTerrainPicker"),soe=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=PWe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=PWe(n.x,n.y,n.level),this.children[t]=n}},cVt=new gn,PH=[new h,new h,new h];function lVt(e,t){P.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var dVt=new h,uVt=new h;function PWe(e,t,n){let i=1/Math.pow(2,n),o=h.fromElements(e*i-.5,t*i-.5,-.5,dVt),r=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,uVt);return Tu.fromCorners(o,r)}function mVt(e,t,n,i,o){h.pack(n[0],e,9*o),h.pack(n[1],e,9*o+3),h.pack(n[2],e,9*o+6),t[o]=i}var hVt=new Ns;function XWe(e,t,n){let i=yi.rayAxisAlignedBoundingBox(t,e.aabb,hVt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Ns(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)XWe(e.children[r],t,n)}function fVt(e,t,n,i,o,r){let s=t.sort(function(c,d){return c.interval.start-d.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let d=s[c],u=pVt(e,n,d.node,i,o,r);if(a=Math.min(u,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function pVt(e,t,n,i,o,r){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,d=e._vertices,u=n.intersectingTriangles.length,p=!(n.level>=sVt)&&!n.buildingChildren,b,f;p&&(b=new Float64Array(u*9),f=new Uint32Array(u));for(let y=0;y<u;y++){let _=n.intersectingTriangles[y],S=ooe(a,o,r,t,d,c[3*_],PH[0]),Z=ooe(a,o,r,t,d,c[3*_+1],PH[1]),R=ooe(a,o,r,t,d,c[3*_+2],PH[2]),C=yi.rayTriangleParametric(t,S,Z,R,i);l(C)&&C<s&&C>=0&&(s=C),p&&mVt(b,f,PH,_,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);gVt(e._inverseTransform,n,f,b)}return s}var bVt=new pe;function ooe(e,t,n,i,o,r,s){let a=e.getExaggeratedPosition(o,r,s);if(t===se.SCENE3D)return a;let d=n.ellipsoid.cartesianToCartographic(a,bVt);a=n.project(d,s),a=h.fromElements(a.z,a.x,a.y,s);let u=W.TWO_PI*n.ellipsoid.maximumRadius,m=Math.round((i.origin.y-a.y)/u);return a.y+=m*u,a}async function gVt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);P.pack(e,o,0);let r=new Float64Array(24);for(let u=0;u<4;u++)h.pack(t.children[u].aabb.minimum,r,u*6),h.pack(t.children[u].aabb.maximum,r,u*6+3);let s={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},a=[r.buffer,o.buffer,n.buffer,i.buffer],c=aVt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((u,m)=>{l(t.children[m])&&(t.children[m].intersectingTriangles=new Uint32Array(u))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var LM=roe;function WM(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y,_){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=d,this.orientedBoundingBox=m,this.encoding=p,this.westIndicesSouthToNorth=b,this.southIndicesEastToWest=f,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=_,this._transform=new P,this._lastPickSceneMode=void 0,this._terrainPicker=new LM(t,n,p)}WM.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===se.SCENE3D?yVt(this,this._transform):CVt(this,t,this._transform))};function yVt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=_o.getHeight(e.minimumHeight,n,i),r=_o.getHeight(e.maximumHeight,n,i),s=tn.fromRectangle(e.rectangle,o,r,ne.default,e.orientedBoundingBox);return tn.computeTransformation(s,t),P.getScale(t,aoe).z<=W.EPSILON16&&(aoe.z=1,P.setScale(t,aoe,t)),t}var xVt=new h,TVt=new h,_Vt=new pe,SVt=new pe,ZVt=new h,RVt=new h,aoe=new h;function CVt(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=_o.getHeight(e.minimumHeight,i,o),s=_o.getHeight(e.maximumHeight,i,o),a=t.project(pe.fromRadians(e.rectangle.west,e.rectangle.south,0,_Vt),xVt),c=t.project(pe.fromRadians(e.rectangle.east,e.rectangle.north,0,SVt),TVt),d=s-r,u=h.fromElements(c.x-a.x,c.y-a.y,d>0?d:1,ZVt),m=h.fromElements(a.x+u.x*.5,a.y+u.y*.5,r+u.z*.5,RVt);return P.fromTranslation(m,n),P.setScale(n,u,n),P.multiply(_t.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}WM.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};WM.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};WM.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var yc=WM;function Jg(e){e=e??B.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??gh.NONE;let t=KE.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===gh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Jg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var NWe="createVerticesFromHeightmap",VVt=new $n(NWe),EVt=new $n(NWe,ou.maximumAsynchronousTasks);Jg.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(re.center(u)),p=this._structure,f=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?EVt:VVt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:m,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(_))return;let S=this;return Promise.resolve(_).then(function(Z){let R;S._skirtHeight>0?R=Qo.getRegularGridAndSkirtIndicesAndEdgeIndices(Z.gridWidth,Z.gridHeight):R=Qo.getRegularGridIndicesAndEdgeIndices(Z.gridWidth,Z.gridHeight);let C=Z.gridWidth*Z.gridHeight;return S._mesh=new yc(m,new Float32Array(Z.vertices),R.indices,R.indexCountWithoutSkirts,C,Z.minimumHeight,Z.maximumHeight,u,de.clone(Z.boundingSphere3D),h.clone(Z.occludeePointInScaledSpace),Z.numberOfAttributes,tn.clone(Z.orientedBoundingBox),Cr.clone(Z.encoding),R.westIndicesSouthToNorth,R.southIndicesEastToWest,R.eastIndicesNorthToSouth,R.northIndicesWestToEast),S._buffer=void 0,S._mesh})};Jg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(re.center(d)),m=this._structure,b=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(b*4,1e3);let f=KE.computeVertices({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Qo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Qo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new yc(u,f.vertices,y.indices,y.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,d,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};Jg.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,m=r.heightScale,p=l(this._mesh),b=this._encoding===gh.LERC;if(!p&&b)return;let y;if(p){let _=this._mesh.vertices,S=this._mesh.encoding;y=YWe(_,S,u,m,e,i,o,t,n)}else y=AVt(this._buffer,a,c,s,d,e,i,o,t,n),y=y*m+u;return y};Jg.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,m=u.stride,p=new this._bufferType(c*d*m),b=a.vertices,f=a.encoding,y=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),S=u.heightOffset,Z=u.heightScale,R=u.elementsPerHeight,C=u.elementMultiplier,E=u.isBigEndian,A=Math.pow(C,R-1);for(let L=0;L<d;++L){let F=W.lerp(_.north,_.south,L/(d-1));for(let I=0;I<c;++I){let N=W.lerp(_.west,_.east,I/(c-1)),g=YWe(b,f,S,Z,y,c,d,N,F);g=g<u.lowestEncodedHeight?u.lowestEncodedHeight:g,g=g>u.highestEncodedHeight?u.highestEncodedHeight:g,GVt(p,R,C,A,m,E,L*c+I,g)}}return Promise.resolve(new Jg({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Jg.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};Jg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function AVt(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),m=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,b=p+1;b>=s&&(b=s-1,p=s-2);let f=m|0,y=f+1;y>=a&&(y=a-1,f=a-2);let _=u-p,S=m-f;f=a-1-f,y=a-1-y;let Z=XH(e,t,n,i,o,f*s+p),R=XH(e,t,n,i,o,f*s+b),C=XH(e,t,n,i,o,y*s+p),E=XH(e,t,n,i,o,y*s+b);return wWe(_,S,Z,R,C,E)}function YWe(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),m=d|0,p=m+1;p>=r&&(p=r-1,m=r-2);let b=u|0,f=b+1;f>=s&&(f=s-1,b=s-2);let y=d-m,_=u-b;b=s-1-b,f=s-1-f;let S=(t.decodeHeight(e,b*r+m)-n)/i,Z=(t.decodeHeight(e,b*r+p)-n)/i,R=(t.decodeHeight(e,f*r+m)-n)/i,C=(t.decodeHeight(e,f*r+p)-n)/i;return wWe(y,_,S,Z,R,C)}function wWe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function XH(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 GVt(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 Mc=Jg;var uno=x(T(),1);function QE(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var kZ=new re;function LVt(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}QE.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 b=t;b<=i;++b)LVt(e,b,p,s)||s.push(new JE(r,void 0,0,b,p));r.tileXYToRectangle(t,n,e,kZ);let a=kZ.west,c=kZ.north;r.tileXYToRectangle(i,o,e,kZ);let d=kZ.east,u=kZ.south,m=new PVt(e,a,u,d,c);for(let p=0;p<s.length;++p){let b=s[p];coe(b.extent,m)&&XVt(this._maximumLevel,b,m)}};QE.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(jE(i.extent,e)){t=i;break}}return l(t)?vM(void 0,t,e):-1};var WVt=[],vVt=[],FVt=new re,IVt=new re;QE.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=WVt;t.length=0,e.east<e.west?(t.push(re.fromRadians(-Math.PI,e.south,e.east,e.north,FVt)),t.push(re.fromRadians(e.west,e.south,Math.PI,e.north,IVt))):t.push(e);let n=vVt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)FM(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 MWe=new pe;QE.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,kZ);return re.center(i,MWe),this.computeMaximumLevelAtPosition(MWe)>=e};QE.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 JE(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(JE.prototype,{nw:{get:function(){return this._nw||(this._nw=new JE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new JE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new JE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new JE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function PVt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function coe(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 XVt(e,t,n){for(;t.level<e;)if(NH(t.nw.extent,n))t=t.nw;else if(NH(t.ne.extent,n))t=t.ne;else if(NH(t.sw.extent,n))t=t.sw;else if(NH(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=Eo(t.rectangles,n.level,NVt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function NVt(e,t){return e.level-t}function NH(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function jE(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function vM(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&jE(t._nw.extent,n),s=t._ne&&jE(t._ne.extent,n),a=t._sw&&jE(t._sw.extent,n),c=t._se&&jE(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,vM(t,t._nw,n))),s&&(i=Math.max(i,vM(t,t._ne,n))),a&&(i=Math.max(i,vM(t,t._sw,n))),c&&(i=Math.max(i,vM(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];jE(a,n)&&(i=a.level)}t=t.parent}return i}function FM(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||coe(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]=YVt(e[s.level],s)}FM(e,t._nw,n),FM(e,t._ne,n),FM(e,t._sw,n),FM(e,t._se,n)}function YVt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];coe(o,t)?(o.west<t.west&&n.push(new re(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new re(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new re(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new re(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var jf=QE;var wVt=15;function kWe(e){this.ellipsoid=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}kWe.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 MVt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Lt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=re.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new to(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 k(r.xmin,r.ymin),s.rectangleNortheastInMeters=new k(r.xmax,r.ymax),e.tilingScheme=new Xr(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"?gh.LERC:gh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new jf(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new jf(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Qo.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 kVt(e,t,n){try{let i=await t.fetchJson();MVt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function yT(){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 Se}Object.defineProperties(yT.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}}});yT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new kWe(t);await kVt(o,i);let r=new yT(t);return o.build(r),r._resource=n,r};yT.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(loe(this,n+1,e*2,t*2))){let m=UWe(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new Mc({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):wVt,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(m){if(l(a)&&a.state===Ri.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ri.CANCELLED,Promise.reject(m)}return Promise.reject(m)})};function loe(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}yT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};yT.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=loe(this,n,e,t);if(l(i))return i;UWe(this,n,e,t)};yT.prototype.loadTileDataAvailability=function(e,t,n){};function UVt(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 k(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=d.x,b=m?d.y+1:d.y;if(!u){for(let f=e.y;f<b;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new k(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!m){let f=d.y*t;for(let y=e.x;y<=p;++y)if(i[f+y]!==s){m=!0;break}m?(a.push(new k(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,m=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function DVt(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 k(0,0)];for(;a.length>0;){let c=a.pop(),d=UVt(c,n,i,o);if(d.value===1){let m=d.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function UWe(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 Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(m)?(m=m.then(function(p){let b=DVt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let y=0;y<b.length;++y){let _=b[y];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return loe(e,t,n,i)}),c[a]={promise:m,request:d},m=m.finally(function(p){return delete c[a],p}),{promise:m,request:d}):{}}var doe=yT;var wno=x(T(),1);var DWe="https://dev.virtualearth.net/REST/v1/Locations";function uoe(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new ve({url:DWe,queryParameters:n}),this._credit=new Lt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(uoe.prototype,{url:{get:function(){return DWe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});uoe.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:re.fromDegrees(a,s,d,c)}})})};var moe=uoe;var Uno=x(T(),1);function hoe(){}Object.defineProperties(hoe.prototype,{credit:{get:function(){}}});hoe.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:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var foe=hoe;var Qno=x(T(),1);var OVt=new ce,OWe=new h,qE=new h;function BVt(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 h);let d=(a-i)*o;return h.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=OVt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,m,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,m=h.subtract(t[2],c,OWe),h.multiplyByScalar(m,.5,m),p=P.multiplyByVector(mx.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],OWe),h.multiplyByScalar(u,.5,u),p=P.multiplyByVector(mx.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=P.multiplyByVector(xT.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,qE),h.add(o,qE,o),h.multiplyByScalar(u,p.z,qE),h.add(o,qE,o),h.multiplyByScalar(m,p.w,qE),h.add(o,qE,o)}}var zVt=new h,HVt=new h;function xT(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=zVt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=HVt,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=BVt(this),this._lastTimeIndex=0}Object.defineProperties(xT.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}}});xT.catmullRomCoefficientMatrix=new P(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);xT.prototype.findTimeInterval=vo.prototype.findTimeInterval;xT.prototype.wrapTime=vo.prototype.wrapTime;xT.prototype.clampTime=vo.prototype.clampTime;xT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var poe=xT;var Dio=x(T(),1);var _io=x(T(),1);var boe={},KVt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},JVt=new pe,jVt=new h,QVt=new P,qVt=new P,$Vt=new P,eEt=new h,tEt=new h,nEt=new h,iEt=new h,oEt=new pe,rEt=new k,IM=new h,sEt=new k,aEt=new h,cEt=new h,YH=function(e,t){return e-t};boe.createMesh=async function(e){e=e??B.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,u=t!==1,m=de.clone(e.boundingSphere,new de),p=tn.clone(e.orientedBoundingBox,new tn),b=h.clone(e.horizonOcclusionPoint,new h),f=ne.clone(e.ellipsoid,new ne),y=re.clone(e.rectangle,new re);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?jy.ready:Promise.resolve(void 0));let Z=y.west,R=y.south,C=y.north,E=y.width,A=y.height,L=re.center(y,JVt);L.height=.5*(s+a);let F=pe.toCartesian(L,f,jVt),I=_t.eastNorthUpToFixedFrame(F,f,QVt),N=P.inverseTransformation(I,qVt),g=P.unpack(r.nodes[0].matrix,0,$Vt);g=P.multiply(Bi.Y_UP_TO_Z_UP,g,g);let V=kEt(r,i,KVt),G=Qo.getSkirtVertexCount(V.edgeIndicesWest,V.edgeIndicesSouth,V.edgeIndicesEast,V.edgeIndicesNorth),v=V.positions,X=V.normals,Y=V.indices,D=v.length/3,w=D+G,O=Y.length,M=Qo.getSkirtIndexCountWithFilledCorners(G),z=w<=65535?Uint16Array:Uint32Array,K=new z(O+M);K.set(Y);let te=new z(V.edgeIndicesWest),H=new z(V.edgeIndicesSouth),$=new z(V.edgeIndicesEast),ee=new z(V.edgeIndicesNorth),le=new z(te).sort(),_e=new z(H).sort(),he=new z($).sort(),Ze=new z(ee).sort(),ye=xi.geodeticLatitudeToMercatorAngle(R),Ae=1/(xi.geodeticLatitudeToMercatorAngle(C)-ye),Fe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,eEt),tt=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,tEt),Be=new Cr(m.center,void 0,void 0,void 0,void 0,i,o,u,t,n),je=Be.stride,qe=new Float32Array(w*je),We=0;for(let ct=0;ct<D;ct++){let Et=h.unpack(v,ct*3,nEt),zt=P.multiplyByPoint(g,Et,iEt),ut=pe.fromCartesian(zt,f,oEt),{longitude:bt,latitude:ht,height:jt}=ut,st=(bt-Z)/E,pt=(ht-R)/A;st=W.clamp(st,0,1),pt=W.clamp(pt,0,1),Eo(le,ct,YH)>=0?st=0:Eo(he,ct,YH)>=0&&(st=1),Eo(_e,ct,YH)>=0?pt=0:Eo(Ze,ct,YH)>=0&&(pt=1);let wi=k.fromElements(st,pt,rEt),jn;if(i){let fi=h.unpack(X,ct*3,IM);fi=P.multiplyByPointAsVector(g,fi,IM),fi=h.normalize(fi,IM),jn=dn.octEncode(fi,sEt)}let _i;o&&(_i=(xi.geodeticLatitudeToMercatorAngle(ht)-ye)*Ae);let Hi;u&&(Hi=f.geodeticSurfaceNormal(zt,aEt)),We=Be.encode(qe,We,zt,wi,jt,jn,_i,Hi);let Gi=P.multiplyByPoint(N,zt,cEt);Fe=h.minimumByComponent(Gi,Fe,Fe),tt=h.maximumByComponent(Gi,tt,tt)}let Ke=new yc(h.clone(Be.center,new h),qe,K,O,D,s,a,y,de.clone(m,new de),h.clone(b,new h),je,tn.clone(p,new tn),Be,te,H,$,ee);return QWe(Ke,y,f,Fe,tt,I,N,c),Promise.resolve(Ke)};var lEt=new k,dEt=new k,uEt=new Array(6),mEt=new k,hEt=new k,fEt=new k,pEt=new h,bEt=new h,gEt=new h,yEt=new pe,xEt=new h,TEt=new pe,_Et=new pe,BWe=new h,SEt=new h,ZEt=new h,REt=new h,CEt=new h,VEt=new h,EEt=new h,AEt=new h,GEt=new P,LEt=new P,zWe=new k,WEt=new k,vEt=new h,FEt=new de,IEt=new tn,PEt=new Tu,HWe=new h,KWe=new k,XEt=new k,JWe=new h,NEt=new h;function YEt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let b=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(b.buffer,b.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=c===4?Uint8Array:Uint16Array,u=new d(o*4);jy.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,a);let m=(1<<u.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let b=0;b<o;b++)p[b*3+0]=u[b*4+0]/m,p[b*3+1]=u[b*4+1]/m,p[b*3+2]=u[b*4+2]/m;return p}function wEt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let m=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(m.buffer,m.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=new Int8Array(o*c);jy.decodeVertexBuffer(new Uint8Array(d.buffer),o,c,a);let u=new Float32Array(o*3);for(let m=0;m<o;m++){let p=Math.max(d[m*4+0]/127,-1),b=Math.max(d[m*4+1]/127,-1),f=1-(Math.abs(p)+Math.abs(b));if(f<0){let _=p,S=b;p=(1-Math.abs(S))*W.signNotZero(_),b=(1-Math.abs(_))*W.signNotZero(S)}let y=IM;y.x=p,y.y=b,y.z=f,y=h.normalize(y,IM),u[m*3+0]=y.x,u[m*3+1]=y.y,u[m*3+2]=y.z}return u}function MEt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let u=e.buffers[i.buffer].extras._pipeline.source;return new r(u.buffer,u.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),d=new r(o);return jy.decodeIndexBuffer(new Uint8Array(d.buffer),o,s.byteStride,c),d}function wH(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,s=i.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[a.buffer].extras._pipeline.source,d=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),u=new s(r),m=a.byteStride;return jy.decodeIndexSequence(new Uint8Array(u.buffer),r,m,d),u}function kEt(e,t,n){return n.positions=YEt(e),n.normals=t?wEt(e):void 0,n.indices=MEt(e),n.edgeIndicesWest=wH(e,"left"),n.edgeIndicesSouth=wH(e,"bottom"),n.edgeIndicesEast=wH(e,"right"),n.edgeIndicesNorth=wH(e,"top"),n}boe.upsampleMesh=function(e){e=e??B.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,d=e.parentVertices,u=Cr.clone(e.parentEncoding,new Cr),m=u.hasVertexNormals,p=u.hasWebMercatorT,b=u.exaggeration,f=u.exaggerationRelativeHeight,_=b!==1,S=re.clone(e.rectangle,new re),Z=ne.clone(e.ellipsoid),R=[],C=[],E=[],A=[],L=[],F=[],I=[],N=[];eAt(t,n,s,a,c,d,u,A,L,F,I,N,R,E,C);let g=re.center(S,yEt);g.height=.5*(i+o);let V=pe.toCartesian(g,Z,xEt),G=R.length,v=new Cr(V,void 0,void 0,void 0,void 0,m,p,_,b,f),X=v.stride,Y=Qo.getSkirtVertexCount(L,F,I,N),D=G+Y,w=A.length,O=Qo.getSkirtIndexCountWithFilledCorners(Y),M=w+O,z=D<=65535?Uint16Array:Uint32Array,K=new z(M);K.set(A);let te=new z(L),H=new z(F),$=new z(I),ee=new z(N),le=new Float32Array(D*X),_e=0,he=_t.eastNorthUpToFixedFrame(V,Z,GEt),Ze=P.inverseTransformation(he,LEt),ye=S.west,Ge=S.east,Ae=S.south,Fe=S.north,tt=xi.geodeticLatitudeToMercatorAngle(Ae),je=1/(xi.geodeticLatitudeToMercatorAngle(Fe)-tt),qe=Number.POSITIVE_INFINITY,We=Number.NEGATIVE_INFINITY,Ke=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,EEt),ct=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,AEt);for(let jt=0;jt<G;jt++){let st=R[jt],pt=a[st*3+0],wi=a[st*3+1],jn=a[st*3+2],_i=WEt;_i.x=C[jt*2+0],_i.y=C[jt*2+1];let Hi=_i.x,Gi=_i.y,fi=E[jt*2+0],Si=E[jt*2+1],On=1-fi-Si,rn=u.decodeHeight(d,pt),Hn=u.decodeHeight(d,wi),$i=u.decodeHeight(d,jn),Po=rn*fi+Hn*Si+$i*On;qe=Math.min(Po,qe),We=Math.max(Po,We);let hr=W.lerp(ye,Ge,Hi),Is=W.lerp(Ae,Fe,Gi),Hs=pe.fromRadians(hr,Is,Po,_Et),or=pe.toCartesian(Hs,Z,SEt),bi=P.multiplyByPoint(Ze,or,REt);Ke=h.minimumByComponent(bi,Ke,Ke),ct=h.maximumByComponent(bi,ct,ct);let fr;if(m){let wn=u.decodeNormal(d,pt,pEt),Ki=u.decodeNormal(d,wi,bEt),Mi=u.decodeNormal(d,jn,gEt),Xo=h.fromElements(wn.x*fi+Ki.x*Si+Mi.x*On,wn.y*fi+Ki.y*Si+Mi.y*On,wn.z*fi+Ki.z*Si+Mi.z*On,HWe);Xo=h.normalize(Xo,HWe),fr=dn.octEncode(Xo,XEt)}let mo;p&&(mo=(xi.geodeticLatitudeToMercatorAngle(Is)-tt)*je);let Qr;_&&(Qr=Z.geodeticSurfaceNormal(or,NEt)),_e=v.encode(le,_e,or,_i,Po,fr,mo,Qr)}let Et=tn.fromRectangle(S,qe,We,Z,IEt),zt=de.fromVertices(le,v.center,X,FEt),bt=new Af(Z).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(v.center,le,X,v.center,qe,vEt),ht=new yc(h.clone(v.center,new h),le,K,w,G,qe,We,S,de.clone(zt),h.clone(bt),X,tn.clone(Et),v,te,H,$,ee);return QWe(ht,S,Z,Ke,ct,he,Ze,r),ht};function QWe(e,t,n,i,o,r,s,a){let{encoding:c}=e,d=c.stride,u=e.vertices,{hasVertexNormals:m,hasWebMercatorT:p,exaggeration:b,exaggerationRelativeHeight:f}=c,_=b!==1,S=e.vertexCountWithoutSkirts,Z=S*d,R=u.length/d,C=R-S,E=e.indices,A=e.indexCountWithoutSkirts,L=e.westIndicesSouthToNorth,F=e.southIndicesEastToWest,I=e.eastIndicesNorthToSouth,N=e.northIndicesWestToEast;Qo.addSkirtIndicesWithFilledCorners(L,F,I,N,S,E,A);let g=0,V=g+L.length,G=V+F.length,v=G+I.length,X=[L,F,I,N],Y=[g,V,G,v],D=[-1,0,1,0],w=[0,-1,0,1],O=h.clone(i,CEt),M=h.clone(o,VEt),z=e.maximumHeight,K=e.minimumHeight-a;for(let $=0;$<C;$++){let ee;for(ee=0;ee<3&&!($<Y[ee+1]);ee++);let le=X[ee][$-Y[ee]],_e=c.decodeTextureCoordinates(u,le,zWe),he=1e-4,Ze=_e.x+D[ee]*he,ye=_e.y+w[ee]*he,Ge=W.lerp(t.west,t.east,Ze),Ae=W.clamp(W.lerp(t.south,t.north,ye),-W.PI_OVER_TWO,+W.PI_OVER_TWO),tt=c.decodeHeight(u,le)-a,Be=pe.fromRadians(Ge,Ae,tt,TEt),je=pe.toCartesian(Be,n,BWe),qe;m&&(qe=c.getOctEncodedNormal(u,le,KWe));let We;p&&(We=c.decodeWebMercatorT(u,le));let Ke;_&&(Ke=n.geodeticSurfaceNormal(je,JWe)),Z=c.encode(u,Z,je,_e,tt,qe,We,Ke);let ct=P.multiplyByPoint(s,je,ZEt);h.minimumByComponent(ct,O,O),h.maximumByComponent(ct,M,M)}let te=Tu.fromCorners(O,M,PEt),H=new Cr(c.center,te,K,z,r,c.hasVertexNormals,c.hasWebMercatorT,_,b,f);if(c.quantization!==H.quantization){let $=H,ee=$.stride,le=new Float32Array(R*ee),_e=0;for(let he=0;he<R;he++)_e=$.encode(le,_e,c.decodePosition(u,he,BWe),c.decodeTextureCoordinates(u,he,zWe),c.decodeHeight(u,he),c.hasVertexNormals?c.getOctEncodedNormal(u,he,KWe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(u,he):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(u,he,JWe):void 0);e.vertices=le,e.stride=ee,e.encoding=$}return e}var goe=0,UEt=1,yoe=2,xoe=3,DEt=4,OEt=new h,BEt=[new h,new h,new h,new h,new h,new h],zEt=[new k,new k,new k,new k,new k,new k],HEt=[new h,new h,new h,new h,new h,new h],KEt=[new k,new k,new k,new k,new k,new k];function jWe(e,t,n,i){switch(n){case goe:return W.sign(i.x-e.x);case yoe:return W.sign(t.x-i.x);case xoe:return W.sign(i.y-e.y);default:return W.sign(t.y-i.y)}}function JEt(e,t,n,i,o,r){let s,a,c;switch(n){case goe:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case yoe:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case xoe:s=(e.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,r)}var jEt={length:0,coordinates:[new k,new k,new k,new k,new k,new k],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function QEt(e,t,n,i,o,r,s,a){let c,d=zEt,u=BEt,m=3,p=KEt;k.clone(o,p[0]),k.clone(r,p[1]),k.clone(s,p[2]);let b=HEt;h.fromElements(1,0,0,b[0]),h.fromElements(0,1,0,b[1]),h.fromElements(0,0,1,b[2]);for(let f=0;f<t;f++){let y=(e+f)%DEt,_=d,S=u;d=p,u=b,c=m,p=_,b=S,m=0;let Z=c-1,R=d[Z],C=u[Z],E=jWe(n,i,y,R);for(let A=0;A<c;A++){let L=d[A],F=u[A],I=jWe(n,i,y,L);if(E*I===-1){let N=JEt(n,i,y,R,L,OEt),{x:g,y:V,z:G}=N,v=1-G,X=C.x*v+F.x*G,Y=C.y*v+F.y*G,D=C.z*v+F.z*G;k.fromElements(g,V,p[m]),h.fromElements(X,Y,D,b[m]),m++}I>=0&&(k.clone(L,p[m]),h.clone(F,b[m]),m++),R=L,C=F,E=I}if(m===0)break}a.length=m;for(let f=0;f<m;f++)k.clone(p[f],a.coordinates[f]),h.clone(b[f],a.barycentricCoordinates[f]);return a}function qEt(e,t,n,i,o,r,s,a){return QEt(e?t?xoe:goe:t?yoe:UEt,2,n,i,o,r,s,a)}var $Et=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function eAt(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f){let y={},_=e?.5:0,S=e?1:.5,Z=t?.5:0,R=t?1:.5,C=lEt;C.x=_,C.y=Z;let E=dEt;E.x=S,E.y=R;let A=0;for(let L=0;L<n;L+=3){let F=i[L+0],I=i[L+1],N=i[L+2],g=s.decodeTextureCoordinates(r,F,mEt),V=s.decodeTextureCoordinates(r,I,hEt),G=s.decodeTextureCoordinates(r,N,fEt),v=qEt(e,t,C,E,g,V,G,jEt),X=v.length;if(X<3)continue;let Y=uEt;for(let M=0;M<X;M++){let z=v.barycentricCoordinates[M],K=z.x,te=z.y,H=z.z,$=Math.ceil(K)|Math.ceil(te)<<1|Math.ceil(H)<<2,ee=$Et[$],le,_e=!1;if(ee.length===1){let he=ee[0],ye=i[L+he];le=y[ye],le===void 0&&(_e=!0,le=A++,y[ye]=le)}else if(ee.length===2){let he=ee[0],Ze=ee[1],ye=i[L+he],Ge=i[L+Ze],Ae=v.barycentricCoordinates[(M+X-1)%X],Fe=Math.ceil(Ae.x)|Math.ceil(Ae.y)<<1|Math.ceil(Ae.z)<<2,tt=$===Fe,Be=Math.min(ye,Ge),je=Math.max(ye,Ge),qe=o+2*(Be*o+je),We=qe+0,Ke=qe+1,ct=y[We],Et=y[Ke],zt=!tt==(ct===void 0||Et===void 0);if(le=zt?ct:Et,le===void 0){_e=!0,le=A++;let ut=zt?We:Ke;y[ut]=le}}else _e=!0,le=A++;if(Y[M]=le,_e){let he=L/3;p.push(he);let Ze=v.coordinates[M],ye=(Ze.x-_)/(S-_),Ge=(Ze.y-Z)/(R-Z);f.push(ye,Ge),b.push(K,te),ye===0?c.push(le):ye===1&&u.push(le),Ge===0?d.push(le):Ge===1&&m.push(le)}}let D=Y[0],w=Y[1],O=Y[2];a.push(D,w,O);for(let M=3;M<X;M++)w=O,O=Y[M],a.push(D,w,O)}c.sort(function(L,F){return f[L*2+1]-f[F*2+1]}),d.sort(function(L,F){return f[F*2+0]-f[L*2+0]}),u.sort(function(L,F){return f[F*2+1]-f[L*2+1]}),m.sort(function(L,F){return f[L*2+0]-f[F*2+0]})}var $E=boe;var Vio=x(T(),1);var MH={};MH.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,m,p,b,f,y;return d===1?s?(u=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),b=(e-i)/(n-i),r.push(2),r.push(0),b!==1&&(r.push(-1),r.push(1),r.push(0),r.push(b)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(b=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(b),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(y=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};MH.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,m=r-a,p=i-a,b=1/(m*d+u*p),f=t-a,y=e-s,_=(m*y+u*f)*b,S=(-p*y+d*f)*b,Z=1-_-S;return l(c)?(c.x=_,c.y=S,c.z=Z,c):new h(_,S,Z)};MH.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),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=d/m,b=u/m;if(p>=0&&p<=1&&b>=0&&b<=1)return l(c)||(c=new k),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Qf=MH;function Qg(e){e=e??B.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=de.clone(e.boundingSphere,new de),this._orientedBoundingBox=tn.clone(e.orientedBoundingBox,new tn),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(Qg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});Qg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:$We(i,e,t,n)};Qg.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};var qWe="createVerticesFromCesium3DTilesTerrain",tAt=new $n(qWe),nAt=new $n(qWe,ou.maximumAsynchronousTasks);Qg.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let n=e.throttle??!0?nAt:tAt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(r,s,a,new re),d=this._gltf,u=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:d,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(u))return;let m=this;return Promise.resolve(u).then(function(p){let b=p,f=Cr.clone(b.encoding,new Cr),y=new Float32Array(b.verticesBuffer),_=y.length/f.stride,S=b.vertexCountWithoutSkirts,Z=_<=65535?Uint16Array:Uint32Array,R=new Z(b.indicesBuffer),C=new Z(b.westIndicesBuffer),E=new Z(b.eastIndicesBuffer),A=new Z(b.southIndicesBuffer),L=new Z(b.northIndicesBuffer),F=b.indexCountWithoutSkirts,I=m._minimumHeight,N=m._maximumHeight,g=h.clone(f.center,new h),V=de.clone(m._boundingSphere,new de),G=h.clone(m._horizonOcclusionPoint,new h),v=tn.clone(m._orientedBoundingBox,new tn),X=new yc(g,y,R,F,S,I,N,c,V,G,f.stride,v,f,C,A,E,L);return m._mesh=X,Promise.resolve(X)})};Qg.prototype._createMeshSync=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,s=t.tileXYToRectangle(i,o,r,new re),a=$E.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(d){return c._mesh=d,Promise.resolve(d)})};Qg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:kH(!1,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};Qg.prototype._upsampleSync=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:kH(!0,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};Qg.prototype.wasCreatedByUpsampling=function(){return!1};function jg(e){e=e??B.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}jg.prototype.createMesh=function(e){return e=e??B.EMPTY_OBJECT,Promise.resolve(this._mesh)};jg.prototype.upsample=function(e,t,n,i,o,r,s){return kH(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};jg.prototype._upsampleSync=function(e,t,n,i,o,r,s){return kH(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};jg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return $We(i,e,t,n)};jg.prototype.wasCreatedByUpsampling=function(){return!0};jg.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(jg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var iAt=new $n("upsampleVerticesFromCesium3DTilesTerrain",ou.maximumAsynchronousTasks);function kH(e,t,n,i,o,r,s,a,c,d,u){if(u-a>1)throw new ge("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,b=r*2!==c,f=s*2===d,y=o.tileXYToRectangle(c,d,u,new re),_=o.ellipsoid,S={isEastChild:b,isNorthChild:f,rectangle:y,ellipsoid:_,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let R=$E.upsampleMesh(S),C=new jg({terrainMesh:R,skirtHeight:p,credits:i});return Promise.resolve(C)}let Z=iAt.scheduleTask(S);if(Z!==void 0)return Z.then(function(R){let C=Cr.clone(R.encoding,new Cr),E=C.stride,A=new Float32Array(R.verticesBuffer),L=A.length/E,F=R.vertexCountWithoutSkirts,I=L<=65535?Uint16Array:Uint32Array,N=new I(R.indicesBuffer),g=new I(R.westIndicesBuffer),V=new I(R.eastIndicesBuffer),G=new I(R.southIndicesBuffer),v=new I(R.northIndicesBuffer),X=R.indexCountWithoutSkirts,Y=R.minimumHeight,D=R.maximumHeight,w=h.clone(C.center,new h),O=de.clone(R.boundingSphere,new de),M=h.clone(R.horizonOcclusionPoint,new h),z=tn.clone(R.orientedBoundingBox,new tn),K=new yc(w,A,N,X,F,Y,D,y,O,M,E,z,C,g,G,V,v),te=new jg({terrainMesh:K,skirtHeight:p,credits:i});return Promise.resolve(te)})}var oAt=new k,rAt=new k,sAt=new k,aAt=new h;function $We(e,t,n,i){let o=W.clamp((n-t.west)/t.width,0,1),r=W.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let d=0;d<e.indexCountWithoutSkirts;d+=3){let u=c[d],m=c[d+1],p=c[d+2],b=a.decodeTextureCoordinates(s,u,oAt),f=a.decodeTextureCoordinates(s,m,rAt),y=a.decodeTextureCoordinates(s,p,sAt),_=Math.min(b.x,f.x,y.x),S=Math.max(b.x,f.x,y.x),Z=Math.min(b.y,f.y,y.y),R=Math.max(b.y,f.y,y.y);if(o>=_&&o<=S&&r>=Z&&r<=R){let C=Qf.computeBarycentricCoordinates(o,r,b.x,b.y,f.x,f.y,y.x,y.y,aAt);if(C.x>=0&&C.y>=0&&C.z>=0){let E=a.decodeHeight(s,u),A=a.decodeHeight(s,m),L=a.decodeHeight(s,p);return C.x*E+C.y*A+C.z*L}}}return 0}var PM=Qg;var _oo=x(T(),1);var Hio=x(T(),1);function qf(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(qf.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}}});qf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new qf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};qf.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};qf.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)eve(this,t)};qf.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++,eve(this,i),t};qf.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],tve(this,0)),this._array[e-1]=void 0,t};qf.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=Toe(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&tve(this,n)}return this._array[e-1]=void 0,t};qf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};qf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Toe(this,1,2)?1:2]};function UH(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function XM(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Toe(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function eve(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=XM(e,t,i);for(o!==n&&(UH(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(XM(e,t,r)!==o)break;UH(e,t,r),t=r}}function tve(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){XM(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;XM(e,u,r)===i&&(r=u)}}if(XM(e,r,t)===i&&(UH(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);Toe(e,r,a)===i&&UH(e,r,a)}t=r}}var qg=qf;function A0(e){e=e??B.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new Se,this._ellipsoid=e.ellipsoid??ne.WGS84,this._tilingScheme=new to({ellipsoid:this._ellipsoid}),this._subtreeCache=new UZ({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}A0.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(u){throw new ae("Could not load tileset JSON",u)}let o=new A0(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,s=r[0],a=r[1],c=i.schema,d=zl.fromJson(c);return o._tileset0=new $p(n,s,d),o._tileset1=new $p(n,a,d),o};A0.fromIonAssetId=async function(e,t){let n=await Ur.fromAssetId(e);return A0.fromUrl(n,t)};var cAt=new Array(3);A0.prototype.requestTileGeometry=async function(e,t,n,i){let o=ive(n,e),r=o===0?this._tileset0:this._tileset1,s=ove(r,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,d=c.find(o,a),u=this._requestWaterMask,m=this,p;if(d===void 0){let Z=r.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=r.baseResource.getDerivedResource({url:Z.url}).fetchArrayBuffer().then(async function(C){if(d=c.find(o,a),d===void 0){let E=new Uint8Array(C);d=await Lb.fromSubtreeJson(m._resource,void 0,E,r,a),c.addSubtree(o,d)}return d})}else p=Promise.resolve(d);let b=r.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),f=r.baseResource.getDerivedResource({url:b.url}),y=f.fetchArrayBuffer();if(y===void 0)return;let _=y.then(Z=>Q_(new Uint8Array(Z))),S=cAt;S[0]=p,S[1]=_,S[2]=u?_.then(Z=>lAt(Z,f)):void 0;try{let Z=await Promise.all(S),R=Z[0],C=Z[1],E=Z[2],A=R.getTileMetadataView(s),L=A.getPropertyBySemantic(Xm.TILE_MINIMUM_HEIGHT),F=A.getPropertyBySemantic(Xm.TILE_MAXIMUM_HEIGHT),I=A.getPropertyBySemantic(Xm.TILE_BOUNDING_SPHERE),N=de.unpack(I,0,new de),g=A.getPropertyBySemantic(Xm.TILE_HORIZON_OCCLUSION_POINT),G=m._tilingScheme.tileXYToRectangle(e,t,n,new re),v=m._ellipsoid,X=tn.fromRectangle(G,L,F,v,new tn),Y=m.getLevelMaximumGeometricError(n)*5,D=DH(r,R,s,0,0),w=DH(r,R,s,1,0),O=DH(r,R,s,0,1),M=DH(r,R,s,1,1),z=(D?1:0)|(w?2:0)|(O?4:0)|(M?8:0),K=new PM({gltf:C,minimumHeight:L,maximumHeight:F,boundingSphere:N,orientedBoundingBox:X,horizonOcclusionPoint:g,skirtHeight:Y,requestVertexNormals:m._requestVertexNormals,childTileMask:z,credits:m._tileCredits,waterMask:E});return Promise.resolve(K)}catch(Z){console.log(`Could not load subtree: ${o} ${a.level} ${a.x} ${a.y}: ${Z}`),console.log(`Could not load tile: ${o} ${s.level} ${s.x} ${s.y}: ${Z}`);return}};A0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=ive(n,e),r=o===0?this._tileset0:this._tileset1,s=ove(r,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(o,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let d=a.getParentSubtreeCoordinates(),u=i.find(o,d);if(u!==void 0)return u.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function ive(e,t){let n=1<<e;return t/n|0}function ove(e,t,n,i){let o=1<<t,r=t,s=n%o,a=o-i-1,{subdivisionScheme:c,subtreeLevels:d}=e;return new e0({subdivisionScheme:c,subtreeLevels:d,level:r,x:s,y:a})}async function lAt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new tx({schema:n.schema});await i.load();let o=i.schema,r,s;if(l(o.classes)){for(let b in o.classes)if(o.classes.hasOwnProperty(b)&&(r=o.classes[b],s=r.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(b=>b.class===r.id);if(!l(a))throw new ge(`Expected a propertyTexture with a class ${r.id}`);let c=a.properties[s.id],d=e.textures[c.index],u=e.images[d.source]?.bufferView,m=Ni.getBufferViewLoader({gltf:e,bufferViewId:u,gltfResource:t,baseResource:t});return await m.load(),await Ab({uint8Array:new Uint8Array(m.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function DH(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=_oe(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function _oe(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new e0({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}A0.prototype.loadTileDataAvailability=function(e,t,n){};A0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(A0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function dAt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function UZ(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new qg({comparator:UZ.comparator}),this._provider=e.provider}UZ.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};UZ.prototype.addSubtree=function(e,t){let n=new dAt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};UZ.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],d=c.rootId,u=c.subtree.implicitCoordinates;if(d===e&&u.level===o&&u.x===r&&u.y===s)return c.subtree}};UZ.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,s=r.subtreeLevels,a=_oe(r,0,0,0),c=this.find(o,a);if(c===void 0)return;let d=c.implicitCoordinates,u=d.x,m=d.y,p=d.level,b=-W.PI,f=+W.PI,y=W.lerp(b,f,o/2),_=W.lerp(b,f,(o+1)/2),S=-W.PI*.5,Z=+W.PI*.5,R=0,C=0,E=!0;for(;E;){let L=1/(1<<p),F=(_-y)*L,I=y+u*F,N=(Z-S)*L,g=S+m*N;R=(t-I)/F,C=(n-g)/N;let V=nve(r,d,R,C,s);if(c.childSubtreeIsAvailableAtCoordinates(V)){let G=this.find(o,V);if(G!==void 0)c=G,d=c.implicitCoordinates,u=d.x,m=d.y,p=d.level;else return V}else E=!1}let A;for(let L=0;L<s;L++){let F=nve(r,d,R,C,L);if(c.tileIsAvailableAtCoordinates(F))A=F;else break}return A};function nve(e,t,n,i,o){let r=1<<o,s=W.clamp(n*r|0,0,r-1),a=W.clamp(i*r|0,0,r-1),c=_oe(e,o,s,a);return t.getDescendantCoordinates(c)}UZ.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Soe=A0;var aro=x(T(),1);var Xoo=x(T(),1);function TT(e){e=e??B.EMPTY_OBJECT,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=BH(e.westIndices,o,t),this._southIndices=BH(e.southIndices,r,t),this._eastIndices=BH(e.eastIndices,o,t),this._northIndices=BH(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(TT.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 OH=[];function BH(e,t,n){OH.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)OH[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(OH.sort(t),Oe.createTypedArray(n,OH)):e}var rve="createVerticesFromQuantizedTerrainMesh",uAt=new $n(rve),mAt=new $n(rve,ou.maximumAsynchronousTasks);TT.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),m=(a?mAt:uAt).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(m))return;let p=this;return Promise.resolve(m).then(function(b){let f=p._quantizedVertices.length/3,y=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Oe.createTypedArray(y,b.indices),S=new Float32Array(b.vertices),Z=b.center,R=b.minimumHeight,C=b.maximumHeight,E=p._boundingSphere,A=p._orientedBoundingBox,L=h.clone(b.occludeePointInScaledSpace)??p._horizonOcclusionPoint,F=b.vertexStride,I=Cr.clone(b.encoding);return p._mesh=new yc(Z,S,_,b.indexCountWithoutSkirts,f,R,C,d,E,L,F,A,I,b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.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 hAt=new $n("upsampleQuantizedTerrainMesh",ou.maximumAsynchronousTasks);TT.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,m=e.tileXYToRectangle(o,r,s),p=hAt.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:m,ellipsoid:u});if(!l(p))return;let b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);let f=c?b*.5:this._westSkirtHeight,y=d?b*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:b*.5,S=d?this._northSkirtHeight:b*.5,Z=this._credits;return Promise.resolve(p).then(function(R){let C=new Uint16Array(R.vertices),E=Oe.createTypedArray(C.length/3,R.indices),A;return l(R.encodedNormals)&&(A=new Uint8Array(R.encodedNormals)),new TT({quantizedVertices:C,indices:E,encodedNormals:A,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:de.clone(R.boundingSphere),orientedBoundingBox:tn.clone(R.orientedBoundingBox),horizonOcclusionPoint:h.clone(R.horizonOcclusionPoint),westIndices:R.westIndices,southIndices:R.southIndices,eastIndices:R.eastIndices,northIndices:R.northIndices,westSkirtHeight:f,southSkirtHeight:y,eastSkirtHeight:_,northSkirtHeight:S,childTileMask:0,credits:Z,createdByUpsampling:!0})})};var Zoe=32767,sve=new h;TT.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Zoe;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Zoe,l(this._mesh)?gAt(this,i,o):yAt(this,i,o)};function ave(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),m=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=m}var fAt=new k,pAt=new k,bAt=new k;function gAt(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],m=s[a+2],p=r.decodeTextureCoordinates(o,d,fAt),b=r.decodeTextureCoordinates(o,u,pAt),f=r.decodeTextureCoordinates(o,m,bAt);if(ave(t,n,p.x,p.y,b.x,b.y,f.x,f.y)){let y=Qf.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,sve);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let _=r.decodeHeight(o,d),S=r.decodeHeight(o,u),Z=r.decodeHeight(o,m);return y.x*_+y.y*S+y.z*Z}}}}function yAt(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],m=s[a+2],p=i[d],b=i[u],f=i[m],y=o[d],_=o[u],S=o[m];if(ave(t,n,p,y,b,_,f,S)){let Z=Qf.computeBarycentricCoordinates(t,n,p,y,b,_,f,S,sve);if(Z.x>=-1e-15&&Z.y>=-1e-15&&Z.z>=-1e-15){let R=Z.x*r[d]+Z.y*r[u]+Z.z*r[m];return W.lerp(e._minimumHeight,e._maximumHeight,R/Zoe)}}}}TT.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};TT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var DZ=TT;function xAt(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 lve(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=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=[]}lve.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 dve(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}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 y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new to({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Xr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}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 m=t.metadataAvailability,p=t.available,b;if(l(p)&&!l(m)){b=new jf(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let _=p[y],S=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let Z=0;Z<_.length;++Z){let R=_[Z],C=S-R.endY-1,E=S-R.startY-1;e.overallAvailability[y].push([R.startX,C,R.endX,E]),b.addAvailableTileRange(y,R.startX,C,R.endX,E)}}}else l(m)&&(u=new jf(e.tilingScheme,d),b=new jf(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],b.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 xAt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:b,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(b)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Voe(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function TAt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Voe(e,n);throw new ae(i)}async function _At(e,t,n){await dve(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new jf(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 Lt(e.attribution);e.tileCredits.push(o)}return!0}async function Voe(e,t){try{let n=await e.layerJsonResource.fetchJson();return _At(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await dve(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):TAt(e,n,t)}}function $f(e){e=e??B.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new Se;let t=e.credit;typeof t=="string"&&(t=new Lt(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 Roe={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function cve(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 SAt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Mc({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 ZAt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*d,b=Uint16Array.BYTES_PER_ELEMENT*3,f=3,y=Uint16Array.BYTES_PER_ELEMENT,_=y*f,S=new DataView(t),Z=new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let R=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let C=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=new de(new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0)),S.getFloat64(a+u,!0));a+=m;let A=new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let L=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let F=new Uint16Array(t,a,L*3);a+=L*b,L>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,_=y*f);let I=F.subarray(0,L),N=F.subarray(L,2*L),g=F.subarray(L*2,3*L);dn.zigZagDeltaDecode(I,N,g),a%y!==0&&(a+=y-a%y);let V=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Oe.createTypedArrayFromArrayBuffer(L,t,a,V*f);a+=V*_;let v=0,X=G.length;for(let he=0;he<X;++he){let Ze=G[he];G[he]=v-Ze,Ze===0&&++v}let Y=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Oe.createTypedArrayFromArrayBuffer(L,t,a,Y);a+=Y*y;let w=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Oe.createTypedArrayFromArrayBuffer(L,t,a,w);a+=w*y;let M=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Oe.createTypedArrayFromArrayBuffer(L,t,a,M);a+=M*y;let K=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Oe.createTypedArrayFromArrayBuffer(L,t,a,K);a+=K*y;let H,$;for(;a<S.byteLength;){let he=S.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let Ze=S.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,he===Roe.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,L*2);else if(he===Roe.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,Ze);else if(he===Roe.METADATA&&e._requestMetadata){let ye=S.getUint32(a,!0);if(ye>0){let Ae=vr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ye).available;if(l(Ae))for(let Fe=0;Fe<Ae.length;++Fe){let tt=n+Fe+1,Be=Ae[Fe],je=e._tilingScheme.getNumberOfYTilesAtLevel(tt);for(let qe=0;qe<Be.length;++qe){let We=Be[qe],Ke=je-We.endY-1,ct=je-We.startY-1;e.availability.addAvailableTileRange(tt,We.startX,Ke,We.endX,ct),r.availability.addAvailableTileRange(tt,We.startX,Ke,We.endX,ct)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=Ze}let ee=e.getLevelMaximumGeometricError(n)*5,le=e._tilingScheme.tileXYToRectangle(i,o,n),_e=tn.fromRectangle(le,R,C,e._tilingScheme.ellipsoid);return new DZ({center:Z,minimumHeight:R,maximumHeight:C,boundingSphere:E,orientedBoundingBox:_e,horizonOcclusionPoint:A,quantizedVertices:F,encodedNormals:H,indices:G,westIndices:D,southIndices:O,eastIndices:z,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:$,credits:e._tileCredits})}$f.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 m=Eoe(this,e,t,n,u,d===0);m.result&&(a=!0,c=c.then(()=>m.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):uve(this,e,t,n,r,i)};function uve(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,m=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=cve(void 0)):d=cve(c);let b=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(b))return b.then(function(f){return l(f)?l(e._heightmapStructure)?SAt(e,f,i,t,n):ZAt(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties($f.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}}});$f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};$f.fromIonAssetId=async function(e,t){let n=await Ur.fromAssetId(e);return $f.fromUrl(n,t)};$f.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=new lve(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Voe(i);let o=new $f(t);return i.build(o),o};$f.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(Eoe(this,e,t,n,i[r],r===0).result)return;return!1};$f.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=Eoe(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Coe(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 Eoe(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=Coe(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 m;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,m=o.availabilityPromiseCache[s],!l(m))){let p=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});m=uve(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=Coe(o,u.x,u.y,u.level)}return{result:!1}}$f._getAvailabilityTile=Coe;var OZ=$f;var pro=x(T(),1);function $g(e){e=e??B.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 dd(n),this._workerName="createCircleGeometry"}$g.packedLength=dd.packedLength;$g.pack=function(e,t,n){return dd.pack(e._ellipseGeometry,t,n)};var mve=new dd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),kc={center:new h,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new we,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};$g.unpack=function(e,t,n){let i=dd.unpack(e,t,mve);return kc.center=h.clone(i._center,kc.center),kc.ellipsoid=ne.clone(i._ellipsoid,kc.ellipsoid),kc.ellipsoid=ne.clone(i._ellipsoid,mve._ellipsoid),kc.height=i._height,kc.extrudedHeight=i._extrudedHeight,kc.granularity=i._granularity,kc.vertexFormat=we.clone(i._vertexFormat,kc.vertexFormat),kc.stRotation=i._stRotation,kc.shadowVolume=i._shadowVolume,l(n)?(kc.semiMajorAxis=i._semiMajorAxis,kc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new dd(kc),n):(kc.radius=i._semiMajorAxis,new $g(kc))};$g.createGeometry=function(e){return dd.createGeometry(e._ellipseGeometry)};$g.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new $g({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:we.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties($g.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Aoe=$g;var Sro=x(T(),1);function eA(e){e=e??B.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 Ju(n),this._workerName="createCircleOutlineGeometry"}eA.packedLength=Ju.packedLength;eA.pack=function(e,t,n){return Ju.pack(e._ellipseGeometry,t,n)};var RAt=new Ju({center:new h,semiMajorAxis:1,semiMinorAxis:1}),rm={center:new h,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};eA.unpack=function(e,t,n){let i=Ju.unpack(e,t,RAt);return rm.center=h.clone(i._center,rm.center),rm.ellipsoid=ne.clone(i._ellipsoid,rm.ellipsoid),rm.height=i._height,rm.extrudedHeight=i._extrudedHeight,rm.granularity=i._granularity,rm.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(rm.semiMajorAxis=i._semiMajorAxis,rm.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Ju(rm),n):(rm.radius=i._semiMajorAxis,new eA(rm))};eA.createGeometry=function(e){return Ju.createGeometry(e._ellipseGeometry)};var Goe=eA;var Rro=x(T(),1);function CAt(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),o=i.createLinearGradient(0,0,n.width,0),r=1/(e.length-1);for(let c=0;c<e.length;c++){let d=e[c],u=c*r,m=d.toCssColorString();o.addColorStop(u,m)}i.fillStyle=o,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var NM=CAt;var Aro=x(T(),1);function VAt(e){return e=e??B.EMPTY_OBJECT,OZ.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var YM=VAt;var Fro=x(T(),1);function EAt(e){return e=e??B.EMPTY_OBJECT,OZ.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ne.WGS84})}var BZ=EAt;var Dro=x(T(),1);function tA(e){e=e??B.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new to({ellipsoid:e.ellipsoid??ne.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se;let n=e.credit;typeof n=="string"&&(n=new Lt(n)),this._credit=n}Object.defineProperties(tA.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}}});tA.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 Mc({buffer:c,width:r,height:s})})};tA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};tA.prototype.getTileDataAvailable=function(e,t,n){};tA.prototype.loadTileDataAvailability=function(e,t,n){};var Loe=tA;var zro=x(T(),1);var AAt=1953029805,GAt=2917034100;function Woe(e,t){if(Woe.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===AAt||o===GAt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,m=8;for(;s<c;)for(m=(m+8)%24,u=m;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&&(m=(m+8)%24,u=m);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}Woe.passThroughDataForTesting=!1;var wM=Woe;var Kro=x(T(),1);function hve(e){this.proxy=e}hve.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var voe=hve;var iso=x(T(),1);function nA(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new to({ellipsoid:e.ellipsoid??ne.default})),this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se}Object.defineProperties(nA.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(){}}});nA.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Mc({buffer:new Uint8Array(256),width:16,height:16}))};nA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};nA.prototype.getTileDataAvailable=function(e,t,n){};nA.prototype.loadTileDataAvailability=function(e,t,n){};var G0=nA;var Pso=x(T(),1);var yso=x(T(),1);var mso=x(T(),1);function L0(e){e=e??B.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new $s,this._perspectiveMatrix=new P,this._infinitePerspective=new P}function Foe(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=P.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=P.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(L0.prototype,{projectionMatrix:{get:function(){return Foe(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Foe(this),this._infinitePerspective}}});var LAt=new h,WAt=new h,vAt=new h,FAt=new h;L0.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=h.cross(t,n,LAt),m=WAt;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=vAt;h.multiplyByScalar(t,d,p),h.add(e,p,p);let b=FAt;h.multiplyByScalar(u,a,b),h.add(m,b,b),h.subtract(b,e,b),h.normalize(b,b),h.cross(b,n,b),h.normalize(b,b);let f=i[0];return l(f)||(f=i[0]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(u,s,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(n,b,b),h.normalize(b,b),f=i[1],l(f)||(f=i[1]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(n,r,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(u,b,b),h.normalize(b,b),f=i[2],l(f)||(f=i[2]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(n,o,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(b,u,b),h.normalize(b,b),f=i[3],l(f)||(f=i[3]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),f=i[4],l(f)||(f=i[4]=new ce),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-h.dot(t,m),h.negate(t,b),f=i[5],l(f)||(f=i[5]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,p),this._cullingVolume};L0.prototype.getPixelDimensions=function(e,t,n,i,o){Foe(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};L0.prototype.clone=function(e){return l(e)||(e=new L0),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};L0.prototype.equals=function(e){return l(e)&&e instanceof L0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};L0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof L0&&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 hd=L0;function ru(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new hd,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}ru.packedLength=6;ru.pack=function(e,t,n){return n=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};ru.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ru),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 ep(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(ru.prototype,{projectionMatrix:{get:function(){return ep(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ep(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ep(this),this._fovy}},sseDenominator:{get:function(){return ep(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ep(this),this._offCenterFrustum}}});ru.prototype.computeCullingVolume=function(e,t,n){return ep(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ru.prototype.getPixelDimensions=function(e,t,n,i,o){return ep(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};ru.prototype.clone=function(e){return l(e)||(e=new ru),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};ru.prototype.equals=function(e){return!l(e)||!(e instanceof ru)?!1:(ep(this),ep(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ru.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ru)?!1:(ep(this),ep(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 qi=ru;var zH=0,IAt=1;function zZ(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??we.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof qi?(s=zH,a=qi.packedLength):t instanceof yn&&(s=IAt,a=yn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Ne.packedLength+we.packedLength}zZ.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===zH?(qi.pack(o,t,n),n+=qi.packedLength):(yn.pack(o,t,n),n+=yn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,we.pack(e._vertexFormat,t,n),n+=we.packedLength,t[n]=e._drawNearPlane?1:0,t};var PAt=new qi,XAt=new yn,NAt=new Ne,YAt=new h,wAt=new we;zZ.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===zH?(o=qi.unpack(e,t,PAt),t+=qi.packedLength):(o=yn.unpack(e,t,XAt),t+=yn.packedLength);let r=h.unpack(e,t,YAt);t+=h.packedLength;let s=Ne.unpack(e,t,NAt);t+=Ne.packedLength;let a=we.unpack(e,t,wAt);t+=we.packedLength;let c=e[t]===1;if(!l(n))return new zZ({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=h.clone(r,n._origin),n._orientation=Ne.clone(s,n._orientation),n._vertexFormat=we.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function iA(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 MAt=new q,kAt=new P,Ioe=new P,fve=new h,pve=new h,bve=new h,UAt=new h,DAt=new h,OAt=new h,_T=new Array(3),MM=new Array(4);MM[0]=new ce(-1,-1,1,1);MM[1]=new ce(1,-1,1,1);MM[2]=new ce(1,1,1,1);MM[3]=new ce(-1,1,1,1);var gve=new Array(4);for(let e=0;e<4;++e)gve[e]=new ce;zZ._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=q.fromQuaternion(t,MAt),d=r??fve,u=s??pve,m=a??bve;d=q.getColumn(c,0,d),u=q.getColumn(c,1,u),m=q.getColumn(c,2,m),h.normalize(d,d),h.normalize(u,u),h.normalize(m,m),h.negate(d,d);let p=P.computeView(e,m,u,d,kAt),b,f,y=i.projectionMatrix;if(n===zH){let _=P.multiply(y,p,Ioe);f=P.inverse(_,Ioe)}else b=P.inverseTransformation(p,Ioe);l(f)?(_T[0]=i.near,_T[1]=i.far):(_T[0]=0,_T[1]=i.near,_T[2]=i.far);for(let _=0;_<2;++_)for(let S=0;S<4;++S){let Z=ce.clone(MM[S],gve[S]);if(l(f)){Z=P.multiplyByVector(f,Z,Z);let R=1/Z.w;h.multiplyByScalar(Z,R,Z),h.subtract(Z,e,Z),h.normalize(Z,Z);let C=h.dot(m,Z);h.multiplyByScalar(Z,_T[_]/C,Z),h.add(Z,e,Z)}else{let R=i.offCenterFrustum;l(R)&&(i=R);let C=_T[_],E=_T[_+1];Z.x=(Z.x*(i.right-i.left)+i.left+i.right)*.5,Z.y=(Z.y*(i.top-i.bottom)+i.bottom+i.top)*.5,Z.z=(Z.z*(C-E)-C-E)*.5,Z.w=1,P.multiplyByVector(b,Z,Z)}o[12*_+S*3]=Z.x,o[12*_+S*3+1]=Z.y,o[12*_+S*3+2]=Z.z}};zZ.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(72);zZ._computeNearFarPlanes(i,o,t,n,c);let d=24;c[d]=c[12],c[d+1]=c[13],c[d+2]=c[14],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[9],c[d+7]=c[10],c[d+8]=c[11],c[d+9]=c[21],c[d+10]=c[22],c[d+11]=c[23],d+=12,c[d]=c[15],c[d+1]=c[16],c[d+2]=c[17],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[12],c[d+10]=c[13],c[d+11]=c[14],d+=12,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[15],c[d+4]=c[16],c[d+5]=c[17],c[d+6]=c[18],c[d+7]=c[19],c[d+8]=c[20],c[d+9]=c[6],c[d+10]=c[7],c[d+11]=c[8],d+=12,c[d]=c[6],c[d+1]=c[7],c[d+2]=c[8],c[d+3]=c[18],c[d+4]=c[19],c[d+5]=c[20],c[d+6]=c[21],c[d+7]=c[22],c[d+8]=c[23],c[d+9]=c[9],c[d+10]=c[10],c[d+11]=c[11],r||(c=c.subarray(12));let u=new Rn({position:new Xe({componentDatatype:J.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,b=l(s.tangent)?new Float32Array(12*a):void 0,f=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,_=fve,S=pve,Z=bve,R=h.negate(_,UAt),C=h.negate(S,DAt),E=h.negate(Z,OAt);d=0,r&&(iA(d,p,b,f,y,E,_,S),d+=12),iA(d,p,b,f,y,Z,R,S),d+=12,iA(d,p,b,f,y,R,E,S),d+=12,iA(d,p,b,f,y,C,E,R),d+=12,iA(d,p,b,f,y,_,Z,S),d+=12,iA(d,p,b,f,y,S,Z,R),l(p)&&(u.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),l(b)&&(u.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),l(f)&&(u.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),l(y)&&(u.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:y}))}let m=new Uint16Array(6*a);for(let p=0;p<a;++p){let b=p*6,f=p*4;m[b]=f,m[b+1]=f+1,m[b+2]=f+2,m[b+3]=f,m[b+4]=f+2,m[b+5]=f+3}return new At({attributes:u,indices:m,primitiveType:Ie.TRIANGLES,boundingSphere:de.fromVertices(c)})};var HZ=zZ;var Jso=x(T(),1);var Poe=0,BAt=1;function kM(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof qi?(r=Poe,s=qi.packedLength):t instanceof yn&&(r=BAt,s=yn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Ne.packedLength}kM.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Poe?(qi.pack(o,t,n),n+=qi.packedLength):(yn.pack(o,t,n),n+=yn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,t[n]=e._drawNearPlane?1:0,t};var zAt=new qi,HAt=new yn,KAt=new Ne,JAt=new h;kM.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Poe?(o=qi.unpack(e,t,zAt),t+=qi.packedLength):(o=yn.unpack(e,t,HAt),t+=yn.packedLength);let r=h.unpack(e,t,JAt);t+=h.packedLength;let s=Ne.unpack(e,t,KAt);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new kM({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=h.clone(r,n._origin),n._orientation=Ne.clone(s,n._orientation),n._drawNearPlane=a,n};kM.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);HZ._computeNearFarPlanes(i,o,t,n,s);let a=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,m=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,m[c]=d,m[c+1]=d+1,m[c+2]=d+1,m[c+3]=d+2,m[c+4]=d+2,m[c+5]=d+3,m[c+6]=d+3,m[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,m[c]=d,m[c+1]=d+4,m[c+2]=d+1,m[c+3]=d+5,m[c+4]=d+2,m[c+5]=d+6,m[c+6]=d+3,m[c+7]=d+7;return new At({attributes:a,indices:m,primitiveType:Ie.LINES,boundingSphere:de.fromVertices(s)})};var UM=kM;var eao=x(T(),1);function HH(){ge.throwInstantiationError()}Object.defineProperties(HH.prototype,{credit:{get:ge.throwInstantiationError}});HH.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Lt.getIonCredit)};HH.prototype.geocode=ge.throwInstantiationError;var oA=HH;var nao=x(T(),1),yve={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(yve);var ST=yve;var rao=x(T(),1);function xve(){ge.throwInstantiationError()}xve.createGeometry=function(e){ge.throwInstantiationError()};var Xoe=xve;var aao=x(T(),1);function jAt(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 DM=jAt;var Aao=x(T(),1),nGt=x(Noe(),1);var pao=x(T(),1);var uao=x(T(),1);function QAt(e,t){return(e&t)!==0}var _l=QAt;var qAt=[1,2,4,8],Tve=15,$At=16,eGt=64,tGt=128;function W0(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}W0.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 W0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};W0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};W0.prototype.hasSubtree=function(){return _l(this._bits,$At)};W0.prototype.hasImagery=function(){return _l(this._bits,eGt)};W0.prototype.hasTerrain=function(){return _l(this._bits,tGt)};W0.prototype.hasChildren=function(){return _l(this._bits,Tve)};W0.prototype.hasChild=function(e){return _l(this._bits,qAt[e])};W0.prototype.getChildBitmask=function(){return this._bits&Tve};var BM=W0;function iGt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var oGt=iGt(`E\xF4\xBD\vy\xE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,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(sm.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});sm.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash();let i=new sm;i._resource=n;try{await rGt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${Sve(i,"",1).url}: ${o}`;throw new ae(r)}return i};sm.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;_l(t,r)?_l(e,r)&&(s|=1):(s|=2,_l(e,r)||(s|=1)),i+=s}return i};sm.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];_l(s,2)?_l(s,1)||(t|=r):(n|=r,_l(s,1)&&(t|=r))}return{x:t,y:n,level:i}};sm.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 _ve=new $n("decodeGoogleEarthEnterprisePacket");sm.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=Sve(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return _ve.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,m=-1;if(e!==""){m=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,y){return f.length-y.length});let b=p.length;for(let f=0;f<b;++f){let y=p[f];if(d[y]!==null){let S=BM.clone(d[y]),Z=y.length;if(Z===m)S.setParent(u);else if(Z>1){let R=r[y.substring(0,y.length-1)];S.setParent(R)}r[y]=S}else r[y]=null}})})};sm.prototype.populateSubtree=function(e,t,n,i){let o=sm.tileXYToQuadKey(e,t,n);return Moe(this,o,i)};function Moe(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 Ar({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Moe(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 Ar({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Moe(e,t,s)}).finally(function(){delete a[o]})}sm.prototype.getTileInformation=function(e,t,n){let i=sm.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};sm.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Sve(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Yoe,woe;function rGt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(woe)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;woe=jT(n).then(function(){Yoe=window.cesiumGoogleEarthDbRootParser(nGt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return woe.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Yoe.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 _ve.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Yoe.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=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 Lt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=oGt})}var ey=sm;var Bao=x(T(),1);function KZ(e){e=e??B.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(KZ.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Cve="createVerticesFromGoogleEarthEnterpriseBuffer",sGt=new $n(Cve),aGt=new $n(Cve,ou.maximumAsynchronousTasks),Zve=new re,KH=new re;KZ.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Zve),t.tileXYToRectangle(n,i,o,KH);let d=c.cartographicToCartesian(re.center(KH)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let b=(a?aGt:sGt).scheduleTask({buffer:this._buffer,nativeRectangle:Zve,rectangle:KH,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(b))return;let f=this;return b.then(function(y){return f._mesh=new yc(d,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,KH,de.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,tn.clone(y.orientedBoundingBox),Cr.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),f._minimumHeight=y.minimumHeight,f._maximumHeight=y.maximumHeight,f._buffer=void 0,f._mesh})};KZ.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)?mGt(this,i,o):pGt(this,i,o,e)};var cGt=new $n("upsampleQuantizedTerrainMesh",ou.maximumAsynchronousTasks);KZ.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,m=e.tileXYToRectangle(o,r,s),p=cGt.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:m,ellipsoid:u});if(!l(p))return;let b=this;return p.then(function(f){let y=new Uint16Array(f.vertices),_=Oe.createTypedArray(y.length/3,f.indices),S=b._skirtHeight;return new DZ({quantizedVertices:y,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:de.clone(f.boundingSphere),orientedBoundingBox:tn.clone(f.orientedBoundingBox),horizonOcclusionPoint:h.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:S,southSkirtHeight:S,eastSkirtHeight:S,northSkirtHeight:S,childTileMask:0,createdByUpsampling:!0,credits:b._credits})})};KZ.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};KZ.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var lGt=new k,dGt=new k,uGt=new k,Vve=new h;function mGt(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],m=s[a+2],p=r.decodeTextureCoordinates(o,d,lGt),b=r.decodeTextureCoordinates(o,u,dGt),f=r.decodeTextureCoordinates(o,m,uGt),y=Qf.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,Vve);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let _=r.decodeHeight(o,d),S=r.decodeHeight(o,u),Z=r.decodeHeight(o,m);return y.x*_+y.y*S+y.z*Z}}}var hGt=Uint16Array.BYTES_PER_ELEMENT,Rve=Uint32Array.BYTES_PER_ELEMENT,koe=Int32Array.BYTES_PER_ELEMENT,fGt=Float32Array.BYTES_PER_ELEMENT,Uoe=Float64Array.BYTES_PER_ELEMENT;function pGt(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 E=0;E<r;++E)d+=c.getUint32(d,!0),d+=Rve;d+=Rve,d+=2*Uoe;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=Uoe;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=Uoe;let p=i.width/u/2,b=i.height/m/2,f=c.getInt32(d,!0);d+=koe;let y=c.getInt32(d,!0)*3;d+=koe,d+=koe;let _=new Array(f),S=new Array(f),Z=new Array(f),R;for(R=0;R<f;++R)_[R]=s+c.getUint8(d++)*p,S[R]=a+c.getUint8(d++)*b,Z[R]=c.getFloat32(d,!0)*6371010,d+=fGt;let C=new Array(y);for(R=0;R<y;++R)C[R]=c.getUint16(d,!0),d+=hGt;for(R=0;R<y;R+=3){let E=C[R],A=C[R+1],L=C[R+2],F=_[E],I=_[A],N=_[L],g=S[E],V=S[A],G=S[L],v=Qf.computeBarycentricCoordinates(t,n,F,g,I,V,N,G,Vve);if(v.x>=-1e-15&&v.y>=-1e-15&&v.z>=-1e-15)return v.x*Z[E]+v.y*Z[A]+v.z*Z[L]}}var rA=KZ;var lco=x(T(),1);var xh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},JH=new Q;function jH(){this._terrainCache={},this._lastTidy=Q.now()}jH.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};jH.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};jH.prototype.tidy=function(){if(Q.now(JH),Q.secondsDifference(JH,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(JH,r.timestamp)>10&&delete e[o]}Q.clone(JH,this._lastTidy)}};function ZT(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=new to({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new jH,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Se}Object.defineProperties(ZT.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(){}}});ZT.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new ZT(t);return n._metadata=e,n};var bGt=new $n("decodeGoogleEarthEnterprisePacket");function Eve(e,t,n){let i=t.getChildBitmask();if(t.terrainState===xh.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}ZT.prototype.requestTileGeometry=function(e,t,n,i){let o=ey.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=xh.UNKNOWN);let d=r.get(o);if(l(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new rA({buffer:d,childTileMask:Eve(o,a,s),credits:l(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===xh.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new Mc({buffer:new Uint8Array(256),width:16,height:16}));let u,m=o,p=-1;switch(c){case xh.SELF:p=a.terrainVersion;break;case xh.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case xh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let b=this._terrainPromises,f=this._terrainRequests,y,_;if(l(b[m]))y=b[m],_=f[m];else{_=i;let S=gGt(this,m,p,_).fetchArrayBuffer();if(!l(S))return;y=S.then(function(Z){return l(Z)?bGt.scheduleTask({buffer:Z,type:"Terrain",key:s.key},[Z]).then(function(R){let C=s.getTileInformationFromQuadKey(m);C.terrainState=xh.SELF,r.add(m,R[0]);let E=C.terrainProvider,A=R.length-1;for(let L=0;L<A;++L){let F=m+L.toString(),I=s.getTileInformationFromQuadKey(F);l(I)&&(r.add(F,R[L+1]),I.terrainState=xh.PARENT,I.terrainProvider===0&&(I.terrainProvider=E))}}):Promise.reject(new ae("Failed to load terrain."))}),b[m]=y,f[m]=_,y=y.finally(function(){delete b[m],delete f[m]})}return y.then(function(){let S=r.get(o);if(l(S)){let Z=s.providers[a.terrainProvider];return new rA({buffer:S,childTileMask:Eve(o,a,s),credits:l(Z)?[Z]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(S){return _.state===Ri.CANCELLED?(i.state=_.state,Promise.reject(S)):(a.terrainState=xh.NONE,Promise.reject(S))})};ZT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ZT.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=ey.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===xh.NONE)return!1;if((!l(s)||s===xh.UNKNOWN)&&(r.terrainState=xh.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 Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};ZT.prototype.loadTileDataAvailability=function(e,t,n){};function gGt(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 Doe=ZT;var bco=x(T(),1);var yGt="https://maps.googleapis.com/maps/api/geocode/json",Ave='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function Ooe(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._resource=new ve({url:yGt,queryParameters:{key:t}}),this._credit=new Lt(Ave,!0)}Object.defineProperties(Ooe.prototype,{credit:{get:function(){return this._credit}}});Ooe.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:re.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:Ave,collapsible:!1}}})};var Boe=Ooe;var Cco=x(T(),1);var yco=x(T(),1);function xGt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var zM=xGt;var Uve={},TGt=32.184,_Gt=2451545,Gve=-.0529921,Lve=-.1059842,Wve=13.0120009,vve=13.3407154,Fve=.9856003,Ive=26.4057084,Pve=13.064993,Xve=.3287146,Nve=1.7484877,Yve=-.1589763,wve=.0036096,Mve=.1643573,kve=12.9590088,zoe=new Q;Uve.ComputeMoon=function(e,t){l(e)||(e=Q.now()),zoe=Q.addSeconds(e,TGt,zoe);let n=Q.totalDays(zoe)-_Gt,i=n/Mn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Gve*n)*W.RADIANS_PER_DEGREE,r=(250.089+Lve*n)*W.RADIANS_PER_DEGREE,s=(260.008+Wve*n)*W.RADIANS_PER_DEGREE,a=(176.625+vve*n)*W.RADIANS_PER_DEGREE,c=(357.529+Fve*n)*W.RADIANS_PER_DEGREE,d=(311.589+Ive*n)*W.RADIANS_PER_DEGREE,u=(134.963+Pve*n)*W.RADIANS_PER_DEGREE,m=(276.617+Xve*n)*W.RADIANS_PER_DEGREE,p=(34.226+Nve*n)*W.RADIANS_PER_DEGREE,b=(15.134+Yve*n)*W.RADIANS_PER_DEGREE,f=(119.743+wve*n)*W.RADIANS_PER_DEGREE,y=(239.961+Mve*n)*W.RADIANS_PER_DEGREE,_=(25.053+kve*n)*W.RADIANS_PER_DEGREE,S=Math.sin(o),Z=Math.sin(r),R=Math.sin(s),C=Math.sin(a),E=Math.sin(c),A=Math.sin(d),L=Math.sin(u),F=Math.sin(m),I=Math.sin(p),N=Math.sin(b),g=Math.sin(f),V=Math.sin(y),G=Math.sin(_),v=Math.cos(o),X=Math.cos(r),Y=Math.cos(s),D=Math.cos(a),w=Math.cos(c),O=Math.cos(d),M=Math.cos(u),z=Math.cos(m),K=Math.cos(p),te=Math.cos(b),H=Math.cos(f),$=Math.cos(y),ee=Math.cos(_),le=(269.9949+.0031*i-3.8787*S-.1204*Z+.07*R-.0172*C+.0072*A-.0052*N+.0043*G)*W.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*v+.0239*X-.0278*Y+.0068*D-.0029*O+9e-4*M+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,he=(38.3213+13.17635815*n-14e-13*n*n+3.561*S+.1208*Z-.0642*R+.0158*C+.0252*E-.0066*A-.0047*L-.0046*F+.0028*I+.0052*N+.004*g+.0019*V-.0044*G)*W.RADIANS_PER_DEGREE,Ze=(13.17635815-14e-13*(2*n)+3.561*v*Gve+.1208*X*Lve-.0642*Y*Wve+.0158*D*vve+.0252*w*Fve-.0066*O*Ive-.0047*M*Pve-.0046*z*Xve+.0028*K*Nve+.0052*te*Yve+.004*H*wve+.0019*$*Mve-.0044*ee*kve)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new zM),t.rightAscension=le,t.declination=_e,t.rotation=he,t.rotationRate=Ze,t};var HM=Uve;var Ico=x(T(),1);function Dve(e){(!l(e)||typeof e!="function")&&(e=HM.ComputeMoon),this._computeFunction=e}var SGt=new h,ZGt=new h,RGt=new h;function CGt(e,t,n){let i=SGt;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=RGt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,ZGt);return l(n)||(n=new q),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 VGt=new q,EGt=new Ne;Dve.prototype.evaluate=function(e,t){l(e)||(e=Q.now());let n=this._computeFunction(e),i=CGt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Ne.fromAxisAngle(h.UNIT_Z,o,EGt),s=q.fromQuaternion(Ne.conjugate(r,r),VGt);return q.multiply(s,i,i)};var KM=Dve;var Nco=x(T(),1);var Hoe=class{constructor(){mt(this,"type")}getRequiredDataPoints(t){ge.throwInstantiationError()}interpolateOrderZero(t,n,i,o,r){ge.throwInstantiationError()}interpolate(t,n,i,o,r,s,a){ge.throwInstantiationError()}},Koe=Hoe;var Mco=x(T(),1),Ove={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(Ove);var ty=Ove;var ilo=x(T(),1);var Hco=x(T(),1);function Joe(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Joe.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Joe.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===ST.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=re.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var JM=Joe;function AGt(e){if(!Object.values(ty).some(t=>t===e))throw new ge(`Invalid geocodeProviderType: "${e}"`)}var Bve=Object.freeze({[ty.GOOGLE]:"google",[ty.BING]:"bing",[ty.DEFAULT]:void 0});function GGt(e){return Bve[e]}function LGt(e){return Object.entries(Bve).find(t=>t[1]===e)[0]}function joe(e){e=e??B.EMPTY_OBJECT;let t=e.geocodeProviderType??ty.DEFAULT,n=e.accessToken??Wd.defaultAccessToken,i=ve.createIfNeeded(e.server??Wd.defaultServer);i.appendForwardSlash();let o=Wd.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Lt.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 JM(r),this.geocodeProviderType=t}Object.defineProperties(joe.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return LGt(this._pelias.url.queryParameters.geocoder)},set:function(e){AGt(e);let t={...this._pelias.url.queryParameters,geocoder:GGt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});joe.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var JZ=joe;var rlo=x(T(),1),zve={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(zve);var Qoe=zve;var alo=x(T(),1),Hve={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(Hve);var qoe=Hve;var llo=x(T(),1),Kve={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(Kve);var jM=Kve;var ulo=x(T(),1),Jve={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(Jve);var $oe=Jve;var Clo=x(T(),1);function jve(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function Qve(e){let t=pe.fromCartesian(e);return{longitude:W.toDegrees(t.longitude),latitude:W.toDegrees(t.latitude),height:t.height}}function WGt(e){let t=[],n=new ce;for(let i=0;i<4;i++)P.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function vGt(e,t,n){return P.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var FGt=new P,IGt=new P,QH=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??B.EMPTY_OBJECT;let i=n.accessToken??Wd.defaultAccessToken,o=ve.createIfNeeded(n.server??Wd.defaultServer);o.appendForwardSlash();let r={url:`assets/${t}/`,headers:Ur._addClientHeaders()};l(i)&&(r.queryParameters={access_token:i});let s=o.getDerivedResource(r),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new ae(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=P.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,o){o=o??new P;let r=vGt(n,i,FGt);return P.multiply(t.viewMatrix,this.ecefTransform,o),P.multiply(t.frustum.projectionMatrix,o,o),P.multiply(r,o,o)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,IGt),i={testPoint:Qve(t.testPoint),closePoint:Qve(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??jM.NEAREST,worldToView:WGt(n)},o;try{o=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(o))return;let r={heat:o.heat,geometryType:o.geomType,parentGeometryType:o.parentGeomType,normal:o.normal,curve:o.curve};return r.snapPoint=jve(o.snapPoint),r.hitPoint=jve(o.hitPoint),r}};QH.DEFAULT_SNAP_APERTURE=12;var ere=QH;var Llo=x(T(),1);var aa={};aa.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});aa.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});aa.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});aa.defaultAccessToken=void 0;aa.defaultShareKey=void 0;aa._getAuthorizationHeader=function(){return l(aa.defaultShareKey)?`Basic ${aa.defaultShareKey}`:`Bearer ${aa.defaultAccessToken}`};aa.apiEndpoint=new ve({url:"https://api.bentley.com"});aa.getExports=async function(e,t){let n=new ve({url:`${aa.apiEndpoint}mesh-export`,headers:{Authorization:aa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:aa.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};aa.getRealityDataMetadata=async function(e,t){let n=new ve({url:`${aa.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:aa._getAuthorizationHeader(),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);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};aa.getRealityDataURL=async function(e,t,n){let i=new ve({url:`${aa.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:aa._getAuthorizationHeader(),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);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var ca=aa;var vlo=x(T(),1),qve={SHIFT:0,CTRL:1,ALT:2};Object.freeze(qve);var ir=qve;var Plo=x(T(),1);var tre=class{constructor(){mt(this,"ellipsoid")}project(t,n){ge.throwInstantiationError()}unproject(t,n){ge.throwInstantiationError()}},nre=tre;var Ylo=x(T(),1);var ire=[],ore=[];function PGt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=ire,d=ore,u,m;for(u=0;u<s;++u)c[u]=e[i+u];for(m=0;m<a;++m)d[m]=e[o+m+1];u=0,m=0;for(let p=i;p<=r;++p){let b=c[u],f=d[m];u<s&&(m>=a||t(b,f,n)<=0)?(e[p]=b,++u):m<a&&(e[p]=f,++m)}}function rre(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);rre(e,t,n,i,r),rre(e,t,n,r+1,o),PGt(e,t,n,i,r,o)}function XGt(e,t,n){let i=e.length,o=Math.ceil(i*.5);ire.length=o,ore.length=o,rre(e,t,n,0,i-1),ire.length=0,ore.length=0}var v0=XGt;var Dlo=x(T(),1);function sA(e){e=e??B.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(sA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});sA.prototype.findTimeInterval=vo.prototype.findTimeInterval;sA.prototype.wrapTime=vo.prototype.wrapTime;sA.prototype.clampTime=vo.prototype.clampTime;sA.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 sre=sA;var edo=x(T(),1);var Blo=x(T(),1),$ve={NONE:-1,PARTIAL:0,FULL:1};Object.freeze($ve);var Jr=$ve;function Sl(e,t){this._occluderPosition=h.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 qH=new h;Object.defineProperties(Sl.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,qH),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,qH);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,qH),qH)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Sl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Sl(e,t)};var t2e=new h;Sl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,t2e),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var NGt=new h;Sl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,NGt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,t2e),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.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 YGt=new h;Sl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Jr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,YGt),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?Jr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Jr.FULL:Jr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Jr.PARTIAL:Jr.FULL))}}return Jr.NONE};var $H=new h;Sl.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,$H),$H),c=-h.dot(a,o),d=Sl._anyRotationVector(o,a,c),u=Sl._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let b=1;b<s;++b){if(m=Sl._horizonToPlaneNormalDotProduct(e,a,c,d,n[b]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,$H),$H)};var wGt=[];Sl.computeOccludeePointFromRectangle=function(e,t){t=t??ne.default;let n=re.subsample(e,t,0,wGt),i=de.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Sl.computeOccludeePoint(new de(o,t.minimumRadius),i.center,n)};var MGt=new h;Sl._anyRotationVector=function(e,t,n){let i=h.abs(t,MGt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var kGt=new h;Sl._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,kGt);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>W.EPSILON13)return h.normalize(s,new h)}return o};var are=new h,UGt=new h,eK=new h,e2e=new h;Sl._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,are),s=h.clone(e.center,UGt),a=e.radius,c=h.subtract(s,r,eK),d=h.magnitudeSquared(c),u=a*a;if(d<u)return!1;let m=d-u,p=Math.sqrt(m),f=1/Math.sqrt(d),_=p*f*p;c=h.normalize(c,c);let S=h.add(r,h.multiplyByScalar(c,_,e2e),e2e),Z=Math.sqrt(m-_*_),R=this._rotationVector(s,t,n,r,i),C=h.fromElements(R.x*R.x*c.x+(R.x*R.y-R.z)*c.y+(R.x*R.z+R.y)*c.z,(R.x*R.y+R.z)*c.x+R.y*R.y*c.y+(R.y*R.z-R.x)*c.z,(R.x*R.z-R.y)*c.x+(R.y*R.z+R.x)*c.y+R.z*R.z*c.z,are);C=h.normalize(C,C);let E=h.multiplyByScalar(C,Z,are);R=h.normalize(h.subtract(h.add(S,E,eK),s,eK),eK);let A=h.dot(t,R);R=h.normalize(h.subtract(h.subtract(S,E,R),s,R),R);let L=h.dot(t,R);return A<L?A:L};var QM=Sl;var cdo=x(T(),1);function cre(e,t,n){e=ve.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Lt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(cre.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});cre.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:It(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=re.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let{lng:s,lat:a}=i.geometry;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var lre=cre;var udo=x(T(),1);var DGt={packedLength:void 0,pack:ge.throwInstantiationError,unpack:ge.throwInstantiationError},dre=DGt;var fdo=x(T(),1);var OGt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:ge.throwInstantiationError,unpackInterpolationResult:ge.throwInstantiationError},ure=OGt;var xdo=x(T(),1);var BGt=new h;function zGt(e,t,n,i){let o=i_(e,t,n,i,BGt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var mre=zGt;var Sdo=x(T(),1);function n2e(){ge.throwInstantiationError()}n2e.prototype.getURL=ge.throwInstantiationError;var hre=n2e;var Cdo=x(T(),1);async function HGt(e,t,n,i){return l(i)||(i=!1),jGt(e,t,n,i)}function KGt(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(o2e(i)):r=o.then(o2e(i)).catch(QGt(i)),e.shift(),t.push(r),!0}function JGt(e){return new Promise(function(t){setTimeout(t,e)})}function fre(e,t,n){return e.length?KGt(e,t,n)?fre(e,t,n):JGt(100).then(()=>fre(e,t,n)):Promise.resolve()}function jGt(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 m={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=m,s.push(m)}a[u].positions.push(n[r])}let c=[];return fre(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function i2e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function o2e(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(!i2e(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];i2e(s,i,n)}}):Promise.resolve()}}function QGt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var qM=HGt;var Ldo=x(T(),1);var pre=new k;async function r2e(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,pre);let p=e.loadTileDataAvailability(pre.x,pre.y,1);l(p)&&s.push(p)}let m=i[u];l(m)||(i[u]=m=[]),m.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return qM(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 r2e(e,a,n),t}var jZ=r2e;var Udo=x(T(),1);var vdo=x(T(),1),s2e={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};Object.freeze(s2e);var mn=s2e;function RT(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 _re(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function QZ(e){let t=[];if(e.shiftKey&&t.push(ir.SHIFT),e.ctrlKey&&t.push(ir.CTRL),e.altKey&&t.push(ir.ALT),t.length)return t}var Fs={LEFT:0,MIDDLE:1,RIGHT:2};function am(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function qGt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(am(e,"pointerdown",t,oLt),am(e,"pointerup",t,b2e),am(e,"pointermove",t,rLt),am(e,"pointercancel",t,b2e)):(am(e,"mousedown",t,g2e),am(e,"mouseup",n,y2e),am(e,"mousemove",n,x2e),am(e,"touchstart",t,nLt),am(e,"touchend",n,u2e),am(e,"touchmove",n,iLt),am(e,"touchcancel",n,u2e)),am(e,"dblclick",t,eLt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",am(e,i,t,tLt)}function $Gt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var a2e={position:new k};function Sre(e){e._lastSeenTouchEvent=Zn()}function Zre(e){return Zn()-e._lastSeenTouchEvent>tp.mouseEmulationIgnoreMilliseconds}function Tre(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function g2e(e,t){if(!Zre(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Fs.LEFT)i=mn.LEFT_DOWN;else if(n===Fs.MIDDLE)i=mn.MIDDLE_DOWN;else if(n===Fs.RIGHT)i=mn.RIGHT_DOWN;else return;let o=RT(e,t,e._primaryPosition);k.clone(o,e._primaryStartPosition),k.clone(o,e._primaryPreviousPosition);let r=QZ(t),s=e.getInputAction(i,r);l(s)&&(k.clone(o,a2e.position),s(a2e),t.preventDefault())}var c2e={position:new k},l2e={position:new k};function bre(e,t,n,i){let o=QZ(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=RT(e,i,e._primaryPosition);if(l(r)&&(k.clone(a,c2e.position),r(c2e)),l(s)){let c=e._primaryStartPosition;Tre(c,a,e._clickPixelTolerance)&&(k.clone(a,l2e.position),s(l2e))}}}function y2e(e,t){if(!Zre(e))return;let n=t.button;n!==Fs.LEFT&&n!==Fs.MIDDLE&&n!==Fs.RIGHT||(e._buttonDown[Fs.LEFT]&&(bre(e,mn.LEFT_UP,mn.LEFT_CLICK,t),e._buttonDown[Fs.LEFT]=!1),e._buttonDown[Fs.MIDDLE]&&(bre(e,mn.MIDDLE_UP,mn.MIDDLE_CLICK,t),e._buttonDown[Fs.MIDDLE]=!1),e._buttonDown[Fs.RIGHT]&&(bre(e,mn.RIGHT_UP,mn.RIGHT_CLICK,t),e._buttonDown[Fs.RIGHT]=!1))}var gre={startPosition:new k,endPosition:new k};function x2e(e,t){if(!Zre(e))return;let n=QZ(t),i=RT(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(mn.MOUSE_MOVE,n);l(r)&&(k.clone(o,gre.startPosition),k.clone(i,gre.endPosition),r(gre)),k.clone(i,o),(e._buttonDown[Fs.LEFT]||e._buttonDown[Fs.MIDDLE]||e._buttonDown[Fs.RIGHT])&&t.preventDefault()}var d2e={position:new k};function eLt(e,t){let n=t.button,i;if(n===Fs.LEFT)i=mn.LEFT_DOUBLE_CLICK;else return;let o=QZ(t),r=e.getInputAction(i,o);l(r)&&(RT(e,t,d2e.position),r(d2e))}function tLt(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=QZ(t),o=e.getInputAction(mn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function nLt(e,t){Sre(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,RT(e,r,new k));tK(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,k.clone(a.get(s)))}function u2e(e,t){Sre(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);tK(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var m2e={position:new k},yre={position1:new k,position2:new k},h2e={position:new k},f2e={position:new k},p2e={position:new k};function tK(e,t){let n=QZ(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Fs.LEFT]){if(e._buttonDown[Fs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(mn.LEFT_UP,n),l(r)&&(k.clone(e._primaryPosition,h2e.position),r(h2e)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(mn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Tre(c,d,e._clickPixelTolerance)&&(k.clone(e._primaryPosition,f2e.position),s(f2e))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(mn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];k.clone(c,e._primaryPosition),k.clone(c,e._primaryStartPosition),k.clone(c,e._primaryPreviousPosition),e._buttonDown[Fs.LEFT]=!0,r=e.getInputAction(mn.LEFT_DOWN,n),l(r)&&(k.clone(c,m2e.position),r(m2e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(mn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];Tre(d,u,e._holdPixelTolerance)&&(k.clone(e._primaryPosition,p2e.position),s(p2e))}},tp.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(mn.PINCH_START,n),l(r)&&(k.clone(i.values[0],yre.position1),k.clone(i.values[1],yre.position2),r(yre),t.preventDefault()))}function iLt(e,t){Sre(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)&&RT(e,r,d)}T2e(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,k.clone(a.get(s),c.get(s))}var xre={startPosition:new k,endPosition:new k},$M={distance:{startPosition:new k,endPosition:new k},angleAndHeight:{startPosition:new k,endPosition:new k}};function T2e(e,t){let n=QZ(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Fs.LEFT]){let a=i.values[0];k.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(mn.MOUSE_MOVE,n),l(s)&&(k.clone(c,xre.startPosition),k.clone(a,xre.endPosition),s(xre)),k.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(mn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],m=c.x-a.x,p=c.y-a.y,b=Math.sqrt(m*m+p*p)*.25,f=u.x-d.x,y=u.y-d.y,_=Math.sqrt(f*f+y*y)*.25,S=(c.y+a.y)*.125,Z=(u.y+d.y)*.125,R=Math.atan2(p,m),C=Math.atan2(y,f);k.fromElements(0,_,$M.distance.startPosition),k.fromElements(0,b,$M.distance.endPosition),k.fromElements(C,Z,$M.angleAndHeight.startPosition),k.fromElements(R,S,$M.angleAndHeight.endPosition),s($M)}}function oLt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,RT(e,t,new k)),tK(e,t),e._previousPositions.set(i,k.clone(n.get(i)))}else g2e(e,t)}function b2e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),tK(e,t),e._previousPositions.remove(i)}else y2e(e,t)}function rLt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;RT(e,t,o),T2e(e,t);let r=e._previousPositions;k.clone(n.get(i),r.get(i))}else x2e(e,t)}function tp(e){this._inputEvents={},this._buttonDown={[Fs.LEFT]:!1,[Fs.MIDDLE]:!1,[Fs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-tp.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new k,this._primaryPosition=new k,this._primaryPreviousPosition=new k,this._positions=new Mt,this._previousPositions=new Mt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,qGt(this)}tp.prototype.setInputAction=function(e,t,n){let i=_re(t,n);this._inputEvents[i]=e};tp.prototype.getInputAction=function(e,t){let n=_re(e,t);return this._inputEvents[n]};tp.prototype.removeInputAction=function(e,t){let n=_re(e,t);delete this._inputEvents[n]};tp.prototype.isDestroyed=function(){return!1};tp.prototype.destroy=function(){return $Gt(this),me(this)};tp.mouseEmulationIgnoreMilliseconds=800;tp.touchHoldDelayMilliseconds=1500;var la=tp;var ruo=x(T(),1);function sLt(e,t,n,i,o,r,s){let a=oo.numberOfPoints(e,t,o),c,d=n.red,u=n.green,m=n.blue,p=n.alpha,b=i.red,f=i.green,y=i.blue,_=i.alpha;if(U.equals(n,i)){for(c=0;c<a;c++)r[s++]=U.floatToByte(d),r[s++]=U.floatToByte(u),r[s++]=U.floatToByte(m),r[s++]=U.floatToByte(p);return s}let S=(b-d)/a,Z=(f-u)/a,R=(y-m)/a,C=(_-p)/a,E=s;for(c=0;c<a;c++)r[E++]=U.floatToByte(d+c*S),r[E++]=U.floatToByte(u+c*Z),r[E++]=U.floatToByte(m+c*R),r[E++]=U.floatToByte(p+c*C);return E}function ek(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ne.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*U.packedLength:1,this.packedLength=o+ne.packedLength+3}ek.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.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+=U.packedLength)U.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};ek.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.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 ek({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var nK=new Array(2),iK=new Array(2),aLt={positions:nK,height:iK,ellipsoid:void 0,minDistance:void 0,granularity:void 0};ek.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,m,p,b,f,y=0;if(o===un.GEODESIC||o===un.RHUMB){let C,E,A;o===un.GEODESIC?(C=W.chordLength(r,s.maximumRadius),E=oo.numberOfPoints,A=oo.generateArc):(C=r,E=oo.numberOfPointsRhumbLine,A=oo.generateRhumbArc);let L=oo.extractHeights(t,s),F=aLt;if(o===un.GEODESIC?F.minDistance=a:F.granularity=r,F.ellipsoid=s,c){let I=0;for(d=0;d<u-1;d++)I+=E(t[d],t[d+1],C)+1;m=new Float64Array(I*3),b=new Uint8Array(I*4),F.positions=nK,F.height=iK;let N=0;for(d=0;d<u-1;++d){nK[0]=t[d],nK[1]=t[d+1],iK[0]=L[d],iK[1]=L[d+1];let g=A(F);if(l(n)){let V=g.length/3;f=n[d];for(let G=0;G<V;++G)b[N++]=U.floatToByte(f.red),b[N++]=U.floatToByte(f.green),b[N++]=U.floatToByte(f.blue),b[N++]=U.floatToByte(f.alpha)}m.set(g,y),y+=g.length}}else if(F.positions=t,F.height=L,m=new Float64Array(A(F)),l(n)){for(b=new Uint8Array(m.length/3*4),d=0;d<u-1;++d){let N=t[d],g=t[d+1],V=n[d],G=n[d+1];y=sLt(N,g,V,G,a,b,y)}let I=n[u-1];b[y++]=U.floatToByte(I.red),b[y++]=U.floatToByte(I.green),b[y++]=U.floatToByte(I.blue),b[y]=U.floatToByte(I.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),b=l(n)?new Uint8Array(p*4):void 0;let C=0,E=0;for(d=0;d<u;++d){let A=t[d];if(c&&d>0&&(h.pack(A,m,C),C+=3,f=n[d-1],b[E++]=U.floatToByte(f.red),b[E++]=U.floatToByte(f.green),b[E++]=U.floatToByte(f.blue),b[E++]=U.floatToByte(f.alpha)),c&&d===u-1)break;h.pack(A,m,C),C+=3,l(n)&&(f=n[d],b[E++]=U.floatToByte(f.red),b[E++]=U.floatToByte(f.green),b[E++]=U.floatToByte(f.blue),b[E++]=U.floatToByte(f.alpha))}}let _=new Rn;_.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),p=m.length/3;let S=(p-1)*2,Z=Oe.createTypedArray(p,S),R=0;for(d=0;d<p-1;++d)Z[R++]=d,Z[R++]=d+1;return new At({attributes:_,indices:Z,primitiveType:Ie.LINES,boundingSphere:de.fromPoints(t)})};var Rre=ek;var cuo=x(T(),1);var oK=class{constructor(){ge.throwInstantiationError()}async snap(t){ge.throwInstantiationError()}};oK.DEFAULT_SNAP_APERTURE=void 0;var Cre=oK;var fuo=x(T(),1);function aA(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ha(i),this._workerName="createSphereGeometry"}aA.packedLength=Ha.packedLength;aA.pack=function(e,t,n){return Ha.pack(e._ellipsoidGeometry,t,n)};var cLt=new Ha,CT={radius:void 0,radii:new h,vertexFormat:new we,stackPartitions:void 0,slicePartitions:void 0};aA.unpack=function(e,t,n){let i=Ha.unpack(e,t,cLt);return CT.vertexFormat=we.clone(i._vertexFormat,CT.vertexFormat),CT.stackPartitions=i._stackPartitions,CT.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,CT.radii),n._ellipsoidGeometry=new Ha(CT),n):(CT.radius=i._radii.x,new aA(CT))};aA.createGeometry=function(e){return Ha.createGeometry(e._ellipsoidGeometry)};var tk=aA;var buo=x(T(),1);function lLt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var qZ=lLt;var yuo=x(T(),1),dLt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Gn=dLt;var _uo=x(T(),1);var Vre=class{constructor(t){mt(this,"ellipsoid");mt(this,"rectangle");mt(this,"projection")}getNumberOfXTilesAtLevel(t){ge.throwInstantiationError()}getNumberOfYTilesAtLevel(t){ge.throwInstantiationError()}rectangleToNativeRectangle(t,n){ge.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,o){ge.throwInstantiationError()}tileXYToRectangle(t,n,i,o){ge.throwInstantiationError()}positionToTileXY(t,n,i){ge.throwInstantiationError()}},Ere=Vre;var Guo=x(T(),1);function $Z(e){e=e??B.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=e.epoch??it.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties($Z.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($Z.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=uLt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});$Z.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};$Z.prototype.isDestroyed=function(){return!1};$Z.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};$Z.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=this.epoch??it.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?this.tolerance??1:.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function uLt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Are=$Z;var Buo=x(T(),1);function mLt(e,t){this.rectangle=e,this.maxLevel=t}function _2e(e){this.ellipsoid=e.ellipsoid??ne.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}_2e.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 hLt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new to({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=Qo.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"))),m=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new mLt(new re(a,c,d,u),m))}}function fLt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function pLt(e,t,n){try{let i=await t.fetchXML();hLt(e,i)}catch(i){fLt(t,i,n)}}function VT(e){e=e??B.EMPTY_OBJECT,this._errorEvent=new Se,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 Lt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(VT.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(){}}});VT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=new _2e(t),i=ve.createIfNeeded(e);await pLt(n,i);let o=new VT(t);return n.build(o),o._resource=i,o};VT.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 Mc({buffer:Fh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:bLt(a,e,t,n),structure:a._terrainDataStructure})})};VT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var S2e=new re;function bLt(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,m=re.intersection(u,s,S2e);l(m)&&(rK(o,u,t*2,n*2,i+1)&&(a|=4),rK(o,u,t*2+1,n*2,i+1)&&(a|=8),rK(o,u,t*2,n*2+1,i+1)&&(a|=1),rK(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function rK(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(re.intersection(r,t,S2e))}VT.prototype.getTileDataAvailable=function(e,t,n){};VT.prototype.loadTileDataAvailability=function(e,t,n){};var Gre=VT;var Huo=x(T(),1),Z2e={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};Object.freeze(Z2e);var Lre=Z2e;var juo=x(T(),1);function gLt(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 Wre=gLt;var quo=x(T(),1);function yLt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var nk=yLt;var amo=x(T(),1);function eR(){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 li,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new k,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(eR.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 R2e(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 xLt(e,t){R2e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.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 li,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 C2e(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 TLt(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 _Lt(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+=`} -.cesium-credit-lightbox { - background-color: #303336; - color: ${FF}; - position: relative; - min-height: ${Rut}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: ${FF}; -} -.cesium-credit-lightbox > ul > li a:hover { - color: ${gD}; -} -.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: ${FF}; -} -.cesium-credit-lightbox-close:hover { - color: ${gD}; -} -.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; -} +`,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 SLt(e,t){C2e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(_Lt(r,i),{framebuffer:n[r].framebuffer,uniformMap:TLt(e,r)});e._commands=o}eR.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ui({color:new U(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};eR.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,xLt(this,e),SLt(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};eR.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)};eR.prototype.isDestroyed=function(){return!1};eR.prototype.destroy=function(){return R2e(this),C2e(this),me(this)};var ik=eR;var umo=x(T(),1);var ZLt=new h(1,1,1);function vre(e){e=e??ZLt,this._dimensions=h.clone(e)}Object.defineProperties(vre.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var RLt=new h;vre.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,RLt),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Fre=vre;var Zmo=x(T(),1);function ok(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(ok.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function CLt(e,t,n){let i=t.createViewportQuadCommand(cM,{framebuffer:n,renderState:ze.fromCache({viewport:new nt(0,0,256,256)})});e._drawCommand=i}ok.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new vt({context:t,width:256,height:256,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Bt.NEAREST});this._colorTexture=n;let i=new ps({context:t,colorTextures:[n],destroyAttachments:!1});CLt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};ok.prototype.isDestroyed=function(){return!1};ok.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var rk=ok;var Xmo=x(T(),1);var Ire=0,V2e=new h,sK=new h,VLt=new Xr;function ELt(e,t,n){let i=t.tileX,o=t.tileY,r=t.tileZ,s=n?.featureIdProperty,a=VLt.tileXYToRectangle(i,o,r),c=re.center(a),d=h.fromRadians(c.longitude,c.latitude,0),u=4294967295,m=u,p=u,b=new Map,f=new Map,y=[],_=[],S=[],Z=0;function R(){let w=(4-Z%4)%4;w>0&&(S.push(new Uint8Array(w)),Z+=w)}function C(w,O){R();let M=Z;S.push(new Uint8Array(w.buffer,w.byteOffset,w.byteLength)),Z+=w.byteLength;let z=y.length;return y.push({buffer:0,byteOffset:M,byteLength:w.byteLength,target:O}),z}function E(w,O){let M=C(w,O.target),z=St.getComponentCount(O.type),K={bufferView:M,byteOffset:0,componentType:O.componentType,count:w.length/z,type:O.type};l(O.min)&&(K.min=O.min),l(O.max)&&(K.max=O.max);let te=_.length;return _.push(K),te}function A(w){let O=Number.POSITIVE_INFINITY,M=Number.POSITIVE_INFINITY,z=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,te=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY;for(let $=0;$<w.length;$+=3){let ee=w[$],le=w[$+1],_e=w[$+2];ee<O&&(O=ee),le<M&&(M=le),_e<z&&(z=_e),ee>K&&(K=ee),le>te&&(te=le),_e>H&&(H=_e)}return{min:[O,M,z],max:[K,te,H]}}function L(w,O,M){if(M.length===0)return;let z=new Uint32Array(M),K=E(z,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER});w._FEATURE_ID_0=K;let te={featureCount:b.size,nullFeatureId:m,attribute:0};f.size>0&&(te.propertyTable=0),O.EXT_mesh_features={featureIds:[te]}}function F(w,O){O=O??4;let M=(O-Z%O)%O;M>0&&(S.push(new Uint8Array(M)),Z+=M);let z=Z;S.push(w),Z+=w.byteLength;let K=y.length;return y.push({buffer:0,byteOffset:z,byteLength:w.byteLength}),K}function I(){if(f.size===0)return;let w=new Map;for(let K of f.values())for(let[te,H]of Object.entries(K)){if(!l(H))continue;let $=typeof H,ee;$==="string"?ee="STRING":$==="number"?ee="SCALAR":$==="boolean"?ee="BOOLEAN":ee="STRING";let le=w.get(te);l(le)?le!==ee&&w.set(te,"STRING"):w.set(te,ee)}if(w.size===0)return;let O={};for(let[K,te]of w)te==="SCALAR"?O[K]={type:"SCALAR",componentType:"FLOAT64"}:te==="BOOLEAN"?O[K]={type:"BOOLEAN"}:O[K]={type:"STRING"};let M={},z=b.size;for(let[K,te]of w)if(te==="SCALAR"){let H=new Float64Array(z);for(let ee=0;ee<z;ee++){let _e=f.get(ee)?.[K];H[ee]=typeof _e=="number"&&Number.isFinite(_e)?_e:NaN}let $=F(new Uint8Array(H.buffer,H.byteOffset,H.byteLength),8);M[K]={values:$}}else if(te==="BOOLEAN"){let H=Math.ceil(z/8),$=new Uint8Array(H);for(let le=0;le<z;le++)f.get(le)?.[K]&&($[le>>3]|=1<<(le&7));let ee=F($);M[K]={values:ee}}else{let H=new TextEncoder,$=[],ee=new Uint32Array(z+1),le=0;for(let Ge=0;Ge<z;Ge++){ee[Ge]=le;let Fe=f.get(Ge)?.[K],tt;Fe==null?tt="":typeof Fe=="string"?tt=Fe:tt=String(Fe);let Be=H.encode(tt);$.push(Be),le+=Be.byteLength}ee[z]=le;let _e=new Uint8Array(le),he=0;for(let Ge of $)_e.set(Ge,he),he+=Ge.byteLength;let Ze=F(_e),ye=F(new Uint8Array(ee.buffer,ee.byteOffset,ee.byteLength));M[K]={values:Ze,stringOffsets:ye,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:O}}},propertyTables:[{class:"mvt_feature",count:z,properties:M}]}}let N=[],g=[],V=[d.x,d.y,d.z];for(let w of e.layers){let O=w.extent,M=[],z=[],K=[],te=[],H=[],$=0,ee=[],le=[],_e=[],he=[],Ze=[],ye=[],Ge=[],Ae=0;for(let Be of w.features){let je=l(s)?GLt(Be,s,b)??m:ALt(Be,b);if(je!==m&&!f.has(je)){let qe=Object.assign({},Be.properties);qe._layer=w.name??"",f.set(je,qe)}if(Be.type==="Point"){let qe=Be.geometry;for(let We of qe)Pre(We,i,o,r,O,Ire,d,M),z.push(je);continue}if(Be.type==="LineString"){let qe=Be.geometry;for(let We of qe){let Ke=K.length/3;for(let ct of We)Pre(ct,i,o,r,O,Ire,d,K),te.push(je);for(let ct=0;ct<We.length;ct++)H.push(Ke+ct);H.push(p),$++}continue}if(Be.type==="Polygon"){let qe=Be.geometry,We=LLt(qe);for(let Ke of We){let ct=[Ke.outerRing,...Ke.holes],Et=[],zt=[],ut=[],bt=0;for(let pt=0;pt<ct.length;pt++){let wi=ct[pt];pt>0&&ut.push(bt);for(let jn of wi)Et.push(new k(jn.x,jn.y)),Pre(jn,i,o,r,O,Ire,d,zt),bt++}if(Et.length<3)continue;let ht=mi.triangulate(Et,ut.length>0?ut:void 0);if(!l(ht)||ht.length===0){xt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let jt=ee.length/3,st=_e.length;he.push(jt),Ze.push(st),ye.push(ut.length);for(let pt=0;pt<ut.length;pt++)Ge.push(jt+ut[pt]);for(let pt=0;pt<zt.length;pt++)ee.push(zt[pt]);for(let pt=0;pt<zt.length/3;pt++)le.push(je);for(let pt=0;pt<ht.length;pt++)_e.push(ht[pt]+jt);Ae++}}}if(M.length===0&&K.length===0&&ee.length===0)continue;H.length>0&&H[H.length-1]===p&&H.pop();let Fe=[];if(M.length>0){let Be=new Float32Array(M),je=A(Be),We={POSITION:E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:je.min,max:je.max})},Ke={CESIUM_mesh_vector:{vector:!0,count:Be.length/3}};L(We,Ke,z),Fe.push({mode:Ie.POINTS,attributes:We,extensions:Ke})}if(K.length>0&&H.length>1){let Be=new Float32Array(K),je=new Uint32Array(H),qe=A(Be),We=E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:qe.min,max:qe.max}),Ke=E(je,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ELEMENT_ARRAY_BUFFER}),ct={POSITION:We},Et={CESIUM_mesh_vector:{vector:!0,count:$}};L(ct,Et,te),Fe.push({mode:Ie.LINE_STRIP,indices:Ke,attributes:ct,extensions:Et})}if(ee.length>0&&_e.length>=3){let Be=new Float32Array(ee),je=new Uint32Array(_e),qe=new Uint32Array(he),We=new Uint32Array(Ze),Ke=Ge.length>0,ct=Ke?new Uint32Array(ye):void 0,Et=Ke?new Uint32Array(Ge):void 0,zt=A(Be),ut=E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:zt.min,max:zt.max}),bt=E(je,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ELEMENT_ARRAY_BUFFER}),ht=E(qe,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}),jt=E(We,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}),st=l(ct)?E(ct,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}):void 0,pt=l(Et)?E(Et,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}):void 0,wi={POSITION:ut},jn={CESIUM_mesh_vector:{vector:!0,count:Ae,polygonAttributeOffsets:ht,polygonIndicesOffsets:jt}};Ke&&(jn.CESIUM_mesh_vector.polygonHoleCounts=st,jn.CESIUM_mesh_vector.polygonHoleOffsets=pt),L(wi,jn,le),Fe.push({mode:Ie.TRIANGLES,indices:bt,attributes:wi,extensions:jn})}if(Fe.length===0)continue;let tt=N.length;N.push({primitives:Fe}),g.push({name:w.name,mesh:tt,translation:V})}if(g.length===0)return;let G=I(),v=ILt(S,Z),X=["CESIUM_mesh_vector"];b.size>0&&X.push("EXT_mesh_features"),l(G)&&X.push("EXT_structural_metadata");let Y=g.map((w,O)=>O),D={asset:{version:"2.0"},extensionsUsed:X,scene:0,scenes:[{nodes:Y}],nodes:g,meshes:N,accessors:_,bufferViews:y,buffers:[{byteLength:v.byteLength}],extensions:void 0};return l(G)&&(D.extensions={EXT_structural_metadata:G}),FLt(D,v)}function ALt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function GLt(e,t,n){let i=e.properties;if(!l(i))return;let o=i[t];if(!l(o)||typeof o!="string"&&typeof o!="number"&&typeof o!="boolean"||typeof o=="number"&&!Number.isFinite(o))return;let r=`${typeof o}:${o}`,s=n.get(r);return l(s)||(s=n.size,n.set(r,s)),s}function LLt(e){let t=[];for(let n of e){let i=vLt(n);if(i.length<3)continue;WLt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function WLt(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function vLt(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function Pre(e,t,n,i,o,r,s,a){let c=1<<i,d=(t+e.x/o)/c,u=(n+e.y/o)/c,m=d*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*u)));h.fromRadians(m,p,r,void 0,V2e),h.subtract(V2e,s,sK),a.push(sK.x,sK.y,sK.z)}function FLt(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let d=Math.ceil(t.byteLength/4)*4,u=new Uint8Array(d);u.set(t);let m=20+a+8+d,p=new Uint8Array(m),b=new DataView(p.buffer),f=0;return b.setUint32(f,1179937895,!0),f+=4,b.setUint32(f,2,!0),f+=4,b.setUint32(f,m,!0),f+=4,b.setUint32(f,a,!0),f+=4,b.setUint32(f,1313821514,!0),f+=4,p.set(c,f),f+=a,b.setUint32(f,d,!0),f+=4,b.setUint32(f,5130562,!0),f+=4,p.set(u,f),p}function ILt(e,t){let n=new Uint8Array(t),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n}var sk=ELt;var Zho=x(T(),1);var rho=x(T(),1);var Ymo=x(T(),1),E2e={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"};Object.freeze(E2e);var F0=E2e;var Jmo=x(T(),1);function cA(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}cA.prototype.getTexture=function(e){return this._textures[e]};function PLt(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})}cA.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):PLt(this,e,t)};function XLt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?aK(o,r,n):NLt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function aK(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?G2e(e,n):new vt({context:n,source:t,sampler:o});return A2e(o)&&r.generateMipmap(),r}function NLt(e,t,n){let{typedArray:i,sampler:o}=e,r=A2e(o),s=o.wrapS===pn.REPEAT||o.wrapS===pn.MIRRORED_REPEAT||o.wrapT===pn.REPEAT||o.wrapT===pn.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===Ue.UNSIGNED_BYTE){let m=DM(i,a,c),p=ex(m);return aK({sampler:o},p,n)}}else{let m=ex(t);return aK(e,m,n)}else return aK(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."),G2e(e,n)}function A2e(e){return[Ht.NEAREST_MIPMAP_NEAREST,Ht.NEAREST_MIPMAP_LINEAR,Ht.LINEAR_MIPMAP_NEAREST,Ht.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function G2e(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})}cA.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];XLt(this,o,t)}n.length=0};cA.prototype.isDestroyed=function(){return!1};cA.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 ak=cA;function ck(e){e=e??B.EMPTY_OBJECT,this.mode=e.mode??Ob.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??B.EMPTY_OBJECT,this.varyings=e.varyings??B.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??bx.INHERIT,this._textureManager=new ak,this._defaultTexture=void 0,this.uniformMap=YLt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},kLt(this),ULt(this)}function YLt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===F0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=wLt(e,i)):n[i]=MLt(e,i)}return n}function wLt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function MLt(e,t){return function(){return e.uniforms[t].value}}function tR(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function kLt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,tR(r,t,o),o=e.usedVariablesVertex.featureIdSet,tR(r,n,o),o=e.usedVariablesVertex.metadataSet,tR(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,tR(s,t,o),o=e.usedVariablesFragment.featureIdSet,tR(s,n,o),o=e.usedVariablesFragment.metadataSet,tR(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;tR(s,a,c)}}function L2e(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 Zl(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${L2e(t)} is not available in the ${i} shader. Did you mean ${L2e(n)} instead?`;throw new ge(o)}}function ULt(e){let t=e.usedVariablesVertex.attributeSet;Zl(t,"position","positionMC","vertex"),Zl(t,"normal","normalMC","vertex"),Zl(t,"tangent","tangentMC","vertex"),Zl(t,"bitangent","bitangentMC","vertex"),Zl(t,"positionWC","positionMC","vertex"),Zl(t,"positionEC","positionMC","vertex"),Zl(t,"normalEC","normalMC","vertex"),Zl(t,"tangentEC","tangentMC","vertex"),Zl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Zl(n,"position","positionEC","fragment"),Zl(n,"normal","normalEC","fragment"),Zl(n,"tangent","tangentEC","fragment"),Zl(n,"bitangent","bitangentEC","fragment"),Zl(n,"normalMC","normalEC","fragment"),Zl(n,"tangentMC","tangentEC","fragment"),Zl(n,"bitangentMC","bitangentEC","fragment")}ck.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===F0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};ck.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};ck.prototype.isDestroyed=function(){return!1};ck.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var I0=ck;var hho=x(T(),1);function DLt(e){e=e??B.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Qe.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=ve.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?pn.REPEAT:pn.CLAMP_TO_EDGE;this.sampler=new Bt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var lk=DLt;function OLt(e){let{names:t,types:n,componentTypes:i,minimumValues:o,maximumValues:r}=e;for(let s=0;s<t.length;s++){if(!BLt(o?.[s],r?.[s]))continue;let a=zLt(t[s],n[s],i[s],o[s],r[s]);if(l(a))return a}}function BLt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function zLt(e,t,n,i,o){if(t===St.VEC4&&n===Nt.FLOAT32)return HLt(e,i,o);if(t===St.SCALAR&&n===Nt.FLOAT32)return KLt(e,i,o)}function HLt(e,t,n){let i=Math.min(...t),o=Math.max(...n);if(!(i<0||o>1))return new I0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +{ + material.diffuse = fsInput.metadata.${e}.rgb; + material.alpha = fsInput.metadata.${e}.a; +}`})}function KLt(e,t,n){let o=NM([new U(.267,.004,.329),new U(.282,.14,.457),new U(.254,.265,.53),new U(.207,.372,.553),new U(.164,.471,.558),new U(.128,.567,.551),new U(.135,.659,.518),new U(.194,.741,.443),new U(.282,.819,.369),new U(.396,.898,.301),new U(.538,.965,.236),new U(.741,.998,.149),new U(.993,1,.144)],128),r=new lk({typedArray:o,width:128,height:1});return new I0({uniforms:{u_colorMap:{type:F0.SAMPLER_2D,value:r},u_minimumValue:{type:F0.FLOAT,value:t[0]},u_maximumValue:{type:F0.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) + { + float value = fsInput.metadata.${e}; + vec3 voxelNormal = fsInput.attributes.normalEC; + float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); + float lighting = 0.5 + 0.5 * diffuse; -.cesium-credit-expand-link { - padding-left: 5px; - cursor: pointer; - text-decoration: underline; - color: ${FF}; -} -.cesium-credit-expand-link:hover { - color: ${gD}; + if (value >= u_minimumValue && value <= u_maximumValue) { + float lerp = (value - u_minimumValue) / (u_maximumValue - u_minimumValue); + material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting; + material.alpha = 1.0; + } + }`})}var lA=OLt;var upo=x(T(),1);var Aho=x(T(),1);function JLt(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,fe.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,fe.FRAGMENT);for(let g=0;g<c;g++){let V=i[g],G=cK(o[g]),v=`PropertyStatistics_${V}`,X=`PropertyStatistics_${V}`;n.addStruct(v,X,fe.FRAGMENT),n.addStructField(v,G,"min"),n.addStructField(v,G,"max")}let u="MetadataStatistics",m="MetadataStatistics",p="metadataStatistics";n.addStruct(u,m,fe.FRAGMENT);for(let g=0;g<c;g++){let V=i[g],G=`PropertyStatistics_${V}`,v=V;n.addStructField(u,G,v)}let b="Metadata",f="Metadata",y="metadata";n.addStruct(b,f,fe.FRAGMENT);for(let g=0;g<c;g++){let V=cK(o[g]);n.addStructField(b,V,i[g])}let _="Attributes",S="Attributes",Z="attributes";n.addStruct(_,S,fe.FRAGMENT),n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","normalEC");let R="Voxel",C="Voxel",E="voxel";n.addStruct(R,C,fe.FRAGMENT),n.addStructField(R,"vec3","viewDirUv"),n.addStructField(R,"float","travelDistance"),n.addStructField(R,"int","stepCount"),n.addStructField(R,"int","tileIndex"),n.addStructField(R,"int","sampleIndex"),n.addStructField(R,"float","distanceToDepthBuffer");let A="FragmentInput";n.addStruct(A,"FragmentInput",fe.FRAGMENT),n.addStructField(A,m,p),n.addStructField(A,f,y),n.addStructField(A,S,Z),n.addStructField(A,C,E);let F="Properties",I="Properties",N="properties";n.addStruct(F,I,fe.FRAGMENT);for(let g=0;g<c;g++){let V=cK(o[g]);n.addStructField(F,V,i[g])}{let g="clearProperties";n.addFunction(g,`${I} clearProperties()`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=cK(o[V],r[V]);n.addFunctionLines(g,[`${N}.${i[V]} = ${G}(0.0);`])}n.addFunctionLines(g,[`return ${N};`])}{let g="sumProperties";n.addFunction(g,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${N}.${G} = propertiesA.${G} + propertiesB.${G};`])}n.addFunctionLines(g,[`return ${N};`])}{let g="scaleProperties";n.addFunction(g,`${I} scaleProperties(${I} ${N}, float scale)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} scaledProperties = ${N};`]);for(let V=0;V<c;V++)n.addFunctionLines(g,[`scaledProperties.${i[V]} *= scale;`]);n.addFunctionLines(g,["return scaledProperties;"])}{let g="mixProperties";n.addFunction(g,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${N}.${G} = mix(propertiesA.${G}, propertiesB.${G}, mixFactor);`])}n.addFunctionLines(g,[`return ${N};`])}{let g="copyPropertiesToMetadata";n.addFunction(g,`void copyPropertiesToMetadata(in ${I} ${N}, inout ${f} ${y})`,fe.FRAGMENT);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${y}.${G} = ${N}.${G};`])}}if(d){let g="setStatistics";n.addFunction(g,`void setStatistics(inout ${m} ${p})`,fe.FRAGMENT);for(let V=0;V<c;V++){let G=i[V],v=o[V],X=St.getComponentCount(v);for(let Y=0;Y<X;Y++){let D=QLt(v,Y),w=s[V][Y],O=a[V][Y];!l(w)||!l(O)||n.addFunctionLines(g,[`${p}.${G}.min${D} = ${W2e(w)};`,`${p}.${G}.max${D} = ${W2e(O)};`])}}}{let g="getPropertiesFromMegatextureAtUv";n.addFunction(g,`${I} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=o[V],v=r[V],X=jLt(G,v);n.addFunctionLines(g,[`properties.${i[V]} = texture(u_megatextureTextures[${V}], texcoord)${X};`])}n.addFunctionLines(g,[`return ${N};`])}}function cK(e){if(e===St.SCALAR)return"float";if(e===St.VEC2)return"vec2";if(e===St.VEC3)return"vec3";if(e===St.VEC4)return"vec4"}function jLt(e){if(e===St.SCALAR)return".r";if(e===St.VEC2)return".ra";if(e===St.VEC3)return".rgb";if(e===St.VEC4)return""}function W2e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function QLt(e,t){return e===St.SCALAR?"":`[${t}]`}var dk=JLt;var zho=x(T(),1);function np(e){let{planes:t,modelMatrix:n=P.IDENTITY,unionClippingRegions:i=!1}=e??B.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=P.clone(n),this.planeAdded=new Se,this.planeRemoved=new Se,this._unionClippingRegions=i,this._testIntersection=i?v2e:F2e,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function v2e(e){return e===qt.OUTSIDE}function F2e(e){return e===qt.INSIDE}Object.defineProperties(np.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?v2e:F2e)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});np.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};np.prototype.get=function(e){return this._planes[e]};function I2e(e,t){for(let n=0;n<e.length;++n)if(cn.equals(e[n],t))return n;return-1}np.prototype.contains=function(e){return I2e(this._planes,e)!==-1};np.prototype.remove=function(e){let t=this._planes,n=I2e(t,e);if(n===-1)return!1;e instanceof ta&&(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 ta&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};np.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ta&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var qLt=new cn(h.fromElements(1,0,0),0);function $Lt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:s,distance:a}=tWt(i[r],t,qLt);n[o]=s.x,n[o+1]=s.y,n[o+2]=s.z,n[o+3]=a,o+=4}}var Xre=new ce,eWt=new h;function tWt(e,t,n){let{normal:i,distance:o}=e,r=ce.fromElements(i.x,i.y,i.z,o,Xre),s=P.multiplyByVector(t,r,Xre),a=h.fromCartesian4(s,eWt);return s=ce.divideByScalar(s,h.magnitude(a),Xre),cn.fromCartesian4(s,n)}function P2e(e,t){return t.x=Math.min(e,kt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var nWt=new k;np.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=P2e(i,nWt);s.y*=2,n=new vt({context:e.context,width:s.x,height:s.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT,sampler:Bt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;$Lt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};np.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=P2e(o,n);return r.y*=2,r};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),me(this)};var ny=np;var jfo=x(T(),1);var Kho=x(T(),1),uk=`struct Ray { +vec3 pos; +vec3 dir; +}; +float minComponent(in vec3 v) { +return min(min(v.x, v.y), v.z); } - -.cesium-credit-text { - color: ${FF}; +float maxComponent(in vec3 v) { +return max(max(v.x, v.y), v.z); } - -.cesium-credit-delimiter { - padding: 0 5px; +`;var jho=x(T(),1),mk=`#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 mat4 u_transformPositionViewToLocal; +uniform mat3 u_transformDirectionViewToLocal; +uniform vec3 u_cameraPositionLocal; +uniform vec3 u_cameraDirectionLocal; +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); } - -.cesium-credit-textContainer *, -.cesium-credit-logoContainer * { - display: inline; +#define MINIMUM_STEP_SCALAR (0.02) +#define SHIFT_FRACTION (0.001) +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); } - -.cesium-credit-textContainer a:hover { - color: ${gD} +vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) { +vec3 gradient = viewRay.dir * jacobianT; +vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient; +RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay); +vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz; +voxelNormal = normalize(czm_normal * voxelNormal); +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) { +dt = shapeIntersection.exit.w - currentT + shift; } - -.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { - padding-left: 5px; +float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); +return vec4(entry.xyz, stepSize); } -`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function gr(e,t,n){C.defined("container",e);let i=this;n=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(h){r.contains(h.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 l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",r.appendChild(l);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 f=document.createElement("div");f.className="cesium-credit-textContainer",f.style.display="inline",e.appendChild(f);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Iut(e);let y=Ct.clone(gr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=f,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=y,this._previousCesiumCredit=void 0,this._currentCesiumCredit=y,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Zt,lightboxCredits:new Zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function pxe(e,t,n,i){i=i??1;let o=t.get(n.id);if(c(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 fxe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}gr.prototype.addCreditToNextFrame=function(e){if(C.defined("credit",e),e.isIon()){c(this._defaultCredit)||(this._defaultCredit=Ct.clone(bxe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,pxe(this,t,e)};gr.prototype.addStaticCredit=function(e){C.defined("credit",e);let t=this._staticCredits;Gut(t,e)||t.push(e)};gr.prototype.removeStaticCredit=function(e){C.defined("credit",e);let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};gr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};gr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};gr.prototype.update=function(){this._expanded&&Xut(this)};gr.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(gr.cesiumCredit,this._cesiumCredit)||pxe(this,s,r,Number.MAX_VALUE)}Ct.equals(gr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Ct.clone(gr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};gr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;uxe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",uxe(this._creditList,t,void 0,"li"),Eut(this)};gr.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),he(this)};gr.prototype.isDestroyed=function(){return!1};gr._cesiumCredit=void 0;gr._cesiumCreditInitialized=!1;var xD;function bxe(){if(!c(xD)){let e=on("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new mxe.default(e).path()),xD=new Ct(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return gr._cesiumCreditInitialized||(gr._cesiumCredit=xD,gr._cesiumCreditInitialized=!0),xD}Object.defineProperties(gr,{cesiumCredit:{get:function(){return bxe(),gr._cesiumCredit},set:function(e){gr._cesiumCredit=e,gr._cesiumCreditInitialized=!0}}});gr.CreditDisplayElement=fxe;var AF=gr;var _5i=_(T(),1);var NNi=_(T(),1);var _D=0,Wut=1;function MT(e){C.typeOf.object("options",e),C.typeOf.object("options.frustum",e.frustum),C.typeOf.object("options.origin",e.origin),C.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??We.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Ci?(s=_D,a=Ci.packedLength):t instanceof sn&&(s=Wut,a=sn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Fe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Fe.packedLength+We.packedLength}MT.pack=function(e,t,n){C.typeOf.object("value",e),C.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===_D?(Ci.pack(o,t,n),n+=Ci.packedLength):(sn.pack(o,t,n),n+=sn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Fe.pack(e._orientation,t,n),n+=Fe.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._drawNearPlane?1:0,t};var wut=new Ci,Put=new sn,vut=new Fe,Fut=new m,Aut=new We;MT.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o;i===_D?(o=Ci.unpack(e,t,wut),t+=Ci.packedLength):(o=sn.unpack(e,t,Put),t+=sn.packedLength);let r=m.unpack(e,t,Fut);t+=m.packedLength;let s=Fe.unpack(e,t,vut);t+=Fe.packedLength;let a=We.unpack(e,t,Aut);t+=We.packedLength;let l=e[t]===1;if(!c(n))return new MT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:l});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=Fe.clone(s,n._orientation),n._vertexFormat=We.clone(a,n._vertexFormat),n._drawNearPlane=l,n};function lL(e,t,n,i,o,r,s,a){let l=e/3*2;for(let d=0;d<4;++d)c(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),c(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),c(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[l]=0,o[l+1]=0,o[l+2]=1,o[l+3]=0,o[l+4]=1,o[l+5]=1,o[l+6]=0,o[l+7]=1}var Mut=new te,Nut=new M,w4=new M,yxe=new m,gxe=new m,xxe=new m,kut=new m,Uut=new m,Out=new m,Xg=new Array(3),MF=new Array(4);MF[0]=new ce(-1,-1,1,1);MF[1]=new ce(1,-1,1,1);MF[2]=new ce(1,1,1,1);MF[3]=new ce(-1,1,1,1);var _xe=new Array(4);for(let e=0;e<4;++e)_xe[e]=new ce;MT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let l=te.fromQuaternion(t,Mut),d=r??yxe,u=s??gxe,f=a??xxe;d=te.getColumn(l,0,d),u=te.getColumn(l,1,u),f=te.getColumn(l,2,f),m.normalize(d,d),m.normalize(u,u),m.normalize(f,f),m.negate(d,d);let p=M.computeView(e,f,u,d,Nut),y,h,g=i.projectionMatrix;if(n===_D){let x=M.multiply(g,p,w4);h=M.inverse(x,w4)}else y=M.inverseTransformation(p,w4);c(h)?(Xg[0]=i.near,Xg[1]=i.far):(Xg[0]=0,Xg[1]=i.near,Xg[2]=i.far);for(let x=0;x<2;++x)for(let S=0;S<4;++S){let V=ce.clone(MF[S],_xe[S]);if(c(h)){V=M.multiplyByVector(h,V,V);let Z=1/V.w;m.multiplyByScalar(V,Z,V),m.subtract(V,e,V),m.normalize(V,V);let R=m.dot(f,V);m.multiplyByScalar(V,Xg[x]/R,V),m.add(V,e,V)}else{let Z=i.offCenterFrustum;c(Z)&&(i=Z);let R=Xg[x],E=Xg[x+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-E)-R-E)*.5,V.w=1,M.multiplyByVector(y,V,V)}o[12*x+S*3]=V.x,o[12*x+S*3+1]=V.y,o[12*x+S*3+2]=V.z}};MT.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,l=new Float64Array(3*4*6);MT._computeNearFarPlanes(i,o,t,n,l);let d=3*4*2;l[d]=l[3*4],l[d+1]=l[3*4+1],l[d+2]=l[3*4+2],l[d+3]=l[0],l[d+4]=l[1],l[d+5]=l[2],l[d+6]=l[3*3],l[d+7]=l[3*3+1],l[d+8]=l[3*3+2],l[d+9]=l[3*7],l[d+10]=l[3*7+1],l[d+11]=l[3*7+2],d+=3*4,l[d]=l[3*5],l[d+1]=l[3*5+1],l[d+2]=l[3*5+2],l[d+3]=l[3],l[d+4]=l[4],l[d+5]=l[5],l[d+6]=l[0],l[d+7]=l[1],l[d+8]=l[2],l[d+9]=l[3*4],l[d+10]=l[3*4+1],l[d+11]=l[3*4+2],d+=3*4,l[d]=l[3],l[d+1]=l[4],l[d+2]=l[5],l[d+3]=l[3*5],l[d+4]=l[3*5+1],l[d+5]=l[3*5+2],l[d+6]=l[3*6],l[d+7]=l[3*6+1],l[d+8]=l[3*6+2],l[d+9]=l[3*2],l[d+10]=l[3*2+1],l[d+11]=l[3*2+2],d+=3*4,l[d]=l[3*2],l[d+1]=l[3*2+1],l[d+2]=l[3*2+2],l[d+3]=l[3*6],l[d+4]=l[3*6+1],l[d+5]=l[3*6+2],l[d+6]=l[3*7],l[d+7]=l[3*7+1],l[d+8]=l[3*7+2],l[d+9]=l[3*3],l[d+10]=l[3*3+1],l[d+11]=l[3*3+2],r||(l=l.subarray(3*4));let u=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l})});if(c(s.normal)||c(s.tangent)||c(s.bitangent)||c(s.st)){let p=c(s.normal)?new Float32Array(12*a):void 0,y=c(s.tangent)?new Float32Array(3*4*a):void 0,h=c(s.bitangent)?new Float32Array(3*4*a):void 0,g=c(s.st)?new Float32Array(2*4*a):void 0,x=yxe,S=gxe,V=xxe,Z=m.negate(x,kut),R=m.negate(S,Uut),E=m.negate(V,Out);d=0,r&&(lL(d,p,y,h,g,E,x,S),d+=3*4),lL(d,p,y,h,g,V,Z,S),d+=3*4,lL(d,p,y,h,g,Z,E,S),d+=3*4,lL(d,p,y,h,g,R,E,Z),d+=3*4,lL(d,p,y,h,g,x,V,S),d+=3*4,lL(d,p,y,h,g,S,V,Z),c(p)&&(u.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:p})),c(y)&&(u.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),c(h)&&(u.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),c(g)&&(u.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:g}))}let f=new Uint16Array(6*a);for(let p=0;p<a;++p){let y=p*6,h=p*4;f[y]=h,f[y+1]=h+1,f[y+2]=h+2,f[y+3]=h,f[y+4]=h+2,f[y+5]=h+3}return new dt({attributes:u,indices:f,primitiveType:ve.TRIANGLES,boundingSphere:ue.fromVertices(l)})};var NT=MT;var e5i=_(T(),1);var P4=0,Dut=1;function NF(e){C.typeOf.object("options",e),C.typeOf.object("options.frustum",e.frustum),C.typeOf.object("options.origin",e.origin),C.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Ci?(r=P4,s=Ci.packedLength):t instanceof sn&&(r=Dut,s=sn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Fe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Fe.packedLength}NF.pack=function(e,t,n){C.typeOf.object("value",e),C.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===P4?(Ci.pack(o,t,n),n+=Ci.packedLength):(sn.pack(o,t,n),n+=sn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Fe.pack(e._orientation,t,n),n+=Fe.packedLength,t[n]=e._drawNearPlane?1:0,t};var But=new Ci,Yut=new sn,Hut=new Fe,zut=new m;NF.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o;i===P4?(o=Ci.unpack(e,t,But),t+=Ci.packedLength):(o=sn.unpack(e,t,Yut),t+=sn.packedLength);let r=m.unpack(e,t,zut);t+=m.packedLength;let s=Fe.unpack(e,t,Hut);t+=Fe.packedLength;let a=e[t]===1;if(!c(n))return new NF({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Fe.clone(s,n._orientation),n._drawNearPlane=a,n};NF.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);NT._computeNearFarPlanes(i,o,t,n,s);let a=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})}),l,d,u=r?2:1,f=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)l=r?p*8:0,d=p*4,f[l]=d,f[l+1]=d+1,f[l+2]=d+1,f[l+3]=d+2,f[l+4]=d+2,f[l+5]=d+3,f[l+6]=d+3,f[l+7]=d;for(p=0;p<2;++p)l=(u+p)*8,d=p*4,f[l]=d,f[l+1]=d+4,f[l+2]=d+1,f[l+3]=d+5,f[l+4]=d+2,f[l+5]=d+6,f[l+6]=d+3,f[l+7]=d+7;return new dt({attributes:a,indices:f,primitiveType:ve.LINES,boundingSphere:ue.fromVertices(s)})};var kF=NF;function TD(e){if(e=e??z.EMPTY_OBJECT,!c(e.camera))throw new L("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??Y.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Kut=new m,Jut=new te,Qut=new Fe,jut=new Ci,qut=new hl,$ut=new sn,emt=new Oo,tmt=new Y,nmt=[1,1e5];TD.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 Ci?a=jut:s instanceof hl?a=qut:s instanceof sn?a=$ut:a=emt,a=s.clone(a);let l,d=this._frustumSplits;!c(d)||d.length<=1?(d=nmt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,l=1):l=d.length-1;let u=r.positionWC,f=r.directionWC,p=r.upWC,y=r.rightWC;y=m.negate(y,Kut);let h=Jut;te.setColumn(h,0,y,h),te.setColumn(h,1,p,h),te.setColumn(h,2,f,h);let g=Fe.fromRotationMatrix(h,Qut);for(t.length=n.length=l,i=0;i<l;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Rt({geometry:new NT({origin:u,orientation:g,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(Y.fromAlpha(this._color,.1,tmt))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Rt({geometry:new kF({origin:u,orientation:g,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};TD.prototype.isDestroyed=function(){return!1};TD.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 he(this)};var op=TD;var O5i=_(T(),1);function OF(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=e??0}var UF=Ot.supportsTypedArrays()?new Float32Array(12):[],Txe=new m,Sxe=new m,v4=new m,Cxe=new m,SD=new m;function imt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof sn)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let f=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,f,Txe),y=m.normalize(p,Sxe),h=m.normalize(m.cross(m.UNIT_Z,p,v4),v4),g=m.normalize(m.cross(y,h,Cxe),Cxe),x=m.magnitude(p),S=Math.sqrt(x*x-1);o=m.multiplyByScalar(y,1/x,Txe);let V=S/x;r=m.multiplyByScalar(h,V,Sxe),s=m.multiplyByScalar(g,V,v4)}let a=m.add(o,s,SD);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,UF,0);let l=m.subtract(o,s,SD);m.subtract(l,r,l),m.multiplyComponents(n,l,l),m.pack(l,UF,3);let d=m.add(o,s,SD);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,UF,6);let u=m.subtract(o,s,SD);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,UF,9),UF}OF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==se.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(c(this._command)||(this._rs=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new et({renderState:this._rs,boundingVolume:new ue(m.ZERO,i.maximumRadius),pass:Xe.OPAQUE,owner:this})),!c(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Be({sources:[Av]}),a=new Be({sources:[Fv]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=imt(i,e);if(c(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new dt({attributes:{position:new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:ve.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};OF.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};OF.prototype.isDestroyed=function(){return!1};OF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var DF=OF;var j5i=_(T(),1);function uL(){}var omt=/\bgl_FragDepth\b/,rmt=/\bdiscard\b/;function smt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(c(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(omt.test(r[a])||rmt.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); +vec2 packIntToVec2(int value) { +float shifted = float(value) / 255.0; +float lowBits = fract(shifted); +float highBits = floor(shifted) / 255.0; +return vec2(highBits, lowBits); } -`;i=new Be({sources:[a]})}else if(!o&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); +vec2 packFloatToVec2(float value) { +float lowBits = fract(value); +float highBits = floor(value) / 255.0; +return vec2(highBits, lowBits); } -`;i=new Be({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function amt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(c(i))return i;let o=Oe.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Oe.fromCache(o);return n[t.id]=r,r}uL.createDepthOnlyDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=et.shallowClone(t,i.depthOnlyCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=smt(n,t.shaderProgram),i.depthOnlyCommand.renderState=amt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var cmt=/\s+czm_writeLogDepth\(/,lmt=/\s+czm_vertexLogDepth\(/;function dmt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(c(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=c(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,l=r.sources;for(let u=0;u<l.length;++u)if(lmt.test(l[u])){a=!0;break}if(!a){for(let f=0;f<l.length;++f)l[f]=Be.replaceMain(l[f],"czm_log_depth_main");l.push(` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); +int getSampleIndex(in SampleData sampleData) { +vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5); +vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate); +ivec3 sampleIndex = ivec3(floor(inputCoordinate)); +return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z); } -`)}l=s.sources,a=!1;for(let u=0;u<l.length;++u)cmt.test(l[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<l.length;u++)l[u]=Be.replaceMain(l[u],"czm_log_depth_main");d=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); +Ray getViewRayLocal() { +vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord); +vec3 origin; +vec3 direction; +if (czm_orthographicIn3D == 1.0) { +eyeCoordinates.z = 0.0; +origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz; +direction = u_cameraDirectionLocal; +} else { +origin = u_cameraPositionLocal; +direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz); } -`}return l.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}uL.createLogDepthCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=et.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=dmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function umt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(c(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,l=r.some(y=>y.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () -{ - czm_non_pick_main(); - if (${l}.a == 0.0) { - discard; - } - ${l} = ${n}; -} `,u=r.length,f=new Array(u+1);for(let y=0;y<u;++y)f[y]=Be.replaceMain(r[y],"czm_non_pick_main");f[u]=d;let p=new Be({sources:f,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Vxe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(c(i))return i;let o=Oe.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Oe.fromCache(o);return n[t.id]=r,r}uL.createPickDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=et.shallowClone(t,i.pickCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=umt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Vxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function dL(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 Lxe(e){return e.isArray?e.arrayLength:lt.getComponentCount(e.type)}function mmt(e){let t=Lxe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function Zxe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function Rxe(e,t){let n=At.getMaximum(t);return`(${e}) / float(${n})`}function fmt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=Zxe(n,i,o)}return e.normalized||(n=Rxe(n,e.componentType)),n}function hmt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=Zxe(o,r,s)}return e.normalized||(o=Rxe(o,e.componentType)),o}function pmt(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(c(a))return a;let l=n.metadataProperty,d=n.classProperty,u=mmt(d),f=["0.0","0.0","0.0","0.0"],p=Lxe(d);if(p===1)f[0]=fmt(d,l);else{let x=["x","y","z","w"];for(let S=0;S<p;S++)f[S]=hmt(d,l,x[S])}let y=t.fragmentShaderSource.defines.slice();y.push(Ld.METADATA_PICKING_ENABLED),dL(y,Ld.METADATA_PICKING_VALUE_TYPE,u),dL(y,Ld.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_X,f[0]),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_Y,f[1]),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_Z,f[2]),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_W,f[3]);let h=new Be({sources:t.fragmentShaderSource.sources,defines:y});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:h,attributeLocations:t._attributeLocations})}uL.createPickMetadataDerivedCommand=function(e,t,n,i){return c(i)||(i={}),i.pickMetadataCommand=et.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=pmt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Vxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function bmt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(c(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=c(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}uL.createHdrCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=et.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=bmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var rp=uL;var rki=_(T(),1);function CD(e){if(!c(e))throw new L("scene is required.");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(!c(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 ymt=new Fe,Gxe=new Fe,gmt=new te;function xmt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Fe.fromAxisAngle(o,n,Gxe),l=Fe.fromAxisAngle(r,i,ymt),d=Fe.multiply(l,a,l),u=Fe.fromAxisAngle(s,t,Gxe);Fe.multiply(u,d,d);let f=te.fromQuaternion(d,gmt);te.multiplyByVector(f,r,r),te.multiplyByVector(f,s,s),te.multiplyByVector(f,o,o)}CD.prototype.update=function(){if(!c(this._alpha))return;c(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;xmt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};CD.prototype.isDestroyed=function(){return!1};CD.prototype.destroy=function(){return this._removeListener(),he(this)};var BF=CD;var mki=_(T(),1);function F4(){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(F4.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){if(c(e)&&e<0)throw new L("value must be positive.");this._heightFalloff=e}}});var _mt=new m;F4.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!c(i)||i.height>this.maxHeight||e.mode!==se.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,_mt),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 YF=F4;var pki=_(T(),1);function Tmt(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=se.SCENE3D,this.morphTime=se.getMorphTime(se.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 HF=Tmt;var Gki=_(T(),1);var Ca={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},kT=Ca.DERIVED_COMMANDS_MAXIMUM_LENGTH,Mxe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function UT(){this._frontFaceAlphaByDistance=new Nt(0,1,0,1),this._backFaceAlphaByDistance=new Nt(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=de.clone(de.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(kT),this._derivedBlendCommandTypes=new Array(kT),this._derivedPickCommandTypes=new Array(kT),this._derivedCommandTypesToUpdate=new Array(kT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(UT.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}}});UT.prototype.update=function(e){let t=e.globe;if(!c(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Exe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Exe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Xxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Xxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Lmt(this,e,t),this._sunVisibleThroughGlobe=Smt(this,e),this._environmentVisible=Cmt(this,e),this._useDepthPlane=Vmt(this,e),this._numberOfTextureUniforms=Zmt(this),this._rectangle=de.clone(t.translucency.rectangle,this._rectangle),Rmt(this,e)};function Exe(e,t,n,i){return e?c(n)?(Nt.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 Xxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Smt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Cmt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Vmt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Lmt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function Zmt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Rmt(e,t){e._derivedCommandsLength=A4(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=A4(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=A4(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<kT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!c(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Omt())}function A4(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let l=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?Ca.PICK_FRONT_FACE:d?Ca.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ca.TRANSLUCENT_FRONT_FACE,f=i?Ca.PICK_BACK_FACE:d?Ca.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ca.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=Ca.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=Ca.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(o[r++]=u,o[r++]=f):(o[r++]=f,o[r++]=u)):l?(n||(o[r++]=Ca.DEPTH_ONLY_BACK_FACE),o[r++]=Ca.OPAQUE_FRONT_FACE,o[r++]=f):(n||(o[r++]=Ca.DEPTH_ONLY_FRONT_FACE),o[r++]=Ca.OPAQUE_BACK_FACE,o[r++]=u),r)}function pm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Ixe(e,t){return e.indexOf(t)>-1}function Gmt(e,t){pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function Emt(e,t){pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG"),pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function M4(e,t){if(Ixe(t.defines,"TILE_LIMIT_RECTANGLE")||Ixe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function N4(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Be.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 Nxe(e,t){N4(e,t),pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG")}function Xmt(e,t){N4(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Imt(e,t){Nxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Wxe(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 Wmt(e,t,n,i,o,r){if(!c(o))return t;if(!i&&c(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!c(s)){let a=t._attributeLocations,l=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();l.defines=c(l.defines)?l.defines.slice(0):[],d.defines=c(d.defines)?d.defines.slice(0):[],o(l,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:a})}return s}function wmt(e){e.cull.face=_i.BACK,e.cull.enabled=!0}function Pmt(e){e.cull.face=_i.FRONT,e.cull.enabled=!0}function vmt(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Fmt(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Amt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function wxe(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Pxe(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Mmt(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Nmt(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function kmt(e,t,n,i,o){if(!c(i))return e;if(!n&&c(t))return t;let r=o[e.id];if(!c(r)){let s=Oe.getState(e);i(s),r=Oe.fromCache(s),o[e.id]=r}return r}function mL(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Umt(e,t,n,i,o){return c(o)?!i&&c(n)?n:St(t,o(e),!1):t}function Of(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Omt(){return[new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:Gmt,getRenderStateFunction:wmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:Emt,getRenderStateFunction:Pmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:M4,getRenderStateFunction:vmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:M4,getRenderStateFunction:Fmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:M4,getRenderStateFunction:Amt,getUniformMapFunction:void 0}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:N4,getRenderStateFunction:wxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Nxe,getRenderStateFunction:Pxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Xmt,getRenderStateFunction:wxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Imt,getRenderStateFunction:Pxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Wxe,getRenderStateFunction:Mmt,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Wxe,getRenderStateFunction:Nmt,getUniformMapFunction:mL})]}var vxe=new Array(kT),Fxe=new Array(kT);UT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Fxe[o]=this._derivedCommandPacks[n[o]],vxe[o]=Mxe[n[o]];Dmt(this,e,i,n,vxe,Fxe,t)}};function Dmt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!c(a)||l){t.dirty=!1,c(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=a.uniformMapDirtyFrame??0,f=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,y=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,g=a.renderStateId!==t.renderState.id;y&&(a.uniformMapDirtyFrame=d),h&&(a.shaderProgramDirtyFrame=d),g&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let S=r[x],V=i[x],Z=o[x],R=a[Z],E,I,v;c(R)?(E=R.uniformMap,I=R.shaderProgram,v=R.renderState):(E=void 0,I=void 0,v=void 0),R=et.shallowClone(t,R),a[Z]=R;let P=R.derivedCommands.uniformMapDirtyFrame??0,F=R.derivedCommands.shaderProgramDirtyFrame??0,N=R.derivedCommands.renderStateDirtyFrame??0,b=y||P<u,G=h||F<f,X=g||N<p;b&&(R.derivedCommands.uniformMapDirtyFrame=d),G&&(R.derivedCommands.shaderProgramDirtyFrame=d),X&&(R.derivedCommands.renderStateDirtyFrame=d),R.derivedCommands.type=V,R.pass=S.pass,R.pickOnly=S.pickOnly,R.uniformMap=Umt(e,t.uniformMap,E,b,S.getUniformMapFunction),R.shaderProgram=Wmt(s.context,t.shaderProgram,I,G,S.getShaderProgramFunction,Z),R.renderState=kmt(t.renderState,v,X,S.getRenderStateFunction,S.renderStateCache)}}}UT.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 l=Mxe[o[a]];n.commandList.push(s[l])}};function kxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],l=a.derivedCommands.type;(!c(r)||r.indexOf(l)>-1)&&n(a,i,o)}}function Axe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Bmt=[Ca.OPAQUE_FRONT_FACE,Ca.OPAQUE_BACK_FACE],Ymt=[Ca.DEPTH_ONLY_FRONT_FACE,Ca.DEPTH_ONLY_BACK_FACE,Ca.DEPTH_ONLY_FRONT_AND_BACK_FACE];UT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Xe.GLOBE],a=e.indices[Xe.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),kxe(s,a,t,i,o,Bmt))};UT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Xe.GLOBE],l=e.indices[Xe.GLOBE],d=e.commands[Xe.TERRAIN_CLASSIFICATION],u=e.indices[Xe.TERRAIN_CLASSIFICATION];if(l===0||u===0)return;let f=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!f||!p)&&Axe(d,u,t,i,o),!f&&!p)return;this._globeTranslucencyFramebuffer=n;let y=s.globeDepthTexture,h=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,kxe(a,l,t,i,o,Ymt),r.depthTexture){let g=n.packDepth(r,o);s.globeDepthTexture=g}Axe(d,u,t,i,o),s.globeDepthTexture=y,o.framebuffer=h};var zF=UT;var Jki=_(T(),1);var Xki=_(T(),1),td=`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 hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({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 Y(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new Y(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 Hmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},zmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Kmt={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Jmt=`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; -} -`,Qmt=`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,l=!c(i)||i.width!==s||i.height!==a;if((l||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._previousFramebuffer)||(this._depthStencilTexture=new Pt({context:e,width:s,height:a,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new md({context:e,width:s,height:a,format:ac.DEPTH24_STENCIL8,numSamples:t})))),!c(this._fbo.framebuffer)||l||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;c(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),c(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),c(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(c(this._rsUnclassified)||(this._rsUnclassified=Oe.fromCache(Hmt),this._rsClassified=Oe.fromCache(zmt),this._rsDefault=Oe.fromCache(Kmt)),!c(this._unclassifiedCommand)||o||r){c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=c(this._previousFramebuffer)?Qmt:Jmt,u=new Be({defines:["UNCLASSIFIED"],sources:[d]}),f=new Be({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:c(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(f,{renderState:c(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),c(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),c(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(td,{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){c(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(!c(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(),c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),he(this)};var fL=sp;var tUi=_(T(),1);function VD(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(VD.prototype,{total:{get:function(){return this._total}}});function Ig(e){if(c(e)&&e.length!==fa.NUMBER_OF_JOB_TYPES)throw new L("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let t=new Array(fa.NUMBER_OF_JOB_TYPES);t[fa.TEXTURE]=new VD(c(e)?e[fa.TEXTURE]:10),t[fa.PROGRAM]=new VD(c(e)?e[fa.PROGRAM]:10),t[fa.BUFFER]=new VD(c(e)?e[fa.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}Ig.getTimestamp=Ti;Object.defineProperties(Ig.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Ig.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Ig.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};Ig.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 l=n.length,d;for(d=0;d<l&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===l&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Ig.getTimestamp();e.execute();let a=Ig.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var KF=Ig;var lUi=_(T(),1);function LD(e){e=e??z.EMPTY_OBJECT;let t=Wn(e.container);if(!c(t))throw new L("container is required");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=Ti(),this._lastMsSampleTime=Ti(),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(LD.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});LD.prototype.update=function(e){let t=Ti(),n=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}};LD.prototype.destroy=function(){return he(this)};var p0=LD;var m3i=_(T(),1);var SUi=_(T(),1);var Va={};Va.decodeRawMetadataValue=function(e,t,n){switch(e){case At.INT8:return t.getInt8(n);case At.UINT8:return t.getUint8(n);case At.INT16:return t.getInt16(n,!0);case At.UINT16:return t.getUint16(n,!0);case At.INT32:return t.getInt32(n,!0);case At.UINT32:return t.getUint32(n,!0);case At.INT64:return t.getBigInt64(n,!0);case At.UINT64:return t.getBigUint64(n,!0);case At.FLOAT32:return t.getFloat32(n,!0);case At.FLOAT64:return t.getFloat64(n,!0)}throw new le(`Invalid component type: ${e}`)};Va.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Va.decodeRawMetadataValue(i,t,n);return e.normalized?At.normalize(o,i):o};Va.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=At.getSizeInBytes(i),r=e.type,s=lt.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let f=0;f<s;f++){let p=n*a+f*o,y=Va.decodeRawMetadataValueComponent(e,t,p);u[f]=y}return u}let l=n*a;return Va.decodeRawMetadataValueComponent(e,t,l)};Va.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=Va.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Va.decodeRawMetadataValueElement(e,n,0)};Va.convertToObjectType=function(e,t){if(!c(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case lt.VEC2:return D.unpack(n,0,new D);case lt.VEC3:return m.unpack(n,0,new m);case lt.VEC4:return ce.unpack(n,0,new ce);case lt.MAT2:return Ii.unpack(n,0,new Ii);case lt.MAT3:return te.unpack(n,0,new te);case lt.MAT4:return M.unpack(n,0,new M)}throw new le(`Invalid metadata object type: ${e}`)};Va.convertFromObjectType=function(e,t){if(!c(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;switch(e){case lt.VEC2:return D.pack(t,Array(2));case lt.VEC3:return m.pack(t,Array(3));case lt.VEC4:return ce.pack(t,Array(4));case lt.MAT2:return Ii.pack(t,Array(4));case lt.MAT3:return te.pack(t,Array(9));case lt.MAT4:return M.pack(t,Array(16))}throw new le(`Invalid metadata object type: ${e}`)};Va.decodeMetadataValues=function(e,t,n){let i=Va.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Va.convertFromObjectType(e.type,t.offset),s=Va.convertFromObjectType(e.type,t.scale);i=gh.valueTransformInPlace(i,r,s,At.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let l=i[a],d=Va.convertToObjectType(e.type,l);s[a]=d}return s}return Va.convertToObjectType(e.type,i)};var JF=Object.freeze(Va);var EUi=_(T(),1);function OT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(OT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function jmt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function qmt(e,t,n){c(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:Oe.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}OT.prototype.update=function(e,t){jmt(this,e,t),qmt(this,e,t)};var $mt=new ce,eft=new ce(1,1/255,1/65025,1/16581375);OT.prototype.getDepth=function(e,t,n){if(!c(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ce.unpack(i,0,$mt);return ce.divideByScalar(o,255,o),ce.dot(o,eft)};OT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};OT.prototype.isDestroyed=function(){return!1};OT.prototype.destroy=function(){return this._framebuffer.destroy(),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=c(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),he(this)};var QF=OT;var MBi=_(T(),1);var WUi=_(T(),1);function tft(e,t){this.near=e??0,this.far=t??0;let n=Xe.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 jF=tft;var QUi=_(T(),1);var PUi=_(T(),1),Wg=`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 hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({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 je,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 Uxe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!je.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),a=!0),(!c(e._rs)||!je.equals(r,e._rs.viewport)||a)&&(e._rs=Oe.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Oe.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Oe.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Wg,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,c(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,c(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Wg,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,c(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,c(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new Y(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,l=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,l),this._copyDepthFramebuffer.update(e,s,a),Uxe(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){c(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=c(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){c(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!c(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!c(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),Uxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};ap.prototype.executeCopyColor=function(e,t){c(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};ap.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;c(i)&&(Y.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(),c(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),c(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),c(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),he(this)};var qF=ap;var aOi=_(T(),1);function DT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(DT.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 nft(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function ift(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function oft(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!je.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),s=!0),(!c(e._renderState)||!je.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Wg,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),c(e._clearCommand)||(e._clearCommand=new ti({color:new Y(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}DT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;ift(this,n,o,r,e),oft(this,n,o,r,i),this._useHdr=e};DT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};DT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};DT.prototype.isDestroyed=function(){return!1};DT.prototype.destroy=function(){return nft(this),he(this)};var $F=DT;var ZOi=_(T(),1);function b0(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 hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new Y(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new Y(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new Y(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new Y(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 je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Oxe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function k4(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Dxe(e){Oxe(e),k4(e)}function rft(e,t,n,i){Oxe(e),e._accumulationTexture=new Pt({context:t,width:n,height:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function sft(e,t){k4(e);let n=oe.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)&&(k4(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,l=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!l||!d)&&(Dxe(e),e._translucentMultipassSupport=!1,i=!1)}return i}b0.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,l=!c(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((l||d)&&(this._numSamples=o,rft(this,e,r,s)),(!c(this._translucentFBO.framebuffer)||l||d)&&!sft(this,e))return;this._useHDR=i;let u=this,f,p;c(this._compositeCommand)||(f=new Be({sources:[vv]}),this._translucentMRTSupport&&f.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(f,{uniformMap:p,owner:this})),c(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(f=new Be({defines:["MRT"],sources:[kV]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(f=new Be({sources:[kV]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let y=!je.equals(this._viewport,t.viewport),h=y!==this._useScissorTest;this._useScissorTest=y,je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=je.clone(t.viewport,this._scissorRectangle),h=!0),(!c(this._rs)||!je.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Oe.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),c(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var aft={enabled:!0,color:new Y(0,0,0,0),equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA},cft={enabled:!0,color:new Y(0,0,0,0),equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationAlpha:Co.ONE},lft={enabled:!0,color:new Y(0,0,0,0),equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ZERO,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA};function U4(e,t,n,i){let o=n[i.id];if(!c(o)){let r=Oe.getState(i);r.depthMask=!1,r.blending=t,o=Oe.fromCache(r),n[i.id]=o}return o}function dft(e,t,n){return U4(t,aft,e._translucentRenderStateCache,n)}function uft(e,t,n){return U4(t,cft,e._translucentRenderStateCache,n)}function mft(e,t,n){return U4(t,lft,e._alphaRenderStateCache,n)}var fft=` 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); -`,hft=` 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 O4(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(c(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return Be.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 l=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<l.length;u++){let f=l[u];d=`layout (location = ${f[1]}) out vec4 ${f[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 bft(e,t){return O4(e,t,"translucentMRT",fft)}function yft(e,t){return O4(e,t,"translucentMultipass",hft)}function gft(e,t){return O4(e,t,"alphaMultipass",pft)}b0.prototype.createDerivedCommands=function(e,t,n){if(c(n)||(n={}),this._translucentMRTSupport){let a,l;return c(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,l=n.translucentCommand.renderState),n.translucentCommand=et.shallowClone(e,n.translucentCommand),!c(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=bft(t,e.shaderProgram),n.translucentCommand.renderState=dft(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=l),n}let i,o,r,s;return c(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=et.shallowClone(e,n.translucentCommand),n.alphaCommand=et.shallowClone(e,n.alphaCommand),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=yft(t,e.shaderProgram),n.translucentCommand.renderState=uft(this,t,e.renderState),n.alphaCommand.shaderProgram=gft(t,e.shaderProgram),n.alphaCommand.renderState=mft(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 xft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:d}=a,u=t._hdr,f=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 y=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let h=0;h<o.length;++h){let g=o[h];g=l?g.derivedCommands.logDepth.command:g,g=u?g.derivedCommands.hdr.command:g;let x=p&&g.receiveShadows?g.derivedCommands.oit.shadows.translucentCommand:g.derivedCommands.oit.translucentCommand;n(x,t,i,y)}if(c(r)){let h=r.unclassifiedCommand,g=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;n(g,t,i,y)}i.framebuffer=e._alphaFBO.framebuffer;for(let h=0;h<o.length;++h){let g=o[h];g=l?g.derivedCommands.logDepth.command:g,g=u?g.derivedCommands.hdr.command:g;let x=p&&g.receiveShadows?g.derivedCommands.oit.shadows.alphaCommand:g.derivedCommands.oit.alphaCommand;n(x,t,i,y)}if(c(r)){let h=r.unclassifiedCommand,g=p&&h.receiveShadows?h.derivedCommands.oit.shadows.alphaCommand:h.derivedCommands.oit.alphaCommand;n(g,t,i,y)}i.framebuffer=f}function _ft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:d}=a,u=t._hdr,f=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let y=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let h=0;h<o.length;++h){let g=o[h];g=l?g.derivedCommands.logDepth.command:g,g=u?g.derivedCommands.hdr.command:g;let x=p&&g.receiveShadows?g.derivedCommands.oit.shadows.translucentCommand:g.derivedCommands.oit.translucentCommand;n(x,t,i,y)}if(c(r)){let h=r.unclassifiedCommand,g=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;n(g,t,i,y)}i.framebuffer=f}b0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){_ft(this,e,t,n,i,o);return}xft(this,e,t,n,i,o)};b0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};b0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,Y.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};b0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};b0.prototype.isDestroyed=function(){return!1};b0.prototype.destroy=function(){return Dxe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),he(this)};var eA=b0;var WOi=_(T(),1);function tA(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(tA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Tft(e){e._framebuffer.destroy()}function Sft(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new sc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new je},o.viewport=new je,e._passState=o}tA.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Sft(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};tA.prototype.isDestroyed=function(){return!1};tA.prototype.destroy=function(){return Tft(this),he(this)};var nA=tA;var kOi=_(T(),1);function hL(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new je},t.viewport=new je,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}hL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return je.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 iA=new Y;hL.prototype.end=function(e){let t=e.width??1,n=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),l=Math.floor(n*.5),d=0,u=0,f=0,p=-1;for(let y=0;y<s;++y){if(-a<=d&&d<=a&&-l<=u&&u<=l){let h=4*((l-u)*t+d+a);iA.red=Y.byteToFloat(o[h]),iA.green=Y.byteToFloat(o[h+1]),iA.blue=Y.byteToFloat(o[h+2]),iA.alpha=Y.byteToFloat(o[h+3]);let g=i.getObjectByPickColor(iA);if(c(g))return g}if(d===u||d<0&&-d===u||d>0&&d===1-u){let h=f;f=-p,p=h}d+=f,u+=p}};hL.prototype.readCenterPixel=function(e){let t=e.width??1,n=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)};hL.prototype.isDestroyed=function(){return!1};hL.prototype.destroy=function(){return this._fb.destroy(),he(this)};var oA=hL;var zOi=_(T(),1);function y0(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new Y(0,0,0,0),this._clearCommand=new ti({color:new Y(0,0,0,0),depth:1,owner:this})}function Cft(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(y0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});y0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};y0.prototype.clear=function(e,t,n){Y.clone(n,this._clearCommand.color),Y.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};y0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};y0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};y0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};y0.prototype.isDestroyed=function(){return!1};y0.prototype.destroy=function(){return Cft(this),he(this)};var BT=y0;var YDi=_(T(),1);var jOi=_(T(),1);function YT(){}YT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};YT.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=Be.findPositionVarying(e),s=c(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=Be.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 Be({defines:i,sources:o})};YT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Be.findPositionVarying(e),a=c(s);a||(s="v_positionEC");let l=r.length;for(let u=0;u<l;++u)r[u]=Be.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 Be({defines:o,sources:r})};YT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,l=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${l}${d}${u}${t}${n}${i}`};YT.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 Be({defines:i,sources:o})};YT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Be.findNormalVarying(e),s=!i&&c(r)||i&&o,a=Be.findPositionVarying(e),l=c(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,f=t._isPointLight,p=t._isSpotLight,y=t._numberOfCascades>1,h=t.debugCascadeColors,g=t.softShadows,x=f?t._pointBias:i?t._terrainBias:t._primitiveBias,S=e.defines.slice(0),V=e.sources.slice(0),Z=V.length;for(let I=0;I<Z;++I)V[I]=Be.replaceMain(V[I],"czm_shadow_receive_main");f?S.push("USE_CUBE_MAP_SHADOW"):d&&S.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!f&&S.push("USE_SOFT_SHADOWS"),y&&n&&i&&(s?S.push("ENABLE_VERTEX_LIGHTING"):S.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(S.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&S.push("USE_NORMAL_SHADING_SMOOTH"));let R="";f?R+=`uniform samplerCube shadowMap_textureCube; -`:R+=`uniform sampler2D shadowMap_texture; -`;let E;return l?E=` return vec4(${a}, 1.0); -`:E=`#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() -{ -${E}} -vec3 getNormalEC() -{ -${s?` return normalize(${r}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${x.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); -`),f?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); -`:y?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); -${h?` // 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 Be({defines:S,sources:V})};var cp=YT;function lp(e){e=e??z.EMPTY_OBJECT;let t=e.context;if(!c(t))throw new L("context is required.");if(!c(e.lightCamera))throw new L("lightCamera is required.");if(c(e.numberOfCascades)&&e.numberOfCascades!==1&&e.numberOfCascades!==4)throw new L("Only one or four cascades are supported.");this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Ot.isInternetExplorer()||Ot.isEdge()||(Ot.isChrome()||Ot.isFirefox())&&Ot.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 M,this._shadowMapTexture=void 0,this._lightDirectionEC=new m,this._lightPositionEC=new ce,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ZD,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?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 Oo:c(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ce,new ce],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new ce;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 Vft(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,B4(this),this._clearCommand=new ti({depth:1,color:new Y}),this._clearPassState=new sc(t),this._size=e.size??2048,this.size=this._size}lp.MAXIMUM_DISTANCE=2e4;function Vft(e){this.camera=new ZD,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function D4(e,t){return Oe.fromCache({cull:{enabled:!0,face:_i.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 B4(e){let t=!e._usesDepthTexture;e._primitiveRenderState=D4(t,e._primitiveBias),e._terrainRenderState=D4(t,e._terrainBias),e._pointRenderState=D4(t,e._pointBias)}lp.prototype.debugCreateRenderStates=function(){B4(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){Xft(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 Y4(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;c(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Lft(e,t){let n=new md({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ac.DEPTH_COMPONENT16}),i=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.NEAREST}),o=new Fr({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 Zft(e,t){let n=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:en.NEAREST}),i=new Fr({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 Rft(e,t){let n=new md({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ac.DEPTH_COMPONENT16}),i=new Uo({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Fr({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 Hxe(e,t){e._isPointLight?Rft(e,t):e._usesDepthTexture?Zft(e,t):Lft(e,t)}function Gft(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==oe.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,B4(e),Y4(e),Hxe(e,t))}function Eft(e,t){(!c(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Y4(e),Hxe(e,t),Gft(e,t),zxe(e,t))}function zxe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Xft(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=mt.maximumCubeMapSize>=t?t:mt.maximumCubeMapSize,o.x=t,o.y=t;let r=new je(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=mt.maximumTextureSize>=t?t:mt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new je(0,0,t,t)):i===4&&(t=mt.maximumTextureSize>=t*2?t:mt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new je(0,0,t,t),n[1].passState.viewport=new je(t,0,t,t),n[2].passState.viewport=new je(0,t,t,t),n[3].passState.viewport=new je(t,t,t,t));e._clearPassState.viewport=new je(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,l=a.x/o.x,d=a.y/o.y,u=a.width/o.x,f=a.height/o.y;s.textureOffsets=new M(u,0,0,l,0,f,0,d,0,0,1,0,0,0,0,1)}}var Ift=new je;function Wft(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=Xe.OVERLAY,i}function wft(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Ift;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;c(a)||(a=Wft(e,n),e._debugShadowViewCommand=a),(!c(a.renderState)||!je.equals(a.renderState.viewport,s))&&(a.renderState=Oe.fromCache({viewport:je.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var dp=new Array(8);dp[0]=new ce(-1,-1,-1,1);dp[1]=new ce(1,-1,-1,1);dp[2]=new ce(1,1,-1,1);dp[3]=new ce(-1,1,-1,1);dp[4]=new ce(-1,-1,1,1);dp[5]=new ce(1,-1,1,1);dp[6]=new ce(1,1,1,1);dp[7]=new ce(-1,1,1,1);var wg=new M,H4=new Array(8);for(let e=0;e<8;++e)H4[e]=new ce;function Pft(e,t){let n=new Rt({geometry:new Fm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new Rt({geometry:new Ib({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var vft=[Y.RED,Y.GREEN,Y.BLUE,Y.MAGENTA],Fft=new m;function Aft(e,t){wft(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:Y.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:Y.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:vft[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!c(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Fe.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,Fft),a=M.fromTranslationQuaternionRotationScale(i,o,s,wg);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Pft(a,Y.YELLOW)}e._debugLightFrustum.update(t)}else(!c(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:Y.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ZD(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new pe,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 M}ZD.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),pe.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 Mft=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ZD.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(Mft,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Nft=new Array(5),kft=new Ci,Uft=new Array(4),Kxe=new m,Jxe=new m;function Oft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,l=r-o,d=r/o,u=.9,f=!1;t.shadowState.closestObjectSize<200&&(f=!0,u=.9);let p=Uft,y=Nft;for(y[0]=o,y[s]=r,a=0;a<s;++a){let N=(a+1)/s,b=o*Math.pow(d,N),G=o+l*N,X=w.lerp(G,b,u);y[a+1]=X,p[a]=X-y[a]}if(f){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=y[0];for(a=0;a<s-1;++a)N+=p[a],y[a+1]=N}ce.unpack(y,0,e._cascadeSplits[0]),ce.unpack(y,1,e._cascadeSplits[1]),ce.unpack(p,0,e._cascadeDistances);let h=n.frustum,g=h.left,x=h.right,S=h.bottom,V=h.top,Z=h.near,R=h.far,E=n.positionWC,I=n.directionWC,v=n.upWC,P=i.frustum.clone(kft),F=n.getViewProjection();for(a=0;a<s;++a){P.near=y[a],P.far=y[a+1];let N=M.multiply(P.projectionMatrix,i.viewMatrix,wg),b=M.inverse(N,wg),G=M.multiply(F,b,wg),X=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Kxe),W=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Jxe);for(let H=0;H<8;++H){let U=ce.clone(dp[H],H4[H]);M.multiplyByVector(G,U,U),m.divideByScalar(U,U.w,U),m.minimumByComponent(U,X,X),m.maximumByComponent(U,W,W)}X.x=Math.max(X.x,0),X.y=Math.max(X.y,0),X.z=0,W.x=Math.min(W.x,1),W.y=Math.min(W.y,1),W.z=Math.min(W.z,1);let A=e._passes[a],k=A.camera;k.clone(n);let B=k.frustum;B.left=g+X.x*(x-g),B.right=g+W.x*(x-g),B.bottom=S+X.y*(V-S),B.top=S+W.y*(V-S),B.near=Z+X.z*(R-Z),B.far=Z+W.z*(R-Z),A.cullingVolume=k.frustum.computeCullingVolume(E,I,v);let O=e._cascadeMatrices[a];M.multiply(k.getViewProjection(),i.inverseViewMatrix,O),M.multiply(A.textureOffsets,O,O)}}var Dft=new M,Bft=new m,Yft=new m,Bxe=new m;function Hft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,wg),r=M.inverse(o,wg),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,w.EPSILON10)&&(a=i.upWC);let l=m.cross(s,a,Bft);a=m.cross(l,s,Yft),m.normalize(a,a),m.normalize(l,l);let d=m.fromElements(0,0,0,Bxe),u=M.computeView(d,s,a,l,Dft),f=M.multiply(u,r,wg),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Kxe),y=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Jxe);for(let R=0;R<8;++R){let E=ce.clone(dp[R],H4[R]);M.multiplyByVector(f,E,E),m.divideByScalar(E,E.w,E),m.minimumByComponent(E,p,p),m.maximumByComponent(E,y,y)}y.z+=1e3,p.z-=10;let h=Bxe;h.x=-(.5*(p.x+y.x)),h.y=-(.5*(p.y+y.y)),h.z=-y.z;let g=M.fromTranslation(h,wg);u=M.multiply(g,u,u);let x=.5*(y.x-p.x),S=.5*(y.y-p.y),V=y.z-p.z,Z=n.frustum;Z.left=-x,Z.right=x,Z.bottom=-S,Z.top=S,Z.near=.01,Z.far=V,M.clone(u,n.viewMatrix),M.inverse(u,n.inverseViewMatrix),M.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(l,n.rightWC)}var zft=[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)],Kft=[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)],Jft=[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 Qft(e,t){let n=new Ci;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=zft[i],o.upWC=Kft[i],o.rightWC=Jft[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var jft=new m,qft=new m,Qxe=new ue,Yxe=Qxe.center;function $ft(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Qxe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,jft),s=m.negate(i.directionWC,qft),a=m.dot(r,s);if(e.fadingEnabled){let l=w.clamp(a/.1,0,1);e._darkness=w.lerp(1,e.darkness,l)}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)===zt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ue.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,Yxe),Yxe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===zt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ue.clone(o,e._boundingSphere)}}function eht(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;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,l;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),l=Math.min(t.shadowState.farPlane,e.maximumDistance),l=Math.max(l,a+1)):(a=n.frustum.near,l=e.maximumDistance),e._sceneCamera=oo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=l,e._distance=l-a,$ft(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}lp.prototype.update=function(e){if(eht(this,e),this._needsUpdate)if(Eft(this,e.context),this._isPointLight&&Qft(this,e),this._cascadesEnabled&&(Hft(this,e),this._numberOfCascades>1&&Oft(this,e)),this._isPointLight)this._shadowMapCullingVolume=fs.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;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Aft(this,e)};lp.prototype.updatePass=function(e,t){zxe(this,e,t)};var tht=new D;function jxe(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=tht;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ce.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ce.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ce,combinedUniforms2:new ce};return St(t,o,!1)}function nht(e,t,n,i,o,r){let s,a,l;if(c(r)&&(s=r.shaderProgram,a=r.renderState,l=r.uniformMap),r=et.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!c(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Xe.GLOBE,f=n.pass!==Xe.TRANSLUCENT,p=e._isPointLight,y=e._usesDepthTexture,h=cp.getShadowCastShaderKeyword(p,u,y,f);if(s=i.shaderCache.getDerivedShaderProgram(d,h),!c(s)){let x=d.vertexShaderSource,S=d.fragmentShaderSource,V=cp.createShadowCastVertexShader(x,p,u),Z=cp.createShadowCastFragmentShader(S,p,y,f);s=i.shaderCache.createDerivedShaderProgram(d,h,{vertexShaderSource:V,fragmentShaderSource:Z,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=He(a,!1),a.cull=He(a.cull,!1),a.cull.enabled=!1,a=Oe.fromCache(a)),l=jxe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=l,r}lp.createReceiveDerivedCommand=function(e,t,n,i,o){c(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,l=s.fragmentShaderSource,d=t.pass===Xe.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let f,p;c(o.receiveCommand)&&(f=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=et.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let y=o.receiveShaderCastShadows!==t.castShadows,h=o.receiveShaderProgramId!==t.shaderProgram.id;if(!c(f)||h||n||y){let g=cp.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(f=i.shaderCache.getDerivedShaderProgram(s,g),!c(f)){let x=cp.createShadowReceiveVertexShader(a,d,u),S=cp.createShadowReceiveFragmentShader(l,e[0],t.castShadows,d,u);f=i.shaderCache.createDerivedShaderProgram(s,g,{vertexShaderSource:x,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=jxe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=f,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};lp.createCastDerivedCommand=function(e,t,n,i,o){if(c(o)||(o={}),t.castShadows){let r=o.castCommands;c(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let l=0;l<a;++l)r[l]=nht(e[l],n,t,i,s,r[l]);o.castShaderProgramId=t.shaderProgram.id}return o};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){Y4(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 he(this)};var g0=lp;var hBi=_(T(),1);var zDi=_(T(),1),HT=`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)) +return Ray(origin, direction); +} +Ray getViewRayEC() { +vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord); +vec3 viewPosEC = (czm_orthographicIn3D == 1.0) +? vec3(eyeCoordinates.xy, 0.0) +: vec3(0.0); +vec3 viewDirEC = normalize(eyeCoordinates.xyz); +return Ray(viewPosEC, viewDirEC); +} +void main() { +Ray viewRayLocal = getViewRayLocal(); +Ray viewRayEC = getViewRayEC(); +Intersections ix; +vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; +RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix); +if (shapeIntersection.entry.w == NO_HIT) { discard; } -#else -color.rgb /= color.a; +float currentT = shapeIntersection.entry.w; +float endT = shapeIntersection.exit.w; +vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir; +TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC); +vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir; +mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal); +TraversalData traversalData; +SampleData sampleDatas[SAMPLE_COUNT]; +traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas); +vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT); +FragmentInput fragmentInput; +#if defined(STATISTICS) +setStatistics(fragmentInput.metadataStatistics); #endif -out_FragColor = color; +czm_modelMaterial materialOutput; +vec4 colorAccum = vec4(0.0); +for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { +Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); +copyPropertiesToMetadata(properties, fragmentInput.metadata); +fragmentInput.attributes.positionEC = positionEC; +fragmentInput.attributes.normalEC = normalize(step.xyz); +fragmentInput.voxel.viewDirUv = viewRayLocal.dir; +fragmentInput.voxel.travelDistance = step.w; +fragmentInput.voxel.stepCount = stepCount; +fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex; +fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]); +fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT; +fragmentMain(fragmentInput, materialOutput); +vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); +color.rgb = max(color.rgb, vec3(0.0)); +color.a = clamp(color.a, 0.0, 1.0); +colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); +if (colorAccum.a > ALPHA_ACCUM_MAX) { +colorAccum.a = ALPHA_ACCUM_MAX; +break; +} +if (step.w == 0.0) { +step.w = 0.001; +} +currentT += step.w; +if (currentT > endT) { +#if (INTERSECTION_COUNT == 1) +break; +#else +shapeIntersection = nextIntersection(ix); +if (shapeIntersection.entry.w == NO_HIT) { +break; +} else { +currentT = shapeIntersection.entry.w; +endT = shapeIntersection.exit.w; +} #endif } -`;var iht=!1;function Pg(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,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 Y(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new je,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(Pg.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function qxe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function $xe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function oht(e,t,n,i){qxe(e),e._translucentDepthStencilTexture=new Pt({context:t,width:n,height:i,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:en.NEAREST})}function rht(e,t,n,i){$xe(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 sht(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)&&(oht(e,t,o,r),rht(e,t,o,r));let s,a;if(c(e._packDepthCommand)||(s=new Be({sources:[Pv]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!c(e._compositeCommand)){s=new Be({sources:[HT]}),a={colorTexture:function(){return e._textureToComposite}},iht&&(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,f=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(f,"pick",{vertexShaderSource:f.vertexShaderSource,fragmentShaderSource:new Be({sources:s.sources,defines:["PICK"]}),attributeLocations:f._attributeLocations}),y=et.shallowClone(u);y.shaderProgram=p,u.derivedCommands.pick=y}c(e._copyCommand)||(s=new Be({sources:[HT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),c(e._accumulateCommand)||(s=new Be({sources:[HT]}),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 l=!je.equals(e._viewport,n.viewport),d=l!==e._useScissorTest;e._useScissorTest=l,je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=je.clone(n.viewport,e._scissorRectangle),d=!0),(!c(e._rsDepth)||!je.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!c(e._rsAccumulate)||!je.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),c(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!c(e._rsComp)||!je.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),c(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Pg.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let l=0;l<i.length;++l){let d=i[l];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){sht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let l=0;l<i.length;++l){let d=i[l];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}};Pg.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(Xe.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let l=i.commands[Xe.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Xe.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(l[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)};Pg.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),aht(this,e,t)};function aht(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}Pg.prototype.isSupported=function(){return this._supported};Pg.prototype.isDestroyed=function(){return!1};Pg.prototype.destroy=function(){return qxe(this),$xe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),he(this)};var rA=Pg;function cht(){this.command=void 0,this.near=void 0,this.far=void 0}function RD(e,t,n){let i=e.context,o;i.depthTexture&&(o=new qF);let r;e._useOIT&&i.depthTexture&&(r=new eA(i));let s=new sc(i);s.viewport=je.clone(n),this.camera=t,this._cameraClone=oo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new oA(i),this.pickDepthFramebuffer=new nA,this.sceneFramebuffer=new BT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new $F,this.oit=r,this.translucentTileClassification=new rA(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var z4=new m,K4=new m;function lht(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,z4)),m.maximumComponent(m.abs(t.position,K4))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,z4),m.multiplyByScalar(t.position,o,K4),m.equalsEpsilon(z4,K4,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}RD.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return lht(t,n,w.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),oo.clone(t,n),!0)};function dht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===se.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;l?(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:f}=e;f.length=u;for(let p=0;p<u;++p){let y,h;l?(y=Math.min(i-d,n+p*d),h=Math.min(i,y+d)):(y=Math.max(n,Math.pow(a,p)*n),h=Math.min(i,a*y));let g=f[p];c(g)?(g.near=y,g.far=h):g=f[p]=new jF(y,h)}}function uht(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 l=s[a];if(o>l.far)continue;if(r<l.near)break;let d=i.pass,u=l.indices[d]++;if(l.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:l}=i,d=a.commandsInFrustums;d[l]=c(d[l])?d[l]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var e_e=new fs,mht=new Ia;RD.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,l=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let F=0;F<u.length;++F)for(let N=0;N<Xe.NUMBER_OF_PASSES;++N)u[F].indices[N]=0;l.length=0,d.length=0;let f=this._commandExtents,p=f.length,y=0,h=+Number.MAX_VALUE,g=-Number.MAX_VALUE,{shadowsEnabled:x}=o,S=+Number.MAX_VALUE,V=-Number.MAX_VALUE,Z=Number.MAX_VALUE,R=t.mode===se.SCENE3D?t.occluder:void 0,{cullingVolume:E}=t,I=e_e.planes;for(let F=0;F<5;++F)I[F]=E.planes[F];E=e_e;for(let F=0;F<i.length;++F){let N=i[F],{pass:b,boundingVolume:G}=N;if(b===Xe.COMPUTE)l.push(N);else if(b===Xe.OVERLAY)d.push(N);else{let X,W;if(c(G)){if(!e.isVisible(E,N,R))continue;let k=G.computePlaneDistances(r,s,mht);if(X=k.start,W=k.stop,h=Math.min(h,X),g=Math.max(g,W),x&&N.receiveShadows&&X<g0.MAXIMUM_DISTANCE&&!(b===Xe.GLOBE&&X<-100&&W>100)){let B=W-X;b!==Xe.GLOBE&&X<100&&(Z=Math.min(Z,B)),S=Math.min(S,X),V=Math.max(V,W)}}else N instanceof ti?(X=a.near,W=a.far):(X=a.near,W=a.far,h=Math.min(h,X),g=Math.max(g,W));let A=f[y];c(A)||(A=f[y]=new cht),A.command=N,A.near=X,A.far=W,y++}}x&&(S=Math.min(Math.max(S,a.near),a.far),V=Math.max(Math.min(V,a.far),S),o.nearPlane=S,o.farPlane=V,o.closestObjectSize=Z),dht(this,e,h,g);for(let F=0;F<y;F++)uht(this,e,f[F]);if(y<p)for(let F=y;F<p;F++){let N=f[F];if(!c(N.command))break;N.command=void 0}let v=u.length,{frustumSplits:P}=t;P.length=v+1;for(let F=0;F<v;++F)P[F]=u[F].near,F===v-1&&(P[F+1]=u[F].far)};RD.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 zT=RD;var n_e=.1,fht=new hm({pass:Fo.MOST_DETAILED_PRELOAD}),hht=new hm({pass:Fo.MOST_DETAILED_PICK}),sA=new hm({pass:Fo.PICK});function na(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new je(0,0,1,1),n=new oo(e);n.frustum=new sn({width:n_e,aspectRatio:1,near:.1}),this._pickOffscreenView=new zT(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 c(i)||(i=new QF,n[t]=i),i};var pht=new Oo,bht=new m,GD=new m,yht=new D,ght=new M;function xht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2*(t.x-o.x)/o.width-1;l*=(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=M.clone(r.transform,ght);r._setTransform(M.IDENTITY);let f=m.clone(r.position,bht);m.multiplyByScalar(r.right,l,GD),m.add(GD,f,f),m.multiplyByScalar(r.up,d,GD),m.add(GD,f,f),r._setTransform(u),e.mode===se.SCENE2D&&m.fromElements(f.z,f.x,f.y,f);let p=s.getPixelDimensions(o.width,o.height,1,1,yht),y=pht;return y.right=p.x*.5,y.left=-y.right,y.top=p.y*.5,y.bottom=-y.top,y.near=s.near,y.far=s.far,y.computeCullingVolume(f,r.directionWC,r.upWC)}var _ht=new hl,Tht=new D;function Sht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,l=Math.tan(s.fovy*.5),d=s.aspectRatio*l,u=2*(t.x-o.x)/o.width-1,f=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,y=f*a*l,h=s.getPixelDimensions(o.width,o.height,1,1,Tht),g=h.x*n*.5,x=h.y*i*.5,S=_ht;return S.top=y+x,S.bottom=y-x,S.right=p+g,S.left=p-g,S.near=a,S.far=s.far,S.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function ED(e,t,n,i,o){let r=e.camera.frustum;return r instanceof sn||r instanceof Oo?xht(e,t,n,i,o):Sht(e,t,n,i,o)}var XD=new je(0,0,3,3),ID=new D,aA=new Y(0,0,0,0);function J4(e,t,n,i,o){return o.width=n??3,o.height=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){C.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=je.clone(a,d.viewport);let u=Oi.transformWindowToDrawingBuffer(e,t,ID),f=J4(o.drawingBufferHeight,u,n,i,XD);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=ED(e,u,f.width,f.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=sA,o.uniformState.update(r),e.updateEnvironment(),d=l.begin(f,a),e.updateAndExecuteCommands(d,aA),e.resolveFramebuffers(d);let p=l.end(f);return o.endFrame(),p};na.prototype.pickVoxelCoordinate=function(e,t,n,i){C.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=je.clone(a,d.viewport);let u=Oi.transformWindowToDrawingBuffer(e,t,ID),f=J4(o.drawingBufferHeight,u,n,i,XD);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=ED(e,u,f.width,f.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=sA,o.uniformState.update(r),e.updateEnvironment(),d=l.begin(f,a),e.updateAndExecuteCommands(d,aA),e.resolveFramebuffers(d);let p=l.readCenterPixel(f);return o.endFrame(),p};na.prototype.pickMetadata=function(e,t,n){C.typeOf.object("windowPosition",t),C.typeOf.object("pickedMetadataInfo",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 l=r.passState;l.viewport=je.clone(s,l.viewport);let d=Oi.transformWindowToDrawingBuffer(e,t,ID),u=J4(i.drawingBufferHeight,d,1,1,XD);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=ED(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=sA,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),l=a.begin(u,s),e.updateAndExecuteCommands(l,aA);let f=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(l),e._environmentState.useOIT=f;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,JF.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Cht(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 l=n.passState;l.viewport=je.clone(s,l.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=ED(e,t,1,1,s),o.tilesetPassState=sA,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,l=a.update(i,t,s),e.updateAndExecuteCommands(l,aA),e.resolveFramebuffers(l),i.endFrame()}var Vht=new Ci,Lht=new hl,Zht=new sn,Rht=new Oo;na.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(C.defined("windowPosition",t),!e.context.depthTexture)throw new L("Picking from the depth buffer is not supported. Check pickPositionSupported.");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:l}=o;e.view=a;let d=Oi.transformWindowToDrawingBuffer(e,t,ID);e.pickTranslucentDepth?Cht(e,d):(e.updateFrameState(),l.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;c(s.frustum.fov)?u=s.frustum.clone(Vht):c(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(Lht):c(s.frustum.width)?u=s.frustum.clone(Zht):u=s.frustum.clone(Rht);let{frustumCommandsList:f}=a,p=f.length;for(let y=0;y<p;++y){let g=this.getPickDepth(e,y).getDepth(o,d.x,d.y);if(c(g)&&g>0&&g<1){let x=f[y],S;return e.mode===se.SCENE2D?(S=s.position.z,s.position.z=S-x.near+1,u.far=Math.max(1,x.far-x.near),u.near=1,l.update(r),l.updateFrustum(u)):(u.near=x.near*(y!==0?e.opaqueFrustumNearOffset:1),u.far=x.far,l.updateFrustum(u)),n=Oi.drawingBufferToWorldCoordinates(e,d,g,n),e.mode===se.SCENE2D&&(s.position.z=S,l.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Ght=new pe;na.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),c(n)&&e.mode!==se.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Ght);o.cartographicToCartesian(r,n)}return n};function i_e(e,t){let n,i,o=[],r=[],s=[],a=[];c(e)||(e=Number.MAX_VALUE);let l=t();for(;c(l);){let d=l.object,u=l.position,f=l.exclude;if(c(u)&&!c(d)){o.push(l);break}if(!c(d)||!c(d.primitive)||!f&&(o.push(l),0>=--e))break;let p=d.primitive,y=!1;typeof p.getGeometryInstanceAttributes=="function"&&c(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),c(i)&&c(i.show)&&(y=!0,i.show=Tn.toValue(!1,i.show),s.push(i))),d instanceof Us&&(y=!0,d.show=!1,a.push(d)),y||(p.show=!1,r.push(p)),l=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=Tn.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 i_e(n,function(){let l=r.pick(e,t,i,o);if(c(l))return{object:l,position:void 0,exclude:!1}}).map(function(l){return l.object})};var t_e=new m,Eht=new m;function Xht(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 o_e(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,t_e),s=m.cross(o,r,t_e),a=m.cross(o,s,Eht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??n_e,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Iht(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,l=o_e(e,o,r,a),d=fht;d.camera=a,d.cullingVolume=l;let u=!0,f=s.length;for(let p=0;p<f;++p){let y=s[p];y.show&&t.primitives.contains(y)&&(y.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)Iht(this,e,t[n])&&t.splice(n--,1)};function r_e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(c(o.isCesium3DTileset)?(!c(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof al&&r_e(o,t,n))}}function WD(e,t,n,i,o,r){let s=[];if(r_e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Xht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Wht(e,t){return!c(e)||!c(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function wht(e,t,n,i,o,r,s){let{context:a,frameState:l}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,o_e(e,n,o,u.camera);let f=je.clone(u.viewport,XD),p=u.pickFramebuffer.begin(f,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=hht:l.tilesetPassState=sA,d.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(p,aA),t.resolveFramebuffers(p);let y,h=u.pickFramebuffer.end(f);if(t.context.depthTexture){let{frustumCommandsList:g}=u,x=g.length;for(let S=0;S<x;++S){let Z=e.getPickDepth(t,S).getDepth(a,0,0);if(c(Z)&&Z>0&&Z<1){let R=g[S],E=R.near*(S!==0?t.opaqueFrustumNearOffset:1),I=R.far,v=E+Z*(I-E);y=bn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),c(h)||c(y))return{object:h,position:y,exclude:!c(y)&&r||Wht(h,i)}}function s_e(e,t,n,i,o,r,s,a){return i_e(i,function(){return wht(e,t,n,o,r,s,a)})}function pL(e,t,n,i,o,r,s){let a=s_e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function a_e(e,t,n,i,o,r,s,a){return s_e(e,t,n,i,o,r,s,a)}function wD(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){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");return pL(this,e,t,n,i,!1,!1)};na.prototype.drillPickFromRay=function(e,t,n,i,o){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");return a_e(this,e,t,n,i,o,!1,!1)};na.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");let o=this;return t=bn.clone(t),n=c(n)?n.slice():n,wD(e,WD(o,e,t,n,i,function(){return pL(o,e,t,n,i,!1,!0)}))};na.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");let r=this;return t=bn.clone(t),i=c(i)?i.slice():i,wD(e,WD(r,e,t,i,o,function(){return a_e(r,e,t,n,i,o,!1,!0)}))};var Pht=new m,vht=new m,Fht=new bn,c_e=new pe;function Q4(e,t){let n=e.ellipsoid,i=ui._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,vht),r=pe.toCartesian(t,n,Pht),s=Fht;s.origin=r,s.direction=o;let a=new bn;return bn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function l_e(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,c_e);return Q4(e,i)}function d_e(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,c_e).height}function Aht(e,t,n,i,o){let r=Q4(t,n);return WD(e,t,r,i,o,function(){let s=pL(e,t,r,i,o,!0,!0);if(c(s))return d_e(t,s.position)})}function Mht(e,t,n,i,o,r){let s=l_e(t,n);return WD(e,t,s,i,o,function(){let a=pL(e,t,s,i,o,!0,!0);if(c(a))return m.clone(a.position,r)})}na.prototype.sampleHeight=function(e,t,n,i){if(C.defined("position",t),e.mode!==se.SCENE3D)throw new L("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new L("sampleHeight requires depth texture support. Check sampleHeightSupported.");let o=Q4(e,t),r=pL(this,e,o,n,i,!0,!1);if(c(r))return d_e(e,r.position)};na.prototype.clampToHeight=function(e,t,n,i,o){if(C.defined("cartesian",t),e.mode!==se.SCENE3D)throw new L("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new L("clampToHeight requires depth texture support. Check clampToHeightSupported.");let r=l_e(e,t),s=pL(this,e,r,n,i,!0,!1);if(c(s))return m.clone(s.position,o)};na.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(C.defined("positions",t),e.mode!==se.SCENE3D)throw new L("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new L("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Aht(this,e,t[s],n,i);return wD(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l].height=s[l];return t}))};na.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(C.defined("cartesians",t),e.mode!==se.SCENE3D)throw new L("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new L("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Mht(this,e,t[s],n,i,t[s]);return wD(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l]=s[l];return t}))};na.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var cA=na;var UHi=_(T(),1);var hHi=_(T(),1);var h3i=_(T(),1),lA=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; +positionEC = viewRayEC.pos + currentT * viewRayEC.dir; +tileAndUv = getTileAndUvCoordinate(positionEC); +positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir; +jacobianT = convertLocalToShapeSpaceDerivative(positionLocal); +traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas); +step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT); +} +colorAccum.a /= ALPHA_ACCUM_MAX; +#if defined(PICKING) +if (colorAccum.a == 0.0) { +discard; +} +out_FragColor = u_pickColor; +#elif defined(PICKING_VOXEL) +if (colorAccum.a == 0.0) { +discard; +} +vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex); +vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0])); +out_FragColor = vec4(megatextureId, sampleIndex); #else -uniform float exposure; +out_FragColor = colorAccum; #endif -void main() +} +`;var qho=x(T(),1),hk=`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 efo=x(T(),1),fk=`#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) { -vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); -vec3 color = fragmentColor.rgb; -#ifdef AUTO_EXPOSURE -color /= texture(autoExposure, vec2(0.5)).r; -#else -color *= vec3(exposure); +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 { +vec4 intersections[INTERSECTION_COUNT * 2]; +float distanceToDepthBuffer; +#if (INTERSECTION_COUNT > 1) +int index; +int surroundCount; +bool surroundIsPositive; #endif -color = czm_acesTonemapping(color); -color = czm_inverseGamma(color); -out_FragColor = vec4(color, fragmentColor.a); +}; +RayShapeIntersection getFirstIntersection(in Intersections ix) +{ +return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); } -`;var b3i=_(T(),1),dA=`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) +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) { -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; -if (depth >= 1.0) { -posEC.z = czm_currentFrustum.y; +float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; +return vec4(intersection.xyz * scale, intersection.w); +} +#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) { +const int sortPasses = INTERSECTION_COUNT * 2 - 1; +for (int n = sortPasses; n > 0; --n) { +for (int i = 0; i < sortPasses; ++i) { +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; +} +} +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) { +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 = intersectionType % 2 == 0; +ix.surroundCount += enter ? +1 : -1; +ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; +if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { +shapeIntersection.entry = surfaceIntersection; +} +bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; +bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; +if (exitPositive || enterNegativeFromPositive) { +shapeIntersection.exit = surfaceIntersection; +if (exitPositive) { +ix.index = passCount; +} +break; +} +} +return shapeIntersection; +} +#endif +`;var nfo=x(T(),1),pk=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); +float entry; +float exit; +if (logDepthOrDepth != 0.0) { +vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); +eyeCoordinateDepth /= eyeCoordinateDepth.w; +entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir); +exit = +INF_HIT; +} else { +entry = NO_HIT; +exit = NO_HIT; +} +ix.distanceToDepthBuffer = entry; +#if defined(DEPTH_TEST) +setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); +#endif +} +`;var ofo=x(T(),1),bk=`uniform sampler2D u_clippingPlanesTexture; +uniform mat4 u_clippingPlanesMatrix; +vec4 intersectPlane(in Ray ray, in vec4 plane) { +vec3 n = plane.xyz; +float w = plane.w; +float a = dot(ray.pos, n); +float b = dot(ray.dir, n); +float t = -(w + a) / b; +return vec4(n, t); +} +#ifdef CLIPPING_PLANES +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) +vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0); +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); +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); +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); } -return posEC; +setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); +#endif } -vec3 getNormalXEdge(vec3 positionEC) -{ -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; -vec3 dx0 = positionEC - positionLeft; -vec3 dx1 = positionRight - positionEC; -vec3 dy0 = positionEC - positionDown; -vec3 dy1 = positionUp - positionEC; -vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1; -vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1; -return normalize(cross(dx, dy)); +#endif +`;var sfo=x(T(),1),dA=`vec4 transformNormalToEC(in vec4 intersection) { +return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } -const float sqrtTwoPi = sqrt(czm_twoPi); -float gaussian(float x, float standardDeviation) { -float argument = x / standardDeviation; -return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation); +RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { +return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit)); } -void main(void) -{ -vec4 positionEC = pixelToEye(gl_FragCoord.xy); -float maxValidDepth = czm_currentFrustum.y - lengthCap; -if (-positionEC.z > maxValidDepth) -{ -out_FragColor = vec4(1.0); -return; +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); } -vec3 normalEC = getNormalXEdge(positionEC.xyz); -float gaussianVariance = lengthCap * sqrt(-positionEC.z); -float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0); -float metersPerPixel = czm_metersPerPixel(positionEC, 1.0); -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); -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; -#if __VERSION__ == 300 -for (int i = 0; i < directionCount; i++) -{ -#else -for (int i = 0; i < 16; i++) +RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) { -if (i >= directionCount) { -break; +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); } -#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 -vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5); -if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) { -break; +void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) +{ +intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false)); +intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true)); } -vec4 samplePositionEC = pixelToEye(samplePixel); -vec3 stepVector = samplePositionEC.xyz - positionEC.xyz; -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); -float sampleDistance = length(stepVector); -float weight = gaussian(sampleDistance, gaussianVariance); -localAO += weight * dotVal; +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; } -ao += localAO; +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); +bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true); +farSide = transformNormalToEC(farSide); +if (hitPositiveSide) { +intersection = transformNormalToEC(intersection); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w); +intersections[1].entry = intersection; +intersections[1].exit = farSide; +} else { +vec4 miss = vec4(normalize(czm_normal * ray.dir), NO_HIT); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = farSide; +intersections[1].entry = miss; +intersections[1].exit = miss; } -ao *= angleStepScale * stepLength; -ao = 1.0 - clamp(ao, 0.0, 1.0); -ao = pow(ao, intensity); -out_FragColor = vec4(vec3(ao), 1.0); } -`;var g3i=_(T(),1),uA=`uniform sampler2D colorTexture; -uniform sampler2D ambientOcclusionTexture; -uniform bool ambientOcclusionOnly; -in vec2 v_textureCoordinates; -void main(void) +RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) { -vec4 color = texture(colorTexture, v_textureCoordinates); -vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); -out_FragColor = ambientOcclusionOnly ? ao : ao * color; +vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); +vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); +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) { +return transformNormalsToEC(RayShapeIntersection(first, last)); +} else if (!exitFromInside && enterFromOutside) { +return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first)); +} else if (exitFromInside && !enterFromOutside) { +return transformNormalsToEC(RayShapeIntersection(last, farSide)); +} else { +return transformNormalsToEC(RayShapeIntersection(miss, miss)); +} +} +`;var cfo=x(T(),1),gk=`uniform sampler2D u_renderBoundPlanesTexture; +RayShapeIntersection intersectBoundPlanes(in Ray ray) { +vec4 lastEntry = vec4(ray.dir, -INF_HIT); +vec4 firstExit = vec4(-ray.dir, +INF_HIT); +for (int i = 0; i < 6; i++) { +vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i); +vec4 intersection = intersectPlane(ray, boundPlane); +if (dot(ray.dir, boundPlane.xyz) < 0.0) { +lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry; +} else { +firstExit = intersection.w < firstExit.w ? intersection: firstExit; } -`;var _3i=_(T(),1),mA=`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); +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -`;var S3i=_(T(),1),fA=`uniform sampler2D colorTexture; -uniform sampler2D bloomTexture; -uniform bool glowOnly; -in vec2 v_textureCoordinates; -void main(void) +} +void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) { -vec4 color = texture(colorTexture, v_textureCoordinates); -#ifdef CZM_SELECTED_FEATURE -if (czm_selected()) { -out_FragColor = color; -return; +RayShapeIntersection intersection = intersectBoundPlanes(rayEC); +setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } +`;var dfo=x(T(),1),yk=`uniform vec2 u_cylinderRenderRadiusMinMax; +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) +uniform vec2 u_cylinderRenderAngleMinMax; #endif -vec4 bloom = texture(bloomTexture, v_textureCoordinates); -out_FragColor = glowOnly ? bloom : bloom + color; +uniform sampler2D u_renderBoundPlanesTexture; +RayShapeIntersection intersectBoundPlanes(in Ray ray) { +vec4 lastEntry = vec4(ray.dir, -INF_HIT); +vec4 firstExit = vec4(-ray.dir, +INF_HIT); +for (int i = 0; i < 2; i++) { +vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i); +vec4 intersection = intersectPlane(ray, boundPlane); +if (dot(ray.dir, boundPlane.xyz) < 0.0) { +lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry; +} else { +firstExit = intersection.w < firstExit.w ? intersection: firstExit; } -`;var V3i=_(T(),1),hA=`uniform sampler2D colorTexture; -uniform float brightness; -in vec2 v_textureCoordinates; -void main(void) +} +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); +} +} +RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) { -vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; -vec3 target = vec3(0.0); -out_FragColor = vec4(mix(target, rgb, brightness), 1.0); +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); } -`;var Z3i=_(T(),1),pA=`uniform sampler2D colorTexture; -uniform float contrast; -uniform float brightness; -in vec2 v_textureCoordinates; -void main(void) +determinant = sqrt(determinant); +float t1 = (-b - determinant) / a; +float t2 = (-b + determinant) / a; +float signFlip = convex ? 1.0 : -1.0; +vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0); +vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0); +vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1); +vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2); +return RayShapeIntersection(intersect1, intersect2); +} +RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius) { -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); +RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true); +RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC); +return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection); } -`;var G3i=_(T(),1),bA=`uniform sampler2D colorTexture; -uniform sampler2D blurTexture; -uniform sampler2D depthTexture; -uniform float focalDistance; -in vec2 v_textureCoordinates; -vec4 toEye(vec2 uv, float depth) +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { -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; +RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y); +setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); +if (outerIntersect.entry.w == NO_HIT) { +return; +} +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) +RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); +setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); +setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); +setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); +setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +#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 } -float computeDepthBlur(float depth) -{ -float f; -if (depth < focalDistance) -{ -f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); +`;var mfo=x(T(),1),xk=`#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); } -else +} +RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex) { -f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); -f = pow(f, 0.1); +vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height); +vec3 position = ray.pos * radiiCorrection; +vec3 direction = ray.dir * radiiCorrection; +float a = dot(direction, direction); +float b = dot(direction, position); +float c = dot(position, position) - 1.0; +float determinant = b * b - a * c; +if (determinant < 0.0) { +vec4 miss = vec4(normalize(direction), NO_HIT); +return RayShapeIntersection(miss, miss); } -f *= f; -f = clamp(f, 0.0, 1.0); -return pow(f, 0.5); +determinant = sqrt(determinant); +float signB = b < 0.0 ? -1.0 : 1.0; +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 * (position + tmin * direction); +vec3 d2 = directionScale * (position + tmax * direction); +vec3 normal1 = normalize(czm_normal * d1); +vec3 normal2 = normalize(czm_normal * d2); +return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax)); } -void main(void) +vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle) { -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); +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; +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) { +return (b == 0.0) +? vec2(NO_HIT) +: vec2(-0.5 * c / b, NO_HIT); } -`;var X3i=_(T(),1),yA=`uniform sampler2D depthTexture; -in vec2 v_textureCoordinates; -void main(void) -{ -float depth = czm_readDepth(depthTexture, v_textureCoordinates); -out_FragColor = vec4(vec3(depth), 1.0); +determinant = sqrt(determinant); +float signB = b < 0.0 ? -1.0 : 1.0; +float t1 = (-b - signB * determinant) / a; +float t2 = c / (a * t1); +float tmin = min(t1, t2); +float tmax = max(t1, t2); +return vec2(tmin, tmax); } -`;var W3i=_(T(),1),gA=`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; +vec3 getConeNormal(in vec3 p, in bool convex) { +vec2 radial = -abs(p.z) * normalize(p.xy); +float zSign = (p.z < 0.0) ? -1.0 : 1.0; +float z = length(p.xy) * zSign; +float flip = (convex) ? -1.0 : 1.0; +return normalize(vec3(radial, z) * flip); } +float getLatitudeConeShift(in float sinLatitude) { +float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; +float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2); +return primeVerticalRadius * u_eccentricitySquared * sinLatitude; } -if (!selected) -{ -out_FragColor = vec4(color.rgb, 0.0); +void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { +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); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = farSide; +intersections[1].entry = miss; +intersections[1].exit = miss; +if (intersect.x == NO_HIT) { 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 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) { +} 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; } -float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); -out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var P3i=_(T(),1),xA=`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 -float exposure = texture(autoExposure, vec2(0.5)).r; -color /= exposure; -#else -color *= vec3(exposure); -#endif -const float A = 0.22; -const float B = 0.30; -const float C = 0.10; -const float D = 0.20; -const float E = 0.01; -const float F = 0.30; -const float white = 11.2; -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); +RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { +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); } -`;var F3i=_(T(),1),_A=`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); +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); } -`;var M3i=_(T(),1),TA=`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 k3i=_(T(),1),vg=`#define SAMPLES 8 -uniform float delta; -uniform float sigma; -uniform float direction; -uniform sampler2D colorTexture; -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { +RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); +setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); +if (outerIntersect.entry.w == NO_HIT) { +return; +} +RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); +if (innerIntersect.entry.w == NO_HIT) { +setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); +} else { +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); +setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); +setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); +setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +} +#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 -in vec2 v_textureCoordinates; -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; +#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 +#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 -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 ffo=x(T(),1),nR=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { +intersectShape(ray, rayEC, ix); +RayShapeIntersection intersection = getFirstIntersection(ix); +if (intersection.entry.w == NO_HIT) { +return intersection; } -`;var O3i=_(T(),1),SA=`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; -#define DISTANCE_TO_SPACE 6500000.0 -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); +#if defined(CLIPPING_PLANES) +intersectClippingPlanes(ray, ix); +#endif +intersectDepth(screenCoord, rayEC, ix); +#if (INTERSECTION_COUNT > 1) +initializeIntersections(ix); +for (int i = 0; i < INTERSECTION_COUNT; ++i) { +intersection = nextIntersection(ix); +if (intersection.exit.w > 0.0) { +intersection.entry.w = max(intersection.entry.w, 0.0); +break; } -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)); } -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 +intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +return intersection; } -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; +`;var bfo=x(T(),1),Tk=`uniform vec3 u_boxLocalToShapeUvScale; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +uniform mat3 u_boxEcToXyz; +mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) { +return mat3(1.0); } -return vec4(clamp(color, 0.0, 1.0), 0.0); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +return shapeUv / u_boxLocalToShapeUvScale; +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 dPosition = u_boxEcToXyz * positionEC; +return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1)); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); +} +`;var yfo=x(T(),1),_k=`uniform vec3 u_cylinderLocalToShapeUvScale; +uniform float u_cylinderShapeUvAngleRangeOrigin; +uniform mat3 u_cylinderEcToRadialTangentUp; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +uniform vec3 u_cameraShapePosition; +mat3 convertLocalToShapeSpaceDerivative(in vec3 position) { +vec3 radial = normalize(vec3(position.xy, 0.0)); +vec3 z = vec3(0.0, 0.0, 1.0); +vec3 east = normalize(vec3(-position.y, position.x, 0.0)); +return mat3(radial, east / length(position.xy), z); } -void main(void) -{ -vec4 originalColor = texture(colorTexture, v_textureCoordinates); -vec3 rgb = originalColor.rgb; -bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; -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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) -{ -out_FragColor = originalColor; -return; +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float radius = shapeUv.x / u_cylinderLocalToShapeUvScale.x; +float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvScale.y; +float height = shapeUv.z / u_cylinderLocalToShapeUvScale.z; +return vec3(radius, angle, height); } -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); -vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; -vec3 direction = normalize(vec3(ghostVec, 0.0)); -vec4 result = vec4(0.0); -vec4 ghost = vec4(0.0); -for (int i = 0; i < 4; ++i) -{ -vec2 offset = fract(texcoord + ghostVec * float(i)); -ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); +vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) { +float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x); +vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle)); +float sinHalfAngle = sin(dAngle / 2.0); +float versine = 2.0 * sinHalfAngle * sinHalfAngle; +float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine; +return vec2(dRadial, dAngle); +} +vec3 convertEcToDeltaShape(in vec3 positionEC) { +vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC; +vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x); +return vec3(dPolar.xy, rtu.z); +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 deltaShape = convertEcToDeltaShape(positionEC); +float dx = u_cylinderLocalToShapeUvScale.x * deltaShape.x; +float dy = deltaShape.y / czm_twoPi; +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) +float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi; +float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin); +float rawOutputUvAngle = cameraUvAngleShift + dy; +float rotation = floor(rawOutputUvAngle); +dy -= rotation; +#endif +dy *= u_cylinderLocalToShapeUvScale.y; +float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1; +tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate); +tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate); +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +if (tileCoordinate.y < 0) { +tileCoordinate.y += (maxTileCoordinate + 1); +} else if (tileCoordinate.y > maxTileCoordinate) { +tileCoordinate.y -= (maxTileCoordinate + 1); } -result += ghost; -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; -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); +#else +tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +#endif +vec3 tileUv = tileUvSum - vec3(tileCoordinateChange); +tileUv.x = clamp(tileUv.x, 0.0, 1.0); +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0); +#else +tileUv.y = clamp(tileUv.y, 0.0, 1.0); +#endif +tileUv.z = clamp(tileUv.z, 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -if (dirtTexCoords.y > 1.0) -{ -dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); +`;var Tfo=x(T(),1),Sk=`uniform vec3 u_cameraPositionCartographic; +uniform vec2 u_ellipsoidCurvatureAtLatitude; +uniform mat3 u_ellipsoidEcToEastNorthUp; +uniform vec3 u_ellipsoidRadii; +uniform vec2 u_evoluteScale; +uniform vec3 u_ellipsoidInverseRadiiSquared; +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +uniform float u_ellipsoidShapeUvLongitudeRangeOrigin; +#endif +uniform vec3 u_ellipsoidLocalToShapeUvScale; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { +vec2 p = abs(pos); +vec2 inverseRadii = 1.0 / radii; +vec2 tTrigs = vec2(0.7071067811865476); +vec2 v = radii * tTrigs; +vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; +const int iterations = 3; +for (int i = 0; i < iterations; ++i) { +vec2 q = normalize(p - evolute) * length(v - evolute); +tTrigs = (q + evolute) * inverseRadii; +tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); +v = radii * tTrigs; +evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; } -result += dirtAmount * texture(dirtTexture, dirtTexCoords); -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; +return vec3(v * sign(pos), length(v - evolute)); } -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; +mat3 convertLocalToShapeSpaceDerivative(in vec3 position) { +vec3 east = normalize(vec3(-position.y, position.x, 0.0)); +float distanceFromZAxis = length(position.xy); +vec2 posEllipse = vec2(distanceFromZAxis, position.z); +vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz); +vec2 surfacePoint = surfacePointAndRadius.xy; +vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz); +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)); +return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up); } -result += texture(colorTexture, v_textureCoordinates); -out_FragColor = result; +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float longitude = shapeUv.x * czm_twoPi; +#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +longitude /= u_ellipsoidLocalToShapeUvScale.x; +#endif +float latitude = shapeUv.y * czm_pi; +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) +latitude /= u_ellipsoidLocalToShapeUvScale.y; +#endif +float height = shapeUv.z / u_ellipsoidLocalToShapeUvScale.z; +return vec3(longitude, latitude, height); } -`;var B3i=_(T(),1),CA=`uniform sampler2D colorTexture; -uniform vec3 white; -in vec2 v_textureCoordinates; -#ifdef AUTO_EXPOSURE -uniform sampler2D autoExposure; -#else -uniform float exposure; +vec3 convertEcToDeltaShape(in vec3 positionEC) { +vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC; +float cosLatitude = cos(u_cameraPositionCartographic.y); +float sinLatitude = sin(u_cameraPositionCartographic.y); +float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x; +vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0); +vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x); +float dLongitude = atan(positionXY.y, positionXY.x); +float sinHalfLongitude = sin(dLongitude / 2.0); +float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude; +enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude); +float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y; +vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0); +vec2 positionZX = cameraZX + vec2(enu.z, enu.y); +float dLatitude = atan(positionZX.y, positionZX.x); +float sinHalfLatitude = sin(dLatitude / 2.0); +float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude; +float dHeight = enu.z + dz; +return vec3(dLongitude, dLatitude, dHeight); +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 deltaShape = convertEcToDeltaShape(positionEC); +float dx = deltaShape.x / czm_twoPi; +#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi; +float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin); +float rawOutputUvLongitude = cameraUvLongitudeShift + dx; +float rotation = floor(rawOutputUvLongitude); +dx -= rotation; +dx *= u_ellipsoidLocalToShapeUvScale.x; +#endif +float dy = deltaShape.y / czm_pi; +#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)) +dy *= u_ellipsoidLocalToShapeUvScale.y; +#endif +float dz = u_ellipsoidLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1; +tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate); +tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate); +#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +if (tileCoordinate.x < 0) { +tileCoordinate.x += (maxTileCoordinate + 1); +} else if (tileCoordinate.x > maxTileCoordinate) { +tileCoordinate.x -= (maxTileCoordinate + 1); +} +#else +tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +#endif +vec3 tileUv = tileUvSum - vec3(tileCoordinateChange); +#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0); +#else +tileUv.x = clamp(tileUv.x, 0.0, 1.0); +#endif +tileUv.y = clamp(tileUv.y, 0.0, 1.0); +tileUv.z = clamp(tileUv.z, 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); +} +`;var Sfo=x(T(),1),Zk=`#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; +uniform ivec3 u_inputDimensions; +#if defined(PADDING) +uniform ivec3 u_paddingBefore; #endif -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); +struct OctreeNodeData { +int data; +int flag; +}; +struct TraversalData { +ivec4 octreeCoords; +int parentOctreeIndex; +}; +struct TileAndUvCoordinate { +ivec4 tileCoords; +vec3 tileUv; +}; +struct SampleData { +int megatextureIndex; +ivec4 tileCoords; +vec3 tileUv; +vec3 inputCoordinate; +#if (SAMPLE_COUNT > 1) +float weight; #endif -color = (color * (1.0 + color / white)) / (1.0 + color); -color = czm_inverseGamma(color); -out_FragColor = vec4(color, fragmentColor.a); +}; +int normU8_toInt(in float value) { +return int(value * 255.0); } -`;var H3i=_(T(),1),VA=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -float rand(vec2 co) -{ -return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); +int normU8x2_toInt(in vec2 value) { +return int(value.x * 255.0) + 256 * int(value.y * 255.0); } -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); +float normU8x2_toFloat(in vec2 value) { +return float(normU8x2_toInt(value)) / 65535.0; } -`;var K3i=_(T(),1),LA=`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 -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); +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; } -`;var Q3i=_(T(),1),ZA=`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); +OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { +int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; +int octreeCoordX = (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); } -`;var rYi=_(T(),1);function KT(){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 hi,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(KT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(c(e))return e[e.length-1].getColorTexture(0)}}});function u_e(e){let t=e._framebuffers;if(!c(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 Nht(e,t){u_e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let l=0;l<r;++l)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[l]=new hi,s[l].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 m_e(e){let t=e._commands;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function kht(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 Uht(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 Oht(e,t){m_e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Uht(r,i),{framebuffer:n[r].framebuffer,uniformMap:kht(e,r)});e._commands=o}KT.prototype.clear=function(e){let t=this._framebuffers;if(!c(t))return;let n=this._clearCommand;c(n)||(n=this._clearCommand=new ti({color:new Y(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};KT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Nht(this,e),Oht(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};KT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};KT.prototype.isDestroyed=function(){return!1};KT.prototype.destroy=function(){return u_e(this),m_e(this),he(this)};var RA=KT;var XYi=_(T(),1);var aYi=_(T(),1),Dht={NEAREST:0,LINEAR:1},qd=Dht;function JT(e){e=e??z.EMPTY_OBJECT;let{name:t=Hn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=qd.NEAREST,pixelFormat:a=ke.RGBA,pixelDatatype:l=Ue.UNSIGNED_BYTE,clearColor:d=Y.BLACK,scissorRectangle:u}=e;if(C.typeOf.string("options.fragmentShader",n),C.typeOf.number.greaterThan("options.textureScale",o,0),C.typeOf.number.lessThanOrEquals("options.textureScale",o,1),!ke.isColorFormat(a))throw new L("options.pixelFormat must be a color format.");this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=l,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 f=new sc;f.scissorTest={enabled:!0,rectangle:c(u)?je.clone(u):new je},this._passState=f,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(JT.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(c(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(c(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 Bht=/uniform\s+sampler2D\s+depthTexture/g;JT.prototype._isSupported=function(e){return!Bht.test(this._fragmentShader)||e.depthTexture};function Yht(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];c(a)&&a!==r&&a instanceof Pt&&!c(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Pt&&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 Hht(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function zht(e,t){return function(){let n=e[t]();if(c(n))return n.dimensions}}function Kht(e){if(c(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]=Hht(e,r),n[r]=Yht(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Pt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=zht(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 Jht(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; +int getOctreeParentIndex(in int octreeIndex) { +int octreeCoordX = (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; } -bool czm_selected() -{ - return czm_selected(vec2(0.0)); +vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) { +int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w; +float scalar = exp2(-1.0 * float(levelDifference)); +vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar; +return tileAndUv.tileUv * scalar + originShift; } - -${e}`}function Qht(e,t){if(c(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(c(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=Jht(n,o)}let i=new Be({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function jht(e){let t=e._sampleMode,n,i;t===qd.LINEAR?(n=Jt.LINEAR,i=di.LINEAR):(n=Jt.NEAREST,i=di.NEAREST);let o=e._sampler;(!c(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function qht(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function $ht(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ept(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let l=n[a];l=l&&l.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:l,source:d}=i[a];e._actualUniforms[l]=new Pt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!c(e._texturePromise)){e._ready=!0;return}if(o.length===0||c(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let l=o[a],d=r[l],u=e._textureCache.getStageByName(d);if(c(u))e._actualUniforms[l]=$ht(e,d);else if(typeof d=="string"){let f=new Ge({url:d});s.push(f.fetchImage().then(qht(e,l)))}else e._texturesToCreate.push({name:l,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 f_e(e){c(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(!c(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 Pt&&(c(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function tpt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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 npt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!c(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];c(a.pickIds)?i+=a.pickIds.length:c(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:en.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(c(a.pickIds)){let l=a.pickIds,d=l.length;for(let u=0;u<d;++u){let f=l[u].color;r[o]=Y.floatToByte(f.red),r[o+1]=Y.floatToByte(f.green),r[o+2]=Y.floatToByte(f.blue),r[o+3]=Y.floatToByte(f.alpha),o+=4}}else if(c(a.pickId)){let l=a.pickId.color;r[o]=Y.floatToByte(l.red),r[o+1]=Y.floatToByte(l.green),r[o+2]=Y.floatToByte(l.blue),r[o+3]=Y.floatToByte(l.alpha),o+=4}}e._selectedIdTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:en.NEAREST})}JT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&f_e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=tpt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0,npt(this,e),Kht(this),ept(this,e),Qht(this,e),jht(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!c(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!c(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Oe.fromCache({viewport:new je(0,0,i.width,i.height)}))),this._command.renderState=o};JT.prototype.execute=function(e,t,n,i){if(!c(this._command)||!c(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,en.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;c(o)&&(o.context=e),this._command.execute(e,o)};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){return f_e(this),he(this)};var mo=JT;var AYi=_(T(),1);function QT(e){e=e??z.EMPTY_OBJECT,C.defined("options.stages",e.stages),C.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;c(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(QT.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}}});QT.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};QT.prototype.get=function(e){return C.typeOf.number.greaterThanOrEquals("index",e,0),C.typeOf.number.lessThan("index",e,this.length),this._stages[e]};function ipt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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}QT.prototype.update=function(e,t){this._selectedDirty=ipt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(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)}};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return he(this)};var nd=QT;var Ir={};function j4(e){let o=`#define USE_STEP_SIZE -${vg}`,r=new mo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:qd.LINEAR}),s=new mo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:qd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(l){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=l}},sigma:{get:function(){return r.uniforms.sigma},set:function(l){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=l}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(l){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=l}}}),new nd({name:e,stages:[r,s],uniforms:a})}Ir.createBlurStage=function(){return j4("czm_blur")};Ir.createDepthOfFieldStage=function(){let e=j4("czm_depth_of_field_blur"),t=new mo({name:"czm_depth_of_field_composite",fragmentShader:bA,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 nd({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Ir.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Ir.createEdgeDetectionStage=function(){let e=Hn();return new mo({name:`czm_edge_detection_${e}`,fragmentShader:gA,uniforms:{length:.25,color:Y.clone(Y.BLACK)}})};Ir.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function opt(e){if(!c(e))return Ir.createEdgeDetectionStage();let t=new nd({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 mo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new nd({name:"czm_edge_detection_composite",stages:[t,s]})}Ir.createSilhouetteStage=function(e){let t=opt(e),n=new mo({name:"czm_silhouette_color_edges",fragmentShader:ZA,uniforms:{silhouetteTexture:t.name}});return new nd({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Ir.isSilhouetteSupported=function(e){return e.context.depthTexture};Ir.createBloomStage=function(){let e=new mo({name:"czm_bloom_contrast_bias",fragmentShader:pA,uniforms:{contrast:128,brightness:-.3}}),t=j4("czm_bloom_blur"),n=new nd({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new mo({name:"czm_bloom_generate_composite",fragmentShader:fA,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 nd({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Ir.createAmbientOcclusionStage=function(){let e=new mo({name:"czm_ambient_occlusion_generate",fragmentShader:dA,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new mo({name:"czm_ambient_occlusion_composite",fragmentShader:uA,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 nd({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Ir.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var rpt=`#define FXAA_QUALITY_PRESET 39 -${Mv} -${TA}`;Ir.createFXAAStage=function(){return new mo({name:"czm_FXAA",fragmentShader:rpt,sampleMode:qd.LINEAR})};Ir.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=lA,new mo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=xA,new mo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=_A,new mo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=LA,new mo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=CA,new mo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:Y.WHITE,autoExposure:void 0,exposure:1}})};Ir.createAutoExposureStage=function(){return new RA};Ir.createBlackAndWhiteStage=function(){return new mo({name:"czm_black_and_white",fragmentShader:mA,uniforms:{gradations:5}})};Ir.createBrightnessStage=function(){return new mo({name:"czm_brightness",fragmentShader:hA,uniforms:{brightness:.5}})};Ir.createNightVisionStage=function(){return new mo({name:"czm_night_vision",fragmentShader:VA})};Ir.createDepthViewStage=function(){return new mo({name:"czm_depth_view",fragmentShader:yA})};Ir.createLensFlareStage=function(){return new mo({name:"czm_lens_flare",fragmentShader:SA,uniforms:{dirtTexture:on("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:on("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var $d=Ir;var SHi=_(T(),1);function x0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function EA(e){for(;c(e.length);)e=e.get(e.length-1);return e.name}function q4(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(c(o)){let a=e.getStageByName(o);r[EA(a)]=!0}let s=i.uniforms;if(c(s)){let a=Object.getOwnPropertyNames(s),l=a.length;for(let d=0;d<l;++d){let u=s[a[d]];if(typeof u=="string"){let f=e.getStageByName(u);c(f)&&(r[EA(f)]=!0)}}}return i.name}function GA(e,t,n,i,o){if(c(i.enabled)&&!i.enabled||c(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!c(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,l=i.length;for(let f=0;f<l;++f){let p=i.get(f);c(p.length)?a=GA(e,t,n,p,o):a=q4(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<l;++d)u=EA(i.get(d)),c(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<l;++d){u=EA(i.get(d));let f=n[u];for(let p=0;p<d;++p)f[EA(i.get(p))]=!0}return a}function spt(e,t){let n={};if(c(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=GA(e,t,n,i,void 0);a=GA(e,t,n,o,a),a=q4(e,t,n,r,a),a=GA(e,t,n,e,a),q4(e,t,n,s,a)}else GA(e,t,n,e,void 0);return n}function apt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,l=o._pixelDatatype,d=o._clearColor,u,f,p=e._framebuffers,y=p.length;for(u=0;u<y;++u){if(f=p[u],r!==f.textureScale||s!==f.forcePowerOfTwo||a!==f.pixelFormat||l!==f.pixelDatatype||!Y.equals(d,f.clearColor))continue;let h=f.stages,g=h.length,x=!1;for(let S=0;S<g;++S)if(n[h[S]]){x=!0;break}if(!x)break}return c(f)&&u<y?(f.stages.push(t),f):(f={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:l,clearColor:d,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:l}),clear:void 0},p.push(f),f)}function cpt(e,t){let n=spt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=apt(e,i,n[i]))}function $4(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function lpt(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],l=a.textureScale,d=Math.ceil(n*l),u=Math.ceil(i*l),f=Math.min(d,u);a.forcePowerOfTwo&&(w.isPowerOfTwo(f)||(f=w.nextPowerOfTwo(f)),d=f,u=f),a.buffer.update(t,d,u),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}x0.prototype.updateDependencies=function(){this._updateDependencies=!0};x0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=c(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=c(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=c(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=c(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!c(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&($4(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&cpt(this,e);let l=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==l||this._height!==d;!n&&!u||(this._width=l,this._height=d,this._updateDependencies=!1,$4(this),lpt(this,e))};x0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};x0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};x0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};x0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(c(t))return t.buffer.framebuffer};x0.prototype.isDestroyed=function(){return!1};x0.prototype.destroy=function(){return $4(this),he(this)};var jT=x0;var VHi=_(T(),1),bL={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};function h_e(e){return e===bL.REINHARD||e===bL.MODIFIED_REINHARD||e===bL.FILMIC||e===bL.ACES||e===bL.PBR_NEUTRAL}var _0=Object.freeze(bL);var e8=[];function pl(){let e=$d.createFXAAStage(),t=$d.createAmbientOcclusionStage(),n=$d.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=$d.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=_0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new jT(this),r={},s=e8;for(s.push(e,t,n,i);s.length>0;){let l=s.pop();r[l.name]=l,l._textureCache=o;let d=l.length;if(c(d))for(let u=0;u<d;++u)s.push(l.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(pl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let l=t[a];e=e||l.ready&&l.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 t8(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(c(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(!c(t))continue;if(c(t.selected))return!0;let n=t.length;if(c(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;if(!h_e(e))throw new L("tonemapper was set to an invalid value.");c(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case _0.REINHARD:n=$d.createReinhardTonemappingStage(t);break;case _0.MODIFIED_REINHARD:n=$d.createModifiedReinhardTonemappingStage(t);break;case _0.FILMIC:n=$d.createFilmicTonemappingStage(t);break;case _0.PBR_NEUTRAL:n=$d.createPbrNeutralTonemappingStage(t);break;default:n=$d.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,c(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 t8(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}pl.prototype.add=function(e){C.typeOf.object("stage",e);let t=this._stageNames,n=e8;for(n.push(e);n.length>0;){let o=n.pop();if(c(t[o.name]))throw new L(`${o.name} has already been added to the collection or does not have a unique name.`);t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(c(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};pl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=e8;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(c(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};pl.prototype.contains=function(e){return c(e)&&c(e._index)&&e._textureCache===this._textureCache};pl.prototype.get=function(e){t8(this);let t=this._stages,n=t.length;return C.typeOf.number.greaterThanOrEquals("stages length",n,0),C.typeOf.number.greaterThanOrEquals("index",e,0),C.typeOf.number.lessThan("index",e,n),t[e]};pl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};pl.prototype.getStageByName=function(e){return this._stageNames[e]};pl.prototype.update=function(e,t,n){t8(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 S=0;S<r.length;++S){let V=r[S];V.ready&&V.enabled&&V._isSupported(e)&&(o[s++]=V)}o.length=s;let a=s!==i.length;if(!a){for(let S=0;S<s;++S)if(o[S]!==i[S]){a=!0;break}}let l=this._ao,d=this._bloom,u=this._autoExposure,f=this._tonemapping,p=this._fxaa;f.enabled=n;let y=l.enabled&&l._isSupported(e),h=d.enabled&&d._isSupported(e),g=f.enabled&&f._isSupported(e),x=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||y!==this._aoEnabled||h!==this._bloomEnabled||g!==this._tonemappingEnabled||x!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=y,this._bloomEnabled=h,this._tonemappingEnabled=g,this._fxaaEnabled=x,this._textureCacheDirty=!1),c(this._randomTexture)&&!y&&(this._randomTexture.destroy(),this._randomTexture=void 0),!c(this._randomTexture)&&y){let V=new Uint8Array(196608);for(let Z=0;Z<196608;Z+=3)V[Z]=Math.floor(Math.random()*255);this._randomTexture=new Pt({context:e,pixelFormat:ke.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:V,width:256,height:256},sampler:new en({wrapS:xn.REPEAT,wrapT:xn.REPEAT,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})})}this._textureCache.update(e),p.update(e,t),l.update(e,t),d.update(e,t),f.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let S=0;S<r.length;++S)r[S].update(e,t);s=0;for(let S=0;S<r.length;++S){let V=r[S];V.ready&&V.enabled&&V._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};pl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function qT(e){for(;c(e.length);)e=e.get(e.length-1);return e.outputTexture}pl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(c(t))return qT(t)};function up(e,t,n,i,o){if(c(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,qT(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)up(e.get(r),t,n,i,o)}pl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,l=this._bloom,d=this._autoExposure,u=this._tonemapping,f=a.enabled&&a._isSupported(e),p=l.enabled&&l._isSupported(e),y=this._autoExposureEnabled,h=u.enabled&&u._isSupported(e),g=s.enabled&&s._isSupported(e);if(!g&&!f&&!p&&!h&&r===0)return;let x=t;f&&a.ready&&(up(a,e,x,n,i),x=qT(a)),p&&l.ready&&(up(l,e,x,n,i),x=qT(l)),y&&d.ready&&up(d,e,x,n,i),h&&u.ready&&(up(u,e,x,n,i),x=qT(u));let S=x;if(r>0){up(o[0],e,x,n,i);for(let V=1;V<r;++V)up(o[V],e,qT(o[V-1]),n,i);S=qT(o[r-1])}g&&s.ready&&up(s,e,S,n,i)};pl.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};pl.prototype.isDestroyed=function(){return!1};pl.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(),he(this)};var XA=pl;var Tzi=_(T(),1);var nzi=_(T(),1);var DHi=_(T(),1),dpt={SHIFT:0,CTRL:1,ALT:2},ia=Object.freeze(dpt);var YHi=_(T(),1),upt={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},Vn=Object.freeze(upt);function Fg(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 a8(e,t){let n=e;return c(t)&&(n+=`+${t}`),n}function $T(e){if(e.shiftKey)return ia.SHIFT;if(e.ctrlKey)return ia.CTRL;if(e.altKey)return ia.ALT}var vs={LEFT:0,MIDDLE:1,RIGHT:2};function eu(e,t,n,i){function o(r){i(e,r)}Ot.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function mpt(e){let t=e._element,n=c(t.disableRootEvents)?t:document;Ot.supportsPointerEvents()?(eu(e,"pointerdown",t,gpt),eu(e,"pointerup",t,V_e),eu(e,"pointermove",t,xpt),eu(e,"pointercancel",t,V_e)):(eu(e,"mousedown",t,L_e),eu(e,"mouseup",n,Z_e),eu(e,"mousemove",n,R_e),eu(e,"touchstart",t,bpt),eu(e,"touchend",n,x_e),eu(e,"touchmove",n,ypt),eu(e,"touchcancel",n,x_e)),eu(e,"dblclick",t,hpt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",eu(e,i,t,ppt)}function fpt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var p_e={position:new D};function c8(e){e._lastSeenTouchEvent=Ti()}function l8(e){return Ti()-e._lastSeenTouchEvent>Df.mouseEmulationIgnoreMilliseconds}function s8(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function L_e(e,t){if(!l8(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===vs.LEFT)i=Vn.LEFT_DOWN;else if(n===vs.MIDDLE)i=Vn.MIDDLE_DOWN;else if(n===vs.RIGHT)i=Vn.RIGHT_DOWN;else return;let o=Fg(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=$T(t),s=e.getInputAction(i,r);c(s)&&(D.clone(o,p_e.position),s(p_e),t.preventDefault())}var b_e={position:new D},y_e={position:new D};function n8(e,t,n,i){let o=$T(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(c(r)||c(s)){let a=Fg(e,i,e._primaryPosition);if(c(r)&&(D.clone(a,b_e.position),r(b_e)),c(s)){let l=e._primaryStartPosition;s8(l,a,e._clickPixelTolerance)&&(D.clone(a,y_e.position),s(y_e))}}}function Z_e(e,t){if(!l8(e))return;let n=t.button;n!==vs.LEFT&&n!==vs.MIDDLE&&n!==vs.RIGHT||(e._buttonDown[vs.LEFT]&&(n8(e,Vn.LEFT_UP,Vn.LEFT_CLICK,t),e._buttonDown[vs.LEFT]=!1),e._buttonDown[vs.MIDDLE]&&(n8(e,Vn.MIDDLE_UP,Vn.MIDDLE_CLICK,t),e._buttonDown[vs.MIDDLE]=!1),e._buttonDown[vs.RIGHT]&&(n8(e,Vn.RIGHT_UP,Vn.RIGHT_CLICK,t),e._buttonDown[vs.RIGHT]=!1))}var i8={startPosition:new D,endPosition:new D};function R_e(e,t){if(!l8(e))return;let n=$T(t),i=Fg(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Vn.MOUSE_MOVE,n);c(r)&&(D.clone(o,i8.startPosition),D.clone(i,i8.endPosition),r(i8)),D.clone(i,o),(e._buttonDown[vs.LEFT]||e._buttonDown[vs.MIDDLE]||e._buttonDown[vs.RIGHT])&&t.preventDefault()}var g_e={position:new D};function hpt(e,t){let n=t.button,i;if(n===vs.LEFT)i=Vn.LEFT_DOUBLE_CLICK;else return;let o=$T(t),r=e.getInputAction(i,o);c(r)&&(Fg(e,t,g_e.position),r(g_e))}function ppt(e,t){let n;if(c(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(!c(n))return;let i=$T(t),o=e.getInputAction(Vn.WHEEL,i);c(o)&&(o(n),t.preventDefault())}function bpt(e,t){c8(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,Fg(e,r,new D));PD(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.set(s,D.clone(a.get(s)))}function x_e(e,t){c8(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);PD(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.remove(s)}var __e={position:new D},o8={position1:new D,position2:new D},T_e={position:new D},S_e={position:new D},C_e={position:new D};function PD(e,t){let n=$T(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[vs.LEFT]){if(e._buttonDown[vs.LEFT]=!1,c(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Vn.LEFT_UP,n),c(r)&&(D.clone(e._primaryPosition,T_e.position),r(T_e)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Vn.LEFT_CLICK,n),c(s))){let l=e._primaryStartPosition,d=e._previousPositions.values[0];s8(l,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,S_e.position),s(S_e))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Vn.PINCH_END,n),c(r)&&r()),o===1&&!a){let l=i.values[0];D.clone(l,e._primaryPosition),D.clone(l,e._primaryStartPosition),D.clone(l,e._primaryPreviousPosition),e._buttonDown[vs.LEFT]=!0,r=e.getInputAction(Vn.LEFT_DOWN,n),c(r)&&(D.clone(l,__e.position),r(__e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Vn.RIGHT_CLICK,n),c(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];s8(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,C_e.position),s(C_e))}},Df.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Vn.PINCH_START,n),c(r)&&(D.clone(i.values[0],o8.position1),D.clone(i.values[1],o8.position2),r(o8),t.preventDefault()))}function ypt(e,t){c8(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);c(d)&&Fg(e,r,d)}G_e(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),l.get(s))}var r8={startPosition:new D,endPosition:new D},IA={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function G_e(e,t){let n=$T(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[vs.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let l=e._primaryPreviousPosition;s=e.getInputAction(Vn.MOUSE_MOVE,n),c(s)&&(D.clone(l,r8.startPosition),D.clone(a,r8.endPosition),s(r8)),D.clone(a,l),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Vn.PINCH_MOVE,n),c(s))){let a=i.values[0],l=i.values[1],d=o.values[0],u=o.values[1],f=l.x-a.x,p=l.y-a.y,y=Math.sqrt(f*f+p*p)*.25,h=u.x-d.x,g=u.y-d.y,x=Math.sqrt(h*h+g*g)*.25,S=(l.y+a.y)*.125,V=(u.y+d.y)*.125,Z=Math.atan2(p,f),R=Math.atan2(g,h);D.fromElements(0,x,IA.distance.startPosition),D.fromElements(0,y,IA.distance.endPosition),D.fromElements(R,V,IA.angleAndHeight.startPosition),D.fromElements(Z,S,IA.angleAndHeight.endPosition),s(IA)}}function gpt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Fg(e,t,new D)),PD(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else L_e(e,t)}function V_e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),PD(e,t),e._previousPositions.remove(i)}else Z_e(e,t)}function xpt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!c(o))return;Fg(e,t,o),G_e(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else R_e(e,t)}function Df(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Df.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Zt,this._previousPositions=new Zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,mpt(this)}Df.prototype.setInputAction=function(e,t,n){if(!c(e))throw new L("action is required.");if(!c(t))throw new L("type is required.");let i=a8(t,n);this._inputEvents[i]=e};Df.prototype.getInputAction=function(e,t){if(!c(e))throw new L("type is required.");let n=a8(e,t);return this._inputEvents[n]};Df.prototype.removeInputAction=function(e,t){if(!c(e))throw new L("type is required.");let n=a8(e,t);delete this._inputEvents[n]};Df.prototype.isDestroyed=function(){return!1};Df.prototype.destroy=function(){return fpt(this),he(this)};Df.mouseEmulationIgnoreMilliseconds=800;Df.touchHoldDelayMilliseconds=1500;var tu=Df;function eS(e){C.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}eS.prototype.completeMorph=function(){c(this._completeMorph)&&this._completeMorph()};eS.prototype.morphTo2D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof sn,!(this._previousMode===se.SCENE2D||this._previousMode===se.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE2D,!0),n._mode=se.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===se.COLUMBUS_VIEW?qpt(this,e):rbt(this,e,t),e===0&&c(this._completeMorph)&&this._completeMorph())};var _pt=new m,Tpt=new m,Spt=new m,Cpt=new m,Vpt=new m,Lpt=new m,Zpt=new m,Rpt=new pe,Gpt=new M,Ept=new Ci,Xpt=new sn,Ipt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};eS.prototype.morphToColumbusView=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===se.COLUMBUS_VIEW||this._previousMode===se.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,se.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=_pt,o=Tpt,r=Spt;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===se.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,Zpt),f=wt.eastNorthUpToFixedFrame(u,t,Gpt);M.inverseTransformation(f,f),n.mapProjection.project(t.cartesianToCartographic(i,Rpt),i),M.multiplyByPointAsVector(f,o,o),M.multiplyByPointAsVector(f,r,r)}}let s;this._morphToOrthographic?(s=Xpt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Ept,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=w.toRadians(60));let a=Ipt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let l=abt(a);WA(this,l),this._previousMode===se.SCENE2D?sbt(this,e,a,l):(a.position2D=M.multiplyByPoint(oo.TRANSFORM_2D,i,Cpt),a.direction2D=M.multiplyByPointAsVector(oo.TRANSFORM_2D,o,Vpt),a.up2D=M.multiplyByPointAsVector(oo.TRANSFORM_2D,r,Lpt),n._mode=se.MORPHING,N_e(this,e,a,l)),e===0&&c(this._completeMorph)&&this._completeMorph()};var m8={position:new m,direction:new m,up:new m,frustum:void 0},X_e=new Ci;eS.prototype.morphTo3D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===se.SCENE3D||this._previousMode===se.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE3D,!0),n._mode=se.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===se.SCENE2D)Opt(this,e,t);else{let i;e>0?(i=m8,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=I_e(this,t);let o,r=n.camera;r.frustum instanceof sn?o=r.frustum.clone():(o=X_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=w.toRadians(60)),i.frustum=o;let s=U_e(i);WA(this,s),u8(this,e,i,s)}e===0&&c(this._completeMorph)&&this._completeMorph()}};eS.prototype.isDestroyed=function(){return!1};eS.prototype.destroy=function(){return vD(this),he(this)};function WA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new tu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Vn.LEFT_DOWN),e._morphHandler.setInputAction(n,Vn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Vn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Vn.WHEEL)}}function vD(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 Wpt=new pe,wpt=new m,Ppt=new M;function I_e(e,t){let n=e._scene,i=n.camera,o=m8,r=o.position,s=o.direction,a=o.up,l=n.mapProjection.unproject(i.position,Wpt);t.cartographicToCartesian(l,r);let d=t.scaleToGeodeticSurface(r,wpt),u=wt.eastNorthUpToFixedFrame(d,t,Ppt);return M.multiplyByPointAsVector(u,i.direction,s),M.multiplyByPointAsVector(u,i.up,a),o}var vpt=new m,Fpt=new m,Apt=new m,Mpt=new m,Npt=new m,kpt=new m;function u8(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,vpt),a=m.clone(r.direction,Fpt),l=m.clone(r.up,Apt),d=M.multiplyByPoint(oo.TRANSFORM_2D_INVERSE,n.position,Mpt),u=M.multiplyByPointAsVector(oo.TRANSFORM_2D_INVERSE,n.direction,Npt),f=M.multiplyByPointAsVector(oo.TRANSFORM_2D_INVERSE,n.up,kpt);function p(h){bm(s,d,h.time,r.position),bm(a,u,h.time,r.direction),bm(l,f,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let y=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){k_e(e,o,0,1,t,i)}});e._currentTweens.push(y)}var Upt=new sn,W_e=new m,w_e=new m,P_e=new m,f8=new m,v_e=new m,F_e=new m;function Opt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=m8,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=I_e(e,n));let s;e._morphToOrthographic?(s=Upt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=X_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=w.toRadians(60)),r.frustum=s;let a=U_e(r);WA(e,a);let l;e._morphToOrthographic?l=function(){u8(e,t,r,a)}:l=function(){M_e(e,t,r,function(){u8(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,f8),complete:function(){i._mode=se.MORPHING,l()}})):l()}function bm(e,t,n,i){return m.lerp(e,t,n,i)}function A_e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof sn)return;let a=s.frustum.fov,l=w.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(l*.5)+1e7;function u(p){s.frustum.fov=w.lerp(a,l,p.time);let y=d/Math.tan(s.frustum.fov*.5);i(s,y)}let f=r.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(f)}var Dpt=new m,Bpt=new m,Ypt=new m,d8=new m,Hpt=new m,zpt=new m,Kpt=new Oo,Jpt=new bn,Qpt=new m,jpt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function qpt(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,Dpt),r=m.clone(i.direction,Bpt),s=m.clone(i.up,Ypt),a=m.negate(m.UNIT_Z,Hpt),l=m.clone(m.UNIT_Y,zpt),d=d8;if(t>0)m.clone(m.ZERO,d8),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,d8);let x=Jpt;M.multiplyByPoint(oo.TRANSFORM_2D,o,x.origin),M.multiplyByPointAsVector(oo.TRANSFORM_2D,r,x.direction);let S=n.globe;if(c(S)){let V=S.pickWorldCoordinates(x,n,!0,Qpt);c(V)&&(M.multiplyByPoint(oo.TRANSFORM_2D_INVERSE,V,d),d.z+=m.distance(o,d))}}let u=Kpt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let f=jpt;f.position=d,f.direction=a,f.up=l,f.frustum=u;let p=O_e(f);WA(e,p);function y(x){bm(o,d,x.time,i.position),bm(r,a,x.time,i.direction),bm(s,l,x.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(x,S){x.position.z=S}let g=n.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){A_e(e,t,f,h,p)}});e._currentTweens.push(g)}var E_e=new pe,$pt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Oo},ebt={position:new m,direction:new m,up:new m,frustum:void 0},tbt=new m,nbt=new bn,ibt=new M,obt=new m;function rbt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=$pt;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,E_e),i.mapProjection.project(E_e,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let f=nbt;m.clone(r.position2D,f.origin);let p=m.clone(o.directionWC,f.direction),y=n.scaleToGeodeticSurface(o.positionWC,obt),h=wt.eastNorthUpToFixedFrame(y,n,ibt);M.inverseTransformation(h,h),M.multiplyByPointAsVector(h,p,p),M.multiplyByPointAsVector(oo.TRANSFORM_2D,p,p);let g=i.globe;if(c(g)){let x=g.pickWorldCoordinates(f,i,!0,tbt);if(c(x)){let S=m.distance(r.position2D,x);x.x+=S,m.clone(x,r.position2D)}}}function s(f,p){f.position.x=p}M.multiplyByPoint(oo.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(oo.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(oo.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 l=ebt;M.multiplyByPoint(oo.TRANSFORM_2D_INVERSE,r.position2D,l.position),m.clone(r.direction,l.direction),m.clone(r.up,l.up),l.frustum=a;let d=O_e(l);WA(e,d);function u(){A_e(e,t,r,s,d)}N_e(e,t,r,u)}function M_e(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,l=w.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(l*.5)+1e7,r.frustum.fov=l;function u(p){r.frustum.fov=w.lerp(l,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let f=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(f)}function sbt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,f8),a=m.clone(n.direction,v_e),l=m.clone(n.up,F_e);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,W_e),f=m.clone(r.direction,w_e),p=m.clone(r.up,P_e);u.z=s.z;function y(g){bm(u,s,g.time,r.position),bm(f,a,g.time,r.direction),bm(p,l,g.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let h=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?d():M_e(e,0,n,d)}function N_e(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,W_e),a=m.clone(r.direction,w_e),l=m.clone(r.up,P_e),d=m.clone(n.position2D,f8),u=m.clone(n.direction2D,v_e),f=m.clone(n.up2D,F_e);function p(h){bm(s,d,h.time,r.position),bm(a,u,h.time,r.direction),bm(l,f,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let y=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){k_e(e,o,1,0,t,i)}});e._currentTweens.push(y)}function k_e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Jr.QUARTIC_OUT};c(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function U_e(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),vD(t);let i=n.camera;(t._previousMode!==se.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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE3D,r)}}function O_e(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),vD(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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE2D,o)}}function abt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),vD(t);let i=n.camera;(t._previousModeMode!==se.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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.COLUMBUS_VIEW,r)}}var wA=eS;var gKi=_(T(),1);var Pzi=_(T(),1);var Czi=_(T(),1),cbt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ni=Object.freeze(cbt);function oa(e,t){let n=`${e}`;return c(t)&&(n+=`+${t}`),n}function lbt(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 D_e(e,t,n){let i=oa(Ni.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,l=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let d=e._movement[i];c(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])},Vn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,l[i]=new Date},Vn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(lbt(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 f=d.angleAndHeight.endPosition.x,p=d.prevAngle,y=Math.PI*2;for(;f>=p+Math.PI;)f-=y;for(;f<p-Math.PI;)f+=y;d.angleAndHeight.endPosition.x=-f*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Vn.PINCH_MOVE,t)}function B_e(e,t){let n=oa(Ni.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];c(s)||(s=e._movement[n]={});let a=e._lastMovement[n];c(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(l){let d=7.5*w.toRadians(l);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},Vn.WHEEL,t)}function yL(e,t,n){let i=oa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];c(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let l,d;n===Ni.LEFT_DRAG?(l=Vn.LEFT_DOWN,d=Vn.LEFT_UP):n===Ni.RIGHT_DRAG?(l=Vn.RIGHT_DOWN,d=Vn.RIGHT_UP):n===Ni.MIDDLE_DRAG&&(l=Vn.MIDDLE_DOWN,d=Vn.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])},l,t),e._eventHandler.setInputAction(function(){h8(oa(n,void 0),e);for(let u of Object.values(ia)){let f=oa(n,u);h8(f,e)}},d,t)}function h8(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 Y_e(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function dbt(e,t,n){let i=n._isDown,o=!1,r=oa(e,t);for(let[l,d]of Object.entries(i))l.startsWith(e)&&d&&l!==r&&(o=!0,h8(l,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];c(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 H_e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Ni)if(Ni.hasOwnProperty(s)){let a=Ni[s];if(c(a)){let l=oa(a,t);n[l]=!0,c(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new D,endPosition:new D,valid:!1}),c(e._movement[l])||(e._movement[l]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Ni)if(Ni.hasOwnProperty(a)){let l=Ni[a];if(c(l)){let d=oa(l,t);dbt(l,t,e),r[d]&&(n[d]?(Y_e(i[d],o[d]),o[d].valid=!0,Y_e(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},Vn.MOUSE_MOVE,t)}function ym(e){if(!c(e))throw new L("canvas is required.");this._eventHandler=new tu(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,B_e(this,void 0),D_e(this,void 0,e),yL(this,void 0,Ni.LEFT_DRAG),yL(this,void 0,Ni.RIGHT_DRAG),yL(this,void 0,Ni.MIDDLE_DRAG),H_e(this,void 0);for(let t in ia)if(ia.hasOwnProperty(t)){let n=ia[t];c(n)&&(B_e(this,n),D_e(this,n,e),yL(this,n,Ni.LEFT_DRAG),yL(this,n,Ni.RIGHT_DRAG),yL(this,n,Ni.MIDDLE_DRAG),H_e(this,n))}}Object.defineProperties(ym.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[oa(Ni.WHEEL)]||!this._update[oa(Ni.WHEEL,ia.SHIFT)]||!this._update[oa(Ni.WHEEL,ia.CTRL)]||!this._update[oa(Ni.WHEEL,ia.ALT)];return this._buttonsDown>0||e}}});ym.prototype.isMoving=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return!this._update[n]};ym.prototype.getMovement=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._movement[n]};ym.prototype.getLastMovement=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t),i=this._lastMovement[n];if(i.valid)return i};ym.prototype.isButtonDown=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._isDown[n]};ym.prototype.getStartMousePosition=function(e,t){if(!c(e))throw new L("type is required.");if(e===Ni.WHEEL)return this._currentMousePosition;let n=oa(e,t);return this._eventStartPosition[n]};ym.prototype.getButtonPressTime=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._pressTime[n]};ym.prototype.getButtonReleaseTime=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._releaseTime[n]};ym.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),he(this)};var PA=ym;var Bzi=_(T(),1);function FD(e,t,n,i,o,r,s,a,l,d){this._tweens=e,this._tweenjs=t,this._startObject=He(n),this._stopObject=He(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=l,this.cancel=d,this.needsStart=!0}Object.defineProperties(FD.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}}});FD.prototype.cancelTween=function(){this._tweens.remove(this)};function Bf(){this._tweens=[]}Object.defineProperties(Bf.prototype,{length:{get:function(){return this._tweens.length}}});Bf.prototype.add=function(e){if(e=e??z.EMPTY_OBJECT,!c(e.startObject)||!c(e.stopObject))throw new L("options.startObject and options.stopObject are required.");if(!c(e.duration)||e.duration<0)throw new L("options.duration is required and must be positive.");if(e.duration===0)return c(e.complete)&&e.complete(),new FD(this);let t=e.duration/Kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Kn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Jr.LINEAR_NONE,r=e.startObject,s=new k0e(r);s.to(He(e.stopObject),t),s.delay(i),s.easing(o),c(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new FD(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Bf.prototype.addProperty=function(e){e=e??z.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;if(!c(t)||!c(e.property))throw new L("options.object and options.property are required.");if(!c(t[n]))throw new L("options.object must have the specified property.");if(!c(i)||!c(o))throw new L("options.startValue and options.stopValue are required.");function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Bf.prototype.addAlpha=function(e){e=e??z.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new L("options.material is required.");let n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&c(t.uniforms[o])&&c(t.uniforms[o].alpha)&&n.push(o);if(n.length===0)throw new L("material has no properties with alpha components.");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:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Bf.prototype.addOffsetIncrement=function(e){e=e??z.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new L("material is required.");if(!c(t.uniforms.offset))throw new L("material.uniforms must have an offset property.");let n=t.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})};Bf.prototype.remove=function(e){if(!c(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),c(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Bf.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),c(n.cancel)&&n.cancel()}e.length=0};Bf.prototype.contains=function(e){return c(e)&&this._tweens.indexOf(e)!==-1};Bf.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._tweens[e]};Bf.prototype.update=function(e){let t=this._tweens,n=0;for(e=c(e)?e/Kn.SECONDS_PER_MILLISECOND:Ti();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 tS=Bf;function FA(e){if(!c(e))throw new L("scene is required.");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=Ni.LEFT_DRAG,this.zoomEventTypes=[Ni.RIGHT_DRAG,Ni.WHEEL,Ni.PINCH],this.rotateEventTypes=Ni.LEFT_DRAG,this.tiltEventTypes=[Ni.MIDDLE_DRAG,Ni.PINCH,{eventType:Ni.LEFT_DRAG,modifier:ia.CTRL},{eventType:Ni.RIGHT_DRAG,modifier:ia.CTRL}],this.lookEventTypes={eventType:Ni.LEFT_DRAG,modifier:ia.SHIFT};let t=e.ellipsoid??re.default;this.minimumPickingTerrainHeight=re.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=re.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=re.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=re.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 PA(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 tS,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 pe(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 ubt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function mbt(e){return D.equalsEpsilon(e.startPosition,e.endPosition,w.EPSILON14)}var fbt=.4;function hbt(e,t,n,i,o,r,s){let a=r[s];c(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let l=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=l&&d&&(d.getTime()-l.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(l&&d&&u<fbt){let y=ubt(p,i),h=e.getLastMovement(t,n);if(!c(h)||mbt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=D.clone(h.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,y,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 g=e.getStartMousePosition(t,n);o(r,g,a)}}}function pbt(e,t){if(c(t)){let n=e[t];c(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(c(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],c(n)&&(n.inertiaEnabled=!1)}}}var z_e=[];function bl(e,t,n,i,o,r){if(!c(n))return;let s=e._aggregator;Array.isArray(n)||(z_e[0]=n,n=z_e);let a=n.length;for(let l=0;l<a;++l){let d=n[l],u=c(d.eventType)?d.eventType:d,f=d.modifier,p=s.isMoving(u,f)&&s.getMovement(u,f),y=s.getStartMousePosition(u,f);e.enableInputs&&t&&(p?(i(e,y,p),pbt(e,r)):o<1&&hbt(s,u,f,o,i,e,r))}}var AD=new bn,bbt=new m,ybt=new D,gbt=new m,xbt=new D,_bt=new m,Tbt=new m,Sbt=new m,Cbt=new m,rTe=new m,Vbt=new m,Lbt=new m,Zbt=new m,Rbt=new m,Gbt=new m,Ebt=new m,Xbt=new m,Ibt=new m,Wbt=new m,wbt=new m,nS=new m,K_e=new m,J_e=new m,p8={orientation:new Ea};function C8(e,t,n,i,o,r){let s=1;c(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,f=o-d,p=i*f;p=w.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let y=a/e._scene.canvas.clientHeight;y=Math.min(y,e.maximumMovementRatio);let h=p*y;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!c(e._globe)){if(h>0&&Math.abs(o-d)<1||h<0&&Math.abs(o-u)<1)return;o-h<d?h=o-d-1:o-h>u&&(h=o-u)}let g=e._scene,x=g.camera,S=g.mode,V=p8.orientation;V.heading=x.heading,V.pitch=x.pitch,V.roll=x.roll;let Z=n.inertiaEnabled??D.equals(t,e._zoomMouseStart),R=e._zoomingOnVector,E=e._rotatingZoom,I;if(Z||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),c(e._globe)&&S===se.SCENE2D?(I=x.getPickRay(t,AD).origin,I=m.fromElements(I.y,I.z,I.x)):c(e._globe)&&(I=T0(e,t,bbt)),c(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,R=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(h);return}let v=S===se.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(E=!0),!Z||E){if(S===se.SCENE2D){let P=e._zoomWorldPosition,F=x.position;if(!m.equals(P,F)&&x.positionCartographic.height<e._maxCoord.x*2){let N=x.position.x,b=m.subtract(P,F,gbt);m.normalize(b,b);let G=m.distance(P,F)*h/(x.getMagnitude()*.5);x.move(b,G*.5),(x.position.x<0&&N>0||x.position.x>0&&N<0)&&(I=x.getPickRay(t,AD).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(S===se.SCENE3D){let P=m.normalize(x.position,rTe);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(m.dot(x.direction,P))<.6)v=!0;else{let F=g.canvas,N=xbt;N.x=F.clientWidth/2,N.y=F.clientHeight/2;let b=T0(e,N,_bt);if(!c(b))v=!0;else if(x.positionCartographic.height<1e6)if(m.dot(x.direction,P)>=-.5)v=!0;else{let G=Lbt;m.clone(x.position,G);let X=e._zoomWorldPosition,W=Vbt;if(W=m.normalize(X,W),m.dot(W,P)<0)return;let A=wbt,k=Gbt;m.clone(x.direction,k),m.add(G,m.multiplyByScalar(k,1e3,nS),A);let B=Ebt,O=Xbt;m.subtract(X,G,B),m.normalize(B,O);let H=m.dot(P,O);if(H>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-H),K=m.magnitude(G),Q=m.magnitude(X),ie=K-h,j=m.magnitude(B),$=Math.asin(w.clamp(j/Q*Math.sin(U),-1,1)),ne=Math.asin(w.clamp(ie/Q*Math.sin(U),-1,1)),be=$-ne+U,Ce=Zbt;m.normalize(G,Ce);let me=Rbt;me=m.cross(O,Ce,me),me=m.normalize(me,me),m.normalize(m.cross(Ce,me,nS),k),m.multiplyByScalar(m.normalize(A,nS),m.magnitude(A)-h,A),m.normalize(G,G),m.multiplyByScalar(G,ie,G);let _e=Ibt;m.multiplyByScalar(m.add(m.multiplyByScalar(Ce,Math.cos(be)-1,K_e),m.multiplyByScalar(k,Math.sin(be),J_e),nS),ie,_e),m.add(G,_e,G),m.normalize(A,Ce),m.normalize(m.cross(Ce,me,nS),k);let Ve=Wbt;m.multiplyByScalar(m.add(m.multiplyByScalar(Ce,Math.cos(be)-1,K_e),m.multiplyByScalar(k,Math.sin(be),J_e),nS),m.magnitude(A),Ve),m.add(A,Ve,A),m.clone(G,x.position),m.normalize(m.subtract(A,G,nS),x.direction),m.clone(x.direction,x.direction),m.cross(x.direction,x.up,x.right),m.cross(x.right,x.direction,x.up),x.setView(p8);return}else{let G=m.normalize(b,Tbt),X=m.normalize(e._zoomWorldPosition,Sbt),W=m.dot(X,G);if(W>0&&W<1){let A=w.acosClamped(W),k=m.cross(X,G,Cbt),B=Math.abs(A)>w.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-h,O=h/B;x.rotate(k,A*O)}}}}e._rotatingZoom=!v}if(!Z&&v||R){let P,F=Oi.worldToWindowCoordinates(g,e._zoomWorldPosition,ybt);S!==se.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&c(F)?P=x.getPickRay(F,AD):P=x.getPickRay(t,AD);let N=P.direction;(S===se.COLUMBUS_VIEW||S===se.SCENE2D)&&m.fromElements(N.y,N.z,N.x,N),x.move(N,h),e._zoomingOnVector=!0}else x.zoomIn(h);e._cameraUnderground||x.setView(p8)}var Pbt=new bn,vbt=new bn,Fbt=new m;function Abt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Pbt).origin,s=o.getPickRay(n.endPosition,vbt).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,Fbt),l=m.magnitude(a);l>0&&(m.normalize(a,a),o.move(a,l))}function Q_e(e,t,n){c(n.distance)&&(n=n.distance);let o=e._scene.camera;C8(e,t,n,e.zoomFactor,o.getMagnitude())}var Mbt=new D,Nbt=new D;function j_e(e,t,n){if(c(n.angleAndHeight)){kbt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,l=Mbt;l.x=2/s*n.startPosition.x-1,l.y=2/a*(a-n.startPosition.y)-1,l=D.normalize(l,l);let d=Nbt;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(l.x);l.y<0&&(u=w.TWO_PI-u);let f=w.acosClamped(d.x);d.y<0&&(f=w.TWO_PI-f);let p=f-u;o.twistRight(p)}function kbt(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 l=i*a*Math.PI*4;r.twistRight(l)}function Ubt(e){let t=e._scene.mapMode2D===ed.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(bl(e,e.enableTranslate,e.translateEventTypes,Abt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bl(e,e.enableZoom,e.zoomEventTypes,Q_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bl(e,e.enableRotate,e.tiltEventTypes,j_e,e.inertiaSpin,"_lastInertiaTiltMovement")):(bl(e,e.enableZoom,e.zoomEventTypes,Q_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bl(e,e.enableRotate,e.translateEventTypes,j_e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var sTe=new bn,Obt=new m,Dbt=new m;function T0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Obt)),!c(o))return m.clone(s,n);let a=!e._cameraUnderground,l=r.getPickRay(t,sTe),d=o.pickWorldCoordinates(l,i,a,Dbt),u=c(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,f=c(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<f?m.clone(s,n):m.clone(d,n)}var Bbt=new pe;function BD(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===se.SCENE3D){let l=t.cartesianToCartographic(i.position,Bbt);c(l)&&(r=l.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var Ybt=new m;function aTe(e,t){let n=t.origin,i=t.direction,o=BD(e),r=m.normalize(n,Ybt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function cTe(e,t,n,i){let o=m.distance(t.origin,n),r=BD(e),s=w.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),bn.getPoint(t,o,i)}function lTe(e,t,n,i){let o;return c(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=BD(e))):o=BD(e),bn.getPoint(t,o,i)}var Hbt=new D;function dTe(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,Hbt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,V8(e,t,e._strafeStartPosition),t.endPosition=n}var q_e=new bn,zbt=new bn,b8=new m,Kbt=new m,Jbt=new m,Qbt=new m,jbt=new cn(m.UNIT_X,0),qbt=new D,$bt=new D;function e0t(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){iu(e,t,n);return}if(e._strafing){dTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,qbt),a=D.clone(n.endPosition,$bt),l=o.getPickRay(s,q_e),d=m.clone(m.ZERO,Qbt),u=m.UNIT_X,f;if(o.position.z<e._minimumPickingTerrainHeight&&(f=T0(e,s,b8),c(f)&&(d.x=f.x)),r||d.x>o.position.z&&c(f)){let Z=f;r&&(Z=lTe(e,l,f,b8)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),m.clone(Z,e._strafeStartPosition),e._strafing=!0,V8(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,jbt);l=o.getPickRay(s,q_e);let y=qn.rayPlane(l,p,b8),h=o.getPickRay(a,zbt),g=qn.rayPlane(h,p,Kbt);if(!c(y)||!c(g)){e._looking=!0,iu(e,t,n),D.clone(t,e._translateMousePosition);return}let x=m.subtract(y,g,Jbt),S=x.x;x.x=x.y,x.y=x.z,x.z=S;let V=m.magnitude(x);V>w.EPSILON6&&(m.normalize(x,x),o.move(x,V))}var uTe=new D,kD=new bn,UD=new m,t0t=new m,mTe=new M,n0t=new M,i0t=new m,o0t=new cn(m.UNIT_X,0),y8=new m,_8=new pe,fTe=new M,r0t=new Fe,s0t=new te,OD=new m;function a0t(e,t,n){if(c(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){iu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,c0t(e,t,n)):l0t(e,t,n)}function c0t(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=uTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,kD),l=m.UNIT_X,d=a.origin,u=a.direction,f,p=m.dot(l,u);if(Math.abs(p)>w.EPSILON6&&(f=-m.dot(l,d)/p),!c(f)||f<=0){e._looking=!0,iu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let y=m.multiplyByScalar(u,f,UD);m.add(d,y,y);let h=i.mapProjection,g=h.ellipsoid;m.fromElements(y.y,y.z,y.x,y);let x=h.unproject(y,_8);g.cartographicToCartesian(x,y);let S=wt.eastNorthUpToFixedFrame(y,g,mTe),V=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let R=M.clone(o.transform,fTe);o._setTransform(S),nu(e,t,n,m.UNIT_Z),o._setTransform(R),e._globe=V,e._ellipsoid=Z;let E=Z.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function l0t(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,l=m.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,UD);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=T0(e,t,UD)),!c(s)){a=o.getPickRay(t,kD);let b=a.origin,G=a.direction,X,W=m.dot(l,G);if(Math.abs(W)>w.EPSILON6&&(X=-m.dot(l,b)/W),!c(X)||X<=0){e._looking=!0,iu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(G,X,UD),m.add(b,s,s)}r&&(c(a)||(a=o.getPickRay(t,kD)),cTe(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=uTe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,kD);let f=m.clone(m.ZERO,i0t);f.x=s.x;let p=cn.fromPointNormal(f,l,o0t),y=qn.rayPlane(a,p,t0t),h=o._projection,g=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let x=h.unproject(s,_8);g.cartographicToCartesian(x,s);let S=wt.eastNorthUpToFixedFrame(s,g,mTe),V;c(y)?(m.fromElements(y.y,y.z,y.x,y),x=h.unproject(y,_8),g.cartographicToCartesian(x,y),V=wt.eastNorthUpToFixedFrame(y,g,n0t)):V=S;let Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=m.UNIT_Z,I=M.clone(o.transform,fTe);o._setTransform(S);let v=m.cross(m.UNIT_Z,m.normalize(o.position,y8),y8),P=m.dot(o.right,v);if(nu(e,t,n,E,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(E=void 0);let G=o.constrainedAxis;o.constrainedAxis=void 0,nu(e,t,n,E,!0,!1),o.constrainedAxis=G}else nu(e,t,n,E,!0,!1);if(c(o.constrainedAxis)){let b=m.cross(o.direction,o.constrainedAxis,OD);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=Z,e._ellipsoid=R;let F=R.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let N=m.clone(o.positionWC,y8);if(e.enableCollisionDetection&&R8(e,!0),!m.equals(o.positionWC,N)){o._setTransform(V),o.worldToCameraCoordinatesPoint(N,N);let b=m.magnitudeSquared(N);m.magnitudeSquared(o.position)>b&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(b),o.position));let G=m.angleBetween(N,o.position),X=m.cross(N,o.position,N);m.normalize(X,X);let W=Fe.fromAxisAngle(X,G,r0t),A=te.fromQuaternion(W,s0t);te.multiplyByVector(A,o.direction,o.direction),te.multiplyByVector(A,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var hTe=new D,pTe=new bn,bTe=new m;function d0t(e,t,n){c(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=hTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let l=o.getPickRay(a,pTe),d=l.origin,u=l.direction,f=o.position.z,p;f<e._minimumPickingTerrainHeight&&(p=T0(e,a,bTe));let y;if(c(p)&&(y=m.distance(d,p)),s){let h=aTe(e,l,f);c(y)?y=Math.min(y,h):y=h}if(!c(y)){let h=m.UNIT_X;y=-m.dot(h,d)/m.dot(h,u)}C8(e,t,n,e.zoomFactor,y)}function u0t(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))bl(e,e.enableRotate,e.rotateEventTypes,nu,e.inertiaSpin,"_lastInertiaSpinMovement"),bl(e,e.enableZoom,e.zoomEventTypes,gTe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),bl(e,e.enableTilt,e.tiltEventTypes,a0t,e.inertiaSpin,"_lastInertiaTiltMovement"),bl(e,e.enableTranslate,e.translateEventTypes,e0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bl(e,e.enableZoom,e.zoomEventTypes,d0t,e.inertiaZoom,"_lastInertiaZoomMovement"),bl(e,e.enableLook,e.lookEventTypes,iu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);c(o)&&(e._tween=i.add(o))}i.update()}}var m0t=new bn,f0t=new cn(m.UNIT_X,0),h0t=new m,p0t=new m;function V8(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,m0t),s=m.clone(o.direction,p0t);i.mode===se.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,f0t),l=qn.rayPlane(r,a,h0t);c(l)&&(s=m.subtract(n,l,s),i.mode===se.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var $_e=new m,yTe=new pe,T8=new m,S8=new re,b0t=new m,y0t=new m,g0t=new m;function x0t(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){nu(e,t,n);return}let a,l,d=s.geodeticSurfaceNormal(o.position,b0t);if(D.equals(t,e._rotateMousePosition)){if(e._looking)iu(e,t,n,d);else if(e._rotating)nu(e,t,n);else if(e._strafing)dTe(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),l=T8,l.x=l.y=l.z=a,s=re.fromCartesian3(l,S8),x8(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,yTe).height,f=e._globe;if(c(f)&&u<e._minimumPickingTerrainHeight){let p=T0(e,n.startPosition,g0t);if(c(p)){let y=!1,h=o.getPickRay(n.startPosition,sTe);if(r)y=!0,lTe(e,h,p,p);else{let g=s.geodeticSurfaceNormal(p,y0t);Math.abs(m.dot(h.direction,g))<.05?y=!0:y=m.magnitude(o.position)<m.magnitude(p)}y?(D.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,V8(e,n,e._strafeStartPosition)):(a=m.magnitude(p),l=T8,l.x=l.y=l.z=a,s=re.fromCartesian3(l,S8),x8(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,iu(e,t,n,d)}else c(o.pickEllipsoid(n.startPosition,e._ellipsoid,$_e))?(x8(e,t,n,e._ellipsoid),m.clone($_e,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,nu(e,t,n)):(e._looking=!0,iu(e,t,n,d));D.clone(t,e._rotateMousePosition)}function nu(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,l=s.canvas,d=a.constrainedAxis;c(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),f=e._rotateFactor*(u-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/l.clientWidth,y=(n.startPosition.y-n.endPosition.y)/l.clientHeight;p=Math.min(p,e.maximumMovementRatio),y=Math.min(y,e.maximumMovementRatio);let h=f*p*Math.PI*2,g=f*y*Math.PI;if(c(i)&&c(e.maximumTiltAngle)){let x=e.maximumTiltAngle,S=m.dot(a.direction,i),V=Math.PI-Math.acos(S)+g;V>x&&(g-=V-x)}o||a.rotateRight(h),r||a.rotateUp(g),a.constrainedAxis=d}var g8=ce.clone(ce.UNIT_W),eTe=ce.clone(ce.UNIT_W),MD=new m,gL=new m,ND=new m,tTe=new m,_0t=new D,T0t=new D,S0t=new D,C0t=new D,V0t=new bn;function x8(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,_0t),a=D.clone(n.endPosition,T0t),l=i.cartesianToCartographic(r.positionWC,yTe).height,d,u;if(!n.inertiaEnabled&&l<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,g8),!c(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=T0(e,s,g8)),!c(e._globe)&&c(d))){let f=m.subtract(d,r.positionWC,gL),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,f),gL),y=m.magnitude(p),h=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,y,o.pixelRatio,C0t),g=D.subtract(a,s,S0t),x=m.multiplyByScalar(r.rightWC,g.x*h.x,gL),S=m.normalize(r.positionWC,rTe),V=r.getPickRay(a,V0t).direction,Z=m.subtract(V,m.projectVector(V,r.rightWC,ND),ND),R=m.angleBetween(Z,r.directionWC),E=1;c(r.frustum.fov)&&(E=Math.max(Math.tan(R),.1));let I=Math.abs(m.dot(r.directionWC,S)),v=-g.y*h.y*2/Math.sqrt(E)*(1-I),P=m.multiplyByScalar(V,v,ND);I=Math.abs(m.dot(r.upWC,S));let F=m.multiplyByScalar(r.upWC,-g.y*(1-I)*h.y,tTe);u=m.add(d,x,eTe),u=m.add(u,P,u),u=m.add(u,F,u),m.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!c(d)||!c(u))&&(d=r.pickEllipsoid(s,i,g8),u=r.pickEllipsoid(a,i,eTe)),!c(d)||!c(u)){e._rotating=!0,nu(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),c(r.constrainedAxis)){let f=r.constrainedAxis,p=m.mostOrthogonalAxis(f,MD);m.cross(p,f,p),m.normalize(p,p);let y=m.cross(f,p,gL),h=m.magnitude(d),g=m.dot(f,d),x=Math.acos(g/h),S=m.multiplyByScalar(f,g,ND);m.subtract(d,S,S),m.normalize(S,S);let V=m.magnitude(u),Z=m.dot(f,u),R=Math.acos(Z/V),E=m.multiplyByScalar(f,Z,tTe);m.subtract(u,E,E),m.normalize(E,E);let I=Math.acos(m.dot(S,p));m.dot(S,y)<0&&(I=w.TWO_PI-I);let v=Math.acos(m.dot(E,p));m.dot(E,y)<0&&(v=w.TWO_PI-v);let P=I-v,F;m.equalsEpsilon(f,r.position,w.EPSILON2)?F=r.right:F=m.cross(f,r.position,MD);let N=m.cross(f,F,MD),b=m.dot(N,m.subtract(d,f,gL)),G=m.dot(N,m.subtract(u,f,gL)),X;b>0&&G>0?X=R-x:b>0&&G<=0?m.dot(r.position,f)>0?X=-x-R:X=x+R:X=x-R,r.rotateRight(P),r.rotateUp(X)}else{m.normalize(d,d),m.normalize(u,u);let f=m.dot(d,u),p=m.cross(d,u,MD);if(f<1&&!m.equalsEpsilon(p,m.ZERO,w.EPSILON14)){let y=Math.acos(f);r.rotate(p,y)}}}var L0t=new m,Z0t=new pe,nTe=0;function gTe(e,t,n){c(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,l=e._cameraUnderground,d;l?d=t:(d=hTe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,pTe),f,p=o.cartesianToCartographic(s.position,Z0t).height,y=Math.abs(nTe)<e.minimumPickingTerrainDistanceWithInertia;(i?y:p<e._minimumPickingTerrainHeight)&&(f=T0(e,d,bTe));let g;if(c(f)&&(g=m.distance(u.origin,f),nTe=g),l){let S=aTe(e,u,p);c(g)?g=Math.min(g,S):g=S}c(g)||(g=p);let x=m.normalize(s.position,L0t);C8(e,t,n,e.zoomFactor,g,m.dot(x,s.direction))}var xTe=new D,DD=new bn,vA=new m,R0t=new m,_Te=new M,G0t=new M,TTe=new M,E0t=new Fe,X0t=new te,L8=new pe,Z8=new m;function I0t(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(c(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,Z8);iu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,L8);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,w0t(e,t,n)):P0t(e,t,n)}var W0t=new pe;function w0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,W0t).height;if(a-s-1<w.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let l=o.canvas,d=xTe;d.x=l.clientWidth/2,d.y=l.clientHeight/2;let u=r.getPickRay(d,DD),f,p=qn.rayEllipsoid(u,i);if(c(p))f=bn.getPoint(u,p.start,vA);else if(a>e._minimumTrackBallHeight){let V=qn.grazingAltitudeLocation(u,i);if(!c(V))return;let Z=i.cartesianToCartographic(V,L8);Z.height=0,f=i.cartographicToCartesian(Z,vA)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,Z8);iu(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let y=wt.eastNorthUpToFixedFrame(f,i,_Te),h=e._globe,g=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=M.clone(r.transform,TTe);r._setTransform(y),nu(e,t,n,m.UNIT_Z),r._setTransform(x),e._globe=h,e._ellipsoid=g;let S=g.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function P0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,l,d;if(D.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,vA);else{if(a=T0(e,t,vA),!c(a)){if(l=r.getPickRay(t,DD),d=qn.rayEllipsoid(l,i),!c(d)){if(i.cartesianToCartographic(r.position,L8).height<=e._minimumTrackBallHeight){e._looking=!0;let G=e._ellipsoid.geodeticSurfaceNormal(r.position,Z8);iu(e,t,n,G),D.clone(t,e._tiltCenterMousePosition)}return}a=bn.getPoint(l,d.start,vA)}s&&(c(l)||(l=r.getPickRay(t,DD)),cTe(e,l,a,a)),D.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,f=xTe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,l=r.getPickRay(f,DD);let p=m.magnitude(a),y=m.fromElements(p,p,p,T8),h=re.fromCartesian3(y,S8);if(d=qn.rayEllipsoid(l,h),!c(d))return;let g=m.magnitude(l.origin)>p?d.start:d.stop,x=bn.getPoint(l,g,R0t),S=wt.eastNorthUpToFixedFrame(a,i,_Te),V=wt.eastNorthUpToFixedFrame(x,h,G0t),Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=m.UNIT_Z,I=M.clone(r.transform,TTe);r._setTransform(V);let v=m.cross(x,r.positionWC,OD);if(m.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(E=void 0);let G=r.constrainedAxis;r.constrainedAxis=void 0,nu(e,t,n,E,!0,!1),r.constrainedAxis=G}else nu(e,t,n,E,!0,!1);if(r._setTransform(S),nu(e,t,n,E,!1,!0),c(r.constrainedAxis)){let b=m.cross(r.direction,r.constrainedAxis,OD);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=Z,e._ellipsoid=R;let F=R.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let N=m.clone(r.positionWC,OD);if(e.enableCollisionDetection&&R8(e,!0),!m.equals(r.positionWC,N)){r._setTransform(V),r.worldToCameraCoordinatesPoint(N,N);let b=m.magnitudeSquared(N);m.magnitudeSquared(r.position)>b&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(b),r.position));let G=m.angleBetween(N,r.position),X=m.cross(N,r.position,N);m.normalize(X,X);let W=Fe.fromAxisAngle(X,G,E0t),A=te.fromQuaternion(W,X0t);te.multiplyByVector(A,r.direction,r.direction),te.multiplyByVector(A,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var v0t=new D,F0t=new D,iTe=new bn,oTe=new bn,A0t=new m,M0t=new m;function iu(e,t,n,i){let r=e._scene.camera,s=v0t;s.x=n.startPosition.x,s.y=0;let a=F0t;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,iTe),d=r.getPickRay(a,oTe),u=0,f,p;r.frustum instanceof sn?(f=l.origin,p=d.origin,m.add(r.direction,f,f),m.add(r.direction,p,p),m.subtract(f,r.position,f),m.subtract(p,r.position,p),m.normalize(f,f),m.normalize(p,p)):(f=l.direction,p=d.direction);let y=m.dot(f,p);y<1&&(u=Math.acos(y)),u=n.startPosition.x>n.endPosition.x?-u:u;let h=e._horizontalRotationAxis;if(c(i)?r.look(i,-u):c(h)?r.look(h,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,iTe),d=r.getPickRay(a,oTe),u=0,r.frustum instanceof sn?(f=l.origin,p=d.origin,m.add(r.direction,f,f),m.add(r.direction,p,p),m.subtract(f,r.position,f),m.subtract(p,r.position,p),m.normalize(f,f),m.normalize(p,p)):(f=l.direction,p=d.direction),y=m.dot(f,p),y<1&&(u=Math.acos(y)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??h,c(i)){let g=r.direction,x=m.negate(i,A0t),S=m.equalsEpsilon(g,i,w.EPSILON2),V=m.equalsEpsilon(g,x,w.EPSILON2);if(!S&&!V){y=m.dot(g,i);let Z=w.acosClamped(y);u>0&&u>Z&&(u=Z-w.EPSILON4),y=m.dot(g,x),Z=w.acosClamped(y),u<0&&-u>Z&&(u=-Z+w.EPSILON4);let R=m.cross(i,g,M0t);r.look(R,u)}else(S&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function N0t(e){bl(e,e.enableRotate,e.rotateEventTypes,x0t,e.inertiaSpin,"_lastInertiaSpinMovement"),bl(e,e.enableZoom,e.zoomEventTypes,gTe,e.inertiaZoom,"_lastInertiaZoomMovement"),bl(e,e.enableTilt,e.tiltEventTypes,I0t,e.inertiaSpin,"_lastInertiaTiltMovement"),bl(e,e.enableLook,e.lookEventTypes,iu)}var k0t=new M,U0t=new pe;function R8(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===se.SCENE2D||i===se.MORPHING)return;let o=n.camera,r=n.ellipsoid??re.WGS84,s=n.mapProjection,a,l;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,k0t),l=m.magnitude(o.position),o._setTransform(M.IDENTITY));let d=U0t;i===se.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let f=e._scene.globeHeight;if(c(f)){let p=f+e.minimumZoomDistance,y=f-e._lastGlobeHeight,h=y/e._lastGlobeHeight;d.height<p&&(t||Math.abs(h)<=.1)&&(d.height=p,i===se.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(h)<=.1?e._lastGlobeHeight=f:e._lastGlobeHeight+=y*.1}}c(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(l,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)))}FA.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===se.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var O0t=new m,D0t=new m;FA.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??re.default):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Lr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Lr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Lr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&c(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,O0t),l=m.clone(t.directionWC,D0t);if(i===se.SCENE2D?Ubt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,u0t(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,N0t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(l,t.directionWC);R8(this,d)}this._aggregator.reset()};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),he(this)};var AA=FA;var UKi=_(T(),1);var _Ki=_(T(),1),MA=`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); +vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) { +vec3 tileUv = getTileUv(tileAndUv, octreeCoords); +return clamp(tileUv, vec3(0.0), vec3(1.0)); } -`;var SKi=_(T(),1),NA=`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; +void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) { +vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords); +vec3 inputCoordinate = tileUv * vec3(u_dimensions); +#if defined(PADDING) +inputCoordinate += vec3(u_paddingBefore); +#endif +#if defined(Y_UP_METADATA_ORDER) +#if defined(SHAPE_BOX) +float inputY = inputCoordinate.y; +inputCoordinate.y = inputCoordinate.z; +inputCoordinate.z = float(u_inputDimensions.z) - inputY; +#elif defined(SHAPE_CYLINDER) +float angle = inputCoordinate.y; +float height = inputCoordinate.z; +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +if (sampleData.tileCoords.w == 0) { +float angleCount = float(u_inputDimensions.z); +angle = mod(angle + angleCount / 2.0, angleCount); } -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); +#endif +inputCoordinate.y = height; +inputCoordinate.z = angle; +#endif +#endif +sampleData.tileUv = tileUv; +sampleData.inputCoordinate = inputCoordinate; } -`;function S0(){this._sceneFramebuffer=new BT;let e=.125,t=new Array(6);t[0]=new mo({fragmentShader:td,textureScale:e,forcePowerOfTwo:!0,sampleMode:qd.LINEAR});let n=t[1]=new mo({fragmentShader:NA,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 mo({fragmentShader:vg,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 mo({fragmentShader:vg,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 mo({fragmentShader:td,sampleMode:qd.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new mo({fragmentShader:MA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new nd({stages:t});let o=new jT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}S0.prototype.get=function(e){return this._stages.get(e)};S0.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 B0t=new ce,STe=new D,Y0t=new D,CTe=new M;function H0t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,l=M.computeViewportTransformation(n,0,1,CTe),d=M.multiplyByPoint(r,o,B0t),u=wt.pointToGLWindowCoordinates(s,l,o,STe);d.x+=w.SOLAR_RADIUS;let f=wt.pointToGLWindowCoordinates(a,l,d,d),p=D.magnitude(D.subtract(f,u,f))*30*2,y=Y0t;y.x=p,y.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(y.x,y.y)*.15;let h=t.drawingBufferWidth,g=t.drawingBufferHeight,x=e._stages,S=x.get(0),V=S.outputTexture.width,Z=S.outputTexture.height,R=new je;R.width=V,R.height=Z,l=M.computeViewportTransformation(R,0,1,CTe),u=wt.pointToGLWindowCoordinates(s,l,o,STe),y.x*=V/h,y.y*=Z/g;let E=S.scissorRectangle;E.x=Math.max(u.x-y.x*.5,0),E.y=Math.max(u.y-y.y*.5,0),E.width=Math.min(y.x,h),E.height=Math.min(y.y,g);for(let I=1;I<4;++I)je.clone(E,x.get(I).scissorRectangle)}S0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};S0.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),H0t(this,t,n),o};S0.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)};S0.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};S0.prototype.isDestroyed=function(){return!1};S0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),he(this)};var kA=S0;var KKi=_(T(),1);function VTe(){this._cachedShowFrustumsShaders={}}function z0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function K0t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Be.replaceMain(u,"czm_Debug_main");let f=/out_FragData_(\d+)/g,p;for(;(p=f.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 l;if(s>0)for(l=0;l<s;++l)a+=` out_FragData_${r[l]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${r[l]}.rgb *= debugShowFrustumsColor; -`;else a+=` out_FragColor.rgb *= debugShowCommandsColor; -`,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let d=z0t(i);return tn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var UA=new Y;function J0t(e,t){let n;return c(t.uniformMap)?n=t.uniformMap:n={},c(n.debugShowCommandsColor)||c(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(c(t._debugColor)||(t._debugColor=Y.fromRandom()),t._debugColor):Y.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(UA.red=t.debugOverlappingFrustums&1?1:0,UA.green=t.debugOverlappingFrustums&2?1:0,UA.blue=t.debugOverlappingFrustums&4?1:0,UA.alpha=1,UA):Y.WHITE}),n}var Q0t=new et;VTe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];c(o)||(o=K0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=et.shallowClone(t,Q0t);r.shaderProgram=o,r.uniformMap=J0t(e,t),r.execute(e.context,n)};var OA=VTe;var tJi=_(T(),1);function iS(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Xn}iS.fromKeyframeNode=function(e,t,n,i){C.typeOf.object("primitive",e),C.typeOf.number("tileIndex",t),C.typeOf.number("sampleIndex",n),C.typeOf.object("keyframeNode",i);let o=new iS(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=j0t(e,s,n),o._orientedBoundingBox=$0t(e,r,n,o._orientedBoundingBox),o};function j0t(e,t,n){if(!c(t)||!c(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let l=i[a],d=lt.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[l]=u}return s}var LTe=new m,q0t=new m;function $0t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,l=Math.floor(a/o.x),d=a-l*o.x,u=m.fromElements(d,l,s,LTe),f=m.divideComponents(m.subtract(u,e._paddingBefore,LTe),e.dimensions,q0t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,f,i)}Object.defineProperties(iS.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()}}});iS.prototype.hasProperty=function(e){return c(this._metadata[e])};iS.prototype.getNames=function(){return Object.keys(this._metadata)};iS.prototype.getProperty=function(e){return this._metadata[e]};var DA=iS;var V8i=_(T(),1);var CQi=_(T(),1);var rQi=_(T(),1);var iJi=_(T(),1),BA=`struct Ray { -vec3 pos; -vec3 dir; -vec3 rawDir; -}; -#if defined(JITTER) -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); +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; +float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; +float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; +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; +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; +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 ivec4 tileCoordinate, inout TraversalData traversalData) { +OctreeNodeData childData; +for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { +int level = traversalData.octreeCoords.w + 1; +int levelDifference = tileCoordinate.w - level; +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +traversalData.octreeCoords = ivec4(coordinateAtLevel, level); +ivec3 childCoordinate = coordinateAtLevel & 1; +childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate); +if (childData.flag != OCTREE_FLAG_INTERNAL) { +break; } -#endif -float minComponent(in vec3 v) { -return min(min(v.x, v.y), v.z); +traversalData.parentOctreeIndex = childData.data; } -float maxComponent(in vec3 v) { -return max(max(v.x, v.y), v.z); +return childData; } -struct PointJacobianT { -vec3 point; -mat3 jacobianT; -}; -`;var rJi=_(T(),1),YA=`#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 +void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, 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(tileAndUv.tileCoords, traversalData); +} +#if (SAMPLE_COUNT == 1) +getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[0]); #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; +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); #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) -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); +bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { +int levelDifference = tileCoordinate.w - octreeCoords.w; +if (levelDifference < 0) { +return false; } -vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) { -vec3 gradient = 2.0 * viewRay.rawDir * jacobianT; -vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient; -RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay); -vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz); -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) { -dt = shapeIntersection.exit.w - currentT + shift; +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +return coordinateAtLevel == octreeCoords.xyz; } -float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); -return vec4(entry.xyz, stepSize); +void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { +ivec4 tileCoords = tileAndUv.tileCoords; +if (insideTile(tileCoords, traversalData.octreeCoords)) { +for (int i = 0; i < SAMPLE_COUNT; i++) { +addSampleCoordinates(tileAndUv, sampleDatas[i]); } -vec2 packIntToVec2(int value) { -float shifted = float(value) / 255.0; -float lowBits = fract(shifted); -float highBits = floor(shifted) / 255.0; -return vec2(highBits, lowBits); +return; } -vec2 packFloatToVec2(float value) { -float lowBits = fract(value); -float highBits = floor(value) / 255.0; -return vec2(highBits, lowBits); +for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { +traversalData.octreeCoords.xyz /= 2; +traversalData.octreeCoords.w -= 1; +if (insideTile(tileCoords, traversalData.octreeCoords)) { +break; } -int getSampleIndex(in SampleData sampleData) { -vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5); -vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate); -ivec3 sampleIndex = ivec3(floor(inputCoordinate)); -return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z); +traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); } -void main() -{ -vec4 fragCoord = gl_FragCoord; -vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; -vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); -vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); -vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); -vec3 viewPosUv = u_cameraPositionUv; -#if defined(SHAPE_ELLIPSOID) -vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv; -Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir); +OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData); +#if (SAMPLE_COUNT == 1) +getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[0]); #else -Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv); +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif -Intersections ix; -RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); -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); -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); -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) { -Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); -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]); -czm_modelMaterial materialOutput; -fragmentMain(fragmentInput, materialOutput); -vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); -color.rgb = max(color.rgb, vec3(0.0)); -color.a = clamp(color.a, 0.0, 1.0); -colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); -if (colorAccum.a > ALPHA_ACCUM_MAX) { -colorAccum.a = ALPHA_ACCUM_MAX; -break; +`;var Rfo=x(T(),1),Rk=`uniform ivec3 u_megatextureTileCounts; +vec3 index1DTo3DTexCoord(int index) +{ +int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y; +int iz = index / tilesPerZ; +int remainder = index - iz * tilesPerZ; +int iy = remainder / u_megatextureTileCounts.x; +int ix = remainder - iy * u_megatextureTileCounts.x; +return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts); } -if (step.w == 0.0) { -step.w == 0.00001; +Properties getPropertiesFromMegatexture(in SampleData sampleData) { +int tileIndex = sampleData.megatextureIndex; +vec3 voxelCoord = sampleData.inputCoordinate; +vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex); +vec3 tileDimensions = vec3(u_inputDimensions); +vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5)); +vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts); +return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv); } -currentT += step.w; -positionUv = viewPosUv + currentT * viewDirUv; -if (currentT > endT) { -#if (INTERSECTION_COUNT == 1) -break; +Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { +#if (SAMPLE_COUNT == 1) +return getPropertiesFromMegatexture(sampleDatas[0]); #else -shapeIntersection = nextIntersection(ix); -if (shapeIntersection.entry.w == NO_HIT) { -break; -} else { -currentT = shapeIntersection.entry.w; -endT = shapeIntersection.exit.w; -positionUv = viewPosUv + currentT * viewDirUv; -} -#endif -} -pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); -traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas); -step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); -} -colorAccum.a /= ALPHA_ACCUM_MAX; -#if defined(PICKING) -if (colorAccum.a == 0.0) { -discard; +Properties properties = clearProperties(); +for (int i = 0; i < SAMPLE_COUNT; ++i) { +float weight = sampleDatas[i].weight; +if (weight > 0.0) { +Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); +tempProperties = scaleProperties(tempProperties, weight); +properties = sumProperties(properties, tempProperties); } -out_FragColor = u_pickColor; -#elif defined(PICKING_VOXEL) -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; +return properties; #endif } -`;var aJi=_(T(),1),HA=`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 lJi=_(T(),1),zA=`#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; +`;var Vfo=x(T(),1),X2e={Z_UP:0,Y_UP:1};Object.freeze(X2e);var P0=X2e;function iWt(e){let t=new Jb;this.shaderBuilder=t;let n=e._customShader,i=It(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let f in o)if(o.hasOwnProperty(f)){let y=o[f];t.addUniform(y.type,f,fe.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",fe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([hk]),e.provider.metadataOrder===P0.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,fe.FRAGMENT);let d=e._provider.shape;d==="BOX"?t.addDefine("SHAPE_BOX",void 0,fe.FRAGMENT):d==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,fe.FRAGMENT):d==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,fe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",Zk,uk,Rk,fk,bk,pk]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,fe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,fe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,fe.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,fe.FRAGMENT),d==="BOX"?t.addFragmentLines([Tk,gk,nR]):d==="CYLINDER"?t.addFragmentLines([_k,dA,yk,nR]):d==="ELLIPSOID"&&t.addFragmentLines([Sk,dA,xk,nR]),t.addFragmentLines([mk]);let u=e._shape,m=u.shaderDefines;for(let f in m)if(m.hasOwnProperty(f)){let y=m[f];l(y)&&(y=y===!0?void 0:y,t.addDefine(f,y,fe.FRAGMENT))}let p=u.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,fe.FRAGMENT),s===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,fe.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,fe.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,fe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT);let b=e._traversal;t.addDefine("SAMPLE_COUNT",`${b._sampleCount}`,fe.FRAGMENT)}var Ck=iWt;var N2e=new k;function oWt(e,t){let n=new Ck(e);dk(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(r>0){let R="getClippingPlane",C=`vec4 ${R}(highp sampler2D packedPlanes, int planeNumber)`,E=gs.getTextureResolution(o,t,N2e),A=Y2e(E);i.addFunction(R,C,fe.FRAGMENT),i.addFunctionLines(R,[A])}if(a>0){let R="getBoundPlane",C=`vec4 ${R}(highp sampler2D packedPlanes, int planeNumber)`,E=ny.getTextureResolution(s,t,N2e),A=Y2e(E);i.addFunction(R,C,fe.FRAGMENT),i.addFunctionLines(R,[A])}let c=i.clone();c.addDefine("PICKING",void 0,fe.FRAGMENT);let d=i.clone();d.addDefine("PICKING_VOXEL",void 0,fe.FRAGMENT);let u=i.buildShaderProgram(t),m=c.buildShaderProgram(t),p=d.buildShaderProgram(t),b=ze.fromCache({cull:{enabled:!0,face:Di.BACK},depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),y=e._depthTest,_=new lt({vertexArray:f,primitiveType:Ie.TRIANGLES,renderState:b,shaderProgram:u,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Le.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),S=lt.shallowClone(_,new lt);S.shaderProgram=m,S.pickOnly=!0;let Z=lt.shallowClone(_,new lt);if(Z.shaderProgram=p,Z.pickOnly=!0,l(e._drawCommand)){let R=e._drawCommand;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}if(l(e._drawCommandPick)){let R=e._drawCommandPick;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let R=e._drawCommandPickVoxel;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}e._drawCommand=_,e._drawCommandPick=S,e._drawCommandPickVoxel=Z}function Y2e(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let s=`${o}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; + int pixX = planeNumber - (pixY * ${t}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${s}; + return texture(packedPlanes, vec2(u, v));`}var Vk=oWt;var t0o=x(T(),1);var Zpo=x(T(),1);var U2e={};function rWt(e,t,n){let i,o,r;if(e instanceof qi){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 hd)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var sWt=new h,w2e=new h;function D2e(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 m=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-m)}}return function(o){return W.lerp(e,t,o)}}function Yre(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,m=e.frustum,p=h.subtract(a,c,sWt),b=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),w2e)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),w2e));r=Math.min(rWt(m,b,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function Ek(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 O2e=new h;function aWt(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,O2e),u=c.pitch,m=Ek(c.heading,i),p=Ek(c.roll,r),b=Yre(c,n,d.z,n.z,s),f=D2e(u,o,b,a);function y(_){let S=_.time/t;c.setView({orientation:{heading:W.lerp(m,i,S),pitch:f(S),roll:W.lerp(p,r,S)}}),k.lerp(d,n,S,c.position),c.position.z=b(S)}return y}function cWt(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function lWt(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 dWt=new pe,uWt=new pe;function mWt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,b=pe.clone(u.positionCartographic,dWt),f=u.pitch,y=Ek(u.heading,i),_=Ek(u.roll,r),S=p.cartesianToCartographic(n,uWt);b.longitude=W.zeroToTwoPi(b.longitude),S.longitude=W.zeroToTwoPi(S.longitude);let Z=!1;if(l(a)){let A=W.zeroToTwoPi(a),L=Math.min(b.longitude,S.longitude),F=Math.max(b.longitude,S.longitude),I=A>=L&&A<=F;if(l(c)){let N=Math.abs(b.longitude-S.longitude),g=W.TWO_PI-N;(I?N:g)<(I?g:N)*c&&!I&&(Z=!0)}else I||(Z=!0)}Z?cWt(b,S):lWt(b,S);let R=Yre(u,n,b.height,S.height,s),C=D2e(f,o,R,d);function E(){let A=b.longitude,L=S.longitude,F=b.latitude,I=S.latitude;return function(g){let V=g.time/t,G=h.fromRadians(W.lerp(A,L,V),W.lerp(F,I,V),R(V),p);u.setView({destination:G,orientation:{heading:W.lerp(y,i,V),pitch:C(V),roll:W.lerp(_,r,V)}})}}return E()}function hWt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,O2e),d=Ek(a.heading,i),u=a.frustum.right-a.frustum.left,m=Yre(a,n,u,n.z,s);function p(b){let f=b.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),k.lerp(c,n,f,a.position);let y=m(f),_=a.frustum,S=_.top/_.right,Z=(y-(_.right-_.left))*.5;_.right+=Z,_.left-=Z,_.top=S*_.right,_.bottom=-_.top}return p}var M2e=new pe,fWt=new h;function Nre(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function k2e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}U2e.createTween=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===se.MORPHING)return Nre();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==se.SCENE3D&&(s.cartesianToCartographic(n,M2e),n=r.project(M2e,fWt));let p=e.camera,b=t.endTransform;l(b)&&p._setTransform(b);let f=t.duration;l(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let y=t.heading??0,_=t.pitch??-W.PI_OVER_TWO,S=t.roll??0,Z=e.screenSpaceCameraController;Z.enableInputs=!1;let R=k2e(Z,t.complete),C=k2e(Z,t.cancel),E=p.frustum,A=e.mode===se.SCENE2D;if(A=A&&k.equalsEpsilon(p.position,n,W.EPSILON6),A=A&&W.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,W.EPSILON6),A=A||e.mode!==se.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),A=A&&W.equalsEpsilon(W.negativePiToPi(y),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(S),W.negativePiToPi(p.roll),W.EPSILON10),A)return Nre(R,C);let L=new Array(4);if(L[se.SCENE2D]=hWt,L[se.SCENE3D]=mWt,L[se.COLUMBUS_VIEW]=aWt,f<=0)return Nre(function(){L[i](e,1,n,y,_,S,a,c,d,u)({time:1}),typeof R=="function"&&R()},C);let F=L[i](e,f,n,y,_,S,a,c,d,u);if(!l(m)){let I=p.positionCartographic.height,N=i===se.SCENE3D?s.cartesianToCartographic(n).height:n.z;I>N&&I>11500?m=vs.CUBIC_OUT:m=vs.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:F,complete:R,cancel:C}};var Ak=U2e;var Cpo=x(T(),1),B2e={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(B2e);var fd=B2e;function ln(e){this._scene=e,this._transform=P.clone(P.IDENTITY),this._invTransform=P.clone(P.IDENTITY),this._actualTransform=P.clone(P.IDENTITY),this._actualInvTransform=P.clone(P.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new pe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new qi,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 Se,this._moveEnd=new Se,this._changed=new Se,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 P,this._invViewMatrix=new P,nFe(this),this._mode=se.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new pe(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,fFe(this,ln.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*ln.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}ln.TRANSFORM_2D=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ln.TRANSFORM_2D_INVERSE=P.inverseTransformation(ln.TRANSFORM_2D,new P);ln.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-95,-20,-70,90);ln.DEFAULT_VIEW_FACTOR=.5;ln.DEFAULT_OFFSET=new dh(0,-W.PI_OVER_FOUR,0);function nFe(e){P.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),P.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),P.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function pWt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Zn()):e.timeSinceMoved=Math.max(Zn()-e._lastMovedTimestamp,0)/1e3}}ln.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==se.SCENE2D};ln.prototype._updateCameraChanged=function(){let e=this;if(pWt(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===se.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,b=e._changedPosition,f=e.frustum,y=e._changedFrustum,_=p.x+f.left,S=p.x+f.right,Z=b.x+y.left,R=b.x+y.right,C=p.y+f.bottom,E=p.y+f.top,A=b.y+y.bottom,L=b.y+y.top,F=Math.max(_,Z),I=Math.min(S,R),N=Math.max(C,A),g=Math.min(E,L),V;if(F>=I||N>=E)V=1;else{let G=y;_<Z&&S>R&&C<A&&E>L&&(G=f),V=1-(I-F)*(g-N)/((G.right-G.left)*(G.top-G.bottom))}V>t&&(e._changed.raiseEvent(V),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let m=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||m>t)&&(e._changed.raiseEvent(Math.max(d,m)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function bWt(e){_t.basisTo2D(e._projection,e._transform,e._actualTransform)}var gWt=new pe,yWt=new h,lK=new h,xWt=new ce,TWt=new ce,_Wt=new ce,SWt=new ce,ZWt=new ce;function RWt(e){let t=e._projection,n=t.ellipsoid,i=P.getColumn(e._transform,3,xWt),o=n.cartesianToCartographic(i,gWt),r=t.project(o,yWt),s=TWt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,ZWt),c=ce.add(P.getColumn(e._transform,0,lK),i,lK);n.cartesianToCartographic(c,o),t.project(o,r);let d=_Wt;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,h.subtract(d,s,d),d.x=0;let u=SWt;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=ce.add(P.getColumn(e._transform,1,lK),i,lK);n.cartesianToCartographic(m,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0,h.magnitudeSquared(u)<W.EPSILON10&&(ce.clone(ce.UNIT_Y,d),ce.clone(ce.UNIT_Z,u))}h.cross(u,a,d),h.normalize(d,d),h.cross(a,d,u),h.normalize(u,u),P.setColumn(e._actualTransform,0,d,e._actualTransform),P.setColumn(e._actualTransform,1,u,e._actualTransform),P.setColumn(e._actualTransform,2,a,e._actualTransform),P.setColumn(e._actualTransform,3,s,e._actualTransform)}var wre=new h;function Cl(e){let t=e._mode,n=!1,i=0;t===se.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,d=!h.equals(c,e.up);d&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let u=e._right,m=!h.equals(u,e.right);m&&(h.normalize(e.right,e.right),u=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(P.inverseTransformation(e._transform,e._invTransform),e._mode===se.COLUMBUS_VIEW||e._mode===se.SCENE2D?P.equals(P.IDENTITY,e._transform)?P.clone(ln.TRANSFORM_2D,e._actualTransform):e._mode===se.COLUMBUS_VIEW?bWt(e):RWt(e):P.clone(e._transform,e._actualTransform),P.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let b=e._actualTransform;if(r||p)if(e._positionWC=P.multiplyByPoint(b,o,e._positionWC),t===se.SCENE3D||t===se.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=wre;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===se.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||m){let f=h.dot(s,h.cross(c,u,wre));if(Math.abs(1-f)>W.EPSILON2){let y=1/h.magnitudeSquared(c),_=h.dot(c,s)*y,S=h.multiplyByScalar(s,_,wre);c=h.normalize(h.subtract(c,S,e._up),e._up),h.clone(c,e.up),u=h.cross(s,c,e._right),h.clone(u,e.right)}}(a||p)&&(e._directionWC=P.multiplyByPointAsVector(b,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=P.multiplyByPointAsVector(b,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=P.multiplyByPointAsVector(b,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||d||m||p)&&nFe(e)}function iFe(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 oFe(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function rFe(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 mK=new P,hK=new P;Object.defineProperties(ln.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Cl(this),this._invTransform}},viewMatrix:{get:function(){return Cl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Cl(this),this._invViewMatrix}},positionCartographic:{get:function(){return Cl(this),this._positionCartographic}},positionWC:{get:function(){return Cl(this),this._positionWC}},directionWC:{get:function(){return Cl(this),this._directionWC}},upWC:{get:function(){return Cl(this),this._upWC}},rightWC:{get:function(){return Cl(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,mK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,hK);this._setTransform(n);let i=iFe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,mK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,hK);this._setTransform(n);let i=oFe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,mK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,hK);this._setTransform(n);let i=rFe(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}}});ln.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==se.MORPHING,t=this._mode===se.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===se.SCENE2D&&lFe(this,this.position)};var CWt=new h,VWt=new h,EWt=new h;ln.prototype._setTransform=function(e){let t=h.clone(this.positionWC,CWt),n=h.clone(this.upWC,VWt),i=h.clone(this.directionWC,EWt);P.clone(e,this._transform),this._transformChanged=!0,Cl(this);let o=this._actualInvTransform;P.multiplyByPoint(o,t,this.position),P.multiplyByPointAsVector(o,i,this.direction),P.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Cl(this)};var AWt=new k,GWt=new gn,LWt=new h,WWt=new h;function sFe(e){if(!P.equals(P.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=AWt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,GWt);o=n.pickWorldCoordinates(a,t,!0,LWt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,WWt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}ln.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof yn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=sFe(this)))};var fK=new h,Ore=new P,vWt=new P,Bre=new Ne,zre=new q,aFe=new pe;function FWt(e,t,n){let i=P.clone(e.transform,Ore),o=_t.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,vWt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,Bre),s=q.fromQuaternion(r,zre);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function IWt(e,t,n,i){let o=P.clone(e.transform,Ore);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,aFe);t=a.project(c,fK)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,Bre),s=q.fromQuaternion(r,zre);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function PWt(e,t,n,i){let o=P.clone(e.transform,Ore);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,aFe);t=c.project(d,fK)}k.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===fd.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Ne.fromHeadingPitchRoll(n,Bre),s=q.fromQuaternion(r,zre);q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var XWt=new h,NWt=new h,YWt=new h;function cFe(e,t,n,i){let o=h.clone(n.direction,XWt),r=h.clone(n.up,NWt);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,c=_t.eastNorthUpToFixedFrame(t,a,mK),d=P.inverseTransformation(c,hK);P.multiplyByPointAsVector(d,o,o),P.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,YWt);return i.heading=iFe(o,r),i.pitch=oFe(o),i.roll=rFe(o,r,s),i}var Dre={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},uA=new Cc;ln.prototype.setView=function(e){e=e??B.EMPTY_OBJECT;let t=e.orientation??B.EMPTY_OBJECT,n=this._mode;if(n===se.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??h.clone(this.positionWC,fK);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,fK),i=!1),l(t.direction)&&(t=cFe(this,o,t,Dre.orientation)),uA.heading=t.heading??0,uA.pitch=t.pitch??-W.PI_OVER_TWO,uA.roll=t.roll??0,n===se.SCENE3D?FWt(this,o,uA):n===se.SCENE2D?PWt(this,o,uA,i):IWt(this,o,uA,i)};var wWt=new h;ln.prototype.flyHome=function(e){let t=this._mode;if(t===se.MORPHING&&this._scene.completeMorph(),t===se.SCENE2D)this.flyTo({destination:ln.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:P.IDENTITY});else if(t===se.SCENE3D){let n=this.getRectangleCameraCoordinates(ln.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*ln.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:P.IDENTITY})}else if(t===se.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,wWt).z),roll:0},endTransform:P.IDENTITY,convert:!1})}};ln.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ce),Cl(this),P.multiplyByVector(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Cl(this),P.multiplyByPoint(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Cl(this),P.multiplyByPointAsVector(this._actualInvTransform,e,t)};ln.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ce),Cl(this),P.multiplyByVector(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Cl(this),P.multiplyByPoint(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Cl(this),P.multiplyByPointAsVector(this._actualTransform,e,t)};function lFe(e,t){let n=e._scene.mapMode2D===fd.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 z2e=new h;ln.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,z2e),h.add(n,z2e,n),this._mode===se.SCENE2D&&lFe(this,n),this._adjustOrthographicFrustum(!0)};ln.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?pK(this,e):this.move(this.direction,e)};ln.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?pK(this,-e):this.move(this.direction,-e)};ln.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};ln.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};ln.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};ln.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};ln.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,-e)};ln.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,e)};ln.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,-e)};ln.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,e)};var MWt=new Ne,kWt=new q;ln.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Ne.fromAxisAngle(e,-n,MWt),o=q.fromQuaternion(i,kWt),r=this.direction,s=this.up,a=this.right;q.multiplyByVector(o,r,r),q.multiplyByVector(o,s,s),q.multiplyByVector(o,a,a)};ln.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};ln.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var UWt=new Ne,DWt=new q;ln.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Ne.fromAxisAngle(e,-n,UWt),o=q.fromQuaternion(i,DWt);q.multiplyByVector(o,this.position,this.position),q.multiplyByVector(o,this.direction,this.direction),q.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};ln.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,dFe(this,e)};ln.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,dFe(this,-e)};var OWt=new h,BWt=new h,zWt=new h,H2e=new h;function dFe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,OWt),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,H2e),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,BWt),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,H2e)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,zWt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}ln.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,uFe(this,-e)};ln.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,uFe(this,e)};function uFe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function pK(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===fd.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===fd.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 mFe(e,t){e.move(e.direction,t)}ln.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?pK(this,e):mFe(this,e)};ln.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?pK(this,-e):mFe(this,-e)};ln.prototype.getMagnitude=function(){if(this._mode===se.SCENE3D)return h.magnitude(this.position);if(this._mode===se.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===se.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var HWt=new P;ln.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ne.default,o=_t.eastNorthUpToFixedFrame(e,i,HWt);this.lookAtTransform(o,t)};var KWt=new h,JWt=new Ne,jWt=new Ne,QWt=new q;function hFe(e,t,n,i){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let o=Ne.fromAxisAngle(h.UNIT_Y,-t,JWt),r=Ne.fromAxisAngle(h.UNIT_Z,-e,jWt),s=Ne.multiply(r,o,r),a=q.fromQuaternion(s,QWt),c=h.clone(h.UNIT_X,i);return q.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}ln.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=hFe(t.heading,t.pitch,t.range,KWt):n=t,this._mode===se.SCENE2D){k.clone(k.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<W.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(P.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<W.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var qWt=new P,K2e=new h,$Wt=new h,J2e=new h;ln.prototype.lookAtWorldPosition=function(e,t=ne.default){let n=P.clone(this._transform,qWt);this._setTransform(P.IDENTITY);let i=h.subtract(e,this.positionWC,K2e);h.magnitudeSquared(i)<W.EPSILON8&&(i=h.clone(this.directionWC,K2e)),i=h.normalize(i,this.direction);let o=t.geodeticSurfaceNormal(e,$Wt),r=h.cross(i,o,J2e);h.magnitudeSquared(r)<W.EPSILON8&&(r=h.clone(this.rightWC,J2e)),h.normalize(r,this.right);let s=h.cross(r,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var Gk=new pe,evt=new pe,tvt=new h,nvt=new h,ivt=new h,ovt=new h,rvt=new h,svt=new h,avt=new h,Mre=new h,cvt={direction:new h,right:new h,up:new h},j2e;function Rl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function fFe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:cvt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,m;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)m=0;else{let I=Gk;I.longitude=u,I.latitude=s,I.height=0;let N=evt;N.longitude=u,N.latitude=a,N.height=0;let g=j2e;(!l(g)||g.ellipsoid!==o)&&(j2e=g=new mb(void 0,void 0,o)),g.setEndPoints(I,N),m=g.interpolateUsingFraction(.5,Gk).latitude}let p=Gk;p.longitude=u,p.latitude=m,p.height=0;let b=o.cartographicToCartesian(p,avt),f=Gk;f.longitude=d,f.latitude=s;let y=o.cartographicToCartesian(f,tvt);f.longitude=c;let _=o.cartographicToCartesian(f,ivt);f.longitude=u;let S=o.cartographicToCartesian(f,rvt);f.latitude=a;let Z=o.cartographicToCartesian(f,svt);f.longitude=d;let R=o.cartographicToCartesian(f,ovt);f.longitude=c;let C=o.cartographicToCartesian(f,nvt);h.subtract(_,b,_),h.subtract(R,b,R),h.subtract(y,b,y),h.subtract(C,b,C),h.subtract(S,b,S),h.subtract(Z,b,Z);let E=o.geodeticSurfaceNormal(b,r.direction);h.negate(E,E);let A=h.cross(E,h.UNIT_Z,r.right);h.normalize(A,A);let L=h.cross(A,E,r.up),F;if(e.frustum instanceof yn){let I=Math.max(h.distance(y,_),h.distance(R,C)),N=Math.max(h.distance(y,R),h.distance(_,C)),g,V,G=e.frustum._offCenterFrustum,v=G.right/G.top,X=N*v;I>X?(g=I,V=g/v):(V=N,g=X),F=Math.max(g,V)}else{let I=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*I;if(F=Math.max(Rl(E,L,_,I),Rl(E,L,R,I),Rl(E,L,y,I),Rl(E,L,C,I),Rl(E,L,S,I),Rl(E,L,Z,I),Rl(E,A,_,N),Rl(E,A,R,N),Rl(E,A,y,N),Rl(E,A,C,N),Rl(E,A,S,N),Rl(E,A,Z,N)),a<0&&s>0){let g=Gk;g.longitude=c,g.latitude=0,g.height=0;let V=o.cartographicToCartesian(g,Mre);h.subtract(V,b,V),F=Math.max(F,Rl(E,L,V,I),Rl(E,A,V,N)),g.longitude=d,V=o.cartographicToCartesian(g,Mre),h.subtract(V,b,V),F=Math.max(F,Rl(E,L,V,I),Rl(E,A,V,N))}}return h.add(b,h.multiplyByScalar(E,-F,Mre),n)}var lvt=new pe,dvt=new h,uvt=new h;function mvt(e,t,n){let i=e._projection;t.west>t.east&&(t=re.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=lvt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,dvt);P.multiplyByPoint(o,a,a),P.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,uvt);if(P.multiplyByPoint(o,c,c),P.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 hvt=new pe,fvt=new h,pvt=new h;function bvt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===fd.INFINITE_SCROLL?o+=W.TWO_PI:(t=re.MAX_VALUE,o=t.east));let r=hvt;r.longitude=o,r.latitude=t.north;let s=i.project(r,fvt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,pvt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,m,p=e.frustum.right/e.frustum.top,b=d*p;return c>b?(u=c,m=u/p):(m=d,u=b),d=Math.max(2*u,2*m),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}ln.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===se.SCENE3D)return fFe(this,e,t);if(n===se.COLUMBUS_VIEW)return mvt(this,e,t);if(n===se.SCENE2D)return bvt(this,e,t)};var gvt=new gn;function yvt(e,t,n,i){n=n??ne.default;let o=e.getPickRay(t,gvt),r=yi.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var xvt=new gn;function Tvt(e,t,n,i){let r=e.getPickRay(t,xvt).origin;r=h.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 _vt=new gn;function Svt(e,t,n,i){let o=e.getPickRay(t,_vt),r=-o.origin.x/o.direction.x;gn.getPoint(o,r,i);let s=n.unproject(new h(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)}ln.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ne.default,this._mode===se.SCENE3D)n=yvt(this,e,t,n);else if(this._mode===se.SCENE2D)n=Tvt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=Svt(this,e,this._projection,n);else return;return n}};var Zvt=new h,Rvt=new h,Cvt=new h;function Vvt(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,m=e.positionWC;h.clone(m,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Zvt);h.add(m,p,p);let b=h.multiplyByScalar(e.rightWC,d*c*a,Rvt),f=h.multiplyByScalar(e.upWC,u*c*s,Cvt),y=h.add(p,b,n.direction);return h.add(y,f,y),h.subtract(y,m,y),h.normalize(y,y),n}var dK=new h;function Evt(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;if(h.clone(e.positionWC,u),h.multiplyByScalar(e.rightWC,c,dK),h.add(dK,u,u),h.multiplyByScalar(e.upWC,d,dK),h.add(dK,u,u),h.clone(e.directionWC,n.direction),e._mode===se.SCENE2D&&e._scene.mapMode2D===fd.INFINITE_SCROLL){let m=e._maxCoord.x;u.y=W.mod(u.y+m,2*m)-m}return n}ln.prototype.getPickRay=function(e,t){l(t)||(t=new gn);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)?Vvt(this,e,t):Evt(this,e,t)};var Avt=new h,Gvt=new h;ln.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Avt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Gvt);return Math.max(0,h.magnitude(n)-e.radius)};var Lvt=new k;ln.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Lvt);return Math.max(o.x,o.y)};function Wvt(e,t,n,i,o,r){let s=h.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=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:vs.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var vvt=new h,Q2e=new h,Fvt=new h,Ivt=new h;function Pvt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,vvt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,Q2e),Q2e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,Fvt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,Ivt)),u=c*d,m=a*d,p=e._maxCoord.x,b=e._maxCoord.y,f=Math.max(u-p,p),y=Math.max(m-b,b);if(n.z<-f||n.z>f||n.y<-y||n.y>y){let _=s.y<-f||s.y>f,S=s.z<-y||s.z>y;if(_||S)return Wvt(e,n,s,f,y,t)}}ln.prototype.createCorrectPositionTween=function(e){if(this._mode===se.COLUMBUS_VIEW)return Pvt(this,e)};var Xvt=new h,Ja={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};ln.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};ln.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=Ja.destination,e.orientation.heading=Ja.heading,e.orientation.pitch=Ja.pitch,e.orientation.roll=Ja.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};ln.prototype.flyTo=function(e){e=e??B.EMPTY_OBJECT;let t=e.destination;if(this._mode===se.MORPHING)return;this.cancelFlight();let i=t instanceof re;i&&(t=this.getRectangleCameraCoordinates(t,Xvt));let o=e.orientation??B.EMPTY_OBJECT;if(l(o.direction)&&(o=cFe(this,t,o,Dre.orientation)),l(e.duration)&&e.duration<=0){let u=Dre;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;Ja.destination=t,Ja.heading=o.heading,Ja.pitch=o.pitch,Ja.roll=o.roll,Ja.duration=e.duration,Ja.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ja.cancel=e.cancel,Ja.endTransform=e.endTransform,Ja.convert=i?!1:e.convert,Ja.maximumHeight=e.maximumHeight,Ja.pitchAdjustHeight=e.pitchAdjustHeight,Ja.flyOverLongitude=e.flyOverLongitude,Ja.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ja.easingFunction=e.easingFunction;let a=this._scene,c=Ak.createTween(a,Ja);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!==se.SCENE2D&&(l(d)||(d=ln.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function Nvt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Yvt(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 wvt=100;function pFe(e,t,n){n=dh.clone(l(n)?n:ln.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=wvt:e.frustum instanceof yn||e._mode===se.SCENE2D?n.range=Yvt(e,s):n.range=Nvt(e,s),n.range=W.clamp(n.range,i,o)}return n}ln.prototype.viewBoundingSphere=function(e,t){t=pFe(this,e,t),this.lookAt(e.center,t)};var Mvt=new P,q2e=new h,kvt=new h,Uvt=new h,Dvt=new h,Ovt=new ce,Bvt=new Ne,zvt=new q;ln.prototype.flyToBoundingSphere=function(e,t){t=t??B.EMPTY_OBJECT;let n=this._mode===se.SCENE2D||this._mode===se.COLUMBUS_VIEW;this._setTransform(P.IDENTITY);let i=pFe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,q2e):o=hFe(i.heading,i.pitch,i.range,q2e);let s=this._scene.ellipsoid??ne.default,a=_t.eastNorthUpToFixedFrame(e.center,s,Mvt);P.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,kvt),h.normalize(c,c),d=P.multiplyByPointAsVector(a,h.UNIT_Z,Uvt),1-Math.abs(h.dot(c,d))<W.EPSILON6){let m=Ne.fromAxisAngle(c,i.heading,Bvt),p=q.fromQuaternion(m,zvt);h.fromCartesian4(P.getColumn(a,1,Ovt),d),q.multiplyByVector(p,d,d)}let u=h.cross(c,d,Dvt);h.cross(u,c,d),h.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 $2e=new h,eFe=new h,kre=new h,tFe=new h,Lk=[new h,new h,new h,new h];function Hvt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,$2e),r=h.magnitude(o),s=h.normalize(o,eFe),a,c;h.equalsEpsilon(s,h.UNIT_Z,W.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,kre),kre),c=h.normalize(h.cross(s,a,tFe),tFe));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,$2e),m=d/r,p=h.multiplyByScalar(a,m,eFe),b=h.multiplyByScalar(c,m,kre),f=h.add(u,b,Lk[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let y=h.subtract(u,b,Lk[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let _=h.subtract(u,b,Lk[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let S=h.add(u,b,Lk[3]);return h.add(S,p,S),h.multiplyComponents(n,S,S),Lk}var Ure=new k,Kvt=new h,ET=[new pe,new pe,new pe,new pe];function uK(e,t,n,i,o,r){Ure.x=e,Ure.y=t;let s=i.pickEllipsoid(Ure,o,Kvt);return l(s)?(ET[n]=o.cartesianToCartographic(s,ET[n]),1):(ET[n]=o.cartesianToCartographic(r[n],ET[n]),0)}ln.prototype.computeViewRectangle=function(e,t){e=e??ne.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new de(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===qt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=Hvt(this,e);if(c+=uK(0,0,0,this,e,d),c+=uK(0,a,1,this,e,d),c+=uK(s,a,2,this,e,d),c+=uK(s,0,3,this,e,d),c<2)return re.MAX_VALUE;t=re.fromCartographicArray(ET,t);let u=0,m=ET[3].longitude;for(let p=0;p<4;++p){let b=ET[p].longitude,f=Math.abs(b-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=b}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,ET[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};ln.prototype.switchToPerspectiveFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof qi)return;let e=this._scene;this.frustum=new qi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};ln.prototype.switchToOrthographicFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof yn)return;let e=sFe(this),t=this._scene;this.frustum=new yn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};ln.clone=function(e,t){return l(t)||(t=new ln(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),P.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Io=ln;var h0o=x(T(),1);var i0o=x(T(),1),bFe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(bFe);var lo=bFe;var _Fe=[ir.SHIFT,ir.CTRL,ir.ALT,[ir.SHIFT,ir.CTRL],[ir.SHIFT,ir.ALT],[ir.CTRL,ir.ALT],[ir.SHIFT,ir.CTRL,ir.ALT]];function ja(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function Jvt(e,t){k.clone(e.distance.startPosition,t.distance.startPosition),k.clone(e.distance.endPosition,t.distance.endPosition),k.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),k.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function gFe(e,t,n){let i=ja(lo.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 k;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new k,endPosition:new k},d.angleAndHeight={startPosition:new k,endPosition:new k},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,k.lerp(u.position1,u.position2,.5,s[i])},mn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},mn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(Jvt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(k.clone(u.distance.endPosition,d.distance.endPosition),k.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let m=d.angleAndHeight.endPosition.x,p=d.prevAngle,b=Math.PI*2;for(;m>=p+Math.PI;)m-=b;for(;m<p-Math.PI;)m+=b;d.angleAndHeight.endPosition.x=-m*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},mn.PINCH_MOVE,t)}function yFe(e,t){let n=ja(lo.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 k,endPosition:new k,valid:!1}),s.startPosition=new k,k.clone(k.ZERO,s.startPosition),s.endPosition=new k,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,k.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},mn.WHEEL,t)}function mA(e,t,n){let i=ja(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new k;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new k,endPosition:new k,valid:!1});let c,d;n===lo.LEFT_DRAG?(c=mn.LEFT_DOWN,d=mn.LEFT_UP):n===lo.RIGHT_DRAG?(c=mn.RIGHT_DOWN,d=mn.RIGHT_UP):n===lo.MIDDLE_DRAG&&(c=mn.MIDDLE_DOWN,d=mn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,k.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){Hre(ja(n,void 0),e);for(let u of _Fe){let m=ja(n,u);Hre(m,e)}},d,t)}function Hre(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 xFe(e,t){k.clone(e.startPosition,t.startPosition),k.clone(e.endPosition,t.endPosition)}function jvt(e,t,n){let i=n._isDown,o=!1,r=ja(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,Hre(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new k,endPosition:new k,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function TFe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in lo)if(lo.hasOwnProperty(s)){let a=lo[s];if(l(a)){let c=ja(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new k,endPosition:new k,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new k,endPosition:new k})}}e._eventHandler.setInputAction(function(s){for(let a in lo)if(lo.hasOwnProperty(a)){let c=lo[a];if(l(c)){let d=ja(c,t);jvt(c,t,e),r[d]&&(n[d]?(xFe(i[d],o[d]),o[d].valid=!0,xFe(s,i[d]),n[d]=!1):k.clone(s.endPosition,i[d].endPosition))}}k.clone(s.endPosition,e._currentMousePosition)},mn.MOUSE_MOVE,t)}function Th(e){this._eventHandler=new la(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new k,yFe(this,void 0),gFe(this,void 0,e),mA(this,void 0,lo.LEFT_DRAG),mA(this,void 0,lo.RIGHT_DRAG),mA(this,void 0,lo.MIDDLE_DRAG),TFe(this,void 0);for(let t of _Fe)yFe(this,t),gFe(this,t,e),mA(this,t,lo.LEFT_DRAG),mA(this,t,lo.RIGHT_DRAG),mA(this,t,lo.MIDDLE_DRAG),TFe(this,t)}Object.defineProperties(Th.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ja(lo.WHEEL)]||!this._update[ja(lo.WHEEL,ir.SHIFT)]||!this._update[ja(lo.WHEEL,ir.CTRL)]||!this._update[ja(lo.WHEEL,ir.ALT)];return this._buttonsDown>0||e}}});Th.prototype.isMoving=function(e,t){let n=ja(e,t);return!this._update[n]};Th.prototype.getMovement=function(e,t){let n=ja(e,t);return this._movement[n]};Th.prototype.getLastMovement=function(e,t){let n=ja(e,t),i=this._lastMovement[n];if(i.valid)return i};Th.prototype.isButtonDown=function(e,t){let n=ja(e,t);return this._isDown[n]};Th.prototype.getStartMousePosition=function(e,t){if(e===lo.WHEEL)return this._currentMousePosition;let n=ja(e,t);return this._eventStartPosition[n]};Th.prototype.getButtonPressTime=function(e,t){let n=ja(e,t);return this._pressTime[n]};Th.prototype.getButtonReleaseTime=function(e,t){let n=ja(e,t);return this._releaseTime[n]};Th.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Th.prototype.isDestroyed=function(){return!1};Th.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var Wk=Th;var b0o=x(T(),1);var Kre=class{constructor(){mt(this,"featuresLength");mt(this,"pointsLength");mt(this,"trianglesLength");mt(this,"geometryByteLength");mt(this,"texturesByteLength");mt(this,"batchTableByteLength");mt(this,"innerContents");mt(this,"ready");mt(this,"tileset");mt(this,"tile");mt(this,"url");mt(this,"batchTable");mt(this,"metadata");mt(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){ge.throwInstantiationError()}getFeature(t){ge.throwInstantiationError()}applyDebugSettings(t,n){ge.throwInstantiationError()}applyStyle(t){ge.throwInstantiationError()}update(t,n){ge.throwInstantiationError()}pick(t,n,i){ge.throwInstantiationError()}isDestroyed(){ge.throwInstantiationError()}destroy(){ge.throwInstantiationError()}},Jre=Kre;var x0o=x(T(),1);function Qvt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var _h=Qvt;var Obo=x(T(),1);var Z0o=x(T(),1);function vk(e){e=e??B.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new qg({comparator:vk.comparator})}vk.prototype.addSubtree=function(e){let t=new qvt(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()};vk.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}};vk.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 qvt(e,t){this.subtree=e,this.stamp=t}var Fk=vk;var W0o=x(T(),1);function iy(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(iy.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});iy.fromMetadataArray=function(e){return new iy({metadata:e})};iy.fromGltf=async function(e){let t=new Lu({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new iy({loader:t})};iy.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=$vt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function $vt(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 m=c[o[u]].attribute,p=e.find(_=>_.name===m);if(!l(p))continue;let b=Nt.toComponentDatatype(s[u]),f=St.getComponentCount(r[u]),y=p.count*f;d[u]=J.createArrayBufferView(b,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return d}iy.prototype.isDestroyed=function(){return!1};iy.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),me(this)};var iR=iy;var ybo=x(T(),1);var k0o=x(T(),1);function Vl(){this._orientedBoundingBox=new tn,this._boundingSphere=new de,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=Vl.DefaultMinBounds.clone(),this._maxBounds=Vl.DefaultMaxBounds.clone(),this._renderMinBounds=Vl.DefaultMinBounds.clone(),this._renderMaxBounds=Vl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Vl,n=[new ta(h.negate(h.UNIT_X,new h),e.x),new ta(h.negate(h.UNIT_Y,new h),e.y),new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_X,-t.x),new ta(h.UNIT_Y,-t.y),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ny({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new q,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Vl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var e2t=new h,t2t=new h,n2t=new q,i2t=new h,o2t=new h;Vl.prototype.update=function(e,t,n,i,o){i=i??t.clone(i2t),o=o??n.clone(o2t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let r=h.clamp(t,i,o,this._renderMinBounds),s=h.clamp(n,i,o,this._renderMaxBounds),a=P.getScale(e,t2t);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=qre(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let d=this._shaderUniforms,u=this._shaderDefines;for(let y in u)u.hasOwnProperty(y)&&(u[y]=void 0);let m=0;u.BOX_INTERSECTION_INDEX=m,m+=1;let p=t,b=n,f=h.fromElements(jre(p.x,b.x),jre(p.y,b.y),jre(p.z,b.z),d.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(f,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=m,!0};function jre(e,t){return W.equalsEpsilon(e,t,W.EPSILON7)?1:1/(t-e)}var r2t=new P;Vl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,r2t),i=P.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;q.multiply(i,o,t.boxEcToXyz)};Vl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var bK=new h,Qre=new h;Vl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.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),bK),d=h.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)),Qre);return qre(c,d,this._shapeTransform,o)};var SFe=new h;Vl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,SFe),s=h.multiplyByScalar(r,o,SFe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,bK),o,bK),c=h.add(a,s,Qre),d=this._minBounds,u=this._maxBounds,m=h.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),bK),p=h.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),Qre);return qre(m,p,this._shapeTransform,i)};Vl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Vl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var ZFe=new h;function qre(e,t,n,i){let o=Vl.DefaultMinBounds,r=Vl.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=P.getTranslation(n,i.center),i.halfAxes=P.getMatrix3(n,i.halfAxes);else{let a=P.getScale(n,ZFe),c=h.midpoint(e,t,e2t);i.center=P.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),ZFe);let d=P.getRotation(n,n2t);i.halfAxes=q.setScale(d,a,i.halfAxes)}return i}var oR=Vl;var $0o=x(T(),1);function cm(){this._orientedBoundingBox=new tn,this._boundingSphere=new de,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=cm.DefaultMinBounds.clone(),this._maxBounds=cm.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=cm,n=[new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ny({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new q,cylinderRenderRadiusMinMax:new k,cylinderRenderAngleMinMax:new k,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,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_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(cm.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var s2t=new h,a2t=new h,c2t=new h,l2t=new h,d2t=new h,u2t=new P,m2t=new h,RFe=new k;cm.prototype.update=function(e,t,n,i,o){i=i??t.clone(a2t),o=o??n.clone(c2t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=cm,a=s.y-r.y,c=.5*a,d=W.EPSILON10,u=W.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=W.negativePiToPi(t.y),n.y=W.negativePiToPi(n.y),i.y=W.negativePiToPi(i.y),o.y=W.negativePiToPi(o.y);let m=h.maximumByComponent(t,i,l2t),p=h.minimumByComponent(n,o,d2t),b=P.getScale(e,s2t);if(p.x===0||m.x>p.x||m.z>p.z||W.equalsEpsilon(b.x,0,void 0,d)||W.equalsEpsilon(b.y,0,void 0,d)||W.equalsEpsilon(b.z,0,void 0,d))return!1;let f=this._renderBoundPlanes;f.get(0).distance=m.z,f.get(1).distance=-p.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=tse(m,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,_=n.y-t.y+y*a,S=p.y<m.y,Z=p.y-m.y+S*a,R=Z>=c-u&&Z<a-u,C=Z>u&&Z<c-u,E=Z<=u,A=R||C||E,L=this._shaderUniforms,F=this._shaderDefines;for(let K in F)F.hasOwnProperty(K)&&(F[K]=void 0);let I=0;F.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=I,I+=1,_<a-u&&(F.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),m.x!==r.x&&(F.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,F.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=I,I+=1),L.cylinderRenderRadiusMinMax=k.fromElements(m.x,p.x,L.cylinderRenderRadiusMinMax),m.x===p.x&&(F.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let N=n.x-t.x,g=0,V=1;N!==0&&(g=1/N,V=-t.x*g);let G=n.z-t.z,v=0,X=1;G!==0&&(v=1/G,X=-t.z*v),A&&(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,F.CYLINDER_INTERSECTION_INDEX_ANGLE=I,R?(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,I+=1):C?(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,I+=2):E&&(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,I+=2),L.cylinderRenderAngleMinMax=k.fromElements(m.y,p.y,L.cylinderRenderAngleMinMax));let Y=(t.y-r.y)/a,D=(n.y-r.y)/a,w=1-_/a,O=(D+.5*w)%1;L.cylinderShapeUvAngleRangeOrigin=O;let M=0,z=1;if(_>u){M=a/_;let K=Y-O;z=-M*(K-Math.floor(K))}return L.cylinderLocalToShapeUvScale=h.fromElements(g,M,v,L.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(V,z,X,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=I,!0};var h2t=new q,f2t=new q,p2t=new P;cm.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,u2t),i=P.multiplyByPoint(n,e.camera.positionWC,m2t);t.cameraShapePosition=h.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=k.normalize(k.fromCartesian3(i,RFe),RFe),r=q.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],h2t),s=e.context.uniformState.inverseView,a=P.multiplyTransformation(n,s,p2t),c=P.getMatrix3(a,f2t);t.cylinderEcToRadialTangentUp=q.multiply(r,c,t.cylinderEcToRadialTangentUp)};cm.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvScale:r,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*r.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*r.y+a.y,o=o*r.z+a.z,h.fromElements(n,i,o,t)};var gK=new h,ese=new h;cm.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,t*a),W.lerp(r.y,s.y,n*a),W.lerp(r.z,s.z,i*a),gK),d=h.fromElements(W.lerp(r.x,s.x,(t+1)*a),W.lerp(r.y,s.y,(n+1)*a),W.lerp(r.z,s.z,(i+1)*a),ese);return tse(c,d,this._shapeTransform,o)};var CFe=new h;cm.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,CFe),s=h.multiplyByScalar(r,o,CFe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,gK),o,gK),c=h.add(a,s,ese),d=this._minBounds,u=this._maxBounds,m=h.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),gK),p=h.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),ese);return tse(m,p,this._shapeTransform,i)};cm.DefaultMinBounds=Object.freeze(new h(0,-W.PI,-1));cm.DefaultMaxBounds=Object.freeze(new h(1,+W.PI,1));var b2t=5,g2t=new Array(b2t),y2t=new h,x2t=new q,T2t=new P,_2t=new P,S2t=new P,$re=new P,Z2t=new h,R2t=new h,C2t=new h,EFe=new Array(8);for(let e=0;e<8;e++)EFe[e]=new h;function VFe(e,t,n){return Math.abs(ce.dot(e,t))<n}function V2t(e){let t=P.getColumn(e,0,Z2t),n=P.getColumn(e,1,R2t),i=P.getColumn(e,2,C2t),o=W.EPSILON4;return VFe(t,n,o)&&VFe(n,i,o)}function E2t(e,t){let n=EFe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)P.multiplyByPoint(e,n[i],n[i]);return tn.fromPoints(n,t)}var A2t=new h;function tse(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+W.TWO_PI:t.y,c=e.z,d=t.z,u=a-s,m=s+u*.5,p=g2t,b=0;p[b++]=s,p[b++]=a,p[b++]=m,u>W.PI&&(p[b++]=m-W.PI_OVER_TWO,p[b++]=m+W.PI_OVER_TWO);let f=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let Y=0;Y<b;++Y){let D=p[Y]-m,w=Math.cos(D),O=Math.sin(D),M=w*o,z=O*o,K=w*r,te=O*r;f=Math.min(f,M,K),y=Math.min(y,z,te),_=Math.max(_,M,K),S=Math.max(S,z,te)}let Z=_-f,R=S-y,C=d-c,E=(f+_)*.5,A=(y+S)*.5,L=(c+d)*.5,F=h.fromElements(E,A,L,y2t),I=q.fromRotationZ(m,x2t),N=h.fromElements(Z,R,C,A2t),g=P.fromScale(N,S2t),V=P.fromRotation(I,_2t),G=P.fromTranslation(F,T2t),v=P.multiplyTransformation(V,P.multiplyTransformation(G,g,$re),$re),X=P.multiplyTransformation(n,v,$re);return V2t(X)?tn.fromTransformation(X,i):E2t(X,i)}var rR=cm;var hbo=x(T(),1);function Sh(){this._orientedBoundingBox=new tn,this._boundingSphere=new de,this._boundTransform=new P,this._shapeTransform=new P,this._rectangle=new re,this._minimumHeight=Sh.DefaultMinBounds.z,this._maximumHeight=Sh.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new h,this._rotation=new q,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new q,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new k,ellipsoidCurvatureAtLatitude:new k,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new k,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new k,clipMinMaxHeight:new k},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_SHAPE_BOUNDS_LONGITUDE: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}Object.defineProperties(Sh.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var G2t=new h,L2t=new h,W2t=new h,v2t=new h,F2t=new h,I2t=new h,P2t=new h,X2t=new h,AFe=new h,GFe=new h,N2t=new re;Sh.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Sh;i=i??r,o=o??s;let a=W.EPSILON10,c=W.EPSILON10,d=W.EPSILON10,u=W.EPSILON3,m=P.getScale(e,X2t),p=h.clone(r,G2t);p.z=-h.minimumComponent(m);let b=h.clamp(t,p,s,L2t),f=h.clamp(n,p,s,W2t),y=h.clamp(i,p,s,v2t),_=h.clamp(o,p,s,F2t),S=h.maximumByComponent(b,y,I2t),Z=h.minimumByComponent(f,_,P2t),R=h.add(m,h.fromElements(f.z,f.z,f.z,AFe),AFe),C=h.add(m,h.fromElements(Z.z,Z.z,Z.z,GFe),GFe);if(S.y>Z.y||S.y===s.y||Z.y===r.y||S.z>Z.z||W.equalsEpsilon(C,h.ZERO,void 0,a))return!1;this._rectangle=re.fromRadians(b.x,b.y,f.x,f.y),this._translation=P.getTranslation(e,this._translation),this._rotation=P.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(m,this._ellipsoid),this._minimumHeight=b.z,this._maximumHeight=f.z;let E=re.fromRadians(S.x,S.y,Z.x,Z.y,N2t);this._orientedBoundingBox=nse(E,S.z,Z.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=P.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=de.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let A=s.x-r.x,L=.5*A,F=Z.x<S.x,I=Z.x-S.x+F*A,N=I<=c,g=I>=L-c&&I<A-c,V=I>c&&I<L-c,G=N||g||V,v=f.x<b.x,X=f.x-b.x+v*A,Y=X>L+c&&X<A-c,D=X>=L-c&&X<=L+c,w=X<L-c,O=Y||D||w,M=Z.y<-u,z=Z.y>=-u&&Z.y<=+u,K=Z.y>+u&&Z.y<s.y-d,te=M||z||K,H=S.y>r.y+d&&S.y<-u,$=S.y>=-u&&S.y<=+u,ee=S.y>+u,le=H||$||ee,_e=te||le,he=f.y-b.y,Ze=f.y<-u,ye=f.y>=-u&&f.y<=+u,Ge=f.y>+u&&f.y<s.y-d,Ae=Ze||ye||Ge,Fe=b.y>r.y+d&&b.y<-u,tt=b.y>=-u&&b.y<=+u,Be=b.y>+u,qe=Ae||(Fe||tt||Be),We=this._shaderUniforms,Ke=this._shaderDefines;for(let jn in Ke)Ke.hasOwnProperty(jn)&&(Ke[jn]=void 0);We.ellipsoidRadii=h.clone(R,We.ellipsoidRadii);let{x:ct,z:Et}=We.ellipsoidRadii,zt=Et/ct;We.eccentricitySquared=1-zt*zt,We.evoluteScale=k.fromElements((ct*ct-Et*Et)/ct,(Et*Et-ct*ct)/Et,We.evoluteScale),We.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(We.ellipsoidRadii,We.ellipsoidRadii,We.ellipsoidInverseRadiiSquared),We.ellipsoidInverseRadiiSquared);let ut=0;Ke.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ut,ut+=1,Ke.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ut,ut+=1,We.clipMinMaxHeight=k.fromElements(S.z-f.z,Z.z-f.z,We.clipMinMaxHeight);let bt=f.z-b.z,ht=bt===0?0:1/bt;G&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ut,g?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ut+=1):V?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ut+=2):N&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ut+=2),We.ellipsoidRenderLongitudeMinMax=k.fromElements(S.x,Z.x,We.ellipsoidRenderLongitudeMinMax));let jt=0,st=1;if(O){Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let jn=(b.x-r.x)/A,_i=(f.x-r.x)/A,Hi=1-X/A,Gi=(_i+.5*Hi)%1;if(We.ellipsoidShapeUvLongitudeRangeOrigin=Gi,X>c){jt=A/X;let fi=jn-Gi;st=-jt*(fi-Math.floor(fi))}}_e&&(le&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ut,H?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ut+=1):$?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ut+=1):ee&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ut+=2)),te&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ut,M?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ut+=2):z?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ut+=1):K&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ut+=1)),We.ellipsoidRenderLatitudeSinMinMax=k.fromElements(Math.sin(S.y),Math.sin(Z.y),We.ellipsoidRenderLatitudeSinMinMax));let pt=0,wi=1;return qe&&(Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,he>d&&(pt=(s.y-r.y)/he,wi=(r.y-b.y)/he)),We.ellipsoidLocalToShapeUvScale=h.fromElements(jt,pt,ht,We.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(st,wi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=ut,!0};var Y2t=new pe,w2t=new h,M2t=new P,LFe=new q;Sh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,Y2t);h.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=h.fromRadians(o.longitude,o.latitude,0,n,w2t);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=_t.eastNorthUpToFixedFrame(r,n,M2t),a=P.getRotation(s,LFe),c=e.context.uniformState.viewRotation,d=q.multiply(c,a,LFe);t.ellipsoidEcToEastNorthUp=q.transpose(d,t.ellipsoidEcToEastNorthUp)};var NFe=new re;Sh.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,m=(i+1)*r,p=re.subsection(this._rectangle,s,c,a,d,NFe),b=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return nse(p,b,f,this._ellipsoid,this._translation,this._rotation,o)};var k2t=new k,U2t=new k,Ik=new k,WFe=new k,vFe=new k,Pk=new k;function D2t(e,t,n,i){let o=k.abs(e,k2t),r=k.fromElements(1/t.x,1/t.y,U2t),s=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,Ik),a=k.multiplyComponents(t,s,WFe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,vFe);for(let d=0;d<3;++d){let u=k.magnitude(k.subtract(a,c,Pk)),m=k.normalize(k.subtract(o,c,Pk),Pk),p=k.multiplyByScalar(m,u,Pk);s=k.multiplyComponents(k.add(p,c,Ik),r,Ik),s=k.normalize(k.clamp(s,k.ZERO,k.ONE,Ik),Ik),a=k.multiplyComponents(t,s,WFe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,vFe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,k.magnitude(k.subtract(a,c,Pk)),i)}var O2t=new k,FFe=new k,B2t=new h,IFe=new k;Sh.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,d=Math.hypot(e.x,e.y),u=k.fromElements(d,e.z,FFe),m=D2t(u,k.fromElements(i.x,i.z,O2t),o,B2t),p=k.normalize(k.fromElements(m.x*r.x,m.y*r.z,IFe),IFe),b=Math.atan2(p.y,p.x),f=k.magnitude(u)<k.magnitude(m)?-1:1,y=k.subtract(u,m,FFe),_=f*k.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:S,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:Z}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(S)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),b=(b+Math.PI/2)/Math.PI,l(Z)&&(b=b*a.y+c.y),_=1+_*a.z,h.fromElements(n,b,_,t)};var PFe=new h,XFe=new h,z2t=new h;Sh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,PFe),s=h.multiplyByScalar(r,o,PFe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,XFe),o,XFe),c=h.add(a,s,z2t),d=re.subsection(this._rectangle,a.x,a.y,c.x,c.y,NFe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return nse(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function nse(e,t,n,i,o,r,s){return s=tn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=q.multiply(s.halfAxes,r,s.halfAxes),s}Sh.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));Sh.DefaultMaxBounds=Object.freeze(new h(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var sR=Sh;var su={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};su.getMinBounds=function(e){switch(e){case su.BOX:return oR.DefaultMinBounds;case su.ELLIPSOID:return sR.DefaultMinBounds;case su.CYLINDER:return rR.DefaultMinBounds}};su.getMaxBounds=function(e){switch(e){case su.BOX:return oR.DefaultMaxBounds;case su.ELLIPSOID:return sR.DefaultMaxBounds;case su.CYLINDER:return rR.DefaultMaxBounds}};su.getShapeConstructor=function(e){switch(e){case su.BOX:return oR;case su.ELLIPSOID:return sR;case su.CYLINDER:return rR}};Object.freeze(su);var xc=su;function Xk(e){e=e??B.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:d=P.IDENTITY.clone(),shapeTransform:u=P.IDENTITY.clone(),minBounds:m,maxBounds:p,minimumValues:b,maximumValues:f,maximumTileCount:y}=e;this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=m,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=r===xc.ELLIPSOID?P0.Z_UP:P0.Y_UP,this._minimumValues=b,this._maximumValues=f,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new Fk}Object.defineProperties(Xk.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}}});Xk.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();K2t(n);let i=tFt(n,t);await i.load();let{root:o}=n,r=no(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new MS({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=nFt(s,c);Object.assign(d,J2t(o)),l(o.transform)?d.globalTransform=P.unpack(o.transform):d.globalTransform=P.clone(P.IDENTITY),d.dimensions=h.unpack(a.dimensions),d.maximumTileCount=H2t(s),l(a.padding)&&(d.paddingBefore=h.unpack(a.padding.before),d.paddingAfter=h.unpack(a.padding.after));let u=new Xk(d),m=new $p(t,o,i.schema);return u._implicitTileset=m,u._availableLevels=m.availableLevels,Ni.unload(i),u};function H2t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Xm.TILESET_TILE_COUNT)}function K2t(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!no(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!no(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!no(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function J2t(e){let t=e.boundingVolume;if(l(t.box))return $2t(t.box);if(l(t.region))return j2t(t.region);if(no(t,"3DTILES_bounding_volume_cylinder"))return eFt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function j2t(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=P.fromScale(ne.WGS84.radii),c=new h(t,n,r),d=new h(i,o,s);return{shape:xc.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a}}var Q2t=new h,q2t=new q;function $2t(e){let t=tn.unpack(e),n=q.getScale(t.halfAxes,Q2t),i=q.getRotation(t.halfAxes,q2t);return{shape:xc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:P.fromRotationTranslation(i,t.center)}}function eFt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-W.PI,maxAngle:r=W.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],d=.5*i+s[2],u=P.fromTranslationQuaternionRotationScale(h.unpack(s),Ne.unpack(a),h.ONE);return{shape:xc.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,d),shapeTransform:u}}function tFt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ni.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ni.getSchemaLoader({schema:i})}function nFt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([b,f])=>{let{type:y,componentType:_}=f,S=o?.properties[b].min,Z=o?.properties[b].max,R=St.getComponentCount(y),C=YFe(S,R),E=YFe(Z,R);return{id:b,type:y,componentType:_,minValue:C,maxValue:E}}),a=s.map(b=>b.id),c=s.map(b=>b.type),d=s.map(b=>b.componentType),u=s.map(b=>b.minValue),m=s.map(b=>b.maxValue),p=u.some(l);return{className:t,names:a,types:c,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?m:void 0}}function YFe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function iFt(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=lg(a);return o=await Lb.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}Xk.prototype.requestData=async function(e){e=e??B.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 e0({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(),m=await iFt(this,d);if(!(c?m.childSubtreeIsAvailableAtCoordinates:m.tileIsAvailableAtCoordinates).call(m,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:f,baseResource:y}=s,_=f[0].getDerivedResource({templateValues:a.getTemplateValues()}),S=y.getDerivedResource({url:_.url});return iR.fromGltf(S)};var ise=Xk;var Kbo=x(T(),1);function ose(e){e=e??1,this._radius=e??1}Object.defineProperties(ose.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});ose.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=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var Nk=ose;var Ygo=x(T(),1);var jbo=x(T(),1),yK={CUMULUS:0};yK.validate=function(e){return e===yK.CUMULUS};Object.freeze(yK);var hA=yK;var igo=x(T(),1);function ip(e,t){if(e=e??B.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new k(this._maximumSize.x,this._maximumSize.y);else{this._scale=k.clone(e.scale??new k(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=U.clone(e.color??U.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var oFt=ip.SHOW_INDEX=0,rFt=ip.POSITION_INDEX=1,sFt=ip.SCALE_INDEX=2,aFt=ip.MAXIMUM_SIZE_INDEX=3,cFt=ip.SLICE_INDEX=4,lFt=ip.BRIGHTNESS_INDEX=5,dFt=ip.COLOR_INDEX=6;ip.NUMBER_OF_PROPERTIES=7;function aR(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(ip.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,aR(this,oFt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),aR(this,rFt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),aR(this,sFt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),aR(this,aFt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),aR(this,dFt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,aR(this,cFt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,aR(this,lFt))}}});ip.prototype._destroy=function(){this._cloudCollection=void 0};var lm=ip;var dm,xK=new h,uFt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},mFt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},hFt=lm.SHOW_INDEX,fFt=lm.POSITION_INDEX,pFt=lm.SCALE_INDEX,bFt=lm.MAXIMUM_SIZE_INDEX,gFt=lm.SLICE_INDEX,yFt=lm.BRIGHTNESS_INDEX,xFt=lm.NUMBER_OF_PROPERTIES,TFt=lm.COLOR_INDEX;function op(e){e=e??B.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(xFt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:wFe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function wFe(e){return function(){return xK.x=e._textureSliceWidth,xK.y=e._noiseTextureRows,xK.z=1/e._noiseTextureRows,xK}}Object.defineProperties(op.prototype,{length:{get:function(){return sse(this),this._clouds.length}}});function MFe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}op.prototype.add=function(e){e=e??B.EMPTY_OBJECT;let t=e.cloudType??hA.CUMULUS,n;return t===hA.CUMULUS&&(n=new lm(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};op.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};op.prototype.removeAll=function(){MFe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function sse(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}}op.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};op.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};op.prototype.get=function(e){return sse(this),this._clouds[e]};var _Ft=new Float32Array([-1,-1,1,-1,1,1,-1,1]),SFt=new Uint16Array([0,1,2,0,2,3]);function ZFt(e){let t=ot.createVertexBuffer({context:e,typedArray:_Ft,usage:Pe.STATIC_DRAW}),n=ot.createIndexBuffer({context:e,typedArray:SFt,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:J.FLOAT}];return new Un({context:e,attributes:i,indexBuffer:n})}var ase;function RFt(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=ot.createIndexBuffer({context:e,typedArray:o,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function CFt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ot.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function VFt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ot.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Pe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function EFt(e,t,n){let i=[{index:dm.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:dm.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:dm.packedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:dm.packedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:dm.color,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,usage:Pe.STATIC_DRAW}];n&&i.push({index:dm.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:VFt(e)});let o=n?t:4*t;return new Qb(e,i,o,n)}var rse=new An;function kFe(e,t,n,i){let o,r=n[dm.positionHighAndScaleX],s=n[dm.positionLowAndScaleY],a=i.position;An.fromCartesian(a,rse);let c=i.scale,d=rse.high,u=rse.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 UFe(e,t,n,i){let o,r=n[dm.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 DFe(e,t,n,i){let o,r=n[dm.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 OFe(e,t,n,i){let o,r=n[dm.color],s=i.color,a=U.floatToByte(s.red),c=U.floatToByte(s.green),d=U.floatToByte(s.blue),u=U.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 AFt(e,t,n,i){kFe(e,t,n,i),UFe(e,t,n,i),DFe(e,t,n,i),OFe(e,t,n,i)}function GFt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=ZFt(a),o._spNoise=nn.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:Ue.UNSIGNED_BYTE,pixelFormat:Qe.RGBA,sampler:new Bt({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:ei.NEAREST})});let u=new Gu({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:wFe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function LFt(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=EFt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];AFt(e,t,s,c)}n._vaf.commit(ase(i))}}var WFt=[];function vFt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=WFt;d.length=0,(c[fFt]||c[pFt])&&d.push(kFe),(c[hFt]||c[yFt])&&d.push(UFe),(c[bFt]||c[gFt])&&d.push(DFe),c[TFt]&&d.push(OFe);let u=d.length,m=i._vaf.writers,p,b,f;if(a/r>.1){for(p=0;p<a;++p)for(b=s[p],b._dirty=!1,f=0;f<u;++f)d[f](e,t,m,b);i._vaf.commit(ase(n))}else{for(p=0;p<a;++p){for(b=s[p],b._dirty=!1,f=0;f<u;++f)d[f](e,t,m,b);i._instanced?i._vaf.subCommit(b._index,1):i._vaf.subCommit(b._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function FFt(e,t,n,i){let o=t.context,r=e,s=new Je({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Je({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=nn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:dm}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:on.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function IFt(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 lt),u.pass=Le.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)}}}op.prototype.update=function(e){if(sse(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&GFt(this,e,mM,uM),this._instanced=e.context.instancedArrays,dm=this._instanced?mFt:uFt,ase=this._instanced?CFt:RFt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?LFt(this,e):r>0&&vFt(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)&&FFt(this,e,dM,lM),IFt(this,e))};op.prototype.isDestroyed=function(){return!1};op.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(),MFe(this._clouds),me(this)};var cse=op;var Ogo=x(T(),1);async function lse(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===se.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===se.SCENE2D)return r;let c=[re.center(e),re.southeast(e),re.southwest(e),re.northeast(e),re.northwest(e)],d=await lse._sampleTerrainMostDetailed(n,c),u=!1,m=d.reduce(function(b,f){return l(f.height)?(u=!0,Math.max(f.height,b)):b},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}lse._sampleTerrainMostDetailed=jZ;var cR=lse;var Kgo=x(T(),1);var PFt=W.toRadians(30);function dse(e){this._angle=e??PFt}Object.defineProperties(dse.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});dse.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=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var use=dse;var dyo=x(T(),1);var XFt=new U,NFt=new U,YFt=new U,wFt=new U,BFe=new ce,Yk=new Uint8Array(4);function zFe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return U.lerp(t.color,n.color,o,i)}function TK(e,t){return{height:e,color:U.clone(t)}}function HFe(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?U.equals(t.color,i[n-1].color):!1,a=r?U.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?U.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function MFt(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 b=s[n],f=W.clamp(b.height,au._minimumHeight,au._maximumHeight),y=U.clone(b.color,XFt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(TK(f,y))}let d=!0,u=!0;for(n=0;n<a-1;n++){let b=c[n+0],f=c[n+1];d=d&&b.height<=f.height,u=u&&b.height>=f.height}u?c=c.reverse():d||v0(c,function(b,f){return W.sign(b.height-f.height)});let m=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,TK(au._minimumHeight,c[0].color)),p&&c.splice(c.length,0,TK(au._maximumHeight,c[c.length-1].color)),c=HFe(c),i.push(c)}return i}function kFt(e){let t=MFt(e),n=[],i,o;function r(d,u){n.push(TK(d,u))}function s(d,u,m){let p=U.multiplyByScalar(m,1-u.alpha,wFt);p=U.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,m=0;i=n,n=[];let p=d.length,b=i.length;for(;u<p||m<b;){let f=u<p?d[u]:void 0,y=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,S=m<b?i[m]:void 0,Z=m>0?i[m-1]:void 0,R=m<b-1?i[m+1]:void 0;if(l(f)&&l(S)&&f.height===S.height){let C=l(R)&&S.height===R.height,E=!l(Z),A=!l(R),L=l(_)&&f.height===_.height,F=!l(y),I=!l(_);C?L?(s(f.height,f.color,S.color),s(f.height,_.color,R.color)):F?(r(f.height,S.color),s(f.height,f.color,R.color)):I?(s(f.height,f.color,S.color),r(f.height,R.color)):(s(f.height,f.color,S.color),s(f.height,f.color,R.color)):E?L?(r(f.height,f.color),s(f.height,_.color,S.color)):I?(r(f.height,f.color),r(f.height,S.color)):(F||r(f.height,f.color),s(f.height,f.color,S.color)):A?L?(s(f.height,f.color,S.color),r(f.height,_.color)):F?(r(f.height,S.color),r(f.height,f.color)):I?s(f.height,f.color,S.color):(s(f.height,f.color,S.color),r(f.height,f.color)):L?(s(f.height,f.color,S.color),s(f.height,_.color,S.color)):F?(r(f.height,S.color),s(f.height,f.color,S.color)):I?(s(f.height,f.color,S.color),r(f.height,S.color)):s(f.height,f.color,S.color),u+=L?2:1,m+=C?2:1}else if(l(f)&&l(S)&&l(Z)&&f.height<S.height){let C=zFe(f.height,Z,S,YFt);l(y)?l(_)?s(f.height,f.color,C):(s(f.height,f.color,C),r(f.height,C)):(r(f.height,C),s(f.height,f.color,C)),u++}else if(l(S)&&l(f)&&l(y)&&S.height<f.height){let C=zFe(S.height,y,f,NFt);l(Z)?l(R)?s(S.height,C,S.color):(s(S.height,C,S.color),r(S.height,C)):(r(S.height,C),s(S.height,C,S.color)),m++}else l(f)&&(!l(S)||f.height<S.height)?(l(S)&&!l(Z)&&!l(_)?(r(f.height,f.color),r(f.height,au._emptyColor),r(S.height,au._emptyColor)):(!l(S)&&l(Z)&&!l(y)&&(r(Z.height,au._emptyColor),r(f.height,au._emptyColor)),r(f.height,f.color)),u++):l(S)&&(!l(f)||S.height<f.height)&&(r(S.height,S.color),m++)}}return HFe(n)}function au(e){let{scene:t,layers:n}=e??B.EMPTY_OBJECT,{context:i}=t,o=kFt(n),r=o.length,s,a,c;if(!au._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,c=Qe.RGBA,s=new Uint8Array(r*4);for(let b=0;b<r;b++)ce.packFloat(o[b].height,BFe),ce.pack(BFe,s,b*4)}else{a=Ue.FLOAT,c=i.webgl2?Qe.RED:Qe.LUMINANCE,s=new Float32Array(r);for(let b=0;b<r;b++)s[b]=o[b].height}let u=vt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:ei.NEAREST})}),m=new Uint8Array(r*4);for(let b=0;b<r;b++)o[b].color.toBytes(Yk),m[b*4+0]=Yk[0],m[b*4+1]=Yk[1],m[b*4+2]=Yk[2],m[b*4+3]=Yk[3];let p=vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:ei.LINEAR})});return eo.fromType("ElevationBand",{heights:u,colors:p})}au._useFloatTexture=function(e){return e.floatingPointTexture};au._maximumHeight=5906376425472;au._minimumHeight=-5906376425472;au._emptyColor=new U(0,0,0,0);var mse=au;var xyo=x(T(),1);async function UFt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??B.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||xt("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=e.key??_a.defaultApiKey;if(!l(n))return DFt(t);let i,o=_a.getDefaultCredit();l(o)&&(i=[o]);let r=new ve({url:`${_a.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return zr.fromUrl(r,t)}var KFe={};async function DFt(e){let i=KFe[2275207];l(i)||(i=Ur.fromAssetId(2275207),KFe[2275207]=i);let o=await i;return zr.fromUrl(o,e)}var hse=UFt;var Vyo=x(T(),1);async function OFt(e){let t=await zr.fromIonAssetId(96188,e);e=e??B.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new og({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var fse=OFt;var Xyo=x(T(),1);function BFt(e){e=e??B.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=P.clone(e.modelMatrix??P.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Yt({geometry:zn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new $t(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Yt({geometry:zn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new $t(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Yt({geometry:zn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new $t(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new Tn({flat:!0,translucent:!1})})}var pse=BFt;var Dyo=x(T(),1);var eIe=x(bu(),1),JFe=576,zFt=100,wk="#ffffff",Mk="#48b";function tIe(e,t){this.credit=e,this.count=t??1}function HFt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Lt.equals(o,t))return!0}return!1}function KFt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Lt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var nIe="cesium-credit-delimiter";function jFe(e){let t=document.createElement("span");return t.textContent=e,t.className=nIe,t}function QFe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function qFe(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(jFe(n));else{let u=o[d];u.className!==nIe&&e.replaceChild(jFe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(QFe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(QFe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function JFt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<JFe?(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>=JFe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function $Fe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function jFt(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); } -return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; + +.cesium-credit-lightbox { + background-color: #303336; + color: ${wk}; + position: relative; + min-height: ${zFt}px; + margin: auto; } -vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) -{ -return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; +.cesium-credit-lightbox > ul > li a, +.cesium-credit-lightbox > ul > li a:visited, +.cesium-credit-wrapper a, +.cesium-credit-wrapper a:visited { + color: ${wk}; } -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); +.cesium-credit-lightbox > ul > li a:hover { + color: ${Mk}; } -vec4 entry = intersectionMax(intersect0.entry, intersect1.entry); -vec4 exit = intersectionMin(intersect0.exit, intersect1.exit); -return RayShapeIntersection(entry, exit); +.cesium-credit-lightbox.cesium-credit-lightbox-expanded { + border: 1px solid #444; + border-radius: 5px; + max-width: 470px; } -struct Intersections { -vec4 intersections[INTERSECTION_COUNT * 2]; -#if (INTERSECTION_COUNT > 1) -int index; -int surroundCount; -bool surroundIsPositive; -#endif -}; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ -return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +.cesium-credit-lightbox.cesium-credit-lightbox-mobile { + height: 100%; + width: 100%; } -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); +.cesium-credit-lightbox-title { + padding: 20px 20px 0 20px; } -#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) { -const int sortPasses = INTERSECTION_COUNT * 2 - 1; -for (int n = sortPasses; n > 0; --n) { -for (int i = 0; i < sortPasses; ++i) { -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; +.cesium-credit-lightbox-close { + font-size: 18pt; + cursor: pointer; + position: absolute; + top: 0; + right: 6px; + color: ${wk}; } +.cesium-credit-lightbox-close:hover { + color: ${Mk}; } -ix.index = 0; -ix.surroundCount = 0; -ix.surroundIsPositive = false; +.cesium-credit-lightbox > ul { + margin: 0; + padding: 12px 20px 12px 40px; + font-size: 13px; } -#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; +.cesium-credit-lightbox > ul > li { + padding-bottom: 6px; } -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; +.cesium-credit-lightbox > ul > li * { + padding: 0; + margin: 0; } -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; -if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { -shapeIntersection.entry = surfaceIntersection; + +.cesium-credit-expand-link { + padding-left: 5px; + cursor: pointer; + text-decoration: underline; + color: ${wk}; } -bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; -bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; -if (exitPositive || enterNegativeFromPositive) { -shapeIntersection.exit = surfaceIntersection; -if (exitPositive) { -ix.index = passCount; +.cesium-credit-expand-link:hover { + color: ${Mk}; } -break; + +.cesium-credit-expand-link:focus-visible, +.cesium-credit-lightbox-close:focus-visible { + outline: 2px solid ${Mk}; + outline-offset: 2px; } + +.cesium-credit-text { + color: ${wk}; } -return shapeIntersection; + +.cesium-credit-delimiter { + padding: 0 5px; } -#endif -`;var uJi=_(T(),1),KA=`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) { -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 { -setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); + +.cesium-credit-textContainer *, +.cesium-credit-logoContainer * { + display: inline; } + +.cesium-credit-textContainer a:hover { + color: ${Mk} } -`;var fJi=_(T(),1),JA=`uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; -vec4 intersectPlane(in Ray ray, in vec4 plane) { -vec3 n = plane.xyz; -float w = plane.w; -float a = dot(ray.pos, n); -float b = dot(ray.dir, n); -float t = -(w + a) / b; -return vec4(n, t); + +.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { + padding-left: 5px; } -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) -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; +`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function jr(e,t,n){let i=this;n=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",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label","Data attribution"),o.appendChild(r);function s(y){r.contains(y.target)||i.hideLightbox()}o.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}o.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",r.appendChild(c);let d=document.createElement("a");d.onclick=this.hideLightbox.bind(this),d.onkeydown=$Fe(this.hideLightbox.bind(this)),d.innerHTML="×",d.className="cesium-credit-lightbox-close",d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-label","Close data attribution"),r.appendChild(d);let u=document.createElement("ul");r.appendChild(u);let m=document.createElement("div");m.className="cesium-credit-logoContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let b=document.createElement("a");b.className="cesium-credit-expand-link",b.onclick=this.showLightbox.bind(this),b.onkeydown=$Fe(this.showLightbox.bind(this)),b.textContent="Data attribution",b.setAttribute("role","button"),b.setAttribute("tabindex","0"),b.setAttribute("aria-haspopup","dialog"),b.setAttribute("aria-expanded","false"),e.appendChild(b),jFt(e);let f=Lt.clone(jr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=m,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=b,this._closeButton=d,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=f,this._previousCesiumCredit=void 0,this._currentCesiumCredit=f,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Mt,lightboxCredits:new Mt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function iIe(e,t,n,i){i=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 tIe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}jr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Lt.clone(oIe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,iIe(this,t,e)};jr.prototype.addStaticCredit=function(e){let t=this._staticCredits;HFt(t,e)||t.push(e)};jr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};jr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};jr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};jr.prototype.update=function(){this._expanded&&JFt(this)};jr.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()&&Lt.equals(jr.cesiumCredit,this._cesiumCredit)||iIe(this,s,r,Number.MAX_VALUE)}Lt.equals(jr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Lt.clone(jr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};jr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;qFe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",qFe(this._creditList,t,void 0,"li"),KFt(this)};jr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),me(this)};jr.prototype.isDestroyed=function(){return!1};jr._cesiumCredit=void 0;jr._cesiumCreditInitialized=!1;var _K;function oIe(){if(!l(_K)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new eIe.default(e).path()),_K=new Lt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return jr._cesiumCreditInitialized||(jr._cesiumCredit=_K,jr._cesiumCreditInitialized=!0),_K}Object.defineProperties(jr,{cesiumCredit:{get:function(){return oIe(),jr._cesiumCredit},set:function(e){jr._cesiumCredit=e,jr._cesiumCreditInitialized=!0}}});jr.CreditDisplayElement=tIe;var kk=jr;var hxo=x(T(),1);function Uk(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new lt({modelMatrix:P.clone(P.IDENTITY),owner:this,pass:Le.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t}Object.defineProperties(Uk.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});Uk.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r,panoramaCommandList:s}=e;if(!this.show||i!==se.SCENE3D&&i!==se.MORPHING||!o.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?oM(r,this._sources).then(function(d){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=d}).catch(d=>{this._hasError=!0,this._error=d}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new $r({context:r,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:we.POSITION_ONLY})),d=this._attributeLocations=zn.createAttributeLocations(c);a.vertexArray=Un.fromGeometry({context:r,geometry:c,attributeLocations:d,bufferUsage:Pe.STATIC_DRAW}),a.renderState=ze.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:on.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Je({defines:[t?"HDR":""],sources:[ZM]});a.shaderProgram=nn.fromCache({context:r,vertexShaderSource:l(this._transform)?pM:RM,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};Uk.prototype.isDestroyed=function(){return!1};Uk.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)};var lR=Uk;var yxo=x(T(),1);function Dk(e){e=e??B.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=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=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Go.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(Dk.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}}});Dk.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;Dk.prototype.isTranslucent=Go.prototype.isTranslucent;Dk.prototype.getRenderState=Go.prototype.getRenderState;var bse=Dk;var Nxo=x(T(),1);function SK(e){e=e??B.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??U.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var QFt=new h,qFt=new q,$Ft=new Ne,eIt=new qi,tIt=new hd,nIt=new yn,iIt=new bs,oIt=new U,rIt=[1,1e5];SK.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 qi?a=eIt:s instanceof hd?a=tIt:s instanceof yn?a=nIt:a=iIt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=rIt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,m=r.directionWC,p=r.upWC,b=r.rightWC;b=h.negate(b,QFt);let f=qFt;q.setColumn(f,0,b,f),q.setColumn(f,1,p,f),q.setColumn(f,2,m,f);let y=Ne.fromRotationMatrix(f,$Ft);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 Yt({geometry:new HZ({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(U.fromAlpha(this._color,.1,oIt))},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Yt({geometry:new UM({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};SK.prototype.isDestroyed=function(){return!1};SK.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 X0=SK;var Oxo=x(T(),1);function rIe(){this._cachedShowFrustumsShaders={}}function sIt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function aIt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Je.replaceMain(u,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.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=sIt(i);return nn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var Ok=new U;function cIt(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=U.fromRandom()),t._debugColor):U.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(Ok.red=t.debugOverlappingFrustums&1?1:0,Ok.green=t.debugOverlappingFrustums&2?1:0,Ok.blue=t.debugOverlappingFrustums&4?1:0,Ok.alpha=1,Ok):U.WHITE}),n}var lIt=new lt;rIe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=aIt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=lt.shallowClone(t,lIt);r.shaderProgram=o,r.uniformMap=cIt(e,t),r.execute(e.context,n)};var Bk=rIe;var iTo=x(T(),1);function ZK(e){e=e??B.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this.id=e.id,this._id=void 0,this._primitive=void 0}ZK.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!P.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=P.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 Yt({geometry:new Ig({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ms.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),n=new Yt({geometry:new Ig({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ms.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),i=new Yt({geometry:new Ig({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ms.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new Ms,asynchronous:!1})}this._primitive.update(e)}};ZK.prototype.isDestroyed=function(){return!1};ZK.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var zk=ZK;var sTo=x(T(),1);var dIt=new TextDecoder,RK={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},uIt={LAYERS:3},Hk={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},gse={TAGS:2,TYPE:3,GEOMETRY:4},dR={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},mIt=["Unknown","Point","LineString","Polygon"];function hIt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let o=CK(t,i,t.length),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===uIt.LAYERS&&s===2){let a=oy(t,i,t.length);i=a.newPos;let c=cu(i,a.value,t.length,"layer");n.push(fIt(t,i,c)),i=c}else i=VK(t,i,s,t.length)}return{layers:n}}function fIt(e,t,n){let i=t,o="",r=4096,s=[],a=[],c=[];for(;i<n;){let u=CK(e,i,n),m=u.fieldNumber,p=u.wireType;if(i=u.newPos,m===Hk.NAME&&p===2){let b=oy(e,i,n);i=b.newPos;let f=cu(i,b.value,n,"layer name");o=xse(e,i,b.value),i=f}else if(m===Hk.FEATURES&&p===2){let b=oy(e,i,n);i=b.newPos;let f=cu(i,b.value,n,"feature");c.push({start:i,end:f}),i=f}else if(m===Hk.KEYS&&p===2){let b=oy(e,i,n);i=b.newPos;let f=cu(i,b.value,n,"key");s.push(xse(e,i,b.value)),i=f}else if(m===Hk.VALUES&&p===2){let b=oy(e,i,n);i=b.newPos;let f=cu(i,b.value,n,"value"),y=gIt(e,i,f);a.push(y),i=f}else if(m===Hk.EXTENT&&p===0){let b=fA(e,i,n);r=b.value,i=b.newPos}else i=VK(e,i,p,n)}let d=c.map(({start:u,end:m})=>pIt(e,u,m,s,a));return{name:o,extent:r,features:d}}function pIt(e,t,n,i,o){let r=t,s=RK.UNKNOWN,a=[],c=[];for(;r<n;){let m=CK(e,r,n),p=m.fieldNumber,b=m.wireType;if(r=m.newPos,p===gse.TYPE&&b===0){let f=fA(e,r,n);s=f.value,r=f.newPos}else if(p===gse.TAGS&&b===2){let f=oy(e,r,n);r=f.newPos;let y=cu(r,f.value,n,"feature tags");for(;r<y;){let _=fA(e,r,y);a.push(_.value),r=_.newPos}}else if(p===gse.GEOMETRY&&b===2){let f=oy(e,r,n);r=f.newPos;let y=cu(r,f.value,n,"feature geometry");for(;r<y;){let _=fA(e,r,y);c.push(_.value),r=_.newPos}}else r=VK(e,r,b,n)}let d={};for(let m=0;m<a.length-1;m+=2){let p=i[a[m]],b=o[a[m+1]];typeof p!="string"||b===void 0||(d[p]=b)}let u=bIt(s,c);return{type:mIt[s]??"Unknown",geometry:u,properties:d}}function bIt(e,t){let n=0,i=0,o=0;if(e===RK.POINT){let r=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let d=0;d<c;d++)i+=N0(t[n++]),o+=N0(t[n++]),r.push({x:i,y:o})}return r}if(e===RK.LINESTRING){let r=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,d=a>>3;if(c===1)s!==null&&r.push(s),s=[],i+=N0(t[n++]),o+=N0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=N0(t[n++]),o+=N0(t[n++]),s.push({x:i,y:o})}return s!==null&&r.push(s),r}if(e===RK.POLYGON){let r=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,d=a>>3;if(c===1)s!==null&&r.push(s),s=[],i+=N0(t[n++]),o+=N0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=N0(t[n++]),o+=N0(t[n++]),s.push({x:i,y:o});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),r.push(s),s=null)}return s!==null&&r.push(s),r}return[]}function gIt(e,t,n){let i=t;for(;i<n;){let o=CK(e,i,n),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===dR.STRING&&s===2){let a=oy(e,i,n);i=a.newPos;let c=cu(i,a.value,n,"string value");return xse(e,i,c-i)}else{if(r===dR.FLOAT&&s===5)return cu(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(r===dR.DOUBLE&&s===1)return cu(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(r===dR.INT64&&s===0){let a=pA(e,i,n);return yse(a.value)}else if(r===dR.UINT64&&s===0){let a=pA(e,i,n);return yse(a.value)}else if(r===dR.SINT64&&s===0){let a=pA(e,i,n);return yse(yIt(a.value))}else if(r===dR.BOOL&&s===0)return fA(e,i,n).value!==0}i=VK(e,i,s,n)}}function CK(e,t,n){let i=fA(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function fA(e,t,n){let i=pA(e,t,n,5);if(i.value>0xffffffffn)throw new ae("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function oy(e,t,n){let i=pA(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new ae("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function pA(e,t,n,i){let o=0n,r=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new ae("Invalid MVT: truncated varint.");let c=e[t++];if(o|=BigInt(c&127)<<r,s++,(c&128)===0)break;if(s>=a)throw new ae("Invalid MVT: varint is too long.");r+=7n}return{value:o,newPos:t}}function xse(e,t,n){let i=cu(t,n,e.length,"string");return dIt.decode(e.subarray(t,i))}function cu(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new ae(`Invalid MVT ${i}: invalid length.`);let o=e+t;if(!Number.isFinite(o)||o<e||o>n)throw new ae(`Invalid MVT ${i}: length exceeds available bytes.`);return o}function VK(e,t,n,i){if(n===0)return pA(e,t,i).newPos;if(n===1)return cu(t,8,i,"fixed64 field");if(n===2){let o=oy(e,t,i);return cu(o.newPos,o.value,i,"length-delimited field")}else if(n===5)return cu(t,4,i,"fixed32 field");throw new ae(`Unsupported protobuf wire type: ${n}`)}function N0(e){return e>>>1^-(e&1)}function yIt(e){return e>>1n^-(e&1n)}function yse(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var Kk=hIt;var ATo=x(T(),1);function jk(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=e??0}var Jk=fn.supportsTypedArrays()?new Float32Array(12):[],sIe=new h,aIe=new h,Tse=new h,cIe=new h,EK=new h;function xIt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof yn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,sIe),b=h.normalize(p,aIe),f=h.normalize(h.cross(h.UNIT_Z,p,Tse),Tse),y=h.normalize(h.cross(b,f,cIe),cIe),_=h.magnitude(p),S=Math.sqrt(_*_-1);o=h.multiplyByScalar(b,1/_,sIe);let Z=S/_;r=h.multiplyByScalar(f,Z,aIe),s=h.multiplyByScalar(y,Z,Tse)}let a=h.add(o,s,EK);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,Jk,0);let c=h.subtract(o,s,EK);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,Jk,3);let d=h.add(o,s,EK);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,Jk,6);let u=h.subtract(o,s,EK);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,Jk,9),Jk}jk.prototype.update=function(e){if(this._mode=e.mode,e.mode!==se.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=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new lt({renderState:this._rs,boundingVolume:new de(h.ZERO,i.maximumRadius),pass:Le.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Je({sources:[gM]}),a=new Je({sources:[bM]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=nn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=xIt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new At({attributes:{position:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Ie.TRIANGLES});this._va=Un.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Pe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};jk.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};jk.prototype.isDestroyed=function(){return!1};jk.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Qk=jk;var NTo=x(T(),1);function uR(){}var TIt=/\bgl_FragDepth\b/,_It=/\bdiscard\b/;function SIt(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(TIt.test(r[a])||_It.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 Je({sources:[a]})}else if(!o&&s){let a=`void main() +{ + out_FragColor = vec4(1.0); + czm_writeLogDepth(); } -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; +`;i=new Je({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function ZIt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}uR.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=lt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=SIt(n,t.shaderProgram),i.depthOnlyCommand.renderState=ZIt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var RIt=/\s+czm_writeLogDepth\(/,CIt=/\s+czm_vertexLogDepth\(/;function VIt(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(CIt.test(c[u])){a=!0;break}if(!a){for(let m=0;m<c.length;++m)c[m]=Je.replaceMain(c[m],"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)RIt.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]=Je.replaceMain(c[u],"czm_log_depth_main");d=` +void main() +{ + czm_log_depth_main(); + czm_writeLogDepth(); } -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); +`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}uR.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=lt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=VIt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function EIt(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(b=>b.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,m=new Array(u+1);for(let b=0;b<u;++b)m[b]=Je.replaceMain(r[b],"czm_non_pick_main");m[u]=d;let p=new Je({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function _se(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}uR.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=lt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=EIt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=_se(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};var AIt=`uint rgba8UnormToUint32(vec4 c) +{ + uvec4 b = uvec4(c * 255.0 + 0.5); + return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); +`;function GIt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(b=>b.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`${AIt} +void main () +{ + czm_non_snap_main(); + if (${c}.a == 0.0) { + discard; + } + ${c} = ${n}; +} `,u=r.length,m=new Array(u+1);for(let b=0;b<u;++b)m[b]=Je.replaceMain(r[b],"czm_non_snap_main");m[u]=d;let p=new Je({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}uR.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.snapCommand?.shaderProgram,r=i.snapCommand?.renderState;return i.snapCommand=lt.shallowClone(t,i.snapCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=GIt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=_se(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=o,i.snapCommand.renderState=r),i};function bA(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 LIt(e){return e.isArray?e.arrayLength:St.getComponentCount(e.type)}function lIe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function dIe(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function WIt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=lIe(n,i,o)}return e.normalized||(n=dIe(n,e.componentType)),n}function vIt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=lIe(o,r,s)}return e.normalized||(o=dIe(o,e.componentType)),o}function FIt(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=d.getGlslType(),m=["0.0","0.0","0.0","0.0"],p=LIt(d);if(p===1)m[0]=WIt(d,c);else{let _=["x","y","z","w"];for(let S=0;S<p;S++)m[S]=vIt(d,c,_[S])}let b=t.fragmentShaderSource.defines.slice();b.push(Xu.METADATA_PICKING_ENABLED),bA(b,Xu.METADATA_PICKING_VALUE_TYPE,u),bA(b,Xu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),bA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_X,m[0]),bA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_Y,m[1]),bA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_Z,m[2]),bA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_W,m[3]);let f=new Je({sources:t.fragmentShaderSource.sources,defines:b});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}uR.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=lt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=FIt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=_se(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function IIt(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})}uR.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=lt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=IIt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var rp=uR;var OTo=x(T(),1);function AK(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 PIt=new Ne,uIe=new Ne,XIt=new q;function NIt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Ne.fromAxisAngle(o,n,uIe),c=Ne.fromAxisAngle(r,i,PIt),d=Ne.multiply(c,a,c),u=Ne.fromAxisAngle(s,t,uIe);Ne.multiply(u,d,d);let m=q.fromQuaternion(d,XIt);q.multiplyByVector(m,r,r),q.multiplyByVector(m,s,s),q.multiplyByVector(m,o,o)}AK.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;NIt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};AK.prototype.isDestroyed=function(){return!1};AK.prototype.destroy=function(){return this._removeListener(),me(this)};var qk=AK;var KTo=x(T(),1);function YIt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var Sse=YIt;var i_o=x(T(),1);function AT(){this._framebufferManager=new li({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(AT.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});AT.prototype.update=function(e,t,n,i,o){let r=t.width,s=t.height,a=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,s,1,a,Qe.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};AT.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};AT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};AT.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};AT.prototype.isDestroyed=function(){return!1};AT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,me(this)};var $k=AT;var E_o=x(T(),1);var Zse={position:0};function GK(e){e=e??B.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new de,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this._computedModelMatrix=new P,this.show=e.show??!0,this.material=e.material??eo.fromType(eo.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 lt({owner:e._owner??this}),this._pickCommand=new lt({owner: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 wIt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:we.POSITION_ONLY}));return t=Un.fromGeometry({context:e,geometry:n,attributeLocations:Zse,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}GK.prototype.update=function(e){if(!this.show||e.mode!==se.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=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?on.ALPHA_BLEND:void 0})),l(this._va)||(this._va=wIt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!P.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(P.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),P.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),de.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,m,p;(s||a||i||d)&&(m=new Je({sources:[BE]}),p=new Je({sources:[this.material.shaderSource,OE]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=nn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:Zse}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=It(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let b=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Le.TRANSLUCENT:Le.OPAQUE,b.push(u)),f.pick){let y=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)&&(m=new Je({sources:[BE]}),p=new Je({sources:[this.material.shaderSource,OE],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=nn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:Zse}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=It(It(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Le.TRANSLUCENT:Le.OPAQUE,b.push(y)}};GK.prototype.isDestroyed=function(){return!1};GK.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 e9=GK;var M_o=x(T(),1);var G_o=x(T(),1),t9=`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); +materialInput.normalEC = normalEC; +materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); +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 pJi=_(T(),1),xL=`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); +`;var W_o=x(T(),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; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) +`;function mR(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??n9,this._fragmentShaderSource=e.fragmentShaderSource??t9,this._renderState=Go.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(mR.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 mR.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});mR.VERTEX_FORMAT=we.POSITION_AND_ST;mR.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;mR.prototype.isTranslucent=Go.prototype.isTranslucent;mR.prototype.getRenderState=Go.prototype.getRenderState;var Rse=mR;var eSo=x(T(),1);var MIt=1e5;function i9(e){e=e??B.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._radius=l(e.radius)?e.radius:MIt,this._image=e.image,this._transform=l(e.transform)?e.transform:P.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new tk({radius:this._radius,vertexFormat:we.ALL}),i=new Yt({geometry:n,modelMatrix:this._transform}),o=new eo({fabric:{type:"Image",uniforms:{image:this._image,repeat:new k(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new In({geometryInstances:i,appearance:new Co({material:o,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(i9.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});i9.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};i9.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};i9.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var Cse=i9;var sSo=x(T(),1);function Vse(){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(Vse.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var kIt=new h;Vse.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!==se.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=h.normalize(n.positionWC,kIt),a=Math.abs(h.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 o9=Vse;var hSo=x(T(),1);function lu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??lu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??lu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??lu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??lu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??lu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new Se,this._nominalFrameRate=new Se,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){UIt(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(){DIt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}lu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};lu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new lu({scene:e})),e._frameRateMonitor};Object.defineProperties(lu.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}}});lu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};lu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};lu.prototype.isDestroyed=function(){return!1};lu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function UIt(e,t){if(e._pauseCount>0)return;let n=Zn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Mn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Mn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Mn.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 DIt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var r9=lu;var bSo=x(T(),1);function OIt(e,t){this.near=e??0,this.far=t??0;let n=Le.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 s9=OIt;var ISo=x(T(),1);var Ase=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=BIt(t.geoJson),i=t.allowPicking??!0,o=t.ellipsoid??ne.default,r=new Float64Array(0);function s(b){return r.length<b&&(r=new Float64Array(b)),r}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??He.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new Od({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new ml({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new Ya({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let d=new h,u=0,m=0,p=0;for(let b=0;b<n.features.length;b++){let f=n.features[b],y=f.featureId,_=this._properties[y];for(let S=0;S<f.points.length;S++){let Z=u++;this._points.add({featureId:y,position:gIe(f.points[S],o,d),pickObject:i?Ese(this,Z,this._points,Pc,_):void 0})}for(let S=0;S<f.polylines.length;S++){let Z=m++;this._polylines.add({featureId:y,positions:mIe(f.polylines[S],o,s),pickObject:i?Ese(this,Z,this._polylines,ga,_):void 0})}for(let S=0;S<f.polygons.length;S++){let Z=f.polygons[S],R=p++;this._polygons.add({featureId:y,positions:mIe(Z.positions,o,s),holes:Z.holes,triangles:Z.triangles,pickObject:i?Ese(this,R,this._polygons,Ir,_):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof ve?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=ve.createIfNeeded(t),o=await i.fetchJson();if(!l(o))throw new ae(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(o,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,o=this._polygons,r=t.frameNumber,s=this._heightReference,a=fs(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,r,s):i.update(t)),l(o)&&(l(a)?a.markForFrame(o,r,s):o.update(t))}destroy(){let t=fs(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),me(this)}isDestroyed(){return!1}};function Ese(e,t,n,i,o){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,o):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:o}}function BIt(e){let t=zIt(e),n=[],i=[],o=[],r=0,s=0,a=0,c=0,d=0,u=0,m=0;for(let p=0;p<t.length;p++){let b=t[p],f={points:[],polylines:[],polygons:[]};if(hIe(b.geometry,f),f.points.length===0&&f.polylines.length===0&&f.polygons.length===0)continue;let y=i.length;i.push(b.id),o.push(iPt(b.properties)?b.properties:B.EMPTY_OBJECT);for(let _=0;_<f.polygons.length;_++){let S=f.polygons[_];u+=S.holes.length,m+=S.triangles.length/3,d+=S.positions.length}for(let _=0;_<f.polylines.length;_++)a+=f.polylines[_].length;r+=f.points.length,s+=f.polylines.length,c+=f.polygons.length,n.push({featureId:y,points:f.points,polylines:f.polylines,polygons:f.polygons})}return{features:n,ids:i,properties:o,pointCount:r,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:d,polygonHoleCount:u,polygonTriangleCount:m}}function zIt(e){if(!l(e)||!l(e.type))throw new ae("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(tPt(e.type))return[{type:"Feature",geometry:e,properties:B.EMPTY_OBJECT,id:void 0}];throw new ae(`Unsupported GeoJSON type: ${e.type}`)}}function hIe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":fIe(e.coordinates,t.points);return;case"MultiPoint":KIt(e.coordinates,t.points);return;case"LineString":pIe(e.coordinates,t.polylines);return;case"MultiLineString":JIt(e.coordinates,t.polylines);return;case"Polygon":bIe(e.coordinates,t.polygons);return;case"MultiPolygon":jIt(e.coordinates,t.polygons);return;case"GeometryCollection":HIt(e.geometries,t);return;default:return}}function HIt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)hIe(e[n],t)}function fIe(e,t){let n=Gse(e);l(n)&&t.push(n)}function KIt(e,t){for(let n=0;n<e.length;n++)fIe(e[n],t)}function pIe(e,t){let n=QIt(e);l(n)&&n.length>=2&&t.push(n)}function JIt(e,t){for(let n=0;n<e.length;n++)pIe(e[n],t)}function bIe(e,t){let n=qIt(e);l(n)&&t.push(n)}function jIt(e,t){for(let n=0;n<e.length;n++)bIe(e[n],t)}function QIt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Gse(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function qIt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=$It(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],o=[],r=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&r.push(o.length);for(let d=0;d<c.length;d++){let u=c[d];o.push(u),i.push(new k(u[0],u[1]))}}}if(o.length<3)return;let s=mi.triangulate(i,r);if(!(!l(s)||s.length<3))return{positions:o,holes:new Uint32Array(r),triangles:new Uint32Array(s)}}function $It(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Gse(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&ePt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Gse(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function ePt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function tPt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function gIe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var nPt=new h;function mIe(e,t,n){let i=e.length*3,o=n(i);for(let r=0;r<e.length;r++){let s=gIe(e[r],t,nPt);o[r*3]=s.x,o[r*3+1]=s.y,o[r*3+2]=s.z}return o.subarray(0,i)}function iPt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Lse=Ase;var XSo=x(T(),1);function oPt(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 a9=oPt;var MSo=x(T(),1);var rPt=new k;function sPt(e,t){let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,rPt),s=r.x,a=r.y,c=o?lPt(s,a):dPt(s,a);return c+=` +`,c+=n?aPt(i):cPt(i),c}function aPt(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; + // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6 + break; + } + } + if (breakAndDiscard) { + discard; + } + return clipAmount; +} +`}function cPt(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 lPt(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) { -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); -} + int pixY = clippingPlaneNumber / ${e}; + int pixX = clippingPlaneNumber - (pixY * ${e}); + // Sample from center of pixel + 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); } -void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) +`}function dPt(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) { -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; -} + int clippingPlaneStartIndex = clippingPlaneNumber * 2; + int pixY = clippingPlaneStartIndex / ${e}; + int pixX = clippingPlaneStartIndex - (pixY * ${e}); + // Sample from center of pixel + 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); } -RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) +`}var hR=sPt;var DSo=x(T(),1);function uPt(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 c9=uPt;var zSo=x(T(),1);function mPt(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 l9=mPt;var _Co=x(T(),1);var tZo=x(T(),1);var Wse=class{constructor(t,n,i,o,r,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=o,this.clippingShaderState=r,this.clippingPolygonShaderState=s}},vse=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,o=t.numberOfDayTextures,r=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,d=t.applyGamma,u=t.applyAlpha,m=t.applyDayNightAlpha,p=t.applySplit,b=t.hasWaterMask,f=t.showReflectiveOcean,y=t.showOceanWaves,_=t.enableLighting,S=t.dynamicAtmosphereLighting,Z=t.dynamicAtmosphereLightingFromSun,R=t.showGroundAtmosphere,C=t.perFragmentGroundAtmosphere,E=t.hasVertexNormals,A=t.useWebMercatorProjection,L=t.enableFog,F=t.enableClippingPlanes,I=t.clippingPlanes,N=t.enableClippingPolygons,g=t.clippingPolygons,V=t.clippedByBoundaries,G=t.hasImageryLayerCutout,v=t.colorCorrect,X=t.highlightFillTile,Y=t.colorToAlpha,D=t.hasGeodeticSurfaceNormals,w=t.hasExaggeration,O=t.showUndergroundColor,M=t.translucent,z=i.vectorData,K=z?.show,te=K&&z.hasPolylines,H=K&&z.hasPolygons,$=K&&t.vectorAntialias,ee=te&&z.hasMeterWidths,le=ee&&z.hasPixelWidths,_e=0,he="",ye=i.renderedMesh.encoding;ye.quantization===Ka.BITS12&&(_e=1,he="QUANTIZATION_BITS12");let Ae=0,Fe="";V&&(Ae=1,Fe="TILE_LIMIT_RECTANGLE");let tt=0,Be="";G&&(tt=1,Be="APPLY_IMAGERY_CUTOUT");let je=n.mode,qe=((je|+r<<2|+s<<3|+a<<4|+c<<5|+d<<6|+u<<7|+b<<8|+f<<9|+y<<10|+_<<11|+S<<12|+Z<<13|+R<<14|+C<<15|+E<<16|+A<<17|+L<<18|_e<<19|+p<<20|+F<<21|+N<<22|Ae<<23|tt<<24|+v<<25|+X<<26|+Y<<27|+D<<28|+w<<29|+O<<30|+M<<31)>>>0)+(m?4294967296:0)+(K?8589934592:0)+(te?17179869184:0)+(H?34359738368:0)+($?68719476736:0)+(ee?137438953472:0)+(le?274877906944:0),We=0;l(I)&&I.length>0&&(We=F?I.clippingPlanesState:0);let Ke=0;l(g)&&g.length>0&&(Ke=N?g.clippingPolygonsState:0);let ct=i.surfaceShader;if(l(ct)&&ct.numberOfDayTextures===o&&ct.flags===qe&&ct.material===this.material&&ct.clippingShaderState===We&&ct.clippingPolygonShaderState===Ke)return ct.shaderProgram;let Et=this._shadersByTexturesFlags[o];if(l(Et)||(Et=this._shadersByTexturesFlags[o]=[]),ct=Et[qe],!l(ct)||ct.material!==this.material||ct.clippingShaderState!==We||ct.clippingPolygonShaderState!==Ke){let zt=this.baseVertexShaderSource.clone(),ut=this.baseFragmentShaderSource.clone();We!==0&&ut.sources.unshift(hR(I,n.context)),zt.defines.push(he),ut.defines.push(`TEXTURE_UNITS ${o}`,Fe,Be),r&&ut.defines.push("APPLY_BRIGHTNESS"),s&&ut.defines.push("APPLY_CONTRAST"),a&&ut.defines.push("APPLY_HUE"),c&&ut.defines.push("APPLY_SATURATION"),d&&ut.defines.push("APPLY_GAMMA"),u&&ut.defines.push("APPLY_ALPHA"),m&&ut.defines.push("APPLY_DAY_NIGHT_ALPHA"),b&&ut.defines.push("HAS_WATER_MASK"),f&&(ut.defines.push("SHOW_REFLECTIVE_OCEAN"),zt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&ut.defines.push("SHOW_OCEAN_WAVES"),Y&&ut.defines.push("APPLY_COLOR_TO_ALPHA"),O&&(zt.defines.push("UNDERGROUND_COLOR"),ut.defines.push("UNDERGROUND_COLOR")),M&&(zt.defines.push("TRANSLUCENT"),ut.defines.push("TRANSLUCENT")),_&&(E?(zt.defines.push("ENABLE_VERTEX_LIGHTING"),ut.defines.push("ENABLE_VERTEX_LIGHTING")):(zt.defines.push("ENABLE_DAYNIGHT_SHADING"),ut.defines.push("ENABLE_DAYNIGHT_SHADING"))),S&&(zt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),ut.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Z&&(zt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),ut.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),R&&(zt.defines.push("GROUND_ATMOSPHERE"),ut.defines.push("GROUND_ATMOSPHERE"),C&&(zt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),ut.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),zt.defines.push("INCLUDE_WEB_MERCATOR_Y"),ut.defines.push("INCLUDE_WEB_MERCATOR_Y"),L&&(zt.defines.push("FOG"),ut.defines.push("FOG")),p&&ut.defines.push("APPLY_SPLIT"),F&&ut.defines.push("ENABLE_CLIPPING_PLANES"),N&&(ut.defines.push("ENABLE_CLIPPING_POLYGONS"),g.inverse&&ut.defines.push("CLIPPING_INVERSE")),v&&ut.defines.push("COLOR_CORRECT"),X&&ut.defines.push("HIGHLIGHT_FILL_TILE"),D&&zt.defines.push("GEODETIC_SURFACE_NORMALS"),w&&zt.defines.push("EXAGGERATION"),K&&(ut.defines.push("HAS_VECTOR_LAYER"),te&&ut.defines.push("HAS_VECTOR_POLYLINES"),H&&ut.defines.push("HAS_VECTOR_POLYGONS"),$&&ut.defines.push("VECTOR_ANTIALIAS"),ee&&ut.defines.push("VECTOR_WIDTH_IN_METERS"),le&&ut.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(K||N)&&ut.sources.unshift(Db);let bt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + { + vec4 color = initialColor; +`;G&&(bt+=` vec4 cutoutAndColorResult; + bool texelUnclipped; +`);for(let jt=0;jt<o;++jt)G?bt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${jt}]; + texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; + cutoutAndColorResult = sampleAndBlend( +`:bt+=` color = sampleAndBlend( +`,bt+=` color, + u_dayTextures[${jt}], + u_dayTextureUseWebMercatorT[${jt}] ? textureCoordinates.xz : textureCoordinates.xy, + u_dayTextureTexCoordsRectangle[${jt}], + u_dayTextureTranslationAndScale[${jt}], + ${u?`u_dayTextureAlpha[${jt}]`:"1.0"}, + ${m?`u_dayTextureNightAlpha[${jt}]`:"1.0"}, + ${m?`u_dayTextureDayAlpha[${jt}]`:"1.0"}, + ${r?`u_dayTextureBrightness[${jt}]`:"0.0"}, + ${s?`u_dayTextureContrast[${jt}]`:"0.0"}, + ${a?`u_dayTextureHue[${jt}]`:"0.0"}, + ${c?`u_dayTextureSaturation[${jt}]`:"0.0"}, + ${d?`u_dayTextureOneOverGamma[${jt}]`:"0.0"}, + ${p?`u_dayTextureSplit[${jt}]`:"0.0"}, + ${Y?`u_colorsToAlpha[${jt}]`:"vec4(0.0)"}, + nightBlend); +`,G&&(bt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);bt+=` return color; + }`,ut.sources.push(bt),zt.sources.push(hPt(je)),zt.sources.push(fPt(A));let ht=nn.fromCache({context:n.context,vertexShaderSource:zt,fragmentShaderSource:ut,attributeLocations:ye.getAttributeLocations()});ct=Et[qe]=new Wse(o,qe,this.material,ht,We,Ke)}return i.surfaceShader=ct,ct.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let o in i)if(i.hasOwnProperty(o)){let r=i[o];if(!l(r))continue;for(t in r)r.hasOwnProperty(t)&&(n=r[t],l(n)&&n.shaderProgram.destroy())}return me(this)}};function hPt(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 se.SCENE3D:o=t;break;case se.SCENE2D:case se.COLUMBUS_VIEW:o=n;break;case se.MORPHING:o=i;break}return o}function fPt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var d9=vse;var o1o=x(T(),1);var vZo=x(T(),1);var iZo=x(T(),1),yIe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(yIe);var Qa=yIe;var rZo=x(T(),1),xIe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(xIe);var Mo=xIe;var Y0=class e{constructor(){mt(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Mo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new de,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===Mo.RECEIVING||t===Mo.TRANSFORMING),o=this.imagery;for(let r=0,s=o.length;i&&r<s;++r){let a=o[r];i=!l(a.loadingImagery)||a.loadingImagery.state!==Dn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,o,r){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,o,n,i);return h.clone(s,r)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Ts.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Wc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=Mo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,o){l(t.data)||(t.data=new e),t.state===Qa.START&&(pPt(t,n,i,o),t.state=Qa.LOADING)}static processStateMachine(t,n,i,o,r,s,a,c){e.initialize(t,i,o,r);let d=t.data;if(t.state===Qa.LOADING&&bPt(t,n,i,o,r,s,a),c)return;let u=t.renderable;t.renderable=l(d.vertexArray);let m=d.terrainState===Mo.READY;t.upsampledFromParent=l(d.terrainData)&&d.terrainData.wasCreatedByUpsampling();let p=d.processImagery(t,i,n);if(m&&p){let b=t._loadedCallbacks,f={};for(let y in b)b.hasOwnProperty(y)&&(b[y](t)||(f[y]=b[y]));t._loadedCallbacks=f,t.state=Qa.DONE}u&&(t.renderable=!0)}processImagery(t,n,i,o){let r=t.data,s=t.upsampledFromParent,a=!1,c=!0,d=r.imagery,u,m;for(u=0,m=d.length;u<m;++u){let p=d[u];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===Dn.PLACEHOLDER){let f=p.loadingImagery.imageryLayer;if(f.ready){p.freeResources(),d.splice(u,1),f._createTileImagerySkeletons(t,n,u),--u,m=d.length;continue}else s=!1}let b=p.processStateMachine(t,i,o);c=c&&b,a=a||b||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===Dn.FAILED||p.loadingImagery.state===Dn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){TIe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){TIe(this,!1,void 0,t)}updateExaggeration(t,n,i){let o=this,r=o.renderedMesh;if(r===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,d=r.encoding,u=d.exaggeration!==s,m=d.exaggerationRelativeHeight!==a;if(u||m){if(u)if(c&&!d.hasGeodeticSurfaceNormals){let b=t.tilingScheme.ellipsoid;o.addGeodeticSurfaceNormals(b,n)}else!c&&d.hasGeodeticSurfaceNormals&&o.removeGeodeticSurfaceNormals(n);if(d.exaggeration=s,d.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let b=t.customData;for(let f of b)f.level=-1}r.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,o=ot.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),r=n.encoding.getAttributes(o),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=ot.createIndexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new Un({context:t,attributes:r,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let o=n.rectangle,r=t.rectangle,s=r.width,a=r.height,c=s/o.width,d=a/o.height;return i.x=c*(r.west-o.west)/s,i.y=d*(r.south-o.south)/a,i.z=c,i.w=d,i}};function TIe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Cr.clone(s);c.hasGeodeticSurfaceNormals=t,c=Cr.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?(Y0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Y0._createVertexArrayForMesh(i.context,o)):(Y0._freeVertexArray(e.vertexArray),e.vertexArray=Y0._createVertexArrayForMesh(i.context,o)),Y0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function pPt(e,t,n,i){let o=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(o)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(o=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let r=e.data;o===!1&&(r.terrainState=Mo.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function bPt(e,t,n,i,o,r,s){let a=e.data,c=e.parent;if(a.terrainState===Mo.FAILED&&c!==void 0){let d=c.data;d!==void 0&&d.terrainData!==void 0&&d.terrainData.canUpsample!==!1||Y0.processStateMachine(c,t,n,i,o,r,s,!0)}if(a.terrainState===Mo.FAILED&&gPt(a,e,t,n,e.x,e.y,e.level),a.terrainState===Mo.UNLOADED&&yPt(a,n,e.x,e.y,e.level),a.terrainState===Mo.RECEIVED&&TPt(a,t,n,e.x,e.y,e.level),a.terrainState===Mo.TRANSFORMED&&(_Pt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,r)),a.terrainState>=Mo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)ZPt(t.context,a);else{let u=a._findAncestorTileWithTerrainData(e),m=u?.data;l(u)&&l(m.waterMaskTexture)&&(a.waterMaskTexture=m.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,u,a.waterMaskTranslationAndScale))}}function gPt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Qa.FAILED;return}let d=a.data.terrainData,u=a.x,m=a.y,p=a.level;if(!l(d))return;let b=d.upsample(i.tilingScheme,u,m,p,o,r,s);l(b)&&(e.terrainState=Mo.RECEIVING,Promise.resolve(b).then(function(f){l(f)&&(e.terrainData=f,e.terrainState=Mo.RECEIVED)}).catch(function(){e.terrainState=Mo.FAILED}))}function yPt(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===Ri.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=tr.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ar({throttle:!1,throttleByServer:!0,type:js.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 xPt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function TPt(e,t,n,i,o,r){let s=n.tilingScheme,a=xPt;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}))}function _Pt(e,t,n,i,o,r,s){e.vertexArray=Y0._createVertexArrayForMesh(t,e.mesh),e.terrainState=Mo.READY,e.fill=e.fill&&e.fill.destroy(s)}function SPt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=vt.create({context:e,pixelFormat:Qe.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:ei.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function ZPt(e,t){let n=t.terrainData.waterMask,i=SPt(e),o,r=n.length;if(n instanceof ImageBitmap)o=vt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=vt.create({context:e,pixelFormat:Qe.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ce.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var Zh=Y0;var iRo=x(T(),1);var PZo=x(T(),1),_Ie={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>=_Ie.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},pi=_Ie;function yA(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 ce}yA.prototype.update=function(e,t,n){this.changedThisFrame&&(AIe(e,t,this.tile,n),this.changedThisFrame=!1)};yA.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};yA.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Zh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var RPt=new sx;yA.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=RPt;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),m=c.findTileToEast(r),p=c.findTileToNorth(r);La(e,n,c,d,s,Gn.EAST,!1,a,i),La(e,n,c,u,s,Gn.NORTH,!1,a,i),La(e,n,c,m,s,Gn.WEST,!1,a,i),La(e,n,c,p,s,Gn.SOUTH,!1,a,i);let b=d.findTileToNorth(r),f=d.findTileToSouth(r),y=m.findTileToNorth(r),_=m.findTileToSouth(r);La(e,n,c,b,s,Gn.SOUTHEAST,!1,a,i),La(e,n,c,y,s,Gn.SOUTHWEST,!1,a,i),La(e,n,c,f,s,Gn.NORTHEAST,!1,a,i),La(e,n,c,_,s,Gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function La(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||pi.wasKicked(d._lastSelectionResult)||pi.originalResult(d._lastSelectionResult)===pi.CULLED);){if(s)return;let u=d.parent;if(r>=Gn.NORTHWEST&&u!==void 0)switch(r){case Gn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case Gn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case Gn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case Gn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===pi.RENDERED){if(l(d.data.vertexArray))return;CPt(e,t,n,d,r,o,a,c);return}if(pi.originalResult(i._lastSelectionResult)!==pi.CULLED)switch(r){case Gn.WEST:La(e,t,n,i.northwestChild,o,r,!0,a,c),La(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.EAST:La(e,t,n,i.southeastChild,o,r,!0,a,c),La(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTH:La(e,t,n,i.southwestChild,o,r,!0,a,c),La(e,t,n,i.southeastChild,o,r,!0,a,c);break;case Gn.NORTH:La(e,t,n,i.northeastChild,o,r,!0,a,c),La(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHWEST:La(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHEAST:La(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTHWEST:La(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.SOUTHEAST:La(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new ge("Invalid edge")}}}function CPt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new yA(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),VPt(e,t,n,i,o,a)}function VPt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(AIe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case Gn.WEST:d=s.westMeshes,u=s.westTiles;break;case Gn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case Gn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case Gn.NORTH:d=s.northMeshes,u=s.northTiles;break;case Gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case Gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case Gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case Gn.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 m,p,b,f,y=n.rectangle,_,S=i.rectangle;switch(o){case Gn.WEST:for(_=(S.north-S.south)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.greaterThan(y.north,f.south,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.greaterThanOrEquals(y.south,f.north,_));++p);break;case Gn.SOUTH:for(_=(S.east-S.west)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.lessThan(y.west,f.east,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.lessThanOrEquals(y.east,f.west,_));++p);break;case Gn.EAST:for(_=(S.north-S.south)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.lessThan(y.south,f.north,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.lessThanOrEquals(y.north,f.south,_));++p);break;case Gn.NORTH:for(_=(S.east-S.west)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.greaterThan(y.east,f.west,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.greaterThanOrEquals(y.west,f.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||d[m]!==a,d[m]=a,u[m]=n):(s.changedThisFrame=!0,d.splice(m,p-m,a),u.splice(m,p-m,n))}var fR=new pe,EPt=new pe,gA=new h,Xse=new h,Fse=new k,Ise=new k,um=new k;function XK(){this.height=0,this.encodedNormal=new k}function LK(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 m=e.tile.data.tileBoundingRegion,p=0,b=0;l(m)&&(p=m.minimumHeight,b=m.maximumHeight),d=(p+b)*.5}return GIe(e,t,n,i,d,c),c}var APt={minimumHeight:0,maximumHeight:0},GPt=new h,SIe=new XK,ZIe=new XK,RIe=new XK,CIe=new XK,LPt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,WPt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function AIe(e,t,n,i){Zh.initialize(n,e.terrainProvider,e.vectorProvider,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,m=vK(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,RIe),p=vK(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,SIe),b=vK(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,ZIe),f=vK(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,CIe);m=LK(r,u,0,1,m,p,f,b,RIe),p=LK(r,u,0,0,p,m,b,f,SIe),b=LK(r,u,1,1,b,p,f,m,ZIe),f=LK(r,u,1,1,f,b,m,p,CIe);let y=p.height,_=b.height,S=m.height,Z=f.height,R=Math.min(y,_,S,Z),C=Math.max(y,_,S,Z),E=(R+C)*.5,A,L,F=e.getLevelMaximumGeometricError(n.level),I=u.maximumRadius-F,N=Math.acos(I/u.maximumRadius)*4;if(N*=1.5,s.width>N&&C-R<=F){let G=new Mc({width:9,height:9,buffer:LPt,structure:{heightOffset:C}}),v=WPt;v.tilingScheme=n.tilingScheme,v.x=n.x,v.y=n.y,v.level=n.level,v.exaggeration=a,v.exaggerationRelativeHeight=c,r.mesh=G._createMeshSync(v)}else{let G=d,v=re.center(s,EPt);v.height=E;let X=u.cartographicToCartesian(v,GPt),Y=new Cr(X,void 0,void 0,void 0,void 0,!0,!0,G,a,c),D=5,w;for(w=r.westMeshes,A=0,L=w.length;A<L;++A)D+=w[A].eastIndicesNorthToSouth.length;for(w=r.southMeshes,A=0,L=w.length;A<L;++A)D+=w[A].northIndicesWestToEast.length;for(w=r.eastMeshes,A=0,L=w.length;A<L;++A)D+=w[A].westIndicesSouthToNorth.length;for(w=r.northMeshes,A=0,L=w.length;A<L;++A)D+=w[A].southIndicesEastToWest.length;let O=APt;O.minimumHeight=R,O.maximumHeight=C;let M=Y.stride,z=new Float32Array(D*M),K=0,te=K;K=WK(u,s,Y,z,K,0,1,m.height,m.encodedNormal,1,O),K=IK(r,u,Y,z,K,r.westTiles,r.westMeshes,Gn.EAST,O);let H=K;K=WK(u,s,Y,z,K,0,0,p.height,p.encodedNormal,0,O),K=IK(r,u,Y,z,K,r.southTiles,r.southMeshes,Gn.NORTH,O);let $=K;K=WK(u,s,Y,z,K,1,0,b.height,b.encodedNormal,0,O),K=IK(r,u,Y,z,K,r.eastTiles,r.eastMeshes,Gn.WEST,O);let ee=K;K=WK(u,s,Y,z,K,1,1,f.height,f.encodedNormal,1,O),K=IK(r,u,Y,z,K,r.northTiles,r.northMeshes,Gn.SOUTH,O),R=O.minimumHeight,C=O.maximumHeight;let le=tn.fromRectangle(s,R,C,n.tilingScheme.ellipsoid),_e=xi.geodeticLatitudeToMercatorAngle(s.south),he=1/(xi.geodeticLatitudeToMercatorAngle(s.north)-_e),Ze=(xi.geodeticLatitudeToMercatorAngle(v.latitude)-_e)*he,ye=u.geodeticSurfaceNormalCartographic(fR,Xse),Ge=dn.octEncode(ye,Fse),Ae=K;Y.encode(z,K*M,le.center,k.fromElements(.5,.5,um),E,Ge,Ze,ye),++K;let Fe=K,tt=Fe<256?1:2,Be=(Fe-1)*3,je=Be*tt,qe=(z.length-Fe*M)*Float32Array.BYTES_PER_ELEMENT,We;if(qe>=je){let bt=Fe*M*Float32Array.BYTES_PER_ELEMENT;We=Fe<256?new Uint8Array(z.buffer,bt,Be):new Uint16Array(z.buffer,bt,Be)}else We=Fe<256?new Uint8Array(Be):new Uint16Array(Be);z=new Float32Array(z.buffer,0,Fe*M);let Ke=0;for(A=0;A<Fe-2;++A)We[Ke++]=Ae,We[Ke++]=A,We[Ke++]=A+1;We[Ke++]=Ae,We[Ke++]=A,We[Ke]=0;let ct=[];for(A=H;A>=te;--A)ct.push(A);let Et=[];for(A=$;A>=H;--A)Et.push(A);let zt=[];for(A=ee;A>=$;--A)zt.push(A);let ut=[];for(ut.push(0),A=Ae-1;A>=ee;--A)ut.push(A);r.mesh=new yc(Y.center,z,We,Be,Fe,R,C,s,de.fromOrientedBoundingBox(le),YPt(e,le.center,s,R,C),Y.stride,le,Y,ct,Et,zt,ut)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=Zh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let V=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let G=o._findAncestorTileWithTerrainData(n);l(G)&&l(G.data.waterMaskTexture)&&(r.waterMaskTexture=G.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,G,r.waterMaskTranslationAndScale))}l(V)&&(--V.referenceCount,V.referenceCount===0&&V.destroy())}function WK(e,t,n,i,o,r,s,a,c,d,u){let m=fR;m.longitude=W.lerp(t.west,t.east,r),m.latitude=W.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,gA),b;n.hasGeodeticSurfaceNormals&&(b=e.geodeticSurfaceNormal(p,Xse));let f=Ise;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,b),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var PK=new re;function u9(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=re.clone(e.rectangle,PK),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=re.clone(e.rectangle,PK),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,m=(r.north-o.south)/d,p=(n.x-a)/(c-a),b=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(b)<Math.EPSILON5?b=0:Math.abs(b-1)<Math.EPSILON5&&(b=1),i.x=p,i.y=b,i}var vPt=new k;function Pse(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 FPt=new k,IPt=new h;function PPt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=u9(t,n,u.decodeTextureCoordinates(m,o,um),um),b=u9(t,n,u.decodeTextureCoordinates(m,r,Ise),Ise),f;c?f=(s-p.x)/(b.x-p.x):f=(a-p.y)/(b.y-p.y);let y=u.decodeHeight(m,o),_=u.decodeHeight(m,r),S=n.rectangle;fR.longitude=W.lerp(S.west,S.east,s),fR.latitude=W.lerp(S.south,S.north,a),d.height=fR.height=W.lerp(y,_,f);let Z;if(u.hasVertexNormals){let R=u.getOctEncodedNormal(m,o,vPt),C=u.getOctEncodedNormal(m,r,FPt),E=dn.octDecode(R.x,R.y,gA),A=dn.octDecode(C.x,C.y,IPt);Z=h.lerp(E,A,f,gA),h.normalize(Z,Z),dn.octEncode(Z,d.encodedNormal)}else Z=e.geodeticSurfaceNormalCartographic(fR,gA),dn.octEncode(Z,d.encodedNormal)}function GIe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(fR,gA);dn.octEncode(s,r.encodedNormal)}function vK(e,t,n,i,o,r,s,a,c,d,u){if(EIe(e,t,a,s,!1,n,i,u)||EIe(e,t,d,c,!0,n,i,u))return u;let p;if(Nse(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],Pse(r,p,n,i,u),u;let b;if(n===0?i===0?b=FK(e.westMeshes,e.westTiles,Gn.EAST,e.southMeshes,e.southTiles,Gn.NORTH,n,i):b=FK(e.northMeshes,e.northTiles,Gn.SOUTH,e.westMeshes,e.westTiles,Gn.EAST,n,i):i===0?b=FK(e.southMeshes,e.southTiles,Gn.NORTH,e.eastMeshes,e.eastTiles,Gn.WEST,n,i):b=FK(e.eastMeshes,e.eastTiles,Gn.WEST,e.northMeshes,e.northTiles,Gn.SOUTH,n,i),l(b))return GIe(e,t,n,i,b,u),u}function FK(e,t,n,i,o,r,s,a){let c=VIe(e,t,!1,n,s,a),d=VIe(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function IK(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=XPt(e,t,n,i,o,r[d],s[d],a,c);return o}function XPt(e,t,n,i,o,r,s,a,c){let d;a===Gn.EAST&&e.tile.x===0?(d=re.clone(r.rectangle,PK),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===Gn.WEST&&r.x===0&&(d=re.clone(r.rectangle,PK),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,um),m=um.x,p=um.y);let b,f;switch(a){case Gn.WEST:b=s.westIndicesSouthToNorth,f=!1;break;case Gn.NORTH:b=s.northIndicesWestToEast,f=!0;break;case Gn.EAST:b=s.eastIndicesNorthToSouth,f=!1;break;case Gn.SOUTH:b=s.southIndicesEastToWest,f=!0;break}let y=r,_=e.tile,S=s.encoding,Z=s.vertices,R=n.stride,C,E;S.hasWebMercatorT&&(C=xi.geodeticLatitudeToMercatorAngle(u.south),E=1/(xi.geodeticLatitudeToMercatorAngle(u.north)-C));for(let A=0;A<b.length;++A){let L=b[A],F=S.decodeTextureCoordinates(Z,L,um);u9(y,_,F,F);let I=F.x,N=F.y,g=f?I:N;if(g<0||g>1||Math.abs(I-m)<W.EPSILON5&&Math.abs(N-p)<W.EPSILON5)continue;let V=Math.abs(I)<W.EPSILON5||Math.abs(I-1)<W.EPSILON5,G=Math.abs(N)<W.EPSILON5||Math.abs(N-1)<W.EPSILON5;if(V&&G)continue;let v=S.decodePosition(Z,L,gA),X=S.decodeHeight(Z,L),Y;S.hasVertexNormals?Y=S.getOctEncodedNormal(Z,L,Fse):(Y=Fse,Y.x=0,Y.y=0);let D=N;if(S.hasWebMercatorT){let O=W.lerp(u.south,u.north,N);D=(xi.geodeticLatitudeToMercatorAngle(O)-C)*E}let w;n.hasGeodeticSurfaceNormals&&(w=t.geodeticSurfaceNormal(v,Xse)),n.encode(i,o*R,v,F,X,Y,D,w),c.minimumHeight=Math.min(c.minimumHeight,X),c.maximumHeight=Math.max(c.maximumHeight,X),++o}return o}function VIe(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],m=t[d];if(!Nse(m,u))continue;let p;switch(i){case Gn.WEST:p=u.westIndicesSouthToNorth;break;case Gn.SOUTH:p=u.southIndicesEastToWest;break;case Gn.EAST:p=u.eastIndicesNorthToSouth;break;case Gn.NORTH:p=u.northIndicesWestToEast;break}let b=p[n?0:p.length-1];if(l(b))return u.encoding.decodeHeight(u.vertices,b)}}function Nse(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function EIe(e,t,n,i,o,r,s,a){let c,d,u,m,p,b=i[o?0:n.length-1],f=n[o?0:n.length-1];if(Nse(b,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)){m=o?0:c.length-1,p=c[m],f.encoding.decodeTextureCoordinates(f.vertices,p,um);let y=u9(b,e.tile,um,um);if(y.x===r&&y.y===s)return Pse(f,p,r,s,a),!0;if(m=Eo(c,d?r:s,function(_,S){f.encoding.decodeTextureCoordinates(f.vertices,_,um);let Z=u9(b,e.tile,um,um);return u?d?Z.x-r:Z.y-s:d?r-Z.x:s-Z.y}),m<0){if(m=~m,m>0&&m<c.length)return PPt(t,b,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return Pse(f,c[m],r,s,a),!0}return!1}var NPt=[new h,new h,new h,new h];function YPt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=NPt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var xA=yA;var Yse=class e{constructor(t){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=vn.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=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Se,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Se,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new U(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=re.clone(re.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=se.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=ce.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){gs.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Wc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(r){r.data.imagery.sort(kPt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=MPt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(r=>{let s=r.data;l(s.vectorData)?s.vectorData=n.updateTileData(r.x,r.y,r.level,t.context,s.vectorData,He.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(r.x,r.y,r.level,t.context,He.CLAMP_TO_TERRAIN)}),n.makeClean(),BPt(this,t);let i=this._vertexArraysToDestroy,o=i.length;for(let r=0;r<o;++r)Zh._freeVertexArray(i[r]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let r=0,s=n.length;r<s;++r){let a=n[r];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let o=this._clippingPolygons;l(o)&&o.enabled&&o.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:rc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL},blending:on.ALPHA_BLEND});let c=$e(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(c),c=$e(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&xA.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight,r=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==o;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=o,r&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&UPt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,d=a.length;c<d;++c){let u=a[c];if(l(u))for(let m=0,p=u.length;m<p;++m){let b=u[m],f=b.data;DPt(this,b,f,t);let y=f.tileBoundingRegion;pXt(this,b,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,o=this._usedDrawCommands;i<o;++i){let r=n[i];r.dirty=!0,r.derivedCommands.picking=void 0;let s=r.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),IIe(r,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,o=!0,r;l(i)&&(o=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===pi.CULLED_BUT_NEEDED,r=i.terrainState),Zh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,o),i=n.data,o&&r!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Jr.NONE&&i.boundingVolumeSourceTile===n&&(o=!1,Zh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,o))}computeTileVisibility(t,n,i){let o=this.computeDistanceToTile(t,n);t._distance=o;let r=XIe(this,n);if(n.fog.enabled&&!r&&W.fog(o,n.fog.density)>=1)return Jr.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Jr.PARTIAL;let c=n.cullingVolume,d=a.boundingVolume;l(d)||(d=a.boundingSphere),s.clippedByBoundaries=!1;let u=YK(t.rectangle,this.cartographicLimitRectangle),m=re.simpleIntersection(u,t.rectangle,PIe);if(!l(m))return Jr.NONE;if(re.equals(m,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==se.SCENE3D&&(d=zPt,de.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center),n.mode===se.MORPHING&&l(s.renderedMesh)&&(d=de.union(a.boundingSphere,d,d))),!l(d))return Jr.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let S=p.computeIntersectionWithBoundingVolume(d);if(t.isClipped=S!==qt.INSIDE,S===qt.OUTSIDE)return Jr.NONE}let b=this._clippingPolygons;if(l(b)&&b.enabled){let S=b.computeIntersectionWithBoundingVolume(a);t.isClipped=S!==qt.OUTSIDE}let f,y=c.computeVisibility(d);if(y===qt.OUTSIDE?f=Jr.NONE:y===qt.INTERSECTING?f=Jr.PARTIAL:y===qt.INSIDE&&(f=Jr.FULL),f===Jr.NONE)return f;let _=n.mode===se.SCENE3D&&n.camera.frustum instanceof yn;if(n.mode===se.SCENE3D&&!_&&l(i)&&!r){let S=s.occludeePointInScaledSpace;return!l(S)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(S,a.minimumHeight)?f:Jr.NONE}return f}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=JPt;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 m=s[a],p=m.loadingImagery,b=!l(p)||p.state===Dn.FAILED||p.state===Dn.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=b&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=jPt;for(u.length=0,u.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);u.length>0;){let m=u.pop(),p=m._lastSelectionResultFrame===d?m._lastSelectionResult:pi.NONE;if(p===pi.RENDERED){let b=m.data;if(!l(b))continue;if(!o&&m.data.terrainState===Mo.READY)return!1;let f=m.data.imagery;for(a=0,c=f.length;a<c;++a){let y=f[a],_=y.loadingImagery,S=!l(_)||_.state===Dn.FAILED||_.state===Dn.INVALID,Z=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(S&&!i[Z])return!1}}else p===pi.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let o=i.tileBoundingRegion.boundingVolume;if(o===void 0)return 0;let r=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(o.center,r,QPt),c=h.magnitude(a);return c<W.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,o=t.data,r=o.imagery;for(let c=0,d=r.length;c<d;++c){let u=r[c];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){rXt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight;if(i.boundingVolumeSourceTile!==t){let d=n.camera.positionCartographic.height,u=Math.abs(d-s),m=Math.abs(d-a);u>m?(r.minimumHeight=s,r.maximumHeight=s):(r.minimumHeight=a,r.maximumHeight=a)}let c=r.distanceToCamera(n);return r.minimumHeight=s,r.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),me(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,o=this,r=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},o._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,d=a.data.imagery,u=d.length,m=-1,p=0;for(c=0;c<u;++c){let f=d[c];if((f.readyImagery??f.loadingImagery).imageryLayer===t)m===-1&&(m=c),++p;else if(m!==-1)break}if(m===-1)return;let b=m+p;t._createTileImagerySkeletons(a,i,b)&&(a._loadedCallbacks[t._layerIndex]=sXt(p,t,i),a.state=Qa.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=Qa.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==o.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==pi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let o=i.data.imagery,r=-1,s=0;for(let a=0,c=o.length;a<c;++a){let d=o[a],u=d.loadingImagery;if(l(u)||(u=d.readyImagery),u.imageryLayer===t)r===-1&&(r=a),d.freeResources(),++s;else if(r!==-1)break}r!==-1&&o.splice(r,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},wPt=new re;function MPt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,wPt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function kPt(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}function UPt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Wc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function DPt(e,t,n,i){let o=e._clippingPolygons;!l(o)||!o.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=o.requestRectangleData(t.rectangle,i.context))}function OPt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function BPt(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)}}function IIe(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)}var zPt=new de,PIe=new re,HPt=new re,KPt=new pe;function YK(e,t){if(t.west<t.east)return t;let n=re.clone(t,HPt);return re.center(e,KPt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function XIe(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||!re.equals(e.cartographicLimitRectangle,re.MAX_VALUE))}var JPt=[],jPt=[],QPt=new h,LIe=new P,NK=new P,qPt=new ce,$Pt=new ce,eXt=new ce,tXt=new h,WIe=new h,nXt=new h,iXt=new h,oXt=[new h,new h,new h,new h];function vIe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=oXt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}function rXt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Zh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new ku({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,m=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(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let b=p.data;if(b!==void 0){let f=b.mesh,y=b.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,b=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=_o.getHeight(r.minimumHeight,p,b),r.maximumHeight=_o.getHeight(r.maximumHeight,p,b)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=tn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=de.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=vIe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=vIe(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}function sXt(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=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?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}}var aXt=new P,cXt=new P;function FIe(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=P.multiplyByPoint(i,this.properties.rtc,WIe);return P.setTranslation(i,o,LIe),LIe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=P.multiplyByPoint(i,this.properties.rtc,WIe);return P.setTranslation(i,r,NK),P.multiply(o,NK,NK),NK},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)?P.multiply(e.context.uniformState.view,i.modelMatrix,aXt):P.IDENTITY;return P.inverseTranspose(o,cXt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},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},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new ce(0,0,.5,1),fillHighlightColor:new U(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new k(65e5,9e6),nightFadeDistance:new k(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new P,tileRectangle:new ce,verticalExaggerationAndRelativeHeight:new k(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new k,southMercatorYAndOneOverHeight:new k,waterMask:void 0,waterMaskTranslationAndScale:new ce,minMaxHeight:new k,scaleAndBias:new P,clippingPlanesEdgeColor:U.clone(U.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ce,frontFaceAlphaByDistance:new ce,backFaceAlphaByDistance:new ce,localizedTranslucencyRectangle:new ce,undergroundColor:U.clone(U.TRANSPARENT),undergroundColorAlphaByDistance:new ce,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new k,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?It(n,t.materialUniformMap):n}function lXt(e,t){let n=t.data,i,o;if(l(n.vertexArray)?(i=n.mesh,o=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,o=n.fill.vertexArray),!(!l(i)||!l(o))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=dXt(e,o,i),n.wireframeVertexArray.mesh=i}}function dXt(e,t,n){let o={indices:n.indices,primitiveType:Ie.TRIANGLES};zn.toWireframe(o);let r=o.indices,s=ot.createIndexBuffer({context:e,typedArray:r,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Un({context:e,attributes:t._attributes,indexBuffer:s})}var NIe,YIe,wK;(function(){let e=new Yt({geometry:Yh.fromDimensions({dimensions:new h(2,2,2)})}),t=new Yt({geometry:new mg({radius:1})}),n=new P,i,o;function r(s){return new In({geometryInstances:s,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}NIe=function(s,a){return s===i||(wK(),i=s,n=P.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=$t.fromColor(a),o=r(e)),o},YIe=function(s,a){return s===i||(wK(),i=s,n=P.fromTranslation(s.center,n),n=P.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=$t.fromColor(a),o=r(t)),o},wK=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var uXt=new ce(0,0,0,0),mXt={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,vectorAntialias:void 0},hXt=U.TRANSPARENT,fXt=new Kt;function pXt(e,t,n){let i=t.data;if(OPt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new xA(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let bt=r.credits;for(let ht=0,jt=bt.length;ht<jt;++ht)o.addCreditToNextFrame(bt[ht])}let s=kt.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,m=u.translucent,p=u.frontFaceAlphaByDistance,b=u.backFaceAlphaByDistance,f=u.rectangle,y=e.undergroundColor??hXt,_=e.undergroundColorAlphaByDistance??fXt,S=XIe(e,n)&&n.mode===se.SCENE3D&&y.alpha>0&&(_.nearValue>0||_.farValue>0),Z=e.lambertDiffuseMultiplier,R=e.vertexShadowDarkness,C=e.hasWaterMask&&l(a),E=C&&e.showWaterEffect,A=e.oceanNormalMap,L=E&&l(A),F=e.terrainProvider,I=l(F)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!d,g=e.showGroundAtmosphere&&n.mode===se.SCENE3D,V=vn.castShadows(e.shadows)&&!m,G=vn.receiveShadows(e.shadows)&&!m,v=e.hueShift,X=e.saturationShift,Y=e.brightnessShift,D=!(W.equalsEpsilon(v,0,W.EPSILON7)&&W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(Y,0,W.EPSILON7)),w=!1;if(g){let bt=h.magnitude(n.camera.positionWC),ht=e.nightFadeOutDistance;w=bt>ht}C&&--s,L&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=u.numberOfTextureUniforms;let O=i.renderedMesh,M=O.center,z=O.encoding,K=i.tileBoundingRegion,te=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,$=te!==1,ee=z.hasGeodeticSurfaceNormals,le=qPt,_e=0,he=0,Ze=0,ye=0,Ge=!1;if(n.mode!==se.SCENE3D){let bt=n.mapProjection,ht=bt.project(re.southwest(t.rectangle),nXt),jt=bt.project(re.northeast(t.rectangle),iXt);if(le.x=ht.x,le.y=ht.y,le.z=jt.x,le.w=jt.y,n.mode!==se.MORPHING&&(M=tXt,M.x=0,M.y=(le.z+le.x)*.5,M.z=(le.w+le.y)*.5,le.x-=M.y,le.y-=M.z,le.z-=M.y,le.w-=M.z),n.mode===se.SCENE2D&&z.quantization===Ka.BITS12){let st=1/(Math.pow(2,12)-1)*.5,pt=(le.z-le.x)*st,wi=(le.w-le.y)*st;le.x-=pt,le.y-=wi,le.z+=pt,le.w+=wi}bt instanceof xi&&(_e=t.rectangle.south,he=t.rectangle.north,Ze=xi.geodeticLatitudeToMercatorAngle(_e),ye=1/(xi.geodeticLatitudeToMercatorAngle(he)-Ze),Ge=!0)}let Ae=mXt;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=C,Ae.showReflectiveOcean=E,Ae.showOceanWaves=L,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=g,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=w,Ae.hasVertexNormals=I,Ae.useWebMercatorProjection=Ge,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=ee,Ae.hasExaggeration=$,Ae.vectorAntialias=e.vectorProvider.antialias;let Fe=i.imagery,tt=0,Be=Fe.length,je=e.showSkirts&&!d&&!m,qe=e.backFaceCulling&&!d&&!m,We=qe?e._renderState:e._disableCullingRenderState,Ke=qe?e._blendRenderState:e._disableCullingBlendRenderState,ct=We,Et=e._firstPassInitialColor,zt=n.context;if(l(e._debug.boundingSphereTile)||wK(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let ht=0;ht<bt;++ht)e._uniformMaps[ht]=FIe(n,e)}do{let bt=0,ht,jt;if(e._drawCommands.length<=e._usedDrawCommands?(ht=new lt,ht.owner=t,ht.cull=!1,ht.boundingVolume=new de,ht.orientedBoundingBox=void 0,jt=FIe(n,e),e._drawCommands.push(ht),e._uniformMaps.push(jt)):(ht=e._drawCommands[e._usedDrawCommands],jt=e._uniformMaps[e._usedDrawCommands]),ht.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ps=K.boundingVolume,$a=K.boundingSphere;l(Ps)?NIe(Ps,U.RED).update(n):l($a)&&YIe($a,U.RED).update(n)}let st=jt.properties;ce.clone(Et,st.initialColor),st.oceanNormalMap=A,st.lightingFadeDistance.x=e.lightingFadeOutDistance,st.lightingFadeDistance.y=e.lightingFadeInDistance,st.nightFadeDistance.x=e.nightFadeOutDistance,st.nightFadeDistance.y=e.nightFadeInDistance,st.atmosphereLightIntensity=e.atmosphereLightIntensity,st.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,st.atmosphereMieCoefficient=e.atmosphereMieCoefficient,st.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,st.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,st.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,st.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let pt=d?b:p,wi=d?p:b;l(pt)&&(ce.fromElements(pt.near,pt.nearValue,pt.far,pt.farValue,st.frontFaceAlphaByDistance),ce.fromElements(wi.near,wi.nearValue,wi.far,wi.farValue,st.backFaceAlphaByDistance)),ce.fromElements(_.near,_.nearValue,_.far,_.farValue,st.undergroundColorAlphaByDistance),U.clone(y,st.undergroundColor),st.lambertDiffuseMultiplier=Z,st.vertexShadowDarkness=R;let jn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;jn&&U.clone(e.fillHighlightColor,st.fillHighlightColor),st.verticalExaggerationAndRelativeHeight.x=te,st.verticalExaggerationAndRelativeHeight.y=H,st.center3D=O.center,h.clone(M,st.rtc),ce.clone(le,st.tileRectangle),st.southAndNorthLatitude.x=_e,st.southAndNorthLatitude.y=he,st.southMercatorYAndOneOverHeight.x=Ze,st.southMercatorYAndOneOverHeight.y=ye;let _i=$Pt,Hi=YK(t.rectangle,e.cartographicLimitRectangle),Gi=eXt,fi=YK(t.rectangle,f);h.fromElements(v,X,Y,st.hsbShift);let Si=t.rectangle,On=1/Si.width,rn=1/Si.height;_i.x=(Hi.west-Si.west)*On,_i.y=(Hi.south-Si.south)*rn,_i.z=(Hi.east-Si.west)*On,_i.w=(Hi.north-Si.south)*rn,ce.clone(_i,st.localizedCartographicLimitRectangle),Gi.x=(fi.west-Si.west)*On,Gi.y=(fi.south-Si.south)*rn,Gi.z=(fi.east-Si.west)*On,Gi.w=(fi.north-Si.south)*rn,ce.clone(Gi,st.localizedTranslucencyRectangle);let Hn=N&&W.fog(t._distance,n.fog.density)>W.EPSILON3;D=D&&(Hn||g);let $i=!1,Po=!1,hr=!1,Is=!1,Hs=!1,or=!1,bi=!1,fr=!1,mo=!1,Qr=!1;for(;bt<s&&tt<Be;){let Ps=Fe[tt],$a=Ps.readyImagery;if(++tt,!l($a)||$a.imageryLayer.alpha===0)continue;let DT=Ps.useWebMercatorT?$a.textureWebMercator:$a.texture,si=$a.imageryLayer;l(Ps.textureTranslationAndScale)||(Ps.textureTranslationAndScale=si._calculateTextureTranslationAndScale(t,Ps)),st.dayTextures[bt]=DT,st.dayTextureTranslationAndScale[bt]=Ps.textureTranslationAndScale,st.dayTextureTexCoordsRectangle[bt]=Ps.textureCoordinateRectangle,st.dayTextureUseWebMercatorT[bt]=Ps.useWebMercatorT,st.dayTextureAlpha[bt]=si.alpha,or=or||st.dayTextureAlpha[bt]!==1,st.dayTextureNightAlpha[bt]=si.nightAlpha,bi=bi||st.dayTextureNightAlpha[bt]!==1,st.dayTextureDayAlpha[bt]=si.dayAlpha,bi=bi||st.dayTextureDayAlpha[bt]!==1,st.dayTextureBrightness[bt]=si.brightness,$i=$i||st.dayTextureBrightness[bt]!==Zs.DEFAULT_BRIGHTNESS,st.dayTextureContrast[bt]=si.contrast,Po=Po||st.dayTextureContrast[bt]!==Zs.DEFAULT_CONTRAST,st.dayTextureHue[bt]=si.hue,hr=hr||st.dayTextureHue[bt]!==Zs.DEFAULT_HUE,st.dayTextureSaturation[bt]=si.saturation,Is=Is||st.dayTextureSaturation[bt]!==Zs.DEFAULT_SATURATION,st.dayTextureOneOverGamma[bt]=1/si.gamma,Hs=Hs||st.dayTextureOneOverGamma[bt]!==1/Zs.DEFAULT_GAMMA,st.dayTextureSplit[bt]=si.splitDirection,fr=fr||st.dayTextureSplit[bt]!==0;let qo=st.dayTextureCutoutRectangles[bt];if(l(qo)||(qo=st.dayTextureCutoutRectangles[bt]=new ce),ce.clone(ce.ZERO,qo),l(si.cutoutRectangle)){let va=YK(Si,si.cutoutRectangle),yp=re.simpleIntersection(va,Si,PIe);mo=l(yp)||mo,qo.x=(va.west-Si.west)*On,qo.y=(va.south-Si.south)*rn,qo.z=(va.east-Si.west)*On,qo.w=(va.north-Si.south)*rn}let Gl=st.colorsToAlpha[bt];l(Gl)||(Gl=st.colorsToAlpha[bt]=new ce);let K0=l(si.colorToAlpha)&&si.colorToAlphaThreshold>0;if(Qr=Qr||K0,K0){let va=si.colorToAlpha;Gl.x=va.red,Gl.y=va.green,Gl.z=va.blue,Gl.w=si.colorToAlphaThreshold}else Gl.w=-1;if(l($a.credits)){let va=$a.credits;for(let yp=0,xy=va.length;yp<xy;++yp)o.addCreditToNextFrame(va[yp])}++bt}st.dayTextures.length=bt,st.waterMask=a,ce.clone(c,st.waterMaskTranslationAndScale),st.minMaxHeight.x=z.minimumHeight,st.minMaxHeight.y=z.maximumHeight,P.clone(z.matrix,st.scaleAndBias);let wn=e._clippingPlanes,Ki=l(wn)&&wn.enabled&&t.isClipped;Ki&&(st.clippingPlanesEdgeColor=U.clone(wn.edgeColor,st.clippingPlanesEdgeColor),st.clippingPlanesEdgeWidth=wn.edgeWidth);let Mi=i.vectorData;l(Mi)&&(st.vectorSegmentTexture=Mi.polylineSegmentTexture,st.vectorWidthTexture=Mi.widthTexture,st.vectorColorTexture=Mi.colorTexture,st.vectorPickColorTexture=Mi.pickColorTexture,st.vectorSegmentPrimitiveIndicesTexture=Mi.polylineSegmentPrimitiveIndicesTexture,st.vectorGridCellIndicesTexture=Mi.polylineGridCellIndicesTexture,st.vectorPolygonEdgeTexture=Mi.polygonEdgeTexture,st.vectorPolygonEdgePrimitiveIndicesTexture=Mi.polygonEdgePrimitiveIndicesTexture,st.vectorPolygonGridCellIndicesTexture=Mi.polygonGridCellIndicesTexture,k.clone(Mi.metersPerUv,st.vectorMetersPerUv));let Xo=i.clippingPolygonData;l(Xo)&&(st.clippingEdgeTexture=Xo.polygonEdgeTexture,st.clippingEdgePrimitiveIndicesTexture=Xo.polygonEdgePrimitiveIndicesTexture,st.clippingGridCellIndicesTexture=Xo.polygonGridCellIndicesTexture);let Dc=e._clippingPolygons,bm=(Xo?.polygonRings.length??0)>0,bp=l(Dc)&&Dc.enabled&&Dc.length>0&&t.isClipped&&bm;Ae.numberOfDayTextures=bt,Ae.applyBrightness=$i,Ae.applyContrast=Po,Ae.applyHue=hr,Ae.applySaturation=Is,Ae.applyGamma=Hs,Ae.applyAlpha=or,Ae.applyDayNightAlpha=bi,Ae.applySplit=fr,Ae.enableFog=Hn,Ae.enableClippingPlanes=Ki,Ae.clippingPlanes=wn,Ae.enableClippingPolygons=bp,Ae.clippingPolygons=Dc,Ae.hasImageryLayerCutout=mo,Ae.colorCorrect=D,Ae.highlightFillTile=jn,Ae.colorToAlpha=Qr,Ae.showUndergroundColor=S,Ae.translucent=m;let Lh=i.renderedMesh.indices.length;je||(Lh=i.renderedMesh.indexCountWithoutSkirts),ht.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),ht.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ht.castShadows=V,ht.receiveShadows=G,ht.renderState=ct,ht.primitiveType=Ie.TRIANGLES,ht.vertexArray=i.vertexArray||i.fill.vertexArray,ht.count=Lh,ht.uniformMap=jt,ht.pass=Le.GLOBE,e._debug.wireframe&&(lXt(zt,t),l(i.wireframeVertexArray)&&(ht.vertexArray=i.wireframeVertexArray,ht.primitiveType=Ie.LINES,ht.count=Lh*2));let ua=ht.boundingVolume,gp=ht.orientedBoundingBox;n.mode!==se.SCENE3D?(de.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,K.minimumHeight,K.maximumHeight,ua),h.fromElements(ua.center.z,ua.center.x,ua.center.y,ua.center),n.mode===se.MORPHING&&de.union(K.boundingSphere,ua,ua)):(ht.boundingVolume=de.clone(K.boundingSphere,ua),ht.orientedBoundingBox=tn.clone(K.boundingVolume,gp)),ht.dirty=!0,m&&u.updateDerivedCommands(ht,n),IIe(ht,n),ct=Ke,Et=uXt}while(tt<Be)}var m9=Yse;var l1o=x(T(),1);function wIe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=re.clone(re.MAX_VALUE)}Object.defineProperties(wIe.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=re.clone(re.MAX_VALUE)),re.clone(e,this._rectangle)}}});var h9=wIe;var D1o=x(T(),1);var h1o=x(T(),1);var wse=class{constructor(t){this._ellipsoid=new Af(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},f9=wse;var T1o=x(T(),1);var Mse=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},bXt=1e3,kse=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.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=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=pi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new Mse(bXt),this.state=Qa.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),o=new Array(n*i),r=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)o[r++]=new e({tilingScheme:t,x:a,y:s,level:0});return o}_getCacheKey(t,n){return yXt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let o=0;o<t.length;++o){let r=t[o];i.add(r),MIe(this,r.positionCartographic)._addedCustomData.push(r)}this._addedCustomData.length=0;for(let o=0;o<n.length;++o){let r=n[o];i.has(r)&&i.delete(r),MIe(this,r.positionCartographic)._removedCustomData.push(r)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<Qa.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let o=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=o:n>=o&&(n-=o),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(r){return r.x===n&&r.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=Qa.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),MK(this._southwestChild),this._southwestChild=void 0,MK(this._southeastChild),this._southeastChild=void 0,MK(this._northwestChild),this._northwestChild=void 0,MK(this._northeastChild),this._northeastChild=void 0}},gXt=256;function yXt(e,t,n,i){let o=n.width/gXt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}var xXt=new pe;function MIe(e,t){let n=e.northwestChild.rectangle,i=re.southeast(n,xXt),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function MK(e){l(e)&&e.freeResources()}var p9=kse;var Z1o=x(T(),1);function kK(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}kK.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};kK.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(),kIe(this,t)),t=i}};function kIe(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}kK.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))&&kIe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var b9=kK;function Rh(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._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new b9,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new f9({ellipsoid:n}),this._tileLoadProgressEvent=new Se,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Rh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Rh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function TXt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,DIe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let s of r)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Rh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Qa.START&&e(t),t=t.replacementNext};Rh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Rh.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,s=!1;for(let a=0;a<r;++a)if(o[a]===i){o.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Rh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function DIe(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}Rh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(TXt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),DIe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Rh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),RXt(this,e),IXt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function _Xt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=Se.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))}Rh.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||(LXt(this,e),FXt(this,e),_Xt(this,e))};Rh.prototype.isDestroyed=function(){return!1};Rh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var y9,UIe=new pe;function SXt(e,t){let n=re.center(e.rectangle,UIe),i=n.longitude-y9.longitude,o=n.latitude-y9.latitude;n=re.center(t.rectangle,UIe);let r=n.longitude-y9.longitude,s=n.latitude-y9.latitude;return i*i+o*o-(r*r+s*s)}var ZXt=new h,g9=[];function RXt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let m=o.tilingScheme;if(l(m)){let p=o.tilingScheme;e._levelZeroTiles=p9.createLevelZeroTiles(p);let b=e._levelZeroTiles.length;if(g9.length<b){g9=new Array(b);for(let f=0;f<b;++f)g9[f]===void 0&&(g9[f]=new x9)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;y9=t.camera.positionCartographic,r.sort(SXt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(m=>{let p=r.find(b=>re.contains(b.rectangle,m.positionCartographic));p&&p._addedCustomData.push(m)}),c.forEach(m=>{let p=r.find(b=>re.contains(b.rectangle,m.positionCartographic));p&&p._removedCustomData.push(m)}),r.forEach(m=>m.updateCustomData()),a.length=0,c.length=0;let d=t.camera;e._cameraPositionCartographic=d.positionCartographic;let u=P.getTranslation(d.transform,ZXt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(u,e._cameraReferenceFrameOriginCartographic);for(let m=0;m<r.length;++m){let p=r[m];e._tileReplacementQueue.markTileRendered(p),p.renderable?Uc(e,p,o,t,s,!1,g9[m]):(ry(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function ry(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function x9(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function OIe(){this.southwest=new x9,this.southeast=new x9,this.northwest=new x9,this.northeast=new x9}OIe.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 Dse=new Array(31);for(let e=0;e<Dse.length;++e)Dse[e]=new OIe;function CXt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=AXt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:pi.NONE,b=e.tileProvider;if(s||i){let f=pi.originalResult(p)===pi.RENDERED,y=pi.originalResult(p)===pi.CULLED||p===pi.NONE,_=n.state===Qa.DONE,S=f||y||_;if(S||l(b.canRenderWithoutLosingDetail)&&(S=b.canRenderWithoutLosingDetail(n)),S){s&&ry(e,e._tileLoadQueueMedium,n,t),UK(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===pi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&ry(e,e._tileLoadQueueHigh,n,t)}if(b.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){UK(e,n),ry(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===pi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.REFINED;let y=e._tilesToRender.length,_=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,Z=e._tileLoadQueueHigh.length,R=e._tileToUpdateHeights.length;if(VXt(e,a,c,d,u,t,i,o),y!==e._tilesToRender.length){let C=o.allAreRenderable,E=o.anyWereRenderedLastFrame,A=o.notYetRenderableCount,L=!1;if(!C&&!E){let F=e._tilesToRender;for(let N=y;N<F.length;++N){let g=F[N];for(;g!==void 0&&g._lastSelectionResult!==pi.KICKED&&g!==n;)g._lastSelectionResult=pi.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=R,UK(e,n),n._lastSelectionResult=pi.RENDERED;let I=p===pi.RENDERED;!I&&A>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=Z,ry(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,L=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=I,I||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!L&&ry(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,UK(e,n),ry(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===pi.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function VXt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=Dse[t.level],p=m.southwest,b=m.southeast,f=m.northwest,y=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Uc(e,t,d,r,u,s,p),Uc(e,n,d,r,u,s,b),Uc(e,i,d,r,u,s,f),Uc(e,o,d,r,u,s,y)):(Uc(e,i,d,r,u,s,f),Uc(e,t,d,r,u,s,p),Uc(e,o,d,r,u,s,y),Uc(e,n,d,r,u,s,b)):c.latitude<t.rectangle.north?(Uc(e,n,d,r,u,s,b),Uc(e,t,d,r,u,s,p),Uc(e,o,d,r,u,s,y),Uc(e,i,d,r,u,s,f)):(Uc(e,o,d,r,u,s,y),Uc(e,i,d,r,u,s,f),Uc(e,n,d,r,u,s,b),Uc(e,t,d,r,u,s,p)),m.combine(a)}function EXt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&re.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&re.contains(n,e._cameraReferenceFrameOriginCartographic)}function Uc(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Jr.NONE)return CXt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,EXt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&ry(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:pi.NONE;c!==pi.CULLED_BUT_NEEDED&&c!==pi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=pi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(ry(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=pi.CULLED):t._lastSelectionResult=pi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function AXt(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof yn||t.camera.frustum instanceof bs)return GXt(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 GXt(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),m=d/u;return t.fog.enabled&&t.mode!==se.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function UK(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function LXt(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=Zn()+e._loadQueueTimeSlice,s=e._tileProvider,a=Use(e,t,s,r,n,!1);a=Use(e,t,s,r,i,a),Use(e,t,s,r,o,a)}function WXt(e,t){return e._loadPriority-t._loadPriority}function Use(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(WXt);for(let s=0,a=o.length;s<a&&(Zn()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var TA=new gn,DK=new pe,GT=new h,vXt=[];function FXt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=vXt;n.length=0;let i=e._tileToUpdateHeights,o=Zn(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let m=i[0];if(!l(m.data)||!l(m.data.mesh)){let _=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:pi.NONE;(_===pi.RENDERED||_===pi.CULLED_BUT_NEEDED)&&n.push(m),m.clearPositionCache(),i.shift();continue}let p=m.customData;l(m._customDataIterator)||(m._customDataIterator=p.values());let b=m._customDataIterator,f=!1,y;for(;!(y=b.next()).done;){let _=y.value,S=m.data.terrainData,Z=l(S)&&S.wasCreatedByUpsampling();if(m.level>_.level&&!Z){let R,C=m.getPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError);if(l(C))R=C;else{if(l(_.positionOnEllipsoidSurface)||(_.positionOnEllipsoidSurface=h.fromRadians(_.positionCartographic.longitude,_.positionCartographic.latitude,0,d)),a===se.SCENE3D){let E=d.geodeticSurfaceNormal(_.positionOnEllipsoidSurface,TA.direction),A=d.getSurfaceNormalIntersectionWithZAxis(_.positionOnEllipsoidSurface,11500,TA.origin);if(!l(A)){let L=0;l(m.data.tileBoundingRegion)&&(L=m.data.tileBoundingRegion.minimumHeight);let F=Math.min(L,-11500),I=h.multiplyByScalar(E,Math.abs(F)+1,GT);h.subtract(_.positionOnEllipsoidSurface,I,TA.origin)}}else pe.clone(_.positionCartographic,DK),DK.height=-11500,c.project(DK,GT),h.fromElements(GT.z,GT.x,GT.y,GT),h.clone(GT,TA.origin),h.clone(h.UNIT_X,TA.direction);R=m.data.pick(TA,a,c,!1,GT),l(R)&&m.setPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError,h.clone(R))}if(l(R)){if(l(_.callback)){let E=d.cartesianToCartographic(R,DK);_.callback(E)}_.level=m.level}}if(Zn()>=s){f=!0;break}}if(f){m._customDataIterator=b;break}else m._customDataIterator=void 0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function IXt(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 T9=Rh;function sp(e){e=e??ne.default;let t=new G0({ellipsoid:e}),n=new kS,i=new rg({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new d9,this._material=void 0,this._surface=new T9({tileProvider:new m9({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new Se,this._vectorProvider=i,this._undergroundColor=U.clone(U.BLACK),this._undergroundColorAlphaByDistance=new Kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new h9,Bse(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new ve({url:en("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 h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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=vn.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(sp.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=re.clone(re.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,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&Bse(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Bse(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=U.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 Bse(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[rf,zE];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(xM),e._surfaceShaderSet.baseVertexShaderSource=new Je({sources:[rf,zE,TM],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Je({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function PXt(e){return function(t,n){let i=de.distanceSquaredTo(t.pickBoundingSphere,e),o=de.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var XXt=[],NXt={start:0,stop:0};sp.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=XXt;s.length=0;for(let d of this._surface._tilesRenderedThisFrame){let u=d.data;if(!l(u))continue;let m=u.pickBoundingSphere;if(o!==se.SCENE3D)u.pickBoundingSphere=m=de.fromRectangleWithHeights2D(d.rectangle,r,u.tileBoundingRegion.minimumHeight,u.tileBoundingRegion.maximumHeight,m),h.fromElements(m.center.z,m.center.x,m.center.y,m.center);else if(l(u.renderedMesh))de.clone(u.tileBoundingRegion.boundingSphere,m);else continue;let p=yi.raySphere(e,m,NXt);l(p)&&s.push(u)}s.sort(PXt(e.origin));let a,c=s.length;for(let d=0;d<c&&(a=s[d].pick(e,t.mode,t.mapProjection,n,i),!l(a));++d);return a};var YXt=new pe;sp.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==se.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,YXt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var wXt=new h,BIe=new h,MXt=new pe,kXt=new gn;function Ose(e,t){return l(e)&&re.contains(e.rectangle,t)?e:void 0}sp.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],!re.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=Ose(n._southwestChild,e)||Ose(n._southeastChild,e)||Ose(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=h.fromRadians(e.longitude,e.latitude,0,a,wXt),d=kXt,u=a.geodeticSurfaceNormal(c,d.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(m)){let b;l(n.data.tileBoundingRegion)&&(b=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(b??0,-11500),y=h.multiplyByScalar(u,Math.abs(f)+1,BIe);h.subtract(c,y,d.origin)}let p=n.data.pick(d,se.SCENE3D,s,!1,BIe);if(l(p))return a.cartesianToCartographic(p,MXt).height};sp.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};sp.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===se.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))};sp.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};sp.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};sp.prototype.isDestroyed=function(){return!1};sp.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 _9=sp;var UCo=x(T(),1);var ZCo=x(T(),1),du=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +void main() { -vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); -vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); -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) { -return RayShapeIntersection(first, last); -} else if (!exitFromInside && enterFromOutside) { -return RayShapeIntersection(-1.0 * farSide, first); -} else if (exitFromInside && !enterFromOutside) { -return RayShapeIntersection(last, farSide); -} else { -return RayShapeIntersection(miss, miss); +out_FragColor = texture(colorTexture, v_textureCoordinates); } +`;var CCo=x(T(),1),LT=`uniform highp sampler2D u_depthTexture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;var yJi=_(T(),1),QA=`uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; -RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound) +`;function w0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),this._outputFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new li,this._tempCopyDepthFramebuffer=new li,this._updateDepthFramebuffer=new li({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 nt,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(w0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer: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}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function zIe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!nt.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,nt.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=nt.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!nt.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:on.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.NEVER,reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(LT,{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(du,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(LT,{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(du,{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 ui({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}w0.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),zIe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};w0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};w0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};w0.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),zIe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};w0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};w0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};w0.prototype.isDestroyed=function(){return!1};w0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.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 S9=w0;var $Co=x(T(),1);function pR(){this._framebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new li,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new nt,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(pR.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 UXt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function DXt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function OXt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!nt.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,nt.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=nt.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!nt.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(LT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({color:new U(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}pR.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;DXt(this,n,o,r,e),OXt(this,n,o,r,i),this._useHdr=e};pR.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};pR.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};pR.prototype.isDestroyed=function(){return!1};pR.prototype.destroy=function(){return UXt(this),me(this)};var Z9=pR;var mVo=x(T(),1);var Tc={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},bR=Tc.DERIVED_COMMANDS_MAXIMUM_LENGTH,nPe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function gR(){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=re.clone(re.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(bR),this._derivedBlendCommandTypes=new Array(bR),this._derivedPickCommandTypes=new Array(bR),this._derivedCommandTypesToUpdate=new Array(bR),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(gR.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}}});gR.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=HIe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=HIe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=KIe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=KIe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=KXt(this,e,t),this._sunVisibleThroughGlobe=BXt(this,e),this._environmentVisible=zXt(this,e),this._useDepthPlane=HXt(this,e),this._numberOfTextureUniforms=JXt(this),this._rectangle=re.clone(t.translucency.rectangle,this._rectangle),jXt(this,e)};function HIe(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 KIe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function BXt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function zXt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function HXt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function KXt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function JXt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function jXt(e,t){e._derivedCommandsLength=zse(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=zse(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=zse(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<bR;++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=uNt())}function zse(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?Tc.PICK_FRONT_FACE:d?Tc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Tc.TRANSLUCENT_FRONT_FACE,m=i?Tc.PICK_BACK_FACE:d?Tc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Tc.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=Tc.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=Tc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=Tc.DEPTH_ONLY_BACK_FACE),o[r++]=Tc.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=Tc.DEPTH_ONLY_FRONT_FACE),o[r++]=Tc.OPAQUE_BACK_FACE,o[r++]=u),r)}function Ch(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function JIe(e,t){return e.indexOf(t)>-1}function QXt(e,t){Ch(e.defines,"TRANSLUCENT"),Ch(t.defines,"TRANSLUCENT")}function qXt(e,t){Ch(e.defines,"GROUND_ATMOSPHERE"),Ch(t.defines,"GROUND_ATMOSPHERE"),Ch(e.defines,"FOG"),Ch(t.defines,"FOG"),Ch(e.defines,"TRANSLUCENT"),Ch(t.defines,"TRANSLUCENT")}function Hse(e,t){if(JIe(t.defines,"TILE_LIMIT_RECTANGLE")||JIe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function Kse(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Je.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 iPe(e,t){Kse(e,t),Ch(e.defines,"GROUND_ATMOSPHERE"),Ch(t.defines,"GROUND_ATMOSPHERE"),Ch(e.defines,"FOG"),Ch(t.defines,"FOG")}function $Xt(e,t){Kse(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function eNt(e,t){iPe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function jIe(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 tNt(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 nNt(e){e.cull.face=Di.BACK,e.cull.enabled=!0}function iNt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0}function oNt(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function rNt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function sNt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function QIe(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function qIe(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function aNt(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function cNt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function lNt(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=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function _A(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function dNt(e,t,n,i,o){return l(o)?!i&&l(n)?n:It(t,o(e),!1):t}function ap(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function uNt(){return[new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:QXt,getRenderStateFunction:nNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:qXt,getRenderStateFunction:iNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:Hse,getRenderStateFunction:oNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:Hse,getRenderStateFunction:rNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:Hse,getRenderStateFunction:sNt,getUniformMapFunction:void 0}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Kse,getRenderStateFunction:QIe,getUniformMapFunction:_A}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:iPe,getRenderStateFunction:qIe,getUniformMapFunction:_A}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:$Xt,getRenderStateFunction:QIe,getUniformMapFunction:_A}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:eNt,getRenderStateFunction:qIe,getUniformMapFunction:_A}),new ap({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:jIe,getRenderStateFunction:aNt,getUniformMapFunction:_A}),new ap({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:jIe,getRenderStateFunction:cNt,getUniformMapFunction:_A})]}var $Ie=new Array(bR),ePe=new Array(bR);gR.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)ePe[o]=this._derivedCommandPacks[n[o]],$Ie[o]=nPe[n[o]];mNt(this,e,i,n,$Ie,ePe,t)}};function mNt(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=a.uniformMapDirtyFrame??0,m=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,b=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;b&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),y&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let S=r[_],Z=i[_],R=o[_],C=a[R],E,A,L;l(C)?(E=C.uniformMap,A=C.shaderProgram,L=C.renderState):(E=void 0,A=void 0,L=void 0),C=lt.shallowClone(t,C),a[R]=C;let F=C.derivedCommands.uniformMapDirtyFrame??0,I=C.derivedCommands.shaderProgramDirtyFrame??0,N=C.derivedCommands.renderStateDirtyFrame??0,g=b||F<u,V=f||I<m,G=y||N<p;g&&(C.derivedCommands.uniformMapDirtyFrame=d),V&&(C.derivedCommands.shaderProgramDirtyFrame=d),G&&(C.derivedCommands.renderStateDirtyFrame=d),C.derivedCommands.type=Z,C.pass=S.pass,C.pickOnly=S.pickOnly,C.uniformMap=dNt(e,t.uniformMap,E,g,S.getUniformMapFunction),C.shaderProgram=tNt(s.context,t.shaderProgram,A,V,S.getShaderProgramFunction,R),C.renderState=lNt(t.renderState,L,G,S.getRenderStateFunction,S.renderStateCache)}}}gR.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=nPe[o[a]];n.commandList.push(s[c])}};function oPe(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 tPe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var hNt=[Tc.OPAQUE_FRONT_FACE,Tc.OPAQUE_BACK_FACE],fNt=[Tc.DEPTH_ONLY_FRONT_FACE,Tc.DEPTH_ONLY_BACK_FACE,Tc.DEPTH_ONLY_FRONT_AND_BACK_FACE];gR.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Le.GLOBE],a=e.indices[Le.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),oPe(s,a,t,i,o,hNt))};gR.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Le.GLOBE],c=e.indices[Le.GLOBE],d=e.commands[Le.TERRAIN_CLASSIFICATION],u=e.indices[Le.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let m=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!m||!p)&&tPe(d,u,t,i,o),!m&&!p)return;this._globeTranslucencyFramebuffer=n;let b=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,oPe(a,c,t,i,o,fNt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}tPe(d,u,t,i,o),s.globeDepthTexture=b,o.framebuffer=f};var R9=gR;var VVo=x(T(),1);var rPe=x(Noe(),1);function Jse(){this._image=new Image}Jse.prototype.isReady=function(){return!0};Jse.prototype.shouldDiscardImage=function(e){return e===this._image};function yR(e){e=e??B.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 to({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Jse),this._errorEvent=new Se}Object.defineProperties(yR.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}}});yR.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new yR(t);return n._metadata=e,n};yR.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]}};yR.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=ey.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ar({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=pNt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){wM(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=bNt(u)),!l(m)&&(!l(p)||p)){let b=gNt(u);m=b.imageType,u=b.imageData}return!l(m)||!l(u)?o:Ab({uint8Array:u,format:m,flipY:!0})})};yR.prototype.pickFeatures=function(e,t,n,i,o){};function pNt(e,t,n,i,o,r){let s=ey.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 bNt(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 gNt(e){let t=rPe.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 jse=yR;var kVo=x(T(),1);var yNt=600;function M0(e){e=e??B.EMPTY_OBJECT,this._key=l(e.key)?e.key:_a.defaultApiKey,this._baseResource=ve.createIfNeeded(e.url??_a.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??yNt}Object.defineProperties(M0.prototype,{});M0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,o=e.signature,{panoId:r}=e;l(r)||(r=(await this.getNearestPanoId(t)).panoId);let s=_a.getDefaultCredit(),a=h.fromDegrees(W.toDegrees(t.longitude),W.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:r,signature:o})],[d,u,m,p,b,f]=await Promise.all(c),y=_t.localFrameToFixedFrameGenerator("north","down"),_=P.getMatrix3(y(a,ne.default),new q);return new lR({sources:{positiveX:d,negativeX:u,positiveY:m,negativeY:p,positiveZ:b,negativeZ:f},transform:_,credit:s})};M0.prototype.getNearestPanoId=async function(e,t){let i=[W.toDegrees(e.latitude),W.toDegrees(e.longitude)].join(","),r=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(r.status!=="OK")throw new ge(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${r.status}`);return{panoId:r.pano_id,latitude:r.location.lat,longitude:r.location.lng}};M0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new ge(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};M0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await ve.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new ge(`Failed to load Street View face image: ${t}`)}};M0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:o,signature:r}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:o,heading:t,pitch:n,key:this._key,...l(r)&&{signature:r}}}).url};M0.fromUrl=async function(e){if(e=e??{},e.key=e.key??_a.defaultStreetViewStaticApiKey??_a.defaultApiKey,!l(e.key)&&!l(_a.defaultStreetViewStaticApiKey)&&!l(_a.defaultApiKey))throw new ge("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new M0({...e})};M0._parseMetadata=function(e){return{cartographic:pe.fromDegrees(e.location.lng,e.location.lat,0)}};var Qse=M0;var KVo=x(T(),1);var xNt=new U(1,1,1,.4),TNt=new U(0,1,0,.05),_Nt=new U(0,.5,0,.2);function xR(e){e=e??B.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 to({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??xNt,this._glowColor=e.glowColor??TNt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??_Nt,this._errorEvent=new Se,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(xR.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}}});xR.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()};xR.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};xR.prototype.getTileCredits=function(e,t,n){};xR.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};xR.prototype.pickFeatures=function(e,t,n,i,o){};var qse=xR;var EAo=x(T(),1);var $Eo=x(T(),1);var XEo=x(T(),1);var oEo=x(T(),1);function cp(){}cp._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);cp._decodeTaskProcessor=new $n("decodeI3S",cp._maxDecodingConcurrency);cp._promise=void 0;async function SNt(){if(await cp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return cp._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}cp.decode=async function(e,t,n,i,o){return l(cp._promise)||(cp._promise=SNt()),cp._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 m=q.fromRotationX(-W.PI_OVER_TWO),p=new q;q.multiply(m,a,p);let b=pe.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(b),y={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:b,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var C9=cp;var cEo=x(T(),1);function $se(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($se.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});$se.prototype.load=async function(){return this._data=await lp.loadJson(this._resource),this._data};var V9=$se;var mEo=x(T(),1);function sy(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(sy.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 OK(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 ZNt(e){return e==="String"?1:OK(e)}async function RNt(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)}sy.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=RNt(this).catch(function(e){console.error(e)}),this._loadPromise)};sy.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}};sy.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};sy.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)}}}};sy.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=OK(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=OK(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};sy.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=ZNt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};sy.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=OK(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 E9=sy;var xEo=x(T(),1);function A9(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(A9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});A9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var CNt=new h,VNt=new h,ENt=new h,ANt=new h,GNt=new h;function eae(e,t,n,i){let o=h.subtract(i,n,CNt),r=h.cross(o,h.subtract(e,n,VNt),ANt),s=h.cross(o,h.subtract(t,n,ENt),GNt);return h.dot(r,s)>=0}var LNt=new h,WNt=new h,vNt=new h,FNt=new h,INt=new h,PNt=new h,XNt=new h,NNt=new h,YNt=new h,wNt=new h;A9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,q.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,m;l(u)?m=u.length:m=d.length/3;for(let p=0;p<m;p++){let b,f,y;l(u)?(b=u[p],f=u[p+1],y=u[p+2]):(b=p*3,f=p*3+1,y=p*3+2);let _=h.fromElements(d[b*3],d[b*3+1],d[b*3+2],LNt),S=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],WNt),Z=new h(d[y*3],d[y*3+1],d[y*3+2],vNt);if(!eae(i,_,S,Z)||!eae(i,S,_,Z)||!eae(i,Z,_,S))continue;let R=h.subtract(S,_,FNt),C=h.subtract(Z,_,INt),E=h.cross(R,C,PNt);if(h.magnitude(E)===0)continue;let A=h.normalize(E,XNt),L=h.subtract(i,_,NNt),F=Math.abs(h.dot(L,A));if(F<o){o=F,r=p;let I=h.magnitudeSquared(h.subtract(i,_,L)),N=h.magnitudeSquared(h.subtract(i,S,YNt)),g=h.magnitudeSquared(h.subtract(i,Z,wNt));I<N&&I<g?(a=b,c=_,s=I):N<g?(a=f,c=S,s=N):(a=y,c=Z,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function sPe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(qZ(e[i])):t.push(e[i]);return t}A9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,m="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let R=this._parent._data.mesh.material.definition;if(R>=0&&R<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[R],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let C="0";if(l(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let A=this._layer._data.textureSetDefinitions[E];for(let L=0;L<A.formats.length;L++){let F=A.formats[L];if(F.format==="jpg"){C=F.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(m=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${C}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=sPe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=sPe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,m=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=[],b=[],f=[];d&&(p=[{sampler:0,source:0}],b=[{uri:m}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],_=n.length;for(let Z=0;Z<_;Z++){let R=n[Z].primitives,C=R.length;for(let E=0;E<C;E++){let A=R[E];if(l(A.material)){for(;A.material>=y.length;){let F=$e(c,!0);y.push(F)}let L=y[A.material];l(A.extra)&&A.extra.isTransparent?l(L.alphaMode)||(L.alphaMode="BLEND"):L.alphaMode==="BLEND"&&(L.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:b,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var SA=A9;function El(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(El.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}}});El.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new eh(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await lp.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 aPe(e,t){let n=new E9(e,t);return e._fields[t.name]=n,n.load()}El.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(aPe(this,i))}return Promise.all(t)};El.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 aPe(this,o)}return Promise.resolve()};El.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)};El.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};El.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 El(e,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};El.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new SA(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 SA(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};El.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new V9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};El.prototype._clearGeometryData=function(){this._geometryData=[]};El.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=pe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=pe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let S=0;S<this._dataProvider._geoidDataList.length;S++){let Z=this._dataProvider._geoidDataList[S],R=Z.projection.project(n);if(R.x>Z.nativeExtent.west&&R.x<Z.nativeExtent.east&&R.y>Z.nativeExtent.south&&R.y<Z.nativeExtent.north){n.height+=DNt(R.x,R.y,Z);break}}let i,o,r;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 S=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/S}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let S=this._data.lodThreshold;s=r/S}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let S=0;S<this._data.lodSelection.length;S++)this._data.lodSelection[S].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[S].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Cc(0,0,0),d=_t.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new Ne(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=q.fromQuaternion(d),m=q.inverse(u,new q),p=new P(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),b=P.inverse(p,new P),f=P.clone(p);l(this._parent._globalTransform)&&P.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=b,this._inverseRotationMatrix=m;let y=[];for(let S=0;S<this._children.length;S++)y.push(this._children[S]._create3DTileDefinition());return{children:y,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}};El.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};El.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 C9.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 MNt(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 kNt(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 cPe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await MNt(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(!kNt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}El.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=cPe(this,t);e.push(n)}return Promise.all(e)};eh.prototype._hookedRequestContent=eh.prototype.requestContent;eh.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 ve({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(()=>{cPe(e._i3sNode,n)})),e._isLoading=!1,t})}};function UNt(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 BK(e,t,n,i){let o=e+t*n;return i[o]}function DNt(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=BK(s,a,n.width,n.buffer),m=BK(c,a,n.width,n.buffer),p=BK(s,d,n.width,n.buffer),b=BK(c,d,n.width,n.buffer),f=UNt(o,r,u,m,p,b);return f=f*n.scale+n.offset,f}Object.defineProperties(eh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var ZA=El;var kEo=x(T(),1);function zK(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(zK.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function tae(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(qZ(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function RA(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=tae(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=tae(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=tae(a.color,a.transparency)))}break}}return n}function ONt(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=RA(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let m=0;m<d.length;m++){let p=d[m];m===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]=RA(o.symbol,t)}return n}}function BNt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=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(RA(r.symbol,t)))}return i.symbols.push(void 0),i}}zK.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=RA(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=RA(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=ONt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=RA(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=BNt(i,n))}};function lPe(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?lPe(s,t,n,i):s}}function zNt(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 HNt(e,t,n){let i=t[n],o=zNt(e.ranges,i);return e.symbols[o]}zK.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=>lPe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>HNt(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 G9=zK;function uu(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 ve({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(uu.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}}});uu.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 G9(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()};uu.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)}};uu.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]}}};uu.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 ZA(this,t,!0)}else this._rootNode=new ZA(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};uu.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]})};uu._fetchJson=function(e){return e.fetchJson()};uu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=uu._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]};uu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=re.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=re.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};uu.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)?$e(e):{},e.outlineColor=U.fromCartesian4(ce.fromArray(o))),this._tileset=await zr.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()})};uu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};uu.prototype.filterByAttributes=function(e){this._filters=l(e)?$e(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var TR=uu;var oAo=x(T(),1);function HK(e,t){this._dataProvider=e,this._resource=new ve({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(HK.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}}});HK.prototype.load=async function(){return this._data=await lp.loadJson(this._resource),this._data};HK.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 L9=HK;var dAo=x(T(),1);function W9(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(W9.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}}});W9._fromData=async function(e,t,n,i){let o=new W9(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=W9._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 ve({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await lp.loadJson(o._resource),c=new TR(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 v9=W9;var mPe=x(dPe(),1);function da(e){e=e??B.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??B.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(da.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}}});da.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)};da.prototype.isDestroyed=function(){return!1};da.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};da.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};da.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};da.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 KNt(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 uPe(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=KNt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=v9._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 L9(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=re.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 TR(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.`)}da.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await da.loadJson(n),o=new da(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=uPe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await uPe(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};da._fetchJson=function(e){return e.fetchJson()};da.loadJson=async function(e){let t=await da._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};da.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};da.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 JNt=new k;function jNt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=pe.fromRadians(t.west,t.north),a=pe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let m=c.x;m<=d.x;m++)for(let p=c.y;p<=d.y;p++){let b=k.fromElements(m,p,JNt),f=b.toString();if(!o.hasOwnProperty(f)){let y={x:b.x,y:b.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=y,i.push(y)}}let u=[];for(let m=0;m<i.length;++m){let p=i[m],b=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(b)}return Promise.all(u).then(function(m){let p=[];for(let b=0;b<m.length;b++){let f={tilingScheme:n,x:i[b].x,y:i[b].y,level:i[b].level},y=m[b],_="Geographic";n._projection instanceof xi&&(_="WebMercator");let S={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===gh.LERC){let Z=mPe.default.decode(y._buffer);S.buffer=Z.pixels[0]}else S.buffer=y._buffer;p.push(S)}return p})}async function QNt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await jNt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}da.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=QNt(this),this._geoidDataPromise)};da.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?re.union(e,n,e):e=re.clone(n)}this._extent=e};da.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};da.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[]};da.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 lp=da;var zAo=x(T(),1);function k0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new li({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new li({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 ui({color:new U(0,0,0,0),owner:this}),this._clearCommand=new ui({color:new U(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(k0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});k0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var qNt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},$Nt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},eYt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK,blending:on.ALPHA_BLEND},tYt=`uniform sampler2D colorTexture; +uniform sampler2D depthTexture; +uniform sampler2D classifiedTexture; +in vec2 v_textureCoordinates; +void main() { -vec3 t0 = (minBound - ray.pos) / ray.dir; -vec3 t1 = (maxBound - ray.pos) / ray.dir; -vec3 entries = min(t0, t1); -vec3 exits = max(t0, t1); -vec3 directions = sign(ray.dir); -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; + 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; } -return RayShapeIntersection(entry, exit); +`,nYt=`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 } -void intersectShape(in Ray ray, inout Intersections ix) +`;k0.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:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Wu({context:e,width:s,height:a,format:ql.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=ze.fromCache(qNt),this._rsClassified=ze.fromCache($Nt),this._rsDefault=ze.fromCache(eYt)),!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)?nYt:tYt,u=new Je({defines:["UNCLASSIFIED"],sources:[d]}),m=new Je({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{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(du,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};k0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};k0.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))};k0.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)};k0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};k0.prototype.isDestroyed=function(){return!1};k0.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 CA=k0;var tGo=x(T(),1);var F9={};F9.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ca.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ca.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===ca.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let s=r.toString(),a=new ve({url:s});return zr.fromUrl(a,n)};F9.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await ca.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ca.RealityDataType.Cesium3DTiles,ca.RealityDataType.PNTS,ca.RealityDataType.RealityMesh3DTiles,ca.RealityDataType.Terrain3DTiles,ca.RealityDataType.GaussianSplat3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let s=await ca.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...o};return zr.fromUrl(s,a)};F9.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ca.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ca.RealityDataType.KML,ca.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await ca.getRealityDataURL(e,t,i);return n===ca.RealityDataType.GeoJSON?cT.load(r):XZ.load(r)};F9.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${ca.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new ve({url:o,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return cT.load(r)};var nae=F9;var sGo=x(T(),1);function JK(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(JK.prototype,{total:{get:function(){return this._total}}});function WT(e){let t=new Array(Lc.NUMBER_OF_JOB_TYPES);t[Lc.TEXTURE]=new JK(l(e)?e[Lc.TEXTURE]:10),t[Lc.PROGRAM]=new JK(l(e)?e[Lc.PROGRAM]:10),t[Lc.BUFFER]=new JK(l(e)?e[Lc.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}WT.getTimestamp=Zn;Object.defineProperties(WT.prototype,{totalBudget:{get:function(){return this._totalBudget}}});WT.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};WT.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};WT.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=WT.getTimestamp();e.execute();let a=WT.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var I9=WT;var cGo=x(T(),1),iae=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function P9(e,t){this.spatialNode=e,this.keyframe=t,this.state=iae.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}P9.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=iae.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};P9.priorityComparator=function(e,t){return e.priority-t.priority};P9.searchComparator=function(e,t){return e.keyframe-t.keyframe};P9.LoadState=iae;var zo=P9;var uGo=x(T(),1);function hPe(){}Object.defineProperties(hPe.prototype,{color:{get:ge.throwInstantiationError},intensity:{get:ge.throwInstantiationError}});var oae=hPe;var yGo=x(T(),1);var iYt=/\/$/,fPe=new Lt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function VA(e){e=e??B.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=ve.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();iYt.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 Lt(c))):c=fPe,this._resource=i,this._imageryProvider=new Ss({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(VA.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}}});VA.prototype.getTileCredits=function(e,t,n){};VA.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};VA.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};VA._defaultCredit=fPe;var rae=VA;var IGo=x(T(),1);function U0(e,t,n,i,o=134217728,r){let s=oYt(i),a=rYt(n),c=n*Nt.getSizeInBytes(i),d=U0.get3DTextureDimension(t,c,o,r),u=h.divideComponents(d,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*d.x*d.y*d.z,this.tileCounts=h.clone(u,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=u.x*u.y*u.z,this.texture=new aM({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d.x,height:d.y,depth:d.z,sampler:new Bt({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:ei.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let m=0;m<this.maximumTileCount;m++)this.nodes[m]=new sYt(m);for(let m=0;m<this.maximumTileCount;m++){let p=this.nodes[m];p.previousNode=m>0?this.nodes[m-1]:void 0,p.nextNode=m<this.maximumTileCount-1?this.nodes[m+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(U0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Bt.NEAREST:this.texture.sampler=new Bt({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:ei.LINEAR}),this._nearestSampling=e)}}});function oYt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function rYt(e){switch(e){case 1:return Qe.RED;case 2:return Qe.RG;case 3:return Qe.RGB;case 4:return Qe.RGBA}}function sYt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}U0.prototype.add=function(e){if(this.isFull())throw new ge("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};U0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new ge("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--};U0.prototype.isFull=function(){return this.emptyList===void 0};U0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=kt;if(h.maximumComponent(e)>o)throw new ae("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,s=Math.floor(n/r);if(s<1)throw new ae("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((u,m)=>m[1]-u[1]),c=a.map(([u,m])=>Math.floor(o/m));for(let u=0;u<3;u++){let m=pPe(c);if(m<i)break;let p=c.slice();p.splice(u,1);let b=p[0]*p[1],f=m-i,y=Math.floor(f/b);c[u]-=y}pPe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let d=new h;for(let u=0;u<3;u++){let[m,p]=a[u];d[m]=c[u]*p}return d};function pPe(e){return e.reduce((t,n)=>t*n)}U0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,s=Math.floor(e/r),a=e-s*r,c=Math.floor(a/n.x),d=a-c*n.x,u={source:o,xOffset:d*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(u)};U0.prototype.isDestroyed=function(){return!1};U0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var X9=U0;var HGo=x(T(),1);var _c={};_c.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};_c.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=_c.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};_c.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=St.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let m=0;m<s;m++){let p=n*a+m*o,b=_c.decodeRawMetadataValueComponent(e,t,p);u[m]=b}return u}let c=n*a;return _c.decodeRawMetadataValueComponent(e,t,c)};_c.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=_c.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return _c.decodeRawMetadataValueElement(e,n,0)};_c.convertToObjectType=function(e,t){if(!l(t)||e===St.SCALAR||e===St.STRING||e===St.BOOLEAN||e===St.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case St.VEC2:return k.unpack(n,0,new k);case St.VEC3:return h.unpack(n,0,new h);case St.VEC4:return ce.unpack(n,0,new ce);case St.MAT2:return Ji.unpack(n,0,new Ji);case St.MAT3:return q.unpack(n,0,new q);case St.MAT4:return P.unpack(n,0,new P)}throw new ae(`Invalid metadata object type: ${e}`)};_c.convertFromObjectType=function(e,t){if(!l(t)||e===St.SCALAR||e===St.STRING||e===St.BOOLEAN||e===St.ENUM)return t;switch(e){case St.VEC2:return k.pack(t,Array(2));case St.VEC3:return h.pack(t,Array(3));case St.VEC4:return ce.pack(t,Array(4));case St.MAT2:return Ji.pack(t,Array(4));case St.MAT3:return q.pack(t,Array(9));case St.MAT4:return P.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};_c.decodeMetadataValues=function(e,t,n){let i=_c.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=_c.convertFromObjectType(e.type,t.offset),s=_c.convertFromObjectType(e.type,t.scale);i=Xp.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=_c.convertToObjectType(e.type,c);s[a]=d}return s}return _c.convertToObjectType(e.type,i)};var N9=Object.freeze(_c);var cLo=x(T(),1);function Y9(e){e=e??B.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ne.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new e9({radii:this.ellipsoid.radii,material:eo.fromType(eo.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new KM}Object.defineProperties(Y9.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var jK=new q,aYt=new q,cYt=new h,QK=[];Y9.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(_t.computeIcrfToFixedMatrix(n,jK))||_t.computeTemeToPseudoFixedMatrix(n,jK);let i=this._axes.evaluate(n,aYt);q.transpose(i,i),q.multiply(jK,i,i);let o=pT.computeMoonPositionInEarthInertialFrame(n,cYt);q.multiplyByVector(jK,o,o),P.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=QK,QK.length=0,t.update(e),e.commandList=r,QK.length===1?QK[0]:void 0};Y9.prototype.isDestroyed=function(){return!1};Y9.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var w9=Y9;var WLo=x(T(),1);var TLo=x(T(),1);var lYt=0,dYt=14,uYt=-1e3,mYt=1e4,hYt=2*Math.PI*ne.WGS84.maximumRadius,fYt=256,pYt=new re,bYt=new re,sae=class{constructor(t,n){n=n??{},this._resource=ve.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=re.clone(n.extent),this._minZoom=n.minZoom??lYt,this._maxZoom=n.maxZoom??dYt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=gYt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await zr.fromUrl(i,this._createTilesetLoadOptions())}catch(o){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,o}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,me(this)}};function gYt(e,t){let n=new Xr,i=l(t.extent)?re.clone(t.extent):re.clone(n.rectangle),o=xYt(n,i,t.minZoom),r={boundingVolume:{region:yPe(i)},geometricError:gPe(0),refine:"REPLACE",children:[]};for(let s=o.minY;s<=o.maxY;s++)for(let a=o.minX;a<=o.maxX;a++){let c=bPe(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&r.children.push(c)}return r.children.length===0&&(r.geometricError=0),{asset:{version:"1.1"},geometricError:r.geometricError,root:r}}function bPe(e,t,n,i,o,r,s){if(!TYt(e,i,r,s,n,pYt,bYt))return;let a=e.tileXYToRectangle(r,s,i,new re),c={boundingVolume:{region:yPe(a)},geometricError:i<o?gPe(i):0,refine:"REPLACE",content:{uri:yYt(t,i,r,s)}};if(i>=o)return c;let d=i+1,u=[];for(let m=s*2;m<=s*2+1;m++)for(let p=r*2;p<=r*2+1;p++){let b=bPe(e,t,n,d,o,p,m);l(b)&&u.push(b)}return u.length>0?c.children=u:c.geometricError=0,c}function yYt(e,t,n,i){let r=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return xm(r)}function gPe(e){return hYt/((1<<e)*fYt)}function yPe(e){return[e.west,e.south,e.east,e.north,uYt,mYt]}function xYt(e,t,n){let i=(1<<n)-1,o=pe.fromRadians(t.west,t.north),r=pe.fromRadians(t.east,t.south),s=e.positionToTileXY(o,n),a=e.positionToTileXY(r,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:W.clamp(Math.min(s.x,a.x),0,i),maxX:W.clamp(Math.max(s.x,a.x),0,i),minY:W.clamp(Math.min(s.y,a.y),0,i),maxY:W.clamp(Math.max(s.y,a.y),0,i)}}function TYt(e,t,n,i,o,r,s){let a=e.tileXYToRectangle(n,i,t,r);return l(re.intersection(a,o,s))}var M9=sae;var qK=class extends M9{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Bi.Z,t._modelForwardAxis=Bi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,o,r)=>{let s=Kk(r),a=xPe(o.getUrlComponent(!0)),c=sk(s,a,{featureIdProperty:t});if(!l(c)){if(!_Yt(s))return new Qp(n,i);throw new ae("Decoded MVT tile did not produce vector glTF content.")}return Ex.fromGltf(n,i,o,c)}}}};function xPe(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(xt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function _Yt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}qK._parseTileCoordinates=xPe;var aae=qK;var FLo=x(T(),1);function cae(e){}cae.prototype.isReady=function(){return!0};cae.prototype.shouldDiscardImage=function(e){return!1};var lae=cae;var qLo=x(T(),1);function ay(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 li({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new li({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new li({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new li({createColorAttachments:!1}),this._opaqueClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({color:new U(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 nt,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function TPe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function dae(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function _Pe(e){TPe(e),dae(e)}function SYt(e,t,n,i){TPe(e),e._accumulationTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function ZYt(e,t){dae(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)&&(dae(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)&&(_Pe(e),e._translucentMultipassSupport=!1,i=!1)}return i}ay.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,SYt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!ZYt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Je({sources:[fM]}),this._translucentMRTSupport&&m.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(m,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new Je({defines:["MRT"],sources:[DE]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new Je({sources:[DE]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let b=!nt.equals(this._viewport,t.viewport),f=b!==this._useScissorTest;this._useScissorTest=b,nt.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=nt.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!nt.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=ze.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 RYt={enabled:!0,color:new U(0,0,0,0),equationRgb:Ec.ADD,equationAlpha:Ec.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA},CYt={enabled:!0,color:new U(0,0,0,0),equationRgb:Ec.ADD,equationAlpha:Ec.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ONE,functionDestinationAlpha:$o.ONE},VYt={enabled:!0,color:new U(0,0,0,0),equationRgb:Ec.ADD,equationAlpha:Ec.ADD,functionSourceRgb:$o.ZERO,functionDestinationRgb:$o.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA};function uae(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function EYt(e,t,n){return uae(t,RYt,e._translucentRenderStateCache,n)}function AYt(e,t,n){return uae(t,CYt,e._translucentRenderStateCache,n)}function GYt(e,t,n){return uae(t,VYt,e._alphaRenderStateCache,n)}var LYt=` 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); +`,WYt=` 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; +`,vYt=` float ai = czm_out_FragColor.a; + out_FragColor = vec4(ai); +`;function mae(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 Je.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,`#define CESIUM_REDIRECTED_COLOR_OUTPUT +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 m=c[u];d=`layout (location = ${m[1]}) out vec4 ${m[0]}; +${d}`}return a.sources.push(d),a.sources.push(`void main() { -RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); -setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); + czm_translucent_main(); + if (czm_discard) + { + discard; + } +${i}} +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function FYt(e,t){return mae(e,t,"translucentMRT",LYt)}function IYt(e,t){return mae(e,t,"translucentMultipass",WYt)}function PYt(e,t){return mae(e,t,"alphaMultipass",vYt)}ay.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=lt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=FYt(t,e.shaderProgram),n.translucentCommand.renderState=EYt(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=lt.shallowClone(e,n.translucentCommand),n.alphaCommand=lt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=IYt(t,e.shaderProgram),n.translucentCommand.renderState=AYt(this,t,e.renderState),n.alphaCommand.shaderProgram=PYt(t,e.shaderProgram),n.alphaCommand.renderState=GYt(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 XYt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=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 b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,b)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(y,t,i,b)}i.framebuffer=m}function NYt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,b)}i.framebuffer=m}ay.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){NYt(this,e,t,n,i,o);return}XYt(this,e,t,n,i,o)};ay.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};ay.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,U.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};ay.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){return _Pe(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 k9=ay;var aWo=x(T(),1);var YYt=new Lt("MapQuest, Open Street Map and contributors, CC-BY-SA");function $K(e){e=e??B.EMPTY_OBJECT;let t=ve.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Xr({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(re.southwest(a),r),d=n.positionToTileXY(re.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),m=e.credit??YYt;typeof m=="string"&&(m=new Lt(m)),Ss.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&($K.prototype=Object.create(Ss.prototype),$K.prototype.constructor=$K);var cy=$K;var dWo=x(T(),1);function SPe(){ge.throwInstantiationError()}Object.defineProperties(SPe.prototype,{show:{get:ge.throwInstantiationError,set:ge.throwInstantiationError},transform:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError}});var hae=SPe;var hWo=x(T(),1);function eJ(){ge.throwInstantiationError()}Object.defineProperties(eJ.prototype,{});eJ.fromUrl=function(e){ge.throwInstantiationError()};eJ.prototype.loadPanorama=function(e){ge.throwInstantiationError()};var fae=eJ;var TWo=x(T(),1);var wYt=new k(1,1);function pae(e){e=e??B.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=U.clone(e.startColor??U.WHITE),this.endColor=U.clone(e.endColor??U.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=k.clone(e.imageSize??wYt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(pae.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var ZPe=new h;pae.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,ZPe),h.add(this.position,ZPe,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 EA=pae;var ZWo=x(T(),1);function RPe(e){e=e??B.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(RPe.prototype,{complete:{get:function(){return this._complete}}});var bae=RPe;var VWo=x(T(),1);function CPe(e){}CPe.prototype.emit=function(e){ge.throwInstantiationError()};var gae=CPe;var kWo=x(T(),1);var VPe=new k(1,1);function U9(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new Nk(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._emitterModelMatrix=P.clone(e.emitterModelMatrix??P.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new P,this._startColor=U.clone(e.color??e.startColor??U.WHITE),this._endColor=U.clone(e.color??e.endColor??U.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=k.clone(e.imageSize??e.minimumImageSize??VPe),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??VPe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 Se,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(U9.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||!P.equals(this._modelMatrix,e),P.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._emitterModelMatrix,e),P.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){U.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){U.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 MYt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let m=o.length;for(let p=0;p<m;++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 m=0;m<u;++m){let p=new EA;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function kYt(e){let t=e._particlePool.pop();return l(t)||(t=new EA),t}function UYt(e,t){e._particlePool.push(t)}function DYt(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 OYt(e){l(e._billboard)&&(e._billboard.show=!1)}function EPe(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 U(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function BYt(e,t){t.startColor=U.clone(e._startColor,t.startColor),t.endColor=U.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);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function zYt(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 tJ=new h;U9.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new wu),this._updateParticlePool&&(MYt(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)?EPe(this,s):(OYt(s),UYt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=zYt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=P.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=kYt(this),this._emitter.emit(s),h.add(s.position,s.velocity,tJ),P.multiplyByPoint(d,tJ,tJ),s.position=P.multiplyByPoint(d,s.position,s.position),h.subtract(tJ,s.position,s.velocity),h.normalize(s.velocity,s.velocity),BYt(this,s),EPe(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&&DYt(this)};U9.prototype.isDestroyed=function(){return!1};U9.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var yae=U9;var HWo=x(T(),1);function nJ(e){e=e??B.EMPTY_OBJECT;let t=Nn(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=Zn(),this._lastMsSampleTime=Zn(),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(nJ.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});nJ.prototype.update=function(e){let t=Zn(),n=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}};nJ.prototype.destroy=function(){return me(this)};var ly=nJ;var evo=x(T(),1);function _R(){this._framebuffer=new li,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(_R.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function HYt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function KYt(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); } -`;var xJi=_(T(),1),jA=`uniform vec2 u_cylinderRenderRadiusMinMax; -uniform vec2 u_cylinderRenderHeightMinMax; -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) -uniform vec2 u_cylinderRenderAngleMinMax; +`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}_R.prototype.update=function(e,t){HYt(this,e,t),KYt(this,e,t)};var JYt=new ce,jYt=new ce(1,1/255,1/65025,1/16581375);_R.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=ce.unpack(i,0,JYt);return ce.divideByScalar(o,255,o),ce.dot(o,jYt)};_R.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};_R.prototype.isDestroyed=function(){return!1};_R.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var D9=_R;var svo=x(T(),1);function O9(){this._framebuffer=new li({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(O9.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function QYt(e){e._framebuffer.destroy()}function qYt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new gc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new nt},o.viewport=new nt,e._passState=o}O9.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&qYt(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};O9.prototype.isDestroyed=function(){return!1};O9.prototype.destroy=function(){return QYt(this),me(this)};var B9=O9;var cvo=x(T(),1);function $Yt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var z9=$Yt;var Tvo=x(T(),1);function SR(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new nt},t.viewport=new nt,this._context=e,this._fb=new li({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function APe(e,t,n,i,o=1){let r=Math.max(n,i),s=r*r,a=Math.floor(n*.5),c=Math.floor(i*.5),d=0,u=0,m=0,p=-1,b=new Set;for(let f=0;f<s;++f){if(-a<=d&&d<=a&&-c<=u&&u<=c){let y=4*((c-u)*n+d+a),_=U.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),S=e.getObjectByPickColor(_);if(l(S)&&(b.add(S),b.size>=o))break}if(d===u||d<0&&-d===u||d>0&&d===1-u){let y=m;m=-p,p=y}d+=m,u+=p}return[...b]}SR.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return nt.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};SR.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,s=this._fb.framebuffer,a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:s}),u=sM.create({context:r});try{await u.waitForSignal(b=>t.afterRender.push(b));let m=Qe.createTypedArray(c,a,i,o);return d.getBufferData(m),APe(r,m,i,o,n)}catch{throw new ae("Async Picking Request Timeout")}finally{u.destroy(),d.destroy()}};SR.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return APe(o,r,n,i,t)};SR.prototype.readCenterPixel=function(e){let t=e.width??1,n=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)};SR.prototype.isDestroyed=function(){return!1};SR.prototype.destroy=function(){return this._fb.destroy(),me(this)};var H9=SR;var tIo=x(T(),1);var AFo=x(T(),1);var Gvo=x(T(),1);function ZR(){this._framebufferManager=new li({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(ZR.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});ZR.prototype.update=function(e,t,n){let i=t.width,o=t.height,r=e.colorBufferFloat?Ue.FLOAT:Ue.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,o,1,r,Qe.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};ZR.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};ZR.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};ZR.prototype.isDestroyed=function(){return!1};ZR.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,me(this)};var K9=ZR;var Xvo=x(T(),1);function dy(){this._numSamples=1,this._colorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new U(0,0,0,0),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,owner:this})}function ewt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(dy.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});dy.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};dy.prototype.clear=function(e,t,n){U.clone(n,this._clearCommand.color),U.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};dy.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};dy.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};dy.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){return ewt(this),me(this)};var RR=dy;var F2o=x(T(),1);var Mvo=x(T(),1);function vT(){}var twt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};vT.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return twt[n]===!0})};vT.getShadowCastShaderKeyword=function(e,t,n,i,o){return`castShadow ${e} ${t} ${n} ${i} ${o}`};vT.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=Je.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=Je.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 Je({defines:i,sources:o})};vT.createShadowCastFragmentShader=function(e,t,n,i,o){let r=e.defines.slice(0),s=e.sources.slice(0);r.push("SHADOW_MAP");let a=Je.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let d=s.length;for(let m=0;m<d;++m)s[m]=Je.replaceMain(s[m],"czm_shadow_cast_main");let u="";return t&&(c||(u+=`in vec3 v_positionEC; +`),u+=`uniform vec4 shadowMap_lightPositionEC; +`),i&&o?u+=`void main() +{ + czm_shadow_cast_main(); +`:i?u+=`void main() +{ +`:u+=`void main() +{ + czm_shadow_cast_main(); + if (out_FragColor.a == 0.0) + { + discard; + } +`,t?u+=` float distance = length(${a}); + if (distance >= shadowMap_lightPositionEC.w) + { + discard; + } + distance /= shadowMap_lightPositionEC.w; // radius + out_FragColor = czm_packDepth(distance); +`:n?u+=` out_FragColor = vec4(1.0); +`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); +`,u+=`} +`,s.push(u),new Je({defines:r,sources:s})};vT.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}`};vT.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 Je({defines:i,sources:o})};vT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Je.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Je.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,b=t._numberOfCascades>1,f=t.debugCascadeColors,y=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,S=e.defines.slice(0),Z=e.sources.slice(0),R=Z.length;for(let A=0;A<R;++A)Z[A]=Je.replaceMain(Z[A],"czm_shadow_receive_main");m?S.push("USE_CUBE_MAP_SHADOW"):d&&S.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!m&&S.push("USE_SOFT_SHADOWS"),b&&n&&i&&(s?S.push("ENABLE_VERTEX_LIGHTING"):S.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(S.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&S.push("USE_NORMAL_SHADING_SMOOTH"));let C="";m?C+=`uniform samplerCube shadowMap_textureCube; +`:C+=`uniform sampler2D shadowMap_texture; +`;let E;return c?E=` return vec4(${a}, 1.0); +`:E=`#ifndef LOG_DEPTH + return czm_windowToEyeCoordinates(gl_FragCoord); +#else + return vec4(v_logPositionEC, 1.0); +#endif +`,C+=`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() +{ +${E}} +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; +`:""}} +`,C+=`void main() +{ + czm_shadow_receive_main(); + vec4 positionEC = getPositionEC(); + vec3 normalEC = getNormalEC(); + float depth = -positionEC.z; +`,C+=` czm_shadowParameters shadowParameters; + shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; + shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; + shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; + shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; +`,i?C+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); +`:u||(C+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); +`),m?C+=` 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?C+=` 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); +`:b?C+=` 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); +`:""}`:C+=` 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); +`,C+=` out_FragColor.rgb *= visibility; +} +`,Z.push(C),new Je({defines:S,sources:Z})};var dp=vT;function D0(e){e=e??B.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(fn.isEdge()||(fn.isChrome()||fn.isFirefox())&&fn.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 P,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ce,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new iJ,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new de,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new k,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new bs:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ce,new ce],this._cascadeMatrices=[new P,new P,new P,new P],this._cascadeDistances=new ce;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 nwt(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,Tae(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new gc(t),this._size=e.size??2048,this.size=this._size}D0.MAXIMUM_DISTANCE=2e4;function nwt(e){this.camera=new iJ,this.passState=new gc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function xae(e,t){return ze.fromCache({cull:{enabled:!0,face:Di.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 Tae(e){let t=!e._usesDepthTexture;e._primitiveRenderState=xae(t,e._primitiveBias),e._terrainRenderState=xae(t,e._terrainBias),e._pointRenderState=xae(t,e._pointBias)}D0.prototype.debugCreateRenderStates=function(){Tae(this)};Object.defineProperties(D0.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){cwt(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 _ae(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 iwt(e,t){let n=new Wu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ql.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Bt.NEAREST}),o=new ps({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 owt(e,t){let n=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Bt.NEAREST}),i=new ps({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 rwt(e,t){let n=new Wu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ql.DEPTH_COMPONENT16}),i=new $r({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Bt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new ps({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 WPe(e,t){e._isPointLight?rwt(e,t):e._usesDepthTexture?owt(e,t):iwt(e,t)}function swt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Tae(e),_ae(e),WPe(e,t))}function awt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(_ae(e),WPe(e,t),swt(e,t),vPe(e,t))}function vPe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function cwt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=kt.maximumCubeMapSize>=t?t:kt.maximumCubeMapSize,o.x=t,o.y=t;let r=new nt(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=kt.maximumTextureSize>=t?t:kt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new nt(0,0,t,t)):i===4&&(t=kt.maximumTextureSize>=t*2?t:kt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new nt(0,0,t,t),n[1].passState.viewport=new nt(t,0,t,t),n[2].passState.viewport=new nt(0,t,t,t),n[3].passState.viewport=new nt(t,t,t,t));e._clearPassState.viewport=new nt(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,m=a.height/o.y;s.textureOffsets=new P(u,0,0,c,0,m,0,d,0,0,1,0,0,0,0,1)}}var lwt=new nt;function dwt(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=Le.OVERLAY,i}function uwt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=lwt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=dwt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!nt.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:nt.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var O0=new Array(8);O0[0]=new ce(-1,-1,-1,1);O0[1]=new ce(1,-1,-1,1);O0[2]=new ce(1,1,-1,1);O0[3]=new ce(-1,1,-1,1);O0[4]=new ce(-1,-1,1,1);O0[5]=new ce(1,-1,1,1);O0[6]=new ce(1,1,1,1);O0[7]=new ce(-1,1,1,1);var FT=new P,Sae=new Array(8);for(let e=0;e<8;++e)Sae[e]=new ce;function mwt(e,t){let n=new Yt({geometry:new Yh({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:$t.fromColor(t)}}),i=new Yt({geometry:new mg({radius:.5}),attributes:{color:$t.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var hwt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],fwt=new h;function pwt(e,t){uwt(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 X0({camera:e._sceneCamera,color:U.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new X0({camera:e._shadowMapCamera,color:U.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 X0({camera:e._passes[i].camera,color:hwt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Ne.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,fwt),a=P.fromTranslationQuaternionRotationScale(i,o,s,FT);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=mwt(a,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new X0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function iJ(){this.viewMatrix=new P,this.inverseViewMatrix=new P,this.frustum=void 0,this.positionCartographic=new pe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new P}iJ.prototype.clone=function(e){P.clone(e.viewMatrix,this.viewMatrix),P.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),pe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var bwt=new P(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);iJ.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return P.multiply(t,e,this.viewProjectionMatrix),P.multiply(bwt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var gwt=new Array(5),ywt=new qi,xwt=new Array(4),FPe=new h,IPe=new h;function Twt(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,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,u=.9);let p=xwt,b=gwt;for(b[0]=o,b[s]=r,a=0;a<s;++a){let N=(a+1)/s,g=o*Math.pow(d,N),V=o+c*N,G=W.lerp(V,g,u);b[a+1]=G,p[a]=G-b[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=b[0];for(a=0;a<s-1;++a)N+=p[a],b[a+1]=N}ce.unpack(b,0,e._cascadeSplits[0]),ce.unpack(b,1,e._cascadeSplits[1]),ce.unpack(p,0,e._cascadeDistances);let f=n.frustum,y=f.left,_=f.right,S=f.bottom,Z=f.top,R=f.near,C=f.far,E=n.positionWC,A=n.directionWC,L=n.upWC,F=i.frustum.clone(ywt),I=n.getViewProjection();for(a=0;a<s;++a){F.near=b[a],F.far=b[a+1];let N=P.multiply(F.projectionMatrix,i.viewMatrix,FT),g=P.inverse(N,FT),V=P.multiply(I,g,FT),G=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,FPe),v=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,IPe);for(let O=0;O<8;++O){let M=ce.clone(O0[O],Sae[O]);P.multiplyByVector(V,M,M),h.divideByScalar(M,M.w,M),h.minimumByComponent(M,G,G),h.maximumByComponent(M,v,v)}G.x=Math.max(G.x,0),G.y=Math.max(G.y,0),G.z=0,v.x=Math.min(v.x,1),v.y=Math.min(v.y,1),v.z=Math.min(v.z,1);let X=e._passes[a],Y=X.camera;Y.clone(n);let D=Y.frustum;D.left=y+G.x*(_-y),D.right=y+v.x*(_-y),D.bottom=S+G.y*(Z-S),D.top=S+v.y*(Z-S),D.near=R+G.z*(C-R),D.far=R+v.z*(C-R),X.cullingVolume=Y.frustum.computeCullingVolume(E,A,L);let w=e._cascadeMatrices[a];P.multiply(Y.getViewProjection(),i.inverseViewMatrix,w),P.multiply(X.textureOffsets,w,w)}}var _wt=new P,Swt=new h,Zwt=new h,GPe=new h;function Rwt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=P.multiply(i.frustum.projectionMatrix,i.viewMatrix,FT),r=P.inverse(o,FT),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,Swt);a=h.cross(c,s,Zwt),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,GPe),u=P.computeView(d,s,a,c,_wt),m=P.multiply(u,r,FT),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,FPe),b=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,IPe);for(let C=0;C<8;++C){let E=ce.clone(O0[C],Sae[C]);P.multiplyByVector(m,E,E),h.divideByScalar(E,E.w,E),h.minimumByComponent(E,p,p),h.maximumByComponent(E,b,b)}b.z+=1e3,p.z-=10;let f=GPe;f.x=-(.5*(p.x+b.x)),f.y=-(.5*(p.y+b.y)),f.z=-b.z;let y=P.fromTranslation(f,FT);u=P.multiply(y,u,u);let _=.5*(b.x-p.x),S=.5*(b.y-p.y),Z=b.z-p.z,R=n.frustum;R.left=-_,R.right=_,R.bottom=-S,R.top=S,R.near=.01,R.far=Z,P.clone(u,n.viewMatrix),P.inverse(u,n.inverseViewMatrix),P.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Cwt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Vwt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Ewt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Awt(e,t){let n=new qi;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=Cwt[i],o.upWC=Vwt[i],o.rightWC=Ewt[i],P.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),P.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Gwt=new h,Lwt=new h,PPe=new de,LPe=PPe.center;function Wwt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=PPe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Gwt),s=h.negate(i.directionWC,Lwt),a=h.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)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),de.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,LPe),LPe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),de.clone(o,e._boundingSphere)}}function vwt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;P.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),P.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=Io.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Wwt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}D0.prototype.update=function(e){if(vwt(this,e),this._needsUpdate)if(awt(this,e.context),this._isPointLight&&Awt(this,e),this._cascadesEnabled&&(Rwt(this,e),this._numberOfCascades>1&&Twt(this,e)),this._isPointLight)this._shadowMapCullingVolume=$s.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;P.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&pwt(this,e)};D0.prototype.updatePass=function(e,t){vPe(this,e,t)};var Fwt=new k;function XPe(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=Fwt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ce.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ce.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ce,combinedUniforms2:new ce};return It(t,o,!1)}function Iwt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=lt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Le.GLOBE,m=n.pass!==Le.TRANSLUCENT,p=e._isPointLight,b=e._usesDepthTexture,f=d.vertexShaderSource,y=d.fragmentShaderSource,_=m&&dp.hasClippingForShadowCast(y),S=dp.getShadowCastShaderKeyword(p,u,b,m,_);if(s=i.shaderCache.getDerivedShaderProgram(d,S),!l(s)){let R=dp.createShadowCastVertexShader(f,p,u),C=dp.createShadowCastFragmentShader(y,p,b,m,_);s=i.shaderCache.createDerivedShaderProgram(d,S,{vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=$e(a,!1),a.cull=$e(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=XPe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}D0.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===Le.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;l(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=lt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let b=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||f||n||b){let y=dp.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,y),!l(m)){let _=dp.createShadowReceiveVertexShader(a,d,u),S=dp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=XPe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};D0.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]=Iwt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};D0.prototype.isDestroyed=function(){return!1};D0.prototype.destroy=function(){_ae(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 uy=D0;var nFo=x(T(),1);var P2o=x(T(),1),CR=`uniform sampler2D colorTexture; +#ifdef DEBUG_SHOW_DEPTH +uniform sampler2D u_packedTranslucentDepth; #endif -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; -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); -} -RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) +in vec2 v_textureCoordinates; +void main() { -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); -} -RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight) +#ifdef DEBUG_SHOW_DEPTH +if (v_textureCoordinates.x < 0.5) { -RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true); -RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true); -return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection); +out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); +out_FragColor.a = 1.0; } -void intersectShape(Ray ray, inout Intersections ix) +#else +vec4 color = texture(colorTexture, v_textureCoordinates); +#ifdef PICK +if (color == vec4(0.0)) { -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; +discard; } -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) -RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); -setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); -#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) -RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); +#else +color.rgb /= color.a; #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]); +out_FragColor = color; #endif } -`;var TJi=_(T(),1),qA=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) -uniform vec2 u_ellipsoidRenderLongitudeMinMax; +`;var Pwt=!1;function IT(e){this._drawClassificationFBO=new li({createDepthAttachments:!1}),this._accumulationFBO=new li({createDepthAttachments:!1}),this._packFBO=new li,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 ui({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new nt,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(IT.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function NPe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function YPe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Xwt(e,t,n,i){NPe(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Bt.NEAREST})}function Nwt(e,t,n,i){YPe(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 Ywt(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)&&(Xwt(e,t,o,r),Nwt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Je({sources:[hM]}),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 Je({sources:[CR]}),a={colorTexture:function(){return e._textureToComposite}},Pwt&&(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,m=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new Je({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),b=lt.shallowClone(u);b.shaderProgram=p,u.derivedCommands.pick=b}l(e._copyCommand)||(s=new Je({sources:[CR]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Je({sources:[CR]}),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=!nt.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,nt.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=nt.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!nt.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!nt.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,reference:Jt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!nt.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:on.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}IT.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){Ywt(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}};IT.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(Le.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Le.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Le.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)};IT.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),wwt(this,e,t)};function wwt(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}IT.prototype.isSupported=function(){return this._supported};IT.prototype.isDestroyed=function(){return!1};IT.prototype.destroy=function(){return NPe(this),YPe(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 J9=IT;function Mwt(){this.command=void 0,this.near=void 0,this.far=void 0}function oJ(e,t,n){let i=e.context,o;i.depthTexture&&(o=new S9);let r;e._useOIT&&i.depthTexture&&(r=new k9(i));let s=new gc(i);s.viewport=nt.clone(n),this.camera=t,this._cameraClone=Io.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new H9(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new B9,this.sceneFramebuffer=new RR,this.edgeFramebuffer=new $k,this.planarFillIdFramebuffer=new K9,this.globeDepth=o,this.globeTranslucencyFramebuffer=new Z9,this.oit=r,this.translucentTileClassification=new J9(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Zae=new h,Rae=new h;function kwt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Zae)),h.maximumComponent(h.abs(t.position,Rae))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,Zae),h.multiplyByScalar(t.position,o,Rae),h.equalsEpsilon(Zae,Rae,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&P.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}oJ.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return kwt(t,n,W.EPSILON15)?(this._cameraStartFired&&Zn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Zn(),Io.clone(t,n),!0)};function Uwt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===se.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:m}=e;m.length=u;for(let p=0;p<u;++p){let b,f;c?(b=Math.min(i-d,n+p*d),f=Math.min(i,b+d)):(b=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*b)),l(m[p])?(m[p].near=b,m[p].far=f):m[p]=new s9(b,f)}}function Dwt(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 wPe=new $s,Owt=new Ns;oJ.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 I=0;I<u.length;++I)for(let N=0;N<Le.NUMBER_OF_PASSES;++N)u[I].indices[N]=0;c.length=0,d.length=0;let m=this._commandExtents,p=m.length,b=0,f=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:_}=o,S=+Number.MAX_VALUE,Z=-Number.MAX_VALUE,R=Number.MAX_VALUE,C=t.mode===se.SCENE3D?t.occluder:void 0,{cullingVolume:E}=t,A=wPe.planes;for(let I=0;I<5;++I)A[I]=E.planes[I];E=wPe;for(let I=0;I<i.length;++I){let N=i[I],{pass:g,boundingVolume:V}=N;if(g===Le.COMPUTE)c.push(N);else if(g===Le.OVERLAY)d.push(N);else{let G,v;if(l(V)){if(!e.isVisible(E,N,C))continue;let Y=V.computePlaneDistances(r,s,Owt);if(G=Y.start,v=Y.stop,f=Math.min(f,G),y=Math.max(y,v),_&&N.receiveShadows&&G<uy.MAXIMUM_DISTANCE&&!(g===Le.GLOBE&&G<-100&&v>100)){let D=v-G;g!==Le.GLOBE&&G<100&&(R=Math.min(R,D)),S=Math.min(S,G),Z=Math.max(Z,v)}}else N instanceof ui?(G=a.near,v=a.far):(G=a.near,v=a.far,f=Math.min(f,G),y=Math.max(y,v));let X=m[b];l(X)||(X=m[b]=new Mwt),X.command=N,X.near=G,X.far=v,b++}}_&&(S=Math.min(Math.max(S,a.near),a.far),Z=Math.max(Math.min(Z,a.far),S),o.nearPlane=S,o.farPlane=Z,o.closestObjectSize=R),Uwt(this,e,f,y);for(let I=0;I<b;I++)Dwt(this,e,m[I]);if(b<p)for(let I=b;I<p;I++){let N=m[I];if(!l(N.command))break;N.command=void 0}let L=u.length,{frustumSplits:F}=t;F.length=L+1;for(let I=0;I<L;++I)F[I]=u[I].near,I===L-1&&(F[I+1]=u[I].far)};oJ.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.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 VR=oJ;var kPe=.1,Bwt=new _h({pass:lr.MOST_DETAILED_PRELOAD}),zwt=new _h({pass:lr.MOST_DETAILED_PICK}),j9=new _h({pass:lr.PICK});function Wa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new nt(0,0,1,1),n=new Io(e);n.frustum=new yn({width:kPe,aspectRatio:1,near:.1}),this._pickOffscreenView=new VR(e,n,t)}Wa.prototype.update=function(){this._pickPositionCacheDirty=!0};Wa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new D9,n[t]=i),i};var Hwt=new bs,Kwt=new h,rJ=new h,Jwt=new k,jwt=new P;function Qwt(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=P.clone(r.transform,jwt);r._setTransform(P.IDENTITY);let m=h.clone(r.position,Kwt);h.multiplyByScalar(r.right,c,rJ),h.add(rJ,m,m),h.multiplyByScalar(r.up,d,rJ),h.add(rJ,m,m),r._setTransform(u),e.mode===se.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,Jwt),b=Hwt;return b.right=p.x*.5,b.left=-b.right,b.top=p.y*.5,b.bottom=-b.top,b.near=s.near,b.far=s.far,b.computeCullingVolume(m,r.directionWC,r.upWC)}var qwt=new hd,$wt=new k;function eMt(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,m=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,b=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,$wt),y=f.x*n*.5,_=f.y*i*.5,S=qwt;return S.top=b+_,S.bottom=b-_,S.right=p+y,S.left=p-y,S.near=a,S.far=s.far,S.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function sJ(e,t,n,i,o){let r=e.camera.frustum;return r instanceof yn||r instanceof bs?Qwt(e,t,n,i,o):eMt(e,t,n,i,o)}var Q9=new nt(0,0,3,3),aJ=new k,q9=new U(0,0,0,0);function Cae(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function $9(e,t,n,i,o,r){let{context:s,frameState:a,defaultView:c}=e,{viewport:d,pickFramebuffer:u}=c,m=r?.framebuffer??u;e.view=c,d.x=0,d.y=0,d.width=s.drawingBufferWidth,d.height=s.drawingBufferHeight;let p=c.passState;p.viewport=nt.clone(d,p.viewport);let b=fo.transformWindowToDrawingBuffer(e,t,aJ);Cae(s.drawingBufferHeight,b,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=sJ(e,b,n.width,n.height,d),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=r?.snap??!1,a.tilesetPassState=j9,s.uniformState.update(a),e.updateEnvironment(),p=m.begin(n,d),e.updateAndExecuteCommands(p,q9),e.resolveFramebuffers(p)}function eU(e){let{context:t}=e;t.endFrame()}Wa.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,d=Q9;$9(e,t,d,n,i);let u;return r.webgl2?u=c.endAsync(d,s,o):(u=c.end(d,o),u=Promise.resolve(u),xt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),eU(e),u};Wa.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=Q9;$9(e,t,a,n,i);let c=s.end(a,o);return eU(e),c};Wa.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=nt.clone(a,d.viewport);let u=fo.transformWindowToDrawingBuffer(e,t,aJ),m=Cae(o.drawingBufferHeight,u,n,i,Q9);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=sJ(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=j9,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,q9),e.resolveFramebuffers(d);let p=c.readCenterPixel(m);return o.endFrame(),p};Wa.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=nt.clone(s,c.viewport);let d=fo.transformWindowToDrawingBuffer(e,t,aJ),u=Cae(i.drawingBufferHeight,d,1,1,Q9);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=sJ(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=j9,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,q9);let m=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=m;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,N9.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function tMt(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=nt.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=sJ(e,t,1,1,s),o.tilesetPassState=j9,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,q9),e.resolveFramebuffers(c),i.endFrame()}var nMt=new qi,iMt=new hd,oMt=new yn,rMt=new bs;Wa.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 h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=fo.transformWindowToDrawingBuffer(e,t,aJ);e.pickTranslucentDepth?tMt(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(nMt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(iMt):l(s.frustum.width)?u=s.frustum.clone(oMt):u=s.frustum.clone(rMt);let{frustumCommandsList:m}=a,p=m.length;for(let b=0;b<p;++b){let y=this.getPickDepth(e,b).getDepth(o,d.x,d.y);if(l(y)&&y>0&&y<1){let _=m[b],S;return e.mode===se.SCENE2D?(S=s.position.z,s.position.z=S-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(b!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=fo.drawingBufferToWorldCoordinates(e,d,y,n),e.mode===se.SCENE2D&&(s.position.z=S,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var sMt=new pe;Wa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==se.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,sMt);o.cartographicToCartesian(r,n)}return n};function aMt(e,t,n,i,o,r){for(let s of e){let a=s.object,c=s.position,d=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!d&&(n.push(s),n.length>=t))return!0;let u=a.primitive,m=!1;if(typeof u.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=u.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(m=!0,p.show=Wn.toValue(!1,p.show),o.push(p))}a instanceof ea&&(m=!0,a.show=!1,r.push(a)),m||(u.show=!1,i.push(u))}}function UPe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!aMt(s,t,n,i,o,r);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<o.length;++a){let c=o[a];c.show=Wn.toValue(!0,c.show)}for(let a=0;a<r.length;++a)r[a].show=!0;return n}Wa.prototype.drillPick=function(e,t,n,i,o){return UPe(a=>this.pick(e,t,i,o,a).map(d=>({object:d,position:void 0,exclude:!1})),n).map(a=>a.object)};var MPe=new h,cMt=new h;function lMt(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 DPe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,MPe),s=h.cross(o,r,MPe),a=h.cross(o,s,cMt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??kPe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function dMt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=DPe(e,o,r,a),d=Bwt;d.camera=a,d.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let b=s[p];b.show&&t.primitives.contains(b)&&(b.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}Wa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)dMt(this,e,t[n])&&t.splice(n--,1)};function OPe(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 xl&&OPe(o,t,n))}}function cJ(e,t,n,i,o,r){let s=[];if(OPe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new lMt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function uMt(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 mMt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,DPe(e,n,o,u.camera);let m=nt.clone(u.viewport,Q9),p=u.pickFramebuffer.begin(m,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=zwt:c.tilesetPassState=j9,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,q9),t.resolveFramebuffers(p);let b,f=u.pickFramebuffer.end(m,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=u,_=y.length;for(let S=0;S<_;++S){let R=e.getPickDepth(t,S).getDepth(a,0,0);if(l(R)&&R>0&&R<1){let C=y[S],E=C.near*(S!==0?t.opaqueFrustumNearOffset:1),A=C.far,L=E+R*(A-E);b=gn.getPoint(n,L);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(b))return{object:f,position:b,exclude:!l(b)&&r||uMt(f,i)}}function Vae(e,t,n,i,o,r,s,a){return UPe(function(){let d=mMt(e,t,n,o,r,s,a);return d?[d]:void 0},i)}function AA(e,t,n,i,o,r,s){let a=Vae(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function lJ(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)})})}Wa.prototype.pickFromRay=function(e,t,n,i){return AA(this,e,t,n,i,!1,!1)};Wa.prototype.drillPickFromRay=function(e,t,n,i,o){return Vae(this,e,t,n,i,o,!1,!1)};Wa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,lJ(e,cJ(o,e,t,n,i,function(){return AA(o,e,t,n,i,!1,!0)}))};Wa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,lJ(e,cJ(r,e,t,i,o,function(){return Vae(r,e,t,n,i,o,!1,!0)}))};var hMt=new h,fMt=new h,pMt=new gn,BPe=new pe;function Eae(e,t){let n=e.ellipsoid,i=Pi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,fMt),r=pe.toCartesian(t,n,hMt),s=pMt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function zPe(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,BPe);return Eae(e,i)}function HPe(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,BPe).height}function bMt(e,t,n,i,o){let r=Eae(t,n);return cJ(e,t,r,i,o,function(){let s=AA(e,t,r,i,o,!0,!0);if(l(s))return HPe(t,s.position)})}function gMt(e,t,n,i,o,r){let s=zPe(t,n);return cJ(e,t,s,i,o,function(){let a=AA(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}Wa.prototype.sampleHeight=function(e,t,n,i){let o=Eae(e,t),r=AA(this,e,o,n,i,!0,!1);if(l(r))return HPe(e,r.position)};Wa.prototype.clampToHeight=function(e,t,n,i,o){let r=zPe(e,t),s=AA(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};Wa.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]=bMt(this,e,t[s],n,i);return lJ(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}))};Wa.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]=gMt(this,e,t[s],n,i,t[s]);return lJ(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Wa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var tU=Wa;var MIo=x(T(),1);var jPe=x(Q5(),1);var oIo=x(T(),1);var yMt={modifyFragmentShader:function(t){return t=Je.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 -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) + czm_splitter_main(); +} +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},GA=yMt;var ER={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function nU(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=U.clone(U.DARKGRAY),this._highlightColor=U.clone(U.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=ER.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=e.opaquePass??Le.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=P.clone(P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.time=0,this.shadows=vn.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=e.splitDirection??Mr.NONE,this._splittingEnabled=!1,this._error=void 0,xMt(this,e)}Object.defineProperties(nU.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return U.clone(this._highlightColor)},set:function(e){this._highlightColor=U.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=de.clone(e,this._boundingSphere)}}});function xMt(e,t){let n=bS.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=$h.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=ER.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=U.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 TMt=new h,_Mt=new h,SMt=new h,KPe,dJ;function ZMt(e){if(!l(dJ)){KPe=new jPe.default(0),dJ=new Array(e);for(let t=0;t<e;++t)dJ[t]=KPe.random()}return dJ}function RMt(e){let n=e.length/3,i=Math.min(n,20),o=ZMt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,TMt),c=h.fromElements(s,s,s,_Mt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,SMt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=de.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function JPe(e,t){let n=J.fromTypedArray(e);return n===J.INT||n===J.UNSIGNED_INT||n===J.DOUBLE?(xt("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 CMt=new ce,VMt=new ce,EMt=new U,QPe=0,uJ=1,vae=2,qPe=3,AMt=4,Aae=new P,GMt=new P;function LMt(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),m=e._isQuantized,p=e._isQuantizedDraco,b=e._isOctEncoded16P,f=e._isOctEncodedDraco,y=e._quantizedRange,_=e._octEncodedRange,S=e._isRGB565,Z=e._isTranslucent,R=e._hasColors,C=e._hasNormals,E=e._hasBatchIds,A,L,F=[],I={};if(e._styleableShaderAttributes=I,u){let w=AMt;for(let O in d)if(d.hasOwnProperty(O)){let M=d[O],z=JPe(M.typedArray,O);A=M.componentCount,L=J.fromTypedArray(z);let K=ot.createVertexBuffer({context:n,typedArray:z,usage:Pe.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:w,vertexBuffer:K,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0};F.push(te),I[O]={location:w,componentCount:A},++w}}let N=ot.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let g;R&&(g=ot.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let V;C&&(V=ot.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=V.sizeInBytes);let G;E&&(c.typedArray=JPe(c.typedArray,"batchIds"),G=ot.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let v=[];if(m?L=J.UNSIGNED_SHORT:p?L=y<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT:L=J.FLOAT,v.push({index:QPe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=de.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=RMt(r.typedArray)),R)if(S)v.push({index:uJ,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:J.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let w=Z?4:3;v.push({index:uJ,vertexBuffer:g,componentsPerAttribute:w,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}C&&(b?(A=2,L=J.UNSIGNED_BYTE):f?(A=2,L=_<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT):(A=3,L=J.FLOAT),v.push({index:vae,vertexBuffer:V,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&v.push({index:qPe,vertexBuffer:G,componentsPerAttribute:1,componentDatatype:J.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(v=v.concat(F));let X=new Un({context:n,attributes:v}),Y={depthTest:{enabled:!0}},D={depthTest:{enabled:!0},depthMask:!1,blending:on.ALPHA_BLEND};e._opaquePass===Le.CESIUM_3D_TILE&&(Y.stencilTest=Jt.setCesium3DTileBit(),Y.stencilMask=Jt.CESIUM_3D_TILE_MASK,D.stencilTest=Jt.setCesium3DTileBit(),D.stencilMask=Jt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(Y),e._translucentRenderState=ze.fromCache(D),e._drawCommand=new lt({boundingVolume:new de,cull:e._cull,modelMatrix:new P,primitiveType:Ie.POINTS,vertexArray:X,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:Z?e._translucentRenderState:e._opaqueRenderState,pass:Z?Le.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function WMt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=CMt;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===se.SCENE2D||c instanceof yn?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 U.TRANSPARENT;let c=U.clone(a.edgeColor,EMt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return P.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;P.multiply(n.uniformState.view3D,c,Aae);let d=P.multiply(Aae,a.modelMatrix,Aae);return P.inverseTranspose(d,GMt)}};GA.addUniforms(e,s),(i||o||r)&&(s=It(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=VMt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Gae(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 Lae(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 Wae(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 vMt={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 FMt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,b=e._isTranslucent,f=e._hasColors,y=e._hasNormals,_=e._hasBatchIds,S=e._backFaceCulling,Z=e._normalShading,R=e._drawCommand.vertexArray,C=e.clippingPlanes,E=e._attenuation,A,L,F,I=b,N=$e(vMt),g={},V=e._styleableShaderAttributes;for(o in V)V.hasOwnProperty(o)&&(r=V[o],N[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let he={translucent:!1},Ze="(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)";A=n.getColorShaderFunction(`getColorFromStyle${Ze}`,N,he),L=n.getShowShaderFunction(`getShowFromStyle${Ze}`,N,he),F=n.getPointSizeShaderFunction(`getPointSizeFromStyle${Ze}`,N,he),l(A)&&he.translucent&&(I=!0)}e._styleTranslucent=I;let G=l(A),v=l(L),X=l(F),Y=e.isClipped,D=[],w=[];G&&(Gae(A,D),Lae(A,w)),v&&(Gae(L,D),Lae(L,w)),X&&(Gae(F,D),Lae(F,w));let O=w.indexOf("COLOR")>=0,M=w.indexOf("NORMAL")>=0;if(M&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in V)if(V.hasOwnProperty(o)){r=V[o];let he=D.indexOf(r.location)>=0,Ze=Wae(R,r.location);Ze.enabled=he}let z=f&&(!G||O);if(f){let he=Wae(R,uJ);he.enabled=z}let K=y&&(Z||S||M);if(y){let he=Wae(R,vae);he.enabled=K}let te={a_position:QPe};z&&(te.a_color=uJ),K&&(te.a_normal=vae),_&&(te.a_batchId=qPe);let H="",$=D.length;for(i=0;i<$;++i){let he=D[i];r=g[he];let Ze=r.componentCount,ye=`czm_3dtiles_property_${he}`,Ge;Ze===1?Ge="float":Ge=`vec${Ze}`,H+=`in ${Ge} ${ye}; +`,te[ye]=r.location}WMt(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; +`,E&&(ee+=`float u_geometricError; +float u_depthMultiplier; +`),ee+=H,z&&(b?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||m?ee+=`in vec2 a_normal; +`:ee+=`in vec3 a_normal; +`),_&&(ee+=`in float a_batchId; +`),(c||d||m)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; +`),G&&(ee+=A),v&&(ee+=L),X&&(ee+=F),ee+=`void main() +{ + u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; + tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; +`,E&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; + u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; +`),z?b?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); +`:m?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); +`,G&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal); +`),v&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); +`),X?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; +`:E?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&&Z&&(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&&S&&(ee+=` float visible = step(-normalEC.z, 0.0); + gl_Position *= visible; + gl_PointSize *= visible; +`),v&&(ee+=` gl_Position.w *= float(show); + gl_PointSize *= float(show); +`),ee+=`} +`;let le=`in vec4 v_color; +`;Y&&(le+=`uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +`,le+=` +`,le+=hR(C,s),le+=` +`),le+=`void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +`,Y&&(le+=a9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),le+=`} +`,e.splitDirection!==Mr.NONE&&(le=GA.modifyFragmentShader(le)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(le=e._fragmentShaderLoaded(le));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=nn.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:le,attributeLocations:te});try{_e.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 IMt(e,t){if(e._decodingState===ER.READY)return!1;if(e._decodingState===ER.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Eb.decodePointCloud(i,t);l(o)&&(e._decodingState=ER.DECODING,o.then(function(r){e._decodingState=ER.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,m=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,S=_.range;e._quantizedVolumeScale=h.fromElements(S,S,S),e._quantizedVolumeOffset=h.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let b=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let S=r[_];l(b)||(b={}),b[_]={typedArray:S.array,componentCount:S.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=b}).catch(function(r){e._decodingState=ER.FAILED,e._error=r}))}return!0}var PMt=new ce,XMt=new h;nU.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(IMt(this,t))return;let i=!1,o=!P.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(LMt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){P.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(P.clone(this._modelMatrix,d),l(this._rtcCenter)&&P.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&P.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==se.SCENE3D){let m=e.mapProjection,p=P.getColumn(d,3,PMt);ce.equals(p,ce.UNIT_W)||_t.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(de.clone(this._boundingSphere,u),this._cull){let m=u.center;P.multiplyByPoint(d,m,m);let p=P.getScale(d,XMt);u.radius*=h.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!==Mr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&FMt(this,e,this._style),this._drawCommand.castShadows=vn.castShadows(this.shadows),this._drawCommand.receiveShadows=vn.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?Le.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};nU.prototype.isDestroyed=function(){return!1};nU.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 iU=nU;var uPo=x(T(),1);var UIo=x(T(),1),NMt={NEAREST:0,LINEAR:1},mm=NMt;function my(e){e=e??B.EMPTY_OBJECT;let{name:t=qn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=mm.NEAREST,pixelFormat:a=Qe.RGBA,pixelDatatype:c=Ue.UNSIGNED_BYTE,clearColor:d=U.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 m=new gc;m.scissorTest={enabled:!0,rectangle:l(u)?nt.clone(u):new nt},this._passState=m,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(my.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 YMt=/uniform\s+sampler2D\s+depthTexture/g;my.prototype._isSupported=function(e){return!YMt.test(this._fragmentShader)||e.depthTexture};function wMt(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 MMt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function kMt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function UMt(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]=MMt(e,r),n[r]=wMt(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`]=kMt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=It(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 DMt(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) { -vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight); -vec3 position = ray.pos * radiiCorrection; -vec3 direction = ray.dir * radiiCorrection; -float a = dot(direction, direction); -float b = dot(direction, position); -float c = dot(position, position) - 1.0; -float determinant = b * b - a * c; -if (determinant < 0.0) { -vec4 miss = vec4(normalize(direction), NO_HIT); -return RayShapeIntersection(miss, miss); -} -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -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)); + 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; } -vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle) +bool czm_selected() { -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; -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) { -return (b == 0.0) -? vec2(NO_HIT) -: vec2(-0.5 * c / b, NO_HIT); -} -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -float t1 = (-b - signB * determinant) / a; -float t2 = c / (a * t1); -float tmin = min(t1, t2); -float tmax = max(t1, t2); -return vec2(tmin, tmax); -} -vec3 getConeNormal(in vec3 p, in bool convex) { -vec2 radial = -abs(p.z) * normalize(p.xy); -float zSign = (p.z < 0.0) ? -1.0 : 1.0; -float z = length(p.xy) * zSign; -float flip = (convex) ? -1.0 : 1.0; -return normalize(vec3(radial, z) * flip); -} -float getLatitudeConeShift(in float sinLatitude) { -float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; -float primeVerticalRadius = inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; -} -void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -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); -intersections[0].entry = -1.0 * farSide; -intersections[0].exit = farSide; -intersections[1].entry = miss; -intersections[1].exit = miss; -if (intersect.x == NO_HIT) { -return; + return czm_selected(vec2(0.0)); } -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) { -} 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; + +${e}`}function OMt(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=DMt(n,o)}let i=new Je({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function BMt(e){let t=e._sampleMode,n,i;t===mm.LINEAR?(n=Ht.LINEAR,i=ei.LINEAR):(n=Ht.NEAREST,i=ei.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Bt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function zMt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function HMt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function KMt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(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]=HMt(e,d);else if(typeof d=="string"){let m=new ve({url:d});s.push(m.fetchImage().then(zMt(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 $Pe(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 JMt(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 jMt(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 c=0;c<n.length;++c){let d=n[c];l(d.pickIds)?i+=d.pickIds.length:l(d.pickId)&&++i}let o=kt.maximumTextureSize;if(i>o&&(my._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${o}). Features beyond the limit will not have the post-process effect applied.`),i=o),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:Bt.NEAREST});return}let r=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&r<s;++c){let d=n[c];if(l(d.pickIds)){let u=d.pickIds,m=u.length;for(let p=0;p<m&&r<s;++p){let b=u[p].color;a[r]=U.floatToByte(b.red),a[r+1]=U.floatToByte(b.green),a[r+2]=U.floatToByte(b.blue),a[r+3]=U.floatToByte(b.alpha),r+=4}}else if(l(d.pickId)){let u=d.pickId.color;a[r]=U.floatToByte(u.red),a[r+1]=U.floatToByte(u.green),a[r+2]=U.floatToByte(u.blue),a[r+3]=U.floatToByte(u.alpha),r+=4}}e._selectedIdTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Bt.NEAREST})}my.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&$Pe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=JMt(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,jMt(this,e),UMt(this),KMt(this,e),OMt(this,e),BMt(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=ze.fromCache({viewport:new nt(0,0,i.width,i.height)}))),this._command.renderState=o};my.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,Bt.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)};my.prototype.isDestroyed=function(){return!1};my.prototype.destroy=function(){return $Pe(this),me(this)};my._oneTimeWarning=xt;var Uo=my;var oNo=x(T(),1);var vXo=x(T(),1);var hPo=x(T(),1),oU=`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 pPo=x(T(),1),rU=`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; +if (depth >= 1.0) { +posEC.z = czm_currentFrustum.y; } -RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -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); +return posEC; } -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); +vec3 getNormalXEdge(vec3 positionEC) +{ +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; +vec3 dx0 = positionEC - positionLeft; +vec3 dx1 = positionRight - positionEC; +vec3 dy0 = positionEC - positionDown; +vec3 dy1 = positionUp - positionEC; +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 intersectShape(in Ray ray, inout Intersections ix) { -ray.pos = ray.pos * 2.0 - 1.0; -ray.dir *= 2.0; -RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); -if (outerIntersect.entry.w == NO_HIT) { +void main(void) +{ +vec4 positionEC = pixelToEye(gl_FragCoord.xy); +float maxValidDepth = czm_currentFrustum.y - lengthCap; +if (-positionEC.z > maxValidDepth) +{ +out_FragColor = vec4(1.0); return; } -RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); -if (innerIntersect.entry.w == NO_HIT) { -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); -} else { -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); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +vec3 normalEC = getNormalXEdge(positionEC.xyz); +float gaussianVariance = lengthCap * sqrt(-positionEC.z); +float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0); +float metersPerPixel = czm_metersPerPixel(positionEC, 1.0); +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); +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; +#if __VERSION__ == 300 +for (int i = 0; i < directionCount; i++) +{ +#else +for (int i = 0; i < 16; i++) +{ +if (i >= directionCount) { +break; } -#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 -#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 -#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 +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; } -`;var CJi=_(T(),1),oS=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { -intersectShape(ray, ix); -RayShapeIntersection intersection = getFirstIntersection(ix); -if (intersection.entry.w == NO_HIT) { -return intersection; -} -#if defined(CLIPPING_PLANES) -intersectClippingPlanes(ray, ix); -#endif -#if defined(DEPTH_TEST) -intersectDepth(screenCoord, ray, ix); -#endif -#if (INTERSECTION_COUNT > 1) -initializeIntersections(ix); -for (int i = 0; i < INTERSECTION_COUNT; ++i) { -intersection = nextIntersection(ix); -if (intersection.exit.w > 0.0) { -intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5); +if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) { break; } +vec4 samplePositionEC = pixelToEye(samplePixel); +vec3 stepVector = samplePositionEC.xyz - positionEC.xyz; +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); +float sampleDistance = length(stepVector); +float weight = gaussian(sampleDistance, gaussianVariance); +localAO += weight * dotVal; } -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; +ao += localAO; } -`;var LJi=_(T(),1),$A=`#if defined(BOX_HAS_SHAPE_BOUNDS) -uniform vec3 u_boxUvToShapeUvScale; -uniform vec3 u_boxUvToShapeUvTranslate; -#endif -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -return PointJacobianT(positionUv, mat3(0.5)); +ao *= angleStepScale * stepLength; +ao = 1.0 - clamp(ao, 0.0, 1.0); +ao = pow(ao, intensity); +out_FragColor = vec4(vec3(ao), 1.0); } -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; -#else -return positionShape; -#endif +`;var gPo=x(T(),1),sU=`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; } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +`;var xPo=x(T(),1),aU=`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; } -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; -#else -return shapeUv; #endif +float luminance = czm_luminance(rgb); +float darkness = luminance * gradations; +darkness = (darkness - fract(darkness)) / gradations; +out_FragColor = vec4(vec3(darkness), 1.0); } -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return shapeUv / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif +`;var _Po=x(T(),1),cU=`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; } -`;var RJi=_(T(),1),e9=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) -uniform vec2 u_cylinderUvToShapeUvRadius; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) -uniform vec2 u_cylinderUvToShapeUvHeight; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) -uniform vec2 u_cylinderUvToShapeUvAngle; -#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) { -vec3 position = positionUv * 2.0 - 1.0; -float radius = length(position.xy); -vec3 radial = normalize(vec3(position.xy, 0.0)); -float height = positionUv.z; -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); +vec4 bloom = texture(bloomTexture, v_textureCoordinates); +out_FragColor = glowOnly ? bloom : bloom + color; } -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) -angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); -#endif -#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); +`;var ZPo=x(T(),1),lU=`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); } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +`;var CPo=x(T(),1),dU=`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); } -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 EPo=x(T(),1),uU=`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; } -`;var EJi=_(T(),1),t9=`uniform vec3 u_ellipsoidRadiiUv; -uniform vec2 u_evoluteScale; -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; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -uniform vec2 u_ellipsoidUvToShapeUvLatitude; -#endif -uniform float u_ellipsoidInverseHeightDifferenceUv; -vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { -vec2 p = abs(pos); -vec2 inverseRadii = 1.0 / radii; -vec2 tTrigs = vec2(0.7071067811865476); -vec2 v = radii * tTrigs; -vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; -const int iterations = 3; -for (int i = 0; i < iterations; ++i) { -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; +float computeDepthBlur(float depth) +{ +float f; +if (depth < focalDistance) +{ +f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); } -return vec3(v * sign(pos), length(v - evolute)); +else +{ +f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); +f = pow(f, 0.1); } -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -vec3 position = positionUv * 2.0 - 1.0; -position = position * u_ellipsoidRadiiUv; -float longitude = atan(position.y, position.x); -vec3 east = normalize(vec3(-position.y, position.x, 0.0)); -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); +f *= f; +f = clamp(f, 0.0, 1.0); +return pow(f, 0.5); } -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -float longitude = (positionShape.x + czm_pi) / czm_twoPi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) -longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); -#endif -#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 -float latitude = (positionShape.y + czm_piOverTwo) / czm_pi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; -#endif -float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv; -return vec3(longitude, latitude, height); +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); } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +`;var GPo=x(T(),1),mU=`uniform sampler2D depthTexture; +in vec2 v_textureCoordinates; +void main(void) +{ +float depth = czm_readDepth(depthTexture, v_textureCoordinates); +out_FragColor = vec4(vec3(depth), 1.0); } -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -float longitude = shapeUv.x * czm_twoPi; -#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) -longitude /= u_ellipsoidUvToShapeUvLongitude.x; -#endif -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 WPo=x(T(),1),hU=`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; } -`;var IJi=_(T(),1),n9=`#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; -uniform ivec3 u_inputDimensions; -#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; +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 FPo=x(T(),1),fU=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#else +uniform float exposure; #endif -}; -int intMod(in int a, in int b) { -return a - (b * (a / b)); +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; +const float B = 0.30; +const float C = 0.10; +const float D = 0.20; +const float E = 0.01; +const float F = 0.30; +const float white = 11.2; +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); } -int normU8_toInt(in float value) { -return int(value * 255.0); +`;var PPo=x(T(),1),pU=`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); } -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); +`;var NPo=x(T(),1),bU=`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); } -float normU8x2_toFloat(in vec2 value) { -return float(normU8x2_toInt(value)) / 65535.0; +`;var wPo=x(T(),1),PT=`#define SAMPLES 8 +uniform float delta; +uniform float sigma; +uniform float direction; +uniform sampler2D colorTexture; +#ifdef USE_STEP_SIZE +uniform float stepSize; +#else +uniform vec2 step; +#endif +in vec2 v_textureCoordinates; +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; } -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; +out_FragColor = result; } -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); +`;var kPo=x(T(),1),gU=`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; +#define DISTANCE_TO_SPACE 6500000.0 +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); } -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; +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)); } -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -float dimAtLevel = exp2(float(octreeCoords.w)); -return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +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; } -vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -vec3 tileUv = getTileUv(shapePosition, octreeCoords); -return clamp(tileUv, vec3(0.0), vec3(1.0)); +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; } -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(Y_UP_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)) -if (sampleData.tileCoords.w == 0) { -float angleCount = float(u_inputDimensions.z); -angle = mod(angle + angleCount / 2.0, angleCount); +return vec4(clamp(color, 0.0, 1.0), 0.0); } -#endif -inputCoordinate.y = height; -inputCoordinate.z = angle; -#endif -#endif -sampleData.tileUv = tileUv; -sampleData.inputCoordinate = inputCoordinate; +void main(void) +{ +vec4 originalColor = texture(colorTexture, v_textureCoordinates); +vec3 rgb = originalColor.rgb; +bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; +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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) +{ +out_FragColor = originalColor; +return; } -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; +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); +vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; +vec3 direction = normalize(vec3(ghostVec, 0.0)); +vec4 result = vec4(0.0); +vec4 ghost = vec4(0.0); +for (int i = 0; i < 4; ++i) +{ +vec2 offset = fract(texcoord + ghostVec * float(i)); +ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); } -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { -int leafIndex = data.data; -int leafNodeTexelCount = 2; -float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; -float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; -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; -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; -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); +result += ghost; +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; +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); } -#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) { -vec3 center = 0.5 * (start + end); -vec3 childCoord = step(center, shapePosition); -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) { -break; +if (dirtTexCoords.y > 1.0) +{ +dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); } -start = mix(start, center, childCoord); -end = mix(center, end, childCoord); -traversalData.parentOctreeIndex = childData.data; +result += dirtAmount * texture(dirtTexture, dirtTexCoords); +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; } -return childData; +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; } -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); +result += texture(colorTexture, v_textureCoordinates); +out_FragColor = result; } -#if (SAMPLE_COUNT == 1) -getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[0]); +`;var DPo=x(T(),1),yU=`uniform sampler2D colorTexture; +uniform vec3 white; +in vec2 v_textureCoordinates; +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; #else -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(shapePosition, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[1]); +uniform float exposure; #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)); -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; -} -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); -} -OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); -#if (SAMPLE_COUNT == 1) -getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[0]); +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 -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(shapePosition, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[1]); +color *= vec3(exposure); #endif +color = (color * (1.0 + color / white)) / (1.0 + color); +color = czm_inverseGamma(color); +out_FragColor = vec4(color, fragmentColor.a); } -`;var wJi=_(T(),1),i9=`uniform ivec2 u_megatextureSliceDimensions; -uniform ivec2 u_megatextureTileDimensions; -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; -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); +`;var BPo=x(T(),1),xU=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +float rand(vec2 co) +{ +return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); } -vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) +void main(void) { -int indexX = intMod(index, dimensions.x); -int indexY = index / dimensions.x; -return vec2(indexX, indexY) * uvScale; +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); } -Properties getPropertiesFromMegatexture(in SampleData sampleData) { -int tileIndex = sampleData.megatextureIndex; -vec3 voxelCoord = sampleData.inputCoordinate; -#if defined(NEAREST_SAMPLING) -voxelCoord = floor(voxelCoord) + vec3(0.5); -#endif -vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -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); -vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -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); +`;var HPo=x(T(),1),TU=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; +#ifdef AUTO_EXPOSURE +uniform sampler2D autoExposure; +#else +uniform float exposure; #endif -} -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { -#if (SAMPLE_COUNT == 1) -return getPropertiesFromMegatexture(sampleDatas[0]); +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 -Properties properties = clearProperties(); -for (int i = 0; i < SAMPLE_COUNT; ++i) { -float weight = sampleDatas[i].weight; -if (weight > 0.0) { -Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); -tempProperties = scaleProperties(tempProperties, weight); -properties = sumProperties(properties, tempProperties); -} -} -return properties; +color *= vec3(exposure); #endif +color = color / (1.0 + color); +color = czm_inverseGamma(color); +out_FragColor = vec4(color, fragmentColor.a); } -`;var vJi=_(T(),1),eyt={Z_UP:0,Y_UP:1},gm=Object.freeze(eyt);function tyt(e){let t=new Lx;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 y=o[p];t.addUniform(y.type,p,xe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",xe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=c(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([HA]),e.provider.metadataOrder===gm.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,xe.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,xe.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,xe.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,xe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",n9,BA,zA,i9]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,xe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,xe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,xe.FRAGMENT),t.addFragmentLines([JA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,xe.FRAGMENT),t.addFragmentLines([KA])),a==="BOX"?t.addFragmentLines([$A,QA,oS]):a==="CYLINDER"?t.addFragmentLines([e9,xL,jA,oS]):a==="ELLIPSOID"&&t.addFragmentLines([t9,xL,qA,oS]),t.addFragmentLines([YA]);let l=e._shape,d=l.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let y=d[p];c(y)&&(y=y===!0?void 0:y,t.addDefine(p,y,xe.FRAGMENT))}let u=l.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,xe.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,xe.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,xe.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,xe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,xe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,xe.FRAGMENT);let f=e._traversal;t.addDefine("SAMPLE_COUNT",`${f._sampleCount}`,xe.FRAGMENT)}var o9=tyt;var dQi=_(T(),1);function nyt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,l=o.length,d=c(s)&&c(a);n.addDefine("METADATA_COUNT",l,xe.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=o[P],b=`PropertyStatistics_${F}`,G=`PropertyStatistics_${F}`;n.addStruct(b,G,xe.FRAGMENT);let X=YD(N);n.addStructField(b,X,"min"),n.addStructField(b,X,"max")}let u="Statistics",f="Statistics",p="statistics";n.addStruct(u,f,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=`PropertyStatistics_${F}`,b=F;n.addStructField(u,N,b)}let y="Metadata",h="Metadata",g="metadata";n.addStruct(y,h,xe.FRAGMENT),n.addStructField(y,f,p);for(let P=0;P<l;P++){let F=i[P],N=o[P],b=YD(N);n.addStructField(y,b,F)}for(let P=0;P<l;P++){let F=i[P],N=o[P],b=oyt(N),G=`VoxelProperty_${F}`,X=`VoxelProperty_${F}`;n.addStruct(G,X,xe.FRAGMENT),n.addStructField(G,b,"partialDerivativeLocal"),n.addStructField(G,b,"partialDerivativeWorld"),n.addStructField(G,b,"partialDerivativeView"),n.addStructField(G,b,"partialDerivativeValid")}let x="Voxel",S="Voxel",V="voxel";n.addStruct(x,S,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=`VoxelProperty_${F}`;n.addStructField(x,N,F)}n.addStructField(x,"vec3","positionEC"),n.addStructField(x,"vec3","positionUv"),n.addStructField(x,"vec3","positionShapeUv"),n.addStructField(x,"vec3","positionUvLocal"),n.addStructField(x,"vec3","viewDirUv"),n.addStructField(x,"vec3","viewDirWorld"),n.addStructField(x,"vec3","surfaceNormal"),n.addStructField(x,"float","travelDistance"),n.addStructField(x,"int","stepCount"),n.addStructField(x,"int","tileIndex"),n.addStructField(x,"int","sampleIndex");let Z="FragmentInput";n.addStruct(Z,"FragmentInput",xe.FRAGMENT),n.addStructField(Z,h,g),n.addStructField(Z,S,V);let E="Properties",I="Properties",v="properties";n.addStruct(E,I,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=o[P],b=YD(N);n.addStructField(E,b,F)}{let P="clearProperties";n.addFunction(P,`${I} clearProperties()`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F],b=o[F],G=r[F],X=YD(b,G);n.addFunctionLines(P,[`${v}.${N} = ${X}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`${v}.${N} = propertiesA.${N} + propertiesB.${N};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${I} scaleProperties(${I} ${v}, float scale)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} scaledProperties = ${v};`]);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`scaledProperties.${N} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`${v}.${N} = mix(propertiesA.${N}, propertiesB.${N}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${I} ${v}, inout ${h} ${g})`,xe.FRAGMENT);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`${g}.${N} = ${v}.${N};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${f} ${p})`,xe.FRAGMENT);for(let F=0;F<l;F++){let N=i[F],b=o[F],G=lt.getComponentCount(b);for(let X=0;X<G;X++){let W=ryt(b,X),A=s[F][X],k=a[F][X];!c(A)||!c(k)||n.addFunctionLines(P,[`${p}.${N}.min${W} = ${ZTe(A)};`,`${p}.${N}.max${W} = ${ZTe(k)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F],b=o[F],G=r[F],X=iyt(b,G);n.addFunctionLines(P,[`properties.${N} = texture(u_megatextureTextures[${F}], texcoord)${X};`])}n.addFunctionLines(P,[`return ${v};`])}}function YD(e){if(e===lt.SCALAR)return"float";if(e===lt.VEC2)return"vec2";if(e===lt.VEC3)return"vec3";if(e===lt.VEC4)return"vec4"}function iyt(e){if(e===lt.SCALAR)return".r";if(e===lt.VEC2)return".ra";if(e===lt.VEC3)return".rgb";if(e===lt.VEC4)return""}function oyt(e){if(e===lt.SCALAR)return"vec3";if(e===lt.VEC2)return"mat2";if(e===lt.VEC3)return"mat3";if(e===lt.VEC4)return"mat4"}function ZTe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function ryt(e,t){return e===lt.SCALAR?"":`[${t}]`}var r9=nyt;function syt(e,t){let n=new o9(e);r9(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let S="getClippingPlane",V=c0(o,t),Z=0,R=V.indexOf(")")+1,E=V.indexOf("{",R)+1,I=V.indexOf("}",E),v=V.slice(Z,R),P=V.slice(E,I);i.addFunction(S,v,xe.FRAGMENT),i.addFunctionLines(S,[P])}let s=i.clone();s.addDefine("PICKING",void 0,xe.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,xe.FRAGMENT);let l=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),f=Oe.fromCache({cull:{enabled:!0,face:_i.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),y=e._depthTest,h=new et({vertexArray:p,primitiveType:ve.TRIANGLES,renderState:f,shaderProgram:l,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Xe.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),g=et.shallowClone(h,new et);g.shaderProgram=d,g.pickOnly=!0;let x=et.shallowClone(h,new et);if(x.shaderProgram=u,x.pickOnly=!0,c(e._drawCommand)){let S=e._drawCommand;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(c(e._drawCommandPick)){let S=e._drawCommandPick;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(c(e._drawCommandPickVoxel)){let S=e._drawCommandPickVoxel;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}e._drawCommand=h,e._drawCommandPick=g,e._drawCommandPickVoxel=x}var s9=syt;var JQi=_(T(),1);var LQi=_(T(),1),ayt={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"},rS=Object.freeze(ayt);var MQi=_(T(),1);var RQi=_(T(),1);function cyt(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 a9=cyt;function _L(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}_L.prototype.getTexture=function(e){return this._textures[e]};function lyt(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];c(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}_L.prototype.loadTexture2D=function(e,t){c(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):lyt(this,e,t)};function dyt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?HD(o,r,n):uyt(o,r,n),a=e._textures[i];c(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function HD(e,t,n){let{typedArray:i,sampler:o}=e,r=c(i)?GTe(e,n):new Pt({context:n,source:t,sampler:o});return RTe(o)&&r.generateMipmap(),r}function uyt(e,t,n){let{typedArray:i,sampler:o}=e,r=RTe(o),s=o.wrapS===xn.REPEAT||o.wrapS===xn.MIRRORED_REPEAT||o.wrapT===xn.REPEAT||o.wrapT===xn.MIRRORED_REPEAT,{width:a,height:l}=c(i)?e:t,d=[a,l].every(w.isPowerOfTwo);if((r||s)&&!d)if(c(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let f=a9(i,a,l),p=py(f);return HD({sampler:o},p,n)}}else{let f=py(t);return HD(e,f,n)}else return HD(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."),GTe(e,n)}function RTe(e){return[Jt.NEAREST_MIPMAP_NEAREST,Jt.NEAREST_MIPMAP_LINEAR,Jt.LINEAR_MIPMAP_NEAREST,Jt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function GTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Pt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}_L.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];dyt(this,o,t)}n.length=0};_L.prototype.isDestroyed=function(){return!1};_L.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 he(this)};var c9=_L;function l9(e){e=e??z.EMPTY_OBJECT,this.mode=e.mode??bb.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??z.EMPTY_OBJECT,this.varyings=e.varyings??z.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Iy.INHERIT,this._textureManager=new c9,this._defaultTexture=void 0,this.uniformMap=myt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},pyt(this),byt(this)}function myt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i],r=o.type;if(r===rS.SAMPLER_CUBE)throw new L("CustomShader does not support samplerCube uniforms");r===rS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=fyt(e,i)):n[i]=hyt(e,i)}return n}function fyt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function hyt(e,t){return function(){return e.uniforms[t].value}}function sS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function pyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;c(r)&&(o=e.usedVariablesVertex.attributeSet,sS(r,t,o),o=e.usedVariablesVertex.featureIdSet,sS(r,n,o),o=e.usedVariablesVertex.metadataSet,sS(r,i,o));let s=e.fragmentShaderText;if(c(s)){o=e.usedVariablesFragment.attributeSet,sS(s,t,o),o=e.usedVariablesFragment.featureIdSet,sS(s,n,o),o=e.usedVariablesFragment.metadataSet,sS(s,i,o);let a=/material\.(\w+)/g,l=e.usedVariablesFragment.materialSet;sS(s,a,l)}}function ETe(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=`${ETe(t)} is not available in the ${i} shader. Did you mean ${ETe(n)} instead?`;throw new L(o)}}function byt(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")}l9.prototype.setUniform=function(e,t){if(C.typeOf.string("uniformName",e),C.defined("value",t),!c(this.uniforms[e]))throw new L(`Uniform ${e} must be declared in the CustomShader constructor.`);let n=this.uniforms[e];n.type===rS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):c(t.clone)?n.value=t.clone(n.value):n.value=t};l9.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};l9.prototype.isDestroyed=function(){return!1};l9.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),he(this)};var aS=l9;var rji=_(T(),1);function C0(e){if(C.typeOf.object("options",e),!c(e.loader)){if(!c(e.metadata))throw new L("One of loader and metadata must be defined.");if(!Array.isArray(e.metadata))throw new L("metadata must be an array of TypedArrays.")}let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(C0.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});C0.fromMetadataArray=function(e){if(C.typeOf.object("metadata",e),!Array.isArray(e))throw new L("metadata must be an array of TypedArrays.");return new C0({metadata:e})};C0.fromGltf=async function(e){C.typeOf.object("resource",e);let t=new nf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new C0({loader:t})};C0.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!c(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=yyt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function yyt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:l}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let f=l[o[u]].attribute,p=e.find(x=>x.name===f);if(!c(p))continue;let y=At.toComponentDatatype(s[u]),h=lt.getComponentCount(r[u]),g=p.count*h;d[u]=q.createArrayBufferView(y,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,g)}return d}C0.prototype.isDestroyed=function(){return!1};C0.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),he(this)};var cS=C0;var Dji=_(T(),1);var hji=_(T(),1);function mp(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ue,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=mp.DefaultMinBounds.clone(),this._maxBounds=mp.DefaultMaxBounds.clone(),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 gyt=new m,G8=new m,xyt=new te,_yt=new m,Tyt=new m,Syt=new m,Cyt=new m,XTe=M.fromRotationTranslation(te.fromUniformScale(.5,new te),new m(.5,.5,.5),new M);mp.prototype.update=function(e,t,n,i,o){C.typeOf.object("modelMatrix",e),C.typeOf.object("minBounds",t),C.typeOf.object("maxBounds",n),i=i??t.clone(_yt),o=o??n.clone(Tyt),t=m.clone(t,this._minBounds),n=m.clone(n,this._maxBounds);let r=m.clamp(t,i,o,Syt),s=m.clamp(n,i,o,Cyt),a=M.getScale(e,G8);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=X8(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ue.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:l,shaderDefines:d}=this;for(let y in d)d.hasOwnProperty(y)&&(d[y]=void 0);let u=0;d.BOX_INTERSECTION_INDEX=u,u+=1,l.renderMinBounds=M.multiplyByPoint(XTe,r,l.renderMinBounds),l.renderMaxBounds=M.multiplyByPoint(XTe,s,l.renderMaxBounds),d.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,p=n;return l.boxUvToShapeUvScale=m.fromElements(2/(f.x===p.x?1:p.x-f.x),2/(f.y===p.y?1:p.y-f.y),2/(f.z===p.z?1:p.z-f.z),l.boxUvToShapeUvScale),l.boxUvToShapeUvTranslate=m.fromElements(-l.boxUvToShapeUvScale.x*(f.x*.5+.5),-l.boxUvToShapeUvScale.y*(f.y*.5+.5),-l.boxUvToShapeUvScale.z*(f.z*.5+.5),l.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=u,!0};var zD=new m,E8=new m;mp.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){C.typeOf.number("tileLevel",e),C.typeOf.number("tileX",t),C.typeOf.number("tileY",n),C.typeOf.number("tileZ",i),C.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=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),zD),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)),E8);return X8(l,d,this.shapeTransform,o)};var ITe=new m;mp.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){C.typeOf.object("spatialNode",e),C.typeOf.object("tileDimensions",t),C.typeOf.object("tileUv",n),C.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,ITe),s=m.multiplyByScalar(r,o,ITe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,zD),o,zD),l=m.add(a,s,E8),d=this._minBounds,u=this._maxBounds,f=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),zD),p=m.fromElements(w.lerp(d.x,u.x,l.x),w.lerp(d.y,u.y,l.y),w.lerp(d.z,u.z,l.z),E8);return X8(f,p,this.shapeTransform,i)};mp.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));mp.DefaultMaxBounds=Object.freeze(new m(1,1,1));function X8(e,t,n,i){let o=mp.DefaultMinBounds,r=mp.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,G8),l=m.midpoint(e,t,gyt);i.center=M.multiplyByPoint(n,l,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),G8);let d=M.getRotation(n,xyt);i.halfAxes=te.setScale(d,a,i.halfAxes)}return i}var lS=mp;var Lji=_(T(),1);function V0(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ue,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=V0.DefaultMinBounds.clone(),this._maxBounds=V0.DefaultMaxBounds.clone(),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 PTe=new m,Vyt=new m,Lyt=new m,Zyt=new m,Ryt=new m;V0.prototype.update=function(e,t,n,i,o){C.typeOf.object("modelMatrix",e),C.typeOf.object("minBounds",t),C.typeOf.object("maxBounds",n),i=i??t.clone(Vyt),o=o??n.clone(Lyt),t=m.clone(t,this._minBounds),n=m.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=V0,a=s.y-r.y,l=.5*a,d=w.EPSILON10,u=w.EPSILON3,f=w.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=w.negativePiToPi(t.y),n.y=w.negativePiToPi(n.y),i.y=w.negativePiToPi(i.y),o.y=w.negativePiToPi(o.y);let p=m.maximumByComponent(t,i,Zyt),y=m.minimumByComponent(n,o,Ryt),h=M.getScale(e,PTe);if(y.x===0||p.x>y.x||p.z>y.z||w.equalsEpsilon(h.x,0,void 0,d)||w.equalsEpsilon(h.y,0,void 0,d)||w.equalsEpsilon(h.z,0,void 0,d))return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=w8(p,y,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ue.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let g=t.x===r.x&&n.x===s.x,x=n.y<t.y,S=n.y-t.y+x*a,V=S>l+f&&S<a-f,Z=S<l-f,R=S>=l-f&&S<=l+f,E=V||Z||R,I=w.equalsEpsilon(t.y,r.y,void 0,u),v=w.equalsEpsilon(n.y,s.y,void 0,u),P=t.z===r.z&&n.z===s.z,F=p.x===r.x,N=y.y<p.y,b=y.y-p.y+N*a,G=b>=l-f&&b<a-f,X=b>f&&b<l-f,W=b<=f,A=G||X||W,{shaderUniforms:k,shaderDefines:B}=this;for(let H in B)B.hasOwnProperty(H)&&(B[H]=void 0);let O=0;if(B.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,F||(B.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,B.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),k.cylinderRenderRadiusMinMax=D.fromElements(p.x,y.x,k.cylinderRenderRadiusMinMax),p.x===y.x&&(B.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!g){B.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let H=n.x-t.x,U=0,K=1;H!==0&&(U=1/H,K=-t.x/H),k.cylinderUvToShapeUvRadius=D.fromElements(U,K,k.cylinderUvToShapeUvRadius)}if(!P){B.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let H=n.z-t.z,U=0,K=1;H!==0&&(U=2/H,K=-(t.z+1)/H),k.cylinderUvToShapeUvHeight=D.fromElements(U,K,k.cylinderUvToShapeUvHeight)}if(k.cylinderRenderHeightMinMax=D.fromElements(p.z,y.z,k.cylinderRenderHeightMinMax),x&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),A&&(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,B.CYLINDER_INTERSECTION_INDEX_ANGLE=O,G?(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):X?(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):W&&(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),k.cylinderRenderAngleMinMax=D.fromElements(p.y,y.y,k.cylinderRenderAngleMinMax)),E){B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,I&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),v&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let H=(t.y-r.y)/a,U=(n.y-r.y)/a,K=1-S/a;if(k.cylinderShapeUvAngleMinMax=D.fromElements(H,U,k.cylinderShapeUvAngleMinMax),k.cylinderShapeUvAngleRangeZeroMid=(U+.5*K)%1,S<=f)k.cylinderUvToShapeUvAngle=D.fromElements(0,1,k.cylinderUvToShapeUvAngle);else{let Q=a/S,ie=-(t.y-r.y)/S;k.cylinderUvToShapeUvAngle=D.fromElements(Q,ie,k.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=O,!0};var KD=new m,W8=new m;V0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){C.typeOf.number("tileLevel",e),C.typeOf.number("tileX",t),C.typeOf.number("tileY",n),C.typeOf.number("tileZ",i),C.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=m.fromElements(w.lerp(r.x,s.x,t*a),w.lerp(r.y,s.y,n*a),w.lerp(r.z,s.z,i*a),KD),d=m.fromElements(w.lerp(r.x,s.x,(t+1)*a),w.lerp(r.y,s.y,(n+1)*a),w.lerp(r.z,s.z,(i+1)*a),W8);return w8(l,d,this.shapeTransform,o)};var WTe=new m;V0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){C.typeOf.object("spatialNode",e),C.typeOf.object("tileDimensions",t),C.typeOf.object("tileUv",n),C.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,WTe),s=m.multiplyByScalar(r,o,WTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,KD),o,KD),l=m.add(a,s,W8),d=this._minBounds,u=this._maxBounds,f=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),KD),p=m.fromElements(w.lerp(d.x,u.x,l.x),w.lerp(d.y,u.y,l.y),w.lerp(d.z,u.z,l.z),W8);return w8(f,p,this.shapeTransform,i)};V0.DefaultMinBounds=Object.freeze(new m(0,-w.PI,-1));V0.DefaultMaxBounds=Object.freeze(new m(1,+w.PI,1));var Gyt=5,Eyt=new Array(Gyt),Xyt=new m,Iyt=new te,Wyt=new M,wyt=new M,Pyt=new M,I8=new M,vyt=new m,Fyt=new m,Ayt=new m,vTe=new Array(8);for(let e=0;e<8;e++)vTe[e]=new m;function wTe(e,t,n){return Math.abs(ce.dot(e,t))<n}function Myt(e){let t=M.getColumn(e,0,vyt),n=M.getColumn(e,1,Fyt),i=M.getColumn(e,2,Ayt),o=w.EPSILON4;return wTe(t,n,o)&&wTe(n,i,o)}function Nyt(e,t){let n=vTe;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)M.multiplyByPoint(e,n[i],n[i]);return Xn.fromPoints(n,t)}function w8(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+w.TWO_PI:t.y,l=e.z,d=t.z,u=a-s,f=s+u*.5,p=Eyt,y=0;p[y++]=s,p[y++]=a,p[y++]=f,u>w.PI&&(p[y++]=f-w.PI_OVER_TWO,p[y++]=f+w.PI_OVER_TWO);let h=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let k=0;k<y;++k){let B=p[k]-f,O=Math.cos(B),H=Math.sin(B),U=O*o,K=H*o,Q=O*r,ie=H*r;h=Math.min(h,U,Q),g=Math.min(g,K,ie),x=Math.max(x,U,Q),S=Math.max(S,K,ie)}let V=x-h,Z=S-g,R=d-l,E=(h+x)*.5,I=(g+S)*.5,v=(l+d)*.5,P=m.fromElements(E,I,v,Xyt),F=te.fromRotationZ(f,Iyt),N=m.fromElements(V,Z,R,PTe),b=M.fromScale(N,Pyt),G=M.fromRotation(F,wyt),X=M.fromTranslation(P,Wyt),W=M.multiplyTransformation(G,M.multiplyTransformation(X,b,I8),I8),A=M.multiplyTransformation(n,W,I8);return Myt(A)?Xn.fromTransformation(A,i):Nyt(A,i)}var dS=V0;var Aji=_(T(),1);function L0(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ue,this.boundTransform=new M,this.shapeTransform=new M,this._rectangle=new de,this._minimumHeight=L0.DefaultMinBounds.z,this._maximumHeight=L0.DefaultMaxBounds.z,this._ellipsoid=new re,this._translation=new m,this._rotation=new te,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 kyt=new m,Uyt=new m,Oyt=new m,Dyt=new m,Byt=new m,Yyt=new m,Hyt=new m,zyt=new m,Kyt=new te,FTe=new m,ATe=new m,Jyt=new de;L0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=L0;i=i??r,o=o??s,C.typeOf.object("modelMatrix",e),C.typeOf.object("minBounds",t),C.typeOf.object("maxBounds",n);let a=w.EPSILON10,l=w.EPSILON3,d=w.EPSILON10,u=w.EPSILON10,f=w.EPSILON3,p=M.getScale(e,zyt),y=m.clone(r,kyt);y.z=-m.minimumComponent(p);let h=m.clamp(t,y,s,Uyt),g=m.clamp(n,y,s,Oyt),x=m.clamp(i,y,s,Dyt),S=m.clamp(o,y,s,Byt),V=m.maximumByComponent(h,x,Yyt),Z=m.minimumByComponent(g,S,Hyt),R=m.add(p,m.fromElements(g.z,g.z,g.z,FTe),FTe),E=m.maximumComponent(R),I=m.add(p,m.fromElements(Z.z,Z.z,Z.z,ATe),ATe);if(V.y>Z.y||V.y===s.y||Z.y===r.y||V.z>Z.z||w.equalsEpsilon(I,m.ZERO,void 0,a))return!1;this._rectangle=de.fromRadians(h.x,h.y,g.x,g.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(p,this._ellipsoid),this._minimumHeight=h.z,this._maximumHeight=g.z;let v=de.fromRadians(V.x,V.y,Z.x,Z.y,Jyt);this.orientedBoundingBox=P8(v,V.z,Z.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=M.fromRotationTranslation(te.setScale(this._rotation,R,Kyt),this._translation,this.shapeTransform),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ue.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,F=.5*P,N=Z.x<V.x,b=Z.x-V.x+N*P,G=b<=d,X=b>=F-d&&b<P-d,W=b>d&&b<F-d,A=G||X||W,k=g.x<h.x,B=g.x-h.x+k*P,O=B>F+d&&B<P-d,H=B>=F-d&&B<=F+d,U=B<F-d,K=O||H||U,Q=Z.y<-f,ie=Z.y>=-f&&Z.y<=+f,j=Z.y>+f&&Z.y<s.y-u,$=Q||ie||j,ne=V.y>r.y+u&&V.y<-f,be=V.y>=-f&&V.y<=+f,Ce=V.y>+f,me=ne||be||Ce,_e=$||me,Ve=g.y-h.y,Ie=g.y<-f,Ze=g.y>=-f&&g.y<=+f,De=g.y>+f&&g.y<s.y-u,Ke=Ie||Ze||De,rt=h.y>r.y+u&&h.y<-f,Xt=h.y>=-f&&h.y<=+f,Ht=h.y>+f,mn=Ke||(rt||Xt||Ht),{shaderUniforms:Dt,shaderDefines:Lt}=this;for(let bt in Lt)Lt.hasOwnProperty(bt)&&(Lt[bt]=void 0);Dt.ellipsoidRadiiUv=m.divideByScalar(R,E,Dt.ellipsoidRadiiUv);let{x:Vi,z:ln}=Dt.ellipsoidRadiiUv,ge=ln/Vi;Dt.eccentricitySquared=1-ge*ge,Dt.evoluteScale=D.fromElements((Vi*Vi-ln*ln)/Vi,(ln*ln-Vi*Vi)/ln,Dt.evoluteScale),Dt.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Dt.ellipsoidRadiiUv,Dt.ellipsoidRadiiUv,Dt.ellipsoidInverseRadiiSquaredUv),Dt.ellipsoidInverseRadiiSquaredUv);let Le=0;Lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Le,Le+=1,Lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Le,Le+=1,Dt.clipMinMaxHeight=D.fromElements((V.z-g.z)/E,(Z.z-g.z)/E,Dt.clipMinMaxHeight);let yn=(g.z-h.z)/E;if(Dt.ellipsoidInverseHeightDifferenceUv=1/yn,h.z===g.z&&(Dt.ellipsoidInverseHeightDifferenceUv=0),A&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Lt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Le,X?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Le+=1):W?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Le+=2):G&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Le+=2),Dt.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,Z.x,Dt.ellipsoidRenderLongitudeMinMax)),K)if(Lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,g.x<h.x&&(Lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),B<=d)Dt.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,Dt.ellipsoidUvToShapeUvLongitude);else{let ro=P/B,Xo=-(h.x-r.x)/B;Dt.ellipsoidUvToShapeUvLongitude=D.fromElements(ro,Xo,Dt.ellipsoidUvToShapeUvLongitude)}if(A){let bt=w.equalsEpsilon(V.x,r.x,void 0,l),ro=w.equalsEpsilon(Z.x,s.x,void 0,l);bt&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),ro&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Xo=(h.x-r.x)/P,ra=(g.x-r.x)/P,Wr=(Z.x-r.x)/P,_s=1-b/P,Ae=(Wr+.5*_s)%1;Dt.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(Xo,ra,Ae,Dt.ellipsoidShapeUvLongitudeMinMaxMid)}if(_e&&(me&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Le,ne?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Le+=1):be?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Le+=1):Ce&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Le+=2)),$&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Le,Q?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Le+=2):ie?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Le+=1):j&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Le+=1)),Dt.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(Z.y),Dt.ellipsoidRenderLatitudeSinMinMax)),mn)if(Lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ve<u)Dt.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,Dt.ellipsoidUvToShapeUvLatitude);else{let ro=(s.y-r.y)/Ve,Xo=(r.y-h.y)/Ve;Dt.ellipsoidUvToShapeUvLatitude=D.fromElements(ro,Xo,Dt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Le,!0};var kTe=new de;L0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){C.typeOf.number("tileLevel",e),C.typeOf.number("tileX",t),C.typeOf.number("tileY",n),C.typeOf.number("tileZ",i),C.typeOf.object("result",o);let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,l=n*r,d=(n+1)*r,u=i*r,f=(i+1)*r,p=de.subsection(this._rectangle,s,l,a,d,kTe),y=w.lerp(this._minimumHeight,this._maximumHeight,u),h=w.lerp(this._minimumHeight,this._maximumHeight,f);return P8(p,y,h,this._ellipsoid,this._translation,this._rotation,o)};var MTe=new m,NTe=new m,Qyt=new m;L0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){C.typeOf.object("spatialNode",e),C.typeOf.object("tileDimensions",t),C.typeOf.object("tileUv",n),C.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,MTe),s=m.multiplyByScalar(r,o,MTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,NTe),o,NTe),l=m.add(a,s,Qyt),d=de.subsection(this._rectangle,a.x,a.y,l.x,l.y,kTe),u=w.lerp(this._minimumHeight,this._maximumHeight,a.z),f=w.lerp(this._minimumHeight,this._maximumHeight,l.z);return P8(d,u,f,this._ellipsoid,this._translation,this._rotation,i)};function P8(e,t,n,i,o,r,s){return s=Xn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=te.multiply(s.halfAxes,r,s.halfAxes),s}L0.DefaultMinBounds=Object.freeze(new m(-w.PI,-w.PI_OVER_TWO,-re.WGS84.minimumRadius));L0.DefaultMaxBounds=Object.freeze(new m(w.PI,w.PI_OVER_TWO,10*re.WGS84.maximumRadius));var uS=L0;var ou={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};ou.getMinBounds=function(e){switch(e){case ou.BOX:return lS.DefaultMinBounds;case ou.ELLIPSOID:return uS.DefaultMinBounds;case ou.CYLINDER:return dS.DefaultMinBounds;default:throw new L(`Invalid shape type ${e}`)}};ou.getMaxBounds=function(e){switch(e){case ou.BOX:return lS.DefaultMaxBounds;case ou.ELLIPSOID:return uS.DefaultMaxBounds;case ou.CYLINDER:return dS.DefaultMaxBounds;default:throw new L(`Invalid shape type ${e}`)}};ou.getShapeConstructor=function(e){switch(e){case ou.BOX:return lS;case ou.ELLIPSOID:return uS;case ou.CYLINDER:return dS;default:throw new L(`Invalid shape type ${e}`)}};var La=Object.freeze(ou);var H4i=_(T(),1);var Kji=_(T(),1);function Yf(e){C.typeOf.object("options",e),C.defined("options.comparator",e.comparator),c(e.maximumLength)&&C.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=c(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Yf.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(c(e)){for(C.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Yf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Yf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Yf.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(c(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Yf.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)UTe(this,t)};Yf.prototype.insert=function(e){let t,n=this._maximumLength;if(c(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++,UTe(this,i),t};Yf.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],OTe(this,0)),this._array[e-1]=void 0,t};Yf.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=v8(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&OTe(this,n)}return this._array[e-1]=void 0,t};Yf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Yf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[v8(this,1,2)?1:2]};function JD(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function d9(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function v8(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function UTe(e,t){if(t===0)return;let n=Math.floor(w.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=d9(e,t,i);for(o!==n&&(JD(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(d9(e,t,r)!==o)break;JD(e,t,r),t=r}}function OTe(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){d9(e,s,r)===i&&(r=s);let a=2*o+1,l=Math.max(Math.min(n-a,4),0);for(let d=0;d<l;d++){let u=a+d;d9(e,u,r)===i&&(r=u)}}if(d9(e,r,t)===i&&(JD(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);v8(e,r,a)===i&&JD(e,r,a)}t=r}}var mS=Yf;var Qji=_(T(),1),F8=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function u9(e,t){this.spatialNode=e,this.keyframe=t,this.state=F8.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}u9.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=F8.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};u9.priorityComparator=function(e,t){return e.priority-t.priority};u9.searchComparator=function(e,t){return e.keyframe-t.keyframe};u9.LoadState=F8;var bo=u9;var p4i=_(T(),1);function Ag(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===At.UNSIGNED_SHORT&&(i=At.FLOAT32),i===At.FLOAT32&&!e.floatingPointTexture)throw new le("Floating point texture not supported");let s=jyt(i),a=qyt(n,e.webgl2),l=At.getSizeInBytes(i),d=$yt(o,n,l),u=Math.ceil(Math.sqrt(t.x)),f=Math.ceil(t.z/u),p=u*t.x,y=f*t.y,h=Math.floor(d/p),g=Math.floor(d/y);if(h===0||g===0)throw new le("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=l*n*d**2,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=h*g,this.regionCountPerMegatexture=new D(h,g),this.voxelCountPerRegion=new D(p,y),this.sliceCountPerRegion=new D(u,f),this.voxelSizeUv=new D(1/d,1/d),this.sliceSizeUv=new D(t.x/d,t.y/d),this.regionSizeUv=new D(p/d,y/d),this.texture=new Pt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d,height:d,sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR})});let x=At.toComponentDatatype(i);this.tileVoxelDataTemp=q.createTypedArray(x,p*y*n),this.nodes=new Array(this.maximumTileCount);for(let S=0;S<this.maximumTileCount;S++)this.nodes[S]=new egt(S);for(let S=0;S<this.maximumTileCount;S++){let V=this.nodes[S];V.previousNode=S>0?this.nodes[S-1]:void 0,V.nextNode=S<this.maximumTileCount-1?this.nodes[S+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function jyt(e){if(e===At.FLOAT32||e===At.FLOAT64)return Ue.FLOAT;if(e===At.UINT8)return Ue.UNSIGNED_BYTE}function qyt(e,t){if(e===1)return t?ke.RED:ke.LUMINANCE;if(e===2)return t?ke.RG:ke.LUMINANCE_ALPHA;if(e===3)return ke.RGB;if(e===4)return ke.RGBA}function $yt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(mt.maximumTextureSize,w.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function egt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Ag.prototype.add=function(e){if(this.isFull())throw new L("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,c(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,c(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Ag.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new L("Megatexture index out of bounds");let t=this.nodes[e];c(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),c(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,c(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Ag.prototype.isFull=function(){return this.emptyList===void 0};Ag.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===At.UNSIGNED_SHORT&&(i=At.FLOAT32);let o=At.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),l=s*t.x,d=a*t.y,u=w.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/l),y=Math.floor(u/d);if(p*y>=e)break;u*=2}return u*u*n*o};Ag.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:l}=this;for(let y=0;y<o.z;y++){let h=y%r.x*o.x,g=Math.floor(y/r.x)*o.y;for(let x=0;x<o.y;x++){let S=tgt(o,x,y),V=(g+x)*s.x+h;for(let Z=0;Z<o.x;Z++){let R=S+Z,E=V+Z;for(let I=0;I<a;I++)i[E*a+I]=n[R*a+I]}}}let d=e%l.x*s.x,u=Math.floor(e/l.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:d,yOffset:u};this.texture.copyFrom(p)};function tgt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}Ag.prototype.isDestroyed=function(){return!1};Ag.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),he(this)};var TL=Ag;var L4i=_(T(),1);function xm(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 Xn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var ngt=new m;xm.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=te.getScale(this.orientedBoundingBox.halfAxes,ngt),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};xm.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,l=s+1,d=r+1,u=a+1,f=t+1,p=[[f,r,s,a],[f,d,s,a],[f,r,l,a],[f,d,l,a],[f,r,s,u],[f,d,s,u],[f,r,l,u],[f,d,l,u]];this.children=p.map(([y,h,g,x])=>new xm(y,h,g,x,this,e,this.dimensions))};xm.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};xm.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 DTe={keyframe:0};function m9(e,t){return DTe.keyframe=e,Wo(t,DTe,bo.searchComparator)}xm.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;c(t);){let{renderableKeyframeNodes:f}=t;if(f.length>=1){let p=igt(i,f),y=f[p],h=o===i||i<y.keyframe?p:Math.min(p+1,f.length-1),g=f[h],x=i-y.keyframe,S=BTe(n-t.level,x);S<a&&(a=S,r=y);let V=g.keyframe-o,Z=BTe(n-t.level,V);if(Z<l&&(l=Z,s=g),x===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!c(r)||!c(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:w.clamp((e-d)/(u-d),0,1)};function igt(e,t){let n=m9(e,t);return n<0?w.clamp(~n-1,0,t.length-1):n}function BTe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}xm.prototype.isVisited=function(e){return this.visitedFrameNumber===e};xm.prototype.createKeyframeNode=function(e){let t=m9(e,this.keyframeNodes);if(t<0){t=~t;let n=new bo(this,e);this.keyframeNodes.splice(t,0,n)}};xm.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=m9(n,this.keyframeNodes);if(i<0)throw new L("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=m9(n,this.renderableKeyframeNodes);if(o<0)throw new L("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};xm.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new L("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=m9(e.keyframe,i);if(o>=0)throw new L("Keyframe already renderable");o=~o,i.splice(o,0,e)};xm.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return c(t)&&c(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var f9=xm;function Mg(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:l,componentTypes:d,metadataOrder:u}=o,f=m.add(r,s,new m);if(m.add(f,a,f),u===gm.Y_UP){let Z=f.y;f.y=f.z,f.z=Z}!c(i)&&c(o.maximumTileCount)&&(i=bgt(o.maximumTileCount,f,l,d)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(l.length);for(let Z=0;Z<l.length;Z++){let R=l[Z],E=lt.getComponentCount(R),I=d[Z];this.megatextures[Z]=new TL(t,f,E,I,i),this.textureMemoryByteLength+=this.megatextures[Z].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let y=e._shape;this.rootNode=new f9(0,0,0,0,void 0,y,r),this._priorityQueue=new mS({maximumLength:p,comparator:bo.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 h=this._binaryTreeKeyframeWeighting;h[0]=0,h[n-1]=0,A8(h,1,n-2,0);let g=9,x=2048,S=Math.floor(x/g),V=Math.ceil(p/S);this.internalNodeTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:x,height:V,sampler:new en({minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})}),this.internalNodeTilesPerRow=S,this.internalNodeTexelSizeUv=new D(1/x,1/V),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}Mg.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function A8(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,A8(e,t,o-1,i+1),A8(e,o+1,n,i+1)}Mg.simultaneousRequestCountMaximum=50;Mg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,l=o._levelBlendFactor,d=l>0,u=a>1,f=(d?2:1)*(u?2:1);this._sampleCount=f;let p=f>=2;if(p&&!c(this.leafNodeTexture)){let Z=Math.floor(512),R=Math.ceil(s/Z);this.leafNodeTexture=new Pt({context:r,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:R,sampler:new en({minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/R,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=Z}else!p&&c(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=w.clamp(t,0,a-1),n&&YTe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let y=Ti();sgt(this,e),agt(this,e);let h=Ti();mgt(this,f,l);let g=Ti(),x=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||x){let S=h-y,V=g-h,Z=g-y;ugt(this,e,S,V,Z)}};Mg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Mg.prototype.isDestroyed=function(){return!1};Mg.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(),he(this)};function YTe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),c(t.children))for(let n=0;n<8;n++){let i=t.children[n];YTe(e,i)}}function ogt(e,t){if(e._simultaneousRequestCount>=Mg.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(c(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=c(u)?bo.LoadState.PROCESSING:bo.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=bo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let l={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(l);c(d)&&(e._simultaneousRequestCount++,t.state=bo.LoadState.RECEIVING,d.then(s).catch(a))}function rgt(e){return e/(1+e)}function sgt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),HTe(e.rootNode,fs.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 agt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(cgt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,l=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===bo.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===bo.LoadState.UNLOADED&&ogt(e,u),u.state===bo.LoadState.PROCESSING)){let{content:f}=u;if(f.update(e._primitive,t),!f.ready)continue;if(!lgt(f.metadata,e)){u.content=void 0,u.state=bo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let y=o[p];e._primitive.tileUnload.raiseEvent(),y.spatialNode.destroyKeyframeNode(y,e.megatextures)}else p=i+l,l++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=bo.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function cgt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function lgt(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:l,z:d}=r,u=a*l*d,f=e[o],p=u*s;if(f.length!==p)return!1}return!0}function HTe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:l,frustum:d}=o,f=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(l,f),t=e.visibility(i,t),t===fs.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,y=p._shape,h=p.screenSpaceError,g=n._priorityQueue,x=n._keyframeCount,S=w.clamp(Math.floor(n._keyframeLocation),0,x-2),V=S+1;if(x===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==x)for(let v=0;v<x;v++)e.createKeyframeNode(v);let{screenSpaceError:Z,keyframeNodes:R}=e,E=rgt(Z),I=!1;for(let v=0;v<R.length;v++){let P=R[v];P.priority=10*E+dgt(S,P.keyframe,V,n),P.state!==bo.LoadState.UNAVAILABLE&&P.state!==bo.LoadState.FAILED&&P.priority!==-Number.MAX_VALUE&&g.insert(P),P.state===bo.LoadState.LOADED&&(I=!0)}if(Z<h||!I){e.children=void 0;return}c(e.children)||e.constructChildNodes(y);for(let v=0;v<8;v++){let P=e.children[v];HTe(P,t,n,i)}}function dgt(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 ugt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(bo.LoadState).length,l=new Array(a),d=new Array(a),u=0;for(let I=0;I<a;I++){let v=new Array(r).fill(0);l[I]=v,d[I]=0}function f(I){let v=I.keyframeNodes;for(let P=0;P<v.length;P++){let F=v[P],N=F.keyframe,b=F.state;l[b][N]+=1,d[b]+=1,u++}if(c(I.children))for(let P=0;P<8;P++){let F=I.children[P];f(F)}}f(s),e._primitive.statistics.numberOfTilesWithContentReady=d[bo.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[bo.LoadState.RECEIVING],y=d[bo.LoadState.PROCESSING],h=p!==e._primitive.statistics.numberOfPendingRequests||y!==e._primitive.statistics.numberOfTilesProcessing;if(h&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,y),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=y,h&&(p===0&&y===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 x=`KEYFRAMES: ${l[bo.LoadState.LOADED]}`,S=`UNLOADED: ${d[bo.LoadState.UNLOADED]} | RECEIVING: ${d[bo.LoadState.RECEIVING]} | PROCESSING: ${d[bo.LoadState.PROCESSING]} | LOADED: ${d[bo.LoadState.LOADED]} | FAILED: ${d[bo.LoadState.FAILED]} | UNAVAILABLE: ${d[bo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,V=Math.round(n*100)/100,Z=Math.round(i*100)/100,R=Math.round(o*100)/100,E=`LOAD: ${V} | OCT: ${Z} | ALL: ${R}`;console.log(`${x} || ${S} || ${E}`)}var QD={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function mgt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,l=0,d=[],u=[];function f(y,h,g,x,S){let V=!1;if(c(y.children))for(let Z=0;Z<8;Z++){let R=y.children[Z];R.computeSurroundingRenderableKeyframeNodes(o),R.isRenderable(r)&&(V=!0)}if(V){d[S]=QD.INTERNAL<<16|h,d[g]=x,a++,x=h,S=x*9+1;for(let Z=0;Z<8;Z++){let R=y.children[Z];h=a,g=h*9+0,f(R,h,g,x,S+Z)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let Z=l*5,R=y.renderableKeyframeNodePrevious,E=y.level-R.spatialNode.level,I=R.spatialNode.parent,v=c(I)?I.renderableKeyframeNodePrevious:R,P=fgt(y,i,n),F=E,N=1,b=R.megatextureIndex,G=v.megatextureIndex;u[Z+0]=P,u[Z+1]=F,u[Z+2]=N,u[Z+3]=b,u[Z+4]=G,d[S]=QD.LEAF<<16|l}else{let Z=y.renderableKeyframeNodePrevious,E=y.level-Z.spatialNode.level===0?QD.LEAF:QD.PACKED_LEAF_FROM_PARENT;d[S]=E<<16|Z.megatextureIndex}l++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&f(p,0,0,0,0),hgt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&pgt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function fgt(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 hgt(e,t,n,i){let o=ke.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)),l=new Uint8Array(s*a*o);for(let f=0;f<e.length;f++){let p=e[f],y=f*o;for(let h=0;h<o;h++)l[y+h]=p>>>h*8&255}let u={source:{arrayBufferView:l,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function pgt(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),l=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*l*o);for(let p=0;p<s;p++){let y=e[p*r+0],h=e[p*r+1],g=e[p*r+2],x=e[p*r+3],S=e[p*r+4],V=w.clamp(Math.floor(65536*y),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=h&255,d[p*8+3]=g&255,d[p*8+4]=x>>>0&255,d[p*8+5]=x>>>8&255,d[p*8+6]=S>>>0&255,d[p*8+7]=S>>>8&255}let f={source:{arrayBufferView:d,width:a,height:l},xOffset:0,yOffset:0};i.copyFrom(f)}function bgt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=i[s],d=lt.getComponentCount(a);o+=TL.getApproximateTextureMemoryByteLength(e,t,d,l)}return o}var h9=Mg;function fp(e){e=e??z.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??fp.DefaultProvider,this._traversal=void 0,this._statistics=new pf,this._calculateStatistics=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=M.clone(e.modelMatrix??M.IDENTITY),this._exaggeratedModelMatrix=M.clone(this._modelMatrix),this._compoundModelMatrix=new M,this._compoundModelMatrixOld=new M,this._customShader=e.customShader??fp.DefaultCustomShader,this._customShaderCompilationEvent=new ye,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new M,this._transformPositionUvToWorld=new M,this._transformDirectionWorldToLocal=new te,this._transformNormalLocalToWorld=new te,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new df,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 M,transformPositionUvToView:new M,transformDirectionViewToLocal:new te,transformNormalLocalToWorld:new te,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new ce,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,stepSize:0,pickColor:new Y},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 ye,this.tileVisible=new ye,this.tileFailed=new ye,this.tileUnload=new ye,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye;let i=this._provider;ygt(this,i)}function ygt(e,t){let{shape:n,minBounds:i=La.getMinBounds(n),maxBounds:o=La.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=M.clone(e._modelMatrix,e._exaggeratedModelMatrix),KTe(e,t);let r=La.getShapeConstructor(n);e._shape=new r,e._shapeVisible=JTe(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){C.typeOf.object("modelMatrix",e),this._modelMatrix=M.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){C.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){C.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){C.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){C.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){C.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){C.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=w.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){C.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){C.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){C.defined("minBounds",e),this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){C.defined("maxBounds",e),this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){C.defined("minClippingBounds",e),this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){C.defined("maxClippingBounds",e),this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.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];c(e)?this._customShader=e:this._customShader=fp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ggt=new ce,xgt=new ce,_gt=new m,Tgt=new m,Sgt=new te,Cgt=new te,Vgt=new M,Lgt=new M,Zgt=new M,Rgt=M.fromRotationTranslation(te.fromUniformScale(.5,new te),new m(.5,.5,.5),new M),Ggt=M.fromRotationTranslation(te.fromUniformScale(2,new te),new m(-1,-1,-1),new M);fp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Pgt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Wgt(this,e);let i=KTe(this,t),o=this._shape;if(i&&(this._shapeVisible=JTe(this,o,t),Fgt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Agt(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&&Ygt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Mgt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;c(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(s9(this,n),this._shaderDirty=!1);let f=n.uniformState.viewProjection,p=o.orientedBoundingBox,y=Ugt(p,f,xgt);if(y.x===1||y.y===1||y.z===-1||y.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=ce.clone(y,u.ndcSpaceAxisAlignedBoundingBox);let g=n.uniformState.inverseView;u.transformPositionViewToUv=M.multiplyTransformation(this._transformPositionWorldToUv,g,u.transformPositionViewToUv);let x=n.uniformState.view;u.transformPositionUvToView=M.multiplyTransformation(x,this._transformPositionUvToWorld,u.transformPositionUvToView);let S=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=te.multiply(this._transformDirectionWorldToLocal,S,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=te.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=M.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let Z=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;Z.boundingVolume=o.boundingSphere,e.commandList.push(Z)};var Egt=new m,M8=new m,Xgt=new pe,Igt=new m;function Wgt(e,t){if(e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===La.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{let n=m.fromElements(1,1,t.verticalExaggeration,Egt);e._exaggeratedModelMatrix=M.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=M.multiplyByTranslation(e._exaggeratedModelMatrix,wgt(e,t),e._exaggeratedModelMatrix)}}function wgt(e,t){let{shapeTransform:n=M.IDENTITY,globalTransform:i=M.IDENTITY}=e._provider,o=M.getTranslation(n,M8),r=M.multiplyByPoint(e._modelMatrix,o,M8),s=M.multiplyByPoint(i,r,M8),l=re.WGS84.cartesianToCartographic(s,Xgt),d=0;c(l)&&(d=l.height);let u=Lr.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return m.fromElements(0,0,(u-d)/t.verticalExaggeration,Igt)}function Pgt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=Y.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=He(o,!0);let s=e._uniformMap;for(let l in r)if(r.hasOwnProperty(l)){let d=`u_${l}`;c(s[d])&&ht(`VoxelPrimitive: Uniform name "${d}" is already defined`),s[d]=function(){return r[l]}}if(e._dimensions=m.clone(t.dimensions,e._dimensions),i.dimensions=m.clone(e._dimensions,i.dimensions),e._paddingBefore=m.clone(t.paddingBefore??m.ZERO,e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(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===gm.Y_UP){let l=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=l}i.inputDimensions=m.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new h9(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,vgt(e._traversal,i)}function KTe(e,t){let n=t.shapeTransform??M.IDENTITY,i=t.globalTransform??M.IDENTITY;return M.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),M.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),fS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+fS(e,"_minBounds","_minBoundsOld")+fS(e,"_maxBounds","_maxBoundsOld")+fS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+fS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+fS(e,"_minClippingBounds","_minClippingBoundsOld")+fS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function fS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function JTe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=M.inverse(o,Vgt),s=M.getRotation(o,Sgt),a=M.getScale(o,_gt),l=m.maximumComponent(a),d=m.divideByScalar(a,l,Tgt),u=te.multiplyByScale(s,d,Cgt);return e._transformPositionWorldToUv=M.multiplyTransformation(Rgt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=M.multiplyTransformation(o,Ggt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=M.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=te.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function vgt(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 Fgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=He(n,!0)),i}function Agt(e,t){if(!c(e)||!c(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=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/r;return o+a}function Mgt(e,t){let n=e.clippingPlanes;if(!c(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.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;c(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return c(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(),he(this)};var zTe=new Array(new ce(-1,-1,-1,1),new ce(1,-1,-1,1),new ce(-1,1,-1,1),new ce(1,1,-1,1),new ce(-1,-1,1,1),new ce(1,-1,1,1),new ce(-1,1,1,1),new ce(1,1,1,1)),Ngt=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),kgt=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function Ugt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,Lgt),o=M.multiply(t,i,Zgt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,l=-Number.MAX_VALUE,d,u=kgt,f=zTe.length;for(d=0;d<f;d++)M.multiplyByVector(o,zTe[d],u[d]);for(d=0;d<f;d++){let p=u[d];if(p.z>=-p.w){let y=p.x/p.w,h=p.y/p.w;r=Math.min(r,y),s=Math.max(s,y),a=Math.min(a,h),l=Math.max(l,h)}else for(let y=0;y<3;y++){let h=Ngt[d*3+y],g=u[h];if(g.z>=-g.w){let x=p.z+p.w,S=g.z+g.w,V=x/(x-S),Z=ce.lerp(p,g,V,ggt),R=Z.x/Z.w,E=Z.y/Z.w;r=Math.min(r,R),s=Math.max(s,R),a=Math.min(a,E),l=Math.max(l,E)}}}return r=w.clamp(r,-1,1),a=w.clamp(a,-1,1),s=w.clamp(s,-1,1),l=w.clamp(l,-1,1),n=ce.fromElements(r,a,s,l,n),n}var N8=3e7,Ogt=new m(N8,0,0),Dgt=new m(0,N8,0),Bgt=new m(0,0,N8);function Ygt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(l,d,u,f){i.add({positions:[l,d],width:f,material:zi.fromType("Color",{color:u})})}function r(l,d,u){let f=l.computeCorners();o(f[0],f[1],d,u),o(f[2],f[3],d,u),o(f[4],f[5],d,u),o(f[6],f[7],d,u),o(f[0],f[2],d,u),o(f[4],f[6],d,u),o(f[1],f[3],d,u),o(f[5],f[7],d,u),o(f[0],f[4],d,u),o(f[2],f[6],d,u),o(f[1],f[5],d,u),o(f[3],f[7],d,u)}function s(l){if(!n.isRenderable(l))return;let d=l.level,f=Math.max(1,5/Math.pow(2,d)),y=[Y.RED,Y.LIME,Y.BLUE][d%3];if(r(l.orientedBoundingBox,y,f),c(l.children))for(let h=0;h<8;h++)s(l.children[h])}r(e._shape.orientedBoundingBox,Y.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,Ogt,Y.RED,a),o(m.ZERO,Dgt,Y.LIME,a),o(m.ZERO,Bgt,Y.BLUE,a),i.update(t)}fp.DefaultCustomShader=new aS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;var JPo=x(T(),1),_U=`uniform sampler2D colorTexture; +uniform sampler2D silhouetteTexture; +in vec2 v_textureCoordinates; +void main(void) { - material.diffuse = vec3(1.0); - material.alpha = 1.0; -}`});function QTe(){this.ready=!0,this.shape=La.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[lt.SCALAR],this.componentTypes=[At.FLOAT32],this.maximumTileCount=1}QTe.prototype.requestData=function(e){if((c(e)?e.tileLevel??0:0)>=1)return;let n=new cS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};fp.DefaultProvider=new QTe;var Ng=fp;var R8i=_(T(),1);function Hgt(e,t,n,i){if(!c(e)||c(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!c(r))return;let a=(r.properties||{})[i];if(c(a))return a}var p9=Hgt;var E8i=_(T(),1);function zgt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var b9=zgt;var W8i=_(T(),1);function Kgt(e,t,n){if(!c(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(c(a))return a}}var y9=Kgt;var qD=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function li(e){e=e??z.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=He(e.contextOptions);if(!c(t))throw new L("options and options.canvas are required.");let r=c(n),s=new lE(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)),c(i)||(i=t.parentNode),this._id=Hn(),this._jobScheduler=new KF,this._frameState=new HF(s,new AF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new bZ(s),this._ellipsoid=e.ellipsoid??re.default,this._globe=void 0,this._globeTranslucencyState=new zF,this._primitives=new al,this._groundPrimitives=new al,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 tS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new DF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new Y,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:Oe.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new wA(this),this._preUpdate=new ye,this._postUpdate=new ye,this._renderError=new ye,this._preRender=new ye,this._postRender=new ye,this._minimumDisableDepthTestDistance=0,this._debugInspector=new OA,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ye,this.morphComplete=new ye,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=Y.clone(Y.BLACK),this._mode=se.SCENE3D,this._mapProjection=c(e.mapProjection)?e.mapProjection:new Xi(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 C_,this.fog=new YF,this.fog.enabled=re.WGS84.equals(this._ellipsoid),re.WGS84.equals(this._ellipsoid)||(oo.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new oo(this),this.shadowMap=new g0({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=Y.clone(Y.WHITE),this._actualInvertClassificationColor=Y.clone(this._invertClassificationColor),this._invertClassification=new fL,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new XA,this._brdfLutGenerator=new IF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new AA(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??ed.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=ic.requestCompletedEvent.addEventListener(qD(this)),this._removeTaskProcessorListenerCallback=gi.taskCompletedEvent.addEventListener(qD(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new je(0,0,s.drawingBufferWidth,s.drawingBufferHeight),l=new oo(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new oo(this),this.preloadFlightCullingVolume=void 0,this._picking=new cA(this),this._defaultView=new zT(this,l,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,tSe(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}li.defaultLogDepthBuffer=!0;function Jgt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];c(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(qD(e))),n.push(t.terrainProviderChanged.addEventListener(qD(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 mt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return mt.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 Bm.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,Jgt(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(c(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(c(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),c(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(c(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){if(this.scene3DOnly&&e!==se.SCENE3D)throw new L("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===se.SCENE2D)this.morphTo2D(0);else if(e===se.SCENE3D)this.morphTo3D(0);else if(e===se.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new L("value must be a valid SceneMode enumeration.");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){if(this.camera.frustum instanceof sn)throw new L("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new oo(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new BF(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){if(!c(e)||e<0)throw new L("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");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,mt.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 Qgt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function jTe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,l=t.derivedCommands;c(t.pickId)&&(l.picking=rp.createPickDerivedCommand(e,t,o,l.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,c(t.pickedMetadataInfo)&&(l.pickingMetadata=rp.createPickMetadataDerivedCommand(e,t,o,l.pickingMetadata))),t.pickOnly||(l.depth=rp.createDepthOnlyDerivedCommand(e,t,o,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=rp.createHdrCommand(t,o,l.hdr),t=l.hdr.command,l=t.derivedCommands),a&&t.receiveShadows&&(l.shadows=g0.createReceiveDerivedCommand(s,t,n,o,l.shadows)),t.pass===Xe.TRANSLUCENT&&c(r)&&r.isSupported()&&(a&&t.receiveShadows?(l.oit=c(l.oit)?l.oit:{},l.oit.shadows=r.createDerivedCommands(l.shadows.receiveCommand,o,l.oit.shadows)):l.oit=r.createDerivedCommands(t,o,l.oit))}li.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!c(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 l=this._hdr,d=c(t.logDepth),u=c(t.hdr),f=c(t.originalCommand),p=o&&!d,y=l&&!u,h=(!o||!l)&&!f,g=n.pickingMetadata&&Qgt(e,n);if(e.dirty=e.dirty||p||y||h||g,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:x,shadowMaps:S}=i;x&&e.castShadows&&(t.shadows=g0.createCastDerivedCommand(S,e,s,r,t.shadows)),(d||p)&&(t.logDepth=rp.createLogDepthCommand(e,r,t.logDepth),jTe(this,t.logDepth.command,s)),(f||h)&&jTe(this,e,s)};var jgt=new hm({pass:Fo.RENDER}),k8=new hm({pass:Fo.PRELOAD}),U8=new hm({pass:Fo.PRELOAD_FLIGHT}),qgt=new hm({pass:Fo.REQUEST_RENDER_MODE_DEFER_CHECK}),qTe=new ue,O8;function $gt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return qTe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,O8=EF.fromBoundingSphere(qTe,e.camera.positionWC,O8),O8}li.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function tSe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.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=$gt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof sn||this.camera.frustum instanceof Oo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;c(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,c(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=Y.clone(this.invertClassificationColor,this._actualInvertClassificationColor),fL.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,c(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(!c(t))return!1;let{boundingVolume:i}=t;return!c(i)||!t.cull?!0:e.computeVisibility(i)===zt.OUTSIDE?!1:!c(n)||!t.occlude||!i.isOccluded(n)};var jD=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);jD=M.inverseTransformation(jD,jD);function ext(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==se.SCENE3D){a=M.multiplyByPoint(jD,a,a);let h=o.mapProjection,g=h.unproject(a);a=h.ellipsoid.cartographicToCartesian(g)}let l,d,{radius:u}=s;c(u)?(l=Js.createGeometry(new Js({radii:new m(u,u,u),vertexFormat:an.FLAT_VERTEX_FORMAT})),d=M.fromTranslation(a)):(l=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT})),d=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new In({geometryInstances:new Rt({geometry:An.toWireframe(l),modelMatrix:d,attributes:{color:new Yt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1});let f=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=rp.createLogDepthCommand(e,r).command);let y;c(i)&&(y=n.framebuffer,n.framebuffer=i),e.execute(r,n),c(y)&&(n.framebuffer=y),o.commandList=f}function hp(e,t,n,i){let o=t._frameState,r=t._context;if(c(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&c(e.boundingVolume)&&ext(e,t,n,i),o.useLogDepth&&c(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&c(e.derivedCommands)&&c(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&c(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&c(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(c(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&&c(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function $Te(e,t,n){let{derivedCommands:i}=e;if(!c(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&c(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:l}=e.derivedCommands;c(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),c(s)?(e=s.pickCommand,e.execute(r,n)):c(l)&&(e=l.depthOnlyCommand,e.execute(r,n))}function nSe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function txt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+w.EPSILON12}function nxt(e,t,n,i,o){h0(i,nSe,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ixt(e,t,n,i,o){h0(i,txt,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function oxt(e,t,n){e.context.uniformState.updatePass(Xe.VOXELS);let i=n.commands[Xe.VOXELS];i.length=n.indices[Xe.VOXELS],h0(i,nSe,e.camera.positionWC);for(let o=0;o<i.length;++o)hp(i[o],e,t)}var rxt=new Ci,sxt=new hl,axt=new sn,cxt=new Oo;function lxt(e){let{frustum:t}=e;return c(t.fov)?t.clone(rxt):c(t.infiniteProjectionMatrix)?t.clone(sxt):c(t.width)?t.clone(axt):t.clone(cxt)}function dxt(e){if(e._environmentState.useOIT){if(!c(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?nxt:ixt}function uxt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,l;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=e._invertClassification);let d=dxt(e);o.uniformState.updatePass(Xe.TRANSLUCENT);let u=n.commands[Xe.TRANSLUCENT];u.length=n.indices[Xe.TRANSLUCENT],d(e,hp,t,u,l)}function mxt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Xe.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Xe.TRANSLUCENT];i.executeTranslucentCommands(e,hp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,hp,t,n)}function B8(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=lxt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,l=a.pick||a.pickVoxel;l||fxt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:f,useGlobeDepthFramebuffer:p,useInvertClassification:y,usePostProcessSelected:h}=e._environmentState,{globeDepth:g,globeTranslucencyFramebuffer:x,sceneFramebuffer:S,frustumCommandsList:V}=e._view,Z=V.length,R=e._globeTranslucencyState,E=e._depthClearCommand,I=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,F=n.position.z;function N(G,X){r.updatePass(X);let W=G.commands[X],A=G.indices[X];for(let k=0;k<A;++k)hp(W[k],e,t);return A}function b(G,X){r.updatePass(X);let W=G.commands[X],A=G.indices[X];for(let k=0;k<A;++k)$Te(W[k],e,t)}for(let G=0;G<Z;++G){let X=Z-G-1,W=V[X];e.mode===se.SCENE2D?(n.position.z=F-W.near+1,s.far=Math.max(1,W.far-W.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=X!==0?W.near*e.opaqueFrustumNearOffset:W.near,s.far=W.far,r.updateFrustum(s)),E.execute(i,t),i.stencilBuffer&&I.execute(i,t),R.translucent?(r.updatePass(Xe.GLOBE),R.executeGlobeCommands(W,hp,x,e,t)):N(W,Xe.GLOBE),p&&g.executeCopyDepth(i,t),u||(R.translucent?(r.updatePass(Xe.TERRAIN_CLASSIFICATION),R.executeGlobeClassificationCommands(W,hp,x,e,t)):N(W,Xe.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),f&&P.execute(i,t));let A;if(!y||l||u)A=N(W,Xe.CESIUM_3D_TILE),A>0&&(p&&(g.prepareColorTextures(i,d),g.executeUpdateDepth(i,t,g.depthStencilTexture)),u||(A=N(W,Xe.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let B=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,A=N(W,Xe.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),g.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),A=N(W,Xe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=B,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),A>0&&i.stencilBuffer&&v.execute(i,t),A=N(W,Xe.CESIUM_3D_TILE_CLASSIFICATION)}if(A>0&&i.stencilBuffer&&I.execute(i,t),oxt(e,t,W),N(W,Xe.OPAQUE),X!==0&&e.mode!==se.SCENE2D&&(s.near=W.near,r.updateFrustum(s)),uxt(e,t,W),mxt(e,t,W),i.depthTexture&&e.useDepthPicking&&(p||u)){let B=e._picking.getPickDepth(e,X);B.update(i,g.depthStencilTexture),B.executeCopyDepth(i,t)}if(l||!h)continue;let k=t.framebuffer;t.framebuffer=S.getIdFramebuffer(),s.near=X!==0?W.near*e.opaqueFrustumNearOffset:W.near,s.far=W.far,r.updateFrustum(s),R.translucent?(r.updatePass(Xe.GLOBE),R.executeGlobeCommands(W,$Te,x,e,t)):b(W,Xe.GLOBE),d&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),d&&f&&P.execute(i,t),b(W,Xe.CESIUM_3D_TILE),b(W,Xe.OPAQUE),b(W,Xe.TRANSLUCENT),t.framebuffer=k}}function fxt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Xe.ENVIRONMENT),c(i.skyBoxCommand)&&hp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&hp(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 iSe(e){e.context.uniformState.updatePass(Xe.COMPUTE);let t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function hxt(e,t){e.context.uniformState.updatePass(Xe.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function pxt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Xe.GLOBE,Xe.CESIUM_3D_TILE,Xe.OPAQUE,Xe.TRANSLUCENT];for(let l=0;l<t.length;++l){let d=t[l];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 f=s-1;f>=0;--f){let p=r[f].cullingVolume;if(e.isVisible(p,d))r[f].commandList.push(d),u=!0;else if(u)break}}}}function oSe(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 l=o[a];if(l.outOfView)continue;let{passes:d}=l;for(let u=0;u<d.length;++u)d[u].commandList.length=0;pxt(e,n,l);for(let u=0;u<d.length;++u){let f=l.passes[u],{camera:p,commandList:y}=f;s.updateCamera(p),l.updatePass(r,u);for(let h=0;h<y.length;++h){let g=y[h];s.updatePass(g.pass);let x=g.derivedCommands.shadows.castCommands[a];hp(x,e,f.passState)}}}}var bxt=new m;li.prototype.updateAndExecuteCommands=function(e,t){Ext(this,e,t),this._environmentState.useWebVR?yxt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===ed.ROTATE?kg(!0,this,e):Zxt(this,e)};function yxt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;rSe(e),n.createPotentiallyVisibleSet(e),iSe(e),r||oSe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=oo.clone(i,e._cameraVR);a.frustum=i.frustum;let l=i.frustum.near,d=l*(e.focalLength??5),u=e.eyeSeparation??d/30,f=m.multiplyByScalar(a.right,u*.5,bxt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*l/d;m.add(a.position,f,i.position),i.frustum.xOffset=p,B8(e,t),s.x=s.width,m.subtract(a.position,f,i.position),i.frustum.xOffset=-p,B8(e,t),oo.clone(a,i)}var gxt=new pe(Math.PI,w.PI_OVER_TWO),xxt=new m,_xt=new m,Txt=new M,Sxt=new M,Cxt=new m,Vxt=new m,Lxt=new je;function Zxt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=je.clone(r,Lxt);t.viewport=s;let a=gxt,l=xxt;e.mapProjection.project(a,l);let u=m.clone(i.position,_xt),f=M.clone(i.transform,Sxt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let y=M.computeViewportTransformation(s,0,1,Txt),h=i.frustum.projectionMatrix,g=i.positionWC.y,x=m.fromElements(w.sign(g)*l.x-g,0,-i.positionWC.x,Cxt),S=wt.pointToGLWindowCoordinates(h,y,x,Vxt);S.x=Math.floor(S.x);let V=s.x,Z=s.width;if(g===0||S.x<=V||S.x>=V+Z)kg(!0,e,t);else if(Math.abs(V+Z*.5-S.x)<1)s.width=S.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),kg(!0,e,t),s.x=S.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),kg(!1,e,t);else if(S.x>V+Z*.5){s.width=S.x-V;let R=i.frustum.right;i.frustum.right=l.x-g,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!0,e,t),s.x=S.x,s.width=V+Z-S.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),kg(!1,e,t)}else{s.x=S.x,s.width=V+Z-S.x;let R=i.frustum.left;i.frustum.left=-l.x-g,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!0,e,t),s.x=V,s.width=S.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),kg(!1,e,t)}i._setTransform(f),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function kg(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),rSe(t),i.createPotentiallyVisibleSet(t),e&&(iSe(t),o||oSe(t)),B8(t,n)}var eSe=new fs;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,l=this._globeTranslucencyState;if(!i||this._mode!==se.SCENE2D&&t.camera.frustum instanceof sn||!l.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(c(s)){if(c(a))s.setDynamicLighting(rb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let S=r.dynamicLighting;s.setDynamicLighting(S),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),c(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=c(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=c(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=c(x)?x.drawCommand:void 0,n.sunComputeCommand=c(x)?x.computeCommand:void 0,n.moonCommand=c(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=c(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===se.SCENE2D);(n.useDepthPlane=d&&this.mode===se.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==se.SCENE2D&&!o;let f=e.mode===se.SCENE3D&&!l.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,y=eSe.planes;for(let x=0;x<5;++x)y[x]=p.planes[x];p=eSe,n.isSkyAtmosphereVisible=c(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,f),n.isMoonVisible=this.isVisible(p,n.moonCommand,f);let h=this.specularEnvironmentMaps,g=this._specularEnvironmentCubeMap;c(h)&&g?.url!==h?(g=g&&g.destroy(),this._specularEnvironmentCubeMap=new Bm(h)):!c(h)&&c(g)&&(g.destroy(),this._specularEnvironmentCubeMap=void 0),c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Rxt(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),c(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Gxt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===se.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 l=o[a];l.update(t),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function rSe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Rxt(e),Gxt(e),e._globe&&e._globe.render(t)}function Ext(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,l=a.pick||a.pickVoxel;c(s.globeDepth)&&(s.globeDepth.picking=l);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new kA:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;Y.clone(n,u.color),u.execute(i,t);let f=r.useGlobeDepthFramebuffer=c(s.globeDepth);f&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,y=r.useOIT=!l&&c(p)&&p.isSupported();y&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let h=e.postProcessStages,g=r.usePostProcess=!l&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(r.usePostProcessSelected=!1,g&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,o.useLogDepth,e._hdr),h.clear(i),g=r.usePostProcess=h.ready,r.usePostProcessSelected=g&&h.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):f?t.framebuffer=s.globeDepth.framebuffer:g&&(t.framebuffer=s.sceneFramebuffer.framebuffer),c(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!l&&c(t.framebuffer)&&e.invertClassification){let S;if(o.invertClassificationColor.alpha===1&&f&&(S=s.globeDepth.framebuffer),c(S)||i.depthTexture){if(e._invertClassification.previousFramebuffer=S,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&y){let V=e._invertClassification.unclassifiedCommand,Z=V.derivedCommands;Z.oit=p.createDerivedCommands(V,i,Z.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;c(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:l,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=l?f.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l){i.sceneFramebuffer.prepareColorTextures(t);let y=f;a&&!s&&(y=u);let h=this.postProcessStages,g=y.getColorTexture(0),x=p.getColorTexture(0),S=(u??f).getDepthStencilTexture();h.execute(t,g,S,x),h.copy(t,d)}!s&&!l&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function Xxt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function Ixt(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function sSe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof al){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=sSe(s,t,n);c(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(c(o)&&o>i)return o}return i}li.prototype.getHeight=function(e,t){if(!c(e))return;let n=t===ze.CLAMP_TO_TERRAIN||t===ze.RELATIVE_TO_TERRAIN,i=t===ze.CLAMP_TO_3D_TILE||t===ze.RELATIVE_TO_3D_TILE;if(!c(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=sSe(this.primitives,e,this);c(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&c(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var D8=new pe;li.prototype.updateHeight=function(e,t,n){C.typeOf.func("callback",t);let i=this._ellipsoid,o=y=>{pe.clone(e,D8);let h;c(y)&&(h=y.height),c(h)||(h=this.getHeight(e,n)),c(h)&&(D8.height=h,t(D8))},r=n===ze.CLAMP_TO_TERRAIN||n===ze.RELATIVE_TO_TERRAIN,s=n===ze.CLAMP_TO_3D_TILE||n===ze.RELATIVE_TO_3D_TILE,a;!s&&c(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let l={},d=y=>{if(r||y.isDestroyed()||!y.isCesium3DTileset)return;let h=y.updateHeight(e,o,i);l[y.id]=h};if(!r){let y=this.primitives.length;for(let h=0;h<y;++h){let g=this.primitives.get(h);d(g)}}let u=this.primitives.primitiveAdded.addEventListener(d),f=this.primitives.primitiveRemoved.addEventListener(y=>{y.isDestroyed()||!y.isCesium3DTileset||(c(l[y.id])&&l[y.id](),delete l[y.id])});return()=>{a=a&&a(),Object.values(l).forEach(y=>y()),l={},u(),f()}};function Wxt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!c(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===se.SCENE2D||n===se.MORPHING)return!1;let r=e._globeHeight;return c(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){c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=Ixt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Wxt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function wxt(e,t){if(e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new p0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Pxt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),c(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function vxt(e){e.primitives.postPassesUpdate(e._frameState),ic.update()}var Fxt=new Y;function Axt(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=jgt;let r=e.backgroundColor??Y.BLACK;e._hdr&&(r=Y.clone(r,Fxt),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;c(s)&&s.enabled&&(!c(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 l=o.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=je.clone(a,l.viewport),c(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,r),e.resolveFramebuffers(l),l.framebuffer=void 0,hxt(e,l),c(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function hS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Mxt(e){return e._picking.updateMostDetailedRayPicks(e)}li.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,c(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===se.MORPHING;if(!i&&c(this.maximumRenderTimeChange)&&c(this._lastRenderTime)){let o=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=w.incrementWrap(t.frameNumber,15e6,1);tSe(this,o,e),t.newFrame=!0}hS(this,Pxt),this.primitives.show&&(hS(this,Mxt),hS(this,Nxt),hS(this,kxt),i||hS(this,Uxt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),hS(this,Axt)),wxt(this,i),hS(this,vxt),Xxt(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(mt.minimumAliasedLineWidth,Math.min(e,mt.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(!c(i))return;let o=i.primitive;if(!(o instanceof Ng))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!c(a))return;let l=255*r[2]+r[3];return DA.fromKeyframeNode(o,s,l,a)};li.prototype.pickMetadata=function(e,t,n,i){C.typeOf.object("windowPosition",e),C.typeOf.string("className",n),C.typeOf.string("propertyName",i);let o=this.pick(e);if(!c(o))return;let r=o.detail?.model?.structuralMetadata;if(!c(r))return;let s=r.schema,a=p9(s,t,n,i);if(!c(a))return;let l=y9(r,n,i);if(!c(l))return;let d=new b9(t,n,i,a,l);return this._picking.pickMetadata(this,e,d)};li.prototype.pickMetadataSchema=function(e){C.typeOf.object("windowPosition",e);let t=this.pick(e);return c(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 Nxt(e){let t=e._frameState;k8.camera=t.camera,k8.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,k8)}function kxt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;U8.camera=e.preloadFlightCamera,U8.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,U8)}function Uxt(e){e.primitives.updateForPass(e._frameState,qgt)}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 Oi.worldToWindowCoordinates(this,e,t)};li.prototype.completeMorph=function(){this._transitioner.completeMorph()};li.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};li.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};li.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function Oxt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){c(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{c(e)&&c(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}li.prototype.setTerrain=function(e){return C.typeOf.object("terrain",e),Oxt(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(),c(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,c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),he(this)};var g9=li;var w6i=_(T(),1);function SL(e){e=e??re.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new et({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(SL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});SL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Y8=new M;SL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==se.SCENE3D&&n!==se.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,Y8),o=M.multiplyTransformation(i,Po.Y_UP_TO_Z_UP,Y8),r=M.multiply(this._scaleMatrix,o,Y8);M.clone(r,this._modelMatrix);let s=e.context,a=Dxt(this),l=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||l||!c(t)||!t.show,u=this._command;if(!c(u.vertexArray)){let p=Js.createGeometry(new Js({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:We.POSITION_ONLY}));u.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:An.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),u.renderState=Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let f=a|d<<2|l<<3;if(f!==this._flags){this._flags=f;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),l&&p.push("GLOBE_TRANSLUCENT");let y=new Be({defines:p,sources:[$m,BV,Bv]}),h=new Be({defines:p,sources:[$m,BV,Dv]});this._spSkyAtmosphere=tn.fromCache({context:s,vertexShaderSource:y,fragmentShaderSource:h}),u.shaderProgram=this._spSkyAtmosphere}return u};function Dxt(e){return!(w.equalsEpsilon(e.hueShift,0,w.EPSILON7)&&w.equalsEpsilon(e.saturationShift,0,w.EPSILON7)&&w.equalsEpsilon(e.brightnessShift,0,w.EPSILON7))}SL.prototype.isDestroyed=function(){return!1};SL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),he(this)};var x9=SL;var iqi=_(T(),1);function VL(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new et({modelMatrix:M.clone(M.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}VL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==se.SCENE3D&&i!==se.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;if(C.defined("this.sources",a),Object.values(Uo.FaceName).some(d=>!c(a[d])))throw new L("this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let l=typeof a.positiveX;if(Object.values(Uo.FaceName).some(d=>typeof a[d]!==l))throw new L("this.sources properties must all be the same type.");typeof a.positiveX=="string"?mE(r,this._sources).then(function(d){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=d}).catch(d=>{this._hasError=!0,this._error=d}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Uo({context:r,source:a}))}let s=this._command;if(!c(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:We.POSITION_ONLY})),l=this._attributeLocations=An.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:l,bufferUsage:Ne.STATIC_DRAW}),s.renderState=Oe.fromCache({blending:un.ALPHA_BLEND})}if(!c(s.shaderProgram)||this._useHdr!==t){let a=new Be({defines:[t?"HDR":""],sources:[Yv]});s.shaderProgram=tn.fromCache({context:r,vertexShaderSource:Hv,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(c(this._cubeMap))return s};VL.prototype.isDestroyed=function(){return!1};VL.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(),he(this)};function CL(e){return on(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}VL.createEarthSkyBox=function(){return new VL({sources:{positiveX:CL("px"),negativeX:CL("mx"),positiveY:CL("py"),negativeY:CL("my"),positiveZ:CL("pz"),negativeZ:CL("mz")}})};var _9=VL;var Wqi=_(T(),1);function S9(){this.show=!0,this._drawCommand=new et({primitiveType:ve.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,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(S9.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Bxt=new D,Yxt=new D,Hxt=new ce,T9=new ce;S9.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===se.SCENE2D||i===se.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!c(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 E=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new Pt({context:o,width:R,height:R,pixelFormat:ke.RGBA,pixelDatatype:E}),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 vc({fragmentShaderSource:Kv,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!c(a.vertexArray)){let R={direction:0},E=new Uint8Array(4*2);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let I=_t.createVertexBuffer({context:o,typedArray:E,usage:Ne.STATIC_DRAW}),v=[{index:R.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:q.UNSIGNED_BYTE}],P=_t.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=tn.fromCache({context:o,vertexShaderSource:Jv,fragmentShaderSource:zv,attributeLocations:R}),a.renderState=Oe.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let l=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,f=this._boundingVolume2D;m.clone(l,u.center),f.center.x=d.z,f.center.y=d.x,f.center.z=d.y,u.radius=w.SOLAR_RADIUS+w.SOLAR_RADIUS*this._glowLengthTS,f.radius=u.radius,i===se.SCENE3D?ue.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&ue.clone(f,a.boundingVolume);let p=Oi.computeActualEllipsoidPosition(e,l,T9),y=m.magnitude(m.subtract(p,e.camera.position,T9)),h=o.uniformState.projection,g=Hxt;g.x=0,g.y=0,g.z=-y,g.w=1;let x=M.multiplyByVector(h,g,T9),S=Oi.clipToGLWindowCoordinates(t.viewport,x,Bxt);g.x=w.SOLAR_RADIUS;let V=M.multiplyByVector(h,g,T9),Z=Oi.clipToGLWindowCoordinates(t.viewport,V,Yxt);return this._size=D.magnitude(D.subtract(Z,S,T9)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};S9.prototype.isDestroyed=function(){return!1};S9.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(),he(this)};var C9=S9;var k$i=_(T(),1);var T$i=_(T(),1);var lSe=_(oN(),1);var vqi=_(T(),1);function zxt(e,t,n){return C.typeOf.string("samplerUniformName",e),C.typeOf.string("matrixUniformName",t),C.typeOf.string("styleUniformName",n),` 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) +vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); +vec4 color = texture(colorTexture, v_textureCoordinates); +out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); +} +`;var tXo=x(T(),1);function AR(e){e=e??B.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=qn()),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(AR.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}}});AR.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};AR.prototype.get=function(e){return this._stages[e]};function QMt(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}AR.prototype.update=function(e,t){this._selectedDirty=QMt(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)}};AR.prototype.isDestroyed=function(){return!1};AR.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var mu=AR;var ls={};function Fae(e){let o=`#define USE_STEP_SIZE +${PT}`,r=new Uo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:mm.LINEAR}),s=new Uo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:mm.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 mu({name:e,stages:[r,s],uniforms:a})}ls.createBlurStage=function(){return Fae("czm_blur")};ls.createDepthOfFieldStage=function(){let e=Fae("czm_depth_of_field_blur"),t=new Uo({name:"czm_depth_of_field_composite",fragmentShader:uU,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 mu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ls.createEdgeDetectionStage=function(){let e=qn();return new Uo({name:`czm_edge_detection_${e}`,fragmentShader:hU,uniforms:{length:.25,color:U.clone(U.BLACK)}})};ls.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function qMt(e){if(!l(e))return ls.createEdgeDetectionStage();let t=new mu({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++) { - out_FragColor = clippingPlanesEdgeColor; - } -`}var V9=zxt;var Mqi=_(T(),1);var Kxt={modifyFragmentShader:function(t){return t=Be.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(); +${o} } + out_FragColor = color; } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},LL=Kxt;var pS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function L9(e){C.typeOf.object("options",e),C.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=Y.clone(Y.DARKGRAY),this._highlightColor=Y.clone(Y.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=pS.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=e.opaquePass??Xe.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=Sn.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=e.splitDirection??Ar.NONE,this._splittingEnabled=!1,this._error=void 0,Jxt(this,e)}Object.defineProperties(L9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return Y.clone(this._highlightColor)},set:function(e){this._highlightColor=Y.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function Jxt(e,t){let n=I_.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&&c(n.batchTableBinary)&&(n.styleableProperties=zp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),c(n.draco)){let a=n.draco;e._decodingState=pS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;c(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;c(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;c(r)&&(c(r.constantColor)&&(e._constantColor=Y.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;c(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 Qxt=new m,jxt=new m,qxt=new m,aSe,$D;function $xt(e){if(!c($D)){aSe=new lSe.default(0),$D=new Array(e);for(let t=0;t<e;++t)$D[t]=aSe.random()}return $D}function e_t(e){let n=e.length/3,i=Math.min(n,20),o=$xt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,Qxt),l=m.fromElements(s,s,s,jxt);for(let u=0;u<i;++u){let f=Math.floor(o[u]*n),p=m.unpack(e,f*3,qxt);m.minimumByComponent(a,p,a),m.maximumByComponent(l,p,l)}let d=ue.fromCornerPoints(a,l);return d.radius+=w.EPSILON2,d}function cSe(e,t){let n=q.fromTypedArray(e);return n===q.INT||n===q.UNSIGNED_INT||n===q.DOUBLE?(ht("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 t_t=new ce,n_t=new ce,i_t=new Y,dSe=0,eB=1,Q8=2,uSe=3,o_t=4,H8=new M,r_t=new M;function s_t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,l=i.batchIds,d=i.styleableProperties,u=c(d),f=e._isQuantized,p=e._isQuantizedDraco,y=e._isOctEncoded16P,h=e._isOctEncodedDraco,g=e._quantizedRange,x=e._octEncodedRange,S=e._isRGB565,V=e._isTranslucent,Z=e._hasColors,R=e._hasNormals,E=e._hasBatchIds,I,v,P=[],F={};if(e._styleableShaderAttributes=F,u){let O=o_t;for(let H in d)if(d.hasOwnProperty(H)){let U=d[H],K=cSe(U.typedArray,H);I=U.componentCount,v=q.fromTypedArray(K);let Q=_t.createVertexBuffer({context:n,typedArray:K,usage:Ne.STATIC_DRAW});e._geometryByteLength+=Q.sizeInBytes;let ie={index:O,vertexBuffer:Q,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(ie),F[H]={location:O,componentCount:I},++O}}let N=_t.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let b;Z&&(b=_t.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let G;R&&(G=_t.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let X;E&&(l.typedArray=cSe(l.typedArray,"batchIds"),X=_t.createVertexBuffer({context:n,typedArray:l.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=X.sizeInBytes);let W=[];if(f?v=q.UNSIGNED_SHORT:p?v=g<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT:v=q.FLOAT,W.push({index:dSe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(f||p?e._boundingSphere=ue.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=e_t(r.typedArray)),Z)if(S)W.push({index:eB,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let O=V?4:3;W.push({index:eB,vertexBuffer:b,componentsPerAttribute:O,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}R&&(y?(I=2,v=q.UNSIGNED_BYTE):h?(I=2,v=x<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT):(I=3,v=q.FLOAT),W.push({index:Q8,vertexBuffer:G,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&W.push({index:uSe,vertexBuffer:X,componentsPerAttribute:1,componentDatatype:q.fromTypedArray(l.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(W=W.concat(P));let A=new ni({context:n,attributes:W}),k={depthTest:{enabled:!0}},B={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Xe.CESIUM_3D_TILE&&(k.stencilTest=kt.setCesium3DTileBit(),k.stencilMask=kt.CESIUM_3D_TILE_MASK,B.stencilTest=kt.setCesium3DTileBit(),B.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Oe.fromCache(k),e._translucentRenderState=Oe.fromCache(B),e._drawCommand=new et({boundingVolume:new ue,cull:e._cull,modelMatrix:new M,primitiveType:ve.POINTS,vertexArray:A,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Xe.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function a_t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=t_t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let l=t.camera.frustum,d;t.mode===se.SCENE2D||l instanceof sn?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(!c(a))return Y.TRANSPARENT;let l=Y.clone(a.edgeColor,i_t);return l.alpha=a.edgeWidth,l},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!c(a))return M.IDENTITY;let l=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,l,H8);let d=M.multiply(H8,a.modelMatrix,H8);return M.inverseTranspose(d,r_t)}};LL.addUniforms(e,s),(i||o||r)&&(s=St(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=n_t;if(c(e._quantizedVolumeScale)){let l=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(l,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),c(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function z8(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 K8(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 J8(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 c_t={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 l_t(e,t,n){let i,o,r,s=t.context,a=c(n),l=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,f=e._isOctEncodedDraco,p=e._isRGB565,y=e._isTranslucent,h=e._hasColors,g=e._hasNormals,x=e._hasBatchIds,S=e._backFaceCulling,V=e._normalShading,Z=e._drawCommand.vertexArray,R=e.clippingPlanes,E=e._attenuation,I,v,P,F=y,N=He(c_t),b={},G=e._styleableShaderAttributes;for(o in G)G.hasOwnProperty(o)&&(r=G[o],N[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let me={translucent:!1},_e="(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${_e}`,N,me),v=n.getShowShaderFunction(`getShowFromStyle${_e}`,N,me),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${_e}`,N,me),c(I)&&me.translucent&&(F=!0)}e._styleTranslucent=F;let X=c(I),W=c(v),A=c(P),k=e.isClipped,B=[],O=[];X&&(z8(I,B),K8(I,O)),W&&(z8(v,B),K8(v,O)),A&&(z8(P,B),K8(P,O));let H=O.indexOf("COLOR")>=0,U=O.indexOf("NORMAL")>=0;if(U&&!g)throw new le("Style references the NORMAL semantic but the point cloud does not have normals");for(o in G)if(G.hasOwnProperty(o)){r=G[o];let me=B.indexOf(r.location)>=0,_e=J8(Z,r.location);_e.enabled=me}let K=h&&(!X||H);if(h){let me=J8(Z,eB);me.enabled=K}let Q=g&&(V||S||U);if(g){let me=J8(Z,Q8);me.enabled=Q}let ie={a_position:dSe};K&&(ie.a_color=eB),Q&&(ie.a_normal=Q8),x&&(ie.a_batchId=uSe);let j="",$=B.length;for(i=0;i<$;++i){let me=B[i];r=b[me];let _e=r.componentCount,Ve=`czm_3dtiles_property_${me}`,Ie;_e===1?Ie="float":Ie=`vec${_e}`,j+=`in ${Ie} ${Ve}; -`,ie[Ve]=r.location}a_t(e,t);let ne=`in vec3 a_position; -out vec4 v_color; -uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; -uniform vec4 u_constantColor; -uniform vec4 u_highlightColor; -`;ne+=`float u_pointSize; -float tiles3d_tileset_time; -`,E&&(ne+=`float u_geometricError; -float u_depthMultiplier; -`),ne+=j,K&&(y?ne+=`in vec4 a_color; -`:p?ne+=`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; -`:ne+=`in vec3 a_color; -`),Q&&(u||f?ne+=`in vec2 a_normal; -`:ne+=`in vec3 a_normal; -`),x&&(ne+=`in float a_batchId; -`),(l||d||f)&&(ne+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),X&&(ne+=I),W&&(ne+=v),A&&(ne+=P),ne+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,E&&(ne+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),K?y?ne+=` vec4 color = a_color; -`:p?ne+=` 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); -`:ne+=` vec4 color = vec4(a_color, 1.0); -`:ne+=` vec4 color = u_constantColor; -`,l||d?ne+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:ne+=` vec3 position = a_position; -`,ne+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,Q?(u?ne+=` vec3 normal = czm_octDecode(a_normal); -`:f?ne+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; -`:ne+=` vec3 normal = a_normal; -`,ne+=` vec3 normalEC = czm_normal * normal; -`):ne+=` vec3 normal = vec3(1.0); -`,X&&(ne+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),W&&(ne+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),A?ne+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:E?ne+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); - float depth = -positionEC.z; - gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); -`:ne+=` gl_PointSize = u_pointSize; -`,ne+=` color = color * u_highlightColor; -`,Q&&V&&(ne+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); - diffuseStrength = max(diffuseStrength, 0.4); - color.xyz *= diffuseStrength * czm_lightColor; -`),ne+=` v_color = color; - gl_Position = czm_modelViewProjection * vec4(position, 1.0); -`,Q&&S&&(ne+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),W&&(ne+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),ne+=`} -`;let be=`in vec4 v_color; -`;k&&(be+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,be+=` -`,be+=c0(R,s),be+=` -`),be+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,k&&(be+=V9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),be+=`} -`,e.splitDirection!==Ar.NONE&&(be=LL.modifyFragmentShader(be)),c(e._vertexShaderLoaded)&&(ne=e._vertexShaderLoaded(ne)),c(e._fragmentShaderLoaded)&&(be=e._fragmentShaderLoaded(be));let Ce=e._drawCommand;c(Ce.shaderProgram)&&Ce.shaderProgram.destroy(),Ce.shaderProgram=tn.fromCache({context:s,vertexShaderSource:ne,fragmentShaderSource:be,attributeLocations:ie});try{Ce.shaderProgram._bind()}catch{throw new le("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function d_t(e,t){if(e._decodingState===pS.READY)return!1;if(e._decodingState===pS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=eb.decodePointCloud(i,t);c(o)&&(e._decodingState=pS.DECODING,o.then(function(r){e._decodingState=pS.READY;let s=c(r.POSITION)?r.POSITION.array:void 0,a=c(r.RGB)?r.RGB.array:void 0,l=c(r.RGBA)?r.RGBA.array:void 0,d=c(r.NORMAL)?r.NORMAL.array:void 0,u=c(r.BATCH_ID)?r.BATCH_ID.array:void 0,f=c(s)&&c(r.POSITION.data.quantization),p=c(d)&&c(r.NORMAL.data.quantization);if(f){let x=r.POSITION.data.quantization,S=x.range;e._quantizedVolumeScale=m.fromElements(S,S,S),e._quantizedVolumeOffset=m.unpack(x.minValues),e._quantizedRange=(1<<x.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let y=n.styleableProperties,h=i.batchTableProperties;for(let x in h)if(h.hasOwnProperty(x)){let S=r[x];c(y)||(y={}),y[x]={typedArray:S.array,componentCount:S.data.componentsPerAttribute}}c(s)&&(n.positions={typedArray:s});let g=l??a;c(g)&&(n.colors={typedArray:g}),c(d)&&(n.normals={typedArray:d}),c(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=y}).catch(function(r){e._decodingState=pS.FAILED,e._error=r}))}return!0}var u_t=new ce,m_t=new m;L9.prototype.update=function(e){let t=e.context;if(c(this._error)){let d=this._error;throw this._error=void 0,d}if(d_t(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(s_t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,d),c(this._rtcCenter)&&M.multiplyByTranslation(d,this._rtcCenter,d),c(this._quantizedVolumeOffset)&&M.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==se.SCENE3D){let f=e.mapProjection,p=M.getColumn(d,3,u_t);ce.equals(p,ce.UNIT_W)||wt.basisTo2D(f,d,d)}let u=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,u),this._cull){let f=u.center;M.multiplyByPoint(d,f,f);let p=M.getScale(d,m_t);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!==Ar.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&l_t(this,e,this._style),this._drawCommand.castShadows=Sn.castShadows(this.shadows),this._drawCommand.receiveShadows=Sn.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?Xe.TRANSLUCENT:this._opaquePass;let a=e.commandList,l=e.passes;(l.render||l.pick)&&a.push(this._drawCommand)};L9.prototype.isDestroyed=function(){return!1};L9.prototype.destroy=function(){let e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),he(this)};var Z9=L9;function yS(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.clock",e.clock),C.typeOf.object("options.intervals",e.intervals),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Sn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Vh(e.shading),this.style=e.style,this.frameFailed=new ye,this.frameChanged=new ye,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new lb,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(yS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(c(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function f_t(e){return`uniform vec4 czm_pickColor; -${e}`}function h_t(e){return function(t){return St(t,{czm_pickColor:function(){return e._pickId.color}})}}function p_t(){return"czm_pickColor"}yS.prototype.makeStyleDirty=function(){this._styleDirty=!0};yS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var b_t=new ee;function q8(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function bS(e,t){return e._intervals.indexOf(t.start)}function y_t(e,t){let n=e._intervals,i=e._clock,o=q8(e);if(o===0)return;let r=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,r*o,b_t),a=n.indexOf(s),l=bS(e,t);return a===l&&(o>=0?++a:--a),n.get(a)}function g_t(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function x_t(e,t,n){let i=q8(e),o=bS(e,t),r=bS(e,n);return i>=0?o>=r:o<=r}function fSe(e,t){return function(n){let i=c(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 __t(e,t,n){let i=bS(e,t),o=e._frames,r=o[i];if(!c(r)){let s=t.data.transform,a=c(s)?M.fromArray(s):void 0,l=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:l},o[i]=r,Ge.fetchArrayBuffer({url:l}).then(function(d){r.pointCloud=new Z9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:f_t,uniformMapLoaded:h_t(e),pickIdLoaded:p_t})}).catch(fSe(e,l))}return r}function T_t(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 S_t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(c(o)&&!t.ready){let r=i.commandList,s=r.length;if(hSe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;T_t(e,a)}}t.touchedFrameNumber=i.frameNumber}var C_t=new M;function V_t(e,t){let n=e.shading;return c(n)&&c(n.baseResolution)?n.baseResolution:c(t.boundingSphere)?w.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function L_t(e){let t=e.shading;return c(t)&&c(t.maximumAttenuation)?t.maximumAttenuation:10}var Z_t=new Vh;function hSe(e,t,n,i){let o=e.shading??Z_t,r=t.pointCloud,s=t.transform??M.IDENTITY;r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,C_t),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=V_t(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=L_t(e);try{r.update(i)}catch(a){fSe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function j8(e,t,n,i){let o=__t(e,t,i);S_t(e,o,n,i)}function R_t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function pSe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(c(r)&&(!c(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),c(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function G_t(e,t){let n=bS(e,t),i=e._frames[n];if(c(i)&&i.ready)return i}function mSe(e,t,n,i,o){return c(n)?n.ready?!0:(j8(e,t,i,o),n.ready):!1}function E_t(e,t,n,i,o){let r,s,a,l=e._intervals,d=e._frames,u=bS(e,n),f=bS(e,t);if(u>=f){for(r=u;r>=f;--r)if(s=l.get(r),a=d[r],mSe(e,s,a,i,o))return s}else for(r=u;r<=f;++r)if(s=l.get(r),a=d[r],mSe(e,s,a,i,o))return s;return t}function X_t(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];c(s)&&c(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var ZL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};yS.prototype.update=function(e){if(e.mode===se.MORPHING||!this.show)return;c(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),c(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=c(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)&&X_t(this,o,s),ZL.timeSinceLoad=t,ZL.isClipped=r;let a=this.shading,l=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,f=this._previousInterval,p=this._nextInterval,y=g_t(this);if(!c(y))return;let h=!1,g=q8(this),x=g===0;g!==this._clockMultiplier&&(h=!0,this._clockMultiplier=g),(!c(f)||x)&&(f=y),(!c(p)||h||x_t(this,y,p))&&(p=y_t(this,y)),f=E_t(this,f,y,ZL,e);let S=G_t(this,f);c(S)||(j8(this,f,ZL,e),S=this._lastRenderedFrame),c(S)&&hSe(this,S,ZL,e),c(p)&&j8(this,p,ZL,e);let V=this;c(S)&&!c(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),c(S)&&S!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=f,this._nextInterval=p,this._lastRenderedFrame=S;let Z=this._totalMemoryUsageInBytes,R=this.maximumMemoryUsage*1024*1024;Z>R&&pSe(this,R_t(e));let I=d.length-u;c(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&l.update(e,u,a,this.boundingSphere)};yS.prototype.isDestroyed=function(){return!1};yS.prototype.destroy=function(){return pSe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),he(this)};var RL=yS;function gSe(e,t){if(c(t)){let n=t.clock;c(n)&&n.getValue(e)}}function I_t(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!c(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 xSe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,c(e._scene)&&(e._scene.pixelRatio=t),t}function _Se(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=xSe(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 TSe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;c(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Go(e,t){if(!c(e))throw new L("container is required.");e=Wn(e),t=t??z.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ot.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ot.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(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 l=c(t.creditContainer)?Wn(t.creditContainer):n;l.appendChild(a);let d=c(t.creditViewport)?Wn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,f=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=l,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=f,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 ye,this._allowDataSourcesToSuspendAnimation=!0,this._clock=c(t.clock)?t.clock:new _f,c(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),_Se(this);try{let p=t.ellipsoid??re.default,y=new g9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=y,y.camera.constrainedAxis=m.UNIT_Z,xSe(this),TSe(this);let h=t.globe;c(h)||(h=new SF(p)),h!==!1&&(y.globe=h,y.globe.shadows=t.terrainShadows??Sn.RECEIVE_ONLY);let g=t.skyBox;!c(g)&&re.WGS84.equals(p)&&(g=_9.createEarthSkyBox()),g!==!1&&(y.skyBox=g,y.sun=new C9,re.WGS84.equals(p)&&(y.moon=new GF));let x=t.skyAtmosphere;!c(x)&&re.WGS84.equals(p)&&(x=new x9(p),x.show=t.globe!==!1&&h.show),x!==!1&&(y.skyAtmosphere=x);let S=t.baseLayer;if(t.globe!==!1&&S!==!1&&(c(S)||(S=Ya.fromWorldImagery()),y.imageryLayers.add(S)),c(t.terrainProvider)&&t.globe!==!1&&(y.terrainProvider=t.terrainProvider),c(t.terrain)&&t.globe!==!1){if(c(t.terrainProvider))throw new L("Specify either options.terrainProvider or options.terrain.");y.setTerrain(t.terrain)}this._screenSpaceEventHandler=new tu(i),c(t.sceneMode)&&(t.sceneMode===se.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===se.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(P,F){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,F)},y.renderError.addEventListener(this._onRenderError);let Z=t.dataSources,R=!1;c(Z)||(Z=new l2,R=!0);let E=new z2({scene:y,dataSourceCollection:Z}),I=new hr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=Z,this._destroyDataSourceCollection=R,this._dataSourceDisplay=E,this._eventHelper=I,this._canAnimateUpdateCallback=this._updateCanAnimate,I.add(this._clock.onTick,Go.prototype._onTick,this),I.add(y.morphStart,Go.prototype._clearTrackedObject,this),I.add(Z.dataSourceAdded,Go.prototype._onDataSourceAdded,this),I.add(Z.dataSourceRemoved,Go.prototype._onDataSourceRemoved,this),I.add(y.postRender,Go.prototype._postRender,this);let v=Z.length;for(let P=0;P<v;P++)this._dataSourceAdded(Z,Z.get(P));this._dataSourceAdded(void 0,E.defaultDataSource),I.add(Z.dataSourceAdded,Go.prototype._dataSourceAdded,this),I.add(Z.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){if(e<=0)throw new L("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&I_t(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new L("resolutionScale must be greater than 0.");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,$8(this);let t=this.scene,n=t.mode;!c(e)||!c(e.position)?(this._needTrackedEntityUpdate=!1,(n===se.COLUMBUS_VIEW||n===se.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===se.COLUMBUS_VIEW||n===se.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.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,gSe(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 l(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}l(),c(window.addEventListener)&&window.addEventListener("resize",l,!1);let d=c(t),u=c(n);if(d||u){let y=document.createElement("div");if(y.className="cesium-widget-errorPanel-message",a.appendChild(y),u){let h=qh(n);d||(typeof n=="string"&&(n=new Error(n)),t=qh({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${h}`);let g=document.createElement("div");g.className="cesium-widget-errorPanel-message-details collapsed";let x=document.createElement("span");x.className="cesium-widget-errorPanel-more-details",x.appendChild(document.createTextNode("See more...")),g.appendChild(x),g.onclick=function(S){g.removeChild(x),g.appendChild(document.createTextNode(h)),g.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",g.onclick=void 0},a.appendChild(g)}y.innerHTML=`<p>${t}</p>`}let f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(f);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){c(l)&&c(window.removeEventListener)&&window.removeEventListener("resize",l,!1),i.removeChild(o)},f.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(),c(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()),he(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,_Se(this),TSe(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),c(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Go.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var W_t=new ue;Go.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(c(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??W_t)===ut.DONE&&i.update(t)}};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&&gSe(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 SSe(this,e,{offset:t},!1)};Go.prototype.flyTo=function(e,t){return SSe(this,e,t,!0)};function SSe(e,t,n,i){if(!c(t))throw new L("zoomTarget is required.");$8(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;c(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let l=r.readyEvent.addEventListener(()=>{l(),a(r.getImageryRectangle())})}),s.then(function(a){return WT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof RL||r instanceof Ng){e._zoomTarget=r;return}if(r.isLoading&&c(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,c(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function R9(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function $8(e){let t=e._zoomPromise;c(t)&&(R9(e),e._completeZoom(!1))}Go.prototype._postRender=function(){w_t(this),P_t(this)};var bSe=new ue;function w_t(e){let t=e._zoomTarget;if(!c(t)||e.scene.mode===se.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){c(o.offset)||(o.offset=new rm(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(M.IDENTITY),e._completeZoom(!0)),R9(e)}if(t instanceof RL){if(c(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(f){s(f.boundingSphere),u()});return}if(t instanceof bs||t instanceof Ng){s(t.boundingSphere);return}if(t instanceof pe){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)),R9(e);return}let a=t,l=[];for(let u=0,f=a.length;u<f;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,bSe);if(p===ut.PENDING)return;p!==ut.FAILED&&l.push(ue.clone(bSe))}if(l.length===0){$8(e);return}e.trackedEntity=void 0;let d=ue.fromBoundingSpheres(l);e._zoomIsFlight?(R9(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(M.IDENTITY),R9(e),e._completeZoom(!0))}var ySe=new ue;function P_t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=J.getValueOrUndefined(t.position,n);if(!c(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,ySe);if(r===ut.PENDING)return;let s=o.mode;(s===se.COLUMBUS_VIEW||s===se.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===se.COLUMBUS_VIEW||s===se.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?ySe:void 0;e._entityView=new J2(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var G9=Go;var jeo=_(T(),1);var Eeo=_(T(),1);function XL(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var gS=new de;function v_t(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}XL.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 y=t;y<=i;++y)v_t(e,y,p,s)||s.push(new GL(r,void 0,0,y,p));r.tileXYToRectangle(t,n,e,gS);let a=gS.west,l=gS.north;r.tileXYToRectangle(i,o,e,gS);let d=gS.east,u=gS.south,f=new k_t(e,a,u,d,l);for(let p=0;p<s.length;++p){let y=s[p];e7(y.extent,f)&&U_t(this._maximumLevel,y,f)}};XL.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(EL(i.extent,e)){t=i;break}}return c(t)?E9(void 0,t,e):-1};var F_t=[],A_t=[],M_t=new de,N_t=new de;XL.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=F_t;t.length=0,e.east<e.west?(t.push(de.fromRadians(-Math.PI,e.south,e.east,e.north,M_t)),t.push(de.fromRadians(e.west,e.south,Math.PI,e.north,N_t))):t.push(e);let n=A_t;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)X9(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(c(n[i])&&n[i].length===0)return i;return 0};var CSe=new pe;XL.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,gS);return de.center(i,CSe),this.computeMaximumLevelAtPosition(CSe)>=e};XL.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 GL(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(GL.prototype,{nw:{get:function(){return this._nw||(this._nw=new GL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new GL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new GL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new GL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function k_t(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function e7(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 U_t(e,t,n){for(;t.level<e;)if(tB(t.nw.extent,n))t=t.nw;else if(tB(t.ne.extent,n))t=t.ne;else if(tB(t.sw.extent,n))t=t.sw;else if(tB(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=Wo(t.rectangles,n.level,O_t);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function O_t(e,t){return e.level-t}function tB(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function EL(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function E9(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&EL(t._nw.extent,n),s=t._ne&&EL(t._ne.extent,n),a=t._sw&&EL(t._sw.extent,n),l=t._se&&EL(t._se.extent,n);if(r+s+a+l>1){r&&(i=Math.max(i,E9(t,t._nw,n))),s&&(i=Math.max(i,E9(t,t._ne,n))),a&&(i=Math.max(i,E9(t,t._sw,n))),l&&(i=Math.max(i,E9(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:l?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];EL(a,n)&&(i=a.level)}t=t.parent}return i}function X9(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||e7(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]=D_t(e[s.level],s)}X9(e,t._nw,n),X9(e,t._ne,n),X9(e,t._sw,n),X9(e,t._se,n)}function D_t(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];e7(o,t)?(o.west<t.west&&n.push(new de(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new de(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new de(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new de(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Hf=XL;var B_t=15;function VSe(e){this.ellipsoid=e.ellipsoid??re.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}VSe.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 Y_t(e,t){let n=t.copyrightText;c(n)&&(e.credit=new Ct(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=de.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ki(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 ss(s)}else throw new le("Invalid spatial reference");let a=t.tileInfo;if(!c(a))throw new le("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?cm.LERC:cm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Hf(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Hf(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=rs.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."),c(t.minValues)&&c(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function H_t(e,t,n){try{let i=await t.fetchJson();Y_t(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,o),i}}function Ug(e){e=e??z.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 ye}Object.defineProperties(Ug.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}}});Ug.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new VSe(t);await H_t(o,i);let r=new Ug(t);return o.build(r),r._resource=n,r};Ug.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&&!c(t7(this,n+1,e*2,t*2))){let f=LSe(this,n+1,e*2,t*2);s=f.promise,a=f.request}let l=o.fetchArrayBuffer();if(!c(l)||!c(s))return;let d=this,u=this._tilesAvailable;return Promise.all([l,s]).then(function(f){return new Da({buffer:f[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):B_t,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(f){if(c(a)&&a.state===jn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=jn.CANCELLED,Promise.reject(f)}return Promise.reject(f)})};function t7(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}Ug.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Ug.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=t7(this,n,e,t);if(c(i))return i;LSe(this,n,e,t)};Ug.prototype.loadTileDataAvailability=function(e,t,n){};function z_t(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],l={startX:e.x,startY:e.y,endX:0,endY:0},d=new D(e.x+1,e.y+1),u=!1,f=!1;for(;!(u&&f);){let p=d.x,y=f?d.y+1:d.y;if(!u){for(let h=e.y;h<y;++h)if(i[h*t+d.x]!==s){u=!0;break}u?(a.push(new D(d.x,e.y)),--d.x,--p,l.endX=d.x):d.x===o?(l.endX=d.x,u=!0):++d.x}if(!f){let h=d.y*t;for(let g=e.x;g<=p;++g)if(i[h+g]!==s){f=!0;break}f?(a.push(new D(e.x,d.y)),--d.y,l.endY=d.y):d.y===r?(l.endY=d.y,f=!0):++d.y}}return{endingIndices:a,range:l,value:s}}function K_t(e,t,n,i,o){let r=[];if(o.every(function(l){return l===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 l=a.pop(),d=z_t(l,n,i,o);if(d.value===1){let f=d.range;f.startX+=e,f.endX+=e,f.startY+=t,f.endY+=t,r.push(f)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function LSe(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}`,l=e._availableCache;if(c(l[a]))return l[a];let d=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN}),f=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return c(f)?(f=f.then(function(p){let y=K_t(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let h=e._tilesAvailable;for(let g=0;g<y.length;++g){let x=y[g];h.addAvailableTileRange(t,x.startX,x.startY,x.endX,x.endY)}return t7(e,t,n,i)}),l[a]={promise:f,request:d},f=f.finally(function(p){return delete l[a],p}),{promise:f,request:d}):{}}var n7=Ug;var sto=_(T(),1);var ZSe="https://dev.virtualearth.net/REST/v1/Locations";function i7(e){e=e??z.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new L("options.key is required.");this._key=t;let n={key:t};c(e.culture)&&(n.culture=e.culture),this._resource=new Ge({url:ZSe,queryParameters:n}),this._credit=new Ct('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(i7.prototype,{url:{get:function(){return ZSe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});i7.prototype.geocode=async function(e){return C.typeOf.string("query",e),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],l=r[2],d=r[3];return{displayName:o.name,destination:de.fromDegrees(a,s,d,l)}})})};var o7=i7;var dto=_(T(),1);function r7(){}Object.defineProperties(r7.prototype,{credit:{get:function(){}}});r7.prototype.geocode=function(e){C.typeOf.string("query",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 s7=r7;var _to=_(T(),1);var J_t=new ce,RSe=new m,IL=new m;function Q_t(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,l){c(l)||(l=new m);let d=(a-i)*o;return m.lerp(r,s,d,l)}}return function(i,o){c(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=J_t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let l,d,u,f,p;return r===0?(l=t[0],d=t[1],u=e.firstTangent,f=m.subtract(t[2],l,RSe),m.multiplyByScalar(f,.5,f),p=M.multiplyByVector(Ry.hermiteCoefficientMatrix,a,a)):r===t.length-2?(l=t[r],d=t[r+1],f=e.lastTangent,u=m.subtract(d,t[r-1],RSe),m.multiplyByScalar(u,.5,u),p=M.multiplyByVector(Ry.hermiteCoefficientMatrix,a,a)):(l=t[r-1],d=t[r],u=t[r+1],f=t[r+2],p=M.multiplyByVector(Og.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(l,p.x,o),m.multiplyByScalar(d,p.y,IL),m.add(o,IL,o),m.multiplyByScalar(u,p.z,IL),m.add(o,IL,o),m.multiplyByScalar(f,p.w,IL),m.add(o,IL,o)}}var j_t=new m,q_t=new m;function Og(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(C.defined("points",t),C.defined("times",n),C.typeOf.number.greaterThanOrEquals("points.length",t.length,2),C.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(c(i)||(i=j_t,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!c(o))){let r=t.length-1;o=q_t,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=Q_t(this),this._lastTimeIndex=0}Object.defineProperties(Og.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}}});Og.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Og.prototype.findTimeInterval=Pi.prototype.findTimeInterval;Og.prototype.wrapTime=Pi.prototype.wrapTime;Og.prototype.clampTime=Pi.prototype.clampTime;Og.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var a7=Og;var bno=_(T(),1);var Bto=_(T(),1);var Rto=_(T(),1);var nB={};nB.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){if(!c(e))throw new L("threshold is required.");if(!c(t))throw new L("keepAbove is required.");if(!c(n))throw new L("u0 is required.");if(!c(i))throw new L("u1 is required.");if(!c(o))throw new L("u2 is required.");c(r)?r.length=0:r=[];let s,a,l;t?(s=n<e,a=i<e,l=o<e):(s=n>e,a=i>e,l=o>e);let d=s+a+l,u,f,p,y,h,g;return d===1?s?(u=(e-n)/(i-n),f=(e-n)/(o-n),r.push(1),r.push(2),f!==1&&(r.push(-1),r.push(0),r.push(2),r.push(f)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),y=(e-i)/(n-i),r.push(2),r.push(0),y!==1&&(r.push(-1),r.push(1),r.push(0),r.push(y)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):l&&(h=(e-o)/(n-o),g=(e-o)/(i-o),r.push(0),r.push(1),g!==1&&(r.push(-1),r.push(2),r.push(1),r.push(g)),h!==1&&(r.push(-1),r.push(2),r.push(0),r.push(h))):d===2?!s&&n!==e?(y=(e-i)/(n-i),h=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(y),r.push(-1),r.push(2),r.push(0),r.push(h)):!a&&i!==e?(g=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(g),r.push(-1),r.push(0),r.push(1),r.push(u)):!l&&o!==e&&(f=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(f),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};nB.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,l){if(!c(e))throw new L("x is required.");if(!c(t))throw new L("y is required.");if(!c(n))throw new L("x1 is required.");if(!c(i))throw new L("y1 is required.");if(!c(o))throw new L("x2 is required.");if(!c(r))throw new L("y2 is required.");if(!c(s))throw new L("x3 is required.");if(!c(a))throw new L("y3 is required.");let d=n-s,u=s-o,f=r-a,p=i-a,y=1/(f*d+u*p),h=t-a,g=e-s,x=(f*g+u*h)*y,S=(-p*g+d*h)*y,V=1-x-S;return c(l)?(l.x=x,l.y=S,l.z=V,l):new m(x,S,V)};nB.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,l){C.typeOf.number("x00",e),C.typeOf.number("y00",t),C.typeOf.number("x01",n),C.typeOf.number("y01",i),C.typeOf.number("x10",o),C.typeOf.number("y10",r),C.typeOf.number("x11",s),C.typeOf.number("y11",a);let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),f=(a-r)*(n-e)-(s-o)*(i-t);if(f===0)return;let p=d/f,y=u/f;if(p>=0&&p<=1&&y>=0&&y<=1)return c(l)||(l=new D),l.x=e+p*(n-e),l.y=t+p*(i-t),l};var Z0=nB;function Dg(e){if(!c(e)||!c(e.quantizedVertices))throw new L("options.quantizedVertices is required.");if(!c(e.indices))throw new L("options.indices is required.");if(!c(e.minimumHeight))throw new L("options.minimumHeight is required.");if(!c(e.maximumHeight))throw new L("options.maximumHeight is required.");if(!c(e.maximumHeight))throw new L("options.maximumHeight is required.");if(!c(e.boundingSphere))throw new L("options.boundingSphere is required.");if(!c(e.horizonOcclusionPoint))throw new L("options.horizonOcclusionPoint is required.");if(!c(e.westIndices))throw new L("options.westIndices is required.");if(!c(e.southIndices))throw new L("options.southIndices is required.");if(!c(e.eastIndices))throw new L("options.eastIndices is required.");if(!c(e.northIndices))throw new L("options.northIndices is required.");if(!c(e.westSkirtHeight))throw new L("options.westSkirtHeight is required.");if(!c(e.southSkirtHeight))throw new L("options.southSkirtHeight is required.");if(!c(e.eastSkirtHeight))throw new L("options.eastSkirtHeight is required.");if(!c(e.northSkirtHeight))throw new L("options.northSkirtHeight is required.");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=oB(e.westIndices,o,t),this._southIndices=oB(e.southIndices,r,t),this._eastIndices=oB(e.eastIndices,o,t),this._northIndices=oB(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Dg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return c(this._mesh)}}});var iB=[];function oB(e,t,n){iB.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)iB[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(iB.sort(t),Me.createTypedArray(n,iB)):e}var GSe="createVerticesFromQuantizedTerrainMesh",$_t=new gi(GSe),eTt=new gi(GSe,Ff.maximumAsynchronousTasks);Dg.prototype.createMesh=function(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),f=(a?eTt:$_t).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:l,exaggeration:r,exaggerationRelativeHeight:s});if(!c(f))return;let p=this;return Promise.resolve(f).then(function(y){let h=p._quantizedVertices.length/3,g=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=Me.createTypedArray(g,y.indices),S=new Float32Array(y.vertices),V=y.center,Z=y.minimumHeight,R=y.maximumHeight,E=p._boundingSphere,I=p._orientedBoundingBox,v=m.clone(y.occludeePointInScaledSpace)??p._horizonOcclusionPoint,P=y.vertexStride,F=Rc.clone(y.encoding);return p._mesh=new dm(V,S,x,y.indexCountWithoutSkirts,h,Z,R,E,v,P,I,F,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.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 tTt=new gi("upsampleQuantizedTerrainMesh",Ff.maximumAsynchronousTasks);Dg.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new L("tilingScheme is required.");if(!c(t))throw new L("thisX is required.");if(!c(n))throw new L("thisY is required.");if(!c(i))throw new L("thisLevel is required.");if(!c(o))throw new L("descendantX is required.");if(!c(r))throw new L("descendantY is required.");if(!c(s))throw new L("descendantLevel is required.");if(s-i>1)throw new L("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let d=t*2!==o,u=n*2===r,f=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),y=tTt.scheduleTask({vertices:l.vertices,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:d,isNorthChild:u,childRectangle:p,ellipsoid:f});if(!c(y))return;let h=Math.min(this._westSkirtHeight,this._eastSkirtHeight);h=Math.min(h,this._southSkirtHeight),h=Math.min(h,this._northSkirtHeight);let g=d?h*.5:this._westSkirtHeight,x=u?h*.5:this._southSkirtHeight,S=d?this._eastSkirtHeight:h*.5,V=u?this._northSkirtHeight:h*.5,Z=this._credits;return Promise.resolve(y).then(function(R){let E=new Uint16Array(R.vertices),I=Me.createTypedArray(E.length/3,R.indices),v;return c(R.encodedNormals)&&(v=new Uint8Array(R.encodedNormals)),new Dg({quantizedVertices:E,indices:I,encodedNormals:v,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:ue.clone(R.boundingSphere),orientedBoundingBox:Xn.clone(R.orientedBoundingBox),horizonOcclusionPoint:m.clone(R.horizonOcclusionPoint),westIndices:R.westIndices,southIndices:R.southIndices,eastIndices:R.eastIndices,northIndices:R.northIndices,westSkirtHeight:g,southSkirtHeight:x,eastSkirtHeight:S,northSkirtHeight:V,childTileMask:0,credits:Z,createdByUpsampling:!0})})};var c7=32767,ESe=new m;Dg.prototype.interpolateHeight=function(e,t,n){let i=w.clamp((t-e.west)/e.width,0,1);i*=c7;let o=w.clamp((n-e.south)/e.height,0,1);return o*=c7,c(this._mesh)?rTt(this,i,o):sTt(this,i,o)};function XSe(e,t,n,i,o,r,s,a){let l=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),f=Math.max(i,r,a);return e>=l&&e<=d&&t>=u&&t<=f}var nTt=new D,iTt=new D,oTt=new D;function rTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let d=s[a],u=s[a+1],f=s[a+2],p=r.decodeTextureCoordinates(o,d,nTt),y=r.decodeTextureCoordinates(o,u,iTt),h=r.decodeTextureCoordinates(o,f,oTt);if(XSe(t,n,p.x,p.y,y.x,y.y,h.x,h.y)){let g=Z0.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,h.x,h.y,ESe);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){let x=r.decodeHeight(o,d),S=r.decodeHeight(o,u),V=r.decodeHeight(o,f);return g.x*x+g.y*S+g.z*V}}}}function sTt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,l=s.length;a<l;a+=3){let d=s[a],u=s[a+1],f=s[a+2],p=i[d],y=i[u],h=i[f],g=o[d],x=o[u],S=o[f];if(XSe(t,n,p,g,y,x,h,S)){let V=Z0.computeBarycentricCoordinates(t,n,p,g,y,x,h,S,ESe);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let Z=V.x*r[d]+V.y*r[u]+V.z*r[f];return w.lerp(e._minimumHeight,e._maximumHeight,Z/c7)}}}}Dg.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new L("thisX is required.");if(!c(t))throw new L("thisY is required.");if(!c(n))throw new L("childX is required.");if(!c(i))throw new L("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Dg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var xS=Dg;function aTt(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 WSe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??re.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=[]}WSe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=c(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 wSe(e,t,n){if(!t.format){let g="The tile format is not specified in the layer.json file.";throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}if(!t.tiles||t.tiles.length===0){let g="The layer.json file does not specify any tile URL templates.";throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,c(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 g=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}let l=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new ss({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let g=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}if(e.levelZeroMaximumGeometricError=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let g=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}let u;c(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:c(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),c(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),c(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let f=t.metadataAvailability,p=t.available,y;if(c(p)&&!c(f)){y=new Hf(e.tilingScheme,p.length);for(let g=0;g<p.length;++g){let x=p[g],S=e.tilingScheme.getNumberOfYTilesAtLevel(g);c(e.overallAvailability[g])||(e.overallAvailability[g]=[]);for(let V=0;V<x.length;++V){let Z=x[V],R=S-Z.endY-1,E=S-Z.startY-1;e.overallAvailability[g].push([Z.startX,R,Z.endX,E]),y.addAvailableTileRange(g,Z.startX,R,Z.endX,E)}}}else c(f)&&(u=new Hf(e.tilingScheme,d),y=new Hf(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],y.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,c(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new aTt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:l,availability:y,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:f,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let h=t.parentUrl;return c(h)?c(y)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await u7(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function cTt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(c(t)&&(i+=` -${t.message}`),e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,i),e.previousError.retry)return u7(e,n);throw new le(i)}async function lTt(e,t,n){await wSe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Hf(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 l=s[a];o.addAvailableTileRange(r,l[0],l[1],l[2],l[3])}}}if(e.attribution.length>0){let o=new Ct(e.attribution);e.tileCredits.push(o)}return!0}async function u7(e,t){try{let n=await e.layerJsonResource.fetchJson();return lTt(e,n,t)}catch(n){return c(n)&&n.statusCode===404?(await wSe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):cTt(e,n,t)}}function zf(e){e=e??z.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new ye;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 l7={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function ISe(e){return!c(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 dTt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Da({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 uTt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,l=3,d=l+1,u=Float64Array.BYTES_PER_ELEMENT*l,f=Float64Array.BYTES_PER_ELEMENT*d,y=Uint16Array.BYTES_PER_ELEMENT*3,h=3,g=Uint16Array.BYTES_PER_ELEMENT,x=g*h,S=new DataView(t),V=new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let Z=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let R=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=new ue(new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0)),S.getFloat64(a+u,!0));a+=f;let I=new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let v=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*y,v>64*1024&&(g=Uint32Array.BYTES_PER_ELEMENT,x=g*h);let F=P.subarray(0,v),N=P.subarray(v,2*v),b=P.subarray(v*2,3*v);Fn.zigZagDeltaDecode(F,N,b),a%g!==0&&(a+=g-a%g);let G=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let X=Me.createTypedArrayFromArrayBuffer(v,t,a,G*h);a+=G*x;let W=0,A=X.length;for(let me=0;me<A;++me){let _e=X[me];X[me]=W-_e,_e===0&&++W}let k=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let B=Me.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*g;let O=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Me.createTypedArrayFromArrayBuffer(v,t,a,O);a+=O*g;let U=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let K=Me.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*g;let Q=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let ie=Me.createTypedArrayFromArrayBuffer(v,t,a,Q);a+=Q*g;let j,$;for(;a<S.byteLength;){let me=S.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let _e=S.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,me===l7.OCT_VERTEX_NORMALS&&e._requestVertexNormals)j=new Uint8Array(t,a,v*2);else if(me===l7.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,_e);else if(me===l7.METADATA&&e._requestMetadata){let Ve=S.getUint32(a,!0);if(Ve>0){let Ze=er(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ve).available;if(c(Ze))for(let De=0;De<Ze.length;++De){let Ke=n+De+1,rt=Ze[De],Xt=e._tilingScheme.getNumberOfYTilesAtLevel(Ke);for(let Ht=0;Ht<rt.length;++Ht){let qe=rt[Ht],mn=Xt-qe.endY-1,Dt=Xt-qe.startY-1;e.availability.addAvailableTileRange(Ke,qe.startX,mn,qe.endX,Dt),r.availability.addAvailableTileRange(Ke,qe.startX,mn,qe.endX,Dt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=_e}let ne=e.getLevelMaximumGeometricError(n)*5,be=e._tilingScheme.tileXYToRectangle(i,o,n),Ce=Xn.fromRectangle(be,Z,R,e._tilingScheme.ellipsoid);return new xS({center:V,minimumHeight:Z,maximumHeight:R,boundingSphere:E,orientedBoundingBox:Ce,horizonOcclusionPoint:I,quantizedVertices:P,encodedNormals:j,indices:X,westIndices:B,southIndices:H,eastIndices:K,northIndices:ie,westSkirtHeight:ne,southSkirtHeight:ne,eastSkirtHeight:ne,northSkirtHeight:ne,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:$,credits:e._tileCredits})}zf.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,l=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!c(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let f=m7(this,e,t,n,u,d===0);f.result&&(a=!0,l=l.then(()=>f.promise))}return!c(r)&&a?l.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):PSe(this,e,t,n,r,i)};function PSe(e,t,n,i,o,r){if(!c(o))return Promise.reject(new le("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 l=[];e._requestVertexNormals&&o.hasVertexNormals&&l.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&l.push("watermask"),e._requestMetadata&&o.hasMetadata&&l.push("metadata");let d,u,f=s[(t+a+i)%s.length],p=o.resource;c(p._ionEndpoint)&&!c(p._ionEndpoint.externalType)?(l.length!==0&&(u={extensions:l.join("-")}),d=ISe(void 0)):d=ISe(l);let y=p.getDerivedResource({url:f,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(c(y))return y.then(function(h){return c(h)?c(e._heightmapStructure)?dTt(e,h,i,t,n):uTt(e,h,i,t,n,o):Promise.reject(new le("Mesh buffer doesn't exist."))})}Object.defineProperties(zf.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}}});zf.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};zf.fromIonAssetId=async function(e,t){C.defined("assetId",e);let n=await xd.fromAssetId(e);return zf.fromUrl(n,t)};zf.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e);n.appendForwardSlash();let i=new WSe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await u7(i);let o=new zf(t);return i.build(o),o};zf.prototype.getTileDataAvailable=function(e,t,n){if(!c(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(m7(this,e,t,n,i[r],r===0).result)return;return!1};zf.prototype.loadTileDataAvailability=function(e,t,n){if(!c(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=m7(this,e,t,n,i[r],r===0);if(c(s.promise))return s.promise}};function d7(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,l=n/s|0;return{level:r,x:a,y:l}}function m7(e,t,n,i,o,r){if(!c(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},l=o.availabilityTilesLoaded,d=o.availability,u=d7(o,t,n,i);for(;c(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!l.isTileAvailable(u.level,u.x,u.y)){let f;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,f=o.availabilityPromiseCache[s],!c(f))){let p=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN});f=PSe(e,u.x,u.y,u.level,o,p),c(f)&&(o.availabilityPromiseCache[s]=f,f.then(a))}return{result:!0,promise:f}}u=d7(o,u.x,u.y,u.level)}return{result:!1}}zf._getAvailabilityTile=d7;var _S=zf;var Lno=_(T(),1);function R0(e){e=e??z.EMPTY_OBJECT;let t=e.radius;C.typeOf.number("radius",t);let 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 cl(n),this._workerName="createCircleGeometry"}R0.packedLength=cl.packedLength;R0.pack=function(e,t,n){return C.typeOf.object("value",e),cl.pack(e._ellipseGeometry,t,n)};var vSe=new cl({center:new m,semiMajorAxis:1,semiMinorAxis:1}),za={center:new m,radius:void 0,ellipsoid:re.clone(re.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new We,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};R0.unpack=function(e,t,n){let i=cl.unpack(e,t,vSe);return za.center=m.clone(i._center,za.center),za.ellipsoid=re.clone(i._ellipsoid,za.ellipsoid),za.ellipsoid=re.clone(i._ellipsoid,vSe._ellipsoid),za.height=i._height,za.extrudedHeight=i._extrudedHeight,za.granularity=i._granularity,za.vertexFormat=We.clone(i._vertexFormat,za.vertexFormat),za.stRotation=i._stRotation,za.shadowVolume=i._shadowVolume,c(n)?(za.semiMajorAxis=i._semiMajorAxis,za.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new cl(za),n):(za.radius=i._semiMajorAxis,new R0(za))};R0.createGeometry=function(e){return cl.createGeometry(e._ellipseGeometry)};R0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new R0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(R0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var f7=R0;var wno=_(T(),1);function WL(e){e=e??z.EMPTY_OBJECT;let t=e.radius;C.typeOf.number("radius",t);let 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 Md(n),this._workerName="createCircleOutlineGeometry"}WL.packedLength=Md.packedLength;WL.pack=function(e,t,n){return C.typeOf.object("value",e),Md.pack(e._ellipseGeometry,t,n)};var mTt=new Md({center:new m,semiMajorAxis:1,semiMinorAxis:1}),ru={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};WL.unpack=function(e,t,n){let i=Md.unpack(e,t,mTt);return ru.center=m.clone(i._center,ru.center),ru.ellipsoid=re.clone(i._ellipsoid,ru.ellipsoid),ru.height=i._height,ru.extrudedHeight=i._extrudedHeight,ru.granularity=i._granularity,ru.numberOfVerticalLines=i._numberOfVerticalLines,c(n)?(ru.semiMajorAxis=i._semiMajorAxis,ru.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Md(ru),n):(ru.radius=i._semiMajorAxis,new WL(ru))};WL.createGeometry=function(e){return Md.createGeometry(e._ellipseGeometry)};var h7=WL;var Ano=_(T(),1);function fTt(e){return e=e??z.EMPTY_OBJECT,_S.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var I9=fTt;var Ono=_(T(),1);function hTt(e){return e=e??z.EMPTY_OBJECT,_S.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:re.WGS84})}var TS=hTt;var $no=_(T(),1);function wL(e){e=e??z.EMPTY_OBJECT,C.defined("options.callback",e.callback),C.defined("options.width",e.width),C.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??re.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this._credit=n}Object.defineProperties(wL.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}}});wL.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!c(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let l=a;return Array.isArray(l)&&(l=new Float64Array(l)),new Da({buffer:l,width:r,height:s})})};wL.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};wL.prototype.getTileDataAvailable=function(e,t,n){};wL.prototype.loadTileDataAvailability=function(e,t,n){};var p7=wL;var iio=_(T(),1);var pTt=1953029805,bTt=2917034100;function b7(e,t){if(b7.passThroughDataForTesting)return t;C.typeOf.object("key",e),C.typeOf.object("data",t);let n=e.byteLength;if(n===0||n%4!==0)throw new le("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===pTt||o===bTt)return t;let r=new DataView(e),s=0,a=t.byteLength,l=a-a%8,d=n,u,f=8;for(;s<l;)for(f=(f+8)%24,u=f;s<l&&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&&(f=(f+8)%24,u=f);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}b7.passThroughDataForTesting=!1;var W9=b7;var rio=_(T(),1);function FSe(e){this.proxy=e}FSe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var y7=FSe;var lio=_(T(),1);function ASe(e,t){return Cs("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty(ASe,"EMPTY_OBJECT",{get:function(){return Cs("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),z.EMPTY_OBJECT}});var g7=ASe;var hio=_(T(),1);function rB(){L.throwInstantiationError()}Object.defineProperties(rB.prototype,{credit:{get:L.throwInstantiationError}});rB.getCreditsFromResult=function(e){if(c(e.attributions))return e.attributions.map(Ct.getIonCredit)};rB.prototype.geocode=L.throwInstantiationError;var PL=rB;var bio=_(T(),1),yTt={SEARCH:0,AUTOCOMPLETE:1},Bg=Object.freeze(yTt);var xio=_(T(),1);function MSe(){L.throwInstantiationError()}MSe.createGeometry=function(e){L.throwInstantiationError()};var x7=MSe;var kio=_(T(),1),CTt=_(_7(),1);var Zio=_(T(),1);var Sio=_(T(),1);function gTt(e,t){return(e&t)!==0}var Wc=gTt;var xTt=[1,2,4,8],NSe=15,_Tt=16,TTt=64,STt=128;function pp(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}pp.clone=function(e,t){return c(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 pp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};pp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};pp.prototype.hasSubtree=function(){return Wc(this._bits,_Tt)};pp.prototype.hasImagery=function(){return Wc(this._bits,TTt)};pp.prototype.hasTerrain=function(){return Wc(this._bits,STt)};pp.prototype.hasChildren=function(){return Wc(this._bits,NSe)};pp.prototype.hasChild=function(e){return Wc(this._bits,xTt[e])};pp.prototype.getChildBitmask=function(){return this._bits&NSe};var w9=pp;function VTt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var LTt=VTt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\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x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function su(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(su.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});su.fromUrl=async function(e){C.defined("resourceOrUrl",e);let t=e;typeof t!="string"&&!(t instanceof Ge)&&(C.typeOf.string("resourceOrUrl.url",e.url),t=e.url);let n=Ge.createIfNeeded(t);n.appendForwardSlash();let i=new su;i._resource=n;try{await ZTt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${USe(i,"",1).url}: ${o}`;throw new le(r)}return i};su.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Wc(t,r)?Wc(e,r)&&(s|=1):(s|=2,Wc(e,r)||(s|=1)),i+=s}return i};su.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];Wc(s,2)?Wc(s,1)||(t|=r):(n|=r,Wc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};su.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(c(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),c(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var kSe=new gi("decodeGoogleEarthEnterprisePacket");su.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=USe(this,e,t,n).fetchArrayBuffer();if(!c(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return kSe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,f=-1;if(e!==""){f=e.length+1;let h=d[e];u=r[e],u._bits|=h._bits,delete d[e]}let p=Object.keys(d);p.sort(function(h,g){return h.length-g.length});let y=p.length;for(let h=0;h<y;++h){let g=p[h];if(d[g]!==null){let S=w9.clone(d[g]),V=g.length;if(V===f)S.setParent(u);else if(V>1){let Z=r[g.substring(0,g.length-1)];S.setParent(Z)}r[g]=S}else r[g]=null}})})};su.prototype.populateSubtree=function(e,t,n,i){let o=su.tileXYToQuadKey(e,t,n);return C7(this,o,i)};function C7(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(c(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,l=a[o];if(c(l))return l.then(function(){return s=new Jo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),C7(e,t,s)});if(!c(r)||!r.hasSubtree())return Promise.reject(new le(`Couldn't load metadata for tile ${t}`));if(l=e.getQuadTreePacket(o,r.cnodeVersion,n),!!c(l))return a[o]=l,l.then(function(){return s=new Jo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),C7(e,t,s)}).finally(function(){delete a[o]})}su.prototype.getTileInformation=function(e,t,n){let i=su.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};su.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function USe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var T7,S7;function ZTt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!c(S7)){let n=on("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;S7=sx(n).then(function(){T7=window.cesiumGoogleEarthDbRootParser(CTt),c(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return S7.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=T7.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 l=o.buffer.slice(r,s);return kSe.scheduleTask({buffer:l,type:"DbRoot",key:a},[l])}).then(function(n){let i=T7.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,c(i.endSnippet)&&c(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}c(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let l=r[a],d=l.copyrightString;c(d)&&(o[l.providerId]=new Ct(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=LTt})}var G0=su;var roo=_(T(),1);function SS(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.buffer",e.buffer),C.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),C.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(SS.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var BSe="createVerticesFromGoogleEarthEnterpriseBuffer",RTt=new gi(BSe),GTt=new gi(BSe,Ff.maximumAsynchronousTasks),OSe=new de,V7=new de;SS.prototype.createMesh=function(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,OSe),t.tileXYToRectangle(n,i,o,V7);let d=l.cartographicToCartesian(de.center(V7)),f=40075.16/(1<<o);this._skirtHeight=Math.min(f*8,1e3);let y=(a?GTt:RTt).scheduleTask({buffer:this._buffer,nativeRectangle:OSe,rectangle:V7,relativeToCenter:d,ellipsoid:l,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!c(y))return;let h=this;return y.then(function(g){return h._mesh=new dm(d,new Float32Array(g.vertices),new Uint16Array(g.indices),g.indexCountWithoutSkirts,g.vertexCountWithoutSkirts,g.minimumHeight,g.maximumHeight,ue.clone(g.boundingSphere3D),m.clone(g.occludeePointInScaledSpace),g.numberOfAttributes,Xn.clone(g.orientedBoundingBox),Rc.clone(g.encoding),g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),h._minimumHeight=g.minimumHeight,h._maximumHeight=g.maximumHeight,h._buffer=void 0,h._mesh})};SS.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 c(this._mesh)?wTt(this,i,o):FTt(this,i,o,e)};var ETt=new gi("upsampleQuantizedTerrainMesh",Ff.maximumAsynchronousTasks);SS.prototype.upsample=function(e,t,n,i,o,r,s){if(C.typeOf.object("tilingScheme",e),C.typeOf.number("thisX",t),C.typeOf.number("thisY",n),C.typeOf.number("thisLevel",i),C.typeOf.number("descendantX",o),C.typeOf.number("descendantY",r),C.typeOf.number("descendantLevel",s),s-i>1)throw new L("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let d=t*2!==o,u=n*2===r,f=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),y=ETt.scheduleTask({vertices:l.vertices,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:d,isNorthChild:u,childRectangle:p,ellipsoid:f});if(!c(y))return;let h=this;return y.then(function(g){let x=new Uint16Array(g.vertices),S=Me.createTypedArray(x.length/3,g.indices),V=h._skirtHeight;return new xS({quantizedVertices:x,indices:S,minimumHeight:g.minimumHeight,maximumHeight:g.maximumHeight,boundingSphere:ue.clone(g.boundingSphere),orientedBoundingBox:Xn.clone(g.orientedBoundingBox),horizonOcclusionPoint:m.clone(g.horizonOcclusionPoint),westIndices:g.westIndices,southIndices:g.southIndices,eastIndices:g.eastIndices,northIndices:g.northIndices,westSkirtHeight:V,southSkirtHeight:V,eastSkirtHeight:V,northSkirtHeight:V,childTileMask:0,createdByUpsampling:!0,credits:h._credits})})};SS.prototype.isChildAvailable=function(e,t,n,i){C.typeOf.number("thisX",e),C.typeOf.number("thisY",t),C.typeOf.number("childX",n),C.typeOf.number("childY",i);let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};SS.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var XTt=new D,ITt=new D,WTt=new D,YSe=new m;function wTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let d=s[a],u=s[a+1],f=s[a+2],p=r.decodeTextureCoordinates(o,d,XTt),y=r.decodeTextureCoordinates(o,u,ITt),h=r.decodeTextureCoordinates(o,f,WTt),g=Z0.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,h.x,h.y,YSe);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){let x=r.decodeHeight(o,d),S=r.decodeHeight(o,u),V=r.decodeHeight(o,f);return g.x*x+g.y*S+g.z*V}}}var PTt=Uint16Array.BYTES_PER_ELEMENT,DSe=Uint32Array.BYTES_PER_ELEMENT,L7=Int32Array.BYTES_PER_ELEMENT,vTt=Float32Array.BYTES_PER_ELEMENT,Z7=Float64Array.BYTES_PER_ELEMENT;function FTt(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 l=new DataView(o),d=0;for(let E=0;E<r;++E)d+=l.getUint32(d,!0),d+=DSe;d+=DSe,d+=2*Z7;let u=w.toRadians(l.getFloat64(d,!0)*180);d+=Z7;let f=w.toRadians(l.getFloat64(d,!0)*180);d+=Z7;let p=i.width/u/2,y=i.height/f/2,h=l.getInt32(d,!0);d+=L7;let g=l.getInt32(d,!0)*3;d+=L7,d+=L7;let x=new Array(h),S=new Array(h),V=new Array(h),Z;for(Z=0;Z<h;++Z)x[Z]=s+l.getUint8(d++)*p,S[Z]=a+l.getUint8(d++)*y,V[Z]=l.getFloat32(d,!0)*6371010,d+=vTt;let R=new Array(g);for(Z=0;Z<g;++Z)R[Z]=l.getUint16(d,!0),d+=PTt;for(Z=0;Z<g;Z+=3){let E=R[Z],I=R[Z+1],v=R[Z+2],P=x[E],F=x[I],N=x[v],b=S[E],G=S[I],X=S[v],W=Z0.computeBarycentricCoordinates(t,n,P,b,F,G,N,X,YSe);if(W.x>=-1e-15&&W.y>=-1e-15&&W.z>=-1e-15)return W.x*V[E]+W.y*V[I]+W.z*V[v]}}var vL=SS;var Voo=_(T(),1);var _m={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},sB=new ee;function aB(){this._terrainCache={},this._lastTidy=ee.now()}aB.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};aB.prototype.get=function(e){let n=this._terrainCache[e];if(c(n))return delete this._terrainCache[e],n.buffer};aB.prototype.tidy=function(){if(ee.now(sB),ee.secondsDifference(sB,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];ee.secondsDifference(sB,r.timestamp)>10&&delete e[o]}ee.clone(sB,this._lastTidy)}};function Yg(e){e=e??z.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-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 aB,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ye}Object.defineProperties(Yg.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(){}}});Yg.fromMetadata=function(e,t){if(C.defined("metadata",e),!e.terrainPresent)throw new le(`The server ${e.url} doesn't have terrain`);let n=new Yg(t);return n._metadata=e,n};var ATt=new gi("decodeGoogleEarthEnterprisePacket");function HSe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===_m.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());c(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}Yg.prototype.requestTileGeometry=function(e,t,n,i){let o=G0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!c(a))return Promise.reject(new le("Terrain tile doesn't exist"));let l=a.terrainState;c(l)||(l=a.terrainState=_m.UNKNOWN);let d=r.get(o);if(c(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new vL({buffer:d,childTileMask:HSe(o,a,s),credits:c(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(l===_m.NONE)return Promise.reject(new le("Terrain tile doesn't exist"))}else return Promise.resolve(new Da({buffer:new Uint8Array(16*16),width:16,height:16}));let u,f=o,p=-1;switch(l){case _m.SELF:p=a.terrainVersion;break;case _m.PARENT:f=f.substring(0,f.length-1),u=s.getTileInformationFromQuadKey(f),p=u.terrainVersion;break;case _m.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(f=f.substring(0,f.length-1),u=s.getTileInformationFromQuadKey(f),c(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new le("Terrain tile doesn't exist"));let y=this._terrainPromises,h=this._terrainRequests,g,x;if(c(y[f]))g=y[f],x=h[f];else{x=i;let S=MTt(this,f,p,x).fetchArrayBuffer();if(!c(S))return;g=S.then(function(V){return c(V)?ATt.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(Z){let R=s.getTileInformationFromQuadKey(f);R.terrainState=_m.SELF,r.add(f,Z[0]);let E=R.terrainProvider,I=Z.length-1;for(let v=0;v<I;++v){let P=f+v.toString(),F=s.getTileInformationFromQuadKey(P);c(F)&&(r.add(P,Z[v+1]),F.terrainState=_m.PARENT,F.terrainProvider===0&&(F.terrainProvider=E))}}):Promise.reject(new le("Failed to load terrain."))}),y[f]=g,h[f]=x,g=g.finally(function(){delete y[f],delete h[f]})}return g.then(function(){let S=r.get(o);if(c(S)){let V=s.providers[a.terrainProvider];return new vL({buffer:S,childTileMask:HSe(o,a,s),credits:c(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new le("Failed to load terrain."))}).catch(function(S){return x.state===jn.CANCELLED?(i.state=x.state,Promise.reject(S)):(a.terrainState=_m.NONE,Promise.reject(S))})};Yg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Yg.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=G0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(c(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===_m.NONE)return!1;if((!c(s)||s===_m.UNKNOWN)&&(r.terrainState=_m.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!c(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};Yg.prototype.loadTileDataAvailability=function(e,t,n){};function MTt(e,t,n,i){return n=c(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var R7=Yg;var Poo=_(T(),1);var NTt="https://maps.googleapis.com/maps/api/geocode/json",zSe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function G7(e){e=e??z.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new L("options.key is required.");this._resource=new Ge({url:NTt,queryParameters:{key:t}}),this._credit=new Ct(zSe,!0)}Object.defineProperties(G7.prototype,{credit:{get:function(){return this._credit}}});G7.prototype.geocode=async function(e){C.typeOf.string("query",e);let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new le(`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:de.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:zSe,collapsible:!1}}})};var E7=G7;var Moo=_(T(),1);var cB={};cB.defaultApiKey=void 0;cB.mapTilesApiEndpoint=new Ge({url:"https://tile.googleapis.com/v1/"});cB.getDefaultCredit=function(){return new Ct('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var CS=cB;var Uoo=_(T(),1);var P9={};P9.type=void 0;P9.getRequiredDataPoints=L.throwInstantiationError;P9.interpolateOrderZero=L.throwInstantiationError;P9.interpolate=L.throwInstantiationError;var X7=P9;var Doo=_(T(),1),kTt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},E0=Object.freeze(kTt);var cro=_(T(),1);var joo=_(T(),1);function I7(e){C.defined("url",e),this._url=Ge.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(I7.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});I7.prototype.geocode=async function(e,t){return C.typeOf.string("query",e),this._url.getDerivedResource({url:t===Bg.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(c(s))r=de.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],l=o.geometry.coordinates[1];r=m.fromDegrees(a,l)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var v9=I7;function KSe(e){if(!Object.values(E0).some(t=>t===e))throw new L(`Invalid geocodeProviderType: "${e}"`)}var JSe=Object.freeze({[E0.GOOGLE]:"google",[E0.BING]:"bing",[E0.DEFAULT]:void 0});function UTt(e){return JSe[e]}function OTt(e){return Object.entries(JSe).find(t=>t[1]===e)[0]}function W7(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.scene",e.scene);let t=e.geocodeProviderType??E0.DEFAULT;KSe(t);let n=e.accessToken??Ym.defaultAccessToken,i=Ge.createIfNeeded(e.server??Ym.defaultServer);i.appendForwardSlash();let o=Ym.getDefaultTokenCredit(n);c(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Ct.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});c(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new v9(r),this.geocodeProviderType=t}Object.defineProperties(W7.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return OTt(this._pelias.url.queryParameters.geocoder)},set:function(e){KSe(e);let t={...this._pelias.url.queryParameters,geocoder:UTt(e)};c(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});W7.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var VS=W7;var pro=_(T(),1);var Eo={};Eo.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Eo.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Eo.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Eo.defaultAccessToken=void 0;Eo.defaultShareKey=void 0;Eo._getAuthorizationHeader=function(){if(!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");return c(Eo.defaultShareKey)?`Basic ${Eo.defaultShareKey}`:`Bearer ${Eo.defaultAccessToken}`};Eo.apiEndpoint=new Ge({url:"https://api.bentley.com"});Eo.getExports=async function(e){if(C.typeOf.string("iModelId",e),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let t=new Ge({url:`${Eo.apiEndpoint}mesh-export`,headers:{Authorization:Eo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Eo.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);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new le(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new le("Not allowed, forbidden");if(n.statusCode===422)throw new le(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new le("Too many requests")}throw new le(`Unknown request failure ${n.statusCode}`)}};Eo.getRealityDataMetadata=async function(e,t){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let n=new Ge({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Eo._getAuthorizationHeader(),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);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new le(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new le("Not allowed, forbidden");if(i.statusCode===404)throw new le(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new le(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new le("Too many requests")}throw new le(`Unknown request failure ${i.statusCode}`)}};Eo.getRealityDataURL=async function(e,t,n){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),C.typeOf.string("rootDocument",n),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=new Ge({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Eo._getAuthorizationHeader(),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);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new le(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new le("Not allowed, forbidden");if(o.statusCode===404)throw new le(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new le(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new le("Too many requests")}throw new le(`Unknown request failure ${o.statusCode}`)}};var as=Eo;var gro=_(T(),1);function lB(){L.throwInstantiationError()}Object.defineProperties(lB.prototype,{ellipsoid:{get:L.throwInstantiationError}});lB.prototype.project=L.throwInstantiationError;lB.prototype.unproject=L.throwInstantiationError;var w7=lB;var Lro=_(T(),1);function FL(e){e=e??z.EMPTY_OBJECT;let t=e.weights,n=e.times;if(C.defined("weights",t),C.defined("times",n),C.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!==0)throw new L("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(FL.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});FL.prototype.findTimeInterval=Pi.prototype.findTimeInterval;FL.prototype.wrapTime=Pi.prototype.wrapTime;FL.prototype.clampTime=Pi.prototype.clampTime;FL.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]);c(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 P7=FL;var Pro=_(T(),1);function v7(e,t,n){C.defined("url",e),C.defined("apiKey",t),c(n)&&C.typeOf.object("params",n),e=Ge.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Ct('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(v7.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});v7.prototype.geocode=async function(e){return C.typeOf.string("query",e),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(c(r))o=de.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 F7=v7;var Aro=_(T(),1);var DTt={packedLength:void 0,pack:L.throwInstantiationError,unpack:L.throwInstantiationError},A7=DTt;var kro=_(T(),1);var BTt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:L.throwInstantiationError,unpackInterpolationResult:L.throwInstantiationError},M7=BTt;var Yro=_(T(),1);var YTt=new m;function HTt(e,t,n,i){let o=px(e,t,n,i,YTt);return c(o)?o.x>0&&o.y>0&&o.z>0:!1}var N7=HTt;var Kro=_(T(),1);function QSe(){L.throwInstantiationError()}QSe.prototype.getURL=L.throwInstantiationError;var k7=QSe;var mso=_(T(),1);function zTt(e,t,n,i,o,r,s){let a=vi.numberOfPoints(e,t,o),l,d=n.red,u=n.green,f=n.blue,p=n.alpha,y=i.red,h=i.green,g=i.blue,x=i.alpha;if(Y.equals(n,i)){for(l=0;l<a;l++)r[s++]=Y.floatToByte(d),r[s++]=Y.floatToByte(u),r[s++]=Y.floatToByte(f),r[s++]=Y.floatToByte(p);return s}let S=(y-d)/a,V=(h-u)/a,Z=(g-f)/a,R=(x-p)/a,E=s;for(l=0;l<a;l++)r[E++]=Y.floatToByte(d+l*S),r[E++]=Y.floatToByte(u+l*V),r[E++]=Y.floatToByte(f+l*Z),r[E++]=Y.floatToByte(p+l*R);return E}function F9(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new L("At least two positions are required.");if(c(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new L("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??Kt.GEODESIC,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??re.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=c(n)?1+n.length*Y.packedLength:1,this.packedLength=o+re.packedLength+3}F9.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=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=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=Y.packedLength)Y.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};F9.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=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+=Y.packedLength)s[i]=Y.unpack(e,t);let a=re.unpack(e,t);t+=re.packedLength;let l=e[t++]===1,d=e[t++],u=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=l,n._arcType=d,n._granularity=u,n):new F9({positions:r,colors:s,ellipsoid:a,colorsPerVertex:l,arcType:d,granularity:u})};var dB=new Array(2),uB=new Array(2),KTt={positions:dB,height:uB,ellipsoid:void 0,minDistance:void 0,granularity:void 0};F9.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),l=c(n)&&!i,d,u=t.length,f,p,y,h,g=0;if(o===Kt.GEODESIC||o===Kt.RHUMB){let R,E,I;o===Kt.GEODESIC?(R=w.chordLength(r,s.maximumRadius),E=vi.numberOfPoints,I=vi.generateArc):(R=r,E=vi.numberOfPointsRhumbLine,I=vi.generateRhumbArc);let v=vi.extractHeights(t,s),P=KTt;if(o===Kt.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,l){let F=0;for(d=0;d<u-1;d++)F+=E(t[d],t[d+1],R)+1;f=new Float64Array(F*3),y=new Uint8Array(F*4),P.positions=dB,P.height=uB;let N=0;for(d=0;d<u-1;++d){dB[0]=t[d],dB[1]=t[d+1],uB[0]=v[d],uB[1]=v[d+1];let b=I(P);if(c(n)){let G=b.length/3;h=n[d];for(let X=0;X<G;++X)y[N++]=Y.floatToByte(h.red),y[N++]=Y.floatToByte(h.green),y[N++]=Y.floatToByte(h.blue),y[N++]=Y.floatToByte(h.alpha)}f.set(b,g),g+=b.length}}else if(P.positions=t,P.height=v,f=new Float64Array(I(P)),c(n)){for(y=new Uint8Array(f.length/3*4),d=0;d<u-1;++d){let N=t[d],b=t[d+1],G=n[d],X=n[d+1];g=zTt(N,b,G,X,a,y,g)}let F=n[u-1];y[g++]=Y.floatToByte(F.red),y[g++]=Y.floatToByte(F.green),y[g++]=Y.floatToByte(F.blue),y[g++]=Y.floatToByte(F.alpha)}}else{p=l?u*2-2:u,f=new Float64Array(p*3),y=c(n)?new Uint8Array(p*4):void 0;let R=0,E=0;for(d=0;d<u;++d){let I=t[d];if(l&&d>0&&(m.pack(I,f,R),R+=3,h=n[d-1],y[E++]=Y.floatToByte(h.red),y[E++]=Y.floatToByte(h.green),y[E++]=Y.floatToByte(h.blue),y[E++]=Y.floatToByte(h.alpha)),l&&d===u-1)break;m.pack(I,f,R),R+=3,c(n)&&(h=n[d],y[E++]=Y.floatToByte(h.red),y[E++]=Y.floatToByte(h.green),y[E++]=Y.floatToByte(h.blue),y[E++]=Y.floatToByte(h.alpha))}}let x=new fn;x.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f}),c(n)&&(x.color=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0})),p=f.length/3;let S=(p-1)*2,V=Me.createTypedArray(p,S),Z=0;for(d=0;d<p-1;++d)V[Z++]=d,V[Z++]=d+1;return new dt({attributes:x,indices:V,primitiveType:ve.LINES,boundingSphere:ue.fromPoints(t)})};var U7=F9;var xso=_(T(),1);function AL(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Js(i),this._workerName="createSphereGeometry"}AL.packedLength=Js.packedLength;AL.pack=function(e,t,n){return C.typeOf.object("value",e),Js.pack(e._ellipsoidGeometry,t,n)};var JTt=new Js,Hg={radius:void 0,radii:new m,vertexFormat:new We,stackPartitions:void 0,slicePartitions:void 0};AL.unpack=function(e,t,n){let i=Js.unpack(e,t,JTt);return Hg.vertexFormat=We.clone(i._vertexFormat,Hg.vertexFormat),Hg.stackPartitions=i._stackPartitions,Hg.slicePartitions=i._slicePartitions,c(n)?(m.clone(i._radii,Hg.radii),n._ellipsoidGeometry=new Js(Hg),n):(Hg.radius=i._radii.x,new AL(Hg))};AL.createGeometry=function(e){return Js.createGeometry(e._ellipsoidGeometry)};var O7=AL;var Sso=_(T(),1);function QTt(e){return C.defined("value",e),e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var LS=QTt;var Lso=_(T(),1);function zg(e){throw new L("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(zg.prototype,{ellipsoid:{get:L.throwInstantiationError},rectangle:{get:L.throwInstantiationError},projection:{get:L.throwInstantiationError}});zg.prototype.getNumberOfXTilesAtLevel=L.throwInstantiationError;zg.prototype.getNumberOfYTilesAtLevel=L.throwInstantiationError;zg.prototype.rectangleToNativeRectangle=L.throwInstantiationError;zg.prototype.tileXYToNativeRectangle=L.throwInstantiationError;zg.prototype.tileXYToRectangle=L.throwInstantiationError;zg.prototype.positionToTileXY=L.throwInstantiationError;var D7=zg;var Wso=_(T(),1);function ZS(e){e=e??z.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=e.epoch??Ye.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(ZS.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(c(t)&&(this._clockSubscription(),this._clockSubscription=void 0),c(e)&&(this._clockSubscription=e.onTick.addEventListener(ZS.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(c(t)&&t.removeEventListener("seeked",this._seekFunction,!1),c(e)&&(this._seeking=!1,this._seekFunction=jTt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});ZS.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,he(this)};ZS.prototype.isDestroyed=function(){return!1};ZS.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};ZS.prototype._onTick=function(e){let t=this._element;if(!c(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=this.epoch??Ye.MINIMUM_VALUE,s=ee.secondsDifference(o,r),a=t.duration,l,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),l=s):s>a?l=a:s<0?l=0:l=s;let u=i?this.tolerance??1:.001;Math.abs(l-d)>u&&(this._seeking=!0,t.currentTime=l)};function jTt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var B7=ZS;var Jso=_(T(),1);function qTt(e,t){this.rectangle=e,this.maxLevel=t}function jSe(e){this.ellipsoid=e.ellipsoid??re.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}jSe.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 $Tt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({ellipsoid:e.ellipsoid});else throw new le(`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=rs.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"))),l=w.toRadians(parseFloat(s.getAttribute("miny"))),d=w.toRadians(parseFloat(s.getAttribute("maxx"))),u=w.toRadians(parseFloat(s.getAttribute("maxy"))),f=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new qTt(new de(a,l,d,u),f))}}function eSt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i=`${i}: ${t.message}`),Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new le(i)}async function tSt(e,t,n){try{let i=await t.fetchXML();$Tt(e,i)}catch(i){eSt(t,i,n)}}function Kg(e){e=e??z.EMPTY_OBJECT,this._errorEvent=new ye,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(Kg.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(){}}});Kg.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=new jSe(t),i=Ge.createIfNeeded(e);await tSt(n,i);let o=new Kg(t);return n.build(o),o._resource=i,o};Kg.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(!c(s))return;let a=this;return Promise.resolve(s).then(function(l){return new Da({buffer:Rm(l),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:nSt(a,e,t,n),structure:a._terrainDataStructure})})};Kg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var qSe=new de;function nSt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let l=0;l<r.length&&a!==15;++l){let d=r[l];if(d.maxLevel<=i)continue;let u=d.rectangle,f=de.intersection(u,s,qSe);c(f)&&(mB(o,u,t*2,n*2,i+1)&&(a|=4),mB(o,u,t*2+1,n*2,i+1)&&(a|=8),mB(o,u,t*2,n*2+1,i+1)&&(a|=1),mB(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function mB(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return c(de.intersection(r,t,qSe))}Kg.prototype.getTileDataAvailable=function(e,t,n){};Kg.prototype.loadTileDataAvailability=function(e,t,n){};var Y7=Kg;var jso=_(T(),1),iSt={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},H7=Object.freeze(iSt);var eao=_(T(),1);function oSt(e){switch(e){case oe.FLOAT:return"float";case oe.FLOAT_VEC2:return"vec2";case oe.FLOAT_VEC3:return"vec3";case oe.FLOAT_VEC4:return"vec4";case oe.FLOAT_MAT2:return"mat2";case oe.FLOAT_MAT3:return"mat3";case oe.FLOAT_MAT4:return"mat4";case oe.SAMPLER_2D:return"sampler2D";case oe.BOOL:return"bool"}}var z7=oSt;var iao=_(T(),1);function rSt(e,t,n){if(typeof t!="function")throw new L("oldFunction is required to be a function.");if(typeof n!="function")throw new L("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}}var A9=rSt;var cao=_(T(),1);var sSt=new m(1,1,1);function K7(e){e=e??sSt,C.defined("dimensions",e),C.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),C.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),C.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=m.clone(e)}Object.defineProperties(K7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){C.defined("value",e),C.typeOf.number.greaterThanOrEquals("value.x",e.x,0),C.typeOf.number.greaterThanOrEquals("value.y",e.y,0),C.typeOf.number.greaterThanOrEquals("value.z",e.z,0),m.clone(e,this._dimensions)}}});var aSt=new m;K7.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,aSt),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 J7=K7;var uao=_(T(),1);function bp(){this.featurePropertiesDirty=!1}Object.defineProperties(bp.prototype,{featuresLength:{get:function(){L.throwInstantiationError()}},pointsLength:{get:function(){L.throwInstantiationError()}},trianglesLength:{get:function(){L.throwInstantiationError()}},geometryByteLength:{get:function(){L.throwInstantiationError()}},texturesByteLength:{get:function(){L.throwInstantiationError()}},batchTableByteLength:{get:function(){L.throwInstantiationError()}},innerContents:{get:function(){L.throwInstantiationError()}},ready:{get:function(){L.throwInstantiationError()}},tileset:{get:function(){L.throwInstantiationError()}},tile:{get:function(){L.throwInstantiationError()}},url:{get:function(){L.throwInstantiationError()}},batchTable:{get:function(){L.throwInstantiationError()}},metadata:{get:function(){L.throwInstantiationError()},set:function(e){L.throwInstantiationError()}},group:{get:function(){L.throwInstantiationError()},set:function(e){L.throwInstantiationError()}}});bp.prototype.hasProperty=function(e,t){L.throwInstantiationError()};bp.prototype.getFeature=function(e){L.throwInstantiationError()};bp.prototype.applyDebugSettings=function(e,t){L.throwInstantiationError()};bp.prototype.applyStyle=function(e){L.throwInstantiationError()};bp.prototype.update=function(e,t){L.throwInstantiationError()};bp.prototype.pick=function(e,t,n){L.throwInstantiationError()};bp.prototype.isDestroyed=function(){L.throwInstantiationError()};bp.prototype.destroy=function(){L.throwInstantiationError()};var Q7=bp;var Lao=_(T(),1);var bao=_(T(),1);function ML(e,t){this._conditionsExpression=He(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,lSt(this,t)}Object.defineProperties(ML.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function cSt(e,t){this.condition=e,this.expression=t}function lSt(e,t){let n=[],i=e._conditions;if(!c(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),l=String(s[1]);n.push(new cSt(new Iu(a,t),new Iu(l,t)))}e._runtimeConditions=n}ML.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!c(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)}};ML.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!c(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)}};ML.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!c(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let l=o[a],d=l.condition.getShaderExpression(t,n),u=l.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d}) - { - return ${u}; - } -`}return r=`${i} ${e} -{ -${r} return ${i}(1.0); -} -`,r};ML.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!c(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 M9=ML;function Jg(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,dSt(this,e)}function dSt(e,t){t=He(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(c(t.meta)){let i=t.defines,o=t.meta??z.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Iu(o[r],i))}e._meta=n,e._ready=!0}function cr(e,t){let n=(e._style??z.EMPTY_OBJECT).defines;if(c(t)){if(typeof t=="boolean"||typeof t=="number")return new Iu(String(t));if(typeof t=="string")return new Iu(t,n);if(c(t.conditions))return new M9(t,n)}else return;return t}function lr(e){if(c(e)){if(c(e.expression))return e.expression;if(c(e.conditionsExpression))return He(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Jg.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=cr(this,e),this._style.show=lr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=cr(this,e),this._style.color=lr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=cr(this,e),this._style.pointSize=lr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=cr(this,e),this._style.pointOutlineColor=lr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=cr(this,e),this._style.pointOutlineWidth=lr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=cr(this,e),this._style.labelColor=lr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=cr(this,e),this._style.labelOutlineColor=lr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=cr(this,e),this._style.labelOutlineWidth=lr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=cr(this,e),this._style.font=lr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=cr(this,e),this._style.labelStyle=lr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=cr(this,e),this._style.labelText=lr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=cr(this,e),this._style.backgroundColor=lr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=cr(this,e),this._style.backgroundPadding=lr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=cr(this,e),this._style.backgroundEnabled=lr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=cr(this,e),this._style.scaleByDistance=lr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=cr(this,e),this._style.translucencyByDistance=lr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=cr(this,e),this._style.distanceDisplayCondition=lr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=cr(this,e),this._style.heightOffset=lr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=cr(this,e),this._style.anchorLineEnabled=lr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=cr(this,e),this._style.anchorLineColor=lr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=cr(this,e),this._style.image=lr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=cr(this,e),this._style.disableDepthTestDistance=lr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=cr(this,e),this._style.horizontalOrigin=lr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=cr(this,e),this._style.verticalOrigin=lr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=cr(this,e),this._style.labelHorizontalOrigin=lr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=cr(this,e),this._style.labelVerticalOrigin=lr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Jg.fromUrl=function(e){if(!c(e))throw new L("url is required");return Ge.createIfNeeded(e).fetchJson(e).then(function(n){return new Jg(n)})};Jg.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,c(this.color)&&c(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Jg.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,c(this.show)&&c(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Jg.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,c(this.pointSize)&&c(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Jg.prototype.getVariables=function(){let e=[];return c(this.color)&&c(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),c(this.show)&&c(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),c(this.pointSize)&&c(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=Jg;var ico=_(T(),1);var Xao=_(T(),1);function N9(e){e=e??z.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new mS({comparator:N9.comparator})}N9.prototype.addSubtree=function(e){let t=new uSt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates();if(this.find(i)===void 0)throw new L("parent node needs to exist")}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};N9.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}};N9.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 uSt(e,t){this.subtree=e,this.stamp=t}var k9=N9;function U9(e){e=e??z.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=m.ZERO.clone(),paddingAfter:l=m.ZERO.clone(),globalTransform:d=M.IDENTITY.clone(),shapeTransform:u=M.IDENTITY.clone(),minBounds:f,maxBounds:p,minimumValues:y,maximumValues:h,maximumTileCount:g}=e;C.typeOf.string("className",t),C.typeOf.object("names",n),C.typeOf.object("types",i),C.typeOf.object("componentTypes",o),C.typeOf.string("shape",r),C.typeOf.object("dimensions",s),this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=f,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=l,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===La.ELLIPSOID?gm.Z_UP:gm.Y_UP,this._minimumValues=y,this._maximumValues=h,this._maximumTileCount=g,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new k9}Object.defineProperties(U9.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}}});U9.fromUrl=async function(e){C.defined("url",e);let t=Ge.createIfNeeded(e),n=await t.fetchJson();fSt(n);let i=_St(n,t);await i.load();let{root:o}=n,r=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new K_({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],l=a.class,d=TSt(s,l);Object.assign(d,hSt(o)),c(o.transform)?d.globalTransform=M.unpack(o.transform):d.globalTransform=M.clone(M.IDENTITY),d.dimensions=m.unpack(a.dimensions),d.maximumTileCount=mSt(s),c(a.padding)&&(d.paddingBefore=m.unpack(a.padding.before),d.paddingAfter=m.unpack(a.padding.after));let u=new U9(d),f=new Q_(t,o,i.schema);return u._implicitTileset=f,u._availableLevels=f.availableLevels,Ri.unload(i),u};function mSt(e){if(c(e.tileset))return e.tileset.getPropertyBySemantic(y_.TILESET_TILE_COUNT)}function fSt(e){let t=e.root;if(!c(t.content))throw new le("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new le("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!c(t.implicitTiling))throw new le("Root tile must have implicit tiling");if(!c(e.schema)&&!c(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new le("Tileset must have a metadata schema")}function hSt(e){let t=e.boundingVolume;if(c(t.box))return gSt(t.box);if(c(t.region))return pSt(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return xSt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new le("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function pSt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(re.WGS84.radii),l=new m(t,n,r),d=new m(i,o,s);return{shape:La.ELLIPSOID,minBounds:l,maxBounds:d,shapeTransform:a}}var bSt=new m,ySt=new te;function gSt(e){let t=Xn.unpack(e),n=te.getScale(t.halfAxes,bSt),i=te.getRotation(t.halfAxes,ySt);return{shape:La.BOX,minBounds:m.negate(n,new m),maxBounds:m.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function xSt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-w.PI,maxAngle:r=w.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e;C.typeOf.number("minRadius",t),C.typeOf.number("maxRadius",n),C.typeOf.number("height",i),C.typeOf.number("minAngle",o),C.typeOf.number("maxAngle",r),C.typeOf.object("translation",s),C.typeOf.object("rotation",a);let l=-.5*i+s[2],d=.5*i+s[2],u=M.fromTranslationQuaternionRotationScale(m.unpack(s),Fe.unpack(a),m.ONE);return{shape:La.CYLINDER,minBounds:m.fromElements(t,o,l),maxBounds:m.fromElements(n,r,d),shapeTransform:u}}function _St(e,t){let{schemaUri:n,schema:i}=e;return c(n)?Ri.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ri.getSchemaLoader({schema:i})}function TSt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([y,h])=>{let{type:g,componentType:x}=h,S=o?.properties[y].min,V=o?.properties[y].max,Z=lt.getComponentCount(g),R=$Se(S,Z),E=$Se(V,Z);return{id:y,type:g,componentType:x,minValue:R,maxValue:E}}),a=s.map(y=>y.id),l=s.map(y=>y.type),d=s.map(y=>y.componentType),u=s.map(y=>y.minValue),f=s.map(y=>y.maxValue),p=u.some(c);return{className:t,names:a,types:l,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?f:void 0}}function $Se(e,t){if(!c(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function SSt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(c(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),c(o))return o;let l=Gb(a);return o=await b_.fromSubtreeJson(s,l.jsonPayload,l.binaryPayload,n,t),i.addSubtree(o),o}U9.prototype.requestData=async function(e){e=e??z.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 j_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=a.isSubtreeRoot()&&a.level>0,d=l?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),f=await SSt(this,d);if(!(l?f.childSubtreeIsAvailableAtCoordinates:f.tileIsAvailableAtCoordinates).call(f,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:h,baseResource:g}=s,x=h[0].getDerivedResource({templateValues:a.getTemplateValues()}),S=g.getDerivedResource({url:x.url});return cS.fromGltf(S)};var j7=U9;var cco=_(T(),1);function q7(e){e=e??1,C.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(q7.prototype,{radius:{get:function(){return this._radius},set:function(e){C.typeOf.number.greaterThan("value",e,0),this._radius=e}}});q7.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 O9=q7;var tlo=_(T(),1);var dco=_(T(),1),$7={CUMULUS:0};$7.validate=function(e){return e===$7.CUMULUS};var GS=Object.freeze($7);var gco=_(T(),1);function Kf(e,t){if(e=e??z.EMPTY_OBJECT,this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),!c(e.scale)&&c(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(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(e.maximumSize??n)}this._slice=e.slice??-1,this._color=Y.clone(e.color??Y.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var CSt=Kf.SHOW_INDEX=0,VSt=Kf.POSITION_INDEX=1,LSt=Kf.SCALE_INDEX=2,ZSt=Kf.MAXIMUM_SIZE_INDEX=3,RSt=Kf.SLICE_INDEX=4,GSt=Kf.BRIGHTNESS_INDEX=5,ESt=Kf.COLOR_INDEX=6;Kf.NUMBER_OF_PROPERTIES=7;function ES(e,t){let n=e._cloudCollection;c(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Kf.prototype,{show:{get:function(){return this._show},set:function(e){C.typeOf.bool("value",e),this._show!==e&&(this._show=e,ES(this,CSt))}},position:{get:function(){return this._position},set:function(e){C.typeOf.object("value",e);let t=this._position;m.equals(t,e)||(m.clone(e,t),ES(this,VSt))}},scale:{get:function(){return this._scale},set:function(e){C.typeOf.object("value",e);let t=this._scale;D.equals(t,e)||(D.clone(e,t),ES(this,LSt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){C.typeOf.object("value",e);let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),ES(this,ZSt))}},color:{get:function(){return this._color},set:function(e){C.typeOf.object("value",e);let t=this._color;Y.equals(t,e)||(Y.clone(e,t),ES(this,ESt))}},slice:{get:function(){return this._slice},set:function(e){C.typeOf.number("value",e),this._slice!==e&&(this._slice=e,ES(this,RSt))}},brightness:{get:function(){return this._brightness},set:function(e){C.typeOf.number("value",e),this._brightness!==e&&(this._brightness=e,ES(this,GSt))}}});Kf.prototype._destroy=function(){this._cloudCollection=void 0};var au=Kf;var cu,fB=new m,XSt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},ISt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},WSt=au.SHOW_INDEX,wSt=au.POSITION_INDEX,PSt=au.SCALE_INDEX,vSt=au.MAXIMUM_SIZE_INDEX,FSt=au.SLICE_INDEX,ASt=au.BRIGHTNESS_INDEX,MSt=au.NUMBER_OF_PROPERTIES,NSt=au.COLOR_INDEX;function Jf(e){e=e??z.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(MSt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=m.clone(e.noiseOffset??m.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:eCe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function eCe(e){return function(){return fB.x=e._textureSliceWidth,fB.y=e._noiseTextureRows,fB.z=1/e._noiseTextureRows,fB}}Object.defineProperties(Jf.prototype,{length:{get:function(){return t6(this),this._clouds.length}}});function tCe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Jf.prototype.add=function(e){e=e??z.EMPTY_OBJECT;let t=e.cloudType??GS.CUMULUS;if(!GS.validate(t))throw new L("invalid cloud type");let n;return t===GS.CUMULUS&&(n=new au(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Jf.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Jf.prototype.removeAll=function(){tCe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function t6(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];c(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Jf.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Jf.prototype.contains=function(e){return c(e)&&e._cloudCollection===this};Jf.prototype.get=function(e){return C.typeOf.number("index",e),t6(this),this._clouds[e]};var kSt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),USt=new Uint16Array([0,1,2,0,2,3]);function OSt(e){let t=_t.createVertexBuffer({context:e,typedArray:kSt,usage:Ne.STATIC_DRAW}),n=_t.createIndexBuffer({context:e,typedArray:USt,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:q.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var n6;function DSt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(c(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=_t.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function BSt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return c(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function YSt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return c(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function HSt(e,t,n){let i=[{index:cu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.packedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.packedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.color,componentsPerAttribute:4,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:cu.direction,componentsPerAttribute:2,componentDatatype:q.FLOAT,vertexBuffer:YSt(e)});let o=n?t:4*t;return new Ip(e,i,o,n)}var e6=new Bn;function nCe(e,t,n,i){let o,r=n[cu.positionHighAndScaleX],s=n[cu.positionLowAndScaleY],a=i.position;Bn.fromCartesian(a,e6);let l=i.scale,d=e6.high,u=e6.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,l.x),s(o,u.x,u.y,u.z,l.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,l.x),r(o+1,d.x,d.y,d.z,l.x),r(o+2,d.x,d.y,d.z,l.x),r(o+3,d.x,d.y,d.z,l.x),s(o+0,u.x,u.y,u.z,l.y),s(o+1,u.x,u.y,u.z,l.y),s(o+2,u.x,u.y,u.z,l.y),s(o+3,u.x,u.y,u.z,l.y))}function iCe(e,t,n,i){let o,r=n[cu.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 oCe(e,t,n,i){let o,r=n[cu.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 rCe(e,t,n,i){let o,r=n[cu.color],s=i.color,a=Y.floatToByte(s.red),l=Y.floatToByte(s.green),d=Y.floatToByte(s.blue),u=Y.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,l,d,u)):(o=i._index*4,r(o+0,a,l,d,u),r(o+1,a,l,d,u),r(o+2,a,l,d,u),r(o+3,a,l,d,u))}function zSt(e,t,n,i){nCe(e,t,n,i),iCe(e,t,n,i),oCe(e,t,n,i),rCe(e,t,n,i)}function KSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows;if(r/s<1||r%s!==0)throw new L("noiseTextureRows must evenly divide textureSliceWidth");let a=t.context;o._vaNoise=OSt(a),o._spNoise=tn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let l=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Pt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA,sampler:new en({wrapS:xn.REPEAT,wrapT:xn.REPEAT,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})});let u=new vc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:eCe(o),u_noiseDetail:function(){return l},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(f){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function JSt(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=HSt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let l=o[a];zSt(e,t,s,l)}n._vaf.commit(n6(i))}}var QSt=[];function jSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,l=i._propertiesChanged,d=QSt;d.length=0,(l[wSt]||l[PSt])&&d.push(nCe),(l[WSt]||l[ASt])&&d.push(iCe),(l[vSt]||l[FSt])&&d.push(oCe),l[NSt]&&d.push(rCe);let u=d.length,f=i._vaf.writers,p,y,h;if(a/r>.1){for(p=0;p<a;++p)for(y=s[p],y._dirty=!1,h=0;h<u;++h)d[h](e,t,f,y);i._vaf.commit(n6(n))}else{for(p=0;p<a;++p){for(y=s[p],y._dirty=!1,h=0;h<u;++h)d[h](e,t,f,y);i._instanced?i._vaf.subCommit(y._index,1):i._vaf.subCommit(y._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function qSt(e,t,n,i){let o=t.context,r=e,s=new Be({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Be({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=tn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:cu}),r._rs=Oe.fromCache({depthTest:{enabled:!0,func:oe.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function $St(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,l=a.length;s.length=l;for(let d=0;d<l;d++){let u=s[d];c(u)||(u=s[d]=new et),u.pass=Xe.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)}}}Jf.prototype.update=function(e){if(t6(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:c(this._noiseTexture),!this._ready&&!this._loading&&!t&&KSt(this,e,wv,Wv),this._instanced=e.context.instancedArrays,cu=this._instanced?ISt:XSt,n6=this._instanced?BSt:DSt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?JSt(this,e):r>0&&jSt(this,e),r>i*1.5&&(o.length=i),!(!c(this._vaf)||!c(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&qSt(this,e,Iv,Xv),$St(this,e))};Jf.prototype.isDestroyed=function(){return!1};Jf.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(),tCe(this._clouds),he(this)};var i6=Jf;var slo=_(T(),1);var eCt=w.toRadians(30);function o6(e){this._angle=e??eCt}Object.defineProperties(o6.prototype,{angle:{get:function(){return this._angle},set:function(e){C.typeOf.number("value",e),this._angle=e}}});o6.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 r6=o6;var Vlo=_(T(),1);var tCt=new Y,nCt=new Y,iCt=new Y,oCt=new Y,sCe=new ce,D9=new Uint8Array(4);function aCe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return Y.lerp(t.color,n.color,o,i)}function hB(e,t){return{height:e,color:Y.clone(t)}}function cCe(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?Y.equals(t.color,i[n-1].color):!1,a=r?Y.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?Y.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function rCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length;if(!Array.isArray(s)||a===0)throw new L("entries must be an array with size > 0.");let l=[];for(n=0;n<a;n++){let y=s[n];if(!c(y.height))throw new L("entry requires a height.");if(!c(y.color))throw new L("entry requires a color.");let h=w.clamp(y.height,id._minimumHeight,id._maximumHeight),g=Y.clone(y.color,tCt);g.red*=g.alpha,g.green*=g.alpha,g.blue*=g.alpha,l.push(hB(h,g))}let d=!0,u=!0;for(n=0;n<a-1;n++){let y=l[n+0],h=l[n+1];d=d&&y.height<=h.height,u=u&&y.height>=h.height}u?l=l.reverse():d||h0(l,function(y,h){return w.sign(y.height-h.height)});let f=r.extendDownwards??!1,p=r.extendUpwards??!1;l.length===1&&!f&&!p&&(f=!0,p=!0),f&&l.splice(0,0,hB(id._minimumHeight,l[0].color)),p&&l.splice(l.length,0,hB(id._maximumHeight,l[l.length-1].color)),l=cCe(l),i.push(l)}return i}function sCt(e){let t=rCt(e),n=[],i=[],o;function r(d,u){n.push(hB(d,u))}function s(d,u,f){let p=Y.multiplyByScalar(f,1-u.alpha,oCt);p=Y.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,f=0;i=n,n=[];let p=d.length,y=i.length;for(;u<p||f<y;){let h=u<p?d[u]:void 0,g=u>0?d[u-1]:void 0,x=u<p-1?d[u+1]:void 0,S=f<y?i[f]:void 0,V=f>0?i[f-1]:void 0,Z=f<y-1?i[f+1]:void 0;if(c(h)&&c(S)&&h.height===S.height){let R=c(Z)&&S.height===Z.height,E=!c(V),I=!c(Z),v=c(x)&&h.height===x.height,P=!c(g),F=!c(x);R?v?(s(h.height,h.color,S.color),s(h.height,x.color,Z.color)):P?(r(h.height,S.color),s(h.height,h.color,Z.color)):F?(s(h.height,h.color,S.color),r(h.height,Z.color)):(s(h.height,h.color,S.color),s(h.height,h.color,Z.color)):E?v?(r(h.height,h.color),s(h.height,x.color,S.color)):F?(r(h.height,h.color),r(h.height,S.color)):(P||r(h.height,h.color),s(h.height,h.color,S.color)):I?v?(s(h.height,h.color,S.color),r(h.height,x.color)):P?(r(h.height,S.color),r(h.height,h.color)):F?s(h.height,h.color,S.color):(s(h.height,h.color,S.color),r(h.height,h.color)):v?(s(h.height,h.color,S.color),s(h.height,x.color,S.color)):P?(r(h.height,S.color),s(h.height,h.color,S.color)):F?(s(h.height,h.color,S.color),r(h.height,S.color)):s(h.height,h.color,S.color),u+=v?2:1,f+=R?2:1}else if(c(h)&&c(S)&&c(V)&&h.height<S.height){let R=aCe(h.height,V,S,iCt);c(g)?c(x)?s(h.height,h.color,R):(s(h.height,h.color,R),r(h.height,R)):(r(h.height,R),s(h.height,h.color,R)),u++}else if(c(S)&&c(h)&&c(g)&&S.height<h.height){let R=aCe(S.height,g,h,nCt);c(V)?c(Z)?s(S.height,R,S.color):(s(S.height,R,S.color),r(S.height,R)):(r(S.height,R),s(S.height,R,S.color)),f++}else c(h)&&(!c(S)||h.height<S.height)?(c(S)&&!c(V)&&!c(x)?(r(h.height,h.color),r(h.height,id._emptyColor),r(S.height,id._emptyColor)):(!c(S)&&c(V)&&!c(g)&&(r(V.height,id._emptyColor),r(h.height,id._emptyColor)),r(h.height,h.color)),u++):c(S)&&(!c(h)||S.height<h.height)&&(r(S.height,S.color),f++)}}return cCe(n)}function id(e){let{scene:t,layers:n}=e??z.EMPTY_OBJECT;C.typeOf.object("options.scene",t),C.defined("options.layers",n),C.typeOf.number.greaterThan("options.layers.length",n.length,0);let{context:i}=t,o=sCt(n),r=o.length,s,a,l;if(!id._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,l=ke.RGBA,s=new Uint8Array(r*4);for(let y=0;y<r;y++)ce.packFloat(o[y].height,sCe),ce.pack(sCe,s,y*4)}else{a=Ue.FLOAT,l=i.webgl2?ke.RED:ke.LUMINANCE,s=new Float32Array(r);for(let y=0;y<r;y++)s[y]=o[y].height}let u=Pt.create({context:i,pixelFormat:l,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})}),f=new Uint8Array(r*4);for(let y=0;y<r;y++)o[y].color.toBytes(D9),f[y*4+0]=D9[0],f[y*4+1]=D9[1],f[y*4+2]=D9[2],f[y*4+3]=D9[3];let p=Pt.create({context:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:f,width:r,height:1},sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR})});return zi.fromType("ElevationBand",{heights:u,colors:p})}id._useFloatTexture=function(e){return e.floatingPointTexture};id._maximumHeight=5906376425472;id._minimumHeight=-5906376425472;id._emptyColor=new Y(0,0,0,0);var s6=id;var Plo=_(T(),1);async function aCt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??z.EMPTY_OBJECT,C.typeOf.object("apiOptions",e),e.onlyUsingWithGoogleGeocoder||ht("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=e.key??CS.defaultApiKey;if(!c(n))return cCt(t);let i,o=CS.getDefaultCredit();c(o)&&(i=[o]);let r=new Ge({url:`${CS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var lCe={};async function cCt(e){let i=lCe[2275207];c(i)||(i=xd.fromAssetId(2275207),lCe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var a6=aCt;var Ulo=_(T(),1);async function lCt(e){let t=await bs.fromIonAssetId(96188,e);e=e??z.EMPTY_OBJECT;let n=e.style;if(!c(n)){let i=(e.defaultColor??Y.WHITE).toCssColorString();n=new RS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var c6=lCt;var qlo=_(T(),1);function dCt(e){e=e??z.EMPTY_OBJECT;let t=[],n=e.geometry;if(!c(n))throw new L("options.geometry is required.");(!c(n.attributes)||!c(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(e.modelMatrix??M.IDENTITY),r=e.length??1e4;if(c(i.normal)&&t.push(new Rt({geometry:An.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),c(i.tangent)&&t.push(new Rt({geometry:An.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),c(i.bitangent)&&t.push(new Rt({geometry:An.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 an({flat:!0,translucent:!1})})}var l6=dCt;var odo=_(T(),1);function B9(e){e=e??z.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;if(!c(t))throw new L("options.attributeName is required.");c(n)||(n=!1);let i=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;default:throw new L("options.glslDatatype must be float, vec2, vec3, or vec4.")}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} +`,s=new Uo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new mu({name:"czm_edge_detection_composite",stages:[t,s]})}ls.createSilhouetteStage=function(e){let t=qMt(e),n=new Uo({name:"czm_silhouette_color_edges",fragmentShader:_U,uniforms:{silhouetteTexture:t.name}});return new mu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ls.isSilhouetteSupported=function(e){return e.context.depthTexture};ls.createBloomStage=function(){let e=new Uo({name:"czm_bloom_contrast_bias",fragmentShader:dU,uniforms:{contrast:128,brightness:-.3}}),t=Fae("czm_bloom_blur"),n=new mu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Uo({name:"czm_bloom_generate_composite",fragmentShader:cU,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 mu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};ls.createAmbientOcclusionStage=function(){let e=new Uo({name:"czm_ambient_occlusion_generate",fragmentShader:rU,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Uo({name:"czm_ambient_occlusion_composite",fragmentShader:sU,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 mu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var $Mt=`#define FXAA_QUALITY_PRESET 39 +${yM} +${bU}`;ls.createFXAAStage=function(){return new Uo({name:"czm_FXAA",fragmentShader:$Mt,sampleMode:mm.LINEAR})};ls.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=oU,new Uo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=fU,new Uo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=pU,new Uo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=TU,new Uo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=yU,new Uo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};ls.createAutoExposureStage=function(){return new ik};ls.createBlackAndWhiteStage=function(){return new Uo({name:"czm_black_and_white",fragmentShader:aU,uniforms:{gradations:5}})};ls.createBrightnessStage=function(){return new Uo({name:"czm_brightness",fragmentShader:lU,uniforms:{brightness:.5}})};ls.createNightVisionStage=function(){return new Uo({name:"czm_night_vision",fragmentShader:xU})};ls.createDepthViewStage=function(){return new Uo({name:"czm_depth_view",fragmentShader:mU})};ls.createLensFlareStage=function(){return new Uo({name:"czm_lens_flare",fragmentShader:gU,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var hm=ls;var MXo=x(T(),1);function hy(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function ZU(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Iae(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[ZU(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 m=e.getStageByName(u);l(m)&&(r[ZU(m)]=!0)}}}return i.name}function SU(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 m=0;m<c;++m){let p=i.get(m);l(p.length)?a=SU(e,t,n,p,o):a=Iae(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=ZU(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=ZU(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[ZU(i.get(p))]=!0}return a}function ekt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=SU(e,t,n,i,void 0);a=SU(e,t,n,o,a),a=Iae(e,t,n,r,a),a=SU(e,t,n,e,a),Iae(e,t,n,s,a)}else SU(e,t,n,e,void 0);return n}function tkt(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,m,p=e._framebuffers,b=p.length;for(u=0;u<b;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!U.equals(d,m.clearColor))continue;let f=m.stages,y=f.length,_=!1;for(let S=0;S<y;++S)if(n[f[S]]){_=!0;break}if(!_)break}return l(m)&&u<b?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new li({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function nkt(e,t){let n=ekt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=tkt(e,i,n[i]))}function Pae(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function ikt(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),m=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(m)||(m=W.nextPowerOfTwo(m)),d=m,u=m),a.buffer.update(t,d,u),a.clear=new ui({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}hy.prototype.updateDependencies=function(){this._updateDependencies=!0};hy.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)&&(Pae(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&nkt(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,Pae(this),ikt(this,e))};hy.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};hy.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};hy.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};hy.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};hy.prototype.isDestroyed=function(){return!1};hy.prototype.destroy=function(){return Pae(this),me(this)};var GR=hy;var UXo=x(T(),1),eXe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(eXe);var fy=eXe;var Xae=[];function pd(){let e=hm.createFXAAStage(),t=hm.createAmbientOcclusionStage(),n=hm.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=hm.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=fy.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new GR(this),r={},s=Xae;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(pd.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 Nae(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 fy.REINHARD:n=hm.createReinhardTonemappingStage(t);break;case fy.MODIFIED_REINHARD:n=hm.createModifiedReinhardTonemappingStage(t);break;case fy.FILMIC:n=hm.createFilmicTonemappingStage(t);break;case fy.PBR_NEUTRAL:n=hm.createPbrNeutralTonemappingStage(t);break;default:n=hm.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 Nae(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}pd.prototype.add=function(e){let t=this._stageNames,n=Xae;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};pd.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Xae;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};pd.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};pd.prototype.get=function(e){return Nae(this),this._stages[e]};pd.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};pd.prototype.getStageByName=function(e){return this._stageNames[e]};pd.prototype.update=function(e,t,n){Nae(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 S=0;S<r.length;++S){let Z=r[S];Z.ready&&Z.enabled&&Z._isSupported(e)&&(o[s++]=Z)}o.length=s;let a=s!==i.length;if(!a){for(let S=0;S<s;++S)if(o[S]!==i[S]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,m=this._tonemapping,p=this._fxaa;m.enabled=n;let b=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),y=m.enabled&&m._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||b!==this._aoEnabled||f!==this._bloomEnabled||y!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=b,this._bloomEnabled=f,this._tonemappingEnabled=y,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&b){let Z=new Uint8Array(196608);for(let R=0;R<196608;R+=3)Z[R]=Math.floor(Math.random()*255);this._randomTexture=new vt({context:e,pixelFormat:Qe.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:Z,width:256,height:256},sampler:new Bt({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:ei.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),m.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let S=0;S<r.length;++S)r[S].update(e,t);s=0;for(let S=0;S<r.length;++S){let Z=r[S];Z.ready&&Z.enabled&&Z._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};pd.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function LR(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}pd.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return LR(t)};function B0(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){B0(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)B0(e.get(r),t,LR(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)B0(e.get(r),t,n,i,o)}pd.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,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),b=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!m&&!p&&!f&&r===0)return;let _=t;m&&a.ready&&(B0(a,e,_,n,i),_=LR(a)),p&&c.ready&&(B0(c,e,_,n,i),_=LR(c)),b&&d.ready&&B0(d,e,_,n,i),f&&u.ready&&(B0(u,e,_,n,i),_=LR(u));let S=_;if(r>0){B0(o[0],e,_,n,i);for(let Z=1;Z<r;++Z)B0(o[Z],e,LR(o[Z-1]),n,i);S=LR(o[r-1])}y&&s.ready&&B0(s,e,S,n,i)};pd.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(du,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};pd.prototype.isDestroyed=function(){return!1};pd.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 RU=pd;var aNo=x(T(),1);var Yae=class{constructor(){mt(this,"quadtree");mt(this,"tilingScheme");mt(this,"errorEvent");ge.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){ge.throwInstantiationError()}beginUpdate(t,n,i){ge.throwInstantiationError()}endUpdate(t,n,i){ge.throwInstantiationError()}getLevelMaximumGeometricError(t){ge.throwInstantiationError()}loadTile(t,n,i){ge.throwInstantiationError()}computeTileVisibility(t,n,i){ge.throwInstantiationError()}showTileThisFrame(t,n,i,o){ge.throwInstantiationError()}computeDistanceToTile(t,n){ge.throwInstantiationError()}isDestroyed(){ge.throwInstantiationError()}destroy(){ge.throwInstantiationError()}},wae=Yae;var Uko=x(T(),1);var dNo=x(T(),1),Mae=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let o=i??this.controllerCount;this._controllers.splice(o,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,o=i.indexOf(t);o!==-1&&(i.splice(o,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},CU=Mae;var ANo=x(T(),1);function WR(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}WR.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};WR.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof yn,!(this._previousMode===se.SCENE2D||this._previousMode===se.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE2D,!0),n._mode=se.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===se.COLUMBUS_VIEW?Xkt(this,e):Dkt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var okt=new h,rkt=new h,skt=new h,akt=new h,ckt=new h,lkt=new h,dkt=new h,ukt=new pe,mkt=new P,hkt=new qi,fkt=new yn,pkt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};WR.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===se.COLUMBUS_VIEW||this._previousMode===se.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,se.COLUMBUS_VIEW,!0),n.camera._setTransform(P.IDENTITY);let i=okt,o=rkt,r=skt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===se.SCENE2D)h.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(d.positionWC,i),h.clone(d.directionWC,o),h.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,dkt),m=_t.eastNorthUpToFixedFrame(u,t,mkt);P.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,ukt),i),P.multiplyByPointAsVector(m,o,o),P.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=fkt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=hkt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=pkt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Bkt(a);VU(this,c),this._previousMode===se.SCENE2D?Okt(this,e,a,c):(a.position2D=P.multiplyByPoint(Io.TRANSFORM_2D,i,akt),a.direction2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,o,ckt),a.up2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,lkt),n._mode=se.MORPHING,uXe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Dae={position:new h,direction:new h,up:new h,frustum:void 0},nXe=new qi;WR.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===se.SCENE3D||this._previousMode===se.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE3D,!0),n._mode=se.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===se.SCENE2D)Vkt(this,e,t);else{let i;e>0?(i=Dae,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=iXe(this,t);let o,r=n.camera;r.frustum instanceof yn?o=r.frustum.clone():(o=nXe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=hXe(i);VU(this,s),Uae(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};WR.prototype.isDestroyed=function(){return!1};WR.prototype.destroy=function(){return mJ(this),me(this)};function VU(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new la(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,mn.LEFT_DOWN),e._morphHandler.setInputAction(n,mn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,mn.RIGHT_DOWN),e._morphHandler.setInputAction(n,mn.WHEEL)}}function mJ(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 bkt=new pe,gkt=new h,ykt=new P;function iXe(e,t){let n=e._scene,i=n.camera,o=Dae,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,bkt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,gkt),u=_t.eastNorthUpToFixedFrame(d,t,ykt);return P.multiplyByPointAsVector(u,i.direction,s),P.multiplyByPointAsVector(u,i.up,a),o}var xkt=new h,Tkt=new h,_kt=new h,Skt=new h,Zkt=new h,Rkt=new h;function Uae(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,xkt),a=h.clone(r.direction,Tkt),c=h.clone(r.up,_kt),d=P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,n.position,Skt),u=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.direction,Zkt),m=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.up,Rkt);function p(f){Vh(s,d,f.time,r.position),Vh(a,u,f.time,r.direction),Vh(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let b=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){mXe(e,o,0,1,t,i)}});e._currentTweens.push(b)}var Ckt=new yn,oXe=new h,rXe=new h,sXe=new h,Oae=new h,aXe=new h,cXe=new h;function Vkt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=Dae,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=iXe(e,n));let s;e._morphToOrthographic?(s=Ckt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=nXe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=hXe(r);VU(e,a);let c;e._morphToOrthographic?c=function(){Uae(e,t,r,a)}:c=function(){dXe(e,t,r,function(){Uae(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Oae),complete:function(){i._mode=se.MORPHING,c()}})):c()}function Vh(e,t,n,i){return h.lerp(e,t,n,i)}function lXe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof yn)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 b=d/Math.tan(s.frustum.fov*.5);i(s,b)}let m=r.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var Ekt=new h,Akt=new h,Gkt=new h,kae=new h,Lkt=new h,Wkt=new h,vkt=new bs,Fkt=new gn,Ikt=new h,Pkt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Xkt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,Ekt),r=h.clone(i.direction,Akt),s=h.clone(i.up,Gkt),a=h.negate(h.UNIT_Z,Lkt),c=h.clone(h.UNIT_Y,Wkt),d=kae;if(t>0)h.clone(h.ZERO,kae),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,kae);let _=Fkt;P.multiplyByPoint(Io.TRANSFORM_2D,o,_.origin),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,_.direction);let S=n.globe;if(l(S)){let Z=S.pickWorldCoordinates(_,n,!0,Ikt);l(Z)&&(P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,Z,d),d.z+=h.distance(o,d))}}let u=vkt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=Pkt;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=fXe(m);VU(e,p);function b(_){Vh(o,d,_.time,i.position),Vh(r,a,_.time,i.direction),Vh(s,c,_.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,S){_.position.z=S}let y=n.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){lXe(e,t,m,f,p)}});e._currentTweens.push(y)}var tXe=new pe,Nkt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new bs},Ykt={position:new h,direction:new h,up:new h,frustum:void 0},wkt=new h,Mkt=new gn,kkt=new P,Ukt=new h;function Dkt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Nkt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,tXe),i.mapProjection.project(tXe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=Mkt;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),b=n.scaleToGeodeticSurface(o.positionWC,Ukt),f=_t.eastNorthUpToFixedFrame(b,n,kkt);P.inverseTransformation(f,f),P.multiplyByPointAsVector(f,p,p),P.multiplyByPointAsVector(Io.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let _=y.pickWorldCoordinates(m,i,!0,wkt);if(l(_)){let S=h.distance(r.position2D,_);_.x+=S,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}P.multiplyByPoint(Io.TRANSFORM_2D,r.position,r.position2D),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r.direction,r.direction2D),P.multiplyByPointAsVector(Io.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=Ykt;P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=fXe(c);VU(e,d);function u(){lXe(e,t,r,s,d)}uXe(e,t,r,u)}function dXe(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 m=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function Okt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,Oae),a=h.clone(n.direction,aXe),c=h.clone(n.up,cXe);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,oXe),m=h.clone(r.direction,rXe),p=h.clone(r.up,sXe);u.z=s.z;function b(y){Vh(u,s,y.time,r.position),Vh(m,a,y.time,r.direction),Vh(p,c,y.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():dXe(e,0,n,d)}function uXe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,oXe),a=h.clone(r.direction,rXe),c=h.clone(r.up,sXe),d=h.clone(n.position2D,Oae),u=h.clone(n.direction2D,aXe),m=h.clone(n.up2D,cXe);function p(f){Vh(s,d,f.time,r.position),Vh(a,u,f.time,r.direction),Vh(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let b=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){mXe(e,o,1,0,t,i)}});e._currentTweens.push(b)}function mXe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:vs.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function hXe(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),mJ(t);let i=n.camera;(t._previousMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,se.SCENE3D,r)}}function fXe(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),mJ(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,se.SCENE2D,o)}}function Bkt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),mJ(t);let i=n.camera;(t._previousModeMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.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,se.COLUMBUS_VIEW,r)}}var EU=WR;var dYo=x(T(),1);var NNo=x(T(),1);function hJ(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=$e(n),this._stopObject=$e(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(hJ.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}}});hJ.prototype.cancelTween=function(){this._tweens.remove(this)};function up(){this._tweens=[]}Object.defineProperties(up.prototype,{length:{get:function(){return this._tweens.length}}});up.prototype.add=function(e){if(e=e??B.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new hJ(this);let t=e.duration/Mn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Mn.SECONDS_PER_MILLISECOND,o=e.easingFunction??vs.LINEAR_NONE,r=e.startObject,s=new GLe(r);s.to($e(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new hJ(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};up.prototype.addProperty=function(e){e=e??B.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:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};up.prototype.addAlpha=function(e){e=e??B.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:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};up.prototype.addOffsetIncrement=function(e){e=e??B.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})};up.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};up.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};up.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};up.prototype.get=function(e){return this._tweens[e]};up.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Mn.SECONDS_PER_MILLISECOND:Zn();n<t.length;){let i=t[n],o=i.tweenjs;if(i.needsStart)i.needsStart=!1,o.start(e);else if(o.update(e))n++;else{if(t[n]?.needsStart)continue;o.stop(),t.splice(n,1)}}};var vR=up;function GU(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=lo.LEFT_DRAG,this.zoomEventTypes=[lo.RIGHT_DRAG,lo.WHEEL,lo.PINCH],this.rotateEventTypes=lo.LEFT_DRAG,this.tiltEventTypes=[lo.MIDDLE_DRAG,lo.PINCH,{eventType:lo.LEFT_DRAG,modifier:ir.CTRL},{eventType:lo.RIGHT_DRAG,modifier:ir.CTRL}],this.lookEventTypes={eventType:lo.LEFT_DRAG,modifier:ir.SHIFT};let t=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 Wk(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 vR,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new k(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new k(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new k,this._strafeEndMousePosition=new k,this._zoomMouseStart=new k(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new k,this._panLastWorldPosition=new h,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 pe(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 zkt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Hkt(e){return k.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var Kkt=.4;function Jkt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new k,endPosition:new k,motion:new k,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<Kkt){let b=zkt(p,i),f=e.getLastMovement(t,n);if(!l(f)||Hkt(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=k.clone(f.startPosition,a.startPosition),a.endPosition=k.multiplyByScalar(a.motion,b,a.endPosition),a.endPosition=k.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||k.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function jkt(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 pXe=[];function bd(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(pXe[0]=n,n=pXe);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,m=d.modifier,p=s.isMoving(u,m)&&s.getMovement(u,m),b=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,b,p),jkt(e,r)):o<1&&Jkt(s,u,m,o,i,e,r))}}var fJ=new gn,Qkt=new h,qkt=new k,$kt=new h,e9t=new k,t9t=new h,n9t=new h,i9t=new h,o9t=new h,EXe=new h,r9t=new h,s9t=new h,a9t=new h,c9t=new h,l9t=new h,d9t=new h,u9t=new h,m9t=new h,h9t=new h,f9t=new h,FR=new h,bXe=new h,gXe=new h,Bae={orientation:new Cc};function $ae(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,m=o-d,p=i*m;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let b=a/e._scene.canvas.clientHeight;b=Math.min(b,e.maximumMovementRatio);let f=p*b;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 y=e._scene,_=y.camera,S=y.mode,Z=Bae.orientation;Z.heading=_.heading,Z.pitch=_.pitch,Z.roll=_.roll;let R=n.inertiaEnabled??k.equals(t,e._zoomMouseStart),C=e._zoomingOnVector,E=e._rotatingZoom,A;if(R||(e._zoomMouseStart=k.clone(t,e._zoomMouseStart),l(e._globe)&&S===se.SCENE2D?(A=_.getPickRay(t,fJ).origin,A=h.fromElements(A.y,A.z,A.x)):l(e._globe)&&(A=py(e,t,Qkt)),l(A)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(A,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,C=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let L=S===se.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(E=!0),!R||E){if(S===se.SCENE2D){let F=e._zoomWorldPosition,I=_.position;if(!h.equals(F,I)&&_.positionCartographic.height<e._maxCoord.x*2){let N=_.position.x,g=h.subtract(F,I,$kt);h.normalize(g,g);let V=h.distance(F,I)*f/(_.getMagnitude()*.5);_.move(g,V*.5),(_.position.x<0&&N>0||_.position.x>0&&N<0)&&(A=_.getPickRay(t,fJ).origin,A=h.fromElements(A.y,A.z,A.x),e._zoomWorldPosition=h.clone(A,e._zoomWorldPosition))}}else if(S===se.SCENE3D){let F=h.normalize(_.position,EXe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,F))<.6)L=!0;else{let I=y.canvas,N=e9t;N.x=I.clientWidth/2,N.y=I.clientHeight/2;let g=py(e,N,t9t);if(!l(g))L=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,F)>=-.5)L=!0;else{let V=s9t;h.clone(_.position,V);let G=e._zoomWorldPosition,v=r9t;if(v=h.normalize(G,v),h.dot(v,F)<0)return;let X=f9t,Y=l9t;h.clone(_.direction,Y),h.add(V,h.multiplyByScalar(Y,1e3,FR),X);let D=d9t,w=u9t;h.subtract(G,V,D),h.normalize(D,w);let O=h.dot(F,w);if(O>=0){e._zoomMouseStart.x=-1;return}let M=Math.acos(-O),z=h.magnitude(V),K=h.magnitude(G),te=z-f,H=h.magnitude(D),$=Math.asin(W.clamp(H/K*Math.sin(M),-1,1)),ee=Math.asin(W.clamp(te/K*Math.sin(M),-1,1)),le=$-ee+M,_e=a9t;h.normalize(V,_e);let he=c9t;he=h.cross(w,_e,he),he=h.normalize(he,he),h.normalize(h.cross(_e,he,FR),Y),h.multiplyByScalar(h.normalize(X,FR),h.magnitude(X)-f,X),h.normalize(V,V),h.multiplyByScalar(V,te,V);let Ze=m9t;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,bXe),h.multiplyByScalar(Y,Math.sin(le),gXe),FR),te,Ze),h.add(V,Ze,V),h.normalize(X,_e),h.normalize(h.cross(_e,he,FR),Y);let ye=h9t;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,bXe),h.multiplyByScalar(Y,Math.sin(le),gXe),FR),h.magnitude(X),ye),h.add(X,ye,X),h.clone(V,_.position),h.normalize(h.subtract(X,V,FR),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(Bae);return}else{let V=h.normalize(g,n9t),G=h.normalize(e._zoomWorldPosition,i9t),v=h.dot(G,V);if(v>0&&v<1){let X=W.acosClamped(v),Y=h.cross(G,V,o9t),D=Math.abs(X)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,w=f/D;_.rotate(Y,X*w)}}}}e._rotatingZoom=!L}if(!R&&L||C){let F,I=fo.worldToWindowCoordinates(y,e._zoomWorldPosition,qkt);S!==se.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(I)?F=_.getPickRay(I,fJ):F=_.getPickRay(t,fJ);let N=F.direction;(S===se.COLUMBUS_VIEW||S===se.SCENE2D)&&h.fromElements(N.y,N.z,N.x,N),_.move(N,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(Bae)}var p9t=new gn,b9t=new gn,g9t=new h;function y9t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,p9t).origin,s=o.getPickRay(n.endPosition,b9t).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,g9t),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function yXe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;$ae(e,t,n,e.zoomFactor,o.getMagnitude())}var x9t=new k,T9t=new k;function xXe(e,t,n){if(l(n.angleAndHeight)){_9t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=x9t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=k.normalize(c,c);let d=T9t;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=k.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let m=W.acosClamped(d.x);d.y<0&&(m=W.TWO_PI-m);let p=m-u;o.twistRight(p)}function _9t(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 S9t(e){let t=e._scene.mapMode2D===fd.ROTATE;P.equals(P.IDENTITY,e._scene.camera.transform)?(bd(e,e.enableTranslate,e.translateEventTypes,y9t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bd(e,e.enableZoom,e.zoomEventTypes,yXe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bd(e,e.enableRotate,e.tiltEventTypes,xXe,e.inertiaSpin,"_lastInertiaTiltMovement")):(bd(e,e.enableZoom,e.zoomEventTypes,yXe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bd(e,e.enableRotate,e.translateEventTypes,xXe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var AXe=new gn,Z9t=new h,R9t=new h;function py(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Z9t)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,AXe),d=o.pickWorldCoordinates(c,i,a,R9t),u=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=l(d)?h.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<m?h.clone(s,n):h.clone(d,n)}var C9t=new pe;function _J(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===se.SCENE3D){let c=t.cartesianToCartographic(i.position,C9t);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var V9t=new h;function GXe(e,t){let n=t.origin,i=t.direction,o=_J(e),r=h.normalize(n,V9t),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function LXe(e,t,n,i){let o=h.distance(t.origin,n),r=_J(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),gn.getPoint(t,o,i)}function WXe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=_J(e))):o=_J(e),gn.getPoint(t,o,i)}var E9t=new k;function vXe(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,E9t),o=e._strafeEndMousePosition;k.add(o,i,o),t.endPosition=o,ece(e,t,e._strafeStartPosition),t.endPosition=n}var TXe=new gn,A9t=new gn,zae=new h,G9t=new h,L9t=new h,W9t=new h,v9t=new cn(h.UNIT_X,0),F9t=new k,I9t=new k;function P9t(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){pm(e,t,n);return}if(e._strafing){vXe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=k.clone(n.startPosition,F9t),a=k.clone(n.endPosition,I9t),c=o.getPickRay(s,TXe),d=h.clone(h.ZERO,W9t),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=py(e,s,zae),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let R=m;r&&(R=WXe(e,c,m,zae)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),h.clone(R,e._strafeStartPosition),e._strafing=!0,ece(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,v9t);c=o.getPickRay(s,TXe);let b=yi.rayPlane(c,p,zae),f=o.getPickRay(a,A9t),y=yi.rayPlane(f,p,G9t);if(!l(b)||!l(y)){e._looking=!0,pm(e,t,n),k.clone(t,e._translateMousePosition);return}let _=h.subtract(b,y,L9t),S=_.x;_.x=_.y,_.y=_.z,_.z=S;let Z=h.magnitude(_);Z>W.EPSILON6&&(h.normalize(_,_),o.move(_,Z))}var FXe=new k,gJ=new gn,yJ=new h,X9t=new h,IXe=new P,N9t=new P,Y9t=new h,w9t=new cn(h.UNIT_X,0),Hae=new h,jae=new pe,PXe=new P,M9t=new Ne,k9t=new q,xJ=new h;function U9t(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){pm(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,D9t(e,t,n)):O9t(e,t,n)}function D9t(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=FXe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,gJ),c=h.UNIT_X,d=a.origin,u=a.direction,m,p=h.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(m=-h.dot(c,d)/p),!l(m)||m<=0){e._looking=!0,pm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let b=h.multiplyByScalar(u,m,yJ);h.add(d,b,b);let f=i.mapProjection,y=f.ellipsoid;h.fromElements(b.y,b.z,b.x,b);let _=f.unproject(b,jae);y.cartographicToCartesian(_,b);let S=_t.eastNorthUpToFixedFrame(b,y,IXe),Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=P.clone(o.transform,PXe);o._setTransform(S),fm(e,t,n,h.UNIT_Z),o._setTransform(C),e._globe=Z,e._ellipsoid=R;let E=R.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function O9t(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(k.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,yJ);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=py(e,t,yJ)),!l(s)){a=o.getPickRay(t,gJ);let g=a.origin,V=a.direction,G,v=h.dot(c,V);if(Math.abs(v)>W.EPSILON6&&(G=-h.dot(c,g)/v),!l(G)||G<=0){e._looking=!0,pm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(V,G,yJ),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,gJ)),LXe(e,a,s,s)),k.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=FXe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,gJ);let m=h.clone(h.ZERO,Y9t);m.x=s.x;let p=cn.fromPointNormal(m,c,w9t),b=yi.rayPlane(a,p,X9t),f=o._projection,y=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,jae);y.cartographicToCartesian(_,s);let S=_t.eastNorthUpToFixedFrame(s,y,IXe),Z;l(b)?(h.fromElements(b.y,b.z,b.x,b),_=f.unproject(b,jae),y.cartographicToCartesian(_,b),Z=_t.eastNorthUpToFixedFrame(b,y,N9t)):Z=S;let R=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,A=P.clone(o.transform,PXe);o._setTransform(S);let L=h.cross(h.UNIT_Z,h.normalize(o.position,Hae),Hae),F=h.dot(o.right,L);if(fm(e,t,n,E,!1,!0),o._setTransform(Z),F<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(E=void 0);let V=o.constrainedAxis;o.constrainedAxis=void 0,fm(e,t,n,E,!0,!1),o.constrainedAxis=V}else fm(e,t,n,E,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,xJ);h.equalsEpsilon(g,h.ZERO,W.EPSILON6)||(h.dot(g,o.right)<0&&h.negate(g,g),h.cross(g,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(A),e._globe=R,e._ellipsoid=C;let I=C.maximumRadius;e._rotateFactor=1/I,e._rotateRateRangeAdjustment=I;let N=h.clone(o.positionWC,Hae);if(e.enableCollisionDetection&&ice(e,!0),!h.equals(o.positionWC,N)){o._setTransform(Z),o.worldToCameraCoordinatesPoint(N,N);let g=h.magnitudeSquared(N);h.magnitudeSquared(o.position)>g&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(g),o.position));let V=h.angleBetween(N,o.position),G=h.cross(N,o.position,N);h.normalize(G,G);let v=Ne.fromAxisAngle(G,V,M9t),X=q.fromQuaternion(v,k9t);q.multiplyByVector(X,o.direction,o.direction),q.multiplyByVector(X,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(A)}}var XXe=new k,NXe=new gn,YXe=new h;function B9t(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=XXe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,NXe),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=py(e,a,YXe));let b;if(l(p)&&(b=h.distance(d,p)),s){let f=GXe(e,c,m);l(b)?b=Math.min(b,f):b=f}if(!l(b)){let f=h.UNIT_X;b=-h.dot(f,d)/h.dot(f,u)}$ae(e,t,n,e.zoomFactor,b)}function z9t(e){let n=e._scene.camera;if(!P.equals(P.IDENTITY,n.transform))bd(e,e.enableRotate,e.rotateEventTypes,fm,e.inertiaSpin,"_lastInertiaSpinMovement"),bd(e,e.enableZoom,e.zoomEventTypes,MXe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),bd(e,e.enableTilt,e.tiltEventTypes,U9t,e.inertiaSpin,"_lastInertiaTiltMovement"),bd(e,e.enableTranslate,e.translateEventTypes,P9t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bd(e,e.enableZoom,e.zoomEventTypes,B9t,e.inertiaZoom,"_lastInertiaZoomMovement"),bd(e,e.enableLook,e.lookEventTypes,pm),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var H9t=new gn,K9t=new cn(h.UNIT_X,0),J9t=new h,j9t=new h;function ece(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,H9t),s=h.clone(o.direction,j9t);i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,K9t),c=yi.rayPlane(r,a,J9t);l(c)&&(s=h.subtract(n,c,s),i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var _Xe=new h,wXe=new pe,Qae=new h,qae=new ne,Q9t=new h,q9t=new h,$9t=new h;function eUt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!P.equals(o.transform,P.IDENTITY)){fm(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,Q9t);if(k.equals(t,e._rotateMousePosition)){if(e._looking)pm(e,t,n,d);else if(e._rotating)fm(e,t,n);else if(e._strafing)vXe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Qae,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,qae),Jae(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,wXe).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=py(e,n.startPosition,$9t);if(l(p)){let b,f=o.getPickRay(n.startPosition,AXe);if(r)b=!0,WXe(e,f,p,p);else{let y=s.geodeticSurfaceNormal(p,q9t);Math.abs(h.dot(f.direction,y))<.05?b=!0:b=h.magnitude(o.position)<h.magnitude(p)}b?(k.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,ece(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Qae,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,qae),Jae(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,pm(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,_Xe))?(Jae(e,t,n,e._ellipsoid),h.clone(_Xe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,fm(e,t,n)):(e._looking=!0,pm(e,t,n,d));k.clone(t,e._rotateMousePosition)}function fm(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=h.magnitude(a.position),m=e._rotateFactor*(u-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,b=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),b=Math.min(b,e.maximumMovementRatio);let f=m*p*Math.PI*2,y=m*b*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,S=h.dot(a.direction,i),Z=Math.PI-Math.acos(S)+y;Z>_&&(y-=Z-_)}o||a.rotateRight(f),r||a.rotateUp(y),a.constrainedAxis=d}var Kae=ce.clone(ce.UNIT_W),SXe=ce.clone(ce.UNIT_W),pJ=new h,LA=new h,bJ=new h,ZXe=new h,tUt=new k,nUt=new k,iUt=new k,oUt=new k,rUt=new gn;function Jae(e,t,n,i){let o=e._scene,r=o.camera,s=k.clone(n.startPosition,tUt),a=k.clone(n.endPosition,nUt),c=i.cartesianToCartographic(r.positionWC,wXe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,Kae),!l(e._globe)&&!k.equalsEpsilon(s,e._panLastMousePosition)&&(d=py(e,s,Kae)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,LA),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),LA),b=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,b,o.pixelRatio,oUt),y=k.subtract(a,s,iUt),_=h.multiplyByScalar(r.rightWC,y.x*f.x,LA),S=h.normalize(r.positionWC,EXe),Z=r.getPickRay(a,rUt).direction,R=h.subtract(Z,h.projectVector(Z,r.rightWC,bJ),bJ),C=h.angleBetween(R,r.directionWC),E=1;l(r.frustum.fov)&&(E=Math.max(Math.tan(C),.1));let A=Math.abs(h.dot(r.directionWC,S)),L=-y.y*f.y*2/Math.sqrt(E)*(1-A),F=h.multiplyByScalar(Z,L,bJ);A=Math.abs(h.dot(r.upWC,S));let I=h.multiplyByScalar(r.upWC,-y.y*(1-A)*f.y,ZXe);u=h.add(d,_,SXe),u=h.add(u,F,u),u=h.add(u,I,u),h.clone(u,e._panLastWorldPosition),k.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,Kae),u=r.pickEllipsoid(a,i,SXe)),!l(d)||!l(u)){e._rotating=!0,fm(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let m=r.constrainedAxis,p=h.mostOrthogonalAxis(m,pJ);h.cross(p,m,p),h.normalize(p,p);let b=h.cross(m,p,LA),f=h.magnitude(d),y=h.dot(m,d),_=Math.acos(y/f),S=h.multiplyByScalar(m,y,bJ);h.subtract(d,S,S),h.normalize(S,S);let Z=h.magnitude(u),R=h.dot(m,u),C=Math.acos(R/Z),E=h.multiplyByScalar(m,R,ZXe);h.subtract(u,E,E),h.normalize(E,E);let A=Math.acos(h.dot(S,p));h.dot(S,b)<0&&(A=W.TWO_PI-A);let L=Math.acos(h.dot(E,p));h.dot(E,b)<0&&(L=W.TWO_PI-L);let F=A-L,I;h.equalsEpsilon(m,r.position,W.EPSILON2)?I=r.right:I=h.cross(m,r.position,pJ);let N=h.cross(m,I,pJ),g=h.dot(N,h.subtract(d,m,LA)),V=h.dot(N,h.subtract(u,m,LA)),G;g>0&&V>0?G=C-_:g>0&&V<=0?h.dot(r.position,m)>0?G=-_-C:G=_+C:G=_-C,r.rotateRight(F),r.rotateUp(G)}else{h.normalize(d,d),h.normalize(u,u);let m=h.dot(d,u),p=h.cross(d,u,pJ);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let b=Math.acos(m);r.rotate(p,b)}}}var sUt=new h,aUt=new pe,RXe=0;function MXe(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=XXe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,NXe),m,p=o.cartesianToCartographic(s.position,aUt).height,b=Math.abs(RXe)<e.minimumPickingTerrainDistanceWithInertia;(i?b:p<e._minimumPickingTerrainHeight)&&(m=py(e,d,YXe));let y;if(l(m)&&(y=h.distance(u.origin,m)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(RXe=y),c){let S=GXe(e,u,p);l(y)?y=Math.min(y,S):y=S}l(y)||(y=p);let _=h.normalize(s.position,sUt);$ae(e,t,n,e.zoomFactor,y,h.dot(_,s.direction))}var kXe=new k,TJ=new gn,AU=new h,cUt=new h,UXe=new P,lUt=new P,DXe=new P,dUt=new Ne,uUt=new q,tce=new pe,nce=new h;function mUt(e,t,n){let o=e._scene.camera;if(!P.equals(o.transform,P.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,nce);pm(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,tce);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,fUt(e,t,n)):pUt(e,t,n)}var hUt=new pe;function fUt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,hUt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=kXe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,TJ),m,p=yi.rayEllipsoid(u,i);if(l(p))m=gn.getPoint(u,p.start,AU);else if(a>e._minimumTrackBallHeight){let Z=yi.grazingAltitudeLocation(u,i);if(!l(Z))return;let R=i.cartesianToCartographic(Z,tce);R.height=0,m=i.cartographicToCartesian(R,AU)}else{e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,nce);pm(e,t,n,Z),k.clone(t,e._tiltCenterMousePosition);return}let b=_t.eastNorthUpToFixedFrame(m,i,UXe),f=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=P.clone(r.transform,DXe);r._setTransform(b),fm(e,t,n,h.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=y;let S=y.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function pUt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(k.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,AU);else{if(a=py(e,t,AU),!l(a)){if(c=r.getPickRay(t,TJ),d=yi.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,tce).height<=e._minimumTrackBallHeight){e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,nce);pm(e,t,n,V),k.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,d.start,AU)}s&&(l(c)||(c=r.getPickRay(t,TJ)),LXe(e,c,a,a)),k.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=kXe;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,TJ);let p=h.magnitude(a),b=h.fromElements(p,p,p,Qae),f=ne.fromCartesian3(b,qae);if(d=yi.rayEllipsoid(c,f),!l(d))return;let y=h.magnitude(c.origin)>p?d.start:d.stop,_=gn.getPoint(c,y,cUt),S=_t.eastNorthUpToFixedFrame(a,i,UXe),Z=_t.eastNorthUpToFixedFrame(_,f,lUt),R=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,A=P.clone(r.transform,DXe);r._setTransform(Z);let L=h.cross(_,r.positionWC,xJ);if(h.dot(r.rightWC,L)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(E=void 0);let V=r.constrainedAxis;r.constrainedAxis=void 0,fm(e,t,n,E,!0,!1),r.constrainedAxis=V}else fm(e,t,n,E,!0,!1);if(r._setTransform(S),fm(e,t,n,E,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,xJ);h.equalsEpsilon(g,h.ZERO,W.EPSILON6)||(h.dot(g,r.right)<0&&h.negate(g,g),h.cross(g,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(A),e._globe=R,e._ellipsoid=C;let I=C.maximumRadius;e._rotateFactor=1/I,e._rotateRateRangeAdjustment=I;let N=h.clone(r.positionWC,xJ);if(e.enableCollisionDetection&&ice(e,!0),!h.equals(r.positionWC,N)){r._setTransform(Z),r.worldToCameraCoordinatesPoint(N,N);let g=h.magnitudeSquared(N);h.magnitudeSquared(r.position)>g&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(g),r.position));let V=h.angleBetween(N,r.position),G=h.cross(N,r.position,N);h.normalize(G,G);let v=Ne.fromAxisAngle(G,V,dUt),X=q.fromQuaternion(v,uUt);q.multiplyByVector(X,r.direction,r.direction),q.multiplyByVector(X,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(A)}}var bUt=new k,gUt=new k,CXe=new gn,VXe=new gn,yUt=new h,xUt=new h;function pm(e,t,n,i){let r=e._scene.camera,s=bUt;s.x=n.startPosition.x,s.y=0;let a=gUt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,CXe),d=r.getPickRay(a,VXe),u=0,m,p;r.frustum instanceof yn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction);let b=h.dot(m,p);b<1&&(u=Math.acos(b)),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,CXe),d=r.getPickRay(a,VXe),u=0,r.frustum instanceof yn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction),b=h.dot(m,p),b<1&&(u=Math.acos(b)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??f,l(i)){let y=r.direction,_=h.negate(i,yUt),S=h.equalsEpsilon(y,i,W.EPSILON2),Z=h.equalsEpsilon(y,_,W.EPSILON2);if(!S&&!Z){b=h.dot(y,i);let R=W.acosClamped(b);u>0&&u>R&&(u=R-W.EPSILON4),b=h.dot(y,_),R=W.acosClamped(b),u<0&&-u>R&&(u=-R+W.EPSILON4);let C=h.cross(i,y,xUt);r.look(C,u)}else(S&&u<0||Z&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function TUt(e){bd(e,e.enableRotate,e.rotateEventTypes,eUt,e.inertiaSpin,"_lastInertiaSpinMovement"),bd(e,e.enableZoom,e.zoomEventTypes,MXe,e.inertiaZoom,"_lastInertiaZoomMovement"),bd(e,e.enableTilt,e.tiltEventTypes,mUt,e.inertiaSpin,"_lastInertiaTiltMovement"),bd(e,e.enableLook,e.lookEventTypes,pm)}var _Ut=new P,SUt=new pe;function ice(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===se.SCENE2D||i===se.MORPHING)return;let o=n.camera,r=n.ellipsoid??ne.WGS84,s=n.mapProjection,a,c;P.equals(o.transform,P.IDENTITY)||(a=P.clone(o.transform,_Ut),c=h.magnitude(o.position),o._setTransform(P.IDENTITY));let d=SUt;i===se.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(l(m)){let p=m+e.minimumZoomDistance,b=m-e._lastGlobeHeight,f=b/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===se.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=m:e._lastGlobeHeight+=b*.1}}l(a)&&(o._setTransform(a),u&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}GU.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===se.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var ZUt=new h,RUt=new h;GU.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;P.equals(t.transform,P.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ne.default):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=_o.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=_o.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=_o.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=h.clone(t.positionWC,ZUt),c=h.clone(t.directionWC,RUt);if(i===se.SCENE2D?S9t(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,z9t(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,TUt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);ice(this,d)}this._aggregator.reset()};GU.prototype.isDestroyed=function(){return!1};GU.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var LU=GU;var GYo=x(T(),1);var xYo=x(T(),1);function WU(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new nt},t.viewport=new nt,this._context=e,this._fb=new li({depthStencil:!0,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),this._passState=t}function CUt(e,t,n,i){let o=Math.max(n,i),r=o*o,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,d=0,u=0,m=-1,p=[];for(let b=0;b<r;++b){if(-s<=c&&c<=s&&-a<=d&&d<=a){let f=4*((a-d)*n+c+s),y=t[f],_=e.getObjectByPickColor(y);l(_)&&p.push({object:_,isEdge:t[f+1]>0,depth:t[f+2],x:c,y:d})}if(c===d||c<0&&-c===d||c>0&&c===1-d){let f=u;u=-m,m=f}c+=u,d+=m}return p}WU.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return nt.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};WU.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:Ue.FLOAT,framebuffer:this._fb.framebuffer});return CUt(i,o,t,n)};WU.prototype.isDestroyed=function(){return!1};WU.prototype.destroy=function(){return this._fb.destroy(),me(this)};var vU=WU;var FU={},VUt=new nt(0,0,3,3),EUt=new k,AUt=new k,GUt=new gn,LUt=new h,WUt=3,vUt=.1,OXe=9;function oce(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function BXe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&oce(s)<=WUt&&(t=Math.min(t,s.depth));let n=t*(1+vUt),i=e.filter(s=>!s.isEdge||s.depth<=n),o=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===o).reduce((s,a)=>oce(a)<oce(s)?a:s)}function zXe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let o of e){if(o.isEdge||o.object!==t)continue;let r=o.x*o.x+o.y*o.y;r<i&&(n=o,i=r)}return n}function rce(e,t,n){let i=EUt;i.x=t.x+n.x,i.y=t.y+n.y;let o=e.camera.getPickRay(i,GUt);if(!l(o))return;let r=h.dot(o.direction,e.camera.directionWC);if(r<=0)return;let s=n.depth/r,a=h.multiplyByScalar(o.direction,s,LUt);return h.add(o.origin,a,new h)}FU.snap=function(e,t,n){let i=n?.width??25,o=n?.height??i,{context:r,defaultView:s}=e;if(!r.colorBufferFloat){xt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new vU(r));let a=s.snapFramebuffer,c=VUt;$9(e,t,c,i,o,{framebuffer:a,snap:!0});let d=a.end(c);if(eU(e),d.length===0)return;let u=BXe(d);if(!l(u))return;let m=rce(e,t,u);if(!l(m))return;let p=m;if(u.isEdge){let b=AUt;b.x=t.x+u.x,b.y=t.y+u.y,$9(e,b,c,OXe,OXe,{framebuffer:a,snap:!0});let f=a.end(c);eU(e);let y=zXe(f,u.object);p=l(y)?rce(e,b,y):void 0}return{object:u.object,isEdge:u.isEdge,position:m,surfacePosition:p,screenPosition:new k(t.x+u.x,t.y+u.y)}};FU._selectBestHit=BXe;FU._nearestSurfaceHit=zXe;FU._snapHitToWorld=rce;var IU=FU;var qYo=x(T(),1);var WYo=x(T(),1),PU=`uniform sampler2D colorTexture; +uniform sampler2D colorTexture2; +uniform vec2 center; +uniform float radius; +in vec2 v_textureCoordinates; void main() { -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(B9.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}}});B9.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;B9.prototype.isTranslucent=no.prototype.isTranslucent;B9.prototype.getRenderState=no.prototype.getRenderState;var d6=B9;var ydo=_(T(),1);function pB(e){e=e??z.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}pB.prototype.update=function(e){if(this.show){if(!c(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,c(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Rt({geometry:new e0({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[Y.RED,Y.RED],arcType:Kt.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Rt({geometry:new e0({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[Y.GREEN,Y.GREEN],arcType:Kt.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Rt({geometry:new e0({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[Y.BLUE,Y.BLUE],arcType:Kt.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new es,asynchronous:!1})}this._primitive.update(e)}};pB.prototype.isDestroyed=function(){return!1};pB.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};var Y9=pB;var Cdo=_(T(),1);function uCt(e){if(C.typeOf.object("options",e),C.typeOf.object("options.direction",e.direction),m.equals(e.direction,m.ZERO))throw new L("options.direction cannot be zero-length");this.direction=m.clone(e.direction),this.color=Y.clone(e.color??Y.WHITE),this.intensity=e.intensity??1}var u6=uCt;var Fdo=_(T(),1);var Ldo=_(T(),1),H9=`in vec3 v_positionMC; -in vec3 v_positionEC; -in vec2 v_st; -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 FYo=x(T(),1),XU=`uniform sampler2D colorTexture; +uniform float avgLuminance; +uniform float threshold; +uniform float offset; +in vec2 v_textureCoordinates; +float key(float avg) { -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); -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC); -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 +float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); +return max(0.0, guess) + 0.1; } -`;var Rdo=_(T(),1),z9=`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; -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +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 XS(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=c(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??z9,this._fragmentShaderSource=e.fragmentShaderSource??H9,this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(XS.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 XS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});XS.VERTEX_FORMAT=We.POSITION_AND_ST;XS.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;XS.prototype.isTranslucent=no.prototype.isTranslucent;XS.prototype.getRenderState=no.prototype.getRenderState;var m6=XS;var Bdo=_(T(),1);function od(e){if(!c(e)||!c(e.scene))throw new L("options.scene is required.");this._scene=e.scene,this.samplingWindow=e.samplingWindow??od.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??od.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??od.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??od.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??od.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new ye,this._nominalFrameRate=new ye,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){mCt(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(){fCt(t)}this._visibilityChangeRemoveListener=void 0,c(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}od.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};od.fromScene=function(e){if(!c(e))throw new L("scene is required.");return(!c(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new od({scene:e})),e._frameRateMonitor};Object.defineProperties(od.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}}});od.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};od.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){return this._preUpdateRemoveListener(),c(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),he(this)};function mCt(e,t){if(e._pauseCount>0)return;let n=Ti();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 fCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var K9=od;var ruo=_(T(),1);var dCe=_(_7(),1);function f6(){this._image=new Image}f6.prototype.isReady=function(){return!0};f6.prototype.shouldDiscardImage=function(e){return e===this._image};function IS(e){e=e??z.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 Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-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,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new f6),this._errorEvent=new ye}Object.defineProperties(IS.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}}});IS.fromMetadata=function(e,t){if(C.defined("metadata",e),!e.imageryPresent)throw new le(`The server ${e.url} doesn't have imagery`);let n=new IS(t);return n._metadata=e,n};IS.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(c(o)){let r=i.providers[o.imageryProvider];if(c(r))return[r]}};IS.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=G0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!c(a)){if(r.isValid(s)){let d=new Jo({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 l=hCt(this,a,e,t,n,i).fetchArrayBuffer();if(c(l))return l.then(function(d){W9(r.key,d);let u=new Uint8Array(d),f,p=r.protoImagery;if((!c(p)||!p)&&(f=pCt(u)),!c(f)&&(!c(p)||p)){let y=bCt(u);f=y.imageType,u=y.imageData}return!c(f)||!c(u)?o:l_({uint8Array:u,format:f,flipY:!0})})};IS.prototype.pickFeatures=function(e,t,n,i,o){};function hCt(e,t,n,i,o,r){let s=G0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=c(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function pCt(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 bCt(e){let t=dCe.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,c(a)||(a=i.copyrightIds=[]),(s&7)===2){let l=t.uint32()+t.pos;for(;t.pos<l;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(c(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new le("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return c(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var h6=IS;var muo=_(T(),1);var yCt=new Y(1,1,1,.4),gCt=new Y(0,1,0,.05),xCt=new Y(0,.5,0,.2);function WS(e){e=e??z.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=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??yCt,this._glowColor=e.glowColor??gCt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??xCt,this._errorEvent=new ye,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(WS.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}}});WS.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()};WS.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};WS.prototype.getTileCredits=function(e,t,n){};WS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};WS.prototype.pickFeatures=function(e,t,n,i,o){};var p6=WS;var Jmo=_(T(),1);var xmo=_(T(),1);var nmo=_(T(),1);var Cuo=_(T(),1);function Qf(){}Qf._maxDecodingConcurrency=Math.max(Ot.hardwareConcurrency-1,1);Qf._decodeTaskProcessor=new gi("decodeI3S",Qf._maxDecodingConcurrency);Qf._promise=void 0;async function _Ct(){if(await Qf._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Qf._decodeTaskProcessor;throw new le("I3S decoder could not be initialized.")}Qf.decode=async function(e,t,n,i,o){return C.typeOf.string("url",e),C.defined("defaultGeometrySchema",t),C.defined("geometryData",n),c(Qf._promise)||(Qf._promise=_Ct()),Qf._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,l=0,d=0,u=0;c(s.obb)?(l=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):c(s.mbs)&&(l=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let f=te.fromRotationX(-w.PI_OVER_TWO),p=new te;te.multiply(f,a,p);let y=pe.fromDegrees(l,d,u),h=re.WGS84.cartographicToCartesian(y),g={binaryData:n._data,featureData:c(i)&&c(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:y,cartesianCenter:h,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(g)})};var J9=Qf;var Ruo=_(T(),1);function b6(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,c(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(b6.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});b6.prototype.load=async function(){return this._data=await jf.loadJson(this._resource),this._data};var Q9=b6;var Iuo=_(T(),1);function X0(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;c(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(X0.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(c(this._values)){if(c(this._values.attributeValues))return this._values.attributeValues;if(c(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function bB(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 TCt(e){return e==="String"?1:bB(e)}async function SCt(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)}X0.prototype.load=function(){return c(this._loadPromise)?this._loadPromise:(this._loadPromise=SCt(this).catch(function(e){console.error(e)}),this._loadPromise)};X0.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}};X0.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};X0.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(c(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],l="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(l+=u.value),t=u.offset}this._values[o].push(l)}}}};X0.prototype._getBodyOffset=function(e){let t=0;return c(this._storageInfo.attributeValues)?t=bB(this._storageInfo.attributeValues.valueType):c(this._storageInfo.objectIds)&&(t=bB(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};X0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=TCt(i.valueType)}if(e.byteLength<t)throw new le(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};X0.prototype._validateBody=function(e,t){if(!c(this._header.count))throw new le(`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(c(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=bB(s.valueType);t+=a*this._header.count}else{if(!c(n))throw new le(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let l=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=l.value,n=l.offset}}else throw new le(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new le(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var j9=X0;var Muo=_(T(),1);function q9(e,t){let n=e._dataProvider,i=e._layer,o;c(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(q9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});q9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var CCt=new m,VCt=new m,LCt=new m,ZCt=new m,RCt=new m;function y6(e,t,n,i){let o=m.subtract(i,n,CCt),r=m.cross(o,m.subtract(e,n,VCt),ZCt),s=m.cross(o,m.subtract(t,n,LCt),RCt);return m.dot(r,s)>=0}var GCt=new m,ECt=new m,XCt=new m,ICt=new m,WCt=new m,wCt=new m,PCt=new m,vCt=new m,FCt=new m,ACt=new m;q9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(c(this._customAttributes)&&c(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,te.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,l,d=this._customAttributes.positions,u=this._customAttributes.indices,f;c(u)?f=u.length:f=d.length/3;for(let p=0;p<f;p++){let y,h,g;c(u)?(y=u[p],h=u[p+1],g=u[p+2]):(y=p*3,h=p*3+1,g=p*3+2);let x=m.fromElements(d[y*3],d[y*3+1],d[y*3+2],GCt),S=m.fromElements(d[h*3],d[h*3+1],d[h*3+2],ECt),V=new m(d[g*3],d[g*3+1],d[g*3+2],XCt);if(!y6(i,x,S,V)||!y6(i,S,x,V)||!y6(i,V,x,S))continue;let Z=m.subtract(S,x,ICt),R=m.subtract(V,x,WCt),E=m.cross(Z,R,wCt);if(m.magnitude(E)===0)continue;let I=m.normalize(E,PCt),v=m.subtract(i,x,vCt),P=Math.abs(m.dot(v,I));if(P<o){o=P,r=p;let F=m.magnitudeSquared(m.subtract(i,x,v)),N=m.magnitudeSquared(m.subtract(i,S,FCt)),b=m.magnitudeSquared(m.subtract(i,V,ACt));F<N&&F<b?(a=y,l=x,s=F):N<b?(a=h,l=S,s=N):(a=g,l=V,s=b)}}if(c(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(l)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function uCe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(LS(e[i])):t.push(e[i]);return t}q9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let l={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,f="";if(c(this._parent._data.mesh)&&c(this._layer._data.materialDefinitions)){let Z=this._parent._data.mesh.material.definition;if(Z>=0&&Z<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[Z],l=u,c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorTexture)){d=!0,l.pbrMetallicRoughness.baseColorTexture.index=0;let R="0";if(c(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let I=this._layer._data.textureSetDefinitions[E];for(let v=0;v<I.formats.length;v++){let P=I.formats[v];if(P.format==="jpg"){R=P.name;break}}}c(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(f=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${R}`}).url)}c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorFactor)&&(l.pbrMetallicRoughness.baseColorFactor=uCe(l.pbrMetallicRoughness.baseColorFactor)),c(l.emissiveFactor)&&(l.emissiveFactor=uCe(l.emissiveFactor))}}else c(this._parent._data.textureData)&&(d=!0,f=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,l.pbrMetallicRoughness.baseColorTexture={index:0});c(l.alphaMode)&&(l.alphaMode=l.alphaMode.toUpperCase());let p=[],y=[],h=[];d&&(p=[{sampler:0,source:0}],y=[{uri:f}],h=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let g=[],x=n.length;for(let V=0;V<x;V++){let Z=n[V].primitives,R=Z.length;for(let E=0;E<R;E++){let I=Z[E];if(c(I.material)){for(;I.material>=g.length;){let P=He(l,!0);g.push(P)}let v=g[I.material];c(I.extra)&&I.extra.isTransparent?c(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:g,textures:p,images:y,samplers:h,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var NL=q9;function wc(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(wc.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}}});wc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Ku(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!c(this._nodeIndex)){let o=await jf.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/":c(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),c(i)&&c(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function mCe(e,t){let n=new j9(e,t);return e._fields[t.name]=n,n.load()}wc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(c(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];c(o)?t.push(o.load()):t.push(mCe(this,i))}return Promise.all(t)};wc.prototype.loadField=function(e){C.defined("name",e);let t=this._fields[e];if(c(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return mCe(this,o)}return Promise.resolve()};wc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!c(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)};wc.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};wc.prototype._loadChildren=function(){let e=this;if(c(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(c(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new wc(e,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};wc.prototype._loadGeometryData=function(){let e=[];if(c(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new NL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(c(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new NL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};wc.prototype._loadFeatureData=function(){let e=[];if(c(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new Q9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};wc.prototype._clearGeometryData=function(){this._geometryData=[]};wc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!c(e)&&!c(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(c(e)?n=pe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=pe.fromDegrees(t[0],t[1],t[2]),c(this._dataProvider._geoidDataList)&&c(n))for(let S=0;S<this._dataProvider._geoidDataList.length;S++){let V=this._dataProvider._geoidDataList[S],Z=V.projection.project(n);if(Z.x>V.nativeExtent.west&&Z.x<V.nativeExtent.east&&Z.y>V.nativeExtent.south&&Z.y<V.nativeExtent.north){n.height+=UCt(Z.x,Z.y,V);break}}let i={},o,r=0;c(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=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=re.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(c(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let S=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/S}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let S=this._data.lodThreshold;s=r/S}else console.error("Invalid lodSelectionMetricType in Layer");else if(c(this._data.lodSelection))for(let S=0;S<this._data.lodSelection.length;S++)this._data.lodSelection[S].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[S].maxError);s===1/0&&(s=1e5);let a=s*16,l=new Ea(0,0,0),d=wt.headingPitchRollQuaternion(o,l);c(this._data.obb)&&(d=new Fe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=te.fromQuaternion(d),f=te.inverse(u,new te),p=new M(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),y=M.inverse(p,new M),h=M.clone(p);c(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=y,this._inverseRotationMatrix=f;let g=[];for(let S=0;S<this._children.length;S++)g.push(this._children[S]._create3DTileDefinition());return{children:g,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:c(this._resource)?this._resource.url:void 0},geometricError:a}};wc.prototype._loadSymbology=async function(){!c(this._symbologyData)&&c(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};wc.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),c(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 J9.decode(o,r,s,this._featureData[0],this._symbologyData);if(!c(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 MCt(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 NCt(e,t,n){if(!c(n.values)||n.values.length===0)return!1;let i=c(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 fCe(e,t){let n=e._tile.content.batchTable;if(c(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await MCt(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(!NCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}wc.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(c(this._geometryData)&&this._geometryData.length>0&&c(t)&&t.ready){t.show=!1;let n=fCe(this,t);e.push(n)}return Promise.all(e)};Ku.prototype._hookedRequestContent=Ku.prototype.requestContent;Ku.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(!c(t)){e._isLoading=!1;return}return e._contentResource=new Ge({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return c(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&c(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{fCe(e._i3sNode,n)})),e._isLoading=!1,t})}};function kCt(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 yB(e,t,n,i){let o=e+t*n;return i[o]}function UCt(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 l=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=yB(s,a,n.width,n.buffer),f=yB(l,a,n.width,n.buffer),p=yB(s,d,n.width,n.buffer),y=yB(l,d,n.width,n.buffer),h=kCt(o,r,u,f,p,y);return h=h*n.scale+n.offset,h}Object.defineProperties(Ku.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var kL=wc;var amo=_(T(),1);function gB(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(gB.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function g6(e,t){let n=[];for(let i=0;i<e.length;i++){let o=Y.byteToFloat(e[i]);i<3?n.push(LS(o)):n.push(o)}return n.length===3&&(c(t)?n.push(1-t/100):n.push(1)),n}function UL(e,t){let n={edges:void 0,material:void 0};if(c(e)&&c(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(c(r)?(n.edges={},c(r.color)&&(n.edges.color=g6(r.color,r.transparency))):c(s)&&(n.edges={},c(s.color)&&(n.edges.color=g6(s.color,s.transparency))),!t){let a=o.material;c(a)&&(n.material={colorMixMode:a.colorMixMode},c(a.color)&&(n.material.color=g6(a.color,a.transparency)))}break}}return n}function OCt(e,t){if(c(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(c(o))for(let r=0;r<o.length;r++){let s=UL(o[r].symbol,t),a=o[r].values;for(let l=0;l<a.length;l++){let d=a[l],u=n;for(let f=0;f<d.length;f++){let p=d[f];f===d.length-1?u[p]=s:(c(u[p])||(u[p]={}),u=u[p])}}}}return n}if(c(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=UL(o.symbol,t)}return n}}function DCt(e,t){if(c(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};c(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];c(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),c(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(UL(r.symbol,t)))}return i.symbols.push(void 0),i}}gB.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(c(e)&&c(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=c(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=UL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=UL(i.defaultSymbol,n),this._valueFields.push(i.field1),c(i.field2)&&this._valueFields.push(i.field2),c(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=OCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=UL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=DCt(i,n))}};function hCe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return c(s)&&++n<t.length?hCe(s,t,n,i):s}}function BCt(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 YCt(e,t,n){let i=t[n],o=BCt(e.ranges,i);return e.symbols[o]}gB.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(c(this._uniqueValueHash)?o=r=>hCe(this._uniqueValueHash,i,0,r):c(this._classBreaksHash)&&(o=r=>YCt(this._classBreaksHash,i[0],r)),c(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);c(a)&&(t[s]=a)}}}return t};var $9=gB;function rd(e,t,n){this._dataProvider=e,this._parent=n,!c(t.href)&&c(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 Ge({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(rd.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(c(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});rd.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new le(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new $9(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()};rd.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],c(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(c(r.compressedAttributes)&&e){a=!0;let l=r.compressedAttributes.attributes;for(let d=0;d<l.length;d++)s.push(l[d])}else for(let l in r)l!=="offset"&&s.push(l);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)}};rd.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(c(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(c(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};rd.prototype._loadRootNode=function(e){if(c(this._data.nodePages)){let t=0;c(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new kL(this,t,!0)}else this._rootNode=new kL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};rd.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]})};rd._fetchJson=function(e){return e.fetchJson()};rd.prototype._loadNodePage=function(e){let t=this;if(!c(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=rd._fetchJson(n).then(function(o){return c(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};rd.prototype._computeExtent=function(){c(this._data.fullExtent)?this._extent=de.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):c(this._data.store.extent)&&(this._extent=de.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};rd.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;c(o)&&!c(e?.outlineColor)&&(e=c(e)?He(e):{},e.outlineColor=Y.fromCartesian4(ce.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){c(r._i3sNode)&&r._i3sNode._loadChildren()})};rd.prototype._updateVisibility=function(){c(this._tileset)&&(this._tileset.show=this._parent.show)};rd.prototype.filterByAttributes=function(e){this._filters=c(e)?He(e,!0):[];let t=this._rootNode;return c(t)?t._filterFeatures():Promise.resolve()};var wS=rd;var Vmo=_(T(),1);function xB(e,t){this._dataProvider=e,this._resource=new Ge({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(xB.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});xB.prototype.load=async function(){return this._data=await jf.loadJson(this._resource),this._data};xB.prototype._getValues=function(e){let t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return c(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var eM=xB;var Imo=_(T(),1);function tM(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(tM.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(C.defined("value",e),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}}});tM._fromData=async function(e,t,n,i){let o=new tM(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(c(r)){let s=[];for(let l=0;l<r.length;l++){let d=tM._fromData(e,t,r[l],o);s.push(d)}let a=await Promise.all(s);for(let l=0;l<a.length;l++){let d=a[l];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 Ge({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await jf.loadJson(o._resource),l=new wS(e,a,o);o._i3sLayers.push(l)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var nM=tM;var yCe=_(pCe(),1);function xs(e){e=e??z.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??z.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(C.defined("value",e),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++)c(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return he(this)};xs.prototype.isDestroyed=function(){return!1};xs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};xs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};xs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(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++)c(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 bCe(e,t,n){if(t.layerType==="Building"){c(n.showFeatures)||(e._showFeatures=!0),c(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),c(n.applySymbology)||(e._applySymbology=!0),c(n.calculateNormals)||(e._calculateNormals=!0);let i=HCt(e,t.id);if(c(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=nM._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(c(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new eM(e,o);await r.load(),e._attributeStatistics.push(r)}if(c(t.fullExtent)){let o=de.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"){!c(n.calculateNormals)&&!c(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new wS(e,t,e);e._layers.push(i),c(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){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await xs.loadJson(n),o=new xs(t);if(o._resource=n,o._data=i,c(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let l=bCe(o,i.layers[a],t);s.push(l)}await Promise.all(s)}else await bCe(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(c(t.error)){if(console.error("Failed to fetch I3S ",e.url),c(t.error.message)&&console.error(t.error.message),c(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new le(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 le(`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 zCt=new D;function KCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=pe.fromRadians(t.west,t.north),a=pe.fromRadians(t.east,t.south),l=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let f=l.x;f<=d.x;f++)for(let p=l.y;p<=d.y;p++){let y=D.fromElements(f,p,zCt),h=y.toString();if(!o.hasOwnProperty(h)){let g={x:y.x,y:y.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[h]=g,i.push(g)}}let u=[];for(let f=0;f<i.length;++f){let p=i[f],y=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(y)}return Promise.all(u).then(function(f){let p=[];for(let y=0;y<f.length;y++){let h={tilingScheme:n,x:i[y].x,y:i[y].y,level:i[y].level},g=f[y],x="Geographic";n._projection instanceof Wi&&(x="WebMercator");let S={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:g._height,width:g._width,scale:g._structure.heightScale,offset:g._structure.heightOffset};if(g._encoding===cm.LERC){let V=yCe.default.decode(g._buffer);S.buffer=V.pixels[0]}else S.buffer=g._buffer;p.push(S)}return p})}async function JCt(e){let t=e._geoidTiledTerrainProvider;if(c(t))try{let n=await KCt(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 c(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=JCt(this),this._geoidDataPromise)};xs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];c(e)?de.union(e,n,e):e=de.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){C.defined("name",e);for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(c(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 jf=xs;var sfo=_(T(),1);var iM={};iM.createTilesetFromIModelId=async function(e,t){let{exports:n}=await as.getExports(e);if(n.length>0&&n.every(a=>a.status===as.ExportStatus.Invalid))throw new le(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===as.ExportStatus.Complete);if(!c(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Ge({url:r});return bs.fromUrl(s,t)};iM.createTilesetForRealityDataId=async function(e,t,n,i){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),c(n)&&C.typeOf.string("type",n),c(i)&&C.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await as.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![as.RealityDataType.Cesium3DTiles,as.RealityDataType.PNTS,as.RealityDataType.RealityMesh3DTiles,as.RealityDataType.Terrain3DTiles].includes(n))throw new le(`Reality data type is not a mesh type: ${n}`);let r=await as.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};iM.createDataSourceForRealityDataId=async function(e,t,n,i){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),c(n)&&C.typeOf.string("type",n),c(i)&&C.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await as.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![as.RealityDataType.KML,as.RealityDataType.GeoJSON].includes(n))throw new le(`Reality data type is not a data source type: ${n}`);let r=await as.getRealityDataURL(e,t,i);return n===as.RealityDataType.GeoJSON?gg.load(r):XT.load(r)};iM.loadGeospatialFeatures=async function(e,t,n){if(C.typeOf.string("iTwinId",e),C.typeOf.string("collectionId",t),c(n)&&(C.typeOf.number("limit",n),C.typeOf.number.lessThanOrEquals("limit",n,1e4),C.typeOf.number.greaterThanOrEquals("limit",n,1)),!c(as.defaultAccessToken)&&!c(as.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=n??1e4,o=`${as.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Ge({url:o,headers:{Authorization:as._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return gg.load(r)};var x6=iM;var lfo=_(T(),1);function gCe(){}Object.defineProperties(gCe.prototype,{color:{get:L.throwInstantiationError},intensity:{get:L.throwInstantiationError}});var _6=gCe;var yfo=_(T(),1);var QCt=/\/$/,xCe=new Ct('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function OL(e){e=e??z.EMPTY_OBJECT;let t=e.styleId;if(!c(t))throw new L("options.styleId is required.");let n=e.accessToken;if(!c(n))throw new L("options.accessToken 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;let i=Ge.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=c(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();QCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let l;c(e.credit)?(l=e.credit,typeof l=="string"&&(l=new Ct(l))):l=xCe,this._resource=i,this._imageryProvider=new Ba({url:i,credit:l,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(OL.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}}});OL.prototype.getTileCredits=function(e,t,n){};OL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};OL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};OL._defaultCredit=xCe;var T6=OL;var xfo=_(T(),1);function S6(e){}S6.prototype.isReady=function(){return!0};S6.prototype.shouldDiscardImage=function(e){return!1};var C6=S6;var Efo=_(T(),1);var jCt=new Ct("MapQuest, Open Street Map and contributors, CC-BY-SA");function TB(e){e=e??z.EMPTY_OBJECT;let t=Ge.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new ss({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,l=n.positionToTileXY(de.southwest(a),r),d=n.positionToTileXY(de.northeast(a),r),u=(Math.abs(d.x-l.x)+1)*(Math.abs(d.y-l.y)+1);if(u>4)throw new L(`The rectangle and minimumLevel indicate that there are ${u} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let f=e.credit??jCt;typeof f=="string"&&(f=new Ct(f)),Ba.call(this,{url:t,credit:f,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}c(Object.create)&&(TB.prototype=Object.create(Ba.prototype),TB.prototype.constructor=TB);var I0=TB;var Ffo=_(T(),1);var qCt=new D(1,1);function V6(e){e=e??z.EMPTY_OBJECT,this.mass=e.mass??1,this.position=m.clone(e.position??m.ZERO),this.velocity=m.clone(e.velocity??m.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=Y.clone(e.startColor??Y.WHITE),this.endColor=Y.clone(e.endColor??Y.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=D.clone(e.imageSize??qCt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(V6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var _Ce=new m;V6.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,_Ce),m.add(this.position,_Ce,this.position),c(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 DL=V6;var Nfo=_(T(),1);function TCe(e){e=e??z.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(TCe.prototype,{complete:{get:function(){return this._complete}}});var L6=TCe;var Ofo=_(T(),1);function SCe(e){throw new L("This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}SCe.prototype.emit=function(e){L.throwInstantiationError()};var Z6=SCe;var oho=_(T(),1);var CCe=new D(1,1);function oM(e){e=e??z.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;c(t)||(t=new O9(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=Y.clone(e.color??e.startColor??Y.WHITE),this._endColor=Y.clone(e.color??e.endColor??Y.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=D.clone(e.imageSize??e.minimumImageSize??CCe),this._maximumImageSize=D.clone(e.imageSize??e.maximumImageSize??CCe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 ye,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(oM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){C.defined("value",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){C.defined("value",e),this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){C.defined("value",e),this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){C.defined("value",e),Y.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){C.defined("value",e),Y.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){C.typeOf.object("value",e),C.typeOf.number.greaterThanOrEquals("value.x",e.x,0),C.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){C.typeOf.object("value",e),C.typeOf.number.greaterThanOrEquals("value.x",e.x,0),C.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){C.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),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(c(o)){let f=o.length;for(let p=0;p<f;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),l=e._particles,d=e._particlePool,u=Math.max(a-l.length-d.length,0);for(let f=0;f<u;++f){let p=new DL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function e1t(e){let t=e._particlePool.pop();return c(t)||(t=new DL),t}function t1t(e,t){e._particlePool.push(t)}function n1t(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 l=a;l<r;++l){let d=n[l];i.remove(d._billboard)}n.length=a}function i1t(e){c(e._billboard)&&(e._billboard.show=!1)}function VCe(e,t){let n=t._billboard;c(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 Y(i,o,r,s),n.scale=w.lerp(t.startScale,t.endScale,t.normalizedAge)}function o1t(e,t){t.startColor=Y.clone(e._startColor,t.startColor),t.endColor=Y.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 r1t(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),c(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;c(s)&&!s._complete&&a>s.time&&(i+=w.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var SB=new m;oM.prototype.update=function(e){if(!this.show)return;c(this._billboardCollection)||(this._billboardCollection=new Gd),this._updateParticlePool&&($Ct(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.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)?VCe(this,s):(i1t(s),t1t(this,s),n[r]=n[a-1],--r,--a);n.length=a;let l=r1t(this,t);if(l>0&&c(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<l;r++)s=e1t(this),this._emitter.emit(s),m.add(s.position,s.velocity,SB),M.multiplyByPoint(d,SB,SB),s.position=M.multiplyByPoint(d,s.position,s.position),m.subtract(SB,s.position,s.velocity),m.normalize(s.velocity,s.velocity),o1t(this,s),VCe(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.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&&n1t(this)};oM.prototype.isDestroyed=function(){return!1};oM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),he(this)};var R6=oM;var aho=_(T(),1);function lu(){L.throwInstantiationError()}lu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(lu.prototype,{quadtree:{get:L.throwInstantiationError,set:L.throwInstantiationError},tilingScheme:{get:L.throwInstantiationError},errorEvent:{get:L.throwInstantiationError}});lu.prototype.update=L.throwInstantiationError;lu.prototype.beginUpdate=L.throwInstantiationError;lu.prototype.endUpdate=L.throwInstantiationError;lu.prototype.getLevelMaximumGeometricError=L.throwInstantiationError;lu.prototype.loadTile=L.throwInstantiationError;lu.prototype.computeTileVisibility=L.throwInstantiationError;lu.prototype.showTileThisFrame=L.throwInstantiationError;lu.prototype.computeDistanceToTile=L.throwInstantiationError;lu.prototype.isDestroyed=L.throwInstantiationError;lu.prototype.destroy=L.throwInstantiationError;var G6=lu;var mho=_(T(),1);function E6(e){e=e??1,C.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(E6.prototype,{radius:{get:function(){return this._radius},set:function(e){C.typeOf.number.greaterThan("value",e,0),this._radius=e}}});E6.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 X6=E6;var pho=_(T(),1);function rM(){}rM.prototype.evaluate=function(e,t){L.throwInstantiationError()};rM.prototype.evaluateColor=function(e,t){L.throwInstantiationError()};rM.prototype.getShaderFunction=function(e,t,n,i){L.throwInstantiationError()};rM.prototype.getVariables=function(){L.throwInstantiationError()};var I6=rM;var Tho=_(T(),1);function BL(e){C.typeOf.object("terrainProviderPromise",e),this._ready=!1,this._provider=void 0,this._errorEvent=new ye,this._readyEvent=new ye,a1t(this,e)}Object.defineProperties(BL.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}}});BL.fromWorldTerrain=function(e){return new BL(TS(e))};BL.fromWorldBathymetry=function(e){return new BL(I9(e))};function s1t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function a1t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){s1t(e._errorEvent,i)}}var sM=BL;var Vho=_(T(),1);function YL(){}YL.prototype.boundingVolume=void 0;YL.prototype.boundingSphere=void 0;YL.prototype.distanceToCamera=function(e){L.throwInstantiationError()};YL.prototype.intersectPlane=function(e){L.throwInstantiationError()};YL.prototype.createDebugVolume=function(e){L.throwInstantiationError()};var W6=YL;var Iho=_(T(),1);function aM(e){e=e??z.EMPTY_OBJECT,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??Y.YELLOW,this._errorEvent=new ye,this._tileWidth=e.tileWidth??256,this._tileHeight=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(aM.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}}});aM.prototype.getTileCredits=function(e,t,n){};aM.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)};aM.prototype.pickFeatures=function(e,t,n,i,o){};var cM=aM;var Pho=_(T(),1);function w6(e){L.throwInstantiationError()}w6.prototype.isReady=L.throwInstantiationError;w6.prototype.shouldDiscardImage=L.throwInstantiationError;var P6=w6;var Fho=_(T(),1),c1t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},v6=Object.freeze(c1t);var Jho=_(T(),1);function CB(e,t){this.show=!0,c(e)||(e=new je),this.rectangle=je.clone(e),c(t)||(t=zi.fromType(zi.ColorType,{color:new Y(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}CB.prototype.update=function(e){if(!this.show)return;if(!c(this.material))throw new L("this.material must be defined.");if(!c(this.rectangle))throw new L("this.rectangle must be defined.");let t=this._rs;if((!c(t)||!je.equals(t.viewport,this.rectangle))&&(this._rs=Oe.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!c(this._overlayCommand)){this._material=this.material,c(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Be({sources:[this._material.shaderSource,Qv]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Xe.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};CB.prototype.isDestroyed=function(){return!1};CB.prototype.destroy=function(){return c(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),he(this)};var F6=CB;var qho=_(T(),1);function A6(){L.throwInstantiationError()}Object.defineProperties(A6.prototype,{globalTransform:{get:L.throwInstantiationError},shapeTransform:{get:L.throwInstantiationError},shape:{get:L.throwInstantiationError},minBounds:{get:L.throwInstantiationError},maxBounds:{get:L.throwInstantiationError},dimensions:{get:L.throwInstantiationError},paddingBefore:{get:L.throwInstantiationError},paddingAfter:{get:L.throwInstantiationError},names:{get:L.throwInstantiationError},types:{get:L.throwInstantiationError},componentTypes:{get:L.throwInstantiationError},minimumValues:{get:L.throwInstantiationError},maximumValues:{get:L.throwInstantiationError},maximumTileCount:{get:L.throwInstantiationError},availableLevels:{get:L.throwInstantiationError},keyframeCount:{get:L.throwInstantiationError},timeIntervalCollection:{get:L.throwInstantiationError}});A6.prototype.requestData=function(e){L.throwInstantiationError()};var M6=A6;var tpo=_(T(),1);function PS(){L.throwInstantiationError()}Object.defineProperties(PS.prototype,{orientedBoundingBox:{get:L.throwInstantiationError},boundingSphere:{get:L.throwInstantiationError},boundTransform:{get:L.throwInstantiationError},shapeTransform:{get:L.throwInstantiationError},shaderUniforms:{get:L.throwInstantiationError},shaderDefines:{get:L.throwInstantiationError},shaderMaximumIntersectionsLength:{get:L.throwInstantiationError}});PS.prototype.update=L.throwInstantiationError;PS.prototype.computeOrientedBoundingBoxForTile=L.throwInstantiationError;PS.prototype.computeOrientedBoundingBoxForSample=L.throwInstantiationError;PS.DefaultMinBounds=L.throwInstantiationError;PS.DefaultMaxBounds=L.throwInstantiationError;var N6=PS;var ipo=_(T(),1),k6=`uniform sampler2D u_depthTexture; +`;function by(){this._sceneFramebuffer=new RR;let e=.125,t=new Array(6);t[0]=new Uo({fragmentShader:du,textureScale:e,forcePowerOfTwo:!0,sampleMode:mm.LINEAR});let n=t[1]=new Uo({fragmentShader:XU,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new k,t[2]=new Uo({fragmentShader:PT,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 Uo({fragmentShader:PT,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 Uo({fragmentShader:du,sampleMode:mm.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new Uo({fragmentShader:PU,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new mu({stages:t});let o=new GR(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}by.prototype.get=function(e){return this._stages.get(e)};by.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 FUt=new ce,HXe=new k,IUt=new k,KXe=new P;function PUt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=P.computeViewportTransformation(n,0,1,KXe),d=P.multiplyByPoint(r,o,FUt),u=_t.pointToGLWindowCoordinates(s,c,o,HXe);d.x+=W.SOLAR_RADIUS;let m=_t.pointToGLWindowCoordinates(a,c,d,d),p=k.magnitude(k.subtract(m,u,m))*30*2,b=IUt;b.x=p,b.y=p,e._uCenter=k.clone(u,e._uCenter),e._uRadius=Math.max(b.x,b.y)*.15;let f=t.drawingBufferWidth,y=t.drawingBufferHeight,_=e._stages,S=_.get(0),Z=S.outputTexture.width,R=S.outputTexture.height,C=new nt;C.width=Z,C.height=R,c=P.computeViewportTransformation(C,0,1,KXe),u=_t.pointToGLWindowCoordinates(s,c,o,HXe),b.x*=Z/f,b.y*=R/y;let E=S.scissorRectangle;E.x=Math.max(u.x-b.x*.5,0),E.y=Math.max(u.y-b.y*.5,0),E.width=Math.min(b.x,f),E.height=Math.min(b.y,y);for(let A=1;A<4;++A)nt.clone(E,_.get(A).scissorRectangle)}by.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};by.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),PUt(this,t,n),o};by.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)};by.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(du,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};by.prototype.isDestroyed=function(){return!1};by.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var NU=by;var owo=x(T(),1);function IR(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new tn}IR.fromKeyframeNode=function(e,t,n,i){let o=new IR(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=XUt(e,s,n),o._orientedBoundingBox=YUt(e,r,n,o._orientedBoundingBox),o};function XUt(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=St.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[c]=u}return s}var JXe=new h,NUt=new h;function YUt(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=h.fromElements(d,c,s,JXe),m=h.divideComponents(h.subtract(u,e._paddingBefore,JXe),e.dimensions,NUt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(IR.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()}}});IR.prototype.hasProperty=function(e){return l(this._metadata[e])};IR.prototype.getNames=function(){return Object.keys(this._metadata)};IR.prototype.getProperty=function(e){return this._metadata[e]};var YU=IR;var dMo=x(T(),1);var Fwo=x(T(),1);var fwo=x(T(),1);function Eh(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=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new tn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var wUt=new h;Eh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=q.getScale(this.orientedBoundingBox.halfAxes,wUt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Eh.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,m=t+1,p=[[m,r,s,a],[m,d,s,a],[m,r,c,a],[m,d,c,a],[m,r,s,u],[m,d,s,u],[m,r,c,u],[m,d,c,u]];this.children=p.map(([b,f,y,_])=>new Eh(b,f,y,_,this,e,this.dimensions))};Eh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Eh.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 jXe={keyframe:0};function wU(e,t){return jXe.keyframe=e,Eo(t,jXe,zo.searchComparator)}Eh.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:m}=t;if(m.length>=1){let p=MUt(i,m),b=m[p],f=o===i||i<b.keyframe?p:Math.min(p+1,m.length-1),y=m[f],_=i-b.keyframe,S=QXe(n-t.level,_);S<a&&(a=S,r=b);let Z=y.keyframe-o,R=QXe(n-t.level,Z);if(R<c&&(c=R,s=y),_===0&&Z===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 MUt(e,t){let n=wU(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function QXe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Eh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Eh.prototype.createKeyframeNode=function(e){let t=wU(e,this.keyframeNodes);if(t<0){t=~t;let n=new zo(this,e);this.keyframeNodes.splice(t,0,n)}};Eh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=wU(n,this.keyframeNodes);if(i<0)throw new ge("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=wU(n,this.renderableKeyframeNodes);if(o<0)throw new ge("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Eh.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new ge("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=wU(e.keyframe,i);if(o>=0)throw new ge("Keyframe already renderable");o=~o,i.splice(o,0,e)};Eh.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 MU=Eh;function XT(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:s}=e,{types:a,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let d=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let S=0;S<a.length;S++){let Z=a[S],R=St.getComponentCount(Z),C=c[S];this.megatextures[S]=new X9(t,s,R,C,i,d),this.textureMemoryByteLength+=this.megatextures[S].textureMemoryByteLength}let u=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let m=e._shape;this.rootNode=new MU(0,0,0,0,void 0,m,r),this._priorityQueue=new qg({maximumLength:u,comparator:zo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(u),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(u),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,sce(p,1,n-2,0);let b=9,f=2048,y=Math.floor(f/b),_=Math.ceil(u/y);this.internalNodeTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:f,height:_,sampler:new Bt({minificationFilter:Ht.NEAREST,magnificationFilter:ei.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new k(1/f,1/_),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new k}XT.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function sce(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,sce(e,t,o-1,i+1),sce(e,o+1,n,i+1)}XT.simultaneousRequestCountMaximum=50;XT.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,m=(d?2:1)*(u?2:1);this._sampleCount=m;let p=m>=2;if(p&&!l(this.leafNodeTexture)){let R=Math.floor(512),C=Math.ceil(s/R);this.leafNodeTexture=new vt({context:r,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:C,sampler:new Bt({minificationFilter:Ht.NEAREST,magnificationFilter:ei.NEAREST})}),this.leafNodeTexelSizeUv=k.fromElements(1/1024,1/C,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=R}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&qXe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let b=Zn();DUt(this,e),OUt(this,e);let f=Zn();JUt(this,m,c);let y=Zn(),_=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||_){let S=f-b,Z=y-f,R=y-b;KUt(this,e,S,Z,R)}};XT.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};XT.prototype.isDestroyed=function(){return!1};XT.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 qXe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];qXe(e,i)}}function kUt(e,t){if(e._simultaneousRequestCount>=XT.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)?zo.LoadState.PROCESSING:zo.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=zo.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=zo.LoadState.RECEIVING,d.then(s).catch(a))}function UUt(e){return e/(1+e)}function DUt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),$Xe(e.rootNode,$s.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 OUt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(BUt);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===zo.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===zo.LoadState.UNLOADED&&kUt(e,u),u.state===zo.LoadState.PROCESSING)){let{content:m}=u;if(m.update(e._primitive,t),!m.ready)continue;if(!zUt(m.metadata,e)){u.content=void 0,u.state=zo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let b=o[p];e._primitive.tileUnload.raiseEvent(),b.spatialNode.destroyKeyframeNode(b,e.megatextures)}else p=i+c,c++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=zo.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function BUt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function zUt(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,m=e[o],p=u*s;if(m.length!==p)return!1}return!0}function $Xe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:d}=o,m=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(c,m),t=e.visibility(i,t),t===$s.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,b=p._shape,f=p.screenSpaceError,y=n._priorityQueue,_=n._keyframeCount,S=W.clamp(Math.floor(n._keyframeLocation),0,_-2),Z=S+1;if(_===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==_)for(let L=0;L<_;L++)e.createKeyframeNode(L);let{screenSpaceError:R,keyframeNodes:C}=e,E=UUt(R),A=!1;for(let L=0;L<C.length;L++){let F=C[L];F.priority=10*E+HUt(S,F.keyframe,Z,n),F.state!==zo.LoadState.UNAVAILABLE&&F.state!==zo.LoadState.FAILED&&F.priority!==-Number.MAX_VALUE&&y.insert(F),F.state===zo.LoadState.LOADED&&(A=!0)}if(R<f||!A){e.children=void 0;return}l(e.children)||e.constructChildNodes(b);for(let L=0;L<8;L++){let F=e.children[L];$Xe(F,t,n,i)}}function HUt(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 KUt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(zo.LoadState).length,c=new Array(a),d=new Array(a),u=0;for(let A=0;A<a;A++){let L=new Array(r).fill(0);c[A]=L,d[A]=0}function m(A){let L=A.keyframeNodes;for(let F=0;F<L.length;F++){let I=L[F],N=I.keyframe,g=I.state;c[g][N]+=1,d[g]+=1,u++}if(l(A.children))for(let F=0;F<8;F++){let I=A.children[F];m(I)}}m(s),e._primitive.statistics.numberOfTilesWithContentReady=d[zo.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[zo.LoadState.RECEIVING],b=d[zo.LoadState.PROCESSING],f=p!==e._primitive.statistics.numberOfPendingRequests||b!==e._primitive.statistics.numberOfTilesProcessing;if(f&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,b),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=b,f&&(p===0&&b===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[zo.LoadState.LOADED]}`,S=`UNLOADED: ${d[zo.LoadState.UNLOADED]} | RECEIVING: ${d[zo.LoadState.RECEIVING]} | PROCESSING: ${d[zo.LoadState.PROCESSING]} | LOADED: ${d[zo.LoadState.LOADED]} | FAILED: ${d[zo.LoadState.FAILED]} | UNAVAILABLE: ${d[zo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,Z=Math.round(n*100)/100,R=Math.round(i*100)/100,C=Math.round(o*100)/100,E=`LOAD: ${Z} | OCT: ${R} | ALL: ${C}`;console.log(`${_} || ${S} || ${E}`)}var SJ={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function JUt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function m(b,f,y,_,S){let Z=!1;if(l(b.children))for(let R=0;R<8;R++){let C=b.children[R];C.computeSurroundingRenderableKeyframeNodes(o),C.isRenderable(r)&&(Z=!0)}if(Z){d[S]=SJ.INTERNAL<<16|f,d[y]=_,a++,_=f,S=_*9+1;for(let R=0;R<8;R++){let C=b.children[R];f=a,y=f*9+0,m(C,f,y,_,S+R)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let R=c*5,C=b.renderableKeyframeNodePrevious,E=b.level-C.spatialNode.level,A=C.spatialNode.parent,L=l(A)?A.renderableKeyframeNodePrevious:C,F=jUt(b,i,n),I=E,N=1,g=C.megatextureIndex,V=L.megatextureIndex;u[R+0]=F,u[R+1]=I,u[R+2]=N,u[R+3]=g,u[R+4]=V,d[S]=SJ.LEAF<<16|c}else{let R=b.renderableKeyframeNodePrevious,E=b.level-R.spatialNode.level===0?SJ.LEAF:SJ.PACKED_LEAF_FROM_PARENT;d[S]=E<<16|R.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),QUt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&qUt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function jUt(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 QUt(e,t,n,i){let o=Qe.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 m=0;m<e.length;m++){let p=e[m],b=m*o;for(let f=0;f<o;f++)c[b+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function qUt(e,t,n,i){let o=Qe.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 b=e[p*r+0],f=e[p*r+1],y=e[p*r+2],_=e[p*r+3],S=e[p*r+4],Z=W.clamp(Math.floor(65536*b),0,65535);d[p*8+0]=Z>>>0&255,d[p*8+1]=Z>>>8&255,d[p*8+2]=f&255,d[p*8+3]=y&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=S>>>0&255,d[p*8+7]=S>>>8&255}let m={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}var kU=XT;function z0(e){e=e??B.EMPTY_OBJECT;let{provider:t=z0.DefaultProvider,modelMatrix:n=P.IDENTITY,customShader:i=lA(t),clock:o,calculateStatistics:r=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Rf,this._calculateStatistics=r;let{shape:s,minBounds:a=xc.getMinBounds(s),maxBounds:c=xc.getMaxBounds(s),dimensions:d,paddingBefore:u=h.ZERO,paddingAfter:m=h.ZERO,metadataOrder:p,availableLevels:b=1}=t;this._dimensions=h.clone(d),this._paddingBefore=h.clone(u),this._paddingAfter=h.clone(m),this._inputDimensions=$Ut(d,u,m,p),this._availableLevels=b,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=P.clone(n),this._modelMatrixOld=P.clone(this._modelMatrix),this._customShader=i??z0.DefaultCustomShader,this._customShaderCompilationEvent=new Se,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=o,this._transformPositionLocalToWorld=new P,this._transformPositionWorldToLocal=new P,this._transformPlaneLocalToView=new P,this._transformDirectionWorldToLocal=new q,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new xf,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let f=xc.getShapeConstructor(s);this._shape=new f,tNe(this),this._shapeVisible=nNe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new k,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new k,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new P,transformDirectionViewToLocal:new q,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new ce,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new ce,clippingPlanesTexture:void 0,clippingPlanesMatrix:new P,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new U},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,_=this._uniformMap;for(let S in y)if(y.hasOwnProperty(S)){let Z=`u_${S}`;_[Z]=function(){return y[S]}}e5t(this,this._shape),this.tileLoad=new Se,this.tileVisible=new Se,this.tileFailed=new Se,this.tileUnload=new Se,this.loadProgress=new Se,this.allTilesLoaded=new Se,this.initialTilesLoaded=new Se}function $Ut(e,t,n,i){let o=h.add(e,t,new h);if(h.add(o,n,o),i===P0.Y_UP){let r=o.y;o.y=o.z,o.z=r}return o}function e5t(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:o}=t;for(let r in i)if(i.hasOwnProperty(r)){let s=`u_${r}`;n[s]=function(){return i[r]}}e._shapeDefinesOld=$e(o,!0)}Object.defineProperties(z0.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=P.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}},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=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];if(l(e))this._customShader=e;else{let o=lA(this._provider);this._customShader=o??z0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var t5t=new ce,n5t=new ce,i5t=new P,o5t=new P,r5t=new h,s5t=new ce;z0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){h5t(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=tNe(this),r=m5t(this,e);if((o||r)&&(this._shapeVisible=nNe(this),Z5t(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=R5t(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,o,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&v5t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),C5t(this,e)&&(this._shaderDirty=!0);let u=a.leafNodeTexture;l(u)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=k.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(Vk(this,i),this._shaderDirty=!1);let m=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,b=A5t(p,m,n5t);if(b.x===1||b.y===1||b.z===-1||b.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ce.clone(b,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,_=P.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=P.transpose(_,this._transformPlaneLocalToView);let S=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=q.multiply(this._transformDirectionWorldToLocal,S,n.transformDirectionViewToLocal),n.cameraPositionLocal=P.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=q.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let Z=l5t(this,n.cameraPositionLocal,s5t);n.cameraTileCoordinates=ce.fromElements(Math.floor(Z.x),Math.floor(Z.y),Math.floor(Z.z),Z.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(Z.x-Math.floor(Z.x),Z.y-Math.floor(Z.y),Z.z-Math.floor(Z.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,a5t(this),c5t(this,e);let R=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;R.boundingVolume=this._shape.boundingSphere,e.commandList.push(R)};function a5t(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function c5t(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function l5t(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,r5t),o=e._availableLevels,r=2**(o-1);return ce.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var d5t=new h,ace=new h,u5t=new pe;function m5t(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function h5t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=U.clone(e._pickId.color,i.pickColor);let o=t.keyframeCount??1;e._traversal=new kU(e,n,o),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,S5t(e._traversal,i)}function tNe(e){return UU(e,"_modelMatrix","_modelMatrixOld")+UU(e,"_minBounds","_minBoundsOld")+UU(e,"_maxBounds","_maxBoundsOld")+UU(e,"_minClippingBounds","_minClippingBoundsOld")+UU(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function UU(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var f5t=new h,p5t=new h,b5t=new h,g5t=new h,y5t=new P,x5t=new P;function nNe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,f5t),o=h.clone(e._maxBounds,p5t),r=h.clone(e._minClippingBounds,b5t),s=h.clone(e._maxClippingBounds,g5t),a=P.clone(e._modelMatrix,y5t);if(e.shape===xc.ELLIPSOID)i.z=_o.getHeight(e._minBounds.z,t,n),o.z=_o.getHeight(e._maxBounds.z,t,n),r.z=_o.getHeight(e._minClippingBounds.z,t,n),s.z=_o.getHeight(e._maxClippingBounds.z,t,n);else{let f=h.fromElements(1,1,t,d5t);P.multiplyByScale(a,f,a),P.multiplyByTranslation(a,_5t(e),a)}let c=e._provider,d=c.shapeTransform??P.IDENTITY,u=c.globalTransform??P.IDENTITY,m=P.multiplyTransformation(u,a,x5t);P.multiplyTransformation(m,d,m);let p=e._shape;return p.update(m,i,o,r,s)?(e._transformPositionLocalToWorld=P.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=P.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=P.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var T5t=new h;function _5t(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=P.IDENTITY,globalTransform:o=P.IDENTITY}=e._provider,r=P.getTranslation(i,ace),s=P.multiplyByPoint(e._modelMatrix,r,ace),a=P.multiplyByPoint(o,s,ace),d=ne.WGS84.cartesianToCartographic(a,u5t),u=0;l(d)&&(u=d.height);let m=_o.getHeight(u,t,n);return h.fromElements(0,0,(m-u)/t,T5t)}function S5t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=k.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function Z5t(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=$e(t,!0)),n}function R5t(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 C5t(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=P.transpose(P.multiplyTransformation(P.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}z0.prototype.isDestroyed=function(){return!1};z0.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 eNe=new Array(new ce(-1,-1,-1,1),new ce(1,-1,-1,1),new ce(-1,1,-1,1),new ce(1,1,-1,1),new ce(-1,-1,1,1),new ce(1,-1,1,1),new ce(-1,1,1,1),new ce(1,1,1,1)),V5t=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),E5t=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function A5t(e,t,n){let i=P.fromRotationTranslation(e.halfAxes,e.center,i5t),o=P.multiply(t,i,o5t),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=E5t,m=eNe.length;for(d=0;d<m;d++)P.multiplyByVector(o,eNe[d],u[d]);for(d=0;d<m;d++){let p=u[d];if(p.z>=-p.w){let b=p.x/p.w,f=p.y/p.w;r=Math.min(r,b),s=Math.max(s,b),a=Math.min(a,f),c=Math.max(c,f)}else for(let b=0;b<3;b++){let f=V5t[d*3+b],y=u[f];if(y.z>=-y.w){let _=p.z+p.w,S=y.z+y.w,Z=_/(_-S),R=ce.lerp(p,y,Z,t5t),C=R.x/R.w,E=R.y/R.w;r=Math.min(r,C),s=Math.max(s,C),a=Math.min(a,E),c=Math.max(c,E)}}}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=ce.fromElements(r,a,s,c,n),n}var cce=3e7,G5t=new h(cce,0,0),L5t=new h(0,cce,0),W5t=new h(0,0,cce);function v5t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,m){i.add({positions:[c,d],width:m,material:eo.fromType("Color",{color:u})})}function r(c,d,u){let m=c.computeCorners();o(m[0],m[1],d,u),o(m[2],m[3],d,u),o(m[4],m[5],d,u),o(m[6],m[7],d,u),o(m[0],m[2],d,u),o(m[4],m[6],d,u),o(m[1],m[3],d,u),o(m[5],m[7],d,u),o(m[0],m[4],d,u),o(m[2],m[6],d,u),o(m[1],m[5],d,u),o(m[3],m[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,m=Math.max(1,5/Math.pow(2,d)),b=[U.RED,U.LIME,U.BLUE][d%3];if(r(c.orientedBoundingBox,b,m),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,U.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,G5t,U.RED,a),o(h.ZERO,L5t,U.LIME,a),o(h.ZERO,W5t,U.BLUE,a),i.update(t)}z0.DefaultCustomShader=new I0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +{ + vec3 voxelNormal = fsInput.attributes.normalEC; + float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); + float lighting = 0.5 + 0.5 * diffuse; + material.diffuse = vec3(lighting); + material.alpha = 1.0; +}`});function iNe(){this.shape=xc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[St.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}iNe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new iR({metadata:[new Float32Array(1)]});return Promise.resolve(n)};z0.DefaultProvider=new iNe;var NT=z0;var RJ=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ti(e){e=e??B.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof rM;if(o)this._context=e.contextOptions.createSceneContext(t);else{let d=$e(e.contextOptions);this._context=new wZ(t,d)}let r=this._context,s=l(n);s||(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=qn(),this._jobScheduler=new I9,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new vx(r,new kk(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new qw(r),this._ellipsoid=e.ellipsoid??ne.default,this._globe=void 0,this._globeTranslucencyState=new R9,this._primitives=new xl({countReferences:o}),this._groundPrimitives=new xl({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Ti.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new vR,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Qk(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new U,stencil:0,owner:this}),this._depthClearCommand=new ui({depth:1,owner:this}),this._stencilClearCommand=new ui({stencil:0}),this._classificationStencilClearCommand=new ui({stencil:0,renderState:ze.fromCache({stencilMask:Jt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new EU(this),this._preUpdate=new Se,this._postUpdate=new Se,this._renderError=new Se,this._preRender=new Se,this._postRender=new Se,this._controllerHost=new CU,this._minimumDisableDepthTestDistance=0,this._debugInspector=new Bk,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Se,this.morphComplete=new Se,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=U.clone(U.BLACK),this._mode=se.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ki(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 nS,this.fog=new o9,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(Io.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Io(this),this.shadowMap=new uy({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=U.clone(U.WHITE),this._actualInvertClassificationColor=U.clone(this._invertClassificationColor),this._invertClassification=new CA,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new RU,this._brdfLutGenerator=new rk,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new LU(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??fd.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Hc.requestCompletedEvent.addEventListener(RJ(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(RJ(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new nt(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new Io(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Io(this),this.preloadFlightCullingVolume=void 0,this._picking=new tU(this),this._defaultView=new VR(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 Kg,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,lNe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}Ti.defaultLogDepthBuffer=!0;function F5t(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(RJ(e))),n.push(t.terrainProviderChanged.addEventListener(RJ(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ti.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 kt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return kt.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 Qh.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,F5t(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}},controllerHost:{get:function(){return this._controllerHost}},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}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},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===se.SCENE2D?this.morphTo2D(0):e===se.SCENE3D?this.morphTo3D(0):e===se.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 Io(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new qk(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,kt.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}}});Ti.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 I5t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function oNe(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)),l(t.snapId)&&i.passes.snap&&(c.snapping=rp.createSnapDerivedCommand(e,t,o,c.snapping)),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=uy.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Le.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))}Ti.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),m=l(t.originalCommand),p=o&&!d,b=c&&!u,f=(!o||!c)&&!m,y=n.pickingMetadata&&I5t(e,n),_=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||b||f||y||_,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:S,shadowMaps:Z}=i;S&&e.castShadows&&(t.shadows=uy.createCastDerivedCommand(Z,e,s,r,t.shadows)),(d||p)&&(t.logDepth=rp.createLogDepthCommand(e,r,t.logDepth),oNe(this,t.logDepth.command,s)),(m||f)&&oNe(this,e,s)};var P5t=new _h({pass:lr.RENDER}),lce=new _h({pass:lr.PRELOAD}),dce=new _h({pass:lr.PRELOAD_FLIGHT}),X5t=new _h({pass:lr.REQUEST_RENDER_MODE_DEFER_CHECK}),rNe=new de,uce;function N5t(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return rNe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,uce=QM.fromBoundingSphere(rNe,e.camera.positionWC,uce),uce}Ti.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function lNe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}Ti.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=N5t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof yn||this.camera.frustum instanceof bs),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=U.clone(this.invertClassificationColor,this._actualInvertClassificationColor),CA.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};Ti.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===qt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var ZJ=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ZJ=P.inverseTransformation(ZJ,ZJ);function Y5t(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==se.SCENE3D){a=P.multiplyByPoint(ZJ,a,a);let f=o.mapProjection,y=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(y)}let c,d,{radius:u}=s;l(u)?(c=Ha.createGeometry(new Ha({radii:new h(u,u,u),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromTranslation(a)):(c=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromRotationTranslation(s.halfAxes,a,new P)),t._debugVolume=new In({geometryInstances:new Yt({geometry:zn.toWireframe(c),modelMatrix:d,attributes:{color:new $t(1,0,0,1)}}),appearance:new Tn({flat:!0,translucent:!1}),asynchronous:!1});let m=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=rp.createLogDepthCommand(e,r).command);let b;l(i)&&(b=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(b)&&(n.framebuffer=b),o.commandList=m}function gd(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Y5t(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.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(r,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n));return}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 sNe(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 dNe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var w5t=new h;function aNe(e,t){let n=h.subtract(e,t,w5t),i=Math.max(0,h.magnitude(n));return i*i}function M5t(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return aNe(o.center,n)-aNe(i.center,n)}function k5t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function U5t(e,t,n,i,o){v0(i,dNe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function D5t(e,t,n,i,o){v0(i,k5t,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function O5t(e,t,n){e.context.uniformState.updatePass(Le.VOXELS);let i=n.commands[Le.VOXELS];i.length=n.indices[Le.VOXELS],v0(i,dNe,e.camera.positionWC);for(let o=0;o<i.length;++o)gd(i[o],e,t)}function B5t(e,t,n){e.context.uniformState.updatePass(Le.GAUSSIAN_SPLATS);let i=n.commands[Le.GAUSSIAN_SPLATS];i.length=n.indices[Le.GAUSSIAN_SPLATS],v0(i,M5t,e.camera.positionWC);for(let o=0;o<i.length;++o)gd(i[o],e,t)}var z5t=new qi,H5t=new hd,K5t=new yn,J5t=new bs;function j5t(e){let{frustum:t}=e;return l(t.fov)?t.clone(z5t):l(t.infiniteProjectionMatrix)?t.clone(H5t):l(t.width)?t.clone(K5t):t.clone(J5t)}function Q5t(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?U5t:D5t}function q5t(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=Q5t(e);o.uniformState.updatePass(Le.TRANSLUCENT);let u=n.commands[Le.TRANSLUCENT];u.length=n.indices[Le.TRANSLUCENT],d(e,gd,t,u,c)}function $5t(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Le.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Le.TRANSLUCENT];i.executeTranslucentCommands(e,gd,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,gd,t,n)}function eDt(e,t,n){e.context.uniformState.updatePass(Le.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Le.CESIUM_3D_TILE_EDGES],r=n.indices[Le.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new U(0,0,0,0)).execute(e.context,t);for(let s=0;s<r;++s)gd(o[s],e,t);t.framebuffer=i}function tDt(e,t,n){let{context:i}=e,{uniformState:o}=i;o.updatePass(Le.CESIUM_3D_TILE_PLANAR_FILL_ID),o.planarFillIdTexture=i.defaultTexture;let r=e._view,s=r&&r.planarFillIdFramebuffer,a=n.commands[Le.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Le.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let d=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new U(0,0,0,0)).execute(i,t);for(let m=0;m<c;++m)gd(a[m],e,t);t.framebuffer=d}}function nDt(e,t,n){e.context.uniformState.updatePass(Le.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Le.CESIUM_3D_TILE_EDGES_DIRECT],o=n.indices[Le.CESIUM_3D_TILE_EDGES_DIRECT];for(let r=0;r<o;++r)gd(i[r],e,t)}function hce(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n),r.planarFillIdTexture=i.defaultTexture;let s=j5t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||iDt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:m,useGlobeDepthFramebuffer:p,useInvertClassification:b,usePostProcessSelected:f}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:_,sceneFramebuffer:S,frustumCommandsList:Z}=e._view,R=Z.length,C=e._globeTranslucencyState,E=e._depthClearCommand,A=e._stencilClearCommand,L=e._classificationStencilClearCommand,F=e._depthPlane,I=n.position.z;function N(V,G){r.updatePass(G);let v=V.commands[G],X=V.indices[G];for(let Y=0;Y<X;++Y)gd(v[Y],e,t);return X}function g(V,G){r.updatePass(G);let v=V.commands[G],X=V.indices[G];for(let Y=0;Y<X;++Y)sNe(v[Y],e,t)}for(let V=0;V<R;++V){let G=R-V-1,v=Z[G];e.mode===se.SCENE2D?(n.position.z=I-v.near+1,s.far=Math.max(1,v.far-v.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=G!==0?v.near*e.opaqueFrustumNearOffset:v.near,s.far=v.far,r.updateFrustum(s)),E.execute(i,t),i.stencilBuffer&&A.execute(i,t),C.translucent?(r.updatePass(Le.GLOBE),C.executeGlobeCommands(v,gd,_,e,t)):N(v,Le.GLOBE),p&&y.executeCopyDepth(i,t),u||(C.translucent?(r.updatePass(Le.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(v,gd,_,e,t)):N(v,Le.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),m&&F.execute(i,t));let X;if(eDt(e,t,v),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let D=e._view.edgeFramebuffer.colorTexture;l(D)?e.context.uniformState.edgeColorTexture=D:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let w=e._view.edgeFramebuffer.idTexture;l(w)?e.context.uniformState.edgeIdTexture=w:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let O=e._view.edgeFramebuffer.depthTexture;l(O)?e.context.uniformState.edgeDepthTexture=O:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(tDt(e,t,v),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let D=e._view.planarFillIdFramebuffer.idTexture;r.planarFillIdTexture=l(D)?D:i.defaultTexture}else r.planarFillIdTexture=i.defaultTexture;if(!b||c||u)X=N(v,Le.CESIUM_3D_TILE),X>0&&(p&&(y.prepareColorTextures(i,d),y.executeUpdateDepth(i,t,y.depthStencilTexture)),u||(X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let D=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N(v,Le.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=D,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),X>0&&i.stencilBuffer&&L.execute(i,t),X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION)}if(X>0&&i.stencilBuffer&&A.execute(i,t),O5t(e,t,v),N(v,Le.OPAQUE),nDt(e,t,v),B5t(e,t,v),G!==0&&e.mode!==se.SCENE2D&&(s.near=v.near,r.updateFrustum(s)),q5t(e,t,v),$5t(e,t,v),i.depthTexture&&e.useDepthPicking&&(p||u)){let D=e._picking.getPickDepth(e,G);D.update(i,y.depthStencilTexture),D.executeCopyDepth(i,t)}if(c||!f)continue;let Y=t.framebuffer;t.framebuffer=S.getIdFramebuffer(),s.near=G!==0?v.near*e.opaqueFrustumNearOffset:v.near,s.far=v.far,r.updateFrustum(s),C.translucent?(r.updatePass(Le.GLOBE),C.executeGlobeCommands(v,sNe,_,e,t)):g(v,Le.GLOBE),d&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),d&&m&&F.execute(i,t),g(v,Le.CESIUM_3D_TILE),g(v,Le.OPAQUE),g(v,Le.TRANSLUCENT),t.framebuffer=Y}}function iDt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Le.ENVIRONMENT),l(i.skyBoxCommand)&&gd(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&gd(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=o.globeDepth.framebuffer:i.usePostProcess?s=o.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let r=e.frameState.panoramaCommandList;for(let s=r.length-1;s>=0;s--){let a=r[s];l(a.shaderProgram)?gd(r[s],e,t):r.splice(s,1)}}function uNe(e){e.context.uniformState.updatePass(Le.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 oDt(e,t){e.context.uniformState.updatePass(Le.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function rDt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Le.GLOBE,Le.CESIUM_3D_TILE,Le.OPAQUE,Le.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 m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(p,d))r[m].commandList.push(d),u=!0;else if(u)break}}}}function mNe(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;rDt(e,n,c);for(let u=0;u<d.length;++u){let m=c.passes[u],{camera:p,commandList:b}=m;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<b.length;++f){let y=b[f];s.updatePass(y.pass);let _=y.derivedCommands.shadows.castCommands[a];gd(_,e,m.passState)}}}}var sDt=new h;Ti.prototype.updateAndExecuteCommands=function(e,t){TDt(this,e,t),this._environmentState.useWebVR?aDt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===fd.ROTATE?YT(!0,this,e):bDt(this,e)};function aDt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;fNe(e),n.createPotentiallyVisibleSet(e),uNe(e),r||mNe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Io.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*(e.focalLength??5),u=e.eyeSeparation??d/30,m=h.multiplyByScalar(a.right,u*.5,sDt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;h.add(a.position,m,i.position),i.frustum.xOffset=p,hce(e,t),s.x=s.width,h.subtract(a.position,m,i.position),i.frustum.xOffset=-p,hce(e,t),Io.clone(a,i)}var cDt=new pe(Math.PI,W.PI_OVER_TWO),lDt=new h,dDt=new h,uDt=new P,mDt=new P,hDt=new h,fDt=new h,pDt=new nt;function bDt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=nt.clone(r,pDt);t.viewport=s;let a=cDt,c=lDt;e.mapProjection.project(a,c);let u=h.clone(i.position,dDt),m=P.clone(i.transform,mDt),p=i.frustum.clone();i._setTransform(P.IDENTITY);let b=P.computeViewportTransformation(s,0,1,uDt),f=i.frustum.projectionMatrix,y=i.positionWC.y,_=h.fromElements(W.sign(y)*c.x-y,0,-i.positionWC.x,hDt),S=_t.pointToGLWindowCoordinates(f,b,_,fDt);S.x=Math.floor(S.x);let Z=s.x,R=s.width;if(y===0||S.x<=Z||S.x>=Z+R)YT(!0,e,t);else if(Math.abs(Z+R*.5-S.x)<1)s.width=S.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),YT(!0,e,t),s.x=S.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),YT(!1,e,t);else if(S.x>Z+R*.5){s.width=S.x-Z;let C=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),YT(!0,e,t),s.x=S.x,s.width=Z+R-S.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=C-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),YT(!1,e,t)}else{s.x=S.x,s.width=Z+R-S.x;let C=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),YT(!0,e,t),s.x=Z,s.width=S.x-Z,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=C-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),YT(!1,e,t)}i._setTransform(m),h.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function YT(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),fNe(t),i.createPotentiallyVisibleSet(t),e&&(uNe(t),o||mNe(t)),hce(t,n)}var cNe=new $s;function hNe(e,t,n){if(!e.show)return;let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);if(r instanceof xl){hNe(r,t,n);continue}r.show&&rg.isSupported(r)&&fs(r.heightReference)&&t.markForFrame(r,n,r.heightReference)}}function gDt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;hNe(e._primitives,n,i)}Ti.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!==se.SCENE2D&&t.camera.frustum instanceof yn||!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(vb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let S=r.dynamicLighting;s.setDynamicLighting(S),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===se.SCENE2D);(n.useDepthPlane=d&&this.mode===se.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==se.SCENE2D&&!o;let m=e.mode===se.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,b=cNe.planes;for(let _=0;_<5;++_)b[_]=p.planes[_];p=cNe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,m),n.isMoonVisible=this.isVisible(p,n.moonCommand,m);let f=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(f)&&y?.url!==f?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new Qh(f)):!l(f)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),gDt(this,e)};function yDt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new X0({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 xDt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===se.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 fNe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,yDt(e),xDt(e),e._globe&&e._globe.render(t)}function TDt(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,s.globeDepth.snapping=a.snap);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new NU: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;U.clone(n,u.color),u.execute(i,t);let m=r.useGlobeDepthFramebuffer=l(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,b=r.useOIT=!c&&l(p)&&p.isSupported();b&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,y=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);r.usePostProcessSelected=!1,y&&(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),y=r.usePostProcess=f.ready,r.usePostProcessSelected=y&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t);let _=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),_){let R;if(o.invertClassificationColor.alpha===1&&m&&(R=s.globeDepth.framebuffer),l(R)||i.depthTexture){if(e._invertClassification.previousFramebuffer=R,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&b){let C=e._invertClassification.unclassifiedCommand,E=C.derivedCommands;E.oit=p.createDerivedCommands(C,i,E.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Ti.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,m=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?m.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let b=m;a&&!s&&(b=u);let f=this.postProcessStages,y=b.getColorTexture(0),_=p.getColorTexture(0),S=(u??m).getDepthStencilTexture();f.execute(t,y,S,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function _Dt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function SDt(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function pNe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof xl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=pNe(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}Ti.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,o=this._heightQueryCache.get(i);if(o!==void 0)return o===null?void 0:o;let r=ZDt(this,e,t);return this._heightQueryCache.set(i,r===void 0?null:r),r};function ZDt(e,t,n){let i=n===He.CLAMP_TO_TERRAIN||n===He.RELATIVE_TO_TERRAIN,o=n===He.CLAMP_TO_3D_TILE||n===He.RELATIVE_TO_3D_TILE;if(!l(t))return;let r=Number.NEGATIVE_INFINITY;if(!i){let a=pNe(e.primitives,t,e);l(a)&&a>r&&(r=a)}let s=e._globe;if(!o&&l(s)&&s.show){let a=s.getHeight(t);a>r&&(r=a)}if(r>Number.NEGATIVE_INFINITY)return r}var mce=new pe;Ti.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=b=>{pe.clone(e,mce);let f;l(b)&&(f=b.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(mce.height=f,t(mce))},r=n===He.CLAMP_TO_TERRAIN||n===He.RELATIVE_TO_TERRAIN,s=n===He.CLAMP_TO_3D_TILE||n===He.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},d=b=>{if(r||b.isDestroyed()||!b.isCesium3DTileset)return;let f=b.updateHeight(e,o,i);c[b.id]=f};if(!r){let b=this.primitives.length;for(let f=0;f<b;++f){let y=this.primitives.get(f);d(y)}}let u=this.primitives.primitiveAdded.addEventListener(d),m=this.primitives.primitiveRemoved.addEventListener(b=>{b.isDestroyed()||!b.isCesium3DTileset||(l(c[b.id])&&c[b.id](),delete c[b.id])});return()=>{a=a&&a(),Object.values(c).forEach(b=>b()),c={},u(),m()}};function RDt(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===se.SCENE2D||n===se.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}Ti.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=SDt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=RDt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function CDt(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 ly({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 VDt(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 EDt(e){e.primitives.postPassesUpdate(e._frameState),Hc.update()}var ADt=new U;function GDt(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=P5t;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,ADt),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 Kg?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.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=nt.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,oDt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function PR(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function LDt(e){return e._picking.updateMostDetailedRayPicks(e)}Ti.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Q.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===se.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,vx.maximumFrameNumber,1);lNe(this,o,e),t.newFrame=!0}PR(this,VDt),this.primitives.show&&(PR(this,LDt),PR(this,WDt),PR(this,vDt),i||PR(this,FDt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),PR(this,GDt)),CDt(this,i),PR(this,EDt),_Dt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ti.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ti.prototype.requestRender=function(){this._renderRequested=!0};Ti.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};Ti.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};Ti.prototype.snap=function(e,t){return IU.snap(this,e,t)};Ti.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};Ti.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof NT))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 YU.fromKeyframeNode(o,s,c,a)};Ti.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=c9(s,t,n,i);if(!l(a))return;let c=l9(r,n,i);if(!l(c))return;let d=new z9(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};Ti.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Ti.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ti.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ti.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function WDt(e){let t=e._frameState;lce.camera=t.camera,lce.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,lce)}function vDt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;dce.camera=e.preloadFlightCamera,dce.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,dce)}function FDt(e){e.primitives.updateForPass(e._frameState,X5t)}Ti.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ti.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ti.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ti.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ti.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ti.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ti.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ti.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ti.prototype.cartesianToCanvasCoordinates=function(e,t){return fo.worldToWindowCoordinates(this,e,t)};Ti.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ti.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};Ti.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};Ti.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function IDt(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()})}Ti.prototype.setTerrain=function(e){return IDt(this,e),e};Ti.prototype.isDestroyed=function(){return!1};Ti.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 DU=Ti;var h9o=x(T(),1);function WA(e){e=e??ne.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=P.fromScale(n),this._modelMatrix=new P,this._command=new lt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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 h;let i=new h;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(WA.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});WA.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var fce=new P;WA.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==se.SCENE3D&&n!==se.MORPHING||!e.passes.render)return;let i=P.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,fce),o=P.multiplyTransformation(i,Bi.Y_UP_TO_Z_UP,fce),r=P.multiply(this._scaleMatrix,o,fce);P.clone(r,this._modelMatrix);let s=e.context,a=PDt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ha.createGeometry(new Ha({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:we.POSITION_ONLY}));u.vertexArray=Un.fromGeometry({context:s,geometry:p,attributeLocations:zn.createAttributeLocations(p),bufferUsage:Pe.STATIC_DRAW}),u.renderState=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},blending:on.ALPHA_BLEND,depthMask:!1})}let m=a|d<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let b=new Je({defines:p,sources:[rf,HE,SM]}),f=new Je({defines:p,sources:[rf,HE,_M]});this._spSkyAtmosphere=nn.fromCache({context:s,vertexShaderSource:b,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function PDt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}WA.prototype.isDestroyed=function(){return!1};WA.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 OU=WA;var x9o=x(T(),1);function XR(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new lR({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(XR.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});XR.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==se.SCENE3D&&n!==se.MORPHING)&&i.render)return this._panorama.update(e,t)};XR.prototype.isDestroyed=function(){return!1};XR.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),me(this)};function vA(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}XR.createEarthSkyBox=function(){return new XR({sources:{positiveX:vA("px"),negativeX:vA("mx"),positiveY:vA("py"),negativeY:vA("my"),positiveZ:vA("pz"),negativeZ:vA("mz")}})};var BU=XR;var Z9o=x(T(),1);function pce(e){e=e??1,this._radius=e??1}Object.defineProperties(pce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});pce.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=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var bce=pce;var V9o=x(T(),1);function zU(){}zU.prototype.evaluate=function(e,t){ge.throwInstantiationError()};zU.prototype.evaluateColor=function(e,t){ge.throwInstantiationError()};zU.prototype.getShaderFunction=function(e,t,n,i){ge.throwInstantiationError()};zU.prototype.getVariables=function(){ge.throwInstantiationError()};var gce=zU;var tUo=x(T(),1);function KU(){this.show=!0,this._drawCommand=new lt({primitiveType:Ie.TRIANGLES,boundingVolume:new de,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new de,this._boundingVolume2D=new de,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(KU.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var XDt=new k,NDt=new k,YDt=new ce,HU=new ce;KU.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===se.SCENE2D||i===se.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 C=Math.max(r,s);C=Math.pow(2,Math.ceil(Math.log(C)/Math.log(2))-2),C=Math.max(1,C);let E=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new vt({context:o,width:C,height:C,pixelFormat:Qe.RGBA,pixelDatatype:E}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let A=this,L={u_radiusTS:function(){return A._radiusTS}};this._commands.computeCommand=new Gu({fragmentShaderSource:VM,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){A._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let C={direction:0},E=new Uint8Array(8);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let A=ot.createVertexBuffer({context:o,typedArray:E,usage:Pe.STATIC_DRAW}),L=[{index:C.direction,vertexBuffer:A,componentsPerAttribute:2,normalize:!0,componentDatatype:J.UNSIGNED_BYTE}],F=ot.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});a.vertexArray=new Un({context:o,attributes:L,indexBuffer:F}),a.shaderProgram=nn.fromCache({context:o,vertexShaderSource:EM,fragmentShaderSource:CM,attributeLocations:C}),a.renderState=ze.fromCache({blending:on.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,m=this._boundingVolume2D;h.clone(c,u.center),m.center.x=d.z,m.center.y=d.x,m.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,m.radius=u.radius,i===se.SCENE3D?de.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&de.clone(m,a.boundingVolume);let p=fo.computeActualEllipsoidPosition(e,c,HU),b=h.magnitude(h.subtract(p,e.camera.position,HU)),f=o.uniformState.projection,y=YDt;y.x=0,y.y=0,y.z=-b,y.w=1;let _=P.multiplyByVector(f,y,HU),S=fo.clipToGLWindowCoordinates(t.viewport,_,XDt);y.x=W.SOLAR_RADIUS;let Z=P.multiplyByVector(f,y,HU),R=fo.clipToGLWindowCoordinates(t.viewport,Z,NDt);return this._size=k.magnitude(k.subtract(R,S,HU)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};KU.prototype.isDestroyed=function(){return!1};KU.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 JU=KU;var sUo=x(T(),1);function FA(e){this._ready=!1,this._provider=void 0,this._errorEvent=new Se,this._readyEvent=new Se,MDt(this,e)}Object.defineProperties(FA.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}}});FA.fromWorldTerrain=function(e){return new FA(BZ(e))};FA.fromWorldBathymetry=function(e){return new FA(YM(e))};function wDt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function MDt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){wDt(e._errorEvent,i)}}var jU=FA;var lUo=x(T(),1);function IA(){}IA.prototype.boundingVolume=void 0;IA.prototype.boundingSphere=void 0;IA.prototype.distanceToCamera=function(e){ge.throwInstantiationError()};IA.prototype.intersectPlane=function(e){ge.throwInstantiationError()};IA.prototype.createDebugVolume=function(e){ge.throwInstantiationError()};var yce=IA;var bUo=x(T(),1);function QU(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new to({ellipsoid:e.ellipsoid}),this._color=e.color??U.YELLOW,this._errorEvent=new Se,this._tileWidth=e.tileWidth??256,this._tileHeight=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(QU.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}}});QU.prototype.getTileCredits=function(e,t,n){};QU.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)};QU.prototype.pickFeatures=function(e,t,n,i,o){};var qU=QU;var xUo=x(T(),1);function xce(e){ge.throwInstantiationError()}xce.prototype.isReady=ge.throwInstantiationError;xce.prototype.shouldDiscardImage=ge.throwInstantiationError;var Tce=xce;var _Uo=x(T(),1),bNe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(bNe);var _ce=bNe;var wUo=x(T(),1);function YR(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.shadows=e.shadows??vn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Up(e.shading),this.style=e.style,this.frameFailed=new Se,this.frameChanged=new Se,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Xb,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(YR.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function kDt(e){return`uniform vec4 czm_pickColor; +${e}`}function UDt(e){return function(t){return It(t,{czm_pickColor:function(){return e._pickId.color}})}}function DDt(){return"czm_pickColor"}YR.prototype.makeStyleDirty=function(){this._styleDirty=!0};YR.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var ODt=new Q;function Zce(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function NR(e,t){return e._intervals.indexOf(t.start)}function BDt(e,t){let n=e._intervals,i=e._clock,o=Zce(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,ODt),a=n.indexOf(s),c=NR(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function zDt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function HDt(e,t,n){let i=Zce(e),o=NR(e,t),r=NR(e,n);return i>=0?o>=r:o<=r}function yNe(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 KDt(e,t,n){let i=NR(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?P.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Zn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,ve.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new iU({arrayBuffer:d,cull:!0,fragmentShaderLoaded:kDt,uniformMapLoaded:UDt(e),pickIdLoaded:DDt})}).catch(yNe(e,c))}return r}function JDt(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 jDt(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(xNe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Zn()-t.timestamp)/1e3;JDt(e,a)}}t.touchedFrameNumber=i.frameNumber}var QDt=new P;function qDt(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 $Dt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var eOt=new Up;function xNe(e,t,n,i){let o=e.shading??eOt,r=t.pointCloud,s=t.transform??P.IDENTITY;r.modelMatrix=P.multiplyTransformation(e.modelMatrix,s,QDt),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=qDt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=$Dt(e);try{r.update(i)}catch(a){yNe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Sce(e,t,n,i){let o=KDt(e,t,i);jDt(e,o,n,i)}function tOt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function TNe(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 nOt(e,t){let n=NR(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function gNe(e,t,n,i,o){return l(n)?n.ready?!0:(Sce(e,t,i,o),n.ready):!1}function iOt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=NR(e,n),m=NR(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],gNe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],gNe(e,s,a,i,o))return s;return t}function oOt(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 PA={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};YR.prototype.update=function(e){if(e.mode===se.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)&&oOt(this,o,s),PA.timeSinceLoad=t,PA.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,b=zDt(this);if(!l(b))return;let f=!1,y=Zce(this),_=y===0;y!==this._clockMultiplier&&(f=!0,this._clockMultiplier=y),(!l(m)||_)&&(m=b),(!l(p)||f||HDt(this,b,p))&&(p=BDt(this,b)),m=iOt(this,m,b,PA,e);let S=nOt(this,m);l(S)||(Sce(this,m,PA,e),S=this._lastRenderedFrame),l(S)&&xNe(this,S,PA,e),l(p)&&Sce(this,p,PA,e);let Z=this;l(S)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(S)&&S!==this._lastRenderedFrame&&Z.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return Z.frameChanged.raiseEvent(Z),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=S;let R=this._totalMemoryUsageInBytes,C=this.maximumMemoryUsage*1024*1024;R>C&&TNe(this,tOt(e));let A=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&A>0&&c.update(e,u,a,this.boundingSphere)};YR.prototype.isDestroyed=function(){return!1};YR.prototype.destroy=function(){return TNe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var XA=YR;var QUo=x(T(),1);function CJ(e,t){this.show=!0,l(e)||(e=new nt),this.rectangle=nt.clone(e),l(t)||(t=eo.fromType(eo.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}CJ.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!nt.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:on.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 Je({sources:[this._material.shaderSource,AM]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Le.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};CJ.prototype.isDestroyed=function(){return!1};CJ.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var Rce=CJ;var e5o=x(T(),1);var Cce=class{constructor(){mt(this,"globalTransform");mt(this,"shapeTransform");mt(this,"shape");mt(this,"minBounds");mt(this,"maxBounds");mt(this,"dimensions");mt(this,"paddingBefore");mt(this,"paddingAfter");mt(this,"names");mt(this,"types");mt(this,"componentTypes");mt(this,"minimumValues");mt(this,"maximumValues");mt(this,"maximumTileCount");mt(this,"availableLevels");mt(this,"keyframeCount");mt(this,"timeIntervalCollection");ge.throwInstantiationError()}requestData(t){ge.throwInstantiationError()}},Vce=Cce;var o5o=x(T(),1);function gy(){ge.throwInstantiationError()}Object.defineProperties(gy.prototype,{orientedBoundingBox:{get:ge.throwInstantiationError},boundingSphere:{get:ge.throwInstantiationError},boundTransform:{get:ge.throwInstantiationError},shapeTransform:{get:ge.throwInstantiationError},shaderUniforms:{get:ge.throwInstantiationError},shaderDefines:{get:ge.throwInstantiationError},shaderMaximumIntersectionsLength:{get:ge.throwInstantiationError}});gy.prototype.update=ge.throwInstantiationError;gy.prototype.updateViewTransforms=ge.throwInstantiationError;gy.prototype.convertLocalToShapeUvSpace=ge.throwInstantiationError;gy.prototype.computeOrientedBoundingBoxForTile=ge.throwInstantiationError;gy.prototype.computeOrientedBoundingBoxForSample=ge.throwInstantiationError;gy.DefaultMinBounds=ge.throwInstantiationError;gy.DefaultMaxBounds=ge.throwInstantiationError;var Ece=gy;var k5o=x(T(),1);function ZNe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function rOt(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 RNe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function CNe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=RNe(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 VNe(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 Ho(e,t){e=Nn(e),t=t??B.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=fn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=fn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(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)?Nn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Nn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,m=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=m,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 Se,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Lf,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),CNe(this);try{let p=t.ellipsoid??ne.default,b=new DU({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=b,b.camera.constrainedAxis=h.UNIT_Z,RNe(this),VNe(this);let f=t.globe;l(f)||(f=new _9(p)),f!==!1&&(b.globe=f,b.globe.shadows=t.terrainShadows??vn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ne.WGS84.equals(p)&&(y=BU.createEarthSkyBox()),y!==!1&&(b.skyBox=y,b.sun=new JU,ne.WGS84.equals(p)&&(b.moon=new w9));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new OU(p),_.show=t.globe!==!1&&f.show),_!==!1&&(b.skyAtmosphere=_);let S=t.baseLayer;t.globe!==!1&&S!==!1&&(l(S)||(S=Zs.fromWorldImagery()),b.imageryLayers.add(S)),l(t.terrainProvider)&&t.globe!==!1&&(b.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&b.setTerrain(t.terrain),this._screenSpaceEventHandler=new la(i),l(t.sceneMode)&&(t.sceneMode===se.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===se.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let Z=this;this._onRenderError=function(F,I){Z._useDefaultRenderLoop=!1,Z._renderLoopRunning=!1,Z._showRenderLoopErrors&&Z.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,I)},b.renderError.addEventListener(this._onRenderError);let R=t.dataSources,C=!1;l(R)||(R=new nY,C=!0);let E=new HY({scene:b,dataSourceCollection:R}),A=new Hr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=R,this._destroyDataSourceCollection=C,this._dataSourceDisplay=E,this._eventHelper=A,this._canAnimateUpdateCallback=this._updateCanAnimate,A.add(this._clock.onTick,Ho.prototype._onTick,this),A.add(b.morphStart,Ho.prototype._clearTrackedObject,this),A.add(R.dataSourceAdded,Ho.prototype._onDataSourceAdded,this),A.add(R.dataSourceRemoved,Ho.prototype._onDataSourceRemoved,this),A.add(b.postRender,Ho.prototype._postRender,this);let L=R.length;for(let F=0;F<L;F++)this._dataSourceAdded(R,R.get(F));this._dataSourceAdded(void 0,E.defaultDataSource),A.add(R.dataSourceAdded,Ho.prototype._dataSourceAdded,this),A.add(R.dataSourceRemoved,Ho.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(Ho.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&&rOt(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,Ace(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===se.COLUMBUS_VIEW||n===se.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===se.COLUMBUS_VIEW||n===se.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(P.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,ZNe(this.clock,e))}}});Ho.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 b=document.createElement("div");if(b.className="cesium-widget-errorPanel-message",a.appendChild(b),u){let f=Op(n);d||(typeof n=="string"&&(n=new Error(n)),t=Op({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e} +${t} +${f}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),y.appendChild(_),y.onclick=function(S){y.removeChild(_),y.appendChild(document.createTextNode(f)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}b.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);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)},m.appendChild(p),i.appendChild(o)};Ho.prototype.isDestroyed=function(){return!1};Ho.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)};Ho.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,CNe(this),VNe(this),this._scene.requestRender())};Ho.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Ho.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ho.prototype._onEntityCollectionChanged,this)};Ho.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ho.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Ho.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var sOt=new de;Ho.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)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??sOt)===Wt.DONE&&i.update(t)}};Ho.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)}};Ho.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ho.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&ZNe(this.clock,e)};Ho.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ho.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ho.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}};Ho.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Ho.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Ho.prototype.zoomTo=function(e,t){return ENe(this,e,{offset:t},!1)};Ho.prototype.flyTo=function(e,t){return ENe(this,e,t,!0)};function ENe(e,t,n,i){Ace(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 Zs){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 cR(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof zr||r instanceof XA||r instanceof NT||r instanceof na){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 $U(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Ace(e){let t=e._zoomPromise;l(t)&&($U(e),e._completeZoom(!1))}Ho.prototype._postRender=function(){aOt(this),cOt(this)};var _Ne=new de;function aOt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===se.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new dh(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(u,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(P.IDENTITY),e._completeZoom(!0)),$U(e)}if(t instanceof XA){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof zr||t instanceof NT){s(t.boundingSphere);return}if(t instanceof na){s(t.boundingVolume);return}if(t instanceof pe){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)),$U(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,_Ne);if(p===Wt.PENDING)return;p!==Wt.FAILED&&c.push(de.clone(_Ne))}if(c.length===0){Ace(e);return}e.trackedEntity=void 0;let d=de.fromBoundingSpheres(c);e._zoomIsFlight?($U(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(P.IDENTITY),$U(e),e._completeZoom(!0))}var SNe=new de;function cOt(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,SNe);if(r===Wt.PENDING)return;let s=o.mode;(s===se.COLUMBUS_VIEW||s===se.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===se.COLUMBUS_VIEW||s===se.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==Wt.FAILED?SNe:void 0;e._entityView=new JY(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var e5=Ho;var D5o=x(T(),1),Gce=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -10892,49 +12729,49 @@ 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 fpo=_(T(),1);function l1t(e){e=e??z.EMPTY_OBJECT;let t=c(e.typedArray),n=c(e.url);if(t===n)throw new L("exactly one of options.typedArray, options.url must be defined");if(t&&(!c(e.width)||!c(e.height)))throw new L("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ke.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let i=e.url;typeof i=="string"&&(i=Ge.createIfNeeded(i)),this.resource=i;let r=e.repeat??!0?xn.REPEAT:xn.CLAMP_TO_EDGE;this.sampler=new en({wrapS:r,wrapT:r,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var U6=l1t;var ppo=_(T(),1),d1t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},O6=Object.freeze(d1t);var ypo=_(T(),1),u1t={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},D6=Object.freeze(u1t);var _po=_(T(),1);function m1t(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: ${qh(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 B6=m1t;globalThis.CESIUM_VERSION="1.129";var lMo=_(T(),1);var v2o=_(T(),1);var I2o=_(T(),1);var S2o=_(T(),1),lM;typeof ko<"u"&&(lM=ko);(function(){/*! +`;var z5o=x(T(),1);var Lce=class{get enabled(){return ge.throwInstantiationError()}set enabled(t){ge.throwInstantiationError()}connectedCallback(t){ge.throwInstantiationError()}disconnectedCallback(t){ge.throwInstantiationError()}update(t,n){ge.throwInstantiationError()}firstUpdate(t,n){ge.throwInstantiationError()}},Wce=Lce;var eDo=x(T(),1);var ANe=new h,lOt=new cn(h.UNIT_X,0),dOt=new gn,uOt=new k(1,1,1);function mp(e,t,n,i=uOt){let{camera:o,ellipsoid:r}=e,s=r.scaleToGeodeticSurface(o.positionWC,ANe);if(!l(s))return;let a=h.magnitude(o.positionWC),c=h.magnitude(s),d=a<=c,u=r.geodeticSurfaceNormal(o.positionWC,ANe),m=h.dot(u,o.directionWC),p=m>0;if(d||p){let b=cn.fromPointNormal(o.positionWC,u,lOt),{clientHeight:f}=e.canvas,y=i.y*f/(2*Math.tan(o.frustum.fovy*.5));b.distance-=m*y;let _=o.getPickRay(t,dOt);return yi.rayPlane(_,b,n)}return o.pickEllipsoid(t,r,n)}var wDo=x(T(),1);var TDo=x(T(),1);var aDo=x(T(),1);var nDo=x(T(),1),GNe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(GNe);var qa=GNe;function mOt(e){if(e===qa.LEFT)return mn.LEFT_DOWN;if(e===qa.MIDDLE)return mn.MIDDLE_DOWN;if(e===qa.RIGHT)return mn.RIGHT_DOWN}function hOt(e){if(e===qa.LEFT)return mn.LEFT_UP;if(e===qa.MIDDLE)return mn.MIDDLE_UP;if(e===qa.RIGHT)return mn.RIGHT_UP}var vce=class{static registerDragInputBindings(t,n,i){let o=new Set,r={isDragging:!1};for(let s of n){r.isDragging=!1;let a=mOt(s.button),c=hOt(s.button);l(a)&&t.setInputAction((...d)=>{r.isDragging=!0,l(i.start)&&i.start(...d)},a,s.modifier),l(c)&&(t.setInputAction((...d)=>{r.isDragging&&(r.isDragging=!1,l(i.end)&&i.end(...d))},c,s.modifier),t.setInputAction((...d)=>{r.isDragging&&(r.isDragging=!1,l(i.end)&&i.end(...d))},c)),o.add(s.modifier)}for(let s of o)t.setInputAction((...a)=>{r.isDragging&&l(i.change)&&i.change(...a)},mn.MOUSE_MOVE,s);return r}},hp=vce;var Fce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=mp,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new la(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(Zn()-this._lastUpdateTime)*Mn.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:o,canvas:r}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let C=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=C,this._panVelocity.y*=C,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:d}=r;if(n===0||c===0||d===0||Math.abs(s)<=W.EPSILON3&&Math.abs(a)<=W.EPSILON3){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0;return}let u=this._panPosition,m=this.pickWorldPosition(t,u,this._ellipsoidSurfacePosition);l(m)||(m=o.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let b=h.normalize(m,this._panDirectionY),f=h.distance(i.positionWC,m),{drawingBufferWidth:y,drawingBufferHeight:_,pixelRatio:S}=t,Z=i.frustum.getPixelDimensions(y,_,f,S,this._pixelSize),R=this.maximumMovementRatio*Math.max(c,d);s=W.clamp(s,-R,R),this._panVelocity.x=s/n,s*=this.panSpeed*Z.x,a=W.clamp(a,-R,R),this._panVelocity.y=a/n,a*=this.panSpeed*Z.y,i.move(p,s),i.move(b,a),this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},t5=Fce;var FDo=x(T(),1);var Ice=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=mp,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new la(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(Zn()-this._lastUpdateTime)*Mn.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,o=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let A=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=A,this._panVelocity.y*=A,i=this._panVelocity.x*n,o=this._panVelocity.y*n}let{camera:r,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:d}=a;if(n===0||c===0||d===0||Math.abs(i)<=W.EPSILON3&&Math.abs(o)<=W.EPSILON3){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0;return}let u=this._panPosition,m=this.pickWorldPosition(t,u,this._ellipsoidSurfacePosition);l(m)||(m=s.scaleToGeodeticSurface(r.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(m,this._ellipsoidNormal),b=h.clone(r.rightWC,this._panDirectionX);b=h.normalize(b,this._panDirectionX);let f=h.clone(r.upWC,this._panDirectionY),y=Math.abs(h.dot(p,r.directionWC));W.lessThan(y,1,W.EPSILON6)&&(f=h.cross(p,b,this._panDirectionY)),f=h.normalize(f,this._panDirectionY);let _=h.distance(r.positionWC,m),{drawingBufferWidth:S,drawingBufferHeight:Z,pixelRatio:R}=t,C=r.frustum.getPixelDimensions(S,Z,_,R,this._pixelSize),E=this.maximumMovementRatio*Math.max(c,d);i=W.clamp(i,-E,E),this._panVelocity.x=i/n,i*=this.panSpeed*C.x,o=W.clamp(o,-E,E),this._panVelocity.y=o/n,o*=this.panSpeed*C.y,r.move(b,i),r.move(f,o),this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},n5=Ice;var Pce=class{constructor(){this._elevatorController=new t5,this._mapController=new n5,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=W.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),o=Math.abs(h.angleBetween(i,n.directionWC));(o<this.angleThreshold&&o>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},Xce=Pce;var oOo=x(T(),1);var Nce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT,modifier:ir.CTRL}),Object.freeze({button:qa.RIGHT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.pickWorldPosition=mp,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=W.PI,this.minimumTiltVelocity=W.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=W.TWO_PI,this.minimumOrbitVelocity=W.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Ne,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new P,this._orbitTargetEast=new h,this._orbitQuaternion=new Ne,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new la(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,o,r,s=ne.default){let a=_t.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=P.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),d=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(o+=this.orbitVelocity*r),o===0)return;let u=d+o,m=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=W.smoothDamp(d,u,this.orbitVelocity,r,m,p,this._orbitDampenedResults);let b=this.orbitAngle-d,f=q.fromQuaternion(Ne.fromAxisAngle(i,-b,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),_=h.dot(y,t.directionWC),S=h.multiplyByScalar(t.directionWC,_,this._orbitLookOffset),Z=h.subtract(y,S,this._orbitLookOffset),R=q.multiplyByVector(f,y,this._orbitOffset),C=q.multiplyByVector(f,Z,this._orbitLookOffset);h.add(n,R,t.position);let E=h.add(n,C,this._orbitOrigin);t.lookAtWorldPosition(E,s)}tilt(t,n,i,o,r,s=ne.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(o+=this.tiltVelocity*r),o===0)return;let a=h.angleBetween(t.direction,i);(a<W.PI_OVER_TWO&&o>0||a>W.PI_OVER_TWO&&o<0)&&(o*=Math.abs(Math.sin(a)));let c=a+o,d=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,u=this.dampingEnabled?this.tiltAnimationDuration:void 0;W.smoothDamp(a,c,this.tiltVelocity,r,d,u,this._tiltDampenedResults);let m=this.tiltAngle-a,p=q.fromQuaternion(Ne.fromAxisAngle(t.rightWC,-m,this._tiltQuaternion)),b=h.subtract(t.position,n,this._tiltOffset),f=h.dot(b,t.directionWC),y=h.multiplyByScalar(t.directionWC,f,this._tiltOffset),_=h.subtract(t.position,y,this._tiltOrigin),S=q.multiplyByVector(p,y,this._tiltOffset);h.add(_,S,t.position),t.lookAtWorldPosition(_,s)}update(t){let n=(Zn()-this._lastUpdateTime)*Mn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:o,clientHeight:r}=i;if(n===0||o===0||r===0){this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=o/2,a.y=r/2);let c=this.pickWorldPosition(t,a,this._target),d=l(c);this._hasTarget=d,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,d=c.geodeticSurfaceNormal(s,this._axis),u=h.negate(d,this._axis);if(this.orbitEnabled){let m=this._dragDelta.x/o;m=W.clamp(m,-this.maximumMovementRatio,this.maximumMovementRatio),m*=this.orbitMagnitude*W.TWO_PI,this.orbit(a,s,u,m,n,c)}if(this.tiltEnabled){let m=this._dragDelta.y/r;m=W.clamp(m,-this.maximumMovementRatio,this.maximumMovementRatio),m*=this.tiltMagnitude*W.PI,this.tilt(a,s,u,m,n,c)}}this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0}},Yce=Nce;var yOo=x(T(),1);var wce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.MIDDLE})]}static _getDefaultScrollInputs(){return[mn.WHEEL]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.zoomSensitivity=.2,this.pickWorldPosition=mp,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=W.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new la(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),mn.MOUSE_MOVE),this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(Zn()-this._lastUpdateTime)*Mn.SECONDS_PER_MILLISECOND,{canvas:o}=t,{clientWidth:r,clientHeight:s}=o;if(i===0||r===0||s===0){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let _=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=_,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=W.EPSILON3&&a>=-W.EPSILON3&&this.zoomVelocity<=W.EPSILON3){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=W.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:d}=t,u=c.direction,m=h.magnitude(c.positionWC)-d.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=r/2,p.y=s/2);let b=this.pickWorldPosition(t,p,this._target);l(b)&&(u=h.subtract(b,c.positionWC,this._zoomDirection),u=h.normalize(u,this._zoomDirection),m=h.distance(b,c.positionWC)),m=W.clamp(m,m>0?this.minimumZoomDistance:-this.maximumZoomDistance,m>0?this.maximumZoomDistance:-this.minimumZoomDistance);let f=a*m*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=W.smoothDamp(0,f,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(u,this.zoomDistance),this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},Mce=wce;var TOo=x(T(),1),LNe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(LNe);var kce=LNe;var SOo=x(T(),1),WNe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(WNe);var Uce=WNe;var COo=x(T(),1);function fOt(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: ${Op(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 Dce=fOt;globalThis.CESIUM_VERSION="1.145.0";var bpr=x(T(),1);var Hlr=x(T(),1);var Dlr=x(T(),1);var Ilr=x(T(),1),i5;typeof ko<"u"&&(i5=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 l(b,G){return b===null||typeof b in g?b===G:!1}function d(b,G){var X;return function(){X||(X=h.a.setTimeout(function(){X=e,b()},G))}}function u(b,G){var X;return function(){clearTimeout(X),X=h.a.setTimeout(b,G)}}function f(b,G){G&&G!=="change"?G==="beforeChange"?this.pc(b):this.gb(b,G):this.qc(b)}function p(b,G){G!==null&&G.s&&G.s()}function y(b,G){var X=this.qd,W=X[R];W.ra||(this.Qb&&this.mb[G]?(X.uc(G,b,this.mb[G]),this.mb[G]=null,--this.Qb):W.I[G]||X.uc(G,b,W.J?{da:b}:X.$c(b)),b.Ja&&b.gd())}var h=typeof s<"u"?s:{};h.b=function(b,G){for(var X=b.split("."),W=h,A=0;A<X.length-1;A++)W=W[X[A]];W[X[X.length-1]]=G},h.L=function(b,G,X){b[G]=X},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function b(j,$){for(var ne in j)A.call(j,ne)&&$(ne,j[ne])}function G(j,$){if($)for(var ne in $)A.call($,ne)&&(j[ne]=$[ne]);return j}function X(j,$){return j.__proto__=$,j}function W(j,$,ne,be){var Ce=j[$].match(Q)||[];h.a.D(ne.match(Q),function(me){h.a.Na(Ce,me,be)}),j[$]=Ce.join(" ")}var A=Object.prototype.hasOwnProperty,k={__proto__:[]}instanceof Array,B=typeof Symbol=="function",O={},H={};O[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],O.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(O,function(j,$){if($.length)for(var ne=0,be=$.length;ne<be;ne++)H[$[ne]]=j});var U={propertychange:!0},K=n&&function(){for(var j=3,$=n.createElement("div"),ne=$.getElementsByTagName("i");$.innerHTML="<!--[if gt IE "+ ++j+"]><i></i><![endif]-->",ne[0];);return 4<j?j:e}(),Q=/\S+/g,ie;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(j,$,ne){for(var be=0,Ce=j.length;be<Ce;be++)$.call(ne,j[be],be,j)},A:typeof Array.prototype.indexOf=="function"?function(j,$){return Array.prototype.indexOf.call(j,$)}:function(j,$){for(var ne=0,be=j.length;ne<be;ne++)if(j[ne]===$)return ne;return-1},Lb:function(j,$,ne){for(var be=0,Ce=j.length;be<Ce;be++)if($.call(ne,j[be],be,j))return j[be];return e},Pa:function(j,$){var ne=h.a.A(j,$);0<ne?j.splice(ne,1):ne===0&&j.shift()},wc:function(j){var $=[];return j&&h.a.D(j,function(ne){0>h.a.A($,ne)&&$.push(ne)}),$},Mb:function(j,$,ne){var be=[];if(j)for(var Ce=0,me=j.length;Ce<me;Ce++)be.push($.call(ne,j[Ce],Ce));return be},jb:function(j,$,ne){var be=[];if(j)for(var Ce=0,me=j.length;Ce<me;Ce++)$.call(ne,j[Ce],Ce)&&be.push(j[Ce]);return be},Nb:function(j,$){if($ instanceof Array)j.push.apply(j,$);else for(var ne=0,be=$.length;ne<be;ne++)j.push($[ne]);return j},Na:function(j,$,ne){var be=h.a.A(h.a.bc(j),$);0>be?ne&&j.push($):ne||j.splice(be,1)},Ba:k,extend:G,setPrototypeOf:X,Ab:k?X:G,P:b,Ga:function(j,$,ne){if(!j)return j;var be={},Ce;for(Ce in j)A.call(j,Ce)&&(be[Ce]=$.call(ne,j[Ce],Ce,j));return be},Tb:function(j){for(;j.firstChild;)h.removeNode(j.firstChild)},Yb:function(j){j=h.a.la(j);for(var $=(j[0]&&j[0].ownerDocument||n).createElement("div"),ne=0,be=j.length;ne<be;ne++)$.appendChild(h.oa(j[ne]));return $},Ca:function(j,$){for(var ne=0,be=j.length,Ce=[];ne<be;ne++){var me=j[ne].cloneNode(!0);Ce.push($?h.oa(me):me)}return Ce},va:function(j,$){if(h.a.Tb(j),$)for(var ne=0,be=$.length;ne<be;ne++)j.appendChild($[ne])},Xc:function(j,$){var ne=j.nodeType?[j]:j;if(0<ne.length){for(var be=ne[0],Ce=be.parentNode,me=0,_e=$.length;me<_e;me++)Ce.insertBefore($[me],be);for(me=0,_e=ne.length;me<_e;me++)h.removeNode(ne[me])}},Ua:function(j,$){if(j.length){for($=$.nodeType===8&&$.parentNode||$;j.length&&j[0].parentNode!==$;)j.splice(0,1);for(;1<j.length&&j[j.length-1].parentNode!==$;)j.length--;if(1<j.length){var ne=j[0],be=j[j.length-1];for(j.length=0;ne!==be;)j.push(ne),ne=ne.nextSibling;j.push(be)}}return j},Zc:function(j,$){7>K?j.setAttribute("selected",$):j.selected=$},Db:function(j){return j===null||j===e?"":j.trim?j.trim():j.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(j,$){return j=j||"",$.length>j.length?!1:j.substring(0,$.length)===$},vd:function(j,$){if(j===$)return!0;if(j.nodeType===11)return!1;if($.contains)return $.contains(j.nodeType!==1?j.parentNode:j);if($.compareDocumentPosition)return($.compareDocumentPosition(j)&16)==16;for(;j&&j!=$;)j=j.parentNode;return!!j},Sb:function(j){return h.a.vd(j,j.ownerDocument.documentElement)},kd:function(j){return!!h.a.Lb(j,h.a.Sb)},R:function(j){return j&&j.tagName&&j.tagName.toLowerCase()},Ac:function(j){return h.onError?function(){try{return j.apply(this,arguments)}catch($){throw h.onError&&h.onError($),$}}:j},setTimeout:function(j,$){return setTimeout(h.a.Ac(j),$)},Gc:function(j){setTimeout(function(){throw h.onError&&h.onError(j),j},0)},B:function(j,$,ne){var be=h.a.Ac(ne);if(ne=U[$],h.options.useOnlyNativeEvents||ne||!o)if(ne||typeof j.addEventListener!="function")if(typeof j.attachEvent<"u"){var Ce=function(_e){be.call(j,_e)},me="on"+$;j.attachEvent(me,Ce),h.a.K.za(j,function(){j.detachEvent(me,Ce)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else j.addEventListener($,be,!1);else ie||(ie=typeof o(j).on=="function"?"on":"bind"),o(j)[ie]($,be)},Fb:function(j,$){if(!j||!j.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ne;if(h.a.R(j)==="input"&&j.type&&$.toLowerCase()=="click"?(ne=j.type,ne=ne=="checkbox"||ne=="radio"):ne=!1,h.options.useOnlyNativeEvents||!o||ne)if(typeof n.createEvent=="function")if(typeof j.dispatchEvent=="function")ne=n.createEvent(H[$]||"HTMLEvents"),ne.initEvent($,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,j),j.dispatchEvent(ne);else throw Error("The supplied element doesn't support dispatchEvent");else if(ne&&j.click)j.click();else if(typeof j.fireEvent<"u")j.fireEvent("on"+$);else throw Error("Browser doesn't support triggering events");else o(j).trigger($)},f:function(j){return h.O(j)?j():j},bc:function(j){return h.O(j)?j.v():j},Eb:function(j,$,ne){var be;$&&(typeof j.classList=="object"?(be=j.classList[ne?"add":"remove"],h.a.D($.match(Q),function(Ce){be.call(j.classList,Ce)})):typeof j.className.baseVal=="string"?W(j.className,"baseVal",$,ne):W(j,"className",$,ne))},Bb:function(j,$){var ne=h.a.f($);(ne===null||ne===e)&&(ne="");var be=h.h.firstChild(j);!be||be.nodeType!=3||h.h.nextSibling(be)?h.h.va(j,[j.ownerDocument.createTextNode(ne)]):be.data=ne,h.a.Ad(j)},Yc:function(j,$){if(j.name=$,7>=K)try{var ne=j.name.replace(/[&<>'"]/g,function(be){return"&#"+be.charCodeAt(0)+";"});j.mergeAttributes(n.createElement("<input name='"+ne+"'/>"),!1)}catch{}},Ad:function(j){9<=K&&(j=j.nodeType==1?j:j.parentNode,j.style&&(j.style.zoom=j.style.zoom))},wd:function(j){if(K){var $=j.style.width;j.style.width=0,j.style.width=$}},Pd:function(j,$){j=h.a.f(j),$=h.a.f($);for(var ne=[],be=j;be<=$;be++)ne.push(be);return ne},la:function(j){for(var $=[],ne=0,be=j.length;ne<be;ne++)$.push(j[ne]);return $},Da:function(j){return B?Symbol(j):j},Zd:K===6,$d:K===7,W:K,Lc:function(j,$){for(var ne=h.a.la(j.getElementsByTagName("input")).concat(h.a.la(j.getElementsByTagName("textarea"))),be=typeof $=="string"?function(_e){return _e.name===$}:function(_e){return $.test(_e.name)},Ce=[],me=ne.length-1;0<=me;me--)be(ne[me])&&Ce.push(ne[me]);return Ce},Nd:function(j){return typeof j=="string"&&(j=h.a.Db(j))?r&&r.parse?r.parse(j):new Function("return "+j)():null},hc:function(j,$,ne){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(h.a.f(j),$,ne)},Od:function(j,$,ne){ne=ne||{};var be=ne.params||{},Ce=ne.includeFields||this.Jc,me=j;if(typeof j=="object"&&h.a.R(j)==="form")for(var me=j.action,_e=Ce.length-1;0<=_e;_e--)for(var Ve=h.a.Lc(j,Ce[_e]),Ie=Ve.length-1;0<=Ie;Ie--)be[Ve[Ie].name]=Ve[Ie].value;$=h.a.f($);var Ze=n.createElement("form");Ze.style.display="none",Ze.action=me,Ze.method="post";for(var De in $)j=n.createElement("input"),j.type="hidden",j.name=De,j.value=h.a.hc(h.a.f($[De])),Ze.appendChild(j);b(be,function(Ke,rt){var Xt=n.createElement("input");Xt.type="hidden",Xt.name=Ke,Xt.value=rt,Ze.appendChild(Xt)}),n.body.appendChild(Ze),ne.submitter?ne.submitter(Ze):Ze.submit(),setTimeout(function(){Ze.parentNode.removeChild(Ze)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var G=this;if(arguments.length===1)return function(){return G.apply(b,arguments)};var X=Array.prototype.slice.call(arguments,1);return function(){var W=X.slice(0);return W.push.apply(W,arguments),G.apply(b,W)}}),h.a.g=new function(){var b=0,G="__ko__"+new Date().getTime(),X={},W,A;return h.a.W?(W=function(k,B){var O=k[G];if(!O||O==="null"||!X[O]){if(!B)return e;O=k[G]="ko"+b++,X[O]={}}return X[O]},A=function(k){var B=k[G];return B?(delete X[B],k[G]=null,!0):!1}):(W=function(k,B){var O=k[G];return!O&&B&&(O=k[G]={}),O},A=function(k){return k[G]?(delete k[G],!0):!1}),{get:function(k,B){var O=W(k,!1);return O&&O[B]},set:function(k,B,O){(k=W(k,O!==e))&&(k[B]=O)},Ub:function(k,B,O){return k=W(k,!0),k[B]||(k[B]=O)},clear:A,Z:function(){return b+++G}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function b(B,O){var H=h.a.g.get(B,W);return H===e&&O&&(H=[],h.a.g.set(B,W,H)),H}function G(B){var O=b(B,!1);if(O)for(var O=O.slice(0),H=0;H<O.length;H++)O[H](B);h.a.g.clear(B),h.a.K.cleanExternalData(B),k[B.nodeType]&&X(B.childNodes,!0)}function X(B,O){for(var H=[],U,K=0;K<B.length;K++)if((!O||B[K].nodeType===8)&&(G(H[H.length]=U=B[K]),B[K]!==U))for(;K--&&h.a.A(H,B[K])==-1;);}var W=h.a.g.Z(),A={1:!0,8:!0,9:!0},k={1:!0,9:!0};return{za:function(B,O){if(typeof O!="function")throw Error("Callback must be a function");b(B,!0).push(O)},yb:function(B,O){var H=b(B,!1);H&&(h.a.Pa(H,O),H.length==0&&h.a.g.set(B,W,e))},oa:function(B){return h.u.G(function(){A[B.nodeType]&&(G(B),k[B.nodeType]&&X(B.getElementsByTagName("*")))}),B},removeNode:function(B){h.oa(B),B.parentNode&&B.parentNode.removeChild(B)},cleanExternalData:function(B){o&&typeof o.cleanData=="function"&&o.cleanData([B])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var b=[0,"",""],G=[1,"<table>","</table>"],X=[3,"<table><tbody><tr>","</tr></tbody></table>"],W=[1,"<select multiple='multiple'>","</select>"],A={thead:G,tbody:G,tfoot:G,tr:[2,"<table><tbody>","</tbody></table>"],td:X,th:X,option:W,optgroup:W},k=8>=h.a.W;h.a.ua=function(B,O){var H;if(o){if(o.parseHTML)H=o.parseHTML(B,O)||[];else if((H=o.clean([B],O))&&H[0]){for(var U=H[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(H=O)||(H=n);var U=H.parentWindow||H.defaultView||t,K=h.a.Db(B).toLowerCase(),Q=H.createElement("div"),ie;for(ie=(K=K.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&A[K[1]]||b,K=ie[0],ie="ignored<div>"+ie[1]+B+ie[2]+"</div>",typeof U.innerShiv=="function"?Q.appendChild(U.innerShiv(ie)):(k&&H.body.appendChild(Q),Q.innerHTML=ie,k&&Q.parentNode.removeChild(Q));K--;)Q=Q.lastChild;H=h.a.la(Q.lastChild.childNodes)}return H},h.a.Md=function(B,O){var H=h.a.ua(B,O);return H.length&&H[0].parentElement||h.a.Yb(H)},h.a.fc=function(B,O){if(h.a.Tb(B),O=h.a.f(O),O!==null&&O!==e)if(typeof O!="string"&&(O=O.toString()),o)o(B).html(O);else for(var H=h.a.ua(O,B.ownerDocument),U=0;U<H.length;U++)B.appendChild(H[U])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function b(X,W){if(X){if(X.nodeType==8){var A=h.aa.Uc(X.nodeValue);A!=null&&W.push({ud:X,Kd:A})}else if(X.nodeType==1)for(var A=0,k=X.childNodes,B=k.length;A<B;A++)b(k[A],W)}}var G={};return{Xb:function(X){if(typeof X!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var W=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return G[W]=X,"<!--[ko_memo:"+W+"]-->"},bd:function(X,W){var A=G[X];if(A===e)throw Error("Couldn't find any memo with ID "+X+". Perhaps it's already been unmemoized.");try{return A.apply(null,W||[]),!0}finally{delete G[X]}},cd:function(X,W){var A=[];b(X,A);for(var k=0,B=A.length;k<B;k++){var O=A[k].ud,H=[O];W&&h.a.Nb(H,W),h.aa.bd(A[k].Kd,H),O.nodeValue="",O.parentNode&&O.parentNode.removeChild(O)}},Uc:function(X){return(X=X.match(/^\[ko_memo\:(.*?)\]$/))?X[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function b(){if(A){for(var O=A,H=0,U;B<A;)if(U=W[B++]){if(B>O){if(5e3<=++H){B=A,h.a.Gc(Error("'Too much recursion' after processing "+H+" task groups."));break}O=A}try{U()}catch(K){h.a.Gc(K)}}}}function G(){b(),B=A=W.length=0}var X,W=[],A=0,k=1,B=0;return t.MutationObserver?X=function(O){var H=n.createElement("div");return new MutationObserver(O).observe(H,{attributes:!0}),function(){H.classList.toggle("foo")}}(G):X=n&&"onreadystatechange"in n.createElement("script")?function(O){var H=n.createElement("script");H.onreadystatechange=function(){H.onreadystatechange=null,n.documentElement.removeChild(H),H=null,O()},n.documentElement.appendChild(H)}:function(O){setTimeout(O,0)},{scheduler:X,zb:function(O){return A||h.na.scheduler(G),W[A++]=O,k++},cancel:function(O){O=O-(k-A),O>=B&&O<A&&(W[O]=null)},resetForTesting:function(){var O=A-B;return B=A=W.length=0,O},Sd:b}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(b,G){b.throttleEvaluation=G;var X=null;return h.$({read:b,write:function(W){clearTimeout(X),X=h.a.setTimeout(function(){b(W)},G)}})},rateLimit:function(b,G){var X,W,A;typeof G=="number"?X=G:(X=G.timeout,W=G.method),b.Hb=!1,A=typeof W=="function"?W:W=="notifyWhenChangesStop"?u:d,b.ub(function(k){return A(k,X,G)})},deferred:function(b,G){if(G!==!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(X){var W,A=!1;return function(){if(!A){h.na.cancel(W),W=h.na.zb(X);try{A=!0,b.notifySubscribers(e,"dirty")}finally{A=!1}}}}))},notify:function(b,G){b.equalityComparer=G=="always"?null:l}};var g={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(b,G,X){this.da=b,this.lc=G,this.mc=X,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(b){this.Jb=b,h.a.K.za(b,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,x),x.qb(this)};var x={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,G,X){var W=this;X=X||"change";var A=new h.ic(W,G?b.bind(G):b,function(){h.a.Pa(W.U[X],A),W.hb&&W.hb(X)});return W.Qa&&W.Qa(X),W.U[X]||(W.U[X]=[]),W.U[X].push(A),A},notifySubscribers:function(b,G){if(G=G||"change",G==="change"&&this.Gb(),this.Wa(G)){var X=G==="change"&&this.ed||this.U[G].slice(0);try{h.u.xc();for(var W=0,A;A=X[W];++W)A.Ib||A.lc(b)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var G=this,X=h.O(G),W,A,k,B,O;G.gb||(G.gb=G.notifySubscribers,G.notifySubscribers=f);var H=b(function(){G.Ja=!1,X&&B===G&&(B=G.nc?G.nc():G());var U=A||O&&G.sb(k,B);O=A=W=!1,U&&G.gb(k=B)});G.qc=function(U,K){K&&G.Ja||(O=!K),G.ed=G.U.change.slice(0),G.Ja=W=!0,B=U,H()},G.pc=function(U){W||(k=U,G.gb(U,"beforeChange"))},G.rc=function(){O=!0},G.gd=function(){G.sb(k,G.v(!0))&&(A=!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 G=0;return h.a.P(this.U,function(X,W){X!=="dirty"&&(G+=W.length)}),G},sb:function(b,G){return!this.equalityComparer||!this.equalityComparer(b,G)},toString:function(){return"[object Object]"},extend:function(b){var G=this;return b&&h.a.P(b,function(X,W){var A=h.Ta[X];typeof A=="function"&&(G=A(G,W)||G)}),G}};h.L(x,"init",x.qb),h.L(x,"subscribe",x.subscribe),h.L(x,"extend",x.extend),h.L(x,"getSubscriptionsCount",x.Bd),h.a.Ba&&h.a.setPrototypeOf(x,Function.prototype),h.T.fn=x,h.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function b(k){X.push(W),W=k}function G(){W=X.pop()}var X=[],W,A=0;return{xc:b,end:G,cc:function(k){if(W){if(!h.Qc(k))throw Error("Only subscribable things can act as dependencies");W.od.call(W.pd,k,k.fd||(k.fd=++A))}},G:function(k,B,O){try{return b(),k.apply(B,O||[])}finally{G()}},qa:function(){if(W)return W.o.qa()},Va:function(){if(W)return W.o.Va()},Ya:function(){if(W)return W.Ya},o:function(){if(W)return W.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var S=h.a.Da("_latestValue");h.ta=function(b){function G(){return 0<arguments.length?(G.sb(G[S],arguments[0])&&(G.ya(),G[S]=arguments[0],G.xa()),this):(h.u.cc(G),G[S])}return G[S]=b,h.a.Ba||h.a.extend(G,h.T.fn),h.T.fn.qb(G),h.a.Ab(G,V),h.options.deferUpdates&&h.Ta.deferred(G,!0),G};var V={equalityComparer:l,v:function(){return this[S]},xa:function(){this.notifySubscribers(this[S],"spectate"),this.notifySubscribers(this[S])},ya:function(){this.notifySubscribers(this[S],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(V,h.T.fn);var Z=h.ta.Ma="__ko_proto__";V[Z]=h.ta,h.O=function(b){if((b=typeof b=="function"&&b[Z])&&b!==V[Z]&&b!==h.o.fn[Z])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},h.Za=function(b){return typeof b=="function"&&(b[Z]===V[Z]||b[Z]===h.o.fn[Z]&&b.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",V),h.L(V,"peek",V.v),h.L(V,"valueHasMutated",V.xa),h.L(V,"valueWillMutate",V.ya),h.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=h.ta(b),h.a.Ab(b,h.Ha.fn),b.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(b){for(var G=this.v(),X=[],W=typeof b!="function"||h.O(b)?function(B){return B===b}:b,A=0;A<G.length;A++){var k=G[A];if(W(k)){if(X.length===0&&this.ya(),G[A]!==k)throw Error("Array modified during remove; cannot remove item");X.push(k),G.splice(A,1),A--}}return X.length&&this.xa(),X},removeAll:function(b){if(b===e){var G=this.v(),X=G.slice(0);return this.ya(),G.splice(0,G.length),this.xa(),X}return b?this.remove(function(W){return 0<=h.a.A(b,W)}):[]},destroy:function(b){var G=this.v(),X=typeof b!="function"||h.O(b)?function(k){return k===b}:b;this.ya();for(var W=G.length-1;0<=W;W--){var A=G[W];X(A)&&(A._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(G){return 0<=h.a.A(b,G)}):[]},indexOf:function(b){var G=this();return h.a.A(G,b)},replace:function(b,G){var X=this.indexOf(b);0<=X&&(this.ya(),this.v()[X]=G,this.xa())},sorted:function(b){var G=this().slice(0);return b?G.sort(b):G.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){h.Ha.fn[b]=function(){var G=this.v();this.ya(),this.zc(G,b,arguments);var X=G[b].apply(G,arguments);return this.xa(),X===G?this:X}}),h.a.D(["slice"],function(b){h.Ha.fn[b]=function(){var G=this();return G[b].apply(G,arguments)}}),h.Pc=function(b){return h.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(b,G){function X(){function Q(){if(O){var ie=[].concat(b.v()||[]),j;b.Wa("arrayChange")&&((!A||1<O)&&(A=h.a.Pb(H,ie,b.Ob)),j=A),H=ie,A=null,O=0,j&&j.length&&b.notifySubscribers(j,"arrayChange")}}W?Q():(W=!0,B=b.subscribe(function(){++O},null,"spectate"),H=[].concat(b.v()||[]),A=null,k=b.subscribe(Q))}if(b.Ob={},G&&typeof G=="object"&&h.a.extend(b.Ob,G),b.Ob.sparse=!0,!b.zc){var W=!1,A=null,k,B,O=0,H,U=b.Qa,K=b.hb;b.Qa=function(Q){U&&U.call(b,Q),Q==="arrayChange"&&X()},b.hb=function(Q){K&&K.call(b,Q),Q!=="arrayChange"||b.Wa("arrayChange")||(k&&k.s(),B&&B.s(),B=k=null,W=!1,H=e)},b.zc=function(Q,ie,j){function $(Ze,De,Ke){return ne[ne.length]={status:Ze,value:De,index:Ke}}if(W&&!O){var ne=[],be=Q.length,Ce=j.length,me=0;switch(ie){case"push":me=be;case"unshift":for(ie=0;ie<Ce;ie++)$("added",j[ie],me+ie);break;case"pop":me=be-1;case"shift":be&&$("deleted",Q[me],me);break;case"splice":ie=Math.min(Math.max(0,0>j[0]?be+j[0]:j[0]),be);for(var be=Ce===1?be:Math.min(ie+(j[1]||0),be),Ce=ie+Ce-2,me=Math.max(be,Ce),_e=[],Ve=[],Ie=2;ie<me;++ie,++Ie)ie<be&&Ve.push($("deleted",Q[ie],ie)),ie<Ce&&_e.push($("added",j[Ie],ie));h.a.Kc(Ve,_e);break;default:return}A=ne}}}};var R=h.a.Da("_state");h.o=h.$=function(b,G,X){function W(){if(0<arguments.length){if(typeof A=="function")A.apply(k.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 k.ra||h.u.cc(W),(k.ka||k.J&&W.Xa())&&W.ha(),k.X}if(typeof b=="object"?X=b:(X=X||{},b&&(X.read=b)),typeof X.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var A=X.write,k={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:X.read,nb:G||X.owner,l:X.disposeWhenNodeIsRemoved||X.l||null,Sa:X.disposeWhen||X.Sa,Rb:null,I:{},V:0,Ic:null};return W[R]=k,W.Nc=typeof A=="function",h.a.Ba||h.a.extend(W,h.T.fn),h.T.fn.qb(W),h.a.Ab(W,E),X.pure?(k.wb=!0,k.J=!0,h.a.extend(W,I)):X.deferEvaluation&&h.a.extend(W,v),h.options.deferUpdates&&h.Ta.deferred(W,!0),k.l&&(k.jc=!0,k.l.nodeType||(k.l=null)),k.J||X.deferEvaluation||W.ha(),k.l&&W.ja()&&h.a.K.za(k.l,k.Rb=function(){W.s()}),W};var E={equalityComparer:l,qa:function(){return this[R].V},Va:function(){var b=[];return h.a.P(this[R].I,function(G,X){b[X.Ka]=X.da}),b},Vb:function(b){if(!this[R].V)return!1;var G=this.Va();return h.a.A(G,b)!==-1?!0:!!h.a.Lb(G,function(X){return X.Vb&&X.Vb(b)})},uc:function(b,G,X){if(this[R].wb&&G===this)throw Error("A 'pure' computed must not be called recursively");this[R].I[b]=X,X.Ka=this[R].V++,X.La=G.ob()},Xa:function(){var b,G,X=this[R].I;for(b in X)if(Object.prototype.hasOwnProperty.call(X,b)&&(G=X[b],this.Ia&&G.da.Ja||G.da.Dd(G.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 G=b.subscribe(this.Jd,this,"dirty"),X=b.subscribe(this.Rd,this);return{da:b,s:function(){G.s(),X.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,G=b.throttleEvaluation;G&&0<=G?(clearTimeout(this[R].Ic),this[R].Ic=h.a.setTimeout(function(){b.ha(!0)},G)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var G=this[R],X=G.Sa,W=!1;if(!G.rb&&!G.ra){if(G.l&&!h.a.Sb(G.l)||X&&X()){if(!G.jc){this.s();return}}else G.jc=!1;G.rb=!0;try{W=this.zd(b)}finally{G.rb=!1}return W}},zd:function(b){var G=this[R],W=!1,X=G.wb?e:!G.V,W={qd:this,mb:G.I,Qb:G.V};h.u.xc({pd:W,od:y,o:this,Ya:X}),G.I={},G.V=0;var A=this.yd(G,W);return G.V?W=this.sb(G.X,A):(this.s(),W=!0),W&&(G.J?this.Gb():this.notifySubscribers(G.X,"beforeChange"),G.X=A,this.notifySubscribers(G.X,"spectate"),!G.J&&b&&this.notifySubscribers(G.X),this.rc&&this.rc()),X&&this.notifySubscribers(G.X,"awake"),W},yd:function(b,G){try{var X=b.Wc;return b.nb?X.call(b.nb):X()}finally{h.u.end(),G.Qb&&!b.J&&h.a.P(G.mb,p),b.sa=b.ka=!1}},v:function(b){var G=this[R];return(G.ka&&(b||!G.V)||G.J&&this.Xa())&&this.ha(),G.X},ub:function(b){h.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(G){this.pc(this[R].X),this[R].ka=!0,G&&(this[R].sa=!0),this.qc(this,!G)}},s:function(){var b=this[R];!b.J&&b.I&&h.a.P(b.I,function(G,X){X.s&&X.s()}),b.l&&b.Rb&&h.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 G=this,X=G[R];if(!X.ra&&X.J&&b=="change"){if(X.J=!1,X.sa||G.Xa())X.I=null,X.V=0,G.ha()&&G.Gb();else{var W=[];h.a.P(X.I,function(A,k){W[k.Ka]=A}),h.a.D(W,function(A,k){var B=X.I[A],O=G.$c(B.da);O.Ka=k,O.La=B.La,X.I[A]=O}),G.Xa()&&G.ha()&&G.Gb()}X.ra||G.notifySubscribers(X.X,"awake")}},hb:function(b){var G=this[R];G.ra||b!="change"||this.Wa("change")||(h.a.P(G.I,function(X,W){W.s&&(G.I[X]={da:W.da,Ka:W.Ka,La:W.La},W.s())}),G.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[R];return b.J&&(b.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(E,h.T.fn);var P=h.ta.Ma;E[P]=h.o,h.Oc=function(b){return typeof b=="function"&&b[P]===E[P]},h.Fd=function(b){return h.Oc(b)&&b[R]&&b[R].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",E),h.L(E,"peek",E.v),h.L(E,"dispose",E.s),h.L(E,"isActive",E.ja),h.L(E,"getDependenciesCount",E.qa),h.L(E,"getDependencies",E.Va),h.xb=function(b,G){return typeof b=="function"?h.o(b,G,{pure:!0}):(b=h.a.extend({},b),b.pure=!0,h.o(b,G))},h.b("pureComputed",h.xb),function(){function b(W,A,k){if(k=k||new X,W=A(W),typeof W!="object"||W===null||W===e||W instanceof RegExp||W instanceof Date||W instanceof String||W instanceof Number||W instanceof Boolean)return W;var B=W instanceof Array?[]:{};return k.save(W,B),G(W,function(O){var H=A(W[O]);switch(typeof H){case"boolean":case"number":case"string":case"function":B[O]=H;break;case"object":case"undefined":var U=k.get(H);B[O]=U!==e?U:b(H,A,k)}}),B}function G(W,A){if(W instanceof Array){for(var k=0;k<W.length;k++)A(k);typeof W.toJSON=="function"&&A("toJSON")}else for(k in W)A(k)}function X(){this.keys=[],this.values=[]}h.ad=function(W){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(W,function(A){for(var k=0;h.O(A)&&10>k;k++)A=A();return A})},h.toJSON=function(W,A,k){return W=h.ad(W),h.a.hc(W,A,k)},X.prototype={constructor:X,save:function(W,A){var k=h.a.A(this.keys,W);0<=k?this.values[k]=A:(this.keys.push(W),this.values.push(A))},get:function(W){return W=h.a.A(this.keys,W),0<=W?this.values[W]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(b,G,X){function W(A){var k=h.xb(b,X).extend({ma:"always"}),B=k.subscribe(function(O){O&&(B.s(),A(O))});return k.notifySubscribers(k.v()),B}return typeof Promise!="function"||G?W(G.bind(X)):new Promise(W)},h.b("when",h.Wd),function(){h.w={M:function(b){switch(h.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?h.a.g.get(b,h.c.options.$b):7>=h.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?h.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,G,X){switch(h.a.R(b)){case"option":typeof G=="string"?(h.a.g.set(b,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=G):(h.a.g.set(b,h.c.options.$b,G),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof G=="number"?G:"");break;case"select":(G===""||G===null)&&(G=e);for(var W=-1,A=0,k=b.options.length,B;A<k;++A)if(B=h.w.M(b.options[A]),B==G||B===""&&G===e){W=A;break}(X||0<=W||G===e&&1<b.size)&&(b.selectedIndex=W,h.a.W===6&&h.a.setTimeout(function(){b.selectedIndex=W},0));break;default:(G===null||G===e)&&(G=""),b.value=G}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function b(O){O=h.a.Db(O),O.charCodeAt(0)===123&&(O=O.slice(1,-1)),O+=` -,`;var H=[],U=O.match(W),K,Q=[],ie=0;if(1<U.length){for(var j=0,$;$=U[j];++j){var ne=$.charCodeAt(0);if(ne===44){if(0>=ie){H.push(K&&Q.length?{key:K,value:Q.join("")}:{unknown:K||Q.join("")}),K=ie=0,Q=[];continue}}else if(ne===58){if(!ie&&!K&&Q.length===1){K=Q.pop();continue}}else{if(ne===47&&1<$.length&&($.charCodeAt(1)===47||$.charCodeAt(1)===42))continue;ne===47&&j&&1<$.length?(ne=U[j-1].match(A))&&!k[ne[0]]&&(O=O.substr(O.indexOf($)+1),U=O.match(W),j=-1,$="/"):ne===40||ne===123||ne===91?++ie:ne===41||ne===125||ne===93?--ie:K||Q.length||ne!==34&&ne!==39||($=$.slice(1,-1))}Q.push($)}if(0<ie)throw Error("Unbalanced parentheses, braces, or brackets")}return H}var G=["true","false","null","undefined"],X=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,W=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),A=/[\])"'A-Za-z0-9_$]+$/,k={in:1,return:1,typeof:1},B={};return{Ra:[],wa:B,ac:b,vb:function(O,H){function U(ne,be){var Ce;if(!j){var me=h.getBindingHandler(ne);if(me&&me.preprocess&&!(be=me.preprocess(be,ne,U)))return;(me=B[ne])&&(Ce=be,0<=h.a.A(G,Ce)?Ce=!1:(me=Ce.match(X),Ce=me===null?!1:me[1]?"Object("+me[1]+")"+me[2]:Ce),me=Ce),me&&Q.push("'"+(typeof B[ne]=="string"?B[ne]:ne)+"':function(_z){"+Ce+"=_z}")}ie&&(be="function(){return "+be+" }"),K.push("'"+ne+"':"+be)}H=H||{};var K=[],Q=[],ie=H.valueAccessors,j=H.bindingParams,$=typeof O=="string"?b(O):O;return h.a.D($,function(ne){U(ne.key||ne.unknown,ne.value)}),Q.length&&U("_ko_property_writers","{"+Q.join(",")+" }"),K.join(",")},Id:function(O,H){for(var U=0;U<O.length;U++)if(O[U].key==H)return!0;return!1},eb:function(O,H,U,K,Q){O&&h.O(O)?!h.Za(O)||Q&&O.v()===K||O(K):(O=H.get("_ko_property_writers"))&&O[U]&&O[U](K)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function b(U){return U.nodeType==8&&k.test(A?U.text:U.nodeValue)}function G(U){return U.nodeType==8&&B.test(A?U.text:U.nodeValue)}function X(U,K){for(var Q=U,ie=1,j=[];Q=Q.nextSibling;){if(G(Q)&&(h.a.g.set(Q,H,!0),ie--,ie===0))return j;j.push(Q),b(Q)&&ie++}if(!K)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function W(U,K){var Q=X(U,K);return Q?0<Q.length?Q[Q.length-1].nextSibling:U.nextSibling:null}var A=n&&n.createComment("test").text==="<!--test-->",k=A?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,B=A?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,O={ul:!0,ol:!0},H="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(U){return b(U)?X(U):U.childNodes},Ea:function(U){if(b(U)){U=h.h.childNodes(U);for(var K=0,Q=U.length;K<Q;K++)h.removeNode(U[K])}else h.a.Tb(U)},va:function(U,K){if(b(U)){h.h.Ea(U);for(var Q=U.nextSibling,ie=0,j=K.length;ie<j;ie++)Q.parentNode.insertBefore(K[ie],Q)}else h.a.va(U,K)},Vc:function(U,K){var Q;b(U)?(Q=U.nextSibling,U=U.parentNode):Q=U.firstChild,Q?K!==Q&&U.insertBefore(K,Q):U.appendChild(K)},Wb:function(U,K,Q){Q?(Q=Q.nextSibling,b(U)&&(U=U.parentNode),Q?K!==Q&&U.insertBefore(K,Q):U.appendChild(K)):h.h.Vc(U,K)},firstChild:function(U){if(b(U))return!U.nextSibling||G(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&G(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(b(U)&&(U=W(U)),U.nextSibling&&G(U.nextSibling)){var K=U.nextSibling;if(G(K)&&!h.a.g.get(K,H))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:b,Vd:function(U){return(U=(A?U.text:U.nodeValue).match(k))?U[1]:null},Sc:function(U){if(O[h.a.R(U)]){var K=U.firstChild;if(K)do if(K.nodeType===1){var Q;Q=K.firstChild;var ie=null;if(Q)do if(ie)ie.push(Q);else if(b(Q)){var j=W(Q,!0);j?Q=j:ie=[Q]}else G(Q)&&(ie=[Q]);while(Q=Q.nextSibling);if(Q=ie)for(ie=K.nextSibling,j=0;j<Q.length;j++)ie?U.insertBefore(Q[j],ie):U.appendChild(Q[j])}while(K=K.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(b);case 8:return h.h.Cd(b);default:return!1}},getBindings:function(b,G){var X=this.getBindingsString(b,G),X=X?this.parseBindingsString(X,G,b):null;return h.j.tc(X,b,G,!1)},getBindingAccessors:function(b,G){var X=this.getBindingsString(b,G),X=X?this.parseBindingsString(X,G,b,{valueAccessors:!0}):null;return h.j.tc(X,b,G,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return h.h.Vd(b);default:return null}},parseBindingsString:function(b,G,X,W){try{var A=this.nd,k=b+(W&&W.valueAccessors||""),B;if(!(B=A[k])){var O,H="with($context){with($data||{}){return{"+h.m.vb(b,W)+"}}}";O=new Function("$context","$element",H),B=A[k]=O}return B(G,X)}catch(U){throw U.message=`Unable to parse bindings. -Bindings value: `+b+` -Message: `+U.message,U}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function b(me){var _e=(me=h.a.g.get(me,Ce))&&me.N;_e&&(me.N=null,_e.Tc())}function G(me,_e,Ve){this.node=me,this.yc=_e,this.kb=[],this.H=!1,_e.N||h.a.K.za(me,b),Ve&&Ve.N&&(Ve.N.kb.push(me),this.Kb=Ve)}function X(me){return function(){return me}}function W(me){return me()}function A(me){return h.a.Ga(h.u.G(me),function(_e,Ve){return function(){return me()[Ve]}})}function k(me,_e,Ve){return typeof me=="function"?A(me.bind(null,_e,Ve)):h.a.Ga(me,X)}function B(me,_e){return A(this.getBindings.bind(this,me,_e))}function O(me,_e){var Ve=h.h.firstChild(_e);if(Ve){var Ie,Ze=h.ga.instance,De=Ze.preprocessNode;if(De){for(;Ie=Ve;)Ve=h.h.nextSibling(Ie),De.call(Ze,Ie);Ve=h.h.firstChild(_e)}for(;Ie=Ve;)Ve=h.h.nextSibling(Ie),H(me,Ie)}h.i.ma(_e,h.i.H)}function H(me,_e){var Ve=me,Ie=_e.nodeType===1;Ie&&h.h.Sc(_e),(Ie||h.ga.instance.nodeHasBindings(_e))&&(Ve=K(_e,null,me).bindingContextForDescendants),Ve&&!ne[h.a.R(_e)]&&O(Ve,_e)}function U(me){var _e=[],Ve={},Ie=[];return h.a.P(me,function Ze(De){if(!Ve[De]){var Ke=h.getBindingHandler(De);Ke&&(Ke.after&&(Ie.push(De),h.a.D(Ke.after,function(rt){if(me[rt]){if(h.a.A(Ie,rt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Ze(rt)}}),Ie.length--),_e.push({key:De,Mc:Ke})),Ve[De]=!0}}),_e}function K(me,_e,Ve){var Ie=h.a.g.Ub(me,Ce,{}),Ze=Ie.hd;if(!_e){if(Ze)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Ze||(Ie.context=Ve),Ie.Zb||(Ie.Zb={});var De;if(_e&&typeof _e!="function")De=_e;else{var Ke=h.ga.instance,rt=Ke.getBindingAccessors||B,Xt=h.$(function(){return(De=_e?_e(Ve,me):rt.call(Ke,me,Ve))&&(Ve[ie]&&Ve[ie](),Ve[$]&&Ve[$]()),De},null,{l:me});De&&Xt.ja()||(Xt=null)}var Ht=Ve,qe;if(De){var mn=function(){return h.a.Ga(Xt?Xt():De,W)},Dt=Xt?function(Lt){return function(){return W(Xt()[Lt])}}:function(Lt){return De[Lt]};mn.get=function(Lt){return De[Lt]&&W(Dt(Lt))},mn.has=function(Lt){return Lt in De},h.i.H in De&&h.i.subscribe(me,h.i.H,function(){var Lt=(0,De[h.i.H])();if(Lt){var Vi=h.h.childNodes(me);Vi.length&&Lt(Vi,h.Ec(Vi[0]))}}),h.i.pa in De&&(Ht=h.i.Cb(me,Ve),h.i.subscribe(me,h.i.pa,function(){var Lt=(0,De[h.i.pa])();Lt&&h.h.firstChild(me)&&Lt(me)})),Ie=U(De),h.a.D(Ie,function(Lt){var Vi=Lt.Mc.init,ln=Lt.Mc.update,ge=Lt.key;if(me.nodeType===8&&!h.h.ea[ge])throw Error("The binding '"+ge+"' cannot be used with virtual elements");try{typeof Vi=="function"&&h.u.G(function(){var Le=Vi(me,Dt(ge),mn,Ht.$data,Ht);if(Le&&Le.controlsDescendantBindings){if(qe!==e)throw Error("Multiple bindings ("+qe+" and "+ge+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");qe=ge}}),typeof ln=="function"&&h.$(function(){ln(me,Dt(ge),mn,Ht.$data,Ht)},null,{l:me})}catch(Le){throw Le.message='Unable to process binding "'+ge+": "+De[ge]+`" -Message: `+Le.message,Le}})}return Ie=qe===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&Ht}}function Q(me,_e){return me&&me instanceof h.fa?me:new h.fa(me,e,e,_e)}var ie=h.a.Da("_subscribable"),j=h.a.Da("_ancestorBindingInfo"),$=h.a.Da("_dataDependency");h.c={};var ne={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(me){return h.c[me]};var be={};h.fa=function(me,_e,Ve,Ie,Ze){function De(){var Dt=Ht?Xt():Xt,Lt=h.a.f(Dt);return _e?(h.a.extend(Ke,_e),j in _e&&(Ke[j]=_e[j])):(Ke.$parents=[],Ke.$root=Lt,Ke.ko=h),Ke[ie]=qe,rt?Lt=Ke.$data:(Ke.$rawData=Dt,Ke.$data=Lt),Ve&&(Ke[Ve]=Lt),Ie&&Ie(Ke,_e,Lt),_e&&_e[ie]&&!h.S.o().Vb(_e[ie])&&_e[ie](),mn&&(Ke[$]=mn),Ke.$data}var Ke=this,rt=me===be,Xt=rt?e:me,Ht=typeof Xt=="function"&&!h.O(Xt),qe,mn=Ze&&Ze.dataDependency;Ze&&Ze.exportDependencies?De():(qe=h.xb(De),qe.v(),qe.ja()?qe.equalityComparer=null:Ke[ie]=e)},h.fa.prototype.createChildContext=function(me,_e,Ve,Ie){if(!Ie&&_e&&typeof _e=="object"&&(Ie=_e,_e=Ie.as,Ve=Ie.extend),_e&&Ie&&Ie.noChildContext){var Ze=typeof me=="function"&&!h.O(me);return new h.fa(be,this,null,function(De){Ve&&Ve(De),De[_e]=Ze?me():me},Ie)}return new h.fa(me,this,_e,function(De,Ke){De.$parentContext=Ke,De.$parent=Ke.$data,De.$parents=(Ke.$parents||[]).slice(0),De.$parents.unshift(De.$parent),Ve&&Ve(De)},Ie)},h.fa.prototype.extend=function(me,_e){return new h.fa(be,this,null,function(Ve){h.a.extend(Ve,typeof me=="function"?me(Ve):me)},_e)};var Ce=h.a.g.Z();G.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},G.prototype.sd=function(me){h.a.Pa(this.kb,me),!this.kb.length&&this.H&&this.Cc()},G.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,b),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(me,_e,Ve,Ie,Ze){var De=h.a.g.Ub(me,Ce,{});return De.Fa||(De.Fa=new h.T),Ze&&Ze.notifyImmediately&&De.Zb[_e]&&h.u.G(Ve,Ie,[me]),De.Fa.subscribe(Ve,Ie,_e)},ma:function(me,_e){var Ve=h.a.g.get(me,Ce);if(Ve&&(Ve.Zb[_e]=!0,Ve.Fa&&Ve.Fa.notifySubscribers(me,_e),_e==h.i.H)){if(Ve.N)Ve.N.Cc();else if(Ve.N===e&&Ve.Fa&&Ve.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(me,_e){var Ve=h.a.g.Ub(me,Ce,{});return Ve.N||(Ve.N=new G(me,Ve,_e[j])),_e[j]==Ve?_e:_e.extend(function(Ie){Ie[j]=Ve})}},h.Td=function(me){return(me=h.a.g.get(me,Ce))&&me.context},h.ib=function(me,_e,Ve){return me.nodeType===1&&h.h.Sc(me),K(me,_e,Q(Ve))},h.ld=function(me,_e,Ve){return Ve=Q(Ve),h.ib(me,k(_e,Ve,me),Ve)},h.Oa=function(me,_e){_e.nodeType!==1&&_e.nodeType!==8||O(Q(me),_e)},h.vc=function(me,_e,Ve){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(_e=n.body,!_e)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!_e||_e.nodeType!==1&&_e.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");H(Q(me,Ve),_e)},h.Dc=function(me){return!me||me.nodeType!==1&&me.nodeType!==8?e:h.Td(me)},h.Ec=function(me){return(me=h.Dc(me))?me.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(b){function G(B,O){var H=Object.prototype.hasOwnProperty.call(A,B)?A[B]:b,U;H?H.subscribe(O):(H=A[B]=new h.T,H.subscribe(O),X(B,function(K,Q){var ie=!(!Q||!Q.synchronous);k[B]={definition:K,Gd:ie},delete A[B],U||ie?H.notifySubscribers(K):h.na.zb(function(){H.notifySubscribers(K)})}),U=!0)}function X(B,O){W("getConfig",[B],function(H){H?W("loadComponent",[B,H],function(U){O(U,H)}):O(null,null)})}function W(B,O,H,U){U||(U=h.j.loaders.slice(0));var K=U.shift();if(K){var Q=K[B];if(Q){var ie=!1;if(Q.apply(K,O.concat(function(j){ie?H(null):j!==null?H(j):W(B,O,H,U)}))!==b&&(ie=!0,!K.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else W(B,O,H,U)}else H(null)}var A={},k={};h.j={get:function(B,O){var H=Object.prototype.hasOwnProperty.call(k,B)?k[B]:b;H?H.Gd?h.u.G(function(){O(H.definition)}):h.na.zb(function(){O(H.definition)}):G(B,O)},Bc:function(B){delete k[B]},oc:W},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function b(H,U,K,Q){function ie(){--$===0&&Q(j)}var j={},$=2,ne=K.template;K=K.viewModel,ne?A(U,ne,function(be){h.j.oc("loadTemplate",[H,be],function(Ce){j.template=Ce,ie()})}):ie(),K?A(U,K,function(be){h.j.oc("loadViewModel",[H,be],function(Ce){j[O]=Ce,ie()})}):ie()}function G(H,U,K){if(typeof U=="function")K(function(ie){return new U(ie)});else if(typeof U[O]=="function")K(U[O]);else if("instance"in U){var Q=U.instance;K(function(){return Q})}else"viewModel"in U?G(H,U.viewModel,K):H("Unknown viewModel value: "+U)}function X(H){switch(h.a.R(H)){case"script":return h.a.ua(H.text);case"textarea":return h.a.ua(H.value);case"template":if(W(H.content))return h.a.Ca(H.content.childNodes)}return h.a.Ca(H.childNodes)}function W(H){return t.DocumentFragment?H instanceof DocumentFragment:H&&H.nodeType===11}function A(H,U,K){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(Q){Q&&typeof Q=="object"&&Q.Xd&&Q.default&&(Q=Q.default),K(Q)}):H("Uses require, but no AMD loader is present"):K(U)}function k(H){return function(U){throw Error("Component '"+H+"': "+U)}}var B={};h.j.register=function(H,U){if(!U)throw Error("Invalid configuration for "+H);if(h.j.tb(H))throw Error("Component "+H+" is already registered");B[H]=U},h.j.tb=function(H){return Object.prototype.hasOwnProperty.call(B,H)},h.j.unregister=function(H){delete B[H],h.j.Bc(H)},h.j.Fc={getConfig:function(H,U){U(h.j.tb(H)?B[H]:null)},loadComponent:function(H,U,K){var Q=k(H);A(Q,U,function(ie){b(H,Q,ie,K)})},loadTemplate:function(H,U,K){if(H=k(H),typeof U=="string")K(h.a.ua(U));else if(U instanceof Array)K(U);else if(W(U))K(h.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)K(X(U));else if(typeof U=="string"){var Q=n.getElementById(U);Q?K(X(Q)):H("Cannot find element with ID "+U)}else H("Unknown element type: "+U);else H("Unknown template value: "+U)},loadViewModel:function(H,U,K){G(k(H),U,K)}};var O="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=B}(),function(){function b(X,W){var A=X.getAttribute("params");if(A){var A=G.parseBindingsString(A,W,X,{valueAccessors:!0,bindingParams:!0}),A=h.a.Ga(A,function(O){return h.o(O,null,{l:X})}),k=h.a.Ga(A,function(O){var H=O.v();return O.ja()?h.o({read:function(){return h.a.f(O())},write:h.Za(H)&&function(U){O()(U)},l:X}):H});return Object.prototype.hasOwnProperty.call(k,"$raw")||(k.$raw=A),k}return{$raw:{}}}h.j.getComponentNameForNode=function(X){var W=h.a.R(X);if(h.j.tb(W)&&(W.indexOf("-")!=-1||""+X=="[object HTMLUnknownElement]"||8>=h.a.W&&X.tagName===W))return W},h.j.tc=function(X,W,A,k){if(W.nodeType===1){var B=h.j.getComponentNameForNode(W);if(B){if(X=X||{},X.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var O={name:B,params:b(W,A)};X.component=k?function(){return O}:O}}return X};var G=new h.ga;9>h.a.W&&(h.j.register=function(X){return function(W){return X.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(X){return function(){var W=X(),A=h.j.dd,k;for(k in A);return W}}(n.createDocumentFragment))}(),function(){function b(W,A,k){if(A=A.template,!A)throw Error("Component '"+W+"' has no template");W=h.a.Ca(A),h.h.va(k,W)}function G(W,A,k){var B=W.createViewModel;return B?B.call(W,A,k):A}var X=0;h.c.component={init:function(W,A,k,B,O){function H(){var j=U&&U.dispose;typeof j=="function"&&j.call(U),Q&&Q.s(),K=U=Q=null}var U,K,Q,ie=h.a.la(h.h.childNodes(W));return h.h.Ea(W),h.a.K.za(W,H),h.o(function(){var j=h.a.f(A()),$,ne;if(typeof j=="string"?$=j:($=h.a.f(j.name),ne=h.a.f(j.params)),!$)throw Error("No component name specified");var be=h.i.Cb(W,O),Ce=K=++X;h.j.get($,function(me){if(K===Ce){if(H(),!me)throw Error("Unknown component '"+$+"'");b($,me,W);var _e=G(me,ne,{element:W,templateNodes:ie});me=be.createChildContext(_e,{extend:function(Ve){Ve.$component=_e,Ve.$componentTemplateNodes=ie}}),_e&&_e.koDescendantsComplete&&(Q=h.i.subscribe(W,h.i.pa,_e.koDescendantsComplete,_e)),U=_e,h.Oa(me,W)}})},null,{l:W}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var F={class:"className",for:"htmlFor"};h.c.attr={update:function(b,G){var X=h.a.f(G())||{};h.a.P(X,function(W,A){A=h.a.f(A);var k=W.indexOf(":"),k="lookupNamespaceURI"in b&&0<k&&b.lookupNamespaceURI(W.substr(0,k)),B=A===!1||A===null||A===e;B?k?b.removeAttributeNS(k,W):b.removeAttribute(W):A=A.toString(),8>=h.a.W&&W in F?(W=F[W],B?b.removeAttribute(W):b[W]=A):B||(k?b.setAttributeNS(k,W,A):b.setAttribute(W,A)),W==="name"&&h.a.Yc(b,B?"":A)})}},function(){h.c.checked={after:["value","attr"],init:function(b,G,X){function W(){var j=b.checked,$=k();if(!h.S.Ya()&&(j||!O&&!h.S.qa())){var ne=h.u.G(G);if(U){var be=K?ne.v():ne,Ce=ie;ie=$,Ce!==$?j&&(h.a.Na(be,$,!0),h.a.Na(be,Ce,!1)):h.a.Na(be,$,j),K&&h.Za(ne)&&ne(be)}else B&&($===e?$=j:j||($=e)),h.m.eb(ne,X,"checked",$,!0)}}function A(){var j=h.a.f(G()),$=k();U?(b.checked=0<=h.a.A(j,$),ie=$):b.checked=B&&$===e?!!j:k()===j}var k=h.xb(function(){if(X.has("checkedValue"))return h.a.f(X.get("checkedValue"));if(Q)return X.has("value")?h.a.f(X.get("value")):b.value}),B=b.type=="checkbox",O=b.type=="radio";if(B||O){var H=G(),U=B&&h.a.f(H)instanceof Array,K=!(U&&H.push&&H.splice),Q=O||U,ie=U?k():e;O&&!b.name&&h.c.uniqueName.init(b,function(){return!0}),h.o(W,null,{l:b}),h.a.B(b,"click",W),h.o(A,null,{l:b}),H=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(b,G){b.value=h.a.f(G())}}}(),h.c.class={update:function(b,G){var X=h.a.Db(h.a.f(G()));h.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=X,h.a.Eb(b,X,!0)}},h.c.css={update:function(b,G){var X=h.a.f(G());X!==null&&typeof X=="object"?h.a.P(X,function(W,A){A=h.a.f(A),h.a.Eb(b,W,A)}):h.c.class.update(b,G)}},h.c.enable={update:function(b,G){var X=h.a.f(G());X&&b.disabled?b.removeAttribute("disabled"):X||b.disabled||(b.disabled=!0)}},h.c.disable={update:function(b,G){h.c.enable.update(b,function(){return!h.a.f(G())})}},h.c.event={init:function(b,G,X,W,A){var k=G()||{};h.a.P(k,function(B){typeof B=="string"&&h.a.B(b,B,function(O){var H,U=G()[B];if(U){try{var K=h.a.la(arguments);W=A.$data,K.unshift(W),H=U.apply(W,K)}finally{H!==!0&&(O.preventDefault?O.preventDefault():O.returnValue=!1)}X.get(B+"Bubble")===!1&&(O.cancelBubble=!0,O.stopPropagation&&O.stopPropagation())}})})}},h.c.foreach={Rc:function(b){return function(){var G=b(),X=h.a.bc(G);return!X||typeof X.length=="number"?{foreach:G,templateEngine:h.ba.Ma}:(h.a.f(G),{foreach:X.data,as:X.as,noChildContext:X.noChildContext,includeDestroyed:X.includeDestroyed,afterAdd:X.afterAdd,beforeRemove:X.beforeRemove,afterRender:X.afterRender,beforeMove:X.beforeMove,afterMove:X.afterMove,templateEngine:h.ba.Ma})}},init:function(b,G){return h.c.template.init(b,h.c.foreach.Rc(G))},update:function(b,G,X,W,A){return h.c.template.update(b,h.c.foreach.Rc(G),X,W,A)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(b,G,X){function W(B){b.__ko_hasfocusUpdating=!0;var O=b.ownerDocument;if("activeElement"in O){var H;try{H=O.activeElement}catch{H=O.body}B=H===b}O=G(),h.m.eb(O,X,"hasfocus",B,!0),b.__ko_hasfocusLastValue=B,b.__ko_hasfocusUpdating=!1}var A=W.bind(null,!0),k=W.bind(null,!1);h.a.B(b,"focus",A),h.a.B(b,"focusin",A),h.a.B(b,"blur",k),h.a.B(b,"focusout",k),b.__ko_hasfocusLastValue=!1},update:function(b,G){var X=!!h.a.f(G());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===X||(X?b.focus():b.blur(),!X&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[b,X?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,G){h.a.fc(b,G())}},function(){function b(G,X,W){h.c[G]={init:function(A,k,B,O,H){var U,K,Q={},ie,j,$;if(X){O=B.get("as");var ne=B.get("noChildContext");$=!(O&&ne),Q={as:O,noChildContext:ne,exportDependencies:$}}return j=(ie=B.get("completeOn")=="render")||B.has(h.i.pa),h.o(function(){var be=h.a.f(k()),Ce=!W!=!be,me=!K,_e;($||Ce!==U)&&(j&&(H=h.i.Cb(A,H)),Ce&&((!X||$)&&(Q.dataDependency=h.S.o()),_e=X?H.createChildContext(typeof be=="function"?be:k,Q):h.S.qa()?H.extend(null,Q):H),me&&h.S.qa()&&(K=h.a.Ca(h.h.childNodes(A),!0)),Ce?(me||h.h.va(A,h.a.Ca(K)),h.Oa(_e,A)):(h.h.Ea(A),ie||h.i.ma(A,h.i.H)),U=Ce)},null,{l:A}),{controlsDescendantBindings:!0}}},h.m.Ra[G]=!1,h.h.ea[G]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),h.c.let={init:function(b,G,X,W,A){return G=A.extend(G),h.Oa(G,b),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var N={};h.c.options={init:function(b){if(h.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,G,X){function W(){return h.a.jb(b.options,function(ne){return ne.selected})}function A(ne,be,Ce){var me=typeof be;return me=="function"?be(ne):me=="string"?ne[be]:Ce}function k(ne,be){if(j&&U)h.i.ma(b,h.i.H);else if(ie.length){var Ce=0<=h.a.A(ie,h.w.M(be[0]));h.a.Zc(be[0],Ce),j&&!Ce&&h.u.G(h.a.Fb,null,[b,"change"])}}var B=b.multiple,O=b.length!=0&&B?b.scrollTop:null,H=h.a.f(G()),U=X.get("valueAllowUnset")&&X.has("value"),K=X.get("optionsIncludeDestroyed");G={};var Q,ie=[];U||(B?ie=h.a.Mb(W(),h.w.M):0<=b.selectedIndex&&ie.push(h.w.M(b.options[b.selectedIndex]))),H&&(typeof H.length>"u"&&(H=[H]),Q=h.a.jb(H,function(ne){return K||ne===e||ne===null||!h.a.f(ne._destroy)}),X.has("optionsCaption")&&(H=h.a.f(X.get("optionsCaption")),H!==null&&H!==e&&Q.unshift(N)));var j=!1;if(G.beforeRemove=function(ne){b.removeChild(ne)},H=k,X.has("optionsAfterRender")&&typeof X.get("optionsAfterRender")=="function"&&(H=function(ne,be){k(0,be),h.u.G(X.get("optionsAfterRender"),null,[be[0],ne!==N?ne:e])}),h.a.ec(b,Q,function(ne,be,Ce){return Ce.length&&(ie=!U&&Ce[0].selected?[h.w.M(Ce[0])]:[],j=!0),be=b.ownerDocument.createElement("option"),ne===N?(h.a.Bb(be,X.get("optionsCaption")),h.w.cb(be,e)):(Ce=A(ne,X.get("optionsValue"),ne),h.w.cb(be,h.a.f(Ce)),ne=A(ne,X.get("optionsText"),Ce),h.a.Bb(be,ne)),[be]},G,H),!U){var $;B?$=ie.length&&W().length<ie.length:$=ie.length&&0<=b.selectedIndex?h.w.M(b.options[b.selectedIndex])!==ie[0]:ie.length||0<=b.selectedIndex,$&&h.u.G(h.a.Fb,null,[b,"change"])}(U||h.S.Ya())&&h.i.ma(b,h.i.H),h.a.wd(b),O&&20<Math.abs(O-b.scrollTop)&&(b.scrollTop=O)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(b,G,X){function W(){var B=G(),O=[];h.a.D(b.getElementsByTagName("option"),function(H){H.selected&&O.push(h.w.M(H))}),h.m.eb(B,X,"selectedOptions",O)}function A(){var B=h.a.f(G()),O=b.scrollTop;B&&typeof B.length=="number"&&h.a.D(b.getElementsByTagName("option"),function(H){var U=0<=h.a.A(B,h.w.M(H));H.selected!=U&&h.a.Zc(H,U)}),b.scrollTop=O}if(h.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var k;h.i.subscribe(b,h.i.H,function(){k?W():(h.a.B(b,"change",W),k=h.o(A,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(b,G){var X=h.a.f(G()||{});h.a.P(X,function(W,A){if(A=h.a.f(A),(A===null||A===e||A===!1)&&(A=""),o)o(b).css(W,A);else if(/^--/.test(W))b.style.setProperty(W,A);else{W=W.replace(/-(\w)/g,function(B,O){return O.toUpperCase()});var k=b.style[W];b.style[W]=A,A===k||b.style[W]!=k||isNaN(A)||(b.style[W]=A+"px")}})}},h.c.submit={init:function(b,G,X,W,A){if(typeof G()!="function")throw Error("The value for a submit binding must be a function");h.a.B(b,"submit",function(k){var B,O=G();try{B=O.call(A.$data,b)}finally{B!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,G){h.a.Bb(b,G())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(Q){if(Q)return parseFloat(Q[1])},G=t.navigator.userAgent,X,W,A,k,B;(X=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(B=b(G.match(/Edge\/([^ ]+)$/)))||b(G.match(/Chrome\/([^ ]+)/))||(W=b(G.match(/Version\/([^ ]+) Safari/)))||(A=b(G.match(/Firefox\/([^ ]+)/)))||(k=h.a.W||b(G.match(/MSIE ([^ ]+)/)))||(k=b(G.match(/rv:([^ )]+)/)))}if(8<=k&&10>k)var O=h.a.g.Z(),H=h.a.g.Z(),U=function(Q){var ie=this.activeElement;(ie=ie&&h.a.g.get(ie,H))&&ie(Q)},K=function(Q,ie){var j=Q.ownerDocument;h.a.g.get(j,O)||(h.a.g.set(j,O,!0),h.a.B(j,"selectionchange",U)),h.a.g.set(Q,H,ie)};h.c.textInput={init:function(Q,ie,j){function $(De,Ke){h.a.B(Q,De,Ke)}function ne(){var De=h.a.f(ie());(De===null||De===e)&&(De=""),Ve!==e&&De===Ve?h.a.setTimeout(ne,4):Q.value!==De&&(Ze=!0,Q.value=De,Ze=!1,me=Q.value)}function be(){_e||(Ve=Q.value,_e=h.a.setTimeout(Ce,4))}function Ce(){clearTimeout(_e),Ve=_e=e;var De=Q.value;me!==De&&(me=De,h.m.eb(ie(),j,"textInput",De))}var me=Q.value,_e,Ve,Ie=h.a.W==9?be:Ce,Ze=!1;k&&$("keypress",Ce),11>k&&$("propertychange",function(De){Ze||De.propertyName!=="value"||Ie(De)}),k==8&&($("keyup",Ce),$("keydown",Ce)),K&&(K(Q,Ie),$("dragend",be)),(!k||9<=k)&&$("input",Ie),5>W&&h.a.R(Q)==="textarea"?($("keydown",be),$("paste",be),$("cut",be)):11>X?$("keydown",be):4>A?($("DOMAutoComplete",Ce),$("dragdrop",Ce),$("drop",Ce)):B&&Q.type==="number"&&$("keydown",be),$("change",Ce),$("blur",Ce),h.o(ne,null,{l:Q})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(Q,ie,j){j("textInput",Q)}}}(),h.c.uniqueName={init:function(b,G){if(G()){var X="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(b,X)}}},h.c.uniqueName.rd=0,h.c.using={init:function(b,G,X,W,A){var k;return X.has("as")&&(k={as:X.get("as"),noChildContext:X.get("noChildContext")}),G=A.createChildContext(G,k),h.Oa(G,b),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(b,G,X){var W=h.a.R(b),A=W=="input";if(!A||b.type!="checkbox"&&b.type!="radio"){var k=[],B=X.get("valueUpdate"),O=!1,H=null;B&&(typeof B=="string"?k=[B]:k=h.a.wc(B),h.a.Pa(k,"change"));var U=function(){H=null,O=!1;var ie=G(),j=h.w.M(b);h.m.eb(ie,X,"value",j)};!h.a.W||!A||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||h.a.A(k,"propertychange")!=-1||(h.a.B(b,"propertychange",function(){O=!0}),h.a.B(b,"focus",function(){O=!1}),h.a.B(b,"blur",function(){O&&U()})),h.a.D(k,function(ie){var j=U;h.a.Ud(ie,"after")&&(j=function(){H=h.w.M(b),h.a.setTimeout(U,0)},ie=ie.substring(5)),h.a.B(b,ie,j)});var K;if(K=A&&b.type=="file"?function(){var ie=h.a.f(G());ie===null||ie===e||ie===""?b.value="":h.u.G(U)}:function(){var ie=h.a.f(G()),j=h.w.M(b);H!==null&&ie===H?h.a.setTimeout(K,0):(ie!==j||j===e)&&(W==="select"?(j=X.get("valueAllowUnset"),h.w.cb(b,ie,j),j||ie===h.w.M(b)||h.u.G(U)):h.w.cb(b,ie))},W==="select"){var Q;h.i.subscribe(b,h.i.H,function(){Q?X.get("valueAllowUnset")?K():U():(h.a.B(b,"change",U),Q=h.o(K,null,{l:b}))},null,{notifyImmediately:!0})}else h.a.B(b,"change",U),h.o(K,null,{l:b})}else h.ib(b,{checkedValue:G})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(b,G){var X=h.a.f(G()),W=b.style.display!="none";X&&!W?b.style.display="":!X&&W&&(b.style.display="none")}},h.c.hidden={update:function(b,G){h.c.visible.update(b,function(){return!h.a.f(G())})}},function(b){h.c[b]={init:function(G,X,W,A,k){return h.c.event.init.call(this,G,function(){var B={};return B[b]=X(),B},W,A,k)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(b,G){if(typeof b=="string"){G=G||n;var X=G.getElementById(b);if(!X)throw Error("Cannot find template with ID "+b);return new h.C.F(X)}if(b.nodeType==1||b.nodeType==8)return new h.C.ia(b);throw Error("Unknown template type: "+b)},h.ca.prototype.renderTemplate=function(b,G,X,W){return b=this.makeTemplateSource(b,W),this.renderTemplateSource(b,G,X,W)},h.ca.prototype.isTemplateRewritten=function(b,G){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,G).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(b,G,X){b=this.makeTemplateSource(b,X),G=G(b.text()),b.text(G),b.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function b(W,A,k,B){W=h.m.ac(W);for(var O=h.m.Ra,H=0;H<W.length;H++){var U=W[H].key;if(Object.prototype.hasOwnProperty.call(O,U)){var K=O[U];if(typeof K=="function"){if(U=K(W[H].value))throw Error(U)}else if(!K)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return k="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(W,{valueAccessors:!0})+" } })()},'"+k.toLowerCase()+"')",B.createJavaScriptEvaluatorBlock(k)+A}var G=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,X=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(W,A,k){A.isTemplateRewritten(W,k)||A.rewriteTemplate(W,function(B){return h.kc.Ld(B,A)},k)},Ld:function(W,A){return W.replace(G,function(k,B,O,H,U){return b(U,B,O,A)}).replace(X,function(k,B){return b(B,"<!-- ko -->","#comment",A)})},md:function(W,A){return h.aa.Xb(function(k,B){var O=k.nextSibling;O&&O.nodeName.toLowerCase()===A&&h.ib(O,W,B)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(X){if(this.F=X){var W=h.a.R(X);this.ab=W==="script"?1:W==="textarea"?2:W=="template"&&X.content&&X.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var X=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[X];var W=arguments[0];X==="innerHTML"?h.a.fc(this.F,W):this.F[X]=W};var b=h.a.g.Z()+"_";h.C.F.prototype.data=function(X){if(arguments.length===1)return h.a.g.get(this.F,b+X);h.a.g.set(this.F,b+X,arguments[1])};var G=h.a.g.Z();h.C.F.prototype.nodes=function(){var X=this.F;if(arguments.length==0){var W=h.a.g.get(X,G)||{},A=W.lb||(this.ab===3?X.content:this.ab===4?X:e);if(!A||W.jd){var k=this.text();k&&k!==W.bb&&(A=h.a.Md(k,X.ownerDocument),h.a.g.set(X,G,{lb:A,bb:k,jd:!0}))}return A}W=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(X,G,{lb:W})},h.C.ia=function(X){this.F=X},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var X=h.a.g.get(this.F,G)||{};return X.bb===e&&X.lb&&(X.bb=X.lb.innerHTML),X.bb}h.a.g.set(this.F,G,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function b(H,U,K){var Q;for(U=h.h.nextSibling(U);H&&(Q=H)!==U;)H=h.h.nextSibling(Q),K(Q,H)}function G(H,U){if(H.length){var K=H[0],Q=H[H.length-1],ie=K.parentNode,j=h.ga.instance,$=j.preprocessNode;if($){if(b(K,Q,function(ne,be){var Ce=ne.previousSibling,me=$.call(j,ne);me&&(ne===K&&(K=me[0]||be),ne===Q&&(Q=me[me.length-1]||Ce))}),H.length=0,!K)return;K===Q?H.push(K):(H.push(K,Q),h.a.Ua(H,ie))}b(K,Q,function(ne){ne.nodeType!==1&&ne.nodeType!==8||h.vc(U,ne)}),b(K,Q,function(ne){ne.nodeType!==1&&ne.nodeType!==8||h.aa.cd(ne,[U])}),h.a.Ua(H,ie)}}function X(H){return H.nodeType?H:0<H.length?H[0]:null}function W(H,U,K,Q,ie){ie=ie||{};var j=(H&&X(H)||K||{}).ownerDocument,$=ie.templateEngine||k;if(h.kc.xd(K,$,j),K=$.renderTemplate(K,Q,ie,j),typeof K.length!="number"||0<K.length&&typeof K[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(j=!1,U){case"replaceChildren":h.h.va(H,K),j=!0;break;case"replaceNode":h.a.Xc(H,K),j=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return j&&(G(K,Q),ie.afterRender&&h.u.G(ie.afterRender,null,[K,Q[ie.as||"$data"]]),U=="replaceChildren"&&h.i.ma(H,h.i.H)),K}function A(H,U,K){return h.O(H)?H():typeof H=="function"?H(U,K):H}var k;h.gc=function(H){if(H!=e&&!(H instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");k=H},h.dc=function(H,U,K,Q,ie){if(K=K||{},(K.templateEngine||k)==e)throw Error("Set a template engine before calling renderTemplate");if(ie=ie||"replaceChildren",Q){var j=X(Q);return h.$(function(){var ne=U&&U instanceof h.fa?U:new h.fa(U,null,null,null,{exportDependencies:!0}),$=A(H,ne.$data,ne),ne=W(Q,ie,$,ne,K);ie=="replaceNode"&&(Q=ne,j=X(Q))},null,{Sa:function(){return!j||!h.a.Sb(j)},l:j&&ie=="replaceNode"?j.parentNode:j})}return h.aa.Xb(function($){h.dc(H,U,K,$,"replaceNode")})},h.Qd=function(H,U,K,Q,ie){function j(Ve,Ie){h.u.G(h.a.ec,null,[Q,Ve,ne,K,$,Ie]),h.i.ma(Q,h.i.H)}function $(Ve,Ie){G(Ie,be),K.afterRender&&K.afterRender(Ie,Ve),be=null}function ne(Ve,Ie){be=ie.createChildContext(Ve,{as:Ce,noChildContext:K.noChildContext,extend:function(De){De.$index=Ie,Ce&&(De[Ce+"Index"]=Ie)}});var Ze=A(H,Ve,be);return W(Q,"ignoreTargetNode",Ze,be,K)}var be,Ce=K.as,me=K.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!K.includeDestroyed;if(me||K.beforeRemove||!h.Pc(U))return h.$(function(){var Ve=h.a.f(U)||[];typeof Ve.length>"u"&&(Ve=[Ve]),me&&(Ve=h.a.jb(Ve,function(Ie){return Ie===e||Ie===null||!h.a.f(Ie._destroy)})),j(Ve)},null,{l:Q});j(U.v());var _e=U.subscribe(function(Ve){j(U(),Ve)},null,"arrayChange");return _e.l(Q),_e};var B=h.a.g.Z(),O=h.a.g.Z();h.c.template={init:function(H,U){var K=h.a.f(U());if(typeof K=="string"||"name"in K)h.h.Ea(H);else if("nodes"in K){if(K=K.nodes||[],h.O(K))throw Error('The "nodes" option must be a plain, non-observable array.');var Q=K[0]&&K[0].parentNode;Q&&h.a.g.get(Q,O)||(Q=h.a.Yb(K),h.a.g.set(Q,O,!0)),new h.C.ia(H).nodes(Q)}else if(K=h.h.childNodes(H),0<K.length)Q=h.a.Yb(K),new h.C.ia(H).nodes(Q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(H,U,K,Q,ie){var j=U();U=h.a.f(j),K=!0,Q=null,typeof U=="string"?U={}:(j="name"in U?U.name:H,"if"in U&&(K=h.a.f(U.if)),K&&"ifnot"in U&&(K=!h.a.f(U.ifnot)),K&&!j&&(K=!1)),"foreach"in U?Q=h.Qd(j,K&&U.foreach||[],U,H,ie):K?(K=ie,"data"in U&&(K=ie.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),Q=h.dc(j,K,U,H)):h.h.Ea(H),ie=Q,(U=h.a.g.get(H,B))&&typeof U.s=="function"&&U.s(),h.a.g.set(H,B,!ie||ie.ja&&!ie.ja()?e:ie)}},h.m.Ra.template=function(H){return H=h.m.ac(H),H.length==1&&H[0].unknown||h.m.Id(H,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(b,G,X){if(b.length&&G.length){var W,A,k,B,O;for(W=A=0;(!X||W<X)&&(B=b[A]);++A){for(k=0;O=G[k];++k)if(B.value===O.value){B.moved=O.index,O.moved=B.index,G.splice(k,1),W=k=0;break}W+=k}}},h.a.Pb=function(){function b(G,X,W,A,k){var B=Math.min,O=Math.max,H=[],U,K=G.length,Q,ie=X.length,j=ie-K||1,$=K+ie+1,ne,be,Ce;for(U=0;U<=K;U++)for(be=ne,H.push(ne=[]),Ce=B(ie,U+j),Q=O(0,U-1);Q<=Ce;Q++)ne[Q]=Q?U?G[U-1]===X[Q-1]?be[Q-1]:B(be[Q]||$,ne[Q-1]||$)+1:Q+1:U+1;for(B=[],O=[],j=[],U=K,Q=ie;U||Q;)ie=H[U][Q]-1,Q&&ie===H[U][Q-1]?O.push(B[B.length]={status:W,value:X[--Q],index:Q}):U&&ie===H[U-1][Q]?j.push(B[B.length]={status:A,value:G[--U],index:U}):(--Q,--U,k.sparse||B.push({status:"retained",value:X[Q]}));return h.a.Kc(j,O,!k.dontLimitMoves&&10*K),B.reverse()}return function(G,X,W){return W=typeof W=="boolean"?{dontLimitMoves:W}:W||{},G=G||[],X=X||[],G.length<X.length?b(G,X,"added","deleted",W):b(X,G,"deleted","added",W)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function b(W,A,k,B,O){var H=[],U=h.$(function(){var K=A(k,O,h.a.Ua(H,W))||[];0<H.length&&(h.a.Xc(H,K),B&&h.u.G(B,null,[k,K,O])),H.length=0,h.a.Nb(H,K)},null,{l:W,Sa:function(){return!h.a.kd(H)}});return{Y:H,$:U.ja()?U:e}}var G=h.a.g.Z(),X=h.a.g.Z();h.a.ec=function(W,A,k,B,O,H){function U(Lt){Ze={Aa:Lt,pb:h.ta(be++)},$.push(Ze),j||Ie.push(Ze)}function K(Lt){Ze=ie[Lt],be!==Ze.pb.v()&&Ve.push(Ze),Ze.pb(be++),h.a.Ua(Ze.Y,W),$.push(Ze)}function Q(Lt,Vi){if(Lt)for(var ln=0,ge=Vi.length;ln<ge;ln++)h.a.D(Vi[ln].Y,function(Le){Lt(Le,ln,Vi[ln].Aa)})}A=A||[],typeof A.length>"u"&&(A=[A]),B=B||{};var ie=h.a.g.get(W,G),j=!ie,$=[],ne=0,be=0,Ce=[],me=[],_e=[],Ve=[],Ie=[],Ze,De=0;if(j)h.a.D(A,U);else{if(!H||ie&&ie._countWaitingForRemove){var Ke=h.a.Mb(ie,function(Lt){return Lt.Aa});H=h.a.Pb(Ke,A,{dontLimitMoves:B.dontLimitMoves,sparse:!0})}for(var Ke=0,rt,Xt,Ht;rt=H[Ke];Ke++)switch(Xt=rt.moved,Ht=rt.index,rt.status){case"deleted":for(;ne<Ht;)K(ne++);Xt===e&&(Ze=ie[ne],Ze.$&&(Ze.$.s(),Ze.$=e),h.a.Ua(Ze.Y,W).length&&(B.beforeRemove&&($.push(Ze),De++,Ze.Aa===X?Ze=null:_e.push(Ze)),Ze&&Ce.push.apply(Ce,Ze.Y))),ne++;break;case"added":for(;be<Ht;)K(ne++);Xt!==e?(me.push($.length),K(Xt)):U(rt.value)}for(;be<A.length;)K(ne++);$._countWaitingForRemove=De}h.a.g.set(W,G,$),Q(B.beforeMove,Ve),h.a.D(Ce,B.beforeRemove?h.oa:h.removeNode);var qe,mn,Dt;try{Dt=W.ownerDocument.activeElement}catch{}if(me.length)for(;(Ke=me.shift())!=e;){for(Ze=$[Ke],qe=e;Ke;)if((mn=$[--Ke].Y)&&mn.length){qe=mn[mn.length-1];break}for(A=0;ne=Ze.Y[A];qe=ne,A++)h.h.Wb(W,ne,qe)}for(Ke=0;Ze=$[Ke];Ke++){for(Ze.Y||h.a.extend(Ze,b(W,k,Ze.Aa,O,Ze.pb)),A=0;ne=Ze.Y[A];qe=ne,A++)h.h.Wb(W,ne,qe);!Ze.Ed&&O&&(O(Ze.Aa,Ze.Y,Ze.pb),Ze.Ed=!0,qe=Ze.Y[Ze.Y.length-1])}for(Dt&&W.ownerDocument.activeElement!=Dt&&Dt.focus(),Q(B.beforeRemove,_e),Ke=0;Ke<_e.length;++Ke)_e[Ke].Aa=X;Q(B.afterMove,Ve),Q(B.afterAdd,Ie)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(b,G,X,W){return(G=!(9>h.a.W)&&b.nodes?b.nodes():null)?h.a.la(G.cloneNode(!0).childNodes):(b=b.text(),h.a.ua(b,W))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var G=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(X,W,A,k){if(k=k||n,A=A||{},2>G)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var B=X.data("precompiled");return B||(B=X.text()||"",B=o.template(null,"{{ko_with $item.koBindingContext}}"+B+"{{/ko_with}}"),X.data("precompiled",B)),X=[W.$data],W=o.extend({koBindingContext:W},A.templateOptions),W=o.tmpl(B,X,W),W.appendTo(k.createElement("div")),o.fragments={},W},this.createJavaScriptEvaluatorBlock=function(X){return"{{ko_code ((function() { return "+X+" })()) }}"},this.addTemplate=function(X,W){n.write("<script type='text/html' id='"+X+"'>"+W+"<\/script>")},0<G&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var b=new h.$a;0<b.Hd&&h.gc(b),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var f1t=ko;typeof window<"u"?(ko=window.ko,typeof lM<"u"?window.ko=lM:delete window.ko):(ko=global.ko,typeof lM<"u"?global.ko=lM:delete global.ko);var vS=f1t;var V2o=_(T(),1);/** + */(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(g,V){return g===null||typeof g in y?g===V:!1}function d(g,V){var G;return function(){G||(G=f.a.setTimeout(function(){G=e,g()},V))}}function u(g,V){var G;return function(){clearTimeout(G),G=f.a.setTimeout(g,V)}}function m(g,V){V&&V!=="change"?V==="beforeChange"?this.pc(g):this.gb(g,V):this.qc(g)}function p(g,V){V!==null&&V.s&&V.s()}function b(g,V){var G=this.qd,v=G[C];v.ra||(this.Qb&&this.mb[V]?(G.uc(V,g,this.mb[V]),this.mb[V]=null,--this.Qb):v.I[V]||G.uc(V,g,v.J?{da:g}:G.$c(g)),g.Ja&&g.gd())}var f=typeof s<"u"?s:{};f.b=function(g,V){for(var G=g.split("."),v=f,X=0;X<G.length-1;X++)v=v[G[X]];v[G[G.length-1]]=V},f.L=function(g,V,G){g[V]=G},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=(function(){function g(H,$){for(var ee in H)X.call(H,ee)&&$(ee,H[ee])}function V(H,$){if($)for(var ee in $)X.call($,ee)&&(H[ee]=$[ee]);return H}function G(H,$){return H.__proto__=$,H}function v(H,$,ee,le){var _e=H[$].match(K)||[];f.a.D(ee.match(K),function(he){f.a.Na(_e,he,le)}),H[$]=_e.join(" ")}var X=Object.prototype.hasOwnProperty,Y={__proto__:[]}instanceof Array,D=typeof Symbol=="function",w={},O={};w[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],w.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(w,function(H,$){if($.length)for(var ee=0,le=$.length;ee<le;ee++)O[$[ee]]=H});var M={propertychange:!0},z=n&&(function(){for(var H=3,$=n.createElement("div"),ee=$.getElementsByTagName("i");$.innerHTML="<!--[if gt IE "+ ++H+"]><i></i><![endif]-->",ee[0];);return 4<H?H:e})(),K=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(H,$,ee){for(var le=0,_e=H.length;le<_e;le++)$.call(ee,H[le],le,H)},A:typeof Array.prototype.indexOf=="function"?function(H,$){return Array.prototype.indexOf.call(H,$)}:function(H,$){for(var ee=0,le=H.length;ee<le;ee++)if(H[ee]===$)return ee;return-1},Lb:function(H,$,ee){for(var le=0,_e=H.length;le<_e;le++)if($.call(ee,H[le],le,H))return H[le];return e},Pa:function(H,$){var ee=f.a.A(H,$);0<ee?H.splice(ee,1):ee===0&&H.shift()},wc:function(H){var $=[];return H&&f.a.D(H,function(ee){0>f.a.A($,ee)&&$.push(ee)}),$},Mb:function(H,$,ee){var le=[];if(H)for(var _e=0,he=H.length;_e<he;_e++)le.push($.call(ee,H[_e],_e));return le},jb:function(H,$,ee){var le=[];if(H)for(var _e=0,he=H.length;_e<he;_e++)$.call(ee,H[_e],_e)&&le.push(H[_e]);return le},Nb:function(H,$){if($ instanceof Array)H.push.apply(H,$);else for(var ee=0,le=$.length;ee<le;ee++)H.push($[ee]);return H},Na:function(H,$,ee){var le=f.a.A(f.a.bc(H),$);0>le?ee&&H.push($):ee||H.splice(le,1)},Ba:Y,extend:V,setPrototypeOf:G,Ab:Y?G:V,P:g,Ga:function(H,$,ee){if(!H)return H;var le={},_e;for(_e in H)X.call(H,_e)&&(le[_e]=$.call(ee,H[_e],_e,H));return le},Tb:function(H){for(;H.firstChild;)f.removeNode(H.firstChild)},Yb:function(H){H=f.a.la(H);for(var $=(H[0]&&H[0].ownerDocument||n).createElement("div"),ee=0,le=H.length;ee<le;ee++)$.appendChild(f.oa(H[ee]));return $},Ca:function(H,$){for(var ee=0,le=H.length,_e=[];ee<le;ee++){var he=H[ee].cloneNode(!0);_e.push($?f.oa(he):he)}return _e},va:function(H,$){if(f.a.Tb(H),$)for(var ee=0,le=$.length;ee<le;ee++)H.appendChild($[ee])},Xc:function(H,$){var ee=H.nodeType?[H]:H;if(0<ee.length){for(var le=ee[0],_e=le.parentNode,he=0,Ze=$.length;he<Ze;he++)_e.insertBefore($[he],le);for(he=0,Ze=ee.length;he<Ze;he++)f.removeNode(ee[he])}},Ua:function(H,$){if(H.length){for($=$.nodeType===8&&$.parentNode||$;H.length&&H[0].parentNode!==$;)H.splice(0,1);for(;1<H.length&&H[H.length-1].parentNode!==$;)H.length--;if(1<H.length){var ee=H[0],le=H[H.length-1];for(H.length=0;ee!==le;)H.push(ee),ee=ee.nextSibling;H.push(le)}}return H},Zc:function(H,$){7>z?H.setAttribute("selected",$):H.selected=$},Db:function(H){return H===null||H===e?"":H.trim?H.trim():H.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(H,$){return H=H||"",$.length>H.length?!1:H.substring(0,$.length)===$},vd:function(H,$){if(H===$)return!0;if(H.nodeType===11)return!1;if($.contains)return $.contains(H.nodeType!==1?H.parentNode:H);if($.compareDocumentPosition)return($.compareDocumentPosition(H)&16)==16;for(;H&&H!=$;)H=H.parentNode;return!!H},Sb:function(H){return f.a.vd(H,H.ownerDocument.documentElement)},kd:function(H){return!!f.a.Lb(H,f.a.Sb)},R:function(H){return H&&H.tagName&&H.tagName.toLowerCase()},Ac:function(H){return f.onError?function(){try{return H.apply(this,arguments)}catch($){throw f.onError&&f.onError($),$}}:H},setTimeout:function(H,$){return setTimeout(f.a.Ac(H),$)},Gc:function(H){setTimeout(function(){throw f.onError&&f.onError(H),H},0)},B:function(H,$,ee){var le=f.a.Ac(ee);if(ee=M[$],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof H.addEventListener!="function")if(typeof H.attachEvent<"u"){var _e=function(Ze){le.call(H,Ze)},he="on"+$;H.attachEvent(he,_e),f.a.K.za(H,function(){H.detachEvent(he,_e)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else H.addEventListener($,le,!1);else te||(te=typeof o(H).on=="function"?"on":"bind"),o(H)[te]($,le)},Fb:function(H,$){if(!H||!H.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(H)==="input"&&H.type&&$.toLowerCase()=="click"?(ee=H.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof H.dispatchEvent=="function")ee=n.createEvent(O[$]||"HTMLEvents"),ee.initEvent($,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,H),H.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&H.click)H.click();else if(typeof H.fireEvent<"u")H.fireEvent("on"+$);else throw Error("Browser doesn't support triggering events");else o(H).trigger($)},f:function(H){return f.O(H)?H():H},bc:function(H){return f.O(H)?H.v():H},Eb:function(H,$,ee){var le;$&&(typeof H.classList=="object"?(le=H.classList[ee?"add":"remove"],f.a.D($.match(K),function(_e){le.call(H.classList,_e)})):typeof H.className.baseVal=="string"?v(H.className,"baseVal",$,ee):v(H,"className",$,ee))},Bb:function(H,$){var ee=f.a.f($);(ee===null||ee===e)&&(ee="");var le=f.h.firstChild(H);!le||le.nodeType!=3||f.h.nextSibling(le)?f.h.va(H,[H.ownerDocument.createTextNode(ee)]):le.data=ee,f.a.Ad(H)},Yc:function(H,$){if(H.name=$,7>=z)try{var ee=H.name.replace(/[&<>'"]/g,function(le){return"&#"+le.charCodeAt(0)+";"});H.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(H){9<=z&&(H=H.nodeType==1?H:H.parentNode,H.style&&(H.style.zoom=H.style.zoom))},wd:function(H){if(z){var $=H.style.width;H.style.width=0,H.style.width=$}},Pd:function(H,$){H=f.a.f(H),$=f.a.f($);for(var ee=[],le=H;le<=$;le++)ee.push(le);return ee},la:function(H){for(var $=[],ee=0,le=H.length;ee<le;ee++)$.push(H[ee]);return $},Da:function(H){return D?Symbol(H):H},Zd:z===6,$d:z===7,W:z,Lc:function(H,$){for(var ee=f.a.la(H.getElementsByTagName("input")).concat(f.a.la(H.getElementsByTagName("textarea"))),le=typeof $=="string"?function(Ze){return Ze.name===$}:function(Ze){return $.test(Ze.name)},_e=[],he=ee.length-1;0<=he;he--)le(ee[he])&&_e.push(ee[he]);return _e},Nd:function(H){return typeof H=="string"&&(H=f.a.Db(H))?r&&r.parse?r.parse(H):new Function("return "+H)():null},hc:function(H,$,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(H),$,ee)},Od:function(H,$,ee){ee=ee||{};var le=ee.params||{},_e=ee.includeFields||this.Jc,he=H;if(typeof H=="object"&&f.a.R(H)==="form")for(var he=H.action,Ze=_e.length-1;0<=Ze;Ze--)for(var ye=f.a.Lc(H,_e[Ze]),Ge=ye.length-1;0<=Ge;Ge--)le[ye[Ge].name]=ye[Ge].value;$=f.a.f($);var Ae=n.createElement("form");Ae.style.display="none",Ae.action=he,Ae.method="post";for(var Fe in $)H=n.createElement("input"),H.type="hidden",H.name=Fe,H.value=f.a.hc(f.a.f($[Fe])),Ae.appendChild(H);g(le,function(tt,Be){var je=n.createElement("input");je.type="hidden",je.name=tt,je.value=Be,Ae.appendChild(je)}),n.body.appendChild(Ae),ee.submitter?ee.submitter(Ae):Ae.submit(),setTimeout(function(){Ae.parentNode.removeChild(Ae)},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(g){var V=this;if(arguments.length===1)return function(){return V.apply(g,arguments)};var G=Array.prototype.slice.call(arguments,1);return function(){var v=G.slice(0);return v.push.apply(v,arguments),V.apply(g,v)}}),f.a.g=new function(){var g=0,V="__ko__"+new Date().getTime(),G={},v,X;return f.a.W?(v=function(Y,D){var w=Y[V];if(!w||w==="null"||!G[w]){if(!D)return e;w=Y[V]="ko"+g++,G[w]={}}return G[w]},X=function(Y){var D=Y[V];return D?(delete G[D],Y[V]=null,!0):!1}):(v=function(Y,D){var w=Y[V];return!w&&D&&(w=Y[V]={}),w},X=function(Y){return Y[V]?(delete Y[V],!0):!1}),{get:function(Y,D){var w=v(Y,!1);return w&&w[D]},set:function(Y,D,w){(Y=v(Y,w!==e))&&(Y[D]=w)},Ub:function(Y,D,w){return Y=v(Y,!0),Y[D]||(Y[D]=w)},clear:X,Z:function(){return g+++V}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function g(D,w){var O=f.a.g.get(D,v);return O===e&&w&&(O=[],f.a.g.set(D,v,O)),O}function V(D){var w=g(D,!1);if(w)for(var w=w.slice(0),O=0;O<w.length;O++)w[O](D);f.a.g.clear(D),f.a.K.cleanExternalData(D),Y[D.nodeType]&&G(D.childNodes,!0)}function G(D,w){for(var O=[],M,z=0;z<D.length;z++)if((!w||D[z].nodeType===8)&&(V(O[O.length]=M=D[z]),D[z]!==M))for(;z--&&f.a.A(O,D[z])==-1;);}var v=f.a.g.Z(),X={1:!0,8:!0,9:!0},Y={1:!0,9:!0};return{za:function(D,w){if(typeof w!="function")throw Error("Callback must be a function");g(D,!0).push(w)},yb:function(D,w){var O=g(D,!1);O&&(f.a.Pa(O,w),O.length==0&&f.a.g.set(D,v,e))},oa:function(D){return f.u.G(function(){X[D.nodeType]&&(V(D),Y[D.nodeType]&&G(D.getElementsByTagName("*")))}),D},removeNode:function(D){f.oa(D),D.parentNode&&D.parentNode.removeChild(D)},cleanExternalData:function(D){o&&typeof o.cleanData=="function"&&o.cleanData([D])}}},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 g=[0,"",""],V=[1,"<table>","</table>"],G=[3,"<table><tbody><tr>","</tr></tbody></table>"],v=[1,"<select multiple='multiple'>","</select>"],X={thead:V,tbody:V,tfoot:V,tr:[2,"<table><tbody>","</tbody></table>"],td:G,th:G,option:v,optgroup:v},Y=8>=f.a.W;f.a.ua=function(D,w){var O;if(o){if(o.parseHTML)O=o.parseHTML(D,w)||[];else if((O=o.clean([D],w))&&O[0]){for(var M=O[0];M.parentNode&&M.parentNode.nodeType!==11;)M=M.parentNode;M.parentNode&&M.parentNode.removeChild(M)}}else{(O=w)||(O=n);var M=O.parentWindow||O.defaultView||t,z=f.a.Db(D).toLowerCase(),K=O.createElement("div"),te;for(te=(z=z.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&X[z[1]]||g,z=te[0],te="ignored<div>"+te[1]+D+te[2]+"</div>",typeof M.innerShiv=="function"?K.appendChild(M.innerShiv(te)):(Y&&O.body.appendChild(K),K.innerHTML=te,Y&&K.parentNode.removeChild(K));z--;)K=K.lastChild;O=f.a.la(K.lastChild.childNodes)}return O},f.a.Md=function(D,w){var O=f.a.ua(D,w);return O.length&&O[0].parentElement||f.a.Yb(O)},f.a.fc=function(D,w){if(f.a.Tb(D),w=f.a.f(w),w!==null&&w!==e)if(typeof w!="string"&&(w=w.toString()),o)o(D).html(w);else for(var O=f.a.ua(w,D.ownerDocument),M=0;M<O.length;M++)D.appendChild(O[M])}})(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=(function(){function g(G,v){if(G){if(G.nodeType==8){var X=f.aa.Uc(G.nodeValue);X!=null&&v.push({ud:G,Kd:X})}else if(G.nodeType==1)for(var X=0,Y=G.childNodes,D=Y.length;X<D;X++)g(Y[X],v)}}var V={};return{Xb:function(G){if(typeof G!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var v=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return V[v]=G,"<!--[ko_memo:"+v+"]-->"},bd:function(G,v){var X=V[G];if(X===e)throw Error("Couldn't find any memo with ID "+G+". Perhaps it's already been unmemoized.");try{return X.apply(null,v||[]),!0}finally{delete V[G]}},cd:function(G,v){var X=[];g(G,X);for(var Y=0,D=X.length;Y<D;Y++){var w=X[Y].ud,O=[w];v&&f.a.Nb(O,v),f.aa.bd(X[Y].Kd,O),w.nodeValue="",w.parentNode&&w.parentNode.removeChild(w)}},Uc:function(G){return(G=G.match(/^\[ko_memo\:(.*?)\]$/))?G[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 g(){if(X){for(var w=X,O=0,M;D<X;)if(M=v[D++]){if(D>w){if(5e3<=++O){D=X,f.a.Gc(Error("'Too much recursion' after processing "+O+" task groups."));break}w=X}try{M()}catch(z){f.a.Gc(z)}}}}function V(){g(),D=X=v.length=0}var G,v=[],X=0,Y=1,D=0;return t.MutationObserver?G=(function(w){var O=n.createElement("div");return new MutationObserver(w).observe(O,{attributes:!0}),function(){O.classList.toggle("foo")}})(V):G=n&&"onreadystatechange"in n.createElement("script")?function(w){var O=n.createElement("script");O.onreadystatechange=function(){O.onreadystatechange=null,n.documentElement.removeChild(O),O=null,w()},n.documentElement.appendChild(O)}:function(w){setTimeout(w,0)},{scheduler:G,zb:function(w){return X||f.na.scheduler(V),v[X++]=w,Y++},cancel:function(w){w=w-(Y-X),w>=D&&w<X&&(v[w]=null)},resetForTesting:function(){var w=X-D;return D=X=v.length=0,w},Sd:g}})(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(g,V){g.throttleEvaluation=V;var G=null;return f.$({read:g,write:function(v){clearTimeout(G),G=f.a.setTimeout(function(){g(v)},V)}})},rateLimit:function(g,V){var G,v,X;typeof V=="number"?G=V:(G=V.timeout,v=V.method),g.Hb=!1,X=typeof v=="function"?v:v=="notifyWhenChangesStop"?u:d,g.ub(function(Y){return X(Y,G,V)})},deferred:function(g,V){if(V!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(G){var v,X=!1;return function(){if(!X){f.na.cancel(v),v=f.na.zb(G);try{X=!0,g.notifySubscribers(e,"dirty")}finally{X=!1}}}}))},notify:function(g,V){g.equalityComparer=V=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(g,V,G){this.da=g,this.lc=V,this.mc=G,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(g){this.Jb=g,f.a.K.za(g,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,V,G){var v=this;G=G||"change";var X=new f.ic(v,V?g.bind(V):g,function(){f.a.Pa(v.U[G],X),v.hb&&v.hb(G)});return v.Qa&&v.Qa(G),v.U[G]||(v.U[G]=[]),v.U[G].push(X),X},notifySubscribers:function(g,V){if(V=V||"change",V==="change"&&this.Gb(),this.Wa(V)){var G=V==="change"&&this.ed||this.U[V].slice(0);try{f.u.xc();for(var v=0,X;X=G[v];++v)X.Ib||X.lc(g)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var V=this,G=f.O(V),v,X,Y,D,w;V.gb||(V.gb=V.notifySubscribers,V.notifySubscribers=m);var O=g(function(){V.Ja=!1,G&&D===V&&(D=V.nc?V.nc():V());var M=X||w&&V.sb(Y,D);w=X=v=!1,M&&V.gb(Y=D)});V.qc=function(M,z){z&&V.Ja||(w=!z),V.ed=V.U.change.slice(0),V.Ja=v=!0,D=M,O()},V.pc=function(M){v||(Y=M,V.gb(M,"beforeChange"))},V.rc=function(){w=!0},V.gd=function(){V.sb(Y,V.v(!0))&&(X=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var V=0;return f.a.P(this.U,function(G,v){G!=="dirty"&&(V+=v.length)}),V},sb:function(g,V){return!this.equalityComparer||!this.equalityComparer(g,V)},toString:function(){return"[object Object]"},extend:function(g){var V=this;return g&&f.a.P(g,function(G,v){var X=f.Ta[G];typeof X=="function"&&(V=X(V,v)||V)}),V}};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(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=(function(){function g(Y){G.push(v),v=Y}function V(){v=G.pop()}var G=[],v,X=0;return{xc:g,end:V,cc:function(Y){if(v){if(!f.Qc(Y))throw Error("Only subscribable things can act as dependencies");v.od.call(v.pd,Y,Y.fd||(Y.fd=++X))}},G:function(Y,D,w){try{return g(),Y.apply(D,w||[])}finally{V()}},qa:function(){if(v)return v.o.qa()},Va:function(){if(v)return v.o.Va()},Ya:function(){if(v)return v.Ya},o:function(){if(v)return v.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 S=f.a.Da("_latestValue");f.ta=function(g){function V(){return 0<arguments.length?(V.sb(V[S],arguments[0])&&(V.ya(),V[S]=arguments[0],V.xa()),this):(f.u.cc(V),V[S])}return V[S]=g,f.a.Ba||f.a.extend(V,f.T.fn),f.T.fn.qb(V),f.a.Ab(V,Z),f.options.deferUpdates&&f.Ta.deferred(V,!0),V};var Z={equalityComparer:c,v:function(){return this[S]},xa:function(){this.notifySubscribers(this[S],"spectate"),this.notifySubscribers(this[S])},ya:function(){this.notifySubscribers(this[S],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(Z,f.T.fn);var R=f.ta.Ma="__ko_proto__";Z[R]=f.ta,f.O=function(g){if((g=typeof g=="function"&&g[R])&&g!==Z[R]&&g!==f.o.fn[R])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},f.Za=function(g){return typeof g=="function"&&(g[R]===Z[R]||g[R]===f.o.fn[R]&&g.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",Z),f.L(Z,"peek",Z.v),f.L(Z,"valueHasMutated",Z.xa),f.L(Z,"valueWillMutate",Z.ya),f.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=f.ta(g),f.a.Ab(g,f.Ha.fn),g.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(g){for(var V=this.v(),G=[],v=typeof g!="function"||f.O(g)?function(D){return D===g}:g,X=0;X<V.length;X++){var Y=V[X];if(v(Y)){if(G.length===0&&this.ya(),V[X]!==Y)throw Error("Array modified during remove; cannot remove item");G.push(Y),V.splice(X,1),X--}}return G.length&&this.xa(),G},removeAll:function(g){if(g===e){var V=this.v(),G=V.slice(0);return this.ya(),V.splice(0,V.length),this.xa(),G}return g?this.remove(function(v){return 0<=f.a.A(g,v)}):[]},destroy:function(g){var V=this.v(),G=typeof g!="function"||f.O(g)?function(Y){return Y===g}:g;this.ya();for(var v=V.length-1;0<=v;v--){var X=V[v];G(X)&&(X._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(V){return 0<=f.a.A(g,V)}):[]},indexOf:function(g){var V=this();return f.a.A(V,g)},replace:function(g,V){var G=this.indexOf(g);0<=G&&(this.ya(),this.v()[G]=V,this.xa())},sorted:function(g){var V=this().slice(0);return g?V.sort(g):V.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(g){f.Ha.fn[g]=function(){var V=this.v();this.ya(),this.zc(V,g,arguments);var G=V[g].apply(V,arguments);return this.xa(),G===V?this:G}}),f.a.D(["slice"],function(g){f.Ha.fn[g]=function(){var V=this();return V[g].apply(V,arguments)}}),f.Pc=function(g){return f.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(g,V){function G(){function K(){if(w){var te=[].concat(g.v()||[]),H;g.Wa("arrayChange")&&((!X||1<w)&&(X=f.a.Pb(O,te,g.Ob)),H=X),O=te,X=null,w=0,H&&H.length&&g.notifySubscribers(H,"arrayChange")}}v?K():(v=!0,D=g.subscribe(function(){++w},null,"spectate"),O=[].concat(g.v()||[]),X=null,Y=g.subscribe(K))}if(g.Ob={},V&&typeof V=="object"&&f.a.extend(g.Ob,V),g.Ob.sparse=!0,!g.zc){var v=!1,X=null,Y,D,w=0,O,M=g.Qa,z=g.hb;g.Qa=function(K){M&&M.call(g,K),K==="arrayChange"&&G()},g.hb=function(K){z&&z.call(g,K),K!=="arrayChange"||g.Wa("arrayChange")||(Y&&Y.s(),D&&D.s(),D=Y=null,v=!1,O=e)},g.zc=function(K,te,H){function $(Ae,Fe,tt){return ee[ee.length]={status:Ae,value:Fe,index:tt}}if(v&&!w){var ee=[],le=K.length,_e=H.length,he=0;switch(te){case"push":he=le;case"unshift":for(te=0;te<_e;te++)$("added",H[te],he+te);break;case"pop":he=le-1;case"shift":le&&$("deleted",K[he],he);break;case"splice":te=Math.min(Math.max(0,0>H[0]?le+H[0]:H[0]),le);for(var le=_e===1?le:Math.min(te+(H[1]||0),le),_e=te+_e-2,he=Math.max(le,_e),Ze=[],ye=[],Ge=2;te<he;++te,++Ge)te<le&&ye.push($("deleted",K[te],te)),te<_e&&Ze.push($("added",H[Ge],te));f.a.Kc(ye,Ze);break;default:return}X=ee}}}};var C=f.a.Da("_state");f.o=f.$=function(g,V,G){function v(){if(0<arguments.length){if(typeof X=="function")X.apply(Y.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 Y.ra||f.u.cc(v),(Y.ka||Y.J&&v.Xa())&&v.ha(),Y.X}if(typeof g=="object"?G=g:(G=G||{},g&&(G.read=g)),typeof G.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var X=G.write,Y={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:G.read,nb:V||G.owner,l:G.disposeWhenNodeIsRemoved||G.l||null,Sa:G.disposeWhen||G.Sa,Rb:null,I:{},V:0,Ic:null};return v[C]=Y,v.Nc=typeof X=="function",f.a.Ba||f.a.extend(v,f.T.fn),f.T.fn.qb(v),f.a.Ab(v,E),G.pure?(Y.wb=!0,Y.J=!0,f.a.extend(v,A)):G.deferEvaluation&&f.a.extend(v,L),f.options.deferUpdates&&f.Ta.deferred(v,!0),Y.l&&(Y.jc=!0,Y.l.nodeType||(Y.l=null)),Y.J||G.deferEvaluation||v.ha(),Y.l&&v.ja()&&f.a.K.za(Y.l,Y.Rb=function(){v.s()}),v};var E={equalityComparer:c,qa:function(){return this[C].V},Va:function(){var g=[];return f.a.P(this[C].I,function(V,G){g[G.Ka]=G.da}),g},Vb:function(g){if(!this[C].V)return!1;var V=this.Va();return f.a.A(V,g)!==-1?!0:!!f.a.Lb(V,function(G){return G.Vb&&G.Vb(g)})},uc:function(g,V,G){if(this[C].wb&&V===this)throw Error("A 'pure' computed must not be called recursively");this[C].I[g]=G,G.Ka=this[C].V++,G.La=V.ob()},Xa:function(){var g,V,G=this[C].I;for(g in G)if(Object.prototype.hasOwnProperty.call(G,g)&&(V=G[g],this.Ia&&V.da.Ja||V.da.Dd(V.La)))return!0},Jd:function(){this.Ia&&!this[C].rb&&this.Ia(!1)},ja:function(){var g=this[C];return g.ka||0<g.V},Rd:function(){this.Ja?this[C].ka&&(this[C].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var V=g.subscribe(this.Jd,this,"dirty"),G=g.subscribe(this.Rd,this);return{da:g,s:function(){V.s(),G.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,V=g.throttleEvaluation;V&&0<=V?(clearTimeout(this[C].Ic),this[C].Ic=f.a.setTimeout(function(){g.ha(!0)},V)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var V=this[C],G=V.Sa,v=!1;if(!V.rb&&!V.ra){if(V.l&&!f.a.Sb(V.l)||G&&G()){if(!V.jc){this.s();return}}else V.jc=!1;V.rb=!0;try{v=this.zd(g)}finally{V.rb=!1}return v}},zd:function(g){var V=this[C],v=!1,G=V.wb?e:!V.V,v={qd:this,mb:V.I,Qb:V.V};f.u.xc({pd:v,od:b,o:this,Ya:G}),V.I={},V.V=0;var X=this.yd(V,v);return V.V?v=this.sb(V.X,X):(this.s(),v=!0),v&&(V.J?this.Gb():this.notifySubscribers(V.X,"beforeChange"),V.X=X,this.notifySubscribers(V.X,"spectate"),!V.J&&g&&this.notifySubscribers(V.X),this.rc&&this.rc()),G&&this.notifySubscribers(V.X,"awake"),v},yd:function(g,V){try{var G=g.Wc;return g.nb?G.call(g.nb):G()}finally{f.u.end(),V.Qb&&!g.J&&f.a.P(V.mb,p),g.sa=g.ka=!1}},v:function(g){var V=this[C];return(V.ka&&(g||!V.V)||V.J&&this.Xa())&&this.ha(),V.X},ub:function(g){f.T.fn.ub.call(this,g),this.nc=function(){return this[C].J||(this[C].sa?this.ha():this[C].ka=!1),this[C].X},this.Ia=function(V){this.pc(this[C].X),this[C].ka=!0,V&&(this[C].sa=!0),this.qc(this,!V)}},s:function(){var g=this[C];!g.J&&g.I&&f.a.P(g.I,function(V,G){G.s&&G.s()}),g.l&&g.Rb&&f.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},A={Qa:function(g){var V=this,G=V[C];if(!G.ra&&G.J&&g=="change"){if(G.J=!1,G.sa||V.Xa())G.I=null,G.V=0,V.ha()&&V.Gb();else{var v=[];f.a.P(G.I,function(X,Y){v[Y.Ka]=X}),f.a.D(v,function(X,Y){var D=G.I[X],w=V.$c(D.da);w.Ka=Y,w.La=D.La,G.I[X]=w}),V.Xa()&&V.ha()&&V.Gb()}G.ra||V.notifySubscribers(G.X,"awake")}},hb:function(g){var V=this[C];V.ra||g!="change"||this.Wa("change")||(f.a.P(V.I,function(G,v){v.s&&(V.I[G]={da:v.da,Ka:v.Ka,La:v.La},v.s())}),V.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[C];return g.J&&(g.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},L={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(E,f.T.fn);var F=f.ta.Ma;E[F]=f.o,f.Oc=function(g){return typeof g=="function"&&g[F]===E[F]},f.Fd=function(g){return f.Oc(g)&&g[C]&&g[C].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",E),f.L(E,"peek",E.v),f.L(E,"dispose",E.s),f.L(E,"isActive",E.ja),f.L(E,"getDependenciesCount",E.qa),f.L(E,"getDependencies",E.Va),f.xb=function(g,V){return typeof g=="function"?f.o(g,V,{pure:!0}):(g=f.a.extend({},g),g.pure=!0,f.o(g,V))},f.b("pureComputed",f.xb),(function(){function g(v,X,Y){if(Y=Y||new G,v=X(v),typeof v!="object"||v===null||v===e||v instanceof RegExp||v instanceof Date||v instanceof String||v instanceof Number||v instanceof Boolean)return v;var D=v instanceof Array?[]:{};return Y.save(v,D),V(v,function(w){var O=X(v[w]);switch(typeof O){case"boolean":case"number":case"string":case"function":D[w]=O;break;case"object":case"undefined":var M=Y.get(O);D[w]=M!==e?M:g(O,X,Y)}}),D}function V(v,X){if(v instanceof Array){for(var Y=0;Y<v.length;Y++)X(Y);typeof v.toJSON=="function"&&X("toJSON")}else for(Y in v)X(Y)}function G(){this.keys=[],this.values=[]}f.ad=function(v){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(v,function(X){for(var Y=0;f.O(X)&&10>Y;Y++)X=X();return X})},f.toJSON=function(v,X,Y){return v=f.ad(v),f.a.hc(v,X,Y)},G.prototype={constructor:G,save:function(v,X){var Y=f.a.A(this.keys,v);0<=Y?this.values[Y]=X:(this.keys.push(v),this.values.push(X))},get:function(v){return v=f.a.A(this.keys,v),0<=v?this.values[v]:e}}})(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(g,V,G){function v(X){var Y=f.xb(g,G).extend({ma:"always"}),D=Y.subscribe(function(w){w&&(D.s(),X(w))});return Y.notifySubscribers(Y.v()),D}return typeof Promise!="function"||V?v(V.bind(G)):new Promise(v)},f.b("when",f.Wd),(function(){f.w={M:function(g){switch(f.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?f.a.g.get(g,f.c.options.$b):7>=f.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?f.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,V,G){switch(f.a.R(g)){case"option":typeof V=="string"?(f.a.g.set(g,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=V):(f.a.g.set(g,f.c.options.$b,V),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof V=="number"?V:"");break;case"select":(V===""||V===null)&&(V=e);for(var v=-1,X=0,Y=g.options.length,D;X<Y;++X)if(D=f.w.M(g.options[X]),D==V||D===""&&V===e){v=X;break}(G||0<=v||V===e&&1<g.size)&&(g.selectedIndex=v,f.a.W===6&&f.a.setTimeout(function(){g.selectedIndex=v},0));break;default:(V===null||V===e)&&(V=""),g.value=V}}}})(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=(function(){function g(w){w=f.a.Db(w),w.charCodeAt(0)===123&&(w=w.slice(1,-1)),w+=` +,`;var O=[],M=w.match(v),z,K=[],te=0;if(1<M.length){for(var H=0,$;$=M[H];++H){var ee=$.charCodeAt(0);if(ee===44){if(0>=te){O.push(z&&K.length?{key:z,value:K.join("")}:{unknown:z||K.join("")}),z=te=0,K=[];continue}}else if(ee===58){if(!te&&!z&&K.length===1){z=K.pop();continue}}else{if(ee===47&&1<$.length&&($.charCodeAt(1)===47||$.charCodeAt(1)===42))continue;ee===47&&H&&1<$.length?(ee=M[H-1].match(X))&&!Y[ee[0]]&&(w=w.substr(w.indexOf($)+1),M=w.match(v),H=-1,$="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:z||K.length||ee!==34&&ee!==39||($=$.slice(1,-1))}K.push($)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return O}var V=["true","false","null","undefined"],G=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,v=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),X=/[\])"'A-Za-z0-9_$]+$/,Y={in:1,return:1,typeof:1},D={};return{Ra:[],wa:D,ac:g,vb:function(w,O){function M(ee,le){var _e;if(!H){var he=f.getBindingHandler(ee);if(he&&he.preprocess&&!(le=he.preprocess(le,ee,M)))return;(he=D[ee])&&(_e=le,0<=f.a.A(V,_e)?_e=!1:(he=_e.match(G),_e=he===null?!1:he[1]?"Object("+he[1]+")"+he[2]:_e),he=_e),he&&K.push("'"+(typeof D[ee]=="string"?D[ee]:ee)+"':function(_z){"+_e+"=_z}")}te&&(le="function(){return "+le+" }"),z.push("'"+ee+"':"+le)}O=O||{};var z=[],K=[],te=O.valueAccessors,H=O.bindingParams,$=typeof w=="string"?g(w):w;return f.a.D($,function(ee){M(ee.key||ee.unknown,ee.value)}),K.length&&M("_ko_property_writers","{"+K.join(",")+" }"),z.join(",")},Id:function(w,O){for(var M=0;M<w.length;M++)if(w[M].key==O)return!0;return!1},eb:function(w,O,M,z,K){w&&f.O(w)?!f.Za(w)||K&&w.v()===z||w(z):(w=O.get("_ko_property_writers"))&&w[M]&&w[M](z)}}})(),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 g(M){return M.nodeType==8&&Y.test(X?M.text:M.nodeValue)}function V(M){return M.nodeType==8&&D.test(X?M.text:M.nodeValue)}function G(M,z){for(var K=M,te=1,H=[];K=K.nextSibling;){if(V(K)&&(f.a.g.set(K,O,!0),te--,te===0))return H;H.push(K),g(K)&&te++}if(!z)throw Error("Cannot find closing comment tag to match: "+M.nodeValue);return null}function v(M,z){var K=G(M,z);return K?0<K.length?K[K.length-1].nextSibling:M.nextSibling:null}var X=n&&n.createComment("test").text==="<!--test-->",Y=X?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,D=X?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,w={ul:!0,ol:!0},O="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(M){return g(M)?G(M):M.childNodes},Ea:function(M){if(g(M)){M=f.h.childNodes(M);for(var z=0,K=M.length;z<K;z++)f.removeNode(M[z])}else f.a.Tb(M)},va:function(M,z){if(g(M)){f.h.Ea(M);for(var K=M.nextSibling,te=0,H=z.length;te<H;te++)K.parentNode.insertBefore(z[te],K)}else f.a.va(M,z)},Vc:function(M,z){var K;g(M)?(K=M.nextSibling,M=M.parentNode):K=M.firstChild,K?z!==K&&M.insertBefore(z,K):M.appendChild(z)},Wb:function(M,z,K){K?(K=K.nextSibling,g(M)&&(M=M.parentNode),K?z!==K&&M.insertBefore(z,K):M.appendChild(z)):f.h.Vc(M,z)},firstChild:function(M){if(g(M))return!M.nextSibling||V(M.nextSibling)?null:M.nextSibling;if(M.firstChild&&V(M.firstChild))throw Error("Found invalid end comment, as the first child of "+M);return M.firstChild},nextSibling:function(M){if(g(M)&&(M=v(M)),M.nextSibling&&V(M.nextSibling)){var z=M.nextSibling;if(V(z)&&!f.a.g.get(z,O))throw Error("Found end comment without a matching opening comment, as child of "+M);return null}return M.nextSibling},Cd:g,Vd:function(M){return(M=(X?M.text:M.nodeValue).match(Y))?M[1]:null},Sc:function(M){if(w[f.a.R(M)]){var z=M.firstChild;if(z)do if(z.nodeType===1){var K;K=z.firstChild;var te=null;if(K)do if(te)te.push(K);else if(g(K)){var H=v(K,!0);H?K=H:te=[K]}else V(K)&&(te=[K]);while(K=K.nextSibling);if(K=te)for(te=z.nextSibling,H=0;H<K.length;H++)te?M.insertBefore(K[H],te):M.appendChild(K[H])}while(z=z.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(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(g);case 8:return f.h.Cd(g);default:return!1}},getBindings:function(g,V){var G=this.getBindingsString(g,V),G=G?this.parseBindingsString(G,V,g):null;return f.j.tc(G,g,V,!1)},getBindingAccessors:function(g,V){var G=this.getBindingsString(g,V),G=G?this.parseBindingsString(G,V,g,{valueAccessors:!0}):null;return f.j.tc(G,g,V,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return f.h.Vd(g);default:return null}},parseBindingsString:function(g,V,G,v){try{var X=this.nd,Y=g+(v&&v.valueAccessors||""),D;if(!(D=X[Y])){var w,O="with($context){with($data||{}){return{"+f.m.vb(g,v)+"}}}";w=new Function("$context","$element",O),D=X[Y]=w}return D(V,G)}catch(M){throw M.message=`Unable to parse bindings. +Bindings value: `+g+` +Message: `+M.message,M}}}),f.ga.instance=new f.ga})(),f.b("bindingProvider",f.ga),(function(){function g(he){var Ze=(he=f.a.g.get(he,_e))&&he.N;Ze&&(he.N=null,Ze.Tc())}function V(he,Ze,ye){this.node=he,this.yc=Ze,this.kb=[],this.H=!1,Ze.N||f.a.K.za(he,g),ye&&ye.N&&(ye.N.kb.push(he),this.Kb=ye)}function G(he){return function(){return he}}function v(he){return he()}function X(he){return f.a.Ga(f.u.G(he),function(Ze,ye){return function(){return he()[ye]}})}function Y(he,Ze,ye){return typeof he=="function"?X(he.bind(null,Ze,ye)):f.a.Ga(he,G)}function D(he,Ze){return X(this.getBindings.bind(this,he,Ze))}function w(he,Ze){var ye=f.h.firstChild(Ze);if(ye){var Ge,Ae=f.ga.instance,Fe=Ae.preprocessNode;if(Fe){for(;Ge=ye;)ye=f.h.nextSibling(Ge),Fe.call(Ae,Ge);ye=f.h.firstChild(Ze)}for(;Ge=ye;)ye=f.h.nextSibling(Ge),O(he,Ge)}f.i.ma(Ze,f.i.H)}function O(he,Ze){var ye=he,Ge=Ze.nodeType===1;Ge&&f.h.Sc(Ze),(Ge||f.ga.instance.nodeHasBindings(Ze))&&(ye=z(Ze,null,he).bindingContextForDescendants),ye&&!ee[f.a.R(Ze)]&&w(ye,Ze)}function M(he){var Ze=[],ye={},Ge=[];return f.a.P(he,function Ae(Fe){if(!ye[Fe]){var tt=f.getBindingHandler(Fe);tt&&(tt.after&&(Ge.push(Fe),f.a.D(tt.after,function(Be){if(he[Be]){if(f.a.A(Ge,Be)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ge.join(", "));Ae(Be)}}),Ge.length--),Ze.push({key:Fe,Mc:tt})),ye[Fe]=!0}}),Ze}function z(he,Ze,ye){var Ge=f.a.g.Ub(he,_e,{}),Ae=Ge.hd;if(!Ze){if(Ae)throw Error("You cannot apply bindings multiple times to the same element.");Ge.hd=!0}Ae||(Ge.context=ye),Ge.Zb||(Ge.Zb={});var Fe;if(Ze&&typeof Ze!="function")Fe=Ze;else{var tt=f.ga.instance,Be=tt.getBindingAccessors||D,je=f.$(function(){return(Fe=Ze?Ze(ye,he):Be.call(tt,he,ye))&&(ye[te]&&ye[te](),ye[$]&&ye[$]()),Fe},null,{l:he});Fe&&je.ja()||(je=null)}var qe=ye,We;if(Fe){var Ke=function(){return f.a.Ga(je?je():Fe,v)},ct=je?function(Et){return function(){return v(je()[Et])}}:function(Et){return Fe[Et]};Ke.get=function(Et){return Fe[Et]&&v(ct(Et))},Ke.has=function(Et){return Et in Fe},f.i.H in Fe&&f.i.subscribe(he,f.i.H,function(){var Et=(0,Fe[f.i.H])();if(Et){var zt=f.h.childNodes(he);zt.length&&Et(zt,f.Ec(zt[0]))}}),f.i.pa in Fe&&(qe=f.i.Cb(he,ye),f.i.subscribe(he,f.i.pa,function(){var Et=(0,Fe[f.i.pa])();Et&&f.h.firstChild(he)&&Et(he)})),Ge=M(Fe),f.a.D(Ge,function(Et){var zt=Et.Mc.init,ut=Et.Mc.update,bt=Et.key;if(he.nodeType===8&&!f.h.ea[bt])throw Error("The binding '"+bt+"' cannot be used with virtual elements");try{typeof zt=="function"&&f.u.G(function(){var ht=zt(he,ct(bt),Ke,qe.$data,qe);if(ht&&ht.controlsDescendantBindings){if(We!==e)throw Error("Multiple bindings ("+We+" and "+bt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");We=bt}}),typeof ut=="function"&&f.$(function(){ut(he,ct(bt),Ke,qe.$data,qe)},null,{l:he})}catch(ht){throw ht.message='Unable to process binding "'+bt+": "+Fe[bt]+`" +Message: `+ht.message,ht}})}return Ge=We===e,{shouldBindDescendants:Ge,bindingContextForDescendants:Ge&&qe}}function K(he,Ze){return he&&he instanceof f.fa?he:new f.fa(he,e,e,Ze)}var te=f.a.Da("_subscribable"),H=f.a.Da("_ancestorBindingInfo"),$=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(he){return f.c[he]};var le={};f.fa=function(he,Ze,ye,Ge,Ae){function Fe(){var ct=qe?je():je,Et=f.a.f(ct);return Ze?(f.a.extend(tt,Ze),H in Ze&&(tt[H]=Ze[H])):(tt.$parents=[],tt.$root=Et,tt.ko=f),tt[te]=We,Be?Et=tt.$data:(tt.$rawData=ct,tt.$data=Et),ye&&(tt[ye]=Et),Ge&&Ge(tt,Ze,Et),Ze&&Ze[te]&&!f.S.o().Vb(Ze[te])&&Ze[te](),Ke&&(tt[$]=Ke),tt.$data}var tt=this,Be=he===le,je=Be?e:he,qe=typeof je=="function"&&!f.O(je),We,Ke=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?Fe():(We=f.xb(Fe),We.v(),We.ja()?We.equalityComparer=null:tt[te]=e)},f.fa.prototype.createChildContext=function(he,Ze,ye,Ge){if(!Ge&&Ze&&typeof Ze=="object"&&(Ge=Ze,Ze=Ge.as,ye=Ge.extend),Ze&&Ge&&Ge.noChildContext){var Ae=typeof he=="function"&&!f.O(he);return new f.fa(le,this,null,function(Fe){ye&&ye(Fe),Fe[Ze]=Ae?he():he},Ge)}return new f.fa(he,this,Ze,function(Fe,tt){Fe.$parentContext=tt,Fe.$parent=tt.$data,Fe.$parents=(tt.$parents||[]).slice(0),Fe.$parents.unshift(Fe.$parent),ye&&ye(Fe)},Ge)},f.fa.prototype.extend=function(he,Ze){return new f.fa(le,this,null,function(ye){f.a.extend(ye,typeof he=="function"?he(ye):he)},Ze)};var _e=f.a.g.Z();V.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},V.prototype.sd=function(he){f.a.Pa(this.kb,he),!this.kb.length&&this.H&&this.Cc()},V.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,g),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(he,Ze,ye,Ge,Ae){var Fe=f.a.g.Ub(he,_e,{});return Fe.Fa||(Fe.Fa=new f.T),Ae&&Ae.notifyImmediately&&Fe.Zb[Ze]&&f.u.G(ye,Ge,[he]),Fe.Fa.subscribe(ye,Ge,Ze)},ma:function(he,Ze){var ye=f.a.g.get(he,_e);if(ye&&(ye.Zb[Ze]=!0,ye.Fa&&ye.Fa.notifySubscribers(he,Ze),Ze==f.i.H)){if(ye.N)ye.N.Cc();else if(ye.N===e&&ye.Fa&&ye.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(he,Ze){var ye=f.a.g.Ub(he,_e,{});return ye.N||(ye.N=new V(he,ye,Ze[H])),Ze[H]==ye?Ze:Ze.extend(function(Ge){Ge[H]=ye})}},f.Td=function(he){return(he=f.a.g.get(he,_e))&&he.context},f.ib=function(he,Ze,ye){return he.nodeType===1&&f.h.Sc(he),z(he,Ze,K(ye))},f.ld=function(he,Ze,ye){return ye=K(ye),f.ib(he,Y(Ze,ye,he),ye)},f.Oa=function(he,Ze){Ze.nodeType!==1&&Ze.nodeType!==8||w(K(he),Ze)},f.vc=function(he,Ze,ye){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(Ze=n.body,!Ze)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!Ze||Ze.nodeType!==1&&Ze.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");O(K(he,ye),Ze)},f.Dc=function(he){return!he||he.nodeType!==1&&he.nodeType!==8?e:f.Td(he)},f.Ec=function(he){return(he=f.Dc(he))?he.$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(g){function V(D,w){var O=Object.prototype.hasOwnProperty.call(X,D)?X[D]:g,M;O?O.subscribe(w):(O=X[D]=new f.T,O.subscribe(w),G(D,function(z,K){var te=!(!K||!K.synchronous);Y[D]={definition:z,Gd:te},delete X[D],M||te?O.notifySubscribers(z):f.na.zb(function(){O.notifySubscribers(z)})}),M=!0)}function G(D,w){v("getConfig",[D],function(O){O?v("loadComponent",[D,O],function(M){w(M,O)}):w(null,null)})}function v(D,w,O,M){M||(M=f.j.loaders.slice(0));var z=M.shift();if(z){var K=z[D];if(K){var te=!1;if(K.apply(z,w.concat(function(H){te?O(null):H!==null?O(H):v(D,w,O,M)}))!==g&&(te=!0,!z.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else v(D,w,O,M)}else O(null)}var X={},Y={};f.j={get:function(D,w){var O=Object.prototype.hasOwnProperty.call(Y,D)?Y[D]:g;O?O.Gd?f.u.G(function(){w(O.definition)}):f.na.zb(function(){w(O.definition)}):V(D,w)},Bc:function(D){delete Y[D]},oc:v},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)})(),(function(){function g(O,M,z,K){function te(){--$===0&&K(H)}var H={},$=2,ee=z.template;z=z.viewModel,ee?X(M,ee,function(le){f.j.oc("loadTemplate",[O,le],function(_e){H.template=_e,te()})}):te(),z?X(M,z,function(le){f.j.oc("loadViewModel",[O,le],function(_e){H[w]=_e,te()})}):te()}function V(O,M,z){if(typeof M=="function")z(function(te){return new M(te)});else if(typeof M[w]=="function")z(M[w]);else if("instance"in M){var K=M.instance;z(function(){return K})}else"viewModel"in M?V(O,M.viewModel,z):O("Unknown viewModel value: "+M)}function G(O){switch(f.a.R(O)){case"script":return f.a.ua(O.text);case"textarea":return f.a.ua(O.value);case"template":if(v(O.content))return f.a.Ca(O.content.childNodes)}return f.a.Ca(O.childNodes)}function v(O){return t.DocumentFragment?O instanceof DocumentFragment:O&&O.nodeType===11}function X(O,M,z){typeof M.require=="string"?a||t.require?(a||t.require)([M.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),z(K)}):O("Uses require, but no AMD loader is present"):z(M)}function Y(O){return function(M){throw Error("Component '"+O+"': "+M)}}var D={};f.j.register=function(O,M){if(!M)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");D[O]=M},f.j.tb=function(O){return Object.prototype.hasOwnProperty.call(D,O)},f.j.unregister=function(O){delete D[O],f.j.Bc(O)},f.j.Fc={getConfig:function(O,M){M(f.j.tb(O)?D[O]:null)},loadComponent:function(O,M,z){var K=Y(O);X(K,M,function(te){g(O,K,te,z)})},loadTemplate:function(O,M,z){if(O=Y(O),typeof M=="string")z(f.a.ua(M));else if(M instanceof Array)z(M);else if(v(M))z(f.a.la(M.childNodes));else if(M.element)if(M=M.element,t.HTMLElement?M instanceof HTMLElement:M&&M.tagName&&M.nodeType===1)z(G(M));else if(typeof M=="string"){var K=n.getElementById(M);K?z(G(K)):O("Cannot find element with ID "+M)}else O("Unknown element type: "+M);else O("Unknown template value: "+M)},loadViewModel:function(O,M,z){V(Y(O),M,z)}};var w="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=D})(),(function(){function g(G,v){var X=G.getAttribute("params");if(X){var X=V.parseBindingsString(X,v,G,{valueAccessors:!0,bindingParams:!0}),X=f.a.Ga(X,function(w){return f.o(w,null,{l:G})}),Y=f.a.Ga(X,function(w){var O=w.v();return w.ja()?f.o({read:function(){return f.a.f(w())},write:f.Za(O)&&function(M){w()(M)},l:G}):O});return Object.prototype.hasOwnProperty.call(Y,"$raw")||(Y.$raw=X),Y}return{$raw:{}}}f.j.getComponentNameForNode=function(G){var v=f.a.R(G);if(f.j.tb(v)&&(v.indexOf("-")!=-1||""+G=="[object HTMLUnknownElement]"||8>=f.a.W&&G.tagName===v))return v},f.j.tc=function(G,v,X,Y){if(v.nodeType===1){var D=f.j.getComponentNameForNode(v);if(D){if(G=G||{},G.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var w={name:D,params:g(v,X)};G.component=Y?function(){return w}:w}}return G};var V=new f.ga;9>f.a.W&&(f.j.register=(function(G){return function(v){return G.apply(this,arguments)}})(f.j.register),n.createDocumentFragment=(function(G){return function(){var v=G(),X=f.j.dd,Y;for(Y in X);return v}})(n.createDocumentFragment))})(),(function(){function g(v,X,Y){if(X=X.template,!X)throw Error("Component '"+v+"' has no template");v=f.a.Ca(X),f.h.va(Y,v)}function V(v,X,Y){var D=v.createViewModel;return D?D.call(v,X,Y):X}var G=0;f.c.component={init:function(v,X,Y,D,w){function O(){var H=M&&M.dispose;typeof H=="function"&&H.call(M),K&&K.s(),z=M=K=null}var M,z,K,te=f.a.la(f.h.childNodes(v));return f.h.Ea(v),f.a.K.za(v,O),f.o(function(){var H=f.a.f(X()),$,ee;if(typeof H=="string"?$=H:($=f.a.f(H.name),ee=f.a.f(H.params)),!$)throw Error("No component name specified");var le=f.i.Cb(v,w),_e=z=++G;f.j.get($,function(he){if(z===_e){if(O(),!he)throw Error("Unknown component '"+$+"'");g($,he,v);var Ze=V(he,ee,{element:v,templateNodes:te});he=le.createChildContext(Ze,{extend:function(ye){ye.$component=Ze,ye.$componentTemplateNodes=te}}),Ze&&Ze.koDescendantsComplete&&(K=f.i.subscribe(v,f.i.pa,Ze.koDescendantsComplete,Ze)),M=Ze,f.Oa(he,v)}})},null,{l:v}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0})();var I={class:"className",for:"htmlFor"};f.c.attr={update:function(g,V){var G=f.a.f(V())||{};f.a.P(G,function(v,X){X=f.a.f(X);var Y=v.indexOf(":"),Y="lookupNamespaceURI"in g&&0<Y&&g.lookupNamespaceURI(v.substr(0,Y)),D=X===!1||X===null||X===e;D?Y?g.removeAttributeNS(Y,v):g.removeAttribute(v):X=X.toString(),8>=f.a.W&&v in I?(v=I[v],D?g.removeAttribute(v):g[v]=X):D||(Y?g.setAttributeNS(Y,v,X):g.setAttribute(v,X)),v==="name"&&f.a.Yc(g,D?"":X)})}},(function(){f.c.checked={after:["value","attr"],init:function(g,V,G){function v(){var H=g.checked,$=Y();if(!f.S.Ya()&&(H||!w&&!f.S.qa())){var ee=f.u.G(V);if(M){var le=z?ee.v():ee,_e=te;te=$,_e!==$?H&&(f.a.Na(le,$,!0),f.a.Na(le,_e,!1)):f.a.Na(le,$,H),z&&f.Za(ee)&&ee(le)}else D&&($===e?$=H:H||($=e)),f.m.eb(ee,G,"checked",$,!0)}}function X(){var H=f.a.f(V()),$=Y();M?(g.checked=0<=f.a.A(H,$),te=$):g.checked=D&&$===e?!!H:Y()===H}var Y=f.xb(function(){if(G.has("checkedValue"))return f.a.f(G.get("checkedValue"));if(K)return G.has("value")?f.a.f(G.get("value")):g.value}),D=g.type=="checkbox",w=g.type=="radio";if(D||w){var O=V(),M=D&&f.a.f(O)instanceof Array,z=!(M&&O.push&&O.splice),K=w||M,te=M?Y():e;w&&!g.name&&f.c.uniqueName.init(g,function(){return!0}),f.o(v,null,{l:g}),f.a.B(g,"click",v),f.o(X,null,{l:g}),O=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(g,V){g.value=f.a.f(V())}}})(),f.c.class={update:function(g,V){var G=f.a.Db(f.a.f(V()));f.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=G,f.a.Eb(g,G,!0)}},f.c.css={update:function(g,V){var G=f.a.f(V());G!==null&&typeof G=="object"?f.a.P(G,function(v,X){X=f.a.f(X),f.a.Eb(g,v,X)}):f.c.class.update(g,V)}},f.c.enable={update:function(g,V){var G=f.a.f(V());G&&g.disabled?g.removeAttribute("disabled"):G||g.disabled||(g.disabled=!0)}},f.c.disable={update:function(g,V){f.c.enable.update(g,function(){return!f.a.f(V())})}},f.c.event={init:function(g,V,G,v,X){var Y=V()||{};f.a.P(Y,function(D){typeof D=="string"&&f.a.B(g,D,function(w){var O,M=V()[D];if(M){try{var z=f.a.la(arguments);v=X.$data,z.unshift(v),O=M.apply(v,z)}finally{O!==!0&&(w.preventDefault?w.preventDefault():w.returnValue=!1)}G.get(D+"Bubble")===!1&&(w.cancelBubble=!0,w.stopPropagation&&w.stopPropagation())}})})}},f.c.foreach={Rc:function(g){return function(){var V=g(),G=f.a.bc(V);return!G||typeof G.length=="number"?{foreach:V,templateEngine:f.ba.Ma}:(f.a.f(V),{foreach:G.data,as:G.as,noChildContext:G.noChildContext,includeDestroyed:G.includeDestroyed,afterAdd:G.afterAdd,beforeRemove:G.beforeRemove,afterRender:G.afterRender,beforeMove:G.beforeMove,afterMove:G.afterMove,templateEngine:f.ba.Ma})}},init:function(g,V){return f.c.template.init(g,f.c.foreach.Rc(V))},update:function(g,V,G,v,X){return f.c.template.update(g,f.c.foreach.Rc(V),G,v,X)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(g,V,G){function v(D){g.__ko_hasfocusUpdating=!0;var w=g.ownerDocument;if("activeElement"in w){var O;try{O=w.activeElement}catch{O=w.body}D=O===g}w=V(),f.m.eb(w,G,"hasfocus",D,!0),g.__ko_hasfocusLastValue=D,g.__ko_hasfocusUpdating=!1}var X=v.bind(null,!0),Y=v.bind(null,!1);f.a.B(g,"focus",X),f.a.B(g,"focusin",X),f.a.B(g,"blur",Y),f.a.B(g,"focusout",Y),g.__ko_hasfocusLastValue=!1},update:function(g,V){var G=!!f.a.f(V());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===G||(G?g.focus():g.blur(),!G&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[g,G?"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(g,V){f.a.fc(g,V())}},(function(){function g(V,G,v){f.c[V]={init:function(X,Y,D,w,O){var M,z,K={},te,H,$;if(G){w=D.get("as");var ee=D.get("noChildContext");$=!(w&&ee),K={as:w,noChildContext:ee,exportDependencies:$}}return H=(te=D.get("completeOn")=="render")||D.has(f.i.pa),f.o(function(){var le=f.a.f(Y()),_e=!v!=!le,he=!z,Ze;($||_e!==M)&&(H&&(O=f.i.Cb(X,O)),_e&&((!G||$)&&(K.dataDependency=f.S.o()),Ze=G?O.createChildContext(typeof le=="function"?le:Y,K):f.S.qa()?O.extend(null,K):O),he&&f.S.qa()&&(z=f.a.Ca(f.h.childNodes(X),!0)),_e?(he||f.h.va(X,f.a.Ca(z)),f.Oa(Ze,X)):(f.h.Ea(X),te||f.i.ma(X,f.i.H)),M=_e)},null,{l:X}),{controlsDescendantBindings:!0}}},f.m.Ra[V]=!1,f.h.ea[V]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)})(),f.c.let={init:function(g,V,G,v,X){return V=X.extend(V),f.Oa(V,g),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var N={};f.c.options={init:function(g){if(f.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,V,G){function v(){return f.a.jb(g.options,function(ee){return ee.selected})}function X(ee,le,_e){var he=typeof le;return he=="function"?le(ee):he=="string"?ee[le]:_e}function Y(ee,le){if(H&&M)f.i.ma(g,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(le[0]));f.a.Zc(le[0],_e),H&&!_e&&f.u.G(f.a.Fb,null,[g,"change"])}}var D=g.multiple,w=g.length!=0&&D?g.scrollTop:null,O=f.a.f(V()),M=G.get("valueAllowUnset")&&G.has("value"),z=G.get("optionsIncludeDestroyed");V={};var K,te=[];M||(D?te=f.a.Mb(v(),f.w.M):0<=g.selectedIndex&&te.push(f.w.M(g.options[g.selectedIndex]))),O&&(typeof O.length>"u"&&(O=[O]),K=f.a.jb(O,function(ee){return z||ee===e||ee===null||!f.a.f(ee._destroy)}),G.has("optionsCaption")&&(O=f.a.f(G.get("optionsCaption")),O!==null&&O!==e&&K.unshift(N)));var H=!1;if(V.beforeRemove=function(ee){g.removeChild(ee)},O=Y,G.has("optionsAfterRender")&&typeof G.get("optionsAfterRender")=="function"&&(O=function(ee,le){Y(0,le),f.u.G(G.get("optionsAfterRender"),null,[le[0],ee!==N?ee:e])}),f.a.ec(g,K,function(ee,le,_e){return _e.length&&(te=!M&&_e[0].selected?[f.w.M(_e[0])]:[],H=!0),le=g.ownerDocument.createElement("option"),ee===N?(f.a.Bb(le,G.get("optionsCaption")),f.w.cb(le,e)):(_e=X(ee,G.get("optionsValue"),ee),f.w.cb(le,f.a.f(_e)),ee=X(ee,G.get("optionsText"),_e),f.a.Bb(le,ee)),[le]},V,O),!M){var $;D?$=te.length&&v().length<te.length:$=te.length&&0<=g.selectedIndex?f.w.M(g.options[g.selectedIndex])!==te[0]:te.length||0<=g.selectedIndex,$&&f.u.G(f.a.Fb,null,[g,"change"])}(M||f.S.Ya())&&f.i.ma(g,f.i.H),f.a.wd(g),w&&20<Math.abs(w-g.scrollTop)&&(g.scrollTop=w)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(g,V,G){function v(){var D=V(),w=[];f.a.D(g.getElementsByTagName("option"),function(O){O.selected&&w.push(f.w.M(O))}),f.m.eb(D,G,"selectedOptions",w)}function X(){var D=f.a.f(V()),w=g.scrollTop;D&&typeof D.length=="number"&&f.a.D(g.getElementsByTagName("option"),function(O){var M=0<=f.a.A(D,f.w.M(O));O.selected!=M&&f.a.Zc(O,M)}),g.scrollTop=w}if(f.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var Y;f.i.subscribe(g,f.i.H,function(){Y?v():(f.a.B(g,"change",v),Y=f.o(X,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(g,V){var G=f.a.f(V()||{});f.a.P(G,function(v,X){if(X=f.a.f(X),(X===null||X===e||X===!1)&&(X=""),o)o(g).css(v,X);else if(/^--/.test(v))g.style.setProperty(v,X);else{v=v.replace(/-(\w)/g,function(D,w){return w.toUpperCase()});var Y=g.style[v];g.style[v]=X,X===Y||g.style[v]!=Y||isNaN(X)||(g.style[v]=X+"px")}})}},f.c.submit={init:function(g,V,G,v,X){if(typeof V()!="function")throw Error("The value for a submit binding must be a function");f.a.B(g,"submit",function(Y){var D,w=V();try{D=w.call(X.$data,g)}finally{D!==!0&&(Y.preventDefault?Y.preventDefault():Y.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,V){f.a.Bb(g,V())}},f.h.ea.text=!0,(function(){if(t&&t.navigator){var g=function(K){if(K)return parseFloat(K[1])},V=t.navigator.userAgent,G,v,X,Y,D;(G=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(D=g(V.match(/Edge\/([^ ]+)$/)))||g(V.match(/Chrome\/([^ ]+)/))||(v=g(V.match(/Version\/([^ ]+) Safari/)))||(X=g(V.match(/Firefox\/([^ ]+)/)))||(Y=f.a.W||g(V.match(/MSIE ([^ ]+)/)))||(Y=g(V.match(/rv:([^ )]+)/)))}if(8<=Y&&10>Y)var w=f.a.g.Z(),O=f.a.g.Z(),M=function(K){var te=this.activeElement;(te=te&&f.a.g.get(te,O))&&te(K)},z=function(K,te){var H=K.ownerDocument;f.a.g.get(H,w)||(f.a.g.set(H,w,!0),f.a.B(H,"selectionchange",M)),f.a.g.set(K,O,te)};f.c.textInput={init:function(K,te,H){function $(Fe,tt){f.a.B(K,Fe,tt)}function ee(){var Fe=f.a.f(te());(Fe===null||Fe===e)&&(Fe=""),ye!==e&&Fe===ye?f.a.setTimeout(ee,4):K.value!==Fe&&(Ae=!0,K.value=Fe,Ae=!1,he=K.value)}function le(){Ze||(ye=K.value,Ze=f.a.setTimeout(_e,4))}function _e(){clearTimeout(Ze),ye=Ze=e;var Fe=K.value;he!==Fe&&(he=Fe,f.m.eb(te(),H,"textInput",Fe))}var he=K.value,Ze,ye,Ge=f.a.W==9?le:_e,Ae=!1;Y&&$("keypress",_e),11>Y&&$("propertychange",function(Fe){Ae||Fe.propertyName!=="value"||Ge(Fe)}),Y==8&&($("keyup",_e),$("keydown",_e)),z&&(z(K,Ge),$("dragend",le)),(!Y||9<=Y)&&$("input",Ge),5>v&&f.a.R(K)==="textarea"?($("keydown",le),$("paste",le),$("cut",le)):11>G?$("keydown",le):4>X?($("DOMAutoComplete",_e),$("dragdrop",_e),$("drop",_e)):D&&K.type==="number"&&$("keydown",le),$("change",_e),$("blur",_e),f.o(ee,null,{l:K})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(K,te,H){H("textInput",K)}}})(),f.c.uniqueName={init:function(g,V){if(V()){var G="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(g,G)}}},f.c.uniqueName.rd=0,f.c.using={init:function(g,V,G,v,X){var Y;return G.has("as")&&(Y={as:G.get("as"),noChildContext:G.get("noChildContext")}),V=X.createChildContext(V,Y),f.Oa(V,g),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(g,V,G){var v=f.a.R(g),X=v=="input";if(!X||g.type!="checkbox"&&g.type!="radio"){var Y=[],D=G.get("valueUpdate"),w=!1,O=null;D&&(typeof D=="string"?Y=[D]:Y=f.a.wc(D),f.a.Pa(Y,"change"));var M=function(){O=null,w=!1;var te=V(),H=f.w.M(g);f.m.eb(te,G,"value",H)};!f.a.W||!X||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||f.a.A(Y,"propertychange")!=-1||(f.a.B(g,"propertychange",function(){w=!0}),f.a.B(g,"focus",function(){w=!1}),f.a.B(g,"blur",function(){w&&M()})),f.a.D(Y,function(te){var H=M;f.a.Ud(te,"after")&&(H=function(){O=f.w.M(g),f.a.setTimeout(M,0)},te=te.substring(5)),f.a.B(g,te,H)});var z;if(z=X&&g.type=="file"?function(){var te=f.a.f(V());te===null||te===e||te===""?g.value="":f.u.G(M)}:function(){var te=f.a.f(V()),H=f.w.M(g);O!==null&&te===O?f.a.setTimeout(z,0):(te!==H||H===e)&&(v==="select"?(H=G.get("valueAllowUnset"),f.w.cb(g,te,H),H||te===f.w.M(g)||f.u.G(M)):f.w.cb(g,te))},v==="select"){var K;f.i.subscribe(g,f.i.H,function(){K?G.get("valueAllowUnset")?z():M():(f.a.B(g,"change",M),K=f.o(z,null,{l:g}))},null,{notifyImmediately:!0})}else f.a.B(g,"change",M),f.o(z,null,{l:g})}else f.ib(g,{checkedValue:V})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(g,V){var G=f.a.f(V()),v=g.style.display!="none";G&&!v?g.style.display="":!G&&v&&(g.style.display="none")}},f.c.hidden={update:function(g,V){f.c.visible.update(g,function(){return!f.a.f(V())})}},(function(g){f.c[g]={init:function(V,G,v,X,Y){return f.c.event.init.call(this,V,function(){var D={};return D[g]=G(),D},v,X,Y)}}})("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(g,V){if(typeof g=="string"){V=V||n;var G=V.getElementById(g);if(!G)throw Error("Cannot find template with ID "+g);return new f.C.F(G)}if(g.nodeType==1||g.nodeType==8)return new f.C.ia(g);throw Error("Unknown template type: "+g)},f.ca.prototype.renderTemplate=function(g,V,G,v){return g=this.makeTemplateSource(g,v),this.renderTemplateSource(g,V,G,v)},f.ca.prototype.isTemplateRewritten=function(g,V){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,V).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(g,V,G){g=this.makeTemplateSource(g,G),V=V(g.text()),g.text(V),g.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=(function(){function g(v,X,Y,D){v=f.m.ac(v);for(var w=f.m.Ra,O=0;O<v.length;O++){var M=v[O].key;if(Object.prototype.hasOwnProperty.call(w,M)){var z=w[M];if(typeof z=="function"){if(M=z(v[O].value))throw Error(M)}else if(!z)throw Error("This template engine does not support the '"+M+"' binding within its templates")}}return Y="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(v,{valueAccessors:!0})+" } })()},'"+Y.toLowerCase()+"')",D.createJavaScriptEvaluatorBlock(Y)+X}var V=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,G=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(v,X,Y){X.isTemplateRewritten(v,Y)||X.rewriteTemplate(v,function(D){return f.kc.Ld(D,X)},Y)},Ld:function(v,X){return v.replace(V,function(Y,D,w,O,M){return g(M,D,w,X)}).replace(G,function(Y,D){return g(D,"<!-- ko -->","#comment",X)})},md:function(v,X){return f.aa.Xb(function(Y,D){var w=Y.nextSibling;w&&w.nodeName.toLowerCase()===X&&f.ib(w,v,D)})}}})(),f.b("__tr_ambtns",f.kc.md),(function(){f.C={},f.C.F=function(G){if(this.F=G){var v=f.a.R(G);this.ab=v==="script"?1:v==="textarea"?2:v=="template"&&G.content&&G.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var G=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[G];var v=arguments[0];G==="innerHTML"?f.a.fc(this.F,v):this.F[G]=v};var g=f.a.g.Z()+"_";f.C.F.prototype.data=function(G){if(arguments.length===1)return f.a.g.get(this.F,g+G);f.a.g.set(this.F,g+G,arguments[1])};var V=f.a.g.Z();f.C.F.prototype.nodes=function(){var G=this.F;if(arguments.length==0){var v=f.a.g.get(G,V)||{},X=v.lb||(this.ab===3?G.content:this.ab===4?G:e);if(!X||v.jd){var Y=this.text();Y&&Y!==v.bb&&(X=f.a.Md(Y,G.ownerDocument),f.a.g.set(G,V,{lb:X,bb:Y,jd:!0}))}return X}v=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(G,V,{lb:v})},f.C.ia=function(G){this.F=G},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 G=f.a.g.get(this.F,V)||{};return G.bb===e&&G.lb&&(G.bb=G.lb.innerHTML),G.bb}f.a.g.set(this.F,V,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)})(),(function(){function g(O,M,z){var K;for(M=f.h.nextSibling(M);O&&(K=O)!==M;)O=f.h.nextSibling(K),z(K,O)}function V(O,M){if(O.length){var z=O[0],K=O[O.length-1],te=z.parentNode,H=f.ga.instance,$=H.preprocessNode;if($){if(g(z,K,function(ee,le){var _e=ee.previousSibling,he=$.call(H,ee);he&&(ee===z&&(z=he[0]||le),ee===K&&(K=he[he.length-1]||_e))}),O.length=0,!z)return;z===K?O.push(z):(O.push(z,K),f.a.Ua(O,te))}g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(M,ee)}),g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[M])}),f.a.Ua(O,te)}}function G(O){return O.nodeType?O:0<O.length?O[0]:null}function v(O,M,z,K,te){te=te||{};var H=(O&&G(O)||z||{}).ownerDocument,$=te.templateEngine||Y;if(f.kc.xd(z,$,H),z=$.renderTemplate(z,K,te,H),typeof z.length!="number"||0<z.length&&typeof z[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(H=!1,M){case"replaceChildren":f.h.va(O,z),H=!0;break;case"replaceNode":f.a.Xc(O,z),H=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+M)}return H&&(V(z,K),te.afterRender&&f.u.G(te.afterRender,null,[z,K[te.as||"$data"]]),M=="replaceChildren"&&f.i.ma(O,f.i.H)),z}function X(O,M,z){return f.O(O)?O():typeof O=="function"?O(M,z):O}var Y;f.gc=function(O){if(O!=e&&!(O instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");Y=O},f.dc=function(O,M,z,K,te){if(z=z||{},(z.templateEngine||Y)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",K){var H=G(K);return f.$(function(){var ee=M&&M instanceof f.fa?M:new f.fa(M,null,null,null,{exportDependencies:!0}),$=X(O,ee.$data,ee),ee=v(K,te,$,ee,z);te=="replaceNode"&&(K=ee,H=G(K))},null,{Sa:function(){return!H||!f.a.Sb(H)},l:H&&te=="replaceNode"?H.parentNode:H})}return f.aa.Xb(function($){f.dc(O,M,z,$,"replaceNode")})},f.Qd=function(O,M,z,K,te){function H(ye,Ge){f.u.G(f.a.ec,null,[K,ye,ee,z,$,Ge]),f.i.ma(K,f.i.H)}function $(ye,Ge){V(Ge,le),z.afterRender&&z.afterRender(Ge,ye),le=null}function ee(ye,Ge){le=te.createChildContext(ye,{as:_e,noChildContext:z.noChildContext,extend:function(Fe){Fe.$index=Ge,_e&&(Fe[_e+"Index"]=Ge)}});var Ae=X(O,ye,le);return v(K,"ignoreTargetNode",Ae,le,z)}var le,_e=z.as,he=z.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!z.includeDestroyed;if(he||z.beforeRemove||!f.Pc(M))return f.$(function(){var ye=f.a.f(M)||[];typeof ye.length>"u"&&(ye=[ye]),he&&(ye=f.a.jb(ye,function(Ge){return Ge===e||Ge===null||!f.a.f(Ge._destroy)})),H(ye)},null,{l:K});H(M.v());var Ze=M.subscribe(function(ye){H(M(),ye)},null,"arrayChange");return Ze.l(K),Ze};var D=f.a.g.Z(),w=f.a.g.Z();f.c.template={init:function(O,M){var z=f.a.f(M());if(typeof z=="string"||"name"in z)f.h.Ea(O);else if("nodes"in z){if(z=z.nodes||[],f.O(z))throw Error('The "nodes" option must be a plain, non-observable array.');var K=z[0]&&z[0].parentNode;K&&f.a.g.get(K,w)||(K=f.a.Yb(z),f.a.g.set(K,w,!0)),new f.C.ia(O).nodes(K)}else if(z=f.h.childNodes(O),0<z.length)K=f.a.Yb(z),new f.C.ia(O).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(O,M,z,K,te){var H=M();M=f.a.f(H),z=!0,K=null,typeof M=="string"?M={}:(H="name"in M?M.name:O,"if"in M&&(z=f.a.f(M.if)),z&&"ifnot"in M&&(z=!f.a.f(M.ifnot)),z&&!H&&(z=!1)),"foreach"in M?K=f.Qd(H,z&&M.foreach||[],M,O,te):z?(z=te,"data"in M&&(z=te.createChildContext(M.data,{as:M.as,noChildContext:M.noChildContext,exportDependencies:!0})),K=f.dc(H,z,M,O)):f.h.Ea(O),te=K,(M=f.a.g.get(O,D))&&typeof M.s=="function"&&M.s(),f.a.g.set(O,D,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(O){return O=f.m.ac(O),O.length==1&&O[0].unknown||f.m.Id(O,"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(g,V,G){if(g.length&&V.length){var v,X,Y,D,w;for(v=X=0;(!G||v<G)&&(D=g[X]);++X){for(Y=0;w=V[Y];++Y)if(D.value===w.value){D.moved=w.index,w.moved=D.index,V.splice(Y,1),v=Y=0;break}v+=Y}}},f.a.Pb=(function(){function g(V,G,v,X,Y){var D=Math.min,w=Math.max,O=[],M,z=V.length,K,te=G.length,H=te-z||1,$=z+te+1,ee,le,_e;for(M=0;M<=z;M++)for(le=ee,O.push(ee=[]),_e=D(te,M+H),K=w(0,M-1);K<=_e;K++)ee[K]=K?M?V[M-1]===G[K-1]?le[K-1]:D(le[K]||$,ee[K-1]||$)+1:K+1:M+1;for(D=[],w=[],H=[],M=z,K=te;M||K;)te=O[M][K]-1,K&&te===O[M][K-1]?w.push(D[D.length]={status:v,value:G[--K],index:K}):M&&te===O[M-1][K]?H.push(D[D.length]={status:X,value:V[--M],index:M}):(--K,--M,Y.sparse||D.push({status:"retained",value:G[K]}));return f.a.Kc(H,w,!Y.dontLimitMoves&&10*z),D.reverse()}return function(V,G,v){return v=typeof v=="boolean"?{dontLimitMoves:v}:v||{},V=V||[],G=G||[],V.length<G.length?g(V,G,"added","deleted",v):g(G,V,"deleted","added",v)}})(),f.b("utils.compareArrays",f.a.Pb),(function(){function g(v,X,Y,D,w){var O=[],M=f.$(function(){var z=X(Y,w,f.a.Ua(O,v))||[];0<O.length&&(f.a.Xc(O,z),D&&f.u.G(D,null,[Y,z,w])),O.length=0,f.a.Nb(O,z)},null,{l:v,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:M.ja()?M:e}}var V=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(v,X,Y,D,w,O){function M(Et){Ae={Aa:Et,pb:f.ta(le++)},$.push(Ae),H||Ge.push(Ae)}function z(Et){Ae=te[Et],le!==Ae.pb.v()&&ye.push(Ae),Ae.pb(le++),f.a.Ua(Ae.Y,v),$.push(Ae)}function K(Et,zt){if(Et)for(var ut=0,bt=zt.length;ut<bt;ut++)f.a.D(zt[ut].Y,function(ht){Et(ht,ut,zt[ut].Aa)})}X=X||[],typeof X.length>"u"&&(X=[X]),D=D||{};var te=f.a.g.get(v,V),H=!te,$=[],ee=0,le=0,_e=[],he=[],Ze=[],ye=[],Ge=[],Ae,Fe=0;if(H)f.a.D(X,M);else{if(!O||te&&te._countWaitingForRemove){var tt=f.a.Mb(te,function(Et){return Et.Aa});O=f.a.Pb(tt,X,{dontLimitMoves:D.dontLimitMoves,sparse:!0})}for(var tt=0,Be,je,qe;Be=O[tt];tt++)switch(je=Be.moved,qe=Be.index,Be.status){case"deleted":for(;ee<qe;)z(ee++);je===e&&(Ae=te[ee],Ae.$&&(Ae.$.s(),Ae.$=e),f.a.Ua(Ae.Y,v).length&&(D.beforeRemove&&($.push(Ae),Fe++,Ae.Aa===G?Ae=null:Ze.push(Ae)),Ae&&_e.push.apply(_e,Ae.Y))),ee++;break;case"added":for(;le<qe;)z(ee++);je!==e?(he.push($.length),z(je)):M(Be.value)}for(;le<X.length;)z(ee++);$._countWaitingForRemove=Fe}f.a.g.set(v,V,$),K(D.beforeMove,ye),f.a.D(_e,D.beforeRemove?f.oa:f.removeNode);var We,Ke,ct;try{ct=v.ownerDocument.activeElement}catch{}if(he.length)for(;(tt=he.shift())!=e;){for(Ae=$[tt],We=e;tt;)if((Ke=$[--tt].Y)&&Ke.length){We=Ke[Ke.length-1];break}for(X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We)}for(tt=0;Ae=$[tt];tt++){for(Ae.Y||f.a.extend(Ae,g(v,Y,Ae.Aa,w,Ae.pb)),X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We);!Ae.Ed&&w&&(w(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,We=Ae.Y[Ae.Y.length-1])}for(ct&&v.ownerDocument.activeElement!=ct&&ct.focus(),K(D.beforeRemove,Ze),tt=0;tt<Ze.length;++tt)Ze[tt].Aa=G;K(D.afterMove,ye),K(D.afterAdd,Ge)}})(),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(g,V,G,v){return(V=!(9>f.a.W)&&g.nodes?g.nodes():null)?f.a.la(V.cloneNode(!0).childNodes):(g=g.text(),f.a.ua(g,v))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),(function(){f.$a=function(){var V=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(G,v,X,Y){if(Y=Y||n,X=X||{},2>V)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var D=G.data("precompiled");return D||(D=G.text()||"",D=o.template(null,"{{ko_with $item.koBindingContext}}"+D+"{{/ko_with}}"),G.data("precompiled",D)),G=[v.$data],v=o.extend({koBindingContext:v},X.templateOptions),v=o.tmpl(D,G,v),v.appendTo(Y.createElement("div")),o.fragments={},v},this.createJavaScriptEvaluatorBlock=function(G){return"{{ko_code ((function() { return "+G+" })()) }}"},this.addTemplate=function(G,v){n.write("<script type='text/html' id='"+G+"'>"+v+"<\/script>")},0<V&&(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 g=new f.$a;0<g.Hd&&f.gc(g),f.b("jqueryTmplTemplateEngine",f.$a)})()})})()})()})();var pOt=ko;typeof window<"u"?(ko=window.ko,typeof i5<"u"?window.ko=i5:delete window.ko):(ko=global.ko,typeof i5<"u"?global.ko=i5:delete global.ko);var wR=pOt;var Xlr=x(T(),1);/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Y6="__knockoutObservables",H6="__knockoutSubscribable";function LCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=ZCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Y6||o===H6)&&!(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&&p1t(n,a)}}),e}function ZCe(e,t){var n=e[Y6];return!n&&t&&(n={},Object.defineProperty(e,Y6,{value:n})),n}function h1t(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),LCe.call(i,e,[t]),e}function p1t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=b1t(e,t,i))})}function b1t(e,t,n){var i=y1t(e,n);return i.subscribe(t)}function y1t(e,t){var n=t[H6];if(!n){n=new e.subscribable,Object.defineProperty(t,H6,{value:n});var i={};g1t(t,n,i),x1t(e,t,n,i)}return n}function g1t(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 x1t(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 RCe(e,t){if(!e)return null;var n=ZCe(e,!1);return n&&n[t]||null}function _1t(e,t){var n=RCe(e,t);n&&n.valueHasMutated()}function T1t(e){e.track=LCe,e.getObservable=RCe,e.valueHasMutated=_1t,e.defineProperty=h1t}var dM={attachToKo:T1t};var Z2o=_(T(),1),GCe="http://www.w3.org/2000/svg",ECe="cesium-svgPath-svg",S1t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(GCe,"svg:svg");i.setAttribute("class",ECe);let o=document.createElementNS(GCe,"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",`${ECe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},uM=S1t;dM.attachToKo(vS);uM.register(vS);var Se=vS;function mM(e){c(e)||(e=new _f),this._clock=e,this._eventHelper=new hr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=ee.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(mM.prototype,{clock:{get:function(){return this._clock}}});mM.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.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};mM.prototype.isDestroyed=function(){return!1};mM.prototype.destroy=function(){this._eventHelper.removeAll(),he(this)};var fM=mM;var M2o=_(T(),1);function C1t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,L.throwInstantiationError()}var z6=C1t;var O2o=_(T(),1);function V1t(e,t){if(!c(e))throw new L("func is required.");t=t??!0;let n=new ye,i=new ye;function o(){if(!o.canExecute)throw new L("Cannot execute command, canExecute is false.");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=V1t;var Y2o=_(T(),1);var HL={};HL.createCheckbox=function(e,t,n){C.typeOf.string("labelText",e),C.typeOf.string("checkedBinding",t);let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return c(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};HL.createSection=function(e,t,n,i){C.defined("panel",e),C.typeOf.string("headerText",t),C.typeOf.string("sectionVisibleBinding",n),C.typeOf.string("toggleSectionVisibilityBinding",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};HL.createRangeInput=function(e,t,n,i,o,r){C.typeOf.string("rangeText",e),C.typeOf.string("sliderValueBinding",t),C.typeOf.number("min",n),C.typeOf.number("max",i),r=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=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let l=document.createElement("div");l.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(l),d};HL.createRangeInputWithDynamicMinMax=function(e,t,n,i){C.typeOf.string("rangeText",e),C.typeOf.string("sliderValueBinding",t),i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};HL.createButton=function(e,t,n){C.typeOf.string("buttonText",e),C.typeOf.string("clickedBinding",t);let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return c(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var sd=HL;var K2o=_(T(),1);function L1t(e,t,n,i,o){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,o)}var Za=L1t;var q2o=_(T(),1);function XCe(e,t){if(!c(e))throw new L("command is required.");this._command=e,t=t??z.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Se.track(this,["toggled","tooltip"])}Object.defineProperties(XCe.prototype,{command:{get:function(){return this._command}}});var Qg=XCe;var nvo=_(T(),1);var FS="http://www.w3.org/2000/svg",wCe="http://www.w3.org/1999/xlink",VB,hM=Y.fromCssColorString("rgba(247,250,255,0.384)"),LB=Y.fromCssColorString("rgba(143,191,255,0.216)"),K6=Y.fromCssColorString("rgba(153,197,255,0.098)"),ZB=Y.fromCssColorString("rgba(255,255,255,0.086)"),Z1t=Y.fromCssColorString("rgba(255,255,255,0.267)"),R1t=Y.fromCssColorString("rgba(255,255,255,0)"),ICe=Y.fromCssColorString("rgba(66,67,68,0.3)"),WCe=Y.fromCssColorString("rgba(0,0,0,0.5)");function jg(e){return Y.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var pM={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 qf(e){let t=document.createElementNS(FS,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(qf(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(wCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function J6(e,t,n){let i=document.createElementNS(FS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(FS,"tspan");return o.textContent=n,i.appendChild(o),i}function G1t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var RB=new Y;function cs(e,t){let n=t.alpha,i=1-n;return RB.red=e.red*i+t.red*n,RB.green=e.green*i+t.green*n,RB.blue=e.blue*i+t.blue*n,RB.toCssColorString()}function Q6(e,t,n){let i=pM[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 qf(o)}function E1t(e,t,n){let i=pM[n],o=pM.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 qf(r)}function X1t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&VB!==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(),l,d;if(t.type==="touchstart"||t.type==="touchmove"?(l=t.touches[0].clientX,d=t.touches[0].clientY):(l=t.clientX,d=t.clientY),!i&&(l>a.right||l<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),f=l-o-a.left,p=d-r-a.top,y=Math.atan2(p,f)*180/Math.PI+90;y>180&&(y-=360);let h=n.shuttleRingAngle;i||l<u.right&&l>u.left&&d>u.top&&d<u.bottom?(VB=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=y):y<h?n.slower():y>h&&n.faster(),t.preventDefault()}else e===VB&&(VB=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=[Za(t,"toggled",this.setToggled,this),Za(t,"tooltip",this.setTooltip,this),Za(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();he(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 zL(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("viewModel is required.");e=Wn(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(FS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",wCe);let s=document.createElementNS(FS,"g");this._topG=s,this._realtimeSVG=new W0(E1t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new W0(Q6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new W0(Q6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new W0(Q6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(FS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let l=qf({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;let d=pM.animation_pathSwooshFX,u=pM.animation_pathPointer,f=qf({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=f,this._shuttleRingPointer=qf({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=qf({tagName:"g",transform:"translate(100,100)"});this._knobOuter=qf({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let y=61,h=qf({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:y});this._knobDate=J6(0,-24,""),this._knobTime=J6(0,-7,""),this._knobStatus=J6(0,-41,"");let g=qf({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:y}),x=document.createElementNS(FS,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(l),x.appendChild(f),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(g),r.appendChild(s),e.appendChild(r);let S=this;function V(v){X1t(S,v)}this._mouseCallback=V,l.addEventListener("mousedown",V,!0),l.addEventListener("touchstart",V,!0),f.addEventListener("mousedown",V,!0),f.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 Z=this._knobTime.childNodes[0],R=this._knobDate.childNodes[0],E=this._knobStatus.childNodes[0],I;this._subscriptions=[Za(t.pauseViewModel,"toggled",function(v){I!==v&&(I=v,I?S._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):S._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Za(t,"shuttleRingAngle",function(v){G1t(S._shuttleRingPointer,S._knobOuter,v)}),Za(t,"dateLabel",function(v){R.textContent!==v&&(R.textContent=v)}),Za(t,"timeLabel",function(v){Z.textContent!==v&&(Z.textContent=v)}),Za(t,"multiplierLabel",function(v){E.textContent!==v&&(E.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(zL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zL.prototype.isDestroyed=function(){return!1};zL.prototype.destroy=function(){c(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 he(this)};zL.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,l=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},${l})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t};zL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(c(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=jg(this._themeNormal),n=jg(this._themeHover),i=jg(this._themeSelect),o=jg(this._themeDisabled),r=jg(this._themeKnob),s=jg(this._themePointer),a=jg(this._themeSwoosh),l=jg(this._themeSwooshHover),d=qf({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,hM)},{tagName:"stop",offset:"12%","stop-color":cs(t,LB)},{tagName:"stop",offset:"46%","stop-color":cs(t,K6)},{tagName:"stop",offset:"81%","stop-color":cs(t,ZB)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(n,hM)},{tagName:"stop",offset:"12%","stop-color":cs(n,LB)},{tagName:"stop",offset:"46%","stop-color":cs(n,K6)},{tagName:"stop",offset:"81%","stop-color":cs(n,ZB)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(i,hM)},{tagName:"stop",offset:"12%","stop-color":cs(i,LB)},{tagName:"stop",offset:"46%","stop-color":cs(i,K6)},{tagName:"stop",offset:"81%","stop-color":cs(i,ZB)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(o,Z1t)},{tagName:"stop",offset:"75%","stop-color":cs(o,R1t)}]},{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":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.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,WCe)},{tagName:"stop",offset:"100%","stop-color":cs(s,WCe)}]},{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,hM)},{tagName:"stop",offset:"60%","stop-color":cs(r,ICe)},{tagName:"stop",offset:"85%","stop-color":cs(r,LB)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":cs(r,ICe)},{tagName:"stop",offset:"60%","stop-color":cs(r,hM)},{tagName:"stop",offset:"85%","stop-color":cs(r,ZB)}]}]});c(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var bM=zL;var cvo=_(T(),1);var I1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qg=15,KL=105;function PCe(e,t){return e-t}function j6(e,t){let n=Wo(t,e,PCe);return n<0?~n:n}function W1t(e,t){if(Math.abs(e)<=qg)return e/qg;let n=qg,i=KL,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 w1t(e,t,n){if(n.clockStep===fo.SYSTEM_CLOCK)return qg;if(Math.abs(e)<=1)return e*qg;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=qg,r=KL,s,a=0,l;return e>0?(s=Math.log(i),l=(s-a)/(r-o),(Math.log(e)-a)/l+o):(s=Math.log(-t[0]),l=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/l+o))}function Tm(e){if(!c(e))throw new L("clockViewModel is required.");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 w1t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,KL),-KL);let a=t._allShuttleRingTicks,l=t._clockViewModel;if(l.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===KL){l.multiplier=s>0?a[a.length-1]:a[0];return}let d=W1t(s,a);if(t.snapToTicks)d=a[j6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let f=u.toFixed(0).length-2,p=Math.pow(10,f);d=Math.round(d/p)*p|0}else u>qg?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}l.multiplier=d}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===zr.UNBOUNDED)return!0;let l=s.multiplier,d=s.currentTime,u=s.startTime,f=!1;if(a===zr.LOOP_STOP)f=ee.greaterThan(d,u)||d.equals(u)&&l>0;else{let p=s.stopTime;f=ee.greaterThan(d,u)&&ee.lessThan(d,p)||d.equals(u)&&l>0||d.equals(p)&&l<0}return f||(s.shouldAnimate=!1),f}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===zr.UNBOUNDED)return!0;let l=s.systemTime;return ee.greaterThanOrEquals(l,s.startTime)&&ee.lessThanOrEquals(l,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 Qg(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 Qg(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 Qg(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 Qg(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,l=s.multiplier,d=j6(l,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,d=j6(l,a)+1;d<a.length&&(s.multiplier=a[d])})}Tm.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${I1t[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=ee.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){if(!c(e))throw new L("positiveTicks is required.");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(PCe);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){if(typeof e!="function")throw new L("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if(typeof e!="function")throw new L("timeFormatter must be a function");this._timeFormatter=e}}});Tm._maxShuttleRingAngle=KL;Tm._realtimeShuttleRingAngle=qg;var yM=Tm;var gvo=_(T(),1);var fvo=_(T(),1);function vCe(e){e=e??z.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??z.EMPTY_ARRAY,i=e.terrainProviderViewModels??z.EMPTY_ARRAY;if(!c(t))throw new L("globe is required");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 f=o(),p={},y;for(y=0;y<f.length;y++){let x=f[y],S=x.category;c(p[S])?p[S].push(x):p[S]=[x]}let h=Object.keys(p),g=[];for(y=0;y<h.length;y++){let x=h[y];g.push({name:x,providers:p[x]})}return g});this._imageryProviders=r;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let f=s(),p={},y;for(y=0;y<f.length;y++){let x=f[y],S=x.category;c(p[S])?p[S].push(x):p[S]=[x]}let h=Object.keys(p),g=[];for(y=0;y<h.length;y++){let x=h[y];g.push({name:x,providers:p[x]})}return g});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let f=this.selectedImagery,p=this.selectedTerrain,y=c(f)?f.name:void 0,h=c(p)?p.name:void 0;return c(y)&&c(h)?`${y} -${h}`:c(y)?y:h}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let f=this.selectedImagery;if(c(f))return f.iconUrl}),this.selectedImagery=void 0;let l=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(f){if(l()===f){this.dropDownVisible=!1;return}let p,y=this._currentImageryLayers,h=y.length,g=this._globe.imageryLayers,x=!1;for(p=0;p<h;p++){let S=g.length;for(let V=0;V<S;V++){let Z=g.get(V);if(Z===y[p]){g.remove(Z),x=!0;break}}}if(c(f)){let S=f.creationCommand();if(Array.isArray(S)){let V=S.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let Z=Ya.fromProviderAsync(S[p]);g.add(Z,0),this._currentImageryLayers.push(Z)}}else{this._currentImageryLayers=[];let V=Ya.fromProviderAsync(S);if(V.name=f.name,x)g.add(V,0);else{let Z=g.get(0);c(Z)&&g.remove(Z),g.add(V,0)}this._currentImageryLayers.push(V)}}l(f),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(f){if(d()===f){this.dropDownVisible=!1;return}let p;if(c(f)&&(p=f.creationCommand()),c(p)&&!c(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof ep),this._globe.terrainProvider=p;else if(c(p)){let y=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{y=!0,h()}),x=new sM(p).readyEvent.addEventListener(S=>{y||(this._globe.depthTestAgainstTerrain=!(S instanceof ep),this._globe.terrainProvider=S,x())})}d(f),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Rn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(vCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var gM=vCe;function GB(e,t){if(!c(e))throw new L("container is required.");e=Wn(e);let n=new gM(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 l=document.createElement("div");l.className="cesium-baseLayerPicker-category",a.appendChild(l);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),l.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),l.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-item",f.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(f);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),f.appendChild(p);let y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),f.appendChild(y);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",r.appendChild(h);let g=document.createElement("div");g.className="cesium-baseLayerPicker-section",g.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(g);let x=document.createElement("div");x.className="cesium-baseLayerPicker-category",g.appendChild(x);let S=document.createElement("div");S.className="cesium-baseLayerPicker-categoryTitle",S.setAttribute("data-bind","text: name"),x.appendChild(S);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),x.appendChild(V);let Z=document.createElement("div");Z.className="cesium-baseLayerPicker-item",Z.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(Z);let R=document.createElement("img");R.className="cesium-baseLayerPicker-itemIcon",R.setAttribute("data-bind","attr: { src: iconUrl }"),R.setAttribute("draggable","false"),Z.appendChild(R);let E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),Z.appendChild(E),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)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(GB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});GB.prototype.isDestroyed=function(){return!1};GB.prototype.destroy=function(){return Ot.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),he(this)};var xM=GB;var Rvo=_(T(),1);var Cvo=_(T(),1);function FCe(e){if(!c(e.name))throw new L("options.name is required.");if(!c(e.tooltip))throw new L("options.tooltip is required.");if(!c(e.iconUrl))throw new L("options.iconUrl is required.");if(typeof e.creationFunction!="function")throw new L("options.creationFunction is required.");let t=e.creationFunction;c(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(FCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ls=FCe;function P1t(){let e=[],t=devicePixelRatio>=2;return e.push(new ls({name:"Bing Maps Aerial",iconUrl:on("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return m0({style:u0.AERIAL})}})),e.push(new ls({name:"Bing Maps Aerial with Labels",iconUrl:on("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return m0({style:u0.AERIAL_WITH_LABELS})}})),e.push(new ls({name:"Bing Maps Roads",iconUrl:on("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return m0({style:u0.ROAD})}})),e.push(new ls({name:"ArcGIS World Imagery",iconUrl:on("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 l0.fromBasemapType(Mf.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ls({name:"ArcGIS World Hillshade",iconUrl:on("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 l0.fromBasemapType(Mf.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ls({name:"Esri World Ocean",iconUrl:on("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 l0.fromBasemapType(Mf.OCEANS,{enablePickFeatures:!1})}})),e.push(new ls({name:"Open\xADStreet\xADMap",iconUrl:on("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 I0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ls({name:"Stadia x Stamen Watercolor",iconUrl:on("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 I0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var Oce="__knockoutObservables",Bce="__knockoutSubscribable";function vNe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=FNe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Oce||o===Bce)&&!(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&&gOt(n,a)}}),e}function FNe(e,t){var n=e[Oce];return!n&&t&&(n={},Object.defineProperty(e,Oce,{value:n})),n}function bOt(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),vNe.call(i,e,[t]),e}function gOt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=yOt(e,t,i))})}function yOt(e,t,n){var i=xOt(e,n);return i.subscribe(t)}function xOt(e,t){var n=t[Bce];if(!n){n=new e.subscribable,Object.defineProperty(t,Bce,{value:n});var i={};TOt(t,n,i),_Ot(e,t,n,i)}return n}function TOt(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 _Ot(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 INe(e,t){if(!e)return null;var n=FNe(e,!1);return n&&n[t]||null}function SOt(e,t){var n=INe(e,t);n&&n.valueHasMutated()}function ZOt(e){e.track=vNe,e.getObservable=INe,e.valueHasMutated=SOt,e.defineProperty=bOt}var o5={attachToKo:ZOt};var Ylr=x(T(),1),PNe="http://www.w3.org/2000/svg",XNe="cesium-svgPath-svg",ROt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(PNe,"svg:svg");i.setAttribute("class",XNe);let o=document.createElementNS(PNe,"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",`${XNe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},r5=ROt;o5.attachToKo(wR);r5.register(wR);var Ee=wR;function s5(e){l(e)||(e=new Lf),this._clock=e,this._eventHelper=new Hr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ee.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=Ee.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ee.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ee.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ee.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ee.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ee.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ee.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ee.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ee.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(s5.prototype,{clock:{get:function(){return this._clock}}});s5.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};s5.prototype.isDestroyed=function(){return!1};s5.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var a5=s5;var jlr=x(T(),1);function COt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,ge.throwInstantiationError()}var zce=COt;var ndr=x(T(),1);function VOt(e,t){t=t??!0;let n=new Se,i=new Se;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,Ee.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Fn=VOt;var sdr=x(T(),1);var NA={};NA.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};NA.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};NA.createRangeInput=function(e,t,n,i,o,r){r=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=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};NA.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};NA.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 hu=NA;var ldr=x(T(),1);function EOt(e,t,n,i,o){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,o)}var Sc=EOt;var pdr=x(T(),1);function NNe(e,t){this._command=e,t=t??B.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Ee.track(this,["toggled","tooltip"])}Object.defineProperties(NNe.prototype,{command:{get:function(){return this._command}}});var wT=NNe;var Tdr=x(T(),1);var Al="http://www.w3.org/2000/svg",kNe="http://www.w3.org/1999/xlink",VJ,c5=U.fromCssColorString("rgba(247,250,255,0.384)"),EJ=U.fromCssColorString("rgba(143,191,255,0.216)"),Hce=U.fromCssColorString("rgba(153,197,255,0.098)"),AJ=U.fromCssColorString("rgba(255,255,255,0.086)"),AOt=U.fromCssColorString("rgba(255,255,255,0.267)"),GOt=U.fromCssColorString("rgba(255,255,255,0)"),YNe=U.fromCssColorString("rgba(66,67,68,0.3)"),wNe=U.fromCssColorString("rgba(0,0,0,0.5)");function MT(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var l5={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 fp(e){let t=document.createElementNS(Al,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(fp(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(kNe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Jce(e,t,n){let i=document.createElementNS(Al,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(Al,"tspan");return o.textContent=n,i.appendChild(o),i}function LOt(e,t){let n=Jce(e,t,"");n.removeChild(n.firstChild);let i={},o=[],r=["month","day","year"];for(let a=0;a<r.length;++a){if(a>0){let u=document.createElementNS(Al,"tspan");u.textContent=" ",o.push(u),n.appendChild(u)}let c=r[a],d=document.createElementNS(Al,"tspan");d.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),d.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=d,n.appendChild(d)}let s=document.createElementNS(Al,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:o}}function WOt(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,o=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",o[0].textContent="",o[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],o[0].textContent=" ",o[1].textContent=" ",e.fallback.textContent=""}function vOt(e,t){let n=Jce(e,t,"");n.removeChild(n.firstChild);let i={},o=[],r=["hour","minute","second"];for(let u=0;u<r.length;++u){if(u>0){let b=document.createElementNS(Al,"tspan");b.textContent=":",o.push(b),n.appendChild(b)}let m=r[u],p=document.createElementNS(Al,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${m}`),p.setAttribute("aria-label",`Adjust ${m} with mouse wheel`),i[m]=p,n.appendChild(p)}let s=document.createElementNS(Al,"tspan");n.appendChild(s);let a=document.createElementNS(Al,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(Al,"tspan");n.appendChild(c);let d=document.createElementNS(Al,"tspan");return n.appendChild(d),{decimalPoint:s,element:n,fallback:d,parts:i,separators:o,suffix:c}}function FOt(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,o=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",o[0].textContent="",o[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],o[0].textContent=":",o[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function MNe(e,t,n){let i=Object.keys(t);for(let o=0;o<i.length;++o){let r=i[o],s=t[r],a=function(c){c.deltaY!==0&&(n(r,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function IOt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var GJ=new U;function zs(e,t){let n=t.alpha,i=1-n;return GJ.red=e.red*i+t.red*n,GJ.green=e.green*i+t.green*n,GJ.blue=e.blue*i+t.blue*n,GJ.toCssColorString()}function Kce(e,t,n){let i=l5[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 fp(o)}function POt(e,t,n){let i=l5[n],o=l5.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 fp(r)}function XOt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&VJ!==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(),m=c-o-a.left,p=d-r-a.top,b=Math.atan2(p,m)*180/Math.PI+90;b>180&&(b-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(VJ=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=b):b<f?n.slower():b>f&&n.faster(),t.preventDefault()}else e===VJ&&(VJ=void 0),n.shuttleRingDragging=!1}function yy(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=[Sc(t,"toggled",this.setToggled,this),Sc(t,"tooltip",this.setTooltip,this),Sc(t.command,"canExecute",this.setEnabled,this)]}yy.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)};yy.prototype.isDestroyed=function(){return!1};yy.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")}};yy.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")))};yy.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function YA(e,t){e=Nn(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(Al,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",kNe);let s=document.createElementNS(Al,"g");this._topG=s,this._realtimeSVG=new yy(POt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new yy(Kce(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new yy(Kce(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new yy(Kce(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Al,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=fp({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=l5.animation_pathSwooshFX,u=l5.animation_pathPointer,m=fp({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=m,this._shuttleRingPointer=fp({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=fp({tagName:"g",transform:"translate(100,100)"});this._knobOuter=fp({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let b=61,f=fp({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:b}),y=LOt(0,-24);this._knobDate=y.element;let _=vOt(0,-7);this._knobTime=_.element,this._knobStatus=Jce(0,-41,"");let S=fp({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:b}),Z=document.createElementNS(Al,"g");Z.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(Z),s.appendChild(p),s.appendChild(a),Z.appendChild(c),Z.appendChild(m),Z.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobStatus),p.appendChild(S),p.appendChild(this._knobDate),p.appendChild(this._knobTime),r.appendChild(s),e.appendChild(r);let R=this;function C(L){XOt(R,L)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),m.addEventListener("mousedown",C,!0),m.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let E=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],MNe(this,y.parts,function(L,F){t.adjustDate(L,F)}),MNe(this,_.parts,function(L,F){t.adjustTime(L,F)});let A;this._subscriptions=[Sc(t.pauseViewModel,"toggled",function(L){A!==L&&(A=L,A?R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Sc(t,"shuttleRingAngle",function(L){IOt(R._shuttleRingPointer,R._knobOuter,L)}),Sc(t,"dateLabel",function(L){R._knobDate.textContent!==L&&WOt(y,L)}),Sc(t,"timeLabel",function(L){R._knobTime.textContent!==L&&FOt(_,L)}),Sc(t,"multiplierLabel",function(L){E.textContent!==L&&(E.textContent=L)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(YA.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YA.prototype.isDestroyed=function(){return!1};YA.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);let n=this._fieldWheelListeners;for(let o=0;o<n.length;++o){let r=n[o];r.element.removeEventListener("wheel",r.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let o=0,r=i.length;o<r;o++)i[o].dispose();return me(this)};YA.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};YA.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=MT(this._themeNormal),n=MT(this._themeHover),i=MT(this._themeSelect),o=MT(this._themeDisabled),r=MT(this._themeKnob),s=MT(this._themePointer),a=MT(this._themeSwoosh),c=MT(this._themeSwooshHover),d=fp({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(t,c5)},{tagName:"stop",offset:"12%","stop-color":zs(t,EJ)},{tagName:"stop",offset:"46%","stop-color":zs(t,Hce)},{tagName:"stop",offset:"81%","stop-color":zs(t,AJ)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(n,c5)},{tagName:"stop",offset:"12%","stop-color":zs(n,EJ)},{tagName:"stop",offset:"46%","stop-color":zs(n,Hce)},{tagName:"stop",offset:"81%","stop-color":zs(n,AJ)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(i,c5)},{tagName:"stop",offset:"12%","stop-color":zs(i,EJ)},{tagName:"stop",offset:"46%","stop-color":zs(i,Hce)},{tagName:"stop",offset:"81%","stop-color":zs(i,AJ)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(o,AOt)},{tagName:"stop",offset:"75%","stop-color":zs(o,GOt)}]},{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":zs(s,wNe)},{tagName:"stop",offset:"100%","stop-color":zs(s,wNe)}]},{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":zs(r,c5)},{tagName:"stop",offset:"60%","stop-color":zs(r,YNe)},{tagName:"stop",offset:"85%","stop-color":zs(r,EJ)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,YNe)},{tagName:"stop",offset:"60%","stop-color":zs(r,c5)},{tagName:"stop",offset:"85%","stop-color":zs(r,AJ)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var d5=YA;var Adr=x(T(),1);var NOt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],kT=15,wA=105,YOt=[31,28,31,30,31,30,31,31,30,31,30,31];function wOt(e,t){return t===2&&pu(e)?29:YOt[t-1]}function UNe(e,t,n){return Q.fromGregorianDate(new vh(t,n,Math.min(e.day,wOt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function DNe(e,t){return e-t}function jce(e,t){let n=Eo(t,e,DNe);return n<0?~n:n}function MOt(e,t){if(Math.abs(e)<=kT)return e/kT;let n=kT,i=wA,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 kOt(e,t,n){if(n.clockStep===Oo.SYSTEM_CLOCK)return kT;if(Math.abs(e)<=1)return e*kT;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=kT,r=wA,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 fu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=fu.defaultDateFormatter,this._timeFormatter=fu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(fu.defaultTicks),this.timeLabel=void 0,Ee.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ee.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ee.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===Oo.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,Ee.defineProperty(this,"shuttleRingAngle",{get:function(){return kOt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,wA),-wA);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===wA){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=MOt(s,a);if(t.snapToTicks)d=a[jce(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let m=u.toFixed(0).length-2,p=Math.pow(10,m);d=Math.round(d/p)*p|0}else u>kT?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Ee.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===As.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m;if(a===As.LOOP_STOP)m=Q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;m=Q.greaterThan(d,u)&&Q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Ee.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===As.UNBOUNDED)return!0;let c=s.systemTime;return Q.greaterThanOrEquals(c,s.startTime)&&Q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ee.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Fn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new wT(n,{toggled:Ee.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new wT(i,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new wT(o,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Oo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Fn(function(){t._clockViewModel.clockStep=Oo.SYSTEM_CLOCK},Ee.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new wT(r,{toggled:Ee.computed(function(){return e.clockStep===Oo.SYSTEM_CLOCK}),tooltip:Ee.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=jce(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=jce(c,a)+1;d<a.length&&(s.multiplier=a[d])})}fu.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${NOt[n.month-1]} ${n.day} ${n.year}`};fu.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];fu.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`};fu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};fu.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(DNe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);ii(s,r),this._allShuttleRingTicks=s};fu.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,o=Q.toGregorianDate(i),r;if(e==="day"){r=Q.addDays(i,t,new Q);let s=Q.toGregorianDate(r);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((o.year-1)*12+o.month-1+t,0),119987),c=Math.floor(a/12)+1,d=a%12+1;r=UNe(o,c,d)}else{let s=Math.min(Math.max(o.year+t,1),9999);r=UNe(o,s,o.month)}Q.equals(i,r)||(n.shouldAnimate=!1,n.currentTime=r)};fu.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,o;if(e==="hour")o=Q.addHours(i,t,new Q);else if(e==="minute")o=Q.addMinutes(i,t,new Q);else{let s=e==="second"?t:t/1e3;o=Q.addSeconds(i,s,new Q)}let r=Q.toGregorianDate(o);r.year<1||r.year>9999||(n.shouldAnimate=!1,n.currentTime=o)};Object.defineProperties(fu.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}}});fu._maxShuttleRingAngle=wA;fu._realtimeShuttleRingAngle=kT;var u5=fu;var kdr=x(T(),1);var Idr=x(T(),1);function ONe(e){e=e??B.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??B.EMPTY_ARRAY,i=e.terrainProviderViewModels??B.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ee.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ee.getObservable(this,"imageryProviderViewModels"),r=Ee.pureComputed(function(){let m=o(),p={},b;for(b=0;b<m.length;b++){let _=m[b],S=_.category;l(p[S])?p[S].push(_):p[S]=[_]}let f=Object.keys(p),y=[];for(b=0;b<f.length;b++){let _=f[b];y.push({name:_,providers:p[_]})}return y});this._imageryProviders=r;let s=Ee.getObservable(this,"terrainProviderViewModels"),a=Ee.pureComputed(function(){let m=s(),p={},b;for(b=0;b<m.length;b++){let _=m[b],S=_.category;l(p[S])?p[S].push(_):p[S]=[_]}let f=Object.keys(p),y=[];for(b=0;b<f.length;b++){let _=f[b];y.push({name:_,providers:p[_]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Ee.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,b=l(m)?m.name:void 0,f=l(p)?p.name:void 0;return l(b)&&l(f)?`${b} +${f}`:l(b)?b:f}),this.buttonImageUrl=void 0,Ee.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Ee.observable();this._currentImageryLayers=[],Ee.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,b=this._currentImageryLayers,f=b.length,y=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let S=y.length;for(let Z=0;Z<S;Z++){let R=y.get(Z);if(R===b[p]){y.remove(R),_=!0;break}}}if(l(m)){let S=m.creationCommand();if(Array.isArray(S)){let Z=S.length;for(this._currentImageryLayers=[],p=Z-1;p>=0;p--){let R=Zs.fromProviderAsync(S[p]);y.add(R,0),this._currentImageryLayers.push(R)}}else{this._currentImageryLayers=[];let Z=Zs.fromProviderAsync(S);if(Z.name=m.name,_)y.add(Z,0);else{let R=y.get(0);l(R)&&y.remove(R),y.add(Z,0)}this._currentImageryLayers.push(Z)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Ee.observable();Ee.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(m){if(d()===m){this.dropDownVisible=!1;return}let p;if(l(m)&&(p=m.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof G0),this._globe.terrainProvider=p;else if(l(p)){let b=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{b=!0,f()}),_=new jU(p).readyEvent.addEventListener(S=>{b||(this._globe.depthTestAgainstTerrain=!(S instanceof G0),this._globe.terrainProvider=S,_())})}d(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Fn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(ONe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var m5=ONe;function LJ(e,t){e=Nn(e);let n=new m5(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 m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.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(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let b=document.createElement("div");b.className="cesium-baseLayerPicker-itemLabel",b.setAttribute("data-bind","text: name"),m.appendChild(b);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 y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",y.appendChild(_);let S=document.createElement("div");S.className="cesium-baseLayerPicker-categoryTitle",S.setAttribute("data-bind","text: name"),_.appendChild(S);let Z=document.createElement("div");Z.className="cesium-baseLayerPicker-choices",Z.setAttribute("data-bind","foreach: providers"),_.appendChild(Z);let R=document.createElement("div");R.className="cesium-baseLayerPicker-item",R.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),Z.appendChild(R);let C=document.createElement("img");C.className="cesium-baseLayerPicker-itemIcon",C.setAttribute("data-bind","attr: { src: iconUrl }"),C.setAttribute("draggable","false"),R.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),R.appendChild(E),Ee.applyBindings(n,i),Ee.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(A){i.contains(A.target)||r.contains(A.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(LJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});LJ.prototype.isDestroyed=function(){return!1};LJ.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._element),Ee.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var h5=LJ;var Qdr=x(T(),1);var Hdr=x(T(),1);function BNe(e){let t=e.creationFunction;l(t.canExecute)||(t=Fn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Ee.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(BNe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var mr=BNe;function UOt(){let e=[],t=devicePixelRatio>=2;return e.push(new mr({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Kb({style:Hb.AERIAL})}})),e.push(new mr({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Kb({style:Hb.AERIAL_WITH_LABELS})}})),e.push(new mr({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Kb({style:Hb.ROAD})}})),e.push(new mr({name:"ArcGIS World Imagery",iconUrl:en("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 Bb.fromBasemapType(mf.SATELLITE,{enablePickFeatures:!1})}})),e.push(new mr({name:"ArcGIS World Hillshade",iconUrl:en("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 Bb.fromBasemapType(mf.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new mr({name:"Esri World Ocean",iconUrl:en("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 Bb.fromBasemapType(mf.OCEANS,{enablePickFeatures:!1})}})),e.push(new mr({name:"Open\xADStreet\xADMap",iconUrl:en("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 cy({url:"https://tile.openstreetmap.org/"})}})),e.push(new mr({name:"Stadia x Stamen Watercolor",iconUrl:en("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 cy({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ls({name:"Stadia x Stamen Toner",iconUrl:on("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 I0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia x Stamen Toner",iconUrl:en("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 cy({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ls({name:"Stadia Alidade Smooth",iconUrl:on("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 I0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia Alidade Smooth",iconUrl:en("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 cy({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ls({name:"Stadia Alidade Smooth Dark",iconUrl:on("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 I0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia Alidade Smooth Dark",iconUrl:en("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 cy({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ls({name:"Sentinel-2",iconUrl:on("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 d0.fromAssetId(3954)}})),e.push(new ls({name:"Blue Marble",iconUrl:on("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return d0.fromAssetId(3845)}})),e.push(new ls({name:"Earth at night",iconUrl:on("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 d0.fromAssetId(3812)}})),e.push(new ls({name:"Natural Earth\xA0II",iconUrl:on("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Rg.fromUrl(on("Assets/Textures/NaturalEarthII"))}})),e}var _M=P1t;var Ivo=_(T(),1);function v1t(){let e=[];return e.push(new ls({name:"WGS84 Ellipsoid",iconUrl:on("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new ep({ellipsoid:re.WGS84})}})),e.push(new ls({name:"Cesium World Terrain",iconUrl:on("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 TS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var TM=v1t;var Uvo=_(T(),1);var vvo=_(T(),1);function F1t(e){return function(t){let n=e._scene.pick(t.position);c(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function MCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);c(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},Vn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Vn.MOUSE_MOVE),e.picking=e.picking)}var A1t={maximumFractionDigits:3};function SM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,A1t):Math.round(t).toLocaleString()}function CM(e,t){if(!c(e))return"";let n=t?e._statisticsPerPass[Fo.PICK]:e._statisticsPerPass[Fo.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>${SM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${SM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${SM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function NCe(){let e=Ri.statistics;return` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Sentinel-2",iconUrl:en("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 $l.fromAssetId(3954)}})),e.push(new mr({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3845)}})),e.push(new mr({name:"Earth at night",iconUrl:en("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 $l.fromAssetId(3812)}})),e.push(new mr({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return yx.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e.push(new mr({name:"Google Maps Satellite",iconUrl:en("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3830182)}})),e.push(new mr({name:"Google Maps Satellite with Labels",iconUrl:en("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3830183)}})),e.push(new mr({name:"Google Maps Roadmap",iconUrl:en("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3830184)}})),e.push(new mr({name:"Google Maps Contour",iconUrl:en("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3830186)}})),e.push(new mr({name:"Azure Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3891168)}})),e.push(new mr({name:"Azure Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return $l.fromAssetId(3891169)}})),e}var f5=UOt;var tur=x(T(),1);function DOt(){let e=[];return e.push(new mr({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new G0({ellipsoid:ne.WGS84})}})),e.push(new mr({name:"Cesium World Terrain",iconUrl:en("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 BZ({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var p5=DOt;var fur=x(T(),1);var aur=x(T(),1);function WJ(e,t){l(t)||(t=document.body),t=Nn(t);let n=this,i=Ee.observable(qr.fullscreen),o=Ee.observable(qr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ee.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ee.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&qr.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Fn(function(){qr.fullscreen?qr.exitFullscreen():qr.requestFullscreen(n._fullscreenElement)},Ee.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Nn(e)??r.body,this._callback=function(){i(qr.fullscreen)},r.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(WJ.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});WJ.prototype.isDestroyed=function(){return!1};WJ.prototype.destroy=function(){document.removeEventListener(qr.changeEventName,this._callback),me(this)};var b5=WJ;var OOt="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",BOt="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 vJ(e,t){e=Nn(e);let n=new b5(t,e);n._exitFullScreenPath=BOt,n._enterFullScreenPath=OOt;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),Ee.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(vJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vJ.prototype.isDestroyed=function(){return!1};vJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var g5=vJ;var Eur=x(T(),1);var Tur=x(T(),1);var zNe=1e3;function pp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new JZ({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 Se,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=KNe,this._handleArrowUp=HNe;let t=this;this._suggestionsVisible=Ee.pureComputed(function(){let o=Ee.getObservable(t,"_suggestions")().length>0,r=Ee.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Fn(function(i){if(i=i??ST.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)QOt(t);else return JOt(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?HNe(t):r?KNe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;QNe(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=e.autocomplete??!0,this.destinationFound=e.destinationFound??pp.flyToDestination,this._focusTextbox=!1,Ee.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ee.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){pp._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ee.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ee.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ee.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(pp.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}}});function HNe(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],pp._adjustSuggestionsScroll(e,n)}function KNe(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],pp._adjustSuggestionsScroll(e,i)}function zOt(e,t){let n=l(t)?t.availability:void 0;return l(n)?jZ(t,[e]).then(function(i){return e=i[0],e.height+=zNe,e}):(e.height+=zNe,Promise.resolve(e))}function HOt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof re?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=re.center(t):a=cR(t,n):t=i.cartesianToCartographic(t),l(a)||(a=zOt(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:P.IDENTITY})})}async function KOt(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 JOt(e,t,n){let i=e._searchText;if(jNe(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 KOt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,qce(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=JNe(e,oA.getCreditsFromResult(s[0]));l(a)||Qce(e,t[o].credit);return}e._searchText=`${i} (not found)`}function Qce(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function JNe(e,t){return l(t)&&t.forEach(n=>Qce(e,n)),t}function qce(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function jOt(e,t){let n=Nn(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 QOt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function jNe(e){return/^\s*$/.test(e)}function QNe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function qOt(e){if(!e.autoComplete)return;let t=e._searchText;if(QNe(e),qce(e),!jNe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,ST.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=oA.getCreditsFromResult(r);o=o&&!l(s),JNe(e,s)}),o&&Qce(e,n.credit)}if(e._suggestions.length>=5)return}}pp.flyToDestination=HOt;pp._updateSearchSuggestions=qOt;pp._adjustSuggestionsScroll=jOt;pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),qce(this),me(this)};var y5=pp;var $Ot="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",eBt="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 FJ(e){let t=Nn(e.container),n=new y5(e);n._startSearchPath=$Ot,n._stopSearchPath=eBt;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),Ee.applyBindings(n,i),Ee.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()},fn.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(FJ.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});FJ.prototype.isDestroyed=function(){return!1};FJ.prototype.destroy=function(){let e=this._container;return fn.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(),Ee.cleanNode(this._form),Ee.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var x5=FJ;var kur=x(T(),1);var Fur=x(T(),1);function tBt(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>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function $ce(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var nBt=new gn,iBt=new h;function T5(e,t){let n=this,i=e.canvas,o=new la(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="",Ee.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=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Fn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Fn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Fn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ee.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Ee.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Ee.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new ly({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Fn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ee.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Fn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new zk({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=Ee.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Fn(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=Ee.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ee.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Ee.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Fn(function(){let d=n.depthFrustum+1;return n.depthFrustum=$ce(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Fn(function(){let d=n.depthFrustum-1;return n.depthFrustum=$ce(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ee.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Fn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new qU({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ee.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ee.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Fn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Fn(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=Ee.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=Fn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ee.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,mn.LEFT_CLICK):o.removeInputAction(mn.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,nBt),b=r.pick(p,n._scene,iBt);if(l(b)){let f=m.cartesianToCartographic(b),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<y.length;++_){let S=y[_];if(l(S))for(let Z=0;!u&&Z<S.length;++Z){let R=S[Z];re.contains(R.rectangle,f)&&(u=R)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Fn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ee.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,mn.LEFT_CLICK):o.removeInputAction(mn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(T5.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 Fn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Fn(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}}});T5.prototype._update=function(){this.frustums&&(this.frustumStatisticText=tBt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=$ce(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}`};T5.prototype.isDestroyed=function(){return!1};T5.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 _5=T5;function IJ(e,t){e=Nn(e);let n=document.createElement("div"),i=new _5(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=hu.createSection,c=hu.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(m),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 b=document.createElement("div");d.appendChild(b);let f=document.createElement("span");f.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(f);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(y);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(_);let S=document.createElement("input");S.type="button",S.value="+",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(S);let Z=a(s,"Primitives","primitivesVisible","togglePrimitives"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",Z.appendChild(R);let C=document.createElement("input");C.type="button",C.value="Pick a primitive",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(C),R.appendChild(E),R.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),R.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),R.appendChild(this._primitiveOnly);let A=a(s,"Terrain","terrainVisible","toggleTerrain"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",A.appendChild(L);let F=document.createElement("input");F.type="button",F.value="Pick a tile",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),E=document.createElement("div"),E.appendChild(F),E.className="cesium-cesiumInspector-center",L.appendChild(E);let I=document.createElement("div");L.appendChild(I);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let V=document.createElement("input");V.type="button",V.value="NE",V.className="cesium-cesiumInspector-pickButton",V.setAttribute("data-bind","click: selectNE");let G=document.createElement("input");G.type="button",G.value="SW",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectSW");let v=document.createElement("input");v.type="button",v.value="SE",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSE");let X=document.createElement("div");X.className="cesium-cesiumInspector-tileText",I.className="cesium-cesiumInspector-frustumStatistics",I.appendChild(X),I.setAttribute("data-bind","visible: hasPickedTile"),X.setAttribute("data-bind","html: tileText");let Y=document.createElement("div");Y.className="cesium-cesiumInspector-relativeText",Y.textContent="Select relative:",I.appendChild(Y);let D=document.createElement("table"),w=document.createElement("tr"),O=document.createElement("tr"),M=document.createElement("td");M.appendChild(N);let z=document.createElement("td");z.appendChild(g);let K=document.createElement("td");K.appendChild(V),w.appendChild(M),w.appendChild(z),w.appendChild(K);let te=document.createElement("td"),H=document.createElement("td");H.appendChild(G);let $=document.createElement("td");$.appendChild(v),O.appendChild(te),O.appendChild(H),O.appendChild($),D.appendChild(w),D.appendChild(O),I.appendChild(D),L.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),L.appendChild(c("Show only selected","filterTile","hasPickedTile")),A.appendChild(c("Wireframe","wireframe")),A.appendChild(c("Suspend LOD update","suspendUpdates")),A.appendChild(c("Show tile coordinates","tileCoordinates")),Ee.applyBindings(i,this._element)}Object.defineProperties(IJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});IJ.prototype.isDestroyed=function(){return!1};IJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var S5=IJ;var $ur=x(T(),1);var zur=x(T(),1);function oBt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof zr&&(e.tileset=n.primitive),e.pickActive=!1}}function $Ne(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof zr&&(e.tileset=i.primitive)},mn.MOUSE_MOVE):(e._eventHandler.removeInputAction(mn.MOUSE_MOVE),e.picking=e.picking)}var rBt={maximumFractionDigits:3};function Z5(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,rBt):Math.round(t).toLocaleString()}function R5(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[lr.PICK]:e._statisticsPerPass[lr.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>${Z5(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${Z5(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${Z5(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function eYe(){let e=Ni.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${SM(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${SM(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${Z5(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${Z5(e.texturesByteLength)}</li> </ul> - `}var M1t=[{text:"Highlight",value:Wl.HIGHLIGHT},{text:"Replace",value:Wl.REPLACE},{text:"Mix",value:Wl.MIX}],ACe=new Y(1,1,0,.4),N1t=new Y,EB=new Y;function Ra(e,t){C.typeOf.object("scene",e),C.typeOf.object("performanceContainer",t);let n=this,i=e.canvas;this._eventHandler=new tu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new p0({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 U=[],K=n._properties();for(let Q in K)K.hasOwnProperty(Q)&&U.push(Q);return U});let o=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),c(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Wl.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(K){let Q=e.pick(K.endPosition);if(Q instanceof Us?(n.feature=Q,n.tile=Q.content.tile):c(Q)&&c(Q.content)?(n.feature=void 0,n.tile=Q.content.tile):(n.feature=void 0,n.tile=void 0),!!c(n._tileset)){if(s&&c(Q)&&c(Q.content)){let ie;e.pickPositionSupported&&(ie=e.pickPosition(K.endPosition),c(ie)&&(n._tileset.debugPickPosition=ie)),n._tileset.debugPickedTile=Q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Vn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Vn.MOUSE_MOVE))}}),this.picking=!0;let l=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return l()},set:function(U){l(U),c(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let d=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return d()},set:function(U){d(U),c(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let u=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(U){u(U),c(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let f=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return f()},set:function(U){f(U),c(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),c(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let y=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return y()},set:function(U){y(U),c(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),c(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(U){h(U),c(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let g=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return g()},set:function(U){g(U),c(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(U){x(U),c(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return S()},set:function(U){S(U),c(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let V=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(U){U=Number(U),isNaN(U)||(V(U),c(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let Z=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return Z()},set:function(U){U=Number(U),isNaN(U)||(Z(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(Z(),1/6)},set:function(U){let K=Math.pow(U,6);Z(K),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=K)}});let R=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let E=F1t(this),I=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return I()},set:function(U){I(U),U?n._eventHandler.setInputAction(E,Vn.LEFT_CLICK):n._eventHandler.removeInputAction(Vn.LEFT_CLICK)}});let v=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(U){v(U),c(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let P=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(U){U=Number(U),isNaN(U)||(P(U),c(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let F=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),c(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let N=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),c(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let b=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(U){b(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let G=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return G()},set:function(U){U=Number(U),isNaN(U)||(G(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let X=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return X()},set:function(U){U=Number(U),isNaN(U)||(X(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let W=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return W()},set:function(U){W(U),c(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let A=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),c(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let k=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),c(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let B=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return B()},set:function(U){U=Number(U),isNaN(U)||(B(U),c(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let O=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return O()},set:function(U){O(U),c(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let H=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return H()},set:function(U){H(U),c(n._tileset)&&(n._tileset.loadSiblings=U)}}),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()}),c(this._tileset)||MCe(this,!0)}Object.defineProperties(Ra.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 M1t}},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,c(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=CM(e,!1),this._pickStatisticsText=CM(e,!0),this._resourceCacheStatisticsText=NCe(),MCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;c(t)&&!t.content.isDestroyed()&&(!this.colorize&&c(this._style)?t.color=c(this._style.color)?this._style.color.evaluateColor(t,N1t):Y.WHITE:t.color=EB,this._scene.requestRender()),c(e)&&(Y.clone(e.color,EB),e.color=ACe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;c(t)&&!t.isDestroyed()&&!q6(t.content)&&(t.color=EB,this._scene.requestRender()),c(e)&&!q6(e.content)&&(Y.clone(e.color,EB),e.color=ACe,this._scene.requestRender()),this._tile=e}}});function q6(e){if(!c(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)if(!q6(t[i]))return!1;return!0}return!1}Ra.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Ra.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Ra.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Ra.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Ra.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Ra.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Ra.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Ra.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Ra.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Ra.prototype.trimTilesCache=function(){c(this._tileset)&&this._tileset.trimLoadedTiles()};Ra.prototype.compileStyle=function(){let e=this._tileset;if(!(!c(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}};Ra.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(` -`),l=a.length,d;if(t.shiftKey)for(d=0;d<l;++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<l;++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};Ra.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),c(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=CM(e,!1),this._pickStatisticsText=CM(e,!0),this._resourceCacheStatisticsText=NCe())};Ra.prototype.isDestroyed=function(){return!1};Ra.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),he(this)};Ra.getStatistics=CM;var VM=Ra;function XB(e,t){C.defined("container",e),C.typeOf.object("scene",t),e=Wn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new VM(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=sd.createSection,l=sd.createCheckbox,d=sd.createRangeInput,u=sd.createButton,f=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),y=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),g=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),S=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let Z=document.createElement("label");Z.className="field-label",Z.appendChild(document.createTextNode("Properties: "));let R=document.createElement("div");R.setAttribute("data-bind","text: properties"),V.appendChild(Z),V.appendChild(R),f.appendChild(V),f.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),f.appendChild(u("Trim Tiles Cache","trimTilesCache")),f.appendChild(l("Enable Picking","picking")),p.appendChild(l("Colorize","colorize"));let E=p.appendChild(l("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.",E.appendChild(I),p.appendChild(l("Bounding Volumes","showBoundingVolumes")),p.appendChild(l("Content Volumes","showContentBoundingVolumes")),p.appendChild(l("Request Volumes","showRequestVolumes")),p.appendChild(l("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(l("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),y.appendChild(l("Freeze Frame","freezeFrame")),y.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));let F=document.createElement("div");F.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),y.appendChild(F);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),y.appendChild(N),h.appendChild(l("Performance","performance")),h.appendChild(i),h.appendChild(l("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(b),h.appendChild(l("Pick Statistics","showPickStatistics"));let G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(G),h.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));let X=document.createElement("div");X.className="cesium-3dTilesInspector-statistics",X.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(X);let W=document.createElement("div");x.appendChild(W),W.appendChild(document.createTextNode("Color Blend Mode: "));let A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),W.appendChild(A);let k=document.createElement("textarea");k.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),W.className="cesium-cesiumInspector-styleEditor",W.appendChild(k);let B=u("Compile (Ctrl+Enter)","compileStyle");W.appendChild(B);let O=document.createElement("div");O.className="cesium-cesiumInspector-error",O.setAttribute("data-bind","text: editorError"),W.appendChild(O),g.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),g.appendChild(l("Geometric Error","showGeometricError")),g.appendChild(l("Rendering Statistics","showRenderingStatistics")),g.appendChild(l("Memory Usage (MB)","showMemoryUsage")),g.appendChild(l("Url","showUrl")),S.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));let H=document.createElement("div");H.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),S.appendChild(H);let U=document.createElement("div");U.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(U);let K=document.createElement("div");K.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),S.appendChild(K),S.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),S.appendChild(l("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(o,n)}Object.defineProperties(XB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XB.prototype.isDestroyed=function(){return!1};XB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),he(this)};var LM=XB;var qvo=_(T(),1);var Hvo=_(T(),1);function k1t(e){let t;if(c(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 l=Math.pow(2,a);o>=l&&(s.push(a+1),o-=l)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function $6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var U1t=new bn,O1t=new m;function ZM(e,t){if(!c(e))throw new L("scene is required");if(!c(t))throw new L("performanceContainer is required");let n=this,i=e.canvas,o=new tu(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 p0({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 Y9({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else c(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 c(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:c(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=$6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let d=n.depthFrustum-1;return n.depthFrustum=$6(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&&!c(s)?s=e.imageryLayers.addImageryProvider(new cM({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&c(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=[],c(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});c(u)&&(n.primitive=c(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,Vn.LEFT_CLICK):o.removeInputAction(Vn.LEFT_CLICK)});function l(d){let u,f=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,U1t),y=r.pick(p,n._scene,O1t);if(c(y)){let h=f.cartesianToCartographic(y),g=r._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!u&&x<g.length;++x){let S=g[x];if(c(S))for(let V=0;!u&&V<S.length;++V){let Z=S[V];de.contains(Z.rectangle,h)&&(u=Z)}}}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(l,Vn.LEFT_CLICK):o.removeInputAction(Vn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(ZM.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,c(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,c(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(c(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;c(n)&&c(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}}});ZM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=k1t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=$6(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}`};ZM.prototype.isDestroyed=function(){return!1};ZM.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(),he(this)};var RM=ZM;function IB(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let n=document.createElement("div"),i=new RM(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=sd.createSection,l=sd.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=l("Show Frustums","frustums"),f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStatistics",f.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(f),d.appendChild(u),d.appendChild(l("Show Frustum Planes","frustumPlanes")),d.appendChild(l("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 y=document.createElement("div");d.appendChild(y);let h=document.createElement("span");h.setAttribute("data-bind",'html: "     Frustum:"'),y.appendChild(h);let g=document.createElement("span");g.setAttribute("data-bind","text: depthFrustumText"),y.appendChild(g);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),y.appendChild(x);let S=document.createElement("input");S.type="button",S.value="+",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: incrementDepthFrustum"),y.appendChild(S);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),Z=document.createElement("div");Z.className="cesium-cesiumInspector-pickSection",V.appendChild(Z);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 E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(R),Z.appendChild(E),Z.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),Z.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),Z.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'),E=document.createElement("div"),E.appendChild(P),E.className="cesium-cesiumInspector-center",v.appendChild(E);let F=document.createElement("div");v.appendChild(F);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.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 G=document.createElement("input");G.type="button",G.value="NE",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectNE");let X=document.createElement("input");X.type="button",X.value="SW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSW");let W=document.createElement("input");W.type="button",W.value="SE",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind","click: selectSE");let A=document.createElement("div");A.className="cesium-cesiumInspector-tileText",F.className="cesium-cesiumInspector-frustumStatistics",F.appendChild(A),F.setAttribute("data-bind","visible: hasPickedTile"),A.setAttribute("data-bind","html: tileText");let k=document.createElement("div");k.className="cesium-cesiumInspector-relativeText",k.textContent="Select relative:",F.appendChild(k);let B=document.createElement("table"),O=document.createElement("tr"),H=document.createElement("tr"),U=document.createElement("td");U.appendChild(N);let K=document.createElement("td");K.appendChild(b);let Q=document.createElement("td");Q.appendChild(G),O.appendChild(U),O.appendChild(K),O.appendChild(Q);let ie=document.createElement("td"),j=document.createElement("td");j.appendChild(X);let $=document.createElement("td");$.appendChild(W),H.appendChild(ie),H.appendChild(j),H.appendChild($),B.appendChild(O),B.appendChild(H),F.appendChild(B),v.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(l("Show only selected","filterTile","hasPickedTile")),I.appendChild(l("Wireframe","wireframe")),I.appendChild(l("Suspend LOD update","suspendUpdates")),I.appendChild(l("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(IB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});IB.prototype.isDestroyed=function(){return!1};IB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),he(this)};var GM=IB;var cFo=_(T(),1);var iFo=_(T(),1);function WB(e,t){c(t)||(t=document.body),t=Wn(t);let n=this,i=Se.observable(_r.fullscreen),o=Se.observable(_r.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&&_r.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(){_r.fullscreen?_r.exitFullscreen():_r.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Wn(e)??r.body,this._callback=function(){i(_r.fullscreen)},r.addEventListener(_r.changeEventName,this._callback)}Object.defineProperties(WB.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new L("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}});WB.prototype.isDestroyed=function(){return!1};WB.prototype.destroy=function(){document.removeEventListener(_r.changeEventName,this._callback),he(this)};var EM=WB;var D1t="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",B1t="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 wB(e,t){if(!c(e))throw new L("container is required.");e=Wn(e);let n=new EM(t,e);n._exitFullScreenPath=B1t,n._enterFullScreenPath=D1t;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(wB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wB.prototype.isDestroyed=function(){return!1};wB.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var XM=wB;var gFo=_(T(),1);var fFo=_(T(),1);function kCe(e,t){if(!c(e))throw new L("scene is required.");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(kCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(c(e)&&e<0)throw new L("value must be positive.");this._duration=e}}});var IM=kCe;function PB(e,t,n){if(!c(e))throw new L("container is required.");e=Wn(e);let i=new IM(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(PB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PB.prototype.isDestroyed=function(){return!1};PB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var WM=PB;var GFo=_(T(),1);var CFo=_(T(),1);var UCe=1e3;function Sm(e){if(!c(e)||!c(e.scene))throw new L("options.scene is required.");c(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new VS({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 ye,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=DCe,this._handleArrowUp=OCe;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=i??Bg.SEARCH,t._focusTextbox=!1,c(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Q1t(t);else return K1t(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?OCe(t):r?DCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;HCe(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=e.autocomplete??!0,this.destinationFound=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){if(typeof i!="string")throw new L("value must be a valid string.");this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){if(c(i)&&i<0)throw new L("value must be positive.");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 OCe(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 DCe(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 Y1t(e,t){let n=c(t)?t.availability:void 0;return c(n)?IT(t,[e]).then(function(i){return e=i[0],e.height+=UCe,e}):(e.height+=UCe,Promise.resolve(e))}function H1t(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof de?w.equalsEpsilon(t.south,t.north,w.EPSILON7)&&w.equalsEpsilon(t.east,t.west,w.EPSILON7)?t=de.center(t):a=WT(t,n):t=i.cartesianToCartographic(t),c(a)||(a=Y1t(t,r)),a.then(function(l){s=i.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function z1t(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 K1t(e,t,n){let i=e._searchText;if(YCe(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 z1t(t[o],i,n),c(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,tq(e);let s=r.value;if(r.state==="fulfilled"&&c(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=BCe(e,PL.getCreditsFromResult(s[0]));c(a)||eq(e,t[o].credit);return}e._searchText=`${i} (not found)`}function eq(e,t){c(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function BCe(e,t){return c(t)&&t.forEach(n=>eq(e,n)),t}function tq(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function J1t(e,t){let n=Wn(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 Q1t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function YCe(e){return/^\s*$/.test(e)}function HCe(e){Se.getObservable(e,"_suggestions").removeAll()}async function j1t(e){if(!e.autoComplete)return;let t=e._searchText;if(HCe(e),tq(e),!YCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Bg.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=PL.getCreditsFromResult(r);o=o&&!c(s),BCe(e,s)}),o&&eq(e,n.credit)}if(e._suggestions.length>=5)return}}Sm.flyToDestination=H1t;Sm._updateSearchSuggestions=j1t;Sm._adjustSuggestionsScroll=J1t;Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){return tq(this),he(this)};var wM=Sm;var q1t="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",$1t="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 vB(e){if(!c(e)||!c(e.container))throw new L("options.container is required.");if(!c(e.scene))throw new L("options.scene is required.");let t=Wn(e.container),n=new wM(e);n._startSearchPath=q1t,n._stopSearchPath=$1t;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 l=document.createElement("li");a.appendChild(l),l.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()},Ot.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(vB.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});vB.prototype.isDestroyed=function(){return!1};vB.prototype.destroy=function(){let e=this._container;return Ot.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),he(this)};var PM=vB;var AFo=_(T(),1);var WFo=_(T(),1);function eVt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function KCe(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)KCe(e.sublayers[n],t)}function FB(e){return e.modelName==="FullModel"}function JCe(e){return e.modelName==="Overview"}function QCe(e){return JCe(e)||FB(e)}function zCe(e,t){if(QCe(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 tVt(e,t){if(QCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");FB(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function nVt(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 iVt(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:eVt,setOptionDisable:function(i,o){Se.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){tVt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){KCe(n[i],this.viewModel);let o=zCe(n[i],this.viewModel);c(o)&&(JCe(o)||!c(this.viewModel.defaultLayer)&&FB(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=zCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=FB(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return nVt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var vM=iVt;function oVt(e,t){let n=document.getElementById(e);C.defined("container",n),C.defined("i3sProvider",t);let i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` + `}var sBt=[{text:"Highlight",value:Id.HIGHLIGHT},{text:"Replace",value:Id.REPLACE},{text:"Mix",value:Id.MIX}],qNe=new U(1,1,0,.4),aBt=new U,PJ=new U;function Zc(e,t){let n=this,i=e.canvas;this._eventHandler=new la(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new ly({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,Ee.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=Ee.observable({}),this.properties=[],Ee.defineProperty(this,"properties",function(){let M=[],z=n._properties();for(let K in z)z.hasOwnProperty(K)&&M.push(K);return M});let o=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(M){o(M),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=M)}}),this.dynamicScreenSpaceError=!1;let r=Ee.observable();Ee.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(M){r(M),l(n._tileset)&&(n._tileset.colorBlendMode=M,n._scene.requestRender())}}),this.colorBlendMode=Id.HIGHLIGHT;let s=Ee.observable(),a=Ee.observable();Ee.defineProperty(this,"picking",{get:function(){return a()},set:function(M){a(M),M?n._eventHandler.setInputAction(function(z){let K=e.pick(z.endPosition);if(K instanceof ea?(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(z.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},mn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(mn.MOUSE_MOVE))}}),this.picking=!0;let c=Ee.observable();Ee.defineProperty(this,"colorize",{get:function(){return c()},set:function(M){c(M),l(n._tileset)&&(n._tileset.debugColorizeTiles=M,n._scene.requestRender())}}),this.colorize=!1;let d=Ee.observable();Ee.defineProperty(this,"wireframe",{get:function(){return d()},set:function(M){d(M),l(n._tileset)&&(n._tileset.debugWireframe=M,n._scene.requestRender())}}),this.wireframe=!1;let u=Ee.observable();Ee.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(M){u(M),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=M,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ee.observable();Ee.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(M){m(M),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=M,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ee.observable();Ee.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(M){p(M),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=M,n._scene.requestRender())}}),this.showRequestVolumes=!1;let b=Ee.observable();Ee.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(M){b(M),l(n._tileset)&&(n._tileset.debugFreezeFrame=M,n._scene.debugShowFrustumPlanes=M,n._scene.requestRender())}}),this.freezeFrame=!1,Ee.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(M){s(M),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=M,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ee.observable();Ee.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(M){f(M),l(n._tileset)&&(n._tileset.debugShowGeometricError=M,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Ee.observable();Ee.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(M){y(M),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=M,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ee.observable();Ee.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(M){_(M),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=M,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Ee.observable();Ee.defineProperty(this,"showUrl",{get:function(){return S()},set:function(M){S(M),l(n._tileset)&&(n._tileset.debugShowUrl=M,n._scene.requestRender())}}),this.showUrl=!1;let Z=Ee.observable();Ee.defineProperty(this,"maximumScreenSpaceError",{get:function(){return Z()},set:function(M){M=Number(M),isNaN(M)||(Z(M),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=M))}}),this.maximumScreenSpaceError=16;let R=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return R()},set:function(M){M=Number(M),isNaN(M)||(R(M),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=M))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ee.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(R(),1/6)},set:function(M){let z=Math.pow(M,6);R(z),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=z)}});let C=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(M){M=Number(M),isNaN(M)||(C(M),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=M))}}),this.dynamicScreenSpaceErrorFactor=24;let E=oBt(this),A=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return A()},set:function(M){A(M),M?n._eventHandler.setInputAction(E,mn.LEFT_CLICK):n._eventHandler.removeInputAction(mn.LEFT_CLICK)}});let L=Ee.observable();Ee.defineProperty(this,"pointCloudShading",{get:function(){return L()},set:function(M){L(M),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=M)}}),this.pointCloudShading=!1;let F=Ee.observable();Ee.defineProperty(this,"geometricErrorScale",{get:function(){return F()},set:function(M){M=Number(M),isNaN(M)||(F(M),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=M))}}),this.geometricErrorScale=1;let I=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return I()},set:function(M){M=Number(M),isNaN(M)||(I(M),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=M===0?void 0:M))}}),this.maximumAttenuation=0;let N=Ee.observable();Ee.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(M){M=Number(M),isNaN(M)||(N(M),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=M===0?void 0:M))}}),this.baseResolution=0;let g=Ee.observable();Ee.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(M){g(M),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=M)}}),this.eyeDomeLighting=!1;let V=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return V()},set:function(M){M=Number(M),isNaN(M)||(V(M),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=M))}}),this.eyeDomeLightingStrength=1;let G=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(M){M=Number(M),isNaN(M)||(G(M),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=M))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let v=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return v()},set:function(M){v(M),l(n._tileset)&&(n._tileset.skipLevelOfDetail=M)}}),this.skipLevelOfDetail=!0;let X=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return X()},set:function(M){M=Number(M),isNaN(M)||(X(M),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=M))}}),this.skipScreenSpaceErrorFactor=16;let Y=Ee.observable();Ee.defineProperty(this,"baseScreenSpaceError",{get:function(){return Y()},set:function(M){M=Number(M),isNaN(M)||(Y(M),l(n._tileset)&&(n._tileset.baseScreenSpaceError=M))}}),this.baseScreenSpaceError=1024;let D=Ee.observable();Ee.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(M){M=Number(M),isNaN(M)||(D(M),l(n._tileset)&&(n._tileset.skipLevels=M))}}),this.skipLevels=1;let w=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return w()},set:function(M){w(M),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=M)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Ee.observable();Ee.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(M){O(M),l(n._tileset)&&(n._tileset.loadSiblings=M)}}),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)||$Ne(this,!0)}Object.defineProperties(Zc.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 sBt}},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=R5(e,!1),this._pickStatisticsText=R5(e,!0),this._resourceCacheStatisticsText=eYe(),$Ne(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,aBt):U.WHITE:t.color=PJ,this._scene.requestRender()),l(e)&&(U.clone(e.color,PJ),e.color=qNe,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()&&!ele(t.content)&&(t.color=PJ,this._scene.requestRender()),l(e)&&!ele(e.content)&&(U.clone(e.color,PJ),e.color=qNe,this._scene.requestRender()),this._tile=e}}});function ele(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(!ele(t[i]))return!1;return!0}return!1}Zc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Zc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Zc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Zc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Zc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Zc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Zc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Zc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Zc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Zc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Zc.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 og(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Zc.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};Zc.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=R5(e,!1),this._pickStatisticsText=R5(e,!0),this._resourceCacheStatisticsText=eYe())};Zc.prototype.isDestroyed=function(){return!1};Zc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),me(this)};Zc.getStatistics=R5;var C5=Zc;function XJ(e,t){e=Nn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new C5(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=hu.createSection,c=hu.createCheckbox,d=hu.createRangeInput,u=hu.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),b=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),S=a(s,"Optimization","optimizationVisible","toggleOptimization"),Z=document.createElement("div");Z.className="field-group";let R=document.createElement("label");R.className="field-label",R.appendChild(document.createTextNode("Properties: "));let C=document.createElement("div");C.setAttribute("data-bind","text: properties"),Z.appendChild(R),Z.appendChild(C),m.appendChild(Z),m.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(u("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let E=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),A=document.createElement("p");A.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),A.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),A.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",E.appendChild(A),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 L=document.createElement("div");L.setAttribute("data-bind","visible: pointCloudShading"),L.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),L.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),L.appendChild(d("Base Resolution","baseResolution",0,1,.01)),L.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(L);let F=document.createElement("div");F.setAttribute("data-bind","visible: eyeDomeLighting"),F.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),F.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),L.appendChild(F),b.appendChild(c("Freeze Frame","freezeFrame")),b.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let I=document.createElement("div");I.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),b.appendChild(I);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),b.appendChild(N),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(g),f.appendChild(c("Pick Statistics","showPickStatistics"));let V=document.createElement("div");V.className="cesium-3dTilesInspector-statistics",V.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(V),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(G);let v=document.createElement("div");_.appendChild(v),v.appendChild(document.createTextNode("Color Blend Mode: "));let X=document.createElement("select");X.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),v.appendChild(X);let Y=document.createElement("textarea");Y.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),v.className="cesium-cesiumInspector-styleEditor",v.appendChild(Y);let D=u("Compile (Ctrl+Enter)","compileStyle");v.appendChild(D);let w=document.createElement("div");w.className="cesium-cesiumInspector-error",w.setAttribute("data-bind","text: editorError"),v.appendChild(w),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),S.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let O=document.createElement("div");O.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),S.appendChild(O);let M=document.createElement("div");M.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(M);let z=document.createElement("div");z.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),S.appendChild(z),S.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),S.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ee.applyBindings(o,n)}Object.defineProperties(XJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XJ.prototype.isDestroyed=function(){return!1};XJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var V5=XJ;var lmr=x(T(),1);var imr=x(T(),1);function cBt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function nYe(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)nYe(e.sublayers[n],t)}function NJ(e){return e.modelName==="FullModel"}function iYe(e){return e.modelName==="Overview"}function oYe(e){return iYe(e)||NJ(e)}function tYe(e,t){if(oYe(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:Ee.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function lBt(e,t){if(oYe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");NJ(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function dBt(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 uBt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Ee.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Ee.observable(!0),index:-1}],currentLayer:Ee.observable(),expandClickHandler:cBt,setOptionDisable:function(i,o){Ee.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){lBt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){nYe(n[i],this.viewModel);let o=tYe(n[i],this.viewModel);l(o)&&(iYe(o)||!l(this.viewModel.defaultLayer)&&NJ(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=tYe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=NJ(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return dBt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var E5=uBt;function mBt(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" @@ -10976,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new vM(t);Se.track(o),Se.applyBindings(o,n),c(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var nq=oVt;var zFo=_(T(),1);var UFo=_(T(),1);var rVt="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",sVt="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 iq(){this._cameraClicked=new ye,this._closeClicked=new ye,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?sVt:rVt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!c(this.description)||this.description.length===0}})}iq.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(iq.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var FM=iq;function AB(e){C.defined("container",e),e=Wn(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="×",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 FM;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 l=r.contentDocument,d=l.createElement("link");d.href=on("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=l.createElement("div");u.className="cesium-infoBox-description",l.head.appendChild(d),l.body.appendChild(u),a._descriptionSubscription=Za(s,"description",function(f){r.style.height="5px",u.innerHTML=f;let p=null,y=u.firstElementChild;if(y!==null&&u.childNodes.length===1){let g=window.getComputedStyle(y);if(g!==null){let x=g["background-color"],S=Y.fromCssColorString(x);c(S)&&S.alpha!==0&&(p=g["background-color"])}}t.style["background-color"]=p;let h=u.getBoundingClientRect().height;r.style.height=`${h}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(AB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});AB.prototype.isDestroyed=function(){return!1};AB.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),c(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),he(this)};var AM=AB;var iAo=_(T(),1);var qFo=_(T(),1);function MB(e){if(!c(e))throw new L("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof sn,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===se.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new hr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof sn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=c(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=se}Object.defineProperties(MB.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}}});MB.prototype.isDestroyed=function(){return!1};MB.prototype.destroy=function(){this._eventHelper.removeAll(),he(this)};var MM=MB;var aVt="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",cVt="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 NB(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let n=new MM(t);n._perspectivePath=aVt,n._orthographicPath=cVt;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)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(NB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NB.prototype.isDestroyed=function(){return!1};NB.prototype.destroy=function(){return this._viewModel.destroy(),Ot.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),he(this)};var NM=NB;var fAo=_(T(),1);var cAo=_(T(),1);function oq(e){if(!c(e)||!c(e.scene))throw new L("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=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(oq.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});oq.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),he(this)};var kM=oq;function kB(e){if(!c(e)||!c(e.container))throw new L("options.container is required.");if(!c(e.scene))throw new L("options.scene is required.");let t=Wn(e.container),n=new kM(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="×",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(kB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kB.prototype.isDestroyed=function(){return!1};kB.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var UM=kB;var SAo=_(T(),1);var yAo=_(T(),1);function jCe(){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(jCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var OM=jCe;function UB(e){if(!c(e)||!c(e.container))throw new L("options.container is required.");let t=Wn(e.container),n=new OM,i=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 l=document.createElement("img");l.src=on("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",a.appendChild(l),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=on("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 f=document.createElement("div");f.className="cesium-click-navigation-help cesium-navigation-help-instructions",f.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),f.innerHTML=` <table> <tr> <td><img src="${on("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="${on("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="${on("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(f);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="${on("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="${on("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="${on("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="${on("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(y){o.contains(y.target)||(n.showInstructions=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(UB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});UB.prototype.isDestroyed=function(){return!1};UB.prototype.destroy=function(){return Ot.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),he(this)};var DM=UB;var IAo=_(T(),1);var ZAo=_(T(),1);var lVt=new D,OB="-1000px";function BM(e,t,n){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("selectionIndicatorElement is required.");if(!c(n))throw new L("container is required.");this._scene=e,this._screenPositionX=OB,this._screenPositionY=OB,this._tweens=e.tweens,this._container=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&&c(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Oi.worldToWindowCoordinates(e,i,o)}}BM.prototype.update=function(){if(this.showSelection&&c(this.position)){let e=this.computeScreenSpacePosition(this.position,lVt);if(!c(e))this._screenPositionX=OB,this._screenPositionY=OB;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`}}};BM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Jr.EXPONENTIAL_OUT})};BM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Jr.EXPONENTIAL_OUT})};Object.defineProperties(BM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var YM=BM;function DB(e,t){if(!c(e))throw new L("container is required.");e=Wn(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 l=new YM(t,this._element,this._container);this._viewModel=l,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(DB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DB.prototype.isDestroyed=function(){return!1};DB.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),he(this)};var HM=DB;var UAo=_(T(),1);var FAo=_(T(),1);function BB(e,t){if(!c(e))throw new L("scene is required.");this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new hr,this._eventHelper.add(e.morphStart,i),this._duration=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===se.SCENE2D?n.tooltip2D:o===se.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=se}Object.defineProperties(BB.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new L("duration value must be positive.");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}}});BB.prototype.isDestroyed=function(){return!1};BB.prototype.destroy=function(){this._eventHelper.removeAll(),he(this)};var zM=BB;var dVt="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",uVt="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",mVt="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 YB(e,t,n){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let i=new zM(t,n);i._globePath=dVt,i._flatMapPath=uVt,i._columbusViewPath=mVt;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 l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.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(l),Se.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(YB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YB.prototype.isDestroyed=function(){return!1};YB.prototype.destroy=function(){return this._viewModel.destroy(),Ot.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),he(this)};var KM=YB;var qAo=_(T(),1);var BAo=_(T(),1);function AS(e,t,n){this._color=e,this._height=t,this._base=n??0}AS.prototype.getHeight=function(){return this._height};AS.prototype.getBase=function(){return this._base};AS.prototype.getStartTime=function(){return this._start};AS.prototype.getStopTime=function(){return this._stop};AS.prototype.setRange=function(e,t){this._start=e,this._stop=t};AS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=ee.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 JM=AS;var zAo=_(T(),1);function qCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new Y(.5,.5,.5,1),this.backgroundColor=i||new Y(0,0,0,0)}qCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,o)&&ee.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,r)&&ee.greaterThanOrEquals(i,o)){let s,a,l;for(s=0;s<t.timeBarWidth;++s){let d=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!c(a)&&ee.greaterThanOrEquals(d,n)?a=s:!c(l)&&ee.greaterThanOrEquals(d,i)&&(l=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),c(a)&&(c(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(l-a,1),this.height))}};var QM=qCe;var rq=1e12,Cm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},yl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},$g=[.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],fVt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gl(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("clock is required.");e=Wn(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=yl.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=hVt(this),this._onMouseUp=pVt(this),this._onMouseMove=bVt(this),this._onMouseWheel=yVt(this),this._onTouchStart=gVt(this),this._onTouchMove=_Vt(this),this._onTouchEnd=xVt(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()}gl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};gl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};gl.prototype.isDestroyed=function(){return!1};gl.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),he(this)};gl.prototype.addHighlightRange=function(e,t,n){let i=new JM(e,t,n);return this._highlightRanges.push(i),this.resize(),i};gl.prototype.addTrack=function(e,t,n,i){let o=new QM(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};gl.prototype.zoomTo=function(e,t){if(!c(e))throw new L("startTime is required.");if(!c(t))throw new L("stopTime is required");if(ee.lessThanOrEquals(t,e))throw new L("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==zr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=ee.secondsDifference(o,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=o,this._timeBarSecondsSpan=ee.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)};gl.prototype.zoomFrom=function(e){let t=ee.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(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function sq(e){return e<10?`0${e.toString()}`:e.toString()}gl.prototype.makeLabel=function(e){let t=ee.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`${fVt[t.month-1]} ${t.day} ${t.year} ${sq(t.hour)}:${sq(t.minute)}:${sq(t.second)}${i}`};gl.prototype.smallestTicInPixels=7;gl.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.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,l=31536e6,d=1e-10,u=0,f=this._timeBarSecondsSpan;f<a?(f=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):f>l&&(f=l,this._timeBarSecondsSpan=l,this._endJulian=ee.addSeconds(this._startJulian,l,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let y=this._startJulian,h=Math.min(f/p*1e-5,.4),g,x=ee.toGregorianDate(y);f>31536e4?g=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):f>31536e3?g=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):f>86400?g=ee.fromDate(new Date(Date.UTC(x.year,0))):g=ee.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let S=ee.secondsDifference(this._startJulian,ee.addSeconds(g,h,new ee)),V=S+f;this._epochJulian=g;function Z(U){return Math.floor(S/U)*U}function R(U,K){return Math.ceil(U/K+.5)*K}function E(U){return(U-S)/f}function I(U,K){return U-K*Math.round(U/K)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let F={startTime:S,startJulian:y,epochJulian:g,duration:f,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(U){s+=U.render(F)});let N=0,b=0,G=0,X=v/p;X>1&&(X=1),X*=this._timeBarSecondsSpan;let W=-1,A=-1,k=$g.length,B;for(B=0;B<k;++B){let U=$g[B];if(++W,N=U,U>X&&U>u)break;A<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(A=W)}if(W>0){for(;W>0;)if(--W,Math.abs(I(N,$g[W]))<1e-5){$g[W]>=u&&(b=$g[W]);break}if(A>=0)for(;A<W;){if(Math.abs(I(b,$g[A]))<1e-5&&$g[A]>=u){G=$g[A];break}++A}}u=P,u>d&&G<1e-5&&Math.abs(u-N)>d&&(G=u,u<=N+d&&(b=0));let O=-999999,H;if(p*(G/this._timeBarSecondsSpan)>=3)for(o=Z(G);o<=V;o=R(o,G))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=Z(b);o<=V;o=R(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,V+=N,o=Z(N);let U=ee.computeTaiMinusUtc(g);for(;o<=V;){let K=ee.addSeconds(y,o-S,new ee);if(N>2.1){let $=ee.computeTaiMinusUtc(K);Math.abs($-U)>.1&&(o+=$-U,K=ee.addSeconds(y,o-S,new ee))}let Q=Math.round(p*E(o)),ie=this.makeLabel(K);this._rulerEle.innerHTML=ie,H=this._rulerEle.offsetWidth,H<10&&(H=v);let j=Q-(H/2-1);j>O?(O=j+H+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${j.toString()}px;">${ie}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Q.toString()}px;"></span>`,o=R(o,N)}}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),F.y=0,this._trackList.forEach(function(U){U.render(r._context,F),F.y+=U.height})};gl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(c(this._scrubElement)){let t=ee.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`)}c(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};gl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),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 hVt(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 pVt(e){return function(t){e._mouseMode=Cm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function bVt(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(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Cm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function yVt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;rq=Math.max(Math.min(Math.abs(n),rq),1),n/=rq,e.zoomFrom(Math.pow(1.05,-n))}}function gVt(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=ee.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=yl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=yl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=yl.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=yl.ignore}}function xVt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===yl.singleTap?(e._touchMode=yl.scrub,e._onTouchMove(t)):e._touchMode===yl.scrub&&e._onTouchMove(t),e._mouseMode=Cm.touchOnly,n!==1?e._touchMode=n>0?yl.ignore:yl.none:e._touchMode===yl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _Vt(e){return function(t){let n,i,o,r,s,a,l=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===yl.singleTap&&(e._touchMode=yl.slideZoom),e._mouseMode=Cm.touchOnly,e._touchMode===yl.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===yl.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),c(r)&&(s>0&&e._touchState.spanX>0?(l=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*l)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-r,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*l,new ee)),e._touchState.centerX=r,e._touchState.spanX=s))}}gl.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 jM=gl;var c9o=_(T(),1);var n9o=_(T(),1);function $Ce(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 l=t[a];l.match(o)[0].length>=s&&(l=l.slice(s)),i+=`${l} -`}return i}function Vm(e){C.typeOf.object("scene",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 l=o.getPrimitiveFunction;l===!0&&(l=function(){t[r]=t._voxelPrimitive[r]}),c(l)&&t._getPrimitiveFunctions.push(l);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),c(a)&&c(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=$Ce(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===La.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===La.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===La.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-w.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:w.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-w.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:w.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-w.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:w.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-w.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:w.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-w.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:w.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-w.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:w.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}})}var TVt=new m,SVt=new m,CVt=new Ea,VVt=new te;function yp(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,TVt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,SVt),i=CVt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=te.fromHeadingPitchRoll(i,VVt),r=te.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.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(c(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!c(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=$Ce(i),c(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,yp(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(){c(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new aS({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(` -`),l=a.length,d;if(t.shiftKey)for(d=0;d<l;++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<l;++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()}),he(this)};var qM=Vm;function HB(e,t){C.defined("container",e),C.typeOf.object("scene",t),e=Wn(e);let n=document.createElement("div"),i=new qM(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{createSection:s,createCheckbox:a,createRangeInput:l,createButton:d}=sd,u=s(r,"Display","displayVisible","toggleDisplay"),f=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),y=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(l("Screen Space Error","screenSpaceError",0,128)),u.appendChild(l("Step Size","stepSize",0,2));let h=10,g=10,x=w.PI;f.appendChild(l("Translation X","translationX",-h,+h)),f.appendChild(l("Translation Y","translationY",-h,+h)),f.appendChild(l("Translation Z","translationZ",-h,+h)),f.appendChild(l("Scale X","scaleX",0,+g)),f.appendChild(l("Scale Y","scaleY",0,+g)),f.appendChild(l("Scale Z","scaleZ",0,+g)),f.appendChild(l("Heading","angleX",-x,+x)),f.appendChild(l("Pitch","angleY",-x,+x)),f.appendChild(l("Roll","angleZ",-x,+x)),aq("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),aq("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),aq("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let S=document.createElement("div");y.appendChild(S);let V=document.createElement("textarea");V.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),S.className="cesium-cesiumInspector-styleEditor",S.appendChild(V);let Z=d("Compile (Ctrl+Enter)","compileShader");S.appendChild(Z);let R=document.createElement("label");R.style.display="block",R.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),S.appendChild(R),Se.applyBindings(i,n)}Object.defineProperties(HB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HB.prototype.isDestroyed=function(){return!1};HB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),he(this)};function aq(e,t,n,i,o,r,s,a,l,d,u,f,p,y){let h=sd.createRangeInputWithDynamicMinMax,g=y.appendChild(document.createElement("div"));g.setAttribute("data-bind",`if: ${p}`),g.appendChild(h(e,s)),g.appendChild(h(t,a)),g.appendChild(h(n,l)),g.appendChild(h(i,d)),g.appendChild(h(o,u)),g.appendChild(h(r,f))}var $M=HB;var S9o=_(T(),1);var y9o=_(T(),1);var o1e=_(i1e(),1);function RVt(e){let t=!1,n=window.screen;return c(n)&&(c(n.lockOrientation)?t=n.lockOrientation(e):c(n.mozLockOrientation)?t=n.mozLockOrientation(e):c(n.msLockOrientation)?t=n.msLockOrientation(e):c(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function r1e(){let e=window.screen;c(e)&&(c(e.unlockOrientation)?e.unlockOrientation():c(e.mozUnlockOrientation)?e.mozUnlockOrientation():c(e.msUnlockOrientation)?e.msUnlockOrientation():c(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function GVt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(r1e(),e._locked=!1),e._noSleep.disable(),_r.exitFullscreen(),n(!1)):(_r.fullscreen||_r.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=RVt("landscape")),t.useWebVR=!0,n(!0)))}function zB(e,t){if(!c(e))throw new L("scene is required.");let n=this,i=Se.observable(_r.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&&_r.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 hr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof sn)}),this._locked=!1,this._noSleep=new o1e.default,this._command=Rn(function(){GVt(n,e,o,r)},Se.getObservable(this,"isVREnabled")),this._vrElement=Wn(t)??document.body,this._callback=function(){!_r.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(r1e(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(_r.changeEventName,this._callback)}Object.defineProperties(zB.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new L("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}});zB.prototype.isDestroyed=function(){return!1};zB.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(_r.changeEventName,this._callback),he(this)};var eN=zB;var EVt="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",XVt="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 KB(e,t,n){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let i=new eN(t,n);i._exitVRPath=XVt,i._enterVRPath=EVt;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(KB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KB.prototype.isDestroyed=function(){return!1};KB.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var tN=KB;var O9o=_(T(),1);var s1e=new ue;function l1e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function IVt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);c(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 WVt(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(c(r)&&r!=="")return r}return"Unnamed Feature"}function a1e(e,t){let n=e.scene.pick(t.position);if(c(n)){let i=n.id??n.primitive.id;if(i instanceof $o)return i;if(n instanceof Us)return new $o({name:WVt(n),description:IVt(n),feature:n})}if(c(e.scene.globe))return vVt(e,t.position)}var wVt=new ee;function uq(e,t){if(c(t)){let n=t.clock;if(c(n)&&c(e)){let i=n.startTime,o=n.stopTime;ee.equals(i,o)&&(o=ee.addSeconds(i,w.EPSILON2,wVt)),e.updateFromClock(),e.zoomTo(i,o)}}}var PVt=new m;function vVt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!c(o))return;let r=new $o({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!c(s)||s.length===0){e.selectedEntity=c1e();return}let a=s[0],l=new $o({id:a.name,description:a.description});if(c(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,PVt);l.position=new Oc(d)}e.selectedEntity=l},function(){e.selectedEntity===r&&(e.selectedEntity=c1e())}),r}function c1e(){return new $o({id:"None",description:"No features found."})}function FVt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,l=e._timeline,d=e._fullscreenButton,u=e._infoBox,f=e._selectionIndicator,p=t?"hidden":"visible";if(c(n)&&(n.container.style.visibility=p),c(i)&&(i.container.style.visibility=p),c(o)&&(o.container.style.visibility=p),c(r)&&(r.container.style.visibility=p),c(s)&&(s.container.style.visibility=p),c(a)&&(a.container.style.visibility=p),c(l)&&(l.container.style.visibility=p),c(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),c(u)&&(u.container.style.visibility=p),c(f)&&(f.container.style.visibility=p),e._container){let y=t||!c(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${y}px`,e.forceResize()}}function qi(e,t){if(!c(e))throw new L("container is required.");if(e=Wn(e),t=t??z.EMPTY_OBJECT,t.globe===!1&&c(t.baseLayer)&&t.baseLayer!==!1)throw new L("Cannot use baseLayer when globe is disabled.");let n=(!c(t.globe)||t.globe!==!1)&&(!c(t.baseLayerPicker)||t.baseLayerPicker!==!1);if(!n&&c(t.selectedImageryProviderViewModel))throw new L("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.baseLayer instead or set options.baseLayerPicker to true.");if(!n&&c(t.selectedTerrainProviderViewModel))throw new L("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");let 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=t.scene3DOnly??!1,l,d,u=!1;c(t.clockViewModel)?(d=t.clockViewModel,l=d.clock):(l=new _f,d=new fM(l),u=!0);let f=new G9(r,{baseLayer:n&&c(t.selectedImageryProviderViewModel)||c(t.baseLayer)||c(t.imageryProvider)?!1:void 0,clock:l,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:c(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=f.scene,y=new hr;y.add(l.onTick,qi.prototype._onTick,this);let h;if(!c(t.selectionIndicator)||t.selectionIndicator!==!1){let K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(K),h=new HM(K,p)}let g;if(!c(t.infoBox)||t.infoBox!==!1){let K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",o.appendChild(K),g=new AM(K);let Q=g.viewModel;y.add(Q.cameraClicked,qi.prototype._onInfoBoxCameraClicked,this),y.add(Q.closeClicked,qi.prototype._onInfoBoxClockClicked,this)}let x=document.createElement("div");x.className="cesium-viewer-toolbar",o.appendChild(x);let S;if(!c(t.geocoder)||t.geocoder!==!1){let K=document.createElement("div");K.className="cesium-viewer-geocoderContainer",x.appendChild(K);let Q;typeof t.geocoder=="string"?Q=[new VS({scene:p,geocodeProviderType:t.geocoder})]:c(t.geocoder)&&typeof t.geocoder!="boolean"&&(Q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new PM({container:K,geocoderServices:Q,scene:p}),y.add(S.viewModel.search.beforeExecute,qi.prototype._clearObjects,this)}let V;if((!c(t.homeButton)||t.homeButton!==!1)&&(V=new WM(x,p),c(S)&&y.add(V.viewModel.command.afterExecute,function(){let K=S.viewModel;K.searchText="",K.isSearchInProgress&&K.search()}),y.add(V.viewModel.command.beforeExecute,qi.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&a)throw new L("options.sceneModePicker is not available when options.scene3DOnly is set to true.");let Z;!a&&(!c(t.sceneModePicker)||t.sceneModePicker!==!1)&&(Z=new KM(x,p));let R;t.projectionPicker&&(R=new NM(x,p));let E,I;if(n){let K=t.imageryProviderViewModels??_M(),Q=t.terrainProviderViewModels??TM();E=new xM(x,{globe:p.globe,imageryProviderViewModels:K,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),I=x.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(c(t.baseLayer)&&t.baseLayer!==!1&&(n&&(E.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),c(t.terrainProvider)&&(n&&(E.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),c(t.terrain)){if(c(t.terrainProvider))throw new L("Specify either options.terrainProvider or options.terrain.");n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain)}let v;if(!c(t.navigationHelpButton)||t.navigationHelpButton!==!1){let K=!0;try{if(c(window.localStorage)){let Q=window.localStorage.getItem("cesium-hasSeenNavHelp");c(Q)&&Q?K=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new DM({container:x,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??K})}let P;if(!c(t.animation)||t.animation!==!1){let K=document.createElement("div");K.className="cesium-viewer-animationContainer",o.appendChild(K),P=new bM(K,new yM(d))}let F;if(!c(t.timeline)||t.timeline!==!1){let K=document.createElement("div");K.className="cesium-viewer-timelineContainer",o.appendChild(K),F=new jM(K,l),F.addEventListener("settime",l1e,!1),F.zoomTo(l.startTime,l.stopTime)}let N,b,G;(!c(t.fullscreenButton)||t.fullscreenButton!==!1)&&(G=document.createElement("div"),G.className="cesium-viewer-fullscreenContainer",o.appendChild(G),N=new XM(G,t.fullscreenElement),b=Za(N.viewModel,"isFullscreenEnabled",function(K){G.style.display=K?"block":"none",c(F)&&(F.container.style.right=`${G.clientWidth}px`,F.resize())}));let X,W,A;if(t.vrButton){let K=document.createElement("div");K.className="cesium-viewer-vrContainer",o.appendChild(K),X=new tN(K,p,t.fullScreenElement),W=Za(X.viewModel,"isVREnabled",function(Q){K.style.display=Q?"block":"none",c(N)&&(K.style.right=`${G.clientWidth}px`),c(F)&&(F.container.style.right=`${K.clientWidth}px`,F.resize())}),A=Za(X.viewModel,"isVRMode",function(Q){FVt(i,Q)})}this._baseLayerPickerDropDown=I,this._fullscreenSubscription=b,this._vrSubscription=W,this._vrModeSubscription=A,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=f,this._selectionIndicator=h,this._infoBox=g,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=x,this._homeButton=V,this._sceneModePicker=Z,this._projectionPicker=R,this._baseLayerPicker=E,this._navigationHelpButton=v,this._animation=P,this._timeline=F,this._fullscreenButton=N,this._vrButton=X,this._geocoder=S,this._eventHelper=y,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=c(g)||c(h),this._selectedEntity=void 0,this._selectedEntityChanged=new ye;let k=this._cesiumWidget.dataSources,B=this._cesiumWidget.dataSourceDisplay;y.add(k.dataSourceAdded,qi.prototype._onDataSourceAdded,this),y.add(k.dataSourceRemoved,qi.prototype._onDataSourceRemoved,this),y.add(p.postUpdate,qi.prototype.resize,this);let O=k.length;for(let K=0;K<O;K++)this._dataSourceAdded(k,k.get(K));this._dataSourceAdded(void 0,B.defaultDataSource),y.add(k.dataSourceAdded,qi.prototype._dataSourceAdded,this),y.add(k.dataSourceRemoved,qi.prototype._dataSourceRemoved,this);function H(K){let Q=a1e(i,K);c(Q)?J.getValueOrUndefined(Q.position,i.clock.currentTime)?i.trackedEntity=Q:i.zoomTo(Q):c(i.trackedEntity)&&(i.trackedEntity=void 0)}function U(K){i.selectedEntity=a1e(i,K)}f.screenSpaceEventHandler.setInputAction(U,Vn.LEFT_CLICK),f.screenSpaceEventHandler.setInputAction(H,Vn.LEFT_DOUBLE_CLICK),f._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=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(e)?c(t)&&t.animateAppear():c(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,uq(this._timeline,e))}}});qi.prototype.extend=function(e,t){if(!c(e))throw new L("mixin is required.");e(this,t)};qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=c(this._animation),r=c(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(c(a)&&(a.style.maxHeight=`${s}px`),c(this._geocoder)){let h=this._geocoder.searchSuggestionsContainer;h.style.maxHeight=`${s}px`}c(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let l=this._timeline,d,u=0,f=5,p=3,y=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let h=this._lastWidth;d=this._animation.container,n>900?(u=169,h<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(h<600||h>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(h>600||h===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),f=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let h=this._fullscreenButton,g=this._vrButton,x=l.container,S=x.style;p=x.clientHeight+3,S.left=`${u}px`;let V=0;c(h)&&(V+=h.container.clientWidth),c(g)&&(V+=g.container.clientWidth),S.right=`${V}px`,l.resize()}!r&&c(this._fullscreenButton)&&(y=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${f}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${y}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 c(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Vn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Vn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),c(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),c(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),c(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),c(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),c(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),c(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),c(this._timeline)&&(this._timeline.removeEventListener("settime",l1e,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),c(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),c(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),c(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),c(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(),he(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),c(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=c(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,s1e)!==ut.FAILED?n=s1e.center:c(o.position)&&(n=o.position.getValue(t,n)),i=c(n));let s=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=c(this._infoBox)?this._infoBox.viewModel:void 0;c(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=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;c(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&&uq(this.timeline,e)};qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&uq(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 mq=qi;var H9o=_(T(),1);function AVt(e){C.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new LM(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var fq=AVt;var Q9o=_(T(),1);function MVt(e){if(!c(e))throw new L("viewer is required.");let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new GM(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var hq=MVt;var $9o=_(T(),1);function NVt(e,t){if(!c(e))throw new L("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new L("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new L("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new L("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new L("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new L("flyToOnDrop is already defined by another mixin.");t=t??z.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new ye,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,l=t.proxy;s=Wn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){if(!c(u))throw new L("value is required.");d1e(s,d),s=u,pq(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?pq(s,d):d1e(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 l},set:function(u){l=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){MS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let f=u.dataTransfer.files,p=f.length;for(let y=0;y<p;y++){let h=f[y],g=new FileReader;g.onload=kVt(e,h,l,a),g.onerror=UVt(e,h),g.readAsText(h)}}pq(s,d),e.destroy=A9(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function MS(e){e.stopPropagation(),e.preventDefault()}function d1e(e,t){let n=e;c(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",MS,!1),n.removeEventListener("dragover",MS,!1),n.removeEventListener("dragexit",MS,!1))}function pq(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",MS,!1),e.addEventListener("dragover",MS,!1),e.addEventListener("dragexit",MS,!1)}function kVt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=c2.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=gg.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=XT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=xv.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}c(a)&&e.dataSources.add(a).then(function(l){e.flyToOnDrop&&e.flyTo(l)}).catch(function(l){e.dropError.raiseEvent(e,s,l)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function UVt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var bq=NVt;var iMo=_(T(),1);function OVt(e,t){if(!c(e))throw new L("viewer is required.");t=t??z.EMPTY_OBJECT;let n=new UM({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var yq=OVt;var aMo=_(T(),1);function DVt(e){C.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new $M(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var gq=DVt;globalThis.CESIUM_VERSION="1.129";var BVt="1.129";return y1e(YVt);})(); + </div>`,n.appendChild(i);let o=new E5(t);Ee.track(o),Ee.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var tle=mBt;var Tmr=x(T(),1);var hmr=x(T(),1);var hBt="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",fBt="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 nle(){this._cameraClicked=new Se,this._closeClicked=new Se,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ee.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,Ee.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?fBt:hBt}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}nle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(nle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var A5=nle;function YJ(e){e=Nn(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=t.ownerDocument,o,r,s,a,c;function d(S){!l(o)||l(S)&&S.pointerId!==o||(o=void 0,t.classList.remove("cesium-infoBox-dragging"))}function u(S){if(!(S.button!==0||S.isPrimary===!1)){o=S.pointerId,r=S.clientX,s=S.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(S.pointerId)}catch{}S.preventDefault()}}function m(S){!l(o)||S.pointerId!==o||(t.style.left=`${a+S.clientX-r}px`,t.style.top=`${c+S.clientY-s}px`,S.preventDefault())}n.addEventListener("pointerdown",u),i.addEventListener("pointermove",m),i.addEventListener("pointerup",d),i.addEventListener("pointercancel",d);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.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(p);let b=document.createElement("button");b.type="button",b.className="cesium-infoBox-close",b.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),b.innerHTML="×",t.appendChild(b);let f=document.createElement("iframe");f.className="cesium-infoBox-iframe",f.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),f.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),f.setAttribute("allowfullscreen",!0),t.appendChild(f);let y=new A5;Ee.applyBindings(y,t),this._container=e,this._element=t,this._frame=f,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=u,this._handlePointerMove=m,this._stopDragging=d;let _=this;f.addEventListener("load",function(){let S=f.contentDocument,Z=S.createElement("link");Z.href=en("Widgets/InfoBox/InfoBoxDescription.css"),Z.rel="stylesheet",Z.type="text/css";let R=S.createElement("div");R.className="cesium-infoBox-description",S.head.appendChild(Z),S.body.appendChild(R),_._descriptionSubscription=Sc(y,"description",function(C){f.style.height="5px",R.innerHTML=C;let E=null,A=R.firstElementChild;if(A!==null&&R.childNodes.length===1){let F=window.getComputedStyle(A);if(F!==null){let I=F["background-color"],N=U.fromCssColorString(I);l(N)&&N.alpha!==0&&(E=F["background-color"])}}t.style["background-color"]=E;let L=R.getBoundingClientRect().height;f.style.height=`${L}px`})}),f.setAttribute("src","about:blank")}Object.defineProperties(YJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});YJ.prototype.isDestroyed=function(){return!1};YJ.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),Ee.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var G5=YJ;var Wmr=x(T(),1);var Rmr=x(T(),1);function rYe(){this.showInstructions=!1;let e=this;this._command=Fn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Fn(function(){e._touch=!1}),this._showTouch=Fn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ee.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(rYe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var L5=rYe;function wJ(e){let t=Nn(e.container),n=new L5,i=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=en("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=en("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 m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=` <table> <tr> <td><img src="${en("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="${en("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="${en("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(m);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="${en("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="${en("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="${en("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="${en("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),Ee.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(b){o.contains(b.target)||(n.showInstructions=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(wJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wJ.prototype.isDestroyed=function(){return!1};wJ.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var W5=wJ;var Umr=x(T(),1);var Pmr=x(T(),1);function sYe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Fn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ee.track(this,["tooltip"])}Object.defineProperties(sYe.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 v5=sYe;function MJ(e,t,n){e=Nn(e);let i=new v5(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),Ee.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(MJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MJ.prototype.isDestroyed=function(){return!1};MJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var F5=MJ;var nhr=x(T(),1);var Jmr=x(T(),1);function kJ(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Hr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ee.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ee.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===se.SCENE2D?n.tooltip2D:o===se.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Fn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Fn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Fn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=se}Object.defineProperties(kJ.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}}});kJ.prototype.isDestroyed=function(){return!1};kJ.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var I5=kJ;var pBt="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",bBt="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",gBt="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 UJ(e,t,n){e=Nn(e);let i=new I5(t,n);i._globePath=pBt,i._flatMapPath=bBt,i._columbusViewPath=gBt;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),Ee.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(UJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});UJ.prototype.isDestroyed=function(){return!1};UJ.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var P5=UJ;var bhr=x(T(),1);var lhr=x(T(),1);function ile(e){this._scene=e.scene,this.lowFrameRateMessage=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,Ee.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Fn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=r9.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(ile.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});ile.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var X5=ile;function DJ(e){let t=Nn(e.container),n=new X5(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="×",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),Ee.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(DJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DJ.prototype.isDestroyed=function(){return!1};DJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var N5=DJ;var Ahr=x(T(),1);var _hr=x(T(),1);var yBt=new k,OJ="-1000px";function Y5(e,t,n){this._scene=e,this._screenPositionX=OJ,this._screenPositionY=OJ,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ee.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ee.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ee.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return fo.worldToWindowCoordinates(e,i,o)}}Y5.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,yBt);if(!l(e))this._screenPositionX=OJ,this._screenPositionY=OJ;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`}}};Y5.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:vs.EXPONENTIAL_OUT})};Y5.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:vs.EXPONENTIAL_OUT})};Object.defineProperties(Y5.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var w5=Y5;function BJ(e,t){e=Nn(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 w5(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties(BJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BJ.prototype.isDestroyed=function(){return!1};BJ.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),me(this)};var M5=BJ;var khr=x(T(),1);var Ihr=x(T(),1);function zJ(e){this._scene=e,this._orthographic=e.camera.frustum instanceof yn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ee.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ee.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Fn(function(){t.sceneMode===se.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Hr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof yn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=se}Object.defineProperties(zJ.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}}});zJ.prototype.isDestroyed=function(){return!1};zJ.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var k5=zJ;var xBt="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",TBt="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 HJ(e,t){e=Nn(e);let n=new k5(t);n._perspectivePath=xBt,n._orthographicPath=TBt;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),Ee.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(HJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HJ.prototype.isDestroyed=function(){return!1};HJ.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var U5=HJ;var $hr=x(T(),1);var Ohr=x(T(),1);function MR(e,t,n){this._color=e,this._height=t,this._base=n??0}MR.prototype.getHeight=function(){return this._height};MR.prototype.getBase=function(){return this._base};MR.prototype.getStartTime=function(){return this._start};MR.prototype.getStopTime=function(){return this._stop};MR.prototype.setRange=function(e,t){this._start=e,this._stop=t};MR.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 D5=MR;var Hhr=x(T(),1);function aYe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new U(.5,.5,.5,1),this.backgroundColor=i||new U(0,0,0,0)}aYe.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 O5=aYe;var ole=1e12,Ah={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},yd={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},UT=[.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],_Bt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xd(e,t){e=Nn(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=Ah.none,this._touchMode=yd.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=SBt(this),this._onMouseUp=ZBt(this),this._onMouseMove=RBt(this),this._onMouseWheel=CBt(this),this._onTouchStart=VBt(this),this._onTouchMove=ABt(this),this._onTouchEnd=EBt(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()}xd.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};xd.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};xd.prototype.isDestroyed=function(){return!1};xd.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)};xd.prototype.addHighlightRange=function(e,t,n){let i=new D5(e,t,n);return this._highlightRanges.push(i),this.resize(),i};xd.prototype.addTrack=function(e,t,n,i){let o=new O5(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};xd.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==As.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)};xd.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 rle(e){return e<10?`0${e.toString()}`:e.toString()}xd.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`${_Bt[t.month-1]} ${t.day} ${t.year} ${rle(t.hour)}:${rle(t.minute)}:${rle(t.second)}${i}`};xd.prototype.smallestTicInPixels=7;xd.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,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=Q.addSeconds(this._startJulian,c,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let b=this._startJulian,f=Math.min(m/p*1e-5,.4),y,_=Q.toGregorianDate(b);m>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?y=Q.fromDate(new Date(Date.UTC(_.year,0))):y=Q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let S=Q.secondsDifference(this._startJulian,Q.addSeconds(y,f,new Q)),Z=S+m;this._epochJulian=y;function R(M){return Math.floor(S/M)*M}function C(M,z){return Math.ceil(M/z+.5)*z}function E(M){return(M-S)/m}function A(M,z){return M-z*Math.round(M/z)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let L=this._rulerEle.offsetWidth+20;L<30&&(L=180);let F=u;u-=d;let I={startTime:S,startJulian:b,epochJulian:y,duration:m,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(M){s+=M.render(I)});let N=0,g=0,V=0,G=L/p;G>1&&(G=1),G*=this._timeBarSecondsSpan;let v=-1,X=-1,Y=UT.length,D;for(D=0;D<Y;++D){let M=UT[D];if(++v,N=M,M>G&&M>u)break;X<0&&p*(M/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(X=v)}if(v>0){for(;v>0;)if(--v,Math.abs(A(N,UT[v]))<1e-5){UT[v]>=u&&(g=UT[v]);break}if(X>=0)for(;X<v;){if(Math.abs(A(g,UT[X]))<1e-5&&UT[X]>=u){V=UT[X];break}++X}}u=F,u>d&&V<1e-5&&Math.abs(u-N)>d&&(V=u,u<=N+d&&(g=0));let w=-999999,O;if(p*(V/this._timeBarSecondsSpan)>=3)for(o=R(V);o<=Z;o=C(o,V))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=R(g);o<=Z;o=C(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,Z+=N,o=R(N);let M=Q.computeTaiMinusUtc(y);for(;o<=Z;){let z=Q.addSeconds(b,o-S,new Q);if(N>2.1){let $=Q.computeTaiMinusUtc(z);Math.abs($-M)>.1&&(o+=$-M,z=Q.addSeconds(b,o-S,new Q))}let K=Math.round(p*E(o)),te=this.makeLabel(z);this._rulerEle.innerHTML=te,O=this._rulerEle.offsetWidth,O<10&&(O=L);let H=K-(O/2-1);H>w?(w=H+O+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${H.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=C(o,N)}}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),I.y=0,this._trackList.forEach(function(M){M.render(r._context,I),I.y+=M.height})};xd.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)))};xd.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 SBt(e){return function(t){e._mouseMode!==Ah.touchOnly&&(t.button===0?(e._mouseMode=Ah.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Ah.zoom:e._mouseMode=Ah.slide)),t.preventDefault()}}function ZBt(e){return function(t){e._mouseMode=Ah.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function RBt(e){return function(t){let n;if(e._mouseMode===Ah.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===Ah.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===Ah.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function CBt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;ole=Math.max(Math.min(Math.abs(n),ole),1),n/=ole,e.zoomFrom(Math.pow(1.05,-n))}}function VBt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Ah.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=yd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=yd.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=yd.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=yd.ignore}}function EBt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===yd.singleTap?(e._touchMode=yd.scrub,e._onTouchMove(t)):e._touchMode===yd.scrub&&e._onTouchMove(t),e._mouseMode=Ah.touchOnly,n!==1?e._touchMode=n>0?yd.ignore:yd.none:e._touchMode===yd.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function ABt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===yd.singleTap&&(e._touchMode=yd.slideZoom),e._mouseMode=Ah.touchOnly,e._touchMode===yd.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===yd.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))}}xd.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 B5=xd;var ufr=x(T(),1);var ofr=x(T(),1);function cYe(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 Gh(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=Ee.observable();return Ee.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=cYe(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===xc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===xc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===xc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-W.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:W.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationX=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationY=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationZ=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleX=P.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleY=P.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleZ=P.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}})}var GBt=new h,LBt=new h,WBt=new Cc,vBt=new q;function H0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,GBt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,LBt),i=WBt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=q.fromHeadingPitchRoll(i,vBt),r=q.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=P.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Gh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=cYe(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,H0(t)}}});Gh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Gh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Gh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Gh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Gh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Gh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Gh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new I0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Gh.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};Gh.prototype.isDestroyed=function(){return!1};Gh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),me(this)};var z5=Gh;function KJ(e,t){e=Nn(e);let n=document.createElement("div"),i=new z5(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{createSection:s,createCheckbox:a,createRangeInput:c,createButton:d}=hu,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),b=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 f=10,y=10,_=W.PI;m.appendChild(c("Translation X","translationX",-f,+f)),m.appendChild(c("Translation Y","translationY",-f,+f)),m.appendChild(c("Translation Z","translationZ",-f,+f)),m.appendChild(c("Scale X","scaleX",0,+y)),m.appendChild(c("Scale Y","scaleY",0,+y)),m.appendChild(c("Scale Z","scaleZ",0,+y)),m.appendChild(c("Heading","angleX",-_,+_)),m.appendChild(c("Pitch","angleY",-_,+_)),m.appendChild(c("Roll","angleZ",-_,+_)),sle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),sle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),sle("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let S=document.createElement("div");b.appendChild(S);let Z=document.createElement("textarea");Z.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),S.className="cesium-cesiumInspector-styleEditor",S.appendChild(Z);let R=d("Compile (Ctrl+Enter)","compileShader");S.appendChild(R);let C=document.createElement("label");C.style.display="block",C.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),S.appendChild(C),Ee.applyBindings(i,n)}Object.defineProperties(KJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KJ.prototype.isDestroyed=function(){return!1};KJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function sle(e,t,n,i,o,r,s,a,c,d,u,m,p,b){let f=hu.createRangeInputWithDynamicMinMax,y=b.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(f(e,s)),y.appendChild(f(t,a)),y.appendChild(f(n,c)),y.appendChild(f(i,d)),y.appendChild(f(o,u)),y.appendChild(f(r,m))}var H5=KJ;var Jfr=x(T(),1);var Afr=x(T(),1);var _fr=x(T(),1);var hYe=x(mYe(),1);function PBt(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 fYe(){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 XBt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(fYe(),e._locked=!1),e._noSleep.disable(),qr.exitFullscreen(),n(!1)):(qr.fullscreen||qr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=PBt("landscape")),t.useWebVR=!0,n(!0)))}function JJ(e,t){let n=this,i=Ee.observable(qr.enabled),o=Ee.observable(!1);this.isVRMode=void 0,Ee.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ee.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&qr.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ee.observable(!1);this._isOrthographic=void 0,Ee.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Hr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof yn)}),this._locked=!1,this._noSleep=new hYe.default,this._command=Fn(function(){XBt(n,e,o,r)},Ee.getObservable(this,"isVREnabled")),this._vrElement=Nn(t)??document.body,this._callback=function(){!qr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(fYe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(JJ.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});JJ.prototype.isDestroyed=function(){return!1};JJ.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(qr.changeEventName,this._callback),me(this)};var K5=JJ;var NBt="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",YBt="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 jJ(e,t,n){e=Nn(e);let i=new K5(t,n);i._exitVRPath=YBt,i._enterVRPath=NBt;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),Ee.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(jJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});jJ.prototype.isDestroyed=function(){return!1};jJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var J5=jJ;var pYe=new de;function yYe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function wBt(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 MBt(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 bYe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof er)return i;if(n instanceof ea||n instanceof ES)return new er({name:MBt(n),description:wBt(n),feature:n})}return OBt(e,t.position)}var kBt=new Q;function dle(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,kBt)),e.updateFromClock(),e.zoomTo(i,o)}}}var UBt=new h;function DBt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof zr)return i}}function OBt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let o=n.imageryLayers;if(!l(o)){let a=DBt(n.primitives);if(!l(a))return;o=a.imageryLayers}let r=o.pickImageryLayerFeatures(i,n);if(!l(r))return;let s=new er({id:"Loading...",description:"Loading feature information..."});return r.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=gYe();return}let c=a[0],d=new er({id:c.name,description:c.description});if(l(c.position)){let u=e.scene.ellipsoid.cartographicToCartesian(c.position,UBt);d.position=new Ml(u)}e.selectedEntity=d},function(){e.selectedEntity===s&&(e.selectedEntity=gYe())}),s}function gYe(){return new er({id:"None",description:"No features found."})}function BBt(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,m=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(m)&&(m.container.style.visibility=p),e._container){let b=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${b}px`,e.forceResize()}}function uo(e,t){e=Nn(e),t=t??B.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=t.scene3DOnly??!1,c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new Lf,d=new a5(c),u=!0);let m=new e5(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=m.scene,b=new Hr;b.add(c.onTick,uo.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let z=document.createElement("div");z.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(z),f=new M5(z,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let z=document.createElement("div");z.className="cesium-viewer-infoBoxContainer",o.appendChild(z),y=new G5(z);let K=y.viewModel;b.add(K.cameraClicked,uo.prototype._onInfoBoxCameraClicked,this),b.add(K.closeClicked,uo.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let S;if(!l(t.geocoder)||t.geocoder!==!1){let z=document.createElement("div");z.className="cesium-viewer-geocoderContainer",_.appendChild(z);let K;typeof t.geocoder=="string"?K=[new JZ({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new x5({container:z,geocoderServices:K,scene:p}),b.add(S.viewModel.search.beforeExecute,uo.prototype._clearObjects,this)}let Z;(!l(t.homeButton)||t.homeButton!==!1)&&(Z=new F5(_,p),l(S)&&b.add(Z.viewModel.command.afterExecute,function(){let z=S.viewModel;z.searchText="",z.isSearchInProgress&&z.search()}),b.add(Z.viewModel.command.beforeExecute,uo.prototype._clearTrackedObject,this));let R;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(R=new P5(_,p));let C;t.projectionPicker&&(C=new U5(_,p));let E,A;if(n){let z=t.imageryProviderViewModels??f5(),K=t.terrainProviderViewModels??p5();E=new h5(_,{globe:p.globe,imageryProviderViewModels:z,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:K,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),A=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(E.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(E.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let L;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let z=!0;try{if(l(window.localStorage)){let K=window.localStorage.getItem("cesium-hasSeenNavHelp");l(K)&&K?z=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}L=new W5({container:_,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??z})}let F;if(!l(t.animation)||t.animation!==!1){let z=document.createElement("div");z.className="cesium-viewer-animationContainer",o.appendChild(z),F=new d5(z,new u5(d))}let I;if(!l(t.timeline)||t.timeline!==!1){let z=document.createElement("div");z.className="cesium-viewer-timelineContainer",o.appendChild(z),I=new B5(z,c),I.addEventListener("settime",yYe,!1),I.zoomTo(c.startTime,c.stopTime)}let N,g,V;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(V=document.createElement("div"),V.className="cesium-viewer-fullscreenContainer",o.appendChild(V),N=new g5(V,t.fullscreenElement),g=Sc(N.viewModel,"isFullscreenEnabled",function(z){V.style.display=z?"block":"none",l(I)&&(I.container.style.right=`${V.clientWidth}px`,I.resize())}));let G,v,X;if(t.vrButton){let z=document.createElement("div");z.className="cesium-viewer-vrContainer",o.appendChild(z),G=new J5(z,p,t.fullScreenElement),v=Sc(G.viewModel,"isVREnabled",function(K){z.style.display=K?"block":"none",l(N)&&(z.style.right=`${V.clientWidth}px`),l(I)&&(I.container.style.right=`${z.clientWidth}px`,I.resize())}),X=Sc(G.viewModel,"isVRMode",function(K){BBt(i,K)})}this._baseLayerPickerDropDown=A,this._fullscreenSubscription=g,this._vrSubscription=v,this._vrModeSubscription=X,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=f,this._infoBox=y,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=Z,this._sceneModePicker=R,this._projectionPicker=C,this._baseLayerPicker=E,this._navigationHelpButton=L,this._animation=F,this._timeline=I,this._fullscreenButton=N,this._vrButton=G,this._geocoder=S,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new Se;let Y=this._cesiumWidget.dataSources,D=this._cesiumWidget.dataSourceDisplay;b.add(Y.dataSourceAdded,uo.prototype._onDataSourceAdded,this),b.add(Y.dataSourceRemoved,uo.prototype._onDataSourceRemoved,this),b.add(p.postUpdate,uo.prototype.resize,this);let w=Y.length;for(let z=0;z<w;z++)this._dataSourceAdded(Y,Y.get(z));this._dataSourceAdded(void 0,D.defaultDataSource),b.add(Y.dataSourceAdded,uo.prototype._dataSourceAdded,this),b.add(Y.dataSourceRemoved,uo.prototype._dataSourceRemoved,this);function O(z){let K=bYe(i,z);l(K)?j.getValueOrUndefined(K.position,i.clock.currentTime)?i.trackedEntity=K:i.zoomTo(K):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function M(z){i.selectedEntity=bYe(i,z)}m.screenSpaceEventHandler.setInputAction(M,mn.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(O,mn.LEFT_DOUBLE_CLICK),m._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(uo.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,dle(this._timeline,e))}}});uo.prototype.extend=function(e,t){e(this,t)};uo.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,m=5,p=3,b=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())),m=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,y=this._vrButton,_=c.container,S=_.style;p=_.clientHeight+3,S.left=`${u}px`;let Z=0;l(f)&&(Z+=f.container.clientWidth),l(y)&&(Z+=y.container.clientWidth),S.right=`${Z}px`,c.resize()}!r&&l(this._fullscreenButton)&&(b=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${b}px`,this._lastWidth=n,this._lastHeight=i};uo.prototype.forceResize=function(){this._lastWidth=0,this.resize()};uo.prototype.render=function(){this._cesiumWidget.render()};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(mn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(mn.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",yYe,!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)};uo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(uo.prototype._onEntityCollectionChanged,this)};uo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(uo.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};uo.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};uo.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,pYe)!==Wt.FAILED?n=pYe.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=h.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=o.name??o.id,a.description=j.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};uo.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)}};uo.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)}};uo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};uo.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};uo.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};uo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&dle(this.timeline,e)};uo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&dle(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,uo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};uo.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};uo.prototype.addController=function(e){return this._cesiumWidget.addController(e)};uo.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};uo.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};uo.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var ule=uo;var qfr=x(T(),1);function zBt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new V5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var mle=zBt;var tpr=x(T(),1);function HBt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new S5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var hle=HBt;var rpr=x(T(),1);function KBt(e,t){t=t??B.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new Se,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Nn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){xYe(s,d),s=u,fle(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?fle(s,d):xYe(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){kR(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let b=0;b<p;b++){let f=m[b],y=new FileReader;y.onload=JBt(e,f,c,a),y.onerror=jBt(e,f),y.readAsText(f)}}fle(s,d),e.destroy=nk(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function kR(e){e.stopPropagation(),e.preventDefault()}function xYe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",kR,!1),n.removeEventListener("dragover",kR,!1),n.removeEventListener("dragexit",kR,!1))}function fle(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",kR,!1),e.addEventListener("dragover",kR,!1),e.addEventListener("dragexit",kR,!1)}function JBt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=tY.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=cT.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=XZ.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=kw.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 jBt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var ple=KBt;var upr=x(T(),1);function QBt(e,t){t=t??B.EMPTY_OBJECT;let n=new N5({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var ble=QBt;var fpr=x(T(),1);function qBt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new H5(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var gle=qBt;globalThis.CESIUM_VERSION="1.145.0";var $Bt="1.145.0";return VYe(e3t);})(); //# sourceMappingURL=Cesium.js.map diff --git a/plugins/feature/map/Cesium/ThirdParty/Workers/pako_deflate.min.js b/plugins/feature/map/Cesium/ThirdParty/Workers/pako_deflate.min.js index 71416d2af..16d1c990e 100644 --- a/plugins/feature/map/Cesium/ThirdParty/Workers/pako_deflate.min.js +++ b/plugins/feature/map/Cesium/ThirdParty/Workers/pako_deflate.min.js @@ -1 +1 @@ -/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(v,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):z((v=typeof globalThis<"u"?globalThis:v||self).pako={})})(this,function(v){"use strict";function z(e){let s=e.length;for(;--s>=0;)e[s]=0}const oe=256,Ae=286,H=30,M=15,de=new Uint8Array([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]),ae=new Uint8Array([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]),ra=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=new Array(576);z(Z);const P=new Array(60);z(P);const j=new Array(512);z(j);const K=new Array(256);z(K);const ue=new Array(29);z(ue);const se=new Array(H);function fe(e,s,a,r,n){this.static_tree=e,this.extra_bits=s,this.extra_base=a,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let Ze,Ue,Re;function ce(e,s){this.dyn_tree=e,this.max_code=0,this.stat_desc=s}z(se);const Se=e=>e<256?j[e]:j[256+(e>>>7)],Y=(e,s)=>{e.pending_buf[e.pending++]=255&s,e.pending_buf[e.pending++]=s>>>8&255},p=(e,s,a)=>{e.bi_valid>16-a?(e.bi_buf|=s<<e.bi_valid&65535,Y(e,e.bi_buf),e.bi_buf=s>>16-e.bi_valid,e.bi_valid+=a-16):(e.bi_buf|=s<<e.bi_valid&65535,e.bi_valid+=a)},k=(e,s,a)=>{p(e,a[2*s],a[2*s+1])},Te=(e,s)=>{let a=0;do a|=1&e,e>>>=1,a<<=1;while(--s>0);return a>>>1},Le=(e,s,a)=>{const r=new Array(16);let n,i,_=0;for(n=1;n<=M;n++)_=_+a[n-1]<<1,r[n]=_;for(i=0;i<=s;i++){let t=e[2*i+1];t!==0&&(e[2*i]=Te(r[t]++,t))}},Fe=e=>{let s;for(s=0;s<Ae;s++)e.dyn_ltree[2*s]=0;for(s=0;s<H;s++)e.dyn_dtree[2*s]=0;for(s=0;s<19;s++)e.bl_tree[2*s]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Oe=e=>{e.bi_valid>8?Y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},De=(e,s,a,r)=>{const n=2*s,i=2*a;return e[n]<e[i]||e[n]===e[i]&&r[s]<=r[a]},pe=(e,s,a)=>{const r=e.heap[a];let n=a<<1;for(;n<=e.heap_len&&(n<e.heap_len&&De(s,e.heap[n+1],e.heap[n],e.depth)&&n++,!De(s,r,e.heap[n],e.depth));)e.heap[a]=e.heap[n],a=n,n<<=1;e.heap[a]=r},Ne=(e,s,a)=>{let r,n,i,_,t=0;if(e.sym_next!==0)do r=255&e.pending_buf[e.sym_buf+t++],r+=(255&e.pending_buf[e.sym_buf+t++])<<8,n=e.pending_buf[e.sym_buf+t++],r===0?k(e,n,s):(i=K[n],k(e,i+oe+1,s),_=de[i],_!==0&&(n-=ue[i],p(e,n,_)),r--,i=Se(r),k(e,i,a),_=ae[i],_!==0&&(r-=se[i],p(e,r,_)));while(t<e.sym_next);k(e,256,s)},ge=(e,s)=>{const a=s.dyn_tree,r=s.stat_desc.static_tree,n=s.stat_desc.has_stree,i=s.stat_desc.elems;let _,t,h,l=-1;for(e.heap_len=0,e.heap_max=573,_=0;_<i;_++)a[2*_]!==0?(e.heap[++e.heap_len]=l=_,e.depth[_]=0):a[2*_+1]=0;for(;e.heap_len<2;)h=e.heap[++e.heap_len]=l<2?++l:0,a[2*h]=1,e.depth[h]=0,e.opt_len--,n&&(e.static_len-=r[2*h+1]);for(s.max_code=l,_=e.heap_len>>1;_>=1;_--)pe(e,a,_);h=i;do _=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pe(e,a,1),t=e.heap[1],e.heap[--e.heap_max]=_,e.heap[--e.heap_max]=t,a[2*h]=a[2*_]+a[2*t],e.depth[h]=(e.depth[_]>=e.depth[t]?e.depth[_]:e.depth[t])+1,a[2*_+1]=a[2*t+1]=h,e.heap[1]=h++,pe(e,a,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((u,d)=>{const m=d.dyn_tree,V=d.max_code,_e=d.stat_desc.static_tree,Na=d.stat_desc.has_stree,Ia=d.stat_desc.extra_bits,na=d.stat_desc.extra_base,$=d.stat_desc.max_length;let ee,y,B,f,le,xe,he=0;for(f=0;f<=M;f++)u.bl_count[f]=0;for(m[2*u.heap[u.heap_max]+1]=0,ee=u.heap_max+1;ee<573;ee++)y=u.heap[ee],f=m[2*m[2*y+1]+1]+1,f>$&&(f=$,he++),m[2*y+1]=f,y>V||(u.bl_count[f]++,le=0,y>=na&&(le=Ia[y-na]),xe=m[2*y],u.opt_len+=xe*(f+le),Na&&(u.static_len+=xe*(_e[2*y+1]+le)));if(he!==0){do{for(f=$-1;u.bl_count[f]===0;)f--;u.bl_count[f]--,u.bl_count[f+1]+=2,u.bl_count[$]--,he-=2}while(he>0);for(f=$;f!==0;f--)for(y=u.bl_count[f];y!==0;)B=u.heap[--ee],B>V||(m[2*B+1]!==f&&(u.opt_len+=(f-m[2*B+1])*m[2*B],m[2*B+1]=f),y--)}})(e,s),Le(a,l,e.bl_count)},Ie=(e,s,a)=>{let r,n,i=-1,_=s[1],t=0,h=7,l=4;for(_===0&&(h=138,l=3),s[2*(a+1)+1]=65535,r=0;r<=a;r++)n=_,_=s[2*(r+1)+1],++t<h&&n===_||(t<l?e.bl_tree[2*n]+=t:n!==0?(n!==i&&e.bl_tree[2*n]++,e.bl_tree[32]++):t<=10?e.bl_tree[34]++:e.bl_tree[36]++,t=0,i=n,_===0?(h=138,l=3):n===_?(h=6,l=3):(h=7,l=4))},Ce=(e,s,a)=>{let r,n,i=-1,_=s[1],t=0,h=7,l=4;for(_===0&&(h=138,l=3),r=0;r<=a;r++)if(n=_,_=s[2*(r+1)+1],!(++t<h&&n===_)){if(t<l)do k(e,n,e.bl_tree);while(--t!=0);else n!==0?(n!==i&&(k(e,n,e.bl_tree),t--),k(e,16,e.bl_tree),p(e,t-3,2)):t<=10?(k(e,17,e.bl_tree),p(e,t-3,3)):(k(e,18,e.bl_tree),p(e,t-11,7));t=0,i=n,_===0?(h=138,l=3):n===_?(h=6,l=3):(h=7,l=4)}};let Be=!1;const He=(e,s,a,r)=>{p(e,0+(r?1:0),3),Oe(e),Y(e,a),Y(e,~a),a&&e.pending_buf.set(e.window.subarray(s,s+a),e.pending),e.pending+=a};var ia=(e,s,a,r)=>{let n,i,_=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(t=>{let h,l=4093624447;for(h=0;h<=31;h++,l>>>=1)if(1&l&&t.dyn_ltree[2*h]!==0)return 0;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return 1;for(h=32;h<oe;h++)if(t.dyn_ltree[2*h]!==0)return 1;return 0})(e)),ge(e,e.l_desc),ge(e,e.d_desc),_=(t=>{let h;for(Ie(t,t.dyn_ltree,t.l_desc.max_code),Ie(t,t.dyn_dtree,t.d_desc.max_code),ge(t,t.bl_desc),h=18;h>=3&&t.bl_tree[2*Ee[h]+1]===0;h--);return t.opt_len+=3*(h+1)+5+5+4,h})(e),n=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=n&&(n=i)):n=i=a+5,a+4<=n&&s!==-1?He(e,s,a,r):e.strategy===4||i===n?(p(e,2+(r?1:0),3),Ne(e,Z,P)):(p(e,4+(r?1:0),3),((t,h,l,u)=>{let d;for(p(t,h-257,5),p(t,l-1,5),p(t,u-4,4),d=0;d<u;d++)p(t,t.bl_tree[2*Ee[d]+1],3);Ce(t,t.dyn_ltree,h-1),Ce(t,t.dyn_dtree,l-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,_+1),Ne(e,e.dyn_ltree,e.dyn_dtree)),Fe(e),r&&Oe(e)},ta={_tr_init:e=>{Be||((()=>{let s,a,r,n,i;const _=new Array(16);for(r=0,n=0;n<28;n++)for(ue[n]=r,s=0;s<1<<de[n];s++)K[r++]=n;for(K[r-1]=n,i=0,n=0;n<16;n++)for(se[n]=i,s=0;s<1<<ae[n];s++)j[i++]=n;for(i>>=7;n<H;n++)for(se[n]=i<<7,s=0;s<1<<ae[n]-7;s++)j[256+i++]=n;for(a=0;a<=M;a++)_[a]=0;for(s=0;s<=143;)Z[2*s+1]=8,s++,_[8]++;for(;s<=255;)Z[2*s+1]=9,s++,_[9]++;for(;s<=279;)Z[2*s+1]=7,s++,_[7]++;for(;s<=287;)Z[2*s+1]=8,s++,_[8]++;for(Le(Z,287,_),s=0;s<H;s++)P[2*s+1]=5,P[2*s]=Te(s,5);Ze=new fe(Z,de,257,Ae,M),Ue=new fe(P,ae,0,H,M),Re=new fe(new Array(0),ra,0,19,7)})(),Be=!0),e.l_desc=new ce(e.dyn_ltree,Ze),e.d_desc=new ce(e.dyn_dtree,Ue),e.bl_desc=new ce(e.bl_tree,Re),e.bi_buf=0,e.bi_valid=0,Fe(e)},_tr_stored_block:He,_tr_flush_block:ia,_tr_tally:(e,s,a)=>(e.pending_buf[e.sym_buf+e.sym_next++]=s,e.pending_buf[e.sym_buf+e.sym_next++]=s>>8,e.pending_buf[e.sym_buf+e.sym_next++]=a,s===0?e.dyn_ltree[2*a]++:(e.matches++,s--,e.dyn_ltree[2*(K[a]+oe+1)]++,e.dyn_dtree[2*Se(s)]++),e.sym_next===e.sym_end),_tr_align:e=>{p(e,2,3),k(e,256,Z),(s=>{s.bi_valid===16?(Y(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)})(e)}},Me=(e,s,a,r)=>{let n=65535&e|0,i=e>>>16&65535|0,_=0;for(;a!==0;){_=a>2e3?2e3:a,a-=_;do n=n+s[r++]|0,i=i+n|0;while(--_);n%=65521,i%=65521}return n|i<<16|0};const _a=new Uint32Array((()=>{let e,s=[];for(var a=0;a<256;a++){e=a;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;s[a]=e}return s})());var U=(e,s,a,r)=>{const n=_a,i=r+a;e^=-1;for(let _=r;_<i;_++)e=e>>>8^n[255&(e^s[_])];return-1^e},ne={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},we={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:la,_tr_stored_block:me,_tr_flush_block:ha,_tr_tally:R,_tr_align:oa}=ta,{Z_NO_FLUSH:S,Z_PARTIAL_FLUSH:da,Z_FULL_FLUSH:ua,Z_FINISH:b,Z_BLOCK:Pe,Z_OK:c,Z_STREAM_END:je,Z_STREAM_ERROR:x,Z_DATA_ERROR:fa,Z_BUF_ERROR:be,Z_DEFAULT_COMPRESSION:ca,Z_FILTERED:pa,Z_HUFFMAN_ONLY:re,Z_RLE:ga,Z_FIXED:wa,Z_DEFAULT_STRATEGY:ma,Z_UNKNOWN:ba,Z_DEFLATED:ie}=we,F=258,A=262,N=42,O=113,G=666,D=(e,s)=>(e.msg=ne[s],s),Ke=e=>2*e-(e>4?9:0),T=e=>{let s=e.length;for(;--s>=0;)e[s]=0},ya=e=>{let s,a,r,n=e.w_size;s=e.hash_size,r=s;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--s);s=n,r=s;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--s)};let L=(e,s,a)=>(s<<e.hash_shift^a)&e.hash_mask;const g=e=>{const s=e.state;let a=s.pending;a>e.avail_out&&(a=e.avail_out),a!==0&&(e.output.set(s.pending_buf.subarray(s.pending_out,s.pending_out+a),e.next_out),e.next_out+=a,s.pending_out+=a,e.total_out+=a,e.avail_out-=a,s.pending-=a,s.pending===0&&(s.pending_out=0))},w=(e,s)=>{ha(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,s),e.block_start=e.strstart,g(e.strm)},o=(e,s)=>{e.pending_buf[e.pending++]=s},X=(e,s)=>{e.pending_buf[e.pending++]=s>>>8&255,e.pending_buf[e.pending++]=255&s},ye=(e,s,a,r)=>{let n=e.avail_in;return n>r&&(n=r),n===0?0:(e.avail_in-=n,s.set(e.input.subarray(e.next_in,e.next_in+n),a),e.state.wrap===1?e.adler=Me(e.adler,s,n,a):e.state.wrap===2&&(e.adler=U(e.adler,s,n,a)),e.next_in+=n,e.total_in+=n,n)},Ye=(e,s)=>{let a,r,n=e.max_chain_length,i=e.strstart,_=e.prev_length,t=e.nice_match;const h=e.strstart>e.w_size-A?e.strstart-(e.w_size-A):0,l=e.window,u=e.w_mask,d=e.prev,m=e.strstart+F;let V=l[i+_-1],_e=l[i+_];e.prev_length>=e.good_match&&(n>>=2),t>e.lookahead&&(t=e.lookahead);do if(a=s,l[a+_]===_e&&l[a+_-1]===V&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do;while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<m);if(r=F-(m-i),i=m-F,r>_){if(e.match_start=s,_=r,r>=t)break;V=l[i+_-1],_e=l[i+_]}}while((s=d[s&u])>h&&--n!=0);return _<=e.lookahead?_:e.lookahead},I=e=>{const s=e.w_size;let a,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-A)&&(e.window.set(e.window.subarray(s,s+s-r),0),e.match_start-=s,e.strstart-=s,e.block_start-=s,e.insert>e.strstart&&(e.insert=e.strstart),ya(e),r+=s),e.strm.avail_in===0)break;if(a=ye(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=a,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=L(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=L(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<A&&e.strm.avail_in!==0)},Ge=(e,s)=>{let a,r,n,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,_=0,t=e.strm.avail_in;do{if(a=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n||(n=e.strm.avail_out-n,r=e.strstart-e.block_start,a>r+e.strm.avail_in&&(a=r+e.strm.avail_in),a>n&&(a=n),a<i&&(a===0&&s!==b||s===S||a!==r+e.strm.avail_in)))break;_=s===b&&a===r+e.strm.avail_in?1:0,me(e,0,0,_),e.pending_buf[e.pending-4]=a,e.pending_buf[e.pending-3]=a>>8,e.pending_buf[e.pending-2]=~a,e.pending_buf[e.pending-1]=~a>>8,g(e.strm),r&&(r>a&&(r=a),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,a-=r),a&&(ye(e.strm,e.strm.output,e.strm.next_out,a),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a)}while(_===0);return t-=e.strm.avail_in,t&&(t>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=t&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-t,e.strm.next_in),e.strstart),e.strstart+=t,e.insert+=t>e.w_size-e.insert?e.w_size-e.insert:t),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),_?4:s!==S&&s!==b&&e.strm.avail_in===0&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(ye(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,i=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=i||(r||s===b)&&s!==S&&e.strm.avail_in===0&&r<=n)&&(a=r>n?n:r,_=s===b&&e.strm.avail_in===0&&a===r?1:0,me(e,e.block_start,a,_),e.block_start+=a,g(e.strm)),_?3:1)},ve=(e,s)=>{let a,r;for(;;){if(e.lookahead<A){if(I(e),e.lookahead<A&&s===S)return 1;if(e.lookahead===0)break}if(a=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),a!==0&&e.strstart-a<=e.w_size-A&&(e.match_length=Ye(e,a)),e.match_length>=3)if(r=R(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=L(e,e.ins_h,e.window[e.strstart+1]);else r=R(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(w(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,s===b?(w(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(w(e,!1),e.strm.avail_out===0)?1:2},C=(e,s)=>{let a,r,n;for(;;){if(e.lookahead<A){if(I(e),e.lookahead<A&&s===S)return 1;if(e.lookahead===0)break}if(a=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,a!==0&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-A&&(e.match_length=Ye(e,a),e.match_length<=5&&(e.strategy===pa||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=R(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(w(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=R(e,0,e.window[e.strstart-1]),r&&w(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=R(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,s===b?(w(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(w(e,!1),e.strm.avail_out===0)?1:2};function E(e,s,a,r,n){this.good_length=e,this.max_lazy=s,this.nice_length=a,this.max_chain=r,this.func=n}const W=[new E(0,0,0,0,Ge),new E(4,4,8,4,ve),new E(4,5,16,8,ve),new E(4,6,32,32,ve),new E(4,4,16,16,C),new E(8,16,32,32,C),new E(8,16,128,128,C),new E(8,32,128,256,C),new E(32,128,258,1024,C),new E(32,258,258,4096,C)];function va(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ie,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const q=e=>{if(!e)return 1;const s=e.state;return!s||s.strm!==e||s.status!==N&&s.status!==57&&s.status!==69&&s.status!==73&&s.status!==91&&s.status!==103&&s.status!==O&&s.status!==G?1:0},Xe=e=>{if(q(e))return D(e,x);e.total_in=e.total_out=0,e.data_type=ba;const s=e.state;return s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap===2?57:s.wrap?N:O,e.adler=s.wrap===2?0:1,s.last_flush=-2,la(s),c},We=e=>{const s=Xe(e);var a;return s===c&&((a=e.state).window_size=2*a.w_size,T(a.head),a.max_lazy_match=W[a.level].max_lazy,a.good_match=W[a.level].good_length,a.nice_match=W[a.level].nice_length,a.max_chain_length=W[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),s},qe=(e,s,a,r,n,i)=>{if(!e)return x;let _=1;if(s===ca&&(s=6),r<0?(_=0,r=-r):r>15&&(_=2,r-=16),n<1||n>9||a!==ie||r<8||r>15||s<0||s>9||i<0||i>wa||r===8&&_!==1)return D(e,x);r===8&&(r=9);const t=new va;return e.state=t,t.strm=e,t.status=N,t.wrap=_,t.gzhead=null,t.w_bits=r,t.w_size=1<<t.w_bits,t.w_mask=t.w_size-1,t.hash_bits=n+7,t.hash_size=1<<t.hash_bits,t.hash_mask=t.hash_size-1,t.hash_shift=~~((t.hash_bits+3-1)/3),t.window=new Uint8Array(2*t.w_size),t.head=new Uint16Array(t.hash_size),t.prev=new Uint16Array(t.w_size),t.lit_bufsize=1<<n+6,t.pending_buf_size=4*t.lit_bufsize,t.pending_buf=new Uint8Array(t.pending_buf_size),t.sym_buf=t.lit_bufsize,t.sym_end=3*(t.lit_bufsize-1),t.level=s,t.strategy=i,t.method=a,We(e)};var J={deflateInit:(e,s)=>qe(e,s,ie,15,8,ma),deflateInit2:qe,deflateReset:We,deflateResetKeep:Xe,deflateSetHeader:(e,s)=>q(e)||e.state.wrap!==2?x:(e.state.gzhead=s,c),deflate:(e,s)=>{if(q(e)||s>Pe||s<0)return e?D(e,x):x;const a=e.state;if(!e.output||e.avail_in!==0&&!e.input||a.status===G&&s!==b)return D(e,e.avail_out===0?be:x);const r=a.last_flush;if(a.last_flush=s,a.pending!==0){if(g(e),e.avail_out===0)return a.last_flush=-1,c}else if(e.avail_in===0&&Ke(s)<=Ke(r)&&s!==b)return D(e,be);if(a.status===G&&e.avail_in!==0)return D(e,be);if(a.status===N&&a.wrap===0&&(a.status=O),a.status===N){let n=ie+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=re||a.level<2?0:a.level<6?1:a.level===6?2:3,n|=i<<6,a.strstart!==0&&(n|=32),n+=31-n%31,X(a,n),a.strstart!==0&&(X(a,e.adler>>>16),X(a,65535&e.adler)),e.adler=1,a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(a.status===57){if(e.adler=0,o(a,31),o(a,139),o(a,8),a.gzhead)o(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),o(a,255&a.gzhead.time),o(a,a.gzhead.time>>8&255),o(a,a.gzhead.time>>16&255),o(a,a.gzhead.time>>24&255),o(a,a.level===9?2:a.strategy>=re||a.level<2?4:0),o(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(o(a,255&a.gzhead.extra.length),o(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=U(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(o(a,0),o(a,0),o(a,0),o(a,0),o(a,0),o(a,a.level===9?2:a.strategy>=re||a.level<2?4:0),o(a,3),a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(a.status===69){if(a.gzhead.extra){let n=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let t=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+t),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>n&&(e.adler=U(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex+=t,g(e),a.pending!==0)return a.last_flush=-1,c;n=0,i-=t}let _=new Uint8Array(a.gzhead.extra);a.pending_buf.set(_.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>n&&(e.adler=U(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex=0}a.status=73}if(a.status===73){if(a.gzhead.name){let n,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),g(e),a.pending!==0)return a.last_flush=-1,c;i=0}n=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,o(a,n)}while(n!==0);a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(a.status===91){if(a.gzhead.comment){let n,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),g(e),a.pending!==0)return a.last_flush=-1,c;i=0}n=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,o(a,n)}while(n!==0);a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(a.status===103){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(g(e),a.pending!==0))return a.last_flush=-1,c;o(a,255&e.adler),o(a,e.adler>>8&255),e.adler=0}if(a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(e.avail_in!==0||a.lookahead!==0||s!==S&&a.status!==G){let n=a.level===0?Ge(a,s):a.strategy===re?((i,_)=>{let t;for(;;){if(i.lookahead===0&&(I(i),i.lookahead===0)){if(_===S)return 1;break}if(i.match_length=0,t=R(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(w(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,_===b?(w(i,!0),i.strm.avail_out===0?3:4):i.sym_next&&(w(i,!1),i.strm.avail_out===0)?1:2})(a,s):a.strategy===ga?((i,_)=>{let t,h,l,u;const d=i.window;for(;;){if(i.lookahead<=F){if(I(i),i.lookahead<=F&&_===S)return 1;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=3&&i.strstart>0&&(l=i.strstart-1,h=d[l],h===d[++l]&&h===d[++l]&&h===d[++l])){u=i.strstart+F;do;while(h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&l<u);i.match_length=F-(u-l),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=3?(t=R(i,1,i.match_length-3),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=R(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(w(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,_===b?(w(i,!0),i.strm.avail_out===0?3:4):i.sym_next&&(w(i,!1),i.strm.avail_out===0)?1:2})(a,s):W[a.level].func(a,s);if(n!==3&&n!==4||(a.status=G),n===1||n===3)return e.avail_out===0&&(a.last_flush=-1),c;if(n===2&&(s===da?oa(a):s!==Pe&&(me(a,0,0,!1),s===ua&&(T(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),g(e),e.avail_out===0))return a.last_flush=-1,c}return s!==b?c:a.wrap<=0?je:(a.wrap===2?(o(a,255&e.adler),o(a,e.adler>>8&255),o(a,e.adler>>16&255),o(a,e.adler>>24&255),o(a,255&e.total_in),o(a,e.total_in>>8&255),o(a,e.total_in>>16&255),o(a,e.total_in>>24&255)):(X(a,e.adler>>>16),X(a,65535&e.adler)),g(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?c:je)},deflateEnd:e=>{if(q(e))return x;const s=e.state.status;return e.state=null,s===O?D(e,fa):c},deflateSetDictionary:(e,s)=>{let a=s.length;if(q(e))return x;const r=e.state,n=r.wrap;if(n===2||n===1&&r.status!==N||r.lookahead)return x;if(n===1&&(e.adler=Me(e.adler,s,a,0)),r.wrap=0,a>=r.w_size){n===0&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let h=new Uint8Array(r.w_size);h.set(s.subarray(a-r.w_size,a),0),s=h,a=r.w_size}const i=e.avail_in,_=e.next_in,t=e.input;for(e.avail_in=a,e.next_in=0,e.input=s,I(r);r.lookahead>=3;){let h=r.strstart,l=r.lookahead-2;do r.ins_h=L(r,r.ins_h,r.window[h+3-1]),r.prev[h&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=h,h++;while(--l);r.strstart=h,r.lookahead=2,I(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=_,e.input=t,e.avail_in=i,r.wrap=n,c},deflateInfo:"pako deflate (from Nodeca project)"};const za=(e,s)=>Object.prototype.hasOwnProperty.call(e,s);var ka=function(e){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const a=s.shift();if(a){if(typeof a!="object")throw new TypeError(a+"must be non-object");for(const r in a)za(a,r)&&(e[r]=a[r])}}return e},xa=e=>{let s=0;for(let r=0,n=e.length;r<n;r++)s+=e[r].length;const a=new Uint8Array(s);for(let r=0,n=0,i=e.length;r<i;r++){let _=e[r];a.set(_,n),n+=_.length}return a};let Aa=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Aa=!1}const ze=new Uint8Array(256);for(let e=0;e<256;e++)ze[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ze[254]=ze[254]=1;var Je=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let s,a,r,n,i,_=e.length,t=0;for(n=0;n<_;n++)a=e.charCodeAt(n),(64512&a)==55296&&n+1<_&&(r=e.charCodeAt(n+1),(64512&r)==56320&&(a=65536+(a-55296<<10)+(r-56320),n++)),t+=a<128?1:a<2048?2:a<65536?3:4;for(s=new Uint8Array(t),i=0,n=0;i<t;n++)a=e.charCodeAt(n),(64512&a)==55296&&n+1<_&&(r=e.charCodeAt(n+1),(64512&r)==56320&&(a=65536+(a-55296<<10)+(r-56320),n++)),a<128?s[i++]=a:a<2048?(s[i++]=192|a>>>6,s[i++]=128|63&a):a<65536?(s[i++]=224|a>>>12,s[i++]=128|a>>>6&63,s[i++]=128|63&a):(s[i++]=240|a>>>18,s[i++]=128|a>>>12&63,s[i++]=128|a>>>6&63,s[i++]=128|63&a);return s},Ea=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Qe=Object.prototype.toString,{Z_NO_FLUSH:Za,Z_SYNC_FLUSH:Ua,Z_FULL_FLUSH:Ra,Z_FINISH:Sa,Z_OK:te,Z_STREAM_END:Ta,Z_DEFAULT_COMPRESSION:La,Z_DEFAULT_STRATEGY:Fa,Z_DEFLATED:Oa}=we;function Q(e){this.options=ka({level:La,method:Oa,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fa},e||{});let s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ea,this.strm.avail_out=0;let a=J.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(a!==te)throw new Error(ne[a]);if(s.header&&J.deflateSetHeader(this.strm,s.header),s.dictionary){let r;if(r=typeof s.dictionary=="string"?Je(s.dictionary):Qe.call(s.dictionary)==="[object ArrayBuffer]"?new Uint8Array(s.dictionary):s.dictionary,a=J.deflateSetDictionary(this.strm,r),a!==te)throw new Error(ne[a]);this._dict_set=!0}}function ke(e,s){const a=new Q(s);if(a.push(e,!0),a.err)throw a.msg||ne[a.err];return a.result}Q.prototype.push=function(e,s){const a=this.strm,r=this.options.chunkSize;let n,i;if(this.ended)return!1;for(i=s===~~s?s:s===!0?Sa:Za,typeof e=="string"?a.input=Je(e):Qe.call(e)==="[object ArrayBuffer]"?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;)if(a.avail_out===0&&(a.output=new Uint8Array(r),a.next_out=0,a.avail_out=r),(i===Ua||i===Ra)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=J.deflate(a,i),n===Ta)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=J.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===te;if(a.avail_out!==0){if(i>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(a.avail_in===0)break}else this.onData(a.output)}return!0},Q.prototype.onData=function(e){this.chunks.push(e)},Q.prototype.onEnd=function(e){e===te&&(this.result=xa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ve=Q,$e=ke,ea=function(e,s){return(s=s||{}).raw=!0,ke(e,s)},aa=function(e,s){return(s=s||{}).gzip=!0,ke(e,s)},sa=we,Da={Deflate:Ve,deflate:$e,deflateRaw:ea,gzip:aa,constants:sa};v.Deflate=Ve,v.constants=sa,v.default=Da,v.deflate=$e,v.deflateRaw=ea,v.gzip=aa,Object.defineProperty(v,"__esModule",{value:!0})}); +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(v,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):z((v=typeof globalThis<"u"?globalThis:v||self).pako={})})(this,(function(v){"use strict";function z(e){let s=e.length;for(;--s>=0;)e[s]=0}const oe=256,Ae=286,H=30,M=15,de=new Uint8Array([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]),ae=new Uint8Array([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]),ra=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=new Array(576);z(Z);const P=new Array(60);z(P);const j=new Array(512);z(j);const K=new Array(256);z(K);const ue=new Array(29);z(ue);const se=new Array(H);function fe(e,s,a,r,n){this.static_tree=e,this.extra_bits=s,this.extra_base=a,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let Ze,Ue,Re;function ce(e,s){this.dyn_tree=e,this.max_code=0,this.stat_desc=s}z(se);const Se=e=>e<256?j[e]:j[256+(e>>>7)],Y=(e,s)=>{e.pending_buf[e.pending++]=255&s,e.pending_buf[e.pending++]=s>>>8&255},p=(e,s,a)=>{e.bi_valid>16-a?(e.bi_buf|=s<<e.bi_valid&65535,Y(e,e.bi_buf),e.bi_buf=s>>16-e.bi_valid,e.bi_valid+=a-16):(e.bi_buf|=s<<e.bi_valid&65535,e.bi_valid+=a)},k=(e,s,a)=>{p(e,a[2*s],a[2*s+1])},Te=(e,s)=>{let a=0;do a|=1&e,e>>>=1,a<<=1;while(--s>0);return a>>>1},Le=(e,s,a)=>{const r=new Array(16);let n,i,_=0;for(n=1;n<=M;n++)_=_+a[n-1]<<1,r[n]=_;for(i=0;i<=s;i++){let t=e[2*i+1];t!==0&&(e[2*i]=Te(r[t]++,t))}},Fe=e=>{let s;for(s=0;s<Ae;s++)e.dyn_ltree[2*s]=0;for(s=0;s<H;s++)e.dyn_dtree[2*s]=0;for(s=0;s<19;s++)e.bl_tree[2*s]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Oe=e=>{e.bi_valid>8?Y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},De=(e,s,a,r)=>{const n=2*s,i=2*a;return e[n]<e[i]||e[n]===e[i]&&r[s]<=r[a]},pe=(e,s,a)=>{const r=e.heap[a];let n=a<<1;for(;n<=e.heap_len&&(n<e.heap_len&&De(s,e.heap[n+1],e.heap[n],e.depth)&&n++,!De(s,r,e.heap[n],e.depth));)e.heap[a]=e.heap[n],a=n,n<<=1;e.heap[a]=r},Ne=(e,s,a)=>{let r,n,i,_,t=0;if(e.sym_next!==0)do r=255&e.pending_buf[e.sym_buf+t++],r+=(255&e.pending_buf[e.sym_buf+t++])<<8,n=e.pending_buf[e.sym_buf+t++],r===0?k(e,n,s):(i=K[n],k(e,i+oe+1,s),_=de[i],_!==0&&(n-=ue[i],p(e,n,_)),r--,i=Se(r),k(e,i,a),_=ae[i],_!==0&&(r-=se[i],p(e,r,_)));while(t<e.sym_next);k(e,256,s)},ge=(e,s)=>{const a=s.dyn_tree,r=s.stat_desc.static_tree,n=s.stat_desc.has_stree,i=s.stat_desc.elems;let _,t,h,l=-1;for(e.heap_len=0,e.heap_max=573,_=0;_<i;_++)a[2*_]!==0?(e.heap[++e.heap_len]=l=_,e.depth[_]=0):a[2*_+1]=0;for(;e.heap_len<2;)h=e.heap[++e.heap_len]=l<2?++l:0,a[2*h]=1,e.depth[h]=0,e.opt_len--,n&&(e.static_len-=r[2*h+1]);for(s.max_code=l,_=e.heap_len>>1;_>=1;_--)pe(e,a,_);h=i;do _=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pe(e,a,1),t=e.heap[1],e.heap[--e.heap_max]=_,e.heap[--e.heap_max]=t,a[2*h]=a[2*_]+a[2*t],e.depth[h]=(e.depth[_]>=e.depth[t]?e.depth[_]:e.depth[t])+1,a[2*_+1]=a[2*t+1]=h,e.heap[1]=h++,pe(e,a,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((u,d)=>{const m=d.dyn_tree,V=d.max_code,_e=d.stat_desc.static_tree,Na=d.stat_desc.has_stree,Ia=d.stat_desc.extra_bits,na=d.stat_desc.extra_base,$=d.stat_desc.max_length;let ee,y,B,f,le,xe,he=0;for(f=0;f<=M;f++)u.bl_count[f]=0;for(m[2*u.heap[u.heap_max]+1]=0,ee=u.heap_max+1;ee<573;ee++)y=u.heap[ee],f=m[2*m[2*y+1]+1]+1,f>$&&(f=$,he++),m[2*y+1]=f,y>V||(u.bl_count[f]++,le=0,y>=na&&(le=Ia[y-na]),xe=m[2*y],u.opt_len+=xe*(f+le),Na&&(u.static_len+=xe*(_e[2*y+1]+le)));if(he!==0){do{for(f=$-1;u.bl_count[f]===0;)f--;u.bl_count[f]--,u.bl_count[f+1]+=2,u.bl_count[$]--,he-=2}while(he>0);for(f=$;f!==0;f--)for(y=u.bl_count[f];y!==0;)B=u.heap[--ee],B>V||(m[2*B+1]!==f&&(u.opt_len+=(f-m[2*B+1])*m[2*B],m[2*B+1]=f),y--)}})(e,s),Le(a,l,e.bl_count)},Ie=(e,s,a)=>{let r,n,i=-1,_=s[1],t=0,h=7,l=4;for(_===0&&(h=138,l=3),s[2*(a+1)+1]=65535,r=0;r<=a;r++)n=_,_=s[2*(r+1)+1],++t<h&&n===_||(t<l?e.bl_tree[2*n]+=t:n!==0?(n!==i&&e.bl_tree[2*n]++,e.bl_tree[32]++):t<=10?e.bl_tree[34]++:e.bl_tree[36]++,t=0,i=n,_===0?(h=138,l=3):n===_?(h=6,l=3):(h=7,l=4))},Ce=(e,s,a)=>{let r,n,i=-1,_=s[1],t=0,h=7,l=4;for(_===0&&(h=138,l=3),r=0;r<=a;r++)if(n=_,_=s[2*(r+1)+1],!(++t<h&&n===_)){if(t<l)do k(e,n,e.bl_tree);while(--t!=0);else n!==0?(n!==i&&(k(e,n,e.bl_tree),t--),k(e,16,e.bl_tree),p(e,t-3,2)):t<=10?(k(e,17,e.bl_tree),p(e,t-3,3)):(k(e,18,e.bl_tree),p(e,t-11,7));t=0,i=n,_===0?(h=138,l=3):n===_?(h=6,l=3):(h=7,l=4)}};let Be=!1;const He=(e,s,a,r)=>{p(e,0+(r?1:0),3),Oe(e),Y(e,a),Y(e,~a),a&&e.pending_buf.set(e.window.subarray(s,s+a),e.pending),e.pending+=a};var ia=(e,s,a,r)=>{let n,i,_=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=(t=>{let h,l=4093624447;for(h=0;h<=31;h++,l>>>=1)if(1&l&&t.dyn_ltree[2*h]!==0)return 0;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return 1;for(h=32;h<oe;h++)if(t.dyn_ltree[2*h]!==0)return 1;return 0})(e)),ge(e,e.l_desc),ge(e,e.d_desc),_=(t=>{let h;for(Ie(t,t.dyn_ltree,t.l_desc.max_code),Ie(t,t.dyn_dtree,t.d_desc.max_code),ge(t,t.bl_desc),h=18;h>=3&&t.bl_tree[2*Ee[h]+1]===0;h--);return t.opt_len+=3*(h+1)+5+5+4,h})(e),n=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=n&&(n=i)):n=i=a+5,a+4<=n&&s!==-1?He(e,s,a,r):e.strategy===4||i===n?(p(e,2+(r?1:0),3),Ne(e,Z,P)):(p(e,4+(r?1:0),3),((t,h,l,u)=>{let d;for(p(t,h-257,5),p(t,l-1,5),p(t,u-4,4),d=0;d<u;d++)p(t,t.bl_tree[2*Ee[d]+1],3);Ce(t,t.dyn_ltree,h-1),Ce(t,t.dyn_dtree,l-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,_+1),Ne(e,e.dyn_ltree,e.dyn_dtree)),Fe(e),r&&Oe(e)},ta={_tr_init:e=>{Be||((()=>{let s,a,r,n,i;const _=new Array(16);for(r=0,n=0;n<28;n++)for(ue[n]=r,s=0;s<1<<de[n];s++)K[r++]=n;for(K[r-1]=n,i=0,n=0;n<16;n++)for(se[n]=i,s=0;s<1<<ae[n];s++)j[i++]=n;for(i>>=7;n<H;n++)for(se[n]=i<<7,s=0;s<1<<ae[n]-7;s++)j[256+i++]=n;for(a=0;a<=M;a++)_[a]=0;for(s=0;s<=143;)Z[2*s+1]=8,s++,_[8]++;for(;s<=255;)Z[2*s+1]=9,s++,_[9]++;for(;s<=279;)Z[2*s+1]=7,s++,_[7]++;for(;s<=287;)Z[2*s+1]=8,s++,_[8]++;for(Le(Z,287,_),s=0;s<H;s++)P[2*s+1]=5,P[2*s]=Te(s,5);Ze=new fe(Z,de,257,Ae,M),Ue=new fe(P,ae,0,H,M),Re=new fe(new Array(0),ra,0,19,7)})(),Be=!0),e.l_desc=new ce(e.dyn_ltree,Ze),e.d_desc=new ce(e.dyn_dtree,Ue),e.bl_desc=new ce(e.bl_tree,Re),e.bi_buf=0,e.bi_valid=0,Fe(e)},_tr_stored_block:He,_tr_flush_block:ia,_tr_tally:(e,s,a)=>(e.pending_buf[e.sym_buf+e.sym_next++]=s,e.pending_buf[e.sym_buf+e.sym_next++]=s>>8,e.pending_buf[e.sym_buf+e.sym_next++]=a,s===0?e.dyn_ltree[2*a]++:(e.matches++,s--,e.dyn_ltree[2*(K[a]+oe+1)]++,e.dyn_dtree[2*Se(s)]++),e.sym_next===e.sym_end),_tr_align:e=>{p(e,2,3),k(e,256,Z),(s=>{s.bi_valid===16?(Y(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)})(e)}},Me=(e,s,a,r)=>{let n=65535&e|0,i=e>>>16&65535|0,_=0;for(;a!==0;){_=a>2e3?2e3:a,a-=_;do n=n+s[r++]|0,i=i+n|0;while(--_);n%=65521,i%=65521}return n|i<<16|0};const _a=new Uint32Array((()=>{let e,s=[];for(var a=0;a<256;a++){e=a;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;s[a]=e}return s})());var U=(e,s,a,r)=>{const n=_a,i=r+a;e^=-1;for(let _=r;_<i;_++)e=e>>>8^n[255&(e^s[_])];return-1^e},ne={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},we={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:la,_tr_stored_block:me,_tr_flush_block:ha,_tr_tally:R,_tr_align:oa}=ta,{Z_NO_FLUSH:S,Z_PARTIAL_FLUSH:da,Z_FULL_FLUSH:ua,Z_FINISH:b,Z_BLOCK:Pe,Z_OK:c,Z_STREAM_END:je,Z_STREAM_ERROR:x,Z_DATA_ERROR:fa,Z_BUF_ERROR:be,Z_DEFAULT_COMPRESSION:ca,Z_FILTERED:pa,Z_HUFFMAN_ONLY:re,Z_RLE:ga,Z_FIXED:wa,Z_DEFAULT_STRATEGY:ma,Z_UNKNOWN:ba,Z_DEFLATED:ie}=we,F=258,A=262,N=42,O=113,G=666,D=(e,s)=>(e.msg=ne[s],s),Ke=e=>2*e-(e>4?9:0),T=e=>{let s=e.length;for(;--s>=0;)e[s]=0},ya=e=>{let s,a,r,n=e.w_size;s=e.hash_size,r=s;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--s);s=n,r=s;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--s)};let L=(e,s,a)=>(s<<e.hash_shift^a)&e.hash_mask;const g=e=>{const s=e.state;let a=s.pending;a>e.avail_out&&(a=e.avail_out),a!==0&&(e.output.set(s.pending_buf.subarray(s.pending_out,s.pending_out+a),e.next_out),e.next_out+=a,s.pending_out+=a,e.total_out+=a,e.avail_out-=a,s.pending-=a,s.pending===0&&(s.pending_out=0))},w=(e,s)=>{ha(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,s),e.block_start=e.strstart,g(e.strm)},o=(e,s)=>{e.pending_buf[e.pending++]=s},X=(e,s)=>{e.pending_buf[e.pending++]=s>>>8&255,e.pending_buf[e.pending++]=255&s},ye=(e,s,a,r)=>{let n=e.avail_in;return n>r&&(n=r),n===0?0:(e.avail_in-=n,s.set(e.input.subarray(e.next_in,e.next_in+n),a),e.state.wrap===1?e.adler=Me(e.adler,s,n,a):e.state.wrap===2&&(e.adler=U(e.adler,s,n,a)),e.next_in+=n,e.total_in+=n,n)},Ye=(e,s)=>{let a,r,n=e.max_chain_length,i=e.strstart,_=e.prev_length,t=e.nice_match;const h=e.strstart>e.w_size-A?e.strstart-(e.w_size-A):0,l=e.window,u=e.w_mask,d=e.prev,m=e.strstart+F;let V=l[i+_-1],_e=l[i+_];e.prev_length>=e.good_match&&(n>>=2),t>e.lookahead&&(t=e.lookahead);do if(a=s,l[a+_]===_e&&l[a+_-1]===V&&l[a]===l[i]&&l[++a]===l[i+1]){i+=2,a++;do;while(l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&l[++i]===l[++a]&&i<m);if(r=F-(m-i),i=m-F,r>_){if(e.match_start=s,_=r,r>=t)break;V=l[i+_-1],_e=l[i+_]}}while((s=d[s&u])>h&&--n!=0);return _<=e.lookahead?_:e.lookahead},I=e=>{const s=e.w_size;let a,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-A)&&(e.window.set(e.window.subarray(s,s+s-r),0),e.match_start-=s,e.strstart-=s,e.block_start-=s,e.insert>e.strstart&&(e.insert=e.strstart),ya(e),r+=s),e.strm.avail_in===0)break;if(a=ye(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=a,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=L(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=L(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<A&&e.strm.avail_in!==0)},Ge=(e,s)=>{let a,r,n,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,_=0,t=e.strm.avail_in;do{if(a=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n||(n=e.strm.avail_out-n,r=e.strstart-e.block_start,a>r+e.strm.avail_in&&(a=r+e.strm.avail_in),a>n&&(a=n),a<i&&(a===0&&s!==b||s===S||a!==r+e.strm.avail_in)))break;_=s===b&&a===r+e.strm.avail_in?1:0,me(e,0,0,_),e.pending_buf[e.pending-4]=a,e.pending_buf[e.pending-3]=a>>8,e.pending_buf[e.pending-2]=~a,e.pending_buf[e.pending-1]=~a>>8,g(e.strm),r&&(r>a&&(r=a),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,a-=r),a&&(ye(e.strm,e.strm.output,e.strm.next_out,a),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a)}while(_===0);return t-=e.strm.avail_in,t&&(t>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=t&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-t,e.strm.next_in),e.strstart),e.strstart+=t,e.insert+=t>e.w_size-e.insert?e.w_size-e.insert:t),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),_?4:s!==S&&s!==b&&e.strm.avail_in===0&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(ye(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,i=n>e.w_size?e.w_size:n,r=e.strstart-e.block_start,(r>=i||(r||s===b)&&s!==S&&e.strm.avail_in===0&&r<=n)&&(a=r>n?n:r,_=s===b&&e.strm.avail_in===0&&a===r?1:0,me(e,e.block_start,a,_),e.block_start+=a,g(e.strm)),_?3:1)},ve=(e,s)=>{let a,r;for(;;){if(e.lookahead<A){if(I(e),e.lookahead<A&&s===S)return 1;if(e.lookahead===0)break}if(a=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),a!==0&&e.strstart-a<=e.w_size-A&&(e.match_length=Ye(e,a)),e.match_length>=3)if(r=R(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=L(e,e.ins_h,e.window[e.strstart+1]);else r=R(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(w(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,s===b?(w(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(w(e,!1),e.strm.avail_out===0)?1:2},C=(e,s)=>{let a,r,n;for(;;){if(e.lookahead<A){if(I(e),e.lookahead<A&&s===S)return 1;if(e.lookahead===0)break}if(a=0,e.lookahead>=3&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,a!==0&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-A&&(e.match_length=Ye(e,a),e.match_length<=5&&(e.strategy===pa||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=R(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=L(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(w(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if(r=R(e,0,e.window[e.strstart-1]),r&&w(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=R(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,s===b?(w(e,!0),e.strm.avail_out===0?3:4):e.sym_next&&(w(e,!1),e.strm.avail_out===0)?1:2};function E(e,s,a,r,n){this.good_length=e,this.max_lazy=s,this.nice_length=a,this.max_chain=r,this.func=n}const W=[new E(0,0,0,0,Ge),new E(4,4,8,4,ve),new E(4,5,16,8,ve),new E(4,6,32,32,ve),new E(4,4,16,16,C),new E(8,16,32,32,C),new E(8,16,128,128,C),new E(8,32,128,256,C),new E(32,128,258,1024,C),new E(32,258,258,4096,C)];function va(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ie,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),T(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const q=e=>{if(!e)return 1;const s=e.state;return!s||s.strm!==e||s.status!==N&&s.status!==57&&s.status!==69&&s.status!==73&&s.status!==91&&s.status!==103&&s.status!==O&&s.status!==G?1:0},Xe=e=>{if(q(e))return D(e,x);e.total_in=e.total_out=0,e.data_type=ba;const s=e.state;return s.pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap===2?57:s.wrap?N:O,e.adler=s.wrap===2?0:1,s.last_flush=-2,la(s),c},We=e=>{const s=Xe(e);var a;return s===c&&((a=e.state).window_size=2*a.w_size,T(a.head),a.max_lazy_match=W[a.level].max_lazy,a.good_match=W[a.level].good_length,a.nice_match=W[a.level].nice_length,a.max_chain_length=W[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),s},qe=(e,s,a,r,n,i)=>{if(!e)return x;let _=1;if(s===ca&&(s=6),r<0?(_=0,r=-r):r>15&&(_=2,r-=16),n<1||n>9||a!==ie||r<8||r>15||s<0||s>9||i<0||i>wa||r===8&&_!==1)return D(e,x);r===8&&(r=9);const t=new va;return e.state=t,t.strm=e,t.status=N,t.wrap=_,t.gzhead=null,t.w_bits=r,t.w_size=1<<t.w_bits,t.w_mask=t.w_size-1,t.hash_bits=n+7,t.hash_size=1<<t.hash_bits,t.hash_mask=t.hash_size-1,t.hash_shift=~~((t.hash_bits+3-1)/3),t.window=new Uint8Array(2*t.w_size),t.head=new Uint16Array(t.hash_size),t.prev=new Uint16Array(t.w_size),t.lit_bufsize=1<<n+6,t.pending_buf_size=4*t.lit_bufsize,t.pending_buf=new Uint8Array(t.pending_buf_size),t.sym_buf=t.lit_bufsize,t.sym_end=3*(t.lit_bufsize-1),t.level=s,t.strategy=i,t.method=a,We(e)};var J={deflateInit:(e,s)=>qe(e,s,ie,15,8,ma),deflateInit2:qe,deflateReset:We,deflateResetKeep:Xe,deflateSetHeader:(e,s)=>q(e)||e.state.wrap!==2?x:(e.state.gzhead=s,c),deflate:(e,s)=>{if(q(e)||s>Pe||s<0)return e?D(e,x):x;const a=e.state;if(!e.output||e.avail_in!==0&&!e.input||a.status===G&&s!==b)return D(e,e.avail_out===0?be:x);const r=a.last_flush;if(a.last_flush=s,a.pending!==0){if(g(e),e.avail_out===0)return a.last_flush=-1,c}else if(e.avail_in===0&&Ke(s)<=Ke(r)&&s!==b)return D(e,be);if(a.status===G&&e.avail_in!==0)return D(e,be);if(a.status===N&&a.wrap===0&&(a.status=O),a.status===N){let n=ie+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=re||a.level<2?0:a.level<6?1:a.level===6?2:3,n|=i<<6,a.strstart!==0&&(n|=32),n+=31-n%31,X(a,n),a.strstart!==0&&(X(a,e.adler>>>16),X(a,65535&e.adler)),e.adler=1,a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(a.status===57){if(e.adler=0,o(a,31),o(a,139),o(a,8),a.gzhead)o(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),o(a,255&a.gzhead.time),o(a,a.gzhead.time>>8&255),o(a,a.gzhead.time>>16&255),o(a,a.gzhead.time>>24&255),o(a,a.level===9?2:a.strategy>=re||a.level<2?4:0),o(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(o(a,255&a.gzhead.extra.length),o(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=U(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(o(a,0),o(a,0),o(a,0),o(a,0),o(a,0),o(a,a.level===9?2:a.strategy>=re||a.level<2?4:0),o(a,3),a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(a.status===69){if(a.gzhead.extra){let n=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let t=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+t),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>n&&(e.adler=U(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex+=t,g(e),a.pending!==0)return a.last_flush=-1,c;n=0,i-=t}let _=new Uint8Array(a.gzhead.extra);a.pending_buf.set(_.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>n&&(e.adler=U(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex=0}a.status=73}if(a.status===73){if(a.gzhead.name){let n,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),g(e),a.pending!==0)return a.last_flush=-1,c;i=0}n=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,o(a,n)}while(n!==0);a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(a.status===91){if(a.gzhead.comment){let n,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i)),g(e),a.pending!==0)return a.last_flush=-1,c;i=0}n=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,o(a,n)}while(n!==0);a.gzhead.hcrc&&a.pending>i&&(e.adler=U(e.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(a.status===103){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(g(e),a.pending!==0))return a.last_flush=-1,c;o(a,255&e.adler),o(a,e.adler>>8&255),e.adler=0}if(a.status=O,g(e),a.pending!==0)return a.last_flush=-1,c}if(e.avail_in!==0||a.lookahead!==0||s!==S&&a.status!==G){let n=a.level===0?Ge(a,s):a.strategy===re?((i,_)=>{let t;for(;;){if(i.lookahead===0&&(I(i),i.lookahead===0)){if(_===S)return 1;break}if(i.match_length=0,t=R(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(w(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,_===b?(w(i,!0),i.strm.avail_out===0?3:4):i.sym_next&&(w(i,!1),i.strm.avail_out===0)?1:2})(a,s):a.strategy===ga?((i,_)=>{let t,h,l,u;const d=i.window;for(;;){if(i.lookahead<=F){if(I(i),i.lookahead<=F&&_===S)return 1;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=3&&i.strstart>0&&(l=i.strstart-1,h=d[l],h===d[++l]&&h===d[++l]&&h===d[++l])){u=i.strstart+F;do;while(h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&h===d[++l]&&l<u);i.match_length=F-(u-l),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=3?(t=R(i,1,i.match_length-3),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=R(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(w(i,!1),i.strm.avail_out===0))return 1}return i.insert=0,_===b?(w(i,!0),i.strm.avail_out===0?3:4):i.sym_next&&(w(i,!1),i.strm.avail_out===0)?1:2})(a,s):W[a.level].func(a,s);if(n!==3&&n!==4||(a.status=G),n===1||n===3)return e.avail_out===0&&(a.last_flush=-1),c;if(n===2&&(s===da?oa(a):s!==Pe&&(me(a,0,0,!1),s===ua&&(T(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),g(e),e.avail_out===0))return a.last_flush=-1,c}return s!==b?c:a.wrap<=0?je:(a.wrap===2?(o(a,255&e.adler),o(a,e.adler>>8&255),o(a,e.adler>>16&255),o(a,e.adler>>24&255),o(a,255&e.total_in),o(a,e.total_in>>8&255),o(a,e.total_in>>16&255),o(a,e.total_in>>24&255)):(X(a,e.adler>>>16),X(a,65535&e.adler)),g(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?c:je)},deflateEnd:e=>{if(q(e))return x;const s=e.state.status;return e.state=null,s===O?D(e,fa):c},deflateSetDictionary:(e,s)=>{let a=s.length;if(q(e))return x;const r=e.state,n=r.wrap;if(n===2||n===1&&r.status!==N||r.lookahead)return x;if(n===1&&(e.adler=Me(e.adler,s,a,0)),r.wrap=0,a>=r.w_size){n===0&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0);let h=new Uint8Array(r.w_size);h.set(s.subarray(a-r.w_size,a),0),s=h,a=r.w_size}const i=e.avail_in,_=e.next_in,t=e.input;for(e.avail_in=a,e.next_in=0,e.input=s,I(r);r.lookahead>=3;){let h=r.strstart,l=r.lookahead-2;do r.ins_h=L(r,r.ins_h,r.window[h+3-1]),r.prev[h&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=h,h++;while(--l);r.strstart=h,r.lookahead=2,I(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=_,e.input=t,e.avail_in=i,r.wrap=n,c},deflateInfo:"pako deflate (from Nodeca project)"};const za=(e,s)=>Object.prototype.hasOwnProperty.call(e,s);var ka=function(e){const s=Array.prototype.slice.call(arguments,1);for(;s.length;){const a=s.shift();if(a){if(typeof a!="object")throw new TypeError(a+"must be non-object");for(const r in a)za(a,r)&&(e[r]=a[r])}}return e},xa=e=>{let s=0;for(let r=0,n=e.length;r<n;r++)s+=e[r].length;const a=new Uint8Array(s);for(let r=0,n=0,i=e.length;r<i;r++){let _=e[r];a.set(_,n),n+=_.length}return a};let Aa=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Aa=!1}const ze=new Uint8Array(256);for(let e=0;e<256;e++)ze[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ze[254]=ze[254]=1;var Je=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let s,a,r,n,i,_=e.length,t=0;for(n=0;n<_;n++)a=e.charCodeAt(n),(64512&a)==55296&&n+1<_&&(r=e.charCodeAt(n+1),(64512&r)==56320&&(a=65536+(a-55296<<10)+(r-56320),n++)),t+=a<128?1:a<2048?2:a<65536?3:4;for(s=new Uint8Array(t),i=0,n=0;i<t;n++)a=e.charCodeAt(n),(64512&a)==55296&&n+1<_&&(r=e.charCodeAt(n+1),(64512&r)==56320&&(a=65536+(a-55296<<10)+(r-56320),n++)),a<128?s[i++]=a:a<2048?(s[i++]=192|a>>>6,s[i++]=128|63&a):a<65536?(s[i++]=224|a>>>12,s[i++]=128|a>>>6&63,s[i++]=128|63&a):(s[i++]=240|a>>>18,s[i++]=128|a>>>12&63,s[i++]=128|a>>>6&63,s[i++]=128|63&a);return s},Ea=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Qe=Object.prototype.toString,{Z_NO_FLUSH:Za,Z_SYNC_FLUSH:Ua,Z_FULL_FLUSH:Ra,Z_FINISH:Sa,Z_OK:te,Z_STREAM_END:Ta,Z_DEFAULT_COMPRESSION:La,Z_DEFAULT_STRATEGY:Fa,Z_DEFLATED:Oa}=we;function Q(e){this.options=ka({level:La,method:Oa,chunkSize:16384,windowBits:15,memLevel:8,strategy:Fa},e||{});let s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ea,this.strm.avail_out=0;let a=J.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(a!==te)throw new Error(ne[a]);if(s.header&&J.deflateSetHeader(this.strm,s.header),s.dictionary){let r;if(r=typeof s.dictionary=="string"?Je(s.dictionary):Qe.call(s.dictionary)==="[object ArrayBuffer]"?new Uint8Array(s.dictionary):s.dictionary,a=J.deflateSetDictionary(this.strm,r),a!==te)throw new Error(ne[a]);this._dict_set=!0}}function ke(e,s){const a=new Q(s);if(a.push(e,!0),a.err)throw a.msg||ne[a.err];return a.result}Q.prototype.push=function(e,s){const a=this.strm,r=this.options.chunkSize;let n,i;if(this.ended)return!1;for(i=s===~~s?s:s===!0?Sa:Za,typeof e=="string"?a.input=Je(e):Qe.call(e)==="[object ArrayBuffer]"?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;)if(a.avail_out===0&&(a.output=new Uint8Array(r),a.next_out=0,a.avail_out=r),(i===Ua||i===Ra)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=J.deflate(a,i),n===Ta)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=J.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===te;if(a.avail_out!==0){if(i>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(a.avail_in===0)break}else this.onData(a.output)}return!0},Q.prototype.onData=function(e){this.chunks.push(e)},Q.prototype.onEnd=function(e){e===te&&(this.result=xa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ve=Q,$e=ke,ea=function(e,s){return(s=s||{}).raw=!0,ke(e,s)},aa=function(e,s){return(s=s||{}).gzip=!0,ke(e,s)},sa=we,Da={Deflate:Ve,deflate:$e,deflateRaw:ea,gzip:aa,constants:sa};v.Deflate=Ve,v.constants=sa,v.default=Da,v.deflate=$e,v.deflateRaw=ea,v.gzip=aa,Object.defineProperty(v,"__esModule",{value:!0})})); diff --git a/plugins/feature/map/Cesium/ThirdParty/Workers/pako_inflate.min.js b/plugins/feature/map/Cesium/ThirdParty/Workers/pako_inflate.min.js index 420318f13..3ad915cf2 100644 --- a/plugins/feature/map/Cesium/ThirdParty/Workers/pako_inflate.min.js +++ b/plugins/feature/map/Cesium/ThirdParty/Workers/pako_inflate.min.js @@ -1 +1 @@ -/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(O,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):I((O=typeof globalThis<"u"?globalThis:O||self).pako={})})(this,function(O){"use strict";var I=(e,i,t,o)=>{let s=65535&e|0,r=e>>>16&65535|0,h=0;for(;t!==0;){h=t>2e3?2e3:t,t-=h;do s=s+i[o++]|0,r=r+s|0;while(--h);s%=65521,r%=65521}return s|r<<16|0};const Zt=new Uint32Array((()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}return i})());var U=(e,i,t,o)=>{const s=Zt,r=o+t;e^=-1;for(let h=o;h<r;h++)e=e>>>8^s[255&(e^i[h])];return-1^e};const j=16209;var St=function(e,i){let t,o,s,r,h,l,p,n,a,A,w,d,Z,v,u,y,k,f,g,E,c,x,m,b;const _=e.state;t=e.next_in,m=e.input,o=t+(e.avail_in-5),s=e.next_out,b=e.output,r=s-(i-e.avail_out),h=s+(e.avail_out-257),l=_.dmax,p=_.wsize,n=_.whave,a=_.wnext,A=_.window,w=_.hold,d=_.bits,Z=_.lencode,v=_.distcode,u=(1<<_.lenbits)-1,y=(1<<_.distbits)-1;t:do{d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=Z[w&u];e:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,f===0)b[s++]=65535&k;else{if(!(16&f)){if(!(64&f)){k=Z[(65535&k)+(w&(1<<f)-1)];continue e}if(32&f){_.mode=16191;break t}e.msg="invalid literal/length code",_.mode=j;break t}g=65535&k,f&=15,f&&(d<f&&(w+=m[t++]<<d,d+=8),g+=w&(1<<f)-1,w>>>=f,d-=f),d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=v[w&y];i:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,!(16&f)){if(!(64&f)){k=v[(65535&k)+(w&(1<<f)-1)];continue i}e.msg="invalid distance code",_.mode=j;break t}if(E=65535&k,f&=15,d<f&&(w+=m[t++]<<d,d+=8,d<f&&(w+=m[t++]<<d,d+=8)),E+=w&(1<<f)-1,E>l){e.msg="invalid distance too far back",_.mode=j;break t}if(w>>>=f,d-=f,f=s-r,E>f){if(f=E-f,f>n&&_.sane){e.msg="invalid distance too far back",_.mode=j;break t}if(c=0,x=A,a===0){if(c+=p-f,f<g){g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}}else if(a<f){if(c+=p+a-f,f-=a,f<g){g-=f;do b[s++]=A[c++];while(--f);if(c=0,a<g){f=a,g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}}}else if(c+=a-f,f<g){g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}for(;g>2;)b[s++]=x[c++],b[s++]=x[c++],b[s++]=x[c++],g-=3;g&&(b[s++]=x[c++],g>1&&(b[s++]=x[c++]))}else{c=s-E;do b[s++]=b[c++],b[s++]=b[c++],b[s++]=b[c++],g-=3;while(g>2);g&&(b[s++]=b[c++],g>1&&(b[s++]=b[c++]))}break}}break}}while(t<o&&s<h);g=d>>3,t-=g,d-=g<<3,w&=(1<<d)-1,e.next_in=t,e.next_out=s,e.avail_in=t<o?o-t+5:5-(t-o),e.avail_out=s<h?h-s+257:257-(s-h),_.hold=w,_.bits=d};const K=15,Tt=new Uint16Array([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]),Ot=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Ut=new Uint16Array([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,0,0]),Dt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var z=(e,i,t,o,s,r,h,l)=>{const p=l.bits;let n,a,A,w,d,Z,v=0,u=0,y=0,k=0,f=0,g=0,E=0,c=0,x=0,m=0,b=null;const _=new Uint16Array(16),S=new Uint16Array(16);let H,q,J,Q=null;for(v=0;v<=K;v++)_[v]=0;for(u=0;u<o;u++)_[i[t+u]]++;for(f=p,k=K;k>=1&&_[k]===0;k--);if(f>k&&(f=k),k===0)return s[r++]=20971520,s[r++]=20971520,l.bits=1,0;for(y=1;y<k&&_[y]===0;y++);for(f<y&&(f=y),c=1,v=1;v<=K;v++)if(c<<=1,c-=_[v],c<0)return-1;if(c>0&&(e===0||k!==1))return-1;for(S[1]=0,v=1;v<K;v++)S[v+1]=S[v]+_[v];for(u=0;u<o;u++)i[t+u]!==0&&(h[S[i[t+u]]++]=u);if(e===0?(b=Q=h,Z=20):e===1?(b=Tt,Q=Ot,Z=257):(b=Ut,Q=Dt,Z=0),m=0,u=0,v=y,d=r,g=f,E=0,A=-1,x=1<<f,w=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){H=v-E,h[u]+1<Z?(q=0,J=h[u]):h[u]>=Z?(q=Q[h[u]-Z],J=b[h[u]-Z]):(q=96,J=0),n=1<<v-E,a=1<<g,y=a;do a-=n,s[d+(m>>E)+a]=H<<24|q<<16|J|0;while(a!==0);for(n=1<<v-1;m&n;)n>>=1;if(n!==0?(m&=n-1,m+=n):m=0,u++,--_[v]==0){if(v===k)break;v=i[t+h[u]]}if(v>f&&(m&w)!==A){for(E===0&&(E=f),d+=y,g=v-E,c=1<<g;g+E<k&&(c-=_[g+E],!(c<=0));)g++,c<<=1;if(x+=1<<g,e===1&&x>852||e===2&&x>592)return 1;A=m&w,s[A]=f<<24|g<<16|d-r|0}}return m!==0&&(s[d+m]=v-E<<24|64<<16|0),l.bits=f,0},V={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:lt,Z_BLOCK:Bt,Z_TREES:P,Z_OK:C,Z_STREAM_END:It,Z_NEED_DICT:Ct,Z_STREAM_ERROR:T,Z_DATA_ERROR:dt,Z_MEM_ERROR:ft,Z_BUF_ERROR:Nt,Z_DEFLATED:ht}=V,Y=16180,G=16190,D=16191,$=16192,tt=16194,X=16199,W=16200,et=16206,R=16209,ct=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function zt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const N=e=>{if(!e)return 1;const i=e.state;return!i||i.strm!==e||i.mode<Y||i.mode>16211?1:0},ut=e=>{if(N(e))return T;const i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=1&i.wrap),i.mode=Y,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(852),i.distcode=i.distdyn=new Int32Array(592),i.sane=1,i.back=-1,C},wt=e=>{if(N(e))return T;const i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,ut(e)},bt=(e,i)=>{let t;if(N(e))return T;const o=e.state;return i<0?(t=0,i=-i):(t=5+(i>>4),i<48&&(i&=15)),i&&(i<8||i>15)?T:(o.window!==null&&o.wbits!==i&&(o.window=null),o.wrap=t,o.wbits=i,wt(e))},mt=(e,i)=>{if(!e)return T;const t=new zt;e.state=t,t.strm=e,t.window=null,t.mode=Y;const o=bt(e,i);return o!==C&&(e.state=null),o};let it,nt,kt=!0;const Ft=e=>{if(kt){it=new Int32Array(512),nt=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(z(1,e.lens,0,288,it,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;z(2,e.lens,0,32,nt,0,e.work,{bits:5}),kt=!1}e.lencode=it,e.lenbits=9,e.distcode=nt,e.distbits=5},_t=(e,i,t,o)=>{let s;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),o>=r.wsize?(r.window.set(i.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>o&&(s=o),r.window.set(i.subarray(t-o,t-o+s),r.wnext),(o-=s)?(r.window.set(i.subarray(t-o,t),0),r.wnext=o,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=s))),0};var B={inflateReset:wt,inflateReset2:bt,inflateResetKeep:ut,inflateInit:e=>mt(e,15),inflateInit2:mt,inflate:(e,i)=>{let t,o,s,r,h,l,p,n,a,A,w,d,Z,v,u,y,k,f,g,E,c,x,m=0;const b=new Uint8Array(4);let _,S;const H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(N(e)||!e.output||!e.input&&e.avail_in!==0)return T;t=e.state,t.mode===D&&(t.mode=$),h=e.next_out,s=e.output,p=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,A=l,w=p,x=C;t:for(;;)switch(t.mode){case Y:if(t.wrap===0){t.mode=$;break}for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(2&t.wrap&&n===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0),n=0,a=0,t.mode=16181;break}if(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&n)<<8)+(n>>8))%31){e.msg="incorrect header check",t.mode=R;break}if((15&n)!==ht){e.msg="unknown compression method",t.mode=R;break}if(n>>>=4,a-=4,c=8+(15&n),t.wbits===0&&(t.wbits=c),c>15||c>t.wbits){e.msg="invalid window size",t.mode=R;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&n?16189:D,n=0,a=0;break;case 16181:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.flags=n,(255&t.flags)!==ht){e.msg="unknown compression method",t.mode=R;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=R;break}t.head&&(t.head.text=n>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=16182;case 16182:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.time=n),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,b[2]=n>>>16&255,b[3]=n>>>24&255,t.check=U(t.check,b,4,0)),n=0,a=0,t.mode=16183;case 16183:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.xflags=255&n,t.head.os=n>>8),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=16184;case 16184:if(1024&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length=n,t.head&&(t.head.extra_len=n),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&(d=t.length,d>l&&(d=l),d&&(t.head&&(c=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(o.subarray(r,r+d),c)),512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,t.length-=d),t.length))break t;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.name+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.comment+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(4&t.wrap&&n!==(65535&t.check)){e.msg="header crc mismatch",t.mode=R;break}n=0,a=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=D;break;case 16189:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}e.adler=t.check=ct(n),n=0,a=0,t.mode=G;case G:if(t.havedict===0)return e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,Ct;e.adler=t.check=1,t.mode=D;case D:if(i===Bt||i===P)break t;case $:if(t.last){n>>>=7&a,a-=7&a,t.mode=et;break}for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}switch(t.last=1&n,n>>>=1,a-=1,3&n){case 0:t.mode=16193;break;case 1:if(Ft(t),t.mode=X,i===P){n>>>=2,a-=2;break t}break;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=R}n>>>=2,a-=2;break;case 16193:for(n>>>=7&a,a-=7&a;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if((65535&n)!=(n>>>16^65535)){e.msg="invalid stored block lengths",t.mode=R;break}if(t.length=65535&n,n=0,a=0,t.mode=tt,i===P)break t;case tt:t.mode=16195;case 16195:if(d=t.length,d){if(d>l&&(d=l),d>p&&(d=p),d===0)break t;s.set(o.subarray(r,r+d),h),l-=d,r+=d,p-=d,h+=d,t.length-=d;break}t.mode=D;break;case 16196:for(;a<14;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.nlen=257+(31&n),n>>>=5,a-=5,t.ndist=1+(31&n),n>>>=5,a-=5,t.ncode=4+(15&n),n>>>=4,a-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=R;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.lens[H[t.have++]]=7&n,n>>>=3,a-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,_={bits:t.lenbits},x=z(0,t.lens,0,19,t.lencode,0,t.work,_),t.lenbits=_.bits,x){e.msg="invalid code lengths set",t.mode=R;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(k<16)n>>>=u,a-=u,t.lens[t.have++]=k;else{if(k===16){for(S=u+2;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(n>>>=u,a-=u,t.have===0){e.msg="invalid bit length repeat",t.mode=R;break}c=t.lens[t.have-1],d=3+(3&n),n>>>=2,a-=2}else if(k===17){for(S=u+3;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=3+(7&n),n>>>=3,a-=3}else{for(S=u+7;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=11+(127&n),n>>>=7,a-=7}if(t.have+d>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=R;break}for(;d--;)t.lens[t.have++]=c}}if(t.mode===R)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=R;break}if(t.lenbits=9,_={bits:t.lenbits},x=z(1,t.lens,0,t.nlen,t.lencode,0,t.work,_),t.lenbits=_.bits,x){e.msg="invalid literal/lengths set",t.mode=R;break}if(t.distbits=6,t.distcode=t.distdyn,_={bits:t.distbits},x=z(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,_),t.distbits=_.bits,x){e.msg="invalid distances set",t.mode=R;break}if(t.mode=X,i===P)break t;case X:t.mode=W;case W:if(l>=6&&p>=258){e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,St(e,w),h=e.next_out,s=e.output,p=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,t.mode===D&&(t.back=-1);break}for(t.back=0;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(y&&!(240&y)){for(f=u,g=y,E=k;m=t.lencode[E+((n&(1<<f+g)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,t.length=k,y===0){t.mode=16205;break}if(32&y){t.back=-1,t.mode=D;break}if(64&y){e.msg="invalid literal/length code",t.mode=R;break}t.extra=15&y,t.mode=16201;case 16201:if(t.extra){for(S=t.extra;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;m=t.distcode[n&(1<<t.distbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(!(240&y)){for(f=u,g=y,E=k;m=t.distcode[E+((n&(1<<f+g)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,64&y){e.msg="invalid distance code",t.mode=R;break}t.offset=k,t.extra=15&y,t.mode=16203;case 16203:if(t.extra){for(S=t.extra;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.offset+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=R;break}t.mode=16204;case 16204:if(p===0)break t;if(d=w-p,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=R;break}d>t.wnext?(d-=t.wnext,Z=t.wsize-d):Z=t.wnext-d,d>t.length&&(d=t.length),v=t.window}else v=s,Z=h-t.offset,d=t.length;d>p&&(d=p),p-=d,t.length-=d;do s[h++]=v[Z++];while(--d);t.length===0&&(t.mode=W);break;case 16205:if(p===0)break t;s[h++]=t.length,p--,t.mode=W;break;case et:if(t.wrap){for(;a<32;){if(l===0)break t;l--,n|=o[r++]<<a,a+=8}if(w-=p,e.total_out+=w,t.total+=w,4&t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,h-w):I(t.check,s,w,h-w)),w=p,4&t.wrap&&(t.flags?n:ct(n))!==t.check){e.msg="incorrect data check",t.mode=R;break}n=0,a=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(4&t.wrap&&n!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=R;break}n=0,a=0}t.mode=16208;case 16208:x=It;break t;case R:x=dt;break t;case 16210:return ft;default:return T}return e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,(t.wsize||w!==e.avail_out&&t.mode<R&&(t.mode<et||i!==lt))&&_t(e,e.output,e.next_out,w-e.avail_out),A-=e.avail_in,w-=e.avail_out,e.total_in+=A,e.total_out+=w,t.total+=w,4&t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,e.next_out-w):I(t.check,s,w,e.next_out-w)),e.data_type=t.bits+(t.last?64:0)+(t.mode===D?128:0)+(t.mode===X||t.mode===tt?256:0),(A===0&&w===0||i===lt)&&x===C&&(x=Nt),x},inflateEnd:e=>{if(N(e))return T;let i=e.state;return i.window&&(i.window=null),e.state=null,C},inflateGetHeader:(e,i)=>{if(N(e))return T;const t=e.state;return 2&t.wrap?(t.head=i,i.done=!1,C):T},inflateSetDictionary:(e,i)=>{const t=i.length;let o,s,r;return N(e)?T:(o=e.state,o.wrap!==0&&o.mode!==G?T:o.mode===G&&(s=1,s=I(s,i,t,0),s!==o.check)?dt:(r=_t(e,i,t,t),r?(o.mode=16210,ft):(o.havedict=1,C)))},inflateInfo:"pako inflate (from Nodeca project)"};const Lt=(e,i)=>Object.prototype.hasOwnProperty.call(e,i);var Mt=function(e){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const o in t)Lt(t,o)&&(e[o]=t[o])}}return e},Ht=e=>{let i=0;for(let o=0,s=e.length;o<s;o++)i+=e[o].length;const t=new Uint8Array(i);for(let o=0,s=0,r=e.length;o<r;o++){let h=e[o];t.set(h,s),s+=h.length}return t};let gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gt=!1}const F=new Uint8Array(256);for(let e=0;e<256;e++)F[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;F[254]=F[254]=1;var jt=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,o,s,r,h=e.length,l=0;for(s=0;s<h;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(l),r=0,s=0;r<l;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),t<128?i[r++]=t:t<2048?(i[r++]=192|t>>>6,i[r++]=128|63&t):t<65536?(i[r++]=224|t>>>12,i[r++]=128|t>>>6&63,i[r++]=128|63&t):(i[r++]=240|t>>>18,i[r++]=128|t>>>12&63,i[r++]=128|t>>>6&63,i[r++]=128|63&t);return i},Kt=(e,i)=>{const t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let o,s;const r=new Array(2*t);for(s=0,o=0;o<t;){let h=e[o++];if(h<128){r[s++]=h;continue}let l=F[h];if(l>4)r[s++]=65533,o+=l-1;else{for(h&=l===2?31:l===3?15:7;l>1&&o<t;)h=h<<6|63&e[o++],l--;l>1?r[s++]=65533:h<65536?r[s++]=h:(h-=65536,r[s++]=55296|h>>10&1023,r[s++]=56320|1023&h)}}return((h,l)=>{if(l<65534&&h.subarray&>)return String.fromCharCode.apply(null,h.length===l?h:h.subarray(0,l));let p="";for(let n=0;n<l;n++)p+=String.fromCharCode(h[n]);return p})(r,s)},Pt=(e,i)=>{(i=i||e.length)>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(192&e[t])==128;)t--;return t<0||t===0?i:t+F[e[t]]>i?t:i},at={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Yt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Gt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_FINISH:Wt,Z_OK:L,Z_STREAM_END:rt,Z_NEED_DICT:ot,Z_STREAM_ERROR:qt,Z_DATA_ERROR:vt,Z_MEM_ERROR:Jt}=V;function M(e){this.options=Mt({chunkSize:65536,windowBits:15,to:""},e||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),!(i.windowBits>=0&&i.windowBits<16)||e&&e.windowBits||(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&!(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let t=B.inflateInit2(this.strm,i.windowBits);if(t!==L)throw new Error(at[t]);if(this.header=new Gt,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=jt(i.dictionary):pt.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=B.inflateSetDictionary(this.strm,i.dictionary),t!==L)))throw new Error(at[t])}function st(e,i){const t=new M(i);if(t.push(e),t.err)throw t.msg||at[t.err];return t.result}M.prototype.push=function(e,i){const t=this.strm,o=this.options.chunkSize,s=this.options.dictionary;let r,h,l;if(this.ended)return!1;for(h=i===~~i?i:i===!0?Wt:Xt,pt.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(o),t.next_out=0,t.avail_out=o),r=B.inflate(t,h),r===ot&&s&&(r=B.inflateSetDictionary(t,s),r===L?r=B.inflate(t,h):r===vt&&(r=ot));t.avail_in>0&&r===rt&&t.state.wrap>0&&e[t.next_in]!==0;)B.inflateReset(t),r=B.inflate(t,h);switch(r){case qt:case vt:case ot:case Jt:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===rt))if(this.options.to==="string"){let p=Pt(t.output,t.next_out),n=t.next_out-p,a=Kt(t.output,p);t.next_out=n,t.avail_out=o-n,n&&t.output.set(t.output.subarray(p,p+n),0),this.onData(a)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(r!==L||l!==0){if(r===rt)return r=B.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},M.prototype.onData=function(e){this.chunks.push(e)},M.prototype.onEnd=function(e){e===L&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ht(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var xt=M,yt=st,Et=function(e,i){return(i=i||{}).raw=!0,st(e,i)},Rt=st,At=V,Qt={Inflate:xt,inflate:yt,inflateRaw:Et,ungzip:Rt,constants:At};O.Inflate=xt,O.constants=At,O.default=Qt,O.inflate=yt,O.inflateRaw=Et,O.ungzip=Rt,Object.defineProperty(O,"__esModule",{value:!0})}); +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(O,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):I((O=typeof globalThis<"u"?globalThis:O||self).pako={})})(this,(function(O){"use strict";var I=(e,i,t,o)=>{let s=65535&e|0,r=e>>>16&65535|0,h=0;for(;t!==0;){h=t>2e3?2e3:t,t-=h;do s=s+i[o++]|0,r=r+s|0;while(--h);s%=65521,r%=65521}return s|r<<16|0};const Zt=new Uint32Array((()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}return i})());var U=(e,i,t,o)=>{const s=Zt,r=o+t;e^=-1;for(let h=o;h<r;h++)e=e>>>8^s[255&(e^i[h])];return-1^e};const j=16209;var St=function(e,i){let t,o,s,r,h,l,p,n,a,A,w,d,Z,v,u,y,k,f,g,E,c,x,m,b;const _=e.state;t=e.next_in,m=e.input,o=t+(e.avail_in-5),s=e.next_out,b=e.output,r=s-(i-e.avail_out),h=s+(e.avail_out-257),l=_.dmax,p=_.wsize,n=_.whave,a=_.wnext,A=_.window,w=_.hold,d=_.bits,Z=_.lencode,v=_.distcode,u=(1<<_.lenbits)-1,y=(1<<_.distbits)-1;t:do{d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=Z[w&u];e:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,f===0)b[s++]=65535&k;else{if(!(16&f)){if((64&f)==0){k=Z[(65535&k)+(w&(1<<f)-1)];continue e}if(32&f){_.mode=16191;break t}e.msg="invalid literal/length code",_.mode=j;break t}g=65535&k,f&=15,f&&(d<f&&(w+=m[t++]<<d,d+=8),g+=w&(1<<f)-1,w>>>=f,d-=f),d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=v[w&y];i:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,!(16&f)){if((64&f)==0){k=v[(65535&k)+(w&(1<<f)-1)];continue i}e.msg="invalid distance code",_.mode=j;break t}if(E=65535&k,f&=15,d<f&&(w+=m[t++]<<d,d+=8,d<f&&(w+=m[t++]<<d,d+=8)),E+=w&(1<<f)-1,E>l){e.msg="invalid distance too far back",_.mode=j;break t}if(w>>>=f,d-=f,f=s-r,E>f){if(f=E-f,f>n&&_.sane){e.msg="invalid distance too far back",_.mode=j;break t}if(c=0,x=A,a===0){if(c+=p-f,f<g){g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}}else if(a<f){if(c+=p+a-f,f-=a,f<g){g-=f;do b[s++]=A[c++];while(--f);if(c=0,a<g){f=a,g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}}}else if(c+=a-f,f<g){g-=f;do b[s++]=A[c++];while(--f);c=s-E,x=b}for(;g>2;)b[s++]=x[c++],b[s++]=x[c++],b[s++]=x[c++],g-=3;g&&(b[s++]=x[c++],g>1&&(b[s++]=x[c++]))}else{c=s-E;do b[s++]=b[c++],b[s++]=b[c++],b[s++]=b[c++],g-=3;while(g>2);g&&(b[s++]=b[c++],g>1&&(b[s++]=b[c++]))}break}}break}}while(t<o&&s<h);g=d>>3,t-=g,d-=g<<3,w&=(1<<d)-1,e.next_in=t,e.next_out=s,e.avail_in=t<o?o-t+5:5-(t-o),e.avail_out=s<h?h-s+257:257-(s-h),_.hold=w,_.bits=d};const K=15,Tt=new Uint16Array([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]),Ot=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Ut=new Uint16Array([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,0,0]),Dt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var z=(e,i,t,o,s,r,h,l)=>{const p=l.bits;let n,a,A,w,d,Z,v=0,u=0,y=0,k=0,f=0,g=0,E=0,c=0,x=0,m=0,b=null;const _=new Uint16Array(16),S=new Uint16Array(16);let H,q,J,Q=null;for(v=0;v<=K;v++)_[v]=0;for(u=0;u<o;u++)_[i[t+u]]++;for(f=p,k=K;k>=1&&_[k]===0;k--);if(f>k&&(f=k),k===0)return s[r++]=20971520,s[r++]=20971520,l.bits=1,0;for(y=1;y<k&&_[y]===0;y++);for(f<y&&(f=y),c=1,v=1;v<=K;v++)if(c<<=1,c-=_[v],c<0)return-1;if(c>0&&(e===0||k!==1))return-1;for(S[1]=0,v=1;v<K;v++)S[v+1]=S[v]+_[v];for(u=0;u<o;u++)i[t+u]!==0&&(h[S[i[t+u]]++]=u);if(e===0?(b=Q=h,Z=20):e===1?(b=Tt,Q=Ot,Z=257):(b=Ut,Q=Dt,Z=0),m=0,u=0,v=y,d=r,g=f,E=0,A=-1,x=1<<f,w=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){H=v-E,h[u]+1<Z?(q=0,J=h[u]):h[u]>=Z?(q=Q[h[u]-Z],J=b[h[u]-Z]):(q=96,J=0),n=1<<v-E,a=1<<g,y=a;do a-=n,s[d+(m>>E)+a]=H<<24|q<<16|J|0;while(a!==0);for(n=1<<v-1;m&n;)n>>=1;if(n!==0?(m&=n-1,m+=n):m=0,u++,--_[v]==0){if(v===k)break;v=i[t+h[u]]}if(v>f&&(m&w)!==A){for(E===0&&(E=f),d+=y,g=v-E,c=1<<g;g+E<k&&(c-=_[g+E],!(c<=0));)g++,c<<=1;if(x+=1<<g,e===1&&x>852||e===2&&x>592)return 1;A=m&w,s[A]=f<<24|g<<16|d-r|0}}return m!==0&&(s[d+m]=v-E<<24|64<<16|0),l.bits=f,0},V={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:lt,Z_BLOCK:Bt,Z_TREES:P,Z_OK:C,Z_STREAM_END:It,Z_NEED_DICT:Ct,Z_STREAM_ERROR:T,Z_DATA_ERROR:dt,Z_MEM_ERROR:ft,Z_BUF_ERROR:Nt,Z_DEFLATED:ht}=V,Y=16180,G=16190,D=16191,$=16192,tt=16194,X=16199,W=16200,et=16206,R=16209,ct=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function zt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const N=e=>{if(!e)return 1;const i=e.state;return!i||i.strm!==e||i.mode<Y||i.mode>16211?1:0},ut=e=>{if(N(e))return T;const i=e.state;return e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=1&i.wrap),i.mode=Y,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(852),i.distcode=i.distdyn=new Int32Array(592),i.sane=1,i.back=-1,C},wt=e=>{if(N(e))return T;const i=e.state;return i.wsize=0,i.whave=0,i.wnext=0,ut(e)},bt=(e,i)=>{let t;if(N(e))return T;const o=e.state;return i<0?(t=0,i=-i):(t=5+(i>>4),i<48&&(i&=15)),i&&(i<8||i>15)?T:(o.window!==null&&o.wbits!==i&&(o.window=null),o.wrap=t,o.wbits=i,wt(e))},mt=(e,i)=>{if(!e)return T;const t=new zt;e.state=t,t.strm=e,t.window=null,t.mode=Y;const o=bt(e,i);return o!==C&&(e.state=null),o};let it,nt,kt=!0;const Ft=e=>{if(kt){it=new Int32Array(512),nt=new Int32Array(32);let i=0;for(;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(z(1,e.lens,0,288,it,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;z(2,e.lens,0,32,nt,0,e.work,{bits:5}),kt=!1}e.lencode=it,e.lenbits=9,e.distcode=nt,e.distbits=5},_t=(e,i,t,o)=>{let s;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),o>=r.wsize?(r.window.set(i.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>o&&(s=o),r.window.set(i.subarray(t-o,t-o+s),r.wnext),(o-=s)?(r.window.set(i.subarray(t-o,t),0),r.wnext=o,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=s))),0};var B={inflateReset:wt,inflateReset2:bt,inflateResetKeep:ut,inflateInit:e=>mt(e,15),inflateInit2:mt,inflate:(e,i)=>{let t,o,s,r,h,l,p,n,a,A,w,d,Z,v,u,y,k,f,g,E,c,x,m=0;const b=new Uint8Array(4);let _,S;const H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(N(e)||!e.output||!e.input&&e.avail_in!==0)return T;t=e.state,t.mode===D&&(t.mode=$),h=e.next_out,s=e.output,p=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,A=l,w=p,x=C;t:for(;;)switch(t.mode){case Y:if(t.wrap===0){t.mode=$;break}for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(2&t.wrap&&n===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0),n=0,a=0,t.mode=16181;break}if(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&n)<<8)+(n>>8))%31){e.msg="incorrect header check",t.mode=R;break}if((15&n)!==ht){e.msg="unknown compression method",t.mode=R;break}if(n>>>=4,a-=4,c=8+(15&n),t.wbits===0&&(t.wbits=c),c>15||c>t.wbits){e.msg="invalid window size",t.mode=R;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&n?16189:D,n=0,a=0;break;case 16181:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.flags=n,(255&t.flags)!==ht){e.msg="unknown compression method",t.mode=R;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=R;break}t.head&&(t.head.text=n>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=16182;case 16182:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.time=n),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,b[2]=n>>>16&255,b[3]=n>>>24&255,t.check=U(t.check,b,4,0)),n=0,a=0,t.mode=16183;case 16183:for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.head&&(t.head.xflags=255&n,t.head.os=n>>8),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0,t.mode=16184;case 16184:if(1024&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length=n,t.head&&(t.head.extra_len=n),512&t.flags&&4&t.wrap&&(b[0]=255&n,b[1]=n>>>8&255,t.check=U(t.check,b,2,0)),n=0,a=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&(d=t.length,d>l&&(d=l),d&&(t.head&&(c=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(o.subarray(r,r+d),c)),512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,t.length-=d),t.length))break t;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.name+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(l===0)break t;d=0;do c=o[r+d++],t.head&&c&&t.length<65536&&(t.head.comment+=String.fromCharCode(c));while(c&&d<l);if(512&t.flags&&4&t.wrap&&(t.check=U(t.check,o,d,r)),l-=d,r+=d,c)break t}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;a<16;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(4&t.wrap&&n!==(65535&t.check)){e.msg="header crc mismatch",t.mode=R;break}n=0,a=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=D;break;case 16189:for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}e.adler=t.check=ct(n),n=0,a=0,t.mode=G;case G:if(t.havedict===0)return e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,Ct;e.adler=t.check=1,t.mode=D;case D:if(i===Bt||i===P)break t;case $:if(t.last){n>>>=7&a,a-=7&a,t.mode=et;break}for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}switch(t.last=1&n,n>>>=1,a-=1,3&n){case 0:t.mode=16193;break;case 1:if(Ft(t),t.mode=X,i===P){n>>>=2,a-=2;break t}break;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=R}n>>>=2,a-=2;break;case 16193:for(n>>>=7&a,a-=7&a;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if((65535&n)!=(n>>>16^65535)){e.msg="invalid stored block lengths",t.mode=R;break}if(t.length=65535&n,n=0,a=0,t.mode=tt,i===P)break t;case tt:t.mode=16195;case 16195:if(d=t.length,d){if(d>l&&(d=l),d>p&&(d=p),d===0)break t;s.set(o.subarray(r,r+d),h),l-=d,r+=d,p-=d,h+=d,t.length-=d;break}t.mode=D;break;case 16196:for(;a<14;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(t.nlen=257+(31&n),n>>>=5,a-=5,t.ndist=1+(31&n),n>>>=5,a-=5,t.ncode=4+(15&n),n>>>=4,a-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=R;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;a<3;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.lens[H[t.have++]]=7&n,n>>>=3,a-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,_={bits:t.lenbits},x=z(0,t.lens,0,19,t.lencode,0,t.work,_),t.lenbits=_.bits,x){e.msg="invalid code lengths set",t.mode=R;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(k<16)n>>>=u,a-=u,t.lens[t.have++]=k;else{if(k===16){for(S=u+2;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(n>>>=u,a-=u,t.have===0){e.msg="invalid bit length repeat",t.mode=R;break}c=t.lens[t.have-1],d=3+(3&n),n>>>=2,a-=2}else if(k===17){for(S=u+3;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=3+(7&n),n>>>=3,a-=3}else{for(S=u+7;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=u,a-=u,c=0,d=11+(127&n),n>>>=7,a-=7}if(t.have+d>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=R;break}for(;d--;)t.lens[t.have++]=c}}if(t.mode===R)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=R;break}if(t.lenbits=9,_={bits:t.lenbits},x=z(1,t.lens,0,t.nlen,t.lencode,0,t.work,_),t.lenbits=_.bits,x){e.msg="invalid literal/lengths set",t.mode=R;break}if(t.distbits=6,t.distcode=t.distdyn,_={bits:t.distbits},x=z(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,_),t.distbits=_.bits,x){e.msg="invalid distances set",t.mode=R;break}if(t.mode=X,i===P)break t;case X:t.mode=W;case W:if(l>=6&&p>=258){e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,St(e,w),h=e.next_out,s=e.output,p=e.avail_out,r=e.next_in,o=e.input,l=e.avail_in,n=t.hold,a=t.bits,t.mode===D&&(t.back=-1);break}for(t.back=0;m=t.lencode[n&(1<<t.lenbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(y&&(240&y)==0){for(f=u,g=y,E=k;m=t.lencode[E+((n&(1<<f+g)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,t.length=k,y===0){t.mode=16205;break}if(32&y){t.back=-1,t.mode=D;break}if(64&y){e.msg="invalid literal/length code",t.mode=R;break}t.extra=15&y,t.mode=16201;case 16201:if(t.extra){for(S=t.extra;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.length+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;m=t.distcode[n&(1<<t.distbits)-1],u=m>>>24,y=m>>>16&255,k=65535&m,!(u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if((240&y)==0){for(f=u,g=y,E=k;m=t.distcode[E+((n&(1<<f+g)-1)>>f)],u=m>>>24,y=m>>>16&255,k=65535&m,!(f+u<=a);){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}n>>>=f,a-=f,t.back+=f}if(n>>>=u,a-=u,t.back+=u,64&y){e.msg="invalid distance code",t.mode=R;break}t.offset=k,t.extra=15&y,t.mode=16203;case 16203:if(t.extra){for(S=t.extra;a<S;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}t.offset+=n&(1<<t.extra)-1,n>>>=t.extra,a-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=R;break}t.mode=16204;case 16204:if(p===0)break t;if(d=w-p,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=R;break}d>t.wnext?(d-=t.wnext,Z=t.wsize-d):Z=t.wnext-d,d>t.length&&(d=t.length),v=t.window}else v=s,Z=h-t.offset,d=t.length;d>p&&(d=p),p-=d,t.length-=d;do s[h++]=v[Z++];while(--d);t.length===0&&(t.mode=W);break;case 16205:if(p===0)break t;s[h++]=t.length,p--,t.mode=W;break;case et:if(t.wrap){for(;a<32;){if(l===0)break t;l--,n|=o[r++]<<a,a+=8}if(w-=p,e.total_out+=w,t.total+=w,4&t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,h-w):I(t.check,s,w,h-w)),w=p,4&t.wrap&&(t.flags?n:ct(n))!==t.check){e.msg="incorrect data check",t.mode=R;break}n=0,a=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;a<32;){if(l===0)break t;l--,n+=o[r++]<<a,a+=8}if(4&t.wrap&&n!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=R;break}n=0,a=0}t.mode=16208;case 16208:x=It;break t;case R:x=dt;break t;case 16210:return ft;default:return T}return e.next_out=h,e.avail_out=p,e.next_in=r,e.avail_in=l,t.hold=n,t.bits=a,(t.wsize||w!==e.avail_out&&t.mode<R&&(t.mode<et||i!==lt))&&_t(e,e.output,e.next_out,w-e.avail_out),A-=e.avail_in,w-=e.avail_out,e.total_in+=A,e.total_out+=w,t.total+=w,4&t.wrap&&w&&(e.adler=t.check=t.flags?U(t.check,s,w,e.next_out-w):I(t.check,s,w,e.next_out-w)),e.data_type=t.bits+(t.last?64:0)+(t.mode===D?128:0)+(t.mode===X||t.mode===tt?256:0),(A===0&&w===0||i===lt)&&x===C&&(x=Nt),x},inflateEnd:e=>{if(N(e))return T;let i=e.state;return i.window&&(i.window=null),e.state=null,C},inflateGetHeader:(e,i)=>{if(N(e))return T;const t=e.state;return(2&t.wrap)==0?T:(t.head=i,i.done=!1,C)},inflateSetDictionary:(e,i)=>{const t=i.length;let o,s,r;return N(e)?T:(o=e.state,o.wrap!==0&&o.mode!==G?T:o.mode===G&&(s=1,s=I(s,i,t,0),s!==o.check)?dt:(r=_t(e,i,t,t),r?(o.mode=16210,ft):(o.havedict=1,C)))},inflateInfo:"pako inflate (from Nodeca project)"};const Lt=(e,i)=>Object.prototype.hasOwnProperty.call(e,i);var Mt=function(e){const i=Array.prototype.slice.call(arguments,1);for(;i.length;){const t=i.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const o in t)Lt(t,o)&&(e[o]=t[o])}}return e},Ht=e=>{let i=0;for(let o=0,s=e.length;o<s;o++)i+=e[o].length;const t=new Uint8Array(i);for(let o=0,s=0,r=e.length;o<r;o++){let h=e[o];t.set(h,s),s+=h.length}return t};let gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gt=!1}const F=new Uint8Array(256);for(let e=0;e<256;e++)F[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;F[254]=F[254]=1;var jt=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let i,t,o,s,r,h=e.length,l=0;for(s=0;s<h;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(i=new Uint8Array(l),r=0,s=0;r<l;s++)t=e.charCodeAt(s),(64512&t)==55296&&s+1<h&&(o=e.charCodeAt(s+1),(64512&o)==56320&&(t=65536+(t-55296<<10)+(o-56320),s++)),t<128?i[r++]=t:t<2048?(i[r++]=192|t>>>6,i[r++]=128|63&t):t<65536?(i[r++]=224|t>>>12,i[r++]=128|t>>>6&63,i[r++]=128|63&t):(i[r++]=240|t>>>18,i[r++]=128|t>>>12&63,i[r++]=128|t>>>6&63,i[r++]=128|63&t);return i},Kt=(e,i)=>{const t=i||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,i));let o,s;const r=new Array(2*t);for(s=0,o=0;o<t;){let h=e[o++];if(h<128){r[s++]=h;continue}let l=F[h];if(l>4)r[s++]=65533,o+=l-1;else{for(h&=l===2?31:l===3?15:7;l>1&&o<t;)h=h<<6|63&e[o++],l--;l>1?r[s++]=65533:h<65536?r[s++]=h:(h-=65536,r[s++]=55296|h>>10&1023,r[s++]=56320|1023&h)}}return((h,l)=>{if(l<65534&&h.subarray&>)return String.fromCharCode.apply(null,h.length===l?h:h.subarray(0,l));let p="";for(let n=0;n<l;n++)p+=String.fromCharCode(h[n]);return p})(r,s)},Pt=(e,i)=>{(i=i||e.length)>e.length&&(i=e.length);let t=i-1;for(;t>=0&&(192&e[t])==128;)t--;return t<0||t===0?i:t+F[e[t]]>i?t:i},at={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Yt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Gt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_FINISH:Wt,Z_OK:L,Z_STREAM_END:rt,Z_NEED_DICT:ot,Z_STREAM_ERROR:qt,Z_DATA_ERROR:vt,Z_MEM_ERROR:Jt}=V;function M(e){this.options=Mt({chunkSize:65536,windowBits:15,to:""},e||{});const i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),!(i.windowBits>=0&&i.windowBits<16)||e&&e.windowBits||(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(15&i.windowBits)==0&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let t=B.inflateInit2(this.strm,i.windowBits);if(t!==L)throw new Error(at[t]);if(this.header=new Gt,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=jt(i.dictionary):pt.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=B.inflateSetDictionary(this.strm,i.dictionary),t!==L)))throw new Error(at[t])}function st(e,i){const t=new M(i);if(t.push(e),t.err)throw t.msg||at[t.err];return t.result}M.prototype.push=function(e,i){const t=this.strm,o=this.options.chunkSize,s=this.options.dictionary;let r,h,l;if(this.ended)return!1;for(h=i===~~i?i:i===!0?Wt:Xt,pt.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(o),t.next_out=0,t.avail_out=o),r=B.inflate(t,h),r===ot&&s&&(r=B.inflateSetDictionary(t,s),r===L?r=B.inflate(t,h):r===vt&&(r=ot));t.avail_in>0&&r===rt&&t.state.wrap>0&&e[t.next_in]!==0;)B.inflateReset(t),r=B.inflate(t,h);switch(r){case qt:case vt:case ot:case Jt:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===rt))if(this.options.to==="string"){let p=Pt(t.output,t.next_out),n=t.next_out-p,a=Kt(t.output,p);t.next_out=n,t.avail_out=o-n,n&&t.output.set(t.output.subarray(p,p+n),0),this.onData(a)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(r!==L||l!==0){if(r===rt)return r=B.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},M.prototype.onData=function(e){this.chunks.push(e)},M.prototype.onEnd=function(e){e===L&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ht(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var xt=M,yt=st,Et=function(e,i){return(i=i||{}).raw=!0,st(e,i)},Rt=st,At=V,Qt={Inflate:xt,inflate:yt,inflateRaw:Et,ungzip:Rt,constants:At};O.Inflate=xt,O.constants=At,O.default=Qt,O.inflate=yt,O.inflateRaw=Et,O.ungzip=Rt,Object.defineProperty(O,"__esModule",{value:!0})})); diff --git a/plugins/feature/map/Cesium/ThirdParty/Workers/z-worker-pako.js b/plugins/feature/map/Cesium/ThirdParty/Workers/z-worker-pako.js index 73fb4afe8..5b75e7d94 100644 --- a/plugins/feature/map/Cesium/ThirdParty/Workers/z-worker-pako.js +++ b/plugins/feature/map/Cesium/ThirdParty/Workers/z-worker-pako.js @@ -1 +1 @@ -(function(){"use strict";const{Array:te,Object:m,Number:ne,Math:A,Error:v,Uint8Array:w,Uint16Array:nt,Uint32Array:se,Int32Array:st,Map:re,DataView:W,Promise:M,TextEncoder:ae,crypto:B,postMessage:K,TransformStream:b,ReadableStream:Ve,WritableStream:xe,CompressionStream:rt,DecompressionStream:at}=self,j=void 0,N="undefined",O="function";class oe{constructor(e){return class extends b{constructor(n,s){const r=new e(s);super({transform(a,o){o.enqueue(r.append(a))},flush(a){const o=r.flush();o&&a.enqueue(o)}})}}}}const ie=[];for(let t=0;256>t;t++){let e=t;for(let n=0;8>n;n++)1&e?e=e>>>1^3988292384:e>>>=1;ie[t]=e}class G{constructor(e){this.crc=e||-1}append(e){let n=0|this.crc;for(let s=0,r=0|e.length;r>s;s++)n=n>>>8^ie[255&(n^e[s])];this.crc=n}get(){return~this.crc}}class ce extends b{constructor(){let e;const n=new G;super({transform(s,r){n.append(s),r.enqueue(s)},flush(){const s=new w(4);new W(s.buffer).setUint32(0,n.get()),e.value=s}}),e=this}}const _={concat(t,e){if(t.length===0||e.length===0)return t.concat(e);const n=t[t.length-1],s=_.getPartial(n);return s===32?t.concat(e):_._shiftRight(e,s,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(e===0)return 0;const n=t[e-1];return 32*(e-1)+_.getPartial(n)},clamp(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,A.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=_.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>t===32?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>A.round(t/1099511627776)||32,_shiftRight(t,e,n,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(e===0)return s.concat(t);for(let o=0;o<t.length;o++)s.push(n|t[o]>>>e),n=t[o]<<32-e;const r=t.length?t[t.length-1]:0,a=_.getPartial(r);return s.push(_.partial(e+a&31,e+a>32?n:s.pop(),1)),s}},L={bytes:{fromBits(t){const e=_.bitLength(t)/8,n=new w(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(_.partial(8*(3&n),s)),e}}},Ee=class{constructor(t){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],t?(e._h=t._h.slice(0),e._buffer=t._buffer.slice(0),e._length=t._length):e.reset()}reset(){const t=this;return t._h=t._init.slice(0),t._buffer=[],t._length=0,t}update(t){const e=this;typeof t=="string"&&(t=L.utf8String.toBits(t));const n=e._buffer=_.concat(e._buffer,t),s=e._length,r=e._length=s+_.bitLength(t);if(r>9007199254740991)throw new v("Cannot hash more than 2^53 - 1 bits");const a=new se(n);let o=0;for(let l=e.blockSize+s-(e.blockSize+s&e.blockSize-1);r>=l;l+=e.blockSize)e._block(a.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e}finalize(){const t=this;let e=t._buffer;const n=t._h;e=_.concat(e,[_.partial(1,1)]);for(let s=e.length+2;15&s;s++)e.push(0);for(e.push(A.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),n}_f(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}_S(t,e){return e<<t|e>>>32-t}_block(t){const e=this,n=e._h,s=te(80);for(let c=0;16>c;c++)s[c]=t[c];let r=n[0],a=n[1],o=n[2],l=n[3],u=n[4];for(let c=0;79>=c;c++){16>c||(s[c]=e._S(1,s[c-3]^s[c-8]^s[c-14]^s[c-16]));const i=e._S(5,r)+e._f(c,a,o,l)+u+s[c]+e._key[A.floor(c/20)]|0;u=l,l=o,o=e._S(30,a),a=r,r=i}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+l|0,n[4]=n[4]+u|0}},Ue={getRandomValues(t){const e=new se(t.buffer),n=s=>{let r=987654321;const a=4294967295;return()=>(r=36969*(65535&r)+(r>>16)&a,(((r<<16)+(s=18e3*(65535&s)+(s>>16)&a)&a)/4294967296+.5)*(A.random()>.5?1:-1))};for(let s,r=0;r<t.length;r+=4){const a=n(4294967296*(s||A.random()));s=987654071*a(),e[r/4]=4294967296*a()|0}return t}},H={importKey:t=>new H.hmacSha1(L.bytes.toBits(t)),pbkdf2(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new v("invalid params to pbkdf2");const r=1+(s>>5)<<2;let a,o,l,u,c;const i=new ArrayBuffer(r),f=new W(i);let h=0;const p=_;for(e=L.bytes.toBits(e),c=1;(r||1)>h;c++){for(a=o=t.encrypt(p.concat(e,[c])),l=1;n>l;l++)for(o=t.encrypt(o),u=0;u<o.length;u++)a[u]^=o[u];for(l=0;(r||1)>h&&l<a.length;l++)f.setInt32(h,a[l]),h+=4}return i.slice(0,s/8)},hmacSha1:class{constructor(t){const e=this,n=e._hash=Ee,s=[[],[]];e._baseHash=[new n,new n];const r=e._baseHash[0].blockSize/32;t.length>r&&(t=new n().update(t).finalize());for(let a=0;r>a;a++)s[0][a]=909522486^t[a],s[1][a]=1549556828^t[a];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new n(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){this._updated=!0,this._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),n=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),n}encrypt(t){if(this._updated)throw new v("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},We=typeof B!=N&&typeof B.getRandomValues==O,le="Invalid password",ue="Invalid signature",he="zipjs-abort-check-password";function fe(t){return We?B.getRandomValues(t):Ue.getRandomValues(t)}const P=16,pe={name:"PBKDF2"},Me=m.assign({hash:{name:"HMAC"}},pe),X=m.assign({iterations:1e3,hash:{name:"SHA-1"}},pe),Ne=["deriveBits"],T=[8,12,16],V=[16,24,32],q=10,Oe=[0,0,0,0],F=typeof B!=N,x=F&&B.subtle,de=F&&typeof x!=N,z=L.bytes,Le=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],s=e._tables[1],r=t.length;let a,o,l,u=1;if(r!==4&&r!==6&&r!==8)throw new v("invalid aes key size");for(e._key=[o=t.slice(0),l=[]],a=r;4*r+28>a;a++){let c=o[a-1];(a%r==0||r===8&&a%r==4)&&(c=n[c>>>24]<<24^n[c>>16&255]<<16^n[c>>8&255]<<8^n[255&c],a%r==0&&(c=c<<8^c>>>24^u<<24,u=u<<1^283*(u>>7))),o[a]=o[a-r]^c}for(let c=0;a;c++,a--){const i=o[3&c?a:a-4];l[c]=4>=a||4>c?i:s[0][n[i>>>24]]^s[1][n[i>>16&255]]^s[2][n[i>>8&255]]^s[3][n[255&i]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],r=[],a=[];let o,l,u,c;for(let i=0;256>i;i++)a[(r[i]=i<<1^283*(i>>7))^i]=i;for(let i=o=0;!n[i];i^=l||1,o=a[o]||1){let f=o^o<<1^o<<2^o<<3^o<<4;f=f>>8^255&f^99,n[i]=f,s[f]=i,c=r[u=r[l=r[i]]];let h=16843009*c^65537*u^257*l^16843008*i,p=257*r[f]^16843008*f;for(let d=0;4>d;d++)t[d][i]=p=p<<24^p>>>8,e[d][f]=h=h<<24^h>>>8}for(let i=0;5>i;i++)t[i]=t[i].slice(0),e[i]=e[i].slice(0)}_crypt(t,e){if(t.length!==4)throw new v("invalid aes block size");const n=this._key[e],s=n.length/4-2,r=[0,0,0,0],a=this._tables[e],o=a[0],l=a[1],u=a[2],c=a[3],i=a[4];let f,h,p,d=t[0]^n[0],g=t[e?3:1]^n[1],y=t[2]^n[2],S=t[e?1:3]^n[3],I=4;for(let C=0;s>C;C++)f=o[d>>>24]^l[g>>16&255]^u[y>>8&255]^c[255&S]^n[I],h=o[g>>>24]^l[y>>16&255]^u[S>>8&255]^c[255&d]^n[I+1],p=o[y>>>24]^l[S>>16&255]^u[d>>8&255]^c[255&g]^n[I+2],S=o[S>>>24]^l[d>>16&255]^u[g>>8&255]^c[255&y]^n[I+3],I+=4,d=f,g=h,y=p;for(let C=0;4>C;C++)r[e?3&-C:C]=i[d>>>24]<<24^i[g>>16&255]<<16^i[y>>8&255]<<8^i[255&S]^n[I++],f=d,d=g,g=y,y=S,S=f;return r}},Fe=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;e===255?(e=0,n===255?(n=0,s===255?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}incCounter(t){(t[0]=this.incWord(t[0]))===0&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let s;if(!(s=e.length))return[];const r=_.bitLength(e);for(let a=0;s>a;a+=4){this.incCounter(n);const o=t.encrypt(n);e[a]^=o[0],e[a+1]^=o[1],e[a+2]^=o[2],e[a+3]^=o[3]}return _.clamp(e,r)}},je=H.hmacSha1;let ge=F&&de&&typeof x.importKey==O,we=F&&de&&typeof x.deriveBits==O;class Ge extends b{constructor({password:e,rawPassword:n,signed:s,encryptionStrength:r,checkPasswordOnly:a}){super({start(){m.assign(this,{ready:new M(o=>this.resolveReady=o),password:_e(e,n),signed:s,strength:r-1,pending:new w})},async transform(o,l){const u=this,{password:c,strength:i,resolveReady:f,ready:h}=u;c?(await(async(d,g,y,S)=>{const I=await me(d,g,y,k(S,0,T[g])),C=k(S,T[g]);if(I[0]!=C[0]||I[1]!=C[1])throw new v(le)})(u,i,c,k(o,0,T[i]+2)),o=k(o,T[i]+2),a?l.error(new v(he)):f()):await h;const p=new w(o.length-q-(o.length-q)%P);l.enqueue(ye(u,o,p,0,q,!0))},async flush(o){const{signed:l,ctr:u,hmac:c,pending:i,ready:f}=this;if(c&&u){await f;const h=k(i,0,i.length-q),p=k(i,i.length-q);let d=new w;if(h.length){const g=U(z,h);c.update(g);const y=u.update(g);d=E(z,y)}if(l){const g=k(E(z,c.digest()),0,q);for(let y=0;q>y;y++)if(g[y]!=p[y])throw new v(ue)}o.enqueue(d)}}})}}class Xe extends b{constructor({password:e,rawPassword:n,encryptionStrength:s}){let r;super({start(){m.assign(this,{ready:new M(a=>this.resolveReady=a),password:_e(e,n),strength:s-1,pending:new w})},async transform(a,o){const l=this,{password:u,strength:c,resolveReady:i,ready:f}=l;let h=new w;u?(h=await(async(d,g,y)=>{const S=fe(new w(T[g]));return J(S,await me(d,g,y,S))})(l,c,u),i()):await f;const p=new w(h.length+a.length-a.length%P);p.set(h,0),o.enqueue(ye(l,a,p,h.length,0))},async flush(a){const{ctr:o,hmac:l,pending:u,ready:c}=this;if(l&&o){await c;let i=new w;if(u.length){const f=o.update(U(z,u));l.update(f),i=E(z,f)}r.signature=E(z,l.digest()).slice(0,q),a.enqueue(J(i,r.signature))}}}),r=this}}function ye(t,e,n,s,r,a){const{ctr:o,hmac:l,pending:u}=t,c=e.length-r;let i;for(u.length&&(e=J(u,e),n=((f,h)=>{if(h&&h>f.length){const p=f;(f=new w(h)).set(p,0)}return f})(n,c-c%P)),i=0;c-P>=i;i+=P){const f=U(z,k(e,i,i+P));a&&l.update(f);const h=o.update(f);a||l.update(h),n.set(E(z,h),i+s)}return t.pending=k(e,i),n}async function me(t,e,n,s){t.password=null;const r=await(async(i,f,h,p,d)=>{if(!ge)return H.importKey(f);try{return await x.importKey("raw",f,h,!1,d)}catch{return ge=!1,H.importKey(f)}})(0,n,Me,0,Ne),a=await(async(i,f,h)=>{if(!we)return H.pbkdf2(f,i.salt,X.iterations,h);try{return await x.deriveBits(i,f,h)}catch{return we=!1,H.pbkdf2(f,i.salt,X.iterations,h)}})(m.assign({salt:s},X),r,8*(2*V[e]+2)),o=new w(a),l=U(z,k(o,0,V[e])),u=U(z,k(o,V[e],2*V[e])),c=k(o,2*V[e]);return m.assign(t,{keys:{key:l,authentication:u,passwordVerification:c},ctr:new Fe(new Le(l),te.from(Oe)),hmac:new je(u)}),c}function _e(t,e){return e===j?(n=>{if(typeof ae==N){const s=new w((n=unescape(encodeURIComponent(n))).length);for(let r=0;r<s.length;r++)s[r]=n.charCodeAt(r);return s}return new ae().encode(n)})(t):e}function J(t,e){let n=t;return t.length+e.length&&(n=new w(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function k(t,e,n){return t.subarray(e,n)}function E(t,e){return t.fromBits(e)}function U(t,e){return t.toBits(e)}class Je extends b{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){m.assign(this,{password:e,passwordVerification:n}),ve(this,e)},transform(r,a){const o=this;if(o.password){const l=be(o,r.subarray(0,12));if(o.password=null,l[11]!=o.passwordVerification)throw new v(le);r=r.subarray(12)}s?a.error(new v(he)):a.enqueue(be(o,r))}})}}class Qe extends b{constructor({password:e,passwordVerification:n}){super({start(){m.assign(this,{password:e,passwordVerification:n}),ve(this,e)},transform(s,r){const a=this;let o,l;if(a.password){a.password=null;const u=fe(new w(12));u[11]=a.passwordVerification,o=new w(s.length+u.length),o.set(Se(a,u),0),l=12}else o=new w(s.length),l=0;o.set(Se(a,s),l),r.enqueue(o)}})}}function be(t,e){const n=new w(e.length);for(let s=0;s<e.length;s++)n[s]=ke(t)^e[s],Q(t,n[s]);return n}function Se(t,e){const n=new w(e.length);for(let s=0;s<e.length;s++)n[s]=ke(t)^e[s],Q(t,e[s]);return n}function ve(t,e){const n=[305419896,591751049,878082192];m.assign(t,{keys:n,crcKey0:new G(n[0]),crcKey2:new G(n[2])});for(let s=0;s<e.length;s++)Q(t,e.charCodeAt(s))}function Q(t,e){let[n,s,r]=t.keys;t.crcKey0.append([e]),n=~t.crcKey0.get(),s=De(A.imul(De(s+ze(n)),134775813)+1),t.crcKey2.append([s>>>24]),r=~t.crcKey2.get(),t.keys=[n,s,r]}function ke(t){const e=2|t.keys[2];return ze(A.imul(e,1^e)>>>8)}function ze(t){return 255&t}function De(t){return 4294967295&t}const Ce="deflate-raw";class Ye extends b{constructor(e,{chunkSize:n,CompressionStream:s,CompressionStreamNative:r}){super({});const{compressed:a,encrypted:o,useCompressionStream:l,zipCrypto:u,signed:c,level:i}=e,f=this;let h,p,d=Ie(super.readable);o&&!u||!c||(h=new ce,d=D(d,h)),a&&(d=qe(d,l,{level:i,chunkSize:n},r,s)),o&&(u?d=D(d,new Qe(e)):(p=new Xe(e),d=D(d,p))),Ae(f,d,()=>{let g;o&&!u&&(g=p.signature),o&&!u||!c||(g=new W(h.value.buffer).getUint32(0)),f.signature=g})}}class Ze extends b{constructor(e,{chunkSize:n,DecompressionStream:s,DecompressionStreamNative:r}){super({});const{zipCrypto:a,encrypted:o,signed:l,signature:u,compressed:c,useCompressionStream:i}=e;let f,h,p=Ie(super.readable);o&&(a?p=D(p,new Je(e)):(h=new Ge(e),p=D(p,h))),c&&(p=qe(p,i,{chunkSize:n},r,s)),o&&!a||!l||(f=new ce,p=D(p,f)),Ae(this,p,()=>{if((!o||a)&&l){const d=new W(f.value.buffer);if(u!=d.getUint32(0,!1))throw new v(ue)}})}}function Ie(t){return D(t,new b({transform(e,n){e&&e.length&&n.enqueue(e)}}))}function Ae(t,e,n){e=D(e,new b({flush:n})),m.defineProperty(t,"readable",{get:()=>e})}function qe(t,e,n,s,r){try{t=D(t,new(e&&s?s:r)(Ce,n))}catch{if(!e)return t;try{t=D(t,new r(Ce,n))}catch{return t}}return t}function D(t,e){return t.pipeThrough(e)}const Re="data",He="close";class $e extends b{constructor(e,n){super({});const s=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=Ye:r.startsWith("inflate")&&(a=Ze);let o=0,l=0;const u=new a(e,n),c=super.readable,i=new b({transform(h,p){h&&h.length&&(l+=h.length,p.enqueue(h))},flush(){m.assign(s,{inputSize:l})}}),f=new b({transform(h,p){h&&h.length&&(o+=h.length,p.enqueue(h))},flush(){const{signature:h}=u;m.assign(s,{signature:h,outputSize:o,inputSize:l})}});m.defineProperty(s,"readable",{get:()=>c.pipeThrough(i).pipeThrough(u).pipeThrough(f)})}}class et extends b{constructor(e){let n;super({transform:function s(r,a){if(n){const o=new w(n.length+r.length);o.set(n),o.set(r,n.length),r=o,n=null}r.length>e?(a.enqueue(r.slice(0,e)),s(r.slice(e),a)):n=r},flush(s){n&&n.length&&s.enqueue(n)}})}}const Y=new re,Z=new re;let $,R=0,Pe=!0;async function tt(t){try{const{options:e,scripts:n,config:s}=t;if(n&&n.length)try{Pe?importScripts.apply(j,n):await Be(n)}catch{Pe=!1,await Be(n)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new oe(self.Deflate)),self.Inflate&&(s.DecompressionStream=new oe(self.Inflate));const r={highWaterMark:1},a=t.readable||new Ve({async pull(h){const p=new M(y=>Y.set(R,y));ee({type:"pull",messageId:R}),R=(R+1)%ne.MAX_SAFE_INTEGER;const{value:d,done:g}=await p;h.enqueue(d),g&&h.close()}},r),o=t.writable||new xe({async write(h){let p;const d=new M(g=>p=g);Z.set(R,p),ee({type:Re,value:h,messageId:R}),R=(R+1)%ne.MAX_SAFE_INTEGER,await d}},r),l=new $e(e,s);$=new AbortController;const{signal:u}=$;await a.pipeThrough(l).pipeThrough(new et(s.chunkSize)).pipeTo(o,{signal:u,preventClose:!0,preventAbort:!0}),await o.getWriter().close();const{signature:c,inputSize:i,outputSize:f}=l;ee({type:He,result:{signature:c,inputSize:i,outputSize:f}})}catch(e){Ke(e)}}async function Be(t){for(const e of t)await import(e)}function ee(t){let{value:e}=t;if(e)if(e.length)try{e=new w(e),t.value=e.buffer,K(t,[t.value])}catch{K(t)}else K(t);else K(t)}function Ke(t=new v("Unknown error")){const{message:e,stack:n,code:s,name:r}=t;K({error:{message:e,stack:n,code:s,name:r}})}function Te(t,e,n){return class{constructor(r){const a=this;var o,l;o=r,l="level",(typeof m.hasOwn===O?m.hasOwn(o,l):o.hasOwnProperty(l))&&r.level===j&&delete r.level,a.codec=new t(m.assign({},e,r)),n(a.codec,u=>{if(a.pendingData){const c=a.pendingData;a.pendingData=new w(c.length+u.length);const{pendingData:i}=a;i.set(c,0),i.set(u,c.length)}else a.pendingData=new w(u)})}append(r){return this.codec.push(r),s(this)}flush(){return this.codec.push(new w,!0),s(this)}};function s(r){if(r.pendingData){const a=r.pendingData;return r.pendingData=null,a}return new w}}addEventListener("message",({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if(e=="start"&&tt(t),e==Re){const a=Y.get(n);Y.delete(n),a({value:new w(s),done:r})}if(e=="ack"){const a=Z.get(n);Z.delete(n),a()}e==He&&$.abort()}catch(a){Ke(a)}}),self.initCodec=()=>{const{Deflate:t,Inflate:e}=((n,s={},r)=>({Deflate:Te(n.Deflate,s.deflate,r),Inflate:Te(n.Inflate,s.inflate,r)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},(n,s)=>n.onData=s);self.Deflate=t,self.Inflate=e}})(); +(function(){"use strict";const{Array:te,Object:m,Number:ne,Math:A,Error:v,Uint8Array:w,Uint16Array:nt,Uint32Array:se,Int32Array:st,Map:re,DataView:W,Promise:M,TextEncoder:ae,crypto:B,postMessage:K,TransformStream:b,ReadableStream:Ve,WritableStream:xe,CompressionStream:rt,DecompressionStream:at}=self,j=void 0,N="undefined",O="function";class oe{constructor(e){return class extends b{constructor(n,s){const r=new e(s);super({transform(a,o){o.enqueue(r.append(a))},flush(a){const o=r.flush();o&&a.enqueue(o)}})}}}}const ie=[];for(let t=0;256>t;t++){let e=t;for(let n=0;8>n;n++)1&e?e=e>>>1^3988292384:e>>>=1;ie[t]=e}class G{constructor(e){this.crc=e||-1}append(e){let n=0|this.crc;for(let s=0,r=0|e.length;r>s;s++)n=n>>>8^ie[255&(n^e[s])];this.crc=n}get(){return~this.crc}}class ce extends b{constructor(){let e;const n=new G;super({transform(s,r){n.append(s),r.enqueue(s)},flush(){const s=new w(4);new W(s.buffer).setUint32(0,n.get()),e.value=s}}),e=this}}const _={concat(t,e){if(t.length===0||e.length===0)return t.concat(e);const n=t[t.length-1],s=_.getPartial(n);return s===32?t.concat(e):_._shiftRight(e,s,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(e===0)return 0;const n=t[e-1];return 32*(e-1)+_.getPartial(n)},clamp(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,A.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=_.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>t===32?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>A.round(t/1099511627776)||32,_shiftRight(t,e,n,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(e===0)return s.concat(t);for(let o=0;o<t.length;o++)s.push(n|t[o]>>>e),n=t[o]<<32-e;const r=t.length?t[t.length-1]:0,a=_.getPartial(r);return s.push(_.partial(e+a&31,e+a>32?n:s.pop(),1)),s}},L={bytes:{fromBits(t){const e=_.bitLength(t)/8,n=new w(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(_.partial(8*(3&n),s)),e}}},Ee=class{constructor(t){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],t?(e._h=t._h.slice(0),e._buffer=t._buffer.slice(0),e._length=t._length):e.reset()}reset(){const t=this;return t._h=t._init.slice(0),t._buffer=[],t._length=0,t}update(t){const e=this;typeof t=="string"&&(t=L.utf8String.toBits(t));const n=e._buffer=_.concat(e._buffer,t),s=e._length,r=e._length=s+_.bitLength(t);if(r>9007199254740991)throw new v("Cannot hash more than 2^53 - 1 bits");const a=new se(n);let o=0;for(let l=e.blockSize+s-(e.blockSize+s&e.blockSize-1);r>=l;l+=e.blockSize)e._block(a.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e}finalize(){const t=this;let e=t._buffer;const n=t._h;e=_.concat(e,[_.partial(1,1)]);for(let s=e.length+2;15&s;s++)e.push(0);for(e.push(A.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),n}_f(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}_S(t,e){return e<<t|e>>>32-t}_block(t){const e=this,n=e._h,s=te(80);for(let c=0;16>c;c++)s[c]=t[c];let r=n[0],a=n[1],o=n[2],l=n[3],u=n[4];for(let c=0;79>=c;c++){16>c||(s[c]=e._S(1,s[c-3]^s[c-8]^s[c-14]^s[c-16]));const i=e._S(5,r)+e._f(c,a,o,l)+u+s[c]+e._key[A.floor(c/20)]|0;u=l,l=o,o=e._S(30,a),a=r,r=i}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+l|0,n[4]=n[4]+u|0}},Ue={getRandomValues(t){const e=new se(t.buffer),n=s=>{let r=987654321;const a=4294967295;return()=>(r=36969*(65535&r)+(r>>16)&a,(((r<<16)+(s=18e3*(65535&s)+(s>>16)&a)&a)/4294967296+.5)*(A.random()>.5?1:-1))};for(let s,r=0;r<t.length;r+=4){const a=n(4294967296*(s||A.random()));s=987654071*a(),e[r/4]=4294967296*a()|0}return t}},H={importKey:t=>new H.hmacSha1(L.bytes.toBits(t)),pbkdf2(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new v("invalid params to pbkdf2");const r=1+(s>>5)<<2;let a,o,l,u,c;const i=new ArrayBuffer(r),f=new W(i);let h=0;const p=_;for(e=L.bytes.toBits(e),c=1;(r||1)>h;c++){for(a=o=t.encrypt(p.concat(e,[c])),l=1;n>l;l++)for(o=t.encrypt(o),u=0;u<o.length;u++)a[u]^=o[u];for(l=0;(r||1)>h&&l<a.length;l++)f.setInt32(h,a[l]),h+=4}return i.slice(0,s/8)},hmacSha1:class{constructor(t){const e=this,n=e._hash=Ee,s=[[],[]];e._baseHash=[new n,new n];const r=e._baseHash[0].blockSize/32;t.length>r&&(t=new n().update(t).finalize());for(let a=0;r>a;a++)s[0][a]=909522486^t[a],s[1][a]=1549556828^t[a];e._baseHash[0].update(s[0]),e._baseHash[1].update(s[1]),e._resultHash=new n(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){this._updated=!0,this._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),n=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),n}encrypt(t){if(this._updated)throw new v("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},We=typeof B!=N&&typeof B.getRandomValues==O,le="Invalid password",ue="Invalid signature",he="zipjs-abort-check-password";function fe(t){return We?B.getRandomValues(t):Ue.getRandomValues(t)}const P=16,pe={name:"PBKDF2"},Me=m.assign({hash:{name:"HMAC"}},pe),X=m.assign({iterations:1e3,hash:{name:"SHA-1"}},pe),Ne=["deriveBits"],T=[8,12,16],V=[16,24,32],q=10,Oe=[0,0,0,0],F=typeof B!=N,x=F&&B.subtle,de=F&&typeof x!=N,z=L.bytes,Le=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],s=e._tables[1],r=t.length;let a,o,l,u=1;if(r!==4&&r!==6&&r!==8)throw new v("invalid aes key size");for(e._key=[o=t.slice(0),l=[]],a=r;4*r+28>a;a++){let c=o[a-1];(a%r==0||r===8&&a%r==4)&&(c=n[c>>>24]<<24^n[c>>16&255]<<16^n[c>>8&255]<<8^n[255&c],a%r==0&&(c=c<<8^c>>>24^u<<24,u=u<<1^283*(u>>7))),o[a]=o[a-r]^c}for(let c=0;a;c++,a--){const i=o[3&c?a:a-4];l[c]=4>=a||4>c?i:s[0][n[i>>>24]]^s[1][n[i>>16&255]]^s[2][n[i>>8&255]]^s[3][n[255&i]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],r=[],a=[];let o,l,u,c;for(let i=0;256>i;i++)a[(r[i]=i<<1^283*(i>>7))^i]=i;for(let i=o=0;!n[i];i^=l||1,o=a[o]||1){let f=o^o<<1^o<<2^o<<3^o<<4;f=f>>8^255&f^99,n[i]=f,s[f]=i,c=r[u=r[l=r[i]]];let h=16843009*c^65537*u^257*l^16843008*i,p=257*r[f]^16843008*f;for(let d=0;4>d;d++)t[d][i]=p=p<<24^p>>>8,e[d][f]=h=h<<24^h>>>8}for(let i=0;5>i;i++)t[i]=t[i].slice(0),e[i]=e[i].slice(0)}_crypt(t,e){if(t.length!==4)throw new v("invalid aes block size");const n=this._key[e],s=n.length/4-2,r=[0,0,0,0],a=this._tables[e],o=a[0],l=a[1],u=a[2],c=a[3],i=a[4];let f,h,p,d=t[0]^n[0],g=t[e?3:1]^n[1],y=t[2]^n[2],S=t[e?1:3]^n[3],I=4;for(let C=0;s>C;C++)f=o[d>>>24]^l[g>>16&255]^u[y>>8&255]^c[255&S]^n[I],h=o[g>>>24]^l[y>>16&255]^u[S>>8&255]^c[255&d]^n[I+1],p=o[y>>>24]^l[S>>16&255]^u[d>>8&255]^c[255&g]^n[I+2],S=o[S>>>24]^l[d>>16&255]^u[g>>8&255]^c[255&y]^n[I+3],I+=4,d=f,g=h,y=p;for(let C=0;4>C;C++)r[e?3&-C:C]=i[d>>>24]<<24^i[g>>16&255]<<16^i[y>>8&255]<<8^i[255&S]^n[I++],f=d,d=g,g=y,y=S,S=f;return r}},Fe=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;e===255?(e=0,n===255?(n=0,s===255?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}incCounter(t){(t[0]=this.incWord(t[0]))===0&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let s;if(!(s=e.length))return[];const r=_.bitLength(e);for(let a=0;s>a;a+=4){this.incCounter(n);const o=t.encrypt(n);e[a]^=o[0],e[a+1]^=o[1],e[a+2]^=o[2],e[a+3]^=o[3]}return _.clamp(e,r)}},je=H.hmacSha1;let ge=F&&de&&typeof x.importKey==O,we=F&&de&&typeof x.deriveBits==O;class Ge extends b{constructor({password:e,rawPassword:n,signed:s,encryptionStrength:r,checkPasswordOnly:a}){super({start(){m.assign(this,{ready:new M((o=>this.resolveReady=o)),password:_e(e,n),signed:s,strength:r-1,pending:new w})},async transform(o,l){const u=this,{password:c,strength:i,resolveReady:f,ready:h}=u;c?(await(async(d,g,y,S)=>{const I=await me(d,g,y,k(S,0,T[g])),C=k(S,T[g]);if(I[0]!=C[0]||I[1]!=C[1])throw new v(le)})(u,i,c,k(o,0,T[i]+2)),o=k(o,T[i]+2),a?l.error(new v(he)):f()):await h;const p=new w(o.length-q-(o.length-q)%P);l.enqueue(ye(u,o,p,0,q,!0))},async flush(o){const{signed:l,ctr:u,hmac:c,pending:i,ready:f}=this;if(c&&u){await f;const h=k(i,0,i.length-q),p=k(i,i.length-q);let d=new w;if(h.length){const g=U(z,h);c.update(g);const y=u.update(g);d=E(z,y)}if(l){const g=k(E(z,c.digest()),0,q);for(let y=0;q>y;y++)if(g[y]!=p[y])throw new v(ue)}o.enqueue(d)}}})}}class Xe extends b{constructor({password:e,rawPassword:n,encryptionStrength:s}){let r;super({start(){m.assign(this,{ready:new M((a=>this.resolveReady=a)),password:_e(e,n),strength:s-1,pending:new w})},async transform(a,o){const l=this,{password:u,strength:c,resolveReady:i,ready:f}=l;let h=new w;u?(h=await(async(d,g,y)=>{const S=fe(new w(T[g]));return J(S,await me(d,g,y,S))})(l,c,u),i()):await f;const p=new w(h.length+a.length-a.length%P);p.set(h,0),o.enqueue(ye(l,a,p,h.length,0))},async flush(a){const{ctr:o,hmac:l,pending:u,ready:c}=this;if(l&&o){await c;let i=new w;if(u.length){const f=o.update(U(z,u));l.update(f),i=E(z,f)}r.signature=E(z,l.digest()).slice(0,q),a.enqueue(J(i,r.signature))}}}),r=this}}function ye(t,e,n,s,r,a){const{ctr:o,hmac:l,pending:u}=t,c=e.length-r;let i;for(u.length&&(e=J(u,e),n=((f,h)=>{if(h&&h>f.length){const p=f;(f=new w(h)).set(p,0)}return f})(n,c-c%P)),i=0;c-P>=i;i+=P){const f=U(z,k(e,i,i+P));a&&l.update(f);const h=o.update(f);a||l.update(h),n.set(E(z,h),i+s)}return t.pending=k(e,i),n}async function me(t,e,n,s){t.password=null;const r=await(async(i,f,h,p,d)=>{if(!ge)return H.importKey(f);try{return await x.importKey("raw",f,h,!1,d)}catch{return ge=!1,H.importKey(f)}})(0,n,Me,0,Ne),a=await(async(i,f,h)=>{if(!we)return H.pbkdf2(f,i.salt,X.iterations,h);try{return await x.deriveBits(i,f,h)}catch{return we=!1,H.pbkdf2(f,i.salt,X.iterations,h)}})(m.assign({salt:s},X),r,8*(2*V[e]+2)),o=new w(a),l=U(z,k(o,0,V[e])),u=U(z,k(o,V[e],2*V[e])),c=k(o,2*V[e]);return m.assign(t,{keys:{key:l,authentication:u,passwordVerification:c},ctr:new Fe(new Le(l),te.from(Oe)),hmac:new je(u)}),c}function _e(t,e){return e===j?(n=>{if(typeof ae==N){const s=new w((n=unescape(encodeURIComponent(n))).length);for(let r=0;r<s.length;r++)s[r]=n.charCodeAt(r);return s}return new ae().encode(n)})(t):e}function J(t,e){let n=t;return t.length+e.length&&(n=new w(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function k(t,e,n){return t.subarray(e,n)}function E(t,e){return t.fromBits(e)}function U(t,e){return t.toBits(e)}class Je extends b{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){m.assign(this,{password:e,passwordVerification:n}),ve(this,e)},transform(r,a){const o=this;if(o.password){const l=be(o,r.subarray(0,12));if(o.password=null,l[11]!=o.passwordVerification)throw new v(le);r=r.subarray(12)}s?a.error(new v(he)):a.enqueue(be(o,r))}})}}class Qe extends b{constructor({password:e,passwordVerification:n}){super({start(){m.assign(this,{password:e,passwordVerification:n}),ve(this,e)},transform(s,r){const a=this;let o,l;if(a.password){a.password=null;const u=fe(new w(12));u[11]=a.passwordVerification,o=new w(s.length+u.length),o.set(Se(a,u),0),l=12}else o=new w(s.length),l=0;o.set(Se(a,s),l),r.enqueue(o)}})}}function be(t,e){const n=new w(e.length);for(let s=0;s<e.length;s++)n[s]=ke(t)^e[s],Q(t,n[s]);return n}function Se(t,e){const n=new w(e.length);for(let s=0;s<e.length;s++)n[s]=ke(t)^e[s],Q(t,e[s]);return n}function ve(t,e){const n=[305419896,591751049,878082192];m.assign(t,{keys:n,crcKey0:new G(n[0]),crcKey2:new G(n[2])});for(let s=0;s<e.length;s++)Q(t,e.charCodeAt(s))}function Q(t,e){let[n,s,r]=t.keys;t.crcKey0.append([e]),n=~t.crcKey0.get(),s=De(A.imul(De(s+ze(n)),134775813)+1),t.crcKey2.append([s>>>24]),r=~t.crcKey2.get(),t.keys=[n,s,r]}function ke(t){const e=2|t.keys[2];return ze(A.imul(e,1^e)>>>8)}function ze(t){return 255&t}function De(t){return 4294967295&t}const Ce="deflate-raw";class Ye extends b{constructor(e,{chunkSize:n,CompressionStream:s,CompressionStreamNative:r}){super({});const{compressed:a,encrypted:o,useCompressionStream:l,zipCrypto:u,signed:c,level:i}=e,f=this;let h,p,d=Ie(super.readable);o&&!u||!c||(h=new ce,d=D(d,h)),a&&(d=qe(d,l,{level:i,chunkSize:n},r,s)),o&&(u?d=D(d,new Qe(e)):(p=new Xe(e),d=D(d,p))),Ae(f,d,(()=>{let g;o&&!u&&(g=p.signature),o&&!u||!c||(g=new W(h.value.buffer).getUint32(0)),f.signature=g}))}}class Ze extends b{constructor(e,{chunkSize:n,DecompressionStream:s,DecompressionStreamNative:r}){super({});const{zipCrypto:a,encrypted:o,signed:l,signature:u,compressed:c,useCompressionStream:i}=e;let f,h,p=Ie(super.readable);o&&(a?p=D(p,new Je(e)):(h=new Ge(e),p=D(p,h))),c&&(p=qe(p,i,{chunkSize:n},r,s)),o&&!a||!l||(f=new ce,p=D(p,f)),Ae(this,p,(()=>{if((!o||a)&&l){const d=new W(f.value.buffer);if(u!=d.getUint32(0,!1))throw new v(ue)}}))}}function Ie(t){return D(t,new b({transform(e,n){e&&e.length&&n.enqueue(e)}}))}function Ae(t,e,n){e=D(e,new b({flush:n})),m.defineProperty(t,"readable",{get:()=>e})}function qe(t,e,n,s,r){try{t=D(t,new(e&&s?s:r)(Ce,n))}catch{if(!e)return t;try{t=D(t,new r(Ce,n))}catch{return t}}return t}function D(t,e){return t.pipeThrough(e)}const Re="data",He="close";class $e extends b{constructor(e,n){super({});const s=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=Ye:r.startsWith("inflate")&&(a=Ze);let o=0,l=0;const u=new a(e,n),c=super.readable,i=new b({transform(h,p){h&&h.length&&(l+=h.length,p.enqueue(h))},flush(){m.assign(s,{inputSize:l})}}),f=new b({transform(h,p){h&&h.length&&(o+=h.length,p.enqueue(h))},flush(){const{signature:h}=u;m.assign(s,{signature:h,outputSize:o,inputSize:l})}});m.defineProperty(s,"readable",{get:()=>c.pipeThrough(i).pipeThrough(u).pipeThrough(f)})}}class et extends b{constructor(e){let n;super({transform:function s(r,a){if(n){const o=new w(n.length+r.length);o.set(n),o.set(r,n.length),r=o,n=null}r.length>e?(a.enqueue(r.slice(0,e)),s(r.slice(e),a)):n=r},flush(s){n&&n.length&&s.enqueue(n)}})}}const Y=new re,Z=new re;let $,R=0,Pe=!0;async function tt(t){try{const{options:e,scripts:n,config:s}=t;if(n&&n.length)try{Pe?importScripts.apply(j,n):await Be(n)}catch{Pe=!1,await Be(n)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new oe(self.Deflate)),self.Inflate&&(s.DecompressionStream=new oe(self.Inflate));const r={highWaterMark:1},a=t.readable||new Ve({async pull(h){const p=new M((y=>Y.set(R,y)));ee({type:"pull",messageId:R}),R=(R+1)%ne.MAX_SAFE_INTEGER;const{value:d,done:g}=await p;h.enqueue(d),g&&h.close()}},r),o=t.writable||new xe({async write(h){let p;const d=new M((g=>p=g));Z.set(R,p),ee({type:Re,value:h,messageId:R}),R=(R+1)%ne.MAX_SAFE_INTEGER,await d}},r),l=new $e(e,s);$=new AbortController;const{signal:u}=$;await a.pipeThrough(l).pipeThrough(new et(s.chunkSize)).pipeTo(o,{signal:u,preventClose:!0,preventAbort:!0}),await o.getWriter().close();const{signature:c,inputSize:i,outputSize:f}=l;ee({type:He,result:{signature:c,inputSize:i,outputSize:f}})}catch(e){Ke(e)}}async function Be(t){for(const e of t)await import(e)}function ee(t){let{value:e}=t;if(e)if(e.length)try{e=new w(e),t.value=e.buffer,K(t,[t.value])}catch{K(t)}else K(t);else K(t)}function Ke(t=new v("Unknown error")){const{message:e,stack:n,code:s,name:r}=t;K({error:{message:e,stack:n,code:s,name:r}})}function Te(t,e,n){return class{constructor(r){const a=this;var o,l;o=r,l="level",(typeof m.hasOwn===O?m.hasOwn(o,l):o.hasOwnProperty(l))&&r.level===j&&delete r.level,a.codec=new t(m.assign({},e,r)),n(a.codec,(u=>{if(a.pendingData){const c=a.pendingData;a.pendingData=new w(c.length+u.length);const{pendingData:i}=a;i.set(c,0),i.set(u,c.length)}else a.pendingData=new w(u)}))}append(r){return this.codec.push(r),s(this)}flush(){return this.codec.push(new w,!0),s(this)}};function s(r){if(r.pendingData){const a=r.pendingData;return r.pendingData=null,a}return new w}}addEventListener("message",(({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if(e=="start"&&tt(t),e==Re){const a=Y.get(n);Y.delete(n),a({value:new w(s),done:r})}if(e=="ack"){const a=Z.get(n);Z.delete(n),a()}e==He&&$.abort()}catch(a){Ke(a)}})),self.initCodec=()=>{const{Deflate:t,Inflate:e}=((n,s={},r)=>({Deflate:Te(n.Deflate,s.deflate,r),Inflate:Te(n.Inflate,s.inflate,r)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((n,s)=>n.onData=s));self.Deflate=t,self.Inflate=e}})(); diff --git a/plugins/feature/map/Cesium/ThirdParty/Workers/zip-web-worker.js b/plugins/feature/map/Cesium/ThirdParty/Workers/zip-web-worker.js new file mode 100644 index 000000000..8a0dcee2c --- /dev/null +++ b/plugins/feature/map/Cesium/ThirdParty/Workers/zip-web-worker.js @@ -0,0 +1 @@ +(function(){"use strict";const{Array:Pe,Object:B,Number:G,Math:D,Error:S,Uint8Array:b,Uint16Array:Qt,Uint32Array:kt,Int32Array:en,Map:H,DataView:L,Promise:ae,TextEncoder:qe,crypto:J,postMessage:V,TransformStream:v,ReadableStream:ce,WritableStream:be,CompressionStream:tn,DecompressionStream:nn}=self,le=void 0,Y="undefined",$="function",ue=new b,Q=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=1&e?e>>>1^3988292384:e>>>1;Q[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=Q[e-1][t];Q[e][t]=n>>>8^Q[0][255&n]}const[Me,zt,vt,Ct,_t,At,It,Ft]=Q;class fe{constructor(e){this.o=e||-1}append(e){let n=0|this.o;const s=0|e.length;let r=0;if(s>=8&&e.buffer){const a=new L(e.buffer,e.byteOffset,s),o=s-8;for(;r<=o;r+=8){const i=n^a.getInt32(r,!0),c=a.getInt32(r+4,!0);n=Ft[255&i]^It[i>>>8&255]^At[i>>>16&255]^_t[i>>>24&255]^Ct[255&c]^vt[c>>>8&255]^zt[c>>>16&255]^Me[c>>>24&255]}}for(;r<s;r++)n=n>>>8^Me[255&(n^e[r])];this.o=n}get(){return~this.o}}class De extends v{constructor(){let e;const n=new fe;super({transform(s,r){n.append(s),r.enqueue(s)},flush(){const s=new b(4);new L(s.buffer).setUint32(0,n.get()),e.value=s}}),e=this}}function j(t,e){const n=new b(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Te(t){return new L(t.buffer,t.byteOffset,t.byteLength)}const C={concat(t,e){if(t.length===0||e.length===0)return t.concat(e);const n=t[t.length-1],s=C.l(n);return s===32?t.concat(e):C.h(e,s,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(e===0)return 0;const n=t[e-1];return 32*(e-1)+C.l(n)},m(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,D.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=C.S(e,t[n-1]&2147483648>>e-1,1)),t},S:(t,e,n)=>t===32?e:(n?0|e:e<<32-t)+1099511627776*t,l:t=>D.round(t/1099511627776)||32,h(t,e,n,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(e===0)return s.concat(t);for(let o=0;o<t.length;o++)s.push(n|t[o]>>>e),n=t[o]<<32-e;const r=t.length?t[t.length-1]:0,a=C.l(r);return s.push(C.S(e+a&31,e+a>32?n:s.pop(),1)),s}},he={bytes:{v(t){const e=C.bitLength(t)/8,n=new b(e);let s;for(let r=0;r<e;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},C(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(C.S(8*(3&n),s)),e}}},Bt=class{constructor(t){const e=this;e.blockSize=512,e.I=[1732584193,4023233417,2562383102,271733878,3285377520],e.A=[1518500249,1859775393,2400959708,3395469782],t?(e.M=t.M.slice(0),e.P=t.P.slice(0),e.B=t.B):e.reset()}reset(){const t=this;return t.M=t.I.slice(0),t.P=[],t.B=0,t}update(t){const e=this;typeof t=="string"&&(t=he.D.C(t));const n=e.P=C.concat(e.P,t),s=e.B,r=e.B=s+C.bitLength(t);if(r>9007199254740991)throw new S("Cannot hash more than 2^53 - 1 bits");const a=new kt(n);let o=0;for(let i=e.blockSize+s-(e.blockSize+s&e.blockSize-1);i<=r;i+=e.blockSize)e.F(a.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e}R(){const t=this;let e=t.P;const n=t.M;e=C.concat(e,[C.S(1,1)]);for(let s=e.length+2;15&s;s++)e.push(0);for(e.push(D.floor(t.B/4294967296)),e.push(0|t.B);e.length;)t.F(e.splice(0,16));return t.reset(),n}U(t,e,n,s){return t<=19?e&n|~e&s:t<=39?e^n^s:t<=59?e&n|e&s|n&s:t<=79?e^n^s:void 0}W(t,e){return e<<t|e>>>32-t}F(t){const e=this,n=e.M,s=Pe(80);for(let l=0;l<16;l++)s[l]=t[l];let r=n[0],a=n[1],o=n[2],i=n[3],c=n[4];for(let l=0;l<=79;l++){l>=16&&(s[l]=e.W(1,s[l-3]^s[l-8]^s[l-14]^s[l-16]));const f=e.W(5,r)+e.U(l,a,o,i)+c+s[l]+e.A[D.floor(l/20)]|0;c=i,i=o,o=e.W(30,a),a=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+i|0,n[4]=n[4]+c|0}},E={importKey:t=>new E._(he.bytes.C(t)),T(t,e,n,s){if(n=n||1e4,s<0||n<0)throw new S("invalid params to pbkdf2");const r=1+(s>>5)<<2;let a,o,i,c,l;const f=new ArrayBuffer(r),u=new L(f);let h=0;const w=C;for(e=he.bytes.C(e),l=1;h<(r||1);l++){for(a=o=t.encrypt(w.concat(e,[l])),i=1;i<n;i++)for(o=t.encrypt(o),c=0;c<o.length;c++)a[c]^=o[c];for(i=0;h<(r||1)&&i<a.length;i++)u.setInt32(h,a[i]),h+=4}return f.slice(0,s/8)},_:class{constructor(t){const e=this,n=e.V=Bt,s=[[],[]];e.K=[new n,new n];const r=e.K[0].blockSize/32;t.length>r&&(t=new n().update(t).R());for(let a=0;a<r;a++)s[0][a]=909522486^t[a],s[1][a]=1549556828^t[a];e.K[0].update(s[0]),e.K[1].update(s[1]),e.L=new n(e.K[0])}reset(){const t=this;t.L=new t.V(t.K[0]),t.O=!1}update(t){this.O=!0,this.L.update(t)}digest(){const t=this,e=t.L.R(),n=new t.V(t.K[1]).update(e).R();return t.reset(),n}encrypt(t){if(this.O)throw new S("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Pt=typeof J!=Y&&typeof J.getRandomValues==$,Ue="Invalid password",Re="Invalid signature",qt=Re,We="zipjs-abort-check-password";function xe(t){if(Pt)return J.getRandomValues(t);throw new S("Crypto API not supported")}const O=16,Ke={name:"PBKDF2"},Mt=B.assign({hash:{name:"HMAC"}},Ke),ke=B.assign({iterations:1e3,hash:{name:"SHA-1"}},Ke),Dt=["deriveBits"],ee=[8,12,16],te=[16,24,32],U=10,Tt=[0,0,0,0],we=typeof J!=Y,ne=we&&J.subtle,Le=we&&typeof ne!=Y,T=he.bytes,Ut=class{constructor(t){const e=this;e.j=[[[],[],[],[],[]],[[],[],[],[],[]]],e.j[0][0][0]||e.H();const n=e.j[0][4],s=e.j[1],r=t.length;let a,o,i,c=1;if(r!==4&&r!==6&&r!==8)throw new S("invalid aes key size");for(e.A=[o=t.slice(0),i=[]],a=r;a<4*r+28;a++){let l=o[a-1];(a%r===0||r===8&&a%r===4)&&(l=n[l>>>24]<<24^n[l>>16&255]<<16^n[l>>8&255]<<8^n[255&l],a%r===0&&(l=l<<8^l>>>24^c<<24,c=c<<1^283*(c>>7))),o[a]=o[a-r]^l}for(let l=0;a;l++,a--){const f=o[3&l?a:a-4];i[l]=a<=4||l<4?f:s[0][n[f>>>24]]^s[1][n[f>>16&255]]^s[2][n[f>>8&255]]^s[3][n[255&f]]}}encrypt(t){return this.N(t,0)}decrypt(t){return this.N(t,1)}H(){const t=this.j[0],e=this.j[1],n=t[4],s=e[4],r=[],a=[];let o,i,c,l;for(let f=0;f<256;f++)a[(r[f]=f<<1^283*(f>>7))^f]=f;for(let f=o=0;!n[f];f^=i||1,o=a[o]||1){let u=o^o<<1^o<<2^o<<3^o<<4;u=u>>8^255&u^99,n[f]=u,s[u]=f,l=r[c=r[i=r[f]]];let h=16843009*l^65537*c^257*i^16843008*f,w=257*r[u]^16843008*u;for(let p=0;p<4;p++)t[p][f]=w=w<<24^w>>>8,e[p][u]=h=h<<24^h>>>8}for(let f=0;f<5;f++)t[f]=t[f].slice(0),e[f]=e[f].slice(0)}N(t,e){if(t.length!==4)throw new S("invalid aes block size");const n=this.A[e],s=n.length/4-2,r=[0,0,0,0],a=this.j[e],o=a[0],i=a[1],c=a[2],l=a[3],f=a[4];let u,h,w,p=t[0]^n[0],d=t[e?3:1]^n[1],m=t[2]^n[2],z=t[e?1:3]^n[3],y=4;for(let g=0;g<s;g++)u=o[p>>>24]^i[d>>16&255]^c[m>>8&255]^l[255&z]^n[y],h=o[d>>>24]^i[m>>16&255]^c[z>>8&255]^l[255&p]^n[y+1],w=o[m>>>24]^i[z>>16&255]^c[p>>8&255]^l[255&d]^n[y+2],z=o[z>>>24]^i[p>>16&255]^c[d>>8&255]^l[255&m]^n[y+3],y+=4,p=u,d=h,m=w;for(let g=0;g<4;g++)r[e?3&-g:g]=f[p>>>24]<<24^f[d>>16&255]<<16^f[m>>8&255]<<8^f[255&z]^n[y++],u=p,p=d,d=m,m=z,z=u;return r}},Rt=class{constructor(t,e){this.G=t,this.J=e,this.X=e}reset(){this.X=this.J}update(t){return this.Y(this.G,t,this.X)}Z(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;e===255?(e=0,n===255?(n=0,s===255?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}$(t){(t[0]=this.Z(t[0]))===0&&(t[1]=this.Z(t[1]))}Y(t,e,n){let s;if(!(s=e.length))return[];const r=C.bitLength(e);for(let a=0;a<s;a+=4){this.$(n);const o=t.encrypt(n);e[a]^=o[0],e[a+1]^=o[1],e[a+2]^=o[2],e[a+3]^=o[3]}return C.m(e,r)}},Wt=E._;let Ve=we&&Le&&typeof ne.importKey==$,je=we&&Le&&typeof ne.deriveBits==$;class xt extends v{constructor({password:e,rawPassword:n,encryptionStrength:s,checkPasswordOnly:r,checkAuthenticationCode:a=!0}){super({start(){Ee(this,e,n,s)},async transform(o,i){const c=this,{password:l,strength:f,nt:u,ready:h}=c;l?(await(async function(p,d,m,z){const y=await Ze(p,d,m,A(z,0,ee[d])),g=A(z,ee[d]);if(y[0]!=g[0]||y[1]!=g[1])throw new S(Ue)})(c,f,l,A(o,0,ee[f]+2)),o=A(o,ee[f]+2),r?i.error(new S(We)):u()):await h;const w=new b(o.length-U-(o.length-U)%O);i.enqueue(Oe(c,o,w,0,U,!0))},async flush(o){const{et:i,st:c,ot:l,ready:f}=this;if(c&&i){await f;const u=A(l,0,l.length-U),h=A(l,l.length-U);let w=ue;if(u.length){const m=re(T,u);c.update(m);const z=i.update(m);w=se(T,z)}const p=A(se(T,c.digest()),0,U);let d=l.length<U?1:0;for(let m=0;m<U;m++)d|=p[m]^h[m];if(d&&a)throw new S(qt);o.enqueue(w)}}})}}class Kt extends v{constructor({password:e,rawPassword:n,encryptionStrength:s}){super({start(){Ee(this,e,n,s)},async transform(r,a){const o=this,{password:i,strength:c,nt:l,ready:f}=o;let u=ue;i?(u=await(async function(w,p,d){const m=xe(new b(ee[p]));return j(m,await Ze(w,p,d,m))})(o,c,i),l()):await f;const h=new b(u.length+r.length-r.length%O);h.set(u,0),a.enqueue(Oe(o,r,h,u.length,0))},async flush(r){const{et:a,st:o,ot:i,ready:c}=this;if(o&&a){await c;let l=ue;if(i.length){const u=a.update(re(T,i));o.update(u),l=se(T,u)}const f=se(T,o.digest()).slice(0,U);r.enqueue(j(l,f))}}})}}function Ee(t,e,n,s){B.assign(t,{ready:new ae(r=>t.nt=r),password:Lt(e,n),strength:s-1,ot:ue})}function Oe(t,e,n,s,r,a){const{et:o,st:i,ot:c}=t;c.length&&(e=j(c,e));const l=e.length-r;let f;for(n=(function(u,h){if(h&&h>u.length){const w=u;(u=new b(h)).set(w,0)}return u})(n,s+(l-l%O)),f=0;f<=l-O;f+=O){const u=re(T,A(e,f,f+O));a&&i.update(u);const h=o.update(u);a||i.update(h),n.set(se(T,h),f+s)}return t.ot=A(e,f),n}async function Ze(t,e,n,s){t.password=null;const r=await(async function(f,u,h,w,p){if(!Ve)return E.importKey(u);try{return await ne.importKey("raw",u,h,!1,p)}catch{return Ve=!1,E.importKey(u)}})(0,n,Mt,0,Dt),a=await(async function(f,u,h){if(!je)return E.T(u,f.salt,ke.iterations,h);try{return await ne.deriveBits(f,u,h)}catch{return je=!1,E.T(u,f.salt,ke.iterations,h)}})(B.assign({salt:s},ke),r,8*(2*te[e]+2)),o=new b(a),i=re(T,A(o,0,te[e])),c=re(T,A(o,te[e],2*te[e])),l=A(o,2*te[e]);return B.assign(t,{keys:{key:i,ct:c,passwordVerification:l},et:new Rt(new Ut(i),Pe.from(Tt)),st:new Wt(c)}),l}function Lt(t,e){return e===le?(function(n){if(typeof qe==Y){n=unescape(encodeURIComponent(n));const s=new b(n.length);for(let r=0;r<s.length;r++)s[r]=n.charCodeAt(r);return s}return new qe().encode(n)})(t):e}function A(t,e,n){return t.subarray(e,n)}function se(t,e){return t.v(e)}function re(t,e){return t.C(e)}class Vt extends v{constructor({password:e,rawPassword:n,passwordVerification:s,checkPasswordOnly:r}){super({start(){Ne(this,e,n,s)},transform(a,o){const i=this;if(i.password||i.rawPassword){const c=Xe(i,a.subarray(0,12));if(i.password=i.rawPassword=null,(c[11]^i.passwordVerification)!=0)throw new S(Ue);a=a.subarray(12)}r?o.error(new S(We)):o.enqueue(Xe(i,a))}})}}class jt extends v{constructor({password:e,rawPassword:n,passwordVerification:s}){super({start(){Ne(this,e,n,s)},transform(r,a){const o=this;let i,c;if(o.password||o.rawPassword){o.password=o.rawPassword=null;const l=xe(new b(12));l[11]=o.passwordVerification,i=new b(r.length+l.length),i.set(Ge(o,l),0),c=12}else i=new b(r.length),c=0;i.set(Ge(o,r),c),a.enqueue(i)}})}}function Ne(t,e,n,s){B.assign(t,{password:e,rawPassword:n,passwordVerification:s}),(function(r,a,o){const i=[305419896,591751049,878082192];if(B.assign(r,{keys:i,it:new fe(i[0]),ft:new fe(i[2])}),o)for(let c=0;c<o.length;c++)pe(r,o[c]);else for(let c=0;c<a.length;c++)pe(r,a.charCodeAt(c))})(t,e,n)}function Xe(t,e){const n=new b(e.length);for(let s=0;s<e.length;s++)n[s]=He(t)^e[s],pe(t,n[s]);return n}function Ge(t,e){const n=new b(e.length);for(let s=0;s<e.length;s++)n[s]=He(t)^e[s],pe(t,e[s]);return n}function pe(t,e){let[,n]=t.keys;t.it.append([e]);const s=~t.it.get();n=Ye(D.imul(Ye(n+Je(s)),134775813)+1),t.ft.append([n>>>24]);const r=~t.ft.get();t.keys=[s,n,r]}function He(t){const e=2|t.keys[2];return Je(D.imul(e,1^e)>>>8)}function Je(t){return 255&t}function Ye(t){return 4294967295&t}function $e(t){if(t instanceof ce)return t;const e=t.getReader();return new ce({async pull(n){const{value:s,done:r}=await e.read();r?n.close():n.enqueue(s)},cancel:n=>e.cancel(n)})}const ze=new H;function Qe(t){return ze.get(t)}const et="Invalid uncompressed size",Et=Re,tt="deflate-raw",ve="gzip",Ot=[31,139,8];class Zt extends v{constructor(e,{chunkSize:n,CompressionStreamFallback:s,CompressionStream:r}){super({});const{compressed:a,encrypted:o,useCompressionStream:i,zipCrypto:c,computeCrc32:l,level:f,deflate64:u,format:h,compressionMethod:w,inputSize:p}=e,d=this;let m,z,y,g=super.readable;const I=h&&Qe(h),F=l&&a&&!u&&!I&&(!o||c)&&!!(i&&r);if(o&&!c||!l||F||(m=new De,g=P(g,m)),a)if(I)g=Z(g,ot(I.CompressionStream,h,{level:f,chunkSize:n,compressionMethod:w,uncompressedSize:p}));else if(F)y=new nt,g=Z(g,new r(ve)),g=P(g,y);else try{g=it(g,i,{level:f,chunkSize:n},r,s)}catch(q){let x;try{x=new r(ve)}catch{throw q}g=Z(g,x),g=P(g,new nt)}o&&(c?g=P(g,new jt(e)):(z=new Kt(e),g=P(g,z))),rt(d,g,()=>{o&&!c||!l||(d.crc32=F?y.crc32:new L(m.value.buffer).getUint32(0))})}}class nt extends v{constructor(){let e,n=10,s=new b(0);super({transform(r,a){if(n){const l=D.min(n,r.length);if(n-=l,!(r=r.subarray(l)).length)return}const o=s.length+r.length;if(o<=8)return void(s=j(s,r));const i=o-8,c=D.min(i,s.length);a.enqueue(j(s.subarray(0,c),r.subarray(0,i-c))),s=j(s.subarray(c),r.subarray(i-c))},flush(){const r=Te(s);e.crc32=r.getUint32(0,!0),e.uncompressedSize=r.getUint32(4,!0)}}),e=this}}class Nt extends v{constructor(e,{chunkSize:n,DecompressionStreamFallback:s,DecompressionStream:r}){super({});const{zipCrypto:a,encrypted:o,checkCrc32:i,crc32:c,compressed:l,useCompressionStream:f,deflate64:u,format:h,compressionMethod:w,rawBitFlag:p,outputSize:d}=e;let m,z,y=super.readable;if(o&&(a?y=P(y,new Vt(e)):(z=new xt(e),y=P(y,z))),l){const g=h&&Qe(h);if(g)y=Z(y,ot(g.DecompressionStream,h,{chunkSize:n,compressionMethod:w,rawBitFlag:p,uncompressedSize:d}));else try{y=it(y,f,{chunkSize:n,deflate64:u},r,s)}catch(I){if(u||d===le)throw I;let F;try{F=new r(ve)}catch{throw I}y=(function(q,x,ie){const ye=new fe;let K,X,Se,dt=0,mt=!1;const gt=new ae((_,M)=>{X=_,Se=M});gt.catch(()=>{}),ie||X();const Yt=new v({start(_){const M=new b(10);M.set(Ot),_.enqueue(M)},transform(_,M){M.enqueue(_)},async flush(_){mt=!0,yt();try{await gt}finally{St()}const M=new b(8),bt=Te(M);bt.setUint32(0,ye.get(),!0),bt.setUint32(4,ie,!0),_.enqueue(M)},cancel(_){Se(_)}}),$t=new v({transform(_,M){ye.append(_),dt+=_.length,dt>=ie?X():mt&&yt(),M.enqueue(_)},cancel(_){Se(_)}});return q=P(q,Yt),P(q=Z(q,x),$t);function yt(){St(),K=setTimeout(()=>Se(new S(et)),5e3)}function St(){clearTimeout(K)}})(y,F,d)}y=(function(I){const F=I.getReader();return new ce({async pull(q){let x;try{x=await F.read()}catch(K){if(K&&K.message)throw K;const X=new S("Invalid compressed data");throw X.cause=K,X}const{value:ie,done:ye}=x;ye?q.close():q.enqueue(ie)},cancel:q=>F.cancel(q)})})(y)}i&&(m=new De,y=P(y,m)),rt(this,y,()=>{if(i){const g=new L(m.value.buffer);if(c!=g.getUint32(0,!1))throw new S(Et)}})}}const st=new H;function rt(t,e,n){e=P(e,new v({flush:n})),B.defineProperty(t,"readable",{get:()=>e})}function ot(t,e,n){if(!t)throw new S("Compression method not supported");return new t(e,n)}function it(t,e,n,s,r){const a=e&&s?s:r||s,o=n.deflate64?"deflate64-raw":tt;let i;try{i=new a(o,n)}catch(c){if(!e||!r||a==r)throw c;i=new r(o,n)}return Z(t,i)}function P(t,e){return $e(t).pipeThrough(e)}function Z(t,e){const n=e.writable.getWriter(),s=t.getReader();return(async function(){try{for(;;){await n.ready;const r=await s.read();if(r.done){await n.close();break}await n.write(r.value)}}catch(r){await(async function(a,o){try{await a.abort(o)}catch{}})(n,r),await(async function(a,o){try{await a.cancel(o)}catch{}})(s,r)}})(),e.readable}const at="data",ct="close",lt="deflate";class Xt extends v{constructor(e,n){super({});const s=this,{codecType:r}=e;let a;r.startsWith(lt)?a=Zt:r.startsWith("inflate")&&(a=Nt),s.outputSize=0;let o=0;const i=new a(e,n),c=super.readable,l=new v({transform(u,h){u&&u.length&&(o+=u.length,h.enqueue(u))},flush(){B.assign(s,{inputSize:o})}}),f=new v({transform(u,h){if(u&&u.length&&(h.enqueue(u),s.outputSize+=u.length,e.outputSize!==le&&s.outputSize>e.outputSize))throw new S(et)},flush(){const{crc32:u}=i;B.assign(s,{crc32:u,inputSize:o})}});B.defineProperty(s,"readable",{get:()=>c.pipeThrough(l).pipeThrough(i).pipeThrough(f)})}}class Gt extends v{constructor(e){const n=[];let s=0;function r(){const a=new b(e);let o=0;for(;o<e;){const i=n[0],c=e-o;i.length<=c?(a.set(i,o),o+=i.length,n.shift()):(a.set(i.subarray(0,c),o),n[0]=i.subarray(c),o+=c)}return s-=e,a}(!G.isFinite(e)||e<1)&&(e=65536),super({transform(a,o){for(n.push(a),s+=a.length;s>e;)o.enqueue(r())},flush(a){s&&a.enqueue((function(o,i){const c=new b(i);let l=0;for(const f of o)c.set(f,l),l+=f.length;return c})(n,s))}})}}let Ht=2;try{typeof navigator!=Y&&navigator.hardwareConcurrency&&(Ht=navigator.hardwareConcurrency)}catch{}const Ce=new H,_e=new H;let Ae,W=0;async function Jt(t){let e,n;try{const{options:s,config:r}=t;if(s.format)try{await(async function(u,h){!ze.has(u)&&h&&(function(w,p){const{CompressionStream:d,DecompressionStream:m}=p;if(typeof d!=$&&typeof m!=$)throw new S("Invalid codec module");ze.set(w,{CompressionStream:d,DecompressionStream:m})})(u,await import(h))})(s.format,s.codecURI)}catch(u){throw u.codecImportFailed=!0,u}if(r.CompressionStream=self.CompressionStream,r.DecompressionStream=self.DecompressionStream,s.compressed&&!s.format)if(s.useCompressionStream){if(!(function(u,h){if(!u)return!1;let w=st.get(u);w||(w=new H,st.set(u,w));let p=w.get(h);if(p===le){try{new u(h),p=!0}catch{p=!1}w.set(h,p)}return p})(s.codecType.startsWith(lt)?r.CompressionStream:r.DecompressionStream,tt))try{await self.initModule(t.config)}catch{}}else try{await self.initModule(t.config)}catch{s.useCompressionStream=!0}!r.CompressionStreamFallback&&r.CompressionStreamZlib&&(r.CompressionStreamFallback=r.CompressionStreamZlib),!r.DecompressionStreamFallback&&r.DecompressionStreamZlib&&(r.DecompressionStreamFallback=r.DecompressionStreamZlib);const a={highWaterMark:1},o=t.readable?$e(t.readable):new ce({async pull(u){const h=new ae(d=>Ce.set(W,d));Ie({type:"pull",messageId:W}),W=(W+1)%G.MAX_SAFE_INTEGER;const{value:w,done:p}=await h;u.enqueue(w),p&&u.close()}},a);n=t.writable?(function(u){if(u instanceof be)return u;const h=u.getWriter();return new be({write:w=>h.write(w),close:()=>h.close(),abort:w=>h.abort(w)})})(t.writable):new be({async write(u){let h;const w=new ae(p=>h=p);_e.set(W,h),Ie({type:at,value:u,messageId:W}),W=(W+1)%G.MAX_SAFE_INTEGER,await w}},a),e=new Xt(s,r),Ae=new AbortController;const{signal:i}=Ae;await o.pipeThrough(e).pipeThrough(new Gt((function(u){return w=typeof(h=w=u.chunkSize)=="string"&&h.trim()?G(h):h,G.isInteger(w)&&w>=1?D.max(w,64):65536;var h,w})(r))).pipeTo(n,{signal:i,preventClose:!0,preventAbort:!0}),await n.getWriter().close();const{crc32:c,inputSize:l,outputSize:f}=e;Ie({type:ct,result:{crc32:c,inputSize:l,outputSize:f}})}catch(s){if(s.outputSize=e?e.outputSize:0,n&&!n.locked)try{await n.getWriter().close()}catch{}ut(s)}}function Ie(t){const{value:e}=t;if(e)if(e.length)try{t.value=(n=e,n.byteOffset||n.byteLength!=n.buffer.byteLength?new b(n):n).buffer,V(t,[t.value])}catch{V(t)}else V(t);else V(t);var n}function ut(t=new S("Unknown error")){const{message:e,stack:n,code:s,name:r,outputSize:a,cause:o,codecImportFailed:i}=t,c={message:e,stack:n,code:s,name:r,outputSize:a};o&&(c.cause={name:o.name,message:o.message}),i&&(c.codecImportFailed=!0),V({error:c})}addEventListener("message",({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if(e=="start"&&Jt(t),e==at){const a=Ce.get(n);Ce.delete(n),a({value:s||new b,done:r})}if(e=="ack"){const a=_e.get(n);_e.delete(n),a()}e==ct&&Ae.abort()}catch(a){ut(a)}}),V({type:"ready"});const de="deflate",me="deflate-raw",ft="deflate64-raw",ge="gzip";let k,N,R,oe,ht;function wt(t,e,n={}){if(!k){const i=new S("WASM module not loaded");throw i.cause=ht,i}const s=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:65536,a=typeof n.inBufferSize=="number"?n.inBufferSize:65536;return new v({start(){try{let i;if(this.ut=N(r),this.in=N(a),this.inBufferSize=a,!this.ut||!this.in)throw new S("allocation failed");if(this.lt=new b(r),t?(this.wt=k.deflate_process,this.ht=k.deflate_last_consumed,this.yt=k.deflate_end,this.St=k.deflate_new(),i=e===ge?k.deflate_init_gzip(this.St,s):e===me?k.deflate_init_raw(this.St,s):k.deflate_init(this.St,s)):e===ft?(this.wt=k.inflate9_process,this.ht=k.inflate9_last_consumed,this.yt=k.inflate9_end,this.St=k.inflate9_new(),i=k.inflate9_init_raw(this.St)):(this.wt=k.inflate_process,this.ht=k.inflate_last_consumed,this.yt=k.inflate_end,this.St=k.inflate_new(),i=e===me?k.inflate_init_raw(this.St):e===ge?k.inflate_init_gzip(this.St):k.inflate_init(this.St)),i!==0)throw new S("init failed:"+i)}catch(i){throw o(this),i}},transform(i,c){try{const l=i,f=new b(oe.buffer),u=this.wt,h=this.ht,w=this.ut,p=this.lt;let d=0;for(;d<l.length;){const m=D.min(l.length-d,32768);if((!this.in||this.inBufferSize<m)&&(this.in&&R&&(R(this.in),this.in=0),this.in=N(m),this.inBufferSize=m,!this.in))throw new S("allocation failed");f.set(l.subarray(d,d+m),this.in);const z=u(this.St,this.in,m,w,r,0),y=16777215&z;if(y&&(p.set(f.subarray(w,w+y),0),c.enqueue(p.slice(0,y))),!t){const I=z>>24&255,F=128&I?I-256:I;if(F<0)throw new S("process error:"+F)}const g=h(this.St);if(g===0)break;d+=g}}catch(l){o(this),c.error(l)}},flush(i){try{const c=new b(oe.buffer),l=this.wt,f=this.ut,u=this.lt;for(;;){const h=l(this.St,0,0,f,r,4),w=16777215&h,p=h>>24&255;if(!t){const d=128&p?p-256:p;if(d<0)throw new S("process error:"+d)}if(w&&(u.set(c.subarray(f,f+w),0),i.enqueue(u.slice(0,w))),p===1||w===0)break}}catch(c){i.error(c)}finally{const c=o(this);c!==0&&i.error(new S("end error:"+c))}},cancel(){o(this)}});function o(i){let c=0;return i.St&&i.yt&&(c=i.yt(i.St)),i.St=0,i.in&&R&&R(i.in),i.in=0,i.ut&&R&&R(i.ut),i.ut=0,c}}class Fe{constructor(e=de,n){return wt(!0,e,n)}}class Be{constructor(e=de,n){return wt(!1,e,n)}}Fe.gt=!0,Be.gt=!0,Fe.vt=[de,me,ge],Be.vt=[de,me,ge,ft];let pt=!1;(function(t={}){const{init:e}=t,n=t.CompressionStreamFallback||t.CompressionStreamZlib,s=t.DecompressionStreamFallback||t.DecompressionStreamZlib;self.initModule=async r=>{e&&await e(r),n&&(r.CompressionStreamFallback=n),s&&(r.DecompressionStreamFallback=s)}})({CompressionStreamFallback:Fe,DecompressionStreamFallback:Be,init:t=>(async function(e,{baseURI:n}){if(!pt)try{await(async function(s,r){let a,o;try{try{o=new URL(s,r)}catch{}a=await(await fetch(o)).arrayBuffer()}catch(i){if(!s.startsWith("data:application/wasm;base64,"))throw i;a=(function(c){const l=c.split(",")[1],f=atob(l),u=f.length,h=new b(u);for(let w=0;w<u;++w)h[w]=f.charCodeAt(w);return h.buffer})(s)}(function(i){if(k=i,{malloc:N,free:R,memory:oe}=k,typeof N!="function"||typeof R!="function"||!oe)throw k=N=R=oe=null,new S("Invalid WASM module")})((await WebAssembly.instantiate(a)).instance.exports)})(e,n),pt=!0}catch(s){throw(function(r){ht=r})(s),s}})(t.wasmURI,t)})})(); diff --git a/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js b/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js index 8aa2fa2c4..2fcff8006 100644 --- a/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js +++ b/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js @@ -1,2 +1,2 @@ -(()=>{window.cesiumGoogleEarthDbRootParser=function(d){"use strict";var f=d.Reader,u=d.util,n=d.roots.default||(d.roots.default={});return n.keyhole=function(){var b={};return b.dbroot=function(){var c={};return c.StringEntryProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.stringId=0,i.prototype.stringValue="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StringEntryProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.stringId=r.fixed32();break}case 2:{o.stringValue=r.string();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("stringId"))throw u.ProtocolError("missing required 'stringId'",{instance:o});if(!o.hasOwnProperty("stringValue"))throw u.ProtocolError("missing required 'stringValue'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isInteger(r.stringId)?u.isString(r.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StringEntryProto)return r;var t=new n.keyhole.dbroot.StringEntryProto;return r.stringId!=null&&(t.stringId=r.stringId>>>0),r.stringValue!=null&&(t.stringValue=String(r.stringValue)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.stringId=0,e.stringValue=""),r.stringId!=null&&r.hasOwnProperty("stringId")&&(e.stringId=r.stringId),r.stringValue!=null&&r.hasOwnProperty("stringValue")&&(e.stringValue=r.stringValue),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StringEntryProto"},i}(),c.StringIdOrValueProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.stringId=0,i.prototype.value="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StringIdOrValueProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.stringId=r.fixed32();break}case 2:{o.value=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.stringId!=null&&r.hasOwnProperty("stringId")&&!u.isInteger(r.stringId)?"stringId: integer expected":r.value!=null&&r.hasOwnProperty("value")&&!u.isString(r.value)?"value: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StringIdOrValueProto)return r;var t=new n.keyhole.dbroot.StringIdOrValueProto;return r.stringId!=null&&(t.stringId=r.stringId>>>0),r.value!=null&&(t.value=String(r.value)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.stringId=0,e.value=""),r.stringId!=null&&r.hasOwnProperty("stringId")&&(e.stringId=r.stringId),r.value!=null&&r.hasOwnProperty("value")&&(e.value=r.value),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StringIdOrValueProto"},i}(),c.PlanetModelProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.radius=6378.137,i.prototype.flattening=.00335281066474748,i.prototype.elevationBias=0,i.prototype.negativeAltitudeExponentBias=0,i.prototype.compressedNegativeAltitudeThreshold=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PlanetModelProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.radius=r.double();break}case 2:{o.flattening=r.double();break}case 4:{o.elevationBias=r.double();break}case 5:{o.negativeAltitudeExponentBias=r.int32();break}case 6:{o.compressedNegativeAltitudeThreshold=r.double();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.radius!=null&&r.hasOwnProperty("radius")&&typeof r.radius!="number"?"radius: number expected":r.flattening!=null&&r.hasOwnProperty("flattening")&&typeof r.flattening!="number"?"flattening: number expected":r.elevationBias!=null&&r.hasOwnProperty("elevationBias")&&typeof r.elevationBias!="number"?"elevationBias: number expected":r.negativeAltitudeExponentBias!=null&&r.hasOwnProperty("negativeAltitudeExponentBias")&&!u.isInteger(r.negativeAltitudeExponentBias)?"negativeAltitudeExponentBias: integer expected":r.compressedNegativeAltitudeThreshold!=null&&r.hasOwnProperty("compressedNegativeAltitudeThreshold")&&typeof r.compressedNegativeAltitudeThreshold!="number"?"compressedNegativeAltitudeThreshold: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PlanetModelProto)return r;var t=new n.keyhole.dbroot.PlanetModelProto;return r.radius!=null&&(t.radius=Number(r.radius)),r.flattening!=null&&(t.flattening=Number(r.flattening)),r.elevationBias!=null&&(t.elevationBias=Number(r.elevationBias)),r.negativeAltitudeExponentBias!=null&&(t.negativeAltitudeExponentBias=r.negativeAltitudeExponentBias|0),r.compressedNegativeAltitudeThreshold!=null&&(t.compressedNegativeAltitudeThreshold=Number(r.compressedNegativeAltitudeThreshold)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.radius=6378.137,e.flattening=.00335281066474748,e.elevationBias=0,e.negativeAltitudeExponentBias=0,e.compressedNegativeAltitudeThreshold=0),r.radius!=null&&r.hasOwnProperty("radius")&&(e.radius=t.json&&!isFinite(r.radius)?String(r.radius):r.radius),r.flattening!=null&&r.hasOwnProperty("flattening")&&(e.flattening=t.json&&!isFinite(r.flattening)?String(r.flattening):r.flattening),r.elevationBias!=null&&r.hasOwnProperty("elevationBias")&&(e.elevationBias=t.json&&!isFinite(r.elevationBias)?String(r.elevationBias):r.elevationBias),r.negativeAltitudeExponentBias!=null&&r.hasOwnProperty("negativeAltitudeExponentBias")&&(e.negativeAltitudeExponentBias=r.negativeAltitudeExponentBias),r.compressedNegativeAltitudeThreshold!=null&&r.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(e.compressedNegativeAltitudeThreshold=t.json&&!isFinite(r.compressedNegativeAltitudeThreshold)?String(r.compressedNegativeAltitudeThreshold):r.compressedNegativeAltitudeThreshold),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PlanetModelProto"},i}(),c.ProviderInfoProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.providerId=0,i.prototype.copyrightString=null,i.prototype.verticalPixelOffset=-1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ProviderInfoProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.providerId=r.int32();break}case 2:{o.copyrightString=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.verticalPixelOffset=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("providerId"))throw u.ProtocolError("missing required 'providerId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isInteger(r.providerId))return"providerId: integer expected";if(r.copyrightString!=null&&r.hasOwnProperty("copyrightString")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.copyrightString);if(t)return"copyrightString."+t}return r.verticalPixelOffset!=null&&r.hasOwnProperty("verticalPixelOffset")&&!u.isInteger(r.verticalPixelOffset)?"verticalPixelOffset: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ProviderInfoProto)return r;var t=new n.keyhole.dbroot.ProviderInfoProto;if(r.providerId!=null&&(t.providerId=r.providerId|0),r.copyrightString!=null){if(typeof r.copyrightString!="object")throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");t.copyrightString=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.copyrightString)}return r.verticalPixelOffset!=null&&(t.verticalPixelOffset=r.verticalPixelOffset|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.providerId=0,e.copyrightString=null,e.verticalPixelOffset=-1),r.providerId!=null&&r.hasOwnProperty("providerId")&&(e.providerId=r.providerId),r.copyrightString!=null&&r.hasOwnProperty("copyrightString")&&(e.copyrightString=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.copyrightString,t)),r.verticalPixelOffset!=null&&r.hasOwnProperty("verticalPixelOffset")&&(e.verticalPixelOffset=r.verticalPixelOffset),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ProviderInfoProto"},i}(),c.PopUpProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.isBalloonStyle=!1,i.prototype.text=null,i.prototype.backgroundColorAbgr=4294967295,i.prototype.textColorAbgr=4278190080,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PopUpProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.isBalloonStyle=r.bool();break}case 2:{o.text=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.backgroundColorAbgr=r.fixed32();break}case 4:{o.textColorAbgr=r.fixed32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.isBalloonStyle!=null&&r.hasOwnProperty("isBalloonStyle")&&typeof r.isBalloonStyle!="boolean")return"isBalloonStyle: boolean expected";if(r.text!=null&&r.hasOwnProperty("text")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.text);if(t)return"text."+t}return r.backgroundColorAbgr!=null&&r.hasOwnProperty("backgroundColorAbgr")&&!u.isInteger(r.backgroundColorAbgr)?"backgroundColorAbgr: integer expected":r.textColorAbgr!=null&&r.hasOwnProperty("textColorAbgr")&&!u.isInteger(r.textColorAbgr)?"textColorAbgr: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PopUpProto)return r;var t=new n.keyhole.dbroot.PopUpProto;if(r.isBalloonStyle!=null&&(t.isBalloonStyle=!!r.isBalloonStyle),r.text!=null){if(typeof r.text!="object")throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");t.text=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.text)}return r.backgroundColorAbgr!=null&&(t.backgroundColorAbgr=r.backgroundColorAbgr>>>0),r.textColorAbgr!=null&&(t.textColorAbgr=r.textColorAbgr>>>0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.isBalloonStyle=!1,e.text=null,e.backgroundColorAbgr=4294967295,e.textColorAbgr=4278190080),r.isBalloonStyle!=null&&r.hasOwnProperty("isBalloonStyle")&&(e.isBalloonStyle=r.isBalloonStyle),r.text!=null&&r.hasOwnProperty("text")&&(e.text=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.text,t)),r.backgroundColorAbgr!=null&&r.hasOwnProperty("backgroundColorAbgr")&&(e.backgroundColorAbgr=r.backgroundColorAbgr),r.textColorAbgr!=null&&r.hasOwnProperty("textColorAbgr")&&(e.textColorAbgr=r.textColorAbgr),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PopUpProto"},i}(),c.StyleAttributeProto=function(){function i(l){if(this.drawFlag=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.styleId="",i.prototype.providerId=0,i.prototype.polyColorAbgr=4294967295,i.prototype.lineColorAbgr=4294967295,i.prototype.lineWidth=1,i.prototype.labelColorAbgr=4294967295,i.prototype.labelScale=1,i.prototype.placemarkIconColorAbgr=4294967295,i.prototype.placemarkIconScale=1,i.prototype.placemarkIconPath=null,i.prototype.placemarkIconX=0,i.prototype.placemarkIconY=0,i.prototype.placemarkIconWidth=32,i.prototype.placemarkIconHeight=32,i.prototype.popUp=null,i.prototype.drawFlag=u.emptyArray,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StyleAttributeProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.styleId=r.string();break}case 3:{o.providerId=r.int32();break}case 4:{o.polyColorAbgr=r.fixed32();break}case 5:{o.lineColorAbgr=r.fixed32();break}case 6:{o.lineWidth=r.float();break}case 7:{o.labelColorAbgr=r.fixed32();break}case 8:{o.labelScale=r.float();break}case 9:{o.placemarkIconColorAbgr=r.fixed32();break}case 10:{o.placemarkIconScale=r.float();break}case 11:{o.placemarkIconPath=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 12:{o.placemarkIconX=r.int32();break}case 13:{o.placemarkIconY=r.int32();break}case 14:{o.placemarkIconWidth=r.int32();break}case 15:{o.placemarkIconHeight=r.int32();break}case 16:{o.popUp=n.keyhole.dbroot.PopUpProto.decode(r,r.uint32());break}case 17:{o.drawFlag&&o.drawFlag.length||(o.drawFlag=[]),o.drawFlag.push(n.keyhole.dbroot.DrawFlagProto.decode(r,r.uint32()));break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("styleId"))throw u.ProtocolError("missing required 'styleId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.styleId))return"styleId: string expected";if(r.providerId!=null&&r.hasOwnProperty("providerId")&&!u.isInteger(r.providerId))return"providerId: integer expected";if(r.polyColorAbgr!=null&&r.hasOwnProperty("polyColorAbgr")&&!u.isInteger(r.polyColorAbgr))return"polyColorAbgr: integer expected";if(r.lineColorAbgr!=null&&r.hasOwnProperty("lineColorAbgr")&&!u.isInteger(r.lineColorAbgr))return"lineColorAbgr: integer expected";if(r.lineWidth!=null&&r.hasOwnProperty("lineWidth")&&typeof r.lineWidth!="number")return"lineWidth: number expected";if(r.labelColorAbgr!=null&&r.hasOwnProperty("labelColorAbgr")&&!u.isInteger(r.labelColorAbgr))return"labelColorAbgr: integer expected";if(r.labelScale!=null&&r.hasOwnProperty("labelScale")&&typeof r.labelScale!="number")return"labelScale: number expected";if(r.placemarkIconColorAbgr!=null&&r.hasOwnProperty("placemarkIconColorAbgr")&&!u.isInteger(r.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(r.placemarkIconScale!=null&&r.hasOwnProperty("placemarkIconScale")&&typeof r.placemarkIconScale!="number")return"placemarkIconScale: number expected";if(r.placemarkIconPath!=null&&r.hasOwnProperty("placemarkIconPath")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.placemarkIconPath);if(t)return"placemarkIconPath."+t}if(r.placemarkIconX!=null&&r.hasOwnProperty("placemarkIconX")&&!u.isInteger(r.placemarkIconX))return"placemarkIconX: integer expected";if(r.placemarkIconY!=null&&r.hasOwnProperty("placemarkIconY")&&!u.isInteger(r.placemarkIconY))return"placemarkIconY: integer expected";if(r.placemarkIconWidth!=null&&r.hasOwnProperty("placemarkIconWidth")&&!u.isInteger(r.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(r.placemarkIconHeight!=null&&r.hasOwnProperty("placemarkIconHeight")&&!u.isInteger(r.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(r.popUp!=null&&r.hasOwnProperty("popUp")){var t=n.keyhole.dbroot.PopUpProto.verify(r.popUp);if(t)return"popUp."+t}if(r.drawFlag!=null&&r.hasOwnProperty("drawFlag")){if(!Array.isArray(r.drawFlag))return"drawFlag: array expected";for(var e=0;e<r.drawFlag.length;++e){var t=n.keyhole.dbroot.DrawFlagProto.verify(r.drawFlag[e]);if(t)return"drawFlag."+t}}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StyleAttributeProto)return r;var t=new n.keyhole.dbroot.StyleAttributeProto;if(r.styleId!=null&&(t.styleId=String(r.styleId)),r.providerId!=null&&(t.providerId=r.providerId|0),r.polyColorAbgr!=null&&(t.polyColorAbgr=r.polyColorAbgr>>>0),r.lineColorAbgr!=null&&(t.lineColorAbgr=r.lineColorAbgr>>>0),r.lineWidth!=null&&(t.lineWidth=Number(r.lineWidth)),r.labelColorAbgr!=null&&(t.labelColorAbgr=r.labelColorAbgr>>>0),r.labelScale!=null&&(t.labelScale=Number(r.labelScale)),r.placemarkIconColorAbgr!=null&&(t.placemarkIconColorAbgr=r.placemarkIconColorAbgr>>>0),r.placemarkIconScale!=null&&(t.placemarkIconScale=Number(r.placemarkIconScale)),r.placemarkIconPath!=null){if(typeof r.placemarkIconPath!="object")throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");t.placemarkIconPath=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.placemarkIconPath)}if(r.placemarkIconX!=null&&(t.placemarkIconX=r.placemarkIconX|0),r.placemarkIconY!=null&&(t.placemarkIconY=r.placemarkIconY|0),r.placemarkIconWidth!=null&&(t.placemarkIconWidth=r.placemarkIconWidth|0),r.placemarkIconHeight!=null&&(t.placemarkIconHeight=r.placemarkIconHeight|0),r.popUp!=null){if(typeof r.popUp!="object")throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");t.popUp=n.keyhole.dbroot.PopUpProto.fromObject(r.popUp)}if(r.drawFlag){if(!Array.isArray(r.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");t.drawFlag=[];for(var e=0;e<r.drawFlag.length;++e){if(typeof r.drawFlag[e]!="object")throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");t.drawFlag[e]=n.keyhole.dbroot.DrawFlagProto.fromObject(r.drawFlag[e])}}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.drawFlag=[]),t.defaults&&(e.styleId="",e.providerId=0,e.polyColorAbgr=4294967295,e.lineColorAbgr=4294967295,e.lineWidth=1,e.labelColorAbgr=4294967295,e.labelScale=1,e.placemarkIconColorAbgr=4294967295,e.placemarkIconScale=1,e.placemarkIconPath=null,e.placemarkIconX=0,e.placemarkIconY=0,e.placemarkIconWidth=32,e.placemarkIconHeight=32,e.popUp=null),r.styleId!=null&&r.hasOwnProperty("styleId")&&(e.styleId=r.styleId),r.providerId!=null&&r.hasOwnProperty("providerId")&&(e.providerId=r.providerId),r.polyColorAbgr!=null&&r.hasOwnProperty("polyColorAbgr")&&(e.polyColorAbgr=r.polyColorAbgr),r.lineColorAbgr!=null&&r.hasOwnProperty("lineColorAbgr")&&(e.lineColorAbgr=r.lineColorAbgr),r.lineWidth!=null&&r.hasOwnProperty("lineWidth")&&(e.lineWidth=t.json&&!isFinite(r.lineWidth)?String(r.lineWidth):r.lineWidth),r.labelColorAbgr!=null&&r.hasOwnProperty("labelColorAbgr")&&(e.labelColorAbgr=r.labelColorAbgr),r.labelScale!=null&&r.hasOwnProperty("labelScale")&&(e.labelScale=t.json&&!isFinite(r.labelScale)?String(r.labelScale):r.labelScale),r.placemarkIconColorAbgr!=null&&r.hasOwnProperty("placemarkIconColorAbgr")&&(e.placemarkIconColorAbgr=r.placemarkIconColorAbgr),r.placemarkIconScale!=null&&r.hasOwnProperty("placemarkIconScale")&&(e.placemarkIconScale=t.json&&!isFinite(r.placemarkIconScale)?String(r.placemarkIconScale):r.placemarkIconScale),r.placemarkIconPath!=null&&r.hasOwnProperty("placemarkIconPath")&&(e.placemarkIconPath=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.placemarkIconPath,t)),r.placemarkIconX!=null&&r.hasOwnProperty("placemarkIconX")&&(e.placemarkIconX=r.placemarkIconX),r.placemarkIconY!=null&&r.hasOwnProperty("placemarkIconY")&&(e.placemarkIconY=r.placemarkIconY),r.placemarkIconWidth!=null&&r.hasOwnProperty("placemarkIconWidth")&&(e.placemarkIconWidth=r.placemarkIconWidth),r.placemarkIconHeight!=null&&r.hasOwnProperty("placemarkIconHeight")&&(e.placemarkIconHeight=r.placemarkIconHeight),r.popUp!=null&&r.hasOwnProperty("popUp")&&(e.popUp=n.keyhole.dbroot.PopUpProto.toObject(r.popUp,t)),r.drawFlag&&r.drawFlag.length){e.drawFlag=[];for(var o=0;o<r.drawFlag.length;++o)e.drawFlag[o]=n.keyhole.dbroot.DrawFlagProto.toObject(r.drawFlag[o],t)}return e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StyleAttributeProto"},i}(),c.StyleMapProto=function(){function i(l){if(this.channelId=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.styleMapId=0,i.prototype.channelId=u.emptyArray,i.prototype.normalStyleAttribute=0,i.prototype.highlightStyleAttribute=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StyleMapProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.styleMapId=r.int32();break}case 2:{if(o.channelId&&o.channelId.length||(o.channelId=[]),(a&7)===2)for(var p=r.uint32()+r.pos;r.pos<p;)o.channelId.push(r.int32());else o.channelId.push(r.int32());break}case 3:{o.normalStyleAttribute=r.int32();break}case 4:{o.highlightStyleAttribute=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("styleMapId"))throw u.ProtocolError("missing required 'styleMapId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isInteger(r.styleMapId))return"styleMapId: integer expected";if(r.channelId!=null&&r.hasOwnProperty("channelId")){if(!Array.isArray(r.channelId))return"channelId: array expected";for(var t=0;t<r.channelId.length;++t)if(!u.isInteger(r.channelId[t]))return"channelId: integer[] expected"}return r.normalStyleAttribute!=null&&r.hasOwnProperty("normalStyleAttribute")&&!u.isInteger(r.normalStyleAttribute)?"normalStyleAttribute: integer expected":r.highlightStyleAttribute!=null&&r.hasOwnProperty("highlightStyleAttribute")&&!u.isInteger(r.highlightStyleAttribute)?"highlightStyleAttribute: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StyleMapProto)return r;var t=new n.keyhole.dbroot.StyleMapProto;if(r.styleMapId!=null&&(t.styleMapId=r.styleMapId|0),r.channelId){if(!Array.isArray(r.channelId))throw TypeError(".keyhole.dbroot.StyleMapProto.channelId: array expected");t.channelId=[];for(var e=0;e<r.channelId.length;++e)t.channelId[e]=r.channelId[e]|0}return r.normalStyleAttribute!=null&&(t.normalStyleAttribute=r.normalStyleAttribute|0),r.highlightStyleAttribute!=null&&(t.highlightStyleAttribute=r.highlightStyleAttribute|0),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.channelId=[]),t.defaults&&(e.styleMapId=0,e.normalStyleAttribute=0,e.highlightStyleAttribute=0),r.styleMapId!=null&&r.hasOwnProperty("styleMapId")&&(e.styleMapId=r.styleMapId),r.channelId&&r.channelId.length){e.channelId=[];for(var o=0;o<r.channelId.length;++o)e.channelId[o]=r.channelId[o]}return r.normalStyleAttribute!=null&&r.hasOwnProperty("normalStyleAttribute")&&(e.normalStyleAttribute=r.normalStyleAttribute),r.highlightStyleAttribute!=null&&r.hasOwnProperty("highlightStyleAttribute")&&(e.highlightStyleAttribute=r.highlightStyleAttribute),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StyleMapProto"},i}(),c.ZoomRangeProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.minZoom=0,i.prototype.maxZoom=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ZoomRangeProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.minZoom=r.int32();break}case 2:{o.maxZoom=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("minZoom"))throw u.ProtocolError("missing required 'minZoom'",{instance:o});if(!o.hasOwnProperty("maxZoom"))throw u.ProtocolError("missing required 'maxZoom'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isInteger(r.minZoom)?u.isInteger(r.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ZoomRangeProto)return r;var t=new n.keyhole.dbroot.ZoomRangeProto;return r.minZoom!=null&&(t.minZoom=r.minZoom|0),r.maxZoom!=null&&(t.maxZoom=r.maxZoom|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.minZoom=0,e.maxZoom=0),r.minZoom!=null&&r.hasOwnProperty("minZoom")&&(e.minZoom=r.minZoom),r.maxZoom!=null&&r.hasOwnProperty("maxZoom")&&(e.maxZoom=r.maxZoom),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ZoomRangeProto"},i}(),c.DrawFlagProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.drawFlagType=1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DrawFlagProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.drawFlagType=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("drawFlagType"))throw u.ProtocolError("missing required 'drawFlagType'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";switch(r.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:break}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DrawFlagProto)return r;var t=new n.keyhole.dbroot.DrawFlagProto;switch(r.drawFlagType){case"TYPE_FILL_ONLY":case 1:t.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:t.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:t.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:t.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:t.drawFlagType=5;break}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.drawFlagType=t.enums===String?"TYPE_FILL_ONLY":1),r.drawFlagType!=null&&r.hasOwnProperty("drawFlagType")&&(e.drawFlagType=t.enums===String?n.keyhole.dbroot.DrawFlagProto.DrawFlagType[r.drawFlagType]:r.drawFlagType),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DrawFlagProto"},i.DrawFlagType=function(){var l={},r=Object.create(l);return r[l[1]="TYPE_FILL_ONLY"]=1,r[l[2]="TYPE_OUTLINE_ONLY"]=2,r[l[3]="TYPE_FILL_AND_OUTLINE"]=3,r[l[4]="TYPE_ANTIALIASING"]=4,r[l[5]="TYPE_CENTER_LABEL"]=5,r}(),i}(),c.LayerProto=function(){function i(l){if(this.zoomRange=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.zoomRange=u.emptyArray,i.prototype.preserveTextLevel=30,i.prototype.lodBeginTransition=!1,i.prototype.lodEndTransition=!1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.LayerProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.zoomRange&&o.zoomRange.length||(o.zoomRange=[]),o.zoomRange.push(n.keyhole.dbroot.ZoomRangeProto.decode(r,r.uint32()));break}case 2:{o.preserveTextLevel=r.int32();break}case 4:{o.lodBeginTransition=r.bool();break}case 5:{o.lodEndTransition=r.bool();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.zoomRange!=null&&r.hasOwnProperty("zoomRange")){if(!Array.isArray(r.zoomRange))return"zoomRange: array expected";for(var t=0;t<r.zoomRange.length;++t){var e=n.keyhole.dbroot.ZoomRangeProto.verify(r.zoomRange[t]);if(e)return"zoomRange."+e}}return r.preserveTextLevel!=null&&r.hasOwnProperty("preserveTextLevel")&&!u.isInteger(r.preserveTextLevel)?"preserveTextLevel: integer expected":r.lodBeginTransition!=null&&r.hasOwnProperty("lodBeginTransition")&&typeof r.lodBeginTransition!="boolean"?"lodBeginTransition: boolean expected":r.lodEndTransition!=null&&r.hasOwnProperty("lodEndTransition")&&typeof r.lodEndTransition!="boolean"?"lodEndTransition: boolean expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.LayerProto)return r;var t=new n.keyhole.dbroot.LayerProto;if(r.zoomRange){if(!Array.isArray(r.zoomRange))throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: array expected");t.zoomRange=[];for(var e=0;e<r.zoomRange.length;++e){if(typeof r.zoomRange[e]!="object")throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: object expected");t.zoomRange[e]=n.keyhole.dbroot.ZoomRangeProto.fromObject(r.zoomRange[e])}}return r.preserveTextLevel!=null&&(t.preserveTextLevel=r.preserveTextLevel|0),r.lodBeginTransition!=null&&(t.lodBeginTransition=!!r.lodBeginTransition),r.lodEndTransition!=null&&(t.lodEndTransition=!!r.lodEndTransition),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.zoomRange=[]),t.defaults&&(e.preserveTextLevel=30,e.lodBeginTransition=!1,e.lodEndTransition=!1),r.zoomRange&&r.zoomRange.length){e.zoomRange=[];for(var o=0;o<r.zoomRange.length;++o)e.zoomRange[o]=n.keyhole.dbroot.ZoomRangeProto.toObject(r.zoomRange[o],t)}return r.preserveTextLevel!=null&&r.hasOwnProperty("preserveTextLevel")&&(e.preserveTextLevel=r.preserveTextLevel),r.lodBeginTransition!=null&&r.hasOwnProperty("lodBeginTransition")&&(e.lodBeginTransition=r.lodBeginTransition),r.lodEndTransition!=null&&r.hasOwnProperty("lodEndTransition")&&(e.lodEndTransition=r.lodEndTransition),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.LayerProto"},i}(),c.FolderProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.isExpandable=!0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.FolderProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.isExpandable=r.bool();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.isExpandable!=null&&r.hasOwnProperty("isExpandable")&&typeof r.isExpandable!="boolean"?"isExpandable: boolean expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.FolderProto)return r;var t=new n.keyhole.dbroot.FolderProto;return r.isExpandable!=null&&(t.isExpandable=!!r.isExpandable),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.isExpandable=!0),r.isExpandable!=null&&r.hasOwnProperty("isExpandable")&&(e.isExpandable=r.isExpandable),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.FolderProto"},i}(),c.RequirementProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.requiredVram="",i.prototype.requiredClientVer="",i.prototype.probability="",i.prototype.requiredUserAgent="",i.prototype.requiredClientCapabilities="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.RequirementProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 3:{o.requiredVram=r.string();break}case 4:{o.requiredClientVer=r.string();break}case 5:{o.probability=r.string();break}case 6:{o.requiredUserAgent=r.string();break}case 7:{o.requiredClientCapabilities=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.requiredVram!=null&&r.hasOwnProperty("requiredVram")&&!u.isString(r.requiredVram)?"requiredVram: string expected":r.requiredClientVer!=null&&r.hasOwnProperty("requiredClientVer")&&!u.isString(r.requiredClientVer)?"requiredClientVer: string expected":r.probability!=null&&r.hasOwnProperty("probability")&&!u.isString(r.probability)?"probability: string expected":r.requiredUserAgent!=null&&r.hasOwnProperty("requiredUserAgent")&&!u.isString(r.requiredUserAgent)?"requiredUserAgent: string expected":r.requiredClientCapabilities!=null&&r.hasOwnProperty("requiredClientCapabilities")&&!u.isString(r.requiredClientCapabilities)?"requiredClientCapabilities: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.RequirementProto)return r;var t=new n.keyhole.dbroot.RequirementProto;return r.requiredVram!=null&&(t.requiredVram=String(r.requiredVram)),r.requiredClientVer!=null&&(t.requiredClientVer=String(r.requiredClientVer)),r.probability!=null&&(t.probability=String(r.probability)),r.requiredUserAgent!=null&&(t.requiredUserAgent=String(r.requiredUserAgent)),r.requiredClientCapabilities!=null&&(t.requiredClientCapabilities=String(r.requiredClientCapabilities)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.requiredVram="",e.requiredClientVer="",e.probability="",e.requiredUserAgent="",e.requiredClientCapabilities=""),r.requiredVram!=null&&r.hasOwnProperty("requiredVram")&&(e.requiredVram=r.requiredVram),r.requiredClientVer!=null&&r.hasOwnProperty("requiredClientVer")&&(e.requiredClientVer=r.requiredClientVer),r.probability!=null&&r.hasOwnProperty("probability")&&(e.probability=r.probability),r.requiredUserAgent!=null&&r.hasOwnProperty("requiredUserAgent")&&(e.requiredUserAgent=r.requiredUserAgent),r.requiredClientCapabilities!=null&&r.hasOwnProperty("requiredClientCapabilities")&&(e.requiredClientCapabilities=r.requiredClientCapabilities),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.RequirementProto"},i}(),c.LookAtProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.longitude=0,i.prototype.latitude=0,i.prototype.range=0,i.prototype.tilt=0,i.prototype.heading=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.LookAtProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.longitude=r.float();break}case 2:{o.latitude=r.float();break}case 3:{o.range=r.float();break}case 4:{o.tilt=r.float();break}case 5:{o.heading=r.float();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("longitude"))throw u.ProtocolError("missing required 'longitude'",{instance:o});if(!o.hasOwnProperty("latitude"))throw u.ProtocolError("missing required 'latitude'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":typeof r.longitude!="number"?"longitude: number expected":typeof r.latitude!="number"?"latitude: number expected":r.range!=null&&r.hasOwnProperty("range")&&typeof r.range!="number"?"range: number expected":r.tilt!=null&&r.hasOwnProperty("tilt")&&typeof r.tilt!="number"?"tilt: number expected":r.heading!=null&&r.hasOwnProperty("heading")&&typeof r.heading!="number"?"heading: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.LookAtProto)return r;var t=new n.keyhole.dbroot.LookAtProto;return r.longitude!=null&&(t.longitude=Number(r.longitude)),r.latitude!=null&&(t.latitude=Number(r.latitude)),r.range!=null&&(t.range=Number(r.range)),r.tilt!=null&&(t.tilt=Number(r.tilt)),r.heading!=null&&(t.heading=Number(r.heading)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.longitude=0,e.latitude=0,e.range=0,e.tilt=0,e.heading=0),r.longitude!=null&&r.hasOwnProperty("longitude")&&(e.longitude=t.json&&!isFinite(r.longitude)?String(r.longitude):r.longitude),r.latitude!=null&&r.hasOwnProperty("latitude")&&(e.latitude=t.json&&!isFinite(r.latitude)?String(r.latitude):r.latitude),r.range!=null&&r.hasOwnProperty("range")&&(e.range=t.json&&!isFinite(r.range)?String(r.range):r.range),r.tilt!=null&&r.hasOwnProperty("tilt")&&(e.tilt=t.json&&!isFinite(r.tilt)?String(r.tilt):r.tilt),r.heading!=null&&r.hasOwnProperty("heading")&&(e.heading=t.json&&!isFinite(r.heading)?String(r.heading):r.heading),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.LookAtProto"},i}(),c.NestedFeatureProto=function(){function i(l){if(this.children=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.featureType=1,i.prototype.kmlUrl=null,i.prototype.databaseUrl="",i.prototype.layer=null,i.prototype.folder=null,i.prototype.requirement=null,i.prototype.channelId=0,i.prototype.displayName=null,i.prototype.isVisible=!0,i.prototype.isEnabled=!0,i.prototype.isChecked=!1,i.prototype.layerMenuIconPath="icons/773_l.png",i.prototype.description=null,i.prototype.lookAt=null,i.prototype.assetUuid="",i.prototype.isSaveLocked=!0,i.prototype.children=u.emptyArray,i.prototype.clientConfigScriptName="",i.prototype.dioramaDataChannelBase=-1,i.prototype.replicaDataChannelBase=-1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.NestedFeatureProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.featureType=r.int32();break}case 2:{o.kmlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 21:{o.databaseUrl=r.string();break}case 3:{o.layer=n.keyhole.dbroot.LayerProto.decode(r,r.uint32());break}case 4:{o.folder=n.keyhole.dbroot.FolderProto.decode(r,r.uint32());break}case 5:{o.requirement=n.keyhole.dbroot.RequirementProto.decode(r,r.uint32());break}case 6:{o.channelId=r.int32();break}case 7:{o.displayName=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 8:{o.isVisible=r.bool();break}case 9:{o.isEnabled=r.bool();break}case 10:{o.isChecked=r.bool();break}case 11:{o.layerMenuIconPath=r.string();break}case 12:{o.description=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 13:{o.lookAt=n.keyhole.dbroot.LookAtProto.decode(r,r.uint32());break}case 15:{o.assetUuid=r.string();break}case 16:{o.isSaveLocked=r.bool();break}case 17:{o.children&&o.children.length||(o.children=[]),o.children.push(n.keyhole.dbroot.NestedFeatureProto.decode(r,r.uint32()));break}case 18:{o.clientConfigScriptName=r.string();break}case 19:{o.dioramaDataChannelBase=r.int32();break}case 20:{o.replicaDataChannelBase=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("channelId"))throw u.ProtocolError("missing required 'channelId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.featureType!=null&&r.hasOwnProperty("featureType"))switch(r.featureType){default:return"featureType: enum value expected";case 1:case 2:case 3:case 4:break}if(r.kmlUrl!=null&&r.hasOwnProperty("kmlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.kmlUrl);if(t)return"kmlUrl."+t}if(r.databaseUrl!=null&&r.hasOwnProperty("databaseUrl")&&!u.isString(r.databaseUrl))return"databaseUrl: string expected";if(r.layer!=null&&r.hasOwnProperty("layer")){var t=n.keyhole.dbroot.LayerProto.verify(r.layer);if(t)return"layer."+t}if(r.folder!=null&&r.hasOwnProperty("folder")){var t=n.keyhole.dbroot.FolderProto.verify(r.folder);if(t)return"folder."+t}if(r.requirement!=null&&r.hasOwnProperty("requirement")){var t=n.keyhole.dbroot.RequirementProto.verify(r.requirement);if(t)return"requirement."+t}if(!u.isInteger(r.channelId))return"channelId: integer expected";if(r.displayName!=null&&r.hasOwnProperty("displayName")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.displayName);if(t)return"displayName."+t}if(r.isVisible!=null&&r.hasOwnProperty("isVisible")&&typeof r.isVisible!="boolean")return"isVisible: boolean expected";if(r.isEnabled!=null&&r.hasOwnProperty("isEnabled")&&typeof r.isEnabled!="boolean")return"isEnabled: boolean expected";if(r.isChecked!=null&&r.hasOwnProperty("isChecked")&&typeof r.isChecked!="boolean")return"isChecked: boolean expected";if(r.layerMenuIconPath!=null&&r.hasOwnProperty("layerMenuIconPath")&&!u.isString(r.layerMenuIconPath))return"layerMenuIconPath: string expected";if(r.description!=null&&r.hasOwnProperty("description")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.description);if(t)return"description."+t}if(r.lookAt!=null&&r.hasOwnProperty("lookAt")){var t=n.keyhole.dbroot.LookAtProto.verify(r.lookAt);if(t)return"lookAt."+t}if(r.assetUuid!=null&&r.hasOwnProperty("assetUuid")&&!u.isString(r.assetUuid))return"assetUuid: string expected";if(r.isSaveLocked!=null&&r.hasOwnProperty("isSaveLocked")&&typeof r.isSaveLocked!="boolean")return"isSaveLocked: boolean expected";if(r.children!=null&&r.hasOwnProperty("children")){if(!Array.isArray(r.children))return"children: array expected";for(var e=0;e<r.children.length;++e){var t=n.keyhole.dbroot.NestedFeatureProto.verify(r.children[e]);if(t)return"children."+t}}return r.clientConfigScriptName!=null&&r.hasOwnProperty("clientConfigScriptName")&&!u.isString(r.clientConfigScriptName)?"clientConfigScriptName: string expected":r.dioramaDataChannelBase!=null&&r.hasOwnProperty("dioramaDataChannelBase")&&!u.isInteger(r.dioramaDataChannelBase)?"dioramaDataChannelBase: integer expected":r.replicaDataChannelBase!=null&&r.hasOwnProperty("replicaDataChannelBase")&&!u.isInteger(r.replicaDataChannelBase)?"replicaDataChannelBase: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.NestedFeatureProto)return r;var t=new n.keyhole.dbroot.NestedFeatureProto;switch(r.featureType){case"TYPE_POINT_Z":case 1:t.featureType=1;break;case"TYPE_POLYGON_Z":case 2:t.featureType=2;break;case"TYPE_LINE_Z":case 3:t.featureType=3;break;case"TYPE_TERRAIN":case 4:t.featureType=4;break}if(r.kmlUrl!=null){if(typeof r.kmlUrl!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected");t.kmlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.kmlUrl)}if(r.databaseUrl!=null&&(t.databaseUrl=String(r.databaseUrl)),r.layer!=null){if(typeof r.layer!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.layer: object expected");t.layer=n.keyhole.dbroot.LayerProto.fromObject(r.layer)}if(r.folder!=null){if(typeof r.folder!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.folder: object expected");t.folder=n.keyhole.dbroot.FolderProto.fromObject(r.folder)}if(r.requirement!=null){if(typeof r.requirement!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.requirement: object expected");t.requirement=n.keyhole.dbroot.RequirementProto.fromObject(r.requirement)}if(r.channelId!=null&&(t.channelId=r.channelId|0),r.displayName!=null){if(typeof r.displayName!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.displayName: object expected");t.displayName=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.displayName)}if(r.isVisible!=null&&(t.isVisible=!!r.isVisible),r.isEnabled!=null&&(t.isEnabled=!!r.isEnabled),r.isChecked!=null&&(t.isChecked=!!r.isChecked),r.layerMenuIconPath!=null&&(t.layerMenuIconPath=String(r.layerMenuIconPath)),r.description!=null){if(typeof r.description!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.description: object expected");t.description=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.description)}if(r.lookAt!=null){if(typeof r.lookAt!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.lookAt: object expected");t.lookAt=n.keyhole.dbroot.LookAtProto.fromObject(r.lookAt)}if(r.assetUuid!=null&&(t.assetUuid=String(r.assetUuid)),r.isSaveLocked!=null&&(t.isSaveLocked=!!r.isSaveLocked),r.children){if(!Array.isArray(r.children))throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: array expected");t.children=[];for(var e=0;e<r.children.length;++e){if(typeof r.children[e]!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: object expected");t.children[e]=n.keyhole.dbroot.NestedFeatureProto.fromObject(r.children[e])}}return r.clientConfigScriptName!=null&&(t.clientConfigScriptName=String(r.clientConfigScriptName)),r.dioramaDataChannelBase!=null&&(t.dioramaDataChannelBase=r.dioramaDataChannelBase|0),r.replicaDataChannelBase!=null&&(t.replicaDataChannelBase=r.replicaDataChannelBase|0),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.children=[]),t.defaults&&(e.featureType=t.enums===String?"TYPE_POINT_Z":1,e.kmlUrl=null,e.layer=null,e.folder=null,e.requirement=null,e.channelId=0,e.displayName=null,e.isVisible=!0,e.isEnabled=!0,e.isChecked=!1,e.layerMenuIconPath="icons/773_l.png",e.description=null,e.lookAt=null,e.assetUuid="",e.isSaveLocked=!0,e.clientConfigScriptName="",e.dioramaDataChannelBase=-1,e.replicaDataChannelBase=-1,e.databaseUrl=""),r.featureType!=null&&r.hasOwnProperty("featureType")&&(e.featureType=t.enums===String?n.keyhole.dbroot.NestedFeatureProto.FeatureType[r.featureType]:r.featureType),r.kmlUrl!=null&&r.hasOwnProperty("kmlUrl")&&(e.kmlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.kmlUrl,t)),r.layer!=null&&r.hasOwnProperty("layer")&&(e.layer=n.keyhole.dbroot.LayerProto.toObject(r.layer,t)),r.folder!=null&&r.hasOwnProperty("folder")&&(e.folder=n.keyhole.dbroot.FolderProto.toObject(r.folder,t)),r.requirement!=null&&r.hasOwnProperty("requirement")&&(e.requirement=n.keyhole.dbroot.RequirementProto.toObject(r.requirement,t)),r.channelId!=null&&r.hasOwnProperty("channelId")&&(e.channelId=r.channelId),r.displayName!=null&&r.hasOwnProperty("displayName")&&(e.displayName=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.displayName,t)),r.isVisible!=null&&r.hasOwnProperty("isVisible")&&(e.isVisible=r.isVisible),r.isEnabled!=null&&r.hasOwnProperty("isEnabled")&&(e.isEnabled=r.isEnabled),r.isChecked!=null&&r.hasOwnProperty("isChecked")&&(e.isChecked=r.isChecked),r.layerMenuIconPath!=null&&r.hasOwnProperty("layerMenuIconPath")&&(e.layerMenuIconPath=r.layerMenuIconPath),r.description!=null&&r.hasOwnProperty("description")&&(e.description=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.description,t)),r.lookAt!=null&&r.hasOwnProperty("lookAt")&&(e.lookAt=n.keyhole.dbroot.LookAtProto.toObject(r.lookAt,t)),r.assetUuid!=null&&r.hasOwnProperty("assetUuid")&&(e.assetUuid=r.assetUuid),r.isSaveLocked!=null&&r.hasOwnProperty("isSaveLocked")&&(e.isSaveLocked=r.isSaveLocked),r.children&&r.children.length){e.children=[];for(var o=0;o<r.children.length;++o)e.children[o]=n.keyhole.dbroot.NestedFeatureProto.toObject(r.children[o],t)}return r.clientConfigScriptName!=null&&r.hasOwnProperty("clientConfigScriptName")&&(e.clientConfigScriptName=r.clientConfigScriptName),r.dioramaDataChannelBase!=null&&r.hasOwnProperty("dioramaDataChannelBase")&&(e.dioramaDataChannelBase=r.dioramaDataChannelBase),r.replicaDataChannelBase!=null&&r.hasOwnProperty("replicaDataChannelBase")&&(e.replicaDataChannelBase=r.replicaDataChannelBase),r.databaseUrl!=null&&r.hasOwnProperty("databaseUrl")&&(e.databaseUrl=r.databaseUrl),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.NestedFeatureProto"},i.FeatureType=function(){var l={},r=Object.create(l);return r[l[1]="TYPE_POINT_Z"]=1,r[l[2]="TYPE_POLYGON_Z"]=2,r[l[3]="TYPE_LINE_Z"]=3,r[l[4]="TYPE_TERRAIN"]=4,r}(),i}(),c.MfeDomainFeaturesProto=function(){function i(l){if(this.supportedFeatures=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.countryCode="",i.prototype.domainName="",i.prototype.supportedFeatures=u.emptyArray,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.MfeDomainFeaturesProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.countryCode=r.string();break}case 2:{o.domainName=r.string();break}case 3:{if(o.supportedFeatures&&o.supportedFeatures.length||(o.supportedFeatures=[]),(a&7)===2)for(var p=r.uint32()+r.pos;r.pos<p;)o.supportedFeatures.push(r.int32());else o.supportedFeatures.push(r.int32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("countryCode"))throw u.ProtocolError("missing required 'countryCode'",{instance:o});if(!o.hasOwnProperty("domainName"))throw u.ProtocolError("missing required 'domainName'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.countryCode))return"countryCode: string expected";if(!u.isString(r.domainName))return"domainName: string expected";if(r.supportedFeatures!=null&&r.hasOwnProperty("supportedFeatures")){if(!Array.isArray(r.supportedFeatures))return"supportedFeatures: array expected";for(var t=0;t<r.supportedFeatures.length;++t)switch(r.supportedFeatures[t]){default:return"supportedFeatures: enum value[] expected";case 0:case 1:case 2:break}}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.MfeDomainFeaturesProto)return r;var t=new n.keyhole.dbroot.MfeDomainFeaturesProto;if(r.countryCode!=null&&(t.countryCode=String(r.countryCode)),r.domainName!=null&&(t.domainName=String(r.domainName)),r.supportedFeatures){if(!Array.isArray(r.supportedFeatures))throw TypeError(".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected");t.supportedFeatures=[];for(var e=0;e<r.supportedFeatures.length;++e)switch(r.supportedFeatures[e]){default:case"GEOCODING":case 0:t.supportedFeatures[e]=0;break;case"LOCAL_SEARCH":case 1:t.supportedFeatures[e]=1;break;case"DRIVING_DIRECTIONS":case 2:t.supportedFeatures[e]=2;break}}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.supportedFeatures=[]),t.defaults&&(e.countryCode="",e.domainName=""),r.countryCode!=null&&r.hasOwnProperty("countryCode")&&(e.countryCode=r.countryCode),r.domainName!=null&&r.hasOwnProperty("domainName")&&(e.domainName=r.domainName),r.supportedFeatures&&r.supportedFeatures.length){e.supportedFeatures=[];for(var o=0;o<r.supportedFeatures.length;++o)e.supportedFeatures[o]=t.enums===String?n.keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature[r.supportedFeatures[o]]:r.supportedFeatures[o]}return e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.MfeDomainFeaturesProto"},i.SupportedFeature=function(){var l={},r=Object.create(l);return r[l[0]="GEOCODING"]=0,r[l[1]="LOCAL_SEARCH"]=1,r[l[2]="DRIVING_DIRECTIONS"]=2,r}(),i}(),c.ClientOptionsProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.disableDiskCache=!1,i.prototype.disableEmbeddedBrowserVista=!1,i.prototype.drawAtmosphere=!0,i.prototype.drawStars=!0,i.prototype.shaderFilePrefix="",i.prototype.useProtobufQuadtreePackets=!1,i.prototype.useExtendedCopyrightIds=!0,i.prototype.precipitationsOptions=null,i.prototype.captureOptions=null,i.prototype.show_2dMapsIcon=!0,i.prototype.disableInternalBrowser=!1,i.prototype.internalBrowserBlacklist="",i.prototype.internalBrowserOriginWhitelist="*",i.prototype.polarTileMergingLevel=0,i.prototype.jsBridgeRequestWhitelist="http://*.google.com/*",i.prototype.mapsOptions=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ClientOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.disableDiskCache=r.bool();break}case 2:{o.disableEmbeddedBrowserVista=r.bool();break}case 3:{o.drawAtmosphere=r.bool();break}case 4:{o.drawStars=r.bool();break}case 5:{o.shaderFilePrefix=r.string();break}case 6:{o.useProtobufQuadtreePackets=r.bool();break}case 7:{o.useExtendedCopyrightIds=r.bool();break}case 8:{o.precipitationsOptions=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.decode(r,r.uint32());break}case 9:{o.captureOptions=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.decode(r,r.uint32());break}case 10:{o.show_2dMapsIcon=r.bool();break}case 11:{o.disableInternalBrowser=r.bool();break}case 12:{o.internalBrowserBlacklist=r.string();break}case 13:{o.internalBrowserOriginWhitelist=r.string();break}case 14:{o.polarTileMergingLevel=r.int32();break}case 15:{o.jsBridgeRequestWhitelist=r.string();break}case 16:{o.mapsOptions=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.decode(r,r.uint32());break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.disableDiskCache!=null&&r.hasOwnProperty("disableDiskCache")&&typeof r.disableDiskCache!="boolean")return"disableDiskCache: boolean expected";if(r.disableEmbeddedBrowserVista!=null&&r.hasOwnProperty("disableEmbeddedBrowserVista")&&typeof r.disableEmbeddedBrowserVista!="boolean")return"disableEmbeddedBrowserVista: boolean expected";if(r.drawAtmosphere!=null&&r.hasOwnProperty("drawAtmosphere")&&typeof r.drawAtmosphere!="boolean")return"drawAtmosphere: boolean expected";if(r.drawStars!=null&&r.hasOwnProperty("drawStars")&&typeof r.drawStars!="boolean")return"drawStars: boolean expected";if(r.shaderFilePrefix!=null&&r.hasOwnProperty("shaderFilePrefix")&&!u.isString(r.shaderFilePrefix))return"shaderFilePrefix: string expected";if(r.useProtobufQuadtreePackets!=null&&r.hasOwnProperty("useProtobufQuadtreePackets")&&typeof r.useProtobufQuadtreePackets!="boolean")return"useProtobufQuadtreePackets: boolean expected";if(r.useExtendedCopyrightIds!=null&&r.hasOwnProperty("useExtendedCopyrightIds")&&typeof r.useExtendedCopyrightIds!="boolean")return"useExtendedCopyrightIds: boolean expected";if(r.precipitationsOptions!=null&&r.hasOwnProperty("precipitationsOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.verify(r.precipitationsOptions);if(t)return"precipitationsOptions."+t}if(r.captureOptions!=null&&r.hasOwnProperty("captureOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.verify(r.captureOptions);if(t)return"captureOptions."+t}if(r.show_2dMapsIcon!=null&&r.hasOwnProperty("show_2dMapsIcon")&&typeof r.show_2dMapsIcon!="boolean")return"show_2dMapsIcon: boolean expected";if(r.disableInternalBrowser!=null&&r.hasOwnProperty("disableInternalBrowser")&&typeof r.disableInternalBrowser!="boolean")return"disableInternalBrowser: boolean expected";if(r.internalBrowserBlacklist!=null&&r.hasOwnProperty("internalBrowserBlacklist")&&!u.isString(r.internalBrowserBlacklist))return"internalBrowserBlacklist: string expected";if(r.internalBrowserOriginWhitelist!=null&&r.hasOwnProperty("internalBrowserOriginWhitelist")&&!u.isString(r.internalBrowserOriginWhitelist))return"internalBrowserOriginWhitelist: string expected";if(r.polarTileMergingLevel!=null&&r.hasOwnProperty("polarTileMergingLevel")&&!u.isInteger(r.polarTileMergingLevel))return"polarTileMergingLevel: integer expected";if(r.jsBridgeRequestWhitelist!=null&&r.hasOwnProperty("jsBridgeRequestWhitelist")&&!u.isString(r.jsBridgeRequestWhitelist))return"jsBridgeRequestWhitelist: string expected";if(r.mapsOptions!=null&&r.hasOwnProperty("mapsOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.verify(r.mapsOptions);if(t)return"mapsOptions."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ClientOptionsProto)return r;var t=new n.keyhole.dbroot.ClientOptionsProto;if(r.disableDiskCache!=null&&(t.disableDiskCache=!!r.disableDiskCache),r.disableEmbeddedBrowserVista!=null&&(t.disableEmbeddedBrowserVista=!!r.disableEmbeddedBrowserVista),r.drawAtmosphere!=null&&(t.drawAtmosphere=!!r.drawAtmosphere),r.drawStars!=null&&(t.drawStars=!!r.drawStars),r.shaderFilePrefix!=null&&(t.shaderFilePrefix=String(r.shaderFilePrefix)),r.useProtobufQuadtreePackets!=null&&(t.useProtobufQuadtreePackets=!!r.useProtobufQuadtreePackets),r.useExtendedCopyrightIds!=null&&(t.useExtendedCopyrightIds=!!r.useExtendedCopyrightIds),r.precipitationsOptions!=null){if(typeof r.precipitationsOptions!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected");t.precipitationsOptions=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.fromObject(r.precipitationsOptions)}if(r.captureOptions!=null){if(typeof r.captureOptions!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected");t.captureOptions=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.fromObject(r.captureOptions)}if(r.show_2dMapsIcon!=null&&(t.show_2dMapsIcon=!!r.show_2dMapsIcon),r.disableInternalBrowser!=null&&(t.disableInternalBrowser=!!r.disableInternalBrowser),r.internalBrowserBlacklist!=null&&(t.internalBrowserBlacklist=String(r.internalBrowserBlacklist)),r.internalBrowserOriginWhitelist!=null&&(t.internalBrowserOriginWhitelist=String(r.internalBrowserOriginWhitelist)),r.polarTileMergingLevel!=null&&(t.polarTileMergingLevel=r.polarTileMergingLevel|0),r.jsBridgeRequestWhitelist!=null&&(t.jsBridgeRequestWhitelist=String(r.jsBridgeRequestWhitelist)),r.mapsOptions!=null){if(typeof r.mapsOptions!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected");t.mapsOptions=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.fromObject(r.mapsOptions)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.disableDiskCache=!1,e.disableEmbeddedBrowserVista=!1,e.drawAtmosphere=!0,e.drawStars=!0,e.shaderFilePrefix="",e.useProtobufQuadtreePackets=!1,e.useExtendedCopyrightIds=!0,e.precipitationsOptions=null,e.captureOptions=null,e.show_2dMapsIcon=!0,e.disableInternalBrowser=!1,e.internalBrowserBlacklist="",e.internalBrowserOriginWhitelist="*",e.polarTileMergingLevel=0,e.jsBridgeRequestWhitelist="http://*.google.com/*",e.mapsOptions=null),r.disableDiskCache!=null&&r.hasOwnProperty("disableDiskCache")&&(e.disableDiskCache=r.disableDiskCache),r.disableEmbeddedBrowserVista!=null&&r.hasOwnProperty("disableEmbeddedBrowserVista")&&(e.disableEmbeddedBrowserVista=r.disableEmbeddedBrowserVista),r.drawAtmosphere!=null&&r.hasOwnProperty("drawAtmosphere")&&(e.drawAtmosphere=r.drawAtmosphere),r.drawStars!=null&&r.hasOwnProperty("drawStars")&&(e.drawStars=r.drawStars),r.shaderFilePrefix!=null&&r.hasOwnProperty("shaderFilePrefix")&&(e.shaderFilePrefix=r.shaderFilePrefix),r.useProtobufQuadtreePackets!=null&&r.hasOwnProperty("useProtobufQuadtreePackets")&&(e.useProtobufQuadtreePackets=r.useProtobufQuadtreePackets),r.useExtendedCopyrightIds!=null&&r.hasOwnProperty("useExtendedCopyrightIds")&&(e.useExtendedCopyrightIds=r.useExtendedCopyrightIds),r.precipitationsOptions!=null&&r.hasOwnProperty("precipitationsOptions")&&(e.precipitationsOptions=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.toObject(r.precipitationsOptions,t)),r.captureOptions!=null&&r.hasOwnProperty("captureOptions")&&(e.captureOptions=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.toObject(r.captureOptions,t)),r.show_2dMapsIcon!=null&&r.hasOwnProperty("show_2dMapsIcon")&&(e.show_2dMapsIcon=r.show_2dMapsIcon),r.disableInternalBrowser!=null&&r.hasOwnProperty("disableInternalBrowser")&&(e.disableInternalBrowser=r.disableInternalBrowser),r.internalBrowserBlacklist!=null&&r.hasOwnProperty("internalBrowserBlacklist")&&(e.internalBrowserBlacklist=r.internalBrowserBlacklist),r.internalBrowserOriginWhitelist!=null&&r.hasOwnProperty("internalBrowserOriginWhitelist")&&(e.internalBrowserOriginWhitelist=r.internalBrowserOriginWhitelist),r.polarTileMergingLevel!=null&&r.hasOwnProperty("polarTileMergingLevel")&&(e.polarTileMergingLevel=r.polarTileMergingLevel),r.jsBridgeRequestWhitelist!=null&&r.hasOwnProperty("jsBridgeRequestWhitelist")&&(e.jsBridgeRequestWhitelist=r.jsBridgeRequestWhitelist),r.mapsOptions!=null&&r.hasOwnProperty("mapsOptions")&&(e.mapsOptions=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.toObject(r.mapsOptions,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ClientOptionsProto"},i.PrecipitationsOptions=function(){function l(r){if(this.weatherMapping=[],r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.imageUrl="",l.prototype.imageExpireTime=900,l.prototype.maxColorDistance=20,l.prototype.imageLevel=5,l.prototype.weatherMapping=u.emptyArray,l.prototype.cloudsLayerUrl="",l.prototype.animationDecelerationDelay=20,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.imageUrl=t.string();break}case 2:{a.imageExpireTime=t.int32();break}case 3:{a.maxColorDistance=t.int32();break}case 4:{a.imageLevel=t.int32();break}case 5:{a.weatherMapping&&a.weatherMapping.length||(a.weatherMapping=[]),a.weatherMapping.push(n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.decode(t,t.uint32()));break}case 6:{a.cloudsLayerUrl=t.string();break}case 7:{a.animationDecelerationDelay=t.float();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.imageUrl!=null&&t.hasOwnProperty("imageUrl")&&!u.isString(t.imageUrl))return"imageUrl: string expected";if(t.imageExpireTime!=null&&t.hasOwnProperty("imageExpireTime")&&!u.isInteger(t.imageExpireTime))return"imageExpireTime: integer expected";if(t.maxColorDistance!=null&&t.hasOwnProperty("maxColorDistance")&&!u.isInteger(t.maxColorDistance))return"maxColorDistance: integer expected";if(t.imageLevel!=null&&t.hasOwnProperty("imageLevel")&&!u.isInteger(t.imageLevel))return"imageLevel: integer expected";if(t.weatherMapping!=null&&t.hasOwnProperty("weatherMapping")){if(!Array.isArray(t.weatherMapping))return"weatherMapping: array expected";for(var e=0;e<t.weatherMapping.length;++e){var o=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.verify(t.weatherMapping[e]);if(o)return"weatherMapping."+o}}return t.cloudsLayerUrl!=null&&t.hasOwnProperty("cloudsLayerUrl")&&!u.isString(t.cloudsLayerUrl)?"cloudsLayerUrl: string expected":t.animationDecelerationDelay!=null&&t.hasOwnProperty("animationDecelerationDelay")&&typeof t.animationDecelerationDelay!="number"?"animationDecelerationDelay: number expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions)return t;var e=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;if(t.imageUrl!=null&&(e.imageUrl=String(t.imageUrl)),t.imageExpireTime!=null&&(e.imageExpireTime=t.imageExpireTime|0),t.maxColorDistance!=null&&(e.maxColorDistance=t.maxColorDistance|0),t.imageLevel!=null&&(e.imageLevel=t.imageLevel|0),t.weatherMapping){if(!Array.isArray(t.weatherMapping))throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: array expected");e.weatherMapping=[];for(var o=0;o<t.weatherMapping.length;++o){if(typeof t.weatherMapping[o]!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: object expected");e.weatherMapping[o]=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.fromObject(t.weatherMapping[o])}}return t.cloudsLayerUrl!=null&&(e.cloudsLayerUrl=String(t.cloudsLayerUrl)),t.animationDecelerationDelay!=null&&(e.animationDecelerationDelay=Number(t.animationDecelerationDelay)),e},l.toObject=function(t,e){e||(e={});var o={};if((e.arrays||e.defaults)&&(o.weatherMapping=[]),e.defaults&&(o.imageUrl="",o.imageExpireTime=900,o.maxColorDistance=20,o.imageLevel=5,o.cloudsLayerUrl="",o.animationDecelerationDelay=20),t.imageUrl!=null&&t.hasOwnProperty("imageUrl")&&(o.imageUrl=t.imageUrl),t.imageExpireTime!=null&&t.hasOwnProperty("imageExpireTime")&&(o.imageExpireTime=t.imageExpireTime),t.maxColorDistance!=null&&t.hasOwnProperty("maxColorDistance")&&(o.maxColorDistance=t.maxColorDistance),t.imageLevel!=null&&t.hasOwnProperty("imageLevel")&&(o.imageLevel=t.imageLevel),t.weatherMapping&&t.weatherMapping.length){o.weatherMapping=[];for(var a=0;a<t.weatherMapping.length;++a)o.weatherMapping[a]=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.toObject(t.weatherMapping[a],e)}return t.cloudsLayerUrl!=null&&t.hasOwnProperty("cloudsLayerUrl")&&(o.cloudsLayerUrl=t.cloudsLayerUrl),t.animationDecelerationDelay!=null&&t.hasOwnProperty("animationDecelerationDelay")&&(o.animationDecelerationDelay=e.json&&!isFinite(t.animationDecelerationDelay)?String(t.animationDecelerationDelay):t.animationDecelerationDelay),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions"},l.WeatherMapping=function(){function r(t){if(t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.colorAbgr=0,r.prototype.weatherType=0,r.prototype.elongation=1,r.prototype.opacity=0,r.prototype.fogDensity=0,r.prototype.speed0=0,r.prototype.speed1=0,r.prototype.speed2=0,r.prototype.speed3=0,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.colorAbgr=e.uint32();break}case 2:{p.weatherType=e.int32();break}case 3:{p.elongation=e.float();break}case 4:{p.opacity=e.float();break}case 5:{p.fogDensity=e.float();break}case 6:{p.speed0=e.float();break}case 7:{p.speed1=e.float();break}case 8:{p.speed2=e.float();break}case 9:{p.speed3=e.float();break}default:e.skipType(y&7);break}}if(!p.hasOwnProperty("colorAbgr"))throw u.ProtocolError("missing required 'colorAbgr'",{instance:p});if(!p.hasOwnProperty("weatherType"))throw u.ProtocolError("missing required 'weatherType'",{instance:p});return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(!u.isInteger(e.colorAbgr))return"colorAbgr: integer expected";switch(e.weatherType){default:return"weatherType: enum value expected";case 0:case 1:case 2:break}return e.elongation!=null&&e.hasOwnProperty("elongation")&&typeof e.elongation!="number"?"elongation: number expected":e.opacity!=null&&e.hasOwnProperty("opacity")&&typeof e.opacity!="number"?"opacity: number expected":e.fogDensity!=null&&e.hasOwnProperty("fogDensity")&&typeof e.fogDensity!="number"?"fogDensity: number expected":e.speed0!=null&&e.hasOwnProperty("speed0")&&typeof e.speed0!="number"?"speed0: number expected":e.speed1!=null&&e.hasOwnProperty("speed1")&&typeof e.speed1!="number"?"speed1: number expected":e.speed2!=null&&e.hasOwnProperty("speed2")&&typeof e.speed2!="number"?"speed2: number expected":e.speed3!=null&&e.hasOwnProperty("speed3")&&typeof e.speed3!="number"?"speed3: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)return e;var o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;switch(e.colorAbgr!=null&&(o.colorAbgr=e.colorAbgr>>>0),e.weatherType){case"NO_PRECIPITATION":case 0:o.weatherType=0;break;case"RAIN":case 1:o.weatherType=1;break;case"SNOW":case 2:o.weatherType=2;break}return e.elongation!=null&&(o.elongation=Number(e.elongation)),e.opacity!=null&&(o.opacity=Number(e.opacity)),e.fogDensity!=null&&(o.fogDensity=Number(e.fogDensity)),e.speed0!=null&&(o.speed0=Number(e.speed0)),e.speed1!=null&&(o.speed1=Number(e.speed1)),e.speed2!=null&&(o.speed2=Number(e.speed2)),e.speed3!=null&&(o.speed3=Number(e.speed3)),o},r.toObject=function(e,o){o||(o={});var a={};return o.defaults&&(a.colorAbgr=0,a.weatherType=o.enums===String?"NO_PRECIPITATION":0,a.elongation=1,a.opacity=0,a.fogDensity=0,a.speed0=0,a.speed1=0,a.speed2=0,a.speed3=0),e.colorAbgr!=null&&e.hasOwnProperty("colorAbgr")&&(a.colorAbgr=e.colorAbgr),e.weatherType!=null&&e.hasOwnProperty("weatherType")&&(a.weatherType=o.enums===String?n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.WeatherType[e.weatherType]:e.weatherType),e.elongation!=null&&e.hasOwnProperty("elongation")&&(a.elongation=o.json&&!isFinite(e.elongation)?String(e.elongation):e.elongation),e.opacity!=null&&e.hasOwnProperty("opacity")&&(a.opacity=o.json&&!isFinite(e.opacity)?String(e.opacity):e.opacity),e.fogDensity!=null&&e.hasOwnProperty("fogDensity")&&(a.fogDensity=o.json&&!isFinite(e.fogDensity)?String(e.fogDensity):e.fogDensity),e.speed0!=null&&e.hasOwnProperty("speed0")&&(a.speed0=o.json&&!isFinite(e.speed0)?String(e.speed0):e.speed0),e.speed1!=null&&e.hasOwnProperty("speed1")&&(a.speed1=o.json&&!isFinite(e.speed1)?String(e.speed1):e.speed1),e.speed2!=null&&e.hasOwnProperty("speed2")&&(a.speed2=o.json&&!isFinite(e.speed2)?String(e.speed2):e.speed2),e.speed3!=null&&e.hasOwnProperty("speed3")&&(a.speed3=o.json&&!isFinite(e.speed3)?String(e.speed3):e.speed3),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping"},r.WeatherType=function(){var t={},e=Object.create(t);return e[t[0]="NO_PRECIPITATION"]=0,e[t[1]="RAIN"]=1,e[t[2]="SNOW"]=2,e}(),r}(),l}(),i.CaptureOptions=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.allowSaveAsImage=!0,l.prototype.maxFreeCaptureRes=2400,l.prototype.maxPremiumCaptureRes=4800,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.allowSaveAsImage=t.bool();break}case 2:{a.maxFreeCaptureRes=t.int32();break}case 3:{a.maxPremiumCaptureRes=t.int32();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":t.allowSaveAsImage!=null&&t.hasOwnProperty("allowSaveAsImage")&&typeof t.allowSaveAsImage!="boolean"?"allowSaveAsImage: boolean expected":t.maxFreeCaptureRes!=null&&t.hasOwnProperty("maxFreeCaptureRes")&&!u.isInteger(t.maxFreeCaptureRes)?"maxFreeCaptureRes: integer expected":t.maxPremiumCaptureRes!=null&&t.hasOwnProperty("maxPremiumCaptureRes")&&!u.isInteger(t.maxPremiumCaptureRes)?"maxPremiumCaptureRes: integer expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.ClientOptionsProto.CaptureOptions)return t;var e=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;return t.allowSaveAsImage!=null&&(e.allowSaveAsImage=!!t.allowSaveAsImage),t.maxFreeCaptureRes!=null&&(e.maxFreeCaptureRes=t.maxFreeCaptureRes|0),t.maxPremiumCaptureRes!=null&&(e.maxPremiumCaptureRes=t.maxPremiumCaptureRes|0),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.allowSaveAsImage=!0,o.maxFreeCaptureRes=2400,o.maxPremiumCaptureRes=4800),t.allowSaveAsImage!=null&&t.hasOwnProperty("allowSaveAsImage")&&(o.allowSaveAsImage=t.allowSaveAsImage),t.maxFreeCaptureRes!=null&&t.hasOwnProperty("maxFreeCaptureRes")&&(o.maxFreeCaptureRes=t.maxFreeCaptureRes),t.maxPremiumCaptureRes!=null&&t.hasOwnProperty("maxPremiumCaptureRes")&&(o.maxPremiumCaptureRes=t.maxPremiumCaptureRes),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.ClientOptionsProto.CaptureOptions"},l}(),i.MapsOptions=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.enableMaps=!1,l.prototype.docsAutoDownloadEnabled=!1,l.prototype.docsAutoDownloadInterval=0,l.prototype.docsAutoUploadEnabled=!1,l.prototype.docsAutoUploadDelay=0,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.enableMaps=t.bool();break}case 2:{a.docsAutoDownloadEnabled=t.bool();break}case 3:{a.docsAutoDownloadInterval=t.int32();break}case 4:{a.docsAutoUploadEnabled=t.bool();break}case 5:{a.docsAutoUploadDelay=t.int32();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":t.enableMaps!=null&&t.hasOwnProperty("enableMaps")&&typeof t.enableMaps!="boolean"?"enableMaps: boolean expected":t.docsAutoDownloadEnabled!=null&&t.hasOwnProperty("docsAutoDownloadEnabled")&&typeof t.docsAutoDownloadEnabled!="boolean"?"docsAutoDownloadEnabled: boolean expected":t.docsAutoDownloadInterval!=null&&t.hasOwnProperty("docsAutoDownloadInterval")&&!u.isInteger(t.docsAutoDownloadInterval)?"docsAutoDownloadInterval: integer expected":t.docsAutoUploadEnabled!=null&&t.hasOwnProperty("docsAutoUploadEnabled")&&typeof t.docsAutoUploadEnabled!="boolean"?"docsAutoUploadEnabled: boolean expected":t.docsAutoUploadDelay!=null&&t.hasOwnProperty("docsAutoUploadDelay")&&!u.isInteger(t.docsAutoUploadDelay)?"docsAutoUploadDelay: integer expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.ClientOptionsProto.MapsOptions)return t;var e=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;return t.enableMaps!=null&&(e.enableMaps=!!t.enableMaps),t.docsAutoDownloadEnabled!=null&&(e.docsAutoDownloadEnabled=!!t.docsAutoDownloadEnabled),t.docsAutoDownloadInterval!=null&&(e.docsAutoDownloadInterval=t.docsAutoDownloadInterval|0),t.docsAutoUploadEnabled!=null&&(e.docsAutoUploadEnabled=!!t.docsAutoUploadEnabled),t.docsAutoUploadDelay!=null&&(e.docsAutoUploadDelay=t.docsAutoUploadDelay|0),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.enableMaps=!1,o.docsAutoDownloadEnabled=!1,o.docsAutoDownloadInterval=0,o.docsAutoUploadEnabled=!1,o.docsAutoUploadDelay=0),t.enableMaps!=null&&t.hasOwnProperty("enableMaps")&&(o.enableMaps=t.enableMaps),t.docsAutoDownloadEnabled!=null&&t.hasOwnProperty("docsAutoDownloadEnabled")&&(o.docsAutoDownloadEnabled=t.docsAutoDownloadEnabled),t.docsAutoDownloadInterval!=null&&t.hasOwnProperty("docsAutoDownloadInterval")&&(o.docsAutoDownloadInterval=t.docsAutoDownloadInterval),t.docsAutoUploadEnabled!=null&&t.hasOwnProperty("docsAutoUploadEnabled")&&(o.docsAutoUploadEnabled=t.docsAutoUploadEnabled),t.docsAutoUploadDelay!=null&&t.hasOwnProperty("docsAutoUploadDelay")&&(o.docsAutoUploadDelay=t.docsAutoUploadDelay),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.ClientOptionsProto.MapsOptions"},l}(),i}(),c.FetchingOptionsProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.maxRequestsPerQuery=1,i.prototype.forceMaxRequestsPerQuery=!1,i.prototype.sortBatches=!1,i.prototype.maxDrawable=2,i.prototype.maxImagery=2,i.prototype.maxTerrain=5,i.prototype.maxQuadtree=5,i.prototype.maxDioramaMetadata=1,i.prototype.maxDioramaData=0,i.prototype.maxConsumerFetchRatio=1,i.prototype.maxProEcFetchRatio=0,i.prototype.safeOverallQps=0,i.prototype.safeImageryQps=0,i.prototype.domainsForHttps="google.com gstatic.com",i.prototype.hostsForHttp="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.FetchingOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.maxRequestsPerQuery=r.int32();break}case 12:{o.forceMaxRequestsPerQuery=r.bool();break}case 13:{o.sortBatches=r.bool();break}case 2:{o.maxDrawable=r.int32();break}case 3:{o.maxImagery=r.int32();break}case 4:{o.maxTerrain=r.int32();break}case 5:{o.maxQuadtree=r.int32();break}case 6:{o.maxDioramaMetadata=r.int32();break}case 7:{o.maxDioramaData=r.int32();break}case 8:{o.maxConsumerFetchRatio=r.float();break}case 9:{o.maxProEcFetchRatio=r.float();break}case 10:{o.safeOverallQps=r.float();break}case 11:{o.safeImageryQps=r.float();break}case 14:{o.domainsForHttps=r.string();break}case 15:{o.hostsForHttp=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.maxRequestsPerQuery!=null&&r.hasOwnProperty("maxRequestsPerQuery")&&!u.isInteger(r.maxRequestsPerQuery)?"maxRequestsPerQuery: integer expected":r.forceMaxRequestsPerQuery!=null&&r.hasOwnProperty("forceMaxRequestsPerQuery")&&typeof r.forceMaxRequestsPerQuery!="boolean"?"forceMaxRequestsPerQuery: boolean expected":r.sortBatches!=null&&r.hasOwnProperty("sortBatches")&&typeof r.sortBatches!="boolean"?"sortBatches: boolean expected":r.maxDrawable!=null&&r.hasOwnProperty("maxDrawable")&&!u.isInteger(r.maxDrawable)?"maxDrawable: integer expected":r.maxImagery!=null&&r.hasOwnProperty("maxImagery")&&!u.isInteger(r.maxImagery)?"maxImagery: integer expected":r.maxTerrain!=null&&r.hasOwnProperty("maxTerrain")&&!u.isInteger(r.maxTerrain)?"maxTerrain: integer expected":r.maxQuadtree!=null&&r.hasOwnProperty("maxQuadtree")&&!u.isInteger(r.maxQuadtree)?"maxQuadtree: integer expected":r.maxDioramaMetadata!=null&&r.hasOwnProperty("maxDioramaMetadata")&&!u.isInteger(r.maxDioramaMetadata)?"maxDioramaMetadata: integer expected":r.maxDioramaData!=null&&r.hasOwnProperty("maxDioramaData")&&!u.isInteger(r.maxDioramaData)?"maxDioramaData: integer expected":r.maxConsumerFetchRatio!=null&&r.hasOwnProperty("maxConsumerFetchRatio")&&typeof r.maxConsumerFetchRatio!="number"?"maxConsumerFetchRatio: number expected":r.maxProEcFetchRatio!=null&&r.hasOwnProperty("maxProEcFetchRatio")&&typeof r.maxProEcFetchRatio!="number"?"maxProEcFetchRatio: number expected":r.safeOverallQps!=null&&r.hasOwnProperty("safeOverallQps")&&typeof r.safeOverallQps!="number"?"safeOverallQps: number expected":r.safeImageryQps!=null&&r.hasOwnProperty("safeImageryQps")&&typeof r.safeImageryQps!="number"?"safeImageryQps: number expected":r.domainsForHttps!=null&&r.hasOwnProperty("domainsForHttps")&&!u.isString(r.domainsForHttps)?"domainsForHttps: string expected":r.hostsForHttp!=null&&r.hasOwnProperty("hostsForHttp")&&!u.isString(r.hostsForHttp)?"hostsForHttp: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.FetchingOptionsProto)return r;var t=new n.keyhole.dbroot.FetchingOptionsProto;return r.maxRequestsPerQuery!=null&&(t.maxRequestsPerQuery=r.maxRequestsPerQuery|0),r.forceMaxRequestsPerQuery!=null&&(t.forceMaxRequestsPerQuery=!!r.forceMaxRequestsPerQuery),r.sortBatches!=null&&(t.sortBatches=!!r.sortBatches),r.maxDrawable!=null&&(t.maxDrawable=r.maxDrawable|0),r.maxImagery!=null&&(t.maxImagery=r.maxImagery|0),r.maxTerrain!=null&&(t.maxTerrain=r.maxTerrain|0),r.maxQuadtree!=null&&(t.maxQuadtree=r.maxQuadtree|0),r.maxDioramaMetadata!=null&&(t.maxDioramaMetadata=r.maxDioramaMetadata|0),r.maxDioramaData!=null&&(t.maxDioramaData=r.maxDioramaData|0),r.maxConsumerFetchRatio!=null&&(t.maxConsumerFetchRatio=Number(r.maxConsumerFetchRatio)),r.maxProEcFetchRatio!=null&&(t.maxProEcFetchRatio=Number(r.maxProEcFetchRatio)),r.safeOverallQps!=null&&(t.safeOverallQps=Number(r.safeOverallQps)),r.safeImageryQps!=null&&(t.safeImageryQps=Number(r.safeImageryQps)),r.domainsForHttps!=null&&(t.domainsForHttps=String(r.domainsForHttps)),r.hostsForHttp!=null&&(t.hostsForHttp=String(r.hostsForHttp)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.maxRequestsPerQuery=1,e.maxDrawable=2,e.maxImagery=2,e.maxTerrain=5,e.maxQuadtree=5,e.maxDioramaMetadata=1,e.maxDioramaData=0,e.maxConsumerFetchRatio=1,e.maxProEcFetchRatio=0,e.safeOverallQps=0,e.safeImageryQps=0,e.forceMaxRequestsPerQuery=!1,e.sortBatches=!1,e.domainsForHttps="google.com gstatic.com",e.hostsForHttp=""),r.maxRequestsPerQuery!=null&&r.hasOwnProperty("maxRequestsPerQuery")&&(e.maxRequestsPerQuery=r.maxRequestsPerQuery),r.maxDrawable!=null&&r.hasOwnProperty("maxDrawable")&&(e.maxDrawable=r.maxDrawable),r.maxImagery!=null&&r.hasOwnProperty("maxImagery")&&(e.maxImagery=r.maxImagery),r.maxTerrain!=null&&r.hasOwnProperty("maxTerrain")&&(e.maxTerrain=r.maxTerrain),r.maxQuadtree!=null&&r.hasOwnProperty("maxQuadtree")&&(e.maxQuadtree=r.maxQuadtree),r.maxDioramaMetadata!=null&&r.hasOwnProperty("maxDioramaMetadata")&&(e.maxDioramaMetadata=r.maxDioramaMetadata),r.maxDioramaData!=null&&r.hasOwnProperty("maxDioramaData")&&(e.maxDioramaData=r.maxDioramaData),r.maxConsumerFetchRatio!=null&&r.hasOwnProperty("maxConsumerFetchRatio")&&(e.maxConsumerFetchRatio=t.json&&!isFinite(r.maxConsumerFetchRatio)?String(r.maxConsumerFetchRatio):r.maxConsumerFetchRatio),r.maxProEcFetchRatio!=null&&r.hasOwnProperty("maxProEcFetchRatio")&&(e.maxProEcFetchRatio=t.json&&!isFinite(r.maxProEcFetchRatio)?String(r.maxProEcFetchRatio):r.maxProEcFetchRatio),r.safeOverallQps!=null&&r.hasOwnProperty("safeOverallQps")&&(e.safeOverallQps=t.json&&!isFinite(r.safeOverallQps)?String(r.safeOverallQps):r.safeOverallQps),r.safeImageryQps!=null&&r.hasOwnProperty("safeImageryQps")&&(e.safeImageryQps=t.json&&!isFinite(r.safeImageryQps)?String(r.safeImageryQps):r.safeImageryQps),r.forceMaxRequestsPerQuery!=null&&r.hasOwnProperty("forceMaxRequestsPerQuery")&&(e.forceMaxRequestsPerQuery=r.forceMaxRequestsPerQuery),r.sortBatches!=null&&r.hasOwnProperty("sortBatches")&&(e.sortBatches=r.sortBatches),r.domainsForHttps!=null&&r.hasOwnProperty("domainsForHttps")&&(e.domainsForHttps=r.domainsForHttps),r.hostsForHttp!=null&&r.hasOwnProperty("hostsForHttp")&&(e.hostsForHttp=r.hostsForHttp),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.FetchingOptionsProto"},i}(),c.TimeMachineOptionsProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.serverUrl="",i.prototype.isTimemachine=!1,i.prototype.dwellTimeMs=500,i.prototype.discoverabilityAltitudeMeters=15e3,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.TimeMachineOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.serverUrl=r.string();break}case 2:{o.isTimemachine=r.bool();break}case 3:{o.dwellTimeMs=r.int32();break}case 4:{o.discoverabilityAltitudeMeters=r.int32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.serverUrl!=null&&r.hasOwnProperty("serverUrl")&&!u.isString(r.serverUrl)?"serverUrl: string expected":r.isTimemachine!=null&&r.hasOwnProperty("isTimemachine")&&typeof r.isTimemachine!="boolean"?"isTimemachine: boolean expected":r.dwellTimeMs!=null&&r.hasOwnProperty("dwellTimeMs")&&!u.isInteger(r.dwellTimeMs)?"dwellTimeMs: integer expected":r.discoverabilityAltitudeMeters!=null&&r.hasOwnProperty("discoverabilityAltitudeMeters")&&!u.isInteger(r.discoverabilityAltitudeMeters)?"discoverabilityAltitudeMeters: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.TimeMachineOptionsProto)return r;var t=new n.keyhole.dbroot.TimeMachineOptionsProto;return r.serverUrl!=null&&(t.serverUrl=String(r.serverUrl)),r.isTimemachine!=null&&(t.isTimemachine=!!r.isTimemachine),r.dwellTimeMs!=null&&(t.dwellTimeMs=r.dwellTimeMs|0),r.discoverabilityAltitudeMeters!=null&&(t.discoverabilityAltitudeMeters=r.discoverabilityAltitudeMeters|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.serverUrl="",e.isTimemachine=!1,e.dwellTimeMs=500,e.discoverabilityAltitudeMeters=15e3),r.serverUrl!=null&&r.hasOwnProperty("serverUrl")&&(e.serverUrl=r.serverUrl),r.isTimemachine!=null&&r.hasOwnProperty("isTimemachine")&&(e.isTimemachine=r.isTimemachine),r.dwellTimeMs!=null&&r.hasOwnProperty("dwellTimeMs")&&(e.dwellTimeMs=r.dwellTimeMs),r.discoverabilityAltitudeMeters!=null&&r.hasOwnProperty("discoverabilityAltitudeMeters")&&(e.discoverabilityAltitudeMeters=r.discoverabilityAltitudeMeters),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.TimeMachineOptionsProto"},i}(),c.AutopiaOptionsProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.metadataServerUrl="http://cbk0.google.com/cbk",i.prototype.depthmapServerUrl="http://cbk0.google.com/cbk",i.prototype.coverageOverlayUrl="",i.prototype.maxImageryQps=0,i.prototype.maxMetadataDepthmapQps=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.AutopiaOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.metadataServerUrl=r.string();break}case 2:{o.depthmapServerUrl=r.string();break}case 3:{o.coverageOverlayUrl=r.string();break}case 4:{o.maxImageryQps=r.float();break}case 5:{o.maxMetadataDepthmapQps=r.float();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.metadataServerUrl!=null&&r.hasOwnProperty("metadataServerUrl")&&!u.isString(r.metadataServerUrl)?"metadataServerUrl: string expected":r.depthmapServerUrl!=null&&r.hasOwnProperty("depthmapServerUrl")&&!u.isString(r.depthmapServerUrl)?"depthmapServerUrl: string expected":r.coverageOverlayUrl!=null&&r.hasOwnProperty("coverageOverlayUrl")&&!u.isString(r.coverageOverlayUrl)?"coverageOverlayUrl: string expected":r.maxImageryQps!=null&&r.hasOwnProperty("maxImageryQps")&&typeof r.maxImageryQps!="number"?"maxImageryQps: number expected":r.maxMetadataDepthmapQps!=null&&r.hasOwnProperty("maxMetadataDepthmapQps")&&typeof r.maxMetadataDepthmapQps!="number"?"maxMetadataDepthmapQps: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.AutopiaOptionsProto)return r;var t=new n.keyhole.dbroot.AutopiaOptionsProto;return r.metadataServerUrl!=null&&(t.metadataServerUrl=String(r.metadataServerUrl)),r.depthmapServerUrl!=null&&(t.depthmapServerUrl=String(r.depthmapServerUrl)),r.coverageOverlayUrl!=null&&(t.coverageOverlayUrl=String(r.coverageOverlayUrl)),r.maxImageryQps!=null&&(t.maxImageryQps=Number(r.maxImageryQps)),r.maxMetadataDepthmapQps!=null&&(t.maxMetadataDepthmapQps=Number(r.maxMetadataDepthmapQps)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.metadataServerUrl="http://cbk0.google.com/cbk",e.depthmapServerUrl="http://cbk0.google.com/cbk",e.coverageOverlayUrl="",e.maxImageryQps=0,e.maxMetadataDepthmapQps=0),r.metadataServerUrl!=null&&r.hasOwnProperty("metadataServerUrl")&&(e.metadataServerUrl=r.metadataServerUrl),r.depthmapServerUrl!=null&&r.hasOwnProperty("depthmapServerUrl")&&(e.depthmapServerUrl=r.depthmapServerUrl),r.coverageOverlayUrl!=null&&r.hasOwnProperty("coverageOverlayUrl")&&(e.coverageOverlayUrl=r.coverageOverlayUrl),r.maxImageryQps!=null&&r.hasOwnProperty("maxImageryQps")&&(e.maxImageryQps=t.json&&!isFinite(r.maxImageryQps)?String(r.maxImageryQps):r.maxImageryQps),r.maxMetadataDepthmapQps!=null&&r.hasOwnProperty("maxMetadataDepthmapQps")&&(e.maxMetadataDepthmapQps=t.json&&!isFinite(r.maxMetadataDepthmapQps)?String(r.maxMetadataDepthmapQps):r.maxMetadataDepthmapQps),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.AutopiaOptionsProto"},i}(),c.CSIOptionsProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.samplingPercentage=0,i.prototype.experimentId="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.CSIOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.samplingPercentage=r.int32();break}case 2:{o.experimentId=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.samplingPercentage!=null&&r.hasOwnProperty("samplingPercentage")&&!u.isInteger(r.samplingPercentage)?"samplingPercentage: integer expected":r.experimentId!=null&&r.hasOwnProperty("experimentId")&&!u.isString(r.experimentId)?"experimentId: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.CSIOptionsProto)return r;var t=new n.keyhole.dbroot.CSIOptionsProto;return r.samplingPercentage!=null&&(t.samplingPercentage=r.samplingPercentage|0),r.experimentId!=null&&(t.experimentId=String(r.experimentId)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.samplingPercentage=0,e.experimentId=""),r.samplingPercentage!=null&&r.hasOwnProperty("samplingPercentage")&&(e.samplingPercentage=r.samplingPercentage),r.experimentId!=null&&r.hasOwnProperty("experimentId")&&(e.experimentId=r.experimentId),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.CSIOptionsProto"},i}(),c.SearchTabProto=function(){function i(l){if(this.inputBox=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.isVisible=!1,i.prototype.tabLabel=null,i.prototype.baseUrl="",i.prototype.viewportPrefix="",i.prototype.inputBox=u.emptyArray,i.prototype.requirement=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.SearchTabProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.isVisible=r.bool();break}case 2:{o.tabLabel=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.baseUrl=r.string();break}case 4:{o.viewportPrefix=r.string();break}case 5:{o.inputBox&&o.inputBox.length||(o.inputBox=[]),o.inputBox.push(n.keyhole.dbroot.SearchTabProto.InputBoxInfo.decode(r,r.uint32()));break}case 6:{o.requirement=n.keyhole.dbroot.RequirementProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("isVisible"))throw u.ProtocolError("missing required 'isVisible'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(typeof r.isVisible!="boolean")return"isVisible: boolean expected";if(r.tabLabel!=null&&r.hasOwnProperty("tabLabel")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.tabLabel);if(t)return"tabLabel."+t}if(r.baseUrl!=null&&r.hasOwnProperty("baseUrl")&&!u.isString(r.baseUrl))return"baseUrl: string expected";if(r.viewportPrefix!=null&&r.hasOwnProperty("viewportPrefix")&&!u.isString(r.viewportPrefix))return"viewportPrefix: string expected";if(r.inputBox!=null&&r.hasOwnProperty("inputBox")){if(!Array.isArray(r.inputBox))return"inputBox: array expected";for(var e=0;e<r.inputBox.length;++e){var t=n.keyhole.dbroot.SearchTabProto.InputBoxInfo.verify(r.inputBox[e]);if(t)return"inputBox."+t}}if(r.requirement!=null&&r.hasOwnProperty("requirement")){var t=n.keyhole.dbroot.RequirementProto.verify(r.requirement);if(t)return"requirement."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.SearchTabProto)return r;var t=new n.keyhole.dbroot.SearchTabProto;if(r.isVisible!=null&&(t.isVisible=!!r.isVisible),r.tabLabel!=null){if(typeof r.tabLabel!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.tabLabel: object expected");t.tabLabel=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.tabLabel)}if(r.baseUrl!=null&&(t.baseUrl=String(r.baseUrl)),r.viewportPrefix!=null&&(t.viewportPrefix=String(r.viewportPrefix)),r.inputBox){if(!Array.isArray(r.inputBox))throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: array expected");t.inputBox=[];for(var e=0;e<r.inputBox.length;++e){if(typeof r.inputBox[e]!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: object expected");t.inputBox[e]=n.keyhole.dbroot.SearchTabProto.InputBoxInfo.fromObject(r.inputBox[e])}}if(r.requirement!=null){if(typeof r.requirement!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.requirement: object expected");t.requirement=n.keyhole.dbroot.RequirementProto.fromObject(r.requirement)}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.inputBox=[]),t.defaults&&(e.isVisible=!1,e.tabLabel=null,e.baseUrl="",e.viewportPrefix="",e.requirement=null),r.isVisible!=null&&r.hasOwnProperty("isVisible")&&(e.isVisible=r.isVisible),r.tabLabel!=null&&r.hasOwnProperty("tabLabel")&&(e.tabLabel=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.tabLabel,t)),r.baseUrl!=null&&r.hasOwnProperty("baseUrl")&&(e.baseUrl=r.baseUrl),r.viewportPrefix!=null&&r.hasOwnProperty("viewportPrefix")&&(e.viewportPrefix=r.viewportPrefix),r.inputBox&&r.inputBox.length){e.inputBox=[];for(var o=0;o<r.inputBox.length;++o)e.inputBox[o]=n.keyhole.dbroot.SearchTabProto.InputBoxInfo.toObject(r.inputBox[o],t)}return r.requirement!=null&&r.hasOwnProperty("requirement")&&(e.requirement=n.keyhole.dbroot.RequirementProto.toObject(r.requirement,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.SearchTabProto"},i.InputBoxInfo=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.label=null,l.prototype.queryVerb="",l.prototype.queryPrepend="",l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.label=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 2:{a.queryVerb=t.string();break}case 3:{a.queryPrepend=t.string();break}default:t.skipType(p&7);break}}if(!a.hasOwnProperty("label"))throw u.ProtocolError("missing required 'label'",{instance:a});if(!a.hasOwnProperty("queryVerb"))throw u.ProtocolError("missing required 'queryVerb'",{instance:a});return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.label);if(e)return"label."+e}return u.isString(t.queryVerb)?t.queryPrepend!=null&&t.hasOwnProperty("queryPrepend")&&!u.isString(t.queryPrepend)?"queryPrepend: string expected":null:"queryVerb: string expected"},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.SearchTabProto.InputBoxInfo)return t;var e=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;if(t.label!=null){if(typeof t.label!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected");e.label=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.label)}return t.queryVerb!=null&&(e.queryVerb=String(t.queryVerb)),t.queryPrepend!=null&&(e.queryPrepend=String(t.queryPrepend)),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.label=null,o.queryVerb="",o.queryPrepend=""),t.label!=null&&t.hasOwnProperty("label")&&(o.label=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.label,e)),t.queryVerb!=null&&t.hasOwnProperty("queryVerb")&&(o.queryVerb=t.queryVerb),t.queryPrepend!=null&&t.hasOwnProperty("queryPrepend")&&(o.queryPrepend=t.queryPrepend),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.SearchTabProto.InputBoxInfo"},l}(),i}(),c.CobrandProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.logoUrl="",i.prototype.xCoord=null,i.prototype.yCoord=null,i.prototype.tiePoint=6,i.prototype.screenSize=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.CobrandProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.logoUrl=r.string();break}case 2:{o.xCoord=n.keyhole.dbroot.CobrandProto.Coord.decode(r,r.uint32());break}case 3:{o.yCoord=n.keyhole.dbroot.CobrandProto.Coord.decode(r,r.uint32());break}case 4:{o.tiePoint=r.int32();break}case 5:{o.screenSize=r.double();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("logoUrl"))throw u.ProtocolError("missing required 'logoUrl'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.logoUrl))return"logoUrl: string expected";if(r.xCoord!=null&&r.hasOwnProperty("xCoord")){var t=n.keyhole.dbroot.CobrandProto.Coord.verify(r.xCoord);if(t)return"xCoord."+t}if(r.yCoord!=null&&r.hasOwnProperty("yCoord")){var t=n.keyhole.dbroot.CobrandProto.Coord.verify(r.yCoord);if(t)return"yCoord."+t}if(r.tiePoint!=null&&r.hasOwnProperty("tiePoint"))switch(r.tiePoint){default:return"tiePoint: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return r.screenSize!=null&&r.hasOwnProperty("screenSize")&&typeof r.screenSize!="number"?"screenSize: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.CobrandProto)return r;var t=new n.keyhole.dbroot.CobrandProto;if(r.logoUrl!=null&&(t.logoUrl=String(r.logoUrl)),r.xCoord!=null){if(typeof r.xCoord!="object")throw TypeError(".keyhole.dbroot.CobrandProto.xCoord: object expected");t.xCoord=n.keyhole.dbroot.CobrandProto.Coord.fromObject(r.xCoord)}if(r.yCoord!=null){if(typeof r.yCoord!="object")throw TypeError(".keyhole.dbroot.CobrandProto.yCoord: object expected");t.yCoord=n.keyhole.dbroot.CobrandProto.Coord.fromObject(r.yCoord)}switch(r.tiePoint){case"TOP_LEFT":case 0:t.tiePoint=0;break;case"TOP_CENTER":case 1:t.tiePoint=1;break;case"TOP_RIGHT":case 2:t.tiePoint=2;break;case"MID_LEFT":case 3:t.tiePoint=3;break;case"MID_CENTER":case 4:t.tiePoint=4;break;case"MID_RIGHT":case 5:t.tiePoint=5;break;case"BOTTOM_LEFT":case 6:t.tiePoint=6;break;case"BOTTOM_CENTER":case 7:t.tiePoint=7;break;case"BOTTOM_RIGHT":case 8:t.tiePoint=8;break}return r.screenSize!=null&&(t.screenSize=Number(r.screenSize)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.logoUrl="",e.xCoord=null,e.yCoord=null,e.tiePoint=t.enums===String?"BOTTOM_LEFT":6,e.screenSize=0),r.logoUrl!=null&&r.hasOwnProperty("logoUrl")&&(e.logoUrl=r.logoUrl),r.xCoord!=null&&r.hasOwnProperty("xCoord")&&(e.xCoord=n.keyhole.dbroot.CobrandProto.Coord.toObject(r.xCoord,t)),r.yCoord!=null&&r.hasOwnProperty("yCoord")&&(e.yCoord=n.keyhole.dbroot.CobrandProto.Coord.toObject(r.yCoord,t)),r.tiePoint!=null&&r.hasOwnProperty("tiePoint")&&(e.tiePoint=t.enums===String?n.keyhole.dbroot.CobrandProto.TiePoint[r.tiePoint]:r.tiePoint),r.screenSize!=null&&r.hasOwnProperty("screenSize")&&(e.screenSize=t.json&&!isFinite(r.screenSize)?String(r.screenSize):r.screenSize),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.CobrandProto"},i.Coord=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.value=0,l.prototype.isRelative=!1,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.CobrandProto.Coord;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.value=t.double();break}case 2:{a.isRelative=t.bool();break}default:t.skipType(p&7);break}}if(!a.hasOwnProperty("value"))throw u.ProtocolError("missing required 'value'",{instance:a});return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":typeof t.value!="number"?"value: number expected":t.isRelative!=null&&t.hasOwnProperty("isRelative")&&typeof t.isRelative!="boolean"?"isRelative: boolean expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.CobrandProto.Coord)return t;var e=new n.keyhole.dbroot.CobrandProto.Coord;return t.value!=null&&(e.value=Number(t.value)),t.isRelative!=null&&(e.isRelative=!!t.isRelative),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.value=0,o.isRelative=!1),t.value!=null&&t.hasOwnProperty("value")&&(o.value=e.json&&!isFinite(t.value)?String(t.value):t.value),t.isRelative!=null&&t.hasOwnProperty("isRelative")&&(o.isRelative=t.isRelative),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.CobrandProto.Coord"},l}(),i.TiePoint=function(){var l={},r=Object.create(l);return r[l[0]="TOP_LEFT"]=0,r[l[1]="TOP_CENTER"]=1,r[l[2]="TOP_RIGHT"]=2,r[l[3]="MID_LEFT"]=3,r[l[4]="MID_CENTER"]=4,r[l[5]="MID_RIGHT"]=5,r[l[6]="BOTTOM_LEFT"]=6,r[l[7]="BOTTOM_CENTER"]=7,r[l[8]="BOTTOM_RIGHT"]=8,r}(),i}(),c.DatabaseDescriptionProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.databaseName=null,i.prototype.databaseUrl="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DatabaseDescriptionProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.databaseName=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.databaseUrl=r.string();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("databaseUrl"))throw u.ProtocolError("missing required 'databaseUrl'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.databaseName!=null&&r.hasOwnProperty("databaseName")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.databaseName);if(t)return"databaseName."+t}return u.isString(r.databaseUrl)?null:"databaseUrl: string expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DatabaseDescriptionProto)return r;var t=new n.keyhole.dbroot.DatabaseDescriptionProto;if(r.databaseName!=null){if(typeof r.databaseName!="object")throw TypeError(".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected");t.databaseName=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.databaseName)}return r.databaseUrl!=null&&(t.databaseUrl=String(r.databaseUrl)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.databaseName=null,e.databaseUrl=""),r.databaseName!=null&&r.hasOwnProperty("databaseName")&&(e.databaseName=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.databaseName,t)),r.databaseUrl!=null&&r.hasOwnProperty("databaseUrl")&&(e.databaseUrl=r.databaseUrl),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DatabaseDescriptionProto"},i}(),c.ConfigScriptProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.scriptName="",i.prototype.scriptData="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ConfigScriptProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.scriptName=r.string();break}case 2:{o.scriptData=r.string();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("scriptName"))throw u.ProtocolError("missing required 'scriptName'",{instance:o});if(!o.hasOwnProperty("scriptData"))throw u.ProtocolError("missing required 'scriptData'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isString(r.scriptName)?u.isString(r.scriptData)?null:"scriptData: string expected":"scriptName: string expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ConfigScriptProto)return r;var t=new n.keyhole.dbroot.ConfigScriptProto;return r.scriptName!=null&&(t.scriptName=String(r.scriptName)),r.scriptData!=null&&(t.scriptData=String(r.scriptData)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.scriptName="",e.scriptData=""),r.scriptName!=null&&r.hasOwnProperty("scriptName")&&(e.scriptName=r.scriptName),r.scriptData!=null&&r.hasOwnProperty("scriptData")&&(e.scriptData=r.scriptData),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ConfigScriptProto"},i}(),c.SwoopParamsProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.startDistInMeters=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.SwoopParamsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.startDistInMeters=r.double();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.startDistInMeters!=null&&r.hasOwnProperty("startDistInMeters")&&typeof r.startDistInMeters!="number"?"startDistInMeters: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.SwoopParamsProto)return r;var t=new n.keyhole.dbroot.SwoopParamsProto;return r.startDistInMeters!=null&&(t.startDistInMeters=Number(r.startDistInMeters)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.startDistInMeters=0),r.startDistInMeters!=null&&r.hasOwnProperty("startDistInMeters")&&(e.startDistInMeters=t.json&&!isFinite(r.startDistInMeters)?String(r.startDistInMeters):r.startDistInMeters),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.SwoopParamsProto"},i}(),c.PostingServerProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.name=null,i.prototype.baseUrl=null,i.prototype.postWizardPath=null,i.prototype.fileSubmitPath=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PostingServerProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.name=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.baseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.postWizardPath=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 4:{o.fileSubmitPath=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.name);if(t)return"name."+t}if(r.baseUrl!=null&&r.hasOwnProperty("baseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.baseUrl);if(t)return"baseUrl."+t}if(r.postWizardPath!=null&&r.hasOwnProperty("postWizardPath")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.postWizardPath);if(t)return"postWizardPath."+t}if(r.fileSubmitPath!=null&&r.hasOwnProperty("fileSubmitPath")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.fileSubmitPath);if(t)return"fileSubmitPath."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PostingServerProto)return r;var t=new n.keyhole.dbroot.PostingServerProto;if(r.name!=null){if(typeof r.name!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.name: object expected");t.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.name)}if(r.baseUrl!=null){if(typeof r.baseUrl!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.baseUrl: object expected");t.baseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.baseUrl)}if(r.postWizardPath!=null){if(typeof r.postWizardPath!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.postWizardPath: object expected");t.postWizardPath=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.postWizardPath)}if(r.fileSubmitPath!=null){if(typeof r.fileSubmitPath!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected");t.fileSubmitPath=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.fileSubmitPath)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.name=null,e.baseUrl=null,e.postWizardPath=null,e.fileSubmitPath=null),r.name!=null&&r.hasOwnProperty("name")&&(e.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.name,t)),r.baseUrl!=null&&r.hasOwnProperty("baseUrl")&&(e.baseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.baseUrl,t)),r.postWizardPath!=null&&r.hasOwnProperty("postWizardPath")&&(e.postWizardPath=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.postWizardPath,t)),r.fileSubmitPath!=null&&r.hasOwnProperty("fileSubmitPath")&&(e.fileSubmitPath=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.fileSubmitPath,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PostingServerProto"},i}(),c.PlanetaryDatabaseProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.url=null,i.prototype.name=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PlanetaryDatabaseProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.url=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.name=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("url"))throw u.ProtocolError("missing required 'url'",{instance:o});if(!o.hasOwnProperty("name"))throw u.ProtocolError("missing required 'name'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";{var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.url);if(t)return"url."+t}{var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.name);if(t)return"name."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PlanetaryDatabaseProto)return r;var t=new n.keyhole.dbroot.PlanetaryDatabaseProto;if(r.url!=null){if(typeof r.url!="object")throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected");t.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.url)}if(r.name!=null){if(typeof r.name!="object")throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected");t.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.name)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.url=null,e.name=null),r.url!=null&&r.hasOwnProperty("url")&&(e.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.url,t)),r.name!=null&&r.hasOwnProperty("name")&&(e.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.name,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PlanetaryDatabaseProto"},i}(),c.LogServerProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.url=null,i.prototype.enable=!1,i.prototype.throttlingFactor=1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.LogServerProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.url=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.enable=r.bool();break}case 3:{o.throttlingFactor=r.int32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.url!=null&&r.hasOwnProperty("url")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.url);if(t)return"url."+t}return r.enable!=null&&r.hasOwnProperty("enable")&&typeof r.enable!="boolean"?"enable: boolean expected":r.throttlingFactor!=null&&r.hasOwnProperty("throttlingFactor")&&!u.isInteger(r.throttlingFactor)?"throttlingFactor: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.LogServerProto)return r;var t=new n.keyhole.dbroot.LogServerProto;if(r.url!=null){if(typeof r.url!="object")throw TypeError(".keyhole.dbroot.LogServerProto.url: object expected");t.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.url)}return r.enable!=null&&(t.enable=!!r.enable),r.throttlingFactor!=null&&(t.throttlingFactor=r.throttlingFactor|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.url=null,e.enable=!1,e.throttlingFactor=1),r.url!=null&&r.hasOwnProperty("url")&&(e.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.url,t)),r.enable!=null&&r.hasOwnProperty("enable")&&(e.enable=r.enable),r.throttlingFactor!=null&&r.hasOwnProperty("throttlingFactor")&&(e.throttlingFactor=r.throttlingFactor),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.LogServerProto"},i}(),c.EndSnippetProto=function(){function i(l){if(this.mfeDomains=[],this.searchTab=[],this.cobrandInfo=[],this.validDatabase=[],this.configScript=[],this.planetaryDatabase=[],this.filmstripConfig=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.model=null,i.prototype.authServerUrl=null,i.prototype.disableAuthentication=!1,i.prototype.mfeDomains=u.emptyArray,i.prototype.mfeLangParam="hl=$5Bhl5D",i.prototype.adsUrlPatterns="",i.prototype.reverseGeocoderUrl=null,i.prototype.reverseGeocoderProtocolVersion=3,i.prototype.skyDatabaseIsAvailable=!0,i.prototype.skyDatabaseUrl=null,i.prototype.defaultWebPageIntlUrl=null,i.prototype.numStartUpTips=17,i.prototype.startUpTipsUrl=null,i.prototype.numProStartUpTips=0,i.prototype.proStartUpTipsUrl=null,i.prototype.startupTipsIntlUrl=null,i.prototype.userGuideIntlUrl=null,i.prototype.supportCenterIntlUrl=null,i.prototype.businessListingIntlUrl=null,i.prototype.supportAnswerIntlUrl=null,i.prototype.supportTopicIntlUrl=null,i.prototype.supportRequestIntlUrl=null,i.prototype.earthIntlUrl=null,i.prototype.addContentUrl=null,i.prototype.sketchupNotInstalledUrl=null,i.prototype.sketchupErrorUrl=null,i.prototype.freeLicenseUrl=null,i.prototype.proLicenseUrl=null,i.prototype.tutorialUrl=null,i.prototype.keyboardShortcutsUrl=null,i.prototype.releaseNotesUrl=null,i.prototype.hideUserData=!1,i.prototype.useGeLogo=!0,i.prototype.dioramaDescriptionUrlBase=null,i.prototype.dioramaDefaultColor=4291281607,i.prototype.dioramaBlacklistUrl=null,i.prototype.clientOptions=null,i.prototype.fetchingOptions=null,i.prototype.timeMachineOptions=null,i.prototype.csiOptions=null,i.prototype.searchTab=u.emptyArray,i.prototype.cobrandInfo=u.emptyArray,i.prototype.validDatabase=u.emptyArray,i.prototype.configScript=u.emptyArray,i.prototype.deauthServerUrl=null,i.prototype.swoopParameters=null,i.prototype.bbsServerInfo=null,i.prototype.dataErrorServerInfo=null,i.prototype.planetaryDatabase=u.emptyArray,i.prototype.logServer=null,i.prototype.autopiaOptions=null,i.prototype.searchConfig=null,i.prototype.searchInfo=null,i.prototype.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",i.prototype.elevationProfileQueryDelay=500,i.prototype.proUpgradeUrl=null,i.prototype.earthCommunityUrl=null,i.prototype.googleMapsUrl=null,i.prototype.sharingUrl=null,i.prototype.privacyPolicyUrl=null,i.prototype.doGplusUserCheck=!1,i.prototype.rocktreeDataProto=null,i.prototype.filmstripConfig=u.emptyArray,i.prototype.showSigninButton=!1,i.prototype.proMeasureUpsellUrl=null,i.prototype.proPrintUpsellUrl=null,i.prototype.starDataProto=null,i.prototype.feedbackUrl=null,i.prototype.oauth2LoginUrl=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.EndSnippetProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.model=n.keyhole.dbroot.PlanetModelProto.decode(r,r.uint32());break}case 2:{o.authServerUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.disableAuthentication=r.bool();break}case 4:{o.mfeDomains&&o.mfeDomains.length||(o.mfeDomains=[]),o.mfeDomains.push(n.keyhole.dbroot.MfeDomainFeaturesProto.decode(r,r.uint32()));break}case 5:{o.mfeLangParam=r.string();break}case 6:{o.adsUrlPatterns=r.string();break}case 7:{o.reverseGeocoderUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 8:{o.reverseGeocoderProtocolVersion=r.int32();break}case 9:{o.skyDatabaseIsAvailable=r.bool();break}case 10:{o.skyDatabaseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 11:{o.defaultWebPageIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 12:{o.numStartUpTips=r.int32();break}case 13:{o.startUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 51:{o.numProStartUpTips=r.int32();break}case 52:{o.proStartUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 64:{o.startupTipsIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 14:{o.userGuideIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 15:{o.supportCenterIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 16:{o.businessListingIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 17:{o.supportAnswerIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 18:{o.supportTopicIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 19:{o.supportRequestIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 20:{o.earthIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 21:{o.addContentUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 22:{o.sketchupNotInstalledUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 23:{o.sketchupErrorUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 24:{o.freeLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 25:{o.proLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 48:{o.tutorialUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 49:{o.keyboardShortcutsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 50:{o.releaseNotesUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 26:{o.hideUserData=r.bool();break}case 27:{o.useGeLogo=r.bool();break}case 28:{o.dioramaDescriptionUrlBase=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 29:{o.dioramaDefaultColor=r.uint32();break}case 53:{o.dioramaBlacklistUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 30:{o.clientOptions=n.keyhole.dbroot.ClientOptionsProto.decode(r,r.uint32());break}case 31:{o.fetchingOptions=n.keyhole.dbroot.FetchingOptionsProto.decode(r,r.uint32());break}case 32:{o.timeMachineOptions=n.keyhole.dbroot.TimeMachineOptionsProto.decode(r,r.uint32());break}case 33:{o.csiOptions=n.keyhole.dbroot.CSIOptionsProto.decode(r,r.uint32());break}case 34:{o.searchTab&&o.searchTab.length||(o.searchTab=[]),o.searchTab.push(n.keyhole.dbroot.SearchTabProto.decode(r,r.uint32()));break}case 35:{o.cobrandInfo&&o.cobrandInfo.length||(o.cobrandInfo=[]),o.cobrandInfo.push(n.keyhole.dbroot.CobrandProto.decode(r,r.uint32()));break}case 36:{o.validDatabase&&o.validDatabase.length||(o.validDatabase=[]),o.validDatabase.push(n.keyhole.dbroot.DatabaseDescriptionProto.decode(r,r.uint32()));break}case 37:{o.configScript&&o.configScript.length||(o.configScript=[]),o.configScript.push(n.keyhole.dbroot.ConfigScriptProto.decode(r,r.uint32()));break}case 38:{o.deauthServerUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 39:{o.swoopParameters=n.keyhole.dbroot.SwoopParamsProto.decode(r,r.uint32());break}case 40:{o.bbsServerInfo=n.keyhole.dbroot.PostingServerProto.decode(r,r.uint32());break}case 41:{o.dataErrorServerInfo=n.keyhole.dbroot.PostingServerProto.decode(r,r.uint32());break}case 42:{o.planetaryDatabase&&o.planetaryDatabase.length||(o.planetaryDatabase=[]),o.planetaryDatabase.push(n.keyhole.dbroot.PlanetaryDatabaseProto.decode(r,r.uint32()));break}case 43:{o.logServer=n.keyhole.dbroot.LogServerProto.decode(r,r.uint32());break}case 44:{o.autopiaOptions=n.keyhole.dbroot.AutopiaOptionsProto.decode(r,r.uint32());break}case 54:{o.searchConfig=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.decode(r,r.uint32());break}case 45:{o.searchInfo=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.decode(r,r.uint32());break}case 46:{o.elevationServiceBaseUrl=r.string();break}case 47:{o.elevationProfileQueryDelay=r.int32();break}case 55:{o.proUpgradeUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 56:{o.earthCommunityUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 57:{o.googleMapsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 58:{o.sharingUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 59:{o.privacyPolicyUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 60:{o.doGplusUserCheck=r.bool();break}case 61:{o.rocktreeDataProto=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.decode(r,r.uint32());break}case 62:{o.filmstripConfig&&o.filmstripConfig.length||(o.filmstripConfig=[]),o.filmstripConfig.push(n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.decode(r,r.uint32()));break}case 63:{o.showSigninButton=r.bool();break}case 65:{o.proMeasureUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 66:{o.proPrintUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 67:{o.starDataProto=n.keyhole.dbroot.EndSnippetProto.StarDataProto.decode(r,r.uint32());break}case 68:{o.feedbackUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 69:{o.oauth2LoginUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.model!=null&&r.hasOwnProperty("model")){var t=n.keyhole.dbroot.PlanetModelProto.verify(r.model);if(t)return"model."+t}if(r.authServerUrl!=null&&r.hasOwnProperty("authServerUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.authServerUrl);if(t)return"authServerUrl."+t}if(r.disableAuthentication!=null&&r.hasOwnProperty("disableAuthentication")&&typeof r.disableAuthentication!="boolean")return"disableAuthentication: boolean expected";if(r.mfeDomains!=null&&r.hasOwnProperty("mfeDomains")){if(!Array.isArray(r.mfeDomains))return"mfeDomains: array expected";for(var e=0;e<r.mfeDomains.length;++e){var t=n.keyhole.dbroot.MfeDomainFeaturesProto.verify(r.mfeDomains[e]);if(t)return"mfeDomains."+t}}if(r.mfeLangParam!=null&&r.hasOwnProperty("mfeLangParam")&&!u.isString(r.mfeLangParam))return"mfeLangParam: string expected";if(r.adsUrlPatterns!=null&&r.hasOwnProperty("adsUrlPatterns")&&!u.isString(r.adsUrlPatterns))return"adsUrlPatterns: string expected";if(r.reverseGeocoderUrl!=null&&r.hasOwnProperty("reverseGeocoderUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.reverseGeocoderUrl);if(t)return"reverseGeocoderUrl."+t}if(r.reverseGeocoderProtocolVersion!=null&&r.hasOwnProperty("reverseGeocoderProtocolVersion")&&!u.isInteger(r.reverseGeocoderProtocolVersion))return"reverseGeocoderProtocolVersion: integer expected";if(r.skyDatabaseIsAvailable!=null&&r.hasOwnProperty("skyDatabaseIsAvailable")&&typeof r.skyDatabaseIsAvailable!="boolean")return"skyDatabaseIsAvailable: boolean expected";if(r.skyDatabaseUrl!=null&&r.hasOwnProperty("skyDatabaseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.skyDatabaseUrl);if(t)return"skyDatabaseUrl."+t}if(r.defaultWebPageIntlUrl!=null&&r.hasOwnProperty("defaultWebPageIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.defaultWebPageIntlUrl);if(t)return"defaultWebPageIntlUrl."+t}if(r.numStartUpTips!=null&&r.hasOwnProperty("numStartUpTips")&&!u.isInteger(r.numStartUpTips))return"numStartUpTips: integer expected";if(r.startUpTipsUrl!=null&&r.hasOwnProperty("startUpTipsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.startUpTipsUrl);if(t)return"startUpTipsUrl."+t}if(r.numProStartUpTips!=null&&r.hasOwnProperty("numProStartUpTips")&&!u.isInteger(r.numProStartUpTips))return"numProStartUpTips: integer expected";if(r.proStartUpTipsUrl!=null&&r.hasOwnProperty("proStartUpTipsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proStartUpTipsUrl);if(t)return"proStartUpTipsUrl."+t}if(r.startupTipsIntlUrl!=null&&r.hasOwnProperty("startupTipsIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.startupTipsIntlUrl);if(t)return"startupTipsIntlUrl."+t}if(r.userGuideIntlUrl!=null&&r.hasOwnProperty("userGuideIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.userGuideIntlUrl);if(t)return"userGuideIntlUrl."+t}if(r.supportCenterIntlUrl!=null&&r.hasOwnProperty("supportCenterIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportCenterIntlUrl);if(t)return"supportCenterIntlUrl."+t}if(r.businessListingIntlUrl!=null&&r.hasOwnProperty("businessListingIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.businessListingIntlUrl);if(t)return"businessListingIntlUrl."+t}if(r.supportAnswerIntlUrl!=null&&r.hasOwnProperty("supportAnswerIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportAnswerIntlUrl);if(t)return"supportAnswerIntlUrl."+t}if(r.supportTopicIntlUrl!=null&&r.hasOwnProperty("supportTopicIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportTopicIntlUrl);if(t)return"supportTopicIntlUrl."+t}if(r.supportRequestIntlUrl!=null&&r.hasOwnProperty("supportRequestIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportRequestIntlUrl);if(t)return"supportRequestIntlUrl."+t}if(r.earthIntlUrl!=null&&r.hasOwnProperty("earthIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.earthIntlUrl);if(t)return"earthIntlUrl."+t}if(r.addContentUrl!=null&&r.hasOwnProperty("addContentUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.addContentUrl);if(t)return"addContentUrl."+t}if(r.sketchupNotInstalledUrl!=null&&r.hasOwnProperty("sketchupNotInstalledUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.sketchupNotInstalledUrl);if(t)return"sketchupNotInstalledUrl."+t}if(r.sketchupErrorUrl!=null&&r.hasOwnProperty("sketchupErrorUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.sketchupErrorUrl);if(t)return"sketchupErrorUrl."+t}if(r.freeLicenseUrl!=null&&r.hasOwnProperty("freeLicenseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.freeLicenseUrl);if(t)return"freeLicenseUrl."+t}if(r.proLicenseUrl!=null&&r.hasOwnProperty("proLicenseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proLicenseUrl);if(t)return"proLicenseUrl."+t}if(r.tutorialUrl!=null&&r.hasOwnProperty("tutorialUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.tutorialUrl);if(t)return"tutorialUrl."+t}if(r.keyboardShortcutsUrl!=null&&r.hasOwnProperty("keyboardShortcutsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.keyboardShortcutsUrl);if(t)return"keyboardShortcutsUrl."+t}if(r.releaseNotesUrl!=null&&r.hasOwnProperty("releaseNotesUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.releaseNotesUrl);if(t)return"releaseNotesUrl."+t}if(r.hideUserData!=null&&r.hasOwnProperty("hideUserData")&&typeof r.hideUserData!="boolean")return"hideUserData: boolean expected";if(r.useGeLogo!=null&&r.hasOwnProperty("useGeLogo")&&typeof r.useGeLogo!="boolean")return"useGeLogo: boolean expected";if(r.dioramaDescriptionUrlBase!=null&&r.hasOwnProperty("dioramaDescriptionUrlBase")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.dioramaDescriptionUrlBase);if(t)return"dioramaDescriptionUrlBase."+t}if(r.dioramaDefaultColor!=null&&r.hasOwnProperty("dioramaDefaultColor")&&!u.isInteger(r.dioramaDefaultColor))return"dioramaDefaultColor: integer expected";if(r.dioramaBlacklistUrl!=null&&r.hasOwnProperty("dioramaBlacklistUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.dioramaBlacklistUrl);if(t)return"dioramaBlacklistUrl."+t}if(r.clientOptions!=null&&r.hasOwnProperty("clientOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.verify(r.clientOptions);if(t)return"clientOptions."+t}if(r.fetchingOptions!=null&&r.hasOwnProperty("fetchingOptions")){var t=n.keyhole.dbroot.FetchingOptionsProto.verify(r.fetchingOptions);if(t)return"fetchingOptions."+t}if(r.timeMachineOptions!=null&&r.hasOwnProperty("timeMachineOptions")){var t=n.keyhole.dbroot.TimeMachineOptionsProto.verify(r.timeMachineOptions);if(t)return"timeMachineOptions."+t}if(r.csiOptions!=null&&r.hasOwnProperty("csiOptions")){var t=n.keyhole.dbroot.CSIOptionsProto.verify(r.csiOptions);if(t)return"csiOptions."+t}if(r.searchTab!=null&&r.hasOwnProperty("searchTab")){if(!Array.isArray(r.searchTab))return"searchTab: array expected";for(var e=0;e<r.searchTab.length;++e){var t=n.keyhole.dbroot.SearchTabProto.verify(r.searchTab[e]);if(t)return"searchTab."+t}}if(r.cobrandInfo!=null&&r.hasOwnProperty("cobrandInfo")){if(!Array.isArray(r.cobrandInfo))return"cobrandInfo: array expected";for(var e=0;e<r.cobrandInfo.length;++e){var t=n.keyhole.dbroot.CobrandProto.verify(r.cobrandInfo[e]);if(t)return"cobrandInfo."+t}}if(r.validDatabase!=null&&r.hasOwnProperty("validDatabase")){if(!Array.isArray(r.validDatabase))return"validDatabase: array expected";for(var e=0;e<r.validDatabase.length;++e){var t=n.keyhole.dbroot.DatabaseDescriptionProto.verify(r.validDatabase[e]);if(t)return"validDatabase."+t}}if(r.configScript!=null&&r.hasOwnProperty("configScript")){if(!Array.isArray(r.configScript))return"configScript: array expected";for(var e=0;e<r.configScript.length;++e){var t=n.keyhole.dbroot.ConfigScriptProto.verify(r.configScript[e]);if(t)return"configScript."+t}}if(r.deauthServerUrl!=null&&r.hasOwnProperty("deauthServerUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.deauthServerUrl);if(t)return"deauthServerUrl."+t}if(r.swoopParameters!=null&&r.hasOwnProperty("swoopParameters")){var t=n.keyhole.dbroot.SwoopParamsProto.verify(r.swoopParameters);if(t)return"swoopParameters."+t}if(r.bbsServerInfo!=null&&r.hasOwnProperty("bbsServerInfo")){var t=n.keyhole.dbroot.PostingServerProto.verify(r.bbsServerInfo);if(t)return"bbsServerInfo."+t}if(r.dataErrorServerInfo!=null&&r.hasOwnProperty("dataErrorServerInfo")){var t=n.keyhole.dbroot.PostingServerProto.verify(r.dataErrorServerInfo);if(t)return"dataErrorServerInfo."+t}if(r.planetaryDatabase!=null&&r.hasOwnProperty("planetaryDatabase")){if(!Array.isArray(r.planetaryDatabase))return"planetaryDatabase: array expected";for(var e=0;e<r.planetaryDatabase.length;++e){var t=n.keyhole.dbroot.PlanetaryDatabaseProto.verify(r.planetaryDatabase[e]);if(t)return"planetaryDatabase."+t}}if(r.logServer!=null&&r.hasOwnProperty("logServer")){var t=n.keyhole.dbroot.LogServerProto.verify(r.logServer);if(t)return"logServer."+t}if(r.autopiaOptions!=null&&r.hasOwnProperty("autopiaOptions")){var t=n.keyhole.dbroot.AutopiaOptionsProto.verify(r.autopiaOptions);if(t)return"autopiaOptions."+t}if(r.searchConfig!=null&&r.hasOwnProperty("searchConfig")){var t=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.verify(r.searchConfig);if(t)return"searchConfig."+t}if(r.searchInfo!=null&&r.hasOwnProperty("searchInfo")){var t=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.verify(r.searchInfo);if(t)return"searchInfo."+t}if(r.elevationServiceBaseUrl!=null&&r.hasOwnProperty("elevationServiceBaseUrl")&&!u.isString(r.elevationServiceBaseUrl))return"elevationServiceBaseUrl: string expected";if(r.elevationProfileQueryDelay!=null&&r.hasOwnProperty("elevationProfileQueryDelay")&&!u.isInteger(r.elevationProfileQueryDelay))return"elevationProfileQueryDelay: integer expected";if(r.proUpgradeUrl!=null&&r.hasOwnProperty("proUpgradeUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proUpgradeUrl);if(t)return"proUpgradeUrl."+t}if(r.earthCommunityUrl!=null&&r.hasOwnProperty("earthCommunityUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.earthCommunityUrl);if(t)return"earthCommunityUrl."+t}if(r.googleMapsUrl!=null&&r.hasOwnProperty("googleMapsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.googleMapsUrl);if(t)return"googleMapsUrl."+t}if(r.sharingUrl!=null&&r.hasOwnProperty("sharingUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.sharingUrl);if(t)return"sharingUrl."+t}if(r.privacyPolicyUrl!=null&&r.hasOwnProperty("privacyPolicyUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.privacyPolicyUrl);if(t)return"privacyPolicyUrl."+t}if(r.doGplusUserCheck!=null&&r.hasOwnProperty("doGplusUserCheck")&&typeof r.doGplusUserCheck!="boolean")return"doGplusUserCheck: boolean expected";if(r.rocktreeDataProto!=null&&r.hasOwnProperty("rocktreeDataProto")){var t=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.verify(r.rocktreeDataProto);if(t)return"rocktreeDataProto."+t}if(r.filmstripConfig!=null&&r.hasOwnProperty("filmstripConfig")){if(!Array.isArray(r.filmstripConfig))return"filmstripConfig: array expected";for(var e=0;e<r.filmstripConfig.length;++e){var t=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.verify(r.filmstripConfig[e]);if(t)return"filmstripConfig."+t}}if(r.showSigninButton!=null&&r.hasOwnProperty("showSigninButton")&&typeof r.showSigninButton!="boolean")return"showSigninButton: boolean expected";if(r.proMeasureUpsellUrl!=null&&r.hasOwnProperty("proMeasureUpsellUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proMeasureUpsellUrl);if(t)return"proMeasureUpsellUrl."+t}if(r.proPrintUpsellUrl!=null&&r.hasOwnProperty("proPrintUpsellUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proPrintUpsellUrl);if(t)return"proPrintUpsellUrl."+t}if(r.starDataProto!=null&&r.hasOwnProperty("starDataProto")){var t=n.keyhole.dbroot.EndSnippetProto.StarDataProto.verify(r.starDataProto);if(t)return"starDataProto."+t}if(r.feedbackUrl!=null&&r.hasOwnProperty("feedbackUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.feedbackUrl);if(t)return"feedbackUrl."+t}if(r.oauth2LoginUrl!=null&&r.hasOwnProperty("oauth2LoginUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.oauth2LoginUrl);if(t)return"oauth2LoginUrl."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.EndSnippetProto)return r;var t=new n.keyhole.dbroot.EndSnippetProto;if(r.model!=null){if(typeof r.model!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.model: object expected");t.model=n.keyhole.dbroot.PlanetModelProto.fromObject(r.model)}if(r.authServerUrl!=null){if(typeof r.authServerUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.authServerUrl: object expected");t.authServerUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.authServerUrl)}if(r.disableAuthentication!=null&&(t.disableAuthentication=!!r.disableAuthentication),r.mfeDomains){if(!Array.isArray(r.mfeDomains))throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: array expected");t.mfeDomains=[];for(var e=0;e<r.mfeDomains.length;++e){if(typeof r.mfeDomains[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: object expected");t.mfeDomains[e]=n.keyhole.dbroot.MfeDomainFeaturesProto.fromObject(r.mfeDomains[e])}}if(r.mfeLangParam!=null&&(t.mfeLangParam=String(r.mfeLangParam)),r.adsUrlPatterns!=null&&(t.adsUrlPatterns=String(r.adsUrlPatterns)),r.reverseGeocoderUrl!=null){if(typeof r.reverseGeocoderUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.reverseGeocoderUrl: object expected");t.reverseGeocoderUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.reverseGeocoderUrl)}if(r.reverseGeocoderProtocolVersion!=null&&(t.reverseGeocoderProtocolVersion=r.reverseGeocoderProtocolVersion|0),r.skyDatabaseIsAvailable!=null&&(t.skyDatabaseIsAvailable=!!r.skyDatabaseIsAvailable),r.skyDatabaseUrl!=null){if(typeof r.skyDatabaseUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.skyDatabaseUrl: object expected");t.skyDatabaseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.skyDatabaseUrl)}if(r.defaultWebPageIntlUrl!=null){if(typeof r.defaultWebPageIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.defaultWebPageIntlUrl: object expected");t.defaultWebPageIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.defaultWebPageIntlUrl)}if(r.numStartUpTips!=null&&(t.numStartUpTips=r.numStartUpTips|0),r.startUpTipsUrl!=null){if(typeof r.startUpTipsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.startUpTipsUrl: object expected");t.startUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.startUpTipsUrl)}if(r.numProStartUpTips!=null&&(t.numProStartUpTips=r.numProStartUpTips|0),r.proStartUpTipsUrl!=null){if(typeof r.proStartUpTipsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proStartUpTipsUrl: object expected");t.proStartUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proStartUpTipsUrl)}if(r.startupTipsIntlUrl!=null){if(typeof r.startupTipsIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.startupTipsIntlUrl: object expected");t.startupTipsIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.startupTipsIntlUrl)}if(r.userGuideIntlUrl!=null){if(typeof r.userGuideIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.userGuideIntlUrl: object expected");t.userGuideIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.userGuideIntlUrl)}if(r.supportCenterIntlUrl!=null){if(typeof r.supportCenterIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportCenterIntlUrl: object expected");t.supportCenterIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportCenterIntlUrl)}if(r.businessListingIntlUrl!=null){if(typeof r.businessListingIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.businessListingIntlUrl: object expected");t.businessListingIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.businessListingIntlUrl)}if(r.supportAnswerIntlUrl!=null){if(typeof r.supportAnswerIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportAnswerIntlUrl: object expected");t.supportAnswerIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportAnswerIntlUrl)}if(r.supportTopicIntlUrl!=null){if(typeof r.supportTopicIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportTopicIntlUrl: object expected");t.supportTopicIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportTopicIntlUrl)}if(r.supportRequestIntlUrl!=null){if(typeof r.supportRequestIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportRequestIntlUrl: object expected");t.supportRequestIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportRequestIntlUrl)}if(r.earthIntlUrl!=null){if(typeof r.earthIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.earthIntlUrl: object expected");t.earthIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.earthIntlUrl)}if(r.addContentUrl!=null){if(typeof r.addContentUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.addContentUrl: object expected");t.addContentUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.addContentUrl)}if(r.sketchupNotInstalledUrl!=null){if(typeof r.sketchupNotInstalledUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupNotInstalledUrl: object expected");t.sketchupNotInstalledUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.sketchupNotInstalledUrl)}if(r.sketchupErrorUrl!=null){if(typeof r.sketchupErrorUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupErrorUrl: object expected");t.sketchupErrorUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.sketchupErrorUrl)}if(r.freeLicenseUrl!=null){if(typeof r.freeLicenseUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.freeLicenseUrl: object expected");t.freeLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.freeLicenseUrl)}if(r.proLicenseUrl!=null){if(typeof r.proLicenseUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proLicenseUrl: object expected");t.proLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proLicenseUrl)}if(r.tutorialUrl!=null){if(typeof r.tutorialUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.tutorialUrl: object expected");t.tutorialUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.tutorialUrl)}if(r.keyboardShortcutsUrl!=null){if(typeof r.keyboardShortcutsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.keyboardShortcutsUrl: object expected");t.keyboardShortcutsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.keyboardShortcutsUrl)}if(r.releaseNotesUrl!=null){if(typeof r.releaseNotesUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.releaseNotesUrl: object expected");t.releaseNotesUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.releaseNotesUrl)}if(r.hideUserData!=null&&(t.hideUserData=!!r.hideUserData),r.useGeLogo!=null&&(t.useGeLogo=!!r.useGeLogo),r.dioramaDescriptionUrlBase!=null){if(typeof r.dioramaDescriptionUrlBase!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaDescriptionUrlBase: object expected");t.dioramaDescriptionUrlBase=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.dioramaDescriptionUrlBase)}if(r.dioramaDefaultColor!=null&&(t.dioramaDefaultColor=r.dioramaDefaultColor>>>0),r.dioramaBlacklistUrl!=null){if(typeof r.dioramaBlacklistUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected");t.dioramaBlacklistUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.dioramaBlacklistUrl)}if(r.clientOptions!=null){if(typeof r.clientOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.clientOptions: object expected");t.clientOptions=n.keyhole.dbroot.ClientOptionsProto.fromObject(r.clientOptions)}if(r.fetchingOptions!=null){if(typeof r.fetchingOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected");t.fetchingOptions=n.keyhole.dbroot.FetchingOptionsProto.fromObject(r.fetchingOptions)}if(r.timeMachineOptions!=null){if(typeof r.timeMachineOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected");t.timeMachineOptions=n.keyhole.dbroot.TimeMachineOptionsProto.fromObject(r.timeMachineOptions)}if(r.csiOptions!=null){if(typeof r.csiOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.csiOptions: object expected");t.csiOptions=n.keyhole.dbroot.CSIOptionsProto.fromObject(r.csiOptions)}if(r.searchTab){if(!Array.isArray(r.searchTab))throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: array expected");t.searchTab=[];for(var e=0;e<r.searchTab.length;++e){if(typeof r.searchTab[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: object expected");t.searchTab[e]=n.keyhole.dbroot.SearchTabProto.fromObject(r.searchTab[e])}}if(r.cobrandInfo){if(!Array.isArray(r.cobrandInfo))throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: array expected");t.cobrandInfo=[];for(var e=0;e<r.cobrandInfo.length;++e){if(typeof r.cobrandInfo[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: object expected");t.cobrandInfo[e]=n.keyhole.dbroot.CobrandProto.fromObject(r.cobrandInfo[e])}}if(r.validDatabase){if(!Array.isArray(r.validDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: array expected");t.validDatabase=[];for(var e=0;e<r.validDatabase.length;++e){if(typeof r.validDatabase[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: object expected");t.validDatabase[e]=n.keyhole.dbroot.DatabaseDescriptionProto.fromObject(r.validDatabase[e])}}if(r.configScript){if(!Array.isArray(r.configScript))throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: array expected");t.configScript=[];for(var e=0;e<r.configScript.length;++e){if(typeof r.configScript[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: object expected");t.configScript[e]=n.keyhole.dbroot.ConfigScriptProto.fromObject(r.configScript[e])}}if(r.deauthServerUrl!=null){if(typeof r.deauthServerUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.deauthServerUrl: object expected");t.deauthServerUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.deauthServerUrl)}if(r.swoopParameters!=null){if(typeof r.swoopParameters!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.swoopParameters: object expected");t.swoopParameters=n.keyhole.dbroot.SwoopParamsProto.fromObject(r.swoopParameters)}if(r.bbsServerInfo!=null){if(typeof r.bbsServerInfo!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.bbsServerInfo: object expected");t.bbsServerInfo=n.keyhole.dbroot.PostingServerProto.fromObject(r.bbsServerInfo)}if(r.dataErrorServerInfo!=null){if(typeof r.dataErrorServerInfo!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.dataErrorServerInfo: object expected");t.dataErrorServerInfo=n.keyhole.dbroot.PostingServerProto.fromObject(r.dataErrorServerInfo)}if(r.planetaryDatabase){if(!Array.isArray(r.planetaryDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: array expected");t.planetaryDatabase=[];for(var e=0;e<r.planetaryDatabase.length;++e){if(typeof r.planetaryDatabase[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: object expected");t.planetaryDatabase[e]=n.keyhole.dbroot.PlanetaryDatabaseProto.fromObject(r.planetaryDatabase[e])}}if(r.logServer!=null){if(typeof r.logServer!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.logServer: object expected");t.logServer=n.keyhole.dbroot.LogServerProto.fromObject(r.logServer)}if(r.autopiaOptions!=null){if(typeof r.autopiaOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.autopiaOptions: object expected");t.autopiaOptions=n.keyhole.dbroot.AutopiaOptionsProto.fromObject(r.autopiaOptions)}if(r.searchConfig!=null){if(typeof r.searchConfig!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.searchConfig: object expected");t.searchConfig=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.fromObject(r.searchConfig)}if(r.searchInfo!=null){if(typeof r.searchInfo!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.searchInfo: object expected");t.searchInfo=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.fromObject(r.searchInfo)}if(r.elevationServiceBaseUrl!=null&&(t.elevationServiceBaseUrl=String(r.elevationServiceBaseUrl)),r.elevationProfileQueryDelay!=null&&(t.elevationProfileQueryDelay=r.elevationProfileQueryDelay|0),r.proUpgradeUrl!=null){if(typeof r.proUpgradeUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proUpgradeUrl: object expected");t.proUpgradeUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proUpgradeUrl)}if(r.earthCommunityUrl!=null){if(typeof r.earthCommunityUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.earthCommunityUrl: object expected");t.earthCommunityUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.earthCommunityUrl)}if(r.googleMapsUrl!=null){if(typeof r.googleMapsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.googleMapsUrl: object expected");t.googleMapsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.googleMapsUrl)}if(r.sharingUrl!=null){if(typeof r.sharingUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.sharingUrl: object expected");t.sharingUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.sharingUrl)}if(r.privacyPolicyUrl!=null){if(typeof r.privacyPolicyUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.privacyPolicyUrl: object expected");t.privacyPolicyUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.privacyPolicyUrl)}if(r.doGplusUserCheck!=null&&(t.doGplusUserCheck=!!r.doGplusUserCheck),r.rocktreeDataProto!=null){if(typeof r.rocktreeDataProto!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.rocktreeDataProto: object expected");t.rocktreeDataProto=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.fromObject(r.rocktreeDataProto)}if(r.filmstripConfig){if(!Array.isArray(r.filmstripConfig))throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: array expected");t.filmstripConfig=[];for(var e=0;e<r.filmstripConfig.length;++e){if(typeof r.filmstripConfig[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: object expected");t.filmstripConfig[e]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fromObject(r.filmstripConfig[e])}}if(r.showSigninButton!=null&&(t.showSigninButton=!!r.showSigninButton),r.proMeasureUpsellUrl!=null){if(typeof r.proMeasureUpsellUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proMeasureUpsellUrl: object expected");t.proMeasureUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proMeasureUpsellUrl)}if(r.proPrintUpsellUrl!=null){if(typeof r.proPrintUpsellUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proPrintUpsellUrl: object expected");t.proPrintUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proPrintUpsellUrl)}if(r.starDataProto!=null){if(typeof r.starDataProto!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.starDataProto: object expected");t.starDataProto=n.keyhole.dbroot.EndSnippetProto.StarDataProto.fromObject(r.starDataProto)}if(r.feedbackUrl!=null){if(typeof r.feedbackUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.feedbackUrl: object expected");t.feedbackUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.feedbackUrl)}if(r.oauth2LoginUrl!=null){if(typeof r.oauth2LoginUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.oauth2LoginUrl: object expected");t.oauth2LoginUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.oauth2LoginUrl)}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.mfeDomains=[],e.searchTab=[],e.cobrandInfo=[],e.validDatabase=[],e.configScript=[],e.planetaryDatabase=[],e.filmstripConfig=[]),t.defaults&&(e.model=null,e.authServerUrl=null,e.disableAuthentication=!1,e.mfeLangParam="hl=$5Bhl5D",e.adsUrlPatterns="",e.reverseGeocoderUrl=null,e.reverseGeocoderProtocolVersion=3,e.skyDatabaseIsAvailable=!0,e.skyDatabaseUrl=null,e.defaultWebPageIntlUrl=null,e.numStartUpTips=17,e.startUpTipsUrl=null,e.userGuideIntlUrl=null,e.supportCenterIntlUrl=null,e.businessListingIntlUrl=null,e.supportAnswerIntlUrl=null,e.supportTopicIntlUrl=null,e.supportRequestIntlUrl=null,e.earthIntlUrl=null,e.addContentUrl=null,e.sketchupNotInstalledUrl=null,e.sketchupErrorUrl=null,e.freeLicenseUrl=null,e.proLicenseUrl=null,e.hideUserData=!1,e.useGeLogo=!0,e.dioramaDescriptionUrlBase=null,e.dioramaDefaultColor=4291281607,e.clientOptions=null,e.fetchingOptions=null,e.timeMachineOptions=null,e.csiOptions=null,e.deauthServerUrl=null,e.swoopParameters=null,e.bbsServerInfo=null,e.dataErrorServerInfo=null,e.logServer=null,e.autopiaOptions=null,e.searchInfo=null,e.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",e.elevationProfileQueryDelay=500,e.tutorialUrl=null,e.keyboardShortcutsUrl=null,e.releaseNotesUrl=null,e.numProStartUpTips=0,e.proStartUpTipsUrl=null,e.dioramaBlacklistUrl=null,e.searchConfig=null,e.proUpgradeUrl=null,e.earthCommunityUrl=null,e.googleMapsUrl=null,e.sharingUrl=null,e.privacyPolicyUrl=null,e.doGplusUserCheck=!1,e.rocktreeDataProto=null,e.showSigninButton=!1,e.startupTipsIntlUrl=null,e.proMeasureUpsellUrl=null,e.proPrintUpsellUrl=null,e.starDataProto=null,e.feedbackUrl=null,e.oauth2LoginUrl=null),r.model!=null&&r.hasOwnProperty("model")&&(e.model=n.keyhole.dbroot.PlanetModelProto.toObject(r.model,t)),r.authServerUrl!=null&&r.hasOwnProperty("authServerUrl")&&(e.authServerUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.authServerUrl,t)),r.disableAuthentication!=null&&r.hasOwnProperty("disableAuthentication")&&(e.disableAuthentication=r.disableAuthentication),r.mfeDomains&&r.mfeDomains.length){e.mfeDomains=[];for(var o=0;o<r.mfeDomains.length;++o)e.mfeDomains[o]=n.keyhole.dbroot.MfeDomainFeaturesProto.toObject(r.mfeDomains[o],t)}if(r.mfeLangParam!=null&&r.hasOwnProperty("mfeLangParam")&&(e.mfeLangParam=r.mfeLangParam),r.adsUrlPatterns!=null&&r.hasOwnProperty("adsUrlPatterns")&&(e.adsUrlPatterns=r.adsUrlPatterns),r.reverseGeocoderUrl!=null&&r.hasOwnProperty("reverseGeocoderUrl")&&(e.reverseGeocoderUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.reverseGeocoderUrl,t)),r.reverseGeocoderProtocolVersion!=null&&r.hasOwnProperty("reverseGeocoderProtocolVersion")&&(e.reverseGeocoderProtocolVersion=r.reverseGeocoderProtocolVersion),r.skyDatabaseIsAvailable!=null&&r.hasOwnProperty("skyDatabaseIsAvailable")&&(e.skyDatabaseIsAvailable=r.skyDatabaseIsAvailable),r.skyDatabaseUrl!=null&&r.hasOwnProperty("skyDatabaseUrl")&&(e.skyDatabaseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.skyDatabaseUrl,t)),r.defaultWebPageIntlUrl!=null&&r.hasOwnProperty("defaultWebPageIntlUrl")&&(e.defaultWebPageIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.defaultWebPageIntlUrl,t)),r.numStartUpTips!=null&&r.hasOwnProperty("numStartUpTips")&&(e.numStartUpTips=r.numStartUpTips),r.startUpTipsUrl!=null&&r.hasOwnProperty("startUpTipsUrl")&&(e.startUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.startUpTipsUrl,t)),r.userGuideIntlUrl!=null&&r.hasOwnProperty("userGuideIntlUrl")&&(e.userGuideIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.userGuideIntlUrl,t)),r.supportCenterIntlUrl!=null&&r.hasOwnProperty("supportCenterIntlUrl")&&(e.supportCenterIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportCenterIntlUrl,t)),r.businessListingIntlUrl!=null&&r.hasOwnProperty("businessListingIntlUrl")&&(e.businessListingIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.businessListingIntlUrl,t)),r.supportAnswerIntlUrl!=null&&r.hasOwnProperty("supportAnswerIntlUrl")&&(e.supportAnswerIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportAnswerIntlUrl,t)),r.supportTopicIntlUrl!=null&&r.hasOwnProperty("supportTopicIntlUrl")&&(e.supportTopicIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportTopicIntlUrl,t)),r.supportRequestIntlUrl!=null&&r.hasOwnProperty("supportRequestIntlUrl")&&(e.supportRequestIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportRequestIntlUrl,t)),r.earthIntlUrl!=null&&r.hasOwnProperty("earthIntlUrl")&&(e.earthIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.earthIntlUrl,t)),r.addContentUrl!=null&&r.hasOwnProperty("addContentUrl")&&(e.addContentUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.addContentUrl,t)),r.sketchupNotInstalledUrl!=null&&r.hasOwnProperty("sketchupNotInstalledUrl")&&(e.sketchupNotInstalledUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.sketchupNotInstalledUrl,t)),r.sketchupErrorUrl!=null&&r.hasOwnProperty("sketchupErrorUrl")&&(e.sketchupErrorUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.sketchupErrorUrl,t)),r.freeLicenseUrl!=null&&r.hasOwnProperty("freeLicenseUrl")&&(e.freeLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.freeLicenseUrl,t)),r.proLicenseUrl!=null&&r.hasOwnProperty("proLicenseUrl")&&(e.proLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proLicenseUrl,t)),r.hideUserData!=null&&r.hasOwnProperty("hideUserData")&&(e.hideUserData=r.hideUserData),r.useGeLogo!=null&&r.hasOwnProperty("useGeLogo")&&(e.useGeLogo=r.useGeLogo),r.dioramaDescriptionUrlBase!=null&&r.hasOwnProperty("dioramaDescriptionUrlBase")&&(e.dioramaDescriptionUrlBase=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.dioramaDescriptionUrlBase,t)),r.dioramaDefaultColor!=null&&r.hasOwnProperty("dioramaDefaultColor")&&(e.dioramaDefaultColor=r.dioramaDefaultColor),r.clientOptions!=null&&r.hasOwnProperty("clientOptions")&&(e.clientOptions=n.keyhole.dbroot.ClientOptionsProto.toObject(r.clientOptions,t)),r.fetchingOptions!=null&&r.hasOwnProperty("fetchingOptions")&&(e.fetchingOptions=n.keyhole.dbroot.FetchingOptionsProto.toObject(r.fetchingOptions,t)),r.timeMachineOptions!=null&&r.hasOwnProperty("timeMachineOptions")&&(e.timeMachineOptions=n.keyhole.dbroot.TimeMachineOptionsProto.toObject(r.timeMachineOptions,t)),r.csiOptions!=null&&r.hasOwnProperty("csiOptions")&&(e.csiOptions=n.keyhole.dbroot.CSIOptionsProto.toObject(r.csiOptions,t)),r.searchTab&&r.searchTab.length){e.searchTab=[];for(var o=0;o<r.searchTab.length;++o)e.searchTab[o]=n.keyhole.dbroot.SearchTabProto.toObject(r.searchTab[o],t)}if(r.cobrandInfo&&r.cobrandInfo.length){e.cobrandInfo=[];for(var o=0;o<r.cobrandInfo.length;++o)e.cobrandInfo[o]=n.keyhole.dbroot.CobrandProto.toObject(r.cobrandInfo[o],t)}if(r.validDatabase&&r.validDatabase.length){e.validDatabase=[];for(var o=0;o<r.validDatabase.length;++o)e.validDatabase[o]=n.keyhole.dbroot.DatabaseDescriptionProto.toObject(r.validDatabase[o],t)}if(r.configScript&&r.configScript.length){e.configScript=[];for(var o=0;o<r.configScript.length;++o)e.configScript[o]=n.keyhole.dbroot.ConfigScriptProto.toObject(r.configScript[o],t)}if(r.deauthServerUrl!=null&&r.hasOwnProperty("deauthServerUrl")&&(e.deauthServerUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.deauthServerUrl,t)),r.swoopParameters!=null&&r.hasOwnProperty("swoopParameters")&&(e.swoopParameters=n.keyhole.dbroot.SwoopParamsProto.toObject(r.swoopParameters,t)),r.bbsServerInfo!=null&&r.hasOwnProperty("bbsServerInfo")&&(e.bbsServerInfo=n.keyhole.dbroot.PostingServerProto.toObject(r.bbsServerInfo,t)),r.dataErrorServerInfo!=null&&r.hasOwnProperty("dataErrorServerInfo")&&(e.dataErrorServerInfo=n.keyhole.dbroot.PostingServerProto.toObject(r.dataErrorServerInfo,t)),r.planetaryDatabase&&r.planetaryDatabase.length){e.planetaryDatabase=[];for(var o=0;o<r.planetaryDatabase.length;++o)e.planetaryDatabase[o]=n.keyhole.dbroot.PlanetaryDatabaseProto.toObject(r.planetaryDatabase[o],t)}if(r.logServer!=null&&r.hasOwnProperty("logServer")&&(e.logServer=n.keyhole.dbroot.LogServerProto.toObject(r.logServer,t)),r.autopiaOptions!=null&&r.hasOwnProperty("autopiaOptions")&&(e.autopiaOptions=n.keyhole.dbroot.AutopiaOptionsProto.toObject(r.autopiaOptions,t)),r.searchInfo!=null&&r.hasOwnProperty("searchInfo")&&(e.searchInfo=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.toObject(r.searchInfo,t)),r.elevationServiceBaseUrl!=null&&r.hasOwnProperty("elevationServiceBaseUrl")&&(e.elevationServiceBaseUrl=r.elevationServiceBaseUrl),r.elevationProfileQueryDelay!=null&&r.hasOwnProperty("elevationProfileQueryDelay")&&(e.elevationProfileQueryDelay=r.elevationProfileQueryDelay),r.tutorialUrl!=null&&r.hasOwnProperty("tutorialUrl")&&(e.tutorialUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.tutorialUrl,t)),r.keyboardShortcutsUrl!=null&&r.hasOwnProperty("keyboardShortcutsUrl")&&(e.keyboardShortcutsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.keyboardShortcutsUrl,t)),r.releaseNotesUrl!=null&&r.hasOwnProperty("releaseNotesUrl")&&(e.releaseNotesUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.releaseNotesUrl,t)),r.numProStartUpTips!=null&&r.hasOwnProperty("numProStartUpTips")&&(e.numProStartUpTips=r.numProStartUpTips),r.proStartUpTipsUrl!=null&&r.hasOwnProperty("proStartUpTipsUrl")&&(e.proStartUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proStartUpTipsUrl,t)),r.dioramaBlacklistUrl!=null&&r.hasOwnProperty("dioramaBlacklistUrl")&&(e.dioramaBlacklistUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.dioramaBlacklistUrl,t)),r.searchConfig!=null&&r.hasOwnProperty("searchConfig")&&(e.searchConfig=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.toObject(r.searchConfig,t)),r.proUpgradeUrl!=null&&r.hasOwnProperty("proUpgradeUrl")&&(e.proUpgradeUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proUpgradeUrl,t)),r.earthCommunityUrl!=null&&r.hasOwnProperty("earthCommunityUrl")&&(e.earthCommunityUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.earthCommunityUrl,t)),r.googleMapsUrl!=null&&r.hasOwnProperty("googleMapsUrl")&&(e.googleMapsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.googleMapsUrl,t)),r.sharingUrl!=null&&r.hasOwnProperty("sharingUrl")&&(e.sharingUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.sharingUrl,t)),r.privacyPolicyUrl!=null&&r.hasOwnProperty("privacyPolicyUrl")&&(e.privacyPolicyUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.privacyPolicyUrl,t)),r.doGplusUserCheck!=null&&r.hasOwnProperty("doGplusUserCheck")&&(e.doGplusUserCheck=r.doGplusUserCheck),r.rocktreeDataProto!=null&&r.hasOwnProperty("rocktreeDataProto")&&(e.rocktreeDataProto=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.toObject(r.rocktreeDataProto,t)),r.filmstripConfig&&r.filmstripConfig.length){e.filmstripConfig=[];for(var o=0;o<r.filmstripConfig.length;++o)e.filmstripConfig[o]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.toObject(r.filmstripConfig[o],t)}return r.showSigninButton!=null&&r.hasOwnProperty("showSigninButton")&&(e.showSigninButton=r.showSigninButton),r.startupTipsIntlUrl!=null&&r.hasOwnProperty("startupTipsIntlUrl")&&(e.startupTipsIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.startupTipsIntlUrl,t)),r.proMeasureUpsellUrl!=null&&r.hasOwnProperty("proMeasureUpsellUrl")&&(e.proMeasureUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proMeasureUpsellUrl,t)),r.proPrintUpsellUrl!=null&&r.hasOwnProperty("proPrintUpsellUrl")&&(e.proPrintUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proPrintUpsellUrl,t)),r.starDataProto!=null&&r.hasOwnProperty("starDataProto")&&(e.starDataProto=n.keyhole.dbroot.EndSnippetProto.StarDataProto.toObject(r.starDataProto,t)),r.feedbackUrl!=null&&r.hasOwnProperty("feedbackUrl")&&(e.feedbackUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.feedbackUrl,t)),r.oauth2LoginUrl!=null&&r.hasOwnProperty("oauth2LoginUrl")&&(e.oauth2LoginUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.oauth2LoginUrl,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.EndSnippetProto"},i.SearchConfigProto=function(){function l(r){if(this.searchServer=[],this.oneboxService=[],r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.searchServer=u.emptyArray,l.prototype.oneboxService=u.emptyArray,l.prototype.kmlSearchUrl=null,l.prototype.kmlRenderUrl=null,l.prototype.searchHistoryUrl=null,l.prototype.errorPageUrl=null,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.searchServer&&a.searchServer.length||(a.searchServer=[]),a.searchServer.push(n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.decode(t,t.uint32()));break}case 2:{a.oneboxService&&a.oneboxService.length||(a.oneboxService=[]),a.oneboxService.push(n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.decode(t,t.uint32()));break}case 3:{a.kmlSearchUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 4:{a.kmlRenderUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 6:{a.searchHistoryUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 5:{a.errorPageUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.searchServer!=null&&t.hasOwnProperty("searchServer")){if(!Array.isArray(t.searchServer))return"searchServer: array expected";for(var e=0;e<t.searchServer.length;++e){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.verify(t.searchServer[e]);if(o)return"searchServer."+o}}if(t.oneboxService!=null&&t.hasOwnProperty("oneboxService")){if(!Array.isArray(t.oneboxService))return"oneboxService: array expected";for(var e=0;e<t.oneboxService.length;++e){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.verify(t.oneboxService[e]);if(o)return"oneboxService."+o}}if(t.kmlSearchUrl!=null&&t.hasOwnProperty("kmlSearchUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.kmlSearchUrl);if(o)return"kmlSearchUrl."+o}if(t.kmlRenderUrl!=null&&t.hasOwnProperty("kmlRenderUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.kmlRenderUrl);if(o)return"kmlRenderUrl."+o}if(t.searchHistoryUrl!=null&&t.hasOwnProperty("searchHistoryUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.searchHistoryUrl);if(o)return"searchHistoryUrl."+o}if(t.errorPageUrl!=null&&t.hasOwnProperty("errorPageUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.errorPageUrl);if(o)return"errorPageUrl."+o}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;if(t.searchServer){if(!Array.isArray(t.searchServer))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: array expected");e.searchServer=[];for(var o=0;o<t.searchServer.length;++o){if(typeof t.searchServer[o]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: object expected");e.searchServer[o]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.fromObject(t.searchServer[o])}}if(t.oneboxService){if(!Array.isArray(t.oneboxService))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: array expected");e.oneboxService=[];for(var o=0;o<t.oneboxService.length;++o){if(typeof t.oneboxService[o]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: object expected");e.oneboxService[o]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.fromObject(t.oneboxService[o])}}if(t.kmlSearchUrl!=null){if(typeof t.kmlSearchUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlSearchUrl: object expected");e.kmlSearchUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.kmlSearchUrl)}if(t.kmlRenderUrl!=null){if(typeof t.kmlRenderUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlRenderUrl: object expected");e.kmlRenderUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.kmlRenderUrl)}if(t.searchHistoryUrl!=null){if(typeof t.searchHistoryUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchHistoryUrl: object expected");e.searchHistoryUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.searchHistoryUrl)}if(t.errorPageUrl!=null){if(typeof t.errorPageUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.errorPageUrl: object expected");e.errorPageUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.errorPageUrl)}return e},l.toObject=function(t,e){e||(e={});var o={};if((e.arrays||e.defaults)&&(o.searchServer=[],o.oneboxService=[]),e.defaults&&(o.kmlSearchUrl=null,o.kmlRenderUrl=null,o.errorPageUrl=null,o.searchHistoryUrl=null),t.searchServer&&t.searchServer.length){o.searchServer=[];for(var a=0;a<t.searchServer.length;++a)o.searchServer[a]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.toObject(t.searchServer[a],e)}if(t.oneboxService&&t.oneboxService.length){o.oneboxService=[];for(var a=0;a<t.oneboxService.length;++a)o.oneboxService[a]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.toObject(t.oneboxService[a],e)}return t.kmlSearchUrl!=null&&t.hasOwnProperty("kmlSearchUrl")&&(o.kmlSearchUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.kmlSearchUrl,e)),t.kmlRenderUrl!=null&&t.hasOwnProperty("kmlRenderUrl")&&(o.kmlRenderUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.kmlRenderUrl,e)),t.errorPageUrl!=null&&t.hasOwnProperty("errorPageUrl")&&(o.errorPageUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.errorPageUrl,e)),t.searchHistoryUrl!=null&&t.hasOwnProperty("searchHistoryUrl")&&(o.searchHistoryUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.searchHistoryUrl,e)),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto"},l.SearchServer=function(){function r(t){if(this.suggestion=[],this.searchlet=[],t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.name=null,r.prototype.url=null,r.prototype.type=0,r.prototype.htmlTransformUrl=null,r.prototype.kmlTransformUrl=null,r.prototype.supplementalUi=null,r.prototype.suggestion=u.emptyArray,r.prototype.searchlet=u.emptyArray,r.prototype.requirements=null,r.prototype.suggestServer=null,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.name=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 2:{p.url=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 3:{p.type=e.int32();break}case 4:{p.htmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 5:{p.kmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 6:{p.supplementalUi=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.decode(e,e.uint32());break}case 9:{p.suggestion&&p.suggestion.length||(p.suggestion=[]),p.suggestion.push(n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32()));break}case 7:{p.searchlet&&p.searchlet.length||(p.searchlet=[]),p.searchlet.push(n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.decode(e,e.uint32()));break}case 8:{p.requirements=n.keyhole.dbroot.RequirementProto.decode(e,e.uint32());break}case 10:{p.suggestServer=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}default:e.skipType(y&7);break}}return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.name);if(o)return"name."+o}if(e.url!=null&&e.hasOwnProperty("url")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.url);if(o)return"url."+o}if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:break}if(e.htmlTransformUrl!=null&&e.hasOwnProperty("htmlTransformUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.htmlTransformUrl);if(o)return"htmlTransformUrl."+o}if(e.kmlTransformUrl!=null&&e.hasOwnProperty("kmlTransformUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.kmlTransformUrl);if(o)return"kmlTransformUrl."+o}if(e.supplementalUi!=null&&e.hasOwnProperty("supplementalUi")){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.verify(e.supplementalUi);if(o)return"supplementalUi."+o}if(e.suggestion!=null&&e.hasOwnProperty("suggestion")){if(!Array.isArray(e.suggestion))return"suggestion: array expected";for(var a=0;a<e.suggestion.length;++a){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.suggestion[a]);if(o)return"suggestion."+o}}if(e.searchlet!=null&&e.hasOwnProperty("searchlet")){if(!Array.isArray(e.searchlet))return"searchlet: array expected";for(var a=0;a<e.searchlet.length;++a){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.verify(e.searchlet[a]);if(o)return"searchlet."+o}}if(e.requirements!=null&&e.hasOwnProperty("requirements")){var o=n.keyhole.dbroot.RequirementProto.verify(e.requirements);if(o)return"requirements."+o}if(e.suggestServer!=null&&e.hasOwnProperty("suggestServer")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.suggestServer);if(o)return"suggestServer."+o}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer)return e;var o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;if(e.name!=null){if(typeof e.name!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.name: object expected");o.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.name)}if(e.url!=null){if(typeof e.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.url: object expected");o.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.url)}switch(e.type){case"RESULT_TYPE_KML":case 0:o.type=0;break;case"RESULT_TYPE_XML":case 1:o.type=1;break}if(e.htmlTransformUrl!=null){if(typeof e.htmlTransformUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.htmlTransformUrl: object expected");o.htmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.htmlTransformUrl)}if(e.kmlTransformUrl!=null){if(typeof e.kmlTransformUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.kmlTransformUrl: object expected");o.kmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.kmlTransformUrl)}if(e.supplementalUi!=null){if(typeof e.supplementalUi!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.supplementalUi: object expected");o.supplementalUi=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.fromObject(e.supplementalUi)}if(e.suggestion){if(!Array.isArray(e.suggestion))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: array expected");o.suggestion=[];for(var a=0;a<e.suggestion.length;++a){if(typeof e.suggestion[a]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: object expected");o.suggestion[a]=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.suggestion[a])}}if(e.searchlet){if(!Array.isArray(e.searchlet))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: array expected");o.searchlet=[];for(var a=0;a<e.searchlet.length;++a){if(typeof e.searchlet[a]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: object expected");o.searchlet[a]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.fromObject(e.searchlet[a])}}if(e.requirements!=null){if(typeof e.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.requirements: object expected");o.requirements=n.keyhole.dbroot.RequirementProto.fromObject(e.requirements)}if(e.suggestServer!=null){if(typeof e.suggestServer!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestServer: object expected");o.suggestServer=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.suggestServer)}return o},r.toObject=function(e,o){o||(o={});var a={};if((o.arrays||o.defaults)&&(a.searchlet=[],a.suggestion=[]),o.defaults&&(a.name=null,a.url=null,a.type=o.enums===String?"RESULT_TYPE_KML":0,a.htmlTransformUrl=null,a.kmlTransformUrl=null,a.supplementalUi=null,a.requirements=null,a.suggestServer=null),e.name!=null&&e.hasOwnProperty("name")&&(a.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.name,o)),e.url!=null&&e.hasOwnProperty("url")&&(a.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.url,o)),e.type!=null&&e.hasOwnProperty("type")&&(a.type=o.enums===String?n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.ResultType[e.type]:e.type),e.htmlTransformUrl!=null&&e.hasOwnProperty("htmlTransformUrl")&&(a.htmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.htmlTransformUrl,o)),e.kmlTransformUrl!=null&&e.hasOwnProperty("kmlTransformUrl")&&(a.kmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.kmlTransformUrl,o)),e.supplementalUi!=null&&e.hasOwnProperty("supplementalUi")&&(a.supplementalUi=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.toObject(e.supplementalUi,o)),e.searchlet&&e.searchlet.length){a.searchlet=[];for(var p=0;p<e.searchlet.length;++p)a.searchlet[p]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.toObject(e.searchlet[p],o)}if(e.requirements!=null&&e.hasOwnProperty("requirements")&&(a.requirements=n.keyhole.dbroot.RequirementProto.toObject(e.requirements,o)),e.suggestion&&e.suggestion.length){a.suggestion=[];for(var p=0;p<e.suggestion.length;++p)a.suggestion[p]=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.suggestion[p],o)}return e.suggestServer!=null&&e.hasOwnProperty("suggestServer")&&(a.suggestServer=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.suggestServer,o)),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer"},r.ResultType=function(){var t={},e=Object.create(t);return e[t[0]="RESULT_TYPE_KML"]=0,e[t[1]="RESULT_TYPE_XML"]=1,e}(),r.SupplementalUi=function(){function t(e){if(e)for(var o=Object.keys(e),a=0;a<o.length;++a)e[o[a]]!=null&&(this[o[a]]=e[o[a]])}return t.prototype.url=null,t.prototype.label=null,t.prototype.height=160,t.decode=function(o,a){o instanceof f||(o=f.create(o));for(var p=a===void 0?o.len:o.pos+a,y=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;o.pos<p;){var h=o.uint32();switch(h>>>3){case 1:{y.url=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 2:{y.label=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 3:{y.height=o.int32();break}default:o.skipType(h&7);break}}return y},t.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.url!=null&&o.hasOwnProperty("url")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.url);if(a)return"url."+a}if(o.label!=null&&o.hasOwnProperty("label")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.label);if(a)return"label."+a}return o.height!=null&&o.hasOwnProperty("height")&&!u.isInteger(o.height)?"height: integer expected":null},t.fromObject=function(o){if(o instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)return o;var a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;if(o.url!=null){if(typeof o.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected");a.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.url)}if(o.label!=null){if(typeof o.label!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected");a.label=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.label)}return o.height!=null&&(a.height=o.height|0),a},t.toObject=function(o,a){a||(a={});var p={};return a.defaults&&(p.url=null,p.label=null,p.height=160),o.url!=null&&o.hasOwnProperty("url")&&(p.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.url,a)),o.label!=null&&o.hasOwnProperty("label")&&(p.label=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.label,a)),o.height!=null&&o.hasOwnProperty("height")&&(p.height=o.height),p},t.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},t.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi"},t}(),r.SearchletProto=function(){function t(e){if(e)for(var o=Object.keys(e),a=0;a<o.length;++a)e[o[a]]!=null&&(this[o[a]]=e[o[a]])}return t.prototype.url=null,t.prototype.name=null,t.prototype.requirements=null,t.decode=function(o,a){o instanceof f||(o=f.create(o));for(var p=a===void 0?o.len:o.pos+a,y=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;o.pos<p;){var h=o.uint32();switch(h>>>3){case 1:{y.url=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 2:{y.name=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 3:{y.requirements=n.keyhole.dbroot.RequirementProto.decode(o,o.uint32());break}default:o.skipType(h&7);break}}return y},t.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.url!=null&&o.hasOwnProperty("url")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.url);if(a)return"url."+a}if(o.name!=null&&o.hasOwnProperty("name")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.name);if(a)return"name."+a}if(o.requirements!=null&&o.hasOwnProperty("requirements")){var a=n.keyhole.dbroot.RequirementProto.verify(o.requirements);if(a)return"requirements."+a}return null},t.fromObject=function(o){if(o instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)return o;var a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;if(o.url!=null){if(typeof o.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected");a.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.url)}if(o.name!=null){if(typeof o.name!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected");a.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.name)}if(o.requirements!=null){if(typeof o.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected");a.requirements=n.keyhole.dbroot.RequirementProto.fromObject(o.requirements)}return a},t.toObject=function(o,a){a||(a={});var p={};return a.defaults&&(p.url=null,p.name=null,p.requirements=null),o.url!=null&&o.hasOwnProperty("url")&&(p.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.url,a)),o.name!=null&&o.hasOwnProperty("name")&&(p.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.name,a)),o.requirements!=null&&o.hasOwnProperty("requirements")&&(p.requirements=n.keyhole.dbroot.RequirementProto.toObject(o.requirements,a)),p},t.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},t.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto"},t}(),r}(),l.OneboxServiceProto=function(){function r(t){if(t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.serviceUrl=null,r.prototype.requirements=null,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.serviceUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 2:{p.requirements=n.keyhole.dbroot.RequirementProto.decode(e,e.uint32());break}default:e.skipType(y&7);break}}return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.serviceUrl!=null&&e.hasOwnProperty("serviceUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.serviceUrl);if(o)return"serviceUrl."+o}if(e.requirements!=null&&e.hasOwnProperty("requirements")){var o=n.keyhole.dbroot.RequirementProto.verify(e.requirements);if(o)return"requirements."+o}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)return e;var o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;if(e.serviceUrl!=null){if(typeof e.serviceUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected");o.serviceUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.serviceUrl)}if(e.requirements!=null){if(typeof e.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected");o.requirements=n.keyhole.dbroot.RequirementProto.fromObject(e.requirements)}return o},r.toObject=function(e,o){o||(o={});var a={};return o.defaults&&(a.serviceUrl=null,a.requirements=null),e.serviceUrl!=null&&e.hasOwnProperty("serviceUrl")&&(a.serviceUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.serviceUrl,o)),e.requirements!=null&&e.hasOwnProperty("requirements")&&(a.requirements=n.keyhole.dbroot.RequirementProto.toObject(e.requirements,o)),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto"},r}(),l}(),i.SearchInfoProto=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.defaultUrl="http://maps.google.com/maps",l.prototype.geocodeParam="q",l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.defaultUrl=t.string();break}case 2:{a.geocodeParam=t.string();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":t.defaultUrl!=null&&t.hasOwnProperty("defaultUrl")&&!u.isString(t.defaultUrl)?"defaultUrl: string expected":t.geocodeParam!=null&&t.hasOwnProperty("geocodeParam")&&!u.isString(t.geocodeParam)?"geocodeParam: string expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.SearchInfoProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;return t.defaultUrl!=null&&(e.defaultUrl=String(t.defaultUrl)),t.geocodeParam!=null&&(e.geocodeParam=String(t.geocodeParam)),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.defaultUrl="http://maps.google.com/maps",o.geocodeParam="q"),t.defaultUrl!=null&&t.hasOwnProperty("defaultUrl")&&(o.defaultUrl=t.defaultUrl),t.geocodeParam!=null&&t.hasOwnProperty("geocodeParam")&&(o.geocodeParam=t.geocodeParam),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.SearchInfoProto"},l}(),i.RockTreeDataProto=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.url=null,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.url=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.url!=null&&t.hasOwnProperty("url")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.url);if(e)return"url."+e}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;if(t.url!=null){if(typeof t.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected");e.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.url)}return e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.url=null),t.url!=null&&t.hasOwnProperty("url")&&(o.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.url,e)),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.RockTreeDataProto"},l}(),i.FilmstripConfigProto=function(){function l(r){if(this.imageryType=[],r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.requirements=null,l.prototype.alleycatUrlTemplate=null,l.prototype.fallbackAlleycatUrlTemplate=null,l.prototype.metadataUrlTemplate=null,l.prototype.thumbnailUrlTemplate=null,l.prototype.kmlUrlTemplate=null,l.prototype.featuredToursUrl=null,l.prototype.enableViewportFallback=!1,l.prototype.viewportFallbackDistance=0,l.prototype.imageryType=u.emptyArray,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.requirements=n.keyhole.dbroot.RequirementProto.decode(t,t.uint32());break}case 2:{a.alleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 9:{a.fallbackAlleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 3:{a.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 4:{a.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 5:{a.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 6:{a.featuredToursUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 7:{a.enableViewportFallback=t.bool();break}case 8:{a.viewportFallbackDistance=t.uint32();break}case 10:{a.imageryType&&a.imageryType.length||(a.imageryType=[]),a.imageryType.push(n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.decode(t,t.uint32()));break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.requirements!=null&&t.hasOwnProperty("requirements")){var e=n.keyhole.dbroot.RequirementProto.verify(t.requirements);if(e)return"requirements."+e}if(t.alleycatUrlTemplate!=null&&t.hasOwnProperty("alleycatUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.alleycatUrlTemplate);if(e)return"alleycatUrlTemplate."+e}if(t.fallbackAlleycatUrlTemplate!=null&&t.hasOwnProperty("fallbackAlleycatUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.fallbackAlleycatUrlTemplate);if(e)return"fallbackAlleycatUrlTemplate."+e}if(t.metadataUrlTemplate!=null&&t.hasOwnProperty("metadataUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.metadataUrlTemplate);if(e)return"metadataUrlTemplate."+e}if(t.thumbnailUrlTemplate!=null&&t.hasOwnProperty("thumbnailUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.thumbnailUrlTemplate);if(e)return"thumbnailUrlTemplate."+e}if(t.kmlUrlTemplate!=null&&t.hasOwnProperty("kmlUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.kmlUrlTemplate);if(e)return"kmlUrlTemplate."+e}if(t.featuredToursUrl!=null&&t.hasOwnProperty("featuredToursUrl")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.featuredToursUrl);if(e)return"featuredToursUrl."+e}if(t.enableViewportFallback!=null&&t.hasOwnProperty("enableViewportFallback")&&typeof t.enableViewportFallback!="boolean")return"enableViewportFallback: boolean expected";if(t.viewportFallbackDistance!=null&&t.hasOwnProperty("viewportFallbackDistance")&&!u.isInteger(t.viewportFallbackDistance))return"viewportFallbackDistance: integer expected";if(t.imageryType!=null&&t.hasOwnProperty("imageryType")){if(!Array.isArray(t.imageryType))return"imageryType: array expected";for(var o=0;o<t.imageryType.length;++o){var e=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.verify(t.imageryType[o]);if(e)return"imageryType."+e}}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;if(t.requirements!=null){if(typeof t.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.requirements: object expected");e.requirements=n.keyhole.dbroot.RequirementProto.fromObject(t.requirements)}if(t.alleycatUrlTemplate!=null){if(typeof t.alleycatUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.alleycatUrlTemplate: object expected");e.alleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.alleycatUrlTemplate)}if(t.fallbackAlleycatUrlTemplate!=null){if(typeof t.fallbackAlleycatUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fallbackAlleycatUrlTemplate: object expected");e.fallbackAlleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.fallbackAlleycatUrlTemplate)}if(t.metadataUrlTemplate!=null){if(typeof t.metadataUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.metadataUrlTemplate: object expected");e.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.metadataUrlTemplate)}if(t.thumbnailUrlTemplate!=null){if(typeof t.thumbnailUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.thumbnailUrlTemplate: object expected");e.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.thumbnailUrlTemplate)}if(t.kmlUrlTemplate!=null){if(typeof t.kmlUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.kmlUrlTemplate: object expected");e.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.kmlUrlTemplate)}if(t.featuredToursUrl!=null){if(typeof t.featuredToursUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.featuredToursUrl: object expected");e.featuredToursUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.featuredToursUrl)}if(t.enableViewportFallback!=null&&(e.enableViewportFallback=!!t.enableViewportFallback),t.viewportFallbackDistance!=null&&(e.viewportFallbackDistance=t.viewportFallbackDistance>>>0),t.imageryType){if(!Array.isArray(t.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");e.imageryType=[];for(var o=0;o<t.imageryType.length;++o){if(typeof t.imageryType[o]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: object expected");e.imageryType[o]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.fromObject(t.imageryType[o])}}return e},l.toObject=function(t,e){e||(e={});var o={};if((e.arrays||e.defaults)&&(o.imageryType=[]),e.defaults&&(o.requirements=null,o.alleycatUrlTemplate=null,o.metadataUrlTemplate=null,o.thumbnailUrlTemplate=null,o.kmlUrlTemplate=null,o.featuredToursUrl=null,o.enableViewportFallback=!1,o.viewportFallbackDistance=0,o.fallbackAlleycatUrlTemplate=null),t.requirements!=null&&t.hasOwnProperty("requirements")&&(o.requirements=n.keyhole.dbroot.RequirementProto.toObject(t.requirements,e)),t.alleycatUrlTemplate!=null&&t.hasOwnProperty("alleycatUrlTemplate")&&(o.alleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.alleycatUrlTemplate,e)),t.metadataUrlTemplate!=null&&t.hasOwnProperty("metadataUrlTemplate")&&(o.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.metadataUrlTemplate,e)),t.thumbnailUrlTemplate!=null&&t.hasOwnProperty("thumbnailUrlTemplate")&&(o.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.thumbnailUrlTemplate,e)),t.kmlUrlTemplate!=null&&t.hasOwnProperty("kmlUrlTemplate")&&(o.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.kmlUrlTemplate,e)),t.featuredToursUrl!=null&&t.hasOwnProperty("featuredToursUrl")&&(o.featuredToursUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.featuredToursUrl,e)),t.enableViewportFallback!=null&&t.hasOwnProperty("enableViewportFallback")&&(o.enableViewportFallback=t.enableViewportFallback),t.viewportFallbackDistance!=null&&t.hasOwnProperty("viewportFallbackDistance")&&(o.viewportFallbackDistance=t.viewportFallbackDistance),t.fallbackAlleycatUrlTemplate!=null&&t.hasOwnProperty("fallbackAlleycatUrlTemplate")&&(o.fallbackAlleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.fallbackAlleycatUrlTemplate,e)),t.imageryType&&t.imageryType.length){o.imageryType=[];for(var a=0;a<t.imageryType.length;++a)o.imageryType[a]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.toObject(t.imageryType[a],e)}return o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.FilmstripConfigProto"},l.AlleycatImageryTypeProto=function(){function r(t){if(t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.imageryTypeId=0,r.prototype.imageryTypeLabel="",r.prototype.metadataUrlTemplate=null,r.prototype.thumbnailUrlTemplate=null,r.prototype.kmlUrlTemplate=null,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.imageryTypeId=e.int32();break}case 2:{p.imageryTypeLabel=e.string();break}case 3:{p.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 4:{p.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 5:{p.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}default:e.skipType(y&7);break}}return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.imageryTypeId!=null&&e.hasOwnProperty("imageryTypeId")&&!u.isInteger(e.imageryTypeId))return"imageryTypeId: integer expected";if(e.imageryTypeLabel!=null&&e.hasOwnProperty("imageryTypeLabel")&&!u.isString(e.imageryTypeLabel))return"imageryTypeLabel: string expected";if(e.metadataUrlTemplate!=null&&e.hasOwnProperty("metadataUrlTemplate")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.metadataUrlTemplate);if(o)return"metadataUrlTemplate."+o}if(e.thumbnailUrlTemplate!=null&&e.hasOwnProperty("thumbnailUrlTemplate")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.thumbnailUrlTemplate);if(o)return"thumbnailUrlTemplate."+o}if(e.kmlUrlTemplate!=null&&e.hasOwnProperty("kmlUrlTemplate")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.kmlUrlTemplate);if(o)return"kmlUrlTemplate."+o}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)return e;var o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;if(e.imageryTypeId!=null&&(o.imageryTypeId=e.imageryTypeId|0),e.imageryTypeLabel!=null&&(o.imageryTypeLabel=String(e.imageryTypeLabel)),e.metadataUrlTemplate!=null){if(typeof e.metadataUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected");o.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.metadataUrlTemplate)}if(e.thumbnailUrlTemplate!=null){if(typeof e.thumbnailUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected");o.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.thumbnailUrlTemplate)}if(e.kmlUrlTemplate!=null){if(typeof e.kmlUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected");o.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.kmlUrlTemplate)}return o},r.toObject=function(e,o){o||(o={});var a={};return o.defaults&&(a.imageryTypeId=0,a.imageryTypeLabel="",a.metadataUrlTemplate=null,a.thumbnailUrlTemplate=null,a.kmlUrlTemplate=null),e.imageryTypeId!=null&&e.hasOwnProperty("imageryTypeId")&&(a.imageryTypeId=e.imageryTypeId),e.imageryTypeLabel!=null&&e.hasOwnProperty("imageryTypeLabel")&&(a.imageryTypeLabel=e.imageryTypeLabel),e.metadataUrlTemplate!=null&&e.hasOwnProperty("metadataUrlTemplate")&&(a.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.metadataUrlTemplate,o)),e.thumbnailUrlTemplate!=null&&e.hasOwnProperty("thumbnailUrlTemplate")&&(a.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.thumbnailUrlTemplate,o)),e.kmlUrlTemplate!=null&&e.hasOwnProperty("kmlUrlTemplate")&&(a.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.kmlUrlTemplate,o)),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto"},r}(),l}(),i.StarDataProto=function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.url=null,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.url=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.url!=null&&t.hasOwnProperty("url")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.url);if(e)return"url."+e}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.StarDataProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;if(t.url!=null){if(typeof t.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected");e.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.url)}return e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.url=null),t.url!=null&&t.hasOwnProperty("url")&&(o.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.url,e)),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.StarDataProto"},l}(),i}(),c.DbRootRefProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.url="",i.prototype.isCritical=!1,i.prototype.requirements=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DbRootRefProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 2:{o.url=r.string();break}case 1:{o.isCritical=r.bool();break}case 3:{o.requirements=n.keyhole.dbroot.RequirementProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("url"))throw u.ProtocolError("missing required 'url'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.url))return"url: string expected";if(r.isCritical!=null&&r.hasOwnProperty("isCritical")&&typeof r.isCritical!="boolean")return"isCritical: boolean expected";if(r.requirements!=null&&r.hasOwnProperty("requirements")){var t=n.keyhole.dbroot.RequirementProto.verify(r.requirements);if(t)return"requirements."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DbRootRefProto)return r;var t=new n.keyhole.dbroot.DbRootRefProto;if(r.url!=null&&(t.url=String(r.url)),r.isCritical!=null&&(t.isCritical=!!r.isCritical),r.requirements!=null){if(typeof r.requirements!="object")throw TypeError(".keyhole.dbroot.DbRootRefProto.requirements: object expected");t.requirements=n.keyhole.dbroot.RequirementProto.fromObject(r.requirements)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.isCritical=!1,e.url="",e.requirements=null),r.isCritical!=null&&r.hasOwnProperty("isCritical")&&(e.isCritical=r.isCritical),r.url!=null&&r.hasOwnProperty("url")&&(e.url=r.url),r.requirements!=null&&r.hasOwnProperty("requirements")&&(e.requirements=n.keyhole.dbroot.RequirementProto.toObject(r.requirements,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DbRootRefProto"},i}(),c.DatabaseVersionProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.quadtreeVersion=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DatabaseVersionProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.quadtreeVersion=r.uint32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("quadtreeVersion"))throw u.ProtocolError("missing required 'quadtreeVersion'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isInteger(r.quadtreeVersion)?null:"quadtreeVersion: integer expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DatabaseVersionProto)return r;var t=new n.keyhole.dbroot.DatabaseVersionProto;return r.quadtreeVersion!=null&&(t.quadtreeVersion=r.quadtreeVersion>>>0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.quadtreeVersion=0),r.quadtreeVersion!=null&&r.hasOwnProperty("quadtreeVersion")&&(e.quadtreeVersion=r.quadtreeVersion),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DatabaseVersionProto"},i}(),c.DbRootProto=function(){function i(l){if(this.providerInfo=[],this.nestedFeature=[],this.styleAttribute=[],this.styleMap=[],this.translationEntry=[],this.dbrootReference=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.databaseName=null,i.prototype.imageryPresent=!0,i.prototype.protoImagery=!1,i.prototype.terrainPresent=!1,i.prototype.providerInfo=u.emptyArray,i.prototype.nestedFeature=u.emptyArray,i.prototype.styleAttribute=u.emptyArray,i.prototype.styleMap=u.emptyArray,i.prototype.endSnippet=null,i.prototype.translationEntry=u.emptyArray,i.prototype.language="en",i.prototype.version=5,i.prototype.dbrootReference=u.emptyArray,i.prototype.databaseVersion=null,i.prototype.refreshTimeout=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DbRootProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 15:{o.databaseName=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 1:{o.imageryPresent=r.bool();break}case 14:{o.protoImagery=r.bool();break}case 2:{o.terrainPresent=r.bool();break}case 3:{o.providerInfo&&o.providerInfo.length||(o.providerInfo=[]),o.providerInfo.push(n.keyhole.dbroot.ProviderInfoProto.decode(r,r.uint32()));break}case 4:{o.nestedFeature&&o.nestedFeature.length||(o.nestedFeature=[]),o.nestedFeature.push(n.keyhole.dbroot.NestedFeatureProto.decode(r,r.uint32()));break}case 5:{o.styleAttribute&&o.styleAttribute.length||(o.styleAttribute=[]),o.styleAttribute.push(n.keyhole.dbroot.StyleAttributeProto.decode(r,r.uint32()));break}case 6:{o.styleMap&&o.styleMap.length||(o.styleMap=[]),o.styleMap.push(n.keyhole.dbroot.StyleMapProto.decode(r,r.uint32()));break}case 7:{o.endSnippet=n.keyhole.dbroot.EndSnippetProto.decode(r,r.uint32());break}case 8:{o.translationEntry&&o.translationEntry.length||(o.translationEntry=[]),o.translationEntry.push(n.keyhole.dbroot.StringEntryProto.decode(r,r.uint32()));break}case 9:{o.language=r.string();break}case 10:{o.version=r.int32();break}case 11:{o.dbrootReference&&o.dbrootReference.length||(o.dbrootReference=[]),o.dbrootReference.push(n.keyhole.dbroot.DbRootRefProto.decode(r,r.uint32()));break}case 13:{o.databaseVersion=n.keyhole.dbroot.DatabaseVersionProto.decode(r,r.uint32());break}case 16:{o.refreshTimeout=r.int32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.databaseName!=null&&r.hasOwnProperty("databaseName")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.databaseName);if(t)return"databaseName."+t}if(r.imageryPresent!=null&&r.hasOwnProperty("imageryPresent")&&typeof r.imageryPresent!="boolean")return"imageryPresent: boolean expected";if(r.protoImagery!=null&&r.hasOwnProperty("protoImagery")&&typeof r.protoImagery!="boolean")return"protoImagery: boolean expected";if(r.terrainPresent!=null&&r.hasOwnProperty("terrainPresent")&&typeof r.terrainPresent!="boolean")return"terrainPresent: boolean expected";if(r.providerInfo!=null&&r.hasOwnProperty("providerInfo")){if(!Array.isArray(r.providerInfo))return"providerInfo: array expected";for(var e=0;e<r.providerInfo.length;++e){var t=n.keyhole.dbroot.ProviderInfoProto.verify(r.providerInfo[e]);if(t)return"providerInfo."+t}}if(r.nestedFeature!=null&&r.hasOwnProperty("nestedFeature")){if(!Array.isArray(r.nestedFeature))return"nestedFeature: array expected";for(var e=0;e<r.nestedFeature.length;++e){var t=n.keyhole.dbroot.NestedFeatureProto.verify(r.nestedFeature[e]);if(t)return"nestedFeature."+t}}if(r.styleAttribute!=null&&r.hasOwnProperty("styleAttribute")){if(!Array.isArray(r.styleAttribute))return"styleAttribute: array expected";for(var e=0;e<r.styleAttribute.length;++e){var t=n.keyhole.dbroot.StyleAttributeProto.verify(r.styleAttribute[e]);if(t)return"styleAttribute."+t}}if(r.styleMap!=null&&r.hasOwnProperty("styleMap")){if(!Array.isArray(r.styleMap))return"styleMap: array expected";for(var e=0;e<r.styleMap.length;++e){var t=n.keyhole.dbroot.StyleMapProto.verify(r.styleMap[e]);if(t)return"styleMap."+t}}if(r.endSnippet!=null&&r.hasOwnProperty("endSnippet")){var t=n.keyhole.dbroot.EndSnippetProto.verify(r.endSnippet);if(t)return"endSnippet."+t}if(r.translationEntry!=null&&r.hasOwnProperty("translationEntry")){if(!Array.isArray(r.translationEntry))return"translationEntry: array expected";for(var e=0;e<r.translationEntry.length;++e){var t=n.keyhole.dbroot.StringEntryProto.verify(r.translationEntry[e]);if(t)return"translationEntry."+t}}if(r.language!=null&&r.hasOwnProperty("language")&&!u.isString(r.language))return"language: string expected";if(r.version!=null&&r.hasOwnProperty("version")&&!u.isInteger(r.version))return"version: integer expected";if(r.dbrootReference!=null&&r.hasOwnProperty("dbrootReference")){if(!Array.isArray(r.dbrootReference))return"dbrootReference: array expected";for(var e=0;e<r.dbrootReference.length;++e){var t=n.keyhole.dbroot.DbRootRefProto.verify(r.dbrootReference[e]);if(t)return"dbrootReference."+t}}if(r.databaseVersion!=null&&r.hasOwnProperty("databaseVersion")){var t=n.keyhole.dbroot.DatabaseVersionProto.verify(r.databaseVersion);if(t)return"databaseVersion."+t}return r.refreshTimeout!=null&&r.hasOwnProperty("refreshTimeout")&&!u.isInteger(r.refreshTimeout)?"refreshTimeout: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DbRootProto)return r;var t=new n.keyhole.dbroot.DbRootProto;if(r.databaseName!=null){if(typeof r.databaseName!="object")throw TypeError(".keyhole.dbroot.DbRootProto.databaseName: object expected");t.databaseName=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.databaseName)}if(r.imageryPresent!=null&&(t.imageryPresent=!!r.imageryPresent),r.protoImagery!=null&&(t.protoImagery=!!r.protoImagery),r.terrainPresent!=null&&(t.terrainPresent=!!r.terrainPresent),r.providerInfo){if(!Array.isArray(r.providerInfo))throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: array expected");t.providerInfo=[];for(var e=0;e<r.providerInfo.length;++e){if(typeof r.providerInfo[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: object expected");t.providerInfo[e]=n.keyhole.dbroot.ProviderInfoProto.fromObject(r.providerInfo[e])}}if(r.nestedFeature){if(!Array.isArray(r.nestedFeature))throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: array expected");t.nestedFeature=[];for(var e=0;e<r.nestedFeature.length;++e){if(typeof r.nestedFeature[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: object expected");t.nestedFeature[e]=n.keyhole.dbroot.NestedFeatureProto.fromObject(r.nestedFeature[e])}}if(r.styleAttribute){if(!Array.isArray(r.styleAttribute))throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: array expected");t.styleAttribute=[];for(var e=0;e<r.styleAttribute.length;++e){if(typeof r.styleAttribute[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: object expected");t.styleAttribute[e]=n.keyhole.dbroot.StyleAttributeProto.fromObject(r.styleAttribute[e])}}if(r.styleMap){if(!Array.isArray(r.styleMap))throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: array expected");t.styleMap=[];for(var e=0;e<r.styleMap.length;++e){if(typeof r.styleMap[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: object expected");t.styleMap[e]=n.keyhole.dbroot.StyleMapProto.fromObject(r.styleMap[e])}}if(r.endSnippet!=null){if(typeof r.endSnippet!="object")throw TypeError(".keyhole.dbroot.DbRootProto.endSnippet: object expected");t.endSnippet=n.keyhole.dbroot.EndSnippetProto.fromObject(r.endSnippet)}if(r.translationEntry){if(!Array.isArray(r.translationEntry))throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: array expected");t.translationEntry=[];for(var e=0;e<r.translationEntry.length;++e){if(typeof r.translationEntry[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: object expected");t.translationEntry[e]=n.keyhole.dbroot.StringEntryProto.fromObject(r.translationEntry[e])}}if(r.language!=null&&(t.language=String(r.language)),r.version!=null&&(t.version=r.version|0),r.dbrootReference){if(!Array.isArray(r.dbrootReference))throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: array expected");t.dbrootReference=[];for(var e=0;e<r.dbrootReference.length;++e){if(typeof r.dbrootReference[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: object expected");t.dbrootReference[e]=n.keyhole.dbroot.DbRootRefProto.fromObject(r.dbrootReference[e])}}if(r.databaseVersion!=null){if(typeof r.databaseVersion!="object")throw TypeError(".keyhole.dbroot.DbRootProto.databaseVersion: object expected");t.databaseVersion=n.keyhole.dbroot.DatabaseVersionProto.fromObject(r.databaseVersion)}return r.refreshTimeout!=null&&(t.refreshTimeout=r.refreshTimeout|0),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.providerInfo=[],e.nestedFeature=[],e.styleAttribute=[],e.styleMap=[],e.translationEntry=[],e.dbrootReference=[]),t.defaults&&(e.imageryPresent=!0,e.terrainPresent=!1,e.endSnippet=null,e.language="en",e.version=5,e.databaseVersion=null,e.protoImagery=!1,e.databaseName=null,e.refreshTimeout=0),r.imageryPresent!=null&&r.hasOwnProperty("imageryPresent")&&(e.imageryPresent=r.imageryPresent),r.terrainPresent!=null&&r.hasOwnProperty("terrainPresent")&&(e.terrainPresent=r.terrainPresent),r.providerInfo&&r.providerInfo.length){e.providerInfo=[];for(var o=0;o<r.providerInfo.length;++o)e.providerInfo[o]=n.keyhole.dbroot.ProviderInfoProto.toObject(r.providerInfo[o],t)}if(r.nestedFeature&&r.nestedFeature.length){e.nestedFeature=[];for(var o=0;o<r.nestedFeature.length;++o)e.nestedFeature[o]=n.keyhole.dbroot.NestedFeatureProto.toObject(r.nestedFeature[o],t)}if(r.styleAttribute&&r.styleAttribute.length){e.styleAttribute=[];for(var o=0;o<r.styleAttribute.length;++o)e.styleAttribute[o]=n.keyhole.dbroot.StyleAttributeProto.toObject(r.styleAttribute[o],t)}if(r.styleMap&&r.styleMap.length){e.styleMap=[];for(var o=0;o<r.styleMap.length;++o)e.styleMap[o]=n.keyhole.dbroot.StyleMapProto.toObject(r.styleMap[o],t)}if(r.endSnippet!=null&&r.hasOwnProperty("endSnippet")&&(e.endSnippet=n.keyhole.dbroot.EndSnippetProto.toObject(r.endSnippet,t)),r.translationEntry&&r.translationEntry.length){e.translationEntry=[];for(var o=0;o<r.translationEntry.length;++o)e.translationEntry[o]=n.keyhole.dbroot.StringEntryProto.toObject(r.translationEntry[o],t)}if(r.language!=null&&r.hasOwnProperty("language")&&(e.language=r.language),r.version!=null&&r.hasOwnProperty("version")&&(e.version=r.version),r.dbrootReference&&r.dbrootReference.length){e.dbrootReference=[];for(var o=0;o<r.dbrootReference.length;++o)e.dbrootReference[o]=n.keyhole.dbroot.DbRootRefProto.toObject(r.dbrootReference[o],t)}return r.databaseVersion!=null&&r.hasOwnProperty("databaseVersion")&&(e.databaseVersion=n.keyhole.dbroot.DatabaseVersionProto.toObject(r.databaseVersion,t)),r.protoImagery!=null&&r.hasOwnProperty("protoImagery")&&(e.protoImagery=r.protoImagery),r.databaseName!=null&&r.hasOwnProperty("databaseName")&&(e.databaseName=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.databaseName,t)),r.refreshTimeout!=null&&r.hasOwnProperty("refreshTimeout")&&(e.refreshTimeout=r.refreshTimeout),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DbRootProto"},i}(),c.EncryptedDbRootProto=function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.encryptionType=0,i.prototype.encryptionData=u.newBuffer([]),i.prototype.dbrootData=u.newBuffer([]),i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.EncryptedDbRootProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.encryptionType=r.int32();break}case 2:{o.encryptionData=r.bytes();break}case 3:{o.dbrootData=r.bytes();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.encryptionType!=null&&r.hasOwnProperty("encryptionType"))switch(r.encryptionType){default:return"encryptionType: enum value expected";case 0:break}return r.encryptionData!=null&&r.hasOwnProperty("encryptionData")&&!(r.encryptionData&&typeof r.encryptionData.length=="number"||u.isString(r.encryptionData))?"encryptionData: buffer expected":r.dbrootData!=null&&r.hasOwnProperty("dbrootData")&&!(r.dbrootData&&typeof r.dbrootData.length=="number"||u.isString(r.dbrootData))?"dbrootData: buffer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.EncryptedDbRootProto)return r;var t=new n.keyhole.dbroot.EncryptedDbRootProto;switch(r.encryptionType){case"ENCRYPTION_XOR":case 0:t.encryptionType=0;break}return r.encryptionData!=null&&(typeof r.encryptionData=="string"?u.base64.decode(r.encryptionData,t.encryptionData=u.newBuffer(u.base64.length(r.encryptionData)),0):r.encryptionData.length>=0&&(t.encryptionData=r.encryptionData)),r.dbrootData!=null&&(typeof r.dbrootData=="string"?u.base64.decode(r.dbrootData,t.dbrootData=u.newBuffer(u.base64.length(r.dbrootData)),0):r.dbrootData.length>=0&&(t.dbrootData=r.dbrootData)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.encryptionType=t.enums===String?"ENCRYPTION_XOR":0,t.bytes===String?e.encryptionData="":(e.encryptionData=[],t.bytes!==Array&&(e.encryptionData=u.newBuffer(e.encryptionData))),t.bytes===String?e.dbrootData="":(e.dbrootData=[],t.bytes!==Array&&(e.dbrootData=u.newBuffer(e.dbrootData)))),r.encryptionType!=null&&r.hasOwnProperty("encryptionType")&&(e.encryptionType=t.enums===String?n.keyhole.dbroot.EncryptedDbRootProto.EncryptionType[r.encryptionType]:r.encryptionType),r.encryptionData!=null&&r.hasOwnProperty("encryptionData")&&(e.encryptionData=t.bytes===String?u.base64.encode(r.encryptionData,0,r.encryptionData.length):t.bytes===Array?Array.prototype.slice.call(r.encryptionData):r.encryptionData),r.dbrootData!=null&&r.hasOwnProperty("dbrootData")&&(e.dbrootData=t.bytes===String?u.base64.encode(r.dbrootData,0,r.dbrootData.length):t.bytes===Array?Array.prototype.slice.call(r.dbrootData):r.dbrootData),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.EncryptedDbRootProto"},i.EncryptionType=function(){var l={},r=Object.create(l);return r[l[0]="ENCRYPTION_XOR"]=0,r}(),i}(),c}(),b}(),n.keyhole.dbroot};})(); +(()=>{window.cesiumGoogleEarthDbRootParser=function(d){"use strict";var f=d.Reader,u=d.util,n=d.roots.default||(d.roots.default={});return n.keyhole=(function(){var b={};return b.dbroot=(function(){var c={};return c.StringEntryProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.stringId=0,i.prototype.stringValue="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StringEntryProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.stringId=r.fixed32();break}case 2:{o.stringValue=r.string();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("stringId"))throw u.ProtocolError("missing required 'stringId'",{instance:o});if(!o.hasOwnProperty("stringValue"))throw u.ProtocolError("missing required 'stringValue'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isInteger(r.stringId)?u.isString(r.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StringEntryProto)return r;var t=new n.keyhole.dbroot.StringEntryProto;return r.stringId!=null&&(t.stringId=r.stringId>>>0),r.stringValue!=null&&(t.stringValue=String(r.stringValue)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.stringId=0,e.stringValue=""),r.stringId!=null&&r.hasOwnProperty("stringId")&&(e.stringId=r.stringId),r.stringValue!=null&&r.hasOwnProperty("stringValue")&&(e.stringValue=r.stringValue),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StringEntryProto"},i})(),c.StringIdOrValueProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.stringId=0,i.prototype.value="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StringIdOrValueProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.stringId=r.fixed32();break}case 2:{o.value=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.stringId!=null&&r.hasOwnProperty("stringId")&&!u.isInteger(r.stringId)?"stringId: integer expected":r.value!=null&&r.hasOwnProperty("value")&&!u.isString(r.value)?"value: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StringIdOrValueProto)return r;var t=new n.keyhole.dbroot.StringIdOrValueProto;return r.stringId!=null&&(t.stringId=r.stringId>>>0),r.value!=null&&(t.value=String(r.value)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.stringId=0,e.value=""),r.stringId!=null&&r.hasOwnProperty("stringId")&&(e.stringId=r.stringId),r.value!=null&&r.hasOwnProperty("value")&&(e.value=r.value),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StringIdOrValueProto"},i})(),c.PlanetModelProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.radius=6378.137,i.prototype.flattening=.00335281066474748,i.prototype.elevationBias=0,i.prototype.negativeAltitudeExponentBias=0,i.prototype.compressedNegativeAltitudeThreshold=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PlanetModelProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.radius=r.double();break}case 2:{o.flattening=r.double();break}case 4:{o.elevationBias=r.double();break}case 5:{o.negativeAltitudeExponentBias=r.int32();break}case 6:{o.compressedNegativeAltitudeThreshold=r.double();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.radius!=null&&r.hasOwnProperty("radius")&&typeof r.radius!="number"?"radius: number expected":r.flattening!=null&&r.hasOwnProperty("flattening")&&typeof r.flattening!="number"?"flattening: number expected":r.elevationBias!=null&&r.hasOwnProperty("elevationBias")&&typeof r.elevationBias!="number"?"elevationBias: number expected":r.negativeAltitudeExponentBias!=null&&r.hasOwnProperty("negativeAltitudeExponentBias")&&!u.isInteger(r.negativeAltitudeExponentBias)?"negativeAltitudeExponentBias: integer expected":r.compressedNegativeAltitudeThreshold!=null&&r.hasOwnProperty("compressedNegativeAltitudeThreshold")&&typeof r.compressedNegativeAltitudeThreshold!="number"?"compressedNegativeAltitudeThreshold: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PlanetModelProto)return r;var t=new n.keyhole.dbroot.PlanetModelProto;return r.radius!=null&&(t.radius=Number(r.radius)),r.flattening!=null&&(t.flattening=Number(r.flattening)),r.elevationBias!=null&&(t.elevationBias=Number(r.elevationBias)),r.negativeAltitudeExponentBias!=null&&(t.negativeAltitudeExponentBias=r.negativeAltitudeExponentBias|0),r.compressedNegativeAltitudeThreshold!=null&&(t.compressedNegativeAltitudeThreshold=Number(r.compressedNegativeAltitudeThreshold)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.radius=6378.137,e.flattening=.00335281066474748,e.elevationBias=0,e.negativeAltitudeExponentBias=0,e.compressedNegativeAltitudeThreshold=0),r.radius!=null&&r.hasOwnProperty("radius")&&(e.radius=t.json&&!isFinite(r.radius)?String(r.radius):r.radius),r.flattening!=null&&r.hasOwnProperty("flattening")&&(e.flattening=t.json&&!isFinite(r.flattening)?String(r.flattening):r.flattening),r.elevationBias!=null&&r.hasOwnProperty("elevationBias")&&(e.elevationBias=t.json&&!isFinite(r.elevationBias)?String(r.elevationBias):r.elevationBias),r.negativeAltitudeExponentBias!=null&&r.hasOwnProperty("negativeAltitudeExponentBias")&&(e.negativeAltitudeExponentBias=r.negativeAltitudeExponentBias),r.compressedNegativeAltitudeThreshold!=null&&r.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(e.compressedNegativeAltitudeThreshold=t.json&&!isFinite(r.compressedNegativeAltitudeThreshold)?String(r.compressedNegativeAltitudeThreshold):r.compressedNegativeAltitudeThreshold),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PlanetModelProto"},i})(),c.ProviderInfoProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.providerId=0,i.prototype.copyrightString=null,i.prototype.verticalPixelOffset=-1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ProviderInfoProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.providerId=r.int32();break}case 2:{o.copyrightString=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.verticalPixelOffset=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("providerId"))throw u.ProtocolError("missing required 'providerId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isInteger(r.providerId))return"providerId: integer expected";if(r.copyrightString!=null&&r.hasOwnProperty("copyrightString")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.copyrightString);if(t)return"copyrightString."+t}return r.verticalPixelOffset!=null&&r.hasOwnProperty("verticalPixelOffset")&&!u.isInteger(r.verticalPixelOffset)?"verticalPixelOffset: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ProviderInfoProto)return r;var t=new n.keyhole.dbroot.ProviderInfoProto;if(r.providerId!=null&&(t.providerId=r.providerId|0),r.copyrightString!=null){if(typeof r.copyrightString!="object")throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");t.copyrightString=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.copyrightString)}return r.verticalPixelOffset!=null&&(t.verticalPixelOffset=r.verticalPixelOffset|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.providerId=0,e.copyrightString=null,e.verticalPixelOffset=-1),r.providerId!=null&&r.hasOwnProperty("providerId")&&(e.providerId=r.providerId),r.copyrightString!=null&&r.hasOwnProperty("copyrightString")&&(e.copyrightString=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.copyrightString,t)),r.verticalPixelOffset!=null&&r.hasOwnProperty("verticalPixelOffset")&&(e.verticalPixelOffset=r.verticalPixelOffset),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ProviderInfoProto"},i})(),c.PopUpProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.isBalloonStyle=!1,i.prototype.text=null,i.prototype.backgroundColorAbgr=4294967295,i.prototype.textColorAbgr=4278190080,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PopUpProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.isBalloonStyle=r.bool();break}case 2:{o.text=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.backgroundColorAbgr=r.fixed32();break}case 4:{o.textColorAbgr=r.fixed32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.isBalloonStyle!=null&&r.hasOwnProperty("isBalloonStyle")&&typeof r.isBalloonStyle!="boolean")return"isBalloonStyle: boolean expected";if(r.text!=null&&r.hasOwnProperty("text")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.text);if(t)return"text."+t}return r.backgroundColorAbgr!=null&&r.hasOwnProperty("backgroundColorAbgr")&&!u.isInteger(r.backgroundColorAbgr)?"backgroundColorAbgr: integer expected":r.textColorAbgr!=null&&r.hasOwnProperty("textColorAbgr")&&!u.isInteger(r.textColorAbgr)?"textColorAbgr: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PopUpProto)return r;var t=new n.keyhole.dbroot.PopUpProto;if(r.isBalloonStyle!=null&&(t.isBalloonStyle=!!r.isBalloonStyle),r.text!=null){if(typeof r.text!="object")throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");t.text=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.text)}return r.backgroundColorAbgr!=null&&(t.backgroundColorAbgr=r.backgroundColorAbgr>>>0),r.textColorAbgr!=null&&(t.textColorAbgr=r.textColorAbgr>>>0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.isBalloonStyle=!1,e.text=null,e.backgroundColorAbgr=4294967295,e.textColorAbgr=4278190080),r.isBalloonStyle!=null&&r.hasOwnProperty("isBalloonStyle")&&(e.isBalloonStyle=r.isBalloonStyle),r.text!=null&&r.hasOwnProperty("text")&&(e.text=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.text,t)),r.backgroundColorAbgr!=null&&r.hasOwnProperty("backgroundColorAbgr")&&(e.backgroundColorAbgr=r.backgroundColorAbgr),r.textColorAbgr!=null&&r.hasOwnProperty("textColorAbgr")&&(e.textColorAbgr=r.textColorAbgr),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PopUpProto"},i})(),c.StyleAttributeProto=(function(){function i(l){if(this.drawFlag=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.styleId="",i.prototype.providerId=0,i.prototype.polyColorAbgr=4294967295,i.prototype.lineColorAbgr=4294967295,i.prototype.lineWidth=1,i.prototype.labelColorAbgr=4294967295,i.prototype.labelScale=1,i.prototype.placemarkIconColorAbgr=4294967295,i.prototype.placemarkIconScale=1,i.prototype.placemarkIconPath=null,i.prototype.placemarkIconX=0,i.prototype.placemarkIconY=0,i.prototype.placemarkIconWidth=32,i.prototype.placemarkIconHeight=32,i.prototype.popUp=null,i.prototype.drawFlag=u.emptyArray,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StyleAttributeProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.styleId=r.string();break}case 3:{o.providerId=r.int32();break}case 4:{o.polyColorAbgr=r.fixed32();break}case 5:{o.lineColorAbgr=r.fixed32();break}case 6:{o.lineWidth=r.float();break}case 7:{o.labelColorAbgr=r.fixed32();break}case 8:{o.labelScale=r.float();break}case 9:{o.placemarkIconColorAbgr=r.fixed32();break}case 10:{o.placemarkIconScale=r.float();break}case 11:{o.placemarkIconPath=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 12:{o.placemarkIconX=r.int32();break}case 13:{o.placemarkIconY=r.int32();break}case 14:{o.placemarkIconWidth=r.int32();break}case 15:{o.placemarkIconHeight=r.int32();break}case 16:{o.popUp=n.keyhole.dbroot.PopUpProto.decode(r,r.uint32());break}case 17:{o.drawFlag&&o.drawFlag.length||(o.drawFlag=[]),o.drawFlag.push(n.keyhole.dbroot.DrawFlagProto.decode(r,r.uint32()));break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("styleId"))throw u.ProtocolError("missing required 'styleId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.styleId))return"styleId: string expected";if(r.providerId!=null&&r.hasOwnProperty("providerId")&&!u.isInteger(r.providerId))return"providerId: integer expected";if(r.polyColorAbgr!=null&&r.hasOwnProperty("polyColorAbgr")&&!u.isInteger(r.polyColorAbgr))return"polyColorAbgr: integer expected";if(r.lineColorAbgr!=null&&r.hasOwnProperty("lineColorAbgr")&&!u.isInteger(r.lineColorAbgr))return"lineColorAbgr: integer expected";if(r.lineWidth!=null&&r.hasOwnProperty("lineWidth")&&typeof r.lineWidth!="number")return"lineWidth: number expected";if(r.labelColorAbgr!=null&&r.hasOwnProperty("labelColorAbgr")&&!u.isInteger(r.labelColorAbgr))return"labelColorAbgr: integer expected";if(r.labelScale!=null&&r.hasOwnProperty("labelScale")&&typeof r.labelScale!="number")return"labelScale: number expected";if(r.placemarkIconColorAbgr!=null&&r.hasOwnProperty("placemarkIconColorAbgr")&&!u.isInteger(r.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(r.placemarkIconScale!=null&&r.hasOwnProperty("placemarkIconScale")&&typeof r.placemarkIconScale!="number")return"placemarkIconScale: number expected";if(r.placemarkIconPath!=null&&r.hasOwnProperty("placemarkIconPath")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.placemarkIconPath);if(t)return"placemarkIconPath."+t}if(r.placemarkIconX!=null&&r.hasOwnProperty("placemarkIconX")&&!u.isInteger(r.placemarkIconX))return"placemarkIconX: integer expected";if(r.placemarkIconY!=null&&r.hasOwnProperty("placemarkIconY")&&!u.isInteger(r.placemarkIconY))return"placemarkIconY: integer expected";if(r.placemarkIconWidth!=null&&r.hasOwnProperty("placemarkIconWidth")&&!u.isInteger(r.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(r.placemarkIconHeight!=null&&r.hasOwnProperty("placemarkIconHeight")&&!u.isInteger(r.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(r.popUp!=null&&r.hasOwnProperty("popUp")){var t=n.keyhole.dbroot.PopUpProto.verify(r.popUp);if(t)return"popUp."+t}if(r.drawFlag!=null&&r.hasOwnProperty("drawFlag")){if(!Array.isArray(r.drawFlag))return"drawFlag: array expected";for(var e=0;e<r.drawFlag.length;++e){var t=n.keyhole.dbroot.DrawFlagProto.verify(r.drawFlag[e]);if(t)return"drawFlag."+t}}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StyleAttributeProto)return r;var t=new n.keyhole.dbroot.StyleAttributeProto;if(r.styleId!=null&&(t.styleId=String(r.styleId)),r.providerId!=null&&(t.providerId=r.providerId|0),r.polyColorAbgr!=null&&(t.polyColorAbgr=r.polyColorAbgr>>>0),r.lineColorAbgr!=null&&(t.lineColorAbgr=r.lineColorAbgr>>>0),r.lineWidth!=null&&(t.lineWidth=Number(r.lineWidth)),r.labelColorAbgr!=null&&(t.labelColorAbgr=r.labelColorAbgr>>>0),r.labelScale!=null&&(t.labelScale=Number(r.labelScale)),r.placemarkIconColorAbgr!=null&&(t.placemarkIconColorAbgr=r.placemarkIconColorAbgr>>>0),r.placemarkIconScale!=null&&(t.placemarkIconScale=Number(r.placemarkIconScale)),r.placemarkIconPath!=null){if(typeof r.placemarkIconPath!="object")throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");t.placemarkIconPath=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.placemarkIconPath)}if(r.placemarkIconX!=null&&(t.placemarkIconX=r.placemarkIconX|0),r.placemarkIconY!=null&&(t.placemarkIconY=r.placemarkIconY|0),r.placemarkIconWidth!=null&&(t.placemarkIconWidth=r.placemarkIconWidth|0),r.placemarkIconHeight!=null&&(t.placemarkIconHeight=r.placemarkIconHeight|0),r.popUp!=null){if(typeof r.popUp!="object")throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");t.popUp=n.keyhole.dbroot.PopUpProto.fromObject(r.popUp)}if(r.drawFlag){if(!Array.isArray(r.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");t.drawFlag=[];for(var e=0;e<r.drawFlag.length;++e){if(typeof r.drawFlag[e]!="object")throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");t.drawFlag[e]=n.keyhole.dbroot.DrawFlagProto.fromObject(r.drawFlag[e])}}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.drawFlag=[]),t.defaults&&(e.styleId="",e.providerId=0,e.polyColorAbgr=4294967295,e.lineColorAbgr=4294967295,e.lineWidth=1,e.labelColorAbgr=4294967295,e.labelScale=1,e.placemarkIconColorAbgr=4294967295,e.placemarkIconScale=1,e.placemarkIconPath=null,e.placemarkIconX=0,e.placemarkIconY=0,e.placemarkIconWidth=32,e.placemarkIconHeight=32,e.popUp=null),r.styleId!=null&&r.hasOwnProperty("styleId")&&(e.styleId=r.styleId),r.providerId!=null&&r.hasOwnProperty("providerId")&&(e.providerId=r.providerId),r.polyColorAbgr!=null&&r.hasOwnProperty("polyColorAbgr")&&(e.polyColorAbgr=r.polyColorAbgr),r.lineColorAbgr!=null&&r.hasOwnProperty("lineColorAbgr")&&(e.lineColorAbgr=r.lineColorAbgr),r.lineWidth!=null&&r.hasOwnProperty("lineWidth")&&(e.lineWidth=t.json&&!isFinite(r.lineWidth)?String(r.lineWidth):r.lineWidth),r.labelColorAbgr!=null&&r.hasOwnProperty("labelColorAbgr")&&(e.labelColorAbgr=r.labelColorAbgr),r.labelScale!=null&&r.hasOwnProperty("labelScale")&&(e.labelScale=t.json&&!isFinite(r.labelScale)?String(r.labelScale):r.labelScale),r.placemarkIconColorAbgr!=null&&r.hasOwnProperty("placemarkIconColorAbgr")&&(e.placemarkIconColorAbgr=r.placemarkIconColorAbgr),r.placemarkIconScale!=null&&r.hasOwnProperty("placemarkIconScale")&&(e.placemarkIconScale=t.json&&!isFinite(r.placemarkIconScale)?String(r.placemarkIconScale):r.placemarkIconScale),r.placemarkIconPath!=null&&r.hasOwnProperty("placemarkIconPath")&&(e.placemarkIconPath=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.placemarkIconPath,t)),r.placemarkIconX!=null&&r.hasOwnProperty("placemarkIconX")&&(e.placemarkIconX=r.placemarkIconX),r.placemarkIconY!=null&&r.hasOwnProperty("placemarkIconY")&&(e.placemarkIconY=r.placemarkIconY),r.placemarkIconWidth!=null&&r.hasOwnProperty("placemarkIconWidth")&&(e.placemarkIconWidth=r.placemarkIconWidth),r.placemarkIconHeight!=null&&r.hasOwnProperty("placemarkIconHeight")&&(e.placemarkIconHeight=r.placemarkIconHeight),r.popUp!=null&&r.hasOwnProperty("popUp")&&(e.popUp=n.keyhole.dbroot.PopUpProto.toObject(r.popUp,t)),r.drawFlag&&r.drawFlag.length){e.drawFlag=[];for(var o=0;o<r.drawFlag.length;++o)e.drawFlag[o]=n.keyhole.dbroot.DrawFlagProto.toObject(r.drawFlag[o],t)}return e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StyleAttributeProto"},i})(),c.StyleMapProto=(function(){function i(l){if(this.channelId=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.styleMapId=0,i.prototype.channelId=u.emptyArray,i.prototype.normalStyleAttribute=0,i.prototype.highlightStyleAttribute=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.StyleMapProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.styleMapId=r.int32();break}case 2:{if(o.channelId&&o.channelId.length||(o.channelId=[]),(a&7)===2)for(var p=r.uint32()+r.pos;r.pos<p;)o.channelId.push(r.int32());else o.channelId.push(r.int32());break}case 3:{o.normalStyleAttribute=r.int32();break}case 4:{o.highlightStyleAttribute=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("styleMapId"))throw u.ProtocolError("missing required 'styleMapId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isInteger(r.styleMapId))return"styleMapId: integer expected";if(r.channelId!=null&&r.hasOwnProperty("channelId")){if(!Array.isArray(r.channelId))return"channelId: array expected";for(var t=0;t<r.channelId.length;++t)if(!u.isInteger(r.channelId[t]))return"channelId: integer[] expected"}return r.normalStyleAttribute!=null&&r.hasOwnProperty("normalStyleAttribute")&&!u.isInteger(r.normalStyleAttribute)?"normalStyleAttribute: integer expected":r.highlightStyleAttribute!=null&&r.hasOwnProperty("highlightStyleAttribute")&&!u.isInteger(r.highlightStyleAttribute)?"highlightStyleAttribute: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.StyleMapProto)return r;var t=new n.keyhole.dbroot.StyleMapProto;if(r.styleMapId!=null&&(t.styleMapId=r.styleMapId|0),r.channelId){if(!Array.isArray(r.channelId))throw TypeError(".keyhole.dbroot.StyleMapProto.channelId: array expected");t.channelId=[];for(var e=0;e<r.channelId.length;++e)t.channelId[e]=r.channelId[e]|0}return r.normalStyleAttribute!=null&&(t.normalStyleAttribute=r.normalStyleAttribute|0),r.highlightStyleAttribute!=null&&(t.highlightStyleAttribute=r.highlightStyleAttribute|0),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.channelId=[]),t.defaults&&(e.styleMapId=0,e.normalStyleAttribute=0,e.highlightStyleAttribute=0),r.styleMapId!=null&&r.hasOwnProperty("styleMapId")&&(e.styleMapId=r.styleMapId),r.channelId&&r.channelId.length){e.channelId=[];for(var o=0;o<r.channelId.length;++o)e.channelId[o]=r.channelId[o]}return r.normalStyleAttribute!=null&&r.hasOwnProperty("normalStyleAttribute")&&(e.normalStyleAttribute=r.normalStyleAttribute),r.highlightStyleAttribute!=null&&r.hasOwnProperty("highlightStyleAttribute")&&(e.highlightStyleAttribute=r.highlightStyleAttribute),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.StyleMapProto"},i})(),c.ZoomRangeProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.minZoom=0,i.prototype.maxZoom=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ZoomRangeProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.minZoom=r.int32();break}case 2:{o.maxZoom=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("minZoom"))throw u.ProtocolError("missing required 'minZoom'",{instance:o});if(!o.hasOwnProperty("maxZoom"))throw u.ProtocolError("missing required 'maxZoom'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isInteger(r.minZoom)?u.isInteger(r.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ZoomRangeProto)return r;var t=new n.keyhole.dbroot.ZoomRangeProto;return r.minZoom!=null&&(t.minZoom=r.minZoom|0),r.maxZoom!=null&&(t.maxZoom=r.maxZoom|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.minZoom=0,e.maxZoom=0),r.minZoom!=null&&r.hasOwnProperty("minZoom")&&(e.minZoom=r.minZoom),r.maxZoom!=null&&r.hasOwnProperty("maxZoom")&&(e.maxZoom=r.maxZoom),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ZoomRangeProto"},i})(),c.DrawFlagProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.drawFlagType=1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DrawFlagProto;r.pos<e;){var a=r.uint32();a>>>3===1?o.drawFlagType=r.int32():r.skipType(a&7)}if(!o.hasOwnProperty("drawFlagType"))throw u.ProtocolError("missing required 'drawFlagType'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";switch(r.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:break}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DrawFlagProto)return r;var t=new n.keyhole.dbroot.DrawFlagProto;switch(r.drawFlagType){case"TYPE_FILL_ONLY":case 1:t.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:t.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:t.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:t.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:t.drawFlagType=5;break}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.drawFlagType=t.enums===String?"TYPE_FILL_ONLY":1),r.drawFlagType!=null&&r.hasOwnProperty("drawFlagType")&&(e.drawFlagType=t.enums===String?n.keyhole.dbroot.DrawFlagProto.DrawFlagType[r.drawFlagType]:r.drawFlagType),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DrawFlagProto"},i.DrawFlagType=(function(){var l={},r=Object.create(l);return r[l[1]="TYPE_FILL_ONLY"]=1,r[l[2]="TYPE_OUTLINE_ONLY"]=2,r[l[3]="TYPE_FILL_AND_OUTLINE"]=3,r[l[4]="TYPE_ANTIALIASING"]=4,r[l[5]="TYPE_CENTER_LABEL"]=5,r})(),i})(),c.LayerProto=(function(){function i(l){if(this.zoomRange=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.zoomRange=u.emptyArray,i.prototype.preserveTextLevel=30,i.prototype.lodBeginTransition=!1,i.prototype.lodEndTransition=!1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.LayerProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.zoomRange&&o.zoomRange.length||(o.zoomRange=[]),o.zoomRange.push(n.keyhole.dbroot.ZoomRangeProto.decode(r,r.uint32()));break}case 2:{o.preserveTextLevel=r.int32();break}case 4:{o.lodBeginTransition=r.bool();break}case 5:{o.lodEndTransition=r.bool();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.zoomRange!=null&&r.hasOwnProperty("zoomRange")){if(!Array.isArray(r.zoomRange))return"zoomRange: array expected";for(var t=0;t<r.zoomRange.length;++t){var e=n.keyhole.dbroot.ZoomRangeProto.verify(r.zoomRange[t]);if(e)return"zoomRange."+e}}return r.preserveTextLevel!=null&&r.hasOwnProperty("preserveTextLevel")&&!u.isInteger(r.preserveTextLevel)?"preserveTextLevel: integer expected":r.lodBeginTransition!=null&&r.hasOwnProperty("lodBeginTransition")&&typeof r.lodBeginTransition!="boolean"?"lodBeginTransition: boolean expected":r.lodEndTransition!=null&&r.hasOwnProperty("lodEndTransition")&&typeof r.lodEndTransition!="boolean"?"lodEndTransition: boolean expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.LayerProto)return r;var t=new n.keyhole.dbroot.LayerProto;if(r.zoomRange){if(!Array.isArray(r.zoomRange))throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: array expected");t.zoomRange=[];for(var e=0;e<r.zoomRange.length;++e){if(typeof r.zoomRange[e]!="object")throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: object expected");t.zoomRange[e]=n.keyhole.dbroot.ZoomRangeProto.fromObject(r.zoomRange[e])}}return r.preserveTextLevel!=null&&(t.preserveTextLevel=r.preserveTextLevel|0),r.lodBeginTransition!=null&&(t.lodBeginTransition=!!r.lodBeginTransition),r.lodEndTransition!=null&&(t.lodEndTransition=!!r.lodEndTransition),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.zoomRange=[]),t.defaults&&(e.preserveTextLevel=30,e.lodBeginTransition=!1,e.lodEndTransition=!1),r.zoomRange&&r.zoomRange.length){e.zoomRange=[];for(var o=0;o<r.zoomRange.length;++o)e.zoomRange[o]=n.keyhole.dbroot.ZoomRangeProto.toObject(r.zoomRange[o],t)}return r.preserveTextLevel!=null&&r.hasOwnProperty("preserveTextLevel")&&(e.preserveTextLevel=r.preserveTextLevel),r.lodBeginTransition!=null&&r.hasOwnProperty("lodBeginTransition")&&(e.lodBeginTransition=r.lodBeginTransition),r.lodEndTransition!=null&&r.hasOwnProperty("lodEndTransition")&&(e.lodEndTransition=r.lodEndTransition),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.LayerProto"},i})(),c.FolderProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.isExpandable=!0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.FolderProto;r.pos<e;){var a=r.uint32();a>>>3===1?o.isExpandable=r.bool():r.skipType(a&7)}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.isExpandable!=null&&r.hasOwnProperty("isExpandable")&&typeof r.isExpandable!="boolean"?"isExpandable: boolean expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.FolderProto)return r;var t=new n.keyhole.dbroot.FolderProto;return r.isExpandable!=null&&(t.isExpandable=!!r.isExpandable),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.isExpandable=!0),r.isExpandable!=null&&r.hasOwnProperty("isExpandable")&&(e.isExpandable=r.isExpandable),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.FolderProto"},i})(),c.RequirementProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.requiredVram="",i.prototype.requiredClientVer="",i.prototype.probability="",i.prototype.requiredUserAgent="",i.prototype.requiredClientCapabilities="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.RequirementProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 3:{o.requiredVram=r.string();break}case 4:{o.requiredClientVer=r.string();break}case 5:{o.probability=r.string();break}case 6:{o.requiredUserAgent=r.string();break}case 7:{o.requiredClientCapabilities=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.requiredVram!=null&&r.hasOwnProperty("requiredVram")&&!u.isString(r.requiredVram)?"requiredVram: string expected":r.requiredClientVer!=null&&r.hasOwnProperty("requiredClientVer")&&!u.isString(r.requiredClientVer)?"requiredClientVer: string expected":r.probability!=null&&r.hasOwnProperty("probability")&&!u.isString(r.probability)?"probability: string expected":r.requiredUserAgent!=null&&r.hasOwnProperty("requiredUserAgent")&&!u.isString(r.requiredUserAgent)?"requiredUserAgent: string expected":r.requiredClientCapabilities!=null&&r.hasOwnProperty("requiredClientCapabilities")&&!u.isString(r.requiredClientCapabilities)?"requiredClientCapabilities: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.RequirementProto)return r;var t=new n.keyhole.dbroot.RequirementProto;return r.requiredVram!=null&&(t.requiredVram=String(r.requiredVram)),r.requiredClientVer!=null&&(t.requiredClientVer=String(r.requiredClientVer)),r.probability!=null&&(t.probability=String(r.probability)),r.requiredUserAgent!=null&&(t.requiredUserAgent=String(r.requiredUserAgent)),r.requiredClientCapabilities!=null&&(t.requiredClientCapabilities=String(r.requiredClientCapabilities)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.requiredVram="",e.requiredClientVer="",e.probability="",e.requiredUserAgent="",e.requiredClientCapabilities=""),r.requiredVram!=null&&r.hasOwnProperty("requiredVram")&&(e.requiredVram=r.requiredVram),r.requiredClientVer!=null&&r.hasOwnProperty("requiredClientVer")&&(e.requiredClientVer=r.requiredClientVer),r.probability!=null&&r.hasOwnProperty("probability")&&(e.probability=r.probability),r.requiredUserAgent!=null&&r.hasOwnProperty("requiredUserAgent")&&(e.requiredUserAgent=r.requiredUserAgent),r.requiredClientCapabilities!=null&&r.hasOwnProperty("requiredClientCapabilities")&&(e.requiredClientCapabilities=r.requiredClientCapabilities),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.RequirementProto"},i})(),c.LookAtProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.longitude=0,i.prototype.latitude=0,i.prototype.range=0,i.prototype.tilt=0,i.prototype.heading=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.LookAtProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.longitude=r.float();break}case 2:{o.latitude=r.float();break}case 3:{o.range=r.float();break}case 4:{o.tilt=r.float();break}case 5:{o.heading=r.float();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("longitude"))throw u.ProtocolError("missing required 'longitude'",{instance:o});if(!o.hasOwnProperty("latitude"))throw u.ProtocolError("missing required 'latitude'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":typeof r.longitude!="number"?"longitude: number expected":typeof r.latitude!="number"?"latitude: number expected":r.range!=null&&r.hasOwnProperty("range")&&typeof r.range!="number"?"range: number expected":r.tilt!=null&&r.hasOwnProperty("tilt")&&typeof r.tilt!="number"?"tilt: number expected":r.heading!=null&&r.hasOwnProperty("heading")&&typeof r.heading!="number"?"heading: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.LookAtProto)return r;var t=new n.keyhole.dbroot.LookAtProto;return r.longitude!=null&&(t.longitude=Number(r.longitude)),r.latitude!=null&&(t.latitude=Number(r.latitude)),r.range!=null&&(t.range=Number(r.range)),r.tilt!=null&&(t.tilt=Number(r.tilt)),r.heading!=null&&(t.heading=Number(r.heading)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.longitude=0,e.latitude=0,e.range=0,e.tilt=0,e.heading=0),r.longitude!=null&&r.hasOwnProperty("longitude")&&(e.longitude=t.json&&!isFinite(r.longitude)?String(r.longitude):r.longitude),r.latitude!=null&&r.hasOwnProperty("latitude")&&(e.latitude=t.json&&!isFinite(r.latitude)?String(r.latitude):r.latitude),r.range!=null&&r.hasOwnProperty("range")&&(e.range=t.json&&!isFinite(r.range)?String(r.range):r.range),r.tilt!=null&&r.hasOwnProperty("tilt")&&(e.tilt=t.json&&!isFinite(r.tilt)?String(r.tilt):r.tilt),r.heading!=null&&r.hasOwnProperty("heading")&&(e.heading=t.json&&!isFinite(r.heading)?String(r.heading):r.heading),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.LookAtProto"},i})(),c.NestedFeatureProto=(function(){function i(l){if(this.children=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.featureType=1,i.prototype.kmlUrl=null,i.prototype.databaseUrl="",i.prototype.layer=null,i.prototype.folder=null,i.prototype.requirement=null,i.prototype.channelId=0,i.prototype.displayName=null,i.prototype.isVisible=!0,i.prototype.isEnabled=!0,i.prototype.isChecked=!1,i.prototype.layerMenuIconPath="icons/773_l.png",i.prototype.description=null,i.prototype.lookAt=null,i.prototype.assetUuid="",i.prototype.isSaveLocked=!0,i.prototype.children=u.emptyArray,i.prototype.clientConfigScriptName="",i.prototype.dioramaDataChannelBase=-1,i.prototype.replicaDataChannelBase=-1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.NestedFeatureProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.featureType=r.int32();break}case 2:{o.kmlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 21:{o.databaseUrl=r.string();break}case 3:{o.layer=n.keyhole.dbroot.LayerProto.decode(r,r.uint32());break}case 4:{o.folder=n.keyhole.dbroot.FolderProto.decode(r,r.uint32());break}case 5:{o.requirement=n.keyhole.dbroot.RequirementProto.decode(r,r.uint32());break}case 6:{o.channelId=r.int32();break}case 7:{o.displayName=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 8:{o.isVisible=r.bool();break}case 9:{o.isEnabled=r.bool();break}case 10:{o.isChecked=r.bool();break}case 11:{o.layerMenuIconPath=r.string();break}case 12:{o.description=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 13:{o.lookAt=n.keyhole.dbroot.LookAtProto.decode(r,r.uint32());break}case 15:{o.assetUuid=r.string();break}case 16:{o.isSaveLocked=r.bool();break}case 17:{o.children&&o.children.length||(o.children=[]),o.children.push(n.keyhole.dbroot.NestedFeatureProto.decode(r,r.uint32()));break}case 18:{o.clientConfigScriptName=r.string();break}case 19:{o.dioramaDataChannelBase=r.int32();break}case 20:{o.replicaDataChannelBase=r.int32();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("channelId"))throw u.ProtocolError("missing required 'channelId'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.featureType!=null&&r.hasOwnProperty("featureType"))switch(r.featureType){default:return"featureType: enum value expected";case 1:case 2:case 3:case 4:break}if(r.kmlUrl!=null&&r.hasOwnProperty("kmlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.kmlUrl);if(t)return"kmlUrl."+t}if(r.databaseUrl!=null&&r.hasOwnProperty("databaseUrl")&&!u.isString(r.databaseUrl))return"databaseUrl: string expected";if(r.layer!=null&&r.hasOwnProperty("layer")){var t=n.keyhole.dbroot.LayerProto.verify(r.layer);if(t)return"layer."+t}if(r.folder!=null&&r.hasOwnProperty("folder")){var t=n.keyhole.dbroot.FolderProto.verify(r.folder);if(t)return"folder."+t}if(r.requirement!=null&&r.hasOwnProperty("requirement")){var t=n.keyhole.dbroot.RequirementProto.verify(r.requirement);if(t)return"requirement."+t}if(!u.isInteger(r.channelId))return"channelId: integer expected";if(r.displayName!=null&&r.hasOwnProperty("displayName")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.displayName);if(t)return"displayName."+t}if(r.isVisible!=null&&r.hasOwnProperty("isVisible")&&typeof r.isVisible!="boolean")return"isVisible: boolean expected";if(r.isEnabled!=null&&r.hasOwnProperty("isEnabled")&&typeof r.isEnabled!="boolean")return"isEnabled: boolean expected";if(r.isChecked!=null&&r.hasOwnProperty("isChecked")&&typeof r.isChecked!="boolean")return"isChecked: boolean expected";if(r.layerMenuIconPath!=null&&r.hasOwnProperty("layerMenuIconPath")&&!u.isString(r.layerMenuIconPath))return"layerMenuIconPath: string expected";if(r.description!=null&&r.hasOwnProperty("description")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.description);if(t)return"description."+t}if(r.lookAt!=null&&r.hasOwnProperty("lookAt")){var t=n.keyhole.dbroot.LookAtProto.verify(r.lookAt);if(t)return"lookAt."+t}if(r.assetUuid!=null&&r.hasOwnProperty("assetUuid")&&!u.isString(r.assetUuid))return"assetUuid: string expected";if(r.isSaveLocked!=null&&r.hasOwnProperty("isSaveLocked")&&typeof r.isSaveLocked!="boolean")return"isSaveLocked: boolean expected";if(r.children!=null&&r.hasOwnProperty("children")){if(!Array.isArray(r.children))return"children: array expected";for(var e=0;e<r.children.length;++e){var t=n.keyhole.dbroot.NestedFeatureProto.verify(r.children[e]);if(t)return"children."+t}}return r.clientConfigScriptName!=null&&r.hasOwnProperty("clientConfigScriptName")&&!u.isString(r.clientConfigScriptName)?"clientConfigScriptName: string expected":r.dioramaDataChannelBase!=null&&r.hasOwnProperty("dioramaDataChannelBase")&&!u.isInteger(r.dioramaDataChannelBase)?"dioramaDataChannelBase: integer expected":r.replicaDataChannelBase!=null&&r.hasOwnProperty("replicaDataChannelBase")&&!u.isInteger(r.replicaDataChannelBase)?"replicaDataChannelBase: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.NestedFeatureProto)return r;var t=new n.keyhole.dbroot.NestedFeatureProto;switch(r.featureType){case"TYPE_POINT_Z":case 1:t.featureType=1;break;case"TYPE_POLYGON_Z":case 2:t.featureType=2;break;case"TYPE_LINE_Z":case 3:t.featureType=3;break;case"TYPE_TERRAIN":case 4:t.featureType=4;break}if(r.kmlUrl!=null){if(typeof r.kmlUrl!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected");t.kmlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.kmlUrl)}if(r.databaseUrl!=null&&(t.databaseUrl=String(r.databaseUrl)),r.layer!=null){if(typeof r.layer!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.layer: object expected");t.layer=n.keyhole.dbroot.LayerProto.fromObject(r.layer)}if(r.folder!=null){if(typeof r.folder!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.folder: object expected");t.folder=n.keyhole.dbroot.FolderProto.fromObject(r.folder)}if(r.requirement!=null){if(typeof r.requirement!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.requirement: object expected");t.requirement=n.keyhole.dbroot.RequirementProto.fromObject(r.requirement)}if(r.channelId!=null&&(t.channelId=r.channelId|0),r.displayName!=null){if(typeof r.displayName!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.displayName: object expected");t.displayName=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.displayName)}if(r.isVisible!=null&&(t.isVisible=!!r.isVisible),r.isEnabled!=null&&(t.isEnabled=!!r.isEnabled),r.isChecked!=null&&(t.isChecked=!!r.isChecked),r.layerMenuIconPath!=null&&(t.layerMenuIconPath=String(r.layerMenuIconPath)),r.description!=null){if(typeof r.description!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.description: object expected");t.description=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.description)}if(r.lookAt!=null){if(typeof r.lookAt!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.lookAt: object expected");t.lookAt=n.keyhole.dbroot.LookAtProto.fromObject(r.lookAt)}if(r.assetUuid!=null&&(t.assetUuid=String(r.assetUuid)),r.isSaveLocked!=null&&(t.isSaveLocked=!!r.isSaveLocked),r.children){if(!Array.isArray(r.children))throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: array expected");t.children=[];for(var e=0;e<r.children.length;++e){if(typeof r.children[e]!="object")throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: object expected");t.children[e]=n.keyhole.dbroot.NestedFeatureProto.fromObject(r.children[e])}}return r.clientConfigScriptName!=null&&(t.clientConfigScriptName=String(r.clientConfigScriptName)),r.dioramaDataChannelBase!=null&&(t.dioramaDataChannelBase=r.dioramaDataChannelBase|0),r.replicaDataChannelBase!=null&&(t.replicaDataChannelBase=r.replicaDataChannelBase|0),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.children=[]),t.defaults&&(e.featureType=t.enums===String?"TYPE_POINT_Z":1,e.kmlUrl=null,e.layer=null,e.folder=null,e.requirement=null,e.channelId=0,e.displayName=null,e.isVisible=!0,e.isEnabled=!0,e.isChecked=!1,e.layerMenuIconPath="icons/773_l.png",e.description=null,e.lookAt=null,e.assetUuid="",e.isSaveLocked=!0,e.clientConfigScriptName="",e.dioramaDataChannelBase=-1,e.replicaDataChannelBase=-1,e.databaseUrl=""),r.featureType!=null&&r.hasOwnProperty("featureType")&&(e.featureType=t.enums===String?n.keyhole.dbroot.NestedFeatureProto.FeatureType[r.featureType]:r.featureType),r.kmlUrl!=null&&r.hasOwnProperty("kmlUrl")&&(e.kmlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.kmlUrl,t)),r.layer!=null&&r.hasOwnProperty("layer")&&(e.layer=n.keyhole.dbroot.LayerProto.toObject(r.layer,t)),r.folder!=null&&r.hasOwnProperty("folder")&&(e.folder=n.keyhole.dbroot.FolderProto.toObject(r.folder,t)),r.requirement!=null&&r.hasOwnProperty("requirement")&&(e.requirement=n.keyhole.dbroot.RequirementProto.toObject(r.requirement,t)),r.channelId!=null&&r.hasOwnProperty("channelId")&&(e.channelId=r.channelId),r.displayName!=null&&r.hasOwnProperty("displayName")&&(e.displayName=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.displayName,t)),r.isVisible!=null&&r.hasOwnProperty("isVisible")&&(e.isVisible=r.isVisible),r.isEnabled!=null&&r.hasOwnProperty("isEnabled")&&(e.isEnabled=r.isEnabled),r.isChecked!=null&&r.hasOwnProperty("isChecked")&&(e.isChecked=r.isChecked),r.layerMenuIconPath!=null&&r.hasOwnProperty("layerMenuIconPath")&&(e.layerMenuIconPath=r.layerMenuIconPath),r.description!=null&&r.hasOwnProperty("description")&&(e.description=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.description,t)),r.lookAt!=null&&r.hasOwnProperty("lookAt")&&(e.lookAt=n.keyhole.dbroot.LookAtProto.toObject(r.lookAt,t)),r.assetUuid!=null&&r.hasOwnProperty("assetUuid")&&(e.assetUuid=r.assetUuid),r.isSaveLocked!=null&&r.hasOwnProperty("isSaveLocked")&&(e.isSaveLocked=r.isSaveLocked),r.children&&r.children.length){e.children=[];for(var o=0;o<r.children.length;++o)e.children[o]=n.keyhole.dbroot.NestedFeatureProto.toObject(r.children[o],t)}return r.clientConfigScriptName!=null&&r.hasOwnProperty("clientConfigScriptName")&&(e.clientConfigScriptName=r.clientConfigScriptName),r.dioramaDataChannelBase!=null&&r.hasOwnProperty("dioramaDataChannelBase")&&(e.dioramaDataChannelBase=r.dioramaDataChannelBase),r.replicaDataChannelBase!=null&&r.hasOwnProperty("replicaDataChannelBase")&&(e.replicaDataChannelBase=r.replicaDataChannelBase),r.databaseUrl!=null&&r.hasOwnProperty("databaseUrl")&&(e.databaseUrl=r.databaseUrl),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.NestedFeatureProto"},i.FeatureType=(function(){var l={},r=Object.create(l);return r[l[1]="TYPE_POINT_Z"]=1,r[l[2]="TYPE_POLYGON_Z"]=2,r[l[3]="TYPE_LINE_Z"]=3,r[l[4]="TYPE_TERRAIN"]=4,r})(),i})(),c.MfeDomainFeaturesProto=(function(){function i(l){if(this.supportedFeatures=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.countryCode="",i.prototype.domainName="",i.prototype.supportedFeatures=u.emptyArray,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.MfeDomainFeaturesProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.countryCode=r.string();break}case 2:{o.domainName=r.string();break}case 3:{if(o.supportedFeatures&&o.supportedFeatures.length||(o.supportedFeatures=[]),(a&7)===2)for(var p=r.uint32()+r.pos;r.pos<p;)o.supportedFeatures.push(r.int32());else o.supportedFeatures.push(r.int32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("countryCode"))throw u.ProtocolError("missing required 'countryCode'",{instance:o});if(!o.hasOwnProperty("domainName"))throw u.ProtocolError("missing required 'domainName'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.countryCode))return"countryCode: string expected";if(!u.isString(r.domainName))return"domainName: string expected";if(r.supportedFeatures!=null&&r.hasOwnProperty("supportedFeatures")){if(!Array.isArray(r.supportedFeatures))return"supportedFeatures: array expected";for(var t=0;t<r.supportedFeatures.length;++t)switch(r.supportedFeatures[t]){default:return"supportedFeatures: enum value[] expected";case 0:case 1:case 2:break}}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.MfeDomainFeaturesProto)return r;var t=new n.keyhole.dbroot.MfeDomainFeaturesProto;if(r.countryCode!=null&&(t.countryCode=String(r.countryCode)),r.domainName!=null&&(t.domainName=String(r.domainName)),r.supportedFeatures){if(!Array.isArray(r.supportedFeatures))throw TypeError(".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected");t.supportedFeatures=[];for(var e=0;e<r.supportedFeatures.length;++e)switch(r.supportedFeatures[e]){default:case"GEOCODING":case 0:t.supportedFeatures[e]=0;break;case"LOCAL_SEARCH":case 1:t.supportedFeatures[e]=1;break;case"DRIVING_DIRECTIONS":case 2:t.supportedFeatures[e]=2;break}}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.supportedFeatures=[]),t.defaults&&(e.countryCode="",e.domainName=""),r.countryCode!=null&&r.hasOwnProperty("countryCode")&&(e.countryCode=r.countryCode),r.domainName!=null&&r.hasOwnProperty("domainName")&&(e.domainName=r.domainName),r.supportedFeatures&&r.supportedFeatures.length){e.supportedFeatures=[];for(var o=0;o<r.supportedFeatures.length;++o)e.supportedFeatures[o]=t.enums===String?n.keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature[r.supportedFeatures[o]]:r.supportedFeatures[o]}return e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.MfeDomainFeaturesProto"},i.SupportedFeature=(function(){var l={},r=Object.create(l);return r[l[0]="GEOCODING"]=0,r[l[1]="LOCAL_SEARCH"]=1,r[l[2]="DRIVING_DIRECTIONS"]=2,r})(),i})(),c.ClientOptionsProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.disableDiskCache=!1,i.prototype.disableEmbeddedBrowserVista=!1,i.prototype.drawAtmosphere=!0,i.prototype.drawStars=!0,i.prototype.shaderFilePrefix="",i.prototype.useProtobufQuadtreePackets=!1,i.prototype.useExtendedCopyrightIds=!0,i.prototype.precipitationsOptions=null,i.prototype.captureOptions=null,i.prototype.show_2dMapsIcon=!0,i.prototype.disableInternalBrowser=!1,i.prototype.internalBrowserBlacklist="",i.prototype.internalBrowserOriginWhitelist="*",i.prototype.polarTileMergingLevel=0,i.prototype.jsBridgeRequestWhitelist="http://*.google.com/*",i.prototype.mapsOptions=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ClientOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.disableDiskCache=r.bool();break}case 2:{o.disableEmbeddedBrowserVista=r.bool();break}case 3:{o.drawAtmosphere=r.bool();break}case 4:{o.drawStars=r.bool();break}case 5:{o.shaderFilePrefix=r.string();break}case 6:{o.useProtobufQuadtreePackets=r.bool();break}case 7:{o.useExtendedCopyrightIds=r.bool();break}case 8:{o.precipitationsOptions=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.decode(r,r.uint32());break}case 9:{o.captureOptions=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.decode(r,r.uint32());break}case 10:{o.show_2dMapsIcon=r.bool();break}case 11:{o.disableInternalBrowser=r.bool();break}case 12:{o.internalBrowserBlacklist=r.string();break}case 13:{o.internalBrowserOriginWhitelist=r.string();break}case 14:{o.polarTileMergingLevel=r.int32();break}case 15:{o.jsBridgeRequestWhitelist=r.string();break}case 16:{o.mapsOptions=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.decode(r,r.uint32());break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.disableDiskCache!=null&&r.hasOwnProperty("disableDiskCache")&&typeof r.disableDiskCache!="boolean")return"disableDiskCache: boolean expected";if(r.disableEmbeddedBrowserVista!=null&&r.hasOwnProperty("disableEmbeddedBrowserVista")&&typeof r.disableEmbeddedBrowserVista!="boolean")return"disableEmbeddedBrowserVista: boolean expected";if(r.drawAtmosphere!=null&&r.hasOwnProperty("drawAtmosphere")&&typeof r.drawAtmosphere!="boolean")return"drawAtmosphere: boolean expected";if(r.drawStars!=null&&r.hasOwnProperty("drawStars")&&typeof r.drawStars!="boolean")return"drawStars: boolean expected";if(r.shaderFilePrefix!=null&&r.hasOwnProperty("shaderFilePrefix")&&!u.isString(r.shaderFilePrefix))return"shaderFilePrefix: string expected";if(r.useProtobufQuadtreePackets!=null&&r.hasOwnProperty("useProtobufQuadtreePackets")&&typeof r.useProtobufQuadtreePackets!="boolean")return"useProtobufQuadtreePackets: boolean expected";if(r.useExtendedCopyrightIds!=null&&r.hasOwnProperty("useExtendedCopyrightIds")&&typeof r.useExtendedCopyrightIds!="boolean")return"useExtendedCopyrightIds: boolean expected";if(r.precipitationsOptions!=null&&r.hasOwnProperty("precipitationsOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.verify(r.precipitationsOptions);if(t)return"precipitationsOptions."+t}if(r.captureOptions!=null&&r.hasOwnProperty("captureOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.verify(r.captureOptions);if(t)return"captureOptions."+t}if(r.show_2dMapsIcon!=null&&r.hasOwnProperty("show_2dMapsIcon")&&typeof r.show_2dMapsIcon!="boolean")return"show_2dMapsIcon: boolean expected";if(r.disableInternalBrowser!=null&&r.hasOwnProperty("disableInternalBrowser")&&typeof r.disableInternalBrowser!="boolean")return"disableInternalBrowser: boolean expected";if(r.internalBrowserBlacklist!=null&&r.hasOwnProperty("internalBrowserBlacklist")&&!u.isString(r.internalBrowserBlacklist))return"internalBrowserBlacklist: string expected";if(r.internalBrowserOriginWhitelist!=null&&r.hasOwnProperty("internalBrowserOriginWhitelist")&&!u.isString(r.internalBrowserOriginWhitelist))return"internalBrowserOriginWhitelist: string expected";if(r.polarTileMergingLevel!=null&&r.hasOwnProperty("polarTileMergingLevel")&&!u.isInteger(r.polarTileMergingLevel))return"polarTileMergingLevel: integer expected";if(r.jsBridgeRequestWhitelist!=null&&r.hasOwnProperty("jsBridgeRequestWhitelist")&&!u.isString(r.jsBridgeRequestWhitelist))return"jsBridgeRequestWhitelist: string expected";if(r.mapsOptions!=null&&r.hasOwnProperty("mapsOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.verify(r.mapsOptions);if(t)return"mapsOptions."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ClientOptionsProto)return r;var t=new n.keyhole.dbroot.ClientOptionsProto;if(r.disableDiskCache!=null&&(t.disableDiskCache=!!r.disableDiskCache),r.disableEmbeddedBrowserVista!=null&&(t.disableEmbeddedBrowserVista=!!r.disableEmbeddedBrowserVista),r.drawAtmosphere!=null&&(t.drawAtmosphere=!!r.drawAtmosphere),r.drawStars!=null&&(t.drawStars=!!r.drawStars),r.shaderFilePrefix!=null&&(t.shaderFilePrefix=String(r.shaderFilePrefix)),r.useProtobufQuadtreePackets!=null&&(t.useProtobufQuadtreePackets=!!r.useProtobufQuadtreePackets),r.useExtendedCopyrightIds!=null&&(t.useExtendedCopyrightIds=!!r.useExtendedCopyrightIds),r.precipitationsOptions!=null){if(typeof r.precipitationsOptions!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected");t.precipitationsOptions=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.fromObject(r.precipitationsOptions)}if(r.captureOptions!=null){if(typeof r.captureOptions!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected");t.captureOptions=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.fromObject(r.captureOptions)}if(r.show_2dMapsIcon!=null&&(t.show_2dMapsIcon=!!r.show_2dMapsIcon),r.disableInternalBrowser!=null&&(t.disableInternalBrowser=!!r.disableInternalBrowser),r.internalBrowserBlacklist!=null&&(t.internalBrowserBlacklist=String(r.internalBrowserBlacklist)),r.internalBrowserOriginWhitelist!=null&&(t.internalBrowserOriginWhitelist=String(r.internalBrowserOriginWhitelist)),r.polarTileMergingLevel!=null&&(t.polarTileMergingLevel=r.polarTileMergingLevel|0),r.jsBridgeRequestWhitelist!=null&&(t.jsBridgeRequestWhitelist=String(r.jsBridgeRequestWhitelist)),r.mapsOptions!=null){if(typeof r.mapsOptions!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected");t.mapsOptions=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.fromObject(r.mapsOptions)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.disableDiskCache=!1,e.disableEmbeddedBrowserVista=!1,e.drawAtmosphere=!0,e.drawStars=!0,e.shaderFilePrefix="",e.useProtobufQuadtreePackets=!1,e.useExtendedCopyrightIds=!0,e.precipitationsOptions=null,e.captureOptions=null,e.show_2dMapsIcon=!0,e.disableInternalBrowser=!1,e.internalBrowserBlacklist="",e.internalBrowserOriginWhitelist="*",e.polarTileMergingLevel=0,e.jsBridgeRequestWhitelist="http://*.google.com/*",e.mapsOptions=null),r.disableDiskCache!=null&&r.hasOwnProperty("disableDiskCache")&&(e.disableDiskCache=r.disableDiskCache),r.disableEmbeddedBrowserVista!=null&&r.hasOwnProperty("disableEmbeddedBrowserVista")&&(e.disableEmbeddedBrowserVista=r.disableEmbeddedBrowserVista),r.drawAtmosphere!=null&&r.hasOwnProperty("drawAtmosphere")&&(e.drawAtmosphere=r.drawAtmosphere),r.drawStars!=null&&r.hasOwnProperty("drawStars")&&(e.drawStars=r.drawStars),r.shaderFilePrefix!=null&&r.hasOwnProperty("shaderFilePrefix")&&(e.shaderFilePrefix=r.shaderFilePrefix),r.useProtobufQuadtreePackets!=null&&r.hasOwnProperty("useProtobufQuadtreePackets")&&(e.useProtobufQuadtreePackets=r.useProtobufQuadtreePackets),r.useExtendedCopyrightIds!=null&&r.hasOwnProperty("useExtendedCopyrightIds")&&(e.useExtendedCopyrightIds=r.useExtendedCopyrightIds),r.precipitationsOptions!=null&&r.hasOwnProperty("precipitationsOptions")&&(e.precipitationsOptions=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.toObject(r.precipitationsOptions,t)),r.captureOptions!=null&&r.hasOwnProperty("captureOptions")&&(e.captureOptions=n.keyhole.dbroot.ClientOptionsProto.CaptureOptions.toObject(r.captureOptions,t)),r.show_2dMapsIcon!=null&&r.hasOwnProperty("show_2dMapsIcon")&&(e.show_2dMapsIcon=r.show_2dMapsIcon),r.disableInternalBrowser!=null&&r.hasOwnProperty("disableInternalBrowser")&&(e.disableInternalBrowser=r.disableInternalBrowser),r.internalBrowserBlacklist!=null&&r.hasOwnProperty("internalBrowserBlacklist")&&(e.internalBrowserBlacklist=r.internalBrowserBlacklist),r.internalBrowserOriginWhitelist!=null&&r.hasOwnProperty("internalBrowserOriginWhitelist")&&(e.internalBrowserOriginWhitelist=r.internalBrowserOriginWhitelist),r.polarTileMergingLevel!=null&&r.hasOwnProperty("polarTileMergingLevel")&&(e.polarTileMergingLevel=r.polarTileMergingLevel),r.jsBridgeRequestWhitelist!=null&&r.hasOwnProperty("jsBridgeRequestWhitelist")&&(e.jsBridgeRequestWhitelist=r.jsBridgeRequestWhitelist),r.mapsOptions!=null&&r.hasOwnProperty("mapsOptions")&&(e.mapsOptions=n.keyhole.dbroot.ClientOptionsProto.MapsOptions.toObject(r.mapsOptions,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ClientOptionsProto"},i.PrecipitationsOptions=(function(){function l(r){if(this.weatherMapping=[],r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.imageUrl="",l.prototype.imageExpireTime=900,l.prototype.maxColorDistance=20,l.prototype.imageLevel=5,l.prototype.weatherMapping=u.emptyArray,l.prototype.cloudsLayerUrl="",l.prototype.animationDecelerationDelay=20,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.imageUrl=t.string();break}case 2:{a.imageExpireTime=t.int32();break}case 3:{a.maxColorDistance=t.int32();break}case 4:{a.imageLevel=t.int32();break}case 5:{a.weatherMapping&&a.weatherMapping.length||(a.weatherMapping=[]),a.weatherMapping.push(n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.decode(t,t.uint32()));break}case 6:{a.cloudsLayerUrl=t.string();break}case 7:{a.animationDecelerationDelay=t.float();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.imageUrl!=null&&t.hasOwnProperty("imageUrl")&&!u.isString(t.imageUrl))return"imageUrl: string expected";if(t.imageExpireTime!=null&&t.hasOwnProperty("imageExpireTime")&&!u.isInteger(t.imageExpireTime))return"imageExpireTime: integer expected";if(t.maxColorDistance!=null&&t.hasOwnProperty("maxColorDistance")&&!u.isInteger(t.maxColorDistance))return"maxColorDistance: integer expected";if(t.imageLevel!=null&&t.hasOwnProperty("imageLevel")&&!u.isInteger(t.imageLevel))return"imageLevel: integer expected";if(t.weatherMapping!=null&&t.hasOwnProperty("weatherMapping")){if(!Array.isArray(t.weatherMapping))return"weatherMapping: array expected";for(var e=0;e<t.weatherMapping.length;++e){var o=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.verify(t.weatherMapping[e]);if(o)return"weatherMapping."+o}}return t.cloudsLayerUrl!=null&&t.hasOwnProperty("cloudsLayerUrl")&&!u.isString(t.cloudsLayerUrl)?"cloudsLayerUrl: string expected":t.animationDecelerationDelay!=null&&t.hasOwnProperty("animationDecelerationDelay")&&typeof t.animationDecelerationDelay!="number"?"animationDecelerationDelay: number expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions)return t;var e=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;if(t.imageUrl!=null&&(e.imageUrl=String(t.imageUrl)),t.imageExpireTime!=null&&(e.imageExpireTime=t.imageExpireTime|0),t.maxColorDistance!=null&&(e.maxColorDistance=t.maxColorDistance|0),t.imageLevel!=null&&(e.imageLevel=t.imageLevel|0),t.weatherMapping){if(!Array.isArray(t.weatherMapping))throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: array expected");e.weatherMapping=[];for(var o=0;o<t.weatherMapping.length;++o){if(typeof t.weatherMapping[o]!="object")throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: object expected");e.weatherMapping[o]=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.fromObject(t.weatherMapping[o])}}return t.cloudsLayerUrl!=null&&(e.cloudsLayerUrl=String(t.cloudsLayerUrl)),t.animationDecelerationDelay!=null&&(e.animationDecelerationDelay=Number(t.animationDecelerationDelay)),e},l.toObject=function(t,e){e||(e={});var o={};if((e.arrays||e.defaults)&&(o.weatherMapping=[]),e.defaults&&(o.imageUrl="",o.imageExpireTime=900,o.maxColorDistance=20,o.imageLevel=5,o.cloudsLayerUrl="",o.animationDecelerationDelay=20),t.imageUrl!=null&&t.hasOwnProperty("imageUrl")&&(o.imageUrl=t.imageUrl),t.imageExpireTime!=null&&t.hasOwnProperty("imageExpireTime")&&(o.imageExpireTime=t.imageExpireTime),t.maxColorDistance!=null&&t.hasOwnProperty("maxColorDistance")&&(o.maxColorDistance=t.maxColorDistance),t.imageLevel!=null&&t.hasOwnProperty("imageLevel")&&(o.imageLevel=t.imageLevel),t.weatherMapping&&t.weatherMapping.length){o.weatherMapping=[];for(var a=0;a<t.weatherMapping.length;++a)o.weatherMapping[a]=n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.toObject(t.weatherMapping[a],e)}return t.cloudsLayerUrl!=null&&t.hasOwnProperty("cloudsLayerUrl")&&(o.cloudsLayerUrl=t.cloudsLayerUrl),t.animationDecelerationDelay!=null&&t.hasOwnProperty("animationDecelerationDelay")&&(o.animationDecelerationDelay=e.json&&!isFinite(t.animationDecelerationDelay)?String(t.animationDecelerationDelay):t.animationDecelerationDelay),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions"},l.WeatherMapping=(function(){function r(t){if(t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.colorAbgr=0,r.prototype.weatherType=0,r.prototype.elongation=1,r.prototype.opacity=0,r.prototype.fogDensity=0,r.prototype.speed0=0,r.prototype.speed1=0,r.prototype.speed2=0,r.prototype.speed3=0,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.colorAbgr=e.uint32();break}case 2:{p.weatherType=e.int32();break}case 3:{p.elongation=e.float();break}case 4:{p.opacity=e.float();break}case 5:{p.fogDensity=e.float();break}case 6:{p.speed0=e.float();break}case 7:{p.speed1=e.float();break}case 8:{p.speed2=e.float();break}case 9:{p.speed3=e.float();break}default:e.skipType(y&7);break}}if(!p.hasOwnProperty("colorAbgr"))throw u.ProtocolError("missing required 'colorAbgr'",{instance:p});if(!p.hasOwnProperty("weatherType"))throw u.ProtocolError("missing required 'weatherType'",{instance:p});return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(!u.isInteger(e.colorAbgr))return"colorAbgr: integer expected";switch(e.weatherType){default:return"weatherType: enum value expected";case 0:case 1:case 2:break}return e.elongation!=null&&e.hasOwnProperty("elongation")&&typeof e.elongation!="number"?"elongation: number expected":e.opacity!=null&&e.hasOwnProperty("opacity")&&typeof e.opacity!="number"?"opacity: number expected":e.fogDensity!=null&&e.hasOwnProperty("fogDensity")&&typeof e.fogDensity!="number"?"fogDensity: number expected":e.speed0!=null&&e.hasOwnProperty("speed0")&&typeof e.speed0!="number"?"speed0: number expected":e.speed1!=null&&e.hasOwnProperty("speed1")&&typeof e.speed1!="number"?"speed1: number expected":e.speed2!=null&&e.hasOwnProperty("speed2")&&typeof e.speed2!="number"?"speed2: number expected":e.speed3!=null&&e.hasOwnProperty("speed3")&&typeof e.speed3!="number"?"speed3: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)return e;var o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;switch(e.colorAbgr!=null&&(o.colorAbgr=e.colorAbgr>>>0),e.weatherType){case"NO_PRECIPITATION":case 0:o.weatherType=0;break;case"RAIN":case 1:o.weatherType=1;break;case"SNOW":case 2:o.weatherType=2;break}return e.elongation!=null&&(o.elongation=Number(e.elongation)),e.opacity!=null&&(o.opacity=Number(e.opacity)),e.fogDensity!=null&&(o.fogDensity=Number(e.fogDensity)),e.speed0!=null&&(o.speed0=Number(e.speed0)),e.speed1!=null&&(o.speed1=Number(e.speed1)),e.speed2!=null&&(o.speed2=Number(e.speed2)),e.speed3!=null&&(o.speed3=Number(e.speed3)),o},r.toObject=function(e,o){o||(o={});var a={};return o.defaults&&(a.colorAbgr=0,a.weatherType=o.enums===String?"NO_PRECIPITATION":0,a.elongation=1,a.opacity=0,a.fogDensity=0,a.speed0=0,a.speed1=0,a.speed2=0,a.speed3=0),e.colorAbgr!=null&&e.hasOwnProperty("colorAbgr")&&(a.colorAbgr=e.colorAbgr),e.weatherType!=null&&e.hasOwnProperty("weatherType")&&(a.weatherType=o.enums===String?n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.WeatherType[e.weatherType]:e.weatherType),e.elongation!=null&&e.hasOwnProperty("elongation")&&(a.elongation=o.json&&!isFinite(e.elongation)?String(e.elongation):e.elongation),e.opacity!=null&&e.hasOwnProperty("opacity")&&(a.opacity=o.json&&!isFinite(e.opacity)?String(e.opacity):e.opacity),e.fogDensity!=null&&e.hasOwnProperty("fogDensity")&&(a.fogDensity=o.json&&!isFinite(e.fogDensity)?String(e.fogDensity):e.fogDensity),e.speed0!=null&&e.hasOwnProperty("speed0")&&(a.speed0=o.json&&!isFinite(e.speed0)?String(e.speed0):e.speed0),e.speed1!=null&&e.hasOwnProperty("speed1")&&(a.speed1=o.json&&!isFinite(e.speed1)?String(e.speed1):e.speed1),e.speed2!=null&&e.hasOwnProperty("speed2")&&(a.speed2=o.json&&!isFinite(e.speed2)?String(e.speed2):e.speed2),e.speed3!=null&&e.hasOwnProperty("speed3")&&(a.speed3=o.json&&!isFinite(e.speed3)?String(e.speed3):e.speed3),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping"},r.WeatherType=(function(){var t={},e=Object.create(t);return e[t[0]="NO_PRECIPITATION"]=0,e[t[1]="RAIN"]=1,e[t[2]="SNOW"]=2,e})(),r})(),l})(),i.CaptureOptions=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.allowSaveAsImage=!0,l.prototype.maxFreeCaptureRes=2400,l.prototype.maxPremiumCaptureRes=4800,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.allowSaveAsImage=t.bool();break}case 2:{a.maxFreeCaptureRes=t.int32();break}case 3:{a.maxPremiumCaptureRes=t.int32();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":t.allowSaveAsImage!=null&&t.hasOwnProperty("allowSaveAsImage")&&typeof t.allowSaveAsImage!="boolean"?"allowSaveAsImage: boolean expected":t.maxFreeCaptureRes!=null&&t.hasOwnProperty("maxFreeCaptureRes")&&!u.isInteger(t.maxFreeCaptureRes)?"maxFreeCaptureRes: integer expected":t.maxPremiumCaptureRes!=null&&t.hasOwnProperty("maxPremiumCaptureRes")&&!u.isInteger(t.maxPremiumCaptureRes)?"maxPremiumCaptureRes: integer expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.ClientOptionsProto.CaptureOptions)return t;var e=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;return t.allowSaveAsImage!=null&&(e.allowSaveAsImage=!!t.allowSaveAsImage),t.maxFreeCaptureRes!=null&&(e.maxFreeCaptureRes=t.maxFreeCaptureRes|0),t.maxPremiumCaptureRes!=null&&(e.maxPremiumCaptureRes=t.maxPremiumCaptureRes|0),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.allowSaveAsImage=!0,o.maxFreeCaptureRes=2400,o.maxPremiumCaptureRes=4800),t.allowSaveAsImage!=null&&t.hasOwnProperty("allowSaveAsImage")&&(o.allowSaveAsImage=t.allowSaveAsImage),t.maxFreeCaptureRes!=null&&t.hasOwnProperty("maxFreeCaptureRes")&&(o.maxFreeCaptureRes=t.maxFreeCaptureRes),t.maxPremiumCaptureRes!=null&&t.hasOwnProperty("maxPremiumCaptureRes")&&(o.maxPremiumCaptureRes=t.maxPremiumCaptureRes),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.ClientOptionsProto.CaptureOptions"},l})(),i.MapsOptions=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.enableMaps=!1,l.prototype.docsAutoDownloadEnabled=!1,l.prototype.docsAutoDownloadInterval=0,l.prototype.docsAutoUploadEnabled=!1,l.prototype.docsAutoUploadDelay=0,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.enableMaps=t.bool();break}case 2:{a.docsAutoDownloadEnabled=t.bool();break}case 3:{a.docsAutoDownloadInterval=t.int32();break}case 4:{a.docsAutoUploadEnabled=t.bool();break}case 5:{a.docsAutoUploadDelay=t.int32();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":t.enableMaps!=null&&t.hasOwnProperty("enableMaps")&&typeof t.enableMaps!="boolean"?"enableMaps: boolean expected":t.docsAutoDownloadEnabled!=null&&t.hasOwnProperty("docsAutoDownloadEnabled")&&typeof t.docsAutoDownloadEnabled!="boolean"?"docsAutoDownloadEnabled: boolean expected":t.docsAutoDownloadInterval!=null&&t.hasOwnProperty("docsAutoDownloadInterval")&&!u.isInteger(t.docsAutoDownloadInterval)?"docsAutoDownloadInterval: integer expected":t.docsAutoUploadEnabled!=null&&t.hasOwnProperty("docsAutoUploadEnabled")&&typeof t.docsAutoUploadEnabled!="boolean"?"docsAutoUploadEnabled: boolean expected":t.docsAutoUploadDelay!=null&&t.hasOwnProperty("docsAutoUploadDelay")&&!u.isInteger(t.docsAutoUploadDelay)?"docsAutoUploadDelay: integer expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.ClientOptionsProto.MapsOptions)return t;var e=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;return t.enableMaps!=null&&(e.enableMaps=!!t.enableMaps),t.docsAutoDownloadEnabled!=null&&(e.docsAutoDownloadEnabled=!!t.docsAutoDownloadEnabled),t.docsAutoDownloadInterval!=null&&(e.docsAutoDownloadInterval=t.docsAutoDownloadInterval|0),t.docsAutoUploadEnabled!=null&&(e.docsAutoUploadEnabled=!!t.docsAutoUploadEnabled),t.docsAutoUploadDelay!=null&&(e.docsAutoUploadDelay=t.docsAutoUploadDelay|0),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.enableMaps=!1,o.docsAutoDownloadEnabled=!1,o.docsAutoDownloadInterval=0,o.docsAutoUploadEnabled=!1,o.docsAutoUploadDelay=0),t.enableMaps!=null&&t.hasOwnProperty("enableMaps")&&(o.enableMaps=t.enableMaps),t.docsAutoDownloadEnabled!=null&&t.hasOwnProperty("docsAutoDownloadEnabled")&&(o.docsAutoDownloadEnabled=t.docsAutoDownloadEnabled),t.docsAutoDownloadInterval!=null&&t.hasOwnProperty("docsAutoDownloadInterval")&&(o.docsAutoDownloadInterval=t.docsAutoDownloadInterval),t.docsAutoUploadEnabled!=null&&t.hasOwnProperty("docsAutoUploadEnabled")&&(o.docsAutoUploadEnabled=t.docsAutoUploadEnabled),t.docsAutoUploadDelay!=null&&t.hasOwnProperty("docsAutoUploadDelay")&&(o.docsAutoUploadDelay=t.docsAutoUploadDelay),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.ClientOptionsProto.MapsOptions"},l})(),i})(),c.FetchingOptionsProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.maxRequestsPerQuery=1,i.prototype.forceMaxRequestsPerQuery=!1,i.prototype.sortBatches=!1,i.prototype.maxDrawable=2,i.prototype.maxImagery=2,i.prototype.maxTerrain=5,i.prototype.maxQuadtree=5,i.prototype.maxDioramaMetadata=1,i.prototype.maxDioramaData=0,i.prototype.maxConsumerFetchRatio=1,i.prototype.maxProEcFetchRatio=0,i.prototype.safeOverallQps=0,i.prototype.safeImageryQps=0,i.prototype.domainsForHttps="google.com gstatic.com",i.prototype.hostsForHttp="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.FetchingOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.maxRequestsPerQuery=r.int32();break}case 12:{o.forceMaxRequestsPerQuery=r.bool();break}case 13:{o.sortBatches=r.bool();break}case 2:{o.maxDrawable=r.int32();break}case 3:{o.maxImagery=r.int32();break}case 4:{o.maxTerrain=r.int32();break}case 5:{o.maxQuadtree=r.int32();break}case 6:{o.maxDioramaMetadata=r.int32();break}case 7:{o.maxDioramaData=r.int32();break}case 8:{o.maxConsumerFetchRatio=r.float();break}case 9:{o.maxProEcFetchRatio=r.float();break}case 10:{o.safeOverallQps=r.float();break}case 11:{o.safeImageryQps=r.float();break}case 14:{o.domainsForHttps=r.string();break}case 15:{o.hostsForHttp=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.maxRequestsPerQuery!=null&&r.hasOwnProperty("maxRequestsPerQuery")&&!u.isInteger(r.maxRequestsPerQuery)?"maxRequestsPerQuery: integer expected":r.forceMaxRequestsPerQuery!=null&&r.hasOwnProperty("forceMaxRequestsPerQuery")&&typeof r.forceMaxRequestsPerQuery!="boolean"?"forceMaxRequestsPerQuery: boolean expected":r.sortBatches!=null&&r.hasOwnProperty("sortBatches")&&typeof r.sortBatches!="boolean"?"sortBatches: boolean expected":r.maxDrawable!=null&&r.hasOwnProperty("maxDrawable")&&!u.isInteger(r.maxDrawable)?"maxDrawable: integer expected":r.maxImagery!=null&&r.hasOwnProperty("maxImagery")&&!u.isInteger(r.maxImagery)?"maxImagery: integer expected":r.maxTerrain!=null&&r.hasOwnProperty("maxTerrain")&&!u.isInteger(r.maxTerrain)?"maxTerrain: integer expected":r.maxQuadtree!=null&&r.hasOwnProperty("maxQuadtree")&&!u.isInteger(r.maxQuadtree)?"maxQuadtree: integer expected":r.maxDioramaMetadata!=null&&r.hasOwnProperty("maxDioramaMetadata")&&!u.isInteger(r.maxDioramaMetadata)?"maxDioramaMetadata: integer expected":r.maxDioramaData!=null&&r.hasOwnProperty("maxDioramaData")&&!u.isInteger(r.maxDioramaData)?"maxDioramaData: integer expected":r.maxConsumerFetchRatio!=null&&r.hasOwnProperty("maxConsumerFetchRatio")&&typeof r.maxConsumerFetchRatio!="number"?"maxConsumerFetchRatio: number expected":r.maxProEcFetchRatio!=null&&r.hasOwnProperty("maxProEcFetchRatio")&&typeof r.maxProEcFetchRatio!="number"?"maxProEcFetchRatio: number expected":r.safeOverallQps!=null&&r.hasOwnProperty("safeOverallQps")&&typeof r.safeOverallQps!="number"?"safeOverallQps: number expected":r.safeImageryQps!=null&&r.hasOwnProperty("safeImageryQps")&&typeof r.safeImageryQps!="number"?"safeImageryQps: number expected":r.domainsForHttps!=null&&r.hasOwnProperty("domainsForHttps")&&!u.isString(r.domainsForHttps)?"domainsForHttps: string expected":r.hostsForHttp!=null&&r.hasOwnProperty("hostsForHttp")&&!u.isString(r.hostsForHttp)?"hostsForHttp: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.FetchingOptionsProto)return r;var t=new n.keyhole.dbroot.FetchingOptionsProto;return r.maxRequestsPerQuery!=null&&(t.maxRequestsPerQuery=r.maxRequestsPerQuery|0),r.forceMaxRequestsPerQuery!=null&&(t.forceMaxRequestsPerQuery=!!r.forceMaxRequestsPerQuery),r.sortBatches!=null&&(t.sortBatches=!!r.sortBatches),r.maxDrawable!=null&&(t.maxDrawable=r.maxDrawable|0),r.maxImagery!=null&&(t.maxImagery=r.maxImagery|0),r.maxTerrain!=null&&(t.maxTerrain=r.maxTerrain|0),r.maxQuadtree!=null&&(t.maxQuadtree=r.maxQuadtree|0),r.maxDioramaMetadata!=null&&(t.maxDioramaMetadata=r.maxDioramaMetadata|0),r.maxDioramaData!=null&&(t.maxDioramaData=r.maxDioramaData|0),r.maxConsumerFetchRatio!=null&&(t.maxConsumerFetchRatio=Number(r.maxConsumerFetchRatio)),r.maxProEcFetchRatio!=null&&(t.maxProEcFetchRatio=Number(r.maxProEcFetchRatio)),r.safeOverallQps!=null&&(t.safeOverallQps=Number(r.safeOverallQps)),r.safeImageryQps!=null&&(t.safeImageryQps=Number(r.safeImageryQps)),r.domainsForHttps!=null&&(t.domainsForHttps=String(r.domainsForHttps)),r.hostsForHttp!=null&&(t.hostsForHttp=String(r.hostsForHttp)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.maxRequestsPerQuery=1,e.maxDrawable=2,e.maxImagery=2,e.maxTerrain=5,e.maxQuadtree=5,e.maxDioramaMetadata=1,e.maxDioramaData=0,e.maxConsumerFetchRatio=1,e.maxProEcFetchRatio=0,e.safeOverallQps=0,e.safeImageryQps=0,e.forceMaxRequestsPerQuery=!1,e.sortBatches=!1,e.domainsForHttps="google.com gstatic.com",e.hostsForHttp=""),r.maxRequestsPerQuery!=null&&r.hasOwnProperty("maxRequestsPerQuery")&&(e.maxRequestsPerQuery=r.maxRequestsPerQuery),r.maxDrawable!=null&&r.hasOwnProperty("maxDrawable")&&(e.maxDrawable=r.maxDrawable),r.maxImagery!=null&&r.hasOwnProperty("maxImagery")&&(e.maxImagery=r.maxImagery),r.maxTerrain!=null&&r.hasOwnProperty("maxTerrain")&&(e.maxTerrain=r.maxTerrain),r.maxQuadtree!=null&&r.hasOwnProperty("maxQuadtree")&&(e.maxQuadtree=r.maxQuadtree),r.maxDioramaMetadata!=null&&r.hasOwnProperty("maxDioramaMetadata")&&(e.maxDioramaMetadata=r.maxDioramaMetadata),r.maxDioramaData!=null&&r.hasOwnProperty("maxDioramaData")&&(e.maxDioramaData=r.maxDioramaData),r.maxConsumerFetchRatio!=null&&r.hasOwnProperty("maxConsumerFetchRatio")&&(e.maxConsumerFetchRatio=t.json&&!isFinite(r.maxConsumerFetchRatio)?String(r.maxConsumerFetchRatio):r.maxConsumerFetchRatio),r.maxProEcFetchRatio!=null&&r.hasOwnProperty("maxProEcFetchRatio")&&(e.maxProEcFetchRatio=t.json&&!isFinite(r.maxProEcFetchRatio)?String(r.maxProEcFetchRatio):r.maxProEcFetchRatio),r.safeOverallQps!=null&&r.hasOwnProperty("safeOverallQps")&&(e.safeOverallQps=t.json&&!isFinite(r.safeOverallQps)?String(r.safeOverallQps):r.safeOverallQps),r.safeImageryQps!=null&&r.hasOwnProperty("safeImageryQps")&&(e.safeImageryQps=t.json&&!isFinite(r.safeImageryQps)?String(r.safeImageryQps):r.safeImageryQps),r.forceMaxRequestsPerQuery!=null&&r.hasOwnProperty("forceMaxRequestsPerQuery")&&(e.forceMaxRequestsPerQuery=r.forceMaxRequestsPerQuery),r.sortBatches!=null&&r.hasOwnProperty("sortBatches")&&(e.sortBatches=r.sortBatches),r.domainsForHttps!=null&&r.hasOwnProperty("domainsForHttps")&&(e.domainsForHttps=r.domainsForHttps),r.hostsForHttp!=null&&r.hasOwnProperty("hostsForHttp")&&(e.hostsForHttp=r.hostsForHttp),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.FetchingOptionsProto"},i})(),c.TimeMachineOptionsProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.serverUrl="",i.prototype.isTimemachine=!1,i.prototype.dwellTimeMs=500,i.prototype.discoverabilityAltitudeMeters=15e3,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.TimeMachineOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.serverUrl=r.string();break}case 2:{o.isTimemachine=r.bool();break}case 3:{o.dwellTimeMs=r.int32();break}case 4:{o.discoverabilityAltitudeMeters=r.int32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.serverUrl!=null&&r.hasOwnProperty("serverUrl")&&!u.isString(r.serverUrl)?"serverUrl: string expected":r.isTimemachine!=null&&r.hasOwnProperty("isTimemachine")&&typeof r.isTimemachine!="boolean"?"isTimemachine: boolean expected":r.dwellTimeMs!=null&&r.hasOwnProperty("dwellTimeMs")&&!u.isInteger(r.dwellTimeMs)?"dwellTimeMs: integer expected":r.discoverabilityAltitudeMeters!=null&&r.hasOwnProperty("discoverabilityAltitudeMeters")&&!u.isInteger(r.discoverabilityAltitudeMeters)?"discoverabilityAltitudeMeters: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.TimeMachineOptionsProto)return r;var t=new n.keyhole.dbroot.TimeMachineOptionsProto;return r.serverUrl!=null&&(t.serverUrl=String(r.serverUrl)),r.isTimemachine!=null&&(t.isTimemachine=!!r.isTimemachine),r.dwellTimeMs!=null&&(t.dwellTimeMs=r.dwellTimeMs|0),r.discoverabilityAltitudeMeters!=null&&(t.discoverabilityAltitudeMeters=r.discoverabilityAltitudeMeters|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.serverUrl="",e.isTimemachine=!1,e.dwellTimeMs=500,e.discoverabilityAltitudeMeters=15e3),r.serverUrl!=null&&r.hasOwnProperty("serverUrl")&&(e.serverUrl=r.serverUrl),r.isTimemachine!=null&&r.hasOwnProperty("isTimemachine")&&(e.isTimemachine=r.isTimemachine),r.dwellTimeMs!=null&&r.hasOwnProperty("dwellTimeMs")&&(e.dwellTimeMs=r.dwellTimeMs),r.discoverabilityAltitudeMeters!=null&&r.hasOwnProperty("discoverabilityAltitudeMeters")&&(e.discoverabilityAltitudeMeters=r.discoverabilityAltitudeMeters),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.TimeMachineOptionsProto"},i})(),c.AutopiaOptionsProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.metadataServerUrl="http://cbk0.google.com/cbk",i.prototype.depthmapServerUrl="http://cbk0.google.com/cbk",i.prototype.coverageOverlayUrl="",i.prototype.maxImageryQps=0,i.prototype.maxMetadataDepthmapQps=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.AutopiaOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.metadataServerUrl=r.string();break}case 2:{o.depthmapServerUrl=r.string();break}case 3:{o.coverageOverlayUrl=r.string();break}case 4:{o.maxImageryQps=r.float();break}case 5:{o.maxMetadataDepthmapQps=r.float();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.metadataServerUrl!=null&&r.hasOwnProperty("metadataServerUrl")&&!u.isString(r.metadataServerUrl)?"metadataServerUrl: string expected":r.depthmapServerUrl!=null&&r.hasOwnProperty("depthmapServerUrl")&&!u.isString(r.depthmapServerUrl)?"depthmapServerUrl: string expected":r.coverageOverlayUrl!=null&&r.hasOwnProperty("coverageOverlayUrl")&&!u.isString(r.coverageOverlayUrl)?"coverageOverlayUrl: string expected":r.maxImageryQps!=null&&r.hasOwnProperty("maxImageryQps")&&typeof r.maxImageryQps!="number"?"maxImageryQps: number expected":r.maxMetadataDepthmapQps!=null&&r.hasOwnProperty("maxMetadataDepthmapQps")&&typeof r.maxMetadataDepthmapQps!="number"?"maxMetadataDepthmapQps: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.AutopiaOptionsProto)return r;var t=new n.keyhole.dbroot.AutopiaOptionsProto;return r.metadataServerUrl!=null&&(t.metadataServerUrl=String(r.metadataServerUrl)),r.depthmapServerUrl!=null&&(t.depthmapServerUrl=String(r.depthmapServerUrl)),r.coverageOverlayUrl!=null&&(t.coverageOverlayUrl=String(r.coverageOverlayUrl)),r.maxImageryQps!=null&&(t.maxImageryQps=Number(r.maxImageryQps)),r.maxMetadataDepthmapQps!=null&&(t.maxMetadataDepthmapQps=Number(r.maxMetadataDepthmapQps)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.metadataServerUrl="http://cbk0.google.com/cbk",e.depthmapServerUrl="http://cbk0.google.com/cbk",e.coverageOverlayUrl="",e.maxImageryQps=0,e.maxMetadataDepthmapQps=0),r.metadataServerUrl!=null&&r.hasOwnProperty("metadataServerUrl")&&(e.metadataServerUrl=r.metadataServerUrl),r.depthmapServerUrl!=null&&r.hasOwnProperty("depthmapServerUrl")&&(e.depthmapServerUrl=r.depthmapServerUrl),r.coverageOverlayUrl!=null&&r.hasOwnProperty("coverageOverlayUrl")&&(e.coverageOverlayUrl=r.coverageOverlayUrl),r.maxImageryQps!=null&&r.hasOwnProperty("maxImageryQps")&&(e.maxImageryQps=t.json&&!isFinite(r.maxImageryQps)?String(r.maxImageryQps):r.maxImageryQps),r.maxMetadataDepthmapQps!=null&&r.hasOwnProperty("maxMetadataDepthmapQps")&&(e.maxMetadataDepthmapQps=t.json&&!isFinite(r.maxMetadataDepthmapQps)?String(r.maxMetadataDepthmapQps):r.maxMetadataDepthmapQps),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.AutopiaOptionsProto"},i})(),c.CSIOptionsProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.samplingPercentage=0,i.prototype.experimentId="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.CSIOptionsProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.samplingPercentage=r.int32();break}case 2:{o.experimentId=r.string();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.samplingPercentage!=null&&r.hasOwnProperty("samplingPercentage")&&!u.isInteger(r.samplingPercentage)?"samplingPercentage: integer expected":r.experimentId!=null&&r.hasOwnProperty("experimentId")&&!u.isString(r.experimentId)?"experimentId: string expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.CSIOptionsProto)return r;var t=new n.keyhole.dbroot.CSIOptionsProto;return r.samplingPercentage!=null&&(t.samplingPercentage=r.samplingPercentage|0),r.experimentId!=null&&(t.experimentId=String(r.experimentId)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.samplingPercentage=0,e.experimentId=""),r.samplingPercentage!=null&&r.hasOwnProperty("samplingPercentage")&&(e.samplingPercentage=r.samplingPercentage),r.experimentId!=null&&r.hasOwnProperty("experimentId")&&(e.experimentId=r.experimentId),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.CSIOptionsProto"},i})(),c.SearchTabProto=(function(){function i(l){if(this.inputBox=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.isVisible=!1,i.prototype.tabLabel=null,i.prototype.baseUrl="",i.prototype.viewportPrefix="",i.prototype.inputBox=u.emptyArray,i.prototype.requirement=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.SearchTabProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.isVisible=r.bool();break}case 2:{o.tabLabel=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.baseUrl=r.string();break}case 4:{o.viewportPrefix=r.string();break}case 5:{o.inputBox&&o.inputBox.length||(o.inputBox=[]),o.inputBox.push(n.keyhole.dbroot.SearchTabProto.InputBoxInfo.decode(r,r.uint32()));break}case 6:{o.requirement=n.keyhole.dbroot.RequirementProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("isVisible"))throw u.ProtocolError("missing required 'isVisible'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(typeof r.isVisible!="boolean")return"isVisible: boolean expected";if(r.tabLabel!=null&&r.hasOwnProperty("tabLabel")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.tabLabel);if(t)return"tabLabel."+t}if(r.baseUrl!=null&&r.hasOwnProperty("baseUrl")&&!u.isString(r.baseUrl))return"baseUrl: string expected";if(r.viewportPrefix!=null&&r.hasOwnProperty("viewportPrefix")&&!u.isString(r.viewportPrefix))return"viewportPrefix: string expected";if(r.inputBox!=null&&r.hasOwnProperty("inputBox")){if(!Array.isArray(r.inputBox))return"inputBox: array expected";for(var e=0;e<r.inputBox.length;++e){var t=n.keyhole.dbroot.SearchTabProto.InputBoxInfo.verify(r.inputBox[e]);if(t)return"inputBox."+t}}if(r.requirement!=null&&r.hasOwnProperty("requirement")){var t=n.keyhole.dbroot.RequirementProto.verify(r.requirement);if(t)return"requirement."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.SearchTabProto)return r;var t=new n.keyhole.dbroot.SearchTabProto;if(r.isVisible!=null&&(t.isVisible=!!r.isVisible),r.tabLabel!=null){if(typeof r.tabLabel!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.tabLabel: object expected");t.tabLabel=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.tabLabel)}if(r.baseUrl!=null&&(t.baseUrl=String(r.baseUrl)),r.viewportPrefix!=null&&(t.viewportPrefix=String(r.viewportPrefix)),r.inputBox){if(!Array.isArray(r.inputBox))throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: array expected");t.inputBox=[];for(var e=0;e<r.inputBox.length;++e){if(typeof r.inputBox[e]!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: object expected");t.inputBox[e]=n.keyhole.dbroot.SearchTabProto.InputBoxInfo.fromObject(r.inputBox[e])}}if(r.requirement!=null){if(typeof r.requirement!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.requirement: object expected");t.requirement=n.keyhole.dbroot.RequirementProto.fromObject(r.requirement)}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.inputBox=[]),t.defaults&&(e.isVisible=!1,e.tabLabel=null,e.baseUrl="",e.viewportPrefix="",e.requirement=null),r.isVisible!=null&&r.hasOwnProperty("isVisible")&&(e.isVisible=r.isVisible),r.tabLabel!=null&&r.hasOwnProperty("tabLabel")&&(e.tabLabel=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.tabLabel,t)),r.baseUrl!=null&&r.hasOwnProperty("baseUrl")&&(e.baseUrl=r.baseUrl),r.viewportPrefix!=null&&r.hasOwnProperty("viewportPrefix")&&(e.viewportPrefix=r.viewportPrefix),r.inputBox&&r.inputBox.length){e.inputBox=[];for(var o=0;o<r.inputBox.length;++o)e.inputBox[o]=n.keyhole.dbroot.SearchTabProto.InputBoxInfo.toObject(r.inputBox[o],t)}return r.requirement!=null&&r.hasOwnProperty("requirement")&&(e.requirement=n.keyhole.dbroot.RequirementProto.toObject(r.requirement,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.SearchTabProto"},i.InputBoxInfo=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.label=null,l.prototype.queryVerb="",l.prototype.queryPrepend="",l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.label=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 2:{a.queryVerb=t.string();break}case 3:{a.queryPrepend=t.string();break}default:t.skipType(p&7);break}}if(!a.hasOwnProperty("label"))throw u.ProtocolError("missing required 'label'",{instance:a});if(!a.hasOwnProperty("queryVerb"))throw u.ProtocolError("missing required 'queryVerb'",{instance:a});return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.label);if(e)return"label."+e}return u.isString(t.queryVerb)?t.queryPrepend!=null&&t.hasOwnProperty("queryPrepend")&&!u.isString(t.queryPrepend)?"queryPrepend: string expected":null:"queryVerb: string expected"},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.SearchTabProto.InputBoxInfo)return t;var e=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;if(t.label!=null){if(typeof t.label!="object")throw TypeError(".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected");e.label=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.label)}return t.queryVerb!=null&&(e.queryVerb=String(t.queryVerb)),t.queryPrepend!=null&&(e.queryPrepend=String(t.queryPrepend)),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.label=null,o.queryVerb="",o.queryPrepend=""),t.label!=null&&t.hasOwnProperty("label")&&(o.label=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.label,e)),t.queryVerb!=null&&t.hasOwnProperty("queryVerb")&&(o.queryVerb=t.queryVerb),t.queryPrepend!=null&&t.hasOwnProperty("queryPrepend")&&(o.queryPrepend=t.queryPrepend),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.SearchTabProto.InputBoxInfo"},l})(),i})(),c.CobrandProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.logoUrl="",i.prototype.xCoord=null,i.prototype.yCoord=null,i.prototype.tiePoint=6,i.prototype.screenSize=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.CobrandProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.logoUrl=r.string();break}case 2:{o.xCoord=n.keyhole.dbroot.CobrandProto.Coord.decode(r,r.uint32());break}case 3:{o.yCoord=n.keyhole.dbroot.CobrandProto.Coord.decode(r,r.uint32());break}case 4:{o.tiePoint=r.int32();break}case 5:{o.screenSize=r.double();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("logoUrl"))throw u.ProtocolError("missing required 'logoUrl'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.logoUrl))return"logoUrl: string expected";if(r.xCoord!=null&&r.hasOwnProperty("xCoord")){var t=n.keyhole.dbroot.CobrandProto.Coord.verify(r.xCoord);if(t)return"xCoord."+t}if(r.yCoord!=null&&r.hasOwnProperty("yCoord")){var t=n.keyhole.dbroot.CobrandProto.Coord.verify(r.yCoord);if(t)return"yCoord."+t}if(r.tiePoint!=null&&r.hasOwnProperty("tiePoint"))switch(r.tiePoint){default:return"tiePoint: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return r.screenSize!=null&&r.hasOwnProperty("screenSize")&&typeof r.screenSize!="number"?"screenSize: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.CobrandProto)return r;var t=new n.keyhole.dbroot.CobrandProto;if(r.logoUrl!=null&&(t.logoUrl=String(r.logoUrl)),r.xCoord!=null){if(typeof r.xCoord!="object")throw TypeError(".keyhole.dbroot.CobrandProto.xCoord: object expected");t.xCoord=n.keyhole.dbroot.CobrandProto.Coord.fromObject(r.xCoord)}if(r.yCoord!=null){if(typeof r.yCoord!="object")throw TypeError(".keyhole.dbroot.CobrandProto.yCoord: object expected");t.yCoord=n.keyhole.dbroot.CobrandProto.Coord.fromObject(r.yCoord)}switch(r.tiePoint){case"TOP_LEFT":case 0:t.tiePoint=0;break;case"TOP_CENTER":case 1:t.tiePoint=1;break;case"TOP_RIGHT":case 2:t.tiePoint=2;break;case"MID_LEFT":case 3:t.tiePoint=3;break;case"MID_CENTER":case 4:t.tiePoint=4;break;case"MID_RIGHT":case 5:t.tiePoint=5;break;case"BOTTOM_LEFT":case 6:t.tiePoint=6;break;case"BOTTOM_CENTER":case 7:t.tiePoint=7;break;case"BOTTOM_RIGHT":case 8:t.tiePoint=8;break}return r.screenSize!=null&&(t.screenSize=Number(r.screenSize)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.logoUrl="",e.xCoord=null,e.yCoord=null,e.tiePoint=t.enums===String?"BOTTOM_LEFT":6,e.screenSize=0),r.logoUrl!=null&&r.hasOwnProperty("logoUrl")&&(e.logoUrl=r.logoUrl),r.xCoord!=null&&r.hasOwnProperty("xCoord")&&(e.xCoord=n.keyhole.dbroot.CobrandProto.Coord.toObject(r.xCoord,t)),r.yCoord!=null&&r.hasOwnProperty("yCoord")&&(e.yCoord=n.keyhole.dbroot.CobrandProto.Coord.toObject(r.yCoord,t)),r.tiePoint!=null&&r.hasOwnProperty("tiePoint")&&(e.tiePoint=t.enums===String?n.keyhole.dbroot.CobrandProto.TiePoint[r.tiePoint]:r.tiePoint),r.screenSize!=null&&r.hasOwnProperty("screenSize")&&(e.screenSize=t.json&&!isFinite(r.screenSize)?String(r.screenSize):r.screenSize),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.CobrandProto"},i.Coord=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.value=0,l.prototype.isRelative=!1,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.CobrandProto.Coord;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.value=t.double();break}case 2:{a.isRelative=t.bool();break}default:t.skipType(p&7);break}}if(!a.hasOwnProperty("value"))throw u.ProtocolError("missing required 'value'",{instance:a});return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":typeof t.value!="number"?"value: number expected":t.isRelative!=null&&t.hasOwnProperty("isRelative")&&typeof t.isRelative!="boolean"?"isRelative: boolean expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.CobrandProto.Coord)return t;var e=new n.keyhole.dbroot.CobrandProto.Coord;return t.value!=null&&(e.value=Number(t.value)),t.isRelative!=null&&(e.isRelative=!!t.isRelative),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.value=0,o.isRelative=!1),t.value!=null&&t.hasOwnProperty("value")&&(o.value=e.json&&!isFinite(t.value)?String(t.value):t.value),t.isRelative!=null&&t.hasOwnProperty("isRelative")&&(o.isRelative=t.isRelative),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.CobrandProto.Coord"},l})(),i.TiePoint=(function(){var l={},r=Object.create(l);return r[l[0]="TOP_LEFT"]=0,r[l[1]="TOP_CENTER"]=1,r[l[2]="TOP_RIGHT"]=2,r[l[3]="MID_LEFT"]=3,r[l[4]="MID_CENTER"]=4,r[l[5]="MID_RIGHT"]=5,r[l[6]="BOTTOM_LEFT"]=6,r[l[7]="BOTTOM_CENTER"]=7,r[l[8]="BOTTOM_RIGHT"]=8,r})(),i})(),c.DatabaseDescriptionProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.databaseName=null,i.prototype.databaseUrl="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DatabaseDescriptionProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.databaseName=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.databaseUrl=r.string();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("databaseUrl"))throw u.ProtocolError("missing required 'databaseUrl'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.databaseName!=null&&r.hasOwnProperty("databaseName")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.databaseName);if(t)return"databaseName."+t}return u.isString(r.databaseUrl)?null:"databaseUrl: string expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DatabaseDescriptionProto)return r;var t=new n.keyhole.dbroot.DatabaseDescriptionProto;if(r.databaseName!=null){if(typeof r.databaseName!="object")throw TypeError(".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected");t.databaseName=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.databaseName)}return r.databaseUrl!=null&&(t.databaseUrl=String(r.databaseUrl)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.databaseName=null,e.databaseUrl=""),r.databaseName!=null&&r.hasOwnProperty("databaseName")&&(e.databaseName=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.databaseName,t)),r.databaseUrl!=null&&r.hasOwnProperty("databaseUrl")&&(e.databaseUrl=r.databaseUrl),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DatabaseDescriptionProto"},i})(),c.ConfigScriptProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.scriptName="",i.prototype.scriptData="",i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.ConfigScriptProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.scriptName=r.string();break}case 2:{o.scriptData=r.string();break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("scriptName"))throw u.ProtocolError("missing required 'scriptName'",{instance:o});if(!o.hasOwnProperty("scriptData"))throw u.ProtocolError("missing required 'scriptData'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isString(r.scriptName)?u.isString(r.scriptData)?null:"scriptData: string expected":"scriptName: string expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.ConfigScriptProto)return r;var t=new n.keyhole.dbroot.ConfigScriptProto;return r.scriptName!=null&&(t.scriptName=String(r.scriptName)),r.scriptData!=null&&(t.scriptData=String(r.scriptData)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.scriptName="",e.scriptData=""),r.scriptName!=null&&r.hasOwnProperty("scriptName")&&(e.scriptName=r.scriptName),r.scriptData!=null&&r.hasOwnProperty("scriptData")&&(e.scriptData=r.scriptData),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.ConfigScriptProto"},i})(),c.SwoopParamsProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.startDistInMeters=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.SwoopParamsProto;r.pos<e;){var a=r.uint32();a>>>3===1?o.startDistInMeters=r.double():r.skipType(a&7)}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.startDistInMeters!=null&&r.hasOwnProperty("startDistInMeters")&&typeof r.startDistInMeters!="number"?"startDistInMeters: number expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.SwoopParamsProto)return r;var t=new n.keyhole.dbroot.SwoopParamsProto;return r.startDistInMeters!=null&&(t.startDistInMeters=Number(r.startDistInMeters)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.startDistInMeters=0),r.startDistInMeters!=null&&r.hasOwnProperty("startDistInMeters")&&(e.startDistInMeters=t.json&&!isFinite(r.startDistInMeters)?String(r.startDistInMeters):r.startDistInMeters),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.SwoopParamsProto"},i})(),c.PostingServerProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.name=null,i.prototype.baseUrl=null,i.prototype.postWizardPath=null,i.prototype.fileSubmitPath=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PostingServerProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.name=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.baseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.postWizardPath=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 4:{o.fileSubmitPath=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.name!=null&&r.hasOwnProperty("name")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.name);if(t)return"name."+t}if(r.baseUrl!=null&&r.hasOwnProperty("baseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.baseUrl);if(t)return"baseUrl."+t}if(r.postWizardPath!=null&&r.hasOwnProperty("postWizardPath")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.postWizardPath);if(t)return"postWizardPath."+t}if(r.fileSubmitPath!=null&&r.hasOwnProperty("fileSubmitPath")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.fileSubmitPath);if(t)return"fileSubmitPath."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PostingServerProto)return r;var t=new n.keyhole.dbroot.PostingServerProto;if(r.name!=null){if(typeof r.name!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.name: object expected");t.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.name)}if(r.baseUrl!=null){if(typeof r.baseUrl!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.baseUrl: object expected");t.baseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.baseUrl)}if(r.postWizardPath!=null){if(typeof r.postWizardPath!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.postWizardPath: object expected");t.postWizardPath=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.postWizardPath)}if(r.fileSubmitPath!=null){if(typeof r.fileSubmitPath!="object")throw TypeError(".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected");t.fileSubmitPath=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.fileSubmitPath)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.name=null,e.baseUrl=null,e.postWizardPath=null,e.fileSubmitPath=null),r.name!=null&&r.hasOwnProperty("name")&&(e.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.name,t)),r.baseUrl!=null&&r.hasOwnProperty("baseUrl")&&(e.baseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.baseUrl,t)),r.postWizardPath!=null&&r.hasOwnProperty("postWizardPath")&&(e.postWizardPath=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.postWizardPath,t)),r.fileSubmitPath!=null&&r.hasOwnProperty("fileSubmitPath")&&(e.fileSubmitPath=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.fileSubmitPath,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PostingServerProto"},i})(),c.PlanetaryDatabaseProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.url=null,i.prototype.name=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.PlanetaryDatabaseProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.url=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.name=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("url"))throw u.ProtocolError("missing required 'url'",{instance:o});if(!o.hasOwnProperty("name"))throw u.ProtocolError("missing required 'name'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";{var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.url);if(t)return"url."+t}{var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.name);if(t)return"name."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.PlanetaryDatabaseProto)return r;var t=new n.keyhole.dbroot.PlanetaryDatabaseProto;if(r.url!=null){if(typeof r.url!="object")throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected");t.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.url)}if(r.name!=null){if(typeof r.name!="object")throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected");t.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.name)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.url=null,e.name=null),r.url!=null&&r.hasOwnProperty("url")&&(e.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.url,t)),r.name!=null&&r.hasOwnProperty("name")&&(e.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.name,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.PlanetaryDatabaseProto"},i})(),c.LogServerProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.url=null,i.prototype.enable=!1,i.prototype.throttlingFactor=1,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.LogServerProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.url=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 2:{o.enable=r.bool();break}case 3:{o.throttlingFactor=r.int32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.url!=null&&r.hasOwnProperty("url")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.url);if(t)return"url."+t}return r.enable!=null&&r.hasOwnProperty("enable")&&typeof r.enable!="boolean"?"enable: boolean expected":r.throttlingFactor!=null&&r.hasOwnProperty("throttlingFactor")&&!u.isInteger(r.throttlingFactor)?"throttlingFactor: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.LogServerProto)return r;var t=new n.keyhole.dbroot.LogServerProto;if(r.url!=null){if(typeof r.url!="object")throw TypeError(".keyhole.dbroot.LogServerProto.url: object expected");t.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.url)}return r.enable!=null&&(t.enable=!!r.enable),r.throttlingFactor!=null&&(t.throttlingFactor=r.throttlingFactor|0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.url=null,e.enable=!1,e.throttlingFactor=1),r.url!=null&&r.hasOwnProperty("url")&&(e.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.url,t)),r.enable!=null&&r.hasOwnProperty("enable")&&(e.enable=r.enable),r.throttlingFactor!=null&&r.hasOwnProperty("throttlingFactor")&&(e.throttlingFactor=r.throttlingFactor),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.LogServerProto"},i})(),c.EndSnippetProto=(function(){function i(l){if(this.mfeDomains=[],this.searchTab=[],this.cobrandInfo=[],this.validDatabase=[],this.configScript=[],this.planetaryDatabase=[],this.filmstripConfig=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.model=null,i.prototype.authServerUrl=null,i.prototype.disableAuthentication=!1,i.prototype.mfeDomains=u.emptyArray,i.prototype.mfeLangParam="hl=$5Bhl5D",i.prototype.adsUrlPatterns="",i.prototype.reverseGeocoderUrl=null,i.prototype.reverseGeocoderProtocolVersion=3,i.prototype.skyDatabaseIsAvailable=!0,i.prototype.skyDatabaseUrl=null,i.prototype.defaultWebPageIntlUrl=null,i.prototype.numStartUpTips=17,i.prototype.startUpTipsUrl=null,i.prototype.numProStartUpTips=0,i.prototype.proStartUpTipsUrl=null,i.prototype.startupTipsIntlUrl=null,i.prototype.userGuideIntlUrl=null,i.prototype.supportCenterIntlUrl=null,i.prototype.businessListingIntlUrl=null,i.prototype.supportAnswerIntlUrl=null,i.prototype.supportTopicIntlUrl=null,i.prototype.supportRequestIntlUrl=null,i.prototype.earthIntlUrl=null,i.prototype.addContentUrl=null,i.prototype.sketchupNotInstalledUrl=null,i.prototype.sketchupErrorUrl=null,i.prototype.freeLicenseUrl=null,i.prototype.proLicenseUrl=null,i.prototype.tutorialUrl=null,i.prototype.keyboardShortcutsUrl=null,i.prototype.releaseNotesUrl=null,i.prototype.hideUserData=!1,i.prototype.useGeLogo=!0,i.prototype.dioramaDescriptionUrlBase=null,i.prototype.dioramaDefaultColor=4291281607,i.prototype.dioramaBlacklistUrl=null,i.prototype.clientOptions=null,i.prototype.fetchingOptions=null,i.prototype.timeMachineOptions=null,i.prototype.csiOptions=null,i.prototype.searchTab=u.emptyArray,i.prototype.cobrandInfo=u.emptyArray,i.prototype.validDatabase=u.emptyArray,i.prototype.configScript=u.emptyArray,i.prototype.deauthServerUrl=null,i.prototype.swoopParameters=null,i.prototype.bbsServerInfo=null,i.prototype.dataErrorServerInfo=null,i.prototype.planetaryDatabase=u.emptyArray,i.prototype.logServer=null,i.prototype.autopiaOptions=null,i.prototype.searchConfig=null,i.prototype.searchInfo=null,i.prototype.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",i.prototype.elevationProfileQueryDelay=500,i.prototype.proUpgradeUrl=null,i.prototype.earthCommunityUrl=null,i.prototype.googleMapsUrl=null,i.prototype.sharingUrl=null,i.prototype.privacyPolicyUrl=null,i.prototype.doGplusUserCheck=!1,i.prototype.rocktreeDataProto=null,i.prototype.filmstripConfig=u.emptyArray,i.prototype.showSigninButton=!1,i.prototype.proMeasureUpsellUrl=null,i.prototype.proPrintUpsellUrl=null,i.prototype.starDataProto=null,i.prototype.feedbackUrl=null,i.prototype.oauth2LoginUrl=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.EndSnippetProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.model=n.keyhole.dbroot.PlanetModelProto.decode(r,r.uint32());break}case 2:{o.authServerUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 3:{o.disableAuthentication=r.bool();break}case 4:{o.mfeDomains&&o.mfeDomains.length||(o.mfeDomains=[]),o.mfeDomains.push(n.keyhole.dbroot.MfeDomainFeaturesProto.decode(r,r.uint32()));break}case 5:{o.mfeLangParam=r.string();break}case 6:{o.adsUrlPatterns=r.string();break}case 7:{o.reverseGeocoderUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 8:{o.reverseGeocoderProtocolVersion=r.int32();break}case 9:{o.skyDatabaseIsAvailable=r.bool();break}case 10:{o.skyDatabaseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 11:{o.defaultWebPageIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 12:{o.numStartUpTips=r.int32();break}case 13:{o.startUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 51:{o.numProStartUpTips=r.int32();break}case 52:{o.proStartUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 64:{o.startupTipsIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 14:{o.userGuideIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 15:{o.supportCenterIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 16:{o.businessListingIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 17:{o.supportAnswerIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 18:{o.supportTopicIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 19:{o.supportRequestIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 20:{o.earthIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 21:{o.addContentUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 22:{o.sketchupNotInstalledUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 23:{o.sketchupErrorUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 24:{o.freeLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 25:{o.proLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 48:{o.tutorialUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 49:{o.keyboardShortcutsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 50:{o.releaseNotesUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 26:{o.hideUserData=r.bool();break}case 27:{o.useGeLogo=r.bool();break}case 28:{o.dioramaDescriptionUrlBase=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 29:{o.dioramaDefaultColor=r.uint32();break}case 53:{o.dioramaBlacklistUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 30:{o.clientOptions=n.keyhole.dbroot.ClientOptionsProto.decode(r,r.uint32());break}case 31:{o.fetchingOptions=n.keyhole.dbroot.FetchingOptionsProto.decode(r,r.uint32());break}case 32:{o.timeMachineOptions=n.keyhole.dbroot.TimeMachineOptionsProto.decode(r,r.uint32());break}case 33:{o.csiOptions=n.keyhole.dbroot.CSIOptionsProto.decode(r,r.uint32());break}case 34:{o.searchTab&&o.searchTab.length||(o.searchTab=[]),o.searchTab.push(n.keyhole.dbroot.SearchTabProto.decode(r,r.uint32()));break}case 35:{o.cobrandInfo&&o.cobrandInfo.length||(o.cobrandInfo=[]),o.cobrandInfo.push(n.keyhole.dbroot.CobrandProto.decode(r,r.uint32()));break}case 36:{o.validDatabase&&o.validDatabase.length||(o.validDatabase=[]),o.validDatabase.push(n.keyhole.dbroot.DatabaseDescriptionProto.decode(r,r.uint32()));break}case 37:{o.configScript&&o.configScript.length||(o.configScript=[]),o.configScript.push(n.keyhole.dbroot.ConfigScriptProto.decode(r,r.uint32()));break}case 38:{o.deauthServerUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 39:{o.swoopParameters=n.keyhole.dbroot.SwoopParamsProto.decode(r,r.uint32());break}case 40:{o.bbsServerInfo=n.keyhole.dbroot.PostingServerProto.decode(r,r.uint32());break}case 41:{o.dataErrorServerInfo=n.keyhole.dbroot.PostingServerProto.decode(r,r.uint32());break}case 42:{o.planetaryDatabase&&o.planetaryDatabase.length||(o.planetaryDatabase=[]),o.planetaryDatabase.push(n.keyhole.dbroot.PlanetaryDatabaseProto.decode(r,r.uint32()));break}case 43:{o.logServer=n.keyhole.dbroot.LogServerProto.decode(r,r.uint32());break}case 44:{o.autopiaOptions=n.keyhole.dbroot.AutopiaOptionsProto.decode(r,r.uint32());break}case 54:{o.searchConfig=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.decode(r,r.uint32());break}case 45:{o.searchInfo=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.decode(r,r.uint32());break}case 46:{o.elevationServiceBaseUrl=r.string();break}case 47:{o.elevationProfileQueryDelay=r.int32();break}case 55:{o.proUpgradeUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 56:{o.earthCommunityUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 57:{o.googleMapsUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 58:{o.sharingUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 59:{o.privacyPolicyUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 60:{o.doGplusUserCheck=r.bool();break}case 61:{o.rocktreeDataProto=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.decode(r,r.uint32());break}case 62:{o.filmstripConfig&&o.filmstripConfig.length||(o.filmstripConfig=[]),o.filmstripConfig.push(n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.decode(r,r.uint32()));break}case 63:{o.showSigninButton=r.bool();break}case 65:{o.proMeasureUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 66:{o.proPrintUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 67:{o.starDataProto=n.keyhole.dbroot.EndSnippetProto.StarDataProto.decode(r,r.uint32());break}case 68:{o.feedbackUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 69:{o.oauth2LoginUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.model!=null&&r.hasOwnProperty("model")){var t=n.keyhole.dbroot.PlanetModelProto.verify(r.model);if(t)return"model."+t}if(r.authServerUrl!=null&&r.hasOwnProperty("authServerUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.authServerUrl);if(t)return"authServerUrl."+t}if(r.disableAuthentication!=null&&r.hasOwnProperty("disableAuthentication")&&typeof r.disableAuthentication!="boolean")return"disableAuthentication: boolean expected";if(r.mfeDomains!=null&&r.hasOwnProperty("mfeDomains")){if(!Array.isArray(r.mfeDomains))return"mfeDomains: array expected";for(var e=0;e<r.mfeDomains.length;++e){var t=n.keyhole.dbroot.MfeDomainFeaturesProto.verify(r.mfeDomains[e]);if(t)return"mfeDomains."+t}}if(r.mfeLangParam!=null&&r.hasOwnProperty("mfeLangParam")&&!u.isString(r.mfeLangParam))return"mfeLangParam: string expected";if(r.adsUrlPatterns!=null&&r.hasOwnProperty("adsUrlPatterns")&&!u.isString(r.adsUrlPatterns))return"adsUrlPatterns: string expected";if(r.reverseGeocoderUrl!=null&&r.hasOwnProperty("reverseGeocoderUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.reverseGeocoderUrl);if(t)return"reverseGeocoderUrl."+t}if(r.reverseGeocoderProtocolVersion!=null&&r.hasOwnProperty("reverseGeocoderProtocolVersion")&&!u.isInteger(r.reverseGeocoderProtocolVersion))return"reverseGeocoderProtocolVersion: integer expected";if(r.skyDatabaseIsAvailable!=null&&r.hasOwnProperty("skyDatabaseIsAvailable")&&typeof r.skyDatabaseIsAvailable!="boolean")return"skyDatabaseIsAvailable: boolean expected";if(r.skyDatabaseUrl!=null&&r.hasOwnProperty("skyDatabaseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.skyDatabaseUrl);if(t)return"skyDatabaseUrl."+t}if(r.defaultWebPageIntlUrl!=null&&r.hasOwnProperty("defaultWebPageIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.defaultWebPageIntlUrl);if(t)return"defaultWebPageIntlUrl."+t}if(r.numStartUpTips!=null&&r.hasOwnProperty("numStartUpTips")&&!u.isInteger(r.numStartUpTips))return"numStartUpTips: integer expected";if(r.startUpTipsUrl!=null&&r.hasOwnProperty("startUpTipsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.startUpTipsUrl);if(t)return"startUpTipsUrl."+t}if(r.numProStartUpTips!=null&&r.hasOwnProperty("numProStartUpTips")&&!u.isInteger(r.numProStartUpTips))return"numProStartUpTips: integer expected";if(r.proStartUpTipsUrl!=null&&r.hasOwnProperty("proStartUpTipsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proStartUpTipsUrl);if(t)return"proStartUpTipsUrl."+t}if(r.startupTipsIntlUrl!=null&&r.hasOwnProperty("startupTipsIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.startupTipsIntlUrl);if(t)return"startupTipsIntlUrl."+t}if(r.userGuideIntlUrl!=null&&r.hasOwnProperty("userGuideIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.userGuideIntlUrl);if(t)return"userGuideIntlUrl."+t}if(r.supportCenterIntlUrl!=null&&r.hasOwnProperty("supportCenterIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportCenterIntlUrl);if(t)return"supportCenterIntlUrl."+t}if(r.businessListingIntlUrl!=null&&r.hasOwnProperty("businessListingIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.businessListingIntlUrl);if(t)return"businessListingIntlUrl."+t}if(r.supportAnswerIntlUrl!=null&&r.hasOwnProperty("supportAnswerIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportAnswerIntlUrl);if(t)return"supportAnswerIntlUrl."+t}if(r.supportTopicIntlUrl!=null&&r.hasOwnProperty("supportTopicIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportTopicIntlUrl);if(t)return"supportTopicIntlUrl."+t}if(r.supportRequestIntlUrl!=null&&r.hasOwnProperty("supportRequestIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.supportRequestIntlUrl);if(t)return"supportRequestIntlUrl."+t}if(r.earthIntlUrl!=null&&r.hasOwnProperty("earthIntlUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.earthIntlUrl);if(t)return"earthIntlUrl."+t}if(r.addContentUrl!=null&&r.hasOwnProperty("addContentUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.addContentUrl);if(t)return"addContentUrl."+t}if(r.sketchupNotInstalledUrl!=null&&r.hasOwnProperty("sketchupNotInstalledUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.sketchupNotInstalledUrl);if(t)return"sketchupNotInstalledUrl."+t}if(r.sketchupErrorUrl!=null&&r.hasOwnProperty("sketchupErrorUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.sketchupErrorUrl);if(t)return"sketchupErrorUrl."+t}if(r.freeLicenseUrl!=null&&r.hasOwnProperty("freeLicenseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.freeLicenseUrl);if(t)return"freeLicenseUrl."+t}if(r.proLicenseUrl!=null&&r.hasOwnProperty("proLicenseUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proLicenseUrl);if(t)return"proLicenseUrl."+t}if(r.tutorialUrl!=null&&r.hasOwnProperty("tutorialUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.tutorialUrl);if(t)return"tutorialUrl."+t}if(r.keyboardShortcutsUrl!=null&&r.hasOwnProperty("keyboardShortcutsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.keyboardShortcutsUrl);if(t)return"keyboardShortcutsUrl."+t}if(r.releaseNotesUrl!=null&&r.hasOwnProperty("releaseNotesUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.releaseNotesUrl);if(t)return"releaseNotesUrl."+t}if(r.hideUserData!=null&&r.hasOwnProperty("hideUserData")&&typeof r.hideUserData!="boolean")return"hideUserData: boolean expected";if(r.useGeLogo!=null&&r.hasOwnProperty("useGeLogo")&&typeof r.useGeLogo!="boolean")return"useGeLogo: boolean expected";if(r.dioramaDescriptionUrlBase!=null&&r.hasOwnProperty("dioramaDescriptionUrlBase")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.dioramaDescriptionUrlBase);if(t)return"dioramaDescriptionUrlBase."+t}if(r.dioramaDefaultColor!=null&&r.hasOwnProperty("dioramaDefaultColor")&&!u.isInteger(r.dioramaDefaultColor))return"dioramaDefaultColor: integer expected";if(r.dioramaBlacklistUrl!=null&&r.hasOwnProperty("dioramaBlacklistUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.dioramaBlacklistUrl);if(t)return"dioramaBlacklistUrl."+t}if(r.clientOptions!=null&&r.hasOwnProperty("clientOptions")){var t=n.keyhole.dbroot.ClientOptionsProto.verify(r.clientOptions);if(t)return"clientOptions."+t}if(r.fetchingOptions!=null&&r.hasOwnProperty("fetchingOptions")){var t=n.keyhole.dbroot.FetchingOptionsProto.verify(r.fetchingOptions);if(t)return"fetchingOptions."+t}if(r.timeMachineOptions!=null&&r.hasOwnProperty("timeMachineOptions")){var t=n.keyhole.dbroot.TimeMachineOptionsProto.verify(r.timeMachineOptions);if(t)return"timeMachineOptions."+t}if(r.csiOptions!=null&&r.hasOwnProperty("csiOptions")){var t=n.keyhole.dbroot.CSIOptionsProto.verify(r.csiOptions);if(t)return"csiOptions."+t}if(r.searchTab!=null&&r.hasOwnProperty("searchTab")){if(!Array.isArray(r.searchTab))return"searchTab: array expected";for(var e=0;e<r.searchTab.length;++e){var t=n.keyhole.dbroot.SearchTabProto.verify(r.searchTab[e]);if(t)return"searchTab."+t}}if(r.cobrandInfo!=null&&r.hasOwnProperty("cobrandInfo")){if(!Array.isArray(r.cobrandInfo))return"cobrandInfo: array expected";for(var e=0;e<r.cobrandInfo.length;++e){var t=n.keyhole.dbroot.CobrandProto.verify(r.cobrandInfo[e]);if(t)return"cobrandInfo."+t}}if(r.validDatabase!=null&&r.hasOwnProperty("validDatabase")){if(!Array.isArray(r.validDatabase))return"validDatabase: array expected";for(var e=0;e<r.validDatabase.length;++e){var t=n.keyhole.dbroot.DatabaseDescriptionProto.verify(r.validDatabase[e]);if(t)return"validDatabase."+t}}if(r.configScript!=null&&r.hasOwnProperty("configScript")){if(!Array.isArray(r.configScript))return"configScript: array expected";for(var e=0;e<r.configScript.length;++e){var t=n.keyhole.dbroot.ConfigScriptProto.verify(r.configScript[e]);if(t)return"configScript."+t}}if(r.deauthServerUrl!=null&&r.hasOwnProperty("deauthServerUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.deauthServerUrl);if(t)return"deauthServerUrl."+t}if(r.swoopParameters!=null&&r.hasOwnProperty("swoopParameters")){var t=n.keyhole.dbroot.SwoopParamsProto.verify(r.swoopParameters);if(t)return"swoopParameters."+t}if(r.bbsServerInfo!=null&&r.hasOwnProperty("bbsServerInfo")){var t=n.keyhole.dbroot.PostingServerProto.verify(r.bbsServerInfo);if(t)return"bbsServerInfo."+t}if(r.dataErrorServerInfo!=null&&r.hasOwnProperty("dataErrorServerInfo")){var t=n.keyhole.dbroot.PostingServerProto.verify(r.dataErrorServerInfo);if(t)return"dataErrorServerInfo."+t}if(r.planetaryDatabase!=null&&r.hasOwnProperty("planetaryDatabase")){if(!Array.isArray(r.planetaryDatabase))return"planetaryDatabase: array expected";for(var e=0;e<r.planetaryDatabase.length;++e){var t=n.keyhole.dbroot.PlanetaryDatabaseProto.verify(r.planetaryDatabase[e]);if(t)return"planetaryDatabase."+t}}if(r.logServer!=null&&r.hasOwnProperty("logServer")){var t=n.keyhole.dbroot.LogServerProto.verify(r.logServer);if(t)return"logServer."+t}if(r.autopiaOptions!=null&&r.hasOwnProperty("autopiaOptions")){var t=n.keyhole.dbroot.AutopiaOptionsProto.verify(r.autopiaOptions);if(t)return"autopiaOptions."+t}if(r.searchConfig!=null&&r.hasOwnProperty("searchConfig")){var t=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.verify(r.searchConfig);if(t)return"searchConfig."+t}if(r.searchInfo!=null&&r.hasOwnProperty("searchInfo")){var t=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.verify(r.searchInfo);if(t)return"searchInfo."+t}if(r.elevationServiceBaseUrl!=null&&r.hasOwnProperty("elevationServiceBaseUrl")&&!u.isString(r.elevationServiceBaseUrl))return"elevationServiceBaseUrl: string expected";if(r.elevationProfileQueryDelay!=null&&r.hasOwnProperty("elevationProfileQueryDelay")&&!u.isInteger(r.elevationProfileQueryDelay))return"elevationProfileQueryDelay: integer expected";if(r.proUpgradeUrl!=null&&r.hasOwnProperty("proUpgradeUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proUpgradeUrl);if(t)return"proUpgradeUrl."+t}if(r.earthCommunityUrl!=null&&r.hasOwnProperty("earthCommunityUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.earthCommunityUrl);if(t)return"earthCommunityUrl."+t}if(r.googleMapsUrl!=null&&r.hasOwnProperty("googleMapsUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.googleMapsUrl);if(t)return"googleMapsUrl."+t}if(r.sharingUrl!=null&&r.hasOwnProperty("sharingUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.sharingUrl);if(t)return"sharingUrl."+t}if(r.privacyPolicyUrl!=null&&r.hasOwnProperty("privacyPolicyUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.privacyPolicyUrl);if(t)return"privacyPolicyUrl."+t}if(r.doGplusUserCheck!=null&&r.hasOwnProperty("doGplusUserCheck")&&typeof r.doGplusUserCheck!="boolean")return"doGplusUserCheck: boolean expected";if(r.rocktreeDataProto!=null&&r.hasOwnProperty("rocktreeDataProto")){var t=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.verify(r.rocktreeDataProto);if(t)return"rocktreeDataProto."+t}if(r.filmstripConfig!=null&&r.hasOwnProperty("filmstripConfig")){if(!Array.isArray(r.filmstripConfig))return"filmstripConfig: array expected";for(var e=0;e<r.filmstripConfig.length;++e){var t=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.verify(r.filmstripConfig[e]);if(t)return"filmstripConfig."+t}}if(r.showSigninButton!=null&&r.hasOwnProperty("showSigninButton")&&typeof r.showSigninButton!="boolean")return"showSigninButton: boolean expected";if(r.proMeasureUpsellUrl!=null&&r.hasOwnProperty("proMeasureUpsellUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proMeasureUpsellUrl);if(t)return"proMeasureUpsellUrl."+t}if(r.proPrintUpsellUrl!=null&&r.hasOwnProperty("proPrintUpsellUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.proPrintUpsellUrl);if(t)return"proPrintUpsellUrl."+t}if(r.starDataProto!=null&&r.hasOwnProperty("starDataProto")){var t=n.keyhole.dbroot.EndSnippetProto.StarDataProto.verify(r.starDataProto);if(t)return"starDataProto."+t}if(r.feedbackUrl!=null&&r.hasOwnProperty("feedbackUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.feedbackUrl);if(t)return"feedbackUrl."+t}if(r.oauth2LoginUrl!=null&&r.hasOwnProperty("oauth2LoginUrl")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.oauth2LoginUrl);if(t)return"oauth2LoginUrl."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.EndSnippetProto)return r;var t=new n.keyhole.dbroot.EndSnippetProto;if(r.model!=null){if(typeof r.model!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.model: object expected");t.model=n.keyhole.dbroot.PlanetModelProto.fromObject(r.model)}if(r.authServerUrl!=null){if(typeof r.authServerUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.authServerUrl: object expected");t.authServerUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.authServerUrl)}if(r.disableAuthentication!=null&&(t.disableAuthentication=!!r.disableAuthentication),r.mfeDomains){if(!Array.isArray(r.mfeDomains))throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: array expected");t.mfeDomains=[];for(var e=0;e<r.mfeDomains.length;++e){if(typeof r.mfeDomains[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: object expected");t.mfeDomains[e]=n.keyhole.dbroot.MfeDomainFeaturesProto.fromObject(r.mfeDomains[e])}}if(r.mfeLangParam!=null&&(t.mfeLangParam=String(r.mfeLangParam)),r.adsUrlPatterns!=null&&(t.adsUrlPatterns=String(r.adsUrlPatterns)),r.reverseGeocoderUrl!=null){if(typeof r.reverseGeocoderUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.reverseGeocoderUrl: object expected");t.reverseGeocoderUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.reverseGeocoderUrl)}if(r.reverseGeocoderProtocolVersion!=null&&(t.reverseGeocoderProtocolVersion=r.reverseGeocoderProtocolVersion|0),r.skyDatabaseIsAvailable!=null&&(t.skyDatabaseIsAvailable=!!r.skyDatabaseIsAvailable),r.skyDatabaseUrl!=null){if(typeof r.skyDatabaseUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.skyDatabaseUrl: object expected");t.skyDatabaseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.skyDatabaseUrl)}if(r.defaultWebPageIntlUrl!=null){if(typeof r.defaultWebPageIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.defaultWebPageIntlUrl: object expected");t.defaultWebPageIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.defaultWebPageIntlUrl)}if(r.numStartUpTips!=null&&(t.numStartUpTips=r.numStartUpTips|0),r.startUpTipsUrl!=null){if(typeof r.startUpTipsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.startUpTipsUrl: object expected");t.startUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.startUpTipsUrl)}if(r.numProStartUpTips!=null&&(t.numProStartUpTips=r.numProStartUpTips|0),r.proStartUpTipsUrl!=null){if(typeof r.proStartUpTipsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proStartUpTipsUrl: object expected");t.proStartUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proStartUpTipsUrl)}if(r.startupTipsIntlUrl!=null){if(typeof r.startupTipsIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.startupTipsIntlUrl: object expected");t.startupTipsIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.startupTipsIntlUrl)}if(r.userGuideIntlUrl!=null){if(typeof r.userGuideIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.userGuideIntlUrl: object expected");t.userGuideIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.userGuideIntlUrl)}if(r.supportCenterIntlUrl!=null){if(typeof r.supportCenterIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportCenterIntlUrl: object expected");t.supportCenterIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportCenterIntlUrl)}if(r.businessListingIntlUrl!=null){if(typeof r.businessListingIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.businessListingIntlUrl: object expected");t.businessListingIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.businessListingIntlUrl)}if(r.supportAnswerIntlUrl!=null){if(typeof r.supportAnswerIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportAnswerIntlUrl: object expected");t.supportAnswerIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportAnswerIntlUrl)}if(r.supportTopicIntlUrl!=null){if(typeof r.supportTopicIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportTopicIntlUrl: object expected");t.supportTopicIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportTopicIntlUrl)}if(r.supportRequestIntlUrl!=null){if(typeof r.supportRequestIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.supportRequestIntlUrl: object expected");t.supportRequestIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.supportRequestIntlUrl)}if(r.earthIntlUrl!=null){if(typeof r.earthIntlUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.earthIntlUrl: object expected");t.earthIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.earthIntlUrl)}if(r.addContentUrl!=null){if(typeof r.addContentUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.addContentUrl: object expected");t.addContentUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.addContentUrl)}if(r.sketchupNotInstalledUrl!=null){if(typeof r.sketchupNotInstalledUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupNotInstalledUrl: object expected");t.sketchupNotInstalledUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.sketchupNotInstalledUrl)}if(r.sketchupErrorUrl!=null){if(typeof r.sketchupErrorUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupErrorUrl: object expected");t.sketchupErrorUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.sketchupErrorUrl)}if(r.freeLicenseUrl!=null){if(typeof r.freeLicenseUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.freeLicenseUrl: object expected");t.freeLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.freeLicenseUrl)}if(r.proLicenseUrl!=null){if(typeof r.proLicenseUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proLicenseUrl: object expected");t.proLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proLicenseUrl)}if(r.tutorialUrl!=null){if(typeof r.tutorialUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.tutorialUrl: object expected");t.tutorialUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.tutorialUrl)}if(r.keyboardShortcutsUrl!=null){if(typeof r.keyboardShortcutsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.keyboardShortcutsUrl: object expected");t.keyboardShortcutsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.keyboardShortcutsUrl)}if(r.releaseNotesUrl!=null){if(typeof r.releaseNotesUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.releaseNotesUrl: object expected");t.releaseNotesUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.releaseNotesUrl)}if(r.hideUserData!=null&&(t.hideUserData=!!r.hideUserData),r.useGeLogo!=null&&(t.useGeLogo=!!r.useGeLogo),r.dioramaDescriptionUrlBase!=null){if(typeof r.dioramaDescriptionUrlBase!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaDescriptionUrlBase: object expected");t.dioramaDescriptionUrlBase=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.dioramaDescriptionUrlBase)}if(r.dioramaDefaultColor!=null&&(t.dioramaDefaultColor=r.dioramaDefaultColor>>>0),r.dioramaBlacklistUrl!=null){if(typeof r.dioramaBlacklistUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected");t.dioramaBlacklistUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.dioramaBlacklistUrl)}if(r.clientOptions!=null){if(typeof r.clientOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.clientOptions: object expected");t.clientOptions=n.keyhole.dbroot.ClientOptionsProto.fromObject(r.clientOptions)}if(r.fetchingOptions!=null){if(typeof r.fetchingOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected");t.fetchingOptions=n.keyhole.dbroot.FetchingOptionsProto.fromObject(r.fetchingOptions)}if(r.timeMachineOptions!=null){if(typeof r.timeMachineOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected");t.timeMachineOptions=n.keyhole.dbroot.TimeMachineOptionsProto.fromObject(r.timeMachineOptions)}if(r.csiOptions!=null){if(typeof r.csiOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.csiOptions: object expected");t.csiOptions=n.keyhole.dbroot.CSIOptionsProto.fromObject(r.csiOptions)}if(r.searchTab){if(!Array.isArray(r.searchTab))throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: array expected");t.searchTab=[];for(var e=0;e<r.searchTab.length;++e){if(typeof r.searchTab[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: object expected");t.searchTab[e]=n.keyhole.dbroot.SearchTabProto.fromObject(r.searchTab[e])}}if(r.cobrandInfo){if(!Array.isArray(r.cobrandInfo))throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: array expected");t.cobrandInfo=[];for(var e=0;e<r.cobrandInfo.length;++e){if(typeof r.cobrandInfo[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: object expected");t.cobrandInfo[e]=n.keyhole.dbroot.CobrandProto.fromObject(r.cobrandInfo[e])}}if(r.validDatabase){if(!Array.isArray(r.validDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: array expected");t.validDatabase=[];for(var e=0;e<r.validDatabase.length;++e){if(typeof r.validDatabase[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: object expected");t.validDatabase[e]=n.keyhole.dbroot.DatabaseDescriptionProto.fromObject(r.validDatabase[e])}}if(r.configScript){if(!Array.isArray(r.configScript))throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: array expected");t.configScript=[];for(var e=0;e<r.configScript.length;++e){if(typeof r.configScript[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: object expected");t.configScript[e]=n.keyhole.dbroot.ConfigScriptProto.fromObject(r.configScript[e])}}if(r.deauthServerUrl!=null){if(typeof r.deauthServerUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.deauthServerUrl: object expected");t.deauthServerUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.deauthServerUrl)}if(r.swoopParameters!=null){if(typeof r.swoopParameters!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.swoopParameters: object expected");t.swoopParameters=n.keyhole.dbroot.SwoopParamsProto.fromObject(r.swoopParameters)}if(r.bbsServerInfo!=null){if(typeof r.bbsServerInfo!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.bbsServerInfo: object expected");t.bbsServerInfo=n.keyhole.dbroot.PostingServerProto.fromObject(r.bbsServerInfo)}if(r.dataErrorServerInfo!=null){if(typeof r.dataErrorServerInfo!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.dataErrorServerInfo: object expected");t.dataErrorServerInfo=n.keyhole.dbroot.PostingServerProto.fromObject(r.dataErrorServerInfo)}if(r.planetaryDatabase){if(!Array.isArray(r.planetaryDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: array expected");t.planetaryDatabase=[];for(var e=0;e<r.planetaryDatabase.length;++e){if(typeof r.planetaryDatabase[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: object expected");t.planetaryDatabase[e]=n.keyhole.dbroot.PlanetaryDatabaseProto.fromObject(r.planetaryDatabase[e])}}if(r.logServer!=null){if(typeof r.logServer!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.logServer: object expected");t.logServer=n.keyhole.dbroot.LogServerProto.fromObject(r.logServer)}if(r.autopiaOptions!=null){if(typeof r.autopiaOptions!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.autopiaOptions: object expected");t.autopiaOptions=n.keyhole.dbroot.AutopiaOptionsProto.fromObject(r.autopiaOptions)}if(r.searchConfig!=null){if(typeof r.searchConfig!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.searchConfig: object expected");t.searchConfig=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.fromObject(r.searchConfig)}if(r.searchInfo!=null){if(typeof r.searchInfo!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.searchInfo: object expected");t.searchInfo=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.fromObject(r.searchInfo)}if(r.elevationServiceBaseUrl!=null&&(t.elevationServiceBaseUrl=String(r.elevationServiceBaseUrl)),r.elevationProfileQueryDelay!=null&&(t.elevationProfileQueryDelay=r.elevationProfileQueryDelay|0),r.proUpgradeUrl!=null){if(typeof r.proUpgradeUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proUpgradeUrl: object expected");t.proUpgradeUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proUpgradeUrl)}if(r.earthCommunityUrl!=null){if(typeof r.earthCommunityUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.earthCommunityUrl: object expected");t.earthCommunityUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.earthCommunityUrl)}if(r.googleMapsUrl!=null){if(typeof r.googleMapsUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.googleMapsUrl: object expected");t.googleMapsUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.googleMapsUrl)}if(r.sharingUrl!=null){if(typeof r.sharingUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.sharingUrl: object expected");t.sharingUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.sharingUrl)}if(r.privacyPolicyUrl!=null){if(typeof r.privacyPolicyUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.privacyPolicyUrl: object expected");t.privacyPolicyUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.privacyPolicyUrl)}if(r.doGplusUserCheck!=null&&(t.doGplusUserCheck=!!r.doGplusUserCheck),r.rocktreeDataProto!=null){if(typeof r.rocktreeDataProto!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.rocktreeDataProto: object expected");t.rocktreeDataProto=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.fromObject(r.rocktreeDataProto)}if(r.filmstripConfig){if(!Array.isArray(r.filmstripConfig))throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: array expected");t.filmstripConfig=[];for(var e=0;e<r.filmstripConfig.length;++e){if(typeof r.filmstripConfig[e]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: object expected");t.filmstripConfig[e]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fromObject(r.filmstripConfig[e])}}if(r.showSigninButton!=null&&(t.showSigninButton=!!r.showSigninButton),r.proMeasureUpsellUrl!=null){if(typeof r.proMeasureUpsellUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proMeasureUpsellUrl: object expected");t.proMeasureUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proMeasureUpsellUrl)}if(r.proPrintUpsellUrl!=null){if(typeof r.proPrintUpsellUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.proPrintUpsellUrl: object expected");t.proPrintUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.proPrintUpsellUrl)}if(r.starDataProto!=null){if(typeof r.starDataProto!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.starDataProto: object expected");t.starDataProto=n.keyhole.dbroot.EndSnippetProto.StarDataProto.fromObject(r.starDataProto)}if(r.feedbackUrl!=null){if(typeof r.feedbackUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.feedbackUrl: object expected");t.feedbackUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.feedbackUrl)}if(r.oauth2LoginUrl!=null){if(typeof r.oauth2LoginUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.oauth2LoginUrl: object expected");t.oauth2LoginUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.oauth2LoginUrl)}return t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.mfeDomains=[],e.searchTab=[],e.cobrandInfo=[],e.validDatabase=[],e.configScript=[],e.planetaryDatabase=[],e.filmstripConfig=[]),t.defaults&&(e.model=null,e.authServerUrl=null,e.disableAuthentication=!1,e.mfeLangParam="hl=$5Bhl5D",e.adsUrlPatterns="",e.reverseGeocoderUrl=null,e.reverseGeocoderProtocolVersion=3,e.skyDatabaseIsAvailable=!0,e.skyDatabaseUrl=null,e.defaultWebPageIntlUrl=null,e.numStartUpTips=17,e.startUpTipsUrl=null,e.userGuideIntlUrl=null,e.supportCenterIntlUrl=null,e.businessListingIntlUrl=null,e.supportAnswerIntlUrl=null,e.supportTopicIntlUrl=null,e.supportRequestIntlUrl=null,e.earthIntlUrl=null,e.addContentUrl=null,e.sketchupNotInstalledUrl=null,e.sketchupErrorUrl=null,e.freeLicenseUrl=null,e.proLicenseUrl=null,e.hideUserData=!1,e.useGeLogo=!0,e.dioramaDescriptionUrlBase=null,e.dioramaDefaultColor=4291281607,e.clientOptions=null,e.fetchingOptions=null,e.timeMachineOptions=null,e.csiOptions=null,e.deauthServerUrl=null,e.swoopParameters=null,e.bbsServerInfo=null,e.dataErrorServerInfo=null,e.logServer=null,e.autopiaOptions=null,e.searchInfo=null,e.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",e.elevationProfileQueryDelay=500,e.tutorialUrl=null,e.keyboardShortcutsUrl=null,e.releaseNotesUrl=null,e.numProStartUpTips=0,e.proStartUpTipsUrl=null,e.dioramaBlacklistUrl=null,e.searchConfig=null,e.proUpgradeUrl=null,e.earthCommunityUrl=null,e.googleMapsUrl=null,e.sharingUrl=null,e.privacyPolicyUrl=null,e.doGplusUserCheck=!1,e.rocktreeDataProto=null,e.showSigninButton=!1,e.startupTipsIntlUrl=null,e.proMeasureUpsellUrl=null,e.proPrintUpsellUrl=null,e.starDataProto=null,e.feedbackUrl=null,e.oauth2LoginUrl=null),r.model!=null&&r.hasOwnProperty("model")&&(e.model=n.keyhole.dbroot.PlanetModelProto.toObject(r.model,t)),r.authServerUrl!=null&&r.hasOwnProperty("authServerUrl")&&(e.authServerUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.authServerUrl,t)),r.disableAuthentication!=null&&r.hasOwnProperty("disableAuthentication")&&(e.disableAuthentication=r.disableAuthentication),r.mfeDomains&&r.mfeDomains.length){e.mfeDomains=[];for(var o=0;o<r.mfeDomains.length;++o)e.mfeDomains[o]=n.keyhole.dbroot.MfeDomainFeaturesProto.toObject(r.mfeDomains[o],t)}if(r.mfeLangParam!=null&&r.hasOwnProperty("mfeLangParam")&&(e.mfeLangParam=r.mfeLangParam),r.adsUrlPatterns!=null&&r.hasOwnProperty("adsUrlPatterns")&&(e.adsUrlPatterns=r.adsUrlPatterns),r.reverseGeocoderUrl!=null&&r.hasOwnProperty("reverseGeocoderUrl")&&(e.reverseGeocoderUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.reverseGeocoderUrl,t)),r.reverseGeocoderProtocolVersion!=null&&r.hasOwnProperty("reverseGeocoderProtocolVersion")&&(e.reverseGeocoderProtocolVersion=r.reverseGeocoderProtocolVersion),r.skyDatabaseIsAvailable!=null&&r.hasOwnProperty("skyDatabaseIsAvailable")&&(e.skyDatabaseIsAvailable=r.skyDatabaseIsAvailable),r.skyDatabaseUrl!=null&&r.hasOwnProperty("skyDatabaseUrl")&&(e.skyDatabaseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.skyDatabaseUrl,t)),r.defaultWebPageIntlUrl!=null&&r.hasOwnProperty("defaultWebPageIntlUrl")&&(e.defaultWebPageIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.defaultWebPageIntlUrl,t)),r.numStartUpTips!=null&&r.hasOwnProperty("numStartUpTips")&&(e.numStartUpTips=r.numStartUpTips),r.startUpTipsUrl!=null&&r.hasOwnProperty("startUpTipsUrl")&&(e.startUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.startUpTipsUrl,t)),r.userGuideIntlUrl!=null&&r.hasOwnProperty("userGuideIntlUrl")&&(e.userGuideIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.userGuideIntlUrl,t)),r.supportCenterIntlUrl!=null&&r.hasOwnProperty("supportCenterIntlUrl")&&(e.supportCenterIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportCenterIntlUrl,t)),r.businessListingIntlUrl!=null&&r.hasOwnProperty("businessListingIntlUrl")&&(e.businessListingIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.businessListingIntlUrl,t)),r.supportAnswerIntlUrl!=null&&r.hasOwnProperty("supportAnswerIntlUrl")&&(e.supportAnswerIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportAnswerIntlUrl,t)),r.supportTopicIntlUrl!=null&&r.hasOwnProperty("supportTopicIntlUrl")&&(e.supportTopicIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportTopicIntlUrl,t)),r.supportRequestIntlUrl!=null&&r.hasOwnProperty("supportRequestIntlUrl")&&(e.supportRequestIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.supportRequestIntlUrl,t)),r.earthIntlUrl!=null&&r.hasOwnProperty("earthIntlUrl")&&(e.earthIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.earthIntlUrl,t)),r.addContentUrl!=null&&r.hasOwnProperty("addContentUrl")&&(e.addContentUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.addContentUrl,t)),r.sketchupNotInstalledUrl!=null&&r.hasOwnProperty("sketchupNotInstalledUrl")&&(e.sketchupNotInstalledUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.sketchupNotInstalledUrl,t)),r.sketchupErrorUrl!=null&&r.hasOwnProperty("sketchupErrorUrl")&&(e.sketchupErrorUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.sketchupErrorUrl,t)),r.freeLicenseUrl!=null&&r.hasOwnProperty("freeLicenseUrl")&&(e.freeLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.freeLicenseUrl,t)),r.proLicenseUrl!=null&&r.hasOwnProperty("proLicenseUrl")&&(e.proLicenseUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proLicenseUrl,t)),r.hideUserData!=null&&r.hasOwnProperty("hideUserData")&&(e.hideUserData=r.hideUserData),r.useGeLogo!=null&&r.hasOwnProperty("useGeLogo")&&(e.useGeLogo=r.useGeLogo),r.dioramaDescriptionUrlBase!=null&&r.hasOwnProperty("dioramaDescriptionUrlBase")&&(e.dioramaDescriptionUrlBase=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.dioramaDescriptionUrlBase,t)),r.dioramaDefaultColor!=null&&r.hasOwnProperty("dioramaDefaultColor")&&(e.dioramaDefaultColor=r.dioramaDefaultColor),r.clientOptions!=null&&r.hasOwnProperty("clientOptions")&&(e.clientOptions=n.keyhole.dbroot.ClientOptionsProto.toObject(r.clientOptions,t)),r.fetchingOptions!=null&&r.hasOwnProperty("fetchingOptions")&&(e.fetchingOptions=n.keyhole.dbroot.FetchingOptionsProto.toObject(r.fetchingOptions,t)),r.timeMachineOptions!=null&&r.hasOwnProperty("timeMachineOptions")&&(e.timeMachineOptions=n.keyhole.dbroot.TimeMachineOptionsProto.toObject(r.timeMachineOptions,t)),r.csiOptions!=null&&r.hasOwnProperty("csiOptions")&&(e.csiOptions=n.keyhole.dbroot.CSIOptionsProto.toObject(r.csiOptions,t)),r.searchTab&&r.searchTab.length){e.searchTab=[];for(var o=0;o<r.searchTab.length;++o)e.searchTab[o]=n.keyhole.dbroot.SearchTabProto.toObject(r.searchTab[o],t)}if(r.cobrandInfo&&r.cobrandInfo.length){e.cobrandInfo=[];for(var o=0;o<r.cobrandInfo.length;++o)e.cobrandInfo[o]=n.keyhole.dbroot.CobrandProto.toObject(r.cobrandInfo[o],t)}if(r.validDatabase&&r.validDatabase.length){e.validDatabase=[];for(var o=0;o<r.validDatabase.length;++o)e.validDatabase[o]=n.keyhole.dbroot.DatabaseDescriptionProto.toObject(r.validDatabase[o],t)}if(r.configScript&&r.configScript.length){e.configScript=[];for(var o=0;o<r.configScript.length;++o)e.configScript[o]=n.keyhole.dbroot.ConfigScriptProto.toObject(r.configScript[o],t)}if(r.deauthServerUrl!=null&&r.hasOwnProperty("deauthServerUrl")&&(e.deauthServerUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.deauthServerUrl,t)),r.swoopParameters!=null&&r.hasOwnProperty("swoopParameters")&&(e.swoopParameters=n.keyhole.dbroot.SwoopParamsProto.toObject(r.swoopParameters,t)),r.bbsServerInfo!=null&&r.hasOwnProperty("bbsServerInfo")&&(e.bbsServerInfo=n.keyhole.dbroot.PostingServerProto.toObject(r.bbsServerInfo,t)),r.dataErrorServerInfo!=null&&r.hasOwnProperty("dataErrorServerInfo")&&(e.dataErrorServerInfo=n.keyhole.dbroot.PostingServerProto.toObject(r.dataErrorServerInfo,t)),r.planetaryDatabase&&r.planetaryDatabase.length){e.planetaryDatabase=[];for(var o=0;o<r.planetaryDatabase.length;++o)e.planetaryDatabase[o]=n.keyhole.dbroot.PlanetaryDatabaseProto.toObject(r.planetaryDatabase[o],t)}if(r.logServer!=null&&r.hasOwnProperty("logServer")&&(e.logServer=n.keyhole.dbroot.LogServerProto.toObject(r.logServer,t)),r.autopiaOptions!=null&&r.hasOwnProperty("autopiaOptions")&&(e.autopiaOptions=n.keyhole.dbroot.AutopiaOptionsProto.toObject(r.autopiaOptions,t)),r.searchInfo!=null&&r.hasOwnProperty("searchInfo")&&(e.searchInfo=n.keyhole.dbroot.EndSnippetProto.SearchInfoProto.toObject(r.searchInfo,t)),r.elevationServiceBaseUrl!=null&&r.hasOwnProperty("elevationServiceBaseUrl")&&(e.elevationServiceBaseUrl=r.elevationServiceBaseUrl),r.elevationProfileQueryDelay!=null&&r.hasOwnProperty("elevationProfileQueryDelay")&&(e.elevationProfileQueryDelay=r.elevationProfileQueryDelay),r.tutorialUrl!=null&&r.hasOwnProperty("tutorialUrl")&&(e.tutorialUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.tutorialUrl,t)),r.keyboardShortcutsUrl!=null&&r.hasOwnProperty("keyboardShortcutsUrl")&&(e.keyboardShortcutsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.keyboardShortcutsUrl,t)),r.releaseNotesUrl!=null&&r.hasOwnProperty("releaseNotesUrl")&&(e.releaseNotesUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.releaseNotesUrl,t)),r.numProStartUpTips!=null&&r.hasOwnProperty("numProStartUpTips")&&(e.numProStartUpTips=r.numProStartUpTips),r.proStartUpTipsUrl!=null&&r.hasOwnProperty("proStartUpTipsUrl")&&(e.proStartUpTipsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proStartUpTipsUrl,t)),r.dioramaBlacklistUrl!=null&&r.hasOwnProperty("dioramaBlacklistUrl")&&(e.dioramaBlacklistUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.dioramaBlacklistUrl,t)),r.searchConfig!=null&&r.hasOwnProperty("searchConfig")&&(e.searchConfig=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.toObject(r.searchConfig,t)),r.proUpgradeUrl!=null&&r.hasOwnProperty("proUpgradeUrl")&&(e.proUpgradeUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proUpgradeUrl,t)),r.earthCommunityUrl!=null&&r.hasOwnProperty("earthCommunityUrl")&&(e.earthCommunityUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.earthCommunityUrl,t)),r.googleMapsUrl!=null&&r.hasOwnProperty("googleMapsUrl")&&(e.googleMapsUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.googleMapsUrl,t)),r.sharingUrl!=null&&r.hasOwnProperty("sharingUrl")&&(e.sharingUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.sharingUrl,t)),r.privacyPolicyUrl!=null&&r.hasOwnProperty("privacyPolicyUrl")&&(e.privacyPolicyUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.privacyPolicyUrl,t)),r.doGplusUserCheck!=null&&r.hasOwnProperty("doGplusUserCheck")&&(e.doGplusUserCheck=r.doGplusUserCheck),r.rocktreeDataProto!=null&&r.hasOwnProperty("rocktreeDataProto")&&(e.rocktreeDataProto=n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.toObject(r.rocktreeDataProto,t)),r.filmstripConfig&&r.filmstripConfig.length){e.filmstripConfig=[];for(var o=0;o<r.filmstripConfig.length;++o)e.filmstripConfig[o]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.toObject(r.filmstripConfig[o],t)}return r.showSigninButton!=null&&r.hasOwnProperty("showSigninButton")&&(e.showSigninButton=r.showSigninButton),r.startupTipsIntlUrl!=null&&r.hasOwnProperty("startupTipsIntlUrl")&&(e.startupTipsIntlUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.startupTipsIntlUrl,t)),r.proMeasureUpsellUrl!=null&&r.hasOwnProperty("proMeasureUpsellUrl")&&(e.proMeasureUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proMeasureUpsellUrl,t)),r.proPrintUpsellUrl!=null&&r.hasOwnProperty("proPrintUpsellUrl")&&(e.proPrintUpsellUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.proPrintUpsellUrl,t)),r.starDataProto!=null&&r.hasOwnProperty("starDataProto")&&(e.starDataProto=n.keyhole.dbroot.EndSnippetProto.StarDataProto.toObject(r.starDataProto,t)),r.feedbackUrl!=null&&r.hasOwnProperty("feedbackUrl")&&(e.feedbackUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.feedbackUrl,t)),r.oauth2LoginUrl!=null&&r.hasOwnProperty("oauth2LoginUrl")&&(e.oauth2LoginUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.oauth2LoginUrl,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.EndSnippetProto"},i.SearchConfigProto=(function(){function l(r){if(this.searchServer=[],this.oneboxService=[],r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.searchServer=u.emptyArray,l.prototype.oneboxService=u.emptyArray,l.prototype.kmlSearchUrl=null,l.prototype.kmlRenderUrl=null,l.prototype.searchHistoryUrl=null,l.prototype.errorPageUrl=null,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.searchServer&&a.searchServer.length||(a.searchServer=[]),a.searchServer.push(n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.decode(t,t.uint32()));break}case 2:{a.oneboxService&&a.oneboxService.length||(a.oneboxService=[]),a.oneboxService.push(n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.decode(t,t.uint32()));break}case 3:{a.kmlSearchUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 4:{a.kmlRenderUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 6:{a.searchHistoryUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 5:{a.errorPageUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.searchServer!=null&&t.hasOwnProperty("searchServer")){if(!Array.isArray(t.searchServer))return"searchServer: array expected";for(var e=0;e<t.searchServer.length;++e){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.verify(t.searchServer[e]);if(o)return"searchServer."+o}}if(t.oneboxService!=null&&t.hasOwnProperty("oneboxService")){if(!Array.isArray(t.oneboxService))return"oneboxService: array expected";for(var e=0;e<t.oneboxService.length;++e){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.verify(t.oneboxService[e]);if(o)return"oneboxService."+o}}if(t.kmlSearchUrl!=null&&t.hasOwnProperty("kmlSearchUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.kmlSearchUrl);if(o)return"kmlSearchUrl."+o}if(t.kmlRenderUrl!=null&&t.hasOwnProperty("kmlRenderUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.kmlRenderUrl);if(o)return"kmlRenderUrl."+o}if(t.searchHistoryUrl!=null&&t.hasOwnProperty("searchHistoryUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.searchHistoryUrl);if(o)return"searchHistoryUrl."+o}if(t.errorPageUrl!=null&&t.hasOwnProperty("errorPageUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(t.errorPageUrl);if(o)return"errorPageUrl."+o}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;if(t.searchServer){if(!Array.isArray(t.searchServer))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: array expected");e.searchServer=[];for(var o=0;o<t.searchServer.length;++o){if(typeof t.searchServer[o]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: object expected");e.searchServer[o]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.fromObject(t.searchServer[o])}}if(t.oneboxService){if(!Array.isArray(t.oneboxService))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: array expected");e.oneboxService=[];for(var o=0;o<t.oneboxService.length;++o){if(typeof t.oneboxService[o]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: object expected");e.oneboxService[o]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.fromObject(t.oneboxService[o])}}if(t.kmlSearchUrl!=null){if(typeof t.kmlSearchUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlSearchUrl: object expected");e.kmlSearchUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.kmlSearchUrl)}if(t.kmlRenderUrl!=null){if(typeof t.kmlRenderUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlRenderUrl: object expected");e.kmlRenderUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.kmlRenderUrl)}if(t.searchHistoryUrl!=null){if(typeof t.searchHistoryUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchHistoryUrl: object expected");e.searchHistoryUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.searchHistoryUrl)}if(t.errorPageUrl!=null){if(typeof t.errorPageUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.errorPageUrl: object expected");e.errorPageUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.errorPageUrl)}return e},l.toObject=function(t,e){e||(e={});var o={};if((e.arrays||e.defaults)&&(o.searchServer=[],o.oneboxService=[]),e.defaults&&(o.kmlSearchUrl=null,o.kmlRenderUrl=null,o.errorPageUrl=null,o.searchHistoryUrl=null),t.searchServer&&t.searchServer.length){o.searchServer=[];for(var a=0;a<t.searchServer.length;++a)o.searchServer[a]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.toObject(t.searchServer[a],e)}if(t.oneboxService&&t.oneboxService.length){o.oneboxService=[];for(var a=0;a<t.oneboxService.length;++a)o.oneboxService[a]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.toObject(t.oneboxService[a],e)}return t.kmlSearchUrl!=null&&t.hasOwnProperty("kmlSearchUrl")&&(o.kmlSearchUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.kmlSearchUrl,e)),t.kmlRenderUrl!=null&&t.hasOwnProperty("kmlRenderUrl")&&(o.kmlRenderUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.kmlRenderUrl,e)),t.errorPageUrl!=null&&t.hasOwnProperty("errorPageUrl")&&(o.errorPageUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.errorPageUrl,e)),t.searchHistoryUrl!=null&&t.hasOwnProperty("searchHistoryUrl")&&(o.searchHistoryUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.searchHistoryUrl,e)),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto"},l.SearchServer=(function(){function r(t){if(this.suggestion=[],this.searchlet=[],t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.name=null,r.prototype.url=null,r.prototype.type=0,r.prototype.htmlTransformUrl=null,r.prototype.kmlTransformUrl=null,r.prototype.supplementalUi=null,r.prototype.suggestion=u.emptyArray,r.prototype.searchlet=u.emptyArray,r.prototype.requirements=null,r.prototype.suggestServer=null,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.name=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 2:{p.url=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 3:{p.type=e.int32();break}case 4:{p.htmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 5:{p.kmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 6:{p.supplementalUi=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.decode(e,e.uint32());break}case 9:{p.suggestion&&p.suggestion.length||(p.suggestion=[]),p.suggestion.push(n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32()));break}case 7:{p.searchlet&&p.searchlet.length||(p.searchlet=[]),p.searchlet.push(n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.decode(e,e.uint32()));break}case 8:{p.requirements=n.keyhole.dbroot.RequirementProto.decode(e,e.uint32());break}case 10:{p.suggestServer=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}default:e.skipType(y&7);break}}return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.name);if(o)return"name."+o}if(e.url!=null&&e.hasOwnProperty("url")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.url);if(o)return"url."+o}if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:break}if(e.htmlTransformUrl!=null&&e.hasOwnProperty("htmlTransformUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.htmlTransformUrl);if(o)return"htmlTransformUrl."+o}if(e.kmlTransformUrl!=null&&e.hasOwnProperty("kmlTransformUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.kmlTransformUrl);if(o)return"kmlTransformUrl."+o}if(e.supplementalUi!=null&&e.hasOwnProperty("supplementalUi")){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.verify(e.supplementalUi);if(o)return"supplementalUi."+o}if(e.suggestion!=null&&e.hasOwnProperty("suggestion")){if(!Array.isArray(e.suggestion))return"suggestion: array expected";for(var a=0;a<e.suggestion.length;++a){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.suggestion[a]);if(o)return"suggestion."+o}}if(e.searchlet!=null&&e.hasOwnProperty("searchlet")){if(!Array.isArray(e.searchlet))return"searchlet: array expected";for(var a=0;a<e.searchlet.length;++a){var o=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.verify(e.searchlet[a]);if(o)return"searchlet."+o}}if(e.requirements!=null&&e.hasOwnProperty("requirements")){var o=n.keyhole.dbroot.RequirementProto.verify(e.requirements);if(o)return"requirements."+o}if(e.suggestServer!=null&&e.hasOwnProperty("suggestServer")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.suggestServer);if(o)return"suggestServer."+o}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer)return e;var o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;if(e.name!=null){if(typeof e.name!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.name: object expected");o.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.name)}if(e.url!=null){if(typeof e.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.url: object expected");o.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.url)}switch(e.type){case"RESULT_TYPE_KML":case 0:o.type=0;break;case"RESULT_TYPE_XML":case 1:o.type=1;break}if(e.htmlTransformUrl!=null){if(typeof e.htmlTransformUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.htmlTransformUrl: object expected");o.htmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.htmlTransformUrl)}if(e.kmlTransformUrl!=null){if(typeof e.kmlTransformUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.kmlTransformUrl: object expected");o.kmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.kmlTransformUrl)}if(e.supplementalUi!=null){if(typeof e.supplementalUi!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.supplementalUi: object expected");o.supplementalUi=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.fromObject(e.supplementalUi)}if(e.suggestion){if(!Array.isArray(e.suggestion))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: array expected");o.suggestion=[];for(var a=0;a<e.suggestion.length;++a){if(typeof e.suggestion[a]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: object expected");o.suggestion[a]=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.suggestion[a])}}if(e.searchlet){if(!Array.isArray(e.searchlet))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: array expected");o.searchlet=[];for(var a=0;a<e.searchlet.length;++a){if(typeof e.searchlet[a]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: object expected");o.searchlet[a]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.fromObject(e.searchlet[a])}}if(e.requirements!=null){if(typeof e.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.requirements: object expected");o.requirements=n.keyhole.dbroot.RequirementProto.fromObject(e.requirements)}if(e.suggestServer!=null){if(typeof e.suggestServer!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestServer: object expected");o.suggestServer=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.suggestServer)}return o},r.toObject=function(e,o){o||(o={});var a={};if((o.arrays||o.defaults)&&(a.searchlet=[],a.suggestion=[]),o.defaults&&(a.name=null,a.url=null,a.type=o.enums===String?"RESULT_TYPE_KML":0,a.htmlTransformUrl=null,a.kmlTransformUrl=null,a.supplementalUi=null,a.requirements=null,a.suggestServer=null),e.name!=null&&e.hasOwnProperty("name")&&(a.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.name,o)),e.url!=null&&e.hasOwnProperty("url")&&(a.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.url,o)),e.type!=null&&e.hasOwnProperty("type")&&(a.type=o.enums===String?n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.ResultType[e.type]:e.type),e.htmlTransformUrl!=null&&e.hasOwnProperty("htmlTransformUrl")&&(a.htmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.htmlTransformUrl,o)),e.kmlTransformUrl!=null&&e.hasOwnProperty("kmlTransformUrl")&&(a.kmlTransformUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.kmlTransformUrl,o)),e.supplementalUi!=null&&e.hasOwnProperty("supplementalUi")&&(a.supplementalUi=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.toObject(e.supplementalUi,o)),e.searchlet&&e.searchlet.length){a.searchlet=[];for(var p=0;p<e.searchlet.length;++p)a.searchlet[p]=n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.toObject(e.searchlet[p],o)}if(e.requirements!=null&&e.hasOwnProperty("requirements")&&(a.requirements=n.keyhole.dbroot.RequirementProto.toObject(e.requirements,o)),e.suggestion&&e.suggestion.length){a.suggestion=[];for(var p=0;p<e.suggestion.length;++p)a.suggestion[p]=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.suggestion[p],o)}return e.suggestServer!=null&&e.hasOwnProperty("suggestServer")&&(a.suggestServer=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.suggestServer,o)),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer"},r.ResultType=(function(){var t={},e=Object.create(t);return e[t[0]="RESULT_TYPE_KML"]=0,e[t[1]="RESULT_TYPE_XML"]=1,e})(),r.SupplementalUi=(function(){function t(e){if(e)for(var o=Object.keys(e),a=0;a<o.length;++a)e[o[a]]!=null&&(this[o[a]]=e[o[a]])}return t.prototype.url=null,t.prototype.label=null,t.prototype.height=160,t.decode=function(o,a){o instanceof f||(o=f.create(o));for(var p=a===void 0?o.len:o.pos+a,y=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;o.pos<p;){var h=o.uint32();switch(h>>>3){case 1:{y.url=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 2:{y.label=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 3:{y.height=o.int32();break}default:o.skipType(h&7);break}}return y},t.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.url!=null&&o.hasOwnProperty("url")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.url);if(a)return"url."+a}if(o.label!=null&&o.hasOwnProperty("label")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.label);if(a)return"label."+a}return o.height!=null&&o.hasOwnProperty("height")&&!u.isInteger(o.height)?"height: integer expected":null},t.fromObject=function(o){if(o instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)return o;var a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;if(o.url!=null){if(typeof o.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected");a.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.url)}if(o.label!=null){if(typeof o.label!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected");a.label=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.label)}return o.height!=null&&(a.height=o.height|0),a},t.toObject=function(o,a){a||(a={});var p={};return a.defaults&&(p.url=null,p.label=null,p.height=160),o.url!=null&&o.hasOwnProperty("url")&&(p.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.url,a)),o.label!=null&&o.hasOwnProperty("label")&&(p.label=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.label,a)),o.height!=null&&o.hasOwnProperty("height")&&(p.height=o.height),p},t.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},t.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi"},t})(),r.SearchletProto=(function(){function t(e){if(e)for(var o=Object.keys(e),a=0;a<o.length;++a)e[o[a]]!=null&&(this[o[a]]=e[o[a]])}return t.prototype.url=null,t.prototype.name=null,t.prototype.requirements=null,t.decode=function(o,a){o instanceof f||(o=f.create(o));for(var p=a===void 0?o.len:o.pos+a,y=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;o.pos<p;){var h=o.uint32();switch(h>>>3){case 1:{y.url=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 2:{y.name=n.keyhole.dbroot.StringIdOrValueProto.decode(o,o.uint32());break}case 3:{y.requirements=n.keyhole.dbroot.RequirementProto.decode(o,o.uint32());break}default:o.skipType(h&7);break}}return y},t.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.url!=null&&o.hasOwnProperty("url")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.url);if(a)return"url."+a}if(o.name!=null&&o.hasOwnProperty("name")){var a=n.keyhole.dbroot.StringIdOrValueProto.verify(o.name);if(a)return"name."+a}if(o.requirements!=null&&o.hasOwnProperty("requirements")){var a=n.keyhole.dbroot.RequirementProto.verify(o.requirements);if(a)return"requirements."+a}return null},t.fromObject=function(o){if(o instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)return o;var a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;if(o.url!=null){if(typeof o.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected");a.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.url)}if(o.name!=null){if(typeof o.name!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected");a.name=n.keyhole.dbroot.StringIdOrValueProto.fromObject(o.name)}if(o.requirements!=null){if(typeof o.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected");a.requirements=n.keyhole.dbroot.RequirementProto.fromObject(o.requirements)}return a},t.toObject=function(o,a){a||(a={});var p={};return a.defaults&&(p.url=null,p.name=null,p.requirements=null),o.url!=null&&o.hasOwnProperty("url")&&(p.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.url,a)),o.name!=null&&o.hasOwnProperty("name")&&(p.name=n.keyhole.dbroot.StringIdOrValueProto.toObject(o.name,a)),o.requirements!=null&&o.hasOwnProperty("requirements")&&(p.requirements=n.keyhole.dbroot.RequirementProto.toObject(o.requirements,a)),p},t.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},t.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto"},t})(),r})(),l.OneboxServiceProto=(function(){function r(t){if(t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.serviceUrl=null,r.prototype.requirements=null,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.serviceUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 2:{p.requirements=n.keyhole.dbroot.RequirementProto.decode(e,e.uint32());break}default:e.skipType(y&7);break}}return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.serviceUrl!=null&&e.hasOwnProperty("serviceUrl")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.serviceUrl);if(o)return"serviceUrl."+o}if(e.requirements!=null&&e.hasOwnProperty("requirements")){var o=n.keyhole.dbroot.RequirementProto.verify(e.requirements);if(o)return"requirements."+o}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)return e;var o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;if(e.serviceUrl!=null){if(typeof e.serviceUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected");o.serviceUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.serviceUrl)}if(e.requirements!=null){if(typeof e.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected");o.requirements=n.keyhole.dbroot.RequirementProto.fromObject(e.requirements)}return o},r.toObject=function(e,o){o||(o={});var a={};return o.defaults&&(a.serviceUrl=null,a.requirements=null),e.serviceUrl!=null&&e.hasOwnProperty("serviceUrl")&&(a.serviceUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.serviceUrl,o)),e.requirements!=null&&e.hasOwnProperty("requirements")&&(a.requirements=n.keyhole.dbroot.RequirementProto.toObject(e.requirements,o)),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto"},r})(),l})(),i.SearchInfoProto=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.defaultUrl="http://maps.google.com/maps",l.prototype.geocodeParam="q",l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.defaultUrl=t.string();break}case 2:{a.geocodeParam=t.string();break}default:t.skipType(p&7);break}}return a},l.verify=function(t){return typeof t!="object"||t===null?"object expected":t.defaultUrl!=null&&t.hasOwnProperty("defaultUrl")&&!u.isString(t.defaultUrl)?"defaultUrl: string expected":t.geocodeParam!=null&&t.hasOwnProperty("geocodeParam")&&!u.isString(t.geocodeParam)?"geocodeParam: string expected":null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.SearchInfoProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;return t.defaultUrl!=null&&(e.defaultUrl=String(t.defaultUrl)),t.geocodeParam!=null&&(e.geocodeParam=String(t.geocodeParam)),e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.defaultUrl="http://maps.google.com/maps",o.geocodeParam="q"),t.defaultUrl!=null&&t.hasOwnProperty("defaultUrl")&&(o.defaultUrl=t.defaultUrl),t.geocodeParam!=null&&t.hasOwnProperty("geocodeParam")&&(o.geocodeParam=t.geocodeParam),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.SearchInfoProto"},l})(),i.RockTreeDataProto=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.url=null,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;t.pos<o;){var p=t.uint32();p>>>3===1?a.url=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32()):t.skipType(p&7)}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.url!=null&&t.hasOwnProperty("url")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.url);if(e)return"url."+e}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;if(t.url!=null){if(typeof t.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected");e.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.url)}return e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.url=null),t.url!=null&&t.hasOwnProperty("url")&&(o.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.url,e)),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.RockTreeDataProto"},l})(),i.FilmstripConfigProto=(function(){function l(r){if(this.imageryType=[],r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.requirements=null,l.prototype.alleycatUrlTemplate=null,l.prototype.fallbackAlleycatUrlTemplate=null,l.prototype.metadataUrlTemplate=null,l.prototype.thumbnailUrlTemplate=null,l.prototype.kmlUrlTemplate=null,l.prototype.featuredToursUrl=null,l.prototype.enableViewportFallback=!1,l.prototype.viewportFallbackDistance=0,l.prototype.imageryType=u.emptyArray,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;t.pos<o;){var p=t.uint32();switch(p>>>3){case 1:{a.requirements=n.keyhole.dbroot.RequirementProto.decode(t,t.uint32());break}case 2:{a.alleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 9:{a.fallbackAlleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 3:{a.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 4:{a.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 5:{a.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 6:{a.featuredToursUrl=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32());break}case 7:{a.enableViewportFallback=t.bool();break}case 8:{a.viewportFallbackDistance=t.uint32();break}case 10:{a.imageryType&&a.imageryType.length||(a.imageryType=[]),a.imageryType.push(n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.decode(t,t.uint32()));break}default:t.skipType(p&7);break}}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.requirements!=null&&t.hasOwnProperty("requirements")){var e=n.keyhole.dbroot.RequirementProto.verify(t.requirements);if(e)return"requirements."+e}if(t.alleycatUrlTemplate!=null&&t.hasOwnProperty("alleycatUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.alleycatUrlTemplate);if(e)return"alleycatUrlTemplate."+e}if(t.fallbackAlleycatUrlTemplate!=null&&t.hasOwnProperty("fallbackAlleycatUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.fallbackAlleycatUrlTemplate);if(e)return"fallbackAlleycatUrlTemplate."+e}if(t.metadataUrlTemplate!=null&&t.hasOwnProperty("metadataUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.metadataUrlTemplate);if(e)return"metadataUrlTemplate."+e}if(t.thumbnailUrlTemplate!=null&&t.hasOwnProperty("thumbnailUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.thumbnailUrlTemplate);if(e)return"thumbnailUrlTemplate."+e}if(t.kmlUrlTemplate!=null&&t.hasOwnProperty("kmlUrlTemplate")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.kmlUrlTemplate);if(e)return"kmlUrlTemplate."+e}if(t.featuredToursUrl!=null&&t.hasOwnProperty("featuredToursUrl")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.featuredToursUrl);if(e)return"featuredToursUrl."+e}if(t.enableViewportFallback!=null&&t.hasOwnProperty("enableViewportFallback")&&typeof t.enableViewportFallback!="boolean")return"enableViewportFallback: boolean expected";if(t.viewportFallbackDistance!=null&&t.hasOwnProperty("viewportFallbackDistance")&&!u.isInteger(t.viewportFallbackDistance))return"viewportFallbackDistance: integer expected";if(t.imageryType!=null&&t.hasOwnProperty("imageryType")){if(!Array.isArray(t.imageryType))return"imageryType: array expected";for(var o=0;o<t.imageryType.length;++o){var e=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.verify(t.imageryType[o]);if(e)return"imageryType."+e}}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;if(t.requirements!=null){if(typeof t.requirements!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.requirements: object expected");e.requirements=n.keyhole.dbroot.RequirementProto.fromObject(t.requirements)}if(t.alleycatUrlTemplate!=null){if(typeof t.alleycatUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.alleycatUrlTemplate: object expected");e.alleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.alleycatUrlTemplate)}if(t.fallbackAlleycatUrlTemplate!=null){if(typeof t.fallbackAlleycatUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fallbackAlleycatUrlTemplate: object expected");e.fallbackAlleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.fallbackAlleycatUrlTemplate)}if(t.metadataUrlTemplate!=null){if(typeof t.metadataUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.metadataUrlTemplate: object expected");e.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.metadataUrlTemplate)}if(t.thumbnailUrlTemplate!=null){if(typeof t.thumbnailUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.thumbnailUrlTemplate: object expected");e.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.thumbnailUrlTemplate)}if(t.kmlUrlTemplate!=null){if(typeof t.kmlUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.kmlUrlTemplate: object expected");e.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.kmlUrlTemplate)}if(t.featuredToursUrl!=null){if(typeof t.featuredToursUrl!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.featuredToursUrl: object expected");e.featuredToursUrl=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.featuredToursUrl)}if(t.enableViewportFallback!=null&&(e.enableViewportFallback=!!t.enableViewportFallback),t.viewportFallbackDistance!=null&&(e.viewportFallbackDistance=t.viewportFallbackDistance>>>0),t.imageryType){if(!Array.isArray(t.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");e.imageryType=[];for(var o=0;o<t.imageryType.length;++o){if(typeof t.imageryType[o]!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: object expected");e.imageryType[o]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.fromObject(t.imageryType[o])}}return e},l.toObject=function(t,e){e||(e={});var o={};if((e.arrays||e.defaults)&&(o.imageryType=[]),e.defaults&&(o.requirements=null,o.alleycatUrlTemplate=null,o.metadataUrlTemplate=null,o.thumbnailUrlTemplate=null,o.kmlUrlTemplate=null,o.featuredToursUrl=null,o.enableViewportFallback=!1,o.viewportFallbackDistance=0,o.fallbackAlleycatUrlTemplate=null),t.requirements!=null&&t.hasOwnProperty("requirements")&&(o.requirements=n.keyhole.dbroot.RequirementProto.toObject(t.requirements,e)),t.alleycatUrlTemplate!=null&&t.hasOwnProperty("alleycatUrlTemplate")&&(o.alleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.alleycatUrlTemplate,e)),t.metadataUrlTemplate!=null&&t.hasOwnProperty("metadataUrlTemplate")&&(o.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.metadataUrlTemplate,e)),t.thumbnailUrlTemplate!=null&&t.hasOwnProperty("thumbnailUrlTemplate")&&(o.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.thumbnailUrlTemplate,e)),t.kmlUrlTemplate!=null&&t.hasOwnProperty("kmlUrlTemplate")&&(o.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.kmlUrlTemplate,e)),t.featuredToursUrl!=null&&t.hasOwnProperty("featuredToursUrl")&&(o.featuredToursUrl=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.featuredToursUrl,e)),t.enableViewportFallback!=null&&t.hasOwnProperty("enableViewportFallback")&&(o.enableViewportFallback=t.enableViewportFallback),t.viewportFallbackDistance!=null&&t.hasOwnProperty("viewportFallbackDistance")&&(o.viewportFallbackDistance=t.viewportFallbackDistance),t.fallbackAlleycatUrlTemplate!=null&&t.hasOwnProperty("fallbackAlleycatUrlTemplate")&&(o.fallbackAlleycatUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.fallbackAlleycatUrlTemplate,e)),t.imageryType&&t.imageryType.length){o.imageryType=[];for(var a=0;a<t.imageryType.length;++a)o.imageryType[a]=n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.toObject(t.imageryType[a],e)}return o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.FilmstripConfigProto"},l.AlleycatImageryTypeProto=(function(){function r(t){if(t)for(var e=Object.keys(t),o=0;o<e.length;++o)t[e[o]]!=null&&(this[e[o]]=t[e[o]])}return r.prototype.imageryTypeId=0,r.prototype.imageryTypeLabel="",r.prototype.metadataUrlTemplate=null,r.prototype.thumbnailUrlTemplate=null,r.prototype.kmlUrlTemplate=null,r.decode=function(e,o){e instanceof f||(e=f.create(e));for(var a=o===void 0?e.len:e.pos+o,p=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;e.pos<a;){var y=e.uint32();switch(y>>>3){case 1:{p.imageryTypeId=e.int32();break}case 2:{p.imageryTypeLabel=e.string();break}case 3:{p.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 4:{p.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}case 5:{p.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.decode(e,e.uint32());break}default:e.skipType(y&7);break}}return p},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.imageryTypeId!=null&&e.hasOwnProperty("imageryTypeId")&&!u.isInteger(e.imageryTypeId))return"imageryTypeId: integer expected";if(e.imageryTypeLabel!=null&&e.hasOwnProperty("imageryTypeLabel")&&!u.isString(e.imageryTypeLabel))return"imageryTypeLabel: string expected";if(e.metadataUrlTemplate!=null&&e.hasOwnProperty("metadataUrlTemplate")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.metadataUrlTemplate);if(o)return"metadataUrlTemplate."+o}if(e.thumbnailUrlTemplate!=null&&e.hasOwnProperty("thumbnailUrlTemplate")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.thumbnailUrlTemplate);if(o)return"thumbnailUrlTemplate."+o}if(e.kmlUrlTemplate!=null&&e.hasOwnProperty("kmlUrlTemplate")){var o=n.keyhole.dbroot.StringIdOrValueProto.verify(e.kmlUrlTemplate);if(o)return"kmlUrlTemplate."+o}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)return e;var o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;if(e.imageryTypeId!=null&&(o.imageryTypeId=e.imageryTypeId|0),e.imageryTypeLabel!=null&&(o.imageryTypeLabel=String(e.imageryTypeLabel)),e.metadataUrlTemplate!=null){if(typeof e.metadataUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected");o.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.metadataUrlTemplate)}if(e.thumbnailUrlTemplate!=null){if(typeof e.thumbnailUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected");o.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.thumbnailUrlTemplate)}if(e.kmlUrlTemplate!=null){if(typeof e.kmlUrlTemplate!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected");o.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.fromObject(e.kmlUrlTemplate)}return o},r.toObject=function(e,o){o||(o={});var a={};return o.defaults&&(a.imageryTypeId=0,a.imageryTypeLabel="",a.metadataUrlTemplate=null,a.thumbnailUrlTemplate=null,a.kmlUrlTemplate=null),e.imageryTypeId!=null&&e.hasOwnProperty("imageryTypeId")&&(a.imageryTypeId=e.imageryTypeId),e.imageryTypeLabel!=null&&e.hasOwnProperty("imageryTypeLabel")&&(a.imageryTypeLabel=e.imageryTypeLabel),e.metadataUrlTemplate!=null&&e.hasOwnProperty("metadataUrlTemplate")&&(a.metadataUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.metadataUrlTemplate,o)),e.thumbnailUrlTemplate!=null&&e.hasOwnProperty("thumbnailUrlTemplate")&&(a.thumbnailUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.thumbnailUrlTemplate,o)),e.kmlUrlTemplate!=null&&e.hasOwnProperty("kmlUrlTemplate")&&(a.kmlUrlTemplate=n.keyhole.dbroot.StringIdOrValueProto.toObject(e.kmlUrlTemplate,o)),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto"},r})(),l})(),i.StarDataProto=(function(){function l(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)r[t[e]]!=null&&(this[t[e]]=r[t[e]])}return l.prototype.url=null,l.decode=function(t,e){t instanceof f||(t=f.create(t));for(var o=e===void 0?t.len:t.pos+e,a=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;t.pos<o;){var p=t.uint32();p>>>3===1?a.url=n.keyhole.dbroot.StringIdOrValueProto.decode(t,t.uint32()):t.skipType(p&7)}return a},l.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.url!=null&&t.hasOwnProperty("url")){var e=n.keyhole.dbroot.StringIdOrValueProto.verify(t.url);if(e)return"url."+e}return null},l.fromObject=function(t){if(t instanceof n.keyhole.dbroot.EndSnippetProto.StarDataProto)return t;var e=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;if(t.url!=null){if(typeof t.url!="object")throw TypeError(".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected");e.url=n.keyhole.dbroot.StringIdOrValueProto.fromObject(t.url)}return e},l.toObject=function(t,e){e||(e={});var o={};return e.defaults&&(o.url=null),t.url!=null&&t.hasOwnProperty("url")&&(o.url=n.keyhole.dbroot.StringIdOrValueProto.toObject(t.url,e)),o},l.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},l.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/keyhole.dbroot.EndSnippetProto.StarDataProto"},l})(),i})(),c.DbRootRefProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.url="",i.prototype.isCritical=!1,i.prototype.requirements=null,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DbRootRefProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 2:{o.url=r.string();break}case 1:{o.isCritical=r.bool();break}case 3:{o.requirements=n.keyhole.dbroot.RequirementProto.decode(r,r.uint32());break}default:r.skipType(a&7);break}}if(!o.hasOwnProperty("url"))throw u.ProtocolError("missing required 'url'",{instance:o});return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(!u.isString(r.url))return"url: string expected";if(r.isCritical!=null&&r.hasOwnProperty("isCritical")&&typeof r.isCritical!="boolean")return"isCritical: boolean expected";if(r.requirements!=null&&r.hasOwnProperty("requirements")){var t=n.keyhole.dbroot.RequirementProto.verify(r.requirements);if(t)return"requirements."+t}return null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DbRootRefProto)return r;var t=new n.keyhole.dbroot.DbRootRefProto;if(r.url!=null&&(t.url=String(r.url)),r.isCritical!=null&&(t.isCritical=!!r.isCritical),r.requirements!=null){if(typeof r.requirements!="object")throw TypeError(".keyhole.dbroot.DbRootRefProto.requirements: object expected");t.requirements=n.keyhole.dbroot.RequirementProto.fromObject(r.requirements)}return t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.isCritical=!1,e.url="",e.requirements=null),r.isCritical!=null&&r.hasOwnProperty("isCritical")&&(e.isCritical=r.isCritical),r.url!=null&&r.hasOwnProperty("url")&&(e.url=r.url),r.requirements!=null&&r.hasOwnProperty("requirements")&&(e.requirements=n.keyhole.dbroot.RequirementProto.toObject(r.requirements,t)),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DbRootRefProto"},i})(),c.DatabaseVersionProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.quadtreeVersion=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DatabaseVersionProto;r.pos<e;){var a=r.uint32();a>>>3===1?o.quadtreeVersion=r.uint32():r.skipType(a&7)}if(!o.hasOwnProperty("quadtreeVersion"))throw u.ProtocolError("missing required 'quadtreeVersion'",{instance:o});return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":u.isInteger(r.quadtreeVersion)?null:"quadtreeVersion: integer expected"},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DatabaseVersionProto)return r;var t=new n.keyhole.dbroot.DatabaseVersionProto;return r.quadtreeVersion!=null&&(t.quadtreeVersion=r.quadtreeVersion>>>0),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.quadtreeVersion=0),r.quadtreeVersion!=null&&r.hasOwnProperty("quadtreeVersion")&&(e.quadtreeVersion=r.quadtreeVersion),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DatabaseVersionProto"},i})(),c.DbRootProto=(function(){function i(l){if(this.providerInfo=[],this.nestedFeature=[],this.styleAttribute=[],this.styleMap=[],this.translationEntry=[],this.dbrootReference=[],l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.databaseName=null,i.prototype.imageryPresent=!0,i.prototype.protoImagery=!1,i.prototype.terrainPresent=!1,i.prototype.providerInfo=u.emptyArray,i.prototype.nestedFeature=u.emptyArray,i.prototype.styleAttribute=u.emptyArray,i.prototype.styleMap=u.emptyArray,i.prototype.endSnippet=null,i.prototype.translationEntry=u.emptyArray,i.prototype.language="en",i.prototype.version=5,i.prototype.dbrootReference=u.emptyArray,i.prototype.databaseVersion=null,i.prototype.refreshTimeout=0,i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.DbRootProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 15:{o.databaseName=n.keyhole.dbroot.StringIdOrValueProto.decode(r,r.uint32());break}case 1:{o.imageryPresent=r.bool();break}case 14:{o.protoImagery=r.bool();break}case 2:{o.terrainPresent=r.bool();break}case 3:{o.providerInfo&&o.providerInfo.length||(o.providerInfo=[]),o.providerInfo.push(n.keyhole.dbroot.ProviderInfoProto.decode(r,r.uint32()));break}case 4:{o.nestedFeature&&o.nestedFeature.length||(o.nestedFeature=[]),o.nestedFeature.push(n.keyhole.dbroot.NestedFeatureProto.decode(r,r.uint32()));break}case 5:{o.styleAttribute&&o.styleAttribute.length||(o.styleAttribute=[]),o.styleAttribute.push(n.keyhole.dbroot.StyleAttributeProto.decode(r,r.uint32()));break}case 6:{o.styleMap&&o.styleMap.length||(o.styleMap=[]),o.styleMap.push(n.keyhole.dbroot.StyleMapProto.decode(r,r.uint32()));break}case 7:{o.endSnippet=n.keyhole.dbroot.EndSnippetProto.decode(r,r.uint32());break}case 8:{o.translationEntry&&o.translationEntry.length||(o.translationEntry=[]),o.translationEntry.push(n.keyhole.dbroot.StringEntryProto.decode(r,r.uint32()));break}case 9:{o.language=r.string();break}case 10:{o.version=r.int32();break}case 11:{o.dbrootReference&&o.dbrootReference.length||(o.dbrootReference=[]),o.dbrootReference.push(n.keyhole.dbroot.DbRootRefProto.decode(r,r.uint32()));break}case 13:{o.databaseVersion=n.keyhole.dbroot.DatabaseVersionProto.decode(r,r.uint32());break}case 16:{o.refreshTimeout=r.int32();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.databaseName!=null&&r.hasOwnProperty("databaseName")){var t=n.keyhole.dbroot.StringIdOrValueProto.verify(r.databaseName);if(t)return"databaseName."+t}if(r.imageryPresent!=null&&r.hasOwnProperty("imageryPresent")&&typeof r.imageryPresent!="boolean")return"imageryPresent: boolean expected";if(r.protoImagery!=null&&r.hasOwnProperty("protoImagery")&&typeof r.protoImagery!="boolean")return"protoImagery: boolean expected";if(r.terrainPresent!=null&&r.hasOwnProperty("terrainPresent")&&typeof r.terrainPresent!="boolean")return"terrainPresent: boolean expected";if(r.providerInfo!=null&&r.hasOwnProperty("providerInfo")){if(!Array.isArray(r.providerInfo))return"providerInfo: array expected";for(var e=0;e<r.providerInfo.length;++e){var t=n.keyhole.dbroot.ProviderInfoProto.verify(r.providerInfo[e]);if(t)return"providerInfo."+t}}if(r.nestedFeature!=null&&r.hasOwnProperty("nestedFeature")){if(!Array.isArray(r.nestedFeature))return"nestedFeature: array expected";for(var e=0;e<r.nestedFeature.length;++e){var t=n.keyhole.dbroot.NestedFeatureProto.verify(r.nestedFeature[e]);if(t)return"nestedFeature."+t}}if(r.styleAttribute!=null&&r.hasOwnProperty("styleAttribute")){if(!Array.isArray(r.styleAttribute))return"styleAttribute: array expected";for(var e=0;e<r.styleAttribute.length;++e){var t=n.keyhole.dbroot.StyleAttributeProto.verify(r.styleAttribute[e]);if(t)return"styleAttribute."+t}}if(r.styleMap!=null&&r.hasOwnProperty("styleMap")){if(!Array.isArray(r.styleMap))return"styleMap: array expected";for(var e=0;e<r.styleMap.length;++e){var t=n.keyhole.dbroot.StyleMapProto.verify(r.styleMap[e]);if(t)return"styleMap."+t}}if(r.endSnippet!=null&&r.hasOwnProperty("endSnippet")){var t=n.keyhole.dbroot.EndSnippetProto.verify(r.endSnippet);if(t)return"endSnippet."+t}if(r.translationEntry!=null&&r.hasOwnProperty("translationEntry")){if(!Array.isArray(r.translationEntry))return"translationEntry: array expected";for(var e=0;e<r.translationEntry.length;++e){var t=n.keyhole.dbroot.StringEntryProto.verify(r.translationEntry[e]);if(t)return"translationEntry."+t}}if(r.language!=null&&r.hasOwnProperty("language")&&!u.isString(r.language))return"language: string expected";if(r.version!=null&&r.hasOwnProperty("version")&&!u.isInteger(r.version))return"version: integer expected";if(r.dbrootReference!=null&&r.hasOwnProperty("dbrootReference")){if(!Array.isArray(r.dbrootReference))return"dbrootReference: array expected";for(var e=0;e<r.dbrootReference.length;++e){var t=n.keyhole.dbroot.DbRootRefProto.verify(r.dbrootReference[e]);if(t)return"dbrootReference."+t}}if(r.databaseVersion!=null&&r.hasOwnProperty("databaseVersion")){var t=n.keyhole.dbroot.DatabaseVersionProto.verify(r.databaseVersion);if(t)return"databaseVersion."+t}return r.refreshTimeout!=null&&r.hasOwnProperty("refreshTimeout")&&!u.isInteger(r.refreshTimeout)?"refreshTimeout: integer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.DbRootProto)return r;var t=new n.keyhole.dbroot.DbRootProto;if(r.databaseName!=null){if(typeof r.databaseName!="object")throw TypeError(".keyhole.dbroot.DbRootProto.databaseName: object expected");t.databaseName=n.keyhole.dbroot.StringIdOrValueProto.fromObject(r.databaseName)}if(r.imageryPresent!=null&&(t.imageryPresent=!!r.imageryPresent),r.protoImagery!=null&&(t.protoImagery=!!r.protoImagery),r.terrainPresent!=null&&(t.terrainPresent=!!r.terrainPresent),r.providerInfo){if(!Array.isArray(r.providerInfo))throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: array expected");t.providerInfo=[];for(var e=0;e<r.providerInfo.length;++e){if(typeof r.providerInfo[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: object expected");t.providerInfo[e]=n.keyhole.dbroot.ProviderInfoProto.fromObject(r.providerInfo[e])}}if(r.nestedFeature){if(!Array.isArray(r.nestedFeature))throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: array expected");t.nestedFeature=[];for(var e=0;e<r.nestedFeature.length;++e){if(typeof r.nestedFeature[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: object expected");t.nestedFeature[e]=n.keyhole.dbroot.NestedFeatureProto.fromObject(r.nestedFeature[e])}}if(r.styleAttribute){if(!Array.isArray(r.styleAttribute))throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: array expected");t.styleAttribute=[];for(var e=0;e<r.styleAttribute.length;++e){if(typeof r.styleAttribute[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: object expected");t.styleAttribute[e]=n.keyhole.dbroot.StyleAttributeProto.fromObject(r.styleAttribute[e])}}if(r.styleMap){if(!Array.isArray(r.styleMap))throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: array expected");t.styleMap=[];for(var e=0;e<r.styleMap.length;++e){if(typeof r.styleMap[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: object expected");t.styleMap[e]=n.keyhole.dbroot.StyleMapProto.fromObject(r.styleMap[e])}}if(r.endSnippet!=null){if(typeof r.endSnippet!="object")throw TypeError(".keyhole.dbroot.DbRootProto.endSnippet: object expected");t.endSnippet=n.keyhole.dbroot.EndSnippetProto.fromObject(r.endSnippet)}if(r.translationEntry){if(!Array.isArray(r.translationEntry))throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: array expected");t.translationEntry=[];for(var e=0;e<r.translationEntry.length;++e){if(typeof r.translationEntry[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: object expected");t.translationEntry[e]=n.keyhole.dbroot.StringEntryProto.fromObject(r.translationEntry[e])}}if(r.language!=null&&(t.language=String(r.language)),r.version!=null&&(t.version=r.version|0),r.dbrootReference){if(!Array.isArray(r.dbrootReference))throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: array expected");t.dbrootReference=[];for(var e=0;e<r.dbrootReference.length;++e){if(typeof r.dbrootReference[e]!="object")throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: object expected");t.dbrootReference[e]=n.keyhole.dbroot.DbRootRefProto.fromObject(r.dbrootReference[e])}}if(r.databaseVersion!=null){if(typeof r.databaseVersion!="object")throw TypeError(".keyhole.dbroot.DbRootProto.databaseVersion: object expected");t.databaseVersion=n.keyhole.dbroot.DatabaseVersionProto.fromObject(r.databaseVersion)}return r.refreshTimeout!=null&&(t.refreshTimeout=r.refreshTimeout|0),t},i.toObject=function(r,t){t||(t={});var e={};if((t.arrays||t.defaults)&&(e.providerInfo=[],e.nestedFeature=[],e.styleAttribute=[],e.styleMap=[],e.translationEntry=[],e.dbrootReference=[]),t.defaults&&(e.imageryPresent=!0,e.terrainPresent=!1,e.endSnippet=null,e.language="en",e.version=5,e.databaseVersion=null,e.protoImagery=!1,e.databaseName=null,e.refreshTimeout=0),r.imageryPresent!=null&&r.hasOwnProperty("imageryPresent")&&(e.imageryPresent=r.imageryPresent),r.terrainPresent!=null&&r.hasOwnProperty("terrainPresent")&&(e.terrainPresent=r.terrainPresent),r.providerInfo&&r.providerInfo.length){e.providerInfo=[];for(var o=0;o<r.providerInfo.length;++o)e.providerInfo[o]=n.keyhole.dbroot.ProviderInfoProto.toObject(r.providerInfo[o],t)}if(r.nestedFeature&&r.nestedFeature.length){e.nestedFeature=[];for(var o=0;o<r.nestedFeature.length;++o)e.nestedFeature[o]=n.keyhole.dbroot.NestedFeatureProto.toObject(r.nestedFeature[o],t)}if(r.styleAttribute&&r.styleAttribute.length){e.styleAttribute=[];for(var o=0;o<r.styleAttribute.length;++o)e.styleAttribute[o]=n.keyhole.dbroot.StyleAttributeProto.toObject(r.styleAttribute[o],t)}if(r.styleMap&&r.styleMap.length){e.styleMap=[];for(var o=0;o<r.styleMap.length;++o)e.styleMap[o]=n.keyhole.dbroot.StyleMapProto.toObject(r.styleMap[o],t)}if(r.endSnippet!=null&&r.hasOwnProperty("endSnippet")&&(e.endSnippet=n.keyhole.dbroot.EndSnippetProto.toObject(r.endSnippet,t)),r.translationEntry&&r.translationEntry.length){e.translationEntry=[];for(var o=0;o<r.translationEntry.length;++o)e.translationEntry[o]=n.keyhole.dbroot.StringEntryProto.toObject(r.translationEntry[o],t)}if(r.language!=null&&r.hasOwnProperty("language")&&(e.language=r.language),r.version!=null&&r.hasOwnProperty("version")&&(e.version=r.version),r.dbrootReference&&r.dbrootReference.length){e.dbrootReference=[];for(var o=0;o<r.dbrootReference.length;++o)e.dbrootReference[o]=n.keyhole.dbroot.DbRootRefProto.toObject(r.dbrootReference[o],t)}return r.databaseVersion!=null&&r.hasOwnProperty("databaseVersion")&&(e.databaseVersion=n.keyhole.dbroot.DatabaseVersionProto.toObject(r.databaseVersion,t)),r.protoImagery!=null&&r.hasOwnProperty("protoImagery")&&(e.protoImagery=r.protoImagery),r.databaseName!=null&&r.hasOwnProperty("databaseName")&&(e.databaseName=n.keyhole.dbroot.StringIdOrValueProto.toObject(r.databaseName,t)),r.refreshTimeout!=null&&r.hasOwnProperty("refreshTimeout")&&(e.refreshTimeout=r.refreshTimeout),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.DbRootProto"},i})(),c.EncryptedDbRootProto=(function(){function i(l){if(l)for(var r=Object.keys(l),t=0;t<r.length;++t)l[r[t]]!=null&&(this[r[t]]=l[r[t]])}return i.prototype.encryptionType=0,i.prototype.encryptionData=u.newBuffer([]),i.prototype.dbrootData=u.newBuffer([]),i.decode=function(r,t){r instanceof f||(r=f.create(r));for(var e=t===void 0?r.len:r.pos+t,o=new n.keyhole.dbroot.EncryptedDbRootProto;r.pos<e;){var a=r.uint32();switch(a>>>3){case 1:{o.encryptionType=r.int32();break}case 2:{o.encryptionData=r.bytes();break}case 3:{o.dbrootData=r.bytes();break}default:r.skipType(a&7);break}}return o},i.verify=function(r){return typeof r!="object"||r===null?"object expected":r.encryptionType!=null&&r.hasOwnProperty("encryptionType")&&r.encryptionType!==0?"encryptionType: enum value expected":r.encryptionData!=null&&r.hasOwnProperty("encryptionData")&&!(r.encryptionData&&typeof r.encryptionData.length=="number"||u.isString(r.encryptionData))?"encryptionData: buffer expected":r.dbrootData!=null&&r.hasOwnProperty("dbrootData")&&!(r.dbrootData&&typeof r.dbrootData.length=="number"||u.isString(r.dbrootData))?"dbrootData: buffer expected":null},i.fromObject=function(r){if(r instanceof n.keyhole.dbroot.EncryptedDbRootProto)return r;var t=new n.keyhole.dbroot.EncryptedDbRootProto;switch(r.encryptionType){case"ENCRYPTION_XOR":case 0:t.encryptionType=0;break}return r.encryptionData!=null&&(typeof r.encryptionData=="string"?u.base64.decode(r.encryptionData,t.encryptionData=u.newBuffer(u.base64.length(r.encryptionData)),0):r.encryptionData.length>=0&&(t.encryptionData=r.encryptionData)),r.dbrootData!=null&&(typeof r.dbrootData=="string"?u.base64.decode(r.dbrootData,t.dbrootData=u.newBuffer(u.base64.length(r.dbrootData)),0):r.dbrootData.length>=0&&(t.dbrootData=r.dbrootData)),t},i.toObject=function(r,t){t||(t={});var e={};return t.defaults&&(e.encryptionType=t.enums===String?"ENCRYPTION_XOR":0,t.bytes===String?e.encryptionData="":(e.encryptionData=[],t.bytes!==Array&&(e.encryptionData=u.newBuffer(e.encryptionData))),t.bytes===String?e.dbrootData="":(e.dbrootData=[],t.bytes!==Array&&(e.dbrootData=u.newBuffer(e.dbrootData)))),r.encryptionType!=null&&r.hasOwnProperty("encryptionType")&&(e.encryptionType=t.enums===String?n.keyhole.dbroot.EncryptedDbRootProto.EncryptionType[r.encryptionType]:r.encryptionType),r.encryptionData!=null&&r.hasOwnProperty("encryptionData")&&(e.encryptionData=t.bytes===String?u.base64.encode(r.encryptionData,0,r.encryptionData.length):t.bytes===Array?Array.prototype.slice.call(r.encryptionData):r.encryptionData),r.dbrootData!=null&&r.hasOwnProperty("dbrootData")&&(e.dbrootData=t.bytes===String?u.base64.encode(r.dbrootData,0,r.dbrootData.length):t.bytes===Array?Array.prototype.slice.call(r.dbrootData):r.dbrootData),e},i.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},i.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/keyhole.dbroot.EncryptedDbRootProto"},i.EncryptionType=(function(){var l={},r=Object.create(l);return r[l[0]="ENCRYPTION_XOR"]=0,r})(),i})(),c})(),b})(),n.keyhole.dbroot};})(); //# sourceMappingURL=google-earth-dbroot-parser.js.map diff --git a/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js.map b/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js.map index c8bd5bc30..1b8b4ff28 100644 --- a/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js.map +++ b/plugins/feature/map/Cesium/ThirdParty/google-earth-dbroot-parser.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../packages/engine/Source/ThirdParty/google-earth-dbroot-parser.js"], "sourcesContent": ["window.cesiumGoogleEarthDbRootParser = function(\r\n $protobuf) {\r\n /* jshint curly: false, sub: true, newcap: false, shadow: true, unused: false*/\r\n 'use strict';\r\n\r\n //\r\n // Creates a parser for a dbroot protocol buffer\r\n // Below code is generated using protobufjs with the following command\r\n //\r\n // ./pbjs --no-encode --no-create --no-comments --no-delimited -w amd -t static dbroot_v2.proto\r\n //\r\n // .proto file can be found here: https://github.com/google/earthenterprise/blob/master/earth_enterprise/src/keyhole/proto/dbroot/dbroot_v2.proto\r\n var $Reader = $protobuf.Reader, $util = $protobuf.util;\r\n\r\n var $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\r\n \r\n $root.keyhole = (function() {\r\n \r\n var keyhole = {};\r\n \r\n keyhole.dbroot = (function() {\r\n \r\n var dbroot = {};\r\n \r\n dbroot.StringEntryProto = (function() {\r\n \r\n function StringEntryProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n StringEntryProto.prototype.stringId = 0;\r\n StringEntryProto.prototype.stringValue = \"\";\r\n \r\n StringEntryProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StringEntryProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.stringId = reader.fixed32();\r\n break;\r\n }\r\n case 2: {\r\n message.stringValue = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"stringId\"))\r\n throw $util.ProtocolError(\"missing required 'stringId'\", { instance: message });\r\n if (!message.hasOwnProperty(\"stringValue\"))\r\n throw $util.ProtocolError(\"missing required 'stringValue'\", { instance: message });\r\n return message;\r\n };\r\n \r\n StringEntryProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isInteger(message.stringId))\r\n return \"stringId: integer expected\";\r\n if (!$util.isString(message.stringValue))\r\n return \"stringValue: string expected\";\r\n return null;\r\n };\r\n \r\n StringEntryProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.StringEntryProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.StringEntryProto();\r\n if (object.stringId != null)\r\n message.stringId = object.stringId >>> 0;\r\n if (object.stringValue != null)\r\n message.stringValue = String(object.stringValue);\r\n return message;\r\n };\r\n \r\n StringEntryProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.stringId = 0;\r\n object.stringValue = \"\";\r\n }\r\n if (message.stringId != null && message.hasOwnProperty(\"stringId\"))\r\n object.stringId = message.stringId;\r\n if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\r\n object.stringValue = message.stringValue;\r\n return object;\r\n };\r\n \r\n StringEntryProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n StringEntryProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.StringEntryProto\";\r\n };\r\n \r\n return StringEntryProto;\r\n })();\r\n \r\n dbroot.StringIdOrValueProto = (function() {\r\n \r\n function StringIdOrValueProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n StringIdOrValueProto.prototype.stringId = 0;\r\n StringIdOrValueProto.prototype.value = \"\";\r\n \r\n StringIdOrValueProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StringIdOrValueProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.stringId = reader.fixed32();\r\n break;\r\n }\r\n case 2: {\r\n message.value = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n StringIdOrValueProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.stringId != null && message.hasOwnProperty(\"stringId\"))\r\n if (!$util.isInteger(message.stringId))\r\n return \"stringId: integer expected\";\r\n if (message.value != null && message.hasOwnProperty(\"value\"))\r\n if (!$util.isString(message.value))\r\n return \"value: string expected\";\r\n return null;\r\n };\r\n \r\n StringIdOrValueProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.StringIdOrValueProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.StringIdOrValueProto();\r\n if (object.stringId != null)\r\n message.stringId = object.stringId >>> 0;\r\n if (object.value != null)\r\n message.value = String(object.value);\r\n return message;\r\n };\r\n \r\n StringIdOrValueProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.stringId = 0;\r\n object.value = \"\";\r\n }\r\n if (message.stringId != null && message.hasOwnProperty(\"stringId\"))\r\n object.stringId = message.stringId;\r\n if (message.value != null && message.hasOwnProperty(\"value\"))\r\n object.value = message.value;\r\n return object;\r\n };\r\n \r\n StringIdOrValueProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n StringIdOrValueProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.StringIdOrValueProto\";\r\n };\r\n \r\n return StringIdOrValueProto;\r\n })();\r\n \r\n dbroot.PlanetModelProto = (function() {\r\n \r\n function PlanetModelProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n PlanetModelProto.prototype.radius = 6378.137;\r\n PlanetModelProto.prototype.flattening = 0.00335281066474748;\r\n PlanetModelProto.prototype.elevationBias = 0;\r\n PlanetModelProto.prototype.negativeAltitudeExponentBias = 0;\r\n PlanetModelProto.prototype.compressedNegativeAltitudeThreshold = 0;\r\n \r\n PlanetModelProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.PlanetModelProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.radius = reader.double();\r\n break;\r\n }\r\n case 2: {\r\n message.flattening = reader.double();\r\n break;\r\n }\r\n case 4: {\r\n message.elevationBias = reader.double();\r\n break;\r\n }\r\n case 5: {\r\n message.negativeAltitudeExponentBias = reader.int32();\r\n break;\r\n }\r\n case 6: {\r\n message.compressedNegativeAltitudeThreshold = reader.double();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n PlanetModelProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.radius != null && message.hasOwnProperty(\"radius\"))\r\n if (typeof message.radius !== \"number\")\r\n return \"radius: number expected\";\r\n if (message.flattening != null && message.hasOwnProperty(\"flattening\"))\r\n if (typeof message.flattening !== \"number\")\r\n return \"flattening: number expected\";\r\n if (message.elevationBias != null && message.hasOwnProperty(\"elevationBias\"))\r\n if (typeof message.elevationBias !== \"number\")\r\n return \"elevationBias: number expected\";\r\n if (message.negativeAltitudeExponentBias != null && message.hasOwnProperty(\"negativeAltitudeExponentBias\"))\r\n if (!$util.isInteger(message.negativeAltitudeExponentBias))\r\n return \"negativeAltitudeExponentBias: integer expected\";\r\n if (message.compressedNegativeAltitudeThreshold != null && message.hasOwnProperty(\"compressedNegativeAltitudeThreshold\"))\r\n if (typeof message.compressedNegativeAltitudeThreshold !== \"number\")\r\n return \"compressedNegativeAltitudeThreshold: number expected\";\r\n return null;\r\n };\r\n \r\n PlanetModelProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.PlanetModelProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.PlanetModelProto();\r\n if (object.radius != null)\r\n message.radius = Number(object.radius);\r\n if (object.flattening != null)\r\n message.flattening = Number(object.flattening);\r\n if (object.elevationBias != null)\r\n message.elevationBias = Number(object.elevationBias);\r\n if (object.negativeAltitudeExponentBias != null)\r\n message.negativeAltitudeExponentBias = object.negativeAltitudeExponentBias | 0;\r\n if (object.compressedNegativeAltitudeThreshold != null)\r\n message.compressedNegativeAltitudeThreshold = Number(object.compressedNegativeAltitudeThreshold);\r\n return message;\r\n };\r\n \r\n PlanetModelProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.radius = 6378.137;\r\n object.flattening = 0.00335281066474748;\r\n object.elevationBias = 0;\r\n object.negativeAltitudeExponentBias = 0;\r\n object.compressedNegativeAltitudeThreshold = 0;\r\n }\r\n if (message.radius != null && message.hasOwnProperty(\"radius\"))\r\n object.radius = options.json && !isFinite(message.radius) ? String(message.radius) : message.radius;\r\n if (message.flattening != null && message.hasOwnProperty(\"flattening\"))\r\n object.flattening = options.json && !isFinite(message.flattening) ? String(message.flattening) : message.flattening;\r\n if (message.elevationBias != null && message.hasOwnProperty(\"elevationBias\"))\r\n object.elevationBias = options.json && !isFinite(message.elevationBias) ? String(message.elevationBias) : message.elevationBias;\r\n if (message.negativeAltitudeExponentBias != null && message.hasOwnProperty(\"negativeAltitudeExponentBias\"))\r\n object.negativeAltitudeExponentBias = message.negativeAltitudeExponentBias;\r\n if (message.compressedNegativeAltitudeThreshold != null && message.hasOwnProperty(\"compressedNegativeAltitudeThreshold\"))\r\n object.compressedNegativeAltitudeThreshold = options.json && !isFinite(message.compressedNegativeAltitudeThreshold) ? String(message.compressedNegativeAltitudeThreshold) : message.compressedNegativeAltitudeThreshold;\r\n return object;\r\n };\r\n \r\n PlanetModelProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n PlanetModelProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.PlanetModelProto\";\r\n };\r\n \r\n return PlanetModelProto;\r\n })();\r\n \r\n dbroot.ProviderInfoProto = (function() {\r\n \r\n function ProviderInfoProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n ProviderInfoProto.prototype.providerId = 0;\r\n ProviderInfoProto.prototype.copyrightString = null;\r\n ProviderInfoProto.prototype.verticalPixelOffset = -1;\r\n \r\n ProviderInfoProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ProviderInfoProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.providerId = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n message.copyrightString = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.verticalPixelOffset = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"providerId\"))\r\n throw $util.ProtocolError(\"missing required 'providerId'\", { instance: message });\r\n return message;\r\n };\r\n \r\n ProviderInfoProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isInteger(message.providerId))\r\n return \"providerId: integer expected\";\r\n if (message.copyrightString != null && message.hasOwnProperty(\"copyrightString\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.copyrightString);\r\n if (error)\r\n return \"copyrightString.\" + error;\r\n }\r\n if (message.verticalPixelOffset != null && message.hasOwnProperty(\"verticalPixelOffset\"))\r\n if (!$util.isInteger(message.verticalPixelOffset))\r\n return \"verticalPixelOffset: integer expected\";\r\n return null;\r\n };\r\n \r\n ProviderInfoProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ProviderInfoProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ProviderInfoProto();\r\n if (object.providerId != null)\r\n message.providerId = object.providerId | 0;\r\n if (object.copyrightString != null) {\r\n if (typeof object.copyrightString !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected\");\r\n message.copyrightString = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.copyrightString);\r\n }\r\n if (object.verticalPixelOffset != null)\r\n message.verticalPixelOffset = object.verticalPixelOffset | 0;\r\n return message;\r\n };\r\n \r\n ProviderInfoProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.providerId = 0;\r\n object.copyrightString = null;\r\n object.verticalPixelOffset = -1;\r\n }\r\n if (message.providerId != null && message.hasOwnProperty(\"providerId\"))\r\n object.providerId = message.providerId;\r\n if (message.copyrightString != null && message.hasOwnProperty(\"copyrightString\"))\r\n object.copyrightString = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.copyrightString, options);\r\n if (message.verticalPixelOffset != null && message.hasOwnProperty(\"verticalPixelOffset\"))\r\n object.verticalPixelOffset = message.verticalPixelOffset;\r\n return object;\r\n };\r\n \r\n ProviderInfoProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n ProviderInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ProviderInfoProto\";\r\n };\r\n \r\n return ProviderInfoProto;\r\n })();\r\n \r\n dbroot.PopUpProto = (function() {\r\n \r\n function PopUpProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n PopUpProto.prototype.isBalloonStyle = false;\r\n PopUpProto.prototype.text = null;\r\n PopUpProto.prototype.backgroundColorAbgr = 4294967295;\r\n PopUpProto.prototype.textColorAbgr = 4278190080;\r\n \r\n PopUpProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.PopUpProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.isBalloonStyle = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.text = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.backgroundColorAbgr = reader.fixed32();\r\n break;\r\n }\r\n case 4: {\r\n message.textColorAbgr = reader.fixed32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n PopUpProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.isBalloonStyle != null && message.hasOwnProperty(\"isBalloonStyle\"))\r\n if (typeof message.isBalloonStyle !== \"boolean\")\r\n return \"isBalloonStyle: boolean expected\";\r\n if (message.text != null && message.hasOwnProperty(\"text\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.text);\r\n if (error)\r\n return \"text.\" + error;\r\n }\r\n if (message.backgroundColorAbgr != null && message.hasOwnProperty(\"backgroundColorAbgr\"))\r\n if (!$util.isInteger(message.backgroundColorAbgr))\r\n return \"backgroundColorAbgr: integer expected\";\r\n if (message.textColorAbgr != null && message.hasOwnProperty(\"textColorAbgr\"))\r\n if (!$util.isInteger(message.textColorAbgr))\r\n return \"textColorAbgr: integer expected\";\r\n return null;\r\n };\r\n \r\n PopUpProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.PopUpProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.PopUpProto();\r\n if (object.isBalloonStyle != null)\r\n message.isBalloonStyle = Boolean(object.isBalloonStyle);\r\n if (object.text != null) {\r\n if (typeof object.text !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PopUpProto.text: object expected\");\r\n message.text = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.text);\r\n }\r\n if (object.backgroundColorAbgr != null)\r\n message.backgroundColorAbgr = object.backgroundColorAbgr >>> 0;\r\n if (object.textColorAbgr != null)\r\n message.textColorAbgr = object.textColorAbgr >>> 0;\r\n return message;\r\n };\r\n \r\n PopUpProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.isBalloonStyle = false;\r\n object.text = null;\r\n object.backgroundColorAbgr = 4294967295;\r\n object.textColorAbgr = 4278190080;\r\n }\r\n if (message.isBalloonStyle != null && message.hasOwnProperty(\"isBalloonStyle\"))\r\n object.isBalloonStyle = message.isBalloonStyle;\r\n if (message.text != null && message.hasOwnProperty(\"text\"))\r\n object.text = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.text, options);\r\n if (message.backgroundColorAbgr != null && message.hasOwnProperty(\"backgroundColorAbgr\"))\r\n object.backgroundColorAbgr = message.backgroundColorAbgr;\r\n if (message.textColorAbgr != null && message.hasOwnProperty(\"textColorAbgr\"))\r\n object.textColorAbgr = message.textColorAbgr;\r\n return object;\r\n };\r\n \r\n PopUpProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n PopUpProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.PopUpProto\";\r\n };\r\n \r\n return PopUpProto;\r\n })();\r\n \r\n dbroot.StyleAttributeProto = (function() {\r\n \r\n function StyleAttributeProto(properties) {\r\n this.drawFlag = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n StyleAttributeProto.prototype.styleId = \"\";\r\n StyleAttributeProto.prototype.providerId = 0;\r\n StyleAttributeProto.prototype.polyColorAbgr = 4294967295;\r\n StyleAttributeProto.prototype.lineColorAbgr = 4294967295;\r\n StyleAttributeProto.prototype.lineWidth = 1;\r\n StyleAttributeProto.prototype.labelColorAbgr = 4294967295;\r\n StyleAttributeProto.prototype.labelScale = 1;\r\n StyleAttributeProto.prototype.placemarkIconColorAbgr = 4294967295;\r\n StyleAttributeProto.prototype.placemarkIconScale = 1;\r\n StyleAttributeProto.prototype.placemarkIconPath = null;\r\n StyleAttributeProto.prototype.placemarkIconX = 0;\r\n StyleAttributeProto.prototype.placemarkIconY = 0;\r\n StyleAttributeProto.prototype.placemarkIconWidth = 32;\r\n StyleAttributeProto.prototype.placemarkIconHeight = 32;\r\n StyleAttributeProto.prototype.popUp = null;\r\n StyleAttributeProto.prototype.drawFlag = $util.emptyArray;\r\n \r\n StyleAttributeProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StyleAttributeProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.styleId = reader.string();\r\n break;\r\n }\r\n case 3: {\r\n message.providerId = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.polyColorAbgr = reader.fixed32();\r\n break;\r\n }\r\n case 5: {\r\n message.lineColorAbgr = reader.fixed32();\r\n break;\r\n }\r\n case 6: {\r\n message.lineWidth = reader.float();\r\n break;\r\n }\r\n case 7: {\r\n message.labelColorAbgr = reader.fixed32();\r\n break;\r\n }\r\n case 8: {\r\n message.labelScale = reader.float();\r\n break;\r\n }\r\n case 9: {\r\n message.placemarkIconColorAbgr = reader.fixed32();\r\n break;\r\n }\r\n case 10: {\r\n message.placemarkIconScale = reader.float();\r\n break;\r\n }\r\n case 11: {\r\n message.placemarkIconPath = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 12: {\r\n message.placemarkIconX = reader.int32();\r\n break;\r\n }\r\n case 13: {\r\n message.placemarkIconY = reader.int32();\r\n break;\r\n }\r\n case 14: {\r\n message.placemarkIconWidth = reader.int32();\r\n break;\r\n }\r\n case 15: {\r\n message.placemarkIconHeight = reader.int32();\r\n break;\r\n }\r\n case 16: {\r\n message.popUp = $root.keyhole.dbroot.PopUpProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 17: {\r\n if (!(message.drawFlag && message.drawFlag.length))\r\n message.drawFlag = [];\r\n message.drawFlag.push($root.keyhole.dbroot.DrawFlagProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"styleId\"))\r\n throw $util.ProtocolError(\"missing required 'styleId'\", { instance: message });\r\n return message;\r\n };\r\n \r\n StyleAttributeProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isString(message.styleId))\r\n return \"styleId: string expected\";\r\n if (message.providerId != null && message.hasOwnProperty(\"providerId\"))\r\n if (!$util.isInteger(message.providerId))\r\n return \"providerId: integer expected\";\r\n if (message.polyColorAbgr != null && message.hasOwnProperty(\"polyColorAbgr\"))\r\n if (!$util.isInteger(message.polyColorAbgr))\r\n return \"polyColorAbgr: integer expected\";\r\n if (message.lineColorAbgr != null && message.hasOwnProperty(\"lineColorAbgr\"))\r\n if (!$util.isInteger(message.lineColorAbgr))\r\n return \"lineColorAbgr: integer expected\";\r\n if (message.lineWidth != null && message.hasOwnProperty(\"lineWidth\"))\r\n if (typeof message.lineWidth !== \"number\")\r\n return \"lineWidth: number expected\";\r\n if (message.labelColorAbgr != null && message.hasOwnProperty(\"labelColorAbgr\"))\r\n if (!$util.isInteger(message.labelColorAbgr))\r\n return \"labelColorAbgr: integer expected\";\r\n if (message.labelScale != null && message.hasOwnProperty(\"labelScale\"))\r\n if (typeof message.labelScale !== \"number\")\r\n return \"labelScale: number expected\";\r\n if (message.placemarkIconColorAbgr != null && message.hasOwnProperty(\"placemarkIconColorAbgr\"))\r\n if (!$util.isInteger(message.placemarkIconColorAbgr))\r\n return \"placemarkIconColorAbgr: integer expected\";\r\n if (message.placemarkIconScale != null && message.hasOwnProperty(\"placemarkIconScale\"))\r\n if (typeof message.placemarkIconScale !== \"number\")\r\n return \"placemarkIconScale: number expected\";\r\n if (message.placemarkIconPath != null && message.hasOwnProperty(\"placemarkIconPath\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.placemarkIconPath);\r\n if (error)\r\n return \"placemarkIconPath.\" + error;\r\n }\r\n if (message.placemarkIconX != null && message.hasOwnProperty(\"placemarkIconX\"))\r\n if (!$util.isInteger(message.placemarkIconX))\r\n return \"placemarkIconX: integer expected\";\r\n if (message.placemarkIconY != null && message.hasOwnProperty(\"placemarkIconY\"))\r\n if (!$util.isInteger(message.placemarkIconY))\r\n return \"placemarkIconY: integer expected\";\r\n if (message.placemarkIconWidth != null && message.hasOwnProperty(\"placemarkIconWidth\"))\r\n if (!$util.isInteger(message.placemarkIconWidth))\r\n return \"placemarkIconWidth: integer expected\";\r\n if (message.placemarkIconHeight != null && message.hasOwnProperty(\"placemarkIconHeight\"))\r\n if (!$util.isInteger(message.placemarkIconHeight))\r\n return \"placemarkIconHeight: integer expected\";\r\n if (message.popUp != null && message.hasOwnProperty(\"popUp\")) {\r\n var error = $root.keyhole.dbroot.PopUpProto.verify(message.popUp);\r\n if (error)\r\n return \"popUp.\" + error;\r\n }\r\n if (message.drawFlag != null && message.hasOwnProperty(\"drawFlag\")) {\r\n if (!Array.isArray(message.drawFlag))\r\n return \"drawFlag: array expected\";\r\n for (var i = 0; i < message.drawFlag.length; ++i) {\r\n var error = $root.keyhole.dbroot.DrawFlagProto.verify(message.drawFlag[i]);\r\n if (error)\r\n return \"drawFlag.\" + error;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n StyleAttributeProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.StyleAttributeProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.StyleAttributeProto();\r\n if (object.styleId != null)\r\n message.styleId = String(object.styleId);\r\n if (object.providerId != null)\r\n message.providerId = object.providerId | 0;\r\n if (object.polyColorAbgr != null)\r\n message.polyColorAbgr = object.polyColorAbgr >>> 0;\r\n if (object.lineColorAbgr != null)\r\n message.lineColorAbgr = object.lineColorAbgr >>> 0;\r\n if (object.lineWidth != null)\r\n message.lineWidth = Number(object.lineWidth);\r\n if (object.labelColorAbgr != null)\r\n message.labelColorAbgr = object.labelColorAbgr >>> 0;\r\n if (object.labelScale != null)\r\n message.labelScale = Number(object.labelScale);\r\n if (object.placemarkIconColorAbgr != null)\r\n message.placemarkIconColorAbgr = object.placemarkIconColorAbgr >>> 0;\r\n if (object.placemarkIconScale != null)\r\n message.placemarkIconScale = Number(object.placemarkIconScale);\r\n if (object.placemarkIconPath != null) {\r\n if (typeof object.placemarkIconPath !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected\");\r\n message.placemarkIconPath = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.placemarkIconPath);\r\n }\r\n if (object.placemarkIconX != null)\r\n message.placemarkIconX = object.placemarkIconX | 0;\r\n if (object.placemarkIconY != null)\r\n message.placemarkIconY = object.placemarkIconY | 0;\r\n if (object.placemarkIconWidth != null)\r\n message.placemarkIconWidth = object.placemarkIconWidth | 0;\r\n if (object.placemarkIconHeight != null)\r\n message.placemarkIconHeight = object.placemarkIconHeight | 0;\r\n if (object.popUp != null) {\r\n if (typeof object.popUp !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.StyleAttributeProto.popUp: object expected\");\r\n message.popUp = $root.keyhole.dbroot.PopUpProto.fromObject(object.popUp);\r\n }\r\n if (object.drawFlag) {\r\n if (!Array.isArray(object.drawFlag))\r\n throw TypeError(\".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected\");\r\n message.drawFlag = [];\r\n for (var i = 0; i < object.drawFlag.length; ++i) {\r\n if (typeof object.drawFlag[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected\");\r\n message.drawFlag[i] = $root.keyhole.dbroot.DrawFlagProto.fromObject(object.drawFlag[i]);\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n StyleAttributeProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.drawFlag = [];\r\n if (options.defaults) {\r\n object.styleId = \"\";\r\n object.providerId = 0;\r\n object.polyColorAbgr = 4294967295;\r\n object.lineColorAbgr = 4294967295;\r\n object.lineWidth = 1;\r\n object.labelColorAbgr = 4294967295;\r\n object.labelScale = 1;\r\n object.placemarkIconColorAbgr = 4294967295;\r\n object.placemarkIconScale = 1;\r\n object.placemarkIconPath = null;\r\n object.placemarkIconX = 0;\r\n object.placemarkIconY = 0;\r\n object.placemarkIconWidth = 32;\r\n object.placemarkIconHeight = 32;\r\n object.popUp = null;\r\n }\r\n if (message.styleId != null && message.hasOwnProperty(\"styleId\"))\r\n object.styleId = message.styleId;\r\n if (message.providerId != null && message.hasOwnProperty(\"providerId\"))\r\n object.providerId = message.providerId;\r\n if (message.polyColorAbgr != null && message.hasOwnProperty(\"polyColorAbgr\"))\r\n object.polyColorAbgr = message.polyColorAbgr;\r\n if (message.lineColorAbgr != null && message.hasOwnProperty(\"lineColorAbgr\"))\r\n object.lineColorAbgr = message.lineColorAbgr;\r\n if (message.lineWidth != null && message.hasOwnProperty(\"lineWidth\"))\r\n object.lineWidth = options.json && !isFinite(message.lineWidth) ? String(message.lineWidth) : message.lineWidth;\r\n if (message.labelColorAbgr != null && message.hasOwnProperty(\"labelColorAbgr\"))\r\n object.labelColorAbgr = message.labelColorAbgr;\r\n if (message.labelScale != null && message.hasOwnProperty(\"labelScale\"))\r\n object.labelScale = options.json && !isFinite(message.labelScale) ? String(message.labelScale) : message.labelScale;\r\n if (message.placemarkIconColorAbgr != null && message.hasOwnProperty(\"placemarkIconColorAbgr\"))\r\n object.placemarkIconColorAbgr = message.placemarkIconColorAbgr;\r\n if (message.placemarkIconScale != null && message.hasOwnProperty(\"placemarkIconScale\"))\r\n object.placemarkIconScale = options.json && !isFinite(message.placemarkIconScale) ? String(message.placemarkIconScale) : message.placemarkIconScale;\r\n if (message.placemarkIconPath != null && message.hasOwnProperty(\"placemarkIconPath\"))\r\n object.placemarkIconPath = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.placemarkIconPath, options);\r\n if (message.placemarkIconX != null && message.hasOwnProperty(\"placemarkIconX\"))\r\n object.placemarkIconX = message.placemarkIconX;\r\n if (message.placemarkIconY != null && message.hasOwnProperty(\"placemarkIconY\"))\r\n object.placemarkIconY = message.placemarkIconY;\r\n if (message.placemarkIconWidth != null && message.hasOwnProperty(\"placemarkIconWidth\"))\r\n object.placemarkIconWidth = message.placemarkIconWidth;\r\n if (message.placemarkIconHeight != null && message.hasOwnProperty(\"placemarkIconHeight\"))\r\n object.placemarkIconHeight = message.placemarkIconHeight;\r\n if (message.popUp != null && message.hasOwnProperty(\"popUp\"))\r\n object.popUp = $root.keyhole.dbroot.PopUpProto.toObject(message.popUp, options);\r\n if (message.drawFlag && message.drawFlag.length) {\r\n object.drawFlag = [];\r\n for (var j = 0; j < message.drawFlag.length; ++j)\r\n object.drawFlag[j] = $root.keyhole.dbroot.DrawFlagProto.toObject(message.drawFlag[j], options);\r\n }\r\n return object;\r\n };\r\n \r\n StyleAttributeProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n StyleAttributeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.StyleAttributeProto\";\r\n };\r\n \r\n return StyleAttributeProto;\r\n })();\r\n \r\n dbroot.StyleMapProto = (function() {\r\n \r\n function StyleMapProto(properties) {\r\n this.channelId = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n StyleMapProto.prototype.styleMapId = 0;\r\n StyleMapProto.prototype.channelId = $util.emptyArray;\r\n StyleMapProto.prototype.normalStyleAttribute = 0;\r\n StyleMapProto.prototype.highlightStyleAttribute = 0;\r\n \r\n StyleMapProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.StyleMapProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.styleMapId = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n if (!(message.channelId && message.channelId.length))\r\n message.channelId = [];\r\n if ((tag & 7) === 2) {\r\n var end2 = reader.uint32() + reader.pos;\r\n while (reader.pos < end2)\r\n message.channelId.push(reader.int32());\r\n } else\r\n message.channelId.push(reader.int32());\r\n break;\r\n }\r\n case 3: {\r\n message.normalStyleAttribute = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.highlightStyleAttribute = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"styleMapId\"))\r\n throw $util.ProtocolError(\"missing required 'styleMapId'\", { instance: message });\r\n return message;\r\n };\r\n \r\n StyleMapProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isInteger(message.styleMapId))\r\n return \"styleMapId: integer expected\";\r\n if (message.channelId != null && message.hasOwnProperty(\"channelId\")) {\r\n if (!Array.isArray(message.channelId))\r\n return \"channelId: array expected\";\r\n for (var i = 0; i < message.channelId.length; ++i)\r\n if (!$util.isInteger(message.channelId[i]))\r\n return \"channelId: integer[] expected\";\r\n }\r\n if (message.normalStyleAttribute != null && message.hasOwnProperty(\"normalStyleAttribute\"))\r\n if (!$util.isInteger(message.normalStyleAttribute))\r\n return \"normalStyleAttribute: integer expected\";\r\n if (message.highlightStyleAttribute != null && message.hasOwnProperty(\"highlightStyleAttribute\"))\r\n if (!$util.isInteger(message.highlightStyleAttribute))\r\n return \"highlightStyleAttribute: integer expected\";\r\n return null;\r\n };\r\n \r\n StyleMapProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.StyleMapProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.StyleMapProto();\r\n if (object.styleMapId != null)\r\n message.styleMapId = object.styleMapId | 0;\r\n if (object.channelId) {\r\n if (!Array.isArray(object.channelId))\r\n throw TypeError(\".keyhole.dbroot.StyleMapProto.channelId: array expected\");\r\n message.channelId = [];\r\n for (var i = 0; i < object.channelId.length; ++i)\r\n message.channelId[i] = object.channelId[i] | 0;\r\n }\r\n if (object.normalStyleAttribute != null)\r\n message.normalStyleAttribute = object.normalStyleAttribute | 0;\r\n if (object.highlightStyleAttribute != null)\r\n message.highlightStyleAttribute = object.highlightStyleAttribute | 0;\r\n return message;\r\n };\r\n \r\n StyleMapProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.channelId = [];\r\n if (options.defaults) {\r\n object.styleMapId = 0;\r\n object.normalStyleAttribute = 0;\r\n object.highlightStyleAttribute = 0;\r\n }\r\n if (message.styleMapId != null && message.hasOwnProperty(\"styleMapId\"))\r\n object.styleMapId = message.styleMapId;\r\n if (message.channelId && message.channelId.length) {\r\n object.channelId = [];\r\n for (var j = 0; j < message.channelId.length; ++j)\r\n object.channelId[j] = message.channelId[j];\r\n }\r\n if (message.normalStyleAttribute != null && message.hasOwnProperty(\"normalStyleAttribute\"))\r\n object.normalStyleAttribute = message.normalStyleAttribute;\r\n if (message.highlightStyleAttribute != null && message.hasOwnProperty(\"highlightStyleAttribute\"))\r\n object.highlightStyleAttribute = message.highlightStyleAttribute;\r\n return object;\r\n };\r\n \r\n StyleMapProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n StyleMapProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.StyleMapProto\";\r\n };\r\n \r\n return StyleMapProto;\r\n })();\r\n \r\n dbroot.ZoomRangeProto = (function() {\r\n \r\n function ZoomRangeProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n ZoomRangeProto.prototype.minZoom = 0;\r\n ZoomRangeProto.prototype.maxZoom = 0;\r\n \r\n ZoomRangeProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ZoomRangeProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.minZoom = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n message.maxZoom = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"minZoom\"))\r\n throw $util.ProtocolError(\"missing required 'minZoom'\", { instance: message });\r\n if (!message.hasOwnProperty(\"maxZoom\"))\r\n throw $util.ProtocolError(\"missing required 'maxZoom'\", { instance: message });\r\n return message;\r\n };\r\n \r\n ZoomRangeProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isInteger(message.minZoom))\r\n return \"minZoom: integer expected\";\r\n if (!$util.isInteger(message.maxZoom))\r\n return \"maxZoom: integer expected\";\r\n return null;\r\n };\r\n \r\n ZoomRangeProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ZoomRangeProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ZoomRangeProto();\r\n if (object.minZoom != null)\r\n message.minZoom = object.minZoom | 0;\r\n if (object.maxZoom != null)\r\n message.maxZoom = object.maxZoom | 0;\r\n return message;\r\n };\r\n \r\n ZoomRangeProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.minZoom = 0;\r\n object.maxZoom = 0;\r\n }\r\n if (message.minZoom != null && message.hasOwnProperty(\"minZoom\"))\r\n object.minZoom = message.minZoom;\r\n if (message.maxZoom != null && message.hasOwnProperty(\"maxZoom\"))\r\n object.maxZoom = message.maxZoom;\r\n return object;\r\n };\r\n \r\n ZoomRangeProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n ZoomRangeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ZoomRangeProto\";\r\n };\r\n \r\n return ZoomRangeProto;\r\n })();\r\n \r\n dbroot.DrawFlagProto = (function() {\r\n \r\n function DrawFlagProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n DrawFlagProto.prototype.drawFlagType = 1;\r\n \r\n DrawFlagProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.DrawFlagProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.drawFlagType = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"drawFlagType\"))\r\n throw $util.ProtocolError(\"missing required 'drawFlagType'\", { instance: message });\r\n return message;\r\n };\r\n \r\n DrawFlagProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n switch (message.drawFlagType) {\r\n default:\r\n return \"drawFlagType: enum value expected\";\r\n case 1:\r\n case 2:\r\n case 3:\r\n case 4:\r\n case 5:\r\n break;\r\n }\r\n return null;\r\n };\r\n \r\n DrawFlagProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.DrawFlagProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.DrawFlagProto();\r\n switch (object.drawFlagType) {\r\n case \"TYPE_FILL_ONLY\":\r\n case 1:\r\n message.drawFlagType = 1;\r\n break;\r\n case \"TYPE_OUTLINE_ONLY\":\r\n case 2:\r\n message.drawFlagType = 2;\r\n break;\r\n case \"TYPE_FILL_AND_OUTLINE\":\r\n case 3:\r\n message.drawFlagType = 3;\r\n break;\r\n case \"TYPE_ANTIALIASING\":\r\n case 4:\r\n message.drawFlagType = 4;\r\n break;\r\n case \"TYPE_CENTER_LABEL\":\r\n case 5:\r\n message.drawFlagType = 5;\r\n break;\r\n }\r\n return message;\r\n };\r\n \r\n DrawFlagProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults)\r\n object.drawFlagType = options.enums === String ? \"TYPE_FILL_ONLY\" : 1;\r\n if (message.drawFlagType != null && message.hasOwnProperty(\"drawFlagType\"))\r\n object.drawFlagType = options.enums === String ? $root.keyhole.dbroot.DrawFlagProto.DrawFlagType[message.drawFlagType] : message.drawFlagType;\r\n return object;\r\n };\r\n \r\n DrawFlagProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n DrawFlagProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.DrawFlagProto\";\r\n };\r\n \r\n DrawFlagProto.DrawFlagType = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[1] = \"TYPE_FILL_ONLY\"] = 1;\r\n values[valuesById[2] = \"TYPE_OUTLINE_ONLY\"] = 2;\r\n values[valuesById[3] = \"TYPE_FILL_AND_OUTLINE\"] = 3;\r\n values[valuesById[4] = \"TYPE_ANTIALIASING\"] = 4;\r\n values[valuesById[5] = \"TYPE_CENTER_LABEL\"] = 5;\r\n return values;\r\n })();\r\n \r\n return DrawFlagProto;\r\n })();\r\n \r\n dbroot.LayerProto = (function() {\r\n \r\n function LayerProto(properties) {\r\n this.zoomRange = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n LayerProto.prototype.zoomRange = $util.emptyArray;\r\n LayerProto.prototype.preserveTextLevel = 30;\r\n LayerProto.prototype.lodBeginTransition = false;\r\n LayerProto.prototype.lodEndTransition = false;\r\n \r\n LayerProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.LayerProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n if (!(message.zoomRange && message.zoomRange.length))\r\n message.zoomRange = [];\r\n message.zoomRange.push($root.keyhole.dbroot.ZoomRangeProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 2: {\r\n message.preserveTextLevel = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.lodBeginTransition = reader.bool();\r\n break;\r\n }\r\n case 5: {\r\n message.lodEndTransition = reader.bool();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n LayerProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.zoomRange != null && message.hasOwnProperty(\"zoomRange\")) {\r\n if (!Array.isArray(message.zoomRange))\r\n return \"zoomRange: array expected\";\r\n for (var i = 0; i < message.zoomRange.length; ++i) {\r\n var error = $root.keyhole.dbroot.ZoomRangeProto.verify(message.zoomRange[i]);\r\n if (error)\r\n return \"zoomRange.\" + error;\r\n }\r\n }\r\n if (message.preserveTextLevel != null && message.hasOwnProperty(\"preserveTextLevel\"))\r\n if (!$util.isInteger(message.preserveTextLevel))\r\n return \"preserveTextLevel: integer expected\";\r\n if (message.lodBeginTransition != null && message.hasOwnProperty(\"lodBeginTransition\"))\r\n if (typeof message.lodBeginTransition !== \"boolean\")\r\n return \"lodBeginTransition: boolean expected\";\r\n if (message.lodEndTransition != null && message.hasOwnProperty(\"lodEndTransition\"))\r\n if (typeof message.lodEndTransition !== \"boolean\")\r\n return \"lodEndTransition: boolean expected\";\r\n return null;\r\n };\r\n \r\n LayerProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.LayerProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.LayerProto();\r\n if (object.zoomRange) {\r\n if (!Array.isArray(object.zoomRange))\r\n throw TypeError(\".keyhole.dbroot.LayerProto.zoomRange: array expected\");\r\n message.zoomRange = [];\r\n for (var i = 0; i < object.zoomRange.length; ++i) {\r\n if (typeof object.zoomRange[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.LayerProto.zoomRange: object expected\");\r\n message.zoomRange[i] = $root.keyhole.dbroot.ZoomRangeProto.fromObject(object.zoomRange[i]);\r\n }\r\n }\r\n if (object.preserveTextLevel != null)\r\n message.preserveTextLevel = object.preserveTextLevel | 0;\r\n if (object.lodBeginTransition != null)\r\n message.lodBeginTransition = Boolean(object.lodBeginTransition);\r\n if (object.lodEndTransition != null)\r\n message.lodEndTransition = Boolean(object.lodEndTransition);\r\n return message;\r\n };\r\n \r\n LayerProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.zoomRange = [];\r\n if (options.defaults) {\r\n object.preserveTextLevel = 30;\r\n object.lodBeginTransition = false;\r\n object.lodEndTransition = false;\r\n }\r\n if (message.zoomRange && message.zoomRange.length) {\r\n object.zoomRange = [];\r\n for (var j = 0; j < message.zoomRange.length; ++j)\r\n object.zoomRange[j] = $root.keyhole.dbroot.ZoomRangeProto.toObject(message.zoomRange[j], options);\r\n }\r\n if (message.preserveTextLevel != null && message.hasOwnProperty(\"preserveTextLevel\"))\r\n object.preserveTextLevel = message.preserveTextLevel;\r\n if (message.lodBeginTransition != null && message.hasOwnProperty(\"lodBeginTransition\"))\r\n object.lodBeginTransition = message.lodBeginTransition;\r\n if (message.lodEndTransition != null && message.hasOwnProperty(\"lodEndTransition\"))\r\n object.lodEndTransition = message.lodEndTransition;\r\n return object;\r\n };\r\n \r\n LayerProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n LayerProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.LayerProto\";\r\n };\r\n \r\n return LayerProto;\r\n })();\r\n \r\n dbroot.FolderProto = (function() {\r\n \r\n function FolderProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n FolderProto.prototype.isExpandable = true;\r\n \r\n FolderProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.FolderProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.isExpandable = reader.bool();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n FolderProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.isExpandable != null && message.hasOwnProperty(\"isExpandable\"))\r\n if (typeof message.isExpandable !== \"boolean\")\r\n return \"isExpandable: boolean expected\";\r\n return null;\r\n };\r\n \r\n FolderProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.FolderProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.FolderProto();\r\n if (object.isExpandable != null)\r\n message.isExpandable = Boolean(object.isExpandable);\r\n return message;\r\n };\r\n \r\n FolderProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults)\r\n object.isExpandable = true;\r\n if (message.isExpandable != null && message.hasOwnProperty(\"isExpandable\"))\r\n object.isExpandable = message.isExpandable;\r\n return object;\r\n };\r\n \r\n FolderProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n FolderProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.FolderProto\";\r\n };\r\n \r\n return FolderProto;\r\n })();\r\n \r\n dbroot.RequirementProto = (function() {\r\n \r\n function RequirementProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n RequirementProto.prototype.requiredVram = \"\";\r\n RequirementProto.prototype.requiredClientVer = \"\";\r\n RequirementProto.prototype.probability = \"\";\r\n RequirementProto.prototype.requiredUserAgent = \"\";\r\n RequirementProto.prototype.requiredClientCapabilities = \"\";\r\n \r\n RequirementProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.RequirementProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 3: {\r\n message.requiredVram = reader.string();\r\n break;\r\n }\r\n case 4: {\r\n message.requiredClientVer = reader.string();\r\n break;\r\n }\r\n case 5: {\r\n message.probability = reader.string();\r\n break;\r\n }\r\n case 6: {\r\n message.requiredUserAgent = reader.string();\r\n break;\r\n }\r\n case 7: {\r\n message.requiredClientCapabilities = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n RequirementProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.requiredVram != null && message.hasOwnProperty(\"requiredVram\"))\r\n if (!$util.isString(message.requiredVram))\r\n return \"requiredVram: string expected\";\r\n if (message.requiredClientVer != null && message.hasOwnProperty(\"requiredClientVer\"))\r\n if (!$util.isString(message.requiredClientVer))\r\n return \"requiredClientVer: string expected\";\r\n if (message.probability != null && message.hasOwnProperty(\"probability\"))\r\n if (!$util.isString(message.probability))\r\n return \"probability: string expected\";\r\n if (message.requiredUserAgent != null && message.hasOwnProperty(\"requiredUserAgent\"))\r\n if (!$util.isString(message.requiredUserAgent))\r\n return \"requiredUserAgent: string expected\";\r\n if (message.requiredClientCapabilities != null && message.hasOwnProperty(\"requiredClientCapabilities\"))\r\n if (!$util.isString(message.requiredClientCapabilities))\r\n return \"requiredClientCapabilities: string expected\";\r\n return null;\r\n };\r\n \r\n RequirementProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.RequirementProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.RequirementProto();\r\n if (object.requiredVram != null)\r\n message.requiredVram = String(object.requiredVram);\r\n if (object.requiredClientVer != null)\r\n message.requiredClientVer = String(object.requiredClientVer);\r\n if (object.probability != null)\r\n message.probability = String(object.probability);\r\n if (object.requiredUserAgent != null)\r\n message.requiredUserAgent = String(object.requiredUserAgent);\r\n if (object.requiredClientCapabilities != null)\r\n message.requiredClientCapabilities = String(object.requiredClientCapabilities);\r\n return message;\r\n };\r\n \r\n RequirementProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.requiredVram = \"\";\r\n object.requiredClientVer = \"\";\r\n object.probability = \"\";\r\n object.requiredUserAgent = \"\";\r\n object.requiredClientCapabilities = \"\";\r\n }\r\n if (message.requiredVram != null && message.hasOwnProperty(\"requiredVram\"))\r\n object.requiredVram = message.requiredVram;\r\n if (message.requiredClientVer != null && message.hasOwnProperty(\"requiredClientVer\"))\r\n object.requiredClientVer = message.requiredClientVer;\r\n if (message.probability != null && message.hasOwnProperty(\"probability\"))\r\n object.probability = message.probability;\r\n if (message.requiredUserAgent != null && message.hasOwnProperty(\"requiredUserAgent\"))\r\n object.requiredUserAgent = message.requiredUserAgent;\r\n if (message.requiredClientCapabilities != null && message.hasOwnProperty(\"requiredClientCapabilities\"))\r\n object.requiredClientCapabilities = message.requiredClientCapabilities;\r\n return object;\r\n };\r\n \r\n RequirementProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n RequirementProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.RequirementProto\";\r\n };\r\n \r\n return RequirementProto;\r\n })();\r\n \r\n dbroot.LookAtProto = (function() {\r\n \r\n function LookAtProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n LookAtProto.prototype.longitude = 0;\r\n LookAtProto.prototype.latitude = 0;\r\n LookAtProto.prototype.range = 0;\r\n LookAtProto.prototype.tilt = 0;\r\n LookAtProto.prototype.heading = 0;\r\n \r\n LookAtProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.LookAtProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.longitude = reader.float();\r\n break;\r\n }\r\n case 2: {\r\n message.latitude = reader.float();\r\n break;\r\n }\r\n case 3: {\r\n message.range = reader.float();\r\n break;\r\n }\r\n case 4: {\r\n message.tilt = reader.float();\r\n break;\r\n }\r\n case 5: {\r\n message.heading = reader.float();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"longitude\"))\r\n throw $util.ProtocolError(\"missing required 'longitude'\", { instance: message });\r\n if (!message.hasOwnProperty(\"latitude\"))\r\n throw $util.ProtocolError(\"missing required 'latitude'\", { instance: message });\r\n return message;\r\n };\r\n \r\n LookAtProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (typeof message.longitude !== \"number\")\r\n return \"longitude: number expected\";\r\n if (typeof message.latitude !== \"number\")\r\n return \"latitude: number expected\";\r\n if (message.range != null && message.hasOwnProperty(\"range\"))\r\n if (typeof message.range !== \"number\")\r\n return \"range: number expected\";\r\n if (message.tilt != null && message.hasOwnProperty(\"tilt\"))\r\n if (typeof message.tilt !== \"number\")\r\n return \"tilt: number expected\";\r\n if (message.heading != null && message.hasOwnProperty(\"heading\"))\r\n if (typeof message.heading !== \"number\")\r\n return \"heading: number expected\";\r\n return null;\r\n };\r\n \r\n LookAtProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.LookAtProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.LookAtProto();\r\n if (object.longitude != null)\r\n message.longitude = Number(object.longitude);\r\n if (object.latitude != null)\r\n message.latitude = Number(object.latitude);\r\n if (object.range != null)\r\n message.range = Number(object.range);\r\n if (object.tilt != null)\r\n message.tilt = Number(object.tilt);\r\n if (object.heading != null)\r\n message.heading = Number(object.heading);\r\n return message;\r\n };\r\n \r\n LookAtProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.longitude = 0;\r\n object.latitude = 0;\r\n object.range = 0;\r\n object.tilt = 0;\r\n object.heading = 0;\r\n }\r\n if (message.longitude != null && message.hasOwnProperty(\"longitude\"))\r\n object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude;\r\n if (message.latitude != null && message.hasOwnProperty(\"latitude\"))\r\n object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude;\r\n if (message.range != null && message.hasOwnProperty(\"range\"))\r\n object.range = options.json && !isFinite(message.range) ? String(message.range) : message.range;\r\n if (message.tilt != null && message.hasOwnProperty(\"tilt\"))\r\n object.tilt = options.json && !isFinite(message.tilt) ? String(message.tilt) : message.tilt;\r\n if (message.heading != null && message.hasOwnProperty(\"heading\"))\r\n object.heading = options.json && !isFinite(message.heading) ? String(message.heading) : message.heading;\r\n return object;\r\n };\r\n \r\n LookAtProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n LookAtProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.LookAtProto\";\r\n };\r\n \r\n return LookAtProto;\r\n })();\r\n \r\n dbroot.NestedFeatureProto = (function() {\r\n \r\n function NestedFeatureProto(properties) {\r\n this.children = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n NestedFeatureProto.prototype.featureType = 1;\r\n NestedFeatureProto.prototype.kmlUrl = null;\r\n NestedFeatureProto.prototype.databaseUrl = \"\";\r\n NestedFeatureProto.prototype.layer = null;\r\n NestedFeatureProto.prototype.folder = null;\r\n NestedFeatureProto.prototype.requirement = null;\r\n NestedFeatureProto.prototype.channelId = 0;\r\n NestedFeatureProto.prototype.displayName = null;\r\n NestedFeatureProto.prototype.isVisible = true;\r\n NestedFeatureProto.prototype.isEnabled = true;\r\n NestedFeatureProto.prototype.isChecked = false;\r\n NestedFeatureProto.prototype.layerMenuIconPath = \"icons/773_l.png\";\r\n NestedFeatureProto.prototype.description = null;\r\n NestedFeatureProto.prototype.lookAt = null;\r\n NestedFeatureProto.prototype.assetUuid = \"\";\r\n NestedFeatureProto.prototype.isSaveLocked = true;\r\n NestedFeatureProto.prototype.children = $util.emptyArray;\r\n NestedFeatureProto.prototype.clientConfigScriptName = \"\";\r\n NestedFeatureProto.prototype.dioramaDataChannelBase = -1;\r\n NestedFeatureProto.prototype.replicaDataChannelBase = -1;\r\n \r\n NestedFeatureProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.NestedFeatureProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.featureType = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n message.kmlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 21: {\r\n message.databaseUrl = reader.string();\r\n break;\r\n }\r\n case 3: {\r\n message.layer = $root.keyhole.dbroot.LayerProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 4: {\r\n message.folder = $root.keyhole.dbroot.FolderProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 5: {\r\n message.requirement = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 6: {\r\n message.channelId = reader.int32();\r\n break;\r\n }\r\n case 7: {\r\n message.displayName = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 8: {\r\n message.isVisible = reader.bool();\r\n break;\r\n }\r\n case 9: {\r\n message.isEnabled = reader.bool();\r\n break;\r\n }\r\n case 10: {\r\n message.isChecked = reader.bool();\r\n break;\r\n }\r\n case 11: {\r\n message.layerMenuIconPath = reader.string();\r\n break;\r\n }\r\n case 12: {\r\n message.description = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 13: {\r\n message.lookAt = $root.keyhole.dbroot.LookAtProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 15: {\r\n message.assetUuid = reader.string();\r\n break;\r\n }\r\n case 16: {\r\n message.isSaveLocked = reader.bool();\r\n break;\r\n }\r\n case 17: {\r\n if (!(message.children && message.children.length))\r\n message.children = [];\r\n message.children.push($root.keyhole.dbroot.NestedFeatureProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 18: {\r\n message.clientConfigScriptName = reader.string();\r\n break;\r\n }\r\n case 19: {\r\n message.dioramaDataChannelBase = reader.int32();\r\n break;\r\n }\r\n case 20: {\r\n message.replicaDataChannelBase = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"channelId\"))\r\n throw $util.ProtocolError(\"missing required 'channelId'\", { instance: message });\r\n return message;\r\n };\r\n \r\n NestedFeatureProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.featureType != null && message.hasOwnProperty(\"featureType\"))\r\n switch (message.featureType) {\r\n default:\r\n return \"featureType: enum value expected\";\r\n case 1:\r\n case 2:\r\n case 3:\r\n case 4:\r\n break;\r\n }\r\n if (message.kmlUrl != null && message.hasOwnProperty(\"kmlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.kmlUrl);\r\n if (error)\r\n return \"kmlUrl.\" + error;\r\n }\r\n if (message.databaseUrl != null && message.hasOwnProperty(\"databaseUrl\"))\r\n if (!$util.isString(message.databaseUrl))\r\n return \"databaseUrl: string expected\";\r\n if (message.layer != null && message.hasOwnProperty(\"layer\")) {\r\n var error = $root.keyhole.dbroot.LayerProto.verify(message.layer);\r\n if (error)\r\n return \"layer.\" + error;\r\n }\r\n if (message.folder != null && message.hasOwnProperty(\"folder\")) {\r\n var error = $root.keyhole.dbroot.FolderProto.verify(message.folder);\r\n if (error)\r\n return \"folder.\" + error;\r\n }\r\n if (message.requirement != null && message.hasOwnProperty(\"requirement\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirement);\r\n if (error)\r\n return \"requirement.\" + error;\r\n }\r\n if (!$util.isInteger(message.channelId))\r\n return \"channelId: integer expected\";\r\n if (message.displayName != null && message.hasOwnProperty(\"displayName\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.displayName);\r\n if (error)\r\n return \"displayName.\" + error;\r\n }\r\n if (message.isVisible != null && message.hasOwnProperty(\"isVisible\"))\r\n if (typeof message.isVisible !== \"boolean\")\r\n return \"isVisible: boolean expected\";\r\n if (message.isEnabled != null && message.hasOwnProperty(\"isEnabled\"))\r\n if (typeof message.isEnabled !== \"boolean\")\r\n return \"isEnabled: boolean expected\";\r\n if (message.isChecked != null && message.hasOwnProperty(\"isChecked\"))\r\n if (typeof message.isChecked !== \"boolean\")\r\n return \"isChecked: boolean expected\";\r\n if (message.layerMenuIconPath != null && message.hasOwnProperty(\"layerMenuIconPath\"))\r\n if (!$util.isString(message.layerMenuIconPath))\r\n return \"layerMenuIconPath: string expected\";\r\n if (message.description != null && message.hasOwnProperty(\"description\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.description);\r\n if (error)\r\n return \"description.\" + error;\r\n }\r\n if (message.lookAt != null && message.hasOwnProperty(\"lookAt\")) {\r\n var error = $root.keyhole.dbroot.LookAtProto.verify(message.lookAt);\r\n if (error)\r\n return \"lookAt.\" + error;\r\n }\r\n if (message.assetUuid != null && message.hasOwnProperty(\"assetUuid\"))\r\n if (!$util.isString(message.assetUuid))\r\n return \"assetUuid: string expected\";\r\n if (message.isSaveLocked != null && message.hasOwnProperty(\"isSaveLocked\"))\r\n if (typeof message.isSaveLocked !== \"boolean\")\r\n return \"isSaveLocked: boolean expected\";\r\n if (message.children != null && message.hasOwnProperty(\"children\")) {\r\n if (!Array.isArray(message.children))\r\n return \"children: array expected\";\r\n for (var i = 0; i < message.children.length; ++i) {\r\n var error = $root.keyhole.dbroot.NestedFeatureProto.verify(message.children[i]);\r\n if (error)\r\n return \"children.\" + error;\r\n }\r\n }\r\n if (message.clientConfigScriptName != null && message.hasOwnProperty(\"clientConfigScriptName\"))\r\n if (!$util.isString(message.clientConfigScriptName))\r\n return \"clientConfigScriptName: string expected\";\r\n if (message.dioramaDataChannelBase != null && message.hasOwnProperty(\"dioramaDataChannelBase\"))\r\n if (!$util.isInteger(message.dioramaDataChannelBase))\r\n return \"dioramaDataChannelBase: integer expected\";\r\n if (message.replicaDataChannelBase != null && message.hasOwnProperty(\"replicaDataChannelBase\"))\r\n if (!$util.isInteger(message.replicaDataChannelBase))\r\n return \"replicaDataChannelBase: integer expected\";\r\n return null;\r\n };\r\n \r\n NestedFeatureProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.NestedFeatureProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.NestedFeatureProto();\r\n switch (object.featureType) {\r\n case \"TYPE_POINT_Z\":\r\n case 1:\r\n message.featureType = 1;\r\n break;\r\n case \"TYPE_POLYGON_Z\":\r\n case 2:\r\n message.featureType = 2;\r\n break;\r\n case \"TYPE_LINE_Z\":\r\n case 3:\r\n message.featureType = 3;\r\n break;\r\n case \"TYPE_TERRAIN\":\r\n case 4:\r\n message.featureType = 4;\r\n break;\r\n }\r\n if (object.kmlUrl != null) {\r\n if (typeof object.kmlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected\");\r\n message.kmlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.kmlUrl);\r\n }\r\n if (object.databaseUrl != null)\r\n message.databaseUrl = String(object.databaseUrl);\r\n if (object.layer != null) {\r\n if (typeof object.layer !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.layer: object expected\");\r\n message.layer = $root.keyhole.dbroot.LayerProto.fromObject(object.layer);\r\n }\r\n if (object.folder != null) {\r\n if (typeof object.folder !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.folder: object expected\");\r\n message.folder = $root.keyhole.dbroot.FolderProto.fromObject(object.folder);\r\n }\r\n if (object.requirement != null) {\r\n if (typeof object.requirement !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.requirement: object expected\");\r\n message.requirement = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirement);\r\n }\r\n if (object.channelId != null)\r\n message.channelId = object.channelId | 0;\r\n if (object.displayName != null) {\r\n if (typeof object.displayName !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.displayName: object expected\");\r\n message.displayName = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.displayName);\r\n }\r\n if (object.isVisible != null)\r\n message.isVisible = Boolean(object.isVisible);\r\n if (object.isEnabled != null)\r\n message.isEnabled = Boolean(object.isEnabled);\r\n if (object.isChecked != null)\r\n message.isChecked = Boolean(object.isChecked);\r\n if (object.layerMenuIconPath != null)\r\n message.layerMenuIconPath = String(object.layerMenuIconPath);\r\n if (object.description != null) {\r\n if (typeof object.description !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.description: object expected\");\r\n message.description = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.description);\r\n }\r\n if (object.lookAt != null) {\r\n if (typeof object.lookAt !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.lookAt: object expected\");\r\n message.lookAt = $root.keyhole.dbroot.LookAtProto.fromObject(object.lookAt);\r\n }\r\n if (object.assetUuid != null)\r\n message.assetUuid = String(object.assetUuid);\r\n if (object.isSaveLocked != null)\r\n message.isSaveLocked = Boolean(object.isSaveLocked);\r\n if (object.children) {\r\n if (!Array.isArray(object.children))\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.children: array expected\");\r\n message.children = [];\r\n for (var i = 0; i < object.children.length; ++i) {\r\n if (typeof object.children[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.NestedFeatureProto.children: object expected\");\r\n message.children[i] = $root.keyhole.dbroot.NestedFeatureProto.fromObject(object.children[i]);\r\n }\r\n }\r\n if (object.clientConfigScriptName != null)\r\n message.clientConfigScriptName = String(object.clientConfigScriptName);\r\n if (object.dioramaDataChannelBase != null)\r\n message.dioramaDataChannelBase = object.dioramaDataChannelBase | 0;\r\n if (object.replicaDataChannelBase != null)\r\n message.replicaDataChannelBase = object.replicaDataChannelBase | 0;\r\n return message;\r\n };\r\n \r\n NestedFeatureProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.children = [];\r\n if (options.defaults) {\r\n object.featureType = options.enums === String ? \"TYPE_POINT_Z\" : 1;\r\n object.kmlUrl = null;\r\n object.layer = null;\r\n object.folder = null;\r\n object.requirement = null;\r\n object.channelId = 0;\r\n object.displayName = null;\r\n object.isVisible = true;\r\n object.isEnabled = true;\r\n object.isChecked = false;\r\n object.layerMenuIconPath = \"icons/773_l.png\";\r\n object.description = null;\r\n object.lookAt = null;\r\n object.assetUuid = \"\";\r\n object.isSaveLocked = true;\r\n object.clientConfigScriptName = \"\";\r\n object.dioramaDataChannelBase = -1;\r\n object.replicaDataChannelBase = -1;\r\n object.databaseUrl = \"\";\r\n }\r\n if (message.featureType != null && message.hasOwnProperty(\"featureType\"))\r\n object.featureType = options.enums === String ? $root.keyhole.dbroot.NestedFeatureProto.FeatureType[message.featureType] : message.featureType;\r\n if (message.kmlUrl != null && message.hasOwnProperty(\"kmlUrl\"))\r\n object.kmlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.kmlUrl, options);\r\n if (message.layer != null && message.hasOwnProperty(\"layer\"))\r\n object.layer = $root.keyhole.dbroot.LayerProto.toObject(message.layer, options);\r\n if (message.folder != null && message.hasOwnProperty(\"folder\"))\r\n object.folder = $root.keyhole.dbroot.FolderProto.toObject(message.folder, options);\r\n if (message.requirement != null && message.hasOwnProperty(\"requirement\"))\r\n object.requirement = $root.keyhole.dbroot.RequirementProto.toObject(message.requirement, options);\r\n if (message.channelId != null && message.hasOwnProperty(\"channelId\"))\r\n object.channelId = message.channelId;\r\n if (message.displayName != null && message.hasOwnProperty(\"displayName\"))\r\n object.displayName = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.displayName, options);\r\n if (message.isVisible != null && message.hasOwnProperty(\"isVisible\"))\r\n object.isVisible = message.isVisible;\r\n if (message.isEnabled != null && message.hasOwnProperty(\"isEnabled\"))\r\n object.isEnabled = message.isEnabled;\r\n if (message.isChecked != null && message.hasOwnProperty(\"isChecked\"))\r\n object.isChecked = message.isChecked;\r\n if (message.layerMenuIconPath != null && message.hasOwnProperty(\"layerMenuIconPath\"))\r\n object.layerMenuIconPath = message.layerMenuIconPath;\r\n if (message.description != null && message.hasOwnProperty(\"description\"))\r\n object.description = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.description, options);\r\n if (message.lookAt != null && message.hasOwnProperty(\"lookAt\"))\r\n object.lookAt = $root.keyhole.dbroot.LookAtProto.toObject(message.lookAt, options);\r\n if (message.assetUuid != null && message.hasOwnProperty(\"assetUuid\"))\r\n object.assetUuid = message.assetUuid;\r\n if (message.isSaveLocked != null && message.hasOwnProperty(\"isSaveLocked\"))\r\n object.isSaveLocked = message.isSaveLocked;\r\n if (message.children && message.children.length) {\r\n object.children = [];\r\n for (var j = 0; j < message.children.length; ++j)\r\n object.children[j] = $root.keyhole.dbroot.NestedFeatureProto.toObject(message.children[j], options);\r\n }\r\n if (message.clientConfigScriptName != null && message.hasOwnProperty(\"clientConfigScriptName\"))\r\n object.clientConfigScriptName = message.clientConfigScriptName;\r\n if (message.dioramaDataChannelBase != null && message.hasOwnProperty(\"dioramaDataChannelBase\"))\r\n object.dioramaDataChannelBase = message.dioramaDataChannelBase;\r\n if (message.replicaDataChannelBase != null && message.hasOwnProperty(\"replicaDataChannelBase\"))\r\n object.replicaDataChannelBase = message.replicaDataChannelBase;\r\n if (message.databaseUrl != null && message.hasOwnProperty(\"databaseUrl\"))\r\n object.databaseUrl = message.databaseUrl;\r\n return object;\r\n };\r\n \r\n NestedFeatureProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n NestedFeatureProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.NestedFeatureProto\";\r\n };\r\n \r\n NestedFeatureProto.FeatureType = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[1] = \"TYPE_POINT_Z\"] = 1;\r\n values[valuesById[2] = \"TYPE_POLYGON_Z\"] = 2;\r\n values[valuesById[3] = \"TYPE_LINE_Z\"] = 3;\r\n values[valuesById[4] = \"TYPE_TERRAIN\"] = 4;\r\n return values;\r\n })();\r\n \r\n return NestedFeatureProto;\r\n })();\r\n \r\n dbroot.MfeDomainFeaturesProto = (function() {\r\n \r\n function MfeDomainFeaturesProto(properties) {\r\n this.supportedFeatures = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n MfeDomainFeaturesProto.prototype.countryCode = \"\";\r\n MfeDomainFeaturesProto.prototype.domainName = \"\";\r\n MfeDomainFeaturesProto.prototype.supportedFeatures = $util.emptyArray;\r\n \r\n MfeDomainFeaturesProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.MfeDomainFeaturesProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.countryCode = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.domainName = reader.string();\r\n break;\r\n }\r\n case 3: {\r\n if (!(message.supportedFeatures && message.supportedFeatures.length))\r\n message.supportedFeatures = [];\r\n if ((tag & 7) === 2) {\r\n var end2 = reader.uint32() + reader.pos;\r\n while (reader.pos < end2)\r\n message.supportedFeatures.push(reader.int32());\r\n } else\r\n message.supportedFeatures.push(reader.int32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"countryCode\"))\r\n throw $util.ProtocolError(\"missing required 'countryCode'\", { instance: message });\r\n if (!message.hasOwnProperty(\"domainName\"))\r\n throw $util.ProtocolError(\"missing required 'domainName'\", { instance: message });\r\n return message;\r\n };\r\n \r\n MfeDomainFeaturesProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isString(message.countryCode))\r\n return \"countryCode: string expected\";\r\n if (!$util.isString(message.domainName))\r\n return \"domainName: string expected\";\r\n if (message.supportedFeatures != null && message.hasOwnProperty(\"supportedFeatures\")) {\r\n if (!Array.isArray(message.supportedFeatures))\r\n return \"supportedFeatures: array expected\";\r\n for (var i = 0; i < message.supportedFeatures.length; ++i)\r\n switch (message.supportedFeatures[i]) {\r\n default:\r\n return \"supportedFeatures: enum value[] expected\";\r\n case 0:\r\n case 1:\r\n case 2:\r\n break;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n MfeDomainFeaturesProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.MfeDomainFeaturesProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.MfeDomainFeaturesProto();\r\n if (object.countryCode != null)\r\n message.countryCode = String(object.countryCode);\r\n if (object.domainName != null)\r\n message.domainName = String(object.domainName);\r\n if (object.supportedFeatures) {\r\n if (!Array.isArray(object.supportedFeatures))\r\n throw TypeError(\".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected\");\r\n message.supportedFeatures = [];\r\n for (var i = 0; i < object.supportedFeatures.length; ++i)\r\n switch (object.supportedFeatures[i]) {\r\n default:\r\n case \"GEOCODING\":\r\n case 0:\r\n message.supportedFeatures[i] = 0;\r\n break;\r\n case \"LOCAL_SEARCH\":\r\n case 1:\r\n message.supportedFeatures[i] = 1;\r\n break;\r\n case \"DRIVING_DIRECTIONS\":\r\n case 2:\r\n message.supportedFeatures[i] = 2;\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n MfeDomainFeaturesProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.supportedFeatures = [];\r\n if (options.defaults) {\r\n object.countryCode = \"\";\r\n object.domainName = \"\";\r\n }\r\n if (message.countryCode != null && message.hasOwnProperty(\"countryCode\"))\r\n object.countryCode = message.countryCode;\r\n if (message.domainName != null && message.hasOwnProperty(\"domainName\"))\r\n object.domainName = message.domainName;\r\n if (message.supportedFeatures && message.supportedFeatures.length) {\r\n object.supportedFeatures = [];\r\n for (var j = 0; j < message.supportedFeatures.length; ++j)\r\n object.supportedFeatures[j] = options.enums === String ? $root.keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature[message.supportedFeatures[j]] : message.supportedFeatures[j];\r\n }\r\n return object;\r\n };\r\n \r\n MfeDomainFeaturesProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n MfeDomainFeaturesProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.MfeDomainFeaturesProto\";\r\n };\r\n \r\n MfeDomainFeaturesProto.SupportedFeature = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[0] = \"GEOCODING\"] = 0;\r\n values[valuesById[1] = \"LOCAL_SEARCH\"] = 1;\r\n values[valuesById[2] = \"DRIVING_DIRECTIONS\"] = 2;\r\n return values;\r\n })();\r\n \r\n return MfeDomainFeaturesProto;\r\n })();\r\n \r\n dbroot.ClientOptionsProto = (function() {\r\n \r\n function ClientOptionsProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n ClientOptionsProto.prototype.disableDiskCache = false;\r\n ClientOptionsProto.prototype.disableEmbeddedBrowserVista = false;\r\n ClientOptionsProto.prototype.drawAtmosphere = true;\r\n ClientOptionsProto.prototype.drawStars = true;\r\n ClientOptionsProto.prototype.shaderFilePrefix = \"\";\r\n ClientOptionsProto.prototype.useProtobufQuadtreePackets = false;\r\n ClientOptionsProto.prototype.useExtendedCopyrightIds = true;\r\n ClientOptionsProto.prototype.precipitationsOptions = null;\r\n ClientOptionsProto.prototype.captureOptions = null;\r\n ClientOptionsProto.prototype.show_2dMapsIcon = true;\r\n ClientOptionsProto.prototype.disableInternalBrowser = false;\r\n ClientOptionsProto.prototype.internalBrowserBlacklist = \"\";\r\n ClientOptionsProto.prototype.internalBrowserOriginWhitelist = \"*\";\r\n ClientOptionsProto.prototype.polarTileMergingLevel = 0;\r\n ClientOptionsProto.prototype.jsBridgeRequestWhitelist = \"http://*.google.com/*\";\r\n ClientOptionsProto.prototype.mapsOptions = null;\r\n \r\n ClientOptionsProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ClientOptionsProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.disableDiskCache = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.disableEmbeddedBrowserVista = reader.bool();\r\n break;\r\n }\r\n case 3: {\r\n message.drawAtmosphere = reader.bool();\r\n break;\r\n }\r\n case 4: {\r\n message.drawStars = reader.bool();\r\n break;\r\n }\r\n case 5: {\r\n message.shaderFilePrefix = reader.string();\r\n break;\r\n }\r\n case 6: {\r\n message.useProtobufQuadtreePackets = reader.bool();\r\n break;\r\n }\r\n case 7: {\r\n message.useExtendedCopyrightIds = reader.bool();\r\n break;\r\n }\r\n case 8: {\r\n message.precipitationsOptions = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 9: {\r\n message.captureOptions = $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 10: {\r\n message.show_2dMapsIcon = reader.bool();\r\n break;\r\n }\r\n case 11: {\r\n message.disableInternalBrowser = reader.bool();\r\n break;\r\n }\r\n case 12: {\r\n message.internalBrowserBlacklist = reader.string();\r\n break;\r\n }\r\n case 13: {\r\n message.internalBrowserOriginWhitelist = reader.string();\r\n break;\r\n }\r\n case 14: {\r\n message.polarTileMergingLevel = reader.int32();\r\n break;\r\n }\r\n case 15: {\r\n message.jsBridgeRequestWhitelist = reader.string();\r\n break;\r\n }\r\n case 16: {\r\n message.mapsOptions = $root.keyhole.dbroot.ClientOptionsProto.MapsOptions.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n ClientOptionsProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.disableDiskCache != null && message.hasOwnProperty(\"disableDiskCache\"))\r\n if (typeof message.disableDiskCache !== \"boolean\")\r\n return \"disableDiskCache: boolean expected\";\r\n if (message.disableEmbeddedBrowserVista != null && message.hasOwnProperty(\"disableEmbeddedBrowserVista\"))\r\n if (typeof message.disableEmbeddedBrowserVista !== \"boolean\")\r\n return \"disableEmbeddedBrowserVista: boolean expected\";\r\n if (message.drawAtmosphere != null && message.hasOwnProperty(\"drawAtmosphere\"))\r\n if (typeof message.drawAtmosphere !== \"boolean\")\r\n return \"drawAtmosphere: boolean expected\";\r\n if (message.drawStars != null && message.hasOwnProperty(\"drawStars\"))\r\n if (typeof message.drawStars !== \"boolean\")\r\n return \"drawStars: boolean expected\";\r\n if (message.shaderFilePrefix != null && message.hasOwnProperty(\"shaderFilePrefix\"))\r\n if (!$util.isString(message.shaderFilePrefix))\r\n return \"shaderFilePrefix: string expected\";\r\n if (message.useProtobufQuadtreePackets != null && message.hasOwnProperty(\"useProtobufQuadtreePackets\"))\r\n if (typeof message.useProtobufQuadtreePackets !== \"boolean\")\r\n return \"useProtobufQuadtreePackets: boolean expected\";\r\n if (message.useExtendedCopyrightIds != null && message.hasOwnProperty(\"useExtendedCopyrightIds\"))\r\n if (typeof message.useExtendedCopyrightIds !== \"boolean\")\r\n return \"useExtendedCopyrightIds: boolean expected\";\r\n if (message.precipitationsOptions != null && message.hasOwnProperty(\"precipitationsOptions\")) {\r\n var error = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.verify(message.precipitationsOptions);\r\n if (error)\r\n return \"precipitationsOptions.\" + error;\r\n }\r\n if (message.captureOptions != null && message.hasOwnProperty(\"captureOptions\")) {\r\n var error = $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions.verify(message.captureOptions);\r\n if (error)\r\n return \"captureOptions.\" + error;\r\n }\r\n if (message.show_2dMapsIcon != null && message.hasOwnProperty(\"show_2dMapsIcon\"))\r\n if (typeof message.show_2dMapsIcon !== \"boolean\")\r\n return \"show_2dMapsIcon: boolean expected\";\r\n if (message.disableInternalBrowser != null && message.hasOwnProperty(\"disableInternalBrowser\"))\r\n if (typeof message.disableInternalBrowser !== \"boolean\")\r\n return \"disableInternalBrowser: boolean expected\";\r\n if (message.internalBrowserBlacklist != null && message.hasOwnProperty(\"internalBrowserBlacklist\"))\r\n if (!$util.isString(message.internalBrowserBlacklist))\r\n return \"internalBrowserBlacklist: string expected\";\r\n if (message.internalBrowserOriginWhitelist != null && message.hasOwnProperty(\"internalBrowserOriginWhitelist\"))\r\n if (!$util.isString(message.internalBrowserOriginWhitelist))\r\n return \"internalBrowserOriginWhitelist: string expected\";\r\n if (message.polarTileMergingLevel != null && message.hasOwnProperty(\"polarTileMergingLevel\"))\r\n if (!$util.isInteger(message.polarTileMergingLevel))\r\n return \"polarTileMergingLevel: integer expected\";\r\n if (message.jsBridgeRequestWhitelist != null && message.hasOwnProperty(\"jsBridgeRequestWhitelist\"))\r\n if (!$util.isString(message.jsBridgeRequestWhitelist))\r\n return \"jsBridgeRequestWhitelist: string expected\";\r\n if (message.mapsOptions != null && message.hasOwnProperty(\"mapsOptions\")) {\r\n var error = $root.keyhole.dbroot.ClientOptionsProto.MapsOptions.verify(message.mapsOptions);\r\n if (error)\r\n return \"mapsOptions.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n ClientOptionsProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ClientOptionsProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ClientOptionsProto();\r\n if (object.disableDiskCache != null)\r\n message.disableDiskCache = Boolean(object.disableDiskCache);\r\n if (object.disableEmbeddedBrowserVista != null)\r\n message.disableEmbeddedBrowserVista = Boolean(object.disableEmbeddedBrowserVista);\r\n if (object.drawAtmosphere != null)\r\n message.drawAtmosphere = Boolean(object.drawAtmosphere);\r\n if (object.drawStars != null)\r\n message.drawStars = Boolean(object.drawStars);\r\n if (object.shaderFilePrefix != null)\r\n message.shaderFilePrefix = String(object.shaderFilePrefix);\r\n if (object.useProtobufQuadtreePackets != null)\r\n message.useProtobufQuadtreePackets = Boolean(object.useProtobufQuadtreePackets);\r\n if (object.useExtendedCopyrightIds != null)\r\n message.useExtendedCopyrightIds = Boolean(object.useExtendedCopyrightIds);\r\n if (object.precipitationsOptions != null) {\r\n if (typeof object.precipitationsOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected\");\r\n message.precipitationsOptions = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.fromObject(object.precipitationsOptions);\r\n }\r\n if (object.captureOptions != null) {\r\n if (typeof object.captureOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected\");\r\n message.captureOptions = $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions.fromObject(object.captureOptions);\r\n }\r\n if (object.show_2dMapsIcon != null)\r\n message.show_2dMapsIcon = Boolean(object.show_2dMapsIcon);\r\n if (object.disableInternalBrowser != null)\r\n message.disableInternalBrowser = Boolean(object.disableInternalBrowser);\r\n if (object.internalBrowserBlacklist != null)\r\n message.internalBrowserBlacklist = String(object.internalBrowserBlacklist);\r\n if (object.internalBrowserOriginWhitelist != null)\r\n message.internalBrowserOriginWhitelist = String(object.internalBrowserOriginWhitelist);\r\n if (object.polarTileMergingLevel != null)\r\n message.polarTileMergingLevel = object.polarTileMergingLevel | 0;\r\n if (object.jsBridgeRequestWhitelist != null)\r\n message.jsBridgeRequestWhitelist = String(object.jsBridgeRequestWhitelist);\r\n if (object.mapsOptions != null) {\r\n if (typeof object.mapsOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected\");\r\n message.mapsOptions = $root.keyhole.dbroot.ClientOptionsProto.MapsOptions.fromObject(object.mapsOptions);\r\n }\r\n return message;\r\n };\r\n \r\n ClientOptionsProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.disableDiskCache = false;\r\n object.disableEmbeddedBrowserVista = false;\r\n object.drawAtmosphere = true;\r\n object.drawStars = true;\r\n object.shaderFilePrefix = \"\";\r\n object.useProtobufQuadtreePackets = false;\r\n object.useExtendedCopyrightIds = true;\r\n object.precipitationsOptions = null;\r\n object.captureOptions = null;\r\n object.show_2dMapsIcon = true;\r\n object.disableInternalBrowser = false;\r\n object.internalBrowserBlacklist = \"\";\r\n object.internalBrowserOriginWhitelist = \"*\";\r\n object.polarTileMergingLevel = 0;\r\n object.jsBridgeRequestWhitelist = \"http://*.google.com/*\";\r\n object.mapsOptions = null;\r\n }\r\n if (message.disableDiskCache != null && message.hasOwnProperty(\"disableDiskCache\"))\r\n object.disableDiskCache = message.disableDiskCache;\r\n if (message.disableEmbeddedBrowserVista != null && message.hasOwnProperty(\"disableEmbeddedBrowserVista\"))\r\n object.disableEmbeddedBrowserVista = message.disableEmbeddedBrowserVista;\r\n if (message.drawAtmosphere != null && message.hasOwnProperty(\"drawAtmosphere\"))\r\n object.drawAtmosphere = message.drawAtmosphere;\r\n if (message.drawStars != null && message.hasOwnProperty(\"drawStars\"))\r\n object.drawStars = message.drawStars;\r\n if (message.shaderFilePrefix != null && message.hasOwnProperty(\"shaderFilePrefix\"))\r\n object.shaderFilePrefix = message.shaderFilePrefix;\r\n if (message.useProtobufQuadtreePackets != null && message.hasOwnProperty(\"useProtobufQuadtreePackets\"))\r\n object.useProtobufQuadtreePackets = message.useProtobufQuadtreePackets;\r\n if (message.useExtendedCopyrightIds != null && message.hasOwnProperty(\"useExtendedCopyrightIds\"))\r\n object.useExtendedCopyrightIds = message.useExtendedCopyrightIds;\r\n if (message.precipitationsOptions != null && message.hasOwnProperty(\"precipitationsOptions\"))\r\n object.precipitationsOptions = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.toObject(message.precipitationsOptions, options);\r\n if (message.captureOptions != null && message.hasOwnProperty(\"captureOptions\"))\r\n object.captureOptions = $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions.toObject(message.captureOptions, options);\r\n if (message.show_2dMapsIcon != null && message.hasOwnProperty(\"show_2dMapsIcon\"))\r\n object.show_2dMapsIcon = message.show_2dMapsIcon;\r\n if (message.disableInternalBrowser != null && message.hasOwnProperty(\"disableInternalBrowser\"))\r\n object.disableInternalBrowser = message.disableInternalBrowser;\r\n if (message.internalBrowserBlacklist != null && message.hasOwnProperty(\"internalBrowserBlacklist\"))\r\n object.internalBrowserBlacklist = message.internalBrowserBlacklist;\r\n if (message.internalBrowserOriginWhitelist != null && message.hasOwnProperty(\"internalBrowserOriginWhitelist\"))\r\n object.internalBrowserOriginWhitelist = message.internalBrowserOriginWhitelist;\r\n if (message.polarTileMergingLevel != null && message.hasOwnProperty(\"polarTileMergingLevel\"))\r\n object.polarTileMergingLevel = message.polarTileMergingLevel;\r\n if (message.jsBridgeRequestWhitelist != null && message.hasOwnProperty(\"jsBridgeRequestWhitelist\"))\r\n object.jsBridgeRequestWhitelist = message.jsBridgeRequestWhitelist;\r\n if (message.mapsOptions != null && message.hasOwnProperty(\"mapsOptions\"))\r\n object.mapsOptions = $root.keyhole.dbroot.ClientOptionsProto.MapsOptions.toObject(message.mapsOptions, options);\r\n return object;\r\n };\r\n \r\n ClientOptionsProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n ClientOptionsProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ClientOptionsProto\";\r\n };\r\n \r\n ClientOptionsProto.PrecipitationsOptions = (function() {\r\n \r\n function PrecipitationsOptions(properties) {\r\n this.weatherMapping = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n PrecipitationsOptions.prototype.imageUrl = \"\";\r\n PrecipitationsOptions.prototype.imageExpireTime = 900;\r\n PrecipitationsOptions.prototype.maxColorDistance = 20;\r\n PrecipitationsOptions.prototype.imageLevel = 5;\r\n PrecipitationsOptions.prototype.weatherMapping = $util.emptyArray;\r\n PrecipitationsOptions.prototype.cloudsLayerUrl = \"\";\r\n PrecipitationsOptions.prototype.animationDecelerationDelay = 20;\r\n \r\n PrecipitationsOptions.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.imageUrl = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.imageExpireTime = reader.int32();\r\n break;\r\n }\r\n case 3: {\r\n message.maxColorDistance = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.imageLevel = reader.int32();\r\n break;\r\n }\r\n case 5: {\r\n if (!(message.weatherMapping && message.weatherMapping.length))\r\n message.weatherMapping = [];\r\n message.weatherMapping.push($root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 6: {\r\n message.cloudsLayerUrl = reader.string();\r\n break;\r\n }\r\n case 7: {\r\n message.animationDecelerationDelay = reader.float();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n PrecipitationsOptions.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.imageUrl != null && message.hasOwnProperty(\"imageUrl\"))\r\n if (!$util.isString(message.imageUrl))\r\n return \"imageUrl: string expected\";\r\n if (message.imageExpireTime != null && message.hasOwnProperty(\"imageExpireTime\"))\r\n if (!$util.isInteger(message.imageExpireTime))\r\n return \"imageExpireTime: integer expected\";\r\n if (message.maxColorDistance != null && message.hasOwnProperty(\"maxColorDistance\"))\r\n if (!$util.isInteger(message.maxColorDistance))\r\n return \"maxColorDistance: integer expected\";\r\n if (message.imageLevel != null && message.hasOwnProperty(\"imageLevel\"))\r\n if (!$util.isInteger(message.imageLevel))\r\n return \"imageLevel: integer expected\";\r\n if (message.weatherMapping != null && message.hasOwnProperty(\"weatherMapping\")) {\r\n if (!Array.isArray(message.weatherMapping))\r\n return \"weatherMapping: array expected\";\r\n for (var i = 0; i < message.weatherMapping.length; ++i) {\r\n var error = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.verify(message.weatherMapping[i]);\r\n if (error)\r\n return \"weatherMapping.\" + error;\r\n }\r\n }\r\n if (message.cloudsLayerUrl != null && message.hasOwnProperty(\"cloudsLayerUrl\"))\r\n if (!$util.isString(message.cloudsLayerUrl))\r\n return \"cloudsLayerUrl: string expected\";\r\n if (message.animationDecelerationDelay != null && message.hasOwnProperty(\"animationDecelerationDelay\"))\r\n if (typeof message.animationDecelerationDelay !== \"number\")\r\n return \"animationDecelerationDelay: number expected\";\r\n return null;\r\n };\r\n \r\n PrecipitationsOptions.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions();\r\n if (object.imageUrl != null)\r\n message.imageUrl = String(object.imageUrl);\r\n if (object.imageExpireTime != null)\r\n message.imageExpireTime = object.imageExpireTime | 0;\r\n if (object.maxColorDistance != null)\r\n message.maxColorDistance = object.maxColorDistance | 0;\r\n if (object.imageLevel != null)\r\n message.imageLevel = object.imageLevel | 0;\r\n if (object.weatherMapping) {\r\n if (!Array.isArray(object.weatherMapping))\r\n throw TypeError(\".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: array expected\");\r\n message.weatherMapping = [];\r\n for (var i = 0; i < object.weatherMapping.length; ++i) {\r\n if (typeof object.weatherMapping[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: object expected\");\r\n message.weatherMapping[i] = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.fromObject(object.weatherMapping[i]);\r\n }\r\n }\r\n if (object.cloudsLayerUrl != null)\r\n message.cloudsLayerUrl = String(object.cloudsLayerUrl);\r\n if (object.animationDecelerationDelay != null)\r\n message.animationDecelerationDelay = Number(object.animationDecelerationDelay);\r\n return message;\r\n };\r\n \r\n PrecipitationsOptions.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.weatherMapping = [];\r\n if (options.defaults) {\r\n object.imageUrl = \"\";\r\n object.imageExpireTime = 900;\r\n object.maxColorDistance = 20;\r\n object.imageLevel = 5;\r\n object.cloudsLayerUrl = \"\";\r\n object.animationDecelerationDelay = 20;\r\n }\r\n if (message.imageUrl != null && message.hasOwnProperty(\"imageUrl\"))\r\n object.imageUrl = message.imageUrl;\r\n if (message.imageExpireTime != null && message.hasOwnProperty(\"imageExpireTime\"))\r\n object.imageExpireTime = message.imageExpireTime;\r\n if (message.maxColorDistance != null && message.hasOwnProperty(\"maxColorDistance\"))\r\n object.maxColorDistance = message.maxColorDistance;\r\n if (message.imageLevel != null && message.hasOwnProperty(\"imageLevel\"))\r\n object.imageLevel = message.imageLevel;\r\n if (message.weatherMapping && message.weatherMapping.length) {\r\n object.weatherMapping = [];\r\n for (var j = 0; j < message.weatherMapping.length; ++j)\r\n object.weatherMapping[j] = $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.toObject(message.weatherMapping[j], options);\r\n }\r\n if (message.cloudsLayerUrl != null && message.hasOwnProperty(\"cloudsLayerUrl\"))\r\n object.cloudsLayerUrl = message.cloudsLayerUrl;\r\n if (message.animationDecelerationDelay != null && message.hasOwnProperty(\"animationDecelerationDelay\"))\r\n object.animationDecelerationDelay = options.json && !isFinite(message.animationDecelerationDelay) ? String(message.animationDecelerationDelay) : message.animationDecelerationDelay;\r\n return object;\r\n };\r\n \r\n PrecipitationsOptions.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n PrecipitationsOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions\";\r\n };\r\n \r\n PrecipitationsOptions.WeatherMapping = (function() {\r\n \r\n function WeatherMapping(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n WeatherMapping.prototype.colorAbgr = 0;\r\n WeatherMapping.prototype.weatherType = 0;\r\n WeatherMapping.prototype.elongation = 1;\r\n WeatherMapping.prototype.opacity = 0;\r\n WeatherMapping.prototype.fogDensity = 0;\r\n WeatherMapping.prototype.speed0 = 0;\r\n WeatherMapping.prototype.speed1 = 0;\r\n WeatherMapping.prototype.speed2 = 0;\r\n WeatherMapping.prototype.speed3 = 0;\r\n \r\n WeatherMapping.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.colorAbgr = reader.uint32();\r\n break;\r\n }\r\n case 2: {\r\n message.weatherType = reader.int32();\r\n break;\r\n }\r\n case 3: {\r\n message.elongation = reader.float();\r\n break;\r\n }\r\n case 4: {\r\n message.opacity = reader.float();\r\n break;\r\n }\r\n case 5: {\r\n message.fogDensity = reader.float();\r\n break;\r\n }\r\n case 6: {\r\n message.speed0 = reader.float();\r\n break;\r\n }\r\n case 7: {\r\n message.speed1 = reader.float();\r\n break;\r\n }\r\n case 8: {\r\n message.speed2 = reader.float();\r\n break;\r\n }\r\n case 9: {\r\n message.speed3 = reader.float();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"colorAbgr\"))\r\n throw $util.ProtocolError(\"missing required 'colorAbgr'\", { instance: message });\r\n if (!message.hasOwnProperty(\"weatherType\"))\r\n throw $util.ProtocolError(\"missing required 'weatherType'\", { instance: message });\r\n return message;\r\n };\r\n \r\n WeatherMapping.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isInteger(message.colorAbgr))\r\n return \"colorAbgr: integer expected\";\r\n switch (message.weatherType) {\r\n default:\r\n return \"weatherType: enum value expected\";\r\n case 0:\r\n case 1:\r\n case 2:\r\n break;\r\n }\r\n if (message.elongation != null && message.hasOwnProperty(\"elongation\"))\r\n if (typeof message.elongation !== \"number\")\r\n return \"elongation: number expected\";\r\n if (message.opacity != null && message.hasOwnProperty(\"opacity\"))\r\n if (typeof message.opacity !== \"number\")\r\n return \"opacity: number expected\";\r\n if (message.fogDensity != null && message.hasOwnProperty(\"fogDensity\"))\r\n if (typeof message.fogDensity !== \"number\")\r\n return \"fogDensity: number expected\";\r\n if (message.speed0 != null && message.hasOwnProperty(\"speed0\"))\r\n if (typeof message.speed0 !== \"number\")\r\n return \"speed0: number expected\";\r\n if (message.speed1 != null && message.hasOwnProperty(\"speed1\"))\r\n if (typeof message.speed1 !== \"number\")\r\n return \"speed1: number expected\";\r\n if (message.speed2 != null && message.hasOwnProperty(\"speed2\"))\r\n if (typeof message.speed2 !== \"number\")\r\n return \"speed2: number expected\";\r\n if (message.speed3 != null && message.hasOwnProperty(\"speed3\"))\r\n if (typeof message.speed3 !== \"number\")\r\n return \"speed3: number expected\";\r\n return null;\r\n };\r\n \r\n WeatherMapping.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping();\r\n if (object.colorAbgr != null)\r\n message.colorAbgr = object.colorAbgr >>> 0;\r\n switch (object.weatherType) {\r\n case \"NO_PRECIPITATION\":\r\n case 0:\r\n message.weatherType = 0;\r\n break;\r\n case \"RAIN\":\r\n case 1:\r\n message.weatherType = 1;\r\n break;\r\n case \"SNOW\":\r\n case 2:\r\n message.weatherType = 2;\r\n break;\r\n }\r\n if (object.elongation != null)\r\n message.elongation = Number(object.elongation);\r\n if (object.opacity != null)\r\n message.opacity = Number(object.opacity);\r\n if (object.fogDensity != null)\r\n message.fogDensity = Number(object.fogDensity);\r\n if (object.speed0 != null)\r\n message.speed0 = Number(object.speed0);\r\n if (object.speed1 != null)\r\n message.speed1 = Number(object.speed1);\r\n if (object.speed2 != null)\r\n message.speed2 = Number(object.speed2);\r\n if (object.speed3 != null)\r\n message.speed3 = Number(object.speed3);\r\n return message;\r\n };\r\n \r\n WeatherMapping.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.colorAbgr = 0;\r\n object.weatherType = options.enums === String ? \"NO_PRECIPITATION\" : 0;\r\n object.elongation = 1;\r\n object.opacity = 0;\r\n object.fogDensity = 0;\r\n object.speed0 = 0;\r\n object.speed1 = 0;\r\n object.speed2 = 0;\r\n object.speed3 = 0;\r\n }\r\n if (message.colorAbgr != null && message.hasOwnProperty(\"colorAbgr\"))\r\n object.colorAbgr = message.colorAbgr;\r\n if (message.weatherType != null && message.hasOwnProperty(\"weatherType\"))\r\n object.weatherType = options.enums === String ? $root.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.WeatherType[message.weatherType] : message.weatherType;\r\n if (message.elongation != null && message.hasOwnProperty(\"elongation\"))\r\n object.elongation = options.json && !isFinite(message.elongation) ? String(message.elongation) : message.elongation;\r\n if (message.opacity != null && message.hasOwnProperty(\"opacity\"))\r\n object.opacity = options.json && !isFinite(message.opacity) ? String(message.opacity) : message.opacity;\r\n if (message.fogDensity != null && message.hasOwnProperty(\"fogDensity\"))\r\n object.fogDensity = options.json && !isFinite(message.fogDensity) ? String(message.fogDensity) : message.fogDensity;\r\n if (message.speed0 != null && message.hasOwnProperty(\"speed0\"))\r\n object.speed0 = options.json && !isFinite(message.speed0) ? String(message.speed0) : message.speed0;\r\n if (message.speed1 != null && message.hasOwnProperty(\"speed1\"))\r\n object.speed1 = options.json && !isFinite(message.speed1) ? String(message.speed1) : message.speed1;\r\n if (message.speed2 != null && message.hasOwnProperty(\"speed2\"))\r\n object.speed2 = options.json && !isFinite(message.speed2) ? String(message.speed2) : message.speed2;\r\n if (message.speed3 != null && message.hasOwnProperty(\"speed3\"))\r\n object.speed3 = options.json && !isFinite(message.speed3) ? String(message.speed3) : message.speed3;\r\n return object;\r\n };\r\n \r\n WeatherMapping.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n WeatherMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping\";\r\n };\r\n \r\n WeatherMapping.WeatherType = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[0] = \"NO_PRECIPITATION\"] = 0;\r\n values[valuesById[1] = \"RAIN\"] = 1;\r\n values[valuesById[2] = \"SNOW\"] = 2;\r\n return values;\r\n })();\r\n \r\n return WeatherMapping;\r\n })();\r\n \r\n return PrecipitationsOptions;\r\n })();\r\n \r\n ClientOptionsProto.CaptureOptions = (function() {\r\n \r\n function CaptureOptions(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n CaptureOptions.prototype.allowSaveAsImage = true;\r\n CaptureOptions.prototype.maxFreeCaptureRes = 2400;\r\n CaptureOptions.prototype.maxPremiumCaptureRes = 4800;\r\n \r\n CaptureOptions.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.allowSaveAsImage = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.maxFreeCaptureRes = reader.int32();\r\n break;\r\n }\r\n case 3: {\r\n message.maxPremiumCaptureRes = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n CaptureOptions.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.allowSaveAsImage != null && message.hasOwnProperty(\"allowSaveAsImage\"))\r\n if (typeof message.allowSaveAsImage !== \"boolean\")\r\n return \"allowSaveAsImage: boolean expected\";\r\n if (message.maxFreeCaptureRes != null && message.hasOwnProperty(\"maxFreeCaptureRes\"))\r\n if (!$util.isInteger(message.maxFreeCaptureRes))\r\n return \"maxFreeCaptureRes: integer expected\";\r\n if (message.maxPremiumCaptureRes != null && message.hasOwnProperty(\"maxPremiumCaptureRes\"))\r\n if (!$util.isInteger(message.maxPremiumCaptureRes))\r\n return \"maxPremiumCaptureRes: integer expected\";\r\n return null;\r\n };\r\n \r\n CaptureOptions.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ClientOptionsProto.CaptureOptions();\r\n if (object.allowSaveAsImage != null)\r\n message.allowSaveAsImage = Boolean(object.allowSaveAsImage);\r\n if (object.maxFreeCaptureRes != null)\r\n message.maxFreeCaptureRes = object.maxFreeCaptureRes | 0;\r\n if (object.maxPremiumCaptureRes != null)\r\n message.maxPremiumCaptureRes = object.maxPremiumCaptureRes | 0;\r\n return message;\r\n };\r\n \r\n CaptureOptions.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.allowSaveAsImage = true;\r\n object.maxFreeCaptureRes = 2400;\r\n object.maxPremiumCaptureRes = 4800;\r\n }\r\n if (message.allowSaveAsImage != null && message.hasOwnProperty(\"allowSaveAsImage\"))\r\n object.allowSaveAsImage = message.allowSaveAsImage;\r\n if (message.maxFreeCaptureRes != null && message.hasOwnProperty(\"maxFreeCaptureRes\"))\r\n object.maxFreeCaptureRes = message.maxFreeCaptureRes;\r\n if (message.maxPremiumCaptureRes != null && message.hasOwnProperty(\"maxPremiumCaptureRes\"))\r\n object.maxPremiumCaptureRes = message.maxPremiumCaptureRes;\r\n return object;\r\n };\r\n \r\n CaptureOptions.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n CaptureOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ClientOptionsProto.CaptureOptions\";\r\n };\r\n \r\n return CaptureOptions;\r\n })();\r\n \r\n ClientOptionsProto.MapsOptions = (function() {\r\n \r\n function MapsOptions(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n MapsOptions.prototype.enableMaps = false;\r\n MapsOptions.prototype.docsAutoDownloadEnabled = false;\r\n MapsOptions.prototype.docsAutoDownloadInterval = 0;\r\n MapsOptions.prototype.docsAutoUploadEnabled = false;\r\n MapsOptions.prototype.docsAutoUploadDelay = 0;\r\n \r\n MapsOptions.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ClientOptionsProto.MapsOptions();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.enableMaps = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.docsAutoDownloadEnabled = reader.bool();\r\n break;\r\n }\r\n case 3: {\r\n message.docsAutoDownloadInterval = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.docsAutoUploadEnabled = reader.bool();\r\n break;\r\n }\r\n case 5: {\r\n message.docsAutoUploadDelay = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n MapsOptions.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.enableMaps != null && message.hasOwnProperty(\"enableMaps\"))\r\n if (typeof message.enableMaps !== \"boolean\")\r\n return \"enableMaps: boolean expected\";\r\n if (message.docsAutoDownloadEnabled != null && message.hasOwnProperty(\"docsAutoDownloadEnabled\"))\r\n if (typeof message.docsAutoDownloadEnabled !== \"boolean\")\r\n return \"docsAutoDownloadEnabled: boolean expected\";\r\n if (message.docsAutoDownloadInterval != null && message.hasOwnProperty(\"docsAutoDownloadInterval\"))\r\n if (!$util.isInteger(message.docsAutoDownloadInterval))\r\n return \"docsAutoDownloadInterval: integer expected\";\r\n if (message.docsAutoUploadEnabled != null && message.hasOwnProperty(\"docsAutoUploadEnabled\"))\r\n if (typeof message.docsAutoUploadEnabled !== \"boolean\")\r\n return \"docsAutoUploadEnabled: boolean expected\";\r\n if (message.docsAutoUploadDelay != null && message.hasOwnProperty(\"docsAutoUploadDelay\"))\r\n if (!$util.isInteger(message.docsAutoUploadDelay))\r\n return \"docsAutoUploadDelay: integer expected\";\r\n return null;\r\n };\r\n \r\n MapsOptions.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ClientOptionsProto.MapsOptions)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ClientOptionsProto.MapsOptions();\r\n if (object.enableMaps != null)\r\n message.enableMaps = Boolean(object.enableMaps);\r\n if (object.docsAutoDownloadEnabled != null)\r\n message.docsAutoDownloadEnabled = Boolean(object.docsAutoDownloadEnabled);\r\n if (object.docsAutoDownloadInterval != null)\r\n message.docsAutoDownloadInterval = object.docsAutoDownloadInterval | 0;\r\n if (object.docsAutoUploadEnabled != null)\r\n message.docsAutoUploadEnabled = Boolean(object.docsAutoUploadEnabled);\r\n if (object.docsAutoUploadDelay != null)\r\n message.docsAutoUploadDelay = object.docsAutoUploadDelay | 0;\r\n return message;\r\n };\r\n \r\n MapsOptions.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.enableMaps = false;\r\n object.docsAutoDownloadEnabled = false;\r\n object.docsAutoDownloadInterval = 0;\r\n object.docsAutoUploadEnabled = false;\r\n object.docsAutoUploadDelay = 0;\r\n }\r\n if (message.enableMaps != null && message.hasOwnProperty(\"enableMaps\"))\r\n object.enableMaps = message.enableMaps;\r\n if (message.docsAutoDownloadEnabled != null && message.hasOwnProperty(\"docsAutoDownloadEnabled\"))\r\n object.docsAutoDownloadEnabled = message.docsAutoDownloadEnabled;\r\n if (message.docsAutoDownloadInterval != null && message.hasOwnProperty(\"docsAutoDownloadInterval\"))\r\n object.docsAutoDownloadInterval = message.docsAutoDownloadInterval;\r\n if (message.docsAutoUploadEnabled != null && message.hasOwnProperty(\"docsAutoUploadEnabled\"))\r\n object.docsAutoUploadEnabled = message.docsAutoUploadEnabled;\r\n if (message.docsAutoUploadDelay != null && message.hasOwnProperty(\"docsAutoUploadDelay\"))\r\n object.docsAutoUploadDelay = message.docsAutoUploadDelay;\r\n return object;\r\n };\r\n \r\n MapsOptions.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n MapsOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ClientOptionsProto.MapsOptions\";\r\n };\r\n \r\n return MapsOptions;\r\n })();\r\n \r\n return ClientOptionsProto;\r\n })();\r\n \r\n dbroot.FetchingOptionsProto = (function() {\r\n \r\n function FetchingOptionsProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n FetchingOptionsProto.prototype.maxRequestsPerQuery = 1;\r\n FetchingOptionsProto.prototype.forceMaxRequestsPerQuery = false;\r\n FetchingOptionsProto.prototype.sortBatches = false;\r\n FetchingOptionsProto.prototype.maxDrawable = 2;\r\n FetchingOptionsProto.prototype.maxImagery = 2;\r\n FetchingOptionsProto.prototype.maxTerrain = 5;\r\n FetchingOptionsProto.prototype.maxQuadtree = 5;\r\n FetchingOptionsProto.prototype.maxDioramaMetadata = 1;\r\n FetchingOptionsProto.prototype.maxDioramaData = 0;\r\n FetchingOptionsProto.prototype.maxConsumerFetchRatio = 1;\r\n FetchingOptionsProto.prototype.maxProEcFetchRatio = 0;\r\n FetchingOptionsProto.prototype.safeOverallQps = 0;\r\n FetchingOptionsProto.prototype.safeImageryQps = 0;\r\n FetchingOptionsProto.prototype.domainsForHttps = \"google.com gstatic.com\";\r\n FetchingOptionsProto.prototype.hostsForHttp = \"\";\r\n \r\n FetchingOptionsProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.FetchingOptionsProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.maxRequestsPerQuery = reader.int32();\r\n break;\r\n }\r\n case 12: {\r\n message.forceMaxRequestsPerQuery = reader.bool();\r\n break;\r\n }\r\n case 13: {\r\n message.sortBatches = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.maxDrawable = reader.int32();\r\n break;\r\n }\r\n case 3: {\r\n message.maxImagery = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.maxTerrain = reader.int32();\r\n break;\r\n }\r\n case 5: {\r\n message.maxQuadtree = reader.int32();\r\n break;\r\n }\r\n case 6: {\r\n message.maxDioramaMetadata = reader.int32();\r\n break;\r\n }\r\n case 7: {\r\n message.maxDioramaData = reader.int32();\r\n break;\r\n }\r\n case 8: {\r\n message.maxConsumerFetchRatio = reader.float();\r\n break;\r\n }\r\n case 9: {\r\n message.maxProEcFetchRatio = reader.float();\r\n break;\r\n }\r\n case 10: {\r\n message.safeOverallQps = reader.float();\r\n break;\r\n }\r\n case 11: {\r\n message.safeImageryQps = reader.float();\r\n break;\r\n }\r\n case 14: {\r\n message.domainsForHttps = reader.string();\r\n break;\r\n }\r\n case 15: {\r\n message.hostsForHttp = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n FetchingOptionsProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.maxRequestsPerQuery != null && message.hasOwnProperty(\"maxRequestsPerQuery\"))\r\n if (!$util.isInteger(message.maxRequestsPerQuery))\r\n return \"maxRequestsPerQuery: integer expected\";\r\n if (message.forceMaxRequestsPerQuery != null && message.hasOwnProperty(\"forceMaxRequestsPerQuery\"))\r\n if (typeof message.forceMaxRequestsPerQuery !== \"boolean\")\r\n return \"forceMaxRequestsPerQuery: boolean expected\";\r\n if (message.sortBatches != null && message.hasOwnProperty(\"sortBatches\"))\r\n if (typeof message.sortBatches !== \"boolean\")\r\n return \"sortBatches: boolean expected\";\r\n if (message.maxDrawable != null && message.hasOwnProperty(\"maxDrawable\"))\r\n if (!$util.isInteger(message.maxDrawable))\r\n return \"maxDrawable: integer expected\";\r\n if (message.maxImagery != null && message.hasOwnProperty(\"maxImagery\"))\r\n if (!$util.isInteger(message.maxImagery))\r\n return \"maxImagery: integer expected\";\r\n if (message.maxTerrain != null && message.hasOwnProperty(\"maxTerrain\"))\r\n if (!$util.isInteger(message.maxTerrain))\r\n return \"maxTerrain: integer expected\";\r\n if (message.maxQuadtree != null && message.hasOwnProperty(\"maxQuadtree\"))\r\n if (!$util.isInteger(message.maxQuadtree))\r\n return \"maxQuadtree: integer expected\";\r\n if (message.maxDioramaMetadata != null && message.hasOwnProperty(\"maxDioramaMetadata\"))\r\n if (!$util.isInteger(message.maxDioramaMetadata))\r\n return \"maxDioramaMetadata: integer expected\";\r\n if (message.maxDioramaData != null && message.hasOwnProperty(\"maxDioramaData\"))\r\n if (!$util.isInteger(message.maxDioramaData))\r\n return \"maxDioramaData: integer expected\";\r\n if (message.maxConsumerFetchRatio != null && message.hasOwnProperty(\"maxConsumerFetchRatio\"))\r\n if (typeof message.maxConsumerFetchRatio !== \"number\")\r\n return \"maxConsumerFetchRatio: number expected\";\r\n if (message.maxProEcFetchRatio != null && message.hasOwnProperty(\"maxProEcFetchRatio\"))\r\n if (typeof message.maxProEcFetchRatio !== \"number\")\r\n return \"maxProEcFetchRatio: number expected\";\r\n if (message.safeOverallQps != null && message.hasOwnProperty(\"safeOverallQps\"))\r\n if (typeof message.safeOverallQps !== \"number\")\r\n return \"safeOverallQps: number expected\";\r\n if (message.safeImageryQps != null && message.hasOwnProperty(\"safeImageryQps\"))\r\n if (typeof message.safeImageryQps !== \"number\")\r\n return \"safeImageryQps: number expected\";\r\n if (message.domainsForHttps != null && message.hasOwnProperty(\"domainsForHttps\"))\r\n if (!$util.isString(message.domainsForHttps))\r\n return \"domainsForHttps: string expected\";\r\n if (message.hostsForHttp != null && message.hasOwnProperty(\"hostsForHttp\"))\r\n if (!$util.isString(message.hostsForHttp))\r\n return \"hostsForHttp: string expected\";\r\n return null;\r\n };\r\n \r\n FetchingOptionsProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.FetchingOptionsProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.FetchingOptionsProto();\r\n if (object.maxRequestsPerQuery != null)\r\n message.maxRequestsPerQuery = object.maxRequestsPerQuery | 0;\r\n if (object.forceMaxRequestsPerQuery != null)\r\n message.forceMaxRequestsPerQuery = Boolean(object.forceMaxRequestsPerQuery);\r\n if (object.sortBatches != null)\r\n message.sortBatches = Boolean(object.sortBatches);\r\n if (object.maxDrawable != null)\r\n message.maxDrawable = object.maxDrawable | 0;\r\n if (object.maxImagery != null)\r\n message.maxImagery = object.maxImagery | 0;\r\n if (object.maxTerrain != null)\r\n message.maxTerrain = object.maxTerrain | 0;\r\n if (object.maxQuadtree != null)\r\n message.maxQuadtree = object.maxQuadtree | 0;\r\n if (object.maxDioramaMetadata != null)\r\n message.maxDioramaMetadata = object.maxDioramaMetadata | 0;\r\n if (object.maxDioramaData != null)\r\n message.maxDioramaData = object.maxDioramaData | 0;\r\n if (object.maxConsumerFetchRatio != null)\r\n message.maxConsumerFetchRatio = Number(object.maxConsumerFetchRatio);\r\n if (object.maxProEcFetchRatio != null)\r\n message.maxProEcFetchRatio = Number(object.maxProEcFetchRatio);\r\n if (object.safeOverallQps != null)\r\n message.safeOverallQps = Number(object.safeOverallQps);\r\n if (object.safeImageryQps != null)\r\n message.safeImageryQps = Number(object.safeImageryQps);\r\n if (object.domainsForHttps != null)\r\n message.domainsForHttps = String(object.domainsForHttps);\r\n if (object.hostsForHttp != null)\r\n message.hostsForHttp = String(object.hostsForHttp);\r\n return message;\r\n };\r\n \r\n FetchingOptionsProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.maxRequestsPerQuery = 1;\r\n object.maxDrawable = 2;\r\n object.maxImagery = 2;\r\n object.maxTerrain = 5;\r\n object.maxQuadtree = 5;\r\n object.maxDioramaMetadata = 1;\r\n object.maxDioramaData = 0;\r\n object.maxConsumerFetchRatio = 1;\r\n object.maxProEcFetchRatio = 0;\r\n object.safeOverallQps = 0;\r\n object.safeImageryQps = 0;\r\n object.forceMaxRequestsPerQuery = false;\r\n object.sortBatches = false;\r\n object.domainsForHttps = \"google.com gstatic.com\";\r\n object.hostsForHttp = \"\";\r\n }\r\n if (message.maxRequestsPerQuery != null && message.hasOwnProperty(\"maxRequestsPerQuery\"))\r\n object.maxRequestsPerQuery = message.maxRequestsPerQuery;\r\n if (message.maxDrawable != null && message.hasOwnProperty(\"maxDrawable\"))\r\n object.maxDrawable = message.maxDrawable;\r\n if (message.maxImagery != null && message.hasOwnProperty(\"maxImagery\"))\r\n object.maxImagery = message.maxImagery;\r\n if (message.maxTerrain != null && message.hasOwnProperty(\"maxTerrain\"))\r\n object.maxTerrain = message.maxTerrain;\r\n if (message.maxQuadtree != null && message.hasOwnProperty(\"maxQuadtree\"))\r\n object.maxQuadtree = message.maxQuadtree;\r\n if (message.maxDioramaMetadata != null && message.hasOwnProperty(\"maxDioramaMetadata\"))\r\n object.maxDioramaMetadata = message.maxDioramaMetadata;\r\n if (message.maxDioramaData != null && message.hasOwnProperty(\"maxDioramaData\"))\r\n object.maxDioramaData = message.maxDioramaData;\r\n if (message.maxConsumerFetchRatio != null && message.hasOwnProperty(\"maxConsumerFetchRatio\"))\r\n object.maxConsumerFetchRatio = options.json && !isFinite(message.maxConsumerFetchRatio) ? String(message.maxConsumerFetchRatio) : message.maxConsumerFetchRatio;\r\n if (message.maxProEcFetchRatio != null && message.hasOwnProperty(\"maxProEcFetchRatio\"))\r\n object.maxProEcFetchRatio = options.json && !isFinite(message.maxProEcFetchRatio) ? String(message.maxProEcFetchRatio) : message.maxProEcFetchRatio;\r\n if (message.safeOverallQps != null && message.hasOwnProperty(\"safeOverallQps\"))\r\n object.safeOverallQps = options.json && !isFinite(message.safeOverallQps) ? String(message.safeOverallQps) : message.safeOverallQps;\r\n if (message.safeImageryQps != null && message.hasOwnProperty(\"safeImageryQps\"))\r\n object.safeImageryQps = options.json && !isFinite(message.safeImageryQps) ? String(message.safeImageryQps) : message.safeImageryQps;\r\n if (message.forceMaxRequestsPerQuery != null && message.hasOwnProperty(\"forceMaxRequestsPerQuery\"))\r\n object.forceMaxRequestsPerQuery = message.forceMaxRequestsPerQuery;\r\n if (message.sortBatches != null && message.hasOwnProperty(\"sortBatches\"))\r\n object.sortBatches = message.sortBatches;\r\n if (message.domainsForHttps != null && message.hasOwnProperty(\"domainsForHttps\"))\r\n object.domainsForHttps = message.domainsForHttps;\r\n if (message.hostsForHttp != null && message.hasOwnProperty(\"hostsForHttp\"))\r\n object.hostsForHttp = message.hostsForHttp;\r\n return object;\r\n };\r\n \r\n FetchingOptionsProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n FetchingOptionsProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.FetchingOptionsProto\";\r\n };\r\n \r\n return FetchingOptionsProto;\r\n })();\r\n \r\n dbroot.TimeMachineOptionsProto = (function() {\r\n \r\n function TimeMachineOptionsProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n TimeMachineOptionsProto.prototype.serverUrl = \"\";\r\n TimeMachineOptionsProto.prototype.isTimemachine = false;\r\n TimeMachineOptionsProto.prototype.dwellTimeMs = 500;\r\n TimeMachineOptionsProto.prototype.discoverabilityAltitudeMeters = 15000;\r\n \r\n TimeMachineOptionsProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.TimeMachineOptionsProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.serverUrl = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.isTimemachine = reader.bool();\r\n break;\r\n }\r\n case 3: {\r\n message.dwellTimeMs = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.discoverabilityAltitudeMeters = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n TimeMachineOptionsProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.serverUrl != null && message.hasOwnProperty(\"serverUrl\"))\r\n if (!$util.isString(message.serverUrl))\r\n return \"serverUrl: string expected\";\r\n if (message.isTimemachine != null && message.hasOwnProperty(\"isTimemachine\"))\r\n if (typeof message.isTimemachine !== \"boolean\")\r\n return \"isTimemachine: boolean expected\";\r\n if (message.dwellTimeMs != null && message.hasOwnProperty(\"dwellTimeMs\"))\r\n if (!$util.isInteger(message.dwellTimeMs))\r\n return \"dwellTimeMs: integer expected\";\r\n if (message.discoverabilityAltitudeMeters != null && message.hasOwnProperty(\"discoverabilityAltitudeMeters\"))\r\n if (!$util.isInteger(message.discoverabilityAltitudeMeters))\r\n return \"discoverabilityAltitudeMeters: integer expected\";\r\n return null;\r\n };\r\n \r\n TimeMachineOptionsProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.TimeMachineOptionsProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.TimeMachineOptionsProto();\r\n if (object.serverUrl != null)\r\n message.serverUrl = String(object.serverUrl);\r\n if (object.isTimemachine != null)\r\n message.isTimemachine = Boolean(object.isTimemachine);\r\n if (object.dwellTimeMs != null)\r\n message.dwellTimeMs = object.dwellTimeMs | 0;\r\n if (object.discoverabilityAltitudeMeters != null)\r\n message.discoverabilityAltitudeMeters = object.discoverabilityAltitudeMeters | 0;\r\n return message;\r\n };\r\n \r\n TimeMachineOptionsProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.serverUrl = \"\";\r\n object.isTimemachine = false;\r\n object.dwellTimeMs = 500;\r\n object.discoverabilityAltitudeMeters = 15000;\r\n }\r\n if (message.serverUrl != null && message.hasOwnProperty(\"serverUrl\"))\r\n object.serverUrl = message.serverUrl;\r\n if (message.isTimemachine != null && message.hasOwnProperty(\"isTimemachine\"))\r\n object.isTimemachine = message.isTimemachine;\r\n if (message.dwellTimeMs != null && message.hasOwnProperty(\"dwellTimeMs\"))\r\n object.dwellTimeMs = message.dwellTimeMs;\r\n if (message.discoverabilityAltitudeMeters != null && message.hasOwnProperty(\"discoverabilityAltitudeMeters\"))\r\n object.discoverabilityAltitudeMeters = message.discoverabilityAltitudeMeters;\r\n return object;\r\n };\r\n \r\n TimeMachineOptionsProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n TimeMachineOptionsProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.TimeMachineOptionsProto\";\r\n };\r\n \r\n return TimeMachineOptionsProto;\r\n })();\r\n \r\n dbroot.AutopiaOptionsProto = (function() {\r\n \r\n function AutopiaOptionsProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n AutopiaOptionsProto.prototype.metadataServerUrl = \"http://cbk0.google.com/cbk\";\r\n AutopiaOptionsProto.prototype.depthmapServerUrl = \"http://cbk0.google.com/cbk\";\r\n AutopiaOptionsProto.prototype.coverageOverlayUrl = \"\";\r\n AutopiaOptionsProto.prototype.maxImageryQps = 0;\r\n AutopiaOptionsProto.prototype.maxMetadataDepthmapQps = 0;\r\n \r\n AutopiaOptionsProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.AutopiaOptionsProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.metadataServerUrl = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.depthmapServerUrl = reader.string();\r\n break;\r\n }\r\n case 3: {\r\n message.coverageOverlayUrl = reader.string();\r\n break;\r\n }\r\n case 4: {\r\n message.maxImageryQps = reader.float();\r\n break;\r\n }\r\n case 5: {\r\n message.maxMetadataDepthmapQps = reader.float();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n AutopiaOptionsProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.metadataServerUrl != null && message.hasOwnProperty(\"metadataServerUrl\"))\r\n if (!$util.isString(message.metadataServerUrl))\r\n return \"metadataServerUrl: string expected\";\r\n if (message.depthmapServerUrl != null && message.hasOwnProperty(\"depthmapServerUrl\"))\r\n if (!$util.isString(message.depthmapServerUrl))\r\n return \"depthmapServerUrl: string expected\";\r\n if (message.coverageOverlayUrl != null && message.hasOwnProperty(\"coverageOverlayUrl\"))\r\n if (!$util.isString(message.coverageOverlayUrl))\r\n return \"coverageOverlayUrl: string expected\";\r\n if (message.maxImageryQps != null && message.hasOwnProperty(\"maxImageryQps\"))\r\n if (typeof message.maxImageryQps !== \"number\")\r\n return \"maxImageryQps: number expected\";\r\n if (message.maxMetadataDepthmapQps != null && message.hasOwnProperty(\"maxMetadataDepthmapQps\"))\r\n if (typeof message.maxMetadataDepthmapQps !== \"number\")\r\n return \"maxMetadataDepthmapQps: number expected\";\r\n return null;\r\n };\r\n \r\n AutopiaOptionsProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.AutopiaOptionsProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.AutopiaOptionsProto();\r\n if (object.metadataServerUrl != null)\r\n message.metadataServerUrl = String(object.metadataServerUrl);\r\n if (object.depthmapServerUrl != null)\r\n message.depthmapServerUrl = String(object.depthmapServerUrl);\r\n if (object.coverageOverlayUrl != null)\r\n message.coverageOverlayUrl = String(object.coverageOverlayUrl);\r\n if (object.maxImageryQps != null)\r\n message.maxImageryQps = Number(object.maxImageryQps);\r\n if (object.maxMetadataDepthmapQps != null)\r\n message.maxMetadataDepthmapQps = Number(object.maxMetadataDepthmapQps);\r\n return message;\r\n };\r\n \r\n AutopiaOptionsProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.metadataServerUrl = \"http://cbk0.google.com/cbk\";\r\n object.depthmapServerUrl = \"http://cbk0.google.com/cbk\";\r\n object.coverageOverlayUrl = \"\";\r\n object.maxImageryQps = 0;\r\n object.maxMetadataDepthmapQps = 0;\r\n }\r\n if (message.metadataServerUrl != null && message.hasOwnProperty(\"metadataServerUrl\"))\r\n object.metadataServerUrl = message.metadataServerUrl;\r\n if (message.depthmapServerUrl != null && message.hasOwnProperty(\"depthmapServerUrl\"))\r\n object.depthmapServerUrl = message.depthmapServerUrl;\r\n if (message.coverageOverlayUrl != null && message.hasOwnProperty(\"coverageOverlayUrl\"))\r\n object.coverageOverlayUrl = message.coverageOverlayUrl;\r\n if (message.maxImageryQps != null && message.hasOwnProperty(\"maxImageryQps\"))\r\n object.maxImageryQps = options.json && !isFinite(message.maxImageryQps) ? String(message.maxImageryQps) : message.maxImageryQps;\r\n if (message.maxMetadataDepthmapQps != null && message.hasOwnProperty(\"maxMetadataDepthmapQps\"))\r\n object.maxMetadataDepthmapQps = options.json && !isFinite(message.maxMetadataDepthmapQps) ? String(message.maxMetadataDepthmapQps) : message.maxMetadataDepthmapQps;\r\n return object;\r\n };\r\n \r\n AutopiaOptionsProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n AutopiaOptionsProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.AutopiaOptionsProto\";\r\n };\r\n \r\n return AutopiaOptionsProto;\r\n })();\r\n \r\n dbroot.CSIOptionsProto = (function() {\r\n \r\n function CSIOptionsProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n CSIOptionsProto.prototype.samplingPercentage = 0;\r\n CSIOptionsProto.prototype.experimentId = \"\";\r\n \r\n CSIOptionsProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.CSIOptionsProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.samplingPercentage = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n message.experimentId = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n CSIOptionsProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.samplingPercentage != null && message.hasOwnProperty(\"samplingPercentage\"))\r\n if (!$util.isInteger(message.samplingPercentage))\r\n return \"samplingPercentage: integer expected\";\r\n if (message.experimentId != null && message.hasOwnProperty(\"experimentId\"))\r\n if (!$util.isString(message.experimentId))\r\n return \"experimentId: string expected\";\r\n return null;\r\n };\r\n \r\n CSIOptionsProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.CSIOptionsProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.CSIOptionsProto();\r\n if (object.samplingPercentage != null)\r\n message.samplingPercentage = object.samplingPercentage | 0;\r\n if (object.experimentId != null)\r\n message.experimentId = String(object.experimentId);\r\n return message;\r\n };\r\n \r\n CSIOptionsProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.samplingPercentage = 0;\r\n object.experimentId = \"\";\r\n }\r\n if (message.samplingPercentage != null && message.hasOwnProperty(\"samplingPercentage\"))\r\n object.samplingPercentage = message.samplingPercentage;\r\n if (message.experimentId != null && message.hasOwnProperty(\"experimentId\"))\r\n object.experimentId = message.experimentId;\r\n return object;\r\n };\r\n \r\n CSIOptionsProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n CSIOptionsProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.CSIOptionsProto\";\r\n };\r\n \r\n return CSIOptionsProto;\r\n })();\r\n \r\n dbroot.SearchTabProto = (function() {\r\n \r\n function SearchTabProto(properties) {\r\n this.inputBox = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SearchTabProto.prototype.isVisible = false;\r\n SearchTabProto.prototype.tabLabel = null;\r\n SearchTabProto.prototype.baseUrl = \"\";\r\n SearchTabProto.prototype.viewportPrefix = \"\";\r\n SearchTabProto.prototype.inputBox = $util.emptyArray;\r\n SearchTabProto.prototype.requirement = null;\r\n \r\n SearchTabProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.SearchTabProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.isVisible = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.tabLabel = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.baseUrl = reader.string();\r\n break;\r\n }\r\n case 4: {\r\n message.viewportPrefix = reader.string();\r\n break;\r\n }\r\n case 5: {\r\n if (!(message.inputBox && message.inputBox.length))\r\n message.inputBox = [];\r\n message.inputBox.push($root.keyhole.dbroot.SearchTabProto.InputBoxInfo.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 6: {\r\n message.requirement = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"isVisible\"))\r\n throw $util.ProtocolError(\"missing required 'isVisible'\", { instance: message });\r\n return message;\r\n };\r\n \r\n SearchTabProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (typeof message.isVisible !== \"boolean\")\r\n return \"isVisible: boolean expected\";\r\n if (message.tabLabel != null && message.hasOwnProperty(\"tabLabel\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.tabLabel);\r\n if (error)\r\n return \"tabLabel.\" + error;\r\n }\r\n if (message.baseUrl != null && message.hasOwnProperty(\"baseUrl\"))\r\n if (!$util.isString(message.baseUrl))\r\n return \"baseUrl: string expected\";\r\n if (message.viewportPrefix != null && message.hasOwnProperty(\"viewportPrefix\"))\r\n if (!$util.isString(message.viewportPrefix))\r\n return \"viewportPrefix: string expected\";\r\n if (message.inputBox != null && message.hasOwnProperty(\"inputBox\")) {\r\n if (!Array.isArray(message.inputBox))\r\n return \"inputBox: array expected\";\r\n for (var i = 0; i < message.inputBox.length; ++i) {\r\n var error = $root.keyhole.dbroot.SearchTabProto.InputBoxInfo.verify(message.inputBox[i]);\r\n if (error)\r\n return \"inputBox.\" + error;\r\n }\r\n }\r\n if (message.requirement != null && message.hasOwnProperty(\"requirement\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirement);\r\n if (error)\r\n return \"requirement.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n SearchTabProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.SearchTabProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.SearchTabProto();\r\n if (object.isVisible != null)\r\n message.isVisible = Boolean(object.isVisible);\r\n if (object.tabLabel != null) {\r\n if (typeof object.tabLabel !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.SearchTabProto.tabLabel: object expected\");\r\n message.tabLabel = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.tabLabel);\r\n }\r\n if (object.baseUrl != null)\r\n message.baseUrl = String(object.baseUrl);\r\n if (object.viewportPrefix != null)\r\n message.viewportPrefix = String(object.viewportPrefix);\r\n if (object.inputBox) {\r\n if (!Array.isArray(object.inputBox))\r\n throw TypeError(\".keyhole.dbroot.SearchTabProto.inputBox: array expected\");\r\n message.inputBox = [];\r\n for (var i = 0; i < object.inputBox.length; ++i) {\r\n if (typeof object.inputBox[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.SearchTabProto.inputBox: object expected\");\r\n message.inputBox[i] = $root.keyhole.dbroot.SearchTabProto.InputBoxInfo.fromObject(object.inputBox[i]);\r\n }\r\n }\r\n if (object.requirement != null) {\r\n if (typeof object.requirement !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.SearchTabProto.requirement: object expected\");\r\n message.requirement = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirement);\r\n }\r\n return message;\r\n };\r\n \r\n SearchTabProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.inputBox = [];\r\n if (options.defaults) {\r\n object.isVisible = false;\r\n object.tabLabel = null;\r\n object.baseUrl = \"\";\r\n object.viewportPrefix = \"\";\r\n object.requirement = null;\r\n }\r\n if (message.isVisible != null && message.hasOwnProperty(\"isVisible\"))\r\n object.isVisible = message.isVisible;\r\n if (message.tabLabel != null && message.hasOwnProperty(\"tabLabel\"))\r\n object.tabLabel = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.tabLabel, options);\r\n if (message.baseUrl != null && message.hasOwnProperty(\"baseUrl\"))\r\n object.baseUrl = message.baseUrl;\r\n if (message.viewportPrefix != null && message.hasOwnProperty(\"viewportPrefix\"))\r\n object.viewportPrefix = message.viewportPrefix;\r\n if (message.inputBox && message.inputBox.length) {\r\n object.inputBox = [];\r\n for (var j = 0; j < message.inputBox.length; ++j)\r\n object.inputBox[j] = $root.keyhole.dbroot.SearchTabProto.InputBoxInfo.toObject(message.inputBox[j], options);\r\n }\r\n if (message.requirement != null && message.hasOwnProperty(\"requirement\"))\r\n object.requirement = $root.keyhole.dbroot.RequirementProto.toObject(message.requirement, options);\r\n return object;\r\n };\r\n \r\n SearchTabProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SearchTabProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.SearchTabProto\";\r\n };\r\n \r\n SearchTabProto.InputBoxInfo = (function() {\r\n \r\n function InputBoxInfo(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n InputBoxInfo.prototype.label = null;\r\n InputBoxInfo.prototype.queryVerb = \"\";\r\n InputBoxInfo.prototype.queryPrepend = \"\";\r\n \r\n InputBoxInfo.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.SearchTabProto.InputBoxInfo();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.label = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.queryVerb = reader.string();\r\n break;\r\n }\r\n case 3: {\r\n message.queryPrepend = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"label\"))\r\n throw $util.ProtocolError(\"missing required 'label'\", { instance: message });\r\n if (!message.hasOwnProperty(\"queryVerb\"))\r\n throw $util.ProtocolError(\"missing required 'queryVerb'\", { instance: message });\r\n return message;\r\n };\r\n \r\n InputBoxInfo.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.label);\r\n if (error)\r\n return \"label.\" + error;\r\n }\r\n if (!$util.isString(message.queryVerb))\r\n return \"queryVerb: string expected\";\r\n if (message.queryPrepend != null && message.hasOwnProperty(\"queryPrepend\"))\r\n if (!$util.isString(message.queryPrepend))\r\n return \"queryPrepend: string expected\";\r\n return null;\r\n };\r\n \r\n InputBoxInfo.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.SearchTabProto.InputBoxInfo)\r\n return object;\r\n var message = new $root.keyhole.dbroot.SearchTabProto.InputBoxInfo();\r\n if (object.label != null) {\r\n if (typeof object.label !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected\");\r\n message.label = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.label);\r\n }\r\n if (object.queryVerb != null)\r\n message.queryVerb = String(object.queryVerb);\r\n if (object.queryPrepend != null)\r\n message.queryPrepend = String(object.queryPrepend);\r\n return message;\r\n };\r\n \r\n InputBoxInfo.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.label = null;\r\n object.queryVerb = \"\";\r\n object.queryPrepend = \"\";\r\n }\r\n if (message.label != null && message.hasOwnProperty(\"label\"))\r\n object.label = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.label, options);\r\n if (message.queryVerb != null && message.hasOwnProperty(\"queryVerb\"))\r\n object.queryVerb = message.queryVerb;\r\n if (message.queryPrepend != null && message.hasOwnProperty(\"queryPrepend\"))\r\n object.queryPrepend = message.queryPrepend;\r\n return object;\r\n };\r\n \r\n InputBoxInfo.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n InputBoxInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.SearchTabProto.InputBoxInfo\";\r\n };\r\n \r\n return InputBoxInfo;\r\n })();\r\n \r\n return SearchTabProto;\r\n })();\r\n \r\n dbroot.CobrandProto = (function() {\r\n \r\n function CobrandProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n CobrandProto.prototype.logoUrl = \"\";\r\n CobrandProto.prototype.xCoord = null;\r\n CobrandProto.prototype.yCoord = null;\r\n CobrandProto.prototype.tiePoint = 6;\r\n CobrandProto.prototype.screenSize = 0;\r\n \r\n CobrandProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.CobrandProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.logoUrl = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.xCoord = $root.keyhole.dbroot.CobrandProto.Coord.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.yCoord = $root.keyhole.dbroot.CobrandProto.Coord.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 4: {\r\n message.tiePoint = reader.int32();\r\n break;\r\n }\r\n case 5: {\r\n message.screenSize = reader.double();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"logoUrl\"))\r\n throw $util.ProtocolError(\"missing required 'logoUrl'\", { instance: message });\r\n return message;\r\n };\r\n \r\n CobrandProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isString(message.logoUrl))\r\n return \"logoUrl: string expected\";\r\n if (message.xCoord != null && message.hasOwnProperty(\"xCoord\")) {\r\n var error = $root.keyhole.dbroot.CobrandProto.Coord.verify(message.xCoord);\r\n if (error)\r\n return \"xCoord.\" + error;\r\n }\r\n if (message.yCoord != null && message.hasOwnProperty(\"yCoord\")) {\r\n var error = $root.keyhole.dbroot.CobrandProto.Coord.verify(message.yCoord);\r\n if (error)\r\n return \"yCoord.\" + error;\r\n }\r\n if (message.tiePoint != null && message.hasOwnProperty(\"tiePoint\"))\r\n switch (message.tiePoint) {\r\n default:\r\n return \"tiePoint: enum value expected\";\r\n case 0:\r\n case 1:\r\n case 2:\r\n case 3:\r\n case 4:\r\n case 5:\r\n case 6:\r\n case 7:\r\n case 8:\r\n break;\r\n }\r\n if (message.screenSize != null && message.hasOwnProperty(\"screenSize\"))\r\n if (typeof message.screenSize !== \"number\")\r\n return \"screenSize: number expected\";\r\n return null;\r\n };\r\n \r\n CobrandProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.CobrandProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.CobrandProto();\r\n if (object.logoUrl != null)\r\n message.logoUrl = String(object.logoUrl);\r\n if (object.xCoord != null) {\r\n if (typeof object.xCoord !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.CobrandProto.xCoord: object expected\");\r\n message.xCoord = $root.keyhole.dbroot.CobrandProto.Coord.fromObject(object.xCoord);\r\n }\r\n if (object.yCoord != null) {\r\n if (typeof object.yCoord !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.CobrandProto.yCoord: object expected\");\r\n message.yCoord = $root.keyhole.dbroot.CobrandProto.Coord.fromObject(object.yCoord);\r\n }\r\n switch (object.tiePoint) {\r\n case \"TOP_LEFT\":\r\n case 0:\r\n message.tiePoint = 0;\r\n break;\r\n case \"TOP_CENTER\":\r\n case 1:\r\n message.tiePoint = 1;\r\n break;\r\n case \"TOP_RIGHT\":\r\n case 2:\r\n message.tiePoint = 2;\r\n break;\r\n case \"MID_LEFT\":\r\n case 3:\r\n message.tiePoint = 3;\r\n break;\r\n case \"MID_CENTER\":\r\n case 4:\r\n message.tiePoint = 4;\r\n break;\r\n case \"MID_RIGHT\":\r\n case 5:\r\n message.tiePoint = 5;\r\n break;\r\n case \"BOTTOM_LEFT\":\r\n case 6:\r\n message.tiePoint = 6;\r\n break;\r\n case \"BOTTOM_CENTER\":\r\n case 7:\r\n message.tiePoint = 7;\r\n break;\r\n case \"BOTTOM_RIGHT\":\r\n case 8:\r\n message.tiePoint = 8;\r\n break;\r\n }\r\n if (object.screenSize != null)\r\n message.screenSize = Number(object.screenSize);\r\n return message;\r\n };\r\n \r\n CobrandProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.logoUrl = \"\";\r\n object.xCoord = null;\r\n object.yCoord = null;\r\n object.tiePoint = options.enums === String ? \"BOTTOM_LEFT\" : 6;\r\n object.screenSize = 0;\r\n }\r\n if (message.logoUrl != null && message.hasOwnProperty(\"logoUrl\"))\r\n object.logoUrl = message.logoUrl;\r\n if (message.xCoord != null && message.hasOwnProperty(\"xCoord\"))\r\n object.xCoord = $root.keyhole.dbroot.CobrandProto.Coord.toObject(message.xCoord, options);\r\n if (message.yCoord != null && message.hasOwnProperty(\"yCoord\"))\r\n object.yCoord = $root.keyhole.dbroot.CobrandProto.Coord.toObject(message.yCoord, options);\r\n if (message.tiePoint != null && message.hasOwnProperty(\"tiePoint\"))\r\n object.tiePoint = options.enums === String ? $root.keyhole.dbroot.CobrandProto.TiePoint[message.tiePoint] : message.tiePoint;\r\n if (message.screenSize != null && message.hasOwnProperty(\"screenSize\"))\r\n object.screenSize = options.json && !isFinite(message.screenSize) ? String(message.screenSize) : message.screenSize;\r\n return object;\r\n };\r\n \r\n CobrandProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n CobrandProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.CobrandProto\";\r\n };\r\n \r\n CobrandProto.Coord = (function() {\r\n \r\n function Coord(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n Coord.prototype.value = 0;\r\n Coord.prototype.isRelative = false;\r\n \r\n Coord.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.CobrandProto.Coord();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.value = reader.double();\r\n break;\r\n }\r\n case 2: {\r\n message.isRelative = reader.bool();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"value\"))\r\n throw $util.ProtocolError(\"missing required 'value'\", { instance: message });\r\n return message;\r\n };\r\n \r\n Coord.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (typeof message.value !== \"number\")\r\n return \"value: number expected\";\r\n if (message.isRelative != null && message.hasOwnProperty(\"isRelative\"))\r\n if (typeof message.isRelative !== \"boolean\")\r\n return \"isRelative: boolean expected\";\r\n return null;\r\n };\r\n \r\n Coord.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.CobrandProto.Coord)\r\n return object;\r\n var message = new $root.keyhole.dbroot.CobrandProto.Coord();\r\n if (object.value != null)\r\n message.value = Number(object.value);\r\n if (object.isRelative != null)\r\n message.isRelative = Boolean(object.isRelative);\r\n return message;\r\n };\r\n \r\n Coord.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.value = 0;\r\n object.isRelative = false;\r\n }\r\n if (message.value != null && message.hasOwnProperty(\"value\"))\r\n object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;\r\n if (message.isRelative != null && message.hasOwnProperty(\"isRelative\"))\r\n object.isRelative = message.isRelative;\r\n return object;\r\n };\r\n \r\n Coord.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n Coord.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.CobrandProto.Coord\";\r\n };\r\n \r\n return Coord;\r\n })();\r\n \r\n CobrandProto.TiePoint = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[0] = \"TOP_LEFT\"] = 0;\r\n values[valuesById[1] = \"TOP_CENTER\"] = 1;\r\n values[valuesById[2] = \"TOP_RIGHT\"] = 2;\r\n values[valuesById[3] = \"MID_LEFT\"] = 3;\r\n values[valuesById[4] = \"MID_CENTER\"] = 4;\r\n values[valuesById[5] = \"MID_RIGHT\"] = 5;\r\n values[valuesById[6] = \"BOTTOM_LEFT\"] = 6;\r\n values[valuesById[7] = \"BOTTOM_CENTER\"] = 7;\r\n values[valuesById[8] = \"BOTTOM_RIGHT\"] = 8;\r\n return values;\r\n })();\r\n \r\n return CobrandProto;\r\n })();\r\n \r\n dbroot.DatabaseDescriptionProto = (function() {\r\n \r\n function DatabaseDescriptionProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n DatabaseDescriptionProto.prototype.databaseName = null;\r\n DatabaseDescriptionProto.prototype.databaseUrl = \"\";\r\n \r\n DatabaseDescriptionProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.DatabaseDescriptionProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.databaseName = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.databaseUrl = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"databaseUrl\"))\r\n throw $util.ProtocolError(\"missing required 'databaseUrl'\", { instance: message });\r\n return message;\r\n };\r\n \r\n DatabaseDescriptionProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.databaseName != null && message.hasOwnProperty(\"databaseName\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.databaseName);\r\n if (error)\r\n return \"databaseName.\" + error;\r\n }\r\n if (!$util.isString(message.databaseUrl))\r\n return \"databaseUrl: string expected\";\r\n return null;\r\n };\r\n \r\n DatabaseDescriptionProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.DatabaseDescriptionProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.DatabaseDescriptionProto();\r\n if (object.databaseName != null) {\r\n if (typeof object.databaseName !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected\");\r\n message.databaseName = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.databaseName);\r\n }\r\n if (object.databaseUrl != null)\r\n message.databaseUrl = String(object.databaseUrl);\r\n return message;\r\n };\r\n \r\n DatabaseDescriptionProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.databaseName = null;\r\n object.databaseUrl = \"\";\r\n }\r\n if (message.databaseName != null && message.hasOwnProperty(\"databaseName\"))\r\n object.databaseName = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.databaseName, options);\r\n if (message.databaseUrl != null && message.hasOwnProperty(\"databaseUrl\"))\r\n object.databaseUrl = message.databaseUrl;\r\n return object;\r\n };\r\n \r\n DatabaseDescriptionProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n DatabaseDescriptionProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.DatabaseDescriptionProto\";\r\n };\r\n \r\n return DatabaseDescriptionProto;\r\n })();\r\n \r\n dbroot.ConfigScriptProto = (function() {\r\n \r\n function ConfigScriptProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n ConfigScriptProto.prototype.scriptName = \"\";\r\n ConfigScriptProto.prototype.scriptData = \"\";\r\n \r\n ConfigScriptProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.ConfigScriptProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.scriptName = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.scriptData = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"scriptName\"))\r\n throw $util.ProtocolError(\"missing required 'scriptName'\", { instance: message });\r\n if (!message.hasOwnProperty(\"scriptData\"))\r\n throw $util.ProtocolError(\"missing required 'scriptData'\", { instance: message });\r\n return message;\r\n };\r\n \r\n ConfigScriptProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isString(message.scriptName))\r\n return \"scriptName: string expected\";\r\n if (!$util.isString(message.scriptData))\r\n return \"scriptData: string expected\";\r\n return null;\r\n };\r\n \r\n ConfigScriptProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.ConfigScriptProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.ConfigScriptProto();\r\n if (object.scriptName != null)\r\n message.scriptName = String(object.scriptName);\r\n if (object.scriptData != null)\r\n message.scriptData = String(object.scriptData);\r\n return message;\r\n };\r\n \r\n ConfigScriptProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.scriptName = \"\";\r\n object.scriptData = \"\";\r\n }\r\n if (message.scriptName != null && message.hasOwnProperty(\"scriptName\"))\r\n object.scriptName = message.scriptName;\r\n if (message.scriptData != null && message.hasOwnProperty(\"scriptData\"))\r\n object.scriptData = message.scriptData;\r\n return object;\r\n };\r\n \r\n ConfigScriptProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n ConfigScriptProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.ConfigScriptProto\";\r\n };\r\n \r\n return ConfigScriptProto;\r\n })();\r\n \r\n dbroot.SwoopParamsProto = (function() {\r\n \r\n function SwoopParamsProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SwoopParamsProto.prototype.startDistInMeters = 0;\r\n \r\n SwoopParamsProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.SwoopParamsProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.startDistInMeters = reader.double();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n SwoopParamsProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.startDistInMeters != null && message.hasOwnProperty(\"startDistInMeters\"))\r\n if (typeof message.startDistInMeters !== \"number\")\r\n return \"startDistInMeters: number expected\";\r\n return null;\r\n };\r\n \r\n SwoopParamsProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.SwoopParamsProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.SwoopParamsProto();\r\n if (object.startDistInMeters != null)\r\n message.startDistInMeters = Number(object.startDistInMeters);\r\n return message;\r\n };\r\n \r\n SwoopParamsProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults)\r\n object.startDistInMeters = 0;\r\n if (message.startDistInMeters != null && message.hasOwnProperty(\"startDistInMeters\"))\r\n object.startDistInMeters = options.json && !isFinite(message.startDistInMeters) ? String(message.startDistInMeters) : message.startDistInMeters;\r\n return object;\r\n };\r\n \r\n SwoopParamsProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SwoopParamsProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.SwoopParamsProto\";\r\n };\r\n \r\n return SwoopParamsProto;\r\n })();\r\n \r\n dbroot.PostingServerProto = (function() {\r\n \r\n function PostingServerProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n PostingServerProto.prototype.name = null;\r\n PostingServerProto.prototype.baseUrl = null;\r\n PostingServerProto.prototype.postWizardPath = null;\r\n PostingServerProto.prototype.fileSubmitPath = null;\r\n \r\n PostingServerProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.PostingServerProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.baseUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.postWizardPath = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 4: {\r\n message.fileSubmitPath = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n PostingServerProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.name != null && message.hasOwnProperty(\"name\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.name);\r\n if (error)\r\n return \"name.\" + error;\r\n }\r\n if (message.baseUrl != null && message.hasOwnProperty(\"baseUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.baseUrl);\r\n if (error)\r\n return \"baseUrl.\" + error;\r\n }\r\n if (message.postWizardPath != null && message.hasOwnProperty(\"postWizardPath\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.postWizardPath);\r\n if (error)\r\n return \"postWizardPath.\" + error;\r\n }\r\n if (message.fileSubmitPath != null && message.hasOwnProperty(\"fileSubmitPath\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.fileSubmitPath);\r\n if (error)\r\n return \"fileSubmitPath.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n PostingServerProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.PostingServerProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.PostingServerProto();\r\n if (object.name != null) {\r\n if (typeof object.name !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PostingServerProto.name: object expected\");\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.name);\r\n }\r\n if (object.baseUrl != null) {\r\n if (typeof object.baseUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PostingServerProto.baseUrl: object expected\");\r\n message.baseUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.baseUrl);\r\n }\r\n if (object.postWizardPath != null) {\r\n if (typeof object.postWizardPath !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PostingServerProto.postWizardPath: object expected\");\r\n message.postWizardPath = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.postWizardPath);\r\n }\r\n if (object.fileSubmitPath != null) {\r\n if (typeof object.fileSubmitPath !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected\");\r\n message.fileSubmitPath = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.fileSubmitPath);\r\n }\r\n return message;\r\n };\r\n \r\n PostingServerProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.name = null;\r\n object.baseUrl = null;\r\n object.postWizardPath = null;\r\n object.fileSubmitPath = null;\r\n }\r\n if (message.name != null && message.hasOwnProperty(\"name\"))\r\n object.name = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.name, options);\r\n if (message.baseUrl != null && message.hasOwnProperty(\"baseUrl\"))\r\n object.baseUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.baseUrl, options);\r\n if (message.postWizardPath != null && message.hasOwnProperty(\"postWizardPath\"))\r\n object.postWizardPath = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.postWizardPath, options);\r\n if (message.fileSubmitPath != null && message.hasOwnProperty(\"fileSubmitPath\"))\r\n object.fileSubmitPath = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.fileSubmitPath, options);\r\n return object;\r\n };\r\n \r\n PostingServerProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n PostingServerProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.PostingServerProto\";\r\n };\r\n \r\n return PostingServerProto;\r\n })();\r\n \r\n dbroot.PlanetaryDatabaseProto = (function() {\r\n \r\n function PlanetaryDatabaseProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n PlanetaryDatabaseProto.prototype.url = null;\r\n PlanetaryDatabaseProto.prototype.name = null;\r\n \r\n PlanetaryDatabaseProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.PlanetaryDatabaseProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"url\"))\r\n throw $util.ProtocolError(\"missing required 'url'\", { instance: message });\r\n if (!message.hasOwnProperty(\"name\"))\r\n throw $util.ProtocolError(\"missing required 'name'\", { instance: message });\r\n return message;\r\n };\r\n \r\n PlanetaryDatabaseProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.name);\r\n if (error)\r\n return \"name.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n PlanetaryDatabaseProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.PlanetaryDatabaseProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.PlanetaryDatabaseProto();\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n if (object.name != null) {\r\n if (typeof object.name !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected\");\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.name);\r\n }\r\n return message;\r\n };\r\n \r\n PlanetaryDatabaseProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.url = null;\r\n object.name = null;\r\n }\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n if (message.name != null && message.hasOwnProperty(\"name\"))\r\n object.name = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.name, options);\r\n return object;\r\n };\r\n \r\n PlanetaryDatabaseProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n PlanetaryDatabaseProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.PlanetaryDatabaseProto\";\r\n };\r\n \r\n return PlanetaryDatabaseProto;\r\n })();\r\n \r\n dbroot.LogServerProto = (function() {\r\n \r\n function LogServerProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n LogServerProto.prototype.url = null;\r\n LogServerProto.prototype.enable = false;\r\n LogServerProto.prototype.throttlingFactor = 1;\r\n \r\n LogServerProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.LogServerProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.enable = reader.bool();\r\n break;\r\n }\r\n case 3: {\r\n message.throttlingFactor = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n LogServerProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.url != null && message.hasOwnProperty(\"url\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n if (message.enable != null && message.hasOwnProperty(\"enable\"))\r\n if (typeof message.enable !== \"boolean\")\r\n return \"enable: boolean expected\";\r\n if (message.throttlingFactor != null && message.hasOwnProperty(\"throttlingFactor\"))\r\n if (!$util.isInteger(message.throttlingFactor))\r\n return \"throttlingFactor: integer expected\";\r\n return null;\r\n };\r\n \r\n LogServerProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.LogServerProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.LogServerProto();\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.LogServerProto.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n if (object.enable != null)\r\n message.enable = Boolean(object.enable);\r\n if (object.throttlingFactor != null)\r\n message.throttlingFactor = object.throttlingFactor | 0;\r\n return message;\r\n };\r\n \r\n LogServerProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.url = null;\r\n object.enable = false;\r\n object.throttlingFactor = 1;\r\n }\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n if (message.enable != null && message.hasOwnProperty(\"enable\"))\r\n object.enable = message.enable;\r\n if (message.throttlingFactor != null && message.hasOwnProperty(\"throttlingFactor\"))\r\n object.throttlingFactor = message.throttlingFactor;\r\n return object;\r\n };\r\n \r\n LogServerProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n LogServerProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.LogServerProto\";\r\n };\r\n \r\n return LogServerProto;\r\n })();\r\n \r\n dbroot.EndSnippetProto = (function() {\r\n \r\n function EndSnippetProto(properties) {\r\n this.mfeDomains = [];\r\n this.searchTab = [];\r\n this.cobrandInfo = [];\r\n this.validDatabase = [];\r\n this.configScript = [];\r\n this.planetaryDatabase = [];\r\n this.filmstripConfig = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n EndSnippetProto.prototype.model = null;\r\n EndSnippetProto.prototype.authServerUrl = null;\r\n EndSnippetProto.prototype.disableAuthentication = false;\r\n EndSnippetProto.prototype.mfeDomains = $util.emptyArray;\r\n EndSnippetProto.prototype.mfeLangParam = \"hl=$5Bhl5D\";\r\n EndSnippetProto.prototype.adsUrlPatterns = \"\";\r\n EndSnippetProto.prototype.reverseGeocoderUrl = null;\r\n EndSnippetProto.prototype.reverseGeocoderProtocolVersion = 3;\r\n EndSnippetProto.prototype.skyDatabaseIsAvailable = true;\r\n EndSnippetProto.prototype.skyDatabaseUrl = null;\r\n EndSnippetProto.prototype.defaultWebPageIntlUrl = null;\r\n EndSnippetProto.prototype.numStartUpTips = 17;\r\n EndSnippetProto.prototype.startUpTipsUrl = null;\r\n EndSnippetProto.prototype.numProStartUpTips = 0;\r\n EndSnippetProto.prototype.proStartUpTipsUrl = null;\r\n EndSnippetProto.prototype.startupTipsIntlUrl = null;\r\n EndSnippetProto.prototype.userGuideIntlUrl = null;\r\n EndSnippetProto.prototype.supportCenterIntlUrl = null;\r\n EndSnippetProto.prototype.businessListingIntlUrl = null;\r\n EndSnippetProto.prototype.supportAnswerIntlUrl = null;\r\n EndSnippetProto.prototype.supportTopicIntlUrl = null;\r\n EndSnippetProto.prototype.supportRequestIntlUrl = null;\r\n EndSnippetProto.prototype.earthIntlUrl = null;\r\n EndSnippetProto.prototype.addContentUrl = null;\r\n EndSnippetProto.prototype.sketchupNotInstalledUrl = null;\r\n EndSnippetProto.prototype.sketchupErrorUrl = null;\r\n EndSnippetProto.prototype.freeLicenseUrl = null;\r\n EndSnippetProto.prototype.proLicenseUrl = null;\r\n EndSnippetProto.prototype.tutorialUrl = null;\r\n EndSnippetProto.prototype.keyboardShortcutsUrl = null;\r\n EndSnippetProto.prototype.releaseNotesUrl = null;\r\n EndSnippetProto.prototype.hideUserData = false;\r\n EndSnippetProto.prototype.useGeLogo = true;\r\n EndSnippetProto.prototype.dioramaDescriptionUrlBase = null;\r\n EndSnippetProto.prototype.dioramaDefaultColor = 4291281607;\r\n EndSnippetProto.prototype.dioramaBlacklistUrl = null;\r\n EndSnippetProto.prototype.clientOptions = null;\r\n EndSnippetProto.prototype.fetchingOptions = null;\r\n EndSnippetProto.prototype.timeMachineOptions = null;\r\n EndSnippetProto.prototype.csiOptions = null;\r\n EndSnippetProto.prototype.searchTab = $util.emptyArray;\r\n EndSnippetProto.prototype.cobrandInfo = $util.emptyArray;\r\n EndSnippetProto.prototype.validDatabase = $util.emptyArray;\r\n EndSnippetProto.prototype.configScript = $util.emptyArray;\r\n EndSnippetProto.prototype.deauthServerUrl = null;\r\n EndSnippetProto.prototype.swoopParameters = null;\r\n EndSnippetProto.prototype.bbsServerInfo = null;\r\n EndSnippetProto.prototype.dataErrorServerInfo = null;\r\n EndSnippetProto.prototype.planetaryDatabase = $util.emptyArray;\r\n EndSnippetProto.prototype.logServer = null;\r\n EndSnippetProto.prototype.autopiaOptions = null;\r\n EndSnippetProto.prototype.searchConfig = null;\r\n EndSnippetProto.prototype.searchInfo = null;\r\n EndSnippetProto.prototype.elevationServiceBaseUrl = \"http://maps.google.com/maps/api/elevation/\";\r\n EndSnippetProto.prototype.elevationProfileQueryDelay = 500;\r\n EndSnippetProto.prototype.proUpgradeUrl = null;\r\n EndSnippetProto.prototype.earthCommunityUrl = null;\r\n EndSnippetProto.prototype.googleMapsUrl = null;\r\n EndSnippetProto.prototype.sharingUrl = null;\r\n EndSnippetProto.prototype.privacyPolicyUrl = null;\r\n EndSnippetProto.prototype.doGplusUserCheck = false;\r\n EndSnippetProto.prototype.rocktreeDataProto = null;\r\n EndSnippetProto.prototype.filmstripConfig = $util.emptyArray;\r\n EndSnippetProto.prototype.showSigninButton = false;\r\n EndSnippetProto.prototype.proMeasureUpsellUrl = null;\r\n EndSnippetProto.prototype.proPrintUpsellUrl = null;\r\n EndSnippetProto.prototype.starDataProto = null;\r\n EndSnippetProto.prototype.feedbackUrl = null;\r\n EndSnippetProto.prototype.oauth2LoginUrl = null;\r\n \r\n EndSnippetProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.model = $root.keyhole.dbroot.PlanetModelProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.authServerUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.disableAuthentication = reader.bool();\r\n break;\r\n }\r\n case 4: {\r\n if (!(message.mfeDomains && message.mfeDomains.length))\r\n message.mfeDomains = [];\r\n message.mfeDomains.push($root.keyhole.dbroot.MfeDomainFeaturesProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 5: {\r\n message.mfeLangParam = reader.string();\r\n break;\r\n }\r\n case 6: {\r\n message.adsUrlPatterns = reader.string();\r\n break;\r\n }\r\n case 7: {\r\n message.reverseGeocoderUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 8: {\r\n message.reverseGeocoderProtocolVersion = reader.int32();\r\n break;\r\n }\r\n case 9: {\r\n message.skyDatabaseIsAvailable = reader.bool();\r\n break;\r\n }\r\n case 10: {\r\n message.skyDatabaseUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 11: {\r\n message.defaultWebPageIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 12: {\r\n message.numStartUpTips = reader.int32();\r\n break;\r\n }\r\n case 13: {\r\n message.startUpTipsUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 51: {\r\n message.numProStartUpTips = reader.int32();\r\n break;\r\n }\r\n case 52: {\r\n message.proStartUpTipsUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 64: {\r\n message.startupTipsIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 14: {\r\n message.userGuideIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 15: {\r\n message.supportCenterIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 16: {\r\n message.businessListingIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 17: {\r\n message.supportAnswerIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 18: {\r\n message.supportTopicIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 19: {\r\n message.supportRequestIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 20: {\r\n message.earthIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 21: {\r\n message.addContentUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 22: {\r\n message.sketchupNotInstalledUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 23: {\r\n message.sketchupErrorUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 24: {\r\n message.freeLicenseUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 25: {\r\n message.proLicenseUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 48: {\r\n message.tutorialUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 49: {\r\n message.keyboardShortcutsUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 50: {\r\n message.releaseNotesUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 26: {\r\n message.hideUserData = reader.bool();\r\n break;\r\n }\r\n case 27: {\r\n message.useGeLogo = reader.bool();\r\n break;\r\n }\r\n case 28: {\r\n message.dioramaDescriptionUrlBase = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 29: {\r\n message.dioramaDefaultColor = reader.uint32();\r\n break;\r\n }\r\n case 53: {\r\n message.dioramaBlacklistUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 30: {\r\n message.clientOptions = $root.keyhole.dbroot.ClientOptionsProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 31: {\r\n message.fetchingOptions = $root.keyhole.dbroot.FetchingOptionsProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 32: {\r\n message.timeMachineOptions = $root.keyhole.dbroot.TimeMachineOptionsProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 33: {\r\n message.csiOptions = $root.keyhole.dbroot.CSIOptionsProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 34: {\r\n if (!(message.searchTab && message.searchTab.length))\r\n message.searchTab = [];\r\n message.searchTab.push($root.keyhole.dbroot.SearchTabProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 35: {\r\n if (!(message.cobrandInfo && message.cobrandInfo.length))\r\n message.cobrandInfo = [];\r\n message.cobrandInfo.push($root.keyhole.dbroot.CobrandProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 36: {\r\n if (!(message.validDatabase && message.validDatabase.length))\r\n message.validDatabase = [];\r\n message.validDatabase.push($root.keyhole.dbroot.DatabaseDescriptionProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 37: {\r\n if (!(message.configScript && message.configScript.length))\r\n message.configScript = [];\r\n message.configScript.push($root.keyhole.dbroot.ConfigScriptProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 38: {\r\n message.deauthServerUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 39: {\r\n message.swoopParameters = $root.keyhole.dbroot.SwoopParamsProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 40: {\r\n message.bbsServerInfo = $root.keyhole.dbroot.PostingServerProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 41: {\r\n message.dataErrorServerInfo = $root.keyhole.dbroot.PostingServerProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 42: {\r\n if (!(message.planetaryDatabase && message.planetaryDatabase.length))\r\n message.planetaryDatabase = [];\r\n message.planetaryDatabase.push($root.keyhole.dbroot.PlanetaryDatabaseProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 43: {\r\n message.logServer = $root.keyhole.dbroot.LogServerProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 44: {\r\n message.autopiaOptions = $root.keyhole.dbroot.AutopiaOptionsProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 54: {\r\n message.searchConfig = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 45: {\r\n message.searchInfo = $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 46: {\r\n message.elevationServiceBaseUrl = reader.string();\r\n break;\r\n }\r\n case 47: {\r\n message.elevationProfileQueryDelay = reader.int32();\r\n break;\r\n }\r\n case 55: {\r\n message.proUpgradeUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 56: {\r\n message.earthCommunityUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 57: {\r\n message.googleMapsUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 58: {\r\n message.sharingUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 59: {\r\n message.privacyPolicyUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 60: {\r\n message.doGplusUserCheck = reader.bool();\r\n break;\r\n }\r\n case 61: {\r\n message.rocktreeDataProto = $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 62: {\r\n if (!(message.filmstripConfig && message.filmstripConfig.length))\r\n message.filmstripConfig = [];\r\n message.filmstripConfig.push($root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 63: {\r\n message.showSigninButton = reader.bool();\r\n break;\r\n }\r\n case 65: {\r\n message.proMeasureUpsellUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 66: {\r\n message.proPrintUpsellUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 67: {\r\n message.starDataProto = $root.keyhole.dbroot.EndSnippetProto.StarDataProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 68: {\r\n message.feedbackUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 69: {\r\n message.oauth2LoginUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n EndSnippetProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.model != null && message.hasOwnProperty(\"model\")) {\r\n var error = $root.keyhole.dbroot.PlanetModelProto.verify(message.model);\r\n if (error)\r\n return \"model.\" + error;\r\n }\r\n if (message.authServerUrl != null && message.hasOwnProperty(\"authServerUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.authServerUrl);\r\n if (error)\r\n return \"authServerUrl.\" + error;\r\n }\r\n if (message.disableAuthentication != null && message.hasOwnProperty(\"disableAuthentication\"))\r\n if (typeof message.disableAuthentication !== \"boolean\")\r\n return \"disableAuthentication: boolean expected\";\r\n if (message.mfeDomains != null && message.hasOwnProperty(\"mfeDomains\")) {\r\n if (!Array.isArray(message.mfeDomains))\r\n return \"mfeDomains: array expected\";\r\n for (var i = 0; i < message.mfeDomains.length; ++i) {\r\n var error = $root.keyhole.dbroot.MfeDomainFeaturesProto.verify(message.mfeDomains[i]);\r\n if (error)\r\n return \"mfeDomains.\" + error;\r\n }\r\n }\r\n if (message.mfeLangParam != null && message.hasOwnProperty(\"mfeLangParam\"))\r\n if (!$util.isString(message.mfeLangParam))\r\n return \"mfeLangParam: string expected\";\r\n if (message.adsUrlPatterns != null && message.hasOwnProperty(\"adsUrlPatterns\"))\r\n if (!$util.isString(message.adsUrlPatterns))\r\n return \"adsUrlPatterns: string expected\";\r\n if (message.reverseGeocoderUrl != null && message.hasOwnProperty(\"reverseGeocoderUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.reverseGeocoderUrl);\r\n if (error)\r\n return \"reverseGeocoderUrl.\" + error;\r\n }\r\n if (message.reverseGeocoderProtocolVersion != null && message.hasOwnProperty(\"reverseGeocoderProtocolVersion\"))\r\n if (!$util.isInteger(message.reverseGeocoderProtocolVersion))\r\n return \"reverseGeocoderProtocolVersion: integer expected\";\r\n if (message.skyDatabaseIsAvailable != null && message.hasOwnProperty(\"skyDatabaseIsAvailable\"))\r\n if (typeof message.skyDatabaseIsAvailable !== \"boolean\")\r\n return \"skyDatabaseIsAvailable: boolean expected\";\r\n if (message.skyDatabaseUrl != null && message.hasOwnProperty(\"skyDatabaseUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.skyDatabaseUrl);\r\n if (error)\r\n return \"skyDatabaseUrl.\" + error;\r\n }\r\n if (message.defaultWebPageIntlUrl != null && message.hasOwnProperty(\"defaultWebPageIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.defaultWebPageIntlUrl);\r\n if (error)\r\n return \"defaultWebPageIntlUrl.\" + error;\r\n }\r\n if (message.numStartUpTips != null && message.hasOwnProperty(\"numStartUpTips\"))\r\n if (!$util.isInteger(message.numStartUpTips))\r\n return \"numStartUpTips: integer expected\";\r\n if (message.startUpTipsUrl != null && message.hasOwnProperty(\"startUpTipsUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.startUpTipsUrl);\r\n if (error)\r\n return \"startUpTipsUrl.\" + error;\r\n }\r\n if (message.numProStartUpTips != null && message.hasOwnProperty(\"numProStartUpTips\"))\r\n if (!$util.isInteger(message.numProStartUpTips))\r\n return \"numProStartUpTips: integer expected\";\r\n if (message.proStartUpTipsUrl != null && message.hasOwnProperty(\"proStartUpTipsUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.proStartUpTipsUrl);\r\n if (error)\r\n return \"proStartUpTipsUrl.\" + error;\r\n }\r\n if (message.startupTipsIntlUrl != null && message.hasOwnProperty(\"startupTipsIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.startupTipsIntlUrl);\r\n if (error)\r\n return \"startupTipsIntlUrl.\" + error;\r\n }\r\n if (message.userGuideIntlUrl != null && message.hasOwnProperty(\"userGuideIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.userGuideIntlUrl);\r\n if (error)\r\n return \"userGuideIntlUrl.\" + error;\r\n }\r\n if (message.supportCenterIntlUrl != null && message.hasOwnProperty(\"supportCenterIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.supportCenterIntlUrl);\r\n if (error)\r\n return \"supportCenterIntlUrl.\" + error;\r\n }\r\n if (message.businessListingIntlUrl != null && message.hasOwnProperty(\"businessListingIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.businessListingIntlUrl);\r\n if (error)\r\n return \"businessListingIntlUrl.\" + error;\r\n }\r\n if (message.supportAnswerIntlUrl != null && message.hasOwnProperty(\"supportAnswerIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.supportAnswerIntlUrl);\r\n if (error)\r\n return \"supportAnswerIntlUrl.\" + error;\r\n }\r\n if (message.supportTopicIntlUrl != null && message.hasOwnProperty(\"supportTopicIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.supportTopicIntlUrl);\r\n if (error)\r\n return \"supportTopicIntlUrl.\" + error;\r\n }\r\n if (message.supportRequestIntlUrl != null && message.hasOwnProperty(\"supportRequestIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.supportRequestIntlUrl);\r\n if (error)\r\n return \"supportRequestIntlUrl.\" + error;\r\n }\r\n if (message.earthIntlUrl != null && message.hasOwnProperty(\"earthIntlUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.earthIntlUrl);\r\n if (error)\r\n return \"earthIntlUrl.\" + error;\r\n }\r\n if (message.addContentUrl != null && message.hasOwnProperty(\"addContentUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.addContentUrl);\r\n if (error)\r\n return \"addContentUrl.\" + error;\r\n }\r\n if (message.sketchupNotInstalledUrl != null && message.hasOwnProperty(\"sketchupNotInstalledUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.sketchupNotInstalledUrl);\r\n if (error)\r\n return \"sketchupNotInstalledUrl.\" + error;\r\n }\r\n if (message.sketchupErrorUrl != null && message.hasOwnProperty(\"sketchupErrorUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.sketchupErrorUrl);\r\n if (error)\r\n return \"sketchupErrorUrl.\" + error;\r\n }\r\n if (message.freeLicenseUrl != null && message.hasOwnProperty(\"freeLicenseUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.freeLicenseUrl);\r\n if (error)\r\n return \"freeLicenseUrl.\" + error;\r\n }\r\n if (message.proLicenseUrl != null && message.hasOwnProperty(\"proLicenseUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.proLicenseUrl);\r\n if (error)\r\n return \"proLicenseUrl.\" + error;\r\n }\r\n if (message.tutorialUrl != null && message.hasOwnProperty(\"tutorialUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.tutorialUrl);\r\n if (error)\r\n return \"tutorialUrl.\" + error;\r\n }\r\n if (message.keyboardShortcutsUrl != null && message.hasOwnProperty(\"keyboardShortcutsUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.keyboardShortcutsUrl);\r\n if (error)\r\n return \"keyboardShortcutsUrl.\" + error;\r\n }\r\n if (message.releaseNotesUrl != null && message.hasOwnProperty(\"releaseNotesUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.releaseNotesUrl);\r\n if (error)\r\n return \"releaseNotesUrl.\" + error;\r\n }\r\n if (message.hideUserData != null && message.hasOwnProperty(\"hideUserData\"))\r\n if (typeof message.hideUserData !== \"boolean\")\r\n return \"hideUserData: boolean expected\";\r\n if (message.useGeLogo != null && message.hasOwnProperty(\"useGeLogo\"))\r\n if (typeof message.useGeLogo !== \"boolean\")\r\n return \"useGeLogo: boolean expected\";\r\n if (message.dioramaDescriptionUrlBase != null && message.hasOwnProperty(\"dioramaDescriptionUrlBase\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.dioramaDescriptionUrlBase);\r\n if (error)\r\n return \"dioramaDescriptionUrlBase.\" + error;\r\n }\r\n if (message.dioramaDefaultColor != null && message.hasOwnProperty(\"dioramaDefaultColor\"))\r\n if (!$util.isInteger(message.dioramaDefaultColor))\r\n return \"dioramaDefaultColor: integer expected\";\r\n if (message.dioramaBlacklistUrl != null && message.hasOwnProperty(\"dioramaBlacklistUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.dioramaBlacklistUrl);\r\n if (error)\r\n return \"dioramaBlacklistUrl.\" + error;\r\n }\r\n if (message.clientOptions != null && message.hasOwnProperty(\"clientOptions\")) {\r\n var error = $root.keyhole.dbroot.ClientOptionsProto.verify(message.clientOptions);\r\n if (error)\r\n return \"clientOptions.\" + error;\r\n }\r\n if (message.fetchingOptions != null && message.hasOwnProperty(\"fetchingOptions\")) {\r\n var error = $root.keyhole.dbroot.FetchingOptionsProto.verify(message.fetchingOptions);\r\n if (error)\r\n return \"fetchingOptions.\" + error;\r\n }\r\n if (message.timeMachineOptions != null && message.hasOwnProperty(\"timeMachineOptions\")) {\r\n var error = $root.keyhole.dbroot.TimeMachineOptionsProto.verify(message.timeMachineOptions);\r\n if (error)\r\n return \"timeMachineOptions.\" + error;\r\n }\r\n if (message.csiOptions != null && message.hasOwnProperty(\"csiOptions\")) {\r\n var error = $root.keyhole.dbroot.CSIOptionsProto.verify(message.csiOptions);\r\n if (error)\r\n return \"csiOptions.\" + error;\r\n }\r\n if (message.searchTab != null && message.hasOwnProperty(\"searchTab\")) {\r\n if (!Array.isArray(message.searchTab))\r\n return \"searchTab: array expected\";\r\n for (var i = 0; i < message.searchTab.length; ++i) {\r\n var error = $root.keyhole.dbroot.SearchTabProto.verify(message.searchTab[i]);\r\n if (error)\r\n return \"searchTab.\" + error;\r\n }\r\n }\r\n if (message.cobrandInfo != null && message.hasOwnProperty(\"cobrandInfo\")) {\r\n if (!Array.isArray(message.cobrandInfo))\r\n return \"cobrandInfo: array expected\";\r\n for (var i = 0; i < message.cobrandInfo.length; ++i) {\r\n var error = $root.keyhole.dbroot.CobrandProto.verify(message.cobrandInfo[i]);\r\n if (error)\r\n return \"cobrandInfo.\" + error;\r\n }\r\n }\r\n if (message.validDatabase != null && message.hasOwnProperty(\"validDatabase\")) {\r\n if (!Array.isArray(message.validDatabase))\r\n return \"validDatabase: array expected\";\r\n for (var i = 0; i < message.validDatabase.length; ++i) {\r\n var error = $root.keyhole.dbroot.DatabaseDescriptionProto.verify(message.validDatabase[i]);\r\n if (error)\r\n return \"validDatabase.\" + error;\r\n }\r\n }\r\n if (message.configScript != null && message.hasOwnProperty(\"configScript\")) {\r\n if (!Array.isArray(message.configScript))\r\n return \"configScript: array expected\";\r\n for (var i = 0; i < message.configScript.length; ++i) {\r\n var error = $root.keyhole.dbroot.ConfigScriptProto.verify(message.configScript[i]);\r\n if (error)\r\n return \"configScript.\" + error;\r\n }\r\n }\r\n if (message.deauthServerUrl != null && message.hasOwnProperty(\"deauthServerUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.deauthServerUrl);\r\n if (error)\r\n return \"deauthServerUrl.\" + error;\r\n }\r\n if (message.swoopParameters != null && message.hasOwnProperty(\"swoopParameters\")) {\r\n var error = $root.keyhole.dbroot.SwoopParamsProto.verify(message.swoopParameters);\r\n if (error)\r\n return \"swoopParameters.\" + error;\r\n }\r\n if (message.bbsServerInfo != null && message.hasOwnProperty(\"bbsServerInfo\")) {\r\n var error = $root.keyhole.dbroot.PostingServerProto.verify(message.bbsServerInfo);\r\n if (error)\r\n return \"bbsServerInfo.\" + error;\r\n }\r\n if (message.dataErrorServerInfo != null && message.hasOwnProperty(\"dataErrorServerInfo\")) {\r\n var error = $root.keyhole.dbroot.PostingServerProto.verify(message.dataErrorServerInfo);\r\n if (error)\r\n return \"dataErrorServerInfo.\" + error;\r\n }\r\n if (message.planetaryDatabase != null && message.hasOwnProperty(\"planetaryDatabase\")) {\r\n if (!Array.isArray(message.planetaryDatabase))\r\n return \"planetaryDatabase: array expected\";\r\n for (var i = 0; i < message.planetaryDatabase.length; ++i) {\r\n var error = $root.keyhole.dbroot.PlanetaryDatabaseProto.verify(message.planetaryDatabase[i]);\r\n if (error)\r\n return \"planetaryDatabase.\" + error;\r\n }\r\n }\r\n if (message.logServer != null && message.hasOwnProperty(\"logServer\")) {\r\n var error = $root.keyhole.dbroot.LogServerProto.verify(message.logServer);\r\n if (error)\r\n return \"logServer.\" + error;\r\n }\r\n if (message.autopiaOptions != null && message.hasOwnProperty(\"autopiaOptions\")) {\r\n var error = $root.keyhole.dbroot.AutopiaOptionsProto.verify(message.autopiaOptions);\r\n if (error)\r\n return \"autopiaOptions.\" + error;\r\n }\r\n if (message.searchConfig != null && message.hasOwnProperty(\"searchConfig\")) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.verify(message.searchConfig);\r\n if (error)\r\n return \"searchConfig.\" + error;\r\n }\r\n if (message.searchInfo != null && message.hasOwnProperty(\"searchInfo\")) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto.verify(message.searchInfo);\r\n if (error)\r\n return \"searchInfo.\" + error;\r\n }\r\n if (message.elevationServiceBaseUrl != null && message.hasOwnProperty(\"elevationServiceBaseUrl\"))\r\n if (!$util.isString(message.elevationServiceBaseUrl))\r\n return \"elevationServiceBaseUrl: string expected\";\r\n if (message.elevationProfileQueryDelay != null && message.hasOwnProperty(\"elevationProfileQueryDelay\"))\r\n if (!$util.isInteger(message.elevationProfileQueryDelay))\r\n return \"elevationProfileQueryDelay: integer expected\";\r\n if (message.proUpgradeUrl != null && message.hasOwnProperty(\"proUpgradeUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.proUpgradeUrl);\r\n if (error)\r\n return \"proUpgradeUrl.\" + error;\r\n }\r\n if (message.earthCommunityUrl != null && message.hasOwnProperty(\"earthCommunityUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.earthCommunityUrl);\r\n if (error)\r\n return \"earthCommunityUrl.\" + error;\r\n }\r\n if (message.googleMapsUrl != null && message.hasOwnProperty(\"googleMapsUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.googleMapsUrl);\r\n if (error)\r\n return \"googleMapsUrl.\" + error;\r\n }\r\n if (message.sharingUrl != null && message.hasOwnProperty(\"sharingUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.sharingUrl);\r\n if (error)\r\n return \"sharingUrl.\" + error;\r\n }\r\n if (message.privacyPolicyUrl != null && message.hasOwnProperty(\"privacyPolicyUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.privacyPolicyUrl);\r\n if (error)\r\n return \"privacyPolicyUrl.\" + error;\r\n }\r\n if (message.doGplusUserCheck != null && message.hasOwnProperty(\"doGplusUserCheck\"))\r\n if (typeof message.doGplusUserCheck !== \"boolean\")\r\n return \"doGplusUserCheck: boolean expected\";\r\n if (message.rocktreeDataProto != null && message.hasOwnProperty(\"rocktreeDataProto\")) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.verify(message.rocktreeDataProto);\r\n if (error)\r\n return \"rocktreeDataProto.\" + error;\r\n }\r\n if (message.filmstripConfig != null && message.hasOwnProperty(\"filmstripConfig\")) {\r\n if (!Array.isArray(message.filmstripConfig))\r\n return \"filmstripConfig: array expected\";\r\n for (var i = 0; i < message.filmstripConfig.length; ++i) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.verify(message.filmstripConfig[i]);\r\n if (error)\r\n return \"filmstripConfig.\" + error;\r\n }\r\n }\r\n if (message.showSigninButton != null && message.hasOwnProperty(\"showSigninButton\"))\r\n if (typeof message.showSigninButton !== \"boolean\")\r\n return \"showSigninButton: boolean expected\";\r\n if (message.proMeasureUpsellUrl != null && message.hasOwnProperty(\"proMeasureUpsellUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.proMeasureUpsellUrl);\r\n if (error)\r\n return \"proMeasureUpsellUrl.\" + error;\r\n }\r\n if (message.proPrintUpsellUrl != null && message.hasOwnProperty(\"proPrintUpsellUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.proPrintUpsellUrl);\r\n if (error)\r\n return \"proPrintUpsellUrl.\" + error;\r\n }\r\n if (message.starDataProto != null && message.hasOwnProperty(\"starDataProto\")) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.StarDataProto.verify(message.starDataProto);\r\n if (error)\r\n return \"starDataProto.\" + error;\r\n }\r\n if (message.feedbackUrl != null && message.hasOwnProperty(\"feedbackUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.feedbackUrl);\r\n if (error)\r\n return \"feedbackUrl.\" + error;\r\n }\r\n if (message.oauth2LoginUrl != null && message.hasOwnProperty(\"oauth2LoginUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.oauth2LoginUrl);\r\n if (error)\r\n return \"oauth2LoginUrl.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n EndSnippetProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto();\r\n if (object.model != null) {\r\n if (typeof object.model !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.model: object expected\");\r\n message.model = $root.keyhole.dbroot.PlanetModelProto.fromObject(object.model);\r\n }\r\n if (object.authServerUrl != null) {\r\n if (typeof object.authServerUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.authServerUrl: object expected\");\r\n message.authServerUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.authServerUrl);\r\n }\r\n if (object.disableAuthentication != null)\r\n message.disableAuthentication = Boolean(object.disableAuthentication);\r\n if (object.mfeDomains) {\r\n if (!Array.isArray(object.mfeDomains))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.mfeDomains: array expected\");\r\n message.mfeDomains = [];\r\n for (var i = 0; i < object.mfeDomains.length; ++i) {\r\n if (typeof object.mfeDomains[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.mfeDomains: object expected\");\r\n message.mfeDomains[i] = $root.keyhole.dbroot.MfeDomainFeaturesProto.fromObject(object.mfeDomains[i]);\r\n }\r\n }\r\n if (object.mfeLangParam != null)\r\n message.mfeLangParam = String(object.mfeLangParam);\r\n if (object.adsUrlPatterns != null)\r\n message.adsUrlPatterns = String(object.adsUrlPatterns);\r\n if (object.reverseGeocoderUrl != null) {\r\n if (typeof object.reverseGeocoderUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.reverseGeocoderUrl: object expected\");\r\n message.reverseGeocoderUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.reverseGeocoderUrl);\r\n }\r\n if (object.reverseGeocoderProtocolVersion != null)\r\n message.reverseGeocoderProtocolVersion = object.reverseGeocoderProtocolVersion | 0;\r\n if (object.skyDatabaseIsAvailable != null)\r\n message.skyDatabaseIsAvailable = Boolean(object.skyDatabaseIsAvailable);\r\n if (object.skyDatabaseUrl != null) {\r\n if (typeof object.skyDatabaseUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.skyDatabaseUrl: object expected\");\r\n message.skyDatabaseUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.skyDatabaseUrl);\r\n }\r\n if (object.defaultWebPageIntlUrl != null) {\r\n if (typeof object.defaultWebPageIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.defaultWebPageIntlUrl: object expected\");\r\n message.defaultWebPageIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.defaultWebPageIntlUrl);\r\n }\r\n if (object.numStartUpTips != null)\r\n message.numStartUpTips = object.numStartUpTips | 0;\r\n if (object.startUpTipsUrl != null) {\r\n if (typeof object.startUpTipsUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.startUpTipsUrl: object expected\");\r\n message.startUpTipsUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.startUpTipsUrl);\r\n }\r\n if (object.numProStartUpTips != null)\r\n message.numProStartUpTips = object.numProStartUpTips | 0;\r\n if (object.proStartUpTipsUrl != null) {\r\n if (typeof object.proStartUpTipsUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.proStartUpTipsUrl: object expected\");\r\n message.proStartUpTipsUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.proStartUpTipsUrl);\r\n }\r\n if (object.startupTipsIntlUrl != null) {\r\n if (typeof object.startupTipsIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.startupTipsIntlUrl: object expected\");\r\n message.startupTipsIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.startupTipsIntlUrl);\r\n }\r\n if (object.userGuideIntlUrl != null) {\r\n if (typeof object.userGuideIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.userGuideIntlUrl: object expected\");\r\n message.userGuideIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.userGuideIntlUrl);\r\n }\r\n if (object.supportCenterIntlUrl != null) {\r\n if (typeof object.supportCenterIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.supportCenterIntlUrl: object expected\");\r\n message.supportCenterIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.supportCenterIntlUrl);\r\n }\r\n if (object.businessListingIntlUrl != null) {\r\n if (typeof object.businessListingIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.businessListingIntlUrl: object expected\");\r\n message.businessListingIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.businessListingIntlUrl);\r\n }\r\n if (object.supportAnswerIntlUrl != null) {\r\n if (typeof object.supportAnswerIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.supportAnswerIntlUrl: object expected\");\r\n message.supportAnswerIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.supportAnswerIntlUrl);\r\n }\r\n if (object.supportTopicIntlUrl != null) {\r\n if (typeof object.supportTopicIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.supportTopicIntlUrl: object expected\");\r\n message.supportTopicIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.supportTopicIntlUrl);\r\n }\r\n if (object.supportRequestIntlUrl != null) {\r\n if (typeof object.supportRequestIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.supportRequestIntlUrl: object expected\");\r\n message.supportRequestIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.supportRequestIntlUrl);\r\n }\r\n if (object.earthIntlUrl != null) {\r\n if (typeof object.earthIntlUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.earthIntlUrl: object expected\");\r\n message.earthIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.earthIntlUrl);\r\n }\r\n if (object.addContentUrl != null) {\r\n if (typeof object.addContentUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.addContentUrl: object expected\");\r\n message.addContentUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.addContentUrl);\r\n }\r\n if (object.sketchupNotInstalledUrl != null) {\r\n if (typeof object.sketchupNotInstalledUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.sketchupNotInstalledUrl: object expected\");\r\n message.sketchupNotInstalledUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.sketchupNotInstalledUrl);\r\n }\r\n if (object.sketchupErrorUrl != null) {\r\n if (typeof object.sketchupErrorUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.sketchupErrorUrl: object expected\");\r\n message.sketchupErrorUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.sketchupErrorUrl);\r\n }\r\n if (object.freeLicenseUrl != null) {\r\n if (typeof object.freeLicenseUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.freeLicenseUrl: object expected\");\r\n message.freeLicenseUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.freeLicenseUrl);\r\n }\r\n if (object.proLicenseUrl != null) {\r\n if (typeof object.proLicenseUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.proLicenseUrl: object expected\");\r\n message.proLicenseUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.proLicenseUrl);\r\n }\r\n if (object.tutorialUrl != null) {\r\n if (typeof object.tutorialUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.tutorialUrl: object expected\");\r\n message.tutorialUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.tutorialUrl);\r\n }\r\n if (object.keyboardShortcutsUrl != null) {\r\n if (typeof object.keyboardShortcutsUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.keyboardShortcutsUrl: object expected\");\r\n message.keyboardShortcutsUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.keyboardShortcutsUrl);\r\n }\r\n if (object.releaseNotesUrl != null) {\r\n if (typeof object.releaseNotesUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.releaseNotesUrl: object expected\");\r\n message.releaseNotesUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.releaseNotesUrl);\r\n }\r\n if (object.hideUserData != null)\r\n message.hideUserData = Boolean(object.hideUserData);\r\n if (object.useGeLogo != null)\r\n message.useGeLogo = Boolean(object.useGeLogo);\r\n if (object.dioramaDescriptionUrlBase != null) {\r\n if (typeof object.dioramaDescriptionUrlBase !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.dioramaDescriptionUrlBase: object expected\");\r\n message.dioramaDescriptionUrlBase = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.dioramaDescriptionUrlBase);\r\n }\r\n if (object.dioramaDefaultColor != null)\r\n message.dioramaDefaultColor = object.dioramaDefaultColor >>> 0;\r\n if (object.dioramaBlacklistUrl != null) {\r\n if (typeof object.dioramaBlacklistUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected\");\r\n message.dioramaBlacklistUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.dioramaBlacklistUrl);\r\n }\r\n if (object.clientOptions != null) {\r\n if (typeof object.clientOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.clientOptions: object expected\");\r\n message.clientOptions = $root.keyhole.dbroot.ClientOptionsProto.fromObject(object.clientOptions);\r\n }\r\n if (object.fetchingOptions != null) {\r\n if (typeof object.fetchingOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected\");\r\n message.fetchingOptions = $root.keyhole.dbroot.FetchingOptionsProto.fromObject(object.fetchingOptions);\r\n }\r\n if (object.timeMachineOptions != null) {\r\n if (typeof object.timeMachineOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected\");\r\n message.timeMachineOptions = $root.keyhole.dbroot.TimeMachineOptionsProto.fromObject(object.timeMachineOptions);\r\n }\r\n if (object.csiOptions != null) {\r\n if (typeof object.csiOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.csiOptions: object expected\");\r\n message.csiOptions = $root.keyhole.dbroot.CSIOptionsProto.fromObject(object.csiOptions);\r\n }\r\n if (object.searchTab) {\r\n if (!Array.isArray(object.searchTab))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.searchTab: array expected\");\r\n message.searchTab = [];\r\n for (var i = 0; i < object.searchTab.length; ++i) {\r\n if (typeof object.searchTab[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.searchTab: object expected\");\r\n message.searchTab[i] = $root.keyhole.dbroot.SearchTabProto.fromObject(object.searchTab[i]);\r\n }\r\n }\r\n if (object.cobrandInfo) {\r\n if (!Array.isArray(object.cobrandInfo))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.cobrandInfo: array expected\");\r\n message.cobrandInfo = [];\r\n for (var i = 0; i < object.cobrandInfo.length; ++i) {\r\n if (typeof object.cobrandInfo[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.cobrandInfo: object expected\");\r\n message.cobrandInfo[i] = $root.keyhole.dbroot.CobrandProto.fromObject(object.cobrandInfo[i]);\r\n }\r\n }\r\n if (object.validDatabase) {\r\n if (!Array.isArray(object.validDatabase))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.validDatabase: array expected\");\r\n message.validDatabase = [];\r\n for (var i = 0; i < object.validDatabase.length; ++i) {\r\n if (typeof object.validDatabase[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.validDatabase: object expected\");\r\n message.validDatabase[i] = $root.keyhole.dbroot.DatabaseDescriptionProto.fromObject(object.validDatabase[i]);\r\n }\r\n }\r\n if (object.configScript) {\r\n if (!Array.isArray(object.configScript))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.configScript: array expected\");\r\n message.configScript = [];\r\n for (var i = 0; i < object.configScript.length; ++i) {\r\n if (typeof object.configScript[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.configScript: object expected\");\r\n message.configScript[i] = $root.keyhole.dbroot.ConfigScriptProto.fromObject(object.configScript[i]);\r\n }\r\n }\r\n if (object.deauthServerUrl != null) {\r\n if (typeof object.deauthServerUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.deauthServerUrl: object expected\");\r\n message.deauthServerUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.deauthServerUrl);\r\n }\r\n if (object.swoopParameters != null) {\r\n if (typeof object.swoopParameters !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.swoopParameters: object expected\");\r\n message.swoopParameters = $root.keyhole.dbroot.SwoopParamsProto.fromObject(object.swoopParameters);\r\n }\r\n if (object.bbsServerInfo != null) {\r\n if (typeof object.bbsServerInfo !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.bbsServerInfo: object expected\");\r\n message.bbsServerInfo = $root.keyhole.dbroot.PostingServerProto.fromObject(object.bbsServerInfo);\r\n }\r\n if (object.dataErrorServerInfo != null) {\r\n if (typeof object.dataErrorServerInfo !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.dataErrorServerInfo: object expected\");\r\n message.dataErrorServerInfo = $root.keyhole.dbroot.PostingServerProto.fromObject(object.dataErrorServerInfo);\r\n }\r\n if (object.planetaryDatabase) {\r\n if (!Array.isArray(object.planetaryDatabase))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.planetaryDatabase: array expected\");\r\n message.planetaryDatabase = [];\r\n for (var i = 0; i < object.planetaryDatabase.length; ++i) {\r\n if (typeof object.planetaryDatabase[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.planetaryDatabase: object expected\");\r\n message.planetaryDatabase[i] = $root.keyhole.dbroot.PlanetaryDatabaseProto.fromObject(object.planetaryDatabase[i]);\r\n }\r\n }\r\n if (object.logServer != null) {\r\n if (typeof object.logServer !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.logServer: object expected\");\r\n message.logServer = $root.keyhole.dbroot.LogServerProto.fromObject(object.logServer);\r\n }\r\n if (object.autopiaOptions != null) {\r\n if (typeof object.autopiaOptions !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.autopiaOptions: object expected\");\r\n message.autopiaOptions = $root.keyhole.dbroot.AutopiaOptionsProto.fromObject(object.autopiaOptions);\r\n }\r\n if (object.searchConfig != null) {\r\n if (typeof object.searchConfig !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.searchConfig: object expected\");\r\n message.searchConfig = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.fromObject(object.searchConfig);\r\n }\r\n if (object.searchInfo != null) {\r\n if (typeof object.searchInfo !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.searchInfo: object expected\");\r\n message.searchInfo = $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto.fromObject(object.searchInfo);\r\n }\r\n if (object.elevationServiceBaseUrl != null)\r\n message.elevationServiceBaseUrl = String(object.elevationServiceBaseUrl);\r\n if (object.elevationProfileQueryDelay != null)\r\n message.elevationProfileQueryDelay = object.elevationProfileQueryDelay | 0;\r\n if (object.proUpgradeUrl != null) {\r\n if (typeof object.proUpgradeUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.proUpgradeUrl: object expected\");\r\n message.proUpgradeUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.proUpgradeUrl);\r\n }\r\n if (object.earthCommunityUrl != null) {\r\n if (typeof object.earthCommunityUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.earthCommunityUrl: object expected\");\r\n message.earthCommunityUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.earthCommunityUrl);\r\n }\r\n if (object.googleMapsUrl != null) {\r\n if (typeof object.googleMapsUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.googleMapsUrl: object expected\");\r\n message.googleMapsUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.googleMapsUrl);\r\n }\r\n if (object.sharingUrl != null) {\r\n if (typeof object.sharingUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.sharingUrl: object expected\");\r\n message.sharingUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.sharingUrl);\r\n }\r\n if (object.privacyPolicyUrl != null) {\r\n if (typeof object.privacyPolicyUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.privacyPolicyUrl: object expected\");\r\n message.privacyPolicyUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.privacyPolicyUrl);\r\n }\r\n if (object.doGplusUserCheck != null)\r\n message.doGplusUserCheck = Boolean(object.doGplusUserCheck);\r\n if (object.rocktreeDataProto != null) {\r\n if (typeof object.rocktreeDataProto !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.rocktreeDataProto: object expected\");\r\n message.rocktreeDataProto = $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.fromObject(object.rocktreeDataProto);\r\n }\r\n if (object.filmstripConfig) {\r\n if (!Array.isArray(object.filmstripConfig))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.filmstripConfig: array expected\");\r\n message.filmstripConfig = [];\r\n for (var i = 0; i < object.filmstripConfig.length; ++i) {\r\n if (typeof object.filmstripConfig[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.filmstripConfig: object expected\");\r\n message.filmstripConfig[i] = $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fromObject(object.filmstripConfig[i]);\r\n }\r\n }\r\n if (object.showSigninButton != null)\r\n message.showSigninButton = Boolean(object.showSigninButton);\r\n if (object.proMeasureUpsellUrl != null) {\r\n if (typeof object.proMeasureUpsellUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.proMeasureUpsellUrl: object expected\");\r\n message.proMeasureUpsellUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.proMeasureUpsellUrl);\r\n }\r\n if (object.proPrintUpsellUrl != null) {\r\n if (typeof object.proPrintUpsellUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.proPrintUpsellUrl: object expected\");\r\n message.proPrintUpsellUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.proPrintUpsellUrl);\r\n }\r\n if (object.starDataProto != null) {\r\n if (typeof object.starDataProto !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.starDataProto: object expected\");\r\n message.starDataProto = $root.keyhole.dbroot.EndSnippetProto.StarDataProto.fromObject(object.starDataProto);\r\n }\r\n if (object.feedbackUrl != null) {\r\n if (typeof object.feedbackUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.feedbackUrl: object expected\");\r\n message.feedbackUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.feedbackUrl);\r\n }\r\n if (object.oauth2LoginUrl != null) {\r\n if (typeof object.oauth2LoginUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.oauth2LoginUrl: object expected\");\r\n message.oauth2LoginUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.oauth2LoginUrl);\r\n }\r\n return message;\r\n };\r\n \r\n EndSnippetProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults) {\r\n object.mfeDomains = [];\r\n object.searchTab = [];\r\n object.cobrandInfo = [];\r\n object.validDatabase = [];\r\n object.configScript = [];\r\n object.planetaryDatabase = [];\r\n object.filmstripConfig = [];\r\n }\r\n if (options.defaults) {\r\n object.model = null;\r\n object.authServerUrl = null;\r\n object.disableAuthentication = false;\r\n object.mfeLangParam = \"hl=$5Bhl5D\";\r\n object.adsUrlPatterns = \"\";\r\n object.reverseGeocoderUrl = null;\r\n object.reverseGeocoderProtocolVersion = 3;\r\n object.skyDatabaseIsAvailable = true;\r\n object.skyDatabaseUrl = null;\r\n object.defaultWebPageIntlUrl = null;\r\n object.numStartUpTips = 17;\r\n object.startUpTipsUrl = null;\r\n object.userGuideIntlUrl = null;\r\n object.supportCenterIntlUrl = null;\r\n object.businessListingIntlUrl = null;\r\n object.supportAnswerIntlUrl = null;\r\n object.supportTopicIntlUrl = null;\r\n object.supportRequestIntlUrl = null;\r\n object.earthIntlUrl = null;\r\n object.addContentUrl = null;\r\n object.sketchupNotInstalledUrl = null;\r\n object.sketchupErrorUrl = null;\r\n object.freeLicenseUrl = null;\r\n object.proLicenseUrl = null;\r\n object.hideUserData = false;\r\n object.useGeLogo = true;\r\n object.dioramaDescriptionUrlBase = null;\r\n object.dioramaDefaultColor = 4291281607;\r\n object.clientOptions = null;\r\n object.fetchingOptions = null;\r\n object.timeMachineOptions = null;\r\n object.csiOptions = null;\r\n object.deauthServerUrl = null;\r\n object.swoopParameters = null;\r\n object.bbsServerInfo = null;\r\n object.dataErrorServerInfo = null;\r\n object.logServer = null;\r\n object.autopiaOptions = null;\r\n object.searchInfo = null;\r\n object.elevationServiceBaseUrl = \"http://maps.google.com/maps/api/elevation/\";\r\n object.elevationProfileQueryDelay = 500;\r\n object.tutorialUrl = null;\r\n object.keyboardShortcutsUrl = null;\r\n object.releaseNotesUrl = null;\r\n object.numProStartUpTips = 0;\r\n object.proStartUpTipsUrl = null;\r\n object.dioramaBlacklistUrl = null;\r\n object.searchConfig = null;\r\n object.proUpgradeUrl = null;\r\n object.earthCommunityUrl = null;\r\n object.googleMapsUrl = null;\r\n object.sharingUrl = null;\r\n object.privacyPolicyUrl = null;\r\n object.doGplusUserCheck = false;\r\n object.rocktreeDataProto = null;\r\n object.showSigninButton = false;\r\n object.startupTipsIntlUrl = null;\r\n object.proMeasureUpsellUrl = null;\r\n object.proPrintUpsellUrl = null;\r\n object.starDataProto = null;\r\n object.feedbackUrl = null;\r\n object.oauth2LoginUrl = null;\r\n }\r\n if (message.model != null && message.hasOwnProperty(\"model\"))\r\n object.model = $root.keyhole.dbroot.PlanetModelProto.toObject(message.model, options);\r\n if (message.authServerUrl != null && message.hasOwnProperty(\"authServerUrl\"))\r\n object.authServerUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.authServerUrl, options);\r\n if (message.disableAuthentication != null && message.hasOwnProperty(\"disableAuthentication\"))\r\n object.disableAuthentication = message.disableAuthentication;\r\n if (message.mfeDomains && message.mfeDomains.length) {\r\n object.mfeDomains = [];\r\n for (var j = 0; j < message.mfeDomains.length; ++j)\r\n object.mfeDomains[j] = $root.keyhole.dbroot.MfeDomainFeaturesProto.toObject(message.mfeDomains[j], options);\r\n }\r\n if (message.mfeLangParam != null && message.hasOwnProperty(\"mfeLangParam\"))\r\n object.mfeLangParam = message.mfeLangParam;\r\n if (message.adsUrlPatterns != null && message.hasOwnProperty(\"adsUrlPatterns\"))\r\n object.adsUrlPatterns = message.adsUrlPatterns;\r\n if (message.reverseGeocoderUrl != null && message.hasOwnProperty(\"reverseGeocoderUrl\"))\r\n object.reverseGeocoderUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.reverseGeocoderUrl, options);\r\n if (message.reverseGeocoderProtocolVersion != null && message.hasOwnProperty(\"reverseGeocoderProtocolVersion\"))\r\n object.reverseGeocoderProtocolVersion = message.reverseGeocoderProtocolVersion;\r\n if (message.skyDatabaseIsAvailable != null && message.hasOwnProperty(\"skyDatabaseIsAvailable\"))\r\n object.skyDatabaseIsAvailable = message.skyDatabaseIsAvailable;\r\n if (message.skyDatabaseUrl != null && message.hasOwnProperty(\"skyDatabaseUrl\"))\r\n object.skyDatabaseUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.skyDatabaseUrl, options);\r\n if (message.defaultWebPageIntlUrl != null && message.hasOwnProperty(\"defaultWebPageIntlUrl\"))\r\n object.defaultWebPageIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.defaultWebPageIntlUrl, options);\r\n if (message.numStartUpTips != null && message.hasOwnProperty(\"numStartUpTips\"))\r\n object.numStartUpTips = message.numStartUpTips;\r\n if (message.startUpTipsUrl != null && message.hasOwnProperty(\"startUpTipsUrl\"))\r\n object.startUpTipsUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.startUpTipsUrl, options);\r\n if (message.userGuideIntlUrl != null && message.hasOwnProperty(\"userGuideIntlUrl\"))\r\n object.userGuideIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.userGuideIntlUrl, options);\r\n if (message.supportCenterIntlUrl != null && message.hasOwnProperty(\"supportCenterIntlUrl\"))\r\n object.supportCenterIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.supportCenterIntlUrl, options);\r\n if (message.businessListingIntlUrl != null && message.hasOwnProperty(\"businessListingIntlUrl\"))\r\n object.businessListingIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.businessListingIntlUrl, options);\r\n if (message.supportAnswerIntlUrl != null && message.hasOwnProperty(\"supportAnswerIntlUrl\"))\r\n object.supportAnswerIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.supportAnswerIntlUrl, options);\r\n if (message.supportTopicIntlUrl != null && message.hasOwnProperty(\"supportTopicIntlUrl\"))\r\n object.supportTopicIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.supportTopicIntlUrl, options);\r\n if (message.supportRequestIntlUrl != null && message.hasOwnProperty(\"supportRequestIntlUrl\"))\r\n object.supportRequestIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.supportRequestIntlUrl, options);\r\n if (message.earthIntlUrl != null && message.hasOwnProperty(\"earthIntlUrl\"))\r\n object.earthIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.earthIntlUrl, options);\r\n if (message.addContentUrl != null && message.hasOwnProperty(\"addContentUrl\"))\r\n object.addContentUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.addContentUrl, options);\r\n if (message.sketchupNotInstalledUrl != null && message.hasOwnProperty(\"sketchupNotInstalledUrl\"))\r\n object.sketchupNotInstalledUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.sketchupNotInstalledUrl, options);\r\n if (message.sketchupErrorUrl != null && message.hasOwnProperty(\"sketchupErrorUrl\"))\r\n object.sketchupErrorUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.sketchupErrorUrl, options);\r\n if (message.freeLicenseUrl != null && message.hasOwnProperty(\"freeLicenseUrl\"))\r\n object.freeLicenseUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.freeLicenseUrl, options);\r\n if (message.proLicenseUrl != null && message.hasOwnProperty(\"proLicenseUrl\"))\r\n object.proLicenseUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.proLicenseUrl, options);\r\n if (message.hideUserData != null && message.hasOwnProperty(\"hideUserData\"))\r\n object.hideUserData = message.hideUserData;\r\n if (message.useGeLogo != null && message.hasOwnProperty(\"useGeLogo\"))\r\n object.useGeLogo = message.useGeLogo;\r\n if (message.dioramaDescriptionUrlBase != null && message.hasOwnProperty(\"dioramaDescriptionUrlBase\"))\r\n object.dioramaDescriptionUrlBase = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.dioramaDescriptionUrlBase, options);\r\n if (message.dioramaDefaultColor != null && message.hasOwnProperty(\"dioramaDefaultColor\"))\r\n object.dioramaDefaultColor = message.dioramaDefaultColor;\r\n if (message.clientOptions != null && message.hasOwnProperty(\"clientOptions\"))\r\n object.clientOptions = $root.keyhole.dbroot.ClientOptionsProto.toObject(message.clientOptions, options);\r\n if (message.fetchingOptions != null && message.hasOwnProperty(\"fetchingOptions\"))\r\n object.fetchingOptions = $root.keyhole.dbroot.FetchingOptionsProto.toObject(message.fetchingOptions, options);\r\n if (message.timeMachineOptions != null && message.hasOwnProperty(\"timeMachineOptions\"))\r\n object.timeMachineOptions = $root.keyhole.dbroot.TimeMachineOptionsProto.toObject(message.timeMachineOptions, options);\r\n if (message.csiOptions != null && message.hasOwnProperty(\"csiOptions\"))\r\n object.csiOptions = $root.keyhole.dbroot.CSIOptionsProto.toObject(message.csiOptions, options);\r\n if (message.searchTab && message.searchTab.length) {\r\n object.searchTab = [];\r\n for (var j = 0; j < message.searchTab.length; ++j)\r\n object.searchTab[j] = $root.keyhole.dbroot.SearchTabProto.toObject(message.searchTab[j], options);\r\n }\r\n if (message.cobrandInfo && message.cobrandInfo.length) {\r\n object.cobrandInfo = [];\r\n for (var j = 0; j < message.cobrandInfo.length; ++j)\r\n object.cobrandInfo[j] = $root.keyhole.dbroot.CobrandProto.toObject(message.cobrandInfo[j], options);\r\n }\r\n if (message.validDatabase && message.validDatabase.length) {\r\n object.validDatabase = [];\r\n for (var j = 0; j < message.validDatabase.length; ++j)\r\n object.validDatabase[j] = $root.keyhole.dbroot.DatabaseDescriptionProto.toObject(message.validDatabase[j], options);\r\n }\r\n if (message.configScript && message.configScript.length) {\r\n object.configScript = [];\r\n for (var j = 0; j < message.configScript.length; ++j)\r\n object.configScript[j] = $root.keyhole.dbroot.ConfigScriptProto.toObject(message.configScript[j], options);\r\n }\r\n if (message.deauthServerUrl != null && message.hasOwnProperty(\"deauthServerUrl\"))\r\n object.deauthServerUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.deauthServerUrl, options);\r\n if (message.swoopParameters != null && message.hasOwnProperty(\"swoopParameters\"))\r\n object.swoopParameters = $root.keyhole.dbroot.SwoopParamsProto.toObject(message.swoopParameters, options);\r\n if (message.bbsServerInfo != null && message.hasOwnProperty(\"bbsServerInfo\"))\r\n object.bbsServerInfo = $root.keyhole.dbroot.PostingServerProto.toObject(message.bbsServerInfo, options);\r\n if (message.dataErrorServerInfo != null && message.hasOwnProperty(\"dataErrorServerInfo\"))\r\n object.dataErrorServerInfo = $root.keyhole.dbroot.PostingServerProto.toObject(message.dataErrorServerInfo, options);\r\n if (message.planetaryDatabase && message.planetaryDatabase.length) {\r\n object.planetaryDatabase = [];\r\n for (var j = 0; j < message.planetaryDatabase.length; ++j)\r\n object.planetaryDatabase[j] = $root.keyhole.dbroot.PlanetaryDatabaseProto.toObject(message.planetaryDatabase[j], options);\r\n }\r\n if (message.logServer != null && message.hasOwnProperty(\"logServer\"))\r\n object.logServer = $root.keyhole.dbroot.LogServerProto.toObject(message.logServer, options);\r\n if (message.autopiaOptions != null && message.hasOwnProperty(\"autopiaOptions\"))\r\n object.autopiaOptions = $root.keyhole.dbroot.AutopiaOptionsProto.toObject(message.autopiaOptions, options);\r\n if (message.searchInfo != null && message.hasOwnProperty(\"searchInfo\"))\r\n object.searchInfo = $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto.toObject(message.searchInfo, options);\r\n if (message.elevationServiceBaseUrl != null && message.hasOwnProperty(\"elevationServiceBaseUrl\"))\r\n object.elevationServiceBaseUrl = message.elevationServiceBaseUrl;\r\n if (message.elevationProfileQueryDelay != null && message.hasOwnProperty(\"elevationProfileQueryDelay\"))\r\n object.elevationProfileQueryDelay = message.elevationProfileQueryDelay;\r\n if (message.tutorialUrl != null && message.hasOwnProperty(\"tutorialUrl\"))\r\n object.tutorialUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.tutorialUrl, options);\r\n if (message.keyboardShortcutsUrl != null && message.hasOwnProperty(\"keyboardShortcutsUrl\"))\r\n object.keyboardShortcutsUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.keyboardShortcutsUrl, options);\r\n if (message.releaseNotesUrl != null && message.hasOwnProperty(\"releaseNotesUrl\"))\r\n object.releaseNotesUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.releaseNotesUrl, options);\r\n if (message.numProStartUpTips != null && message.hasOwnProperty(\"numProStartUpTips\"))\r\n object.numProStartUpTips = message.numProStartUpTips;\r\n if (message.proStartUpTipsUrl != null && message.hasOwnProperty(\"proStartUpTipsUrl\"))\r\n object.proStartUpTipsUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.proStartUpTipsUrl, options);\r\n if (message.dioramaBlacklistUrl != null && message.hasOwnProperty(\"dioramaBlacklistUrl\"))\r\n object.dioramaBlacklistUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.dioramaBlacklistUrl, options);\r\n if (message.searchConfig != null && message.hasOwnProperty(\"searchConfig\"))\r\n object.searchConfig = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.toObject(message.searchConfig, options);\r\n if (message.proUpgradeUrl != null && message.hasOwnProperty(\"proUpgradeUrl\"))\r\n object.proUpgradeUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.proUpgradeUrl, options);\r\n if (message.earthCommunityUrl != null && message.hasOwnProperty(\"earthCommunityUrl\"))\r\n object.earthCommunityUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.earthCommunityUrl, options);\r\n if (message.googleMapsUrl != null && message.hasOwnProperty(\"googleMapsUrl\"))\r\n object.googleMapsUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.googleMapsUrl, options);\r\n if (message.sharingUrl != null && message.hasOwnProperty(\"sharingUrl\"))\r\n object.sharingUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.sharingUrl, options);\r\n if (message.privacyPolicyUrl != null && message.hasOwnProperty(\"privacyPolicyUrl\"))\r\n object.privacyPolicyUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.privacyPolicyUrl, options);\r\n if (message.doGplusUserCheck != null && message.hasOwnProperty(\"doGplusUserCheck\"))\r\n object.doGplusUserCheck = message.doGplusUserCheck;\r\n if (message.rocktreeDataProto != null && message.hasOwnProperty(\"rocktreeDataProto\"))\r\n object.rocktreeDataProto = $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto.toObject(message.rocktreeDataProto, options);\r\n if (message.filmstripConfig && message.filmstripConfig.length) {\r\n object.filmstripConfig = [];\r\n for (var j = 0; j < message.filmstripConfig.length; ++j)\r\n object.filmstripConfig[j] = $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.toObject(message.filmstripConfig[j], options);\r\n }\r\n if (message.showSigninButton != null && message.hasOwnProperty(\"showSigninButton\"))\r\n object.showSigninButton = message.showSigninButton;\r\n if (message.startupTipsIntlUrl != null && message.hasOwnProperty(\"startupTipsIntlUrl\"))\r\n object.startupTipsIntlUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.startupTipsIntlUrl, options);\r\n if (message.proMeasureUpsellUrl != null && message.hasOwnProperty(\"proMeasureUpsellUrl\"))\r\n object.proMeasureUpsellUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.proMeasureUpsellUrl, options);\r\n if (message.proPrintUpsellUrl != null && message.hasOwnProperty(\"proPrintUpsellUrl\"))\r\n object.proPrintUpsellUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.proPrintUpsellUrl, options);\r\n if (message.starDataProto != null && message.hasOwnProperty(\"starDataProto\"))\r\n object.starDataProto = $root.keyhole.dbroot.EndSnippetProto.StarDataProto.toObject(message.starDataProto, options);\r\n if (message.feedbackUrl != null && message.hasOwnProperty(\"feedbackUrl\"))\r\n object.feedbackUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.feedbackUrl, options);\r\n if (message.oauth2LoginUrl != null && message.hasOwnProperty(\"oauth2LoginUrl\"))\r\n object.oauth2LoginUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.oauth2LoginUrl, options);\r\n return object;\r\n };\r\n \r\n EndSnippetProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n EndSnippetProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto\";\r\n };\r\n \r\n EndSnippetProto.SearchConfigProto = (function() {\r\n \r\n function SearchConfigProto(properties) {\r\n this.searchServer = [];\r\n this.oneboxService = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SearchConfigProto.prototype.searchServer = $util.emptyArray;\r\n SearchConfigProto.prototype.oneboxService = $util.emptyArray;\r\n SearchConfigProto.prototype.kmlSearchUrl = null;\r\n SearchConfigProto.prototype.kmlRenderUrl = null;\r\n SearchConfigProto.prototype.searchHistoryUrl = null;\r\n SearchConfigProto.prototype.errorPageUrl = null;\r\n \r\n SearchConfigProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n if (!(message.searchServer && message.searchServer.length))\r\n message.searchServer = [];\r\n message.searchServer.push($root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 2: {\r\n if (!(message.oneboxService && message.oneboxService.length))\r\n message.oneboxService = [];\r\n message.oneboxService.push($root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 3: {\r\n message.kmlSearchUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 4: {\r\n message.kmlRenderUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 6: {\r\n message.searchHistoryUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 5: {\r\n message.errorPageUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n SearchConfigProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.searchServer != null && message.hasOwnProperty(\"searchServer\")) {\r\n if (!Array.isArray(message.searchServer))\r\n return \"searchServer: array expected\";\r\n for (var i = 0; i < message.searchServer.length; ++i) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.verify(message.searchServer[i]);\r\n if (error)\r\n return \"searchServer.\" + error;\r\n }\r\n }\r\n if (message.oneboxService != null && message.hasOwnProperty(\"oneboxService\")) {\r\n if (!Array.isArray(message.oneboxService))\r\n return \"oneboxService: array expected\";\r\n for (var i = 0; i < message.oneboxService.length; ++i) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.verify(message.oneboxService[i]);\r\n if (error)\r\n return \"oneboxService.\" + error;\r\n }\r\n }\r\n if (message.kmlSearchUrl != null && message.hasOwnProperty(\"kmlSearchUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.kmlSearchUrl);\r\n if (error)\r\n return \"kmlSearchUrl.\" + error;\r\n }\r\n if (message.kmlRenderUrl != null && message.hasOwnProperty(\"kmlRenderUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.kmlRenderUrl);\r\n if (error)\r\n return \"kmlRenderUrl.\" + error;\r\n }\r\n if (message.searchHistoryUrl != null && message.hasOwnProperty(\"searchHistoryUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.searchHistoryUrl);\r\n if (error)\r\n return \"searchHistoryUrl.\" + error;\r\n }\r\n if (message.errorPageUrl != null && message.hasOwnProperty(\"errorPageUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.errorPageUrl);\r\n if (error)\r\n return \"errorPageUrl.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n SearchConfigProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto();\r\n if (object.searchServer) {\r\n if (!Array.isArray(object.searchServer))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: array expected\");\r\n message.searchServer = [];\r\n for (var i = 0; i < object.searchServer.length; ++i) {\r\n if (typeof object.searchServer[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: object expected\");\r\n message.searchServer[i] = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.fromObject(object.searchServer[i]);\r\n }\r\n }\r\n if (object.oneboxService) {\r\n if (!Array.isArray(object.oneboxService))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: array expected\");\r\n message.oneboxService = [];\r\n for (var i = 0; i < object.oneboxService.length; ++i) {\r\n if (typeof object.oneboxService[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: object expected\");\r\n message.oneboxService[i] = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.fromObject(object.oneboxService[i]);\r\n }\r\n }\r\n if (object.kmlSearchUrl != null) {\r\n if (typeof object.kmlSearchUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlSearchUrl: object expected\");\r\n message.kmlSearchUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.kmlSearchUrl);\r\n }\r\n if (object.kmlRenderUrl != null) {\r\n if (typeof object.kmlRenderUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlRenderUrl: object expected\");\r\n message.kmlRenderUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.kmlRenderUrl);\r\n }\r\n if (object.searchHistoryUrl != null) {\r\n if (typeof object.searchHistoryUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchHistoryUrl: object expected\");\r\n message.searchHistoryUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.searchHistoryUrl);\r\n }\r\n if (object.errorPageUrl != null) {\r\n if (typeof object.errorPageUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.errorPageUrl: object expected\");\r\n message.errorPageUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.errorPageUrl);\r\n }\r\n return message;\r\n };\r\n \r\n SearchConfigProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults) {\r\n object.searchServer = [];\r\n object.oneboxService = [];\r\n }\r\n if (options.defaults) {\r\n object.kmlSearchUrl = null;\r\n object.kmlRenderUrl = null;\r\n object.errorPageUrl = null;\r\n object.searchHistoryUrl = null;\r\n }\r\n if (message.searchServer && message.searchServer.length) {\r\n object.searchServer = [];\r\n for (var j = 0; j < message.searchServer.length; ++j)\r\n object.searchServer[j] = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.toObject(message.searchServer[j], options);\r\n }\r\n if (message.oneboxService && message.oneboxService.length) {\r\n object.oneboxService = [];\r\n for (var j = 0; j < message.oneboxService.length; ++j)\r\n object.oneboxService[j] = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.toObject(message.oneboxService[j], options);\r\n }\r\n if (message.kmlSearchUrl != null && message.hasOwnProperty(\"kmlSearchUrl\"))\r\n object.kmlSearchUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.kmlSearchUrl, options);\r\n if (message.kmlRenderUrl != null && message.hasOwnProperty(\"kmlRenderUrl\"))\r\n object.kmlRenderUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.kmlRenderUrl, options);\r\n if (message.errorPageUrl != null && message.hasOwnProperty(\"errorPageUrl\"))\r\n object.errorPageUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.errorPageUrl, options);\r\n if (message.searchHistoryUrl != null && message.hasOwnProperty(\"searchHistoryUrl\"))\r\n object.searchHistoryUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.searchHistoryUrl, options);\r\n return object;\r\n };\r\n \r\n SearchConfigProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SearchConfigProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.SearchConfigProto\";\r\n };\r\n \r\n SearchConfigProto.SearchServer = (function() {\r\n \r\n function SearchServer(properties) {\r\n this.suggestion = [];\r\n this.searchlet = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SearchServer.prototype.name = null;\r\n SearchServer.prototype.url = null;\r\n SearchServer.prototype.type = 0;\r\n SearchServer.prototype.htmlTransformUrl = null;\r\n SearchServer.prototype.kmlTransformUrl = null;\r\n SearchServer.prototype.supplementalUi = null;\r\n SearchServer.prototype.suggestion = $util.emptyArray;\r\n SearchServer.prototype.searchlet = $util.emptyArray;\r\n SearchServer.prototype.requirements = null;\r\n SearchServer.prototype.suggestServer = null;\r\n \r\n SearchServer.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.type = reader.int32();\r\n break;\r\n }\r\n case 4: {\r\n message.htmlTransformUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 5: {\r\n message.kmlTransformUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 6: {\r\n message.supplementalUi = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 9: {\r\n if (!(message.suggestion && message.suggestion.length))\r\n message.suggestion = [];\r\n message.suggestion.push($root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 7: {\r\n if (!(message.searchlet && message.searchlet.length))\r\n message.searchlet = [];\r\n message.searchlet.push($root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 8: {\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 10: {\r\n message.suggestServer = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n SearchServer.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.name != null && message.hasOwnProperty(\"name\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.name);\r\n if (error)\r\n return \"name.\" + error;\r\n }\r\n if (message.url != null && message.hasOwnProperty(\"url\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n if (message.type != null && message.hasOwnProperty(\"type\"))\r\n switch (message.type) {\r\n default:\r\n return \"type: enum value expected\";\r\n case 0:\r\n case 1:\r\n break;\r\n }\r\n if (message.htmlTransformUrl != null && message.hasOwnProperty(\"htmlTransformUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.htmlTransformUrl);\r\n if (error)\r\n return \"htmlTransformUrl.\" + error;\r\n }\r\n if (message.kmlTransformUrl != null && message.hasOwnProperty(\"kmlTransformUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.kmlTransformUrl);\r\n if (error)\r\n return \"kmlTransformUrl.\" + error;\r\n }\r\n if (message.supplementalUi != null && message.hasOwnProperty(\"supplementalUi\")) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.verify(message.supplementalUi);\r\n if (error)\r\n return \"supplementalUi.\" + error;\r\n }\r\n if (message.suggestion != null && message.hasOwnProperty(\"suggestion\")) {\r\n if (!Array.isArray(message.suggestion))\r\n return \"suggestion: array expected\";\r\n for (var i = 0; i < message.suggestion.length; ++i) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.suggestion[i]);\r\n if (error)\r\n return \"suggestion.\" + error;\r\n }\r\n }\r\n if (message.searchlet != null && message.hasOwnProperty(\"searchlet\")) {\r\n if (!Array.isArray(message.searchlet))\r\n return \"searchlet: array expected\";\r\n for (var i = 0; i < message.searchlet.length; ++i) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.verify(message.searchlet[i]);\r\n if (error)\r\n return \"searchlet.\" + error;\r\n }\r\n }\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirements);\r\n if (error)\r\n return \"requirements.\" + error;\r\n }\r\n if (message.suggestServer != null && message.hasOwnProperty(\"suggestServer\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.suggestServer);\r\n if (error)\r\n return \"suggestServer.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n SearchServer.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer();\r\n if (object.name != null) {\r\n if (typeof object.name !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.name: object expected\");\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.name);\r\n }\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n switch (object.type) {\r\n case \"RESULT_TYPE_KML\":\r\n case 0:\r\n message.type = 0;\r\n break;\r\n case \"RESULT_TYPE_XML\":\r\n case 1:\r\n message.type = 1;\r\n break;\r\n }\r\n if (object.htmlTransformUrl != null) {\r\n if (typeof object.htmlTransformUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.htmlTransformUrl: object expected\");\r\n message.htmlTransformUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.htmlTransformUrl);\r\n }\r\n if (object.kmlTransformUrl != null) {\r\n if (typeof object.kmlTransformUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.kmlTransformUrl: object expected\");\r\n message.kmlTransformUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.kmlTransformUrl);\r\n }\r\n if (object.supplementalUi != null) {\r\n if (typeof object.supplementalUi !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.supplementalUi: object expected\");\r\n message.supplementalUi = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.fromObject(object.supplementalUi);\r\n }\r\n if (object.suggestion) {\r\n if (!Array.isArray(object.suggestion))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: array expected\");\r\n message.suggestion = [];\r\n for (var i = 0; i < object.suggestion.length; ++i) {\r\n if (typeof object.suggestion[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: object expected\");\r\n message.suggestion[i] = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.suggestion[i]);\r\n }\r\n }\r\n if (object.searchlet) {\r\n if (!Array.isArray(object.searchlet))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: array expected\");\r\n message.searchlet = [];\r\n for (var i = 0; i < object.searchlet.length; ++i) {\r\n if (typeof object.searchlet[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: object expected\");\r\n message.searchlet[i] = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.fromObject(object.searchlet[i]);\r\n }\r\n }\r\n if (object.requirements != null) {\r\n if (typeof object.requirements !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.requirements: object expected\");\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirements);\r\n }\r\n if (object.suggestServer != null) {\r\n if (typeof object.suggestServer !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestServer: object expected\");\r\n message.suggestServer = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.suggestServer);\r\n }\r\n return message;\r\n };\r\n \r\n SearchServer.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults) {\r\n object.searchlet = [];\r\n object.suggestion = [];\r\n }\r\n if (options.defaults) {\r\n object.name = null;\r\n object.url = null;\r\n object.type = options.enums === String ? \"RESULT_TYPE_KML\" : 0;\r\n object.htmlTransformUrl = null;\r\n object.kmlTransformUrl = null;\r\n object.supplementalUi = null;\r\n object.requirements = null;\r\n object.suggestServer = null;\r\n }\r\n if (message.name != null && message.hasOwnProperty(\"name\"))\r\n object.name = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.name, options);\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n if (message.type != null && message.hasOwnProperty(\"type\"))\r\n object.type = options.enums === String ? $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.ResultType[message.type] : message.type;\r\n if (message.htmlTransformUrl != null && message.hasOwnProperty(\"htmlTransformUrl\"))\r\n object.htmlTransformUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.htmlTransformUrl, options);\r\n if (message.kmlTransformUrl != null && message.hasOwnProperty(\"kmlTransformUrl\"))\r\n object.kmlTransformUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.kmlTransformUrl, options);\r\n if (message.supplementalUi != null && message.hasOwnProperty(\"supplementalUi\"))\r\n object.supplementalUi = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.toObject(message.supplementalUi, options);\r\n if (message.searchlet && message.searchlet.length) {\r\n object.searchlet = [];\r\n for (var j = 0; j < message.searchlet.length; ++j)\r\n object.searchlet[j] = $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.toObject(message.searchlet[j], options);\r\n }\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\"))\r\n object.requirements = $root.keyhole.dbroot.RequirementProto.toObject(message.requirements, options);\r\n if (message.suggestion && message.suggestion.length) {\r\n object.suggestion = [];\r\n for (var j = 0; j < message.suggestion.length; ++j)\r\n object.suggestion[j] = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.suggestion[j], options);\r\n }\r\n if (message.suggestServer != null && message.hasOwnProperty(\"suggestServer\"))\r\n object.suggestServer = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.suggestServer, options);\r\n return object;\r\n };\r\n \r\n SearchServer.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SearchServer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer\";\r\n };\r\n \r\n SearchServer.ResultType = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[0] = \"RESULT_TYPE_KML\"] = 0;\r\n values[valuesById[1] = \"RESULT_TYPE_XML\"] = 1;\r\n return values;\r\n })();\r\n \r\n SearchServer.SupplementalUi = (function() {\r\n \r\n function SupplementalUi(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SupplementalUi.prototype.url = null;\r\n SupplementalUi.prototype.label = null;\r\n SupplementalUi.prototype.height = 160;\r\n \r\n SupplementalUi.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.label = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.height = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n SupplementalUi.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.url != null && message.hasOwnProperty(\"url\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n if (message.label != null && message.hasOwnProperty(\"label\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.label);\r\n if (error)\r\n return \"label.\" + error;\r\n }\r\n if (message.height != null && message.hasOwnProperty(\"height\"))\r\n if (!$util.isInteger(message.height))\r\n return \"height: integer expected\";\r\n return null;\r\n };\r\n \r\n SupplementalUi.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi();\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n if (object.label != null) {\r\n if (typeof object.label !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected\");\r\n message.label = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.label);\r\n }\r\n if (object.height != null)\r\n message.height = object.height | 0;\r\n return message;\r\n };\r\n \r\n SupplementalUi.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.url = null;\r\n object.label = null;\r\n object.height = 160;\r\n }\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n if (message.label != null && message.hasOwnProperty(\"label\"))\r\n object.label = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.label, options);\r\n if (message.height != null && message.hasOwnProperty(\"height\"))\r\n object.height = message.height;\r\n return object;\r\n };\r\n \r\n SupplementalUi.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SupplementalUi.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi\";\r\n };\r\n \r\n return SupplementalUi;\r\n })();\r\n \r\n SearchServer.SearchletProto = (function() {\r\n \r\n function SearchletProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SearchletProto.prototype.url = null;\r\n SearchletProto.prototype.name = null;\r\n SearchletProto.prototype.requirements = null;\r\n \r\n SearchletProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n SearchletProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.url != null && message.hasOwnProperty(\"url\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n if (message.name != null && message.hasOwnProperty(\"name\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.name);\r\n if (error)\r\n return \"name.\" + error;\r\n }\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirements);\r\n if (error)\r\n return \"requirements.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n SearchletProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto();\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n if (object.name != null) {\r\n if (typeof object.name !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected\");\r\n message.name = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.name);\r\n }\r\n if (object.requirements != null) {\r\n if (typeof object.requirements !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected\");\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirements);\r\n }\r\n return message;\r\n };\r\n \r\n SearchletProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.url = null;\r\n object.name = null;\r\n object.requirements = null;\r\n }\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n if (message.name != null && message.hasOwnProperty(\"name\"))\r\n object.name = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.name, options);\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\"))\r\n object.requirements = $root.keyhole.dbroot.RequirementProto.toObject(message.requirements, options);\r\n return object;\r\n };\r\n \r\n SearchletProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SearchletProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto\";\r\n };\r\n \r\n return SearchletProto;\r\n })();\r\n \r\n return SearchServer;\r\n })();\r\n \r\n SearchConfigProto.OneboxServiceProto = (function() {\r\n \r\n function OneboxServiceProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n OneboxServiceProto.prototype.serviceUrl = null;\r\n OneboxServiceProto.prototype.requirements = null;\r\n \r\n OneboxServiceProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.serviceUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n OneboxServiceProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.serviceUrl != null && message.hasOwnProperty(\"serviceUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.serviceUrl);\r\n if (error)\r\n return \"serviceUrl.\" + error;\r\n }\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirements);\r\n if (error)\r\n return \"requirements.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n OneboxServiceProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto();\r\n if (object.serviceUrl != null) {\r\n if (typeof object.serviceUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected\");\r\n message.serviceUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.serviceUrl);\r\n }\r\n if (object.requirements != null) {\r\n if (typeof object.requirements !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected\");\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirements);\r\n }\r\n return message;\r\n };\r\n \r\n OneboxServiceProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.serviceUrl = null;\r\n object.requirements = null;\r\n }\r\n if (message.serviceUrl != null && message.hasOwnProperty(\"serviceUrl\"))\r\n object.serviceUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.serviceUrl, options);\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\"))\r\n object.requirements = $root.keyhole.dbroot.RequirementProto.toObject(message.requirements, options);\r\n return object;\r\n };\r\n \r\n OneboxServiceProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n OneboxServiceProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto\";\r\n };\r\n \r\n return OneboxServiceProto;\r\n })();\r\n \r\n return SearchConfigProto;\r\n })();\r\n \r\n EndSnippetProto.SearchInfoProto = (function() {\r\n \r\n function SearchInfoProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n SearchInfoProto.prototype.defaultUrl = \"http://maps.google.com/maps\";\r\n SearchInfoProto.prototype.geocodeParam = \"q\";\r\n \r\n SearchInfoProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.defaultUrl = reader.string();\r\n break;\r\n }\r\n case 2: {\r\n message.geocodeParam = reader.string();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n SearchInfoProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.defaultUrl != null && message.hasOwnProperty(\"defaultUrl\"))\r\n if (!$util.isString(message.defaultUrl))\r\n return \"defaultUrl: string expected\";\r\n if (message.geocodeParam != null && message.hasOwnProperty(\"geocodeParam\"))\r\n if (!$util.isString(message.geocodeParam))\r\n return \"geocodeParam: string expected\";\r\n return null;\r\n };\r\n \r\n SearchInfoProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.SearchInfoProto();\r\n if (object.defaultUrl != null)\r\n message.defaultUrl = String(object.defaultUrl);\r\n if (object.geocodeParam != null)\r\n message.geocodeParam = String(object.geocodeParam);\r\n return message;\r\n };\r\n \r\n SearchInfoProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.defaultUrl = \"http://maps.google.com/maps\";\r\n object.geocodeParam = \"q\";\r\n }\r\n if (message.defaultUrl != null && message.hasOwnProperty(\"defaultUrl\"))\r\n object.defaultUrl = message.defaultUrl;\r\n if (message.geocodeParam != null && message.hasOwnProperty(\"geocodeParam\"))\r\n object.geocodeParam = message.geocodeParam;\r\n return object;\r\n };\r\n \r\n SearchInfoProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n SearchInfoProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.SearchInfoProto\";\r\n };\r\n \r\n return SearchInfoProto;\r\n })();\r\n \r\n EndSnippetProto.RockTreeDataProto = (function() {\r\n \r\n function RockTreeDataProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n RockTreeDataProto.prototype.url = null;\r\n \r\n RockTreeDataProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n RockTreeDataProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.url != null && message.hasOwnProperty(\"url\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n RockTreeDataProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.RockTreeDataProto();\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n return message;\r\n };\r\n \r\n RockTreeDataProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults)\r\n object.url = null;\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n return object;\r\n };\r\n \r\n RockTreeDataProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n RockTreeDataProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.RockTreeDataProto\";\r\n };\r\n \r\n return RockTreeDataProto;\r\n })();\r\n \r\n EndSnippetProto.FilmstripConfigProto = (function() {\r\n \r\n function FilmstripConfigProto(properties) {\r\n this.imageryType = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n FilmstripConfigProto.prototype.requirements = null;\r\n FilmstripConfigProto.prototype.alleycatUrlTemplate = null;\r\n FilmstripConfigProto.prototype.fallbackAlleycatUrlTemplate = null;\r\n FilmstripConfigProto.prototype.metadataUrlTemplate = null;\r\n FilmstripConfigProto.prototype.thumbnailUrlTemplate = null;\r\n FilmstripConfigProto.prototype.kmlUrlTemplate = null;\r\n FilmstripConfigProto.prototype.featuredToursUrl = null;\r\n FilmstripConfigProto.prototype.enableViewportFallback = false;\r\n FilmstripConfigProto.prototype.viewportFallbackDistance = 0;\r\n FilmstripConfigProto.prototype.imageryType = $util.emptyArray;\r\n \r\n FilmstripConfigProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 2: {\r\n message.alleycatUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 9: {\r\n message.fallbackAlleycatUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 3: {\r\n message.metadataUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 4: {\r\n message.thumbnailUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 5: {\r\n message.kmlUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 6: {\r\n message.featuredToursUrl = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 7: {\r\n message.enableViewportFallback = reader.bool();\r\n break;\r\n }\r\n case 8: {\r\n message.viewportFallbackDistance = reader.uint32();\r\n break;\r\n }\r\n case 10: {\r\n if (!(message.imageryType && message.imageryType.length))\r\n message.imageryType = [];\r\n message.imageryType.push($root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n FilmstripConfigProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirements);\r\n if (error)\r\n return \"requirements.\" + error;\r\n }\r\n if (message.alleycatUrlTemplate != null && message.hasOwnProperty(\"alleycatUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.alleycatUrlTemplate);\r\n if (error)\r\n return \"alleycatUrlTemplate.\" + error;\r\n }\r\n if (message.fallbackAlleycatUrlTemplate != null && message.hasOwnProperty(\"fallbackAlleycatUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.fallbackAlleycatUrlTemplate);\r\n if (error)\r\n return \"fallbackAlleycatUrlTemplate.\" + error;\r\n }\r\n if (message.metadataUrlTemplate != null && message.hasOwnProperty(\"metadataUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.metadataUrlTemplate);\r\n if (error)\r\n return \"metadataUrlTemplate.\" + error;\r\n }\r\n if (message.thumbnailUrlTemplate != null && message.hasOwnProperty(\"thumbnailUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.thumbnailUrlTemplate);\r\n if (error)\r\n return \"thumbnailUrlTemplate.\" + error;\r\n }\r\n if (message.kmlUrlTemplate != null && message.hasOwnProperty(\"kmlUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.kmlUrlTemplate);\r\n if (error)\r\n return \"kmlUrlTemplate.\" + error;\r\n }\r\n if (message.featuredToursUrl != null && message.hasOwnProperty(\"featuredToursUrl\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.featuredToursUrl);\r\n if (error)\r\n return \"featuredToursUrl.\" + error;\r\n }\r\n if (message.enableViewportFallback != null && message.hasOwnProperty(\"enableViewportFallback\"))\r\n if (typeof message.enableViewportFallback !== \"boolean\")\r\n return \"enableViewportFallback: boolean expected\";\r\n if (message.viewportFallbackDistance != null && message.hasOwnProperty(\"viewportFallbackDistance\"))\r\n if (!$util.isInteger(message.viewportFallbackDistance))\r\n return \"viewportFallbackDistance: integer expected\";\r\n if (message.imageryType != null && message.hasOwnProperty(\"imageryType\")) {\r\n if (!Array.isArray(message.imageryType))\r\n return \"imageryType: array expected\";\r\n for (var i = 0; i < message.imageryType.length; ++i) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.verify(message.imageryType[i]);\r\n if (error)\r\n return \"imageryType.\" + error;\r\n }\r\n }\r\n return null;\r\n };\r\n \r\n FilmstripConfigProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto();\r\n if (object.requirements != null) {\r\n if (typeof object.requirements !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.requirements: object expected\");\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirements);\r\n }\r\n if (object.alleycatUrlTemplate != null) {\r\n if (typeof object.alleycatUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.alleycatUrlTemplate: object expected\");\r\n message.alleycatUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.alleycatUrlTemplate);\r\n }\r\n if (object.fallbackAlleycatUrlTemplate != null) {\r\n if (typeof object.fallbackAlleycatUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fallbackAlleycatUrlTemplate: object expected\");\r\n message.fallbackAlleycatUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.fallbackAlleycatUrlTemplate);\r\n }\r\n if (object.metadataUrlTemplate != null) {\r\n if (typeof object.metadataUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.metadataUrlTemplate: object expected\");\r\n message.metadataUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.metadataUrlTemplate);\r\n }\r\n if (object.thumbnailUrlTemplate != null) {\r\n if (typeof object.thumbnailUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.thumbnailUrlTemplate: object expected\");\r\n message.thumbnailUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.thumbnailUrlTemplate);\r\n }\r\n if (object.kmlUrlTemplate != null) {\r\n if (typeof object.kmlUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.kmlUrlTemplate: object expected\");\r\n message.kmlUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.kmlUrlTemplate);\r\n }\r\n if (object.featuredToursUrl != null) {\r\n if (typeof object.featuredToursUrl !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.featuredToursUrl: object expected\");\r\n message.featuredToursUrl = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.featuredToursUrl);\r\n }\r\n if (object.enableViewportFallback != null)\r\n message.enableViewportFallback = Boolean(object.enableViewportFallback);\r\n if (object.viewportFallbackDistance != null)\r\n message.viewportFallbackDistance = object.viewportFallbackDistance >>> 0;\r\n if (object.imageryType) {\r\n if (!Array.isArray(object.imageryType))\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected\");\r\n message.imageryType = [];\r\n for (var i = 0; i < object.imageryType.length; ++i) {\r\n if (typeof object.imageryType[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: object expected\");\r\n message.imageryType[i] = $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.fromObject(object.imageryType[i]);\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n FilmstripConfigProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults)\r\n object.imageryType = [];\r\n if (options.defaults) {\r\n object.requirements = null;\r\n object.alleycatUrlTemplate = null;\r\n object.metadataUrlTemplate = null;\r\n object.thumbnailUrlTemplate = null;\r\n object.kmlUrlTemplate = null;\r\n object.featuredToursUrl = null;\r\n object.enableViewportFallback = false;\r\n object.viewportFallbackDistance = 0;\r\n object.fallbackAlleycatUrlTemplate = null;\r\n }\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\"))\r\n object.requirements = $root.keyhole.dbroot.RequirementProto.toObject(message.requirements, options);\r\n if (message.alleycatUrlTemplate != null && message.hasOwnProperty(\"alleycatUrlTemplate\"))\r\n object.alleycatUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.alleycatUrlTemplate, options);\r\n if (message.metadataUrlTemplate != null && message.hasOwnProperty(\"metadataUrlTemplate\"))\r\n object.metadataUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.metadataUrlTemplate, options);\r\n if (message.thumbnailUrlTemplate != null && message.hasOwnProperty(\"thumbnailUrlTemplate\"))\r\n object.thumbnailUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.thumbnailUrlTemplate, options);\r\n if (message.kmlUrlTemplate != null && message.hasOwnProperty(\"kmlUrlTemplate\"))\r\n object.kmlUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.kmlUrlTemplate, options);\r\n if (message.featuredToursUrl != null && message.hasOwnProperty(\"featuredToursUrl\"))\r\n object.featuredToursUrl = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.featuredToursUrl, options);\r\n if (message.enableViewportFallback != null && message.hasOwnProperty(\"enableViewportFallback\"))\r\n object.enableViewportFallback = message.enableViewportFallback;\r\n if (message.viewportFallbackDistance != null && message.hasOwnProperty(\"viewportFallbackDistance\"))\r\n object.viewportFallbackDistance = message.viewportFallbackDistance;\r\n if (message.fallbackAlleycatUrlTemplate != null && message.hasOwnProperty(\"fallbackAlleycatUrlTemplate\"))\r\n object.fallbackAlleycatUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.fallbackAlleycatUrlTemplate, options);\r\n if (message.imageryType && message.imageryType.length) {\r\n object.imageryType = [];\r\n for (var j = 0; j < message.imageryType.length; ++j)\r\n object.imageryType[j] = $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.toObject(message.imageryType[j], options);\r\n }\r\n return object;\r\n };\r\n \r\n FilmstripConfigProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n FilmstripConfigProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.FilmstripConfigProto\";\r\n };\r\n \r\n FilmstripConfigProto.AlleycatImageryTypeProto = (function() {\r\n \r\n function AlleycatImageryTypeProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n AlleycatImageryTypeProto.prototype.imageryTypeId = 0;\r\n AlleycatImageryTypeProto.prototype.imageryTypeLabel = \"\";\r\n AlleycatImageryTypeProto.prototype.metadataUrlTemplate = null;\r\n AlleycatImageryTypeProto.prototype.thumbnailUrlTemplate = null;\r\n AlleycatImageryTypeProto.prototype.kmlUrlTemplate = null;\r\n \r\n AlleycatImageryTypeProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.imageryTypeId = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n message.imageryTypeLabel = reader.string();\r\n break;\r\n }\r\n case 3: {\r\n message.metadataUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 4: {\r\n message.thumbnailUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 5: {\r\n message.kmlUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n AlleycatImageryTypeProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.imageryTypeId != null && message.hasOwnProperty(\"imageryTypeId\"))\r\n if (!$util.isInteger(message.imageryTypeId))\r\n return \"imageryTypeId: integer expected\";\r\n if (message.imageryTypeLabel != null && message.hasOwnProperty(\"imageryTypeLabel\"))\r\n if (!$util.isString(message.imageryTypeLabel))\r\n return \"imageryTypeLabel: string expected\";\r\n if (message.metadataUrlTemplate != null && message.hasOwnProperty(\"metadataUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.metadataUrlTemplate);\r\n if (error)\r\n return \"metadataUrlTemplate.\" + error;\r\n }\r\n if (message.thumbnailUrlTemplate != null && message.hasOwnProperty(\"thumbnailUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.thumbnailUrlTemplate);\r\n if (error)\r\n return \"thumbnailUrlTemplate.\" + error;\r\n }\r\n if (message.kmlUrlTemplate != null && message.hasOwnProperty(\"kmlUrlTemplate\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.kmlUrlTemplate);\r\n if (error)\r\n return \"kmlUrlTemplate.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n AlleycatImageryTypeProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto();\r\n if (object.imageryTypeId != null)\r\n message.imageryTypeId = object.imageryTypeId | 0;\r\n if (object.imageryTypeLabel != null)\r\n message.imageryTypeLabel = String(object.imageryTypeLabel);\r\n if (object.metadataUrlTemplate != null) {\r\n if (typeof object.metadataUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected\");\r\n message.metadataUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.metadataUrlTemplate);\r\n }\r\n if (object.thumbnailUrlTemplate != null) {\r\n if (typeof object.thumbnailUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected\");\r\n message.thumbnailUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.thumbnailUrlTemplate);\r\n }\r\n if (object.kmlUrlTemplate != null) {\r\n if (typeof object.kmlUrlTemplate !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected\");\r\n message.kmlUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.kmlUrlTemplate);\r\n }\r\n return message;\r\n };\r\n \r\n AlleycatImageryTypeProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.imageryTypeId = 0;\r\n object.imageryTypeLabel = \"\";\r\n object.metadataUrlTemplate = null;\r\n object.thumbnailUrlTemplate = null;\r\n object.kmlUrlTemplate = null;\r\n }\r\n if (message.imageryTypeId != null && message.hasOwnProperty(\"imageryTypeId\"))\r\n object.imageryTypeId = message.imageryTypeId;\r\n if (message.imageryTypeLabel != null && message.hasOwnProperty(\"imageryTypeLabel\"))\r\n object.imageryTypeLabel = message.imageryTypeLabel;\r\n if (message.metadataUrlTemplate != null && message.hasOwnProperty(\"metadataUrlTemplate\"))\r\n object.metadataUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.metadataUrlTemplate, options);\r\n if (message.thumbnailUrlTemplate != null && message.hasOwnProperty(\"thumbnailUrlTemplate\"))\r\n object.thumbnailUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.thumbnailUrlTemplate, options);\r\n if (message.kmlUrlTemplate != null && message.hasOwnProperty(\"kmlUrlTemplate\"))\r\n object.kmlUrlTemplate = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.kmlUrlTemplate, options);\r\n return object;\r\n };\r\n \r\n AlleycatImageryTypeProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n AlleycatImageryTypeProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto\";\r\n };\r\n \r\n return AlleycatImageryTypeProto;\r\n })();\r\n \r\n return FilmstripConfigProto;\r\n })();\r\n \r\n EndSnippetProto.StarDataProto = (function() {\r\n \r\n function StarDataProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n StarDataProto.prototype.url = null;\r\n \r\n StarDataProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EndSnippetProto.StarDataProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n StarDataProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.url != null && message.hasOwnProperty(\"url\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.url);\r\n if (error)\r\n return \"url.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n StarDataProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EndSnippetProto.StarDataProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EndSnippetProto.StarDataProto();\r\n if (object.url != null) {\r\n if (typeof object.url !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected\");\r\n message.url = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.url);\r\n }\r\n return message;\r\n };\r\n \r\n StarDataProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults)\r\n object.url = null;\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.url, options);\r\n return object;\r\n };\r\n \r\n StarDataProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n StarDataProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EndSnippetProto.StarDataProto\";\r\n };\r\n \r\n return StarDataProto;\r\n })();\r\n \r\n return EndSnippetProto;\r\n })();\r\n \r\n dbroot.DbRootRefProto = (function() {\r\n \r\n function DbRootRefProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n DbRootRefProto.prototype.url = \"\";\r\n DbRootRefProto.prototype.isCritical = false;\r\n DbRootRefProto.prototype.requirements = null;\r\n \r\n DbRootRefProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.DbRootRefProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 2: {\r\n message.url = reader.string();\r\n break;\r\n }\r\n case 1: {\r\n message.isCritical = reader.bool();\r\n break;\r\n }\r\n case 3: {\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"url\"))\r\n throw $util.ProtocolError(\"missing required 'url'\", { instance: message });\r\n return message;\r\n };\r\n \r\n DbRootRefProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isString(message.url))\r\n return \"url: string expected\";\r\n if (message.isCritical != null && message.hasOwnProperty(\"isCritical\"))\r\n if (typeof message.isCritical !== \"boolean\")\r\n return \"isCritical: boolean expected\";\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\")) {\r\n var error = $root.keyhole.dbroot.RequirementProto.verify(message.requirements);\r\n if (error)\r\n return \"requirements.\" + error;\r\n }\r\n return null;\r\n };\r\n \r\n DbRootRefProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.DbRootRefProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.DbRootRefProto();\r\n if (object.url != null)\r\n message.url = String(object.url);\r\n if (object.isCritical != null)\r\n message.isCritical = Boolean(object.isCritical);\r\n if (object.requirements != null) {\r\n if (typeof object.requirements !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootRefProto.requirements: object expected\");\r\n message.requirements = $root.keyhole.dbroot.RequirementProto.fromObject(object.requirements);\r\n }\r\n return message;\r\n };\r\n \r\n DbRootRefProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.isCritical = false;\r\n object.url = \"\";\r\n object.requirements = null;\r\n }\r\n if (message.isCritical != null && message.hasOwnProperty(\"isCritical\"))\r\n object.isCritical = message.isCritical;\r\n if (message.url != null && message.hasOwnProperty(\"url\"))\r\n object.url = message.url;\r\n if (message.requirements != null && message.hasOwnProperty(\"requirements\"))\r\n object.requirements = $root.keyhole.dbroot.RequirementProto.toObject(message.requirements, options);\r\n return object;\r\n };\r\n \r\n DbRootRefProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n DbRootRefProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.DbRootRefProto\";\r\n };\r\n \r\n return DbRootRefProto;\r\n })();\r\n \r\n dbroot.DatabaseVersionProto = (function() {\r\n \r\n function DatabaseVersionProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n DatabaseVersionProto.prototype.quadtreeVersion = 0;\r\n \r\n DatabaseVersionProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.DatabaseVersionProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.quadtreeVersion = reader.uint32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n if (!message.hasOwnProperty(\"quadtreeVersion\"))\r\n throw $util.ProtocolError(\"missing required 'quadtreeVersion'\", { instance: message });\r\n return message;\r\n };\r\n \r\n DatabaseVersionProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (!$util.isInteger(message.quadtreeVersion))\r\n return \"quadtreeVersion: integer expected\";\r\n return null;\r\n };\r\n \r\n DatabaseVersionProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.DatabaseVersionProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.DatabaseVersionProto();\r\n if (object.quadtreeVersion != null)\r\n message.quadtreeVersion = object.quadtreeVersion >>> 0;\r\n return message;\r\n };\r\n \r\n DatabaseVersionProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults)\r\n object.quadtreeVersion = 0;\r\n if (message.quadtreeVersion != null && message.hasOwnProperty(\"quadtreeVersion\"))\r\n object.quadtreeVersion = message.quadtreeVersion;\r\n return object;\r\n };\r\n \r\n DatabaseVersionProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n DatabaseVersionProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.DatabaseVersionProto\";\r\n };\r\n \r\n return DatabaseVersionProto;\r\n })();\r\n \r\n dbroot.DbRootProto = (function() {\r\n \r\n function DbRootProto(properties) {\r\n this.providerInfo = [];\r\n this.nestedFeature = [];\r\n this.styleAttribute = [];\r\n this.styleMap = [];\r\n this.translationEntry = [];\r\n this.dbrootReference = [];\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n DbRootProto.prototype.databaseName = null;\r\n DbRootProto.prototype.imageryPresent = true;\r\n DbRootProto.prototype.protoImagery = false;\r\n DbRootProto.prototype.terrainPresent = false;\r\n DbRootProto.prototype.providerInfo = $util.emptyArray;\r\n DbRootProto.prototype.nestedFeature = $util.emptyArray;\r\n DbRootProto.prototype.styleAttribute = $util.emptyArray;\r\n DbRootProto.prototype.styleMap = $util.emptyArray;\r\n DbRootProto.prototype.endSnippet = null;\r\n DbRootProto.prototype.translationEntry = $util.emptyArray;\r\n DbRootProto.prototype.language = \"en\";\r\n DbRootProto.prototype.version = 5;\r\n DbRootProto.prototype.dbrootReference = $util.emptyArray;\r\n DbRootProto.prototype.databaseVersion = null;\r\n DbRootProto.prototype.refreshTimeout = 0;\r\n \r\n DbRootProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.DbRootProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 15: {\r\n message.databaseName = $root.keyhole.dbroot.StringIdOrValueProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 1: {\r\n message.imageryPresent = reader.bool();\r\n break;\r\n }\r\n case 14: {\r\n message.protoImagery = reader.bool();\r\n break;\r\n }\r\n case 2: {\r\n message.terrainPresent = reader.bool();\r\n break;\r\n }\r\n case 3: {\r\n if (!(message.providerInfo && message.providerInfo.length))\r\n message.providerInfo = [];\r\n message.providerInfo.push($root.keyhole.dbroot.ProviderInfoProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 4: {\r\n if (!(message.nestedFeature && message.nestedFeature.length))\r\n message.nestedFeature = [];\r\n message.nestedFeature.push($root.keyhole.dbroot.NestedFeatureProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 5: {\r\n if (!(message.styleAttribute && message.styleAttribute.length))\r\n message.styleAttribute = [];\r\n message.styleAttribute.push($root.keyhole.dbroot.StyleAttributeProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 6: {\r\n if (!(message.styleMap && message.styleMap.length))\r\n message.styleMap = [];\r\n message.styleMap.push($root.keyhole.dbroot.StyleMapProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 7: {\r\n message.endSnippet = $root.keyhole.dbroot.EndSnippetProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 8: {\r\n if (!(message.translationEntry && message.translationEntry.length))\r\n message.translationEntry = [];\r\n message.translationEntry.push($root.keyhole.dbroot.StringEntryProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 9: {\r\n message.language = reader.string();\r\n break;\r\n }\r\n case 10: {\r\n message.version = reader.int32();\r\n break;\r\n }\r\n case 11: {\r\n if (!(message.dbrootReference && message.dbrootReference.length))\r\n message.dbrootReference = [];\r\n message.dbrootReference.push($root.keyhole.dbroot.DbRootRefProto.decode(reader, reader.uint32()));\r\n break;\r\n }\r\n case 13: {\r\n message.databaseVersion = $root.keyhole.dbroot.DatabaseVersionProto.decode(reader, reader.uint32());\r\n break;\r\n }\r\n case 16: {\r\n message.refreshTimeout = reader.int32();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n DbRootProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.databaseName != null && message.hasOwnProperty(\"databaseName\")) {\r\n var error = $root.keyhole.dbroot.StringIdOrValueProto.verify(message.databaseName);\r\n if (error)\r\n return \"databaseName.\" + error;\r\n }\r\n if (message.imageryPresent != null && message.hasOwnProperty(\"imageryPresent\"))\r\n if (typeof message.imageryPresent !== \"boolean\")\r\n return \"imageryPresent: boolean expected\";\r\n if (message.protoImagery != null && message.hasOwnProperty(\"protoImagery\"))\r\n if (typeof message.protoImagery !== \"boolean\")\r\n return \"protoImagery: boolean expected\";\r\n if (message.terrainPresent != null && message.hasOwnProperty(\"terrainPresent\"))\r\n if (typeof message.terrainPresent !== \"boolean\")\r\n return \"terrainPresent: boolean expected\";\r\n if (message.providerInfo != null && message.hasOwnProperty(\"providerInfo\")) {\r\n if (!Array.isArray(message.providerInfo))\r\n return \"providerInfo: array expected\";\r\n for (var i = 0; i < message.providerInfo.length; ++i) {\r\n var error = $root.keyhole.dbroot.ProviderInfoProto.verify(message.providerInfo[i]);\r\n if (error)\r\n return \"providerInfo.\" + error;\r\n }\r\n }\r\n if (message.nestedFeature != null && message.hasOwnProperty(\"nestedFeature\")) {\r\n if (!Array.isArray(message.nestedFeature))\r\n return \"nestedFeature: array expected\";\r\n for (var i = 0; i < message.nestedFeature.length; ++i) {\r\n var error = $root.keyhole.dbroot.NestedFeatureProto.verify(message.nestedFeature[i]);\r\n if (error)\r\n return \"nestedFeature.\" + error;\r\n }\r\n }\r\n if (message.styleAttribute != null && message.hasOwnProperty(\"styleAttribute\")) {\r\n if (!Array.isArray(message.styleAttribute))\r\n return \"styleAttribute: array expected\";\r\n for (var i = 0; i < message.styleAttribute.length; ++i) {\r\n var error = $root.keyhole.dbroot.StyleAttributeProto.verify(message.styleAttribute[i]);\r\n if (error)\r\n return \"styleAttribute.\" + error;\r\n }\r\n }\r\n if (message.styleMap != null && message.hasOwnProperty(\"styleMap\")) {\r\n if (!Array.isArray(message.styleMap))\r\n return \"styleMap: array expected\";\r\n for (var i = 0; i < message.styleMap.length; ++i) {\r\n var error = $root.keyhole.dbroot.StyleMapProto.verify(message.styleMap[i]);\r\n if (error)\r\n return \"styleMap.\" + error;\r\n }\r\n }\r\n if (message.endSnippet != null && message.hasOwnProperty(\"endSnippet\")) {\r\n var error = $root.keyhole.dbroot.EndSnippetProto.verify(message.endSnippet);\r\n if (error)\r\n return \"endSnippet.\" + error;\r\n }\r\n if (message.translationEntry != null && message.hasOwnProperty(\"translationEntry\")) {\r\n if (!Array.isArray(message.translationEntry))\r\n return \"translationEntry: array expected\";\r\n for (var i = 0; i < message.translationEntry.length; ++i) {\r\n var error = $root.keyhole.dbroot.StringEntryProto.verify(message.translationEntry[i]);\r\n if (error)\r\n return \"translationEntry.\" + error;\r\n }\r\n }\r\n if (message.language != null && message.hasOwnProperty(\"language\"))\r\n if (!$util.isString(message.language))\r\n return \"language: string expected\";\r\n if (message.version != null && message.hasOwnProperty(\"version\"))\r\n if (!$util.isInteger(message.version))\r\n return \"version: integer expected\";\r\n if (message.dbrootReference != null && message.hasOwnProperty(\"dbrootReference\")) {\r\n if (!Array.isArray(message.dbrootReference))\r\n return \"dbrootReference: array expected\";\r\n for (var i = 0; i < message.dbrootReference.length; ++i) {\r\n var error = $root.keyhole.dbroot.DbRootRefProto.verify(message.dbrootReference[i]);\r\n if (error)\r\n return \"dbrootReference.\" + error;\r\n }\r\n }\r\n if (message.databaseVersion != null && message.hasOwnProperty(\"databaseVersion\")) {\r\n var error = $root.keyhole.dbroot.DatabaseVersionProto.verify(message.databaseVersion);\r\n if (error)\r\n return \"databaseVersion.\" + error;\r\n }\r\n if (message.refreshTimeout != null && message.hasOwnProperty(\"refreshTimeout\"))\r\n if (!$util.isInteger(message.refreshTimeout))\r\n return \"refreshTimeout: integer expected\";\r\n return null;\r\n };\r\n \r\n DbRootProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.DbRootProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.DbRootProto();\r\n if (object.databaseName != null) {\r\n if (typeof object.databaseName !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.databaseName: object expected\");\r\n message.databaseName = $root.keyhole.dbroot.StringIdOrValueProto.fromObject(object.databaseName);\r\n }\r\n if (object.imageryPresent != null)\r\n message.imageryPresent = Boolean(object.imageryPresent);\r\n if (object.protoImagery != null)\r\n message.protoImagery = Boolean(object.protoImagery);\r\n if (object.terrainPresent != null)\r\n message.terrainPresent = Boolean(object.terrainPresent);\r\n if (object.providerInfo) {\r\n if (!Array.isArray(object.providerInfo))\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.providerInfo: array expected\");\r\n message.providerInfo = [];\r\n for (var i = 0; i < object.providerInfo.length; ++i) {\r\n if (typeof object.providerInfo[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.providerInfo: object expected\");\r\n message.providerInfo[i] = $root.keyhole.dbroot.ProviderInfoProto.fromObject(object.providerInfo[i]);\r\n }\r\n }\r\n if (object.nestedFeature) {\r\n if (!Array.isArray(object.nestedFeature))\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.nestedFeature: array expected\");\r\n message.nestedFeature = [];\r\n for (var i = 0; i < object.nestedFeature.length; ++i) {\r\n if (typeof object.nestedFeature[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.nestedFeature: object expected\");\r\n message.nestedFeature[i] = $root.keyhole.dbroot.NestedFeatureProto.fromObject(object.nestedFeature[i]);\r\n }\r\n }\r\n if (object.styleAttribute) {\r\n if (!Array.isArray(object.styleAttribute))\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.styleAttribute: array expected\");\r\n message.styleAttribute = [];\r\n for (var i = 0; i < object.styleAttribute.length; ++i) {\r\n if (typeof object.styleAttribute[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.styleAttribute: object expected\");\r\n message.styleAttribute[i] = $root.keyhole.dbroot.StyleAttributeProto.fromObject(object.styleAttribute[i]);\r\n }\r\n }\r\n if (object.styleMap) {\r\n if (!Array.isArray(object.styleMap))\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.styleMap: array expected\");\r\n message.styleMap = [];\r\n for (var i = 0; i < object.styleMap.length; ++i) {\r\n if (typeof object.styleMap[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.styleMap: object expected\");\r\n message.styleMap[i] = $root.keyhole.dbroot.StyleMapProto.fromObject(object.styleMap[i]);\r\n }\r\n }\r\n if (object.endSnippet != null) {\r\n if (typeof object.endSnippet !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.endSnippet: object expected\");\r\n message.endSnippet = $root.keyhole.dbroot.EndSnippetProto.fromObject(object.endSnippet);\r\n }\r\n if (object.translationEntry) {\r\n if (!Array.isArray(object.translationEntry))\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.translationEntry: array expected\");\r\n message.translationEntry = [];\r\n for (var i = 0; i < object.translationEntry.length; ++i) {\r\n if (typeof object.translationEntry[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.translationEntry: object expected\");\r\n message.translationEntry[i] = $root.keyhole.dbroot.StringEntryProto.fromObject(object.translationEntry[i]);\r\n }\r\n }\r\n if (object.language != null)\r\n message.language = String(object.language);\r\n if (object.version != null)\r\n message.version = object.version | 0;\r\n if (object.dbrootReference) {\r\n if (!Array.isArray(object.dbrootReference))\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.dbrootReference: array expected\");\r\n message.dbrootReference = [];\r\n for (var i = 0; i < object.dbrootReference.length; ++i) {\r\n if (typeof object.dbrootReference[i] !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.dbrootReference: object expected\");\r\n message.dbrootReference[i] = $root.keyhole.dbroot.DbRootRefProto.fromObject(object.dbrootReference[i]);\r\n }\r\n }\r\n if (object.databaseVersion != null) {\r\n if (typeof object.databaseVersion !== \"object\")\r\n throw TypeError(\".keyhole.dbroot.DbRootProto.databaseVersion: object expected\");\r\n message.databaseVersion = $root.keyhole.dbroot.DatabaseVersionProto.fromObject(object.databaseVersion);\r\n }\r\n if (object.refreshTimeout != null)\r\n message.refreshTimeout = object.refreshTimeout | 0;\r\n return message;\r\n };\r\n \r\n DbRootProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.arrays || options.defaults) {\r\n object.providerInfo = [];\r\n object.nestedFeature = [];\r\n object.styleAttribute = [];\r\n object.styleMap = [];\r\n object.translationEntry = [];\r\n object.dbrootReference = [];\r\n }\r\n if (options.defaults) {\r\n object.imageryPresent = true;\r\n object.terrainPresent = false;\r\n object.endSnippet = null;\r\n object.language = \"en\";\r\n object.version = 5;\r\n object.databaseVersion = null;\r\n object.protoImagery = false;\r\n object.databaseName = null;\r\n object.refreshTimeout = 0;\r\n }\r\n if (message.imageryPresent != null && message.hasOwnProperty(\"imageryPresent\"))\r\n object.imageryPresent = message.imageryPresent;\r\n if (message.terrainPresent != null && message.hasOwnProperty(\"terrainPresent\"))\r\n object.terrainPresent = message.terrainPresent;\r\n if (message.providerInfo && message.providerInfo.length) {\r\n object.providerInfo = [];\r\n for (var j = 0; j < message.providerInfo.length; ++j)\r\n object.providerInfo[j] = $root.keyhole.dbroot.ProviderInfoProto.toObject(message.providerInfo[j], options);\r\n }\r\n if (message.nestedFeature && message.nestedFeature.length) {\r\n object.nestedFeature = [];\r\n for (var j = 0; j < message.nestedFeature.length; ++j)\r\n object.nestedFeature[j] = $root.keyhole.dbroot.NestedFeatureProto.toObject(message.nestedFeature[j], options);\r\n }\r\n if (message.styleAttribute && message.styleAttribute.length) {\r\n object.styleAttribute = [];\r\n for (var j = 0; j < message.styleAttribute.length; ++j)\r\n object.styleAttribute[j] = $root.keyhole.dbroot.StyleAttributeProto.toObject(message.styleAttribute[j], options);\r\n }\r\n if (message.styleMap && message.styleMap.length) {\r\n object.styleMap = [];\r\n for (var j = 0; j < message.styleMap.length; ++j)\r\n object.styleMap[j] = $root.keyhole.dbroot.StyleMapProto.toObject(message.styleMap[j], options);\r\n }\r\n if (message.endSnippet != null && message.hasOwnProperty(\"endSnippet\"))\r\n object.endSnippet = $root.keyhole.dbroot.EndSnippetProto.toObject(message.endSnippet, options);\r\n if (message.translationEntry && message.translationEntry.length) {\r\n object.translationEntry = [];\r\n for (var j = 0; j < message.translationEntry.length; ++j)\r\n object.translationEntry[j] = $root.keyhole.dbroot.StringEntryProto.toObject(message.translationEntry[j], options);\r\n }\r\n if (message.language != null && message.hasOwnProperty(\"language\"))\r\n object.language = message.language;\r\n if (message.version != null && message.hasOwnProperty(\"version\"))\r\n object.version = message.version;\r\n if (message.dbrootReference && message.dbrootReference.length) {\r\n object.dbrootReference = [];\r\n for (var j = 0; j < message.dbrootReference.length; ++j)\r\n object.dbrootReference[j] = $root.keyhole.dbroot.DbRootRefProto.toObject(message.dbrootReference[j], options);\r\n }\r\n if (message.databaseVersion != null && message.hasOwnProperty(\"databaseVersion\"))\r\n object.databaseVersion = $root.keyhole.dbroot.DatabaseVersionProto.toObject(message.databaseVersion, options);\r\n if (message.protoImagery != null && message.hasOwnProperty(\"protoImagery\"))\r\n object.protoImagery = message.protoImagery;\r\n if (message.databaseName != null && message.hasOwnProperty(\"databaseName\"))\r\n object.databaseName = $root.keyhole.dbroot.StringIdOrValueProto.toObject(message.databaseName, options);\r\n if (message.refreshTimeout != null && message.hasOwnProperty(\"refreshTimeout\"))\r\n object.refreshTimeout = message.refreshTimeout;\r\n return object;\r\n };\r\n \r\n DbRootProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n DbRootProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.DbRootProto\";\r\n };\r\n \r\n return DbRootProto;\r\n })();\r\n \r\n dbroot.EncryptedDbRootProto = (function() {\r\n \r\n function EncryptedDbRootProto(properties) {\r\n if (properties)\r\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\r\n if (properties[keys[i]] != null)\r\n this[keys[i]] = properties[keys[i]];\r\n }\r\n \r\n EncryptedDbRootProto.prototype.encryptionType = 0;\r\n EncryptedDbRootProto.prototype.encryptionData = $util.newBuffer([]);\r\n EncryptedDbRootProto.prototype.dbrootData = $util.newBuffer([]);\r\n \r\n EncryptedDbRootProto.decode = function decode(reader, length) {\r\n if (!(reader instanceof $Reader))\r\n reader = $Reader.create(reader);\r\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.keyhole.dbroot.EncryptedDbRootProto();\r\n while (reader.pos < end) {\r\n var tag = reader.uint32();\r\n switch (tag >>> 3) {\r\n case 1: {\r\n message.encryptionType = reader.int32();\r\n break;\r\n }\r\n case 2: {\r\n message.encryptionData = reader.bytes();\r\n break;\r\n }\r\n case 3: {\r\n message.dbrootData = reader.bytes();\r\n break;\r\n }\r\n default:\r\n reader.skipType(tag & 7);\r\n break;\r\n }\r\n }\r\n return message;\r\n };\r\n \r\n EncryptedDbRootProto.verify = function verify(message) {\r\n if (typeof message !== \"object\" || message === null)\r\n return \"object expected\";\r\n if (message.encryptionType != null && message.hasOwnProperty(\"encryptionType\"))\r\n switch (message.encryptionType) {\r\n default:\r\n return \"encryptionType: enum value expected\";\r\n case 0:\r\n break;\r\n }\r\n if (message.encryptionData != null && message.hasOwnProperty(\"encryptionData\"))\r\n if (!(message.encryptionData && typeof message.encryptionData.length === \"number\" || $util.isString(message.encryptionData)))\r\n return \"encryptionData: buffer expected\";\r\n if (message.dbrootData != null && message.hasOwnProperty(\"dbrootData\"))\r\n if (!(message.dbrootData && typeof message.dbrootData.length === \"number\" || $util.isString(message.dbrootData)))\r\n return \"dbrootData: buffer expected\";\r\n return null;\r\n };\r\n \r\n EncryptedDbRootProto.fromObject = function fromObject(object) {\r\n if (object instanceof $root.keyhole.dbroot.EncryptedDbRootProto)\r\n return object;\r\n var message = new $root.keyhole.dbroot.EncryptedDbRootProto();\r\n switch (object.encryptionType) {\r\n case \"ENCRYPTION_XOR\":\r\n case 0:\r\n message.encryptionType = 0;\r\n break;\r\n }\r\n if (object.encryptionData != null)\r\n if (typeof object.encryptionData === \"string\")\r\n $util.base64.decode(object.encryptionData, message.encryptionData = $util.newBuffer($util.base64.length(object.encryptionData)), 0);\r\n else if (object.encryptionData.length >= 0)\r\n message.encryptionData = object.encryptionData;\r\n if (object.dbrootData != null)\r\n if (typeof object.dbrootData === \"string\")\r\n $util.base64.decode(object.dbrootData, message.dbrootData = $util.newBuffer($util.base64.length(object.dbrootData)), 0);\r\n else if (object.dbrootData.length >= 0)\r\n message.dbrootData = object.dbrootData;\r\n return message;\r\n };\r\n \r\n EncryptedDbRootProto.toObject = function toObject(message, options) {\r\n if (!options)\r\n options = {};\r\n var object = {};\r\n if (options.defaults) {\r\n object.encryptionType = options.enums === String ? \"ENCRYPTION_XOR\" : 0;\r\n if (options.bytes === String)\r\n object.encryptionData = \"\";\r\n else {\r\n object.encryptionData = [];\r\n if (options.bytes !== Array)\r\n object.encryptionData = $util.newBuffer(object.encryptionData);\r\n }\r\n if (options.bytes === String)\r\n object.dbrootData = \"\";\r\n else {\r\n object.dbrootData = [];\r\n if (options.bytes !== Array)\r\n object.dbrootData = $util.newBuffer(object.dbrootData);\r\n }\r\n }\r\n if (message.encryptionType != null && message.hasOwnProperty(\"encryptionType\"))\r\n object.encryptionType = options.enums === String ? $root.keyhole.dbroot.EncryptedDbRootProto.EncryptionType[message.encryptionType] : message.encryptionType;\r\n if (message.encryptionData != null && message.hasOwnProperty(\"encryptionData\"))\r\n object.encryptionData = options.bytes === String ? $util.base64.encode(message.encryptionData, 0, message.encryptionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.encryptionData) : message.encryptionData;\r\n if (message.dbrootData != null && message.hasOwnProperty(\"dbrootData\"))\r\n object.dbrootData = options.bytes === String ? $util.base64.encode(message.dbrootData, 0, message.dbrootData.length) : options.bytes === Array ? Array.prototype.slice.call(message.dbrootData) : message.dbrootData;\r\n return object;\r\n };\r\n \r\n EncryptedDbRootProto.prototype.toJSON = function toJSON() {\r\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\r\n };\r\n \r\n EncryptedDbRootProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\r\n if (typeUrlPrefix === undefined) {\r\n typeUrlPrefix = \"type.googleapis.com\";\r\n }\r\n return typeUrlPrefix + \"/keyhole.dbroot.EncryptedDbRootProto\";\r\n };\r\n \r\n EncryptedDbRootProto.EncryptionType = (function() {\r\n var valuesById = {}, values = Object.create(valuesById);\r\n values[valuesById[0] = \"ENCRYPTION_XOR\"] = 0;\r\n return values;\r\n })();\r\n \r\n return EncryptedDbRootProto;\r\n })();\r\n \r\n return dbroot;\r\n })();\r\n \r\n return keyhole;\r\n })();\r\n\r\n // End generated code\r\n\r\n return $root.keyhole.dbroot;\r\n};\r\n"], - "mappings": "MAAA,OAAO,8BAAgC,SACnCA,EAAW,CAEX,aASA,IAAIC,EAAUD,EAAU,OAAQE,EAAQF,EAAU,KAE9CG,EAAQH,EAAU,MAAM,UAAeA,EAAU,MAAM,QAAa,CAAC,GAEzE,OAAAG,EAAM,QAAW,UAAW,CAExB,IAAIC,EAAU,CAAC,EAEf,OAAAA,EAAQ,OAAU,UAAW,CAEzB,IAAIC,EAAS,CAAC,EAEd,OAAAA,EAAO,iBAAoB,UAAW,CAElC,SAASC,EAAiBC,EAAY,CAClC,GAAIA,EACA,QAASC,EAAO,OAAO,KAAKD,CAAU,EAAGE,EAAI,EAAGA,EAAID,EAAK,OAAQ,EAAEC,EAC3DF,EAAWC,EAAKC,CAAC,CAAC,GAAK,OACvB,KAAKD,EAAKC,CAAC,CAAC,EAAIF,EAAWC,EAAKC,CAAC,CAAC,EAClD,CAEA,OAAAH,EAAiB,UAAU,SAAW,EACtCA,EAAiB,UAAU,YAAc,GAEzCA,EAAiB,OAAS,SAAgBI,EAAQC,EAAQ,CAChDD,aAAkBT,IACpBS,EAAST,EAAQ,OAAOS,CAAM,GAElC,QADIE,EAAMD,IAAW,OAAYD,EAAO,IAAMA,EAAO,IAAMC,EAAQE,EAAU,IAAIV,EAAM,QAAQ,OAAO,iBAC/FO,EAAO,IAAME,GAAK,CACrB,IAAIE,EAAMJ,EAAO,OAAO,EACxB,OAAQI,IAAQ,EAAG,CACnB,IAAK,GAAG,CACAD,EAAQ,SAAWH,EAAO,QAAQ,EAClC,KACJ,CACJ,IAAK,GAAG,CACAG,EAAQ,YAAcH,EAAO,OAAO,EACpC,KACJ,CACJ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["$protobuf", "$Reader", "$util", "$root", "keyhole", "dbroot", "StringEntryProto", "properties", "keys", "i", "reader", "length", "end", "message", "tag", "object", "options", "typeUrlPrefix", "StringIdOrValueProto", "PlanetModelProto", "ProviderInfoProto", "error", "PopUpProto", "StyleAttributeProto", "j", "StyleMapProto", "end2", "ZoomRangeProto", "DrawFlagProto", "valuesById", "values", "LayerProto", "FolderProto", "RequirementProto", "LookAtProto", "NestedFeatureProto", "MfeDomainFeaturesProto", "ClientOptionsProto", "PrecipitationsOptions", "WeatherMapping", "CaptureOptions", "MapsOptions", "FetchingOptionsProto", "TimeMachineOptionsProto", "AutopiaOptionsProto", "CSIOptionsProto", "SearchTabProto", "InputBoxInfo", "CobrandProto", "Coord", "DatabaseDescriptionProto", "ConfigScriptProto", "SwoopParamsProto", "PostingServerProto", "PlanetaryDatabaseProto", "LogServerProto", "EndSnippetProto", "SearchConfigProto", "SearchServer", "SupplementalUi", "SearchletProto", "OneboxServiceProto", "SearchInfoProto", "RockTreeDataProto", "FilmstripConfigProto", "AlleycatImageryTypeProto", "StarDataProto", "DbRootRefProto", "DatabaseVersionProto", "DbRootProto", "EncryptedDbRootProto"] } diff --git a/plugins/feature/map/Cesium/ThirdParty/wasm_splats_bg.wasm b/plugins/feature/map/Cesium/ThirdParty/wasm_splats_bg.wasm new file mode 100644 index 000000000..9e46cc4cd Binary files /dev/null and b/plugins/feature/map/Cesium/ThirdParty/wasm_splats_bg.wasm differ diff --git a/plugins/feature/map/Cesium/ThirdParty/zip-module.wasm b/plugins/feature/map/Cesium/ThirdParty/zip-module.wasm new file mode 100644 index 000000000..021813150 Binary files /dev/null and b/plugins/feature/map/Cesium/ThirdParty/zip-module.wasm differ diff --git a/plugins/feature/map/Cesium/Widgets/Animation/Animation.css b/plugins/feature/map/Cesium/Widgets/Animation/Animation.css index 0f18c52e2..311076326 100644 --- a/plugins/feature/map/Cesium/Widgets/Animation/Animation.css +++ b/plugins/feature/map/Cesium/Widgets/Animation/Animation.css @@ -35,6 +35,11 @@ font-size: 15px; text-anchor: middle; } +.cesium-animation-dateField, +.cesium-animation-timeField { + cursor: ns-resize; + pointer-events: all; +} .cesium-animation-blank { fill: #000; fill-opacity: 0.01; diff --git a/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/azureAerial.png b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/azureAerial.png new file mode 100644 index 000000000..7542b42e1 Binary files /dev/null and b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/azureAerial.png differ diff --git a/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/azureRoads.png b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/azureRoads.png new file mode 100644 index 000000000..80d3f2976 Binary files /dev/null and b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/azureRoads.png differ diff --git a/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleContour.png b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleContour.png new file mode 100644 index 000000000..618cc1214 Binary files /dev/null and b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleContour.png differ diff --git a/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleRoadmap.png b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleRoadmap.png new file mode 100644 index 000000000..c0db555bc Binary files /dev/null and b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleRoadmap.png differ diff --git a/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleSatellite.png b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleSatellite.png new file mode 100644 index 000000000..84fadbe4f Binary files /dev/null and b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleSatellite.png differ diff --git a/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png new file mode 100644 index 000000000..e2133a18d Binary files /dev/null and b/plugins/feature/map/Cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png differ diff --git a/plugins/feature/map/Cesium/Widgets/InfoBox/InfoBox.css b/plugins/feature/map/Cesium/Widgets/InfoBox/InfoBox.css index 42a7b2201..2cd343432 100644 --- a/plugins/feature/map/Cesium/Widgets/InfoBox/InfoBox.css +++ b/plugins/feature/map/Cesium/Widgets/InfoBox/InfoBox.css @@ -38,6 +38,15 @@ white-space: nowrap; overflow: hidden; box-sizing: content-box; + cursor: grab; + touch-action: none; + user-select: none; +} +.cesium-infoBox-dragging { + transition: none; +} +.cesium-infoBox-dragging .cesium-infoBox-title { + cursor: grabbing; } .cesium-infoBox-bodyless .cesium-infoBox-title { border-bottom-left-radius: 7px; diff --git a/plugins/feature/map/Cesium/Widgets/widgets.css b/plugins/feature/map/Cesium/Widgets/widgets.css index df675d599..57666a16f 100644 --- a/plugins/feature/map/Cesium/Widgets/widgets.css +++ b/plugins/feature/map/Cesium/Widgets/widgets.css @@ -139,6 +139,11 @@ font-size: 15px; text-anchor: middle; } +.cesium-animation-dateField, +.cesium-animation-timeField { + cursor: ns-resize; + pointer-events: all; +} .cesium-animation-blank { fill: #000; fill-opacity: 0.01; @@ -819,6 +824,15 @@ input.cesium-cesiumInspector-url { white-space: nowrap; overflow: hidden; box-sizing: content-box; + cursor: grab; + touch-action: none; + user-select: none; +} +.cesium-infoBox-dragging { + transition: none; +} +.cesium-infoBox-dragging .cesium-infoBox-title { + cursor: grabbing; } .cesium-infoBox-bodyless .cesium-infoBox-title { border-bottom-left-radius: 7px; diff --git a/plugins/feature/map/Cesium/Workers/chunk-SP23RJSN.js b/plugins/feature/map/Cesium/Workers/chunk-23IOGON7.js similarity index 69% rename from plugins/feature/map/Cesium/Workers/chunk-SP23RJSN.js rename to plugins/feature/map/Cesium/Workers/chunk-23IOGON7.js index 3655f0ae5..0eb4fac8e 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-SP23RJSN.js +++ b/plugins/feature/map/Cesium/Workers/chunk-23IOGON7.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,5 +23,5 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{e}from"./chunk-3BGP4HCL.js";function t(r){this.name="RuntimeError",this.message=r;let o;try{throw new Error}catch(s){o=s.stack}this.stack=o}e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t);t.prototype.toString=function(){let r=`${this.name}: ${this.message}`;return e(this.stack)&&(r+=` +import{f as e}from"./chunk-H7SJWKIY.js";function t(r){this.name="RuntimeError",this.message=r;let o;try{throw new Error}catch(s){o=s.stack}this.stack=o}e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t);t.prototype.toString=function(){let r=`${this.name}: ${this.message}`;return e(this.stack)&&(r+=` ${this.stack.toString()}`),r};var c=t;export{c as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-23RYXNR3.js b/plugins/feature/map/Cesium/Workers/chunk-23RYXNR3.js deleted file mode 100644 index 8c17d00a8..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-23RYXNR3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as tt}from"./chunk-X6N776GR.js";import{a as jt}from"./chunk-XOTNFHCP.js";import{b as Lt}from"./chunk-QFKZXFLI.js";import{a as Et}from"./chunk-ASLWXOD7.js";import{a as j}from"./chunk-JQLYZQ6V.js";import{a as dt,b as D,c as B,d as U}from"./chunk-AVPLM4UI.js";import{a as _t,b as Ut,d as ot}from"./chunk-ZYYZDBKK.js";import{a as pt,b as H}from"./chunk-3PT5NNSP.js";import{a as F}from"./chunk-WER4LUMF.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-FGKVHLJ4.js";import{a as N}from"./chunk-YRCAQUFT.js";import{a as I,b as ft}from"./chunk-ELJAHN3H.js";import{e as f}from"./chunk-3BGP4HCL.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(3*3)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+4*3;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+4*3;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+2*4;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+2*4;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+2*2;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+2*2;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+4*3;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+4*2;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+4*4;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-2V6KZTKL.js b/plugins/feature/map/Cesium/Workers/chunk-2V6KZTKL.js deleted file mode 100644 index a01512cf1..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-2V6KZTKL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as R}from"./chunk-IFR5HKVH.js";import{a as ct}from"./chunk-23RYXNR3.js";import{a as Z,b as H}from"./chunk-BKYT7QHD.js";import{a as V}from"./chunk-PNMU44JZ.js";import{a as U}from"./chunk-IAW6QHRG.js";import{b as ot}from"./chunk-QFKZXFLI.js";import{a as it}from"./chunk-ASLWXOD7.js";import{a as nt}from"./chunk-JQLYZQ6V.js";import{a as et}from"./chunk-J3L5WX3X.js";import{b as J,c as X,d as z}from"./chunk-AVPLM4UI.js";import{f as K}from"./chunk-3PT5NNSP.js";import{a as k}from"./chunk-WER4LUMF.js";import{a as w,b as q,c as M,d as tt,e as F}from"./chunk-FGKVHLJ4.js";import{a as I}from"./chunk-YRCAQUFT.js";import{e as x}from"./chunk-3BGP4HCL.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,++i,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-3AERAMWF.js b/plugins/feature/map/Cesium/Workers/chunk-3AERAMWF.js new file mode 100644 index 000000000..a826e4bca --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-3AERAMWF.js @@ -0,0 +1,29 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as Fa}from"./chunk-V23IN42C.js";import{a as zb,b as Ja,c as Ha}from"./chunk-WVRWFNLS.js";import{a as Ia}from"./chunk-MQTDGHHT.js";import{a as ra}from"./chunk-XAERMS6D.js";import{a as rb}from"./chunk-QCE33JV5.js";import{a as Ca}from"./chunk-DV5LK4D5.js";import{a as gb,b as ib}from"./chunk-ZNBU4MZZ.js";import{b as db,c as pa}from"./chunk-THB3EPLO.js";import{a as Ra,b as _b,d as hb,e as Fb,f as Mb,g as Na,i as Oa,j as xa}from"./chunk-YZ5ZCI55.js";import{b as J}from"./chunk-HLXNFZAZ.js";import{a as tb}from"./chunk-WCOEOHX5.js";import{a as Ba}from"./chunk-23IOGON7.js";import{a as Y,b as R,c as Ea,d as nb}from"./chunk-KP72RGCH.js";import{a as p,b as ya,c as fb}from"./chunk-OSVSBQDY.js";import{a as L}from"./chunk-LZC73BOP.js";import{a as Aa,b as T}from"./chunk-OU2IPMYE.js";import{d as $b,f as Z}from"./chunk-H7SJWKIY.js";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gDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo: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;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb: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:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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 c,o=WebAssembly.instantiate(u(e),{}).then(function(k){c=k.instance,c.exports.__wasm_call_ctors(),c.exports.meshopt_encodeVertexVersion(1),c.exports.meshopt_encodeIndexVersion(1)});function u(k){for(var s=new Uint8Array(k.length),h=0;h<k.length;++h){var n=k.charCodeAt(h);s[h]=n>96?n-97:n>64?n-39:n+4}for(var t=0,h=0;h<k.length;++h)s[t++]=s[h]<60?i[s[h]]:(s[h]-60)*64+s[++h];return s.buffer.slice(0,t)}function b(k){if(!k)throw new Error("Assertion failed")}function g(k){return new Uint8Array(k.buffer,k.byteOffset,k.byteLength)}function w(k,s,h,n){var t=c.exports.sbrk,a=t(s.length*4),d=t(h*4),f=new Uint8Array(c.exports.memory.buffer),r=g(s);f.set(r,a),n&&n(a,a,s.length,h);var l=k(d,a,s.length,h);f=new Uint8Array(c.exports.memory.buffer);var m=new Uint32Array(h);new Uint8Array(m.buffer).set(f.subarray(d,d+h*4)),r.set(f.subarray(a,a+s.length*4)),t(a-t(0));for(var y=0;y<s.length;++y)s[y]=m[s[y]];return[m,l]}function v(k,s,h,n){var t=c.exports.sbrk,a=t(h*4),d=t(h*n),f=new Uint8Array(c.exports.memory.buffer);f.set(g(s),d),k(a,d,h,n),f=new Uint8Array(c.exports.memory.buffer);var r=new Uint32Array(h);return new Uint8Array(r.buffer).set(f.subarray(a,a+h*4)),t(a-t(0)),r}function x(k,s,h,n,t,a,d){var f=c.exports.sbrk,r=f(s),l=f(n*t),m=new Uint8Array(c.exports.memory.buffer);m.set(g(h),l);var y=k(r,s,l,n,t,a,d),I=new Uint8Array(y);return I.set(m.subarray(r,r+y)),f(r-f(0)),I}function j(k){for(var s=0,h=0;h<k.length;++h){var n=k[h];s=s<n?n:s}return s}function A(k,s){if(b(s==2||s==4),s==4)return new Uint32Array(k.buffer,k.byteOffset,k.byteLength/4);var h=new Uint16Array(k.buffer,k.byteOffset,k.byteLength/2);return new Uint32Array(h)}function F(k,s,h,n,t,a,d){var f=c.exports.sbrk,r=f(h*n),l=f(h*a),m=new Uint8Array(c.exports.memory.buffer);m.set(g(s),l),k(r,h,n,t,l,d);var y=new Uint8Array(h*n);return y.set(m.subarray(r,r+h*n)),f(r-f(0)),y}return{ready:o,supported:!0,reorderMesh:function(k,s,h){b(k instanceof Uint32Array||k instanceof Int32Array),b(!s||k.length%3==0);var n=s?h?c.exports.meshopt_optimizeVertexCacheStrip:c.exports.meshopt_optimizeVertexCache:void 0;return w(c.exports.meshopt_optimizeVertexFetchRemap,k,j(k)+1,n)},reorderPoints:function(k,s){return b(k instanceof Float32Array),b(k.length%s==0),b(s>=3),v(c.exports.meshopt_spatialSortRemap,k,k.length/s,s*4)},encodeVertexBuffer:function(k,s,h){b(h>0&&h<=256),b(h%4==0);var n=c.exports.meshopt_encodeVertexBufferBound(s,h);return x(c.exports.meshopt_encodeVertexBuffer,n,k,s,h)},encodeVertexBufferLevel:function(k,s,h,n,t){b(h>0&&h<=256),b(h%4==0),b(n>=0&&n<=3),b(t===void 0||t==0||t==1);var a=c.exports.meshopt_encodeVertexBufferBound(s,h);return x(c.exports.meshopt_encodeVertexBufferLevel,a,k,s,h,n,t===void 0?-1:t)},encodeIndexBuffer:function(k,s,h){b(h==2||h==4),b(s%3==0);var n=A(k,h),t=c.exports.meshopt_encodeIndexBufferBound(s,j(n)+1);return x(c.exports.meshopt_encodeIndexBuffer,t,n,s,4)},encodeIndexSequence:function(k,s,h){b(h==2||h==4);var n=A(k,h),t=c.exports.meshopt_encodeIndexSequenceBound(s,j(n)+1);return x(c.exports.meshopt_encodeIndexSequence,t,n,s,4)},encodeGltfBuffer:function(k,s,h,n,t){var a={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return b(a[n]),a[n](k,s,h,2,t===void 0?0:t)},encodeFilterOct:function(k,s,h,n){return b(h==4||h==8),b(n>=2&&n<=16),F(c.exports.meshopt_encodeFilterOct,k,s,h,n,16)},encodeFilterQuat:function(k,s,h,n){return b(h==8),b(n>=4&&n<=16),F(c.exports.meshopt_encodeFilterQuat,k,s,h,n,16)},encodeFilterExp:function(k,s,h,n,t){b(h>0&&h%4==0),b(n>=1&&n<=24);var a={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return b(!t||t in a),F(c.exports.meshopt_encodeFilterExp,k,s,h,n,h,t?a[t]:1)},encodeFilterColor:function(k,s,h,n){return b(h==4||h==8),b(n>=2&&n<=16),F(c.exports.meshopt_encodeFilterColor,k,s,h,n,16)}}})();var Ma=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",i="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",c=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]),o=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 u=WebAssembly.validate(c)?w(i):w(e),b,g=WebAssembly.instantiate(u,{}).then(function(t){b=t.instance,b.exports.__wasm_call_ctors()});function w(t){for(var a=new Uint8Array(t.length),d=0;d<t.length;++d){var f=t.charCodeAt(d);a[d]=f>96?f-97:f>64?f-39:f+4}for(var r=0,d=0;d<t.length;++d)a[r++]=a[d]<60?o[a[d]]:(a[d]-60)*64+a[++d];return a.buffer.slice(0,r)}function v(t,a,d,f,r,l,m){var y=t.exports.sbrk,I=f+3&-4,H=y(I*r),E=y(l.length),N=new Uint8Array(t.exports.memory.buffer);N.set(l,E);var z=a(H,f,r,E,l.length);if(z==0&&m&&m(H,I,r),d.set(N.subarray(H,H+f*r)),y(H-y(0)),z!=0)throw new Error("Malformed buffer data: "+z)}var x={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},j={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},A=[],F=0;function k(t){var a={object:new Worker(t),pending:0,requests:{}};return a.object.onmessage=function(d){var f=d.data;a.pending-=f.count,a.requests[f.id][f.action](f.value),delete a.requests[f.id]},a}function s(t){for(var a="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(u)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+n.name+";"+v.toString()+n.toString(),d=new Blob([a],{type:"text/javascript"}),f=URL.createObjectURL(d),r=A.length;r<t;++r)A[r]=k(f);for(var r=t;r<A.length;++r)A[r].object.postMessage({});A.length=t,URL.revokeObjectURL(f)}function h(t,a,d,f,r){for(var l=A[0],m=1;m<A.length;++m)A[m].pending<l.pending&&(l=A[m]);return new Promise(function(y,I){var H=new Uint8Array(d),E=++F;l.pending+=t,l.requests[E]={resolve:y,reject:I},l.object.postMessage({id:E,count:t,size:a,source:H,mode:f,filter:r},[H.buffer])})}function n(t){var a=t.data;self.ready.then(function(d){if(!a.id)return self.close();try{var f=new Uint8Array(a.count*a.size);v(d,d.exports[a.mode],f,a.count,a.size,a.source,d.exports[a.filter]),self.postMessage({id:a.id,count:a.count,action:"resolve",value:f},[f.buffer])}catch(r){self.postMessage({id:a.id,count:a.count,action:"reject",value:r})}})}return{ready:g,supported:!0,useWorkers:function(t){s(t)},decodeVertexBuffer:function(t,a,d,f,r){v(b,b.exports.meshopt_decodeVertexBuffer,t,a,d,f,b.exports[x[r]])},decodeIndexBuffer:function(t,a,d,f){v(b,b.exports.meshopt_decodeIndexBuffer,t,a,d,f)},decodeIndexSequence:function(t,a,d,f){v(b,b.exports.meshopt_decodeIndexSequence,t,a,d,f)},decodeGltfBuffer:function(t,a,d,f,r,l){v(b,b.exports[j[r]],t,a,d,f,b.exports[x[l]])},decodeGltfBufferAsync:function(t,a,d,f,r){return A.length>0?h(t,a,d,j[f],x[r]):g.then(function(){var l=new Uint8Array(t*a);return v(b,b.exports[j[f]],l,t,a,d,b.exports[x[r]]),l})}}})();var Ce=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbk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AcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg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MMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEa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kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaea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ahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaR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efgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi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jjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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 c,o=WebAssembly.instantiate(u(e),{}).then(function(a){c=a.instance,c.exports.__wasm_call_ctors()});function u(a){for(var d=new Uint8Array(a.length),f=0;f<a.length;++f){var r=a.charCodeAt(f);d[f]=r>96?r-97:r>64?r-39:r+4}for(var l=0,f=0;f<a.length;++f)d[l++]=d[f]<60?i[d[f]]:(d[f]-60)*64+d[++f];return d.buffer.slice(0,l)}function b(a){if(!a)throw new Error("Assertion failed")}function g(a){return new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}function w(a,d,f,r){var l=c.exports.sbrk,m=l(f*4),y=l(f*r*4),I=new Uint8Array(c.exports.memory.buffer);I.set(g(d),y),a(m,y,f,r*4),I=new Uint8Array(c.exports.memory.buffer);var H=new Uint32Array(f);return new Uint8Array(H.buffer).set(I.subarray(m,m+f*4)),l(m-l(0)),H}function v(a,d,f){var r=c.exports.sbrk,l=r(d.length*4),m=r(f*4),y=new Uint8Array(c.exports.memory.buffer),I=g(d);y.set(I,l);var H=a(m,l,d.length,f);y=new Uint8Array(c.exports.memory.buffer);var E=new Uint32Array(f);new Uint8Array(E.buffer).set(y.subarray(m,m+f*4)),r(l-r(0));for(var N=0;N<d.length;++N)d[N]=E[d[N]];return[E,H]}function x(a){for(var d=0,f=0;f<a.length;++f){var r=a[f];d=d<r?r:d}return d}function j(a,d,f,r,l,m,y,I,H){var E=c.exports.sbrk,N=E(4),z=E(f*4),K=E(l*m),M=E(f*4),D=new Uint8Array(c.exports.memory.buffer);D.set(g(r),K),D.set(g(d),M);var B=a(z,M,f,K,l,m,y,I,H,N);D=new Uint8Array(c.exports.memory.buffer);var U=new Uint32Array(B);g(U).set(D.subarray(z,z+B*4));var C=new Float32Array(1);return g(C).set(D.subarray(N,N+4)),E(N-E(0)),[U,C[0]]}function A(a,d,f,r,l,m,y,I,H,E,N,z,K){var M=c.exports.sbrk,D=M(4),B=M(f*4),U=M(l*m),C=M(l*I),O=M(H.length*4),G=M(f*4),W=E?M(l):0,S=new Uint8Array(c.exports.memory.buffer);S.set(g(r),U),S.set(g(y),C),S.set(g(H),O),S.set(g(d),G),E&&S.set(g(E),W);var _=a(B,G,f,U,l,m,C,I,O,H.length,W,N,z,K,D);S=new Uint8Array(c.exports.memory.buffer);var V=new Uint32Array(_);g(V).set(S.subarray(B,B+_*4));var q=new Float32Array(1);return g(q).set(S.subarray(D,D+4)),M(D-M(0)),[V,q[0]]}function F(a,d,f,r,l,m,y,I,H,E,N,z,K){var M=c.exports.sbrk,D=M(4),B=M(l*m),U=M(l*I),C=M(H.length*4),O=M(f*4),G=E?M(l):0,W=new Uint8Array(c.exports.memory.buffer);W.set(g(r),B),W.set(g(y),U),W.set(g(H),C),W.set(g(d),O),E&&W.set(g(E),G);var S=a(O,f,B,l,m,U,I,C,H.length,G,N,z,K,D);W=new Uint8Array(c.exports.memory.buffer),g(d).set(W.subarray(O,O+S*4)),g(r).set(W.subarray(B,B+l*m)),g(y).set(W.subarray(U,U+l*I));var _=new Float32Array(1);return g(_).set(W.subarray(D,D+4)),M(D-M(0)),[S,_[0]]}function k(a,d,f,r){var l=c.exports.sbrk,m=l(f*r),y=new Uint8Array(c.exports.memory.buffer);y.set(g(d),m);var I=a(m,f,r);return l(m-l(0)),I}function s(a,d,f,r,l,m,y,I){var H=c.exports.sbrk,E=H(I*4),N=H(f*r),z=l?H(f*m):0,K=new Uint8Array(c.exports.memory.buffer);K.set(g(d),N),l&&K.set(g(l),z);var M=a(E,N,f,r,z,m,y,I);K=new Uint8Array(c.exports.memory.buffer);var D=new Uint32Array(M);return g(D).set(K.subarray(E,E+M*4)),H(E-H(0)),D}function h(a,d,f,r,l,m,y,I,H){var E=c.exports.sbrk,N=E(4),z=E(f*4),K=E(l*m),M=E(f*4),D=y?E(l):0,B=new Uint8Array(c.exports.memory.buffer);B.set(g(r),K),B.set(g(d),M),y&&B.set(g(y),D);var U=a(z,M,f,K,l,m,D,I,H,N);B=new Uint8Array(c.exports.memory.buffer);var C=new Uint32Array(U);g(C).set(B.subarray(z,z+U*4));var O=new Float32Array(1);return g(O).set(B.subarray(N,N+4)),E(N-E(0)),[C,O[0]]}function n(a,d,f,r,l,m,y){var I=c.exports.sbrk,H=I(f*4),E=I(l*m),N=I(f*4),z=new Uint8Array(c.exports.memory.buffer);z.set(g(r),E),z.set(g(d),N);var K=a(H,N,f,E,l,m,y);z=new Uint8Array(c.exports.memory.buffer);var M=new Uint32Array(K);return g(M).set(z.subarray(H,H+K*4)),I(H-I(0)),M}var t={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:o,supported:!0,compactMesh:function(a){b(a instanceof Uint32Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Int16Array),b(a.length%3==0);var d=a.BYTES_PER_ELEMENT==4?a:new Uint32Array(a),f=v(c.exports.meshopt_optimizeVertexFetchRemap,d,x(a)+1);if(a!==d)for(var r=0;r<d.length;++r)a[r]=d[r];return f},generatePositionRemap:function(a,d){return b(a instanceof Float32Array),b(a.length%d==0),b(d>=3),w(c.exports.meshopt_generatePositionRemap,a,a.length/d,d)},simplify:function(a,d,f,r,l,m){b(a instanceof Uint32Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Int16Array),b(a.length%3==0),b(d instanceof Float32Array),b(d.length%f==0),b(f>=3),b(r>=0&&r<=a.length),b(r%3==0),b(l>=0);for(var y=0,I=0;I<(m?m.length:0);++I)b(m[I]in t),y|=t[m[I]];var H=a.BYTES_PER_ELEMENT==4?a:new Uint32Array(a),E=j(c.exports.meshopt_simplify,H,a.length,d,d.length/f,f*4,r,l,y);return E[0]=a instanceof Uint32Array?E[0]:new a.constructor(E[0]),E},simplifyWithAttributes:function(a,d,f,r,l,m,y,I,H,E){b(a instanceof Uint32Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Int16Array),b(a.length%3==0),b(d instanceof Float32Array),b(d.length%f==0),b(f>=3),b(r instanceof Float32Array),b(r.length==l*(d.length/f)),b(l>=0),b(y==null||y instanceof Uint8Array),b(y==null||y.length==d.length/f),b(I>=0&&I<=a.length),b(I%3==0),b(H>=0),b(Array.isArray(m)),b(l>=m.length),b(m.length<=32);for(var N=0;N<m.length;++N)b(m[N]>=0);for(var z=0,N=0;N<(E?E.length:0);++N)b(E[N]in t),z|=t[E[N]];var K=a.BYTES_PER_ELEMENT==4?a:new Uint32Array(a),M=A(c.exports.meshopt_simplifyWithAttributes,K,a.length,d,d.length/f,f*4,r,l*4,new Float32Array(m),y,I,H,z);return M[0]=a instanceof Uint32Array?M[0]:new a.constructor(M[0]),M},simplifyWithUpdate:function(a,d,f,r,l,m,y,I,H,E){b(a instanceof Uint32Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Int16Array),b(a.length%3==0),b(d instanceof Float32Array),b(d.length%f==0),b(f>=3),b(r instanceof Float32Array),b(r.length==l*(d.length/f)),b(l>=0),b(y==null||y instanceof Uint8Array),b(y==null||y.length==d.length/f),b(I>=0&&I<=a.length),b(I%3==0),b(H>=0),b(Array.isArray(m)),b(l>=m.length),b(m.length<=32);for(var N=0;N<m.length;++N)b(m[N]>=0);for(var z=0,N=0;N<(E?E.length:0);++N)b(E[N]in t),z|=t[E[N]];var K=a.BYTES_PER_ELEMENT==4?a:new Uint32Array(a),M=F(c.exports.meshopt_simplifyWithUpdate,K,a.length,d,d.length/f,f*4,r,l*4,new Float32Array(m),y,I,H,z);if(a!==K)for(var N=0;N<M[0];++N)a[N]=K[N];return M},getScale:function(a,d){return b(a instanceof Float32Array),b(a.length%d==0),b(d>=3),k(c.exports.meshopt_simplifyScale,a,a.length/d,d*4)},simplifyPoints:function(a,d,f,r,l,m){return b(a instanceof Float32Array),b(a.length%d==0),b(d>=3),b(f>=0&&f<=a.length/d),r?(b(r instanceof Float32Array),b(r.length%l==0),b(l>=3),b(a.length/d==r.length/l),s(c.exports.meshopt_simplifyPoints,a,a.length/d,d*4,r,l*4,m||0,f)):s(c.exports.meshopt_simplifyPoints,a,a.length/d,d*4,void 0,0,0,f)},simplifySloppy:function(a,d,f,r,l,m){b(a instanceof Uint32Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Int16Array),b(a.length%3==0),b(d instanceof Float32Array),b(d.length%f==0),b(f>=3),b(r==null||r instanceof Uint8Array),b(r==null||r.length==d.length/f),b(l>=0&&l<=a.length),b(l%3==0),b(m>=0);var y=a.BYTES_PER_ELEMENT==4?a:new Uint32Array(a),I=h(c.exports.meshopt_simplifySloppy,y,a.length,d,d.length/f,f*4,r,l,m);return I[0]=a instanceof Uint32Array?I[0]:new a.constructor(I[0]),I},simplifyPrune:function(a,d,f,r){b(a instanceof Uint32Array||a instanceof Int32Array||a instanceof Uint16Array||a instanceof Int16Array),b(a.length%3==0),b(d instanceof Float32Array),b(d.length%f==0),b(f>=3),b(r>=0);var l=a.BYTES_PER_ELEMENT==4?a:new Uint32Array(a),m=n(c.exports.meshopt_simplifyPrune,l,a.length,d,d.length/f,f*4,r);return m=a instanceof Uint32Array?m:new a.constructor(m),m}}})();var Te=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaD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bdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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 c,o=WebAssembly.instantiate(u(e),{}).then(function(h){c=h.instance,c.exports.__wasm_call_ctors()});function u(h){for(var n=new Uint8Array(h.length),t=0;t<h.length;++t){var a=h.charCodeAt(t);n[t]=a>96?a-97:a>64?a-39:a+4}for(var d=0,t=0;t<h.length;++t)n[d++]=n[t]<60?i[n[t]]:(n[t]-60)*64+n[++t];return n.buffer.slice(0,d)}function b(h){if(!h)throw new Error("Assertion failed")}function g(h){return new Uint8Array(h.buffer,h.byteOffset,h.byteLength)}var w=48,v=16;function x(h,n){var t=h.meshlets[n*4+0],a=h.meshlets[n*4+1],d=h.meshlets[n*4+2],f=h.meshlets[n*4+3];return{vertices:h.vertices.subarray(t,t+d),triangles:h.triangles.subarray(a,a+f*3)}}function j(h,n,t,a,d,f,r,l,m,y){var I=c.exports.sbrk,H=c.exports.meshopt_buildMeshletsBound(n.length,f,r),E=I(H*v),N=I(n.length*4),z=I(n.length),K=I(n.byteLength),M=I(t.byteLength),D=new Uint8Array(c.exports.memory.buffer);D.set(g(n),K),D.set(g(t),M);var B=h(E,N,z,K,n.length,M,a,d,f,r,l,m,y);D=new Uint8Array(c.exports.memory.buffer);for(var U=D.subarray(E,E+B*v),C=new Uint32Array(U.buffer,U.byteOffset,U.byteLength/4).slice(),O=0;O<B;++O){var G=C[O*4+0],W=C[O*4+1],a=C[O*4+2],S=C[O*4+3];c.exports.meshopt_optimizeMeshlet(N+G*4,z+W,S,a)}var _=B?C[(B-1)*4+0]+C[(B-1)*4+2]:0,V=B?C[(B-1)*4+1]+C[(B-1)*4+3]*3:0,q={meshlets:C,vertices:new Uint32Array(D.buffer,N,_).slice(),triangles:new Uint8Array(D.buffer,z,V).slice(),meshletCount:B};return I(E-I(0)),q}function A(h){var n=new Float32Array(c.exports.memory.buffer,h,w/4);return{centerX:n[0],centerY:n[1],centerZ:n[2],radius:n[3],coneApexX:n[4],coneApexY:n[5],coneApexZ:n[6],coneAxisX:n[7],coneAxisY:n[8],coneAxisZ:n[9],coneCutoff:n[10]}}function F(h,n,t,a){var d=c.exports.sbrk,f=[],r=d(n.byteLength),l=d(h.vertices.byteLength),m=d(h.triangles.byteLength),y=d(w),I=new Uint8Array(c.exports.memory.buffer);I.set(g(n),r),I.set(g(h.vertices),l),I.set(g(h.triangles),m);for(var H=0;H<h.meshletCount;++H){var E=h.meshlets[H*4+0],N=h.meshlets[H*4+1],z=h.meshlets[H*4+3];c.exports.meshopt_computeMeshletBounds(y,l+E*4,m+N,z,r,t,a),f.push(A(y))}return d(r-d(0)),f}function k(h,n,t,a){var d=c.exports.sbrk,f=d(w),r=d(h.byteLength),l=d(n.byteLength),m=new Uint8Array(c.exports.memory.buffer);m.set(g(h),r),m.set(g(n),l),c.exports.meshopt_computeClusterBounds(f,r,h.length,l,t,a);var y=A(f);return d(f-d(0)),y}function s(h,n,t,a,d){var f=c.exports.sbrk,r=f(w),l=f(h.byteLength),m=a?f(a.byteLength):0,y=new Uint8Array(c.exports.memory.buffer);y.set(g(h),l),a&&y.set(g(a),m),c.exports.meshopt_computeSphereBounds(r,l,n,t,m,a?d:0);var I=A(r);return f(r-f(0)),I}return{ready:o,supported:!0,buildMeshlets:function(h,n,t,a,d,f){b(h.length%3==0),b(n instanceof Float32Array),b(n.length%t==0),b(t>=3),b(a>=3&&a<=256),b(d>=1&&d<=512),f=f||0;var r=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return j(c.exports.meshopt_buildMeshletsFlex,r,n,n.length/t,t*4,a,d,d,f,0)},buildMeshletsFlex:function(h,n,t,a,d,f,r,l){b(h.length%3==0),b(n instanceof Float32Array),b(n.length%t==0),b(t>=3),b(a>=3&&a<=256),b(d>=1&&f<=512),b(d<=f),r=r||0,l=l||0;var m=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return j(c.exports.meshopt_buildMeshletsFlex,m,n,n.length/t,t*4,a,d,f,r,l)},buildMeshletsSpatial:function(h,n,t,a,d,f,r){b(h.length%3==0),b(n instanceof Float32Array),b(n.length%t==0),b(t>=3),b(a>=3&&a<=256),b(d>=1&&f<=512),b(d<=f),r=r||0;var l=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return j(c.exports.meshopt_buildMeshletsSpatial,l,n,n.length/t,t*4,a,d,f,r)},extractMeshlet:function(h,n){return b(n>=0&&n<h.meshletCount),x(h,n)},computeClusterBounds:function(h,n,t){b(h.length%3==0),b(h.length/3<=512),b(n instanceof Float32Array),b(n.length%t==0),b(t>=3);var a=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return k(a,n,n.length/t,t*4)},computeMeshletBounds:function(h,n,t){return b(n instanceof Float32Array),b(n.length%t==0),b(t>=3),F(h,n,n.length/t,t*4)},computeSphereBounds:function(h,n,t,a){return b(h instanceof Float32Array),b(h.length%n==0),b(n>=3),b(!t||t instanceof Float32Array),b(!t||t.length%a==0),b(!t||a>=1),b(!t||h.length/n==t.length/a),a=a||0,s(h,h.length/n,n*4,t,a*4)}}})();var Ge=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcef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dGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",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 c,o=WebAssembly.instantiate(u(e),{}).then(function(x){c=x.instance,c.exports.__wasm_call_ctors()});function u(x){for(var j=new Uint8Array(x.length),A=0;A<x.length;++A){var F=x.charCodeAt(A);j[A]=F>96?F-97:F>64?F-39:F+4}for(var k=0,A=0;A<x.length;++A)j[k++]=j[A]<60?i[j[A]]:(j[A]-60)*64+j[++A];return j.buffer.slice(0,k)}function b(x){if(!x)throw new Error("Assertion failed")}function g(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function w(x,j,A,F,k,s,h,n,t,a){var d=c.exports.sbrk,f=d(j*16),r=x?d(x.byteLength):0,l=d(A.byteLength),m=d(s.byteLength),y=d(n.byteLength),I=new Uint8Array(c.exports.memory.buffer);x&&I.set(g(x),r),I.set(g(A),l),I.set(g(s),m),I.set(g(n),y),c.exports.meshopt_generateTangents(f,r,j,l,F,k*4,m,h*4,y,t*4,a),I=new Uint8Array(c.exports.memory.buffer);var H=new Float32Array(I.buffer,f,j*4).slice();return d(f-d(0)),H}var v={Compatible:1,ZeroFallback:2};return{ready:o,supported:!0,generateTangents:function(x,j,A,F,k,s,h,n){b(x===null||x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),b(x===null||x.length%3==0),b(j instanceof Float32Array),b(j.length%A==0),b(A>=3),b(F instanceof Float32Array),b(F.length%k==0),b(k>=3),b(s instanceof Float32Array),b(s.length%h==0),b(h>=2),b(j.length/A==F.length/k),b(j.length/A==s.length/h),b(x!==null||j.length/A%3==0);for(var t=0,a=0;a<(n?n.length:0);++a)b(n[a]in v),t|=v[n[a]];var d=j.length/A,f=x?x.length:d,r=x===null||x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x);return w(r,f,j,d,A,F,k,s,h,t)}}})();var ma={X:0,Y:1,Z:2};ma.Y_UP_TO_Z_UP=J.fromRotationTranslation(ya.fromArray([1,0,0,0,0,1,0,-1,0]));ma.Z_UP_TO_Y_UP=J.fromRotationTranslation(ya.fromArray([1,0,0,0,0,-1,0,1,0]));ma.X_UP_TO_Z_UP=J.fromRotationTranslation(ya.fromArray([0,0,1,0,1,0,-1,0,0]));ma.Z_UP_TO_X_UP=J.fromRotationTranslation(ya.fromArray([0,0,-1,0,1,0,1,0,0]));ma.X_UP_TO_Y_UP=J.fromRotationTranslation(ya.fromArray([0,1,0,-1,0,0,0,0,1]));ma.Y_UP_TO_X_UP=J.fromRotationTranslation(ya.fromArray([0,-1,0,1,0,0,0,0,1]));ma.fromName=function(e){return T.typeOf.string("name",e),ma[e]};Object.freeze(ma);var Kb=ma;var Ta={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Ta.getMorphTime=function(e){return e===Ta.SCENE3D?1:e===Ta.MORPHING?void 0:0};Object.freeze(Ta);var Ya=Ta;var Bb=$b(_b(),1);function ac(){return!0}function bc(e,i){i=i??"This object was destroyed, i.e., destroy() was called.";function c(){throw new Aa(i)}for(let o in e)typeof e[o]=="function"&&(e[o]=c);e.isDestroyed=ac}var Db=bc;function Rb(){if(!Z($._canTransferArrayBuffer)){let e=lb("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let i=99,c=new Int8Array([i]);try{e.postMessage({array:c},[c.buffer])}catch{return $._canTransferArrayBuffer=!1,$._canTransferArrayBuffer}$._canTransferArrayBuffer=new Promise(o=>{e.onmessage=function(u){let b=u.data.array,g=Z(b)&&b[0]===i;o(g),e.terminate(),$._canTransferArrayBuffer=g}})}return $._canTransferArrayBuffer}var mb=new Fb;function ob(e){let i;try{i=new Blob([e],{type:"application/javascript"})}catch{let u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,b=new u;b.append(e),i=b.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(i)}function lb(e){let i=new Bb.default(e),c=i.scheme().length!==0&&i.fragment().length===0,o=e.replace(/\.js$/,""),u={},b,g;if(hb(e))g=e;else if(!c){let w=Na(`${$._workerModulePrefix}/${o}.js`);hb(w)&&(g=w)}if(g){let w=`import "${g}";`;return b=ob(w),u.type="module",new Worker(b,u)}if(!c&&typeof CESIUM_WORKERS<"u"){let w=` + importScripts("${ob(CESIUM_WORKERS)}"); + CesiumWorkers["${o}"](); + `;return b=ob(w),new Worker(b,u)}if(b=e,c||(b=Na(`${$._workerModulePrefix+o}.js`)),!nb.supportsEsmWebWorkers())throw new Ba("This browser is not supported. Please update your browser to continue.");return u.type="module",new Worker(b,u)}async function cc(e,i){let c={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!nb.supportsWebAssembly()){if(!Z(i.fallbackModulePath))throw new Ba(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return c.modulePath=Na(i.fallbackModulePath),c}c.wasmBinaryFile=Na(i.wasmBinaryFile);let o=await Mb.fetchArrayBuffer({url:c.wasmBinaryFile});return c.wasmBinary=o,c}function $(e,i){this._workerPath=e,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var ec=(e,i,c,o)=>{let u=({data:b})=>{if(b.id===i){if(Z(b.error)){let g=b.error;g.name==="RuntimeError"?(g=new Ba(b.error.message),g.stack=b.error.stack):g.name==="DeveloperError"?(g=new Aa(b.error.message),g.stack=b.error.stack):g.name==="Error"&&(g=new Error(b.error.message),g.stack=b.error.stack),mb.raiseEvent(g),o(g)}else mb.raiseEvent(),c(b.result);e.removeEventListener("message",u)}};return u},dc=[];async function fc(e,i,c){let o=await Promise.resolve(Rb());Z(c)?o||(c.length=0):c=dc;let u=e._nextID++,b=new Promise((g,w)=>{e._worker.addEventListener("message",ec(e._worker,u,g,w))});return e._worker.postMessage({id:u,baseUrl:Na.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:o},c),b}async function hc(e,i,c){++e._activeTasks;try{let o=await fc(e,i,c);return--e._activeTasks,o}catch(o){throw--e._activeTasks,o}}$.prototype.scheduleTask=function(e,i){if(Z(this._worker)||(this._worker=lb(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return hc(this,e,i)};$.prototype.initWebAssemblyModule=async function(e){if(Z(this._webAssemblyPromise))return this._webAssemblyPromise;let i=async()=>{let c=this._worker=lb(this._workerPath),o=await cc(this,e),u=await Promise.resolve(Rb()),b,g=o.wasmBinary;Z(g)&&u&&(b=[g]);let w=new Promise((v,x)=>{c.onmessage=function({data:j}){Z(j)?v(j.result):x(new Ba("Could not configure wasm module"))}});return c.postMessage({canTransferArrayBuffer:u,parameters:{webAssemblyConfig:o}},b),w};return this._webAssemblyPromise=i(),this._webAssemblyPromise};$.prototype.isDestroyed=function(){return!1};$.prototype.destroy=function(){return Z(this._worker)&&this._worker.terminate(),Db(this)};$.taskCompletedEvent=mb;$._defaultWorkerModulePrefix="Workers/";$._workerModulePrefix=$._defaultWorkerModulePrefix;$._canTransferArrayBuffer=void 0;var Ob=$;var nc=3,kb=class{constructor(i,c,o){T.defined("vertices",i),T.defined("indices",c),T.defined("encoding",o),this._vertices=i,this._indices=c,this._encoding=o,this._inverseTransform=new J,this._needsRebuild=!0,this._rootNode=new jb}get needsRebuild(){return this._needsRebuild}set needsRebuild(i){this._needsRebuild=i}rayIntersect(i,c,o,u,b){this._needsRebuild&&gc(this,c);let g=this._inverseTransform,w=rc;w.origin=J.multiplyByPoint(g,i.origin,w.origin),w.direction=J.multiplyByPointAsVector(g,i.direction,w.direction);let v=[];return Jb(this._rootNode,w,v),sc(this,v,i,o,u,b)}},tc=new Ob("incrementallyBuildTerrainPicker"),jb=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=Cb(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(i){if(i<0||i>3)throw new Aa("TerrainPickerNode child index must be between 0 and 3, inclusive.");let c=new e;c.x=this.x*2+(i&1),c.y=this.y*2+(i>>1&1),c.level=this.level+1,c.aabb=Cb(c.x,c.y,c.level),this.children[i]=c}},rc=new gb,Qa=[new p,new p,new p];function gc(e,i){J.inverse(i,e._inverseTransform),e._needsRebuild=!1;let c=e._indices.length/3,o=new Uint32Array(c);for(let u=0;u<c;++u)o[u]=u;e._rootNode.intersectingTriangles=o,e._rootNode.children.length=0}var ic=new p,oc=new p;function Cb(e,i,c){let o=1/Math.pow(2,c),u=p.fromElements(e*o-.5,i*o-.5,-.5,ic),b=p.fromElements((e+1)*o-.5,(i+1)*o-.5,.5,oc);return Ca.fromCorners(u,b)}function mc(e,i,c,o,u){p.pack(c[0],e,9*u),p.pack(c[1],e,9*u+3),p.pack(c[2],e,9*u+6),i[u]=o}var lc=new db;function Jb(e,i,c){let o=ib.rayAxisAlignedBoundingBox(i,e.aabb,lc);if(!Z(o))return;if(!e.children.length||e.buildingChildren){c.push({node:e,interval:new db(o.start,o.stop)});return}for(let b=0;b<e.children.length;b++)Jb(e.children[b],i,c)}function sc(e,i,c,o,u,b){let g=i.sort(function(v,x){return v.interval.start-x.interval.start}),w=Number.MAX_VALUE;for(let v=0;v<g.length;v++){let x=g[v],j=kc(e,c,x.node,o,u,b);if(w=Math.min(j,w),w!==Number.MAX_VALUE)break}if(w!==Number.MAX_VALUE)return gb.getPoint(c,w)}function kc(e,i,c,o,u,b){let g=Number.MAX_VALUE,w=e._encoding,v=e._indices,x=e._vertices,j=c.intersectingTriangles.length,F=!(c.level>=nc)&&!c.buildingChildren,k,s;F&&(k=new Float64Array(j*9),s=new Uint32Array(j));for(let h=0;h<j;h++){let n=c.intersectingTriangles[h],t=sb(w,u,b,i,x,v[3*n],Qa[0]),a=sb(w,u,b,i,x,v[3*n+1],Qa[1]),d=sb(w,u,b,i,x,v[3*n+2],Qa[2]),f=ib.rayTriangleParametric(i,t,a,d,o);Z(f)&&f<g&&f>=0&&(g=f),F&&mc(k,s,Qa,n,h)}if(F){for(let h=0;h<4;h++)c.addChild(h);uc(e._inverseTransform,c,s,k)}return g}var jc=new Y;function sb(e,i,c,o,u,b,g){let w=e.getExaggeratedPosition(u,b,g);if(i===Ya.SCENE3D)return w;let x=c.ellipsoid.cartesianToCartographic(w,jc);w=c.project(x,g),w=p.fromElements(w.z,w.x,w.y,g);let j=L.TWO_PI*c.ellipsoid.maximumRadius,A=Math.round((o.origin.y-w.y)/j);return w.y+=A*j,w}async function uc(e,i,c,o){i.buildingChildren=!0;let u=new Float64Array(16);J.pack(e,u,0);let b=new Float64Array(24);for(let j=0;j<4;j++)p.pack(i.children[j].aabb.minimum,b,j*6),p.pack(i.children[j].aabb.maximum,b,j*6+3);let g={aabbs:b,inverseTransform:u,triangleIndices:c,trianglePositions:o},w=[b.buffer,u.buffer,c.buffer,o.buffer],v=tc.scheduleTask(g,w);if(!Z(v)){i.buildingChildren=!1;return}(await v).intersectingTrianglesArrays.forEach((j,A)=>{Z(i.children[A])&&(i.children[A].intersectingTriangles=new Uint32Array(j))}),i.intersectingTriangles=new Uint32Array(0),i.buildingChildren=!1}var Tb=kb;function Ua(e,i,c,o,u,b,g,w,v,x,j,A,F,k,s,h,n){this.center=e,this.vertices=i,this.stride=j??6,this.indices=c,this.indexCountWithoutSkirts=o,this.vertexCountWithoutSkirts=u,this.minimumHeight=b,this.maximumHeight=g,this.rectangle=w,this.boundingSphere3D=v,this.occludeePointInScaledSpace=x,this.orientedBoundingBox=A,this.encoding=F,this.westIndicesSouthToNorth=k,this.southIndicesEastToWest=s,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=n,this._transform=new J,this._lastPickSceneMode=void 0,this._terrainPicker=new Tb(i,c,F)}Ua.prototype.getTransform=function(e,i){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!Z(e)||e===Ya.SCENE3D?wc(this,this._transform):Ec(this,i,this._transform))};function wc(e,i){let c=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,u=Ja.getHeight(e.minimumHeight,c,o),b=Ja.getHeight(e.maximumHeight,c,o),g=ra.fromRectangle(e.rectangle,u,b,Ea.default,e.orientedBoundingBox);return ra.computeTransformation(g,i),J.getScale(i,ub).z<=L.EPSILON16&&(ub.z=1,J.setScale(i,ub,i)),i}var pc=new p,yc=new p,xc=new Y,Ic=new Y,vc=new p,Ac=new p,ub=new p;function Ec(e,i,c){let o=e.encoding.exaggeration,u=e.encoding.exaggerationRelativeHeight,b=Ja.getHeight(e.minimumHeight,o,u),g=Ja.getHeight(e.maximumHeight,o,u),w=i.project(Y.fromRadians(e.rectangle.west,e.rectangle.south,0,xc),pc),v=i.project(Y.fromRadians(e.rectangle.east,e.rectangle.north,0,Ic),yc),x=g-b,j=p.fromElements(v.x-w.x,v.y-w.y,x>0?x:1,vc),A=p.fromElements(w.x+j.x*.5,w.y+j.y*.5,b+j.z*.5,Ac);return J.fromTranslation(A,c),J.setScale(c,j,c),J.multiply(Oa.SWIZZLE_3D_TO_2D_MATRIX,c,c),c}Ua.prototype.pick=function(e,i,c,o){let u=this._terrainPicker.rayIntersect(e,this.getTransform(c,o),i,c,o);return this._lastPickSceneMode=c,u};Ua.prototype.updateExaggeration=function(e,i){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};Ua.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var wb=Ua;var pb={},Nc={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},Hc=new Y,Fc=new p,Mc=new J,zc=new J,Kc=new J,Dc=new p,Bc=new p,Rc=new p,Oc=new p,Cc=new Y,Jc=new R,Ga=new p,Tc=new R,Uc=new p,Gc=new p,Za=function(e,i){return e-i};pb.createMesh=async function(e){e=e??fb.EMPTY_OBJECT;let{exaggeration:i=1,exaggerationRelativeHeight:c=0,hasVertexNormals:o,hasWebMercatorT:u,gltf:b,minimumHeight:g,maximumHeight:w,skirtHeight:v}=e;T.typeOf.object("options.ellipsoid",e.ellipsoid),T.typeOf.object("options.rectangle",e.rectangle),T.typeOf.bool("options.hasVertexNormals",o),T.typeOf.bool("options.hasWebMercatorT",u),T.typeOf.object("options.gltf",b),T.typeOf.number("options.minimumHeight",g),T.typeOf.number("options.maximumHeight",w),T.typeOf.object("options.boundingSphere",e.boundingSphere),T.typeOf.object("options.orientedBoundingBox",e.orientedBoundingBox),T.typeOf.object("options.horizonOcclusionPoint",e.horizonOcclusionPoint),T.typeOf.number("options.skirtHeight",v);let j=i!==1,A=pa.clone(e.boundingSphere,new pa),F=ra.clone(e.orientedBoundingBox,new ra),k=p.clone(e.horizonOcclusionPoint,new p),s=Ea.clone(e.ellipsoid,new Ea),h=xa.clone(e.rectangle,new xa);await(b.extensionsRequired!==void 0&&b.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?Ma.ready:Promise.resolve(void 0));let a=h.west,d=h.south,f=h.north,r=h.width,l=h.height,m=xa.center(h,Hc);m.height=.5*(g+w);let y=Y.toCartesian(m,s,Fc),I=Oa.eastNorthUpToFixedFrame(y,s,Mc),H=J.inverseTransformation(I,zc),E=J.unpack(b.nodes[0].matrix,0,Kc);E=J.multiply(Kb.Y_UP_TO_Z_UP,E,E);let N=pe(b,o,Nc),z=Fa.getSkirtVertexCount(N.edgeIndicesWest,N.edgeIndicesSouth,N.edgeIndicesEast,N.edgeIndicesNorth),K=N.positions,M=N.normals,D=N.indices,B=K.length/3,U=B+z,C=D.length,O=Fa.getSkirtIndexCountWithFilledCorners(z),G=U<=65535?Uint16Array:Uint32Array,W=new G(C+O);W.set(D);let S=new G(N.edgeIndicesWest),_=new G(N.edgeIndicesSouth),V=new G(N.edgeIndicesEast),q=new G(N.edgeIndicesNorth),P=new G(S).sort(),aa=new G(_).sort(),X=new G(V).sort(),fa=new G(q).sort(),ba=Ia.geodeticLatitudeToMercatorAngle(d),ga=1/(Ia.geodeticLatitudeToMercatorAngle(f)-ba),ia=p.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Dc),ha=p.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Bc),la=new Ha(A.center,void 0,void 0,void 0,void 0,o,u,j,i,c),oa=la.stride,ca=new Float32Array(U*oa),ea=0;for(let Q=0;Q<B;Q++){let va=p.unpack(K,Q*3,Rc),sa=J.multiplyByPoint(E,va,Oc),Pa=Y.fromCartesian(sa,s,Cc),{longitude:_a,latitude:za,height:ka}=Pa,ja=(_a-a)/r,ua=(za-d)/l;ja=L.clamp(ja,0,1),ua=L.clamp(ua,0,1),Ra(P,Q,Za)>=0?ja=0:Ra(X,Q,Za)>=0&&(ja=1),Ra(aa,Q,Za)>=0?ua=0:Ra(fa,Q,Za)>=0&&(ua=1);let qa=R.fromElements(ja,ua,Jc),Ka;if(o){let na=p.unpack(M,Q*3,Ga);na=J.multiplyByPointAsVector(E,na,Ga),na=p.normalize(na,Ga),Ka=rb.octEncode(na,Tc)}let wa;u&&(wa=(Ia.geodeticLatitudeToMercatorAngle(za)-ba)*ga);let Wa;j&&(Wa=s.geodeticSurfaceNormal(sa,Uc)),ea=la.encode(ca,ea,sa,qa,ka,Ka,wa,Wa);let Sa=J.multiplyByPoint(H,sa,Gc);ia=p.minimumByComponent(Sa,ia,ia),ha=p.maximumByComponent(Sa,ha,ha)}let da=new wb(p.clone(la.center,new p),ca,W,C,B,g,w,h,pa.clone(A,new pa),p.clone(k,new p),oa,ra.clone(F,new ra),la,S,_,V,q);return Xb(da,h,s,ia,ha,I,H,v),Promise.resolve(da)};var Pc=new R,qc=new R,Wc=new Array(6),Sc=new R,Xc=new R,Vc=new R,Lc=new p,Yc=new p,Qc=new p,Zc=new Y,$c=new p,_c=new Y,ae=new Y,Ub=new p,be=new p,ce=new p,ee=new p,de=new p,fe=new p,he=new p,ne=new p,te=new J,re=new J,Gb=new R,ge=new R,ie=new p,oe=new pa,me=new ra,le=new Ca,Pb=new p,qb=new R,se=new R,Wb=new p,ke=new p;function je(e){let i=e.meshes[0].primitives[0],c=e.accessors[i.attributes.POSITION],o=e.bufferViews[c.bufferView],u=c.count,b=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(b===void 0){let k=e.buffers[o.buffer].extras._pipeline.source;return new Float32Array(k.buffer,k.byteOffset+(o.byteOffset??0)+(c.byteOffset??0),u*3)}let g=e.buffers[b.buffer].extras._pipeline.source,w=new Uint8Array(g.buffer,g.byteOffset+(b.byteOffset??0)+(c.byteOffset??0),b.byteLength),v=b.byteStride,x=v===4?Uint8Array:Uint16Array,j=new x(u*4);Ma.decodeVertexBuffer(new Uint8Array(j.buffer),u,v,w);let A=(1<<j.BYTES_PER_ELEMENT*8)-1,F=new Float32Array(u*3);for(let k=0;k<u;k++)F[k*3+0]=j[k*4+0]/A,F[k*3+1]=j[k*4+1]/A,F[k*3+2]=j[k*4+2]/A;return F}function ue(e){let i=e.meshes[0].primitives[0],c=e.accessors[i.attributes.NORMAL],o=e.bufferViews[c.bufferView],u=c.count,b=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(b===void 0){let A=e.buffers[o.buffer].extras._pipeline.source;return new Float32Array(A.buffer,A.byteOffset+(o.byteOffset??0)+(c.byteOffset??0),u*3)}let g=e.buffers[b.buffer].extras._pipeline.source,w=new Uint8Array(g.buffer,g.byteOffset+(b.byteOffset??0)+(c.byteOffset??0),b.byteLength),v=b.byteStride,x=new Int8Array(u*v);Ma.decodeVertexBuffer(new Uint8Array(x.buffer),u,v,w);let j=new Float32Array(u*3);for(let A=0;A<u;A++){let F=Math.max(x[A*4+0]/127,-1),k=Math.max(x[A*4+1]/127,-1),s=1-(Math.abs(F)+Math.abs(k));if(s<0){let n=F,t=k;F=(1-Math.abs(t))*L.signNotZero(n),k=(1-Math.abs(n))*L.signNotZero(t)}let h=Ga;h.x=F,h.y=k,h.z=s,h=p.normalize(h,Ga),j[A*3+0]=h.x,j[A*3+1]=h.y,j[A*3+2]=h.z}return j}function we(e){let i=e.meshes[0].primitives[0],c=e.accessors[i.indices],o=e.bufferViews[c.bufferView],u=c.count,b=c.componentType===tb.UNSIGNED_SHORT?Uint16Array:Uint32Array,g=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(g===void 0){let j=e.buffers[o.buffer].extras._pipeline.source;return new b(j.buffer,j.byteOffset+(o.byteOffset??0)+(c.byteOffset??0),u)}let w=e.buffers[g.buffer].extras._pipeline.source,v=new Uint8Array(w.buffer,w.byteOffset+(g.byteOffset??0)+(c.byteOffset??0),g.byteLength),x=new b(u);return Ma.decodeIndexBuffer(new Uint8Array(x.buffer),u,g.byteStride,v),x}function $a(e,i){let c=e.meshes[0].primitives[0],o=e.accessors[c.extensions.CESIUM_tile_edges[i]],u=e.bufferViews[o.bufferView],b=o.count,g=o.componentType===tb.UNSIGNED_SHORT?Uint16Array:Uint32Array,w=u.extensions?u.extensions.EXT_meshopt_compression:void 0;if(w===void 0){let F=e.buffers[u.buffer].extras._pipeline.source;return new g(F.buffer,F.byteOffset+(u.byteOffset??0)+(o.byteOffset??0),b)}let v=e.buffers[w.buffer].extras._pipeline.source,x=new Uint8Array(v.buffer,v.byteOffset+(w.byteOffset??0)+(o.byteOffset??0),w.byteLength),j=new g(b),A=w.byteStride;return Ma.decodeIndexSequence(new Uint8Array(j.buffer),b,A,x),j}function pe(e,i,c){return c.positions=je(e),c.normals=i?ue(e):void 0,c.indices=we(e),c.edgeIndicesWest=$a(e,"left"),c.edgeIndicesSouth=$a(e,"bottom"),c.edgeIndicesEast=$a(e,"right"),c.edgeIndicesNorth=$a(e,"top"),c}pb.upsampleMesh=function(e){e=e??fb.EMPTY_OBJECT;let{isEastChild:i,isNorthChild:c,parentMinimumHeight:o,parentMaximumHeight:u,skirtHeight:b}=e;T.typeOf.bool("options.isEastChild",i),T.typeOf.bool("options.isNorthChild",c),T.typeOf.object("options.parentVertices",e.parentVertices),T.typeOf.object("options.parentIndices",e.parentIndices),T.typeOf.number("options.parentVertexCountWithoutSkirts",e.parentVertexCountWithoutSkirts),T.typeOf.number("options.parentIndexCountWithoutSkirts",e.parentIndexCountWithoutSkirts),T.typeOf.number("options.parentMinimumHeight",o),T.typeOf.number("options.parentMaximumHeight",u),T.typeOf.object("options.parentEncoding",e.parentEncoding),T.typeOf.object("options.rectangle",e.rectangle),T.typeOf.number("options.skirtHeight",b),T.typeOf.object("options.ellipsoid",e.ellipsoid);let g=e.parentIndexCountWithoutSkirts,w=e.parentIndices,v=e.parentVertexCountWithoutSkirts,x=e.parentVertices,j=Ha.clone(e.parentEncoding,new Ha),A=j.hasVertexNormals,F=j.hasWebMercatorT,k=j.exaggeration,s=j.exaggerationRelativeHeight,n=k!==1,t=xa.clone(e.rectangle,new xa),a=Ea.clone(e.ellipsoid),d=[],f=[],r=[],l=[],m=[],y=[],I=[],H=[];De(i,c,g,w,v,x,j,l,m,y,I,H,d,r,f);let E=xa.center(t,Zc);E.height=.5*(o+u);let N=Y.toCartesian(E,a,$c),z=d.length,K=new Ha(N,void 0,void 0,void 0,void 0,A,F,n,k,s),M=K.stride,D=Fa.getSkirtVertexCount(m,y,I,H),B=z+D,U=l.length,C=Fa.getSkirtIndexCountWithFilledCorners(D),O=U+C,G=B<=65535?Uint16Array:Uint32Array,W=new G(O);W.set(l);let S=new G(m),_=new G(y),V=new G(I),q=new G(H),P=new Float32Array(B*M),aa=0,X=Oa.eastNorthUpToFixedFrame(N,a,te),fa=J.inverseTransformation(X,re),ba=t.west,ta=t.east,ga=t.south,ia=t.north,ha=Ia.geodeticLatitudeToMercatorAngle(ga),oa=1/(Ia.geodeticLatitudeToMercatorAngle(ia)-ha),ca=Number.POSITIVE_INFINITY,ea=Number.NEGATIVE_INFINITY,da=p.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,he),Q=p.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,ne);for(let ka=0;ka<z;ka++){let ja=d[ka],ua=w[ja*3+0],qa=w[ja*3+1],Ka=w[ja*3+2],wa=ge;wa.x=f[ka*2+0],wa.y=f[ka*2+1];let Wa=wa.x,Sa=wa.y,na=r[ka*2+0],Da=r[ka*2+1],Xa=1-na-Da,Vb=j.decodeHeight(x,ua),Lb=j.decodeHeight(x,qa),Yb=j.decodeHeight(x,Ka),Va=Vb*na+Lb*Da+Yb*Xa;ca=Math.min(Va,ca),ea=Math.max(Va,ea);let Qb=L.lerp(ba,ta,Wa),vb=L.lerp(ga,ia,Sa),Zb=Y.fromRadians(Qb,vb,Va,ae),ab=Y.toCartesian(Zb,a,be),Ab=J.multiplyByPoint(fa,ab,ee);da=p.minimumByComponent(Ab,da,da),Q=p.maximumByComponent(Ab,Q,Q);let Eb;if(A){let La=j.decodeNormal(x,ua,Lc),bb=j.decodeNormal(x,qa,Yc),cb=j.decodeNormal(x,Ka,Qc),eb=p.fromElements(La.x*na+bb.x*Da+cb.x*Xa,La.y*na+bb.y*Da+cb.y*Xa,La.z*na+bb.z*Da+cb.z*Xa,Pb);eb=p.normalize(eb,Pb),Eb=rb.octEncode(eb,se)}let Nb;F&&(Nb=(Ia.geodeticLatitudeToMercatorAngle(vb)-ha)*oa);let Hb;n&&(Hb=a.geodeticSurfaceNormal(ab,ke)),aa=K.encode(P,aa,ab,wa,Va,Eb,Nb,Hb)}let va=ra.fromRectangle(t,ca,ea,a,me),sa=pa.fromVertices(P,K.center,M,oe),_a=new zb(a).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(K.center,P,M,K.center,ca,ie),za=new wb(p.clone(K.center,new p),P,W,U,z,ca,ea,t,pa.clone(sa),p.clone(_a),M,ra.clone(va),K,S,_,V,q);return Xb(za,t,a,da,Q,X,fa,b),za};function Xb(e,i,c,o,u,b,g,w){let{encoding:v}=e,x=v.stride,j=e.vertices,{hasVertexNormals:A,hasWebMercatorT:F,exaggeration:k,exaggerationRelativeHeight:s}=v,n=k!==1,t=e.vertexCountWithoutSkirts,a=t*x,d=j.length/x,f=d-t,r=e.indices,l=e.indexCountWithoutSkirts,m=e.westIndicesSouthToNorth,y=e.southIndicesEastToWest,I=e.eastIndicesNorthToSouth,H=e.northIndicesWestToEast;Fa.addSkirtIndicesWithFilledCorners(m,y,I,H,t,r,l);let E=0,N=E+m.length,z=N+y.length,K=z+I.length,M=[m,y,I,H],D=[E,N,z,K],B=[-1,0,1,0],U=[0,-1,0,1],C=p.clone(o,de),O=p.clone(u,fe),G=e.maximumHeight,W=e.minimumHeight-w;for(let V=0;V<f;V++){let q;for(q=0;q<3&&!(V<D[q+1]);q++);let P=M[q][V-D[q]],aa=v.decodeTextureCoordinates(j,P,Gb),X=1e-4,fa=aa.x+B[q]*X,ba=aa.y+U[q]*X,ta=L.lerp(i.west,i.east,fa),ga=L.clamp(L.lerp(i.south,i.north,ba),-L.PI_OVER_TWO,+L.PI_OVER_TWO),ha=v.decodeHeight(j,P)-w,la=Y.fromRadians(ta,ga,ha,_c),oa=Y.toCartesian(la,c,Ub),ca;A&&(ca=v.getOctEncodedNormal(j,P,qb));let ea;F&&(ea=v.decodeWebMercatorT(j,P));let da;n&&(da=c.geodeticSurfaceNormal(oa,Wb)),a=v.encode(j,a,oa,aa,ha,ca,ea,da);let Q=J.multiplyByPoint(g,oa,ce);p.minimumByComponent(Q,C,C),p.maximumByComponent(Q,O,O)}let S=Ca.fromCorners(C,O,le),_=new Ha(v.center,S,W,G,b,v.hasVertexNormals,v.hasWebMercatorT,n,k,s);if(v.quantization!==_.quantization){let V=_,q=V.stride,P=new Float32Array(d*q),aa=0;for(let X=0;X<d;X++)aa=V.encode(P,aa,v.decodePosition(j,X,Ub),v.decodeTextureCoordinates(j,X,Gb),v.decodeHeight(j,X),v.hasVertexNormals?v.getOctEncodedNormal(j,X,qb):void 0,v.hasWebMercatorT?v.decodeWebMercatorT(j,X):void 0,v.hasGeodeticSurfaceNormals?v.decodeGeodeticSurfaceNormal(j,X,Wb):void 0);e.vertices=P,e.stride=q,e.encoding=V}return e}var yb=0,ye=1,xb=2,Ib=3,xe=4,Ie=new p,ve=[new p,new p,new p,new p,new p,new p],Ae=[new R,new R,new R,new R,new R,new R],Ee=[new p,new p,new p,new p,new p,new p],Ne=[new R,new R,new R,new R,new R,new R];function Sb(e,i,c,o){switch(c){case yb:return L.sign(o.x-e.x);case xb:return L.sign(i.x-o.x);case Ib:return L.sign(o.y-e.y);default:return L.sign(i.y-o.y)}}function He(e,i,c,o,u,b){let g,w,v;switch(c){case yb:g=(e.x-o.x)/(u.x-o.x),w=e.x,v=o.y+(u.y-o.y)*g;break;case xb:g=(i.x-o.x)/(u.x-o.x),w=i.x,v=o.y+(u.y-o.y)*g;break;case Ib:g=(e.y-o.y)/(u.y-o.y),w=o.x+(u.x-o.x)*g,v=e.y;break;default:g=(i.y-o.y)/(u.y-o.y),w=o.x+(u.x-o.x)*g,v=i.y;break}return p.fromElements(w,v,g,b)}var Fe={length:0,coordinates:[new R,new R,new R,new R,new R,new R],barycentricCoordinates:[new p,new p,new p,new p,new p,new p]};function Me(e,i,c,o,u,b,g,w){let v,x=Ae,j=ve,A=3,F=Ne;R.clone(u,F[0]),R.clone(b,F[1]),R.clone(g,F[2]);let k=Ee;p.fromElements(1,0,0,k[0]),p.fromElements(0,1,0,k[1]),p.fromElements(0,0,1,k[2]);for(let s=0;s<i;s++){let h=(e+s)%xe,n=x,t=j;x=F,j=k,v=A,F=n,k=t,A=0;let a=v-1,d=x[a],f=j[a],r=Sb(c,o,h,d);for(let l=0;l<v;l++){let m=x[l],y=j[l],I=Sb(c,o,h,m);if(r*I===-1){let H=He(c,o,h,d,m,Ie),{x:E,y:N,z}=H,K=1-z,M=f.x*K+y.x*z,D=f.y*K+y.y*z,B=f.z*K+y.z*z;R.fromElements(E,N,F[A]),p.fromElements(M,D,B,k[A]),A++}I>=0&&(R.clone(m,F[A]),p.clone(y,k[A]),A++),d=m,f=y,r=I}if(A===0)break}w.length=A;for(let s=0;s<A;s++)R.clone(F[s],w.coordinates[s]),p.clone(k[s],w.barycentricCoordinates[s]);return w}function ze(e,i,c,o,u,b,g,w){return Me(e?i?Ib:yb:i?xb:ye,2,c,o,u,b,g,w)}var Ke=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function De(e,i,c,o,u,b,g,w,v,x,j,A,F,k,s){let h={},n=e?.5:0,t=e?1:.5,a=i?.5:0,d=i?1:.5,f=Pc;f.x=n,f.y=a;let r=qc;r.x=t,r.y=d;let l=0;for(let m=0;m<c;m+=3){let y=o[m+0],I=o[m+1],H=o[m+2],E=g.decodeTextureCoordinates(b,y,Sc),N=g.decodeTextureCoordinates(b,I,Xc),z=g.decodeTextureCoordinates(b,H,Vc),K=ze(e,i,f,r,E,N,z,Fe),M=K.length;if(M<3)continue;let D=Wc;for(let O=0;O<M;O++){let G=K.barycentricCoordinates[O],W=G.x,S=G.y,_=G.z,V=Math.ceil(W)|Math.ceil(S)<<1|Math.ceil(_)<<2,q=Ke[V],P,aa=!1;if(q.length===1){let X=q[0],ba=o[m+X];P=h[ba],P===void 0&&(aa=!0,P=l++,h[ba]=P)}else if(q.length===2){let X=q[0],fa=q[1],ba=o[m+X],ta=o[m+fa],ga=K.barycentricCoordinates[(O+M-1)%M],ia=Math.ceil(ga.x)|Math.ceil(ga.y)<<1|Math.ceil(ga.z)<<2,ha=V===ia,la=Math.min(ba,ta),oa=Math.max(ba,ta),ca=u+2*(la*u+oa),ea=ca+0,da=ca+1,Q=h[ea],va=h[da],sa=!ha==(Q===void 0||va===void 0);if(P=sa?Q:va,P===void 0){aa=!0,P=l++;let Pa=sa?ea:da;h[Pa]=P}}else aa=!0,P=l++;if(D[O]=P,aa){let X=m/3;F.push(X);let fa=K.coordinates[O],ba=(fa.x-n)/(t-n),ta=(fa.y-a)/(d-a);s.push(ba,ta),k.push(W,S),ba===0?v.push(P):ba===1&&j.push(P),ta===0?x.push(P):ta===1&&A.push(P)}}let B=D[0],U=D[1],C=D[2];w.push(B,U,C);for(let O=3;O<M;O++)U=C,C=D[O],w.push(B,U,C)}v.sort(function(m,y){return s[m*2+1]-s[y*2+1]}),x.sort(function(m,y){return s[y*2+0]-s[m*2+0]}),j.sort(function(m,y){return s[y*2+1]-s[m*2+1]}),A.sort(function(m,y){return s[m*2+0]-s[y*2+0]})}var nf=pb;export{nf as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-3BGP4HCL.js b/plugins/feature/map/Cesium/Workers/chunk-3BGP4HCL.js deleted file mode 100644 index dd750629e..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-3BGP4HCL.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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 i=Object.create;var u=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var a=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,d)=>(typeof require<"u"?require:e)[d]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')}),b=n=>e=>{var d=n[e];if(d)return d();throw new Error("Module not found in bundle: "+e)};var g=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var p=(n,e,d,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of l(e))!c.call(n,f)&&f!==d&&u(n,f,{get:()=>e[f],enumerable:!(t=r(e,f))||t.enumerable});return n};var h=(n,e,d)=>(d=n!=null?i(o(n)):{},p(e||!n||!n.__esModule?u(d,"default",{value:n,enumerable:!0}):d,n));function x(n){return n!=null}var k=x;export{a,b,g as c,h as d,k as e}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-3PT5NNSP.js b/plugins/feature/map/Cesium/Workers/chunk-3PT5NNSP.js deleted file mode 100644 index b1dc5d08e..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-3PT5NNSP.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as g,b as Me,c as be,d as Ie,e as B,f as _e,g as un}from"./chunk-FGKVHLJ4.js";import{a as R}from"./chunk-YRCAQUFT.js";import{a as Se}from"./chunk-SP23RJSN.js";import{a as A,b as s}from"./chunk-ELJAHN3H.js";import{a as Sn,c as Rn,d as Ze,e as p}from"./chunk-3BGP4HCL.js";var Pt=Rn((en,nn)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var n=typeof en=="object"&&en&&!en.nodeType&&en,t=typeof nn=="object"&&nn&&!nn.nodeType&&nn,o=typeof global=="object"&&global;(o.global===o||o.window===o||o.self===o)&&(e=o);var i,r=2147483647,a=36,u=1,d=26,m=38,l=700,w=72,E=128,T="-",M=/^xn--/,v=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,N={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=a-u,k=Math.floor,x=String.fromCharCode,Q;function W(b){throw new RangeError(N[b])}function K(b,z){for(var D=b.length,Y=[];D--;)Y[D]=z(b[D]);return Y}function oe(b,z){var D=b.split("@"),Y="";D.length>1&&(Y=D[0]+"@",b=D[1]),b=b.replace(I,".");var re=b.split("."),se=K(re,z).join(".");return Y+se}function X(b){for(var z=[],D=0,Y=b.length,re,se;D<Y;)re=b.charCodeAt(D++),re>=55296&&re<=56319&&D<Y?(se=b.charCodeAt(D++),(se&64512)==56320?z.push(((re&1023)<<10)+(se&1023)+65536):(z.push(re),D--)):z.push(re);return z}function te(b){return K(b,function(z){var D="";return z>65535&&(z-=65536,D+=x(z>>>10&1023|55296),z=56320|z&1023),D+=x(z),D}).join("")}function Z(b){return b-48<10?b-22:b-65<26?b-65:b-97<26?b-97:a}function c(b,z){return b+22+75*(b<26)-((z!=0)<<5)}function f(b,z,D){var Y=0;for(b=D?k(b/l):b>>1,b+=k(b/z);b>F*d>>1;Y+=a)b=k(b/F);return k(Y+(F+1)*b/(b+m))}function h(b){var z=[],D=b.length,Y,re=0,se=E,ee=w,fe,he,me,de,pe,V,ge,Te,je;for(fe=b.lastIndexOf(T),fe<0&&(fe=0),he=0;he<fe;++he)b.charCodeAt(he)>=128&&W("not-basic"),z.push(b.charCodeAt(he));for(me=fe>0?fe+1:0;me<D;){for(de=re,pe=1,V=a;me>=D&&W("invalid-input"),ge=Z(b.charCodeAt(me++)),(ge>=a||ge>k((r-re)/pe))&&W("overflow"),re+=ge*pe,Te=V<=ee?u:V>=ee+d?d:V-ee,!(ge<Te);V+=a)je=a-Te,pe>k(r/je)&&W("overflow"),pe*=je;Y=z.length+1,ee=f(re-de,Y,de==0),k(re/Y)>r-se&&W("overflow"),se+=k(re/Y),re%=Y,z.splice(re++,0,se)}return te(z)}function y(b){var z,D,Y,re,se,ee,fe,he,me,de,pe,V=[],ge,Te,je,fn;for(b=X(b),ge=b.length,z=E,D=0,se=w,ee=0;ee<ge;++ee)pe=b[ee],pe<128&&V.push(x(pe));for(Y=re=V.length,re&&V.push(T);Y<ge;){for(fe=r,ee=0;ee<ge;++ee)pe=b[ee],pe>=z&&pe<fe&&(fe=pe);for(Te=Y+1,fe-z>k((r-D)/Te)&&W("overflow"),D+=(fe-z)*Te,z=fe,ee=0;ee<ge;++ee)if(pe=b[ee],pe<z&&++D>r&&W("overflow"),pe==z){for(he=D,me=a;de=me<=se?u:me>=se+d?d:me-se,!(he<de);me+=a)fn=he-de,je=a-de,V.push(x(c(de+fn%je,0))),he=k(fn/je);V.push(x(c(he,0))),se=f(D,Te,Y==re),D=0,++Y}++D,++z}return V.join("")}function O(b){return oe(b,function(z){return M.test(z)?h(z.slice(4).toLowerCase()):z})}function C(b){return oe(b,function(z){return v.test(z)?"xn--"+y(z):z})}if(i={version:"1.3.2",ucs2:{decode:X,encode:te},decode:h,encode:y,toASCII:C,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return i});else if(n&&t)if(nn.exports==n)t.exports=i;else for(Q in i)i.hasOwnProperty(Q)&&(n[Q]=i[Q]);else e.punycode=i})(en)});var zt=Rn((Ut,Mn)=>{/*! - * 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,n){"use strict";typeof Mn=="object"&&Mn.exports?Mn.exports=n():typeof define=="function"&&define.amd?define(n):e.IPv6=n(e)})(Ut,function(e){"use strict";var n=e&&e.IPv6;function t(i){var r=i.toLowerCase(),a=r.split(":"),u=a.length,d=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[u-1]===""&&a[u-2]===""&&a.pop(),u=a.length,a[u-1].indexOf(".")!==-1&&(d=7);var m;for(m=0;m<u&&a[m]!=="";m++);if(m<d)for(a.splice(m,1,"0000");a.length<d;)a.splice(m,0,"0000");for(var l,w=0;w<d;w++){l=a[w].split("");for(var E=0;E<3&&(l[0]==="0"&&l.length>1);E++)l.splice(0,1);a[w]=l.join("")}var T=-1,M=0,v=0,I=-1,N=!1;for(w=0;w<d;w++)N?a[w]==="0"?v+=1:(N=!1,v>M&&(T=I,M=v)):a[w]==="0"&&(N=!0,I=w,v=1);v>M&&(T=I,M=v),M>1&&a.splice(T,M,""),u=a.length;var F="";for(a[0]===""&&(F=":"),w=0;w<u&&(F+=a[w],w!==u-1);w++)F+=":";return a[u-1]===""&&(F+=":"),F}function o(){return e.IPv6===this&&(e.IPv6=n),this}return{best:t,noConflict:o}})});var qt=Rn((It,Pn)=>{/*! - * 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,n){"use strict";typeof Pn=="object"&&Pn.exports?Pn.exports=n():typeof define=="function"&&define.amd?define(n):e.SecondLevelDomains=n(e)})(It,function(e){"use strict";var n=e&&e.SecondLevelDomains,t={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(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return!1;var a=t.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(r+1,i)+" ")>=0:!1},is:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return!1;var r=o.lastIndexOf(".",i-1);if(r>=0)return!1;var a=t.list[o.slice(i+1)];return a?a.indexOf(" "+o.slice(0,i)+" ")>=0:!1},get:function(o){var i=o.lastIndexOf(".");if(i<=0||i>=o.length-1)return null;var r=o.lastIndexOf(".",i-1);if(r<=0||r>=i-1)return null;var a=t.list[o.slice(i+1)];return!a||a.indexOf(" "+o.slice(r+1,i)+" ")<0?null:o.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=n),this}};return t})});var Qe=Rn((Dt,Un)=>{/*! - * 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,n){"use strict";typeof Un=="object"&&Un.exports?Un.exports=n(Pt(),zt(),qt()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],n):e.URI=n(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Dt,function(e,n,t,o){"use strict";var i=o&&o.URI;function r(c,f){var h=arguments.length>=1,y=arguments.length>=2;if(!(this instanceof r))return h?y?new r(c,f):new r(c):new r;if(c===void 0){if(h)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?c=location.href+"":c=""}if(c===null&&h)throw new TypeError("null is not a valid argument for URI");return this.href(c),f!==void 0?this.absoluteTo(f):this}function a(c){return/^[0-9]+$/.test(c)}r.version="1.19.11";var u=r.prototype,d=Object.prototype.hasOwnProperty;function m(c){return c.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(c){return c===void 0?"Undefined":String(Object.prototype.toString.call(c)).slice(8,-1)}function w(c){return l(c)==="Array"}function E(c,f){var h={},y,O;if(l(f)==="RegExp")h=null;else if(w(f))for(y=0,O=f.length;y<O;y++)h[f[y]]=!0;else h[f]=!0;for(y=0,O=c.length;y<O;y++){var C=h&&h[c[y]]!==void 0||!h&&f.test(c[y]);C&&(c.splice(y,1),O--,y--)}return c}function T(c,f){var h,y;if(w(f)){for(h=0,y=f.length;h<y;h++)if(!T(c,f[h]))return!1;return!0}var O=l(f);for(h=0,y=c.length;h<y;h++)if(O==="RegExp"){if(typeof c[h]=="string"&&c[h].match(f))return!0}else if(c[h]===f)return!0;return!1}function M(c,f){if(!w(c)||!w(f)||c.length!==f.length)return!1;c.sort(),f.sort();for(var h=0,y=c.length;h<y;h++)if(c[h]!==f[h])return!1;return!0}function v(c){var f=/^\/+|\/+$/g;return c.replace(f,"")}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(c){if(!(!c||!c.nodeName)){var f=c.nodeName.toLowerCase();if(!(f==="input"&&c.type!=="image"))return r.domAttributes[f]}};function I(c){return escape(c)}function N(c){return encodeURIComponent(c).replace(/[!'()*]/g,I).replace(/\*/g,"%2A")}r.encode=N,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=N,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(c,f){var h=r.encode(c+"");return f===void 0&&(f=r.escapeQuerySpace),f?h.replace(/%20/g,"+"):h},r.decodeQuery=function(c,f){c+="",f===void 0&&(f=r.escapeQuerySpace);try{return r.decode(f?c.replace(/\+/g,"%20"):c)}catch{return c}};var F={encode:"encode",decode:"decode"},k,x=function(c,f){return function(h){try{return r[f](h+"").replace(r.characters[c][f].expression,function(y){return r.characters[c][f].map[y]})}catch{return h}}};for(k in F)r[k+"PathSegment"]=x("pathname",F[k]),r[k+"UrnPathSegment"]=x("urnpath",F[k]);var Q=function(c,f,h){return function(y){var O;h?O=function(D){return r[f](r[h](D))}:O=r[f];for(var C=(y+"").split(c),b=0,z=C.length;b<z;b++)C[b]=O(C[b]);return C.join(c)}};r.decodePath=Q("/","decodePathSegment"),r.decodeUrnPath=Q(":","decodeUrnPathSegment"),r.recodePath=Q("/","encodePathSegment","decode"),r.recodeUrnPath=Q(":","encodeUrnPathSegment","decode"),r.encodeReserved=x("reserved","encode"),r.parse=function(c,f){var h;return f||(f={preventInvalidHostname:r.preventInvalidHostname}),c=c.replace(r.leading_whitespace_expression,""),c=c.replace(r.ascii_tab_whitespace,""),h=c.indexOf("#"),h>-1&&(f.fragment=c.substring(h+1)||null,c=c.substring(0,h)),h=c.indexOf("?"),h>-1&&(f.query=c.substring(h+1)||null,c=c.substring(0,h)),c=c.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),c=c.replace(/^[/\\]{2,}/i,"//"),c.substring(0,2)==="//"?(f.protocol=null,c=c.substring(2),c=r.parseAuthority(c,f)):(h=c.indexOf(":"),h>-1&&(f.protocol=c.substring(0,h)||null,f.protocol&&!f.protocol.match(r.protocol_expression)?f.protocol=void 0:c.substring(h+1,h+3).replace(/\\/g,"/")==="//"?(c=c.substring(h+3),c=r.parseAuthority(c,f)):(c=c.substring(h+1),f.urn=!0))),f.path=c,f},r.parseHost=function(c,f){c||(c=""),c=c.replace(/\\/g,"/");var h=c.indexOf("/"),y,O;if(h===-1&&(h=c.length),c.charAt(0)==="[")y=c.indexOf("]"),f.hostname=c.substring(1,y)||null,f.port=c.substring(y+2,h)||null,f.port==="/"&&(f.port=null);else{var C=c.indexOf(":"),b=c.indexOf("/"),z=c.indexOf(":",C+1);z!==-1&&(b===-1||z<b)?(f.hostname=c.substring(0,h)||null,f.port=null):(O=c.substring(0,h).split(":"),f.hostname=O[0]||null,f.port=O[1]||null)}return f.hostname&&c.substring(h).charAt(0)!=="/"&&(h++,c="/"+c),f.preventInvalidHostname&&r.ensureValidHostname(f.hostname,f.protocol),f.port&&r.ensureValidPort(f.port),c.substring(h)||"/"},r.parseAuthority=function(c,f){return c=r.parseUserinfo(c,f),r.parseHost(c,f)},r.parseUserinfo=function(c,f){var h=c,y=c.indexOf("\\");y!==-1&&(c=c.replace(/\\/g,"/"));var O=c.indexOf("/"),C=c.lastIndexOf("@",O>-1?O:c.length-1),b;return C>-1&&(O===-1||C<O)?(b=c.substring(0,C).split(":"),f.username=b[0]?r.decode(b[0]):null,b.shift(),f.password=b[0]?r.decode(b.join(":")):null,c=h.substring(C+1)):(f.username=null,f.password=null),c},r.parseQuery=function(c,f){if(!c)return{};if(c=c.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!c)return{};for(var h={},y=c.split("&"),O=y.length,C,b,z,D=0;D<O;D++)C=y[D].split("="),b=r.decodeQuery(C.shift(),f),z=C.length?r.decodeQuery(C.join("="),f):null,b!=="__proto__"&&(d.call(h,b)?((typeof h[b]=="string"||h[b]===null)&&(h[b]=[h[b]]),h[b].push(z)):h[b]=z);return h},r.build=function(c){var f="",h=!1;return c.protocol&&(f+=c.protocol+":"),!c.urn&&(f||c.hostname)&&(f+="//",h=!0),f+=r.buildAuthority(c)||"",typeof c.path=="string"&&(c.path.charAt(0)!=="/"&&h&&(f+="/"),f+=c.path),typeof c.query=="string"&&c.query&&(f+="?"+c.query),typeof c.fragment=="string"&&c.fragment&&(f+="#"+c.fragment),f},r.buildHost=function(c){var f="";if(c.hostname)r.ip6_expression.test(c.hostname)?f+="["+c.hostname+"]":f+=c.hostname;else return"";return c.port&&(f+=":"+c.port),f},r.buildAuthority=function(c){return r.buildUserinfo(c)+r.buildHost(c)},r.buildUserinfo=function(c){var f="";return c.username&&(f+=r.encode(c.username)),c.password&&(f+=":"+r.encode(c.password)),f&&(f+="@"),f},r.buildQuery=function(c,f,h){var y="",O,C,b,z;for(C in c)if(C!=="__proto__"&&d.call(c,C))if(w(c[C]))for(O={},b=0,z=c[C].length;b<z;b++)c[C][b]!==void 0&&O[c[C][b]+""]===void 0&&(y+="&"+r.buildQueryParameter(C,c[C][b],h),f!==!0&&(O[c[C][b]+""]=!0));else c[C]!==void 0&&(y+="&"+r.buildQueryParameter(C,c[C],h));return y.substring(1)},r.buildQueryParameter=function(c,f,h){return r.encodeQuery(c,h)+(f!==null?"="+r.encodeQuery(f,h):"")},r.addQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.addQuery(c,y,f[y]);else if(typeof f=="string"){if(c[f]===void 0){c[f]=h;return}else typeof c[f]=="string"&&(c[f]=[c[f]]);w(h)||(h=[h]),c[f]=(c[f]||[]).concat(h)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(c,f,h){if(typeof f=="object")for(var y in f)d.call(f,y)&&r.setQuery(c,y,f[y]);else if(typeof f=="string")c[f]=h===void 0?null:h;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(c,f,h){var y,O,C;if(w(f))for(y=0,O=f.length;y<O;y++)c[f[y]]=void 0;else if(l(f)==="RegExp")for(C in c)f.test(C)&&(c[C]=void 0);else if(typeof f=="object")for(C in f)d.call(f,C)&&r.removeQuery(c,C,f[C]);else if(typeof f=="string")h!==void 0?l(h)==="RegExp"?!w(c[f])&&h.test(c[f])?c[f]=void 0:c[f]=E(c[f],h):c[f]===String(h)&&(!w(h)||h.length===1)?c[f]=void 0:w(c[f])&&(c[f]=E(c[f],h)):c[f]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(c,f,h,y){switch(l(f)){case"String":break;case"RegExp":for(var O in c)if(d.call(c,O)&&f.test(O)&&(h===void 0||r.hasQuery(c,O,h)))return!0;return!1;case"Object":for(var C in f)if(d.call(f,C)&&!r.hasQuery(c,C,f[C]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(h)){case"Undefined":return f in c;case"Boolean":var b=!!(w(c[f])?c[f].length:c[f]);return h===b;case"Function":return!!h(c[f],f,c);case"Array":if(!w(c[f]))return!1;var z=y?T:M;return z(c[f],h);case"RegExp":return w(c[f])?y?T(c[f],h):!1:!!(c[f]&&c[f].match(h));case"Number":h=String(h);case"String":return w(c[f])?y?T(c[f],h):!1:c[f]===h;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var c=[],f=[],h=0,y=0;y<arguments.length;y++){var O=new r(arguments[y]);c.push(O);for(var C=O.segment(),b=0;b<C.length;b++)typeof C[b]=="string"&&f.push(C[b]),C[b]&&h++}if(!f.length||!h)return new r("");var z=new r("").segment(f);return(c[0].path()===""||c[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(c,f){var h=Math.min(c.length,f.length),y;for(y=0;y<h;y++)if(c.charAt(y)!==f.charAt(y)){y--;break}return y<1?c.charAt(0)===f.charAt(0)&&c.charAt(0)==="/"?"/":"":((c.charAt(y)!=="/"||f.charAt(y)!=="/")&&(y=c.substring(0,y).lastIndexOf("/")),c.substring(0,y+1))},r.withinString=function(c,f,h){h||(h={});var y=h.start||r.findUri.start,O=h.end||r.findUri.end,C=h.trim||r.findUri.trim,b=h.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(y.lastIndex=0;;){var D=y.exec(c);if(!D)break;var Y=D.index;if(h.ignoreHtml){var re=c.slice(Math.max(Y-3,0),Y);if(re&&z.test(re))continue}for(var se=Y+c.slice(Y).search(O),ee=c.slice(Y,se),fe=-1;;){var he=b.exec(ee);if(!he)break;var me=he.index+he[0].length;fe=Math.max(fe,me)}if(fe>-1?ee=ee.slice(0,fe)+ee.slice(fe).replace(C,""):ee=ee.replace(C,""),!(ee.length<=D[0].length)&&!(h.ignore&&h.ignore.test(ee))){se=Y+ee.length;var de=f(ee,Y,se,c);if(de===void 0){y.lastIndex=se;continue}de=String(de),c=c.slice(0,Y)+de+c.slice(se),y.lastIndex=Y+de.length}}return y.lastIndex=0,c},r.ensureValidHostname=function(c,f){var h=!!c,y=!!f,O=!1;if(y&&(O=T(r.hostProtocols,f)),O&&!h)throw new TypeError("Hostname cannot be empty, if protocol is "+f);if(c&&c.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(c).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(c){if(c){var f=Number(c);if(!(a(f)&&f>0&&f<65536))throw new TypeError('Port "'+c+'" is not a valid port')}},r.noConflict=function(c){if(c){var f={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(f.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(f.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(f.SecondLevelDomains=o.SecondLevelDomains.noConflict()),f}else o.URI===this&&(o.URI=i);return this},u.build=function(c){return c===!0?this._deferred_build=!0:(c===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function W(c){return function(f,h){return f===void 0?this._parts[c]||"":(this._parts[c]=f||null,this.build(!h),this)}}function K(c,f){return function(h,y){return h===void 0?this._parts[c]||"":(h!==null&&(h=h+"",h.charAt(0)===f&&(h=h.substring(1))),this._parts[c]=h,this.build(!y),this)}}u.protocol=W("protocol"),u.username=W("username"),u.password=W("password"),u.hostname=W("hostname"),u.port=W("port"),u.query=K("query","?"),u.fragment=K("fragment","#"),u.search=function(c,f){var h=this.query(c,f);return typeof h=="string"&&h.length?"?"+h:h},u.hash=function(c,f){var h=this.fragment(c,f);return typeof h=="string"&&h.length?"#"+h:h},u.pathname=function(c,f){if(c===void 0||c===!0){var h=this._parts.path||(this._parts.hostname?"/":"");return c?(this._parts.urn?r.decodeUrnPath:r.decodePath)(h):h}else return this._parts.urn?this._parts.path=c?r.recodeUrnPath(c):"":this._parts.path=c?r.recodePath(c):"/",this.build(!f),this},u.path=u.pathname,u.href=function(c,f){var h;if(c===void 0)return this.toString();this._string="",this._parts=r._parts();var y=c instanceof r,O=typeof c=="object"&&(c.hostname||c.path||c.pathname);if(c.nodeName){var C=r.getDomAttribute(c);c=c[C]||"",O=!1}if(!y&&O&&c.pathname!==void 0&&(c=c.toString()),typeof c=="string"||c instanceof String)this._parts=r.parse(String(c),this._parts);else if(y||O){var b=y?c._parts:c;for(h in b)h!=="query"&&d.call(this._parts,h)&&(this._parts[h]=b[h]);b.query&&this.query(b.query,!1)}else throw new TypeError("invalid input");return this.build(!f),this},u.is=function(c){var f=!1,h=!1,y=!1,O=!1,C=!1,b=!1,z=!1,D=!this._parts.urn;switch(this._parts.hostname&&(D=!1,h=r.ip4_expression.test(this._parts.hostname),y=r.ip6_expression.test(this._parts.hostname),f=h||y,O=!f,C=O&&t&&t.has(this._parts.hostname),b=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),c.toLowerCase()){case"relative":return D;case"absolute":return!D;case"domain":case"name":return O;case"sld":return C;case"ip":return f;case"ip4":case"ipv4":case"inet4":return h;case"ip6":case"ipv6":case"inet6":return y;case"idn":return b;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var oe=u.protocol,X=u.port,te=u.hostname;u.protocol=function(c,f){if(c&&(c=c.replace(/:(\/\/)?$/,""),!c.match(r.protocol_expression)))throw new TypeError('Protocol "'+c+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return oe.call(this,c,f)},u.scheme=u.protocol,u.port=function(c,f){return this._parts.urn?c===void 0?"":this:(c!==void 0&&(c===0&&(c=null),c&&(c+="",c.charAt(0)===":"&&(c=c.substring(1)),r.ensureValidPort(c))),X.call(this,c,f))},u.hostname=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c!==void 0){var h={preventInvalidHostname:this._parts.preventInvalidHostname},y=r.parseHost(c,h);if(y!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');c=h.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(c,this._parts.protocol)}return te.call(this,c,f)},u.origin=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=this.protocol(),y=this.authority();return y?(h?h+"://":"")+this.authority():""}else{var O=r(c);return this.protocol(O.protocol()).authority(O.authority()).build(!f),this}},u.host=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var h=r.parseHost(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.authority=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var h=r.parseAuthority(c,this._parts);if(h!=="/")throw new TypeError('Hostname "'+c+'" contains characters other than [A-Z0-9.-]');return this.build(!f),this},u.userinfo=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){var h=r.buildUserinfo(this._parts);return h&&h.substring(0,h.length-1)}else return c[c.length-1]!=="@"&&(c+="@"),r.parseUserinfo(c,this._parts),this.build(!f),this},u.resource=function(c,f){var h;return c===void 0?this.path()+this.search()+this.hash():(h=r.parse(c),this._parts.path=h.path,this._parts.query=h.query,this._parts.fragment=h.fragment,this.build(!f),this)},u.subdomain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,h)||""}else{var y=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,y),C=new RegExp("^"+m(O));if(c&&c.charAt(c.length-1)!=="."&&(c+="."),c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return c&&r.ensureValidHostname(c,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(C,c),this.build(!f),this}},u.domain=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.match(/\./g);if(h&&h.length<2)return this._parts.hostname;var y=this._parts.hostname.length-this.tld(f).length-1;return y=this._parts.hostname.lastIndexOf(".",y-1)+1,this._parts.hostname.substring(y)||""}else{if(!c)throw new TypeError("cannot set domain empty");if(c.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(c,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=c;else{var O=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,c)}return this.build(!f),this}},u.tld=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c=="boolean"&&(f=c,c=void 0),c===void 0){if(!this._parts.hostname||this.is("IP"))return"";var h=this._parts.hostname.lastIndexOf("."),y=this._parts.hostname.substring(h+1);return f!==!0&&t&&t.list[y.toLowerCase()]&&t.get(this._parts.hostname)||y}else{var O;if(c)if(c.match(/[^a-zA-Z0-9-]/))if(t&&t.is(c))O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c);else throw new TypeError('TLD "'+c+'" 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");O=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,c)}else throw new TypeError("cannot set TLD empty");return this.build(!f),this}},u.directory=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var h=this._parts.path.length-this.filename().length-1,y=this._parts.path.substring(0,h)||(this._parts.hostname?"/":"");return c?r.decodePath(y):y}else{var O=this._parts.path.length-this.filename().length,C=this._parts.path.substring(0,O),b=new RegExp("^"+m(C));return this.is("relative")||(c||(c="/"),c.charAt(0)!=="/"&&(c="/"+c)),c&&c.charAt(c.length-1)!=="/"&&(c+="/"),c=r.recodePath(c),this._parts.path=this._parts.path.replace(b,c),this.build(!f),this}},u.filename=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(typeof c!="string"){if(!this._parts.path||this._parts.path==="/")return"";var h=this._parts.path.lastIndexOf("/"),y=this._parts.path.substring(h+1);return c?r.decodePathSegment(y):y}else{var O=!1;c.charAt(0)==="/"&&(c=c.substring(1)),c.match(/\.?\//)&&(O=!0);var C=new RegExp(m(this.filename())+"$");return c=r.recodePath(c),this._parts.path=this._parts.path.replace(C,c),O?this.normalizePath(f):this.build(!f),this}},u.suffix=function(c,f){if(this._parts.urn)return c===void 0?"":this;if(c===void 0||c===!0){if(!this._parts.path||this._parts.path==="/")return"";var h=this.filename(),y=h.lastIndexOf("."),O,C;return y===-1?"":(O=h.substring(y+1),C=/^[a-z0-9%]+$/i.test(O)?O:"",c?r.decodePathSegment(C):C)}else{c.charAt(0)==="."&&(c=c.substring(1));var b=this.suffix(),z;if(b)c?z=new RegExp(m(b)+"$"):z=new RegExp(m("."+b)+"$");else{if(!c)return this;this._parts.path+="."+r.recodePath(c)}return z&&(c=r.recodePath(c),this._parts.path=this._parts.path.replace(z,c)),this.build(!f),this}},u.segment=function(c,f,h){var y=this._parts.urn?":":"/",O=this.path(),C=O.substring(0,1)==="/",b=O.split(y);if(c!==void 0&&typeof c!="number"&&(h=f,f=c,c=void 0),c!==void 0&&typeof c!="number")throw new Error('Bad segment "'+c+'", must be 0-based integer');if(C&&b.shift(),c<0&&(c=Math.max(b.length+c,0)),f===void 0)return c===void 0?b:b[c];if(c===null||b[c]===void 0)if(w(f)){b=[];for(var z=0,D=f.length;z<D;z++)!f[z].length&&(!b.length||!b[b.length-1].length)||(b.length&&!b[b.length-1].length&&b.pop(),b.push(v(f[z])))}else(f||typeof f=="string")&&(f=v(f),b[b.length-1]===""?b[b.length-1]=f:b.push(f));else f?b[c]=v(f):b.splice(c,1);return C&&b.unshift(""),this.path(b.join(y),h)},u.segmentCoded=function(c,f,h){var y,O,C;if(typeof c!="number"&&(h=f,f=c,c=void 0),f===void 0){if(y=this.segment(c,f,h),!w(y))y=y!==void 0?r.decode(y):void 0;else for(O=0,C=y.length;O<C;O++)y[O]=r.decode(y[O]);return y}if(!w(f))f=typeof f=="string"||f instanceof String?r.encode(f):f;else for(O=0,C=f.length;O<C;O++)f[O]=r.encode(f[O]);return this.segment(c,f,h)};var Z=u.query;return u.query=function(c,f){if(c===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="function"){var h=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),y=c.call(this,h);return this._parts.query=r.buildQuery(y||h,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this}else return c!==void 0&&typeof c!="string"?(this._parts.query=r.buildQuery(c,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!f),this):Z.call(this,c,f)},u.setQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof c=="string"||c instanceof String)y[c]=f!==void 0?f:null;else if(typeof c=="object")for(var O in c)d.call(c,O)&&(y[O]=c[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.addQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(y,c,f===void 0?null:f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.removeQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(y,c,f),this._parts.query=r.buildQuery(y,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof c!="string"&&(h=f),this.build(!h),this},u.hasQuery=function(c,f,h){var y=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(y,c,f,h)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(c){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!c)),this},u.normalizeHostname=function(c){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!c)),this},u.normalizePort=function(c){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!c)),this},u.normalizePath=function(c){var f=this._parts.path;if(!f)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!c),this;if(this._parts.path==="/")return this;f=r.recodePath(f);var h,y="",O,C;for(f.charAt(0)!=="/"&&(h=!0,f="/"+f),(f.slice(-3)==="/.."||f.slice(-2)==="/.")&&(f+="/"),f=f.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),h&&(y=f.substring(1).match(/^(\.\.\/)+/)||"",y&&(y=y[0]));O=f.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){f=f.substring(3);continue}C=f.substring(0,O).lastIndexOf("/"),C===-1&&(C=O),f=f.substring(0,C)+f.substring(O+3)}return h&&this.is("relative")&&(f=y+f.substring(1)),this._parts.path=f,this.build(!c),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(c){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(!c)),this},u.normalizeFragment=function(c){return this._parts.fragment||(this._parts.fragment=null,this.build(!c)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var c=r.encode,f=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.unicode=function(){var c=r.encode,f=r.decode;r.encode=N,r.decode=unescape;try{this.normalize()}finally{r.encode=c,r.decode=f}return this},u.readable=function(){var c=this.clone();c.username("").password("").normalize();var f="";if(c._parts.protocol&&(f+=c._parts.protocol+"://"),c._parts.hostname&&(c.is("punycode")&&e?(f+=e.toUnicode(c._parts.hostname),c._parts.port&&(f+=":"+c._parts.port)):f+=c.host()),c._parts.hostname&&c._parts.path&&c._parts.path.charAt(0)!=="/"&&(f+="/"),f+=c.path(!0),c._parts.query){for(var h="",y=0,O=c._parts.query.split("&"),C=O.length;y<C;y++){var b=(O[y]||"").split("=");h+="&"+r.decodeQuery(b[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),b[1]!==void 0&&(h+="="+r.decodeQuery(b[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}f+="?"+h.substring(1)}return f+=r.decodeQuery(c.hash(),!0),f},u.absoluteTo=function(c){var f=this.clone(),h=["protocol","username","password","hostname","port"],y,O,C;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c instanceof r||(c=new r(c)),f._parts.protocol||(f._parts.protocol=c._parts.protocol,this._parts.hostname))return f;for(O=0;C=h[O];O++)f._parts[C]=c._parts[C];return f._parts.path?(f._parts.path.substring(-2)===".."&&(f._parts.path+="/"),f.path().charAt(0)!=="/"&&(y=c.directory(),y=y||(c.path().indexOf("/")===0?"/":""),f._parts.path=(y?y+"/":"")+f._parts.path,f.normalizePath())):(f._parts.path=c._parts.path,f._parts.query||(f._parts.query=c._parts.query)),f.build(),f},u.relativeTo=function(c){var f=this.clone().normalize(),h,y,O,C,b;if(f._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(c=new r(c).normalize(),h=f._parts,y=c._parts,C=f.path(),b=c.path(),C.charAt(0)!=="/")throw new Error("URI is already relative");if(b.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(h.protocol===y.protocol&&(h.protocol=null),h.username!==y.username||h.password!==y.password||h.protocol!==null||h.username!==null||h.password!==null)return f.build();if(h.hostname===y.hostname&&h.port===y.port)h.hostname=null,h.port=null;else return f.build();if(C===b)return h.path="",f.build();if(O=r.commonPath(C,b),!O)return f.build();var z=y.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return h.path=z+h.path.substring(O.length)||"./",f.build()},u.equals=function(c){var f=this.clone(),h=new r(c),y={},O={},C={},b,z,D;if(f.normalize(),h.normalize(),f.toString()===h.toString())return!0;if(b=f.query(),z=h.query(),f.query(""),h.query(""),f.toString()!==h.toString()||b.length!==z.length)return!1;y=r.parseQuery(b,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(D in y)if(d.call(y,D)){if(w(y[D])){if(!M(y[D],O[D]))return!1}else if(y[D]!==O[D])return!1;C[D]=!0}for(D in O)if(d.call(O,D)&&!C[D])return!1;return!0},u.preventInvalidHostname=function(c){return this._parts.preventInvalidHostname=!!c,this},u.duplicateQueryParameters=function(c){return this._parts.duplicateQueryParameters=!!c,this},u.escapeQuerySpace=function(c){return this._parts.escapeQuerySpace=!!c,this},r})});function j(e,n,t,o){this.x=e??0,this.y=n??0,this.z=t??0,this.w=o??0}j.fromElements=function(e,n,t,o,i){return p(i)?(i.x=e,i.y=n,i.z=t,i.w=o,i):new j(e,n,t,o)};j.fromColor=function(e,n){return s.typeOf.object("color",e),p(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new j(e.red,e.green,e.blue,e.alpha)};j.clone=function(e,n){if(p(e))return p(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new j(e.x,e.y,e.z,e.w)};j.packedLength=4;j.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e.x,n[t++]=e.y,n[t++]=e.z,n[t]=e.w,n};j.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new j),t.x=e[n++],t.y=e[n++],t.z=e[n++],t.w=e[n],t};j.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*4;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)j.pack(e[i],n,i*4);return n};j.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let t=e.length;p(n)?n.length=t/4:n=new Array(t/4);for(let o=0;o<t;o+=4){let i=o/4;n[i]=j.unpack(e,o,n[i])}return n};j.fromArray=j.unpack;j.maximumComponent=function(e){return s.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};j.minimumComponent=function(e){return s.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};j.minimumByComponent=function(e,n,t){return s.typeOf.object("first",e),s.typeOf.object("second",n),s.typeOf.object("result",t),t.x=Math.min(e.x,n.x),t.y=Math.min(e.y,n.y),t.z=Math.min(e.z,n.z),t.w=Math.min(e.w,n.w),t};j.maximumByComponent=function(e,n,t){return s.typeOf.object("first",e),s.typeOf.object("second",n),s.typeOf.object("result",t),t.x=Math.max(e.x,n.x),t.y=Math.max(e.y,n.y),t.z=Math.max(e.z,n.z),t.w=Math.max(e.w,n.w),t};j.clamp=function(e,n,t,o){s.typeOf.object("value",e),s.typeOf.object("min",n),s.typeOf.object("max",t),s.typeOf.object("result",o);let i=R.clamp(e.x,n.x,t.x),r=R.clamp(e.y,n.y,t.y),a=R.clamp(e.z,n.z,t.z),u=R.clamp(e.w,n.w,t.w);return o.x=i,o.y=r,o.z=a,o.w=u,o};j.magnitudeSquared=function(e){return s.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};j.magnitude=function(e){return Math.sqrt(j.magnitudeSquared(e))};var En=new j;j.distance=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),j.subtract(e,n,En),j.magnitude(En)};j.distanceSquared=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),j.subtract(e,n,En),j.magnitudeSquared(En)};j.normalize=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=j.magnitude(e);if(n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new A("normalized result is not a number");return n};j.dot=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w};j.multiplyComponents=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x*n.x,t.y=e.y*n.y,t.z=e.z*n.z,t.w=e.w*n.w,t};j.divideComponents=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x/n.x,t.y=e.y/n.y,t.z=e.z/n.z,t.w=e.w/n.w,t};j.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t.w=e.w+n.w,t};j.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t.w=e.w-n.w,t};j.multiplyByScalar=function(e,n,t){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=e.w*n,t};j.divideByScalar=function(e,n,t){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};j.negate=function(e,n){return s.typeOf.object("cartesian",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n};j.abs=function(e,n){return s.typeOf.object("cartesian",e),s.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n.w=Math.abs(e.w),n};var Et=new j;j.lerp=function(e,n,t,o){return s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o),j.multiplyByScalar(n,t,Et),o=j.multiplyByScalar(e,1-t,o),j.add(Et,o,o)};var zo=new j;j.mostOrthogonalAxis=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=j.normalize(e,zo);return j.abs(t,t),t.x<=t.y?t.x<=t.z?t.x<=t.w?n=j.clone(j.UNIT_X,n):n=j.clone(j.UNIT_W,n):t.z<=t.w?n=j.clone(j.UNIT_Z,n):n=j.clone(j.UNIT_W,n):t.y<=t.z?t.y<=t.w?n=j.clone(j.UNIT_Y,n):n=j.clone(j.UNIT_W,n):t.z<=t.w?n=j.clone(j.UNIT_Z,n):n=j.clone(j.UNIT_W,n),n};j.equals=function(e,n){return e===n||p(e)&&p(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w};j.equalsArray=function(e,n,t){return e.x===n[t]&&e.y===n[t+1]&&e.z===n[t+2]&&e.w===n[t+3]};j.equalsEpsilon=function(e,n,t,o){return e===n||p(e)&&p(n)&&R.equalsEpsilon(e.x,n.x,t,o)&&R.equalsEpsilon(e.y,n.y,t,o)&&R.equalsEpsilon(e.z,n.z,t,o)&&R.equalsEpsilon(e.w,n.w,t,o)};j.ZERO=Object.freeze(new j(0,0,0,0));j.ONE=Object.freeze(new j(1,1,1,1));j.UNIT_X=Object.freeze(new j(1,0,0,0));j.UNIT_Y=Object.freeze(new j(0,1,0,0));j.UNIT_Z=Object.freeze(new j(0,0,1,0));j.UNIT_W=Object.freeze(new j(0,0,0,1));j.prototype.clone=function(e){return j.clone(this,e)};j.prototype.equals=function(e){return j.equals(this,e)};j.prototype.equalsEpsilon=function(e,n,t){return j.equalsEpsilon(this,e,n,t)};j.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Jn=new Float32Array(1),ye=new Uint8Array(Jn.buffer),Io=new Uint32Array([287454020]),qo=new Uint8Array(Io.buffer),Tt=qo[0]===68;j.packFloat=function(e,n){return s.typeOf.number("value",e),p(n)||(n=new j),Jn[0]=e,Tt?(n.x=ye[0],n.y=ye[1],n.z=ye[2],n.w=ye[3]):(n.x=ye[3],n.y=ye[2],n.z=ye[1],n.w=ye[0]),n};j.unpackFloat=function(e){return s.typeOf.object("packedFloat",e),Tt?(ye[0]=e.x,ye[1]=e.y,ye[2]=e.z,ye[3]=e.w):(ye[0]=e.w,ye[1]=e.z,ye[2]=e.y,ye[3]=e.x),Jn[0]};var qe=j;function _(e,n,t,o,i,r,a,u,d,m,l,w,E,T,M,v){this[0]=e??0,this[1]=i??0,this[2]=d??0,this[3]=E??0,this[4]=n??0,this[5]=r??0,this[6]=m??0,this[7]=T??0,this[8]=t??0,this[9]=a??0,this[10]=l??0,this[11]=M??0,this[12]=o??0,this[13]=u??0,this[14]=w??0,this[15]=v??0}_.packedLength=16;_.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n[t++]=e[4],n[t++]=e[5],n[t++]=e[6],n[t++]=e[7],n[t++]=e[8],n[t++]=e[9],n[t++]=e[10],n[t++]=e[11],n[t++]=e[12],n[t++]=e[13],n[t++]=e[14],n[t]=e[15],n};_.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new _),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t[4]=e[n++],t[5]=e[n++],t[6]=e[n++],t[7]=e[n++],t[8]=e[n++],t[9]=e[n++],t[10]=e[n++],t[11]=e[n++],t[12]=e[n++],t[13]=e[n++],t[14]=e[n++],t[15]=e[n],t};_.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*16;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)_.pack(e[i],n,i*16);return n};_.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new A("array length must be a multiple of 16.");let t=e.length;p(n)?n.length=t/16:n=new Array(t/16);for(let o=0;o<t;o+=16){let i=o/16;n[i]=_.unpack(e,o,n[i])}return n};_.clone=function(e,n){if(p(e))return p(n)?(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]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n):new _(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])};_.fromArray=_.unpack;_.fromColumnMajorArray=function(e,n){return s.defined("values",e),_.clone(e,n)};_.fromRowMajorArray=function(e,n){return s.defined("values",e),p(n)?(n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15],n):new _(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])};_.fromRotationTranslation=function(e,n,t){return s.typeOf.object("rotation",e),n=n??g.ZERO,p(t)?(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]=n.x,t[13]=n.y,t[14]=n.z,t[15]=1,t):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)};_.fromTranslationQuaternionRotationScale=function(e,n,t,o){s.typeOf.object("translation",e),s.typeOf.object("rotation",n),s.typeOf.object("scale",t),p(o)||(o=new _);let i=t.x,r=t.y,a=t.z,u=n.x*n.x,d=n.x*n.y,m=n.x*n.z,l=n.x*n.w,w=n.y*n.y,E=n.y*n.z,T=n.y*n.w,M=n.z*n.z,v=n.z*n.w,I=n.w*n.w,N=u-w-M+I,F=2*(d-v),k=2*(m+T),x=2*(d+v),Q=-u+w-M+I,W=2*(E-l),K=2*(m-T),oe=2*(E+l),X=-u-w+M+I;return o[0]=N*i,o[1]=x*i,o[2]=K*i,o[3]=0,o[4]=F*r,o[5]=Q*r,o[6]=oe*r,o[7]=0,o[8]=k*a,o[9]=W*a,o[10]=X*a,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};_.fromTranslationRotationScale=function(e,n){return s.typeOf.object("translationRotationScale",e),_.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,n)};_.fromTranslation=function(e,n){return s.typeOf.object("translation",e),_.fromRotationTranslation(B.IDENTITY,e,n)};_.fromScale=function(e,n){return s.typeOf.object("scale",e),p(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};_.fromUniformScale=function(e,n){return s.typeOf.number("scale",e),p(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};_.fromRotation=function(e,n){return s.typeOf.object("rotation",e),p(n)||(n=new _),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]=0,n[13]=0,n[14]=0,n[15]=1,n};var Je=new g,Ge=new g,pn=new g;_.fromCamera=function(e,n){s.typeOf.object("camera",e);let t=e.position,o=e.direction,i=e.up;s.typeOf.object("camera.position",t),s.typeOf.object("camera.direction",o),s.typeOf.object("camera.up",i),g.normalize(o,Je),g.normalize(g.cross(Je,i,Ge),Ge),g.normalize(g.cross(Ge,Je,pn),pn);let r=Ge.x,a=Ge.y,u=Ge.z,d=Je.x,m=Je.y,l=Je.z,w=pn.x,E=pn.y,T=pn.z,M=t.x,v=t.y,I=t.z,N=r*-M+a*-v+u*-I,F=w*-M+E*-v+T*-I,k=d*M+m*v+l*I;return p(n)?(n[0]=r,n[1]=w,n[2]=-d,n[3]=0,n[4]=a,n[5]=E,n[6]=-m,n[7]=0,n[8]=u,n[9]=T,n[10]=-l,n[11]=0,n[12]=N,n[13]=F,n[14]=k,n[15]=1,n):new _(r,a,u,N,w,E,T,F,-d,-m,-l,k,0,0,0,1)};_.computePerspectiveFieldOfView=function(e,n,t,o,i){s.typeOf.number.greaterThan("fovY",e,0),s.typeOf.number.lessThan("fovY",e,Math.PI),s.typeOf.number.greaterThan("near",t,0),s.typeOf.number.greaterThan("far",o,0),s.typeOf.object("result",i);let a=1/Math.tan(e*.5),u=a/n,d=(o+t)/(t-o),m=2*o*t/(t-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=a,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=-1,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i};_.computeOrthographicOffCenter=function(e,n,t,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=1/(n-e),d=1/(o-t),m=1/(r-i),l=-(n+e)*u,w=-(o+t)*d,E=-(r+i)*m;return u*=2,d*=2,m*=-2,a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=m,a[11]=0,a[12]=l,a[13]=w,a[14]=E,a[15]=1,a};_.computePerspectiveOffCenter=function(e,n,t,o,i,r,a){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.number("far",r),s.typeOf.object("result",a);let u=2*i/(n-e),d=2*i/(o-t),m=(n+e)/(n-e),l=(o+t)/(o-t),w=-(r+i)/(r-i),E=-1,T=-2*r*i/(r-i);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=m,a[9]=l,a[10]=w,a[11]=E,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a};_.computeInfinitePerspectiveOffCenter=function(e,n,t,o,i,r){s.typeOf.number("left",e),s.typeOf.number("right",n),s.typeOf.number("bottom",t),s.typeOf.number("top",o),s.typeOf.number("near",i),s.typeOf.object("result",r);let a=2*i/(n-e),u=2*i/(o-t),d=(n+e)/(n-e),m=(o+t)/(o-t),l=-1,w=-1,E=-2*i;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=d,r[9]=m,r[10]=l,r[11]=w,r[12]=0,r[13]=0,r[14]=E,r[15]=0,r};_.computeViewportTransformation=function(e,n,t,o){p(o)||(o=new _),e=e??_e.EMPTY_OBJECT;let i=e.x??0,r=e.y??0,a=e.width??0,u=e.height??0;n=n??0,t=t??1;let d=a*.5,m=u*.5,l=(t-n)*.5,w=d,E=m,T=l,M=i+d,v=r+m,I=n+l,N=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=T,o[11]=0,o[12]=M,o[13]=v,o[14]=I,o[15]=N,o};_.computeView=function(e,n,t,o,i){return s.typeOf.object("position",e),s.typeOf.object("direction",n),s.typeOf.object("up",t),s.typeOf.object("right",o),s.typeOf.object("result",i),i[0]=o.x,i[1]=t.x,i[2]=-n.x,i[3]=0,i[4]=o.y,i[5]=t.y,i[6]=-n.y,i[7]=0,i[8]=o.z,i[9]=t.z,i[10]=-n.z,i[11]=0,i[12]=-g.dot(o,e),i[13]=-g.dot(t,e),i[14]=g.dot(n,e),i[15]=1,i};_.toArray=function(e,n){return s.typeOf.object("matrix",e),p(n)?(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]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n):[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]]};_.getElementIndex=function(e,n){return s.typeOf.number.greaterThanOrEquals("row",n,0),s.typeOf.number.lessThanOrEquals("row",n,3),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,3),e*4+n};_.getColumn=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("result",t);let o=n*4,i=e[o],r=e[o+1],a=e[o+2],u=e[o+3];return t.x=i,t.y=r,t.z=a,t.w=u,t};_.setColumn=function(e,n,t,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=_.clone(e,o);let i=n*4;return o[i]=t.x,o[i+1]=t.y,o[i+2]=t.z,o[i+3]=t.w,o};_.getRow=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("result",t);let o=e[n],i=e[n+4],r=e[n+8],a=e[n+12];return t.x=o,t.y=i,t.z=r,t.w=a,t};_.setRow=function(e,n,t,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,3),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=_.clone(e,o),o[n]=t.x,o[n+4]=t.y,o[n+8]=t.z,o[n+12]=t.w,o};_.setTranslation=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.object("translation",n),s.typeOf.object("result",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]=n.x,t[13]=n.y,t[14]=n.z,t[15]=e[15],t};var Do=new g;_.setScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=_.getScale(e,Do),i=n.x/o.x,r=n.y/o.y,a=n.z/o.z;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3],t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7],t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var No=new g;_.setUniformScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t);let o=_.getScale(e,No),i=n/o.x,r=n/o.y,a=n/o.z;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3],t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7],t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var Gn=new g;_.getScale=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=g.magnitude(g.fromElements(e[0],e[1],e[2],Gn)),n.y=g.magnitude(g.fromElements(e[4],e[5],e[6],Gn)),n.z=g.magnitude(g.fromElements(e[8],e[9],e[10],Gn)),n};var Ct=new g;_.getMaximumScale=function(e){return _.getScale(e,Ct),g.maximumComponent(Ct)};var ko=new g;_.setRotation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let o=_.getScale(e,ko);return t[0]=n[0]*o.x,t[1]=n[1]*o.x,t[2]=n[2]*o.x,t[3]=e[3],t[4]=n[3]*o.y,t[5]=n[4]*o.y,t[6]=n[5]*o.y,t[7]=e[7],t[8]=n[6]*o.z,t[9]=n[7]*o.z,t[10]=n[8]*o.z,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};var Fo=new g;_.getRotation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=_.getScale(e,Fo);return n[0]=e[0]/t.x,n[1]=e[1]/t.x,n[2]=e[2]/t.x,n[3]=e[4]/t.y,n[4]=e[5]/t.y,n[5]=e[6]/t.y,n[6]=e[8]/t.z,n[7]=e[9]/t.z,n[8]=e[10]/t.z,n};_.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[3],u=e[4],d=e[5],m=e[6],l=e[7],w=e[8],E=e[9],T=e[10],M=e[11],v=e[12],I=e[13],N=e[14],F=e[15],k=n[0],x=n[1],Q=n[2],W=n[3],K=n[4],oe=n[5],X=n[6],te=n[7],Z=n[8],c=n[9],f=n[10],h=n[11],y=n[12],O=n[13],C=n[14],b=n[15],z=o*k+u*x+w*Q+v*W,D=i*k+d*x+E*Q+I*W,Y=r*k+m*x+T*Q+N*W,re=a*k+l*x+M*Q+F*W,se=o*K+u*oe+w*X+v*te,ee=i*K+d*oe+E*X+I*te,fe=r*K+m*oe+T*X+N*te,he=a*K+l*oe+M*X+F*te,me=o*Z+u*c+w*f+v*h,de=i*Z+d*c+E*f+I*h,pe=r*Z+m*c+T*f+N*h,V=a*Z+l*c+M*f+F*h,ge=o*y+u*O+w*C+v*b,Te=i*y+d*O+E*C+I*b,je=r*y+m*O+T*C+N*b,fn=a*y+l*O+M*C+F*b;return t[0]=z,t[1]=D,t[2]=Y,t[3]=re,t[4]=se,t[5]=ee,t[6]=fe,t[7]=he,t[8]=me,t[9]=de,t[10]=pe,t[11]=V,t[12]=ge,t[13]=Te,t[14]=je,t[15]=fn,t};_.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t};_.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t};_.multiplyTransformation=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=e[12],T=e[13],M=e[14],v=n[0],I=n[1],N=n[2],F=n[4],k=n[5],x=n[6],Q=n[8],W=n[9],K=n[10],oe=n[12],X=n[13],te=n[14],Z=o*v+a*I+m*N,c=i*v+u*I+l*N,f=r*v+d*I+w*N,h=o*F+a*k+m*x,y=i*F+u*k+l*x,O=r*F+d*k+w*x,C=o*Q+a*W+m*K,b=i*Q+u*W+l*K,z=r*Q+d*W+w*K,D=o*oe+a*X+m*te+E,Y=i*oe+u*X+l*te+T,re=r*oe+d*X+w*te+M;return t[0]=Z,t[1]=c,t[2]=f,t[3]=0,t[4]=h,t[5]=y,t[6]=O,t[7]=0,t[8]=C,t[9]=b,t[10]=z,t[11]=0,t[12]=D,t[13]=Y,t[14]=re,t[15]=1,t};_.multiplyByMatrix3=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("rotation",n),s.typeOf.object("result",t);let o=e[0],i=e[1],r=e[2],a=e[4],u=e[5],d=e[6],m=e[8],l=e[9],w=e[10],E=n[0],T=n[1],M=n[2],v=n[3],I=n[4],N=n[5],F=n[6],k=n[7],x=n[8],Q=o*E+a*T+m*M,W=i*E+u*T+l*M,K=r*E+d*T+w*M,oe=o*v+a*I+m*N,X=i*v+u*I+l*N,te=r*v+d*I+w*N,Z=o*F+a*k+m*x,c=i*F+u*k+l*x,f=r*F+d*k+w*x;return t[0]=Q,t[1]=W,t[2]=K,t[3]=0,t[4]=oe,t[5]=X,t[6]=te,t[7]=0,t[8]=Z,t[9]=c,t[10]=f,t[11]=0,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};_.multiplyByTranslation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("translation",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=o*e[0]+i*e[4]+r*e[8]+e[12],u=o*e[1]+i*e[5]+r*e[9]+e[13],d=o*e[2]+i*e[6]+r*e[10]+e[14];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]=a,t[13]=u,t[14]=d,t[15]=e[15],t};_.multiplyByScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z;return o===1&&i===1&&r===1?_.clone(e,t):(t[0]=o*e[0],t[1]=o*e[1],t[2]=o*e[2],t[3]=e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=i*e[6],t[7]=e[7],t[8]=r*e[8],t[9]=r*e[9],t[10]=r*e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t)};_.multiplyByUniformScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3],t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7],t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};_.multiplyByVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=n.w,u=e[0]*o+e[4]*i+e[8]*r+e[12]*a,d=e[1]*o+e[5]*i+e[9]*r+e[13]*a,m=e[2]*o+e[6]*i+e[10]*r+e[14]*a,l=e[3]*o+e[7]*i+e[11]*r+e[15]*a;return t.x=u,t.y=d,t.z=m,t.w=l,t};_.multiplyByPointAsVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=e[0]*o+e[4]*i+e[8]*r,u=e[1]*o+e[5]*i+e[9]*r,d=e[2]*o+e[6]*i+e[10]*r;return t.x=a,t.y=u,t.z=d,t};_.multiplyByPoint=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=n.x,i=n.y,r=n.z,a=e[0]*o+e[4]*i+e[8]*r+e[12],u=e[1]*o+e[5]*i+e[9]*r+e[13],d=e[2]*o+e[6]*i+e[10]*r+e[14];return t.x=a,t.y=u,t.z=d,t};_.multiplyByScalar=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t};_.negate=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),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]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=-e[15],n};_.transpose=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[1],o=e[2],i=e[3],r=e[6],a=e[7],u=e[11];return n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=o,n[9]=r,n[10]=e[10],n[11]=e[14],n[12]=i,n[13]=a,n[14]=u,n[15]=e[15],n};_.abs=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n[9]=Math.abs(e[9]),n[10]=Math.abs(e[10]),n[11]=Math.abs(e[11]),n[12]=Math.abs(e[12]),n[13]=Math.abs(e[13]),n[14]=Math.abs(e[14]),n[15]=Math.abs(e[15]),n};_.equals=function(e,n){return e===n||p(e)&&p(n)&&e[12]===n[12]&&e[13]===n[13]&&e[14]===n[14]&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[4]===n[4]&&e[5]===n[5]&&e[6]===n[6]&&e[8]===n[8]&&e[9]===n[9]&&e[10]===n[10]&&e[3]===n[3]&&e[7]===n[7]&&e[11]===n[11]&&e[15]===n[15]};_.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e[0]-n[0])<=t&&Math.abs(e[1]-n[1])<=t&&Math.abs(e[2]-n[2])<=t&&Math.abs(e[3]-n[3])<=t&&Math.abs(e[4]-n[4])<=t&&Math.abs(e[5]-n[5])<=t&&Math.abs(e[6]-n[6])<=t&&Math.abs(e[7]-n[7])<=t&&Math.abs(e[8]-n[8])<=t&&Math.abs(e[9]-n[9])<=t&&Math.abs(e[10]-n[10])<=t&&Math.abs(e[11]-n[11])<=t&&Math.abs(e[12]-n[12])<=t&&Math.abs(e[13]-n[13])<=t&&Math.abs(e[14]-n[14])<=t&&Math.abs(e[15]-n[15])<=t};_.getTranslation=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=e[12],n.y=e[13],n.z=e[14],n};_.getMatrix3=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n};var Lo=new B,xo=new B,Bo=new qe,Qo=new qe(0,0,0,1);_.inverse=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[4],i=e[8],r=e[12],a=e[1],u=e[5],d=e[9],m=e[13],l=e[2],w=e[6],E=e[10],T=e[14],M=e[3],v=e[7],I=e[11],N=e[15],F=E*N,k=T*I,x=w*N,Q=T*v,W=w*I,K=E*v,oe=l*N,X=T*M,te=l*I,Z=E*M,c=l*v,f=w*M,h=F*u+Q*d+W*m-(k*u+x*d+K*m),y=k*a+oe*d+Z*m-(F*a+X*d+te*m),O=x*a+X*u+c*m-(Q*a+oe*u+f*m),C=K*a+te*u+f*d-(W*a+Z*u+c*d),b=k*o+x*i+K*r-(F*o+Q*i+W*r),z=F*t+X*i+te*r-(k*t+oe*i+Z*r),D=Q*t+oe*o+f*r-(x*t+X*o+c*r),Y=W*t+Z*o+c*i-(K*t+te*o+f*i);F=i*m,k=r*d,x=o*m,Q=r*u,W=o*d,K=i*u,oe=t*m,X=r*a,te=t*d,Z=i*a,c=t*u,f=o*a;let re=F*v+Q*I+W*N-(k*v+x*I+K*N),se=k*M+oe*I+Z*N-(F*M+X*I+te*N),ee=x*M+X*v+c*N-(Q*M+oe*v+f*N),fe=K*M+te*v+f*I-(W*M+Z*v+c*I),he=x*E+K*T+k*w-(W*T+F*w+Q*E),me=te*T+F*l+X*E-(oe*E+Z*T+k*l),de=oe*w+f*T+Q*l-(c*T+x*l+X*w),pe=c*E+W*l+Z*w-(te*w+f*E+K*l),V=t*h+o*y+i*O+r*C;if(Math.abs(V)<R.EPSILON21){if(B.equalsEpsilon(_.getMatrix3(e,Lo),xo,R.EPSILON7)&&qe.equals(_.getRow(e,3,Bo),Qo))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;throw new Se("matrix is not invertible because its determinate is zero.")}return V=1/V,n[0]=h*V,n[1]=y*V,n[2]=O*V,n[3]=C*V,n[4]=b*V,n[5]=z*V,n[6]=D*V,n[7]=Y*V,n[8]=re*V,n[9]=se*V,n[10]=ee*V,n[11]=fe*V,n[12]=he*V,n[13]=me*V,n[14]=de*V,n[15]=pe*V,n};_.inverseTransformation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[1],i=e[2],r=e[4],a=e[5],u=e[6],d=e[8],m=e[9],l=e[10],w=e[12],E=e[13],T=e[14],M=-t*w-o*E-i*T,v=-r*w-a*E-u*T,I=-d*w-m*E-l*T;return n[0]=t,n[1]=r,n[2]=d,n[3]=0,n[4]=o,n[5]=a,n[6]=m,n[7]=0,n[8]=i,n[9]=u,n[10]=l,n[11]=0,n[12]=M,n[13]=v,n[14]=I,n[15]=1,n};var Wo=new _;_.inverseTranspose=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),_.inverse(_.transpose(e,Wo),n)};_.IDENTITY=Object.freeze(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));_.ZERO=Object.freeze(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));_.COLUMN0ROW0=0;_.COLUMN0ROW1=1;_.COLUMN0ROW2=2;_.COLUMN0ROW3=3;_.COLUMN1ROW0=4;_.COLUMN1ROW1=5;_.COLUMN1ROW2=6;_.COLUMN1ROW3=7;_.COLUMN2ROW0=8;_.COLUMN2ROW1=9;_.COLUMN2ROW2=10;_.COLUMN2ROW3=11;_.COLUMN3ROW0=12;_.COLUMN3ROW1=13;_.COLUMN3ROW2=14;_.COLUMN3ROW3=15;Object.defineProperties(_.prototype,{length:{get:function(){return _.packedLength}}});_.prototype.clone=function(e){return _.clone(this,e)};_.prototype.equals=function(e){return _.equals(this,e)};_.equalsArray=function(e,n,t){return e[0]===n[t]&&e[1]===n[t+1]&&e[2]===n[t+2]&&e[3]===n[t+3]&&e[4]===n[t+4]&&e[5]===n[t+5]&&e[6]===n[t+6]&&e[7]===n[t+7]&&e[8]===n[t+8]&&e[9]===n[t+9]&&e[10]===n[t+10]&&e[11]===n[t+11]&&e[12]===n[t+12]&&e[13]===n[t+13]&&e[14]===n[t+14]&&e[15]===n[t+15]};_.prototype.equalsEpsilon=function(e,n){return _.equalsEpsilon(this,e,n)};_.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 J=_;function vt(e,n,t){t=t??!1;let o={},i=p(e),r=p(n),a,u,d;if(i)for(a in e)e.hasOwnProperty(a)&&(u=e[a],r&&t&&typeof u=="object"&&n.hasOwnProperty(a)?(d=n[a],typeof d=="object"?o[a]=vt(u,d,t):o[a]=u):o[a]=u);if(r)for(a in n)n.hasOwnProperty(a)&&!o.hasOwnProperty(a)&&(d=n[a],o[a]=d);return o}var De=vt;function Ho(e,n,t){s.defined("array",e),s.defined("itemToFind",n),s.defined("comparator",t);let o=0,i=e.length-1,r,a;for(;o<=i;){if(r=~~((o+i)/2),a=t(e[r],n),a<0){o=r+1;continue}if(a>0){i=r-1;continue}return r}return~(i+1)}var Be=Ho;function $o(e,n,t,o,i){this.xPoleWander=e,this.yPoleWander=n,this.xPoleOffset=t,this.yPoleOffset=o,this.ut1MinusUtc=i}var hn=$o;function Yo(e){if(e===null||isNaN(e))throw new A("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var dn=Yo;var At=[31,28,31,30,31,30,31,31,30,31,30,31];function Vo(e,n,t,o,i,r,a,u){e=e??1,n=n??1,t=t??1,o=o??0,i=i??0,r=r??0,a=a??0,u=u??!1,v(),I(),this.year=e,this.month=n,this.day=t,this.hour=o,this.minute=i,this.second=r,this.millisecond=a,this.isLeapSecond=u;function v(){s.typeOf.number.greaterThanOrEquals("Year",e,1),s.typeOf.number.lessThanOrEquals("Year",e,9999),s.typeOf.number.greaterThanOrEquals("Month",n,1),s.typeOf.number.lessThanOrEquals("Month",n,12),s.typeOf.number.greaterThanOrEquals("Day",t,1),s.typeOf.number.lessThanOrEquals("Day",t,31),s.typeOf.number.greaterThanOrEquals("Hour",o,0),s.typeOf.number.lessThanOrEquals("Hour",o,23),s.typeOf.number.greaterThanOrEquals("Minute",i,0),s.typeOf.number.lessThanOrEquals("Minute",i,59),s.typeOf.bool("IsLeapSecond",u),s.typeOf.number.greaterThanOrEquals("Second",r,0),s.typeOf.number.lessThanOrEquals("Second",r,u?60:59),s.typeOf.number.greaterThanOrEquals("Millisecond",a,0),s.typeOf.number.lessThan("Millisecond",a,1e3)}function I(){let N=n===2&&dn(e)?At[n-1]+1:At[n-1];if(t>N)throw new A("Month and Day represents invalid date")}}var Tn=Vo;function Xo(e,n){this.julianDate=e,this.offset=n}var ne=Xo;var Zo={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},ie=Object.freeze(Zo);var Jo={UTC:0,TAI:1},H=Object.freeze(Jo);var Mt=new Tn,Cn=[31,28,31,30,31,30,31,31,30,31,30,31],vn=29;function Kn(e,n){return U.compare(e.julianDate,n.julianDate)}var Ke=new ne;function jn(e){Ke.julianDate=e;let n=U.leapSeconds,t=Be(n,Ke,Kn);t<0&&(t=~t),t>=n.length&&(t=n.length-1);let o=n[t].offset;t>0&&U.secondsDifference(n[t].julianDate,e)>o&&(t--,o=n[t].offset),U.addSeconds(e,o,e)}function jt(e,n){Ke.julianDate=e;let t=U.leapSeconds,o=Be(t,Ke,Kn);if(o<0&&(o=~o),o===0)return U.addSeconds(e,-t[0].offset,n);if(o>=t.length)return U.addSeconds(e,-t[o-1].offset,n);let i=U.secondsDifference(t[o].julianDate,e);if(i===0)return U.addSeconds(e,-t[o].offset,n);if(!(i<=1))return U.addSeconds(e,-t[--o].offset,n)}function Ne(e,n,t){let o=n/ie.SECONDS_PER_DAY|0;return e+=o,n-=ie.SECONDS_PER_DAY*o,n<0&&(e--,n+=ie.SECONDS_PER_DAY),t.dayNumber=e,t.secondsOfDay=n,t}function et(e,n,t,o,i,r,a){let u=(n-14)/12|0,d=e+4800+u,m=(1461*d/4|0)+(367*(n-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+t-32075;o=o-12,o<0&&(o+=24);let l=r+(o*ie.SECONDS_PER_HOUR+i*ie.SECONDS_PER_MINUTE+a*ie.SECONDS_PER_MILLISECOND);return l>=43200&&(m-=1),[m,l]}var Go=/^(\d{4})$/,Ko=/^(\d{4})-(\d{2})$/,er=/^(\d{4})-?(\d{3})$/,nr=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,tr=/^(\d{4})-?(\d{2})-?(\d{2})$/,nt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,or=/^(\d{2})(\.\d+)?/.source+nt.source,rr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+nt.source,ir=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+nt.source,Re="Invalid ISO 8601 date.";function U(e,n,t){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,n=n??0,t=t??H.UTC;let o=e|0;n=n+(e-o)*ie.SECONDS_PER_DAY,Ne(o,n,this),t===H.UTC&&jn(this)}U.fromGregorianDate=function(e,n){if(!(e instanceof Tn))throw new A("date must be a valid GregorianDate.");let t=et(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(n)?(Ne(t[0],t[1],n),jn(n),n):new U(t[0],t[1],H.UTC)};U.fromDate=function(e,n){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let t=et(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(n)?(Ne(t[0],t[1],n),jn(n),n):new U(t[0],t[1],H.UTC)};U.fromIso8601=function(e,n){if(typeof e!="string")throw new A(Re);e=e.replace(",",".");let t=e.split("T"),o,i=1,r=1,a=0,u=0,d=0,m=0,l=t[0],w=t[1],E,T;if(!p(l))throw new A(Re);let M;if(t=l.match(tr),t!==null){if(M=l.split("-").length-1,M>0&&M!==2)throw new A(Re);o=+t[1],i=+t[2],r=+t[3]}else if(t=l.match(Ko),t!==null)o=+t[1],i=+t[2];else if(t=l.match(Go),t!==null)o=+t[1];else{let F;if(t=l.match(er),t!==null){if(o=+t[1],F=+t[2],T=dn(o),F<1||T&&F>366||!T&&F>365)throw new A(Re)}else if(t=l.match(nr),t!==null){o=+t[1];let k=+t[2],x=+t[3]||0;if(M=l.split("-").length-1,M>0&&(!p(t[3])&&M!==1||p(t[3])&&M!==2))throw new A(Re);let Q=new Date(Date.UTC(o,0,4));F=k*7+x-Q.getUTCDay()-3}else throw new A(Re);E=new Date(Date.UTC(o,0,1)),E.setUTCDate(F),i=E.getUTCMonth()+1,r=E.getUTCDate()}if(T=dn(o),i<1||i>12||r<1||(i!==2||!T)&&r>Cn[i-1]||T&&i===2&&r>vn)throw new A(Re);let v;if(p(w)){if(t=w.match(ir),t!==null){if(M=w.split(":").length-1,M>0&&M!==2&&M!==3)throw new A(Re);a=+t[1],u=+t[2],d=+t[3],m=+(t[4]||0)*1e3,v=5}else if(t=w.match(rr),t!==null){if(M=w.split(":").length-1,M>2)throw new A(Re);a=+t[1],u=+t[2],d=+(t[3]||0)*60,v=4}else if(t=w.match(or),t!==null)a=+t[1],u=+(t[2]||0)*60,v=3;else throw new A(Re);if(u>=60||d>=61||a>24||a===24&&(u>0||d>0||m>0))throw new A(Re);let F=t[v],k=+t[v+1],x=+(t[v+2]||0);switch(F){case"+":a=a-k,u=u-x;break;case"-":a=a+k,u=u+x;break;case"Z":break;default:u=u+new Date(Date.UTC(o,i-1,r,a,u)).getTimezoneOffset();break}}let I=d===60;for(I&&d--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,r++;for(E=T&&i===2?vn:Cn[i-1];r>E;)r-=E,i++,i>12&&(i-=12,o++),E=T&&i===2?vn:Cn[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)i--,i<1&&(i+=12,o--),E=T&&i===2?vn:Cn[i-1],r+=E;let N=et(o,i,r,a,u,d,m);return p(n)?(Ne(N[0],N[1],n),jn(n)):n=new U(N[0],N[1],H.UTC),I&&U.addSeconds(n,1,n),n};U.now=function(e){return U.fromDate(new Date,e)};var An=new U(0,0,H.TAI);U.toGregorianDate=function(e,n){if(!p(e))throw new A("julianDate is required.");let t=!1,o=jt(e,An);p(o)||(U.addSeconds(e,-1,An),o=jt(An,An),t=!0);let i=o.dayNumber,r=o.secondsOfDay;r>=43200&&(i+=1);let a=i+68569|0,u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let m=80*a/2447|0,l=a-(2447*m/80|0)|0;a=m/11|0;let w=m+2-12*a|0,E=100*(u-49)+d+a|0,T=r/ie.SECONDS_PER_HOUR|0,M=r-T*ie.SECONDS_PER_HOUR,v=M/ie.SECONDS_PER_MINUTE|0;M=M-v*ie.SECONDS_PER_MINUTE;let I=M|0,N=(M-I)/ie.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),t&&(I+=1),p(n)?(n.year=E,n.month=w,n.day=l,n.hour=T,n.minute=v,n.second=I,n.millisecond=N,n.isLeapSecond=t,n):new Tn(E,w,l,T,v,I,N,t)};U.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let n=U.toGregorianDate(e,Mt),t=n.second;return n.isLeapSecond&&(t-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,t,n.millisecond))};U.toIso8601=function(e,n){if(!p(e))throw new A("julianDate is required.");let t=U.toGregorianDate(e,Mt),o=t.year,i=t.month,r=t.day,a=t.hour,u=t.minute,d=t.second,m=t.millisecond;o===1e4&&i===1&&r===1&&a===0&&u===0&&d===0&&m===0&&(o=9999,i=12,r=31,a=24);let l;if(!p(n)&&m!==0){let w=m*.01;return l=w<1e-6?w.toFixed(20).replace(".","").replace(/0+$/,""):w.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`}return!p(n)||n===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(l=(m*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${l}Z`)};U.clone=function(e,n){if(p(e))return p(n)?(n.dayNumber=e.dayNumber,n.secondsOfDay=e.secondsOfDay,n):new U(e.dayNumber,e.secondsOfDay,H.TAI)};U.compare=function(e,n){if(!p(e))throw new A("left is required.");if(!p(n))throw new A("right is required.");let t=e.dayNumber-n.dayNumber;return t!==0?t:e.secondsOfDay-n.secondsOfDay};U.equals=function(e,n){return e===n||p(e)&&p(n)&&e.dayNumber===n.dayNumber&&e.secondsOfDay===n.secondsOfDay};U.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(U.secondsDifference(e,n))<=t};U.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ie.SECONDS_PER_DAY};U.secondsDifference=function(e,n){if(!p(e))throw new A("left is required.");if(!p(n))throw new A("right is required.");return(e.dayNumber-n.dayNumber)*ie.SECONDS_PER_DAY+(e.secondsOfDay-n.secondsOfDay)};U.daysDifference=function(e,n){if(!p(e))throw new A("left is required.");if(!p(n))throw new A("right is required.");let t=e.dayNumber-n.dayNumber,o=(e.secondsOfDay-n.secondsOfDay)/ie.SECONDS_PER_DAY;return t+o};U.computeTaiMinusUtc=function(e){Ke.julianDate=e;let n=U.leapSeconds,t=Be(n,Ke,Kn);return t<0&&(t=~t,--t,t<0&&(t=0)),n[t].offset};U.addSeconds=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("seconds is required.");if(!p(t))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+n,t)};U.addMinutes=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("minutes is required.");if(!p(t))throw new A("result is required.");let o=e.secondsOfDay+n*ie.SECONDS_PER_MINUTE;return Ne(e.dayNumber,o,t)};U.addHours=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("hours is required.");if(!p(t))throw new A("result is required.");let o=e.secondsOfDay+n*ie.SECONDS_PER_HOUR;return Ne(e.dayNumber,o,t)};U.addDays=function(e,n,t){if(!p(e))throw new A("julianDate is required.");if(!p(n))throw new A("days is required.");if(!p(t))throw new A("result is required.");let o=e.dayNumber+n;return Ne(o,e.secondsOfDay,t)};U.lessThan=function(e,n){return U.compare(e,n)<0};U.lessThanOrEquals=function(e,n){return U.compare(e,n)<=0};U.greaterThan=function(e,n){return U.compare(e,n)>0};U.greaterThanOrEquals=function(e,n){return U.compare(e,n)>=0};U.prototype.clone=function(e){return U.clone(this,e)};U.prototype.equals=function(e){return U.equals(this,e)};U.prototype.equalsEpsilon=function(e,n){return U.equalsEpsilon(this,e,n)};U.prototype.toString=function(){return U.toIso8601(this)};U.leapSeconds=[new ne(new U(2441317,43210,H.TAI),10),new ne(new U(2441499,43211,H.TAI),11),new ne(new U(2441683,43212,H.TAI),12),new ne(new U(2442048,43213,H.TAI),13),new ne(new U(2442413,43214,H.TAI),14),new ne(new U(2442778,43215,H.TAI),15),new ne(new U(2443144,43216,H.TAI),16),new ne(new U(2443509,43217,H.TAI),17),new ne(new U(2443874,43218,H.TAI),18),new ne(new U(2444239,43219,H.TAI),19),new ne(new U(2444786,43220,H.TAI),20),new ne(new U(2445151,43221,H.TAI),21),new ne(new U(2445516,43222,H.TAI),22),new ne(new U(2446247,43223,H.TAI),23),new ne(new U(2447161,43224,H.TAI),24),new ne(new U(2447892,43225,H.TAI),25),new ne(new U(2448257,43226,H.TAI),26),new ne(new U(2448804,43227,H.TAI),27),new ne(new U(2449169,43228,H.TAI),28),new ne(new U(2449534,43229,H.TAI),29),new ne(new U(2450083,43230,H.TAI),30),new ne(new U(2450630,43231,H.TAI),31),new ne(new U(2451179,43232,H.TAI),32),new ne(new U(2453736,43233,H.TAI),33),new ne(new U(2454832,43234,H.TAI),34),new ne(new U(2456109,43235,H.TAI),35),new ne(new U(2457204,43236,H.TAI),36),new ne(new U(2457754,43237,H.TAI),37)];var ue=U;var co=Ze(Qe(),1);function cr(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var Nt=cr;function kt(e,n){if(e===null||typeof e!="object")return e;n=n??!1;let t=new e.constructor;for(let o in e)if(e.hasOwnProperty(o)){let i=e[o];n&&(i=kt(i,n)),t[o]=i}return t}var tn=kt;function sr(){let e,n,t=new Promise(function(o,i){e=o,n=i});return{resolve:e,reject:n,promise:t}}var We=sr;var Ft=Ze(Qe(),1);function tt(e,n){let t;return typeof document<"u"&&(t=document),tt._implementation(e,n,t)}tt._implementation=function(e,n,t){if(!p(e))throw new A("relative uri is required.");if(!p(n)){if(typeof t>"u")return e;n=t.baseURI??t.location.href}let o=new Ft.default(e);return o.scheme()!==""?o.toString():o.absoluteTo(n).toString()};var mn=tt;var Lt=Ze(Qe(),1);function ar(e,n){if(!p(e))throw new A("uri is required.");let t="",o=e.lastIndexOf("/");return o!==-1&&(t=e.substring(0,o+1)),n&&(e=new Lt.default(e),e.query().length!==0&&(t+=`?${e.query()}`),e.fragment().length!==0&&(t+=`#${e.fragment()}`)),t}var xt=ar;var Bt=Ze(Qe(),1);function fr(e){if(!p(e))throw new A("uri is required.");let n=new Bt.default(e);n.normalize();let t=n.path(),o=t.lastIndexOf("/");return o!==-1&&(t=t.substr(o+1)),o=t.lastIndexOf("."),o===-1?t="":t=t.substr(o+1),t}var Qt=fr;var Wt={};function ur(e,n,t){p(n)||(n=e.width),p(t)||(t=e.height);let o=Wt[n];p(o)||(o={},Wt[n]=o);let i=o[t];if(!p(i)){let r=document.createElement("canvas");r.width=n,r.height=t,i=r.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[t]=i}return i.drawImage(e,0,0,n,t),i.getImageData(0,0,n,t).data}var ot=ur;var pr=/^blob:/i;function hr(e){return s.typeOf.string("uri",e),pr.test(e)}var zn=hr;var Ce;function dr(e){p(Ce)||(Ce=document.createElement("a")),Ce.href=window.location.href;let n=Ce.host,t=Ce.protocol;return Ce.href=e,Ce.href=Ce.href,t!==Ce.protocol||n!==Ce.host}var Ht=dr;var mr=/^data:/i;function yr(e){return s.typeOf.string("uri",e),mr.test(e)}var In=yr;function lr(e){let n=document.createElement("script");return n.async=!0,n.src=e,new Promise((t,o)=>{window.crossOriginIsolated&&n.setAttribute("crossorigin","anonymous");let i=document.getElementsByTagName("head")[0];n.onload=function(){n.onload=void 0,i.removeChild(n),t()},n.onerror=function(r){o(r)},i.appendChild(n)})}var $t=lr;function wr(e){if(!p(e))throw new A("obj is required.");let n="";for(let t in e)if(e.hasOwnProperty(t)){let o=e[t],i=`${encodeURIComponent(t)}=`;if(Array.isArray(o))for(let r=0,a=o.length;r<a;++r)n+=`${i+encodeURIComponent(o[r])}&`;else n+=`${i+encodeURIComponent(o)}&`}return n=n.slice(0,-1),n}var Yt=wr;function br(e){if(!p(e))throw new A("queryString is required.");let n={};if(e==="")return n;let t=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=t.length;o<i;++o){let r=t[o].split("="),a=decodeURIComponent(r[0]),u=r[1];p(u)?u=decodeURIComponent(u):u="";let d=n[a];typeof d=="string"?n[a]=[d,u]:Array.isArray(d)?d.push(u):n[a]=u}return n}var Vt=br;var Or={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ae=Object.freeze(Or);var gr={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Xt=Object.freeze(gr);function qn(e){e=e??_e.EMPTY_OBJECT;let n=e.throttleByServer??!1,t=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=t,this.throttleByServer=n,this.type=e.type??Xt.OTHER,this.serverKey=e.serverKey,this.state=ae.UNISSUED,this.deferred=void 0,this.cancelled=!1}qn.prototype.cancel=function(){this.cancelled=!0};qn.prototype.clone=function(e){return p(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=ae.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new qn(this)};var Zt=qn;function _r(e){let n={};if(!e)return n;let t=e.split(`\r -`);for(let o=0;o<t.length;++o){let i=t[o],r=i.indexOf(": ");if(r>0){let a=i.substring(0,r),u=i.substring(r+2);n[a]=u}}return n}var Jt=_r;function Gt(e,n,t){this.statusCode=e,this.response=n,this.responseHeaders=t,typeof this.responseHeaders=="string"&&(this.responseHeaders=Jt(this.responseHeaders))}Gt.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var yn=Gt;var Dn=Ze(Qe(),1);function ln(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(ln.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});ln.prototype.addEventListener=function(e,n){s.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(n);let t=this;return function(){t.removeEventListener(e,n)}};ln.prototype.removeEventListener=function(e,n){s.typeOf.func("listener",e);let t=this._listeners,o=this._scopes,i=-1;for(let r=0;r<t.length;r++)if(t[r]===e&&o[r]===n){i=r;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),t[i]=void 0,o[i]=void 0):(t.splice(i,1),o.splice(i,1)),!0):!1};function Sr(e,n){return n-e}ln.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,n=this._listeners,t=this._scopes,o=n.length;for(e=0;e<o;e++){let r=n[e];p(r)&&n[e].apply(t[e],arguments)}let i=this._toRemove;if(o=i.length,o>0){for(i.sort(Sr),e=0;e<o;e++){let r=i[e];n.splice(r,1),t.splice(r,1)}i.length=0}this._insideRaiseEvent=!1};var Kt=ln;function He(e){s.typeOf.object("options",e),s.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){s.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let n=this._length;if(e<n){let t=this._array;for(let o=e;o<n;++o)t[o]=void 0;this._length=e,t.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function rt(e,n,t){let o=e[n];e[n]=e[t],e[t]=o}He.prototype.reserve=function(e){e=e??this._length,this._array.length=e};He.prototype.heapify=function(e){e=e??0;let n=this._length,t=this._comparator,o=this._array,i=-1,r=!0;for(;r;){let a=2*(e+1),u=a-1;u<n&&t(o[u],o[e])<0?i=u:i=e,a<n&&t(o[a],o[i])<0&&(i=a),i!==e?(rt(o,i,e),e=i):r=!1}};He.prototype.resort=function(){let e=this._length;for(let n=Math.ceil(e/2);n>=0;--n)this.heapify(n)};He.prototype.insert=function(e){s.defined("element",e);let n=this._array,t=this._comparator,o=this._maximumLength,i=this._length++;for(i<n.length?n[i]=e:n.push(e);i!==0;){let a=Math.floor((i-1)/2);if(t(n[i],n[a])<0)rt(n,i,a),i=a;else break}let r;return p(o)&&this._length>o&&(r=n[o],this._length=o),r};He.prototype.pop=function(e){if(e=e??0,this._length===0)return;s.typeOf.number.lessThan("index",e,this._length);let n=this._array,t=n[e];return rt(n,e,--this._length),this.heapify(e),n[this._length]=void 0,t};var eo=He;function Rr(e,n){return e.priority-n.priority}var G={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},on=20,le=new eo({comparator:Rr});le.maximumLength=on;le.reserve(on);var ve=[],Pe={},Er=typeof document<"u"?new Dn.default(document.location.href):new Dn.default,Nn=new Kt;function ce(){}ce.maximumRequests=50;ce.maximumRequestsPerServer=18;ce.requestsByServer={};ce.throttleRequests=!0;ce.debugShowStatistics=!1;ce.requestCompletedEvent=Nn;Object.defineProperties(ce,{statistics:{get:function(){return G}},priorityHeapLength:{get:function(){return on},set:function(e){if(e<on)for(;le.length>e;){let n=le.pop();$e(n)}on=e,le.maximumLength=e,le.reserve(e)}}});function no(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}ce.serverHasOpenSlots=function(e,n){n=n??1;let t=ce.requestsByServer[e]??ce.maximumRequestsPerServer;return Pe[e]+n<=t};ce.heapHasOpenSlots=function(e){return le.length+e<=on};function to(e){return e.state===ae.UNISSUED&&(e.state=ae.ISSUED,e.deferred=We()),e.deferred.promise}function Tr(e){return function(n){if(e.state===ae.CANCELLED)return;let t=e.deferred;--G.numberOfActiveRequests,--Pe[e.serverKey],Nn.raiseEvent(),e.state=ae.RECEIVED,e.deferred=void 0,t.resolve(n)}}function Cr(e){return function(n){e.state!==ae.CANCELLED&&(++G.numberOfFailedRequests,--G.numberOfActiveRequests,--Pe[e.serverKey],Nn.raiseEvent(n),e.state=ae.FAILED,e.deferred.reject(n))}}function oo(e){let n=to(e);return e.state=ae.ACTIVE,ve.push(e),++G.numberOfActiveRequests,++G.numberOfActiveRequestsEver,++Pe[e.serverKey],e.requestFunction().then(Tr(e)).catch(Cr(e)),n}function $e(e){let n=e.state===ae.ACTIVE;if(e.state=ae.CANCELLED,++G.numberOfCancelledRequests,p(e.deferred)){let t=e.deferred;e.deferred=void 0,t.reject()}n&&(--G.numberOfActiveRequests,--Pe[e.serverKey],++G.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}ce.update=function(){let e,n,t=0,o=ve.length;for(e=0;e<o;++e){if(n=ve[e],n.cancelled&&$e(n),n.state!==ae.ACTIVE){++t;continue}t>0&&(ve[e-t]=n)}ve.length-=t;let i=le.internalArray,r=le.length;for(e=0;e<r;++e)no(i[e]);le.resort();let a=Math.max(ce.maximumRequests-ve.length,0),u=0;for(;u<a&&le.length>0;){if(n=le.pop(),n.cancelled){$e(n);continue}if(n.throttleByServer&&!ce.serverHasOpenSlots(n.serverKey)){$e(n);continue}oo(n),++u}vr()};ce.getServerKey=function(e){s.typeOf.string("url",e);let n=new Dn.default(e);n.scheme()===""&&(n=n.absoluteTo(Er),n.normalize());let t=n.authority();/:/.test(t)||(t=`${t}:${n.scheme()==="https"?"443":"80"}`);let o=Pe[t];return p(o)||(Pe[t]=0),t};ce.request=function(e){if(s.typeOf.object("request",e),s.typeOf.string("request.url",e.url),s.typeOf.func("request.requestFunction",e.requestFunction),In(e.url)||zn(e.url))return Nn.raiseEvent(),e.state=ae.RECEIVED,e.requestFunction();if(++G.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=ce.getServerKey(e.url)),ce.throttleRequests&&e.throttleByServer&&!ce.serverHasOpenSlots(e.serverKey))return;if(!ce.throttleRequests||!e.throttle)return oo(e);if(ve.length>=ce.maximumRequests)return;no(e);let n=le.insert(e);if(p(n)){if(n===e)return;$e(n)}return to(e)};function vr(){ce.debugShowStatistics&&(G.numberOfActiveRequests===0&&G.lastNumberOfActiveRequests>0&&(G.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${G.numberOfAttemptedRequests}`),G.numberOfAttemptedRequests=0),G.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${G.numberOfCancelledRequests}`),G.numberOfCancelledRequests=0),G.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${G.numberOfCancelledActiveRequests}`),G.numberOfCancelledActiveRequests=0),G.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${G.numberOfFailedRequests}`),G.numberOfFailedRequests=0)),G.lastNumberOfActiveRequests=G.numberOfActiveRequests)}ce.clearForSpecs=function(){for(;le.length>0;){let n=le.pop();$e(n)}let e=ve.length;for(let n=0;n<e;++n)$e(ve[n]);ve.length=0,Pe={},G.numberOfAttemptedRequests=0,G.numberOfActiveRequests=0,G.numberOfCancelledRequests=0,G.numberOfCancelledActiveRequests=0,G.numberOfFailedRequests=0,G.numberOfActiveRequestsEver=0,G.lastNumberOfActiveRequests=0};ce.numberOfActiveRequestsByServer=function(e){return Pe[e]};ce.requestHeap=le;var kn=ce;var ro=Ze(Qe(),1);var wn={},rn={};wn.add=function(e,n){if(!p(e))throw new A("host is required.");if(!p(n)||n<=0)throw new A("port is required to be greater than 0.");let t=`${e.toLowerCase()}:${n}`;p(rn[t])||(rn[t]=!0)};wn.remove=function(e,n){if(!p(e))throw new A("host is required.");if(!p(n)||n<=0)throw new A("port is required to be greater than 0.");let t=`${e.toLowerCase()}:${n}`;p(rn[t])&&delete rn[t]};function Ar(e){let n=new ro.default(e);n.normalize();let t=n.authority();if(t.length!==0){if(n.authority(t),t.indexOf("@")!==-1&&(t=t.split("@")[1]),t.indexOf(":")===-1){let o=n.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")t+=":80";else if(o==="https")t+=":443";else return}return t}}wn.contains=function(e){if(!p(e))throw new A("url is required.");let n=Ar(e);return!!(p(n)&&p(rn[n]))};wn.clear=function(){rn={}};var it=wn;var so=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function P(e){e=e??_e.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),s.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=e.request??new Zt,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ae(e,n){return p(e)?tn(e):n}P.createIfNeeded=function(e){return e instanceof P?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new P({url:e})};var cn;P.supportsImageBitmapOptions=function(){return p(cn)?cn:typeof createImageBitmap!="function"?(cn=Promise.resolve(!1),cn):(cn=P.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(n){let t={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(n,t),createImageBitmap(n)])}).then(function(n){let t=ot(n[0]),o=ot(n[1]);return t[1]!==o[1]}).catch(function(){return!1}),cn)};Object.defineProperties(P,{isBlobSupported:{get:function(){return so}}});Object.defineProperties(P.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 Qt(this._url)}},isDataUri:{get:function(){return In(this._url)}},isBlobUri:{get:function(){return zn(this._url)}},isCrossOriginUrl:{get:function(){return Ht(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});P.prototype.toString=function(){return this.getUrlComponent(!0,!0)};P.prototype.parseUrl=function(e,n,t,o){let i=new co.default(e),r=jr(i.query());this._queryParameters=n?Ln(r,this.queryParameters,t):r,i.search(""),i.fragment(""),p(o)&&i.scheme()===""&&(i=i.absoluteTo(mn(o))),this._url=i.toString()};function jr(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Vt(e)}function Ln(e,n,t){if(!t)return De(e,n);let o=tn(e,!0);for(let i in n)if(n.hasOwnProperty(i)){let r=o[i],a=n[i];p(r)?(Array.isArray(r)||(r=o[i]=[r]),o[i]=r.concat(a)):o[i]=Array.isArray(a)?a.slice():a}return o}P.prototype.getUrlComponent=function(e,n){if(this.isDataUri)return this._url;let t=this._url;e&&(t=`${t}${Mr(this.queryParameters)}`),t=t.replace(/%7B/g,"{").replace(/%7D/g,"}");let o=this._templateValues;return Object.keys(o).length>0&&(t=t.replace(/{(.*?)}/g,function(i,r){let a=o[r];return p(a)?encodeURIComponent(a):i})),n&&p(this.proxy)&&(t=this.proxy.getURL(t)),t};function Mr(e){let n=Object.keys(e);return n.length===0?"":n.length===1&&!p(e[n[0]])?`?${n[0]}`:`?${Yt(e)}`}P.prototype.setQueryParameters=function(e,n){n?this._queryParameters=Ln(this._queryParameters,e,!1):this._queryParameters=Ln(e,this._queryParameters,!1)};P.prototype.appendQueryParameters=function(e){this._queryParameters=Ln(e,this._queryParameters,!0)};P.prototype.setTemplateValues=function(e,n){n?this._templateValues=De(this._templateValues,e):this._templateValues=De(e,this._templateValues)};P.prototype.getDerivedResource=function(e){let n=this.clone();if(n._retryCount=0,p(e.url)){let t=e.preserveQueryParameters??!1;n.parseUrl(e.url,!0,t,this._url)}return p(e.queryParameters)&&(n._queryParameters=De(e.queryParameters,n.queryParameters)),p(e.templateValues)&&(n._templateValues=De(e.templateValues,n.templateValues)),p(e.headers)&&(n.headers=De(e.headers,n.headers)),p(e.proxy)&&(n.proxy=e.proxy),p(e.request)&&(n.request=e.request),p(e.retryCallback)&&(n.retryCallback=e.retryCallback),p(e.retryAttempts)&&(n.retryAttempts=e.retryAttempts),n};P.prototype.retryOnError=function(e){let n=this.retryCallback;if(typeof n!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let t=this;return Promise.resolve(n(this,e)).then(function(o){return++t._retryCount,o})};P.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=tn(this._queryParameters),e._templateValues=tn(this._templateValues),e.headers=tn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new P({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:p(this.credits)?this.credits.slice():void 0})};P.prototype.getBaseUri=function(e){return xt(this.getUrlComponent(e),e)};P.prototype.appendForwardSlash=function(){this._url=Nt(this._url)};P.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};P.fetchArrayBuffer=function(e){return new P(e).fetchArrayBuffer()};P.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};P.fetchBlob=function(e){return new P(e).fetchBlob()};P.prototype.fetchImage=function(e){e=e??_e.EMPTY_OBJECT;let n=e.preferImageBitmap??!1,t=e.preferBlob??!1,o=e.flipY??!1,i=e.skipColorSpaceConversion??!1;if(st(this.request),!so||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!t)return ct({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:n});let r=this.fetchBlob();if(!p(r))return;let a,u,d,m;return P.supportsImageBitmapOptions().then(function(l){return a=l,u=a&&n,r}).then(function(l){if(!p(l))return;if(m=l,u)return P.createImageBitmapFromBlob(l,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});let w=window.URL.createObjectURL(l);return d=new P({url:w}),ct({resource:d,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(l){if(p(l))return l.blob=m,u||window.URL.revokeObjectURL(d.url),l}).catch(function(l){return p(d)&&window.URL.revokeObjectURL(d.url),l.blob=m,Promise.reject(l)})};function ct(e){let n=e.resource,t=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,r=n.request;r.url=n.url,r.requestFunction=function(){let u=!1;!n.isDataUri&&!n.isBlobUri&&(u=n.isCrossOriginUrl);let d=We();return P._Implementations.createImage(r,u,d,t,o,i),d.promise};let a=kn.request(r);if(p(a))return a.catch(function(u){return r.state!==ae.FAILED?Promise.reject(u):n.retryOnError(u).then(function(d){return d?(r.state=ae.UNISSUED,r.deferred=void 0,ct({resource:n,flipY:t,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(u)})})}P.fetchImage=function(e){return new P(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};P.prototype.fetchText=function(){return this.fetch({responseType:"text"})};P.fetchText=function(e){return new P(e).fetchText()};P.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then(function(n){if(p(n))return JSON.parse(n)})};P.fetchJson=function(e){return new P(e).fetchJson()};P.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};P.fetchXML=function(e){return new P(e).fetchXML()};P.prototype.fetchJsonp=function(e){e=e??"callback",st(this.request);let n;do n=`loadJsonp${R.nextRandomNumber().toString().substring(2,8)}`;while(p(window[n]));return ao(this,e,n)};function ao(e,n,t){let o={};o[n]=t,e.setQueryParameters(o);let i=e.request,r=e.url;i.url=r,i.requestFunction=function(){let u=We();return window[t]=function(d){u.resolve(d);try{delete window[t]}catch{window[t]=void 0}},P._Implementations.loadAndExecuteScript(r,t,u),u.promise};let a=kn.request(i);if(p(a))return a.catch(function(u){return i.state!==ae.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(i.state=ae.UNISSUED,i.deferred=void 0,ao(e,n,t)):Promise.reject(u)})})}P.fetchJsonp=function(e){return new P(e).fetchJsonp(e.callbackParameterName)};P.prototype._makeRequest=function(e){let n=this;st(n.request);let t=n.request,o=n.url;t.url=o,t.requestFunction=function(){let r=e.responseType,a=De(e.headers,n.headers),u=e.overrideMimeType,d=e.method,m=e.data,l=We(),w=P._Implementations.loadWithXhr(o,r,d,m,a,l,u);return p(w)&&p(w.abort)&&(t.cancelFunction=function(){w.abort()}),l.promise};let i=kn.request(t);if(p(i))return i.then(function(r){return t.cancelFunction=void 0,r}).catch(function(r){return t.cancelFunction=void 0,t.state!==ae.FAILED?Promise.reject(r):n.retryOnError(r).then(function(a){return a?(t.state=ae.UNISSUED,t.deferred=void 0,n.fetch(e)):Promise.reject(r)})})};function st(e){if(e.state===ae.ISSUED||e.state===ae.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=ae.UNISSUED,e.deferred=void 0}var Pr=/^data:(.*?)(;base64)?,(.*)$/;function Fn(e,n){let t=decodeURIComponent(n);return e?atob(t):t}function io(e,n){let t=Fn(e,n),o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return o}function Ur(e,n){n=n??"";let t=e[1],o=!!e[2],i=e[3],r,a;switch(n){case"":case"text":return Fn(o,i);case"arraybuffer":return io(o,i);case"blob":return r=io(o,i),new Blob([r],{type:t});case"document":return a=new DOMParser,a.parseFromString(Fn(o,i),t);case"json":return JSON.parse(Fn(o,i));default:throw new A(`Unhandled responseType: ${n}`)}}P.prototype.fetch=function(e){return e=Ae(e,{}),e.method="GET",this._makeRequest(e)};P.fetch=function(e){return new P(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.delete=function(e){return e=Ae(e,{}),e.method="DELETE",this._makeRequest(e)};P.delete=function(e){return new P(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};P.prototype.head=function(e){return e=Ae(e,{}),e.method="HEAD",this._makeRequest(e)};P.head=function(e){return new P(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.options=function(e){return e=Ae(e,{}),e.method="OPTIONS",this._makeRequest(e)};P.options=function(e){return new P(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.post=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="POST",n.data=e,this._makeRequest(n)};P.post=function(e){return new P(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.put=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="PUT",n.data=e,this._makeRequest(n)};P.put=function(e){return new P(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P.prototype.patch=function(e,n){return s.defined("data",e),n=Ae(n,{}),n.method="PATCH",n.data=e,this._makeRequest(n)};P.patch=function(e){return new P(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};P._Implementations={};P._Implementations.loadImageElement=function(e,n,t){let o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),t.resolve(o)},o.onerror=function(i){t.reject(i)},n&&(it.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};P._Implementations.createImage=function(e,n,t,o,i,r){let a=e.url;P.supportsImageBitmapOptions().then(function(u){if(!(u&&r)){P._Implementations.loadImageElement(a,n,t);return}let d="blob",m="GET",l=We(),w=P._Implementations.loadWithXhr(a,d,m,void 0,void 0,l,void 0,void 0,void 0);return p(w)&&p(w.abort)&&(e.cancelFunction=function(){w.abort()}),l.promise.then(function(E){if(!p(E)){t.reject(new Se(`Successfully retrieved ${a} but it contained no content.`));return}return P.createImageBitmapFromBlob(E,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(E){t.resolve(E)})}).catch(function(u){t.reject(u)})};P.createImageBitmapFromBlob=function(e,n){return s.defined("options",n),s.typeOf.bool("options.flipY",n.flipY),s.typeOf.bool("options.premultiplyAlpha",n.premultiplyAlpha),s.typeOf.bool("options.skipColorSpaceConversion",n.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:n.flipY?"flipY":"none",premultiplyAlpha:n.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:n.skipColorSpaceConversion?"none":"default"})};function zr(e,n,t,o,i,r,a){fetch(e,{method:t,headers:i}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((m,l)=>{d[l]=m}),r.reject(new yn(u.status,u,d));return}switch(n){case"text":r.resolve(u.text());break;case"json":r.resolve(u.json());break;default:r.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new yn)})}var Ir=typeof XMLHttpRequest>"u";P._Implementations.loadWithXhr=function(e,n,t,o,i,r,a){let u=Pr.exec(e);if(u!==null){r.resolve(Ur(u,n));return}if(Ir){zr(e,n,t,o,i,r,a);return}let d=new XMLHttpRequest;if(it.contains(e)&&(d.withCredentials=!0),d.open(t,e,!0),p(a)&&p(d.overrideMimeType)&&d.overrideMimeType(a),p(i))for(let l in i)i.hasOwnProperty(l)&&d.setRequestHeader(l,i[l]);p(n)&&(d.responseType=n);let m=!1;return typeof e=="string"&&(m=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(m&&d.status===0)){r.reject(new yn(d.status,d.response,d.getAllResponseHeaders()));return}let l=d.response,w=d.responseType;if(t==="HEAD"||t==="OPTIONS"){let T=d.getAllResponseHeaders().trim().split(/[\r\n]+/),M={};T.forEach(function(v){let I=v.split(": "),N=I.shift();M[N]=I.join(": ")}),r.resolve(M);return}if(d.status===204)r.resolve(void 0);else if(p(l)&&(!p(n)||w===n))r.resolve(l);else if(n==="json"&&typeof l=="string")try{r.resolve(JSON.parse(l))}catch(E){r.reject(E)}else(w===""||w==="document")&&p(d.responseXML)&&d.responseXML.hasChildNodes()?r.resolve(d.responseXML):(w===""||w==="text")&&p(d.responseText)?r.resolve(d.responseText):r.reject(new Se("Invalid XMLHttpRequest response type."))},d.onerror=function(l){r.reject(new yn)},d.send(o),d};P._Implementations.loadAndExecuteScript=function(e,n,t){return $t(e,n).catch(function(o){t.reject(o)})};P._DefaultImplementations={};P._DefaultImplementations.createImage=P._Implementations.createImage;P._DefaultImplementations.loadWithXhr=P._Implementations.loadWithXhr;P._DefaultImplementations.loadAndExecuteScript=P._Implementations.loadAndExecuteScript;P.DEFAULT=Object.freeze(new P({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ke=P;function On(e){e=e??_e.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=e.addNewLeapSeconds??!0,p(e.data)?fo(this,e.data):fo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}On.fromUrl=async function(e,n){s.defined("url",e),n=n??_e.EMPTY_OBJECT;let t=ke.createIfNeeded(e),o;try{o=await t.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${t.url}.`)}return new On({addNewLeapSeconds:n.addNewLeapSeconds,data:o})};On.NONE=Object.freeze({compute:function(e,n){return p(n)?(n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0):n=new hn(0,0,0,0,0),n}});On.prototype.compute=function(e,n){if(!p(this._samples))return;if(p(n)||(n=new hn(0,0,0,0,0)),this._samples.length===0)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;let t=this._dates,o=this._lastIndex,i=0,r=0;if(p(o)){let u=t[o],d=t[o+1],m=ue.lessThanOrEquals(u,e),l=!p(d),w=l||ue.greaterThanOrEquals(d,e);if(m&&w)return i=o,!l&&d.equals(e)&&++i,r=i+1,po(this,t,this._samples,e,i,r,n),n}let a=Be(t,e,ue.compare,this._dateColumn);return a>=0?(a<t.length-1&&t[a+1].equals(e)&&++a,i=a,r=a):(r=~a,i=r-1,i<0&&(i=0)),this._lastIndex=i,po(this,t,this._samples,e,i,r,n),n};function qr(e,n){return ue.compare(e.julianDate,n)}function fo(e,n){if(!p(n.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(n.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let t=n.columnNames.indexOf("modifiedJulianDateUtc"),o=n.columnNames.indexOf("xPoleWanderRadians"),i=n.columnNames.indexOf("yPoleWanderRadians"),r=n.columnNames.indexOf("ut1MinusUtcSeconds"),a=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("taiMinusUtcSeconds");if(t<0||o<0||i<0||r<0||a<0||u<0||d<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let m=e._samples=n.samples,l=e._dates=[];e._dateColumn=t,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=d,e._columnCount=n.columnNames.length,e._lastIndex=void 0;let w,E=e._addNewLeapSeconds;for(let T=0,M=m.length;T<M;T+=e._columnCount){let v=m[T+t],I=m[T+d],N=v+ie.MODIFIED_JULIAN_DATE_DIFFERENCE,F=new ue(N,I,H.TAI);if(l.push(F),E){if(I!==w&&p(w)){let k=ue.leapSeconds,x=Be(k,F,qr);if(x<0){let Q=new ne(F,I);k.splice(~x,0,Q)}}w=I}}}function uo(e,n,t,o,i){let r=t*o;i.xPoleWander=n[r+e._xPoleWanderRadiansColumn],i.yPoleWander=n[r+e._yPoleWanderRadiansColumn],i.xPoleOffset=n[r+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=n[r+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=n[r+e._ut1MinusUtcSecondsColumn]}function bn(e,n,t){return n+e*(t-n)}function po(e,n,t,o,i,r,a){let u=e._columnCount;if(r>n.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let d=n[i],m=n[r];if(d.equals(m)||o.equals(d))return uo(e,t,i,u,a),a;if(o.equals(m))return uo(e,t,r,u,a),a;let l=ue.secondsDifference(o,d)/ue.secondsDifference(m,d),w=i*u,E=r*u,T=t[w+e._ut1MinusUtcSecondsColumn],M=t[E+e._ut1MinusUtcSecondsColumn],v=M-T;if(v>.5||v<-.5){let I=t[w+e._taiMinusUtcSecondsColumn],N=t[E+e._taiMinusUtcSecondsColumn];I!==N&&(m.equals(o)?T=M:M-=N-I)}return a.xPoleWander=bn(l,t[w+e._xPoleWanderRadiansColumn],t[E+e._xPoleWanderRadiansColumn]),a.yPoleWander=bn(l,t[w+e._yPoleWanderRadiansColumn],t[E+e._yPoleWanderRadiansColumn]),a.xPoleOffset=bn(l,t[w+e._xCelestialPoleOffsetRadiansColumn],t[E+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=bn(l,t[w+e._yCelestialPoleOffsetRadiansColumn],t[E+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=bn(l,T,M),a}var ho=On;function we(e,n,t){this.heading=e??0,this.pitch=n??0,this.roll=t??0}we.fromQuaternion=function(e,n){if(!p(e))throw new A("quaternion is required");p(n)||(n=new we);let t=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(a,r),n.roll=Math.atan2(i,o),n.pitch=-R.asinClamped(t),n};we.fromDegrees=function(e,n,t,o){if(!p(e))throw new A("heading is required");if(!p(n))throw new A("pitch is required");if(!p(t))throw new A("roll is required");return p(o)||(o=new we),o.heading=e*R.RADIANS_PER_DEGREE,o.pitch=n*R.RADIANS_PER_DEGREE,o.roll=t*R.RADIANS_PER_DEGREE,o};we.clone=function(e,n){if(p(e))return p(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new we(e.heading,e.pitch,e.roll)};we.equals=function(e,n){return e===n||p(e)&&p(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll};we.equalsEpsilon=function(e,n,t,o){return e===n||p(e)&&p(n)&&R.equalsEpsilon(e.heading,n.heading,t,o)&&R.equalsEpsilon(e.pitch,n.pitch,t,o)&&R.equalsEpsilon(e.roll,n.roll,t,o)};we.prototype.clone=function(e){return we.clone(this,e)};we.prototype.equals=function(e){return we.equals(this,e)};we.prototype.equalsEpsilon=function(e,n,t){return we.equalsEpsilon(this,e,n,t)};we.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var xn=we;var mo=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Dr(){let e=document.getElementsByTagName("script");for(let n=0,t=e.length;n<t;++n){let o=e[n].getAttribute("src"),i=mo.exec(o);if(i!==null)return i[1]}}var Bn;function yo(e){return typeof document>"u"?e:(p(Bn)||(Bn=document.createElement("a")),Bn.href=e,Bn.href)}var Ye;function lo(){if(p(Ye))return Ye;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:p(import.meta?.url)?e=mn(".",import.meta.url):typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Sn.toUrl)?e=mn("..",Ve("Core/buildModuleUrl.js")):e=Dr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ye=new ke({url:yo(e)}),Ye.appendForwardSlash(),Ye}function Nr(e){return yo(Sn.toUrl(`../${e}`))}function wo(e){return lo().getDerivedResource({url:e}).url}var Qn;function Ve(e){return p(Qn)||(typeof define=="object"&&p(define.amd)&&!define.amd.toUrlUndefined&&p(Sn.toUrl)?Qn=Nr:Qn=wo),Qn(e)}Ve._cesiumScriptRegex=mo;Ve._buildModuleUrlFromBaseUrl=wo;Ve._clearBaseResource=function(){Ye=void 0};Ve.setBaseUrl=function(e){Ye=ke.DEFAULT.getDerivedResource({url:e})};Ve.getCesiumBaseUrl=lo;var bo=Ve;function kr(e,n,t){this.x=e,this.y=n,this.s=t}var Wn=kr;function ut(e){e=e??_e.EMPTY_OBJECT,this._xysFileUrlTemplate=ke.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ue(this._sampleZeroJulianEphemerisDate,0,H.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let n=this._interpolationOrder,t=this._denominators=new Array(n+1),o=this._xTable=new Array(n+1),i=Math.pow(this._stepSizeDays,n);for(let r=0;r<=n;++r){t[r]=i,o[r]=r*this._stepSizeDays;for(let a=0;a<=n;++a)a!==r&&(t[r]*=r-a);t[r]=1/t[r]}this._work=new Array(n+1),this._coef=new Array(n+1)}var Fr=new ue(0,0,H.TAI);function at(e,n,t){let o=Fr;return o.dayNumber=n,o.secondsOfDay=t,ue.daysDifference(o,e._sampleZeroDateTT)}ut.prototype.preload=function(e,n,t,o){let i=at(this,e,n),r=at(this,t,o),a=i/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let u=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=a/this._samplesPerXysFile|0,m=u/this._samplesPerXysFile|0,l=[];for(let w=d;w<=m;++w)l.push(ft(this,w));return Promise.all(l)};ut.prototype.computeXysRadians=function(e,n,t){let o=at(this,e,n);if(o<0)return;let i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;let r=this._interpolationOrder,a=i-(r/2|0);a<0&&(a=0);let u=a+r;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-r,a<0&&(a=0));let d=!1,m=this._samples;if(p(m[a*3])||(ft(this,a/this._samplesPerXysFile|0),d=!0),p(m[u*3])||(ft(this,u/this._samplesPerXysFile|0),d=!0),d)return;p(t)?(t.x=0,t.y=0,t.s=0):t=new Wn(0,0,0);let l=o-a*this._stepSizeDays,w=this._work,E=this._denominators,T=this._coef,M=this._xTable,v,I;for(v=0;v<=r;++v)w[v]=l-M[v];for(v=0;v<=r;++v){for(T[v]=1,I=0;I<=r;++I)I!==v&&(T[v]*=w[I]);T[v]*=E[v];let N=(a+v)*3;t.x+=T[v]*m[N++],t.y+=T[v]*m[N++],t.s+=T[v]*m[N]}return t};function ft(e,n){if(e._chunkDownloadsInProgress[n])return e._chunkDownloadsInProgress[n];let t,o=e._xysFileUrlTemplate;p(o)?t=o.getDerivedResource({templateValues:{0:n}}):t=new ke({url:bo(`Assets/IAU2006_XYS/IAU2006_XYS_${n}.json`)});let i=t.fetchJson().then(function(r){e._chunkDownloadsInProgress[n]=!1;let a=e._samples,u=r.samples,d=n*e._samplesPerXysFile*3;for(let m=0,l=u.length;m<l;++m)a[d+m]=u[m]});return e._chunkDownloadsInProgress[n]=i,i}var Oo=ut;function S(e,n,t,o){this.x=e??0,this.y=n??0,this.z=t??0,this.w=o??0}var gn=new g;S.fromAxisAngle=function(e,n,t){s.typeOf.object("axis",e),s.typeOf.number("angle",n);let o=n/2,i=Math.sin(o);gn=g.normalize(e,gn);let r=gn.x*i,a=gn.y*i,u=gn.z*i,d=Math.cos(o);return p(t)?(t.x=r,t.y=a,t.z=u,t.w=d,t):new S(r,a,u,d)};var Lr=[1,2,0],xr=new Array(3);S.fromRotationMatrix=function(e,n){s.typeOf.object("matrix",e);let t,o,i,r,a,u=e[B.COLUMN0ROW0],d=e[B.COLUMN1ROW1],m=e[B.COLUMN2ROW2],l=u+d+m;if(l>0)t=Math.sqrt(l+1),a=.5*t,t=.5/t,o=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*t,i=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*t,r=(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*t;else{let w=Lr,E=0;d>u&&(E=1),m>u&&m>d&&(E=2);let T=w[E],M=w[T];t=Math.sqrt(e[B.getElementIndex(E,E)]-e[B.getElementIndex(T,T)]-e[B.getElementIndex(M,M)]+1);let v=xr;v[E]=.5*t,t=.5/t,a=(e[B.getElementIndex(M,T)]-e[B.getElementIndex(T,M)])*t,v[T]=(e[B.getElementIndex(T,E)]+e[B.getElementIndex(E,T)])*t,v[M]=(e[B.getElementIndex(M,E)]+e[B.getElementIndex(E,M)])*t,o=-v[0],i=-v[1],r=-v[2]}return p(n)?(n.x=o,n.y=i,n.z=r,n.w=a,n):new S(o,i,r,a)};var go=new S,_o=new S,pt=new S,So=new S;S.fromHeadingPitchRoll=function(e,n){return s.typeOf.object("headingPitchRoll",e),So=S.fromAxisAngle(g.UNIT_X,e.roll,go),pt=S.fromAxisAngle(g.UNIT_Y,-e.pitch,n),n=S.multiply(pt,So,pt),_o=S.fromAxisAngle(g.UNIT_Z,-e.heading,go),S.multiply(_o,n,n)};var Hn=new g,ht=new g,Ee=new S,Ro=new S,$n=new S;S.packedLength=4;S.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e.x,n[t++]=e.y,n[t++]=e.z,n[t]=e.w,n};S.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new S),t.x=e[n],t.y=e[n+1],t.z=e[n+2],t.w=e[n+3],t};S.packedInterpolationLength=3;S.convertPackedArrayForInterpolation=function(e,n,t,o){S.unpack(e,t*4,$n),S.conjugate($n,$n);for(let i=0,r=t-n+1;i<r;i++){let a=i*3;S.unpack(e,(n+i)*4,Ee),S.multiply(Ee,$n,Ee),Ee.w<0&&S.negate(Ee,Ee),S.computeAxis(Ee,Hn);let u=S.computeAngle(Ee);p(o)||(o=[]),o[a]=Hn.x*u,o[a+1]=Hn.y*u,o[a+2]=Hn.z*u}};S.unpackInterpolationResult=function(e,n,t,o,i){p(i)||(i=new S),g.fromArray(e,0,ht);let r=g.magnitude(ht);return S.unpack(n,o*4,Ro),r===0?S.clone(S.IDENTITY,Ee):S.fromAxisAngle(ht,r,Ee),S.multiply(Ee,Ro,i)};S.clone=function(e,n){if(p(e))return p(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new S(e.x,e.y,e.z,e.w)};S.conjugate=function(e,n){return s.typeOf.object("quaternion",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=e.w,n};S.magnitudeSquared=function(e){return s.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};S.magnitude=function(e){return Math.sqrt(S.magnitudeSquared(e))};S.normalize=function(e,n){s.typeOf.object("result",n);let t=1/S.magnitude(e),o=e.x*t,i=e.y*t,r=e.z*t,a=e.w*t;return n.x=o,n.y=i,n.z=r,n.w=a,n};S.inverse=function(e,n){s.typeOf.object("result",n);let t=S.magnitudeSquared(e);return n=S.conjugate(e,n),S.multiplyByScalar(n,1/t,n)};S.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x+n.x,t.y=e.y+n.y,t.z=e.z+n.z,t.w=e.w+n.w,t};S.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t.x=e.x-n.x,t.y=e.y-n.y,t.z=e.z-n.z,t.w=e.w-n.w,t};S.negate=function(e,n){return s.typeOf.object("quaternion",e),s.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n};S.dot=function(e,n){return s.typeOf.object("left",e),s.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w};S.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e.x,i=e.y,r=e.z,a=e.w,u=n.x,d=n.y,m=n.z,l=n.w,w=a*u+o*l+i*m-r*d,E=a*d-o*m+i*l+r*u,T=a*m+o*d-i*u+r*l,M=a*l-o*u-i*d-r*m;return t.x=w,t.y=E,t.z=T,t.w=M,t};S.multiplyByScalar=function(e,n,t){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=e.w*n,t};S.divideByScalar=function(e,n,t){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};S.computeAxis=function(e,n){s.typeOf.object("quaternion",e),s.typeOf.object("result",n);let t=e.w;if(Math.abs(t-1)<R.EPSILON6||Math.abs(t+1)<R.EPSILON6)return n.x=1,n.y=n.z=0,n;let o=1/Math.sqrt(1-t*t);return n.x=e.x*o,n.y=e.y*o,n.z=e.z*o,n};S.computeAngle=function(e){return s.typeOf.object("quaternion",e),Math.abs(e.w-1)<R.EPSILON6?0:2*Math.acos(e.w)};var dt=new S;S.lerp=function(e,n,t,o){return s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o),dt=S.multiplyByScalar(n,t,dt),o=S.multiplyByScalar(e,1-t,o),S.add(dt,o,o)};var Eo=new S,mt=new S,yt=new S;S.slerp=function(e,n,t,o){s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o);let i=S.dot(e,n),r=n;if(i<0&&(i=-i,r=Eo=S.negate(n,Eo)),1-i<R.EPSILON6)return S.lerp(e,r,t,o);let a=Math.acos(i);return mt=S.multiplyByScalar(e,Math.sin((1-t)*a),mt),yt=S.multiplyByScalar(r,Math.sin(t*a),yt),o=S.add(mt,yt,o),S.multiplyByScalar(o,1/Math.sin(a),o)};S.log=function(e,n){s.typeOf.object("quaternion",e),s.typeOf.object("result",n);let t=R.acosClamped(e.w),o=0;return t!==0&&(o=t/Math.sin(t)),g.multiplyByScalar(e,o,n)};S.exp=function(e,n){s.typeOf.object("cartesian",e),s.typeOf.object("result",n);let t=g.magnitude(e),o=0;return t!==0&&(o=Math.sin(t)/t),n.x=e.x*o,n.y=e.y*o,n.z=e.z*o,n.w=Math.cos(t),n};var Br=new g,Qr=new g,_n=new S,sn=new S;S.computeInnerQuadrangle=function(e,n,t,o){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("q2",t),s.typeOf.object("result",o);let i=S.conjugate(n,_n);S.multiply(i,t,sn);let r=S.log(sn,Br);S.multiply(i,e,sn);let a=S.log(sn,Qr);return g.add(r,a,r),g.multiplyByScalar(r,.25,r),g.negate(r,r),S.exp(r,_n),S.multiply(n,_n,o)};S.squad=function(e,n,t,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("s0",t),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=S.slerp(e,n,i,_n),u=S.slerp(t,o,i,sn);return S.slerp(a,u,2*i*(1-i),r)};var Wr=new S,To=1.9011074535173003,Yn=un.supportsTypedArrays()?new Float32Array(8):[],Vn=un.supportsTypedArrays()?new Float32Array(8):[],Ue=un.supportsTypedArrays()?new Float32Array(8):[],ze=un.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let n=e+1,t=2*n+1;Yn[e]=1/(n*t),Vn[e]=n/t}Yn[7]=To/(8*17);Vn[7]=To*8/17;S.fastSlerp=function(e,n,t,o){s.typeOf.object("start",e),s.typeOf.object("end",n),s.typeOf.number("t",t),s.typeOf.object("result",o);let i=S.dot(e,n),r;i>=0?r=1:(r=-1,i=-i);let a=i-1,u=1-t,d=t*t,m=u*u;for(let T=7;T>=0;--T)Ue[T]=(Yn[T]*d-Vn[T])*a,ze[T]=(Yn[T]*m-Vn[T])*a;let l=r*t*(1+Ue[0]*(1+Ue[1]*(1+Ue[2]*(1+Ue[3]*(1+Ue[4]*(1+Ue[5]*(1+Ue[6]*(1+Ue[7])))))))),w=u*(1+ze[0]*(1+ze[1]*(1+ze[2]*(1+ze[3]*(1+ze[4]*(1+ze[5]*(1+ze[6]*(1+ze[7])))))))),E=S.multiplyByScalar(e,w,Wr);return S.multiplyByScalar(n,l,o),S.add(E,o,o)};S.fastSquad=function(e,n,t,o,i,r){s.typeOf.object("q0",e),s.typeOf.object("q1",n),s.typeOf.object("s0",t),s.typeOf.object("s1",o),s.typeOf.number("t",i),s.typeOf.object("result",r);let a=S.fastSlerp(e,n,i,_n),u=S.fastSlerp(t,o,i,sn);return S.fastSlerp(a,u,2*i*(1-i),r)};S.equals=function(e,n){return e===n||p(e)&&p(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w};S.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e.x-n.x)<=t&&Math.abs(e.y-n.y)<=t&&Math.abs(e.z-n.z)<=t&&Math.abs(e.w-n.w)<=t};S.ZERO=Object.freeze(new S(0,0,0,0));S.IDENTITY=Object.freeze(new S(0,0,0,1));S.prototype.clone=function(e){return S.clone(this,e)};S.prototype.equals=function(e){return S.equals(this,e)};S.prototype.equalsEpsilon=function(e,n){return S.equalsEpsilon(this,e,n)};S.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=S;var $={},lt={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"}},an={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},wt={},Oe={east:new g,north:new g,up:new g,west:new g,south:new g,down:new g},Fe=new g,Le=new g,xe=new g;$.localFrameToFixedFrameGenerator=function(e,n){if(!lt.hasOwnProperty(e)||!lt[e].hasOwnProperty(n))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let t=lt[e][n],o,i=e+n;return p(wt[i])?o=wt[i]:(o=function(r,a,u){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(u)||(u=new J),g.equalsEpsilon(r,g.ZERO,R.EPSILON14))g.unpack(an[e],0,Fe),g.unpack(an[n],0,Le),g.unpack(an[t],0,xe);else if(R.equalsEpsilon(r.x,0,R.EPSILON14)&&R.equalsEpsilon(r.y,0,R.EPSILON14)){let d=R.sign(r.z);g.unpack(an[e],0,Fe),e!=="east"&&e!=="west"&&g.multiplyByScalar(Fe,d,Fe),g.unpack(an[n],0,Le),n!=="east"&&n!=="west"&&g.multiplyByScalar(Le,d,Le),g.unpack(an[t],0,xe),t!=="east"&&t!=="west"&&g.multiplyByScalar(xe,d,xe)}else{a=a??Ie.default,a.geodeticSurfaceNormal(r,Oe.up);let d=Oe.up,m=Oe.east;m.x=-r.y,m.y=r.x,m.z=0,g.normalize(m,Oe.east),g.cross(d,m,Oe.north),g.multiplyByScalar(Oe.up,-1,Oe.down),g.multiplyByScalar(Oe.east,-1,Oe.west),g.multiplyByScalar(Oe.north,-1,Oe.south),Fe=Oe[e],Le=Oe[n],xe=Oe[t]}return u[0]=Fe.x,u[1]=Fe.y,u[2]=Fe.z,u[3]=0,u[4]=Le.x,u[5]=Le.y,u[6]=Le.z,u[7]=0,u[8]=xe.x,u[9]=xe.y,u[10]=xe.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},wt[i]=o),o};$.eastNorthUpToFixedFrame=$.localFrameToFixedFrameGenerator("east","north");$.northEastDownToFixedFrame=$.localFrameToFixedFrameGenerator("north","east");$.northUpEastToFixedFrame=$.localFrameToFixedFrameGenerator("north","up");$.northWestUpToFixedFrame=$.localFrameToFixedFrameGenerator("north","west");var Hr=new Xe,$r=new g(1,1,1),Yr=new J;$.headingPitchRollToFixedFrame=function(e,n,t,o,i){s.typeOf.object("HeadingPitchRoll",n),o=o??$.eastNorthUpToFixedFrame;let r=Xe.fromHeadingPitchRoll(n,Hr),a=J.fromTranslationQuaternionRotationScale(g.ZERO,r,$r,Yr);return i=o(e,t,i),J.multiply(i,a,i)};var Vr=new J,Xr=new B;$.headingPitchRollQuaternion=function(e,n,t,o,i){s.typeOf.object("HeadingPitchRoll",n);let r=$.headingPitchRollToFixedFrame(e,n,t,o,Vr),a=J.getMatrix3(r,Xr);return Xe.fromRotationMatrix(a,i)};var Zr=new g(1,1,1),Jr=new g,Co=new J,Gr=new J,Kr=new B,ei=new Xe;$.fixedFrameToHeadingPitchRoll=function(e,n,t,o){s.defined("transform",e),n=n??Ie.default,t=t??$.eastNorthUpToFixedFrame,p(o)||(o=new xn);let i=J.getTranslation(e,Jr);if(g.equals(i,g.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let r=J.inverseTransformation(t(i,n,Co),Co),a=J.setScale(e,Zr,Gr);a=J.setTranslation(a,g.ZERO,a),r=J.multiply(r,a,r);let u=Xe.fromRotationMatrix(J.getMatrix3(r,Kr),ei);return u=Xe.normalize(u,u),xn.fromQuaternion(u,o)};var ni=6*3600+41*60+50.54841,ti=8640184812866e-6,oi=.093104,ri=-62e-7,ii=11772758384668e-32,ci=72921158553e-15,si=R.TWO_PI/86400,Xn=new ue;$.computeIcrfToCentralBodyFixedMatrix=function(e,n){let t=$.computeIcrfToFixedMatrix(e,n);return p(t)||(t=$.computeTemeToPseudoFixedMatrix(e,n)),t};$.computeTemeToPseudoFixedMatrix=function(e,n){if(!p(e))throw new A("date is required.");Xn=ue.addSeconds(e,-ue.computeTaiMinusUtc(e),Xn);let t=Xn.dayNumber,o=Xn.secondsOfDay,i,r=t-2451545;o>=43200?i=(r+.5)/ie.DAYS_PER_JULIAN_CENTURY:i=(r-.5)/ie.DAYS_PER_JULIAN_CENTURY;let u=(ni+i*(ti+i*(oi+i*ri)))*si%R.TWO_PI,d=ci+ii*(t-24515455e-1),m=(o+ie.SECONDS_PER_DAY*.5)%ie.SECONDS_PER_DAY,l=u+d*m,w=Math.cos(l),E=Math.sin(l);return p(n)?(n[0]=w,n[1]=-E,n[2]=0,n[3]=E,n[4]=w,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new B(w,E,0,-E,w,0,0,0,1)};$.iau2006XysData=new Oo;$.earthOrientationParameters=ho.NONE;var gt=32.184,ai=2451545;$.preloadIcrfFixed=function(e){let n=e.start.dayNumber,t=e.start.secondsOfDay+gt,o=e.stop.dayNumber,i=e.stop.secondsOfDay+gt;return $.iau2006XysData.preload(n,t,o,i)};$.computeIcrfToFixedMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=$.computeFixedToIcrfMatrix(e,n);if(p(t))return B.transpose(t,n)};var fi=32.184,ui=2451545,Zn=new xn,pi=new B,hi=new ue;$.computeMoonFixedToIcrfMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=ue.addSeconds(e,fi,hi),o=ue.totalDays(t)-ui,i=R.toRadians(12.112)-R.toRadians(.052992)*o,r=R.toRadians(24.224)-R.toRadians(.105984)*o,a=R.toRadians(227.645)+R.toRadians(13.012)*o,u=R.toRadians(261.105)+R.toRadians(13.340716)*o,d=R.toRadians(358)+R.toRadians(.9856)*o;return Zn.pitch=R.toRadians(180)-R.toRadians(3.878)*Math.sin(i)-R.toRadians(.12)*Math.sin(r)+R.toRadians(.07)*Math.sin(a)-R.toRadians(.017)*Math.sin(u),Zn.roll=R.toRadians(66.53-90)+R.toRadians(1.543)*Math.cos(i)+R.toRadians(.24)*Math.cos(r)-R.toRadians(.028)*Math.cos(a)+R.toRadians(.007)*Math.cos(u),Zn.heading=R.toRadians(244.375-90)+R.toRadians(13.17635831)*o+R.toRadians(3.558)*Math.sin(i)+R.toRadians(.121)*Math.sin(r)-R.toRadians(.064)*Math.sin(a)+R.toRadians(.016)*Math.sin(u)+R.toRadians(.025)*Math.sin(d),B.fromHeadingPitchRoll(Zn,pi)};$.computeIcrfToMoonFixedMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=$.computeMoonFixedToIcrfMatrix(e,n);if(p(t))return B.transpose(t,n)};var di=new Wn(0,0,0),mi=new hn(0,0,0,0,0,0),bt=new B,Ot=new B;$.computeFixedToIcrfMatrix=function(e,n){if(!p(e))throw new A("date is required.");p(n)||(n=new B);let t=$.earthOrientationParameters.compute(e,mi);if(!p(t))return;let o=e.dayNumber,i=e.secondsOfDay+gt,r=$.iau2006XysData.computeXysRadians(o,i,di);if(!p(r))return;let a=r.x+t.xPoleOffset,u=r.y+t.yPoleOffset,d=1/(1+Math.sqrt(1-a*a-u*u)),m=bt;m[0]=1-d*a*a,m[3]=-d*a*u,m[6]=a,m[1]=-d*a*u,m[4]=1-d*u*u,m[7]=u,m[2]=-a,m[5]=-u,m[8]=1-d*(a*a+u*u);let l=B.fromRotationZ(-r.s,Ot),w=B.multiply(m,l,bt),E=e.dayNumber,T=e.secondsOfDay-ue.computeTaiMinusUtc(e)+t.ut1MinusUtc,M=E-2451545,v=T/ie.SECONDS_PER_DAY,I=.779057273264+v+.00273781191135448*(M+v);I=I%1*R.TWO_PI;let N=B.fromRotationZ(I,Ot),F=B.multiply(w,N,bt),k=Math.cos(t.xPoleWander),x=Math.cos(t.yPoleWander),Q=Math.sin(t.xPoleWander),W=Math.sin(t.yPoleWander),K=o-ai+i/ie.SECONDS_PER_DAY;K/=36525;let oe=-47e-6*K*R.RADIANS_PER_DEGREE/3600,X=Math.cos(oe),te=Math.sin(oe),Z=Ot;return Z[0]=k*X,Z[1]=k*te,Z[2]=Q,Z[3]=-x*te+W*Q*X,Z[4]=x*X+W*Q*te,Z[5]=-W*k,Z[6]=-W*te-x*Q*X,Z[7]=W*X-x*Q*te,Z[8]=x*k,B.multiply(F,Z,n)};var yi=new qe;$.pointToWindowCoordinates=function(e,n,t,o){return o=$.pointToGLWindowCoordinates(e,n,t,o),o.y=2*n[5]-o.y,o};$.pointToGLWindowCoordinates=function(e,n,t,o){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(n))throw new A("viewportTransformation is required.");if(!p(t))throw new A("point is required.");p(o)||(o=new be);let i=yi;return J.multiplyByVector(e,qe.fromElements(t.x,t.y,t.z,1,i),i),qe.multiplyByScalar(i,1/i.w,i),J.multiplyByVector(n,i,i),be.fromCartesian4(i,o)};var li=new g,wi=new g,bi=new g;$.rotationMatrixFromPositionVelocity=function(e,n,t,o){if(!p(e))throw new A("position is required.");if(!p(n))throw new A("velocity is required.");let i=(t??Ie.default).geodeticSurfaceNormal(e,li),r=g.cross(n,i,wi);g.equalsEpsilon(r,g.ZERO,R.EPSILON6)&&(r=g.clone(g.UNIT_X,r));let a=g.cross(r,n,bi);return g.normalize(a,a),g.cross(n,a,r),g.negate(r,r),g.normalize(r,r),p(o)||(o=new B),o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=r.x,o[4]=r.y,o[5]=r.z,o[6]=a.x,o[7]=a.y,o[8]=a.z,o};var vo=new J(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Ao=new Me,_t=new g,Oi=new g,gi=new B,St=new J,jo=new J;$.basisTo2D=function(e,n,t){if(!p(e))throw new A("projection is required.");if(!p(n))throw new A("matrix is required.");if(!p(t))throw new A("result is required.");let o=J.getTranslation(n,Oi),i=e.ellipsoid,r;if(g.equals(o,g.ZERO))r=g.clone(g.ZERO,_t);else{let l=i.cartesianToCartographic(o,Ao);r=e.project(l,_t),g.fromElements(r.z,r.x,r.y,r)}let a=$.eastNorthUpToFixedFrame(o,i,St),u=J.inverseTransformation(a,jo),d=J.getMatrix3(n,gi),m=J.multiplyByMatrix3(u,d,t);return J.multiply(vo,m,t),J.setTranslation(t,r,t),t};$.ellipsoidTo2DModelMatrix=function(e,n,t){if(!p(e))throw new A("projection is required.");if(!p(n))throw new A("center is required.");if(!p(t))throw new A("result is required.");let o=e.ellipsoid,i=$.eastNorthUpToFixedFrame(n,o,St),r=J.inverseTransformation(i,jo),a=o.cartesianToCartographic(n,Ao),u=e.project(a,_t);g.fromElements(u.z,u.x,u.y,u);let d=J.fromTranslation(u,St);return J.multiply(vo,r,t),J.multiply(d,t,t),t};var Mo=$;function L(e,n,t,o){this.west=e??0,this.south=n??0,this.east=t??0,this.north=o??0}Object.defineProperties(L.prototype,{width:{get:function(){return L.computeWidth(this)}},height:{get:function(){return L.computeHeight(this)}}});L.packedLength=4;L.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e.west,n[t++]=e.south,n[t++]=e.east,n[t]=e.north,n};L.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new L),t.west=e[n++],t.south=e[n++],t.east=e[n++],t.north=e[n],t};L.computeWidth=function(e){s.typeOf.object("rectangle",e);let n=e.east,t=e.west;return n<t&&(n+=R.TWO_PI),n-t};L.computeHeight=function(e){return s.typeOf.object("rectangle",e),e.north-e.south};L.fromDegrees=function(e,n,t,o,i){return e=R.toRadians(e??0),n=R.toRadians(n??0),t=R.toRadians(t??0),o=R.toRadians(o??0),p(i)?(i.west=e,i.south=n,i.east=t,i.north=o,i):new L(e,n,t,o)};L.fromRadians=function(e,n,t,o,i){return p(i)?(i.west=e??0,i.south=n??0,i.east=t??0,i.north=o??0,i):new L(e,n,t,o)};L.fromCartographicArray=function(e,n){s.defined("cartographics",e);let t=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let d=0,m=e.length;d<m;d++){let l=e[d];t=Math.min(t,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),u=Math.max(u,l.latitude);let w=l.longitude>=0?l.longitude:l.longitude+R.TWO_PI;i=Math.min(i,w),r=Math.max(r,w)}return o-t>r-i&&(t=i,o=r,o>R.PI&&(o=o-R.TWO_PI),t>R.PI&&(t=t-R.TWO_PI)),p(n)?(n.west=t,n.south=a,n.east=o,n.north=u,n):new L(t,a,o,u)};L.fromCartesianArray=function(e,n,t){s.defined("cartesians",e),n=n??Ie.default;let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let m=0,l=e.length;m<l;m++){let w=n.cartesianToCartographic(e[m]);o=Math.min(o,w.longitude),i=Math.max(i,w.longitude),u=Math.min(u,w.latitude),d=Math.max(d,w.latitude);let E=w.longitude>=0?w.longitude:w.longitude+R.TWO_PI;r=Math.min(r,E),a=Math.max(a,E)}return i-o>a-r&&(o=r,i=a,i>R.PI&&(i=i-R.TWO_PI),o>R.PI&&(o=o-R.TWO_PI)),p(t)?(t.west=o,t.south=u,t.east=i,t.north=d,t):new L(o,u,i,d)};var _i=new g,Si=new g,Ri=new g,Ei=new g,Ti=new g,Rt=new Array(5);for(let e=0;e<Rt.length;++e)Rt[e]=new g;L.fromBoundingSphere=function(e,n,t){s.typeOf.object("boundingSphere",e);let o=e.center,i=e.radius;if(p(n)||(n=Ie.default),p(t)||(t=new L),g.equals(o,g.ZERO))return L.clone(L.MAX_VALUE,t),t;let r=Mo.eastNorthUpToFixedFrame(o,n,_i),a=J.multiplyByPointAsVector(r,g.UNIT_X,Si);g.normalize(a,a);let u=J.multiplyByPointAsVector(r,g.UNIT_Y,Ri);g.normalize(u,u),g.multiplyByScalar(u,i,u),g.multiplyByScalar(a,i,a);let d=g.negate(u,Ti),m=g.negate(a,Ei),l=Rt,w=l[0];return g.add(o,u,w),w=l[1],g.add(o,m,w),w=l[2],g.add(o,d,w),w=l[3],g.add(o,a,w),l[4]=o,L.fromCartesianArray(l,n,t)};L.clone=function(e,n){if(p(e))return p(n)?(n.west=e.west,n.south=e.south,n.east=e.east,n.north=e.north,n):new L(e.west,e.south,e.east,e.north)};L.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e.west-n.west)<=t&&Math.abs(e.south-n.south)<=t&&Math.abs(e.east-n.east)<=t&&Math.abs(e.north-n.north)<=t};L.prototype.clone=function(e){return L.clone(this,e)};L.prototype.equals=function(e){return L.equals(this,e)};L.equals=function(e,n){return e===n||p(e)&&p(n)&&e.west===n.west&&e.south===n.south&&e.east===n.east&&e.north===n.north};L.prototype.equalsEpsilon=function(e,n){return L.equalsEpsilon(this,e,n)};L._validate=function(e){s.typeOf.object("rectangle",e);let n=e.north;s.typeOf.number.greaterThanOrEquals("north",n,-R.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("north",n,R.PI_OVER_TWO);let t=e.south;s.typeOf.number.greaterThanOrEquals("south",t,-R.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("south",t,R.PI_OVER_TWO);let o=e.west;s.typeOf.number.greaterThanOrEquals("west",o,-Math.PI),s.typeOf.number.lessThanOrEquals("west",o,Math.PI);let i=e.east;s.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),s.typeOf.number.lessThanOrEquals("east",i,Math.PI)};L.southwest=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new Me(e.west,e.south)};L.northwest=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new Me(e.west,e.north)};L.northeast=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new Me(e.east,e.north)};L.southeast=function(e,n){return s.typeOf.object("rectangle",e),p(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new Me(e.east,e.south)};L.center=function(e,n){s.typeOf.object("rectangle",e);let t=e.east,o=e.west;t<o&&(t+=R.TWO_PI);let i=R.negativePiToPi((o+t)*.5),r=(e.south+e.north)*.5;return p(n)?(n.longitude=i,n.latitude=r,n.height=0,n):new Me(i,r)};L.intersection=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n);let o=e.east,i=e.west,r=n.east,a=n.west;o<i&&r>0?o+=R.TWO_PI:r<a&&o>0&&(r+=R.TWO_PI),o<i&&a<0?a+=R.TWO_PI:r<a&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.max(i,a)),d=R.negativePiToPi(Math.min(o,r));if((e.west<e.east||n.west<n.east)&&d<=u)return;let m=Math.max(e.south,n.south),l=Math.min(e.north,n.north);if(!(m>=l))return p(t)?(t.west=u,t.south=m,t.east=d,t.north=l,t):new L(u,m,d,l)};L.simpleIntersection=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n);let o=Math.max(e.west,n.west),i=Math.max(e.south,n.south),r=Math.min(e.east,n.east),a=Math.min(e.north,n.north);if(!(i>=a||o>=r))return p(t)?(t.west=o,t.south=i,t.east=r,t.north=a,t):new L(o,i,r,a)};L.union=function(e,n,t){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",n),p(t)||(t=new L);let o=e.east,i=e.west,r=n.east,a=n.west;o<i&&r>0?o+=R.TWO_PI:r<a&&o>0&&(r+=R.TWO_PI),o<i&&a<0?a+=R.TWO_PI:r<a&&i<0&&(i+=R.TWO_PI);let u=R.negativePiToPi(Math.min(i,a)),d=R.negativePiToPi(Math.max(o,r));return t.west=u,t.south=Math.min(e.south,n.south),t.east=d,t.north=Math.max(e.north,n.north),t};L.expand=function(e,n,t){return s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",n),p(t)||(t=new L),t.west=Math.min(e.west,n.longitude),t.south=Math.min(e.south,n.latitude),t.east=Math.max(e.east,n.longitude),t.north=Math.max(e.north,n.latitude),t};L.contains=function(e,n){s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",n);let t=n.longitude,o=n.latitude,i=e.west,r=e.east;return r<i&&(r+=R.TWO_PI,t<0&&(t+=R.TWO_PI)),(t>i||R.equalsEpsilon(t,i,R.EPSILON14))&&(t<r||R.equalsEpsilon(t,r,R.EPSILON14))&&o>=e.south&&o<=e.north};var Ci=new Me;L.subsample=function(e,n,t,o){s.typeOf.object("rectangle",e),n=n??Ie.default,t=t??0,p(o)||(o=[]);let i=0,r=e.north,a=e.south,u=e.east,d=e.west,m=Ci;m.height=t,m.longitude=d,m.latitude=r,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.latitude=a,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=d,o[i]=n.cartographicToCartesian(m,o[i]),i++,r<0?m.latitude=r:a>0?m.latitude=a:m.latitude=0;for(let l=1;l<8;++l)m.longitude=-Math.PI+l*R.PI_OVER_TWO,L.contains(e,m)&&(o[i]=n.cartographicToCartesian(m,o[i]),i++);return m.latitude===0&&(m.longitude=d,o[i]=n.cartographicToCartesian(m,o[i]),i++,m.longitude=u,o[i]=n.cartographicToCartesian(m,o[i]),i++),o.length=i,o};L.subsection=function(e,n,t,o,i,r){if(s.typeOf.object("rectangle",e),s.typeOf.number.greaterThanOrEquals("westLerp",n,0),s.typeOf.number.lessThanOrEquals("westLerp",n,1),s.typeOf.number.greaterThanOrEquals("southLerp",t,0),s.typeOf.number.lessThanOrEquals("southLerp",t,1),s.typeOf.number.greaterThanOrEquals("eastLerp",o,0),s.typeOf.number.lessThanOrEquals("eastLerp",o,1),s.typeOf.number.greaterThanOrEquals("northLerp",i,0),s.typeOf.number.lessThanOrEquals("northLerp",i,1),s.typeOf.number.lessThanOrEquals("westLerp",n,o),s.typeOf.number.lessThanOrEquals("southLerp",t,i),p(r)||(r=new L),e.west<=e.east){let u=e.east-e.west;r.west=e.west+n*u,r.east=e.west+o*u}else{let u=R.TWO_PI+e.east-e.west;r.west=R.negativePiToPi(e.west+n*u),r.east=R.negativePiToPi(e.west+o*u)}let a=e.north-e.south;return r.south=e.south+t*a,r.north=e.south+i*a,n===1&&(r.west=e.east),o===1&&(r.east=e.east),t===1&&(r.south=e.north),i===1&&(r.north=e.north),r};L.MAX_VALUE=Object.freeze(new L(-Math.PI,-R.PI_OVER_TWO,Math.PI,R.PI_OVER_TWO));var nf=L;function q(e,n,t,o){this[0]=e??0,this[1]=t??0,this[2]=n??0,this[3]=o??0}q.packedLength=4;q.pack=function(e,n,t){return s.typeOf.object("value",e),s.defined("array",n),t=t??0,n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n};q.unpack=function(e,n,t){return s.defined("array",e),n=n??0,p(t)||(t=new q),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t};q.packArray=function(e,n){s.defined("array",e);let t=e.length,o=t*4;if(!p(n))n=new Array(o);else{if(!Array.isArray(n)&&n.length!==o)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==o&&(n.length=o)}for(let i=0;i<t;++i)q.pack(e[i],n,i*4);return n};q.unpackArray=function(e,n){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new A("array length must be a multiple of 4.");let t=e.length;p(n)?n.length=t/4:n=new Array(t/4);for(let o=0;o<t;o+=4){let i=o/4;n[i]=q.unpack(e,o,n[i])}return n};q.clone=function(e,n){if(p(e))return p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):new q(e[0],e[2],e[1],e[3])};q.fromArray=q.unpack;q.fromColumnMajorArray=function(e,n){return s.defined("values",e),q.clone(e,n)};q.fromRowMajorArray=function(e,n){return s.defined("values",e),p(n)?(n[0]=e[0],n[1]=e[2],n[2]=e[1],n[3]=e[3],n):new q(e[0],e[1],e[2],e[3])};q.fromScale=function(e,n){return s.typeOf.object("scale",e),p(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=e.y,n):new q(e.x,0,0,e.y)};q.fromUniformScale=function(e,n){return s.typeOf.number("scale",e),p(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=e,n):new q(e,0,0,e)};q.fromRotation=function(e,n){s.typeOf.number("angle",e);let t=Math.cos(e),o=Math.sin(e);return p(n)?(n[0]=t,n[1]=o,n[2]=-o,n[3]=t,n):new q(t,-o,o,t)};q.toArray=function(e,n){return s.typeOf.object("matrix",e),p(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):[e[0],e[1],e[2],e[3]]};q.getElementIndex=function(e,n){return s.typeOf.number.greaterThanOrEquals("row",n,0),s.typeOf.number.lessThanOrEquals("row",n,1),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,1),e*2+n};q.getColumn=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("result",t);let o=n*2,i=e[o],r=e[o+1];return t.x=i,t.y=r,t};q.setColumn=function(e,n,t,o){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=q.clone(e,o);let i=n*2;return o[i]=t.x,o[i+1]=t.y,o};q.getRow=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("result",t);let o=e[n],i=e[n+2];return t.x=o,t.y=i,t};q.setRow=function(e,n,t,o){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",n,0),s.typeOf.number.lessThanOrEquals("index",n,1),s.typeOf.object("cartesian",t),s.typeOf.object("result",o),o=q.clone(e,o),o[n]=t.x,o[n+2]=t.y,o};var vi=new be;q.setScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t);let o=q.getScale(e,vi),i=n.x/o.x,r=n.y/o.y;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*r,t};var Ai=new be;q.setUniformScale=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t);let o=q.getScale(e,Ai),i=n/o.x,r=n/o.y;return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*r,t};var Po=new be;q.getScale=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n.x=be.magnitude(be.fromElements(e[0],e[1],Po)),n.y=be.magnitude(be.fromElements(e[2],e[3],Po)),n};var Uo=new be;q.getMaximumScale=function(e){return q.getScale(e,Uo),be.maximumComponent(Uo)};var ji=new be;q.setRotation=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let o=q.getScale(e,ji);return t[0]=n[0]*o.x,t[1]=n[1]*o.x,t[2]=n[2]*o.y,t[3]=n[3]*o.y,t};var Mi=new be;q.getRotation=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=q.getScale(e,Mi);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};q.multiply=function(e,n,t){s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t);let o=e[0]*n[0]+e[2]*n[1],i=e[0]*n[2]+e[2]*n[3],r=e[1]*n[0]+e[3]*n[1],a=e[1]*n[2]+e[3]*n[3];return t[0]=o,t[1]=r,t[2]=i,t[3]=a,t};q.add=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t};q.subtract=function(e,n,t){return s.typeOf.object("left",e),s.typeOf.object("right",n),s.typeOf.object("result",t),t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t};q.multiplyByVector=function(e,n,t){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",n),s.typeOf.object("result",t);let o=e[0]*n.x+e[2]*n.y,i=e[1]*n.x+e[3]*n.y;return t.x=o,t.y=i,t};q.multiplyByScalar=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t};q.multiplyByScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.object("scale",n),s.typeOf.object("result",t),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};q.multiplyByUniformScale=function(e,n,t){return s.typeOf.object("matrix",e),s.typeOf.number("scale",n),s.typeOf.object("result",t),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t};q.negate=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n};q.transpose=function(e,n){s.typeOf.object("matrix",e),s.typeOf.object("result",n);let t=e[0],o=e[2],i=e[1],r=e[3];return n[0]=t,n[1]=o,n[2]=i,n[3]=r,n};q.abs=function(e,n){return s.typeOf.object("matrix",e),s.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n};q.equals=function(e,n){return e===n||p(e)&&p(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]};q.equalsArray=function(e,n,t){return e[0]===n[t]&&e[1]===n[t+1]&&e[2]===n[t+2]&&e[3]===n[t+3]};q.equalsEpsilon=function(e,n,t){return t=t??0,e===n||p(e)&&p(n)&&Math.abs(e[0]-n[0])<=t&&Math.abs(e[1]-n[1])<=t&&Math.abs(e[2]-n[2])<=t&&Math.abs(e[3]-n[3])<=t};q.IDENTITY=Object.freeze(new q(1,0,0,1));q.ZERO=Object.freeze(new q(0,0,0,0));q.COLUMN0ROW0=0;q.COLUMN0ROW1=1;q.COLUMN1ROW0=2;q.COLUMN1ROW1=3;Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}});q.prototype.clone=function(e){return q.clone(this,e)};q.prototype.equals=function(e){return q.equals(this,e)};q.prototype.equalsEpsilon=function(e,n){return q.equalsEpsilon(this,e,n)};q.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var af=q;export{qe as a,J as b,De as c,ke as d,bo as e,Xe as f,Mo as g,nf as h,af as i}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-3RSLEP7W.js b/plugins/feature/map/Cesium/Workers/chunk-3RSLEP7W.js deleted file mode 100644 index 0432700e7..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-3RSLEP7W.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as _}from"./chunk-ALKSRI7Y.js";import{a as te}from"./chunk-RQKZTHAV.js";import{a as ie,b as j,f as Z,g as fe}from"./chunk-3PT5NNSP.js";import{a as e,b as se,c as ee,e as O}from"./chunk-FGKVHLJ4.js";import{a as Q}from"./chunk-YRCAQUFT.js";import{a as le}from"./chunk-ELJAHN3H.js";import{e as $}from"./chunk-3BGP4HCL.js";var Ee={ROUNDED:0,MITERED:1,BEVELED:2},G=Object.freeze(Ee);var me={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(me[r])||(me[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var ue=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,he=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),he.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,he,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f,o}function de(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ge=new Z,ye=new e,we=new O;function pe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ge),we):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ge),we);let i,g;if(n=e.clone(n,ye),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,ye),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):de(n,a),S=t?de(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){ue("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?pe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let xe=t?i+D.length:i,J=new Float64Array(xe);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,ue as b,ct as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-4U57P2C5.js b/plugins/feature/map/Cesium/Workers/chunk-4U57P2C5.js new file mode 100644 index 000000000..7d5865143 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-4U57P2C5.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as F}from"./chunk-GNBKSQYP.js";import{a as Z}from"./chunk-AZINMULF.js";import{a as X}from"./chunk-ILBQ77ZM.js";import{b as K,c as Q,d as U}from"./chunk-7RNSURKI.js";import{c as H}from"./chunk-THB3EPLO.js";import{a as y}from"./chunk-WCOEOHX5.js";import{c as J}from"./chunk-KP72RGCH.js";import{a as r,c as V}from"./chunk-OSVSBQDY.js";import{a as N}from"./chunk-LZC73BOP.js";import{a as b}from"./chunk-OU2IPMYE.js";import{f as R}from"./chunk-H7SJWKIY.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-76NBDD5E.js b/plugins/feature/map/Cesium/Workers/chunk-76NBDD5E.js new file mode 100644 index 000000000..620ca8c36 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-76NBDD5E.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as R}from"./chunk-LXGG3JDP.js";import{a as ct}from"./chunk-XUWPEWB7.js";import{a as Z,b as H}from"./chunk-SIFLADX4.js";import{a as V}from"./chunk-D3YAYYEG.js";import{a as U}from"./chunk-B5FT3Q23.js";import{b as ot}from"./chunk-ZNBU4MZZ.js";import{a as it}from"./chunk-SIBAZPZR.js";import{a as nt}from"./chunk-AZINMULF.js";import{a as et}from"./chunk-ILBQ77ZM.js";import{b as J,c as X,d as z}from"./chunk-7RNSURKI.js";import{h as K}from"./chunk-YZ5ZCI55.js";import{a as k}from"./chunk-WCOEOHX5.js";import{a as q,b as M,c as tt}from"./chunk-KP72RGCH.js";import{a as w,b as F}from"./chunk-OSVSBQDY.js";import{a as I}from"./chunk-LZC73BOP.js";import{f as x}from"./chunk-H7SJWKIY.js";function ft(n,i){this.positions=x(n)?n:[],this.holes=x(i)?i:[]}var st=ft;function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}});S.prototype.enqueue=function(n){this._array.push(n),this._length++};S.prototype.dequeue=function(){if(this._length===0)return;let n=this._array,i=this._offset,u=n[i];return n[i]=void 0,i++,i>10&&i*2>n.length&&(this._array=n.slice(i),i=0),this._offset=i,this._length--,u};S.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};S.prototype.contains=function(n){return this._array.indexOf(n)!==-1};S.prototype.clear=function(){this._array.length=this._offset=this._length=0};S.prototype.sort=function(n){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(n)};var $=S;var b={};b.computeHierarchyPackedLength=function(n,i){let u=0,s=[n];for(;s.length>0;){let c=s.pop();if(!x(c))continue;u+=2;let a=c.positions,t=c.holes;if(x(a)&&a.length>0&&(u+=a.length*i.packedLength),x(t)){let o=t.length;for(let e=0;e<o;++e)s.push(t[e])}}return u};b.packPolygonHierarchy=function(n,i,u,s){let c=[n];for(;c.length>0;){let a=c.pop();if(!x(a))continue;let t=a.positions,o=a.holes;if(i[u++]=x(t)?t.length:0,i[u++]=x(o)?o.length:0,x(t)){let e=t.length;for(let r=0;r<e;++r,u+=s.packedLength)s.pack(t[r],i,u)}if(x(o)){let e=o.length;for(let r=0;r<e;++r)c.push(o[r])}}return u};b.unpackPolygonHierarchy=function(n,i,u){let s=n[i++],c=n[i++],a=new Array(s),t=c>0?new Array(c):void 0;for(let o=0;o<s;++o,i+=u.packedLength)a[o]=u.unpack(n,i);for(let o=0;o<c;++o)t[o]=b.unpackPolygonHierarchy(n,i,u),i=t[o].startingIndex,delete t[o].startingIndex;return{positions:a,holes:t,startingIndex:i}};var O=new M;function at(n,i,u,s){return M.subtract(i,n,O),M.multiplyByScalar(O,u/s,O),M.add(n,O,O),[O.x,O.y]}var G=new w;function gt(n,i,u,s){return w.subtract(i,n,G),w.multiplyByScalar(G,u/s,G),w.add(n,G,G),[G.x,G.y,G.z]}b.subdivideLineCount=function(n,i,u){let c=w.distance(n,i)/u,a=Math.max(0,Math.ceil(I.log2(c)));return Math.pow(2,a)};var j=new q,Q=new q,dt=new q,pt=new w,Y=new U;b.subdivideRhumbLineCount=function(n,i,u,s){let c=n.cartesianToCartographic(i,j),a=n.cartesianToCartographic(u,Q),o=new U(c,a,n).surfaceDistance/s,e=Math.max(0,Math.ceil(I.log2(o)));return Math.pow(2,e)};b.subdivideTexcoordLine=function(n,i,u,s,c,a){let t=b.subdivideLineCount(u,s,c),o=M.distance(n,i),e=o/t,r=a;r.length=t*2;let l=0;for(let h=0;h<t;h++){let f=at(n,i,h*e,o);r[l++]=f[0],r[l++]=f[1]}return r};b.subdivideLine=function(n,i,u,s){let c=b.subdivideLineCount(n,i,u),a=w.distance(n,i),t=a/c;x(s)||(s=[]);let o=s;o.length=c*3;let e=0;for(let r=0;r<c;r++){let l=gt(n,i,r*t,a);o[e++]=l[0],o[e++]=l[1],o[e++]=l[2]}return o};b.subdivideTexcoordRhumbLine=function(n,i,u,s,c,a,t){let o=u.cartesianToCartographic(s,j),e=u.cartesianToCartographic(c,Q);Y.setEndPoints(o,e);let r=Y.surfaceDistance/a,l=Math.max(0,Math.ceil(I.log2(r))),h=Math.pow(2,l),f=M.distance(n,i),d=f/h,m=t;m.length=h*2;let p=0;for(let g=0;g<h;g++){let y=at(n,i,g*d,f);m[p++]=y[0],m[p++]=y[1]}return m};b.subdivideRhumbLine=function(n,i,u,s,c){let a=n.cartesianToCartographic(i,j),t=n.cartesianToCartographic(u,Q),o=new U(a,t,n);if(x(c)||(c=[]),o.surfaceDistance<=s)return c.length=3,c[0]=i.x,c[1]=i.y,c[2]=i.z,c;let e=o.surfaceDistance/s,r=Math.max(0,Math.ceil(I.log2(e))),l=Math.pow(2,r),h=o.surfaceDistance/l,f=c;f.length=l*3;let d=0;for(let m=0;m<l;m++){let p=o.interpolateUsingSurfaceDistance(m*h,dt),g=n.cartographicToCartesian(p,pt);f[d++]=g.x,f[d++]=g.y,f[d++]=g.z}return f};var mt=new w,yt=new w,xt=new w,wt=new w;b.scaleToGeodeticHeightExtruded=function(n,i,u,s,c){s=s??tt.default;let a=mt,t=yt,o=xt,e=wt;if(x(n)&&x(n.attributes)&&x(n.attributes.position)){let r=n.attributes.position.values,l=r.length/2;for(let h=0;h<l;h+=3)w.fromArray(r,h,o),s.geodeticSurfaceNormal(o,a),e=s.scaleToGeodeticSurface(o,e),t=w.multiplyByScalar(a,u,t),t=w.add(e,t,t),r[h+l]=t.x,r[h+1+l]=t.y,r[h+2+l]=t.z,c&&(e=w.clone(o,e)),t=w.multiplyByScalar(a,i,t),t=w.add(e,t,t),r[h]=t.x,r[h+1]=t.y,r[h+2]=t.z}return n};b.polygonOutlinesFromHierarchy=function(n,i,u){let s=[],c=new $;c.enqueue(n);let a,t,o;for(;c.length!==0;){let e=c.dequeue(),r=e.positions;if(i)for(o=r.length,a=0;a<o;a++)u.scaleToGeodeticSurface(r[a],r[a]);if(r=V(r,w.equalsEpsilon,!0),r.length<3)continue;let l=e.holes?e.holes.length:0;for(a=0;a<l;a++){let h=e.holes[a],f=h.positions;if(i)for(o=f.length,t=0;t<o;++t)u.scaleToGeodeticSurface(f[t],f[t]);if(f=V(f,w.equalsEpsilon,!0),f.length<3)continue;s.push(f);let d=0;for(x(h.holes)&&(d=h.holes.length),t=0;t<d;t++)c.enqueue(h.holes[t])}s.push(r)}return s};var bt=new q;function Lt(n,i,u){let s=u.cartesianToCartographic(n,j),c=u.cartesianToCartographic(i,Q);if(Math.sign(s.latitude)===Math.sign(c.latitude))return;Y.setEndPoints(s,c);let a=Y.findIntersectionWithLatitude(0,bt);if(!x(a))return;let t=Math.min(s.longitude,c.longitude),o=Math.max(s.longitude,c.longitude);if(Math.abs(o-t)>I.PI){let e=t;t=o,o=e}if(!(a.longitude<t||a.longitude>o))return u.cartographicToCartesian(a)}function Tt(n,i,u,s){if(s===R.RHUMB)return Lt(n,i,u);let c=ot.lineSegmentPlane(n,i,it.ORIGIN_XY_PLANE);if(x(c))return u.scaleToGeodeticSurface(c,c)}var Et=new q;function vt(n,i,u){let s=[],c,a,t,o,e,r=0;for(;r<n.length;){c=n[r],a=n[(r+1)%n.length],t=I.sign(c.z),o=I.sign(a.z);let l=h=>i.cartesianToCartographic(h,Et).longitude;if(t===0)s.push({position:r,type:t,visited:!1,next:o,theta:l(c)});else if(o!==0){if(e=Tt(c,a,i,u),++r,!x(e))continue;n.splice(r,0,e),s.push({position:r,type:t,visited:!1,next:o,theta:l(e)})}++r}return s}function ht(n,i,u,s,c,a,t){let o=[],e=a,r=h=>f=>f.position===h,l=[];do{let h=u[e];o.push(h);let f=s.findIndex(r(e)),d=s[f];if(!x(d)){++e;continue}let{visited:m,type:p,next:g}=d;if(d.visited=!0,p===0){if(g===0){let C=s[f-(t?1:-1)];if(C?.position===e+1)C.visited=!0;else{++e;continue}}if(!m&&t&&g>0||a===e&&!t&&g<0){++e;continue}}if(!(t?p>=0:p<=0)){++e;continue}m||l.push(e);let L=f+(t?1:-1),_=s[L];if(!x(_)){++e;continue}e=_.position}while(e<u.length&&e>=0&&e!==a&&o.length<u.length);n.splice(i,c,o);for(let h of l)i=ht(n,i+1,u,s,0,h,!t);return i}b.splitPolygonsOnEquator=function(n,i,u,s){x(s)||(s=[]),s.splice(0,0,...n),s.length=n.length;let c=0;for(;c<s.length;){let a=s[c],t=a.slice();if(a.length<3){s[c]=t,++c;continue}let o=vt(t,i,u);if(t.length===a.length||o.length<=1){s[c]=t,++c;continue}o.sort((r,l)=>r.theta-l.theta);let e=t[0].z>=0;c=ht(s,c,t,o,1,0,e)}return s};b.polygonsFromHierarchy=function(n,i,u,s,c,a){let t=[],o=[],e=new $;e.enqueue(n);let r=x(a);for(;e.length!==0;){let l=e.dequeue(),h=l.positions,f=l.holes,d,m;if(s)for(m=h.length,d=0;d<m;d++)c.scaleToGeodeticSurface(h[d],h[d]);if(i||(h=V(h,w.equalsEpsilon,!0)),h.length<3)continue;let p=u(h);if(!x(p))continue;let g=[],y=H.computeWindingOrder2D(p);if(y===Z.CLOCKWISE&&(p.reverse(),h=h.slice().reverse()),r){r=!1;let P=[h];if(P=a(P,P),P.length>1){for(let v of P)e.enqueue(new st(v,f));continue}}let L=h.slice(),_=x(f)?f.length:0,C=[],T;for(d=0;d<_;d++){let P=f[d],v=P.positions;if(s)for(m=v.length,T=0;T<m;++T)c.scaleToGeodeticSurface(v[T],v[T]);if(i||(v=V(v,w.equalsEpsilon,!0)),v.length<3)continue;let E=u(v);if(!x(E))continue;y=H.computeWindingOrder2D(E),y===Z.CLOCKWISE&&(E.reverse(),v=v.slice().reverse()),C.push(v),g.push(L.length),L=L.concat(v),p=p.concat(E);let D=0;for(x(P.holes)&&(D=P.holes.length),T=0;T<D;T++)e.enqueue(P.holes[T])}t.push({outerRing:h,holes:C}),o.push({positions:L,positions2D:p,holes:g})}return{hierarchy:t,polygons:o}};var Ct=new M,Pt=new w,Dt=new K,It=new F;b.computeBoundingRectangle=function(n,i,u,s,c){let a=K.fromAxisAngle(n,s,Dt),t=F.fromQuaternion(a,It),o=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=u.length;for(let f=0;f<h;++f){let d=w.clone(u[f],Pt);F.multiplyByVector(t,d,d);let m=i(d,Ct);x(m)&&(o=Math.min(o,m.x),e=Math.max(e,m.x),r=Math.min(r,m.y),l=Math.max(l,m.y))}return c.x=o,c.y=r,c.width=e-o,c.height=l-r,c};b.createGeometryFromPositions=function(n,i,u,s,c,a,t){let o=H.triangulate(i.positions2D,i.holes);o.length<3&&(o=[0,1,2]);let e=i.positions,r=x(u),l=r?u.positions:void 0;if(c){let h=e.length,f=new Array(h*3),d=0;for(let g=0;g<h;g++){let y=e[g];f[d++]=y.x,f[d++]=y.y,f[d++]=y.z}let m={attributes:{position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:f})},indices:o,primitiveType:J.TRIANGLES};r&&(m.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:M.packArray(l)}));let p=new X(m);return a.normal?ct.computeNormal(p):p}if(t===R.GEODESIC)return H.computeSubdivision(n,e,o,l,s);if(t===R.RHUMB)return H.computeRhumbLineSubdivision(n,e,o,l,s)};var rt=[],ut=[],_t=new w,At=new w;b.computeWallGeometry=function(n,i,u,s,c,a){let t,o,e,r,l,h,f,d,m,p=n.length,g=0,y=0,L=x(i),_=L?i.positions:void 0;if(c)for(o=p*3*2,t=new Array(o*2),L&&(m=p*2*2,d=new Array(m*2)),e=0;e<p;e++)r=n[e],l=n[(e+1)%p],t[g]=t[g+o]=r.x,++g,t[g]=t[g+o]=r.y,++g,t[g]=t[g+o]=r.z,++g,t[g]=t[g+o]=l.x,++g,t[g]=t[g+o]=l.y,++g,t[g]=t[g+o]=l.z,++g,L&&(h=_[e],f=_[(e+1)%p],d[y]=d[y+m]=h.x,++y,d[y]=d[y+m]=h.y,++y,d[y]=d[y+m]=f.x,++y,d[y]=d[y+m]=f.y,++y);else{let E=I.chordLength(s,u.maximumRadius),D=0;if(a===R.GEODESIC)for(e=0;e<p;e++)D+=b.subdivideLineCount(n[e],n[(e+1)%p],E);else if(a===R.RHUMB)for(e=0;e<p;e++)D+=b.subdivideRhumbLineCount(u,n[e],n[(e+1)%p],E);for(o=(D+p)*3,t=new Array(o*2),L&&(m=(D+p)*2,d=new Array(m*2)),e=0;e<p;e++){r=n[e],l=n[(e+1)%p];let A,N;L&&(h=_[e],f=_[(e+1)%p]),a===R.GEODESIC?(A=b.subdivideLine(r,l,E,ut),L&&(N=b.subdivideTexcoordLine(h,f,r,l,E,rt))):a===R.RHUMB&&(A=b.subdivideRhumbLine(u,r,l,E,ut),L&&(N=b.subdivideTexcoordRhumbLine(h,f,u,r,l,E,rt)));let lt=A.length;for(let B=0;B<lt;++B,++g)t[g]=A[B],t[g+o]=A[B];if(t[g]=l.x,t[g+o]=l.x,++g,t[g]=l.y,t[g+o]=l.y,++g,t[g]=l.z,t[g+o]=l.z,++g,L){let B=N.length;for(let W=0;W<B;++W,++y)d[y]=N[W],d[y+m]=N[W];d[y]=f.x,d[y+m]=f.x,++y,d[y]=f.y,d[y+m]=f.y,++y}}}p=t.length;let C=nt.createTypedArray(p/3,p-n.length*6),T=0;for(p/=6,e=0;e<p;e++){let E=e,D=E+1,A=E+p,N=A+1;r=w.fromArray(t,E*3,_t),l=w.fromArray(t,D*3,At),!w.equalsEpsilon(r,l,I.EPSILON10,I.EPSILON10)&&(C[T++]=E,C[T++]=A,C[T++]=D,C[T++]=D,C[T++]=A,C[T++]=N)}let P={attributes:new et({position:new z({componentDatatype:k.DOUBLE,componentsPerAttribute:3,values:t})}),indices:C,primitiveType:J.TRIANGLES};return L&&(P.attributes.st=new z({componentDatatype:k.FLOAT,componentsPerAttribute:2,values:d})),new X(P)};var ie=b;export{ie as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-7IFFXLK3.js b/plugins/feature/map/Cesium/Workers/chunk-7IFFXLK3.js new file mode 100644 index 000000000..3a5f98c96 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-7IFFXLK3.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{h as C}from"./chunk-YZ5ZCI55.js";import{a as n,b}from"./chunk-OSVSBQDY.js";import{a as w}from"./chunk-LZC73BOP.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-7RNSURKI.js b/plugins/feature/map/Cesium/Workers/chunk-7RNSURKI.js new file mode 100644 index 000000000..ffdaab02b --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-7RNSURKI.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{h as O,i as R,j as G,k as L}from"./chunk-YZ5ZCI55.js";import{b as E}from"./chunk-HLXNFZAZ.js";import{a as u}from"./chunk-ZJRS2FK6.js";import{a as N,b as s}from"./chunk-KP72RGCH.js";import{a as S,b as y,c as A}from"./chunk-OSVSBQDY.js";import{a as I,b as w}from"./chunk-OU2IPMYE.js";import{f}from"./chunk-H7SJWKIY.js";var F={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(F);var M=F;var e={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};e.isLines=function(t){return t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP};e.isTriangles=function(t){return t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN};e.validate=function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN};Object.freeze(e);var g=e;function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??g.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??M.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],r=o.values.length/o.componentsPerAttribute;if(c!==r&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=r}return c};var W=new N,H=new S,V=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let r,D=G.center(o,W),Y=N.toCartesian(D,a,H),z=R.eastNorthUpToFixedFrame(Y,a,V),C=E.inverse(z,V),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(r=0;r<3;r++)N.toCartesian(m[r],a,n),n=E.multiplyByPointAsVector(C,n,n),b[r].x=n.x,b[r].y=n.y;let B=O.fromAxisAngle(S.UNIT_Z,-c,et),v=y.fromQuaternion(B,rt),j=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(r=0;r<j;r++)n=E.multiplyByPointAsVector(C,t[r],n),n=y.multiplyByVector(v,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let k=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],X=b[2].x-l.x,q=b[1].y-l.y;for(r=0;r<3;r++){let h=i[r];L.multiplyByVector(k,h,h),h.x=(h.x-l.x)/X,h.y=(h.y-l.y)/q}let J=i[0],Q=i[1],U=i[2],P=new Array(6);return s.pack(J,P),s.pack(Q,P,2),s.pack(U,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{M as a,g as b,Lt as c,Ot as d}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ALKSRI7Y.js b/plugins/feature/map/Cesium/Workers/chunk-ALKSRI7Y.js deleted file mode 100644 index 086404da4..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-ALKSRI7Y.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as G}from"./chunk-OM62BMPV.js";import{a as z}from"./chunk-IAW6QHRG.js";import{b as B}from"./chunk-QFKZXFLI.js";import{a as C}from"./chunk-ASLWXOD7.js";import{b as L}from"./chunk-3PT5NNSP.js";import{a,b as D,d as I}from"./chunk-FGKVHLJ4.js";import{a as S}from"./chunk-YRCAQUFT.js";import{a as x}from"./chunk-ELJAHN3H.js";import{e as T}from"./chunk-3BGP4HCL.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-NEXD3R4K.js b/plugins/feature/map/Cesium/Workers/chunk-ARDVIBNJ.js similarity index 91% rename from plugins/feature/map/Cesium/Workers/chunk-NEXD3R4K.js rename to plugins/feature/map/Cesium/Workers/chunk-ARDVIBNJ.js index ea0b4e939..83d07a234 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-NEXD3R4K.js +++ b/plugins/feature/map/Cesium/Workers/chunk-ARDVIBNJ.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as w}from"./chunk-YRCAQUFT.js";var C={};C.computePositions=function(I,f,b,n,e){let m=I*.5,i=-m,s=n+n,P=e?2*s:s,t=new Float64Array(P*3),r,c=0,o=0,p=e?s*3:0,a=e?(s+n)*3:n*3;for(r=0;r<n;r++){let y=r/n*w.TWO_PI,x=Math.cos(y),h=Math.sin(y),u=x*b,M=h*b,O=x*f,d=h*f;t[o+p]=u,t[o+p+1]=M,t[o+p+2]=i,t[o+a]=O,t[o+a+1]=d,t[o+a+2]=m,o+=3,e&&(t[c++]=u,t[c++]=M,t[c++]=i,t[c++]=O,t[c++]=d,t[c++]=m)}return t};var Y=C;export{Y as a}; +import{a as w}from"./chunk-LZC73BOP.js";var C={};C.computePositions=function(I,f,b,n,e){let m=I*.5,i=-m,s=n+n,P=e?2*s:s,t=new Float64Array(P*3),r,c=0,o=0,p=e?s*3:0,a=e?(s+n)*3:n*3;for(r=0;r<n;r++){let y=r/n*w.TWO_PI,x=Math.cos(y),h=Math.sin(y),u=x*b,M=h*b,O=x*f,d=h*f;t[o+p]=u,t[o+p+1]=M,t[o+p+2]=i,t[o+a]=O,t[o+a+1]=d,t[o+a+2]=m,o+=3,e&&(t[c++]=u,t[c++]=M,t[c++]=i,t[c++]=O,t[c++]=d,t[c++]=m)}return t};var Y=C;export{Y as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-AVPLM4UI.js b/plugins/feature/map/Cesium/Workers/chunk-AVPLM4UI.js deleted file mode 100644 index 3398c2107..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-AVPLM4UI.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{b as E,f as O,g as R,h as G,i as L}from"./chunk-3PT5NNSP.js";import{a as S,b as N,c as s,e as y,f as A}from"./chunk-FGKVHLJ4.js";import{a as u}from"./chunk-OVIPITBL.js";import{a as I,b as w}from"./chunk-ELJAHN3H.js";import{e as f}from"./chunk-3BGP4HCL.js";var U={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},F=Object.freeze(U);var r={POINTS:u.POINTS,LINES:u.LINES,LINE_LOOP:u.LINE_LOOP,LINE_STRIP:u.LINE_STRIP,TRIANGLES:u.TRIANGLES,TRIANGLE_STRIP:u.TRIANGLE_STRIP,TRIANGLE_FAN:u.TRIANGLE_FAN};r.isLines=function(t){return t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP};r.isTriangles=function(t){return t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};r.validate=function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN};var M=Object.freeze(r);function _(t){t=t??A.EMPTY_OBJECT,w.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType??M.TRIANGLES,this.boundingSphere=t.boundingSphere,this.geometryType=t.geometryType??F.NONE,this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}_.computeNumberOfVertices=function(t){w.typeOf.object("geometry",t);let c=-1;for(let a in t.attributes)if(t.attributes.hasOwnProperty(a)&&f(t.attributes[a])&&f(t.attributes[a].values)){let o=t.attributes[a],e=o.values.length/o.componentsPerAttribute;if(c!==e&&c!==-1)throw new I("All attribute lists must have the same number of attributes.");c=e}return c};var W=new N,H=new S,g=new E,Z=[new N,new N,new N],K=[new s,new s,new s],$=[new s,new s,new s],tt=new S,et=new O,rt=new E,nt=new L;_._textureCoordinateRotationPoints=function(t,c,a,o){let e,V=G.center(o,W),D=N.toCartesian(V,a,H),Y=R.eastNorthUpToFixedFrame(D,a,g),C=E.inverse(Y,g),b=K,m=Z;m[0].longitude=o.west,m[0].latitude=o.south,m[1].longitude=o.west,m[1].latitude=o.north,m[2].longitude=o.east,m[2].latitude=o.south;let n=tt;for(e=0;e<3;e++)N.toCartesian(m[e],a,n),n=E.multiplyByPointAsVector(C,n,n),b[e].x=n.x,b[e].y=n.y;let z=O.fromAxisAngle(S.UNIT_Z,-c,et),B=y.fromQuaternion(z,rt),v=t.length,T=Number.POSITIVE_INFINITY,p=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(e=0;e<v;e++)n=E.multiplyByPointAsVector(C,t[e],n),n=y.multiplyByVector(B,n,n),T=Math.min(T,n.x),p=Math.min(p,n.y),x=Math.max(x,n.x),d=Math.max(d,n.y);let j=L.fromRotation(c,nt),i=$;i[0].x=T,i[0].y=p,i[1].x=T,i[1].y=d,i[2].x=x,i[2].y=p;let l=b[0],k=b[2].x-l.x,X=b[1].y-l.y;for(e=0;e<3;e++){let h=i[e];L.multiplyByVector(j,h,h),h.x=(h.x-l.x)/k,h.y=(h.y-l.y)/X}let q=i[0],J=i[1],Q=i[2],P=new Array(6);return s.pack(q,P),s.pack(J,P,2),s.pack(Q,P,4),P};var Lt=_;function ot(t){if(t=t??A.EMPTY_OBJECT,!f(t.componentDatatype))throw new I("options.componentDatatype is required.");if(!f(t.componentsPerAttribute))throw new I("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)throw new I("options.componentsPerAttribute must be between 1 and 4.");if(!f(t.values))throw new I("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=t.normalize??!1,this.values=t.values}var Ot=ot;export{F as a,M as b,Lt as c,Ot as d}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-JQLYZQ6V.js b/plugins/feature/map/Cesium/Workers/chunk-AZINMULF.js similarity index 88% rename from plugins/feature/map/Cesium/Workers/chunk-JQLYZQ6V.js rename to plugins/feature/map/Cesium/Workers/chunk-AZINMULF.js index 3569b1f68..1c05e237e 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-JQLYZQ6V.js +++ b/plugins/feature/map/Cesium/Workers/chunk-AZINMULF.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a}from"./chunk-YRCAQUFT.js";import{a as N}from"./chunk-OVIPITBL.js";import{a as t}from"./chunk-ELJAHN3H.js";import{e as i}from"./chunk-3BGP4HCL.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))throw new t("numberOfVertices is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))throw new t("numberOfVertices is required.");if(!i(n))throw new t("sourceArray is required.");if(!i(E))throw new t("byteOffset is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,E,o):new Uint16Array(n,E,o)};r.fromTypedArray=function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var u=Object.freeze(r);export{u as a}; +import{a as N}from"./chunk-ZJRS2FK6.js";import{a}from"./chunk-LZC73BOP.js";import{a as t}from"./chunk-OU2IPMYE.js";import{f as i}from"./chunk-H7SJWKIY.js";var r={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case 2:return r.UNSIGNED_SHORT;case 4:return r.UNSIGNED_INT;case 1:return r.UNSIGNED_BYTE;default:throw new t("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){return i(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))throw new t("numberOfVertices is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n):new Uint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))throw new t("numberOfVertices is required.");if(!i(n))throw new t("sourceArray is required.");if(!i(E))throw new t("byteOffset is required.");return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(n,E,o):new Uint16Array(n,E,o)};r.fromTypedArray=function(e){if(e instanceof Uint8Array)return r.UNSIGNED_BYTE;if(e instanceof Uint16Array)return r.UNSIGNED_SHORT;if(e instanceof Uint32Array)return r.UNSIGNED_INT;throw new t("array must be a Uint8Array, Uint16Array, or Uint32Array.")};Object.freeze(r);var u=r;export{u as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-2RJONVEL.js b/plugins/feature/map/Cesium/Workers/chunk-B2EMOZB6.js similarity index 93% rename from plugins/feature/map/Cesium/Workers/chunk-2RJONVEL.js rename to plugins/feature/map/Cesium/Workers/chunk-B2EMOZB6.js index 5109ff7fc..a66b467b2 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-2RJONVEL.js +++ b/plugins/feature/map/Cesium/Workers/chunk-B2EMOZB6.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as z,c as q}from"./chunk-3RSLEP7W.js";import{a as U}from"./chunk-ALKSRI7Y.js";import{f as I}from"./chunk-3PT5NNSP.js";import{a as e,e as C}from"./chunk-FGKVHLJ4.js";import{a as O}from"./chunk-YRCAQUFT.js";import{e as j}from"./chunk-3BGP4HCL.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; +import{a as z,c as q}from"./chunk-LHXP7CH5.js";import{a as U}from"./chunk-NCJU5VAQ.js";import{h as I}from"./chunk-YZ5ZCI55.js";import{a as e,b as C}from"./chunk-OSVSBQDY.js";import{a as O}from"./chunk-LZC73BOP.js";import{f as j}from"./chunk-H7SJWKIY.js";var G={},B=new e,J=new e,_=new e,v=new e,g=[new e,new e],K=new e,W=new e,X=new e,$=new e,ee=new e,te=new e,ne=new e,oe=new e,re=new e,se=new e,F=new I,k=new C;function V(o,s,a,c,r){let d=e.angleBetween(e.subtract(s,o,B),e.subtract(a,o,J)),y=c===z.BEVELED?1:Math.ceil(d/O.toRadians(5))+1,n=y*3,l=new Array(n);l[n-3]=a.x,l[n-2]=a.y,l[n-1]=a.z;let m;r?m=C.fromQuaternion(I.fromAxisAngle(e.negate(o,B),d/y,F),k):m=C.fromQuaternion(I.fromAxisAngle(o,d/y,F),k);let t=0;s=e.clone(s,B);for(let i=0;i<y;i++)s=C.multiplyByVector(m,s,s),l[t++]=s.x,l[t++]=s.y,l[t++]=s.z;return l}function ae(o){let s=K,a=W,c=X,r=o[1];a=e.fromArray(o[1],r.length-3,a),c=e.fromArray(o[0],0,c),s=e.midpoint(a,c,s);let d=V(s,a,c,z.ROUNDED,!1),y=o.length-1,n=o[y-1];r=o[y],a=e.fromArray(n,n.length-3,a),c=e.fromArray(r,0,c),s=e.midpoint(a,c,s);let l=V(s,a,c,z.ROUNDED,!1);return[d,l]}function H(o,s,a,c){let r=B;return c?r=e.add(o,s,r):(s=e.negate(s,s),r=e.add(o,s,r)),[r.x,r.y,r.z,a.x,a.y,a.z]}function T(o,s,a,c){let r=new Array(o.length),d=new Array(o.length),y=e.multiplyByScalar(s,a,B),n=e.negate(y,J),l=0,m=o.length-1;for(let t=0;t<o.length;t+=3){let i=e.fromArray(o,t,_),w=e.add(i,n,v);r[l++]=w.x,r[l++]=w.y,r[l++]=w.z;let f=e.add(i,y,v);d[m--]=f.z,d[m--]=f.y,d[m--]=f.x}return c.push(r,d),c}G.addAttribute=function(o,s,a,c){let r=s.x,d=s.y,y=s.z;j(a)&&(o[a]=r,o[a+1]=d,o[a+2]=y),j(c)&&(o[c]=y,o[c-1]=d,o[c-2]=r)};var le=new e,ce=new e;G.computePositions=function(o){let s=o.granularity,a=o.positions,c=o.ellipsoid,r=o.width/2,d=o.cornerType,y=o.saveAttributes,n=K,l=W,m=X,t=$,i=ee,w=te,f=ne,u=oe,p=re,x=se,E=[],S=y?[]:void 0,D=y?[]:void 0,h=a[0],N=a[1];l=e.normalize(e.subtract(N,h,l),l),n=c.geodeticSurfaceNormal(h,n),t=e.normalize(e.cross(n,l,t),t),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),f=e.clone(h,f),h=N,m=e.negate(l,m);let A,P=[],M,Y=a.length;for(M=1;M<Y-1;M++){n=c.geodeticSurfaceNormal(h,n),N=a[M+1],l=e.normalize(e.subtract(N,h,l),l);let L=e.multiplyByScalar(n,e.dot(l,n),le);e.subtract(l,L,L),e.normalize(L,L);let R=e.multiplyByScalar(n,e.dot(m,n),ce);if(e.subtract(m,R,R),e.normalize(R,R),!O.equalsEpsilon(Math.abs(e.dot(L,R)),1,O.EPSILON7)){i=e.normalize(e.add(l,m,i),i),i=e.cross(i,n,i),i=e.cross(n,i,i),i=e.normalize(i,i);let Z=r/Math.max(.25,e.magnitude(e.cross(i,m,B))),b=q.angleIsGreaterThanPi(l,m,h,c);i=e.multiplyByScalar(i,Z,i),b?(u=e.add(h,i,u),x=e.add(u,e.multiplyByScalar(t,r,x),x),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(p,w),t=e.normalize(e.cross(n,l,t),t),p=e.add(u,e.multiplyByScalar(t,r*2,p),p),f=e.add(u,e.multiplyByScalar(t,r,f),f),d===z.ROUNDED||d===z.BEVELED?P.push({leftPositions:V(u,w,p,d,b)}):P.push({leftPositions:H(h,e.negate(i,i),p,b)})):(p=e.add(h,i,p),x=e.add(p,e.negate(e.multiplyByScalar(t,r,x),x),x),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),g[0]=e.clone(f,g[0]),g[1]=e.clone(x,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z)),w=e.clone(u,w),t=e.normalize(e.cross(n,l,t),t),u=e.add(p,e.negate(e.multiplyByScalar(t,r*2,u),u),u),f=e.add(p,e.negate(e.multiplyByScalar(t,r,f),f),f),d===z.ROUNDED||d===z.BEVELED?P.push({rightPositions:V(p,w,u,d,b)}):P.push({rightPositions:H(h,i,u,b)})),m=e.negate(l,m)}h=N}n=c.geodeticSurfaceNormal(h,n),g[0]=e.clone(f,g[0]),g[1]=e.clone(h,g[1]),A=U.generateArc({positions:g,granularity:s,ellipsoid:c}),E=T(A,t,r,E),y&&(S.push(t.x,t.y,t.z),D.push(n.x,n.y,n.z));let Q;return d===z.ROUNDED&&(Q=ae(E)),{positions:E,corners:P,lefts:S,normals:D,endPositions:Q}};var we=G;export{we as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-B5FT3Q23.js b/plugins/feature/map/Cesium/Workers/chunk-B5FT3Q23.js new file mode 100644 index 000000000..556dc3c71 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-B5FT3Q23.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as P,c as T}from"./chunk-KP72RGCH.js";import{a as p}from"./chunk-OSVSBQDY.js";import{a}from"./chunk-LZC73BOP.js";import{a as I,b as g}from"./chunk-OU2IPMYE.js";import{f as l}from"./chunk-H7SJWKIY.js";function w(n,i,o){if(n===0)return i*o;let t=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);return i*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}function H(n,i,o){let t=n/o;if(i===0)return t;let e=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),v=Math.sin(4*t),W=Math.cos(4*t),V=Math.sin(6*t),C=Math.cos(6*t),N=Math.sin(8*t),R=Math.cos(8*t),b=Math.sin(10*t),x=Math.cos(10*t),U=Math.sin(12*t);return t+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*W+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*C+(1097*t*M/65536+42783*t*_/1048576)*R+8011*t*_/1048576*x+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*v+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*V+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*N+(8011*M/2621440+8011*_/1048576)*b+293393*_/251658240*U}function O(n,i){if(n===0)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let o=n*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}function z(n,i,o,t,e){let c=O(n._ellipticity,o),r=O(n._ellipticity,e);return Math.atan2(a.negativePiToPi(t-i),r-c)}function k(n,i,o,t,e,c,r){let h=n._heading,s=c-t,d;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{let u=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{let u=w(n._ellipticity,i,e);d=(w(n._ellipticity,i,r)-u)/Math.cos(h)}return Math.abs(d)}var A=new p,q=new p;function y(n,i,o,t){let e=p.normalize(t.cartographicToCartesian(i,q),A),c=p.normalize(t.cartographicToCartesian(o,q),q);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);let r=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=z(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=k(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}function D(n,i,o,t,e,c){if(o===0)return P.clone(n,c);let r=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let u=w(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=H(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let _=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;let u;if(e===0)u=t*Math.cos(n.latitude);else{let f=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}return l(c)?(c.longitude=h,c.latitude=s,c.height=0,c):new P(h,s,0)}function m(n,i,o){let t=o??T.default;this._ellipsoid=t,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(n)&&l(i)&&y(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);let c=t??T.default,r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);let f=D(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?new m(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),y(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){return this.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");return D(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=new P),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)return i.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))return a.equalsEpsilon(n,c.longitude,a.EPSILON12)?void 0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);let r=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;let M=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));return i.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;let c=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);return l(i)?(i.longitude=s,i.latitude=n,i.height=0,i):new P(s,n,0)};var Y=m;export{Y as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-BCYPTFKK.js b/plugins/feature/map/Cesium/Workers/chunk-BCYPTFKK.js deleted file mode 100644 index fd325cf9e..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-BCYPTFKK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as z}from"./chunk-ZYYZDBKK.js";import{h as I,i as b}from"./chunk-3PT5NNSP.js";import{a as W,b as O,d as L}from"./chunk-FGKVHLJ4.js";import{a as m}from"./chunk-YRCAQUFT.js";import{a as v}from"./chunk-ELJAHN3H.js";import{e as k}from"./chunk-3BGP4HCL.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-BKYT7QHD.js b/plugins/feature/map/Cesium/Workers/chunk-BKYT7QHD.js deleted file mode 100644 index 82f6ab35a..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-BKYT7QHD.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as st}from"./chunk-IAW6QHRG.js";import{b as xt,c as at,d as et}from"./chunk-AVPLM4UI.js";import{a as tt}from"./chunk-WER4LUMF.js";import{a,b as Y,c as g,d as gt}from"./chunk-FGKVHLJ4.js";import{a as X}from"./chunk-YRCAQUFT.js";import{a as ft}from"./chunk-OVIPITBL.js";import{b as A}from"./chunk-ELJAHN3H.js";import{e as F}from"./chunk-3BGP4HCL.js";var ct={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};ct.validate=function(t){return t===ct.CLOCKWISE||t===ct.COUNTER_CLOCKWISE};var ht=Object.freeze(ct);function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=1/0,x=1/0;let p=-1/0,y=-1/0;for(let b=e;b<r;b+=e){let S=t[b],h=t[b+1];S<c&&(c=S),h<x&&(x=h),S>p&&(p=S),h>y&&(y=h)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return rt(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(ot(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(ot(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function rt(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),ot(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),rt(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):rt(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),h=o.next;for(;h!==n;){if(h.x>=p&&h.x<=b&&h.y>=y&&h.y<=S&&nt(r,c,s,x,i,u,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),h=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,h,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=h&&l.y<=L&&l!==r&&l!==i&&nt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=h&&f.y<=L&&f!==r&&f!==i&&nt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&it(o,r)&&it(r,o)&&(n.push(o.i,e.i,r.i),ot(e),ot(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),rt(i,n,e,o,r,s,0),rt(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);it(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function nt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(it(t,n)&&it(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function it(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new a,Jt=new a,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?ht.COUNTER_CLOCKWISE:ht.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new a,Ot=new a,Zt=new a,At=new a,Ct=new a,Et=new a,R=new a,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=a.fromArray(u,m*3,Tt),C=a.fromArray(u,f*3,Ot),V=a.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=a.multiplyByScalar(a.normalize(M,At),T,At),U=a.multiplyByScalar(a.normalize(C,Ct),T,Ct),W=a.multiplyByScalar(a.normalize(V,Et),T,Et),$=a.magnitudeSquared(a.subtract(k,U,R)),G=a.magnitudeSquared(a.subtract(U,W,R)),Q=a.magnitudeSquared(a.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=h[O],F(c)||(v=a.add(M,C,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=h[O],F(c)||(v=a.add(C,V,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=h[O],F(c)||(v=a.add(V,M,R),a.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,h[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],h={},T=t.maximumRadius,L=X.chordLength(r,T),z=new st(void 0,void 0,t),D=new st(void 0,void 0,t),l=new st(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=a.fromArray(u,C*3,Tt),q=a.fromArray(u,M*3,Ot),J=a.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=h[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=h[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=h[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=a.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,h[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new at(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)a.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),a.multiplyByScalar(r,n,r),a.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{ht as a,de as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-C5UTI7P4.js b/plugins/feature/map/Cesium/Workers/chunk-C5UTI7P4.js new file mode 100644 index 000000000..69a6ff4ca --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-C5UTI7P4.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as P}from"./chunk-DV5LK4D5.js";import{a as u,b as d}from"./chunk-ZNBU4MZZ.js";import{a as j}from"./chunk-SIBAZPZR.js";import{i as A}from"./chunk-YZ5ZCI55.js";import{a as _,b as h}from"./chunk-HLXNFZAZ.js";import{b as l,c as g}from"./chunk-KP72RGCH.js";import{a as e}from"./chunk-OSVSBQDY.js";import{a as y,b as p}from"./chunk-OU2IPMYE.js";import{f as r}from"./chunk-H7SJWKIY.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-CB2GA3G5.js b/plugins/feature/map/Cesium/Workers/chunk-CB2GA3G5.js new file mode 100644 index 000000000..f1aceebfc --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-CB2GA3G5.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as D,c as B}from"./chunk-KP72RGCH.js";import{a as y}from"./chunk-OSVSBQDY.js";import{a as z}from"./chunk-LZC73BOP.js";import{b as q}from"./chunk-OU2IPMYE.js";import{f as L}from"./chunk-H7SJWKIY.js";function X(n){let a=n._uSquared,t=n._ellipsoid.maximumRadius,e=n._ellipsoid.minimumRadius,g=(t-e)/t,m=Math.cos(n._startHeading),_=Math.sin(n._startHeading),r=(1-g)*Math.tan(n._start.latitude),p=1/Math.sqrt(1+r*r),R=p*r,f=Math.atan2(r,m),l=p*_,U=l*l,i=1-U,A=Math.sqrt(i),c=a/4,o=c*c,h=o*c,S=o*o,M=1+c-3*o/4+5*h/4-175*S/64,C=1-c+15*o/8-35*h/8,u=1-3*c+35*o/4,d=1-5*c,w=M*f-C*Math.sin(2*f)*c/2-u*Math.sin(4*f)*o/16-d*Math.sin(6*f)*h/48-Math.sin(8*f)*5*S/512,s=n._constants;s.a=t,s.b=e,s.f=g,s.cosineHeading=m,s.sineHeading=_,s.tanU=r,s.cosineU=p,s.sineU=R,s.sigma=f,s.sineAlpha=l,s.sineSquaredAlpha=U,s.cosineSquaredAlpha=i,s.cosineAlpha=A,s.u2Over4=c,s.u4Over16=o,s.u6Over64=h,s.u8Over256=S,s.a0=M,s.a1=C,s.a2=u,s.a3=d,s.distanceRatio=w}function Y(n,a){return n*a*(4+n*(4-3*a))/16}function k(n,a,t,e,g,m,_){let r=Y(n,t);return(1-r)*n*a*(e+r*g*(_+r*m*(2*_*_-1)))}function Z(n,a,t,e,g,m,_){let r=(a-t)/a,p=m-e,R=Math.atan((1-r)*Math.tan(g)),f=Math.atan((1-r)*Math.tan(_)),l=Math.cos(R),U=Math.sin(R),i=Math.cos(f),A=Math.sin(f),c=l*i,o=l*A,h=U*A,S=U*i,M=p,C,u,d,w,s,O,H,b;do{u=Math.cos(M),d=Math.sin(M);let I=o-S*u;O=Math.sqrt(i*i*d*d+I*I),s=h+c*u,w=Math.atan2(O,s);let E;O===0?(E=0,H=1):(E=c*d/O,H=1-E*E),C=M,b=s-2*h/H,isFinite(b)||(b=0),M=p+k(r,E,H,w,O,s,b)}while(Math.abs(M-C)>z.EPSILON12);let v=H*(a*a-t*t)/(t*t),J=1+v*(4096+v*(v*(320-175*v)-768))/16384,T=v*(256+v*(v*(74-47*v)-128))/1024,F=b*b,K=T*O*(b+T*(s*(2*F-1)-T*b*(4*O*O-3)*(4*F-3)/6)/4),Q=t*J*(w-K),V=Math.atan2(i*d,o-S*u),W=Math.atan2(l*d,o*u-S);n._distance=Q,n._startHeading=V,n._endHeading=W,n._uSquared=v}var $=new y,x=new y;function N(n,a,t,e){let g=y.normalize(e.cartographicToCartesian(a,x),$),m=y.normalize(e.cartographicToCartesian(t,x),x);q.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(y.angleBetween(g,m))-Math.PI),.0125),Z(n,e.maximumRadius,e.minimumRadius,a.longitude,a.latitude,t.longitude,t.latitude),n._start=D.clone(a,n._start),n._end=D.clone(t,n._end),n._start.height=0,n._end.height=0,X(n)}function P(n,a,t){let e=t??B.default;this._ellipsoid=e,this._start=new D,this._end=new D,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,L(n)&&L(a)&&N(this,n,a,e)}Object.defineProperties(P.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return q.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return q.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return q.defined("distance",this._distance),this._endHeading}}});P.prototype.setEndPoints=function(n,a){q.defined("start",n),q.defined("end",a),N(this,n,a,this._ellipsoid)};P.prototype.interpolateUsingFraction=function(n,a){return this.interpolateUsingSurfaceDistance(this._distance*n,a)};P.prototype.interpolateUsingSurfaceDistance=function(n,a){q.defined("distance",this._distance);let t=this._constants,e=t.distanceRatio+n/t.b,g=Math.cos(2*e),m=Math.cos(4*e),_=Math.cos(6*e),r=Math.sin(2*e),p=Math.sin(4*e),R=Math.sin(6*e),f=Math.sin(8*e),l=e*e,U=e*l,i=t.u8Over256,A=t.u2Over4,c=t.u6Over64,o=t.u4Over16,h=2*U*i*g/3+e*(1-A+7*o/4-15*c/4+579*i/64-(o-15*c/4+187*i/16)*g-(5*c/4-115*i/16)*m-29*i*_/16)+(A/2-o+71*c/32-85*i/16)*r+(5*o/16-5*c/4+383*i/96)*p-l*((c-11*i/2)*r+5*i*p/2)+(29*c/96-29*i/16)*R+539*i*f/1536,S=Math.asin(Math.sin(h)*t.cosineAlpha),M=Math.atan(t.a/t.b*Math.tan(S));h=h-t.sigma;let C=Math.cos(2*t.sigma+h),u=Math.sin(h),d=Math.cos(h),w=t.cosineU*d,s=t.sineU*u,H=Math.atan2(u*t.sineHeading,w-s*t.cosineHeading)-k(t.f,t.sineAlpha,t.cosineSquaredAlpha,h,u,d,C);return L(a)?(a.longitude=this._start.longitude+H,a.latitude=M,a.height=0,a):new D(this._start.longitude+H,M,0)};var et=P;export{et as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-CYYYI5LY.js b/plugins/feature/map/Cesium/Workers/chunk-CYYYI5LY.js new file mode 100644 index 000000000..82a40dd01 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-CYYYI5LY.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as L}from"./chunk-7IFFXLK3.js";import{a as S}from"./chunk-GNBKSQYP.js";import{a as D}from"./chunk-AZINMULF.js";import{a as H}from"./chunk-ILBQ77ZM.js";import{b as T,c as B,d as x}from"./chunk-7RNSURKI.js";import{c as E}from"./chunk-THB3EPLO.js";import{a as O}from"./chunk-WCOEOHX5.js";import{c as d}from"./chunk-KP72RGCH.js";import{a as c,c as V}from"./chunk-OSVSBQDY.js";import{a as w}from"./chunk-LZC73BOP.js";import{a as A}from"./chunk-OU2IPMYE.js";import{f as a}from"./chunk-H7SJWKIY.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,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(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-D3YAYYEG.js b/plugins/feature/map/Cesium/Workers/chunk-D3YAYYEG.js new file mode 100644 index 000000000..590e3691d --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-D3YAYYEG.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as C}from"./chunk-LZC73BOP.js";import{b as g}from"./chunk-OU2IPMYE.js";import{f}from"./chunk-H7SJWKIY.js";var d=C.EPSILON10;function x(e,r,h,n){if(g.defined("equalsEpsilon",r),!f(e))return;h=h??!1;let c=f(n),l=e.length;if(l<2)return e;let i,s=e[0],o,t,p=0,m=-1;for(i=1;i<l;++i)o=e[i],r(s,o,d)?(f(t)||(t=e.slice(0,i),p=i-1,m=0),c&&n.push(i)):(f(t)&&(t.push(o),p=i,c&&(m=n.length)),s=o);return h&&r(e[0],e[l-1],d)&&(c&&(f(t)?n.splice(m,0,p):n.push(l-1)),f(t)?t.length-=1:t=e.slice(0,-1)),f(t)?t:e}var k=x;export{k as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-K6A7NKZT.js b/plugins/feature/map/Cesium/Workers/chunk-DV5LK4D5.js similarity index 51% rename from plugins/feature/map/Cesium/Workers/chunk-K6A7NKZT.js rename to plugins/feature/map/Cesium/Workers/chunk-DV5LK4D5.js index 51d30957f..416b531e3 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-K6A7NKZT.js +++ b/plugins/feature/map/Cesium/Workers/chunk-DV5LK4D5.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{b as d}from"./chunk-ZYYZDBKK.js";import{a as i}from"./chunk-FGKVHLJ4.js";import{b as r}from"./chunk-ELJAHN3H.js";import{e as c}from"./chunk-3BGP4HCL.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return r.defined("minimum",m),r.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,a=m[0].y,u=m[0].z,o=m[0].x,y=m[0].y,l=m[0].z,q=m.length;for(let E=1;E<q;E++){let M=m[E],z=M.x,Z=M.y,p=M.z;e=Math.min(z,e),o=Math.max(z,o),a=Math.min(Z,a),y=Math.max(Z,y),u=Math.min(p,u),l=Math.max(p,l)}let f=n.minimum;f.x=e,f.y=a,f.z=u;let x=n.maximum;return x.x=o,x.y=y,x.z=l,n.center=i.midpoint(f,x,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var h=new i;t.intersectPlane=function(m,n){r.defined("box",m),r.defined("plane",n),h=i.subtract(m.maximum,m.minimum,h);let e=i.multiplyByScalar(h,.5,h),a=n.normal,u=e.x*Math.abs(a.x)+e.y*Math.abs(a.y)+e.z*Math.abs(a.z),o=i.dot(m.center,a)+n.distance;return o-u>0?d.INSIDE:o+u<0?d.OUTSIDE:d.INTERSECTING};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var S=t;export{S as a}; +import{a as d}from"./chunk-QQWQKL3T.js";import{a as i}from"./chunk-OSVSBQDY.js";import{b as a}from"./chunk-OU2IPMYE.js";import{f as c}from"./chunk-H7SJWKIY.js";function t(m,n,e){this.minimum=i.clone(m??i.ZERO),this.maximum=i.clone(n??i.ZERO),c(e)?e=i.clone(e):e=i.midpoint(this.minimum,this.maximum,new i),this.center=e}t.fromCorners=function(m,n,e){return a.defined("minimum",m),a.defined("maximum",n),c(e)||(e=new t),e.minimum=i.clone(m,e.minimum),e.maximum=i.clone(n,e.maximum),e.center=i.midpoint(m,n,e.center),e};t.fromPoints=function(m,n){if(c(n)||(n=new t),!c(m)||m.length===0)return n.minimum=i.clone(i.ZERO,n.minimum),n.maximum=i.clone(i.ZERO,n.maximum),n.center=i.clone(i.ZERO,n.center),n;let e=m[0].x,u=m[0].y,o=m[0].z,r=m[0].x,h=m[0].y,l=m[0].z,A=m.length;for(let z=1;z<A;z++){let B=m[z],E=B.x,M=B.y,p=B.z;e=Math.min(E,e),r=Math.max(E,r),u=Math.min(M,u),h=Math.max(M,h),o=Math.min(p,o),l=Math.max(p,l)}let x=n.minimum;x.x=e,x.y=u,x.z=o;let f=n.maximum;return f.x=r,f.y=h,f.z=l,n.center=i.midpoint(x,f,n.center),n};t.clone=function(m,n){if(c(m))return c(n)?(n.minimum=i.clone(m.minimum,n.minimum),n.maximum=i.clone(m.maximum,n.maximum),n.center=i.clone(m.center,n.center),n):new t(m.minimum,m.maximum,m.center)};t.equals=function(m,n){return m===n||c(m)&&c(n)&&i.equals(m.center,n.center)&&i.equals(m.minimum,n.minimum)&&i.equals(m.maximum,n.maximum)};var y=new i;t.intersectPlane=function(m,n){a.defined("box",m),a.defined("plane",n),y=i.subtract(m.maximum,m.minimum,y);let e=i.multiplyByScalar(y,.5,y),u=n.normal,o=e.x*Math.abs(u.x)+e.y*Math.abs(u.y)+e.z*Math.abs(u.z),r=i.dot(m.center,u)+n.distance;return r-o>0?d.INSIDE:r+o<0?d.OUTSIDE:d.INTERSECTING};t.intersectAxisAlignedBoundingBox=function(m,n){return a.defined("box",m),a.defined("other",n),m.minimum.x<=n.maximum.x&&m.maximum.x>=n.minimum.x&&m.minimum.y<=n.maximum.y&&m.maximum.y>=n.minimum.y&&m.minimum.z<=n.maximum.z&&m.maximum.z>=n.minimum.z};t.prototype.clone=function(m){return t.clone(this,m)};t.prototype.intersectPlane=function(m){return t.intersectPlane(this,m)};t.prototype.intersectAxisAlignedBoundingBox=function(m){return t.intersectAxisAlignedBoundingBox(this,m)};t.prototype.equals=function(m){return t.equals(this,m)};var O=t;export{O as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-EFXTPVRC.js b/plugins/feature/map/Cesium/Workers/chunk-EFXTPVRC.js deleted file mode 100644 index 12c59b4c3..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-EFXTPVRC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as h}from"./chunk-LUT6AMUC.js";import{a as n,c as y,e as a}from"./chunk-FGKVHLJ4.js";import{b as f}from"./chunk-ELJAHN3H.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-XOTNFHCP.js b/plugins/feature/map/Cesium/Workers/chunk-EL5WNS34.js similarity index 90% rename from plugins/feature/map/Cesium/Workers/chunk-XOTNFHCP.js rename to plugins/feature/map/Cesium/Workers/chunk-EL5WNS34.js index 1bedc80d0..74fda8c8f 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-XOTNFHCP.js +++ b/plugins/feature/map/Cesium/Workers/chunk-EL5WNS34.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as c}from"./chunk-FGKVHLJ4.js";import{b as t}from"./chunk-ELJAHN3H.js";import{e as g}from"./chunk-3BGP4HCL.js";function f(){this.high=c.clone(c.ZERO),this.low=c.clone(c.ZERO)}f.encode=function(n,o){t.typeOf.number("value",n),g(o)||(o={high:0,low:0});let h;return n>=0?(h=Math.floor(n/65536)*65536,o.high=h,o.low=n-h):(h=Math.floor(-n/65536)*65536,o.high=-h,o.low=n+h),o};var e={high:0,low:0};f.fromCartesian=function(n,o){t.typeOf.object("cartesian",n),g(o)||(o=new f);let h=o.high,i=o.low;return f.encode(n.x,e),h.x=e.high,i.x=e.low,f.encode(n.y,e),h.y=e.high,i.y=e.low,f.encode(n.z,e),h.z=e.high,i.z=e.low,o};var m=new f;f.writeElements=function(n,o,h){t.defined("cartesianArray",o),t.typeOf.number("index",h),t.typeOf.number.greaterThanOrEquals("index",h,0),f.fromCartesian(n,m);let i=m.high,w=m.low;o[h]=i.x,o[h+1]=i.y,o[h+2]=i.z,o[h+3]=w.x,o[h+4]=w.y,o[h+5]=w.z};var O=f;export{O as a}; +import{a as c}from"./chunk-OSVSBQDY.js";import{b as t}from"./chunk-OU2IPMYE.js";import{f as g}from"./chunk-H7SJWKIY.js";function f(){this.high=c.clone(c.ZERO),this.low=c.clone(c.ZERO)}f.encode=function(n,o){t.typeOf.number("value",n),g(o)||(o={high:0,low:0});let h;return n>=0?(h=Math.floor(n/65536)*65536,o.high=h,o.low=n-h):(h=Math.floor(-n/65536)*65536,o.high=-h,o.low=n+h),o};var e={high:0,low:0};f.fromCartesian=function(n,o){t.typeOf.object("cartesian",n),g(o)||(o=new f);let h=o.high,i=o.low;return f.encode(n.x,e),h.x=e.high,i.x=e.low,f.encode(n.y,e),h.y=e.high,i.y=e.low,f.encode(n.z,e),h.z=e.high,i.z=e.low,o};var m=new f;f.writeElements=function(n,o,h){t.defined("cartesianArray",o),t.typeOf.number("index",h),t.typeOf.number.greaterThanOrEquals("index",h,0),f.fromCartesian(n,m);let i=m.high,w=m.low;o[h]=i.x,o[h+1]=i.y,o[h+2]=i.z,o[h+3]=w.x,o[h+4]=w.y,o[h+5]=w.z};var O=f;export{O as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-FGKVHLJ4.js b/plugins/feature/map/Cesium/Workers/chunk-FGKVHLJ4.js deleted file mode 100644 index 47b76d9c1..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-FGKVHLJ4.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as h}from"./chunk-YRCAQUFT.js";import{a as g,b as c}from"./chunk-ELJAHN3H.js";import{e as u}from"./chunk-3BGP4HCL.js";function f(n,e,o){this.x=n??0,this.y=e??0,this.z=o??0}f.fromSpherical=function(n,e){c.typeOf.object("spherical",n),u(e)||(e=new f);let o=n.clock,t=n.cone,i=n.magnitude??1,p=i*Math.sin(t);return e.x=p*Math.cos(o),e.y=p*Math.sin(o),e.z=i*Math.cos(t),e};f.fromElements=function(n,e,o,t){return u(t)?(t.x=n,t.y=e,t.z=o,t):new f(n,e,o)};f.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e.z=n.z,e):new f(n.x,n.y,n.z)};f.fromCartesian4=f.clone;f.packedLength=3;f.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,e[o++]=n.x,e[o++]=n.y,e[o]=n.z,e};f.unpack=function(n,e,o){return c.defined("array",n),e=e??0,u(o)||(o=new f),o.x=n[e++],o.y=n[e++],o.z=n[e],o};f.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*3;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new g("If result is a typed array, it must have exactly array.length * 3 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)f.pack(n[i],e,i*3);return e};f.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new g("array length must be a multiple of 3.");let o=n.length;u(e)?e.length=o/3:e=new Array(o/3);for(let t=0;t<o;t+=3){let i=t/3;e[i]=f.unpack(n,t,e[i])}return e};f.fromArray=f.unpack;f.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)};f.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)};f.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o.z=Math.min(n.z,e.z),o};f.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o.z=Math.max(n.z,e.z),o};f.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=h.clamp(n.x,e.x,o.x),p=h.clamp(n.y,e.y,o.y),d=h.clamp(n.z,e.z,o.z);return t.x=i,t.y=p,t.z=d,t};f.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z};f.magnitude=function(n){return Math.sqrt(f.magnitudeSquared(n))};var X=new f;f.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,X),f.magnitude(X)};f.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),f.subtract(n,e,X),f.magnitudeSquared(X)};f.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,e.z=n.z/o,isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new g("normalized result is not a number");return e};f.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y+n.z*e.z};f.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o.z=n.z*e.z,o};f.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o.z=n.z/e.z,o};f.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o.z=n.z+e.z,o};f.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o.z=n.z-e.z,o};f.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o.z=n.z*e,o};f.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o.z=n.z/e,o};f.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e.z=-n.z,e};f.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e.z=Math.abs(n.z),e};var Tn=new f;f.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),f.multiplyByScalar(e,o,Tn),t=f.multiplyByScalar(n,1-o,t),f.add(Tn,t,t)};var Y=new f,dn=new f;f.angleBetween=function(n,e){c.typeOf.object("left",n),c.typeOf.object("right",e),f.normalize(n,Y),f.normalize(e,dn);let o=f.dot(Y,dn),t=f.magnitude(f.cross(Y,dn,Y));return Math.atan2(t,o)};var Yn=new f;f.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=f.normalize(n,Yn);return f.abs(o,o),o.x<=o.y?o.x<=o.z?e=f.clone(f.UNIT_X,e):e=f.clone(f.UNIT_Z,e):o.y<=o.z?e=f.clone(f.UNIT_Y,e):e=f.clone(f.UNIT_Z,e),e};f.projectVector=function(n,e,o){c.defined("a",n),c.defined("b",e),c.defined("result",o);let t=f.dot(n,e)/f.dot(e,e);return f.multiplyByScalar(e,t,o)};f.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y&&n.z===e.z};f.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]&&n.z===e[o+2]};f.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&h.equalsEpsilon(n.x,e.x,o,t)&&h.equalsEpsilon(n.y,e.y,o,t)&&h.equalsEpsilon(n.z,e.z,o,t)};f.cross=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n.x,i=n.y,p=n.z,d=e.x,m=e.y,s=e.z,b=i*s-p*m,w=p*d-t*s,S=t*m-i*d;return o.x=b,o.y=w,o.z=S,o};f.midpoint=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=(n.x+e.x)*.5,o.y=(n.y+e.y)*.5,o.z=(n.z+e.z)*.5,o};f.fromDegrees=function(n,e,o,t,i){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=h.toRadians(n),e=h.toRadians(e),f.fromRadians(n,e,o,t,i)};var T=new f,V=new f;f._ellipsoidRadiiSquared=new f(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);f.fromRadians=function(n,e,o,t,i){c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=o??0;let p=u(t)?t.radiiSquared:f._ellipsoidRadiiSquared,d=Math.cos(e);T.x=d*Math.cos(n),T.y=d*Math.sin(n),T.z=Math.sin(e),T=f.normalize(T,T),f.multiplyComponents(p,T,V);let m=Math.sqrt(f.dot(T,V));return V=f.divideByScalar(V,m,V),T=f.multiplyByScalar(T,o,T),u(i)||(i=new f),f.add(V,T,i)};f.fromDegreesArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new g("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromDegrees(p,d,0,e,o[m])}return o};f.fromRadiansArray=function(n,e,o){if(c.defined("coordinates",n),n.length<2||n.length%2!==0)throw new g("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;u(o)?o.length=t/2:o=new Array(t/2);for(let i=0;i<t;i+=2){let p=n[i],d=n[i+1],m=i/2;o[m]=f.fromRadians(p,d,0,e,o[m])}return o};f.fromDegreesArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new g("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromDegrees(p,d,m,e,o[s])}return o};f.fromRadiansArrayHeights=function(n,e,o){if(c.defined("coordinates",n),n.length<3||n.length%3!==0)throw new g("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;u(o)?o.length=t/3:o=new Array(t/3);for(let i=0;i<t;i+=3){let p=n[i],d=n[i+1],m=n[i+2],s=i/3;o[s]=f.fromRadians(p,d,m,e,o[s])}return o};f.ZERO=Object.freeze(new f(0,0,0));f.ONE=Object.freeze(new f(1,1,1));f.UNIT_X=Object.freeze(new f(1,0,0));f.UNIT_Y=Object.freeze(new f(0,1,0));f.UNIT_Z=Object.freeze(new f(0,0,1));f.prototype.clone=function(n){return f.clone(this,n)};f.prototype.equals=function(n){return f.equals(this,n)};f.prototype.equalsEpsilon=function(n,e,o){return f.equalsEpsilon(this,n,e,o)};f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var y=f;var Xn=new y,Gn=new y;function Hn(n,e,o,t,i){if(!u(n))throw new g("cartesian is required.");if(!u(e))throw new g("oneOverRadii is required.");if(!u(o))throw new g("oneOverRadiiSquared is required.");if(!u(t))throw new g("centerToleranceSquared is required.");let p=n.x,d=n.y,m=n.z,s=e.x,b=e.y,w=e.z,S=p*p*s*s,R=d*d*b*b,M=m*m*w*w,C=S+R+M,_=Math.sqrt(1/C),N=y.multiplyByScalar(n,_,Xn);if(C<t)return isFinite(_)?y.clone(N,i):void 0;let B=o.x,U=o.y,P=o.z,F=Gn;F.x=N.x*B*2,F.y=N.y*U*2,F.z=N.z*P*2;let Z=(1-_)*y.magnitude(n)/(.5*y.magnitude(F)),Mn=0,rn,qn,I,L,W,pn,un,an,En,An,_n;do{Z-=Mn,I=1/(1+Z*B),L=1/(1+Z*U),W=1/(1+Z*P),pn=I*I,un=L*L,an=W*W,En=pn*I,An=un*L,_n=an*W,rn=S*pn+R*un+M*an-1,qn=S*En*B+R*An*U+M*_n*P;let Zn=-2*qn;Mn=rn/Zn}while(Math.abs(rn)>h.EPSILON12);return u(i)?(i.x=p*I,i.y=d*L,i.z=m*W,i):new y(p*I,d*L,m*W)}var G=Hn;function j(n,e,o){this.longitude=n??0,this.latitude=e??0,this.height=o??0}j.fromRadians=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),o=o??0,u(t)?(t.longitude=n,t.latitude=e,t.height=o,t):new j(n,e,o)};j.fromDegrees=function(n,e,o,t){return c.typeOf.number("longitude",n),c.typeOf.number("latitude",e),n=h.toRadians(n),e=h.toRadians(e),j.fromRadians(n,e,o,t)};var Qn=new y,Jn=new y,Kn=new y;j._ellipsoidOneOverRadii=new y(1/6378137,1/6378137,1/6356752314245179e-9);j._ellipsoidOneOverRadiiSquared=new y(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));j._ellipsoidCenterToleranceSquared=h.EPSILON1;j.fromCartesian=function(n,e,o){let t=u(e)?e.oneOverRadii:j._ellipsoidOneOverRadii,i=u(e)?e.oneOverRadiiSquared:j._ellipsoidOneOverRadiiSquared,p=u(e)?e._centerToleranceSquared:j._ellipsoidCenterToleranceSquared,d=G(n,t,i,p,Jn);if(!u(d))return;let m=y.multiplyComponents(d,i,Qn);m=y.normalize(m,m);let s=y.subtract(n,d,Kn),b=Math.atan2(m.y,m.x),w=Math.asin(m.z),S=h.sign(y.dot(s,n))*y.magnitude(s);return u(o)?(o.longitude=b,o.latitude=w,o.height=S,o):new j(b,w,S)};j.toCartesian=function(n,e,o){return c.defined("cartographic",n),y.fromRadians(n.longitude,n.latitude,n.height,e,o)};j.clone=function(n,e){if(u(n))return u(e)?(e.longitude=n.longitude,e.latitude=n.latitude,e.height=n.height,e):new j(n.longitude,n.latitude,n.height)};j.equals=function(n,e){return n===e||u(n)&&u(e)&&n.longitude===e.longitude&&n.latitude===e.latitude&&n.height===e.height};j.equalsEpsilon=function(n,e,o){return o=o??0,n===e||u(n)&&u(e)&&Math.abs(n.longitude-e.longitude)<=o&&Math.abs(n.latitude-e.latitude)<=o&&Math.abs(n.height-e.height)<=o};j.ZERO=Object.freeze(new j(0,0,0));j.prototype.clone=function(n){return j.clone(this,n)};j.prototype.equals=function(n){return j.equals(this,n)};j.prototype.equalsEpsilon=function(n,e){return j.equalsEpsilon(this,n,e)};j.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var $=j;function a(n,e){this.x=n??0,this.y=e??0}a.fromElements=function(n,e,o){return u(o)?(o.x=n,o.y=e,o):new a(n,e)};a.clone=function(n,e){if(u(n))return u(e)?(e.x=n.x,e.y=n.y,e):new a(n.x,n.y)};a.fromCartesian3=a.clone;a.fromCartesian4=a.clone;a.packedLength=2;a.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,e[o++]=n.x,e[o]=n.y,e};a.unpack=function(n,e,o){return c.defined("array",n),e=e??0,u(o)||(o=new a),o.x=n[e++],o.y=n[e],o};a.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*2;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new g("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)a.pack(n[i],e,i*2);return e};a.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,2),n.length%2!==0)throw new g("array length must be a multiple of 2.");let o=n.length;u(e)?e.length=o/2:e=new Array(o/2);for(let t=0;t<o;t+=2){let i=t/2;e[i]=a.unpack(n,t,e[i])}return e};a.fromArray=a.unpack;a.maximumComponent=function(n){return c.typeOf.object("cartesian",n),Math.max(n.x,n.y)};a.minimumComponent=function(n){return c.typeOf.object("cartesian",n),Math.min(n.x,n.y)};a.minimumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.min(n.x,e.x),o.y=Math.min(n.y,e.y),o};a.maximumByComponent=function(n,e,o){return c.typeOf.object("first",n),c.typeOf.object("second",e),c.typeOf.object("result",o),o.x=Math.max(n.x,e.x),o.y=Math.max(n.y,e.y),o};a.clamp=function(n,e,o,t){c.typeOf.object("value",n),c.typeOf.object("min",e),c.typeOf.object("max",o),c.typeOf.object("result",t);let i=h.clamp(n.x,e.x,o.x),p=h.clamp(n.y,e.y,o.y);return t.x=i,t.y=p,t};a.magnitudeSquared=function(n){return c.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y};a.magnitude=function(n){return Math.sqrt(a.magnitudeSquared(n))};var H=new a;a.distance=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,H),a.magnitude(H)};a.distanceSquared=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.subtract(n,e,H),a.magnitudeSquared(H)};a.normalize=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.magnitude(n);if(e.x=n.x/o,e.y=n.y/o,isNaN(e.x)||isNaN(e.y))throw new g("normalized result is not a number");return e};a.dot=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.x+n.y*e.y};a.cross=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),n.x*e.y-n.y*e.x};a.multiplyComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x*e.x,o.y=n.y*e.y,o};a.divideComponents=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x/e.x,o.y=n.y/e.y,o};a.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x+e.x,o.y=n.y+e.y,o};a.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o.x=n.x-e.x,o.y=n.y-e.y,o};a.multiplyByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x*e,o.y=n.y*e,o};a.divideByScalar=function(n,e,o){return c.typeOf.object("cartesian",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o.x=n.x/e,o.y=n.y/e,o};a.negate=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=-n.x,e.y=-n.y,e};a.abs=function(n,e){return c.typeOf.object("cartesian",n),c.typeOf.object("result",e),e.x=Math.abs(n.x),e.y=Math.abs(n.y),e};var ln=new a;a.lerp=function(n,e,o,t){return c.typeOf.object("start",n),c.typeOf.object("end",e),c.typeOf.number("t",o),c.typeOf.object("result",t),a.multiplyByScalar(e,o,ln),t=a.multiplyByScalar(n,1-o,t),a.add(ln,t,t)};var Cn=new a,Nn=new a;a.angleBetween=function(n,e){return c.typeOf.object("left",n),c.typeOf.object("right",e),a.normalize(n,Cn),a.normalize(e,Nn),h.acosClamped(a.dot(Cn,Nn))};var ne=new a;a.mostOrthogonalAxis=function(n,e){c.typeOf.object("cartesian",n),c.typeOf.object("result",e);let o=a.normalize(n,ne);return a.abs(o,o),o.x<=o.y?e=a.clone(a.UNIT_X,e):e=a.clone(a.UNIT_Y,e),e};a.equals=function(n,e){return n===e||u(n)&&u(e)&&n.x===e.x&&n.y===e.y};a.equalsArray=function(n,e,o){return n.x===e[o]&&n.y===e[o+1]};a.equalsEpsilon=function(n,e,o,t){return n===e||u(n)&&u(e)&&h.equalsEpsilon(n.x,e.x,o,t)&&h.equalsEpsilon(n.y,e.y,o,t)};a.ZERO=Object.freeze(new a(0,0));a.ONE=Object.freeze(new a(1,1));a.UNIT_X=Object.freeze(new a(1,0));a.UNIT_Y=Object.freeze(new a(0,1));a.prototype.clone=function(n){return a.clone(this,n)};a.prototype.equals=function(n){return a.equals(this,n)};a.prototype.equalsEpsilon=function(n,e,o){return a.equalsEpsilon(this,n,e,o)};a.prototype.toString=function(){return`(${this.x}, ${this.y})`};var yn=a;function Fn(n,e,o,t){e=e??0,o=o??0,t=t??0,c.typeOf.number.greaterThanOrEquals("x",e,0),c.typeOf.number.greaterThanOrEquals("y",o,0),c.typeOf.number.greaterThanOrEquals("z",t,0),n._radii=new y(e,o,t),n._radiiSquared=new y(e*e,o*o,t*t),n._radiiToTheFourth=new y(e*e*e*e,o*o*o*o,t*t*t*t),n._oneOverRadii=new y(e===0?0:1/e,o===0?0:1/o,t===0?0:1/t),n._oneOverRadiiSquared=new y(e===0?0:1/(e*e),o===0?0:1/(o*o),t===0?0:1/(t*t)),n._minimumRadius=Math.min(e,o,t),n._maximumRadius=Math.max(e,o,t),n._centerToleranceSquared=h.EPSILON1,n._radiiSquared.z!==0&&(n._squaredXOverSquaredZ=n._radiiSquared.x/n._radiiSquared.z)}function O(n,e,o){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,Fn(this,n,e,o)}Object.defineProperties(O.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}}});O.clone=function(n,e){if(!u(n))return;let o=n._radii;return u(e)?(y.clone(o,e._radii),y.clone(n._radiiSquared,e._radiiSquared),y.clone(n._radiiToTheFourth,e._radiiToTheFourth),y.clone(n._oneOverRadii,e._oneOverRadii),y.clone(n._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=n._minimumRadius,e._maximumRadius=n._maximumRadius,e._centerToleranceSquared=n._centerToleranceSquared,e):new O(o.x,o.y,o.z)};O.fromCartesian3=function(n,e){return u(e)||(e=new O),u(n)&&Fn(e,n.x,n.y,n.z),e};O.WGS84=Object.freeze(new O(6378137,6378137,6356752314245179e-9));O.UNIT_SPHERE=Object.freeze(new O(1,1,1));O.MOON=Object.freeze(new O(h.LUNAR_RADIUS,h.LUNAR_RADIUS,h.LUNAR_RADIUS));O._default=O.WGS84;Object.defineProperties(O,{default:{get:function(){return O._default},set:function(n){c.typeOf.object("value",n),O._default=n,y._ellipsoidRadiiSquared=n.radiiSquared,$._ellipsoidOneOverRadii=n.oneOverRadii,$._ellipsoidOneOverRadiiSquared=n.oneOverRadiiSquared,$._ellipsoidCenterToleranceSquared=n._centerToleranceSquared}}});O.prototype.clone=function(n){return O.clone(this,n)};O.packedLength=y.packedLength;O.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,y.pack(n._radii,e,o),e};O.unpack=function(n,e,o){c.defined("array",n),e=e??0;let t=y.unpack(n,e);return O.fromCartesian3(t,o)};O.prototype.geocentricSurfaceNormal=y.normalize;O.prototype.geodeticSurfaceNormalCartographic=function(n,e){c.typeOf.object("cartographic",n);let o=n.longitude,t=n.latitude,i=Math.cos(t),p=i*Math.cos(o),d=i*Math.sin(o),m=Math.sin(t);return u(e)||(e=new y),e.x=p,e.y=d,e.z=m,y.normalize(e,e)};O.prototype.geodeticSurfaceNormal=function(n,e){if(c.typeOf.object("cartesian",n),isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new g("cartesian has a NaN component");if(!y.equalsEpsilon(n,y.ZERO,h.EPSILON14))return u(e)||(e=new y),e=y.multiplyComponents(n,this._oneOverRadiiSquared,e),y.normalize(e,e)};var ee=new y,oe=new y;O.prototype.cartographicToCartesian=function(n,e){let o=ee,t=oe;this.geodeticSurfaceNormalCartographic(n,o),y.multiplyComponents(this._radiiSquared,o,t);let i=Math.sqrt(y.dot(o,t));return y.divideByScalar(t,i,t),y.multiplyByScalar(o,n.height,o),u(e)||(e=new y),y.add(t,o,e)};O.prototype.cartographicArrayToCartesianArray=function(n,e){c.defined("cartographics",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;t++)e[t]=this.cartographicToCartesian(n[t],e[t]);return e};var te=new y,ce=new y,ie=new y;O.prototype.cartesianToCartographic=function(n,e){let o=this.scaleToGeodeticSurface(n,ce);if(!u(o))return;let t=this.geodeticSurfaceNormal(o,te),i=y.subtract(n,o,ie),p=Math.atan2(t.y,t.x),d=Math.asin(t.z),m=h.sign(y.dot(i,n))*y.magnitude(i);return u(e)?(e.longitude=p,e.latitude=d,e.height=m,e):new $(p,d,m)};O.prototype.cartesianArrayToCartographicArray=function(n,e){c.defined("cartesians",n);let o=n.length;u(e)?e.length=o:e=new Array(o);for(let t=0;t<o;++t)e[t]=this.cartesianToCartographic(n[t],e[t]);return e};O.prototype.scaleToGeodeticSurface=function(n,e){return G(n,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)};O.prototype.scaleToGeocentricSurface=function(n,e){c.typeOf.object("cartesian",n),u(e)||(e=new y);let o=n.x,t=n.y,i=n.z,p=this._oneOverRadiiSquared,d=1/Math.sqrt(o*o*p.x+t*t*p.y+i*i*p.z);return y.multiplyByScalar(n,d,e)};O.prototype.transformPositionToScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._oneOverRadii,e)};O.prototype.transformPositionFromScaledSpace=function(n,e){return u(e)||(e=new y),y.multiplyComponents(n,this._radii,e)};O.prototype.equals=function(n){return this===n||u(n)&&y.equals(this._radii,n._radii)};O.prototype.toString=function(){return this._radii.toString()};O.prototype.getSurfaceNormalIntersectionWithZAxis=function(n,e,o){if(c.typeOf.object("position",n),!h.equalsEpsilon(this._radii.x,this._radii.y,h.EPSILON15))throw new g("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");c.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),e=e??0;let t=this._squaredXOverSquaredZ;if(u(o)||(o=new y),o.x=0,o.y=0,o.z=n.z*(1-t),!(Math.abs(o.z)>=this._radii.z-e))return o};var fe=new y;O.prototype.getLocalCurvature=function(n,e){c.typeOf.object("surfacePosition",n),u(e)||(e=new yn);let o=this.getSurfaceNormalIntersectionWithZAxis(n,0,fe),t=y.distance(n,o),i=this.minimumRadius*t/this.maximumRadius**2,p=t*i**2;return yn.fromElements(1/t,1/p,e)};var re=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],pe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xn(n,e,o){c.typeOf.number("a",n),c.typeOf.number("b",e),c.typeOf.func("func",o);let t=.5*(e+n),i=.5*(e-n),p=0;for(let d=0;d<5;d++){let m=i*re[d];p+=pe[d]*(o(t+m)+o(t-m))}return p*=i,p}O.prototype.surfaceArea=function(n){c.typeOf.object("rectangle",n);let e=n.west,o=n.east,t=n.south,i=n.north;for(;o<e;)o+=h.TWO_PI;let p=this._radiiSquared,d=p.x,m=p.y,s=p.z,b=d*m;return xn(t,i,function(w){let S=Math.cos(w),R=Math.sin(w);return Math.cos(w)*xn(e,o,function(M){let C=Math.cos(M),_=Math.sin(M);return Math.sqrt(b*R*R+s*(m*C*C+d*_*_)*S*S)})})};var oo=O;function r(n,e,o,t,i,p,d,m,s){this[0]=n??0,this[1]=t??0,this[2]=d??0,this[3]=e??0,this[4]=i??0,this[5]=m??0,this[6]=o??0,this[7]=p??0,this[8]=s??0}r.packedLength=9;r.pack=function(n,e,o){return c.typeOf.object("value",n),c.defined("array",e),o=o??0,e[o++]=n[0],e[o++]=n[1],e[o++]=n[2],e[o++]=n[3],e[o++]=n[4],e[o++]=n[5],e[o++]=n[6],e[o++]=n[7],e[o++]=n[8],e};r.unpack=function(n,e,o){return c.defined("array",n),e=e??0,u(o)||(o=new r),o[0]=n[e++],o[1]=n[e++],o[2]=n[e++],o[3]=n[e++],o[4]=n[e++],o[5]=n[e++],o[6]=n[e++],o[7]=n[e++],o[8]=n[e++],o};r.packArray=function(n,e){c.defined("array",n);let o=n.length,t=o*9;if(!u(e))e=new Array(t);else{if(!Array.isArray(e)&&e.length!==t)throw new g("If result is a typed array, it must have exactly array.length * 9 elements");e.length!==t&&(e.length=t)}for(let i=0;i<o;++i)r.pack(n[i],e,i*9);return e};r.unpackArray=function(n,e){if(c.defined("array",n),c.typeOf.number.greaterThanOrEquals("array.length",n.length,9),n.length%9!==0)throw new g("array length must be a multiple of 9.");let o=n.length;u(e)?e.length=o/9:e=new Array(o/9);for(let t=0;t<o;t+=9){let i=t/9;e[i]=r.unpack(n,t,e[i])}return e};r.clone=function(n,e){if(u(n))return u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):new r(n[0],n[3],n[6],n[1],n[4],n[7],n[2],n[5],n[8])};r.fromArray=r.unpack;r.fromColumnMajorArray=function(n,e){return c.defined("values",n),r.clone(n,e)};r.fromRowMajorArray=function(n,e){return c.defined("values",n),u(e)?(e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],e):new r(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])};r.fromQuaternion=function(n,e){c.typeOf.object("quaternion",n);let o=n.x*n.x,t=n.x*n.y,i=n.x*n.z,p=n.x*n.w,d=n.y*n.y,m=n.y*n.z,s=n.y*n.w,b=n.z*n.z,w=n.z*n.w,S=n.w*n.w,R=o-d-b+S,M=2*(t-w),C=2*(i+s),_=2*(t+w),N=-o+d-b+S,B=2*(m-p),U=2*(i-s),P=2*(m+p),F=-o-d+b+S;return u(e)?(e[0]=R,e[1]=_,e[2]=U,e[3]=M,e[4]=N,e[5]=P,e[6]=C,e[7]=B,e[8]=F,e):new r(R,M,C,_,N,B,U,P,F)};r.fromHeadingPitchRoll=function(n,e){c.typeOf.object("headingPitchRoll",n);let o=Math.cos(-n.pitch),t=Math.cos(-n.heading),i=Math.cos(n.roll),p=Math.sin(-n.pitch),d=Math.sin(-n.heading),m=Math.sin(n.roll),s=o*t,b=-i*d+m*p*t,w=m*d+i*p*t,S=o*d,R=i*t+m*p*d,M=-m*t+i*p*d,C=-p,_=m*o,N=i*o;return u(e)?(e[0]=s,e[1]=S,e[2]=C,e[3]=b,e[4]=R,e[5]=_,e[6]=w,e[7]=M,e[8]=N,e):new r(s,b,w,S,R,M,C,_,N)};r.fromScale=function(n,e){return c.typeOf.object("scale",n),u(e)?(e[0]=n.x,e[1]=0,e[2]=0,e[3]=0,e[4]=n.y,e[5]=0,e[6]=0,e[7]=0,e[8]=n.z,e):new r(n.x,0,0,0,n.y,0,0,0,n.z)};r.fromUniformScale=function(n,e){return c.typeOf.number("scale",n),u(e)?(e[0]=n,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=n,e):new r(n,0,0,0,n,0,0,0,n)};r.fromCrossProduct=function(n,e){return c.typeOf.object("vector",n),u(e)?(e[0]=0,e[1]=n.z,e[2]=-n.y,e[3]=-n.z,e[4]=0,e[5]=n.x,e[6]=n.y,e[7]=-n.x,e[8]=0,e):new r(0,-n.z,n.y,n.z,0,-n.x,-n.y,n.x,0)};r.fromRotationX=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=o,e[5]=t,e[6]=0,e[7]=-t,e[8]=o,e):new r(1,0,0,0,o,-t,0,t,o)};r.fromRotationY=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=0,e[2]=-t,e[3]=0,e[4]=1,e[5]=0,e[6]=t,e[7]=0,e[8]=o,e):new r(o,0,t,0,1,0,-t,0,o)};r.fromRotationZ=function(n,e){c.typeOf.number("angle",n);let o=Math.cos(n),t=Math.sin(n);return u(e)?(e[0]=o,e[1]=t,e[2]=0,e[3]=-t,e[4]=o,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new r(o,-t,0,t,o,0,0,0,1)};r.toArray=function(n,e){return c.typeOf.object("matrix",n),u(e)?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e):[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8]]};r.getElementIndex=function(n,e){return c.typeOf.number.greaterThanOrEquals("row",e,0),c.typeOf.number.lessThanOrEquals("row",e,2),c.typeOf.number.greaterThanOrEquals("column",n,0),c.typeOf.number.lessThanOrEquals("column",n,2),n*3+e};r.getColumn=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=e*3,i=n[t],p=n[t+1],d=n[t+2];return o.x=i,o.y=p,o.z=d,o};r.setColumn=function(n,e,o,t){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t);let i=e*3;return t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t};r.getRow=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("result",o);let t=n[e],i=n[e+3],p=n[e+6];return o.x=t,o.y=i,o.z=p,o};r.setRow=function(n,e,o,t){return c.typeOf.object("matrix",n),c.typeOf.number.greaterThanOrEquals("index",e,0),c.typeOf.number.lessThanOrEquals("index",e,2),c.typeOf.object("cartesian",o),c.typeOf.object("result",t),t=r.clone(n,t),t[e]=o.x,t[e+3]=o.y,t[e+6]=o.z,t};var ue=new y;r.setScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ue),i=e.x/t.x,p=e.y/t.y,d=e.z/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var ae=new y;r.setUniformScale=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o);let t=r.getScale(n,ae),i=e/t.x,p=e/t.y,d=e/t.z;return o[0]=n[0]*i,o[1]=n[1]*i,o[2]=n[2]*i,o[3]=n[3]*p,o[4]=n[4]*p,o[5]=n[5]*p,o[6]=n[6]*d,o[7]=n[7]*d,o[8]=n[8]*d,o};var mn=new y;r.getScale=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e.x=y.magnitude(y.fromElements(n[0],n[1],n[2],mn)),e.y=y.magnitude(y.fromElements(n[3],n[4],n[5],mn)),e.z=y.magnitude(y.fromElements(n[6],n[7],n[8],mn)),e};var kn=new y;r.getMaximumScale=function(n){return r.getScale(n,kn),y.maximumComponent(kn)};var de=new y;r.setRotation=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("result",o);let t=r.getScale(n,de);return o[0]=e[0]*t.x,o[1]=e[1]*t.x,o[2]=e[2]*t.x,o[3]=e[3]*t.y,o[4]=e[4]*t.y,o[5]=e[5]*t.y,o[6]=e[6]*t.z,o[7]=e[7]*t.z,o[8]=e[8]*t.z,o};var ye=new y;r.getRotation=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=r.getScale(n,ye);return e[0]=n[0]/o.x,e[1]=n[1]/o.x,e[2]=n[2]/o.x,e[3]=n[3]/o.y,e[4]=n[4]/o.y,e[5]=n[5]/o.y,e[6]=n[6]/o.z,e[7]=n[7]/o.z,e[8]=n[8]/o.z,e};r.multiply=function(n,e,o){c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o);let t=n[0]*e[0]+n[3]*e[1]+n[6]*e[2],i=n[1]*e[0]+n[4]*e[1]+n[7]*e[2],p=n[2]*e[0]+n[5]*e[1]+n[8]*e[2],d=n[0]*e[3]+n[3]*e[4]+n[6]*e[5],m=n[1]*e[3]+n[4]*e[4]+n[7]*e[5],s=n[2]*e[3]+n[5]*e[4]+n[8]*e[5],b=n[0]*e[6]+n[3]*e[7]+n[6]*e[8],w=n[1]*e[6]+n[4]*e[7]+n[7]*e[8],S=n[2]*e[6]+n[5]*e[7]+n[8]*e[8];return o[0]=t,o[1]=i,o[2]=p,o[3]=d,o[4]=m,o[5]=s,o[6]=b,o[7]=w,o[8]=S,o};r.add=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]+e[0],o[1]=n[1]+e[1],o[2]=n[2]+e[2],o[3]=n[3]+e[3],o[4]=n[4]+e[4],o[5]=n[5]+e[5],o[6]=n[6]+e[6],o[7]=n[7]+e[7],o[8]=n[8]+e[8],o};r.subtract=function(n,e,o){return c.typeOf.object("left",n),c.typeOf.object("right",e),c.typeOf.object("result",o),o[0]=n[0]-e[0],o[1]=n[1]-e[1],o[2]=n[2]-e[2],o[3]=n[3]-e[3],o[4]=n[4]-e[4],o[5]=n[5]-e[5],o[6]=n[6]-e[6],o[7]=n[7]-e[7],o[8]=n[8]-e[8],o};r.multiplyByVector=function(n,e,o){c.typeOf.object("matrix",n),c.typeOf.object("cartesian",e),c.typeOf.object("result",o);let t=e.x,i=e.y,p=e.z,d=n[0]*t+n[3]*i+n[6]*p,m=n[1]*t+n[4]*i+n[7]*p,s=n[2]*t+n[5]*i+n[8]*p;return o.x=d,o.y=m,o.z=s,o};r.multiplyByScalar=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scalar",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.multiplyByScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.object("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e.x,o[1]=n[1]*e.x,o[2]=n[2]*e.x,o[3]=n[3]*e.y,o[4]=n[4]*e.y,o[5]=n[5]*e.y,o[6]=n[6]*e.z,o[7]=n[7]*e.z,o[8]=n[8]*e.z,o};r.multiplyByUniformScale=function(n,e,o){return c.typeOf.object("matrix",n),c.typeOf.number("scale",e),c.typeOf.object("result",o),o[0]=n[0]*e,o[1]=n[1]*e,o[2]=n[2]*e,o[3]=n[3]*e,o[4]=n[4]*e,o[5]=n[5]*e,o[6]=n[6]*e,o[7]=n[7]*e,o[8]=n[8]*e,o};r.negate=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=-n[0],e[1]=-n[1],e[2]=-n[2],e[3]=-n[3],e[4]=-n[4],e[5]=-n[5],e[6]=-n[6],e[7]=-n[7],e[8]=-n[8],e};r.transpose=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[3],i=n[6],p=n[1],d=n[4],m=n[7],s=n[2],b=n[5],w=n[8];return e[0]=o,e[1]=t,e[2]=i,e[3]=p,e[4]=d,e[5]=m,e[6]=s,e[7]=b,e[8]=w,e};function me(n){let e=0;for(let o=0;o<9;++o){let t=n[o];e+=t*t}return Math.sqrt(e)}var sn=[1,0,0],On=[2,2,1];function se(n){let e=0;for(let o=0;o<3;++o){let t=n[r.getElementIndex(On[o],sn[o])];e+=2*t*t}return Math.sqrt(e)}function Oe(n,e){let o=h.EPSILON15,t=0,i=1;for(let b=0;b<3;++b){let w=Math.abs(n[r.getElementIndex(On[b],sn[b])]);w>t&&(i=b,t=w)}let p=1,d=0,m=sn[i],s=On[i];if(Math.abs(n[r.getElementIndex(s,m)])>o){let b=n[r.getElementIndex(s,s)],w=n[r.getElementIndex(m,m)],S=n[r.getElementIndex(s,m)],R=(b-w)/2/S,M;R<0?M=-1/(-R+Math.sqrt(1+R*R)):M=1/(R+Math.sqrt(1+R*R)),p=1/Math.sqrt(1+M*M),d=M*p}return e=r.clone(r.IDENTITY,e),e[r.getElementIndex(m,m)]=e[r.getElementIndex(s,s)]=p,e[r.getElementIndex(s,m)]=d,e[r.getElementIndex(m,s)]=-d,e}var Q=new r,Bn=new r;r.computeEigenDecomposition=function(n,e){c.typeOf.object("matrix",n);let o=h.EPSILON20,t=10,i=0,p=0;u(e)||(e={});let d=e.unitary=r.clone(r.IDENTITY,e.unitary),m=e.diagonal=r.clone(n,e.diagonal),s=o*me(m);for(;p<t&&se(m)>s;)Oe(m,Q),r.transpose(Q,Bn),r.multiply(m,Q,m),r.multiply(Bn,m,m),r.multiply(d,Q,d),++i>2&&(++p,i=0);return e};r.abs=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),e[0]=Math.abs(n[0]),e[1]=Math.abs(n[1]),e[2]=Math.abs(n[2]),e[3]=Math.abs(n[3]),e[4]=Math.abs(n[4]),e[5]=Math.abs(n[5]),e[6]=Math.abs(n[6]),e[7]=Math.abs(n[7]),e[8]=Math.abs(n[8]),e};r.determinant=function(n){c.typeOf.object("matrix",n);let e=n[0],o=n[3],t=n[6],i=n[1],p=n[4],d=n[7],m=n[2],s=n[5],b=n[8];return e*(p*b-s*d)+i*(s*t-o*b)+m*(o*d-p*t)};r.inverse=function(n,e){c.typeOf.object("matrix",n),c.typeOf.object("result",e);let o=n[0],t=n[1],i=n[2],p=n[3],d=n[4],m=n[5],s=n[6],b=n[7],w=n[8],S=r.determinant(n);if(Math.abs(S)<=h.EPSILON15)throw new g("matrix is not invertible");e[0]=d*w-b*m,e[1]=b*i-t*w,e[2]=t*m-d*i,e[3]=s*m-p*w,e[4]=o*w-s*i,e[5]=p*i-o*m,e[6]=p*b-s*d,e[7]=s*t-o*b,e[8]=o*d-p*t;let R=1/S;return r.multiplyByScalar(e,R,e)};var be=new r;r.inverseTranspose=function(n,e){return c.typeOf.object("matrix",n),c.typeOf.object("result",e),r.inverse(r.transpose(n,be),e)};r.equals=function(n,e){return n===e||u(n)&&u(e)&&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]};r.equalsEpsilon=function(n,e,o){return o=o??0,n===e||u(n)&&u(e)&&Math.abs(n[0]-e[0])<=o&&Math.abs(n[1]-e[1])<=o&&Math.abs(n[2]-e[2])<=o&&Math.abs(n[3]-e[3])<=o&&Math.abs(n[4]-e[4])<=o&&Math.abs(n[5]-e[5])<=o&&Math.abs(n[6]-e[6])<=o&&Math.abs(n[7]-e[7])<=o&&Math.abs(n[8]-e[8])<=o};r.IDENTITY=Object.freeze(new r(1,0,0,0,1,0,0,0,1));r.ZERO=Object.freeze(new r(0,0,0,0,0,0,0,0,0));r.COLUMN0ROW0=0;r.COLUMN0ROW1=1;r.COLUMN0ROW2=2;r.COLUMN1ROW0=3;r.COLUMN1ROW1=4;r.COLUMN1ROW2=5;r.COLUMN2ROW0=6;r.COLUMN2ROW1=7;r.COLUMN2ROW2=8;Object.defineProperties(r.prototype,{length:{get:function(){return r.packedLength}}});r.prototype.clone=function(n){return r.clone(this,n)};r.prototype.equals=function(n){return r.equals(this,n)};r.equalsArray=function(n,e,o){return n[0]===e[o]&&n[1]===e[o+1]&&n[2]===e[o+2]&&n[3]===e[o+3]&&n[4]===e[o+4]&&n[5]===e[o+5]&&n[6]===e[o+6]&&n[7]===e[o+7]&&n[8]===e[o+8]};r.prototype.equalsEpsilon=function(n,e){return r.equalsEpsilon(this,n,e)};r.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) -(${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var uo=r;var bn={};bn.EMPTY_OBJECT=Object.freeze({});bn.EMPTY_ARRAY=Object.freeze([]);var yo=bn;var x,z={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},A={};Object.defineProperties(A,{element:{get:function(){if(A.supportsFullscreen())return document[z.fullscreenElement]}},changeEventName:{get:function(){if(A.supportsFullscreen())return z.fullscreenchange}},errorEventName:{get:function(){if(A.supportsFullscreen())return z.fullscreenerror}},enabled:{get:function(){if(A.supportsFullscreen())return document[z.fullscreenEnabled]}},fullscreen:{get:function(){if(A.supportsFullscreen())return A.element!==null}}});A.supportsFullscreen=function(){if(u(x))return x;x=!1;let n=document.body;if(typeof n.requestFullscreen=="function")return z.requestFullscreen="requestFullscreen",z.exitFullscreen="exitFullscreen",z.fullscreenEnabled="fullscreenEnabled",z.fullscreenElement="fullscreenElement",z.fullscreenchange="fullscreenchange",z.fullscreenerror="fullscreenerror",x=!0,x;let e=["webkit","moz","o","ms","khtml"],o;for(let t=0,i=e.length;t<i;++t){let p=e[t];o=`${p}RequestFullscreen`,typeof n[o]=="function"?(z.requestFullscreen=o,x=!0):(o=`${p}RequestFullScreen`,typeof n[o]=="function"&&(z.requestFullscreen=o,x=!0)),o=`${p}ExitFullscreen`,typeof document[o]=="function"?z.exitFullscreen=o:(o=`${p}CancelFullScreen`,typeof document[o]=="function"&&(z.exitFullscreen=o)),o=`${p}FullscreenEnabled`,document[o]!==void 0?z.fullscreenEnabled=o:(o=`${p}FullScreenEnabled`,document[o]!==void 0&&(z.fullscreenEnabled=o)),o=`${p}FullscreenElement`,document[o]!==void 0?z.fullscreenElement=o:(o=`${p}FullScreenElement`,document[o]!==void 0&&(z.fullscreenElement=o)),o=`${p}fullscreenchange`,document[`on${o}`]!==void 0&&(p==="ms"&&(o="MSFullscreenChange"),z.fullscreenchange=o),o=`${p}fullscreenerror`,document[`on${o}`]!==void 0&&(p==="ms"&&(o="MSFullscreenError"),z.fullscreenerror=o)}return x};A.requestFullscreen=function(n,e){A.supportsFullscreen()&&n[z.requestFullscreen]({vrDisplay:e})};A.exitFullscreen=function(){A.supportsFullscreen()&&document[z.exitFullscreen]()};A._names=z;var Un=A;var E;typeof navigator<"u"?E=navigator:E={};function k(n){let e=n.split(".");for(let o=0,t=e.length;o<t;++o)e[o]=parseInt(e[o],10);return e}var J,Pn;function zn(){if(!u(J)&&(J=!1,!cn())){let n=/ Chrome\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(J=!0,Pn=k(n[1]))}return J}function he(){return zn()&&Pn}var K,In;function Ln(){if(!u(K)&&(K=!1,!zn()&&!cn()&&/ Safari\/[\.0-9]+/.test(E.userAgent))){let n=/ Version\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(K=!0,In=k(n[1]))}return K}function we(){return Ln()&&In}var nn,gn;function Wn(){if(!u(nn)){nn=!1;let n=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(E.userAgent);n!==null&&(nn=!0,gn=k(n[1]),gn.isNightly=!!n[2])}return nn}function je(){return Wn()&&gn}var D,Sn;function Vn(){if(!u(D)){D=!1;let n;E.appName==="Microsoft Internet Explorer"?(n=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(E.userAgent),n!==null&&(D=!0,Sn=k(n[1]))):E.appName==="Netscape"&&(n=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(E.userAgent),n!==null&&(D=!0,Sn=k(n[1])))}return D}function ge(){return Vn()&&Sn}var en,vn;function cn(){if(!u(en)){en=!1;let n=/ Edg\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(en=!0,vn=k(n[1]))}return en}function Se(){return cn()&&vn}var on,Rn;function fn(){if(!u(on)){on=!1;let n=/Firefox\/([\.0-9]+)/.exec(E.userAgent);n!==null&&(on=!0,Rn=k(n[1]))}return on}var hn;function ze(){return u(hn)||(hn=/Windows/i.test(E.appVersion)),hn}var wn;function Re(){return u(wn)||(wn=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),wn}function Me(){return fn()&&Rn}var jn;function qe(){return u(jn)||(jn=!fn()&&typeof PointerEvent<"u"&&(!u(E.pointerEnabled)||E.pointerEnabled)),jn}var $n,tn;function Dn(){if(!u(tn)){let n=document.createElement("canvas");n.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let e=n.style.imageRendering;tn=u(e)&&e!=="",tn&&($n=e)}return tn}function Ee(){return Dn()?$n:void 0}function q(){if(!q.initialized)throw new g("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return q._result}q._promise=void 0;q._result=void 0;q.initialize=function(){return u(q._promise)||(q._promise=new Promise(n=>{let e=new Image;e.onload=function(){q._result=e.width>0&&e.height>0,n(q._result)},e.onerror=function(){q._result=!1,n(q._result)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),q._promise};Object.defineProperties(q,{initialized:{get:function(){return u(q._result)}}});var v=[];typeof ArrayBuffer<"u"&&(v.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&v.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&v.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&v.push(BigInt64Array),typeof BigUint64Array<"u"&&v.push(BigUint64Array));var l={isChrome:zn,chromeVersion:he,isSafari:Ln,safariVersion:we,isWebkit:Wn,webkitVersion:je,isInternetExplorer:Vn,internetExplorerVersion:ge,isEdge:cn,edgeVersion:Se,isFirefox:fn,firefoxVersion:Me,isWindows:ze,isIPadOrIOS:Re,hardwareConcurrency:E.hardwareConcurrency??3,supportsPointerEvents:qe,supportsImageRenderingPixelated:Dn,supportsWebP:q,imageRenderingValue:Ee,typedArrayTypes:v};l.supportsBasis=function(n){return l.supportsWebAssembly()&&n.context.supportsBasis};l.supportsFullscreen=function(){return Un.supportsFullscreen()};l.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};l.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};l.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};l.supportsBigInt=function(){return typeof BigInt<"u"};l.supportsWebWorkers=function(){return typeof Worker<"u"};l.supportsWebAssembly=function(){return typeof WebAssembly<"u"};l.supportsWebgl2=function(n){return c.defined("scene",n),n.context.webgl2};l.supportsEsmWebWorkers=function(){return!fn()||parseInt(Rn)>=114};var go=l;export{y as a,$ as b,yn as c,oo as d,uo as e,yo as f,go as g}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-FUD3WFGN.js b/plugins/feature/map/Cesium/Workers/chunk-FUD3WFGN.js deleted file mode 100644 index 12a884616..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-FUD3WFGN.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as wt}from"./chunk-4W2MZV6I.js";import{a as C}from"./chunk-S3L7VZFL.js";import{a as kt}from"./chunk-JQLYZQ6V.js";import{a as Ct}from"./chunk-J3L5WX3X.js";import{b as dt,c as _t,d as N}from"./chunk-AVPLM4UI.js";import{d as ht}from"./chunk-ZYYZDBKK.js";import{a as M}from"./chunk-WER4LUMF.js";import{a as s,c as lt,d as it,f as pt}from"./chunk-FGKVHLJ4.js";import{a as E}from"./chunk-YRCAQUFT.js";import{a as g}from"./chunk-ELJAHN3H.js";import{e as v}from"./chunk-3BGP4HCL.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-S3L7VZFL.js b/plugins/feature/map/Cesium/Workers/chunk-FZSSAWMQ.js similarity index 92% rename from plugins/feature/map/Cesium/Workers/chunk-S3L7VZFL.js rename to plugins/feature/map/Cesium/Workers/chunk-FZSSAWMQ.js index 45b44e311..d877dd26a 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-S3L7VZFL.js +++ b/plugins/feature/map/Cesium/Workers/chunk-FZSSAWMQ.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{f as O}from"./chunk-FGKVHLJ4.js";import{a as f}from"./chunk-ELJAHN3H.js";import{e as t}from"./chunk-3BGP4HCL.js";function n(e){e=e??O.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}n.POSITION_ONLY=Object.freeze(new n({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(new n({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(new n({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(new n({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(new n({position:!0,color:!0}));n.ALL=Object.freeze(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!t(e))throw new f("value is required");if(!t(o))throw new f("array is required");return i=i??0,o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!t(e))throw new f("array is required");return o=o??0,t(i)||(i=new n),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(t(e))return t(o)||(o=new n),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var _=n;export{_ as a}; +import{c as O}from"./chunk-OSVSBQDY.js";import{a as f}from"./chunk-OU2IPMYE.js";import{f as t}from"./chunk-H7SJWKIY.js";function n(e){e=e??O.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}n.POSITION_ONLY=Object.freeze(new n({position:!0}));n.POSITION_AND_NORMAL=Object.freeze(new n({position:!0,normal:!0}));n.POSITION_NORMAL_AND_ST=Object.freeze(new n({position:!0,normal:!0,st:!0}));n.POSITION_AND_ST=Object.freeze(new n({position:!0,st:!0}));n.POSITION_AND_COLOR=Object.freeze(new n({position:!0,color:!0}));n.ALL=Object.freeze(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));n.DEFAULT=n.POSITION_NORMAL_AND_ST;n.packedLength=6;n.pack=function(e,o,i){if(!t(e))throw new f("value is required");if(!t(o))throw new f("array is required");return i=i??0,o[i++]=e.position?1:0,o[i++]=e.normal?1:0,o[i++]=e.st?1:0,o[i++]=e.tangent?1:0,o[i++]=e.bitangent?1:0,o[i]=e.color?1:0,o};n.unpack=function(e,o,i){if(!t(e))throw new f("array is required");return o=o??0,t(i)||(i=new n),i.position=e[o++]===1,i.normal=e[o++]===1,i.st=e[o++]===1,i.tangent=e[o++]===1,i.bitangent=e[o++]===1,i.color=e[o]===1,i};n.clone=function(e,o){if(t(e))return t(o)||(o=new n),o.position=e.position,o.normal=e.normal,o.st=e.st,o.tangent=e.tangent,o.bitangent=e.bitangent,o.color=e.color,o};var _=n;export{_ as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-G2DFB5K6.js b/plugins/feature/map/Cesium/Workers/chunk-G2DFB5K6.js new file mode 100644 index 000000000..47bb4c4ee --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-G2DFB5K6.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as G}from"./chunk-7IFFXLK3.js";import{a as At}from"./chunk-PICDM7L2.js";import{a as yt}from"./chunk-XUWPEWB7.js";import{a as $}from"./chunk-GNBKSQYP.js";import{a as v}from"./chunk-FZSSAWMQ.js";import{a as st}from"./chunk-AZINMULF.js";import{a as ht}from"./chunk-ILBQ77ZM.js";import{b as ct,c as rt,d as F}from"./chunk-7RNSURKI.js";import{a as lt,c as it}from"./chunk-THB3EPLO.js";import{h as nt,j as bt}from"./chunk-YZ5ZCI55.js";import{a as P}from"./chunk-WCOEOHX5.js";import{a as _t,b as Q,c as D}from"./chunk-KP72RGCH.js";import{a,b as C,c as dt}from"./chunk-OSVSBQDY.js";import{a as R}from"./chunk-LZC73BOP.js";import{a as ot,b as k}from"./chunk-OU2IPMYE.js";import{f as Z}from"./chunk-H7SJWKIY.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-G65SAF2P.js b/plugins/feature/map/Cesium/Workers/chunk-G65SAF2P.js deleted file mode 100644 index 9cb346b5b..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-G65SAF2P.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as y}from"./chunk-X6N776GR.js";import{d as L}from"./chunk-ZYYZDBKK.js";import{b as d,h as W}from"./chunk-3PT5NNSP.js";import{a as A}from"./chunk-WER4LUMF.js";import{a as s,b as k,c as T,d as b}from"./chunk-FGKVHLJ4.js";import{a as E}from"./chunk-YRCAQUFT.js";import{a as I,b as z}from"./chunk-ELJAHN3H.js";import{e as h}from"./chunk-3BGP4HCL.js";function x(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(x.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=n}}});var j=new s;x.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,j);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};x.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var it=new s;x.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,n,i;return h(t)&&t<0&&e.minimumRadius>-t?(i=it,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(o,i,n)};x.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var U=b.clone(b.UNIT_SPHERE);x.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,n){let i=v(this._ellipsoid,e,U);return Z(i,o,t,n)};x.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,n,i){return Q(this._ellipsoid,o,t,e,n,i)};x.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,n,i,c){let a=v(this._ellipsoid,i,U);return Q(a,o,t,e,n,c)};var nt=[];x.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let n=W.subsample(o,t,0,nt),i=L.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,e)};var at=new s;function v(o,t,e){if(h(t)&&t<0&&o.minimumRadius>-t){let n=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=b.fromCartesian3(n,e)}return o}function Z(o,t,e,n){z.typeOf.object("directionToPoint",t),z.defined("positions",e),h(n)||(n=new s);let i=X(o,t),c=0;for(let a=0,r=e.length;a<r;++a){let m=e[a],l=J(o,m,i);if(l<0)return;c=Math.max(c,l)}return K(i,c,n)}var q=new s;function Q(o,t,e,n,i,c){z.typeOf.object("directionToPoint",t),z.defined("vertices",e),z.typeOf.number("stride",n),h(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=X(o,t),r=0;for(let m=0,l=e.length;m<l;m+=n){q.x=e[m]+i.x,q.y=e[m+1]+i.y,q.z=e[m+2]+i.z;let u=J(o,q,a);if(u<0)return;r=Math.max(r,u)}return K(a,r,c)}function D(o,t,e){let n=t,i=e,c=s.subtract(o,n,j),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var st=new s,ct=new s;function J(o,t,e){let n=o.transformPositionToScaledSpace(t,st),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,ct);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(a,e),m=s.magnitude(s.cross(a,e,a)),l=1/c,u=Math.sqrt(i-1)*l;return 1/(r*l-m*u)}function K(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function X(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Tt=x;var M={};M.getHeight=function(o,t,e){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(e))throw new I("relativeHeight must be a finite number.");return(o-e)*t+e};var rt=new k;M.getPosition=function(o,t,e,n,i){let c=t.cartesianToCartographic(o,rt);if(!h(c))return s.clone(o,i);let a=M.getHeight(c.height,e,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var Y=M;var mt={NONE:0,BITS12:1},S=Object.freeze(mt);var _=new s,dt=new s,f=new T,O=new d,ht=new d,lt=Math.pow(2,12);function p(o,t,e,n,i,c,a,r,m,l){let u=S.NONE,g,N;if(h(t)&&h(e)&&h(n)&&h(i)){let C=t.minimum,V=t.maximum,P=s.subtract(V,C,dt),B=n-e;Math.max(s.maximumComponent(P),B)<lt-1?u=S.BITS12:u=S.NONE,g=d.inverseTransformation(i,new d);let tt=s.negate(C,_);d.multiply(d.fromTranslation(tt,O),g,g);let w=_;w.x=1/P.x,w.y=1/P.y,w.z=1/P.z,d.multiply(d.fromScale(w,O),g,g),N=d.clone(i),d.setTranslation(N,s.ZERO,N),i=d.clone(i,new d);let ot=d.fromTranslation(C,O),et=d.fromScale(P,ht),F=d.multiply(ot,et,O);d.multiply(i,F,i),d.multiply(N,F,N)}this.quantization=u,this.minimumHeight=e,this.maximumHeight=n,this.center=s.clone(o),this.toScaledENU=g,this.fromScaledENU=i,this.matrix=N,this.hasVertexNormals=c,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=r??!1,this.exaggeration=m??1,this.exaggerationRelativeHeight=l??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(o,t,e,n,i,c,a,r){let m=n.x,l=n.y;if(this.quantization===S.BITS12){e=d.multiplyByPoint(this.toScaledENU,e,_),e.x=E.clamp(e.x,0,1),e.y=E.clamp(e.y,0,1),e.z=E.clamp(e.z,0,1);let u=this.maximumHeight-this.minimumHeight,g=E.clamp((i-this.minimumHeight)/u,0,1);T.fromElements(e.x,e.y,f);let N=y.compressTextureCoordinates(f);T.fromElements(e.z,g,f);let C=y.compressTextureCoordinates(f);T.fromElements(m,l,f);let V=y.compressTextureCoordinates(f);if(o[t++]=N,o[t++]=C,o[t++]=V,this.hasWebMercatorT){T.fromElements(a,0,f);let P=y.compressTextureCoordinates(f);o[t++]=P}}else s.subtract(e,this.center,_),o[t++]=_.x,o[t++]=_.y,o[t++]=_.z,o[t++]=i,o[t++]=m,o[t++]=l,this.hasWebMercatorT&&(o[t++]=a);return this.hasVertexNormals&&(o[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(o[t++]=r.x,o[t++]=r.y,o[t++]=r.z),t};var pt=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(o,t,e){if(this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=o.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let u=0;u<n;u++){let g=a*n+u,N=a*c+u;t[N]=o[g]}let r=this.decodePosition(t,a,pt),m=e.geodeticSurfaceNormal(r,$),l=a*c+this._offsetGeodeticSurfaceNormal;t[l]=m.x,t[l+1]=m.y,t[l+2]=m.z}};p.prototype.removeGeodeticSurfaceNormals=function(o,t){if(!this.hasGeodeticSurfaceNormals)return;let e=this.stride,n=o.length/e;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let r=c*e+a,m=c*i+a;t[m]=o[r]}};p.prototype.decodePosition=function(o,t,e){if(h(e)||(e=new s),t*=this.stride,this.quantization===S.BITS12){let n=y.decompressTextureCoordinates(o[t],f);e.x=n.x,e.y=n.y;let i=y.decompressTextureCoordinates(o[t+1],f);return e.z=i.x,d.multiplyByPoint(this.fromScaledENU,e,e)}return e.x=o[t],e.y=o[t+1],e.z=o[t+2],s.add(e,this.center,e)};p.prototype.getExaggeratedPosition=function(o,t,e){e=this.decodePosition(o,t,e);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(o,t,$),r=this.decodeHeight(o,t),m=Y.getHeight(r,n,i)-r;e.x+=a.x*m,e.y+=a.y*m,e.z+=a.z*m}return e};p.prototype.decodeTextureCoordinates=function(o,t,e){return h(e)||(e=new T),t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+2],e):T.fromElements(o[t+4],o[t+5],e)};p.prototype.decodeHeight=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+1],f).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:o[t+3]};p.prototype.decodeWebMercatorT=function(o,t){return t*=this.stride,this.quantization===S.BITS12?y.decompressTextureCoordinates(o[t+3],f).x:o[t+6]};p.prototype.getOctEncodedNormal=function(o,t,e){t=t*this.stride+this._offsetVertexNormal;let n=o[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,e)};p.prototype.decodeGeodeticSurfaceNormal=function(o,t,e){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,e.x=o[t],e.y=o[t+1],e.z=o[t+2],e};p.prototype._calculateStrideAndOffsets=function(){let o=0;switch(this.quantization){case S.BITS12:o+=3;break;default:o+=6}this.hasWebMercatorT&&(o+=1),this.hasVertexNormals&&(this._offsetVertexNormal=o,o+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=o,o+=3),this.stride=o};var G={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},H={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(o){let t=A.FLOAT,e=A.getSizeInBytes(t),n=this.stride*e,i=0,c=[];function a(r,m){c.push({index:r,vertexBuffer:o,componentDatatype:t,componentsPerAttribute:m,offsetInBytes:i,strideInBytes:n}),i+=m*e}if(this.quantization===S.NONE){a(G.position3DAndHeight,4);let r=2;r+=this.hasWebMercatorT?1:0,r+=this.hasVertexNormals?1:0,a(G.textureCoordAndEncodedNormals,r),this.hasGeodeticSurfaceNormals&&a(G.geodeticSurfaceNormal,3)}else{let r=this.hasWebMercatorT||this.hasVertexNormals,m=this.hasWebMercatorT&&this.hasVertexNormals;a(H.compressed0,r?4:3),m&&a(H.compressed1,1),this.hasGeodeticSurfaceNormals&&a(H.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===S.NONE?G:H};p.clone=function(o,t){if(h(o))return h(t)||(t=new p),t.quantization=o.quantization,t.minimumHeight=o.minimumHeight,t.maximumHeight=o.maximumHeight,t.center=s.clone(o.center),t.toScaledENU=d.clone(o.toScaledENU),t.fromScaledENU=d.clone(o.fromScaledENU),t.matrix=d.clone(o.matrix),t.hasVertexNormals=o.hasVertexNormals,t.hasWebMercatorT=o.hasWebMercatorT,t.hasGeodeticSurfaceNormals=o.hasGeodeticSurfaceNormals,t.exaggeration=o.exaggeration,t.exaggerationRelativeHeight=o.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Dt=p;export{Tt as a,Dt as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-GH3KEUYL.js b/plugins/feature/map/Cesium/Workers/chunk-GH3KEUYL.js new file mode 100644 index 000000000..a61f305af --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-GH3KEUYL.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as Q}from"./chunk-ARDVIBNJ.js";import{a as N}from"./chunk-GNBKSQYP.js";import{a as _}from"./chunk-FZSSAWMQ.js";import{a as K}from"./chunk-AZINMULF.js";import{a as H}from"./chunk-ILBQ77ZM.js";import{b as J,c as W,d as L}from"./chunk-7RNSURKI.js";import{c as j}from"./chunk-THB3EPLO.js";import{a as S}from"./chunk-WCOEOHX5.js";import{b as E}from"./chunk-KP72RGCH.js";import{a as b,c as Z}from"./chunk-OSVSBQDY.js";import{a as Y}from"./chunk-LZC73BOP.js";import{a as F}from"./chunk-OU2IPMYE.js";import{f as g}from"./chunk-H7SJWKIY.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-4W2MZV6I.js b/plugins/feature/map/Cesium/Workers/chunk-GNBKSQYP.js similarity index 88% rename from plugins/feature/map/Cesium/Workers/chunk-4W2MZV6I.js rename to plugins/feature/map/Cesium/Workers/chunk-GNBKSQYP.js index 45e90cd01..f4e79b129 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-4W2MZV6I.js +++ b/plugins/feature/map/Cesium/Workers/chunk-GNBKSQYP.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var e={NONE:0,TOP:1,ALL:2},t=Object.freeze(e);export{t as a}; +var e={NONE:0,TOP:1,ALL:2};Object.freeze(e);var t=e;export{t as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-H7SJWKIY.js b/plugins/feature/map/Cesium/Workers/chunk-H7SJWKIY.js new file mode 100644 index 000000000..f60a1fdd3 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-H7SJWKIY.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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 i=Object.create;var t=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var p=(n,e,d)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):n[e]=d;var b=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,d)=>(typeof require<"u"?require:e)[d]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')}),g=n=>e=>{var d=n[e];if(d)return d();throw new Error("Module not found in bundle: "+e)};var h=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(d){throw e=0,d}};var x=(n,e,d,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of l(e))!c.call(n,f)&&f!==d&&t(n,f,{get:()=>e[f],enumerable:!(u=r(e,f))||u.enumerable});return n};var j=(n,e,d)=>(d=n!=null?i(o(n)):{},x(e||!n||!n.__esModule?t(d,"default",{value:n,enumerable:!0}):d,n));var k=(n,e,d)=>p(n,typeof e!="symbol"?e+"":e,d);function a(n){return n!=null}var q=a;export{b as a,g as b,h as c,j as d,k as e,q as f}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-HLXNFZAZ.js b/plugins/feature/map/Cesium/Workers/chunk-HLXNFZAZ.js new file mode 100644 index 000000000..744bfcee8 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-HLXNFZAZ.js @@ -0,0 +1,29 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as R1}from"./chunk-23IOGON7.js";import{a as W,b as u,c as z1}from"./chunk-OSVSBQDY.js";import{a as G}from"./chunk-LZC73BOP.js";import{a as m,b as p}from"./chunk-OU2IPMYE.js";import{f as S}from"./chunk-H7SJWKIY.js";var V=class f{constructor(c,o,n,y){this.x=c??0,this.y=o??0,this.z=n??0,this.w=y??0}static fromElements(c,o,n,y,O){return S(O)?(O.x=c,O.y=o,O.z=n,O.w=y,O):new f(c,o,n,y)}static fromColor(c,o){return p.typeOf.object("color",c),S(o)?(o.x=c.red,o.y=c.green,o.z=c.blue,o.w=c.alpha,o):new f(c.red,c.green,c.blue,c.alpha)}static clone(c,o){if(S(c))return S(o)?(o.x=c.x,o.y=c.y,o.z=c.z,o.w=c.w,o):new f(c.x,c.y,c.z,c.w)}static pack(c,o,n){return p.typeOf.object("value",c),p.defined("array",o),n=n??0,o[n++]=c.x,o[n++]=c.y,o[n++]=c.z,o[n]=c.w,o}static unpack(c,o,n){return p.defined("array",c),o=o??0,S(n)||(n=new f),n.x=c[o++],n.y=c[o++],n.z=c[o++],n.w=c[o],n}static packArray(c,o){p.defined("array",c);let n=c.length,y=n*4;if(!S(o))o=new Array(y);else{if(!Array.isArray(o)&&o.length!==y)throw new m("If result is a typed array, it must have exactly array.length * 4 elements");o.length!==y&&(o.length=y)}for(let O=0;O<n;++O)f.pack(c[O],o,O*4);return o}static unpackArray(c,o){if(p.defined("array",c),p.typeOf.number.greaterThanOrEquals("array.length",c.length,4),c.length%4!==0)throw new m("array length must be a multiple of 4.");let n=c.length;S(o)?o.length=n/4:o=new Array(n/4);for(let y=0;y<n;y+=4){let O=y/4;o[O]=f.unpack(c,y,o[O])}return o}static maximumComponent(c){return p.typeOf.object("cartesian",c),Math.max(c.x,c.y,c.z,c.w)}static minimumComponent(c){return p.typeOf.object("cartesian",c),Math.min(c.x,c.y,c.z,c.w)}static minimumByComponent(c,o,n){return p.typeOf.object("first",c),p.typeOf.object("second",o),p.typeOf.object("result",n),n.x=Math.min(c.x,o.x),n.y=Math.min(c.y,o.y),n.z=Math.min(c.z,o.z),n.w=Math.min(c.w,o.w),n}static maximumByComponent(c,o,n){return p.typeOf.object("first",c),p.typeOf.object("second",o),p.typeOf.object("result",n),n.x=Math.max(c.x,o.x),n.y=Math.max(c.y,o.y),n.z=Math.max(c.z,o.z),n.w=Math.max(c.w,o.w),n}static clamp(c,o,n,y){p.typeOf.object("value",c),p.typeOf.object("min",o),p.typeOf.object("max",n),p.typeOf.object("result",y);let O=G.clamp(c.x,o.x,n.x),w=G.clamp(c.y,o.y,n.y),b=G.clamp(c.z,o.z,n.z),j=G.clamp(c.w,o.w,n.w);return y.x=O,y.y=w,y.z=b,y.w=j,y}static magnitudeSquared(c){return p.typeOf.object("cartesian",c),c.x*c.x+c.y*c.y+c.z*c.z+c.w*c.w}static magnitude(c){return Math.sqrt(f.magnitudeSquared(c))}static distance(c,o){return p.typeOf.object("left",c),p.typeOf.object("right",o),f.subtract(c,o,r),f.magnitude(r)}static distanceSquared(c,o){return p.typeOf.object("left",c),p.typeOf.object("right",o),f.subtract(c,o,r),f.magnitudeSquared(r)}static normalize(c,o){p.typeOf.object("cartesian",c),p.typeOf.object("result",o);let n=f.magnitude(c);if(o.x=c.x/n,o.y=c.y/n,o.z=c.z/n,o.w=c.w/n,isNaN(o.x)||isNaN(o.y)||isNaN(o.z)||isNaN(o.w))throw new m("normalized result is not a number");return o}static dot(c,o){return p.typeOf.object("left",c),p.typeOf.object("right",o),c.x*o.x+c.y*o.y+c.z*o.z+c.w*o.w}static multiplyComponents(c,o,n){return p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n),n.x=c.x*o.x,n.y=c.y*o.y,n.z=c.z*o.z,n.w=c.w*o.w,n}static divideComponents(c,o,n){return p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n),n.x=c.x/o.x,n.y=c.y/o.y,n.z=c.z/o.z,n.w=c.w/o.w,n}static add(c,o,n){return p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n),n.x=c.x+o.x,n.y=c.y+o.y,n.z=c.z+o.z,n.w=c.w+o.w,n}static subtract(c,o,n){return p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n),n.x=c.x-o.x,n.y=c.y-o.y,n.z=c.z-o.z,n.w=c.w-o.w,n}static multiplyByScalar(c,o,n){return p.typeOf.object("cartesian",c),p.typeOf.number("scalar",o),p.typeOf.object("result",n),n.x=c.x*o,n.y=c.y*o,n.z=c.z*o,n.w=c.w*o,n}static divideByScalar(c,o,n){return p.typeOf.object("cartesian",c),p.typeOf.number("scalar",o),p.typeOf.object("result",n),n.x=c.x/o,n.y=c.y/o,n.z=c.z/o,n.w=c.w/o,n}static negate(c,o){return p.typeOf.object("cartesian",c),p.typeOf.object("result",o),o.x=-c.x,o.y=-c.y,o.z=-c.z,o.w=-c.w,o}static abs(c,o){return p.typeOf.object("cartesian",c),p.typeOf.object("result",o),o.x=Math.abs(c.x),o.y=Math.abs(c.y),o.z=Math.abs(c.z),o.w=Math.abs(c.w),o}static lerp(c,o,n,y){return p.typeOf.object("start",c),p.typeOf.object("end",o),p.typeOf.number("t",n),p.typeOf.object("result",y),f.multiplyByScalar(o,n,h1),y=f.multiplyByScalar(c,1-n,y),f.add(h1,y,y)}static mostOrthogonalAxis(c,o){p.typeOf.object("cartesian",c),p.typeOf.object("result",o);let n=f.normalize(c,S1);return f.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?o=f.clone(f.UNIT_X,o):o=f.clone(f.UNIT_W,o):n.z<=n.w?o=f.clone(f.UNIT_Z,o):o=f.clone(f.UNIT_W,o):n.y<=n.z?n.y<=n.w?o=f.clone(f.UNIT_Y,o):o=f.clone(f.UNIT_W,o):n.z<=n.w?o=f.clone(f.UNIT_Z,o):o=f.clone(f.UNIT_W,o),o}static equals(c,o){return c===o||S(c)&&S(o)&&c.x===o.x&&c.y===o.y&&c.z===o.z&&c.w===o.w}static equalsArray(c,o,n){return c.x===o[n]&&c.y===o[n+1]&&c.z===o[n+2]&&c.w===o[n+3]}static equalsEpsilon(c,o,n,y){return c===o||S(c)&&S(o)&&G.equalsEpsilon(c.x,o.x,n,y)&&G.equalsEpsilon(c.y,o.y,n,y)&&G.equalsEpsilon(c.z,o.z,n,y)&&G.equalsEpsilon(c.w,o.w,n,y)}clone(c){return f.clone(this,c)}equals(c){return f.equals(this,c)}equalsEpsilon(c,o,n){return f.equalsEpsilon(this,c,o,n)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(c,o){return p.typeOf.number("value",c),S(o)||(o=new f),f1[0]=c,M1?(o.x=F[0],o.y=F[1],o.z=F[2],o.w=F[3]):(o.x=F[3],o.y=F[2],o.z=F[1],o.w=F[0]),o}static unpackFloat(c){return p.typeOf.object("packedFloat",c),M1?(F[0]=c.x,F[1]=c.y,F[2]=c.z,F[3]=c.w):(F[0]=c.w,F[1]=c.z,F[2]=c.y,F[3]=c.x),f1[0]}};V.packedLength=4;V.fromArray=V.unpack;var r=new V,h1=new V,S1=new V;V.ZERO=Object.freeze(new V(0,0,0,0));V.ONE=Object.freeze(new V(1,1,1,1));V.UNIT_X=Object.freeze(new V(1,0,0,0));V.UNIT_Y=Object.freeze(new V(0,1,0,0));V.UNIT_Z=Object.freeze(new V(0,0,1,0));V.UNIT_W=Object.freeze(new V(0,0,0,1));var f1=new Float32Array(1),F=new Uint8Array(f1.buffer),U1=new Uint32Array([287454020]),d1=new Uint8Array(U1.buffer),M1=d1[0]===68,c1=V;var A1=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),L=class f{constructor(c,o,n,y,O,w,b,j,z,h,M,N,T,C,E,q){let R=Reflect.construct(Array,A1,new.target);return R[0]=c??0,R[1]=O??0,R[2]=z??0,R[3]=T??0,R[4]=o??0,R[5]=w??0,R[6]=h??0,R[7]=C??0,R[8]=n??0,R[9]=b??0,R[10]=M??0,R[11]=E??0,R[12]=y??0,R[13]=j??0,R[14]=N??0,R[15]=q??0,R}static pack(c,o,n){return p.typeOf.object("value",c),p.defined("array",o),n=n??0,o[n++]=c[0],o[n++]=c[1],o[n++]=c[2],o[n++]=c[3],o[n++]=c[4],o[n++]=c[5],o[n++]=c[6],o[n++]=c[7],o[n++]=c[8],o[n++]=c[9],o[n++]=c[10],o[n++]=c[11],o[n++]=c[12],o[n++]=c[13],o[n++]=c[14],o[n]=c[15],o}static unpack(c,o,n){return p.defined("array",c),o=o??0,S(n)||(n=new f),n[0]=c[o++],n[1]=c[o++],n[2]=c[o++],n[3]=c[o++],n[4]=c[o++],n[5]=c[o++],n[6]=c[o++],n[7]=c[o++],n[8]=c[o++],n[9]=c[o++],n[10]=c[o++],n[11]=c[o++],n[12]=c[o++],n[13]=c[o++],n[14]=c[o++],n[15]=c[o],n}static packArray(c,o){p.defined("array",c);let n=c.length,y=n*16;if(!S(o))o=new Array(y);else{if(!Array.isArray(o)&&o.length!==y)throw new m("If result is a typed array, it must have exactly array.length * 16 elements");o.length!==y&&(o.length=y)}for(let O=0;O<n;++O)f.pack(c[O],o,O*16);return o}static unpackArray(c,o){if(p.defined("array",c),p.typeOf.number.greaterThanOrEquals("array.length",c.length,16),c.length%16!==0)throw new m("array length must be a multiple of 16.");let n=c.length;S(o)?o.length=n/16:o=new Array(n/16);for(let y=0;y<n;y+=16){let O=y/16;o[O]=f.unpack(c,y,o[O])}return o}static clone(c,o){if(S(c))return S(o)?(o[0]=c[0],o[1]=c[1],o[2]=c[2],o[3]=c[3],o[4]=c[4],o[5]=c[5],o[6]=c[6],o[7]=c[7],o[8]=c[8],o[9]=c[9],o[10]=c[10],o[11]=c[11],o[12]=c[12],o[13]=c[13],o[14]=c[14],o[15]=c[15],o):new f(c[0],c[4],c[8],c[12],c[1],c[5],c[9],c[13],c[2],c[6],c[10],c[14],c[3],c[7],c[11],c[15])}static fromColumnMajorArray(c,o){return p.defined("values",c),f.clone(c,o)}static fromRowMajorArray(c,o){return p.defined("values",c),S(o)?(o[0]=c[0],o[1]=c[4],o[2]=c[8],o[3]=c[12],o[4]=c[1],o[5]=c[5],o[6]=c[9],o[7]=c[13],o[8]=c[2],o[9]=c[6],o[10]=c[10],o[11]=c[14],o[12]=c[3],o[13]=c[7],o[14]=c[11],o[15]=c[15],o):new f(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])}static fromRotationTranslation(c,o,n){return p.typeOf.object("rotation",c),o=o??W.ZERO,S(n)?(n[0]=c[0],n[1]=c[1],n[2]=c[2],n[3]=0,n[4]=c[3],n[5]=c[4],n[6]=c[5],n[7]=0,n[8]=c[6],n[9]=c[7],n[10]=c[8],n[11]=0,n[12]=o.x,n[13]=o.y,n[14]=o.z,n[15]=1,n):new f(c[0],c[3],c[6],o.x,c[1],c[4],c[7],o.y,c[2],c[5],c[8],o.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(c,o,n,y){p.typeOf.object("translation",c),p.typeOf.object("rotation",o),p.typeOf.object("scale",n),S(y)||(y=new f);let O=n.x,w=n.y,b=n.z,j=o.x*o.x,z=o.x*o.y,h=o.x*o.z,M=o.x*o.w,N=o.y*o.y,T=o.y*o.z,C=o.y*o.w,E=o.z*o.z,q=o.z*o.w,R=o.w*o.w,U=j-N-E+R,d=2*(z-q),A=2*(h+C),$=2*(z+q),Z=-j+N-E+R,B=2*(T-M),Y=2*(h-C),k=2*(T+M),X=-j-N+E+R;return y[0]=U*O,y[1]=$*O,y[2]=Y*O,y[3]=0,y[4]=d*w,y[5]=Z*w,y[6]=k*w,y[7]=0,y[8]=A*b,y[9]=B*b,y[10]=X*b,y[11]=0,y[12]=c.x,y[13]=c.y,y[14]=c.z,y[15]=1,y}static fromTranslationRotationScale(c,o){return p.typeOf.object("translationRotationScale",c),f.fromTranslationQuaternionRotationScale(c.translation,c.rotation,c.scale,o)}static fromTranslation(c,o){return p.typeOf.object("translation",c),f.fromRotationTranslation(u.IDENTITY,c,o)}static fromScale(c,o){return p.typeOf.object("scale",c),S(o)?(o[0]=c.x,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=c.y,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c.z,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o):new f(c.x,0,0,0,0,c.y,0,0,0,0,c.z,0,0,0,0,1)}static fromUniformScale(c,o){return p.typeOf.number("scale",c),S(o)?(o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o):new f(c,0,0,0,0,c,0,0,0,0,c,0,0,0,0,1)}static fromRotation(c,o){return p.typeOf.object("rotation",c),S(o)||(o=new f),o[0]=c[0],o[1]=c[1],o[2]=c[2],o[3]=0,o[4]=c[3],o[5]=c[4],o[6]=c[5],o[7]=0,o[8]=c[6],o[9]=c[7],o[10]=c[8],o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o}static fromCamera(c,o){p.typeOf.object("camera",c);let n=c.position,y=c.direction,O=c.up;p.typeOf.object("camera.position",n),p.typeOf.object("camera.direction",y),p.typeOf.object("camera.up",O),W.normalize(y,e),W.normalize(W.cross(e,O,t),t),W.normalize(W.cross(t,e,l),l);let w=t.x,b=t.y,j=t.z,z=e.x,h=e.y,M=e.z,N=l.x,T=l.y,C=l.z,E=n.x,q=n.y,R=n.z,U=w*-E+b*-q+j*-R,d=N*-E+T*-q+C*-R,A=z*E+h*q+M*R;return S(o)?(o[0]=w,o[1]=N,o[2]=-z,o[3]=0,o[4]=b,o[5]=T,o[6]=-h,o[7]=0,o[8]=j,o[9]=C,o[10]=-M,o[11]=0,o[12]=U,o[13]=d,o[14]=A,o[15]=1,o):new f(w,b,j,U,N,T,C,d,-z,-h,-M,A,0,0,0,1)}static computePerspectiveFieldOfView(c,o,n,y,O){p.typeOf.number.greaterThan("fovY",c,0),p.typeOf.number.lessThan("fovY",c,Math.PI),p.typeOf.number.greaterThan("near",n,0),p.typeOf.number.greaterThan("far",y,0),p.typeOf.object("result",O);let b=1/Math.tan(c*.5),j=b/o,z=(y+n)/(n-y),h=2*y*n/(n-y);return O[0]=j,O[1]=0,O[2]=0,O[3]=0,O[4]=0,O[5]=b,O[6]=0,O[7]=0,O[8]=0,O[9]=0,O[10]=z,O[11]=-1,O[12]=0,O[13]=0,O[14]=h,O[15]=0,O}static computeOrthographicOffCenter(c,o,n,y,O,w,b){p.typeOf.number("left",c),p.typeOf.number("right",o),p.typeOf.number("bottom",n),p.typeOf.number("top",y),p.typeOf.number("near",O),p.typeOf.number("far",w),p.typeOf.object("result",b);let j=1/(o-c),z=1/(y-n),h=1/(w-O),M=-(o+c)*j,N=-(y+n)*z,T=-(w+O)*h;return j*=2,z*=2,h*=-2,b[0]=j,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=z,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[10]=h,b[11]=0,b[12]=M,b[13]=N,b[14]=T,b[15]=1,b}static computePerspectiveOffCenter(c,o,n,y,O,w,b){p.typeOf.number("left",c),p.typeOf.number("right",o),p.typeOf.number("bottom",n),p.typeOf.number("top",y),p.typeOf.number("near",O),p.typeOf.number("far",w),p.typeOf.object("result",b);let j=2*O/(o-c),z=2*O/(y-n),h=(o+c)/(o-c),M=(y+n)/(y-n),N=-(w+O)/(w-O),T=-1,C=-2*w*O/(w-O);return b[0]=j,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=z,b[6]=0,b[7]=0,b[8]=h,b[9]=M,b[10]=N,b[11]=T,b[12]=0,b[13]=0,b[14]=C,b[15]=0,b}static computeInfinitePerspectiveOffCenter(c,o,n,y,O,w){p.typeOf.number("left",c),p.typeOf.number("right",o),p.typeOf.number("bottom",n),p.typeOf.number("top",y),p.typeOf.number("near",O),p.typeOf.object("result",w);let b=2*O/(o-c),j=2*O/(y-n),z=(o+c)/(o-c),h=(y+n)/(y-n),M=-1,N=-1,T=-2*O;return w[0]=b,w[1]=0,w[2]=0,w[3]=0,w[4]=0,w[5]=j,w[6]=0,w[7]=0,w[8]=z,w[9]=h,w[10]=M,w[11]=N,w[12]=0,w[13]=0,w[14]=T,w[15]=0,w}static computeViewportTransformation(c,o,n,y){S(y)||(y=new f),c=c??z1.EMPTY_OBJECT;let O=c.x??0,w=c.y??0,b=c.width??0,j=c.height??0;o=o??0,n=n??1;let z=b*.5,h=j*.5,M=(n-o)*.5,N=z,T=h,C=M,E=O+z,q=w+h,R=o+M,U=1;return y[0]=N,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=T,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=C,y[11]=0,y[12]=E,y[13]=q,y[14]=R,y[15]=U,y}static computeView(c,o,n,y,O){return p.typeOf.object("position",c),p.typeOf.object("direction",o),p.typeOf.object("up",n),p.typeOf.object("right",y),p.typeOf.object("result",O),O[0]=y.x,O[1]=n.x,O[2]=-o.x,O[3]=0,O[4]=y.y,O[5]=n.y,O[6]=-o.y,O[7]=0,O[8]=y.z,O[9]=n.z,O[10]=-o.z,O[11]=0,O[12]=-W.dot(y,c),O[13]=-W.dot(n,c),O[14]=W.dot(o,c),O[15]=1,O}static toArray(c,o){return p.typeOf.object("matrix",c),S(o)?(o[0]=c[0],o[1]=c[1],o[2]=c[2],o[3]=c[3],o[4]=c[4],o[5]=c[5],o[6]=c[6],o[7]=c[7],o[8]=c[8],o[9]=c[9],o[10]=c[10],o[11]=c[11],o[12]=c[12],o[13]=c[13],o[14]=c[14],o[15]=c[15],o):[c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15]]}static getElementIndex(c,o){return p.typeOf.number.greaterThanOrEquals("row",o,0),p.typeOf.number.lessThanOrEquals("row",o,3),p.typeOf.number.greaterThanOrEquals("column",c,0),p.typeOf.number.lessThanOrEquals("column",c,3),c*4+o}static getColumn(c,o,n){p.typeOf.object("matrix",c),p.typeOf.number.greaterThanOrEquals("index",o,0),p.typeOf.number.lessThanOrEquals("index",o,3),p.typeOf.object("result",n);let y=o*4,O=c[y],w=c[y+1],b=c[y+2],j=c[y+3];return n.x=O,n.y=w,n.z=b,n.w=j,n}static setColumn(c,o,n,y){p.typeOf.object("matrix",c),p.typeOf.number.greaterThanOrEquals("index",o,0),p.typeOf.number.lessThanOrEquals("index",o,3),p.typeOf.object("cartesian",n),p.typeOf.object("result",y),y=f.clone(c,y);let O=o*4;return y[O]=n.x,y[O+1]=n.y,y[O+2]=n.z,y[O+3]=n.w,y}static getRow(c,o,n){p.typeOf.object("matrix",c),p.typeOf.number.greaterThanOrEquals("index",o,0),p.typeOf.number.lessThanOrEquals("index",o,3),p.typeOf.object("result",n);let y=c[o],O=c[o+4],w=c[o+8],b=c[o+12];return n.x=y,n.y=O,n.z=w,n.w=b,n}static setRow(c,o,n,y){return p.typeOf.object("matrix",c),p.typeOf.number.greaterThanOrEquals("index",o,0),p.typeOf.number.lessThanOrEquals("index",o,3),p.typeOf.object("cartesian",n),p.typeOf.object("result",y),y=f.clone(c,y),y[o]=n.x,y[o+4]=n.y,y[o+8]=n.z,y[o+12]=n.w,y}static setTranslation(c,o,n){return p.typeOf.object("matrix",c),p.typeOf.object("translation",o),p.typeOf.object("result",n),n[0]=c[0],n[1]=c[1],n[2]=c[2],n[3]=c[3],n[4]=c[4],n[5]=c[5],n[6]=c[6],n[7]=c[7],n[8]=c[8],n[9]=c[9],n[10]=c[10],n[11]=c[11],n[12]=o.x,n[13]=o.y,n[14]=o.z,n[15]=c[15],n}static setScale(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("scale",o),p.typeOf.object("result",n);let y=f.getScale(c,L1),O=o.x/y.x,w=o.y/y.y,b=o.z/y.z;return n[0]=c[0]*O,n[1]=c[1]*O,n[2]=c[2]*O,n[3]=c[3],n[4]=c[4]*w,n[5]=c[5]*w,n[6]=c[6]*w,n[7]=c[7],n[8]=c[8]*b,n[9]=c[9]*b,n[10]=c[10]*b,n[11]=c[11],n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n}static setUniformScale(c,o,n){p.typeOf.object("matrix",c),p.typeOf.number("scale",o),p.typeOf.object("result",n);let y=f.getScale(c,W1),O=o/y.x,w=o/y.y,b=o/y.z;return n[0]=c[0]*O,n[1]=c[1]*O,n[2]=c[2]*O,n[3]=c[3],n[4]=c[4]*w,n[5]=c[5]*w,n[6]=c[6]*w,n[7]=c[7],n[8]=c[8]*b,n[9]=c[9]*b,n[10]=c[10]*b,n[11]=c[11],n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n}static getScale(c,o){return p.typeOf.object("matrix",c),p.typeOf.object("result",o),o.x=W.magnitude(W.fromElements(c[0],c[1],c[2],j1)),o.y=W.magnitude(W.fromElements(c[4],c[5],c[6],j1)),o.z=W.magnitude(W.fromElements(c[8],c[9],c[10],j1)),o}static getMaximumScale(c){return f.getScale(c,N1),W.maximumComponent(N1)}static setRotation(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("result",n);let y=f.getScale(c,$1);return n[0]=o[0]*y.x,n[1]=o[1]*y.x,n[2]=o[2]*y.x,n[3]=c[3],n[4]=o[3]*y.y,n[5]=o[4]*y.y,n[6]=o[5]*y.y,n[7]=c[7],n[8]=o[6]*y.z,n[9]=o[7]*y.z,n[10]=o[8]*y.z,n[11]=c[11],n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n}static getRotation(c,o){p.typeOf.object("matrix",c),p.typeOf.object("result",o);let n=f.getScale(c,Z1);return o[0]=c[0]/n.x,o[1]=c[1]/n.x,o[2]=c[2]/n.x,o[3]=c[4]/n.y,o[4]=c[5]/n.y,o[5]=c[6]/n.y,o[6]=c[8]/n.z,o[7]=c[9]/n.z,o[8]=c[10]/n.z,o}static multiply(c,o,n){p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n);let y=c[0],O=c[1],w=c[2],b=c[3],j=c[4],z=c[5],h=c[6],M=c[7],N=c[8],T=c[9],C=c[10],E=c[11],q=c[12],R=c[13],U=c[14],d=c[15],A=o[0],$=o[1],Z=o[2],B=o[3],Y=o[4],k=o[5],X=o[6],Q=o[7],H=o[8],J=o[9],D=o[10],K=o[11],I=o[12],v=o[13],g=o[14],_=o[15],x=y*A+j*$+N*Z+q*B,s=O*A+z*$+T*Z+R*B,i=w*A+h*$+C*Z+U*B,a=b*A+M*$+E*Z+d*B,o1=y*Y+j*k+N*X+q*Q,n1=O*Y+z*k+T*X+R*Q,y1=w*Y+h*k+C*X+U*Q,p1=b*Y+M*k+E*X+d*Q,O1=y*H+j*J+N*D+q*K,b1=O*H+z*J+T*D+R*K,w1=w*H+h*J+C*D+U*K,P=b*H+M*J+E*D+d*K,T1=y*I+j*v+N*g+q*_,C1=O*I+z*v+T*g+R*_,q1=w*I+h*v+C*g+U*_,E1=b*I+M*v+E*g+d*_;return n[0]=x,n[1]=s,n[2]=i,n[3]=a,n[4]=o1,n[5]=n1,n[6]=y1,n[7]=p1,n[8]=O1,n[9]=b1,n[10]=w1,n[11]=P,n[12]=T1,n[13]=C1,n[14]=q1,n[15]=E1,n}static add(c,o,n){return p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n),n[0]=c[0]+o[0],n[1]=c[1]+o[1],n[2]=c[2]+o[2],n[3]=c[3]+o[3],n[4]=c[4]+o[4],n[5]=c[5]+o[5],n[6]=c[6]+o[6],n[7]=c[7]+o[7],n[8]=c[8]+o[8],n[9]=c[9]+o[9],n[10]=c[10]+o[10],n[11]=c[11]+o[11],n[12]=c[12]+o[12],n[13]=c[13]+o[13],n[14]=c[14]+o[14],n[15]=c[15]+o[15],n}static subtract(c,o,n){return p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n),n[0]=c[0]-o[0],n[1]=c[1]-o[1],n[2]=c[2]-o[2],n[3]=c[3]-o[3],n[4]=c[4]-o[4],n[5]=c[5]-o[5],n[6]=c[6]-o[6],n[7]=c[7]-o[7],n[8]=c[8]-o[8],n[9]=c[9]-o[9],n[10]=c[10]-o[10],n[11]=c[11]-o[11],n[12]=c[12]-o[12],n[13]=c[13]-o[13],n[14]=c[14]-o[14],n[15]=c[15]-o[15],n}static multiplyTransformation(c,o,n){p.typeOf.object("left",c),p.typeOf.object("right",o),p.typeOf.object("result",n);let y=c[0],O=c[1],w=c[2],b=c[4],j=c[5],z=c[6],h=c[8],M=c[9],N=c[10],T=c[12],C=c[13],E=c[14],q=o[0],R=o[1],U=o[2],d=o[4],A=o[5],$=o[6],Z=o[8],B=o[9],Y=o[10],k=o[12],X=o[13],Q=o[14],H=y*q+b*R+h*U,J=O*q+j*R+M*U,D=w*q+z*R+N*U,K=y*d+b*A+h*$,I=O*d+j*A+M*$,v=w*d+z*A+N*$,g=y*Z+b*B+h*Y,_=O*Z+j*B+M*Y,x=w*Z+z*B+N*Y,s=y*k+b*X+h*Q+T,i=O*k+j*X+M*Q+C,a=w*k+z*X+N*Q+E;return n[0]=H,n[1]=J,n[2]=D,n[3]=0,n[4]=K,n[5]=I,n[6]=v,n[7]=0,n[8]=g,n[9]=_,n[10]=x,n[11]=0,n[12]=s,n[13]=i,n[14]=a,n[15]=1,n}static multiplyByMatrix3(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("rotation",o),p.typeOf.object("result",n);let y=c[0],O=c[1],w=c[2],b=c[4],j=c[5],z=c[6],h=c[8],M=c[9],N=c[10],T=o[0],C=o[1],E=o[2],q=o[3],R=o[4],U=o[5],d=o[6],A=o[7],$=o[8],Z=y*T+b*C+h*E,B=O*T+j*C+M*E,Y=w*T+z*C+N*E,k=y*q+b*R+h*U,X=O*q+j*R+M*U,Q=w*q+z*R+N*U,H=y*d+b*A+h*$,J=O*d+j*A+M*$,D=w*d+z*A+N*$;return n[0]=Z,n[1]=B,n[2]=Y,n[3]=0,n[4]=k,n[5]=X,n[6]=Q,n[7]=0,n[8]=H,n[9]=J,n[10]=D,n[11]=0,n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n}static multiplyByTranslation(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("translation",o),p.typeOf.object("result",n);let y=o.x,O=o.y,w=o.z,b=y*c[0]+O*c[4]+w*c[8]+c[12],j=y*c[1]+O*c[5]+w*c[9]+c[13],z=y*c[2]+O*c[6]+w*c[10]+c[14];return n[0]=c[0],n[1]=c[1],n[2]=c[2],n[3]=c[3],n[4]=c[4],n[5]=c[5],n[6]=c[6],n[7]=c[7],n[8]=c[8],n[9]=c[9],n[10]=c[10],n[11]=c[11],n[12]=b,n[13]=j,n[14]=z,n[15]=c[15],n}static multiplyByScale(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("scale",o),p.typeOf.object("result",n);let y=o.x,O=o.y,w=o.z;return y===1&&O===1&&w===1?f.clone(c,n):(n[0]=y*c[0],n[1]=y*c[1],n[2]=y*c[2],n[3]=c[3],n[4]=O*c[4],n[5]=O*c[5],n[6]=O*c[6],n[7]=c[7],n[8]=w*c[8],n[9]=w*c[9],n[10]=w*c[10],n[11]=c[11],n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n)}static multiplyByUniformScale(c,o,n){return p.typeOf.object("matrix",c),p.typeOf.number("scale",o),p.typeOf.object("result",n),n[0]=c[0]*o,n[1]=c[1]*o,n[2]=c[2]*o,n[3]=c[3],n[4]=c[4]*o,n[5]=c[5]*o,n[6]=c[6]*o,n[7]=c[7],n[8]=c[8]*o,n[9]=c[9]*o,n[10]=c[10]*o,n[11]=c[11],n[12]=c[12],n[13]=c[13],n[14]=c[14],n[15]=c[15],n}static multiplyByVector(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("cartesian",o),p.typeOf.object("result",n);let y=o.x,O=o.y,w=o.z,b=o.w,j=c[0]*y+c[4]*O+c[8]*w+c[12]*b,z=c[1]*y+c[5]*O+c[9]*w+c[13]*b,h=c[2]*y+c[6]*O+c[10]*w+c[14]*b,M=c[3]*y+c[7]*O+c[11]*w+c[15]*b;return n.x=j,n.y=z,n.z=h,n.w=M,n}static multiplyByPointAsVector(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("cartesian",o),p.typeOf.object("result",n);let y=o.x,O=o.y,w=o.z,b=c[0]*y+c[4]*O+c[8]*w,j=c[1]*y+c[5]*O+c[9]*w,z=c[2]*y+c[6]*O+c[10]*w;return n.x=b,n.y=j,n.z=z,n}static multiplyByPoint(c,o,n){p.typeOf.object("matrix",c),p.typeOf.object("cartesian",o),p.typeOf.object("result",n);let y=o.x,O=o.y,w=o.z,b=c[0]*y+c[4]*O+c[8]*w+c[12],j=c[1]*y+c[5]*O+c[9]*w+c[13],z=c[2]*y+c[6]*O+c[10]*w+c[14];return n.x=b,n.y=j,n.z=z,n}static multiplyByScalar(c,o,n){return p.typeOf.object("matrix",c),p.typeOf.number("scalar",o),p.typeOf.object("result",n),n[0]=c[0]*o,n[1]=c[1]*o,n[2]=c[2]*o,n[3]=c[3]*o,n[4]=c[4]*o,n[5]=c[5]*o,n[6]=c[6]*o,n[7]=c[7]*o,n[8]=c[8]*o,n[9]=c[9]*o,n[10]=c[10]*o,n[11]=c[11]*o,n[12]=c[12]*o,n[13]=c[13]*o,n[14]=c[14]*o,n[15]=c[15]*o,n}static negate(c,o){return p.typeOf.object("matrix",c),p.typeOf.object("result",o),o[0]=-c[0],o[1]=-c[1],o[2]=-c[2],o[3]=-c[3],o[4]=-c[4],o[5]=-c[5],o[6]=-c[6],o[7]=-c[7],o[8]=-c[8],o[9]=-c[9],o[10]=-c[10],o[11]=-c[11],o[12]=-c[12],o[13]=-c[13],o[14]=-c[14],o[15]=-c[15],o}static transpose(c,o){p.typeOf.object("matrix",c),p.typeOf.object("result",o);let n=c[1],y=c[2],O=c[3],w=c[6],b=c[7],j=c[11];return o[0]=c[0],o[1]=c[4],o[2]=c[8],o[3]=c[12],o[4]=n,o[5]=c[5],o[6]=c[9],o[7]=c[13],o[8]=y,o[9]=w,o[10]=c[10],o[11]=c[14],o[12]=O,o[13]=b,o[14]=j,o[15]=c[15],o}static abs(c,o){return p.typeOf.object("matrix",c),p.typeOf.object("result",o),o[0]=Math.abs(c[0]),o[1]=Math.abs(c[1]),o[2]=Math.abs(c[2]),o[3]=Math.abs(c[3]),o[4]=Math.abs(c[4]),o[5]=Math.abs(c[5]),o[6]=Math.abs(c[6]),o[7]=Math.abs(c[7]),o[8]=Math.abs(c[8]),o[9]=Math.abs(c[9]),o[10]=Math.abs(c[10]),o[11]=Math.abs(c[11]),o[12]=Math.abs(c[12]),o[13]=Math.abs(c[13]),o[14]=Math.abs(c[14]),o[15]=Math.abs(c[15]),o}static equals(c,o){return c===o||S(c)&&S(o)&&c[12]===o[12]&&c[13]===o[13]&&c[14]===o[14]&&c[0]===o[0]&&c[1]===o[1]&&c[2]===o[2]&&c[4]===o[4]&&c[5]===o[5]&&c[6]===o[6]&&c[8]===o[8]&&c[9]===o[9]&&c[10]===o[10]&&c[3]===o[3]&&c[7]===o[7]&&c[11]===o[11]&&c[15]===o[15]}static equalsEpsilon(c,o,n){return n=n??0,c===o||S(c)&&S(o)&&Math.abs(c[0]-o[0])<=n&&Math.abs(c[1]-o[1])<=n&&Math.abs(c[2]-o[2])<=n&&Math.abs(c[3]-o[3])<=n&&Math.abs(c[4]-o[4])<=n&&Math.abs(c[5]-o[5])<=n&&Math.abs(c[6]-o[6])<=n&&Math.abs(c[7]-o[7])<=n&&Math.abs(c[8]-o[8])<=n&&Math.abs(c[9]-o[9])<=n&&Math.abs(c[10]-o[10])<=n&&Math.abs(c[11]-o[11])<=n&&Math.abs(c[12]-o[12])<=n&&Math.abs(c[13]-o[13])<=n&&Math.abs(c[14]-o[14])<=n&&Math.abs(c[15]-o[15])<=n}static getTranslation(c,o){return p.typeOf.object("matrix",c),p.typeOf.object("result",o),o.x=c[12],o.y=c[13],o.z=c[14],o}static getMatrix3(c,o){return p.typeOf.object("matrix",c),p.typeOf.object("result",o),o[0]=c[0],o[1]=c[1],o[2]=c[2],o[3]=c[4],o[4]=c[5],o[5]=c[6],o[6]=c[8],o[7]=c[9],o[8]=c[10],o}static inverse(c,o){p.typeOf.object("matrix",c),p.typeOf.object("result",o);let n=c[0],y=c[4],O=c[8],w=c[12],b=c[1],j=c[5],z=c[9],h=c[13],M=c[2],N=c[6],T=c[10],C=c[14],E=c[3],q=c[7],R=c[11],U=c[15],d=T*U,A=C*R,$=N*U,Z=C*q,B=N*R,Y=T*q,k=M*U,X=C*E,Q=M*R,H=T*E,J=M*q,D=N*E,K=d*j+Z*z+B*h-(A*j+$*z+Y*h),I=A*b+k*z+H*h-(d*b+X*z+Q*h),v=$*b+X*j+J*h-(Z*b+k*j+D*h),g=Y*b+Q*j+D*z-(B*b+H*j+J*z),_=A*y+$*O+Y*w-(d*y+Z*O+B*w),x=d*n+X*O+Q*w-(A*n+k*O+H*w),s=Z*n+k*y+D*w-($*n+X*y+J*w),i=B*n+H*y+J*O-(Y*n+Q*y+D*O);d=O*h,A=w*z,$=y*h,Z=w*j,B=y*z,Y=O*j,k=n*h,X=w*b,Q=n*z,H=O*b,J=n*j,D=y*b;let a=d*q+Z*R+B*U-(A*q+$*R+Y*U),o1=A*E+k*R+H*U-(d*E+X*R+Q*U),n1=$*E+X*q+J*U-(Z*E+k*q+D*U),y1=Y*E+Q*q+D*R-(B*E+H*q+J*R),p1=$*T+Y*C+A*N-(B*C+d*N+Z*T),O1=Q*C+d*M+X*T-(k*T+H*C+A*M),b1=k*N+D*C+Z*M-(J*C+$*M+X*N),w1=J*T+B*M+H*N-(Q*N+D*T+Y*M),P=n*K+y*I+O*v+w*g;if(Math.abs(P)<G.EPSILON21){if(u.equalsEpsilon(f.getMatrix3(c,B1),Y1,G.EPSILON7)&&c1.equals(f.getRow(c,3,k1),X1))return o[0]=0,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=0,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=0,o[11]=0,o[12]=-c[12],o[13]=-c[13],o[14]=-c[14],o[15]=1,o;throw new R1("matrix is not invertible because its determinate is zero.")}return P=1/P,o[0]=K*P,o[1]=I*P,o[2]=v*P,o[3]=g*P,o[4]=_*P,o[5]=x*P,o[6]=s*P,o[7]=i*P,o[8]=a*P,o[9]=o1*P,o[10]=n1*P,o[11]=y1*P,o[12]=p1*P,o[13]=O1*P,o[14]=b1*P,o[15]=w1*P,o}static inverseTransformation(c,o){p.typeOf.object("matrix",c),p.typeOf.object("result",o);let n=c[0],y=c[1],O=c[2],w=c[4],b=c[5],j=c[6],z=c[8],h=c[9],M=c[10],N=c[12],T=c[13],C=c[14],E=-n*N-y*T-O*C,q=-w*N-b*T-j*C,R=-z*N-h*T-M*C;return o[0]=n,o[1]=w,o[2]=z,o[3]=0,o[4]=y,o[5]=b,o[6]=h,o[7]=0,o[8]=O,o[9]=j,o[10]=M,o[11]=0,o[12]=E,o[13]=q,o[14]=R,o[15]=1,o}static inverseTranspose(c,o){return p.typeOf.object("matrix",c),p.typeOf.object("result",o),f.inverse(f.transpose(c,P1),o)}get length(){return f.packedLength}clone(c){return f.clone(this,c)}equals(c){return f.equals(this,c)}static equalsArray(c,o,n){return c[0]===o[n]&&c[1]===o[n+1]&&c[2]===o[n+2]&&c[3]===o[n+3]&&c[4]===o[n+4]&&c[5]===o[n+5]&&c[6]===o[n+6]&&c[7]===o[n+7]&&c[8]===o[n+8]&&c[9]===o[n+9]&&c[10]===o[n+10]&&c[11]===o[n+11]&&c[12]===o[n+12]&&c[13]===o[n+13]&&c[14]===o[n+14]&&c[15]===o[n+15]}equalsEpsilon(c,o){return f.equalsEpsilon(this,c,o)}toString(){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]})`}};L.packedLength=16;L.fromArray=L.unpack;L.IDENTITY=new L(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);L.ZERO=new L(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);L.COLUMN0ROW0=0;L.COLUMN0ROW1=1;L.COLUMN0ROW2=2;L.COLUMN0ROW3=3;L.COLUMN1ROW0=4;L.COLUMN1ROW1=5;L.COLUMN1ROW2=6;L.COLUMN1ROW3=7;L.COLUMN2ROW0=8;L.COLUMN2ROW1=9;L.COLUMN2ROW2=10;L.COLUMN2ROW3=11;L.COLUMN3ROW0=12;L.COLUMN3ROW1=13;L.COLUMN3ROW2=14;L.COLUMN3ROW3=15;var e=new W,t=new W,l=new W,L1=new W,W1=new W,j1=new W,N1=new W,$1=new W,Z1=new W,B1=new u,Y1=new u,k1=new c1,X1=new c1(0,0,0,1),P1=new L,t1=L;export{c1 as a,t1 as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-HRZKIJQA.js b/plugins/feature/map/Cesium/Workers/chunk-HRZKIJQA.js deleted file mode 100644 index d4e416cdd..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-HRZKIJQA.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{f as C}from"./chunk-3PT5NNSP.js";import{a as n,e as b}from"./chunk-FGKVHLJ4.js";import{a as w}from"./chunk-YRCAQUFT.js";var j={},q=new n,L=new n,Q=new C,G=new b;function W(m,O,p,S,g,_,d,f,M,s){let a=m+O;n.multiplyByScalar(S,Math.cos(a),q),n.multiplyByScalar(p,Math.sin(a),L),n.add(q,L,q);let u=Math.cos(m);u=u*u;let l=Math.sin(m);l=l*l;let h=_/Math.sqrt(d*u+g*l)/f;return C.fromAxisAngle(q,h,Q),b.fromQuaternion(Q,G),b.multiplyByVector(G,M,s),n.normalize(s,s),n.multiplyByScalar(s,f,s),s}var U=new n,Z=new n,N=new n,v=new n;j.raisePositionsToHeight=function(m,O,p){let S=O.ellipsoid,g=O.height,_=O.extrudedHeight,d=p?m.length/3*2:m.length/3,f=new Float64Array(d*3),M=m.length,s=p?M:0;for(let a=0;a<M;a+=3){let u=a+1,l=a+2,r=n.fromArray(m,a,U);S.scaleToGeodeticSurface(r,r);let h=n.clone(r,Z),x=S.geodeticSurfaceNormal(r,v),P=n.multiplyByScalar(x,g,N);n.add(r,P,r),p&&(n.multiplyByScalar(x,_,P),n.add(h,P,h),f[a+s]=h.x,f[u+s]=h.y,f[l+s]=h.z),f[a]=r.x,f[u]=r.y,f[l]=r.z}return f};var D=new n,J=new n,K=new n;j.computeEllipsePositions=function(m,O,p){let S=m.semiMinorAxis,g=m.semiMajorAxis,_=m.rotation,d=m.center,f=m.granularity*8,M=S*S,s=g*g,a=g*S,u=n.magnitude(d),l=n.normalize(d,D),r=n.cross(n.UNIT_Z,d,J);r=n.normalize(r,r);let h=n.cross(l,r,K),x=1+Math.ceil(w.PI_OVER_TWO/f),P=w.PI_OVER_TWO/(x-1),y=w.PI_OVER_TWO-x*P;y<0&&(x-=Math.ceil(Math.abs(y)/P));let k=2*(x*(x+2)),e=O?new Array(k*3):void 0,o=0,t=U,i=Z,H=x*4*3,z=H-1,A=0,c=p?new Array(H):void 0,I,T,R,E,V;for(y=w.PI_OVER_TWO,t=W(y,_,h,r,M,a,s,u,l,t),O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x),y=w.PI_OVER_TWO-P,I=1;I<x+1;++I){if(t=W(y,_,h,r,M,a,s,u,l,t),i=W(Math.PI-y,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*I+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z),y=w.PI_OVER_TWO-(I+1)*P}for(I=x;I>1;--I){if(y=w.PI_OVER_TWO-(I-1)*P,t=W(-y,_,h,r,M,a,s,u,l,t),i=W(y+Math.PI,_,h,r,M,a,s,u,l,i),O){for(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,R=2*(I-1)+2,T=1;T<R-1;++T)E=T/(R-1),V=n.lerp(t,i,E,N),e[o++]=V.x,e[o++]=V.y,e[o++]=V.z;e[o++]=i.x,e[o++]=i.y,e[o++]=i.z}p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,c[A++]=i.x,c[A++]=i.y,c[A++]=i.z)}y=w.PI_OVER_TWO,t=W(-y,_,h,r,M,a,s,u,l,t);let B={};return O&&(e[o++]=t.x,e[o++]=t.y,e[o++]=t.z,B.positions=e,B.numPts=x),p&&(c[z--]=t.z,c[z--]=t.y,c[z--]=t.x,B.outerPositions=c),B};var tt=j;export{tt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-IAW6QHRG.js b/plugins/feature/map/Cesium/Workers/chunk-IAW6QHRG.js deleted file mode 100644 index 8c5807d39..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-IAW6QHRG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as p,b as P,d as T}from"./chunk-FGKVHLJ4.js";import{a}from"./chunk-YRCAQUFT.js";import{a as I,b as g}from"./chunk-ELJAHN3H.js";import{e as l}from"./chunk-3BGP4HCL.js";function w(n,i,o){if(n===0)return i*o;let t=n*n,e=t*t,c=e*t,r=c*t,h=r*t,s=h*t,d=o,u=Math.sin(2*d),f=Math.sin(4*d),M=Math.sin(6*d),_=Math.sin(8*d),E=Math.sin(10*d),S=Math.sin(12*d);return i*((1-t/4-3*e/64-5*c/256-175*r/16384-441*h/65536-4851*s/1048576)*d-(3*t/8+3*e/32+45*c/1024+105*r/4096+2205*h/131072+6237*s/524288)*u+(15*e/256+45*c/1024+525*r/16384+1575*h/65536+155925*s/8388608)*f-(35*c/3072+175*r/12288+3675*h/262144+13475*s/1048576)*M+(315*r/131072+2205*h/524288+43659*s/8388608)*_-(693*h/1310720+6237*s/5242880)*E+1001*s/8388608*S)}function H(n,i,o){let t=n/o;if(i===0)return t;let e=t*t,c=e*t,r=c*t,h=i,s=h*h,d=s*s,u=d*s,f=u*s,M=f*s,_=M*s,E=Math.sin(2*t),S=Math.cos(2*t),v=Math.sin(4*t),W=Math.cos(4*t),V=Math.sin(6*t),C=Math.cos(6*t),N=Math.sin(8*t),R=Math.cos(8*t),b=Math.sin(10*t),x=Math.cos(10*t),U=Math.sin(12*t);return t+t*s/4+7*t*d/64+15*t*u/256+579*t*f/16384+1515*t*M/65536+16837*t*_/1048576+(3*t*d/16+45*t*u/256-t*(32*e-561)*f/4096-t*(232*e-1677)*M/16384+t*(399985-90560*e+512*r)*_/5242880)*S+(21*t*u/256+483*t*f/4096-t*(224*e-1969)*M/16384-t*(33152*e-112599)*_/1048576)*W+(151*t*f/4096+4681*t*M/65536+1479*t*_/16384-453*c*_/32768)*C+(1097*t*M/65536+42783*t*_/1048576)*R+8011*t*_/1048576*x+(3*s/8+3*d/16+213*u/2048-3*e*u/64+255*f/4096-33*e*f/512+20861*M/524288-33*e*M/512+r*M/1024+28273*_/1048576-471*e*_/8192+9*r*_/4096)*E+(21*d/256+21*u/256+533*f/8192-21*e*f/512+197*M/4096-315*e*M/4096+584039*_/16777216-12517*e*_/131072+7*r*_/2048)*v+(151*u/6144+151*f/4096+5019*M/131072-453*e*M/16384+26965*_/786432-8607*e*_/131072)*V+(1097*f/131072+1097*M/65536+225797*_/10485760-1097*e*_/65536)*N+(8011*M/2621440+8011*_/1048576)*b+293393*_/251658240*U}function O(n,i){if(n===0)return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)));let o=n*Math.sin(i);return Math.log(Math.tan(.5*(a.PI_OVER_TWO+i)))-n/2*Math.log((1+o)/(1-o))}function z(n,i,o,t,e){let c=O(n._ellipticity,o),r=O(n._ellipticity,e);return Math.atan2(a.negativePiToPi(t-i),r-c)}function k(n,i,o,t,e,c,r){let h=n._heading,s=c-t,d=0;if(a.equalsEpsilon(Math.abs(h),a.PI_OVER_TWO,a.EPSILON8))if(i===o)d=i*Math.cos(e)*a.negativePiToPi(s);else{let u=Math.sin(e);d=i*Math.cos(e)*a.negativePiToPi(s)/Math.sqrt(1-n._ellipticitySquared*u*u)}else{let u=w(n._ellipticity,i,e);d=(w(n._ellipticity,i,r)-u)/Math.cos(h)}return Math.abs(d)}var A=new p,q=new p;function y(n,i,o,t){let e=p.normalize(t.cartographicToCartesian(i,q),A),c=p.normalize(t.cartographicToCartesian(o,q),q);g.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(p.angleBetween(e,c))-Math.PI),.0125);let r=t.maximumRadius,h=t.minimumRadius,s=r*r,d=h*h;n._ellipticitySquared=(s-d)/s,n._ellipticity=Math.sqrt(n._ellipticitySquared),n._start=P.clone(i,n._start),n._start.height=0,n._end=P.clone(o,n._end),n._end.height=0,n._heading=z(n,i.longitude,i.latitude,o.longitude,o.latitude),n._distance=k(n,t.maximumRadius,t.minimumRadius,i.longitude,i.latitude,o.longitude,o.latitude)}function D(n,i,o,t,e,c){if(o===0)return P.clone(n,c);let r=e*e,h,s,d;if(Math.abs(a.PI_OVER_TWO-Math.abs(i))>a.EPSILON8){let u=w(e,t,n.latitude),f=o*Math.cos(i),M=u+f;if(s=H(M,e,t),Math.abs(i)<a.EPSILON10)h=a.negativePiToPi(n.longitude);else{let _=O(e,n.latitude),E=O(e,s);d=Math.tan(i)*(E-_),h=a.negativePiToPi(n.longitude+d)}}else{s=n.latitude;let u;if(e===0)u=t*Math.cos(n.latitude);else{let f=Math.sin(n.latitude);u=t*Math.cos(n.latitude)/Math.sqrt(1-r*f*f)}d=o/u,i>0?h=a.negativePiToPi(n.longitude+d):h=a.negativePiToPi(n.longitude-d)}return l(c)?(c.longitude=h,c.latitude=s,c.height=0,c):new P(h,s,0)}function m(n,i,o){let t=o??T.default;this._ellipsoid=t,this._start=new P,this._end=new P,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(n)&&l(i)&&y(this,n,i,t)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return g.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return g.defined("distance",this._distance),this._heading}}});m.fromStartHeadingDistance=function(n,i,o,t,e){g.defined("start",n),g.defined("heading",i),g.defined("distance",o),g.typeOf.number.greaterThan("distance",o,0);let c=t??T.default,r=c.maximumRadius,h=c.minimumRadius,s=r*r,d=h*h,u=Math.sqrt((s-d)/s);i=a.negativePiToPi(i);let f=D(n,i,o,c.maximumRadius,u);return!l(e)||l(t)&&!t.equals(e.ellipsoid)?new m(n,f,c):(e.setEndPoints(n,f),e)};m.prototype.setEndPoints=function(n,i){g.defined("start",n),g.defined("end",i),y(this,n,i,this._ellipsoid)};m.prototype.interpolateUsingFraction=function(n,i){return this.interpolateUsingSurfaceDistance(n*this._distance,i)};m.prototype.interpolateUsingSurfaceDistance=function(n,i){if(g.typeOf.number("distance",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");return D(this._start,this._heading,n,this._ellipsoid.maximumRadius,this._ellipticity,i)};m.prototype.findIntersectionWithLongitude=function(n,i){if(g.typeOf.number("intersectionLongitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=Math.abs(t),c=this._start;if(n=a.negativePiToPi(n),a.equalsEpsilon(Math.abs(n),Math.PI,a.EPSILON14)&&(n=a.sign(c.longitude)*Math.PI),l(i)||(i=new P),Math.abs(a.PI_OVER_TWO-e)<=a.EPSILON8)return i.longitude=n,i.latitude=c.latitude,i.height=0,i;if(a.equalsEpsilon(Math.abs(a.PI_OVER_TWO-e),a.PI_OVER_TWO,a.EPSILON8))return a.equalsEpsilon(n,c.longitude,a.EPSILON12)?void 0:(i.longitude=n,i.latitude=a.PI_OVER_TWO*a.sign(a.PI_OVER_TWO-t),i.height=0,i);let r=c.latitude,h=o*Math.sin(r),s=Math.tan(.5*(a.PI_OVER_TWO+r))*Math.exp((n-c.longitude)/Math.tan(t)),d=(1+h)/(1-h),u=c.latitude,f;do{f=u;let M=o*Math.sin(f),_=(1+M)/(1-M);u=2*Math.atan(s*Math.pow(_/d,o/2))-a.PI_OVER_TWO}while(!a.equalsEpsilon(u,f,a.EPSILON12));return i.longitude=n,i.latitude=u,i.height=0,i};m.prototype.findIntersectionWithLatitude=function(n,i){if(g.typeOf.number("intersectionLatitude",n),!l(this._distance)||this._distance===0)throw new I("EllipsoidRhumbLine must have distinct start and end set.");let o=this._ellipticity,t=this._heading,e=this._start;if(a.equalsEpsilon(Math.abs(t),a.PI_OVER_TWO,a.EPSILON8))return;let c=O(o,e.latitude),r=O(o,n),h=Math.tan(t)*(r-c),s=a.negativePiToPi(e.longitude+h);return l(i)?(i.longitude=s,i.latitude=n,i.height=0,i):new P(s,n,0)};var Y=m;export{Y as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-J3L5WX3X.js b/plugins/feature/map/Cesium/Workers/chunk-ILBQ77ZM.js similarity index 90% rename from plugins/feature/map/Cesium/Workers/chunk-J3L5WX3X.js rename to plugins/feature/map/Cesium/Workers/chunk-ILBQ77ZM.js index cc9768581..178ce1b33 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-J3L5WX3X.js +++ b/plugins/feature/map/Cesium/Workers/chunk-ILBQ77ZM.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{f as e}from"./chunk-FGKVHLJ4.js";function r(t){t=t??e.EMPTY_OBJECT,this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}var n=r;export{n as a}; +import{c as e}from"./chunk-OSVSBQDY.js";function r(t){t=t??e.EMPTY_OBJECT,this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}var n=r;export{n as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ITJR6PVW.js b/plugins/feature/map/Cesium/Workers/chunk-ITJR6PVW.js deleted file mode 100644 index 81363da49..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-ITJR6PVW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as b}from"./chunk-4W2MZV6I.js";import{a as u}from"./chunk-S3L7VZFL.js";import{a as O}from"./chunk-J3L5WX3X.js";import{b as w,c as h,d as y}from"./chunk-AVPLM4UI.js";import{d as l}from"./chunk-ZYYZDBKK.js";import{a as p}from"./chunk-WER4LUMF.js";import{a as i,f as A}from"./chunk-FGKVHLJ4.js";import{a as d,b as c}from"./chunk-ELJAHN3H.js";import{e as x}from"./chunk-3BGP4HCL.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(6*4*3),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(6*2*3),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(8*3),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(6*2*3),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-J6775DYR.js b/plugins/feature/map/Cesium/Workers/chunk-J6775DYR.js new file mode 100644 index 000000000..bdb286868 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-J6775DYR.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as wt}from"./chunk-GNBKSQYP.js";import{a as C}from"./chunk-FZSSAWMQ.js";import{a as kt}from"./chunk-AZINMULF.js";import{a as Ct}from"./chunk-ILBQ77ZM.js";import{b as dt,c as _t,d as N}from"./chunk-7RNSURKI.js";import{c as ht}from"./chunk-THB3EPLO.js";import{a as M}from"./chunk-WCOEOHX5.js";import{b as lt,c as it}from"./chunk-KP72RGCH.js";import{a as s,c as pt}from"./chunk-OSVSBQDY.js";import{a as E}from"./chunk-LZC73BOP.js";import{a as g}from"./chunk-OU2IPMYE.js";import{f as v}from"./chunk-H7SJWKIY.js";var yt=new s,vt=new s,Et=new s,Mt=new s,Nt=new s,Rt=new s(1,1,1),Pt=Math.cos,At=Math.sin;function x(n){n=n??pt.EMPTY_OBJECT;let m=n.radii??Rt,i=n.innerRadii??m,w=n.minimumClock??0,O=n.maximumClock??E.TWO_PI,P=n.minimumCone??0,A=n.maximumCone??E.PI,a=Math.round(n.stackPartitions??64),u=Math.round(n.slicePartitions??64),p=n.vertexFormat??C.DEFAULT;if(u<3)throw new g("options.slicePartitions cannot be less than three.");if(a<3)throw new g("options.stackPartitions cannot be less than three.");this._radii=s.clone(m),this._innerRadii=s.clone(i),this._minimumClock=w,this._maximumClock=O,this._minimumCone=P,this._maximumCone=A,this._stackPartitions=a,this._slicePartitions=u,this._vertexFormat=C.clone(p),this._offsetAttribute=n.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*s.packedLength+C.packedLength+7;x.pack=function(n,m,i){if(!v(n))throw new g("value is required");if(!v(m))throw new g("array is required");return i=i??0,s.pack(n._radii,m,i),i+=s.packedLength,s.pack(n._innerRadii,m,i),i+=s.packedLength,C.pack(n._vertexFormat,m,i),i+=C.packedLength,m[i++]=n._minimumClock,m[i++]=n._maximumClock,m[i++]=n._minimumCone,m[i++]=n._maximumCone,m[i++]=n._stackPartitions,m[i++]=n._slicePartitions,m[i]=n._offsetAttribute??-1,m};var bt=new s,xt=new s,Ot=new C,L={radii:bt,innerRadii:xt,vertexFormat:Ot,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};x.unpack=function(n,m,i){if(!v(n))throw new g("array is required");m=m??0;let w=s.unpack(n,m,bt);m+=s.packedLength;let O=s.unpack(n,m,xt);m+=s.packedLength;let P=C.unpack(n,m,Ot);m+=C.packedLength;let A=n[m++],a=n[m++],u=n[m++],p=n[m++],t=n[m++],o=n[m++],e=n[m];return v(i)?(i._radii=s.clone(w,i._radii),i._innerRadii=s.clone(O,i._innerRadii),i._vertexFormat=C.clone(P,i._vertexFormat),i._minimumClock=A,i._maximumClock=a,i._minimumCone=u,i._maximumCone=p,i._stackPartitions=t,i._slicePartitions=o,i._offsetAttribute=e===-1?void 0:e,i):(L.minimumClock=A,L.maximumClock=a,L.minimumCone=u,L.maximumCone=p,L.stackPartitions=t,L.slicePartitions=o,L.offsetAttribute=e===-1?void 0:e,new x(L))};x.createGeometry=function(n){let m=n._radii;if(m.x<=0||m.y<=0||m.z<=0)return;let i=n._innerRadii;if(i.x<=0||i.y<=0||i.z<=0)return;let w=n._minimumClock,O=n._maximumClock,P=n._minimumCone,A=n._maximumCone,a=n._vertexFormat,u=n._slicePartitions+1,p=n._stackPartitions+1;u=Math.round(u*Math.abs(O-w)/E.TWO_PI),p=Math.round(p*Math.abs(A-P)/E.PI),u<2&&(u=2),p<2&&(p=2);let t,o,e=0,z=[P],D=[w];for(t=0;t<p;t++)z.push(P+t*(A-P)/(p-1));for(z.push(A),o=0;o<u;o++)D.push(w+o*(O-w)/(u-1));D.push(O);let f=z.length,c=D.length,S=0,U=1,q=i.x!==m.x||i.y!==m.y||i.z!==m.z,H=!1,mt=!1,rt=!1;q&&(U=2,P>0&&(H=!0,S+=u-1),A<Math.PI&&(mt=!0,S+=u-1),(O-w)%E.TWO_PI?(rt=!0,S+=(p-1)*2+1):S+=1);let k=c*f*U,b=new Float64Array(k*3),J=new Array(k).fill(!1),ct=new Array(k).fill(!1),st=u*p*U,Tt=6*(st+S+1-(u+p)*U),r=kt.createTypedArray(st,Tt),V=a.normal?new Float32Array(k*3):void 0,Y=a.tangent?new Float32Array(k*3):void 0,j=a.bitangent?new Float32Array(k*3):void 0,X=a.st?new Float32Array(k*2):void 0,B=new Array(f),Z=new Array(f);for(t=0;t<f;t++)B[t]=At(z[t]),Z[t]=Pt(z[t]);let G=new Array(c),K=new Array(c);for(o=0;o<c;o++)K[o]=Pt(D[o]),G[o]=At(D[o]);for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=m.x*B[t]*K[o],b[e++]=m.y*B[t]*G[o],b[e++]=m.z*Z[t];let Q=k/2;if(q)for(t=0;t<f;t++)for(o=0;o<c;o++)b[e++]=i.x*B[t]*K[o],b[e++]=i.y*B[t]*G[o],b[e++]=i.z*Z[t],J[Q]=!0,t>0&&t!==f-1&&o!==0&&o!==c-1&&(ct[Q]=!0),Q++;e=0;let T,F;for(t=1;t<f-2;t++)for(T=t*c,F=(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=F+o+1,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=T+o;if(q){let R=f*c;for(t=1;t<f-2;t++)for(T=R+t*c,F=R+(t+1)*c,o=1;o<c-2;o++)r[e++]=F+o,r[e++]=T+o,r[e++]=T+o+1,r[e++]=F+o,r[e++]=T+o+1,r[e++]=F+o+1}let h,l;if(q){if(H)for(l=f*c,t=1;t<c-2;t++)r[e++]=t,r[e++]=t+1,r[e++]=l+t+1,r[e++]=t,r[e++]=l+t+1,r[e++]=l+t;if(mt)for(h=f*c-c,l=f*c*U-c,t=1;t<c-2;t++)r[e++]=h+t+1,r[e++]=h+t,r[e++]=l+t,r[e++]=h+t+1,r[e++]=l+t,r[e++]=l+t+1}if(rt){for(t=1;t<f-2;t++)l=c*f+c*t,h=c*t,r[e++]=l,r[e++]=h+c,r[e++]=h,r[e++]=l,r[e++]=l+c,r[e++]=h+c;for(t=1;t<f-2;t++)l=c*f+c*(t+1)-1,h=c*(t+1)-1,r[e++]=h+c,r[e++]=l,r[e++]=h,r[e++]=h+c,r[e++]=l+c,r[e++]=l}let y=new Ct;a.position&&(y.position=new N({componentDatatype:M.DOUBLE,componentsPerAttribute:3,values:b}));let at=0,$=0,I=0,tt=0,Ft=k/2,ft,ut=it.fromCartesian3(m),Lt=it.fromCartesian3(i);if(a.st||a.normal||a.tangent||a.bitangent){for(t=0;t<k;t++){ft=J[t]?Lt:ut;let R=s.fromArray(b,t*3,yt),_=ft.geodeticSurfaceNormal(R,vt);if(ct[t]&&s.negate(_,_),a.st){let d=lt.negate(_,Nt);X[at++]=Math.atan2(d.y,d.x)/E.TWO_PI+.5,X[at++]=Math.asin(_.z)/Math.PI+.5}if(a.normal&&(V[$++]=_.x,V[$++]=_.y,V[$++]=_.z),a.tangent||a.bitangent){let d=Et,nt=0,et;if(J[t]&&(nt=Ft),!H&&t>=nt&&t<nt+c*2?et=s.UNIT_X:et=s.UNIT_Z,s.cross(et,_,d),s.normalize(d,d),a.tangent&&(Y[I++]=d.x,Y[I++]=d.y,Y[I++]=d.z),a.bitangent){let W=s.cross(_,d,Mt);s.normalize(W,W),j[tt++]=W.x,j[tt++]=W.y,j[tt++]=W.z}}}a.st&&(y.st=new N({componentDatatype:M.FLOAT,componentsPerAttribute:2,values:X})),a.normal&&(y.normal=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:V})),a.tangent&&(y.tangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:Y})),a.bitangent&&(y.bitangent=new N({componentDatatype:M.FLOAT,componentsPerAttribute:3,values:j}))}if(v(n._offsetAttribute)){let R=b.length,_=n._offsetAttribute===wt.NONE?0:1,d=new Uint8Array(R/3).fill(_);y.applyOffset=new N({componentDatatype:M.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new _t({attributes:y,indices:r,primitiveType:dt.TRIANGLES,boundingSphere:ht.fromEllipsoid(ut),offsetAttribute:n._offsetAttribute})};var ot;x.getUnitEllipsoid=function(){return v(ot)||(ot=x.createGeometry(new x({radii:new s(1,1,1),vertexFormat:C.POSITION_ONLY}))),ot};var Kt=x;export{Kt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-U3N6LNE4.js b/plugins/feature/map/Cesium/Workers/chunk-JJVL7F22.js similarity index 88% rename from plugins/feature/map/Cesium/Workers/chunk-U3N6LNE4.js rename to plugins/feature/map/Cesium/Workers/chunk-JJVL7F22.js index f27537619..479523579 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-U3N6LNE4.js +++ b/plugins/feature/map/Cesium/Workers/chunk-JJVL7F22.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,6 +23,6 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{e as f}from"./chunk-3BGP4HCL.js";function c(t){let n,a=t.name,e=t.message;f(a)&&f(e)?n=`${a}: ${e}`:n=t.toString();let o=t.stack;return f(o)&&(n+=` +import{f}from"./chunk-H7SJWKIY.js";function c(t){let n,a=t.name,e=t.message;f(a)&&f(e)?n=`${a}: ${e}`:n=t.toString();let o=t.stack;return f(o)&&(n+=` ${o}`),n}var i=c;function l(t){async function n({data:e}){let o=[],s={id:e.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=e.baseUrl;try{let r=await t(e.parameters,o);s.result=r}catch(r){r instanceof Error?s.error={name:r.name,message:r.message,stack:r.stack}:s.error=r}e.canTransferArrayBuffer||(o.length=0);try{postMessage(s,o)}catch(r){s.result=void 0,s.error=`postMessage failed with error: ${i(r)} with responseMessage: ${JSON.stringify(s)}`,postMessage(s)}}function a(e){postMessage({id:e.data?.id,error:`postMessage failed with error: ${JSON.stringify(e)}`})}return self.onmessage=n,self.onmessageerror=a,self}var d=l;export{d as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-JMWI6IHX.js b/plugins/feature/map/Cesium/Workers/chunk-JMWI6IHX.js new file mode 100644 index 000000000..4254281ec --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-JMWI6IHX.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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 r,u=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&u.decode();var a=null;function h(){return(a===null||a.byteLength===0)&&(a=new Uint8Array(r.memory.buffer)),a}function b(e,t){return e=e>>>0,u.decode(h().subarray(e,e+t))}var o=null;function g(){return(o===null||o.byteLength===0)&&(o=new Uint32Array(r.memory.buffer)),o}function m(e,t){return e=e>>>0,g().subarray(e/4,e/4+t)}var y=0;function x(e,t){let n=t(e.length*4,4)>>>0;return g().set(e,n/4),y=e.length,n}function c(e){let t=r.__wbindgen_export_0.get(e);return r.__externref_table_dealloc(e),t}function U(e,t,n,i,_){let s=r.generate_splat_texture(e,t,n,i,_);if(s[2])throw c(s[1]);return f.__wrap(s[0])}function M(e,t,n){let i=r.radix_sort_gaussians_indexes(e,t,n);if(i[2])throw c(i[1]);return c(i[0])}var w=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_texturedata_free(e>>>0,1)),f=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,w.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,w.unregister(this),t}free(){let t=this.__destroy_into_raw();r.__wbg_texturedata_free(t,0)}get data(){let t=r.texturedata_data(this.__wbg_ptr);var n=m(t[0],t[1]).slice();return r.__wbindgen_free(t[0],t[1]*4,4),n}get width(){return r.texturedata_width(this.__wbg_ptr)>>>0}get height(){return r.texturedata_height(this.__wbg_ptr)>>>0}static new(t,n,i){let _=x(t,r.__wbindgen_malloc),s=y,p=r.texturedata_new(_,s,n,i);return e.__wrap(p)}};async function A(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(i){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function d(){let e={};return e.wbg={},e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return t.buffer},e.wbg.__wbg_length_3b4f022188ae8db6=function(t){return t.length},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return t.length},e.wbg.__wbg_new_780abee5c1739fd7=function(t){return new Float32Array(t)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){return new Uint8Array(t)},e.wbg.__wbg_new_e3b321dcfef89fc7=function(t){return new Uint32Array(t)},e.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(t,n,i){return new Uint32Array(t,n>>>0,i>>>0)},e.wbg.__wbg_set_10bad9bee0e9c58b=function(t,n,i){t.set(n,i>>>0)},e.wbg.__wbg_set_65595bdd868b3009=function(t,n,i){t.set(n,i>>>0)},e.wbg.__wbindgen_init_externref_table=function(){let t=r.__wbindgen_export_0,n=t.grow(4);t.set(0,void 0),t.set(n+0,void 0),t.set(n+1,null),t.set(n+2,!0),t.set(n+3,!1)},e.wbg.__wbindgen_memory=function(){return r.memory},e.wbg.__wbindgen_string_new=function(t,n){return b(t,n)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(b(t,n))},e}function l(e,t){return r=e.exports,W.__wbindgen_wasm_module=t,o=null,a=null,r.__wbindgen_start(),r}function O(e){if(r!==void 0)return r;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=d();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return l(n,e)}async function W(e){if(r!==void 0)return r;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("wasm_splats_bg.wasm",import.meta.url));let t=d();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:i}=await A(await e,t);return l(n,i)}export{U as a,M as b,O as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-KP72RGCH.js b/plugins/feature/map/Cesium/Workers/chunk-KP72RGCH.js new file mode 100644 index 000000000..53a612005 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-KP72RGCH.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a}from"./chunk-OSVSBQDY.js";import{a as d}from"./chunk-LZC73BOP.js";import{a as g,b as r}from"./chunk-OU2IPMYE.js";import{e as W,f as u}from"./chunk-H7SJWKIY.js";var ve=new a,_e=new a;function Fe(i,t,e,n,o){if(!u(i))throw new g("cartesian is required.");if(!u(t))throw new g("oneOverRadii is required.");if(!u(e))throw new g("oneOverRadiiSquared is required.");if(!u(n))throw new g("centerToleranceSquared is required.");let s=i.x,c=i.y,m=i.z,p=t.x,A=t.y,j=t.z,w=s*s*p*p,q=c*c*A*A,T=m*m*j*j,N=w+q+T,C=Math.sqrt(1/N),E=a.multiplyByScalar(i,C,ve);if(N<n)return isFinite(C)?a.clone(E,o):void 0;let H=e.x,J=e.y,K=e.z,I=_e;I.x=E.x*H*2,I.y=E.y*J*2,I.z=E.z*K*2;let B=(1-C)*a.magnitude(i)/(.5*a.magnitude(I)),fe=0,ee,le,v,_,F,te,ne,ie,me,pe,ye;do{B-=fe,v=1/(1+B*H),_=1/(1+B*J),F=1/(1+B*K),te=v*v,ne=_*_,ie=F*F,me=te*v,pe=ne*_,ye=ie*F,ee=w*te+q*ne+T*ie-1,le=w*me*H+q*pe*J+T*ye*K;let Ce=-2*le;fe=ee/Ce}while(Math.abs(ee)>d.EPSILON12);return u(o)?(o.x=s*v,o.y=c*_,o.z=m*F,o):new a(s*v,c*_,m*F)}var U=Fe;var h=class h{constructor(t,e,n){this.longitude=t??0,this.latitude=e??0,this.height=n??0}static fromRadians(t,e,n,o){return r.typeOf.number("longitude",t),r.typeOf.number("latitude",e),n=n??0,u(o)?(o.longitude=t,o.latitude=e,o.height=n,o):new h(t,e,n)}static fromDegrees(t,e,n,o){return r.typeOf.number("longitude",t),r.typeOf.number("latitude",e),t=d.toRadians(t),e=d.toRadians(e),h.fromRadians(t,e,n,o)}static fromCartesian(t,e,n){let o=u(e)?e.oneOverRadii:h._ellipsoidOneOverRadii,s=u(e)?e.oneOverRadiiSquared:h._ellipsoidOneOverRadiiSquared,c=u(e)?e._centerToleranceSquared:h._ellipsoidCenterToleranceSquared,m=U(t,o,s,c,Ne);if(!u(m))return;let p=a.multiplyComponents(m,s,Me);p=a.normalize(p,p);let A=a.subtract(t,m,ze),j=Math.atan2(p.y,p.x),w=Math.asin(p.z),q=d.sign(a.dot(A,t))*a.magnitude(A);return u(n)?(n.longitude=j,n.latitude=w,n.height=q,n):new h(j,w,q)}static toCartesian(t,e,n){return r.defined("cartographic",t),a.fromRadians(t.longitude,t.latitude,t.height,e,n)}static clone(t,e){if(u(t))return u(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new h(t.longitude,t.latitude,t.height)}static equals(t,e){return t===e||u(t)&&u(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height}static equalsEpsilon(t,e,n){return n=n??0,t===e||u(t)&&u(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n}clone(t){return h.clone(this,t)}equals(t){return h.equals(this,t)}equalsEpsilon(t,e){return h.equalsEpsilon(this,t,e)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};W(h,"_ellipsoidOneOverRadii",new a(1/6378137,1/6378137,1/6356752314245179e-9)),W(h,"_ellipsoidOneOverRadiiSquared",new a(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),W(h,"_ellipsoidCenterToleranceSquared",d.EPSILON1);var z=h;z.ZERO=Object.freeze(new z(0,0,0));var Me=new a,Ne=new a,ze=new a,P=z;var f=class i{constructor(t,e){this.x=t??0,this.y=e??0}static fromElements(t,e,n){return u(n)?(n.x=t,n.y=e,n):new i(t,e)}static clone(t,e){if(u(t))return u(e)?(e.x=t.x,e.y=t.y,e):new i(t.x,t.y)}static pack(t,e,n){return r.typeOf.object("value",t),r.defined("array",e),n=n??0,e[n++]=t.x,e[n]=t.y,e}static unpack(t,e,n){return r.defined("array",t),e=e??0,u(n)||(n=new i),n.x=t[e++],n.y=t[e],n}static packArray(t,e){r.defined("array",t);let n=t.length,o=n*2;if(!u(e))e=new Array(o);else{if(!Array.isArray(e)&&e.length!==o)throw new g("If result is a typed array, it must have exactly array.length * 2 elements");e.length!==o&&(e.length=o)}for(let s=0;s<n;++s)i.pack(t[s],e,s*2);return e}static unpackArray(t,e){if(r.defined("array",t),r.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new g("array length must be a multiple of 2.");let n=t.length;u(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){let s=o/2;e[s]=i.unpack(t,o,e[s])}return e}static maximumComponent(t){return r.typeOf.object("cartesian",t),Math.max(t.x,t.y)}static minimumComponent(t){return r.typeOf.object("cartesian",t),Math.min(t.x,t.y)}static minimumByComponent(t,e,n){return r.typeOf.object("first",t),r.typeOf.object("second",e),r.typeOf.object("result",n),n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n}static maximumByComponent(t,e,n){return r.typeOf.object("first",t),r.typeOf.object("second",e),r.typeOf.object("result",n),n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n}static clamp(t,e,n,o){r.typeOf.object("value",t),r.typeOf.object("min",e),r.typeOf.object("max",n),r.typeOf.object("result",o);let s=d.clamp(t.x,e.x,n.x),c=d.clamp(t.y,e.y,n.y);return o.x=s,o.y=c,o}static magnitudeSquared(t){return r.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(i.magnitudeSquared(t))}static distance(t,e){return r.typeOf.object("left",t),r.typeOf.object("right",e),i.subtract(t,e,V),i.magnitude(V)}static distanceSquared(t,e){return r.typeOf.object("left",t),r.typeOf.object("right",e),i.subtract(t,e,V),i.magnitudeSquared(V)}static normalize(t,e){r.typeOf.object("cartesian",t),r.typeOf.object("result",e);let n=i.magnitude(t);if(e.x=t.x/n,e.y=t.y/n,isNaN(e.x)||isNaN(e.y))throw new g("normalized result is not a number");return e}static dot(t,e){return r.typeOf.object("left",t),r.typeOf.object("right",e),t.x*e.x+t.y*e.y}static cross(t,e){return r.typeOf.object("left",t),r.typeOf.object("right",e),t.x*e.y-t.y*e.x}static multiplyComponents(t,e,n){return r.typeOf.object("left",t),r.typeOf.object("right",e),r.typeOf.object("result",n),n.x=t.x*e.x,n.y=t.y*e.y,n}static divideComponents(t,e,n){return r.typeOf.object("left",t),r.typeOf.object("right",e),r.typeOf.object("result",n),n.x=t.x/e.x,n.y=t.y/e.y,n}static add(t,e,n){return r.typeOf.object("left",t),r.typeOf.object("right",e),r.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n}static subtract(t,e,n){return r.typeOf.object("left",t),r.typeOf.object("right",e),r.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n}static multiplyByScalar(t,e,n){return r.typeOf.object("cartesian",t),r.typeOf.number("scalar",e),r.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n}static divideByScalar(t,e,n){return r.typeOf.object("cartesian",t),r.typeOf.number("scalar",e),r.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n}static negate(t,e){return r.typeOf.object("cartesian",t),r.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e}static abs(t,e){return r.typeOf.object("cartesian",t),r.typeOf.object("result",e),e.x=Math.abs(t.x),e.y=Math.abs(t.y),e}static lerp(t,e,n,o){return r.typeOf.object("start",t),r.typeOf.object("end",e),r.typeOf.number("t",n),r.typeOf.object("result",o),i.multiplyByScalar(e,n,he),o=i.multiplyByScalar(t,1-n,o),i.add(he,o,o)}static angleBetween(t,e){return r.typeOf.object("left",t),r.typeOf.object("right",e),i.normalize(t,Oe),i.normalize(e,ge),d.acosClamped(i.dot(Oe,ge))}static mostOrthogonalAxis(t,e){r.typeOf.object("cartesian",t),r.typeOf.object("result",e);let n=i.normalize(t,Pe);return i.abs(n,n),n.x<=n.y?e=i.clone(i.UNIT_X,e):e=i.clone(i.UNIT_Y,e),e}static equals(t,e){return t===e||u(t)&&u(e)&&t.x===e.x&&t.y===e.y}static equalsArray(t,e,n){return t.x===e[n]&&t.y===e[n+1]}static equalsEpsilon(t,e,n,o){return t===e||u(t)&&u(e)&&d.equalsEpsilon(t.x,e.x,n,o)&&d.equalsEpsilon(t.y,e.y,n,o)}clone(t){return i.clone(this,t)}equals(t){return i.equals(this,t)}equalsEpsilon(t,e,n){return i.equalsEpsilon(this,t,e,n)}toString(){return`(${this.x}, ${this.y})`}};f.fromCartesian3=f.clone;f.fromCartesian4=f.clone;f.packedLength=2;f.fromArray=f.unpack;var V=new f,he=new f,Oe=new f,ge=new f,Pe=new f;f.ZERO=Object.freeze(new f(0,0));f.ONE=Object.freeze(new f(1,1));f.UNIT_X=Object.freeze(new f(1,0));f.UNIT_Y=Object.freeze(new f(0,1));var re=f;function be(i,t,e,n){t=t??0,e=e??0,n=n??0,r.typeOf.number.greaterThanOrEquals("x",t,0),r.typeOf.number.greaterThanOrEquals("y",e,0),r.typeOf.number.greaterThanOrEquals("z",n,0),i._radii=new a(t,e,n),i._radiiSquared=new a(t*t,e*e,n*n),i._radiiToTheFourth=new a(t*t*t*t,e*e*e*e,n*n*n*n),i._oneOverRadii=new a(t===0?0:1/t,e===0?0:1/e,n===0?0:1/n),i._oneOverRadiiSquared=new a(t===0?0:1/(t*t),e===0?0:1/(e*e),n===0?0:1/(n*n)),i._minimumRadius=Math.min(t,e,n),i._maximumRadius=Math.max(t,e,n),i._centerToleranceSquared=d.EPSILON1,i._radiiSquared.z!==0&&(i._squaredXOverSquaredZ=i._radiiSquared.x/i._radiiSquared.z)}var O=class i{constructor(t,e,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,be(this,t,e,n)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,e){if(!u(t))return;let n=t._radii;return u(e)?(a.clone(n,e._radii),a.clone(t._radiiSquared,e._radiiSquared),a.clone(t._radiiToTheFourth,e._radiiToTheFourth),a.clone(t._oneOverRadii,e._oneOverRadii),a.clone(t._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=t._minimumRadius,e._maximumRadius=t._maximumRadius,e._centerToleranceSquared=t._centerToleranceSquared,e):new i(n.x,n.y,n.z)}static fromCartesian3(t,e){return u(e)||(e=new i),u(t)&&be(e,t.x,t.y,t.z),e}static get default(){return i._default}static set default(t){r.typeOf.object("value",t),i._default=t,a._ellipsoidRadiiSquared=t.radiiSquared,P._ellipsoidOneOverRadii=t.oneOverRadii,P._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,P._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return i.clone(this,t)}static pack(t,e,n){return r.typeOf.object("value",t),r.defined("array",e),n=n??0,a.pack(t._radii,e,n),e}static unpack(t,e,n){r.defined("array",t),e=e??0;let o=a.unpack(t,e);return i.fromCartesian3(o,n)}geodeticSurfaceNormalCartographic(t,e){r.typeOf.object("cartographic",t);let n=t.longitude,o=t.latitude,s=Math.cos(o),c=s*Math.cos(n),m=s*Math.sin(n),p=Math.sin(o);return u(e)||(e=new a),e.x=c,e.y=m,e.z=p,a.normalize(e,e)}geodeticSurfaceNormal(t,e){if(r.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new g("cartesian has a NaN component");if(!a.equalsEpsilon(t,a.ZERO,d.EPSILON14))return u(e)||(e=new a),e=a.multiplyComponents(t,this._oneOverRadiiSquared,e),a.normalize(e,e)}cartographicToCartesian(t,e){let n=ke,o=Ie;this.geodeticSurfaceNormalCartographic(t,n),a.multiplyComponents(this._radiiSquared,n,o);let s=Math.sqrt(a.dot(n,o));return a.divideByScalar(o,s,o),a.multiplyByScalar(n,t.height,n),u(e)||(e=new a),a.add(o,n,e)}cartographicArrayToCartesianArray(t,e){r.defined("cartographics",t);let n=t.length;u(e)?e.length=n:e=new Array(n);for(let o=0;o<n;o++)e[o]=this.cartographicToCartesian(t[o],e[o]);return e}cartesianToCartographic(t,e){let n=this.scaleToGeodeticSurface(t,We);if(!u(n))return;let o=this.geodeticSurfaceNormal(n,Be),s=a.subtract(t,n,Ue),c=Math.atan2(o.y,o.x),m=Math.asin(o.z),p=d.sign(a.dot(s,t))*a.magnitude(s);return u(e)?(e.longitude=c,e.latitude=m,e.height=p,e):new P(c,m,p)}cartesianArrayToCartographicArray(t,e){r.defined("cartesians",t);let n=t.length;u(e)?e.length=n:e=new Array(n);for(let o=0;o<n;++o)e[o]=this.cartesianToCartographic(t[o],e[o]);return e}scaleToGeodeticSurface(t,e){return U(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)}scaleToGeocentricSurface(t,e){r.typeOf.object("cartesian",t),u(e)||(e=new a);let n=t.x,o=t.y,s=t.z,c=this._oneOverRadiiSquared,m=1/Math.sqrt(n*n*c.x+o*o*c.y+s*s*c.z);return a.multiplyByScalar(t,m,e)}transformPositionToScaledSpace(t,e){return u(e)||(e=new a),a.multiplyComponents(t,this._oneOverRadii,e)}transformPositionFromScaledSpace(t,e){return u(e)||(e=new a),a.multiplyComponents(t,this._radii,e)}equals(t){return this===t||u(t)&&a.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,e,n){if(r.typeOf.object("position",t),!d.equalsEpsilon(this._radii.x,this._radii.y,d.EPSILON15))throw new g("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");r.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),e=e??0;let o=this._squaredXOverSquaredZ;if(u(n)||(n=new a),n.x=0,n.y=0,n.z=t.z*(1-o),!(Math.abs(n.z)>=this._radii.z-e))return n}getLocalCurvature(t,e){r.typeOf.object("surfacePosition",t),u(e)||(e=new re);let n=this.getSurfaceNormalIntersectionWithZAxis(t,0,Ve),o=a.distance(t,n),s=this.minimumRadius*o/this.maximumRadius**2,c=o*s**2;return re.fromElements(1/o,1/c,e)}surfaceArea(t){r.typeOf.object("rectangle",t);let e=t.west,n=t.east,o=t.south,s=t.north;for(;n<e;)n+=d.TWO_PI;let c=this._radiiSquared,m=c.x,p=c.y,A=c.z,j=m*p;return xe(o,s,function(w){let q=Math.cos(w),T=Math.sin(w);return Math.cos(w)*xe(e,n,function(N){let C=Math.cos(N),E=Math.sin(N);return Math.sqrt(j*T*T+A*(p*C*C+m*E*E)*q*q)})})}};O.WGS84=Object.freeze(new O(6378137,6378137,6356752314245179e-9));O.UNIT_SPHERE=Object.freeze(new O(1,1,1));O.MOON=Object.freeze(new O(d.LUNAR_RADIUS,d.LUNAR_RADIUS,d.LUNAR_RADIUS));O.MARS=Object.freeze(new O(3396190,3396190,3376200));O._default=O.WGS84;O.packedLength=a.packedLength;O.prototype.geocentricSurfaceNormal=a.normalize;var ke=new a,Ie=new a,Be=new a,We=new a,Ue=new a,Ve=new a,Le=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],$e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function xe(i,t,e){r.typeOf.number("a",i),r.typeOf.number("b",t),r.typeOf.func("func",e);let n=.5*(t+i),o=.5*(t-i),s=0;for(let c=0;c<5;c++){let m=o*Le[c];s+=$e[c]*(e(n+m)+e(n-m))}return s*=o,s}var At=O;var R,l={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},b={};Object.defineProperties(b,{element:{get:function(){if(b.supportsFullscreen())return document[l.fullscreenElement]}},changeEventName:{get:function(){if(b.supportsFullscreen())return l.fullscreenchange}},errorEventName:{get:function(){if(b.supportsFullscreen())return l.fullscreenerror}},enabled:{get:function(){if(b.supportsFullscreen())return document[l.fullscreenEnabled]}},fullscreen:{get:function(){if(b.supportsFullscreen())return b.element!==null}}});b.supportsFullscreen=function(){if(u(R))return R;R=!1;let i=document.body;if(typeof i.requestFullscreen=="function")return l.requestFullscreen="requestFullscreen",l.exitFullscreen="exitFullscreen",l.fullscreenEnabled="fullscreenEnabled",l.fullscreenElement="fullscreenElement",l.fullscreenchange="fullscreenchange",l.fullscreenerror="fullscreenerror",R=!0,R;let t=["webkit","moz","o","ms","khtml"],e;for(let n=0,o=t.length;n<o;++n){let s=t[n];e=`${s}RequestFullscreen`,typeof i[e]=="function"?(l.requestFullscreen=e,R=!0):(e=`${s}RequestFullScreen`,typeof i[e]=="function"&&(l.requestFullscreen=e,R=!0)),e=`${s}ExitFullscreen`,typeof document[e]=="function"?l.exitFullscreen=e:(e=`${s}CancelFullScreen`,typeof document[e]=="function"&&(l.exitFullscreen=e)),e=`${s}FullscreenEnabled`,document[e]!==void 0?l.fullscreenEnabled=e:(e=`${s}FullScreenEnabled`,document[e]!==void 0&&(l.fullscreenEnabled=e)),e=`${s}FullscreenElement`,document[e]!==void 0?l.fullscreenElement=e:(e=`${s}FullScreenElement`,document[e]!==void 0&&(l.fullscreenElement=e)),e=`${s}fullscreenchange`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenChange"),l.fullscreenchange=e),e=`${s}fullscreenerror`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenError"),l.fullscreenerror=e)}return R};b.requestFullscreen=function(i,t){b.supportsFullscreen()&&i[l.requestFullscreen]({vrDisplay:t})};b.exitFullscreen=function(){b.supportsFullscreen()&&document[l.exitFullscreen]()};b._names=l;var Se=b;var x;typeof navigator<"u"?x=navigator:x={};function k(i){let t=i.split(".");for(let e=0,n=t.length;e<n;++e)t[e]=parseInt(t[e],10);return t}var L,we;function ce(){if(!u(L)&&(L=!1,!Y())){let i=/ Chrome\/([\.0-9]+)/.exec(x.userAgent);i!==null&&(L=!0,we=k(i[1]))}return L}function De(){return ce()&&we}var $,qe;function Re(){if(!u($)&&($=!1,!ce()&&!Y()&&/ Safari\/[\.0-9]+/.test(x.userAgent))){let i=/ Version\/([\.0-9]+)/.exec(x.userAgent);i!==null&&($=!0,qe=k(i[1]))}return $}function Ze(){return Re()&&qe}var D,se;function Ae(){if(!u(D)){D=!1;let i=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(x.userAgent);i!==null&&(D=!0,se=k(i[1]),se.isNightly=!!i[2])}return D}function Ge(){return Ae()&&se}var Z,je;function Y(){if(!u(Z)){Z=!1;let i=/ Edg\/([\.0-9]+)/.exec(x.userAgent);i!==null&&(Z=!0,je=k(i[1]))}return Z}function Xe(){return Y()&&je}var G,de;function Q(){if(!u(G)){G=!1;let i=/Firefox\/([\.0-9]+)/.exec(x.userAgent);i!==null&&(G=!0,de=k(i[1]))}return G}var oe;function Ye(){return u(oe)||(oe=/Windows/i.test(x.appVersion)),oe}var ae;function Qe(){return u(ae)||(ae=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),ae}function He(){return Q()&&de}var ue;function Je(){return u(ue)||(ue=!Q()&&typeof PointerEvent<"u"&&(!u(x.pointerEnabled)||x.pointerEnabled)),ue}var Ee,X;function Te(){if(!u(X)){let i=document.createElement("canvas");i.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=i.style.imageRendering;X=u(t)&&t!=="",X&&(Ee=t)}return X}function Ke(){return Te()?Ee:void 0}function y(){if(!y.initialized)throw new g("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return y._result}y._promise=void 0;y._result=void 0;y.initialize=function(){return u(y._promise)||(y._promise=new Promise(i=>{let t=new Image;t.onload=function(){y._result=t.width>0&&t.height>0,i(y._result)},t.onerror=function(){y._result=!1,i(y._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),y._promise};Object.defineProperties(y,{initialized:{get:function(){return u(y._result)}}});var M=[];typeof ArrayBuffer<"u"&&(M.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&M.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&M.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&M.push(BigInt64Array),typeof BigUint64Array<"u"&&M.push(BigUint64Array));var S={isChrome:ce,chromeVersion:De,isSafari:Re,safariVersion:Ze,isWebkit:Ae,webkitVersion:Ge,isEdge:Y,edgeVersion:Xe,isFirefox:Q,firefoxVersion:He,isWindows:Ye,isIPadOrIOS:Qe,hardwareConcurrency:x.hardwareConcurrency??3,supportsPointerEvents:Je,supportsImageRenderingPixelated:Te,supportsWebP:y,imageRenderingValue:Ke,typedArrayTypes:M};S.supportsBasis=function(i){return S.supportsWebAssembly()&&i.context.supportsBasis};S.supportsFullscreen=function(){return Se.supportsFullscreen()};S.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};S.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};S.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};S.supportsBigInt=function(){return typeof BigInt<"u"};S.supportsWebWorkers=function(){return typeof Worker<"u"};S.supportsWebAssembly=function(){return typeof WebAssembly<"u"};S.supportsWebgl2=function(i){return r.defined("scene",i),i.context.webgl2};S.supportsEsmWebWorkers=function(){return!Q()||parseInt(de)>=114};var Mt=S;export{P as a,re as b,At as c,Mt as d}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-L4JCTZ6Y.js b/plugins/feature/map/Cesium/Workers/chunk-L4JCTZ6Y.js deleted file mode 100644 index 0ce7e51e5..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-L4JCTZ6Y.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as u,b as c,d as p}from"./chunk-FGKVHLJ4.js";import{a as d}from"./chunk-YRCAQUFT.js";import{a as s}from"./chunk-ELJAHN3H.js";import{e as a}from"./chunk-3BGP4HCL.js";function e(t){this._ellipsoid=t??p.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(e.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});e.mercatorAngleToGeodeticLatitude=function(t){return d.PI_OVER_TWO-2*Math.atan(Math.exp(-t))};e.geodeticLatitudeToMercatorAngle=function(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let i=Math.sin(t);return .5*Math.log((1+i)/(1-i))};e.MaximumLatitude=e.mercatorAngleToGeodeticLatitude(Math.PI);e.prototype.project=function(t,i){let o=this._semimajorAxis,r=t.longitude*o,n=e.geodeticLatitudeToMercatorAngle(t.latitude)*o,m=t.height;return a(i)?(i.x=r,i.y=n,i.z=m,i):new u(r,n,m)};e.prototype.unproject=function(t,i){if(!a(t))throw new s("cartesian is required");let o=this._oneOverSemimajorAxis,r=t.x*o,n=e.mercatorAngleToGeodeticLatitude(t.y*o),m=t.z;return a(i)?(i.longitude=r,i.latitude=n,i.height=m,i):new c(r,n,m)};var A=e;export{A as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-LHXP7CH5.js b/plugins/feature/map/Cesium/Workers/chunk-LHXP7CH5.js new file mode 100644 index 000000000..51ae4fd5e --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-LHXP7CH5.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as _}from"./chunk-NCJU5VAQ.js";import{a as te}from"./chunk-C5UTI7P4.js";import{h as Z,i as fe}from"./chunk-YZ5ZCI55.js";import{a as ie,b as j}from"./chunk-HLXNFZAZ.js";import{a as se,b as ee}from"./chunk-KP72RGCH.js";import{a as e,b as O}from"./chunk-OSVSBQDY.js";import{a as Q}from"./chunk-LZC73BOP.js";import{a as le}from"./chunk-OU2IPMYE.js";import{f as $}from"./chunk-H7SJWKIY.js";var me={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(me);var G=me;var ue={};function P(r,n){if(!$(r))throw new le("identifier is required.");$(ue[r])||(ue[r]=!0,console.warn(n??r))}P.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.";P.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";P.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";P.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var he=P;var w=[new e,new e],Se=new e,Te=new e,Be=new e,Ce=new e,ze=new e,Ae=new e,be=new e,Oe=new e,ve=new e,I=new e,W=new e,R={},re=new se;function De(r,n){let a=new Array(r.length);for(let o=0;o<r.length;o++){let t=r[o];re=n.cartesianToCartographic(t,re),a[o]=re.height,r[o]=n.scaleToGeodeticSurface(t,t)}return a}function ne(r,n,a,o){let t=r[0],c=r[1],f=e.angleBetween(t,c),l=Math.ceil(f/o),m=new Array(l),s;if(n===a){for(s=0;s<l;s++)m[s]=n;return m.push(a),m}let d=(a-n)/l;for(s=1;s<l;s++){let x=n+s*d;m[s]=x}return m[0]=n,m.push(a),m}var X=new e,Y=new e;function je(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y),l=ee.angleBetween(c,f);return f.x*c.y-f.y*c.x>=0?-l:l}var He=new e(-1,0,0),H=new j,Me=new j,oe=new O,Ne=O.IDENTITY.clone(),Ve=new e,Fe=new ie,de=new e;function v(r,n,a,o,t,c,f,l){let m=Ve,s=Fe;H=fe.eastNorthUpToFixedFrame(r,t,H),m=j.multiplyByPointAsVector(H,He,m),m=e.normalize(m,m);let S=je(m,n,r,t);oe=O.fromRotationZ(S,oe),de.z=c,H=j.multiplyTransformation(H,j.fromRotationTranslation(oe,de,Me),H);let d=Ne;d[0]=f;for(let x=0;x<l;x++)for(let i=0;i<a.length;i+=3)s=e.fromArray(a,i,s),s=O.multiplyByVector(d,s,s),s=j.multiplyByPoint(H,s,s),o.push(s.x,s.y,s.z);return o}var Ge=new e;function ce(r,n,a,o,t,c,f){for(let l=0;l<r.length;l+=3){let m=e.fromArray(r,l,Ge);o=v(m,n,a,o,t,c[l/3],f,1)}return o}function Ie(r,n){let a=r.length,o=new Array(a*6),t=0,c=n.x+n.width/2,f=n.y+n.height/2,l=r[0];o[t++]=l.x-c,o[t++]=0,o[t++]=l.y-f;for(let m=1;m<a;m++){l=r[m];let s=l.x-c,S=l.y-f;o[t++]=s,o[t++]=0,o[t++]=S,o[t++]=s,o[t++]=0,o[t++]=S}return l=r[0],o[t++]=l.x-c,o[t++]=0,o[t]=l.y-f,o}function ge(r,n){let a=r.length,o=new Array(a*3),t=0,c=n.x+n.width/2,f=n.y+n.height/2;for(let l=0;l<a;l++)o[t++]=r[l].x-c,o[t++]=0,o[t++]=r[l].y-f;return o}var ye=new Z,we=new e,pe=new O;function xe(r,n,a,o,t,c,f,l,m,s){let S=e.angleBetween(e.subtract(n,r,I),e.subtract(a,r,W)),d=o===G.BEVELED?0:Math.ceil(S/Q.toRadians(5)),x;t?x=O.fromQuaternion(Z.fromAxisAngle(e.negate(r,I),S/(d+1),ye),pe):x=O.fromQuaternion(Z.fromAxisAngle(r,S/(d+1),ye),pe);let i,g;if(n=e.clone(n,we),d>0){let D=s?2:1;for(let y=0;y<d;y++)n=O.multiplyByVector(x,n,n),i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,D)}else i=e.subtract(n,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(n,W),f=v(g,i,l,f,c,m,1,1),a=e.clone(a,we),i=e.subtract(a,r,I),i=e.normalize(i,i),t||(i=e.negate(i,i)),g=c.scaleToGeodeticSurface(a,W),f=v(g,i,l,f,c,m,1,1);return f}R.removeDuplicatesFromShape=function(r){let n=r.length,a=[];for(let o=n-1,t=0;t<n;o=t++){let c=r[o],f=r[t];ee.equals(c,f)||a.push(f)}return a};R.angleIsGreaterThanPi=function(r,n,a,o){let t=new te(a,o),c=t.projectPointOntoPlane(e.add(a,r,X),X),f=t.projectPointOntoPlane(e.add(a,n,Y),Y);return f.x*c.y-f.y*c.x>=0};var Le=new e,qe=new e;R.computePositions=function(r,n,a,o,t){let c=o._ellipsoid,f=De(r,c),l=o._granularity,m=o._cornerType,s=t?Ie(n,a):ge(n,a),S=t?ge(n,a):void 0,d=a.height/2,x=a.width/2,i=r.length,g=[],D=t?[]:void 0,y=Se,b=Te,h=Be,E=Ce,B=ze,C=Ae,z=be,u=Oe,T=ve,p=r[0],M=r[1];E=c.geodeticSurfaceNormal(p,E),y=e.subtract(M,p,y),y=e.normalize(y,y),u=e.cross(E,y,u),u=e.normalize(u,u);let N=f[0],A=f[1];t&&(D=v(p,u,S,D,c,N+d,1,1)),T=e.clone(p,T),p=M,b=e.negate(y,b);let V,F;for(let U=1;U<i-1;U++){let ae=t?2:1;if(M=r[U+1],p.equals(M)){he("Positions are too close and are considered equivalent with rounding error.");continue}y=e.subtract(M,p,y),y=e.normalize(y,y),E=c.geodeticSurfaceNormal(p,E);let L=e.multiplyByScalar(E,e.dot(y,E),Le);e.subtract(y,L,L),e.normalize(L,L);let q=e.multiplyByScalar(E,e.dot(b,E),qe);if(e.subtract(b,q,q),e.normalize(q,q),!Q.equalsEpsilon(Math.abs(e.dot(L,q)),1,Q.EPSILON7)){h=e.add(y,b,h),h=e.normalize(h,h),h=e.cross(h,E,h),h=e.cross(E,h,h),h=e.normalize(h,h);let k=1/Math.max(.25,e.magnitude(e.cross(h,b,I))),K=R.angleIsGreaterThanPi(y,b,p,c);K?(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):(h=e.negate(h,h),g=v(p,h,s,g,c,A+d,k,ae)),T=e.clone(z,T)):(B=e.add(p,e.multiplyByScalar(h,k*x,h),B),C=e.add(B,e.multiplyByScalar(u,-x,C),C),w[0]=e.clone(T,w[0]),w[1]=e.clone(C,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),u=e.cross(E,y,u),u=e.normalize(u,u),z=e.add(B,e.multiplyByScalar(u,-x,z),z),m===G.ROUNDED||m===G.BEVELED?xe(B,C,z,m,K,c,g,s,A+d,t):g=v(p,h,s,g,c,A+d,k,ae),T=e.clone(z,T)),b=e.negate(y,b)}else g=v(T,u,s,g,c,N+d,1,1),T=p;N=A,A=f[U+1],p=M}w[0]=e.clone(T,w[0]),w[1]=e.clone(p,w[1]),V=ne(w,N+d,A+d,l),F=_.generateArc({positions:w,granularity:l,ellipsoid:c}),g=ce(F,u,s,g,c,V,1),t&&(D=v(p,u,S,D,c,A+d,1,1)),i=g.length;let Ee=t?i+D.length:i,J=new Float64Array(Ee);return J.set(g),t&&J.set(D,i),J};var ct=R;export{G as a,he as b,ct as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-LUT6AMUC.js b/plugins/feature/map/Cesium/Workers/chunk-LUT6AMUC.js deleted file mode 100644 index 70991217b..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-LUT6AMUC.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as J}from"./chunk-RQKZTHAV.js";import{a as I}from"./chunk-ASLWXOD7.js";import{b as B,c as G,d as k}from"./chunk-ZYYZDBKK.js";import{b as j,h as X}from"./chunk-3PT5NNSP.js";import{a as t,b as S,c as z,d as F,e as d}from"./chunk-FGKVHLJ4.js";import{a as g}from"./chunk-YRCAQUFT.js";import{a as b,b as W}from"./chunk-ELJAHN3H.js";import{e as p}from"./chunk-3BGP4HCL.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-IFR5HKVH.js b/plugins/feature/map/Cesium/Workers/chunk-LXGG3JDP.js similarity index 87% rename from plugins/feature/map/Cesium/Workers/chunk-IFR5HKVH.js rename to plugins/feature/map/Cesium/Workers/chunk-LXGG3JDP.js index 9de78a5f2..6f433b430 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-IFR5HKVH.js +++ b/plugins/feature/map/Cesium/Workers/chunk-LXGG3JDP.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var e={NONE:0,GEODESIC:1,RHUMB:2},t=Object.freeze(e);export{t as a}; +var e={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(e);var t=e;export{t as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-LZC73BOP.js b/plugins/feature/map/Cesium/Workers/chunk-LZC73BOP.js new file mode 100644 index 000000000..fb857b55e --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-LZC73BOP.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as n,b as u}from"./chunk-OU2IPMYE.js";import{c as b,d as A,f as s}from"./chunk-H7SJWKIY.js";var N=b((S,p)=>{var a=function(t){t==null&&(t=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,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};a.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};a.prototype.init_by_array=function(t,i){var e,o,h;for(this.init_seed(19650218),e=1,o=0,h=this.N>i?this.N:i;h;h--){var f=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((f&4294901760)>>>16)*1664525<<16)+(f&65535)*1664525)+t[o]+o,this.mt[e]>>>=0,e++,o++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),o>=i&&(o=0)}for(h=this.N-1;h;h--){var f=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((f&4294901760)>>>16)*1566083941<<16)+(f&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648};a.prototype.random_int=function(){var t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^i[t&1];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};a.prototype.random_int31=function(){return this.random_int()>>>1};a.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};a.prototype.random=function(){return this.random_int()*(1/4294967296)};a.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};a.prototype.random_long=function(){var t=this.random_int()>>>5,i=this.random_int()>>>6;return(t*67108864+i)*(1/9007199254740992)};p.exports=a});var d=A(N(),1);var r={};r.EPSILON1=.1;r.EPSILON2=.01;r.EPSILON3=.001;r.EPSILON4=1e-4;r.EPSILON5=1e-5;r.EPSILON6=1e-6;r.EPSILON7=1e-7;r.EPSILON8=1e-8;r.EPSILON9=1e-9;r.EPSILON10=1e-10;r.EPSILON11=1e-11;r.EPSILON12=1e-12;r.EPSILON13=1e-13;r.EPSILON14=1e-14;r.EPSILON15=1e-15;r.EPSILON16=1e-16;r.EPSILON17=1e-17;r.EPSILON18=1e-18;r.EPSILON19=1e-19;r.EPSILON20=1e-20;r.EPSILON21=1e-21;r.GRAVITATIONALPARAMETER=3986004418e5;r.SOLAR_RADIUS=6955e5;r.LUNAR_RADIUS=1737400;r.SIXTY_FOUR_KILOBYTES=64*1024;r.FOUR_GIGABYTES=4*1024*1024*1024;r.sign=Math.sign??function(i){return i=+i,i===0||i!==i?i:i>0?1:-1};r.signNotZero=function(t){return t<0?-1:1};r.toSNorm=function(t,i){return i=i??255,Math.round((r.clamp(t,-1,1)*.5+.5)*i)};r.fromSNorm=function(t,i){return i=i??255,r.clamp(t,0,i)/i*2-1};r.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:r.clamp((t-i)/e,0,1)};r.sinh=Math.sinh??function(i){return(Math.exp(i)-Math.exp(-i))/2};r.cosh=Math.cosh??function(i){return(Math.exp(i)+Math.exp(-i))/2};r.lerp=function(t,i,e){return(1-e)*t+e*i};r.smoothDamp=function(t,i,e,o=0,h=Number.POSITIVE_INFINITY,f=1e-4,w={}){u.typeOf.number("p",t),u.typeOf.number("q",i),u.typeOf.number("velocity",e),u.typeOf.number.greaterThanOrEquals("deltaTime",o,0),u.typeOf.number.greaterThanOrEquals("maximumSpeed",h,0),u.typeOf.number.greaterThanOrEquals("smoothTime",f,1e-4),u.typeOf.object("result",w),f=Math.max(1e-4,f);let P=2/f,c=P*o,I=1/(1+c+.48*c*c+.235*c*c*c),E=h*f,m=t-i;m=r.clamp(m,-E,E);let R=t-m,_=(e+P*m)*o;return e=(e-P*_)*I,w.value=R+(m+_)*I,w.velocity=e,w};r.PI=Math.PI;r.ONE_OVER_PI=1/Math.PI;r.PI_OVER_TWO=Math.PI/2;r.PI_OVER_THREE=Math.PI/3;r.PI_OVER_FOUR=Math.PI/4;r.PI_OVER_SIX=Math.PI/6;r.THREE_PI_OVER_TWO=3*Math.PI/2;r.TWO_PI=2*Math.PI;r.ONE_OVER_TWO_PI=1/(2*Math.PI);r.RADIANS_PER_DEGREE=Math.PI/180;r.DEGREES_PER_RADIAN=180/Math.PI;r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600;r.toRadians=function(t){if(!s(t))throw new n("degrees is required.");return t*r.RADIANS_PER_DEGREE};r.toDegrees=function(t){if(!s(t))throw new n("radians is required.");return t*r.DEGREES_PER_RADIAN};r.convertLongitudeRange=function(t){if(!s(t))throw new n("angle is required.");let i=r.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e};r.clampToLatitudeRange=function(t){if(!s(t))throw new n("angle is required.");return r.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)};r.negativePiToPi=function(t){if(!s(t))throw new n("angle is required.");return t>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI};r.zeroToTwoPi=function(t){if(!s(t))throw new n("angle is required.");if(t>=0&&t<=r.TWO_PI)return t;let i=r.mod(t,r.TWO_PI);return Math.abs(i)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:i};r.mod=function(t,i){if(!s(t))throw new n("m is required.");if(!s(i))throw new n("n is required.");if(i===0)throw new n("divisor cannot be 0.");return r.sign(t)===r.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i};r.equalsEpsilon=function(t,i,e,o){if(!s(t))throw new n("left is required.");if(!s(i))throw new n("right is required.");e=e??0,o=o??e;let h=Math.abs(t-i);return h<=o||h<=e*Math.max(Math.abs(t),Math.abs(i))};r.lessThan=function(t,i,e){if(!s(t))throw new n("first is required.");if(!s(i))throw new n("second is required.");if(!s(e))throw new n("absoluteEpsilon is required.");return t-i<-e};r.lessThanOrEquals=function(t,i,e){if(!s(t))throw new n("first is required.");if(!s(i))throw new n("second is required.");if(!s(e))throw new n("absoluteEpsilon is required.");return t-i<e};r.greaterThan=function(t,i,e){if(!s(t))throw new n("first is required.");if(!s(i))throw new n("second is required.");if(!s(e))throw new n("absoluteEpsilon is required.");return t-i>e};r.greaterThanOrEquals=function(t,i,e){if(!s(t))throw new n("first is required.");if(!s(i))throw new n("second is required.");if(!s(e))throw new n("absoluteEpsilon is required.");return t-i>-e};var O=[1];r.factorial=function(t){if(typeof t!="number"||t<0)throw new n("A number greater than or equal to 0 is required.");let i=O.length;if(t>=i){let e=O[i-1];for(let o=i;o<=t;o++){let h=e*o;O.push(h),e=h}}return O[t]};r.incrementWrap=function(t,i,e){if(e=e??0,!s(t))throw new n("n is required.");if(i<=e)throw new n("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t};r.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0};r.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new n("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t};r.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t};r.clamp=function(t,i,e){return u.typeOf.number("value",t),u.typeOf.number("min",i),u.typeOf.number("max",e),t<i?i:t>e?e:t};var M=new d.default;r.setRandomNumberSeed=function(t){if(!s(t))throw new n("seed is required.");M=new d.default(t)};r.nextRandomNumber=function(){return M.random()};r.randomBetween=function(t,i){return r.nextRandomNumber()*(i-t)+t};r.acosClamped=function(t){if(!s(t))throw new n("value is required.");return Math.acos(r.clamp(t,-1,1))};r.asinClamped=function(t){if(!s(t))throw new n("value is required.");return Math.asin(r.clamp(t,-1,1))};r.chordLength=function(t,i){if(!s(t))throw new n("angle is required.");if(!s(i))throw new n("radius is required.");return 2*i*Math.sin(t*.5)};r.logBase=function(t,i){if(!s(t))throw new n("number is required.");if(!s(i))throw new n("base is required.");return Math.log(t)/Math.log(i)};r.cbrt=Math.cbrt??function(i){let e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e};r.log2=Math.log2??function(i){return Math.log(i)*Math.LOG2E};r.fog=function(t,i){let e=t*i;return 1-Math.exp(-(e*e))};r.fastApproximateAtan=function(t){return u.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)};r.fastApproximateAtan2=function(t,i){u.typeOf.number("x",t),u.typeOf.number("y",i);let e,o=Math.abs(t);e=Math.abs(i);let h=Math.max(o,e);e=Math.min(o,e);let f=e/h;if(isNaN(f))throw new n("either x or y must be nonzero");return o=r.fastApproximateAtan(f),o=Math.abs(i)>Math.abs(t)?r.PI_OVER_TWO-o:o,o=t<0?r.PI-o:o,o=i<0?-o:o,o};var y=r;export{y as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-MQTDGHHT.js b/plugins/feature/map/Cesium/Workers/chunk-MQTDGHHT.js new file mode 100644 index 000000000..85dddfe49 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-MQTDGHHT.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as c,c as x}from"./chunk-KP72RGCH.js";import{a as h}from"./chunk-OSVSBQDY.js";import{a as u}from"./chunk-LZC73BOP.js";import{a as d}from"./chunk-OU2IPMYE.js";import{f as n}from"./chunk-H7SJWKIY.js";var s=class e{constructor(i){this._ellipsoid=i??x.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(i){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-i))}static geodeticLatitudeToMercatorAngle(i){i>e.MaximumLatitude?i=e.MaximumLatitude:i<-e.MaximumLatitude&&(i=-e.MaximumLatitude);let t=Math.sin(i);return .5*Math.log((1+t)/(1-t))}project(i,t){let o=this._semimajorAxis,r=i.longitude*o,m=e.geodeticLatitudeToMercatorAngle(i.latitude)*o,a=i.height;return n(t)?(t.x=r,t.y=m,t.z=a,t):new h(r,m,a)}unproject(i,t){if(!n(i))throw new d("cartesian is required");let o=this._oneOverSemimajorAxis,r=i.x*o,m=e.mercatorAngleToGeodeticLatitude(i.y*o),a=i.z;return n(t)?(t.longitude=r,t.latitude=m,t.height=a,t):new c(r,m,a)}};s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI);var L=s;export{L as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-MZG3W7S4.js b/plugins/feature/map/Cesium/Workers/chunk-MZG3W7S4.js new file mode 100644 index 000000000..63e561830 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-MZG3W7S4.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as C}from"./chunk-NCJU5VAQ.js";import{a as P}from"./chunk-D3YAYYEG.js";import{a as L}from"./chunk-KP72RGCH.js";import{a as O}from"./chunk-OSVSBQDY.js";import{a as y}from"./chunk-LZC73BOP.js";import{f as S}from"./chunk-H7SJWKIY.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-NCJU5VAQ.js b/plugins/feature/map/Cesium/Workers/chunk-NCJU5VAQ.js new file mode 100644 index 000000000..502d3585d --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-NCJU5VAQ.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as G}from"./chunk-CB2GA3G5.js";import{a as z}from"./chunk-B5FT3Q23.js";import{b as B}from"./chunk-ZNBU4MZZ.js";import{a as C}from"./chunk-SIBAZPZR.js";import{b as L}from"./chunk-HLXNFZAZ.js";import{a as D,c as I}from"./chunk-KP72RGCH.js";import{a}from"./chunk-OSVSBQDY.js";import{a as S}from"./chunk-LZC73BOP.js";import{a as x}from"./chunk-OU2IPMYE.js";import{f as T}from"./chunk-H7SJWKIY.js";var p={};p.numberOfPoints=function(r,n,o){let e=a.distance(r,n);return Math.ceil(e/o)};p.numberOfPointsRhumbLine=function(r,n,o){let e=Math.pow(r.longitude-n.longitude,2)+Math.pow(r.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(o*o))))};var Z=new D;p.extractHeights=function(r,n){let o=r.length,e=new Array(o);for(let t=0;t<o;t++){let l=r[t];e[t]=n.cartesianToCartographic(l,Z).height}return e};var Y=new L,V=new a,_=new a,F=new C(a.UNIT_X,0),v=new a,j=new C(a.UNIT_X,0),J=new a,K=new a,O=[];function U(r,n,o){let e=O;e.length=r;let t;if(n===o){for(t=0;t<r;t++)e[t]=n;return e}let u=(o-n)/r;for(t=0;t<r;t++){let d=n+t*u;e[t]=d}return e}var N=new D,E=new D,b=new a,k=new a,Q=new a,M=new G,R=new z;function W(r,n,o,e,t,l,u,d){let c=e.scaleToGeodeticSurface(r,k),w=e.scaleToGeodeticSurface(n,Q),h=p.numberOfPoints(r,n,o),f=e.cartesianToCartographic(c,N),y=e.cartesianToCartographic(w,E),g=U(h,t,l);M.setEndPoints(f,y);let P=M.surfaceDistance/h,i=d;f.height=t;let s=e.cartographicToCartesian(f,b);a.pack(s,u,i),i+=3;for(let m=1;m<h;m++){let A=M.interpolateUsingSurfaceDistance(m*P,E);A.height=g[m],s=e.cartographicToCartesian(A,b),a.pack(s,u,i),i+=3}return i}function $(r,n,o,e,t,l,u,d){let c=e.cartesianToCartographic(r,N),w=e.cartesianToCartographic(n,E),h=p.numberOfPointsRhumbLine(c,w,o);c.height=0,w.height=0;let f=U(h,t,l);R.ellipsoid.equals(e)||(R=new z(void 0,void 0,e)),R.setEndPoints(c,w);let y=R.surfaceDistance/h,g=d;c.height=t;let P=e.cartographicToCartesian(c,b);a.pack(P,u,g),g+=3;for(let i=1;i<h;i++){let s=R.interpolateUsingSurfaceDistance(i*y,E);s.height=f[i],P=e.cartographicToCartesian(s,b),a.pack(P,u,g),g+=3}return g}p.wrapLongitude=function(r,n){let o=[],e=[];if(T(r)&&r.length>0){n=n??L.IDENTITY;let t=L.inverseTransformation(n,Y),l=L.multiplyByPoint(t,a.ZERO,V),u=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_Y,_),_),d=C.fromPointNormal(l,u,F),c=a.normalize(L.multiplyByPointAsVector(t,a.UNIT_X,v),v),w=C.fromPointNormal(l,c,j),h=1;o.push(a.clone(r[0]));let f=o[0],y=r.length;for(let g=1;g<y;++g){let P=r[g];if(C.getPointDistance(w,f)<0||C.getPointDistance(w,P)<0){let i=B.lineSegmentPlane(f,P,d,J);if(T(i)){let s=a.multiplyByScalar(u,5e-9,K);C.getPointDistance(d,f)<0&&a.negate(s,s),o.push(a.add(i,s,new a)),e.push(h+1),a.negate(s,s),o.push(a.add(i,s,new a)),h=1}}o.push(a.clone(r[g])),h++,f=P}e.push(h)}return{positions:o,lengths:e}};p.generateArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let i=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let s=e.geodeticSurfaceNormal(i,b);a.multiplyByScalar(s,t,s),a.add(i,s,i)}return[i.x,i.y,i.z]}let u=r.minDistance;if(!T(u)){let i=r.granularity??S.RADIANS_PER_DEGREE;u=S.chordLength(i,e.maximumRadius)}let d=0,c;for(c=0;c<o-1;c++)d+=p.numberOfPoints(n[c],n[c+1],u);let w=(d+1)*3,h=new Array(w),f=0;for(c=0;c<o-1;c++){let i=n[c],s=n[c+1],m=l?t[c]:t,A=l?t[c+1]:t;f=W(i,s,u,e,m,A,h,f)}O.length=0;let y=n[o-1],g=e.cartesianToCartographic(y,N);g.height=l?t[o-1]:t;let P=e.cartographicToCartesian(g,b);return a.pack(P,h,w-3),h};var H=new D,tt=new D;p.generateRhumbArc=function(r){T(r)||(r={});let n=r.positions;if(!T(n))throw new x("options.positions is required.");let o=n.length,e=r.ellipsoid??I.default,t=r.height??0,l=Array.isArray(t);if(o<1)return[];if(o===1){let m=e.scaleToGeodeticSurface(n[0],k);if(t=l?t[0]:t,t!==0){let A=e.geodeticSurfaceNormal(m,b);a.multiplyByScalar(A,t,A),a.add(m,A,m)}return[m.x,m.y,m.z]}let u=r.granularity??S.RADIANS_PER_DEGREE,d=0,c,w=e.cartesianToCartographic(n[0],H),h;for(c=0;c<o-1;c++)h=e.cartesianToCartographic(n[c+1],tt),d+=p.numberOfPointsRhumbLine(w,h,u),w=D.clone(h,H);let f=(d+1)*3,y=new Array(f),g=0;for(c=0;c<o-1;c++){let m=n[c],A=n[c+1],q=l?t[c]:t,X=l?t[c+1]:t;g=$(m,A,u,e,q,X,y,g)}O.length=0;let P=n[o-1],i=e.cartesianToCartographic(P,N);i.height=l?t[o-1]:t;let s=e.cartographicToCartesian(i,b);return a.pack(s,y,f-3),y};p.generateCartesianArc=function(r){let n=p.generateArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};p.generateCartesianRhumbArc=function(r){let n=p.generateRhumbArc(r),o=n.length/3,e=new Array(o);for(let t=0;t<o;t++)e[t]=a.unpack(n,t*3);return e};var gt=p;export{gt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-NXL34BSE.js b/plugins/feature/map/Cesium/Workers/chunk-NXL34BSE.js deleted file mode 100644 index 00aa3b5a3..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-NXL34BSE.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as fn,c as Tn}from"./chunk-3BGP4HCL.js";var Dn=Tn((nt,bt)=>{var _=_||{};_.scope={};_.arrayIteratorImpl=function(p){var c=0;return function(){return c<p.length?{done:!1,value:p[c++]}:{done:!0}}};_.arrayIterator=function(p){return{next:_.arrayIteratorImpl(p)}};_.makeIterator=function(p){var c=typeof Symbol<"u"&&Symbol.iterator&&p[Symbol.iterator];return c?c.call(p):_.arrayIterator(p)};_.ASSUME_ES5=!1;_.ASSUME_NO_NATIVE_MAP=!1;_.ASSUME_NO_NATIVE_SET=!1;_.SIMPLE_FROUND_POLYFILL=!1;_.ISOLATE_POLYFILLS=!1;_.FORCE_POLYFILL_PROMISE=!1;_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;_.getGlobal=function(p){p=[typeof globalThis=="object"&&globalThis,p,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var c=0;c<p.length;++c){var s=p[c];if(s&&s.Math==Math)return s}throw Error("Cannot find global object")};_.global=_.getGlobal(nt);_.defineProperty=_.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(p,c,s){return p==Array.prototype||p==Object.prototype||(p[c]=s.value),p};_.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol";_.TRUST_ES6_POLYFILLS=!_.ISOLATE_POLYFILLS||_.IS_SYMBOL_NATIVE;_.polyfills={};_.propertyToPolyfillSymbol={};_.POLYFILL_PREFIX="$jscp$";_.polyfill=function(p,c,s,y){c&&(_.ISOLATE_POLYFILLS?_.polyfillIsolated(p,c,s,y):_.polyfillUnisolated(p,c,s,y))};_.polyfillUnisolated=function(p,c,s,y){for(s=_.global,p=p.split("."),y=0;y<p.length-1;y++){var a=p[y];if(!(a in s))return;s=s[a]}p=p[p.length-1],y=s[p],c=c(y),c!=y&&c!=null&&_.defineProperty(s,p,{configurable:!0,writable:!0,value:c})};_.polyfillIsolated=function(p,c,s,y){var a=p.split(".");p=a.length===1,y=a[0],y=!p&&y in _.polyfills?_.polyfills:_.global;for(var g=0;g<a.length-1;g++){var i=a[g];if(!(i in y))return;y=y[i]}a=a[a.length-1],s=_.IS_SYMBOL_NATIVE&&s==="es6"?y[a]:null,c=c(s),c!=null&&(p?_.defineProperty(_.polyfills,a,{configurable:!0,writable:!0,value:c}):c!==s&&(_.propertyToPolyfillSymbol[a]===void 0&&(s=1e9*Math.random()>>>0,_.propertyToPolyfillSymbol[a]=_.IS_SYMBOL_NATIVE?_.global.Symbol(a):_.POLYFILL_PREFIX+s+"$"+a),_.defineProperty(y,_.propertyToPolyfillSymbol[a],{configurable:!0,writable:!0,value:c})))};_.polyfill("Promise",function(p){function c(){this.batch_=null}function s(i){return i instanceof a?i:new a(function(l,h){l(i)})}if(p&&(!(_.FORCE_POLYFILL_PROMISE||_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof _.global.PromiseRejectionEvent>"u")||!_.global.Promise||_.global.Promise.toString().indexOf("[native code]")===-1))return p;c.prototype.asyncExecute=function(i){if(this.batch_==null){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(i)};var y=_.global.setTimeout;c.prototype.asyncExecuteFunction=function(i){y(i,0)},c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var i=this.batch_;this.batch_=[];for(var l=0;l<i.length;++l){var h=i[l];i[l]=null;try{h()}catch(I){this.asyncThrow_(I)}}}this.batch_=null},c.prototype.asyncThrow_=function(i){this.asyncExecuteFunction(function(){throw i})};var a=function(i){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var l=this.createResolveAndReject_();try{i(l.resolve,l.reject)}catch(h){l.reject(h)}};a.prototype.createResolveAndReject_=function(){function i(I){return function(C){h||(h=!0,I.call(l,C))}}var l=this,h=!1;return{resolve:i(this.resolveTo_),reject:i(this.reject_)}},a.prototype.resolveTo_=function(i){if(i===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(i instanceof a)this.settleSameAsPromise_(i);else{t:switch(typeof i){case"object":var l=i!=null;break t;case"function":l=!0;break t;default:l=!1}l?this.resolveToNonPromiseObj_(i):this.fulfill_(i)}},a.prototype.resolveToNonPromiseObj_=function(i){var l=void 0;try{l=i.then}catch(h){this.reject_(h);return}typeof l=="function"?this.settleSameAsThenable_(l,i):this.fulfill_(i)},a.prototype.reject_=function(i){this.settle_(2,i)},a.prototype.fulfill_=function(i){this.settle_(1,i)},a.prototype.settle_=function(i,l){if(this.state_!=0)throw Error("Cannot settle("+i+", "+l+"): Promise already settled in state"+this.state_);this.state_=i,this.result_=l,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},a.prototype.scheduleUnhandledRejectionCheck_=function(){var i=this;y(function(){if(i.notifyUnhandledRejection_()){var l=_.global.console;typeof l<"u"&&l.error(i.result_)}},1)},a.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var i=_.global.CustomEvent,l=_.global.Event,h=_.global.dispatchEvent;return typeof h>"u"?!0:(typeof i=="function"?i=new i("unhandledrejection",{cancelable:!0}):typeof l=="function"?i=new l("unhandledrejection",{cancelable:!0}):(i=_.global.document.createEvent("CustomEvent"),i.initCustomEvent("unhandledrejection",!1,!0,i)),i.promise=this,i.reason=this.result_,h(i))},a.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var i=0;i<this.onSettledCallbacks_.length;++i)g.asyncExecute(this.onSettledCallbacks_[i]);this.onSettledCallbacks_=null}};var g=new c;return a.prototype.settleSameAsPromise_=function(i){var l=this.createResolveAndReject_();i.callWhenSettled_(l.resolve,l.reject)},a.prototype.settleSameAsThenable_=function(i,l){var h=this.createResolveAndReject_();try{i.call(l,h.resolve,h.reject)}catch(I){h.reject(I)}},a.prototype.then=function(i,l){function h(f,T){return typeof f=="function"?function(G){try{I(f(G))}catch(V){C(V)}}:T}var I,C,K=new a(function(f,T){I=f,C=T});return this.callWhenSettled_(h(i,I),h(l,C)),K},a.prototype.catch=function(i){return this.then(void 0,i)},a.prototype.callWhenSettled_=function(i,l){function h(){switch(I.state_){case 1:i(I.result_);break;case 2:l(I.result_);break;default:throw Error("Unexpected state: "+I.state_)}}var I=this;this.onSettledCallbacks_==null?g.asyncExecute(h):this.onSettledCallbacks_.push(h),this.isRejectionHandled_=!0},a.resolve=s,a.reject=function(i){return new a(function(l,h){h(i)})},a.race=function(i){return new a(function(l,h){for(var I=_.makeIterator(i),C=I.next();!C.done;C=I.next())s(C.value).callWhenSettled_(l,h)})},a.all=function(i){var l=_.makeIterator(i),h=l.next();return h.done?s([]):new a(function(I,C){function K(G){return function(V){f[G]=V,T--,T==0&&I(f)}}var f=[],T=0;do f.push(void 0),T++,s(h.value).callWhenSettled_(K(f.length-1),C),h=l.next();while(!h.done)})},a},"es6","es3");_.owns=function(p,c){return Object.prototype.hasOwnProperty.call(p,c)};_.assign=_.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(p,c){for(var s=1;s<arguments.length;s++){var y=arguments[s];if(y)for(var a in y)_.owns(y,a)&&(p[a]=y[a])}return p};_.polyfill("Object.assign",function(p){return p||_.assign},"es6","es3");_.checkStringArgs=function(p,c,s){if(p==null)throw new TypeError("The 'this' value for String.prototype."+s+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+s+" must not be a regular expression");return p+""};_.polyfill("String.prototype.startsWith",function(p){return p||function(c,s){var y=_.checkStringArgs(this,c,"startsWith");c+="";var a=y.length,g=c.length;s=Math.max(0,Math.min(s|0,y.length));for(var i=0;i<g&&s<a;)if(y[s++]!=c[i++])return!1;return i>=g}},"es6","es3");_.polyfill("Array.prototype.copyWithin",function(p){function c(s){return s=Number(s),s===1/0||s===-1/0?s:s|0}return p||function(s,y,a){var g=this.length;if(s=c(s),y=c(y),a=a===void 0?g:c(a),s=0>s?Math.max(g+s,0):Math.min(s,g),y=0>y?Math.max(g+y,0):Math.min(y,g),a=0>a?Math.max(g+a,0):Math.min(a,g),s<y)for(;y<a;)y in this?this[s++]=this[y++]:(delete this[s++],y++);else for(a=Math.min(a,g+y-s),s+=a-y;a>y;)--a in this?this[--s]=this[a]:delete this[--s];return this}},"es6","es3");_.typedArrayCopyWithin=function(p){return p||Array.prototype.copyWithin};_.polyfill("Int8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8ClampedArray.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float64Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");var dt=function(){var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(p=p||__filename),function(c){function s(e){return t.locateFile?t.locateFile(e,Q):Q+e}function y(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.buffer&&Ot)return Ot.decode(e.subarray(r,n));for(o="";r<n;){var m=e[r++];if(m&128){var b=e[r++]&63;if((m&224)==192)o+=String.fromCharCode((m&31)<<6|b);else{var X=e[r++]&63;m=(m&240)==224?(m&15)<<12|b<<6|X:(m&7)<<18|b<<12|X<<6|e[r++]&63,65536>m?o+=String.fromCharCode(m):(m-=65536,o+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else o+=String.fromCharCode(m)}return o}function a(e,r){return e?y(tt,e,r):""}function g(){var e=_t.buffer;t.HEAP8=q=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=et=new Int32Array(e),t.HEAPU8=tt=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=x=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function i(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",J(e),Gt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),ot(e),e}function l(e){try{if(e==z&&Z)return new Uint8Array(Z);if(ut)return ut(e);throw"both async and sync fetching of the wasm failed"}catch(r){i(r)}}function h(){if(!Z&&(It||$)){if(typeof fetch=="function"&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+z+"'";return e.arrayBuffer()}).catch(function(){return l(z)});if(st)return new Promise(function(e,r){st(z,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return l(z)})}function I(e){for(;0<e.length;)e.shift()(t)}function C(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){x[this.ptr+4>>2]=r},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(r){x[this.ptr+8>>2]=r},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(r){et[this.ptr>>2]=r},this.set_caught=function(r){q[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return q[this.ptr+12>>0]!=0},this.set_rethrown=function(r){q[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return q[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){et[this.ptr>>2]+=1},this.release_ref=function(){var r=et[this.ptr>>2];return et[this.ptr>>2]=r-1,r===1},this.set_adjusted_ptr=function(r){x[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ln(this.get_type()))return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function K(){function e(){if(!it&&(it=!0,t.calledRun=!0,!Gt)){if(Rt=!0,I(ct),ht(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt.unshift(t.postRun.shift());I(Pt)}}if(!(0<k)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)jt.unshift(t.preRun.shift());I(jt),0<k||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}function f(){}function T(e){return(e||f).__cache__}function G(e,r){var n=T(r),o=n[e];return o||(o=Object.create((r||f).prototype),o.ptr=e,n[e]=o)}function V(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?r++:2047>=o?r+=2:55296<=o&&57343>=o?(r+=4,++n):r+=3}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var m=0;m<e.length;++m){var b=e.charCodeAt(m);if(55296<=b&&57343>=b){var X=e.charCodeAt(++m);b=65536+((b&1023)<<10)|X&1023}if(127>=b){if(n>=o)break;r[n++]=b}else{if(2047>=b){if(n+1>=o)break;r[n++]=192|b>>6}else{if(65535>=b){if(n+2>=o)break;r[n++]=224|b>>12}else{if(n+3>=o)break;r[n++]=240|b>>18,r[n++]=128|b>>12&63}r[n++]=128|b>>6&63}r[n++]=128|b&63}}r[n]=0}return e=d.alloc(r,q),d.copy(r,q,e),e}return e}function at(e){if(typeof e=="object"){var r=d.alloc(e,q);return d.copy(e,q,r),r}return e}function H(){throw"cannot construct a VoidPtr, no constructor in IDL"}function B(){this.ptr=Mt(),T(B)[this.ptr]=this}function w(){this.ptr=Ft(),T(w)[this.ptr]=this}function Y(){this.ptr=wt(),T(Y)[this.ptr]=this}function A(){this.ptr=Vt(),T(A)[this.ptr]=this}function E(){this.ptr=Jt(),T(E)[this.ptr]=this}function j(){this.ptr=ne(),T(j)[this.ptr]=this}function P(){this.ptr=ae(),T(P)[this.ptr]=this}function O(){this.ptr=ce(),T(O)[this.ptr]=this}function W(){this.ptr=de(),T(W)[this.ptr]=this}function v(){throw"cannot construct a Status, no constructor in IDL"}function R(){this.ptr=Ie(),T(R)[this.ptr]=this}function S(){this.ptr=Ge(),T(S)[this.ptr]=this}function M(){this.ptr=Re(),T(M)[this.ptr]=this}function N(){this.ptr=Ue(),T(N)[this.ptr]=this}function U(){this.ptr=we(),T(U)[this.ptr]=this}function F(){this.ptr=We(),T(F)[this.ptr]=this}function L(){this.ptr=He(),T(L)[this.ptr]=this}function D(){this.ptr=Ke(),T(D)[this.ptr]=this}function u(){this.ptr=_r(),T(u)[this.ptr]=this}c=c===void 0?{}:c;var t=typeof c<"u"?c:{},ht,ot;t.ready=new Promise(function(e,r){ht=e,ot=r});var At=!1,Tt=!1;t.onRuntimeInitialized=function(){At=!0,Tt&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){Tt=!0,At&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var Dt=Object.assign({},t),It=typeof window=="object",$=typeof importScripts=="function",gt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q="";if(gt){var vt=fn("fs"),pt=fn("path");Q=$?pt.dirname(Q)+"/":__dirname+"/";var Et=function(e,r){return e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFileSync(e,r?void 0:"utf8")},ut=function(e){return e=Et(e,!0),e.buffer||(e=new Uint8Array(e)),e},st=function(e,r,n){e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFile(e,function(o,m){o?n(o):r(m.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(It||$)&&($?Q=self.location.href:typeof document<"u"&&document.currentScript&&(Q=document.currentScript.src),p&&(Q=p),Q=Q.indexOf("blob:")!==0?Q.substr(0,Q.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Et=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},$&&(ut=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),st=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var dn=t.print||console.log.bind(console),J=t.printErr||console.warn.bind(console);Object.assign(t,Dt),Dt=null;var Z;t.wasmBinary&&(Z=t.wasmBinary),typeof WebAssembly!="object"&&i("no native wasm support detected");var _t,Gt=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q,tt,et,x,jt=[],ct=[],Pt=[],Rt=!1,k=0,yt=null,rt=null,z="draco_decoder.wasm";z.startsWith("data:application/octet-stream;base64,")||(z=s(z));var bn=0,hn=[null,[],[]],An={b:function(e,r,n){throw new C(e).init(r,n),bn++,e},a:function(){i("")},g:function(e,r,n){tt.copyWithin(e,r,r+n)},e:function(e){var r=tt.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var m=Math;o=Math.max(e,o),m=m.min.call(m,2147483648,o+(65536-o%65536)%65536);t:{o=_t.buffer;try{_t.grow(m-o.byteLength+65535>>>16),g();var b=1;break t}catch{}b=void 0}if(b)return!0}return!1},f:function(e){return 52},d:function(e,r,n,o,m){return 70},c:function(e,r,n,o){for(var m=0,b=0;b<n;b++){var X=x[r>>2],mn=x[r+4>>2];r+=8;for(var lt=0;lt<mn;lt++){var mt=tt[X+lt],ft=hn[e];mt===0||mt===10?((e===1?dn:J)(y(ft,0)),ft.length=0):ft.push(mt)}m+=mn}return x[o>>2]=m,0}};(function(){function e(m,b){t.asm=m.exports,_t=t.asm.h,g(),ct.unshift(t.asm.i),k--,t.monitorRunDependencies&&t.monitorRunDependencies(k),k==0&&(yt!==null&&(clearInterval(yt),yt=null),rt&&(m=rt,rt=null,m()))}function r(m){e(m.instance)}function n(m){return h().then(function(b){return WebAssembly.instantiate(b,o)}).then(function(b){return b}).then(m,function(b){J("failed to asynchronously prepare wasm: "+b),i(b)})}var o={a:An};if(k++,t.monitorRunDependencies&&t.monitorRunDependencies(k),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(m){J("Module.instantiateWasm callback failed with error: "+m),ot(m)}return function(){return Z||typeof WebAssembly.instantiateStreaming!="function"||z.startsWith("data:application/octet-stream;base64,")||z.startsWith("file://")||gt||typeof fetch!="function"?n(r):fetch(z,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,o).then(r,function(b){return J("wasm streaming compile failed: "+b),J("falling back to ArrayBuffer instantiation"),n(r)})})}().catch(ot),{}})();var St=t._emscripten_bind_VoidPtr___destroy___0=function(){return(St=t._emscripten_bind_VoidPtr___destroy___0=t.asm.k).apply(null,arguments)},Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.l).apply(null,arguments)},Nt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Nt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.m).apply(null,arguments)},Ut=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Ut=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.n).apply(null,arguments)},Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.o).apply(null,arguments)},Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.p).apply(null,arguments)},Ct=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Ct=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.q).apply(null,arguments)},wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.r).apply(null,arguments)},zt=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(zt=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.s).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.t).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_size_0=function(){return(Bt=t._emscripten_bind_PointAttribute_size_0=t.asm.u).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.v).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(Qt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.w).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(xt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.x).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Yt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.y).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Ht=t._emscripten_bind_PointAttribute_normalized_0=t.asm.z).apply(null,arguments)},qt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(qt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.A).apply(null,arguments)},kt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(kt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.B).apply(null,arguments)},Xt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Xt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.C).apply(null,arguments)},Kt=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Kt=t._emscripten_bind_PointAttribute___destroy___0=t.asm.D).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.E).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.F).apply(null,arguments)},Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.G).apply(null,arguments)},te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.H).apply(null,arguments)},ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.I).apply(null,arguments)},re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.J).apply(null,arguments)},ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.K).apply(null,arguments)},oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.L).apply(null,arguments)},_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.M).apply(null,arguments)},ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.N).apply(null,arguments)},ae=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ae=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.O).apply(null,arguments)},pe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(pe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.P).apply(null,arguments)},ue=t._emscripten_bind_PointCloud_num_points_0=function(){return(ue=t._emscripten_bind_PointCloud_num_points_0=t.asm.Q).apply(null,arguments)},se=t._emscripten_bind_PointCloud___destroy___0=function(){return(se=t._emscripten_bind_PointCloud___destroy___0=t.asm.R).apply(null,arguments)},ce=t._emscripten_bind_Mesh_Mesh_0=function(){return(ce=t._emscripten_bind_Mesh_Mesh_0=t.asm.S).apply(null,arguments)},ye=t._emscripten_bind_Mesh_num_faces_0=function(){return(ye=t._emscripten_bind_Mesh_num_faces_0=t.asm.T).apply(null,arguments)},le=t._emscripten_bind_Mesh_num_attributes_0=function(){return(le=t._emscripten_bind_Mesh_num_attributes_0=t.asm.U).apply(null,arguments)},me=t._emscripten_bind_Mesh_num_points_0=function(){return(me=t._emscripten_bind_Mesh_num_points_0=t.asm.V).apply(null,arguments)},fe=t._emscripten_bind_Mesh___destroy___0=function(){return(fe=t._emscripten_bind_Mesh___destroy___0=t.asm.W).apply(null,arguments)},de=t._emscripten_bind_Metadata_Metadata_0=function(){return(de=t._emscripten_bind_Metadata_Metadata_0=t.asm.X).apply(null,arguments)},be=t._emscripten_bind_Metadata___destroy___0=function(){return(be=t._emscripten_bind_Metadata___destroy___0=t.asm.Y).apply(null,arguments)},he=t._emscripten_bind_Status_code_0=function(){return(he=t._emscripten_bind_Status_code_0=t.asm.Z).apply(null,arguments)},Ae=t._emscripten_bind_Status_ok_0=function(){return(Ae=t._emscripten_bind_Status_ok_0=t.asm._).apply(null,arguments)},Te=t._emscripten_bind_Status_error_msg_0=function(){return(Te=t._emscripten_bind_Status_error_msg_0=t.asm.$).apply(null,arguments)},De=t._emscripten_bind_Status___destroy___0=function(){return(De=t._emscripten_bind_Status___destroy___0=t.asm.aa).apply(null,arguments)},Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ba).apply(null,arguments)},ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.ca).apply(null,arguments)},ve=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(ve=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.da).apply(null,arguments)},Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.ea).apply(null,arguments)},Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.fa).apply(null,arguments)},Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ga).apply(null,arguments)},je=t._emscripten_bind_DracoInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ha).apply(null,arguments)},Pe=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ia).apply(null,arguments)},Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ja).apply(null,arguments)},Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.ka).apply(null,arguments)},Me=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(Me=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.la).apply(null,arguments)},Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.ma).apply(null,arguments)},Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.na).apply(null,arguments)},Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.oa).apply(null,arguments)},Le=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Le=t._emscripten_bind_DracoInt16Array_size_0=t.asm.pa).apply(null,arguments)},Ce=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Ce=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.qa).apply(null,arguments)},we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.ra).apply(null,arguments)},ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.sa).apply(null,arguments)},Ve=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Ve=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ta).apply(null,arguments)},Be=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.ua).apply(null,arguments)},We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.va).apply(null,arguments)},Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.wa).apply(null,arguments)},xe=t._emscripten_bind_DracoInt32Array_size_0=function(){return(xe=t._emscripten_bind_DracoInt32Array_size_0=t.asm.xa).apply(null,arguments)},Ye=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.ya).apply(null,arguments)},He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.za).apply(null,arguments)},qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Aa).apply(null,arguments)},ke=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(ke=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ba).apply(null,arguments)},Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Ca).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Da).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Ea).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return($e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Fa).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ga).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ha).apply(null,arguments)},er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ia).apply(null,arguments)},rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ja).apply(null,arguments)},nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.Ka).apply(null,arguments)},or=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(or=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.La).apply(null,arguments)},_r=t._emscripten_bind_Decoder_Decoder_0=function(){return(_r=t._emscripten_bind_Decoder_Decoder_0=t.asm.Ma).apply(null,arguments)},ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Na).apply(null,arguments)},ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Oa).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Pa).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Qa).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Ra).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(cr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Sa).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ta).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(lr=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Ua).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Va).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Wa).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Xa).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Ya).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm.Za).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm._a).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.$a).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.ab).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.bb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.db).apply(null,arguments)},Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.fb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.hb).apply(null,arguments)},Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.ib).apply(null,arguments)},Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.jb).apply(null,arguments)},Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.kb).apply(null,arguments)},Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.lb).apply(null,arguments)},Nr=t._emscripten_bind_Decoder___destroy___0=function(){return(Nr=t._emscripten_bind_Decoder___destroy___0=t.asm.mb).apply(null,arguments)},Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.nb).apply(null,arguments)},Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.ob).apply(null,arguments)},Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.pb).apply(null,arguments)},Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.qb).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.rb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.sb).apply(null,arguments)},Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.tb).apply(null,arguments)},Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.ub).apply(null,arguments)},Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.vb).apply(null,arguments)},Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.wb).apply(null,arguments)},xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.xb).apply(null,arguments)},Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.yb).apply(null,arguments)},Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.zb).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(qr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Ab).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Bb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Cb).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Db).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Eb).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_INT32=function(){return($r=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Fb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Gb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(tn=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Hb).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(en=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Ib).apply(null,arguments)},rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Jb).apply(null,arguments)},nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Kb).apply(null,arguments)},on=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(on=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Lb).apply(null,arguments)},_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Mb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_OK=function(){return(an=t._emscripten_enum_draco_StatusCode_OK=t.asm.Nb).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Ob).apply(null,arguments)},un=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(un=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Pb).apply(null,arguments)},sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Qb).apply(null,arguments)},cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Rb).apply(null,arguments)},yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Sb).apply(null,arguments)};t._malloc=function(){return(t._malloc=t.asm.Tb).apply(null,arguments)},t._free=function(){return(t._free=t.asm.Ub).apply(null,arguments)};var ln=function(){return(ln=t.asm.Vb).apply(null,arguments)};t.___start_em_js=15856,t.___stop_em_js=15954;var it;if(rt=function e(){it||K(),it||(rt=e)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();K(),f.prototype=Object.create(f.prototype),f.prototype.constructor=f,f.prototype.__class__=f,f.__cache__={},t.WrapperObject=f,t.getCache=T,t.wrapPointer=G,t.castObject=function(e,r){return G(e.ptr,r)},t.NULL=G(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete T(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var d={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(d.needed){for(var e=0;e<d.temps.length;e++)t._free(d.temps[e]);d.temps.length=0,t._free(d.buffer),d.buffer=0,d.size+=d.needed,d.needed=0}d.buffer||(d.size+=128,d.buffer=t._malloc(d.size),d.buffer||i(void 0)),d.pos=0},alloc:function(e,r){return d.buffer||i(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,d.pos+e>=d.size?(0<e||i(void 0),d.needed+=e,r=t._malloc(e),d.temps.push(r)):(r=d.buffer+d.pos,d.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return H.prototype=Object.create(f.prototype),H.prototype.constructor=H,H.prototype.__class__=H,H.__cache__={},t.VoidPtr=H,H.prototype.__destroy__=H.prototype.__destroy__=function(){St(this.ptr)},B.prototype=Object.create(f.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.DecoderBuffer=B,B.prototype.Init=B.prototype.Init=function(e,r){var n=this.ptr;d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),Nt(n,e,r)},B.prototype.__destroy__=B.prototype.__destroy__=function(){Ut(this.ptr)},w.prototype=Object.create(f.prototype),w.prototype.constructor=w,w.prototype.__class__=w,w.__cache__={},t.AttributeTransformData=w,w.prototype.transform_type=w.prototype.transform_type=function(){return Lt(this.ptr)},w.prototype.__destroy__=w.prototype.__destroy__=function(){Ct(this.ptr)},Y.prototype=Object.create(f.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.GeometryAttribute=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){zt(this.ptr)},A.prototype=Object.create(f.prototype),A.prototype.constructor=A,A.prototype.__class__=A,A.__cache__={},t.PointAttribute=A,A.prototype.size=A.prototype.size=function(){return Bt(this.ptr)},A.prototype.GetAttributeTransformData=A.prototype.GetAttributeTransformData=function(){return G(Wt(this.ptr),w)},A.prototype.attribute_type=A.prototype.attribute_type=function(){return Qt(this.ptr)},A.prototype.data_type=A.prototype.data_type=function(){return xt(this.ptr)},A.prototype.num_components=A.prototype.num_components=function(){return Yt(this.ptr)},A.prototype.normalized=A.prototype.normalized=function(){return!!Ht(this.ptr)},A.prototype.byte_stride=A.prototype.byte_stride=function(){return qt(this.ptr)},A.prototype.byte_offset=A.prototype.byte_offset=function(){return kt(this.ptr)},A.prototype.unique_id=A.prototype.unique_id=function(){return Xt(this.ptr)},A.prototype.__destroy__=A.prototype.__destroy__=function(){Kt(this.ptr)},E.prototype=Object.create(f.prototype),E.prototype.constructor=E,E.prototype.__class__=E,E.__cache__={},t.AttributeQuantizationTransform=E,E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!$t(r,e)},E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Zt(this.ptr)},E.prototype.min_value=E.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),te(r,e)},E.prototype.range=E.prototype.range=function(){return ee(this.ptr)},E.prototype.__destroy__=E.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(f.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.AttributeOctahedronTransform=j,j.prototype.InitFromAttribute=j.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!oe(r,e)},j.prototype.quantization_bits=j.prototype.quantization_bits=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},P.prototype=Object.create(f.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.PointCloud=P,P.prototype.num_attributes=P.prototype.num_attributes=function(){return pe(this.ptr)},P.prototype.num_points=P.prototype.num_points=function(){return ue(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){se(this.ptr)},O.prototype=Object.create(f.prototype),O.prototype.constructor=O,O.prototype.__class__=O,O.__cache__={},t.Mesh=O,O.prototype.num_faces=O.prototype.num_faces=function(){return ye(this.ptr)},O.prototype.num_attributes=O.prototype.num_attributes=function(){return le(this.ptr)},O.prototype.num_points=O.prototype.num_points=function(){return me(this.ptr)},O.prototype.__destroy__=O.prototype.__destroy__=function(){fe(this.ptr)},W.prototype=Object.create(f.prototype),W.prototype.constructor=W,W.prototype.__class__=W,W.__cache__={},t.Metadata=W,W.prototype.__destroy__=W.prototype.__destroy__=function(){be(this.ptr)},v.prototype=Object.create(f.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.Status=v,v.prototype.code=v.prototype.code=function(){return he(this.ptr)},v.prototype.ok=v.prototype.ok=function(){return!!Ae(this.ptr)},v.prototype.error_msg=v.prototype.error_msg=function(){return a(Te(this.ptr))},v.prototype.__destroy__=v.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(f.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoFloat32Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(f.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(f.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoUInt8Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(f.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Le(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Ce(this.ptr)},U.prototype=Object.create(f.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoUInt16Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(f.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Qe(r,e)},F.prototype.size=F.prototype.size=function(){return xe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},L.prototype=Object.create(f.prototype),L.prototype.constructor=L,L.prototype.__class__=L,L.__cache__={},t.DracoUInt32Array=L,L.prototype.GetValue=L.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),qe(r,e)},L.prototype.size=L.prototype.size=function(){return ke(this.ptr)},L.prototype.__destroy__=L.prototype.__destroy__=function(){Xe(this.ptr)},D.prototype=Object.create(f.prototype),D.prototype.constructor=D,D.prototype.__class__=D,D.__cache__={},t.MetadataQuerier=D,D.prototype.HasEntry=D.prototype.HasEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),!!Je(n,e,r)},D.prototype.GetIntEntry=D.prototype.GetIntEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),$e(n,e,r)},D.prototype.GetIntEntryArray=D.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n&&typeof n=="object"&&(n=n.ptr),Ze(o,e,r,n)},D.prototype.GetDoubleEntry=D.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),tr(n,e,r)},D.prototype.GetStringEntry=D.prototype.GetStringEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),a(er(n,e,r))},D.prototype.NumEntries=D.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),rr(r,e)},D.prototype.GetEntryName=D.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),a(nr(n,e,r))},D.prototype.__destroy__=D.prototype.__destroy__=function(){or(this.ptr)},u.prototype=Object.create(f.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ir(o,e,r,n),v)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ar(o,e,r,n),v)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),pr(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),ur(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n=n&&typeof n=="object"?n.ptr:V(n),sr(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(cr(n,e,r),A)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(yr(n,e,r),A)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),G(lr(r,e),W)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(mr(n,e,r),W)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),dr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!vr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Er(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Gr(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Or(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,m){var b=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),m&&typeof m=="object"&&(m=m.ptr),!!jr(b,e,r,n,o,m)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Pr(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Rr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Sr(n,e,r),v)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Mr(n,e,r),v)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Nr(this.ptr)},function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Ur(),t.ATTRIBUTE_NO_TRANSFORM=Fr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Lr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Cr(),t.INVALID=wr(),t.POSITION=zr(),t.NORMAL=Vr(),t.COLOR=Br(),t.TEX_COORD=Wr(),t.GENERIC=Qr(),t.INVALID_GEOMETRY_TYPE=xr(),t.POINT_CLOUD=Yr(),t.TRIANGULAR_MESH=Hr(),t.DT_INVALID=qr(),t.DT_INT8=kr(),t.DT_UINT8=Xr(),t.DT_INT16=Kr(),t.DT_UINT16=Jr(),t.DT_INT32=$r(),t.DT_UINT32=Zr(),t.DT_INT64=tn(),t.DT_UINT64=en(),t.DT_FLOAT32=rn(),t.DT_FLOAT64=nn(),t.DT_BOOL=on(),t.DT_TYPES_COUNT=_n(),t.OK=an(),t.DRACO_ERROR=pn(),t.IO_ERROR=un(),t.INVALID_PARAMETER=sn(),t.UNSUPPORTED_VERSION=cn(),t.UNKNOWN_VERSION=yn()}Rt?e():ct.unshift(e)}(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},c.ready}}();typeof nt=="object"&&typeof bt=="object"?bt.exports=dt:typeof define=="function"&&define.amd?define([],function(){return dt}):typeof nt=="object"&&(nt.DracoDecoderModule=dt)});export{Dn as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-OAGMF473.js b/plugins/feature/map/Cesium/Workers/chunk-OAGMF473.js deleted file mode 100644 index 4304df664..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-OAGMF473.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as L}from"./chunk-HRZKIJQA.js";import{a as S}from"./chunk-4W2MZV6I.js";import{a as D}from"./chunk-JQLYZQ6V.js";import{a as H}from"./chunk-J3L5WX3X.js";import{b as T,c as B,d as x}from"./chunk-AVPLM4UI.js";import{d as E}from"./chunk-ZYYZDBKK.js";import{a as O}from"./chunk-WER4LUMF.js";import{a as c,d,f as V}from"./chunk-FGKVHLJ4.js";import{a as w}from"./chunk-YRCAQUFT.js";import{a as A}from"./chunk-ELJAHN3H.js";import{e as a}from"./chunk-3BGP4HCL.js";var q=new c,g=new c;function U(e){let t=e.center;g=c.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g),e.height,g),g=c.add(t,g,g);let i=new E(g,e.semiMajorAxis),f=L.computeEllipsePositions(e,!1,!0).outerPositions,o=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(f,e,!1)})}),r=f.length/3,u=D.createTypedArray(r,r*2),m=0;for(let n=0;n<r;++n)u[m++]=n,u[m++]=(n+1)%r;return{boundingSphere:i,attributes:o,indices:u}}var j=new E,N=new E;function R(e){let t=e.center,i=e.ellipsoid,f=e.semiMajorAxis,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,q),e.height,q);j.center=c.add(t,o,j.center),j.radius=f,o=c.multiplyByScalar(i.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),N.center=c.add(t,o,N.center),N.radius=f;let r=L.computeEllipsePositions(e,!1,!0).outerPositions,u=new H({position:new x({componentDatatype:O.DOUBLE,componentsPerAttribute:3,values:L.raisePositionsToHeight(r,e,!0)})});r=u.position.values;let m=E.union(j,N),n=r.length/3;if(a(e.offsetAttribute)){let b=new Uint8Array(n);if(e.offsetAttribute===S.TOP)b=b.fill(1,0,n/2);else{let k=e.offsetAttribute===S.NONE?0:1;b=b.fill(k)}u.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let l=e.numberOfVerticalLines??16;l=w.clamp(l,0,n/2);let h=D.createTypedArray(n,n*2+l*2);n/=2;let p=0,s;for(s=0;s<n;++s)h[p++]=s,h[p++]=(s+1)%n,h[p++]=s+n,h[p++]=(s+1)%n+n;let P;if(l>0){let b=Math.min(l,n);P=Math.round(n/b);let k=Math.min(P*l,n);for(s=0;s<k;s+=P)h[p++]=s,h[p++]=s+n}return{boundingSphere:m,attributes:u,indices:h}}function M(e){e=e??V.EMPTY_OBJECT;let t=e.center,i=e.ellipsoid??d.default,f=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!a(t))throw new A("center is required.");if(!a(f))throw new A("semiMajorAxis is required.");if(!a(o))throw new A("semiMinorAxis is required.");if(f<o)throw new A("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new A("granularity must be greater than zero.");let u=e.height??0,m=e.extrudedHeight??u;this._center=c.clone(t),this._semiMajorAxis=f,this._semiMinorAxis=o,this._ellipsoid=d.clone(i),this._rotation=e.rotation??0,this._height=Math.max(m,u),this._granularity=r,this._extrudedHeight=Math.min(m,u),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}M.packedLength=c.packedLength+d.packedLength+8;M.pack=function(e,t,i){if(!a(e))throw new A("value is required");if(!a(t))throw new A("array is required");return i=i??0,c.pack(e._center,t,i),i+=c.packedLength,d.pack(e._ellipsoid,t,i),i+=d.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=e._offsetAttribute??-1,t};var y=new c,C=new d,_={center:y,ellipsoid:C,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};M.unpack=function(e,t,i){if(!a(e))throw new A("array is required");t=t??0;let f=c.unpack(e,t,y);t+=c.packedLength;let o=d.unpack(e,t,C);t+=d.packedLength;let r=e[t++],u=e[t++],m=e[t++],n=e[t++],l=e[t++],h=e[t++],p=e[t++],s=e[t];return a(i)?(i._center=c.clone(f,i._center),i._ellipsoid=d.clone(o,i._ellipsoid),i._semiMajorAxis=r,i._semiMinorAxis=u,i._rotation=m,i._height=n,i._granularity=l,i._extrudedHeight=h,i._numberOfVerticalLines=p,i._offsetAttribute=s===-1?void 0:s,i):(_.height=n,_.extrudedHeight=h,_.granularity=l,_.rotation=m,_.semiMajorAxis=r,_.semiMinorAxis=u,_.numberOfVerticalLines=p,_.offsetAttribute=s===-1?void 0:s,new M(_))};M.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,i=e._extrudedHeight,f=!w.equalsEpsilon(t,i,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(f)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,r=R(o);else if(r=U(o),a(e._offsetAttribute)){let u=r.attributes.position.values.length,m=e._offsetAttribute===S.NONE?0:1,n=new Uint8Array(u/3).fill(m);r.attributes.applyOffset=new x({componentDatatype:O.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}return new B({attributes:r.attributes,indices:r.indices,primitiveType:T.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ie=M;export{ie as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-OM62BMPV.js b/plugins/feature/map/Cesium/Workers/chunk-OM62BMPV.js deleted file mode 100644 index 7ffe32da9..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-OM62BMPV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as y,b as P,d as B}from"./chunk-FGKVHLJ4.js";import{a as L}from"./chunk-YRCAQUFT.js";import{b as q}from"./chunk-ELJAHN3H.js";import{e as T}from"./chunk-3BGP4HCL.js";function X(n){let a=n._uSquared,t=n._ellipsoid.maximumRadius,e=n._ellipsoid.minimumRadius,f=(t-e)/t,m=Math.cos(n._startHeading),_=Math.sin(n._startHeading),r=(1-f)*Math.tan(n._start.latitude),p=1/Math.sqrt(1+r*r),R=p*r,M=Math.atan2(r,m),l=p*_,U=l*l,i=1-U,A=Math.sqrt(i),c=a/4,o=c*c,h=o*c,S=o*o,u=1+c-3*o/4+5*h/4-175*S/64,C=1-c+15*o/8-35*h/8,d=1-3*c+35*o/4,g=1-5*c,w=u*M-C*Math.sin(2*M)*c/2-d*Math.sin(4*M)*o/16-g*Math.sin(6*M)*h/48-Math.sin(8*M)*5*S/512,s=n._constants;s.a=t,s.b=e,s.f=f,s.cosineHeading=m,s.sineHeading=_,s.tanU=r,s.cosineU=p,s.sineU=R,s.sigma=M,s.sineAlpha=l,s.sineSquaredAlpha=U,s.cosineSquaredAlpha=i,s.cosineAlpha=A,s.u2Over4=c,s.u4Over16=o,s.u6Over64=h,s.u8Over256=S,s.a0=u,s.a1=C,s.a2=d,s.a3=g,s.distanceRatio=w}function Y(n,a){return n*a*(4+n*(4-3*a))/16}function k(n,a,t,e,f,m,_){let r=Y(n,t);return(1-r)*n*a*(e+r*f*(_+r*m*(2*_*_-1)))}function Z(n,a,t,e,f,m,_){let r=(a-t)/a,p=m-e,R=Math.atan((1-r)*Math.tan(f)),M=Math.atan((1-r)*Math.tan(_)),l=Math.cos(R),U=Math.sin(R),i=Math.cos(M),A=Math.sin(M),c=l*i,o=l*A,h=U*A,S=U*i,u=p,C=L.TWO_PI,d=Math.cos(u),g=Math.sin(u),w,s,O,H,b;do{d=Math.cos(u),g=Math.sin(u);let z=o-S*d;O=Math.sqrt(i*i*g*g+z*z),s=h+c*d,w=Math.atan2(O,s);let D;O===0?(D=0,H=1):(D=c*g/O,H=1-D*D),C=u,b=s-2*h/H,isFinite(b)||(b=0),u=p+k(r,D,H,w,O,s,b)}while(Math.abs(u-C)>L.EPSILON12);let v=H*(a*a-t*t)/(t*t),W=1+v*(4096+v*(v*(320-175*v)-768))/16384,I=v*(256+v*(v*(74-47*v)-128))/1024,F=b*b,J=I*O*(b+I*(s*(2*F-1)-I*b*(4*O*O-3)*(4*F-3)/6)/4),K=t*W*(w-J),Q=Math.atan2(i*g,o-S*d),V=Math.atan2(l*g,o*d-S);n._distance=K,n._startHeading=Q,n._endHeading=V,n._uSquared=v}var $=new y,x=new y;function N(n,a,t,e){let f=y.normalize(e.cartographicToCartesian(a,x),$),m=y.normalize(e.cartographicToCartesian(t,x),x);q.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(y.angleBetween(f,m))-Math.PI),.0125),Z(n,e.maximumRadius,e.minimumRadius,a.longitude,a.latitude,t.longitude,t.latitude),n._start=P.clone(a,n._start),n._end=P.clone(t,n._end),n._start.height=0,n._end.height=0,X(n)}function E(n,a,t){let e=t??B.default;this._ellipsoid=e,this._start=new P,this._end=new P,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,T(n)&&T(a)&&N(this,n,a,e)}Object.defineProperties(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return q.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return q.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return q.defined("distance",this._distance),this._endHeading}}});E.prototype.setEndPoints=function(n,a){q.defined("start",n),q.defined("end",a),N(this,n,a,this._ellipsoid)};E.prototype.interpolateUsingFraction=function(n,a){return this.interpolateUsingSurfaceDistance(this._distance*n,a)};E.prototype.interpolateUsingSurfaceDistance=function(n,a){q.defined("distance",this._distance);let t=this._constants,e=t.distanceRatio+n/t.b,f=Math.cos(2*e),m=Math.cos(4*e),_=Math.cos(6*e),r=Math.sin(2*e),p=Math.sin(4*e),R=Math.sin(6*e),M=Math.sin(8*e),l=e*e,U=e*l,i=t.u8Over256,A=t.u2Over4,c=t.u6Over64,o=t.u4Over16,h=2*U*i*f/3+e*(1-A+7*o/4-15*c/4+579*i/64-(o-15*c/4+187*i/16)*f-(5*c/4-115*i/16)*m-29*i*_/16)+(A/2-o+71*c/32-85*i/16)*r+(5*o/16-5*c/4+383*i/96)*p-l*((c-11*i/2)*r+5*i*p/2)+(29*c/96-29*i/16)*R+539*i*M/1536,S=Math.asin(Math.sin(h)*t.cosineAlpha),u=Math.atan(t.a/t.b*Math.tan(S));h=h-t.sigma;let C=Math.cos(2*t.sigma+h),d=Math.sin(h),g=Math.cos(h),w=t.cosineU*g,s=t.sineU*d,H=Math.atan2(d*t.sineHeading,w-s*t.cosineHeading)-k(t.f,t.sineAlpha,t.cosineSquaredAlpha,h,d,g,C);return T(a)?(a.longitude=this._start.longitude+H,a.latitude=u,a.height=0,a):new P(this._start.longitude+H,u,0)};var et=E;export{et as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-OSVSBQDY.js b/plugins/feature/map/Cesium/Workers/chunk-OSVSBQDY.js new file mode 100644 index 000000000..689952986 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-OSVSBQDY.js @@ -0,0 +1,28 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as N}from"./chunk-LZC73BOP.js";import{a as S,b as e}from"./chunk-OU2IPMYE.js";import{f as z}from"./chunk-H7SJWKIY.js";var h=class p{constructor(n,o,c){this.x=n??0,this.y=o??0,this.z=c??0}static fromSpherical(n,o){e.typeOf.object("spherical",n),z(o)||(o=new p);let c=n.clock,t=n.cone,y=n.magnitude??1,O=y*Math.sin(t);return o.x=O*Math.cos(c),o.y=O*Math.sin(c),o.z=y*Math.cos(t),o}static fromElements(n,o,c,t){return z(t)?(t.x=n,t.y=o,t.z=c,t):new p(n,o,c)}static clone(n,o){if(z(n))return z(o)?(o.x=n.x,o.y=n.y,o.z=n.z,o):new p(n.x,n.y,n.z)}static pack(n,o,c){return e.typeOf.object("value",n),e.defined("array",o),c=c??0,o[c++]=n.x,o[c++]=n.y,o[c]=n.z,o}static unpack(n,o,c){return e.defined("array",n),o=o??0,z(c)||(c=new p),c.x=n[o++],c.y=n[o++],c.z=n[o],c}static packArray(n,o){e.defined("array",n);let c=n.length,t=c*3;if(!z(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 3 elements");o.length!==t&&(o.length=t)}for(let y=0;y<c;++y)p.pack(n[y],o,y*3);return o}static unpackArray(n,o){if(e.defined("array",n),e.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new S("array length must be a multiple of 3.");let c=n.length;z(o)?o.length=c/3:o=new Array(c/3);for(let t=0;t<c;t+=3){let y=t/3;o[y]=p.unpack(n,t,o[y])}return o}static maximumComponent(n){return e.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)}static minimumComponent(n){return e.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)}static minimumByComponent(n,o,c){return e.typeOf.object("first",n),e.typeOf.object("second",o),e.typeOf.object("result",c),c.x=Math.min(n.x,o.x),c.y=Math.min(n.y,o.y),c.z=Math.min(n.z,o.z),c}static maximumByComponent(n,o,c){return e.typeOf.object("first",n),e.typeOf.object("second",o),e.typeOf.object("result",c),c.x=Math.max(n.x,o.x),c.y=Math.max(n.y,o.y),c.z=Math.max(n.z,o.z),c}static clamp(n,o,c,t){e.typeOf.object("value",n),e.typeOf.object("min",o),e.typeOf.object("max",c),e.typeOf.object("result",t);let y=N.clamp(n.x,o.x,c.x),O=N.clamp(n.y,o.y,c.y),b=N.clamp(n.z,o.z,c.z);return t.x=y,t.y=O,t.z=b,t}static magnitudeSquared(n){return e.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z}static magnitude(n){return Math.sqrt(p.magnitudeSquared(n))}static distance(n,o){return e.typeOf.object("left",n),e.typeOf.object("right",o),p.subtract(n,o,U),p.magnitude(U)}static distanceSquared(n,o){return e.typeOf.object("left",n),e.typeOf.object("right",o),p.subtract(n,o,U),p.magnitudeSquared(U)}static normalize(n,o){e.typeOf.object("cartesian",n),e.typeOf.object("result",o);let c=p.magnitude(n);if(o.x=n.x/c,o.y=n.y/c,o.z=n.z/c,isNaN(o.x)||isNaN(o.y)||isNaN(o.z))throw new S("normalized result is not a number");return o}static dot(n,o){return e.typeOf.object("left",n),e.typeOf.object("right",o),n.x*o.x+n.y*o.y+n.z*o.z}static multiplyComponents(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c.x=n.x*o.x,c.y=n.y*o.y,c.z=n.z*o.z,c}static divideComponents(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c.x=n.x/o.x,c.y=n.y/o.y,c.z=n.z/o.z,c}static add(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c.x=n.x+o.x,c.y=n.y+o.y,c.z=n.z+o.z,c}static subtract(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c.x=n.x-o.x,c.y=n.y-o.y,c.z=n.z-o.z,c}static multiplyByScalar(n,o,c){return e.typeOf.object("cartesian",n),e.typeOf.number("scalar",o),e.typeOf.object("result",c),c.x=n.x*o,c.y=n.y*o,c.z=n.z*o,c}static divideByScalar(n,o,c){return e.typeOf.object("cartesian",n),e.typeOf.number("scalar",o),e.typeOf.object("result",c),c.x=n.x/o,c.y=n.y/o,c.z=n.z/o,c}static negate(n,o){return e.typeOf.object("cartesian",n),e.typeOf.object("result",o),o.x=-n.x,o.y=-n.y,o.z=-n.z,o}static abs(n,o){return e.typeOf.object("cartesian",n),e.typeOf.object("result",o),o.x=Math.abs(n.x),o.y=Math.abs(n.y),o.z=Math.abs(n.z),o}static lerp(n,o,c,t){return e.typeOf.object("start",n),e.typeOf.object("end",o),e.typeOf.number("t",c),e.typeOf.object("result",t),p.multiplyByScalar(o,c,V),t=p.multiplyByScalar(n,1-c,t),p.add(V,t,t)}static angleBetween(n,o){e.typeOf.object("left",n),e.typeOf.object("right",o),p.normalize(n,i),p.normalize(o,L);let c=p.dot(i,L),t=p.magnitude(p.cross(i,L,i));return Math.atan2(t,c)}static mostOrthogonalAxis(n,o){e.typeOf.object("cartesian",n),e.typeOf.object("result",o);let c=p.normalize(n,I);return p.abs(c,c),c.x<=c.y?c.x<=c.z?o=p.clone(p.UNIT_X,o):o=p.clone(p.UNIT_Z,o):c.y<=c.z?o=p.clone(p.UNIT_Y,o):o=p.clone(p.UNIT_Z,o),o}static projectVector(n,o,c){e.defined("a",n),e.defined("b",o),e.defined("result",c);let t=p.dot(n,o)/p.dot(o,o);return p.multiplyByScalar(o,t,c)}static equals(n,o){return n===o||z(n)&&z(o)&&n.x===o.x&&n.y===o.y&&n.z===o.z}static equalsArray(n,o,c){return n.x===o[c]&&n.y===o[c+1]&&n.z===o[c+2]}static equalsEpsilon(n,o,c,t){return n===o||z(n)&&z(o)&&N.equalsEpsilon(n.x,o.x,c,t)&&N.equalsEpsilon(n.y,o.y,c,t)&&N.equalsEpsilon(n.z,o.z,c,t)}static cross(n,o,c){e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c);let t=n.x,y=n.y,O=n.z,b=o.x,f=o.y,j=o.z,m=y*j-O*f,M=O*b-t*j,d=t*f-y*b;return c.x=m,c.y=M,c.z=d,c}static midpoint(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c.x=(n.x+o.x)*.5,c.y=(n.y+o.y)*.5,c.z=(n.z+o.z)*.5,c}static fromDegrees(n,o,c,t,y){return e.typeOf.number("longitude",n),e.typeOf.number("latitude",o),n=N.toRadians(n),o=N.toRadians(o),p.fromRadians(n,o,c,t,y)}static fromRadians(n,o,c,t,y){e.typeOf.number("longitude",n),e.typeOf.number("latitude",o),c=c??0;let O=z(t)?t.radiiSquared:p._ellipsoidRadiiSquared,b=Math.cos(o);E.x=b*Math.cos(n),E.y=b*Math.sin(n),E.z=Math.sin(o),E=p.normalize(E,E),p.multiplyComponents(O,E,A);let f=Math.sqrt(p.dot(E,A));return A=p.divideByScalar(A,f,A),E=p.multiplyByScalar(E,c,E),z(y)||(y=new p),p.add(A,E,y)}static fromDegreesArray(n,o,c){if(e.defined("coordinates",n),n.length<2||n.length%2!==0)throw new S("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;z(c)?c.length=t/2:c=new Array(t/2);for(let y=0;y<t;y+=2){let O=n[y],b=n[y+1],f=y/2;c[f]=p.fromDegrees(O,b,0,o,c[f])}return c}static fromRadiansArray(n,o,c){if(e.defined("coordinates",n),n.length<2||n.length%2!==0)throw new S("the number of coordinates must be a multiple of 2 and at least 2");let t=n.length;z(c)?c.length=t/2:c=new Array(t/2);for(let y=0;y<t;y+=2){let O=n[y],b=n[y+1],f=y/2;c[f]=p.fromRadians(O,b,0,o,c[f])}return c}static fromDegreesArrayHeights(n,o,c){if(e.defined("coordinates",n),n.length<3||n.length%3!==0)throw new S("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;z(c)?c.length=t/3:c=new Array(t/3);for(let y=0;y<t;y+=3){let O=n[y],b=n[y+1],f=n[y+2],j=y/3;c[j]=p.fromDegrees(O,b,f,o,c[j])}return c}static fromRadiansArrayHeights(n,o,c){if(e.defined("coordinates",n),n.length<3||n.length%3!==0)throw new S("the number of coordinates must be a multiple of 3 and at least 3");let t=n.length;z(c)?c.length=t/3:c=new Array(t/3);for(let y=0;y<t;y+=3){let O=n[y],b=n[y+1],f=n[y+2],j=y/3;c[j]=p.fromRadians(O,b,f,o,c[j])}return c}clone(n){return p.clone(this,n)}equals(n){return p.equals(this,n)}equalsEpsilon(n,o,c){return p.equalsEpsilon(this,n,o,c)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};h.fromCartesian4=h.clone;h.packedLength=3;h.fromArray=h.unpack;var U=new h,V=new h,i=new h,L=new h,I=new h,E=new h,A=new h;h._ellipsoidRadiiSquared=new h(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);h.ZERO=Object.freeze(new h(0,0,0));h.ONE=Object.freeze(new h(1,1,1));h.UNIT_X=Object.freeze(new h(1,0,0));h.UNIT_Y=Object.freeze(new h(0,1,0));h.UNIT_Z=Object.freeze(new h(0,0,1));var a=h;var J=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),w=class p{constructor(n,o,c,t,y,O,b,f,j){let m=Reflect.construct(Array,J,new.target);return m[0]=n??0,m[1]=t??0,m[2]=b??0,m[3]=o??0,m[4]=y??0,m[5]=f??0,m[6]=c??0,m[7]=O??0,m[8]=j??0,m}static pack(n,o,c){return e.typeOf.object("value",n),e.defined("array",o),c=c??0,o[c++]=n[0],o[c++]=n[1],o[c++]=n[2],o[c++]=n[3],o[c++]=n[4],o[c++]=n[5],o[c++]=n[6],o[c++]=n[7],o[c]=n[8],o}static unpack(n,o,c){return e.defined("array",n),o=o??0,z(c)||(c=new p),c[0]=n[o++],c[1]=n[o++],c[2]=n[o++],c[3]=n[o++],c[4]=n[o++],c[5]=n[o++],c[6]=n[o++],c[7]=n[o++],c[8]=n[o],c}static packArray(n,o){e.defined("array",n);let c=n.length,t=c*9;if(!z(o))o=new Array(t);else{if(!Array.isArray(o)&&o.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 9 elements");o.length!==t&&(o.length=t)}for(let y=0;y<c;++y)p.pack(n[y],o,y*9);return o}static unpackArray(n,o){if(e.defined("array",n),e.typeOf.number.greaterThanOrEquals("array.length",n.length,9),n.length%9!==0)throw new S("array length must be a multiple of 9.");let c=n.length;z(o)?o.length=c/9:o=new Array(c/9);for(let t=0;t<c;t+=9){let y=t/9;o[y]=p.unpack(n,t,o[y])}return o}static clone(n,o){if(z(n))return z(o)?(o[0]=n[0],o[1]=n[1],o[2]=n[2],o[3]=n[3],o[4]=n[4],o[5]=n[5],o[6]=n[6],o[7]=n[7],o[8]=n[8],o):new p(n[0],n[3],n[6],n[1],n[4],n[7],n[2],n[5],n[8])}static fromColumnMajorArray(n,o){return e.defined("values",n),p.clone(n,o)}static fromRowMajorArray(n,o){return e.defined("values",n),z(o)?(o[0]=n[0],o[1]=n[3],o[2]=n[6],o[3]=n[1],o[4]=n[4],o[5]=n[7],o[6]=n[2],o[7]=n[5],o[8]=n[8],o):new p(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])}static fromQuaternion(n,o){e.typeOf.object("quaternion",n);let c=n.x*n.x,t=n.x*n.y,y=n.x*n.z,O=n.x*n.w,b=n.y*n.y,f=n.y*n.z,j=n.y*n.w,m=n.z*n.z,M=n.z*n.w,d=n.w*n.w,R=c-b-m+d,T=2*(t-M),q=2*(y+j),C=2*(t+M),k=-c+b-m+d,Z=2*(f-O),W=2*(y-j),X=2*(f+O),P=-c-b+m+d;return z(o)?(o[0]=R,o[1]=C,o[2]=W,o[3]=T,o[4]=k,o[5]=X,o[6]=q,o[7]=Z,o[8]=P,o):new p(R,T,q,C,k,Z,W,X,P)}static fromHeadingPitchRoll(n,o){e.typeOf.object("headingPitchRoll",n);let c=Math.cos(-n.pitch),t=Math.cos(-n.heading),y=Math.cos(n.roll),O=Math.sin(-n.pitch),b=Math.sin(-n.heading),f=Math.sin(n.roll),j=c*t,m=-y*b+f*O*t,M=f*b+y*O*t,d=c*b,R=y*t+f*O*b,T=-f*t+y*O*b,q=-O,C=f*c,k=y*c;return z(o)?(o[0]=j,o[1]=d,o[2]=q,o[3]=m,o[4]=R,o[5]=C,o[6]=M,o[7]=T,o[8]=k,o):new p(j,m,M,d,R,T,q,C,k)}static fromScale(n,o){return e.typeOf.object("scale",n),z(o)?(o[0]=n.x,o[1]=0,o[2]=0,o[3]=0,o[4]=n.y,o[5]=0,o[6]=0,o[7]=0,o[8]=n.z,o):new p(n.x,0,0,0,n.y,0,0,0,n.z)}static fromUniformScale(n,o){return e.typeOf.number("scale",n),z(o)?(o[0]=n,o[1]=0,o[2]=0,o[3]=0,o[4]=n,o[5]=0,o[6]=0,o[7]=0,o[8]=n,o):new p(n,0,0,0,n,0,0,0,n)}static fromCrossProduct(n,o){return e.typeOf.object("vector",n),z(o)?(o[0]=0,o[1]=n.z,o[2]=-n.y,o[3]=-n.z,o[4]=0,o[5]=n.x,o[6]=n.y,o[7]=-n.x,o[8]=0,o):new p(0,-n.z,n.y,n.z,0,-n.x,-n.y,n.x,0)}static fromRotationX(n,o){e.typeOf.number("angle",n);let c=Math.cos(n),t=Math.sin(n);return z(o)?(o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=c,o[5]=t,o[6]=0,o[7]=-t,o[8]=c,o):new p(1,0,0,0,c,-t,0,t,c)}static fromRotationY(n,o){e.typeOf.number("angle",n);let c=Math.cos(n),t=Math.sin(n);return z(o)?(o[0]=c,o[1]=0,o[2]=-t,o[3]=0,o[4]=1,o[5]=0,o[6]=t,o[7]=0,o[8]=c,o):new p(c,0,t,0,1,0,-t,0,c)}static fromRotationZ(n,o){e.typeOf.number("angle",n);let c=Math.cos(n),t=Math.sin(n);return z(o)?(o[0]=c,o[1]=t,o[2]=0,o[3]=-t,o[4]=c,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o):new p(c,-t,0,t,c,0,0,0,1)}static toArray(n,o){return e.typeOf.object("matrix",n),z(o)?(o[0]=n[0],o[1]=n[1],o[2]=n[2],o[3]=n[3],o[4]=n[4],o[5]=n[5],o[6]=n[6],o[7]=n[7],o[8]=n[8],o):[n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8]]}static getElementIndex(n,o){return e.typeOf.number.greaterThanOrEquals("row",o,0),e.typeOf.number.lessThanOrEquals("row",o,2),e.typeOf.number.greaterThanOrEquals("column",n,0),e.typeOf.number.lessThanOrEquals("column",n,2),n*3+o}static getColumn(n,o,c){e.typeOf.object("matrix",n),e.typeOf.number.greaterThanOrEquals("index",o,0),e.typeOf.number.lessThanOrEquals("index",o,2),e.typeOf.object("result",c);let t=o*3,y=n[t],O=n[t+1],b=n[t+2];return c.x=y,c.y=O,c.z=b,c}static setColumn(n,o,c,t){e.typeOf.object("matrix",n),e.typeOf.number.greaterThanOrEquals("index",o,0),e.typeOf.number.lessThanOrEquals("index",o,2),e.typeOf.object("cartesian",c),e.typeOf.object("result",t),t=p.clone(n,t);let y=o*3;return t[y]=c.x,t[y+1]=c.y,t[y+2]=c.z,t}static getRow(n,o,c){e.typeOf.object("matrix",n),e.typeOf.number.greaterThanOrEquals("index",o,0),e.typeOf.number.lessThanOrEquals("index",o,2),e.typeOf.object("result",c);let t=n[o],y=n[o+3],O=n[o+6];return c.x=t,c.y=y,c.z=O,c}static setRow(n,o,c,t){return e.typeOf.object("matrix",n),e.typeOf.number.greaterThanOrEquals("index",o,0),e.typeOf.number.lessThanOrEquals("index",o,2),e.typeOf.object("cartesian",c),e.typeOf.object("result",t),t=p.clone(n,t),t[o]=c.x,t[o+3]=c.y,t[o+6]=c.z,t}static setScale(n,o,c){e.typeOf.object("matrix",n),e.typeOf.object("scale",o),e.typeOf.object("result",c);let t=p.getScale(n,K),y=o.x/t.x,O=o.y/t.y,b=o.z/t.z;return c[0]=n[0]*y,c[1]=n[1]*y,c[2]=n[2]*y,c[3]=n[3]*O,c[4]=n[4]*O,c[5]=n[5]*O,c[6]=n[6]*b,c[7]=n[7]*b,c[8]=n[8]*b,c}static setUniformScale(n,o,c){e.typeOf.object("matrix",n),e.typeOf.number("scale",o),e.typeOf.object("result",c);let t=p.getScale(n,Q),y=o/t.x,O=o/t.y,b=o/t.z;return c[0]=n[0]*y,c[1]=n[1]*y,c[2]=n[2]*y,c[3]=n[3]*O,c[4]=n[4]*O,c[5]=n[5]*O,c[6]=n[6]*b,c[7]=n[7]*b,c[8]=n[8]*b,c}static getScale(n,o){return e.typeOf.object("matrix",n),e.typeOf.object("result",o),o.x=a.magnitude(a.fromElements(n[0],n[1],n[2],g)),o.y=a.magnitude(a.fromElements(n[3],n[4],n[5],g)),o.z=a.magnitude(a.fromElements(n[6],n[7],n[8],g)),o}static getMaximumScale(n){return p.getScale(n,F),a.maximumComponent(F)}static setRotation(n,o,c){e.typeOf.object("matrix",n),e.typeOf.object("result",c);let t=p.getScale(n,G);return c[0]=o[0]*t.x,c[1]=o[1]*t.x,c[2]=o[2]*t.x,c[3]=o[3]*t.y,c[4]=o[4]*t.y,c[5]=o[5]*t.y,c[6]=o[6]*t.z,c[7]=o[7]*t.z,c[8]=o[8]*t.z,c}static getRotation(n,o){e.typeOf.object("matrix",n),e.typeOf.object("result",o);let c=p.getScale(n,s);return o[0]=n[0]/c.x,o[1]=n[1]/c.x,o[2]=n[2]/c.x,o[3]=n[3]/c.y,o[4]=n[4]/c.y,o[5]=n[5]/c.y,o[6]=n[6]/c.z,o[7]=n[7]/c.z,o[8]=n[8]/c.z,o}static multiply(n,o,c){e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c);let t=n[0]*o[0]+n[3]*o[1]+n[6]*o[2],y=n[1]*o[0]+n[4]*o[1]+n[7]*o[2],O=n[2]*o[0]+n[5]*o[1]+n[8]*o[2],b=n[0]*o[3]+n[3]*o[4]+n[6]*o[5],f=n[1]*o[3]+n[4]*o[4]+n[7]*o[5],j=n[2]*o[3]+n[5]*o[4]+n[8]*o[5],m=n[0]*o[6]+n[3]*o[7]+n[6]*o[8],M=n[1]*o[6]+n[4]*o[7]+n[7]*o[8],d=n[2]*o[6]+n[5]*o[7]+n[8]*o[8];return c[0]=t,c[1]=y,c[2]=O,c[3]=b,c[4]=f,c[5]=j,c[6]=m,c[7]=M,c[8]=d,c}static add(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c[0]=n[0]+o[0],c[1]=n[1]+o[1],c[2]=n[2]+o[2],c[3]=n[3]+o[3],c[4]=n[4]+o[4],c[5]=n[5]+o[5],c[6]=n[6]+o[6],c[7]=n[7]+o[7],c[8]=n[8]+o[8],c}static subtract(n,o,c){return e.typeOf.object("left",n),e.typeOf.object("right",o),e.typeOf.object("result",c),c[0]=n[0]-o[0],c[1]=n[1]-o[1],c[2]=n[2]-o[2],c[3]=n[3]-o[3],c[4]=n[4]-o[4],c[5]=n[5]-o[5],c[6]=n[6]-o[6],c[7]=n[7]-o[7],c[8]=n[8]-o[8],c}static multiplyByVector(n,o,c){e.typeOf.object("matrix",n),e.typeOf.object("cartesian",o),e.typeOf.object("result",c);let t=o.x,y=o.y,O=o.z,b=n[0]*t+n[3]*y+n[6]*O,f=n[1]*t+n[4]*y+n[7]*O,j=n[2]*t+n[5]*y+n[8]*O;return c.x=b,c.y=f,c.z=j,c}static multiplyByScalar(n,o,c){return e.typeOf.object("matrix",n),e.typeOf.number("scalar",o),e.typeOf.object("result",c),c[0]=n[0]*o,c[1]=n[1]*o,c[2]=n[2]*o,c[3]=n[3]*o,c[4]=n[4]*o,c[5]=n[5]*o,c[6]=n[6]*o,c[7]=n[7]*o,c[8]=n[8]*o,c}static multiplyByScale(n,o,c){return e.typeOf.object("matrix",n),e.typeOf.object("scale",o),e.typeOf.object("result",c),c[0]=n[0]*o.x,c[1]=n[1]*o.x,c[2]=n[2]*o.x,c[3]=n[3]*o.y,c[4]=n[4]*o.y,c[5]=n[5]*o.y,c[6]=n[6]*o.z,c[7]=n[7]*o.z,c[8]=n[8]*o.z,c}static multiplyByUniformScale(n,o,c){return e.typeOf.object("matrix",n),e.typeOf.number("scale",o),e.typeOf.object("result",c),c[0]=n[0]*o,c[1]=n[1]*o,c[2]=n[2]*o,c[3]=n[3]*o,c[4]=n[4]*o,c[5]=n[5]*o,c[6]=n[6]*o,c[7]=n[7]*o,c[8]=n[8]*o,c}static negate(n,o){return e.typeOf.object("matrix",n),e.typeOf.object("result",o),o[0]=-n[0],o[1]=-n[1],o[2]=-n[2],o[3]=-n[3],o[4]=-n[4],o[5]=-n[5],o[6]=-n[6],o[7]=-n[7],o[8]=-n[8],o}static transpose(n,o){e.typeOf.object("matrix",n),e.typeOf.object("result",o);let c=n[0],t=n[3],y=n[6],O=n[1],b=n[4],f=n[7],j=n[2],m=n[5],M=n[8];return o[0]=c,o[1]=t,o[2]=y,o[3]=O,o[4]=b,o[5]=f,o[6]=j,o[7]=m,o[8]=M,o}static computeEigenDecomposition(n,o){e.typeOf.object("matrix",n);let c=N.EPSILON20,t=10,y=0,O=0;z(o)||(o={});let b=o.unitary=p.clone(p.IDENTITY,o.unitary),f=o.diagonal=p.clone(n,o.diagonal),j=c*x(f);for(;O<t&&_(f)>j;)u(f,B),p.transpose(B,H),p.multiply(f,B,f),p.multiply(H,f,f),p.multiply(b,B,b),++y>2&&(++O,y=0);return o}static abs(n,o){return e.typeOf.object("matrix",n),e.typeOf.object("result",o),o[0]=Math.abs(n[0]),o[1]=Math.abs(n[1]),o[2]=Math.abs(n[2]),o[3]=Math.abs(n[3]),o[4]=Math.abs(n[4]),o[5]=Math.abs(n[5]),o[6]=Math.abs(n[6]),o[7]=Math.abs(n[7]),o[8]=Math.abs(n[8]),o}static determinant(n){e.typeOf.object("matrix",n);let o=n[0],c=n[3],t=n[6],y=n[1],O=n[4],b=n[7],f=n[2],j=n[5],m=n[8];return o*(O*m-j*b)+y*(j*t-c*m)+f*(c*b-O*t)}static inverse(n,o){e.typeOf.object("matrix",n),e.typeOf.object("result",o);let c=n[0],t=n[1],y=n[2],O=n[3],b=n[4],f=n[5],j=n[6],m=n[7],M=n[8],d=p.determinant(n);if(Math.abs(d)<=N.EPSILON15)throw new S("matrix is not invertible");o[0]=b*M-m*f,o[1]=m*y-t*M,o[2]=t*f-b*y,o[3]=j*f-O*M,o[4]=c*M-j*y,o[5]=O*y-c*f,o[6]=O*m-j*b,o[7]=j*t-c*m,o[8]=c*b-O*t;let R=1/d;return p.multiplyByScalar(o,R,o)}static inverseTranspose(n,o){return e.typeOf.object("matrix",n),e.typeOf.object("result",o),p.inverse(p.transpose(n,v),o)}static equals(n,o){return n===o||z(n)&&z(o)&&n[0]===o[0]&&n[1]===o[1]&&n[2]===o[2]&&n[3]===o[3]&&n[4]===o[4]&&n[5]===o[5]&&n[6]===o[6]&&n[7]===o[7]&&n[8]===o[8]}static equalsEpsilon(n,o,c){return c=c??0,n===o||z(n)&&z(o)&&Math.abs(n[0]-o[0])<=c&&Math.abs(n[1]-o[1])<=c&&Math.abs(n[2]-o[2])<=c&&Math.abs(n[3]-o[3])<=c&&Math.abs(n[4]-o[4])<=c&&Math.abs(n[5]-o[5])<=c&&Math.abs(n[6]-o[6])<=c&&Math.abs(n[7]-o[7])<=c&&Math.abs(n[8]-o[8])<=c}get length(){return p.packedLength}clone(n){return p.clone(this,n)}equals(n){return p.equals(this,n)}static equalsArray(n,o,c){return n[0]===o[c]&&n[1]===o[c+1]&&n[2]===o[c+2]&&n[3]===o[c+3]&&n[4]===o[c+4]&&n[5]===o[c+5]&&n[6]===o[c+6]&&n[7]===o[c+7]&&n[8]===o[c+8]}equalsEpsilon(n,o){return p.equalsEpsilon(this,n,o)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) +(${this[1]}, ${this[4]}, ${this[7]}) +(${this[2]}, ${this[5]}, ${this[8]})`}};w.packedLength=9;w.fromArray=w.unpack;w.IDENTITY=new w(1,0,0,0,1,0,0,0,1);w.ZERO=new w(0,0,0,0,0,0,0,0,0);w.COLUMN0ROW0=0;w.COLUMN0ROW1=1;w.COLUMN0ROW2=2;w.COLUMN1ROW0=3;w.COLUMN1ROW1=4;w.COLUMN1ROW2=5;w.COLUMN2ROW0=6;w.COLUMN2ROW1=7;w.COLUMN2ROW2=8;var K=new a,Q=new a,g=new a,F=new a,G=new a,s=new a,B=new w,H=new w,v=new w;function x(p){let n=0;for(let o=0;o<9;++o){let c=p[o];n+=c*c}return Math.sqrt(n)}var D=[1,0,0],Y=[2,2,1];function _(p){let n=0;for(let o=0;o<3;++o){let c=p[w.getElementIndex(Y[o],D[o])];n+=2*c*c}return Math.sqrt(n)}function u(p,n){let o=N.EPSILON15,c=0,t=1;for(let j=0;j<3;++j){let m=Math.abs(p[w.getElementIndex(Y[j],D[j])]);m>c&&(t=j,c=m)}let y=1,O=0,b=D[t],f=Y[t];if(Math.abs(p[w.getElementIndex(f,b)])>o){let j=p[w.getElementIndex(f,f)],m=p[w.getElementIndex(b,b)],M=p[w.getElementIndex(f,b)],d=(j-m)/2/M,R;d<0?R=-1/(-d+Math.sqrt(1+d*d)):R=1/(d+Math.sqrt(1+d*d)),y=1/Math.sqrt(1+R*R),O=R*y}return n=w.clone(w.IDENTITY,n),n[w.getElementIndex(b,b)]=n[w.getElementIndex(f,f)]=y,n[w.getElementIndex(f,b)]=O,n[w.getElementIndex(b,f)]=-O,n}var bn=w;var $={};$.EMPTY_OBJECT=Object.freeze({});$.EMPTY_ARRAY=Object.freeze([]);var jn=$;export{a,bn as b,jn as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ELJAHN3H.js b/plugins/feature/map/Cesium/Workers/chunk-OU2IPMYE.js similarity index 96% rename from plugins/feature/map/Cesium/Workers/chunk-ELJAHN3H.js rename to plugins/feature/map/Cesium/Workers/chunk-OU2IPMYE.js index 720f94047..0f829ad17 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-ELJAHN3H.js +++ b/plugins/feature/map/Cesium/Workers/chunk-OU2IPMYE.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,5 +23,5 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{e as u}from"./chunk-3BGP4HCL.js";function f(t){this.name="DeveloperError",this.message=t;let e;try{throw new Error}catch(o){e=o.stack}this.stack=e}u(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f);f.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return u(this.stack)&&(t+=` +import{f as u}from"./chunk-H7SJWKIY.js";function f(t){this.name="DeveloperError",this.message=t;let e;try{throw new Error}catch(o){e=o.stack}this.stack=e}u(Object.create)&&(f.prototype=Object.create(Error.prototype),f.prototype.constructor=f);f.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return u(this.stack)&&(t+=` ${this.stack.toString()}`),t};f.throwInstantiationError=function(){throw new f("This function defines an interface and should not be called directly.")};var r=f;var n={};n.typeOf={};function c(t){return`${t} is required, actual value was undefined`}function a(t,e,o){return`Expected ${o} to be typeof ${e}, actual typeof was ${t}`}n.defined=function(t,e){if(!u(e))throw new r(c(t))};n.typeOf.func=function(t,e){if(typeof e!="function")throw new r(a(typeof e,"function",t))};n.typeOf.string=function(t,e){if(typeof e!="string")throw new r(a(typeof e,"string",t))};n.typeOf.number=function(t,e){if(typeof e!="number")throw new r(a(typeof e,"number",t))};n.typeOf.number.lessThan=function(t,e,o){if(n.typeOf.number(t,e),e>=o)throw new r(`Expected ${t} to be less than ${o}, actual value was ${e}`)};n.typeOf.number.lessThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e>o)throw new r(`Expected ${t} to be less than or equal to ${o}, actual value was ${e}`)};n.typeOf.number.greaterThan=function(t,e,o){if(n.typeOf.number(t,e),e<=o)throw new r(`Expected ${t} to be greater than ${o}, actual value was ${e}`)};n.typeOf.number.greaterThanOrEquals=function(t,e,o){if(n.typeOf.number(t,e),e<o)throw new r(`Expected ${t} to be greater than or equal to ${o}, actual value was ${e}`)};n.typeOf.object=function(t,e){if(typeof e!="object")throw new r(a(typeof e,"object",t))};n.typeOf.bool=function(t,e){if(typeof e!="boolean")throw new r(a(typeof e,"boolean",t))};n.typeOf.bigint=function(t,e){if(typeof e!="bigint")throw new r(a(typeof e,"bigint",t))};n.typeOf.number.equals=function(t,e,o,i){if(n.typeOf.number(t,o),n.typeOf.number(e,i),o!==i)throw new r(`${t} must be equal to ${e}, the actual values are ${o} and ${i}`)};var l=n;export{r as a,l as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-4OIYAFXA.js b/plugins/feature/map/Cesium/Workers/chunk-PICDM7L2.js similarity index 82% rename from plugins/feature/map/Cesium/Workers/chunk-4OIYAFXA.js rename to plugins/feature/map/Cesium/Workers/chunk-PICDM7L2.js index 92df37804..9ac0758f9 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-4OIYAFXA.js +++ b/plugins/feature/map/Cesium/Workers/chunk-PICDM7L2.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{b as r}from"./chunk-3PT5NNSP.js";import{f as m}from"./chunk-FGKVHLJ4.js";import{a as i}from"./chunk-ELJAHN3H.js";import{e as t}from"./chunk-3BGP4HCL.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; +import{b as r}from"./chunk-HLXNFZAZ.js";import{c as m}from"./chunk-OSVSBQDY.js";import{a as i}from"./chunk-OU2IPMYE.js";import{f as t}from"./chunk-H7SJWKIY.js";function d(e){if(e=e??m.EMPTY_OBJECT,!t(e.geometry))throw new i("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.clone(e.modelMatrix??r.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var a=d;export{a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-PNMU44JZ.js b/plugins/feature/map/Cesium/Workers/chunk-PNMU44JZ.js deleted file mode 100644 index 65bfca3be..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-PNMU44JZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as C}from"./chunk-YRCAQUFT.js";import{b as g}from"./chunk-ELJAHN3H.js";import{e as f}from"./chunk-3BGP4HCL.js";var d=C.EPSILON10;function x(e,r,h,n){if(g.defined("equalsEpsilon",r),!f(e))return;h=h??!1;let c=f(n),l=e.length;if(l<2)return e;let i,s=e[0],o,t,p=0,m=-1;for(i=1;i<l;++i)o=e[i],r(s,o,d)?(f(t)||(t=e.slice(0,i),p=i-1,m=0),c&&n.push(i)):(f(t)&&(t.push(o),p=i,c&&(m=n.length)),s=o);return h&&r(e[0],e[l-1],d)&&(c&&(f(t)?n.splice(m,0,p):n.push(l-1)),f(t)?t.length-=1:t=e.slice(0,-1)),f(t)?t:e}var k=x;export{k as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-3RMLTUUP.js b/plugins/feature/map/Cesium/Workers/chunk-PPEMEUUU.js similarity index 94% rename from plugins/feature/map/Cesium/Workers/chunk-3RMLTUUP.js rename to plugins/feature/map/Cesium/Workers/chunk-PPEMEUUU.js index ba1156d2f..6cc94eeba 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-3RMLTUUP.js +++ b/plugins/feature/map/Cesium/Workers/chunk-PPEMEUUU.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as U}from"./chunk-L4JCTZ6Y.js";import{a as b}from"./chunk-23RYXNR3.js";import{a as E}from"./chunk-JQLYZQ6V.js";import{a as z}from"./chunk-J3L5WX3X.js";import{c as B,d as D}from"./chunk-AVPLM4UI.js";import{a as V,d as y}from"./chunk-ZYYZDBKK.js";import{b as G}from"./chunk-3PT5NNSP.js";import{a as k}from"./chunk-WER4LUMF.js";import{d as F}from"./chunk-FGKVHLJ4.js";import{a as M,b as I}from"./chunk-ELJAHN3H.js";import{e as a}from"./chunk-3BGP4HCL.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; +import{a as U}from"./chunk-MQTDGHHT.js";import{a as b}from"./chunk-XUWPEWB7.js";import{a as E}from"./chunk-AZINMULF.js";import{a as z}from"./chunk-ILBQ77ZM.js";import{c as B,d as D}from"./chunk-7RNSURKI.js";import{a as V,c as y}from"./chunk-THB3EPLO.js";import{b as G}from"./chunk-HLXNFZAZ.js";import{a as k}from"./chunk-WCOEOHX5.js";import{c as F}from"./chunk-KP72RGCH.js";import{a as M,b as I}from"./chunk-OU2IPMYE.js";import{f as a}from"./chunk-H7SJWKIY.js";function v(e,n,t){e=e??0,n=n??0,t=t??0,this.value=new Float32Array([e,n,t])}Object.defineProperties(v.prototype,{componentDatatype:{get:function(){return k.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});v.fromCartesian3=function(e){return I.defined("offset",e),new v(e.x,e.y,e.z)};v.toValue=function(e,n){return I.defined("offset",e),a(n)||(n=new Float32Array([e.x,e.y,e.z])),n[0]=e.x,n[1]=e.y,n[2]=e.z,n};var $=v;function J(e,n,t){let i=!t,r=e.length,c;if(!i&&r>1){let o=e[0].modelMatrix;for(c=1;c<r;++c)if(!G.equals(o,e[c].modelMatrix)){i=!0;break}}if(i)for(c=0;c<r;++c)a(e[c].geometry)&&b.transformToWorldCoordinates(e[c]);else G.multiplyTransformation(n,e[0].modelMatrix,n)}function L(e,n){let t=e.attributes,i=t.position,r=i.values.length/i.componentsPerAttribute;t.batchId=new D({componentDatatype:k.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let c=t.batchId.values;for(let o=0;o<r;++o)c[o]=n}function K(e){let n=e.length;for(let t=0;t<n;++t){let i=e[t];a(i.geometry)?L(i.geometry,t):a(i.westHemisphereGeometry)&&a(i.eastHemisphereGeometry)&&(L(i.westHemisphereGeometry,t),L(i.eastHemisphereGeometry,t))}}function N(e){let n=e.instances,t=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,c=e.vertexCacheOptimize,o=e.compressVertices,g=e.modelMatrix,s,u,m,p=n.length;for(s=0;s<p;++s)if(a(n[s].geometry)){m=n[s].geometry.primitiveType;break}for(s=1;s<p;++s)if(a(n[s].geometry)&&n[s].geometry.primitiveType!==m)throw new M("All instance geometries must have the same primitiveType.");if(J(n,g,r),!r)for(s=0;s<p;++s)a(n[s].geometry)&&b.splitLongitude(n[s]);if(K(n),c)for(s=0;s<p;++s){let f=n[s];a(f.geometry)?(b.reorderForPostVertexCache(f.geometry),b.reorderForPreVertexCache(f.geometry)):a(f.westHemisphereGeometry)&&a(f.eastHemisphereGeometry)&&(b.reorderForPostVertexCache(f.westHemisphereGeometry),b.reorderForPreVertexCache(f.westHemisphereGeometry),b.reorderForPostVertexCache(f.eastHemisphereGeometry),b.reorderForPreVertexCache(f.eastHemisphereGeometry))}let l=b.combineInstances(n);for(p=l.length,s=0;s<p;++s){u=l[s];let f=u.attributes;if(r)for(let d in f)f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE&&b.encodeAttribute(u,d,`${d}3DHigh`,`${d}3DLow`);else for(let d in f)if(f.hasOwnProperty(d)&&f[d].componentDatatype===k.DOUBLE){let h=`${d}3D`,x=`${d}2D`;b.projectTo2D(u,d,h,x,t),a(u.boundingSphere)&&d==="position"&&(u.boundingSphereCV=y.fromVertices(u.attributes.position2D.values)),b.encodeAttribute(u,h,`${h}High`,`${h}Low`),b.encodeAttribute(u,x,`${x}High`,`${x}Low`)}o&&b.compressVertices(u)}if(!i){let f=[];for(p=l.length,s=0;s<p;++s)u=l[s],f=f.concat(b.fitToUnsignedShortIndices(u));l=f}return l}function P(e,n,t,i){let r,c,o,g=i.length-1;if(g>=0){let u=i[g];r=u.offset+u.count,o=u.index,c=t[o].indices.length}else r=0,o=0,c=t[o].indices.length;let s=e.length;for(let u=0;u<s;++u){let p=e[u][n];if(!a(p))continue;let l=p.indices.length;r+l>c&&(r=0,c=t[++o].indices.length),i.push({index:o,offset:r,count:l}),r+=l}}function Q(e,n){let t=[];return P(e,"geometry",n,t),P(e,"westHemisphereGeometry",n,t),P(e,"eastHemisphereGeometry",n,t),t}var S={};S.combineGeometry=function(e){let n,t,i=e.instances,r=i.length,c,o,g=!1;r>0&&(n=N(e),n.length>0&&(t=b.createAttributeLocations(n[0]),e.createPickOffsets&&(c=Q(i,n))),a(i[0].attributes)&&a(i[0].attributes.offset)&&(o=new Array(r),g=!0));let s=new Array(r),u=new Array(r);for(let m=0;m<r;++m){let p=i[m],l=p.geometry;a(l)&&(s[m]=l.boundingSphere,u[m]=l.boundingSphereCV,g&&(o[m]=p.geometry.offsetAttribute));let f=p.eastHemisphereGeometry,d=p.westHemisphereGeometry;a(f)&&a(d)&&(a(f.boundingSphere)&&a(d.boundingSphere)&&(s[m]=y.union(f.boundingSphere,d.boundingSphere)),a(f.boundingSphereCV)&&a(d.boundingSphereCV)&&(u[m]=y.union(f.boundingSphereCV,d.boundingSphereCV)))}return{geometries:n,modelMatrix:e.modelMatrix,attributeLocations:t,pickOffsets:c,offsetInstanceExtend:o,boundingSpheres:s,boundingSpheresCV:u}};function X(e,n){let t=e.attributes;for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];a(r)&&a(r.values)&&n.push(r.values.buffer)}a(e.indices)&&n.push(e.indices.buffer)}function Y(e,n){let t=e.length;for(let i=0;i<t;++i)X(e[i],n)}function Z(e){let n=1,t=e.length;for(let i=0;i<t;i++){let r=e[i];if(++n,!a(r))continue;let c=r.attributes;n+=7+2*y.packedLength+(a(r.indices)?r.indices.length:0);for(let o in c)if(c.hasOwnProperty(o)&&a(c[o])){let g=c[o];n+=5+g.values.length}}return n}S.packCreateGeometryResults=function(e,n){let t=new Float64Array(Z(e)),i=[],r={},c=e.length,o=0;t[o++]=c;for(let g=0;g<c;g++){let s=e[g],u=a(s);if(t[o++]=u?1:0,!u)continue;t[o++]=s.primitiveType,t[o++]=s.geometryType,t[o++]=s.offsetAttribute??-1;let m=a(s.boundingSphere)?1:0;t[o++]=m,m&&y.pack(s.boundingSphere,t,o),o+=y.packedLength;let p=a(s.boundingSphereCV)?1:0;t[o++]=p,p&&y.pack(s.boundingSphereCV,t,o),o+=y.packedLength;let l=s.attributes,f=[];for(let h in l)l.hasOwnProperty(h)&&a(l[h])&&(f.push(h),a(r[h])||(r[h]=i.length,i.push(h)));t[o++]=f.length;for(let h=0;h<f.length;h++){let x=f[h],C=l[x];t[o++]=r[x],t[o++]=C.componentDatatype,t[o++]=C.componentsPerAttribute,t[o++]=C.normalize?1:0,t[o++]=C.values.length,t.set(C.values,o),o+=C.values.length}let d=a(s.indices)?s.indices.length:0;t[o++]=d,d>0&&(t.set(s.indices,o),o+=d)}return n.push(t.buffer),{stringTable:i,packedData:t}};S.unpackCreateGeometryResults=function(e){let n=e.stringTable,t=e.packedData,i,r=new Array(t[0]),c=0,o=1;for(;o<t.length;){if(!(t[o++]===1)){r[c++]=void 0;continue}let s=t[o++],u=t[o++],m=t[o++];m===-1&&(m=void 0);let p,l;t[o++]===1&&(p=y.unpack(t,o)),o+=y.packedLength,t[o++]===1&&(l=y.unpack(t,o)),o+=y.packedLength;let h,x,C,T=new z,W=t[o++];for(i=0;i<W;i++){let A=n[t[o++]],H=t[o++];C=t[o++];let q=t[o++]!==0;h=t[o++],x=k.createTypedArray(H,h);for(let O=0;O<h;O++)x[O]=t[o++];T[A]=new D({componentDatatype:H,componentsPerAttribute:C,normalize:q,values:x})}let w;if(h=t[o++],h>0){let A=x.length/C;for(w=E.createTypedArray(A,h),i=0;i<h;i++)w[i]=t[o++]}r[c++]=new B({primitiveType:s,geometryType:u,boundingSphere:p,boundingSphereCV:l,indices:w,attributes:T,offsetAttribute:m})}return r};function _(e,n){let t=e.length,i=new Float64Array(1+t*19),r=0;i[r++]=t;for(let c=0;c<t;c++){let o=e[c];if(G.pack(o.modelMatrix,i,r),r+=G.packedLength,a(o.attributes)&&a(o.attributes.offset)){let g=o.attributes.offset.value;i[r]=g[0],i[r+1]=g[1],i[r+2]=g[2]}r+=3}return n.push(i.buffer),i}function ee(e){let n=e,t=new Array(n[0]),i=0,r=1;for(;r<n.length;){let c=G.unpack(n,r),o;r+=G.packedLength,a(n[r])&&(o={offset:new $(n[r],n[r+1],n[r+2])}),r+=3,t[i++]={modelMatrix:c,attributes:o}}return t}S.packCombineGeometryParameters=function(e,n){let t=e.createGeometryResults,i=t.length;for(let r=0;r<i;r++)n.push(t[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_(e.instances,n),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof V,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};S.unpackCombineGeometryParameters=function(e){let n=ee(e.packedInstances),t=e.createGeometryResults,i=t.length,r=0;for(let g=0;g<i;g++){let s=S.unpackCreateGeometryResults(t[g]),u=s.length;for(let m=0;m<u;m++){let p=s[m],l=n[r];l.geometry=p,++r}}let c=F.clone(e.ellipsoid),o=e.isGeographic?new V(c):new U(c);return{instances:n,ellipsoid:c,projection:o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:G.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function j(e){let n=e.length,t=1+(y.packedLength+1)*n,i=new Float32Array(t),r=0;i[r++]=n;for(let c=0;c<n;++c){let o=e[c];a(o)?(i[r++]=1,y.pack(e[c],i,r)):i[r++]=0,r+=y.packedLength}return i}function R(e){let n=new Array(e[0]),t=0,i=1;for(;i<e.length;)e[i++]===1&&(n[t]=y.unpack(e,i)),++t,i+=y.packedLength;return n}S.packCombineGeometryResults=function(e,n){a(e.geometries)&&Y(e.geometries,n);let t=j(e.boundingSpheres),i=j(e.boundingSpheresCV);return n.push(t.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:t,boundingSpheresCV:i}};S.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:R(e.boundingSpheres),boundingSpheresCV:R(e.boundingSpheresCV)}};var xe=S;export{xe as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-PUJTKPNP.js b/plugins/feature/map/Cesium/Workers/chunk-PUJTKPNP.js new file mode 100644 index 000000000..5c38d8317 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-PUJTKPNP.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as h}from"./chunk-XAERMS6D.js";import{b as y}from"./chunk-KP72RGCH.js";import{a as n,b as a}from"./chunk-OSVSBQDY.js";import{b as f}from"./chunk-OU2IPMYE.js";var x={},b=new n,P=new n,B=new n,M=new n,w=new h;x.validOutline=function(i){f.defined("positions",i);let o=h.fromPoints(i,w).halfAxes,e=a.getColumn(o,0,P),r=a.getColumn(o,1,B),t=a.getColumn(o,2,M),u=n.magnitude(e),s=n.magnitude(r),l=n.magnitude(t);return!(u===0&&(s===0||l===0)||s===0&&l===0)};x.computeProjectTo2DArguments=function(i,c,o,e){f.defined("positions",i),f.defined("centerResult",c),f.defined("planeAxis1Result",o),f.defined("planeAxis2Result",e);let r=h.fromPoints(i,w),t=r.halfAxes,u=a.getColumn(t,0,P),s=a.getColumn(t,1,B),l=a.getColumn(t,2,M),A=n.magnitude(u),d=n.magnitude(s),g=n.magnitude(l),m=Math.min(A,d,g);if(A===0&&(d===0||g===0)||d===0&&g===0)return!1;let p,C;return(m===d||m===g)&&(p=u),m===A?p=s:m===g&&(C=s),(m===A||m===d)&&(C=l),n.normalize(p,o),n.normalize(C,e),n.clone(r.center,c),!0};function z(i,c,o,e,r){let t=n.subtract(i,c,b),u=n.dot(o,t),s=n.dot(e,t);return y.fromElements(u,s,r)}x.createProjectPointsTo2DFunction=function(i,c,o){return function(e){let r=new Array(e.length);for(let t=0;t<e.length;t++)r[t]=z(e[t],i,c,o);return r}};x.createProjectPointTo2DFunction=function(i,c,o){return function(e,r){return z(e,i,c,o,r)}};var O=x;export{O as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-PZWPGERZ.js b/plugins/feature/map/Cesium/Workers/chunk-PZWPGERZ.js deleted file mode 100644 index 95fb37805..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-PZWPGERZ.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as F}from"./chunk-4W2MZV6I.js";import{a as Z}from"./chunk-JQLYZQ6V.js";import{a as X}from"./chunk-J3L5WX3X.js";import{b as K,c as Q,d as U}from"./chunk-AVPLM4UI.js";import{d as H}from"./chunk-ZYYZDBKK.js";import{a as y}from"./chunk-WER4LUMF.js";import{a as r,d as J,f as V}from"./chunk-FGKVHLJ4.js";import{a as N}from"./chunk-YRCAQUFT.js";import{a as b}from"./chunk-ELJAHN3H.js";import{e as R}from"./chunk-3BGP4HCL.js";var ii=new r(1,1,1),B=Math.cos,S=Math.sin;function v(t){t=t??V.EMPTY_OBJECT;let o=t.radii??ii,n=t.innerRadii??o,C=t.minimumClock??0,P=t.maximumClock??N.TWO_PI,h=t.minimumCone??0,k=t.maximumCone??N.PI,s=Math.round(t.stackPartitions??10),w=Math.round(t.slicePartitions??8),m=Math.round(t.subdivisions??128);if(s<1)throw new b("options.stackPartitions cannot be less than 1");if(w<0)throw new b("options.slicePartitions cannot be less than 0");if(m<0)throw new b("options.subdivisions must be greater than or equal to zero.");if(R(t.offsetAttribute)&&t.offsetAttribute===F.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=r.clone(o),this._innerRadii=r.clone(n),this._minimumClock=C,this._maximumClock=P,this._minimumCone=h,this._maximumCone=k,this._stackPartitions=s,this._slicePartitions=w,this._subdivisions=m,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*r.packedLength+8;v.pack=function(t,o,n){if(!R(t))throw new b("value is required");if(!R(o))throw new b("array is required");return n=n??0,r.pack(t._radii,o,n),n+=r.packedLength,r.pack(t._innerRadii,o,n),n+=r.packedLength,o[n++]=t._minimumClock,o[n++]=t._maximumClock,o[n++]=t._minimumCone,o[n++]=t._maximumCone,o[n++]=t._stackPartitions,o[n++]=t._slicePartitions,o[n++]=t._subdivisions,o[n]=t._offsetAttribute??-1,o};var $=new r,G=new r,l={radii:$,innerRadii:G,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,o,n){if(!R(t))throw new b("array is required");o=o??0;let C=r.unpack(t,o,$);o+=r.packedLength;let P=r.unpack(t,o,G);o+=r.packedLength;let h=t[o++],k=t[o++],s=t[o++],w=t[o++],m=t[o++],f=t[o++],T=t[o++],a=t[o];return R(n)?(n._radii=r.clone(C,n._radii),n._innerRadii=r.clone(P,n._innerRadii),n._minimumClock=h,n._maximumClock=k,n._minimumCone=s,n._maximumCone=w,n._stackPartitions=m,n._slicePartitions=f,n._subdivisions=T,n._offsetAttribute=a===-1?void 0:a,n):(l.minimumClock=h,l.maximumClock=k,l.minimumCone=s,l.maximumCone=w,l.stackPartitions=m,l.slicePartitions=f,l.subdivisions=T,l.offsetAttribute=a===-1?void 0:a,new v(l))};v.createGeometry=function(t){let o=t._radii;if(o.x<=0||o.y<=0||o.z<=0)return;let n=t._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let C=t._minimumClock,P=t._maximumClock,h=t._minimumCone,k=t._maximumCone,s=t._subdivisions,w=J.fromCartesian3(o),m=t._slicePartitions+1,f=t._stackPartitions+1;m=Math.round(m*Math.abs(P-C)/N.TWO_PI),f=Math.round(f*Math.abs(k-h)/N.PI),m<2&&(m=2),f<2&&(f=2);let T=0,a=1,x=n.x!==o.x||n.y!==o.y||n.z!==o.z,W=!1,Y=!1;x&&(a=2,h>0&&(W=!0,T+=m),k<Math.PI&&(Y=!0,T+=m));let q=s*a*(f+m),u=new Float64Array(q*3),g=2*(q+T-(m+f)*a),d=Z.createTypedArray(q,g),i,e,E,z,c=0,_=new Array(f),A=new Array(f);for(i=0;i<f;i++)z=h+i*(k-h)/(f-1),_[i]=S(z),A[i]=B(z);let O=new Array(s),M=new Array(s);for(i=0;i<s;i++)E=C+i*(P-C)/(s-1),O[i]=S(E),M[i]=B(E);for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<f;i++)for(e=0;e<s;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(_.length=s,A.length=s,i=0;i<s;i++)z=h+i*(k-h)/(s-1),_[i]=S(z),A[i]=B(z);for(O.length=m,M.length=m,i=0;i<m;i++)E=C+i*(P-C)/(m-1),O[i]=S(E),M[i]=B(E);for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=o.x*_[i]*M[e],u[c++]=o.y*_[i]*O[e],u[c++]=o.z*A[i];if(x)for(i=0;i<s;i++)for(e=0;e<m;e++)u[c++]=n.x*_[i]*M[e],u[c++]=n.y*_[i]*O[e],u[c++]=n.z*A[i];for(c=0,i=0;i<f*a;i++){let p=i*s;for(e=0;e<s-1;e++)d[c++]=p+e,d[c++]=p+e+1}let L=f*s*a;for(i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x)for(L=f*s*a+m*s,i=0;i<m;i++)for(e=0;e<s-1;e++)d[c++]=L+i+e*m,d[c++]=L+i+(e+1)*m;if(x){let p=f*s*a,D=p+s*m;if(W)for(i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i;if(Y)for(p+=s*m-m,D+=s*m-m,i=0;i<m;i++)d[c++]=p+i,d[c++]=D+i}let j=new X({position:new U({componentDatatype:y.DOUBLE,componentsPerAttribute:3,values:u})});if(R(t._offsetAttribute)){let p=u.length,D=t._offsetAttribute===F.NONE?0:1,I=new Uint8Array(p/3).fill(D);j.applyOffset=new U({componentDatatype:y.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}return new Q({attributes:j,indices:d,primitiveType:K.LINES,boundingSphere:H.fromEllipsoid(w),offsetAttribute:t._offsetAttribute})};var Ci=v;export{Ci as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-Q4LSC5X3.js b/plugins/feature/map/Cesium/Workers/chunk-Q4LSC5X3.js deleted file mode 100644 index 68c071276..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-Q4LSC5X3.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{f as g,g as j}from"./chunk-FGKVHLJ4.js";import{a as i}from"./chunk-YRCAQUFT.js";import{b as n}from"./chunk-ELJAHN3H.js";import{e as b}from"./chunk-3BGP4HCL.js";function F(r,o,t){return t<0&&(t+=1),t>1&&(t-=1),t*6<1?r+(o-r)*6*t:t*2<1?o:t*3<2?r+(o-r)*(2/3-t)*6:r}function e(r,o,t,f){this.red=r??1,this.green=o??1,this.blue=t??1,this.alpha=f??1}e.fromCartesian4=function(r,o){return n.typeOf.object("cartesian",r),b(o)?(o.red=r.x,o.green=r.y,o.blue=r.z,o.alpha=r.w,o):new e(r.x,r.y,r.z,r.w)};e.fromBytes=function(r,o,t,f,C){return r=e.byteToFloat(r??255),o=e.byteToFloat(o??255),t=e.byteToFloat(t??255),f=e.byteToFloat(f??255),b(C)?(C.red=r,C.green=o,C.blue=t,C.alpha=f,C):new e(r,o,t,f)};e.fromAlpha=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("alpha",o),b(t)?(t.red=r.red,t.green=r.green,t.blue=r.blue,t.alpha=o,t):new e(r.red,r.green,r.blue,o)};var l,A,E;j.supportsTypedArrays()&&(l=new ArrayBuffer(4),A=new Uint32Array(l),E=new Uint8Array(l));e.fromRgba=function(r,o){return A[0]=r,e.fromBytes(E[0],E[1],E[2],E[3],o)};e.fromHsl=function(r,o,t,f,C){r=(r??0)%1,o=o??0,t=t??0,f=f??1;let m=t,s=t,O=t;if(o!==0){let c;t<.5?c=t*(1+o):c=t+o-t*o;let S=2*t-c;m=F(S,c,r+1/3),s=F(S,c,r),O=F(S,c,r-1/3)}return b(C)?(C.red=m,C.green=s,C.blue=O,C.alpha=f,C):new e(m,s,O,f)};e.fromRandom=function(r,o){r=r??g.EMPTY_OBJECT;let t=r.red;if(!b(t)){let s=r.minimumRed??0,O=r.maximumRed??1;n.typeOf.number.lessThanOrEquals("minimumRed",s,O),t=s+i.nextRandomNumber()*(O-s)}let f=r.green;if(!b(f)){let s=r.minimumGreen??0,O=r.maximumGreen??1;n.typeOf.number.lessThanOrEquals("minimumGreen",s,O),f=s+i.nextRandomNumber()*(O-s)}let C=r.blue;if(!b(C)){let s=r.minimumBlue??0,O=r.maximumBlue??1;n.typeOf.number.lessThanOrEquals("minimumBlue",s,O),C=s+i.nextRandomNumber()*(O-s)}let m=r.alpha;if(!b(m)){let s=r.minimumAlpha??0,O=r.maximumAlpha??1;n.typeOf.number.lessThanOrEquals("minimumAlpha",s,O),m=s+i.nextRandomNumber()*(O-s)}return b(o)?(o.red=t,o.green=f,o.blue=C,o.alpha=m,o):new e(t,f,C,m)};var a=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,z=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,p=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;e.fromCssColorString=function(r,o){n.typeOf.string("color",r),b(o)||(o=new e),r=r.trim();let t=e[r.toUpperCase()];if(b(t))return e.clone(t,o),o;let f=a.exec(r);return f!==null?(o.red=parseInt(f[1],16)/15,o.green=parseInt(f[2],16)/15,o.blue=parseInt(f[3],16)/15,o.alpha=parseInt(f[4]??"f",16)/15,o):(f=z.exec(r),f!==null?(o.red=parseInt(f[1],16)/255,o.green=parseInt(f[2],16)/255,o.blue=parseInt(f[3],16)/255,o.alpha=parseInt(f[4]??"ff",16)/255,o):(f=p.exec(r),f!==null?(o.red=parseFloat(f[1])/(f[1].substr(-1)==="%"?100:255),o.green=parseFloat(f[2])/(f[2].substr(-1)==="%"?100:255),o.blue=parseFloat(f[3])/(f[3].substr(-1)==="%"?100:255),o.alpha=parseFloat(f[4]??"1.0"),o):(f=R.exec(r),f!==null?e.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(f[4]??"1.0"),o):(o=void 0,o))))};e.packedLength=4;e.pack=function(r,o,t){return n.typeOf.object("value",r),n.defined("array",o),t=t??0,o[t++]=r.red,o[t++]=r.green,o[t++]=r.blue,o[t]=r.alpha,o};e.unpack=function(r,o,t){return n.defined("array",r),o=o??0,b(t)||(t=new e),t.red=r[o++],t.green=r[o++],t.blue=r[o++],t.alpha=r[o],t};e.byteToFloat=function(r){return r/255};e.floatToByte=function(r){return r===1?255:r*256|0};e.clone=function(r,o){if(b(r))return b(o)?(o.red=r.red,o.green=r.green,o.blue=r.blue,o.alpha=r.alpha,o):new e(r.red,r.green,r.blue,r.alpha)};e.equals=function(r,o){return r===o||b(r)&&b(o)&&r.red===o.red&&r.green===o.green&&r.blue===o.blue&&r.alpha===o.alpha};e.equalsArray=function(r,o,t){return r.red===o[t]&&r.green===o[t+1]&&r.blue===o[t+2]&&r.alpha===o[t+3]};e.prototype.clone=function(r){return e.clone(this,r)};e.prototype.equals=function(r){return e.equals(this,r)};e.prototype.equalsEpsilon=function(r,o){return this===r||b(r)&&Math.abs(this.red-r.red)<=o&&Math.abs(this.green-r.green)<=o&&Math.abs(this.blue-r.blue)<=o&&Math.abs(this.alpha-r.alpha)<=o};e.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};e.prototype.toCssColorString=function(){let r=e.floatToByte(this.red),o=e.floatToByte(this.green),t=e.floatToByte(this.blue);return this.alpha===1?`rgb(${r},${o},${t})`:`rgba(${r},${o},${t},${this.alpha})`};e.prototype.toCssHexString=function(){let r=e.floatToByte(this.red).toString(16);r.length<2&&(r=`0${r}`);let o=e.floatToByte(this.green).toString(16);o.length<2&&(o=`0${o}`);let t=e.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let f=e.floatToByte(this.alpha).toString(16);return f.length<2&&(f=`0${f}`),`#${r}${o}${t}${f}`}return`#${r}${o}${t}`};e.prototype.toBytes=function(r){let o=e.floatToByte(this.red),t=e.floatToByte(this.green),f=e.floatToByte(this.blue),C=e.floatToByte(this.alpha);return b(r)?(r[0]=o,r[1]=t,r[2]=f,r[3]=C,r):[o,t,f,C]};e.prototype.toRgba=function(){return E[0]=e.floatToByte(this.red),E[1]=e.floatToByte(this.green),E[2]=e.floatToByte(this.blue),E[3]=e.floatToByte(this.alpha),A[0]};e.prototype.brighten=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=1-(1-this.red)*r,o.green=1-(1-this.green)*r,o.blue=1-(1-this.blue)*r,o.alpha=this.alpha,o};e.prototype.darken=function(r,o){return n.typeOf.number("magnitude",r),n.typeOf.number.greaterThanOrEquals("magnitude",r,0),n.typeOf.object("result",o),r=1-r,o.red=this.red*r,o.green=this.green*r,o.blue=this.blue*r,o.alpha=this.alpha,o};e.prototype.withAlpha=function(r,o){return e.fromAlpha(this,r,o)};e.add=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red+o.red,t.green=r.green+o.green,t.blue=r.blue+o.blue,t.alpha=r.alpha+o.alpha,t};e.subtract=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red-o.red,t.green=r.green-o.green,t.blue=r.blue-o.blue,t.alpha=r.alpha-o.alpha,t};e.multiply=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red*o.red,t.green=r.green*o.green,t.blue=r.blue*o.blue,t.alpha=r.alpha*o.alpha,t};e.divide=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red/o.red,t.green=r.green/o.green,t.blue=r.blue/o.blue,t.alpha=r.alpha/o.alpha,t};e.mod=function(r,o,t){return n.typeOf.object("left",r),n.typeOf.object("right",o),n.typeOf.object("result",t),t.red=r.red%o.red,t.green=r.green%o.green,t.blue=r.blue%o.blue,t.alpha=r.alpha%o.alpha,t};e.lerp=function(r,o,t,f){return n.typeOf.object("start",r),n.typeOf.object("end",o),n.typeOf.number("t",t),n.typeOf.object("result",f),f.red=i.lerp(r.red,o.red,t),f.green=i.lerp(r.green,o.green,t),f.blue=i.lerp(r.blue,o.blue,t),f.alpha=i.lerp(r.alpha,o.alpha,t),f};e.multiplyByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red*o,t.green=r.green*o,t.blue=r.blue*o,t.alpha=r.alpha*o,t};e.divideByScalar=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("scalar",o),n.typeOf.object("result",t),t.red=r.red/o,t.green=r.green/o,t.blue=r.blue/o,t.alpha=r.alpha/o,t};e.ALICEBLUE=Object.freeze(e.fromCssColorString("#F0F8FF"));e.ANTIQUEWHITE=Object.freeze(e.fromCssColorString("#FAEBD7"));e.AQUA=Object.freeze(e.fromCssColorString("#00FFFF"));e.AQUAMARINE=Object.freeze(e.fromCssColorString("#7FFFD4"));e.AZURE=Object.freeze(e.fromCssColorString("#F0FFFF"));e.BEIGE=Object.freeze(e.fromCssColorString("#F5F5DC"));e.BISQUE=Object.freeze(e.fromCssColorString("#FFE4C4"));e.BLACK=Object.freeze(e.fromCssColorString("#000000"));e.BLANCHEDALMOND=Object.freeze(e.fromCssColorString("#FFEBCD"));e.BLUE=Object.freeze(e.fromCssColorString("#0000FF"));e.BLUEVIOLET=Object.freeze(e.fromCssColorString("#8A2BE2"));e.BROWN=Object.freeze(e.fromCssColorString("#A52A2A"));e.BURLYWOOD=Object.freeze(e.fromCssColorString("#DEB887"));e.CADETBLUE=Object.freeze(e.fromCssColorString("#5F9EA0"));e.CHARTREUSE=Object.freeze(e.fromCssColorString("#7FFF00"));e.CHOCOLATE=Object.freeze(e.fromCssColorString("#D2691E"));e.CORAL=Object.freeze(e.fromCssColorString("#FF7F50"));e.CORNFLOWERBLUE=Object.freeze(e.fromCssColorString("#6495ED"));e.CORNSILK=Object.freeze(e.fromCssColorString("#FFF8DC"));e.CRIMSON=Object.freeze(e.fromCssColorString("#DC143C"));e.CYAN=Object.freeze(e.fromCssColorString("#00FFFF"));e.DARKBLUE=Object.freeze(e.fromCssColorString("#00008B"));e.DARKCYAN=Object.freeze(e.fromCssColorString("#008B8B"));e.DARKGOLDENROD=Object.freeze(e.fromCssColorString("#B8860B"));e.DARKGRAY=Object.freeze(e.fromCssColorString("#A9A9A9"));e.DARKGREEN=Object.freeze(e.fromCssColorString("#006400"));e.DARKGREY=e.DARKGRAY;e.DARKKHAKI=Object.freeze(e.fromCssColorString("#BDB76B"));e.DARKMAGENTA=Object.freeze(e.fromCssColorString("#8B008B"));e.DARKOLIVEGREEN=Object.freeze(e.fromCssColorString("#556B2F"));e.DARKORANGE=Object.freeze(e.fromCssColorString("#FF8C00"));e.DARKORCHID=Object.freeze(e.fromCssColorString("#9932CC"));e.DARKRED=Object.freeze(e.fromCssColorString("#8B0000"));e.DARKSALMON=Object.freeze(e.fromCssColorString("#E9967A"));e.DARKSEAGREEN=Object.freeze(e.fromCssColorString("#8FBC8F"));e.DARKSLATEBLUE=Object.freeze(e.fromCssColorString("#483D8B"));e.DARKSLATEGRAY=Object.freeze(e.fromCssColorString("#2F4F4F"));e.DARKSLATEGREY=e.DARKSLATEGRAY;e.DARKTURQUOISE=Object.freeze(e.fromCssColorString("#00CED1"));e.DARKVIOLET=Object.freeze(e.fromCssColorString("#9400D3"));e.DEEPPINK=Object.freeze(e.fromCssColorString("#FF1493"));e.DEEPSKYBLUE=Object.freeze(e.fromCssColorString("#00BFFF"));e.DIMGRAY=Object.freeze(e.fromCssColorString("#696969"));e.DIMGREY=e.DIMGRAY;e.DODGERBLUE=Object.freeze(e.fromCssColorString("#1E90FF"));e.FIREBRICK=Object.freeze(e.fromCssColorString("#B22222"));e.FLORALWHITE=Object.freeze(e.fromCssColorString("#FFFAF0"));e.FORESTGREEN=Object.freeze(e.fromCssColorString("#228B22"));e.FUCHSIA=Object.freeze(e.fromCssColorString("#FF00FF"));e.GAINSBORO=Object.freeze(e.fromCssColorString("#DCDCDC"));e.GHOSTWHITE=Object.freeze(e.fromCssColorString("#F8F8FF"));e.GOLD=Object.freeze(e.fromCssColorString("#FFD700"));e.GOLDENROD=Object.freeze(e.fromCssColorString("#DAA520"));e.GRAY=Object.freeze(e.fromCssColorString("#808080"));e.GREEN=Object.freeze(e.fromCssColorString("#008000"));e.GREENYELLOW=Object.freeze(e.fromCssColorString("#ADFF2F"));e.GREY=e.GRAY;e.HONEYDEW=Object.freeze(e.fromCssColorString("#F0FFF0"));e.HOTPINK=Object.freeze(e.fromCssColorString("#FF69B4"));e.INDIANRED=Object.freeze(e.fromCssColorString("#CD5C5C"));e.INDIGO=Object.freeze(e.fromCssColorString("#4B0082"));e.IVORY=Object.freeze(e.fromCssColorString("#FFFFF0"));e.KHAKI=Object.freeze(e.fromCssColorString("#F0E68C"));e.LAVENDER=Object.freeze(e.fromCssColorString("#E6E6FA"));e.LAVENDAR_BLUSH=Object.freeze(e.fromCssColorString("#FFF0F5"));e.LAWNGREEN=Object.freeze(e.fromCssColorString("#7CFC00"));e.LEMONCHIFFON=Object.freeze(e.fromCssColorString("#FFFACD"));e.LIGHTBLUE=Object.freeze(e.fromCssColorString("#ADD8E6"));e.LIGHTCORAL=Object.freeze(e.fromCssColorString("#F08080"));e.LIGHTCYAN=Object.freeze(e.fromCssColorString("#E0FFFF"));e.LIGHTGOLDENRODYELLOW=Object.freeze(e.fromCssColorString("#FAFAD2"));e.LIGHTGRAY=Object.freeze(e.fromCssColorString("#D3D3D3"));e.LIGHTGREEN=Object.freeze(e.fromCssColorString("#90EE90"));e.LIGHTGREY=e.LIGHTGRAY;e.LIGHTPINK=Object.freeze(e.fromCssColorString("#FFB6C1"));e.LIGHTSEAGREEN=Object.freeze(e.fromCssColorString("#20B2AA"));e.LIGHTSKYBLUE=Object.freeze(e.fromCssColorString("#87CEFA"));e.LIGHTSLATEGRAY=Object.freeze(e.fromCssColorString("#778899"));e.LIGHTSLATEGREY=e.LIGHTSLATEGRAY;e.LIGHTSTEELBLUE=Object.freeze(e.fromCssColorString("#B0C4DE"));e.LIGHTYELLOW=Object.freeze(e.fromCssColorString("#FFFFE0"));e.LIME=Object.freeze(e.fromCssColorString("#00FF00"));e.LIMEGREEN=Object.freeze(e.fromCssColorString("#32CD32"));e.LINEN=Object.freeze(e.fromCssColorString("#FAF0E6"));e.MAGENTA=Object.freeze(e.fromCssColorString("#FF00FF"));e.MAROON=Object.freeze(e.fromCssColorString("#800000"));e.MEDIUMAQUAMARINE=Object.freeze(e.fromCssColorString("#66CDAA"));e.MEDIUMBLUE=Object.freeze(e.fromCssColorString("#0000CD"));e.MEDIUMORCHID=Object.freeze(e.fromCssColorString("#BA55D3"));e.MEDIUMPURPLE=Object.freeze(e.fromCssColorString("#9370DB"));e.MEDIUMSEAGREEN=Object.freeze(e.fromCssColorString("#3CB371"));e.MEDIUMSLATEBLUE=Object.freeze(e.fromCssColorString("#7B68EE"));e.MEDIUMSPRINGGREEN=Object.freeze(e.fromCssColorString("#00FA9A"));e.MEDIUMTURQUOISE=Object.freeze(e.fromCssColorString("#48D1CC"));e.MEDIUMVIOLETRED=Object.freeze(e.fromCssColorString("#C71585"));e.MIDNIGHTBLUE=Object.freeze(e.fromCssColorString("#191970"));e.MINTCREAM=Object.freeze(e.fromCssColorString("#F5FFFA"));e.MISTYROSE=Object.freeze(e.fromCssColorString("#FFE4E1"));e.MOCCASIN=Object.freeze(e.fromCssColorString("#FFE4B5"));e.NAVAJOWHITE=Object.freeze(e.fromCssColorString("#FFDEAD"));e.NAVY=Object.freeze(e.fromCssColorString("#000080"));e.OLDLACE=Object.freeze(e.fromCssColorString("#FDF5E6"));e.OLIVE=Object.freeze(e.fromCssColorString("#808000"));e.OLIVEDRAB=Object.freeze(e.fromCssColorString("#6B8E23"));e.ORANGE=Object.freeze(e.fromCssColorString("#FFA500"));e.ORANGERED=Object.freeze(e.fromCssColorString("#FF4500"));e.ORCHID=Object.freeze(e.fromCssColorString("#DA70D6"));e.PALEGOLDENROD=Object.freeze(e.fromCssColorString("#EEE8AA"));e.PALEGREEN=Object.freeze(e.fromCssColorString("#98FB98"));e.PALETURQUOISE=Object.freeze(e.fromCssColorString("#AFEEEE"));e.PALEVIOLETRED=Object.freeze(e.fromCssColorString("#DB7093"));e.PAPAYAWHIP=Object.freeze(e.fromCssColorString("#FFEFD5"));e.PEACHPUFF=Object.freeze(e.fromCssColorString("#FFDAB9"));e.PERU=Object.freeze(e.fromCssColorString("#CD853F"));e.PINK=Object.freeze(e.fromCssColorString("#FFC0CB"));e.PLUM=Object.freeze(e.fromCssColorString("#DDA0DD"));e.POWDERBLUE=Object.freeze(e.fromCssColorString("#B0E0E6"));e.PURPLE=Object.freeze(e.fromCssColorString("#800080"));e.RED=Object.freeze(e.fromCssColorString("#FF0000"));e.ROSYBROWN=Object.freeze(e.fromCssColorString("#BC8F8F"));e.ROYALBLUE=Object.freeze(e.fromCssColorString("#4169E1"));e.SADDLEBROWN=Object.freeze(e.fromCssColorString("#8B4513"));e.SALMON=Object.freeze(e.fromCssColorString("#FA8072"));e.SANDYBROWN=Object.freeze(e.fromCssColorString("#F4A460"));e.SEAGREEN=Object.freeze(e.fromCssColorString("#2E8B57"));e.SEASHELL=Object.freeze(e.fromCssColorString("#FFF5EE"));e.SIENNA=Object.freeze(e.fromCssColorString("#A0522D"));e.SILVER=Object.freeze(e.fromCssColorString("#C0C0C0"));e.SKYBLUE=Object.freeze(e.fromCssColorString("#87CEEB"));e.SLATEBLUE=Object.freeze(e.fromCssColorString("#6A5ACD"));e.SLATEGRAY=Object.freeze(e.fromCssColorString("#708090"));e.SLATEGREY=e.SLATEGRAY;e.SNOW=Object.freeze(e.fromCssColorString("#FFFAFA"));e.SPRINGGREEN=Object.freeze(e.fromCssColorString("#00FF7F"));e.STEELBLUE=Object.freeze(e.fromCssColorString("#4682B4"));e.TAN=Object.freeze(e.fromCssColorString("#D2B48C"));e.TEAL=Object.freeze(e.fromCssColorString("#008080"));e.THISTLE=Object.freeze(e.fromCssColorString("#D8BFD8"));e.TOMATO=Object.freeze(e.fromCssColorString("#FF6347"));e.TURQUOISE=Object.freeze(e.fromCssColorString("#40E0D0"));e.VIOLET=Object.freeze(e.fromCssColorString("#EE82EE"));e.WHEAT=Object.freeze(e.fromCssColorString("#F5DEB3"));e.WHITE=Object.freeze(e.fromCssColorString("#FFFFFF"));e.WHITESMOKE=Object.freeze(e.fromCssColorString("#F5F5F5"));e.YELLOW=Object.freeze(e.fromCssColorString("#FFFF00"));e.YELLOWGREEN=Object.freeze(e.fromCssColorString("#9ACD32"));e.TRANSPARENT=Object.freeze(new e(0,0,0,0));var h=e;export{h as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-Q7QJJ4HI.js b/plugins/feature/map/Cesium/Workers/chunk-Q7QJJ4HI.js deleted file mode 100644 index a98b92930..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-Q7QJJ4HI.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as G}from"./chunk-HRZKIJQA.js";import{a as At}from"./chunk-4OIYAFXA.js";import{a as yt}from"./chunk-23RYXNR3.js";import{a as $}from"./chunk-4W2MZV6I.js";import{a as v}from"./chunk-S3L7VZFL.js";import{a as st}from"./chunk-JQLYZQ6V.js";import{a as ht}from"./chunk-J3L5WX3X.js";import{b as ct,c as rt,d as F}from"./chunk-AVPLM4UI.js";import{a as lt,d as it}from"./chunk-ZYYZDBKK.js";import{f as nt,h as bt}from"./chunk-3PT5NNSP.js";import{a as P}from"./chunk-WER4LUMF.js";import{a,b as _t,c as Q,d as D,e as C,f as dt}from"./chunk-FGKVHLJ4.js";import{a as R}from"./chunk-YRCAQUFT.js";import{a as ot,b as k}from"./chunk-ELJAHN3H.js";import{e as Z}from"./chunk-3BGP4HCL.js";var tt=new a,pt=new a,xt=new a,wt=new a,w=new Q,Mt=new C,Vt=new C,gt=new nt,Tt=new a,Nt=new a,Et=new a,ft=new _t,Pt=new a,Ft=new Q,St=new Q;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,N=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(N*2):void 0,l=n.normal?new Float32Array(N*3):void 0,A=n.tangent?new Float32Array(N*3):void 0,x=n.bitangent?new Float32Array(N*3):void 0,S=g?new Float32Array(N*3):void 0,z=0,b=Tt,M=Nt,d=Et,_=new lt(f),I=_.project(f.cartesianToCartographic(s,ft),Pt),W=f.scaleToGeodeticSurface(s,tt);f.geodeticSurfaceNormal(W,W);let J=Mt,U=Vt;if(h!==0){let m=nt.fromAxisAngle(W,h,gt);J=C.fromQuaternion(m,J),m=nt.fromAxisAngle(W,-h,gt),U=C.fromQuaternion(m,U)}else J=C.clone(C.IDENTITY,J),U=C.clone(C.IDENTITY,U);let B=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),q=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),O=o.length,y=t?O:0,p=y/3*2;for(let m=0;m<O;m+=3){let u=m+1,T=m+2,V=a.fromArray(o,m,tt);if(n.st){let E=C.multiplyByVector(J,V,pt),j=_.project(f.cartesianToCartographic(E,ft),xt);a.subtract(j,I,j),w.x=(j.x+i)/(2*i),w.y=(j.y+r)/(2*r),B.x=Math.min(w.x,B.x),B.y=Math.min(w.y,B.y),q.x=Math.max(w.x,q.x),q.y=Math.max(w.y,q.y),t&&(c[z+p]=w.x,c[z+1+p]=w.y),c[z++]=w.x,c[z++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(V,b),g&&(S[m+y]=-b.x,S[u+y]=-b.y,S[T+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),C.multiplyByVector(U,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[T]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[T+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[T]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[T+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[T]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[T+y]=d.z))))}if(n.st){O=c.length;for(let m=0;m<O;m+=2)c[m]=(c[m]-B.x)/(q.x-B.x),c[m+1]=(c[m+1]-B.y)/(q.y-B.y)}let L=new ht;if(n.position){let m=G.raisePositionsToHeight(o,e,t);L.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(L.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(L.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(L.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(L.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),g&&(L.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),t&&Z(e.offsetAttribute)){let m=new Uint8Array(N);if(e.offsetAttribute===$.TOP)m=m.fill(1,0,N/2);else{let u=e.offsetAttribute===$.NONE?0:1;m=m.fill(u)}L.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return L}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=n++,e[t++]=n++,e[t++]=i++}for(r=0;r<3;r++)e[t++]=n++,e[t++]=n,e[t++]=i;return e}var K=new a;function Dt(o){let e=o.center;K=a.multiplyByScalar(o.ellipsoid.geodeticSurfaceNormal(e,K),o.height,K),K=a.add(e,K,K);let t=new it(K,o.semiMajorAxis),n=G.computeEllipsePositions(o,!0,!1),s=n.positions,i=n.numPts,r=Ot(s,o,!1),f=jt(i);return f=st.createTypedArray(s.length/3,f),{boundingSphere:t,attributes:r,indices:f}}function vt(o,e){let t=e.vertexFormat,n=e.center,s=e.semiMajorAxis,i=e.semiMinorAxis,r=e.ellipsoid,f=e.height,h=e.extrudedHeight,N=e.stRotation,g=o.length/3*2,c=new Float64Array(g*3),l=t.st?new Float32Array(g*2):void 0,A=t.normal?new Float32Array(g*3):void 0,x=t.tangent?new Float32Array(g*3):void 0,S=t.bitangent?new Float32Array(g*3):void 0,z=e.shadowVolume,b=z?new Float32Array(g*3):void 0,M=0,d=Tt,_=Nt,I=Et,W=new lt(r),J=W.project(r.cartesianToCartographic(n,ft),Pt),U=r.scaleToGeodeticSurface(n,tt);r.geodeticSurfaceNormal(U,U);let B=nt.fromAxisAngle(U,N,gt),q=C.fromQuaternion(B,Mt),O=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),y=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),p=o.length,L=p/3*2;for(let u=0;u<p;u+=3){let T=u+1,V=u+2,E=a.fromArray(o,u,tt),j;if(t.st){let et=C.multiplyByVector(q,E,pt),X=W.project(r.cartesianToCartographic(et,ft),xt);a.subtract(X,J,X),w.x=(X.x+s)/(2*s),w.y=(X.y+i)/(2*i),O.x=Math.min(w.x,O.x),O.y=Math.min(w.y,O.y),y.x=Math.max(w.x,y.x),y.y=Math.max(w.y,y.y),l[M+L]=w.x,l[M+1+L]=w.y,l[M++]=w.x,l[M++]=w.y}E=r.scaleToGeodeticSurface(E,E),j=a.clone(E,pt),d=r.geodeticSurfaceNormal(E,d),z&&(b[u+p]=-d.x,b[T+p]=-d.y,b[V+p]=-d.z);let at=a.multiplyByScalar(d,f,wt);if(E=a.add(E,at,E),at=a.multiplyByScalar(d,h,at),j=a.add(j,at,j),t.position&&(c[u+p]=j.x,c[T+p]=j.y,c[V+p]=j.z,c[u]=E.x,c[T]=E.y,c[V]=E.z),t.normal||t.tangent||t.bitangent){I=a.clone(d,I);let et=a.fromArray(o,(u+3)%p,wt);a.subtract(et,E,et);let X=a.subtract(j,E,xt);d=a.normalize(a.cross(X,et,d),d),t.normal&&(A[u]=d.x,A[T]=d.y,A[V]=d.z,A[u+p]=d.x,A[T+p]=d.y,A[V+p]=d.z),t.tangent&&(_=a.normalize(a.cross(I,d,_),_),x[u]=_.x,x[T]=_.y,x[V]=_.z,x[u+p]=_.x,x[u+1+p]=_.y,x[u+2+p]=_.z),t.bitangent&&(S[u]=I.x,S[T]=I.y,S[V]=I.z,S[u+p]=I.x,S[T+p]=I.y,S[V+p]=I.z)}}if(t.st){p=l.length;for(let u=0;u<p;u+=2)l[u]=(l[u]-O.x)/(y.x-O.x),l[u+1]=(l[u+1]-O.y)/(y.y-O.y)}let m=new ht;if(t.position&&(m.position=new F({componentDatatype:P.DOUBLE,componentsPerAttribute:3,values:c})),t.st&&(m.st=new F({componentDatatype:P.FLOAT,componentsPerAttribute:2,values:l})),t.normal&&(m.normal=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(m.tangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(m.bitangent=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:S})),z&&(m.extrudeDirection=new F({componentDatatype:P.FLOAT,componentsPerAttribute:3,values:b})),Z(e.offsetAttribute)){let u=new Uint8Array(g);if(e.offsetAttribute===$.TOP)u=u.fill(1,0,g/2);else{let T=e.offsetAttribute===$.NONE?0:1;u=u.fill(T)}m.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return m}function zt(o){let e=o.length/3,t=st.createTypedArray(e,e*6),n=0;for(let s=0;s<e;s++){let i=s,r=s+e,f=(i+1)%e,h=f+e;t[n++]=i,t[n++]=r,t[n++]=f,t[n++]=f,t[n++]=r,t[n++]=h}return t}var mt=new it,ut=new it;function Bt(o){let e=o.center,t=o.ellipsoid,n=o.semiMajorAxis,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,tt),o.height,tt);mt.center=a.add(e,s,mt.center),mt.radius=n,s=a.multiplyByScalar(t.geodeticSurfaceNormal(e,s),o.extrudedHeight,s),ut.center=a.add(e,s,ut.center),ut.radius=n;let i=G.computeEllipsePositions(o,!0,!0),r=i.positions,f=i.numPts,h=i.outerPositions,N=it.union(mt,ut),g=Ot(r,o,!0),c=jt(f),l=c.length;c.length=l*2;let A=r.length/3;for(let _=0;_<l;_+=3)c[_+l]=c[_+2]+A,c[_+1+l]=c[_+1]+A,c[_+2+l]=c[_]+A;let x=st.createTypedArray(A*2/3,c),S=new rt({attributes:g,indices:x,primitiveType:ct.TRIANGLES}),z=vt(h,o);c=zt(h);let b=st.createTypedArray(h.length*2/3,c),M=new rt({attributes:z,indices:b,primitiveType:ct.TRIANGLES}),d=yt.combineInstances([new At({geometry:S}),new At({geometry:M})]);return{boundingSphere:N,attributes:d[0].attributes,indices:d[0].indices}}function Ct(o,e,t,n,s,i,r){let h=G.computeEllipsePositions({center:o,semiMajorAxis:e,semiMinorAxis:t,rotation:n,granularity:s},!1,!0).outerPositions,N=h.length/3,g=new Array(N);for(let l=0;l<N;++l)g[l]=a.fromArray(h,l*3);let c=bt.fromCartesianArray(g,i,r);return c.width>R.PI&&(c.north=c.north>0?R.PI_OVER_TWO-R.EPSILON7:c.north,c.south=c.south<0?R.EPSILON7-R.PI_OVER_TWO:c.south,c.east=R.PI,c.west=-R.PI),c}function Y(o){o=o??dt.EMPTY_OBJECT;let e=o.center,t=o.ellipsoid??D.default,n=o.semiMajorAxis,s=o.semiMinorAxis,i=o.granularity??R.RADIANS_PER_DEGREE,r=o.vertexFormat??v.DEFAULT;if(k.defined("options.center",e),k.typeOf.number("options.semiMajorAxis",n),k.typeOf.number("options.semiMinorAxis",s),n<s)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(i<=0)throw new ot("granularity must be greater than zero.");let f=o.height??0,h=o.extrudedHeight??f;this._center=a.clone(e),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=D.clone(t),this._rotation=o.rotation??0,this._stRotation=o.stRotation??0,this._height=Math.max(h,f),this._granularity=i,this._vertexFormat=v.clone(r),this._extrudedHeight=Math.min(h,f),this._shadowVolume=o.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y.packedLength=a.packedLength+D.packedLength+v.packedLength+9;Y.pack=function(o,e,t){return k.defined("value",o),k.defined("array",e),t=t??0,a.pack(o._center,e,t),t+=a.packedLength,D.pack(o._ellipsoid,e,t),t+=D.packedLength,v.pack(o._vertexFormat,e,t),t+=v.packedLength,e[t++]=o._semiMajorAxis,e[t++]=o._semiMinorAxis,e[t++]=o._rotation,e[t++]=o._stRotation,e[t++]=o._height,e[t++]=o._granularity,e[t++]=o._extrudedHeight,e[t++]=o._shadowVolume?1:0,e[t]=o._offsetAttribute??-1,e};var Rt=new a,It=new D,Lt=new v,H={center:Rt,ellipsoid:It,vertexFormat:Lt,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};Y.unpack=function(o,e,t){k.defined("array",o),e=e??0;let n=a.unpack(o,e,Rt);e+=a.packedLength;let s=D.unpack(o,e,It);e+=D.packedLength;let i=v.unpack(o,e,Lt);e+=v.packedLength;let r=o[e++],f=o[e++],h=o[e++],N=o[e++],g=o[e++],c=o[e++],l=o[e++],A=o[e++]===1,x=o[e];return Z(t)?(t._center=a.clone(n,t._center),t._ellipsoid=D.clone(s,t._ellipsoid),t._vertexFormat=v.clone(i,t._vertexFormat),t._semiMajorAxis=r,t._semiMinorAxis=f,t._rotation=h,t._stRotation=N,t._height=g,t._granularity=c,t._extrudedHeight=l,t._shadowVolume=A,t._offsetAttribute=x===-1?void 0:x,t):(H.height=g,H.extrudedHeight=l,H.granularity=c,H.stRotation=N,H.rotation=h,H.semiMajorAxis=r,H.semiMinorAxis=f,H.shadowVolume=A,H.offsetAttribute=x===-1?void 0:x,new Y(H))};Y.computeRectangle=function(o,e){o=o??dt.EMPTY_OBJECT;let t=o.center,n=o.ellipsoid??D.default,s=o.semiMajorAxis,i=o.semiMinorAxis,r=o.granularity??R.RADIANS_PER_DEGREE,f=o.rotation??0;if(k.defined("options.center",t),k.typeOf.number("options.semiMajorAxis",s),k.typeOf.number("options.semiMinorAxis",i),s<i)throw new ot("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new ot("granularity must be greater than zero.");return Ct(t,s,i,f,r,n,e)};Y.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let e=o._height,t=o._extrudedHeight,n=!R.equalsEpsilon(e,t,0,R.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let s={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:e,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},i;if(n)s.extrudedHeight=t,s.shadowVolume=o._shadowVolume,s.offsetAttribute=o._offsetAttribute,i=Bt(s);else if(i=Dt(s),Z(o._offsetAttribute)){let r=i.attributes.position.values.length,f=o._offsetAttribute===$.NONE?0:1,h=new Uint8Array(r/3).fill(f);i.attributes.applyOffset=new F({componentDatatype:P.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new rt({attributes:i.attributes,indices:i.indices,primitiveType:ct.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:o._offsetAttribute})};Y.createShadowVolume=function(o,e,t){let n=o._granularity,s=o._ellipsoid,i=e(n,s),r=t(n,s);return new Y({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:s,rotation:o._rotation,stRotation:o._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:v.POSITION_ONLY,shadowVolume:!0})};function kt(o){let e=-o._stRotation;if(e===0)return[0,0,0,1,1,0];let n=G.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,s=n.length/3,i=new Array(s);for(let h=0;h<s;++h)i[h]=a.fromArray(n,h*3);let r=o._ellipsoid,f=o.rectangle;return rt._textureCoordinateRotationPoints(i,e,r,f)}Object.defineProperties(Y.prototype,{rectangle:{get:function(){return Z(this._rectangle)||(this._rectangle=Ct(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Z(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=kt(this)),this._textureCoordinateRotationPoints}}});var de=Y;export{de as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-QCE33JV5.js b/plugins/feature/map/Cesium/Workers/chunk-QCE33JV5.js new file mode 100644 index 000000000..63e2a8303 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-QCE33JV5.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{k as N}from"./chunk-YZ5ZCI55.js";import{a as S,b as z}from"./chunk-HLXNFZAZ.js";import{a as p}from"./chunk-WCOEOHX5.js";import{b as C}from"./chunk-KP72RGCH.js";import{a as T,b as w}from"./chunk-OSVSBQDY.js";import{a as m}from"./chunk-LZC73BOP.js";import{a as h,b as c}from"./chunk-OU2IPMYE.js";import{f as b}from"./chunk-H7SJWKIY.js";var a={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};a.getMathType=function(e){switch(e){case a.SCALAR:return Number;case a.VEC2:return C;case a.VEC3:return T;case a.VEC4:return S;case a.MAT2:return N;case a.MAT3:return w;case a.MAT4:return z;default:throw new h("attributeType is not a valid value.")}};a.getNumberOfComponents=function(e){switch(e){case a.SCALAR:return 1;case a.VEC2:return 2;case a.VEC3:return 3;case a.VEC4:case a.MAT2:return 4;case a.MAT3:return 9;case a.MAT4:return 16;default:throw new h("attributeType is not a valid value.")}};a.getAttributeLocationCount=function(e){switch(e){case a.SCALAR:case a.VEC2:case a.VEC3:case a.VEC4:return 1;case a.MAT2:return 2;case a.MAT3:return 3;case a.MAT4:return 4;default:throw new h("attributeType is not a valid value.")}};a.getGlslType=function(e){switch(c.typeOf.string("attributeType",e),e){case a.SCALAR:return"float";case a.VEC2:return"vec2";case a.VEC3:return"vec3";case a.VEC4:return"vec4";case a.MAT2:return"mat2";case a.MAT3:return"mat3";case a.MAT4:return"mat4";default:throw new h("attributeType is not a valid value.")}};Object.freeze(a);var F=a;var V=1/256,k=65536,l=256,r={};r.octEncodeInRange=function(e,t,n){c.defined("vector",e),c.defined("result",n);let o=T.magnitudeSquared(e);if(Math.abs(o-1)>m.EPSILON6)throw new h("vector must be normalized.");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,d=n.y;n.x=(1-Math.abs(d))*m.signNotZero(i),n.y=(1-Math.abs(i))*m.signNotZero(d)}return n.x=m.toSNorm(n.x,t),n.y=m.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var E=new C,D=new Uint8Array(1);function M(e){return D[0]=e,D[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,E),t.x=M(E.x*V),t.y=M(E.x),t.z=M(E.y*V),t.w=M(E.y),t};r.octDecodeInRange=function(e,t,n,o){if(c.defined("result",o),e<0||e>n||t<0||t>n)throw new h(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=m.fromSNorm(e,n),o.y=m.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*m.signNotZero(i),o.y=(1-Math.abs(i))*m.signNotZero(o.y)}return T.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){c.typeOf.object("encoded",e),c.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new h("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*l+o,s=i*l+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return c.defined("encoded",e),256*e.x+e.y};var x=new C;r.octEncodeFloat=function(e){return r.octEncode(e,x),r.octPackFloat(x)};r.octDecodeFloat=function(e,t){c.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){c.defined("v1",e),c.defined("v2",t),c.defined("v3",n),c.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,x);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){c.defined("packed",e),c.defined("v1",t),c.defined("v2",n),c.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),u=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(u,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){c.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){c.defined("compressed",e),c.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){c.defined("uBuffer",e),c.defined("vBuffer",t),c.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&c.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){c.defined("typedArray",e),c.defined("componentDatatype",t),c.defined("type",n),c.defined("count",o);let i=F.getNumberOfComponents(n),d;switch(t){case p.BYTE:d=127;break;case p.UNSIGNED_BYTE:d=255;break;case p.SHORT:d=32767;break;case p.UNSIGNED_SHORT:d=65535;break;case p.INT:d=2147483647;break;case p.UNSIGNED_INT:d=4294967295;break;default:throw new h(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let u=0;u<i;u++){let y=s*i+u;f[y]=Math.max(e[y]/d,-1)}return f};r.encodeRGB8=function(e){return c.typeOf.object("color",e),Math.round(m.clamp(e.red*255,0,255))*k+Math.round(m.clamp(e.green*255,0,255))*l+Math.round(m.clamp(e.blue*255,0,255))};r.decodeRGB8=function(e,t){return c.typeOf.number("encoded",e),c.typeOf.object("result",t),e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};r.decodeRGB565=function(e,t){c.defined("typedArray",e);let n=e.length*3;b(t)&&c.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let u=0;u<o;u++){let y=e[u],R=y>>11,O=y>>5&d,I=y&i,A=3*u;t[A]=R*f,t[A+1]=O*s,t[A+2]=I*f}return t};var B=r;export{B as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-QFKZXFLI.js b/plugins/feature/map/Cesium/Workers/chunk-QFKZXFLI.js deleted file mode 100644 index f3845b054..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-QFKZXFLI.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{c as Z}from"./chunk-ZYYZDBKK.js";import{a as o,b as at,e as b}from"./chunk-FGKVHLJ4.js";import{a as R}from"./chunk-YRCAQUFT.js";import{a as w,b as tt}from"./chunk-ELJAHN3H.js";import{e as g}from"./chunk-3BGP4HCL.js";var et={};et.computeDiscriminant=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");return e*e-4*t*r};function ft(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}et.computeRealRoots=function(t,e,r){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");let n;if(t===0)return e===0?[]:[-r/e];if(e===0){if(r===0)return[0,0];let a=Math.abs(r),f=Math.abs(t);if(a<f&&a/f<R.EPSILON14)return[0,0];if(a>f&&f/a<R.EPSILON14)return[];if(n=-r/t,n<0)return[];let l=Math.sqrt(n);return[-l,l]}else if(r===0)return n=-e/t,n<0?[n,0]:[0,n];let i=e*e,c=4*t*r,s=ft(i,-c,R.EPSILON14);if(s<0)return[];let u=-.5*ft(e,R.sign(e)*Math.sqrt(s),R.EPSILON14);return e>0?[u/t,r/u]:[r/u,u/t]};var T=et;var rt={};rt.computeDiscriminant=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i=t*t,c=e*e,s=r*r,u=n*n;return 18*t*e*r*n+c*s-27*i*u-4*(t*s*r+c*e*n)};function nt(t,e,r,n){let i=t,c=e/3,s=r/3,u=n,a=i*s,f=c*u,l=c*c,m=s*s,p=i*s-l,q=i*u-c*s,d=c*u-m,h=4*p*d-q*q,E,D;if(h<0){let K,k,G;l*f>=a*m?(K=i,k=p,G=-2*c*p+i*q):(K=u,k=d,G=-u*q+2*s*d);let ut=-(G<0?-1:1)*Math.abs(K)*Math.sqrt(-h);D=-G+ut;let X=D/2,j=X<0?-Math.pow(-X,1/3):Math.pow(X,1/3),$=D===ut?-j:-k/j;return E=k<=0?j+$:-G/(j*j+$*$+k),l*f>=a*m?[(E-c)/i]:[-u/(E+s)]}let W=p,v=-2*c*p+i*q,L=d,B=-u*q+2*s*d,I=Math.sqrt(h),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(i*I,-v)/3);E=2*Math.sqrt(-W);let y=Math.cos(P);D=E*y;let S=E*(-y/2-C*Math.sin(P)),M=D+S>2*c?D-c:S-c,N=i,x=M/N;P=Math.abs(Math.atan2(u*I,-B)/3),E=2*Math.sqrt(-L),y=Math.cos(P),D=E*y,S=E*(-y/2-C*Math.sin(P));let _=-u,A=D+S<2*s?D+s:S+s,U=_/A,Rt=N*A,ct=-M*A-N*_,yt=M*_,V=(s*ct-c*yt)/(-c*ct+s*Rt);return x<=V?x<=U?V<=U?[x,V,U]:[x,U,V]:[U,x,V]:x<=U?[V,x,U]:V<=U?[V,U,x]:[U,V,x]}rt.computeRealRoots=function(t,e,r,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let i,c;if(t===0)return T.computeRealRoots(e,r,n);if(e===0){if(r===0){if(n===0)return[0,0,0];c=-n/t;let s=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);return[s,s,s]}else if(n===0)return i=T.computeRealRoots(t,0,r),i.Length===0?[0]:[i[0],0,i[1]];return nt(t,0,r,n)}else{if(r===0)return n===0?(c=-e/t,c<0?[c,0,0]:[0,0,c]):nt(t,e,0,n);if(n===0)return i=T.computeRealRoots(t,e,r),i.length===0?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]}return nt(t,e,r,n)};var Y=rt;var ot={};ot.computeDiscriminant=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");let c=t*t,s=c*t,u=e*e,a=u*e,f=r*r,l=f*r,m=n*n,p=m*n,q=i*i,d=q*i;return u*f*m-4*a*p-4*t*l*m+18*t*e*r*p-27*c*m*m+256*s*d+i*(18*a*r*n-4*u*l+16*t*f*f-80*t*e*f*n-6*t*u*m+144*c*r*m)+q*(144*t*u*r-27*u*u-128*c*f-192*c*e*n)};function z(t,e,r,n){let i=t*t,c=e-3*i/8,s=r-e*t/2+i*t/8,u=n-r*t/4+e*i/16-3*i*i/256,a=Y.computeRealRoots(1,2*c,c*c-4*u,-s*s);if(a.length>0){let f=-t/4,l=a[a.length-1];if(Math.abs(l)<R.EPSILON14){let m=T.computeRealRoots(1,c,u);if(m.length===2){let p=m[0],q=m[1],d;if(p>=0&&q>=0){let h=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-h,f+h,f+E]}else{if(p>=0&&q<0)return d=Math.sqrt(p),[f-d,f+d];if(p<0&&q>=0)return d=Math.sqrt(q),[f-d,f+d]}}return[]}else if(l>0){let m=Math.sqrt(l),p=(c+l-s/m)/2,q=(c+l+s/m)/2,d=T.computeRealRoots(1,m,p),h=T.computeRealRoots(1,-m,q);return d.length!==0?(d[0]+=f,d[1]+=f,h.length!==0?(h[0]+=f,h[1]+=f,d[1]<=h[0]?[d[0],d[1],h[0],h[1]]:h[1]<=d[0]?[h[0],h[1],d[0],d[1]]:d[0]>=h[0]&&d[1]<=h[1]?[h[0],d[0],d[1],h[1]]:h[0]>=d[0]&&h[1]<=d[1]?[d[0],h[0],h[1],d[1]]:d[0]>h[0]&&d[0]<h[1]?[h[0],d[0],h[1],d[1]]:[d[0],h[0],d[1],h[1]]):d):h.length!==0?(h[0]+=f,h[1]+=f,h):[]}}return[]}function H(t,e,r,n){let i=r*r,c=e*e,s=t*t,u=-2*e,a=r*t+c-4*n,f=s*n-r*e*t+i,l=Y.computeRealRoots(1,u,a,f);if(l.length>0){let m=l[0],p=e-m,q=p*p,d=t/2,h=p/2,E=q-4*n,D=q+4*Math.abs(n),W=s-4*m,v=s+4*Math.abs(m),L,B;if(m<0||E*v<W*D){let N=Math.sqrt(W);L=N/2,B=N===0?0:(t*h-r)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*h-r)/N,B=N/2}let I,C;d===0&&L===0?(I=0,C=0):R.sign(d)===R.sign(L)?(I=d+L,C=m/I):(C=d-L,I=m/C);let P,y;h===0&&B===0?(P=0,y=0):R.sign(h)===R.sign(B)?(P=h+B,y=n/P):(y=h-B,P=n/y);let S=T.computeRealRoots(1,I,P),M=T.computeRealRoots(1,C,y);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}ot.computeRealRoots=function(t,e,r,n,i){if(typeof t!="number")throw new w("a is a required number.");if(typeof e!="number")throw new w("b is a required number.");if(typeof r!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof i!="number")throw new w("e is a required number.");if(Math.abs(t)<R.EPSILON15)return Y.computeRealRoots(e,r,n,i);let c=e/t,s=r/t,u=n/t,a=i/t,f=c<0?1:0;switch(f+=s<0?f+1:f,f+=u<0?f+1:f,f+=a<0?f+1:f,f){case 0:return z(c,s,u,a);case 1:return H(c,s,u,a);case 2:return H(c,s,u,a);case 3:return z(c,s,u,a);case 4:return z(c,s,u,a);case 5:return H(c,s,u,a);case 6:return z(c,s,u,a);case 7:return z(c,s,u,a);case 8:return H(c,s,u,a);case 9:return z(c,s,u,a);case 10:return z(c,s,u,a);case 11:return H(c,s,u,a);case 12:return z(c,s,u,a);case 13:return z(c,s,u,a);case 14:return z(c,s,u,a);case 15:return z(c,s,u,a);default:return}};var dt=ot;function F(t,e){e=o.clone(e??o.ZERO),o.equals(e,o.ZERO)||o.normalize(e,e),this.origin=o.clone(t??o.ZERO),this.direction=e}F.clone=function(t,e){if(g(t))return g(e)?(e.origin=o.clone(t.origin),e.direction=o.clone(t.direction),e):new F(t.origin,t.direction)};F.getPoint=function(t,e,r){return tt.typeOf.object("ray",t),tt.typeOf.number("t",e),g(r)||(r=new o),r=o.multiplyByScalar(t.direction,e,r),o.add(t.origin,r,r)};var it=F;var O={};O.rayPlane=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("plane is required.");g(r)||(r=new o);let n=t.origin,i=t.direction,c=e.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON15)return;let u=(-e.distance-o.dot(c,n))/s;if(!(u<0))return r=o.multiplyByScalar(i,u,r),o.add(n,r,r)};var bt=new o,Ot=new o,St=new o,mt=new o,lt=new o;O.rayTriangleParametric=function(t,e,r,n,i){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");i=i??!1;let c=t.origin,s=t.direction,u=o.subtract(r,e,bt),a=o.subtract(n,e,Ot),f=o.cross(s,a,St),l=o.dot(u,f),m,p,q,d,h;if(i){if(l<R.EPSILON6||(m=o.subtract(c,e,mt),q=o.dot(m,f),q<0||q>l)||(p=o.cross(m,u,lt),d=o.dot(s,p),d<0||q+d>l))return;h=o.dot(a,p)/l}else{if(Math.abs(l)<R.EPSILON6)return;let E=1/l;if(m=o.subtract(c,e,mt),q=o.dot(m,f)*E,q<0||q>1||(p=o.cross(m,u,lt),d=o.dot(s,p)*E,d<0||q+d>1))return;h=o.dot(a,p)*E}return h};O.rayTriangle=function(t,e,r,n,i,c){let s=O.rayTriangleParametric(t,e,r,n,i);if(!(!g(s)||s<0))return g(c)||(c=new o),o.multiplyByScalar(t.direction,s,c),o.add(t.origin,c,c)};var Pt=new it;O.lineSegmentTriangle=function(t,e,r,n,i,c,s){if(!g(t))throw new w("v0 is required.");if(!g(e))throw new w("v1 is required.");if(!g(r))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(i))throw new w("p2 is required.");let u=Pt;o.clone(t,u.origin),o.subtract(e,t,u.direction),o.normalize(u.direction,u.direction);let a=O.rayTriangleParametric(u,r,n,i,c);if(!(!g(a)||a<0||a>o.distance(t,e)))return g(s)||(s=new o),o.multiplyByScalar(u.direction,a,s),o.add(u.origin,s,s)};function Et(t,e,r,n){let i=e*e-4*t*r;if(i<0)return;if(i>0){let s=1/(2*t),u=Math.sqrt(i),a=(-e+u)*s,f=(-e-u)*s;return a<f?(n.root0=a,n.root1=f):(n.root0=f,n.root1=a),n}let c=-e/(2*t);if(c!==0)return n.root0=n.root1=c,n}var Ct={root0:0,root1:0};function Mt(t,e,r){g(r)||(r=new Z);let n=t.origin,i=t.direction,c=e.center,s=e.radius*e.radius,u=o.subtract(n,c,St),a=o.dot(i,i),f=2*o.dot(i,u),l=o.magnitudeSquared(u)-s,m=Et(a,f,l,Ct);if(g(m))return r.start=m.root0,r.stop=m.root1,r}O.raySphere=function(t,e,r){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("sphere is required.");if(r=Mt(t,e,r),!(!g(r)||r.stop<0))return r.start=Math.max(r.start,0),r};var Nt=new it;O.lineSegmentSphere=function(t,e,r,n){if(!g(t))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(r))throw new w("sphere is required.");let i=Nt;o.clone(t,i.origin);let c=o.subtract(e,t,i.direction),s=o.magnitude(c);if(o.normalize(c,c),n=Mt(i,r,n),!(!g(n)||n.stop<0||n.start>s))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,s),n};var Lt=new o,It=new o;O.rayEllipsoid=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=e.oneOverRadii,n=o.multiplyComponents(r,t.origin,Lt),i=o.multiplyComponents(r,t.direction,It),c=o.magnitudeSquared(n),s=o.dot(n,i),u,a,f,l,m;if(c>1){if(s>=0)return;let p=s*s;if(u=c-1,a=o.magnitudeSquared(i),f=a*u,p<f)return;if(p>f){l=s*s-f,m=-s+Math.sqrt(l);let d=m/a,h=u/m;return d<h?new Z(d,h):{start:h,stop:d}}let q=Math.sqrt(u/a);return new Z(q,q)}else if(c<1)return u=c-1,a=o.magnitudeSquared(i),f=a*u,l=s*s-f,m=-s+Math.sqrt(l),new Z(0,m/a);if(s<0)return a=o.magnitudeSquared(i),new Z(0,-s/a)};function Q(t,e,r){let n=t+e;return R.sign(t)!==R.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}O.quadraticVectorExpression=function(t,e,r,n,i){let c=n*n,s=i*i,u=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*s,a=i*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],R.EPSILON15)+e.y),f=t[b.COLUMN0ROW0]*c+t[b.COLUMN2ROW2]*s+n*e.x+r,l=s*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],R.EPSILON15),m=i*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+e.z),p,q=[];if(m===0&&l===0){if(p=T.computeRealRoots(u,a,f),p.length===0)return q;let P=p[0],y=Math.sqrt(Math.max(1-P*P,0));if(q.push(new o(n,i*P,i*-y)),q.push(new o(n,i*P,i*y)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new o(n,i*S,i*-M)),q.push(new o(n,i*S,i*M))}return q}let d=m*m,h=l*l,E=u*u,D=m*l,W=E+h,v=2*(a*u+D),L=2*f*u+a*a-h+d,B=2*(f*a-D),I=f*f-d;if(W===0&&v===0&&L===0&&B===0)return q;p=dt.computeRealRoots(W,v,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let y=p[P],S=y*y,M=Math.max(1-S,0),N=Math.sqrt(M),x;R.sign(u)===R.sign(f)?x=Q(u*S+f,a*y,R.EPSILON12):R.sign(f)===R.sign(a*y)?x=Q(u*S,a*y+f,R.EPSILON12):x=Q(u*S+a*y,f,R.EPSILON12);let _=Q(l*y,m,R.EPSILON15),A=x*_;A<0?q.push(new o(n,i*y,i*N)):A>0?q.push(new o(n,i*y,i*-N)):N!==0?(q.push(new o(n,i*y,i*-N)),q.push(new o(n,i*y,i*N)),++P):q.push(new o(n,i*y,i*N))}return q};var st=new o,ht=new o,wt=new o,J=new o,Dt=new o,Bt=new b,xt=new b,Tt=new b,zt=new b,Wt=new b,qt=new b,gt=new b,pt=new o,vt=new o,Ut=new at;O.grazingAltitudeLocation=function(t,e){if(!g(t))throw new w("ray is required.");if(!g(e))throw new w("ellipsoid is required.");let r=t.origin,n=t.direction;if(!o.equals(r,o.ZERO)){let I=e.geodeticSurfaceNormal(r,st);if(o.dot(n,I)>=0)return r}let i=g(this.rayEllipsoid(t,e)),c=e.transformPositionToScaledSpace(n,st),s=o.normalize(c,c),u=o.mostOrthogonalAxis(c,J),a=o.normalize(o.cross(u,s,ht),ht),f=o.normalize(o.cross(s,a,wt),wt),l=Bt;l[0]=s.x,l[1]=s.y,l[2]=s.z,l[3]=a.x,l[4]=a.y,l[5]=a.z,l[6]=f.x,l[7]=f.y,l[8]=f.z;let m=b.transpose(l,xt),p=b.fromScale(e.radii,Tt),q=b.fromScale(e.oneOverRadii,zt),d=Wt;d[0]=0,d[1]=-n.z,d[2]=n.y,d[3]=n.z,d[4]=0,d[5]=-n.x,d[6]=-n.y,d[7]=n.x,d[8]=0;let h=b.multiply(b.multiply(m,q,qt),d,qt),E=b.multiply(b.multiply(h,p,gt),l,gt),D=b.multiplyByVector(h,r,Dt),W=O.quadraticVectorExpression(E,o.negate(D,st),0,0,1),v,L,B=W.length;if(B>0){let I=o.clone(o.ZERO,vt),C=Number.NEGATIVE_INFINITY;for(let y=0;y<B;++y){v=b.multiplyByVector(p,b.multiplyByVector(l,W[y],pt),pt);let S=o.normalize(o.subtract(v,r,J),J),M=o.dot(S,n);M>C&&(C=M,I=o.clone(v,I))}let P=e.cartesianToCartographic(I,Ut);return C=R.clamp(C,0,1),L=o.magnitude(o.subtract(I,r,J))*Math.sqrt(1-C*C),L=i?-L:L,P.height=L,e.cartographicToCartesian(P,new o)}};var Vt=new o;O.lineSegmentPlane=function(t,e,r,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(e))throw new w("endPoint1 is required.");if(!g(r))throw new w("plane is required.");g(n)||(n=new o);let i=o.subtract(e,t,Vt),c=r.normal,s=o.dot(c,i);if(Math.abs(s)<R.EPSILON6)return;let u=o.dot(c,t),a=-(r.distance+u)/s;if(!(a<0||a>1))return o.multiplyByScalar(i,a,n),o.add(t,n,n),n};O.trianglePlaneIntersection=function(t,e,r,n){if(!g(t)||!g(e)||!g(r)||!g(n))throw new w("p0, p1, p2, and plane are required.");let i=n.normal,c=n.distance,s=o.dot(i,t)+c<0,u=o.dot(i,e)+c<0,a=o.dot(i,r)+c<0,f=0;f+=s?1:0,f+=u?1:0,f+=a?1:0;let l,m;if((f===1||f===2)&&(l=new o,m=new o),f===1){if(s)return O.lineSegmentPlane(t,e,n,l),O.lineSegmentPlane(t,r,n,m),{positions:[t,e,r,l,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return O.lineSegmentPlane(e,r,n,l),O.lineSegmentPlane(e,t,n,m),{positions:[t,e,r,l,m],indices:[1,3,4,2,0,4,2,4,3]};if(a)return O.lineSegmentPlane(r,t,n,l),O.lineSegmentPlane(r,e,n,m),{positions:[t,e,r,l,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(s)if(u){if(!a)return O.lineSegmentPlane(t,r,n,l),O.lineSegmentPlane(e,r,n,m),{positions:[t,e,r,l,m],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(r,e,n,l),O.lineSegmentPlane(t,e,n,m),{positions:[t,e,r,l,m],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(e,t,n,l),O.lineSegmentPlane(r,t,n,m),{positions:[t,e,r,l,m],indices:[1,2,4,1,4,3,0,3,4]}};var me=O;export{it as a,me as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-QQWQKL3T.js b/plugins/feature/map/Cesium/Workers/chunk-QQWQKL3T.js new file mode 100644 index 000000000..c87ca6c7e --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-QQWQKL3T.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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 e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(e);var t=e;export{t as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-QXSX66ML.js b/plugins/feature/map/Cesium/Workers/chunk-QXSX66ML.js deleted file mode 100644 index 0e35ff4a9..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-QXSX66ML.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as N}from"./chunk-S3L7VZFL.js";import{a as Q}from"./chunk-ASLWXOD7.js";import{a as ae}from"./chunk-J3L5WX3X.js";import{b as oe,c as re,d as J}from"./chunk-AVPLM4UI.js";import{b as E,d as ie}from"./chunk-ZYYZDBKK.js";import{a as C,b as F,f as D}from"./chunk-3PT5NNSP.js";import{a as H}from"./chunk-WER4LUMF.js";import{a as r,e as G,f as A}from"./chunk-FGKVHLJ4.js";import{a as O}from"./chunk-YRCAQUFT.js";import{a as w,b}from"./chunk-ELJAHN3H.js";import{e as a}from"./chunk-3BGP4HCL.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,de=new r,fe=new Q(new r(1,0,0),0);R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let s=e.center,_=e.radius,p=0;for(let m=0;m<n;++m){let i=X[m],c=f[p],d=f[p+1];a(c)||(c=f[p]=new C),a(d)||(d=f[p+1]=new C),r.multiplyByScalar(i,-_,j),r.add(s,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(s,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,de),j),p+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,s=t.length;f<s;++f){let _=e.intersectPlane(Q.fromCartesian4(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let s=0,_=f.length;s<_;++s){let p=s<31?1<<s:0;if(s<31&&!(t&p))continue;let m=e.intersectPlane(Q.fromCartesian4(f[s],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=p)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var $=R;function M(e){e=e??A.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new $,this._orthographicMatrix=new F}function ce(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than 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=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,me);r.normalize(d,d);let y=ye;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=ge;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,p,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,ee),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,s,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,ee),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,ee),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,s){if(ce(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=this.right-this.left,p=this.top-this.bottom,m=f*_/e,i=f*p/t;return s.x=m,s.y=i,s};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var he=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new he,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than 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(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,s){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new $,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function te(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:s,near:_,far:p}=e;if(t!==e._top||n!==e._bottom||s!==e._left||f!==e._right||_!==e._near||p!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=s,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=p,e._perspectiveMatrix=F.computePerspectiveOffCenter(s,f,n,t,_,p,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(s,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Oe=new r,Fe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,s=this.top,_=this.bottom,p=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,Ce),y=be;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Oe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Fe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,s){if(te(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(s))throw new w("A result object is required.");let _=1/this.near,p=this.top*_,m=2*f*n*p/t;p=this.right*_;let i=2*f*n*p/e;return s.x=i,s.y=m,s};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=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};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");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;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");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(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,s){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,s)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var I=0,Pe=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,s=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,p,m;t instanceof L?(p=I,m=L.packedLength):t instanceof V&&(p=Pe,m=V.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,s=e._frustum;return t[n++]=f,f===I?(L.pack(s,t,n),n+=L.packedLength):(V.pack(s,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var ze=new L,xe=new V,ve=new D,Re=new r,Te=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],s;f===I?(s=L.unpack(e,t,ze),t+=L.packedLength):(s=V.unpack(e,t,xe),t+=V.packedLength);let _=r.unpack(e,t,Re);t+=r.packedLength;let p=D.unpack(e,t,ve);t+=D.packedLength;let m=N.unpack(e,t,Te);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:s,origin:_,orientation:p,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=s.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(p,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,s,_,p,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=p.x,n[e+1]=p.y,n[e+2]=p.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;s[i]=0,s[i+1]=0,s[i+2]=1,s[i+3]=0,s[i+4]=1,s[i+5]=1,s[i+6]=0,s[i+7]=1}var qe=new G,Me=new F,ne=new F,pe=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var _e=new Array(4);for(let e=0;e<4;++e)_e[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,s,_,p,m){let i=G.fromQuaternion(t,qe),c=_??pe,d=p??le,y=m??we;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,Me),o,h,q=f.projectionMatrix;if(n===I){let P=F.multiply(q,l,ne);h=F.inverse(P,ne)}else o=F.inverseTransformation(l,ne);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],_e[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}s[12*P+z*3]=g.x,s[12*P+z*3+1]=g.y,s[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,s=e._orientation,_=e._drawNearPlane,p=e._vertexFormat,m=_?6:5,i=new Float64Array(3*4*6);u._computeNearFarPlanes(f,s,t,n,i);let c=3*4*2;i[c]=i[3*4],i[c+1]=i[3*4+1],i[c+2]=i[3*4+2],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[3*3],i[c+7]=i[3*3+1],i[c+8]=i[3*3+2],i[c+9]=i[3*7],i[c+10]=i[3*7+1],i[c+11]=i[3*7+2],c+=3*4,i[c]=i[3*5],i[c+1]=i[3*5+1],i[c+2]=i[3*5+2],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[3*4],i[c+10]=i[3*4+1],i[c+11]=i[3*4+2],c+=3*4,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[3*5],i[c+4]=i[3*5+1],i[c+5]=i[3*5+2],i[c+6]=i[3*6],i[c+7]=i[3*6+1],i[c+8]=i[3*6+2],i[c+9]=i[3*2],i[c+10]=i[3*2+1],i[c+11]=i[3*2+2],c+=3*4,i[c]=i[3*2],i[c+1]=i[3*2+1],i[c+2]=i[3*2+2],i[c+3]=i[3*6],i[c+4]=i[3*6+1],i[c+5]=i[3*6+2],i[c+6]=i[3*7],i[c+7]=i[3*7+1],i[c+8]=i[3*7+2],i[c+9]=i[3*3],i[c+10]=i[3*3+1],i[c+11]=i[3*3+2],_||(i=i.subarray(3*4));let d=new ae({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){let l=a(p.normal)?new Float32Array(12*m):void 0,o=a(p.tangent)?new Float32Array(3*4*m):void 0,h=a(p.bitangent)?new Float32Array(3*4*m):void 0,q=a(p.st)?new Float32Array(2*4*m):void 0,P=pe,z=le,g=we,S=r.negate(P,ke),Y=r.negate(z,Se),K=r.negate(g,De);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=3*4),W(c,l,o,h,q,g,S,z),c+=3*4,W(c,l,o,h,q,S,K,z),c+=3*4,W(c,l,o,h,q,Y,K,S),c+=3*4,W(c,l,o,h,q,P,g,z),c+=3*4,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new re({attributes:d,indices:y,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(i)})};var Et=u;export{V as a,L as b,Et as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-RDRVGSTZ.js b/plugins/feature/map/Cesium/Workers/chunk-RDRVGSTZ.js new file mode 100644 index 000000000..fd1038286 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-RDRVGSTZ.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{d as j}from"./chunk-KP72RGCH.js";import{c as g}from"./chunk-OSVSBQDY.js";import{a as i}from"./chunk-LZC73BOP.js";import{b as C}from"./chunk-OU2IPMYE.js";import{f as O}from"./chunk-H7SJWKIY.js";function a(n,r,o){return o<0&&(o+=1),o>1&&(o-=1),o*6<1?n+(r-n)*6*o:o*2<1?r:o*3<2?n+(r-n)*(2/3-o)*6:n}var e=class n{constructor(r,o,t,f){this.red=r??1,this.green=o??1,this.blue=t??1,this.alpha=f??1}static fromCartesian4(r,o){return C.typeOf.object("cartesian",r),O(o)?(o.red=r.x,o.green=r.y,o.blue=r.z,o.alpha=r.w,o):new n(r.x,r.y,r.z,r.w)}static fromBytes(r,o,t,f,s){return r=n.byteToFloat(r??255),o=n.byteToFloat(o??255),t=n.byteToFloat(t??255),f=n.byteToFloat(f??255),O(s)?(s.red=r,s.green=o,s.blue=t,s.alpha=f,s):new n(r,o,t,f)}static fromAlpha(r,o,t){return C.typeOf.object("color",r),C.typeOf.number("alpha",o),O(t)?(t.red=r.red,t.green=r.green,t.blue=r.blue,t.alpha=o,t):new n(r.red,r.green,r.blue,o)}static fromRgba(r,o){return A[0]=r,n.fromBytes(m[0],m[1],m[2],m[3],o)}static fromHsl(r,o,t,f,s){r=(r??0)%1,o=o??0,t=t??0,f=f??1;let c=t,b=t,E=t;if(o!==0){let S;t<.5?S=t*(1+o):S=t+o-t*o;let F=2*t-S;c=a(F,S,r+1/3),b=a(F,S,r),E=a(F,S,r-1/3)}return O(s)?(s.red=c,s.green=b,s.blue=E,s.alpha=f,s):new n(c,b,E,f)}static fromRandom(r,o){r=r??g.EMPTY_OBJECT;let t=r.red;if(!O(t)){let b=r.minimumRed??0,E=r.maximumRed??1;C.typeOf.number.lessThanOrEquals("minimumRed",b,E),t=b+i.nextRandomNumber()*(E-b)}let f=r.green;if(!O(f)){let b=r.minimumGreen??0,E=r.maximumGreen??1;C.typeOf.number.lessThanOrEquals("minimumGreen",b,E),f=b+i.nextRandomNumber()*(E-b)}let s=r.blue;if(!O(s)){let b=r.minimumBlue??0,E=r.maximumBlue??1;C.typeOf.number.lessThanOrEquals("minimumBlue",b,E),s=b+i.nextRandomNumber()*(E-b)}let c=r.alpha;if(!O(c)){let b=r.minimumAlpha??0,E=r.maximumAlpha??1;C.typeOf.number.lessThanOrEquals("minimumAlpha",b,E),c=b+i.nextRandomNumber()*(E-b)}return O(o)?(o.red=t,o.green=f,o.blue=s,o.alpha=c,o):new n(t,f,s,c)}static fromCssColorString(r,o){C.typeOf.string("color",r),O(o)||(o=new n),r=r.trim();let t=n[r.toUpperCase()];if(O(t))return n.clone(t,o),o;let f=z.exec(r);return f!==null?(o.red=parseInt(f[1],16)/15,o.green=parseInt(f[2],16)/15,o.blue=parseInt(f[3],16)/15,o.alpha=parseInt(f[4]??"f",16)/15,o):(f=R.exec(r),f!==null?(o.red=parseInt(f[1],16)/255,o.green=parseInt(f[2],16)/255,o.blue=parseInt(f[3],16)/255,o.alpha=parseInt(f[4]??"ff",16)/255,o):(f=D.exec(r),f!==null?(o.red=parseFloat(f[1])/(f[1].substr(-1)==="%"?100:255),o.green=parseFloat(f[2])/(f[2].substr(-1)==="%"?100:255),o.blue=parseFloat(f[3])/(f[3].substr(-1)==="%"?100:255),o.alpha=parseFloat(f[4]??"1.0"),o):(f=p.exec(r),f!==null?n.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(f[4]??"1.0"),o):(o=void 0,o))))}static pack(r,o,t){return C.typeOf.object("value",r),C.defined("array",o),t=t??0,o[t++]=r.red,o[t++]=r.green,o[t++]=r.blue,o[t]=r.alpha,o}static unpack(r,o,t){return C.defined("array",r),o=o??0,O(t)||(t=new n),t.red=r[o++],t.green=r[o++],t.blue=r[o++],t.alpha=r[o],t}static byteToFloat(r){return r/255}static floatToByte(r){return r===1?255:r*256|0}static clone(r,o){if(O(r))return O(o)?(o.red=r.red,o.green=r.green,o.blue=r.blue,o.alpha=r.alpha,o):new n(r.red,r.green,r.blue,r.alpha)}static equals(r,o){return r===o||O(r)&&O(o)&&r.red===o.red&&r.green===o.green&&r.blue===o.blue&&r.alpha===o.alpha}static equalsArray(r,o,t){return r.red===o[t]&&r.green===o[t+1]&&r.blue===o[t+2]&&r.alpha===o[t+3]}clone(r){return n.clone(this,r)}equals(r){return n.equals(this,r)}equalsEpsilon(r,o){return this===r||O(r)&&Math.abs(this.red-r.red)<=o&&Math.abs(this.green-r.green)<=o&&Math.abs(this.blue-r.blue)<=o&&Math.abs(this.alpha-r.alpha)<=o}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let r=n.floatToByte(this.red),o=n.floatToByte(this.green),t=n.floatToByte(this.blue);return this.alpha===1?`rgb(${r},${o},${t})`:`rgba(${r},${o},${t},${this.alpha})`}toCssHexString(){let r=n.floatToByte(this.red).toString(16);r.length<2&&(r=`0${r}`);let o=n.floatToByte(this.green).toString(16);o.length<2&&(o=`0${o}`);let t=n.floatToByte(this.blue).toString(16);if(t.length<2&&(t=`0${t}`),this.alpha<1){let f=n.floatToByte(this.alpha).toString(16);return f.length<2&&(f=`0${f}`),`#${r}${o}${t}${f}`}return`#${r}${o}${t}`}toBytes(r){let o=n.floatToByte(this.red),t=n.floatToByte(this.green),f=n.floatToByte(this.blue),s=n.floatToByte(this.alpha);return O(r)?(r[0]=o,r[1]=t,r[2]=f,r[3]=s,r):[o,t,f,s]}static bytesToRgba(r,o,t,f){return m[0]=r,m[1]=o,m[2]=t,m[3]=f,A[0]}toRgba(){return n.bytesToRgba(n.floatToByte(this.red),n.floatToByte(this.green),n.floatToByte(this.blue),n.floatToByte(this.alpha))}brighten(r,o){return C.typeOf.number("magnitude",r),C.typeOf.number.greaterThanOrEquals("magnitude",r,0),C.typeOf.object("result",o),r=1-r,o.red=1-(1-this.red)*r,o.green=1-(1-this.green)*r,o.blue=1-(1-this.blue)*r,o.alpha=this.alpha,o}darken(r,o){return C.typeOf.number("magnitude",r),C.typeOf.number.greaterThanOrEquals("magnitude",r,0),C.typeOf.object("result",o),r=1-r,o.red=this.red*r,o.green=this.green*r,o.blue=this.blue*r,o.alpha=this.alpha,o}withAlpha(r,o){return n.fromAlpha(this,r,o)}static add(r,o,t){return C.typeOf.object("left",r),C.typeOf.object("right",o),C.typeOf.object("result",t),t.red=r.red+o.red,t.green=r.green+o.green,t.blue=r.blue+o.blue,t.alpha=r.alpha+o.alpha,t}static subtract(r,o,t){return C.typeOf.object("left",r),C.typeOf.object("right",o),C.typeOf.object("result",t),t.red=r.red-o.red,t.green=r.green-o.green,t.blue=r.blue-o.blue,t.alpha=r.alpha-o.alpha,t}static multiply(r,o,t){return C.typeOf.object("left",r),C.typeOf.object("right",o),C.typeOf.object("result",t),t.red=r.red*o.red,t.green=r.green*o.green,t.blue=r.blue*o.blue,t.alpha=r.alpha*o.alpha,t}static divide(r,o,t){return C.typeOf.object("left",r),C.typeOf.object("right",o),C.typeOf.object("result",t),t.red=r.red/o.red,t.green=r.green/o.green,t.blue=r.blue/o.blue,t.alpha=r.alpha/o.alpha,t}static mod(r,o,t){return C.typeOf.object("left",r),C.typeOf.object("right",o),C.typeOf.object("result",t),t.red=r.red%o.red,t.green=r.green%o.green,t.blue=r.blue%o.blue,t.alpha=r.alpha%o.alpha,t}static lerp(r,o,t,f){return C.typeOf.object("start",r),C.typeOf.object("end",o),C.typeOf.number("t",t),C.typeOf.object("result",f),f.red=i.lerp(r.red,o.red,t),f.green=i.lerp(r.green,o.green,t),f.blue=i.lerp(r.blue,o.blue,t),f.alpha=i.lerp(r.alpha,o.alpha,t),f}static multiplyByScalar(r,o,t){return C.typeOf.object("color",r),C.typeOf.number("scalar",o),C.typeOf.object("result",t),t.red=r.red*o,t.green=r.green*o,t.blue=r.blue*o,t.alpha=r.alpha*o,t}static divideByScalar(r,o,t){return C.typeOf.object("color",r),C.typeOf.number("scalar",o),C.typeOf.object("result",t),t.red=r.red/o,t.green=r.green/o,t.blue=r.blue/o,t.alpha=r.alpha/o,t}},l,A,m;j.supportsTypedArrays()&&(l=new ArrayBuffer(4),A=new Uint32Array(l),m=new Uint8Array(l));var z=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,R=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,D=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,p=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;e.packedLength=4;e.ALICEBLUE=Object.freeze(e.fromCssColorString("#F0F8FF"));e.ANTIQUEWHITE=Object.freeze(e.fromCssColorString("#FAEBD7"));e.AQUA=Object.freeze(e.fromCssColorString("#00FFFF"));e.AQUAMARINE=Object.freeze(e.fromCssColorString("#7FFFD4"));e.AZURE=Object.freeze(e.fromCssColorString("#F0FFFF"));e.BEIGE=Object.freeze(e.fromCssColorString("#F5F5DC"));e.BISQUE=Object.freeze(e.fromCssColorString("#FFE4C4"));e.BLACK=Object.freeze(e.fromCssColorString("#000000"));e.BLANCHEDALMOND=Object.freeze(e.fromCssColorString("#FFEBCD"));e.BLUE=Object.freeze(e.fromCssColorString("#0000FF"));e.BLUEVIOLET=Object.freeze(e.fromCssColorString("#8A2BE2"));e.BROWN=Object.freeze(e.fromCssColorString("#A52A2A"));e.BURLYWOOD=Object.freeze(e.fromCssColorString("#DEB887"));e.CADETBLUE=Object.freeze(e.fromCssColorString("#5F9EA0"));e.CHARTREUSE=Object.freeze(e.fromCssColorString("#7FFF00"));e.CHOCOLATE=Object.freeze(e.fromCssColorString("#D2691E"));e.CORAL=Object.freeze(e.fromCssColorString("#FF7F50"));e.CORNFLOWERBLUE=Object.freeze(e.fromCssColorString("#6495ED"));e.CORNSILK=Object.freeze(e.fromCssColorString("#FFF8DC"));e.CRIMSON=Object.freeze(e.fromCssColorString("#DC143C"));e.CYAN=Object.freeze(e.fromCssColorString("#00FFFF"));e.DARKBLUE=Object.freeze(e.fromCssColorString("#00008B"));e.DARKCYAN=Object.freeze(e.fromCssColorString("#008B8B"));e.DARKGOLDENROD=Object.freeze(e.fromCssColorString("#B8860B"));e.DARKGRAY=Object.freeze(e.fromCssColorString("#A9A9A9"));e.DARKGREEN=Object.freeze(e.fromCssColorString("#006400"));e.DARKGREY=e.DARKGRAY;e.DARKKHAKI=Object.freeze(e.fromCssColorString("#BDB76B"));e.DARKMAGENTA=Object.freeze(e.fromCssColorString("#8B008B"));e.DARKOLIVEGREEN=Object.freeze(e.fromCssColorString("#556B2F"));e.DARKORANGE=Object.freeze(e.fromCssColorString("#FF8C00"));e.DARKORCHID=Object.freeze(e.fromCssColorString("#9932CC"));e.DARKRED=Object.freeze(e.fromCssColorString("#8B0000"));e.DARKSALMON=Object.freeze(e.fromCssColorString("#E9967A"));e.DARKSEAGREEN=Object.freeze(e.fromCssColorString("#8FBC8F"));e.DARKSLATEBLUE=Object.freeze(e.fromCssColorString("#483D8B"));e.DARKSLATEGRAY=Object.freeze(e.fromCssColorString("#2F4F4F"));e.DARKSLATEGREY=e.DARKSLATEGRAY;e.DARKTURQUOISE=Object.freeze(e.fromCssColorString("#00CED1"));e.DARKVIOLET=Object.freeze(e.fromCssColorString("#9400D3"));e.DEEPPINK=Object.freeze(e.fromCssColorString("#FF1493"));e.DEEPSKYBLUE=Object.freeze(e.fromCssColorString("#00BFFF"));e.DIMGRAY=Object.freeze(e.fromCssColorString("#696969"));e.DIMGREY=e.DIMGRAY;e.DODGERBLUE=Object.freeze(e.fromCssColorString("#1E90FF"));e.FIREBRICK=Object.freeze(e.fromCssColorString("#B22222"));e.FLORALWHITE=Object.freeze(e.fromCssColorString("#FFFAF0"));e.FORESTGREEN=Object.freeze(e.fromCssColorString("#228B22"));e.FUCHSIA=Object.freeze(e.fromCssColorString("#FF00FF"));e.GAINSBORO=Object.freeze(e.fromCssColorString("#DCDCDC"));e.GHOSTWHITE=Object.freeze(e.fromCssColorString("#F8F8FF"));e.GOLD=Object.freeze(e.fromCssColorString("#FFD700"));e.GOLDENROD=Object.freeze(e.fromCssColorString("#DAA520"));e.GRAY=Object.freeze(e.fromCssColorString("#808080"));e.GREEN=Object.freeze(e.fromCssColorString("#008000"));e.GREENYELLOW=Object.freeze(e.fromCssColorString("#ADFF2F"));e.GREY=e.GRAY;e.HONEYDEW=Object.freeze(e.fromCssColorString("#F0FFF0"));e.HOTPINK=Object.freeze(e.fromCssColorString("#FF69B4"));e.INDIANRED=Object.freeze(e.fromCssColorString("#CD5C5C"));e.INDIGO=Object.freeze(e.fromCssColorString("#4B0082"));e.IVORY=Object.freeze(e.fromCssColorString("#FFFFF0"));e.KHAKI=Object.freeze(e.fromCssColorString("#F0E68C"));e.LAVENDER=Object.freeze(e.fromCssColorString("#E6E6FA"));e.LAVENDAR_BLUSH=Object.freeze(e.fromCssColorString("#FFF0F5"));e.LAWNGREEN=Object.freeze(e.fromCssColorString("#7CFC00"));e.LEMONCHIFFON=Object.freeze(e.fromCssColorString("#FFFACD"));e.LIGHTBLUE=Object.freeze(e.fromCssColorString("#ADD8E6"));e.LIGHTCORAL=Object.freeze(e.fromCssColorString("#F08080"));e.LIGHTCYAN=Object.freeze(e.fromCssColorString("#E0FFFF"));e.LIGHTGOLDENRODYELLOW=Object.freeze(e.fromCssColorString("#FAFAD2"));e.LIGHTGRAY=Object.freeze(e.fromCssColorString("#D3D3D3"));e.LIGHTGREEN=Object.freeze(e.fromCssColorString("#90EE90"));e.LIGHTGREY=e.LIGHTGRAY;e.LIGHTPINK=Object.freeze(e.fromCssColorString("#FFB6C1"));e.LIGHTSEAGREEN=Object.freeze(e.fromCssColorString("#20B2AA"));e.LIGHTSKYBLUE=Object.freeze(e.fromCssColorString("#87CEFA"));e.LIGHTSLATEGRAY=Object.freeze(e.fromCssColorString("#778899"));e.LIGHTSLATEGREY=e.LIGHTSLATEGRAY;e.LIGHTSTEELBLUE=Object.freeze(e.fromCssColorString("#B0C4DE"));e.LIGHTYELLOW=Object.freeze(e.fromCssColorString("#FFFFE0"));e.LIME=Object.freeze(e.fromCssColorString("#00FF00"));e.LIMEGREEN=Object.freeze(e.fromCssColorString("#32CD32"));e.LINEN=Object.freeze(e.fromCssColorString("#FAF0E6"));e.MAGENTA=Object.freeze(e.fromCssColorString("#FF00FF"));e.MAROON=Object.freeze(e.fromCssColorString("#800000"));e.MEDIUMAQUAMARINE=Object.freeze(e.fromCssColorString("#66CDAA"));e.MEDIUMBLUE=Object.freeze(e.fromCssColorString("#0000CD"));e.MEDIUMORCHID=Object.freeze(e.fromCssColorString("#BA55D3"));e.MEDIUMPURPLE=Object.freeze(e.fromCssColorString("#9370DB"));e.MEDIUMSEAGREEN=Object.freeze(e.fromCssColorString("#3CB371"));e.MEDIUMSLATEBLUE=Object.freeze(e.fromCssColorString("#7B68EE"));e.MEDIUMSPRINGGREEN=Object.freeze(e.fromCssColorString("#00FA9A"));e.MEDIUMTURQUOISE=Object.freeze(e.fromCssColorString("#48D1CC"));e.MEDIUMVIOLETRED=Object.freeze(e.fromCssColorString("#C71585"));e.MIDNIGHTBLUE=Object.freeze(e.fromCssColorString("#191970"));e.MINTCREAM=Object.freeze(e.fromCssColorString("#F5FFFA"));e.MISTYROSE=Object.freeze(e.fromCssColorString("#FFE4E1"));e.MOCCASIN=Object.freeze(e.fromCssColorString("#FFE4B5"));e.NAVAJOWHITE=Object.freeze(e.fromCssColorString("#FFDEAD"));e.NAVY=Object.freeze(e.fromCssColorString("#000080"));e.OLDLACE=Object.freeze(e.fromCssColorString("#FDF5E6"));e.OLIVE=Object.freeze(e.fromCssColorString("#808000"));e.OLIVEDRAB=Object.freeze(e.fromCssColorString("#6B8E23"));e.ORANGE=Object.freeze(e.fromCssColorString("#FFA500"));e.ORANGERED=Object.freeze(e.fromCssColorString("#FF4500"));e.ORCHID=Object.freeze(e.fromCssColorString("#DA70D6"));e.PALEGOLDENROD=Object.freeze(e.fromCssColorString("#EEE8AA"));e.PALEGREEN=Object.freeze(e.fromCssColorString("#98FB98"));e.PALETURQUOISE=Object.freeze(e.fromCssColorString("#AFEEEE"));e.PALEVIOLETRED=Object.freeze(e.fromCssColorString("#DB7093"));e.PAPAYAWHIP=Object.freeze(e.fromCssColorString("#FFEFD5"));e.PEACHPUFF=Object.freeze(e.fromCssColorString("#FFDAB9"));e.PERU=Object.freeze(e.fromCssColorString("#CD853F"));e.PINK=Object.freeze(e.fromCssColorString("#FFC0CB"));e.PLUM=Object.freeze(e.fromCssColorString("#DDA0DD"));e.POWDERBLUE=Object.freeze(e.fromCssColorString("#B0E0E6"));e.PURPLE=Object.freeze(e.fromCssColorString("#800080"));e.RED=Object.freeze(e.fromCssColorString("#FF0000"));e.ROSYBROWN=Object.freeze(e.fromCssColorString("#BC8F8F"));e.ROYALBLUE=Object.freeze(e.fromCssColorString("#4169E1"));e.SADDLEBROWN=Object.freeze(e.fromCssColorString("#8B4513"));e.SALMON=Object.freeze(e.fromCssColorString("#FA8072"));e.SANDYBROWN=Object.freeze(e.fromCssColorString("#F4A460"));e.SEAGREEN=Object.freeze(e.fromCssColorString("#2E8B57"));e.SEASHELL=Object.freeze(e.fromCssColorString("#FFF5EE"));e.SIENNA=Object.freeze(e.fromCssColorString("#A0522D"));e.SILVER=Object.freeze(e.fromCssColorString("#C0C0C0"));e.SKYBLUE=Object.freeze(e.fromCssColorString("#87CEEB"));e.SLATEBLUE=Object.freeze(e.fromCssColorString("#6A5ACD"));e.SLATEGRAY=Object.freeze(e.fromCssColorString("#708090"));e.SLATEGREY=e.SLATEGRAY;e.SNOW=Object.freeze(e.fromCssColorString("#FFFAFA"));e.SPRINGGREEN=Object.freeze(e.fromCssColorString("#00FF7F"));e.STEELBLUE=Object.freeze(e.fromCssColorString("#4682B4"));e.TAN=Object.freeze(e.fromCssColorString("#D2B48C"));e.TEAL=Object.freeze(e.fromCssColorString("#008080"));e.THISTLE=Object.freeze(e.fromCssColorString("#D8BFD8"));e.TOMATO=Object.freeze(e.fromCssColorString("#FF6347"));e.TURQUOISE=Object.freeze(e.fromCssColorString("#40E0D0"));e.VIOLET=Object.freeze(e.fromCssColorString("#EE82EE"));e.WHEAT=Object.freeze(e.fromCssColorString("#F5DEB3"));e.WHITE=Object.freeze(e.fromCssColorString("#FFFFFF"));e.WHITESMOKE=Object.freeze(e.fromCssColorString("#F5F5F5"));e.YELLOW=Object.freeze(e.fromCssColorString("#FFFF00"));e.YELLOWGREEN=Object.freeze(e.fromCssColorString("#9ACD32"));e.TRANSPARENT=Object.freeze(new e(0,0,0,0));var N=e;export{N as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-RQKZTHAV.js b/plugins/feature/map/Cesium/Workers/chunk-RQKZTHAV.js deleted file mode 100644 index 007e427ce..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-RQKZTHAV.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as P}from"./chunk-K6A7NKZT.js";import{a as u,b as d}from"./chunk-QFKZXFLI.js";import{a as j}from"./chunk-ASLWXOD7.js";import{a as _,b as h,g as A}from"./chunk-3PT5NNSP.js";import{a as e,c as l,d as g}from"./chunk-FGKVHLJ4.js";import{a as y,b as p}from"./chunk-ELJAHN3H.js";import{e as r}from"./chunk-3BGP4HCL.js";var x=new _;function s(n,t){if(p.defined("origin",n),t=t??g.default,n=t.scaleToGeodeticSurface(n),!r(n))throw new y("origin must not be at the center of the ellipsoid.");let o=A.eastNorthUpToFixedFrame(n,t);this._ellipsoid=t,this._origin=n,this._xAxis=e.fromCartesian4(h.getColumn(o,0,x)),this._yAxis=e.fromCartesian4(h.getColumn(o,1,x));let i=e.fromCartesian4(h.getColumn(o,2,x));this._plane=j.fromPointNormal(n,i)}Object.defineProperties(s.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 w=new P;s.fromPoints=function(n,t){p.defined("cartesians",n);let o=P.fromPoints(n,w);return new s(o.center,t)};var O=new u,m=new e;s.prototype.projectPointOntoPlane=function(n,t){p.defined("cartesian",n);let o=O;o.origin=n,e.normalize(n,o.direction);let i=d.rayPlane(o,this._plane,m);if(r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m)),r(i)){let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return r(t)?(t.x=a,t.y=f,t):new l(a,f)}};s.prototype.projectPointsOntoPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=0,i=n.length;for(let c=0;c<i;c++){let a=this.projectPointOntoPlane(n[c],t[o]);r(a)&&(t[o]=a,o++)}return t.length=o,t};s.prototype.projectPointToNearestOnPlane=function(n,t){p.defined("cartesian",n),r(t)||(t=new l);let o=O;o.origin=n,e.clone(this._plane.normal,o.direction);let i=d.rayPlane(o,this._plane,m);r(i)||(e.negate(o.direction,o.direction),i=d.rayPlane(o,this._plane,m));let c=e.subtract(i,this._origin,i),a=e.dot(this._xAxis,c),f=e.dot(this._yAxis,c);return t.x=a,t.y=f,t};s.prototype.projectPointsToNearestOnPlane=function(n,t){p.defined("cartesians",n),r(t)||(t=[]);let o=n.length;t.length=o;for(let i=0;i<o;i++)t[i]=this.projectPointToNearestOnPlane(n[i],t[i]);return t};var C=new e;s.prototype.projectPointOntoEllipsoid=function(n,t){p.defined("cartesian",n),r(t)||(t=new e);let o=this._ellipsoid,i=this._origin,c=this._xAxis,a=this._yAxis,f=C;return e.multiplyByScalar(c,n.x,f),t=e.add(i,f,t),e.multiplyByScalar(a,n.y,f),e.add(t,f,t),o.scaleToGeocentricSurface(t,t),t};s.prototype.projectPointsOntoEllipsoid=function(n,t){p.defined("cartesians",n);let o=n.length;r(t)?t.length=o:t=new Array(o);for(let i=0;i<o;++i)t[i]=this.projectPointOntoEllipsoid(n[i],t[i]);return t};var D=s;export{D as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-RWR4JTSS.js b/plugins/feature/map/Cesium/Workers/chunk-RWR4JTSS.js new file mode 100644 index 000000000..803bbaab3 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-RWR4JTSS.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as fn,c as Tn}from"./chunk-H7SJWKIY.js";var Dn=Tn((nt,bt)=>{var _=_||{};_.scope={};_.arrayIteratorImpl=function(p){var c=0;return function(){return c<p.length?{done:!1,value:p[c++]}:{done:!0}}};_.arrayIterator=function(p){return{next:_.arrayIteratorImpl(p)}};_.makeIterator=function(p){var c=typeof Symbol<"u"&&Symbol.iterator&&p[Symbol.iterator];return c?c.call(p):_.arrayIterator(p)};_.ASSUME_ES5=!1;_.ASSUME_NO_NATIVE_MAP=!1;_.ASSUME_NO_NATIVE_SET=!1;_.SIMPLE_FROUND_POLYFILL=!1;_.ISOLATE_POLYFILLS=!1;_.FORCE_POLYFILL_PROMISE=!1;_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;_.getGlobal=function(p){p=[typeof globalThis=="object"&&globalThis,p,typeof window=="object"&&window,typeof self=="object"&&self,typeof global=="object"&&global];for(var c=0;c<p.length;++c){var s=p[c];if(s&&s.Math==Math)return s}throw Error("Cannot find global object")};_.global=_.getGlobal(nt);_.defineProperty=_.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(p,c,s){return p==Array.prototype||p==Object.prototype||(p[c]=s.value),p};_.IS_SYMBOL_NATIVE=typeof Symbol=="function"&&typeof Symbol("x")=="symbol";_.TRUST_ES6_POLYFILLS=!_.ISOLATE_POLYFILLS||_.IS_SYMBOL_NATIVE;_.polyfills={};_.propertyToPolyfillSymbol={};_.POLYFILL_PREFIX="$jscp$";_.polyfill=function(p,c,s,y){c&&(_.ISOLATE_POLYFILLS?_.polyfillIsolated(p,c,s,y):_.polyfillUnisolated(p,c,s,y))};_.polyfillUnisolated=function(p,c,s,y){for(s=_.global,p=p.split("."),y=0;y<p.length-1;y++){var a=p[y];if(!(a in s))return;s=s[a]}p=p[p.length-1],y=s[p],c=c(y),c!=y&&c!=null&&_.defineProperty(s,p,{configurable:!0,writable:!0,value:c})};_.polyfillIsolated=function(p,c,s,y){var a=p.split(".");p=a.length===1,y=a[0],y=!p&&y in _.polyfills?_.polyfills:_.global;for(var g=0;g<a.length-1;g++){var i=a[g];if(!(i in y))return;y=y[i]}a=a[a.length-1],s=_.IS_SYMBOL_NATIVE&&s==="es6"?y[a]:null,c=c(s),c!=null&&(p?_.defineProperty(_.polyfills,a,{configurable:!0,writable:!0,value:c}):c!==s&&(_.propertyToPolyfillSymbol[a]===void 0&&(s=1e9*Math.random()>>>0,_.propertyToPolyfillSymbol[a]=_.IS_SYMBOL_NATIVE?_.global.Symbol(a):_.POLYFILL_PREFIX+s+"$"+a),_.defineProperty(y,_.propertyToPolyfillSymbol[a],{configurable:!0,writable:!0,value:c})))};_.polyfill("Promise",function(p){function c(){this.batch_=null}function s(i){return i instanceof a?i:new a(function(l,h){l(i)})}if(p&&(!(_.FORCE_POLYFILL_PROMISE||_.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION&&typeof _.global.PromiseRejectionEvent>"u")||!_.global.Promise||_.global.Promise.toString().indexOf("[native code]")===-1))return p;c.prototype.asyncExecute=function(i){if(this.batch_==null){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(i)};var y=_.global.setTimeout;c.prototype.asyncExecuteFunction=function(i){y(i,0)},c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var i=this.batch_;this.batch_=[];for(var l=0;l<i.length;++l){var h=i[l];i[l]=null;try{h()}catch(I){this.asyncThrow_(I)}}}this.batch_=null},c.prototype.asyncThrow_=function(i){this.asyncExecuteFunction(function(){throw i})};var a=function(i){this.state_=0,this.result_=void 0,this.onSettledCallbacks_=[],this.isRejectionHandled_=!1;var l=this.createResolveAndReject_();try{i(l.resolve,l.reject)}catch(h){l.reject(h)}};a.prototype.createResolveAndReject_=function(){function i(I){return function(C){h||(h=!0,I.call(l,C))}}var l=this,h=!1;return{resolve:i(this.resolveTo_),reject:i(this.reject_)}},a.prototype.resolveTo_=function(i){if(i===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(i instanceof a)this.settleSameAsPromise_(i);else{t:switch(typeof i){case"object":var l=i!=null;break t;case"function":l=!0;break t;default:l=!1}l?this.resolveToNonPromiseObj_(i):this.fulfill_(i)}},a.prototype.resolveToNonPromiseObj_=function(i){var l=void 0;try{l=i.then}catch(h){this.reject_(h);return}typeof l=="function"?this.settleSameAsThenable_(l,i):this.fulfill_(i)},a.prototype.reject_=function(i){this.settle_(2,i)},a.prototype.fulfill_=function(i){this.settle_(1,i)},a.prototype.settle_=function(i,l){if(this.state_!=0)throw Error("Cannot settle("+i+", "+l+"): Promise already settled in state"+this.state_);this.state_=i,this.result_=l,this.state_===2&&this.scheduleUnhandledRejectionCheck_(),this.executeOnSettledCallbacks_()},a.prototype.scheduleUnhandledRejectionCheck_=function(){var i=this;y(function(){if(i.notifyUnhandledRejection_()){var l=_.global.console;typeof l<"u"&&l.error(i.result_)}},1)},a.prototype.notifyUnhandledRejection_=function(){if(this.isRejectionHandled_)return!1;var i=_.global.CustomEvent,l=_.global.Event,h=_.global.dispatchEvent;return typeof h>"u"?!0:(typeof i=="function"?i=new i("unhandledrejection",{cancelable:!0}):typeof l=="function"?i=new l("unhandledrejection",{cancelable:!0}):(i=_.global.document.createEvent("CustomEvent"),i.initCustomEvent("unhandledrejection",!1,!0,i)),i.promise=this,i.reason=this.result_,h(i))},a.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var i=0;i<this.onSettledCallbacks_.length;++i)g.asyncExecute(this.onSettledCallbacks_[i]);this.onSettledCallbacks_=null}};var g=new c;return a.prototype.settleSameAsPromise_=function(i){var l=this.createResolveAndReject_();i.callWhenSettled_(l.resolve,l.reject)},a.prototype.settleSameAsThenable_=function(i,l){var h=this.createResolveAndReject_();try{i.call(l,h.resolve,h.reject)}catch(I){h.reject(I)}},a.prototype.then=function(i,l){function h(f,T){return typeof f=="function"?function(G){try{I(f(G))}catch(V){C(V)}}:T}var I,C,K=new a(function(f,T){I=f,C=T});return this.callWhenSettled_(h(i,I),h(l,C)),K},a.prototype.catch=function(i){return this.then(void 0,i)},a.prototype.callWhenSettled_=function(i,l){function h(){switch(I.state_){case 1:i(I.result_);break;case 2:l(I.result_);break;default:throw Error("Unexpected state: "+I.state_)}}var I=this;this.onSettledCallbacks_==null?g.asyncExecute(h):this.onSettledCallbacks_.push(h),this.isRejectionHandled_=!0},a.resolve=s,a.reject=function(i){return new a(function(l,h){h(i)})},a.race=function(i){return new a(function(l,h){for(var I=_.makeIterator(i),C=I.next();!C.done;C=I.next())s(C.value).callWhenSettled_(l,h)})},a.all=function(i){var l=_.makeIterator(i),h=l.next();return h.done?s([]):new a(function(I,C){function K(G){return function(V){f[G]=V,T--,T==0&&I(f)}}var f=[],T=0;do f.push(void 0),T++,s(h.value).callWhenSettled_(K(f.length-1),C),h=l.next();while(!h.done)})},a},"es6","es3");_.owns=function(p,c){return Object.prototype.hasOwnProperty.call(p,c)};_.assign=_.TRUST_ES6_POLYFILLS&&typeof Object.assign=="function"?Object.assign:function(p,c){for(var s=1;s<arguments.length;s++){var y=arguments[s];if(y)for(var a in y)_.owns(y,a)&&(p[a]=y[a])}return p};_.polyfill("Object.assign",function(p){return p||_.assign},"es6","es3");_.checkStringArgs=function(p,c,s){if(p==null)throw new TypeError("The 'this' value for String.prototype."+s+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+s+" must not be a regular expression");return p+""};_.polyfill("String.prototype.startsWith",function(p){return p||function(c,s){var y=_.checkStringArgs(this,c,"startsWith");c+="";var a=y.length,g=c.length;s=Math.max(0,Math.min(s|0,y.length));for(var i=0;i<g&&s<a;)if(y[s++]!=c[i++])return!1;return i>=g}},"es6","es3");_.polyfill("Array.prototype.copyWithin",function(p){function c(s){return s=Number(s),s===1/0||s===-1/0?s:s|0}return p||function(s,y,a){var g=this.length;if(s=c(s),y=c(y),a=a===void 0?g:c(a),s=0>s?Math.max(g+s,0):Math.min(s,g),y=0>y?Math.max(g+y,0):Math.min(y,g),a=0>a?Math.max(g+a,0):Math.min(a,g),s<y)for(;y<a;)y in this?this[s++]=this[y++]:(delete this[s++],y++);else for(a=Math.min(a,g+y-s),s+=a-y;a>y;)--a in this?this[--s]=this[a]:delete this[--s];return this}},"es6","es3");_.typedArrayCopyWithin=function(p){return p||Array.prototype.copyWithin};_.polyfill("Int8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint8ClampedArray.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint16Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Int32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Uint32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float32Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");_.polyfill("Float64Array.prototype.copyWithin",_.typedArrayCopyWithin,"es6","es5");var dt=(function(){var p=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(p=p||__filename),function(c){function s(e){return t.locateFile?t.locateFile(e,Q):Q+e}function y(e,r,n){var o=r+n;for(n=r;e[n]&&!(n>=o);)++n;if(16<n-r&&e.buffer&&Ot)return Ot.decode(e.subarray(r,n));for(o="";r<n;){var m=e[r++];if(m&128){var b=e[r++]&63;if((m&224)==192)o+=String.fromCharCode((m&31)<<6|b);else{var X=e[r++]&63;m=(m&240)==224?(m&15)<<12|b<<6|X:(m&7)<<18|b<<12|X<<6|e[r++]&63,65536>m?o+=String.fromCharCode(m):(m-=65536,o+=String.fromCharCode(55296|m>>10,56320|m&1023))}}else o+=String.fromCharCode(m)}return o}function a(e,r){return e?y(tt,e,r):""}function g(){var e=_t.buffer;t.HEAP8=q=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=et=new Int32Array(e),t.HEAPU8=tt=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=x=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}function i(e){throw t.onAbort&&t.onAbort(e),e="Aborted("+e+")",J(e),Gt=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),ot(e),e}function l(e){try{if(e==z&&Z)return new Uint8Array(Z);if(ut)return ut(e);throw"both async and sync fetching of the wasm failed"}catch(r){i(r)}}function h(){if(!Z&&(It||$)){if(typeof fetch=="function"&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+z+"'";return e.arrayBuffer()}).catch(function(){return l(z)});if(st)return new Promise(function(e,r){st(z,function(n){e(new Uint8Array(n))},r)})}return Promise.resolve().then(function(){return l(z)})}function I(e){for(;0<e.length;)e.shift()(t)}function C(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(r){x[this.ptr+4>>2]=r},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(r){x[this.ptr+8>>2]=r},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(r){et[this.ptr>>2]=r},this.set_caught=function(r){q[this.ptr+12>>0]=r?1:0},this.get_caught=function(){return q[this.ptr+12>>0]!=0},this.set_rethrown=function(r){q[this.ptr+13>>0]=r?1:0},this.get_rethrown=function(){return q[this.ptr+13>>0]!=0},this.init=function(r,n){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){et[this.ptr>>2]+=1},this.release_ref=function(){var r=et[this.ptr>>2];return et[this.ptr>>2]=r-1,r===1},this.set_adjusted_ptr=function(r){x[this.ptr+16>>2]=r},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(ln(this.get_type()))return x[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}function K(){function e(){if(!it&&(it=!0,t.calledRun=!0,!Gt)){if(Rt=!0,I(ct),ht(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt.unshift(t.postRun.shift());I(Pt)}}if(!(0<k)){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)jt.unshift(t.preRun.shift());I(jt),0<k||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e())}}function f(){}function T(e){return(e||f).__cache__}function G(e,r){var n=T(r),o=n[e];return o||(o=Object.create((r||f).prototype),o.ptr=e,n[e]=o)}function V(e){if(typeof e=="string"){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?r++:2047>=o?r+=2:55296<=o&&57343>=o?(r+=4,++n):r+=3}if(r=Array(r+1),n=0,o=r.length,0<o){o=n+o-1;for(var m=0;m<e.length;++m){var b=e.charCodeAt(m);if(55296<=b&&57343>=b){var X=e.charCodeAt(++m);b=65536+((b&1023)<<10)|X&1023}if(127>=b){if(n>=o)break;r[n++]=b}else{if(2047>=b){if(n+1>=o)break;r[n++]=192|b>>6}else{if(65535>=b){if(n+2>=o)break;r[n++]=224|b>>12}else{if(n+3>=o)break;r[n++]=240|b>>18,r[n++]=128|b>>12&63}r[n++]=128|b>>6&63}r[n++]=128|b&63}}r[n]=0}return e=d.alloc(r,q),d.copy(r,q,e),e}return e}function at(e){if(typeof e=="object"){var r=d.alloc(e,q);return d.copy(e,q,r),r}return e}function H(){throw"cannot construct a VoidPtr, no constructor in IDL"}function B(){this.ptr=Mt(),T(B)[this.ptr]=this}function w(){this.ptr=Ft(),T(w)[this.ptr]=this}function Y(){this.ptr=wt(),T(Y)[this.ptr]=this}function A(){this.ptr=Vt(),T(A)[this.ptr]=this}function E(){this.ptr=Jt(),T(E)[this.ptr]=this}function j(){this.ptr=ne(),T(j)[this.ptr]=this}function P(){this.ptr=ae(),T(P)[this.ptr]=this}function O(){this.ptr=ce(),T(O)[this.ptr]=this}function W(){this.ptr=de(),T(W)[this.ptr]=this}function v(){throw"cannot construct a Status, no constructor in IDL"}function R(){this.ptr=Ie(),T(R)[this.ptr]=this}function S(){this.ptr=Ge(),T(S)[this.ptr]=this}function M(){this.ptr=Re(),T(M)[this.ptr]=this}function N(){this.ptr=Ue(),T(N)[this.ptr]=this}function U(){this.ptr=we(),T(U)[this.ptr]=this}function F(){this.ptr=We(),T(F)[this.ptr]=this}function L(){this.ptr=He(),T(L)[this.ptr]=this}function D(){this.ptr=Ke(),T(D)[this.ptr]=this}function u(){this.ptr=_r(),T(u)[this.ptr]=this}c=c===void 0?{}:c;var t=typeof c<"u"?c:{},ht,ot;t.ready=new Promise(function(e,r){ht=e,ot=r});var At=!1,Tt=!1;t.onRuntimeInitialized=function(){At=!0,Tt&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.onModuleParsed=function(){Tt=!0,At&&typeof t.onModuleLoaded=="function"&&t.onModuleLoaded(t)},t.isVersionSupported=function(e){return typeof e!="string"?!1:(e=e.split("."),2>e.length||3<e.length?!1:e[0]==1&&0<=e[1]&&5>=e[1]?!0:!(e[0]!=0||10<e[1]))};var Dt=Object.assign({},t),It=typeof window=="object",$=typeof importScripts=="function",gt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q="";if(gt){var vt=fn("fs"),pt=fn("path");Q=$?pt.dirname(Q)+"/":__dirname+"/";var Et=function(e,r){return e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFileSync(e,r?void 0:"utf8")},ut=function(e){return e=Et(e,!0),e.buffer||(e=new Uint8Array(e)),e},st=function(e,r,n){e=e.startsWith("file://")?new URL(e):pt.normalize(e),vt.readFile(e,function(o,m){o?n(o):r(m.buffer)})};1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),t.inspect=function(){return"[Emscripten Module object]"}}else(It||$)&&($?Q=self.location.href:typeof document<"u"&&document.currentScript&&(Q=document.currentScript.src),p&&(Q=p),Q=Q.indexOf("blob:")!==0?Q.substr(0,Q.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Et=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},$&&(ut=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),st=function(e,r,n){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?r(o.response):n()},o.onerror=n,o.send(null)});var dn=t.print||console.log.bind(console),J=t.printErr||console.warn.bind(console);Object.assign(t,Dt),Dt=null;var Z;t.wasmBinary&&(Z=t.wasmBinary),typeof WebAssembly!="object"&&i("no native wasm support detected");var _t,Gt=!1,Ot=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,q,tt,et,x,jt=[],ct=[],Pt=[],Rt=!1,k=0,yt=null,rt=null,z="draco_decoder.wasm";z.startsWith("data:application/octet-stream;base64,")||(z=s(z));var bn=0,hn=[null,[],[]],An={b:function(e,r,n){throw new C(e).init(r,n),bn++,e},a:function(){i("")},g:function(e,r,n){tt.copyWithin(e,r,r+n)},e:function(e){var r=tt.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var m=Math;o=Math.max(e,o),m=m.min.call(m,2147483648,o+(65536-o%65536)%65536);t:{o=_t.buffer;try{_t.grow(m-o.byteLength+65535>>>16),g();var b=1;break t}catch{}b=void 0}if(b)return!0}return!1},f:function(e){return 52},d:function(e,r,n,o,m){return 70},c:function(e,r,n,o){for(var m=0,b=0;b<n;b++){var X=x[r>>2],mn=x[r+4>>2];r+=8;for(var lt=0;lt<mn;lt++){var mt=tt[X+lt],ft=hn[e];mt===0||mt===10?((e===1?dn:J)(y(ft,0)),ft.length=0):ft.push(mt)}m+=mn}return x[o>>2]=m,0}};(function(){function e(m,b){t.asm=m.exports,_t=t.asm.h,g(),ct.unshift(t.asm.i),k--,t.monitorRunDependencies&&t.monitorRunDependencies(k),k==0&&(yt!==null&&(clearInterval(yt),yt=null),rt&&(m=rt,rt=null,m()))}function r(m){e(m.instance)}function n(m){return h().then(function(b){return WebAssembly.instantiate(b,o)}).then(function(b){return b}).then(m,function(b){J("failed to asynchronously prepare wasm: "+b),i(b)})}var o={a:An};if(k++,t.monitorRunDependencies&&t.monitorRunDependencies(k),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(m){J("Module.instantiateWasm callback failed with error: "+m),ot(m)}return(function(){return Z||typeof WebAssembly.instantiateStreaming!="function"||z.startsWith("data:application/octet-stream;base64,")||z.startsWith("file://")||gt||typeof fetch!="function"?n(r):fetch(z,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,o).then(r,function(b){return J("wasm streaming compile failed: "+b),J("falling back to ArrayBuffer instantiation"),n(r)})})})().catch(ot),{}})();var St=t._emscripten_bind_VoidPtr___destroy___0=function(){return(St=t._emscripten_bind_VoidPtr___destroy___0=t.asm.k).apply(null,arguments)},Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return(Mt=t._emscripten_bind_DecoderBuffer_DecoderBuffer_0=t.asm.l).apply(null,arguments)},Nt=t._emscripten_bind_DecoderBuffer_Init_2=function(){return(Nt=t._emscripten_bind_DecoderBuffer_Init_2=t.asm.m).apply(null,arguments)},Ut=t._emscripten_bind_DecoderBuffer___destroy___0=function(){return(Ut=t._emscripten_bind_DecoderBuffer___destroy___0=t.asm.n).apply(null,arguments)},Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return(Ft=t._emscripten_bind_AttributeTransformData_AttributeTransformData_0=t.asm.o).apply(null,arguments)},Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=function(){return(Lt=t._emscripten_bind_AttributeTransformData_transform_type_0=t.asm.p).apply(null,arguments)},Ct=t._emscripten_bind_AttributeTransformData___destroy___0=function(){return(Ct=t._emscripten_bind_AttributeTransformData___destroy___0=t.asm.q).apply(null,arguments)},wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return(wt=t._emscripten_bind_GeometryAttribute_GeometryAttribute_0=t.asm.r).apply(null,arguments)},zt=t._emscripten_bind_GeometryAttribute___destroy___0=function(){return(zt=t._emscripten_bind_GeometryAttribute___destroy___0=t.asm.s).apply(null,arguments)},Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=function(){return(Vt=t._emscripten_bind_PointAttribute_PointAttribute_0=t.asm.t).apply(null,arguments)},Bt=t._emscripten_bind_PointAttribute_size_0=function(){return(Bt=t._emscripten_bind_PointAttribute_size_0=t.asm.u).apply(null,arguments)},Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return(Wt=t._emscripten_bind_PointAttribute_GetAttributeTransformData_0=t.asm.v).apply(null,arguments)},Qt=t._emscripten_bind_PointAttribute_attribute_type_0=function(){return(Qt=t._emscripten_bind_PointAttribute_attribute_type_0=t.asm.w).apply(null,arguments)},xt=t._emscripten_bind_PointAttribute_data_type_0=function(){return(xt=t._emscripten_bind_PointAttribute_data_type_0=t.asm.x).apply(null,arguments)},Yt=t._emscripten_bind_PointAttribute_num_components_0=function(){return(Yt=t._emscripten_bind_PointAttribute_num_components_0=t.asm.y).apply(null,arguments)},Ht=t._emscripten_bind_PointAttribute_normalized_0=function(){return(Ht=t._emscripten_bind_PointAttribute_normalized_0=t.asm.z).apply(null,arguments)},qt=t._emscripten_bind_PointAttribute_byte_stride_0=function(){return(qt=t._emscripten_bind_PointAttribute_byte_stride_0=t.asm.A).apply(null,arguments)},kt=t._emscripten_bind_PointAttribute_byte_offset_0=function(){return(kt=t._emscripten_bind_PointAttribute_byte_offset_0=t.asm.B).apply(null,arguments)},Xt=t._emscripten_bind_PointAttribute_unique_id_0=function(){return(Xt=t._emscripten_bind_PointAttribute_unique_id_0=t.asm.C).apply(null,arguments)},Kt=t._emscripten_bind_PointAttribute___destroy___0=function(){return(Kt=t._emscripten_bind_PointAttribute___destroy___0=t.asm.D).apply(null,arguments)},Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return(Jt=t._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=t.asm.E).apply(null,arguments)},$t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return($t=t._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=t.asm.F).apply(null,arguments)},Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return(Zt=t._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=t.asm.G).apply(null,arguments)},te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return(te=t._emscripten_bind_AttributeQuantizationTransform_min_value_1=t.asm.H).apply(null,arguments)},ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return(ee=t._emscripten_bind_AttributeQuantizationTransform_range_0=t.asm.I).apply(null,arguments)},re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return(re=t._emscripten_bind_AttributeQuantizationTransform___destroy___0=t.asm.J).apply(null,arguments)},ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return(ne=t._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=t.asm.K).apply(null,arguments)},oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return(oe=t._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=t.asm.L).apply(null,arguments)},_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return(_e=t._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=t.asm.M).apply(null,arguments)},ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return(ie=t._emscripten_bind_AttributeOctahedronTransform___destroy___0=t.asm.N).apply(null,arguments)},ae=t._emscripten_bind_PointCloud_PointCloud_0=function(){return(ae=t._emscripten_bind_PointCloud_PointCloud_0=t.asm.O).apply(null,arguments)},pe=t._emscripten_bind_PointCloud_num_attributes_0=function(){return(pe=t._emscripten_bind_PointCloud_num_attributes_0=t.asm.P).apply(null,arguments)},ue=t._emscripten_bind_PointCloud_num_points_0=function(){return(ue=t._emscripten_bind_PointCloud_num_points_0=t.asm.Q).apply(null,arguments)},se=t._emscripten_bind_PointCloud___destroy___0=function(){return(se=t._emscripten_bind_PointCloud___destroy___0=t.asm.R).apply(null,arguments)},ce=t._emscripten_bind_Mesh_Mesh_0=function(){return(ce=t._emscripten_bind_Mesh_Mesh_0=t.asm.S).apply(null,arguments)},ye=t._emscripten_bind_Mesh_num_faces_0=function(){return(ye=t._emscripten_bind_Mesh_num_faces_0=t.asm.T).apply(null,arguments)},le=t._emscripten_bind_Mesh_num_attributes_0=function(){return(le=t._emscripten_bind_Mesh_num_attributes_0=t.asm.U).apply(null,arguments)},me=t._emscripten_bind_Mesh_num_points_0=function(){return(me=t._emscripten_bind_Mesh_num_points_0=t.asm.V).apply(null,arguments)},fe=t._emscripten_bind_Mesh___destroy___0=function(){return(fe=t._emscripten_bind_Mesh___destroy___0=t.asm.W).apply(null,arguments)},de=t._emscripten_bind_Metadata_Metadata_0=function(){return(de=t._emscripten_bind_Metadata_Metadata_0=t.asm.X).apply(null,arguments)},be=t._emscripten_bind_Metadata___destroy___0=function(){return(be=t._emscripten_bind_Metadata___destroy___0=t.asm.Y).apply(null,arguments)},he=t._emscripten_bind_Status_code_0=function(){return(he=t._emscripten_bind_Status_code_0=t.asm.Z).apply(null,arguments)},Ae=t._emscripten_bind_Status_ok_0=function(){return(Ae=t._emscripten_bind_Status_ok_0=t.asm._).apply(null,arguments)},Te=t._emscripten_bind_Status_error_msg_0=function(){return(Te=t._emscripten_bind_Status_error_msg_0=t.asm.$).apply(null,arguments)},De=t._emscripten_bind_Status___destroy___0=function(){return(De=t._emscripten_bind_Status___destroy___0=t.asm.aa).apply(null,arguments)},Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return(Ie=t._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=t.asm.ba).apply(null,arguments)},ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return(ge=t._emscripten_bind_DracoFloat32Array_GetValue_1=t.asm.ca).apply(null,arguments)},ve=t._emscripten_bind_DracoFloat32Array_size_0=function(){return(ve=t._emscripten_bind_DracoFloat32Array_size_0=t.asm.da).apply(null,arguments)},Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=function(){return(Ee=t._emscripten_bind_DracoFloat32Array___destroy___0=t.asm.ea).apply(null,arguments)},Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return(Ge=t._emscripten_bind_DracoInt8Array_DracoInt8Array_0=t.asm.fa).apply(null,arguments)},Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=function(){return(Oe=t._emscripten_bind_DracoInt8Array_GetValue_1=t.asm.ga).apply(null,arguments)},je=t._emscripten_bind_DracoInt8Array_size_0=function(){return(je=t._emscripten_bind_DracoInt8Array_size_0=t.asm.ha).apply(null,arguments)},Pe=t._emscripten_bind_DracoInt8Array___destroy___0=function(){return(Pe=t._emscripten_bind_DracoInt8Array___destroy___0=t.asm.ia).apply(null,arguments)},Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return(Re=t._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=t.asm.ja).apply(null,arguments)},Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return(Se=t._emscripten_bind_DracoUInt8Array_GetValue_1=t.asm.ka).apply(null,arguments)},Me=t._emscripten_bind_DracoUInt8Array_size_0=function(){return(Me=t._emscripten_bind_DracoUInt8Array_size_0=t.asm.la).apply(null,arguments)},Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=function(){return(Ne=t._emscripten_bind_DracoUInt8Array___destroy___0=t.asm.ma).apply(null,arguments)},Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return(Ue=t._emscripten_bind_DracoInt16Array_DracoInt16Array_0=t.asm.na).apply(null,arguments)},Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=function(){return(Fe=t._emscripten_bind_DracoInt16Array_GetValue_1=t.asm.oa).apply(null,arguments)},Le=t._emscripten_bind_DracoInt16Array_size_0=function(){return(Le=t._emscripten_bind_DracoInt16Array_size_0=t.asm.pa).apply(null,arguments)},Ce=t._emscripten_bind_DracoInt16Array___destroy___0=function(){return(Ce=t._emscripten_bind_DracoInt16Array___destroy___0=t.asm.qa).apply(null,arguments)},we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return(we=t._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=t.asm.ra).apply(null,arguments)},ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return(ze=t._emscripten_bind_DracoUInt16Array_GetValue_1=t.asm.sa).apply(null,arguments)},Ve=t._emscripten_bind_DracoUInt16Array_size_0=function(){return(Ve=t._emscripten_bind_DracoUInt16Array_size_0=t.asm.ta).apply(null,arguments)},Be=t._emscripten_bind_DracoUInt16Array___destroy___0=function(){return(Be=t._emscripten_bind_DracoUInt16Array___destroy___0=t.asm.ua).apply(null,arguments)},We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return(We=t._emscripten_bind_DracoInt32Array_DracoInt32Array_0=t.asm.va).apply(null,arguments)},Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=function(){return(Qe=t._emscripten_bind_DracoInt32Array_GetValue_1=t.asm.wa).apply(null,arguments)},xe=t._emscripten_bind_DracoInt32Array_size_0=function(){return(xe=t._emscripten_bind_DracoInt32Array_size_0=t.asm.xa).apply(null,arguments)},Ye=t._emscripten_bind_DracoInt32Array___destroy___0=function(){return(Ye=t._emscripten_bind_DracoInt32Array___destroy___0=t.asm.ya).apply(null,arguments)},He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return(He=t._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=t.asm.za).apply(null,arguments)},qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return(qe=t._emscripten_bind_DracoUInt32Array_GetValue_1=t.asm.Aa).apply(null,arguments)},ke=t._emscripten_bind_DracoUInt32Array_size_0=function(){return(ke=t._emscripten_bind_DracoUInt32Array_size_0=t.asm.Ba).apply(null,arguments)},Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=function(){return(Xe=t._emscripten_bind_DracoUInt32Array___destroy___0=t.asm.Ca).apply(null,arguments)},Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return(Ke=t._emscripten_bind_MetadataQuerier_MetadataQuerier_0=t.asm.Da).apply(null,arguments)},Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return(Je=t._emscripten_bind_MetadataQuerier_HasEntry_2=t.asm.Ea).apply(null,arguments)},$e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return($e=t._emscripten_bind_MetadataQuerier_GetIntEntry_2=t.asm.Fa).apply(null,arguments)},Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return(Ze=t._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=t.asm.Ga).apply(null,arguments)},tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return(tr=t._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=t.asm.Ha).apply(null,arguments)},er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return(er=t._emscripten_bind_MetadataQuerier_GetStringEntry_2=t.asm.Ia).apply(null,arguments)},rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return(rr=t._emscripten_bind_MetadataQuerier_NumEntries_1=t.asm.Ja).apply(null,arguments)},nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return(nr=t._emscripten_bind_MetadataQuerier_GetEntryName_2=t.asm.Ka).apply(null,arguments)},or=t._emscripten_bind_MetadataQuerier___destroy___0=function(){return(or=t._emscripten_bind_MetadataQuerier___destroy___0=t.asm.La).apply(null,arguments)},_r=t._emscripten_bind_Decoder_Decoder_0=function(){return(_r=t._emscripten_bind_Decoder_Decoder_0=t.asm.Ma).apply(null,arguments)},ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=function(){return(ir=t._emscripten_bind_Decoder_DecodeArrayToPointCloud_3=t.asm.Na).apply(null,arguments)},ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=function(){return(ar=t._emscripten_bind_Decoder_DecodeArrayToMesh_3=t.asm.Oa).apply(null,arguments)},pr=t._emscripten_bind_Decoder_GetAttributeId_2=function(){return(pr=t._emscripten_bind_Decoder_GetAttributeId_2=t.asm.Pa).apply(null,arguments)},ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return(ur=t._emscripten_bind_Decoder_GetAttributeIdByName_2=t.asm.Qa).apply(null,arguments)},sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return(sr=t._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=t.asm.Ra).apply(null,arguments)},cr=t._emscripten_bind_Decoder_GetAttribute_2=function(){return(cr=t._emscripten_bind_Decoder_GetAttribute_2=t.asm.Sa).apply(null,arguments)},yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return(yr=t._emscripten_bind_Decoder_GetAttributeByUniqueId_2=t.asm.Ta).apply(null,arguments)},lr=t._emscripten_bind_Decoder_GetMetadata_1=function(){return(lr=t._emscripten_bind_Decoder_GetMetadata_1=t.asm.Ua).apply(null,arguments)},mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return(mr=t._emscripten_bind_Decoder_GetAttributeMetadata_2=t.asm.Va).apply(null,arguments)},fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return(fr=t._emscripten_bind_Decoder_GetFaceFromMesh_3=t.asm.Wa).apply(null,arguments)},dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return(dr=t._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=t.asm.Xa).apply(null,arguments)},br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return(br=t._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=t.asm.Ya).apply(null,arguments)},hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return(hr=t._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=t.asm.Za).apply(null,arguments)},Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return(Ar=t._emscripten_bind_Decoder_GetAttributeFloat_3=t.asm._a).apply(null,arguments)},Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return(Tr=t._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=t.asm.$a).apply(null,arguments)},Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return(Dr=t._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=t.asm.ab).apply(null,arguments)},Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return(Ir=t._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=t.asm.bb).apply(null,arguments)},gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return(gr=t._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=t.asm.cb).apply(null,arguments)},vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return(vr=t._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=t.asm.db).apply(null,arguments)},Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return(Er=t._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=t.asm.eb).apply(null,arguments)},Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return(Gr=t._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=t.asm.fb).apply(null,arguments)},Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return(Or=t._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=t.asm.gb).apply(null,arguments)},jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return(jr=t._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=t.asm.hb).apply(null,arguments)},Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return(Pr=t._emscripten_bind_Decoder_SkipAttributeTransform_1=t.asm.ib).apply(null,arguments)},Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=function(){return(Rr=t._emscripten_bind_Decoder_GetEncodedGeometryType_Deprecated_1=t.asm.jb).apply(null,arguments)},Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return(Sr=t._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=t.asm.kb).apply(null,arguments)},Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return(Mr=t._emscripten_bind_Decoder_DecodeBufferToMesh_2=t.asm.lb).apply(null,arguments)},Nr=t._emscripten_bind_Decoder___destroy___0=function(){return(Nr=t._emscripten_bind_Decoder___destroy___0=t.asm.mb).apply(null,arguments)},Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return(Ur=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=t.asm.nb).apply(null,arguments)},Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return(Fr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=t.asm.ob).apply(null,arguments)},Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return(Lr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=t.asm.pb).apply(null,arguments)},Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return(Cr=t._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=t.asm.qb).apply(null,arguments)},wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return(wr=t._emscripten_enum_draco_GeometryAttribute_Type_INVALID=t.asm.rb).apply(null,arguments)},zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return(zr=t._emscripten_enum_draco_GeometryAttribute_Type_POSITION=t.asm.sb).apply(null,arguments)},Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return(Vr=t._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=t.asm.tb).apply(null,arguments)},Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return(Br=t._emscripten_enum_draco_GeometryAttribute_Type_COLOR=t.asm.ub).apply(null,arguments)},Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return(Wr=t._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=t.asm.vb).apply(null,arguments)},Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return(Qr=t._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=t.asm.wb).apply(null,arguments)},xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return(xr=t._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=t.asm.xb).apply(null,arguments)},Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return(Yr=t._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=t.asm.yb).apply(null,arguments)},Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return(Hr=t._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=t.asm.zb).apply(null,arguments)},qr=t._emscripten_enum_draco_DataType_DT_INVALID=function(){return(qr=t._emscripten_enum_draco_DataType_DT_INVALID=t.asm.Ab).apply(null,arguments)},kr=t._emscripten_enum_draco_DataType_DT_INT8=function(){return(kr=t._emscripten_enum_draco_DataType_DT_INT8=t.asm.Bb).apply(null,arguments)},Xr=t._emscripten_enum_draco_DataType_DT_UINT8=function(){return(Xr=t._emscripten_enum_draco_DataType_DT_UINT8=t.asm.Cb).apply(null,arguments)},Kr=t._emscripten_enum_draco_DataType_DT_INT16=function(){return(Kr=t._emscripten_enum_draco_DataType_DT_INT16=t.asm.Db).apply(null,arguments)},Jr=t._emscripten_enum_draco_DataType_DT_UINT16=function(){return(Jr=t._emscripten_enum_draco_DataType_DT_UINT16=t.asm.Eb).apply(null,arguments)},$r=t._emscripten_enum_draco_DataType_DT_INT32=function(){return($r=t._emscripten_enum_draco_DataType_DT_INT32=t.asm.Fb).apply(null,arguments)},Zr=t._emscripten_enum_draco_DataType_DT_UINT32=function(){return(Zr=t._emscripten_enum_draco_DataType_DT_UINT32=t.asm.Gb).apply(null,arguments)},tn=t._emscripten_enum_draco_DataType_DT_INT64=function(){return(tn=t._emscripten_enum_draco_DataType_DT_INT64=t.asm.Hb).apply(null,arguments)},en=t._emscripten_enum_draco_DataType_DT_UINT64=function(){return(en=t._emscripten_enum_draco_DataType_DT_UINT64=t.asm.Ib).apply(null,arguments)},rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return(rn=t._emscripten_enum_draco_DataType_DT_FLOAT32=t.asm.Jb).apply(null,arguments)},nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return(nn=t._emscripten_enum_draco_DataType_DT_FLOAT64=t.asm.Kb).apply(null,arguments)},on=t._emscripten_enum_draco_DataType_DT_BOOL=function(){return(on=t._emscripten_enum_draco_DataType_DT_BOOL=t.asm.Lb).apply(null,arguments)},_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return(_n=t._emscripten_enum_draco_DataType_DT_TYPES_COUNT=t.asm.Mb).apply(null,arguments)},an=t._emscripten_enum_draco_StatusCode_OK=function(){return(an=t._emscripten_enum_draco_StatusCode_OK=t.asm.Nb).apply(null,arguments)},pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return(pn=t._emscripten_enum_draco_StatusCode_DRACO_ERROR=t.asm.Ob).apply(null,arguments)},un=t._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return(un=t._emscripten_enum_draco_StatusCode_IO_ERROR=t.asm.Pb).apply(null,arguments)},sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return(sn=t._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=t.asm.Qb).apply(null,arguments)},cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return(cn=t._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=t.asm.Rb).apply(null,arguments)},yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return(yn=t._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=t.asm.Sb).apply(null,arguments)};t._malloc=function(){return(t._malloc=t.asm.Tb).apply(null,arguments)},t._free=function(){return(t._free=t.asm.Ub).apply(null,arguments)};var ln=function(){return(ln=t.asm.Vb).apply(null,arguments)};t.___start_em_js=15856,t.___stop_em_js=15954;var it;if(rt=function e(){it||K(),it||(rt=e)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();K(),f.prototype=Object.create(f.prototype),f.prototype.constructor=f,f.prototype.__class__=f,f.__cache__={},t.WrapperObject=f,t.getCache=T,t.wrapPointer=G,t.castObject=function(e,r){return G(e.ptr,r)},t.NULL=G(0),t.destroy=function(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete T(e.__class__)[e.ptr]},t.compare=function(e,r){return e.ptr===r.ptr},t.getPointer=function(e){return e.ptr},t.getClass=function(e){return e.__class__};var d={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(d.needed){for(var e=0;e<d.temps.length;e++)t._free(d.temps[e]);d.temps.length=0,t._free(d.buffer),d.buffer=0,d.size+=d.needed,d.needed=0}d.buffer||(d.size+=128,d.buffer=t._malloc(d.size),d.buffer||i(void 0)),d.pos=0},alloc:function(e,r){return d.buffer||i(void 0),e=e.length*r.BYTES_PER_ELEMENT,e=e+7&-8,d.pos+e>=d.size?(0<e||i(void 0),d.needed+=e,r=t._malloc(e),d.temps.push(r)):(r=d.buffer+d.pos,d.pos+=e),r},copy:function(e,r,n){switch(n>>>=0,r.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var o=0;o<e.length;o++)r[n+o]=e[o]}};return H.prototype=Object.create(f.prototype),H.prototype.constructor=H,H.prototype.__class__=H,H.__cache__={},t.VoidPtr=H,H.prototype.__destroy__=H.prototype.__destroy__=function(){St(this.ptr)},B.prototype=Object.create(f.prototype),B.prototype.constructor=B,B.prototype.__class__=B,B.__cache__={},t.DecoderBuffer=B,B.prototype.Init=B.prototype.Init=function(e,r){var n=this.ptr;d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),Nt(n,e,r)},B.prototype.__destroy__=B.prototype.__destroy__=function(){Ut(this.ptr)},w.prototype=Object.create(f.prototype),w.prototype.constructor=w,w.prototype.__class__=w,w.__cache__={},t.AttributeTransformData=w,w.prototype.transform_type=w.prototype.transform_type=function(){return Lt(this.ptr)},w.prototype.__destroy__=w.prototype.__destroy__=function(){Ct(this.ptr)},Y.prototype=Object.create(f.prototype),Y.prototype.constructor=Y,Y.prototype.__class__=Y,Y.__cache__={},t.GeometryAttribute=Y,Y.prototype.__destroy__=Y.prototype.__destroy__=function(){zt(this.ptr)},A.prototype=Object.create(f.prototype),A.prototype.constructor=A,A.prototype.__class__=A,A.__cache__={},t.PointAttribute=A,A.prototype.size=A.prototype.size=function(){return Bt(this.ptr)},A.prototype.GetAttributeTransformData=A.prototype.GetAttributeTransformData=function(){return G(Wt(this.ptr),w)},A.prototype.attribute_type=A.prototype.attribute_type=function(){return Qt(this.ptr)},A.prototype.data_type=A.prototype.data_type=function(){return xt(this.ptr)},A.prototype.num_components=A.prototype.num_components=function(){return Yt(this.ptr)},A.prototype.normalized=A.prototype.normalized=function(){return!!Ht(this.ptr)},A.prototype.byte_stride=A.prototype.byte_stride=function(){return qt(this.ptr)},A.prototype.byte_offset=A.prototype.byte_offset=function(){return kt(this.ptr)},A.prototype.unique_id=A.prototype.unique_id=function(){return Xt(this.ptr)},A.prototype.__destroy__=A.prototype.__destroy__=function(){Kt(this.ptr)},E.prototype=Object.create(f.prototype),E.prototype.constructor=E,E.prototype.__class__=E,E.__cache__={},t.AttributeQuantizationTransform=E,E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!$t(r,e)},E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Zt(this.ptr)},E.prototype.min_value=E.prototype.min_value=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),te(r,e)},E.prototype.range=E.prototype.range=function(){return ee(this.ptr)},E.prototype.__destroy__=E.prototype.__destroy__=function(){re(this.ptr)},j.prototype=Object.create(f.prototype),j.prototype.constructor=j,j.prototype.__class__=j,j.__cache__={},t.AttributeOctahedronTransform=j,j.prototype.InitFromAttribute=j.prototype.InitFromAttribute=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),!!oe(r,e)},j.prototype.quantization_bits=j.prototype.quantization_bits=function(){return _e(this.ptr)},j.prototype.__destroy__=j.prototype.__destroy__=function(){ie(this.ptr)},P.prototype=Object.create(f.prototype),P.prototype.constructor=P,P.prototype.__class__=P,P.__cache__={},t.PointCloud=P,P.prototype.num_attributes=P.prototype.num_attributes=function(){return pe(this.ptr)},P.prototype.num_points=P.prototype.num_points=function(){return ue(this.ptr)},P.prototype.__destroy__=P.prototype.__destroy__=function(){se(this.ptr)},O.prototype=Object.create(f.prototype),O.prototype.constructor=O,O.prototype.__class__=O,O.__cache__={},t.Mesh=O,O.prototype.num_faces=O.prototype.num_faces=function(){return ye(this.ptr)},O.prototype.num_attributes=O.prototype.num_attributes=function(){return le(this.ptr)},O.prototype.num_points=O.prototype.num_points=function(){return me(this.ptr)},O.prototype.__destroy__=O.prototype.__destroy__=function(){fe(this.ptr)},W.prototype=Object.create(f.prototype),W.prototype.constructor=W,W.prototype.__class__=W,W.__cache__={},t.Metadata=W,W.prototype.__destroy__=W.prototype.__destroy__=function(){be(this.ptr)},v.prototype=Object.create(f.prototype),v.prototype.constructor=v,v.prototype.__class__=v,v.__cache__={},t.Status=v,v.prototype.code=v.prototype.code=function(){return he(this.ptr)},v.prototype.ok=v.prototype.ok=function(){return!!Ae(this.ptr)},v.prototype.error_msg=v.prototype.error_msg=function(){return a(Te(this.ptr))},v.prototype.__destroy__=v.prototype.__destroy__=function(){De(this.ptr)},R.prototype=Object.create(f.prototype),R.prototype.constructor=R,R.prototype.__class__=R,R.__cache__={},t.DracoFloat32Array=R,R.prototype.GetValue=R.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ge(r,e)},R.prototype.size=R.prototype.size=function(){return ve(this.ptr)},R.prototype.__destroy__=R.prototype.__destroy__=function(){Ee(this.ptr)},S.prototype=Object.create(f.prototype),S.prototype.constructor=S,S.prototype.__class__=S,S.__cache__={},t.DracoInt8Array=S,S.prototype.GetValue=S.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Oe(r,e)},S.prototype.size=S.prototype.size=function(){return je(this.ptr)},S.prototype.__destroy__=S.prototype.__destroy__=function(){Pe(this.ptr)},M.prototype=Object.create(f.prototype),M.prototype.constructor=M,M.prototype.__class__=M,M.__cache__={},t.DracoUInt8Array=M,M.prototype.GetValue=M.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Se(r,e)},M.prototype.size=M.prototype.size=function(){return Me(this.ptr)},M.prototype.__destroy__=M.prototype.__destroy__=function(){Ne(this.ptr)},N.prototype=Object.create(f.prototype),N.prototype.constructor=N,N.prototype.__class__=N,N.__cache__={},t.DracoInt16Array=N,N.prototype.GetValue=N.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Fe(r,e)},N.prototype.size=N.prototype.size=function(){return Le(this.ptr)},N.prototype.__destroy__=N.prototype.__destroy__=function(){Ce(this.ptr)},U.prototype=Object.create(f.prototype),U.prototype.constructor=U,U.prototype.__class__=U,U.__cache__={},t.DracoUInt16Array=U,U.prototype.GetValue=U.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),ze(r,e)},U.prototype.size=U.prototype.size=function(){return Ve(this.ptr)},U.prototype.__destroy__=U.prototype.__destroy__=function(){Be(this.ptr)},F.prototype=Object.create(f.prototype),F.prototype.constructor=F,F.prototype.__class__=F,F.__cache__={},t.DracoInt32Array=F,F.prototype.GetValue=F.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Qe(r,e)},F.prototype.size=F.prototype.size=function(){return xe(this.ptr)},F.prototype.__destroy__=F.prototype.__destroy__=function(){Ye(this.ptr)},L.prototype=Object.create(f.prototype),L.prototype.constructor=L,L.prototype.__class__=L,L.__cache__={},t.DracoUInt32Array=L,L.prototype.GetValue=L.prototype.GetValue=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),qe(r,e)},L.prototype.size=L.prototype.size=function(){return ke(this.ptr)},L.prototype.__destroy__=L.prototype.__destroy__=function(){Xe(this.ptr)},D.prototype=Object.create(f.prototype),D.prototype.constructor=D,D.prototype.__class__=D,D.__cache__={},t.MetadataQuerier=D,D.prototype.HasEntry=D.prototype.HasEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),!!Je(n,e,r)},D.prototype.GetIntEntry=D.prototype.GetIntEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),$e(n,e,r)},D.prototype.GetIntEntryArray=D.prototype.GetIntEntryArray=function(e,r,n){var o=this.ptr;d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n&&typeof n=="object"&&(n=n.ptr),Ze(o,e,r,n)},D.prototype.GetDoubleEntry=D.prototype.GetDoubleEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),tr(n,e,r)},D.prototype.GetStringEntry=D.prototype.GetStringEntry=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),a(er(n,e,r))},D.prototype.NumEntries=D.prototype.NumEntries=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),rr(r,e)},D.prototype.GetEntryName=D.prototype.GetEntryName=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),a(nr(n,e,r))},D.prototype.__destroy__=D.prototype.__destroy__=function(){or(this.ptr)},u.prototype=Object.create(f.prototype),u.prototype.constructor=u,u.prototype.__class__=u,u.__cache__={},t.Decoder=u,u.prototype.DecodeArrayToPointCloud=u.prototype.DecodeArrayToPointCloud=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ir(o,e,r,n),v)},u.prototype.DecodeArrayToMesh=u.prototype.DecodeArrayToMesh=function(e,r,n){var o=this.ptr;return d.prepare(),typeof e=="object"&&(e=at(e)),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),G(ar(o,e,r,n),v)},u.prototype.GetAttributeId=u.prototype.GetAttributeId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),pr(n,e,r)},u.prototype.GetAttributeIdByName=u.prototype.GetAttributeIdByName=function(e,r){var n=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),ur(n,e,r)},u.prototype.GetAttributeIdByMetadataEntry=u.prototype.GetAttributeIdByMetadataEntry=function(e,r,n){var o=this.ptr;return d.prepare(),e&&typeof e=="object"&&(e=e.ptr),r=r&&typeof r=="object"?r.ptr:V(r),n=n&&typeof n=="object"?n.ptr:V(n),sr(o,e,r,n)},u.prototype.GetAttribute=u.prototype.GetAttribute=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(cr(n,e,r),A)},u.prototype.GetAttributeByUniqueId=u.prototype.GetAttributeByUniqueId=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(yr(n,e,r),A)},u.prototype.GetMetadata=u.prototype.GetMetadata=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),G(lr(r,e),W)},u.prototype.GetAttributeMetadata=u.prototype.GetAttributeMetadata=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(mr(n,e,r),W)},u.prototype.GetFaceFromMesh=u.prototype.GetFaceFromMesh=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!fr(o,e,r,n)},u.prototype.GetTriangleStripsFromMesh=u.prototype.GetTriangleStripsFromMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),dr(n,e,r)},u.prototype.GetTrianglesUInt16Array=u.prototype.GetTrianglesUInt16Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!br(o,e,r,n)},u.prototype.GetTrianglesUInt32Array=u.prototype.GetTrianglesUInt32Array=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!hr(o,e,r,n)},u.prototype.GetAttributeFloat=u.prototype.GetAttributeFloat=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ar(o,e,r,n)},u.prototype.GetAttributeFloatForAllPoints=u.prototype.GetAttributeFloatForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Tr(o,e,r,n)},u.prototype.GetAttributeIntForAllPoints=u.prototype.GetAttributeIntForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Dr(o,e,r,n)},u.prototype.GetAttributeInt8ForAllPoints=u.prototype.GetAttributeInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Ir(o,e,r,n)},u.prototype.GetAttributeUInt8ForAllPoints=u.prototype.GetAttributeUInt8ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!gr(o,e,r,n)},u.prototype.GetAttributeInt16ForAllPoints=u.prototype.GetAttributeInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!vr(o,e,r,n)},u.prototype.GetAttributeUInt16ForAllPoints=u.prototype.GetAttributeUInt16ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Er(o,e,r,n)},u.prototype.GetAttributeInt32ForAllPoints=u.prototype.GetAttributeInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Gr(o,e,r,n)},u.prototype.GetAttributeUInt32ForAllPoints=u.prototype.GetAttributeUInt32ForAllPoints=function(e,r,n){var o=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),!!Or(o,e,r,n)},u.prototype.GetAttributeDataArrayForAllPoints=u.prototype.GetAttributeDataArrayForAllPoints=function(e,r,n,o,m){var b=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),n&&typeof n=="object"&&(n=n.ptr),o&&typeof o=="object"&&(o=o.ptr),m&&typeof m=="object"&&(m=m.ptr),!!jr(b,e,r,n,o,m)},u.prototype.SkipAttributeTransform=u.prototype.SkipAttributeTransform=function(e){var r=this.ptr;e&&typeof e=="object"&&(e=e.ptr),Pr(r,e)},u.prototype.GetEncodedGeometryType_Deprecated=u.prototype.GetEncodedGeometryType_Deprecated=function(e){var r=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),Rr(r,e)},u.prototype.DecodeBufferToPointCloud=u.prototype.DecodeBufferToPointCloud=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Sr(n,e,r),v)},u.prototype.DecodeBufferToMesh=u.prototype.DecodeBufferToMesh=function(e,r){var n=this.ptr;return e&&typeof e=="object"&&(e=e.ptr),r&&typeof r=="object"&&(r=r.ptr),G(Mr(n,e,r),v)},u.prototype.__destroy__=u.prototype.__destroy__=function(){Nr(this.ptr)},(function(){function e(){t.ATTRIBUTE_INVALID_TRANSFORM=Ur(),t.ATTRIBUTE_NO_TRANSFORM=Fr(),t.ATTRIBUTE_QUANTIZATION_TRANSFORM=Lr(),t.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Cr(),t.INVALID=wr(),t.POSITION=zr(),t.NORMAL=Vr(),t.COLOR=Br(),t.TEX_COORD=Wr(),t.GENERIC=Qr(),t.INVALID_GEOMETRY_TYPE=xr(),t.POINT_CLOUD=Yr(),t.TRIANGULAR_MESH=Hr(),t.DT_INVALID=qr(),t.DT_INT8=kr(),t.DT_UINT8=Xr(),t.DT_INT16=Kr(),t.DT_UINT16=Jr(),t.DT_INT32=$r(),t.DT_UINT32=Zr(),t.DT_INT64=tn(),t.DT_UINT64=en(),t.DT_FLOAT32=rn(),t.DT_FLOAT64=nn(),t.DT_BOOL=on(),t.DT_TYPES_COUNT=_n(),t.OK=an(),t.DRACO_ERROR=pn(),t.IO_ERROR=un(),t.INVALID_PARAMETER=sn(),t.UNSUPPORTED_VERSION=cn(),t.UNKNOWN_VERSION=yn()}Rt?e():ct.unshift(e)})(),typeof t.onModuleParsed=="function"&&t.onModuleParsed(),t.Decoder.prototype.GetEncodedGeometryType=function(e){if(e.__class__&&e.__class__===t.DecoderBuffer)return t.Decoder.prototype.GetEncodedGeometryType_Deprecated(e);if(8>e.byteLength)return t.INVALID_GEOMETRY_TYPE;switch(e[7]){case 0:return t.POINT_CLOUD;case 1:return t.TRIANGULAR_MESH;default:return t.INVALID_GEOMETRY_TYPE}},c.ready}})();typeof nt=="object"&&typeof bt=="object"?bt.exports=dt:typeof define=="function"&&define.amd?define([],function(){return dt}):typeof nt=="object"&&(nt.DracoDecoderModule=dt)});export{Dn as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-S5KJ4JQS.js b/plugins/feature/map/Cesium/Workers/chunk-S5KJ4JQS.js deleted file mode 100644 index 6914af530..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-S5KJ4JQS.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as g,b as d}from"./chunk-ZYYZDBKK.js";import{h as x}from"./chunk-3PT5NNSP.js";import{b as p,c as M,d as O}from"./chunk-FGKVHLJ4.js";import{b as m}from"./chunk-ELJAHN3H.js";import{e as f}from"./chunk-3BGP4HCL.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ASLWXOD7.js b/plugins/feature/map/Cesium/Workers/chunk-SIBAZPZR.js similarity index 89% rename from plugins/feature/map/Cesium/Workers/chunk-ASLWXOD7.js rename to plugins/feature/map/Cesium/Workers/chunk-SIBAZPZR.js index 515fb5ed9..8b268d327 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-ASLWXOD7.js +++ b/plugins/feature/map/Cesium/Workers/chunk-SIBAZPZR.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as l,b as d}from"./chunk-3PT5NNSP.js";import{a as t}from"./chunk-FGKVHLJ4.js";import{a as s}from"./chunk-YRCAQUFT.js";import{a as f,b as r}from"./chunk-ELJAHN3H.js";import{e as m}from"./chunk-3BGP4HCL.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; +import{a as l,b as d}from"./chunk-HLXNFZAZ.js";import{a as t}from"./chunk-OSVSBQDY.js";import{a as s}from"./chunk-LZC73BOP.js";import{a as f,b as r}from"./chunk-OU2IPMYE.js";import{f as m}from"./chunk-H7SJWKIY.js";function o(e,n){if(r.typeOf.object("normal",e),!s.equalsEpsilon(t.magnitude(e),1,s.EPSILON6))throw new f("normal must be normalized.");r.typeOf.number("distance",n),this.normal=t.clone(e),this.distance=n}o.fromPointNormal=function(e,n,a){if(r.typeOf.object("point",e),r.typeOf.object("normal",n),!s.equalsEpsilon(t.magnitude(n),1,s.EPSILON6))throw new f("normal must be normalized.");let c=-t.dot(n,e);return m(a)?(t.clone(n,a.normal),a.distance=c,a):new o(n,c)};var b=new t;o.fromCartesian4=function(e,n){r.typeOf.object("coefficients",e);let a=t.fromCartesian4(e,b),c=e.w;if(!s.equalsEpsilon(t.magnitude(a),1,s.EPSILON6))throw new f("normal must be normalized.");return m(n)?(t.clone(a,n.normal),n.distance=c,n):new o(a,c)};o.getPointDistance=function(e,n){return r.typeOf.object("plane",e),r.typeOf.object("point",n),t.dot(e.normal,n)+e.distance};var y=new t;o.projectPointOntoPlane=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("point",n),m(a)||(a=new t);let c=o.getPointDistance(e,n),p=t.multiplyByScalar(e.normal,c,y);return t.subtract(n,p,a)};var w=new d,j=new l,N=new t;o.transform=function(e,n,a){r.typeOf.object("plane",e),r.typeOf.object("transform",n);let c=e.normal,p=e.distance,u=d.inverseTranspose(n,w),i=l.fromElements(c.x,c.y,c.z,p,j);i=d.multiplyByVector(u,i,i);let O=t.fromCartesian4(i,N);return i=l.divideByScalar(i,t.magnitude(O),i),o.fromCartesian4(i,a)};o.clone=function(e,n){return r.typeOf.object("plane",e),m(n)?(t.clone(e.normal,n.normal),n.distance=e.distance,n):new o(e.normal,e.distance)};o.equals=function(e,n){return r.typeOf.object("left",e),r.typeOf.object("right",n),e.distance===n.distance&&t.equals(e.normal,n.normal)};o.ORIGIN_XY_PLANE=Object.freeze(new o(t.UNIT_Z,0));o.ORIGIN_YZ_PLANE=Object.freeze(new o(t.UNIT_X,0));o.ORIGIN_ZX_PLANE=Object.freeze(new o(t.UNIT_Y,0));var T=o;export{T as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-SIFLADX4.js b/plugins/feature/map/Cesium/Workers/chunk-SIFLADX4.js new file mode 100644 index 000000000..ab9c37f97 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-SIFLADX4.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as ct}from"./chunk-B5FT3Q23.js";import{b as xt,c as ht,d as et}from"./chunk-7RNSURKI.js";import{a as tt}from"./chunk-WCOEOHX5.js";import{a as ft}from"./chunk-ZJRS2FK6.js";import{a as Y,b as g,c as gt}from"./chunk-KP72RGCH.js";import{a as h}from"./chunk-OSVSBQDY.js";import{a as X}from"./chunk-LZC73BOP.js";import{b as A}from"./chunk-OU2IPMYE.js";import{f as F}from"./chunk-H7SJWKIY.js";var nt={CLOCKWISE:ft.CW,COUNTER_CLOCKWISE:ft.CCW};nt.validate=function(t){return t===nt.CLOCKWISE||t===nt.COUNTER_CLOCKWISE};Object.freeze(nt);var at=nt;function mt(t,n,e=2){let o=n&&n.length,r=o?n[0]*e:t.length,s=wt(t,0,r,e,!0),i=[];if(!s||s.next===s.prev)return i;let c,x,u;if(o&&(s=It(t,n,s,e)),t.length>80*e){c=t[0],x=t[1];let p=c,y=x;for(let b=e;b<r;b+=e){let S=t[b],a=t[b+1];S<c&&(c=S),a<x&&(x=a),S>p&&(p=S),a>y&&(y=a)}u=Math.max(p-c,y-x),u=u!==0?32767/u:0}return it(s,i,e,c,x,u,0),i}function wt(t,n,e,o,r){let s;if(r===Vt(t,n,e,o)>0)for(let i=n;i<e;i+=o)s=vt(i/o|0,t[i],t[i+1],s);else for(let i=e-o;i>=n;i-=o)s=vt(i/o|0,t[i],t[i+1],s);return s&&K(s,s.next)&&(st(s),s=s.next),s}function N(t,n){if(!t)return t;n||(n=t);let e=t,o;do if(o=!1,!e.steiner&&(K(e,e.next)||w(e.prev,e,e.next)===0)){if(st(e),e=n=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==n);return n}function it(t,n,e,o,r,s,i){if(!t)return;!i&&s&&Nt(t,o,r,s);let c=t;for(;t.prev!==t.next;){let x=t.prev,u=t.next;if(s?Rt(t,o,r,s):Pt(t)){n.push(x.i,t.i,u.i),st(t),t=u.next,c=u.next;continue}if(t=u,t===c){i?i===1?(t=zt(N(t),n),it(t,n,e,o,r,s,2)):i===2&&Bt(t,n,e,o,r,s):it(N(t),n,e,o,r,s,1);break}}}function Pt(t){let n=t.prev,e=t,o=t.next;if(w(n,e,o)>=0)return!1;let r=n.x,s=e.x,i=o.x,c=n.y,x=e.y,u=o.y,p=Math.min(r,s,i),y=Math.min(c,x,u),b=Math.max(r,s,i),S=Math.max(c,x,u),a=o.next;for(;a!==n;){if(a.x>=p&&a.x<=b&&a.y>=y&&a.y<=S&&rt(r,c,s,x,i,u,a.x,a.y)&&w(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function Rt(t,n,e,o){let r=t.prev,s=t,i=t.next;if(w(r,s,i)>=0)return!1;let c=r.x,x=s.x,u=i.x,p=r.y,y=s.y,b=i.y,S=Math.min(c,x,u),a=Math.min(p,y,b),T=Math.max(c,x,u),L=Math.max(p,y,b),z=pt(S,a,n,e,o),D=pt(T,L,n,e,o),l=t.prevZ,f=t.nextZ;for(;l&&l.z>=z&&f&&f.z<=D;){if(l.x>=S&&l.x<=T&&l.y>=a&&l.y<=L&&l!==r&&l!==i&&rt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0||(l=l.prevZ,f.x>=S&&f.x<=T&&f.y>=a&&f.y<=L&&f!==r&&f!==i&&rt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0))return!1;f=f.nextZ}for(;l&&l.z>=z;){if(l.x>=S&&l.x<=T&&l.y>=a&&l.y<=L&&l!==r&&l!==i&&rt(c,p,x,y,u,b,l.x,l.y)&&w(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;f&&f.z<=D;){if(f.x>=S&&f.x<=T&&f.y>=a&&f.y<=L&&f!==r&&f!==i&&rt(c,p,x,y,u,b,f.x,f.y)&&w(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function zt(t,n){let e=t;do{let o=e.prev,r=e.next.next;!K(o,r)&&bt(o,e,e.next,r)&&ot(o,r)&&ot(r,o)&&(n.push(o.i,e.i,r.i),st(e),st(e.next),e=t=r),e=e.next}while(e!==t);return N(e)}function Bt(t,n,e,o,r,s){let i=t;do{let c=i.next.next;for(;c!==i.prev;){if(i.i!==c.i&&_t(i,c)){let x=Mt(i,c);i=N(i,i.next),x=N(x,x.next),it(i,n,e,o,r,s,0),it(x,n,e,o,r,s,0);return}c=c.next}i=i.next}while(i!==t)}function It(t,n,e,o){let r=[];for(let s=0,i=n.length;s<i;s++){let c=n[s]*o,x=s<i-1?n[s+1]*o:t.length,u=wt(t,c,x,o,!1);u===u.next&&(u.steiner=!0),r.push(Ut(u))}r.sort(Wt);for(let s=0;s<r.length;s++)e=$t(r[s],e);return e}function Wt(t,n){let e=t.x-n.x;if(e===0&&(e=t.y-n.y,e===0)){let o=(t.next.y-t.y)/(t.next.x-t.x),r=(n.next.y-n.y)/(n.next.x-n.x);e=o-r}return e}function $t(t,n){let e=Gt(t,n);if(!e)return n;let o=Mt(e,t);return N(o,o.next),N(e,e.next)}function Gt(t,n){let e=n,o=t.x,r=t.y,s=-1/0,i;if(K(t,e))return e;do{if(K(t,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){let y=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(y<=o&&y>s&&(s=y,i=e.x<e.next.x?e:e.next,y===o))return i}e=e.next}while(e!==n);if(!i)return null;let c=i,x=i.x,u=i.y,p=1/0;e=i;do{if(o>=e.x&&e.x>=x&&o!==e.x&&St(r<u?o:s,r,x,u,r<u?s:o,r,e.x,e.y)){let y=Math.abs(r-e.y)/(o-e.x);ot(e,t)&&(y<p||y===p&&(e.x>i.x||e.x===i.x&&Ht(i,e)))&&(i=e,p=y)}e=e.next}while(e!==c);return i}function Ht(t,n){return w(t.prev,t,n.prev)<0&&w(n.next,t,t.next)<0}function Nt(t,n,e,o){let r=t;do r.z===0&&(r.z=pt(r.x,r.y,n,e,o)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,kt(r)}function kt(t){let n,e=1;do{let o=t,r;t=null;let s=null;for(n=0;o;){n++;let i=o,c=0;for(let u=0;u<e&&(c++,i=i.nextZ,!!i);u++);let x=e;for(;c>0||x>0&&i;)c!==0&&(x===0||!i||o.z<=i.z)?(r=o,o=o.nextZ,c--):(r=i,i=i.nextZ,x--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;o=i}s.nextZ=null,e*=2}while(n>1);return t}function pt(t,n,e,o,r){return t=(t-e)*r|0,n=(n-o)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function Ut(t){let n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function St(t,n,e,o,r,s,i,c){return(r-i)*(n-c)>=(t-i)*(s-c)&&(t-i)*(o-c)>=(e-i)*(n-c)&&(e-i)*(s-c)>=(r-i)*(o-c)}function rt(t,n,e,o,r,s,i,c){return!(t===i&&n===c)&&St(t,n,e,o,r,s,i,c)}function _t(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!Kt(t,n)&&(ot(t,n)&&ot(n,t)&&jt(t,n)&&(w(t.prev,t,n.prev)||w(t,n.prev,n))||K(t,n)&&w(t.prev,t,t.next)>0&&w(n.prev,n,n.next)>0)}function w(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function K(t,n){return t.x===n.x&&t.y===n.y}function bt(t,n,e,o){let r=lt(w(t,n,e)),s=lt(w(t,n,o)),i=lt(w(e,o,t)),c=lt(w(e,o,n));return!!(r!==s&&i!==c||r===0&&ut(t,e,n)||s===0&&ut(t,o,n)||i===0&&ut(e,t,o)||c===0&&ut(e,n,o))}function ut(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function lt(t){return t>0?1:t<0?-1:0}function Kt(t,n){let e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&bt(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function ot(t,n){return w(t.prev,t,t.next)<0?w(t,n,t.next)>=0&&w(t,t.prev,n)>=0:w(t,n,t.prev)<0||w(t,t.next,n)<0}function jt(t,n){let e=t,o=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==t);return o}function Mt(t,n){let e=yt(t.i,t.x,t.y),o=yt(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,e.next=r,r.prev=e,o.next=e,e.prev=o,s.next=o,o.prev=s,o}function vt(t,n,e,o){let r=yt(t,n,e);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function st(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yt(t,n,e){return{i:t,x:n,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vt(t,n,e,o){let r=0;for(let s=n,i=e-o;s<e;s+=o)r+=(t[i]-t[s])*(t[s+1]+t[i+1]),i=s;return r}var qt=new h,Jt=new h,B={};B.computeArea2D=function(t){A.defined("positions",t),A.typeOf.number.greaterThanOrEquals("positions.length",t.length,3);let n=t.length,e=0;for(let o=n-1,r=0;r<n;o=r++){let s=t[o],i=t[r];e+=s.x*i.y-i.x*s.y}return e*.5};B.computeWindingOrder2D=function(t){return B.computeArea2D(t)>0?at.COUNTER_CLOCKWISE:at.CLOCKWISE};B.triangulate=function(t,n){A.defined("positions",t);let e=g.packArray(t);return mt(e,n,2)};var Tt=new h,Ot=new h,Zt=new h,At=new h,Ct=new h,Et=new h,R=new h,Lt=new g,Ft=new g,Dt=new g,j=new g;B.computeSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let l=n[c];if(u[y++]=l.x,u[y++]=l.y,u[y++]=l.z,s){let f=o[c];p[b++]=f.x,p[b++]=f.y}}let S=[],a={},T=t.maximumRadius,L=X.chordLength(r,T),z=L*L;for(;i.length>0;){let l=i.pop(),f=i.pop(),m=i.pop(),M=h.fromArray(u,m*3,Tt),C=h.fromArray(u,f*3,Ot),V=h.fromArray(u,l*3,Zt),q,J,I;s&&(q=g.fromArray(p,m*2,Lt),J=g.fromArray(p,f*2,Ft),I=g.fromArray(p,l*2,Dt));let k=h.multiplyByScalar(h.normalize(M,At),T,At),U=h.multiplyByScalar(h.normalize(C,Ct),T,Ct),W=h.multiplyByScalar(h.normalize(V,Et),T,Et),$=h.magnitudeSquared(h.subtract(k,U,R)),G=h.magnitudeSquared(h.subtract(U,W,R)),Q=h.magnitudeSquared(h.subtract(W,k,R)),H=Math.max($,G,Q),O,v,d;H>z?$===H?(O=`${Math.min(m,f)} ${Math.max(m,f)}`,c=a[O],F(c)||(v=h.add(M,C,R),h.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,a[O]=c,s&&(d=g.add(q,J,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(m,c,l),i.push(c,f,l)):G===H?(O=`${Math.min(f,l)} ${Math.max(f,l)}`,c=a[O],F(c)||(v=h.add(C,V,R),h.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,a[O]=c,s&&(d=g.add(J,I,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(f,c,m),i.push(c,l,m)):Q===H&&(O=`${Math.min(l,m)} ${Math.max(l,m)}`,c=a[O],F(c)||(v=h.add(V,M,R),h.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),c=u.length/3-1,a[O]=c,s&&(d=g.add(I,q,j),g.multiplyByScalar(d,.5,d),p.push(d.x,d.y))),i.push(l,c,f),i.push(c,m,f)):(S.push(m),S.push(f),S.push(l))}let D={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(D.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new ht(D)};var Qt=new Y,Xt=new Y,Yt=new Y,dt=new Y;B.computeRhumbLineSubdivision=function(t,n,e,o,r){r=r??X.RADIANS_PER_DEGREE;let s=F(o);A.typeOf.object("ellipsoid",t),A.defined("positions",n),A.defined("indices",e),A.typeOf.number.greaterThanOrEquals("indices.length",e.length,3),A.typeOf.number.equals("indices.length % 3","0",e.length%3,0),A.typeOf.number.greaterThan("granularity",r,0);let i=e.slice(0),c,x=n.length,u=new Array(x*3),p=new Array(x*2),y=0,b=0;for(c=0;c<x;c++){let m=n[c];if(u[y++]=m.x,u[y++]=m.y,u[y++]=m.z,s){let M=o[c];p[b++]=M.x,p[b++]=M.y}}let S=[],a={},T=t.maximumRadius,L=X.chordLength(r,T),z=new ct(void 0,void 0,t),D=new ct(void 0,void 0,t),l=new ct(void 0,void 0,t);for(;i.length>0;){let m=i.pop(),M=i.pop(),C=i.pop(),V=h.fromArray(u,C*3,Tt),q=h.fromArray(u,M*3,Ot),J=h.fromArray(u,m*3,Zt),I,k,U;s&&(I=g.fromArray(p,C*2,Lt),k=g.fromArray(p,M*2,Ft),U=g.fromArray(p,m*2,Dt));let W=t.cartesianToCartographic(V,Qt),$=t.cartesianToCartographic(q,Xt),G=t.cartesianToCartographic(J,Yt);z.setEndPoints(W,$);let Q=z.surfaceDistance;D.setEndPoints($,G);let H=D.surfaceDistance;l.setEndPoints(G,W);let O=l.surfaceDistance,v=Math.max(Q,H,O),d,P,_,Z,E;v>L?Q===v?(d=`${Math.min(C,M)} ${Math.max(C,M)}`,c=a[d],F(c)||(P=z.interpolateUsingFraction(.5,dt),_=(W.height+$.height)*.5,Z=h.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,a[d]=c,s&&(E=g.add(I,k,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(C,c,m),i.push(c,M,m)):H===v?(d=`${Math.min(M,m)} ${Math.max(M,m)}`,c=a[d],F(c)||(P=D.interpolateUsingFraction(.5,dt),_=($.height+G.height)*.5,Z=h.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,a[d]=c,s&&(E=g.add(k,U,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(M,c,C),i.push(c,m,C)):O===v&&(d=`${Math.min(m,C)} ${Math.max(m,C)}`,c=a[d],F(c)||(P=l.interpolateUsingFraction(.5,dt),_=(G.height+W.height)*.5,Z=h.fromRadians(P.longitude,P.latitude,_,t,R),u.push(Z.x,Z.y,Z.z),c=u.length/3-1,a[d]=c,s&&(E=g.add(U,I,j),g.multiplyByScalar(E,.5,E),p.push(E.x,E.y))),i.push(m,c,M),i.push(c,C,M)):(S.push(C),S.push(M),S.push(m))}let f={attributes:{position:new et({componentDatatype:tt.DOUBLE,componentsPerAttribute:3,values:u})},indices:S,primitiveType:xt.TRIANGLES};return s&&(f.attributes.st=new et({componentDatatype:tt.FLOAT,componentsPerAttribute:2,values:p})),new ht(f)};B.scaleToGeodeticHeight=function(t,n,e,o){e=e??gt.default;let r=qt,s=Jt;if(n=n??0,o=o??!0,F(t)){let i=t.length;for(let c=0;c<i;c+=3)h.fromArray(t,c,s),o&&(s=e.scaleToGeodeticSurface(s,s)),n!==0&&(r=e.geodeticSurfaceNormal(s,r),h.multiplyByScalar(r,n,r),h.add(s,r,s)),t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}return t};var de=B;export{at as a,de as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-THB3EPLO.js b/plugins/feature/map/Cesium/Workers/chunk-THB3EPLO.js new file mode 100644 index 000000000..881d278ae --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-THB3EPLO.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as A}from"./chunk-QQWQKL3T.js";import{j as W}from"./chunk-YZ5ZCI55.js";import{b as Z}from"./chunk-HLXNFZAZ.js";import{a as v,c as N}from"./chunk-KP72RGCH.js";import{a as t,b as U}from"./chunk-OSVSBQDY.js";import{a as ot}from"./chunk-LZC73BOP.js";import{a as ct,b as z}from"./chunk-OU2IPMYE.js";import{f as x}from"./chunk-H7SJWKIY.js";var X=class{constructor(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(e,n){let c=this._semimajorAxis,o=e.longitude*c,a=e.latitude*c,i=e.height;return x(n)?(n.x=o,n.y=a,n.z=i,n):new t(o,a,i)}unproject(e,n){if(!x(e))throw new ct("cartesian is required");let c=this._oneOverSemimajorAxis,o=e.x*c,a=e.y*c,i=e.z;return x(n)?(n.longitude=o,n.latitude=a,n.height=i,n):new v(o,a,i)}},F=X;function ft(m,e){this.start=m??0,this.stop=e??0}var at=ft;var k=class m{constructor(e,n){this.center=t.clone(e??t.ZERO),this.radius=n??0}static fromPoints(e,n){if(x(n)||(n=new m),!x(e)||e.length===0)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;let c=t.clone(e[0],$),o=t.clone(c,Y),a=t.clone(c,G),i=t.clone(c,I),d=t.clone(c,J),s=t.clone(c,K),f=t.clone(c,Q),S=e.length,y;for(y=1;y<S;y++){t.clone(e[y],c);let C=c.x,q=c.y,p=c.z;C<o.x&&t.clone(c,o),C>d.x&&t.clone(c,d),q<a.y&&t.clone(c,a),q>s.y&&t.clone(c,s),p<i.z&&t.clone(c,i),p>f.z&&t.clone(c,f)}let u=t.magnitudeSquared(t.subtract(d,o,j)),r=t.magnitudeSquared(t.subtract(s,a,j)),B=t.magnitudeSquared(t.subtract(f,i,j)),T=o,M=d,b=u;r>b&&(b=r,T=a,M=s),B>b&&(T=i,M=f);let h=L;h.x=(T.x+M.x)*.5,h.y=(T.y+M.y)*.5,h.z=(T.z+M.z)*.5;let w=t.magnitudeSquared(t.subtract(M,h,j)),l=Math.sqrt(w),g=H;g.x=o.x,g.y=a.y,g.z=i.z;let P=_;P.x=d.x,P.y=s.y,P.z=f.z;let D=t.midpoint(g,P,tt),E=0;for(y=0;y<S;y++){t.clone(e[y],c);let C=t.magnitude(t.subtract(c,D,j));C>E&&(E=C);let q=t.magnitudeSquared(t.subtract(c,h,j));if(q>w){let p=Math.sqrt(q);l=(l+p)*.5,w=l*l;let O=p-l;h.x=(l*h.x+O*c.x)/p,h.y=(l*h.y+O*c.y)/p,h.z=(l*h.z+O*c.z)/p}}return l<E?(t.clone(h,n.center),n.radius=l):(t.clone(D,n.center),n.radius=E),n}static fromRectangle2D(e,n,c){return m.fromRectangleWithHeights2D(e,n,0,0,c)}static fromRectangleWithHeights2D(e,n,c,o,a){if(x(a)||(a=new m),!x(e))return a.center=t.clone(t.ZERO,a.center),a.radius=0,a;rt._ellipsoid=N.default,n=n??rt,W.southwest(e,nt),nt.height=c,W.northeast(e,et),et.height=o;let i=n.project(nt,ut),d=n.project(et,xt),s=d.x-i.x,f=d.y-i.y,S=d.z-i.z;a.radius=Math.sqrt(s*s+f*f+S*S)*.5;let y=a.center;return y.x=i.x+s*.5,y.y=i.y+f*.5,y.z=i.z+S*.5,a}static fromRectangle3D(e,n,c,o){if(n=n??N.default,c=c??0,x(o)||(o=new m),!x(e))return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;let a=W.subsample(e,n,c,yt);return m.fromPoints(a,o)}static fromVertices(e,n,c,o){if(x(o)||(o=new m),!x(e)||e.length===0)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=n??t.ZERO,c=c??3,z.typeOf.number.greaterThanOrEquals("stride",c,3);let a=$;a.x=e[0]+n.x,a.y=e[1]+n.y,a.z=e[2]+n.z;let i=t.clone(a,Y),d=t.clone(a,G),s=t.clone(a,I),f=t.clone(a,J),S=t.clone(a,K),y=t.clone(a,Q),u=e.length,r;for(r=0;r<u;r+=c){let p=e[r]+n.x,O=e[r+1]+n.y,R=e[r+2]+n.z;a.x=p,a.y=O,a.z=R,p<i.x&&t.clone(a,i),p>f.x&&t.clone(a,f),O<d.y&&t.clone(a,d),O>S.y&&t.clone(a,S),R<s.z&&t.clone(a,s),R>y.z&&t.clone(a,y)}let B=t.magnitudeSquared(t.subtract(f,i,j)),T=t.magnitudeSquared(t.subtract(S,d,j)),M=t.magnitudeSquared(t.subtract(y,s,j)),b=i,h=f,w=B;T>w&&(w=T,b=d,h=S),M>w&&(b=s,h=y);let l=L;l.x=(b.x+h.x)*.5,l.y=(b.y+h.y)*.5,l.z=(b.z+h.z)*.5;let g=t.magnitudeSquared(t.subtract(h,l,j)),P=Math.sqrt(g),D=H;D.x=i.x,D.y=d.y,D.z=s.z;let E=_;E.x=f.x,E.y=S.y,E.z=y.z;let C=t.midpoint(D,E,tt),q=0;for(r=0;r<u;r+=c){a.x=e[r]+n.x,a.y=e[r+1]+n.y,a.z=e[r+2]+n.z;let p=t.magnitude(t.subtract(a,C,j));p>q&&(q=p);let O=t.magnitudeSquared(t.subtract(a,l,j));if(O>g){let R=Math.sqrt(O);P=(P+R)*.5,g=P*P;let V=R-P;l.x=(P*l.x+V*a.x)/R,l.y=(P*l.y+V*a.y)/R,l.z=(P*l.z+V*a.z)/R}}return P<q?(t.clone(l,o.center),o.radius=P):(t.clone(C,o.center),o.radius=q),o}static fromEncodedCartesianVertices(e,n,c){if(x(c)||(c=new m),!x(e)||!x(n)||e.length!==n.length||e.length===0)return c.center=t.clone(t.ZERO,c.center),c.radius=0,c;let o=$;o.x=e[0]+n[0],o.y=e[1]+n[1],o.z=e[2]+n[2];let a=t.clone(o,Y),i=t.clone(o,G),d=t.clone(o,I),s=t.clone(o,J),f=t.clone(o,K),S=t.clone(o,Q),y=e.length,u;for(u=0;u<y;u+=3){let q=e[u]+n[u],p=e[u+1]+n[u+1],O=e[u+2]+n[u+2];o.x=q,o.y=p,o.z=O,q<a.x&&t.clone(o,a),q>s.x&&t.clone(o,s),p<i.y&&t.clone(o,i),p>f.y&&t.clone(o,f),O<d.z&&t.clone(o,d),O>S.z&&t.clone(o,S)}let r=t.magnitudeSquared(t.subtract(s,a,j)),B=t.magnitudeSquared(t.subtract(f,i,j)),T=t.magnitudeSquared(t.subtract(S,d,j)),M=a,b=s,h=r;B>h&&(h=B,M=i,b=f),T>h&&(M=d,b=S);let w=L;w.x=(M.x+b.x)*.5,w.y=(M.y+b.y)*.5,w.z=(M.z+b.z)*.5;let l=t.magnitudeSquared(t.subtract(b,w,j)),g=Math.sqrt(l),P=H;P.x=a.x,P.y=i.y,P.z=d.z;let D=_;D.x=s.x,D.y=f.y,D.z=S.z;let E=t.midpoint(P,D,tt),C=0;for(u=0;u<y;u+=3){o.x=e[u]+n[u],o.y=e[u+1]+n[u+1],o.z=e[u+2]+n[u+2];let q=t.magnitude(t.subtract(o,E,j));q>C&&(C=q);let p=t.magnitudeSquared(t.subtract(o,w,j));if(p>l){let O=Math.sqrt(p);g=(g+O)*.5,l=g*g;let R=O-g;w.x=(g*w.x+R*o.x)/O,w.y=(g*w.y+R*o.y)/O,w.z=(g*w.z+R*o.z)/O}}return g<C?(t.clone(w,c.center),c.radius=g):(t.clone(E,c.center),c.radius=C),c}static fromCornerPoints(e,n,c){z.typeOf.object("corner",e),z.typeOf.object("oppositeCorner",n),x(c)||(c=new m);let o=t.midpoint(e,n,c.center);return c.radius=t.distance(o,n),c}static fromEllipsoid(e,n){return z.typeOf.object("ellipsoid",e),x(n)||(n=new m),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n}static fromBoundingSpheres(e,n){if(x(n)||(n=new m),!x(e)||e.length===0)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;let c=e.length;if(c===1)return m.clone(e[0],n);if(c===2)return m.union(e[0],e[1],n);let o=[],a;for(a=0;a<c;a++)o.push(e[a].center);n=m.fromPoints(o,n);let i=n.center,d=n.radius;for(a=0;a<c;a++){let s=e[a];d=Math.max(d,t.distance(i,s.center)+s.radius)}return n.radius=d,n}static fromOrientedBoundingBox(e,n){z.defined("orientedBoundingBox",e),x(n)||(n=new m);let c=e.halfAxes,o=U.getColumn(c,0,lt),a=U.getColumn(c,1,zt),i=U.getColumn(c,2,ht);return t.add(o,a,o),t.add(o,i,o),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(o),n}static fromTransformation(e,n){z.typeOf.object("transformation",e),x(n)||(n=new m);let c=Z.getTranslation(e,St),o=Z.getScale(e,wt),a=.5*t.magnitude(o);return n.center=t.clone(c,n.center),n.radius=a,n}static clone(e,n){if(x(e))return x(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new m(e.center,e.radius)}static pack(e,n,c){z.typeOf.object("value",e),z.defined("array",n),c=c??0;let o=e.center;return n[c++]=o.x,n[c++]=o.y,n[c++]=o.z,n[c]=e.radius,n}static unpack(e,n,c){z.defined("array",e),n=n??0,x(c)||(c=new m);let o=c.center;return o.x=e[n++],o.y=e[n++],o.z=e[n++],c.radius=e[n],c}static union(e,n,c){z.typeOf.object("left",e),z.typeOf.object("right",n),x(c)||(c=new m);let o=e.center,a=e.radius,i=n.center,d=n.radius,s=t.subtract(i,o,pt),f=t.magnitude(s);if(a>=f+d)return e.clone(c),c;if(d>=f+a)return n.clone(c),c;let S=(a+f+d)*.5,y=t.multiplyByScalar(s,(-a+S)/f,Pt);return t.add(y,o,y),t.clone(y,c.center),c.radius=S,c}static expand(e,n,c){z.typeOf.object("sphere",e),z.typeOf.object("point",n),c=m.clone(e,c);let o=t.magnitude(t.subtract(n,c.center,Ot));return o>c.radius&&(c.radius=o),c}static intersectPlane(e,n){z.typeOf.object("sphere",e),z.typeOf.object("plane",n);let c=e.center,o=e.radius,a=n.normal,i=t.dot(a,c)+n.distance;return i<-o?A.OUTSIDE:i<o?A.INTERSECTING:A.INSIDE}static transform(e,n,c){return z.typeOf.object("sphere",e),z.typeOf.object("transform",n),x(c)||(c=new m),c.center=Z.multiplyByPoint(n,e.center,c.center),c.radius=Z.getMaximumScale(n)*e.radius,c}static distanceSquaredTo(e,n){z.typeOf.object("sphere",e),z.typeOf.object("cartesian",n);let c=t.subtract(e.center,n,gt),o=t.magnitude(c)-e.radius;return o<=0?0:o*o}static transformWithoutScale(e,n,c){return z.typeOf.object("sphere",e),z.typeOf.object("transform",n),x(c)||(c=new m),c.center=Z.multiplyByPoint(n,e.center,c.center),c.radius=e.radius,c}static computePlaneDistances(e,n,c,o){z.typeOf.object("sphere",e),z.typeOf.object("position",n),z.typeOf.object("direction",c),x(o)||(o=new at);let a=t.subtract(e.center,n,bt),i=t.dot(c,a);return o.start=i-e.radius,o.stop=i+e.radius,o}static projectTo2D(e,n,c){z.typeOf.object("sphere",e),dt._ellipsoid=N.default,n=n??dt;let o=n.ellipsoid,a=e.center,i=e.radius,d;t.equals(a,t.ZERO)?d=t.clone(t.UNIT_X,it):d=o.geodeticSurfaceNormal(a,it);let s=t.cross(t.UNIT_Z,d,jt);t.normalize(s,s);let f=t.cross(d,s,qt);t.normalize(f,f),t.multiplyByScalar(d,i,d),t.multiplyByScalar(f,i,f),t.multiplyByScalar(s,i,s);let S=t.negate(f,Ct),y=t.negate(s,Mt),u=st,r=u[0];t.add(d,f,r),t.add(r,s,r),r=u[1],t.add(d,f,r),t.add(r,y,r),r=u[2],t.add(d,S,r),t.add(r,y,r),r=u[3],t.add(d,S,r),t.add(r,s,r),t.negate(d,d),r=u[4],t.add(d,f,r),t.add(r,s,r),r=u[5],t.add(d,f,r),t.add(r,y,r),r=u[6],t.add(d,S,r),t.add(r,y,r),r=u[7],t.add(d,S,r),t.add(r,s,r);let B=u.length;for(let h=0;h<B;++h){let w=u[h];t.add(a,w,w);let l=o.cartesianToCartographic(w,Rt);n.project(l,w)}c=m.fromPoints(u,c),a=c.center;let T=a.x,M=a.y,b=a.z;return a.x=b,a.y=T,a.z=M,c}static isOccluded(e,n){return z.typeOf.object("sphere",e),z.typeOf.object("occluder",n),!n.isBoundingSphereVisible(e)}static equals(e,n){return e===n||x(e)&&x(n)&&t.equals(e.center,n.center)&&e.radius===n.radius}intersectPlane(e){return m.intersectPlane(this,e)}distanceSquaredTo(e){return m.distanceSquaredTo(this,e)}computePlaneDistances(e,n,c){return m.computePlaneDistances(this,e,n,c)}isOccluded(e){return m.isOccluded(this,e)}equals(e){return m.equals(this,e)}clone(e){return m.clone(this,e)}volume(){let e=this.radius;return mt*e*e*e}};k.packedLength=4;var Y=new t,G=new t,I=new t,J=new t,K=new t,Q=new t,$=new t,j=new t,L=new t,H=new t,_=new t,tt=new t,mt=4/3*ot.PI,rt=new F,ut=new t,xt=new t,nt=new v,et=new v,yt=[],lt=new t,zt=new t,ht=new t,St=new t,wt=new t,pt=new t,Pt=new t,Ot=new t,gt=new t,bt=new t,it=new t,jt=new t,qt=new t,Mt=new t,Ct=new t,Rt=new v,st=new Array(8);for(let m=0;m<8;++m)st[m]=new t;var dt=new F,Qt=k;export{F as a,at as b,Qt as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-UI4K6XI3.js b/plugins/feature/map/Cesium/Workers/chunk-UI4K6XI3.js new file mode 100644 index 000000000..78c2436f1 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-UI4K6XI3.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as N}from"./chunk-FZSSAWMQ.js";import{a as ae}from"./chunk-SIBAZPZR.js";import{a as re}from"./chunk-ILBQ77ZM.js";import{b as ie,c as oe,d as J}from"./chunk-7RNSURKI.js";import{c as ne}from"./chunk-THB3EPLO.js";import{a as E}from"./chunk-QQWQKL3T.js";import{h as D}from"./chunk-YZ5ZCI55.js";import{a as C,b as F}from"./chunk-HLXNFZAZ.js";import{a as H}from"./chunk-WCOEOHX5.js";import{a as r,b as G,c as A}from"./chunk-OSVSBQDY.js";import{a as O}from"./chunk-LZC73BOP.js";import{a as w,b}from"./chunk-OU2IPMYE.js";import{f as a}from"./chunk-H7SJWKIY.js";function R(e){this.planes=e??[]}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]);r.clone(r.UNIT_Y,X[1]);r.clone(r.UNIT_Z,X[2]);var j=new r,me=new r,fe=new ae(new r(1,0,0),0);function ce(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}R.fromBoundingSphere=function(e,t){if(!a(e))throw new w("boundingSphere is required.");a(t)||(t=new R);let n=X.length,f=t.planes;f.length=2*n;let p=e.center,_=e.radius,s=0;for(let m=0;m<n;++m){let i=X[m],c=f[s],d=f[s+1];a(c)||(c=f[s]=new C),a(d)||(d=f[s+1]=new C),r.multiplyByScalar(i,-_,j),r.add(p,j,j),c.x=i.x,c.y=i.y,c.z=i.z,c.w=-r.dot(i,j),r.multiplyByScalar(i,_,j),r.add(p,j,j),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,me),j),s+=2}return t};R.prototype.computeVisibility=function(e){if(!a(e))throw new w("boundingVolume is required.");let t=this.planes,n=!1;for(let f=0,p=t.length;f<p;++f){let _=e.intersectPlane(ce(t[f],fe));if(_===E.OUTSIDE)return E.OUTSIDE;_===E.INTERSECTING&&(n=!0)}return n?E.INTERSECTING:E.INSIDE};R.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!a(e))throw new w("boundingVolume is required.");if(!a(t))throw new w("parentPlaneMask is required.");if(t===R.MASK_OUTSIDE||t===R.MASK_INSIDE)return t;let n=R.MASK_INSIDE,f=this.planes;for(let p=0,_=f.length;p<_;++p){let s=p<31?1<<p:0;if(p<31&&(t&s)===0)continue;let m=e.intersectPlane(ce(f[p],fe));if(m===E.OUTSIDE)return R.MASK_OUTSIDE;m===E.INTERSECTING&&(n|=s)}return n};R.MASK_OUTSIDE=4294967295;R.MASK_INSIDE=0;R.MASK_INDETERMINATE=2147483647;var Q=R;function M(e){e=e??A.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Q,this._orthographicMatrix=new F}function he(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than 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=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return he(this),this._orthographicMatrix}}});var ye=new r,ge=new r,Ce=new r,I=new r;M.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,p=this.top,_=this.bottom,s=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,ye);r.normalize(d,d);let y=ge;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Ce;r.multiplyByScalar(d,m,l),r.add(y,l,l);let o=f[0];return a(o)||(o=f[0]=new C),o.x=d.x,o.y=d.y,o.z=d.z,o.w=-r.dot(d,l),r.multiplyByScalar(d,s,l),r.add(y,l,l),o=f[1],a(o)||(o=f[1]=new C),o.x=-d.x,o.y=-d.y,o.z=-d.z,o.w=-r.dot(r.negate(d,I),l),r.multiplyByScalar(n,_,l),r.add(y,l,l),o=f[2],a(o)||(o=f[2]=new C),o.x=n.x,o.y=n.y,o.z=n.z,o.w=-r.dot(n,l),r.multiplyByScalar(n,p,l),r.add(y,l,l),o=f[3],a(o)||(o=f[3]=new C),o.x=-n.x,o.y=-n.y,o.z=-n.z,o.w=-r.dot(r.negate(n,I),l),o=f[4],a(o)||(o=f[4]=new C),o.x=t.x,o.y=t.y,o.z=t.z,o.w=-r.dot(t,y),r.multiplyByScalar(t,c,l),r.add(e,l,l),o=f[5],a(o)||(o=f[5]=new C),o.x=-t.x,o.y=-t.y,o.z=-t.z,o.w=-r.dot(r.negate(t,I),l),this._cullingVolume};M.prototype.getPixelDimensions=function(e,t,n,f,p){if(he(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(p))throw new w("A result object is required.");let _=this.right-this.left,s=this.top-this.bottom,m=f*_/e,i=f*s/t;return p.x=m,p.y=i,p};M.prototype.clone=function(e){return a(e)||(e=new M),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};M.prototype.equals=function(e){return a(e)&&e instanceof M&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};M.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof M&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var pe=M;function x(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new pe,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}x.packedLength=4;x.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};x.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new x),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B(e){if(!a(e.width)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than 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(x.prototype,{projectionMatrix:{get:function(){return B(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,t,n){return B(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};x.prototype.getPixelDimensions=function(e,t,n,f,p){return B(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};x.prototype.clone=function(e){return a(e)||(e=new x),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};x.prototype.equals=function(e){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof x)?!1:(B(this),B(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var V=x;function k(e){e=e??A.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Q,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function ee(e){if(!a(e.right)||!a(e.left)||!a(e.top)||!a(e.bottom)||!a(e.near)||!a(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:f,left:p,near:_,far:s}=e;if(t!==e._top||n!==e._bottom||p!==e._left||f!==e._right||_!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=p,e._right=f,e._top=t,e._bottom=n,e._near=_,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(p,f,n,t,_,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(p,f,n,t,_,e._infinitePerspective)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return ee(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return ee(this),this._infinitePerspective}}});var be=new r,Oe=new r,Fe=new r,Pe=new r;k.prototype.computeCullingVolume=function(e,t,n){if(!a(e))throw new w("position is required.");if(!a(t))throw new w("direction is required.");if(!a(n))throw new w("up is required.");let f=this._cullingVolume.planes,p=this.top,_=this.bottom,s=this.right,m=this.left,i=this.near,c=this.far,d=r.cross(t,n,be),y=Oe;r.multiplyByScalar(t,i,y),r.add(e,y,y);let l=Fe;r.multiplyByScalar(t,c,l),r.add(e,l,l);let o=Pe;r.multiplyByScalar(d,m,o),r.add(y,o,o),r.subtract(o,e,o),r.normalize(o,o),r.cross(o,n,o),r.normalize(o,o);let h=f[0];return a(h)||(h=f[0]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(d,s,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(n,o,o),r.normalize(o,o),h=f[1],a(h)||(h=f[1]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,_,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(d,o,o),r.normalize(o,o),h=f[2],a(h)||(h=f[2]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),r.multiplyByScalar(n,p,o),r.add(y,o,o),r.subtract(o,e,o),r.cross(o,d,o),r.normalize(o,o),h=f[3],a(h)||(h=f[3]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,e),h=f[4],a(h)||(h=f[4]=new C),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-r.dot(t,y),r.negate(t,o),h=f[5],a(h)||(h=f[5]=new C),h.x=o.x,h.y=o.y,h.z=o.z,h.w=-r.dot(o,l),this._cullingVolume};k.prototype.getPixelDimensions=function(e,t,n,f,p){if(ee(this),!a(e)||!a(t))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(t<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(n))throw new w("distance is required.");if(!a(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!a(p))throw new w("A result object is required.");let _=1/this.near,s=this.top*_,m=2*f*n*s/t;s=this.right*_;let i=2*f*n*s/e;return p.x=i,p.y=m,p};k.prototype.clone=function(e){return a(e)||(e=new k),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};k.prototype.equals=function(e){return a(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,t,n){return e===this||a(e)&&e instanceof k&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var se=k;function v(e){e=e??A.EMPTY_OBJECT,this._offCenterFrustum=new se,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}v.packedLength=6;v.pack=function(e,t,n){return b.typeOf.object("value",e),b.defined("array",t),n=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};v.unpack=function(e,t,n){return b.defined("array",e),t=t??0,a(n)||(n=new v),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 T(e){if(!a(e.fov)||!a(e.aspectRatio)||!a(e.near)||!a(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");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;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");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(v.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}});v.prototype.computeCullingVolume=function(e,t,n){return T(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};v.prototype.getPixelDimensions=function(e,t,n,f,p){return T(this),this._offCenterFrustum.getPixelDimensions(e,t,n,f,p)};v.prototype.clone=function(e){return a(e)||(e=new v),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};v.prototype.equals=function(e){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};v.prototype.equalsEpsilon=function(e,t,n){return!a(e)||!(e instanceof v)?!1:(T(this),T(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var L=v;var $=0,ze=1;function u(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,f=e.origin,p=e.vertexFormat??N.DEFAULT,_=e._drawNearPlane??!0,s,m;t instanceof L?(s=$,m=L.packedLength):t instanceof V&&(s=ze,m=V.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=r.clone(f),this._orientation=D.clone(n),this._drawNearPlane=_,this._vertexFormat=p,this._workerName="createFrustumGeometry",this.packedLength=2+m+r.packedLength+D.packedLength+N.packedLength}u.pack=function(e,t,n){b.typeOf.object("value",e),b.defined("array",t),n=n??0;let f=e._frustumType,p=e._frustum;return t[n++]=f,f===$?(L.pack(p,t,n),n+=L.packedLength):(V.pack(p,t,n),n+=V.packedLength),r.pack(e._origin,t,n),n+=r.packedLength,D.pack(e._orientation,t,n),n+=D.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,t[n]=e._drawNearPlane?1:0,t};var xe=new L,ve=new V,Re=new D,Te=new r,qe=new N;u.unpack=function(e,t,n){b.defined("array",e),t=t??0;let f=e[t++],p;f===$?(p=L.unpack(e,t,xe),t+=L.packedLength):(p=V.unpack(e,t,ve),t+=V.packedLength);let _=r.unpack(e,t,Te);t+=r.packedLength;let s=D.unpack(e,t,Re);t+=D.packedLength;let m=N.unpack(e,t,qe);t+=N.packedLength;let i=e[t]===1;if(!a(n))return new u({frustum:p,origin:_,orientation:s,vertexFormat:m,_drawNearPlane:i});let c=f===n._frustumType?n._frustum:void 0;return n._frustum=p.clone(c),n._frustumType=f,n._origin=r.clone(_,n._origin),n._orientation=D.clone(s,n._orientation),n._vertexFormat=N.clone(m,n._vertexFormat),n._drawNearPlane=i,n};function W(e,t,n,f,p,_,s,m){let i=e/3*2;for(let c=0;c<4;++c)a(t)&&(t[e]=_.x,t[e+1]=_.y,t[e+2]=_.z),a(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),a(f)&&(f[e]=m.x,f[e+1]=m.y,f[e+2]=m.z),e+=3;p[i]=0,p[i+1]=0,p[i+2]=1,p[i+3]=0,p[i+4]=1,p[i+5]=1,p[i+6]=0,p[i+7]=1}var Me=new G,ke=new F,te=new F,le=new r,we=new r,_e=new r,Se=new r,De=new r,Ne=new r,U=new Array(3),Z=new Array(4);Z[0]=new C(-1,-1,1,1);Z[1]=new C(1,-1,1,1);Z[2]=new C(1,1,1,1);Z[3]=new C(-1,1,1,1);var de=new Array(4);for(let e=0;e<4;++e)de[e]=new C;u._computeNearFarPlanes=function(e,t,n,f,p,_,s,m){let i=G.fromQuaternion(t,Me),c=_??le,d=s??we,y=m??_e;c=G.getColumn(i,0,c),d=G.getColumn(i,1,d),y=G.getColumn(i,2,y),r.normalize(c,c),r.normalize(d,d),r.normalize(y,y),r.negate(c,c);let l=F.computeView(e,y,d,c,ke),o,h,q=f.projectionMatrix;if(n===$){let P=F.multiply(q,l,te);h=F.inverse(P,te)}else o=F.inverseTransformation(l,te);a(h)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let P=0;P<2;++P)for(let z=0;z<4;++z){let g=C.clone(Z[z],de[z]);if(a(h)){g=F.multiplyByVector(h,g,g);let S=1/g.w;r.multiplyByScalar(g,S,g),r.subtract(g,e,g),r.normalize(g,g);let Y=r.dot(y,g);r.multiplyByScalar(g,U[P]/Y,g),r.add(g,e,g)}else{let S=f.offCenterFrustum;a(S)&&(f=S);let Y=U[P],K=U[P+1];g.x=(g.x*(f.right-f.left)+f.left+f.right)*.5,g.y=(g.y*(f.top-f.bottom)+f.bottom+f.top)*.5,g.z=(g.z*(Y-K)-Y-K)*.5,g.w=1,F.multiplyByVector(o,g,g)}p[12*P+z*3]=g.x,p[12*P+z*3+1]=g.y,p[12*P+z*3+2]=g.z}};u.createGeometry=function(e){let t=e._frustumType,n=e._frustum,f=e._origin,p=e._orientation,_=e._drawNearPlane,s=e._vertexFormat,m=_?6:5,i=new Float64Array(72);u._computeNearFarPlanes(f,p,t,n,i);let c=24;i[c]=i[12],i[c+1]=i[13],i[c+2]=i[14],i[c+3]=i[0],i[c+4]=i[1],i[c+5]=i[2],i[c+6]=i[9],i[c+7]=i[10],i[c+8]=i[11],i[c+9]=i[21],i[c+10]=i[22],i[c+11]=i[23],c+=12,i[c]=i[15],i[c+1]=i[16],i[c+2]=i[17],i[c+3]=i[3],i[c+4]=i[4],i[c+5]=i[5],i[c+6]=i[0],i[c+7]=i[1],i[c+8]=i[2],i[c+9]=i[12],i[c+10]=i[13],i[c+11]=i[14],c+=12,i[c]=i[3],i[c+1]=i[4],i[c+2]=i[5],i[c+3]=i[15],i[c+4]=i[16],i[c+5]=i[17],i[c+6]=i[18],i[c+7]=i[19],i[c+8]=i[20],i[c+9]=i[6],i[c+10]=i[7],i[c+11]=i[8],c+=12,i[c]=i[6],i[c+1]=i[7],i[c+2]=i[8],i[c+3]=i[18],i[c+4]=i[19],i[c+5]=i[20],i[c+6]=i[21],i[c+7]=i[22],i[c+8]=i[23],i[c+9]=i[9],i[c+10]=i[10],i[c+11]=i[11],_||(i=i.subarray(12));let d=new re({position:new J({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:i})});if(a(s.normal)||a(s.tangent)||a(s.bitangent)||a(s.st)){let l=a(s.normal)?new Float32Array(12*m):void 0,o=a(s.tangent)?new Float32Array(12*m):void 0,h=a(s.bitangent)?new Float32Array(12*m):void 0,q=a(s.st)?new Float32Array(8*m):void 0,P=le,z=we,g=_e,S=r.negate(P,Se),Y=r.negate(z,De),K=r.negate(g,Ne);c=0,_&&(W(c,l,o,h,q,K,P,z),c+=12),W(c,l,o,h,q,g,S,z),c+=12,W(c,l,o,h,q,S,K,z),c+=12,W(c,l,o,h,q,Y,K,S),c+=12,W(c,l,o,h,q,P,g,z),c+=12,W(c,l,o,h,q,z,g,S),a(l)&&(d.normal=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:l})),a(o)&&(d.tangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:o})),a(h)&&(d.bitangent=new J({componentDatatype:H.FLOAT,componentsPerAttribute:3,values:h})),a(q)&&(d.st=new J({componentDatatype:H.FLOAT,componentsPerAttribute:2,values:q}))}let y=new Uint16Array(6*m);for(let l=0;l<m;++l){let o=l*6,h=l*4;y[o]=h,y[o+1]=h+1,y[o+2]=h+2,y[o+3]=h,y[o+4]=h+2,y[o+5]=h+3}return new oe({attributes:d,indices:y,primitiveType:ie.TRIANGLES,boundingSphere:ne.fromVertices(i)})};var At=u;export{V as a,L as b,At as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-UVR3GLLW.js b/plugins/feature/map/Cesium/Workers/chunk-UVR3GLLW.js deleted file mode 100644 index 99004299d..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-UVR3GLLW.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as C}from"./chunk-ALKSRI7Y.js";import{a as P}from"./chunk-PNMU44JZ.js";import{a as O,b as L}from"./chunk-FGKVHLJ4.js";import{a as y}from"./chunk-YRCAQUFT.js";import{e as S}from"./chunk-3BGP4HCL.js";var T={};function b(a,e){return y.equalsEpsilon(a.latitude,e.latitude,y.EPSILON10)&&y.equalsEpsilon(a.longitude,e.longitude,y.EPSILON10)}var q=new L,v=new L;function w(a,e,i,h){e=P(e,O.equalsEpsilon);let p=e.length;if(p<2)return;let E=S(h),u=S(i),l=new Array(p),g=new Array(p),r=new Array(p),d=e[0];l[0]=d;let f=a.cartesianToCartographic(d,q);u&&(f.height=i[0]),g[0]=f.height,E?r[0]=h[0]:r[0]=0;let o=g[0],m=r[0],t=o===m,n=1;for(let c=1;c<p;++c){let A=e[c],s=a.cartesianToCartographic(A,v);u&&(s.height=i[c]),t=t&&s.height===0,b(f,s)?f.height<s.height&&(g[n-1]=s.height):(l[n]=A,g[n]=s.height,E?r[n]=h[c]:r[n]=0,t=t&&g[n]===r[n],L.clone(s,f),++n)}if(!(t||n<2))return l.length=n,g.length=n,r.length=n,{positions:l,topHeights:g,bottomHeights:r}}var D=new Array(2),F=new Array(2),B={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};T.computePositions=function(a,e,i,h,p,E){let u=w(a,e,i,h);if(!S(u))return;e=u.positions,i=u.topHeights,h=u.bottomHeights;let l=e.length,g=l-2,r,d,f=y.chordLength(p,a.maximumRadius),o=B;if(o.minDistance=f,o.ellipsoid=a,E){let m=0,t;for(t=0;t<l-1;t++)m+=C.numberOfPoints(e[t],e[t+1],f)+1;r=new Float64Array(m*3),d=new Float64Array(m*3);let n=D,c=F;o.positions=n,o.height=c;let A=0;for(t=0;t<l-1;t++){n[0]=e[t],n[1]=e[t+1],c[0]=i[t],c[1]=i[t+1];let s=C.generateArc(o);r.set(s,A),c[0]=h[t],c[1]=h[t+1],d.set(C.generateArc(o),A),A+=s.length}}else o.positions=e,o.height=i,r=new Float64Array(C.generateArc(o)),o.height=h,d=new Float64Array(C.generateArc(o));return{bottomPositions:d,topPositions:r,numCorners:g}};var j=T;export{j as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-V23IN42C.js b/plugins/feature/map/Cesium/Workers/chunk-V23IN42C.js new file mode 100644 index 000000000..1e306940c --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-V23IN42C.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as k}from"./chunk-AZINMULF.js";import{a as T}from"./chunk-LZC73BOP.js";import{a as d}from"./chunk-OU2IPMYE.js";import{f as E}from"./chunk-H7SJWKIY.js";function a(){d.throwInstantiationError()}Object.defineProperties(a.prototype,{errorEvent:{get:d.throwInstantiationError},credit:{get:d.throwInstantiationError},tilingScheme:{get:d.throwInstantiationError},hasWaterMask:{get:d.throwInstantiationError},hasVertexNormals:{get:d.throwInstantiationError},availability:{get:d.throwInstantiationError}});var b=[];a.getRegularGridIndices=function(t,n){if(t*n>=T.FOUR_GIGABYTES)throw new d("The total number of vertices (width * height) must be less than 4,294,967,296.");let r=b[t];E(r)||(b[t]=r=[]);let e=r[n];return E(e)||(t*n<T.SIXTY_FOUR_KILOBYTES?e=r[n]=new Uint16Array((t-1)*(n-1)*6):e=r[n]=new Uint32Array((t-1)*(n-1)*6),v(t,n,e,0)),e};var N=[];a.getRegularGridIndicesAndEdgeIndices=function(t,n){if(t*n>=T.FOUR_GIGABYTES)throw new d("The total number of vertices (width * height) must be less than 4,294,967,296.");let r=N[t];E(r)||(N[t]=r=[]);let e=r[n];if(!E(e)){let i=a.getRegularGridIndices(t,n),s=w(t,n),o=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,I=s.eastIndicesNorthToSouth,u=s.northIndicesWestToEast;e=r[n]={indices:i,westIndicesSouthToNorth:o,southIndicesEastToWest:c,eastIndicesNorthToSouth:I,northIndicesWestToEast:u}}return e};var R=[];a.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,n){if(t*n>=T.FOUR_GIGABYTES)throw new d("The total number of vertices (width * height) must be less than 4,294,967,296.");let r=R[t];E(r)||(R[t]=r=[]);let e=r[n];if(!E(e)){let i=t*n,s=(t-1)*(n-1)*6,o=t*2+n*2,c=Math.max(0,o-4)*6,I=i+o,u=s+c,l=w(t,n),h=l.westIndicesSouthToNorth,x=l.southIndicesEastToWest,m=l.eastIndicesNorthToSouth,S=l.northIndicesWestToEast,g=k.createTypedArray(I,u);v(t,n,g,0),a.addSkirtIndices(h,x,m,S,i,g,s),e=r[n]={indices:g,westIndicesSouthToNorth:h,southIndicesEastToWest:x,eastIndicesNorthToSouth:m,northIndicesWestToEast:S,indexCountWithoutSkirts:s}}return e};a.getSkirtVertexCount=function(t,n,r,e){return t.length+n.length+r.length+e.length};a.getSkirtIndexCount=function(t){return(t-4)*2*3};a.getSkirtIndexCountWithFilledCorners=function(t){return((t-4)*2+4)*3};a.addSkirtIndices=function(t,n,r,e,i,s,o){let c=i;o=p(t,c,s,o),c+=t.length,o=p(n,c,s,o),c+=n.length,o=p(r,c,s,o),c+=r.length,p(e,c,s,o)};a.addSkirtIndicesWithFilledCorners=function(t,n,r,e,i,s,o){a.addSkirtIndices(t,n,r,e,i,s,o);let c=a.getSkirtVertexCount(t,n,r,e),I=a.getSkirtIndexCount(c),u=o+I,l=t[0],h=e[0],x=r[0],m=n[0],S=i,g=S+t.length-1,y=g+1,A=y+n.length-1,W=A+1,C=W+r.length-1,G=C+1,F=G+e.length-1;s[u+0]=l,s[u+1]=S,s[u+2]=A,s[u+3]=m,s[u+4]=y,s[u+5]=C,s[u+6]=x,s[u+7]=W,s[u+8]=F,s[u+9]=h,s[u+10]=G,s[u+11]=g};function w(t,n){let r=new Array(n),e=new Array(t),i=new Array(n),s=new Array(t),o;for(o=0;o<t;++o)s[o]=o,e[o]=t*n-1-o;for(o=0;o<n;++o)i[o]=(o+1)*t-1,r[o]=(n-o-1)*t;return{westIndicesSouthToNorth:r,southIndicesEastToWest:e,eastIndicesNorthToSouth:i,northIndicesWestToEast:s}}function v(t,n,r,e){let i=0;for(let s=0;s<n-1;++s){for(let o=0;o<t-1;++o){let c=i,I=c+t,u=I+1,l=c+1;r[e++]=c,r[e++]=I,r[e++]=l,r[e++]=l,r[e++]=I,r[e++]=u,++i}++i}}function p(t,n,r,e){let i=t[0],s=t.length;for(let o=1;o<s;++o){let c=t[o];r[e++]=i,r[e++]=c,r[e++]=n,r[e++]=n,r[e++]=c,r[e++]=n+1,i=c,++n}return e}a.heightmapTerrainQuality=.25;a.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(t,n,r){return t.maximumRadius*2*Math.PI*a.heightmapTerrainQuality/(n*r)};a.prototype.requestTileGeometry=d.throwInstantiationError;a.prototype.getLevelMaximumGeometricError=d.throwInstantiationError;a.prototype.getTileDataAvailable=d.throwInstantiationError;a.prototype.loadTileDataAvailability=d.throwInstantiationError;var M=a;export{M as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-WCOEOHX5.js b/plugins/feature/map/Cesium/Workers/chunk-WCOEOHX5.js new file mode 100644 index 000000000..0b201ebc7 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-WCOEOHX5.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as N}from"./chunk-ZJRS2FK6.js";import{a as t}from"./chunk-OU2IPMYE.js";import{f as T}from"./chunk-H7SJWKIY.js";var r={BYTE:N.BYTE,UNSIGNED_BYTE:N.UNSIGNED_BYTE,SHORT:N.SHORT,UNSIGNED_SHORT:N.UNSIGNED_SHORT,INT:N.INT,UNSIGNED_INT:N.UNSIGNED_INT,FLOAT:N.FLOAT,DOUBLE:N.DOUBLE};r.getSizeInBytes=function(n){if(!T(n))throw new t("value is required.");switch(n){case r.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.INT:return Int32Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new t("componentDatatype is not a valid value.")}};r.fromTypedArray=function(n){if(n instanceof Int8Array)return r.BYTE;if(n instanceof Uint8Array)return r.UNSIGNED_BYTE;if(n instanceof Int16Array)return r.SHORT;if(n instanceof Uint16Array)return r.UNSIGNED_SHORT;if(n instanceof Int32Array)return r.INT;if(n instanceof Uint32Array)return r.UNSIGNED_INT;if(n instanceof Float32Array)return r.FLOAT;if(n instanceof Float64Array)return r.DOUBLE;throw new t("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};r.validate=function(n){return T(n)&&(n===r.BYTE||n===r.UNSIGNED_BYTE||n===r.SHORT||n===r.UNSIGNED_SHORT||n===r.INT||n===r.UNSIGNED_INT||n===r.FLOAT||n===r.DOUBLE)};r.createTypedArray=function(n,e){if(!T(n))throw new t("componentDatatype is required.");if(!T(e))throw new t("valuesOrLength is required.");switch(n){case r.BYTE:return new Int8Array(e);case r.UNSIGNED_BYTE:return new Uint8Array(e);case r.SHORT:return new Int16Array(e);case r.UNSIGNED_SHORT:return new Uint16Array(e);case r.INT:return new Int32Array(e);case r.UNSIGNED_INT:return new Uint32Array(e);case r.FLOAT:return new Float32Array(e);case r.DOUBLE:return new Float64Array(e);default:throw new t("componentDatatype is not a valid value.")}};r.createArrayBufferView=function(n,e,a,E){if(!T(n))throw new t("componentDatatype is required.");if(!T(e))throw new t("buffer is required.");switch(a=a??0,E=E??(e.byteLength-a)/r.getSizeInBytes(n),n){case r.BYTE:return new Int8Array(e,a,E);case r.UNSIGNED_BYTE:return new Uint8Array(e,a,E);case r.SHORT:return new Int16Array(e,a,E);case r.UNSIGNED_SHORT:return new Uint16Array(e,a,E);case r.INT:return new Int32Array(e,a,E);case r.UNSIGNED_INT:return new Uint32Array(e,a,E);case r.FLOAT:return new Float32Array(e,a,E);case r.DOUBLE:return new Float64Array(e,a,E);default:throw new t("componentDatatype is not a valid value.")}};r.fromName=function(n){switch(n){case"BYTE":return r.BYTE;case"UNSIGNED_BYTE":return r.UNSIGNED_BYTE;case"SHORT":return r.SHORT;case"UNSIGNED_SHORT":return r.UNSIGNED_SHORT;case"INT":return r.INT;case"UNSIGNED_INT":return r.UNSIGNED_INT;case"FLOAT":return r.FLOAT;case"DOUBLE":return r.DOUBLE;default:throw new t("name is not a valid value.")}};r.dequantize=function(n,e){switch(e){case r.BYTE:return Math.max(n/127,-1);case r.UNSIGNED_BYTE:return n/255;case r.SHORT:return Math.max(n/32767,-1);case r.UNSIGNED_SHORT:return n/65535;case r.INT:return Math.max(n/2147483647,-1);case r.UNSIGNED_INT:return n/4294967295;default:throw new t("componentDatatype is not a valid integer type for dequantization.")}};Object.freeze(r);var c=r;export{c as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-WER4LUMF.js b/plugins/feature/map/Cesium/Workers/chunk-WER4LUMF.js deleted file mode 100644 index 1a1ee0434..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-WER4LUMF.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as N}from"./chunk-OVIPITBL.js";import{a}from"./chunk-ELJAHN3H.js";import{e as T}from"./chunk-3BGP4HCL.js";var r={BYTE:N.BYTE,UNSIGNED_BYTE:N.UNSIGNED_BYTE,SHORT:N.SHORT,UNSIGNED_SHORT:N.UNSIGNED_SHORT,INT:N.INT,UNSIGNED_INT:N.UNSIGNED_INT,FLOAT:N.FLOAT,DOUBLE:N.DOUBLE};r.getSizeInBytes=function(n){if(!T(n))throw new a("value is required.");switch(n){case r.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.INT:return Int32Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new a("componentDatatype is not a valid value.")}};r.fromTypedArray=function(n){if(n instanceof Int8Array)return r.BYTE;if(n instanceof Uint8Array)return r.UNSIGNED_BYTE;if(n instanceof Int16Array)return r.SHORT;if(n instanceof Uint16Array)return r.UNSIGNED_SHORT;if(n instanceof Int32Array)return r.INT;if(n instanceof Uint32Array)return r.UNSIGNED_INT;if(n instanceof Float32Array)return r.FLOAT;if(n instanceof Float64Array)return r.DOUBLE;throw new a("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};r.validate=function(n){return T(n)&&(n===r.BYTE||n===r.UNSIGNED_BYTE||n===r.SHORT||n===r.UNSIGNED_SHORT||n===r.INT||n===r.UNSIGNED_INT||n===r.FLOAT||n===r.DOUBLE)};r.createTypedArray=function(n,e){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("valuesOrLength is required.");switch(n){case r.BYTE:return new Int8Array(e);case r.UNSIGNED_BYTE:return new Uint8Array(e);case r.SHORT:return new Int16Array(e);case r.UNSIGNED_SHORT:return new Uint16Array(e);case r.INT:return new Int32Array(e);case r.UNSIGNED_INT:return new Uint32Array(e);case r.FLOAT:return new Float32Array(e);case r.DOUBLE:return new Float64Array(e);default:throw new a("componentDatatype is not a valid value.")}};r.createArrayBufferView=function(n,e,E,t){if(!T(n))throw new a("componentDatatype is required.");if(!T(e))throw new a("buffer is required.");switch(E=E??0,t=t??(e.byteLength-E)/r.getSizeInBytes(n),n){case r.BYTE:return new Int8Array(e,E,t);case r.UNSIGNED_BYTE:return new Uint8Array(e,E,t);case r.SHORT:return new Int16Array(e,E,t);case r.UNSIGNED_SHORT:return new Uint16Array(e,E,t);case r.INT:return new Int32Array(e,E,t);case r.UNSIGNED_INT:return new Uint32Array(e,E,t);case r.FLOAT:return new Float32Array(e,E,t);case r.DOUBLE:return new Float64Array(e,E,t);default:throw new a("componentDatatype is not a valid value.")}};r.fromName=function(n){switch(n){case"BYTE":return r.BYTE;case"UNSIGNED_BYTE":return r.UNSIGNED_BYTE;case"SHORT":return r.SHORT;case"UNSIGNED_SHORT":return r.UNSIGNED_SHORT;case"INT":return r.INT;case"UNSIGNED_INT":return r.UNSIGNED_INT;case"FLOAT":return r.FLOAT;case"DOUBLE":return r.DOUBLE;default:throw new a("name is not a valid value.")}};var A=Object.freeze(r);export{A as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-WVRWFNLS.js b/plugins/feature/map/Cesium/Workers/chunk-WVRWFNLS.js new file mode 100644 index 000000000..5f2fab490 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-WVRWFNLS.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as y}from"./chunk-QCE33JV5.js";import{c as W}from"./chunk-THB3EPLO.js";import{j as k}from"./chunk-YZ5ZCI55.js";import{b as h}from"./chunk-HLXNFZAZ.js";import{a as A}from"./chunk-WCOEOHX5.js";import{a as F,b as T,c as w}from"./chunk-KP72RGCH.js";import{a as s}from"./chunk-OSVSBQDY.js";import{a as _}from"./chunk-LZC73BOP.js";import{a as I,b as r}from"./chunk-OU2IPMYE.js";import{f as l}from"./chunk-H7SJWKIY.js";function b(e,t){r.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let o=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(o)-1;s.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=o,this._distanceToLimbInScaledSpaceSquared=n}}});var L=new s;b.prototype.isPointVisible=function(e){let o=this._ellipsoid.transformPositionToScaledSpace(e,L);return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};b.prototype.isScaledSpacePointVisible=function(e){return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var et=new s;b.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let o=this._ellipsoid,n,i;return l(t)&&t<0&&o.minimumRadius>-t?(i=et,i.x=this._cameraPosition.x/(o.radii.x+t),i.y=this._cameraPosition.y/(o.radii.y+t),i.z=this._cameraPosition.z/(o.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(e,i,n)};b.prototype.computeHorizonCullingPoint=function(e,t,o){return Q(this._ellipsoid,e,t,o)};var U=w.clone(w.UNIT_SPHERE);b.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,o,n){let i=v(this._ellipsoid,o,U);return Q(i,e,t,n)};b.prototype.computeHorizonCullingPointFromVertices=function(e,t,o,n,i){return Z(this._ellipsoid,e,t,o,n,i)};b.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,o,n,i,c){let a=v(this._ellipsoid,i,U);return Z(a,e,t,o,n,c)};var ot=[];b.prototype.computeHorizonCullingPointFromRectangle=function(e,t,o){r.typeOf.object("rectangle",e);let n=k.subsample(e,t,0,ot),i=W.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,o)};var it=new s;function v(e,t,o){if(l(t)&&t<0&&e.minimumRadius>-t){let n=s.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,it);e=w.fromCartesian3(n,o)}return e}function Q(e,t,o,n){r.typeOf.object("directionToPoint",t),r.defined("positions",o),l(n)||(n=new s);let i=K(e,t),c=0;for(let a=0,m=o.length;a<m;++a){let d=o[a],u=B(e,d,i);if(u<0)return;c=Math.max(c,u)}return J(i,c,n)}var q=new s;function Z(e,t,o,n,i,c){r.typeOf.object("directionToPoint",t),r.defined("vertices",o),r.typeOf.number("stride",n),l(c)||(c=new s),n=n??3,i=i??s.ZERO;let a=K(e,t),m=0;for(let d=0,u=o.length;d<u;d+=n){q.x=o[d]+i.x,q.y=o[d+1]+i.y,q.z=o[d+2]+i.z;let f=B(e,q,a);if(f<0)return;m=Math.max(m,f)}return J(a,m,c)}function D(e,t,o){let n=t,i=o,c=s.subtract(e,n,L),a=-s.dot(c,n);return!(i<0?a>0:a>i&&a*a/s.magnitudeSquared(c)>i)}var nt=new s,at=new s;function B(e,t,o){let n=e.transformPositionToScaledSpace(t,nt),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,at);i=Math.max(1,i),c=Math.max(1,c);let m=s.dot(a,o),d=s.magnitude(s.cross(a,o,a)),u=1/c,f=Math.sqrt(i-1)*u;return 1/(m*u-d*f)}function J(e,t,o){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(e,t,o)}var R=new s;function K(e,t){return s.equals(t,s.ZERO)?t:(e.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Nt=b;var j={};j.getHeight=function(e,t,o){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(o))throw new I("relativeHeight must be a finite number.");return(e-o)*t+o};var st=new F;j.getPosition=function(e,t,o,n,i){let c=t.cartesianToCartographic(e,st);if(!l(c))return s.clone(e,i);let a=j.getHeight(c.height,o,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var X=j;var Y={NONE:0,BITS12:1};Object.freeze(Y);var g=Y;var C=new s,ct=new s,N=new T,rt=new h,mt=new h,dt=Math.pow(2,12);function p(e,t,o,n,i,c,a,m,d,u){let f=g.NONE,O,S;if(l(t)&&l(o)&&l(n)&&l(i)){let z=t.minimum,G=t.maximum,x=s.subtract(G,z,ct),tt=n-o;Math.max(s.maximumComponent(x),tt)<dt-1?f=g.BITS12:f=g.NONE;let P=h.fromScale(x,rt);P=h.setTranslation(P,z,P);let E=h.fromScale(s.fromElements(1/x.x,1/x.y,1/x.z,C),mt);E=h.multiplyByTranslation(E,s.negate(z,C),E),S=h.clone(i,new h);let H=h.getTranslation(i,C);H=s.subtract(H,e,C),S=h.setTranslation(S,H,S),S=h.multiply(S,P,S),O=h.inverseTransformation(i,new h),O=h.multiply(E,O,O),i=h.multiply(i,P,new h)}this.quantization=f,this.minimumHeight=o,this.maximumHeight=n,this.center=s.clone(e),this.toScaledENU=O,this.fromScaledENU=i,this.matrix=S,this.hasVertexNormals=c??!1,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=m??!1,this.exaggeration=d??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}p.prototype.encode=function(e,t,o,n,i,c,a,m){r.typeOf.object("vertexBuffer",e),r.typeOf.number("bufferIndex",t),r.typeOf.object("position",o),r.typeOf.object("uv",n),r.typeOf.number("height",i);let d=n.x,u=n.y;if(this.quantization===g.BITS12){o=h.multiplyByPoint(this.toScaledENU,o,C),o.x=_.clamp(o.x,0,1),o.y=_.clamp(o.y,0,1),o.z=_.clamp(o.z,0,1);let f=this.maximumHeight-this.minimumHeight,O=_.clamp((i-this.minimumHeight)/f,0,1);T.fromElements(o.x,o.y,N);let S=y.compressTextureCoordinates(N);T.fromElements(o.z,O,N);let z=y.compressTextureCoordinates(N);T.fromElements(d,u,N);let G=y.compressTextureCoordinates(N);if(e[t++]=S,e[t++]=z,e[t++]=G,this.hasWebMercatorT){T.fromElements(a,0,N);let x=y.compressTextureCoordinates(N);e[t++]=x}}else e[t++]=o.x-this.center.x,e[t++]=o.y-this.center.y,e[t++]=o.z-this.center.z,e[t++]=i,e[t++]=d,e[t++]=u,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=y.octPackFloat(c)),this.hasGeodeticSurfaceNormals&&(e[t++]=m.x,e[t++]=m.y,e[t++]=m.z),t};var ht=new s,$=new s;p.prototype.addGeodeticSurfaceNormals=function(e,t,o){if(r.typeOf.object("oldBuffer",e),r.typeOf.object("newBuffer",t),r.typeOf.object("ellipsoid",o),this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let c=this.stride;for(let a=0;a<i;a++){for(let f=0;f<n;f++){let O=a*n+f,S=a*c+f;t[S]=e[O]}let m=this.decodePosition(t,a,ht),d=o.geodeticSurfaceNormal(m,$),u=a*c+this._offsetGeodeticSurfaceNormal;t[u]=d.x,t[u+1]=d.y,t[u+2]=d.z}};p.prototype.removeGeodeticSurfaceNormals=function(e,t){if(r.typeOf.object("oldBuffer",e),r.typeOf.object("newBuffer",t),!this.hasGeodeticSurfaceNormals)return;let o=this.stride,n=e.length/o;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let i=this.stride;for(let c=0;c<n;c++)for(let a=0;a<i;a++){let m=c*o+a,d=c*i+a;t[d]=e[m]}};p.prototype.decodePosition=function(e,t,o){if(r.typeOf.object("buffer",e),r.typeOf.number("index",t),l(o)||(o=new s),t*=this.stride,this.quantization===g.BITS12){let n=y.decompressTextureCoordinates(e[t],N);o.x=n.x,o.y=n.y;let i=y.decompressTextureCoordinates(e[t+1],N);return o.z=i.x,h.multiplyByPoint(this.fromScaledENU,o,o)}return o.x=e[t],o.y=e[t+1],o.z=e[t+2],s.add(o,this.center,o)};p.prototype.getExaggeratedPosition=function(e,t,o){o=this.decodePosition(e,t,o);let n=this.exaggeration,i=this.exaggerationRelativeHeight;if(n!==1&&this.hasGeodeticSurfaceNormals){let a=this.decodeGeodeticSurfaceNormal(e,t,$),m=this.decodeHeight(e,t),d=X.getHeight(m,n,i)-m;o.x+=a.x*d,o.y+=a.y*d,o.z+=a.z*d}return o};p.prototype.decodeTextureCoordinates=function(e,t,o){return r.typeOf.object("buffer",e),r.typeOf.number("index",t),l(o)||(o=new T),t*=this.stride,this.quantization===g.BITS12?y.decompressTextureCoordinates(e[t+2],o):T.fromElements(e[t+4],e[t+5],o)};p.prototype.decodeHeight=function(e,t){return r.typeOf.object("buffer",e),r.typeOf.number("index",t),t*=this.stride,this.quantization===g.BITS12?y.decompressTextureCoordinates(e[t+1],N).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};p.prototype.decodeWebMercatorT=function(e,t){return r.typeOf.object("buffer",e),r.typeOf.number("index",t),t*=this.stride,this.quantization===g.BITS12?y.decompressTextureCoordinates(e[t+3],N).x:e[t+6]};p.prototype.getOctEncodedNormal=function(e,t,o){r.typeOf.object("buffer",e),r.typeOf.number("index",t),t=t*this.stride+this._offsetVertexNormal;let n=e[t]/256,i=Math.floor(n),c=(n-i)*256;return T.fromElements(i,c,o)};p.prototype.decodeNormal=function(e,t,o){r.typeOf.object("buffer",e),r.typeOf.number("index",t),r.typeOf.object("result",o);let n=t*this.stride+this._offsetVertexNormal;return y.octDecodeFloat(e[n],o)};p.prototype.decodeGeodeticSurfaceNormal=function(e,t,o){return r.typeOf.object("buffer",e),r.typeOf.number("index",t),r.typeOf.object("result",o),t=t*this.stride+this._offsetGeodeticSurfaceNormal,o.x=e[t],o.y=e[t+1],o.z=e[t+2],o};p.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===g.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var M={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},V={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};p.prototype.getAttributes=function(e){r.typeOf.object("buffer",e);let t=A.FLOAT,o=A.getSizeInBytes(t),n=this.stride*o,i=0,c=[];function a(m,d){c.push({index:m,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:d,offsetInBytes:i,strideInBytes:n}),i+=d*o}if(this.quantization===g.NONE){a(M.position3DAndHeight,4);let m=2;m+=this.hasWebMercatorT?1:0,m+=this.hasVertexNormals?1:0,a(M.textureCoordAndEncodedNormals,m),this.hasGeodeticSurfaceNormals&&a(M.geodeticSurfaceNormal,3)}else{let m=this.hasWebMercatorT||this.hasVertexNormals,d=this.hasWebMercatorT&&this.hasVertexNormals;a(V.compressed0,m?4:3),d&&a(V.compressed1,1),this.hasGeodeticSurfaceNormals&&a(V.geodeticSurfaceNormal,3)}return c};p.prototype.getAttributeLocations=function(){return this.quantization===g.NONE?M:V};p.clone=function(e,t){if(l(e))return l(t)||(t=new p),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=s.clone(e.center),t.toScaledENU=h.clone(e.toScaledENU),t.fromScaledENU=h.clone(e.fromScaledENU),t.matrix=h.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 At=p;export{Nt as a,X as b,At as c}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-X6N776GR.js b/plugins/feature/map/Cesium/Workers/chunk-X6N776GR.js deleted file mode 100644 index 665a58d64..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-X6N776GR.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as w,b as z,i as S}from"./chunk-3PT5NNSP.js";import{a as y}from"./chunk-WER4LUMF.js";import{a as C,c as T,e as x}from"./chunk-FGKVHLJ4.js";import{a as h}from"./chunk-YRCAQUFT.js";import{a as u,b as a}from"./chunk-ELJAHN3H.js";import{e as b}from"./chunk-3BGP4HCL.js";var c={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};c.getMathType=function(e){switch(e){case c.SCALAR:return Number;case c.VEC2:return T;case c.VEC3:return C;case c.VEC4:return w;case c.MAT2:return S;case c.MAT3:return x;case c.MAT4:return z;default:throw new u("attributeType is not a valid value.")}};c.getNumberOfComponents=function(e){switch(e){case c.SCALAR:return 1;case c.VEC2:return 2;case c.VEC3:return 3;case c.VEC4:case c.MAT2:return 4;case c.MAT3:return 9;case c.MAT4:return 16;default:throw new u("attributeType is not a valid value.")}};c.getAttributeLocationCount=function(e){switch(e){case c.SCALAR:case c.VEC2:case c.VEC3:case c.VEC4:return 1;case c.MAT2:return 2;case c.MAT3:return 3;case c.MAT4:return 4;default:throw new u("attributeType is not a valid value.")}};c.getGlslType=function(e){switch(a.typeOf.string("attributeType",e),e){case c.SCALAR:return"float";case c.VEC2:return"vec2";case c.VEC3:return"vec3";case c.VEC4:return"vec4";case c.MAT2:return"mat2";case c.MAT3:return"mat3";case c.MAT4:return"mat4";default:throw new u("attributeType is not a valid value.")}};var N=Object.freeze(c);var V=1/256,D=256,r={};r.octEncodeInRange=function(e,t,n){a.defined("vector",e),a.defined("result",n);let o=C.magnitudeSquared(e);if(Math.abs(o-1)>h.EPSILON6)throw new u("vector must be normalized.");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,d=n.y;n.x=(1-Math.abs(d))*h.signNotZero(i),n.y=(1-Math.abs(i))*h.signNotZero(d)}return n.x=h.toSNorm(n.x,t),n.y=h.toSNorm(n.y,t),n};r.octEncode=function(e,t){return r.octEncodeInRange(e,255,t)};var A=new T,F=new Uint8Array(1);function E(e){return F[0]=e,F[0]}r.octEncodeToCartesian4=function(e,t){return r.octEncodeInRange(e,65535,A),t.x=E(A.x*V),t.y=E(A.x),t.z=E(A.y*V),t.w=E(A.y),t};r.octDecodeInRange=function(e,t,n,o){if(a.defined("result",o),e<0||e>n||t<0||t>n)throw new u(`x and y must be unsigned normalized integers between 0 and ${n}`);if(o.x=h.fromSNorm(e,n),o.y=h.fromSNorm(t,n),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){let i=o.x;o.x=(1-Math.abs(o.y))*h.signNotZero(i),o.y=(1-Math.abs(i))*h.signNotZero(o.y)}return C.normalize(o,o)};r.octDecode=function(e,t,n){return r.octDecodeInRange(e,t,255,n)};r.octDecodeFromCartesian4=function(e,t){a.typeOf.object("encoded",e),a.typeOf.object("result",t);let n=e.x,o=e.y,i=e.z,d=e.w;if(n<0||n>255||o<0||o>255||i<0||i>255||d<0||d>255)throw new u("x, y, z, and w must be unsigned normalized integers between 0 and 255");let f=n*D+o,s=i*D+d;return r.octDecodeInRange(f,s,65535,t)};r.octPackFloat=function(e){return a.defined("encoded",e),256*e.x+e.y};var l=new T;r.octEncodeFloat=function(e){return r.octEncode(e,l),r.octPackFloat(l)};r.octDecodeFloat=function(e,t){a.defined("value",e);let n=e/256,o=Math.floor(n),i=(n-o)*256;return r.octDecode(o,i,t)};r.octPack=function(e,t,n,o){a.defined("v1",e),a.defined("v2",t),a.defined("v3",n),a.defined("result",o);let i=r.octEncodeFloat(e),d=r.octEncodeFloat(t),f=r.octEncode(n,l);return o.x=65536*f.x+i,o.y=65536*f.y+d,o};r.octUnpack=function(e,t,n,o){a.defined("packed",e),a.defined("v1",t),a.defined("v2",n),a.defined("v3",o);let i=e.x/65536,d=Math.floor(i),f=(i-d)*65536;i=e.y/65536;let s=Math.floor(i),m=(i-s)*65536;r.octDecodeFloat(f,t),r.octDecodeFloat(m,n),r.octDecode(d,s,o)};r.compressTextureCoordinates=function(e){a.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};r.decompressTextureCoordinates=function(e,t){a.defined("compressed",e),a.defined("result",t);let n=e/4096,o=Math.floor(n);return t.x=o/4095,t.y=(e-o*4096)/4095,t};function g(e){return e>>1^-(e&1)}r.zigZagDeltaDecode=function(e,t,n){a.defined("uBuffer",e),a.defined("vBuffer",t),a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),b(n)&&a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let o=e.length,i=0,d=0,f=0;for(let s=0;s<o;++s)i+=g(e[s]),d+=g(t[s]),e[s]=i,t[s]=d,b(n)&&(f+=g(n[s]),n[s]=f)};r.dequantize=function(e,t,n,o){a.defined("typedArray",e),a.defined("componentDatatype",t),a.defined("type",n),a.defined("count",o);let i=N.getNumberOfComponents(n),d;switch(t){case y.BYTE:d=127;break;case y.UNSIGNED_BYTE:d=255;break;case y.SHORT:d=32767;break;case y.UNSIGNED_SHORT:d=65535;break;case y.INT:d=2147483647;break;case y.UNSIGNED_INT:d=4294967295;break;default:throw new u(`Cannot dequantize component datatype: ${t}`)}let f=new Float32Array(o*i);for(let s=0;s<o;s++)for(let m=0;m<i;m++){let p=s*i+m;f[p]=Math.max(e[p]/d,-1)}return f};r.decodeRGB565=function(e,t){a.defined("typedArray",e);let n=e.length*3;b(t)&&a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let o=e.length;b(t)||(t=new Float32Array(o*3));let i=31,d=63,f=1/31,s=1/63;for(let m=0;m<o;m++){let p=e[m],R=p>>11,I=p>>5&d,O=p&i,M=3*m;t[M]=R*f,t[M+1]=I*s,t[M+2]=O*f}return t};var W=r;export{W as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-XAERMS6D.js b/plugins/feature/map/Cesium/Workers/chunk-XAERMS6D.js new file mode 100644 index 000000000..863654798 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-XAERMS6D.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as J}from"./chunk-C5UTI7P4.js";import{a as I}from"./chunk-SIBAZPZR.js";import{b as G,c as k}from"./chunk-THB3EPLO.js";import{a as B}from"./chunk-QQWQKL3T.js";import{j as X}from"./chunk-YZ5ZCI55.js";import{b as j}from"./chunk-HLXNFZAZ.js";import{a as S,b as z,c as F}from"./chunk-KP72RGCH.js";import{a as t,b as d}from"./chunk-OSVSBQDY.js";import{a as g}from"./chunk-LZC73BOP.js";import{a as b,b as W}from"./chunk-OU2IPMYE.js";import{f as p}from"./chunk-H7SJWKIY.js";function w(n,e){this.center=t.clone(n??t.ZERO),this.halfAxes=d.clone(e??d.ZERO)}w.packedLength=t.packedLength+d.packedLength;w.pack=function(n,e,c){return W.typeOf.object("value",n),W.defined("array",e),c=c??0,t.pack(n.center,e,c),d.pack(n.halfAxes,e,c+t.packedLength),e};w.unpack=function(n,e,c){return W.defined("array",n),e=e??0,p(c)||(c=new w),t.unpack(n,e,c.center),d.unpack(n,e+t.packedLength,c.halfAxes),c};var pt=new t,Ct=new t,ut=new t,Pt=new t,xt=new t,yt=new t,At=new d,Nt={unitary:new d,diagonal:new d};w.fromPoints=function(n,e){if(p(e)||(e=new w),!p(n)||n.length===0)return e.halfAxes=d.ZERO,e.center=t.ZERO,e;let c,h=n.length,r=t.clone(n[0],pt);for(c=1;c<h;c++)t.add(r,n[c],r);let o=1/h;t.multiplyByScalar(r,o,r);let i=0,C=0,m=0,l=0,u=0,a=0,s;for(c=0;c<h;c++)s=t.subtract(n[c],r,Ct),i+=s.x*s.x,C+=s.x*s.y,m+=s.x*s.z,l+=s.y*s.y,u+=s.y*s.z,a+=s.z*s.z;i*=o,C*=o,m*=o,l*=o,u*=o,a*=o;let f=At;f[0]=i,f[1]=C,f[2]=m,f[3]=C,f[4]=l,f[5]=u,f[6]=m,f[7]=u,f[8]=a;let A=d.computeEigenDecomposition(f,Nt),M=d.clone(A.unitary,e.halfAxes),x=d.getColumn(M,0,Pt),y=d.getColumn(M,1,xt),N=d.getColumn(M,2,yt),P=-Number.MAX_VALUE,O=-Number.MAX_VALUE,L=-Number.MAX_VALUE,U=Number.MAX_VALUE,R=Number.MAX_VALUE,q=Number.MAX_VALUE;for(c=0;c<h;c++)s=n[c],P=Math.max(t.dot(x,s),P),O=Math.max(t.dot(y,s),O),L=Math.max(t.dot(N,s),L),U=Math.min(t.dot(x,s),U),R=Math.min(t.dot(y,s),R),q=Math.min(t.dot(N,s),q);x=t.multiplyByScalar(x,.5*(U+P),x),y=t.multiplyByScalar(y,.5*(R+O),y),N=t.multiplyByScalar(N,.5*(q+L),N);let T=t.add(x,y,e.center);t.add(T,N,T);let E=ut;return E.x=P-U,E.y=O-R,E.z=L-q,t.multiplyByScalar(E,.5,E),d.multiplyByScale(e.halfAxes,E,e.halfAxes),e};var et=new t,Mt=new t;function K(n,e,c,h,r,o,i,C,m,l,u){if(!p(r)||!p(o)||!p(i)||!p(C)||!p(m)||!p(l))throw new b("all extents (minimum/maximum X/Y/Z) are required.");p(u)||(u=new w);let a=u.halfAxes;d.setColumn(a,0,e,a),d.setColumn(a,1,c,a),d.setColumn(a,2,h,a);let s=et;s.x=(r+o)/2,s.y=(i+C)/2,s.z=(m+l)/2;let f=Mt;f.x=(o-r)/2,f.y=(C-i)/2,f.z=(l-m)/2;let A=u.center;return s=d.multiplyByVector(a,s,s),t.add(n,s,A),d.multiplyByScale(a,f,a),u}var Q=new S,Ot=new t,bt=new S,Tt=new S,St=new S,gt=new S,Et=new S,Rt=new t,$=new t,Wt=new t,H=new t,zt=new t,It=new z,Lt=new z,Ut=new z,qt=new z,jt=new z,Bt=new t,vt=new t,_t=new t,Vt=new t,Dt=new z,Xt=new t,kt=new t,Zt=new t,Yt=new I(t.UNIT_X,0);w.fromRectangle=function(n,e,c,h,r){if(!p(n))throw new b("rectangle is required");if(n.width<0||n.width>g.TWO_PI)throw new b("Rectangle width must be between 0 and 2 * pi");if(n.height<0||n.height>g.PI)throw new b("Rectangle height must be between 0 and pi");if(p(h)&&!g.equalsEpsilon(h.radii.x,h.radii.y,g.EPSILON15))throw new b("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");e=e??0,c=c??0,h=h??F.default;let o,i,C,m,l,u,a;if(n.width<=g.PI){let R=X.center(n,Q),q=h.cartographicToCartesian(R,Ot),T=new J(q,h);a=T.plane;let E=R.longitude,rt=n.south<0&&n.north>0?0:R.latitude,ot=S.fromRadians(E,n.north,c,bt),v=S.fromRadians(n.west,n.north,c,Tt),st=S.fromRadians(n.west,rt,c,St),_=S.fromRadians(n.west,n.south,c,gt),it=S.fromRadians(E,n.south,c,Et),ht=h.cartographicToCartesian(ot,Rt),V=h.cartographicToCartesian(v,$),ft=h.cartographicToCartesian(st,Wt),D=h.cartographicToCartesian(_,H),dt=h.cartographicToCartesian(it,zt),wt=T.projectPointToNearestOnPlane(ht,It),Z=T.projectPointToNearestOnPlane(V,Lt),mt=T.projectPointToNearestOnPlane(ft,Ut),Y=T.projectPointToNearestOnPlane(D,qt),lt=T.projectPointToNearestOnPlane(dt,jt);return o=Math.min(Z.x,mt.x,Y.x),i=-o,m=Math.max(Z.y,wt.y),C=Math.min(Y.y,lt.y),v.height=_.height=e,V=h.cartographicToCartesian(v,$),D=h.cartographicToCartesian(_,H),l=Math.min(I.getPointDistance(a,V),I.getPointDistance(a,D)),u=c,K(T.origin,T.xAxis,T.yAxis,T.zAxis,o,i,C,m,l,u,r)}let s=n.south>0,f=n.north<0,A=s?n.south:f?n.north:0,M=X.center(n,Q).longitude,x=t.fromRadians(M,A,c,h,Bt);x.z=0;let N=Math.abs(x.x)<g.EPSILON10&&Math.abs(x.y)<g.EPSILON10?t.UNIT_X:t.normalize(x,vt),P=t.UNIT_Z,O=t.cross(N,P,_t);a=I.fromPointNormal(x,N,Yt);let L=t.fromRadians(M+g.PI_OVER_TWO,A,c,h,Vt);i=t.dot(I.projectPointOntoPlane(a,L,Dt),O),o=-i,m=t.fromRadians(0,n.north,f?e:c,h,Xt).z,C=t.fromRadians(0,n.south,s?e:c,h,kt).z;let U=t.fromRadians(n.east,A,c,h,Zt);return l=I.getPointDistance(a,U),u=0,K(x,O,P,N,o,i,C,m,l,u,r)};w.fromTransformation=function(n,e){return W.typeOf.object("transformation",n),p(e)||(e=new w),e.center=j.getTranslation(n,e.center),e.halfAxes=j.getMatrix3(n,e.halfAxes),e.halfAxes=d.multiplyByScalar(e.halfAxes,.5,e.halfAxes),e};w.clone=function(n,e){if(p(n))return p(e)?(t.clone(n.center,e.center),d.clone(n.halfAxes,e.halfAxes),e):new w(n.center,n.halfAxes)};w.intersectPlane=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("plane is required.");let c=n.center,h=e.normal,r=n.halfAxes,o=h.x,i=h.y,C=h.z,m=Math.abs(o*r[d.COLUMN0ROW0]+i*r[d.COLUMN0ROW1]+C*r[d.COLUMN0ROW2])+Math.abs(o*r[d.COLUMN1ROW0]+i*r[d.COLUMN1ROW1]+C*r[d.COLUMN1ROW2])+Math.abs(o*r[d.COLUMN2ROW0]+i*r[d.COLUMN2ROW1]+C*r[d.COLUMN2ROW2]),l=t.dot(h,c)+e.distance;return l<=-m?B.OUTSIDE:l>=m?B.INSIDE:B.INTERSECTING};var nt=new t,at=new t,ct=new t,Ft=new t,tt=new t,Gt=new t;w.distanceSquaredTo=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("cartesian is required.");let c=t.subtract(e,n.center,et),h=n.halfAxes,r=d.getColumn(h,0,nt),o=d.getColumn(h,1,at),i=d.getColumn(h,2,ct),C=t.magnitude(r),m=t.magnitude(o),l=t.magnitude(i),u=!0,a=!0,s=!0;C>0?t.divideByScalar(r,C,r):u=!1,m>0?t.divideByScalar(o,m,o):a=!1,l>0?t.divideByScalar(i,l,i):s=!1;let f=!u+!a+!s,A,M,x;if(f===1){let O=r;A=o,M=i,a?s||(O=i,M=r):(O=o,A=r),x=t.cross(A,M,tt),O===r?r=x:O===o?o=x:O===i&&(i=x)}else if(f===2){A=r,a?A=o:s&&(A=i);let O=t.UNIT_Y;O.equalsEpsilon(A,g.EPSILON3)&&(O=t.UNIT_X),M=t.cross(A,O,Ft),t.normalize(M,M),x=t.cross(A,M,tt),t.normalize(x,x),A===r?(o=M,i=x):A===o?(i=M,r=x):A===i&&(r=M,o=x)}else f===3&&(r=t.UNIT_X,o=t.UNIT_Y,i=t.UNIT_Z);let y=Gt;y.x=t.dot(c,r),y.y=t.dot(c,o),y.z=t.dot(c,i);let N=0,P;return y.x<-C?(P=y.x+C,N+=P*P):y.x>C&&(P=y.x-C,N+=P*P),y.y<-m?(P=y.y+m,N+=P*P):y.y>m&&(P=y.y-m,N+=P*P),y.z<-l?(P=y.z+l,N+=P*P):y.z>l&&(P=y.z-l,N+=P*P),N};var Jt=new t,Kt=new t;w.computePlaneDistances=function(n,e,c,h){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("position is required.");if(!p(c))throw new b("direction is required.");p(h)||(h=new G);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=n.center,C=n.halfAxes,m=d.getColumn(C,0,nt),l=d.getColumn(C,1,at),u=d.getColumn(C,2,ct),a=t.add(m,l,Jt);t.add(a,u,a),t.add(a,i,a);let s=t.subtract(a,e,Kt),f=t.dot(c,s);return r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.add(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.add(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.add(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),t.subtract(i,m,a),t.subtract(a,l,a),t.subtract(a,u,a),t.subtract(a,e,s),f=t.dot(c,s),r=Math.min(f,r),o=Math.max(f,o),h.start=r,h.stop=o,h};var Qt=new t,$t=new t,Ht=new t;w.computeCorners=function(n,e){W.typeOf.object("box",n),p(e)||(e=[new t,new t,new t,new t,new t,new t,new t,new t]);let c=n.center,h=n.halfAxes,r=d.getColumn(h,0,Qt),o=d.getColumn(h,1,$t),i=d.getColumn(h,2,Ht);return t.clone(c,e[0]),t.subtract(e[0],r,e[0]),t.subtract(e[0],o,e[0]),t.subtract(e[0],i,e[0]),t.clone(c,e[1]),t.subtract(e[1],r,e[1]),t.subtract(e[1],o,e[1]),t.add(e[1],i,e[1]),t.clone(c,e[2]),t.subtract(e[2],r,e[2]),t.add(e[2],o,e[2]),t.subtract(e[2],i,e[2]),t.clone(c,e[3]),t.subtract(e[3],r,e[3]),t.add(e[3],o,e[3]),t.add(e[3],i,e[3]),t.clone(c,e[4]),t.add(e[4],r,e[4]),t.subtract(e[4],o,e[4]),t.subtract(e[4],i,e[4]),t.clone(c,e[5]),t.add(e[5],r,e[5]),t.subtract(e[5],o,e[5]),t.add(e[5],i,e[5]),t.clone(c,e[6]),t.add(e[6],r,e[6]),t.add(e[6],o,e[6]),t.subtract(e[6],i,e[6]),t.clone(c,e[7]),t.add(e[7],r,e[7]),t.add(e[7],o,e[7]),t.add(e[7],i,e[7]),e};var te=new d;w.computeTransformation=function(n,e){W.typeOf.object("box",n),p(e)||(e=new j);let c=n.center,h=d.multiplyByUniformScale(n.halfAxes,2,te);return j.fromRotationTranslation(h,c,e)};var ee=new k;w.isOccluded=function(n,e){if(!p(n))throw new b("box is required.");if(!p(e))throw new b("occluder is required.");let c=k.fromOrientedBoundingBox(n,ee);return!e.isBoundingSphereVisible(c)};w.prototype.intersectPlane=function(n){return w.intersectPlane(this,n)};w.prototype.distanceSquaredTo=function(n){return w.distanceSquaredTo(this,n)};w.prototype.computePlaneDistances=function(n,e,c){return w.computePlaneDistances(this,n,e,c)};w.prototype.computeCorners=function(n){return w.computeCorners(this,n)};w.prototype.computeTransformation=function(n){return w.computeTransformation(this,n)};w.prototype.isOccluded=function(n){return w.isOccluded(this,n)};w.equals=function(n,e){return n===e||p(n)&&p(e)&&t.equals(n.center,e.center)&&d.equals(n.halfAxes,e.halfAxes)};w.prototype.clone=function(n){return w.clone(this,n)};w.prototype.equals=function(n){return w.equals(this,n)};var Pe=w;export{Pe as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-XSEHEM5B.js b/plugins/feature/map/Cesium/Workers/chunk-XSEHEM5B.js new file mode 100644 index 000000000..205a5f035 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-XSEHEM5B.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as z}from"./chunk-THB3EPLO.js";import{j as I,k as b}from"./chunk-YZ5ZCI55.js";import{a as O,c as L}from"./chunk-KP72RGCH.js";import{a as W}from"./chunk-OSVSBQDY.js";import{a as m}from"./chunk-LZC73BOP.js";import{a as v}from"./chunk-OU2IPMYE.js";import{f as k}from"./chunk-H7SJWKIY.js";var Z=Math.cos,B=Math.sin,p=Math.sqrt,N={};N.computePosition=function(t,M,g,u,G,h,a){let e=M.radiiSquared,i=t.nwCorner,r=t.boundingRectangle,n=i.latitude-t.granYCos*u+G*t.granXSin,d=Z(n),X=B(n),Y=e.z*X,s=i.longitude+u*t.granYSin+G*t.granXCos,S=d*Z(s),f=d*B(s),w=e.x*S,R=e.y*f,_=p(w*S+R*f+Y*X);if(h.x=w/_,h.y=R/_,h.z=Y/_,g){let o=t.stNwCorner;k(o)?(n=o.latitude-t.stGranYCos*u+G*t.stGranXSin,s=o.longitude+u*t.stGranYSin+G*t.stGranXCos,a.x=(s-t.stWest)*t.lonScalar,a.y=(n-t.stSouth)*t.latScalar):(a.x=(s-r.west)*t.lonScalar,a.y=(n-r.south)*t.latScalar)}};var A=new b,l=new W,F=new O,j=new W,y=new z;function D(t,M,g,u,G,h,a){let e=Math.cos(M),i=u*e,r=g*e,n=Math.sin(M),d=u*n,X=g*n;y._ellipsoid=L.default,l=y.project(t,l),l=W.subtract(l,j,l);let Y=b.fromRotation(M,A);l=b.multiplyByVector(Y,l,l),l=W.add(l,j,l),t=y.unproject(l,t),h-=1,a-=1;let s=t.latitude,S=s+h*X,f=s-i*a,w=s-i*a+h*X,R=Math.max(s,S,f,w),_=Math.min(s,S,f,w),o=t.longitude,E=o+h*r,T=o+a*d,V=o+a*d+h*r,q=Math.max(o,E,T,V),x=Math.min(o,E,T,V);return{north:R,south:_,east:q,west:x,granYCos:i,granYSin:d,granXCos:r,granXSin:X,nwCorner:t}}N.computeOptions=function(t,M,g,u,G,h,a){let e=t.east,i=t.west,r=t.north,n=t.south,d=!1,X=!1;r===m.PI_OVER_TWO&&(d=!0),n===-m.PI_OVER_TWO&&(X=!0);let Y,s=r-n;i>e?Y=m.TWO_PI-i+e:Y=e-i;let S=Math.ceil(Y/M)+1,f=Math.ceil(s/M)+1,w=Y/(S-1),R=s/(f-1),_=I.northwest(t,h),o=I.center(t,F);(g!==0||u!==0)&&(o.longitude<_.longitude&&(o.longitude+=m.TWO_PI),y._ellipsoid=L.default,j=y.project(o,j));let E=R,T=w,V=0,q=0,x=I.clone(t,G),c={granYCos:E,granYSin:V,granXCos:T,granXSin:q,nwCorner:_,boundingRectangle:x,width:S,height:f,northCap:d,southCap:X};if(g!==0){let C=D(_,g,w,R,o,S,f);if(r=C.north,n=C.south,e=C.east,i=C.west,r<-m.PI_OVER_TWO||r>m.PI_OVER_TWO||n<-m.PI_OVER_TWO||n>m.PI_OVER_TWO)throw new v("Rotated rectangle is invalid. It crosses over either the north or south pole.");c.granYCos=C.granYCos,c.granYSin=C.granYSin,c.granXCos=C.granXCos,c.granXSin=C.granXSin,x.north=r,x.south=n,x.east=e,x.west=i}if(u!==0){g=g-u;let C=I.northwest(x,a),P=D(C,g,w,R,o,S,f);c.stGranYCos=P.granYCos,c.stGranXCos=P.granXCos,c.stGranYSin=P.granYSin,c.stGranXSin=P.granXSin,c.stNwCorner=C,c.stWest=P.west,c.stSouth=P.south}return c};var st=N;export{st as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-XUWPEWB7.js b/plugins/feature/map/Cesium/Workers/chunk-XUWPEWB7.js new file mode 100644 index 000000000..7a9bf7663 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-XUWPEWB7.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as tt}from"./chunk-QCE33JV5.js";import{a as jt}from"./chunk-EL5WNS34.js";import{b as Lt}from"./chunk-ZNBU4MZZ.js";import{a as Et}from"./chunk-SIBAZPZR.js";import{a as j}from"./chunk-AZINMULF.js";import{a as dt,b as D,c as B,d as U}from"./chunk-7RNSURKI.js";import{a as _t,c as ot}from"./chunk-THB3EPLO.js";import{a as Ut}from"./chunk-QQWQKL3T.js";import{a as pt,b as H}from"./chunk-HLXNFZAZ.js";import{a as F}from"./chunk-WCOEOHX5.js";import{a as Mt,b as V}from"./chunk-KP72RGCH.js";import{a as r,b as gt,c as Ot}from"./chunk-OSVSBQDY.js";import{a as N}from"./chunk-LZC73BOP.js";import{a as I,b as ft}from"./chunk-OU2IPMYE.js";import{f}from"./chunk-H7SJWKIY.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S,x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTypedArray(e,n),i=t[0],c=0;for(let o=1;o<e;++o,c+=6)It(s,c,i,t[o],t[o+1]);return s}return new Uint16Array}k.toWireframe=function(t){if(!f(t))throw new I("geometry is required.");let e=t.indices;if(f(e)){switch(t.primitiveType){case D.TRIANGLES:t.indices=de(e);break;case D.TRIANGLE_STRIP:t.indices=me(e);break;case D.TRIANGLE_FAN:t.indices=he(e);break;default:throw new I("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}t.primitiveType=D.LINES}return t};k.createLineSegmentsForVectors=function(t,e,n){if(e=e??"normal",!f(t))throw new I("geometry is required.");if(!f(t.attributes.position))throw new I("geometry.attributes.position is required.");if(!f(t.attributes[e]))throw new I(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${e}.`);n=n??1e4;let s=t.attributes.position.values,i=t.attributes[e].values,c=s.length,o=new Float64Array(2*c),a=0;for(let d=0;d<c;d+=3)o[a++]=s[d],o[a++]=s[d+1],o[a++]=s[d+2],o[a++]=s[d]+i[d]*n,o[a++]=s[d+1]+i[d+1]*n,o[a++]=s[d+2]+i[d+2]*n;let p,u=t.boundingSphere;return f(u)&&(p=new ot(u.center,u.radius+n)),new B({attributes:{position:new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:D.LINES,boundingSphere:p})};k.createAttributeLocations=function(t){if(!f(t))throw new I("geometry is required.");let e=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=t.attributes,s={},i=0,c,o=e.length;for(c=0;c<o;++c){let a=e[c];f(n[a])&&(s[a]=i++)}for(let a in n)n.hasOwnProperty(a)&&!f(s[a])&&(s[a]=i++);return s};k.reorderForPreVertexCache=function(t){if(!f(t))throw new I("geometry is required.");let e=B.computeNumberOfVertices(t),n=t.indices;if(f(n)){let s=new Int32Array(e);for(let l=0;l<e;l++)s[l]=-1;let i=n,c=i.length,o=j.createTypedArray(e,c),a=0,p=0,u=0,d;for(;a<c;)d=s[i[a]],d!==-1?o[p]=d:(d=i[a],s[d]=u,o[p]=u,++u),++a,++p;t.indices=o;let m=t.attributes;for(let l in m)if(m.hasOwnProperty(l)&&f(m[l])&&f(m[l].values)){let h=m[l],y=h.values,v=0,b=h.componentsPerAttribute,S=F.createTypedArray(h.componentDatatype,u*b);for(;v<e;){let x=s[v];if(x!==-1)for(let w=0;w<b;w++)S[b*x+w]=y[b*v+w];++v}h.values=S}}return t};k.reorderForPostVertexCache=function(t,e){if(!f(t))throw new I("geometry is required.");let n=t.indices;if(t.primitiveType===D.TRIANGLES&&f(n)){let s=n.length,i=0;for(let c=0;c<s;c++)n[c]>i&&(i=n[c]);t.indices=Wt.tipsify({indices:n,maximumIndex:i,cacheSize:e})}return t};function $t(t){let e={};for(let n in t)if(t.hasOwnProperty(n)&&f(t[n])&&f(t[n].values)){let s=t[n];e[n]=new U({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:[]})}return e}function be(t,e,n){for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];for(let c=0;c<i.componentsPerAttribute;++c)t[s].values.push(i.values[n*i.componentsPerAttribute+c])}}k.fitToUnsignedShortIndices=function(t){if(!f(t))throw new I("geometry is required.");if(f(t.indices)&&t.primitiveType!==D.TRIANGLES&&t.primitiveType!==D.LINES&&t.primitiveType!==D.POINTS)throw new I("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let e=[],n=B.computeNumberOfVertices(t);if(f(t.indices)&&n>=N.SIXTY_FOUR_KILOBYTES){let s=[],i=[],c=0,o=$t(t.attributes),a=t.indices,p=a.length,u;t.primitiveType===D.TRIANGLES?u=3:t.primitiveType===D.LINES?u=2:t.primitiveType===D.POINTS&&(u=1);for(let d=0;d<p;d+=u){for(let m=0;m<u;++m){let l=a[d+m],h=s[l];f(h)||(h=c++,s[l]=h,be(o,t.attributes,l)),i.push(h)}c+u>=N.SIXTY_FOUR_KILOBYTES&&(e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV})),s=[],i=[],c=0,o=$t(t.attributes))}i.length!==0&&e.push(new B({attributes:o,indices:i,primitiveType:t.primitiveType,boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV}))}else e.push(t);return e};var Jt=new r,we=new Mt;k.projectTo2D=function(t,e,n,s,i){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeName3D is required.");if(!f(s))throw new I("attributeName2D is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let c=t.attributes[e];i=f(i)?i:new _t;let o=i.ellipsoid,a=c.values,p=new Float64Array(a.length),u=0;for(let d=0;d<a.length;d+=3){let m=r.fromArray(a,d,Jt),l=o.cartesianToCartographic(m,we);if(!f(l))throw new I(`Could not project point (${m.x}, ${m.y}, ${m.z}) to 2D.`);let h=i.project(l,Jt);p[u++]=h.x,p[u++]=h.y,p[u++]=h.z}return t.attributes[n]=c,t.attributes[s]=new U({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:p}),delete t.attributes[e],t};var zt={high:0,low:0};k.encodeAttribute=function(t,e,n,s){if(!f(t))throw new I("geometry is required.");if(!f(e))throw new I("attributeName is required.");if(!f(n))throw new I("attributeHighName is required.");if(!f(s))throw new I("attributeLowName is required.");if(!f(t.attributes[e]))throw new I(`geometry must have attribute matching the attributeName argument: ${e}.`);if(t.attributes[e].componentDatatype!==F.DOUBLE)throw new I("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let i=t.attributes[e],c=i.values,o=c.length,a=new Float32Array(o),p=new Float32Array(o);for(let d=0;d<o;++d)jt.encode(c[d],zt),a[d]=zt.high,p[d]=zt.low;let u=i.componentsPerAttribute;return t.attributes[n]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:a}),t.attributes[s]=new U({componentDatatype:F.FLOAT,componentsPerAttribute:u,values:p}),delete t.attributes[e],t};var $=new r;function Dt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),H.multiplyByPoint(t,$,$),r.pack($,n,i)}}function qt(t,e){if(f(e)){let n=e.values,s=n.length;for(let i=0;i<s;i+=3)r.unpack(n,i,$),gt.multiplyByVector(t,$,$),$=r.normalize($,$),r.pack($,n,i)}}var wt=new H,vt=new gt;k.transformToWorldCoordinates=function(t){if(!f(t))throw new I("instance is required.");let e=t.modelMatrix;if(H.equals(e,H.IDENTITY))return t;let n=t.geometry.attributes;Dt(e,n.position),Dt(e,n.prevPosition),Dt(e,n.nextPosition),(f(n.normal)||f(n.tangent)||f(n.bitangent))&&(H.inverse(e,wt),H.transpose(wt,wt),H.getMatrix3(wt,vt),qt(vt,n.normal),qt(vt,n.tangent),qt(vt,n.bitangent));let s=t.geometry.boundingSphere;return f(s)&&(t.geometry.boundingSphere=ot.transform(s,e,s)),t.modelMatrix=H.clone(H.IDENTITY),t};function ve(t,e){let n=t.length,s={},i=t[0][e].attributes,c;for(c in i)if(i.hasOwnProperty(c)&&f(i[c])&&f(i[c].values)){let o=i[c],a=o.values.length,p=!0;for(let u=1;u<n;++u){let d=t[u][e].attributes[c];if(!f(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){p=!1;break}a+=d.values.length}p&&(s[c]=new U({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:F.createTypedArray(o.componentDatatype,a)}))}return s}var ye=new r;function Rt(t,e){let n=t.length,s,i,c,o,a=t[0].modelMatrix,p=f(t[0][e].indices),u=t[0][e].primitiveType;for(i=1;i<n;++i){if(!H.equals(t[i].modelMatrix,a))throw new I("All instances must have the same modelMatrix.");if(f(t[i][e].indices)!==p)throw new I("All instance geometries must have an indices or not have one.");if(t[i][e].primitiveType!==u)throw new I("All instance geometries must have the same primitiveType.")}let d=ve(t,e),m,l,h;for(s in d)if(d.hasOwnProperty(s))for(m=d[s].values,o=0,i=0;i<n;++i)for(l=t[i][e].attributes[s].values,h=l.length,c=0;c<h;++c)m[o++]=l[c];let y;if(p){let x=0;for(i=0;i<n;++i)x+=t[i][e].indices.length;let w=B.computeNumberOfVertices(new B({attributes:d,primitiveType:D.POINTS})),A=j.createTypedArray(w,x),E=0,P=0;for(i=0;i<n;++i){let O=t[i][e].indices,L=O.length;for(o=0;o<L;++o)A[E++]=P+O[o];P+=B.computeNumberOfVertices(t[i][e])}y=A}let v=new r,b=0,S;for(i=0;i<n;++i){if(S=t[i][e].boundingSphere,!f(S)){v=void 0;break}r.add(S.center,v,v)}if(f(v))for(r.divideByScalar(v,n,v),i=0;i<n;++i){S=t[i][e].boundingSphere;let x=r.magnitude(r.subtract(S.center,v,ye))+S.radius;x>b&&(b=x)}return new B({attributes:d,indices:y,primitiveType:u,boundingSphere:f(v)?new ot(v,b):void 0})}k.combineInstances=function(t){if(!f(t)||t.length<1)throw new I("instances is required and must have length greater than zero.");let e=[],n=[],s=t.length;for(let c=0;c<s;++c){let o=t[c];f(o.geometry)?e.push(o):f(o.westHemisphereGeometry)&&f(o.eastHemisphereGeometry)&&n.push(o)}let i=[];return e.length>0&&i.push(Rt(e,"geometry")),n.length>0&&(i.push(Rt(n,"westHemisphereGeometry")),i.push(Rt(n,"eastHemisphereGeometry"))),i};var Z=new r,mt=new r,rt=new r,ct=new r;k.computeNormal=function(t){if(!f(t))throw new I("geometry is required.");if(!f(t.attributes.position)||!f(t.attributes.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(t.indices))throw new I("geometry.indices is required.");if(t.indices.length<2||t.indices.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let e=t.indices,n=t.attributes,s=n.position.values,i=n.position.values.length/3,c=e.length,o=new Array(i),a=new Array(c/3),p=new Array(c),u;for(u=0;u<i;u++)o[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<c;u+=3){let y=e[u],v=e[u+1],b=e[u+2],S=y*3,x=v*3,w=b*3;mt.x=s[S],mt.y=s[S+1],mt.z=s[S+2],rt.x=s[x],rt.y=s[x+1],rt.z=s[x+2],ct.x=s[w],ct.y=s[w+1],ct.z=s[w+2],o[y].count++,o[v].count++,o[b].count++,r.subtract(rt,mt,rt),r.subtract(ct,mt,ct),a[d]=r.cross(rt,ct,new r),d++}let m=0;for(u=0;u<i;u++)o[u].indexOffset+=m,m+=o[u].count;d=0;let l;for(u=0;u<c;u+=3){l=o[e[u]];let y=l.indexOffset+l.currentCount;p[y]=d,l.currentCount++,l=o[e[u+1]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,l=o[e[u+2]],y=l.indexOffset+l.currentCount,p[y]=d,l.currentCount++,d++}let h=new Float32Array(i*3);for(u=0;u<i;u++){let y=u*3;if(l=o[u],r.clone(r.ZERO,Z),l.count>0){for(d=0;d<l.count;d++)r.add(Z,a[p[l.indexOffset+d]],Z);r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&r.clone(a[p[l.indexOffset]],Z)}r.equalsEpsilon(r.ZERO,Z,N.EPSILON10)&&(Z.z=1),r.normalize(Z,Z),h[y]=Z.x,h[y+1]=Z.y,h[y+2]=Z.z}return t.attributes.normal=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t};var xe=new r,Kt=new r,Te=new r;k.computeTangentAndBitangent=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes,n=t.indices;if(!f(e.position)||!f(e.position.values))throw new I("geometry.attributes.position.values is required.");if(!f(e.normal)||!f(e.normal.values))throw new I("geometry.attributes.normal.values is required.");if(!f(e.st)||!f(e.st.values))throw new I("geometry.attributes.st.values is required.");if(!f(n))throw new I("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new I("geometry.indices length must be greater than 0 and be a multiple of 3.");if(t.primitiveType!==D.TRIANGLES)throw new I("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let s=t.attributes.position.values,i=t.attributes.normal.values,c=t.attributes.st.values,o=t.attributes.position.values.length/3,a=n.length,p=new Array(o*3),u;for(u=0;u<p.length;u++)p[u]=0;let d,m,l;for(u=0;u<a;u+=3){let v=n[u],b=n[u+1],S=n[u+2];d=v*3,m=b*3,l=S*3;let x=v*2,w=b*2,A=S*2,E=s[d],P=s[d+1],O=s[d+2],L=c[x],g=c[x+1],T=c[w+1]-g,C=c[A+1]-g,z=1/((c[w]-L)*C-(c[A]-L)*T),q=(C*(s[m]-E)-T*(s[l]-E))*z,R=(C*(s[m+1]-P)-T*(s[l+1]-P))*z,G=(C*(s[m+2]-O)-T*(s[l+2]-O))*z;p[d]+=q,p[d+1]+=R,p[d+2]+=G,p[m]+=q,p[m+1]+=R,p[m+2]+=G,p[l]+=q,p[l+1]+=R,p[l+2]+=G}let h=new Float32Array(o*3),y=new Float32Array(o*3);for(u=0;u<o;u++){d=u*3,m=d+1,l=d+2;let v=r.fromArray(i,d,xe),b=r.fromArray(p,d,Te),S=r.dot(v,b);r.multiplyByScalar(v,S,Kt),r.normalize(r.subtract(b,Kt,b),b),h[d]=b.x,h[m]=b.y,h[l]=b.z,r.normalize(r.cross(v,b,b),b),y[d]=b.x,y[m]=b.y,y[l]=b.z}return t.attributes.tangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:h}),t.attributes.bitangent=new U({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:y}),t};var ht=new V,W=new r,Qt=new r,te=new r,yt=new V;k.compressVertices=function(t){if(!f(t))throw new I("geometry is required.");let e=t.attributes.extrudeDirection,n,s;if(f(e)){let P=e.values;s=P.length/3;let O=new Float32Array(s*2),L=0;for(n=0;n<s;++n){if(r.fromArray(P,n*3,W),r.equals(W,r.ZERO)){L+=2;continue}yt=tt.octEncodeInRange(W,65535,yt),O[L++]=yt.x,O[L++]=yt.y}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:O}),delete t.attributes.extrudeDirection,t}let i=t.attributes.normal,c=t.attributes.st,o=f(i),a=f(c);if(!o&&!a)return t;let p=t.attributes.tangent,u=t.attributes.bitangent,d=f(p),m=f(u),l,h,y,v;o&&(l=i.values),a&&(h=c.values),d&&(y=p.values),m&&(v=u.values),s=(o?l.length:h.length)/(o?3:2);let x=s,w=a&&o?2:1;w+=d||m?1:0,x*=w;let A=new Float32Array(x),E=0;for(n=0;n<s;++n){a&&(V.fromArray(h,n*2,ht),A[E++]=tt.compressTextureCoordinates(ht));let P=n*3;o&&f(y)&&f(v)?(r.fromArray(l,P,W),r.fromArray(y,P,Qt),r.fromArray(v,P,te),tt.octPack(W,Qt,te,ht),A[E++]=ht.x,A[E++]=ht.y):(o&&(r.fromArray(l,P,W),A[E++]=tt.octEncodeFloat(W)),d&&(r.fromArray(y,P,W),A[E++]=tt.octEncodeFloat(W)),m&&(r.fromArray(v,P,W),A[E++]=tt.octEncodeFloat(W)))}return t.attributes.compressedAttributes=new U({componentDatatype:F.FLOAT,componentsPerAttribute:w,values:A}),o&&delete t.attributes.normal,a&&delete t.attributes.st,m&&delete t.attributes.bitangent,d&&delete t.attributes.tangent,t};function Ae(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");if(e%3!==0)throw new I("The number of vertices must be a multiple of three.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function Ie(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least three.");let n=j.createTypedArray(e,(e-2)*3);n[0]=1,n[1]=0,n[2]=2;let s=3;for(let i=3;i<e;++i)n[s++]=i-1,n[s++]=0,n[s++]=i;return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Se(t){let e=B.computeNumberOfVertices(t);if(e<3)throw new I("The number of vertices must be at least 3.");let n=j.createTypedArray(e,(e-2)*3);n[0]=0,n[1]=1,n[2]=2,e>3&&(n[3]=0,n[4]=2,n[5]=3);let s=6;for(let i=3;i<e-1;i+=2)n[s++]=i,n[s++]=i-1,n[s++]=i+1,i+2<e&&(n[s++]=i,n[s++]=i+1,n[s++]=i+2);return t.indices=n,t.primitiveType=D.TRIANGLES,t}function Pe(t){if(f(t.indices))return t;let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");if(e%2!==0)throw new I("The number of vertices must be a multiple of 2.");let n=j.createTypedArray(e,e);for(let s=0;s<e;++s)n[s]=s;return t.indices=n,t}function ge(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,(e-1)*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return t.indices=n,t.primitiveType=D.LINES,t}function Oe(t){let e=B.computeNumberOfVertices(t);if(e<2)throw new I("The number of vertices must be at least two.");let n=j.createTypedArray(e,e*2);n[0]=0,n[1]=1;let s=2;for(let i=2;i<e;++i)n[s++]=i-1,n[s++]=i;return n[s++]=e-1,n[s]=0,t.indices=n,t.primitiveType=D.LINES,t}function Le(t){switch(t.primitiveType){case D.TRIANGLE_FAN:return Ie(t);case D.TRIANGLE_STRIP:return Se(t);case D.TRIANGLES:return Ae(t);case D.LINE_STRIP:return ge(t);case D.LINE_LOOP:return Oe(t);case D.LINES:return Pe(t)}return t}function Q(t,e){Math.abs(t.y)<N.EPSILON6&&(e?t.y=-N.EPSILON6:t.y=N.EPSILON6)}function Ee(t,e,n){if(t.y!==0&&e.y!==0&&n.y!==0){Q(t,t.y<0),Q(e,e.y<0),Q(n,n.y<0);return}let s=Math.abs(t.y),i=Math.abs(e.y),c=Math.abs(n.y),o;s>i?s>c?o=N.sign(t.y):o=N.sign(n.y):i>c?o=N.sign(e.y):o=N.sign(n.y);let a=o<0;Q(t,a),Q(e,a),Q(n,a)}var ee=new r;function X(t,e,n,s){r.add(t,r.multiplyByScalar(r.subtract(e,t,ee),t.y/(t.y-e.y),ee),n),r.clone(n,s),Q(n,!0),Q(s,!1)}var et=new r,nt=new r,it=new r,st=new r,Vt={positions:new Array(7),indices:new Array(9)};function Ne(t,e,n){if(t.x>=0||e.x>=0||n.x>=0)return;Ee(t,e,n);let s=t.y<0,i=e.y<0,c=n.y<0,o=0;o+=s?1:0,o+=i?1:0,o+=c?1:0;let a=Vt.indices;o===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,s?(X(t,e,et,it),X(t,n,nt,st),a[0]=0,a[3]=1,a[4]=2,a[6]=1):i?(X(e,n,et,it),X(e,t,nt,st),a[0]=1,a[3]=2,a[4]=0,a[6]=2):c&&(X(n,t,et,it),X(n,e,nt,st),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):o===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,s?i?c||(X(n,t,et,it),X(n,e,nt,st),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(X(e,n,et,it),X(e,t,nt,st),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(X(t,e,et,it),X(t,n,nt,st),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let p=Vt.positions;return p[0]=t,p[1]=e,p[2]=n,p.length=3,(o===1||o===2)&&(p[3]=et,p[4]=nt,p[5]=it,p[6]=st,p.length=7),Vt}function ne(t,e){let n=t.attributes;if(n.position.values.length===0)return;for(let i in n)if(n.hasOwnProperty(i)&&f(n[i])&&f(n[i].values)){let c=n[i];c.values=F.createTypedArray(c.componentDatatype,c.values)}let s=B.computeNumberOfVertices(t);return t.indices=j.createTypedArray(s,t.indices),e&&(t.boundingSphere=ot.fromVertices(n.position.values)),t}function ut(t){let e=t.attributes,n={};for(let s in e)if(e.hasOwnProperty(s)&&f(e[s])&&f(e[s].values)){let i=e[s];n[s]=new U({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new B({attributes:n,indices:[],primitiveType:t.primitiveType})}function Ft(t,e,n){let s=f(t.geometry.boundingSphere);e=ne(e,s),n=ne(n,s),f(n)&&!f(e)?t.geometry=n:!f(n)&&f(e)?t.geometry=e:(t.westHemisphereGeometry=e,t.eastHemisphereGeometry=n,t.geometry=void 0)}function kt(t,e){let n=new t,s=new t,i=new t;return function(c,o,a,p,u,d,m,l){let h=t.fromArray(u,c*e,n),y=t.fromArray(u,o*e,s),v=t.fromArray(u,a*e,i);t.multiplyByScalar(h,p.x,h),t.multiplyByScalar(y,p.y,y),t.multiplyByScalar(v,p.z,v);let b=t.add(h,y,h);t.add(b,v,b),l&&t.normalize(b,b),t.pack(b,d,m*e)}}var ze=kt(pt,4),At=kt(r,3),ae=kt(V,2),De=function(t,e,n,s,i,c,o){let a=i[t]*s.x,p=i[e]*s.y,u=i[n]*s.z;c[o]=a+p+u>N.EPSILON6?1:0},bt=new r,Gt=new r,Ct=new r,qe=new r;function xt(t,e,n,s,i,c,o,a,p,u,d,m,l,h,y,v){if(!f(c)&&!f(o)&&!f(a)&&!f(p)&&!f(u)&&h===0)return;let b=r.fromArray(i,t*3,bt),S=r.fromArray(i,e*3,Gt),x=r.fromArray(i,n*3,Ct),w=Ht(s,b,S,x,qe);if(f(w)){if(f(c)&&At(t,e,n,w,c,m.normal.values,v,!0),f(u)){let A=r.fromArray(u,t*3,bt),E=r.fromArray(u,e*3,Gt),P=r.fromArray(u,n*3,Ct);r.multiplyByScalar(A,w.x,A),r.multiplyByScalar(E,w.y,E),r.multiplyByScalar(P,w.z,P);let O;!r.equals(A,r.ZERO)||!r.equals(E,r.ZERO)||!r.equals(P,r.ZERO)?(O=r.add(A,E,A),r.add(O,P,O),r.normalize(O,O)):(O=bt,O.x=0,O.y=0,O.z=0),r.pack(O,m.extrudeDirection.values,v*3)}if(f(d)&&De(t,e,n,w,d,m.applyOffset.values,v),f(o)&&At(t,e,n,w,o,m.tangent.values,v,!0),f(a)&&At(t,e,n,w,a,m.bitangent.values,v,!0),f(p)&&ae(t,e,n,w,p,m.st.values,v),h>0)for(let A=0;A<h;A++){let E=l[A];Re(t,e,n,w,v,y[E],m[E])}}}function Re(t,e,n,s,i,c,o){let a=c.componentsPerAttribute,p=c.values,u=o.values;switch(a){case 4:ze(t,e,n,s,p,u,i,!1);break;case 3:At(t,e,n,s,p,u,i,!1);break;case 2:ae(t,e,n,s,p,u,i,!1);break;default:u[i]=p[t]*s.x+p[e]*s.y+p[n]*s.z}}function K(t,e,n,s,i,c){let o=t.position.values.length/3;if(i!==-1){let a=s[i],p=n[a];return p===-1?(n[a]=o,t.position.values.push(c.x,c.y,c.z),e.push(o),o):(e.push(p),p)}return t.position.values.push(c.x,c.y,c.z),e.push(o),o}var Ve={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ie(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.normal)?n.normal.values:void 0,c=f(n.bitangent)?n.bitangent.values:void 0,o=f(n.tangent)?n.tangent.values:void 0,a=f(n.st)?n.st.values:void 0,p=f(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=f(n.applyOffset)?n.applyOffset.values:void 0,d=e.indices,m=[];for(let O in n)n.hasOwnProperty(O)&&!Ve[O]&&f(n[O])&&m.push(O);let l=m.length,h=ut(e),y=ut(e),v,b,S,x,w,A=[];A.length=s.length/3;let E=[];for(E.length=s.length/3,w=0;w<A.length;++w)A[w]=-1,E[w]=-1;let P=d.length;for(w=0;w<P;w+=3){let O=d[w],L=d[w+1],g=d[w+2],T=r.fromArray(s,O*3),C=r.fromArray(s,L*3),z=r.fromArray(s,g*3),q=Ne(T,C,z);if(f(q)&&q.positions.length>3){let R=q.positions,G=q.indices,M=G.length;for(let J=0;J<M;++J){let Y=G[J],_=R[Y];_.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,Y<3?w+Y:-1,_),xt(O,L,g,_,s,i,o,c,a,p,u,v,m,l,n,x)}}else f(q)&&(T=q.positions[0],C=q.positions[1],z=q.positions[2]),T.y<0?(v=y.attributes,b=y.indices,S=A):(v=h.attributes,b=h.indices,S=E),x=K(v,b,S,d,w,T),xt(O,L,g,T,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+1,C),xt(O,L,g,C,s,i,o,c,a,p,u,v,m,l,n,x),x=K(v,b,S,d,w+2,z),xt(O,L,g,z,s,i,o,c,a,p,u,v,m,l,n,x)}Ft(t,y,h)}var ue=Et.fromPointNormal(r.ZERO,r.UNIT_Y),Ge=new r,Ce=new r;function at(t,e,n,s,i,c,o){if(!f(o))return;let a=r.fromArray(s,t*3,bt);r.equalsEpsilon(a,n,N.EPSILON10)?c.applyOffset.values[i]=o[t]:c.applyOffset.values[i]=o[e]}function se(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=f(n.applyOffset)?n.applyOffset.values:void 0,c=e.indices,o=ut(e),a=ut(e),p,u=c.length,d=[];d.length=s.length/3;let m=[];for(m.length=s.length/3,p=0;p<d.length;++p)d[p]=-1,m[p]=-1;for(p=0;p<u;p+=2){let l=c[p],h=c[p+1],y=r.fromArray(s,l*3,bt),v=r.fromArray(s,h*3,Gt),b;Math.abs(y.y)<N.EPSILON6&&(y.y<0?y.y=-N.EPSILON6:y.y=N.EPSILON6),Math.abs(v.y)<N.EPSILON6&&(v.y<0?v.y=-N.EPSILON6:v.y=N.EPSILON6);let S=o.attributes,x=o.indices,w=m,A=a.attributes,E=a.indices,P=d,O=Lt.lineSegmentPlane(y,v,ue,Ct);if(f(O)){let L=r.multiplyByScalar(r.UNIT_Y,5*N.EPSILON9,Ge);y.y<0&&(r.negate(L,L),S=a.attributes,x=a.indices,w=d,A=o.attributes,E=o.indices,P=m);let g=r.add(O,L,Ce);b=K(S,x,w,c,p,y),at(l,h,y,s,b,S,i),b=K(S,x,w,c,-1,g),at(l,h,g,s,b,S,i),r.negate(L,L),r.add(O,L,g),b=K(A,E,P,c,-1,g),at(l,h,g,s,b,A,i),b=K(A,E,P,c,p+1,v),at(l,h,v,s,b,A,i)}else{let L,g,T;y.y<0?(L=a.attributes,g=a.indices,T=d):(L=o.attributes,g=o.indices,T=m),b=K(L,g,T,c,p,y),at(l,h,y,s,b,L,i),b=K(L,g,T,c,p+1,v),at(l,h,v,s,b,L,i)}}Ft(t,a,o)}var oe=new V,Be=new V,le=new r,fe=new r,Bt=new r,Fe=new r,ke=new r,Me=new r,re=new pt;function ce(t){let e=t.attributes,n=e.position.values,s=e.prevPosition.values,i=e.nextPosition.values,c=n.length;for(let o=0;o<c;o+=3){let a=r.unpack(n,o,le);if(a.x>0)continue;let p=r.unpack(s,o,fe);(a.y<0&&p.y>0||a.y>0&&p.y<0)&&(o-3>0?(s[o]=n[o-3],s[o+1]=n[o-2],s[o+2]=n[o-1]):r.pack(a,s,o));let u=r.unpack(i,o,Bt);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(o+3<c?(i[o]=n[o+3],i[o+1]=n[o+4],i[o+2]=n[o+5]):r.pack(a,i,o))}}var _e=5*N.EPSILON9,Tt=N.EPSILON6;function Ue(t){let e=t.geometry,n=e.attributes,s=n.position.values,i=n.prevPosition.values,c=n.nextPosition.values,o=n.expandAndWidth.values,a=f(n.st)?n.st.values:void 0,p=f(n.color)?n.color.values:void 0,u=ut(e),d=ut(e),m,l,h,y=!1,v=s.length/3;for(m=0;m<v;m+=4){let b=m,S=m+2,x=r.fromArray(s,b*3,le),w=r.fromArray(s,S*3,fe);if(Math.abs(x.y)<Tt)for(x.y=Tt*(w.y<0?-1:1),s[m*3+1]=x.y,s[(m+1)*3+1]=x.y,l=b*3;l<b*3+12;l+=3)i[l]=s[m*3],i[l+1]=s[m*3+1],i[l+2]=s[m*3+2];if(Math.abs(w.y)<Tt)for(w.y=Tt*(x.y<0?-1:1),s[(m+2)*3+1]=w.y,s[(m+3)*3+1]=w.y,l=b*3;l<b*3+12;l+=3)c[l]=s[(m+2)*3],c[l+1]=s[(m+2)*3+1],c[l+2]=s[(m+2)*3+2];let A=u.attributes,E=u.indices,P=d.attributes,O=d.indices,L=Lt.lineSegmentPlane(x,w,ue,Fe);if(f(L)){y=!0;let g=r.multiplyByScalar(r.UNIT_Y,_e,ke);x.y<0&&(r.negate(g,g),A=d.attributes,E=d.indices,P=u.attributes,O=u.indices);let T=r.add(L,g,Me);A.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.position.values.push(T.x,T.y,T.z),A.position.values.push(T.x,T.y,T.z),A.prevPosition.values.push(i[b*3],i[b*3+1],i[b*3+2]),A.prevPosition.values.push(i[b*3+3],i[b*3+4],i[b*3+5]),A.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),A.nextPosition.values.push(T.x,T.y,T.z),r.negate(g,g),r.add(L,g,T),P.position.values.push(T.x,T.y,T.z),P.position.values.push(T.x,T.y,T.z),P.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.prevPosition.values.push(T.x,T.y,T.z),P.nextPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),P.nextPosition.values.push(c[S*3],c[S*3+1],c[S*3+2]),P.nextPosition.values.push(c[S*3+3],c[S*3+4],c[S*3+5]);let C=V.fromArray(o,b*2,oe),z=Math.abs(C.y);A.expandAndWidth.values.push(-1,z,1,z),A.expandAndWidth.values.push(-1,-z,1,-z),P.expandAndWidth.values.push(-1,z,1,z),P.expandAndWidth.values.push(-1,-z,1,-z);let q=r.magnitudeSquared(r.subtract(L,x,Bt));if(q/=r.magnitudeSquared(r.subtract(w,x,Bt)),f(p)){let R=pt.fromArray(p,b*4,re),G=pt.fromArray(p,S*4,re),M=N.lerp(R.x,G.x,q),J=N.lerp(R.y,G.y,q),Y=N.lerp(R.z,G.z,q),_=N.lerp(R.w,G.w,q);for(l=b*4;l<b*4+8;++l)A.color.values.push(p[l]);for(A.color.values.push(M,J,Y,_),A.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),P.color.values.push(M,J,Y,_),l=S*4;l<S*4+8;++l)P.color.values.push(p[l])}if(f(a)){let R=V.fromArray(a,b*2,oe),G=V.fromArray(a,(m+3)*2,Be),M=N.lerp(R.x,G.x,q);for(l=b*2;l<b*2+4;++l)A.st.values.push(a[l]);for(A.st.values.push(M,R.y),A.st.values.push(M,G.y),P.st.values.push(M,R.y),P.st.values.push(M,G.y),l=S*2;l<S*2+4;++l)P.st.values.push(a[l])}h=A.position.values.length/3-4,E.push(h,h+2,h+1),E.push(h+1,h+2,h+3),h=P.position.values.length/3-4,O.push(h,h+2,h+1),O.push(h+1,h+2,h+3)}else{let g,T;for(x.y<0?(g=d.attributes,T=d.indices):(g=u.attributes,T=u.indices),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(w.x,w.y,w.z),g.position.values.push(w.x,w.y,w.z),l=m*3;l<m*3+12;++l)g.prevPosition.values.push(i[l]),g.nextPosition.values.push(c[l]);for(l=m*2;l<m*2+8;++l)g.expandAndWidth.values.push(o[l]),f(a)&&g.st.values.push(a[l]);if(f(p))for(l=m*4;l<m*4+16;++l)g.color.values.push(p[l]);h=g.position.values.length/3-4,T.push(h,h+2,h+1),T.push(h+1,h+2,h+3)}}y&&(ce(d),ce(u)),Ft(t,d,u)}k.splitLongitude=function(t){if(!f(t))throw new I("instance is required.");let e=t.geometry,n=e.boundingSphere;if(f(n)&&(n.center.x-n.radius>0||ot.intersectPlane(n,Et.ORIGIN_ZX_PLANE)!==Ut.INTERSECTING))return t;if(e.geometryType!==dt.NONE)switch(e.geometryType){case dt.POLYLINES:Ue(t);break;case dt.TRIANGLES:ie(t);break;case dt.LINES:se(t);break}else Le(e),e.primitiveType===D.TRIANGLES?ie(t):e.primitiveType===D.LINES&&se(t);return t};var Pn=k;export{Pn as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-YAU2WIVW.js b/plugins/feature/map/Cesium/Workers/chunk-YAU2WIVW.js new file mode 100644 index 000000000..091c89e55 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-YAU2WIVW.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as g}from"./chunk-THB3EPLO.js";import{a as d}from"./chunk-QQWQKL3T.js";import{j as x}from"./chunk-YZ5ZCI55.js";import{a as p,b as M,c as O}from"./chunk-KP72RGCH.js";import{b as m}from"./chunk-OU2IPMYE.js";import{f}from"./chunk-H7SJWKIY.js";function n(i,h,o,t){this.x=i??0,this.y=h??0,this.width=o??0,this.height=t??0}n.packedLength=4;n.pack=function(i,h,o){return m.typeOf.object("value",i),m.defined("array",h),o=o??0,h[o++]=i.x,h[o++]=i.y,h[o++]=i.width,h[o]=i.height,h};n.unpack=function(i,h,o){return m.defined("array",i),h=h??0,f(o)||(o=new n),o.x=i[h++],o.y=i[h++],o.width=i[h++],o.height=i[h],o};n.fromPoints=function(i,h){if(f(h)||(h=new n),!f(i)||i.length===0)return h.x=0,h.y=0,h.width=0,h.height=0,h;let o=i.length,t=i[0].x,c=i[0].y,e=i[0].x,w=i[0].y;for(let y=1;y<o;y++){let R=i[y],b=R.x,j=R.y;t=Math.min(b,t),e=Math.max(b,e),c=Math.min(j,c),w=Math.max(j,w)}return h.x=t,h.y=c,h.width=e-t,h.height=w-c,h};var L=new g,X=new p,Y=new p;n.fromRectangle=function(i,h,o){if(f(o)||(o=new n),!f(i))return o.x=0,o.y=0,o.width=0,o.height=0,o;L._ellipsoid=O.default,h=h??L;let t=h.project(x.southwest(i,X)),c=h.project(x.northeast(i,Y));return M.subtract(c,t,c),o.x=t.x,o.y=t.y,o.width=c.x,o.height=c.y,o};n.clone=function(i,h){if(f(i))return f(h)?(h.x=i.x,h.y=i.y,h.width=i.width,h.height=i.height,h):new n(i.x,i.y,i.width,i.height)};n.union=function(i,h,o){m.typeOf.object("left",i),m.typeOf.object("right",h),f(o)||(o=new n);let t=Math.min(i.x,h.x),c=Math.min(i.y,h.y),e=Math.max(i.x+i.width,h.x+h.width),w=Math.max(i.y+i.height,h.y+h.height);return o.x=t,o.y=c,o.width=e-t,o.height=w-c,o};n.expand=function(i,h,o){m.typeOf.object("rectangle",i),m.typeOf.object("point",h),o=n.clone(i,o);let t=h.x-o.x,c=h.y-o.y;return t>o.width?o.width=t:t<0&&(o.width-=t,o.x=h.x),c>o.height?o.height=c:c<0&&(o.height-=c,o.y=h.y),o};n.intersect=function(i,h){m.typeOf.object("left",i),m.typeOf.object("right",h);let o=i.x,t=i.y,c=h.x,e=h.y;return o>c+h.width||o+i.width<c||t+i.height<e||t>e+h.height?d.OUTSIDE:d.INTERSECTING};n.equals=function(i,h){return i===h||f(i)&&f(h)&&i.x===h.x&&i.y===h.y&&i.width===h.width&&i.height===h.height};n.prototype.clone=function(i){return n.clone(this,i)};n.prototype.intersect=function(i){return n.intersect(this,i)};n.prototype.equals=function(i){return n.equals(this,i)};var S=n;export{S as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-YRCAQUFT.js b/plugins/feature/map/Cesium/Workers/chunk-YRCAQUFT.js deleted file mode 100644 index 42a8c38ed..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-YRCAQUFT.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as n,b as a}from"./chunk-ELJAHN3H.js";import{c as E,d as I,e as o}from"./chunk-3BGP4HCL.js";var d=E((_,m)=>{var f=function(t){t==null&&(t=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,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};f.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};f.prototype.init_by_array=function(t,i){var e,s,h;for(this.init_seed(19650218),e=1,s=0,h=this.N>i?this.N:i;h;h--){var u=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((u&4294901760)>>>16)*1664525<<16)+(u&65535)*1664525)+t[s]+s,this.mt[e]>>>=0,e++,s++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),s>=i&&(s=0)}for(h=this.N-1;h;h--){var u=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((u&4294901760)>>>16)*1566083941<<16)+(u&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648};f.prototype.random_int=function(){var t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^i[t&1];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^i[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^i[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};f.prototype.random_int31=function(){return this.random_int()>>>1};f.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};f.prototype.random=function(){return this.random_int()*(1/4294967296)};f.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};f.prototype.random_long=function(){var t=this.random_int()>>>5,i=this.random_int()>>>6;return(t*67108864+i)*(1/9007199254740992)};m.exports=f});var w=I(d(),1);var r={};r.EPSILON1=.1;r.EPSILON2=.01;r.EPSILON3=.001;r.EPSILON4=1e-4;r.EPSILON5=1e-5;r.EPSILON6=1e-6;r.EPSILON7=1e-7;r.EPSILON8=1e-8;r.EPSILON9=1e-9;r.EPSILON10=1e-10;r.EPSILON11=1e-11;r.EPSILON12=1e-12;r.EPSILON13=1e-13;r.EPSILON14=1e-14;r.EPSILON15=1e-15;r.EPSILON16=1e-16;r.EPSILON17=1e-17;r.EPSILON18=1e-18;r.EPSILON19=1e-19;r.EPSILON20=1e-20;r.EPSILON21=1e-21;r.GRAVITATIONALPARAMETER=3986004418e5;r.SOLAR_RADIUS=6955e5;r.LUNAR_RADIUS=1737400;r.SIXTY_FOUR_KILOBYTES=64*1024;r.FOUR_GIGABYTES=4*1024*1024*1024;r.sign=Math.sign??function(i){return i=+i,i===0||i!==i?i:i>0?1:-1};r.signNotZero=function(t){return t<0?-1:1};r.toSNorm=function(t,i){return i=i??255,Math.round((r.clamp(t,-1,1)*.5+.5)*i)};r.fromSNorm=function(t,i){return i=i??255,r.clamp(t,0,i)/i*2-1};r.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:r.clamp((t-i)/e,0,1)};r.sinh=Math.sinh??function(i){return(Math.exp(i)-Math.exp(-i))/2};r.cosh=Math.cosh??function(i){return(Math.exp(i)+Math.exp(-i))/2};r.lerp=function(t,i,e){return(1-e)*t+e*i};r.PI=Math.PI;r.ONE_OVER_PI=1/Math.PI;r.PI_OVER_TWO=Math.PI/2;r.PI_OVER_THREE=Math.PI/3;r.PI_OVER_FOUR=Math.PI/4;r.PI_OVER_SIX=Math.PI/6;r.THREE_PI_OVER_TWO=3*Math.PI/2;r.TWO_PI=2*Math.PI;r.ONE_OVER_TWO_PI=1/(2*Math.PI);r.RADIANS_PER_DEGREE=Math.PI/180;r.DEGREES_PER_RADIAN=180/Math.PI;r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600;r.toRadians=function(t){if(!o(t))throw new n("degrees is required.");return t*r.RADIANS_PER_DEGREE};r.toDegrees=function(t){if(!o(t))throw new n("radians is required.");return t*r.DEGREES_PER_RADIAN};r.convertLongitudeRange=function(t){if(!o(t))throw new n("angle is required.");let i=r.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e};r.clampToLatitudeRange=function(t){if(!o(t))throw new n("angle is required.");return r.clamp(t,-1*r.PI_OVER_TWO,r.PI_OVER_TWO)};r.negativePiToPi=function(t){if(!o(t))throw new n("angle is required.");return t>=-r.PI&&t<=r.PI?t:r.zeroToTwoPi(t+r.PI)-r.PI};r.zeroToTwoPi=function(t){if(!o(t))throw new n("angle is required.");if(t>=0&&t<=r.TWO_PI)return t;let i=r.mod(t,r.TWO_PI);return Math.abs(i)<r.EPSILON14&&Math.abs(t)>r.EPSILON14?r.TWO_PI:i};r.mod=function(t,i){if(!o(t))throw new n("m is required.");if(!o(i))throw new n("n is required.");if(i===0)throw new n("divisor cannot be 0.");return r.sign(t)===r.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i};r.equalsEpsilon=function(t,i,e,s){if(!o(t))throw new n("left is required.");if(!o(i))throw new n("right is required.");e=e??0,s=s??e;let h=Math.abs(t-i);return h<=s||h<=e*Math.max(Math.abs(t),Math.abs(i))};r.lessThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<-e};r.lessThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i<e};r.greaterThan=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>e};r.greaterThanOrEquals=function(t,i,e){if(!o(t))throw new n("first is required.");if(!o(i))throw new n("second is required.");if(!o(e))throw new n("absoluteEpsilon is required.");return t-i>-e};var c=[1];r.factorial=function(t){if(typeof t!="number"||t<0)throw new n("A number greater than or equal to 0 is required.");let i=c.length;if(t>=i){let e=c[i-1];for(let s=i;s<=t;s++){let h=e*s;c.push(h),e=h}}return c[t]};r.incrementWrap=function(t,i,e){if(e=e??0,!o(t))throw new n("n is required.");if(i<=e)throw new n("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t};r.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0};r.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new n("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t};r.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new n("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t};r.clamp=function(t,i,e){return a.typeOf.number("value",t),a.typeOf.number("min",i),a.typeOf.number("max",e),t<i?i:t>e?e:t};var P=new w.default;r.setRandomNumberSeed=function(t){if(!o(t))throw new n("seed is required.");P=new w.default(t)};r.nextRandomNumber=function(){return P.random()};r.randomBetween=function(t,i){return r.nextRandomNumber()*(i-t)+t};r.acosClamped=function(t){if(!o(t))throw new n("value is required.");return Math.acos(r.clamp(t,-1,1))};r.asinClamped=function(t){if(!o(t))throw new n("value is required.");return Math.asin(r.clamp(t,-1,1))};r.chordLength=function(t,i){if(!o(t))throw new n("angle is required.");if(!o(i))throw new n("radius is required.");return 2*i*Math.sin(t*.5)};r.logBase=function(t,i){if(!o(t))throw new n("number is required.");if(!o(i))throw new n("base is required.");return Math.log(t)/Math.log(i)};r.cbrt=Math.cbrt??function(i){let e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e};r.log2=Math.log2??function(i){return Math.log(i)*Math.LOG2E};r.fog=function(t,i){let e=t*i;return 1-Math.exp(-(e*e))};r.fastApproximateAtan=function(t){return a.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)};r.fastApproximateAtan2=function(t,i){a.typeOf.number("x",t),a.typeOf.number("y",i);let e,s=Math.abs(t);e=Math.abs(i);let h=Math.max(s,e);e=Math.min(s,e);let u=e/h;if(isNaN(u))throw new n("either x or y must be nonzero");return s=r.fastApproximateAtan(u),s=Math.abs(i)>Math.abs(t)?r.PI_OVER_TWO-s:s,s=t<0?r.PI-s:s,s=i<0?-s:s,s};var M=r;export{M as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-YZ5ZCI55.js b/plugins/feature/map/Cesium/Workers/chunk-YZ5ZCI55.js new file mode 100644 index 000000000..00f6e6a2f --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-YZ5ZCI55.js @@ -0,0 +1,63 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as mt,b as N}from"./chunk-HLXNFZAZ.js";import{a as de}from"./chunk-23IOGON7.js";import{a as ve,b as se,c as Ce,d as nt}from"./chunk-KP72RGCH.js";import{a as v,b as k,c as we}from"./chunk-OSVSBQDY.js";import{a as _}from"./chunk-LZC73BOP.js";import{a as T,b as l}from"./chunk-OU2IPMYE.js";import{a as dt,c as pt,d as We,f as h}from"./chunk-H7SJWKIY.js";var Sn=pt((Ve,Ye)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(t){var e=typeof Ve=="object"&&Ve&&!Ve.nodeType&&Ve,n=typeof Ye=="object"&&Ye&&!Ye.nodeType&&Ye,r=typeof global=="object"&&global;(r.global===r||r.window===r||r.self===r)&&(t=r);var s,o=2147483647,c=36,u=1,d=26,w=38,y=700,g=72,x=128,C="-",I=/^xn--/,R=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,z={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Q=c-u,j=Math.floor,Y=String.fromCharCode,Z;function J(m){throw new RangeError(z[m])}function Se(m,A){for(var P=m.length,F=[];P--;)F[P]=A(m[P]);return F}function qe(m,A){var P=m.split("@"),F="";P.length>1&&(F=P[0]+"@",m=P[1]),m=m.replace(D,".");var X=m.split("."),G=Se(X,A).join(".");return F+G}function ye(m){for(var A=[],P=0,F=m.length,X,G;P<F;)X=m.charCodeAt(P++),X>=55296&&X<=56319&&P<F?(G=m.charCodeAt(P++),(G&64512)==56320?A.push(((X&1023)<<10)+(G&1023)+65536):(A.push(X),P--)):A.push(X);return A}function ge(m){return Se(m,function(A){var P="";return A>65535&&(A-=65536,P+=Y(A>>>10&1023|55296),A=56320|A&1023),P+=Y(A),P}).join("")}function ae(m){return m-48<10?m-22:m-65<26?m-65:m-97<26?m-97:c}function i(m,A){return m+22+75*(m<26)-((A!=0)<<5)}function a(m,A,P){var F=0;for(m=P?j(m/y):m>>1,m+=j(m/A);m>Q*d>>1;F+=c)m=j(m/Q);return j(F+(Q+1)*m/(m+w))}function f(m){var A=[],P=m.length,F,X=0,G=x,H=g,ee,oe,fe,ie,te,he,le,Ae,ke;for(ee=m.lastIndexOf(C),ee<0&&(ee=0),oe=0;oe<ee;++oe)m.charCodeAt(oe)>=128&&J("not-basic"),A.push(m.charCodeAt(oe));for(fe=ee>0?ee+1:0;fe<P;){for(ie=X,te=1,he=c;fe>=P&&J("invalid-input"),le=ae(m.charCodeAt(fe++)),(le>=c||le>j((o-X)/te))&&J("overflow"),X+=le*te,Ae=he<=H?u:he>=H+d?d:he-H,!(le<Ae);he+=c)ke=c-Ae,te>j(o/ke)&&J("overflow"),te*=ke;F=A.length+1,H=a(X-ie,F,ie==0),j(X/F)>o-G&&J("overflow"),G+=j(X/F),X%=F,A.splice(X++,0,G)}return ge(A)}function p(m){var A,P,F,X,G,H,ee,oe,fe,ie,te,he=[],le,Ae,ke,Qt;for(m=ye(m),le=m.length,A=x,P=0,G=g,H=0;H<le;++H)te=m[H],te<128&&he.push(Y(te));for(F=X=he.length,X&&he.push(C);F<le;){for(ee=o,H=0;H<le;++H)te=m[H],te>=A&&te<ee&&(ee=te);for(Ae=F+1,ee-A>j((o-P)/Ae)&&J("overflow"),P+=(ee-A)*Ae,A=ee,H=0;H<le;++H)if(te=m[H],te<A&&++P>o&&J("overflow"),te==A){for(oe=P,fe=c;ie=fe<=G?u:fe>=G+d?d:fe-G,!(oe<ie);fe+=c)Qt=oe-ie,ke=c-ie,he.push(Y(i(ie+Qt%ke,0))),oe=j(Qt/ke);he.push(Y(i(oe,0))),G=a(P,Ae,F==X),P=0,++F}++P,++A}return he.join("")}function b(m){return qe(m,function(A){return I.test(A)?f(A.slice(4).toLowerCase()):A})}function S(m){return qe(m,function(A){return R.test(A)?"xn--"+p(A):A})}if(s={version:"1.3.2",ucs2:{decode:ye,encode:ge},decode:f,encode:p,toASCII:S,toUnicode:b},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return s});else if(e&&n)if(Ye.exports==e)n.exports=s;else for(Z in s)s.hasOwnProperty(Z)&&(e[Z]=s[Z]);else t.punycode=s})(Ve)});var En=pt((vn,_t)=>{/*! + * 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(t,e){"use strict";typeof _t=="object"&&_t.exports?_t.exports=e():typeof define=="function"&&define.amd?define(e):t.IPv6=e(t)})(vn,function(t){"use strict";var e=t&&t.IPv6;function n(s){var o=s.toLowerCase(),c=o.split(":"),u=c.length,d=8;c[0]===""&&c[1]===""&&c[2]===""?(c.shift(),c.shift()):c[0]===""&&c[1]===""?c.shift():c[u-1]===""&&c[u-2]===""&&c.pop(),u=c.length,c[u-1].indexOf(".")!==-1&&(d=7);var w;for(w=0;w<u&&c[w]!=="";w++);if(w<d)for(c.splice(w,1,"0000");c.length<d;)c.splice(w,0,"0000");for(var y,g=0;g<d;g++){y=c[g].split("");for(var x=0;x<3&&(y[0]==="0"&&y.length>1);x++)y.splice(0,1);c[g]=y.join("")}var C=-1,I=0,R=0,D=-1,z=!1;for(g=0;g<d;g++)z?c[g]==="0"?R+=1:(z=!1,R>I&&(C=D,I=R)):c[g]==="0"&&(z=!0,D=g,R=1);R>I&&(C=D,I=R),I>1&&c.splice(C,I,""),u=c.length;var Q="";for(c[0]===""&&(Q=":"),g=0;g<u&&(Q+=c[g],g!==u-1);g++)Q+=":";return c[u-1]===""&&(Q+=":"),Q}function r(){return t.IPv6===this&&(t.IPv6=e),this}return{best:n,noConflict:r}})});var xn=pt((Tn,St)=>{/*! + * 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(t,e){"use strict";typeof St=="object"&&St.exports?St.exports=e():typeof define=="function"&&define.amd?define(e):t.SecondLevelDomains=e(t)})(Tn,function(t){"use strict";var e=t&&t.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(r){var s=r.lastIndexOf(".");if(s<=0||s>=r.length-1)return!1;var o=r.lastIndexOf(".",s-1);if(o<=0||o>=s-1)return!1;var c=n.list[r.slice(s+1)];return c?c.indexOf(" "+r.slice(o+1,s)+" ")>=0:!1},is:function(r){var s=r.lastIndexOf(".");if(s<=0||s>=r.length-1)return!1;var o=r.lastIndexOf(".",s-1);if(o>=0)return!1;var c=n.list[r.slice(s+1)];return c?c.indexOf(" "+r.slice(0,s)+" ")>=0:!1},get:function(r){var s=r.lastIndexOf(".");if(s<=0||s>=r.length-1)return null;var o=r.lastIndexOf(".",s-1);if(o<=0||o>=s-1)return null;var c=n.list[r.slice(s+1)];return!c||c.indexOf(" "+r.slice(o+1,s)+" ")<0?null:r.slice(o+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return n})});var Ne=pt((An,vt)=>{/*! + * 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(t,e){"use strict";typeof vt=="object"&&vt.exports?vt.exports=e(Sn(),En(),xn()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],e):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(An,function(t,e,n,r){"use strict";var s=r&&r.URI;function o(i,a){var f=arguments.length>=1,p=arguments.length>=2;if(!(this instanceof o))return f?p?new o(i,a):new o(i):new o;if(i===void 0){if(f)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?i=location.href+"":i=""}if(i===null&&f)throw new TypeError("null is not a valid argument for URI");return this.href(i),a!==void 0?this.absoluteTo(a):this}function c(i){return/^[0-9]+$/.test(i)}o.version="1.19.11";var u=o.prototype,d=Object.prototype.hasOwnProperty;function w(i){return i.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function y(i){return i===void 0?"Undefined":String(Object.prototype.toString.call(i)).slice(8,-1)}function g(i){return y(i)==="Array"}function x(i,a){var f={},p,b;if(y(a)==="RegExp")f=null;else if(g(a))for(p=0,b=a.length;p<b;p++)f[a[p]]=!0;else f[a]=!0;for(p=0,b=i.length;p<b;p++){var S=f&&f[i[p]]!==void 0||!f&&a.test(i[p]);S&&(i.splice(p,1),b--,p--)}return i}function C(i,a){var f,p;if(g(a)){for(f=0,p=a.length;f<p;f++)if(!C(i,a[f]))return!1;return!0}var b=y(a);for(f=0,p=i.length;f<p;f++)if(b==="RegExp"){if(typeof i[f]=="string"&&i[f].match(a))return!0}else if(i[f]===a)return!0;return!1}function I(i,a){if(!g(i)||!g(a)||i.length!==a.length)return!1;i.sort(),a.sort();for(var f=0,p=i.length;f<p;f++)if(i[f]!==a[f])return!1;return!0}function R(i){var a=/^\/+|\/+$/g;return i.replace(a,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.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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+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.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"},o.getDomAttribute=function(i){if(!(!i||!i.nodeName)){var a=i.nodeName.toLowerCase();if(!(a==="input"&&i.type!=="image"))return o.domAttributes[a]}};function D(i){return escape(i)}function z(i){return encodeURIComponent(i).replace(/[!'()*]/g,D).replace(/\*/g,"%2A")}o.encode=z,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=z,o.decode=decodeURIComponent},o.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"}}}},o.encodeQuery=function(i,a){var f=o.encode(i+"");return a===void 0&&(a=o.escapeQuerySpace),a?f.replace(/%20/g,"+"):f},o.decodeQuery=function(i,a){i+="",a===void 0&&(a=o.escapeQuerySpace);try{return o.decode(a?i.replace(/\+/g,"%20"):i)}catch{return i}};var Q={encode:"encode",decode:"decode"},j,Y=function(i,a){return function(f){try{return o[a](f+"").replace(o.characters[i][a].expression,function(p){return o.characters[i][a].map[p]})}catch{return f}}};for(j in Q)o[j+"PathSegment"]=Y("pathname",Q[j]),o[j+"UrnPathSegment"]=Y("urnpath",Q[j]);var Z=function(i,a,f){return function(p){var b;f?b=function(P){return o[a](o[f](P))}:b=o[a];for(var S=(p+"").split(i),m=0,A=S.length;m<A;m++)S[m]=b(S[m]);return S.join(i)}};o.decodePath=Z("/","decodePathSegment"),o.decodeUrnPath=Z(":","decodeUrnPathSegment"),o.recodePath=Z("/","encodePathSegment","decode"),o.recodeUrnPath=Z(":","encodeUrnPathSegment","decode"),o.encodeReserved=Y("reserved","encode"),o.parse=function(i,a){var f;return a||(a={preventInvalidHostname:o.preventInvalidHostname}),i=i.replace(o.leading_whitespace_expression,""),i=i.replace(o.ascii_tab_whitespace,""),f=i.indexOf("#"),f>-1&&(a.fragment=i.substring(f+1)||null,i=i.substring(0,f)),f=i.indexOf("?"),f>-1&&(a.query=i.substring(f+1)||null,i=i.substring(0,f)),i=i.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),i=i.replace(/^[/\\]{2,}/i,"//"),i.substring(0,2)==="//"?(a.protocol=null,i=i.substring(2),i=o.parseAuthority(i,a)):(f=i.indexOf(":"),f>-1&&(a.protocol=i.substring(0,f)||null,a.protocol&&!a.protocol.match(o.protocol_expression)?a.protocol=void 0:i.substring(f+1,f+3).replace(/\\/g,"/")==="//"?(i=i.substring(f+3),i=o.parseAuthority(i,a)):(i=i.substring(f+1),a.urn=!0))),a.path=i,a},o.parseHost=function(i,a){i||(i=""),i=i.replace(/\\/g,"/");var f=i.indexOf("/"),p,b;if(f===-1&&(f=i.length),i.charAt(0)==="[")p=i.indexOf("]"),a.hostname=i.substring(1,p)||null,a.port=i.substring(p+2,f)||null,a.port==="/"&&(a.port=null);else{var S=i.indexOf(":"),m=i.indexOf("/"),A=i.indexOf(":",S+1);A!==-1&&(m===-1||A<m)?(a.hostname=i.substring(0,f)||null,a.port=null):(b=i.substring(0,f).split(":"),a.hostname=b[0]||null,a.port=b[1]||null)}return a.hostname&&i.substring(f).charAt(0)!=="/"&&(f++,i="/"+i),a.preventInvalidHostname&&o.ensureValidHostname(a.hostname,a.protocol),a.port&&o.ensureValidPort(a.port),i.substring(f)||"/"},o.parseAuthority=function(i,a){return i=o.parseUserinfo(i,a),o.parseHost(i,a)},o.parseUserinfo=function(i,a){var f=i,p=i.indexOf("\\");p!==-1&&(i=i.replace(/\\/g,"/"));var b=i.indexOf("/"),S=i.lastIndexOf("@",b>-1?b:i.length-1),m;return S>-1&&(b===-1||S<b)?(m=i.substring(0,S).split(":"),a.username=m[0]?o.decode(m[0]):null,m.shift(),a.password=m[0]?o.decode(m.join(":")):null,i=f.substring(S+1)):(a.username=null,a.password=null),i},o.parseQuery=function(i,a){if(!i)return{};if(i=i.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!i)return{};for(var f={},p=i.split("&"),b=p.length,S,m,A,P=0;P<b;P++)S=p[P].split("="),m=o.decodeQuery(S.shift(),a),A=S.length?o.decodeQuery(S.join("="),a):null,m!=="__proto__"&&(d.call(f,m)?((typeof f[m]=="string"||f[m]===null)&&(f[m]=[f[m]]),f[m].push(A)):f[m]=A);return f},o.build=function(i){var a="",f=!1;return i.protocol&&(a+=i.protocol+":"),!i.urn&&(a||i.hostname)&&(a+="//",f=!0),a+=o.buildAuthority(i)||"",typeof i.path=="string"&&(i.path.charAt(0)!=="/"&&f&&(a+="/"),a+=i.path),typeof i.query=="string"&&i.query&&(a+="?"+i.query),typeof i.fragment=="string"&&i.fragment&&(a+="#"+i.fragment),a},o.buildHost=function(i){var a="";if(i.hostname)o.ip6_expression.test(i.hostname)?a+="["+i.hostname+"]":a+=i.hostname;else return"";return i.port&&(a+=":"+i.port),a},o.buildAuthority=function(i){return o.buildUserinfo(i)+o.buildHost(i)},o.buildUserinfo=function(i){var a="";return i.username&&(a+=o.encode(i.username)),i.password&&(a+=":"+o.encode(i.password)),a&&(a+="@"),a},o.buildQuery=function(i,a,f){var p="",b,S,m,A;for(S in i)if(S!=="__proto__"&&d.call(i,S))if(g(i[S]))for(b={},m=0,A=i[S].length;m<A;m++)i[S][m]!==void 0&&b[i[S][m]+""]===void 0&&(p+="&"+o.buildQueryParameter(S,i[S][m],f),a!==!0&&(b[i[S][m]+""]=!0));else i[S]!==void 0&&(p+="&"+o.buildQueryParameter(S,i[S],f));return p.substring(1)},o.buildQueryParameter=function(i,a,f){return o.encodeQuery(i,f)+(a!==null?"="+o.encodeQuery(a,f):"")},o.addQuery=function(i,a,f){if(typeof a=="object")for(var p in a)d.call(a,p)&&o.addQuery(i,p,a[p]);else if(typeof a=="string"){if(i[a]===void 0){i[a]=f;return}else typeof i[a]=="string"&&(i[a]=[i[a]]);g(f)||(f=[f]),i[a]=(i[a]||[]).concat(f)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(i,a,f){if(typeof a=="object")for(var p in a)d.call(a,p)&&o.setQuery(i,p,a[p]);else if(typeof a=="string")i[a]=f===void 0?null:f;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(i,a,f){var p,b,S;if(g(a))for(p=0,b=a.length;p<b;p++)i[a[p]]=void 0;else if(y(a)==="RegExp")for(S in i)a.test(S)&&(i[S]=void 0);else if(typeof a=="object")for(S in a)d.call(a,S)&&o.removeQuery(i,S,a[S]);else if(typeof a=="string")f!==void 0?y(f)==="RegExp"?!g(i[a])&&f.test(i[a])?i[a]=void 0:i[a]=x(i[a],f):i[a]===String(f)&&(!g(f)||f.length===1)?i[a]=void 0:g(i[a])&&(i[a]=x(i[a],f)):i[a]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(i,a,f,p){switch(y(a)){case"String":break;case"RegExp":for(var b in i)if(d.call(i,b)&&a.test(b)&&(f===void 0||o.hasQuery(i,b,f)))return!0;return!1;case"Object":for(var S in a)if(d.call(a,S)&&!o.hasQuery(i,S,a[S]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(y(f)){case"Undefined":return a in i;case"Boolean":var m=!!(g(i[a])?i[a].length:i[a]);return f===m;case"Function":return!!f(i[a],a,i);case"Array":if(!g(i[a]))return!1;var A=p?C:I;return A(i[a],f);case"RegExp":return g(i[a])?p?C(i[a],f):!1:!!(i[a]&&i[a].match(f));case"Number":f=String(f);case"String":return g(i[a])?p?C(i[a],f):!1:i[a]===f;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var i=[],a=[],f=0,p=0;p<arguments.length;p++){var b=new o(arguments[p]);i.push(b);for(var S=b.segment(),m=0;m<S.length;m++)typeof S[m]=="string"&&a.push(S[m]),S[m]&&f++}if(!a.length||!f)return new o("");var A=new o("").segment(a);return(i[0].path()===""||i[0].path().slice(0,1)==="/")&&A.path("/"+A.path()),A.normalize()},o.commonPath=function(i,a){var f=Math.min(i.length,a.length),p;for(p=0;p<f;p++)if(i.charAt(p)!==a.charAt(p)){p--;break}return p<1?i.charAt(0)===a.charAt(0)&&i.charAt(0)==="/"?"/":"":((i.charAt(p)!=="/"||a.charAt(p)!=="/")&&(p=i.substring(0,p).lastIndexOf("/")),i.substring(0,p+1))},o.withinString=function(i,a,f){f||(f={});var p=f.start||o.findUri.start,b=f.end||o.findUri.end,S=f.trim||o.findUri.trim,m=f.parens||o.findUri.parens,A=/[a-z0-9-]=["']?$/i;for(p.lastIndex=0;;){var P=p.exec(i);if(!P)break;var F=P.index;if(f.ignoreHtml){var X=i.slice(Math.max(F-3,0),F);if(X&&A.test(X))continue}for(var G=F+i.slice(F).search(b),H=i.slice(F,G),ee=-1;;){var oe=m.exec(H);if(!oe)break;var fe=oe.index+oe[0].length;ee=Math.max(ee,fe)}if(ee>-1?H=H.slice(0,ee)+H.slice(ee).replace(S,""):H=H.replace(S,""),!(H.length<=P[0].length)&&!(f.ignore&&f.ignore.test(H))){G=F+H.length;var ie=a(H,F,G,i);if(ie===void 0){p.lastIndex=G;continue}ie=String(ie),i=i.slice(0,F)+ie+i.slice(G),p.lastIndex=F+ie.length}}return p.lastIndex=0,i},o.ensureValidHostname=function(i,a){var f=!!i,p=!!a,b=!1;if(p&&(b=C(o.hostProtocols,a)),b&&!f)throw new TypeError("Hostname cannot be empty, if protocol is "+a);if(i&&i.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+i+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(i).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+i+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(i){if(i){var a=Number(i);if(!(c(a)&&a>0&&a<65536))throw new TypeError('Port "'+i+'" is not a valid port')}},o.noConflict=function(i){if(i){var a={URI:this.noConflict()};return r.URITemplate&&typeof r.URITemplate.noConflict=="function"&&(a.URITemplate=r.URITemplate.noConflict()),r.IPv6&&typeof r.IPv6.noConflict=="function"&&(a.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&typeof r.SecondLevelDomains.noConflict=="function"&&(a.SecondLevelDomains=r.SecondLevelDomains.noConflict()),a}else r.URI===this&&(r.URI=s);return this},u.build=function(i){return i===!0?this._deferred_build=!0:(i===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new o(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function J(i){return function(a,f){return a===void 0?this._parts[i]||"":(this._parts[i]=a||null,this.build(!f),this)}}function Se(i,a){return function(f,p){return f===void 0?this._parts[i]||"":(f!==null&&(f=f+"",f.charAt(0)===a&&(f=f.substring(1))),this._parts[i]=f,this.build(!p),this)}}u.protocol=J("protocol"),u.username=J("username"),u.password=J("password"),u.hostname=J("hostname"),u.port=J("port"),u.query=Se("query","?"),u.fragment=Se("fragment","#"),u.search=function(i,a){var f=this.query(i,a);return typeof f=="string"&&f.length?"?"+f:f},u.hash=function(i,a){var f=this.fragment(i,a);return typeof f=="string"&&f.length?"#"+f:f},u.pathname=function(i,a){if(i===void 0||i===!0){var f=this._parts.path||(this._parts.hostname?"/":"");return i?(this._parts.urn?o.decodeUrnPath:o.decodePath)(f):f}else return this._parts.urn?this._parts.path=i?o.recodeUrnPath(i):"":this._parts.path=i?o.recodePath(i):"/",this.build(!a),this},u.path=u.pathname,u.href=function(i,a){var f;if(i===void 0)return this.toString();this._string="",this._parts=o._parts();var p=i instanceof o,b=typeof i=="object"&&(i.hostname||i.path||i.pathname);if(i.nodeName){var S=o.getDomAttribute(i);i=i[S]||"",b=!1}if(!p&&b&&i.pathname!==void 0&&(i=i.toString()),typeof i=="string"||i instanceof String)this._parts=o.parse(String(i),this._parts);else if(p||b){var m=p?i._parts:i;for(f in m)f!=="query"&&d.call(this._parts,f)&&(this._parts[f]=m[f]);m.query&&this.query(m.query,!1)}else throw new TypeError("invalid input");return this.build(!a),this},u.is=function(i){var a=!1,f=!1,p=!1,b=!1,S=!1,m=!1,A=!1,P=!this._parts.urn;switch(this._parts.hostname&&(P=!1,f=o.ip4_expression.test(this._parts.hostname),p=o.ip6_expression.test(this._parts.hostname),a=f||p,b=!a,S=b&&n&&n.has(this._parts.hostname),m=b&&o.idn_expression.test(this._parts.hostname),A=b&&o.punycode_expression.test(this._parts.hostname)),i.toLowerCase()){case"relative":return P;case"absolute":return!P;case"domain":case"name":return b;case"sld":return S;case"ip":return a;case"ip4":case"ipv4":case"inet4":return f;case"ip6":case"ipv6":case"inet6":return p;case"idn":return m;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return A}return null};var qe=u.protocol,ye=u.port,ge=u.hostname;u.protocol=function(i,a){if(i&&(i=i.replace(/:(\/\/)?$/,""),!i.match(o.protocol_expression)))throw new TypeError('Protocol "'+i+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return qe.call(this,i,a)},u.scheme=u.protocol,u.port=function(i,a){return this._parts.urn?i===void 0?"":this:(i!==void 0&&(i===0&&(i=null),i&&(i+="",i.charAt(0)===":"&&(i=i.substring(1)),o.ensureValidPort(i))),ye.call(this,i,a))},u.hostname=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i!==void 0){var f={preventInvalidHostname:this._parts.preventInvalidHostname},p=o.parseHost(i,f);if(p!=="/")throw new TypeError('Hostname "'+i+'" contains characters other than [A-Z0-9.-]');i=f.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(i,this._parts.protocol)}return ge.call(this,i,a)},u.origin=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0){var f=this.protocol(),p=this.authority();return p?(f?f+"://":"")+this.authority():""}else{var b=o(i);return this.protocol(b.protocol()).authority(b.authority()).build(!a),this}},u.host=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var f=o.parseHost(i,this._parts);if(f!=="/")throw new TypeError('Hostname "'+i+'" contains characters other than [A-Z0-9.-]');return this.build(!a),this},u.authority=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var f=o.parseAuthority(i,this._parts);if(f!=="/")throw new TypeError('Hostname "'+i+'" contains characters other than [A-Z0-9.-]');return this.build(!a),this},u.userinfo=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0){var f=o.buildUserinfo(this._parts);return f&&f.substring(0,f.length-1)}else return i[i.length-1]!=="@"&&(i+="@"),o.parseUserinfo(i,this._parts),this.build(!a),this},u.resource=function(i,a){var f;return i===void 0?this.path()+this.search()+this.hash():(f=o.parse(i),this._parts.path=f.path,this._parts.query=f.query,this._parts.fragment=f.fragment,this.build(!a),this)},u.subdomain=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0){if(!this._parts.hostname||this.is("IP"))return"";var f=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,f)||""}else{var p=this._parts.hostname.length-this.domain().length,b=this._parts.hostname.substring(0,p),S=new RegExp("^"+w(b));if(i&&i.charAt(i.length-1)!=="."&&(i+="."),i.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return i&&o.ensureValidHostname(i,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(S,i),this.build(!a),this}},u.domain=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(typeof i=="boolean"&&(a=i,i=void 0),i===void 0){if(!this._parts.hostname||this.is("IP"))return"";var f=this._parts.hostname.match(/\./g);if(f&&f.length<2)return this._parts.hostname;var p=this._parts.hostname.length-this.tld(a).length-1;return p=this._parts.hostname.lastIndexOf(".",p-1)+1,this._parts.hostname.substring(p)||""}else{if(!i)throw new TypeError("cannot set domain empty");if(i.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(i,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=i;else{var b=new RegExp(w(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(b,i)}return this.build(!a),this}},u.tld=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(typeof i=="boolean"&&(a=i,i=void 0),i===void 0){if(!this._parts.hostname||this.is("IP"))return"";var f=this._parts.hostname.lastIndexOf("."),p=this._parts.hostname.substring(f+1);return a!==!0&&n&&n.list[p.toLowerCase()]&&n.get(this._parts.hostname)||p}else{var b;if(i)if(i.match(/[^a-zA-Z0-9-]/))if(n&&n.is(i))b=new RegExp(w(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(b,i);else throw new TypeError('TLD "'+i+'" 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");b=new RegExp(w(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(b,i)}else throw new TypeError("cannot set TLD empty");return this.build(!a),this}},u.directory=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0||i===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var f=this._parts.path.length-this.filename().length-1,p=this._parts.path.substring(0,f)||(this._parts.hostname?"/":"");return i?o.decodePath(p):p}else{var b=this._parts.path.length-this.filename().length,S=this._parts.path.substring(0,b),m=new RegExp("^"+w(S));return this.is("relative")||(i||(i="/"),i.charAt(0)!=="/"&&(i="/"+i)),i&&i.charAt(i.length-1)!=="/"&&(i+="/"),i=o.recodePath(i),this._parts.path=this._parts.path.replace(m,i),this.build(!a),this}},u.filename=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(typeof i!="string"){if(!this._parts.path||this._parts.path==="/")return"";var f=this._parts.path.lastIndexOf("/"),p=this._parts.path.substring(f+1);return i?o.decodePathSegment(p):p}else{var b=!1;i.charAt(0)==="/"&&(i=i.substring(1)),i.match(/\.?\//)&&(b=!0);var S=new RegExp(w(this.filename())+"$");return i=o.recodePath(i),this._parts.path=this._parts.path.replace(S,i),b?this.normalizePath(a):this.build(!a),this}},u.suffix=function(i,a){if(this._parts.urn)return i===void 0?"":this;if(i===void 0||i===!0){if(!this._parts.path||this._parts.path==="/")return"";var f=this.filename(),p=f.lastIndexOf("."),b,S;return p===-1?"":(b=f.substring(p+1),S=/^[a-z0-9%]+$/i.test(b)?b:"",i?o.decodePathSegment(S):S)}else{i.charAt(0)==="."&&(i=i.substring(1));var m=this.suffix(),A;if(m)i?A=new RegExp(w(m)+"$"):A=new RegExp(w("."+m)+"$");else{if(!i)return this;this._parts.path+="."+o.recodePath(i)}return A&&(i=o.recodePath(i),this._parts.path=this._parts.path.replace(A,i)),this.build(!a),this}},u.segment=function(i,a,f){var p=this._parts.urn?":":"/",b=this.path(),S=b.substring(0,1)==="/",m=b.split(p);if(i!==void 0&&typeof i!="number"&&(f=a,a=i,i=void 0),i!==void 0&&typeof i!="number")throw new Error('Bad segment "'+i+'", must be 0-based integer');if(S&&m.shift(),i<0&&(i=Math.max(m.length+i,0)),a===void 0)return i===void 0?m:m[i];if(i===null||m[i]===void 0)if(g(a)){m=[];for(var A=0,P=a.length;A<P;A++)!a[A].length&&(!m.length||!m[m.length-1].length)||(m.length&&!m[m.length-1].length&&m.pop(),m.push(R(a[A])))}else(a||typeof a=="string")&&(a=R(a),m[m.length-1]===""?m[m.length-1]=a:m.push(a));else a?m[i]=R(a):m.splice(i,1);return S&&m.unshift(""),this.path(m.join(p),f)},u.segmentCoded=function(i,a,f){var p,b,S;if(typeof i!="number"&&(f=a,a=i,i=void 0),a===void 0){if(p=this.segment(i,a,f),!g(p))p=p!==void 0?o.decode(p):void 0;else for(b=0,S=p.length;b<S;b++)p[b]=o.decode(p[b]);return p}if(!g(a))a=typeof a=="string"||a instanceof String?o.encode(a):a;else for(b=0,S=a.length;b<S;b++)a[b]=o.encode(a[b]);return this.segment(i,a,f)};var ae=u.query;return u.query=function(i,a){if(i===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof i=="function"){var f=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),p=i.call(this,f);return this._parts.query=o.buildQuery(p||f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!a),this}else return i!==void 0&&typeof i!="string"?(this._parts.query=o.buildQuery(i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!a),this):ae.call(this,i,a)},u.setQuery=function(i,a,f){var p=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof i=="string"||i instanceof String)p[i]=a!==void 0?a:null;else if(typeof i=="object")for(var b in i)d.call(i,b)&&(p[b]=i[b]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(p,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof i!="string"&&(f=a),this.build(!f),this},u.addQuery=function(i,a,f){var p=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(p,i,a===void 0?null:a),this._parts.query=o.buildQuery(p,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof i!="string"&&(f=a),this.build(!f),this},u.removeQuery=function(i,a,f){var p=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(p,i,a),this._parts.query=o.buildQuery(p,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof i!="string"&&(f=a),this.build(!f),this},u.hasQuery=function(i,a,f){var p=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(p,i,a,f)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.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()},u.normalizeProtocol=function(i){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!i)),this},u.normalizeHostname=function(i){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!i)),this},u.normalizePort=function(i){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!i)),this},u.normalizePath=function(i){var a=this._parts.path;if(!a)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!i),this;if(this._parts.path==="/")return this;a=o.recodePath(a);var f,p="",b,S;for(a.charAt(0)!=="/"&&(f=!0,a="/"+a),(a.slice(-3)==="/.."||a.slice(-2)==="/.")&&(a+="/"),a=a.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),f&&(p=a.substring(1).match(/^(\.\.\/)+/)||"",p&&(p=p[0]));b=a.search(/\/\.\.(\/|$)/),b!==-1;){if(b===0){a=a.substring(3);continue}S=a.substring(0,b).lastIndexOf("/"),S===-1&&(S=b),a=a.substring(0,S)+a.substring(b+3)}return f&&this.is("relative")&&(a=p+a.substring(1)),this._parts.path=a,this.build(!i),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(i){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!i)),this},u.normalizeFragment=function(i){return this._parts.fragment||(this._parts.fragment=null,this.build(!i)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var i=o.encode,a=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=i,o.decode=a}return this},u.unicode=function(){var i=o.encode,a=o.decode;o.encode=z,o.decode=unescape;try{this.normalize()}finally{o.encode=i,o.decode=a}return this},u.readable=function(){var i=this.clone();i.username("").password("").normalize();var a="";if(i._parts.protocol&&(a+=i._parts.protocol+"://"),i._parts.hostname&&(i.is("punycode")&&t?(a+=t.toUnicode(i._parts.hostname),i._parts.port&&(a+=":"+i._parts.port)):a+=i.host()),i._parts.hostname&&i._parts.path&&i._parts.path.charAt(0)!=="/"&&(a+="/"),a+=i.path(!0),i._parts.query){for(var f="",p=0,b=i._parts.query.split("&"),S=b.length;p<S;p++){var m=(b[p]||"").split("=");f+="&"+o.decodeQuery(m[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),m[1]!==void 0&&(f+="="+o.decodeQuery(m[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}a+="?"+f.substring(1)}return a+=o.decodeQuery(i.hash(),!0),a},u.absoluteTo=function(i){var a=this.clone(),f=["protocol","username","password","hostname","port"],p,b,S;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(i instanceof o||(i=new o(i)),a._parts.protocol||(a._parts.protocol=i._parts.protocol,this._parts.hostname))return a;for(b=0;S=f[b];b++)a._parts[S]=i._parts[S];return a._parts.path?(a._parts.path.substring(-2)===".."&&(a._parts.path+="/"),a.path().charAt(0)!=="/"&&(p=i.directory(),p=p||(i.path().indexOf("/")===0?"/":""),a._parts.path=(p?p+"/":"")+a._parts.path,a.normalizePath())):(a._parts.path=i._parts.path,a._parts.query||(a._parts.query=i._parts.query)),a.build(),a},u.relativeTo=function(i){var a=this.clone().normalize(),f,p,b,S,m;if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(i=new o(i).normalize(),f=a._parts,p=i._parts,S=a.path(),m=i.path(),S.charAt(0)!=="/")throw new Error("URI is already relative");if(m.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(f.protocol===p.protocol&&(f.protocol=null),f.username!==p.username||f.password!==p.password||f.protocol!==null||f.username!==null||f.password!==null)return a.build();if(f.hostname===p.hostname&&f.port===p.port)f.hostname=null,f.port=null;else return a.build();if(S===m)return f.path="",a.build();if(b=o.commonPath(S,m),!b)return a.build();var A=p.path.substring(b.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return f.path=A+f.path.substring(b.length)||"./",a.build()},u.equals=function(i){var a=this.clone(),f=new o(i),p={},b={},S={},m,A,P;if(a.normalize(),f.normalize(),a.toString()===f.toString())return!0;if(m=a.query(),A=f.query(),a.query(""),f.query(""),a.toString()!==f.toString()||m.length!==A.length)return!1;p=o.parseQuery(m,this._parts.escapeQuerySpace),b=o.parseQuery(A,this._parts.escapeQuerySpace);for(P in p)if(d.call(p,P)){if(g(p[P])){if(!I(p[P],b[P]))return!1}else if(p[P]!==b[P])return!1;S[P]=!0}for(P in b)if(d.call(b,P)&&!S[P])return!1;return!0},u.preventInvalidHostname=function(i){return this._parts.preventInvalidHostname=!!i,this},u.duplicateQueryParameters=function(i){return this._parts.duplicateQueryParameters=!!i,this},u.escapeQuerySpace=function(i){return this._parts.escapeQuerySpace=!!i,this},o})});function yn(t,e,n){n=n??!1;let r={},s=h(t),o=h(e),c,u,d;if(s)for(c in t)t.hasOwnProperty(c)&&(u=t[c],o&&n&&typeof u=="object"&&e.hasOwnProperty(c)?(d=e[c],typeof d=="object"?r[c]=yn(u,d,n):r[c]=u):r[c]=u);if(o)for(c in e)e.hasOwnProperty(c)&&!r.hasOwnProperty(c)&&(d=e[c],r[c]=d);return r}var Re=yn;function Er(t,e,n){l.defined("array",t),l.defined("itemToFind",e),l.defined("comparator",n);let r=0,s=t.length-1,o,c;for(;r<=s;){if(o=~~((r+s)/2),c=n(t[o],e),c<0){r=o+1;continue}if(c>0){s=o-1;continue}return o}return~(s+1)}var je=Er;function Tr(t,e,n,r,s){this.xPoleWander=t,this.yPoleWander=e,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=s}var rt=Tr;function xr(t){if(t===null||isNaN(t))throw new T("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}var ot=xr;var gn=[31,28,31,30,31,30,31,31,30,31,30,31];function Ar(t,e,n,r,s,o,c,u){t=t??1,e=e??1,n=n??1,r=r??0,s=s??0,o=o??0,c=c??0,u=u??!1,R(),D(),this.year=t,this.month=e,this.day=n,this.hour=r,this.minute=s,this.second=o,this.millisecond=c,this.isLeapSecond=u;function R(){l.typeOf.number.greaterThanOrEquals("Year",t,1),l.typeOf.number.lessThanOrEquals("Year",t,9999),l.typeOf.number.greaterThanOrEquals("Month",e,1),l.typeOf.number.lessThanOrEquals("Month",e,12),l.typeOf.number.greaterThanOrEquals("Day",n,1),l.typeOf.number.lessThanOrEquals("Day",n,31),l.typeOf.number.greaterThanOrEquals("Hour",r,0),l.typeOf.number.lessThanOrEquals("Hour",r,23),l.typeOf.number.greaterThanOrEquals("Minute",s,0),l.typeOf.number.lessThanOrEquals("Minute",s,59),l.typeOf.bool("IsLeapSecond",u),l.typeOf.number.greaterThanOrEquals("Second",o,0),l.typeOf.number.lessThanOrEquals("Second",o,u?60:59),l.typeOf.number.greaterThanOrEquals("Millisecond",c,0),l.typeOf.number.lessThan("Millisecond",c,1e3)}function D(){let z=e===2&&ot(t)?gn[e-1]+1:gn[e-1];if(n>z)throw new T("Month and Day represents invalid date")}}var yt=Ar;function Cr(t,e){this.julianDate=t,this.offset=e}var B=Cr;var wn={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};Object.freeze(wn);var W=wn;var bn={UTC:0,TAI:1};Object.freeze(bn);var q=bn;var On=new yt,gt=[31,28,31,30,31,30,31,31,30,31,30,31],wt=29;function Wt(t,e){return U.compare(t.julianDate,e.julianDate)}var $e=new B;function bt(t){$e.julianDate=t;let e=U.leapSeconds,n=je(e,$e,Wt);n<0&&(n=~n),n>=e.length&&(n=e.length-1);let r=e[n].offset;n>0&&U.secondsDifference(e[n].julianDate,t)>r&&(n--,r=e[n].offset),U.addSeconds(t,r,t)}function _n(t,e){$e.julianDate=t;let n=U.leapSeconds,r=je(n,$e,Wt);if(r<0&&(r=~r),r===0)return U.addSeconds(t,-n[0].offset,e);if(r>=n.length)return U.addSeconds(t,-n[r-1].offset,e);let s=U.secondsDifference(n[r].julianDate,t);if(s===0)return U.addSeconds(t,-n[r].offset,e);if(!(s<=1))return U.addSeconds(t,-n[r-1].offset,e)}function Pe(t,e,n){let r=e/W.SECONDS_PER_DAY|0;return t+=r,e-=W.SECONDS_PER_DAY*r,e<0&&(t--,e+=W.SECONDS_PER_DAY),n.dayNumber=t,n.secondsOfDay=e,n}function Ht(t,e,n,r,s,o,c){let u=(e-14)/12|0,d=t+4800+u,w=(1461*d/4|0)+(367*(e-2-12*u)/12|0)-(3*((d+100)/100|0)/4|0)+n-32075;r=r-12,r<0&&(r+=24);let y=o+(r*W.SECONDS_PER_HOUR+s*W.SECONDS_PER_MINUTE+c*W.SECONDS_PER_MILLISECOND);return y>=43200&&(w-=1),[w,y]}var Rr=/^(\d{4})$/,Pr=/^(\d{4})-(\d{2})$/,Ir=/^(\d{4})-?(\d{3})$/,Ur=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Mr=/^(\d{4})-?(\d{2})-?(\d{2})$/,$t=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Dr=/^(\d{2})(\.\d+)?/.source+$t.source,qr=/^(\d{2}):?(\d{2})(\.\d+)?/.source+$t.source,kr=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+$t.source,pe="Invalid ISO 8601 date.",U=class t{constructor(e,n,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,n=n??0,r=r??q.UTC;let s=e|0;n=n+(e-s)*W.SECONDS_PER_DAY,Pe(s,n,this),r===q.UTC&&bt(this)}static fromGregorianDate(e,n){if(!(e instanceof yt))throw new T("date must be a valid GregorianDate.");let r=Ht(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return h(n)?(Pe(r[0],r[1],n),bt(n),n):new t(r[0],r[1],q.UTC)}static fromDate(e,n){if(!(e instanceof Date)||isNaN(e.getTime()))throw new T("date must be a valid JavaScript Date.");let r=Ht(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return h(n)?(Pe(r[0],r[1],n),bt(n),n):new t(r[0],r[1],q.UTC)}static fromIso8601(e,n){if(typeof e!="string")throw new T(pe);e=e.replace(",",".");let r=e.split("T"),s,o=1,c=1,u=0,d=0,w=0,y=0,g=r[0],x=r[1],C,I;if(!h(g))throw new T(pe);let R;if(r=g.match(Mr),r!==null){if(R=g.split("-").length-1,R>0&&R!==2)throw new T(pe);s=+r[1],o=+r[2],c=+r[3]}else if(r=g.match(Pr),r!==null)s=+r[1],o=+r[2];else if(r=g.match(Rr),r!==null)s=+r[1];else{let j;if(r=g.match(Ir),r!==null){if(s=+r[1],j=+r[2],I=ot(s),j<1||I&&j>366||!I&&j>365)throw new T(pe)}else if(r=g.match(Ur),r!==null){s=+r[1];let Y=+r[2],Z=+r[3]||0;if(R=g.split("-").length-1,R>0&&(!h(r[3])&&R!==1||h(r[3])&&R!==2))throw new T(pe);let J=new Date(Date.UTC(s,0,4));j=Y*7+Z-J.getUTCDay()-3}else throw new T(pe);C=new Date(Date.UTC(s,0,1)),C.setUTCDate(j),o=C.getUTCMonth()+1,c=C.getUTCDate()}if(I=ot(s),o<1||o>12||c<1||(o!==2||!I)&&c>gt[o-1]||I&&o===2&&c>wt)throw new T(pe);let D;if(h(x)){if(r=x.match(kr),r!==null){if(R=x.split(":").length-1,R>0&&R!==2&&R!==3)throw new T(pe);u=+r[1],d=+r[2],w=+r[3],y=+(r[4]||0)*1e3,D=5}else if(r=x.match(qr),r!==null){if(R=x.split(":").length-1,R>2)throw new T(pe);u=+r[1],d=+r[2],w=+(r[3]||0)*60,D=4}else if(r=x.match(Dr),r!==null)u=+r[1],d=+(r[2]||0)*60,D=3;else throw new T(pe);if(d>=60||w>=61||u>24||u===24&&(d>0||w>0||y>0))throw new T(pe);let j=r[D],Y=+r[D+1],Z=+(r[D+2]||0);switch(j){case"+":u=u-Y,d=d-Z;break;case"-":u=u+Y,d=d+Z;break;case"Z":break;default:d=d+new Date(Date.UTC(s,o-1,c,u,d)).getTimezoneOffset();break}}let z=w===60;for(z&&w--;d>=60;)d-=60,u++;for(;u>=24;)u-=24,c++;for(C=I&&o===2?wt:gt[o-1];c>C;)c-=C,o++,o>12&&(o-=12,s++),C=I&&o===2?wt:gt[o-1];for(;d<0;)d+=60,u--;for(;u<0;)u+=24,c--;for(;c<1;)o--,o<1&&(o+=12,s--),C=I&&o===2?wt:gt[o-1],c+=C;let Q=Ht(s,o,c,u,d,w,y);return h(n)?(Pe(Q[0],Q[1],n),bt(n)):n=new t(Q[0],Q[1],q.UTC),z&&t.addSeconds(n,1,n),n}static now(e){return t.fromDate(new Date,e)}static toGregorianDate(e,n){if(!h(e))throw new T("julianDate is required.");let r=!1,s=_n(e,Ot);h(s)||(t.addSeconds(e,-1,Ot),s=_n(Ot,Ot),r=!0);let o=s.dayNumber,c=s.secondsOfDay;c>=43200&&(o+=1);let u=o+68569|0,d=4*u/146097|0;u=u-((146097*d+3)/4|0)|0;let w=4e3*(u+1)/1461001|0;u=u-(1461*w/4|0)+31|0;let y=80*u/2447|0,g=u-(2447*y/80|0)|0;u=y/11|0;let x=y+2-12*u|0,C=100*(d-49)+w+u|0,I=c/W.SECONDS_PER_HOUR|0,R=c-I*W.SECONDS_PER_HOUR,D=R/W.SECONDS_PER_MINUTE|0;R=R-D*W.SECONDS_PER_MINUTE;let z=R|0,Q=(R-z)/W.SECONDS_PER_MILLISECOND;return I+=12,I>23&&(I-=24),r&&(z+=1),h(n)?(n.year=C,n.month=x,n.day=g,n.hour=I,n.minute=D,n.second=z,n.millisecond=Q,n.isLeapSecond=r,n):new yt(C,x,g,I,D,z,Q,r)}static toDate(e){if(!h(e))throw new T("julianDate is required.");let n=t.toGregorianDate(e,On),r=n.second;return n.isLeapSecond&&(r-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,r,n.millisecond))}static toIso8601(e,n){if(!h(e))throw new T("julianDate is required.");let r=t.toGregorianDate(e,On),s=r.year,o=r.month,c=r.day,u=r.hour,d=r.minute,w=r.second,y=r.millisecond;s===1e4&&o===1&&c===1&&u===0&&d===0&&w===0&&y===0&&(s=9999,o=12,c=31,u=24);let g;if(!h(n)&&y!==0){let x=y*.01;return g=x<1e-6?x.toFixed(20).replace(".","").replace(/0+$/,""):x.toString().replace(".",""),`${s.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${c.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}.${g}Z`}return!h(n)||n===0?`${s.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${c.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}Z`:(g=(y*.01).toFixed(n).replace(".","").slice(0,n),`${s.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${c.toString().padStart(2,"0")}T${u.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}.${g}Z`)}static clone(e,n){if(h(e))return h(n)?(n.dayNumber=e.dayNumber,n.secondsOfDay=e.secondsOfDay,n):new t(e.dayNumber,e.secondsOfDay,q.TAI)}static compare(e,n){if(!h(e))throw new T("left is required.");if(!h(n))throw new T("right is required.");let r=e.dayNumber-n.dayNumber;return r!==0?r:e.secondsOfDay-n.secondsOfDay}static equals(e,n){return e===n||h(e)&&h(n)&&e.dayNumber===n.dayNumber&&e.secondsOfDay===n.secondsOfDay}static equalsEpsilon(e,n,r){return r=r??0,e===n||h(e)&&h(n)&&Math.abs(t.secondsDifference(e,n))<=r}static totalDays(e){if(!h(e))throw new T("julianDate is required.");return e.dayNumber+e.secondsOfDay/W.SECONDS_PER_DAY}static secondsDifference(e,n){if(!h(e))throw new T("left is required.");if(!h(n))throw new T("right is required.");return(e.dayNumber-n.dayNumber)*W.SECONDS_PER_DAY+(e.secondsOfDay-n.secondsOfDay)}static daysDifference(e,n){if(!h(e))throw new T("left is required.");if(!h(n))throw new T("right is required.");let r=e.dayNumber-n.dayNumber,s=(e.secondsOfDay-n.secondsOfDay)/W.SECONDS_PER_DAY;return r+s}static computeTaiMinusUtc(e){$e.julianDate=e;let n=t.leapSeconds,r=je(n,$e,Wt);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset}static addSeconds(e,n,r){if(!h(e))throw new T("julianDate is required.");if(!h(n))throw new T("seconds is required.");if(!h(r))throw new T("result is required.");return Pe(e.dayNumber,e.secondsOfDay+n,r)}static addMinutes(e,n,r){if(!h(e))throw new T("julianDate is required.");if(!h(n))throw new T("minutes is required.");if(!h(r))throw new T("result is required.");let s=e.secondsOfDay+n*W.SECONDS_PER_MINUTE;return Pe(e.dayNumber,s,r)}static addHours(e,n,r){if(!h(e))throw new T("julianDate is required.");if(!h(n))throw new T("hours is required.");if(!h(r))throw new T("result is required.");let s=e.secondsOfDay+n*W.SECONDS_PER_HOUR;return Pe(e.dayNumber,s,r)}static addDays(e,n,r){if(!h(e))throw new T("julianDate is required.");if(!h(n))throw new T("days is required.");if(!h(r))throw new T("result is required.");let s=e.dayNumber+n;return Pe(s,e.secondsOfDay,r)}static lessThan(e,n){return t.compare(e,n)<0}static lessThanOrEquals(e,n){return t.compare(e,n)<=0}static greaterThan(e,n){return t.compare(e,n)>0}static greaterThanOrEquals(e,n){return t.compare(e,n)>=0}clone(e){return t.clone(this,e)}equals(e){return t.equals(this,e)}equalsEpsilon(e,n){return t.equalsEpsilon(this,e,n)}toString(){return t.toIso8601(this)}},Ot=new U(0,0,q.TAI);U.leapSeconds=[new B(new U(2441317,43210,q.TAI),10),new B(new U(2441499,43211,q.TAI),11),new B(new U(2441683,43212,q.TAI),12),new B(new U(2442048,43213,q.TAI),13),new B(new U(2442413,43214,q.TAI),14),new B(new U(2442778,43215,q.TAI),15),new B(new U(2443144,43216,q.TAI),16),new B(new U(2443509,43217,q.TAI),17),new B(new U(2443874,43218,q.TAI),18),new B(new U(2444239,43219,q.TAI),19),new B(new U(2444786,43220,q.TAI),20),new B(new U(2445151,43221,q.TAI),21),new B(new U(2445516,43222,q.TAI),22),new B(new U(2446247,43223,q.TAI),23),new B(new U(2447161,43224,q.TAI),24),new B(new U(2447892,43225,q.TAI),25),new B(new U(2448257,43226,q.TAI),26),new B(new U(2448804,43227,q.TAI),27),new B(new U(2449169,43228,q.TAI),28),new B(new U(2449534,43229,q.TAI),29),new B(new U(2450083,43230,q.TAI),30),new B(new U(2450630,43231,q.TAI),31),new B(new U(2451179,43232,q.TAI),32),new B(new U(2453736,43233,q.TAI),33),new B(new U(2454832,43234,q.TAI),34),new B(new U(2456109,43235,q.TAI),35),new B(new U(2457204,43236,q.TAI),36),new B(new U(2457754,43237,q.TAI),37)];var K=U;var Kn=We(Ne(),1);function jr(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}var Cn=jr;function Rn(t,e){if(t===null||typeof t!="object")return t;e=e??!1;let n=new t.constructor;for(let r in t)if(t.hasOwnProperty(r)){let s=t[r];e&&(s=Rn(s,e)),n[r]=s}return n}var Xe=Rn;function Nr(){let t,e,n=new Promise(function(r,s){t=r,e=s});return{resolve:t,reject:e,promise:n}}var ze=Nr;var Pn=We(Ne(),1);function Vt(t,e){let n;return typeof document<"u"&&(n=document),Vt._implementation(t,e,n)}Vt._implementation=function(t,e,n){if(!h(t))throw new T("relative uri is required.");if(!h(e)){if(typeof n>"u")return t;e=n.baseURI??n.location.href}let r=new Pn.default(t);return r.scheme()!==""?r.toString():r.absoluteTo(e).toString()};var it=Vt;var In=We(Ne(),1);function zr(t,e){if(!h(t))throw new T("uri is required.");let n="",r=t.lastIndexOf("/");return r!==-1&&(n=t.substring(0,r+1)),e&&(t=new In.default(t),t.query().length!==0&&(n+=`?${t.query()}`),t.fragment().length!==0&&(n+=`#${t.fragment()}`)),n}var Un=zr;var Mn=We(Ne(),1);function Fr(t){if(!h(t))throw new T("uri is required.");let e=new Mn.default(t);e.normalize();let n=e.path(),r=n.lastIndexOf("/");return r!==-1&&(n=n.substr(r+1)),r=n.lastIndexOf("."),r===-1?n="":n=n.substr(r+1),n}var Dn=Fr;var qn={};function Lr(t,e,n){h(e)||(e=t.width),h(n)||(n=t.height);let r=qn[e];h(r)||(r={},qn[e]=r);let s=r[n];if(!h(s)){let o=document.createElement("canvas");o.width=e,o.height=n,s=o.getContext("2d",{willReadFrequently:!0}),s.globalCompositeOperation="copy",r[n]=s}return s.drawImage(t,0,0,e,n),s.getImageData(0,0,e,n).data}var Yt=Lr;var Br=/^blob:/i;function Qr(t){return l.typeOf.string("uri",t),Br.test(t)}var Et=Qr;var be;function Hr(t){h(be)||(be=document.createElement("a")),be.href=window.location.href;let e=be.host,n=be.protocol;return be.href=t,be.href=be.href,n!==be.protocol||e!==be.host}var kn=Hr;var Wr=/^data:/i;function $r(t){return l.typeOf.string("uri",t),Wr.test(t)}var Tt=$r;function Vr(t){let e=document.createElement("script");return e.async=!0,e.src=t,new Promise((n,r)=>{window.crossOriginIsolated&&e.setAttribute("crossorigin","anonymous");let s=document.getElementsByTagName("head")[0];e.onload=function(){e.onload=void 0,s.removeChild(e),n()},e.onerror=function(o){r(o)},s.appendChild(e)})}var jn=Vr;function Yr(t){if(!h(t))throw new T("obj is required.");let e="";for(let n in t)if(t.hasOwnProperty(n)){let r=t[n],s=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(let o=0,c=r.length;o<c;++o)e+=`${s+encodeURIComponent(r[o])}&`;else e+=`${s+encodeURIComponent(r)}&`}return e=e.slice(0,-1),e}var Nn=Yr;function Xr(t){if(!h(t))throw new T("queryString is required.");let e={};if(t==="")return e;let n=t.replace(/\+/g,"%20").split(/[&;]/);for(let r=0,s=n.length;r<s;++r){let o=n[r].split("="),c=decodeURIComponent(o[0]),u=o[1];h(u)?u=decodeURIComponent(u):u="";let d=e[c];typeof d=="string"?e[c]=[d,u]:Array.isArray(d)?d.push(u):e[c]=u}return e}var zn=Xr;var Fn={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Fn);var V=Fn;var Ln={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Ln);var Bn=Ln;function xt(t){t=t??we.EMPTY_OBJECT;let e=t.throttleByServer??!1,n=t.throttle??!1;this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=t.priority??0,this.throttle=n,this.throttleByServer=e,this.type=t.type??Bn.OTHER,this.serverKey=t.serverKey,this.state=V.UNISSUED,this.deferred=void 0,this.cancelled=!1}xt.prototype.cancel=function(){this.cancelled=!0};xt.prototype.clone=function(t){return h(t)?(t.url=this.url,t.requestFunction=this.requestFunction,t.cancelFunction=this.cancelFunction,t.priorityFunction=this.priorityFunction,t.priority=this.priority,t.throttle=this.throttle,t.throttleByServer=this.throttleByServer,t.type=this.type,t.serverKey=this.serverKey,t.state=V.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new xt(this)};var Qn=xt;function Zr(t){let e={};if(!t)return e;let n=t.split(`\r +`);for(let r=0;r<n.length;++r){let s=n[r],o=s.indexOf(": ");if(o>0){let c=s.substring(0,o),u=s.substring(o+2);e[c]=u}}return e}var Hn=Zr;function Wn(t,e,n){this.statusCode=t,this.response=e,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=Hn(this.responseHeaders))}Wn.prototype.toString=function(){let t="Request has failed.";return h(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};var st=Wn;var At=We(Ne(),1);function at(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(at.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});at.prototype.addEventListener=function(t,e){l.typeOf.func("listener",t);let n=this,r=n._invokingListeners?n._toAdd:n._listeners;return Zt(this,r,t,e)&&n._listenerCount++,function(){n.removeEventListener(t,e)}};function Zt(t,e,n,r){e.has(n)||e.set(n,new Set);let s=e.get(n);return s.has(r)?!1:(s.add(r),!0)}at.prototype.removeEventListener=function(t,e){l.typeOf.func("listener",t);let n=Xt(this,this._listeners,t,e),r=Xt(this,this._toAdd,t,e),s=n||r;return s&&this._listenerCount--,s};function Xt(t,e,n,r){let s=e.get(n);if(!s||!s.has(r))return!1;if(t._invokingListeners){if(!Zt(t,t._toRemove,n,r))return!1}else s.delete(r),s.size===0&&e.delete(n);return!0}at.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[t,e]of this._listeners.entries())if(h(t))for(let n of e)t.apply(n,arguments);this._invokingListeners=!1;for(let[t,e]of this._toAdd.entries())for(let n of e)Zt(this,this._listeners,t,n);this._toAdd.clear();for(let[t,e]of this._toRemove.entries())for(let n of e)Xt(this,this._listeners,t,n);this._toRemove.clear()};var $n=at;function Fe(t){l.typeOf.object("options",t),l.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Fe.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){l.typeOf.number.greaterThanOrEquals("maximumLength",t,0);let e=this._length;if(t<e){let n=this._array;for(let r=t;r<e;++r)n[r]=void 0;this._length=t,n.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Jt(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}Fe.prototype.reserve=function(t){t=t??this._length,this._array.length=t};Fe.prototype.heapify=function(t){t=t??0;let e=this._length,n=this._comparator,r=this._array,s,o=!0;for(;o;){let c=2*(t+1),u=c-1;u<e&&n(r[u],r[t])<0?s=u:s=t,c<e&&n(r[c],r[s])<0&&(s=c),s!==t?(Jt(r,s,t),t=s):o=!1}};Fe.prototype.resort=function(){let t=this._length;for(let e=Math.ceil(t/2);e>=0;--e)this.heapify(e)};Fe.prototype.insert=function(t){l.defined("element",t);let e=this._array,n=this._comparator,r=this._maximumLength,s=this._length++;for(s<e.length?e[s]=t:e.push(t);s!==0;){let c=Math.floor((s-1)/2);if(n(e[s],e[c])<0)Jt(e,s,c),s=c;else break}let o;return h(r)&&this._length>r&&(o=e[r],this._length=r),o};Fe.prototype.pop=function(t){if(t=t??0,this._length===0)return;l.typeOf.number.lessThan("index",t,this._length);let e=this._array,n=e[t];return Jt(e,t,--this._length),this.heapify(t),e[this._length]=void 0,n};var Vn=Fe;function Jr(t,e){return t.priority-e.priority}var L={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Ze=20,ne=new Vn({comparator:Jr});ne.maximumLength=Ze;ne.reserve(Ze);var Oe=[],Ee={},Gr=typeof document<"u"?new At.default(document.location.href):new At.default,Ct=new $n;function $(){}$.maximumRequests=50;$.maximumRequestsPerServer=18;$.requestsByServer={};$.throttleRequests=!0;$.debugShowStatistics=!1;$.requestCompletedEvent=Ct;Object.defineProperties($,{statistics:{get:function(){return L}},priorityHeapLength:{get:function(){return Ze},set:function(t){if(t<Ze)for(;ne.length>t;){let e=ne.pop();Le(e)}Ze=t,ne.maximumLength=t,ne.reserve(t)}}});function Yn(t){h(t.priorityFunction)&&(t.priority=t.priorityFunction())}$.serverHasOpenSlots=function(t,e){e=e??1;let n=$.requestsByServer[t]??$.maximumRequestsPerServer;return Ee[t]+e<=n};$.heapHasOpenSlots=function(t){return ne.length+t<=Ze};function Xn(t){return t.state===V.UNISSUED&&(t.state=V.ISSUED,t.deferred=ze()),t.deferred.promise}function Kr(t){return function(e){if(t.state===V.CANCELLED)return;let n=t.deferred;--L.numberOfActiveRequests,--Ee[t.serverKey],Ct.raiseEvent(),t.state=V.RECEIVED,t.deferred=void 0,n.resolve(e)}}function eo(t){return function(e){t.state!==V.CANCELLED&&(++L.numberOfFailedRequests,--L.numberOfActiveRequests,--Ee[t.serverKey],Ct.raiseEvent(e),t.state=V.FAILED,t.deferred.reject(e))}}function Zn(t){let e=Xn(t);return t.state=V.ACTIVE,Oe.push(t),++L.numberOfActiveRequests,++L.numberOfActiveRequestsEver,++Ee[t.serverKey],t.requestFunction().then(Kr(t)).catch(eo(t)),e}function Le(t){let e=t.state===V.ACTIVE;if(t.state=V.CANCELLED,++L.numberOfCancelledRequests,h(t.deferred)){let n=t.deferred;n.promise.catch(()=>{}),t.deferred=void 0,n.reject(new de(`Request cancelled: "${t.url}"`))}e&&(--L.numberOfActiveRequests,--Ee[t.serverKey],++L.numberOfCancelledActiveRequests),h(t.cancelFunction)&&t.cancelFunction()}$.update=function(){let t,e,n=0,r=Oe.length;for(t=0;t<r;++t){if(e=Oe[t],e.cancelled&&Le(e),e.state!==V.ACTIVE){++n;continue}n>0&&(Oe[t-n]=e)}Oe.length-=n;let s=ne.internalArray,o=ne.length;for(t=0;t<o;++t)Yn(s[t]);ne.resort();let c=Math.max($.maximumRequests-Oe.length,0),u=0;for(;u<c&&ne.length>0;){if(e=ne.pop(),e.cancelled){Le(e);continue}if(e.throttleByServer&&!$.serverHasOpenSlots(e.serverKey)){Le(e);continue}Zn(e),++u}to()};$.getServerKey=function(t){l.typeOf.string("url",t);let e=new At.default(t);e.scheme()===""&&(e=e.absoluteTo(Gr),e.normalize());let n=e.authority();/:/.test(n)||(n=`${n}:${e.scheme()==="https"?"443":"80"}`);let r=Ee[n];return h(r)||(Ee[n]=0),n};$.request=function(t){if(l.typeOf.object("request",t),l.typeOf.string("request.url",t.url),l.typeOf.func("request.requestFunction",t.requestFunction),Tt(t.url)||Et(t.url))return Ct.raiseEvent(),t.state=V.RECEIVED,t.requestFunction();if(++L.numberOfAttemptedRequests,h(t.serverKey)||(t.serverKey=$.getServerKey(t.url)),$.throttleRequests&&t.throttleByServer&&!$.serverHasOpenSlots(t.serverKey))return;if(!$.throttleRequests||!t.throttle)return Zn(t);if(Oe.length>=$.maximumRequests)return;Yn(t);let e=ne.insert(t);if(h(e)){if(e===t)return;Le(e)}return Xn(t)};function to(){$.debugShowStatistics&&(L.numberOfActiveRequests===0&&L.lastNumberOfActiveRequests>0&&(L.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${L.numberOfAttemptedRequests}`),L.numberOfAttemptedRequests=0),L.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${L.numberOfCancelledRequests}`),L.numberOfCancelledRequests=0),L.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${L.numberOfCancelledActiveRequests}`),L.numberOfCancelledActiveRequests=0),L.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${L.numberOfFailedRequests}`),L.numberOfFailedRequests=0)),L.lastNumberOfActiveRequests=L.numberOfActiveRequests)}$.clearForSpecs=function(){for(;ne.length>0;){let e=ne.pop();Le(e)}let t=Oe.length;for(let e=0;e<t;++e)Le(Oe[e]);Oe.length=0,Ee={},L.numberOfAttemptedRequests=0,L.numberOfActiveRequests=0,L.numberOfCancelledRequests=0,L.numberOfCancelledActiveRequests=0,L.numberOfFailedRequests=0,L.numberOfActiveRequestsEver=0,L.lastNumberOfActiveRequests=0};$.numberOfActiveRequestsByServer=function(t){return Ee[t]};$.requestHeap=ne;var Rt=$;var Jn=We(Ne(),1);var ct={},Je={};ct.add=function(t,e){if(!h(t))throw new T("host is required.");if(!h(e)||e<=0)throw new T("port is required to be greater than 0.");let n=`${t.toLowerCase()}:${e}`;h(Je[n])||(Je[n]=!0)};ct.remove=function(t,e){if(!h(t))throw new T("host is required.");if(!h(e)||e<=0)throw new T("port is required to be greater than 0.");let n=`${t.toLowerCase()}:${e}`;h(Je[n])&&delete Je[n]};function no(t){let e=new Jn.default(t);e.normalize();let n=e.authority();if(n.length!==0){if(e.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let r=e.scheme();if(r.length===0&&(r=window.location.protocol,r=r.substring(0,r.length-1)),r==="http")n+=":80";else if(r==="https")n+=":443";else return}return n}}ct.contains=function(t){if(!h(t))throw new T("url is required.");let e=no(t);return!!(h(e)&&h(Je[e]))};ct.clear=function(){Je={}};var Gt=ct;var er=(function(){try{let t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}})();function E(t){t=t??we.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),l.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=_e(t.templateValues,{}),this._queryParameters=_e(t.queryParameters,{}),this.headers=_e(t.headers,{}),this.request=t.request??new Qn,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function _e(t,e){return h(t)?Xe(t):e}E.createIfNeeded=function(t){return t instanceof E?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new E({url:t})};var Ge;E.supportsImageBitmapOptions=function(){return h(Ge)?Ge:typeof createImageBitmap!="function"?(Ge=Promise.resolve(!1),Ge):(Ge=E.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(e){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(e,n),createImageBitmap(e)])}).then(function(e){let n=Yt(e[0]),r=Yt(e[1]);return n[1]!==r[1]}).catch(function(){return!1}),Ge)};Object.defineProperties(E,{isBlobSupported:{get:function(){return er}}});Object.defineProperties(E.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return Dn(this._url)}},isDataUri:{get:function(){return Tt(this._url)}},isBlobUri:{get:function(){return Et(this._url)}},isCrossOriginUrl:{get:function(){return kn(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});E.prototype.toString=function(){return this.getUrlComponent(!0,!0)};E.prototype.parseUrl=function(t,e,n,r){let s=new Kn.default(t),o=ro(s.query());this._queryParameters=e?It(o,this.queryParameters,n):o,s.search(""),s.fragment(""),h(r)&&s.scheme()===""&&(s=s.absoluteTo(it(r))),this._url=s.toString()};function ro(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:zn(t)}function It(t,e,n){if(!n)return Re(t,e);let r=Xe(t,!0);for(let s in e)if(e.hasOwnProperty(s)){let o=r[s],c=e[s];h(o)?(Array.isArray(o)||(o=r[s]=[o]),r[s]=o.concat(c)):r[s]=Array.isArray(c)?c.slice():c}return r}E.prototype.getUrlComponent=function(t,e){if(this.isDataUri)return this._url;let n=this._url;t&&(n=`${n}${oo(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let r=this._templateValues;return Object.keys(r).length>0&&(n=n.replace(/{(.*?)}/g,function(s,o){let c=r[o];return h(c)?encodeURIComponent(c):s})),e&&h(this.proxy)&&(n=this.proxy.getURL(n)),n};function oo(t){let e=Object.keys(t);return e.length===0?"":e.length===1&&!h(t[e[0]])?`?${e[0]}`:`?${Nn(t)}`}E.prototype.setQueryParameters=function(t,e){e?this._queryParameters=It(this._queryParameters,t,!1):this._queryParameters=It(t,this._queryParameters,!1)};E.prototype.appendQueryParameters=function(t){this._queryParameters=It(t,this._queryParameters,!0)};E.prototype.setTemplateValues=function(t,e){e?this._templateValues=Re(this._templateValues,t):this._templateValues=Re(t,this._templateValues)};E.prototype.getDerivedResource=function(t){let e=this.clone();if(e._retryCount=0,h(t.url)){let n=t.preserveQueryParameters??!1;e.parseUrl(t.url,!0,n,this._url)}return h(t.queryParameters)&&(e._queryParameters=Re(t.queryParameters,e.queryParameters)),h(t.templateValues)&&(e._templateValues=Re(t.templateValues,e.templateValues)),h(t.headers)&&(e.headers=Re(t.headers,e.headers)),h(t.proxy)&&(e.proxy=t.proxy),h(t.request)&&(e.request=t.request),h(t.retryCallback)&&(e.retryCallback=t.retryCallback),h(t.retryAttempts)&&(e.retryAttempts=t.retryAttempts),e};E.prototype.retryOnError=function(t){let e=this.retryCallback;if(typeof e!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(e(this,t)).then(function(r){return++n._retryCount,r})};E.prototype.clone=function(t){return h(t)?(t._url=this._url,t._queryParameters=Xe(this._queryParameters),t._templateValues=Xe(this._templateValues),t.headers=Xe(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new E({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:h(this.credits)?this.credits.slice():void 0})};E.prototype.getBaseUri=function(t){return Un(this.getUrlComponent(t),t)};E.prototype.appendForwardSlash=function(){this._url=Cn(this._url)};E.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};E.fetchArrayBuffer=function(t){return new E(t).fetchArrayBuffer()};E.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};E.fetchBlob=function(t){return new E(t).fetchBlob()};E.prototype.fetchImage=function(t){t=t??we.EMPTY_OBJECT;let e=t.preferImageBitmap??!1,n=t.preferBlob??!1,r=t.flipY??!1,s=t.skipColorSpaceConversion??!1;if(Kt(this.request),!er||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:r,skipColorSpaceConversion:s,preferImageBitmap:e});let o=this.fetchBlob();if(!h(o))return;let c,u,d,w;return E.supportsImageBitmapOptions().then(function(y){return c=y,u=c&&e,o}).then(function(y){if(!h(y))return;if(w=y,u)return E.createImageBitmapFromBlob(y,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:s});let g=window.URL.createObjectURL(y);return d=new E({url:g}),d._fetchImage({flipY:r,skipColorSpaceConversion:s,preferImageBitmap:!1})}).then(function(y){if(h(y))return y.blob=w,u||window.URL.revokeObjectURL(d.url),y}).catch(function(y){return h(d)&&window.URL.revokeObjectURL(d.url),y.blob=w,Promise.reject(y)})};E.prototype._fetchImage=function(t){let e=this,n=t.flipY,r=t.skipColorSpaceConversion,s=t.preferImageBitmap,o=e.request;o.url=e.url,o.requestFunction=function(){let u=!1;!e.isDataUri&&!e.isBlobUri&&(u=e.isCrossOriginUrl);let d=ze();return E._Implementations.createImage(o,u,d,n,r,s),d.promise};let c=Rt.request(o);if(h(c))return c.catch(function(u){return o.state!==V.FAILED?Promise.reject(u):e.retryOnError(u).then(function(d){return d?(o.state=V.UNISSUED,o.deferred=void 0,e._fetchImage({flipY:n,skipColorSpaceConversion:r,preferImageBitmap:s})):Promise.reject(u)})})};E.fetchImage=function(t){return new E(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})};E.prototype.fetchText=function(){return this.fetch({responseType:"text"})};E.fetchText=function(t){return new E(t).fetchText()};E.prototype.fetchJson=function(){let t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(h(t))return t.then(function(e){if(h(e))return JSON.parse(e)})};E.fetchJson=function(t){return new E(t).fetchJson()};E.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};E.fetchXML=function(t){return new E(t).fetchXML()};E.prototype.fetchJsonp=function(t){t=t??"callback",Kt(this.request);let e;do e=`loadJsonp${_.nextRandomNumber().toString().substring(2,8)}`;while(h(window[e]));return tr(this,t,e)};function tr(t,e,n){let r={};r[e]=n,t.setQueryParameters(r);let s=t.request,o=t.url;s.url=o,s.requestFunction=function(){let u=ze();return window[n]=function(d){u.resolve(d);try{delete window[n]}catch{window[n]=void 0}},E._Implementations.loadAndExecuteScript(o,n,u),u.promise};let c=Rt.request(s);if(h(c))return c.catch(function(u){return s.state!==V.FAILED?Promise.reject(u):t.retryOnError(u).then(function(d){return d?(s.state=V.UNISSUED,s.deferred=void 0,tr(t,e,n)):Promise.reject(u)})})}E.fetchJsonp=function(t){return new E(t).fetchJsonp(t.callbackParameterName)};E.prototype._makeRequest=function(t){let e=this;Kt(e.request);let n=e.request,r=e.url;n.url=r,n.requestFunction=function(){let o=t.responseType,c=Re(t.headers,e.headers),u=t.overrideMimeType,d=t.method,w=t.data,y=ze(),g=E._Implementations.loadWithXhr(r,o,d,w,c,y,u);return h(g)&&h(g.abort)&&(n.cancelFunction=function(){g.abort()}),y.promise};let s=Rt.request(n);if(h(s))return s.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==V.FAILED?Promise.reject(o):e.retryOnError(o).then(function(c){return c?(n.state=V.UNISSUED,n.deferred=void 0,e.fetch(t)):Promise.reject(o)})})};function Kt(t){if(t.state===V.ISSUED||t.state===V.ACTIVE)throw new de("The Resource is already being fetched.");t.state=V.UNISSUED,t.deferred=void 0}var io=/^data:(.*?)(;base64)?,(.*)$/;function Pt(t,e){let n=decodeURIComponent(e);return t?atob(n):n}function Gn(t,e){let n=Pt(t,e),r=new ArrayBuffer(n.length),s=new Uint8Array(r);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return r}function so(t,e){e=e??"";let n=t[1],r=!!t[2],s=t[3],o,c;switch(e){case"":case"text":return Pt(r,s);case"arraybuffer":return Gn(r,s);case"blob":return o=Gn(r,s),new Blob([o],{type:n});case"document":return c=new DOMParser,c.parseFromString(Pt(r,s),n);case"json":return JSON.parse(Pt(r,s));default:throw new T(`Unhandled responseType: ${e}`)}}E.prototype.fetch=function(t){return t=_e(t,{}),t.method="GET",this._makeRequest(t)};E.fetch=function(t){return new E(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})};E.prototype.delete=function(t){return t=_e(t,{}),t.method="DELETE",this._makeRequest(t)};E.delete=function(t){return new E(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})};E.prototype.head=function(t){return t=_e(t,{}),t.method="HEAD",this._makeRequest(t)};E.head=function(t){return new E(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})};E.prototype.options=function(t){return t=_e(t,{}),t.method="OPTIONS",this._makeRequest(t)};E.options=function(t){return new E(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})};E.prototype.post=function(t,e){return l.defined("data",t),e=_e(e,{}),e.method="POST",e.data=t,this._makeRequest(e)};E.post=function(t){return new E(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})};E.prototype.put=function(t,e){return l.defined("data",t),e=_e(e,{}),e.method="PUT",e.data=t,this._makeRequest(e)};E.put=function(t){return new E(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})};E.prototype.patch=function(t,e){return l.defined("data",t),e=_e(e,{}),e.method="PATCH",e.data=t,this._makeRequest(e)};E.patch=function(t){return new E(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})};E._Implementations={};E._Implementations.loadImageElement=function(t,e,n){let r=new Image;r.onload=function(){r.naturalWidth===0&&r.naturalHeight===0&&r.width===0&&r.height===0&&(r.width=300,r.height=150),n.resolve(r)},r.onerror=function(s){n.reject(s)},e&&(Gt.contains(t)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=t};E._Implementations.createImage=function(t,e,n,r,s,o,c){let u=t.url;E.supportsImageBitmapOptions().then(function(d){if(!(d&&o)){E._Implementations.loadImageElement(u,e,n);return}let w="blob",y="GET",g=ze(),x=E._Implementations.loadWithXhr(u,w,y,void 0,c,g,void 0,void 0,void 0);return h(x)&&h(x.abort)&&(t.cancelFunction=function(){x.abort()}),g.promise.then(function(C){if(!h(C)){n.reject(new de(`Successfully retrieved ${u} but it contained no content.`));return}return E.createImageBitmapFromBlob(C,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:s})}).then(function(C){n.resolve(C)})}).catch(function(d){n.reject(d)})};E.createImageBitmapFromBlob=function(t,e){return l.defined("options",e),l.typeOf.bool("options.flipY",e.flipY),l.typeOf.bool("options.premultiplyAlpha",e.premultiplyAlpha),l.typeOf.bool("options.skipColorSpaceConversion",e.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:e.flipY?"flipY":"none",premultiplyAlpha:e.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:e.skipColorSpaceConversion?"none":"default"})};function ao(t,e,n,r,s,o,c){fetch(t,{method:n,headers:s}).then(async u=>{if(!u.ok){let d={};u.headers.forEach((w,y)=>{d[y]=w}),o.reject(new st(u.status,u,d));return}switch(e){case"text":o.resolve(u.text());break;case"json":o.resolve(u.json());break;default:o.resolve(new Uint8Array(await u.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new st)})}var co=typeof XMLHttpRequest>"u";E._Implementations.loadWithXhr=function(t,e,n,r,s,o,c){let u=io.exec(t);if(u!==null){o.resolve(so(u,e));return}if(co){ao(t,e,n,r,s,o,c);return}let d=new XMLHttpRequest;if(Gt.contains(t)&&(d.withCredentials=!0),d.open(n,t,!0),h(c)&&h(d.overrideMimeType)&&d.overrideMimeType(c),h(s))for(let y in s)s.hasOwnProperty(y)&&d.setRequestHeader(y,s[y]);h(e)&&(d.responseType=e);let w=!1;return typeof t=="string"&&(w=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),d.onload=function(){if((d.status<200||d.status>=300)&&!(w&&d.status===0)){o.reject(new st(d.status,d.response,d.getAllResponseHeaders()));return}let y=d.response,g=d.responseType;if(n==="HEAD"||n==="OPTIONS"){let C=d.getAllResponseHeaders().trim().split(/[\r\n]+/),I={};C.forEach(function(R){let D=R.split(": "),z=D.shift();I[z]=D.join(": ")}),o.resolve(I);return}if(d.status===204)o.resolve(void 0);else if(h(y)&&(!h(e)||g===e))o.resolve(y);else if(e==="json"&&typeof y=="string")try{o.resolve(JSON.parse(y))}catch(x){o.reject(x)}else(g===""||g==="document")&&h(d.responseXML)&&d.responseXML.hasChildNodes()?o.resolve(d.responseXML):(g===""||g==="text")&&h(d.responseText)?o.resolve(d.responseText):o.reject(new de("Invalid XMLHttpRequest response type."))},d.onerror=function(y){o.reject(new st)},d.send(r),d};E._Implementations.loadAndExecuteScript=function(t,e,n){return jn(t,e).catch(function(r){n.reject(r)})};E._DefaultImplementations={};E._DefaultImplementations.createImage=E._Implementations.createImage;E._DefaultImplementations.loadWithXhr=E._Implementations.loadWithXhr;E._DefaultImplementations.loadAndExecuteScript=E._Implementations.loadAndExecuteScript;E.DEFAULT=Object.freeze(new E({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ie=E;function ft(t){t=t??we.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=t.addNewLeapSeconds??!0,h(t.data)?nr(this,t.data):nr(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}ft.fromUrl=async function(t,e){l.defined("url",t),e=e??we.EMPTY_OBJECT;let n=Ie.createIfNeeded(t),r;try{r=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new ft({addNewLeapSeconds:e.addNewLeapSeconds,data:r})};ft.NONE=Object.freeze({compute:function(t,e){return h(e)?(e.xPoleWander=0,e.yPoleWander=0,e.xPoleOffset=0,e.yPoleOffset=0,e.ut1MinusUtc=0):e=new rt(0,0,0,0,0),e}});ft.prototype.compute=function(t,e){if(!h(this._samples))return;if(h(e)||(e=new rt(0,0,0,0,0)),this._samples.length===0)return e.xPoleWander=0,e.yPoleWander=0,e.xPoleOffset=0,e.yPoleOffset=0,e.ut1MinusUtc=0,e;let n=this._dates,r=this._lastIndex,s,o;if(h(r)){let u=n[r],d=n[r+1],w=K.lessThanOrEquals(u,t),y=!h(d),g=y||K.greaterThanOrEquals(d,t);if(w&&g)return s=r,!y&&d.equals(t)&&++s,o=s+1,or(this,n,this._samples,t,s,o,e),e}let c=je(n,t,K.compare,this._dateColumn);return c>=0?(c<n.length-1&&n[c+1].equals(t)&&++c,s=c,o=c):(o=~c,s=o-1,s<0&&(s=0)),this._lastIndex=s,or(this,n,this._samples,t,s,o,e),e};function uo(t,e){return K.compare(t.julianDate,e)}function nr(t,e){if(!h(e.columnNames))throw new de("Error in loaded EOP data: The columnNames property is required.");if(!h(e.samples))throw new de("Error in loaded EOP data: The samples property is required.");let n=e.columnNames.indexOf("modifiedJulianDateUtc"),r=e.columnNames.indexOf("xPoleWanderRadians"),s=e.columnNames.indexOf("yPoleWanderRadians"),o=e.columnNames.indexOf("ut1MinusUtcSeconds"),c=e.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=e.columnNames.indexOf("yCelestialPoleOffsetRadians"),d=e.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||r<0||s<0||o<0||c<0||u<0||d<0)throw new de("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let w=t._samples=e.samples,y=t._dates=[];t._dateColumn=n,t._xPoleWanderRadiansColumn=r,t._yPoleWanderRadiansColumn=s,t._ut1MinusUtcSecondsColumn=o,t._xCelestialPoleOffsetRadiansColumn=c,t._yCelestialPoleOffsetRadiansColumn=u,t._taiMinusUtcSecondsColumn=d,t._columnCount=e.columnNames.length,t._lastIndex=void 0;let g,x=t._addNewLeapSeconds;for(let C=0,I=w.length;C<I;C+=t._columnCount){let R=w[C+n],D=w[C+d],z=R+W.MODIFIED_JULIAN_DATE_DIFFERENCE,Q=new K(z,D,q.TAI);if(y.push(Q),x){if(D!==g&&h(g)){let j=K.leapSeconds,Y=je(j,Q,uo);if(Y<0){let Z=new B(Q,D);j.splice(~Y,0,Z)}}g=D}}}function rr(t,e,n,r,s){let o=n*r;s.xPoleWander=e[o+t._xPoleWanderRadiansColumn],s.yPoleWander=e[o+t._yPoleWanderRadiansColumn],s.xPoleOffset=e[o+t._xCelestialPoleOffsetRadiansColumn],s.yPoleOffset=e[o+t._yCelestialPoleOffsetRadiansColumn],s.ut1MinusUtc=e[o+t._ut1MinusUtcSecondsColumn]}function ut(t,e,n){return e+t*(n-e)}function or(t,e,n,r,s,o,c){let u=t._columnCount;if(o>e.length-1)return c.xPoleWander=0,c.yPoleWander=0,c.xPoleOffset=0,c.yPoleOffset=0,c.ut1MinusUtc=0,c;let d=e[s],w=e[o];if(d.equals(w)||r.equals(d))return rr(t,n,s,u,c),c;if(r.equals(w))return rr(t,n,o,u,c),c;let y=K.secondsDifference(r,d)/K.secondsDifference(w,d),g=s*u,x=o*u,C=n[g+t._ut1MinusUtcSecondsColumn],I=n[x+t._ut1MinusUtcSecondsColumn],R=I-C;if(R>.5||R<-.5){let D=n[g+t._taiMinusUtcSecondsColumn],z=n[x+t._taiMinusUtcSecondsColumn];D!==z&&(w.equals(r)?C=I:I-=z-D)}return c.xPoleWander=ut(y,n[g+t._xPoleWanderRadiansColumn],n[x+t._xPoleWanderRadiansColumn]),c.yPoleWander=ut(y,n[g+t._yPoleWanderRadiansColumn],n[x+t._yPoleWanderRadiansColumn]),c.xPoleOffset=ut(y,n[g+t._xCelestialPoleOffsetRadiansColumn],n[x+t._xCelestialPoleOffsetRadiansColumn]),c.yPoleOffset=ut(y,n[g+t._yCelestialPoleOffsetRadiansColumn],n[x+t._yCelestialPoleOffsetRadiansColumn]),c.ut1MinusUtc=ut(y,C,I),c}var ir=ft;function re(t,e,n){this.heading=t??0,this.pitch=e??0,this.roll=n??0}re.fromQuaternion=function(t,e){if(!h(t))throw new T("quaternion is required");h(e)||(e=new re);let n=2*(t.w*t.y-t.z*t.x),r=1-2*(t.x*t.x+t.y*t.y),s=2*(t.w*t.x+t.y*t.z),o=1-2*(t.y*t.y+t.z*t.z),c=2*(t.w*t.z+t.x*t.y);return e.heading=-Math.atan2(c,o),e.roll=Math.atan2(s,r),e.pitch=-_.asinClamped(n),e};re.fromDegrees=function(t,e,n,r){if(!h(t))throw new T("heading is required");if(!h(e))throw new T("pitch is required");if(!h(n))throw new T("roll is required");return h(r)||(r=new re),r.heading=t*_.RADIANS_PER_DEGREE,r.pitch=e*_.RADIANS_PER_DEGREE,r.roll=n*_.RADIANS_PER_DEGREE,r};re.clone=function(t,e){if(h(t))return h(e)?(e.heading=t.heading,e.pitch=t.pitch,e.roll=t.roll,e):new re(t.heading,t.pitch,t.roll)};re.equals=function(t,e){return t===e||h(t)&&h(e)&&t.heading===e.heading&&t.pitch===e.pitch&&t.roll===e.roll};re.equalsEpsilon=function(t,e,n,r){return t===e||h(t)&&h(e)&&_.equalsEpsilon(t.heading,e.heading,n,r)&&_.equalsEpsilon(t.pitch,e.pitch,n,r)&&_.equalsEpsilon(t.roll,e.roll,n,r)};re.prototype.clone=function(t){return re.clone(this,t)};re.prototype.equals=function(t){return re.equals(this,t)};re.prototype.equalsEpsilon=function(t,e,n){return re.equalsEpsilon(this,t,e,n)};re.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ut=re;var sr=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function fo(){let t=document.getElementsByTagName("script");for(let e=0,n=t.length;e<n;++e){let r=t[e].getAttribute("src"),s=sr.exec(r);if(s!==null)return s[1]}}var Mt;function ar(t){return typeof document>"u"?t:(h(Mt)||(Mt=document.createElement("a")),Mt.href=t,Mt.href)}var Be;function cr(){if(h(Be))return Be;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:h(import.meta?.url)?t=it(".",import.meta.url):typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(dt.toUrl)?t=it("..",Qe("Core/buildModuleUrl.js")):t=fo(),!h(t))throw new T("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Be=new Ie({url:ar(t)}),Be.appendForwardSlash(),Be}function ho(t){return ar(dt.toUrl(`../${t}`))}function ur(t){return cr().getDerivedResource({url:t}).url}var Dt;function Qe(t){return h(Dt)||(typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(dt.toUrl)?Dt=ho:Dt=ur),Dt(t)}Qe._cesiumScriptRegex=sr;Qe._buildModuleUrlFromBaseUrl=ur;Qe._clearBaseResource=function(){Be=void 0};Qe.setBaseUrl=function(t){Be=Ie.DEFAULT.getDerivedResource({url:t})};Qe.getCesiumBaseUrl=cr;var fr=Qe;function lo(t,e,n){this.x=t,this.y=e,this.s=n}var qt=lo;function kt(t){t=t??we.EMPTY_OBJECT,this._xysFileUrlTemplate=Ie.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,q.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let e=this._interpolationOrder,n=this._denominators=new Array(e+1),r=this._xTable=new Array(e+1),s=Math.pow(this._stepSizeDays,e);for(let o=0;o<=e;++o){n[o]=s,r[o]=o*this._stepSizeDays;for(let c=0;c<=e;++c)c!==o&&(n[o]*=o-c);n[o]=1/n[o]}this._work=new Array(e+1),this._coef=new Array(e+1)}var po=new K(0,0,q.TAI);function en(t,e,n){let r=po;return r.dayNumber=e,r.secondsOfDay=n,K.daysDifference(r,t._sampleZeroDateTT)}kt.prototype.preload=function(t,e,n,r){let s=en(this,t,e),o=en(this,n,r),c=s/this._stepSizeDays-this._interpolationOrder/2|0;c<0&&(c=0);let u=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);let d=c/this._samplesPerXysFile|0,w=u/this._samplesPerXysFile|0,y=[];for(let g=d;g<=w;++g)y.push(tn(this,g));return Promise.all(y)};kt.prototype.computeXysRadians=function(t,e,n){let r=en(this,t,e);if(r<0)return;let s=r/this._stepSizeDays|0;if(s>=this._totalSamples)return;let o=this._interpolationOrder,c=s-(o/2|0);c<0&&(c=0);let u=c+o;u>=this._totalSamples&&(u=this._totalSamples-1,c=u-o,c<0&&(c=0));let d=!1,w=this._samples;if(h(w[c*3])||(tn(this,c/this._samplesPerXysFile|0),d=!0),h(w[u*3])||(tn(this,u/this._samplesPerXysFile|0),d=!0),d)return;h(n)?(n.x=0,n.y=0,n.s=0):n=new qt(0,0,0);let y=r-c*this._stepSizeDays,g=this._work,x=this._denominators,C=this._coef,I=this._xTable,R,D;for(R=0;R<=o;++R)g[R]=y-I[R];for(R=0;R<=o;++R){for(C[R]=1,D=0;D<=o;++D)D!==R&&(C[R]*=g[D]);C[R]*=x[R];let z=(c+R)*3;n.x+=C[R]*w[z++],n.y+=C[R]*w[z++],n.s+=C[R]*w[z]}return n};kt.prototype._updateChunkData=function(t,{samples:e}){this._chunkDownloadsInProgress[t]=void 0;let n=this._samplesPerXysFile,r=t*n*3;for(let s=0;s<e.length;++s)this._samples[r+s]=e[s]};async function mo(t,e,n){try{let r=await t.fetchJson();n._updateChunkData(e,r)}catch{}}function tn(t,e){if(h(t._chunkDownloadsInProgress[e]))return t._chunkDownloadsInProgress[e];let n,r=t._xysFileUrlTemplate;h(r)?n=r.getDerivedResource({templateValues:{0:e}}):n=new Ie({url:fr(`Assets/IAU2006_XYS/IAU2006_XYS_${e}.json`)});let s=mo(n,e,t);return t._chunkDownloadsInProgress[e]=s,s}var hr=kt;function O(t,e,n,r){this.x=t??0,this.y=e??0,this.z=n??0,this.w=r??0}var ht=new v;O.fromAxisAngle=function(t,e,n){l.typeOf.object("axis",t),l.typeOf.number("angle",e);let r=e/2,s=Math.sin(r);ht=v.normalize(t,ht);let o=ht.x*s,c=ht.y*s,u=ht.z*s,d=Math.cos(r);return h(n)?(n.x=o,n.y=c,n.z=u,n.w=d,n):new O(o,c,u,d)};var yo=[1,2,0],go=new Array(3);O.fromRotationMatrix=function(t,e){l.typeOf.object("matrix",t);let n,r,s,o,c,u=t[k.COLUMN0ROW0],d=t[k.COLUMN1ROW1],w=t[k.COLUMN2ROW2],y=u+d+w;if(y>0)n=Math.sqrt(y+1),c=.5*n,n=.5/n,r=(t[k.COLUMN1ROW2]-t[k.COLUMN2ROW1])*n,s=(t[k.COLUMN2ROW0]-t[k.COLUMN0ROW2])*n,o=(t[k.COLUMN0ROW1]-t[k.COLUMN1ROW0])*n;else{let g=yo,x=0;d>u&&(x=1),w>u&&w>d&&(x=2);let C=g[x],I=g[C];n=Math.sqrt(t[k.getElementIndex(x,x)]-t[k.getElementIndex(C,C)]-t[k.getElementIndex(I,I)]+1);let R=go;R[x]=.5*n,n=.5/n,c=(t[k.getElementIndex(I,C)]-t[k.getElementIndex(C,I)])*n,R[C]=(t[k.getElementIndex(C,x)]+t[k.getElementIndex(x,C)])*n,R[I]=(t[k.getElementIndex(I,x)]+t[k.getElementIndex(x,I)])*n,r=-R[0],s=-R[1],o=-R[2]}return h(e)?(e.x=r,e.y=s,e.z=o,e.w=c,e):new O(r,s,o,c)};var lr=new O,dr=new O,nn=new O,pr=new O;O.fromHeadingPitchRoll=function(t,e){return l.typeOf.object("headingPitchRoll",t),pr=O.fromAxisAngle(v.UNIT_X,t.roll,lr),nn=O.fromAxisAngle(v.UNIT_Y,-t.pitch,e),e=O.multiply(nn,pr,nn),dr=O.fromAxisAngle(v.UNIT_Z,-t.heading,lr),O.multiply(dr,e,e)};var jt=new v,rn=new v,me=new O,mr=new O,Nt=new O;O.packedLength=4;O.pack=function(t,e,n){return l.typeOf.object("value",t),l.defined("array",e),n=n??0,e[n++]=t.x,e[n++]=t.y,e[n++]=t.z,e[n]=t.w,e};O.unpack=function(t,e,n){return l.defined("array",t),e=e??0,h(n)||(n=new O),n.x=t[e],n.y=t[e+1],n.z=t[e+2],n.w=t[e+3],n};O.packedInterpolationLength=3;O.convertPackedArrayForInterpolation=function(t,e,n,r){O.unpack(t,n*4,Nt),O.conjugate(Nt,Nt);for(let s=0,o=n-e+1;s<o;s++){let c=s*3;O.unpack(t,(e+s)*4,me),O.multiply(me,Nt,me),me.w<0&&O.negate(me,me),O.computeAxis(me,jt);let u=O.computeAngle(me);h(r)||(r=[]),r[c]=jt.x*u,r[c+1]=jt.y*u,r[c+2]=jt.z*u}};O.unpackInterpolationResult=function(t,e,n,r,s){h(s)||(s=new O),v.fromArray(t,0,rn);let o=v.magnitude(rn);return O.unpack(e,r*4,mr),o===0?O.clone(O.IDENTITY,me):O.fromAxisAngle(rn,o,me),O.multiply(me,mr,s)};O.clone=function(t,e){if(h(t))return h(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new O(t.x,t.y,t.z,t.w)};O.conjugate=function(t,e){return l.typeOf.object("quaternion",t),l.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=t.w,e};O.magnitudeSquared=function(t){return l.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w};O.magnitude=function(t){return Math.sqrt(O.magnitudeSquared(t))};O.normalize=function(t,e){l.typeOf.object("result",e);let n=1/O.magnitude(t),r=t.x*n,s=t.y*n,o=t.z*n,c=t.w*n;return e.x=r,e.y=s,e.z=o,e.w=c,e};O.inverse=function(t,e){l.typeOf.object("result",e);let n=O.magnitudeSquared(t);return e=O.conjugate(t,e),O.multiplyByScalar(e,1/n,e)};O.add=function(t,e,n){return l.typeOf.object("left",t),l.typeOf.object("right",e),l.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n};O.subtract=function(t,e,n){return l.typeOf.object("left",t),l.typeOf.object("right",e),l.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n};O.negate=function(t,e){return l.typeOf.object("quaternion",t),l.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e};O.dot=function(t,e){return l.typeOf.object("left",t),l.typeOf.object("right",e),t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w};O.multiply=function(t,e,n){l.typeOf.object("left",t),l.typeOf.object("right",e),l.typeOf.object("result",n);let r=t.x,s=t.y,o=t.z,c=t.w,u=e.x,d=e.y,w=e.z,y=e.w,g=c*u+r*y+s*w-o*d,x=c*d-r*w+s*y+o*u,C=c*w+r*d-s*u+o*y,I=c*y-r*u-s*d-o*w;return n.x=g,n.y=x,n.z=C,n.w=I,n};O.multiplyByScalar=function(t,e,n){return l.typeOf.object("quaternion",t),l.typeOf.number("scalar",e),l.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n};O.divideByScalar=function(t,e,n){return l.typeOf.object("quaternion",t),l.typeOf.number("scalar",e),l.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n};O.computeAxis=function(t,e){l.typeOf.object("quaternion",t),l.typeOf.object("result",e);let n=t.w;if(Math.abs(n-1)<_.EPSILON6||Math.abs(n+1)<_.EPSILON6)return e.x=1,e.y=e.z=0,e;let r=1/Math.sqrt(1-n*n);return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e};O.computeAngle=function(t){return l.typeOf.object("quaternion",t),Math.abs(t.w-1)<_.EPSILON6?0:2*Math.acos(t.w)};var on=new O;O.lerp=function(t,e,n,r){return l.typeOf.object("start",t),l.typeOf.object("end",e),l.typeOf.number("t",n),l.typeOf.object("result",r),on=O.multiplyByScalar(e,n,on),r=O.multiplyByScalar(t,1-n,r),O.add(on,r,r)};var yr=new O,sn=new O,an=new O;O.slerp=function(t,e,n,r){l.typeOf.object("start",t),l.typeOf.object("end",e),l.typeOf.number("t",n),l.typeOf.object("result",r);let s=O.dot(t,e),o=e;if(s<0&&(s=-s,o=yr=O.negate(e,yr)),1-s<_.EPSILON6)return O.lerp(t,o,n,r);let c=Math.acos(s);return sn=O.multiplyByScalar(t,Math.sin((1-n)*c),sn),an=O.multiplyByScalar(o,Math.sin(n*c),an),r=O.add(sn,an,r),O.multiplyByScalar(r,1/Math.sin(c),r)};O.log=function(t,e){l.typeOf.object("quaternion",t),l.typeOf.object("result",e);let n=_.acosClamped(t.w),r=0;return n!==0&&(r=n/Math.sin(n)),v.multiplyByScalar(t,r,e)};O.exp=function(t,e){l.typeOf.object("cartesian",t),l.typeOf.object("result",e);let n=v.magnitude(t),r=0;return n!==0&&(r=Math.sin(n)/n),e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e.w=Math.cos(n),e};var wo=new v,bo=new v,lt=new O,Ke=new O;O.computeInnerQuadrangle=function(t,e,n,r){l.typeOf.object("q0",t),l.typeOf.object("q1",e),l.typeOf.object("q2",n),l.typeOf.object("result",r);let s=O.conjugate(e,lt);O.multiply(s,n,Ke);let o=O.log(Ke,wo);O.multiply(s,t,Ke);let c=O.log(Ke,bo);return v.add(o,c,o),v.multiplyByScalar(o,.25,o),v.negate(o,o),O.exp(o,lt),O.multiply(e,lt,r)};O.squad=function(t,e,n,r,s,o){l.typeOf.object("q0",t),l.typeOf.object("q1",e),l.typeOf.object("s0",n),l.typeOf.object("s1",r),l.typeOf.number("t",s),l.typeOf.object("result",o);let c=O.slerp(t,e,s,lt),u=O.slerp(n,r,s,Ke);return O.slerp(c,u,2*s*(1-s),o)};var Oo=new O,gr=1.9011074535173003,zt=nt.supportsTypedArrays()?new Float32Array(8):[],Ft=nt.supportsTypedArrays()?new Float32Array(8):[],Te=nt.supportsTypedArrays()?new Float32Array(8):[],xe=nt.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){let e=t+1,n=2*e+1;zt[t]=1/(e*n),Ft[t]=e/n}zt[7]=gr/136;Ft[7]=gr*8/17;O.fastSlerp=function(t,e,n,r){l.typeOf.object("start",t),l.typeOf.object("end",e),l.typeOf.number("t",n),l.typeOf.object("result",r);let s=O.dot(t,e),o;s>=0?o=1:(o=-1,s=-s);let c=s-1,u=1-n,d=n*n,w=u*u;for(let C=7;C>=0;--C)Te[C]=(zt[C]*d-Ft[C])*c,xe[C]=(zt[C]*w-Ft[C])*c;let y=o*n*(1+Te[0]*(1+Te[1]*(1+Te[2]*(1+Te[3]*(1+Te[4]*(1+Te[5]*(1+Te[6]*(1+Te[7])))))))),g=u*(1+xe[0]*(1+xe[1]*(1+xe[2]*(1+xe[3]*(1+xe[4]*(1+xe[5]*(1+xe[6]*(1+xe[7])))))))),x=O.multiplyByScalar(t,g,Oo);return O.multiplyByScalar(e,y,r),O.add(x,r,r)};O.fastSquad=function(t,e,n,r,s,o){l.typeOf.object("q0",t),l.typeOf.object("q1",e),l.typeOf.object("s0",n),l.typeOf.object("s1",r),l.typeOf.number("t",s),l.typeOf.object("result",o);let c=O.fastSlerp(t,e,s,lt),u=O.fastSlerp(n,r,s,Ke);return O.fastSlerp(c,u,2*s*(1-s),o)};O.equals=function(t,e){return t===e||h(t)&&h(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w};O.equalsEpsilon=function(t,e,n){return n=n??0,t===e||h(t)&&h(e)&&Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.z-e.z)<=n&&Math.abs(t.w-e.w)<=n};O.ZERO=Object.freeze(new O(0,0,0,0));O.IDENTITY=Object.freeze(new O(0,0,0,1));O.prototype.clone=function(t){return O.clone(this,t)};O.prototype.equals=function(t){return O.equals(this,t)};O.prototype.equalsEpsilon=function(t,e){return O.equalsEpsilon(this,t,e)};O.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var He=O;var M={},cn={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"}},et={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},un={},ce={east:new v,north:new v,up:new v,west:new v,south:new v,down:new v},Ue=new v,Me=new v,De=new v;M.localFrameToFixedFrameGenerator=function(t,e){if(!cn.hasOwnProperty(t)||!cn[t].hasOwnProperty(e))throw new T("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=cn[t][e],r,s=t+e;return h(un[s])?r=un[s]:(r=function(o,c,u){if(!h(o))throw new T("origin is required.");if(isNaN(o.x)||isNaN(o.y)||isNaN(o.z))throw new T("origin has a NaN component");if(h(u)||(u=new N),v.equalsEpsilon(o,v.ZERO,_.EPSILON14))v.unpack(et[t],0,Ue),v.unpack(et[e],0,Me),v.unpack(et[n],0,De);else if(_.equalsEpsilon(o.x,0,_.EPSILON14)&&_.equalsEpsilon(o.y,0,_.EPSILON14)){let d=_.sign(o.z);v.unpack(et[t],0,Ue),t!=="east"&&t!=="west"&&v.multiplyByScalar(Ue,d,Ue),v.unpack(et[e],0,Me),e!=="east"&&e!=="west"&&v.multiplyByScalar(Me,d,Me),v.unpack(et[n],0,De),n!=="east"&&n!=="west"&&v.multiplyByScalar(De,d,De)}else{c=c??Ce.default,c.geodeticSurfaceNormal(o,ce.up);let d=ce.up,w=ce.east;w.x=-o.y,w.y=o.x,w.z=0,v.normalize(w,ce.east),v.cross(d,w,ce.north),v.multiplyByScalar(ce.up,-1,ce.down),v.multiplyByScalar(ce.east,-1,ce.west),v.multiplyByScalar(ce.north,-1,ce.south),Ue=ce[t],Me=ce[e],De=ce[n]}return u[0]=Ue.x,u[1]=Ue.y,u[2]=Ue.z,u[3]=0,u[4]=Me.x,u[5]=Me.y,u[6]=Me.z,u[7]=0,u[8]=De.x,u[9]=De.y,u[10]=De.z,u[11]=0,u[12]=o.x,u[13]=o.y,u[14]=o.z,u[15]=1,u},un[s]=r),r};M.eastNorthUpToFixedFrame=M.localFrameToFixedFrameGenerator("east","north");M.northEastDownToFixedFrame=M.localFrameToFixedFrameGenerator("north","east");M.northUpEastToFixedFrame=M.localFrameToFixedFrameGenerator("north","up");M.northWestUpToFixedFrame=M.localFrameToFixedFrameGenerator("north","west");var _o=new He,So=new v(1,1,1),vo=new N;M.headingPitchRollToFixedFrame=function(t,e,n,r,s){l.typeOf.object("HeadingPitchRoll",e),r=r??M.eastNorthUpToFixedFrame;let o=He.fromHeadingPitchRoll(e,_o),c=N.fromTranslationQuaternionRotationScale(v.ZERO,o,So,vo);return s=r(t,n,s),N.multiply(s,c,s)};var Eo=new N,To=new k;M.headingPitchRollQuaternion=function(t,e,n,r,s){l.typeOf.object("HeadingPitchRoll",e);let o=M.headingPitchRollToFixedFrame(t,e,n,r,Eo),c=N.getMatrix3(o,To);return He.fromRotationMatrix(c,s)};var xo=new v(1,1,1),Ao=new v,wr=new N,Co=new N,Ro=new k,Po=new He;M.fixedFrameToHeadingPitchRoll=function(t,e,n,r){l.defined("transform",t),e=e??Ce.default,n=n??M.eastNorthUpToFixedFrame,h(r)||(r=new Ut);let s=N.getTranslation(t,Ao);if(v.equals(s,v.ZERO))return r.heading=0,r.pitch=0,r.roll=0,r;let o=N.inverseTransformation(n(s,e,wr),wr),c=N.setScale(t,xo,Co);c=N.setTranslation(c,v.ZERO,c),o=N.multiply(o,c,o);let u=He.fromRotationMatrix(N.getMatrix3(o,Ro),Po);return u=He.normalize(u,u),Ut.fromQuaternion(u,r)};var Io=6*3600+2460+50.54841,Uo=8640184812866e-6,Mo=.093104,Do=-62e-7,qo=11772758384668e-32,ko=72921158553e-15,jo=_.TWO_PI/86400,Lt=new K;M.computeIcrfToCentralBodyFixedMatrix=function(t,e){let n=M.computeIcrfToFixedMatrix(t,e);return h(n)||(n=M.computeTemeToPseudoFixedMatrix(t,e)),n};M.computeTemeToPseudoFixedMatrix=function(t,e){if(!h(t))throw new T("date is required.");Lt=K.addSeconds(t,-K.computeTaiMinusUtc(t),Lt);let n=Lt.dayNumber,r=Lt.secondsOfDay,s,o=n-2451545;r>=43200?s=(o+.5)/W.DAYS_PER_JULIAN_CENTURY:s=(o-.5)/W.DAYS_PER_JULIAN_CENTURY;let u=(Io+s*(Uo+s*(Mo+s*Do)))*jo%_.TWO_PI,d=ko+qo*(n-24515455e-1),w=(r+W.SECONDS_PER_DAY*.5)%W.SECONDS_PER_DAY,y=u+d*w,g=Math.cos(y),x=Math.sin(y);return h(e)?(e[0]=g,e[1]=-x,e[2]=0,e[3]=x,e[4]=g,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new k(g,x,0,-x,g,0,0,0,1)};M.iau2006XysData=new hr;M.earthOrientationParameters=ir.NONE;var ln=32.184,No=2451545;M.preloadIcrfFixed=function(t){let e=t.start.dayNumber,n=t.start.secondsOfDay+ln,r=t.stop.dayNumber,s=t.stop.secondsOfDay+ln;return M.iau2006XysData.preload(e,n,r,s)};M.computeIcrfToFixedMatrix=function(t,e){if(!h(t))throw new T("date is required.");h(e)||(e=new k);let n=M.computeFixedToIcrfMatrix(t,e);if(h(n))return k.transpose(n,e)};var zo=32.184,Fo=2451545,Bt=new Ut,Lo=new k,Bo=new K;M.computeMoonFixedToIcrfMatrix=function(t,e){if(!h(t))throw new T("date is required.");h(e)||(e=new k);let n=K.addSeconds(t,zo,Bo),r=K.totalDays(n)-Fo,s=_.toRadians(12.112)-_.toRadians(.052992)*r,o=_.toRadians(24.224)-_.toRadians(.105984)*r,c=_.toRadians(227.645)+_.toRadians(13.012)*r,u=_.toRadians(261.105)+_.toRadians(13.340716)*r,d=_.toRadians(358)+_.toRadians(.9856)*r;return Bt.pitch=_.toRadians(180)-_.toRadians(3.878)*Math.sin(s)-_.toRadians(.12)*Math.sin(o)+_.toRadians(.07)*Math.sin(c)-_.toRadians(.017)*Math.sin(u),Bt.roll=_.toRadians(66.53-90)+_.toRadians(1.543)*Math.cos(s)+_.toRadians(.24)*Math.cos(o)-_.toRadians(.028)*Math.cos(c)+_.toRadians(.007)*Math.cos(u),Bt.heading=_.toRadians(244.375-90)+_.toRadians(13.17635831)*r+_.toRadians(3.558)*Math.sin(s)+_.toRadians(.121)*Math.sin(o)-_.toRadians(.064)*Math.sin(c)+_.toRadians(.016)*Math.sin(u)+_.toRadians(.025)*Math.sin(d),k.fromHeadingPitchRoll(Bt,Lo,e)};M.computeIcrfToMoonFixedMatrix=function(t,e){if(!h(t))throw new T("date is required.");h(e)||(e=new k);let n=M.computeMoonFixedToIcrfMatrix(t,e);if(h(n))return k.transpose(n,e)};var Qo=new qt(0,0,0),Ho=new rt(0,0,0,0,0,0),fn=new k,hn=new k;M.computeFixedToIcrfMatrix=function(t,e){if(!h(t))throw new T("date is required.");h(e)||(e=new k);let n=M.earthOrientationParameters.compute(t,Ho);if(!h(n))return;let r=t.dayNumber,s=t.secondsOfDay+ln,o=M.iau2006XysData.computeXysRadians(r,s,Qo);if(!h(o))return;let c=o.x+n.xPoleOffset,u=o.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-u*u)),w=fn;w[0]=1-d*c*c,w[3]=-d*c*u,w[6]=c,w[1]=-d*c*u,w[4]=1-d*u*u,w[7]=u,w[2]=-c,w[5]=-u,w[8]=1-d*(c*c+u*u);let y=k.fromRotationZ(-o.s,hn),g=k.multiply(w,y,fn),x=t.dayNumber,C=t.secondsOfDay-K.computeTaiMinusUtc(t)+n.ut1MinusUtc,I=x-2451545,R=C/W.SECONDS_PER_DAY,D=.779057273264+R+.00273781191135448*(I+R);D=D%1*_.TWO_PI;let z=k.fromRotationZ(D,hn),Q=k.multiply(g,z,fn),j=Math.cos(n.xPoleWander),Y=Math.cos(n.yPoleWander),Z=Math.sin(n.xPoleWander),J=Math.sin(n.yPoleWander),Se=r-No+s/W.SECONDS_PER_DAY;Se/=36525;let qe=-47e-6*Se*_.RADIANS_PER_DEGREE/3600,ye=Math.cos(qe),ge=Math.sin(qe),ae=hn;return ae[0]=j*ye,ae[1]=j*ge,ae[2]=Z,ae[3]=-Y*ge+J*Z*ye,ae[4]=Y*ye+J*Z*ge,ae[5]=-J*j,ae[6]=-J*ge-Y*Z*ye,ae[7]=J*ye-Y*Z*ge,ae[8]=Y*j,k.multiply(Q,ae,e)};var Wo=new mt;M.pointToWindowCoordinates=function(t,e,n,r){return r=M.pointToGLWindowCoordinates(t,e,n,r),r.y=2*e[5]-r.y,r};M.pointToGLWindowCoordinates=function(t,e,n,r){if(!h(t))throw new T("modelViewProjectionMatrix is required.");if(!h(e))throw new T("viewportTransformation is required.");if(!h(n))throw new T("point is required.");h(r)||(r=new se);let s=Wo;return N.multiplyByVector(t,mt.fromElements(n.x,n.y,n.z,1,s),s),mt.multiplyByScalar(s,1/s.w,s),N.multiplyByVector(e,s,s),se.fromCartesian4(s,r)};var $o=new v,Vo=new v,Yo=new v;M.rotationMatrixFromPositionVelocity=function(t,e,n,r){if(!h(t))throw new T("position is required.");if(!h(e))throw new T("velocity is required.");let s=(n??Ce.default).geodeticSurfaceNormal(t,$o),o=v.cross(e,s,Vo);v.equalsEpsilon(o,v.ZERO,_.EPSILON6)&&(o=v.clone(v.UNIT_X,o));let c=v.cross(o,e,Yo);return v.normalize(c,c),v.cross(e,c,o),v.negate(o,o),v.normalize(o,o),h(r)||(r=new k),r[0]=e.x,r[1]=e.y,r[2]=e.z,r[3]=o.x,r[4]=o.y,r[5]=o.z,r[6]=c.x,r[7]=c.y,r[8]=c.z,r};M.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var br=new ve,dn=new v,Xo=new v,Zo=new k,pn=new N,Or=new N;M.basisTo2D=function(t,e,n){if(!h(t))throw new T("projection is required.");if(!h(e))throw new T("matrix is required.");if(!h(n))throw new T("result is required.");let r=N.getTranslation(e,Xo),s=t.ellipsoid,o;if(v.equals(r,v.ZERO))o=v.clone(v.ZERO,dn);else{let y=s.cartesianToCartographic(r,br);o=t.project(y,dn),v.fromElements(o.z,o.x,o.y,o)}let c=M.eastNorthUpToFixedFrame(r,s,pn),u=N.inverseTransformation(c,Or),d=N.getMatrix3(e,Zo),w=N.multiplyByMatrix3(u,d,n);return N.multiply(M.SWIZZLE_3D_TO_2D_MATRIX,w,n),N.setTranslation(n,o,n),n};M.ellipsoidTo2DModelMatrix=function(t,e,n){if(!h(t))throw new T("projection is required.");if(!h(e))throw new T("center is required.");if(!h(n))throw new T("result is required.");let r=t.ellipsoid,s=M.eastNorthUpToFixedFrame(e,r,pn),o=N.inverseTransformation(s,Or),c=r.cartesianToCartographic(e,br),u=t.project(c,dn);v.fromElements(u.z,u.x,u.y,u);let d=N.fromTranslation(u,pn);return N.multiply(M.SWIZZLE_3D_TO_2D_MATRIX,o,n),N.multiply(d,n,n),n};var _r=M;var tt=class t{constructor(e,n,r,s){this.west=e??0,this.south=n??0,this.east=r??0,this.north=s??0}get width(){return t.computeWidth(this)}get height(){return t.computeHeight(this)}static pack(e,n,r){return l.typeOf.object("value",e),l.defined("array",n),r=r??0,n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n}static unpack(e,n,r){return l.defined("array",e),n=n??0,h(r)||(r=new t),r.west=e[n++],r.south=e[n++],r.east=e[n++],r.north=e[n],r}static computeWidth(e){l.typeOf.object("rectangle",e);let n=e.east,r=e.west;return n<r&&(n+=_.TWO_PI),n-r}static computeHeight(e){return l.typeOf.object("rectangle",e),e.north-e.south}static fromDegrees(e,n,r,s,o){return e=_.toRadians(e??0),n=_.toRadians(n??0),r=_.toRadians(r??0),s=_.toRadians(s??0),h(o)?(o.west=e,o.south=n,o.east=r,o.north=s,o):new t(e,n,r,s)}static fromRadians(e,n,r,s,o){return h(o)?(o.west=e??0,o.south=n??0,o.east=r??0,o.north=s??0,o):new t(e,n,r,s)}static fromCartographicArray(e,n){l.defined("cartographics",e);let r=Number.MAX_VALUE,s=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let w=0,y=e.length;w<y;w++){let g=e[w];r=Math.min(r,g.longitude),s=Math.max(s,g.longitude),u=Math.min(u,g.latitude),d=Math.max(d,g.latitude);let x=g.longitude>=0?g.longitude:g.longitude+_.TWO_PI;o=Math.min(o,x),c=Math.max(c,x)}return s-r>c-o&&(r=o,s=c,s>_.PI&&(s=s-_.TWO_PI),r>_.PI&&(r=r-_.TWO_PI)),h(n)?(n.west=r,n.south=u,n.east=s,n.north=d,n):new t(r,u,s,d)}static fromCartesianArray(e,n,r){l.defined("cartesians",e),n=n??Ce.default;let s=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let y=0,g=e.length;y<g;y++){let x=n.cartesianToCartographic(e[y]);s=Math.min(s,x.longitude),o=Math.max(o,x.longitude),d=Math.min(d,x.latitude),w=Math.max(w,x.latitude);let C=x.longitude>=0?x.longitude:x.longitude+_.TWO_PI;c=Math.min(c,C),u=Math.max(u,C)}return o-s>u-c&&(s=c,o=u,o>_.PI&&(o=o-_.TWO_PI),s>_.PI&&(s=s-_.TWO_PI)),h(r)?(r.west=s,r.south=d,r.east=o,r.north=w,r):new t(s,d,o,w)}static fromBoundingSphere(e,n,r){l.typeOf.object("boundingSphere",e);let s=e.center,o=e.radius;if(h(n)||(n=Ce.default),h(r)||(r=new t),v.equals(s,v.ZERO))return t.clone(t.MAX_VALUE,r),r;let c=_r.eastNorthUpToFixedFrame(s,n,Jo),u=N.multiplyByPointAsVector(c,v.UNIT_X,Go);v.normalize(u,u);let d=N.multiplyByPointAsVector(c,v.UNIT_Y,Ko);v.normalize(d,d),v.multiplyByScalar(d,o,d),v.multiplyByScalar(u,o,u);let w=v.negate(d,ti),y=v.negate(u,ei),g=mn,x=g[0];return v.add(s,d,x),x=g[1],v.add(s,y,x),x=g[2],v.add(s,w,x),x=g[3],v.add(s,u,x),g[4]=s,t.fromCartesianArray(g,n,r)}static clone(e,n){if(h(e))return h(n)?(n.west=e.west,n.south=e.south,n.east=e.east,n.north=e.north,n):new t(e.west,e.south,e.east,e.north)}static equalsEpsilon(e,n,r){return r=r??0,e===n||h(e)&&h(n)&&Math.abs(e.west-n.west)<=r&&Math.abs(e.south-n.south)<=r&&Math.abs(e.east-n.east)<=r&&Math.abs(e.north-n.north)<=r}clone(e){return t.clone(this,e)}equals(e){return t.equals(this,e)}static equals(e,n){return e===n||h(e)&&h(n)&&e.west===n.west&&e.south===n.south&&e.east===n.east&&e.north===n.north}equalsEpsilon(e,n){return t.equalsEpsilon(this,e,n)}static _validate(e){l.typeOf.object("rectangle",e);let n=e.north;l.typeOf.number.greaterThanOrEquals("north",n,-_.PI_OVER_TWO),l.typeOf.number.lessThanOrEquals("north",n,_.PI_OVER_TWO);let r=e.south;l.typeOf.number.greaterThanOrEquals("south",r,-_.PI_OVER_TWO),l.typeOf.number.lessThanOrEquals("south",r,_.PI_OVER_TWO);let s=e.west;l.typeOf.number.greaterThanOrEquals("west",s,-Math.PI),l.typeOf.number.lessThanOrEquals("west",s,Math.PI);let o=e.east;l.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),l.typeOf.number.lessThanOrEquals("east",o,Math.PI)}static southwest(e,n){return l.typeOf.object("rectangle",e),h(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new ve(e.west,e.south)}static northwest(e,n){return l.typeOf.object("rectangle",e),h(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new ve(e.west,e.north)}static northeast(e,n){return l.typeOf.object("rectangle",e),h(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new ve(e.east,e.north)}static southeast(e,n){return l.typeOf.object("rectangle",e),h(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new ve(e.east,e.south)}static center(e,n){l.typeOf.object("rectangle",e);let r=e.east,s=e.west;r<s&&(r+=_.TWO_PI);let o=_.negativePiToPi((s+r)*.5),c=(e.south+e.north)*.5;return h(n)?(n.longitude=o,n.latitude=c,n.height=0,n):new ve(o,c)}static intersection(e,n,r){l.typeOf.object("rectangle",e),l.typeOf.object("otherRectangle",n);let s=e.east,o=e.west,c=n.east,u=n.west;s<o&&c>0?s+=_.TWO_PI:c<u&&s>0&&(c+=_.TWO_PI),s<o&&u<0?u+=_.TWO_PI:c<u&&o<0&&(o+=_.TWO_PI);let d=_.negativePiToPi(Math.max(o,u)),w=_.negativePiToPi(Math.min(s,c));if(d===_.PI&&w<_.PI&&(d=-_.PI),(e.west<e.east||n.west<n.east)&&w<=d)return;let y=Math.max(e.south,n.south),g=Math.min(e.north,n.north);if(!(y>=g))return h(r)?(r.west=d,r.south=y,r.east=w,r.north=g,r):new t(d,y,w,g)}static simpleIntersection(e,n,r){l.typeOf.object("rectangle",e),l.typeOf.object("otherRectangle",n);let s=Math.max(e.west,n.west),o=Math.max(e.south,n.south),c=Math.min(e.east,n.east),u=Math.min(e.north,n.north);if(!(o>=u||s>=c))return h(r)?(r.west=s,r.south=o,r.east=c,r.north=u,r):new t(s,o,c,u)}static union(e,n,r){l.typeOf.object("rectangle",e),l.typeOf.object("otherRectangle",n),h(r)||(r=new t);let s=e.east,o=e.west,c=n.east,u=n.west;s<o&&c>0?s+=_.TWO_PI:c<u&&s>0&&(c+=_.TWO_PI),s<o&&u<0?u+=_.TWO_PI:c<u&&o<0&&(o+=_.TWO_PI);let d=_.negativePiToPi(Math.min(o,u)),w=_.negativePiToPi(Math.max(s,c));return r.west=d,r.south=Math.min(e.south,n.south),r.east=w,r.north=Math.max(e.north,n.north),r}static expand(e,n,r){return l.typeOf.object("rectangle",e),l.typeOf.object("cartographic",n),h(r)||(r=new t),r.west=Math.min(e.west,n.longitude),r.south=Math.min(e.south,n.latitude),r.east=Math.max(e.east,n.longitude),r.north=Math.max(e.north,n.latitude),r}static contains(e,n){l.typeOf.object("rectangle",e),l.typeOf.object("cartographic",n);let r=n.longitude,s=n.latitude,o=e.west,c=e.east;return c<o&&(c+=_.TWO_PI,r<0&&(r+=_.TWO_PI)),(r>o||_.equalsEpsilon(r,o,_.EPSILON14))&&(r<c||_.equalsEpsilon(r,c,_.EPSILON14))&&s>=e.south&&s<=e.north}static subsample(e,n,r,s){l.typeOf.object("rectangle",e),n=n??Ce.default,r=r??0,h(s)||(s=[]);let o=0,c=e.north,u=e.south,d=e.east,w=e.west,y=ni;y.height=r,y.longitude=w,y.latitude=c,s[o]=n.cartographicToCartesian(y,s[o]),o++,y.longitude=d,s[o]=n.cartographicToCartesian(y,s[o]),o++,y.latitude=u,s[o]=n.cartographicToCartesian(y,s[o]),o++,y.longitude=w,s[o]=n.cartographicToCartesian(y,s[o]),o++,c<0?y.latitude=c:u>0?y.latitude=u:y.latitude=0;for(let g=1;g<8;++g)y.longitude=-Math.PI+g*_.PI_OVER_TWO,t.contains(e,y)&&(s[o]=n.cartographicToCartesian(y,s[o]),o++);return y.latitude===0&&(y.longitude=w,s[o]=n.cartographicToCartesian(y,s[o]),o++,y.longitude=d,s[o]=n.cartographicToCartesian(y,s[o]),o++),s.length=o,s}static subsection(e,n,r,s,o,c){if(l.typeOf.object("rectangle",e),l.typeOf.number.greaterThanOrEquals("westLerp",n,0),l.typeOf.number.lessThanOrEquals("westLerp",n,1),l.typeOf.number.greaterThanOrEquals("southLerp",r,0),l.typeOf.number.lessThanOrEquals("southLerp",r,1),l.typeOf.number.greaterThanOrEquals("eastLerp",s,0),l.typeOf.number.lessThanOrEquals("eastLerp",s,1),l.typeOf.number.greaterThanOrEquals("northLerp",o,0),l.typeOf.number.lessThanOrEquals("northLerp",o,1),l.typeOf.number.lessThanOrEquals("westLerp",n,s),l.typeOf.number.lessThanOrEquals("southLerp",r,o),h(c)||(c=new t),e.west<=e.east){let d=e.east-e.west;c.west=e.west+n*d,c.east=e.west+s*d}else{let d=_.TWO_PI+e.east-e.west;c.west=_.negativePiToPi(e.west+n*d),c.east=_.negativePiToPi(e.west+s*d)}let u=e.north-e.south;return c.south=e.south+r*u,c.north=e.south+o*u,n===1&&(c.west=e.east),s===1&&(c.east=e.east),r===1&&(c.south=e.north),o===1&&(c.north=e.north),c}};tt.packedLength=4;var Jo=new N,Go=new v,Ko=new v,ei=new v,ti=new v,mn=new Array(5);for(let t=0;t<mn.length;++t)mn[t]=new v;var ni=new ve;tt.MAX_VALUE=Object.freeze(new tt(-Math.PI,-_.PI_OVER_TWO,Math.PI,_.PI_OVER_TWO));var wc=tt;var ri=Object.freeze([NaN,NaN,NaN,NaN]),ue=class t{constructor(e,n,r,s){let o=Reflect.construct(Array,ri,new.target);return o[0]=e??0,o[1]=r??0,o[2]=n??0,o[3]=s??0,o}static pack(e,n,r){return l.typeOf.object("value",e),l.defined("array",n),r=r??0,n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r]=e[3],n}static unpack(e,n,r){return l.defined("array",e),n=n??0,h(r)||(r=new t),r[0]=e[n++],r[1]=e[n++],r[2]=e[n++],r[3]=e[n],r}static packArray(e,n){l.defined("array",e);let r=e.length,s=r*4;if(!h(n))n=new Array(s);else{if(!Array.isArray(n)&&n.length!==s)throw new T("If result is a typed array, it must have exactly array.length * 4 elements");n.length!==s&&(n.length=s)}for(let o=0;o<r;++o)t.pack(e[o],n,o*4);return n}static unpackArray(e,n){if(l.defined("array",e),l.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new T("array length must be a multiple of 4.");let r=e.length;h(n)?n.length=r/4:n=new Array(r/4);for(let s=0;s<r;s+=4){let o=s/4;n[o]=t.unpack(e,s,n[o])}return n}static clone(e,n){if(h(e))return h(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):new t(e[0],e[2],e[1],e[3])}static fromColumnMajorArray(e,n){return l.defined("values",e),t.clone(e,n)}static fromRowMajorArray(e,n){return l.defined("values",e),h(n)?(n[0]=e[0],n[1]=e[2],n[2]=e[1],n[3]=e[3],n):new t(e[0],e[1],e[2],e[3])}static fromScale(e,n){return l.typeOf.object("scale",e),h(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=e.y,n):new t(e.x,0,0,e.y)}static fromUniformScale(e,n){return l.typeOf.number("scale",e),h(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=e,n):new t(e,0,0,e)}static fromRotation(e,n){l.typeOf.number("angle",e);let r=Math.cos(e),s=Math.sin(e);return h(n)?(n[0]=r,n[1]=s,n[2]=-s,n[3]=r,n):new t(r,-s,s,r)}static toArray(e,n){return l.typeOf.object("matrix",e),h(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n):[e[0],e[1],e[2],e[3]]}static getElementIndex(e,n){return l.typeOf.number.greaterThanOrEquals("row",n,0),l.typeOf.number.lessThanOrEquals("row",n,1),l.typeOf.number.greaterThanOrEquals("column",e,0),l.typeOf.number.lessThanOrEquals("column",e,1),e*2+n}static getColumn(e,n,r){l.typeOf.object("matrix",e),l.typeOf.number.greaterThanOrEquals("index",n,0),l.typeOf.number.lessThanOrEquals("index",n,1),l.typeOf.object("result",r);let s=n*2,o=e[s],c=e[s+1];return r.x=o,r.y=c,r}static setColumn(e,n,r,s){l.typeOf.object("matrix",e),l.typeOf.number.greaterThanOrEquals("index",n,0),l.typeOf.number.lessThanOrEquals("index",n,1),l.typeOf.object("cartesian",r),l.typeOf.object("result",s),s=t.clone(e,s);let o=n*2;return s[o]=r.x,s[o+1]=r.y,s}static getRow(e,n,r){l.typeOf.object("matrix",e),l.typeOf.number.greaterThanOrEquals("index",n,0),l.typeOf.number.lessThanOrEquals("index",n,1),l.typeOf.object("result",r);let s=e[n],o=e[n+2];return r.x=s,r.y=o,r}static setRow(e,n,r,s){return l.typeOf.object("matrix",e),l.typeOf.number.greaterThanOrEquals("index",n,0),l.typeOf.number.lessThanOrEquals("index",n,1),l.typeOf.object("cartesian",r),l.typeOf.object("result",s),s=t.clone(e,s),s[n]=r.x,s[n+2]=r.y,s}static setScale(e,n,r){l.typeOf.object("matrix",e),l.typeOf.object("scale",n),l.typeOf.object("result",r);let s=t.getScale(e,oi),o=n.x/s.x,c=n.y/s.y;return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*c,r[3]=e[3]*c,r}static setUniformScale(e,n,r){l.typeOf.object("matrix",e),l.typeOf.number("scale",n),l.typeOf.object("result",r);let s=t.getScale(e,ii),o=n/s.x,c=n/s.y;return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*c,r[3]=e[3]*c,r}static getScale(e,n){return l.typeOf.object("matrix",e),l.typeOf.object("result",n),n.x=se.magnitude(se.fromElements(e[0],e[1],Sr)),n.y=se.magnitude(se.fromElements(e[2],e[3],Sr)),n}static getMaximumScale(e){return t.getScale(e,vr),se.maximumComponent(vr)}static setRotation(e,n,r){l.typeOf.object("matrix",e),l.typeOf.object("result",r);let s=t.getScale(e,si);return r[0]=n[0]*s.x,r[1]=n[1]*s.x,r[2]=n[2]*s.y,r[3]=n[3]*s.y,r}static getRotation(e,n){l.typeOf.object("matrix",e),l.typeOf.object("result",n);let r=t.getScale(e,ai);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.y,n[3]=e[3]/r.y,n}static multiply(e,n,r){l.typeOf.object("left",e),l.typeOf.object("right",n),l.typeOf.object("result",r);let s=e[0]*n[0]+e[2]*n[1],o=e[0]*n[2]+e[2]*n[3],c=e[1]*n[0]+e[3]*n[1],u=e[1]*n[2]+e[3]*n[3];return r[0]=s,r[1]=c,r[2]=o,r[3]=u,r}static add(e,n,r){return l.typeOf.object("left",e),l.typeOf.object("right",n),l.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r}static subtract(e,n,r){return l.typeOf.object("left",e),l.typeOf.object("right",n),l.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r}static multiplyByVector(e,n,r){l.typeOf.object("matrix",e),l.typeOf.object("cartesian",n),l.typeOf.object("result",r);let s=e[0]*n.x+e[2]*n.y,o=e[1]*n.x+e[3]*n.y;return r.x=s,r.y=o,r}static multiplyByScalar(e,n,r){return l.typeOf.object("matrix",e),l.typeOf.number("scalar",n),l.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r}static multiplyByScale(e,n,r){return l.typeOf.object("matrix",e),l.typeOf.object("scale",n),l.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.y,r[3]=e[3]*n.y,r}static multiplyByUniformScale(e,n,r){return l.typeOf.object("matrix",e),l.typeOf.number("scale",n),l.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r}static negate(e,n){return l.typeOf.object("matrix",e),l.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n}static transpose(e,n){l.typeOf.object("matrix",e),l.typeOf.object("result",n);let r=e[0],s=e[2],o=e[1],c=e[3];return n[0]=r,n[1]=s,n[2]=o,n[3]=c,n}static abs(e,n){return l.typeOf.object("matrix",e),l.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n}static equals(e,n){return e===n||h(e)&&h(n)&&e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]&&e[3]===n[3]}static equalsArray(e,n,r){return e[0]===n[r]&&e[1]===n[r+1]&&e[2]===n[r+2]&&e[3]===n[r+3]}static equalsEpsilon(e,n,r){return r=r??0,e===n||h(e)&&h(n)&&Math.abs(e[0]-n[0])<=r&&Math.abs(e[1]-n[1])<=r&&Math.abs(e[2]-n[2])<=r&&Math.abs(e[3]-n[3])<=r}get length(){return t.packedLength}clone(e){return t.clone(this,e)}equals(e){return t.equals(this,e)}equalsEpsilon(e,n){return t.equalsEpsilon(this,e,n)}toString(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`}};ue.packedLength=4;ue.fromArray=ue.unpack;ue.IDENTITY=new ue(1,0,0,1);ue.ZERO=new ue(0,0,0,0);ue.COLUMN0ROW0=0;ue.COLUMN0ROW1=1;ue.COLUMN1ROW0=2;ue.COLUMN1ROW1=3;var oi=new se,ii=new se,Sr=new se,vr=new se,si=new se,ai=new se,Ec=ue;export{je as a,Ne as b,Re as c,kn as d,$n as e,Ie as f,fr as g,He as h,_r as i,wc as j,Ec as k}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-OVIPITBL.js b/plugins/feature/map/Cesium/Workers/chunk-ZJRS2FK6.js similarity index 98% rename from plugins/feature/map/Cesium/Workers/chunk-OVIPITBL.js rename to plugins/feature/map/Cesium/Workers/chunk-ZJRS2FK6.js index 3f637025c..e0502f7d2 100644 --- a/plugins/feature/map/Cesium/Workers/chunk-OVIPITBL.js +++ b/plugins/feature/map/Cesium/Workers/chunk-ZJRS2FK6.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var E={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},_=Object.freeze(E);export{_ as a}; +var E={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};Object.freeze(E);var _=E;export{_ as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ZNBU4MZZ.js b/plugins/feature/map/Cesium/Workers/chunk-ZNBU4MZZ.js new file mode 100644 index 000000000..09c6ff8c2 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-ZNBU4MZZ.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{b as U}from"./chunk-THB3EPLO.js";import{a as ft}from"./chunk-KP72RGCH.js";import{a as i,b}from"./chunk-OSVSBQDY.js";import{a as y}from"./chunk-LZC73BOP.js";import{a as w,b as $}from"./chunk-OU2IPMYE.js";import{f as g}from"./chunk-H7SJWKIY.js";var tt={};tt.computeDiscriminant=function(t,r,e){if(typeof t!="number")throw new w("a is a required number.");if(typeof r!="number")throw new w("b is a required number.");if(typeof e!="number")throw new w("c is a required number.");return r*r-4*t*e};function mt(t,r,e){let n=t+r;return y.sign(t)!==y.sign(r)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(r)))<e?0:n}tt.computeRealRoots=function(t,r,e){if(typeof t!="number")throw new w("a is a required number.");if(typeof r!="number")throw new w("b is a required number.");if(typeof e!="number")throw new w("c is a required number.");let n;if(t===0)return r===0?[]:[-e/r];if(r===0){if(e===0)return[0,0];let u=Math.abs(e),f=Math.abs(t);if(u<f&&u/f<y.EPSILON14)return[0,0];if(u>f&&f/u<y.EPSILON14)return[];if(n=-e/t,n<0)return[];let h=Math.sqrt(n);return[-h,h]}else if(e===0)return n=-r/t,n<0?[n,0]:[0,n];let o=r*r,s=4*t*e,c=mt(o,-s,y.EPSILON14);if(c<0)return[];let a=-.5*mt(r,y.sign(r)*Math.sqrt(c),y.EPSILON14);return r>0?[a/t,e/a]:[e/a,a/t]};var z=tt;var et={};et.computeDiscriminant=function(t,r,e,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof r!="number")throw new w("b is a required number.");if(typeof e!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let o=t*t,s=r*r,c=e*e,a=n*n;return 18*t*r*e*n+s*c-27*o*a-4*(t*c*e+s*r*n)};function nt(t,r,e,n){let o=t,s=r/3,c=e/3,a=n,u=o*c,f=s*a,h=s*s,d=c*c,p=o*c-h,q=o*a-s*c,m=s*a-d,l=4*p*m-q*q,E,x;if(l<0){let F,G,_;h*f>=u*d?(F=o,G=p,_=-2*s*p+o*q):(F=a,G=m,_=-a*q+2*c*m);let ut=-(_<0?-1:1)*Math.abs(F)*Math.sqrt(-l);x=-_+ut;let J=x/2,Y=J<0?-Math.pow(-J,1/3):Math.pow(J,1/3),K=x===ut?-Y:-G/Y;return E=G<=0?Y+K:-_/(Y*Y+K*K+G),h*f>=u*d?[(E-s)/o]:[-a/(E+c)]}let v=p,W=-2*s*p+o*q,L=m,B=-a*q+2*c*m,I=Math.sqrt(l),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-W)/3);E=2*Math.sqrt(-v);let R=Math.cos(P);x=E*R;let S=E*(-R/2-C*Math.sin(P)),M=x+S>2*s?x-s:S-s,N=o,D=M/N;P=Math.abs(Math.atan2(a*I,-B)/3),E=2*Math.sqrt(-L),R=Math.cos(P),x=E*R,S=E*(-R/2-C*Math.sin(P));let k=-a,Z=x+S<2*c?x+c:S+c,A=k/Z,Rt=N*Z,at=-M*Z-N*k,bt=M*k,V=(c*at-s*bt)/(-s*at+c*Rt);return D<=V?D<=A?V<=A?[D,V,A]:[D,A,V]:[A,D,V]:D<=A?[V,D,A]:V<=A?[V,A,D]:[A,V,D]}et.computeRealRoots=function(t,r,e,n){if(typeof t!="number")throw new w("a is a required number.");if(typeof r!="number")throw new w("b is a required number.");if(typeof e!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");let o,s;if(t===0)return z.computeRealRoots(r,e,n);if(r===0){if(e===0){if(n===0)return[0,0,0];s=-n/t;let c=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[c,c,c]}else if(n===0)return o=z.computeRealRoots(t,0,e),o.Length===0?[0]:[o[0],0,o[1]];return nt(t,0,e,n)}else{if(e===0)return n===0?(s=-r/t,s<0?[s,0,0]:[0,0,s]):nt(t,r,0,n);if(n===0)return o=z.computeRealRoots(t,r,e),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 nt(t,r,e,n)};var H=et;var rt={};rt.computeDiscriminant=function(t,r,e,n,o){if(typeof t!="number")throw new w("a is a required number.");if(typeof r!="number")throw new w("b is a required number.");if(typeof e!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof o!="number")throw new w("e is a required number.");let s=t*t,c=s*t,a=r*r,u=a*r,f=e*e,h=f*e,d=n*n,p=d*n,q=o*o,m=q*o;return a*f*d-4*u*p-4*t*h*d+18*t*r*e*p-27*s*d*d+256*c*m+o*(18*u*e*n-4*a*h+16*t*f*f-80*t*r*f*n-6*t*a*d+144*s*e*d)+q*(144*t*a*e-27*a*a-128*s*f-192*s*r*n)};function T(t,r,e,n){let o=t*t,s=r-3*o/8,c=e-r*t/2+o*t/8,a=n-e*t/4+r*o/16-3*o*o/256,u=H.computeRealRoots(1,2*s,s*s-4*a,-c*c);if(u.length>0){let f=-t/4,h=u[u.length-1];if(Math.abs(h)<y.EPSILON14){let d=z.computeRealRoots(1,s,a);if(d.length===2){let p=d[0],q=d[1],m;if(p>=0&&q>=0){let l=Math.sqrt(p),E=Math.sqrt(q);return[f-E,f-l,f+l,f+E]}else{if(p>=0&&q<0)return m=Math.sqrt(p),[f-m,f+m];if(p<0&&q>=0)return m=Math.sqrt(q),[f-m,f+m]}}return[]}else if(h>0){let d=Math.sqrt(h),p=(s+h-c/d)/2,q=(s+h+c/d)/2,m=z.computeRealRoots(1,d,p),l=z.computeRealRoots(1,-d,q);return m.length!==0?(m[0]+=f,m[1]+=f,l.length!==0?(l[0]+=f,l[1]+=f,m[1]<=l[0]?[m[0],m[1],l[0],l[1]]:l[1]<=m[0]?[l[0],l[1],m[0],m[1]]:m[0]>=l[0]&&m[1]<=l[1]?[l[0],m[0],m[1],l[1]]:l[0]>=m[0]&&l[1]<=m[1]?[m[0],l[0],l[1],m[1]]:m[0]>l[0]&&m[0]<l[1]?[l[0],m[0],l[1],m[1]]:[m[0],l[0],m[1],l[1]]):m):l.length!==0?(l[0]+=f,l[1]+=f,l):[]}}return[]}function j(t,r,e,n){let o=e*e,s=r*r,c=t*t,a=-2*r,u=e*t+s-4*n,f=c*n-e*r*t+o,h=H.computeRealRoots(1,a,u,f);if(h.length>0){let d=h[0],p=r-d,q=p*p,m=t/2,l=p/2,E=q-4*n,x=q+4*Math.abs(n),v=c-4*d,W=c+4*Math.abs(d),L,B;if(d<0||E*W<v*x){let N=Math.sqrt(v);L=N/2,B=N===0?0:(t*l-e)/N}else{let N=Math.sqrt(E);L=N===0?0:(t*l-e)/N,B=N/2}let I,C;m===0&&L===0?(I=0,C=0):y.sign(m)===y.sign(L)?(I=m+L,C=d/I):(C=m-L,I=d/C);let P,R;l===0&&B===0?(P=0,R=0):y.sign(l)===y.sign(B)?(P=l+B,R=n/P):(R=l-B,P=n/R);let S=z.computeRealRoots(1,I,P),M=z.computeRealRoots(1,C,R);if(S.length!==0)return M.length!==0?S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]:S;if(M.length!==0)return M}return[]}rt.computeRealRoots=function(t,r,e,n,o){if(typeof t!="number")throw new w("a is a required number.");if(typeof r!="number")throw new w("b is a required number.");if(typeof e!="number")throw new w("c is a required number.");if(typeof n!="number")throw new w("d is a required number.");if(typeof o!="number")throw new w("e is a required number.");if(Math.abs(t)<y.EPSILON15)return H.computeRealRoots(r,e,n,o);let s=r/t,c=e/t,a=n/t,u=o/t,f=s<0?1:0;switch(f+=c<0?f+1:f,f+=a<0?f+1:f,f+=u<0?f+1:f,f){case 0:return T(s,c,a,u);case 1:return j(s,c,a,u);case 2:return j(s,c,a,u);case 3:return T(s,c,a,u);case 4:return T(s,c,a,u);case 5:return j(s,c,a,u);case 6:return T(s,c,a,u);case 7:return T(s,c,a,u);case 8:return j(s,c,a,u);case 9:return T(s,c,a,u);case 10:return T(s,c,a,u);case 11:return j(s,c,a,u);case 12:return T(s,c,a,u);case 13:return T(s,c,a,u);case 14:return T(s,c,a,u);case 15:return T(s,c,a,u);default:return}};var dt=rt;var ot=class t{constructor(r,e){e=i.clone(e??i.ZERO),i.equals(e,i.ZERO)||i.normalize(e,e),this.origin=i.clone(r??i.ZERO),this.direction=e}static clone(r,e){if(g(r))return g(e)?(e.origin=i.clone(r.origin),e.direction=i.clone(r.direction),e):new t(r.origin,r.direction)}static getPoint(r,e,n){return $.typeOf.object("ray",r),$.typeOf.number("t",e),g(n)||(n=new i),n=i.multiplyByScalar(r.direction,e,n),i.add(r.origin,n,n)}},it=ot;var O={};O.rayPlane=function(t,r,e){if(!g(t))throw new w("ray is required.");if(!g(r))throw new w("plane is required.");g(e)||(e=new i);let n=t.origin,o=t.direction,s=r.normal,c=i.dot(s,o);if(Math.abs(c)<y.EPSILON15)return;let a=(-r.distance-i.dot(s,n))/c;if(!(a<0))return e=i.multiplyByScalar(o,a,e),i.add(n,e,e)};var Ot=new i,Pt=new i,Mt=new i,ht=new i,lt=new i;O.rayTriangleParametric=function(t,r,e,n,o){if(!g(t))throw new w("ray is required.");if(!g(r))throw new w("p0 is required.");if(!g(e))throw new w("p1 is required.");if(!g(n))throw new w("p2 is required.");o=o??!1;let s=t.origin,c=t.direction,a=i.subtract(e,r,Ot),u=i.subtract(n,r,Pt),f=i.cross(c,u,Mt),h=i.dot(a,f),d,p,q,m,l;if(o){if(h<y.EPSILON6||(d=i.subtract(s,r,ht),q=i.dot(d,f),q<0||q>h)||(p=i.cross(d,a,lt),m=i.dot(c,p),m<0||q+m>h))return;l=i.dot(u,p)/h}else{if(Math.abs(h)<y.EPSILON6)return;let E=1/h;if(d=i.subtract(s,r,ht),q=i.dot(d,f)*E,q<0||q>1||(p=i.cross(d,a,lt),m=i.dot(c,p)*E,m<0||q+m>1))return;l=i.dot(u,p)*E}return l};O.rayTriangle=function(t,r,e,n,o,s){let c=O.rayTriangleParametric(t,r,e,n,o);if(!(!g(c)||c<0))return g(s)||(s=new i),i.multiplyByScalar(t.direction,c,s),i.add(t.origin,s,s)};var Et=new it;O.lineSegmentTriangle=function(t,r,e,n,o,s,c){if(!g(t))throw new w("v0 is required.");if(!g(r))throw new w("v1 is required.");if(!g(e))throw new w("p0 is required.");if(!g(n))throw new w("p1 is required.");if(!g(o))throw new w("p2 is required.");let a=Et;i.clone(t,a.origin),i.subtract(r,t,a.direction),i.normalize(a.direction,a.direction);let u=O.rayTriangleParametric(a,e,n,o,s);if(!(!g(u)||u<0||u>i.distance(t,r)))return g(c)||(c=new i),i.multiplyByScalar(a.direction,u,c),i.add(a.origin,c,c)};function Ct(t,r,e,n){let o=r*r-4*t*e;if(o<0)return;if(o>0){let c=1/(2*t),a=Math.sqrt(o),u=(-r+a)*c,f=(-r-a)*c;return u<f?(n.root0=u,n.root1=f):(n.root0=f,n.root1=u),n}let s=-r/(2*t);if(s!==0)return n.root0=n.root1=s,n}var Nt={root0:0,root1:0};function yt(t,r,e){g(e)||(e=new U);let n=t.origin,o=t.direction,s=r.center,c=r.radius*r.radius,a=i.subtract(n,s,Mt),u=i.dot(o,o),f=2*i.dot(o,a),h=i.magnitudeSquared(a)-c,d=Ct(u,f,h,Nt);if(g(d))return e.start=d.root0,e.stop=d.root1,e}O.raySphere=function(t,r,e){if(!g(t))throw new w("ray is required.");if(!g(r))throw new w("sphere is required.");if(e=yt(t,r,e),!(!g(e)||e.stop<0))return e.start=Math.max(e.start,0),e};var Lt=new it;O.lineSegmentSphere=function(t,r,e,n){if(!g(t))throw new w("p0 is required.");if(!g(r))throw new w("p1 is required.");if(!g(e))throw new w("sphere is required.");let o=Lt;i.clone(t,o.origin);let s=i.subtract(r,t,o.direction),c=i.magnitude(s);if(i.normalize(s,s),n=yt(o,e,n),!(!g(n)||n.stop<0||n.start>c))return n.start=Math.max(n.start,0),n.stop=Math.min(n.stop,c),n};var It=new i,xt=new i;O.rayEllipsoid=function(t,r){if(!g(t))throw new w("ray is required.");if(!g(r))throw new w("ellipsoid is required.");let e=r.oneOverRadii,n=i.multiplyComponents(e,t.origin,It),o=i.multiplyComponents(e,t.direction,xt),s=i.magnitudeSquared(n),c=i.dot(n,o),a,u,f,h,d;if(s>1){if(c>=0)return;let p=c*c;if(a=s-1,u=i.magnitudeSquared(o),f=u*a,p<f)return;if(p>f){h=c*c-f,d=-c+Math.sqrt(h);let m=d/u,l=a/d;return m<l?new U(m,l):{start:l,stop:m}}let q=Math.sqrt(a/u);return new U(q,q)}else if(s<1)return a=s-1,u=i.magnitudeSquared(o),f=u*a,h=c*c-f,d=-c+Math.sqrt(h),new U(0,d/u);if(c<0)return u=i.magnitudeSquared(o),new U(0,-c/u)};var Bt=new U,Dt=new U,zt=new U;O.rayAxisAlignedBoundingBox=function(t,r,e){if(!g(t))throw new w("ray is required.");if(!g(r))throw new w("box is required.");g(e)||(e=new U);let n=st(t.origin.x,t.direction.x,r.minimum.x,r.maximum.x,Bt),o=st(t.origin.y,t.direction.y,r.minimum.y,r.maximum.y,Dt),s=st(t.origin.z,t.direction.z,r.minimum.z,r.maximum.z,zt);if(e.start=n.start>o.start?n.start:o.start,e.stop=n.stop<o.stop?n.stop:o.stop,!(n.start>o.stop||o.start>n.stop)&&!(e.start>s.stop||s.start>e.stop))return s.start>e.start&&(e.start=s.start),s.stop<e.stop&&(e.stop=s.stop),e};function st(t,r,e,n,o){if(o.start=(e-t)/r,o.stop=(n-t)/r,o.stop<o.start){let s=o.stop;o.stop=o.start,o.start=s}return o}function Q(t,r,e){let n=t+r;return y.sign(t)!==y.sign(r)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(r)))<e?0:n}O.quadraticVectorExpression=function(t,r,e,n,o){let s=n*n,c=o*o,a=(t[b.COLUMN1ROW1]-t[b.COLUMN2ROW2])*c,u=o*(n*Q(t[b.COLUMN1ROW0],t[b.COLUMN0ROW1],y.EPSILON15)+r.y),f=t[b.COLUMN0ROW0]*s+t[b.COLUMN2ROW2]*c+n*r.x+e,h=c*Q(t[b.COLUMN2ROW1],t[b.COLUMN1ROW2],y.EPSILON15),d=o*(n*Q(t[b.COLUMN2ROW0],t[b.COLUMN0ROW2])+r.z),p,q=[];if(d===0&&h===0){if(p=z.computeRealRoots(a,u,f),p.length===0)return q;let P=p[0],R=Math.sqrt(Math.max(1-P*P,0));if(q.push(new i(n,o*P,o*-R)),q.push(new i(n,o*P,o*R)),p.length===2){let S=p[1],M=Math.sqrt(Math.max(1-S*S,0));q.push(new i(n,o*S,o*-M)),q.push(new i(n,o*S,o*M))}return q}let m=d*d,l=h*h,E=a*a,x=d*h,v=E+l,W=2*(u*a+x),L=2*f*a+u*u-l+m,B=2*(f*u-x),I=f*f-m;if(v===0&&W===0&&L===0&&B===0)return q;p=dt.computeRealRoots(v,W,L,B,I);let C=p.length;if(C===0)return q;for(let P=0;P<C;++P){let R=p[P],S=R*R,M=Math.max(1-S,0),N=Math.sqrt(M),D;y.sign(a)===y.sign(f)?D=Q(a*S+f,u*R,y.EPSILON12):y.sign(f)===y.sign(u*R)?D=Q(a*S,u*R+f,y.EPSILON12):D=Q(a*S+u*R,f,y.EPSILON12);let k=Q(h*R,d,y.EPSILON15),Z=D*k;Z<0?q.push(new i(n,o*R,o*N)):Z>0?q.push(new i(n,o*R,o*-N)):N!==0?(q.push(new i(n,o*R,o*-N)),q.push(new i(n,o*R,o*N)),++P):q.push(new i(n,o*R,o*N))}return q};var ct=new i,wt=new i,qt=new i,X=new i,Tt=new i,vt=new b,Wt=new b,At=new b,Ut=new b,Vt=new b,gt=new b,pt=new b,St=new i,Qt=new i,Zt=new ft;O.grazingAltitudeLocation=function(t,r){if(!g(t))throw new w("ray is required.");if(!g(r))throw new w("ellipsoid is required.");let e=t.origin,n=t.direction;if(!i.equals(e,i.ZERO)){let I=r.geodeticSurfaceNormal(e,ct);if(i.dot(n,I)>=0)return e}let o=g(this.rayEllipsoid(t,r)),s=r.transformPositionToScaledSpace(n,ct),c=i.normalize(s,s),a=i.mostOrthogonalAxis(s,X),u=i.normalize(i.cross(a,c,wt),wt),f=i.normalize(i.cross(c,u,qt),qt),h=vt;h[0]=c.x,h[1]=c.y,h[2]=c.z,h[3]=u.x,h[4]=u.y,h[5]=u.z,h[6]=f.x,h[7]=f.y,h[8]=f.z;let d=b.transpose(h,Wt),p=b.fromScale(r.radii,At),q=b.fromScale(r.oneOverRadii,Ut),m=Vt;m[0]=0,m[1]=-n.z,m[2]=n.y,m[3]=n.z,m[4]=0,m[5]=-n.x,m[6]=-n.y,m[7]=n.x,m[8]=0;let l=b.multiply(b.multiply(d,q,gt),m,gt),E=b.multiply(b.multiply(l,p,pt),h,pt),x=b.multiplyByVector(l,e,Tt),v=O.quadraticVectorExpression(E,i.negate(x,ct),0,0,1),W,L,B=v.length;if(B>0){let I=i.clone(i.ZERO,Qt),C=Number.NEGATIVE_INFINITY;for(let R=0;R<B;++R){W=b.multiplyByVector(p,b.multiplyByVector(h,v[R],St),St);let S=i.normalize(i.subtract(W,e,X),X),M=i.dot(S,n);M>C&&(C=M,I=i.clone(W,I))}let P=r.cartesianToCartographic(I,Zt);return C=y.clamp(C,0,1),L=i.magnitude(i.subtract(I,e,X))*Math.sqrt(1-C*C),L=o?-L:L,P.height=L,r.cartographicToCartesian(P,new i)}};var kt=new i;O.lineSegmentPlane=function(t,r,e,n){if(!g(t))throw new w("endPoint0 is required.");if(!g(r))throw new w("endPoint1 is required.");if(!g(e))throw new w("plane is required.");g(n)||(n=new i);let o=i.subtract(r,t,kt),s=e.normal,c=i.dot(s,o);if(Math.abs(c)<y.EPSILON6)return;let a=i.dot(s,t),u=-(e.distance+a)/c;if(!(u<0||u>1))return i.multiplyByScalar(o,u,n),i.add(t,n,n),n};O.trianglePlaneIntersection=function(t,r,e,n){if(!g(t)||!g(r)||!g(e)||!g(n))throw new w("p0, p1, p2, and plane are required.");let o=n.normal,s=n.distance,c=i.dot(o,t)+s<0,a=i.dot(o,r)+s<0,u=i.dot(o,e)+s<0,f=0;f+=c?1:0,f+=a?1:0,f+=u?1:0;let h,d;if((f===1||f===2)&&(h=new i,d=new i),f===1){if(c)return O.lineSegmentPlane(t,r,n,h),O.lineSegmentPlane(t,e,n,d),{positions:[t,r,e,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return O.lineSegmentPlane(r,e,n,h),O.lineSegmentPlane(r,t,n,d),{positions:[t,r,e,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return O.lineSegmentPlane(e,t,n,h),O.lineSegmentPlane(e,r,n,d),{positions:[t,r,e,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(f===2)if(c)if(a){if(!u)return O.lineSegmentPlane(t,e,n,h),O.lineSegmentPlane(r,e,n,d),{positions:[t,r,e,h,d],indices:[0,1,4,0,4,3,2,3,4]}}else return O.lineSegmentPlane(e,r,n,h),O.lineSegmentPlane(t,r,n,d),{positions:[t,r,e,h,d],indices:[2,0,4,2,4,3,1,3,4]};else return O.lineSegmentPlane(r,t,n,h),O.lineSegmentPlane(e,t,n,d),{positions:[t,r,e,h,d],indices:[1,2,4,1,4,3,0,3,4]}};var gn=O;export{it as a,gn as b}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ZQVZZSUG.js b/plugins/feature/map/Cesium/Workers/chunk-ZQVZZSUG.js deleted file mode 100644 index 4b9094859..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-ZQVZZSUG.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{a as Q}from"./chunk-NEXD3R4K.js";import{a as N}from"./chunk-4W2MZV6I.js";import{a as _}from"./chunk-S3L7VZFL.js";import{a as K}from"./chunk-JQLYZQ6V.js";import{a as H}from"./chunk-J3L5WX3X.js";import{b as J,c as W,d as L}from"./chunk-AVPLM4UI.js";import{d as j}from"./chunk-ZYYZDBKK.js";import{a as S}from"./chunk-WER4LUMF.js";import{a as b,c as E,f as Z}from"./chunk-FGKVHLJ4.js";import{a as Y}from"./chunk-YRCAQUFT.js";import{a as F}from"./chunk-ELJAHN3H.js";import{e as g}from"./chunk-3BGP4HCL.js";var k=new E,ot=new b,nt=new b,it=new b,rt=new b;function O(t){t=t??Z.EMPTY_OBJECT;let n=t.length,e=t.topRadius,h=t.bottomRadius,o=t.vertexFormat??_.DEFAULT,s=t.slices??128;if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(s<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===N.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=e??0,_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=t._offsetAttribute??-1,n};var X=new _,D={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=n??0;let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],s=t[n++],p=t[n++],P=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=s,e._bottomRadius=p,e._slices=P,e._offsetAttribute=w===-1?void 0:w,e):(D.length=o,D.topRadius=s,D.bottomRadius=p,D.slices=P,D.offsetAttribute=w===-1?void 0:w,new O(D))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,s=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=s+s,P=s+p,w=p+p,C=Q.computePositions(n,e,h,s,!0),z=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,G=o.normal||o.tangent||o.bitangent;if(G){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i<s;i++){let V=i/s*Y.TWO_PI,tt=B*Math.cos(V),et=B*Math.sin(V);G&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<s;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let $=12*s-12,r=K.createTypedArray(w,$),a=0,x=0;for(i=0;i<s-1;i++)r[a++]=x,r[a++]=x+2,r[a++]=x+3,r[a++]=x,r[a++]=x+3,r[a++]=x+1,x+=2;for(r[a++]=p-2,r[a++]=0,r[a++]=1,r[a++]=p-2,r[a++]=1,r[a++]=p-1,i=1;i<s-1;i++)r[a++]=p+i+1,r[a++]=p+i,r[a++]=p;for(i=1;i<s-1;i++)r[a++]=P,r[a++]=P+i,r[a++]=P+i+1;let U=0;if(o.st){let T=Math.max(e,h);for(i=0;i<w;i++){let f=b.fromArray(C,i*3,rt);z[U++]=(f.x+T)/(2*T),z[U++]=(f.y+T)/(2*T)}}let v=new H;o.position&&(v.position=new L({componentDatatype:S.DOUBLE,componentsPerAttribute:3,values:C})),o.normal&&(v.normal=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(v.tangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(v.bitangent=new L({componentDatatype:S.FLOAT,componentsPerAttribute:3,values:u})),o.st&&(v.st=new L({componentDatatype:S.FLOAT,componentsPerAttribute:2,values:z})),k.x=n*.5,k.y=Math.max(h,e);let I=new j(b.ZERO,E.magnitude(k));if(g(t._offsetAttribute)){n=C.length;let T=t._offsetAttribute===N.NONE?0:1,f=new Uint8Array(n/3).fill(T);v.applyOffset=new L({componentDatatype:S.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new W({attributes:v,indices:r,primitiveType:J.TRIANGLES,boundingSphere:I,offsetAttribute:t._offsetAttribute})};var M;O.getUnitCylinder=function(){return g(M)||(M=O.createGeometry(new O({topRadius:1,bottomRadius:1,length:1,vertexFormat:_.POSITION_ONLY}))),M};var yt=O;export{yt as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ZV4OMVCY.js b/plugins/feature/map/Cesium/Workers/chunk-ZV4OMVCY.js new file mode 100644 index 000000000..f93febdc1 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/chunk-ZV4OMVCY.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as b}from"./chunk-GNBKSQYP.js";import{a as u}from"./chunk-FZSSAWMQ.js";import{a as O}from"./chunk-ILBQ77ZM.js";import{b as w,c as h,d as y}from"./chunk-7RNSURKI.js";import{c as l}from"./chunk-THB3EPLO.js";import{a as p}from"./chunk-WCOEOHX5.js";import{a as i,c as A}from"./chunk-OSVSBQDY.js";import{a as d,b as c}from"./chunk-OU2IPMYE.js";import{f as x}from"./chunk-H7SJWKIY.js";var D=new i;function f(r){r=r??A.EMPTY_OBJECT;let o=r.minimum,m=r.maximum;if(c.typeOf.object("min",o),c.typeOf.object("max",m),x(r.offsetAttribute)&&r.offsetAttribute===b.TOP)throw new d("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let a=r.vertexFormat??u.DEFAULT;this._minimum=i.clone(o),this._maximum=i.clone(m),this._vertexFormat=a,this._offsetAttribute=r.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(r){r=r??A.EMPTY_OBJECT;let o=r.dimensions;c.typeOf.object("dimensions",o),c.typeOf.number.greaterThanOrEquals("dimensions.x",o.x,0),c.typeOf.number.greaterThanOrEquals("dimensions.y",o.y,0),c.typeOf.number.greaterThanOrEquals("dimensions.z",o.z,0);let m=i.multiplyByScalar(o,.5,new i);return new f({minimum:i.negate(m,new i),maximum:m,vertexFormat:r.vertexFormat,offsetAttribute:r.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(r){return c.typeOf.object("boundingBox",r),new f({minimum:r.minimum,maximum:r.maximum})};f.packedLength=2*i.packedLength+u.packedLength+1;f.pack=function(r,o,m){return c.typeOf.object("value",r),c.defined("array",o),m=m??0,i.pack(r._minimum,o,m),i.pack(r._maximum,o,m+i.packedLength),u.pack(r._vertexFormat,o,m+2*i.packedLength),o[m+2*i.packedLength+u.packedLength]=r._offsetAttribute??-1,o};var _=new i,g=new i,k=new u,F={minimum:_,maximum:g,vertexFormat:k,offsetAttribute:void 0};f.unpack=function(r,o,m){c.defined("array",r),o=o??0;let a=i.unpack(r,o,_),s=i.unpack(r,o+i.packedLength,g),n=u.unpack(r,o+2*i.packedLength,k),e=r[o+2*i.packedLength+u.packedLength];return x(m)?(m._minimum=i.clone(a,m._minimum),m._maximum=i.clone(s,m._maximum),m._vertexFormat=u.clone(n,m._vertexFormat),m._offsetAttribute=e===-1?void 0:e,m):(F.offsetAttribute=e===-1?void 0:e,new f(F))};f.createGeometry=function(r){let o=r._minimum,m=r._maximum,a=r._vertexFormat;if(i.equals(o,m))return;let s=new O,n,e;if(a.position&&(a.st||a.normal||a.tangent||a.bitangent)){if(a.position&&(e=new Float64Array(72),e[0]=o.x,e[1]=o.y,e[2]=m.z,e[3]=m.x,e[4]=o.y,e[5]=m.z,e[6]=m.x,e[7]=m.y,e[8]=m.z,e[9]=o.x,e[10]=m.y,e[11]=m.z,e[12]=o.x,e[13]=o.y,e[14]=o.z,e[15]=m.x,e[16]=o.y,e[17]=o.z,e[18]=m.x,e[19]=m.y,e[20]=o.z,e[21]=o.x,e[22]=m.y,e[23]=o.z,e[24]=m.x,e[25]=o.y,e[26]=o.z,e[27]=m.x,e[28]=m.y,e[29]=o.z,e[30]=m.x,e[31]=m.y,e[32]=m.z,e[33]=m.x,e[34]=o.y,e[35]=m.z,e[36]=o.x,e[37]=o.y,e[38]=o.z,e[39]=o.x,e[40]=m.y,e[41]=o.z,e[42]=o.x,e[43]=m.y,e[44]=m.z,e[45]=o.x,e[46]=o.y,e[47]=m.z,e[48]=o.x,e[49]=m.y,e[50]=o.z,e[51]=m.x,e[52]=m.y,e[53]=o.z,e[54]=m.x,e[55]=m.y,e[56]=m.z,e[57]=o.x,e[58]=m.y,e[59]=m.z,e[60]=o.x,e[61]=o.y,e[62]=o.z,e[63]=m.x,e[64]=o.y,e[65]=o.z,e[66]=m.x,e[67]=o.y,e[68]=m.z,e[69]=o.x,e[70]=o.y,e[71]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e})),a.normal){let t=new Float32Array(72);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,t[12]=0,t[13]=0,t[14]=-1,t[15]=0,t[16]=0,t[17]=-1,t[18]=0,t[19]=0,t[20]=-1,t[21]=0,t[22]=0,t[23]=-1,t[24]=1,t[25]=0,t[26]=0,t[27]=1,t[28]=0,t[29]=0,t[30]=1,t[31]=0,t[32]=0,t[33]=1,t[34]=0,t[35]=0,t[36]=-1,t[37]=0,t[38]=0,t[39]=-1,t[40]=0,t[41]=0,t[42]=-1,t[43]=0,t[44]=0,t[45]=-1,t[46]=0,t[47]=0,t[48]=0,t[49]=1,t[50]=0,t[51]=0,t[52]=1,t[53]=0,t[54]=0,t[55]=1,t[56]=0,t[57]=0,t[58]=1,t[59]=0,t[60]=0,t[61]=-1,t[62]=0,t[63]=0,t[64]=-1,t[65]=0,t[66]=0,t[67]=-1,t[68]=0,t[69]=0,t[70]=-1,t[71]=0,s.normal=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.st){let t=new Float32Array(48);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,t[8]=1,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=1,t[14]=1,t[15]=1,t[16]=0,t[17]=0,t[18]=1,t[19]=0,t[20]=1,t[21]=1,t[22]=0,t[23]=1,t[24]=1,t[25]=0,t[26]=0,t[27]=0,t[28]=0,t[29]=1,t[30]=1,t[31]=1,t[32]=1,t[33]=0,t[34]=0,t[35]=0,t[36]=0,t[37]=1,t[38]=1,t[39]=1,t[40]=0,t[41]=0,t[42]=1,t[43]=0,t[44]=1,t[45]=1,t[46]=0,t[47]=1,s.st=new y({componentDatatype:p.FLOAT,componentsPerAttribute:2,values:t})}if(a.tangent){let t=new Float32Array(72);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=-1,t[13]=0,t[14]=0,t[15]=-1,t[16]=0,t[17]=0,t[18]=-1,t[19]=0,t[20]=0,t[21]=-1,t[22]=0,t[23]=0,t[24]=0,t[25]=1,t[26]=0,t[27]=0,t[28]=1,t[29]=0,t[30]=0,t[31]=1,t[32]=0,t[33]=0,t[34]=1,t[35]=0,t[36]=0,t[37]=-1,t[38]=0,t[39]=0,t[40]=-1,t[41]=0,t[42]=0,t[43]=-1,t[44]=0,t[45]=0,t[46]=-1,t[47]=0,t[48]=-1,t[49]=0,t[50]=0,t[51]=-1,t[52]=0,t[53]=0,t[54]=-1,t[55]=0,t[56]=0,t[57]=-1,t[58]=0,t[59]=0,t[60]=1,t[61]=0,t[62]=0,t[63]=1,t[64]=0,t[65]=0,t[66]=1,t[67]=0,t[68]=0,t[69]=1,t[70]=0,t[71]=0,s.tangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}if(a.bitangent){let t=new Float32Array(72);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=1,t[14]=0,t[15]=0,t[16]=1,t[17]=0,t[18]=0,t[19]=1,t[20]=0,t[21]=0,t[22]=1,t[23]=0,t[24]=0,t[25]=0,t[26]=1,t[27]=0,t[28]=0,t[29]=1,t[30]=0,t[31]=0,t[32]=1,t[33]=0,t[34]=0,t[35]=1,t[36]=0,t[37]=0,t[38]=1,t[39]=0,t[40]=0,t[41]=1,t[42]=0,t[43]=0,t[44]=1,t[45]=0,t[46]=0,t[47]=1,t[48]=0,t[49]=0,t[50]=1,t[51]=0,t[52]=0,t[53]=1,t[54]=0,t[55]=0,t[56]=1,t[57]=0,t[58]=0,t[59]=1,t[60]=0,t[61]=0,t[62]=1,t[63]=0,t[64]=0,t[65]=1,t[66]=0,t[67]=0,t[68]=1,t[69]=0,t[70]=0,t[71]=1,s.bitangent=new y({componentDatatype:p.FLOAT,componentsPerAttribute:3,values:t})}n=new Uint16Array(36),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else e=new Float64Array(24),e[0]=o.x,e[1]=o.y,e[2]=o.z,e[3]=m.x,e[4]=o.y,e[5]=o.z,e[6]=m.x,e[7]=m.y,e[8]=o.z,e[9]=o.x,e[10]=m.y,e[11]=o.z,e[12]=o.x,e[13]=o.y,e[14]=m.z,e[15]=m.x,e[16]=o.y,e[17]=m.z,e[18]=m.x,e[19]=m.y,e[20]=m.z,e[21]=o.x,e[22]=m.y,e[23]=m.z,s.position=new y({componentDatatype:p.DOUBLE,componentsPerAttribute:3,values:e}),n=new Uint16Array(36),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;let v=i.subtract(m,o,D),L=i.magnitude(v)*.5;if(x(r._offsetAttribute)){let t=e.length,T=r._offsetAttribute===b.NONE?0:1,E=new Uint8Array(t/3).fill(T);s.applyOffset=new y({componentDatatype:p.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}return new h({attributes:s,indices:n,primitiveType:w.TRIANGLES,boundingSphere:new l(i.ZERO,L),offsetAttribute:r._offsetAttribute})};var z;f.getUnitBox=function(){return x(z)||(z=f.createGeometry(f.fromDimensions({dimensions:new i(1,1,1),vertexFormat:u.POSITION_ONLY}))),z};var R=f;export{R as a}; diff --git a/plugins/feature/map/Cesium/Workers/chunk-ZYYZDBKK.js b/plugins/feature/map/Cesium/Workers/chunk-ZYYZDBKK.js deleted file mode 100644 index 390466b01..000000000 --- a/plugins/feature/map/Cesium/Workers/chunk-ZYYZDBKK.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 - * - * 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. - */ - -import{b as Z,h as A}from"./chunk-3PT5NNSP.js";import{a as n,b as v,d as N,e as _}from"./chunk-FGKVHLJ4.js";import{a as on}from"./chunk-YRCAQUFT.js";import{a as en,b as h}from"./chunk-ELJAHN3H.js";import{e as x}from"./chunk-3BGP4HCL.js";function I(e){this._ellipsoid=e??N.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});I.prototype.project=function(e,t){let o=this._semimajorAxis,c=e.longitude*o,r=e.latitude*o,d=e.height;return x(t)?(t.x=c,t.y=r,t.z=d,t):new n(c,r,d)};I.prototype.unproject=function(e,t){if(!x(e))throw new en("cartesian is required");let o=this._oneOverSemimajorAxis,c=e.x*o,r=e.y*o,d=e.z;return x(t)?(t.longitude=c,t.latitude=r,t.height=d,t):new v(c,r,d)};var k=I;var sn={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},U=Object.freeze(sn);function mn(e,t){this.start=e??0,this.stop=t??0}var cn=mn;function a(e,t){this.center=n.clone(e??n.ZERO),this.radius=t??0}var X=new n,F=new n,Y=new n,J=new n,K=new n,Q=new n,$=new n,b=new n,L=new n,H=new n,nn=new n,tn=new n,un=4/3*on.PI;a.fromPoints=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=n.clone(e[0],$),c=n.clone(o,X),r=n.clone(o,F),d=n.clone(o,Y),f=n.clone(o,J),s=n.clone(o,K),m=n.clone(o,Q),z=e.length,y;for(y=1;y<z;y++){n.clone(e[y],o);let C=o.x,M=o.y,w=o.z;C<c.x&&n.clone(o,c),C>f.x&&n.clone(o,f),M<r.y&&n.clone(o,r),M>s.y&&n.clone(o,s),w<d.z&&n.clone(o,d),w>m.z&&n.clone(o,m)}let u=n.magnitudeSquared(n.subtract(f,c,b)),i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=c,q=f,O=u;i>O&&(O=i,T=r,q=s),B>O&&(O=B,T=d,q=m);let p=L;p.x=(T.x+q.x)*.5,p.y=(T.y+q.y)*.5,p.z=(T.z+q.z)*.5;let S=n.magnitudeSquared(n.subtract(q,p,b)),l=Math.sqrt(S),j=H;j.x=c.x,j.y=r.y,j.z=d.z;let P=nn;P.x=f.x,P.y=s.y,P.z=m.z;let E=n.midpoint(j,P,tn),D=0;for(y=0;y<z;y++){n.clone(e[y],o);let C=n.magnitude(n.subtract(o,E,b));C>D&&(D=C);let M=n.magnitudeSquared(n.subtract(o,p,b));if(M>S){let w=Math.sqrt(M);l=(l+w)*.5,S=l*l;let g=w-l;p.x=(l*p.x+g*o.x)/w,p.y=(l*p.y+g*o.y)/w,p.z=(l*p.z+g*o.z)/w}}return l<D?(n.clone(p,t.center),t.radius=l):(n.clone(E,t.center),t.radius=D),t};var rn=new k,xn=new n,yn=new n,G=new v,V=new v;a.fromRectangle2D=function(e,t,o){return a.fromRectangleWithHeights2D(e,t,0,0,o)};a.fromRectangleWithHeights2D=function(e,t,o,c,r){if(x(r)||(r=new a),!x(e))return r.center=n.clone(n.ZERO,r.center),r.radius=0,r;rn._ellipsoid=N.default,t=t??rn,A.southwest(e,G),G.height=o,A.northeast(e,V),V.height=c;let d=t.project(G,xn),f=t.project(V,yn),s=f.x-d.x,m=f.y-d.y,z=f.z-d.z;r.radius=Math.sqrt(s*s+m*m+z*z)*.5;let y=r.center;return y.x=d.x+s*.5,y.y=d.y+m*.5,y.z=d.z+z*.5,r};var ln=[];a.fromRectangle3D=function(e,t,o,c){if(t=t??N.default,o=o??0,x(c)||(c=new a),!x(e))return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;let r=A.subsample(e,t,o,ln);return a.fromPoints(r,c)};a.fromVertices=function(e,t,o,c){if(x(c)||(c=new a),!x(e)||e.length===0)return c.center=n.clone(n.ZERO,c.center),c.radius=0,c;t=t??n.ZERO,o=o??3,h.typeOf.number.greaterThanOrEquals("stride",o,3);let r=$;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;let d=n.clone(r,X),f=n.clone(r,F),s=n.clone(r,Y),m=n.clone(r,J),z=n.clone(r,K),y=n.clone(r,Q),u=e.length,i;for(i=0;i<u;i+=o){let w=e[i]+t.x,g=e[i+1]+t.y,R=e[i+2]+t.z;r.x=w,r.y=g,r.z=R,w<d.x&&n.clone(r,d),w>m.x&&n.clone(r,m),g<f.y&&n.clone(r,f),g>z.y&&n.clone(r,z),R<s.z&&n.clone(r,s),R>y.z&&n.clone(r,y)}let B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=n.magnitudeSquared(n.subtract(y,s,b)),O=d,p=m,S=B;T>S&&(S=T,O=f,p=z),q>S&&(S=q,O=s,p=y);let l=L;l.x=(O.x+p.x)*.5,l.y=(O.y+p.y)*.5,l.z=(O.z+p.z)*.5;let j=n.magnitudeSquared(n.subtract(p,l,b)),P=Math.sqrt(j),E=H;E.x=d.x,E.y=f.y,E.z=s.z;let D=nn;D.x=m.x,D.y=z.y,D.z=y.z;let C=n.midpoint(E,D,tn),M=0;for(i=0;i<u;i+=o){r.x=e[i]+t.x,r.y=e[i+1]+t.y,r.z=e[i+2]+t.z;let w=n.magnitude(n.subtract(r,C,b));w>M&&(M=w);let g=n.magnitudeSquared(n.subtract(r,l,b));if(g>j){let R=Math.sqrt(g);P=(P+R)*.5,j=P*P;let W=R-P;l.x=(P*l.x+W*r.x)/R,l.y=(P*l.y+W*r.y)/R,l.z=(P*l.z+W*r.z)/R}}return P<M?(n.clone(l,c.center),c.radius=P):(n.clone(C,c.center),c.radius=M),c};a.fromEncodedCartesianVertices=function(e,t,o){if(x(o)||(o=new a),!x(e)||!x(t)||e.length!==t.length||e.length===0)return o.center=n.clone(n.ZERO,o.center),o.radius=0,o;let c=$;c.x=e[0]+t[0],c.y=e[1]+t[1],c.z=e[2]+t[2];let r=n.clone(c,X),d=n.clone(c,F),f=n.clone(c,Y),s=n.clone(c,J),m=n.clone(c,K),z=n.clone(c,Q),y=e.length,u;for(u=0;u<y;u+=3){let M=e[u]+t[u],w=e[u+1]+t[u+1],g=e[u+2]+t[u+2];c.x=M,c.y=w,c.z=g,M<r.x&&n.clone(c,r),M>s.x&&n.clone(c,s),w<d.y&&n.clone(c,d),w>m.y&&n.clone(c,m),g<f.z&&n.clone(c,f),g>z.z&&n.clone(c,z)}let i=n.magnitudeSquared(n.subtract(s,r,b)),B=n.magnitudeSquared(n.subtract(m,d,b)),T=n.magnitudeSquared(n.subtract(z,f,b)),q=r,O=s,p=i;B>p&&(p=B,q=d,O=m),T>p&&(p=T,q=f,O=z);let S=L;S.x=(q.x+O.x)*.5,S.y=(q.y+O.y)*.5,S.z=(q.z+O.z)*.5;let l=n.magnitudeSquared(n.subtract(O,S,b)),j=Math.sqrt(l),P=H;P.x=r.x,P.y=d.y,P.z=f.z;let E=nn;E.x=s.x,E.y=m.y,E.z=z.z;let D=n.midpoint(P,E,tn),C=0;for(u=0;u<y;u+=3){c.x=e[u]+t[u],c.y=e[u+1]+t[u+1],c.z=e[u+2]+t[u+2];let M=n.magnitude(n.subtract(c,D,b));M>C&&(C=M);let w=n.magnitudeSquared(n.subtract(c,S,b));if(w>l){let g=Math.sqrt(w);j=(j+g)*.5,l=j*j;let R=g-j;S.x=(j*S.x+R*c.x)/g,S.y=(j*S.y+R*c.y)/g,S.z=(j*S.z+R*c.z)/g}}return j<C?(n.clone(S,o.center),o.radius=j):(n.clone(D,o.center),o.radius=C),o};a.fromCornerPoints=function(e,t,o){h.typeOf.object("corner",e),h.typeOf.object("oppositeCorner",t),x(o)||(o=new a);let c=n.midpoint(e,t,o.center);return o.radius=n.distance(c,t),o};a.fromEllipsoid=function(e,t){return h.typeOf.object("ellipsoid",e),x(t)||(t=new a),n.clone(n.ZERO,t.center),t.radius=e.maximumRadius,t};var pn=new n;a.fromBoundingSpheres=function(e,t){if(x(t)||(t=new a),!x(e)||e.length===0)return t.center=n.clone(n.ZERO,t.center),t.radius=0,t;let o=e.length;if(o===1)return a.clone(e[0],t);if(o===2)return a.union(e[0],e[1],t);let c=[],r;for(r=0;r<o;r++)c.push(e[r].center);t=a.fromPoints(c,t);let d=t.center,f=t.radius;for(r=0;r<o;r++){let s=e[r];f=Math.max(f,n.distance(d,s.center,pn)+s.radius)}return t.radius=f,t};var hn=new n,zn=new n,Sn=new n;a.fromOrientedBoundingBox=function(e,t){h.defined("orientedBoundingBox",e),x(t)||(t=new a);let o=e.halfAxes,c=_.getColumn(o,0,hn),r=_.getColumn(o,1,zn),d=_.getColumn(o,2,Sn);return n.add(c,r,c),n.add(c,d,c),t.center=n.clone(e.center,t.center),t.radius=n.magnitude(c),t};var wn=new n,Pn=new n;a.fromTransformation=function(e,t){h.typeOf.object("transformation",e),x(t)||(t=new a);let o=Z.getTranslation(e,wn),c=Z.getScale(e,Pn),r=.5*n.magnitude(c);return t.center=n.clone(o,t.center),t.radius=r,t};a.clone=function(e,t){if(x(e))return x(t)?(t.center=n.clone(e.center,t.center),t.radius=e.radius,t):new a(e.center,e.radius)};a.packedLength=4;a.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let c=e.center;return t[o++]=c.x,t[o++]=c.y,t[o++]=c.z,t[o]=e.radius,t};a.unpack=function(e,t,o){h.defined("array",e),t=t??0,x(o)||(o=new a);let c=o.center;return c.x=e[t++],c.y=e[t++],c.z=e[t++],o.radius=e[t],o};var gn=new n,On=new n;a.union=function(e,t,o){h.typeOf.object("left",e),h.typeOf.object("right",t),x(o)||(o=new a);let c=e.center,r=e.radius,d=t.center,f=t.radius,s=n.subtract(d,c,gn),m=n.magnitude(s);if(r>=m+f)return e.clone(o),o;if(f>=m+r)return t.clone(o),o;let z=(r+m+f)*.5,y=n.multiplyByScalar(s,(-r+z)/m,On);return n.add(y,c,y),n.clone(y,o.center),o.radius=z,o};var jn=new n;a.expand=function(e,t,o){h.typeOf.object("sphere",e),h.typeOf.object("point",t),o=a.clone(e,o);let c=n.magnitude(n.subtract(t,o.center,jn));return c>o.radius&&(o.radius=c),o};a.intersectPlane=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("plane",t);let o=e.center,c=e.radius,r=t.normal,d=n.dot(r,o)+t.distance;return d<-c?U.OUTSIDE:d<c?U.INTERSECTING:U.INSIDE};a.transform=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=Z.getMaximumScale(t)*e.radius,o};var bn=new n;a.distanceSquaredTo=function(e,t){h.typeOf.object("sphere",e),h.typeOf.object("cartesian",t);let o=n.subtract(e.center,t,bn),c=n.magnitude(o)-e.radius;return c<=0?0:c*c};a.transformWithoutScale=function(e,t,o){return h.typeOf.object("sphere",e),h.typeOf.object("transform",t),x(o)||(o=new a),o.center=Z.multiplyByPoint(t,e.center,o.center),o.radius=e.radius,o};var qn=new n;a.computePlaneDistances=function(e,t,o,c){h.typeOf.object("sphere",e),h.typeOf.object("position",t),h.typeOf.object("direction",o),x(c)||(c=new cn);let r=n.subtract(e.center,t,qn),d=n.dot(o,r);return c.start=d-e.radius,c.stop=d+e.radius,c};var an=new n,Mn=new n,Tn=new n,Cn=new n,Rn=new n,En=new v,fn=new Array(8);for(let e=0;e<8;++e)fn[e]=new n;var dn=new k;a.projectTo2D=function(e,t,o){h.typeOf.object("sphere",e),dn._ellipsoid=N.default,t=t??dn;let c=t.ellipsoid,r=e.center,d=e.radius,f;n.equals(r,n.ZERO)?f=n.clone(n.UNIT_X,an):f=c.geodeticSurfaceNormal(r,an);let s=n.cross(n.UNIT_Z,f,Mn);n.normalize(s,s);let m=n.cross(f,s,Tn);n.normalize(m,m),n.multiplyByScalar(f,d,f),n.multiplyByScalar(m,d,m),n.multiplyByScalar(s,d,s);let z=n.negate(m,Rn),y=n.negate(s,Cn),u=fn,i=u[0];n.add(f,m,i),n.add(i,s,i),i=u[1],n.add(f,m,i),n.add(i,y,i),i=u[2],n.add(f,z,i),n.add(i,y,i),i=u[3],n.add(f,z,i),n.add(i,s,i),n.negate(f,f),i=u[4],n.add(f,m,i),n.add(i,s,i),i=u[5],n.add(f,m,i),n.add(i,y,i),i=u[6],n.add(f,z,i),n.add(i,y,i),i=u[7],n.add(f,z,i),n.add(i,s,i);let B=u.length;for(let p=0;p<B;++p){let S=u[p];n.add(r,S,S);let l=c.cartesianToCartographic(S,En);t.project(l,S)}o=a.fromPoints(u,o),r=o.center;let T=r.x,q=r.y,O=r.z;return r.x=O,r.y=T,r.z=q,o};a.isOccluded=function(e,t){return h.typeOf.object("sphere",e),h.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};a.equals=function(e,t){return e===t||x(e)&&x(t)&&n.equals(e.center,t.center)&&e.radius===t.radius};a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)};a.prototype.distanceSquaredTo=function(e){return a.distanceSquaredTo(this,e)};a.prototype.computePlaneDistances=function(e,t,o){return a.computePlaneDistances(this,e,t,o)};a.prototype.isOccluded=function(e){return a.isOccluded(this,e)};a.prototype.equals=function(e){return a.equals(this,e)};a.prototype.clone=function(e){return a.clone(this,e)};a.prototype.volume=function(){let e=this.radius;return un*e*e*e};var Ln=a;export{k as a,U as b,cn as c,Ln as d}; diff --git a/plugins/feature/map/Cesium/Workers/combineGeometry.js b/plugins/feature/map/Cesium/Workers/combineGeometry.js index ce87e6990..50d47d54e 100644 --- a/plugins/feature/map/Cesium/Workers/combineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/combineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as e}from"./chunk-3RMLTUUP.js";import{a as r}from"./chunk-U3N6LNE4.js";import"./chunk-L4JCTZ6Y.js";import"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import"./chunk-3BGP4HCL.js";function n(o,t){let m=e.unpackCombineGeometryParameters(o),i=e.combineGeometry(m);return e.packCombineGeometryResults(i,t)}var c=r(n);export{c as default}; +import{a as e}from"./chunk-PPEMEUUU.js";import{a as r}from"./chunk-JJVL7F22.js";import"./chunk-MQTDGHHT.js";import"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";function n(o,t){let m=e.unpackCombineGeometryParameters(o),i=e.combineGeometry(m);return e.packCombineGeometryResults(i,t)}var c=r(n);export{c as default}; diff --git a/plugins/feature/map/Cesium/Workers/createBoxGeometry.js b/plugins/feature/map/Cesium/Workers/createBoxGeometry.js index 683047eaf..2c42c73b4 100644 --- a/plugins/feature/map/Cesium/Workers/createBoxGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createBoxGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-ITJR6PVW.js";import"./chunk-4W2MZV6I.js";import"./chunk-S3L7VZFL.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as o}from"./chunk-3BGP4HCL.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; +import{a as r}from"./chunk-ZV4OMVCY.js";import"./chunk-GNBKSQYP.js";import"./chunk-FZSSAWMQ.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as o}from"./chunk-H7SJWKIY.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; diff --git a/plugins/feature/map/Cesium/Workers/createBoxOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createBoxOutlineGeometry.js index 76b61c1d1..f28a64d0b 100644 --- a/plugins/feature/map/Cesium/Workers/createBoxOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createBoxOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as d}from"./chunk-4W2MZV6I.js";import{a as l}from"./chunk-J3L5WX3X.js";import{b as O,c as h,d as p}from"./chunk-AVPLM4UI.js";import{d as A}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a}from"./chunk-WER4LUMF.js";import{a as m,f as s}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as b,b as r}from"./chunk-ELJAHN3H.js";import{e as c}from"./chunk-3BGP4HCL.js";var g=new m;function f(e){e=e??s.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(r.typeOf.object("min",t),r.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===d.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}f.fromDimensions=function(e){e=e??s.EMPTY_OBJECT;let t=e.dimensions;r.typeOf.object("dimensions",t),r.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),r.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),r.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new f({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(e){return r.typeOf.object("boundindBox",e),new f({minimum:e.minimum,maximum:e.maximum})};f.packedLength=2*m.packedLength+1;f.pack=function(e,t,n){return r.typeOf.object("value",e),r.defined("array",t),n=n??0,m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=e._offsetAttribute??-1,t};var w=new m,x=new m,_={minimum:w,maximum:x,offsetAttribute:void 0};f.unpack=function(e,t,n){r.defined("array",e),t=t??0;let u=m.unpack(e,t,w),o=m.unpack(e,t+m.packedLength,x),i=e[t+m.packedLength*2];return c(n)?(n._min=m.clone(u,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=i===-1?void 0:i,n):(_.offsetAttribute=i===-1?void 0:i,new f(_))};f.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let u=new l,o=new Uint16Array(12*2),i=new Float64Array(8*3);i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=n.x,i[4]=t.y,i[5]=t.z,i[6]=n.x,i[7]=n.y,i[8]=t.z,i[9]=t.x,i[10]=n.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=n.z,i[15]=n.x,i[16]=t.y,i[17]=n.z,i[18]=n.x,i[19]=n.y,i[20]=n.z,i[21]=t.x,i[22]=n.y,i[23]=n.z,u.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:i}),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 k=m.subtract(n,t,g),E=m.magnitude(k)*.5;if(c(e._offsetAttribute)){let T=i.length,z=e._offsetAttribute===d.NONE?0:1,B=new Uint8Array(T/3).fill(z);u.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new h({attributes:u,indices:o,primitiveType:O.LINES,boundingSphere:new A(m.ZERO,E),offsetAttribute:e._offsetAttribute})};var y=f;function L(e,t){return c(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}var V=L;export{V as default}; +import{a as d}from"./chunk-GNBKSQYP.js";import{a as l}from"./chunk-ILBQ77ZM.js";import{b as O,c as h,d as p}from"./chunk-7RNSURKI.js";import{c as A}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a as m,c as s}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{a as b,b as r}from"./chunk-OU2IPMYE.js";import{f as c}from"./chunk-H7SJWKIY.js";var g=new m;function f(e){e=e??s.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(r.typeOf.object("min",t),r.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===d.TOP)throw new b("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}f.fromDimensions=function(e){e=e??s.EMPTY_OBJECT;let t=e.dimensions;r.typeOf.object("dimensions",t),r.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),r.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),r.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new f({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};f.fromAxisAlignedBoundingBox=function(e){return r.typeOf.object("boundindBox",e),new f({minimum:e.minimum,maximum:e.maximum})};f.packedLength=2*m.packedLength+1;f.pack=function(e,t,n){return r.typeOf.object("value",e),r.defined("array",t),n=n??0,m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=e._offsetAttribute??-1,t};var w=new m,x=new m,_={minimum:w,maximum:x,offsetAttribute:void 0};f.unpack=function(e,t,n){r.defined("array",e),t=t??0;let u=m.unpack(e,t,w),o=m.unpack(e,t+m.packedLength,x),i=e[t+m.packedLength*2];return c(n)?(n._min=m.clone(u,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=i===-1?void 0:i,n):(_.offsetAttribute=i===-1?void 0:i,new f(_))};f.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let u=new l,o=new Uint16Array(24),i=new Float64Array(24);i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=n.x,i[4]=t.y,i[5]=t.z,i[6]=n.x,i[7]=n.y,i[8]=t.z,i[9]=t.x,i[10]=n.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=n.z,i[15]=n.x,i[16]=t.y,i[17]=n.z,i[18]=n.x,i[19]=n.y,i[20]=n.z,i[21]=t.x,i[22]=n.y,i[23]=n.z,u.position=new p({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:i}),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 k=m.subtract(n,t,g),E=m.magnitude(k)*.5;if(c(e._offsetAttribute)){let T=i.length,z=e._offsetAttribute===d.NONE?0:1,B=new Uint8Array(T/3).fill(z);u.applyOffset=new p({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new h({attributes:u,indices:o,primitiveType:O.LINES,boundingSphere:new A(m.ZERO,E),offsetAttribute:e._offsetAttribute})};var y=f;function L(e,t){return c(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}var V=L;export{V as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCircleGeometry.js b/plugins/feature/map/Cesium/Workers/createCircleGeometry.js index 0d7aa710a..9a867fcb0 100644 --- a/plugins/feature/map/Cesium/Workers/createCircleGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCircleGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as l}from"./chunk-Q7QJJ4HI.js";import"./chunk-HRZKIJQA.js";import"./chunk-4OIYAFXA.js";import"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import"./chunk-4W2MZV6I.js";import{a as m}from"./chunk-S3L7VZFL.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a,d as s,f as _}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as p}from"./chunk-ELJAHN3H.js";import{e as d}from"./chunk-3BGP4HCL.js";function n(e){e=e??_.EMPTY_OBJECT;let r=e.radius;p.typeOf.number("radius",r);let o={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new l(o),this._workerName="createCircleGeometry"}n.packedLength=l.packedLength;n.pack=function(e,r,o){return p.typeOf.object("value",e),l.pack(e._ellipseGeometry,r,o)};var h=new l({center:new a,semiMajorAxis:1,semiMinorAxis:1}),t={center:new a,radius:void 0,ellipsoid:s.clone(s.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new m,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};n.unpack=function(e,r,o){let i=l.unpack(e,r,h);return t.center=a.clone(i._center,t.center),t.ellipsoid=s.clone(i._ellipsoid,t.ellipsoid),t.ellipsoid=s.clone(i._ellipsoid,h._ellipsoid),t.height=i._height,t.extrudedHeight=i._extrudedHeight,t.granularity=i._granularity,t.vertexFormat=m.clone(i._vertexFormat,t.vertexFormat),t.stRotation=i._stRotation,t.shadowVolume=i._shadowVolume,d(o)?(t.semiMajorAxis=i._semiMajorAxis,t.semiMinorAxis=i._semiMinorAxis,o._ellipseGeometry=new l(t),o):(t.radius=i._semiMajorAxis,new n(t))};n.createGeometry=function(e){return l.createGeometry(e._ellipseGeometry)};n.createShadowVolume=function(e,r,o){let i=e._ellipseGeometry._granularity,u=e._ellipseGeometry._ellipsoid,f=r(i,u),x=o(i,u);return new n({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:u,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:f,height:x,vertexFormat:m.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(n.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var c=n;function g(e,r){return d(r)&&(e=c.unpack(e,r)),e._ellipseGeometry._center=a.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),c.createGeometry(e)}var V=g;export{V as default}; +import{a as l}from"./chunk-G2DFB5K6.js";import"./chunk-7IFFXLK3.js";import"./chunk-PICDM7L2.js";import"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import"./chunk-GNBKSQYP.js";import{a as m}from"./chunk-FZSSAWMQ.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as s}from"./chunk-KP72RGCH.js";import{a,c as _}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as p}from"./chunk-OU2IPMYE.js";import{f as d}from"./chunk-H7SJWKIY.js";function n(e){e=e??_.EMPTY_OBJECT;let r=e.radius;p.typeOf.number("radius",r);let o={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new l(o),this._workerName="createCircleGeometry"}n.packedLength=l.packedLength;n.pack=function(e,r,o){return p.typeOf.object("value",e),l.pack(e._ellipseGeometry,r,o)};var h=new l({center:new a,semiMajorAxis:1,semiMinorAxis:1}),t={center:new a,radius:void 0,ellipsoid:s.clone(s.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new m,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};n.unpack=function(e,r,o){let i=l.unpack(e,r,h);return t.center=a.clone(i._center,t.center),t.ellipsoid=s.clone(i._ellipsoid,t.ellipsoid),t.ellipsoid=s.clone(i._ellipsoid,h._ellipsoid),t.height=i._height,t.extrudedHeight=i._extrudedHeight,t.granularity=i._granularity,t.vertexFormat=m.clone(i._vertexFormat,t.vertexFormat),t.stRotation=i._stRotation,t.shadowVolume=i._shadowVolume,d(o)?(t.semiMajorAxis=i._semiMajorAxis,t.semiMinorAxis=i._semiMinorAxis,o._ellipseGeometry=new l(t),o):(t.radius=i._semiMajorAxis,new n(t))};n.createGeometry=function(e){return l.createGeometry(e._ellipseGeometry)};n.createShadowVolume=function(e,r,o){let i=e._ellipseGeometry._granularity,u=e._ellipseGeometry._ellipsoid,f=r(i,u),x=o(i,u);return new n({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:u,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:f,height:x,vertexFormat:m.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(n.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var c=n;function g(e,r){return d(r)&&(e=c.unpack(e,r)),e._ellipseGeometry._center=a.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),c.createGeometry(e)}var V=g;export{V as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCircleOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createCircleOutlineGeometry.js index cf80e29e1..f2cfcf88b 100644 --- a/plugins/feature/map/Cesium/Workers/createCircleOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCircleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as n}from"./chunk-OAGMF473.js";import"./chunk-HRZKIJQA.js";import"./chunk-4W2MZV6I.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as o,d as s,f as c}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as d}from"./chunk-ELJAHN3H.js";import{e as a}from"./chunk-3BGP4HCL.js";function m(e){e=e??c.EMPTY_OBJECT;let r=e.radius;d.typeOf.number("radius",r);let l={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(l),this._workerName="createCircleOutlineGeometry"}m.packedLength=n.packedLength;m.pack=function(e,r,l){return d.typeOf.object("value",e),n.pack(e._ellipseGeometry,r,l)};var p=new n({center:new o,semiMajorAxis:1,semiMinorAxis:1}),i={center:new o,radius:void 0,ellipsoid:s.clone(s.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};m.unpack=function(e,r,l){let t=n.unpack(e,r,p);return i.center=o.clone(t._center,i.center),i.ellipsoid=s.clone(t._ellipsoid,i.ellipsoid),i.height=t._height,i.extrudedHeight=t._extrudedHeight,i.granularity=t._granularity,i.numberOfVerticalLines=t._numberOfVerticalLines,a(l)?(i.semiMajorAxis=t._semiMajorAxis,i.semiMinorAxis=t._semiMinorAxis,l._ellipseGeometry=new n(i),l):(i.radius=t._semiMajorAxis,new m(i))};m.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)};var u=m;function f(e,r){return a(r)&&(e=u.unpack(e,r)),e._ellipseGeometry._center=o.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),u.createGeometry(e)}var E=f;export{E as default}; +import{a as n}from"./chunk-CYYYI5LY.js";import"./chunk-7IFFXLK3.js";import"./chunk-GNBKSQYP.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as s}from"./chunk-KP72RGCH.js";import{a as o,c}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as d}from"./chunk-OU2IPMYE.js";import{f as a}from"./chunk-H7SJWKIY.js";function m(e){e=e??c.EMPTY_OBJECT;let r=e.radius;d.typeOf.number("radius",r);let l={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(l),this._workerName="createCircleOutlineGeometry"}m.packedLength=n.packedLength;m.pack=function(e,r,l){return d.typeOf.object("value",e),n.pack(e._ellipseGeometry,r,l)};var p=new n({center:new o,semiMajorAxis:1,semiMinorAxis:1}),i={center:new o,radius:void 0,ellipsoid:s.clone(s.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};m.unpack=function(e,r,l){let t=n.unpack(e,r,p);return i.center=o.clone(t._center,i.center),i.ellipsoid=s.clone(t._ellipsoid,i.ellipsoid),i.height=t._height,i.extrudedHeight=t._extrudedHeight,i.granularity=t._granularity,i.numberOfVerticalLines=t._numberOfVerticalLines,a(l)?(i.semiMajorAxis=t._semiMajorAxis,i.semiMinorAxis=t._semiMinorAxis,l._ellipseGeometry=new n(i),l):(i.radius=t._semiMajorAxis,new m(i))};m.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)};var u=m;function f(e,r){return a(r)&&(e=u.unpack(e,r)),e._ellipseGeometry._center=o.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=s.clone(e._ellipseGeometry._ellipsoid),u.createGeometry(e)}var E=f;export{E as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCoplanarPolygonGeometry.js b/plugins/feature/map/Cesium/Workers/createCoplanarPolygonGeometry.js index 266c3f9c3..fc6552fdd 100644 --- a/plugins/feature/map/Cesium/Workers/createCoplanarPolygonGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCoplanarPolygonGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as et}from"./chunk-S5KJ4JQS.js";import{a as Q}from"./chunk-EFXTPVRC.js";import"./chunk-LUT6AMUC.js";import{a as u}from"./chunk-2V6KZTKL.js";import"./chunk-IFR5HKVH.js";import{a as I}from"./chunk-4OIYAFXA.js";import{a as $}from"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import{a as f}from"./chunk-S3L7VZFL.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{b as ot}from"./chunk-BKYT7QHD.js";import{a as tt}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as J}from"./chunk-JQLYZQ6V.js";import{a as X}from"./chunk-J3L5WX3X.js";import{b as W,c as Y,d as z}from"./chunk-AVPLM4UI.js";import{d as K}from"./chunk-ZYYZDBKK.js";import{f as q}from"./chunk-3PT5NNSP.js";import{a as B}from"./chunk-WER4LUMF.js";import{a as i,c as H,d as m,e as g,f as U}from"./chunk-FGKVHLJ4.js";import{a as V}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as G}from"./chunk-ELJAHN3H.js";import{e as d}from"./chunk-3BGP4HCL.js";var st=new i,at=new et,pt=new H,lt=new H,mt=new i,ft=new i,ut=new i,M=new i,yt=new i,ht=new i,nt=new q,dt=new g,gt=new g,Pt=new i;function wt(e,t,o,a,y,_,r,n,p){let A=e.positions,c=ot.triangulate(e.positions2D,e.holes);c.length<3&&(c=[0,1,2]);let P=J.createTypedArray(A.length,c.length);P.set(c);let E=dt;if(a!==0){let h=q.fromAxisAngle(r,a,nt);if(E=g.fromQuaternion(h,E),t.tangent||t.bitangent){h=q.fromAxisAngle(r,-a,nt);let O=g.fromQuaternion(h,gt);n=i.normalize(g.multiplyByVector(O,n,n),n),t.bitangent&&(p=i.normalize(i.cross(r,n,p),p))}}else E=g.clone(g.IDENTITY,E);let N=lt;t.st&&(N.x=o.x,N.y=o.y);let b=A.length,k=b*3,C=new Float64Array(k),L=t.normal?new Float32Array(k):void 0,D=t.tangent?new Float32Array(k):void 0,F=t.bitangent?new Float32Array(k):void 0,T=t.st?new Float32Array(b*2):void 0,j=0,R=0,l=0,S=0,s=0;for(let h=0;h<b;h++){let O=A[h];if(C[j++]=O.x,C[j++]=O.y,C[j++]=O.z,t.st)if(d(y)&&y.positions.length===b)T[s++]=y.positions[h].x,T[s++]=y.positions[h].y;else{let it=g.multiplyByVector(E,O,st),v=_(it,pt);H.subtract(v,N,v);let rt=V.clamp(v.x/o.width,0,1),ct=V.clamp(v.y/o.height,0,1);T[s++]=rt,T[s++]=ct}t.normal&&(L[R++]=r.x,L[R++]=r.y,L[R++]=r.z),t.tangent&&(D[S++]=n.x,D[S++]=n.y,D[S++]=n.z),t.bitangent&&(F[l++]=p.x,F[l++]=p.y,F[l++]=p.z)}let w=new X;return t.position&&(w.position=new z({componentDatatype:B.DOUBLE,componentsPerAttribute:3,values:C})),t.normal&&(w.normal=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:L})),t.tangent&&(w.tangent=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:D})),t.bitangent&&(w.bitangent=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:F})),t.st&&(w.st=new z({componentDatatype:B.FLOAT,componentsPerAttribute:2,values:T})),new Y({attributes:w,indices:P,primitiveType:W.TRIANGLES})}function x(e){e=e??U.EMPTY_OBJECT;let t=e.polygonHierarchy,o=e.textureCoordinates;G.defined("options.polygonHierarchy",t);let a=e.vertexFormat??f.DEFAULT;this._vertexFormat=f.clone(a),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=m.clone(e.ellipsoid??m.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=o,this.packedLength=u.computeHierarchyPackedLength(t,i)+f.packedLength+m.packedLength+(d(o)?u.computeHierarchyPackedLength(o,H):1)+2}x.fromPositions=function(e){e=e??U.EMPTY_OBJECT,G.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new x(t)};x.pack=function(e,t,o){return G.typeOf.object("value",e),G.defined("array",t),o=o??0,o=u.packPolygonHierarchy(e._polygonHierarchy,t,o,i),m.pack(e._ellipsoid,t,o),o+=m.packedLength,f.pack(e._vertexFormat,t,o),o+=f.packedLength,t[o++]=e._stRotation,d(e._textureCoordinates)?o=u.packPolygonHierarchy(e._textureCoordinates,t,o,H):t[o++]=-1,t[o++]=e.packedLength,t};var _t=m.clone(m.UNIT_SPHERE),At=new f,bt={polygonHierarchy:{}};x.unpack=function(e,t,o){G.defined("array",e),t=t??0;let a=u.unpackPolygonHierarchy(e,t,i);t=a.startingIndex,delete a.startingIndex;let y=m.unpack(e,t,_t);t+=m.packedLength;let _=f.unpack(e,t,At);t+=f.packedLength;let r=e[t++],n=e[t]===-1?void 0:u.unpackPolygonHierarchy(e,t,H);d(n)?(t=n.startingIndex,delete n.startingIndex):t++;let p=e[t++];return d(o)||(o=new x(bt)),o._polygonHierarchy=a,o._ellipsoid=m.clone(y,o._ellipsoid),o._vertexFormat=f.clone(_,o._vertexFormat),o._stRotation=r,o._textureCoordinates=n,o.packedLength=p,o};x.createGeometry=function(e){let t=e._vertexFormat,o=e._polygonHierarchy,a=e._stRotation,y=e._textureCoordinates,_=d(y),r=o.positions;if(r=tt(r,i.equalsEpsilon,!0),r.length<3)return;let n=mt,p=ft,A=ut,c=yt,P=ht;if(!Q.computeProjectTo2DArguments(r,M,c,P))return;if(n=i.cross(c,P,n),n=i.normalize(n,n),!i.equalsEpsilon(M,i.ZERO,V.EPSILON6)){let s=e._ellipsoid.geodeticSurfaceNormal(M,Pt);i.dot(n,s)<0&&(n=i.negate(n,n),c=i.negate(c,c))}let N=Q.createProjectPointsTo2DFunction(M,c,P),b=Q.createProjectPointTo2DFunction(M,c,P);t.tangent&&(p=i.clone(c,p)),t.bitangent&&(A=i.clone(P,A));let k=u.polygonsFromHierarchy(o,_,N,!1),C=k.hierarchy,L=k.polygons,D=function(s){return s},F=_?u.polygonsFromHierarchy(y,!0,D,!1).polygons:void 0;if(C.length===0)return;r=C[0].outerRing;let T=K.fromPoints(r),j=u.computeBoundingRectangle(n,b,r,a,at),R=[];for(let s=0;s<L.length;s++){let w=new I({geometry:wt(L[s],t,j,a,_?F[s]:void 0,b,n,p,A)});R.push(w)}let l=$.combineInstances(R)[0];l.attributes.position.values=new Float64Array(l.attributes.position.values),l.indices=J.createTypedArray(l.attributes.position.values.length/3,l.indices);let S=l.attributes;return t.position||delete S.position,new Y({attributes:S,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:T})};var Z=x;function kt(e,t){return d(t)&&(e=Z.unpack(e,t)),Z.createGeometry(e)}var Xt=kt;export{Xt as default}; +import{a as et}from"./chunk-YAU2WIVW.js";import{a as Q}from"./chunk-PUJTKPNP.js";import"./chunk-XAERMS6D.js";import{a as u}from"./chunk-76NBDD5E.js";import"./chunk-LXGG3JDP.js";import{a as I}from"./chunk-PICDM7L2.js";import{a as $}from"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import{a as f}from"./chunk-FZSSAWMQ.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{b as ot}from"./chunk-SIFLADX4.js";import{a as tt}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as J}from"./chunk-AZINMULF.js";import{a as X}from"./chunk-ILBQ77ZM.js";import{b as W,c as Y,d as z}from"./chunk-7RNSURKI.js";import{c as K}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{h as q}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as B}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{b as H,c as m}from"./chunk-KP72RGCH.js";import{a as i,b as g,c as U}from"./chunk-OSVSBQDY.js";import{a as V}from"./chunk-LZC73BOP.js";import{b as G}from"./chunk-OU2IPMYE.js";import{f as d}from"./chunk-H7SJWKIY.js";var st=new i,at=new et,pt=new H,lt=new H,mt=new i,ft=new i,ut=new i,M=new i,yt=new i,ht=new i,nt=new q,dt=new g,gt=new g,Pt=new i;function wt(e,t,o,a,y,_,r,n,p){let A=e.positions,c=ot.triangulate(e.positions2D,e.holes);c.length<3&&(c=[0,1,2]);let P=J.createTypedArray(A.length,c.length);P.set(c);let E=dt;if(a!==0){let h=q.fromAxisAngle(r,a,nt);if(E=g.fromQuaternion(h,E),t.tangent||t.bitangent){h=q.fromAxisAngle(r,-a,nt);let O=g.fromQuaternion(h,gt);n=i.normalize(g.multiplyByVector(O,n,n),n),t.bitangent&&(p=i.normalize(i.cross(r,n,p),p))}}else E=g.clone(g.IDENTITY,E);let N=lt;t.st&&(N.x=o.x,N.y=o.y);let b=A.length,k=b*3,C=new Float64Array(k),L=t.normal?new Float32Array(k):void 0,D=t.tangent?new Float32Array(k):void 0,F=t.bitangent?new Float32Array(k):void 0,T=t.st?new Float32Array(b*2):void 0,j=0,R=0,l=0,S=0,s=0;for(let h=0;h<b;h++){let O=A[h];if(C[j++]=O.x,C[j++]=O.y,C[j++]=O.z,t.st)if(d(y)&&y.positions.length===b)T[s++]=y.positions[h].x,T[s++]=y.positions[h].y;else{let it=g.multiplyByVector(E,O,st),v=_(it,pt);H.subtract(v,N,v);let rt=V.clamp(v.x/o.width,0,1),ct=V.clamp(v.y/o.height,0,1);T[s++]=rt,T[s++]=ct}t.normal&&(L[R++]=r.x,L[R++]=r.y,L[R++]=r.z),t.tangent&&(D[S++]=n.x,D[S++]=n.y,D[S++]=n.z),t.bitangent&&(F[l++]=p.x,F[l++]=p.y,F[l++]=p.z)}let w=new X;return t.position&&(w.position=new z({componentDatatype:B.DOUBLE,componentsPerAttribute:3,values:C})),t.normal&&(w.normal=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:L})),t.tangent&&(w.tangent=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:D})),t.bitangent&&(w.bitangent=new z({componentDatatype:B.FLOAT,componentsPerAttribute:3,values:F})),t.st&&(w.st=new z({componentDatatype:B.FLOAT,componentsPerAttribute:2,values:T})),new Y({attributes:w,indices:P,primitiveType:W.TRIANGLES})}function x(e){e=e??U.EMPTY_OBJECT;let t=e.polygonHierarchy,o=e.textureCoordinates;G.defined("options.polygonHierarchy",t);let a=e.vertexFormat??f.DEFAULT;this._vertexFormat=f.clone(a),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=m.clone(e.ellipsoid??m.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=o,this.packedLength=u.computeHierarchyPackedLength(t,i)+f.packedLength+m.packedLength+(d(o)?u.computeHierarchyPackedLength(o,H):1)+2}x.fromPositions=function(e){e=e??U.EMPTY_OBJECT,G.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new x(t)};x.pack=function(e,t,o){return G.typeOf.object("value",e),G.defined("array",t),o=o??0,o=u.packPolygonHierarchy(e._polygonHierarchy,t,o,i),m.pack(e._ellipsoid,t,o),o+=m.packedLength,f.pack(e._vertexFormat,t,o),o+=f.packedLength,t[o++]=e._stRotation,d(e._textureCoordinates)?o=u.packPolygonHierarchy(e._textureCoordinates,t,o,H):t[o++]=-1,t[o]=e.packedLength,t};var _t=m.clone(m.UNIT_SPHERE),At=new f,bt={polygonHierarchy:{}};x.unpack=function(e,t,o){G.defined("array",e),t=t??0;let a=u.unpackPolygonHierarchy(e,t,i);t=a.startingIndex,delete a.startingIndex;let y=m.unpack(e,t,_t);t+=m.packedLength;let _=f.unpack(e,t,At);t+=f.packedLength;let r=e[t++],n=e[t]===-1?void 0:u.unpackPolygonHierarchy(e,t,H);d(n)?(t=n.startingIndex,delete n.startingIndex):t++;let p=e[t];return d(o)||(o=new x(bt)),o._polygonHierarchy=a,o._ellipsoid=m.clone(y,o._ellipsoid),o._vertexFormat=f.clone(_,o._vertexFormat),o._stRotation=r,o._textureCoordinates=n,o.packedLength=p,o};x.createGeometry=function(e){let t=e._vertexFormat,o=e._polygonHierarchy,a=e._stRotation,y=e._textureCoordinates,_=d(y),r=o.positions;if(r=tt(r,i.equalsEpsilon,!0),r.length<3)return;let n=mt,p=ft,A=ut,c=yt,P=ht;if(!Q.computeProjectTo2DArguments(r,M,c,P))return;if(n=i.cross(c,P,n),n=i.normalize(n,n),!i.equalsEpsilon(M,i.ZERO,V.EPSILON6)){let s=e._ellipsoid.geodeticSurfaceNormal(M,Pt);i.dot(n,s)<0&&(n=i.negate(n,n),c=i.negate(c,c))}let N=Q.createProjectPointsTo2DFunction(M,c,P),b=Q.createProjectPointTo2DFunction(M,c,P);t.tangent&&(p=i.clone(c,p)),t.bitangent&&(A=i.clone(P,A));let k=u.polygonsFromHierarchy(o,_,N,!1),C=k.hierarchy,L=k.polygons,D=function(s){return s},F=_?u.polygonsFromHierarchy(y,!0,D,!1).polygons:void 0;if(C.length===0)return;r=C[0].outerRing;let T=K.fromPoints(r),j=u.computeBoundingRectangle(n,b,r,a,at),R=[];for(let s=0;s<L.length;s++){let w=new I({geometry:wt(L[s],t,j,a,_?F[s]:void 0,b,n,p,A)});R.push(w)}let l=$.combineInstances(R)[0];l.attributes.position.values=new Float64Array(l.attributes.position.values),l.indices=J.createTypedArray(l.attributes.position.values.length/3,l.indices);let S=l.attributes;return t.position||delete S.position,new Y({attributes:S,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:T})};var Z=x;function kt(e,t){return d(t)&&(e=Z.unpack(e,t)),Z.createGeometry(e)}var Xt=kt;export{Xt as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js index 6181ee275..28f050a8e 100644 --- a/plugins/feature/map/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as T}from"./chunk-EFXTPVRC.js";import"./chunk-LUT6AMUC.js";import{a as l}from"./chunk-2V6KZTKL.js";import"./chunk-IFR5HKVH.js";import{a as G}from"./chunk-4OIYAFXA.js";import{a as C}from"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import"./chunk-BKYT7QHD.js";import{a as L}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as w}from"./chunk-JQLYZQ6V.js";import{a as O}from"./chunk-J3L5WX3X.js";import{b,c as d,d as k}from"./chunk-AVPLM4UI.js";import{d as P}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as H}from"./chunk-WER4LUMF.js";import{a as y,d as g,f as u}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as m}from"./chunk-ELJAHN3H.js";import{e as f}from"./chunk-3BGP4HCL.js";function E(o){let e=o.length,t=new Float64Array(e*3),i=w.createTypedArray(e,e*2),r=0,a=0;for(let n=0;n<e;n++){let p=o[n];t[r++]=p.x,t[r++]=p.y,t[r++]=p.z,i[a++]=n,i[a++]=(n+1)%e}let s=new O({position:new k({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:t})});return new d({attributes:s,indices:i,primitiveType:b.LINES})}function c(o){o=o??u.EMPTY_OBJECT;let e=o.polygonHierarchy;m.defined("options.polygonHierarchy",e),this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=l.computeHierarchyPackedLength(e,y)+1}c.fromPositions=function(o){o=o??u.EMPTY_OBJECT,m.defined("options.positions",o.positions);let e={polygonHierarchy:{positions:o.positions}};return new c(e)};c.pack=function(o,e,t){return m.typeOf.object("value",o),m.defined("array",e),t=t??0,t=l.packPolygonHierarchy(o._polygonHierarchy,e,t,y),e[t]=o.packedLength,e};var v={polygonHierarchy:{}};c.unpack=function(o,e,t){m.defined("array",o),e=e??0;let i=l.unpackPolygonHierarchy(o,e,y);e=i.startingIndex,delete i.startingIndex;let r=o[e];return f(t)||(t=new c(v)),t._polygonHierarchy=i,t.packedLength=r,t};c.createGeometry=function(o){let e=o._polygonHierarchy,t=e.positions;if(t=L(t,y.equalsEpsilon,!0),t.length<3||!T.validOutline(t))return;let r=l.polygonOutlinesFromHierarchy(e,!1);if(r.length===0)return;let a=[];for(let p=0;p<r.length;p++){let _=new G({geometry:E(r[p])});a.push(_)}let s=C.combineInstances(a)[0],n=P.fromPoints(e.positions);return new d({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:n})};var h=c;function A(o,e){return f(e)&&(o=h.unpack(o,e)),o._ellipsoid=g.clone(o._ellipsoid),h.createGeometry(o)}var Z=A;export{Z as default}; +import{a as T}from"./chunk-PUJTKPNP.js";import"./chunk-XAERMS6D.js";import{a as l}from"./chunk-76NBDD5E.js";import"./chunk-LXGG3JDP.js";import{a as G}from"./chunk-PICDM7L2.js";import{a as C}from"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import"./chunk-SIFLADX4.js";import{a as L}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as w}from"./chunk-AZINMULF.js";import{a as O}from"./chunk-ILBQ77ZM.js";import{b,c as d,d as k}from"./chunk-7RNSURKI.js";import{c as P}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as H}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as g}from"./chunk-KP72RGCH.js";import{a as y,c as u}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as m}from"./chunk-OU2IPMYE.js";import{f}from"./chunk-H7SJWKIY.js";function E(o){let e=o.length,t=new Float64Array(e*3),i=w.createTypedArray(e,e*2),r=0,a=0;for(let n=0;n<e;n++){let p=o[n];t[r++]=p.x,t[r++]=p.y,t[r++]=p.z,i[a++]=n,i[a++]=(n+1)%e}let s=new O({position:new k({componentDatatype:H.DOUBLE,componentsPerAttribute:3,values:t})});return new d({attributes:s,indices:i,primitiveType:b.LINES})}function c(o){o=o??u.EMPTY_OBJECT;let e=o.polygonHierarchy;m.defined("options.polygonHierarchy",e),this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=l.computeHierarchyPackedLength(e,y)+1}c.fromPositions=function(o){o=o??u.EMPTY_OBJECT,m.defined("options.positions",o.positions);let e={polygonHierarchy:{positions:o.positions}};return new c(e)};c.pack=function(o,e,t){return m.typeOf.object("value",o),m.defined("array",e),t=t??0,t=l.packPolygonHierarchy(o._polygonHierarchy,e,t,y),e[t]=o.packedLength,e};var v={polygonHierarchy:{}};c.unpack=function(o,e,t){m.defined("array",o),e=e??0;let i=l.unpackPolygonHierarchy(o,e,y);e=i.startingIndex,delete i.startingIndex;let r=o[e];return f(t)||(t=new c(v)),t._polygonHierarchy=i,t.packedLength=r,t};c.createGeometry=function(o){let e=o._polygonHierarchy,t=e.positions;if(t=L(t,y.equalsEpsilon,!0),t.length<3||!T.validOutline(t))return;let r=l.polygonOutlinesFromHierarchy(e,!1);if(r.length===0)return;let a=[];for(let p=0;p<r.length;p++){let _=new G({geometry:E(r[p])});a.push(_)}let s=C.combineInstances(a)[0],n=P.fromPoints(e.positions);return new d({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:n})};var h=c;function A(o,e){return f(e)&&(o=h.unpack(o,e)),o._ellipsoid=g.clone(o._ellipsoid),h.createGeometry(o)}var Z=A;export{Z as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCorridorGeometry.js b/plugins/feature/map/Cesium/Workers/createCorridorGeometry.js index 886983195..34b80f4f7 100644 --- a/plugins/feature/map/Cesium/Workers/createCorridorGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCorridorGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as M}from"./chunk-2RJONVEL.js";import{a as ut}from"./chunk-3RSLEP7W.js";import"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import{a as bt}from"./chunk-4W2MZV6I.js";import{a as J}from"./chunk-S3L7VZFL.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{b as _t}from"./chunk-BKYT7QHD.js";import{a as Pt}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as Nt}from"./chunk-JQLYZQ6V.js";import{a as Dt}from"./chunk-J3L5WX3X.js";import{b as Mt,c as Ct,d as F}from"./chunk-AVPLM4UI.js";import{d as St}from"./chunk-ZYYZDBKK.js";import{h as Et}from"./chunk-3PT5NNSP.js";import{a as v}from"./chunk-WER4LUMF.js";import{a as o,b as At,d as Y,f as Tt}from"./chunk-FGKVHLJ4.js";import{a as it}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as ot}from"./chunk-ELJAHN3H.js";import{e as Q}from"./chunk-3BGP4HCL.js";var Rt=new o,kt=new o,yt=new o,wt=new o,jt=new o,Ht=new o,st=new o,dt=new o;function Ut(t,e){for(let i=0;i<t.length;i++)t[i]=e.scaleToGeodeticSurface(t[i],t[i]);return t}function X(t,e,i,l,d,f){let h=t.normals,O=t.tangents,g=t.bitangents,r=o.normalize(o.cross(i,e,st),st);f.normal&&M.addAttribute(h,e,l,d),f.tangent&&M.addAttribute(O,r,l,d),f.bitangent&&M.addAttribute(g,i,l,d)}function Bt(t,e,i){let l=t.positions,d=t.corners,f=t.endPositions,h=t.lefts,O=t.normals,g=new Dt,r,a=0,s=0,n,A=0,u;for(n=0;n<l.length;n+=2)u=l[n].length-3,a+=u,A+=u*2,s+=l[n+1].length-3;for(a+=3,s+=3,n=0;n<d.length;n++){r=d[n];let c=d[n].leftPositions;Q(c)?(u=c.length,a+=u,A+=u):(u=d[n].rightPositions.length,s+=u,A+=u)}let b=Q(f),p;b&&(p=f[0].length-3,a+=p,s+=p,p/=3,A+=p*6);let z=a+s,m=new Float64Array(z),D=e.normal?new Float32Array(z):void 0,V=e.tangent?new Float32Array(z):void 0,rt=e.bitangent?new Float32Array(z):void 0,R={normals:D,tangents:V,bitangents:rt},y=0,E=z-1,S,C,H,q,P=Rt,w=kt,et,nt,pt=p/2,_=Nt.createTypedArray(z/3,A),T=0;if(b){nt=yt,et=wt;let c=f[0];for(P=o.fromArray(O,0,P),w=o.fromArray(h,0,w),n=0;n<pt;n++)nt=o.fromArray(c,(pt-1-n)*3,nt),et=o.fromArray(c,(pt+n)*3,et),M.addAttribute(m,et,y),M.addAttribute(m,nt,void 0,E),X(R,P,w,y,E,e),C=y/3,q=C+1,S=(E-2)/3,H=S-1,_[T++]=S,_[T++]=C,_[T++]=H,_[T++]=H,_[T++]=C,_[T++]=q,y+=3,E-=3}let mt=0,ft=0,at=l[mt++],j=l[mt++];m.set(at,y),m.set(j,E-j.length+1),w=o.fromArray(h,ft,w);let lt,ct;for(u=j.length-3,n=0;n<u;n+=3)lt=i.geodeticSurfaceNormal(o.fromArray(at,n,st),st),ct=i.geodeticSurfaceNormal(o.fromArray(j,u-n,dt),dt),P=o.normalize(o.add(lt,ct,P),P),X(R,P,w,y,E,e),C=y/3,q=C+1,S=(E-2)/3,H=S-1,_[T++]=S,_[T++]=C,_[T++]=H,_[T++]=H,_[T++]=C,_[T++]=q,y+=3,E-=3;for(lt=i.geodeticSurfaceNormal(o.fromArray(at,u,st),st),ct=i.geodeticSurfaceNormal(o.fromArray(j,u,dt),dt),P=o.normalize(o.add(lt,ct,P),P),ft+=3,n=0;n<d.length;n++){let c;r=d[n];let Z=r.leftPositions,$=r.rightPositions,L,U,N=Ht,k=yt,B=wt;if(P=o.fromArray(O,ft,P),Q(Z)){for(X(R,P,w,void 0,E,e),E-=3,L=q,U=H,c=0;c<Z.length/3;c++)N=o.fromArray(Z,c*3,N),_[T++]=L,_[T++]=U-c-1,_[T++]=U-c,M.addAttribute(m,N,void 0,E),k=o.fromArray(m,(U-c-1)*3,k),B=o.fromArray(m,L*3,B),w=o.normalize(o.subtract(k,B,w),w),X(R,P,w,void 0,E,e),E-=3;N=o.fromArray(m,L*3,N),k=o.subtract(o.fromArray(m,U*3,k),N,k),B=o.subtract(o.fromArray(m,(U-c)*3,B),N,B),w=o.normalize(o.add(k,B,w),w),X(R,P,w,y,void 0,e),y+=3}else{for(X(R,P,w,y,void 0,e),y+=3,L=H,U=q,c=0;c<$.length/3;c++)N=o.fromArray($,c*3,N),_[T++]=L,_[T++]=U+c,_[T++]=U+c+1,M.addAttribute(m,N,y),k=o.fromArray(m,L*3,k),B=o.fromArray(m,(U+c)*3,B),w=o.normalize(o.subtract(k,B,w),w),X(R,P,w,y,void 0,e),y+=3;N=o.fromArray(m,L*3,N),k=o.subtract(o.fromArray(m,(U+c)*3,k),N,k),B=o.subtract(o.fromArray(m,U*3,B),N,B),w=o.normalize(o.negate(o.add(B,k,w),w),w),X(R,P,w,void 0,E,e),E-=3}for(at=l[mt++],j=l[mt++],at.splice(0,3),j.splice(j.length-3,3),m.set(at,y),m.set(j,E-j.length+1),u=j.length-3,ft+=3,w=o.fromArray(h,ft,w),c=0;c<j.length;c+=3)lt=i.geodeticSurfaceNormal(o.fromArray(at,c,st),st),ct=i.geodeticSurfaceNormal(o.fromArray(j,u-c,dt),dt),P=o.normalize(o.add(lt,ct,P),P),X(R,P,w,y,E,e),q=y/3,C=q-1,H=(E-2)/3,S=H+1,_[T++]=S,_[T++]=C,_[T++]=H,_[T++]=H,_[T++]=C,_[T++]=q,y+=3,E-=3;y-=3,E+=3}if(P=o.fromArray(O,O.length-3,P),X(R,P,w,y,E,e),b){y+=3,E-=3,nt=yt,et=wt;let c=f[1];for(n=0;n<pt;n++)nt=o.fromArray(c,(p-n-1)*3,nt),et=o.fromArray(c,n*3,et),M.addAttribute(m,nt,void 0,E),M.addAttribute(m,et,y),X(R,P,w,y,E,e),q=y/3,C=q-1,H=(E-2)/3,S=H+1,_[T++]=S,_[T++]=C,_[T++]=H,_[T++]=H,_[T++]=C,_[T++]=q,y+=3,E-=3}if(g.position=new F({componentDatatype:v.DOUBLE,componentsPerAttribute:3,values:m}),e.st){let c=new Float32Array(z/3*2),Z,$,L=0;if(b){a/=3,s/=3;let U=Math.PI/(p+1);$=1/(a-p+1),Z=1/(s-p+1);let N,k=p/2;for(n=k+1;n<p+1;n++)N=it.PI_OVER_TWO+U*n,c[L++]=Z*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=1;n<s-p+1;n++)c[L++]=n*Z,c[L++]=0;for(n=p;n>k;n--)N=it.PI_OVER_TWO-n*U,c[L++]=1-Z*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=k;n>0;n--)N=it.PI_OVER_TWO-U*n,c[L++]=1-$*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N));for(n=a-p;n>0;n--)c[L++]=n*$,c[L++]=1;for(n=1;n<k+1;n++)N=it.PI_OVER_TWO+U*n,c[L++]=$*(1+Math.cos(N)),c[L++]=.5*(1+Math.sin(N))}else{for(a/=3,s/=3,$=1/(a-1),Z=1/(s-1),n=0;n<s;n++)c[L++]=n*Z,c[L++]=0;for(n=a;n>0;n--)c[L++]=(n-1)*$,c[L++]=1}g.st=new F({componentDatatype:v.FLOAT,componentsPerAttribute:2,values:c})}return e.normal&&(g.normal=new F({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:R.normals})),e.tangent&&(g.tangent=new F({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:R.tangents})),e.bitangent&&(g.bitangent=new F({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:R.bitangents})),{attributes:g,indices:_}}function qt(t,e){if(!e.normal&&!e.tangent&&!e.bitangent&&!e.st)return t;let i=t.position.values,l,d;(e.normal||e.bitangent)&&(l=t.normal.values,d=t.bitangent.values);let f=t.position.values.length/18,h=f*3,O=f*2,g=h*2,r;if(e.normal||e.bitangent||e.tangent){let a=e.normal?new Float32Array(h*6):void 0,s=e.tangent?new Float32Array(h*6):void 0,n=e.bitangent?new Float32Array(h*6):void 0,A=Rt,u=kt,b=yt,p=wt,z=jt,m=Ht,D=g;for(r=0;r<h;r+=3){let V=D+g;A=o.fromArray(i,r,A),u=o.fromArray(i,r+h,u),b=o.fromArray(i,(r+3)%h,b),u=o.subtract(u,A,u),b=o.subtract(b,A,b),p=o.normalize(o.cross(u,b,p),p),e.normal&&(M.addAttribute(a,p,V),M.addAttribute(a,p,V+3),M.addAttribute(a,p,D),M.addAttribute(a,p,D+3)),(e.tangent||e.bitangent)&&(m=o.fromArray(l,r,m),e.bitangent&&(M.addAttribute(n,m,V),M.addAttribute(n,m,V+3),M.addAttribute(n,m,D),M.addAttribute(n,m,D+3)),e.tangent&&(z=o.normalize(o.cross(m,p,z),z),M.addAttribute(s,z,V),M.addAttribute(s,z,V+3),M.addAttribute(s,z,D),M.addAttribute(s,z,D+3))),D+=6}if(e.normal){for(a.set(l),r=0;r<h;r+=3)a[r+h]=-l[r],a[r+h+1]=-l[r+1],a[r+h+2]=-l[r+2];t.normal.values=a}else t.normal=void 0;if(e.bitangent?(n.set(d),n.set(d,h),t.bitangent.values=n):t.bitangent=void 0,e.tangent){let V=t.tangent.values;s.set(V),s.set(V,h),t.tangent.values=s}}if(e.st){let a=t.st.values,s=new Float32Array(O*6);s.set(a),s.set(a,O);let n=O*2;for(let A=0;A<2;A++){for(s[n++]=a[0],s[n++]=a[1],r=2;r<O;r+=2){let u=a[r],b=a[r+1];s[n++]=u,s[n++]=b,s[n++]=u,s[n++]=b}s[n++]=a[0],s[n++]=a[1]}t.st.values=s}return t}function Ot(t,e,i){i[e++]=t[0],i[e++]=t[1],i[e++]=t[2];for(let l=3;l<t.length;l+=3){let d=t[l],f=t[l+1],h=t[l+2];i[e++]=d,i[e++]=f,i[e++]=h,i[e++]=d,i[e++]=f,i[e++]=h}return i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i}function Jt(t,e){let i=new J({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),l=t.ellipsoid,d=M.computePositions(t),f=Bt(d,i,l),h=t.height,O=t.extrudedHeight,g=f.attributes,r=f.indices,a=g.position.values,s=a.length,n=new Float64Array(s*6),A=new Float64Array(s);A.set(a);let u=new Float64Array(s*4);a=_t.scaleToGeodeticHeight(a,h,l),u=Ot(a,0,u),A=_t.scaleToGeodeticHeight(A,O,l),u=Ot(A,s*2,u),n.set(a),n.set(A,s),n.set(u,s*2),g.position.values=n,g=qt(g,e);let b,p=s/3;if(t.shadowVolume){let S=g.normal.values;s=S.length;let C=new Float32Array(s*6);for(b=0;b<s;b++)S[b]=-S[b];C.set(S,s),C=Ot(S,s*4,C),g.extrudeDirection=new F({componentDatatype:v.FLOAT,componentsPerAttribute:3,values:C}),e.normal||(g.normal=void 0)}if(Q(t.offsetAttribute)){let S=new Uint8Array(p*6);if(t.offsetAttribute===bt.TOP)S=S.fill(1,0,p).fill(1,p*2,p*4);else{let C=t.offsetAttribute===bt.NONE?0:1;S=S.fill(C)}g.applyOffset=new F({componentDatatype:v.UNSIGNED_BYTE,componentsPerAttribute:1,values:S})}let z=r.length,m=p+p,D=Nt.createTypedArray(n.length/3,z*2+m*3);D.set(r);let V=z;for(b=0;b<z;b+=3){let S=r[b],C=r[b+1],H=r[b+2];D[V++]=H+p,D[V++]=C+p,D[V++]=S+p}let rt,R,y,E;for(b=0;b<m;b+=2)rt=b+m,R=rt+m,y=rt+1,E=R+1,D[V++]=rt,D[V++]=R,D[V++]=y,D[V++]=y,D[V++]=R,D[V++]=E;return{attributes:g,indices:D}}var Vt=new o,ht=new o,K=new At;function zt(t,e,i,l,d,f){let h=o.subtract(e,t,Vt);o.normalize(h,h);let O=i.geodeticSurfaceNormal(t,ht),g=o.cross(h,O,Vt);o.multiplyByScalar(g,l,g);let r=d.latitude,a=d.longitude,s=f.latitude,n=f.longitude;o.add(t,g,ht),i.cartesianToCartographic(ht,K);let A=K.latitude,u=K.longitude;r=Math.min(r,A),a=Math.min(a,u),s=Math.max(s,A),n=Math.max(n,u),o.subtract(t,g,ht),i.cartesianToCartographic(ht,K),A=K.latitude,u=K.longitude,r=Math.min(r,A),a=Math.min(a,u),s=Math.max(s,A),n=Math.max(n,u),d.latitude=r,d.longitude=a,f.latitude=s,f.longitude=n}var G=new o,gt=new o,I=new At,W=new At;function Yt(t,e,i,l,d){t=Ut(t,e);let f=Pt(t,o.equalsEpsilon),h=f.length;if(h<2||i<=0)return new Et;let O=i*.5;I.latitude=Number.POSITIVE_INFINITY,I.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;let g,r;if(l===ut.ROUNDED){let n=f[0];o.subtract(n,f[1],G),o.normalize(G,G),o.multiplyByScalar(G,O,G),o.add(n,G,gt),e.cartesianToCartographic(gt,K),g=K.latitude,r=K.longitude,I.latitude=Math.min(I.latitude,g),I.longitude=Math.min(I.longitude,r),W.latitude=Math.max(W.latitude,g),W.longitude=Math.max(W.longitude,r)}for(let n=0;n<h-1;++n)zt(f[n],f[n+1],e,O,I,W);let a=f[h-1];o.subtract(a,f[h-2],G),o.normalize(G,G),o.multiplyByScalar(G,O,G),o.add(a,G,gt),zt(a,gt,e,O,I,W),l===ut.ROUNDED&&(e.cartesianToCartographic(gt,K),g=K.latitude,r=K.longitude,I.latitude=Math.min(I.latitude,g),I.longitude=Math.min(I.longitude,r),W.latitude=Math.max(W.latitude,g),W.longitude=Math.max(W.longitude,r));let s=Q(d)?d:new Et;return s.north=W.latitude,s.south=I.latitude,s.east=W.longitude,s.west=I.longitude,s}function tt(t){t=t??Tt.EMPTY_OBJECT;let e=t.positions,i=t.width;ot.defined("options.positions",e),ot.defined("options.width",i);let l=t.height??0,d=t.extrudedHeight??l;this._positions=e,this._ellipsoid=Y.clone(t.ellipsoid??Y.default),this._vertexFormat=J.clone(t.vertexFormat??J.DEFAULT),this._width=i,this._height=Math.max(l,d),this._extrudedHeight=Math.min(l,d),this._cornerType=t.cornerType??ut.ROUNDED,this._granularity=t.granularity??it.RADIANS_PER_DEGREE,this._shadowVolume=t.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*o.packedLength+Y.packedLength+J.packedLength+7}tt.pack=function(t,e,i){ot.defined("value",t),ot.defined("array",e),i=i??0;let l=t._positions,d=l.length;e[i++]=d;for(let f=0;f<d;++f,i+=o.packedLength)o.pack(l[f],e,i);return Y.pack(t._ellipsoid,e,i),i+=Y.packedLength,J.pack(t._vertexFormat,e,i),i+=J.packedLength,e[i++]=t._width,e[i++]=t._height,e[i++]=t._extrudedHeight,e[i++]=t._cornerType,e[i++]=t._granularity,e[i++]=t._shadowVolume?1:0,e[i]=t._offsetAttribute??-1,e};var It=Y.clone(Y.UNIT_SPHERE),Wt=new J,x={positions:void 0,ellipsoid:It,vertexFormat:Wt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};tt.unpack=function(t,e,i){ot.defined("array",t),e=e??0;let l=t[e++],d=new Array(l);for(let u=0;u<l;++u,e+=o.packedLength)d[u]=o.unpack(t,e);let f=Y.unpack(t,e,It);e+=Y.packedLength;let h=J.unpack(t,e,Wt);e+=J.packedLength;let O=t[e++],g=t[e++],r=t[e++],a=t[e++],s=t[e++],n=t[e++]===1,A=t[e];return Q(i)?(i._positions=d,i._ellipsoid=Y.clone(f,i._ellipsoid),i._vertexFormat=J.clone(h,i._vertexFormat),i._width=O,i._height=g,i._extrudedHeight=r,i._cornerType=a,i._granularity=s,i._shadowVolume=n,i._offsetAttribute=A===-1?void 0:A,i):(x.positions=d,x.width=O,x.height=g,x.extrudedHeight=r,x.cornerType=a,x.granularity=s,x.shadowVolume=n,x.offsetAttribute=A===-1?void 0:A,new tt(x))};tt.computeRectangle=function(t,e){t=t??Tt.EMPTY_OBJECT;let i=t.positions,l=t.width;ot.defined("options.positions",i),ot.defined("options.width",l);let d=t.ellipsoid??Y.default,f=t.cornerType??ut.ROUNDED;return Yt(i,d,l,f,e)};tt.createGeometry=function(t){let e=t._positions,i=t._width,l=t._ellipsoid;e=Ut(e,l);let d=Pt(e,o.equalsEpsilon);if(d.length<2||i<=0)return;let f=t._height,h=t._extrudedHeight,O=!it.equalsEpsilon(f,h,0,it.EPSILON2),g=t._vertexFormat,r={ellipsoid:l,positions:d,width:i,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0},a;if(O)r.height=f,r.extrudedHeight=h,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,a=Jt(r,g);else{let A=M.computePositions(r);if(a=Bt(A,g,l),a.attributes.position.values=_t.scaleToGeodeticHeight(a.attributes.position.values,f,l),Q(t._offsetAttribute)){let u=t._offsetAttribute===bt.NONE?0:1,b=a.attributes.position.values.length,p=new Uint8Array(b/3).fill(u);a.attributes.applyOffset=new F({componentDatatype:v.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}}let s=a.attributes,n=St.fromVertices(s.position.values,void 0,3);return g.position||(a.attributes.position.values=void 0),new Ct({attributes:s,indices:a.indices,primitiveType:Mt.TRIANGLES,boundingSphere:n,offsetAttribute:t._offsetAttribute})};tt.createShadowVolume=function(t,e,i){let l=t._granularity,d=t._ellipsoid,f=e(l,d),h=i(l,d);return new tt({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:d,granularity:l,extrudedHeight:f,height:h,vertexFormat:J.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(tt.prototype,{rectangle:{get:function(){return Q(this._rectangle)||(this._rectangle=Yt(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Lt=tt;function Gt(t,e){return Q(e)&&(t=Lt.unpack(t,e)),t._ellipsoid=Y.clone(t._ellipsoid),Lt.createGeometry(t)}var Ae=Gt;export{Ae as default}; +import{a as M}from"./chunk-B2EMOZB6.js";import{a as ut}from"./chunk-LHXP7CH5.js";import"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import{a as bt}from"./chunk-GNBKSQYP.js";import{a as G}from"./chunk-FZSSAWMQ.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{b as _t}from"./chunk-SIFLADX4.js";import{a as Pt}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as Nt}from"./chunk-AZINMULF.js";import{a as Dt}from"./chunk-ILBQ77ZM.js";import{b as Mt,c as Ct,d as x}from"./chunk-7RNSURKI.js";import{c as St}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{j as Et}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as F}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as At,c as Y}from"./chunk-KP72RGCH.js";import{a as o,c as Tt}from"./chunk-OSVSBQDY.js";import{a as st}from"./chunk-LZC73BOP.js";import{b as it}from"./chunk-OU2IPMYE.js";import{f as X}from"./chunk-H7SJWKIY.js";var Rt=new o,kt=new o,yt=new o,wt=new o,jt=new o,Ht=new o,at=new o,dt=new o;function Ut(t,e){for(let i=0;i<t.length;i++)t[i]=e.scaleToGeodeticSurface(t[i],t[i]);return t}function Z(t,e,i,r,d,f){let g=t.normals,O=t.tangents,p=t.bitangents,s=o.normalize(o.cross(i,e,at),at);f.normal&&M.addAttribute(g,e,r,d),f.tangent&&M.addAttribute(O,s,r,d),f.bitangent&&M.addAttribute(p,i,r,d)}function Bt(t,e,i){let r=t.positions,d=t.corners,f=t.endPositions,g=t.lefts,O=t.normals,p=new Dt,s=0,a=0,n,c=0,u;for(n=0;n<r.length;n+=2)u=r[n].length-3,s+=u,c+=u*2,a+=r[n+1].length-3;for(s+=3,a+=3,n=0;n<d.length;n++){let l=d[n].leftPositions;X(l)?(u=l.length,s+=u,c+=u):(u=d[n].rightPositions.length,a+=u,c+=u)}let A=X(f),h;A&&(h=f[0].length-3,s+=h,a+=h,h/=3,c+=h*6);let E=s+a,m=new Float64Array(E),k=e.normal?new Float32Array(E):void 0,C=e.tangent?new Float32Array(E):void 0,D=e.bitangent?new Float32Array(E):void 0,V={normals:k,tangents:C,bitangents:D},b=0,y=E-1,j,N,L,H,P=Rt,w=kt,nt,ot,pt=h/2,_=Nt.createTypedArray(E/3,c),T=0;if(A){ot=yt,nt=wt;let l=f[0];for(P=o.fromArray(O,0,P),w=o.fromArray(g,0,w),n=0;n<pt;n++)ot=o.fromArray(l,(pt-1-n)*3,ot),nt=o.fromArray(l,(pt+n)*3,nt),M.addAttribute(m,nt,b),M.addAttribute(m,ot,void 0,y),Z(V,P,w,b,y,e),N=b/3,H=N+1,j=(y-2)/3,L=j-1,_[T++]=j,_[T++]=N,_[T++]=L,_[T++]=L,_[T++]=N,_[T++]=H,b+=3,y-=3}let mt=0,ft=0,rt=r[mt++],q=r[mt++];m.set(rt,b),m.set(q,y-q.length+1),w=o.fromArray(g,ft,w);let lt,ct;for(u=q.length-3,n=0;n<u;n+=3)lt=i.geodeticSurfaceNormal(o.fromArray(rt,n,at),at),ct=i.geodeticSurfaceNormal(o.fromArray(q,u-n,dt),dt),P=o.normalize(o.add(lt,ct,P),P),Z(V,P,w,b,y,e),N=b/3,H=N+1,j=(y-2)/3,L=j-1,_[T++]=j,_[T++]=N,_[T++]=L,_[T++]=L,_[T++]=N,_[T++]=H,b+=3,y-=3;for(lt=i.geodeticSurfaceNormal(o.fromArray(rt,u,at),at),ct=i.geodeticSurfaceNormal(o.fromArray(q,u,dt),dt),P=o.normalize(o.add(lt,ct,P),P),ft+=3,n=0;n<d.length;n++){let l,v=d[n],$=v.leftPositions,z=v.rightPositions,J,S,R=Ht,U=yt,B=wt;if(P=o.fromArray(O,ft,P),X($)){for(Z(V,P,w,void 0,y,e),y-=3,J=H,S=L,l=0;l<$.length/3;l++)R=o.fromArray($,l*3,R),_[T++]=J,_[T++]=S-l-1,_[T++]=S-l,M.addAttribute(m,R,void 0,y),U=o.fromArray(m,(S-l-1)*3,U),B=o.fromArray(m,J*3,B),w=o.normalize(o.subtract(U,B,w),w),Z(V,P,w,void 0,y,e),y-=3;R=o.fromArray(m,J*3,R),U=o.subtract(o.fromArray(m,S*3,U),R,U),B=o.subtract(o.fromArray(m,(S-l)*3,B),R,B),w=o.normalize(o.add(U,B,w),w),Z(V,P,w,b,void 0,e),b+=3}else{for(Z(V,P,w,b,void 0,e),b+=3,J=L,S=H,l=0;l<z.length/3;l++)R=o.fromArray(z,l*3,R),_[T++]=J,_[T++]=S+l,_[T++]=S+l+1,M.addAttribute(m,R,b),U=o.fromArray(m,J*3,U),B=o.fromArray(m,(S+l)*3,B),w=o.normalize(o.subtract(U,B,w),w),Z(V,P,w,b,void 0,e),b+=3;R=o.fromArray(m,J*3,R),U=o.subtract(o.fromArray(m,(S+l)*3,U),R,U),B=o.subtract(o.fromArray(m,S*3,B),R,B),w=o.normalize(o.negate(o.add(B,U,w),w),w),Z(V,P,w,void 0,y,e),y-=3}for(rt=r[mt++],q=r[mt++],rt.splice(0,3),q.splice(q.length-3,3),m.set(rt,b),m.set(q,y-q.length+1),u=q.length-3,ft+=3,w=o.fromArray(g,ft,w),l=0;l<q.length;l+=3)lt=i.geodeticSurfaceNormal(o.fromArray(rt,l,at),at),ct=i.geodeticSurfaceNormal(o.fromArray(q,u-l,dt),dt),P=o.normalize(o.add(lt,ct,P),P),Z(V,P,w,b,y,e),H=b/3,N=H-1,L=(y-2)/3,j=L+1,_[T++]=j,_[T++]=N,_[T++]=L,_[T++]=L,_[T++]=N,_[T++]=H,b+=3,y-=3;b-=3,y+=3}if(P=o.fromArray(O,O.length-3,P),Z(V,P,w,b,y,e),A){b+=3,y-=3,ot=yt,nt=wt;let l=f[1];for(n=0;n<pt;n++)ot=o.fromArray(l,(h-n-1)*3,ot),nt=o.fromArray(l,n*3,nt),M.addAttribute(m,ot,void 0,y),M.addAttribute(m,nt,b),Z(V,P,w,b,y,e),H=b/3,N=H-1,L=(y-2)/3,j=L+1,_[T++]=j,_[T++]=N,_[T++]=L,_[T++]=L,_[T++]=N,_[T++]=H,b+=3,y-=3}if(p.position=new x({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:m}),e.st){let l=new Float32Array(E/3*2),v,$,z=0;if(A){s/=3,a/=3;let J=Math.PI/(h+1);$=1/(s-h+1),v=1/(a-h+1);let S,R=h/2;for(n=R+1;n<h+1;n++)S=st.PI_OVER_TWO+J*n,l[z++]=v*(1+Math.cos(S)),l[z++]=.5*(1+Math.sin(S));for(n=1;n<a-h+1;n++)l[z++]=n*v,l[z++]=0;for(n=h;n>R;n--)S=st.PI_OVER_TWO-n*J,l[z++]=1-v*(1+Math.cos(S)),l[z++]=.5*(1+Math.sin(S));for(n=R;n>0;n--)S=st.PI_OVER_TWO-J*n,l[z++]=1-$*(1+Math.cos(S)),l[z++]=.5*(1+Math.sin(S));for(n=s-h;n>0;n--)l[z++]=n*$,l[z++]=1;for(n=1;n<R+1;n++)S=st.PI_OVER_TWO+J*n,l[z++]=$*(1+Math.cos(S)),l[z++]=.5*(1+Math.sin(S))}else{for(s/=3,a/=3,$=1/(s-1),v=1/(a-1),n=0;n<a;n++)l[z++]=n*v,l[z++]=0;for(n=s;n>0;n--)l[z++]=(n-1)*$,l[z++]=1}p.st=new x({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:l})}return e.normal&&(p.normal=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:V.normals})),e.tangent&&(p.tangent=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:V.tangents})),e.bitangent&&(p.bitangent=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:V.bitangents})),{attributes:p,indices:_}}function qt(t,e){if(!e.normal&&!e.tangent&&!e.bitangent&&!e.st)return t;let i=t.position.values,r,d;(e.normal||e.bitangent)&&(r=t.normal.values,d=t.bitangent.values);let f=t.position.values.length/18,g=f*3,O=f*2,p=g*2,s;if(e.normal||e.bitangent||e.tangent){let a=e.normal?new Float32Array(g*6):void 0,n=e.tangent?new Float32Array(g*6):void 0,c=e.bitangent?new Float32Array(g*6):void 0,u=Rt,A=kt,h=yt,E=wt,m=jt,k=Ht,C=p;for(s=0;s<g;s+=3){let D=C+p;u=o.fromArray(i,s,u),A=o.fromArray(i,s+g,A),h=o.fromArray(i,(s+3)%g,h),A=o.subtract(A,u,A),h=o.subtract(h,u,h),E=o.normalize(o.cross(A,h,E),E),e.normal&&(M.addAttribute(a,E,D),M.addAttribute(a,E,D+3),M.addAttribute(a,E,C),M.addAttribute(a,E,C+3)),(e.tangent||e.bitangent)&&(k=o.fromArray(r,s,k),e.bitangent&&(M.addAttribute(c,k,D),M.addAttribute(c,k,D+3),M.addAttribute(c,k,C),M.addAttribute(c,k,C+3)),e.tangent&&(m=o.normalize(o.cross(k,E,m),m),M.addAttribute(n,m,D),M.addAttribute(n,m,D+3),M.addAttribute(n,m,C),M.addAttribute(n,m,C+3))),C+=6}if(e.normal){for(a.set(r),s=0;s<g;s+=3)a[s+g]=-r[s],a[s+g+1]=-r[s+1],a[s+g+2]=-r[s+2];t.normal.values=a}else t.normal=void 0;if(e.bitangent?(c.set(d),c.set(d,g),t.bitangent.values=c):t.bitangent=void 0,e.tangent){let D=t.tangent.values;n.set(D),n.set(D,g),t.tangent.values=n}}if(e.st){let a=t.st.values,n=new Float32Array(O*6);n.set(a),n.set(a,O);let c=O*2;for(let u=0;u<2;u++){for(n[c++]=a[0],n[c++]=a[1],s=2;s<O;s+=2){let A=a[s],h=a[s+1];n[c++]=A,n[c++]=h,n[c++]=A,n[c++]=h}n[c++]=a[0],n[c++]=a[1]}t.st.values=n}return t}function Ot(t,e,i){i[e++]=t[0],i[e++]=t[1],i[e++]=t[2];for(let r=3;r<t.length;r+=3){let d=t[r],f=t[r+1],g=t[r+2];i[e++]=d,i[e++]=f,i[e++]=g,i[e++]=d,i[e++]=f,i[e++]=g}return i[e++]=t[0],i[e++]=t[1],i[e]=t[2],i}function Jt(t,e){let i=new G({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),r=t.ellipsoid,d=M.computePositions(t),f=Bt(d,i,r),g=t.height,O=t.extrudedHeight,p=f.attributes,s=f.indices,a=p.position.values,n=a.length,c=new Float64Array(n*6),u=new Float64Array(n);u.set(a);let A=new Float64Array(n*4);a=_t.scaleToGeodeticHeight(a,g,r),A=Ot(a,0,A),u=_t.scaleToGeodeticHeight(u,O,r),A=Ot(u,n*2,A),c.set(a),c.set(u,n),c.set(A,n*2),p.position.values=c,p=qt(p,e);let h,E=n/3;if(t.shadowVolume){let N=p.normal.values;n=N.length;let L=new Float32Array(n*6);for(h=0;h<n;h++)N[h]=-N[h];L.set(N,n),L=Ot(N,n*4,L),p.extrudeDirection=new x({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:L}),e.normal||(p.normal=void 0)}if(X(t.offsetAttribute)){let N=new Uint8Array(E*6);if(t.offsetAttribute===bt.TOP)N=N.fill(1,0,E).fill(1,E*2,E*4);else{let L=t.offsetAttribute===bt.NONE?0:1;N=N.fill(L)}p.applyOffset=new x({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}let m=s.length,k=E+E,C=Nt.createTypedArray(c.length/3,m*2+k*3);C.set(s);let D=m;for(h=0;h<m;h+=3){let N=s[h],L=s[h+1],H=s[h+2];C[D++]=H+E,C[D++]=L+E,C[D++]=N+E}let V,b,y,j;for(h=0;h<k;h+=2)V=h+k,b=V+k,y=V+1,j=b+1,C[D++]=V,C[D++]=b,C[D++]=y,C[D++]=y,C[D++]=b,C[D++]=j;return{attributes:p,indices:C}}var Vt=new o,ht=new o,Q=new At;function zt(t,e,i,r,d,f){let g=o.subtract(e,t,Vt);o.normalize(g,g);let O=i.geodeticSurfaceNormal(t,ht),p=o.cross(g,O,Vt);o.multiplyByScalar(p,r,p);let s=d.latitude,a=d.longitude,n=f.latitude,c=f.longitude;o.add(t,p,ht),i.cartesianToCartographic(ht,Q);let u=Q.latitude,A=Q.longitude;s=Math.min(s,u),a=Math.min(a,A),n=Math.max(n,u),c=Math.max(c,A),o.subtract(t,p,ht),i.cartesianToCartographic(ht,Q),u=Q.latitude,A=Q.longitude,s=Math.min(s,u),a=Math.min(a,A),n=Math.max(n,u),c=Math.max(c,A),d.latitude=s,d.longitude=a,f.latitude=n,f.longitude=c}var K=new o,gt=new o,I=new At,W=new At;function Yt(t,e,i,r,d){t=Ut(t,e);let f=Pt(t,o.equalsEpsilon),g=f.length;if(g<2||i<=0)return new Et;let O=i*.5;I.latitude=Number.POSITIVE_INFINITY,I.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;let p,s;if(r===ut.ROUNDED){let c=f[0];o.subtract(c,f[1],K),o.normalize(K,K),o.multiplyByScalar(K,O,K),o.add(c,K,gt),e.cartesianToCartographic(gt,Q),p=Q.latitude,s=Q.longitude,I.latitude=Math.min(I.latitude,p),I.longitude=Math.min(I.longitude,s),W.latitude=Math.max(W.latitude,p),W.longitude=Math.max(W.longitude,s)}for(let c=0;c<g-1;++c)zt(f[c],f[c+1],e,O,I,W);let a=f[g-1];o.subtract(a,f[g-2],K),o.normalize(K,K),o.multiplyByScalar(K,O,K),o.add(a,K,gt),zt(a,gt,e,O,I,W),r===ut.ROUNDED&&(e.cartesianToCartographic(gt,Q),p=Q.latitude,s=Q.longitude,I.latitude=Math.min(I.latitude,p),I.longitude=Math.min(I.longitude,s),W.latitude=Math.max(W.latitude,p),W.longitude=Math.max(W.longitude,s));let n=X(d)?d:new Et;return n.north=W.latitude,n.south=I.latitude,n.east=W.longitude,n.west=I.longitude,n}function et(t){t=t??Tt.EMPTY_OBJECT;let e=t.positions,i=t.width;it.defined("options.positions",e),it.defined("options.width",i);let r=t.height??0,d=t.extrudedHeight??r;this._positions=e,this._ellipsoid=Y.clone(t.ellipsoid??Y.default),this._vertexFormat=G.clone(t.vertexFormat??G.DEFAULT),this._width=i,this._height=Math.max(r,d),this._extrudedHeight=Math.min(r,d),this._cornerType=t.cornerType??ut.ROUNDED,this._granularity=t.granularity??st.RADIANS_PER_DEGREE,this._shadowVolume=t.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*o.packedLength+Y.packedLength+G.packedLength+7}et.pack=function(t,e,i){it.defined("value",t),it.defined("array",e),i=i??0;let r=t._positions,d=r.length;e[i++]=d;for(let f=0;f<d;++f,i+=o.packedLength)o.pack(r[f],e,i);return Y.pack(t._ellipsoid,e,i),i+=Y.packedLength,G.pack(t._vertexFormat,e,i),i+=G.packedLength,e[i++]=t._width,e[i++]=t._height,e[i++]=t._extrudedHeight,e[i++]=t._cornerType,e[i++]=t._granularity,e[i++]=t._shadowVolume?1:0,e[i]=t._offsetAttribute??-1,e};var It=Y.clone(Y.UNIT_SPHERE),Wt=new G,tt={positions:void 0,ellipsoid:It,vertexFormat:Wt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};et.unpack=function(t,e,i){it.defined("array",t),e=e??0;let r=t[e++],d=new Array(r);for(let A=0;A<r;++A,e+=o.packedLength)d[A]=o.unpack(t,e);let f=Y.unpack(t,e,It);e+=Y.packedLength;let g=G.unpack(t,e,Wt);e+=G.packedLength;let O=t[e++],p=t[e++],s=t[e++],a=t[e++],n=t[e++],c=t[e++]===1,u=t[e];return X(i)?(i._positions=d,i._ellipsoid=Y.clone(f,i._ellipsoid),i._vertexFormat=G.clone(g,i._vertexFormat),i._width=O,i._height=p,i._extrudedHeight=s,i._cornerType=a,i._granularity=n,i._shadowVolume=c,i._offsetAttribute=u===-1?void 0:u,i):(tt.positions=d,tt.width=O,tt.height=p,tt.extrudedHeight=s,tt.cornerType=a,tt.granularity=n,tt.shadowVolume=c,tt.offsetAttribute=u===-1?void 0:u,new et(tt))};et.computeRectangle=function(t,e){t=t??Tt.EMPTY_OBJECT;let i=t.positions,r=t.width;it.defined("options.positions",i),it.defined("options.width",r);let d=t.ellipsoid??Y.default,f=t.cornerType??ut.ROUNDED;return Yt(i,d,r,f,e)};et.createGeometry=function(t){let e=t._positions,i=t._width,r=t._ellipsoid;e=Ut(e,r);let d=Pt(e,o.equalsEpsilon);if(d.length<2||i<=0)return;let f=t._height,g=t._extrudedHeight,O=!st.equalsEpsilon(f,g,0,st.EPSILON2),p=t._vertexFormat,s={ellipsoid:r,positions:d,width:i,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0},a;if(O)s.height=f,s.extrudedHeight=g,s.shadowVolume=t._shadowVolume,s.offsetAttribute=t._offsetAttribute,a=Jt(s,p);else{let u=M.computePositions(s);if(a=Bt(u,p,r),a.attributes.position.values=_t.scaleToGeodeticHeight(a.attributes.position.values,f,r),X(t._offsetAttribute)){let A=t._offsetAttribute===bt.NONE?0:1,h=a.attributes.position.values.length,E=new Uint8Array(h/3).fill(A);a.attributes.applyOffset=new x({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}}let n=a.attributes,c=St.fromVertices(n.position.values,void 0,3);return p.position||(a.attributes.position.values=void 0),new Ct({attributes:n,indices:a.indices,primitiveType:Mt.TRIANGLES,boundingSphere:c,offsetAttribute:t._offsetAttribute})};et.createShadowVolume=function(t,e,i){let r=t._granularity,d=t._ellipsoid,f=e(r,d),g=i(r,d);return new et({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:d,granularity:r,extrudedHeight:f,height:g,vertexFormat:G.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(et.prototype,{rectangle:{get:function(){return X(this._rectangle)||(this._rectangle=Yt(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Lt=et;function Gt(t,e){return X(e)&&(t=Lt.unpack(t,e)),t._ellipsoid=Y.clone(t._ellipsoid),Lt.createGeometry(t)}var Ae=Gt;export{Ae as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCorridorOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createCorridorOutlineGeometry.js index 55d119cb5..9adba2c0b 100644 --- a/plugins/feature/map/Cesium/Workers/createCorridorOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCorridorOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as C}from"./chunk-2RJONVEL.js";import{a as Q}from"./chunk-3RSLEP7W.js";import"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import{a as J}from"./chunk-4W2MZV6I.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{b as K}from"./chunk-BKYT7QHD.js";import{a as it}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as X}from"./chunk-JQLYZQ6V.js";import{a as et}from"./chunk-J3L5WX3X.js";import{b as I,c as tt,d as z}from"./chunk-AVPLM4UI.js";import{d as x}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as q}from"./chunk-WER4LUMF.js";import{a as A,d as P,f as $}from"./chunk-FGKVHLJ4.js";import{a as Y}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as B}from"./chunk-ELJAHN3H.js";import{e as N}from"./chunk-3BGP4HCL.js";var ot=new A,nt=new A,lt=new A;function ft(t,i){for(let e=0;e<t.length;e++)t[e]=i.scaleToGeodeticSurface(t[e],t[e]);return t}function st(t,i){let e=[],r=t.positions,h=t.corners,m=t.endPositions,H=new et,y,u=0,p=0,o,g=0,d;for(o=0;o<r.length;o+=2)d=r[o].length-3,u+=d,g+=d/3*4,p+=r[o+1].length-3;for(u+=3,p+=3,o=0;o<h.length;o++){y=h[o];let c=h[o].leftPositions;N(c)?(d=c.length,u+=d,g+=d/3*2):(d=h[o].rightPositions.length,p+=d,g+=d/3*2)}let _=N(m),w;_&&(w=m[0].length-3,u+=w,p+=w,w/=3,g+=w*4);let T=u+p,b=new Float64Array(T),n=0,s=T-1,a,E,L,k,S,U,j=w/2,l=X.createTypedArray(T/3,g+4),f=0;if(l[f++]=n/3,l[f++]=(s-2)/3,_){e.push(n/3),U=ot,S=nt;let c=m[0];for(o=0;o<j;o++)U=A.fromArray(c,(j-1-o)*3,U),S=A.fromArray(c,(j+o)*3,S),C.addAttribute(b,S,n),C.addAttribute(b,U,void 0,s),E=n/3,k=E+1,a=(s-2)/3,L=a-1,l[f++]=a,l[f++]=L,l[f++]=E,l[f++]=k,n+=3,s-=3}let V=0,F=r[V++],D=r[V++];for(b.set(F,n),b.set(D,s-D.length+1),d=D.length-3,e.push(n/3,(s-2)/3),o=0;o<d;o+=3)E=n/3,k=E+1,a=(s-2)/3,L=a-1,l[f++]=a,l[f++]=L,l[f++]=E,l[f++]=k,n+=3,s-=3;for(o=0;o<h.length;o++){let c;y=h[o];let G=y.leftPositions,W=y.rightPositions,O,R=lt;if(N(G)){for(s-=3,O=L,e.push(k),c=0;c<G.length/3;c++)R=A.fromArray(G,c*3,R),l[f++]=O-c-1,l[f++]=O-c,C.addAttribute(b,R,void 0,s),s-=3;e.push(O-Math.floor(G.length/6)),i===Q.BEVELED&&e.push((s-2)/3+1),n+=3}else{for(n+=3,O=k,e.push(L),c=0;c<W.length/3;c++)R=A.fromArray(W,c*3,R),l[f++]=O+c,l[f++]=O+c+1,C.addAttribute(b,R,n),n+=3;e.push(O+Math.floor(W.length/6)),i===Q.BEVELED&&e.push(n/3-1),s-=3}for(F=r[V++],D=r[V++],F.splice(0,3),D.splice(D.length-3,3),b.set(F,n),b.set(D,s-D.length+1),d=D.length-3,c=0;c<D.length;c+=3)k=n/3,E=k-1,L=(s-2)/3,a=L+1,l[f++]=a,l[f++]=L,l[f++]=E,l[f++]=k,n+=3,s-=3;n-=3,s+=3,e.push(n/3,(s-2)/3)}if(_){n+=3,s-=3,U=ot,S=nt;let c=m[1];for(o=0;o<j;o++)U=A.fromArray(c,(w-o-1)*3,U),S=A.fromArray(c,o*3,S),C.addAttribute(b,U,void 0,s),C.addAttribute(b,S,n),k=n/3,E=k-1,L=(s-2)/3,a=L+1,l[f++]=a,l[f++]=L,l[f++]=E,l[f++]=k,n+=3,s-=3;e.push(n/3)}else e.push(n/3,(s-2)/3);return l[f++]=n/3,l[f++]=(s-2)/3,H.position=new z({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:H,indices:l,wallIndices:e}}function ct(t){let i=t.ellipsoid,e=C.computePositions(t),r=st(e,t.cornerType),h=r.wallIndices,m=t.height,H=t.extrudedHeight,y=r.attributes,u=r.indices,p=y.position.values,o=p.length,g=new Float64Array(o);g.set(p);let d=new Float64Array(o*2);if(p=K.scaleToGeodeticHeight(p,m,i),g=K.scaleToGeodeticHeight(g,H,i),d.set(p),d.set(g,o),y.position.values=d,o/=3,N(t.offsetAttribute)){let a=new Uint8Array(o*2);if(t.offsetAttribute===J.TOP)a=a.fill(1,0,o);else{let E=t.offsetAttribute===J.NONE?0:1;a=a.fill(E)}y.applyOffset=new z({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}let _,w=u.length,T=X.createTypedArray(d.length/3,(w+h.length)*2);T.set(u);let b=w;for(_=0;_<w;_+=2){let a=u[_],E=u[_+1];T[b++]=a+o,T[b++]=E+o}let n,s;for(_=0;_<h.length;_++)n=h[_],s=n+o,T[b++]=n,T[b++]=s;return{attributes:y,indices:T}}function M(t){t=t??$.EMPTY_OBJECT;let i=t.positions,e=t.width;B.typeOf.object("options.positions",i),B.typeOf.number("options.width",e);let r=t.height??0,h=t.extrudedHeight??r;this._positions=i,this._ellipsoid=P.clone(t.ellipsoid??P.default),this._width=e,this._height=Math.max(r,h),this._extrudedHeight=Math.min(r,h),this._cornerType=t.cornerType??Q.ROUNDED,this._granularity=t.granularity??Y.RADIANS_PER_DEGREE,this._offsetAttribute=t.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+i.length*A.packedLength+P.packedLength+6}M.pack=function(t,i,e){B.typeOf.object("value",t),B.typeOf.object("array",i),e=e??0;let r=t._positions,h=r.length;i[e++]=h;for(let m=0;m<h;++m,e+=A.packedLength)A.pack(r[m],i,e);return P.pack(t._ellipsoid,i,e),e+=P.packedLength,i[e++]=t._width,i[e++]=t._height,i[e++]=t._extrudedHeight,i[e++]=t._cornerType,i[e++]=t._granularity,i[e]=t._offsetAttribute??-1,i};var rt=P.clone(P.UNIT_SPHERE),v={positions:void 0,ellipsoid:rt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};M.unpack=function(t,i,e){B.typeOf.object("array",t),i=i??0;let r=t[i++],h=new Array(r);for(let d=0;d<r;++d,i+=A.packedLength)h[d]=A.unpack(t,i);let m=P.unpack(t,i,rt);i+=P.packedLength;let H=t[i++],y=t[i++],u=t[i++],p=t[i++],o=t[i++],g=t[i];return N(e)?(e._positions=h,e._ellipsoid=P.clone(m,e._ellipsoid),e._width=H,e._height=y,e._extrudedHeight=u,e._cornerType=p,e._granularity=o,e._offsetAttribute=g===-1?void 0:g,e):(v.positions=h,v.width=H,v.height=y,v.extrudedHeight=u,v.cornerType=p,v.granularity=o,v.offsetAttribute=g===-1?void 0:g,new M(v))};M.createGeometry=function(t){let i=t._positions,e=t._width,r=t._ellipsoid;i=ft(i,r);let h=it(i,A.equalsEpsilon);if(h.length<2||e<=0)return;let m=t._height,H=t._extrudedHeight,y=!Y.equalsEpsilon(m,H,0,Y.EPSILON2),u={ellipsoid:r,positions:h,width:e,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1},p;if(y)u.height=m,u.extrudedHeight=H,u.offsetAttribute=t._offsetAttribute,p=ct(u);else{let d=C.computePositions(u);if(p=st(d,u.cornerType),p.attributes.position.values=K.scaleToGeodeticHeight(p.attributes.position.values,m,r),N(t._offsetAttribute)){let _=p.attributes.position.values.length,w=t._offsetAttribute===J.NONE?0:1,T=new Uint8Array(_/3).fill(w);p.attributes.applyOffset=new z({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}}let o=p.attributes,g=x.fromVertices(o.position.values,void 0,3);return new tt({attributes:o,indices:p.indices,primitiveType:I.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var Z=M;function ht(t,i){return N(i)&&(t=Z.unpack(t,i)),t._ellipsoid=P.clone(t._ellipsoid),Z.createGeometry(t)}var Ot=ht;export{Ot as default}; +import{a as C}from"./chunk-B2EMOZB6.js";import{a as Q}from"./chunk-LHXP7CH5.js";import"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import{a as J}from"./chunk-GNBKSQYP.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{b as K}from"./chunk-SIFLADX4.js";import{a as it}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as X}from"./chunk-AZINMULF.js";import{a as et}from"./chunk-ILBQ77ZM.js";import{b as I,c as tt,d as z}from"./chunk-7RNSURKI.js";import{c as x}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as q}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as P}from"./chunk-KP72RGCH.js";import{a as A,c as $}from"./chunk-OSVSBQDY.js";import{a as Y}from"./chunk-LZC73BOP.js";import{b as B}from"./chunk-OU2IPMYE.js";import{f as N}from"./chunk-H7SJWKIY.js";var ot=new A,nt=new A,lt=new A;function ft(t,i){for(let e=0;e<t.length;e++)t[e]=i.scaleToGeodeticSurface(t[e],t[e]);return t}function st(t,i){let e=[],r=t.positions,p=t.corners,m=t.endPositions,H=new et,E,u=0,h=0,o,g=0,d;for(o=0;o<r.length;o+=2)d=r[o].length-3,u+=d,g+=d/3*4,h+=r[o+1].length-3;for(u+=3,h+=3,o=0;o<p.length;o++){let c=p[o].leftPositions;N(c)?(d=c.length,u+=d,g+=d/3*2):(d=p[o].rightPositions.length,h+=d,g+=d/3*2)}let _=N(m),w;_&&(w=m[0].length-3,u+=w,h+=w,w/=3,g+=w*4);let T=u+h,b=new Float64Array(T),n=0,s=T-1,a,y,L,k,S,U,j=w/2,l=X.createTypedArray(T/3,g+4),f=0;if(l[f++]=n/3,l[f++]=(s-2)/3,_){e.push(n/3),U=ot,S=nt;let c=m[0];for(o=0;o<j;o++)U=A.fromArray(c,(j-1-o)*3,U),S=A.fromArray(c,(j+o)*3,S),C.addAttribute(b,S,n),C.addAttribute(b,U,void 0,s),y=n/3,k=y+1,a=(s-2)/3,L=a-1,l[f++]=a,l[f++]=L,l[f++]=y,l[f++]=k,n+=3,s-=3}let V=0,F=r[V++],D=r[V++];for(b.set(F,n),b.set(D,s-D.length+1),d=D.length-3,e.push(n/3,(s-2)/3),o=0;o<d;o+=3)y=n/3,k=y+1,a=(s-2)/3,L=a-1,l[f++]=a,l[f++]=L,l[f++]=y,l[f++]=k,n+=3,s-=3;for(o=0;o<p.length;o++){let c;E=p[o];let G=E.leftPositions,W=E.rightPositions,O,R=lt;if(N(G)){for(s-=3,O=L,e.push(k),c=0;c<G.length/3;c++)R=A.fromArray(G,c*3,R),l[f++]=O-c-1,l[f++]=O-c,C.addAttribute(b,R,void 0,s),s-=3;e.push(O-Math.floor(G.length/6)),i===Q.BEVELED&&e.push((s-2)/3+1),n+=3}else{for(n+=3,O=k,e.push(L),c=0;c<W.length/3;c++)R=A.fromArray(W,c*3,R),l[f++]=O+c,l[f++]=O+c+1,C.addAttribute(b,R,n),n+=3;e.push(O+Math.floor(W.length/6)),i===Q.BEVELED&&e.push(n/3-1),s-=3}for(F=r[V++],D=r[V++],F.splice(0,3),D.splice(D.length-3,3),b.set(F,n),b.set(D,s-D.length+1),c=0;c<D.length;c+=3)k=n/3,y=k-1,L=(s-2)/3,a=L+1,l[f++]=a,l[f++]=L,l[f++]=y,l[f++]=k,n+=3,s-=3;n-=3,s+=3,e.push(n/3,(s-2)/3)}if(_){n+=3,s-=3,U=ot,S=nt;let c=m[1];for(o=0;o<j;o++)U=A.fromArray(c,(w-o-1)*3,U),S=A.fromArray(c,o*3,S),C.addAttribute(b,U,void 0,s),C.addAttribute(b,S,n),k=n/3,y=k-1,L=(s-2)/3,a=L+1,l[f++]=a,l[f++]=L,l[f++]=y,l[f++]=k,n+=3,s-=3;e.push(n/3)}else e.push(n/3,(s-2)/3);return l[f++]=n/3,l[f]=(s-2)/3,H.position=new z({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:H,indices:l,wallIndices:e}}function ct(t){let i=t.ellipsoid,e=C.computePositions(t),r=st(e,t.cornerType),p=r.wallIndices,m=t.height,H=t.extrudedHeight,E=r.attributes,u=r.indices,h=E.position.values,o=h.length,g=new Float64Array(o);g.set(h);let d=new Float64Array(o*2);if(h=K.scaleToGeodeticHeight(h,m,i),g=K.scaleToGeodeticHeight(g,H,i),d.set(h),d.set(g,o),E.position.values=d,o/=3,N(t.offsetAttribute)){let a=new Uint8Array(o*2);if(t.offsetAttribute===J.TOP)a=a.fill(1,0,o);else{let y=t.offsetAttribute===J.NONE?0:1;a=a.fill(y)}E.applyOffset=new z({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}let _,w=u.length,T=X.createTypedArray(d.length/3,(w+p.length)*2);T.set(u);let b=w;for(_=0;_<w;_+=2){let a=u[_],y=u[_+1];T[b++]=a+o,T[b++]=y+o}let n,s;for(_=0;_<p.length;_++)n=p[_],s=n+o,T[b++]=n,T[b++]=s;return{attributes:E,indices:T}}function M(t){t=t??$.EMPTY_OBJECT;let i=t.positions,e=t.width;B.typeOf.object("options.positions",i),B.typeOf.number("options.width",e);let r=t.height??0,p=t.extrudedHeight??r;this._positions=i,this._ellipsoid=P.clone(t.ellipsoid??P.default),this._width=e,this._height=Math.max(r,p),this._extrudedHeight=Math.min(r,p),this._cornerType=t.cornerType??Q.ROUNDED,this._granularity=t.granularity??Y.RADIANS_PER_DEGREE,this._offsetAttribute=t.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+i.length*A.packedLength+P.packedLength+6}M.pack=function(t,i,e){B.typeOf.object("value",t),B.typeOf.object("array",i),e=e??0;let r=t._positions,p=r.length;i[e++]=p;for(let m=0;m<p;++m,e+=A.packedLength)A.pack(r[m],i,e);return P.pack(t._ellipsoid,i,e),e+=P.packedLength,i[e++]=t._width,i[e++]=t._height,i[e++]=t._extrudedHeight,i[e++]=t._cornerType,i[e++]=t._granularity,i[e]=t._offsetAttribute??-1,i};var rt=P.clone(P.UNIT_SPHERE),v={positions:void 0,ellipsoid:rt,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};M.unpack=function(t,i,e){B.typeOf.object("array",t),i=i??0;let r=t[i++],p=new Array(r);for(let d=0;d<r;++d,i+=A.packedLength)p[d]=A.unpack(t,i);let m=P.unpack(t,i,rt);i+=P.packedLength;let H=t[i++],E=t[i++],u=t[i++],h=t[i++],o=t[i++],g=t[i];return N(e)?(e._positions=p,e._ellipsoid=P.clone(m,e._ellipsoid),e._width=H,e._height=E,e._extrudedHeight=u,e._cornerType=h,e._granularity=o,e._offsetAttribute=g===-1?void 0:g,e):(v.positions=p,v.width=H,v.height=E,v.extrudedHeight=u,v.cornerType=h,v.granularity=o,v.offsetAttribute=g===-1?void 0:g,new M(v))};M.createGeometry=function(t){let i=t._positions,e=t._width,r=t._ellipsoid;i=ft(i,r);let p=it(i,A.equalsEpsilon);if(p.length<2||e<=0)return;let m=t._height,H=t._extrudedHeight,E=!Y.equalsEpsilon(m,H,0,Y.EPSILON2),u={ellipsoid:r,positions:p,width:e,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1},h;if(E)u.height=m,u.extrudedHeight=H,u.offsetAttribute=t._offsetAttribute,h=ct(u);else{let d=C.computePositions(u);if(h=st(d,u.cornerType),h.attributes.position.values=K.scaleToGeodeticHeight(h.attributes.position.values,m,r),N(t._offsetAttribute)){let _=h.attributes.position.values.length,w=t._offsetAttribute===J.NONE?0:1,T=new Uint8Array(_/3).fill(w);h.attributes.applyOffset=new z({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}}let o=h.attributes,g=x.fromVertices(o.position.values,void 0,3);return new tt({attributes:o,indices:h.indices,primitiveType:I.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var Z=M;function ht(t,i){return N(i)&&(t=Z.unpack(t,i)),t._ellipsoid=P.clone(t._ellipsoid),Z.createGeometry(t)}var Ot=ht;export{Ot as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCylinderGeometry.js b/plugins/feature/map/Cesium/Workers/createCylinderGeometry.js index ee4921f1d..a44c13f71 100644 --- a/plugins/feature/map/Cesium/Workers/createCylinderGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCylinderGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-ZQVZZSUG.js";import"./chunk-NEXD3R4K.js";import"./chunk-4W2MZV6I.js";import"./chunk-S3L7VZFL.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as o}from"./chunk-3BGP4HCL.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; +import{a as r}from"./chunk-GH3KEUYL.js";import"./chunk-ARDVIBNJ.js";import"./chunk-GNBKSQYP.js";import"./chunk-FZSSAWMQ.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as o}from"./chunk-H7SJWKIY.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; diff --git a/plugins/feature/map/Cesium/Workers/createCylinderOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createCylinderOutlineGeometry.js index 8e2712f14..3ecbb7bbc 100644 --- a/plugins/feature/map/Cesium/Workers/createCylinderOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createCylinderOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as M}from"./chunk-NEXD3R4K.js";import{a as L}from"./chunk-4W2MZV6I.js";import{a as N}from"./chunk-JQLYZQ6V.js";import{a as k}from"./chunk-J3L5WX3X.js";import{b as D,c as P,d as A}from"./chunk-AVPLM4UI.js";import{d as y}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as R}from"./chunk-WER4LUMF.js";import{a as T,c as _,f as S}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as E,b as m}from"./chunk-ELJAHN3H.js";import{e as b}from"./chunk-3BGP4HCL.js";var V=new _;function d(t){t=t??S.EMPTY_OBJECT;let e=t.length,i=t.topRadius,f=t.bottomRadius,o=t.slices??128,u=Math.max(t.numberOfVerticalLines??16,0);if(m.typeOf.number("options.positions",e),m.typeOf.number("options.topRadius",i),m.typeOf.number("options.bottomRadius",f),m.typeOf.number.greaterThanOrEquals("options.slices",o,3),b(t.offsetAttribute)&&t.offsetAttribute===L.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=i,this._bottomRadius=f,this._slices=o,this._numberOfVerticalLines=u,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}d.packedLength=6;d.pack=function(t,e,i){return m.typeOf.object("value",t),m.defined("array",e),i=i??0,e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=t._offsetAttribute??-1,e};var p={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};d.unpack=function(t,e,i){m.defined("array",t),e=e??0;let f=t[e++],o=t[e++],u=t[e++],l=t[e++],a=t[e++],c=t[e];return b(i)?(i._length=f,i._topRadius=o,i._bottomRadius=u,i._slices=l,i._numberOfVerticalLines=a,i._offsetAttribute=c===-1?void 0:c,i):(p.length=f,p.topRadius=o,p.bottomRadius=u,p.slices=l,p.numberOfVerticalLines=a,p.offsetAttribute=c===-1?void 0:c,new d(p))};d.createGeometry=function(t){let e=t._length,i=t._topRadius,f=t._bottomRadius,o=t._slices,u=t._numberOfVerticalLines;if(e<=0||i<0||f<0||i===0&&f===0)return;let l=o*2,a=M.computePositions(e,i,f,o,!1),c=o*2,C;if(u>0){let h=Math.min(u,o);C=Math.round(o/h),c+=h}let s=N.createTypedArray(l,c*2),r=0,n;for(n=0;n<o-1;n++)s[r++]=n,s[r++]=n+1,s[r++]=n+o,s[r++]=n+1+o;if(s[r++]=o-1,s[r++]=0,s[r++]=o+o-1,s[r++]=o,u>0)for(n=0;n<o;n+=C)s[r++]=n,s[r++]=n+o;let O=new k;O.position=new A({componentDatatype:R.DOUBLE,componentsPerAttribute:3,values:a}),V.x=e*.5,V.y=Math.max(f,i);let g=new y(T.ZERO,_.magnitude(V));if(b(t._offsetAttribute)){e=a.length;let h=t._offsetAttribute===L.NONE?0:1,B=new Uint8Array(e/3).fill(h);O.applyOffset=new A({componentDatatype:R.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new P({attributes:O,indices:s,primitiveType:D.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var w=d;function G(t,e){return b(e)&&(t=w.unpack(t,e)),w.createGeometry(t)}var et=G;export{et as default}; +import{a as M}from"./chunk-ARDVIBNJ.js";import{a as L}from"./chunk-GNBKSQYP.js";import{a as N}from"./chunk-AZINMULF.js";import{a as k}from"./chunk-ILBQ77ZM.js";import{b as D,c as P,d as A}from"./chunk-7RNSURKI.js";import{c as y}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as R}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{b as _}from"./chunk-KP72RGCH.js";import{a as T,c as S}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{a as E,b as m}from"./chunk-OU2IPMYE.js";import{f as b}from"./chunk-H7SJWKIY.js";var V=new _;function d(t){t=t??S.EMPTY_OBJECT;let e=t.length,i=t.topRadius,f=t.bottomRadius,o=t.slices??128,u=Math.max(t.numberOfVerticalLines??16,0);if(m.typeOf.number("options.positions",e),m.typeOf.number("options.topRadius",i),m.typeOf.number("options.bottomRadius",f),m.typeOf.number.greaterThanOrEquals("options.slices",o,3),b(t.offsetAttribute)&&t.offsetAttribute===L.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=i,this._bottomRadius=f,this._slices=o,this._numberOfVerticalLines=u,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}d.packedLength=6;d.pack=function(t,e,i){return m.typeOf.object("value",t),m.defined("array",e),i=i??0,e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=t._offsetAttribute??-1,e};var p={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};d.unpack=function(t,e,i){m.defined("array",t),e=e??0;let f=t[e++],o=t[e++],u=t[e++],l=t[e++],a=t[e++],c=t[e];return b(i)?(i._length=f,i._topRadius=o,i._bottomRadius=u,i._slices=l,i._numberOfVerticalLines=a,i._offsetAttribute=c===-1?void 0:c,i):(p.length=f,p.topRadius=o,p.bottomRadius=u,p.slices=l,p.numberOfVerticalLines=a,p.offsetAttribute=c===-1?void 0:c,new d(p))};d.createGeometry=function(t){let e=t._length,i=t._topRadius,f=t._bottomRadius,o=t._slices,u=t._numberOfVerticalLines;if(e<=0||i<0||f<0||i===0&&f===0)return;let l=o*2,a=M.computePositions(e,i,f,o,!1),c=o*2,C;if(u>0){let h=Math.min(u,o);C=Math.round(o/h),c+=h}let s=N.createTypedArray(l,c*2),r=0,n;for(n=0;n<o-1;n++)s[r++]=n,s[r++]=n+1,s[r++]=n+o,s[r++]=n+1+o;if(s[r++]=o-1,s[r++]=0,s[r++]=o+o-1,s[r++]=o,u>0)for(n=0;n<o;n+=C)s[r++]=n,s[r++]=n+o;let O=new k;O.position=new A({componentDatatype:R.DOUBLE,componentsPerAttribute:3,values:a}),V.x=e*.5,V.y=Math.max(f,i);let g=new y(T.ZERO,_.magnitude(V));if(b(t._offsetAttribute)){e=a.length;let h=t._offsetAttribute===L.NONE?0:1,B=new Uint8Array(e/3).fill(h);O.applyOffset=new A({componentDatatype:R.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new P({attributes:O,indices:s,primitiveType:D.LINES,boundingSphere:g,offsetAttribute:t._offsetAttribute})};var w=d;function G(t,e){return b(e)&&(t=w.unpack(t,e)),w.createGeometry(t)}var et=G;export{et as default}; diff --git a/plugins/feature/map/Cesium/Workers/createEllipseGeometry.js b/plugins/feature/map/Cesium/Workers/createEllipseGeometry.js index 5ccd9a4a3..eff1e427c 100644 --- a/plugins/feature/map/Cesium/Workers/createEllipseGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createEllipseGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as o}from"./chunk-Q7QJJ4HI.js";import"./chunk-HRZKIJQA.js";import"./chunk-4OIYAFXA.js";import"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import"./chunk-4W2MZV6I.js";import"./chunk-S3L7VZFL.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as t,d as c}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as n}from"./chunk-3BGP4HCL.js";function a(r,i){return n(i)&&(r=o.unpack(r,i)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),o.createGeometry(r)}var u=a;export{u as default}; +import{a as o}from"./chunk-G2DFB5K6.js";import"./chunk-7IFFXLK3.js";import"./chunk-PICDM7L2.js";import"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import"./chunk-GNBKSQYP.js";import"./chunk-FZSSAWMQ.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c}from"./chunk-KP72RGCH.js";import{a as t}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as n}from"./chunk-H7SJWKIY.js";function a(r,i){return n(i)&&(r=o.unpack(r,i)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),o.createGeometry(r)}var u=a;export{u as default}; diff --git a/plugins/feature/map/Cesium/Workers/createEllipseOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createEllipseOutlineGeometry.js index bb44f58e3..6a39fc03a 100644 --- a/plugins/feature/map/Cesium/Workers/createEllipseOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createEllipseOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as i}from"./chunk-OAGMF473.js";import"./chunk-HRZKIJQA.js";import"./chunk-4W2MZV6I.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as t,d as c}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as o}from"./chunk-3BGP4HCL.js";function a(r,n){return o(n)&&(r=i.unpack(r,n)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),i.createGeometry(r)}var p=a;export{p as default}; +import{a as i}from"./chunk-CYYYI5LY.js";import"./chunk-7IFFXLK3.js";import"./chunk-GNBKSQYP.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c}from"./chunk-KP72RGCH.js";import{a as t}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as o}from"./chunk-H7SJWKIY.js";function a(r,n){return o(n)&&(r=i.unpack(r,n)),r._center=t.clone(r._center),r._ellipsoid=c.clone(r._ellipsoid),i.createGeometry(r)}var p=a;export{p as default}; diff --git a/plugins/feature/map/Cesium/Workers/createEllipsoidGeometry.js b/plugins/feature/map/Cesium/Workers/createEllipsoidGeometry.js index c5d08b607..bbc48fae2 100644 --- a/plugins/feature/map/Cesium/Workers/createEllipsoidGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createEllipsoidGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as e}from"./chunk-FUD3WFGN.js";import"./chunk-4W2MZV6I.js";import"./chunk-S3L7VZFL.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as o}from"./chunk-3BGP4HCL.js";function i(r,t){return o(t)&&(r=e.unpack(r,t)),e.createGeometry(r)}var a=i;export{a as default}; +import{a as e}from"./chunk-J6775DYR.js";import"./chunk-GNBKSQYP.js";import"./chunk-FZSSAWMQ.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as o}from"./chunk-H7SJWKIY.js";function i(r,t){return o(t)&&(r=e.unpack(r,t)),e.createGeometry(r)}var a=i;export{a as default}; diff --git a/plugins/feature/map/Cesium/Workers/createEllipsoidOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createEllipsoidOutlineGeometry.js index 191d41388..e652f654a 100644 --- a/plugins/feature/map/Cesium/Workers/createEllipsoidOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createEllipsoidOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as t}from"./chunk-PZWPGERZ.js";import"./chunk-4W2MZV6I.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as n}from"./chunk-3BGP4HCL.js";function u(r,e){return n(r.buffer,e)&&(r=t.unpack(r,e)),t.createGeometry(r)}var a=u;export{a as default}; +import{a as t}from"./chunk-4U57P2C5.js";import"./chunk-GNBKSQYP.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as n}from"./chunk-H7SJWKIY.js";function u(r,e){return n(r.buffer,e)&&(r=t.unpack(r,e)),t.createGeometry(r)}var a=u;export{a as default}; diff --git a/plugins/feature/map/Cesium/Workers/createFrustumGeometry.js b/plugins/feature/map/Cesium/Workers/createFrustumGeometry.js index 05ff1b777..d67acd3b1 100644 --- a/plugins/feature/map/Cesium/Workers/createFrustumGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createFrustumGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{c as r}from"./chunk-QXSX66ML.js";import"./chunk-S3L7VZFL.js";import"./chunk-ASLWXOD7.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as o}from"./chunk-3BGP4HCL.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; +import{c as r}from"./chunk-UI4K6XI3.js";import"./chunk-FZSSAWMQ.js";import"./chunk-SIBAZPZR.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as o}from"./chunk-H7SJWKIY.js";function i(e,t){return o(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}var a=i;export{a as default}; diff --git a/plugins/feature/map/Cesium/Workers/createFrustumOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createFrustumOutlineGeometry.js index b00d2dd35..ae96bfcb5 100644 --- a/plugins/feature/map/Cesium/Workers/createFrustumOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createFrustumOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as k,b as _,c as A}from"./chunk-QXSX66ML.js";import"./chunk-S3L7VZFL.js";import"./chunk-ASLWXOD7.js";import{a as F}from"./chunk-J3L5WX3X.js";import{b,c as N,d as g}from"./chunk-AVPLM4UI.js";import{d as y}from"./chunk-ZYYZDBKK.js";import{f as s}from"./chunk-3PT5NNSP.js";import{a as T}from"./chunk-WER4LUMF.js";import{a}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as h}from"./chunk-ELJAHN3H.js";import{e as w}from"./chunk-3BGP4HCL.js";var d=0,j=1;function P(e){h.typeOf.object("options",e),h.typeOf.object("options.frustum",e.frustum),h.typeOf.object("options.origin",e.origin),h.typeOf.object("options.orientation",e.orientation);let t=e.frustum,o=e.orientation,u=e.origin,c=e._drawNearPlane??!0,p,m;t instanceof _?(p=d,m=_.packedLength):t instanceof k&&(p=j,m=k.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=a.clone(u),this._orientation=s.clone(o),this._drawNearPlane=c,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+m+a.packedLength+s.packedLength}P.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let u=e._frustumType,c=e._frustum;return t[o++]=u,u===d?(_.pack(c,t,o),o+=_.packedLength):(k.pack(c,t,o),o+=k.packedLength),a.pack(e._origin,t,o),o+=a.packedLength,s.pack(e._orientation,t,o),o+=s.packedLength,t[o]=e._drawNearPlane?1:0,t};var C=new _,E=new k,G=new s,R=new a;P.unpack=function(e,t,o){h.defined("array",e),t=t??0;let u=e[t++],c;u===d?(c=_.unpack(e,t,C),t+=_.packedLength):(c=k.unpack(e,t,E),t+=k.packedLength);let p=a.unpack(e,t,R);t+=a.packedLength;let m=s.unpack(e,t,G);t+=s.packedLength;let l=e[t]===1;if(!w(o))return new P({frustum:c,origin:p,orientation:m,_drawNearPlane:l});let n=u===o._frustumType?o._frustum:void 0;return o._frustum=c.clone(n),o._frustumType=u,o._origin=a.clone(p,o._origin),o._orientation=s.clone(m,o._orientation),o._drawNearPlane=l,o};P.createGeometry=function(e){let t=e._frustumType,o=e._frustum,u=e._origin,c=e._orientation,p=e._drawNearPlane,m=new Float64Array(3*4*2);A._computeNearFarPlanes(u,c,t,o,m);let l=new F({position:new g({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:m})}),n,i,O=p?2:1,r=new Uint16Array(8*(O+1)),f=p?0:1;for(;f<2;++f)n=p?f*8:0,i=f*4,r[n]=i,r[n+1]=i+1,r[n+2]=i+1,r[n+3]=i+2,r[n+4]=i+2,r[n+5]=i+3,r[n+6]=i+3,r[n+7]=i;for(f=0;f<2;++f)n=(O+f)*8,i=f*4,r[n]=i,r[n+1]=i+4,r[n+2]=i+1,r[n+3]=i+5,r[n+4]=i+2,r[n+5]=i+6,r[n+6]=i+3,r[n+7]=i+7;return new N({attributes:l,indices:r,primitiveType:b.LINES,boundingSphere:y.fromVertices(m)})};var L=P;function S(e,t){return w(t)&&(e=L.unpack(e,t)),L.createGeometry(e)}var $=S;export{$ as default}; +import{a as k,b as _,c as A}from"./chunk-UI4K6XI3.js";import"./chunk-FZSSAWMQ.js";import"./chunk-SIBAZPZR.js";import{a as F}from"./chunk-ILBQ77ZM.js";import{b,c as N,d as g}from"./chunk-7RNSURKI.js";import{c as y}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{h as s}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as T}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as h}from"./chunk-OU2IPMYE.js";import{f as w}from"./chunk-H7SJWKIY.js";var d=0,j=1;function P(e){h.typeOf.object("options",e),h.typeOf.object("options.frustum",e.frustum),h.typeOf.object("options.origin",e.origin),h.typeOf.object("options.orientation",e.orientation);let t=e.frustum,o=e.orientation,u=e.origin,c=e._drawNearPlane??!0,p,m;t instanceof _?(p=d,m=_.packedLength):t instanceof k&&(p=j,m=k.packedLength),this._frustumType=p,this._frustum=t.clone(),this._origin=a.clone(u),this._orientation=s.clone(o),this._drawNearPlane=c,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+m+a.packedLength+s.packedLength}P.pack=function(e,t,o){h.typeOf.object("value",e),h.defined("array",t),o=o??0;let u=e._frustumType,c=e._frustum;return t[o++]=u,u===d?(_.pack(c,t,o),o+=_.packedLength):(k.pack(c,t,o),o+=k.packedLength),a.pack(e._origin,t,o),o+=a.packedLength,s.pack(e._orientation,t,o),o+=s.packedLength,t[o]=e._drawNearPlane?1:0,t};var C=new _,E=new k,G=new s,R=new a;P.unpack=function(e,t,o){h.defined("array",e),t=t??0;let u=e[t++],c;u===d?(c=_.unpack(e,t,C),t+=_.packedLength):(c=k.unpack(e,t,E),t+=k.packedLength);let p=a.unpack(e,t,R);t+=a.packedLength;let m=s.unpack(e,t,G);t+=s.packedLength;let l=e[t]===1;if(!w(o))return new P({frustum:c,origin:p,orientation:m,_drawNearPlane:l});let n=u===o._frustumType?o._frustum:void 0;return o._frustum=c.clone(n),o._frustumType=u,o._origin=a.clone(p,o._origin),o._orientation=s.clone(m,o._orientation),o._drawNearPlane=l,o};P.createGeometry=function(e){let t=e._frustumType,o=e._frustum,u=e._origin,c=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);A._computeNearFarPlanes(u,c,t,o,m);let l=new F({position:new g({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:m})}),n,i,O=p?2:1,r=new Uint16Array(8*(O+1)),f=p?0:1;for(;f<2;++f)n=p?f*8:0,i=f*4,r[n]=i,r[n+1]=i+1,r[n+2]=i+1,r[n+3]=i+2,r[n+4]=i+2,r[n+5]=i+3,r[n+6]=i+3,r[n+7]=i;for(f=0;f<2;++f)n=(O+f)*8,i=f*4,r[n]=i,r[n+1]=i+4,r[n+2]=i+1,r[n+3]=i+5,r[n+4]=i+2,r[n+5]=i+6,r[n+6]=i+3,r[n+7]=i+7;return new N({attributes:l,indices:r,primitiveType:b.LINES,boundingSphere:y.fromVertices(m)})};var L=P;function S(e,t){return w(t)&&(e=L.unpack(e,t)),L.createGeometry(e)}var $=S;export{$ as default}; diff --git a/plugins/feature/map/Cesium/Workers/createGeometry.js b/plugins/feature/map/Cesium/Workers/createGeometry.js index 061ce070c..9e0314d30 100644 --- a/plugins/feature/map/Cesium/Workers/createGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as k}from"./chunk-3RMLTUUP.js";import{a as w}from"./chunk-U3N6LNE4.js";import"./chunk-L4JCTZ6Y.js";import"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as y}from"./chunk-ELJAHN3H.js";import{a,b as p,e as r}from"./chunk-3BGP4HCL.js";var g=p({"./combineGeometry.js":()=>import("./combineGeometry.js"),"./createBoxGeometry.js":()=>import("./createBoxGeometry.js"),"./createBoxOutlineGeometry.js":()=>import("./createBoxOutlineGeometry.js"),"./createCircleGeometry.js":()=>import("./createCircleGeometry.js"),"./createCircleOutlineGeometry.js":()=>import("./createCircleOutlineGeometry.js"),"./createCoplanarPolygonGeometry.js":()=>import("./createCoplanarPolygonGeometry.js"),"./createCoplanarPolygonOutlineGeometry.js":()=>import("./createCoplanarPolygonOutlineGeometry.js"),"./createCorridorGeometry.js":()=>import("./createCorridorGeometry.js"),"./createCorridorOutlineGeometry.js":()=>import("./createCorridorOutlineGeometry.js"),"./createCylinderGeometry.js":()=>import("./createCylinderGeometry.js"),"./createCylinderOutlineGeometry.js":()=>import("./createCylinderOutlineGeometry.js"),"./createEllipseGeometry.js":()=>import("./createEllipseGeometry.js"),"./createEllipseOutlineGeometry.js":()=>import("./createEllipseOutlineGeometry.js"),"./createEllipsoidGeometry.js":()=>import("./createEllipsoidGeometry.js"),"./createEllipsoidOutlineGeometry.js":()=>import("./createEllipsoidOutlineGeometry.js"),"./createFrustumGeometry.js":()=>import("./createFrustumGeometry.js"),"./createFrustumOutlineGeometry.js":()=>import("./createFrustumOutlineGeometry.js"),"./createGeometry.js":()=>import("./createGeometry.js"),"./createGroundPolylineGeometry.js":()=>import("./createGroundPolylineGeometry.js"),"./createPlaneGeometry.js":()=>import("./createPlaneGeometry.js"),"./createPlaneOutlineGeometry.js":()=>import("./createPlaneOutlineGeometry.js"),"./createPolygonGeometry.js":()=>import("./createPolygonGeometry.js"),"./createPolygonOutlineGeometry.js":()=>import("./createPolygonOutlineGeometry.js"),"./createPolylineGeometry.js":()=>import("./createPolylineGeometry.js"),"./createPolylineVolumeGeometry.js":()=>import("./createPolylineVolumeGeometry.js"),"./createPolylineVolumeOutlineGeometry.js":()=>import("./createPolylineVolumeOutlineGeometry.js"),"./createRectangleGeometry.js":()=>import("./createRectangleGeometry.js"),"./createRectangleOutlineGeometry.js":()=>import("./createRectangleOutlineGeometry.js"),"./createSimplePolylineGeometry.js":()=>import("./createSimplePolylineGeometry.js"),"./createSphereGeometry.js":()=>import("./createSphereGeometry.js"),"./createSphereOutlineGeometry.js":()=>import("./createSphereOutlineGeometry.js"),"./createTaskProcessorWorker.js":()=>import("./createTaskProcessorWorker.js"),"./createVectorTileClampedPolylines.js":()=>import("./createVectorTileClampedPolylines.js"),"./createVectorTileGeometries.js":()=>import("./createVectorTileGeometries.js"),"./createVectorTilePoints.js":()=>import("./createVectorTilePoints.js"),"./createVectorTilePolygons.js":()=>import("./createVectorTilePolygons.js"),"./createVectorTilePolylines.js":()=>import("./createVectorTilePolylines.js"),"./createVerticesFromGoogleEarthEnterpriseBuffer.js":()=>import("./createVerticesFromGoogleEarthEnterpriseBuffer.js"),"./createVerticesFromHeightmap.js":()=>import("./createVerticesFromHeightmap.js"),"./createVerticesFromQuantizedTerrainMesh.js":()=>import("./createVerticesFromQuantizedTerrainMesh.js"),"./createWallGeometry.js":()=>import("./createWallGeometry.js"),"./createWallOutlineGeometry.js":()=>import("./createWallOutlineGeometry.js"),"./decodeDraco.js":()=>import("./decodeDraco.js"),"./decodeGoogleEarthEnterprisePacket.js":()=>import("./decodeGoogleEarthEnterprisePacket.js"),"./decodeI3S.js":()=>import("./decodeI3S.js"),"./transcodeKTX2.js":()=>import("./transcodeKTX2.js"),"./transferTypedArrayTest.js":()=>import("./transferTypedArrayTest.js"),"./upsampleQuantizedTerrainMesh.js":()=>import("./upsampleQuantizedTerrainMesh.js")});var c={};async function b(s,t){let e=c[t]??c[s];return r(e)?e:r(t)?(typeof exports=="object"?e=a(t):e=(await import(t)).default,c[t]=e,e):(typeof exports=="object"?e=a(`Workers/${s}`):e=(r(t)?await import(t):await g(`./${s}.js`)).default,c[s]=e,e)}async function h(s,t){let e=s.subTasks,n=e.length,f=new Array(n);for(let o=0;o<n;o++){let i=e[o],m=i.geometry,u=i.moduleName,l=i.modulePath;if(r(u)&&r(l))throw new y("Must only set moduleName or modulePath");r(u)||r(l)?f[o]=b(u,l).then(d=>d(m,i.offset)):f[o]=m}return Promise.all(f).then(function(o){return k.packCreateGeometryResults(o,t)})}var G=w(h);export{G as default}; +import{a as k}from"./chunk-PPEMEUUU.js";import{a as w}from"./chunk-JJVL7F22.js";import"./chunk-MQTDGHHT.js";import"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{a as y}from"./chunk-OU2IPMYE.js";import{a,b as p,f as r}from"./chunk-H7SJWKIY.js";var g=p({"./combineGeometry.js":()=>import("./combineGeometry.js"),"./createBoxGeometry.js":()=>import("./createBoxGeometry.js"),"./createBoxOutlineGeometry.js":()=>import("./createBoxOutlineGeometry.js"),"./createCircleGeometry.js":()=>import("./createCircleGeometry.js"),"./createCircleOutlineGeometry.js":()=>import("./createCircleOutlineGeometry.js"),"./createCoplanarPolygonGeometry.js":()=>import("./createCoplanarPolygonGeometry.js"),"./createCoplanarPolygonOutlineGeometry.js":()=>import("./createCoplanarPolygonOutlineGeometry.js"),"./createCorridorGeometry.js":()=>import("./createCorridorGeometry.js"),"./createCorridorOutlineGeometry.js":()=>import("./createCorridorOutlineGeometry.js"),"./createCylinderGeometry.js":()=>import("./createCylinderGeometry.js"),"./createCylinderOutlineGeometry.js":()=>import("./createCylinderOutlineGeometry.js"),"./createEllipseGeometry.js":()=>import("./createEllipseGeometry.js"),"./createEllipseOutlineGeometry.js":()=>import("./createEllipseOutlineGeometry.js"),"./createEllipsoidGeometry.js":()=>import("./createEllipsoidGeometry.js"),"./createEllipsoidOutlineGeometry.js":()=>import("./createEllipsoidOutlineGeometry.js"),"./createFrustumGeometry.js":()=>import("./createFrustumGeometry.js"),"./createFrustumOutlineGeometry.js":()=>import("./createFrustumOutlineGeometry.js"),"./createGeometry.js":()=>import("./createGeometry.js"),"./createGroundPolylineGeometry.js":()=>import("./createGroundPolylineGeometry.js"),"./createPlaneGeometry.js":()=>import("./createPlaneGeometry.js"),"./createPlaneOutlineGeometry.js":()=>import("./createPlaneOutlineGeometry.js"),"./createPolygonGeometry.js":()=>import("./createPolygonGeometry.js"),"./createPolygonOutlineGeometry.js":()=>import("./createPolygonOutlineGeometry.js"),"./createPolylineGeometry.js":()=>import("./createPolylineGeometry.js"),"./createPolylineVolumeGeometry.js":()=>import("./createPolylineVolumeGeometry.js"),"./createPolylineVolumeOutlineGeometry.js":()=>import("./createPolylineVolumeOutlineGeometry.js"),"./createRectangleGeometry.js":()=>import("./createRectangleGeometry.js"),"./createRectangleOutlineGeometry.js":()=>import("./createRectangleOutlineGeometry.js"),"./createSimplePolylineGeometry.js":()=>import("./createSimplePolylineGeometry.js"),"./createSphereGeometry.js":()=>import("./createSphereGeometry.js"),"./createSphereOutlineGeometry.js":()=>import("./createSphereOutlineGeometry.js"),"./createTaskProcessorWorker.js":()=>import("./createTaskProcessorWorker.js"),"./createVectorTileClampedPolylines.js":()=>import("./createVectorTileClampedPolylines.js"),"./createVectorTileGeometries.js":()=>import("./createVectorTileGeometries.js"),"./createVectorTilePoints.js":()=>import("./createVectorTilePoints.js"),"./createVectorTilePolygons.js":()=>import("./createVectorTilePolygons.js"),"./createVectorTilePolylines.js":()=>import("./createVectorTilePolylines.js"),"./createVerticesFromCesium3DTilesTerrain.js":()=>import("./createVerticesFromCesium3DTilesTerrain.js"),"./createVerticesFromGoogleEarthEnterpriseBuffer.js":()=>import("./createVerticesFromGoogleEarthEnterpriseBuffer.js"),"./createVerticesFromHeightmap.js":()=>import("./createVerticesFromHeightmap.js"),"./createVerticesFromQuantizedTerrainMesh.js":()=>import("./createVerticesFromQuantizedTerrainMesh.js"),"./createWallGeometry.js":()=>import("./createWallGeometry.js"),"./createWallOutlineGeometry.js":()=>import("./createWallOutlineGeometry.js"),"./decodeDraco.js":()=>import("./decodeDraco.js"),"./decodeGoogleEarthEnterprisePacket.js":()=>import("./decodeGoogleEarthEnterprisePacket.js"),"./decodeI3S.js":()=>import("./decodeI3S.js"),"./gaussianSplatSorter.js":()=>import("./gaussianSplatSorter.js"),"./gaussianSplatTextureGenerator.js":()=>import("./gaussianSplatTextureGenerator.js"),"./incrementallyBuildTerrainPicker.js":()=>import("./incrementallyBuildTerrainPicker.js"),"./transcodeKTX2.js":()=>import("./transcodeKTX2.js"),"./transferTypedArrayTest.js":()=>import("./transferTypedArrayTest.js"),"./upsampleQuantizedTerrainMesh.js":()=>import("./upsampleQuantizedTerrainMesh.js"),"./upsampleVerticesFromCesium3DTilesTerrain.js":()=>import("./upsampleVerticesFromCesium3DTilesTerrain.js")});var c={};async function b(s,t){let e=c[t]??c[s];return r(e)?e:r(t)?(typeof exports=="object"?e=a(t):e=(await import(t)).default,c[t]=e,e):(typeof exports=="object"?e=a(`Workers/${s}`):e=(r(t)?await import(t):await g(`./${s}.js`)).default,c[s]=e,e)}async function h(s,t){let e=s.subTasks,n=e.length,f=new Array(n);for(let o=0;o<n;o++){let i=e[o],m=i.geometry,u=i.moduleName,l=i.modulePath;if(r(u)&&r(l))throw new y("Must only set moduleName or modulePath");r(u)||r(l)?f[o]=b(u,l).then(d=>d(m,i.offset)):f[o]=m}return Promise.all(f).then(function(o){return k.packCreateGeometryResults(o,t)})}var G=w(h);export{G as default}; diff --git a/plugins/feature/map/Cesium/Workers/createGroundPolylineGeometry.js b/plugins/feature/map/Cesium/Workers/createGroundPolylineGeometry.js index 6cb4da5f6..5cc6502b4 100644 --- a/plugins/feature/map/Cesium/Workers/createGroundPolylineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createGroundPolylineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as _e}from"./chunk-L4JCTZ6Y.js";import{a as W}from"./chunk-IFR5HKVH.js";import{a as Ct}from"./chunk-XOTNFHCP.js";import{a as Oe}from"./chunk-OM62BMPV.js";import{a as Le}from"./chunk-PNMU44JZ.js";import{a as te}from"./chunk-IAW6QHRG.js";import{b as Qt}from"./chunk-QFKZXFLI.js";import{a as jt}from"./chunk-ASLWXOD7.js";import{c as Ce,d as zt}from"./chunk-AVPLM4UI.js";import{a as Pt,d as U}from"./chunk-ZYYZDBKK.js";import{d as xe,e as Ne,f as Kt,h as Y}from"./chunk-3PT5NNSP.js";import{a as Bt}from"./chunk-WER4LUMF.js";import{a as t,b as u,c as Rt,d as B,e as bt,f as vt}from"./chunk-FGKVHLJ4.js";import{a as p}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as wt,b as tt}from"./chunk-ELJAHN3H.js";import{e as g}from"./chunk-3BGP4HCL.js";function it(e){e=e??vt.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??B.default,this._rectangle=e.rectangle??Y.MAX_VALUE,this._projection=new Pt(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(it.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});it.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};it.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};it.prototype.rectangleToNativeRectangle=function(e,i){tt.defined("rectangle",e);let r=p.toDegrees(e.west),n=p.toDegrees(e.south),o=p.toDegrees(e.east),a=p.toDegrees(e.north);return g(i)?(i.west=r,i.south=n,i.east=o,i.north=a,i):new Y(r,n,o,a)};it.prototype.tileXYToNativeRectangle=function(e,i,r,n){let o=this.tileXYToRectangle(e,i,r,n);return o.west=p.toDegrees(o.west),o.south=p.toDegrees(o.south),o.east=p.toDegrees(o.east),o.north=p.toDegrees(o.north),o};it.prototype.tileXYToRectangle=function(e,i,r,n){let o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=o.width/a,s=e*l+o.west,d=(e+1)*l+o.west,h=o.height/c,N=o.north-i*h,S=o.north-(i+1)*h;return g(n)||(n=new Y(s,S,d,N)),n.west=s,n.south=S,n.east=d,n.north=N,n};it.prototype.positionToTileXY=function(e,i,r){let n=this._rectangle;if(!Y.contains(n,e))return;let o=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=n.width/o,l=n.height/a,s=e.longitude;n.east<n.west&&(s+=p.TWO_PI);let d=(s-n.west)/c|0;d>=o&&(d=o-1);let h=(n.north-e.latitude)/l|0;return h>=a&&(h=a-1),g(r)?(r.x=d,r.y=h,r):new Rt(d,h)};var De=it;var Ie=new t,He=new t,ke=new u,ee=new t,hn=new t,ye=new U,pn=new De,_t=[new u,new u,new u,new u],Lt=new Rt,w={};w.initialize=function(){let e=w._initPromise;return g(e)||(e=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(i){w._terrainHeights=i}),w._initPromise=e),e};w.getMinimumMaximumHeights=function(e,i){if(tt.defined("rectangle",e),!g(w._terrainHeights))throw new wt("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=i??B.default;let r=Ae(e),n=w._defaultMinTerrainHeight,o=w._defaultMaxTerrainHeight;if(g(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[0],o=c[1]),i.cartographicToCartesian(Y.northeast(e,ke),Ie),i.cartographicToCartesian(Y.southwest(e,ke),He),t.midpoint(He,Ie,ee);let l=i.scaleToGeodeticSurface(ee,hn);if(g(l)){let s=t.distance(ee,l);n=Math.min(n,-s)}else n=w._defaultMinTerrainHeight}return n=Math.max(w._defaultMinTerrainHeight,n),{minimumTerrainHeight:n,maximumTerrainHeight:o}};w.getBoundingSphere=function(e,i){if(tt.defined("rectangle",e),!g(w._terrainHeights))throw new wt("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");i=i??B.default;let r=Ae(e),n=w._defaultMaxTerrainHeight;if(g(r)){let a=`${r.level}-${r.x}-${r.y}`,c=w._terrainHeights[a];g(c)&&(n=c[1])}let o=U.fromRectangle3D(e,i,0);return U.fromRectangle3D(e,i,n,ye),U.union(o,ye,o)};function Ae(e){u.fromRadians(e.east,e.north,0,_t[0]),u.fromRadians(e.west,e.north,0,_t[1]),u.fromRadians(e.east,e.south,0,_t[2]),u.fromRadians(e.west,e.south,0,_t[3]);let i=0,r=0,n=0,o=0,a=w._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let d=_t[s];if(pn.positionToTileXY(d,c,Lt),s===0)n=Lt.x,o=Lt.y;else if(n!==Lt.x||o!==Lt.y){l=!0;break}}if(l)break;i=n,r=o}if(c!==0)return{x:i,y:r,level:c>a?a:c-1}}w._terrainHeightsMaxLevel=6;w._defaultMaxTerrainHeight=9e3;w._defaultMinTerrainHeight=-1e5;w._terrainHeights=void 0;w._initPromise=void 0;Object.defineProperties(w,{initialized:{get:function(){return g(w._terrainHeights)}}});var Ft=w;var le=[Pt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;function at(e){e=e??vt.EMPTY_OBJECT;let i=e.positions;if(!g(i)||i.length<2)throw new wt("At least two positions are required.");if(g(e.arcType)&&e.arcType!==W.GEODESIC&&e.arcType!==W.RHUMB)throw new wt("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=i,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??W.GEODESIC,this._ellipsoid=B.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(at.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+B.packedLength+1+1}}});at.setProjectionAndEllipsoid=function(e,i){let r=0;for(let n=0;n<dn;n++)if(i instanceof le[n]){r=n;break}e._projectionIndex=r,e._ellipsoid=i.ellipsoid};var fn=new t,Re=new t,Pe=new t;function se(e,i,r,n,o){let a=R(n,e,0,fn),c=R(n,e,r,Re),l=R(n,i,0,Pe),s=et(c,a,Re),d=et(l,a,Pe);return t.cross(d,s,o),t.normalize(o,o)}var mn=new u,gn=new t,un=new t,wn=new t;function ne(e,i,r,n,o,a,c,l,s,d,h){if(o===0)return;let N;a===W.GEODESIC?N=new Oe(e,i,c):a===W.RHUMB&&(N=new te(e,i,c));let S=N.surfaceDistance;if(S<o)return;let M=se(e,i,n,c,wn),O=Math.ceil(S/o),D=S/O,z=D,G=O-1,f=l.length;for(let j=0;j<G;j++){let b=N.interpolateUsingSurfaceDistance(z,mn),k=R(c,b,r,gn),I=R(c,b,n,un);t.pack(M,l,f),t.pack(k,s,f),t.pack(I,d,f),h.push(b.latitude),h.push(b.longitude),f+=3,z+=D}}var oe=new u;function R(e,i,r,n){return u.clone(i,oe),oe.height=r,u.toCartesian(oe,e,n)}at.pack=function(e,i,r){tt.typeOf.object("value",e),tt.defined("array",i);let n=r??0,o=e._positions,a=o.length;i[n++]=a;for(let c=0;c<a;++c){let l=o[c];t.pack(l,i,n),n+=3}return i[n++]=e.granularity,i[n++]=e.loop?1:0,i[n++]=e.arcType,B.pack(e._ellipsoid,i,n),n+=B.packedLength,i[n++]=e._projectionIndex,i[n++]=e._scene3DOnly?1:0,i};at.unpack=function(e,i,r){tt.defined("array",e);let n=i??0,o=e[n++],a=new Array(o);for(let S=0;S<o;S++)a[S]=t.unpack(e,n),n+=3;let c=e[n++],l=e[n++]===1,s=e[n++],d=B.unpack(e,n);n+=B.packedLength;let h=e[n++],N=e[n++]===1;return g(r)||(r=new at({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=d,r._projectionIndex=h,r._scene3DOnly=N,r};function et(e,i,r){return t.subtract(e,i,r),t.normalize(r,r),r}function be(e,i,r,n){return n=et(e,i,n),n=t.cross(n,r,n),n=t.normalize(n,n),n=t.cross(r,n,n),n}var Sn=new t,Tn=new t,En=new t,en=new t,xn=0,Nn=-1;function ie(e,i,r,n,o){let a=et(r,i,en),c=be(e,i,a,Sn),l=be(n,i,a,Tn);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return o=t.cross(a,c,o),o=t.normalize(o,o),o;o=t.add(l,c,o),o=t.normalize(o,o);let s=t.cross(a,o,En);return t.dot(l,s)<xn&&(o=t.negate(o,o)),o}var Gt=jt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,_n=new t,Ln=new t,On=new t,Dn=new t,Xt=new t,Yt=new u,ve=new u,Be=new u;at.createGeometry=function(e){let i=!e._scene3DOnly,r=e.loop,n=e._ellipsoid,o=e.granularity,a=e.arcType,c=new le[e._projectionIndex](n),l=Qe,s=tn,d,h,N=e._positions,S=N.length;S===2&&(r=!1);let M,O,D,z,G=new te(void 0,void 0,n),f,j,b,k=[N[0]];for(h=0;h<S-1;h++)M=N[h],O=N[h+1],f=Qt.lineSegmentPlane(M,O,Gt,Xt),g(f)&&!t.equalsEpsilon(f,M,p.EPSILON7)&&!t.equalsEpsilon(f,O,p.EPSILON7)&&(e.arcType===W.GEODESIC?k.push(t.clone(f)):e.arcType===W.RHUMB&&(b=n.cartesianToCartographic(f,Yt).longitude,D=n.cartesianToCartographic(M,Yt),z=n.cartesianToCartographic(O,ve),G.setEndPoints(D,z),j=G.findIntersectionWithLongitude(b,Be),f=n.cartographicToCartesian(j,Xt),g(f)&&!t.equalsEpsilon(f,M,p.EPSILON7)&&!t.equalsEpsilon(f,O,p.EPSILON7)&&k.push(t.clone(f)))),k.push(O);r&&(M=N[S-1],O=N[0],f=Qt.lineSegmentPlane(M,O,Gt,Xt),g(f)&&!t.equalsEpsilon(f,M,p.EPSILON7)&&!t.equalsEpsilon(f,O,p.EPSILON7)&&(e.arcType===W.GEODESIC?k.push(t.clone(f)):e.arcType===W.RHUMB&&(b=n.cartesianToCartographic(f,Yt).longitude,D=n.cartesianToCartographic(M,Yt),z=n.cartesianToCartographic(O,ve),G.setEndPoints(D,z),j=G.findIntersectionWithLongitude(b,Be),f=n.cartographicToCartesian(j,Xt),g(f)&&!t.equalsEpsilon(f,M,p.EPSILON7)&&!t.equalsEpsilon(f,O,p.EPSILON7)&&k.push(t.clone(f)))));let I=k.length,C=new Array(I);for(h=0;h<I;h++){let X=u.fromCartesian(k[h],n);X.height=0,C[h]=X}if(C=Le(C,u.equalsEpsilon),I=C.length,I<2)return;let H=[],P=[],v=[],E=[],x=Cn,L=_n,_=Ln,F=On,y=Dn,m=C[0],Z=C[1],Dt=C[I-1];for(x=R(n,Dt,l,x),F=R(n,Z,l,F),L=R(n,m,l,L),_=R(n,m,s,_),r?y=ie(x,L,_,F,y):y=se(m,Z,s,n,y),t.pack(y,P,0),t.pack(L,v,0),t.pack(_,E,0),H.push(m.latitude),H.push(m.longitude),ne(m,Z,l,s,o,a,n,P,v,E,H),h=1;h<I-1;++h){x=t.clone(L,x),L=t.clone(F,L);let X=C[h];R(n,X,s,_),R(n,C[h+1],l,F),ie(x,L,_,F,y),d=P.length,t.pack(y,P,d),t.pack(L,v,d),t.pack(_,E,d),H.push(X.latitude),H.push(X.longitude),ne(C[h],C[h+1],l,s,o,a,n,P,v,E,H)}let A=C[I-1],St=C[I-2];if(L=R(n,A,l,L),_=R(n,A,s,_),r){let X=C[0];x=R(n,St,l,x),F=R(n,X,l,F),y=ie(x,L,_,F,y)}else y=se(St,A,s,n,y);if(d=P.length,t.pack(y,P,d),t.pack(L,v,d),t.pack(_,E,d),H.push(A.latitude),H.push(A.longitude),r){for(ne(A,m,l,s,o,a,n,P,v,E,H),d=P.length,h=0;h<3;++h)P[d+h]=P[h],v[d+h]=v[h],E[d+h]=E[h];H.push(m.latitude),H.push(m.longitude)}return Qn(r,c,v,E,P,H,i)};var In=new t,Hn=new bt,kn=new Kt;function ze(e,i,r,n){let o=et(r,i,In),a=t.dot(o,e);if(a>Ke||a<Me){let c=et(n,r,en),l=a<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Kt.fromAxisAngle(c,l,kn),d=bt.fromQuaternion(s,Hn);return bt.multiplyByVector(d,e,e),!0}return!1}var je=new u,yn=new t,Fe=new t;function Ot(e,i,r,n,o){let a=u.toCartesian(i,e._ellipsoid,yn),c=t.add(a,r,Fe),l=!1,s=e._ellipsoid,d=s.cartesianToCartographic(c,je);Math.abs(i.longitude-d.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Fe),d=s.cartesianToCartographic(c,je)),d.height=0;let h=e.project(d,o);return o=t.subtract(h,n,o),o.z=0,o=t.normalize(o,o),l&&t.negate(o,o),o}var An=new t,Xe=new t;function Ye(e,i,r,n,o,a){let c=t.subtract(i,e,An);t.normalize(c,c);let l=r-Qe,s=t.multiplyByScalar(c,l,Xe);t.add(e,s,o);let d=n-tn;s=t.multiplyByScalar(c,d,Xe),t.add(i,s,a)}var Mn=new t;function Ut(e,i){let r=jt.getPointDistance(Gt,e),n=jt.getPointDistance(Gt,i),o=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(o=et(i,e,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(e,o,e)):p.equalsEpsilon(n,0,p.EPSILON2)&&(o=et(e,i,o),t.multiplyByScalar(o,p.EPSILON2,o),t.add(i,o,i))}function Rn(e,i){let r=Math.abs(e.longitude),n=Math.abs(i.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let o=p.sign(i.longitude);return e.longitude=o*(r-p.EPSILON11),1}else if(p.equalsEpsilon(n,p.PI,p.EPSILON11)){let o=p.sign(e.longitude);return i.longitude=o*(n-p.EPSILON11),2}return 0}var nn=new u,on=new u,Ue=new t,re=new t,Ge=new t,qe=new t,Pn=new t,We=new t,bn=[nn,on],vn=new Y,Bn=new t,zn=new t,jn=new t,Fn=new t,Xn=new t,Yn=new t,ae=new t,ce=new t,Un=new t,Gn=new t,qn=new t,Ze=new t,Wn=new t,Zn=new t,Vn=new Ct,$n=new Ct,Ve=new t,Jn=new t,$e=new t,Kn=[new U,new U],rn=[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],Je=rn.length;function Qn(e,i,r,n,o,a,c){let l,s,d=i._ellipsoid,h=r.length/3-1,N=h*8,S=N*4,M=h*36,O=N>65535?new Uint32Array(M):new Uint16Array(M),D=new Float64Array(N*3),z=new Float32Array(S),G=new Float32Array(S),f=new Float32Array(S),j=new Float32Array(S),b=new Float32Array(S),k,I,C,H;c&&(k=new Float32Array(S),I=new Float32Array(S),C=new Float32Array(S),H=new Float32Array(N*2));let P=a.length/2,v=0,E=nn;E.height=0;let x=on;x.height=0;let L=Ue,_=re;if(c)for(s=0,l=1;l<P;l++)E.latitude=a[s],E.longitude=a[s+1],x.latitude=a[s+2],x.longitude=a[s+3],L=i.project(E,L),_=i.project(x,_),v+=t.distance(L,_),s+=2;let F=n.length/3;_=t.unpack(n,0,_);let y=0;for(s=3,l=1;l<F;l++)L=t.clone(_,L),_=t.unpack(n,s,_),y+=t.distance(L,_),s+=3;let m;s=3;let Z=0,Dt=0,A=0,St=0,X=!1,ct=t.unpack(r,0,qe),st=t.unpack(n,0,re),q=t.unpack(o,0,We);if(e){let lt=t.unpack(r,r.length-6,Ge);ze(q,lt,ct,st)&&(q=t.negate(q,q))}let pe=0,de=0,qt=0;for(l=0;l<h;l++){let lt=t.clone(ct,Ge),Zt=t.clone(st,Ue),ft=t.clone(q,Pn);X&&(ft=t.negate(ft,ft)),ct=t.unpack(r,s,qe),st=t.unpack(n,s,re),q=t.unpack(o,s,We),X=ze(q,lt,ct,st),E.latitude=a[Z],E.longitude=a[Z+1],x.latitude=a[Z+2],x.longitude=a[Z+3];let ht,mt,nt,ot;if(c){let T=Rn(E,x);ht=i.project(E,Xn),mt=i.project(x,Yn);let ut=et(mt,ht,Ve);ut.y=Math.abs(ut.y),nt=ae,ot=ce,T===0||t.dot(ut,t.UNIT_Y)>Ke?(nt=Ot(i,E,ft,ht,ae),ot=Ot(i,x,q,mt,ce)):T===1?(ot=Ot(i,x,q,mt,ce),nt.x=0,nt.y=p.sign(E.longitude-Math.abs(x.longitude)),nt.z=0):(nt=Ot(i,E,ft,ht,ae),ot.x=0,ot.y=p.sign(E.longitude-x.longitude),ot.z=0)}let ge=t.distance(Zt,st),ue=Ct.fromCartesian(lt,Vn),It=t.subtract(ct,lt,Un),an=t.normalize(It,Ze),Et=t.subtract(Zt,lt,Gn);Et=t.normalize(Et,Et);let gt=t.cross(an,Et,Ze);gt=t.normalize(gt,gt);let Ht=t.cross(Et,ft,Wn);Ht=t.normalize(Ht,Ht);let kt=t.subtract(st,ct,qn);kt=t.normalize(kt,kt);let yt=t.cross(q,kt,Zn);yt=t.normalize(yt,yt);let cn=ge/y,sn=pe/y,Vt=0,xt,At,pt,we=0,Se=0;if(c){Vt=t.distance(ht,mt),xt=Ct.fromCartesian(ht,$n),At=t.subtract(mt,ht,Ve),pt=t.normalize(At,Jn);let T=pt.x;pt.x=pt.y,pt.y=-T,we=Vt/v,Se=de/v}for(m=0;m<8;m++){let T=St+m*4,ut=Dt+m*2,Nt=T+3,Ee=m<4?1:-1,Mt=m===2||m===3||m===6||m===7?1:-1;t.pack(ue.high,z,T),z[Nt]=It.x,t.pack(ue.low,G,T),G[Nt]=It.y,t.pack(Ht,f,T),f[Nt]=It.z,t.pack(yt,j,T),j[Nt]=cn*Ee,t.pack(gt,b,T);let dt=sn*Mt;dt===0&&Mt<0&&(dt=9),b[Nt]=dt,c&&(k[T]=xt.high.x,k[T+1]=xt.high.y,k[T+2]=xt.low.x,k[T+3]=xt.low.y,C[T]=-nt.y,C[T+1]=nt.x,C[T+2]=ot.y,C[T+3]=-ot.x,I[T]=At.x,I[T+1]=At.y,I[T+2]=pt.x,I[T+3]=pt.y,H[ut]=we*Ee,dt=Se*Mt,dt===0&&Mt<0&&(dt=9),H[ut+1]=dt)}let V=jn,$=Fn,J=Bn,K=zn,ln=Y.fromCartographicArray(bn,vn),Te=Ft.getMinimumMaximumHeights(ln,d),$t=Te.minimumTerrainHeight,Jt=Te.maximumTerrainHeight;qt+=Math.abs($t),qt+=Math.abs(Jt),Ye(lt,Zt,$t,Jt,V,J),Ye(ct,st,$t,Jt,$,K);let Q=t.multiplyByScalar(gt,p.EPSILON5,$e);t.add(V,Q,V),t.add($,Q,$),t.add(J,Q,J),t.add(K,Q,K),Ut(V,$),Ut(J,K),t.pack(V,D,A),t.pack($,D,A+3),t.pack(K,D,A+6),t.pack(J,D,A+9),Q=t.multiplyByScalar(gt,-2*p.EPSILON5,$e),t.add(V,Q,V),t.add($,Q,$),t.add(J,Q,J),t.add(K,Q,K),Ut(V,$),Ut(J,K),t.pack(V,D,A+12),t.pack($,D,A+15),t.pack(K,D,A+18),t.pack(J,D,A+21),Z+=2,s+=3,Dt+=16,A+=24,St+=32,pe+=ge,de+=Vt}s=0;let fe=0;for(l=0;l<h;l++){for(m=0;m<Je;m++)O[s+m]=rn[m]+fe;fe+=8,s+=Je}let Wt=Kn;U.fromVertices(r,t.ZERO,3,Wt[0]),U.fromVertices(n,t.ZERO,3,Wt[1]);let me=U.fromBoundingSpheres(Wt);me.radius+=qt/(h*2);let Tt={position:new zt({componentDatatype:Bt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:D}),startHiAndForwardOffsetX:rt(z),startLoAndForwardOffsetY:rt(G),startNormalAndForwardOffsetZ:rt(f),endNormalAndTextureCoordinateNormalizationX:rt(j),rightNormalAndTextureCoordinateNormalizationY:rt(b)};return c&&(Tt.startHiLo2D=rt(k),Tt.offsetAndRight2D=rt(I),Tt.startEndNormals2D=rt(C),Tt.texcoordNormalization2D=new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:2,normalize:!1,values:H})),new Ce({attributes:Tt,indices:O,boundingSphere:me})}function rt(e){return new zt({componentDatatype:Bt.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}at._projectNormal=Ot;var he=at;function to(e,i){return Ft.initialize().then(function(){return g(i)&&(e=he.unpack(e,i)),he.createGeometry(e)})}var Qo=to;export{Qo as default}; +import{a as _e}from"./chunk-MQTDGHHT.js";import{a as W}from"./chunk-LXGG3JDP.js";import{a as Nt}from"./chunk-EL5WNS34.js";import{a as De}from"./chunk-CB2GA3G5.js";import{a as Le}from"./chunk-D3YAYYEG.js";import{a as Qt}from"./chunk-B5FT3Q23.js";import{b as Kt}from"./chunk-ZNBU4MZZ.js";import{a as zt}from"./chunk-SIBAZPZR.js";import{c as Ce,d as Bt}from"./chunk-7RNSURKI.js";import{a as Rt,c as U}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{f as xe,g as Ne,h as Jt,j as Y}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as vt}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as w,b as Mt,c as B}from"./chunk-KP72RGCH.js";import{a as t,b as Pt,c as bt}from"./chunk-OSVSBQDY.js";import{a as p}from"./chunk-LZC73BOP.js";import{a as ut,b as tt}from"./chunk-OU2IPMYE.js";import{f as u}from"./chunk-H7SJWKIY.js";var te=class{constructor(o){o=o??bt.EMPTY_OBJECT,this._ellipsoid=o.ellipsoid??B.default,this._rectangle=o.rectangle??Y.MAX_VALUE,this._projection=new Rt(this._ellipsoid),this._numberOfLevelZeroTilesX=o.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=o.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(o){return this._numberOfLevelZeroTilesX<<o}getNumberOfYTilesAtLevel(o){return this._numberOfLevelZeroTilesY<<o}rectangleToNativeRectangle(o,r){tt.defined("rectangle",o);let e=p.toDegrees(o.west),i=p.toDegrees(o.south),a=p.toDegrees(o.east),c=p.toDegrees(o.north);return u(r)?(r.west=e,r.south=i,r.east=a,r.north=c,r):new Y(e,i,a,c)}tileXYToNativeRectangle(o,r,e,i){let a=this.tileXYToRectangle(o,r,e,i);return a.west=p.toDegrees(a.west),a.south=p.toDegrees(a.south),a.east=p.toDegrees(a.east),a.north=p.toDegrees(a.north),a}tileXYToRectangle(o,r,e,i){let a=this._rectangle,c=this.getNumberOfXTilesAtLevel(e),l=this.getNumberOfYTilesAtLevel(e),s=a.width/c,d=o*s+a.west,h=(o+1)*s+a.west,f=a.height/l,T=a.north-r*f,D=a.north-(r+1)*f;return u(i)||(i=new Y(d,D,h,T)),i.west=d,i.south=D,i.east=h,i.north=T,i}positionToTileXY(o,r,e){let i=this._rectangle;if(!Y.contains(i,o))return;let a=this.getNumberOfXTilesAtLevel(r),c=this.getNumberOfYTilesAtLevel(r),l=i.width/a,s=i.height/c,d=o.longitude;i.east<i.west&&(d+=p.TWO_PI);let h=(d-i.west)/l|0;h>=a&&(h=a-1);let f=(i.north-o.latitude)/s|0;return f>=c&&(f=c-1),u(e)?(e.x=h,e.y=f,e):new Mt(h,f)}},Oe=te;var Ie=new t,He=new t,ke=new w,ee=new t,hn=new t,ye=new U,pn=new Oe,Ct=[new w,new w,new w,new w],_t=new Mt,S={};S.initialize=function(){let n=S._initPromise;return u(n)||(n=xe.fetchJson(Ne("Assets/approximateTerrainHeights.json")).then(function(o){S._terrainHeights=o}),S._initPromise=n),n};S.getMinimumMaximumHeights=function(n,o){if(tt.defined("rectangle",n),!u(S._terrainHeights))throw new ut("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=o??B.default;let r=Ae(n),e=S._defaultMinTerrainHeight,i=S._defaultMaxTerrainHeight;if(u(r)){let a=`${r.level}-${r.x}-${r.y}`,c=S._terrainHeights[a];u(c)&&(e=c[0],i=c[1]),o.cartographicToCartesian(Y.northeast(n,ke),Ie),o.cartographicToCartesian(Y.southwest(n,ke),He),t.midpoint(He,Ie,ee);let l=o.scaleToGeodeticSurface(ee,hn);if(u(l)){let s=t.distance(ee,l);e=Math.min(e,-s)}else e=S._defaultMinTerrainHeight}return e=Math.max(S._defaultMinTerrainHeight,e),{minimumTerrainHeight:e,maximumTerrainHeight:i}};S.getBoundingSphere=function(n,o){if(tt.defined("rectangle",n),!u(S._terrainHeights))throw new ut("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");o=o??B.default;let r=Ae(n),e=S._defaultMaxTerrainHeight;if(u(r)){let a=`${r.level}-${r.x}-${r.y}`,c=S._terrainHeights[a];u(c)&&(e=c[1])}let i=U.fromRectangle3D(n,o,0);return U.fromRectangle3D(n,o,e,ye),U.union(i,ye,i)};function Ae(n){w.fromRadians(n.east,n.north,0,Ct[0]),w.fromRadians(n.west,n.north,0,Ct[1]),w.fromRadians(n.east,n.south,0,Ct[2]),w.fromRadians(n.west,n.south,0,Ct[3]);let o=0,r=0,e=0,i=0,a=S._terrainHeightsMaxLevel,c;for(c=0;c<=a;++c){let l=!1;for(let s=0;s<4;++s){let d=Ct[s];if(pn.positionToTileXY(d,c,_t),s===0)e=_t.x,i=_t.y;else if(e!==_t.x||i!==_t.y){l=!0;break}}if(l)break;o=e,r=i}if(c!==0)return{x:o,y:r,level:c>a?a:c-1}}S._terrainHeightsMaxLevel=6;S._defaultMaxTerrainHeight=9e3;S._defaultMinTerrainHeight=-1e5;S._terrainHeights=void 0;S._initPromise=void 0;Object.defineProperties(S,{initialized:{get:function(){return u(S._terrainHeights)}}});var jt=S;var le=[Rt,_e],dn=le.length,Ke=Math.cos(p.toRadians(30)),Me=Math.cos(p.toRadians(150)),Qe=0,tn=1e3;function rt(n){n=n??bt.EMPTY_OBJECT;let o=n.positions;if(!u(o)||o.length<2)throw new ut("At least two positions are required.");if(u(n.arcType)&&n.arcType!==W.GEODESIC&&n.arcType!==W.RHUMB)throw new ut("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=n.width??1,this._positions=o,this.granularity=n.granularity??9999,this.loop=n.loop??!1,this.arcType=n.arcType??W.GEODESIC,this._ellipsoid=B.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(rt.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+B.packedLength+1+1}}});rt.setProjectionAndEllipsoid=function(n,o){let r=0;for(let e=0;e<dn;e++)if(o instanceof le[e]){r=e;break}n._projectionIndex=r,n._ellipsoid=o.ellipsoid};var mn=new t,Re=new t,Pe=new t;function se(n,o,r,e,i){let a=R(e,n,0,mn),c=R(e,n,r,Re),l=R(e,o,0,Pe),s=et(c,a,Re),d=et(l,a,Pe);return t.cross(d,s,i),t.normalize(i,i)}var fn=new w,gn=new t,un=new t,wn=new t;function ne(n,o,r,e,i,a,c,l,s,d,h){if(i===0)return;let f;a===W.GEODESIC?f=new De(n,o,c):a===W.RHUMB&&(f=new Qt(n,o,c));let T=f.surfaceDistance;if(T<i)return;let D=se(n,o,e,c,wn),O=Math.ceil(T/i),I=T/O,z=I,q=O-1,m=l.length;for(let j=0;j<q;j++){let b=f.interpolateUsingSurfaceDistance(z,fn),y=R(c,b,r,gn),H=R(c,b,e,un);t.pack(D,l,m),t.pack(y,s,m),t.pack(H,d,m),h.push(b.latitude),h.push(b.longitude),m+=3,z+=I}}var oe=new w;function R(n,o,r,e){return w.clone(o,oe),oe.height=r,w.toCartesian(oe,n,e)}rt.pack=function(n,o,r){tt.typeOf.object("value",n),tt.defined("array",o);let e=r??0,i=n._positions,a=i.length;o[e++]=a;for(let c=0;c<a;++c){let l=i[c];t.pack(l,o,e),e+=3}return o[e++]=n.granularity,o[e++]=n.loop?1:0,o[e++]=n.arcType,B.pack(n._ellipsoid,o,e),e+=B.packedLength,o[e++]=n._projectionIndex,o[e]=n._scene3DOnly?1:0,o};rt.unpack=function(n,o,r){tt.defined("array",n);let e=o??0,i=n[e++],a=new Array(i);for(let T=0;T<i;T++)a[T]=t.unpack(n,e),e+=3;let c=n[e++],l=n[e++]===1,s=n[e++],d=B.unpack(n,e);e+=B.packedLength;let h=n[e++],f=n[e]===1;return u(r)||(r=new rt({positions:a})),r._positions=a,r.granularity=c,r.loop=l,r.arcType=s,r._ellipsoid=d,r._projectionIndex=h,r._scene3DOnly=f,r};function et(n,o,r){return t.subtract(n,o,r),t.normalize(r,r),r}function be(n,o,r,e){return e=et(n,o,e),e=t.cross(e,r,e),e=t.normalize(e,e),e=t.cross(r,e,e),e}var Sn=new t,Tn=new t,En=new t,en=new t,xn=0,Nn=-1;function ie(n,o,r,e,i){let a=et(r,o,en),c=be(n,o,a,Sn),l=be(e,o,a,Tn);if(p.equalsEpsilon(t.dot(c,l),Nn,p.EPSILON5))return i=t.cross(a,c,i),i=t.normalize(i,i),i;i=t.add(l,c,i),i=t.normalize(i,i);let s=t.cross(a,i,En);return t.dot(l,s)<xn&&(i=t.negate(i,i)),i}var Ut=zt.fromPointNormal(t.ZERO,t.UNIT_Y),Cn=new t,_n=new t,Ln=new t,Dn=new t,On=new t,Ft=new t,Xt=new w,ve=new w,Be=new w;rt.createGeometry=function(n){let o=!n._scene3DOnly,r=n.loop,e=n._ellipsoid,i=n.granularity,a=n.arcType,c=new le[n._projectionIndex](e),l=Qe,s=tn,d,h,f=n._positions,T=f.length;T===2&&(r=!1);let D,O,I,z,q=new Qt(void 0,void 0,e),m,j,b,y=[f[0]];for(h=0;h<T-1;h++)D=f[h],O=f[h+1],m=Kt.lineSegmentPlane(D,O,Ut,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&(n.arcType===W.GEODESIC?y.push(t.clone(m)):n.arcType===W.RHUMB&&(b=e.cartesianToCartographic(m,Xt).longitude,I=e.cartesianToCartographic(D,Xt),z=e.cartesianToCartographic(O,ve),q.setEndPoints(I,z),j=q.findIntersectionWithLongitude(b,Be),m=e.cartographicToCartesian(j,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&y.push(t.clone(m)))),y.push(O);r&&(D=f[T-1],O=f[0],m=Kt.lineSegmentPlane(D,O,Ut,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&(n.arcType===W.GEODESIC?y.push(t.clone(m)):n.arcType===W.RHUMB&&(b=e.cartesianToCartographic(m,Xt).longitude,I=e.cartesianToCartographic(D,Xt),z=e.cartesianToCartographic(O,ve),q.setEndPoints(I,z),j=q.findIntersectionWithLongitude(b,Be),m=e.cartographicToCartesian(j,Ft),u(m)&&!t.equalsEpsilon(m,D,p.EPSILON7)&&!t.equalsEpsilon(m,O,p.EPSILON7)&&y.push(t.clone(m)))));let H=y.length,C=new Array(H);for(h=0;h<H;h++){let X=w.fromCartesian(y[h],e);X.height=0,C[h]=X}if(C=Le(C,w.equalsEpsilon),H=C.length,H<2)return;let k=[],P=[],v=[],x=[],N=Cn,L=_n,_=Ln,F=Dn,A=On,g=C[0],Z=C[1],Dt=C[H-1];for(N=R(e,Dt,l,N),F=R(e,Z,l,F),L=R(e,g,l,L),_=R(e,g,s,_),r?A=ie(N,L,_,F,A):A=se(g,Z,s,e,A),t.pack(A,P,0),t.pack(L,v,0),t.pack(_,x,0),k.push(g.latitude),k.push(g.longitude),ne(g,Z,l,s,i,a,e,P,v,x,k),h=1;h<H-1;++h){N=t.clone(L,N),L=t.clone(F,L);let X=C[h];R(e,X,s,_),R(e,C[h+1],l,F),ie(N,L,_,F,A),d=P.length,t.pack(A,P,d),t.pack(L,v,d),t.pack(_,x,d),k.push(X.latitude),k.push(X.longitude),ne(C[h],C[h+1],l,s,i,a,e,P,v,x,k)}let M=C[H-1],wt=C[H-2];if(L=R(e,M,l,L),_=R(e,M,s,_),r){let X=C[0];N=R(e,wt,l,N),F=R(e,X,l,F),A=ie(N,L,_,F,A)}else A=se(wt,M,s,e,A);if(d=P.length,t.pack(A,P,d),t.pack(L,v,d),t.pack(_,x,d),k.push(M.latitude),k.push(M.longitude),r){for(ne(M,g,l,s,i,a,e,P,v,x,k),d=P.length,h=0;h<3;++h)P[d+h]=P[h],v[d+h]=v[h],x[d+h]=x[h];k.push(g.latitude),k.push(g.longitude)}return Qn(r,c,v,x,P,k,o)};var In=new t,Hn=new Pt,kn=new Jt;function ze(n,o,r,e){let i=et(r,o,In),a=t.dot(i,n);if(a>Ke||a<Me){let c=et(e,r,en),l=a<Me?p.PI_OVER_TWO:-p.PI_OVER_TWO,s=Jt.fromAxisAngle(c,l,kn),d=Pt.fromQuaternion(s,Hn);return Pt.multiplyByVector(d,n,n),!0}return!1}var je=new w,yn=new t,Fe=new t;function Lt(n,o,r,e,i){let a=w.toCartesian(o,n._ellipsoid,yn),c=t.add(a,r,Fe),l=!1,s=n._ellipsoid,d=s.cartesianToCartographic(c,je);Math.abs(o.longitude-d.longitude)>p.PI_OVER_TWO&&(l=!0,c=t.subtract(a,r,Fe),d=s.cartesianToCartographic(c,je)),d.height=0;let h=n.project(d,i);return i=t.subtract(h,e,i),i.z=0,i=t.normalize(i,i),l&&t.negate(i,i),i}var An=new t,Xe=new t;function Ye(n,o,r,e,i,a){let c=t.subtract(o,n,An);t.normalize(c,c);let l=r-Qe,s=t.multiplyByScalar(c,l,Xe);t.add(n,s,i);let d=e-tn;s=t.multiplyByScalar(c,d,Xe),t.add(o,s,a)}var Mn=new t;function Yt(n,o){let r=zt.getPointDistance(Ut,n),e=zt.getPointDistance(Ut,o),i=Mn;p.equalsEpsilon(r,0,p.EPSILON2)?(i=et(o,n,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(n,i,n)):p.equalsEpsilon(e,0,p.EPSILON2)&&(i=et(n,o,i),t.multiplyByScalar(i,p.EPSILON2,i),t.add(o,i,o))}function Rn(n,o){let r=Math.abs(n.longitude),e=Math.abs(o.longitude);if(p.equalsEpsilon(r,p.PI,p.EPSILON11)){let i=p.sign(o.longitude);return n.longitude=i*(r-p.EPSILON11),1}else if(p.equalsEpsilon(e,p.PI,p.EPSILON11)){let i=p.sign(n.longitude);return o.longitude=i*(e-p.EPSILON11),2}return 0}var nn=new w,on=new w,Ue=new t,re=new t,qe=new t,Ge=new t,Pn=new t,We=new t,bn=[nn,on],vn=new Y,Bn=new t,zn=new t,jn=new t,Fn=new t,Xn=new t,Yn=new t,ae=new t,ce=new t,Un=new t,qn=new t,Gn=new t,Ze=new t,Wn=new t,Zn=new t,Vn=new Nt,$n=new Nt,Ve=new t,Jn=new t,$e=new t,Kn=[new U,new U],rn=[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],Je=rn.length;function Qn(n,o,r,e,i,a,c){let l,s,d=o._ellipsoid,h=r.length/3-1,f=h*8,T=f*4,D=h*36,O=f>65535?new Uint32Array(D):new Uint16Array(D),I=new Float64Array(f*3),z=new Float32Array(T),q=new Float32Array(T),m=new Float32Array(T),j=new Float32Array(T),b=new Float32Array(T),y,H,C,k;c&&(y=new Float32Array(T),H=new Float32Array(T),C=new Float32Array(T),k=new Float32Array(f*2));let P=a.length/2,v=0,x=nn;x.height=0;let N=on;N.height=0;let L=Ue,_=re;if(c)for(s=0,l=1;l<P;l++)x.latitude=a[s],x.longitude=a[s+1],N.latitude=a[s+2],N.longitude=a[s+3],L=o.project(x,L),_=o.project(N,_),v+=t.distance(L,_),s+=2;let F=e.length/3;_=t.unpack(e,0,_);let A=0;for(s=3,l=1;l<F;l++)L=t.clone(_,L),_=t.unpack(e,s,_),A+=t.distance(L,_),s+=3;let g;s=3;let Z=0,Dt=0,M=0,wt=0,X=!1,at=t.unpack(r,0,Ge),ct=t.unpack(e,0,re),G=t.unpack(i,0,We);if(n){let st=t.unpack(r,r.length-6,qe);ze(G,st,at,ct)&&(G=t.negate(G,G))}let pe=0,de=0,qt=0;for(l=0;l<h;l++){let st=t.clone(at,qe),Wt=t.clone(ct,Ue),dt=t.clone(G,Pn);X&&(dt=t.negate(dt,dt)),at=t.unpack(r,s,Ge),ct=t.unpack(e,s,re),G=t.unpack(i,s,We),X=ze(G,st,at,ct),x.latitude=a[Z],x.longitude=a[Z+1],N.latitude=a[Z+2],N.longitude=a[Z+3];let lt,mt,nt,ot;if(c){let E=Rn(x,N);lt=o.project(x,Xn),mt=o.project(N,Yn);let gt=et(mt,lt,Ve);gt.y=Math.abs(gt.y),nt=ae,ot=ce,E===0||t.dot(gt,t.UNIT_Y)>Ke?(nt=Lt(o,x,dt,lt,ae),ot=Lt(o,N,G,mt,ce)):E===1?(ot=Lt(o,N,G,mt,ce),nt.x=0,nt.y=p.sign(x.longitude-Math.abs(N.longitude)),nt.z=0):(nt=Lt(o,x,dt,lt,ae),ot.x=0,ot.y=p.sign(x.longitude-N.longitude),ot.z=0)}let ge=t.distance(Wt,ct),ue=Nt.fromCartesian(st,Vn),Ot=t.subtract(at,st,Un),an=t.normalize(Ot,Ze),Tt=t.subtract(Wt,st,qn);Tt=t.normalize(Tt,Tt);let ft=t.cross(an,Tt,Ze);ft=t.normalize(ft,ft);let It=t.cross(Tt,dt,Wn);It=t.normalize(It,It);let Ht=t.subtract(ct,at,Gn);Ht=t.normalize(Ht,Ht);let kt=t.cross(G,Ht,Zn);kt=t.normalize(kt,kt);let cn=ge/A,sn=pe/A,Zt=0,Et,yt,ht,we=0,Se=0;if(c){Zt=t.distance(lt,mt),Et=Nt.fromCartesian(lt,$n),yt=t.subtract(mt,lt,Ve),ht=t.normalize(yt,Jn);let E=ht.x;ht.x=ht.y,ht.y=-E,we=Zt/v,Se=de/v}for(g=0;g<8;g++){let E=wt+g*4,gt=Dt+g*2,xt=E+3,Ee=g<4?1:-1,At=g===2||g===3||g===6||g===7?1:-1;t.pack(ue.high,z,E),z[xt]=Ot.x,t.pack(ue.low,q,E),q[xt]=Ot.y,t.pack(It,m,E),m[xt]=Ot.z,t.pack(kt,j,E),j[xt]=cn*Ee,t.pack(ft,b,E);let pt=sn*At;pt===0&&At<0&&(pt=9),b[xt]=pt,c&&(y[E]=Et.high.x,y[E+1]=Et.high.y,y[E+2]=Et.low.x,y[E+3]=Et.low.y,C[E]=-nt.y,C[E+1]=nt.x,C[E+2]=ot.y,C[E+3]=-ot.x,H[E]=yt.x,H[E+1]=yt.y,H[E+2]=ht.x,H[E+3]=ht.y,k[gt]=we*Ee,pt=Se*At,pt===0&&At<0&&(pt=9),k[gt+1]=pt)}let V=jn,$=Fn,J=Bn,K=zn,ln=Y.fromCartographicArray(bn,vn),Te=jt.getMinimumMaximumHeights(ln,d),Vt=Te.minimumTerrainHeight,$t=Te.maximumTerrainHeight;qt+=Math.abs(Vt),qt+=Math.abs($t),Ye(st,Wt,Vt,$t,V,J),Ye(at,ct,Vt,$t,$,K);let Q=t.multiplyByScalar(ft,p.EPSILON5,$e);t.add(V,Q,V),t.add($,Q,$),t.add(J,Q,J),t.add(K,Q,K),Yt(V,$),Yt(J,K),t.pack(V,I,M),t.pack($,I,M+3),t.pack(K,I,M+6),t.pack(J,I,M+9),Q=t.multiplyByScalar(ft,-2*p.EPSILON5,$e),t.add(V,Q,V),t.add($,Q,$),t.add(J,Q,J),t.add(K,Q,K),Yt(V,$),Yt(J,K),t.pack(V,I,M+12),t.pack($,I,M+15),t.pack(K,I,M+18),t.pack(J,I,M+21),Z+=2,s+=3,Dt+=16,M+=24,wt+=32,pe+=ge,de+=Zt}s=0;let me=0;for(l=0;l<h;l++){for(g=0;g<Je;g++)O[s+g]=rn[g]+me;me+=8,s+=Je}let Gt=Kn;U.fromVertices(r,t.ZERO,3,Gt[0]),U.fromVertices(e,t.ZERO,3,Gt[1]);let fe=U.fromBoundingSpheres(Gt);fe.radius+=qt/(h*2);let St={position:new Bt({componentDatatype:vt.DOUBLE,componentsPerAttribute:3,normalize:!1,values:I}),startHiAndForwardOffsetX:it(z),startLoAndForwardOffsetY:it(q),startNormalAndForwardOffsetZ:it(m),endNormalAndTextureCoordinateNormalizationX:it(j),rightNormalAndTextureCoordinateNormalizationY:it(b)};return c&&(St.startHiLo2D=it(y),St.offsetAndRight2D=it(H),St.startEndNormals2D=it(C),St.texcoordNormalization2D=new Bt({componentDatatype:vt.FLOAT,componentsPerAttribute:2,normalize:!1,values:k})),new Ce({attributes:St,indices:O,boundingSphere:fe})}function it(n){return new Bt({componentDatatype:vt.FLOAT,componentsPerAttribute:4,normalize:!1,values:n})}rt._projectNormal=Lt;var he=rt;function to(n,o){return jt.initialize().then(function(){return u(o)&&(n=he.unpack(n,o)),he.createGeometry(n)})}var Qo=to;export{Qo as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPlaneGeometry.js b/plugins/feature/map/Cesium/Workers/createPlaneGeometry.js index 79f9bce44..a50ffea0a 100644 --- a/plugins/feature/map/Cesium/Workers/createPlaneGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPlaneGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as m}from"./chunk-S3L7VZFL.js";import{a as b}from"./chunk-J3L5WX3X.js";import{b as v,c as x,d as c}from"./chunk-AVPLM4UI.js";import{d as l}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as i}from"./chunk-WER4LUMF.js";import{a as u,f as A}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as f}from"./chunk-ELJAHN3H.js";import{e as s}from"./chunk-3BGP4HCL.js";function p(r){r=r??A.EMPTY_OBJECT;let e=r.vertexFormat??m.DEFAULT;this._vertexFormat=e,this._workerName="createPlaneGeometry"}p.packedLength=m.packedLength;p.pack=function(r,e,o){return f.typeOf.object("value",r),f.defined("array",e),o=o??0,m.pack(r._vertexFormat,e,o),e};var d=new m,P={vertexFormat:d};p.unpack=function(r,e,o){f.defined("array",r),e=e??0;let a=m.unpack(r,e,d);return s(o)?(o._vertexFormat=m.clone(a,o._vertexFormat),o):new p(P)};var y=new u(-.5,-.5,0),F=new u(.5,.5,0);p.createGeometry=function(r){let e=r._vertexFormat,o=new b,a,n;if(e.position){if(n=new Float64Array(4*3),n[0]=y.x,n[1]=y.y,n[2]=0,n[3]=F.x,n[4]=y.y,n[5]=0,n[6]=F.x,n[7]=F.y,n[8]=0,n[9]=y.x,n[10]=F.y,n[11]=0,o.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:n}),e.normal){let t=new Float32Array(12);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,o.normal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t})}if(e.st){let t=new Float32Array(8);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,o.st=new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:t})}if(e.tangent){let t=new Float32Array(12);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,o.tangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t})}if(e.bitangent){let t=new Float32Array(12);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,o.bitangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t})}a=new Uint16Array(2*3),a[0]=0,a[1]=1,a[2]=2,a[3]=0,a[4]=2,a[5]=3}return new x({attributes:o,indices:a,primitiveType:v.TRIANGLES,boundingSphere:new l(u.ZERO,Math.sqrt(2))})};var w=p;function h(r,e){return s(e)&&(r=w.unpack(r,e)),w.createGeometry(r)}var N=h;export{N as default}; +import{a as m}from"./chunk-FZSSAWMQ.js";import{a as b}from"./chunk-ILBQ77ZM.js";import{b as v,c as x,d as c}from"./chunk-7RNSURKI.js";import{c as l}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as i}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a as u,c as A}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as f}from"./chunk-OU2IPMYE.js";import{f as s}from"./chunk-H7SJWKIY.js";function p(r){r=r??A.EMPTY_OBJECT;let e=r.vertexFormat??m.DEFAULT;this._vertexFormat=e,this._workerName="createPlaneGeometry"}p.packedLength=m.packedLength;p.pack=function(r,e,o){return f.typeOf.object("value",r),f.defined("array",e),o=o??0,m.pack(r._vertexFormat,e,o),e};var d=new m,P={vertexFormat:d};p.unpack=function(r,e,o){f.defined("array",r),e=e??0;let a=m.unpack(r,e,d);return s(o)?(o._vertexFormat=m.clone(a,o._vertexFormat),o):new p(P)};var y=new u(-.5,-.5,0),F=new u(.5,.5,0);p.createGeometry=function(r){let e=r._vertexFormat,o=new b,a,n;if(e.position){if(n=new Float64Array(12),n[0]=y.x,n[1]=y.y,n[2]=0,n[3]=F.x,n[4]=y.y,n[5]=0,n[6]=F.x,n[7]=F.y,n[8]=0,n[9]=y.x,n[10]=F.y,n[11]=0,o.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:n}),e.normal){let t=new Float32Array(12);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=1,t[9]=0,t[10]=0,t[11]=1,o.normal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t})}if(e.st){let t=new Float32Array(8);t[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,o.st=new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:t})}if(e.tangent){let t=new Float32Array(12);t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=1,t[10]=0,t[11]=0,o.tangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t})}if(e.bitangent){let t=new Float32Array(12);t[0]=0,t[1]=1,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=1,t[8]=0,t[9]=0,t[10]=1,t[11]=0,o.bitangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t})}a=new Uint16Array(6),a[0]=0,a[1]=1,a[2]=2,a[3]=0,a[4]=2,a[5]=3}return new x({attributes:o,indices:a,primitiveType:v.TRIANGLES,boundingSphere:new l(u.ZERO,Math.sqrt(2))})};var w=p;function h(r,e){return s(e)&&(r=w.unpack(r,e)),w.createGeometry(r)}var N=h;export{N as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPlaneOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createPlaneOutlineGeometry.js index 6f7917120..e03abcefb 100644 --- a/plugins/feature/map/Cesium/Workers/createPlaneOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPlaneOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as l}from"./chunk-J3L5WX3X.js";import{b as d,c as y,d as s}from"./chunk-AVPLM4UI.js";import{d as c}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as f}from"./chunk-WER4LUMF.js";import{a}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as m}from"./chunk-ELJAHN3H.js";import{e as i}from"./chunk-3BGP4HCL.js";function o(){this._workerName="createPlaneOutlineGeometry"}o.packedLength=0;o.pack=function(r,e){return m.defined("value",r),m.defined("array",e),e};o.unpack=function(r,e,t){return m.defined("array",r),i(t)?t:new o};var n=new a(-.5,-.5,0),p=new a(.5,.5,0);o.createGeometry=function(){let r=new l,e=new Uint16Array(4*2),t=new Float64Array(4*3);return t[0]=n.x,t[1]=n.y,t[2]=n.z,t[3]=p.x,t[4]=n.y,t[5]=n.z,t[6]=p.x,t[7]=p.y,t[8]=n.z,t[9]=n.x,t[10]=p.y,t[11]=n.z,r.position=new s({componentDatatype:f.DOUBLE,componentsPerAttribute:3,values:t}),e[0]=0,e[1]=1,e[2]=1,e[3]=2,e[4]=2,e[5]=3,e[6]=3,e[7]=0,new y({attributes:r,indices:e,primitiveType:d.LINES,boundingSphere:new c(a.ZERO,Math.sqrt(2))})};var u=o;function w(r,e){return i(e)&&(r=u.unpack(r,e)),u.createGeometry(r)}var D=w;export{D as default}; +import{a as l}from"./chunk-ILBQ77ZM.js";import{b as d,c as y,d as s}from"./chunk-7RNSURKI.js";import{c}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as f}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as m}from"./chunk-OU2IPMYE.js";import{f as i}from"./chunk-H7SJWKIY.js";function o(){this._workerName="createPlaneOutlineGeometry"}o.packedLength=0;o.pack=function(r,e){return m.defined("value",r),m.defined("array",e),e};o.unpack=function(r,e,t){return m.defined("array",r),i(t)?t:new o};var n=new a(-.5,-.5,0),p=new a(.5,.5,0);o.createGeometry=function(){let r=new l,e=new Uint16Array(8),t=new Float64Array(12);return t[0]=n.x,t[1]=n.y,t[2]=n.z,t[3]=p.x,t[4]=n.y,t[5]=n.z,t[6]=p.x,t[7]=p.y,t[8]=n.z,t[9]=n.x,t[10]=p.y,t[11]=n.z,r.position=new s({componentDatatype:f.DOUBLE,componentsPerAttribute:3,values:t}),e[0]=0,e[1]=1,e[2]=1,e[3]=2,e[4]=2,e[5]=3,e[6]=3,e[7]=0,new y({attributes:r,indices:e,primitiveType:d.LINES,boundingSphere:new c(a.ZERO,Math.sqrt(2))})};var u=o;function w(r,e){return i(e)&&(r=u.unpack(r,e)),u.createGeometry(r)}var D=w;export{D as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPolygonGeometry.js b/plugins/feature/map/Cesium/Workers/createPolygonGeometry.js index cc4ade824..84d52f5df 100644 --- a/plugins/feature/map/Cesium/Workers/createPolygonGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPolygonGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as mt}from"./chunk-S5KJ4JQS.js";import{a as L}from"./chunk-2V6KZTKL.js";import{a as st}from"./chunk-IFR5HKVH.js";import{a as rt}from"./chunk-4OIYAFXA.js";import{a as bt}from"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import{a as lt}from"./chunk-4W2MZV6I.js";import{a as q}from"./chunk-S3L7VZFL.js";import{a as Z}from"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{a as dt,b as ot}from"./chunk-BKYT7QHD.js";import"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import{a as wt,b as yt}from"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as ct}from"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import{c as ut,d as $}from"./chunk-AVPLM4UI.js";import{d as Tt}from"./chunk-ZYYZDBKK.js";import{f as at,h as _t}from"./chunk-3PT5NNSP.js";import{a as X}from"./chunk-WER4LUMF.js";import{a as c,b as et,c as O,d as S,e as D,f as Pt}from"./chunk-FGKVHLJ4.js";import{a as l}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as ft,b as Y}from"./chunk-ELJAHN3H.js";import{e as P}from"./chunk-3BGP4HCL.js";function b(t,e){this.position=t,P(this.position)||(this.position=new O),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=b.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(b.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 t=O.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=l.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=l.TWO_PI),t}}});var nt=new et,Rt=new c;b.prototype.getLatitude=function(t){P(t)||(t=S.default),nt.latitude=this.conformalLatitude,nt.longitude=this.longitude,nt.height=0;let e=this.ellipsoid.cartographicToCartesian(nt,Rt);return t.cartesianToCartographic(e,nt),nt.latitude};var It=new wt,Lt=new c,Ft=new c;b.fromCartesian=function(t,e){Y.defined("cartesian",t);let o=l.signNotZero(t.z),n=b.NORTH_POLE_TANGENT_PLANE,s=b.SOUTH_POLE;o<0&&(n=b.SOUTH_POLE_TANGENT_PLANE,s=b.NORTH_POLE);let i=It;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,Lt),c.normalize(i.direction,i.direction);let r=yt.rayPlane(i,n.plane,Ft),f=c.subtract(r,s,r),d=c.dot(n.xAxis,f),p=o*c.dot(n.yAxis,f);return P(e)?(e.position=new O(d,p),e.tangentPlane=n,e):new b(new O(d,p),n)};b.fromCartesianArray=function(t,e){Y.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;n<o;n++)e[n]=b.fromCartesian(t[n],e[n]);return e};b.clone=function(t,e){if(P(t))return P(e)?(e.position=t.position,e.tangentPlane=t.tangentPlane,e):new b(t.position,t.tangentPlane)};b.HALF_UNIT_SPHERE=Object.freeze(new S(.5,.5,.5));b.NORTH_POLE=Object.freeze(new c(0,0,.5));b.SOUTH_POLE=Object.freeze(new c(0,0,-.5));b.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Z(b.NORTH_POLE,b.HALF_UNIT_SPHERE));b.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Z(b.SOUTH_POLE,b.HALF_UNIT_SPHERE));var z=b;var vt=new et,Ot=new et;function St(t,e,o,n){let i=n.cartesianToCartographic(t,vt).height,r=n.cartesianToCartographic(e,Ot);r.height=i,n.cartographicToCartesian(r,e);let f=n.cartesianToCartographic(o,Ot);f.height=i-100,n.cartographicToCartesian(f,o)}var Et=new mt,Vt=new c,Bt=new c,Mt=new c,jt=new c,kt=new c,zt=new c,ht=new c,Q=new c,it=new c,Dt=new O,Ut=new O,Wt=new c,At=new at,Gt=new D,Yt=new D;function gt(t){let e=t.vertexFormat,o=t.geometry,n=t.shadowVolume,s=o.attributes.position.values,i=P(o.attributes.st)?o.attributes.st.values:void 0,r=s.length,f=t.wall,d=t.top||f,p=t.bottom||f;if(e.st||e.normal||e.tangent||e.bitangent||n){let w=t.boundingRectangle,a=t.rotationAxis,H=t.projectTo2d,x=t.ellipsoid,M=t.stRotation,C=t.perPositionHeight,R=Dt;R.x=w.x,R.y=w.y;let V=e.st?new Float32Array(2*(r/3)):void 0,u;e.normal&&(C&&d&&!f?u=o.attributes.normal.values:u=new Float32Array(r));let E=e.tangent?new Float32Array(r):void 0,A=e.bitangent?new Float32Array(r):void 0,F=n?new Float32Array(r):void 0,T=0,y=0,_=Bt,h=Mt,g=jt,j=!0,G=Gt,K=Yt;if(M!==0){let B=at.fromAxisAngle(a,M,At);G=D.fromQuaternion(B,G),B=at.fromAxisAngle(a,-M,At),K=D.fromQuaternion(B,K)}else G=D.clone(D.IDENTITY,G),K=D.clone(D.IDENTITY,K);let m=0,I=0;d&&p&&(m=r/2,I=r/3,r/=2);for(let B=0;B<r;B+=3){let k=c.fromArray(s,B,Wt);if(e.st&&!P(i)){let N=D.multiplyByVector(G,k,Vt);N=x.scaleToGeodeticSurface(N,N);let v=H([N],Ut)[0];O.subtract(v,R,v);let J=l.clamp(v.x/w.width,0,1),tt=l.clamp(v.y/w.height,0,1);p&&(V[T+I]=J,V[T+1+I]=tt),d&&(V[T]=J,V[T+1]=tt),T+=2}if(e.normal||e.tangent||e.bitangent||n){let N=y+1,v=y+2;if(f){if(B+3<r){let J=c.fromArray(s,B+3,kt);if(j){let tt=c.fromArray(s,B+r,zt);C&&St(k,J,tt,x),c.subtract(J,k,J),c.subtract(tt,k,tt),_=c.normalize(c.cross(tt,J,_),_),j=!1}c.equalsEpsilon(J,k,l.EPSILON10)&&(j=!0)}(e.tangent||e.bitangent)&&(g=x.geodeticSurfaceNormal(k,g),e.tangent&&(h=c.normalize(c.cross(g,_,h),h)))}else _=x.geodeticSurfaceNormal(k,_),(e.tangent||e.bitangent)&&(C&&(ht=c.fromArray(u,y,ht),Q=c.cross(c.UNIT_Z,ht,Q),Q=c.normalize(D.multiplyByVector(K,Q,Q),Q),e.bitangent&&(it=c.normalize(c.cross(ht,Q,it),it))),h=c.cross(c.UNIT_Z,_,h),h=c.normalize(D.multiplyByVector(K,h,h),h),e.bitangent&&(g=c.normalize(c.cross(_,h,g),g)));e.normal&&(t.wall?(u[y+m]=_.x,u[N+m]=_.y,u[v+m]=_.z):p&&(u[y+m]=-_.x,u[N+m]=-_.y,u[v+m]=-_.z),(d&&!C||f)&&(u[y]=_.x,u[N]=_.y,u[v]=_.z)),n&&(f&&(_=x.geodeticSurfaceNormal(k,_)),F[y+m]=-_.x,F[N+m]=-_.y,F[v+m]=-_.z),e.tangent&&(t.wall?(E[y+m]=h.x,E[N+m]=h.y,E[v+m]=h.z):p&&(E[y+m]=-h.x,E[N+m]=-h.y,E[v+m]=-h.z),d&&(C?(E[y]=Q.x,E[N]=Q.y,E[v]=Q.z):(E[y]=h.x,E[N]=h.y,E[v]=h.z))),e.bitangent&&(p&&(A[y+m]=g.x,A[N+m]=g.y,A[v+m]=g.z),d&&(C?(A[y]=it.x,A[N]=it.y,A[v]=it.z):(A[y]=g.x,A[N]=g.y,A[v]=g.z))),y+=3}}e.st&&!P(i)&&(o.attributes.st=new $({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:V})),e.normal&&(o.attributes.normal=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})),e.tangent&&(o.attributes.tangent=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),e.bitangent&&(o.attributes.bitangent=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),n&&(o.attributes.extrudeDirection=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:F}))}if(t.extrude&&P(t.offsetAttribute)){let w=s.length/3,a=new Uint8Array(w);if(t.offsetAttribute===lt.TOP)d&&p||f?a=a.fill(1,0,w/2):d&&(a=a.fill(1));else{let H=t.offsetAttribute===lt.NONE?0:1;a=a.fill(H)}o.attributes.applyOffset=new $({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return o}var Ht=[];function qt(t,e,o,n,s,i,r,f,d,p){let w={walls:[]},a;if(r||f){let u=L.createGeometryFromPositions(t,e,o,n,i,d,p),E=u.attributes.position.values,A=u.indices,F,T;if(r&&f){let y=E.concat(E);F=y.length/3,T=ct.createTypedArray(F,A.length*2),T.set(A);let _=A.length,h=F/2;for(a=0;a<_;a+=3){let g=T[a]+h,j=T[a+1]+h,G=T[a+2]+h;T[a+_]=G,T[a+1+_]=j,T[a+2+_]=g}if(u.attributes.position.values=y,i&&d.normal){let g=u.attributes.normal.values;u.attributes.normal.values=new Float32Array(y.length),u.attributes.normal.values.set(g)}if(d.st&&P(o)){let g=u.attributes.st.values;u.attributes.st.values=new Float32Array(F*2),u.attributes.st.values=g.concat(g)}u.indices=T}else if(f){for(F=E.length/3,T=ct.createTypedArray(F,A.length),a=0;a<A.length;a+=3)T[a]=A[a+2],T[a+1]=A[a+1],T[a+2]=A[a];u.indices=T}w.topAndBottom=new rt({geometry:u})}let H=s.outerRing,x=Z.fromPoints(H,t),M=x.projectPointsOntoPlane(H,Ht),C=ot.computeWindingOrder2D(M);C===dt.CLOCKWISE&&(H=H.slice().reverse());let R=L.computeWallGeometry(H,o,t,n,i,p);w.walls.push(new rt({geometry:R}));let V=s.holes;for(a=0;a<V.length;a++){let u=V[a];M=x.projectPointsOntoPlane(u,Ht),C=ot.computeWindingOrder2D(M),C===dt.COUNTER_CLOCKWISE&&(u=u.slice().reverse()),R=L.computeWallGeometry(u,o,t,n,i,p),w.walls.push(new rt({geometry:R}))}return w}function W(t){if(Y.typeOf.object("options",t),Y.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),P(t.perPositionHeight)&&t.perPositionHeight&&P(t.height))throw new ft("Cannot use both options.perPositionHeight and options.height");if(P(t.arcType)&&t.arcType!==st.GEODESIC&&t.arcType!==st.RHUMB)throw new ft("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let e=t.polygonHierarchy,o=t.vertexFormat??q.DEFAULT,n=t.ellipsoid??S.default,s=t.granularity??l.RADIANS_PER_DEGREE,i=t.stRotation??0,r=t.textureCoordinates,f=t.perPositionHeight??!1,d=f&&P(t.extrudedHeight),p=t.height??0,w=t.extrudedHeight??p;if(!d){let a=Math.max(p,w);w=Math.min(p,w),p=a}this._vertexFormat=q.clone(o),this._ellipsoid=S.clone(n),this._granularity=s,this._stRotation=i,this._height=p,this._extrudedHeight=w,this._closeTop=t.closeTop??!0,this._closeBottom=t.closeBottom??!0,this._polygonHierarchy=e,this._perPositionHeight=f,this._perPositionHeightExtrude=d,this._shadowVolume=t.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=t.arcType??st.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=r,this.packedLength=L.computeHierarchyPackedLength(e,c)+S.packedLength+q.packedLength+(r?L.computeHierarchyPackedLength(r,O):1)+12}W.fromPositions=function(t){t=t??Pt.EMPTY_OBJECT,Y.defined("options.positions",t.positions);let e={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};return new W(e)};W.pack=function(t,e,o){return Y.typeOf.object("value",t),Y.defined("array",e),o=o??0,o=L.packPolygonHierarchy(t._polygonHierarchy,e,o,c),S.pack(t._ellipsoid,e,o),o+=S.packedLength,q.pack(t._vertexFormat,e,o),o+=q.packedLength,e[o++]=t._height,e[o++]=t._extrudedHeight,e[o++]=t._granularity,e[o++]=t._stRotation,e[o++]=t._perPositionHeightExtrude?1:0,e[o++]=t._perPositionHeight?1:0,e[o++]=t._closeTop?1:0,e[o++]=t._closeBottom?1:0,e[o++]=t._shadowVolume?1:0,e[o++]=t._offsetAttribute??-1,e[o++]=t._arcType,P(t._textureCoordinates)?o=L.packPolygonHierarchy(t._textureCoordinates,e,o,O):e[o++]=-1,e[o++]=t.packedLength,e};var Qt=S.clone(S.UNIT_SPHERE),Zt=new q,Kt={polygonHierarchy:{}};W.unpack=function(t,e,o){Y.defined("array",t),e=e??0;let n=L.unpackPolygonHierarchy(t,e,c);e=n.startingIndex,delete n.startingIndex;let s=S.unpack(t,e,Qt);e+=S.packedLength;let i=q.unpack(t,e,Zt);e+=q.packedLength;let r=t[e++],f=t[e++],d=t[e++],p=t[e++],w=t[e++]===1,a=t[e++]===1,H=t[e++]===1,x=t[e++]===1,M=t[e++]===1,C=t[e++],R=t[e++],V=t[e]===-1?void 0:L.unpackPolygonHierarchy(t,e,O);P(V)?(e=V.startingIndex,delete V.startingIndex):e++;let u=t[e++];return P(o)||(o=new W(Kt)),o._polygonHierarchy=n,o._ellipsoid=S.clone(s,o._ellipsoid),o._vertexFormat=q.clone(i,o._vertexFormat),o._height=r,o._extrudedHeight=f,o._granularity=d,o._stRotation=p,o._perPositionHeightExtrude=w,o._perPositionHeight=a,o._closeTop=H,o._closeBottom=x,o._shadowVolume=M,o._offsetAttribute=C===-1?void 0:C,o._arcType=R,o._textureCoordinates=V,o.packedLength=u,o};var Jt=new O,Xt=new O,$t=new z;function xt(t,e,o,n,s,i){let r=t.longitude,f=r>=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);let d=t.getLatitude(o),p=d;if(i.south=Math.min(i.south,d),i.north=Math.max(i.north,d),n!==st.RHUMB){let H=O.subtract(e.position,t.position,Jt),x=O.dot(e.position,H)/O.dot(H,H);if(x>0&&x<1){let M=O.add(e.position,O.multiplyByScalar(H,-x,H),Xt),C=z.clone(e,$t);C.position=M;let R=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(d)>Math.abs(R)&&(p=R)}}let w=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=O.angleBetween(e.position,t.position)),p>=0&&(s.northAngle+=a),p<=0&&(s.southAngle+=a)}var Ct=new z,te=new z,U={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};W.computeRectangleFromPositions=function(t,e,o,n){if(Y.defined("positions",t),P(n)||(n=new _t),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,U.northAngle=0,U.southAngle=0,U.westOverIdl=Number.POSITIVE_INFINITY,U.eastOverIdl=Number.NEGATIVE_INFINITY;let s=t.length,i=z.fromCartesian(t[0],te);for(let r=1;r<s;r++){let f=z.fromCartesian(t[r],Ct);xt(f,i,e,o,U,n),i=z.clone(f,i)}return xt(z.fromCartesian(t[0],Ct),i,e,o,U,n),n.east-n.west>U.eastOverIdl-U.westOverIdl&&(n.west=U.westOverIdl,n.east=U.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(U.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(U.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};var ee=new z;function oe(t,e,o){return t.height>=l.PI||t.width>=l.PI?z.fromCartesian(e[0],ee).tangentPlane:Z.fromPoints(e,o)}var Nt=new et;function ne(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(let r=0;r<n.length;++r){let f=o.cartesianToCartographic(n[r],Nt);s[r]=new O(f.longitude/l.PI,f.latitude/l.PI_OVER_TWO)}return s.length=n.length,s}return z.fromCartesianArray(n,s)}return Z.fromPoints(e,o).projectPointsOntoPlane(n,s)}}function ie(t,e,o){if(t.height>=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){let r=o.cartesianToCartographic(s,Nt);return P(i)||(i=new O),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}return z.fromCartesian(s,i)};let n=Z.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}function re(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?L.splitPolygonsOnEquator(s,e,o,i):s}function se(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)return mt.fromRectangle(e,void 0,Et);let s=t,i=Z.fromPoints(s,o);return L.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Et)}W.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,d=t._closeBottom,p=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;let x=t.rectangle,M=L.polygonsFromHierarchy(i,a,ne(x,H,o),!r,o,re(x,o,p,r)),C=M.hierarchy,R=M.polygons,V=function(m){return m},u=a?L.polygonsFromHierarchy(w,!0,V,!1,o).polygons:void 0;if(C.length===0)return;let E=C[0].outerRing,A=se(E,x,o,s),F=[],T=t._height,y=t._extrudedHeight,_=t._perPositionHeightExtrude||!l.equalsEpsilon(T,y,0,l.EPSILON2),h={perPositionHeight:r,vertexFormat:e,geometry:void 0,rotationAxis:oe(x,E,o).plane.normal,projectTo2d:ie(x,E,o),boundingRectangle:A,ellipsoid:o,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p},g;if(_)for(h.extrude=!0,h.top=f,h.bottom=d,h.shadowVolume=t._shadowVolume,h.offsetAttribute=t._offsetAttribute,g=0;g<R.length;g++){let m=qt(o,R[g],a?u[g]:void 0,n,C[g],r,f,d,e,p),I;f&&d?(I=m.topAndBottom,h.geometry=L.scaleToGeodeticHeightExtruded(I.geometry,T,y,o,r)):f?(I=m.topAndBottom,I.geometry.attributes.position.values=ot.scaleToGeodeticHeight(I.geometry.attributes.position.values,T,o,!r),h.geometry=I.geometry):d&&(I=m.topAndBottom,I.geometry.attributes.position.values=ot.scaleToGeodeticHeight(I.geometry.attributes.position.values,y,o,!0),h.geometry=I.geometry),(f||d)&&(h.wall=!1,I.geometry=gt(h),F.push(I));let B=m.walls;h.wall=!0;for(let k=0;k<B.length;k++){let N=B[k];h.geometry=L.scaleToGeodeticHeightExtruded(N.geometry,T,y,o,r),N.geometry=gt(h),F.push(N)}}else for(g=0;g<R.length;g++){let m=new rt({geometry:L.createGeometryFromPositions(o,R[g],a?u[g]:void 0,n,r,e,p)});if(m.geometry.attributes.position.values=ot.scaleToGeodeticHeight(m.geometry.attributes.position.values,T,o,!r),h.geometry=m.geometry,m.geometry=gt(h),P(t._offsetAttribute)){let I=m.geometry.attributes.position.values.length,B=t._offsetAttribute===lt.NONE?0:1,k=new Uint8Array(I/3).fill(B);m.geometry.attributes.applyOffset=new $({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}F.push(m)}let j=bt.combineInstances(F)[0];j.attributes.position.values=new Float64Array(j.attributes.position.values),j.indices=ct.createTypedArray(j.attributes.position.values.length/3,j.indices);let G=j.attributes,K=Tt.fromVertices(G.position.values);return e.position||delete G.position,new ut({attributes:G,indices:j.indices,primitiveType:j.primitiveType,boundingSphere:K,offsetAttribute:t._offsetAttribute})};W.createShadowVolume=function(t,e,o){let n=t._granularity,s=t._ellipsoid,i=e(n,s),r=o(n,s);return new W({polygonHierarchy:t._polygonHierarchy,ellipsoid:s,stRotation:t._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:i,height:r,vertexFormat:q.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})};function ae(t){let e=-t._stRotation;if(e===0)return[0,0,0,1,1,0];let o=t._ellipsoid,n=t._polygonHierarchy.positions,s=t.rectangle;return ut._textureCoordinateRotationPoints(n,e,o,s)}Object.defineProperties(W.prototype,{rectangle:{get:function(){if(!P(this._rectangle)){let t=this._polygonHierarchy.positions;this._rectangle=W.computeRectangleFromPositions(t,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return P(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ae(this)),this._textureCoordinateRotationPoints}}});var pt=W;function ce(t,e){return P(e)&&(t=pt.unpack(t,e)),t._ellipsoid=S.clone(t._ellipsoid),pt.createGeometry(t)}var Xe=ce;export{Xe as default}; +import{a as mt}from"./chunk-YAU2WIVW.js";import{a as L}from"./chunk-76NBDD5E.js";import{a as st}from"./chunk-LXGG3JDP.js";import{a as rt}from"./chunk-PICDM7L2.js";import{a as bt}from"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import{a as lt}from"./chunk-GNBKSQYP.js";import{a as q}from"./chunk-FZSSAWMQ.js";import{a as Z}from"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{a as dt,b as ot}from"./chunk-SIFLADX4.js";import"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import{a as wt,b as yt}from"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as ct}from"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import{c as ut,d as $}from"./chunk-7RNSURKI.js";import{c as Tt}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{h as at,j as _t}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as X}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as et,b as O,c as S}from"./chunk-KP72RGCH.js";import{a as c,b as D,c as Pt}from"./chunk-OSVSBQDY.js";import{a as l}from"./chunk-LZC73BOP.js";import{a as ft,b as Y}from"./chunk-OU2IPMYE.js";import{f as P}from"./chunk-H7SJWKIY.js";function b(t,e){this.position=t,P(this.position)||(this.position=new O),this.tangentPlane=e,P(this.tangentPlane)||(this.tangentPlane=b.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(b.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 t=O.magnitude(this.position),e=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(l.PI_OVER_TWO-2*Math.atan2(t,e))}},longitude:{get:function(){let t=l.PI_OVER_TWO+Math.atan2(this.y,this.x);return t>Math.PI&&(t-=l.TWO_PI),t}}});var nt=new et,Rt=new c;b.prototype.getLatitude=function(t){P(t)||(t=S.default),nt.latitude=this.conformalLatitude,nt.longitude=this.longitude,nt.height=0;let e=this.ellipsoid.cartographicToCartesian(nt,Rt);return t.cartesianToCartographic(e,nt),nt.latitude};var It=new wt,Lt=new c,Ft=new c;b.fromCartesian=function(t,e){Y.defined("cartesian",t);let o=l.signNotZero(t.z),n=b.NORTH_POLE_TANGENT_PLANE,s=b.SOUTH_POLE;o<0&&(n=b.SOUTH_POLE_TANGENT_PLANE,s=b.NORTH_POLE);let i=It;i.origin=n.ellipsoid.scaleToGeocentricSurface(t,i.origin),i.direction=c.subtract(i.origin,s,Lt),c.normalize(i.direction,i.direction);let r=yt.rayPlane(i,n.plane,Ft),f=c.subtract(r,s,r),d=c.dot(n.xAxis,f),p=o*c.dot(n.yAxis,f);return P(e)?(e.position=new O(d,p),e.tangentPlane=n,e):new b(new O(d,p),n)};b.fromCartesianArray=function(t,e){Y.defined("cartesians",t);let o=t.length;P(e)?e.length=o:e=new Array(o);for(let n=0;n<o;n++)e[n]=b.fromCartesian(t[n],e[n]);return e};b.clone=function(t,e){if(P(t))return P(e)?(e.position=t.position,e.tangentPlane=t.tangentPlane,e):new b(t.position,t.tangentPlane)};b.HALF_UNIT_SPHERE=Object.freeze(new S(.5,.5,.5));b.NORTH_POLE=Object.freeze(new c(0,0,.5));b.SOUTH_POLE=Object.freeze(new c(0,0,-.5));b.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Z(b.NORTH_POLE,b.HALF_UNIT_SPHERE));b.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Z(b.SOUTH_POLE,b.HALF_UNIT_SPHERE));var z=b;var vt=new et,Ot=new et;function St(t,e,o,n){let i=n.cartesianToCartographic(t,vt).height,r=n.cartesianToCartographic(e,Ot);r.height=i,n.cartographicToCartesian(r,e);let f=n.cartesianToCartographic(o,Ot);f.height=i-100,n.cartographicToCartesian(f,o)}var Et=new mt,Vt=new c,Bt=new c,Mt=new c,jt=new c,kt=new c,zt=new c,ht=new c,Q=new c,it=new c,Dt=new O,Ut=new O,Wt=new c,At=new at,Gt=new D,Yt=new D;function gt(t){let e=t.vertexFormat,o=t.geometry,n=t.shadowVolume,s=o.attributes.position.values,i=P(o.attributes.st)?o.attributes.st.values:void 0,r=s.length,f=t.wall,d=t.top||f,p=t.bottom||f;if(e.st||e.normal||e.tangent||e.bitangent||n){let w=t.boundingRectangle,a=t.rotationAxis,H=t.projectTo2d,x=t.ellipsoid,M=t.stRotation,C=t.perPositionHeight,R=Dt;R.x=w.x,R.y=w.y;let V=e.st?new Float32Array(2*(r/3)):void 0,u;e.normal&&(C&&d&&!f?u=o.attributes.normal.values:u=new Float32Array(r));let E=e.tangent?new Float32Array(r):void 0,A=e.bitangent?new Float32Array(r):void 0,F=n?new Float32Array(r):void 0,T=0,y=0,_=Bt,h=Mt,g=jt,j=!0,G=Gt,K=Yt;if(M!==0){let B=at.fromAxisAngle(a,M,At);G=D.fromQuaternion(B,G),B=at.fromAxisAngle(a,-M,At),K=D.fromQuaternion(B,K)}else G=D.clone(D.IDENTITY,G),K=D.clone(D.IDENTITY,K);let m=0,I=0;d&&p&&(m=r/2,I=r/3,r/=2);for(let B=0;B<r;B+=3){let k=c.fromArray(s,B,Wt);if(e.st&&!P(i)){let N=D.multiplyByVector(G,k,Vt);N=x.scaleToGeodeticSurface(N,N);let v=H([N],Ut)[0];O.subtract(v,R,v);let J=l.clamp(v.x/w.width,0,1),tt=l.clamp(v.y/w.height,0,1);p&&(V[T+I]=J,V[T+1+I]=tt),d&&(V[T]=J,V[T+1]=tt),T+=2}if(e.normal||e.tangent||e.bitangent||n){let N=y+1,v=y+2;if(f){if(B+3<r){let J=c.fromArray(s,B+3,kt);if(j){let tt=c.fromArray(s,B+r,zt);C&&St(k,J,tt,x),c.subtract(J,k,J),c.subtract(tt,k,tt),_=c.normalize(c.cross(tt,J,_),_),j=!1}c.equalsEpsilon(J,k,l.EPSILON10)&&(j=!0)}(e.tangent||e.bitangent)&&(g=x.geodeticSurfaceNormal(k,g),e.tangent&&(h=c.normalize(c.cross(g,_,h),h)))}else _=x.geodeticSurfaceNormal(k,_),(e.tangent||e.bitangent)&&(C&&(ht=c.fromArray(u,y,ht),Q=c.cross(c.UNIT_Z,ht,Q),Q=c.normalize(D.multiplyByVector(K,Q,Q),Q),e.bitangent&&(it=c.normalize(c.cross(ht,Q,it),it))),h=c.cross(c.UNIT_Z,_,h),h=c.normalize(D.multiplyByVector(K,h,h),h),e.bitangent&&(g=c.normalize(c.cross(_,h,g),g)));e.normal&&(t.wall?(u[y+m]=_.x,u[N+m]=_.y,u[v+m]=_.z):p&&(u[y+m]=-_.x,u[N+m]=-_.y,u[v+m]=-_.z),(d&&!C||f)&&(u[y]=_.x,u[N]=_.y,u[v]=_.z)),n&&(f&&(_=x.geodeticSurfaceNormal(k,_)),F[y+m]=-_.x,F[N+m]=-_.y,F[v+m]=-_.z),e.tangent&&(t.wall?(E[y+m]=h.x,E[N+m]=h.y,E[v+m]=h.z):p&&(E[y+m]=-h.x,E[N+m]=-h.y,E[v+m]=-h.z),d&&(C?(E[y]=Q.x,E[N]=Q.y,E[v]=Q.z):(E[y]=h.x,E[N]=h.y,E[v]=h.z))),e.bitangent&&(p&&(A[y+m]=g.x,A[N+m]=g.y,A[v+m]=g.z),d&&(C?(A[y]=it.x,A[N]=it.y,A[v]=it.z):(A[y]=g.x,A[N]=g.y,A[v]=g.z))),y+=3}}e.st&&!P(i)&&(o.attributes.st=new $({componentDatatype:X.FLOAT,componentsPerAttribute:2,values:V})),e.normal&&(o.attributes.normal=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:u})),e.tangent&&(o.attributes.tangent=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:E})),e.bitangent&&(o.attributes.bitangent=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:A})),n&&(o.attributes.extrudeDirection=new $({componentDatatype:X.FLOAT,componentsPerAttribute:3,values:F}))}if(t.extrude&&P(t.offsetAttribute)){let w=s.length/3,a=new Uint8Array(w);if(t.offsetAttribute===lt.TOP)d&&p||f?a=a.fill(1,0,w/2):d&&(a=a.fill(1));else{let H=t.offsetAttribute===lt.NONE?0:1;a=a.fill(H)}o.attributes.applyOffset=new $({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}return o}var Ht=[];function qt(t,e,o,n,s,i,r,f,d,p){let w={walls:[]},a;if(r||f){let u=L.createGeometryFromPositions(t,e,o,n,i,d,p),E=u.attributes.position.values,A=u.indices,F,T;if(r&&f){let y=E.concat(E);F=y.length/3,T=ct.createTypedArray(F,A.length*2),T.set(A);let _=A.length,h=F/2;for(a=0;a<_;a+=3){let g=T[a]+h,j=T[a+1]+h,G=T[a+2]+h;T[a+_]=G,T[a+1+_]=j,T[a+2+_]=g}if(u.attributes.position.values=y,i&&d.normal){let g=u.attributes.normal.values;u.attributes.normal.values=new Float32Array(y.length),u.attributes.normal.values.set(g)}if(d.st&&P(o)){let g=u.attributes.st.values;u.attributes.st.values=new Float32Array(F*2),u.attributes.st.values=g.concat(g)}u.indices=T}else if(f){for(F=E.length/3,T=ct.createTypedArray(F,A.length),a=0;a<A.length;a+=3)T[a]=A[a+2],T[a+1]=A[a+1],T[a+2]=A[a];u.indices=T}w.topAndBottom=new rt({geometry:u})}let H=s.outerRing,x=Z.fromPoints(H,t),M=x.projectPointsOntoPlane(H,Ht),C=ot.computeWindingOrder2D(M);C===dt.CLOCKWISE&&(H=H.slice().reverse());let R=L.computeWallGeometry(H,o,t,n,i,p);w.walls.push(new rt({geometry:R}));let V=s.holes;for(a=0;a<V.length;a++){let u=V[a];M=x.projectPointsOntoPlane(u,Ht),C=ot.computeWindingOrder2D(M),C===dt.COUNTER_CLOCKWISE&&(u=u.slice().reverse()),R=L.computeWallGeometry(u,o,t,n,i,p),w.walls.push(new rt({geometry:R}))}return w}function W(t){if(Y.typeOf.object("options",t),Y.typeOf.object("options.polygonHierarchy",t.polygonHierarchy),P(t.perPositionHeight)&&t.perPositionHeight&&P(t.height))throw new ft("Cannot use both options.perPositionHeight and options.height");if(P(t.arcType)&&t.arcType!==st.GEODESIC&&t.arcType!==st.RHUMB)throw new ft("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let e=t.polygonHierarchy,o=t.vertexFormat??q.DEFAULT,n=t.ellipsoid??S.default,s=t.granularity??l.RADIANS_PER_DEGREE,i=t.stRotation??0,r=t.textureCoordinates,f=t.perPositionHeight??!1,d=f&&P(t.extrudedHeight),p=t.height??0,w=t.extrudedHeight??p;if(!d){let a=Math.max(p,w);w=Math.min(p,w),p=a}this._vertexFormat=q.clone(o),this._ellipsoid=S.clone(n),this._granularity=s,this._stRotation=i,this._height=p,this._extrudedHeight=w,this._closeTop=t.closeTop??!0,this._closeBottom=t.closeBottom??!0,this._polygonHierarchy=e,this._perPositionHeight=f,this._perPositionHeightExtrude=d,this._shadowVolume=t.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=t.offsetAttribute,this._arcType=t.arcType??st.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=r,this.packedLength=L.computeHierarchyPackedLength(e,c)+S.packedLength+q.packedLength+(r?L.computeHierarchyPackedLength(r,O):1)+12}W.fromPositions=function(t){t=t??Pt.EMPTY_OBJECT,Y.defined("options.positions",t.positions);let e={polygonHierarchy:{positions:t.positions},height:t.height,extrudedHeight:t.extrudedHeight,vertexFormat:t.vertexFormat,stRotation:t.stRotation,ellipsoid:t.ellipsoid,granularity:t.granularity,perPositionHeight:t.perPositionHeight,closeTop:t.closeTop,closeBottom:t.closeBottom,offsetAttribute:t.offsetAttribute,arcType:t.arcType,textureCoordinates:t.textureCoordinates};return new W(e)};W.pack=function(t,e,o){return Y.typeOf.object("value",t),Y.defined("array",e),o=o??0,o=L.packPolygonHierarchy(t._polygonHierarchy,e,o,c),S.pack(t._ellipsoid,e,o),o+=S.packedLength,q.pack(t._vertexFormat,e,o),o+=q.packedLength,e[o++]=t._height,e[o++]=t._extrudedHeight,e[o++]=t._granularity,e[o++]=t._stRotation,e[o++]=t._perPositionHeightExtrude?1:0,e[o++]=t._perPositionHeight?1:0,e[o++]=t._closeTop?1:0,e[o++]=t._closeBottom?1:0,e[o++]=t._shadowVolume?1:0,e[o++]=t._offsetAttribute??-1,e[o++]=t._arcType,P(t._textureCoordinates)?o=L.packPolygonHierarchy(t._textureCoordinates,e,o,O):e[o++]=-1,e[o]=t.packedLength,e};var Qt=S.clone(S.UNIT_SPHERE),Zt=new q,Kt={polygonHierarchy:{}};W.unpack=function(t,e,o){Y.defined("array",t),e=e??0;let n=L.unpackPolygonHierarchy(t,e,c);e=n.startingIndex,delete n.startingIndex;let s=S.unpack(t,e,Qt);e+=S.packedLength;let i=q.unpack(t,e,Zt);e+=q.packedLength;let r=t[e++],f=t[e++],d=t[e++],p=t[e++],w=t[e++]===1,a=t[e++]===1,H=t[e++]===1,x=t[e++]===1,M=t[e++]===1,C=t[e++],R=t[e++],V=t[e]===-1?void 0:L.unpackPolygonHierarchy(t,e,O);P(V)?(e=V.startingIndex,delete V.startingIndex):e++;let u=t[e];return P(o)||(o=new W(Kt)),o._polygonHierarchy=n,o._ellipsoid=S.clone(s,o._ellipsoid),o._vertexFormat=q.clone(i,o._vertexFormat),o._height=r,o._extrudedHeight=f,o._granularity=d,o._stRotation=p,o._perPositionHeightExtrude=w,o._perPositionHeight=a,o._closeTop=H,o._closeBottom=x,o._shadowVolume=M,o._offsetAttribute=C===-1?void 0:C,o._arcType=R,o._textureCoordinates=V,o.packedLength=u,o};var Jt=new O,Xt=new O,$t=new z;function xt(t,e,o,n,s,i){let r=t.longitude,f=r>=0?r:r+l.TWO_PI;s.westOverIdl=Math.min(s.westOverIdl,f),s.eastOverIdl=Math.max(s.eastOverIdl,f),i.west=Math.min(i.west,r),i.east=Math.max(i.east,r);let d=t.getLatitude(o),p=d;if(i.south=Math.min(i.south,d),i.north=Math.max(i.north,d),n!==st.RHUMB){let H=O.subtract(e.position,t.position,Jt),x=O.dot(e.position,H)/O.dot(H,H);if(x>0&&x<1){let M=O.add(e.position,O.multiplyByScalar(H,-x,H),Xt),C=z.clone(e,$t);C.position=M;let R=C.getLatitude(o);i.south=Math.min(i.south,R),i.north=Math.max(i.north,R),Math.abs(d)>Math.abs(R)&&(p=R)}}let w=e.x*t.y-t.x*e.y,a=Math.sign(w);a!==0&&(a*=O.angleBetween(e.position,t.position)),p>=0&&(s.northAngle+=a),p<=0&&(s.southAngle+=a)}var Ct=new z,te=new z,U={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};W.computeRectangleFromPositions=function(t,e,o,n){if(Y.defined("positions",t),P(n)||(n=new _t),t.length<3)return n;n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,U.northAngle=0,U.southAngle=0,U.westOverIdl=Number.POSITIVE_INFINITY,U.eastOverIdl=Number.NEGATIVE_INFINITY;let s=t.length,i=z.fromCartesian(t[0],te);for(let r=1;r<s;r++){let f=z.fromCartesian(t[r],Ct);xt(f,i,e,o,U,n),i=z.clone(f,i)}return xt(z.fromCartesian(t[0],Ct),i,e,o,U,n),n.east-n.west>U.eastOverIdl-U.westOverIdl&&(n.west=U.westOverIdl,n.east=U.eastOverIdl,n.east>l.PI&&(n.east=n.east-l.TWO_PI),n.west>l.PI&&(n.west=n.west-l.TWO_PI)),l.equalsEpsilon(Math.abs(U.northAngle),l.TWO_PI,l.EPSILON10)&&(n.north=l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),l.equalsEpsilon(Math.abs(U.southAngle),l.TWO_PI,l.EPSILON10)&&(n.south=-l.PI_OVER_TWO,n.east=l.PI,n.west=-l.PI),n};var ee=new z;function oe(t,e,o){return t.height>=l.PI||t.width>=l.PI?z.fromCartesian(e[0],ee).tangentPlane:Z.fromPoints(e,o)}var Nt=new et;function ne(t,e,o){return(n,s)=>{if(t.height>=l.PI||t.width>=l.PI){if(t.south<0&&t.north>0){P(s)||(s=[]);for(let r=0;r<n.length;++r){let f=o.cartesianToCartographic(n[r],Nt);s[r]=new O(f.longitude/l.PI,f.latitude/l.PI_OVER_TWO)}return s.length=n.length,s}return z.fromCartesianArray(n,s)}return Z.fromPoints(e,o).projectPointsOntoPlane(n,s)}}function ie(t,e,o){if(t.height>=l.PI||t.width>=l.PI)return(s,i)=>{if(t.south<0&&t.north>0){let r=o.cartesianToCartographic(s,Nt);return P(i)||(i=new O),i.x=r.longitude/l.PI,i.y=r.latitude/l.PI_OVER_TWO,i}return z.fromCartesian(s,i)};let n=Z.fromPoints(e,o);return(s,i)=>n.projectPointsOntoPlane(s,i)}function re(t,e,o,n){return(s,i)=>!n&&(t.height>=l.PI_OVER_TWO||t.width>=2*l.PI_OVER_THREE)?L.splitPolygonsOnEquator(s,e,o,i):s}function se(t,e,o,n){if(e.height>=l.PI||e.width>=l.PI)return mt.fromRectangle(e,void 0,Et);let s=t,i=Z.fromPoints(s,o);return L.computeBoundingRectangle(i.plane.normal,i.projectPointOntoPlane.bind(i),s,n,Et)}W.createGeometry=function(t){let e=t._vertexFormat,o=t._ellipsoid,n=t._granularity,s=t._stRotation,i=t._polygonHierarchy,r=t._perPositionHeight,f=t._closeTop,d=t._closeBottom,p=t._arcType,w=t._textureCoordinates,a=P(w),H=i.positions;if(H.length<3)return;let x=t.rectangle,M=L.polygonsFromHierarchy(i,a,ne(x,H,o),!r,o,re(x,o,p,r)),C=M.hierarchy,R=M.polygons,V=function(m){return m},u=a?L.polygonsFromHierarchy(w,!0,V,!1,o).polygons:void 0;if(C.length===0)return;let E=C[0].outerRing,A=se(E,x,o,s),F=[],T=t._height,y=t._extrudedHeight,_=t._perPositionHeightExtrude||!l.equalsEpsilon(T,y,0,l.EPSILON2),h={perPositionHeight:r,vertexFormat:e,geometry:void 0,rotationAxis:oe(x,E,o).plane.normal,projectTo2d:ie(x,E,o),boundingRectangle:A,ellipsoid:o,stRotation:s,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:p},g;if(_)for(h.extrude=!0,h.top=f,h.bottom=d,h.shadowVolume=t._shadowVolume,h.offsetAttribute=t._offsetAttribute,g=0;g<R.length;g++){let m=qt(o,R[g],a?u[g]:void 0,n,C[g],r,f,d,e,p),I;f&&d?(I=m.topAndBottom,h.geometry=L.scaleToGeodeticHeightExtruded(I.geometry,T,y,o,r)):f?(I=m.topAndBottom,I.geometry.attributes.position.values=ot.scaleToGeodeticHeight(I.geometry.attributes.position.values,T,o,!r),h.geometry=I.geometry):d&&(I=m.topAndBottom,I.geometry.attributes.position.values=ot.scaleToGeodeticHeight(I.geometry.attributes.position.values,y,o,!0),h.geometry=I.geometry),(f||d)&&(h.wall=!1,I.geometry=gt(h),F.push(I));let B=m.walls;h.wall=!0;for(let k=0;k<B.length;k++){let N=B[k];h.geometry=L.scaleToGeodeticHeightExtruded(N.geometry,T,y,o,r),N.geometry=gt(h),F.push(N)}}else for(g=0;g<R.length;g++){let m=new rt({geometry:L.createGeometryFromPositions(o,R[g],a?u[g]:void 0,n,r,e,p)});if(m.geometry.attributes.position.values=ot.scaleToGeodeticHeight(m.geometry.attributes.position.values,T,o,!r),h.geometry=m.geometry,m.geometry=gt(h),P(t._offsetAttribute)){let I=m.geometry.attributes.position.values.length,B=t._offsetAttribute===lt.NONE?0:1,k=new Uint8Array(I/3).fill(B);m.geometry.attributes.applyOffset=new $({componentDatatype:X.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}F.push(m)}let j=bt.combineInstances(F)[0];j.attributes.position.values=new Float64Array(j.attributes.position.values),j.indices=ct.createTypedArray(j.attributes.position.values.length/3,j.indices);let G=j.attributes,K=Tt.fromVertices(G.position.values);return e.position||delete G.position,new ut({attributes:G,indices:j.indices,primitiveType:j.primitiveType,boundingSphere:K,offsetAttribute:t._offsetAttribute})};W.createShadowVolume=function(t,e,o){let n=t._granularity,s=t._ellipsoid,i=e(n,s),r=o(n,s);return new W({polygonHierarchy:t._polygonHierarchy,ellipsoid:s,stRotation:t._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:i,height:r,vertexFormat:q.POSITION_ONLY,shadowVolume:!0,arcType:t._arcType})};function ae(t){let e=-t._stRotation;if(e===0)return[0,0,0,1,1,0];let o=t._ellipsoid,n=t._polygonHierarchy.positions,s=t.rectangle;return ut._textureCoordinateRotationPoints(n,e,o,s)}Object.defineProperties(W.prototype,{rectangle:{get:function(){if(!P(this._rectangle)){let t=this._polygonHierarchy.positions;this._rectangle=W.computeRectangleFromPositions(t,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return P(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=ae(this)),this._textureCoordinateRotationPoints}}});var pt=W;function ce(t,e){return P(e)&&(t=pt.unpack(t,e)),t._ellipsoid=S.clone(t._ellipsoid),pt.createGeometry(t)}var Xe=ce;export{Xe as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPolygonOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createPolygonOutlineGeometry.js index c364b509f..b7b62f951 100644 --- a/plugins/feature/map/Cesium/Workers/createPolygonOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a}from"./chunk-2V6KZTKL.js";import{a as P}from"./chunk-IFR5HKVH.js";import{a as F}from"./chunk-4OIYAFXA.js";import{a as V}from"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import{a as C}from"./chunk-4W2MZV6I.js";import{a as M}from"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{a as W,b as D}from"./chunk-BKYT7QHD.js";import"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as G}from"./chunk-JQLYZQ6V.js";import{a as B}from"./chunk-J3L5WX3X.js";import{b as U,c as S,d as w}from"./chunk-AVPLM4UI.js";import{d as x}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as T}from"./chunk-WER4LUMF.js";import{a as v,d as y,f as j}from"./chunk-FGKVHLJ4.js";import{a as L}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as N,b as O}from"./chunk-ELJAHN3H.js";import{e as E}from"./chunk-3BGP4HCL.js";var Y=[],k=[];function K(e,t,r,b,l){let p=M.fromPoints(t,e).projectPointsOntoPlane(t,Y);D.computeWindingOrder2D(p)===W.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=0;if(b)for(n=new Float64Array(o*2*3),i=0;i<o;i++){let u=t[i],h=t[(i+1)%o];n[c++]=u.x,n[c++]=u.y,n[c++]=u.z,n[c++]=h.x,n[c++]=h.y,n[c++]=h.z}else{let u=0;if(l===P.GEODESIC)for(i=0;i<o;i++)u+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===P.RHUMB)for(i=0;i<o;i++)u+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(u*3),i=0;i<o;i++){let h;l===P.GEODESIC?h=a.subdivideLine(t[i],t[(i+1)%o],r,k):l===P.RHUMB&&(h=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,k));let g=h.length;for(let d=0;d<g;++d)n[c++]=h[d]}}o=n.length/3;let f=o*2,m=G.createTypedArray(o,f);for(c=0,i=0;i<o-1;i++)m[c++]=i,m[c++]=i+1;return m[c++]=o-1,m[c++]=0,new F({geometry:new S({attributes:new B({position:new w({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:U.LINES})})}function q(e,t,r,b,l){let p=M.fromPoints(t,e).projectPointsOntoPlane(t,Y);D.computeWindingOrder2D(p)===W.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=new Array(o),f=0;if(b)for(n=new Float64Array(o*2*3*2),i=0;i<o;++i){c[i]=f/3;let g=t[i],d=t[(i+1)%o];n[f++]=g.x,n[f++]=g.y,n[f++]=g.z,n[f++]=d.x,n[f++]=d.y,n[f++]=d.z}else{let g=0;if(l===P.GEODESIC)for(i=0;i<o;i++)g+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===P.RHUMB)for(i=0;i<o;i++)g+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(g*3*2),i=0;i<o;++i){c[i]=f/3;let d;l===P.GEODESIC?d=a.subdivideLine(t[i],t[(i+1)%o],r,k):l===P.RHUMB&&(d=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,k));let _=d.length;for(let R=0;R<_;++R)n[f++]=d[R]}}o=n.length/(3*2);let m=c.length,u=(o*2+m)*2,h=G.createTypedArray(o+m,u);for(f=0,i=0;i<o;++i)h[f++]=i,h[f++]=(i+1)%o,h[f++]=i+o,h[f++]=(i+1)%o+o;for(i=0;i<m;i++){let g=c[i];h[f++]=g,h[f++]=g+o}return new F({geometry:new S({attributes:new B({position:new w({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n})}),indices:h,primitiveType:U.LINES})})}function A(e){if(O.typeOf.object("options",e),O.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&E(e.height))throw new N("Cannot use both options.perPositionHeight and options.height");if(E(e.arcType)&&e.arcType!==P.GEODESIC&&e.arcType!==P.RHUMB)throw new N("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,r=e.ellipsoid??y.default,b=e.granularity??L.RADIANS_PER_DEGREE,l=e.perPositionHeight??!1,H=l&&E(e.extrudedHeight),p=e.arcType??P.GEODESIC,s=e.height??0,n=e.extrudedHeight??s;if(!H){let i=Math.max(s,n);n=Math.min(s,n),s=i}this._ellipsoid=y.clone(r),this._granularity=b,this._height=s,this._extrudedHeight=n,this._arcType=p,this._polygonHierarchy=t,this._perPositionHeight=l,this._perPositionHeightExtrude=H,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=a.computeHierarchyPackedLength(t,v)+y.packedLength+8}A.pack=function(e,t,r){return O.typeOf.object("value",e),O.defined("array",t),r=r??0,r=a.packPolygonHierarchy(e._polygonHierarchy,t,r,v),y.pack(e._ellipsoid,t,r),r+=y.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._arcType,t[r++]=e._offsetAttribute??-1,t[r]=e.packedLength,t};var J=y.clone(y.UNIT_SPHERE),Q={polygonHierarchy:{}};A.unpack=function(e,t,r){O.defined("array",e),t=t??0;let b=a.unpackPolygonHierarchy(e,t,v);t=b.startingIndex,delete b.startingIndex;let l=y.unpack(e,t,J);t+=y.packedLength;let H=e[t++],p=e[t++],s=e[t++],n=e[t++]===1,i=e[t++]===1,o=e[t++],c=e[t++],f=e[t];return E(r)||(r=new A(Q)),r._polygonHierarchy=b,r._ellipsoid=y.clone(l,r._ellipsoid),r._height=H,r._extrudedHeight=p,r._granularity=s,r._perPositionHeight=i,r._perPositionHeightExtrude=n,r._arcType=o,r._offsetAttribute=c===-1?void 0:c,r.packedLength=f,r};A.fromPositions=function(e){e=e??j.EMPTY_OBJECT,O.defined("options.positions",e.positions);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 A(t)};A.createGeometry=function(e){let t=e._ellipsoid,r=e._granularity,b=e._polygonHierarchy,l=e._perPositionHeight,H=e._arcType,p=a.polygonOutlinesFromHierarchy(b,!l,t);if(p.length===0)return;let s,n=[],i=L.chordLength(r,t.maximumRadius),o=e._height,c=e._extrudedHeight,f=e._perPositionHeightExtrude||!L.equalsEpsilon(o,c,0,L.EPSILON2),m,u;if(f)for(u=0;u<p.length;u++){if(s=q(t,p[u],i,l,H),s.geometry=a.scaleToGeodeticHeightExtruded(s.geometry,o,c,t,l),E(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length/3,_=new Uint8Array(d);e._offsetAttribute===C.TOP?_=_.fill(1,0,d/2):(m=e._offsetAttribute===C.NONE?0:1,_=_.fill(m)),s.geometry.attributes.applyOffset=new w({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}n.push(s)}else for(u=0;u<p.length;u++){if(s=K(t,p[u],i,l,H),s.geometry.attributes.position.values=D.scaleToGeodeticHeight(s.geometry.attributes.position.values,o,t,!l),E(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length;m=e._offsetAttribute===C.NONE?0:1;let _=new Uint8Array(d/3).fill(m);s.geometry.attributes.applyOffset=new w({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}n.push(s)}let h=V.combineInstances(n)[0],g=x.fromVertices(h.attributes.position.values);return new S({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};var z=A;function X(e,t){return E(t)&&(e=z.unpack(e,t)),e._ellipsoid=y.clone(e._ellipsoid),z.createGeometry(e)}var Oe=X;export{Oe as default}; +import{a}from"./chunk-76NBDD5E.js";import{a as P}from"./chunk-LXGG3JDP.js";import{a as F}from"./chunk-PICDM7L2.js";import{a as V}from"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import{a as C}from"./chunk-GNBKSQYP.js";import{a as M}from"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{a as W,b as D}from"./chunk-SIFLADX4.js";import"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as G}from"./chunk-AZINMULF.js";import{a as B}from"./chunk-ILBQ77ZM.js";import{b as U,c as S,d as w}from"./chunk-7RNSURKI.js";import{c as x}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as T}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as y}from"./chunk-KP72RGCH.js";import{a as v,c as j}from"./chunk-OSVSBQDY.js";import{a as L}from"./chunk-LZC73BOP.js";import{a as N,b as O}from"./chunk-OU2IPMYE.js";import{f as E}from"./chunk-H7SJWKIY.js";var Y=[],k=[];function K(e,t,r,b,l){let p=M.fromPoints(t,e).projectPointsOntoPlane(t,Y);D.computeWindingOrder2D(p)===W.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=0;if(b)for(n=new Float64Array(o*2*3),i=0;i<o;i++){let u=t[i],h=t[(i+1)%o];n[c++]=u.x,n[c++]=u.y,n[c++]=u.z,n[c++]=h.x,n[c++]=h.y,n[c++]=h.z}else{let u=0;if(l===P.GEODESIC)for(i=0;i<o;i++)u+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===P.RHUMB)for(i=0;i<o;i++)u+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(u*3),i=0;i<o;i++){let h;l===P.GEODESIC?h=a.subdivideLine(t[i],t[(i+1)%o],r,k):l===P.RHUMB&&(h=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,k));let g=h.length;for(let d=0;d<g;++d)n[c++]=h[d]}}o=n.length/3;let f=o*2,m=G.createTypedArray(o,f);for(c=0,i=0;i<o-1;i++)m[c++]=i,m[c++]=i+1;return m[c++]=o-1,m[c]=0,new F({geometry:new S({attributes:new B({position:new w({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:U.LINES})})}function q(e,t,r,b,l){let p=M.fromPoints(t,e).projectPointsOntoPlane(t,Y);D.computeWindingOrder2D(p)===W.CLOCKWISE&&(p.reverse(),t=t.slice().reverse());let n,i,o=t.length,c=new Array(o),f=0;if(b)for(n=new Float64Array(o*2*3*2),i=0;i<o;++i){c[i]=f/3;let g=t[i],d=t[(i+1)%o];n[f++]=g.x,n[f++]=g.y,n[f++]=g.z,n[f++]=d.x,n[f++]=d.y,n[f++]=d.z}else{let g=0;if(l===P.GEODESIC)for(i=0;i<o;i++)g+=a.subdivideLineCount(t[i],t[(i+1)%o],r);else if(l===P.RHUMB)for(i=0;i<o;i++)g+=a.subdivideRhumbLineCount(e,t[i],t[(i+1)%o],r);for(n=new Float64Array(g*3*2),i=0;i<o;++i){c[i]=f/3;let d;l===P.GEODESIC?d=a.subdivideLine(t[i],t[(i+1)%o],r,k):l===P.RHUMB&&(d=a.subdivideRhumbLine(e,t[i],t[(i+1)%o],r,k));let _=d.length;for(let R=0;R<_;++R)n[f++]=d[R]}}o=n.length/6;let m=c.length,u=(o*2+m)*2,h=G.createTypedArray(o+m,u);for(f=0,i=0;i<o;++i)h[f++]=i,h[f++]=(i+1)%o,h[f++]=i+o,h[f++]=(i+1)%o+o;for(i=0;i<m;i++){let g=c[i];h[f++]=g,h[f++]=g+o}return new F({geometry:new S({attributes:new B({position:new w({componentDatatype:T.DOUBLE,componentsPerAttribute:3,values:n})}),indices:h,primitiveType:U.LINES})})}function A(e){if(O.typeOf.object("options",e),O.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&E(e.height))throw new N("Cannot use both options.perPositionHeight and options.height");if(E(e.arcType)&&e.arcType!==P.GEODESIC&&e.arcType!==P.RHUMB)throw new N("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,r=e.ellipsoid??y.default,b=e.granularity??L.RADIANS_PER_DEGREE,l=e.perPositionHeight??!1,H=l&&E(e.extrudedHeight),p=e.arcType??P.GEODESIC,s=e.height??0,n=e.extrudedHeight??s;if(!H){let i=Math.max(s,n);n=Math.min(s,n),s=i}this._ellipsoid=y.clone(r),this._granularity=b,this._height=s,this._extrudedHeight=n,this._arcType=p,this._polygonHierarchy=t,this._perPositionHeight=l,this._perPositionHeightExtrude=H,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=a.computeHierarchyPackedLength(t,v)+y.packedLength+8}A.pack=function(e,t,r){return O.typeOf.object("value",e),O.defined("array",t),r=r??0,r=a.packPolygonHierarchy(e._polygonHierarchy,t,r,v),y.pack(e._ellipsoid,t,r),r+=y.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._arcType,t[r++]=e._offsetAttribute??-1,t[r]=e.packedLength,t};var J=y.clone(y.UNIT_SPHERE),Q={polygonHierarchy:{}};A.unpack=function(e,t,r){O.defined("array",e),t=t??0;let b=a.unpackPolygonHierarchy(e,t,v);t=b.startingIndex,delete b.startingIndex;let l=y.unpack(e,t,J);t+=y.packedLength;let H=e[t++],p=e[t++],s=e[t++],n=e[t++]===1,i=e[t++]===1,o=e[t++],c=e[t++],f=e[t];return E(r)||(r=new A(Q)),r._polygonHierarchy=b,r._ellipsoid=y.clone(l,r._ellipsoid),r._height=H,r._extrudedHeight=p,r._granularity=s,r._perPositionHeight=i,r._perPositionHeightExtrude=n,r._arcType=o,r._offsetAttribute=c===-1?void 0:c,r.packedLength=f,r};A.fromPositions=function(e){e=e??j.EMPTY_OBJECT,O.defined("options.positions",e.positions);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 A(t)};A.createGeometry=function(e){let t=e._ellipsoid,r=e._granularity,b=e._polygonHierarchy,l=e._perPositionHeight,H=e._arcType,p=a.polygonOutlinesFromHierarchy(b,!l,t);if(p.length===0)return;let s,n=[],i=L.chordLength(r,t.maximumRadius),o=e._height,c=e._extrudedHeight,f=e._perPositionHeightExtrude||!L.equalsEpsilon(o,c,0,L.EPSILON2),m,u;if(f)for(u=0;u<p.length;u++){if(s=q(t,p[u],i,l,H),s.geometry=a.scaleToGeodeticHeightExtruded(s.geometry,o,c,t,l),E(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length/3,_=new Uint8Array(d);e._offsetAttribute===C.TOP?_=_.fill(1,0,d/2):(m=e._offsetAttribute===C.NONE?0:1,_=_.fill(m)),s.geometry.attributes.applyOffset=new w({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}n.push(s)}else for(u=0;u<p.length;u++){if(s=K(t,p[u],i,l,H),s.geometry.attributes.position.values=D.scaleToGeodeticHeight(s.geometry.attributes.position.values,o,t,!l),E(e._offsetAttribute)){let d=s.geometry.attributes.position.values.length;m=e._offsetAttribute===C.NONE?0:1;let _=new Uint8Array(d/3).fill(m);s.geometry.attributes.applyOffset=new w({componentDatatype:T.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}n.push(s)}let h=V.combineInstances(n)[0],g=x.fromVertices(h.attributes.position.values);return new S({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})};var z=A;function X(e,t){return E(t)&&(e=z.unpack(e,t)),e._ellipsoid=y.clone(e._ellipsoid),z.createGeometry(e)}var Oe=X;export{Oe as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPolylineGeometry.js b/plugins/feature/map/Cesium/Workers/createPolylineGeometry.js index 9e9db2f42..773d6e25f 100644 --- a/plugins/feature/map/Cesium/Workers/createPolylineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPolylineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as m}from"./chunk-Q4LSC5X3.js";import{a as R}from"./chunk-IFR5HKVH.js";import{a as N}from"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import{a as g}from"./chunk-S3L7VZFL.js";import{a as le}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as se}from"./chunk-JQLYZQ6V.js";import{a as ce}from"./chunk-J3L5WX3X.js";import{a as ne,b as re,c as ie,d as x}from"./chunk-AVPLM4UI.js";import{d as oe}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as V}from"./chunk-WER4LUMF.js";import{a as p,d as u,f as te}from"./chunk-FGKVHLJ4.js";import{a as j}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as F}from"./chunk-ELJAHN3H.js";import{e as h}from"./chunk-3BGP4HCL.js";var me=[];function Ae(e,o,t,n,c){let s=me;s.length=c;let l,k=t.red,a=t.green,r=t.blue,w=t.alpha,E=n.red,i=n.green,f=n.blue,b=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);return s}let G=(E-k)/c,z=(i-a)/c,M=(f-r)/c,S=(b-w)/c;for(l=0;l<c;l++)s[l]=new m(k+l*G,a+l*z,r+l*M,w+l*S);return s}function q(e){e=e??te.EMPTY_OBJECT;let o=e.positions,t=e.colors,n=e.width??1,c=e.colorsPerVertex??!1;if(!h(o)||o.length<2)throw new F("At least two positions are required.");if(typeof n!="number")throw new F("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))throw new F("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=g.clone(e.vertexFormat??g.DEFAULT),this._arcType=e.arcType??R.GEODESIC,this._granularity=e.granularity??j.RADIANS_PER_DEGREE,this._ellipsoid=u.clone(e.ellipsoid??u.default),this._workerName="createPolylineGeometry";let s=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+g.packedLength+4}q.pack=function(e,o,t){if(!h(e))throw new F("value is required");if(!h(o))throw new F("array is required");t=t??0;let n,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);let l=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);return u.pack(e._ellipsoid,o,t),t+=u.packedLength,g.pack(e._vertexFormat,o,t),t+=g.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};var de=u.clone(u.UNIT_SPHERE),ue=new g,O={positions:void 0,colors:void 0,ellipsoid:de,vertexFormat:ue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};q.unpack=function(e,o,t){if(!h(e))throw new F("array is required");o=o??0;let n,c=e[o++],s=new Array(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];let l=c>0?new Array(c):void 0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);let k=u.unpack(e,o,de);o+=u.packedLength;let a=g.unpack(e,o,ue);o+=g.packedLength;let r=e[o++],w=e[o++]===1,E=e[o++],i=e[o];return h(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(k,t._ellipsoid),t._vertexFormat=g.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=E,t._granularity=i,t):(O.positions=s,O.colors=l,O.width=r,O.colorsPerVertex=w,O.arcType=E,O.granularity=i,new q(O))};var pe=new p,ae=new p,fe=new p,he=new p;q.createGeometry=function(e){let o=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,k=e._ellipsoid,a,r,w,E=[],i=le(e._positions,p.equalsEpsilon,!1,E);if(h(n)&&E.length>0){let d=0,P=E[0];n=n.filter(function(U,L){let A=!1;return c?A=L===P||L===0&&P===1:A=L+1===P,A?(d++,P=E[d],!1):!0})}let f=i.length;if(f<2||o<=0)return;if(s===R.GEODESIC||s===R.RHUMB){let d,P;s===R.GEODESIC?(d=j.chordLength(l,k.maximumRadius),P=N.numberOfPoints):(d=l,P=N.numberOfPointsRhumbLine);let U=N.extractHeights(i,k);if(h(n)){let L=1;for(a=0;a<f-1;++a)L+=P(i[a],i[a+1],d);let A=new Array(L),y=0;for(a=0;a<f-1;++a){let X=i[a],Z=i[a+1],$=n[a],I=P(X,Z,d);if(c&&a<L){let _e=n[a+1],ee=Ae(X,Z,$,_e,I),Pe=ee.length;for(r=0;r<Pe;++r)A[y++]=ee[r]}else for(r=0;r<I;++r)A[y++]=m.clone($)}A[y]=m.clone(n[n.length-1]),n=A,me.length=0}s===R.GEODESIC?i=N.generateCartesianArc({positions:i,minDistance:d,ellipsoid:k,height:U}):i=N.generateCartesianRhumbArc({positions:i,granularity:d,ellipsoid:k,height:U})}f=i.length;let b=f*4-4,G=new Float64Array(b*3),z=new Float64Array(b*3),M=new Float64Array(b*3),S=new Float32Array(b*2),Y=t.st?new Float32Array(b*2):void 0,T=h(n)?new Uint8Array(b*4):void 0,H=0,K=0,Q=0,W=0,_;for(r=0;r<f;++r){r===0?(_=pe,p.subtract(i[0],i[1],_),p.add(i[0],_,_)):_=i[r-1],p.clone(_,fe),p.clone(i[r],ae),r===f-1?(_=pe,p.subtract(i[f-1],i[f-2],_),p.add(i[f-1],_,_)):_=i[r+1],p.clone(_,he);let d,P;h(T)&&(r!==0&&!c?d=n[r-1]:d=n[r],r!==f-1&&(P=n[r]));let U=r===0?2:0,L=r===f-1?2:4;for(w=U;w<L;++w){p.pack(ae,G,H),p.pack(fe,z,H),p.pack(he,M,H),H+=3;let A=w-2<0?-1:1;if(S[K++]=2*(w%2)-1,S[K++]=A*o,t.st&&(Y[Q++]=r/(f-1),Y[Q++]=Math.max(S[K-2],0)),h(T)){let y=w<2?d:P;T[W++]=m.floatToByte(y.red),T[W++]=m.floatToByte(y.green),T[W++]=m.floatToByte(y.blue),T[W++]=m.floatToByte(y.alpha)}}}let D=new ce;D.position=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:G}),D.prevPosition=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:z}),D.nextPosition=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:M}),D.expandAndWidth=new x({componentDatatype:V.FLOAT,componentsPerAttribute:2,values:S}),t.st&&(D.st=new x({componentDatatype:V.FLOAT,componentsPerAttribute:2,values:Y})),h(T)&&(D.color=new x({componentDatatype:V.UNSIGNED_BYTE,componentsPerAttribute:4,values:T,normalize:!0}));let v=se.createTypedArray(b,f*6-6),C=0,B=0,we=f-1;for(r=0;r<we;++r)v[B++]=C,v[B++]=C+2,v[B++]=C+1,v[B++]=C+1,v[B++]=C+2,v[B++]=C+3,C+=4;return new ie({attributes:D,indices:v,primitiveType:re.TRIANGLES,boundingSphere:oe.fromPoints(i),geometryType:ne.POLYLINES})};var J=q;function ge(e,o){return h(o)&&(e=J.unpack(e,o)),e._ellipsoid=u.clone(e._ellipsoid),J.createGeometry(e)}var We=ge;export{We as default}; +import{a as m}from"./chunk-RDRVGSTZ.js";import{a as R}from"./chunk-LXGG3JDP.js";import{a as N}from"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import{a as g}from"./chunk-FZSSAWMQ.js";import{a as le}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as se}from"./chunk-AZINMULF.js";import{a as ce}from"./chunk-ILBQ77ZM.js";import{a as ne,b as re,c as ie,d as x}from"./chunk-7RNSURKI.js";import{c as oe}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as V}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as u}from"./chunk-KP72RGCH.js";import{a as p,c as te}from"./chunk-OSVSBQDY.js";import{a as j}from"./chunk-LZC73BOP.js";import{a as F}from"./chunk-OU2IPMYE.js";import{f as h}from"./chunk-H7SJWKIY.js";var me=[];function Ae(e,o,t,n,c){let s=me;s.length=c;let l,k=t.red,a=t.green,r=t.blue,w=t.alpha,E=n.red,i=n.green,f=n.blue,b=n.alpha;if(m.equals(t,n)){for(l=0;l<c;l++)s[l]=m.clone(t);return s}let G=(E-k)/c,z=(i-a)/c,M=(f-r)/c,S=(b-w)/c;for(l=0;l<c;l++)s[l]=new m(k+l*G,a+l*z,r+l*M,w+l*S);return s}function q(e){e=e??te.EMPTY_OBJECT;let o=e.positions,t=e.colors,n=e.width??1,c=e.colorsPerVertex??!1;if(!h(o)||o.length<2)throw new F("At least two positions are required.");if(typeof n!="number")throw new F("width must be a number");if(h(t)&&(c&&t.length<o.length||!c&&t.length<o.length-1))throw new F("colors has an invalid length.");this._positions=o,this._colors=t,this._width=n,this._colorsPerVertex=c,this._vertexFormat=g.clone(e.vertexFormat??g.DEFAULT),this._arcType=e.arcType??R.GEODESIC,this._granularity=e.granularity??j.RADIANS_PER_DEGREE,this._ellipsoid=u.clone(e.ellipsoid??u.default),this._workerName="createPolylineGeometry";let s=1+o.length*p.packedLength;s+=h(t)?1+t.length*m.packedLength:1,this.packedLength=s+u.packedLength+g.packedLength+4}q.pack=function(e,o,t){if(!h(e))throw new F("value is required");if(!h(o))throw new F("array is required");t=t??0;let n,c=e._positions,s=c.length;for(o[t++]=s,n=0;n<s;++n,t+=p.packedLength)p.pack(c[n],o,t);let l=e._colors;for(s=h(l)?l.length:0,o[t++]=s,n=0;n<s;++n,t+=m.packedLength)m.pack(l[n],o,t);return u.pack(e._ellipsoid,o,t),t+=u.packedLength,g.pack(e._vertexFormat,o,t),t+=g.packedLength,o[t++]=e._width,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o};var de=u.clone(u.UNIT_SPHERE),ue=new g,O={positions:void 0,colors:void 0,ellipsoid:de,vertexFormat:ue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};q.unpack=function(e,o,t){if(!h(e))throw new F("array is required");o=o??0;let n,c=e[o++],s=new Array(c);for(n=0;n<c;++n,o+=p.packedLength)s[n]=p.unpack(e,o);c=e[o++];let l=c>0?new Array(c):void 0;for(n=0;n<c;++n,o+=m.packedLength)l[n]=m.unpack(e,o);let k=u.unpack(e,o,de);o+=u.packedLength;let a=g.unpack(e,o,ue);o+=g.packedLength;let r=e[o++],w=e[o++]===1,E=e[o++],i=e[o];return h(t)?(t._positions=s,t._colors=l,t._ellipsoid=u.clone(k,t._ellipsoid),t._vertexFormat=g.clone(a,t._vertexFormat),t._width=r,t._colorsPerVertex=w,t._arcType=E,t._granularity=i,t):(O.positions=s,O.colors=l,O.width=r,O.colorsPerVertex=w,O.arcType=E,O.granularity=i,new q(O))};var pe=new p,ae=new p,fe=new p,he=new p;q.createGeometry=function(e){let o=e._width,t=e._vertexFormat,n=e._colors,c=e._colorsPerVertex,s=e._arcType,l=e._granularity,k=e._ellipsoid,a,r,w,E=[],i=le(e._positions,p.equalsEpsilon,!1,E);if(h(n)&&E.length>0){let d=0,P=E[0];n=n.filter(function(U,L){let A;return c?A=L===P||L===0&&P===1:A=L+1===P,A?(d++,P=E[d],!1):!0})}let f=i.length;if(f<2||o<=0)return;if(s===R.GEODESIC||s===R.RHUMB){let d,P;s===R.GEODESIC?(d=j.chordLength(l,k.maximumRadius),P=N.numberOfPoints):(d=l,P=N.numberOfPointsRhumbLine);let U=N.extractHeights(i,k);if(h(n)){let L=1;for(a=0;a<f-1;++a)L+=P(i[a],i[a+1],d);let A=new Array(L),y=0;for(a=0;a<f-1;++a){let X=i[a],Z=i[a+1],$=n[a],I=P(X,Z,d);if(c&&a<L){let _e=n[a+1],ee=Ae(X,Z,$,_e,I),Pe=ee.length;for(r=0;r<Pe;++r)A[y++]=ee[r]}else for(r=0;r<I;++r)A[y++]=m.clone($)}A[y]=m.clone(n[n.length-1]),n=A,me.length=0}s===R.GEODESIC?i=N.generateCartesianArc({positions:i,minDistance:d,ellipsoid:k,height:U}):i=N.generateCartesianRhumbArc({positions:i,granularity:d,ellipsoid:k,height:U})}f=i.length;let b=f*4-4,G=new Float64Array(b*3),z=new Float64Array(b*3),M=new Float64Array(b*3),S=new Float32Array(b*2),Y=t.st?new Float32Array(b*2):void 0,T=h(n)?new Uint8Array(b*4):void 0,H=0,K=0,Q=0,W=0,_;for(r=0;r<f;++r){r===0?(_=pe,p.subtract(i[0],i[1],_),p.add(i[0],_,_)):_=i[r-1],p.clone(_,fe),p.clone(i[r],ae),r===f-1?(_=pe,p.subtract(i[f-1],i[f-2],_),p.add(i[f-1],_,_)):_=i[r+1],p.clone(_,he);let d,P;h(T)&&(r!==0&&!c?d=n[r-1]:d=n[r],r!==f-1&&(P=n[r]));let U=r===0?2:0,L=r===f-1?2:4;for(w=U;w<L;++w){p.pack(ae,G,H),p.pack(fe,z,H),p.pack(he,M,H),H+=3;let A=w-2<0?-1:1;if(S[K++]=2*(w%2)-1,S[K++]=A*o,t.st&&(Y[Q++]=r/(f-1),Y[Q++]=Math.max(S[K-2],0)),h(T)){let y=w<2?d:P;T[W++]=m.floatToByte(y.red),T[W++]=m.floatToByte(y.green),T[W++]=m.floatToByte(y.blue),T[W++]=m.floatToByte(y.alpha)}}}let D=new ce;D.position=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:G}),D.prevPosition=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:z}),D.nextPosition=new x({componentDatatype:V.DOUBLE,componentsPerAttribute:3,values:M}),D.expandAndWidth=new x({componentDatatype:V.FLOAT,componentsPerAttribute:2,values:S}),t.st&&(D.st=new x({componentDatatype:V.FLOAT,componentsPerAttribute:2,values:Y})),h(T)&&(D.color=new x({componentDatatype:V.UNSIGNED_BYTE,componentsPerAttribute:4,values:T,normalize:!0}));let v=se.createTypedArray(b,f*6-6),C=0,B=0,we=f-1;for(r=0;r<we;++r)v[B++]=C,v[B++]=C+2,v[B++]=C+1,v[B++]=C+1,v[B++]=C+2,v[B++]=C+3,C+=4;return new ie({attributes:D,indices:v,primitiveType:re.TRIANGLES,boundingSphere:oe.fromPoints(i),geometryType:ne.POLYLINES})};var J=q;function ge(e,o){return h(o)&&(e=J.unpack(e,o)),e._ellipsoid=u.clone(e._ellipsoid),J.createGeometry(e)}var We=ge;export{We as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPolylineVolumeGeometry.js b/plugins/feature/map/Cesium/Workers/createPolylineVolumeGeometry.js index ddc4ac807..bfa35c963 100644 --- a/plugins/feature/map/Cesium/Workers/createPolylineVolumeGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPolylineVolumeGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as W}from"./chunk-S5KJ4JQS.js";import{a as U}from"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import{a as x,b as I,c as j}from"./chunk-3RSLEP7W.js";import"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import{a as g}from"./chunk-S3L7VZFL.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{a as $,b as M}from"./chunk-BKYT7QHD.js";import{a as Z}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as X}from"./chunk-JQLYZQ6V.js";import{a as Q}from"./chunk-J3L5WX3X.js";import{b as V,c as Y,d as B}from"./chunk-AVPLM4UI.js";import{d as K}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as N}from"./chunk-WER4LUMF.js";import{a as E,c as D,d as f,f as J}from"./chunk-FGKVHLJ4.js";import{a as H}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as A}from"./chunk-ELJAHN3H.js";import{e as _}from"./chunk-3BGP4HCL.js";function oe(t,e,n,o){let m=new Q;o.position&&(m.position=new B({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:t}));let i=e.length,u=t.length/3,w=(u-i*2)/(i*2),L=M.triangulate(e),R=(w-1)*i*6+L.length*2,r=X.createTypedArray(u,R),l,s,d,T,b,F,q=i*2,p=0;for(l=0;l<w-1;l++){for(s=0;s<i-1;s++)d=s*2+l*i*2,F=d+q,T=d+1,b=T+q,r[p++]=T,r[p++]=d,r[p++]=b,r[p++]=b,r[p++]=d,r[p++]=F;d=i*2-2+l*i*2,T=d+1,b=T+q,F=d+q,r[p++]=T,r[p++]=d,r[p++]=b,r[p++]=b,r[p++]=d,r[p++]=F}if(o.st||o.tangent||o.bitangent){let c=new Float32Array(u*2),C=1/(w-1),P=1/n.height,O=n.height/2,y,a,h=0;for(l=0;l<w;l++){for(y=l*C,a=P*(e[0].y+O),c[h++]=y,c[h++]=a,s=1;s<i;s++)a=P*(e[s].y+O),c[h++]=y,c[h++]=a,c[h++]=y,c[h++]=a;a=P*(e[0].y+O),c[h++]=y,c[h++]=a}for(s=0;s<i;s++)y=0,a=P*(e[s].y+O),c[h++]=y,c[h++]=a;for(s=0;s<i;s++)y=(w-1)*C,a=P*(e[s].y+O),c[h++]=y,c[h++]=a;m.st=new B({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})}let G=u-i*2;for(l=0;l<L.length;l+=3){let c=L[l]+G,C=L[l+1]+G,P=L[l+2]+G;r[p++]=c,r[p++]=C,r[p++]=P,r[p++]=P+i,r[p++]=C+i,r[p++]=c+i}let k=new Y({attributes:m,indices:r,boundingSphere:K.fromVertices(t),primitiveType:V.TRIANGLES});if(o.normal&&(k=U.computeNormal(k)),o.tangent||o.bitangent){try{k=U.computeTangentAndBitangent(k)}catch{I("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(k.attributes.tangent=void 0),o.bitangent||(k.attributes.bitangent=void 0),o.st||(k.attributes.st=void 0)}return k}function v(t){t=t??J.EMPTY_OBJECT;let e=t.polylinePositions,n=t.shapePositions;if(!_(e))throw new A("options.polylinePositions is required.");if(!_(n))throw new A("options.shapePositions is required.");this._positions=e,this._shape=n,this._ellipsoid=f.clone(t.ellipsoid??f.default),this._cornerType=t.cornerType??x.ROUNDED,this._vertexFormat=g.clone(t.vertexFormat??g.DEFAULT),this._granularity=t.granularity??H.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let o=1+e.length*E.packedLength;o+=1+n.length*D.packedLength,this.packedLength=o+f.packedLength+g.packedLength+2}v.pack=function(t,e,n){if(!_(t))throw new A("value is required");if(!_(e))throw new A("array is required");n=n??0;let o,m=t._positions,i=m.length;for(e[n++]=i,o=0;o<i;++o,n+=E.packedLength)E.pack(m[o],e,n);let u=t._shape;for(i=u.length,e[n++]=i,o=0;o<i;++o,n+=D.packedLength)D.pack(u[o],e,n);return f.pack(t._ellipsoid,e,n),n+=f.packedLength,g.pack(t._vertexFormat,e,n),n+=g.packedLength,e[n++]=t._cornerType,e[n]=t._granularity,e};var ee=f.clone(f.UNIT_SPHERE),te=new g,S={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ee,vertexFormat:te,cornerType:void 0,granularity:void 0};v.unpack=function(t,e,n){if(!_(t))throw new A("array is required");e=e??0;let o,m=t[e++],i=new Array(m);for(o=0;o<m;++o,e+=E.packedLength)i[o]=E.unpack(t,e);m=t[e++];let u=new Array(m);for(o=0;o<m;++o,e+=D.packedLength)u[o]=D.unpack(t,e);let w=f.unpack(t,e,ee);e+=f.packedLength;let L=g.unpack(t,e,te);e+=g.packedLength;let R=t[e++],r=t[e];return _(n)?(n._positions=i,n._shape=u,n._ellipsoid=f.clone(w,n._ellipsoid),n._vertexFormat=g.clone(L,n._vertexFormat),n._cornerType=R,n._granularity=r,n):(S.polylinePositions=i,S.shapePositions=u,S.cornerType=R,S.granularity=r,new v(S))};var ne=new W;v.createGeometry=function(t){let e=t._positions,n=Z(e,E.equalsEpsilon),o=t._shape;if(o=j.removeDuplicatesFromShape(o),n.length<2||o.length<3)return;M.computeWindingOrder2D(o)===$.CLOCKWISE&&o.reverse();let m=W.fromPoints(o,ne),i=j.computePositions(n,o,m,t,!0);return oe(i,o,m,t._vertexFormat)};var z=v;function ie(t,e){return _(e)&&(t=z.unpack(t,e)),t._ellipsoid=f.clone(t._ellipsoid),z.createGeometry(t)}var Re=ie;export{Re as default}; +import{a as W}from"./chunk-YAU2WIVW.js";import{a as U}from"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import{a as x,b as I,c as j}from"./chunk-LHXP7CH5.js";import"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import{a as g}from"./chunk-FZSSAWMQ.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{a as $,b as M}from"./chunk-SIFLADX4.js";import{a as Z}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as X}from"./chunk-AZINMULF.js";import{a as Q}from"./chunk-ILBQ77ZM.js";import{b as V,c as Y,d as B}from"./chunk-7RNSURKI.js";import{c as K}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as N}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{b as D,c as f}from"./chunk-KP72RGCH.js";import{a as E,c as J}from"./chunk-OSVSBQDY.js";import{a as H}from"./chunk-LZC73BOP.js";import{a as A}from"./chunk-OU2IPMYE.js";import{f as _}from"./chunk-H7SJWKIY.js";function oe(t,e,n,o){let m=new Q;o.position&&(m.position=new B({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:t}));let i=e.length,u=t.length/3,w=(u-i*2)/(i*2),L=M.triangulate(e),R=(w-1)*i*6+L.length*2,r=X.createTypedArray(u,R),l,s,d,T,b,F,q=i*2,p=0;for(l=0;l<w-1;l++){for(s=0;s<i-1;s++)d=s*2+l*i*2,F=d+q,T=d+1,b=T+q,r[p++]=T,r[p++]=d,r[p++]=b,r[p++]=b,r[p++]=d,r[p++]=F;d=i*2-2+l*i*2,T=d+1,b=T+q,F=d+q,r[p++]=T,r[p++]=d,r[p++]=b,r[p++]=b,r[p++]=d,r[p++]=F}if(o.st||o.tangent||o.bitangent){let c=new Float32Array(u*2),C=1/(w-1),P=1/n.height,O=n.height/2,y,a,h=0;for(l=0;l<w;l++){for(y=l*C,a=P*(e[0].y+O),c[h++]=y,c[h++]=a,s=1;s<i;s++)a=P*(e[s].y+O),c[h++]=y,c[h++]=a,c[h++]=y,c[h++]=a;a=P*(e[0].y+O),c[h++]=y,c[h++]=a}for(s=0;s<i;s++)y=0,a=P*(e[s].y+O),c[h++]=y,c[h++]=a;for(s=0;s<i;s++)y=(w-1)*C,a=P*(e[s].y+O),c[h++]=y,c[h++]=a;m.st=new B({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})}let G=u-i*2;for(l=0;l<L.length;l+=3){let c=L[l]+G,C=L[l+1]+G,P=L[l+2]+G;r[p++]=c,r[p++]=C,r[p++]=P,r[p++]=P+i,r[p++]=C+i,r[p++]=c+i}let k=new Y({attributes:m,indices:r,boundingSphere:K.fromVertices(t),primitiveType:V.TRIANGLES});if(o.normal&&(k=U.computeNormal(k)),o.tangent||o.bitangent){try{k=U.computeTangentAndBitangent(k)}catch{I("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(k.attributes.tangent=void 0),o.bitangent||(k.attributes.bitangent=void 0),o.st||(k.attributes.st=void 0)}return k}function v(t){t=t??J.EMPTY_OBJECT;let e=t.polylinePositions,n=t.shapePositions;if(!_(e))throw new A("options.polylinePositions is required.");if(!_(n))throw new A("options.shapePositions is required.");this._positions=e,this._shape=n,this._ellipsoid=f.clone(t.ellipsoid??f.default),this._cornerType=t.cornerType??x.ROUNDED,this._vertexFormat=g.clone(t.vertexFormat??g.DEFAULT),this._granularity=t.granularity??H.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let o=1+e.length*E.packedLength;o+=1+n.length*D.packedLength,this.packedLength=o+f.packedLength+g.packedLength+2}v.pack=function(t,e,n){if(!_(t))throw new A("value is required");if(!_(e))throw new A("array is required");n=n??0;let o,m=t._positions,i=m.length;for(e[n++]=i,o=0;o<i;++o,n+=E.packedLength)E.pack(m[o],e,n);let u=t._shape;for(i=u.length,e[n++]=i,o=0;o<i;++o,n+=D.packedLength)D.pack(u[o],e,n);return f.pack(t._ellipsoid,e,n),n+=f.packedLength,g.pack(t._vertexFormat,e,n),n+=g.packedLength,e[n++]=t._cornerType,e[n]=t._granularity,e};var ee=f.clone(f.UNIT_SPHERE),te=new g,S={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ee,vertexFormat:te,cornerType:void 0,granularity:void 0};v.unpack=function(t,e,n){if(!_(t))throw new A("array is required");e=e??0;let o,m=t[e++],i=new Array(m);for(o=0;o<m;++o,e+=E.packedLength)i[o]=E.unpack(t,e);m=t[e++];let u=new Array(m);for(o=0;o<m;++o,e+=D.packedLength)u[o]=D.unpack(t,e);let w=f.unpack(t,e,ee);e+=f.packedLength;let L=g.unpack(t,e,te);e+=g.packedLength;let R=t[e++],r=t[e];return _(n)?(n._positions=i,n._shape=u,n._ellipsoid=f.clone(w,n._ellipsoid),n._vertexFormat=g.clone(L,n._vertexFormat),n._cornerType=R,n._granularity=r,n):(S.polylinePositions=i,S.shapePositions=u,S.cornerType=R,S.granularity=r,new v(S))};var ne=new W;v.createGeometry=function(t){let e=t._positions,n=Z(e,E.equalsEpsilon),o=t._shape;if(o=j.removeDuplicatesFromShape(o),n.length<2||o.length<3)return;M.computeWindingOrder2D(o)===$.CLOCKWISE&&o.reverse();let m=W.fromPoints(o,ne),i=j.computePositions(n,o,m,t,!0);return oe(i,o,m,t._vertexFormat)};var z=v;function ie(t,e){return _(e)&&(t=z.unpack(t,e)),t._ellipsoid=f.clone(t._ellipsoid),z.createGeometry(t)}var Re=ie;export{Re as default}; diff --git a/plugins/feature/map/Cesium/Workers/createPolylineVolumeOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createPolylineVolumeOutlineGeometry.js index 47280c7d6..9cc61001b 100644 --- a/plugins/feature/map/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createPolylineVolumeOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as k}from"./chunk-S5KJ4JQS.js";import{a as N,c as w}from"./chunk-3RSLEP7W.js";import"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import{a as v,b as G}from"./chunk-BKYT7QHD.js";import{a as q}from"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as g}from"./chunk-JQLYZQ6V.js";import{a as O}from"./chunk-J3L5WX3X.js";import{b as A,c as R,d as S}from"./chunk-AVPLM4UI.js";import{d as C}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as b}from"./chunk-WER4LUMF.js";import{a as d,c as y,d as s,f as D}from"./chunk-FGKVHLJ4.js";import{a as T}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a}from"./chunk-ELJAHN3H.js";import{e as u}from"./chunk-3BGP4HCL.js";function W(o,i){let t=new O;t.position=new S({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:o});let e=i.length,r=t.position.values.length/3,f=o.length/3/e,p=g.createTypedArray(r,2*e*(f+1)),m,n,l=0;m=0;let h=m*e;for(n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=f-1,h=m*e,n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=0;m<f-1;m++){let L=e*m,U=L+e;for(n=0;n<e;n++)p[l++]=n+L,p[l++]=n+U}return new R({attributes:t,indices:g.createTypedArray(r,p),boundingSphere:C.fromVertices(o),primitiveType:A.LINES})}function P(o){o=o??D.EMPTY_OBJECT;let i=o.polylinePositions,t=o.shapePositions;if(!u(i))throw new a("options.polylinePositions is required.");if(!u(t))throw new a("options.shapePositions is required.");this._positions=i,this._shape=t,this._ellipsoid=s.clone(o.ellipsoid??s.default),this._cornerType=o.cornerType??N.ROUNDED,this._granularity=o.granularity??T.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let e=1+i.length*d.packedLength;e+=1+t.length*y.packedLength,this.packedLength=e+s.packedLength+2}P.pack=function(o,i,t){if(!u(o))throw new a("value is required");if(!u(i))throw new a("array is required");t=t??0;let e,r=o._positions,c=r.length;for(i[t++]=c,e=0;e<c;++e,t+=d.packedLength)d.pack(r[e],i,t);let f=o._shape;for(c=f.length,i[t++]=c,e=0;e<c;++e,t+=y.packedLength)y.pack(f[e],i,t);return s.pack(o._ellipsoid,i,t),t+=s.packedLength,i[t++]=o._cornerType,i[t]=o._granularity,i};var B=s.clone(s.UNIT_SPHERE),_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:B,height:void 0,cornerType:void 0,granularity:void 0};P.unpack=function(o,i,t){if(!u(o))throw new a("array is required");i=i??0;let e,r=o[i++],c=new Array(r);for(e=0;e<r;++e,i+=d.packedLength)c[e]=d.unpack(o,i);r=o[i++];let f=new Array(r);for(e=0;e<r;++e,i+=y.packedLength)f[e]=y.unpack(o,i);let p=s.unpack(o,i,B);i+=s.packedLength;let m=o[i++],n=o[i];return u(t)?(t._positions=c,t._shape=f,t._ellipsoid=s.clone(p,t._ellipsoid),t._cornerType=m,t._granularity=n,t):(_.polylinePositions=c,_.shapePositions=f,_.cornerType=m,_.granularity=n,new P(_))};var F=new k;P.createGeometry=function(o){let i=o._positions,t=q(i,d.equalsEpsilon),e=o._shape;if(e=w.removeDuplicatesFromShape(e),t.length<2||e.length<3)return;G.computeWindingOrder2D(e)===v.CLOCKWISE&&e.reverse();let r=k.fromPoints(e,F),c=w.computePositions(t,e,r,o,!1);return W(c,e)};var E=P;function M(o,i){return u(i)&&(o=E.unpack(o,i)),o._ellipsoid=s.clone(o._ellipsoid),E.createGeometry(o)}var he=M;export{he as default}; +import{a as k}from"./chunk-YAU2WIVW.js";import{a as N,c as w}from"./chunk-LHXP7CH5.js";import"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import{a as v,b as G}from"./chunk-SIFLADX4.js";import{a as q}from"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as g}from"./chunk-AZINMULF.js";import{a as O}from"./chunk-ILBQ77ZM.js";import{b as A,c as R,d as S}from"./chunk-7RNSURKI.js";import{c as C}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as b}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{b as y,c as s}from"./chunk-KP72RGCH.js";import{a as d,c as D}from"./chunk-OSVSBQDY.js";import{a as T}from"./chunk-LZC73BOP.js";import{a}from"./chunk-OU2IPMYE.js";import{f as u}from"./chunk-H7SJWKIY.js";function W(o,i){let t=new O;t.position=new S({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:o});let e=i.length,r=t.position.values.length/3,f=o.length/3/e,p=g.createTypedArray(r,2*e*(f+1)),m,n,l=0;m=0;let h=m*e;for(n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=f-1,h=m*e,n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=0;m<f-1;m++){let L=e*m,U=L+e;for(n=0;n<e;n++)p[l++]=n+L,p[l++]=n+U}return new R({attributes:t,indices:g.createTypedArray(r,p),boundingSphere:C.fromVertices(o),primitiveType:A.LINES})}function P(o){o=o??D.EMPTY_OBJECT;let i=o.polylinePositions,t=o.shapePositions;if(!u(i))throw new a("options.polylinePositions is required.");if(!u(t))throw new a("options.shapePositions is required.");this._positions=i,this._shape=t,this._ellipsoid=s.clone(o.ellipsoid??s.default),this._cornerType=o.cornerType??N.ROUNDED,this._granularity=o.granularity??T.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let e=1+i.length*d.packedLength;e+=1+t.length*y.packedLength,this.packedLength=e+s.packedLength+2}P.pack=function(o,i,t){if(!u(o))throw new a("value is required");if(!u(i))throw new a("array is required");t=t??0;let e,r=o._positions,c=r.length;for(i[t++]=c,e=0;e<c;++e,t+=d.packedLength)d.pack(r[e],i,t);let f=o._shape;for(c=f.length,i[t++]=c,e=0;e<c;++e,t+=y.packedLength)y.pack(f[e],i,t);return s.pack(o._ellipsoid,i,t),t+=s.packedLength,i[t++]=o._cornerType,i[t]=o._granularity,i};var B=s.clone(s.UNIT_SPHERE),_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:B,height:void 0,cornerType:void 0,granularity:void 0};P.unpack=function(o,i,t){if(!u(o))throw new a("array is required");i=i??0;let e,r=o[i++],c=new Array(r);for(e=0;e<r;++e,i+=d.packedLength)c[e]=d.unpack(o,i);r=o[i++];let f=new Array(r);for(e=0;e<r;++e,i+=y.packedLength)f[e]=y.unpack(o,i);let p=s.unpack(o,i,B);i+=s.packedLength;let m=o[i++],n=o[i];return u(t)?(t._positions=c,t._shape=f,t._ellipsoid=s.clone(p,t._ellipsoid),t._cornerType=m,t._granularity=n,t):(_.polylinePositions=c,_.shapePositions=f,_.cornerType=m,_.granularity=n,new P(_))};var F=new k;P.createGeometry=function(o){let i=o._positions,t=q(i,d.equalsEpsilon),e=o._shape;if(e=w.removeDuplicatesFromShape(e),t.length<2||e.length<3)return;G.computeWindingOrder2D(e)===v.CLOCKWISE&&e.reverse();let r=k.fromPoints(e,F),c=w.computePositions(t,e,r,o,!1);return W(c,e)};var E=P;function M(o,i){return u(i)&&(o=E.unpack(o,i)),o._ellipsoid=s.clone(o._ellipsoid),E.createGeometry(o)}var he=M;export{he as default}; diff --git a/plugins/feature/map/Cesium/Workers/createRectangleGeometry.js b/plugins/feature/map/Cesium/Workers/createRectangleGeometry.js index 2b7e5e315..cea7a74d3 100644 --- a/plugins/feature/map/Cesium/Workers/createRectangleGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createRectangleGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as W}from"./chunk-BCYPTFKK.js";import{a as Nt}from"./chunk-4OIYAFXA.js";import{a as zt}from"./chunk-23RYXNR3.js";import"./chunk-X6N776GR.js";import"./chunk-XOTNFHCP.js";import{a as ft}from"./chunk-4W2MZV6I.js";import{a as q}from"./chunk-S3L7VZFL.js";import{b as yt}from"./chunk-BKYT7QHD.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as At}from"./chunk-JQLYZQ6V.js";import{a as Vt}from"./chunk-J3L5WX3X.js";import{b as Mt,c as Pt,d as Y}from"./chunk-AVPLM4UI.js";import{d as at}from"./chunk-ZYYZDBKK.js";import{f as Lt,h as E,i as bt}from"./chunk-3PT5NNSP.js";import{a as U}from"./chunk-WER4LUMF.js";import{a as w,b as mt,c as $,d as D,e as lt,f as St}from"./chunk-FGKVHLJ4.js";import{a as I}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as Et,b as ct}from"./chunk-ELJAHN3H.js";import{e as K}from"./chunk-3BGP4HCL.js";var Tt=new w,Bt=new w,Ut=new w,Yt=new w,qt=new E,Zt=new $,Kt=new at,$t=new at;function Xt(t,e){let n=new Pt({attributes:new Vt,primitiveType:Mt.TRIANGLES});return n.attributes.position=new Y({componentDatatype:U.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}function Gt(t,e,n,r){let a=t.length,c=e.normal?new Float32Array(a):void 0,l=e.tangent?new Float32Array(a):void 0,u=e.bitangent?new Float32Array(a):void 0,p=0,d=Yt,o=Ut,i=Bt;if(e.normal||e.tangent||e.bitangent)for(let f=0;f<a;f+=3){let s=w.fromArray(t,f,Tt),h=p+1,g=p+2;i=n.geodeticSurfaceNormal(s,i),(e.tangent||e.bitangent)&&(w.cross(w.UNIT_Z,i,o),lt.multiplyByVector(r,o,o),w.normalize(o,o),e.bitangent&&w.normalize(w.cross(i,o,d),d)),e.normal&&(c[p]=i.x,c[h]=i.y,c[g]=i.z),e.tangent&&(l[p]=o.x,l[h]=o.y,l[g]=o.z),e.bitangent&&(u[p]=d.x,u[h]=d.y,u[g]=d.z),p+=3}return Xt(e,{positions:t,normals:c,tangents:l,bitangents:u})}var Ct=new w,jt=new w;function te(t,e,n){let r=t.length,a=e.normal?new Float32Array(r):void 0,c=e.tangent?new Float32Array(r):void 0,l=e.bitangent?new Float32Array(r):void 0,u=0,p=0,d=0,o=!0,i=Yt,f=Ut,s=Bt;if(e.normal||e.tangent||e.bitangent)for(let h=0;h<r;h+=6){let g=w.fromArray(t,h,Tt),A=w.fromArray(t,(h+6)%r,Ct);if(o){let b=w.fromArray(t,(h+3)%r,jt);w.subtract(A,g,A),w.subtract(b,g,b),s=w.normalize(w.cross(b,A,s),s),o=!1}w.equalsEpsilon(A,g,I.EPSILON10)&&(o=!0),(e.tangent||e.bitangent)&&(i=n.geodeticSurfaceNormal(g,i),e.tangent&&(f=w.normalize(w.cross(i,s,f),f))),e.normal&&(a[u++]=s.x,a[u++]=s.y,a[u++]=s.z,a[u++]=s.x,a[u++]=s.y,a[u++]=s.z),e.tangent&&(c[p++]=f.x,c[p++]=f.y,c[p++]=f.z,c[p++]=f.x,c[p++]=f.y,c[p++]=f.z),e.bitangent&&(l[d++]=i.x,l[d++]=i.y,l[d++]=i.z,l[d++]=i.x,l[d++]=i.y,l[d++]=i.z)}return Xt(e,{positions:t,normals:a,tangents:c,bitangents:l})}function It(t,e){let n=t._vertexFormat,r=t._ellipsoid,a=e.height,c=e.width,l=e.northCap,u=e.southCap,p=0,d=a,o=a,i=0;l&&(p=1,o-=1,i+=1),u&&(d-=1,o-=1,i+=1),i+=c*o;let f=n.position?new Float64Array(i*3):void 0,s=n.st?new Float32Array(i*2):void 0,h=0,g=0,A=Tt,b=Zt,V=Number.MAX_VALUE,z=Number.MAX_VALUE,X=-Number.MAX_VALUE,N=-Number.MAX_VALUE;for(let x=p;x<d;++x)for(let O=0;O<c;++O)W.computePosition(e,r,n.st,x,O,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,V=Math.min(V,b.x),z=Math.min(z,b.y),X=Math.max(X,b.x),N=Math.max(N,b.y));if(l&&(W.computePosition(e,r,n.st,0,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,V=b.x,z=b.y,X=b.x,N=b.y)),u&&(W.computePosition(e,r,n.st,a-1,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h]=A.z,n.st&&(s[g++]=b.x,s[g]=b.y,V=Math.min(V,b.x),z=Math.min(z,b.y),X=Math.max(X,b.x),N=Math.max(N,b.y))),n.st&&(V<0||z<0||X>1||N>1))for(let x=0;x<s.length;x+=2)s[x]=(s[x]-V)/(X-V),s[x+1]=(s[x+1]-z)/(N-z);let m=Gt(f,n,r,e.tangentRotationMatrix),Z=6*(c-1)*(o-1);l&&(Z+=3*(c-1)),u&&(Z+=3*(c-1));let L=At.createTypedArray(i,Z),C=0,P=0,H;for(H=0;H<o-1;++H){for(let x=0;x<c-1;++x){let O=C,k=O+c,j=k+1,st=O+1;L[P++]=O,L[P++]=k,L[P++]=st,L[P++]=st,L[P++]=k,L[P++]=j,++C}++C}if(l||u){let x=i-1,O=i-1;l&&u&&(x=i-2);let k,j;if(C=0,l)for(H=0;H<c-1;H++)k=C,j=k+1,L[P++]=x,L[P++]=k,L[P++]=j,++C;if(u)for(C=(o-1)*c,H=0;H<c-1;H++)k=C,j=k+1,L[P++]=k,L[P++]=O,L[P++]=j,++C}return m.indices=L,n.st&&(m.attributes.st=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:2,values:s})),m}function ut(t,e,n,r,a){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n+2],t[e++]=a[n],t[e++]=a[n+1],t[e]=a[n+2],t}function ht(t,e,n,r){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n],t[e]=r[n+1],t}var Dt=new q;function ee(t,e){let n=t._shadowVolume,r=t._offsetAttribute,a=t._vertexFormat,c=t._extrudedHeight,l=t._surfaceHeight,u=t._ellipsoid,p=e.height,d=e.width,o;if(n){let R=q.clone(a,Dt);R.normal=!0,t._vertexFormat=R}let i=It(t,e);n&&(t._vertexFormat=a);let f=yt.scaleToGeodeticHeight(i.attributes.position.values,l,u,!1);f=new Float64Array(f);let s=f.length,h=s*2,g=new Float64Array(h);g.set(f);let A=yt.scaleToGeodeticHeight(i.attributes.position.values,c,u);g.set(A,s),i.attributes.position.values=g;let b=a.normal?new Float32Array(h):void 0,V=a.tangent?new Float32Array(h):void 0,z=a.bitangent?new Float32Array(h):void 0,X=a.st?new Float32Array(h/3*2):void 0,N,m;if(a.normal){for(m=i.attributes.normal.values,b.set(m),o=0;o<s;o++)m[o]=-m[o];b.set(m,s),i.attributes.normal.values=b}if(n){m=i.attributes.normal.values,a.normal||(i.attributes.normal=void 0);let R=new Float32Array(h);for(o=0;o<s;o++)m[o]=-m[o];R.set(m,s),i.attributes.extrudeDirection=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:R})}let Z,L=K(r);if(L){let R=s/3*2,it=new Uint8Array(R);r===ft.TOP?it=it.fill(1,0,R/2):(Z=r===ft.NONE?0:1,it=it.fill(Z)),i.attributes.applyOffset=new Y({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:it})}if(a.tangent){let R=i.attributes.tangent.values;for(V.set(R),o=0;o<s;o++)R[o]=-R[o];V.set(R,s),i.attributes.tangent.values=V}if(a.bitangent){let R=i.attributes.bitangent.values;z.set(R),z.set(R,s),i.attributes.bitangent.values=z}a.st&&(N=i.attributes.st.values,X.set(N),X.set(N,s/3*2),i.attributes.st.values=X);let C=i.indices,P=C.length,H=s/3,x=At.createTypedArray(h/3,P*2);for(x.set(C),o=0;o<P;o+=3)x[o+P]=C[o+2]+H,x[o+1+P]=C[o+1]+H,x[o+2+P]=C[o]+H;i.indices=x;let O=e.northCap,k=e.southCap,j=p,st=2,pt=0,Rt=4,xt=4;O&&(st-=1,j-=1,pt+=1,Rt-=2,xt-=1),k&&(st-=1,j-=1,pt+=1,Rt-=2,xt-=1),pt+=st*d+2*j-Rt;let dt=(pt+xt)*2,T=new Float64Array(dt*3),S=n?new Float32Array(dt*3):void 0,Q=L?new Uint8Array(dt):void 0,M=a.st?new Float32Array(dt*2):void 0,tt=r===ft.TOP;L&&!tt&&(Z=r===ft.ALL?1:0,Q=Q.fill(Z));let F=0,v=0,y=0,B=0,et=d*j,_;for(o=0;o<et;o+=d)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);if(k){let R=O?et+1:et;for(_=R*3,o=0;o<2;o++)T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,R*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1)}else for(o=et-d;o<et;o++)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);for(o=et-1;o>0;o-=d)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);if(O){let R=et;for(_=R*3,o=0;o<2;o++)T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,R*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1)}else for(o=d-1;o>=0;o--)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);let nt=te(T,a,u);a.st&&(nt.attributes.st=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:2,values:M})),n&&(nt.attributes.extrudeDirection=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:S})),L&&(nt.attributes.applyOffset=new Y({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let ot=At.createTypedArray(dt,pt*6),gt,_t,kt,wt;s=T.length/3;let rt=0;for(o=0;o<s-1;o+=2){gt=o,wt=(gt+2)%s;let R=w.fromArray(T,gt*3,Ct),it=w.fromArray(T,wt*3,jt);w.equalsEpsilon(R,it,I.EPSILON10)||(_t=(gt+1)%s,kt=(_t+2)%s,ot[rt++]=gt,ot[rt++]=_t,ot[rt++]=wt,ot[rt++]=wt,ot[rt++]=_t,ot[rt++]=kt)}return nt.indices=ot,nt=zt.combineInstances([new Nt({geometry:i}),new Nt({geometry:nt})]),nt[0]}var ne=[new w,new w,new w,new w],Wt=new mt,oe=new mt;function Ht(t,e,n,r,a){if(n===0)return E.clone(t,a);let c=W.computeOptions(t,e,n,0,qt,Wt),l=c.height,u=c.width,p=ne;return W.computePosition(c,r,!1,0,0,p[0]),W.computePosition(c,r,!1,0,u-1,p[1]),W.computePosition(c,r,!1,l-1,0,p[2]),W.computePosition(c,r,!1,l-1,u-1,p[3]),E.fromCartesianArray(p,r,a)}function J(t){t=t??St.EMPTY_OBJECT;let e=t.rectangle;if(ct.typeOf.object("rectangle",e),E._validate(e),e.north<e.south)throw new Et("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=t.height??0,r=t.extrudedHeight??n;this._rectangle=E.clone(e),this._granularity=t.granularity??I.RADIANS_PER_DEGREE,this._ellipsoid=D.clone(t.ellipsoid??D.default),this._surfaceHeight=Math.max(n,r),this._rotation=t.rotation??0,this._stRotation=t.stRotation??0,this._vertexFormat=q.clone(t.vertexFormat??q.DEFAULT),this._extrudedHeight=Math.min(n,r),this._shadowVolume=t.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}J.packedLength=E.packedLength+D.packedLength+q.packedLength+7;J.pack=function(t,e,n){return ct.typeOf.object("value",t),ct.defined("array",e),n=n??0,E.pack(t._rectangle,e,n),n+=E.packedLength,D.pack(t._ellipsoid,e,n),n+=D.packedLength,q.pack(t._vertexFormat,e,n),n+=q.packedLength,e[n++]=t._granularity,e[n++]=t._surfaceHeight,e[n++]=t._rotation,e[n++]=t._stRotation,e[n++]=t._extrudedHeight,e[n++]=t._shadowVolume?1:0,e[n]=t._offsetAttribute??-1,e};var Jt=new E,Qt=D.clone(D.UNIT_SPHERE),G={rectangle:Jt,ellipsoid:Qt,vertexFormat:Dt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};J.unpack=function(t,e,n){ct.defined("array",t),e=e??0;let r=E.unpack(t,e,Jt);e+=E.packedLength;let a=D.unpack(t,e,Qt);e+=D.packedLength;let c=q.unpack(t,e,Dt);e+=q.packedLength;let l=t[e++],u=t[e++],p=t[e++],d=t[e++],o=t[e++],i=t[e++]===1,f=t[e];return K(n)?(n._rectangle=E.clone(r,n._rectangle),n._ellipsoid=D.clone(a,n._ellipsoid),n._vertexFormat=q.clone(c,n._vertexFormat),n._granularity=l,n._surfaceHeight=u,n._rotation=p,n._stRotation=d,n._extrudedHeight=o,n._shadowVolume=i,n._offsetAttribute=f===-1?void 0:f,n):(G.granularity=l,G.height=u,G.rotation=p,G.stRotation=d,G.extrudedHeight=o,G.shadowVolume=i,G.offsetAttribute=f===-1?void 0:f,new J(G))};J.computeRectangle=function(t,e){t=t??St.EMPTY_OBJECT;let n=t.rectangle;if(ct.typeOf.object("rectangle",n),E._validate(n),n.north<n.south)throw new Et("options.rectangle.north must be greater than or equal to options.rectangle.south");let r=t.granularity??I.RADIANS_PER_DEGREE,a=t.ellipsoid??D.default,c=t.rotation??0;return Ht(n,r,c,a,e)};var ie=new lt,Ft=new Lt,ae=new mt;J.createGeometry=function(t){if(I.equalsEpsilon(t._rectangle.north,t._rectangle.south,I.EPSILON10)||I.equalsEpsilon(t._rectangle.east,t._rectangle.west,I.EPSILON10))return;let e=t._rectangle,n=t._ellipsoid,r=t._rotation,a=t._stRotation,c=t._vertexFormat,l=W.computeOptions(e,t._granularity,r,a,qt,Wt,oe),u=ie;if(a!==0||r!==0){let s=E.center(e,ae),h=n.geodeticSurfaceNormalCartographic(s,Ct);Lt.fromAxisAngle(h,-a,Ft),lt.fromQuaternion(Ft,u)}else lt.clone(lt.IDENTITY,u);let p=t._surfaceHeight,d=t._extrudedHeight,o=!I.equalsEpsilon(p,d,0,I.EPSILON2);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.tangentRotationMatrix=u;let i,f;if(e=t._rectangle,o){i=ee(t,l);let s=at.fromRectangle3D(e,n,p,$t),h=at.fromRectangle3D(e,n,d,Kt);f=at.union(s,h)}else{if(i=It(t,l),i.attributes.position.values=yt.scaleToGeodeticHeight(i.attributes.position.values,p,n,!1),K(t._offsetAttribute)){let s=i.attributes.position.values.length,h=t._offsetAttribute===ft.NONE?0:1,g=new Uint8Array(s/3).fill(h);i.attributes.applyOffset=new Y({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}f=at.fromRectangle3D(e,n,p)}return c.position||delete i.attributes.position,new Pt({attributes:i.attributes,indices:i.indices,primitiveType:i.primitiveType,boundingSphere:f,offsetAttribute:t._offsetAttribute})};J.createShadowVolume=function(t,e,n){let r=t._granularity,a=t._ellipsoid,c=e(r,a),l=n(r,a);return new J({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:a,stRotation:t._stRotation,granularity:r,extrudedHeight:l,height:c,vertexFormat:q.POSITION_ONLY,shadowVolume:!0})};var vt=new E,se=[new $,new $,new $],re=new bt,ce=new mt;function le(t){if(t._stRotation===0)return[0,0,0,1,1,0];let e=E.clone(t._rectangle,vt),n=t._granularity,r=t._ellipsoid,a=t._rotation-t._stRotation,c=Ht(e,n,a,r,vt),l=se;l[0].x=c.west,l[0].y=c.south,l[1].x=c.west,l[1].y=c.north,l[2].x=c.east,l[2].y=c.south;let u=t.rectangle,p=bt.fromRotation(t._stRotation,re),d=E.center(u,ce);for(let h=0;h<3;++h){let g=l[h];g.x-=d.longitude,g.y-=d.latitude,bt.multiplyByVector(p,g,g),g.x+=d.longitude,g.y+=d.latitude,g.x=(g.x-u.west)/u.width,g.y=(g.y-u.south)/u.height}let o=l[0],i=l[1],f=l[2],s=new Array(6);return $.pack(o,s),$.pack(i,s,2),$.pack(f,s,4),s}Object.defineProperties(J.prototype,{rectangle:{get:function(){return K(this._rotatedRectangle)||(this._rotatedRectangle=Ht(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return K(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=le(this)),this._textureCoordinateRotationPoints}}});var Ot=J;function fe(t,e){return K(e)&&(t=Ot.unpack(t,e)),t._ellipsoid=D.clone(t._ellipsoid),t._rectangle=E.clone(t._rectangle),Ot.createGeometry(t)}var Ye=fe;export{Ye as default}; +import{a as W}from"./chunk-XSEHEM5B.js";import{a as Nt}from"./chunk-PICDM7L2.js";import{a as zt}from"./chunk-XUWPEWB7.js";import"./chunk-QCE33JV5.js";import"./chunk-EL5WNS34.js";import{a as ft}from"./chunk-GNBKSQYP.js";import{a as q}from"./chunk-FZSSAWMQ.js";import{b as yt}from"./chunk-SIFLADX4.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as At}from"./chunk-AZINMULF.js";import{a as Vt}from"./chunk-ILBQ77ZM.js";import{b as Mt,c as Pt,d as Y}from"./chunk-7RNSURKI.js";import{c as at}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{h as Lt,j as E,k as bt}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as U}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as mt,b as $,c as D}from"./chunk-KP72RGCH.js";import{a as w,b as lt,c as St}from"./chunk-OSVSBQDY.js";import{a as I}from"./chunk-LZC73BOP.js";import{a as Et,b as ct}from"./chunk-OU2IPMYE.js";import{f as K}from"./chunk-H7SJWKIY.js";var Tt=new w,Bt=new w,Ut=new w,Yt=new w,qt=new E,Zt=new $,Kt=new at,$t=new at;function Xt(t,e){let n=new Pt({attributes:new Vt,primitiveType:Mt.TRIANGLES});return n.attributes.position=new Y({componentDatatype:U.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(n.attributes.normal=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(n.attributes.tangent=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(n.attributes.bitangent=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:e.bitangents})),n}function Gt(t,e,n,r){let a=t.length,c=e.normal?new Float32Array(a):void 0,l=e.tangent?new Float32Array(a):void 0,u=e.bitangent?new Float32Array(a):void 0,p=0,d=Yt,o=Ut,i=Bt;if(e.normal||e.tangent||e.bitangent)for(let f=0;f<a;f+=3){let s=w.fromArray(t,f,Tt),h=p+1,g=p+2;i=n.geodeticSurfaceNormal(s,i),(e.tangent||e.bitangent)&&(w.cross(w.UNIT_Z,i,o),lt.multiplyByVector(r,o,o),w.normalize(o,o),e.bitangent&&w.normalize(w.cross(i,o,d),d)),e.normal&&(c[p]=i.x,c[h]=i.y,c[g]=i.z),e.tangent&&(l[p]=o.x,l[h]=o.y,l[g]=o.z),e.bitangent&&(u[p]=d.x,u[h]=d.y,u[g]=d.z),p+=3}return Xt(e,{positions:t,normals:c,tangents:l,bitangents:u})}var Ct=new w,jt=new w;function te(t,e,n){let r=t.length,a=e.normal?new Float32Array(r):void 0,c=e.tangent?new Float32Array(r):void 0,l=e.bitangent?new Float32Array(r):void 0,u=0,p=0,d=0,o=!0,i=Yt,f=Ut,s=Bt;if(e.normal||e.tangent||e.bitangent)for(let h=0;h<r;h+=6){let g=w.fromArray(t,h,Tt),A=w.fromArray(t,(h+6)%r,Ct);if(o){let b=w.fromArray(t,(h+3)%r,jt);w.subtract(A,g,A),w.subtract(b,g,b),s=w.normalize(w.cross(b,A,s),s),o=!1}w.equalsEpsilon(A,g,I.EPSILON10)&&(o=!0),(e.tangent||e.bitangent)&&(i=n.geodeticSurfaceNormal(g,i),e.tangent&&(f=w.normalize(w.cross(i,s,f),f))),e.normal&&(a[u++]=s.x,a[u++]=s.y,a[u++]=s.z,a[u++]=s.x,a[u++]=s.y,a[u++]=s.z),e.tangent&&(c[p++]=f.x,c[p++]=f.y,c[p++]=f.z,c[p++]=f.x,c[p++]=f.y,c[p++]=f.z),e.bitangent&&(l[d++]=i.x,l[d++]=i.y,l[d++]=i.z,l[d++]=i.x,l[d++]=i.y,l[d++]=i.z)}return Xt(e,{positions:t,normals:a,tangents:c,bitangents:l})}function It(t,e){let n=t._vertexFormat,r=t._ellipsoid,a=e.height,c=e.width,l=e.northCap,u=e.southCap,p=0,d=a,o=a,i=0;l&&(p=1,o-=1,i+=1),u&&(d-=1,o-=1,i+=1),i+=c*o;let f=n.position?new Float64Array(i*3):void 0,s=n.st?new Float32Array(i*2):void 0,h=0,g=0,A=Tt,b=Zt,V=Number.MAX_VALUE,z=Number.MAX_VALUE,X=-Number.MAX_VALUE,N=-Number.MAX_VALUE;for(let x=p;x<d;++x)for(let O=0;O<c;++O)W.computePosition(e,r,n.st,x,O,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,V=Math.min(V,b.x),z=Math.min(z,b.y),X=Math.max(X,b.x),N=Math.max(N,b.y));if(l&&(W.computePosition(e,r,n.st,0,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h++]=A.z,n.st&&(s[g++]=b.x,s[g++]=b.y,V=b.x,z=b.y,X=b.x,N=b.y)),u&&(W.computePosition(e,r,n.st,a-1,0,A,b),f[h++]=A.x,f[h++]=A.y,f[h]=A.z,n.st&&(s[g++]=b.x,s[g]=b.y,V=Math.min(V,b.x),z=Math.min(z,b.y),X=Math.max(X,b.x),N=Math.max(N,b.y))),n.st&&(V<0||z<0||X>1||N>1))for(let x=0;x<s.length;x+=2)s[x]=(s[x]-V)/(X-V),s[x+1]=(s[x+1]-z)/(N-z);let m=Gt(f,n,r,e.tangentRotationMatrix),Z=6*(c-1)*(o-1);l&&(Z+=3*(c-1)),u&&(Z+=3*(c-1));let L=At.createTypedArray(i,Z),C=0,P=0,H;for(H=0;H<o-1;++H){for(let x=0;x<c-1;++x){let O=C,k=O+c,j=k+1,st=O+1;L[P++]=O,L[P++]=k,L[P++]=st,L[P++]=st,L[P++]=k,L[P++]=j,++C}++C}if(l||u){let x=i-1,O=i-1;l&&u&&(x=i-2);let k,j;if(C=0,l)for(H=0;H<c-1;H++)k=C,j=k+1,L[P++]=x,L[P++]=k,L[P++]=j,++C;if(u)for(C=(o-1)*c,H=0;H<c-1;H++)k=C,j=k+1,L[P++]=k,L[P++]=O,L[P++]=j,++C}return m.indices=L,n.st&&(m.attributes.st=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:2,values:s})),m}function ut(t,e,n,r,a){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n+2],t[e++]=a[n],t[e++]=a[n+1],t[e]=a[n+2],t}function ht(t,e,n,r){return t[e++]=r[n],t[e++]=r[n+1],t[e++]=r[n],t[e]=r[n+1],t}var Dt=new q;function ee(t,e){let n=t._shadowVolume,r=t._offsetAttribute,a=t._vertexFormat,c=t._extrudedHeight,l=t._surfaceHeight,u=t._ellipsoid,p=e.height,d=e.width,o;if(n){let R=q.clone(a,Dt);R.normal=!0,t._vertexFormat=R}let i=It(t,e);n&&(t._vertexFormat=a);let f=yt.scaleToGeodeticHeight(i.attributes.position.values,l,u,!1);f=new Float64Array(f);let s=f.length,h=s*2,g=new Float64Array(h);g.set(f);let A=yt.scaleToGeodeticHeight(i.attributes.position.values,c,u);g.set(A,s),i.attributes.position.values=g;let b=a.normal?new Float32Array(h):void 0,V=a.tangent?new Float32Array(h):void 0,z=a.bitangent?new Float32Array(h):void 0,X=a.st?new Float32Array(h/3*2):void 0,N,m;if(a.normal){for(m=i.attributes.normal.values,b.set(m),o=0;o<s;o++)m[o]=-m[o];b.set(m,s),i.attributes.normal.values=b}if(n){m=i.attributes.normal.values,a.normal||(i.attributes.normal=void 0);let R=new Float32Array(h);for(o=0;o<s;o++)m[o]=-m[o];R.set(m,s),i.attributes.extrudeDirection=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:R})}let Z,L=K(r);if(L){let R=s/3*2,it=new Uint8Array(R);r===ft.TOP?it=it.fill(1,0,R/2):(Z=r===ft.NONE?0:1,it=it.fill(Z)),i.attributes.applyOffset=new Y({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:it})}if(a.tangent){let R=i.attributes.tangent.values;for(V.set(R),o=0;o<s;o++)R[o]=-R[o];V.set(R,s),i.attributes.tangent.values=V}if(a.bitangent){let R=i.attributes.bitangent.values;z.set(R),z.set(R,s),i.attributes.bitangent.values=z}a.st&&(N=i.attributes.st.values,X.set(N),X.set(N,s/3*2),i.attributes.st.values=X);let C=i.indices,P=C.length,H=s/3,x=At.createTypedArray(h/3,P*2);for(x.set(C),o=0;o<P;o+=3)x[o+P]=C[o+2]+H,x[o+1+P]=C[o+1]+H,x[o+2+P]=C[o]+H;i.indices=x;let O=e.northCap,k=e.southCap,j=p,st=2,pt=0,Rt=4,xt=4;O&&(st-=1,j-=1,pt+=1,Rt-=2,xt-=1),k&&(st-=1,j-=1,pt+=1,Rt-=2,xt-=1),pt+=st*d+2*j-Rt;let dt=(pt+xt)*2,T=new Float64Array(dt*3),S=n?new Float32Array(dt*3):void 0,Q=L?new Uint8Array(dt):void 0,M=a.st?new Float32Array(dt*2):void 0,tt=r===ft.TOP;L&&!tt&&(Z=r===ft.ALL?1:0,Q=Q.fill(Z));let F=0,v=0,y=0,B=0,et=d*j,_;for(o=0;o<et;o+=d)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);if(k){let R=O?et+1:et;for(_=R*3,o=0;o<2;o++)T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,R*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1)}else for(o=et-d;o<et;o++)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);for(o=et-1;o>0;o-=d)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);if(O){let R=et;for(_=R*3,o=0;o<2;o++)T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,R*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1)}else for(o=d-1;o>=0;o--)_=o*3,T=ut(T,F,_,f,A),F+=6,a.st&&(M=ht(M,v,o*2,N),v+=4),n&&(y+=3,S[y++]=m[_],S[y++]=m[_+1],S[y++]=m[_+2]),tt&&(Q[B++]=1,B+=1);let nt=te(T,a,u);a.st&&(nt.attributes.st=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:2,values:M})),n&&(nt.attributes.extrudeDirection=new Y({componentDatatype:U.FLOAT,componentsPerAttribute:3,values:S})),L&&(nt.attributes.applyOffset=new Y({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let ot=At.createTypedArray(dt,pt*6),gt,_t,kt,wt;s=T.length/3;let rt=0;for(o=0;o<s-1;o+=2){gt=o,wt=(gt+2)%s;let R=w.fromArray(T,gt*3,Ct),it=w.fromArray(T,wt*3,jt);w.equalsEpsilon(R,it,I.EPSILON10)||(_t=(gt+1)%s,kt=(_t+2)%s,ot[rt++]=gt,ot[rt++]=_t,ot[rt++]=wt,ot[rt++]=wt,ot[rt++]=_t,ot[rt++]=kt)}return nt.indices=ot,nt=zt.combineInstances([new Nt({geometry:i}),new Nt({geometry:nt})]),nt[0]}var ne=[new w,new w,new w,new w],Wt=new mt,oe=new mt;function Ht(t,e,n,r,a){if(n===0)return E.clone(t,a);let c=W.computeOptions(t,e,n,0,qt,Wt),l=c.height,u=c.width,p=ne;return W.computePosition(c,r,!1,0,0,p[0]),W.computePosition(c,r,!1,0,u-1,p[1]),W.computePosition(c,r,!1,l-1,0,p[2]),W.computePosition(c,r,!1,l-1,u-1,p[3]),E.fromCartesianArray(p,r,a)}function J(t){t=t??St.EMPTY_OBJECT;let e=t.rectangle;if(ct.typeOf.object("rectangle",e),E._validate(e),e.north<e.south)throw new Et("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=t.height??0,r=t.extrudedHeight??n;this._rectangle=E.clone(e),this._granularity=t.granularity??I.RADIANS_PER_DEGREE,this._ellipsoid=D.clone(t.ellipsoid??D.default),this._surfaceHeight=Math.max(n,r),this._rotation=t.rotation??0,this._stRotation=t.stRotation??0,this._vertexFormat=q.clone(t.vertexFormat??q.DEFAULT),this._extrudedHeight=Math.min(n,r),this._shadowVolume=t.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}J.packedLength=E.packedLength+D.packedLength+q.packedLength+7;J.pack=function(t,e,n){return ct.typeOf.object("value",t),ct.defined("array",e),n=n??0,E.pack(t._rectangle,e,n),n+=E.packedLength,D.pack(t._ellipsoid,e,n),n+=D.packedLength,q.pack(t._vertexFormat,e,n),n+=q.packedLength,e[n++]=t._granularity,e[n++]=t._surfaceHeight,e[n++]=t._rotation,e[n++]=t._stRotation,e[n++]=t._extrudedHeight,e[n++]=t._shadowVolume?1:0,e[n]=t._offsetAttribute??-1,e};var Jt=new E,Qt=D.clone(D.UNIT_SPHERE),G={rectangle:Jt,ellipsoid:Qt,vertexFormat:Dt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};J.unpack=function(t,e,n){ct.defined("array",t),e=e??0;let r=E.unpack(t,e,Jt);e+=E.packedLength;let a=D.unpack(t,e,Qt);e+=D.packedLength;let c=q.unpack(t,e,Dt);e+=q.packedLength;let l=t[e++],u=t[e++],p=t[e++],d=t[e++],o=t[e++],i=t[e++]===1,f=t[e];return K(n)?(n._rectangle=E.clone(r,n._rectangle),n._ellipsoid=D.clone(a,n._ellipsoid),n._vertexFormat=q.clone(c,n._vertexFormat),n._granularity=l,n._surfaceHeight=u,n._rotation=p,n._stRotation=d,n._extrudedHeight=o,n._shadowVolume=i,n._offsetAttribute=f===-1?void 0:f,n):(G.granularity=l,G.height=u,G.rotation=p,G.stRotation=d,G.extrudedHeight=o,G.shadowVolume=i,G.offsetAttribute=f===-1?void 0:f,new J(G))};J.computeRectangle=function(t,e){t=t??St.EMPTY_OBJECT;let n=t.rectangle;if(ct.typeOf.object("rectangle",n),E._validate(n),n.north<n.south)throw new Et("options.rectangle.north must be greater than or equal to options.rectangle.south");let r=t.granularity??I.RADIANS_PER_DEGREE,a=t.ellipsoid??D.default,c=t.rotation??0;return Ht(n,r,c,a,e)};var ie=new lt,Ft=new Lt,ae=new mt;J.createGeometry=function(t){if(I.equalsEpsilon(t._rectangle.north,t._rectangle.south,I.EPSILON10)||I.equalsEpsilon(t._rectangle.east,t._rectangle.west,I.EPSILON10))return;let e=t._rectangle,n=t._ellipsoid,r=t._rotation,a=t._stRotation,c=t._vertexFormat,l=W.computeOptions(e,t._granularity,r,a,qt,Wt,oe),u=ie;if(a!==0||r!==0){let s=E.center(e,ae),h=n.geodeticSurfaceNormalCartographic(s,Ct);Lt.fromAxisAngle(h,-a,Ft),lt.fromQuaternion(Ft,u)}else lt.clone(lt.IDENTITY,u);let p=t._surfaceHeight,d=t._extrudedHeight,o=!I.equalsEpsilon(p,d,0,I.EPSILON2);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.tangentRotationMatrix=u;let i,f;if(e=t._rectangle,o){i=ee(t,l);let s=at.fromRectangle3D(e,n,p,$t),h=at.fromRectangle3D(e,n,d,Kt);f=at.union(s,h)}else{if(i=It(t,l),i.attributes.position.values=yt.scaleToGeodeticHeight(i.attributes.position.values,p,n,!1),K(t._offsetAttribute)){let s=i.attributes.position.values.length,h=t._offsetAttribute===ft.NONE?0:1,g=new Uint8Array(s/3).fill(h);i.attributes.applyOffset=new Y({componentDatatype:U.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}f=at.fromRectangle3D(e,n,p)}return c.position||delete i.attributes.position,new Pt({attributes:i.attributes,indices:i.indices,primitiveType:i.primitiveType,boundingSphere:f,offsetAttribute:t._offsetAttribute})};J.createShadowVolume=function(t,e,n){let r=t._granularity,a=t._ellipsoid,c=e(r,a),l=n(r,a);return new J({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:a,stRotation:t._stRotation,granularity:r,extrudedHeight:l,height:c,vertexFormat:q.POSITION_ONLY,shadowVolume:!0})};var vt=new E,se=[new $,new $,new $],re=new bt,ce=new mt;function le(t){if(t._stRotation===0)return[0,0,0,1,1,0];let e=E.clone(t._rectangle,vt),n=t._granularity,r=t._ellipsoid,a=t._rotation-t._stRotation,c=Ht(e,n,a,r,vt),l=se;l[0].x=c.west,l[0].y=c.south,l[1].x=c.west,l[1].y=c.north,l[2].x=c.east,l[2].y=c.south;let u=t.rectangle,p=bt.fromRotation(t._stRotation,re),d=E.center(u,ce);for(let h=0;h<3;++h){let g=l[h];g.x-=d.longitude,g.y-=d.latitude,bt.multiplyByVector(p,g,g),g.x+=d.longitude,g.y+=d.latitude,g.x=(g.x-u.west)/u.width,g.y=(g.y-u.south)/u.height}let o=l[0],i=l[1],f=l[2],s=new Array(6);return $.pack(o,s),$.pack(i,s,2),$.pack(f,s,4),s}Object.defineProperties(J.prototype,{rectangle:{get:function(){return K(this._rotatedRectangle)||(this._rotatedRectangle=Ht(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return K(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=le(this)),this._textureCoordinateRotationPoints}}});var Ot=J;function fe(t,e){return K(e)&&(t=Ot.unpack(t,e)),t._ellipsoid=D.clone(t._ellipsoid),t._rectangle=E.clone(t._rectangle),Ot.createGeometry(t)}var Ye=fe;export{Ye as default}; diff --git a/plugins/feature/map/Cesium/Workers/createRectangleOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createRectangleOutlineGeometry.js index bda28fcd4..cc4ceb9e4 100644 --- a/plugins/feature/map/Cesium/Workers/createRectangleOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createRectangleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as R}from"./chunk-BCYPTFKK.js";import{a as y}from"./chunk-4W2MZV6I.js";import{b as z}from"./chunk-BKYT7QHD.js";import"./chunk-IAW6QHRG.js";import{a as q}from"./chunk-JQLYZQ6V.js";import{a as F}from"./chunk-J3L5WX3X.js";import{b as v,c as B,d as T}from"./chunk-AVPLM4UI.js";import{d as P}from"./chunk-ZYYZDBKK.js";import{h as b}from"./chunk-3PT5NNSP.js";import{a as D}from"./chunk-WER4LUMF.js";import{a as x,b as U,d as w,f as M}from"./chunk-FGKVHLJ4.js";import{a as S}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as C}from"./chunk-ELJAHN3H.js";import{e as H}from"./chunk-3BGP4HCL.js";var j=new P,K=new P,Q=new x,W=new b;function Y(t,e){let i=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,p=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),p&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;let n=new Float64Array(o*3),l=0,f=0,a,r=Q;if(h)R.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;else for(a=0;a<s;a++)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(a=s-1,f=1;f<m;f++)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!p)for(a=s-2;a>=0;a--)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(a=0,f=m-2;f>0;f--)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;let u=n.length/3*2,c=q.createTypedArray(n.length/3,u),E=0;for(let L=0;L<n.length/3-1;L++)c[E++]=L,c[E++]=L+1;c[E++]=n.length/3-1,c[E++]=0;let d=new B({attributes:new F,primitiveType:v.LINES});return d.attributes.position=new T({componentDatatype:D.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}function X(t,e){let i=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=Y(t,e),p=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=new Float64Array(o*2);g.set(A);let n=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;let l=e.northCap,f=e.southCap,a=4;l&&(a-=1),f&&(a-=1);let r=(g.length/3+a)*2,u=q.createTypedArray(g.length/3,r);o=g.length/6;let c=0;for(let d=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;let E;if(l)E=p-1;else{let d=_-1;u[c++]=d,u[c++]=d+o,E=_+p-2}if(u[c++]=E,u[c++]=E+o,!f){let d=_+E-1;u[c++]=d,u[c]=d+o}return h.indices=u,h}function k(t){t=t??M.EMPTY_OBJECT;let e=t.rectangle,i=t.granularity??S.RADIANS_PER_DEGREE,m=t.ellipsoid??w.default,s=t.rotation??0;if(!H(e))throw new C("rectangle is required.");if(b._validate(e),e.north<e.south)throw new C("options.rectangle.north must be greater than options.rectangle.south");let h=t.height??0,p=t.extrudedHeight??h;this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,p),this._rotation=s,this._extrudedHeight=Math.min(h,p),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}k.packedLength=b.packedLength+w.packedLength+5;k.pack=function(t,e,i){if(!H(t))throw new C("value is required");if(!H(e))throw new C("array is required");return i=i??0,b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=t._offsetAttribute??-1,e};var J=new b,V=w.clone(w.UNIT_SPHERE),N={rectangle:J,ellipsoid:V,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};k.unpack=function(t,e,i){if(!H(t))throw new C("array is required");e=e??0;let m=b.unpack(t,e,J);e+=b.packedLength;let s=w.unpack(t,e,V);e+=w.packedLength;let h=t[e++],p=t[e++],_=t[e++],A=t[e++],o=t[e];return H(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=p,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void 0:o,i):(N.granularity=h,N.height=p,N.rotation=_,N.extrudedHeight=A,N.offsetAttribute=o===-1?void 0:o,new k(N))};var Z=new U;k.createGeometry=function(t){let e=t._rectangle,i=t._ellipsoid,m=R.computeOptions(e,t._granularity,t._rotation,0,W,Z),s,h;if(S.equalsEpsilon(e.north,e.south,S.EPSILON10)||S.equalsEpsilon(e.east,e.west,S.EPSILON10))return;let p=t._surfaceHeight,_=t._extrudedHeight,A=!S.equalsEpsilon(p,_,0,S.EPSILON2),o;if(A){if(s=X(t,m),H(t._offsetAttribute)){let l=s.attributes.position.values.length/3,f=new Uint8Array(l);t._offsetAttribute===y.TOP?f=f.fill(1,0,l/2):(o=t._offsetAttribute===y.NONE?0:1,f=f.fill(o)),s.attributes.applyOffset=new T({componentDatatype:D.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let g=P.fromRectangle3D(e,i,p,K),n=P.fromRectangle3D(e,i,_,j);h=P.union(g,n)}else{if(s=Y(t,m),s.attributes.position.values=z.scaleToGeodeticHeight(s.attributes.position.values,p,i,!1),H(t._offsetAttribute)){let g=s.attributes.position.values.length;o=t._offsetAttribute===y.NONE?0:1;let n=new Uint8Array(g/3).fill(o);s.attributes.applyOffset=new T({componentDatatype:D.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}h=P.fromRectangle3D(e,i,p)}return new B({attributes:s.attributes,indices:s.indices,primitiveType:v.LINES,boundingSphere:h,offsetAttribute:t._offsetAttribute})};var O=k;function $(t,e){return H(e)&&(t=O.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),t._rectangle=b.clone(t._rectangle),O.createGeometry(t)}var Et=$;export{Et as default}; +import{a as R}from"./chunk-XSEHEM5B.js";import{a as y}from"./chunk-GNBKSQYP.js";import{b as z}from"./chunk-SIFLADX4.js";import"./chunk-B5FT3Q23.js";import{a as q}from"./chunk-AZINMULF.js";import{a as F}from"./chunk-ILBQ77ZM.js";import{b as v,c as B,d as T}from"./chunk-7RNSURKI.js";import{c as P}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{j as b}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as D}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as U,c as w}from"./chunk-KP72RGCH.js";import{a as x,c as M}from"./chunk-OSVSBQDY.js";import{a as S}from"./chunk-LZC73BOP.js";import{a as C}from"./chunk-OU2IPMYE.js";import{f as H}from"./chunk-H7SJWKIY.js";var j=new P,K=new P,Q=new x,W=new b;function Y(t,e){let i=t._ellipsoid,m=e.height,s=e.width,h=e.northCap,p=e.southCap,_=m,A=2,o=0,g=4;h&&(A-=1,_-=1,o+=1,g-=2),p&&(A-=1,_-=1,o+=1,g-=2),o+=A*s+2*_-g;let n=new Float64Array(o*3),l=0,f=0,a,r=Q;if(h)R.computePosition(e,i,!1,f,0,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;else for(a=0;a<s;a++)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(a=s-1,f=1;f<m;f++)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;if(f=m-1,!p)for(a=s-2;a>=0;a--)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;for(a=0,f=m-2;f>0;f--)R.computePosition(e,i,!1,f,a,r),n[l++]=r.x,n[l++]=r.y,n[l++]=r.z;let u=n.length/3*2,c=q.createTypedArray(n.length/3,u),E=0;for(let L=0;L<n.length/3-1;L++)c[E++]=L,c[E++]=L+1;c[E++]=n.length/3-1,c[E]=0;let d=new B({attributes:new F,primitiveType:v.LINES});return d.attributes.position=new T({componentDatatype:D.DOUBLE,componentsPerAttribute:3,values:n}),d.indices=c,d}function X(t,e){let i=t._surfaceHeight,m=t._extrudedHeight,s=t._ellipsoid,h=Y(t,e),p=e.height,_=e.width,A=z.scaleToGeodeticHeight(h.attributes.position.values,i,s,!1),o=A.length,g=new Float64Array(o*2);g.set(A);let n=z.scaleToGeodeticHeight(h.attributes.position.values,m,s);g.set(n,o),h.attributes.position.values=g;let l=e.northCap,f=e.southCap,a=4;l&&(a-=1),f&&(a-=1);let r=(g.length/3+a)*2,u=q.createTypedArray(g.length/3,r);o=g.length/6;let c=0;for(let d=0;d<o-1;d++)u[c++]=d,u[c++]=d+1,u[c++]=d+o,u[c++]=d+o+1;u[c++]=o-1,u[c++]=0,u[c++]=o+o-1,u[c++]=o,u[c++]=0,u[c++]=o;let E;if(l)E=p-1;else{let d=_-1;u[c++]=d,u[c++]=d+o,E=_+p-2}if(u[c++]=E,u[c++]=E+o,!f){let d=_+E-1;u[c++]=d,u[c]=d+o}return h.indices=u,h}function k(t){t=t??M.EMPTY_OBJECT;let e=t.rectangle,i=t.granularity??S.RADIANS_PER_DEGREE,m=t.ellipsoid??w.default,s=t.rotation??0;if(!H(e))throw new C("rectangle is required.");if(b._validate(e),e.north<e.south)throw new C("options.rectangle.north must be greater than options.rectangle.south");let h=t.height??0,p=t.extrudedHeight??h;this._rectangle=b.clone(e),this._granularity=i,this._ellipsoid=m,this._surfaceHeight=Math.max(h,p),this._rotation=s,this._extrudedHeight=Math.min(h,p),this._offsetAttribute=t.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}k.packedLength=b.packedLength+w.packedLength+5;k.pack=function(t,e,i){if(!H(t))throw new C("value is required");if(!H(e))throw new C("array is required");return i=i??0,b.pack(t._rectangle,e,i),i+=b.packedLength,w.pack(t._ellipsoid,e,i),i+=w.packedLength,e[i++]=t._granularity,e[i++]=t._surfaceHeight,e[i++]=t._rotation,e[i++]=t._extrudedHeight,e[i]=t._offsetAttribute??-1,e};var J=new b,V=w.clone(w.UNIT_SPHERE),N={rectangle:J,ellipsoid:V,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};k.unpack=function(t,e,i){if(!H(t))throw new C("array is required");e=e??0;let m=b.unpack(t,e,J);e+=b.packedLength;let s=w.unpack(t,e,V);e+=w.packedLength;let h=t[e++],p=t[e++],_=t[e++],A=t[e++],o=t[e];return H(i)?(i._rectangle=b.clone(m,i._rectangle),i._ellipsoid=w.clone(s,i._ellipsoid),i._surfaceHeight=p,i._rotation=_,i._extrudedHeight=A,i._offsetAttribute=o===-1?void 0:o,i):(N.granularity=h,N.height=p,N.rotation=_,N.extrudedHeight=A,N.offsetAttribute=o===-1?void 0:o,new k(N))};var Z=new U;k.createGeometry=function(t){let e=t._rectangle,i=t._ellipsoid,m=R.computeOptions(e,t._granularity,t._rotation,0,W,Z),s,h;if(S.equalsEpsilon(e.north,e.south,S.EPSILON10)||S.equalsEpsilon(e.east,e.west,S.EPSILON10))return;let p=t._surfaceHeight,_=t._extrudedHeight,A=!S.equalsEpsilon(p,_,0,S.EPSILON2),o;if(A){if(s=X(t,m),H(t._offsetAttribute)){let l=s.attributes.position.values.length/3,f=new Uint8Array(l);t._offsetAttribute===y.TOP?f=f.fill(1,0,l/2):(o=t._offsetAttribute===y.NONE?0:1,f=f.fill(o)),s.attributes.applyOffset=new T({componentDatatype:D.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let g=P.fromRectangle3D(e,i,p,K),n=P.fromRectangle3D(e,i,_,j);h=P.union(g,n)}else{if(s=Y(t,m),s.attributes.position.values=z.scaleToGeodeticHeight(s.attributes.position.values,p,i,!1),H(t._offsetAttribute)){let g=s.attributes.position.values.length;o=t._offsetAttribute===y.NONE?0:1;let n=new Uint8Array(g/3).fill(o);s.attributes.applyOffset=new T({componentDatatype:D.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}h=P.fromRectangle3D(e,i,p)}return new B({attributes:s.attributes,indices:s.indices,primitiveType:v.LINES,boundingSphere:h,offsetAttribute:t._offsetAttribute})};var O=k;function $(t,e){return H(e)&&(t=O.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),t._rectangle=b.clone(t._rectangle),O.createGeometry(t)}var Et=$;export{Et as default}; diff --git a/plugins/feature/map/Cesium/Workers/createSimplePolylineGeometry.js b/plugins/feature/map/Cesium/Workers/createSimplePolylineGeometry.js index d68a24fad..88154412b 100644 --- a/plugins/feature/map/Cesium/Workers/createSimplePolylineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createSimplePolylineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-Q4LSC5X3.js";import{a as L}from"./chunk-IFR5HKVH.js";import{a as P}from"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as X}from"./chunk-JQLYZQ6V.js";import{a as W}from"./chunk-J3L5WX3X.js";import{b as K,c as Q,d as H}from"./chunk-AVPLM4UI.js";import{d as j}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as v}from"./chunk-WER4LUMF.js";import{a as A,d as w,f as J}from"./chunk-FGKVHLJ4.js";import{a as G}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as D}from"./chunk-ELJAHN3H.js";import{e as u}from"./chunk-3BGP4HCL.js";function Z(t,e,o,i,s,c,p){let g=P.numberOfPoints(t,e,s),f,n=o.red,m=o.green,d=o.blue,T=o.alpha,l=i.red,h=i.green,y=i.blue,S=i.alpha;if(r.equals(o,i)){for(f=0;f<g;f++)c[p++]=r.floatToByte(n),c[p++]=r.floatToByte(m),c[p++]=r.floatToByte(d),c[p++]=r.floatToByte(T);return p}let N=(l-n)/g,V=(h-m)/g,R=(y-d)/g,_=(S-T)/g,a=p;for(f=0;f<g;f++)c[a++]=r.floatToByte(n+f*N),c[a++]=r.floatToByte(m+f*V),c[a++]=r.floatToByte(d+f*R),c[a++]=r.floatToByte(T+f*_);return a}function O(t){t=t??J.EMPTY_OBJECT;let e=t.positions,o=t.colors,i=t.colorsPerVertex??!1;if(!u(e)||e.length<2)throw new D("At least two positions are required.");if(u(o)&&(i&&o.length<e.length||!i&&o.length<e.length-1))throw new D("colors has an invalid length.");this._positions=e,this._colors=o,this._colorsPerVertex=i,this._arcType=t.arcType??L.GEODESIC,this._granularity=t.granularity??G.RADIANS_PER_DEGREE,this._ellipsoid=t.ellipsoid??w.default,this._workerName="createSimplePolylineGeometry";let s=1+e.length*A.packedLength;s+=u(o)?1+o.length*r.packedLength:1,this.packedLength=s+w.packedLength+3}O.pack=function(t,e,o){if(!u(t))throw new D("value is required");if(!u(e))throw new D("array is required");o=o??0;let i,s=t._positions,c=s.length;for(e[o++]=c,i=0;i<c;++i,o+=A.packedLength)A.pack(s[i],e,o);let p=t._colors;for(c=u(p)?p.length:0,e[o++]=c,i=0;i<c;++i,o+=r.packedLength)r.pack(p[i],e,o);return w.pack(t._ellipsoid,e,o),o+=w.packedLength,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._arcType,e[o]=t._granularity,e};O.unpack=function(t,e,o){if(!u(t))throw new D("array is required");e=e??0;let i,s=t[e++],c=new Array(s);for(i=0;i<s;++i,e+=A.packedLength)c[i]=A.unpack(t,e);s=t[e++];let p=s>0?new Array(s):void 0;for(i=0;i<s;++i,e+=r.packedLength)p[i]=r.unpack(t,e);let g=w.unpack(t,e);e+=w.packedLength;let f=t[e++]===1,n=t[e++],m=t[e];return u(o)?(o._positions=c,o._colors=p,o._ellipsoid=g,o._colorsPerVertex=f,o._arcType=n,o._granularity=m,o):new O({positions:c,colors:p,ellipsoid:g,colorsPerVertex:f,arcType:n,granularity:m})};var U=new Array(2),q=new Array(2),$={positions:U,height:q,ellipsoid:void 0,minDistance:void 0,granularity:void 0};O.createGeometry=function(t){let e=t._positions,o=t._colors,i=t._colorsPerVertex,s=t._arcType,c=t._granularity,p=t._ellipsoid,g=G.chordLength(c,p.maximumRadius),f=u(o)&&!i,n,m=e.length,d,T,l,h,y=0;if(s===L.GEODESIC||s===L.RHUMB){let _,a,k;s===L.GEODESIC?(_=G.chordLength(c,p.maximumRadius),a=P.numberOfPoints,k=P.generateArc):(_=c,a=P.numberOfPointsRhumbLine,k=P.generateRhumbArc);let z=P.extractHeights(e,p),B=$;if(s===L.GEODESIC?B.minDistance=g:B.granularity=c,B.ellipsoid=p,f){let b=0;for(n=0;n<m-1;n++)b+=a(e[n],e[n+1],_)+1;d=new Float64Array(b*3),l=new Uint8Array(b*4),B.positions=U,B.height=q;let E=0;for(n=0;n<m-1;++n){U[0]=e[n],U[1]=e[n+1],q[0]=z[n],q[1]=z[n+1];let C=k(B);if(u(o)){let M=C.length/3;h=o[n];for(let F=0;F<M;++F)l[E++]=r.floatToByte(h.red),l[E++]=r.floatToByte(h.green),l[E++]=r.floatToByte(h.blue),l[E++]=r.floatToByte(h.alpha)}d.set(C,y),y+=C.length}}else if(B.positions=e,B.height=z,d=new Float64Array(k(B)),u(o)){for(l=new Uint8Array(d.length/3*4),n=0;n<m-1;++n){let E=e[n],C=e[n+1],M=o[n],F=o[n+1];y=Z(E,C,M,F,g,l,y)}let b=o[m-1];l[y++]=r.floatToByte(b.red),l[y++]=r.floatToByte(b.green),l[y++]=r.floatToByte(b.blue),l[y++]=r.floatToByte(b.alpha)}}else{T=f?m*2-2:m,d=new Float64Array(T*3),l=u(o)?new Uint8Array(T*4):void 0;let _=0,a=0;for(n=0;n<m;++n){let k=e[n];if(f&&n>0&&(A.pack(k,d,_),_+=3,h=o[n-1],l[a++]=r.floatToByte(h.red),l[a++]=r.floatToByte(h.green),l[a++]=r.floatToByte(h.blue),l[a++]=r.floatToByte(h.alpha)),f&&n===m-1)break;A.pack(k,d,_),_+=3,u(o)&&(h=o[n],l[a++]=r.floatToByte(h.red),l[a++]=r.floatToByte(h.green),l[a++]=r.floatToByte(h.blue),l[a++]=r.floatToByte(h.alpha))}}let S=new W;S.position=new H({componentDatatype:v.DOUBLE,componentsPerAttribute:3,values:d}),u(o)&&(S.color=new H({componentDatatype:v.UNSIGNED_BYTE,componentsPerAttribute:4,values:l,normalize:!0})),T=d.length/3;let N=(T-1)*2,V=X.createTypedArray(T,N),R=0;for(n=0;n<T-1;++n)V[R++]=n,V[R++]=n+1;return new Q({attributes:S,indices:V,primitiveType:K.LINES,boundingSphere:j.fromPoints(e)})};var Y=O;function x(t,e){return u(e)&&(t=Y.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),Y.createGeometry(t)}var _e=x;export{_e as default}; +import{a as r}from"./chunk-RDRVGSTZ.js";import{a as L}from"./chunk-LXGG3JDP.js";import{a as P}from"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as X}from"./chunk-AZINMULF.js";import{a as W}from"./chunk-ILBQ77ZM.js";import{b as K,c as Q,d as H}from"./chunk-7RNSURKI.js";import{c as j}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as v}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as w}from"./chunk-KP72RGCH.js";import{a as A,c as J}from"./chunk-OSVSBQDY.js";import{a as G}from"./chunk-LZC73BOP.js";import{a as D}from"./chunk-OU2IPMYE.js";import{f as u}from"./chunk-H7SJWKIY.js";function Z(t,e,o,i,s,c,p){let g=P.numberOfPoints(t,e,s),f,n=o.red,m=o.green,d=o.blue,T=o.alpha,l=i.red,h=i.green,y=i.blue,S=i.alpha;if(r.equals(o,i)){for(f=0;f<g;f++)c[p++]=r.floatToByte(n),c[p++]=r.floatToByte(m),c[p++]=r.floatToByte(d),c[p++]=r.floatToByte(T);return p}let N=(l-n)/g,V=(h-m)/g,R=(y-d)/g,_=(S-T)/g,a=p;for(f=0;f<g;f++)c[a++]=r.floatToByte(n+f*N),c[a++]=r.floatToByte(m+f*V),c[a++]=r.floatToByte(d+f*R),c[a++]=r.floatToByte(T+f*_);return a}function O(t){t=t??J.EMPTY_OBJECT;let e=t.positions,o=t.colors,i=t.colorsPerVertex??!1;if(!u(e)||e.length<2)throw new D("At least two positions are required.");if(u(o)&&(i&&o.length<e.length||!i&&o.length<e.length-1))throw new D("colors has an invalid length.");this._positions=e,this._colors=o,this._colorsPerVertex=i,this._arcType=t.arcType??L.GEODESIC,this._granularity=t.granularity??G.RADIANS_PER_DEGREE,this._ellipsoid=t.ellipsoid??w.default,this._workerName="createSimplePolylineGeometry";let s=1+e.length*A.packedLength;s+=u(o)?1+o.length*r.packedLength:1,this.packedLength=s+w.packedLength+3}O.pack=function(t,e,o){if(!u(t))throw new D("value is required");if(!u(e))throw new D("array is required");o=o??0;let i,s=t._positions,c=s.length;for(e[o++]=c,i=0;i<c;++i,o+=A.packedLength)A.pack(s[i],e,o);let p=t._colors;for(c=u(p)?p.length:0,e[o++]=c,i=0;i<c;++i,o+=r.packedLength)r.pack(p[i],e,o);return w.pack(t._ellipsoid,e,o),o+=w.packedLength,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._arcType,e[o]=t._granularity,e};O.unpack=function(t,e,o){if(!u(t))throw new D("array is required");e=e??0;let i,s=t[e++],c=new Array(s);for(i=0;i<s;++i,e+=A.packedLength)c[i]=A.unpack(t,e);s=t[e++];let p=s>0?new Array(s):void 0;for(i=0;i<s;++i,e+=r.packedLength)p[i]=r.unpack(t,e);let g=w.unpack(t,e);e+=w.packedLength;let f=t[e++]===1,n=t[e++],m=t[e];return u(o)?(o._positions=c,o._colors=p,o._ellipsoid=g,o._colorsPerVertex=f,o._arcType=n,o._granularity=m,o):new O({positions:c,colors:p,ellipsoid:g,colorsPerVertex:f,arcType:n,granularity:m})};var U=new Array(2),q=new Array(2),$={positions:U,height:q,ellipsoid:void 0,minDistance:void 0,granularity:void 0};O.createGeometry=function(t){let e=t._positions,o=t._colors,i=t._colorsPerVertex,s=t._arcType,c=t._granularity,p=t._ellipsoid,g=G.chordLength(c,p.maximumRadius),f=u(o)&&!i,n,m=e.length,d,T,l,h,y=0;if(s===L.GEODESIC||s===L.RHUMB){let _,a,k;s===L.GEODESIC?(_=G.chordLength(c,p.maximumRadius),a=P.numberOfPoints,k=P.generateArc):(_=c,a=P.numberOfPointsRhumbLine,k=P.generateRhumbArc);let z=P.extractHeights(e,p),B=$;if(s===L.GEODESIC?B.minDistance=g:B.granularity=c,B.ellipsoid=p,f){let b=0;for(n=0;n<m-1;n++)b+=a(e[n],e[n+1],_)+1;d=new Float64Array(b*3),l=new Uint8Array(b*4),B.positions=U,B.height=q;let E=0;for(n=0;n<m-1;++n){U[0]=e[n],U[1]=e[n+1],q[0]=z[n],q[1]=z[n+1];let C=k(B);if(u(o)){let M=C.length/3;h=o[n];for(let F=0;F<M;++F)l[E++]=r.floatToByte(h.red),l[E++]=r.floatToByte(h.green),l[E++]=r.floatToByte(h.blue),l[E++]=r.floatToByte(h.alpha)}d.set(C,y),y+=C.length}}else if(B.positions=e,B.height=z,d=new Float64Array(k(B)),u(o)){for(l=new Uint8Array(d.length/3*4),n=0;n<m-1;++n){let E=e[n],C=e[n+1],M=o[n],F=o[n+1];y=Z(E,C,M,F,g,l,y)}let b=o[m-1];l[y++]=r.floatToByte(b.red),l[y++]=r.floatToByte(b.green),l[y++]=r.floatToByte(b.blue),l[y]=r.floatToByte(b.alpha)}}else{T=f?m*2-2:m,d=new Float64Array(T*3),l=u(o)?new Uint8Array(T*4):void 0;let _=0,a=0;for(n=0;n<m;++n){let k=e[n];if(f&&n>0&&(A.pack(k,d,_),_+=3,h=o[n-1],l[a++]=r.floatToByte(h.red),l[a++]=r.floatToByte(h.green),l[a++]=r.floatToByte(h.blue),l[a++]=r.floatToByte(h.alpha)),f&&n===m-1)break;A.pack(k,d,_),_+=3,u(o)&&(h=o[n],l[a++]=r.floatToByte(h.red),l[a++]=r.floatToByte(h.green),l[a++]=r.floatToByte(h.blue),l[a++]=r.floatToByte(h.alpha))}}let S=new W;S.position=new H({componentDatatype:v.DOUBLE,componentsPerAttribute:3,values:d}),u(o)&&(S.color=new H({componentDatatype:v.UNSIGNED_BYTE,componentsPerAttribute:4,values:l,normalize:!0})),T=d.length/3;let N=(T-1)*2,V=X.createTypedArray(T,N),R=0;for(n=0;n<T-1;++n)V[R++]=n,V[R++]=n+1;return new Q({attributes:S,indices:V,primitiveType:K.LINES,boundingSphere:j.fromPoints(e)})};var Y=O;function x(t,e){return u(e)&&(t=Y.unpack(t,e)),t._ellipsoid=w.clone(t._ellipsoid),Y.createGeometry(t)}var _e=x;export{_e as default}; diff --git a/plugins/feature/map/Cesium/Workers/createSphereGeometry.js b/plugins/feature/map/Cesium/Workers/createSphereGeometry.js index 6ebf109f6..dc6313dca 100644 --- a/plugins/feature/map/Cesium/Workers/createSphereGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createSphereGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as r}from"./chunk-FUD3WFGN.js";import"./chunk-4W2MZV6I.js";import{a as m}from"./chunk-S3L7VZFL.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as s}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as p}from"./chunk-ELJAHN3H.js";import{e as c}from"./chunk-3BGP4HCL.js";function a(e){let t=e.radius??1,o={radii:new s(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new r(o),this._workerName="createSphereGeometry"}a.packedLength=r.packedLength;a.pack=function(e,t,n){return p.typeOf.object("value",e),r.pack(e._ellipsoidGeometry,t,n)};var l=new r,i={radius:void 0,radii:new s,vertexFormat:new m,stackPartitions:void 0,slicePartitions:void 0};a.unpack=function(e,t,n){let o=r.unpack(e,t,l);return i.vertexFormat=m.clone(o._vertexFormat,i.vertexFormat),i.stackPartitions=o._stackPartitions,i.slicePartitions=o._slicePartitions,c(n)?(s.clone(o._radii,i.radii),n._ellipsoidGeometry=new r(i),n):(i.radius=o._radii.x,new a(i))};a.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)};var d=a;function f(e,t){return c(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}var w=f;export{w as default}; +import{a as r}from"./chunk-J6775DYR.js";import"./chunk-GNBKSQYP.js";import{a as m}from"./chunk-FZSSAWMQ.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a as s}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as p}from"./chunk-OU2IPMYE.js";import{f as c}from"./chunk-H7SJWKIY.js";function a(e){let t=e.radius??1,o={radii:new s(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new r(o),this._workerName="createSphereGeometry"}a.packedLength=r.packedLength;a.pack=function(e,t,n){return p.typeOf.object("value",e),r.pack(e._ellipsoidGeometry,t,n)};var l=new r,i={radius:void 0,radii:new s,vertexFormat:new m,stackPartitions:void 0,slicePartitions:void 0};a.unpack=function(e,t,n){let o=r.unpack(e,t,l);return i.vertexFormat=m.clone(o._vertexFormat,i.vertexFormat),i.stackPartitions=o._stackPartitions,i.slicePartitions=o._slicePartitions,c(n)?(s.clone(o._radii,i.radii),n._ellipsoidGeometry=new r(i),n):(i.radius=o._radii.x,new a(i))};a.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)};var d=a;function f(e,t){return c(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}var w=f;export{w as default}; diff --git a/plugins/feature/map/Cesium/Workers/createSphereOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createSphereOutlineGeometry.js index 27f68b9a4..a9da6ac31 100644 --- a/plugins/feature/map/Cesium/Workers/createSphereOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createSphereOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as t}from"./chunk-PZWPGERZ.js";import"./chunk-4W2MZV6I.js";import"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as c}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{b as u}from"./chunk-ELJAHN3H.js";import{e as a}from"./chunk-3BGP4HCL.js";function s(i){let e=i.radius??1,r={radii:new c(e,e,e),stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new t(r),this._workerName="createSphereOutlineGeometry"}s.packedLength=t.packedLength;s.pack=function(i,e,o){return u.typeOf.object("value",i),t.pack(i._ellipsoidGeometry,e,o)};var l=new t,n={radius:void 0,radii:new c,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};s.unpack=function(i,e,o){let r=t.unpack(i,e,l);return n.stackPartitions=r._stackPartitions,n.slicePartitions=r._slicePartitions,n.subdivisions=r._subdivisions,a(o)?(c.clone(r._radii,n.radii),o._ellipsoidGeometry=new t(n),o):(n.radius=r._radii.x,new s(n))};s.createGeometry=function(i){return t.createGeometry(i._ellipsoidGeometry)};var d=s;function m(i,e){return a(e)&&(i=d.unpack(i,e)),d.createGeometry(i)}var h=m;export{h as default}; +import{a as t}from"./chunk-4U57P2C5.js";import"./chunk-GNBKSQYP.js";import"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a as c}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import{b as u}from"./chunk-OU2IPMYE.js";import{f as a}from"./chunk-H7SJWKIY.js";function s(i){let e=i.radius??1,r={radii:new c(e,e,e),stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new t(r),this._workerName="createSphereOutlineGeometry"}s.packedLength=t.packedLength;s.pack=function(i,e,o){return u.typeOf.object("value",i),t.pack(i._ellipsoidGeometry,e,o)};var l=new t,n={radius:void 0,radii:new c,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};s.unpack=function(i,e,o){let r=t.unpack(i,e,l);return n.stackPartitions=r._stackPartitions,n.slicePartitions=r._slicePartitions,n.subdivisions=r._subdivisions,a(o)?(c.clone(r._radii,n.radii),o._ellipsoidGeometry=new t(n),o):(n.radius=r._radii.x,new s(n))};s.createGeometry=function(i){return t.createGeometry(i._ellipsoidGeometry)};var d=s;function m(i,e){return a(e)&&(i=d.unpack(i,e)),d.createGeometry(i)}var h=m;export{h as default}; diff --git a/plugins/feature/map/Cesium/Workers/createTaskProcessorWorker.js b/plugins/feature/map/Cesium/Workers/createTaskProcessorWorker.js index 34676f978..4c2c6be4f 100644 --- a/plugins/feature/map/Cesium/Workers/createTaskProcessorWorker.js +++ b/plugins/feature/map/Cesium/Workers/createTaskProcessorWorker.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a}from"./chunk-U3N6LNE4.js";import"./chunk-3BGP4HCL.js";export{a as default}; +import{a}from"./chunk-JJVL7F22.js";import"./chunk-H7SJWKIY.js";export{a as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVectorTileClampedPolylines.js b/plugins/feature/map/Cesium/Workers/createVectorTileClampedPolylines.js index dc12e38a0..3d56b2760 100644 --- a/plugins/feature/map/Cesium/Workers/createVectorTileClampedPolylines.js +++ b/plugins/feature/map/Cesium/Workers/createVectorTileClampedPolylines.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as J}from"./chunk-U3N6LNE4.js";import{a as Y}from"./chunk-X6N776GR.js";import{a as B}from"./chunk-JQLYZQ6V.js";import{c as X,h as W}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as t,b as k,d as _}from"./chunk-FGKVHLJ4.js";import{a as v}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import"./chunk-3BGP4HCL.js";var V=32767,it=Math.cos(v.toRadians(150)),ct=new k,rt=new t;function at(e,o,c,i,s,A,h){let g=e.length,f=new Float64Array(g*3);for(let d=0;d<g;++d){let l=e[d],r=o[d],E=c[d],n=v.lerp(i.west,i.east,l/V),p=v.lerp(i.south,i.north,r/V),w=v.lerp(s,A,E/V),x=k.fromRadians(n,p,w,ct),P=h.cartographicToCartesian(x,rt);t.pack(P,f,d*3)}return f}function dt(e){let o=e.length,c=new Uint32Array(o+1),i=0;for(let s=0;s<o;++s)c[s]=i,i+=e[s];return c[o]=i,c}var lt=new k,ht=new k;function ft(e,o,c,i){let s=i.length,A=e.length,h=new Uint8Array(A),g=lt,f=ht,d=0;for(let r=0;r<s;r++){let E=i[r],n=E;for(let p=1;p<E;p++){let w=d+p,x=w-1;f.longitude=e[w],f.latitude=o[w],g.longitude=e[x],g.latitude=o[x],k.equals(f,g)&&(n--,h[x]=1)}i[r]=n,d+=E}let l=0;for(let r=0;r<A;r++)h[r]!==1&&(e[l]=e[r],o[l]=o[r],c[l]=c[r],l++)}function ot(e){let o=e*8,c=o*3,i=o*4;this.startEllipsoidNormals=new Float32Array(c),this.endEllipsoidNormals=new Float32Array(c),this.startPositionAndHeights=new Float32Array(i),this.startFaceNormalAndVertexCornerIds=new Float32Array(i),this.endPositionAndHeights=new Float32Array(i),this.endFaceNormalAndHalfWidths=new Float32Array(i),this.vertexBatchIds=new Uint16Array(o),this.indices=B.createTypedArray(o,36*e),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}var Q=new t,pt=new t;function $(e,o,c,i,s){let A=t.subtract(c,o,pt),h=t.subtract(o,e,Q);return t.normalize(A,A),t.normalize(h,h),t.dot(A,h)<it&&(h=t.multiplyByScalar(h,-1,Q)),t.add(A,h,s),t.equals(s,t.ZERO)&&(s=t.subtract(e,o)),t.cross(s,i,s),t.cross(i,s,s),t.normalize(s,s),s}var st=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],j=st.length,tt=new t,ut=new t,mt=new t,At=new t,Nt=new t;ot.prototype.addVolume=function(e,o,c,i,s,A,h,g,f,d){let l=t.add(o,f,tt),r=d.geodeticSurfaceNormal(l,ut);l=t.add(c,f,tt);let E=d.geodeticSurfaceNormal(l,At),n=$(e,o,c,r,mt),p=$(i,c,o,E,Nt),w=this.startEllipsoidNormals,x=this.endEllipsoidNormals,P=this.startPositionAndHeights,H=this.startFaceNormalAndVertexCornerIds,b=this.endPositionAndHeights,a=this.endFaceNormalAndHalfWidths,F=this.vertexBatchIds,m=this.batchIdOffset,I=this.vec3Offset,u=this.vec4Offset,N;for(N=0;N<8;N++)t.pack(r,w,I),t.pack(E,x,I),t.pack(o,P,u),P[u+3]=s,t.pack(c,b,u),b[u+3]=A,t.pack(n,H,u),H[u+3]=N,t.pack(p,a,u),a[u+3]=h,F[m++]=g,I+=3,u+=4;this.batchIdOffset=m,this.vec3Offset=I,this.vec4Offset=u;let C=this.indices,y=this.volumeStartIndex,z=this.indexOffset;for(N=0;N<j;N++)C[z+N]=st[N]+y;this.volumeStartIndex+=8,this.indexOffset+=j};var gt=new W,Et=new _,wt=new t,M=new t,It=new t,xt=new t,T=new t;function Pt(e,o){let c=new Uint16Array(e.positions),i=new Uint16Array(e.widths),s=new Uint32Array(e.counts),A=new Uint16Array(e.batchIds),h=gt,g=Et,f=wt,d=new Float64Array(e.packedBuffer),l=0,r=d[l++],E=d[l++];W.unpack(d,l,h),l+=W.packedLength,_.unpack(d,l,g),l+=_.packedLength,t.unpack(d,l,f);let n,p=c.length/3,w=c.subarray(0,p),x=c.subarray(p,2*p),P=c.subarray(2*p,3*p);Y.zigZagDeltaDecode(w,x,P),ft(w,x,P,s);let H=s.length,b=0;for(n=0;n<H;n++){let y=s[n];b+=y-1}let a=new ot(b),F=at(w,x,P,h,r,E,g,f);p=w.length;let m=new Float32Array(p*3);for(n=0;n<p;++n)m[n*3]=F[n*3]-f.x,m[n*3+1]=F[n*3+1]-f.y,m[n*3+2]=F[n*3+2]-f.z;let I=0,u=0;for(n=0;n<H;n++){let y=s[n]-1,z=i[n]*.5,et=A[n],q=I;for(let D=0;D<y;D++){let S=t.unpack(m,I,It),O=t.unpack(m,I+3,xt),G=P[u],Z=P[u+1];G=v.lerp(r,E,G/V),Z=v.lerp(r,E,Z/V),u++;let L=M,R=T;if(D===0){let U=q+y*3,K=t.unpack(m,U,M);if(t.equals(K,S))t.unpack(m,U-3,L);else{let nt=t.subtract(S,O,M);L=t.add(nt,S,M)}}else t.unpack(m,I-3,L);if(D===y-1){let U=t.unpack(m,q,T);if(t.equals(U,O))t.unpack(m,q+3,R);else{let K=t.subtract(O,S,T);R=t.add(K,O,T)}}else t.unpack(m,I+6,R);a.addVolume(L,S,O,R,G,Z,z,et,f,g),I+=3}I+=3,u++}let N=a.indices;o.push(a.startEllipsoidNormals.buffer),o.push(a.endEllipsoidNormals.buffer),o.push(a.startPositionAndHeights.buffer),o.push(a.startFaceNormalAndVertexCornerIds.buffer),o.push(a.endPositionAndHeights.buffer),o.push(a.endFaceNormalAndHalfWidths.buffer),o.push(a.vertexBatchIds.buffer),o.push(N.buffer);let C={indexDatatype:N.BYTES_PER_ELEMENT===2?B.UNSIGNED_SHORT:B.UNSIGNED_INT,startEllipsoidNormals:a.startEllipsoidNormals.buffer,endEllipsoidNormals:a.endEllipsoidNormals.buffer,startPositionAndHeights:a.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:a.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:a.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:a.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:a.vertexBatchIds.buffer,indices:N.buffer};if(e.keepDecodedPositions){let y=dt(s);o.push(F.buffer,y.buffer),C=X(C,{decodedPositions:F.buffer,decodedPositionOffsets:y.buffer})}return C}var Vt=J(Pt);export{Vt as default}; +import{a as J}from"./chunk-JJVL7F22.js";import{a as Y}from"./chunk-QCE33JV5.js";import{a as B}from"./chunk-AZINMULF.js";import{c as X,j as W}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as k,c as _}from"./chunk-KP72RGCH.js";import{a as t}from"./chunk-OSVSBQDY.js";import{a as v}from"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";var V=32767,it=Math.cos(v.toRadians(150)),ct=new k,rt=new t;function at(e,o,c,i,s,A,h){let g=e.length,f=new Float64Array(g*3);for(let d=0;d<g;++d){let l=e[d],r=o[d],E=c[d],n=v.lerp(i.west,i.east,l/V),p=v.lerp(i.south,i.north,r/V),w=v.lerp(s,A,E/V),x=k.fromRadians(n,p,w,ct),P=h.cartographicToCartesian(x,rt);t.pack(P,f,d*3)}return f}function dt(e){let o=e.length,c=new Uint32Array(o+1),i=0;for(let s=0;s<o;++s)c[s]=i,i+=e[s];return c[o]=i,c}var lt=new k,ht=new k;function ft(e,o,c,i){let s=i.length,A=e.length,h=new Uint8Array(A),g=lt,f=ht,d=0;for(let r=0;r<s;r++){let E=i[r],n=E;for(let p=1;p<E;p++){let w=d+p,x=w-1;f.longitude=e[w],f.latitude=o[w],g.longitude=e[x],g.latitude=o[x],k.equals(f,g)&&(n--,h[x]=1)}i[r]=n,d+=E}let l=0;for(let r=0;r<A;r++)h[r]!==1&&(e[l]=e[r],o[l]=o[r],c[l]=c[r],l++)}function ot(e){let o=e*8,c=o*3,i=o*4;this.startEllipsoidNormals=new Float32Array(c),this.endEllipsoidNormals=new Float32Array(c),this.startPositionAndHeights=new Float32Array(i),this.startFaceNormalAndVertexCornerIds=new Float32Array(i),this.endPositionAndHeights=new Float32Array(i),this.endFaceNormalAndHalfWidths=new Float32Array(i),this.vertexBatchIds=new Uint16Array(o),this.indices=B.createTypedArray(o,36*e),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}var Q=new t,pt=new t;function $(e,o,c,i,s){let A=t.subtract(c,o,pt),h=t.subtract(o,e,Q);return t.normalize(A,A),t.normalize(h,h),t.dot(A,h)<it&&(h=t.multiplyByScalar(h,-1,Q)),t.add(A,h,s),t.equals(s,t.ZERO)&&(s=t.subtract(e,o)),t.cross(s,i,s),t.cross(i,s,s),t.normalize(s,s),s}var st=[0,2,6,0,6,4,0,1,3,0,3,2,0,4,5,0,5,1,5,3,1,5,7,3,7,5,4,7,4,6,7,6,2,7,2,3],j=st.length,tt=new t,ut=new t,mt=new t,At=new t,Nt=new t;ot.prototype.addVolume=function(e,o,c,i,s,A,h,g,f,d){let l=t.add(o,f,tt),r=d.geodeticSurfaceNormal(l,ut);l=t.add(c,f,tt);let E=d.geodeticSurfaceNormal(l,At),n=$(e,o,c,r,mt),p=$(i,c,o,E,Nt),w=this.startEllipsoidNormals,x=this.endEllipsoidNormals,P=this.startPositionAndHeights,H=this.startFaceNormalAndVertexCornerIds,b=this.endPositionAndHeights,a=this.endFaceNormalAndHalfWidths,F=this.vertexBatchIds,m=this.batchIdOffset,I=this.vec3Offset,u=this.vec4Offset,N;for(N=0;N<8;N++)t.pack(r,w,I),t.pack(E,x,I),t.pack(o,P,u),P[u+3]=s,t.pack(c,b,u),b[u+3]=A,t.pack(n,H,u),H[u+3]=N,t.pack(p,a,u),a[u+3]=h,F[m++]=g,I+=3,u+=4;this.batchIdOffset=m,this.vec3Offset=I,this.vec4Offset=u;let C=this.indices,y=this.volumeStartIndex,z=this.indexOffset;for(N=0;N<j;N++)C[z+N]=st[N]+y;this.volumeStartIndex+=8,this.indexOffset+=j};var gt=new W,Et=new _,wt=new t,M=new t,It=new t,xt=new t,T=new t;function Pt(e,o){let c=new Uint16Array(e.positions),i=new Uint16Array(e.widths),s=new Uint32Array(e.counts),A=new Uint16Array(e.batchIds),h=gt,g=Et,f=wt,d=new Float64Array(e.packedBuffer),l=0,r=d[l++],E=d[l++];W.unpack(d,l,h),l+=W.packedLength,_.unpack(d,l,g),l+=_.packedLength,t.unpack(d,l,f);let n,p=c.length/3,w=c.subarray(0,p),x=c.subarray(p,2*p),P=c.subarray(2*p,3*p);Y.zigZagDeltaDecode(w,x,P),ft(w,x,P,s);let H=s.length,b=0;for(n=0;n<H;n++){let y=s[n];b+=y-1}let a=new ot(b),F=at(w,x,P,h,r,E,g,f);p=w.length;let m=new Float32Array(p*3);for(n=0;n<p;++n)m[n*3]=F[n*3]-f.x,m[n*3+1]=F[n*3+1]-f.y,m[n*3+2]=F[n*3+2]-f.z;let I=0,u=0;for(n=0;n<H;n++){let y=s[n]-1,z=i[n]*.5,et=A[n],q=I;for(let D=0;D<y;D++){let S=t.unpack(m,I,It),O=t.unpack(m,I+3,xt),G=P[u],Z=P[u+1];G=v.lerp(r,E,G/V),Z=v.lerp(r,E,Z/V),u++;let L=M,R=T;if(D===0){let U=q+y*3,K=t.unpack(m,U,M);if(t.equals(K,S))t.unpack(m,U-3,L);else{let nt=t.subtract(S,O,M);L=t.add(nt,S,M)}}else t.unpack(m,I-3,L);if(D===y-1){let U=t.unpack(m,q,T);if(t.equals(U,O))t.unpack(m,q+3,R);else{let K=t.subtract(O,S,T);R=t.add(K,O,T)}}else t.unpack(m,I+6,R);a.addVolume(L,S,O,R,G,Z,z,et,f,g),I+=3}I+=3,u++}let N=a.indices;o.push(a.startEllipsoidNormals.buffer),o.push(a.endEllipsoidNormals.buffer),o.push(a.startPositionAndHeights.buffer),o.push(a.startFaceNormalAndVertexCornerIds.buffer),o.push(a.endPositionAndHeights.buffer),o.push(a.endFaceNormalAndHalfWidths.buffer),o.push(a.vertexBatchIds.buffer),o.push(N.buffer);let C={indexDatatype:N.BYTES_PER_ELEMENT===2?B.UNSIGNED_SHORT:B.UNSIGNED_INT,startEllipsoidNormals:a.startEllipsoidNormals.buffer,endEllipsoidNormals:a.endEllipsoidNormals.buffer,startPositionAndHeights:a.startPositionAndHeights.buffer,startFaceNormalAndVertexCornerIds:a.startFaceNormalAndVertexCornerIds.buffer,endPositionAndHeights:a.endPositionAndHeights.buffer,endFaceNormalAndHalfWidths:a.endFaceNormalAndHalfWidths.buffer,vertexBatchIds:a.vertexBatchIds.buffer,indices:N.buffer};if(e.keepDecodedPositions){let y=dt(s);o.push(F.buffer,y.buffer),C=X(C,{decodedPositions:F.buffer,decodedPositionOffsets:y.buffer})}return C}var Vt=J(Pt);export{Vt as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVectorTileGeometries.js b/plugins/feature/map/Cesium/Workers/createVectorTileGeometries.js index affc541bb..19a358159 100644 --- a/plugins/feature/map/Cesium/Workers/createVectorTileGeometries.js +++ b/plugins/feature/map/Cesium/Workers/createVectorTileGeometries.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as P}from"./chunk-Q4LSC5X3.js";import{a as z}from"./chunk-ZQVZZSUG.js";import"./chunk-NEXD3R4K.js";import{a as H}from"./chunk-FUD3WFGN.js";import{a as Y}from"./chunk-U3N6LNE4.js";import{a as j}from"./chunk-ITJR6PVW.js";import"./chunk-4W2MZV6I.js";import"./chunk-S3L7VZFL.js";import{a as W}from"./chunk-JQLYZQ6V.js";import"./chunk-J3L5WX3X.js";import"./chunk-AVPLM4UI.js";import{d as E}from"./chunk-ZYYZDBKK.js";import{b as d}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as o}from"./chunk-FGKVHLJ4.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as l}from"./chunk-3BGP4HCL.js";function X(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var J=X;var S=new o,$=d.packedLength+o.packedLength,ee=d.packedLength+2,ne=d.packedLength+o.packedLength,te=o.packedLength+1,u={modelMatrix:new d,boundingVolume:new E};function oe(e,c){let n=c*$,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=Math.sqrt(3),u}function ce(e,c){let n=c*ee,i=e[n++],r=e[n++],t=o.fromElements(i,i,r,S),s=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(s,t,s);let h=u.boundingVolume;return o.clone(o.ZERO,h.center),h.radius=Math.sqrt(2),u}function se(e,c){let n=c*ne,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=1,u}function ie(e,c){let n=c*te,i=e[n++],r=o.unpack(e,n,S),t=d.fromTranslation(r,u.modelMatrix);d.multiplyByUniformScale(t,i,t);let s=u.boundingVolume;return o.clone(o.ZERO,s.center),s.radius=1,u}var de=new o;function R(e,c,n,i,r){if(!l(c))return;let t=n.length,s=i.attributes.position.values,h=i.indices,a=e.positions,x=e.vertexBatchIds,y=e.indices,I=e.batchIds,p=e.batchTableColors,T=e.batchedIndices,U=e.indexOffsets,v=e.indexCounts,L=e.boundingVolumes,F=e.modelMatrix,Z=e.center,V=e.positionOffset,B=e.batchIdIndex,O=e.indexOffset,D=e.batchedIndicesOffset;for(let w=0;w<t;++w){let C=r(c,w),k=C.modelMatrix;d.multiply(F,k,k);let M=n[w],A=s.length;for(let f=0;f<A;f+=3){let m=o.unpack(s,f,de);d.multiplyByPoint(k,m,m),o.subtract(m,Z,m),o.pack(m,a,V*3+f),x[B++]=M}let b=h.length;for(let f=0;f<b;++f)y[O+f]=h[f]+V;let g=w+D;T[g]=new J({offset:O,count:b,color:P.fromRgba(p[M]),batchIds:[M]}),I[g]=M,U[g]=O,v[g]=b,L[g]=E.transform(C.boundingVolume,k),V+=A/3,O+=b}e.positionOffset=V,e.batchIdIndex=B,e.indexOffset=O,e.batchedIndicesOffset+=t}var K=new o,Q=new d;function re(e){let c=new Float64Array(e),n=0;o.unpack(c,n,K),n+=o.packedLength,d.unpack(c,n,Q)}function le(e){let c=e.length,n=0;for(let i=0;i<c;++i)n+=P.packedLength+3+e[i].batchIds.length;return n}function ae(e,c,n){let i=n.length,r=2+i*E.packedLength+1+le(c),t=new Float64Array(r),s=0;t[s++]=e,t[s++]=i;for(let a=0;a<i;++a)E.pack(n[a],t,s),s+=E.packedLength;let h=c.length;t[s++]=h;for(let a=0;a<h;++a){let x=c[a];P.pack(x.color,t,s),s+=P.packedLength,t[s++]=x.offset,t[s++]=x.count;let y=x.batchIds,I=y.length;t[s++]=I;for(let p=0;p<I;++p)t[s++]=y[p]}return t}function fe(e,c){let n=l(e.boxes)?new Float32Array(e.boxes):void 0,i=l(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,r=l(e.cylinders)?new Float32Array(e.cylinders):void 0,t=l(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,s=l(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=l(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,a=l(e.spheres)?new Float32Array(e.spheres):void 0,x=l(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=l(n)?i.length:0,I=l(r)?t.length:0,p=l(s)?h.length:0,T=l(a)?x.length:0,U=j.getUnitBox(),v=z.getUnitCylinder(),L=H.getUnitEllipsoid(),F=U.attributes.position.values,Z=v.attributes.position.values,V=L.attributes.position.values,B=F.length*y;B+=Z.length*I,B+=V.length*(p+T);let O=U.indices,D=v.indices,w=L.indices,C=O.length*y;C+=D.length*I,C+=w.length*(p+T);let k=new Float32Array(B),M=new Uint16Array(B/3),A=W.createTypedArray(B/3,C),b=y+I+p+T,g=new Uint16Array(b),f=new Array(b),m=new Uint32Array(b),q=new Uint32Array(b),_=new Array(b);re(e.packedBuffer);let G={batchTableColors:new Uint32Array(e.batchTableColors),positions:k,vertexBatchIds:M,indices:A,batchIds:g,batchedIndices:f,indexOffsets:m,indexCounts:q,boundingVolumes:_,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:Q,center:K};R(G,n,i,U,oe),R(G,r,t,v,ce),R(G,s,h,L,se),R(G,a,x,L,ie);let N=ae(A.BYTES_PER_ELEMENT,f,_);return c.push(k.buffer,M.buffer,A.buffer),c.push(g.buffer,m.buffer,q.buffer),c.push(N.buffer),{positions:k.buffer,vertexBatchIds:M.buffer,indices:A.buffer,indexOffsets:m.buffer,indexCounts:q.buffer,batchIds:g.buffer,packedBuffer:N.buffer}}var Oe=Y(fe);export{Oe as default}; +import{a as P}from"./chunk-RDRVGSTZ.js";import{a as z}from"./chunk-GH3KEUYL.js";import"./chunk-ARDVIBNJ.js";import{a as H}from"./chunk-J6775DYR.js";import{a as Y}from"./chunk-JJVL7F22.js";import{a as j}from"./chunk-ZV4OMVCY.js";import"./chunk-GNBKSQYP.js";import"./chunk-FZSSAWMQ.js";import{a as W}from"./chunk-AZINMULF.js";import"./chunk-ILBQ77ZM.js";import"./chunk-7RNSURKI.js";import{c as E}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import{b as d}from"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import{a as o}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as l}from"./chunk-H7SJWKIY.js";function X(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var J=X;var S=new o,$=d.packedLength+o.packedLength,ee=d.packedLength+2,ne=d.packedLength+o.packedLength,te=o.packedLength+1,u={modelMatrix:new d,boundingVolume:new E};function oe(e,c){let n=c*$,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=Math.sqrt(3),u}function ce(e,c){let n=c*ee,i=e[n++],r=e[n++],t=o.fromElements(i,i,r,S),s=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(s,t,s);let h=u.boundingVolume;return o.clone(o.ZERO,h.center),h.radius=Math.sqrt(2),u}function se(e,c){let n=c*ne,i=o.unpack(e,n,S);n+=o.packedLength;let r=d.unpack(e,n,u.modelMatrix);d.multiplyByScale(r,i,r);let t=u.boundingVolume;return o.clone(o.ZERO,t.center),t.radius=1,u}function ie(e,c){let n=c*te,i=e[n++],r=o.unpack(e,n,S),t=d.fromTranslation(r,u.modelMatrix);d.multiplyByUniformScale(t,i,t);let s=u.boundingVolume;return o.clone(o.ZERO,s.center),s.radius=1,u}var de=new o;function R(e,c,n,i,r){if(!l(c))return;let t=n.length,s=i.attributes.position.values,h=i.indices,a=e.positions,x=e.vertexBatchIds,y=e.indices,I=e.batchIds,p=e.batchTableColors,T=e.batchedIndices,U=e.indexOffsets,v=e.indexCounts,L=e.boundingVolumes,F=e.modelMatrix,Z=e.center,V=e.positionOffset,B=e.batchIdIndex,O=e.indexOffset,D=e.batchedIndicesOffset;for(let w=0;w<t;++w){let C=r(c,w),k=C.modelMatrix;d.multiply(F,k,k);let M=n[w],A=s.length;for(let f=0;f<A;f+=3){let m=o.unpack(s,f,de);d.multiplyByPoint(k,m,m),o.subtract(m,Z,m),o.pack(m,a,V*3+f),x[B++]=M}let b=h.length;for(let f=0;f<b;++f)y[O+f]=h[f]+V;let g=w+D;T[g]=new J({offset:O,count:b,color:P.fromRgba(p[M]),batchIds:[M]}),I[g]=M,U[g]=O,v[g]=b,L[g]=E.transform(C.boundingVolume,k),V+=A/3,O+=b}e.positionOffset=V,e.batchIdIndex=B,e.indexOffset=O,e.batchedIndicesOffset+=t}var K=new o,Q=new d;function re(e){let c=new Float64Array(e),n=0;o.unpack(c,n,K),n+=o.packedLength,d.unpack(c,n,Q)}function le(e){let c=e.length,n=0;for(let i=0;i<c;++i)n+=P.packedLength+3+e[i].batchIds.length;return n}function ae(e,c,n){let i=n.length,r=2+i*E.packedLength+1+le(c),t=new Float64Array(r),s=0;t[s++]=e,t[s++]=i;for(let a=0;a<i;++a)E.pack(n[a],t,s),s+=E.packedLength;let h=c.length;t[s++]=h;for(let a=0;a<h;++a){let x=c[a];P.pack(x.color,t,s),s+=P.packedLength,t[s++]=x.offset,t[s++]=x.count;let y=x.batchIds,I=y.length;t[s++]=I;for(let p=0;p<I;++p)t[s++]=y[p]}return t}function fe(e,c){let n=l(e.boxes)?new Float32Array(e.boxes):void 0,i=l(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,r=l(e.cylinders)?new Float32Array(e.cylinders):void 0,t=l(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,s=l(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,h=l(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,a=l(e.spheres)?new Float32Array(e.spheres):void 0,x=l(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,y=l(n)?i.length:0,I=l(r)?t.length:0,p=l(s)?h.length:0,T=l(a)?x.length:0,U=j.getUnitBox(),v=z.getUnitCylinder(),L=H.getUnitEllipsoid(),F=U.attributes.position.values,Z=v.attributes.position.values,V=L.attributes.position.values,B=F.length*y;B+=Z.length*I,B+=V.length*(p+T);let O=U.indices,D=v.indices,w=L.indices,C=O.length*y;C+=D.length*I,C+=w.length*(p+T);let k=new Float32Array(B),M=new Uint16Array(B/3),A=W.createTypedArray(B/3,C),b=y+I+p+T,g=new Uint16Array(b),f=new Array(b),m=new Uint32Array(b),q=new Uint32Array(b),_=new Array(b);re(e.packedBuffer);let G={batchTableColors:new Uint32Array(e.batchTableColors),positions:k,vertexBatchIds:M,indices:A,batchIds:g,batchedIndices:f,indexOffsets:m,indexCounts:q,boundingVolumes:_,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:Q,center:K};R(G,n,i,U,oe),R(G,r,t,v,ce),R(G,s,h,L,se),R(G,a,x,L,ie);let N=ae(A.BYTES_PER_ELEMENT,f,_);return c.push(k.buffer,M.buffer,A.buffer),c.push(g.buffer,m.buffer,q.buffer),c.push(N.buffer),{positions:k.buffer,vertexBatchIds:M.buffer,indices:A.buffer,indexOffsets:m.buffer,indexCounts:q.buffer,batchIds:g.buffer,packedBuffer:N.buffer}}var Oe=Y(fe);export{Oe as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVectorTilePoints.js b/plugins/feature/map/Cesium/Workers/createVectorTilePoints.js index 247dfcd5e..cede23221 100644 --- a/plugins/feature/map/Cesium/Workers/createVectorTilePoints.js +++ b/plugins/feature/map/Cesium/Workers/createVectorTilePoints.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as x}from"./chunk-U3N6LNE4.js";import{a as w}from"./chunk-X6N776GR.js";import{h as c}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as h,b as l,d as p}from"./chunk-FGKVHLJ4.js";import{a as i}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import"./chunk-3BGP4HCL.js";var u=32767,F=new l,L=new h,b=new c,y=new p,a={min:void 0,max:void 0};function V(t){t=new Float64Array(t);let o=0;a.min=t[o++],a.max=t[o++],c.unpack(t,o,b),o+=c.packedLength,p.unpack(t,o,y)}function z(t,o){let s=new Uint16Array(t.positions);V(t.packedBuffer);let e=b,C=y,A=a.min,P=a.max,n=s.length/3,f=s.subarray(0,n),g=s.subarray(n,2*n),d=s.subarray(2*n,3*n);w.zigZagDeltaDecode(f,g,d);let m=new Float64Array(s.length);for(let r=0;r<n;++r){let k=f[r],E=g[r],H=d[r],M=i.lerp(e.west,e.east,k/u),R=i.lerp(e.south,e.north,E/u),T=i.lerp(A,P,H/u),v=l.fromRadians(M,R,T,F),D=C.cartographicToCartesian(v,L);h.pack(D,m,r*3)}return o.push(m.buffer),{positions:m.buffer}}var G=x(z);export{G as default}; +import{a as x}from"./chunk-JJVL7F22.js";import{a as w}from"./chunk-QCE33JV5.js";import{j as c}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as l,c as p}from"./chunk-KP72RGCH.js";import{a as h}from"./chunk-OSVSBQDY.js";import{a as i}from"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";var u=32767,F=new l,L=new h,b=new c,y=new p,a={min:void 0,max:void 0};function V(t){t=new Float64Array(t);let o=0;a.min=t[o++],a.max=t[o++],c.unpack(t,o,b),o+=c.packedLength,p.unpack(t,o,y)}function z(t,o){let s=new Uint16Array(t.positions);V(t.packedBuffer);let e=b,C=y,A=a.min,P=a.max,n=s.length/3,f=s.subarray(0,n),g=s.subarray(n,2*n),d=s.subarray(2*n,3*n);w.zigZagDeltaDecode(f,g,d);let m=new Float64Array(s.length);for(let r=0;r<n;++r){let k=f[r],E=g[r],H=d[r],M=i.lerp(e.west,e.east,k/u),R=i.lerp(e.south,e.north,E/u),T=i.lerp(A,P,H/u),v=l.fromRadians(M,R,T,F),D=C.cartographicToCartesian(v,L);h.pack(D,m,r*3)}return o.push(m.buffer),{positions:m.buffer}}var G=x(z);export{G as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVectorTilePolygons.js b/plugins/feature/map/Cesium/Workers/createVectorTilePolygons.js index 97d262471..2bcdb0be7 100644 --- a/plugins/feature/map/Cesium/Workers/createVectorTilePolygons.js +++ b/plugins/feature/map/Cesium/Workers/createVectorTilePolygons.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as R}from"./chunk-Q4LSC5X3.js";import{a as It}from"./chunk-U3N6LNE4.js";import{a as M}from"./chunk-LUT6AMUC.js";import{a as bt}from"./chunk-X6N776GR.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as W}from"./chunk-JQLYZQ6V.js";import"./chunk-ZYYZDBKK.js";import{h as z}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as o,b as nt,d as j}from"./chunk-FGKVHLJ4.js";import{a as et}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as A}from"./chunk-3BGP4HCL.js";var kt=new o,Bt=new j,Nt=new z,E={min:void 0,max:void 0,indexBytesPerElement:void 0};function Pt(s){let u=new Float64Array(s),n=0;E.indexBytesPerElement=u[n++],E.min=u[n++],E.max=u[n++],o.unpack(u,n,kt),n+=o.packedLength,j.unpack(u,n,Bt),n+=j.packedLength,z.unpack(u,n,Nt)}function Tt(s){let u=s.length,n=0;for(let y=0;y<u;++y)n+=R.packedLength+3+s[y].batchIds.length;return n}function Ct(s,u,n){let y=u.length,O=2+y*M.packedLength+1+Tt(n),c=new Float64Array(O),i=0;c[i++]=s,c[i++]=y;for(let x=0;x<y;++x)M.pack(u[x],c,i),i+=M.packedLength;let V=n.length;c[i++]=V;for(let x=0;x<V;++x){let B=n[x];R.pack(B.color,c,i),i+=R.packedLength,c[i++]=B.offset,c[i++]=B.count;let P=B.batchIds,w=P.length;c[i++]=w;for(let h=0;h<w;++h)c[i++]=P[h]}return c}var yt=32767,wt=new o,Ht=new o,St=new o,Ut=new o,Ft=new o,Lt=new nt,Mt=new z;function Rt(s,u){Pt(s.packedBuffer);let n;E.indexBytesPerElement===2?n=new Uint16Array(s.indices):n=new Uint32Array(s.indices);let O=new Uint16Array(s.positions),c=new Uint32Array(s.counts),i=new Uint32Array(s.indexCounts),V=new Uint32Array(s.batchIds),x=new Uint32Array(s.batchTableColors),B=new Array(c.length),P=kt,w=Bt,h=Nt,ot=E.min,st=E.max,T=s.minimumHeights,C=s.maximumHeights;A(T)&&A(C)&&(T=new Float32Array(T),C=new Float32Array(C));let t,f,l,N=O.length/2,ct=O.subarray(0,N),it=O.subarray(N,2*N);bt.zigZagDeltaDecode(ct,it);let rt=new Float64Array(N*3);for(t=0;t<N;++t){let e=ct[t],p=it[t],L=et.lerp(h.west,h.east,e/yt),k=et.lerp(h.south,h.north,p/yt),b=nt.fromRadians(L,k,0,Lt),Y=w.cartographicToCartesian(b,wt);o.pack(Y,rt,t*3)}let H=c.length,at=new Array(H),Z=new Array(H),ft=0,lt=0;for(t=0;t<H;++t)at[t]=ft,Z[t]=lt,ft+=c[t],lt+=i[t];let S=new Float32Array(N*3*2),_=new Uint16Array(N*2),D=new Uint32Array(Z.length),G=new Uint32Array(i.length),r=[],g={};for(t=0;t<H;++t)l=x[t],A(g[l])?(g[l].positionLength+=c[t],g[l].indexLength+=i[t],g[l].batchIds.push(t)):g[l]={positionLength:c[t],indexLength:i[t],offset:0,indexOffset:0,batchIds:[t]};let a,dt=0,ht=0;for(l in g)if(g.hasOwnProperty(l)){a=g[l],a.offset=dt,a.indexOffset=ht;let e=a.positionLength*2,p=a.indexLength*2+a.positionLength*6;dt+=e,ht+=p,a.indexLength=p}let U=[];for(l in g)g.hasOwnProperty(l)&&(a=g[l],U.push({color:R.fromRgba(parseInt(l)),offset:a.indexOffset,count:a.indexLength,batchIds:a.batchIds}));for(t=0;t<H;++t){l=x[t],a=g[l];let e=a.offset,p=e*3,L=e,k=at[t],b=c[t],Y=V[t],mt=ot,gt=st;A(T)&&A(C)&&(mt=T[t],gt=C[t]);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;for(f=0;f<b;++f){let m=o.unpack(rt,k*3+f*3,wt);w.scaleToGeodeticSurface(m,m);let I=w.cartesianToCartographic(m,Lt),F=I.latitude,pt=I.longitude;q=Math.min(F,q),J=Math.max(F,J),K=Math.min(pt,K),Q=Math.max(pt,Q);let xt=w.geodeticSurfaceNormal(m,Ht),v=o.multiplyByScalar(xt,mt,St),$=o.add(m,v,Ut);v=o.multiplyByScalar(xt,gt,v);let tt=o.add(m,v,Ft);o.subtract(tt,P,tt),o.subtract($,P,$),o.pack(tt,S,p),o.pack($,S,p+3),_[L]=Y,_[L+1]=Y,p+=6,L+=2}h=Mt,h.west=K,h.east=Q,h.south=q,h.north=J,B[t]=M.fromRectangle(h,ot,st,w);let d=a.indexOffset,X=Z[t],Ot=i[t];for(D[t]=d,f=0;f<Ot;f+=3){let m=n[X+f]-k,I=n[X+f+1]-k,F=n[X+f+2]-k;r[d++]=m*2+e,r[d++]=I*2+e,r[d++]=F*2+e,r[d++]=F*2+1+e,r[d++]=I*2+1+e,r[d++]=m*2+1+e}for(f=0;f<b;++f){let m=f,I=(f+1)%b;r[d++]=m*2+1+e,r[d++]=I*2+e,r[d++]=m*2+e,r[d++]=m*2+1+e,r[d++]=I*2+1+e,r[d++]=I*2+e}a.offset+=b*2,a.indexOffset=d,G[t]=d-D[t]}r=W.createTypedArray(S.length/3,r);let At=U.length;for(let e=0;e<At;++e){let p=U[e].batchIds,L=0,k=p.length;for(let b=0;b<k;++b)L+=G[p[b]];U[e].count=L}let Et=r.BYTES_PER_ELEMENT===2?W.UNSIGNED_SHORT:W.UNSIGNED_INT,ut=Ct(Et,B,U);return u.push(S.buffer,r.buffer,D.buffer,G.buffer,_.buffer,ut.buffer),{positions:S.buffer,indices:r.buffer,indexOffsets:D.buffer,indexCounts:G.buffer,batchIds:_.buffer,packedBuffer:ut.buffer}}var Jt=It(Rt);export{Jt as default}; +import{a as R}from"./chunk-RDRVGSTZ.js";import{a as It}from"./chunk-JJVL7F22.js";import{a as M}from"./chunk-XAERMS6D.js";import{a as bt}from"./chunk-QCE33JV5.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as W}from"./chunk-AZINMULF.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{j as z}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as nt,c as j}from"./chunk-KP72RGCH.js";import{a as o}from"./chunk-OSVSBQDY.js";import{a as et}from"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as A}from"./chunk-H7SJWKIY.js";var kt=new o,Bt=new j,Nt=new z,E={min:void 0,max:void 0,indexBytesPerElement:void 0};function Pt(s){let u=new Float64Array(s),n=0;E.indexBytesPerElement=u[n++],E.min=u[n++],E.max=u[n++],o.unpack(u,n,kt),n+=o.packedLength,j.unpack(u,n,Bt),n+=j.packedLength,z.unpack(u,n,Nt)}function Tt(s){let u=s.length,n=0;for(let y=0;y<u;++y)n+=R.packedLength+3+s[y].batchIds.length;return n}function Ct(s,u,n){let y=u.length,O=2+y*M.packedLength+1+Tt(n),c=new Float64Array(O),i=0;c[i++]=s,c[i++]=y;for(let x=0;x<y;++x)M.pack(u[x],c,i),i+=M.packedLength;let V=n.length;c[i++]=V;for(let x=0;x<V;++x){let B=n[x];R.pack(B.color,c,i),i+=R.packedLength,c[i++]=B.offset,c[i++]=B.count;let P=B.batchIds,w=P.length;c[i++]=w;for(let h=0;h<w;++h)c[i++]=P[h]}return c}var yt=32767,wt=new o,Ht=new o,St=new o,Ut=new o,Ft=new o,Lt=new nt,Mt=new z;function Rt(s,u){Pt(s.packedBuffer);let n;E.indexBytesPerElement===2?n=new Uint16Array(s.indices):n=new Uint32Array(s.indices);let O=new Uint16Array(s.positions),c=new Uint32Array(s.counts),i=new Uint32Array(s.indexCounts),V=new Uint32Array(s.batchIds),x=new Uint32Array(s.batchTableColors),B=new Array(c.length),P=kt,w=Bt,h=Nt,ot=E.min,st=E.max,T=s.minimumHeights,C=s.maximumHeights;A(T)&&A(C)&&(T=new Float32Array(T),C=new Float32Array(C));let t,f,l,N=O.length/2,ct=O.subarray(0,N),it=O.subarray(N,2*N);bt.zigZagDeltaDecode(ct,it);let rt=new Float64Array(N*3);for(t=0;t<N;++t){let e=ct[t],p=it[t],L=et.lerp(h.west,h.east,e/yt),k=et.lerp(h.south,h.north,p/yt),b=nt.fromRadians(L,k,0,Lt),Y=w.cartographicToCartesian(b,wt);o.pack(Y,rt,t*3)}let H=c.length,at=new Array(H),Z=new Array(H),ft=0,lt=0;for(t=0;t<H;++t)at[t]=ft,Z[t]=lt,ft+=c[t],lt+=i[t];let S=new Float32Array(N*3*2),_=new Uint16Array(N*2),D=new Uint32Array(Z.length),G=new Uint32Array(i.length),r=[],g={};for(t=0;t<H;++t)l=x[t],A(g[l])?(g[l].positionLength+=c[t],g[l].indexLength+=i[t],g[l].batchIds.push(t)):g[l]={positionLength:c[t],indexLength:i[t],offset:0,indexOffset:0,batchIds:[t]};let a,dt=0,ht=0;for(l in g)if(g.hasOwnProperty(l)){a=g[l],a.offset=dt,a.indexOffset=ht;let e=a.positionLength*2,p=a.indexLength*2+a.positionLength*6;dt+=e,ht+=p,a.indexLength=p}let U=[];for(l in g)g.hasOwnProperty(l)&&(a=g[l],U.push({color:R.fromRgba(parseInt(l)),offset:a.indexOffset,count:a.indexLength,batchIds:a.batchIds}));for(t=0;t<H;++t){l=x[t],a=g[l];let e=a.offset,p=e*3,L=e,k=at[t],b=c[t],Y=V[t],mt=ot,gt=st;A(T)&&A(C)&&(mt=T[t],gt=C[t]);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;for(f=0;f<b;++f){let m=o.unpack(rt,k*3+f*3,wt);w.scaleToGeodeticSurface(m,m);let I=w.cartesianToCartographic(m,Lt),F=I.latitude,pt=I.longitude;q=Math.min(F,q),J=Math.max(F,J),K=Math.min(pt,K),Q=Math.max(pt,Q);let xt=w.geodeticSurfaceNormal(m,Ht),v=o.multiplyByScalar(xt,mt,St),$=o.add(m,v,Ut);v=o.multiplyByScalar(xt,gt,v);let tt=o.add(m,v,Ft);o.subtract(tt,P,tt),o.subtract($,P,$),o.pack(tt,S,p),o.pack($,S,p+3),_[L]=Y,_[L+1]=Y,p+=6,L+=2}h=Mt,h.west=K,h.east=Q,h.south=q,h.north=J,B[t]=M.fromRectangle(h,ot,st,w);let d=a.indexOffset,X=Z[t],Ot=i[t];for(D[t]=d,f=0;f<Ot;f+=3){let m=n[X+f]-k,I=n[X+f+1]-k,F=n[X+f+2]-k;r[d++]=m*2+e,r[d++]=I*2+e,r[d++]=F*2+e,r[d++]=F*2+1+e,r[d++]=I*2+1+e,r[d++]=m*2+1+e}for(f=0;f<b;++f){let m=f,I=(f+1)%b;r[d++]=m*2+1+e,r[d++]=I*2+e,r[d++]=m*2+e,r[d++]=m*2+1+e,r[d++]=I*2+1+e,r[d++]=I*2+e}a.offset+=b*2,a.indexOffset=d,G[t]=d-D[t]}r=W.createTypedArray(S.length/3,r);let At=U.length;for(let e=0;e<At;++e){let p=U[e].batchIds,L=0,k=p.length;for(let b=0;b<k;++b)L+=G[p[b]];U[e].count=L}let Et=r.BYTES_PER_ELEMENT===2?W.UNSIGNED_SHORT:W.UNSIGNED_INT,ut=Ct(Et,B,U);return u.push(S.buffer,r.buffer,D.buffer,G.buffer,_.buffer,ut.buffer),{positions:S.buffer,indices:r.buffer,indexOffsets:D.buffer,indexCounts:G.buffer,batchIds:_.buffer,packedBuffer:ut.buffer}}var Jt=It(Rt);export{Jt as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVectorTilePolylines.js b/plugins/feature/map/Cesium/Workers/createVectorTilePolylines.js index a26229145..a9b7ce738 100644 --- a/plugins/feature/map/Cesium/Workers/createVectorTilePolylines.js +++ b/plugins/feature/map/Cesium/Workers/createVectorTilePolylines.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as K}from"./chunk-U3N6LNE4.js";import{a as G}from"./chunk-X6N776GR.js";import{a as S}from"./chunk-JQLYZQ6V.js";import{c as B,h as R}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as t,b as _,d as L}from"./chunk-FGKVHLJ4.js";import{a as F}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import"./chunk-3BGP4HCL.js";var O=32767,ct=new _,rt=new t;function it(n,o,p,m,s){let d=n.length/3,U=n.subarray(0,d),v=n.subarray(d,2*d),P=n.subarray(2*d,3*d);G.zigZagDeltaDecode(U,v,P);let D=new Float64Array(n.length);for(let u=0;u<d;++u){let e=U[u],A=v[u],l=P[u],k=F.lerp(o.west,o.east,e/O),I=F.lerp(o.south,o.north,A/O),E=F.lerp(p,m,l/O),g=_.fromRadians(k,I,E,ct),C=s.cartographicToCartesian(g,rt);t.pack(C,D,u*3)}return D}var Y=it;var X=new R,$=new L,j=new t,H={min:void 0,max:void 0};function at(n){n=new Float64Array(n);let o=0;H.min=n[o++],H.max=n[o++],R.unpack(n,o,X),o+=R.packedLength,L.unpack(n,o,$),o+=L.packedLength,t.unpack(n,o,j)}function ft(n){let o=n.length,p=new Uint32Array(o+1),m=0;for(let s=0;s<o;++s)p[s]=m,m+=n[s];return p[o]=m,p}var Z=new t,q=new t,J=new t,dt=new t,Q=new t;function ut(n,o){let p=new Uint16Array(n.positions),m=new Uint16Array(n.widths),s=new Uint32Array(n.counts),d=new Uint16Array(n.batchIds);at(n.packedBuffer);let U=X,v=$,P=j,D=H.min,u=H.max,e=Y(p,U,D,u,v),A=e.length/3,l=A*4-4,k=new Float32Array(l*3),I=new Float32Array(l*3),E=new Float32Array(l*3),g=new Float32Array(l*2),C=new Uint16Array(l),N=0,z=0,tt=0,r,h=0,M=s.length;for(r=0;r<M;++r){let a=s[r],nt=m[r],ot=d[r];for(let f=0;f<a;++f){let w;if(f===0){let c=t.unpack(e,h*3,Z),T=t.unpack(e,(h+1)*3,q);w=t.subtract(c,T,J),t.add(c,w,w)}else w=t.unpack(e,(h+f-1)*3,J);let W=t.unpack(e,(h+f)*3,dt),x;if(f===a-1){let c=t.unpack(e,(h+a-1)*3,Z),T=t.unpack(e,(h+a-2)*3,q);x=t.subtract(c,T,Q),t.add(c,x,x)}else x=t.unpack(e,(h+f+1)*3,Q);t.subtract(w,P,w),t.subtract(W,P,W),t.subtract(x,P,x);let et=f===0?2:0,st=f===a-1?2:4;for(let c=et;c<st;++c){t.pack(W,k,N),t.pack(w,I,N),t.pack(x,E,N),N+=3;let T=c-2<0?-1:1;g[z++]=2*(c%2)-1,g[z++]=T*nt,C[tt++]=ot}}h+=a}let i=S.createTypedArray(l,A*6-6),b=0,y=0;for(M=A-1,r=0;r<M;++r)i[y++]=b,i[y++]=b+2,i[y++]=b+1,i[y++]=b+1,i[y++]=b+2,i[y++]=b+3,b+=4;o.push(k.buffer,I.buffer,E.buffer),o.push(g.buffer,C.buffer,i.buffer);let V={indexDatatype:i.BYTES_PER_ELEMENT===2?S.UNSIGNED_SHORT:S.UNSIGNED_INT,currentPositions:k.buffer,previousPositions:I.buffer,nextPositions:E.buffer,expandAndWidth:g.buffer,batchIds:C.buffer,indices:i.buffer};if(n.keepDecodedPositions){let a=ft(s);o.push(e.buffer,a.buffer),V=B(V,{decodedPositions:e.buffer,decodedPositionOffsets:a.buffer})}return V}var It=K(ut);export{It as default}; +import{a as K}from"./chunk-JJVL7F22.js";import{a as G}from"./chunk-QCE33JV5.js";import{a as S}from"./chunk-AZINMULF.js";import{c as B,j as R}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as _,c as L}from"./chunk-KP72RGCH.js";import{a as t}from"./chunk-OSVSBQDY.js";import{a as F}from"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";var O=32767,ct=new _,rt=new t;function it(n,o,p,m,s){let d=n.length/3,U=n.subarray(0,d),v=n.subarray(d,2*d),P=n.subarray(2*d,3*d);G.zigZagDeltaDecode(U,v,P);let D=new Float64Array(n.length);for(let u=0;u<d;++u){let e=U[u],A=v[u],l=P[u],k=F.lerp(o.west,o.east,e/O),I=F.lerp(o.south,o.north,A/O),E=F.lerp(p,m,l/O),g=_.fromRadians(k,I,E,ct),C=s.cartographicToCartesian(g,rt);t.pack(C,D,u*3)}return D}var Y=it;var X=new R,$=new L,j=new t,H={min:void 0,max:void 0};function at(n){n=new Float64Array(n);let o=0;H.min=n[o++],H.max=n[o++],R.unpack(n,o,X),o+=R.packedLength,L.unpack(n,o,$),o+=L.packedLength,t.unpack(n,o,j)}function ft(n){let o=n.length,p=new Uint32Array(o+1),m=0;for(let s=0;s<o;++s)p[s]=m,m+=n[s];return p[o]=m,p}var Z=new t,q=new t,J=new t,dt=new t,Q=new t;function ut(n,o){let p=new Uint16Array(n.positions),m=new Uint16Array(n.widths),s=new Uint32Array(n.counts),d=new Uint16Array(n.batchIds);at(n.packedBuffer);let U=X,v=$,P=j,D=H.min,u=H.max,e=Y(p,U,D,u,v),A=e.length/3,l=A*4-4,k=new Float32Array(l*3),I=new Float32Array(l*3),E=new Float32Array(l*3),g=new Float32Array(l*2),C=new Uint16Array(l),N=0,z=0,tt=0,r,h=0,M=s.length;for(r=0;r<M;++r){let a=s[r],nt=m[r],ot=d[r];for(let f=0;f<a;++f){let w;if(f===0){let c=t.unpack(e,h*3,Z),T=t.unpack(e,(h+1)*3,q);w=t.subtract(c,T,J),t.add(c,w,w)}else w=t.unpack(e,(h+f-1)*3,J);let W=t.unpack(e,(h+f)*3,dt),x;if(f===a-1){let c=t.unpack(e,(h+a-1)*3,Z),T=t.unpack(e,(h+a-2)*3,q);x=t.subtract(c,T,Q),t.add(c,x,x)}else x=t.unpack(e,(h+f+1)*3,Q);t.subtract(w,P,w),t.subtract(W,P,W),t.subtract(x,P,x);let et=f===0?2:0,st=f===a-1?2:4;for(let c=et;c<st;++c){t.pack(W,k,N),t.pack(w,I,N),t.pack(x,E,N),N+=3;let T=c-2<0?-1:1;g[z++]=2*(c%2)-1,g[z++]=T*nt,C[tt++]=ot}}h+=a}let i=S.createTypedArray(l,A*6-6),b=0,y=0;for(M=A-1,r=0;r<M;++r)i[y++]=b,i[y++]=b+2,i[y++]=b+1,i[y++]=b+1,i[y++]=b+2,i[y++]=b+3,b+=4;o.push(k.buffer,I.buffer,E.buffer),o.push(g.buffer,C.buffer,i.buffer);let V={indexDatatype:i.BYTES_PER_ELEMENT===2?S.UNSIGNED_SHORT:S.UNSIGNED_INT,currentPositions:k.buffer,previousPositions:I.buffer,nextPositions:E.buffer,expandAndWidth:g.buffer,batchIds:C.buffer,indices:i.buffer};if(n.keepDecodedPositions){let a=ft(s);o.push(e.buffer,a.buffer),V=B(V,{decodedPositions:e.buffer,decodedPositionOffsets:a.buffer})}return V}var It=K(ut);export{It as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVerticesFromCesium3DTilesTerrain.js b/plugins/feature/map/Cesium/Workers/createVerticesFromCesium3DTilesTerrain.js new file mode 100644 index 000000000..8ed74a289 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/createVerticesFromCesium3DTilesTerrain.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as u}from"./chunk-3AERAMWF.js";import"./chunk-V23IN42C.js";import"./chunk-WVRWFNLS.js";import{a as f}from"./chunk-JJVL7F22.js";import"./chunk-MQTDGHHT.js";import"./chunk-XAERMS6D.js";import"./chunk-QCE33JV5.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import"./chunk-AZINMULF.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";function a(c,d){return u.createMesh(c).then(function(e){let t=e.vertices.buffer,r=e.indices.buffer,s=e.westIndicesSouthToNorth.buffer,o=e.southIndicesEastToWest.buffer,i=e.eastIndicesNorthToSouth.buffer,n=e.northIndicesWestToEast.buffer;return d.push(t,r,s,o,i,n),{verticesBuffer:t,indicesBuffer:r,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,encoding:e.encoding,westIndicesBuffer:s,southIndicesBuffer:o,eastIndicesBuffer:i,northIndicesBuffer:n}})}var T=f(a);export{T as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/plugins/feature/map/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js index 57ceff5e0..0e3048d46 100644 --- a/plugins/feature/map/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +++ b/plugins/feature/map/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Dt,b as Gt}from"./chunk-G65SAF2P.js";import{a as Lt}from"./chunk-U3N6LNE4.js";import{a as lt}from"./chunk-L4JCTZ6Y.js";import{a as qt}from"./chunk-LUT6AMUC.js";import"./chunk-X6N776GR.js";import"./chunk-RQKZTHAV.js";import{a as kt}from"./chunk-K6A7NKZT.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{d as zt}from"./chunk-ZYYZDBKK.js";import{b as $,g as Ot,h as Vt}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as P,b as N,c as wt,d as Ut}from"./chunk-FGKVHLJ4.js";import{a as r}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import{a as Ht}from"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{e as ht}from"./chunk-3BGP4HCL.js";var $t=Uint16Array.BYTES_PER_ELEMENT,mt=Int32Array.BYTES_PER_ELEMENT,Pt=Uint32Array.BYTES_PER_ELEMENT,te=Float32Array.BYTES_PER_ELEMENT,H=Float64Array.BYTES_PER_ELEMENT;function tt(n,l,e){e=e??r;let i=n.length;for(let c=0;c<i;++c)if(e.equalsEpsilon(n[c],l,r.EPSILON12))return c;return-1}function ee(n,l){n.ellipsoid=Ut.clone(n.ellipsoid),n.rectangle=Vt.clone(n.rectangle);let e=re(n.buffer,n.relativeToCenter,n.ellipsoid,n.rectangle,n.nativeRectangle,n.exaggeration,n.exaggerationRelativeHeight,n.skirtHeight,n.includeWebMercatorT,n.negativeAltitudeExponentBias,n.negativeElevationThreshold),i=e.vertices;l.push(i.buffer);let c=e.indices;return l.push(c.buffer),{vertices:i.buffer,indices:c.buffer,numberOfAttributes:e.encoding.stride,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere3D:e.boundingSphere3D,orientedBoundingBox:e.orientedBoundingBox,occludeePointInScaledSpace:e.occludeePointInScaledSpace,encoding:e.encoding,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,westIndicesSouthToNorth:e.westIndicesSouthToNorth,southIndicesEastToWest:e.southIndicesEastToWest,eastIndicesNorthToSouth:e.eastIndicesNorthToSouth,northIndicesWestToEast:e.northIndicesWestToEast}}var u=new N,G=new P,oe=new P,ne=new P,ie=new $;function re(n,l,e,i,c,et,m,ot,T,nt,it){let I,h,E,f,x,p;ht(i)?(I=i.west,h=i.south,E=i.east,f=i.north,x=i.width,p=i.height):(I=r.toRadians(c.west),h=r.toRadians(c.south),E=r.toRadians(c.east),f=r.toRadians(c.north),x=r.toRadians(i.width),p=r.toRadians(i.height));let X=[h,f],A=[I,E],O=Ot.eastNorthUpToFixedFrame(l,e),j=$.inverseTransformation(O,ie),V,Q;T&&(V=lt.geodeticLatitudeToMercatorAngle(h),Q=1/(lt.geodeticLatitudeToMercatorAngle(f)-V));let y=et!==1,a=new DataView(n),z=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,b=oe;b.x=Number.POSITIVE_INFINITY,b.y=Number.POSITIVE_INFINITY,b.z=Number.POSITIVE_INFINITY;let M=ne;M.x=Number.NEGATIVE_INFINITY,M.y=Number.NEGATIVE_INFINITY,M.z=Number.NEGATIVE_INFINITY;let o=0,S=0,At=0,rt,L;for(L=0;L<4;++L){let t=o;rt=a.getUint32(t,!0),t+=Pt;let d=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(A,d)===-1&&A.push(d);let Y=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(X,Y)===-1&&X.push(Y),t+=2*H;let B=a.getInt32(t,!0);t+=mt,S+=B,B=a.getInt32(t,!0),At+=B*3,o+=rt+Pt}let yt=[],bt=[],g=new Array(S),R=new Array(S),_=new Array(S),C=T?new Array(S):[],F=y?new Array(S):[],v=new Array(At),k=[],st=[],ct=[],W=[],s=0,pt=0;for(o=0,L=0;L<4;++L){rt=a.getUint32(o,!0),o+=Pt;let t=o,d=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let Y=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let B=r.toRadians(a.getFloat64(o,!0)*180),Ft=B*.5;o+=H;let vt=r.toRadians(a.getFloat64(o,!0)*180),Wt=vt*.5;o+=H;let Yt=a.getInt32(o,!0);o+=mt;let Kt=a.getInt32(o,!0);o+=mt,o+=mt;let St=new Array(Yt);for(let U=0;U<Yt;++U){let Z=d+a.getUint8(o++)*B;u.longitude=Z;let D=Y+a.getUint8(o++)*vt;u.latitude=D;let w=a.getFloat32(o,!0);if(o+=te,w!==0&&w<it&&(w*=-Math.pow(2,nt)),w*=6371010,u.height=w,tt(A,Z)!==-1||tt(X,D)!==-1){let dt=tt(yt,u,N);if(dt===-1)yt.push(N.clone(u)),bt.push(s);else{St[U]=bt[dt];continue}}St[U]=s,Math.abs(Z-I)<Ft?k.push({index:s,cartographic:N.clone(u)}):Math.abs(Z-E)<Ft?ct.push({index:s,cartographic:N.clone(u)}):Math.abs(D-h)<Wt?st.push({index:s,cartographic:N.clone(u)}):Math.abs(D-f)<Wt&&W.push({index:s,cartographic:N.clone(u)}),z=Math.min(w,z),J=Math.max(w,J),_[s]=w;let Nt=e.cartographicToCartesian(u);if(g[s]=Nt,T&&(C[s]=(lt.geodeticLatitudeToMercatorAngle(D)-V)*Q),y){let dt=e.geodeticSurfaceNormal(Nt);F[s]=dt}$.multiplyByPoint(j,Nt,G),P.minimumByComponent(G,b,b),P.maximumByComponent(G,M,M);let Tt=(Z-I)/(E-I);Tt=r.clamp(Tt,0,1);let Bt=(D-h)/(f-h);Bt=r.clamp(Bt,0,1),R[s]=new wt(Tt,Bt),++s}let Zt=Kt*3;for(let U=0;U<Zt;++U,++pt)v[pt]=St[a.getUint16(o,!0)],o+=$t;if(rt!==o-t)throw new Ht("Invalid terrain tile.")}g.length=s,R.length=s,_.length=s,T&&(C.length=s),y&&(F.length=s);let Mt=s,Xt=pt,K={hMin:z,lastBorderPoint:void 0,skirtHeight:ot,toENU:j,ellipsoid:e,minimum:b,maximum:M};k.sort(function(t,d){return d.cartographic.latitude-t.cartographic.latitude}),st.sort(function(t,d){return t.cartographic.longitude-d.cartographic.longitude}),ct.sort(function(t,d){return t.cartographic.latitude-d.cartographic.latitude}),W.sort(function(t,d){return d.cartographic.longitude-t.cartographic.longitude});let q=1e-5;if(gt(g,_,R,C,F,v,K,k,-q*x,!0,-q*p),gt(g,_,R,C,F,v,K,st,-q*p,!1),gt(g,_,R,C,F,v,K,ct,q*x,!0,q*p),gt(g,_,R,C,F,v,K,W,q*p,!1),k.length>0&&W.length>0){let t=k[0].index,d=Mt,Y=W[W.length-1].index,B=g.length-1;v.push(Y,B,d,d,t,Y)}S=g.length;let jt=zt.fromPoints(g),Rt;ht(i)&&(Rt=qt.fromRectangle(i,z,J,e));let Qt=new Dt(e).computeHorizonCullingPointPossiblyUnderEllipsoid(l,g,z),Jt=new kt(b,M,l),It=new Gt(l,Jt,K.hMin,J,O,!1,T,y,et,m),_t=new Float32Array(S*It.stride),Ct=0;for(let t=0;t<S;++t)Ct=It.encode(_t,Ct,g[t],R[t],_[t],void 0,C[t],F[t]);let at=k.map(function(t){return t.index}).reverse(),Et=st.map(function(t){return t.index}).reverse(),ut=ct.map(function(t){return t.index}).reverse(),xt=W.map(function(t){return t.index}).reverse();return Et.unshift(ut[ut.length-1]),Et.push(at[0]),xt.unshift(at[at.length-1]),xt.push(ut[0]),{vertices:_t,indices:new Uint16Array(v),maximumHeight:J,minimumHeight:z,encoding:It,boundingSphere3D:jt,orientedBoundingBox:Rt,occludeePointInScaledSpace:Qt,vertexCountWithoutSkirts:Mt,indexCountWithoutSkirts:Xt,westIndicesSouthToNorth:at,southIndicesEastToWest:Et,eastIndicesNorthToSouth:ut,northIndicesWestToEast:xt}}function gt(n,l,e,i,c,et,m,ot,T,nt,it){let I=ot.length;for(let h=0;h<I;++h){let E=ot[h],f=E.cartographic,x=E.index,p=n.length,X=f.longitude,A=f.latitude;A=r.clamp(A,-r.PI_OVER_TWO,r.PI_OVER_TWO);let O=f.height-m.skirtHeight;m.hMin=Math.min(m.hMin,O),N.fromRadians(X,A,O,u),nt&&(u.longitude+=T),nt?h===I-1?u.latitude+=it:h===0&&(u.latitude-=it):u.latitude+=T;let j=m.ellipsoid.cartographicToCartesian(u);n.push(j),l.push(O),e.push(wt.clone(e[x])),i.length>0&&i.push(i[x]),c.length>0&&c.push(c[x]),$.multiplyByPoint(m.toENU,j,G);let V=m.minimum,Q=m.maximum;P.minimumByComponent(G,V,V),P.maximumByComponent(G,Q,Q);let ft=m.lastBorderPoint;if(ht(ft)){let y=ft.index;et.push(y,p-1,p,p,x,y)}m.lastBorderPoint=E}}var we=Lt(ee);export{we as default}; +import{a as Dt,c as Gt}from"./chunk-WVRWFNLS.js";import{a as Lt}from"./chunk-JJVL7F22.js";import{a as lt}from"./chunk-MQTDGHHT.js";import{a as qt}from"./chunk-XAERMS6D.js";import"./chunk-QCE33JV5.js";import"./chunk-C5UTI7P4.js";import{a as kt}from"./chunk-DV5LK4D5.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{c as zt}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{i as Ot,j as Vt}from"./chunk-YZ5ZCI55.js";import{b as $}from"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import{a as Ht}from"./chunk-23IOGON7.js";import{a as N,b as wt,c as Ut}from"./chunk-KP72RGCH.js";import{a as P}from"./chunk-OSVSBQDY.js";import{a as r}from"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as ht}from"./chunk-H7SJWKIY.js";var $t=Uint16Array.BYTES_PER_ELEMENT,mt=Int32Array.BYTES_PER_ELEMENT,Pt=Uint32Array.BYTES_PER_ELEMENT,te=Float32Array.BYTES_PER_ELEMENT,H=Float64Array.BYTES_PER_ELEMENT;function tt(n,l,e){e=e??r;let i=n.length;for(let c=0;c<i;++c)if(e.equalsEpsilon(n[c],l,r.EPSILON12))return c;return-1}function ee(n,l){n.ellipsoid=Ut.clone(n.ellipsoid),n.rectangle=Vt.clone(n.rectangle);let e=re(n.buffer,n.relativeToCenter,n.ellipsoid,n.rectangle,n.nativeRectangle,n.exaggeration,n.exaggerationRelativeHeight,n.skirtHeight,n.includeWebMercatorT,n.negativeAltitudeExponentBias,n.negativeElevationThreshold),i=e.vertices;l.push(i.buffer);let c=e.indices;return l.push(c.buffer),{vertices:i.buffer,indices:c.buffer,numberOfAttributes:e.encoding.stride,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere3D:e.boundingSphere3D,orientedBoundingBox:e.orientedBoundingBox,occludeePointInScaledSpace:e.occludeePointInScaledSpace,encoding:e.encoding,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,westIndicesSouthToNorth:e.westIndicesSouthToNorth,southIndicesEastToWest:e.southIndicesEastToWest,eastIndicesNorthToSouth:e.eastIndicesNorthToSouth,northIndicesWestToEast:e.northIndicesWestToEast}}var u=new N,G=new P,oe=new P,ne=new P,ie=new $;function re(n,l,e,i,c,et,m,ot,T,nt,it){let I,h,E,f,x,p;ht(i)?(I=i.west,h=i.south,E=i.east,f=i.north,x=i.width,p=i.height):(I=r.toRadians(c.west),h=r.toRadians(c.south),E=r.toRadians(c.east),f=r.toRadians(c.north),x=r.toRadians(i.width),p=r.toRadians(i.height));let X=[h,f],A=[I,E],O=Ot.eastNorthUpToFixedFrame(l,e),j=$.inverseTransformation(O,ie),V,Q;T&&(V=lt.geodeticLatitudeToMercatorAngle(h),Q=1/(lt.geodeticLatitudeToMercatorAngle(f)-V));let y=et!==1,a=new DataView(n),z=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,b=oe;b.x=Number.POSITIVE_INFINITY,b.y=Number.POSITIVE_INFINITY,b.z=Number.POSITIVE_INFINITY;let M=ne;M.x=Number.NEGATIVE_INFINITY,M.y=Number.NEGATIVE_INFINITY,M.z=Number.NEGATIVE_INFINITY;let o=0,S=0,At=0,rt,L;for(L=0;L<4;++L){let t=o;rt=a.getUint32(t,!0),t+=Pt;let d=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(A,d)===-1&&A.push(d);let Y=r.toRadians(a.getFloat64(t,!0)*180);t+=H,tt(X,Y)===-1&&X.push(Y),t+=2*H;let B=a.getInt32(t,!0);t+=mt,S+=B,B=a.getInt32(t,!0),At+=B*3,o+=rt+Pt}let yt=[],bt=[],g=new Array(S),R=new Array(S),_=new Array(S),C=T?new Array(S):[],F=y?new Array(S):[],v=new Array(At),k=[],st=[],ct=[],W=[],s=0,pt=0;for(o=0,L=0;L<4;++L){rt=a.getUint32(o,!0),o+=Pt;let t=o,d=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let Y=r.toRadians(a.getFloat64(o,!0)*180);o+=H;let B=r.toRadians(a.getFloat64(o,!0)*180),Ft=B*.5;o+=H;let vt=r.toRadians(a.getFloat64(o,!0)*180),Wt=vt*.5;o+=H;let Yt=a.getInt32(o,!0);o+=mt;let Kt=a.getInt32(o,!0);o+=mt,o+=mt;let St=new Array(Yt);for(let U=0;U<Yt;++U){let Z=d+a.getUint8(o++)*B;u.longitude=Z;let D=Y+a.getUint8(o++)*vt;u.latitude=D;let w=a.getFloat32(o,!0);if(o+=te,w!==0&&w<it&&(w*=-Math.pow(2,nt)),w*=6371010,u.height=w,tt(A,Z)!==-1||tt(X,D)!==-1){let dt=tt(yt,u,N);if(dt===-1)yt.push(N.clone(u)),bt.push(s);else{St[U]=bt[dt];continue}}St[U]=s,Math.abs(Z-I)<Ft?k.push({index:s,cartographic:N.clone(u)}):Math.abs(Z-E)<Ft?ct.push({index:s,cartographic:N.clone(u)}):Math.abs(D-h)<Wt?st.push({index:s,cartographic:N.clone(u)}):Math.abs(D-f)<Wt&&W.push({index:s,cartographic:N.clone(u)}),z=Math.min(w,z),J=Math.max(w,J),_[s]=w;let Nt=e.cartographicToCartesian(u);if(g[s]=Nt,T&&(C[s]=(lt.geodeticLatitudeToMercatorAngle(D)-V)*Q),y){let dt=e.geodeticSurfaceNormal(Nt);F[s]=dt}$.multiplyByPoint(j,Nt,G),P.minimumByComponent(G,b,b),P.maximumByComponent(G,M,M);let Tt=(Z-I)/(E-I);Tt=r.clamp(Tt,0,1);let Bt=(D-h)/(f-h);Bt=r.clamp(Bt,0,1),R[s]=new wt(Tt,Bt),++s}let Zt=Kt*3;for(let U=0;U<Zt;++U,++pt)v[pt]=St[a.getUint16(o,!0)],o+=$t;if(rt!==o-t)throw new Ht("Invalid terrain tile.")}g.length=s,R.length=s,_.length=s,T&&(C.length=s),y&&(F.length=s);let Mt=s,Xt=pt,K={hMin:z,lastBorderPoint:void 0,skirtHeight:ot,toENU:j,ellipsoid:e,minimum:b,maximum:M};k.sort(function(t,d){return d.cartographic.latitude-t.cartographic.latitude}),st.sort(function(t,d){return t.cartographic.longitude-d.cartographic.longitude}),ct.sort(function(t,d){return t.cartographic.latitude-d.cartographic.latitude}),W.sort(function(t,d){return d.cartographic.longitude-t.cartographic.longitude});let q=1e-5;if(gt(g,_,R,C,F,v,K,k,-q*x,!0,-q*p),gt(g,_,R,C,F,v,K,st,-q*p,!1),gt(g,_,R,C,F,v,K,ct,q*x,!0,q*p),gt(g,_,R,C,F,v,K,W,q*p,!1),k.length>0&&W.length>0){let t=k[0].index,d=Mt,Y=W[W.length-1].index,B=g.length-1;v.push(Y,B,d,d,t,Y)}S=g.length;let jt=zt.fromPoints(g),Rt;ht(i)&&(Rt=qt.fromRectangle(i,z,J,e));let Qt=new Dt(e).computeHorizonCullingPointPossiblyUnderEllipsoid(l,g,z),Jt=new kt(b,M,l),It=new Gt(l,Jt,K.hMin,J,O,!1,T,y,et,m),_t=new Float32Array(S*It.stride),Ct=0;for(let t=0;t<S;++t)Ct=It.encode(_t,Ct,g[t],R[t],_[t],void 0,C[t],F[t]);let at=k.map(function(t){return t.index}).reverse(),Et=st.map(function(t){return t.index}).reverse(),ut=ct.map(function(t){return t.index}).reverse(),xt=W.map(function(t){return t.index}).reverse();return Et.unshift(ut[ut.length-1]),Et.push(at[0]),xt.unshift(at[at.length-1]),xt.push(ut[0]),{vertices:_t,indices:new Uint16Array(v),maximumHeight:J,minimumHeight:z,encoding:It,boundingSphere3D:jt,orientedBoundingBox:Rt,occludeePointInScaledSpace:Qt,vertexCountWithoutSkirts:Mt,indexCountWithoutSkirts:Xt,westIndicesSouthToNorth:at,southIndicesEastToWest:Et,eastIndicesNorthToSouth:ut,northIndicesWestToEast:xt}}function gt(n,l,e,i,c,et,m,ot,T,nt,it){let I=ot.length;for(let h=0;h<I;++h){let E=ot[h],f=E.cartographic,x=E.index,p=n.length,X=f.longitude,A=f.latitude;A=r.clamp(A,-r.PI_OVER_TWO,r.PI_OVER_TWO);let O=f.height-m.skirtHeight;m.hMin=Math.min(m.hMin,O),N.fromRadians(X,A,O,u),nt&&(u.longitude+=T),nt?h===I-1?u.latitude+=it:h===0&&(u.latitude-=it):u.latitude+=T;let j=m.ellipsoid.cartographicToCartesian(u);n.push(j),l.push(O),e.push(wt.clone(e[x])),i.length>0&&i.push(i[x]),c.length>0&&c.push(c[x]),$.multiplyByPoint(m.toENU,j,G);let V=m.minimum,Q=m.maximum;P.minimumByComponent(G,V,V),P.maximumByComponent(G,Q,Q);let ft=m.lastBorderPoint;if(ht(ft)){let y=ft.index;et.push(y,p-1,p,p,x,y)}m.lastBorderPoint=E}}var we=Lt(ee);export{we as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVerticesFromHeightmap.js b/plugins/feature/map/Cesium/Workers/createVerticesFromHeightmap.js index 97c64284c..c8dc2b530 100644 --- a/plugins/feature/map/Cesium/Workers/createVerticesFromHeightmap.js +++ b/plugins/feature/map/Cesium/Workers/createVerticesFromHeightmap.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as ar,b as sr}from"./chunk-G65SAF2P.js";import{a as ir}from"./chunk-U3N6LNE4.js";import{a as xe}from"./chunk-L4JCTZ6Y.js";import{a as nr}from"./chunk-LUT6AMUC.js";import"./chunk-X6N776GR.js";import"./chunk-RQKZTHAV.js";import{a as tr}from"./chunk-K6A7NKZT.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{d as rr}from"./chunk-ZYYZDBKK.js";import{b as Ie,g as er,h as ne}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as re,c as Pe,d as pe}from"./chunk-FGKVHLJ4.js";import{a as he}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import{a as Re}from"./chunk-SP23RJSN.js";import{a as me}from"./chunk-ELJAHN3H.js";import{c as pr,d as Ir,e as W}from"./chunk-3BGP4HCL.js";var lr=pr((Zr,Ue)=>{/* 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 D=function(){var A={};A.defaultNoDataValue=-34027999387901484e22,A.decode=function(r,a){a=a||{};var t=a.encodedMaskData||a.encodedMaskData===null,i=n(r,a.inputOffset||0,t),o=a.noDataValue!==null?a.noDataValue:A.defaultNoDataValue,s=V(i,a.pixelType||Float32Array,a.encodedMaskData,o,a.returnMask),u={width:i.width,height:i.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:i.pixels.maxValue,noDataValue:o};return s.resultMask&&(u.maskData=s.resultMask),a.returnEncodedMask&&i.mask&&(u.encodedMaskData=i.mask.bitset?i.mask.bitset:null),a.returnFileInfo&&(u.fileInfo=b(i),a.computeUsedBitDepths&&(u.fileInfo.bitDepths=Y(i))),u};var V=function(r,a,t,i,o){var s=0,u=r.pixels.numBlocksX,m=r.pixels.numBlocksY,l=Math.floor(r.width/u),f=Math.floor(r.height/m),h=2*r.maxZError,c=Number.MAX_VALUE,g;t=t||(r.mask?r.mask.bitset:null);var v,U;v=new a(r.width*r.height),o&&t&&(U=new Uint8Array(r.width*r.height));for(var M=new Float32Array(l*f),S,I,k=0;k<=m;k++){var w=k!==m?f:r.height%m;if(w!==0)for(var d=0;d<=u;d++){var x=d!==u?l:r.width%u;if(x!==0){var T=k*r.width*f+d*l,y=r.width-x,p=r.pixels.blocks[s],L,B,E;p.encoding<2?(p.encoding===0?L=p.rawData:(e(p.stuffedData,p.bitsPerPixel,p.numValidPixels,p.offset,h,M,r.pixels.maxValue),L=M),B=0):p.encoding===2?E=0:E=p.offset;var O;if(t)for(I=0;I<w;I++){for(T&7&&(O=t[T>>3],O<<=T&7),S=0;S<x;S++)T&7||(O=t[T>>3]),O&128?(U&&(U[T]=1),g=p.encoding<2?L[B++]:E,c=c>g?g:c,v[T++]=g):(U&&(U[T]=0),v[T++]=i),O<<=1;T+=y}else if(p.encoding<2)for(I=0;I<w;I++){for(S=0;S<x;S++)g=L[B++],c=c>g?g:c,v[T++]=g;T+=y}else for(c=c>E?E:c,I=0;I<w;I++){for(S=0;S<x;S++)v[T++]=E;T+=y}if(p.encoding===1&&B!==p.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:v,resultMask:U,minValue:c}},b=function(r){return{fileIdentifierString:r.fileIdentifierString,fileVersion:r.fileVersion,imageType:r.imageType,height:r.height,width:r.width,maxZError:r.maxZError,eofOffset:r.eofOffset,mask:r.mask?{numBlocksX:r.mask.numBlocksX,numBlocksY:r.mask.numBlocksY,numBytes:r.mask.numBytes,maxValue:r.mask.maxValue}:null,pixels:{numBlocksX:r.pixels.numBlocksX,numBlocksY:r.pixels.numBlocksY,numBytes:r.pixels.numBytes,maxValue:r.pixels.maxValue,noDataValue:r.noDataValue}}},Y=function(r){for(var a=r.pixels.numBlocksX*r.pixels.numBlocksY,t={},i=0;i<a;i++){var o=r.pixels.blocks[i];o.encoding===0?t.float32=!0:o.encoding===1?t[o.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},n=function(r,a,t){var i={},o=new Uint8Array(r,a,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,o),i.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+i.fileIdentifierString;a+=10;var s=new DataView(r,a,24);if(i.fileVersion=s.getInt32(0,!0),i.imageType=s.getInt32(4,!0),i.height=s.getUint32(8,!0),i.width=s.getUint32(12,!0),i.maxZError=s.getFloat64(16,!0),a+=24,!t)if(s=new DataView(r,a,16),i.mask={},i.mask.numBlocksY=s.getUint32(0,!0),i.mask.numBlocksX=s.getUint32(4,!0),i.mask.numBytes=s.getUint32(8,!0),i.mask.maxValue=s.getFloat32(12,!0),a+=16,i.mask.numBytes>0){var u=new Uint8Array(Math.ceil(i.width*i.height/8));s=new DataView(r,a,i.mask.numBytes);var m=s.getInt16(0,!0),l=2,f=0;do{if(m>0)for(;m--;)u[f++]=s.getUint8(l++);else{var h=s.getUint8(l++);for(m=-m;m--;)u[f++]=h}m=s.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(m!==-32768||f<u.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=u,a+=i.mask.numBytes}else i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue||(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));s=new DataView(r,a,16),i.pixels={},i.pixels.numBlocksY=s.getUint32(0,!0),i.pixels.numBlocksX=s.getUint32(4,!0),i.pixels.numBytes=s.getUint32(8,!0),i.pixels.maxValue=s.getFloat32(12,!0),a+=16;var c=i.pixels.numBlocksX,g=i.pixels.numBlocksY,v=c+(i.width%c>0?1:0),U=g+(i.height%g>0?1:0);i.pixels.blocks=new Array(v*U);for(var M=0,S=0;S<U;S++)for(var I=0;I<v;I++){var k=0,w=r.byteLength-a;s=new DataView(r,a,Math.min(10,w));var d={};i.pixels.blocks[M++]=d;var x=s.getUint8(0);if(k++,d.encoding=x&63,d.encoding>3)throw"Invalid block encoding ("+d.encoding+")";if(d.encoding===2){a++;continue}if(x!==0&&x!==2){if(x>>=6,d.offsetType=x,x===2)d.offset=s.getInt8(1),k++;else if(x===1)d.offset=s.getInt16(1,!0),k+=2;else if(x===0)d.offset=s.getFloat32(1,!0),k+=4;else throw"Invalid block offset type";if(d.encoding===1)if(x=s.getUint8(k),k++,d.bitsPerPixel=x&63,x>>=6,d.numValidPixelsType=x,x===2)d.numValidPixels=s.getUint8(k),k++;else if(x===1)d.numValidPixels=s.getUint16(k,!0),k+=2;else if(x===0)d.numValidPixels=s.getUint32(k,!0),k+=4;else throw"Invalid valid pixel count type"}if(a+=k,d.encoding!==3){var T,y;if(d.encoding===0){var p=(i.pixels.numBytes-1)/4;if(p!==Math.floor(p))throw"uncompressed block has invalid length";T=new ArrayBuffer(p*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,p*4));var L=new Float32Array(T);d.rawData=L,a+=p*4}else if(d.encoding===1){var B=Math.ceil(d.numValidPixels*d.bitsPerPixel/8),E=Math.ceil(B/4);T=new ArrayBuffer(E*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,B)),d.stuffedData=new Uint32Array(T),a+=B}}}return i.eofOffset=a,i},e=function(r,a,t,i,o,s,u){var m=(1<<a)-1,l=0,f,h=0,c,g,v=Math.ceil((u-i)/o),U=r.length*4-Math.ceil(a*t/8);for(r[r.length-1]<<=8*U,f=0;f<t;f++){if(h===0&&(g=r[l++],h=32),h>=a)c=g>>>h-a&m,h-=a;else{var M=a-h;c=(g&m)<<M&m,g=r[l++],h=32-M,c+=g>>>h}s[f]=c<v?i+c*o:u}return s};return A}(),ae=function(){"use strict";var A={unstuff:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h,c,g,v,U=n.length*4-Math.ceil(r*a/8);if(n[n.length-1]<<=8*U,t)for(l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=t[h];else for(v=Math.ceil((s-i)/o),l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=h<v?i+h*o:s},unstuffLUT:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h,c=[],g=n.length*4-Math.ceil(e*r/8);n[n.length-1]<<=8*g;var v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(h=n[s++],l=32),l>=e?(f=h>>>l-e&o,l-=e):(m=e-l,f=(h&o)<<m&o,h=n[s++],l=32-m,f+=h>>>l),c[u]=f<v?a+f*t:i;return c.unshift(a),c},unstuff2:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h=0,c,g,v;if(t)for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=t[c];else{var U=Math.ceil((s-i)/o);for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=c<U?i+c*o:s}return e},unstuffLUT2:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h=0,c,g=[],v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(c=n[s++],l=32,h=0),l>=e?(f=c>>>h&o,l-=e,h+=e):(m=e-l,f=c>>>h&o,c=n[s++],l=32-m,f|=(c&(1<<m)-1)<<e-m,h=m),g[u]=f<v?a+f*t:i;return g.unshift(a),g},originalUnstuff:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u,m,l,f=n.length*4-Math.ceil(r*a/8);for(n[n.length-1]<<=8*f,o=0;o<a;o++)s===0&&(m=n[i++],s=32),s>=r?(u=m>>>s-r&t,s-=r):(l=r-s,u=(m&t)<<l&t,m=n[i++],s=32-l,u+=m>>>s),e[o]=u;return e},originalUnstuff2:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u=0,m,l,f;for(o=0;o<a;o++)s===0&&(l=n[i++],s=32,u=0),s>=r?(m=l>>>u&t,s-=r,u+=r):(f=r-s,m=l>>>u&t,l=n[i++],s=32-f,m|=(l&(1<<f)-1)<<r-f,u=f),e[o]=m;return e}},V={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(n){for(var e=65535,r=65535,a=n.length,t=Math.floor(a/2),i=0;t;){var o=t>=359?359:t;t-=o;do e+=n[i++]<<8,r+=e+=n[i++];while(--o);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}return a&1&&(r+=e+=n[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(n,e){var r=e.ptr,a=new Uint8Array(n,r,6),t={};if(t.fileIdentifierString=String.fromCharCode.apply(null,a),t.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+t.fileIdentifierString;r+=6;var i=new DataView(n,r,8),o=i.getInt32(0,!0);t.fileVersion=o,r+=4,o>=3&&(t.checksum=i.getUint32(4,!0),r+=4),i=new DataView(n,r,12),t.height=i.getUint32(0,!0),t.width=i.getUint32(4,!0),r+=8,o>=4?(t.numDims=i.getUint32(8,!0),r+=4):t.numDims=1,i=new DataView(n,r,40),t.numValidPixel=i.getUint32(0,!0),t.microBlockSize=i.getInt32(4,!0),t.blobSize=i.getInt32(8,!0),t.imageType=i.getInt32(12,!0),t.maxZError=i.getFloat64(16,!0),t.zMin=i.getFloat64(24,!0),t.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=t,e.ptr=r;var s,u;if(o>=3&&(u=o>=4?52:48,s=this.computeChecksumFletcher32(new Uint8Array(n,r-u,t.blobSize-14)),s!==t.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(n,e){var r=e.headerInfo,a=this.getDataTypeArray(r.imageType),t=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(n,e.ptr,a,t),o=this.readSubArray(n,e.ptr+t,a,t);e.ptr+=2*t;var s,u=!0;for(s=0;s<r.numDims;s++)if(i[s]!==o[s]){u=!1;break}return r.minValues=i,r.maxValues=o,u},readSubArray:function(n,e,r,a){var t;if(r===Uint8Array)t=new Uint8Array(n,e,a);else{var i=new ArrayBuffer(a),o=new Uint8Array(i);o.set(new Uint8Array(n,e,a)),t=new r(i)}return t},readMask:function(n,e){var r=e.ptr,a=e.headerInfo,t=a.width*a.height,i=a.numValidPixel,o=new DataView(n,r,4),s={};if(s.numBytes=o.getUint32(0,!0),r+=4,(i===0||t===i)&&s.numBytes!==0)throw"invalid mask";var u,m;if(i===0)u=new Uint8Array(Math.ceil(t/8)),s.bitset=u,m=new Uint8Array(t),e.pixels.resultMask=m,r+=s.numBytes;else if(s.numBytes>0){u=new Uint8Array(Math.ceil(t/8)),o=new DataView(n,r,s.numBytes);var l=o.getInt16(0,!0),f=2,h=0,c=0;do{if(l>0)for(;l--;)u[h++]=o.getUint8(f++);else for(c=o.getUint8(f++),l=-l;l--;)u[h++]=c;l=o.getInt16(f,!0),f+=2}while(f<s.numBytes);if(l!==-32768||h<u.length)throw"Unexpected end of mask RLE encoding";m=new Uint8Array(t);var g=0,v=0;for(v=0;v<t;v++)v&7?(g=u[v>>3],g<<=v&7):g=u[v>>3],g&128&&(m[v]=1);e.pixels.resultMask=m,s.bitset=u,r+=s.numBytes}return e.ptr=r,e.mask=s,!0},readDataOneSweep:function(n,e,r){var a=e.ptr,t=e.headerInfo,i=t.numDims,o=t.width*t.height,s=t.imageType,u=t.numValidPixel*V.getDataTypeSize(s)*i,m,l=e.pixels.resultMask;if(r===Uint8Array)m=new Uint8Array(n,a,u);else{var f=new ArrayBuffer(u),h=new Uint8Array(f);h.set(new Uint8Array(n,a,u)),m=new r(f)}if(m.length===o*i)e.pixels.resultPixels=m;else{e.pixels.resultPixels=new r(o*i);var c=0,g=0,v=0,U=0;if(i>1)for(v=0;v<i;v++)for(U=v*o,g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[U+g]=m[c++]);else for(g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[g]=m[c++])}return a+=u,e.ptr=a,!0},readHuffmanTree:function(n,e){var r=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(n,e.ptr,16);e.ptr+=16;var t=a.getInt32(0,!0);if(t<2)throw"unsupported Huffman version";var i=a.getInt32(4,!0),o=a.getInt32(8,!0),s=a.getInt32(12,!0);if(o>=s)return!1;var u=new Uint32Array(s-o);V.decodeBits(n,e,u);var m=[],l,f,h,c;for(l=o;l<s;l++)f=l-(l<i?0:i),m[f]={first:u[l-o],second:null};var g=n.byteLength-e.ptr,v=Math.ceil(g/4),U=new ArrayBuffer(v*4),M=new Uint8Array(U);M.set(new Uint8Array(n,e.ptr,g));var S=new Uint32Array(U),I=0,k,w=0;for(k=S[0],l=o;l<s;l++)f=l-(l<i?0:i),c=m[f].first,c>0&&(m[f].second=k<<I>>>32-c,32-I>=c?(I+=c,I===32&&(I=0,w++,k=S[w])):(I+=c-32,w++,k=S[w],m[f].second|=k>>>32-I));var d=0,x=0,T=new b;for(l=0;l<m.length;l++)m[l]!==void 0&&(d=Math.max(d,m[l].first));d>=r?x=r:x=d,d>=30&&console.log("WARning, large NUM LUT BITS IS "+d);var y=[],p,L,B,E,O,F;for(l=o;l<s;l++)if(f=l-(l<i?0:i),c=m[f].first,c>0)if(p=[c,f],c<=x)for(L=m[f].second<<x-c,B=1<<x-c,h=0;h<B;h++)y[L|h]=p;else for(L=m[f].second,F=T,E=c-1;E>=0;E--)O=L>>>E&1,O?(F.right||(F.right=new b),F=F.right):(F.left||(F.left=new b),F=F.left),E===0&&!F.val&&(F.val=p[1]);return{decodeLut:y,numBitsLUTQick:x,numBitsLUT:d,tree:T,stuffedData:S,srcPtr:w,bitPos:I}},readHuffman:function(n,e,r){var a=e.headerInfo,t=a.numDims,i=e.headerInfo.height,o=e.headerInfo.width,s=o*i,u=this.readHuffmanTree(n,e),m=u.decodeLut,l=u.tree,f=u.stuffedData,h=u.srcPtr,c=u.bitPos,g=u.numBitsLUTQick,v=u.numBitsLUT,U=e.headerInfo.imageType===0?128:0,M,S,I,k=e.pixels.resultMask,w,d,x,T,y,p,L,B=0;c>0&&(h++,c=0);var E=f[h],O=e.encodeMode===1,F=new r(s*t),N=F,_;for(_=0;_<a.numDims;_++){if(t>1&&(N=new r(F.buffer,s*_,s),B=0),e.headerInfo.numValidPixel===o*i)for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0?I+=B:T>0?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}else for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++)if(k[p]){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0&&k[p-1]?I+=B:T>0&&k[p-o]?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}e.ptr=e.ptr+(h+1)*4+(c>0?4:0)}e.pixels.resultPixels=F},decodeBits:function(n,e,r,a,t){{var i=e.headerInfo,o=i.fileVersion,s=0,u=new DataView(n,e.ptr,5),m=u.getUint8(0);s++;var l=m>>6,f=l===0?4:3-l,h=(m&32)>0,c=m&31,g=0;if(f===1)g=u.getUint8(s),s++;else if(f===2)g=u.getUint16(s,!0),s+=2;else if(f===4)g=u.getUint32(s,!0),s+=4;else throw"Invalid valid pixel count type";var v=2*i.maxZError,U,M,S,I,k,w,d,x,T,y,p=i.numDims>1?i.maxValues[t]:i.zMax;if(h){for(e.counter.lut++,x=u.getUint8(s),T=c,s++,I=Math.ceil((x-1)*c/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),e.ptr+=s,S.set(new Uint8Array(n,e.ptr,I)),d=new Uint32Array(M),e.ptr+=I,y=0;x-1>>>y;)y++;I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?w=A.unstuffLUT2(d,c,x-1,a,v,p):w=A.unstuffLUT(d,c,x-1,a,v,p),o>=3?A.unstuff2(U,r,y,g,w):A.unstuff(U,r,y,g,w)}else e.counter.bitstuffer++,y=c,e.ptr+=s,y>0&&(I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?a==null?A.originalUnstuff2(U,r,y,g):A.unstuff2(U,r,y,g,!1,a,v,p):a==null?A.originalUnstuff(U,r,y,g):A.unstuff(U,r,y,g,!1,a,v,p))}},readTiles:function(n,e,r){var a=e.headerInfo,t=a.width,i=a.height,o=a.microBlockSize,s=a.imageType,u=V.getDataTypeSize(s),m=Math.ceil(t/o),l=Math.ceil(i/o);e.pixels.numBlocksY=l,e.pixels.numBlocksX=m,e.pixels.ptr=0;var f=0,h=0,c=0,g=0,v=0,U=0,M=0,S=0,I=0,k=0,w=0,d=0,x=0,T=0,y=0,p=0,L,B,E,O,F,N,_=new r(o*o),Te=i%o||o,ke=t%o||o,Q,z,le=a.numDims,ie,Z=e.pixels.resultMask,j=e.pixels.resultPixels;for(c=0;c<l;c++)for(v=c!==l-1?o:Te,g=0;g<m;g++)for(U=g!==m-1?o:ke,w=c*t*o+g*o,d=t-U,ie=0;ie<le;ie++){if(le>1&&(j=new r(e.pixels.resultPixels.buffer,t*i*ie*u,t*i)),M=n.byteLength-e.ptr,L=new DataView(n,e.ptr,Math.min(10,M)),B={},p=0,S=L.getUint8(0),p++,I=S>>6&255,k=S>>2&15,k!==(g*o>>3&15))throw"integrity issue";if(N=S&3,N>3)throw e.ptr+=p,"Invalid block encoding ("+N+")";if(N===2){e.counter.constant++,e.ptr+=p;continue}else if(N===0){if(e.counter.uncompressed++,e.ptr+=p,x=v*U*u,T=n.byteLength-e.ptr,x=x<T?x:T,E=new ArrayBuffer(x%u===0?x:x+u-x%u),O=new Uint8Array(E),O.set(new Uint8Array(n,e.ptr,x)),F=new r(E),y=0,Z)for(f=0;f<v;f++){for(h=0;h<U;h++)Z[w]&&(j[w]=F[y++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)j[w++]=F[y++];w+=d}e.ptr+=y*u}else if(Q=V.getDataTypeUsed(s,I),z=V.getOnePixel(B,p,Q,L),p+=V.getDataTypeSize(Q),N===3)if(e.ptr+=p,e.counter.constantoffset++,Z)for(f=0;f<v;f++){for(h=0;h<U;h++)Z[w]&&(j[w]=z),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)j[w++]=z;w+=d}else if(e.ptr+=p,V.decodeBits(n,e,_,z,ie),p=0,Z)for(f=0;f<v;f++){for(h=0;h<U;h++)Z[w]&&(j[w]=_[p++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)j[w++]=_[p++];w+=d}}},formatFileInfo:function(n){return{fileIdentifierString:n.headerInfo.fileIdentifierString,fileVersion:n.headerInfo.fileVersion,imageType:n.headerInfo.imageType,height:n.headerInfo.height,width:n.headerInfo.width,numValidPixel:n.headerInfo.numValidPixel,microBlockSize:n.headerInfo.microBlockSize,blobSize:n.headerInfo.blobSize,maxZError:n.headerInfo.maxZError,pixelType:V.getPixelType(n.headerInfo.imageType),eofOffset:n.eofOffset,mask:n.mask?{numBytes:n.mask.numBytes}:null,pixels:{numBlocksX:n.pixels.numBlocksX,numBlocksY:n.pixels.numBlocksY,maxValue:n.headerInfo.zMax,minValue:n.headerInfo.zMin,noDataValue:n.noDataValue}}},constructConstantSurface:function(n){var e=n.headerInfo.zMax,r=n.headerInfo.numDims,a=n.headerInfo.height*n.headerInfo.width,t=a*r,i=0,o=0,s=0,u=n.pixels.resultMask;if(u)if(r>1)for(i=0;i<r;i++)for(s=i*a,o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[s+o]=e);else for(o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[o]=e);else if(n.pixels.resultPixels.fill)n.pixels.resultPixels.fill(e);else for(o=0;o<t;o++)n.pixels.resultPixels[o]=e},getDataTypeArray:function(n){var e;switch(n){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:e=Float32Array;break;case 7:e=Float64Array;break;default:e=Float32Array}return e},getPixelType:function(n){var e;switch(n){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:e="F32";break;case 7:e="F64";break;default:e="F32"}return e},isValidPixelValue:function(n,e){if(e==null)return!1;var r;switch(n){case 0:r=e>=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=5e-324&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(n){var e=0;switch(n){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=n}return e},getDataTypeUsed:function(n,e){var r=n;switch(n){case 2:case 4:r=n-e;break;case 3:case 5:r=n-2*e;break;case 6:e===0?r=n:e===1?r=2:r=1;break;case 7:e===0?r=n:r=n-2*e+1;break;default:r=n;break}return r},getOnePixel:function(n,e,r,a){var t=0;switch(r){case 0:t=a.getInt8(e);break;case 1:t=a.getUint8(e);break;case 2:t=a.getInt16(e,!0);break;case 3:t=a.getUint16(e,!0);break;case 4:t=a.getInt32(e,!0);break;case 5:t=a.getUInt32(e,!0);break;case 6:t=a.getFloat32(e,!0);break;case 7:t=a.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return t}},b=function(n,e,r){this.val=n,this.left=e,this.right=r},Y={decode:function(n,e){e=e||{};var r=e.noDataValue,a=0,t={};if(t.ptr=e.inputOffset||0,t.pixels={},!!V.readHeaderInfo(n,t)){var i=t.headerInfo,o=i.fileVersion,s=V.getDataTypeArray(i.imageType);V.readMask(n,t),i.numValidPixel!==i.width*i.height&&!t.pixels.resultMask&&(t.pixels.resultMask=e.maskData);var u=i.width*i.height;if(t.pixels.resultPixels=new s(u*i.numDims),t.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},i.numValidPixel!==0)if(i.zMax===i.zMin)V.constructConstantSurface(t);else if(o>=4&&V.checkMinMaxRanges(n,t))V.constructConstantSurface(t);else{var m=new DataView(n,t.ptr,2),l=m.getUint8(0);if(t.ptr++,l)V.readDataOneSweep(n,t,s);else if(o>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var f=m.getUint8(1);if(t.ptr++,t.encodeMode=f,f>2||o<4&&f>1)throw"Invalid Huffman flag "+f;f?V.readHuffman(n,t,s):V.readTiles(n,t,s)}else V.readTiles(n,t,s)}t.eofOffset=t.ptr;var h;e.inputOffset?(h=t.headerInfo.blobSize+e.inputOffset-t.ptr,Math.abs(h)>=1&&(t.eofOffset=e.inputOffset+t.headerInfo.blobSize)):(h=t.headerInfo.blobSize-t.ptr,Math.abs(h)>=1&&(t.eofOffset=t.headerInfo.blobSize));var c={width:i.width,height:i.height,pixelData:t.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:t.pixels.resultMask};if(t.pixels.resultMask&&V.isValidPixelValue(i.imageType,r)){var g=t.pixels.resultMask;for(a=0;a<u;a++)g[a]||(c.pixelData[a]=r);c.noDataValue=r}return t.noDataValue=r,e.returnFileInfo&&(c.fileInfo=V.formatFileInfo(t)),c}},getBandCount:function(n){var e=0,r=0,a={};for(a.ptr=0,a.pixels={};r<n.byteLength-58;)V.readHeaderInfo(n,a),r+=a.headerInfo.blobSize,e++,a.ptr=r;return e}};return Y}(),C=function(){var A=new ArrayBuffer(4),V=new Uint8Array(A),b=new Uint32Array(A);return b[0]=1,V[0]===1}(),ee={decode:function(A,V){if(!C)throw"Big endian system is not supported.";V=V||{};var b=V.inputOffset||0,Y=new Uint8Array(A,b,10),n=String.fromCharCode.apply(null,Y),e,r;if(n.trim()==="CntZImage")e=D,r=1;else if(n.substring(0,5)==="Lerc2")e=ae,r=2;else throw"Unexpected file identifier string: "+n;for(var a=0,t=A.byteLength-10,i,o=[],s,u,m={width:0,height:0,pixels:[],pixelType:V.pixelType,mask:null,statistics:[]};b<t;){var l=e.decode(A,{inputOffset:b,encodedMaskData:i,maskData:u,returnMask:a===0,returnEncodedMask:a===0,returnFileInfo:!0,pixelType:V.pixelType||null,noDataValue:V.noDataValue||null});b=l.fileInfo.eofOffset,a===0&&(i=l.encodedMaskData,u=l.maskData,m.width=l.width,m.height=l.height,m.dimCount=l.dimCount||1,m.pixelType=l.pixelType||l.fileInfo.pixelType,m.mask=l.maskData),r>1&&l.fileInfo.mask&&l.fileInfo.mask.numBytes>0&&o.push(l.maskData),a++,m.pixels.push(l.pixelData),m.statistics.push({minValue:l.minValue,maxValue:l.maxValue,noDataValue:l.noDataValue,dimStats:l.dimStats})}var f,h,c;if(r>1&&o.length>1){for(c=m.width*m.height,m.bandMasks=o,u=new Uint8Array(c),u.set(o[0]),f=1;f<o.length;f++)for(s=o[f],h=0;h<c;h++)u[h]=u[h]&s[h];m.maskData=u}return m}};typeof define=="function"&&define.amd?define([],function(){return ee}):typeof Ue<"u"&&Ue.exports?Ue.exports=ee:this.Lerc=ee})()});var xr={NONE:0,LERC:1},fr=Object.freeze(xr);var G={};G.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var He=new re,Ur=new Ie,Tr=new re,kr=new re;G.computeVertices=function(D){if(!W(D)||!W(D.heightmap))throw new me("options.heightmap is required.");if(!W(D.width)||!W(D.height))throw new me("options.width and options.height are required.");if(!W(D.nativeRectangle))throw new me("options.nativeRectangle is required.");if(!W(D.skirtHeight))throw new me("options.skirtHeight is required.");let ae=Math.cos,C=Math.sin,ee=Math.sqrt,A=Math.atan,V=Math.exp,b=he.PI_OVER_TWO,Y=he.toRadians,n=D.heightmap,e=D.width,r=D.height,a=D.skirtHeight,t=a>0,i=D.isGeographic??!0,o=D.ellipsoid??pe.default,s=1/o.maximumRadius,u=ne.clone(D.nativeRectangle),m=ne.clone(D.rectangle),l,f,h,c;W(m)?(l=m.west,f=m.south,h=m.east,c=m.north):i?(l=Y(u.west),f=Y(u.south),h=Y(u.east),c=Y(u.north)):(l=u.west*s,f=b-2*A(V(-u.south*s)),h=u.east*s,c=b-2*A(V(-u.north*s)));let g=D.relativeToCenter,v=W(g);g=v?g:re.ZERO;let U=D.includeWebMercatorT??!1,M=D.exaggeration??1,S=D.exaggerationRelativeHeight??0,k=M!==1,w=D.structure??G.DEFAULT_STRUCTURE,d=w.heightScale??G.DEFAULT_STRUCTURE.heightScale,x=w.heightOffset??G.DEFAULT_STRUCTURE.heightOffset,T=w.elementsPerHeight??G.DEFAULT_STRUCTURE.elementsPerHeight,y=w.stride??G.DEFAULT_STRUCTURE.stride,p=w.elementMultiplier??G.DEFAULT_STRUCTURE.elementMultiplier,L=w.isBigEndian??G.DEFAULT_STRUCTURE.isBigEndian,B=ne.computeWidth(u),E=ne.computeHeight(u),O=B/(e-1),F=E/(r-1);i||(B*=s,E*=s);let N=o.radiiSquared,_=N.x,Te=N.y,ke=N.z,Q=65536,z=-65536,le=er.eastNorthUpToFixedFrame(g,o),ie=Ie.inverseTransformation(le,Ur),Z,j;U&&(Z=xe.geodeticLatitudeToMercatorAngle(f),j=1/(xe.geodeticLatitudeToMercatorAngle(c)-Z));let se=Tr;se.x=Number.POSITIVE_INFINITY,se.y=Number.POSITIVE_INFINITY,se.z=Number.POSITIVE_INFINITY;let fe=kr;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;let ye=Number.POSITIVE_INFINITY,ue=e*r,cr=a>0?e*2+r*2:0,te=ue+cr,ge=new Array(te),Ye=new Array(te),Xe=new Array(te),_e=U?new Array(te):[],ze=k?new Array(te):[],Me=0,Se=r,Ve=0,De=e;t&&(--Me,++Se,--Ve,++De);let ve=1e-5;for(let H=Me;H<Se;++H){let J=H;J<0&&(J=0),J>=r&&(J=r-1);let q=u.north-F*J;i?q=Y(q):q=b-2*A(V(-q*s));let Ee=(q-f)/(c-f);Ee=he.clamp(Ee,0,1);let de=H===Me,we=H===Se-1;a>0&&(de?q+=ve*E:we&&(q-=ve*E));let Ge=ae(q),Le=C(q),Qe=ke*Le,Je;U&&(Je=(xe.geodeticLatitudeToMercatorAngle(q)-Z)*j);for(let ce=Ve;ce<De;++ce){let K=ce;K<0&&(K=0),K>=e&&(K=e-1);let Be=J*(e*y)+K*y,R;if(T===1)R=n[Be];else{R=0;let X;if(L)for(X=0;X<T;++X)R=R*p+n[Be+X];else for(X=T-1;X>=0;--X)R=R*p+n[Be+X]}R=R*d+x,z=Math.max(z,R),Q=Math.min(Q,R);let $=u.west+O*K;i?$=Y($):$=$*s;let Fe=($-l)/(h-l);Fe=he.clamp(Fe,0,1);let P=J*e+K;if(a>0){let X=ce===Ve,Oe=ce===De-1,wr=de||we||X||Oe;if((de||we)&&(X||Oe))continue;wr&&(R-=a,X?(P=ue+(r-J-1),$-=ve*B):we?P=ue+r+(e-K-1):Oe?(P=ue+r+e+J,$+=ve*B):de&&(P=ue+r+e+r+K))}let be=Ge*ae($),Ne=Ge*C($),Ke=_*be,$e=Te*Ne,Ce=1/ee(Ke*be+$e*Ne+Qe*Le),gr=Ke*Ce,vr=$e*Ce,dr=Qe*Ce,oe=new re;oe.x=gr+be*R,oe.y=vr+Ne*R,oe.z=dr+Le*R,Ie.multiplyByPoint(ie,oe,He),re.minimumByComponent(He,se,se),re.maximumByComponent(He,fe,fe),ye=Math.min(ye,R),ge[P]=oe,Xe[P]=new Pe(Fe,Ee),Ye[P]=R,U&&(_e[P]=Je),k&&(ze[P]=o.geodeticSurfaceNormal(oe))}}let mr=rr.fromPoints(ge),Ze;W(m)&&(Ze=nr.fromRectangle(m,Q,z,o));let je;v&&(je=new ar(o).computeHorizonCullingPointPossiblyUnderEllipsoid(g,ge,Q));let hr=new tr(se,fe,g),Ae=new sr(g,hr,ye,z,le,!1,U,k,M,S),qe=new Float32Array(te*Ae.stride),We=0;for(let H=0;H<te;++H)We=Ae.encode(qe,We,ge[H],Xe[H],Ye[H],void 0,_e[H],ze[H]);return{vertices:qe,maximumHeight:z,minimumHeight:Q,encoding:Ae,boundingSphere3D:mr,orientedBoundingBox:Ze,occludeePointInScaledSpace:je}};var or=G;var ur=Ir(lr(),1);function yr(D,ae){if(D.encoding===fr.LERC){let A;try{A=ur.default.decode(D.heightmap)}catch(b){throw new Re(b)}if(A.statistics[0].minValue===Number.MAX_VALUE)throw new Re("Invalid tile data");D.heightmap=A.pixels[0],D.width=A.width,D.height=A.height}D.ellipsoid=pe.clone(D.ellipsoid),D.rectangle=ne.clone(D.rectangle);let C=or.computeVertices(D),ee=C.vertices;return ae.push(ee.buffer),{vertices:ee.buffer,numberOfAttributes:C.encoding.stride,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,gridWidth:D.width,gridHeight:D.height,boundingSphere3D:C.boundingSphere3D,orientedBoundingBox:C.orientedBoundingBox,occludeePointInScaledSpace:C.occludeePointInScaledSpace,encoding:C.encoding,westIndicesSouthToNorth:C.westIndicesSouthToNorth,southIndicesEastToWest:C.southIndicesEastToWest,eastIndicesNorthToSouth:C.eastIndicesNorthToSouth,northIndicesWestToEast:C.northIndicesWestToEast}}var Kr=ir(yr);export{Kr as default}; +import{a as ar,c as sr}from"./chunk-WVRWFNLS.js";import{a as ir}from"./chunk-JJVL7F22.js";import{a as xe}from"./chunk-MQTDGHHT.js";import{a as nr}from"./chunk-XAERMS6D.js";import"./chunk-QCE33JV5.js";import"./chunk-C5UTI7P4.js";import{a as tr}from"./chunk-DV5LK4D5.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{c as rr}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{i as er,j as ne}from"./chunk-YZ5ZCI55.js";import{b as Ie}from"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import{a as Re}from"./chunk-23IOGON7.js";import{b as Pe,c as pe}from"./chunk-KP72RGCH.js";import{a as re}from"./chunk-OSVSBQDY.js";import{a as he}from"./chunk-LZC73BOP.js";import{a as me}from"./chunk-OU2IPMYE.js";import{c as Ir,d as xr,f as W}from"./chunk-H7SJWKIY.js";var ur=Ir((Zr,Ue)=>{/* 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 D=(function(){var A={};A.defaultNoDataValue=-34027999387901484e22,A.decode=function(r,a){a=a||{};var t=a.encodedMaskData||a.encodedMaskData===null,i=n(r,a.inputOffset||0,t),o=a.noDataValue!==null?a.noDataValue:A.defaultNoDataValue,s=V(i,a.pixelType||Float32Array,a.encodedMaskData,o,a.returnMask),u={width:i.width,height:i.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:i.pixels.maxValue,noDataValue:o};return s.resultMask&&(u.maskData=s.resultMask),a.returnEncodedMask&&i.mask&&(u.encodedMaskData=i.mask.bitset?i.mask.bitset:null),a.returnFileInfo&&(u.fileInfo=b(i),a.computeUsedBitDepths&&(u.fileInfo.bitDepths=Y(i))),u};var V=function(r,a,t,i,o){var s=0,u=r.pixels.numBlocksX,m=r.pixels.numBlocksY,l=Math.floor(r.width/u),f=Math.floor(r.height/m),h=2*r.maxZError,c=Number.MAX_VALUE,g;t=t||(r.mask?r.mask.bitset:null);var v,U;v=new a(r.width*r.height),o&&t&&(U=new Uint8Array(r.width*r.height));for(var M=new Float32Array(l*f),S,I,k=0;k<=m;k++){var w=k!==m?f:r.height%m;if(w!==0)for(var d=0;d<=u;d++){var x=d!==u?l:r.width%u;if(x!==0){var T=k*r.width*f+d*l,y=r.width-x,p=r.pixels.blocks[s],L,B,E;p.encoding<2?(p.encoding===0?L=p.rawData:(e(p.stuffedData,p.bitsPerPixel,p.numValidPixels,p.offset,h,M,r.pixels.maxValue),L=M),B=0):p.encoding===2?E=0:E=p.offset;var O;if(t)for(I=0;I<w;I++){for(T&7&&(O=t[T>>3],O<<=T&7),S=0;S<x;S++)T&7||(O=t[T>>3]),O&128?(U&&(U[T]=1),g=p.encoding<2?L[B++]:E,c=c>g?g:c,v[T++]=g):(U&&(U[T]=0),v[T++]=i),O<<=1;T+=y}else if(p.encoding<2)for(I=0;I<w;I++){for(S=0;S<x;S++)g=L[B++],c=c>g?g:c,v[T++]=g;T+=y}else for(c=c>E?E:c,I=0;I<w;I++){for(S=0;S<x;S++)v[T++]=E;T+=y}if(p.encoding===1&&B!==p.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:v,resultMask:U,minValue:c}},b=function(r){return{fileIdentifierString:r.fileIdentifierString,fileVersion:r.fileVersion,imageType:r.imageType,height:r.height,width:r.width,maxZError:r.maxZError,eofOffset:r.eofOffset,mask:r.mask?{numBlocksX:r.mask.numBlocksX,numBlocksY:r.mask.numBlocksY,numBytes:r.mask.numBytes,maxValue:r.mask.maxValue}:null,pixels:{numBlocksX:r.pixels.numBlocksX,numBlocksY:r.pixels.numBlocksY,numBytes:r.pixels.numBytes,maxValue:r.pixels.maxValue,noDataValue:r.noDataValue}}},Y=function(r){for(var a=r.pixels.numBlocksX*r.pixels.numBlocksY,t={},i=0;i<a;i++){var o=r.pixels.blocks[i];o.encoding===0?t.float32=!0:o.encoding===1?t[o.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},n=function(r,a,t){var i={},o=new Uint8Array(r,a,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,o),i.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+i.fileIdentifierString;a+=10;var s=new DataView(r,a,24);if(i.fileVersion=s.getInt32(0,!0),i.imageType=s.getInt32(4,!0),i.height=s.getUint32(8,!0),i.width=s.getUint32(12,!0),i.maxZError=s.getFloat64(16,!0),a+=24,!t)if(s=new DataView(r,a,16),i.mask={},i.mask.numBlocksY=s.getUint32(0,!0),i.mask.numBlocksX=s.getUint32(4,!0),i.mask.numBytes=s.getUint32(8,!0),i.mask.maxValue=s.getFloat32(12,!0),a+=16,i.mask.numBytes>0){var u=new Uint8Array(Math.ceil(i.width*i.height/8));s=new DataView(r,a,i.mask.numBytes);var m=s.getInt16(0,!0),l=2,f=0;do{if(m>0)for(;m--;)u[f++]=s.getUint8(l++);else{var h=s.getUint8(l++);for(m=-m;m--;)u[f++]=h}m=s.getInt16(l,!0),l+=2}while(l<i.mask.numBytes);if(m!==-32768||f<u.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=u,a+=i.mask.numBytes}else(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)===0&&(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));s=new DataView(r,a,16),i.pixels={},i.pixels.numBlocksY=s.getUint32(0,!0),i.pixels.numBlocksX=s.getUint32(4,!0),i.pixels.numBytes=s.getUint32(8,!0),i.pixels.maxValue=s.getFloat32(12,!0),a+=16;var c=i.pixels.numBlocksX,g=i.pixels.numBlocksY,v=c+(i.width%c>0?1:0),U=g+(i.height%g>0?1:0);i.pixels.blocks=new Array(v*U);for(var M=0,S=0;S<U;S++)for(var I=0;I<v;I++){var k=0,w=r.byteLength-a;s=new DataView(r,a,Math.min(10,w));var d={};i.pixels.blocks[M++]=d;var x=s.getUint8(0);if(k++,d.encoding=x&63,d.encoding>3)throw"Invalid block encoding ("+d.encoding+")";if(d.encoding===2){a++;continue}if(x!==0&&x!==2){if(x>>=6,d.offsetType=x,x===2)d.offset=s.getInt8(1),k++;else if(x===1)d.offset=s.getInt16(1,!0),k+=2;else if(x===0)d.offset=s.getFloat32(1,!0),k+=4;else throw"Invalid block offset type";if(d.encoding===1)if(x=s.getUint8(k),k++,d.bitsPerPixel=x&63,x>>=6,d.numValidPixelsType=x,x===2)d.numValidPixels=s.getUint8(k),k++;else if(x===1)d.numValidPixels=s.getUint16(k,!0),k+=2;else if(x===0)d.numValidPixels=s.getUint32(k,!0),k+=4;else throw"Invalid valid pixel count type"}if(a+=k,d.encoding!==3){var T,y;if(d.encoding===0){var p=(i.pixels.numBytes-1)/4;if(p!==Math.floor(p))throw"uncompressed block has invalid length";T=new ArrayBuffer(p*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,p*4));var L=new Float32Array(T);d.rawData=L,a+=p*4}else if(d.encoding===1){var B=Math.ceil(d.numValidPixels*d.bitsPerPixel/8),E=Math.ceil(B/4);T=new ArrayBuffer(E*4),y=new Uint8Array(T),y.set(new Uint8Array(r,a,B)),d.stuffedData=new Uint32Array(T),a+=B}}}return i.eofOffset=a,i},e=function(r,a,t,i,o,s,u){var m=(1<<a)-1,l=0,f,h=0,c,g,v=Math.ceil((u-i)/o),U=r.length*4-Math.ceil(a*t/8);for(r[r.length-1]<<=8*U,f=0;f<t;f++){if(h===0&&(g=r[l++],h=32),h>=a)c=g>>>h-a&m,h-=a;else{var M=a-h;c=(g&m)<<M&m,g=r[l++],h=32-M,c+=g>>>h}s[f]=c<v?i+c*o:u}return s};return A})(),ae=(function(){"use strict";var A={unstuff:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h,c,g,v,U=n.length*4-Math.ceil(r*a/8);if(n[n.length-1]<<=8*U,t)for(l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=t[h];else for(v=Math.ceil((s-i)/o),l=0;l<a;l++)f===0&&(c=n[m++],f=32),f>=r?(h=c>>>f-r&u,f-=r):(g=r-f,h=(c&u)<<g&u,c=n[m++],f=32-g,h+=c>>>f),e[l]=h<v?i+h*o:s},unstuffLUT:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h,c=[],g=n.length*4-Math.ceil(e*r/8);n[n.length-1]<<=8*g;var v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(h=n[s++],l=32),l>=e?(f=h>>>l-e&o,l-=e):(m=e-l,f=(h&o)<<m&o,h=n[s++],l=32-m,f+=h>>>l),c[u]=f<v?a+f*t:i;return c.unshift(a),c},unstuff2:function(n,e,r,a,t,i,o,s){var u=(1<<r)-1,m=0,l,f=0,h=0,c,g,v;if(t)for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=t[c];else{var U=Math.ceil((s-i)/o);for(l=0;l<a;l++)f===0&&(g=n[m++],f=32,h=0),f>=r?(c=g>>>h&u,f-=r,h+=r):(v=r-f,c=g>>>h&u,g=n[m++],f=32-v,c|=(g&(1<<v)-1)<<r-v,h=v),e[l]=c<U?i+c*o:s}return e},unstuffLUT2:function(n,e,r,a,t,i){var o=(1<<e)-1,s=0,u=0,m=0,l=0,f=0,h=0,c,g=[],v=Math.ceil((i-a)/t);for(u=0;u<r;u++)l===0&&(c=n[s++],l=32,h=0),l>=e?(f=c>>>h&o,l-=e,h+=e):(m=e-l,f=c>>>h&o,c=n[s++],l=32-m,f|=(c&(1<<m)-1)<<e-m,h=m),g[u]=f<v?a+f*t:i;return g.unshift(a),g},originalUnstuff:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u,m,l,f=n.length*4-Math.ceil(r*a/8);for(n[n.length-1]<<=8*f,o=0;o<a;o++)s===0&&(m=n[i++],s=32),s>=r?(u=m>>>s-r&t,s-=r):(l=r-s,u=(m&t)<<l&t,m=n[i++],s=32-l,u+=m>>>s),e[o]=u;return e},originalUnstuff2:function(n,e,r,a){var t=(1<<r)-1,i=0,o,s=0,u=0,m,l,f;for(o=0;o<a;o++)s===0&&(l=n[i++],s=32,u=0),s>=r?(m=l>>>u&t,s-=r,u+=r):(f=r-s,m=l>>>u&t,l=n[i++],s=32-f,m|=(l&(1<<f)-1)<<r-f,u=f),e[o]=m;return e}},V={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(n){for(var e=65535,r=65535,a=n.length,t=Math.floor(a/2),i=0;t;){var o=t>=359?359:t;t-=o;do e+=n[i++]<<8,r+=e+=n[i++];while(--o);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}return a&1&&(r+=e+=n[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(n,e){var r=e.ptr,a=new Uint8Array(n,r,6),t={};if(t.fileIdentifierString=String.fromCharCode.apply(null,a),t.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+t.fileIdentifierString;r+=6;var i=new DataView(n,r,8),o=i.getInt32(0,!0);t.fileVersion=o,r+=4,o>=3&&(t.checksum=i.getUint32(4,!0),r+=4),i=new DataView(n,r,12),t.height=i.getUint32(0,!0),t.width=i.getUint32(4,!0),r+=8,o>=4?(t.numDims=i.getUint32(8,!0),r+=4):t.numDims=1,i=new DataView(n,r,40),t.numValidPixel=i.getUint32(0,!0),t.microBlockSize=i.getInt32(4,!0),t.blobSize=i.getInt32(8,!0),t.imageType=i.getInt32(12,!0),t.maxZError=i.getFloat64(16,!0),t.zMin=i.getFloat64(24,!0),t.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=t,e.ptr=r;var s,u;if(o>=3&&(u=o>=4?52:48,s=this.computeChecksumFletcher32(new Uint8Array(n,r-u,t.blobSize-14)),s!==t.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(n,e){var r=e.headerInfo,a=this.getDataTypeArray(r.imageType),t=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(n,e.ptr,a,t),o=this.readSubArray(n,e.ptr+t,a,t);e.ptr+=2*t;var s,u=!0;for(s=0;s<r.numDims;s++)if(i[s]!==o[s]){u=!1;break}return r.minValues=i,r.maxValues=o,u},readSubArray:function(n,e,r,a){var t;if(r===Uint8Array)t=new Uint8Array(n,e,a);else{var i=new ArrayBuffer(a),o=new Uint8Array(i);o.set(new Uint8Array(n,e,a)),t=new r(i)}return t},readMask:function(n,e){var r=e.ptr,a=e.headerInfo,t=a.width*a.height,i=a.numValidPixel,o=new DataView(n,r,4),s={};if(s.numBytes=o.getUint32(0,!0),r+=4,(i===0||t===i)&&s.numBytes!==0)throw"invalid mask";var u,m;if(i===0)u=new Uint8Array(Math.ceil(t/8)),s.bitset=u,m=new Uint8Array(t),e.pixels.resultMask=m,r+=s.numBytes;else if(s.numBytes>0){u=new Uint8Array(Math.ceil(t/8)),o=new DataView(n,r,s.numBytes);var l=o.getInt16(0,!0),f=2,h=0,c=0;do{if(l>0)for(;l--;)u[h++]=o.getUint8(f++);else for(c=o.getUint8(f++),l=-l;l--;)u[h++]=c;l=o.getInt16(f,!0),f+=2}while(f<s.numBytes);if(l!==-32768||h<u.length)throw"Unexpected end of mask RLE encoding";m=new Uint8Array(t);var g=0,v=0;for(v=0;v<t;v++)v&7?(g=u[v>>3],g<<=v&7):g=u[v>>3],g&128&&(m[v]=1);e.pixels.resultMask=m,s.bitset=u,r+=s.numBytes}return e.ptr=r,e.mask=s,!0},readDataOneSweep:function(n,e,r){var a=e.ptr,t=e.headerInfo,i=t.numDims,o=t.width*t.height,s=t.imageType,u=t.numValidPixel*V.getDataTypeSize(s)*i,m,l=e.pixels.resultMask;if(r===Uint8Array)m=new Uint8Array(n,a,u);else{var f=new ArrayBuffer(u),h=new Uint8Array(f);h.set(new Uint8Array(n,a,u)),m=new r(f)}if(m.length===o*i)e.pixels.resultPixels=m;else{e.pixels.resultPixels=new r(o*i);var c=0,g=0,v=0,U=0;if(i>1)for(v=0;v<i;v++)for(U=v*o,g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[U+g]=m[c++]);else for(g=0;g<o;g++)l[g]&&(e.pixels.resultPixels[g]=m[c++])}return a+=u,e.ptr=a,!0},readHuffmanTree:function(n,e){var r=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(n,e.ptr,16);e.ptr+=16;var t=a.getInt32(0,!0);if(t<2)throw"unsupported Huffman version";var i=a.getInt32(4,!0),o=a.getInt32(8,!0),s=a.getInt32(12,!0);if(o>=s)return!1;var u=new Uint32Array(s-o);V.decodeBits(n,e,u);var m=[],l,f,h,c;for(l=o;l<s;l++)f=l-(l<i?0:i),m[f]={first:u[l-o],second:null};var g=n.byteLength-e.ptr,v=Math.ceil(g/4),U=new ArrayBuffer(v*4),M=new Uint8Array(U);M.set(new Uint8Array(n,e.ptr,g));var S=new Uint32Array(U),I=0,k,w=0;for(k=S[0],l=o;l<s;l++)f=l-(l<i?0:i),c=m[f].first,c>0&&(m[f].second=k<<I>>>32-c,32-I>=c?(I+=c,I===32&&(I=0,w++,k=S[w])):(I+=c-32,w++,k=S[w],m[f].second|=k>>>32-I));var d=0,x=0,T=new b;for(l=0;l<m.length;l++)m[l]!==void 0&&(d=Math.max(d,m[l].first));d>=r?x=r:x=d,d>=30&&console.log("WARning, large NUM LUT BITS IS "+d);var y=[],p,L,B,E,O,F;for(l=o;l<s;l++)if(f=l-(l<i?0:i),c=m[f].first,c>0)if(p=[c,f],c<=x)for(L=m[f].second<<x-c,B=1<<x-c,h=0;h<B;h++)y[L|h]=p;else for(L=m[f].second,F=T,E=c-1;E>=0;E--)O=L>>>E&1,O?(F.right||(F.right=new b),F=F.right):(F.left||(F.left=new b),F=F.left),E===0&&!F.val&&(F.val=p[1]);return{decodeLut:y,numBitsLUTQick:x,numBitsLUT:d,tree:T,stuffedData:S,srcPtr:w,bitPos:I}},readHuffman:function(n,e,r){var a=e.headerInfo,t=a.numDims,i=e.headerInfo.height,o=e.headerInfo.width,s=o*i,u=this.readHuffmanTree(n,e),m=u.decodeLut,l=u.tree,f=u.stuffedData,h=u.srcPtr,c=u.bitPos,g=u.numBitsLUTQick,v=u.numBitsLUT,U=e.headerInfo.imageType===0?128:0,M,S,I,k=e.pixels.resultMask,w,d,x,T,y,p,L,B=0;c>0&&(h++,c=0);var E=f[h],O=e.encodeMode===1,F=new r(s*t),N=F,_;for(_=0;_<a.numDims;_++){if(t>1&&(N=new r(F.buffer,s*_,s),B=0),e.headerInfo.numValidPixel===o*i)for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0?I+=B:T>0?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}else for(p=0,T=0;T<i;T++)for(y=0;y<o;y++,p++)if(k[p]){if(S=0,w=E<<c>>>32-g,d=w,32-c<g&&(w|=f[h+1]>>>64-c-g,d=w),m[d])S=m[d][1],c+=m[d][0];else for(w=E<<c>>>32-v,d=w,32-c<v&&(w|=f[h+1]>>>64-c-v,d=w),M=l,L=0;L<v;L++)if(x=w>>>v-L-1&1,M=x?M.right:M.left,!(M.left||M.right)){S=M.val,c=c+L+1;break}c>=32&&(c-=32,h++,E=f[h]),I=S-U,O?(y>0&&k[p-1]?I+=B:T>0&&k[p-o]?I+=N[p-o]:I+=B,I&=255,N[p]=I,B=I):N[p]=I}e.ptr=e.ptr+(h+1)*4+(c>0?4:0)}e.pixels.resultPixels=F},decodeBits:function(n,e,r,a,t){{var i=e.headerInfo,o=i.fileVersion,s=0,u=new DataView(n,e.ptr,5),m=u.getUint8(0);s++;var l=m>>6,f=l===0?4:3-l,h=(m&32)>0,c=m&31,g=0;if(f===1)g=u.getUint8(s),s++;else if(f===2)g=u.getUint16(s,!0),s+=2;else if(f===4)g=u.getUint32(s,!0),s+=4;else throw"Invalid valid pixel count type";var v=2*i.maxZError,U,M,S,I,k,w,d,x,T,y,p=i.numDims>1?i.maxValues[t]:i.zMax;if(h){for(e.counter.lut++,x=u.getUint8(s),T=c,s++,I=Math.ceil((x-1)*c/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),e.ptr+=s,S.set(new Uint8Array(n,e.ptr,I)),d=new Uint32Array(M),e.ptr+=I,y=0;x-1>>>y;)y++;I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?w=A.unstuffLUT2(d,c,x-1,a,v,p):w=A.unstuffLUT(d,c,x-1,a,v,p),o>=3?A.unstuff2(U,r,y,g,w):A.unstuff(U,r,y,g,w)}else e.counter.bitstuffer++,y=c,e.ptr+=s,y>0&&(I=Math.ceil(g*y/8),k=Math.ceil(I/4),M=new ArrayBuffer(k*4),S=new Uint8Array(M),S.set(new Uint8Array(n,e.ptr,I)),U=new Uint32Array(M),e.ptr+=I,o>=3?a==null?A.originalUnstuff2(U,r,y,g):A.unstuff2(U,r,y,g,!1,a,v,p):a==null?A.originalUnstuff(U,r,y,g):A.unstuff(U,r,y,g,!1,a,v,p))}},readTiles:function(n,e,r){var a=e.headerInfo,t=a.width,i=a.height,o=a.microBlockSize,s=a.imageType,u=V.getDataTypeSize(s),m=Math.ceil(t/o),l=Math.ceil(i/o);e.pixels.numBlocksY=l,e.pixels.numBlocksX=m,e.pixels.ptr=0;var f=0,h=0,c=0,g=0,v=0,U=0,M=0,S=0,I=0,k=0,w=0,d=0,x=0,T=0,y=0,p=0,L,B,E,O,F,N,_=new r(o*o),Te=i%o||o,ke=t%o||o,Q,z,le=a.numDims,ie,Z=e.pixels.resultMask,j=e.pixels.resultPixels;for(c=0;c<l;c++)for(v=c!==l-1?o:Te,g=0;g<m;g++)for(U=g!==m-1?o:ke,w=c*t*o+g*o,d=t-U,ie=0;ie<le;ie++){if(le>1&&(j=new r(e.pixels.resultPixels.buffer,t*i*ie*u,t*i)),M=n.byteLength-e.ptr,L=new DataView(n,e.ptr,Math.min(10,M)),B={},p=0,S=L.getUint8(0),p++,I=S>>6&255,k=S>>2&15,k!==(g*o>>3&15))throw"integrity issue";if(N=S&3,N>3)throw e.ptr+=p,"Invalid block encoding ("+N+")";if(N===2){e.counter.constant++,e.ptr+=p;continue}else if(N===0){if(e.counter.uncompressed++,e.ptr+=p,x=v*U*u,T=n.byteLength-e.ptr,x=x<T?x:T,E=new ArrayBuffer(x%u===0?x:x+u-x%u),O=new Uint8Array(E),O.set(new Uint8Array(n,e.ptr,x)),F=new r(E),y=0,Z)for(f=0;f<v;f++){for(h=0;h<U;h++)Z[w]&&(j[w]=F[y++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)j[w++]=F[y++];w+=d}e.ptr+=y*u}else if(Q=V.getDataTypeUsed(s,I),z=V.getOnePixel(B,p,Q,L),p+=V.getDataTypeSize(Q),N===3)if(e.ptr+=p,e.counter.constantoffset++,Z)for(f=0;f<v;f++){for(h=0;h<U;h++)Z[w]&&(j[w]=z),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)j[w++]=z;w+=d}else if(e.ptr+=p,V.decodeBits(n,e,_,z,ie),p=0,Z)for(f=0;f<v;f++){for(h=0;h<U;h++)Z[w]&&(j[w]=_[p++]),w++;w+=d}else for(f=0;f<v;f++){for(h=0;h<U;h++)j[w++]=_[p++];w+=d}}},formatFileInfo:function(n){return{fileIdentifierString:n.headerInfo.fileIdentifierString,fileVersion:n.headerInfo.fileVersion,imageType:n.headerInfo.imageType,height:n.headerInfo.height,width:n.headerInfo.width,numValidPixel:n.headerInfo.numValidPixel,microBlockSize:n.headerInfo.microBlockSize,blobSize:n.headerInfo.blobSize,maxZError:n.headerInfo.maxZError,pixelType:V.getPixelType(n.headerInfo.imageType),eofOffset:n.eofOffset,mask:n.mask?{numBytes:n.mask.numBytes}:null,pixels:{numBlocksX:n.pixels.numBlocksX,numBlocksY:n.pixels.numBlocksY,maxValue:n.headerInfo.zMax,minValue:n.headerInfo.zMin,noDataValue:n.noDataValue}}},constructConstantSurface:function(n){var e=n.headerInfo.zMax,r=n.headerInfo.numDims,a=n.headerInfo.height*n.headerInfo.width,t=a*r,i=0,o=0,s=0,u=n.pixels.resultMask;if(u)if(r>1)for(i=0;i<r;i++)for(s=i*a,o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[s+o]=e);else for(o=0;o<a;o++)u[o]&&(n.pixels.resultPixels[o]=e);else if(n.pixels.resultPixels.fill)n.pixels.resultPixels.fill(e);else for(o=0;o<t;o++)n.pixels.resultPixels[o]=e},getDataTypeArray:function(n){var e;switch(n){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:e=Float32Array;break;case 7:e=Float64Array;break;default:e=Float32Array}return e},getPixelType:function(n){var e;switch(n){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:e="F32";break;case 7:e="F64";break;default:e="F32"}return e},isValidPixelValue:function(n,e){if(e==null)return!1;var r;switch(n){case 0:r=e>=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=5e-324&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(n){var e=0;switch(n){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=n}return e},getDataTypeUsed:function(n,e){var r=n;switch(n){case 2:case 4:r=n-e;break;case 3:case 5:r=n-2*e;break;case 6:e===0?r=n:e===1?r=2:r=1;break;case 7:e===0?r=n:r=n-2*e+1;break;default:r=n;break}return r},getOnePixel:function(n,e,r,a){var t=0;switch(r){case 0:t=a.getInt8(e);break;case 1:t=a.getUint8(e);break;case 2:t=a.getInt16(e,!0);break;case 3:t=a.getUint16(e,!0);break;case 4:t=a.getInt32(e,!0);break;case 5:t=a.getUInt32(e,!0);break;case 6:t=a.getFloat32(e,!0);break;case 7:t=a.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return t}},b=function(n,e,r){this.val=n,this.left=e,this.right=r},Y={decode:function(n,e){e=e||{};var r=e.noDataValue,a=0,t={};if(t.ptr=e.inputOffset||0,t.pixels={},!!V.readHeaderInfo(n,t)){var i=t.headerInfo,o=i.fileVersion,s=V.getDataTypeArray(i.imageType);V.readMask(n,t),i.numValidPixel!==i.width*i.height&&!t.pixels.resultMask&&(t.pixels.resultMask=e.maskData);var u=i.width*i.height;if(t.pixels.resultPixels=new s(u*i.numDims),t.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},i.numValidPixel!==0)if(i.zMax===i.zMin)V.constructConstantSurface(t);else if(o>=4&&V.checkMinMaxRanges(n,t))V.constructConstantSurface(t);else{var m=new DataView(n,t.ptr,2),l=m.getUint8(0);if(t.ptr++,l)V.readDataOneSweep(n,t,s);else if(o>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var f=m.getUint8(1);if(t.ptr++,t.encodeMode=f,f>2||o<4&&f>1)throw"Invalid Huffman flag "+f;f?V.readHuffman(n,t,s):V.readTiles(n,t,s)}else V.readTiles(n,t,s)}t.eofOffset=t.ptr;var h;e.inputOffset?(h=t.headerInfo.blobSize+e.inputOffset-t.ptr,Math.abs(h)>=1&&(t.eofOffset=e.inputOffset+t.headerInfo.blobSize)):(h=t.headerInfo.blobSize-t.ptr,Math.abs(h)>=1&&(t.eofOffset=t.headerInfo.blobSize));var c={width:i.width,height:i.height,pixelData:t.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:t.pixels.resultMask};if(t.pixels.resultMask&&V.isValidPixelValue(i.imageType,r)){var g=t.pixels.resultMask;for(a=0;a<u;a++)g[a]||(c.pixelData[a]=r);c.noDataValue=r}return t.noDataValue=r,e.returnFileInfo&&(c.fileInfo=V.formatFileInfo(t)),c}},getBandCount:function(n){var e=0,r=0,a={};for(a.ptr=0,a.pixels={};r<n.byteLength-58;)V.readHeaderInfo(n,a),r+=a.headerInfo.blobSize,e++,a.ptr=r;return e}};return Y})(),C=(function(){var A=new ArrayBuffer(4),V=new Uint8Array(A),b=new Uint32Array(A);return b[0]=1,V[0]===1})(),ee={decode:function(A,V){if(!C)throw"Big endian system is not supported.";V=V||{};var b=V.inputOffset||0,Y=new Uint8Array(A,b,10),n=String.fromCharCode.apply(null,Y),e,r;if(n.trim()==="CntZImage")e=D,r=1;else if(n.substring(0,5)==="Lerc2")e=ae,r=2;else throw"Unexpected file identifier string: "+n;for(var a=0,t=A.byteLength-10,i,o=[],s,u,m={width:0,height:0,pixels:[],pixelType:V.pixelType,mask:null,statistics:[]};b<t;){var l=e.decode(A,{inputOffset:b,encodedMaskData:i,maskData:u,returnMask:a===0,returnEncodedMask:a===0,returnFileInfo:!0,pixelType:V.pixelType||null,noDataValue:V.noDataValue||null});b=l.fileInfo.eofOffset,a===0&&(i=l.encodedMaskData,u=l.maskData,m.width=l.width,m.height=l.height,m.dimCount=l.dimCount||1,m.pixelType=l.pixelType||l.fileInfo.pixelType,m.mask=l.maskData),r>1&&l.fileInfo.mask&&l.fileInfo.mask.numBytes>0&&o.push(l.maskData),a++,m.pixels.push(l.pixelData),m.statistics.push({minValue:l.minValue,maxValue:l.maxValue,noDataValue:l.noDataValue,dimStats:l.dimStats})}var f,h,c;if(r>1&&o.length>1){for(c=m.width*m.height,m.bandMasks=o,u=new Uint8Array(c),u.set(o[0]),f=1;f<o.length;f++)for(s=o[f],h=0;h<c;h++)u[h]=u[h]&s[h];m.maskData=u}return m}};typeof define=="function"&&define.amd?define([],function(){return ee}):typeof Ue<"u"&&Ue.exports?Ue.exports=ee:this.Lerc=ee})()});var fr={NONE:0,LERC:1};Object.freeze(fr);var or=fr;var G={};G.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var He=new re,Ur=new Ie,Tr=new re,kr=new re;G.computeVertices=function(D){if(!W(D)||!W(D.heightmap))throw new me("options.heightmap is required.");if(!W(D.width)||!W(D.height))throw new me("options.width and options.height are required.");if(!W(D.nativeRectangle))throw new me("options.nativeRectangle is required.");if(!W(D.skirtHeight))throw new me("options.skirtHeight is required.");let ae=Math.cos,C=Math.sin,ee=Math.sqrt,A=Math.atan,V=Math.exp,b=he.PI_OVER_TWO,Y=he.toRadians,n=D.heightmap,e=D.width,r=D.height,a=D.skirtHeight,t=a>0,i=D.isGeographic??!0,o=D.ellipsoid??pe.default,s=1/o.maximumRadius,u=ne.clone(D.nativeRectangle),m=ne.clone(D.rectangle),l,f,h,c;W(m)?(l=m.west,f=m.south,h=m.east,c=m.north):i?(l=Y(u.west),f=Y(u.south),h=Y(u.east),c=Y(u.north)):(l=u.west*s,f=b-2*A(V(-u.south*s)),h=u.east*s,c=b-2*A(V(-u.north*s)));let g=D.relativeToCenter,v=W(g);g=v?g:re.ZERO;let U=D.includeWebMercatorT??!1,M=D.exaggeration??1,S=D.exaggerationRelativeHeight??0,k=M!==1,w=D.structure??G.DEFAULT_STRUCTURE,d=w.heightScale??G.DEFAULT_STRUCTURE.heightScale,x=w.heightOffset??G.DEFAULT_STRUCTURE.heightOffset,T=w.elementsPerHeight??G.DEFAULT_STRUCTURE.elementsPerHeight,y=w.stride??G.DEFAULT_STRUCTURE.stride,p=w.elementMultiplier??G.DEFAULT_STRUCTURE.elementMultiplier,L=w.isBigEndian??G.DEFAULT_STRUCTURE.isBigEndian,B=ne.computeWidth(u),E=ne.computeHeight(u),O=B/(e-1),F=E/(r-1);i||(B*=s,E*=s);let N=o.radiiSquared,_=N.x,Te=N.y,ke=N.z,Q=65536,z=-65536,le=er.eastNorthUpToFixedFrame(g,o),ie=Ie.inverseTransformation(le,Ur),Z,j;U&&(Z=xe.geodeticLatitudeToMercatorAngle(f),j=1/(xe.geodeticLatitudeToMercatorAngle(c)-Z));let se=Tr;se.x=Number.POSITIVE_INFINITY,se.y=Number.POSITIVE_INFINITY,se.z=Number.POSITIVE_INFINITY;let fe=kr;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;let ye=Number.POSITIVE_INFINITY,ue=e*r,mr=a>0?e*2+r*2:0,te=ue+mr,ge=new Array(te),Ye=new Array(te),Xe=new Array(te),_e=U?new Array(te):[],ze=k?new Array(te):[],Me=0,Se=r,Ve=0,De=e;t&&(--Me,++Se,--Ve,++De);let ve=1e-5;for(let H=Me;H<Se;++H){let J=H;J<0&&(J=0),J>=r&&(J=r-1);let q=u.north-F*J;i?q=Y(q):q=b-2*A(V(-q*s));let Ee=(q-f)/(c-f);Ee=he.clamp(Ee,0,1);let de=H===Me,we=H===Se-1;a>0&&(de?q+=ve*E:we&&(q-=ve*E));let Ge=ae(q),Le=C(q),Qe=ke*Le,Je;U&&(Je=(xe.geodeticLatitudeToMercatorAngle(q)-Z)*j);for(let ce=Ve;ce<De;++ce){let K=ce;K<0&&(K=0),K>=e&&(K=e-1);let Be=J*(e*y)+K*y,R;if(T===1)R=n[Be];else{R=0;let X;if(L)for(X=0;X<T;++X)R=R*p+n[Be+X];else for(X=T-1;X>=0;--X)R=R*p+n[Be+X]}R=R*d+x,z=Math.max(z,R),Q=Math.min(Q,R);let $=u.west+O*K;i?$=Y($):$=$*s;let Fe=($-l)/(h-l);Fe=he.clamp(Fe,0,1);let P=J*e+K;if(a>0){let X=ce===Ve,Oe=ce===De-1,pr=de||we||X||Oe;if((de||we)&&(X||Oe))continue;pr&&(R-=a,X?(P=ue+(r-J-1),$-=ve*B):we?P=ue+r+(e-K-1):Oe?(P=ue+r+e+J,$+=ve*B):de&&(P=ue+r+e+r+K))}let be=Ge*ae($),Ne=Ge*C($),Ke=_*be,$e=Te*Ne,Ce=1/ee(Ke*be+$e*Ne+Qe*Le),vr=Ke*Ce,dr=$e*Ce,wr=Qe*Ce,oe=new re;oe.x=vr+be*R,oe.y=dr+Ne*R,oe.z=wr+Le*R,Ie.multiplyByPoint(ie,oe,He),re.minimumByComponent(He,se,se),re.maximumByComponent(He,fe,fe),ye=Math.min(ye,R),ge[P]=oe,Xe[P]=new Pe(Fe,Ee),Ye[P]=R,U&&(_e[P]=Je),k&&(ze[P]=o.geodeticSurfaceNormal(oe))}}let hr=rr.fromPoints(ge),Ze;W(m)&&(Ze=nr.fromRectangle(m,Q,z,o));let je;v&&(je=new ar(o).computeHorizonCullingPointPossiblyUnderEllipsoid(g,ge,Q));let gr=new tr(se,fe,g),Ae=new sr(g,gr,ye,z,le,!1,U,k,M,S),qe=new Float32Array(te*Ae.stride),We=0;for(let H=0;H<te;++H)We=Ae.encode(qe,We,ge[H],Xe[H],Ye[H],void 0,_e[H],ze[H]);return{vertices:qe,maximumHeight:z,minimumHeight:Q,encoding:Ae,boundingSphere3D:hr,orientedBoundingBox:Ze,occludeePointInScaledSpace:je}};var lr=G;var cr=xr(ur(),1);function yr(D,ae){if(D.encoding===or.LERC){let A;try{A=cr.default.decode(D.heightmap)}catch(b){throw new Re(b)}if(A.statistics[0].minValue===Number.MAX_VALUE)throw new Re("Invalid tile data");D.heightmap=A.pixels[0],D.width=A.width,D.height=A.height}D.ellipsoid=pe.clone(D.ellipsoid),D.rectangle=ne.clone(D.rectangle);let C=lr.computeVertices(D),ee=C.vertices;return ae.push(ee.buffer),{vertices:ee.buffer,numberOfAttributes:C.encoding.stride,minimumHeight:C.minimumHeight,maximumHeight:C.maximumHeight,gridWidth:D.width,gridHeight:D.height,boundingSphere3D:C.boundingSphere3D,orientedBoundingBox:C.orientedBoundingBox,occludeePointInScaledSpace:C.occludeePointInScaledSpace,encoding:C.encoding,westIndicesSouthToNorth:C.westIndicesSouthToNorth,southIndicesEastToWest:C.southIndicesEastToWest,eastIndicesNorthToSouth:C.eastIndicesNorthToSouth,northIndicesWestToEast:C.northIndicesWestToEast}}var Kr=ir(yr);export{Kr as default}; diff --git a/plugins/feature/map/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js b/plugins/feature/map/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js index 080567aeb..d0a767f51 100644 --- a/plugins/feature/map/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/plugins/feature/map/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Ct,b as vt}from"./chunk-G65SAF2P.js";import{a as Mt}from"./chunk-U3N6LNE4.js";import{a as z}from"./chunk-L4JCTZ6Y.js";import"./chunk-X6N776GR.js";import{a as Wt}from"./chunk-K6A7NKZT.js";import{a as X}from"./chunk-JQLYZQ6V.js";import"./chunk-ZYYZDBKK.js";import{b as U,g as bt,h as At}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as P,b as wt,c as lt,d as pt}from"./chunk-FGKVHLJ4.js";import{a as f}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as m}from"./chunk-ELJAHN3H.js";import{e as w}from"./chunk-3BGP4HCL.js";function T(){m.throwInstantiationError()}Object.defineProperties(T.prototype,{errorEvent:{get:m.throwInstantiationError},credit:{get:m.throwInstantiationError},tilingScheme:{get:m.throwInstantiationError},hasWaterMask:{get:m.throwInstantiationError},hasVertexNormals:{get:m.throwInstantiationError},availability:{get:m.throwInstantiationError}});var Ot=[];T.getRegularGridIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=Ot[t];w(o)||(Ot[t]=o=[]);let e=o[n];return w(e)||(t*n<f.SIXTY_FOUR_KILOBYTES?e=o[n]=new Uint16Array((t-1)*(n-1)*6):e=o[n]=new Uint32Array((t-1)*(n-1)*6),Pt(t,n,e,0)),e};var Gt=[];T.getRegularGridIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=Gt[t];w(o)||(Gt[t]=o=[]);let e=o[n];if(!w(e)){let r=T.getRegularGridIndices(t,n),s=Lt(t,n),i=s.westIndicesSouthToNorth,c=s.southIndicesEastToWest,h=s.eastIndicesNorthToSouth,E=s.northIndicesWestToEast;e=o[n]={indices:r,westIndicesSouthToNorth:i,southIndicesEastToWest:c,eastIndicesNorthToSouth:h,northIndicesWestToEast:E}}return e};var kt=[];T.getRegularGridAndSkirtIndicesAndEdgeIndices=function(t,n){if(t*n>=f.FOUR_GIGABYTES)throw new m("The total number of vertices (width * height) must be less than 4,294,967,296.");let o=kt[t];w(o)||(kt[t]=o=[]);let e=o[n];if(!w(e)){let r=t*n,s=(t-1)*(n-1)*6,i=t*2+n*2,c=Math.max(0,i-4)*6,h=r+i,E=s+c,g=Lt(t,n),d=g.westIndicesSouthToNorth,p=g.southIndicesEastToWest,b=g.eastIndicesNorthToSouth,L=g.northIndicesWestToEast,N=X.createTypedArray(h,E);Pt(t,n,N,0),T.addSkirtIndices(d,p,b,L,r,N,s),e=o[n]={indices:N,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:L,indexCountWithoutSkirts:s}}return e};T.addSkirtIndices=function(t,n,o,e,r,s,i){let c=r;i=Z(t,c,s,i),c+=t.length,i=Z(n,c,s,i),c+=n.length,i=Z(o,c,s,i),c+=o.length,Z(e,c,s,i)};function Lt(t,n){let o=new Array(n),e=new Array(t),r=new Array(n),s=new Array(t),i;for(i=0;i<t;++i)s[i]=i,e[i]=t*n-1-i;for(i=0;i<n;++i)r[i]=(i+1)*t-1,o[i]=(n-i-1)*t;return{westIndicesSouthToNorth:o,southIndicesEastToWest:e,eastIndicesNorthToSouth:r,northIndicesWestToEast:s}}function Pt(t,n,o,e){let r=0;for(let s=0;s<n-1;++s){for(let i=0;i<t-1;++i){let c=r,h=c+t,E=h+1,g=c+1;o[e++]=c,o[e++]=h,o[e++]=g,o[e++]=g,o[e++]=h,o[e++]=E,++r}++r}}function Z(t,n,o,e){let r=t[0],s=t.length;for(let i=1;i<s;++i){let c=t[i];o[e++]=r,o[e++]=c,o[e++]=n,o[e++]=n,o[e++]=c,o[e++]=n+1,r=c,++n}return e}T.heightmapTerrainQuality=.25;T.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(t,n,o){return t.maximumRadius*2*Math.PI*T.heightmapTerrainQuality/(n*o)};T.prototype.requestTileGeometry=m.throwInstantiationError;T.prototype.getLevelMaximumGeometricError=m.throwInstantiationError;T.prototype.getTileDataAvailable=m.throwInstantiationError;T.prototype.loadTileDataAvailability=m.throwInstantiationError;var Vt=T;var ht=32767,D=new P,Xt=new P,Zt=new P,u=new wt,Y=new lt;function Jt(t,n){let o=t.quantizedVertices,e=o.length/3,r=t.octEncodedNormals,s=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,i=t.includeWebMercatorT,c=t.exaggeration,h=t.exaggerationRelativeHeight,g=c!==1,d=At.clone(t.rectangle),p=d.west,b=d.south,L=d.east,N=d.north,I=pt.clone(t.ellipsoid),y=t.minimumHeight,v=t.maximumHeight,S=t.relativeToCenter,_=bt.eastNorthUpToFixedFrame(S,I),O=U.inverseTransformation(_,new U),G,A;i&&(G=z.geodeticLatitudeToMercatorAngle(b),A=1/(z.geodeticLatitudeToMercatorAngle(N)-G));let j=o.subarray(0,e),q=o.subarray(e,2*e),Q=o.subarray(e*2,3*e),R=w(r),l=new Array(e),M=new Array(e),et=new Array(e),It=i?new Array(e):[],gt=g?new Array(e):[],W=Xt;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;let C=Zt;C.x=Number.NEGATIVE_INFINITY,C.y=Number.NEGATIVE_INFINITY,C.z=Number.NEGATIVE_INFINITY;let ot=Number.POSITIVE_INFINITY,nt=Number.NEGATIVE_INFINITY,it=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY;for(let a=0;a<e;++a){let x=j[a],Kt=q[a],St=x/ht,xt=Kt/ht,yt=f.lerp(y,v,Q[a]/ht);u.longitude=f.lerp(p,L,St),u.latitude=f.lerp(b,N,xt),u.height=yt,ot=Math.min(u.longitude,ot),nt=Math.max(u.longitude,nt),it=Math.min(u.latitude,it),rt=Math.max(u.latitude,rt);let dt=I.cartographicToCartesian(u);l[a]=new lt(St,xt),M[a]=yt,et[a]=dt,i&&(It[a]=(z.geodeticLatitudeToMercatorAngle(u.latitude)-G)*A),g&&(gt[a]=I.geodeticSurfaceNormal(dt)),U.multiplyByPoint(O,dt,D),P.minimumByComponent(D,W,W),P.maximumByComponent(D,C,C)}let st=tt(t.westIndices,function(a,x){return l[a].y-l[x].y}),ct=tt(t.eastIndices,function(a,x){return l[x].y-l[a].y}),at=tt(t.southIndices,function(a,x){return l[x].x-l[a].x}),ut=tt(t.northIndices,function(a,x){return l[a].x-l[x].x}),mt;y<0&&(mt=new Ct(I).computeHorizonCullingPointPossiblyUnderEllipsoid(S,et,y));let k=y;k=Math.min(k,J(t.westIndices,t.westSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.southIndices,t.southSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.eastIndices,t.eastSkirtHeight,M,l,d,I,O,W,C)),k=Math.min(k,J(t.northIndices,t.northSkirtHeight,M,l,d,I,O,W,C));let Ft=new Wt(W,C,S),V=new vt(S,Ft,k,v,_,R,i,g,c,h),F=V.stride,Bt=e*F+s*F,B=new Float32Array(Bt),ft=0;for(let a=0;a<e;++a){if(R){let x=a*2;Y.x=r[x],Y.y=r[x+1]}ft=V.encode(B,ft,et[a],l[a],M[a],Y,It[a],gt[a])}let Ht=Math.max(0,(s-4)*2),_t=t.indices.length+Ht*3,K=X.createTypedArray(e+s,_t);K.set(t.indices,0);let Tt=1e-4,Et=(nt-ot)*Tt,Nt=(rt-it)*Tt,Yt=-Et,Rt=0,Ut=Et,zt=0,Dt=0,jt=Nt,qt=0,Qt=-Nt,H=e*F;return $(B,H,st,V,M,l,r,I,d,t.westSkirtHeight,G,A,Yt,Rt),H+=t.westIndices.length*F,$(B,H,at,V,M,l,r,I,d,t.southSkirtHeight,G,A,qt,Qt),H+=t.southIndices.length*F,$(B,H,ct,V,M,l,r,I,d,t.eastSkirtHeight,G,A,Ut,zt),H+=t.eastIndices.length*F,$(B,H,ut,V,M,l,r,I,d,t.northSkirtHeight,G,A,Dt,jt),Vt.addSkirtIndices(st,at,ct,ut,e,K,t.indices.length),n.push(B.buffer,K.buffer),{vertices:B.buffer,indices:K.buffer,westIndicesSouthToNorth:st,southIndicesEastToWest:at,eastIndicesNorthToSouth:ct,northIndicesWestToEast:ut,vertexStride:F,center:S,minimumHeight:y,maximumHeight:v,occludeePointInScaledSpace:mt,encoding:V,indexCountWithoutSkirts:t.indices.length}}function J(t,n,o,e,r,s,i,c,h){let E=Number.POSITIVE_INFINITY,g=r.north,d=r.south,p=r.east,b=r.west;p<b&&(p+=f.TWO_PI);let L=t.length;for(let N=0;N<L;++N){let I=t[N],y=o[I],v=e[I];u.longitude=f.lerp(b,p,v.x),u.latitude=f.lerp(d,g,v.y),u.height=y-n;let S=s.cartographicToCartesian(u,D);U.multiplyByPoint(i,S,S),P.minimumByComponent(S,c,c),P.maximumByComponent(S,h,h),E=Math.min(E,u.height)}return E}function $(t,n,o,e,r,s,i,c,h,E,g,d,p,b){let L=w(i),N=h.north,I=h.south,y=h.east,v=h.west;y<v&&(y+=f.TWO_PI);let S=o.length;for(let _=0;_<S;++_){let O=o[_],G=r[O],A=s[O];u.longitude=f.lerp(v,y,A.x)+p,u.latitude=f.lerp(I,N,A.y)+b,u.height=G-E;let j=c.cartographicToCartesian(u,D);if(L){let R=O*2;Y.x=i[R],Y.y=i[R+1]}let q;e.hasWebMercatorT&&(q=(z.geodeticLatitudeToMercatorAngle(u.latitude)-g)*d);let Q;e.hasGeodeticSurfaceNormals&&(Q=c.geodeticSurfaceNormal(j)),n=e.encode(t,n,j,A,u.height,Y,q,Q)}}function tt(t,n){let o;return typeof t.slice=="function"&&(o=t.slice(),typeof o.sort!="function"&&(o=void 0)),w(o)||(o=Array.prototype.slice.call(t)),o.sort(n),o}var Se=Mt(Jt);export{Se as default}; +import{a as At}from"./chunk-V23IN42C.js";import{a as Ot,c as pt}from"./chunk-WVRWFNLS.js";import{a as Et}from"./chunk-JJVL7F22.js";import{a as z}from"./chunk-MQTDGHHT.js";import"./chunk-QCE33JV5.js";import{a as bt}from"./chunk-DV5LK4D5.js";import{a as Mt}from"./chunk-AZINMULF.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{i as wt,j as yt}from"./chunk-YZ5ZCI55.js";import{b as Y}from"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as xt,b as rt,c as St}from"./chunk-KP72RGCH.js";import{a as O}from"./chunk-OSVSBQDY.js";import{a as T}from"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{f as D}from"./chunk-H7SJWKIY.js";var ut=32767,G=new O,Gt=new O,Ut=new O,n=new xt,F=new rt;function qt(t,M){let c=t.quantizedVertices,o=c.length/3,u=t.octEncodedNormals,p=t.westIndices.length+t.eastIndices.length+t.southIndices.length+t.northIndices.length,l=t.includeWebMercatorT,E=t.exaggeration,N=t.exaggerationRelativeHeight,A=E!==1,r=yt.clone(t.rectangle),H=r.west,P=r.south,_=r.east,b=r.north,s=St.clone(t.ellipsoid),a=t.minimumHeight,x=t.maximumHeight,h=t.relativeToCenter,B=wt.eastNorthUpToFixedFrame(h,s),S=Y.inverseTransformation(B,new Y),w,f;l&&(w=z.geodeticLatitudeToMercatorAngle(P),f=1/(z.geodeticLatitudeToMercatorAngle(b)-w));let U=c.subarray(0,o),q=c.subarray(o,2*o),R=c.subarray(o*2,3*o),W=D(u),i=new Array(o),g=new Array(o),X=new Array(o),ht=l?new Array(o):[],dt=A?new Array(o):[],I=Gt;I.x=Number.POSITIVE_INFINITY,I.y=Number.POSITIVE_INFINITY,I.z=Number.POSITIVE_INFINITY;let m=Ut;m.x=Number.NEGATIVE_INFINITY,m.y=Number.NEGATIVE_INFINITY,m.z=Number.NEGATIVE_INFINITY;let Z=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,tt=Number.POSITIVE_INFINITY,et=Number.NEGATIVE_INFINITY;for(let e=0;e<o;++e){let d=U[e],zt=q[e],mt=d/ut,Tt=zt/ut,Nt=T.lerp(a,x,R[e]/ut);n.longitude=T.lerp(H,_,mt),n.latitude=T.lerp(P,b,Tt),n.height=Nt,Z=Math.min(n.longitude,Z),$=Math.max(n.longitude,$),tt=Math.min(n.latitude,tt),et=Math.max(n.latitude,et);let st=s.cartographicToCartesian(n);i[e]=new rt(mt,Tt),g[e]=Nt,X[e]=st,l&&(ht[e]=(z.geodeticLatitudeToMercatorAngle(n.latitude)-w)*f),A&&(dt[e]=s.geodeticSurfaceNormal(st)),Y.multiplyByPoint(S,st,G),O.minimumByComponent(G,I,I),O.maximumByComponent(G,m,m)}let ot=K(t.westIndices,function(e,d){return i[e].y-i[d].y}),nt=K(t.eastIndices,function(e,d){return i[d].y-i[e].y}),it=K(t.southIndices,function(e,d){return i[d].x-i[e].x}),ct=K(t.northIndices,function(e,d){return i[e].x-i[d].x}),at;a<0&&(at=new Ot(s).computeHorizonCullingPointPossiblyUnderEllipsoid(h,X,a));let y=a;y=Math.min(y,Q(t.westIndices,t.westSkirtHeight,g,i,r,s,S,I,m)),y=Math.min(y,Q(t.southIndices,t.southSkirtHeight,g,i,r,s,S,I,m)),y=Math.min(y,Q(t.eastIndices,t.eastSkirtHeight,g,i,r,s,S,I,m)),y=Math.min(y,Q(t.northIndices,t.northSkirtHeight,g,i,r,s,S,I,m));let Ht=new bt(I,m,h),V=new pt(h,Ht,y,x,B,W,l,A,E,N),C=V.stride,Pt=o*C+p*C,L=new Float32Array(Pt),lt=0;for(let e=0;e<o;++e){if(W){let d=e*2;F.x=u[d],F.y=u[d+1]}lt=V.encode(L,lt,X[e],i[e],g[e],F,ht[e],dt[e])}let Vt=Math.max(0,(p-4)*2),Ct=t.indices.length+Vt*3,j=Mt.createTypedArray(o+p,Ct);j.set(t.indices,0);let ft=1e-4,gt=($-Z)*ft,It=(et-tt)*ft,Lt=-gt,kt=0,vt=gt,Bt=0,Ft=0,_t=It,Wt=0,Yt=-It,k=o*C;return J(L,k,ot,V,g,i,u,s,r,t.westSkirtHeight,w,f,Lt,kt),k+=t.westIndices.length*C,J(L,k,it,V,g,i,u,s,r,t.southSkirtHeight,w,f,Wt,Yt),k+=t.southIndices.length*C,J(L,k,nt,V,g,i,u,s,r,t.eastSkirtHeight,w,f,vt,Bt),k+=t.eastIndices.length*C,J(L,k,ct,V,g,i,u,s,r,t.northSkirtHeight,w,f,Ft,_t),At.addSkirtIndices(ot,it,nt,ct,o,j,t.indices.length),M.push(L.buffer,j.buffer),{vertices:L.buffer,indices:j.buffer,westIndicesSouthToNorth:ot,southIndicesEastToWest:it,eastIndicesNorthToSouth:nt,northIndicesWestToEast:ct,vertexStride:C,center:h,minimumHeight:a,maximumHeight:x,occludeePointInScaledSpace:at,encoding:V,indexCountWithoutSkirts:t.indices.length}}function Q(t,M,c,o,u,p,l,E,N){let v=Number.POSITIVE_INFINITY,A=u.north,r=u.south,H=u.east,P=u.west;H<P&&(H+=T.TWO_PI);let _=t.length;for(let b=0;b<_;++b){let s=t[b],a=c[s],x=o[s];n.longitude=T.lerp(P,H,x.x),n.latitude=T.lerp(r,A,x.y),n.height=a-M;let h=p.cartographicToCartesian(n,G);Y.multiplyByPoint(l,h,h),O.minimumByComponent(h,E,E),O.maximumByComponent(h,N,N),v=Math.min(v,n.height)}return v}function J(t,M,c,o,u,p,l,E,N,v,A,r,H,P){let _=D(l),b=N.north,s=N.south,a=N.east,x=N.west;a<x&&(a+=T.TWO_PI);let h=c.length;for(let B=0;B<h;++B){let S=c[B],w=u[S],f=p[S];n.longitude=T.lerp(x,a,f.x)+H,n.latitude=T.lerp(s,b,f.y)+P,n.height=w-v;let U=E.cartographicToCartesian(n,G);if(_){let W=S*2;F.x=l[W],F.y=l[W+1]}let q;o.hasWebMercatorT&&(q=(z.geodeticLatitudeToMercatorAngle(n.latitude)-A)*r);let R;o.hasGeodeticSurfaceNormals&&(R=E.geodeticSurfaceNormal(U)),M=o.encode(t,M,U,f,n.height,F,q,R)}}function K(t,M){let c;return typeof t.slice=="function"&&(c=t.slice(),typeof c.sort!="function"&&(c=void 0)),D(c)||(c=Array.prototype.slice.call(t)),c.sort(M),c}var re=Et(qt);export{re as default}; diff --git a/plugins/feature/map/Cesium/Workers/createWallGeometry.js b/plugins/feature/map/Cesium/Workers/createWallGeometry.js index add06fee8..8be1fda0c 100644 --- a/plugins/feature/map/Cesium/Workers/createWallGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createWallGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as nt}from"./chunk-UVR3GLLW.js";import"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import{a as w}from"./chunk-S3L7VZFL.js";import"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as ot}from"./chunk-JQLYZQ6V.js";import{a as it}from"./chunk-J3L5WX3X.js";import{b as tt,c as et,d as R}from"./chunk-AVPLM4UI.js";import{d as I}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as N}from"./chunk-WER4LUMF.js";import{a as s,d as l,f as K}from"./chunk-FGKVHLJ4.js";import{a as V}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as y}from"./chunk-ELJAHN3H.js";import{e as r}from"./chunk-3BGP4HCL.js";var Q=new s,J=new s,lt=new s,st=new s,pt=new s,ut=new s,ft=new s;function E(t){t=t??K.EMPTY_OBJECT;let e=t.positions,o=t.maximumHeights,n=t.minimumHeights;if(!r(e))throw new y("options.positions is required.");if(r(o)&&o.length!==e.length)throw new y("options.positions and options.maximumHeights must have the same length.");if(r(n)&&n.length!==e.length)throw new y("options.positions and options.minimumHeights must have the same length.");let i=t.vertexFormat??w.DEFAULT,c=t.granularity??V.RADIANS_PER_DEGREE,a=t.ellipsoid??l.default;this._positions=e,this._minimumHeights=n,this._maximumHeights=o,this._vertexFormat=w.clone(i),this._granularity=c,this._ellipsoid=l.clone(a),this._workerName="createWallGeometry";let m=1+e.length*s.packedLength+2;r(n)&&(m+=n.length),r(o)&&(m+=o.length),this.packedLength=m+l.packedLength+w.packedLength+1}E.pack=function(t,e,o){if(!r(t))throw new y("value is required");if(!r(e))throw new y("array is required");o=o??0;let n,i=t._positions,c=i.length;for(e[o++]=c,n=0;n<c;++n,o+=s.packedLength)s.pack(i[n],e,o);let a=t._minimumHeights;if(c=r(a)?a.length:0,e[o++]=c,r(a))for(n=0;n<c;++n)e[o++]=a[n];let m=t._maximumHeights;if(c=r(m)?m.length:0,e[o++]=c,r(m))for(n=0;n<c;++n)e[o++]=m[n];return l.pack(t._ellipsoid,e,o),o+=l.packedLength,w.pack(t._vertexFormat,e,o),o+=w.packedLength,e[o]=t._granularity,e};var mt=l.clone(l.UNIT_SPHERE),rt=new w,U={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:mt,vertexFormat:rt,granularity:void 0};E.unpack=function(t,e,o){if(!r(t))throw new y("array is required");e=e??0;let n,i=t[e++],c=new Array(i);for(n=0;n<i;++n,e+=s.packedLength)c[n]=s.unpack(t,e);i=t[e++];let a;if(i>0)for(a=new Array(i),n=0;n<i;++n)a[n]=t[e++];i=t[e++];let m;if(i>0)for(m=new Array(i),n=0;n<i;++n)m[n]=t[e++];let S=l.unpack(t,e,mt);e+=l.packedLength;let _=w.unpack(t,e,rt);e+=w.packedLength;let f=t[e];return r(o)?(o._positions=c,o._minimumHeights=a,o._maximumHeights=m,o._ellipsoid=l.clone(S,o._ellipsoid),o._vertexFormat=w.clone(_,o._vertexFormat),o._granularity=f,o):(U.positions=c,U.minimumHeights=a,U.maximumHeights=m,U.granularity=f,new E(U))};E.fromConstantHeights=function(t){t=t??K.EMPTY_OBJECT;let e=t.positions;if(!r(e))throw new y("options.positions is required.");let o,n,i=t.minimumHeight,c=t.maximumHeight,a=r(i),m=r(c);if(a||m){let _=e.length;o=a?new Array(_):void 0,n=m?new Array(_):void 0;for(let f=0;f<_;++f)a&&(o[f]=i),m&&(n[f]=c)}let S={positions:e,maximumHeights:n,minimumHeights:o,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat};return new E(S)};E.createGeometry=function(t){let e=t._positions,o=t._minimumHeights,n=t._maximumHeights,i=t._vertexFormat,c=t._granularity,a=t._ellipsoid,m=nt.computePositions(a,e,n,o,c,!0);if(!r(m))return;let S=m.bottomPositions,_=m.topPositions,f=m.numCorners,q=_.length,A=q*2,h=i.position?new Float64Array(A):void 0,P=i.normal?new Float32Array(A):void 0,b=i.tangent?new Float32Array(A):void 0,x=i.bitangent?new Float32Array(A):void 0,B=i.st?new Float32Array(A/3*2):void 0,k=0,v=0,T=0,C=0,W=0,g=ft,d=ut,H=pt,Y=!0;q/=3;let p,Z=0,ct=1/(q-f-1);for(p=0;p<q;++p){let L=p*3,u=s.fromArray(_,L,Q),M=s.fromArray(S,L,J);if(i.position&&(h[k++]=M.x,h[k++]=M.y,h[k++]=M.z,h[k++]=u.x,h[k++]=u.y,h[k++]=u.z),i.st&&(B[W++]=Z,B[W++]=0,B[W++]=Z,B[W++]=1),i.normal||i.tangent||i.bitangent){let O=s.clone(s.ZERO,st),j=s.subtract(u,a.geodeticSurfaceNormal(u,J),J);if(p+1<q&&(O=s.fromArray(_,L+3,st)),Y){let G=s.subtract(O,u,lt),at=s.subtract(j,u,Q);g=s.normalize(s.cross(at,G,g),g),Y=!1}s.equalsEpsilon(u,O,V.EPSILON10)?Y=!0:(Z+=ct,i.tangent&&(d=s.normalize(s.subtract(O,u,d),d)),i.bitangent&&(H=s.normalize(s.cross(g,d,H),H))),i.normal&&(P[v++]=g.x,P[v++]=g.y,P[v++]=g.z,P[v++]=g.x,P[v++]=g.y,P[v++]=g.z),i.tangent&&(b[C++]=d.x,b[C++]=d.y,b[C++]=d.z,b[C++]=d.x,b[C++]=d.y,b[C++]=d.z),i.bitangent&&(x[T++]=H.x,x[T++]=H.y,x[T++]=H.z,x[T++]=H.x,x[T++]=H.y,x[T++]=H.z)}}let z=new it;i.position&&(z.position=new R({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:h})),i.normal&&(z.normal=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:P})),i.tangent&&(z.tangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:b})),i.bitangent&&(z.bitangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:x})),i.st&&(z.st=new R({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:B}));let $=A/3;A-=6*(f+1);let F=ot.createTypedArray($,A),D=0;for(p=0;p<$-2;p+=2){let L=p,u=p+2,M=s.fromArray(h,L*3,Q),O=s.fromArray(h,u*3,J);if(s.equalsEpsilon(M,O,V.EPSILON10))continue;let j=p+1,G=p+3;F[D++]=j,F[D++]=L,F[D++]=G,F[D++]=G,F[D++]=L,F[D++]=u}return new et({attributes:z,indices:F,primitiveType:tt.TRIANGLES,boundingSphere:new I.fromVertices(h)})};var X=E;function ht(t,e){return r(e)&&(t=X.unpack(t,e)),t._ellipsoid=l.clone(t._ellipsoid),X.createGeometry(t)}var Ot=ht;export{Ot as default}; +import{a as nt}from"./chunk-MZG3W7S4.js";import"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import{a as w}from"./chunk-FZSSAWMQ.js";import"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as ot}from"./chunk-AZINMULF.js";import{a as it}from"./chunk-ILBQ77ZM.js";import{b as tt,c as et,d as R}from"./chunk-7RNSURKI.js";import{c as I}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as N}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as l}from"./chunk-KP72RGCH.js";import{a as s,c as K}from"./chunk-OSVSBQDY.js";import{a as V}from"./chunk-LZC73BOP.js";import{a as y}from"./chunk-OU2IPMYE.js";import{f as r}from"./chunk-H7SJWKIY.js";var Q=new s,J=new s,lt=new s,st=new s,pt=new s,ut=new s,ft=new s;function E(t){t=t??K.EMPTY_OBJECT;let e=t.positions,o=t.maximumHeights,n=t.minimumHeights;if(!r(e))throw new y("options.positions is required.");if(r(o)&&o.length!==e.length)throw new y("options.positions and options.maximumHeights must have the same length.");if(r(n)&&n.length!==e.length)throw new y("options.positions and options.minimumHeights must have the same length.");let i=t.vertexFormat??w.DEFAULT,c=t.granularity??V.RADIANS_PER_DEGREE,a=t.ellipsoid??l.default;this._positions=e,this._minimumHeights=n,this._maximumHeights=o,this._vertexFormat=w.clone(i),this._granularity=c,this._ellipsoid=l.clone(a),this._workerName="createWallGeometry";let m=1+e.length*s.packedLength+2;r(n)&&(m+=n.length),r(o)&&(m+=o.length),this.packedLength=m+l.packedLength+w.packedLength+1}E.pack=function(t,e,o){if(!r(t))throw new y("value is required");if(!r(e))throw new y("array is required");o=o??0;let n,i=t._positions,c=i.length;for(e[o++]=c,n=0;n<c;++n,o+=s.packedLength)s.pack(i[n],e,o);let a=t._minimumHeights;if(c=r(a)?a.length:0,e[o++]=c,r(a))for(n=0;n<c;++n)e[o++]=a[n];let m=t._maximumHeights;if(c=r(m)?m.length:0,e[o++]=c,r(m))for(n=0;n<c;++n)e[o++]=m[n];return l.pack(t._ellipsoid,e,o),o+=l.packedLength,w.pack(t._vertexFormat,e,o),o+=w.packedLength,e[o]=t._granularity,e};var mt=l.clone(l.UNIT_SPHERE),rt=new w,U={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:mt,vertexFormat:rt,granularity:void 0};E.unpack=function(t,e,o){if(!r(t))throw new y("array is required");e=e??0;let n,i=t[e++],c=new Array(i);for(n=0;n<i;++n,e+=s.packedLength)c[n]=s.unpack(t,e);i=t[e++];let a;if(i>0)for(a=new Array(i),n=0;n<i;++n)a[n]=t[e++];i=t[e++];let m;if(i>0)for(m=new Array(i),n=0;n<i;++n)m[n]=t[e++];let S=l.unpack(t,e,mt);e+=l.packedLength;let _=w.unpack(t,e,rt);e+=w.packedLength;let f=t[e];return r(o)?(o._positions=c,o._minimumHeights=a,o._maximumHeights=m,o._ellipsoid=l.clone(S,o._ellipsoid),o._vertexFormat=w.clone(_,o._vertexFormat),o._granularity=f,o):(U.positions=c,U.minimumHeights=a,U.maximumHeights=m,U.granularity=f,new E(U))};E.fromConstantHeights=function(t){t=t??K.EMPTY_OBJECT;let e=t.positions;if(!r(e))throw new y("options.positions is required.");let o,n,i=t.minimumHeight,c=t.maximumHeight,a=r(i),m=r(c);if(a||m){let _=e.length;o=a?new Array(_):void 0,n=m?new Array(_):void 0;for(let f=0;f<_;++f)a&&(o[f]=i),m&&(n[f]=c)}let S={positions:e,maximumHeights:n,minimumHeights:o,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat};return new E(S)};E.createGeometry=function(t){let e=t._positions,o=t._minimumHeights,n=t._maximumHeights,i=t._vertexFormat,c=t._granularity,a=t._ellipsoid,m=nt.computePositions(a,e,n,o,c,!0);if(!r(m))return;let S=m.bottomPositions,_=m.topPositions,f=m.numCorners,q=_.length,A=q*2,h=i.position?new Float64Array(A):void 0,P=i.normal?new Float32Array(A):void 0,b=i.tangent?new Float32Array(A):void 0,x=i.bitangent?new Float32Array(A):void 0,B=i.st?new Float32Array(A/3*2):void 0,k=0,v=0,T=0,C=0,W=0,g=ft,d=ut,H=pt,Y=!0;q/=3;let p,Z=0,ct=1/(q-f-1);for(p=0;p<q;++p){let L=p*3,u=s.fromArray(_,L,Q),M=s.fromArray(S,L,J);if(i.position&&(h[k++]=M.x,h[k++]=M.y,h[k++]=M.z,h[k++]=u.x,h[k++]=u.y,h[k++]=u.z),i.st&&(B[W++]=Z,B[W++]=0,B[W++]=Z,B[W++]=1),i.normal||i.tangent||i.bitangent){let O=s.clone(s.ZERO,st),j=s.subtract(u,a.geodeticSurfaceNormal(u,J),J);if(p+1<q&&(O=s.fromArray(_,L+3,st)),Y){let G=s.subtract(O,u,lt),at=s.subtract(j,u,Q);g=s.normalize(s.cross(at,G,g),g),Y=!1}s.equalsEpsilon(u,O,V.EPSILON10)?Y=!0:(Z+=ct,i.tangent&&(d=s.normalize(s.subtract(O,u,d),d)),i.bitangent&&(H=s.normalize(s.cross(g,d,H),H))),i.normal&&(P[v++]=g.x,P[v++]=g.y,P[v++]=g.z,P[v++]=g.x,P[v++]=g.y,P[v++]=g.z),i.tangent&&(b[C++]=d.x,b[C++]=d.y,b[C++]=d.z,b[C++]=d.x,b[C++]=d.y,b[C++]=d.z),i.bitangent&&(x[T++]=H.x,x[T++]=H.y,x[T++]=H.z,x[T++]=H.x,x[T++]=H.y,x[T++]=H.z)}}let z=new it;i.position&&(z.position=new R({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:h})),i.normal&&(z.normal=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:P})),i.tangent&&(z.tangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:b})),i.bitangent&&(z.bitangent=new R({componentDatatype:N.FLOAT,componentsPerAttribute:3,values:x})),i.st&&(z.st=new R({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:B}));let $=A/3;A-=6*(f+1);let F=ot.createTypedArray($,A),D=0;for(p=0;p<$-2;p+=2){let L=p,u=p+2,M=s.fromArray(h,L*3,Q),O=s.fromArray(h,u*3,J);if(s.equalsEpsilon(M,O,V.EPSILON10))continue;let j=p+1,G=p+3;F[D++]=j,F[D++]=L,F[D++]=G,F[D++]=G,F[D++]=L,F[D++]=u}return new et({attributes:z,indices:F,primitiveType:tt.TRIANGLES,boundingSphere:I.fromVertices(h)})};var X=E;function ht(t,e){return r(e)&&(t=X.unpack(t,e)),t._ellipsoid=l.clone(t._ellipsoid),X.createGeometry(t)}var Ot=ht;export{Ot as default}; diff --git a/plugins/feature/map/Cesium/Workers/createWallOutlineGeometry.js b/plugins/feature/map/Cesium/Workers/createWallOutlineGeometry.js index e8b8a9749..3cacd0e62 100644 --- a/plugins/feature/map/Cesium/Workers/createWallOutlineGeometry.js +++ b/plugins/feature/map/Cesium/Workers/createWallOutlineGeometry.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as z}from"./chunk-UVR3GLLW.js";import"./chunk-ALKSRI7Y.js";import"./chunk-OM62BMPV.js";import"./chunk-PNMU44JZ.js";import"./chunk-IAW6QHRG.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as W}from"./chunk-JQLYZQ6V.js";import{a as N}from"./chunk-J3L5WX3X.js";import{b as R,c as S,d as M}from"./chunk-AVPLM4UI.js";import{d as D}from"./chunk-ZYYZDBKK.js";import"./chunk-3PT5NNSP.js";import{a as q}from"./chunk-WER4LUMF.js";import{a as p,d as l,f as O}from"./chunk-FGKVHLJ4.js";import{a as b}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as H}from"./chunk-ELJAHN3H.js";import{e as m}from"./chunk-3BGP4HCL.js";var B=new p,U=new p;function _(i){i=i??O.EMPTY_OBJECT;let t=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))throw new H("options.positions is required.");if(m(e)&&e.length!==t.length)throw new H("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)throw new H("options.positions and options.minimumHeights must have the same length.");let s=i.granularity??b.RADIANS_PER_DEGREE,r=i.ellipsoid??l.default;this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";let n=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}_.pack=function(i,t,e){if(!m(i))throw new H("value is required");if(!m(t))throw new H("array is required");e=e??0;let o,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);let n=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];let c=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];return l.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};var G=l.clone(l.UNIT_SPHERE),L={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G,granularity:void 0};_.unpack=function(i,t,e){if(!m(i))throw new H("array is required");t=t??0;let o,s=i[t++],r=new Array(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];let n;if(s>0)for(n=new Array(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];let c;if(s>0)for(c=new Array(s),o=0;o<s;++o)c[o]=i[t++];let w=l.unpack(i,t,G);t+=l.packedLength;let u=i[t];return m(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(w,e._ellipsoid),e._granularity=u,e):(L.positions=r,L.minimumHeights=n,L.maximumHeights=c,L.granularity=u,new _(L))};_.fromConstantHeights=function(i){i=i??O.EMPTY_OBJECT;let t=i.positions;if(!m(t))throw new H("options.positions is required.");let e,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){let u=t.length;e=n?new Array(u):void 0,o=c?new Array(u):void 0;for(let g=0;g<u;++g)n&&(e[g]=s),c&&(o[g]=r)}let w={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};return new _(w)};_.createGeometry=function(i){let t=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=z.computePositions(r,t,o,e,s,!1);if(!m(n))return;let c=n.bottomPositions,w=n.topPositions,u=w.length,g=u*2,f=new Float64Array(g),E=0;u/=3;let h;for(h=0;h<u;++h){let y=h*3,A=p.fromArray(w,y,B),k=p.fromArray(c,y,U);f[E++]=k.x,f[E++]=k.y,f[E++]=k.z,f[E++]=A.x,f[E++]=A.y,f[E++]=A.z}let v=new N({position:new M({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),P=g/3;g=2*P-4+P;let a=W.createTypedArray(P,g),d=0;for(h=0;h<P-2;h+=2){let y=h,A=h+2,k=p.fromArray(f,y*3,B),x=p.fromArray(f,A*3,U);if(p.equalsEpsilon(k,x,b.EPSILON10))continue;let T=h+1,F=h+3;a[d++]=T,a[d++]=y,a[d++]=T,a[d++]=F,a[d++]=y,a[d++]=A}return a[d++]=P-2,a[d++]=P-1,new S({attributes:v,indices:a,primitiveType:R.LINES,boundingSphere:new D.fromVertices(f)})};var C=_;function J(i,t){return m(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}var pi=J;export{pi as default}; +import{a as z}from"./chunk-MZG3W7S4.js";import"./chunk-NCJU5VAQ.js";import"./chunk-CB2GA3G5.js";import"./chunk-D3YAYYEG.js";import"./chunk-B5FT3Q23.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as W}from"./chunk-AZINMULF.js";import{a as N}from"./chunk-ILBQ77ZM.js";import{b as R,c as S,d as M}from"./chunk-7RNSURKI.js";import{c as D}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import{a as q}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{c as l}from"./chunk-KP72RGCH.js";import{a as p,c as O}from"./chunk-OSVSBQDY.js";import{a as b}from"./chunk-LZC73BOP.js";import{a as H}from"./chunk-OU2IPMYE.js";import{f as m}from"./chunk-H7SJWKIY.js";var B=new p,U=new p;function _(i){i=i??O.EMPTY_OBJECT;let t=i.positions,e=i.maximumHeights,o=i.minimumHeights;if(!m(t))throw new H("options.positions is required.");if(m(e)&&e.length!==t.length)throw new H("options.positions and options.maximumHeights must have the same length.");if(m(o)&&o.length!==t.length)throw new H("options.positions and options.minimumHeights must have the same length.");let s=i.granularity??b.RADIANS_PER_DEGREE,r=i.ellipsoid??l.default;this._positions=t,this._minimumHeights=o,this._maximumHeights=e,this._granularity=s,this._ellipsoid=l.clone(r),this._workerName="createWallOutlineGeometry";let n=1+t.length*p.packedLength+2;m(o)&&(n+=o.length),m(e)&&(n+=e.length),this.packedLength=n+l.packedLength+1}_.pack=function(i,t,e){if(!m(i))throw new H("value is required");if(!m(t))throw new H("array is required");e=e??0;let o,s=i._positions,r=s.length;for(t[e++]=r,o=0;o<r;++o,e+=p.packedLength)p.pack(s[o],t,e);let n=i._minimumHeights;if(r=m(n)?n.length:0,t[e++]=r,m(n))for(o=0;o<r;++o)t[e++]=n[o];let c=i._maximumHeights;if(r=m(c)?c.length:0,t[e++]=r,m(c))for(o=0;o<r;++o)t[e++]=c[o];return l.pack(i._ellipsoid,t,e),e+=l.packedLength,t[e]=i._granularity,t};var G=l.clone(l.UNIT_SPHERE),L={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:G,granularity:void 0};_.unpack=function(i,t,e){if(!m(i))throw new H("array is required");t=t??0;let o,s=i[t++],r=new Array(s);for(o=0;o<s;++o,t+=p.packedLength)r[o]=p.unpack(i,t);s=i[t++];let n;if(s>0)for(n=new Array(s),o=0;o<s;++o)n[o]=i[t++];s=i[t++];let c;if(s>0)for(c=new Array(s),o=0;o<s;++o)c[o]=i[t++];let w=l.unpack(i,t,G);t+=l.packedLength;let u=i[t];return m(e)?(e._positions=r,e._minimumHeights=n,e._maximumHeights=c,e._ellipsoid=l.clone(w,e._ellipsoid),e._granularity=u,e):(L.positions=r,L.minimumHeights=n,L.maximumHeights=c,L.granularity=u,new _(L))};_.fromConstantHeights=function(i){i=i??O.EMPTY_OBJECT;let t=i.positions;if(!m(t))throw new H("options.positions is required.");let e,o,s=i.minimumHeight,r=i.maximumHeight,n=m(s),c=m(r);if(n||c){let u=t.length;e=n?new Array(u):void 0,o=c?new Array(u):void 0;for(let g=0;g<u;++g)n&&(e[g]=s),c&&(o[g]=r)}let w={positions:t,maximumHeights:o,minimumHeights:e,ellipsoid:i.ellipsoid};return new _(w)};_.createGeometry=function(i){let t=i._positions,e=i._minimumHeights,o=i._maximumHeights,s=i._granularity,r=i._ellipsoid,n=z.computePositions(r,t,o,e,s,!1);if(!m(n))return;let c=n.bottomPositions,w=n.topPositions,u=w.length,g=u*2,f=new Float64Array(g),E=0;u/=3;let h;for(h=0;h<u;++h){let y=h*3,A=p.fromArray(w,y,B),k=p.fromArray(c,y,U);f[E++]=k.x,f[E++]=k.y,f[E++]=k.z,f[E++]=A.x,f[E++]=A.y,f[E++]=A.z}let v=new N({position:new M({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),P=g/3;g=2*P-4+P;let a=W.createTypedArray(P,g),d=0;for(h=0;h<P-2;h+=2){let y=h,A=h+2,k=p.fromArray(f,y*3,B),x=p.fromArray(f,A*3,U);if(p.equalsEpsilon(k,x,b.EPSILON10))continue;let T=h+1,F=h+3;a[d++]=T,a[d++]=y,a[d++]=T,a[d++]=F,a[d++]=y,a[d++]=A}return a[d++]=P-2,a[d]=P-1,new S({attributes:v,indices:a,primitiveType:R.LINES,boundingSphere:D.fromVertices(f)})};var C=_;function J(i,t){return m(t)&&(i=C.unpack(i,t)),i._ellipsoid=l.clone(i._ellipsoid),C.createGeometry(i)}var pi=J;export{pi as default}; diff --git a/plugins/feature/map/Cesium/Workers/decodeDraco.js b/plugins/feature/map/Cesium/Workers/decodeDraco.js index 2b4336eae..68259a81f 100644 --- a/plugins/feature/map/Cesium/Workers/decodeDraco.js +++ b/plugins/feature/map/Cesium/Workers/decodeDraco.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as D}from"./chunk-NXL34BSE.js";import{a as I}from"./chunk-U3N6LNE4.js";import{a as m}from"./chunk-JQLYZQ6V.js";import{a as w}from"./chunk-WER4LUMF.js";import"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import{a as A}from"./chunk-SP23RJSN.js";import"./chunk-ELJAHN3H.js";import{d as P,e as d}from"./chunk-3BGP4HCL.js";var b=P(D(),1),r;function F(t,n){let o=t.num_points(),a=t.num_faces(),i=new r.DracoInt32Array,e=a*3,s=m.createTypedArray(o,e),u=0;for(let f=0;f<a;++f)n.GetFaceFromMesh(t,f,i),s[u+0]=i.GetValue(0),s[u+1]=i.GetValue(1),s[u+2]=i.GetValue(2),u+=3;return r.destroy(i),{typedArray:s,numberOfIndices:e}}function U(t,n,o,a,i){let e,s;a.quantizationBits<=8?(s=new r.DracoUInt8Array,e=new Uint8Array(i),n.GetAttributeUInt8ForAllPoints(t,o,s)):a.quantizationBits<=16?(s=new r.DracoUInt16Array,e=new Uint16Array(i),n.GetAttributeUInt16ForAllPoints(t,o,s)):(s=new r.DracoFloat32Array,e=new Float32Array(i),n.GetAttributeFloatForAllPoints(t,o,s));for(let u=0;u<i;++u)e[u]=s.GetValue(u);return r.destroy(s),e}function k(t,n,o,a){let i,e;switch(o.data_type()){case 1:case 11:e=new r.DracoInt8Array,i=new Int8Array(a),n.GetAttributeInt8ForAllPoints(t,o,e);break;case 2:e=new r.DracoUInt8Array,i=new Uint8Array(a),n.GetAttributeUInt8ForAllPoints(t,o,e);break;case 3:e=new r.DracoInt16Array,i=new Int16Array(a),n.GetAttributeInt16ForAllPoints(t,o,e);break;case 4:e=new r.DracoUInt16Array,i=new Uint16Array(a),n.GetAttributeUInt16ForAllPoints(t,o,e);break;case 5:case 7:e=new r.DracoInt32Array,i=new Int32Array(a),n.GetAttributeInt32ForAllPoints(t,o,e);break;case 6:case 8:e=new r.DracoUInt32Array,i=new Uint32Array(a),n.GetAttributeUInt32ForAllPoints(t,o,e);break;case 9:case 10:e=new r.DracoFloat32Array,i=new Float32Array(a),n.GetAttributeFloatForAllPoints(t,o,e);break}for(let s=0;s<a;++s)i[s]=e.GetValue(s);return r.destroy(e),i}function p(t,n,o){let a=t.num_points(),i=o.num_components(),e,s=new r.AttributeQuantizationTransform;if(s.InitFromAttribute(o)){let c=new Array(i);for(let y=0;y<i;++y)c[y]=s.min_value(y);e={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}r.destroy(s),s=new r.AttributeOctahedronTransform,s.InitFromAttribute(o)&&(e={quantizationBits:s.quantization_bits(),octEncoded:!0}),r.destroy(s);let u=a*i,f;d(e)?f=U(t,n,o,e,u):f=k(t,n,o,u);let l=w.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:i,componentDatatype:l,byteOffset:o.byte_offset(),byteStride:w.getSizeInBytes(l)*i,normalized:o.normalized(),quantization:e}}}function O(t){let n=new r.Decoder;t.dequantizeInShader&&(n.SkipAttributeTransform(r.POSITION),n.SkipAttributeTransform(r.NORMAL));let o=new r.DecoderBuffer;if(o.Init(t.buffer,t.buffer.length),n.GetEncodedGeometryType(o)!==r.POINT_CLOUD)throw new A("Draco geometry type must be POINT_CLOUD.");let i=new r.PointCloud,e=n.DecodeBufferToPointCloud(o,i);if(!e.ok()||i.ptr===0)throw new A(`Error decoding draco point cloud: ${e.error_msg()}`);r.destroy(o);let s={},u=t.properties;for(let f in u)if(u.hasOwnProperty(f)){let l;if(f==="POSITION"||f==="NORMAL"){let c=n.GetAttributeId(i,r[f]);l=n.GetAttribute(i,c)}else{let c=u[f];l=n.GetAttributeByUniqueId(i,c)}s[f]=p(i,n,l)}return r.destroy(i),r.destroy(n),s}function g(t){let n=new r.Decoder;if(t.dequantizeInShader)for(let c=0;c<t.attributesToSkipTransform.length;++c)n.SkipAttributeTransform(r[t.attributesToSkipTransform[c]]);let o=t.bufferView,a=new r.DecoderBuffer;if(a.Init(t.array,o.byteLength),n.GetEncodedGeometryType(a)!==r.TRIANGULAR_MESH)throw new A("Unsupported draco mesh geometry type.");let e=new r.Mesh,s=n.DecodeBufferToMesh(a,e);if(!s.ok()||e.ptr===0)throw new A(`Error decoding draco mesh geometry: ${s.error_msg()}`);r.destroy(a);let u={},f=t.compressedAttributes;for(let c in f)if(f.hasOwnProperty(c)){let y=f[c],T=n.GetAttributeByUniqueId(e,y);u[c]=p(e,n,T)}let l={indexArray:F(e,n),attributeData:u};return r.destroy(e),r.destroy(n),l}async function z(t,n){return d(t.bufferView)?g(t):O(t)}async function G(t,n){let o=t.webAssemblyConfig;return d(o)&&d(o.wasmBinaryFile)?r=await(0,b.default)(o):r=await(0,b.default)(),!0}async function S(t,n){let o=t.webAssemblyConfig;return d(o)?G(t,n):z(t,n)}var h=I(S);export{h as default}; +import{a as D}from"./chunk-RWR4JTSS.js";import{a as I}from"./chunk-JJVL7F22.js";import{a as m}from"./chunk-AZINMULF.js";import{a as w}from"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import{a as A}from"./chunk-23IOGON7.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import{d as P,f as d}from"./chunk-H7SJWKIY.js";var b=P(D(),1),r;function F(t,n){let o=t.num_points(),a=t.num_faces(),i=new r.DracoInt32Array,e=a*3,s=m.createTypedArray(o,e),u=0;for(let f=0;f<a;++f)n.GetFaceFromMesh(t,f,i),s[u+0]=i.GetValue(0),s[u+1]=i.GetValue(1),s[u+2]=i.GetValue(2),u+=3;return r.destroy(i),{typedArray:s,numberOfIndices:e}}function U(t,n,o,a,i){let e,s;a.quantizationBits<=8?(s=new r.DracoUInt8Array,e=new Uint8Array(i),n.GetAttributeUInt8ForAllPoints(t,o,s)):a.quantizationBits<=16?(s=new r.DracoUInt16Array,e=new Uint16Array(i),n.GetAttributeUInt16ForAllPoints(t,o,s)):(s=new r.DracoFloat32Array,e=new Float32Array(i),n.GetAttributeFloatForAllPoints(t,o,s));for(let u=0;u<i;++u)e[u]=s.GetValue(u);return r.destroy(s),e}function k(t,n,o,a){let i,e;switch(o.data_type()){case 1:case 11:e=new r.DracoInt8Array,i=new Int8Array(a),n.GetAttributeInt8ForAllPoints(t,o,e);break;case 2:e=new r.DracoUInt8Array,i=new Uint8Array(a),n.GetAttributeUInt8ForAllPoints(t,o,e);break;case 3:e=new r.DracoInt16Array,i=new Int16Array(a),n.GetAttributeInt16ForAllPoints(t,o,e);break;case 4:e=new r.DracoUInt16Array,i=new Uint16Array(a),n.GetAttributeUInt16ForAllPoints(t,o,e);break;case 5:case 7:e=new r.DracoInt32Array,i=new Int32Array(a),n.GetAttributeInt32ForAllPoints(t,o,e);break;case 6:case 8:e=new r.DracoUInt32Array,i=new Uint32Array(a),n.GetAttributeUInt32ForAllPoints(t,o,e);break;case 9:case 10:e=new r.DracoFloat32Array,i=new Float32Array(a),n.GetAttributeFloatForAllPoints(t,o,e);break}for(let s=0;s<a;++s)i[s]=e.GetValue(s);return r.destroy(e),i}function p(t,n,o){let a=t.num_points(),i=o.num_components(),e,s=new r.AttributeQuantizationTransform;if(s.InitFromAttribute(o)){let c=new Array(i);for(let y=0;y<i;++y)c[y]=s.min_value(y);e={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}r.destroy(s),s=new r.AttributeOctahedronTransform,s.InitFromAttribute(o)&&(e={quantizationBits:s.quantization_bits(),octEncoded:!0}),r.destroy(s);let u=a*i,f;d(e)?f=U(t,n,o,e,u):f=k(t,n,o,u);let l=w.fromTypedArray(f);return{array:f,data:{componentsPerAttribute:i,componentDatatype:l,byteOffset:o.byte_offset(),byteStride:w.getSizeInBytes(l)*i,normalized:o.normalized(),quantization:e}}}function O(t){let n=new r.Decoder;t.dequantizeInShader&&(n.SkipAttributeTransform(r.POSITION),n.SkipAttributeTransform(r.NORMAL));let o=new r.DecoderBuffer;if(o.Init(t.buffer,t.buffer.length),n.GetEncodedGeometryType(o)!==r.POINT_CLOUD)throw new A("Draco geometry type must be POINT_CLOUD.");let i=new r.PointCloud,e=n.DecodeBufferToPointCloud(o,i);if(!e.ok()||i.ptr===0)throw new A(`Error decoding draco point cloud: ${e.error_msg()}`);r.destroy(o);let s={},u=t.properties;for(let f in u)if(u.hasOwnProperty(f)){let l;if(f==="POSITION"||f==="NORMAL"){let c=n.GetAttributeId(i,r[f]);l=n.GetAttribute(i,c)}else{let c=u[f];l=n.GetAttributeByUniqueId(i,c)}s[f]=p(i,n,l)}return r.destroy(i),r.destroy(n),s}function g(t){let n=new r.Decoder;if(t.dequantizeInShader)for(let c=0;c<t.attributesToSkipTransform.length;++c)n.SkipAttributeTransform(r[t.attributesToSkipTransform[c]]);let o=t.bufferView,a=new r.DecoderBuffer;if(a.Init(t.array,o.byteLength),n.GetEncodedGeometryType(a)!==r.TRIANGULAR_MESH)throw new A("Unsupported draco mesh geometry type.");let e=new r.Mesh,s=n.DecodeBufferToMesh(a,e);if(!s.ok()||e.ptr===0)throw new A(`Error decoding draco mesh geometry: ${s.error_msg()}`);r.destroy(a);let u={},f=t.compressedAttributes;for(let c in f)if(f.hasOwnProperty(c)){let y=f[c],T=n.GetAttributeByUniqueId(e,y);u[c]=p(e,n,T)}let l={indexArray:F(e,n),attributeData:u};return r.destroy(e),r.destroy(n),l}async function z(t,n){return d(t.bufferView)?g(t):O(t)}async function G(t,n){let o=t.webAssemblyConfig;return d(o)&&d(o.wasmBinaryFile)?r=await(0,b.default)(o):r=await(0,b.default)(),!0}async function S(t,n){let o=t.webAssemblyConfig;return d(o)?G(t,n):z(t,n)}var h=I(S);export{h as default}; diff --git a/plugins/feature/map/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js b/plugins/feature/map/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js index 00deea8d5..bd8cd25d1 100644 --- a/plugins/feature/map/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js +++ b/plugins/feature/map/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as Se}from"./chunk-U3N6LNE4.js";import{a as D}from"./chunk-SP23RJSN.js";import{b as ae}from"./chunk-ELJAHN3H.js";import{c as R,d as Ot,e as me}from"./chunk-3BGP4HCL.js";var Ie=R((Li,Ae)=>{"use strict";var zt=(t,i,e,r)=>{let s=t&65535|0,n=t>>>16&65535|0,c=0;for(;e!==0;){c=e>2e3?2e3:e,e-=c;do s=s+i[r++]|0,n=n+s|0;while(--c);s%=65521,n%=65521}return s|n<<16|0};Ae.exports=zt});var De=R((Pi,Re)=>{"use strict";var Ht=()=>{let t,i=[];for(var e=0;e<256;e++){t=e;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;i[e]=t}return i},Ft=new Uint32Array(Ht()),Vt=(t,i,e,r)=>{let s=Ft,n=r+e;t^=-1;for(let c=r;c<n;c++)t=t>>>8^s[(t^i[c])&255];return t^-1};Re.exports=Vt});var Oe=R((zi,Ue)=>{"use strict";Ue.exports=function(i,e){let r,s,n,c,f,_,a,o,v,w,l,u,I,p,x,T,g,d,E,A,h,S,k,b,m=i.state;r=i.next_in,k=i.input,s=r+(i.avail_in-5),n=i.next_out,b=i.output,c=n-(e-i.avail_out),f=n+(i.avail_out-257),_=m.dmax,a=m.wsize,o=m.whave,v=m.wnext,w=m.window,l=m.hold,u=m.bits,I=m.lencode,p=m.distcode,x=(1<<m.lenbits)-1,T=(1<<m.distbits)-1;e:do{u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=I[l&x];t:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d===0)b[n++]=g&65535;else if(d&16){E=g&65535,d&=15,d&&(u<d&&(l+=k[r++]<<u,u+=8),E+=l&(1<<d)-1,l>>>=d,u-=d),u<15&&(l+=k[r++]<<u,u+=8,l+=k[r++]<<u,u+=8),g=p[l&T];i:for(;;){if(d=g>>>24,l>>>=d,u-=d,d=g>>>16&255,d&16){if(A=g&65535,d&=15,u<d&&(l+=k[r++]<<u,u+=8,u<d&&(l+=k[r++]<<u,u+=8)),A+=l&(1<<d)-1,A>_){i.msg="invalid distance too far back",m.mode=16209;break e}if(l>>>=d,u-=d,d=n-c,A>d){if(d=A-d,d>o&&m.sane){i.msg="invalid distance too far back",m.mode=16209;break e}if(h=0,S=w,v===0){if(h+=a-d,d<E){E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}}else if(v<d){if(h+=a+v-d,d-=v,d<E){E-=d;do b[n++]=w[h++];while(--d);if(h=0,v<E){d=v,E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}}}else if(h+=v-d,d<E){E-=d;do b[n++]=w[h++];while(--d);h=n-A,S=b}for(;E>2;)b[n++]=S[h++],b[n++]=S[h++],b[n++]=S[h++],E-=3;E&&(b[n++]=S[h++],E>1&&(b[n++]=S[h++]))}else{h=n-A;do b[n++]=b[h++],b[n++]=b[h++],b[n++]=b[h++],E-=3;while(E>2);E&&(b[n++]=b[h++],E>1&&(b[n++]=b[h++]))}}else if(d&64){i.msg="invalid distance code",m.mode=16209;break e}else{g=p[(g&65535)+(l&(1<<d)-1)];continue i}break}}else if(d&64)if(d&32){m.mode=16191;break e}else{i.msg="invalid literal/length code",m.mode=16209;break e}else{g=I[(g&65535)+(l&(1<<d)-1)];continue t}break}}while(r<s&&n<f);E=u>>3,r-=E,u-=E<<3,l&=(1<<u)-1,i.next_in=r,i.next_out=n,i.avail_in=r<s?5+(s-r):5-(r-s),i.avail_out=n<f?257+(f-n):257-(n-f),m.hold=l,m.bits=u}});var Me=R((Hi,Ne)=>{"use strict";var Gt=new Uint16Array([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]),Yt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Xt=new Uint16Array([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,0,0]),qt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Kt=(t,i,e,r,s,n,c,f)=>{let _=f.bits,a=0,o=0,v=0,w=0,l=0,u=0,I=0,p=0,x=0,T=0,g,d,E,A,h,S=null,k,b=new Uint16Array(16),m=new Uint16Array(16),L=null,Ee,W,Q;for(a=0;a<=15;a++)b[a]=0;for(o=0;o<r;o++)b[i[e+o]]++;for(l=_,w=15;w>=1&&b[w]===0;w--);if(l>w&&(l=w),w===0)return s[n++]=1<<24|64<<16|0,s[n++]=1<<24|64<<16|0,f.bits=1,0;for(v=1;v<w&&b[v]===0;v++);for(l<v&&(l=v),p=1,a=1;a<=15;a++)if(p<<=1,p-=b[a],p<0)return-1;if(p>0&&(t===0||w!==1))return-1;for(m[1]=0,a=1;a<15;a++)m[a+1]=m[a]+b[a];for(o=0;o<r;o++)i[e+o]!==0&&(c[m[i[e+o]]++]=o);if(t===0?(S=L=c,k=20):t===1?(S=Gt,L=Yt,k=257):(S=Xt,L=qt,k=0),T=0,o=0,a=v,h=n,u=l,I=0,E=-1,x=1<<l,A=x-1,t===1&&x>852||t===2&&x>592)return 1;for(;;){Ee=a-I,c[o]+1<k?(W=0,Q=c[o]):c[o]>=k?(W=L[c[o]-k],Q=S[c[o]-k]):(W=96,Q=0),g=1<<a-I,d=1<<u,v=d;do d-=g,s[h+(T>>I)+d]=Ee<<24|W<<16|Q|0;while(d!==0);for(g=1<<a-1;T&g;)g>>=1;if(g!==0?(T&=g-1,T+=g):T=0,o++,--b[a]===0){if(a===w)break;a=i[e+c[o]]}if(a>l&&(T&A)!==E){for(I===0&&(I=l),h+=v,u=a-I,p=1<<u;u+I<w&&(p-=b[u+I],!(p<=0));)u++,p<<=1;if(x+=1<<u,t===1&&x>852||t===2&&x>592)return 1;E=T&A,s[E]=l<<24|u<<16|h-n|0}}return T!==0&&(s[h+T]=a-I<<24|64<<16|0),f.bits=l,0};Ne.exports=Kt});var J=R((Fi,Ze)=>{"use strict";Ze.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var bt=R((Vi,O)=>{"use strict";var he=Ie(),M=De(),jt=Oe(),X=Me(),Wt=0,st=1,ft=2,{Z_FINISH:Be,Z_BLOCK:Qt,Z_TREES:$,Z_OK:P,Z_STREAM_END:Jt,Z_NEED_DICT:$t,Z_STREAM_ERROR:U,Z_DATA_ERROR:lt,Z_MEM_ERROR:ue,Z_BUF_ERROR:ei,Z_DEFLATED:Ce}=J(),ne=16180,Le=16181,Pe=16182,ze=16183,He=16184,Fe=16185,Ve=16186,Ge=16187,Ye=16188,Xe=16189,ie=16190,Z=16191,se=16192,qe=16193,fe=16194,Ke=16195,je=16196,We=16197,Qe=16198,ee=16199,te=16200,Je=16201,$e=16202,et=16203,tt=16204,it=16205,le=16206,nt=16207,rt=16208,y=16209,we=16210,ct=16211,ti=852,ii=592,ni=15,ri=ni,at=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function ai(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var z=t=>{if(!t)return 1;let i=t.state;return!i||i.strm!==t||i.mode<ne||i.mode>ct?1:0},dt=t=>{if(z(t))return U;let i=t.state;return t.total_in=t.total_out=i.total=0,t.msg="",i.wrap&&(t.adler=i.wrap&1),i.mode=ne,i.last=0,i.havedict=0,i.flags=-1,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Int32Array(ti),i.distcode=i.distdyn=new Int32Array(ii),i.sane=1,i.back=-1,P},ht=t=>{if(z(t))return U;let i=t.state;return i.wsize=0,i.whave=0,i.wnext=0,dt(t)},ut=(t,i)=>{let e;if(z(t))return U;let r=t.state;return i<0?(e=0,i=-i):(e=(i>>4)+5,i<48&&(i&=15)),i&&(i<8||i>15)?U:(r.window!==null&&r.wbits!==i&&(r.window=null),r.wrap=e,r.wbits=i,ht(t))},wt=(t,i)=>{if(!t)return U;let e=new ai;t.state=e,e.strm=t,e.window=null,e.mode=ne;let r=ut(t,i);return r!==P&&(t.state=null),r},oi=t=>wt(t,ri),ot=!0,ce,de,si=t=>{if(ot){ce=new Int32Array(512),de=new Int32Array(32);let i=0;for(;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(X(st,t.lens,0,288,ce,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;X(ft,t.lens,0,32,de,0,t.work,{bits:5}),ot=!1}t.lencode=ce,t.lenbits=9,t.distcode=de,t.distbits=5},xt=(t,i,e,r)=>{let s,n=t.state;return n.window===null&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(i.subarray(e-n.wsize,e),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>r&&(s=r),n.window.set(i.subarray(e-r,e-r+s),n.wnext),r-=s,r?(n.window.set(i.subarray(e-r,e),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0},fi=(t,i)=>{let e,r,s,n,c,f,_,a,o,v,w,l,u,I,p=0,x,T,g,d,E,A,h,S,k=new Uint8Array(4),b,m,L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(z(t)||!t.output||!t.input&&t.avail_in!==0)return U;e=t.state,e.mode===Z&&(e.mode=se),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,v=f,w=_,S=P;e:for(;;)switch(e.mode){case ne:if(e.wrap===0){e.mode=se;break}for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&2&&a===35615){e.wbits===0&&(e.wbits=15),e.check=0,k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0),a=0,o=0,e.mode=Le;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((a&255)<<8)+(a>>8))%31){t.msg="incorrect header check",e.mode=y;break}if((a&15)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(a>>>=4,o-=4,h=(a&15)+8,e.wbits===0&&(e.wbits=h),h>15||h>e.wbits){t.msg="invalid window size",e.mode=y;break}e.dmax=1<<e.wbits,e.flags=0,t.adler=e.check=1,e.mode=a&512?Xe:Z,a=0,o=0;break;case Le:for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.flags=a,(e.flags&255)!==Ce){t.msg="unknown compression method",e.mode=y;break}if(e.flags&57344){t.msg="unknown header flags set",e.mode=y;break}e.head&&(e.head.text=a>>8&1),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=Pe;case Pe:for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.time=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,k[2]=a>>>16&255,k[3]=a>>>24&255,e.check=M(e.check,k,4,0)),a=0,o=0,e.mode=ze;case ze:for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.head&&(e.head.xflags=a&255,e.head.os=a>>8),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0,e.mode=He;case He:if(e.flags&1024){for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.length=a,e.head&&(e.head.extra_len=a),e.flags&512&&e.wrap&4&&(k[0]=a&255,k[1]=a>>>8&255,e.check=M(e.check,k,2,0)),a=0,o=0}else e.head&&(e.head.extra=null);e.mode=Fe;case Fe:if(e.flags&1024&&(l=e.length,l>f&&(l=f),l&&(e.head&&(h=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(r.subarray(n,n+l),h)),e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,e.length-=l),e.length))break e;e.length=0,e.mode=Ve;case Ve:if(e.flags&2048){if(f===0)break e;l=0;do h=r[n+l++],e.head&&h&&e.length<65536&&(e.head.name+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=Ge;case Ge:if(e.flags&4096){if(f===0)break e;l=0;do h=r[n+l++],e.head&&h&&e.length<65536&&(e.head.comment+=String.fromCharCode(h));while(h&&l<f);if(e.flags&512&&e.wrap&4&&(e.check=M(e.check,r,l,n)),f-=l,n+=l,h)break e}else e.head&&(e.head.comment=null);e.mode=Ye;case Ye:if(e.flags&512){for(;o<16;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.check&65535)){t.msg="header crc mismatch",e.mode=y;break}a=0,o=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),t.adler=e.check=0,e.mode=Z;break;case Xe:for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}t.adler=e.check=at(a),a=0,o=0,e.mode=ie;case ie:if(e.havedict===0)return t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,$t;t.adler=e.check=1,e.mode=Z;case Z:if(i===Qt||i===$)break e;case se:if(e.last){a>>>=o&7,o-=o&7,e.mode=le;break}for(;o<3;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}switch(e.last=a&1,a>>>=1,o-=1,a&3){case 0:e.mode=qe;break;case 1:if(si(e),e.mode=ee,i===$){a>>>=2,o-=2;break e}break;case 2:e.mode=je;break;case 3:t.msg="invalid block type",e.mode=y}a>>>=2,o-=2;break;case qe:for(a>>>=o&7,o-=o&7;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if((a&65535)!==(a>>>16^65535)){t.msg="invalid stored block lengths",e.mode=y;break}if(e.length=a&65535,a=0,o=0,e.mode=fe,i===$)break e;case fe:e.mode=Ke;case Ke:if(l=e.length,l){if(l>f&&(l=f),l>_&&(l=_),l===0)break e;s.set(r.subarray(n,n+l),c),f-=l,n+=l,_-=l,c+=l,e.length-=l;break}e.mode=Z;break;case je:for(;o<14;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.nlen=(a&31)+257,a>>>=5,o-=5,e.ndist=(a&31)+1,a>>>=5,o-=5,e.ncode=(a&15)+4,a>>>=4,o-=4,e.nlen>286||e.ndist>30){t.msg="too many length or distance symbols",e.mode=y;break}e.have=0,e.mode=We;case We:for(;e.have<e.ncode;){for(;o<3;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.lens[L[e.have++]]=a&7,a>>>=3,o-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,b={bits:e.lenbits},S=X(Wt,e.lens,0,19,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid code lengths set",e.mode=y;break}e.have=0,e.mode=Qe;case Qe:for(;e.have<e.nlen+e.ndist;){for(;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(g<16)a>>>=x,o-=x,e.lens[e.have++]=g;else{if(g===16){for(m=x+2;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(a>>>=x,o-=x,e.have===0){t.msg="invalid bit length repeat",e.mode=y;break}h=e.lens[e.have-1],l=3+(a&3),a>>>=2,o-=2}else if(g===17){for(m=x+3;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=3+(a&7),a>>>=3,o-=3}else{for(m=x+7;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=x,o-=x,h=0,l=11+(a&127),a>>>=7,o-=7}if(e.have+l>e.nlen+e.ndist){t.msg="invalid bit length repeat",e.mode=y;break}for(;l--;)e.lens[e.have++]=h}}if(e.mode===y)break;if(e.lens[256]===0){t.msg="invalid code -- missing end-of-block",e.mode=y;break}if(e.lenbits=9,b={bits:e.lenbits},S=X(st,e.lens,0,e.nlen,e.lencode,0,e.work,b),e.lenbits=b.bits,S){t.msg="invalid literal/lengths set",e.mode=y;break}if(e.distbits=6,e.distcode=e.distdyn,b={bits:e.distbits},S=X(ft,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,b),e.distbits=b.bits,S){t.msg="invalid distances set",e.mode=y;break}if(e.mode=ee,i===$)break e;case ee:e.mode=te;case te:if(f>=6&&_>=258){t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,jt(t,w),c=t.next_out,s=t.output,_=t.avail_out,n=t.next_in,r=t.input,f=t.avail_in,a=e.hold,o=e.bits,e.mode===Z&&(e.back=-1);break}for(e.back=0;p=e.lencode[a&(1<<e.lenbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(T&&!(T&240)){for(d=x,E=T,A=g;p=e.lencode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,e.length=g,T===0){e.mode=it;break}if(T&32){e.back=-1,e.mode=Z;break}if(T&64){t.msg="invalid literal/length code",e.mode=y;break}e.extra=T&15,e.mode=Je;case Je:if(e.extra){for(m=e.extra;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.length+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=$e;case $e:for(;p=e.distcode[a&(1<<e.distbits)-1],x=p>>>24,T=p>>>16&255,g=p&65535,!(x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(!(T&240)){for(d=x,E=T,A=g;p=e.distcode[A+((a&(1<<d+E)-1)>>d)],x=p>>>24,T=p>>>16&255,g=p&65535,!(d+x<=o);){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}a>>>=d,o-=d,e.back+=d}if(a>>>=x,o-=x,e.back+=x,T&64){t.msg="invalid distance code",e.mode=y;break}e.offset=g,e.extra=T&15,e.mode=et;case et:if(e.extra){for(m=e.extra;o<m;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}e.offset+=a&(1<<e.extra)-1,a>>>=e.extra,o-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back",e.mode=y;break}e.mode=tt;case tt:if(_===0)break e;if(l=w-_,e.offset>l){if(l=e.offset-l,l>e.whave&&e.sane){t.msg="invalid distance too far back",e.mode=y;break}l>e.wnext?(l-=e.wnext,u=e.wsize-l):u=e.wnext-l,l>e.length&&(l=e.length),I=e.window}else I=s,u=c-e.offset,l=e.length;l>_&&(l=_),_-=l,e.length-=l;do s[c++]=I[u++];while(--l);e.length===0&&(e.mode=te);break;case it:if(_===0)break e;s[c++]=e.length,_--,e.mode=te;break;case le:if(e.wrap){for(;o<32;){if(f===0)break e;f--,a|=r[n++]<<o,o+=8}if(w-=_,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,c-w):he(e.check,s,w,c-w)),w=_,e.wrap&4&&(e.flags?a:at(a))!==e.check){t.msg="incorrect data check",e.mode=y;break}a=0,o=0}e.mode=nt;case nt:if(e.wrap&&e.flags){for(;o<32;){if(f===0)break e;f--,a+=r[n++]<<o,o+=8}if(e.wrap&4&&a!==(e.total&4294967295)){t.msg="incorrect length check",e.mode=y;break}a=0,o=0}e.mode=rt;case rt:S=Jt;break e;case y:S=lt;break e;case we:return ue;case ct:default:return U}return t.next_out=c,t.avail_out=_,t.next_in=n,t.avail_in=f,e.hold=a,e.bits=o,(e.wsize||w!==t.avail_out&&e.mode<y&&(e.mode<le||i!==Be))&&xt(t,t.output,t.next_out,w-t.avail_out)?(e.mode=we,ue):(v-=t.avail_in,w-=t.avail_out,t.total_in+=v,t.total_out+=w,e.total+=w,e.wrap&4&&w&&(t.adler=e.check=e.flags?M(e.check,s,w,t.next_out-w):he(e.check,s,w,t.next_out-w)),t.data_type=e.bits+(e.last?64:0)+(e.mode===Z?128:0)+(e.mode===ee||e.mode===fe?256:0),(v===0&&w===0||i===Be)&&S===P&&(S=ei),S)},li=t=>{if(z(t))return U;let i=t.state;return i.window&&(i.window=null),t.state=null,P},ci=(t,i)=>{if(z(t))return U;let e=t.state;return e.wrap&2?(e.head=i,i.done=!1,P):U},di=(t,i)=>{let e=i.length,r,s,n;return z(t)||(r=t.state,r.wrap!==0&&r.mode!==ie)?U:r.mode===ie&&(s=1,s=he(s,i,e,0),s!==r.check)?lt:(n=xt(t,i,e,e),n?(r.mode=we,ue):(r.havedict=1,P))};O.exports.inflateReset=ht;O.exports.inflateReset2=ut;O.exports.inflateResetKeep=dt;O.exports.inflateInit=oi;O.exports.inflateInit2=wt;O.exports.inflate=fi;O.exports.inflateEnd=li;O.exports.inflateGetHeader=ci;O.exports.inflateSetDictionary=di;O.exports.inflateInfo="pako inflate (from Nodeca project)"});var _t=R((Gi,xe)=>{"use strict";var hi=(t,i)=>Object.prototype.hasOwnProperty.call(t,i);xe.exports.assign=function(t){let i=Array.prototype.slice.call(arguments,1);for(;i.length;){let e=i.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let r in e)hi(e,r)&&(t[r]=e[r])}}return t};xe.exports.flattenChunks=t=>{let i=0;for(let r=0,s=t.length;r<s;r++)i+=t[r].length;let e=new Uint8Array(i);for(let r=0,s=0,n=t.length;r<n;r++){let c=t[r];e.set(c,s),s+=c.length}return e}});var kt=R((Yi,re)=>{"use strict";var gt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{gt=!1}var q=new Uint8Array(256);for(let t=0;t<256;t++)q[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;q[254]=q[254]=1;re.exports.string2buf=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let i,e,r,s,n,c=t.length,f=0;for(s=0;s<c;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),f+=e<128?1:e<2048?2:e<65536?3:4;for(i=new Uint8Array(f),n=0,s=0;n<f;s++)e=t.charCodeAt(s),(e&64512)===55296&&s+1<c&&(r=t.charCodeAt(s+1),(r&64512)===56320&&(e=65536+(e-55296<<10)+(r-56320),s++)),e<128?i[n++]=e:e<2048?(i[n++]=192|e>>>6,i[n++]=128|e&63):e<65536?(i[n++]=224|e>>>12,i[n++]=128|e>>>6&63,i[n++]=128|e&63):(i[n++]=240|e>>>18,i[n++]=128|e>>>12&63,i[n++]=128|e>>>6&63,i[n++]=128|e&63);return i};var ui=(t,i)=>{if(i<65534&&t.subarray&>)return String.fromCharCode.apply(null,t.length===i?t:t.subarray(0,i));let e="";for(let r=0;r<i;r++)e+=String.fromCharCode(t[r]);return e};re.exports.buf2string=(t,i)=>{let e=i||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,i));let r,s,n=new Array(e*2);for(s=0,r=0;r<e;){let c=t[r++];if(c<128){n[s++]=c;continue}let f=q[c];if(f>4){n[s++]=65533,r+=f-1;continue}for(c&=f===2?31:f===3?15:7;f>1&&r<e;)c=c<<6|t[r++]&63,f--;if(f>1){n[s++]=65533;continue}c<65536?n[s++]=c:(c-=65536,n[s++]=55296|c>>10&1023,n[s++]=56320|c&1023)}return ui(n,s)};re.exports.utf8border=(t,i)=>{i=i||t.length,i>t.length&&(i=t.length);let e=i-1;for(;e>=0&&(t[e]&192)===128;)e--;return e<0||e===0?i:e+q[t[e]]>i?e:i}});var Et=R((Xi,pt)=>{"use strict";pt.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var St=R((qi,mt)=>{"use strict";function wi(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}mt.exports=wi});var vt=R((Ki,Tt)=>{"use strict";function xi(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Tt.exports=xi});var Rt=R((ji,V)=>{"use strict";var B=bt(),At=_t(),ge=kt(),ke=Et(),bi=St(),_i=vt(),It=Object.prototype.toString,{Z_NO_FLUSH:gi,Z_FINISH:ki,Z_OK:K,Z_STREAM_END:be,Z_NEED_DICT:_e,Z_STREAM_ERROR:pi,Z_DATA_ERROR:yt,Z_MEM_ERROR:Ei}=J();function j(t){this.options=At.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(t&&t.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15||(i.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bi,this.strm.avail_out=0;let e=B.inflateInit2(this.strm,i.windowBits);if(e!==K)throw new Error(ke[e]);if(this.header=new _i,B.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=ge.string2buf(i.dictionary):It.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(e=B.inflateSetDictionary(this.strm,i.dictionary),e!==K)))throw new Error(ke[e])}j.prototype.push=function(t,i){let e=this.strm,r=this.options.chunkSize,s=this.options.dictionary,n,c,f;if(this.ended)return!1;for(i===~~i?c=i:c=i===!0?ki:gi,It.call(t)==="[object ArrayBuffer]"?e.input=new Uint8Array(t):e.input=t,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(r),e.next_out=0,e.avail_out=r),n=B.inflate(e,c),n===_e&&s&&(n=B.inflateSetDictionary(e,s),n===K?n=B.inflate(e,c):n===yt&&(n=_e));e.avail_in>0&&n===be&&e.state.wrap>0&&t[e.next_in]!==0;)B.inflateReset(e),n=B.inflate(e,c);switch(n){case pi:case yt:case _e:case Ei:return this.onEnd(n),this.ended=!0,!1}if(f=e.avail_out,e.next_out&&(e.avail_out===0||n===be))if(this.options.to==="string"){let _=ge.utf8border(e.output,e.next_out),a=e.next_out-_,o=ge.buf2string(e.output,_);e.next_out=a,e.avail_out=r-a,a&&e.output.set(e.output.subarray(_,_+a),0),this.onData(o)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(n===K&&f===0)){if(n===be)return n=B.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};j.prototype.onData=function(t){this.chunks.push(t)};j.prototype.onEnd=function(t){t===K&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=At.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pe(t,i){let e=new j(i);if(e.push(t),e.err)throw e.msg||ke[e.err];return e.result}function mi(t,i){return i=i||{},i.raw=!0,pe(t,i)}V.exports.Inflate=j;V.exports.inflate=pe;V.exports.inflateRaw=mi;V.exports.ungzip=pe;V.exports.constants=J()});var Nt=1953029805,Mt=2917034100;function oe(t,i){if(oe.passThroughDataForTesting)return i;ae.typeOf.object("key",t),ae.typeOf.object("data",i);let e=t.byteLength;if(e===0||e%4!==0)throw new D("The length of key must be greater than 0 and a multiple of 4.");let r=new DataView(i),s=r.getUint32(0,!0);if(s===Nt||s===Mt)return i;let n=new DataView(t),c=0,f=i.byteLength,_=f-f%8,a=e,o,v=8;for(;c<_;)for(v=(v+8)%24,o=v;c<_&&o<a;)r.setUint32(c,r.getUint32(c,!0)^n.getUint32(o,!0),!0),r.setUint32(c+4,r.getUint32(c+4,!0)^n.getUint32(o+4,!0),!0),c+=8,o+=24;if(c<f)for(o>=a&&(v=(v+8)%24,o=v);c<f;)r.setUint8(c,r.getUint8(c)^n.getUint8(o)),c++,o++}oe.passThroughDataForTesting=!1;var Te=oe;function Zt(t,i){return(t&i)!==0}var F=Zt;var Bt=[1,2,4,8],ve=15,Ct=16,Lt=64,Pt=128;function N(t,i,e,r,s,n){this._bits=t,this.cnodeVersion=i,this.imageryVersion=e,this.terrainVersion=r,this.imageryProvider=s,this.terrainProvider=n,this.ancestorHasTerrain=!1,this.terrainState=void 0}N.clone=function(t,i){return me(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=new N(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i};N.prototype.setParent=function(t){this.ancestorHasTerrain=t.ancestorHasTerrain||this.hasTerrain()};N.prototype.hasSubtree=function(){return F(this._bits,Ct)};N.prototype.hasImagery=function(){return F(this._bits,Lt)};N.prototype.hasTerrain=function(){return F(this._bits,Pt)};N.prototype.hasChildren=function(){return F(this._bits,ve)};N.prototype.hasChild=function(t){return F(this._bits,Bt[t])};N.prototype.getChildBitmask=function(){return this._bits&ve};var ye=N;var Ut=Ot(Rt(),1);var G=Uint16Array.BYTES_PER_ELEMENT,H=Int32Array.BYTES_PER_ELEMENT,Y=Uint32Array.BYTES_PER_ELEMENT,C={METADATA:0,TERRAIN:1,DBROOT:2};C.fromString=function(t){if(t==="Metadata")return C.METADATA;if(t==="Terrain")return C.TERRAIN;if(t==="DbRoot")return C.DBROOT};function Si(t,i){let e=C.fromString(t.type),r=t.buffer;Te(t.key,r);let s=Di(r);r=s.buffer;let n=s.length;switch(e){case C.METADATA:return vi(r,n,t.quadKey);case C.TERRAIN:return Ii(r,n,i);case C.DBROOT:return i.push(r),{buffer:r}}}var Ti=32301;function vi(t,i,e){let r=new DataView(t),s=0,n=r.getUint32(s,!0);if(s+=Y,n!==Ti)throw new D("Invalid magic");let c=r.getUint32(s,!0);if(s+=Y,c!==1)throw new D("Invalid data type. Must be 1 for QuadTreePacket");let f=r.getUint32(s,!0);if(s+=Y,f!==2)throw new D("Invalid QuadTreePacket version. Only version 2 is supported.");let _=r.getInt32(s,!0);s+=H;let a=r.getInt32(s,!0);if(s+=H,a!==32)throw new D("Invalid instance size.");let o=r.getInt32(s,!0);s+=H;let v=r.getInt32(s,!0);s+=H;let w=r.getInt32(s,!0);if(s+=H,o!==_*a+s)throw new D("Invalid dataBufferOffset");if(o+v+w!==i)throw new D("Invalid packet offsets");let l=[];for(let g=0;g<_;++g){let d=r.getUint8(s);++s,++s;let E=r.getUint16(s,!0);s+=G;let A=r.getUint16(s,!0);s+=G;let h=r.getUint16(s,!0);s+=G,s+=G,s+=G,s+=H,s+=H,s+=8;let S=r.getUint8(s++),k=r.getUint8(s++);s+=G,l.push(new ye(d,E,A,h,S,k))}let u=[],I=0;function p(g,d,E){let A=!1;if(E===4){if(d.hasSubtree())return;A=!0}for(let h=0;h<4;++h){let S=g+h.toString();if(A)u[S]=null;else if(E<4)if(!d.hasChild(h))u[S]=null;else{if(I===_){console.log("Incorrect number of instances");return}let k=l[I++];u[S]=k,p(S,k,E+1)}}}let x=0,T=l[I++];return e===""?++x:u[e]=T,p(e,T,x),u}var yi=5,Ai=4;function Ii(t,i,e){let r=new DataView(t),s=function(f){for(let _=0;_<Ai;++_){let a=r.getUint32(f,!0);if(f+=Y,f+=a,f>i)throw new D("Malformed terrain packet found.")}return f},n=0,c=[];for(;c.length<yi;){let f=n;n=s(n);let _=t.slice(f,n);e.push(_),c.push(_)}return c}var Dt=1953029805,Ri=2917034100;function Di(t){let i=new DataView(t),e=0,r=i.getUint32(e,!0);if(e+=Y,r!==Dt&&r!==Ri)throw new D("Invalid magic");let s=i.getUint32(e,r===Dt);e+=Y;let n=new Uint8Array(t,e),c=Ut.default.inflate(n);if(c.length!==s)throw new D("Size of packet doesn't match header");return c}var en=Se(Si);export{en as default}; +import{a as Ct}from"./chunk-JJVL7F22.js";import{a as O}from"./chunk-23IOGON7.js";import{b as ht}from"./chunk-OU2IPMYE.js";import{f as Rt}from"./chunk-H7SJWKIY.js";var Wr=1953029805,Jr=2917034100;function ct(t,a){if(ct.passThroughDataForTesting)return a;ht.typeOf.object("key",t),ht.typeOf.object("data",a);let r=t.byteLength;if(r===0||r%4!==0)throw new O("The length of key must be greater than 0 and a multiple of 4.");let e=new DataView(a),i=e.getUint32(0,!0);if(i===Wr||i===Jr)return a;let s=new DataView(t),d=0,l=a.byteLength,_=l-l%8,n=r,o,g=8;for(;d<_;)for(g=(g+8)%24,o=g;d<_&&o<n;)e.setUint32(d,e.getUint32(d,!0)^s.getUint32(o,!0),!0),e.setUint32(d+4,e.getUint32(d+4,!0)^s.getUint32(o+4,!0),!0),d+=8,o+=24;if(d<l)for(o>=n&&(g=(g+8)%24,o=g);d<l;)e.setUint8(d,e.getUint8(d)^s.getUint8(o)),d++,o++}ct.passThroughDataForTesting=!1;var Lt=ct;function Kr(t,a){return(t&a)!==0}var F=Kr;var Xr=[1,2,4,8],Nt=15,Zr=16,$r=64,ta=128;function I(t,a,r,e,i,s){this._bits=t,this.cnodeVersion=a,this.imageryVersion=r,this.terrainVersion=e,this.imageryProvider=i,this.terrainProvider=s,this.ancestorHasTerrain=!1,this.terrainState=void 0}I.clone=function(t,a){return Rt(a)?(a._bits=t._bits,a.cnodeVersion=t.cnodeVersion,a.imageryVersion=t.imageryVersion,a.terrainVersion=t.terrainVersion,a.imageryProvider=t.imageryProvider,a.terrainProvider=t.terrainProvider):a=new I(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),a.ancestorHasTerrain=t.ancestorHasTerrain,a.terrainState=t.terrainState,a};I.prototype.setParent=function(t){this.ancestorHasTerrain=t.ancestorHasTerrain||this.hasTerrain()};I.prototype.hasSubtree=function(){return F(this._bits,Zr)};I.prototype.hasImagery=function(){return F(this._bits,$r)};I.prototype.hasTerrain=function(){return F(this._bits,ta)};I.prototype.hasChildren=function(){return F(this._bits,Nt)};I.prototype.hasChild=function(t){return F(this._bits,Xr[t])};I.prototype.getChildBitmask=function(){return this._bits&Nt};var Gt=I;var Ht=0,Ft=1;function q(t){let a=t.length;for(;--a>=0;)t[a]=0}var ra=29,Bt=256,Ot=30,Ar=19,Ur=573,Tr=15,ft=16,Er=256,Sr=16,Br=17,Or=18,aa=new Uint8Array([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]),ia=new Uint8Array([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]);new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);var Pr=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ea=512,Ir=Array(288*2);q(Ir);var Dr=Array(Ot*2);q(Dr);var zt=Array(ea);q(zt);var Pt=Array(256);q(Pt);var Vr=Array(ra);q(Vr);var Mr=Array(Ot);q(Mr);var jr=t=>t<256?zt[t]:zt[256+(t>>>7)],st=(t,a)=>{t.pending_buf[t.pending++]=a&255,t.pending_buf[t.pending++]=a>>>8&255},B=(t,a,r)=>{t.bi_valid>ft-r?(t.bi_buf|=a<<t.bi_valid&65535,st(t,t.bi_buf),t.bi_buf=a>>ft-t.bi_valid,t.bi_valid+=r-ft):(t.bi_buf|=a<<t.bi_valid&65535,t.bi_valid+=r)},j=(t,a,r)=>{B(t,r[a*2],r[a*2+1])},na=(t,a)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--a>0);return r>>>1},sa=(t,a)=>{let r=a.dyn_tree,e=a.max_code,i=a.stat_desc.static_tree,s=a.stat_desc.has_stree,d=a.stat_desc.extra_bits,l=a.stat_desc.extra_base,_=a.stat_desc.max_length,n,o,g,c,h,z,A=0;for(c=0;c<=Tr;c++)t.bl_count[c]=0;for(r[t.heap[t.heap_max]*2+1]=0,n=t.heap_max+1;n<Ur;n++)o=t.heap[n],c=r[r[o*2+1]*2+1]+1,c>_&&(c=_,A++),r[o*2+1]=c,!(o>e)&&(t.bl_count[c]++,h=0,o>=l&&(h=d[o-l]),z=r[o*2],t.opt_len+=z*(c+h),s&&(t.static_len+=z*(i[o*2+1]+h)));if(A!==0){do{for(c=_-1;t.bl_count[c]===0;)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[_]--,A-=2}while(A>0);for(c=_;c!==0;c--)for(o=t.bl_count[c];o!==0;)g=t.heap[--n],!(g>e)&&(r[g*2+1]!==c&&(t.opt_len+=(c-r[g*2+1])*r[g*2],r[g*2+1]=c),o--)}},oa=(t,a,r)=>{let e=Array(16),i=0,s,d;for(s=1;s<=Tr;s++)i=i+r[s-1]<<1,e[s]=i;for(d=0;d<=a;d++){let l=t[d*2+1];l!==0&&(t[d*2]=na(e[l]++,l))}},la=t=>{let a;for(a=0;a<286;a++)t.dyn_ltree[a*2]=0;for(a=0;a<Ot;a++)t.dyn_dtree[a*2]=0;for(a=0;a<Ar;a++)t.bl_tree[a*2]=0;t.dyn_ltree[Er*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Rr=t=>{t.bi_valid>8?st(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Yt=(t,a,r,e)=>{let i=a*2,s=r*2;return t[i]<t[s]||t[i]===t[s]&&e[a]<=e[r]},_t=(t,a,r)=>{let e=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Yt(a,t.heap[i+1],t.heap[i],t.depth)&&i++,!Yt(a,e,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=e},Qt=(t,a,r)=>{let e,i,s=0,d,l;if(t.sym_next!==0)do e=t.pending_buf[t.sym_buf+s++]&255,e+=(t.pending_buf[t.sym_buf+s++]&255)<<8,i=t.pending_buf[t.sym_buf+s++],e===0?j(t,i,a):(d=Pt[i],j(t,d+Bt+1,a),l=aa[d],l!==0&&(i-=Vr[d],B(t,i,l)),e--,d=jr(e),j(t,d,r),l=ia[d],l!==0&&(e-=Mr[d],B(t,e,l)));while(s<t.sym_next);j(t,Er,a)},At=(t,a)=>{let r=a.dyn_tree,e=a.stat_desc.static_tree,i=a.stat_desc.has_stree,s=a.stat_desc.elems,d,l,_=-1,n;for(t.heap_len=0,t.heap_max=Ur,d=0;d<s;d++)r[d*2]===0?r[d*2+1]=0:(t.heap[++t.heap_len]=_=d,t.depth[d]=0);for(;t.heap_len<2;)n=t.heap[++t.heap_len]=_<2?++_:0,r[n*2]=1,t.depth[n]=0,t.opt_len--,i&&(t.static_len-=e[n*2+1]);for(a.max_code=_,d=t.heap_len>>1;d>=1;d--)_t(t,r,d);n=s;do d=t.heap[1],t.heap[1]=t.heap[t.heap_len--],_t(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=d,t.heap[--t.heap_max]=l,r[n*2]=r[d*2]+r[l*2],t.depth[n]=(t.depth[d]>=t.depth[l]?t.depth[d]:t.depth[l])+1,r[d*2+1]=r[l*2+1]=n,t.heap[1]=n++,_t(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],sa(t,a),oa(r,_,t.bl_count)},qt=(t,a,r)=>{let e,i=-1,s,d=a[1],l=0,_=7,n=4;for(d===0&&(_=138,n=3),a[(r+1)*2+1]=65535,e=0;e<=r;e++)s=d,d=a[(e+1)*2+1],!(++l<_&&s===d)&&(l<n?t.bl_tree[s*2]+=l:s===0?l<=10?t.bl_tree[Br*2]++:t.bl_tree[Or*2]++:(s!==i&&t.bl_tree[s*2]++,t.bl_tree[Sr*2]++),l=0,i=s,d===0?(_=138,n=3):s===d?(_=6,n=3):(_=7,n=4))},Wt=(t,a,r)=>{let e,i=-1,s,d=a[1],l=0,_=7,n=4;for(d===0&&(_=138,n=3),e=0;e<=r;e++)if(s=d,d=a[(e+1)*2+1],!(++l<_&&s===d)){if(l<n)do j(t,s,t.bl_tree);while(--l!==0);else s===0?l<=10?(j(t,Br,t.bl_tree),B(t,l-3,3)):(j(t,Or,t.bl_tree),B(t,l-11,7)):(s!==i&&(j(t,s,t.bl_tree),l--),j(t,Sr,t.bl_tree),B(t,l-3,2));l=0,i=s,d===0?(_=138,n=3):s===d?(_=6,n=3):(_=7,n=4)}},da=t=>{let a;for(qt(t,t.dyn_ltree,t.l_desc.max_code),qt(t,t.dyn_dtree,t.d_desc.max_code),At(t,t.bl_desc),a=Ar-1;a>=3&&t.bl_tree[Pr[a]*2+1]===0;a--);return t.opt_len+=3*(a+1)+5+5+4,a},ha=(t,a,r,e)=>{let i;for(B(t,a-257,5),B(t,r-1,5),B(t,e-4,4),i=0;i<e;i++)B(t,t.bl_tree[Pr[i]*2+1],3);Wt(t,t.dyn_ltree,a-1),Wt(t,t.dyn_dtree,r-1)},ca=t=>{let a=4093624447,r;for(r=0;r<=31;r++,a>>>=1)if(a&1&&t.dyn_ltree[r*2]!==0)return Ht;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return Ft;for(r=32;r<Bt;r++)if(t.dyn_ltree[r*2]!==0)return Ft;return Ht},Ut=(t,a,r,e)=>{B(t,0+ +!!e,3),Rr(t),st(t,r),st(t,~r),r&&t.pending_buf.set(t.window.subarray(a,a+r),t.pending),t.pending+=r},fa=(t,a,r,e)=>{let i,s,d=0;t.level>0?(t.strm.data_type===2&&(t.strm.data_type=ca(t)),At(t,t.l_desc),At(t,t.d_desc),d=da(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=r+5,r+4<=i&&a!==-1?Ut(t,a,r,e):t.strategy===4||s===i?(B(t,2+ +!!e,3),Qt(t,Ir,Dr)):(B(t,4+ +!!e,3),ha(t,t.l_desc.max_code+1,t.d_desc.max_code+1,d+1),Qt(t,t.dyn_ltree,t.dyn_dtree)),la(t),e&&Rr(t)},X=(t,a,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=a,t.pending_buf[t.sym_buf+t.sym_next++]=a>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,a===0?t.dyn_ltree[r*2]++:(t.matches++,a--,t.dyn_ltree[(Pt[r]+Bt+1)*2]++,t.dyn_dtree[jr(a)*2]++),t.sym_next===t.sym_end),ot=(t,a,r,e)=>{let i=t&65535|0,s=t>>>16&65535|0,d=0;for(;r!==0;){d=r>2e3?2e3:r,r-=d;do i=i+a[e++]|0,s=s+i|0;while(--d);i%=65521,s%=65521}return i|s<<16|0},_a=new Uint32Array((()=>{let t,a=[];for(var r=0;r<256;r++){t=r;for(var e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;a[r]=t}return a})()),P=(t,a,r,e)=>{let i=_a,s=e+r;t^=-1;for(let d=e;d<s;d++)t=t>>>8^i[(t^a[d])&255];return t^-1},ut={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},E=3,mt=258,V=262,C=1,It=2,Dt=3,Vt=4,ua=t=>{let a,r,e,i=t.w_size;a=t.hash_size,e=a;do r=t.head[--e],t.head[e]=r>=i?r-i:0;while(--a);a=i,e=a;do r=t.prev[--e],t.prev[e]=r>=i?r-i:0;while(--a)},Mt=(t,a,r)=>(a<<t.hash_shift^r)&t.hash_mask,Q=(t,a)=>{let r;if(t.legacy_hash)r=t.ins_h=Mt(t,t.ins_h,t.window[a+E-1]);else{let i=t.window,s=i[a]|i[a+1]<<8|i[a+2]<<16|i[a+3]<<24;r=t.ins_h=Math.imul(s,66521)+66521>>>16&t.hash_mask}let e=t.prev[a&t.w_mask]=t.head[r];return t.head[r]=a,e},Tt=t=>{let a=t.state,r=a.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(a.pending_buf.subarray(a.pending_out,a.pending_out+r),t.next_out),t.next_out+=r,a.pending_out+=r,t.total_out+=r,t.avail_out-=r,a.pending-=r,a.pending===0&&(a.pending_out=0))},G=(t,a)=>{fa(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,a),t.block_start=t.strstart,Tt(t.strm)},Et=(t,a,r,e)=>{let i=t.avail_in;return i>e&&(i=e),i===0?0:(t.avail_in-=i,a.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=ot(t.adler,a,i,r):t.state.wrap===2&&(t.adler=P(t.adler,a,i,r)),t.next_in+=i,t.total_in+=i,i)},Cr=(t,a)=>{let r=t.max_chain_length,e=t.strstart,i,s,d=t.prev_length,l=t.nice_match,_=t.strstart>t.w_size-V?t.strstart-(t.w_size-V):0,n=t.window,o=t.w_mask,g=t.prev,c=t.strstart+mt,h=n[e+d-1],z=n[e+d];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(i=a,!(n[i+d]!==z||n[i+d-1]!==h||n[i]!==n[e]||n[++i]!==n[e+1])){e+=2,i++;do;while(n[++e]===n[++i]&&n[++e]===n[++i]&&n[++e]===n[++i]&&n[++e]===n[++i]&&n[++e]===n[++i]&&n[++e]===n[++i]&&n[++e]===n[++i]&&n[++e]===n[++i]&&e<c);if(s=mt-(c-e),e=c-mt,s>d){if(t.match_start=a,d=s,s>=l)break;h=n[e+d-1],z=n[e+d]}}while((a=g[a&o])>_&&--r!==0);return d<=t.lookahead?d:t.lookahead},Lr=t=>{let a=t.w_size,r,e,i;do{if(e=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-V)&&(t.window.set(t.window.subarray(a,a+a-e),0),t.match_start-=a,t.strstart-=a,t.block_start-=a,t.insert>t.strstart&&(t.insert=t.strstart),ua(t),e+=a),t.strm.avail_in===0)break;if(r=Et(t.strm,t.window,t.strstart+t.lookahead,e),t.lookahead+=r,!t.legacy_hash){if(t.lookahead+t.insert>E)for(i=t.strstart-t.insert;t.insert&&(Q(t,i),i++,t.insert--,!(t.lookahead+t.insert<=E)););}else if(t.lookahead+t.insert>=E)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Mt(t,t.ins_h,t.window[i+1]);t.insert&&(Q(t,i),i++,t.insert--,!(t.lookahead+t.insert<E)););}while(t.lookahead<V&&t.strm.avail_in!==0)},ma=(t,a)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,e,i,s,d=0,l=t.strm.avail_in;do{if(e=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s||(s=t.strm.avail_out-s,i=t.strstart-t.block_start,e>i+t.strm.avail_in&&(e=i+t.strm.avail_in),e>s&&(e=s),e<r&&(e===0&&a!==4||a===0||e!==i+t.strm.avail_in)))break;d=+(a===4&&e===i+t.strm.avail_in),Ut(t,0,0,d),t.pending_buf[t.pending-4]=e,t.pending_buf[t.pending-3]=e>>8,t.pending_buf[t.pending-2]=~e,t.pending_buf[t.pending-1]=~e>>8,Tt(t.strm),i&&(i>e&&(i=e),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,e-=i),e&&(Et(t.strm,t.strm.output,t.strm.next_out,e),t.strm.next_out+=e,t.strm.avail_out-=e,t.strm.total_out+=e)}while(d===0);return l-=t.strm.avail_in,l&&(l>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=l&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-l,t.strm.next_in),t.strstart),t.strstart+=l,t.insert+=l>t.w_size-t.insert?t.w_size-t.insert:l),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),d?Vt:a!==0&&a!==4&&t.strm.avail_in===0&&t.strstart===t.block_start?It:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(Et(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,r=s>t.w_size?t.w_size:s,i=t.strstart-t.block_start,(i>=r||(i||a===4)&&a!==0&&t.strm.avail_in===0&&i<=s)&&(e=i>s?s:i,d=+(a===4&&t.strm.avail_in===0&&e===i),Ut(t,t.block_start,e,d),t.block_start+=e,Tt(t.strm)),d?Dt:C)},wt=(t,a)=>{let r,e;for(;;){if(t.lookahead<V){if(Lr(t),t.lookahead<V&&a===0)return C;if(t.lookahead===0)break}if(r=0,t.lookahead>=E&&(r=Q(t,t.strstart)),r!==0&&t.strstart-r<=t.w_size-V&&(t.match_length=Cr(t,r)),t.match_length>=E)if(e=X(t,t.strstart-t.match_start,t.match_length-E),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=E){t.match_length--;do t.strstart++,r=Q(t,t.strstart);while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.legacy_hash&&(t.ins_h=t.window[t.strstart],t.ins_h=Mt(t,t.ins_h,t.window[t.strstart+1]));else e=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(e&&(G(t,!1),t.strm.avail_out===0))return C}return t.insert=t.strstart<E-1?t.strstart:E-1,a===4?(G(t,!0),t.strm.avail_out===0?Dt:Vt):t.sym_next&&(G(t,!1),t.strm.avail_out===0)?C:It},Y=(t,a)=>{let r,e,i;for(;;){if(t.lookahead<V){if(Lr(t),t.lookahead<V&&a===0)return C;if(t.lookahead===0)break}if(r=0,t.lookahead>=E&&(r=Q(t,t.strstart)),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=E-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-V&&(t.match_length=Cr(t,r),t.match_length<=5&&(t.strategy===1||t.match_length===E&&t.strstart-t.match_start>4096)&&(t.match_length=E-1)),t.prev_length>=E&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-E,e=X(t,t.strstart-1-t.prev_match,t.prev_length-E),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(r=Q(t,t.strstart));while(--t.prev_length!==0);if(t.match_available=0,t.match_length=E-1,t.strstart++,e&&(G(t,!1),t.strm.avail_out===0))return C}else if(t.match_available){if(e=X(t,0,t.window[t.strstart-1]),e&&G(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return C}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(e=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<E-1?t.strstart:E-1,a===4?(G(t,!0),t.strm.avail_out===0?Dt:Vt):t.sym_next&&(G(t,!1),t.strm.avail_out===0)?C:It},D=class{constructor(t,a,r,e,i){this.good_length=t,this.max_lazy=a,this.nice_length=r,this.max_chain=e,this.func=i}};new D(0,0,0,0,ma),new D(4,4,8,4,wt),new D(4,5,16,8,wt),new D(4,6,32,32,wt),new D(4,4,16,16,Y),new D(8,16,32,32,Y),new D(8,16,128,128,Y),new D(8,32,128,256,Y),new D(32,128,258,1024,Y),new D(32,258,258,4096,Y);var at=16209,wa=16191;function ba(t,a){let r,e,i,s,d,l,_,n,o,g,c,h,z,A,y,b,w,f,m,U,v,p,x,u,k=t.state;r=t.next_in,x=t.input,e=r+(t.avail_in-5),i=t.next_out,u=t.output,s=i-(a-t.avail_out),d=i+(t.avail_out-257),l=k.dmax,_=k.wsize,n=k.whave,o=k.wnext,g=k.window,c=k.hold,h=k.bits,z=k.lencode,A=k.distcode,y=(1<<k.lenbits)-1,b=(1<<k.distbits)-1;t:do{h<15&&(c+=x[r++]<<h,h+=8,c+=x[r++]<<h,h+=8),w=z[c&y];r:for(;;){if(f=w>>>24,c>>>=f,h-=f,f=w>>>16&255,f===0)u[i++]=w&65535;else if(f&16){m=w&65535,f&=15,f&&(h<f&&(c+=x[r++]<<h,h+=8),m+=c&(1<<f)-1,c>>>=f,h-=f),h<15&&(c+=x[r++]<<h,h+=8,c+=x[r++]<<h,h+=8),w=A[c&b];a:for(;;){if(f=w>>>24,c>>>=f,h-=f,f=w>>>16&255,f&16){if(U=w&65535,f&=15,h<f&&(c+=x[r++]<<h,h+=8,h<f&&(c+=x[r++]<<h,h+=8)),U+=c&(1<<f)-1,U>l){t.msg="invalid distance too far back",k.mode=at;break t}if(c>>>=f,h-=f,f=i-s,U>f){if(f=U-f,f>n&&k.sane){t.msg="invalid distance too far back",k.mode=at;break t}if(v=0,p=g,o===0){if(v+=_-f,f<m){m-=f;do u[i++]=g[v++];while(--f);v=i-U,p=u}}else if(o<f){if(v+=_+o-f,f-=o,f<m){m-=f;do u[i++]=g[v++];while(--f);if(v=0,o<m){f=o,m-=f;do u[i++]=g[v++];while(--f);v=i-U,p=u}}}else if(v+=o-f,f<m){m-=f;do u[i++]=g[v++];while(--f);v=i-U,p=u}for(;m>2;)u[i++]=p[v++],u[i++]=p[v++],u[i++]=p[v++],m-=3;m&&(u[i++]=p[v++],m>1&&(u[i++]=p[v++]))}else{v=i-U;do u[i++]=u[v++],u[i++]=u[v++],u[i++]=u[v++],m-=3;while(m>2);m&&(u[i++]=u[v++],m>1&&(u[i++]=u[v++]))}}else if(f&64){t.msg="invalid distance code",k.mode=at;break t}else{w=A[(w&65535)+(c&(1<<f)-1)];continue a}break}}else if(f&64)if(f&32){k.mode=wa;break t}else{t.msg="invalid literal/length code",k.mode=at;break t}else{w=z[(w&65535)+(c&(1<<f)-1)];continue r}break}}while(r<e&&i<d);m=h>>3,r-=m,h-=m<<3,c&=(1<<h)-1,t.next_in=r,t.next_out=i,t.avail_in=r<e?5+(e-r):5-(r-e),t.avail_out=i<d?257+(d-i):257-(i-d),k.hold=c,k.bits=h}var it=15,Jt=852,Kt=592,Xt=0,bt=1,Zt=2,pa=new Uint16Array([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]),ga=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),ka=new Uint16Array([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,0,0]),va=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Z=(t,a,r,e,i,s,d,l)=>{let _=l.bits,n=0,o=0,g=0,c=0,h=0,z=0,A=0,y=0,b=0,w=0,f,m,U,v,p,x=null,u,k=new Uint16Array(16),S=new Uint16Array(16),N=null,jt,tt,rt;for(n=0;n<=it;n++)k[n]=0;for(o=0;o<e;o++)k[a[r+o]]++;for(h=_,c=it;c>=1&&k[c]===0;c--);if(h>c&&(h=c),c===0)return i[s++]=20971520,i[s++]=20971520,l.bits=1,0;for(g=1;g<c&&k[g]===0;g++);for(h<g&&(h=g),y=1,n=1;n<=it;n++)if(y<<=1,y-=k[n],y<0)return-1;if(y>0&&(t===Xt||c!==1))return-1;for(S[1]=0,n=1;n<it;n++)S[n+1]=S[n]+k[n];for(o=0;o<e;o++)a[r+o]!==0&&(d[S[a[r+o]]++]=o);if(t===Xt?(x=N=d,u=20):t===bt?(x=pa,N=ga,u=257):(x=ka,N=va,u=0),w=0,o=0,n=g,p=s,z=h,A=0,U=-1,b=1<<h,v=b-1,t===bt&&b>Jt||t===Zt&&b>Kt)return 1;for(;;){jt=n-A,d[o]+1<u?(tt=0,rt=d[o]):d[o]>=u?(tt=N[d[o]-u],rt=x[d[o]-u]):(tt=96,rt=0),f=1<<n-A,m=1<<z,g=m;do m-=f,i[p+(w>>A)+m]=jt<<24|tt<<16|rt|0;while(m!==0);for(f=1<<n-1;w&f;)f>>=1;if(f===0?w=0:(w&=f-1,w+=f),o++,--k[n]===0){if(n===c)break;n=a[r+d[o]]}if(n>h&&(w&v)!==U){for(A===0&&(A=h),p+=g,z=n-A,y=1<<z;z+A<c&&(y-=k[z+A],!(y<=0));)z++,y<<=1;if(b+=1<<z,t===bt&&b>Jt||t===Zt&&b>Kt)return 1;U=w&v,i[U]=h<<24|z<<16|p-s|0}}return w!==0&&(i[p+w]=n-A<<24|4194304),l.bits=h,0},ya=0,Nr=1,Gr=2,dt=16180,$t=16181,tr=16182,rr=16183,ar=16184,ir=16185,er=16186,nr=16187,sr=16188,or=16189,lt=16190,M=16191,pt=16192,lr=16193,gt=16194,dr=16195,hr=16196,cr=16197,fr=16198,et=16199,nt=16200,_r=16201,ur=16202,mr=16203,wr=16204,br=16205,kt=16206,pr=16207,gr=16208,T=16209,St=16210,Hr=16211,xa=852,za=592,kr=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24),Aa=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},W=t=>{if(!t)return 1;let a=t.state;return+(!a||a.strm!==t||a.mode<dt||a.mode>Hr)},Ua=t=>{if(W(t))return-2;let a=t.state;return t.total_in=t.total_out=a.total=0,t.msg="",a.wrap&&(t.adler=a.wrap&1),a.mode=dt,a.last=0,a.havedict=0,a.flags=-1,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new Int32Array(xa),a.distcode=a.distdyn=new Int32Array(za),a.sane=1,a.back=-1,0},Fr=t=>{if(W(t))return-2;let a=t.state;return a.wsize=0,a.whave=0,a.wnext=0,Ua(t)},Ta=(t,a)=>{let r;if(W(t))return-2;let e=t.state;return a<0?(r=0,a=-a):(r=(a>>4)+5,a<48&&(a&=15)),a&&(a<8||a>15)?-2:(e.window!==null&&e.wbits!==a&&(e.window=null),e.wrap=r,e.wbits=a,Fr(t))},Ea=(t,a)=>{if(!t)return-2;let r=new Aa;t.state=r,r.strm=t,r.window=null,r.mode=dt;let e=Ta(t,a);return e!==0&&(t.state=null),e},vr=!0,vt,yt,Sa=t=>{if(vr){vt=new Int32Array(512),yt=new Int32Array(32);let a=0;for(;a<144;)t.lens[a++]=8;for(;a<256;)t.lens[a++]=9;for(;a<280;)t.lens[a++]=7;for(;a<288;)t.lens[a++]=8;for(Z(Nr,t.lens,0,288,vt,0,t.work,{bits:9}),a=0;a<32;)t.lens[a++]=5;Z(Gr,t.lens,0,32,yt,0,t.work,{bits:5}),vr=!1}t.lencode=vt,t.lenbits=9,t.distcode=yt,t.distbits=5},Yr=(t,a,r,e)=>{let i,s=t.state;return s.window===null&&(s.window=new Uint8Array(1<<s.wbits)),s.wsize===0&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0),e>=s.wsize?(s.window.set(a.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>e&&(i=e),s.window.set(a.subarray(r-e,r-e+i),s.wnext),e-=i,e?(s.window.set(a.subarray(r-e,r),0),s.wnext=e,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},xt=(t,a)=>{let r,e,i,s,d,l,_,n,o,g,c,h,z,A,y=0,b,w,f,m,U,v,p,x,u=new Uint8Array(4),k,S,N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(W(t)||!t.output||!t.input&&t.avail_in!==0)return-2;r=t.state,r.mode===M&&(r.mode=pt),d=t.next_out,i=t.output,_=t.avail_out,s=t.next_in,e=t.input,l=t.avail_in,n=r.hold,o=r.bits,g=l,c=_,x=0;t:for(;;)switch(r.mode){case dt:if(r.wrap===0){r.mode=pt;break}for(;o<16;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(r.wrap&2&&n===35615){r.wbits===0&&(r.wbits=15),r.check=0,u[0]=n&255,u[1]=n>>>8&255,r.check=P(r.check,u,2,0),n=0,o=0,r.mode=$t;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((n&255)<<8)+(n>>8))%31){t.msg="incorrect header check",r.mode=T;break}if((n&15)!=8){t.msg="unknown compression method",r.mode=T;break}if(n>>>=4,o-=4,p=(n&15)+8,r.wbits===0&&(r.wbits=p),p>15||p>r.wbits){t.msg="invalid window size",r.mode=T;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=n&512?or:M,n=0,o=0;break;case $t:for(;o<16;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(r.flags=n,(r.flags&255)!=8){t.msg="unknown compression method",r.mode=T;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=T;break}r.head&&(r.head.text=n>>8&1),r.flags&512&&r.wrap&4&&(u[0]=n&255,u[1]=n>>>8&255,r.check=P(r.check,u,2,0)),n=0,o=0,r.mode=tr;case tr:for(;o<32;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}r.head&&(r.head.time=n),r.flags&512&&r.wrap&4&&(u[0]=n&255,u[1]=n>>>8&255,u[2]=n>>>16&255,u[3]=n>>>24&255,r.check=P(r.check,u,4,0)),n=0,o=0,r.mode=rr;case rr:for(;o<16;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}r.head&&(r.head.xflags=n&255,r.head.os=n>>8),r.flags&512&&r.wrap&4&&(u[0]=n&255,u[1]=n>>>8&255,r.check=P(r.check,u,2,0)),n=0,o=0,r.mode=ar;case ar:if(r.flags&1024){for(;o<16;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}r.length=n,r.head&&(r.head.extra_len=n),r.flags&512&&r.wrap&4&&(u[0]=n&255,u[1]=n>>>8&255,r.check=P(r.check,u,2,0)),n=0,o=0}else r.head&&(r.head.extra=null);r.mode=ir;case ir:if(r.flags&1024&&(h=r.length,h>l&&(h=l),h&&(r.head&&(p=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(e.subarray(s,s+h),p)),r.flags&512&&r.wrap&4&&(r.check=P(r.check,e,h,s)),l-=h,s+=h,r.length-=h),r.length))break t;r.length=0,r.mode=er;case er:if(r.flags&2048){if(l===0)break t;h=0;do p=e[s+h++],r.head&&p&&r.length<65536&&(r.head.name+=String.fromCharCode(p));while(p&&h<l);if(r.flags&512&&r.wrap&4&&(r.check=P(r.check,e,h,s)),l-=h,s+=h,p)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=nr;case nr:if(r.flags&4096){if(l===0)break t;h=0;do p=e[s+h++],r.head&&p&&r.length<65536&&(r.head.comment+=String.fromCharCode(p));while(p&&h<l);if(r.flags&512&&r.wrap&4&&(r.check=P(r.check,e,h,s)),l-=h,s+=h,p)break t}else r.head&&(r.head.comment=null);r.mode=sr;case sr:if(r.flags&512){for(;o<16;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(r.wrap&4&&n!==(r.check&65535)){t.msg="header crc mismatch",r.mode=T;break}n=0,o=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=M;break;case or:for(;o<32;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}t.adler=r.check=kr(n),n=0,o=0,r.mode=lt;case lt:if(r.havedict===0)return t.next_out=d,t.avail_out=_,t.next_in=s,t.avail_in=l,r.hold=n,r.bits=o,2;t.adler=r.check=1,r.mode=M;case M:if(a===5||a===6)break t;case pt:if(r.last){n>>>=o&7,o-=o&7,r.mode=kt;break}for(;o<3;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}switch(r.last=n&1,n>>>=1,--o,n&3){case 0:r.mode=lr;break;case 1:if(Sa(r),r.mode=et,a===6){n>>>=2,o-=2;break t}break;case 2:r.mode=hr;break;case 3:t.msg="invalid block type",r.mode=T}n>>>=2,o-=2;break;case lr:for(n>>>=o&7,o-=o&7;o<32;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if((n&65535)!=(n>>>16^65535)){t.msg="invalid stored block lengths",r.mode=T;break}if(r.length=n&65535,n=0,o=0,r.mode=gt,a===6)break t;case gt:r.mode=dr;case dr:if(h=r.length,h){if(h>l&&(h=l),h>_&&(h=_),h===0)break t;i.set(e.subarray(s,s+h),d),l-=h,s+=h,_-=h,d+=h,r.length-=h;break}r.mode=M;break;case hr:for(;o<14;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(r.nlen=(n&31)+257,n>>>=5,o-=5,r.ndist=(n&31)+1,n>>>=5,o-=5,r.ncode=(n&15)+4,n>>>=4,o-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=T;break}r.have=0,r.mode=cr;case cr:for(;r.have<r.ncode;){for(;o<3;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}r.lens[N[r.have++]]=n&7,n>>>=3,o-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,k={bits:r.lenbits},x=Z(ya,r.lens,0,19,r.lencode,0,r.work,k),r.lenbits=k.bits,x){t.msg="invalid code lengths set",r.mode=T;break}r.have=0,r.mode=fr;case fr:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[n&(1<<r.lenbits)-1],b=y>>>24,w=y>>>16&255,f=y&65535,!(b<=o);){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(f<16)n>>>=b,o-=b,r.lens[r.have++]=f;else{if(f===16){for(S=b+2;o<S;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(n>>>=b,o-=b,r.have===0){t.msg="invalid bit length repeat",r.mode=T;break}p=r.lens[r.have-1],h=3+(n&3),n>>>=2,o-=2}else if(f===17){for(S=b+3;o<S;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}n>>>=b,o-=b,p=0,h=3+(n&7),n>>>=3,o-=3}else{for(S=b+7;o<S;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}n>>>=b,o-=b,p=0,h=11+(n&127),n>>>=7,o-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=T;break}for(;h--;)r.lens[r.have++]=p}}if(r.mode===T)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=T;break}if(r.lenbits=9,k={bits:r.lenbits},x=Z(Nr,r.lens,0,r.nlen,r.lencode,0,r.work,k),r.lenbits=k.bits,x){t.msg="invalid literal/lengths set",r.mode=T;break}if(r.distbits=6,r.distcode=r.distdyn,k={bits:r.distbits},x=Z(Gr,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,k),r.distbits=k.bits,x){t.msg="invalid distances set",r.mode=T;break}if(r.mode=et,a===6)break t;case et:r.mode=nt;case nt:if(l>=6&&_>=258){t.next_out=d,t.avail_out=_,t.next_in=s,t.avail_in=l,r.hold=n,r.bits=o,ba(t,c),d=t.next_out,i=t.output,_=t.avail_out,s=t.next_in,e=t.input,l=t.avail_in,n=r.hold,o=r.bits,r.mode===M&&(r.back=-1);break}for(r.back=0;y=r.lencode[n&(1<<r.lenbits)-1],b=y>>>24,w=y>>>16&255,f=y&65535,!(b<=o);){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(w&&!(w&240)){for(m=b,U=w,v=f;y=r.lencode[v+((n&(1<<m+U)-1)>>m)],b=y>>>24,w=y>>>16&255,f=y&65535,!(m+b<=o);){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}n>>>=m,o-=m,r.back+=m}if(n>>>=b,o-=b,r.back+=b,r.length=f,w===0){r.mode=br;break}if(w&32){r.back=-1,r.mode=M;break}if(w&64){t.msg="invalid literal/length code",r.mode=T;break}r.extra=w&15,r.mode=_r;case _r:if(r.extra){for(S=r.extra;o<S;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}r.length+=n&(1<<r.extra)-1,n>>>=r.extra,o-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ur;case ur:for(;y=r.distcode[n&(1<<r.distbits)-1],b=y>>>24,w=y>>>16&255,f=y&65535,!(b<=o);){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(!(w&240)){for(m=b,U=w,v=f;y=r.distcode[v+((n&(1<<m+U)-1)>>m)],b=y>>>24,w=y>>>16&255,f=y&65535,!(m+b<=o);){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}n>>>=m,o-=m,r.back+=m}if(n>>>=b,o-=b,r.back+=b,w&64){t.msg="invalid distance code",r.mode=T;break}r.offset=f,r.extra=w&15,r.mode=mr;case mr:if(r.extra){for(S=r.extra;o<S;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}r.offset+=n&(1<<r.extra)-1,n>>>=r.extra,o-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=T;break}r.mode=wr;case wr:if(_===0)break t;if(h=c-_,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=T;break}h>r.wnext?(h-=r.wnext,z=r.wsize-h):z=r.wnext-h,h>r.length&&(h=r.length),A=r.window}else A=i,z=d-r.offset,h=r.length;h>_&&(h=_),_-=h,r.length-=h;do i[d++]=A[z++];while(--h);r.length===0&&(r.mode=nt);break;case br:if(_===0)break t;i[d++]=r.length,_--,r.mode=nt;break;case kt:if(r.wrap){for(;o<32;){if(l===0)break t;l--,n|=e[s++]<<o,o+=8}if(c-=_,t.total_out+=c,r.total+=c,r.wrap&4&&c&&(t.adler=r.check=r.flags?P(r.check,i,c,d-c):ot(r.check,i,c,d-c)),c=_,r.wrap&4&&(r.flags?n:kr(n))!==r.check){t.msg="incorrect data check",r.mode=T;break}n=0,o=0}r.mode=pr;case pr:if(r.wrap&&r.flags){for(;o<32;){if(l===0)break t;l--,n+=e[s++]<<o,o+=8}if(r.wrap&4&&n!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=T;break}n=0,o=0}r.mode=gr;case gr:x=1;break t;case T:x=-3;break t;case St:return-4;case Hr:default:return-2}return t.next_out=d,t.avail_out=_,t.next_in=s,t.avail_in=l,r.hold=n,r.bits=o,(r.wsize||c!==t.avail_out&&r.mode<T&&(r.mode<kt||a!==4))&&Yr(t,t.output,t.next_out,c-t.avail_out)?(r.mode=St,-4):(g-=t.avail_in,c-=t.avail_out,t.total_in+=g,t.total_out+=c,r.total+=c,r.wrap&4&&c&&(t.adler=r.check=r.flags?P(r.check,i,c,t.next_out-c):ot(r.check,i,c,t.next_out-c)),t.data_type=r.bits+(r.last?64:0)+(r.mode===M?128:0)+(r.mode===et||r.mode===gt?256:0),(g===0&&c===0||a===4)&&x===0&&(x=-5),x)},yr=t=>{if(W(t))return-2;let a=t.state;return a.window&&(a.window=null),t.state=null,0},xr=(t,a)=>{let r=a.length,e,i,s;return W(t)||(e=t.state,e.wrap!==0&&e.mode!==lt)?-2:e.mode===lt&&(i=1,i=ot(i,a,r,0),i!==e.check)?-3:(s=Yr(t,a,r,r),s?(e.mode=St,-4):(e.havedict=1,0))},Ba=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},Oa=t=>{let a=new Uint8Array(t.reduce((e,i)=>e+i.length,0)),r=0;for(let e of t)a.set(e,r),r+=e.length;return a};function $(t){"@babel/helpers - typeof";return $=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},$(t)}function Pa(t,a){if($(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var e=r.call(t,a||"default");if($(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(t)}function Ia(t){var a=Pa(t,"string");return $(a)=="symbol"?a:a+""}function R(t,a,r){return(a=Ia(a))in t?Object.defineProperty(t,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[a]=r,t}var zr=Object.prototype.toString,Da={chunkSize:1024*64,windowBits:15,raw:!1,dictionary:new Uint8Array},Va=class{constructor(t={}){R(this,"options",void 0),R(this,"err",void 0),R(this,"msg",void 0),R(this,"ended",void 0),R(this,"started",void 0),R(this,"chunks",void 0),R(this,"strm",void 0),R(this,"result",void 0),this.options=Object.assign({},Da,t);let a=this.options;a.raw&&a.windowBits>=0&&a.windowBits<16&&(a.windowBits=-a.windowBits,a.windowBits===0&&(a.windowBits=-15)),a.windowBits>=0&&a.windowBits<16&&!t.windowBits&&(a.windowBits+=32),a.windowBits>15&&a.windowBits<48&&(a.windowBits&15||(a.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new Ba,this.strm.avail_out=0;let r=Ea(this.strm,a.windowBits);if(r!==0)throw Error(ut[r]);zr.call(a.dictionary)==="[object ArrayBuffer]"&&(a.dictionary=new Uint8Array(a.dictionary));let e=a.dictionary;if(a.raw&&e.length&&(r=xr(this.strm,e),r!==0))throw Error(ut[r])}push(t,a=!1){let r=this.strm,e=this.options.chunkSize,i,s,d;if(this.ended)return this.err===0;for(s=typeof a=="number"?a:a===!0?4:0,zr.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length,this.started||(this.started=!0,this.onStart(r));;){if(r.avail_out===0&&(r.output=new Uint8Array(e),r.next_out=0,r.avail_out=e),i=xt(r,s),i===2){let l=this.options.dictionary;l.length&&(i=xr(r,l),i===0?i=xt(r,s):i===-3&&(i=2))}for(;r.avail_in>0&&i===1&&r.state.wrap&2&&r.state.flags!==0&&r.input[r.next_in]!==0;)Fr(r),i=xt(r,s);if(i===-2||i===-3||i===2||i===-4)break;if(d=r.avail_out,r.next_out&&(r.avail_out===0||i===1||s>0)&&(this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out)),r.avail_out=0,r.next_out=0),!((i===0||i===-5)&&d===0)){if(i===1){i=yr(this.strm);break}if(r.avail_in===0){if(s===4){i=yr(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=r.msg||ut[i],this.ended=!0,this.onEnd(i),i===0}onStart(t){}onData(t){this.chunks.push(t)}onEnd(t){t===0&&(this.result=Oa(this.chunks)),this.chunks=[]}};function Qr(t,a={}){let r=new Va(a);if(r.push(t,!0),r.err)throw Error(r.msg);let e=r.result;return a.toText?new TextDecoder().decode(e):e}var J=Uint16Array.BYTES_PER_ELEMENT,H=Int32Array.BYTES_PER_ELEMENT,K=Uint32Array.BYTES_PER_ELEMENT,L={METADATA:0,TERRAIN:1,DBROOT:2};L.fromString=function(t){if(t==="Metadata")return L.METADATA;if(t==="Terrain")return L.TERRAIN;if(t==="DbRoot")return L.DBROOT};function Ma(t,a){let r=L.fromString(t.type),e=t.buffer;Lt(t.key,e);let i=Ha(e);e=i.buffer;let s=i.length;switch(r){case L.METADATA:return Ra(e,s,t.quadKey);case L.TERRAIN:return Na(e,s,a);case L.DBROOT:return a.push(e),{buffer:e}}}var ja=32301;function Ra(t,a,r){let e=new DataView(t),i=0,s=e.getUint32(i,!0);if(i+=K,s!==ja)throw new O("Invalid magic");let d=e.getUint32(i,!0);if(i+=K,d!==1)throw new O("Invalid data type. Must be 1 for QuadTreePacket");let l=e.getUint32(i,!0);if(i+=K,l!==2)throw new O("Invalid QuadTreePacket version. Only version 2 is supported.");let _=e.getInt32(i,!0);i+=H;let n=e.getInt32(i,!0);if(i+=H,n!==32)throw new O("Invalid instance size.");let o=e.getInt32(i,!0);i+=H;let g=e.getInt32(i,!0);i+=H;let c=e.getInt32(i,!0);if(i+=H,o!==_*n+i)throw new O("Invalid dataBufferOffset");if(o+g+c!==a)throw new O("Invalid packet offsets");let h=[];for(let f=0;f<_;++f){let m=e.getUint8(i);++i,++i;let U=e.getUint16(i,!0);i+=J;let v=e.getUint16(i,!0);i+=J;let p=e.getUint16(i,!0);i+=J,i+=J,i+=J,i+=H,i+=H,i+=8;let x=e.getUint8(i++),u=e.getUint8(i++);i+=J,h.push(new Gt(m,U,v,p,x,u))}let z=[],A=0;function y(f,m,U){let v=!1;if(U===4){if(m.hasSubtree())return;v=!0}for(let p=0;p<4;++p){let x=f+p.toString();if(v)z[x]=null;else if(U<4)if(!m.hasChild(p))z[x]=null;else{if(A===_){console.log("Incorrect number of instances");return}let u=h[A++];z[x]=u,y(x,u,U+1)}}}let b=0,w=h[A++];return r===""?++b:z[r]=w,y(r,w,b),z}var Ca=5,La=4;function Na(t,a,r){let e=new DataView(t),i=function(l){for(let _=0;_<La;++_){let n=e.getUint32(l,!0);if(l+=K,l+=n,l>a)throw new O("Malformed terrain packet found.")}return l},s=0,d=[];for(;d.length<Ca;){let l=s;s=i(s);let _=t.slice(l,s);r.push(_),d.push(_)}return d}var qr=1953029805,Ga=2917034100;function Ha(t){let a=new DataView(t),r=0,e=a.getUint32(r,!0);if(r+=K,e!==qr&&e!==Ga)throw new O("Invalid magic");let i=a.getUint32(r,e===qr);r+=K;let s=new Uint8Array(t,r),d=Qr(s);if(d.length!==i)throw new O("Size of packet doesn't match header");return d}var oi=Ct(Ma);export{oi as default}; diff --git a/plugins/feature/map/Cesium/Workers/decodeI3S.js b/plugins/feature/map/Cesium/Workers/decodeI3S.js index 845b2e56b..56c9c7e72 100644 --- a/plugins/feature/map/Cesium/Workers/decodeI3S.js +++ b/plugins/feature/map/Cesium/Workers/decodeI3S.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as mt}from"./chunk-NXL34BSE.js";import{a as P}from"./chunk-Q4LSC5X3.js";import{a as ht}from"./chunk-U3N6LNE4.js";import{a as ft}from"./chunk-L4JCTZ6Y.js";import{a as g,b as ot,d as st,e as it}from"./chunk-FGKVHLJ4.js";import{a as M}from"./chunk-YRCAQUFT.js";import{b as lt}from"./chunk-ELJAHN3H.js";import{d as pt,e as h}from"./chunk-3BGP4HCL.js";var at=pt(mt(),1);function xt(n){return lt.defined("value",n),n<=.04045?n*.07739938080495357:Math.pow((n+.055)*.9478672985781991,2.4)}var k=xt;var ut;function wt(n,t,e,o,a,i){let r=e*(1-n)+o*n,s=a*(1-n)+i*n;return r*(1-t)+s*t}function H(n,t,e,o){let a=n+t*e;return o[a]}function It(n,t,e){let o=e.nativeExtent,a=(n-o.west)/(o.east-o.west)*(e.width-1),i=(t-o.south)/(o.north-o.south)*(e.height-1),r=Math.floor(a),s=Math.floor(i);a-=r,i-=s;let c=r<e.width?r+1:r,u=s<e.height?s+1:s;s=e.height-1-s,u=e.height-1-u;let l=H(r,s,e.width,e.buffer),f=H(c,s,e.width,e.buffer),p=H(r,u,e.width,e.buffer),m=H(c,u,e.width,e.buffer),d=wt(a,i,l,f,p,m);return d=d*e.scale+e.offset,d}function yt(n,t,e){for(let o=0;o<e.length;o++){let a=e[o].nativeExtent,i=new g;if(e[o].projectionType==="WebMercator"){let r=e[o].projection._ellipsoid._radii;i=new ft(new st(r.x,r.y,r.z)).project(new ot(n,t,0))}else i.x=n,i.y=t;if(i.x>a.west&&i.x<a.east&&i.y>a.south&&i.y<a.north)return It(i.x,i.y,e[o])}return 0}function At(n,t,e,o,a,i,r){if(r)return;let s=yt(a.longitude,a.latitude,i);for(let c=0;c<n;++c){let u=yt(a.longitude+M.toRadians(e*t[c*3]),a.latitude+M.toRadians(o*t[c*3+1]),i);t[c*3+2]+=u-s}}function Lt(n,t,e,o,a,i,r,s,c){if(n===0||!h(t)||t.length===0)return;let u=new st(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z));for(let l=0;l<n;++l){let f=l*3,p=f+1,m=f+2,d=new ot;d.longitude=o.longitude+M.toRadians(s*t[f]),d.latitude=o.latitude+M.toRadians(c*t[p]),d.height=o.height+t[m];let b={};u.cartographicToCartesian(d,b),b.x-=a.x,b.y-=a.y,b.z-=a.z;let x={};if(it.multiplyByVector(i,b,x),t[f]=x.x,t[p]=x.y,t[m]=x.z,h(e)){let T=new g(e[f],e[p],e[m]),I={};it.multiplyByVector(i,T,I),e[f]=I.x,e[p]=I.y,e[m]=I.z}}}function Ot(n,t,e){for(let o=0;o<n;++o){let a=e[o*4]/65535,i=e[o*4+1]/65535,r=(e[o*4+2]-e[o*4])/65535,s=(e[o*4+3]-e[o*4+1])/65535;t[o*2]*=r,t[o*2]+=a,t[o*2+1]*=s,t[o*2+1]+=i}}function Tt(n,t,e,o){let a=new Uint32Array(n),i=h(t)?s=>t[s]:s=>s,r=0;if(o&&h(e)){let s=c=>e[i(c)*4+3]<255;for(let c=0;c<n;c+=3)!s(c)&&!s(c+1)&&!s(c+2)&&(a[r++]=i(c),a[r++]=i(c+1),a[r++]=i(c+2));if(r>0){let c=r;for(let u=0;u<n;u+=3)(s(u)||s(u+1)||s(u+2))&&(a[c++]=i(u),a[c++]=i(u+1),a[c++]=i(u+2))}else for(let c=0;c<n;++c)a[c]=i(c)}else{r=n;for(let s=0;s<n;++s)a[s]=i(s)}return{indexArray:a,transparentVertexOffset:r}}function Ct(n,t,e){let o=t[e];if(h(o))return o;let a=t[e]={positions:{},indices:{},edges:{}},i=n[e]??n.default;return a.hasOutline=h(i?.edges),a}function Ft(n,t,e,o){if(!h(n[e])){let a=e*3,i=t;for(let r=0;r<3;r++){let s=o[a+r];h(i[s])||(i[s]={}),i=i[s]}h(i.index)||(i.index=e),n[e]=i.index}}function Ut(n,t,e,o,a,i){let r,s;o<a?(r=o,s=a):(r=a,s=o);let c=n[r];h(c)||(c=n[r]={});let u=c[s];h(u)||(u=c[s]={normalsIndex:[],outlines:[]}),u.normalsIndex.push(i),(u.outlines.length===0||t!==o||e!==a)&&u.outlines.push(t,e)}function Vt(n,t,e,o){let a=[];for(let i=0;i<e.length;i+=3){let r=h(t)?t[e[i]]:"default",s=Ct(n,a,r);if(!s.hasOutline)continue;let c=s.indices,u=s.positions;for(let f=0;f<3;f++){let p=e[i+f];Ft(c,u,p,o)}let l=s.edges;for(let f=0;f<3;f++){let p=e[i+f],m=e[i+(f+1)%3],d=c[p],b=c[m];Ut(l,p,m,d,b,i)}}return a}var O=new g,X=new g,Y=new g;function bt(n,t,e,o){let a=e[t]*3,i=e[t+1]*3,r=e[t+2]*3;g.fromArray(o,a,O),g.fromArray(o,i,X),g.fromArray(o,r,Y),g.subtract(X,O,X),g.subtract(Y,O,Y),g.cross(X,Y,O);let s=g.magnitude(O);s!==0&&g.divideByScalar(O,s,O);let c=t*3,u=(t+1)*3,l=(t+2)*3;g.pack(O,n,c),g.pack(O,n,u),g.pack(O,n,l)}var z=new g,ct=new g;function Et(n,t,e){g.fromArray(n,t,z),g.fromArray(n,e,ct);let o=g.dot(z,ct),a=g.magnitude(g.cross(z,ct,z));return Math.atan2(a,o)<.25}function _t(n,t,e,o,a){if(t.normalsIndex.length>1){let i=o.length===a.length;for(let r=0;r<t.normalsIndex.length;r++){let s=t.normalsIndex[r];if(h(a[s*3])||bt(a,s,e,o),r!==0)for(let c=0;c<r;c++){let u=t.normalsIndex[c],l=i?e[s]*3:s*3,f=i?e[u]*3:u*3;if(Et(a,l,f))return}}}n.push(...t.outlines)}function Rt(n,t,e,o,a){let i=Object.keys(t);for(let r=0;r<i.length;r++){let s=t[i[r]],c=Object.keys(s);for(let u=0;u<c.length;u++){let l=s[c[u]];_t(n,l,e,o,a)}}}function Nt(n,t,e,o){let a=[],i=Object.keys(n);for(let r=0;r<i.length;r++){let s=n[i[r]].edges;Rt(a,s,t,e,o)}return a}function Bt(n,t,e,o,a){if(!h(n)||Object.keys(n).length===0)return;let i=Vt(n,t,e,o);(!h(a)||e.length*3!==a.length)&&(a=[]);let r=Nt(i,e,o,a);return r.length>0?new Uint32Array(r):void 0}function Gt(n){let t=new Float32Array(n.length);for(let e=0;e<n.length;e+=4)t[e]=k(P.byteToFloat(n[e])),t[e+1]=k(P.byteToFloat(n[e+1])),t[e+2]=k(P.byteToFloat(n[e+2])),t[e+3]=P.byteToFloat(n[e+3]);return t}function St(n,t,e,o,a,i,r){let s={normals:void 0,positions:void 0,uv0s:void 0,colors:void 0,featureIndex:void 0,vertexCount:void 0};if(n===0||!h(e)||e.length===0||h(o))return s;if(h(t)){s.vertexCount=t.length,s.positions=new Float32Array(t.length*3),s.uv0s=h(a)?new Float32Array(t.length*2):void 0,s.colors=h(i)?new Uint8Array(t.length*4):void 0,s.featureIndex=h(r)?new Array(t.length):void 0;for(let c=0;c<t.length;c++){let u=t[c];s.positions[c*3]=e[u*3],s.positions[c*3+1]=e[u*3+1],s.positions[c*3+2]=e[u*3+2],h(s.uv0s)&&(s.uv0s[c*2]=a[u*2],s.uv0s[c*2+1]=a[u*2+1]),h(s.colors)&&(s.colors[c*4]=i[u*4],s.colors[c*4+1]=i[u*4+1],s.colors[c*4+2]=i[u*4+2],s.colors[c*4+3]=i[u*4+3]),h(s.featureIndex)&&(s.featureIndex[c]=r[u])}n=t.length,e=s.positions}t=new Array(n);for(let c=0;c<n;c++)t[c]=c;s.normals=new Float32Array(t.length*3);for(let c=0;c<t.length;c+=3)bt(s.normals,c,t,e);return s}function vt(n,t,e,o,a,i,r,s){if(n===0||!h(e)||e.length===0)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};let c=[],u=[],l=[],f=[],p=[],m=[],d={},b=[];h(t)&&(n=t.length);let{indexArray:x,transparentVertexOffset:T}=Tt(n,t,i,s.splitGeometryByColorTransparency),I=new Blob([x],{type:"application/binary"}),A=URL.createObjectURL(I),w=n,F=s.enableFeatures&&h(r)?new Float32Array(r.length):void 0,C=0;if(h(F))for(let y=0;y<r.length;++y){F[y]=r[y];let E=r[y]+1;C<E&&(C=E)}let U,R=Bt(s.symbologyData,r,x,e,o);if(h(R)){let y=new Blob([R],{type:"application/binary"});U=URL.createObjectURL(y)}let L=e.subarray(0,w*3),gt=new Blob([L],{type:"application/binary"}),dt=URL.createObjectURL(gt),D=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY;for(let y=0;y<L.length/3;y++)D=Math.min(D,L[y*3+0]),K=Math.max(K,L[y*3+0]),Q=Math.min(Q,L[y*3+1]),Z=Math.max(Z,L[y*3+1]),J=Math.min(J,L[y*3+2]),$=Math.max($,L[y*3+2]);let N=o?o.subarray(0,w*3):void 0,q;if(h(N)){let y=new Blob([N],{type:"application/binary"});q=URL.createObjectURL(y)}let B=a?a.subarray(0,w*2):void 0,tt;if(h(B)){let y=new Blob([B],{type:"application/binary"});tt=URL.createObjectURL(y)}let G=h(i)?Gt(i.subarray(0,w*4)):void 0,et;if(h(G)){let y=new Blob([G],{type:"application/binary"});et=URL.createObjectURL(y)}let S=h(F)?F.subarray(0,w):void 0,nt;if(h(S)){let y=new Blob([S],{type:"application/binary"});nt=URL.createObjectURL(y)}let _=h(F)?new Float32Array(C):void 0,rt;if(h(_)){for(let E=0;E<_.length;++E)_[E]=E;let y=new Blob([_],{type:"application/binary"});rt=URL.createObjectURL(y)}let V={},j={};V.POSITION=l.length,c.push({uri:dt,byteLength:L.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:L.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:L.length/3,type:"VEC3",max:[D,Q,J],min:[K,Z,$]}),h(q)&&(V.NORMAL=l.length,c.push({uri:q,byteLength:N.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:N.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:N.length/3,type:"VEC3"})),h(tt)&&(V.TEXCOORD_0=l.length,c.push({uri:tt,byteLength:B.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:B.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:B.length/2,type:"VEC2"})),h(et)&&(V.COLOR_0=l.length,c.push({uri:et,byteLength:G.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:G.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:G.length/4,type:"VEC4"})),h(nt)&&(V._FEATURE_ID_0=l.length,c.push({uri:nt,byteLength:S.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:S.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:S.length,type:"SCALAR"}),j.EXT_mesh_features={featureIds:[{attribute:0,propertyTable:0,featureCount:C}]},b.push("EXT_mesh_features")),h(rt)&&(c.push({uri:rt,byteLength:_.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:_.byteLength,target:34963}),d.EXT_structural_metadata={schema:{id:"i3s-metadata-schema-001",name:"I3S metadata schema 001",description:"The schema for I3S metadata",version:"1.0",classes:{feature:{name:"feature",description:"Feature metadata",properties:{index:{description:"The feature index",type:"SCALAR",componentType:"FLOAT32",required:!0}}}}},propertyTables:[{name:"feature-indices-mapping",class:"feature",count:C,properties:{index:{values:u.length-1}}}]},b.push("EXT_structural_metadata")),h(U)&&(c.push({uri:U,byteLength:R.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:R.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:R.length,type:"SCALAR"}),j.CESIUM_primitive_outline={indices:l.length-1},b.push("CESIUM_primitive_outline")),c.push({uri:A,byteLength:x.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:x.byteLength,target:34963});let v=[];return T>0&&(l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j})),T<n&&(l.push({bufferView:u.length-1,byteOffset:4*T,componentType:5125,count:n-T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j,extra:{isTransparent:!0}})),f.push({primitives:v}),m.push(0),p.push({mesh:0}),{buffers:c,bufferViews:u,accessors:l,meshes:f,nodes:p,nodesInScene:m,rootExtensions:d,extensionsUsed:b}}function Mt(n,t,e,o){let a=new Uint8Array(n,0,5);return a[0]===68&&a[1]===82&&a[2]===65&&a[3]===67&&a[4]===79?Pt(n,e):kt(n,t,e,o)}function Pt(n){let t=ut,e=new t.DecoderBuffer,o=new Uint8Array(n);e.Init(o,o.length);let a=new t.Decoder,i=a.GetEncodedGeometryType(e),r=new t.MetadataQuerier,s,c;i===t.TRIANGULAR_MESH&&(s=new t.Mesh,c=a.DecodeBufferToMesh(e,s));let u={vertexCount:[0],featureCount:0};if(h(c)&&c.ok()&&s.ptr!==0){let l=s.num_faces(),f=s.num_attributes(),p=s.num_points();u.indices=new Uint32Array(l*3);let m=u.indices;u.vertexCount[0]=p,u.scale_x=1,u.scale_y=1;let d=new t.DracoInt32Array(3);for(let b=0;b<l;++b)a.GetFaceFromMesh(s,b,d),m[b*3]=d.GetValue(0),m[b*3+1]=d.GetValue(1),m[b*3+2]=d.GetValue(2);t.destroy(d);for(let b=0;b<f;++b){let x=a.GetAttribute(s,b),T=jt(t,a,s,x,p),I=x.attribute_type(),A="unknown";I===t.POSITION?A="positions":I===t.NORMAL?A="normals":I===t.COLOR?A="colors":I===t.TEX_COORD&&(A="uv0s");let w=a.GetAttributeMetadata(s,b);if(w.ptr!==0){let F=r.NumEntries(w);for(let C=0;C<F;++C){let U=r.GetEntryName(w,C);U==="i3s-scale_x"?u.scale_x=r.GetDoubleEntry(w,"i3s-scale_x"):U==="i3s-scale_y"?u.scale_y=r.GetDoubleEntry(w,"i3s-scale_y"):U==="i3s-attribute-type"&&(A=r.GetStringEntry(w,"i3s-attribute-type"))}}h(u[A])&&console.log("Attribute already exists",A),u[A]=T,A==="feature-index"&&u.featureCount++}t.destroy(s)}return t.destroy(r),t.destroy(a),u}function jt(n,t,e,o,a){let i=o.num_components()*a,r,c=[function(){},function(){r=new n.DracoInt8Array(i),t.GetAttributeInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeUInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeUInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){},function(){r=new n.DracoFloat32Array(i),t.GetAttributeFloatForAllPoints(e,o,r)||console.error("Bad stream");let l=new Float32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){r=new n.DracoUInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l}][o.data_type()]();return h(r)&&n.destroy(r),c}var W={position:function(n,t,e){let o=n.vertexCount*3;return n.positions=new Float32Array(t,e,o),e+=o*4,e},normal:function(n,t,e){let o=n.vertexCount*3;return n.normals=new Float32Array(t,e,o),e+=o*4,e},uv0:function(n,t,e){let o=n.vertexCount*2;return n.uv0s=new Float32Array(t,e,o),e+=o*4,e},color:function(n,t,e){let o=n.vertexCount*4;return n.colors=new Uint8Array(t,e,o),e+=o,e},featureId:function(n,t,e){let o=n.featureCount;return e+=o*8,e},id:function(n,t,e){let o=n.featureCount;return e+=o*8,e},faceRange:function(n,t,e){let o=n.featureCount*2;return n.faceRange=new Uint32Array(t,e,o),e+=o*4,e},uvRegion:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e},region:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e}};function kt(n,t,e,o){let a={vertexCount:0},i=new DataView(n);try{let r=0;if(a.vertexCount=i.getUint32(r,1),r+=4,a.featureCount=i.getUint32(r,1),r+=4,h(e))for(let s=0;s<e.attributes.length;s++)h(W[e.attributes[s]])?r=W[e.attributes[s]](a,n,r):console.error("Unknown decoder for",e.attributes[s]);else{let s=t.ordering,c=t.featureAttributeOrder;h(o)&&h(o.geometryData)&&h(o.geometryData[0])&&h(o.geometryData[0].params)&&(s=Object.keys(o.geometryData[0].params.vertexAttributes),c=Object.keys(o.geometryData[0].params.featureAttributes));for(let u=0;u<s.length;u++){let l=W[s[u]];r=l(a,n,r)}for(let u=0;u<c.length;u++){let l=W[c[u]];r=l(a,n,r)}}}catch(r){console.error(r)}return a.scale_x=1,a.scale_y=1,a}function Ht(n){let t=Mt(n.binaryData,n.schema,n.bufferInfo,n.featureData);h(n.geoidDataList)&&n.geoidDataList.length>0&&At(t.vertexCount,t.positions,t.scale_x,t.scale_y,n.cartographicCenter,n.geoidDataList,!1),Lt(t.vertexCount,t.positions,t.normals,n.cartographicCenter,n.cartesianCenter,n.parentRotation,n.ellipsoidRadiiSquare,t.scale_x,t.scale_y),h(t.uv0s)&&h(t["uv-region"])&&Ot(t.vertexCount,t.uv0s,t["uv-region"]);let e;if(h(t["feature-index"]))e=t["feature-index"];else if(h(t.faceRange)){e=new Array(t.vertexCount);for(let r=0;r<t.faceRange.length-1;r+=2){let s=r/2,c=t.faceRange[r],u=t.faceRange[r+1];for(let l=c;l<=u;l++)e[l*3]=s,e[l*3+1]=s,e[l*3+2]=s}}if(n.calculateNormals){let r=St(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e);h(r.normals)&&(t.normals=r.normals,h(r.vertexCount)&&(t.vertexCount=r.vertexCount,t.indices=r.indices,t.positions=r.positions,t.uv0s=r.uv0s,t.colors=r.colors,e=r.featureIndex))}let o=vt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e,n),a={positions:t.positions,indices:t.indices,featureIndex:e,sourceURL:n.url,cartesianCenter:n.cartesianCenter,parentRotation:n.parentRotation};return o._customAttributes=a,{meshData:o}}async function Xt(n,t){let e=n.webAssemblyConfig;return h(e)&&h(e.wasmBinaryFile)?ut=await(0,at.default)(e):ut=await(0,at.default)(),!0}function Yt(n,t){let e=n.webAssemblyConfig;return h(e)?Xt(n,t):Ht(n,t)}var re=ht(Yt);export{re as default}; +import{a as mt}from"./chunk-RWR4JTSS.js";import{a as P}from"./chunk-RDRVGSTZ.js";import{a as ht}from"./chunk-JJVL7F22.js";import{a as ft}from"./chunk-MQTDGHHT.js";import{a as ot,c as st}from"./chunk-KP72RGCH.js";import{a as g,b as it}from"./chunk-OSVSBQDY.js";import{a as M}from"./chunk-LZC73BOP.js";import{b as lt}from"./chunk-OU2IPMYE.js";import{d as pt,f as h}from"./chunk-H7SJWKIY.js";var at=pt(mt(),1);function xt(n){return lt.defined("value",n),n<=.04045?n*.07739938080495357:Math.pow((n+.055)*.9478672985781991,2.4)}var k=xt;var ut;function wt(n,t,e,o,a,i){let r=e*(1-n)+o*n,s=a*(1-n)+i*n;return r*(1-t)+s*t}function H(n,t,e,o){let a=n+t*e;return o[a]}function It(n,t,e){let o=e.nativeExtent,a=(n-o.west)/(o.east-o.west)*(e.width-1),i=(t-o.south)/(o.north-o.south)*(e.height-1),r=Math.floor(a),s=Math.floor(i);a-=r,i-=s;let c=r<e.width?r+1:r,u=s<e.height?s+1:s;s=e.height-1-s,u=e.height-1-u;let l=H(r,s,e.width,e.buffer),f=H(c,s,e.width,e.buffer),p=H(r,u,e.width,e.buffer),m=H(c,u,e.width,e.buffer),d=wt(a,i,l,f,p,m);return d=d*e.scale+e.offset,d}function yt(n,t,e){for(let o=0;o<e.length;o++){let a=e[o].nativeExtent,i=new g;if(e[o].projectionType==="WebMercator"){let r=e[o].projection._ellipsoid._radii;i=new ft(new st(r.x,r.y,r.z)).project(new ot(n,t,0))}else i.x=n,i.y=t;if(i.x>a.west&&i.x<a.east&&i.y>a.south&&i.y<a.north)return It(i.x,i.y,e[o])}return 0}function At(n,t,e,o,a,i,r){if(r)return;let s=yt(a.longitude,a.latitude,i);for(let c=0;c<n;++c){let u=yt(a.longitude+M.toRadians(e*t[c*3]),a.latitude+M.toRadians(o*t[c*3+1]),i);t[c*3+2]+=u-s}}function Lt(n,t,e,o,a,i,r,s,c){if(n===0||!h(t)||t.length===0)return;let u=new st(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z));for(let l=0;l<n;++l){let f=l*3,p=f+1,m=f+2,d=new ot;d.longitude=o.longitude+M.toRadians(s*t[f]),d.latitude=o.latitude+M.toRadians(c*t[p]),d.height=o.height+t[m];let b={};u.cartographicToCartesian(d,b),b.x-=a.x,b.y-=a.y,b.z-=a.z;let x={};if(it.multiplyByVector(i,b,x),t[f]=x.x,t[p]=x.y,t[m]=x.z,h(e)){let T=new g(e[f],e[p],e[m]),I={};it.multiplyByVector(i,T,I),e[f]=I.x,e[p]=I.y,e[m]=I.z}}}function Ot(n,t,e){for(let o=0;o<n;++o){let a=e[o*4]/65535,i=e[o*4+1]/65535,r=(e[o*4+2]-e[o*4])/65535,s=(e[o*4+3]-e[o*4+1])/65535;t[o*2]*=r,t[o*2]+=a,t[o*2+1]*=s,t[o*2+1]+=i}}function Tt(n,t,e,o){let a=new Uint32Array(n),i=h(t)?s=>t[s]:s=>s,r=0;if(o&&h(e)){let s=c=>e[i(c)*4+3]<255;for(let c=0;c<n;c+=3)!s(c)&&!s(c+1)&&!s(c+2)&&(a[r++]=i(c),a[r++]=i(c+1),a[r++]=i(c+2));if(r>0){let c=r;for(let u=0;u<n;u+=3)(s(u)||s(u+1)||s(u+2))&&(a[c++]=i(u),a[c++]=i(u+1),a[c++]=i(u+2))}else for(let c=0;c<n;++c)a[c]=i(c)}else{r=n;for(let s=0;s<n;++s)a[s]=i(s)}return{indexArray:a,transparentVertexOffset:r}}function Ct(n,t,e){let o=t[e];if(h(o))return o;let a=t[e]={positions:{},indices:{},edges:{}},i=n[e]??n.default;return a.hasOutline=h(i?.edges),a}function Ft(n,t,e,o){if(!h(n[e])){let a=e*3,i=t;for(let r=0;r<3;r++){let s=o[a+r];h(i[s])||(i[s]={}),i=i[s]}h(i.index)||(i.index=e),n[e]=i.index}}function Ut(n,t,e,o,a,i){let r,s;o<a?(r=o,s=a):(r=a,s=o);let c=n[r];h(c)||(c=n[r]={});let u=c[s];h(u)||(u=c[s]={normalsIndex:[],outlines:[]}),u.normalsIndex.push(i),(u.outlines.length===0||t!==o||e!==a)&&u.outlines.push(t,e)}function Vt(n,t,e,o){let a=[];for(let i=0;i<e.length;i+=3){let r=h(t)?t[e[i]]:"default",s=Ct(n,a,r);if(!s.hasOutline)continue;let c=s.indices,u=s.positions;for(let f=0;f<3;f++){let p=e[i+f];Ft(c,u,p,o)}let l=s.edges;for(let f=0;f<3;f++){let p=e[i+f],m=e[i+(f+1)%3],d=c[p],b=c[m];Ut(l,p,m,d,b,i)}}return a}var O=new g,X=new g,Y=new g;function bt(n,t,e,o){let a=e[t]*3,i=e[t+1]*3,r=e[t+2]*3;g.fromArray(o,a,O),g.fromArray(o,i,X),g.fromArray(o,r,Y),g.subtract(X,O,X),g.subtract(Y,O,Y),g.cross(X,Y,O);let s=g.magnitude(O);s!==0&&g.divideByScalar(O,s,O);let c=t*3,u=(t+1)*3,l=(t+2)*3;g.pack(O,n,c),g.pack(O,n,u),g.pack(O,n,l)}var z=new g,ct=new g;function Et(n,t,e){g.fromArray(n,t,z),g.fromArray(n,e,ct);let o=g.dot(z,ct),a=g.magnitude(g.cross(z,ct,z));return Math.atan2(a,o)<.25}function _t(n,t,e,o,a){if(t.normalsIndex.length>1){let i=o.length===a.length;for(let r=0;r<t.normalsIndex.length;r++){let s=t.normalsIndex[r];if(h(a[s*3])||bt(a,s,e,o),r!==0)for(let c=0;c<r;c++){let u=t.normalsIndex[c],l=i?e[s]*3:s*3,f=i?e[u]*3:u*3;if(Et(a,l,f))return}}}n.push(...t.outlines)}function Rt(n,t,e,o,a){let i=Object.keys(t);for(let r=0;r<i.length;r++){let s=t[i[r]],c=Object.keys(s);for(let u=0;u<c.length;u++){let l=s[c[u]];_t(n,l,e,o,a)}}}function Nt(n,t,e,o){let a=[],i=Object.keys(n);for(let r=0;r<i.length;r++){let s=n[i[r]].edges;Rt(a,s,t,e,o)}return a}function Bt(n,t,e,o,a){if(!h(n)||Object.keys(n).length===0)return;let i=Vt(n,t,e,o);(!h(a)||e.length*3!==a.length)&&(a=[]);let r=Nt(i,e,o,a);return r.length>0?new Uint32Array(r):void 0}function Gt(n){let t=new Float32Array(n.length);for(let e=0;e<n.length;e+=4)t[e]=k(P.byteToFloat(n[e])),t[e+1]=k(P.byteToFloat(n[e+1])),t[e+2]=k(P.byteToFloat(n[e+2])),t[e+3]=P.byteToFloat(n[e+3]);return t}function St(n,t,e,o,a,i,r){let s={normals:void 0,positions:void 0,uv0s:void 0,colors:void 0,featureIndex:void 0,vertexCount:void 0};if(n===0||!h(e)||e.length===0||h(o))return s;if(h(t)){s.vertexCount=t.length,s.positions=new Float32Array(t.length*3),s.uv0s=h(a)?new Float32Array(t.length*2):void 0,s.colors=h(i)?new Uint8Array(t.length*4):void 0,s.featureIndex=h(r)?new Array(t.length):void 0;for(let c=0;c<t.length;c++){let u=t[c];s.positions[c*3]=e[u*3],s.positions[c*3+1]=e[u*3+1],s.positions[c*3+2]=e[u*3+2],h(s.uv0s)&&(s.uv0s[c*2]=a[u*2],s.uv0s[c*2+1]=a[u*2+1]),h(s.colors)&&(s.colors[c*4]=i[u*4],s.colors[c*4+1]=i[u*4+1],s.colors[c*4+2]=i[u*4+2],s.colors[c*4+3]=i[u*4+3]),h(s.featureIndex)&&(s.featureIndex[c]=r[u])}n=t.length,e=s.positions}t=new Array(n);for(let c=0;c<n;c++)t[c]=c;s.normals=new Float32Array(t.length*3);for(let c=0;c<t.length;c+=3)bt(s.normals,c,t,e);return s}function vt(n,t,e,o,a,i,r,s){if(n===0||!h(e)||e.length===0)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};let c=[],u=[],l=[],f=[],p=[],m=[],d={},b=[];h(t)&&(n=t.length);let{indexArray:x,transparentVertexOffset:T}=Tt(n,t,i,s.splitGeometryByColorTransparency),I=new Blob([x],{type:"application/binary"}),A=URL.createObjectURL(I),w=n,F=s.enableFeatures&&h(r)?new Float32Array(r.length):void 0,C=0;if(h(F))for(let y=0;y<r.length;++y){F[y]=r[y];let E=r[y]+1;C<E&&(C=E)}let U,R=Bt(s.symbologyData,r,x,e,o);if(h(R)){let y=new Blob([R],{type:"application/binary"});U=URL.createObjectURL(y)}let L=e.subarray(0,w*3),gt=new Blob([L],{type:"application/binary"}),dt=URL.createObjectURL(gt),D=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,J=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY;for(let y=0;y<L.length/3;y++)D=Math.min(D,L[y*3+0]),K=Math.max(K,L[y*3+0]),Q=Math.min(Q,L[y*3+1]),Z=Math.max(Z,L[y*3+1]),J=Math.min(J,L[y*3+2]),$=Math.max($,L[y*3+2]);let N=o?o.subarray(0,w*3):void 0,q;if(h(N)){let y=new Blob([N],{type:"application/binary"});q=URL.createObjectURL(y)}let B=a?a.subarray(0,w*2):void 0,tt;if(h(B)){let y=new Blob([B],{type:"application/binary"});tt=URL.createObjectURL(y)}let G=h(i)?Gt(i.subarray(0,w*4)):void 0,et;if(h(G)){let y=new Blob([G],{type:"application/binary"});et=URL.createObjectURL(y)}let S=h(F)?F.subarray(0,w):void 0,nt;if(h(S)){let y=new Blob([S],{type:"application/binary"});nt=URL.createObjectURL(y)}let _=h(F)?new Float32Array(C):void 0,rt;if(h(_)){for(let E=0;E<_.length;++E)_[E]=E;let y=new Blob([_],{type:"application/binary"});rt=URL.createObjectURL(y)}let V={},j={};V.POSITION=l.length,c.push({uri:dt,byteLength:L.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:L.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:L.length/3,type:"VEC3",min:[D,Q,J],max:[K,Z,$]}),h(q)&&(V.NORMAL=l.length,c.push({uri:q,byteLength:N.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:N.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:N.length/3,type:"VEC3"})),h(tt)&&(V.TEXCOORD_0=l.length,c.push({uri:tt,byteLength:B.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:B.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:B.length/2,type:"VEC2"})),h(et)&&(V.COLOR_0=l.length,c.push({uri:et,byteLength:G.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:G.byteLength,target:34962}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:G.length/4,type:"VEC4"})),h(nt)&&(V._FEATURE_ID_0=l.length,c.push({uri:nt,byteLength:S.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:S.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5126,count:S.length,type:"SCALAR"}),j.EXT_mesh_features={featureIds:[{attribute:0,propertyTable:0,featureCount:C}]},b.push("EXT_mesh_features")),h(rt)&&(c.push({uri:rt,byteLength:_.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:_.byteLength,target:34963}),d.EXT_structural_metadata={schema:{id:"i3s-metadata-schema-001",name:"I3S metadata schema 001",description:"The schema for I3S metadata",version:"1.0",classes:{feature:{name:"feature",description:"Feature metadata",properties:{index:{description:"The feature index",type:"SCALAR",componentType:"FLOAT32",required:!0}}}}},propertyTables:[{name:"feature-indices-mapping",class:"feature",count:C,properties:{index:{values:u.length-1}}}]},b.push("EXT_structural_metadata")),h(U)&&(c.push({uri:U,byteLength:R.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:R.byteLength,target:34963}),l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:R.length,type:"SCALAR"}),j.CESIUM_primitive_outline={indices:l.length-1},b.push("CESIUM_primitive_outline")),c.push({uri:A,byteLength:x.byteLength}),u.push({buffer:c.length-1,byteOffset:0,byteLength:x.byteLength,target:34963});let v=[];return T>0&&(l.push({bufferView:u.length-1,byteOffset:0,componentType:5125,count:T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j})),T<n&&(l.push({bufferView:u.length-1,byteOffset:4*T,componentType:5125,count:n-T,type:"SCALAR"}),v.push({attributes:V,indices:l.length-1,material:v.length,extensions:j,extra:{isTransparent:!0}})),f.push({primitives:v}),m.push(0),p.push({mesh:0}),{buffers:c,bufferViews:u,accessors:l,meshes:f,nodes:p,nodesInScene:m,rootExtensions:d,extensionsUsed:b}}function Mt(n,t,e,o){let a=new Uint8Array(n,0,5);return a[0]===68&&a[1]===82&&a[2]===65&&a[3]===67&&a[4]===79?Pt(n,e):kt(n,t,e,o)}function Pt(n){let t=ut,e=new t.DecoderBuffer,o=new Uint8Array(n);e.Init(o,o.length);let a=new t.Decoder,i=a.GetEncodedGeometryType(e),r=new t.MetadataQuerier,s,c;i===t.TRIANGULAR_MESH&&(s=new t.Mesh,c=a.DecodeBufferToMesh(e,s));let u={vertexCount:[0],featureCount:0};if(h(c)&&c.ok()&&s.ptr!==0){let l=s.num_faces(),f=s.num_attributes(),p=s.num_points();u.indices=new Uint32Array(l*3);let m=u.indices;u.vertexCount[0]=p,u.scale_x=1,u.scale_y=1;let d=new t.DracoInt32Array(3);for(let b=0;b<l;++b)a.GetFaceFromMesh(s,b,d),m[b*3]=d.GetValue(0),m[b*3+1]=d.GetValue(1),m[b*3+2]=d.GetValue(2);t.destroy(d);for(let b=0;b<f;++b){let x=a.GetAttribute(s,b),T=jt(t,a,s,x,p),I=x.attribute_type(),A="unknown";I===t.POSITION?A="positions":I===t.NORMAL?A="normals":I===t.COLOR?A="colors":I===t.TEX_COORD&&(A="uv0s");let w=a.GetAttributeMetadata(s,b);if(w.ptr!==0){let F=r.NumEntries(w);for(let C=0;C<F;++C){let U=r.GetEntryName(w,C);U==="i3s-scale_x"?u.scale_x=r.GetDoubleEntry(w,"i3s-scale_x"):U==="i3s-scale_y"?u.scale_y=r.GetDoubleEntry(w,"i3s-scale_y"):U==="i3s-attribute-type"&&(A=r.GetStringEntry(w,"i3s-attribute-type"))}}h(u[A])&&console.log("Attribute already exists",A),u[A]=T,A==="feature-index"&&u.featureCount++}t.destroy(s)}return t.destroy(r),t.destroy(a),u}function jt(n,t,e,o,a){let i=o.num_components()*a,r,c=[function(){},function(){r=new n.DracoInt8Array(i),t.GetAttributeInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt16Array(i),t.GetAttributeUInt16ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint16Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Int32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){r=new n.DracoInt32Array(i),t.GetAttributeUInt32ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){},function(){r=new n.DracoFloat32Array(i),t.GetAttributeFloatForAllPoints(e,o,r)||console.error("Bad stream");let l=new Float32Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l},function(){},function(){r=new n.DracoUInt8Array(i),t.GetAttributeUInt8ForAllPoints(e,o,r)||console.error("Bad stream");let l=new Uint8Array(i);for(let f=0;f<i;++f)l[f]=r.GetValue(f);return l}][o.data_type()]();return h(r)&&n.destroy(r),c}var W={position:function(n,t,e){let o=n.vertexCount*3;return n.positions=new Float32Array(t,e,o),e+=o*4,e},normal:function(n,t,e){let o=n.vertexCount*3;return n.normals=new Float32Array(t,e,o),e+=o*4,e},uv0:function(n,t,e){let o=n.vertexCount*2;return n.uv0s=new Float32Array(t,e,o),e+=o*4,e},color:function(n,t,e){let o=n.vertexCount*4;return n.colors=new Uint8Array(t,e,o),e+=o,e},featureId:function(n,t,e){let o=n.featureCount;return e+=o*8,e},id:function(n,t,e){let o=n.featureCount;return e+=o*8,e},faceRange:function(n,t,e){let o=n.featureCount*2;return n.faceRange=new Uint32Array(t,e,o),e+=o*4,e},uvRegion:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e},region:function(n,t,e){let o=n.vertexCount*4;return n["uv-region"]=new Uint16Array(t,e,o),e+=o*2,e}};function kt(n,t,e,o){let a={vertexCount:0},i=new DataView(n);try{let r=0;if(a.vertexCount=i.getUint32(r,1),r+=4,a.featureCount=i.getUint32(r,1),r+=4,h(e))for(let s=0;s<e.attributes.length;s++)h(W[e.attributes[s]])?r=W[e.attributes[s]](a,n,r):console.error("Unknown decoder for",e.attributes[s]);else{let s=t.ordering,c=t.featureAttributeOrder;h(o)&&h(o.geometryData)&&h(o.geometryData[0])&&h(o.geometryData[0].params)&&(s=Object.keys(o.geometryData[0].params.vertexAttributes),c=Object.keys(o.geometryData[0].params.featureAttributes));for(let u=0;u<s.length;u++){let l=W[s[u]];r=l(a,n,r)}for(let u=0;u<c.length;u++){let l=W[c[u]];r=l(a,n,r)}}}catch(r){console.error(r)}return a.scale_x=1,a.scale_y=1,a}function Ht(n){let t=Mt(n.binaryData,n.schema,n.bufferInfo,n.featureData);h(n.geoidDataList)&&n.geoidDataList.length>0&&At(t.vertexCount,t.positions,t.scale_x,t.scale_y,n.cartographicCenter,n.geoidDataList,!1),Lt(t.vertexCount,t.positions,t.normals,n.cartographicCenter,n.cartesianCenter,n.parentRotation,n.ellipsoidRadiiSquare,t.scale_x,t.scale_y),h(t.uv0s)&&h(t["uv-region"])&&Ot(t.vertexCount,t.uv0s,t["uv-region"]);let e;if(h(t["feature-index"]))e=t["feature-index"];else if(h(t.faceRange)){e=new Array(t.vertexCount);for(let r=0;r<t.faceRange.length-1;r+=2){let s=r/2,c=t.faceRange[r],u=t.faceRange[r+1];for(let l=c;l<=u;l++)e[l*3]=s,e[l*3+1]=s,e[l*3+2]=s}}if(n.calculateNormals){let r=St(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e);h(r.normals)&&(t.normals=r.normals,h(r.vertexCount)&&(t.vertexCount=r.vertexCount,t.indices=r.indices,t.positions=r.positions,t.uv0s=r.uv0s,t.colors=r.colors,e=r.featureIndex))}let o=vt(t.vertexCount,t.indices,t.positions,t.normals,t.uv0s,t.colors,e,n),a={positions:t.positions,indices:t.indices,featureIndex:e,sourceURL:n.url,cartesianCenter:n.cartesianCenter,parentRotation:n.parentRotation};return o._customAttributes=a,{meshData:o}}async function Xt(n,t){let e=n.webAssemblyConfig;return h(e)&&h(e.wasmBinaryFile)?ut=await(0,at.default)(e):ut=await(0,at.default)(),!0}function Yt(n,t){let e=n.webAssemblyConfig;return h(e)?Xt(n,t):Ht(n,t)}var re=ht(Yt);export{re as default}; diff --git a/plugins/feature/map/Cesium/Workers/gaussianSplatSorter.js b/plugins/feature/map/Cesium/Workers/gaussianSplatSorter.js new file mode 100644 index 000000000..38f82c4a9 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/gaussianSplatSorter.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{b as t,c as f}from"./chunk-JMWI6IHX.js";import{a as s}from"./chunk-JJVL7F22.js";import{f as o}from"./chunk-H7SJWKIY.js";async function m(i,e){let n=i.webAssemblyConfig;if(o(n)&&o(n.wasmBinary))return f({module:n.wasmBinary}),!0}function c(i,e){let n=i.webAssemblyConfig;if(o(n))return m(i,e);let{primitive:r,sortType:a}=i;if(a==="Index")return t(r.positions,r.modelView,r.count)}var y=s(c);export{y as default}; diff --git a/plugins/feature/map/Cesium/Workers/gaussianSplatTextureGenerator.js b/plugins/feature/map/Cesium/Workers/gaussianSplatTextureGenerator.js new file mode 100644 index 000000000..554c9decf --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/gaussianSplatTextureGenerator.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a,c}from"./chunk-JMWI6IHX.js";import{a as i}from"./chunk-JJVL7F22.js";import{f as n}from"./chunk-H7SJWKIY.js";async function u(t,s){let e=t.webAssemblyConfig;return n(e)&&n(e.wasmBinary)?(c({module:e.wasmBinary}),!0):!1}async function l(t,s){let e=t.webAssemblyConfig;if(n(e))return u(t,s);let{attributes:r,count:f}=t,o=a(r.positions,r.scales,r.rotations,r.colors,f);return{data:o.data,width:o.width,height:o.height}}var w=i(l);export{w as default}; diff --git a/plugins/feature/map/Cesium/Workers/incrementallyBuildTerrainPicker.js b/plugins/feature/map/Cesium/Workers/incrementallyBuildTerrainPicker.js new file mode 100644 index 000000000..2287d0a1b --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/incrementallyBuildTerrainPicker.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as y}from"./chunk-JJVL7F22.js";import{a as c}from"./chunk-DV5LK4D5.js";import"./chunk-QQWQKL3T.js";import{b as a}from"./chunk-HLXNFZAZ.js";import"./chunk-23IOGON7.js";import{a as n}from"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";var b=new n,d=new n,A=[new n,new n,new n],x=new c,f=new n(.5,.5,.5),p=new n(-.5,-.5,-.5);function h(e,r){let o=new Float64Array(e.aabbs),g=Array.from({length:4},(t,i)=>{let s=n.unpack(o,i*6,b),B=n.unpack(o,i*6+3,d);return c.fromCorners(s,B,new c)}),w=new Float64Array(e.inverseTransform),T=a.unpack(w,0,new a),u=new Uint32Array(e.triangleIndices),m=new Float64Array(e.trianglePositions),l=Array.from({length:4},()=>[]);for(let t=0;t<u.length;t++){n.unpack(m,t*9,A[0]),n.unpack(m,t*9+3,A[1]),n.unpack(m,t*9+6,A[2]);let i=k(T,A);for(let s=0;s<4;s++)g[s].intersectAxisAlignedBoundingBox(i)&&l[s].push(u[t])}return{intersectingTrianglesArrays:l.map(t=>{let i=new Uint32Array(t);return r.push(i.buffer),i.buffer})}}function k(e,r){a.multiplyByPoint(e,r[0],r[0]),a.multiplyByPoint(e,r[1],r[1]),a.multiplyByPoint(e,r[2],r[2]);let o=c.fromPoints(r,x);return n.clamp(o.minimum,p,f,o.minimum),n.clamp(o.maximum,p,f,o.maximum),o}var P=y(h);export{P as default}; diff --git a/plugins/feature/map/Cesium/Workers/transcodeKTX2.js b/plugins/feature/map/Cesium/Workers/transcodeKTX2.js index 32da9569d..a565e3b65 100644 --- a/plugins/feature/map/Cesium/Workers/transcodeKTX2.js +++ b/plugins/feature/map/Cesium/Workers/transcodeKTX2.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,34 +23,34 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as _n}from"./chunk-U3N6LNE4.js";import{a as M}from"./chunk-OVIPITBL.js";import{a as ie}from"./chunk-SP23RJSN.js";import{b as nn}from"./chunk-ELJAHN3H.js";import{a as Gt,c as ir,d as sr,e as ge}from"./chunk-3BGP4HCL.js";var on=ir((it,Pt)=>{var Nt=function(){var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(i=i||__filename),function(f){f=f||{};var r=typeof f<"u"?f:{},C,l;r.ready=new Promise(function(e,t){C=e,l=t});var p={},F;for(F in r)r.hasOwnProperty(F)&&(p[F]=r[F]);var U=[],y="./this.program",m=function(e,t){throw t},V=!1,d=!1,P=!1,Q=!1;V=typeof window=="object",d=typeof importScripts=="function",P=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Q=!V&&!P&&!d;var u="";function X(e){return r.locateFile?r.locateFile(e,u):u+e}var se,le,W,J,g,Fe;P?(d?u=Gt("path").dirname(u)+"/":u=__dirname+"/",se=function(t,n){return g||(g=Gt("fs")),Fe||(Fe=Gt("path")),t=Fe.normalize(t),g.readFileSync(t,n?null:"utf8")},W=function(t){var n=se(t,!0);return n.buffer||(n=new Uint8Array(n)),Se(n.buffer),n},process.argv.length>1&&(y=process.argv[1].replace(/\\/g,"/")),U=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof _r))throw e}),process.on("unhandledRejection",Me),m=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):Q?(typeof read<"u"&&(se=function(t){return read(t)}),W=function(t){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(t)):(n=read(t,"binary"),Se(typeof n=="object"),n)},typeof scriptArgs<"u"?U=scriptArgs:typeof arguments<"u"&&(U=arguments),typeof quit=="function"&&(m=function(e){quit(e)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(V||d)&&(d?u=self.location.href:typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),i&&(u=i),u.indexOf("blob:")!==0?u=u.substr(0,u.lastIndexOf("/")+1):u="",se=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(W=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),le=function(e,t,n){var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},J=function(e){document.title=e});var st=r.print||console.log.bind(console),ee=r.printErr||console.warn.bind(console);for(F in p)p.hasOwnProperty(F)&&(r[F]=p[F]);p=null,r.arguments&&(U=r.arguments),r.thisProgram&&(y=r.thisProgram),r.quit&&(m=r.quit);var De=0,Ie=function(e){De=e},ae;r.wasmBinary&&(ae=r.wasmBinary);var ot=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Me("no native wasm support detected");var ce,de=!1,be;function Se(e,t){e||Me("Assertion failed: "+t)}var we=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function He(e,t,n){for(var _=t+n,s=t;e[s]&&!(s>=_);)++s;if(s-t>16&&e.subarray&&we)return we.decode(e.subarray(t,s));for(var a="";t<s;){var c=e[t++];if(!(c&128)){a+=String.fromCharCode(c);continue}var o=e[t++]&63;if((c&224)==192){a+=String.fromCharCode((c&31)<<6|o);continue}var R=e[t++]&63;if((c&240)==224?c=(c&15)<<12|o<<6|R:c=(c&7)<<18|o<<12|R<<6|e[t++]&63,c<65536)a+=String.fromCharCode(c);else{var T=c-65536;a+=String.fromCharCode(55296|T>>10,56320|T&1023)}}return a}function Xe(e,t){return e?He(D,e,t):""}function Rt(e,t,n,_){if(!(_>0))return 0;for(var s=n,a=n+_-1,c=0;c<e.length;++c){var o=e.charCodeAt(c);if(o>=55296&&o<=57343){var R=e.charCodeAt(++c);o=65536+((o&1023)<<10)|R&1023}if(o<=127){if(n>=a)break;t[n++]=o}else if(o<=2047){if(n+1>=a)break;t[n++]=192|o>>6,t[n++]=128|o&63}else if(o<=65535){if(n+2>=a)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|o&63}else{if(n+3>=a)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|o&63}}return t[n]=0,n-s}function L(e,t,n){return Rt(e,D,t,n)}function j(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}return t}var Ae=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function at(e,t){for(var n=e,_=n>>1,s=_+t/2;!(_>=s)&&Ge[_];)++_;if(n=_<<1,n-e>32&&Ae)return Ae.decode(D.subarray(e,n));for(var a="",c=0;!(c>=t/2);++c){var o=fe[e+c*2>>1];if(o==0)break;a+=String.fromCharCode(o)}return a}function xe(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var _=t,s=n<e.length*2?n/2:e.length,a=0;a<s;++a){var c=e.charCodeAt(a);fe[t>>1]=c,t+=2}return fe[t>>1]=0,t-_}function fn(e){return e.length*2}function Tn(e,t){for(var n=0,_="";!(n>=t/4);){var s=w[e+n*4>>2];if(s==0)break;if(++n,s>=65536){var a=s-65536;_+=String.fromCharCode(55296|a>>10,56320|a&1023)}else _+=String.fromCharCode(s)}return _}function un(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var _=t,s=_+n-4,a=0;a<e.length;++a){var c=e.charCodeAt(a);if(c>=55296&&c<=57343){var o=e.charCodeAt(++a);c=65536+((c&1023)<<10)|o&1023}if(w[t>>2]=c,t+=4,t+4>s)break}return w[t>>2]=0,t-_}function On(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}return t}function ln(e,t){return e%t>0&&(e+=t-e%t),e}var ct,ke,D,fe,Ge,w,Y,pt,Et;function vt(e){ct=e,r.HEAP8=ke=new Int8Array(e),r.HEAP16=fe=new Int16Array(e),r.HEAP32=w=new Int32Array(e),r.HEAPU8=D=new Uint8Array(e),r.HEAPU16=Ge=new Uint16Array(e),r.HEAPU32=Y=new Uint32Array(e),r.HEAPF32=pt=new Float32Array(e),r.HEAPF64=Et=new Float64Array(e)}var Tr=r.INITIAL_MEMORY||16777216,Ve,ht=[],Ut=[],Mn=[],yt=[],Kn=!1;function Bn(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Sn(r.preRun.shift());$e(ht)}function Cn(){Kn=!0,$e(Ut)}function Fn(){$e(Mn)}function dn(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Vn(r.postRun.shift());$e(yt)}function Sn(e){ht.unshift(e)}function Gn(e){Ut.unshift(e)}function Vn(e){yt.unshift(e)}var Te=0,At=null,Ne=null;function Nn(e){Te++,r.monitorRunDependencies&&r.monitorRunDependencies(Te)}function Pn(e){if(Te--,r.monitorRunDependencies&&r.monitorRunDependencies(Te),Te==0&&(At!==null&&(clearInterval(At),At=null),Ne)){var t=Ne;Ne=null,t()}}r.preloadedImages={},r.preloadedAudios={};function Me(e){r.onAbort&&r.onAbort(e),e+="",ee(e),de=!0,be=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw l(t),t}function gt(e,t){return String.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}var pn="data:application/octet-stream;base64,";function Lt(e){return gt(e,pn)}var En="file://";function mt(e){return gt(e,En)}var x="basis_transcoder.wasm";Lt(x)||(x=X(x));function Dt(e){try{if(e==x&&ae)return new Uint8Array(ae);if(W)return W(e);throw"both async and sync fetching of the wasm failed"}catch(t){Me(t)}}function vn(){if(!ae&&(V||d)){if(typeof fetch=="function"&&!mt(x))return fetch(x,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+x+"'";return e.arrayBuffer()}).catch(function(){return Dt(x)});if(le)return new Promise(function(e,t){le(x,function(n){e(new Uint8Array(n))},t)})}return Promise.resolve().then(function(){return Dt(x)})}function hn(){var e={a:J_};function t(c,o){var R=c.exports;r.asm=R,ce=r.asm.K,vt(ce.buffer),Ve=r.asm.O,Gn(r.asm.L),Pn("wasm-instantiate")}Nn("wasm-instantiate");function n(c){t(c.instance)}function _(c){return vn().then(function(o){var R=WebAssembly.instantiate(o,e);return R}).then(c,function(o){ee("failed to asynchronously prepare wasm: "+o),Me(o)})}function s(){return!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!Lt(x)&&!mt(x)&&typeof fetch=="function"?fetch(x,{credentials:"same-origin"}).then(function(c){var o=WebAssembly.instantiateStreaming(c,e);return o.then(n,function(R){return ee("wasm streaming compile failed: "+R),ee("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{var a=r.instantiateWasm(e,t);return a}catch(c){return ee("Module.instantiateWasm callback failed with error: "+c),!1}return s().catch(l),{}}function $e(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t(r);continue}var n=t.func;typeof n=="number"?t.arg===void 0?Ve.get(n)():Ve.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}var We={};function je(e){for(;e.length;){var t=e.pop(),n=e.pop();n(t)}}function Pe(e){return this.fromWireType(Y[e>>2])}var Ke={},ue={},ze={},Un=48,yn=57;function Ye(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=Un&&t<=yn?"_"+e:e}function qe(e,t){return e=Ye(e),new Function("body","return function "+e+`() { +import{a as on}from"./chunk-JJVL7F22.js";import{a as f}from"./chunk-ZJRS2FK6.js";import{a as se}from"./chunk-23IOGON7.js";import{b as sn}from"./chunk-OU2IPMYE.js";import{a as Vt,c as sr,d as or,f as De}from"./chunk-H7SJWKIY.js";var An=sr((ot,pt)=>{var Pt=(function(){var s=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(s=s||__filename),(function(T){T=T||{};var r=typeof T<"u"?T:{},B,l;r.ready=new Promise(function(e,t){B=e,l=t});var p={},F;for(F in r)r.hasOwnProperty(F)&&(p[F]=r[F]);var D=[],I="./this.program",b=function(e,t){throw t},E=!1,S=!1,V=!1,C=!1;E=typeof window=="object",S=typeof importScripts=="function",V=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",C=!E&&!V&&!S;var d="";function j(e){return r.locateFile?r.locateFile(e,d):d+e}var J,Ae,Y,Fe,de,Ge;V?(S?d=Vt("path").dirname(d)+"/":d=__dirname+"/",J=function(t,n){return de||(de=Vt("fs")),Ge||(Ge=Vt("path")),t=Ge.normalize(t),de.readFileSync(t,n?null:"utf8")},Y=function(t){var n=J(t,!0);return n.buffer||(n=new Uint8Array(n)),Se(n.buffer),n},process.argv.length>1&&(I=process.argv[1].replace(/\\/g,"/")),D=process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof _r))throw e}),process.on("unhandledRejection",Be),b=function(e){process.exit(e)},r.inspect=function(){return"[Emscripten Module object]"}):C?(typeof read<"u"&&(J=function(t){return read(t)}),Y=function(t){var n;return typeof readbuffer=="function"?new Uint8Array(readbuffer(t)):(n=read(t,"binary"),Se(typeof n=="object"),n)},typeof scriptArgs<"u"?D=scriptArgs:typeof arguments<"u"&&(D=arguments),typeof quit=="function"&&(b=function(e){quit(e)}),typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(E||S)&&(S?d=self.location.href:typeof document<"u"&&document.currentScript&&(d=document.currentScript.src),s&&(d=s),d.indexOf("blob:")!==0?d=d.substr(0,d.lastIndexOf("/")+1):d="",J=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},S&&(Y=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Ae=function(e,t,n){var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=function(){if(_.status==200||_.status==0&&_.response){t(_.response);return}n()},_.onerror=n,_.send(null)},Fe=function(e){document.title=e});var it=r.print||console.log.bind(console),oe=r.printErr||console.warn.bind(console);for(F in p)p.hasOwnProperty(F)&&(r[F]=p[F]);p=null,r.arguments&&(D=r.arguments),r.thisProgram&&(I=r.thisProgram),r.quit&&(b=r.quit);var vt=0,we=function(e){vt=e},Oe;r.wasmBinary&&(Oe=r.wasmBinary);var ln=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Be("no native wasm support detected");var le,ie=!1,X;function Se(e,t){e||Be("Assertion failed: "+t)}var He=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ne(e,t,n){for(var _=t+n,o=t;e[o]&&!(o>=_);)++o;if(o-t>16&&e.subarray&&He)return He.decode(e.subarray(t,o));for(var c="";t<o;){var A=e[t++];if(!(A&128)){c+=String.fromCharCode(A);continue}var R=e[t++]&63;if((A&224)==192){c+=String.fromCharCode((A&31)<<6|R);continue}var a=e[t++]&63;if((A&240)==224?A=(A&15)<<12|R<<6|a:A=(A&7)<<18|R<<12|a<<6|e[t++]&63,A<65536)c+=String.fromCharCode(A);else{var u=A-65536;c+=String.fromCharCode(55296|u>>10,56320|u&1023)}}return c}function Ee(e,t){return e?Ne(U,e,t):""}function Xe(e,t,n,_){if(!(_>0))return 0;for(var o=n,c=n+_-1,A=0;A<e.length;++A){var R=e.charCodeAt(A);if(R>=55296&&R<=57343){var a=e.charCodeAt(++A);R=65536+((R&1023)<<10)|a&1023}if(R<=127){if(n>=c)break;t[n++]=R}else if(R<=2047){if(n+1>=c)break;t[n++]=192|R>>6,t[n++]=128|R&63}else if(R<=65535){if(n+2>=c)break;t[n++]=224|R>>12,t[n++]=128|R>>6&63,t[n++]=128|R&63}else{if(n+3>=c)break;t[n++]=240|R>>18,t[n++]=128|R>>12&63,t[n++]=128|R>>6&63,t[n++]=128|R&63}}return t[n]=0,n-o}function Rt(e,t,n){return Xe(e,U,t,n)}function xe(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&(_=65536+((_&1023)<<10)|e.charCodeAt(++n)&1023),_<=127?++t:_<=2047?t+=2:_<=65535?t+=3:t+=4}return t}var Ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function ke(e,t){for(var n=e,_=n>>1,o=_+t/2;!(_>=o)&&Re[_];)++_;if(n=_<<1,n-e>32&&Ve)return Ve.decode(U.subarray(e,n));for(var c="",A=0;!(A>=t/2);++A){var R=ee[e+A*2>>1];if(R==0)break;c+=String.fromCharCode(R)}return c}function $e(e,t,n){if(n===void 0&&(n=2147483647),n<2)return 0;n-=2;for(var _=t,o=n<e.length*2?n/2:e.length,c=0;c<o;++c){var A=e.charCodeAt(c);ee[t>>1]=A,t+=2}return ee[t>>1]=0,t-_}function at(e){return e.length*2}function ct(e,t){for(var n=0,_="";!(n>=t/4);){var o=x[e+n*4>>2];if(o==0)break;if(++n,o>=65536){var c=o-65536;_+=String.fromCharCode(55296|c>>10,56320|c&1023)}else _+=String.fromCharCode(o)}return _}function At(e,t,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var _=t,o=_+n-4,c=0;c<e.length;++c){var A=e.charCodeAt(c);if(A>=55296&&A<=57343){var R=e.charCodeAt(++c);A=65536+((A&1023)<<10)|R&1023}if(x[t>>2]=A,t+=4,t+4>o)break}return x[t>>2]=0,t-_}function Tt(e){for(var t=0,n=0;n<e.length;++n){var _=e.charCodeAt(n);_>=55296&&_<=57343&&++n,t+=4}return t}function ut(e,t){return e%t>0&&(e+=t-e%t),e}var g,L,U,ee,Re,x,q,Ut,ht;function yt(e){g=e,r.HEAP8=L=new Int8Array(e),r.HEAP16=ee=new Int16Array(e),r.HEAP32=x=new Int32Array(e),r.HEAPU8=U=new Uint8Array(e),r.HEAPU16=Re=new Uint16Array(e),r.HEAPU32=q=new Uint32Array(e),r.HEAPF32=Ut=new Float32Array(e),r.HEAPF64=ht=new Float64Array(e)}var ur=r.INITIAL_MEMORY||16777216,Pe,gt=[],Lt=[],Bn=[],mt=[],Mn=!1;function Kn(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)Gn(r.preRun.shift());We(gt)}function Cn(){Mn=!0,We(Lt)}function Fn(){We(Bn)}function dn(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Nn(r.postRun.shift());We(mt)}function Gn(e){gt.unshift(e)}function Sn(e){Lt.unshift(e)}function Nn(e){mt.unshift(e)}var Te=0,ft=null,pe=null;function En(e){Te++,r.monitorRunDependencies&&r.monitorRunDependencies(Te)}function Vn(e){if(Te--,r.monitorRunDependencies&&r.monitorRunDependencies(Te),Te==0&&(ft!==null&&(clearInterval(ft),ft=null),pe)){var t=pe;pe=null,t()}}r.preloadedImages={},r.preloadedAudios={};function Be(e){r.onAbort&&r.onAbort(e),e+="",oe(e),ie=!0,X=1,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw l(t),t}function Dt(e,t){return String.prototype.startsWith?e.startsWith(t):e.indexOf(t)===0}var Pn="data:application/octet-stream;base64,";function It(e){return Dt(e,Pn)}var pn="file://";function bt(e){return Dt(e,pn)}var k="basis_transcoder.wasm";It(k)||(k=j(k));function wt(e){try{if(e==k&&Oe)return new Uint8Array(Oe);if(Y)return Y(e);throw"both async and sync fetching of the wasm failed"}catch(t){Be(t)}}function vn(){if(!Oe&&(E||S)){if(typeof fetch=="function"&&!bt(k))return fetch(k,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+k+"'";return e.arrayBuffer()}).catch(function(){return wt(k)});if(Ae)return new Promise(function(e,t){Ae(k,function(n){e(new Uint8Array(n))},t)})}return Promise.resolve().then(function(){return wt(k)})}function Un(){var e={a:J_};function t(A,R){var a=A.exports;r.asm=a,le=r.asm.K,yt(le.buffer),Pe=r.asm.O,Sn(r.asm.L),Vn("wasm-instantiate")}En("wasm-instantiate");function n(A){t(A.instance)}function _(A){return vn().then(function(R){var a=WebAssembly.instantiate(R,e);return a}).then(A,function(R){oe("failed to asynchronously prepare wasm: "+R),Be(R)})}function o(){return!Oe&&typeof WebAssembly.instantiateStreaming=="function"&&!It(k)&&!bt(k)&&typeof fetch=="function"?fetch(k,{credentials:"same-origin"}).then(function(A){var R=WebAssembly.instantiateStreaming(A,e);return R.then(n,function(a){return oe("wasm streaming compile failed: "+a),oe("falling back to ArrayBuffer instantiation"),_(n)})}):_(n)}if(r.instantiateWasm)try{var c=r.instantiateWasm(e,t);return c}catch(A){return oe("Module.instantiateWasm callback failed with error: "+A),!1}return o().catch(l),{}}function We(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t(r);continue}var n=t.func;typeof n=="number"?t.arg===void 0?Pe.get(n)():Pe.get(n)(t.arg):n(t.arg===void 0?null:t.arg)}}var je={};function Ye(e){for(;e.length;){var t=e.pop(),n=e.pop();n(t)}}function ve(e){return this.fromWireType(q[e>>2])}var Me={},ue={},ze={},hn=48,yn=57;function qe(e){if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=hn&&t<=yn?"_"+e:e}function Ze(e,t){return e=qe(e),new Function("body","return function "+e+`() { "use strict"; return body.apply(this, arguments); }; -`)(t)}function ft(e,t){var n=qe(t,function(_){this.name=t,this.message=_;var s=new Error(_).stack;s!==void 0&&(this.stack=this.toString()+` -`+s.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var It=void 0;function Ze(e){throw new It(e)}function oe(e,t,n){e.forEach(function(o){ze[o]=t});function _(o){var R=n(o);R.length!==e.length&&Ze("Mismatched type converter count");for(var T=0;T<e.length;++T)q(e[T],R[T])}var s=new Array(t.length),a=[],c=0;t.forEach(function(o,R){ue.hasOwnProperty(o)?s[R]=ue[o]:(a.push(o),Ke.hasOwnProperty(o)||(Ke[o]=[]),Ke[o].push(function(){s[R]=ue[o],++c,c===a.length&&_(s)}))}),a.length===0&&_(s)}function gn(e){var t=We[e];delete We[e];var n=t.rawConstructor,_=t.rawDestructor,s=t.fields,a=s.map(function(c){return c.getterReturnType}).concat(s.map(function(c){return c.setterArgumentType}));oe([e],a,function(c){var o={};return s.forEach(function(R,T){var O=R.fieldName,K=c[T],G=R.getter,N=R.getterContext,h=c[T+s.length],I=R.setter,$=R.setterContext;o[O]={read:function(Z){return K.fromWireType(G(N,Z))},write:function(Z,ye){var re=[];I($,Z,h.toWireType(re,ye)),je(re)}}}),[{name:t.name,fromWireType:function(R){var T={};for(var O in o)T[O]=o[O].read(R);return _(R),T},toWireType:function(R,T){for(var O in o)if(!(O in T))throw new TypeError('Missing field: "'+O+'"');var K=n();for(O in o)o[O].write(K,T[O]);return R!==null&&R.push(_,K),K},argPackAdvance:8,readValueFromPointer:Pe,destructorFunction:_}]})}function Qe(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function Ln(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);bt=e}var bt=void 0;function v(e){for(var t="",n=e;D[n];)t+=bt[D[n++]];return t}var Be=void 0;function S(e){throw new Be(e)}function q(e,t,n){if(n=n||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var _=t.name;if(e||S('type "'+_+'" must have a positive integer typeid pointer'),ue.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;S("Cannot register type '"+_+"' twice")}if(ue[e]=t,delete ze[e],Ke.hasOwnProperty(e)){var s=Ke[e];delete Ke[e],s.forEach(function(a){a()})}}function mn(e,t,n,_,s){var a=Qe(n);t=v(t),q(e,{name:t,fromWireType:function(c){return!!c},toWireType:function(c,o){return o?_:s},argPackAdvance:8,readValueFromPointer:function(c){var o;if(n===1)o=ke;else if(n===2)o=fe;else if(n===4)o=w;else throw new TypeError("Unknown boolean type size: "+t);return this.fromWireType(o[c>>a])},destructorFunction:null})}function Dn(e){if(!(this instanceof Re)||!(e instanceof Re))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,_=e.$$.ptrType.registeredClass,s=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;_.baseClass;)s=_.upcast(s),_=_.baseClass;return t===_&&n===s}function In(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function Tt(e){function t(n){return n.$$.ptrType.registeredClass.name}S(t(e)+" instance already deleted")}var ut=!1;function wt(e){}function bn(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function Ht(e){e.count.value-=1;var t=e.count.value===0;t&&bn(e)}function pe(e){return typeof FinalizationGroup>"u"?(pe=function(t){return t},e):(ut=new FinalizationGroup(function(t){for(var n=t.next();!n.done;n=t.next()){var _=n.value;_.ptr?Ht(_):console.warn("object already deleted: "+_.ptr)}}),pe=function(t){return ut.register(t,t.$$,t.$$),t},wt=function(t){ut.unregister(t.$$)},pe(e))}function wn(){if(this.$$.ptr||Tt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=pe(Object.create(Object.getPrototypeOf(this),{$$:{value:In(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Hn(){this.$$.ptr||Tt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&S("Object already scheduled for deletion"),wt(this),Ht(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Xn(){return!this.$$.ptr}var Ee=void 0,ve=[];function Ot(){for(;ve.length;){var e=ve.pop();e.$$.deleteScheduled=!1,e.delete()}}function xn(){return this.$$.ptr||Tt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&S("Object already scheduled for deletion"),ve.push(this),ve.length===1&&Ee&&Ee(Ot),this.$$.deleteScheduled=!0,this}function kn(){Re.prototype.isAliasOf=Dn,Re.prototype.clone=wn,Re.prototype.delete=Hn,Re.prototype.isDeleted=Xn,Re.prototype.deleteLater=xn}function Re(){}var Xt={};function xt(e,t,n){if(e[t].overloadTable===void 0){var _=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||S("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[_.argCount]=_}}function lt(e,t,n){r.hasOwnProperty(e)?((n===void 0||r[e].overloadTable!==void 0&&r[e].overloadTable[n]!==void 0)&&S("Cannot register public name '"+e+"' twice"),xt(r,e,e),r.hasOwnProperty(n)&&S("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),r[e].overloadTable[n]=t):(r[e]=t,n!==void 0&&(r[e].numArguments=n))}function $n(e,t,n,_,s,a,c,o){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=_,this.baseClass=s,this.getActualType=a,this.upcast=c,this.downcast=o,this.pureVirtualFunctions=[]}function Mt(e,t,n){for(;t!==n;)t.upcast||S("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Wn(e,t){if(t===null)return this.isReference&&S("null is not a valid "+this.name),0;t.$$||S('Cannot pass "'+Ce(t)+'" as a '+this.name),t.$$.ptr||S("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass,_=Mt(t.$$.ptr,n,this.registeredClass);return _}function jn(e,t){var n;if(t===null)return this.isReference&&S("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;t.$$||S('Cannot pass "'+Ce(t)+'" as a '+this.name),t.$$.ptr||S("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&S("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var _=t.$$.ptrType.registeredClass;if(n=Mt(t.$$.ptr,_,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&S("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:S("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var s=t.clone();n=this.rawShare(n,ne(function(){s.delete()})),e!==null&&e.push(this.rawDestructor,n)}break;default:S("Unsupporting sharing policy")}return n}function zn(e,t){if(t===null)return this.isReference&&S("null is not a valid "+this.name),0;t.$$||S('Cannot pass "'+Ce(t)+'" as a '+this.name),t.$$.ptr||S("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&S("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass,_=Mt(t.$$.ptr,n,this.registeredClass);return _}function Yn(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function qn(e){this.rawDestructor&&this.rawDestructor(e)}function Zn(e){e!==null&&e.delete()}function kt(e,t,n){if(t===n)return e;if(n.baseClass===void 0)return null;var _=kt(e,t,n.baseClass);return _===null?null:n.downcast(_)}function Qn(){return Object.keys(he).length}function Jn(){var e=[];for(var t in he)he.hasOwnProperty(t)&&e.push(he[t]);return e}function e_(e){Ee=e,ve.length&&Ee&&Ee(Ot)}function t_(){r.getInheritedInstanceCount=Qn,r.getLiveInheritedInstances=Jn,r.flushPendingDeletes=Ot,r.setDelayFunction=e_}var he={};function n_(e,t){for(t===void 0&&S("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function __(e,t){return t=n_(e,t),he[t]}function Je(e,t){(!t.ptrType||!t.ptr)&&Ze("makeClassHandle requires ptr and ptrType");var n=!!t.smartPtrType,_=!!t.smartPtr;return n!==_&&Ze("Both smartPtrType and smartPtr must be specified"),t.count={value:1},pe(Object.create(e,{$$:{value:t}}))}function r_(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=__(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var _=n.clone();return this.destructor(e),_}function s(){return this.isSmartPointer?Je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Je(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=this.registeredClass.getActualType(t),c=Xt[a];if(!c)return s.call(this);var o;this.isConst?o=c.constPointerType:o=c.pointerType;var R=kt(t,this.registeredClass,o.registeredClass);return R===null?s.call(this):this.isSmartPointer?Je(o.registeredClass.instancePrototype,{ptrType:o,ptr:R,smartPtrType:this,smartPtr:e}):Je(o.registeredClass.instancePrototype,{ptrType:o,ptr:R})}function i_(){te.prototype.getPointee=Yn,te.prototype.destructor=qn,te.prototype.argPackAdvance=8,te.prototype.readValueFromPointer=Pe,te.prototype.deleteObject=Zn,te.prototype.fromWireType=r_}function te(e,t,n,_,s,a,c,o,R,T,O){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=_,this.isSmartPointer=s,this.pointeeType=a,this.sharingPolicy=c,this.rawGetPointee=o,this.rawConstructor=R,this.rawShare=T,this.rawDestructor=O,!s&&t.baseClass===void 0?_?(this.toWireType=Wn,this.destructorFunction=null):(this.toWireType=zn,this.destructorFunction=null):this.toWireType=jn}function $t(e,t,n){r.hasOwnProperty(e)||Ze("Replacing nonexistant public symbol"),r[e].overloadTable!==void 0&&n!==void 0?r[e].overloadTable[n]=t:(r[e]=t,r[e].argCount=n)}function s_(e,t,n){var _=r["dynCall_"+e];return n&&n.length?_.apply(null,[t].concat(n)):_.call(null,t)}function o_(e,t,n){return e.indexOf("j")!=-1?s_(e,t,n):Ve.get(t).apply(null,n)}function R_(e,t){var n=[];return function(){n.length=arguments.length;for(var _=0;_<arguments.length;_++)n[_]=arguments[_];return o_(e,t,n)}}function z(e,t){e=v(e);function n(){return e.indexOf("j")!=-1?R_(e,t):Ve.get(t)}var _=n();return typeof _!="function"&&S("unknown function pointer with signature "+e+": "+t),_}var Wt=void 0;function jt(e){var t=Qt(e),n=v(t);return _e(t),n}function et(e,t){var n=[],_={};function s(a){if(!_[a]&&!ue[a]){if(ze[a]){ze[a].forEach(s);return}n.push(a),_[a]=!0}}throw t.forEach(s),new Wt(e+": "+n.map(jt).join([", "]))}function a_(e,t,n,_,s,a,c,o,R,T,O,K,G){O=v(O),a=z(s,a),o&&(o=z(c,o)),T&&(T=z(R,T)),G=z(K,G);var N=Ye(O);lt(N,function(){et("Cannot construct "+O+" due to unbound types",[_])}),oe([e,t,n],_?[_]:[],function(h){h=h[0];var I,$;_?(I=h.registeredClass,$=I.instancePrototype):$=Re.prototype;var Z=qe(N,function(){if(Object.getPrototypeOf(this)!==ye)throw new Be("Use 'new' to construct "+O);if(re.constructor_body===void 0)throw new Be(O+" has no accessible constructor");var tn=re.constructor_body[arguments.length];if(tn===void 0)throw new Be("Tried to invoke ctor of "+O+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(re.constructor_body).toString()+") parameters instead!");return tn.apply(this,arguments)}),ye=Object.create($,{constructor:{value:Z}});Z.prototype=ye;var re=new $n(O,Z,ye,G,I,a,o,T),rr=new te(O,re,!0,!1,!1),Jt=new te(O+"*",re,!1,!1,!1),en=new te(O+" const*",re,!1,!0,!1);return Xt[e]={pointerType:Jt,constPointerType:en},$t(N,Z),[rr,Jt,en]})}function Kt(e,t){for(var n=[],_=0;_<e;_++)n.push(w[(t>>2)+_]);return n}function c_(e,t,n,_,s,a){Se(t>0);var c=Kt(t,n);s=z(_,s);var o=[a],R=[];oe([],[e],function(T){T=T[0];var O="constructor "+T.name;if(T.registeredClass.constructor_body===void 0&&(T.registeredClass.constructor_body=[]),T.registeredClass.constructor_body[t-1]!==void 0)throw new Be("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+T.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return T.registeredClass.constructor_body[t-1]=function(){et("Cannot construct "+T.name+" due to unbound types",c)},oe([],c,function(K){return T.registeredClass.constructor_body[t-1]=function(){arguments.length!==t-1&&S(O+" called with "+arguments.length+" arguments, expected "+(t-1)),R.length=0,o.length=t;for(var N=1;N<t;++N)o[N]=K[N].toWireType(R,arguments[N-1]);var h=s.apply(null,o);return je(R),K[0].fromWireType(h)},[]}),[]})}function zt(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=qe(e.name||"unknownFunctionName",function(){});n.prototype=e.prototype;var _=new n,s=e.apply(_,t);return s instanceof Object?s:_}function Yt(e,t,n,_,s){var a=t.length;a<2&&S("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=t[1]!==null&&n!==null,o=!1,R=1;R<t.length;++R)if(t[R]!==null&&t[R].destructorFunction===void 0){o=!0;break}for(var T=t[0].name!=="void",O="",K="",R=0;R<a-2;++R)O+=(R!==0?", ":"")+"arg"+R,K+=(R!==0?", ":"")+"arg"+R+"Wired";var G="return function "+Ye(e)+"("+O+`) { -if (arguments.length !== `+(a-2)+`) { -throwBindingError('function `+e+" called with ' + arguments.length + ' arguments, expected "+(a-2)+` args!'); +`)(t)}function Ot(e,t){var n=Ze(t,function(_){this.name=t,this.message=_;var o=new Error(_).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var Ht=void 0;function Qe(e){throw new Ht(e)}function ae(e,t,n){e.forEach(function(R){ze[R]=t});function _(R){var a=n(R);a.length!==e.length&&Qe("Mismatched type converter count");for(var u=0;u<e.length;++u)Z(e[u],a[u])}var o=new Array(t.length),c=[],A=0;t.forEach(function(R,a){ue.hasOwnProperty(R)?o[a]=ue[R]:(c.push(R),Me.hasOwnProperty(R)||(Me[R]=[]),Me[R].push(function(){o[a]=ue[R],++A,A===c.length&&_(o)}))}),c.length===0&&_(o)}function gn(e){var t=je[e];delete je[e];var n=t.rawConstructor,_=t.rawDestructor,o=t.fields,c=o.map(function(A){return A.getterReturnType}).concat(o.map(function(A){return A.setterArgumentType}));ae([e],c,function(A){var R={};return o.forEach(function(a,u){var O=a.fieldName,M=A[u],N=a.getter,P=a.getterContext,m=A[u+o.length],w=a.setter,W=a.setterContext;R[O]={read:function(Q){return M.fromWireType(N(P,Q))},write:function(Q,me){var re=[];w(W,Q,m.toWireType(re,me)),Ye(re)}}}),[{name:t.name,fromWireType:function(a){var u={};for(var O in R)u[O]=R[O].read(a);return _(a),u},toWireType:function(a,u){for(var O in R)if(!(O in u))throw new TypeError('Missing field: "'+O+'"');var M=n();for(O in R)R[O].write(M,u[O]);return a!==null&&a.push(_,M),M},argPackAdvance:8,readValueFromPointer:ve,destructorFunction:_}]})}function Je(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function Ln(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Xt=e}var Xt=void 0;function h(e){for(var t="",n=e;U[n];)t+=Xt[U[n++]];return t}var Ke=void 0;function G(e){throw new Ke(e)}function Z(e,t,n){if(n=n||{},!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var _=t.name;if(e||G('type "'+_+'" must have a positive integer typeid pointer'),ue.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;G("Cannot register type '"+_+"' twice")}if(ue[e]=t,delete ze[e],Me.hasOwnProperty(e)){var o=Me[e];delete Me[e],o.forEach(function(c){c()})}}function mn(e,t,n,_,o){var c=Je(n);t=h(t),Z(e,{name:t,fromWireType:function(A){return!!A},toWireType:function(A,R){return R?_:o},argPackAdvance:8,readValueFromPointer:function(A){var R;if(n===1)R=L;else if(n===2)R=ee;else if(n===4)R=x;else throw new TypeError("Unknown boolean type size: "+t);return this.fromWireType(R[A>>c])},destructorFunction:null})}function Dn(e){if(!(this instanceof ce)||!(e instanceof ce))return!1;for(var t=this.$$.ptrType.registeredClass,n=this.$$.ptr,_=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;_.baseClass;)o=_.upcast(o),_=_.baseClass;return t===_&&n===o}function In(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function lt(e){function t(n){return n.$$.ptrType.registeredClass.name}G(t(e)+" instance already deleted")}var Bt=!1;function xt(e){}function bn(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function kt(e){e.count.value-=1;var t=e.count.value===0;t&&bn(e)}function Ue(e){return typeof FinalizationGroup>"u"?(Ue=function(t){return t},e):(Bt=new FinalizationGroup(function(t){for(var n=t.next();!n.done;n=t.next()){var _=n.value;_.ptr?kt(_):console.warn("object already deleted: "+_.ptr)}}),Ue=function(t){return Bt.register(t,t.$$,t.$$),t},xt=function(t){Bt.unregister(t.$$)},Ue(e))}function wn(){if(this.$$.ptr||lt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Ue(Object.create(Object.getPrototypeOf(this),{$$:{value:In(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Hn(){this.$$.ptr||lt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&G("Object already scheduled for deletion"),xt(this),kt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Xn(){return!this.$$.ptr}var he=void 0,ye=[];function Mt(){for(;ye.length;){var e=ye.pop();e.$$.deleteScheduled=!1,e.delete()}}function xn(){return this.$$.ptr||lt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&G("Object already scheduled for deletion"),ye.push(this),ye.length===1&&he&&he(Mt),this.$$.deleteScheduled=!0,this}function kn(){ce.prototype.isAliasOf=Dn,ce.prototype.clone=wn,ce.prototype.delete=Hn,ce.prototype.isDeleted=Xn,ce.prototype.deleteLater=xn}function ce(){}var $t={};function Wt(e,t,n){if(e[t].overloadTable===void 0){var _=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||G("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[_.argCount]=_}}function Kt(e,t,n){r.hasOwnProperty(e)?((n===void 0||r[e].overloadTable!==void 0&&r[e].overloadTable[n]!==void 0)&&G("Cannot register public name '"+e+"' twice"),Wt(r,e,e),r.hasOwnProperty(n)&&G("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),r[e].overloadTable[n]=t):(r[e]=t,n!==void 0&&(r[e].numArguments=n))}function $n(e,t,n,_,o,c,A,R){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=_,this.baseClass=o,this.getActualType=c,this.upcast=A,this.downcast=R,this.pureVirtualFunctions=[]}function Ct(e,t,n){for(;t!==n;)t.upcast||G("Expected null or instance of "+n.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Wn(e,t){if(t===null)return this.isReference&&G("null is not a valid "+this.name),0;t.$$||G('Cannot pass "'+Ce(t)+'" as a '+this.name),t.$$.ptr||G("Cannot pass deleted object as a pointer of type "+this.name);var n=t.$$.ptrType.registeredClass,_=Ct(t.$$.ptr,n,this.registeredClass);return _}function jn(e,t){var n;if(t===null)return this.isReference&&G("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;t.$$||G('Cannot pass "'+Ce(t)+'" as a '+this.name),t.$$.ptr||G("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&G("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var _=t.$$.ptrType.registeredClass;if(n=Ct(t.$$.ptr,_,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&G("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:G("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var o=t.clone();n=this.rawShare(n,ne(function(){o.delete()})),e!==null&&e.push(this.rawDestructor,n)}break;default:G("Unsupporting sharing policy")}return n}function Yn(e,t){if(t===null)return this.isReference&&G("null is not a valid "+this.name),0;t.$$||G('Cannot pass "'+Ce(t)+'" as a '+this.name),t.$$.ptr||G("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&G("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass,_=Ct(t.$$.ptr,n,this.registeredClass);return _}function zn(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function qn(e){this.rawDestructor&&this.rawDestructor(e)}function Zn(e){e!==null&&e.delete()}function jt(e,t,n){if(t===n)return e;if(n.baseClass===void 0)return null;var _=jt(e,t,n.baseClass);return _===null?null:n.downcast(_)}function Qn(){return Object.keys(ge).length}function Jn(){var e=[];for(var t in ge)ge.hasOwnProperty(t)&&e.push(ge[t]);return e}function e_(e){he=e,ye.length&&he&&he(Mt)}function t_(){r.getInheritedInstanceCount=Qn,r.getLiveInheritedInstances=Jn,r.flushPendingDeletes=Mt,r.setDelayFunction=e_}var ge={};function n_(e,t){for(t===void 0&&G("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function __(e,t){return t=n_(e,t),ge[t]}function et(e,t){(!t.ptrType||!t.ptr)&&Qe("makeClassHandle requires ptr and ptrType");var n=!!t.smartPtrType,_=!!t.smartPtr;return n!==_&&Qe("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ue(Object.create(e,{$$:{value:t}}))}function r_(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=__(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var _=n.clone();return this.destructor(e),_}function o(){return this.isSmartPointer?et(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):et(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var c=this.registeredClass.getActualType(t),A=$t[c];if(!A)return o.call(this);var R;this.isConst?R=A.constPointerType:R=A.pointerType;var a=jt(t,this.registeredClass,R.registeredClass);return a===null?o.call(this):this.isSmartPointer?et(R.registeredClass.instancePrototype,{ptrType:R,ptr:a,smartPtrType:this,smartPtr:e}):et(R.registeredClass.instancePrototype,{ptrType:R,ptr:a})}function s_(){te.prototype.getPointee=zn,te.prototype.destructor=qn,te.prototype.argPackAdvance=8,te.prototype.readValueFromPointer=ve,te.prototype.deleteObject=Zn,te.prototype.fromWireType=r_}function te(e,t,n,_,o,c,A,R,a,u,O){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=_,this.isSmartPointer=o,this.pointeeType=c,this.sharingPolicy=A,this.rawGetPointee=R,this.rawConstructor=a,this.rawShare=u,this.rawDestructor=O,!o&&t.baseClass===void 0?_?(this.toWireType=Wn,this.destructorFunction=null):(this.toWireType=Yn,this.destructorFunction=null):this.toWireType=jn}function Yt(e,t,n){r.hasOwnProperty(e)||Qe("Replacing nonexistant public symbol"),r[e].overloadTable!==void 0&&n!==void 0?r[e].overloadTable[n]=t:(r[e]=t,r[e].argCount=n)}function o_(e,t,n){var _=r["dynCall_"+e];return n&&n.length?_.apply(null,[t].concat(n)):_.call(null,t)}function i_(e,t,n){return e.indexOf("j")!=-1?o_(e,t,n):Pe.get(t).apply(null,n)}function R_(e,t){var n=[];return function(){n.length=arguments.length;for(var _=0;_<arguments.length;_++)n[_]=arguments[_];return i_(e,t,n)}}function z(e,t){e=h(e);function n(){return e.indexOf("j")!=-1?R_(e,t):Pe.get(t)}var _=n();return typeof _!="function"&&G("unknown function pointer with signature "+e+": "+t),_}var zt=void 0;function qt(e){var t=tn(e),n=h(t);return _e(t),n}function tt(e,t){var n=[],_={};function o(c){if(!_[c]&&!ue[c]){if(ze[c]){ze[c].forEach(o);return}n.push(c),_[c]=!0}}throw t.forEach(o),new zt(e+": "+n.map(qt).join([", "]))}function a_(e,t,n,_,o,c,A,R,a,u,O,M,N){O=h(O),c=z(o,c),R&&(R=z(A,R)),u&&(u=z(a,u)),N=z(M,N);var P=qe(O);Kt(P,function(){tt("Cannot construct "+O+" due to unbound types",[_])}),ae([e,t,n],_?[_]:[],function(m){m=m[0];var w,W;_?(w=m.registeredClass,W=w.instancePrototype):W=ce.prototype;var Q=Ze(P,function(){if(Object.getPrototypeOf(this)!==me)throw new Ke("Use 'new' to construct "+O);if(re.constructor_body===void 0)throw new Ke(O+" has no accessible constructor");var rn=re.constructor_body[arguments.length];if(rn===void 0)throw new Ke("Tried to invoke ctor of "+O+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(re.constructor_body).toString()+") parameters instead!");return rn.apply(this,arguments)}),me=Object.create(W,{constructor:{value:Q}});Q.prototype=me;var re=new $n(O,Q,me,N,w,c,R,u),rr=new te(O,re,!0,!1,!1),nn=new te(O+"*",re,!1,!1,!1),_n=new te(O+" const*",re,!1,!0,!1);return $t[e]={pointerType:nn,constPointerType:_n},Yt(P,Q),[rr,nn,_n]})}function Ft(e,t){for(var n=[],_=0;_<e;_++)n.push(x[(t>>2)+_]);return n}function c_(e,t,n,_,o,c){Se(t>0);var A=Ft(t,n);o=z(_,o);var R=[c],a=[];ae([],[e],function(u){u=u[0];var O="constructor "+u.name;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[t-1]!==void 0)throw new Ke("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+u.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return u.registeredClass.constructor_body[t-1]=function(){tt("Cannot construct "+u.name+" due to unbound types",A)},ae([],A,function(M){return u.registeredClass.constructor_body[t-1]=function(){arguments.length!==t-1&&G(O+" called with "+arguments.length+" arguments, expected "+(t-1)),a.length=0,R.length=t;for(var P=1;P<t;++P)R[P]=M[P].toWireType(a,arguments[P-1]);var m=o.apply(null,R);return Ye(a),M[0].fromWireType(m)},[]}),[]})}function Zt(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=Ze(e.name||"unknownFunctionName",function(){});n.prototype=e.prototype;var _=new n,o=e.apply(_,t);return o instanceof Object?o:_}function Qt(e,t,n,_,o){var c=t.length;c<2&&G("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var A=t[1]!==null&&n!==null,R=!1,a=1;a<t.length;++a)if(t[a]!==null&&t[a].destructorFunction===void 0){R=!0;break}for(var u=t[0].name!=="void",O="",M="",a=0;a<c-2;++a)O+=(a!==0?", ":"")+"arg"+a,M+=(a!==0?", ":"")+"arg"+a+"Wired";var N="return function "+qe(e)+"("+O+`) { +if (arguments.length !== `+(c-2)+`) { +throwBindingError('function `+e+" called with ' + arguments.length + ' arguments, expected "+(c-2)+` args!'); } -`;o&&(G+=`var destructors = []; -`);var N=o?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],I=[S,_,s,je,t[0],t[1]];c&&(G+="var thisWired = classParam.toWireType("+N+`, this); -`);for(var R=0;R<a-2;++R)G+="var arg"+R+"Wired = argType"+R+".toWireType("+N+", arg"+R+"); // "+t[R+2].name+` -`,h.push("argType"+R),I.push(t[R+2]);if(c&&(K="thisWired"+(K.length>0?", ":"")+K),G+=(T?"var rv = ":"")+"invoker(fn"+(K.length>0?", ":"")+K+`); -`,o)G+=`runDestructors(destructors); -`;else for(var R=c?1:2;R<t.length;++R){var $=R===1?"thisWired":"arg"+(R-2)+"Wired";t[R].destructorFunction!==null&&(G+=$+"_dtor("+$+"); // "+t[R].name+` -`,h.push($+"_dtor"),I.push(t[R].destructorFunction))}T&&(G+=`var ret = retType.fromWireType(rv); +`;R&&(N+=`var destructors = []; +`);var P=R?"destructors":"null",m=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],w=[G,_,o,Ye,t[0],t[1]];A&&(N+="var thisWired = classParam.toWireType("+P+`, this); +`);for(var a=0;a<c-2;++a)N+="var arg"+a+"Wired = argType"+a+".toWireType("+P+", arg"+a+"); // "+t[a+2].name+` +`,m.push("argType"+a),w.push(t[a+2]);if(A&&(M="thisWired"+(M.length>0?", ":"")+M),N+=(u?"var rv = ":"")+"invoker(fn"+(M.length>0?", ":"")+M+`); +`,R)N+=`runDestructors(destructors); +`;else for(var a=A?1:2;a<t.length;++a){var W=a===1?"thisWired":"arg"+(a-2)+"Wired";t[a].destructorFunction!==null&&(N+=W+"_dtor("+W+"); // "+t[a].name+` +`,m.push(W+"_dtor"),w.push(t[a].destructorFunction))}u&&(N+=`var ret = retType.fromWireType(rv); return ret; -`),G+=`} -`,h.push(G);var Z=zt(Function,h).apply(null,I);return Z}function A_(e,t,n,_,s,a,c,o){var R=Kt(n,_);t=v(t),a=z(s,a),oe([],[e],function(T){T=T[0];var O=T.name+"."+t;o&&T.registeredClass.pureVirtualFunctions.push(t);function K(){et("Cannot call "+O+" due to unbound types",R)}var G=T.registeredClass.instancePrototype,N=G[t];return N===void 0||N.overloadTable===void 0&&N.className!==T.name&&N.argCount===n-2?(K.argCount=n-2,K.className=T.name,G[t]=K):(xt(G,t,O),G[t].overloadTable[n-2]=K),oe([],R,function(h){var I=Yt(O,h,T,a,c);return G[t].overloadTable===void 0?(I.argCount=n-2,G[t]=I):G[t].overloadTable[n-2]=I,[]}),[]})}function f_(e,t,n){e=v(e),oe([],[t],function(_){return _=_[0],r[e]=_.fromWireType(n),[]})}var Bt=[],k=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ct(e){e>4&&--k[e].refcount===0&&(k[e]=void 0,Bt.push(e))}function T_(){for(var e=0,t=5;t<k.length;++t)k[t]!==void 0&&++e;return e}function u_(){for(var e=5;e<k.length;++e)if(k[e]!==void 0)return k[e];return null}function O_(){r.count_emval_handles=T_,r.get_first_emval=u_}function ne(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:{var t=Bt.length?Bt.pop():k.length;return k[t]={refcount:1,value:e},t}}}function l_(e,t){t=v(t),q(e,{name:t,fromWireType:function(n){var _=k[n].value;return Ct(n),_},toWireType:function(n,_){return ne(_)},argPackAdvance:8,readValueFromPointer:Pe,destructorFunction:null})}function M_(e,t,n){switch(t){case 0:return function(_){var s=n?ke:D;return this.fromWireType(s[_])};case 1:return function(_){var s=n?fe:Ge;return this.fromWireType(s[_>>1])};case 2:return function(_){var s=n?w:Y;return this.fromWireType(s[_>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function K_(e,t,n,_){var s=Qe(n);t=v(t);function a(){}a.values={},q(e,{name:t,constructor:a,fromWireType:function(c){return this.constructor.values[c]},toWireType:function(c,o){return o.value},argPackAdvance:8,readValueFromPointer:M_(t,s,_),destructorFunction:null}),lt(t,a)}function tt(e,t){var n=ue[e];return n===void 0&&S(t+" has unknown type "+jt(e)),n}function B_(e,t,n){var _=tt(e,"enum");t=v(t);var s=_.constructor,a=Object.create(_.constructor.prototype,{value:{value:n},constructor:{value:qe(_.name+"_"+t,function(){})}});s.values[n]=a,s[t]=a}function Ce(e){if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e}function C_(e,t){switch(t){case 2:return function(n){return this.fromWireType(pt[n>>2])};case 3:return function(n){return this.fromWireType(Et[n>>3])};default:throw new TypeError("Unknown float type: "+e)}}function F_(e,t,n){var _=Qe(n);t=v(t),q(e,{name:t,fromWireType:function(s){return s},toWireType:function(s,a){if(typeof a!="number"&&typeof a!="boolean")throw new TypeError('Cannot convert "'+Ce(a)+'" to '+this.name);return a},argPackAdvance:8,readValueFromPointer:C_(t,_),destructorFunction:null})}function d_(e,t,n,_,s,a){var c=Kt(t,n);e=v(e),s=z(_,s),lt(e,function(){et("Cannot call "+e+" due to unbound types",c)},t-1),oe([],c,function(o){var R=[o[0],null].concat(o.slice(1));return $t(e,Yt(e,R,null,s,a),t-1),[]})}function S_(e,t,n){switch(t){case 0:return n?function(s){return ke[s]}:function(s){return D[s]};case 1:return n?function(s){return fe[s>>1]}:function(s){return Ge[s>>1]};case 2:return n?function(s){return w[s>>2]}:function(s){return Y[s>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function G_(e,t,n,_,s){t=v(t),s===-1&&(s=4294967295);var a=Qe(n),c=function(T){return T};if(_===0){var o=32-8*n;c=function(T){return T<<o>>>o}}var R=t.indexOf("unsigned")!=-1;q(e,{name:t,fromWireType:c,toWireType:function(T,O){if(typeof O!="number"&&typeof O!="boolean")throw new TypeError('Cannot convert "'+Ce(O)+'" to '+this.name);if(O<_||O>s)throw new TypeError('Passing a number "'+Ce(O)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+_+", "+s+"]!");return R?O>>>0:O|0},argPackAdvance:8,readValueFromPointer:S_(t,a,_!==0),destructorFunction:null})}function V_(e,t,n){var _=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],s=_[t];function a(c){c=c>>2;var o=Y,R=o[c],T=o[c+1];return new s(ct,T,R)}n=v(n),q(e,{name:n,fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})}function N_(e,t){t=v(t);var n=t==="std::string";q(e,{name:t,fromWireType:function(_){var s=Y[_>>2],a;if(n)for(var c=_+4,o=0;o<=s;++o){var R=_+4+o;if(o==s||D[R]==0){var T=R-c,O=Xe(c,T);a===void 0?a=O:(a+="\0",a+=O),c=R+1}}else{for(var K=new Array(s),o=0;o<s;++o)K[o]=String.fromCharCode(D[_+4+o]);a=K.join("")}return _e(_),a},toWireType:function(_,s){s instanceof ArrayBuffer&&(s=new Uint8Array(s));var a,c=typeof s=="string";c||s instanceof Uint8Array||s instanceof Uint8ClampedArray||s instanceof Int8Array||S("Cannot pass non-string to std::string"),n&&c?a=function(){return j(s)}:a=function(){return s.length};var o=a(),R=dt(4+o+1);if(Y[R>>2]=o,n&&c)L(s,R+4,o+1);else if(c)for(var T=0;T<o;++T){var O=s.charCodeAt(T);O>255&&(_e(R),S("String has UTF-16 code units that do not fit in 8 bits")),D[R+4+T]=O}else for(var T=0;T<o;++T)D[R+4+T]=s[T];return _!==null&&_.push(_e,R),R},argPackAdvance:8,readValueFromPointer:Pe,destructorFunction:function(_){_e(_)}})}function P_(e,t,n){n=v(n);var _,s,a,c,o;t===2?(_=at,s=xe,c=fn,a=function(){return Ge},o=1):t===4&&(_=Tn,s=un,c=On,a=function(){return Y},o=2),q(e,{name:n,fromWireType:function(R){for(var T=Y[R>>2],O=a(),K,G=R+4,N=0;N<=T;++N){var h=R+4+N*t;if(N==T||O[h>>o]==0){var I=h-G,$=_(G,I);K===void 0?K=$:(K+="\0",K+=$),G=h+t}}return _e(R),K},toWireType:function(R,T){typeof T!="string"&&S("Cannot pass non-string to C++ string type "+n);var O=c(T),K=dt(4+O+t);return Y[K>>2]=O>>o,s(T,K+4,O+t),R!==null&&R.push(_e,K),K},argPackAdvance:8,readValueFromPointer:Pe,destructorFunction:function(R){_e(R)}})}function p_(e,t,n,_,s,a){We[e]={name:v(t),rawConstructor:z(n,_),rawDestructor:z(s,a),fields:[]}}function E_(e,t,n,_,s,a,c,o,R,T){We[e].fields.push({fieldName:v(t),getterReturnType:n,getter:z(_,s),getterContext:a,setterArgumentType:c,setter:z(o,R),setterContext:T})}function v_(e,t){t=v(t),q(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:function(){},toWireType:function(n,_){}})}function Ue(e){return e||S("Cannot use deleted val. handle = "+e),k[e].value}function h_(e,t,n){e=Ue(e),t=tt(t,"emval::as");var _=[],s=ne(_);return w[n>>2]=s,t.toWireType(_,e)}var U_={};function nt(e){var t=U_[e];return t===void 0?v(e):t}var Ft=[];function y_(e,t,n,_){e=Ft[e],t=Ue(t),n=nt(n),e(t,n,null,_)}function qt(){return typeof globalThis=="object"?globalThis:function(){return Function}()("return this")()}function g_(e){return e===0?ne(qt()):(e=nt(e),ne(qt()[e]))}function L_(e){var t=Ft.length;return Ft.push(e),t}function m_(e,t){for(var n=new Array(e),_=0;_<e;++_)n[_]=tt(w[(t>>2)+_],"parameter "+_);return n}function D_(e,t){for(var n=m_(e,t),_=n[0],s=_.name+"_$"+n.slice(1).map(function(N){return N.name}).join("_")+"$",a=["retType"],c=[_],o="",R=0;R<e-1;++R)o+=(R!==0?", ":"")+"arg"+R,a.push("argType"+R),c.push(n[1+R]);for(var T=Ye("methodCaller_"+s),O="return function "+T+`(handle, name, destructors, args) { -`,K=0,R=0;R<e-1;++R)O+=" var arg"+R+" = argType"+R+".readValueFromPointer(args"+(K?"+"+K:"")+`); -`,K+=n[R+1].argPackAdvance;O+=" var rv = handle[name]("+o+`); -`;for(var R=0;R<e-1;++R)n[R+1].deleteObject&&(O+=" argType"+R+".deleteObject(arg"+R+`); +`),N+=`} +`,m.push(N);var Q=Zt(Function,m).apply(null,w);return Q}function A_(e,t,n,_,o,c,A,R){var a=Ft(n,_);t=h(t),c=z(o,c),ae([],[e],function(u){u=u[0];var O=u.name+"."+t;R&&u.registeredClass.pureVirtualFunctions.push(t);function M(){tt("Cannot call "+O+" due to unbound types",a)}var N=u.registeredClass.instancePrototype,P=N[t];return P===void 0||P.overloadTable===void 0&&P.className!==u.name&&P.argCount===n-2?(M.argCount=n-2,M.className=u.name,N[t]=M):(Wt(N,t,O),N[t].overloadTable[n-2]=M),ae([],a,function(m){var w=Qt(O,m,u,c,A);return N[t].overloadTable===void 0?(w.argCount=n-2,N[t]=w):N[t].overloadTable[n-2]=w,[]}),[]})}function T_(e,t,n){e=h(e),ae([],[t],function(_){return _=_[0],r[e]=_.fromWireType(n),[]})}var dt=[],$=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Gt(e){e>4&&--$[e].refcount===0&&($[e]=void 0,dt.push(e))}function u_(){for(var e=0,t=5;t<$.length;++t)$[t]!==void 0&&++e;return e}function f_(){for(var e=5;e<$.length;++e)if($[e]!==void 0)return $[e];return null}function O_(){r.count_emval_handles=u_,r.get_first_emval=f_}function ne(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:{var t=dt.length?dt.pop():$.length;return $[t]={refcount:1,value:e},t}}}function l_(e,t){t=h(t),Z(e,{name:t,fromWireType:function(n){var _=$[n].value;return Gt(n),_},toWireType:function(n,_){return ne(_)},argPackAdvance:8,readValueFromPointer:ve,destructorFunction:null})}function B_(e,t,n){switch(t){case 0:return function(_){var o=n?L:U;return this.fromWireType(o[_])};case 1:return function(_){var o=n?ee:Re;return this.fromWireType(o[_>>1])};case 2:return function(_){var o=n?x:q;return this.fromWireType(o[_>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function M_(e,t,n,_){var o=Je(n);t=h(t);function c(){}c.values={},Z(e,{name:t,constructor:c,fromWireType:function(A){return this.constructor.values[A]},toWireType:function(A,R){return R.value},argPackAdvance:8,readValueFromPointer:B_(t,o,_),destructorFunction:null}),Kt(t,c)}function nt(e,t){var n=ue[e];return n===void 0&&G(t+" has unknown type "+qt(e)),n}function K_(e,t,n){var _=nt(e,"enum");t=h(t);var o=_.constructor,c=Object.create(_.constructor.prototype,{value:{value:n},constructor:{value:Ze(_.name+"_"+t,function(){})}});o.values[n]=c,o[t]=c}function Ce(e){if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e}function C_(e,t){switch(t){case 2:return function(n){return this.fromWireType(Ut[n>>2])};case 3:return function(n){return this.fromWireType(ht[n>>3])};default:throw new TypeError("Unknown float type: "+e)}}function F_(e,t,n){var _=Je(n);t=h(t),Z(e,{name:t,fromWireType:function(o){return o},toWireType:function(o,c){if(typeof c!="number"&&typeof c!="boolean")throw new TypeError('Cannot convert "'+Ce(c)+'" to '+this.name);return c},argPackAdvance:8,readValueFromPointer:C_(t,_),destructorFunction:null})}function d_(e,t,n,_,o,c){var A=Ft(t,n);e=h(e),o=z(_,o),Kt(e,function(){tt("Cannot call "+e+" due to unbound types",A)},t-1),ae([],A,function(R){var a=[R[0],null].concat(R.slice(1));return Yt(e,Qt(e,a,null,o,c),t-1),[]})}function G_(e,t,n){switch(t){case 0:return n?function(o){return L[o]}:function(o){return U[o]};case 1:return n?function(o){return ee[o>>1]}:function(o){return Re[o>>1]};case 2:return n?function(o){return x[o>>2]}:function(o){return q[o>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function S_(e,t,n,_,o){t=h(t),o===-1&&(o=4294967295);var c=Je(n),A=function(u){return u};if(_===0){var R=32-8*n;A=function(u){return u<<R>>>R}}var a=t.indexOf("unsigned")!=-1;Z(e,{name:t,fromWireType:A,toWireType:function(u,O){if(typeof O!="number"&&typeof O!="boolean")throw new TypeError('Cannot convert "'+Ce(O)+'" to '+this.name);if(O<_||O>o)throw new TypeError('Passing a number "'+Ce(O)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+_+", "+o+"]!");return a?O>>>0:O|0},argPackAdvance:8,readValueFromPointer:G_(t,c,_!==0),destructorFunction:null})}function N_(e,t,n){var _=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=_[t];function c(A){A=A>>2;var R=q,a=R[A],u=R[A+1];return new o(g,u,a)}n=h(n),Z(e,{name:n,fromWireType:c,argPackAdvance:8,readValueFromPointer:c},{ignoreDuplicateRegistrations:!0})}function E_(e,t){t=h(t);var n=t==="std::string";Z(e,{name:t,fromWireType:function(_){var o=q[_>>2],c;if(n)for(var A=_+4,R=0;R<=o;++R){var a=_+4+R;if(R==o||U[a]==0){var u=a-A,O=Ee(A,u);c===void 0?c=O:(c+="\0",c+=O),A=a+1}}else{for(var M=new Array(o),R=0;R<o;++R)M[R]=String.fromCharCode(U[_+4+R]);c=M.join("")}return _e(_),c},toWireType:function(_,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var c,A=typeof o=="string";A||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||G("Cannot pass non-string to std::string"),n&&A?c=function(){return xe(o)}:c=function(){return o.length};var R=c(),a=Nt(4+R+1);if(q[a>>2]=R,n&&A)Rt(o,a+4,R+1);else if(A)for(var u=0;u<R;++u){var O=o.charCodeAt(u);O>255&&(_e(a),G("String has UTF-16 code units that do not fit in 8 bits")),U[a+4+u]=O}else for(var u=0;u<R;++u)U[a+4+u]=o[u];return _!==null&&_.push(_e,a),a},argPackAdvance:8,readValueFromPointer:ve,destructorFunction:function(_){_e(_)}})}function V_(e,t,n){n=h(n);var _,o,c,A,R;t===2?(_=ke,o=$e,A=at,c=function(){return Re},R=1):t===4&&(_=ct,o=At,A=Tt,c=function(){return q},R=2),Z(e,{name:n,fromWireType:function(a){for(var u=q[a>>2],O=c(),M,N=a+4,P=0;P<=u;++P){var m=a+4+P*t;if(P==u||O[m>>R]==0){var w=m-N,W=_(N,w);M===void 0?M=W:(M+="\0",M+=W),N=m+t}}return _e(a),M},toWireType:function(a,u){typeof u!="string"&&G("Cannot pass non-string to C++ string type "+n);var O=A(u),M=Nt(4+O+t);return q[M>>2]=O>>R,o(u,M+4,O+t),a!==null&&a.push(_e,M),M},argPackAdvance:8,readValueFromPointer:ve,destructorFunction:function(a){_e(a)}})}function P_(e,t,n,_,o,c){je[e]={name:h(t),rawConstructor:z(n,_),rawDestructor:z(o,c),fields:[]}}function p_(e,t,n,_,o,c,A,R,a,u){je[e].fields.push({fieldName:h(t),getterReturnType:n,getter:z(_,o),getterContext:c,setterArgumentType:A,setter:z(R,a),setterContext:u})}function v_(e,t){t=h(t),Z(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:function(){},toWireType:function(n,_){}})}function Le(e){return e||G("Cannot use deleted val. handle = "+e),$[e].value}function U_(e,t,n){e=Le(e),t=nt(t,"emval::as");var _=[],o=ne(_);return x[n>>2]=o,t.toWireType(_,e)}var h_={};function _t(e){var t=h_[e];return t===void 0?h(e):t}var St=[];function y_(e,t,n,_){e=St[e],t=Le(t),n=_t(n),e(t,n,null,_)}function Jt(){return typeof globalThis=="object"?globalThis:(function(){return Function})()("return this")()}function g_(e){return e===0?ne(Jt()):(e=_t(e),ne(Jt()[e]))}function L_(e){var t=St.length;return St.push(e),t}function m_(e,t){for(var n=new Array(e),_=0;_<e;++_)n[_]=nt(x[(t>>2)+_],"parameter "+_);return n}function D_(e,t){for(var n=m_(e,t),_=n[0],o=_.name+"_$"+n.slice(1).map(function(P){return P.name}).join("_")+"$",c=["retType"],A=[_],R="",a=0;a<e-1;++a)R+=(a!==0?", ":"")+"arg"+a,c.push("argType"+a),A.push(n[1+a]);for(var u=qe("methodCaller_"+o),O="return function "+u+`(handle, name, destructors, args) { +`,M=0,a=0;a<e-1;++a)O+=" var arg"+a+" = argType"+a+".readValueFromPointer(args"+(M?"+"+M:"")+`); +`,M+=n[a+1].argPackAdvance;O+=" var rv = handle[name]("+R+`); +`;for(var a=0;a<e-1;++a)n[a+1].deleteObject&&(O+=" argType"+a+".deleteObject(arg"+a+`); `);_.isVoid||(O+=` return retType.toWireType(destructors, rv); `),O+=`}; -`,a.push(O);var G=zt(Function,a).apply(null,c);return L_(G)}function I_(e){return e=nt(e),ne(r[e])}function b_(e,t){return e=Ue(e),t=Ue(t),ne(e[t])}function w_(e){e>4&&(k[e].refcount+=1)}function H_(e){for(var t="",n=0;n<e;++n)t+=(n!==0?", ":"")+"arg"+n;for(var _="return function emval_allocator_"+e+`(constructor, argTypes, args) { +`,c.push(O);var N=Zt(Function,c).apply(null,A);return L_(N)}function I_(e){return e=_t(e),ne(r[e])}function b_(e,t){return e=Le(e),t=Le(t),ne(e[t])}function w_(e){e>4&&($[e].refcount+=1)}function H_(e){for(var t="",n=0;n<e;++n)t+=(n!==0?", ":"")+"arg"+n;for(var _="return function emval_allocator_"+e+`(constructor, argTypes, args) { `,n=0;n<e;++n)_+="var argType"+n+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+n+'], "parameter '+n+`"); var arg`+n+" = argType"+n+`.readValueFromPointer(args); args += argType`+n+`['argPackAdvance']; `;return _+="var obj = new constructor("+t+`); return __emval_register(obj); } -`,new Function("requireRegisteredType","Module","__emval_register",_)(tt,r,ne)}var Zt={};function X_(e,t,n,_){e=Ue(e);var s=Zt[t];return s||(s=H_(t),Zt[t]=s),s(e,n,_)}function x_(e){return ne(nt(e))}function k_(e){var t=k[e].value;je(t),Ct(e)}function $_(){Me()}function W_(e,t,n){D.copyWithin(e,t,t+n)}function j_(e){try{return ce.grow(e-ct.byteLength+65535>>>16),vt(ce.buffer),1}catch{}}function z_(e){var t=D.length;e=e>>>0;var n=2147483648;if(e>n)return!1;for(var _=1;_<=4;_*=2){var s=t*(1+.2/_);s=Math.min(s,e+100663296);var a=Math.min(n,ln(Math.max(e,s),65536)),c=j_(a);if(c)return!0}return!1}var _t={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var n=_t.buffers[e];t===0||t===10?((e===1?st:ee)(He(n,0)),n.length=0):n.push(t)},varargs:void 0,get:function(){_t.varargs+=4;var e=w[_t.varargs-4>>2];return e},getStr:function(e){var t=Xe(e);return t},get64:function(e,t){return e}};function Y_(e){return 0}function q_(e,t,n,_,s){}function Z_(e,t,n,_){for(var s=0,a=0;a<n;a++){for(var c=w[t+a*8>>2],o=w[t+(a*8+4)>>2],R=0;R<o;R++)_t.printChar(e,D[c+R]);s+=o}return w[_>>2]=s,0}function Q_(e){Ie(e|0)}It=r.InternalError=ft(Error,"InternalError"),Ln(),Be=r.BindingError=ft(Error,"BindingError"),kn(),i_(),t_(),Wt=r.UnboundTypeError=ft(Error,"UnboundTypeError"),O_();var J_={t:gn,I:mn,x:a_,w:c_,d:A_,k:f_,H:l_,n:K_,a:B_,A:F_,i:d_,j:G_,h:V_,B:N_,v:P_,u:p_,c:E_,J:v_,m:h_,s:y_,b:Ct,y:g_,p:D_,r:I_,e:b_,g:w_,q:X_,f:x_,l:k_,o:$_,E:W_,F:z_,G:Y_,C:q_,z:Z_,D:Q_},ur=hn(),er=r.___wasm_call_ctors=function(){return(er=r.___wasm_call_ctors=r.asm.L).apply(null,arguments)},dt=r._malloc=function(){return(dt=r._malloc=r.asm.M).apply(null,arguments)},_e=r._free=function(){return(_e=r._free=r.asm.N).apply(null,arguments)},Qt=r.___getTypeName=function(){return(Qt=r.___getTypeName=r.asm.P).apply(null,arguments)},tr=r.___embind_register_native_and_builtin_types=function(){return(tr=r.___embind_register_native_and_builtin_types=r.asm.Q).apply(null,arguments)},nr=r.dynCall_jiji=function(){return(nr=r.dynCall_jiji=r.asm.R).apply(null,arguments)},rt;function _r(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Ne=function e(){rt||St(),rt||(Ne=e)};function St(e){if(e=e||U,Te>0||(Bn(),Te>0))return;function t(){rt||(rt=!0,r.calledRun=!0,!de&&(Cn(),Fn(),C(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),dn()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()}if(r.run=St,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return St(),f.ready}}();typeof it=="object"&&typeof Pt=="object"?Pt.exports=Nt:typeof define=="function"&&define.amd?define([],function(){return Nt}):typeof it=="object"&&(it.BASIS=Nt)});var B={UNSIGNED_BYTE:M.UNSIGNED_BYTE,UNSIGNED_SHORT:M.UNSIGNED_SHORT,UNSIGNED_INT:M.UNSIGNED_INT,FLOAT:M.FLOAT,HALF_FLOAT:M.HALF_FLOAT_OES,UNSIGNED_INT_24_8:M.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:M.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:M.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:M.UNSIGNED_SHORT_5_6_5};B.toWebGLConstant=function(i,f){switch(i){case B.UNSIGNED_BYTE:return M.UNSIGNED_BYTE;case B.UNSIGNED_SHORT:return M.UNSIGNED_SHORT;case B.UNSIGNED_INT:return M.UNSIGNED_INT;case B.FLOAT:return M.FLOAT;case B.HALF_FLOAT:return f.webgl2?M.HALF_FLOAT:M.HALF_FLOAT_OES;case B.UNSIGNED_INT_24_8:return M.UNSIGNED_INT_24_8;case B.UNSIGNED_SHORT_4_4_4_4:return M.UNSIGNED_SHORT_4_4_4_4;case B.UNSIGNED_SHORT_5_5_5_1:return M.UNSIGNED_SHORT_5_5_5_1;case B.UNSIGNED_SHORT_5_6_5:return B.UNSIGNED_SHORT_5_6_5}};B.isPacked=function(i){return i===B.UNSIGNED_INT_24_8||i===B.UNSIGNED_SHORT_4_4_4_4||i===B.UNSIGNED_SHORT_5_5_5_1||i===B.UNSIGNED_SHORT_5_6_5};B.sizeInBytes=function(i){switch(i){case B.UNSIGNED_BYTE:return 1;case B.UNSIGNED_SHORT:case B.UNSIGNED_SHORT_4_4_4_4:case B.UNSIGNED_SHORT_5_5_5_1:case B.UNSIGNED_SHORT_5_6_5:case B.HALF_FLOAT:return 2;case B.UNSIGNED_INT:case B.FLOAT:case B.UNSIGNED_INT_24_8:return 4}};B.validate=function(i){return i===B.UNSIGNED_BYTE||i===B.UNSIGNED_SHORT||i===B.UNSIGNED_INT||i===B.FLOAT||i===B.HALF_FLOAT||i===B.UNSIGNED_INT_24_8||i===B.UNSIGNED_SHORT_4_4_4_4||i===B.UNSIGNED_SHORT_5_5_5_1||i===B.UNSIGNED_SHORT_5_6_5};B.getTypedArrayConstructor=function(i){let f=B.sizeInBytes(i);return f===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:f===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:f===Float32Array.BYTES_PER_ELEMENT&&i===B.FLOAT?Float32Array:Uint32Array};var H=Object.freeze(B);var A={DEPTH_COMPONENT:M.DEPTH_COMPONENT,DEPTH_STENCIL:M.DEPTH_STENCIL,ALPHA:M.ALPHA,RED:M.RED,RG:M.RG,RGB:M.RGB,RGBA:M.RGBA,LUMINANCE:M.LUMINANCE,LUMINANCE_ALPHA:M.LUMINANCE_ALPHA,RGB_DXT1:M.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:M.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:M.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:M.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:M.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:M.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:M.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:M.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:M.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:M.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:M.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:M.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:M.COMPRESSED_RGBA_BPTC_UNORM};A.componentsLength=function(i){switch(i){case A.RGB:return 3;case A.RGBA:return 4;case A.LUMINANCE_ALPHA:case A.RG:return 2;case A.ALPHA:case A.RED:case A.LUMINANCE:return 1;default:return 1}};A.validate=function(i){return i===A.DEPTH_COMPONENT||i===A.DEPTH_STENCIL||i===A.ALPHA||i===A.RED||i===A.RG||i===A.RGB||i===A.RGBA||i===A.LUMINANCE||i===A.LUMINANCE_ALPHA||i===A.RGB_DXT1||i===A.RGBA_DXT1||i===A.RGBA_DXT3||i===A.RGBA_DXT5||i===A.RGB_PVRTC_4BPPV1||i===A.RGB_PVRTC_2BPPV1||i===A.RGBA_PVRTC_4BPPV1||i===A.RGBA_PVRTC_2BPPV1||i===A.RGBA_ASTC||i===A.RGB_ETC1||i===A.RGB8_ETC2||i===A.RGBA8_ETC2_EAC||i===A.RGBA_BC7};A.isColorFormat=function(i){return i===A.RED||i===A.ALPHA||i===A.RGB||i===A.RGBA||i===A.LUMINANCE||i===A.LUMINANCE_ALPHA};A.isDepthFormat=function(i){return i===A.DEPTH_COMPONENT||i===A.DEPTH_STENCIL};A.isCompressedFormat=function(i){return i===A.RGB_DXT1||i===A.RGBA_DXT1||i===A.RGBA_DXT3||i===A.RGBA_DXT5||i===A.RGB_PVRTC_4BPPV1||i===A.RGB_PVRTC_2BPPV1||i===A.RGBA_PVRTC_4BPPV1||i===A.RGBA_PVRTC_2BPPV1||i===A.RGBA_ASTC||i===A.RGB_ETC1||i===A.RGB8_ETC2||i===A.RGBA8_ETC2_EAC||i===A.RGBA_BC7};A.isDXTFormat=function(i){return i===A.RGB_DXT1||i===A.RGBA_DXT1||i===A.RGBA_DXT3||i===A.RGBA_DXT5};A.isPVRTCFormat=function(i){return i===A.RGB_PVRTC_4BPPV1||i===A.RGB_PVRTC_2BPPV1||i===A.RGBA_PVRTC_4BPPV1||i===A.RGBA_PVRTC_2BPPV1};A.isASTCFormat=function(i){return i===A.RGBA_ASTC};A.isETC1Format=function(i){return i===A.RGB_ETC1};A.isETC2Format=function(i){return i===A.RGB8_ETC2||i===A.RGBA8_ETC2_EAC};A.isBC7Format=function(i){return i===A.RGBA_BC7};A.compressedTextureSizeInBytes=function(i,f,r){switch(i){case A.RGB_DXT1:case A.RGBA_DXT1:case A.RGB_ETC1:case A.RGB8_ETC2:return Math.floor((f+3)/4)*Math.floor((r+3)/4)*8;case A.RGBA_DXT3:case A.RGBA_DXT5:case A.RGBA_ASTC:case A.RGBA8_ETC2_EAC:return Math.floor((f+3)/4)*Math.floor((r+3)/4)*16;case A.RGB_PVRTC_4BPPV1:case A.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(f,8)*Math.max(r,8)*4+7)/8);case A.RGB_PVRTC_2BPPV1:case A.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(f,16)*Math.max(r,8)*2+7)/8);case A.RGBA_BC7:return Math.ceil(f/4)*Math.ceil(r/4)*16;default:return 0}};A.textureSizeInBytes=function(i,f,r,C){let l=A.componentsLength(i);return H.isPacked(f)&&(l=1),l*H.sizeInBytes(f)*r*C};A.alignmentInBytes=function(i,f,r){let C=A.textureSizeInBytes(i,f,r,1)%4;return C===0?4:C===2?2:1};A.createTypedArray=function(i,f,r,C){let l=H.getTypedArrayConstructor(f),p=A.componentsLength(i)*r*C;return new l(p)};A.flipY=function(i,f,r,C,l){if(l===1)return i;let p=A.createTypedArray(f,r,C,l),F=A.componentsLength(f),U=C*F;for(let y=0;y<l;++y){let m=y*C*F,V=(l-y-1)*C*F;for(let d=0;d<U;++d)p[V+d]=i[m+d]}return p};A.toInternalFormat=function(i,f,r){if(!r.webgl2)return i;if(i===A.DEPTH_STENCIL)return M.DEPTH24_STENCIL8;if(i===A.DEPTH_COMPONENT){if(f===H.UNSIGNED_SHORT)return M.DEPTH_COMPONENT16;if(f===H.UNSIGNED_INT)return M.DEPTH_COMPONENT24}if(f===H.FLOAT)switch(i){case A.RGBA:return M.RGBA32F;case A.RGB:return M.RGB32F;case A.RG:return M.RG32F;case A.RED:return M.R32F}if(f===H.HALF_FLOAT)switch(i){case A.RGBA:return M.RGBA16F;case A.RGB:return M.RGB16F;case A.RG:return M.RG16F;case A.RED:return M.R16F}return i};var E=Object.freeze(A);var or={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},Le=Object.freeze(or);var Vt=class{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}},Oe=class{constructor(f,r,C,l){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(f.buffer,f.byteOffset+r,C),this._littleEndian=l,this._offset=0}_nextUint8(){let f=this._dataView.getUint8(this._offset);return this._offset+=1,f}_nextUint16(){let f=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,f}_nextUint32(){let f=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,f}_nextUint64(){let f=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),C=f+2**32*r;return this._offset+=8,C}_nextInt32(){let f=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,f}_nextUint8Array(f){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,f);return this._offset+=f,r}_skip(f){return this._offset+=f,this}_scan(f,r=0){let C=this._offset,l=0;for(;this._dataView.getUint8(this._offset)!==r&&l<f;)l++,this._offset++;return l<f&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+C,l)}};var Fr=new Uint8Array([0]),b=[171,75,84,88,32,50,48,187,13,10,26,10];function rn(i){return new TextDecoder().decode(i)}function sn(i){let f=new Uint8Array(i.buffer,i.byteOffset,b.length);if(f[0]!==b[0]||f[1]!==b[1]||f[2]!==b[2]||f[3]!==b[3]||f[4]!==b[4]||f[5]!==b[5]||f[6]!==b[6]||f[7]!==b[7]||f[8]!==b[8]||f[9]!==b[9]||f[10]!==b[10]||f[11]!==b[11])throw new Error("Missing KTX 2.0 identifier.");let r=new Vt,C=17*Uint32Array.BYTES_PER_ELEMENT,l=new Oe(i,b.length,C,!0);r.vkFormat=l._nextUint32(),r.typeSize=l._nextUint32(),r.pixelWidth=l._nextUint32(),r.pixelHeight=l._nextUint32(),r.pixelDepth=l._nextUint32(),r.layerCount=l._nextUint32(),r.faceCount=l._nextUint32();let p=l._nextUint32();r.supercompressionScheme=l._nextUint32();let F=l._nextUint32(),U=l._nextUint32(),y=l._nextUint32(),m=l._nextUint32(),V=l._nextUint64(),d=l._nextUint64(),P=p*3*8,Q=new Oe(i,b.length+C,P,!0);for(let L=0;L<p;L++)r.levels.push({levelData:new Uint8Array(i.buffer,i.byteOffset+Q._nextUint64(),Q._nextUint64()),uncompressedByteLength:Q._nextUint64()});let u=new Oe(i,F,U,!0),X={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},W=(X.descriptorBlockSize/4-6)/4;for(let L=0;L<W;L++){let j={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelType:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};j.channelType&64?(j.sampleLower=u._nextInt32(),j.sampleUpper=u._nextInt32()):(j.sampleLower=u._nextUint32(),j.sampleUpper=u._nextUint32()),X.samples[L]=j}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(X);let J=new Oe(i,y,m,!0);for(;J._offset<m;){let L=J._nextUint32(),j=J._scan(L),Ae=rn(j);if(r.keyValue[Ae]=J._nextUint8Array(L-j.byteLength-1),Ae.match(/^ktx/i)){let xe=rn(r.keyValue[Ae]);r.keyValue[Ae]=xe.substring(0,xe.lastIndexOf("\0"))}let at=L%4?4-L%4:0;J._skip(at)}if(d<=0)return r;let g=new Oe(i,V,d,!0),Fe=g._nextUint16(),st=g._nextUint16(),ee=g._nextUint32(),De=g._nextUint32(),Ie=g._nextUint32(),ae=g._nextUint32(),ot=[];for(let L=0;L<p;L++)ot.push({imageFlags:g._nextUint32(),rgbSliceByteOffset:g._nextUint32(),rgbSliceByteLength:g._nextUint32(),alphaSliceByteOffset:g._nextUint32(),alphaSliceByteLength:g._nextUint32()});let ce=V+g._offset,de=ce+ee,be=de+De,Se=be+Ie,we=new Uint8Array(i.buffer,i.byteOffset+ce,ee),He=new Uint8Array(i.buffer,i.byteOffset+de,De),Xe=new Uint8Array(i.buffer,i.byteOffset+be,Ie),Rt=new Uint8Array(i.buffer,i.byteOffset+Se,ae);return r.globalData={endpointCount:Fe,selectorCount:st,imageDescs:ot,endpointsData:we,selectorsData:He,tablesData:Xe,extendedData:Rt},r}var Rn=sr(on(),1),an=["positiveX","negativeX","positiveY","negativeY","positiveZ","negativeZ"],cn=163,An=166,me;function Rr(i,f){nn.typeOf.object("transcoderModule",me);let r=i.ktx2Buffer,C=i.supportedTargetFormats,l;try{l=sn(r)}catch{throw new ie("Invalid KTX2 file.")}if(l.layerCount!==0)throw new ie("KTX2 texture arrays are not supported.");if(l.pixelDepth!==0)throw new ie("KTX2 3D textures are unsupported.");let p=l.dataFormatDescriptor[0],F=new Array(l.levelCount);return l.vkFormat===0&&(p.colorModel===cn||p.colorModel===An)?cr(r,l,C,me,f,F):(f.push(r.buffer),ar(l,F)),F}function ar(i,f){let r=i.vkFormat===Le.VK_FORMAT_R8G8B8_SRGB?E.RGB:E.RGBA,C;i.vkFormat===Le.VK_FORMAT_R8G8B8A8_UNORM?C=H.UNSIGNED_BYTE:i.vkFormat===Le.VK_FORMAT_R16G16B16A16_SFLOAT?C=H.HALF_FLOAT:i.vkFormat===Le.VK_FORMAT_R32G32B32A32_SFLOAT&&(C=H.FLOAT);for(let l=0;l<i.levels.length;++l){let p={};f[l]=p;let F=i.levels[l].levelData,U=i.pixelWidth>>l,y=i.pixelHeight>>l,m=U*y*E.componentsLength(r);for(let V=0;V<i.faceCount;++V){let d=F.byteOffset+m*i.typeSize*V,P;!ge(C)||H.sizeInBytes(C)===1?P=new Uint8Array(F.buffer,d,m):H.sizeInBytes(C)===2?P=new Uint16Array(F.buffer,d,m):P=new Float32Array(F.buffer,d,m),p[an[V]]={internalFormat:r,datatype:C,width:U,height:y,levelBuffer:P}}}}function cr(i,f,r,C,l,p){let F=new C.KTX2File(i),U=F.getWidth(),y=F.getHeight(),m=F.getLevels(),V=F.getHasAlpha();if(!(U>0)||!(y>0)||!(m>0))throw F.close(),F.delete(),new ie("Invalid KTX2 file");let d,P,Q=f.dataFormatDescriptor[0],u=C.transcoder_texture_format;if(Q.colorModel===cn)if(r.etc)d=V?E.RGBA8_ETC2_EAC:E.RGB8_ETC2,P=V?u.cTFETC2_RGBA:u.cTFETC1_RGB;else if(r.etc1&&!V)d=E.RGB_ETC1,P=u.cTFETC1_RGB;else if(r.s3tc)d=V?E.RGBA_DXT5:E.RGB_DXT1,P=V?u.cTFBC3_RGBA:u.cTFBC1_RGB;else if(r.pvrtc)d=V?E.RGBA_PVRTC_4BPPV1:E.RGB_PVRTC_4BPPV1,P=V?u.cTFPVRTC1_4_RGBA:u.cTFPVRTC1_4_RGB;else if(r.astc)d=E.RGBA_ASTC,P=u.cTFASTC_4x4_RGBA;else if(r.bc7)d=E.RGBA_BC7,P=u.cTFBC7_RGBA;else throw new ie("No transcoding format target available for ETC1S compressed ktx2.");else if(Q.colorModel===An)if(r.astc)d=E.RGBA_ASTC,P=u.cTFASTC_4x4_RGBA;else if(r.bc7)d=E.RGBA_BC7,P=u.cTFBC7_RGBA;else if(r.s3tc)d=V?E.RGBA_DXT5:E.RGB_DXT1,P=V?u.cTFBC3_RGBA:u.cTFBC1_RGB;else if(r.etc)d=V?E.RGBA8_ETC2_EAC:E.RGB8_ETC2,P=V?u.cTFETC2_RGBA:u.cTFETC1_RGB;else if(r.etc1&&!V)d=E.RGB_ETC1,P=u.cTFETC1_RGB;else if(r.pvrtc)d=V?E.RGBA_PVRTC_4BPPV1:E.RGB_PVRTC_4BPPV1,P=V?u.cTFPVRTC1_4_RGBA:u.cTFPVRTC1_4_RGB;else throw new ie("No transcoding format target available for UASTC compressed ktx2.");if(!F.startTranscoding())throw F.close(),F.delete(),new ie("startTranscoding() failed");for(let X=0;X<f.levels.length;++X){let se={};p[X]=se,U=f.pixelWidth>>X,y=f.pixelHeight>>X;let le=F.getImageTranscodedSizeInBytes(X,0,0,P.value),W=new Uint8Array(le),J=F.transcodeImage(W,X,0,0,P.value,0,-1,-1);if(!ge(J))throw new ie("transcodeImage() failed.");l.push(W.buffer),se[an[0]]={internalFormat:d,width:U,height:y,levelBuffer:W}}return F.close(),F.delete(),p}async function Ar(i,f){let r=i.webAssemblyConfig,C=Rn.default??self.BASIS;return ge(r.wasmBinaryFile)?me=await C(r):me=await C(),me.initializeBasis(),!0}function fr(i,f){let r=i.webAssemblyConfig;return ge(r)?Ar(i,f):Rr(i,f)}var hr=_n(fr);export{hr as default}; +`,new Function("requireRegisteredType","Module","__emval_register",_)(nt,r,ne)}var en={};function X_(e,t,n,_){e=Le(e);var o=en[t];return o||(o=H_(t),en[t]=o),o(e,n,_)}function x_(e){return ne(_t(e))}function k_(e){var t=$[e].value;Ye(t),Gt(e)}function $_(){Be()}function W_(e,t,n){U.copyWithin(e,t,t+n)}function j_(e){try{return le.grow(e-g.byteLength+65535>>>16),yt(le.buffer),1}catch{}}function Y_(e){var t=U.length;e=e>>>0;var n=2147483648;if(e>n)return!1;for(var _=1;_<=4;_*=2){var o=t*(1+.2/_);o=Math.min(o,e+100663296);var c=Math.min(n,ut(Math.max(e,o),65536)),A=j_(c);if(A)return!0}return!1}var rt={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var n=rt.buffers[e];t===0||t===10?((e===1?it:oe)(Ne(n,0)),n.length=0):n.push(t)},varargs:void 0,get:function(){rt.varargs+=4;var e=x[rt.varargs-4>>2];return e},getStr:function(e){var t=Ee(e);return t},get64:function(e,t){return e}};function z_(e){return 0}function q_(e,t,n,_,o){}function Z_(e,t,n,_){for(var o=0,c=0;c<n;c++){for(var A=x[t+c*8>>2],R=x[t+(c*8+4)>>2],a=0;a<R;a++)rt.printChar(e,U[A+a]);o+=R}return x[_>>2]=o,0}function Q_(e){we(e|0)}Ht=r.InternalError=Ot(Error,"InternalError"),Ln(),Ke=r.BindingError=Ot(Error,"BindingError"),kn(),s_(),t_(),zt=r.UnboundTypeError=Ot(Error,"UnboundTypeError"),O_();var J_={t:gn,I:mn,x:a_,w:c_,d:A_,k:T_,H:l_,n:M_,a:K_,A:F_,i:d_,j:S_,h:N_,B:E_,v:V_,u:P_,c:p_,J:v_,m:U_,s:y_,b:Gt,y:g_,p:D_,r:I_,e:b_,g:w_,q:X_,f:x_,l:k_,o:$_,E:W_,F:Y_,G:z_,C:q_,z:Z_,D:Q_},fr=Un(),er=r.___wasm_call_ctors=function(){return(er=r.___wasm_call_ctors=r.asm.L).apply(null,arguments)},Nt=r._malloc=function(){return(Nt=r._malloc=r.asm.M).apply(null,arguments)},_e=r._free=function(){return(_e=r._free=r.asm.N).apply(null,arguments)},tn=r.___getTypeName=function(){return(tn=r.___getTypeName=r.asm.P).apply(null,arguments)},tr=r.___embind_register_native_and_builtin_types=function(){return(tr=r.___embind_register_native_and_builtin_types=r.asm.Q).apply(null,arguments)},nr=r.dynCall_jiji=function(){return(nr=r.dynCall_jiji=r.asm.R).apply(null,arguments)},st;function _r(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}pe=function e(){st||Et(),st||(pe=e)};function Et(e){if(e=e||D,Te>0||(Kn(),Te>0))return;function t(){st||(st=!0,r.calledRun=!0,!ie&&(Cn(),Fn(),B(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),dn()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),t()},1)):t()}if(r.run=Et,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Et(),T.ready})})();typeof ot=="object"&&typeof pt=="object"?pt.exports=Pt:typeof define=="function"&&define.amd?define([],function(){return Pt}):typeof ot=="object"&&(ot.BASIS=Pt)});var K={UNSIGNED_BYTE:f.UNSIGNED_BYTE,UNSIGNED_SHORT:f.UNSIGNED_SHORT,UNSIGNED_INT:f.UNSIGNED_INT,FLOAT:f.FLOAT,HALF_FLOAT:f.HALF_FLOAT_OES,UNSIGNED_INT_24_8:f.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:f.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:f.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:f.UNSIGNED_SHORT_5_6_5};K.toWebGLConstant=function(s,T){switch(s){case K.UNSIGNED_BYTE:return f.UNSIGNED_BYTE;case K.UNSIGNED_SHORT:return f.UNSIGNED_SHORT;case K.UNSIGNED_INT:return f.UNSIGNED_INT;case K.FLOAT:return f.FLOAT;case K.HALF_FLOAT:return T.webgl2?f.HALF_FLOAT:f.HALF_FLOAT_OES;case K.UNSIGNED_INT_24_8:return f.UNSIGNED_INT_24_8;case K.UNSIGNED_SHORT_4_4_4_4:return f.UNSIGNED_SHORT_4_4_4_4;case K.UNSIGNED_SHORT_5_5_5_1:return f.UNSIGNED_SHORT_5_5_5_1;case K.UNSIGNED_SHORT_5_6_5:return K.UNSIGNED_SHORT_5_6_5}};K.isPacked=function(s){return s===K.UNSIGNED_INT_24_8||s===K.UNSIGNED_SHORT_4_4_4_4||s===K.UNSIGNED_SHORT_5_5_5_1||s===K.UNSIGNED_SHORT_5_6_5};K.sizeInBytes=function(s){switch(s){case K.UNSIGNED_BYTE:return 1;case K.UNSIGNED_SHORT:case K.UNSIGNED_SHORT_4_4_4_4:case K.UNSIGNED_SHORT_5_5_5_1:case K.UNSIGNED_SHORT_5_6_5:case K.HALF_FLOAT:return 2;case K.UNSIGNED_INT:case K.FLOAT:case K.UNSIGNED_INT_24_8:return 4}};K.validate=function(s){return s===K.UNSIGNED_BYTE||s===K.UNSIGNED_SHORT||s===K.UNSIGNED_INT||s===K.FLOAT||s===K.HALF_FLOAT||s===K.UNSIGNED_INT_24_8||s===K.UNSIGNED_SHORT_4_4_4_4||s===K.UNSIGNED_SHORT_5_5_5_1||s===K.UNSIGNED_SHORT_5_6_5};K.getTypedArrayConstructor=function(s){let T=K.sizeInBytes(s);return T===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:T===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:T===Float32Array.BYTES_PER_ELEMENT&&s===K.FLOAT?Float32Array:Uint32Array};Object.freeze(K);var y=K;var i={DEPTH_COMPONENT:f.DEPTH_COMPONENT,DEPTH_STENCIL:f.DEPTH_STENCIL,ALPHA:f.ALPHA,RED:f.RED,RG:f.RG,RGB:f.RGB,RGBA:f.RGBA,RED_INTEGER:f.RED_INTEGER,RG_INTEGER:f.RG_INTEGER,RGB_INTEGER:f.RGB_INTEGER,RGBA_INTEGER:f.RGBA_INTEGER,LUMINANCE:f.LUMINANCE,LUMINANCE_ALPHA:f.LUMINANCE_ALPHA,RGB_DXT1:f.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:f.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:f.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:f.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:f.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:f.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:f.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:f.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:f.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:f.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:f.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:f.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:f.COMPRESSED_RGBA_BPTC_UNORM};i.componentsLength=function(s){switch(s){case i.RGB:case i.RGB_INTEGER:return 3;case i.RGBA:case i.RGBA_INTEGER:return 4;case i.LUMINANCE_ALPHA:case i.RG:case i.RG_INTEGER:return 2;case i.ALPHA:case i.RED:case i.RED_INTEGER:case i.LUMINANCE:return 1;default:return 1}};i.validate=function(s){return s===i.DEPTH_COMPONENT||s===i.DEPTH_STENCIL||s===i.ALPHA||s===i.RED||s===i.RG||s===i.RGB||s===i.RGBA||s===i.RED_INTEGER||s===i.RG_INTEGER||s===i.RGB_INTEGER||s===i.RGBA_INTEGER||s===i.LUMINANCE||s===i.LUMINANCE_ALPHA||s===i.RGB_DXT1||s===i.RGBA_DXT1||s===i.RGBA_DXT3||s===i.RGBA_DXT5||s===i.RGB_PVRTC_4BPPV1||s===i.RGB_PVRTC_2BPPV1||s===i.RGBA_PVRTC_4BPPV1||s===i.RGBA_PVRTC_2BPPV1||s===i.RGBA_ASTC||s===i.RGB_ETC1||s===i.RGB8_ETC2||s===i.RGBA8_ETC2_EAC||s===i.RGBA_BC7};i.isColorFormat=function(s){return s===i.RED||s===i.ALPHA||s===i.RGB||s===i.RGBA||s===i.LUMINANCE||s===i.LUMINANCE_ALPHA};i.isDepthFormat=function(s){return s===i.DEPTH_COMPONENT||s===i.DEPTH_STENCIL};i.isCompressedFormat=function(s){return s===i.RGB_DXT1||s===i.RGBA_DXT1||s===i.RGBA_DXT3||s===i.RGBA_DXT5||s===i.RGB_PVRTC_4BPPV1||s===i.RGB_PVRTC_2BPPV1||s===i.RGBA_PVRTC_4BPPV1||s===i.RGBA_PVRTC_2BPPV1||s===i.RGBA_ASTC||s===i.RGB_ETC1||s===i.RGB8_ETC2||s===i.RGBA8_ETC2_EAC||s===i.RGBA_BC7};i.isDXTFormat=function(s){return s===i.RGB_DXT1||s===i.RGBA_DXT1||s===i.RGBA_DXT3||s===i.RGBA_DXT5};i.isPVRTCFormat=function(s){return s===i.RGB_PVRTC_4BPPV1||s===i.RGB_PVRTC_2BPPV1||s===i.RGBA_PVRTC_4BPPV1||s===i.RGBA_PVRTC_2BPPV1};i.isASTCFormat=function(s){return s===i.RGBA_ASTC};i.isETC1Format=function(s){return s===i.RGB_ETC1};i.isETC2Format=function(s){return s===i.RGB8_ETC2||s===i.RGBA8_ETC2_EAC};i.isBC7Format=function(s){return s===i.RGBA_BC7};i.compressedTextureSizeInBytes=function(s,T,r){switch(s){case i.RGB_DXT1:case i.RGBA_DXT1:case i.RGB_ETC1:case i.RGB8_ETC2:return Math.floor((T+3)/4)*Math.floor((r+3)/4)*8;case i.RGBA_DXT3:case i.RGBA_DXT5:case i.RGBA_ASTC:case i.RGBA8_ETC2_EAC:return Math.floor((T+3)/4)*Math.floor((r+3)/4)*16;case i.RGB_PVRTC_4BPPV1:case i.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(T,8)*Math.max(r,8)*4+7)/8);case i.RGB_PVRTC_2BPPV1:case i.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(T,16)*Math.max(r,8)*2+7)/8);case i.RGBA_BC7:return Math.ceil(T/4)*Math.ceil(r/4)*16;default:return 0}};i.textureSizeInBytes=function(s,T,r,B){let l=i.componentsLength(s);return y.isPacked(T)&&(l=1),l*y.sizeInBytes(T)*r*B};i.texture3DSizeInBytes=function(s,T,r,B,l){let p=i.componentsLength(s);return y.isPacked(T)&&(p=1),p*y.sizeInBytes(T)*r*B*l};i.alignmentInBytes=function(s,T,r){let B=i.textureSizeInBytes(s,T,r,1)%4;return B===0?4:B===2?2:1};i.createTypedArray=function(s,T,r,B){let l=y.getTypedArrayConstructor(T),p=i.componentsLength(s)*r*B;return new l(p)};i.flipY=function(s,T,r,B,l){if(l===1)return s;let p=i.createTypedArray(T,r,B,l),F=i.componentsLength(T),D=B*F;for(let I=0;I<l;++I){let b=I*B*F,E=(l-I-1)*B*F;for(let S=0;S<D;++S)p[E+S]=s[b+S]}return p};i.toInternalFormat=function(s,T,r){if(!r.webgl2)return s;if(s===i.DEPTH_STENCIL)return f.DEPTH24_STENCIL8;if(s===i.DEPTH_COMPONENT){if(T===y.UNSIGNED_SHORT)return f.DEPTH_COMPONENT16;if(T===y.UNSIGNED_INT)return f.DEPTH_COMPONENT24}if(T===y.FLOAT)switch(s){case i.RGBA:return f.RGBA32F;case i.RGB:return f.RGB32F;case i.RG:return f.RG32F;case i.RED:return f.R32F}if(T===y.HALF_FLOAT)switch(s){case i.RGBA:return f.RGBA16F;case i.RGB:return f.RGB16F;case i.RG:return f.RG16F;case i.RED:return f.R16F}if(T===y.UNSIGNED_BYTE)switch(s){case i.RGBA:return f.RGBA8;case i.RGB:return f.RGB8;case i.RG:return f.RG8;case i.RED:return f.R8}if(T===y.INT)switch(s){case i.RGBA_INTEGER:return f.RGBA32I;case i.RGB_INTEGER:return f.RGB32I;case i.RG_INTEGER:return f.RG32I;case i.RED_INTEGER:return f.R32I}if(T===y.UNSIGNED_INT)switch(s){case i.RGBA_INTEGER:return f.RGBA32UI;case i.RGB_INTEGER:return f.RGB32UI;case i.RG_INTEGER:return f.RG32UI;case i.RED_INTEGER:return f.R32UI}return s};Object.freeze(i);var v=i;var Rn={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};Object.freeze(Rn);var Ie=Rn;function ir(){return{vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}var fe=class{constructor(T,r,B,l){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(T.buffer,T.byteOffset+r,B),this._littleEndian=l,this._offset=0}_nextUint8(){let T=this._dataView.getUint8(this._offset);return this._offset+=1,T}_nextUint16(){let T=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,T}_nextUint32(){let T=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,T}_nextUint64(){let T=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),B=T+2**32*r;return this._offset+=8,B}_nextInt32(){let T=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,T}_nextUint8Array(T){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,T);return this._offset+=T,r}_skip(T){return this._offset+=T,this}_scan(T,r=0){let B=this._offset,l=0;for(;this._dataView.getUint8(this._offset)!==r&&l<T;)l++,this._offset++;return l<T&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+B,l)}};var Fr=new Uint8Array([0]),H=[171,75,84,88,32,50,48,187,13,10,26,10];function an(s){return new TextDecoder().decode(s)}function cn(s){let T=new Uint8Array(s.buffer,s.byteOffset,H.length);if(T[0]!==H[0]||T[1]!==H[1]||T[2]!==H[2]||T[3]!==H[3]||T[4]!==H[4]||T[5]!==H[5]||T[6]!==H[6]||T[7]!==H[7]||T[8]!==H[8]||T[9]!==H[9]||T[10]!==H[10]||T[11]!==H[11])throw new Error("Missing KTX 2.0 identifier.");let r=ir(),B=17*Uint32Array.BYTES_PER_ELEMENT,l=new fe(s,H.length,B,!0);r.vkFormat=l._nextUint32(),r.typeSize=l._nextUint32(),r.pixelWidth=l._nextUint32(),r.pixelHeight=l._nextUint32(),r.pixelDepth=l._nextUint32(),r.layerCount=l._nextUint32(),r.faceCount=l._nextUint32(),r.levelCount=l._nextUint32(),r.supercompressionScheme=l._nextUint32();let p=l._nextUint32(),F=l._nextUint32(),D=l._nextUint32(),I=l._nextUint32(),b=l._nextUint64(),E=l._nextUint64(),S=Math.max(r.levelCount,1)*3*8,V=new fe(s,H.length+B,S,!0);for(let g=0,L=Math.max(r.levelCount,1);g<L;g++)r.levels.push({levelData:new Uint8Array(s.buffer,s.byteOffset+V._nextUint64(),V._nextUint64()),uncompressedByteLength:V._nextUint64()});let C=new fe(s,p,F,!0);C._skip(4);let d=C._nextUint16(),j=C._nextUint16(),J=C._nextUint16(),Ae=C._nextUint16(),Y=C._nextUint8(),Fe=C._nextUint8(),de=C._nextUint8(),Ge=C._nextUint8(),it=[C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8()],oe=[C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8()],we={vendorId:d,descriptorType:j,versionNumber:J,colorModel:Y,colorPrimaries:Fe,transferFunction:de,flags:Ge,texelBlockDimension:it,bytesPlane:oe,samples:[]},le=(Ae/4-6)/4;for(let g=0;g<le;g++){let L={bitOffset:C._nextUint16(),bitLength:C._nextUint8(),channelType:C._nextUint8(),samplePosition:[C._nextUint8(),C._nextUint8(),C._nextUint8(),C._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};L.channelType&64?(L.sampleLower=C._nextInt32(),L.sampleUpper=C._nextInt32()):(L.sampleLower=C._nextUint32(),L.sampleUpper=C._nextUint32()),we.samples[g]=L}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(we);let ie=new fe(s,D,I,!0);for(;ie._offset<I;){let g=ie._nextUint32(),L=ie._scan(g),U=an(L);if(r.keyValue[U]=ie._nextUint8Array(g-L.byteLength-1),U.match(/^ktx/i)){let Re=an(r.keyValue[U]);r.keyValue[U]=Re.substring(0,Re.lastIndexOf("\0"))}let ee=g%4?4-g%4:0;ie._skip(ee)}if(E<=0)return r;let X=new fe(s,b,E,!0),Se=X._nextUint16(),He=X._nextUint16(),Ne=X._nextUint32(),Ee=X._nextUint32(),Xe=X._nextUint32(),Rt=X._nextUint32(),xe=[];for(let g=0,L=Math.max(r.levelCount,1);g<L;g++)xe.push({imageFlags:X._nextUint32(),rgbSliceByteOffset:X._nextUint32(),rgbSliceByteLength:X._nextUint32(),alphaSliceByteOffset:X._nextUint32(),alphaSliceByteLength:X._nextUint32()});let Ve=b+X._offset,ke=Ve+Ne,$e=ke+Ee,at=$e+Xe,ct=new Uint8Array(s.buffer,s.byteOffset+Ve,Ne),At=new Uint8Array(s.buffer,s.byteOffset+ke,Ee),Tt=new Uint8Array(s.buffer,s.byteOffset+$e,Xe),ut=new Uint8Array(s.buffer,s.byteOffset+at,Rt);return r.globalData={endpointCount:Se,selectorCount:He,imageDescs:xe,endpointsData:ct,selectorsData:At,tablesData:Tt,extendedData:ut},r}var Tn=or(An(),1),un=["positiveX","negativeX","positiveY","negativeY","positiveZ","negativeZ"],fn=163,On=166,be;function Rr(s,T){sn.typeOf.object("transcoderModule",be);let r=s.ktx2Buffer,B=s.supportedTargetFormats,l;try{l=cn(r)}catch{throw new se("Invalid KTX2 file.")}if(l.layerCount!==0)throw new se("KTX2 texture arrays are not supported.");if(l.pixelDepth!==0)throw new se("KTX2 3D textures are unsupported.");let p=l.dataFormatDescriptor[0],F=new Array(l.levelCount);return l.vkFormat===0&&(p.colorModel===fn||p.colorModel===On)?cr(r,l,B,be,T,F):(T.push(r.buffer),ar(l,F)),F}function ar(s,T){let r=s.vkFormat===Ie.VK_FORMAT_R8G8B8_SRGB?v.RGB:v.RGBA,B;s.vkFormat===Ie.VK_FORMAT_R8G8B8A8_UNORM?B=y.UNSIGNED_BYTE:s.vkFormat===Ie.VK_FORMAT_R16G16B16A16_SFLOAT?B=y.HALF_FLOAT:s.vkFormat===Ie.VK_FORMAT_R32G32B32A32_SFLOAT&&(B=y.FLOAT);for(let l=0;l<s.levels.length;++l){let p={};T[l]=p;let F=s.levels[l].levelData,D=s.pixelWidth>>l,I=s.pixelHeight>>l,b=D*I*v.componentsLength(r);for(let E=0;E<s.faceCount;++E){let S=F.byteOffset+b*s.typeSize*E,V;!De(B)||y.sizeInBytes(B)===1?V=new Uint8Array(F.buffer,S,b):y.sizeInBytes(B)===2?V=new Uint16Array(F.buffer,S,b):V=new Float32Array(F.buffer,S,b),p[un[E]]={internalFormat:r,datatype:B,width:D,height:I,levelBuffer:V}}}}function cr(s,T,r,B,l,p){let F=new B.KTX2File(s),D=F.getWidth(),I=F.getHeight(),b=F.getLevels(),E=F.getHasAlpha();if(!(D>0)||!(I>0)||!(b>0))throw F.close(),F.delete(),new se("Invalid KTX2 file");let S,V,C=T.dataFormatDescriptor[0],d=B.transcoder_texture_format;if(C.colorModel===fn)if(r.etc)S=E?v.RGBA8_ETC2_EAC:v.RGB8_ETC2,V=E?d.cTFETC2_RGBA:d.cTFETC1_RGB;else if(r.etc1&&!E)S=v.RGB_ETC1,V=d.cTFETC1_RGB;else if(r.s3tc)S=E?v.RGBA_DXT5:v.RGB_DXT1,V=E?d.cTFBC3_RGBA:d.cTFBC1_RGB;else if(r.pvrtc)S=E?v.RGBA_PVRTC_4BPPV1:v.RGB_PVRTC_4BPPV1,V=E?d.cTFPVRTC1_4_RGBA:d.cTFPVRTC1_4_RGB;else if(r.astc)S=v.RGBA_ASTC,V=d.cTFASTC_4x4_RGBA;else if(r.bc7)S=v.RGBA_BC7,V=d.cTFBC7_RGBA;else throw new se("No transcoding format target available for ETC1S compressed ktx2.");else if(C.colorModel===On)if(r.astc)S=v.RGBA_ASTC,V=d.cTFASTC_4x4_RGBA;else if(r.bc7)S=v.RGBA_BC7,V=d.cTFBC7_RGBA;else if(r.s3tc)S=E?v.RGBA_DXT5:v.RGB_DXT1,V=E?d.cTFBC3_RGBA:d.cTFBC1_RGB;else if(r.etc)S=E?v.RGBA8_ETC2_EAC:v.RGB8_ETC2,V=E?d.cTFETC2_RGBA:d.cTFETC1_RGB;else if(r.etc1&&!E)S=v.RGB_ETC1,V=d.cTFETC1_RGB;else if(r.pvrtc)S=E?v.RGBA_PVRTC_4BPPV1:v.RGB_PVRTC_4BPPV1,V=E?d.cTFPVRTC1_4_RGBA:d.cTFPVRTC1_4_RGB;else throw new se("No transcoding format target available for UASTC compressed ktx2.");if(!F.startTranscoding())throw F.close(),F.delete(),new se("startTranscoding() failed");for(let j=0;j<T.levels.length;++j){let J={};p[j]=J,D=T.pixelWidth>>j,I=T.pixelHeight>>j;let Ae=F.getImageTranscodedSizeInBytes(j,0,0,V.value),Y=new Uint8Array(Ae),Fe=F.transcodeImage(Y,j,0,0,V.value,0,-1,-1);if(!De(Fe))throw new se("transcodeImage() failed.");l.push(Y.buffer),J[un[0]]={internalFormat:S,width:D,height:I,levelBuffer:Y}}return F.close(),F.delete(),p}async function Ar(s,T){let r=s.webAssemblyConfig,B=Tn.default??self.BASIS;return De(r.wasmBinaryFile)?be=await B(r):be=await B(),be.initializeBasis(),!0}function Tr(s,T){let r=s.webAssemblyConfig;return De(r)?Ar(s,T):Rr(s,T)}var Ur=on(Tr);export{Ur as default}; diff --git a/plugins/feature/map/Cesium/Workers/transferTypedArrayTest.js b/plugins/feature/map/Cesium/Workers/transferTypedArrayTest.js index 382b33b9b..208143eda 100644 --- a/plugins/feature/map/Cesium/Workers/transferTypedArrayTest.js +++ b/plugins/feature/map/Cesium/Workers/transferTypedArrayTest.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * diff --git a/plugins/feature/map/Cesium/Workers/upsampleQuantizedTerrainMesh.js b/plugins/feature/map/Cesium/Workers/upsampleQuantizedTerrainMesh.js index fe370a6f9..07f52ce2b 100644 --- a/plugins/feature/map/Cesium/Workers/upsampleQuantizedTerrainMesh.js +++ b/plugins/feature/map/Cesium/Workers/upsampleQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,4 +23,4 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -import{a as be,b as Ne}from"./chunk-G65SAF2P.js";import{a as Ae}from"./chunk-U3N6LNE4.js";import{a as ue}from"./chunk-LUT6AMUC.js";import{a as ee}from"./chunk-X6N776GR.js";import"./chunk-RQKZTHAV.js";import"./chunk-K6A7NKZT.js";import"./chunk-QFKZXFLI.js";import"./chunk-ASLWXOD7.js";import{a as Ve}from"./chunk-JQLYZQ6V.js";import{d as de}from"./chunk-ZYYZDBKK.js";import{h as Se}from"./chunk-3PT5NNSP.js";import"./chunk-WER4LUMF.js";import{a as A,b as Ie,c as Z,d as Ce}from"./chunk-FGKVHLJ4.js";import{a as N}from"./chunk-YRCAQUFT.js";import"./chunk-OVIPITBL.js";import"./chunk-SP23RJSN.js";import{a as V,b as q}from"./chunk-ELJAHN3H.js";import{e as f}from"./chunk-3BGP4HCL.js";var ne={};ne.clipTriangleAtAxisAlignedThreshold=function(n,h,o,i,s,e){if(!f(n))throw new V("threshold is required.");if(!f(h))throw new V("keepAbove is required.");if(!f(o))throw new V("u0 is required.");if(!f(i))throw new V("u1 is required.");if(!f(s))throw new V("u2 is required.");f(e)?e.length=0:e=[];let g,w,c;h?(g=o<n,w=i<n,c=s<n):(g=o>n,w=i>n,c=s>n);let p=g+w+c,d,u,r,l,I,C;return p===1?g?(d=(n-o)/(i-o),u=(n-o)/(s-o),e.push(1),e.push(2),u!==1&&(e.push(-1),e.push(0),e.push(2),e.push(u)),d!==1&&(e.push(-1),e.push(0),e.push(1),e.push(d))):w?(r=(n-i)/(s-i),l=(n-i)/(o-i),e.push(2),e.push(0),l!==1&&(e.push(-1),e.push(1),e.push(0),e.push(l)),r!==1&&(e.push(-1),e.push(1),e.push(2),e.push(r))):c&&(I=(n-s)/(o-s),C=(n-s)/(i-s),e.push(0),e.push(1),C!==1&&(e.push(-1),e.push(2),e.push(1),e.push(C)),I!==1&&(e.push(-1),e.push(2),e.push(0),e.push(I))):p===2?!g&&o!==n?(l=(n-i)/(o-i),I=(n-s)/(o-s),e.push(0),e.push(-1),e.push(1),e.push(0),e.push(l),e.push(-1),e.push(2),e.push(0),e.push(I)):!w&&i!==n?(C=(n-s)/(i-s),d=(n-o)/(i-o),e.push(1),e.push(-1),e.push(2),e.push(1),e.push(C),e.push(-1),e.push(0),e.push(1),e.push(d)):!c&&s!==n&&(u=(n-o)/(s-o),r=(n-i)/(s-i),e.push(2),e.push(-1),e.push(0),e.push(2),e.push(u),e.push(-1),e.push(1),e.push(2),e.push(r)):p!==3&&(e.push(0),e.push(1),e.push(2)),e};ne.computeBarycentricCoordinates=function(n,h,o,i,s,e,g,w,c){if(!f(n))throw new V("x is required.");if(!f(h))throw new V("y is required.");if(!f(o))throw new V("x1 is required.");if(!f(i))throw new V("y1 is required.");if(!f(s))throw new V("x2 is required.");if(!f(e))throw new V("y2 is required.");if(!f(g))throw new V("x3 is required.");if(!f(w))throw new V("y3 is required.");let p=o-g,d=g-s,u=e-w,r=i-w,l=1/(u*p+d*r),I=h-w,C=n-g,R=(u*C+d*I)*l,O=(-r*C+p*I)*l,W=1-R-O;return f(c)?(c.x=R,c.y=O,c.z=W,c):new A(R,O,W)};ne.computeLineSegmentLineSegmentIntersection=function(n,h,o,i,s,e,g,w,c){q.typeOf.number("x00",n),q.typeOf.number("y00",h),q.typeOf.number("x01",o),q.typeOf.number("y01",i),q.typeOf.number("x10",s),q.typeOf.number("y10",e),q.typeOf.number("x11",g),q.typeOf.number("y11",w);let p=(g-s)*(h-e)-(w-e)*(n-s),d=(o-n)*(h-e)-(i-h)*(n-s),u=(w-e)*(o-n)-(g-s)*(i-h);if(u===0)return;let r=p/u,l=d/u;if(r>=0&&r<=1&&l>=0&&l<=1)return f(c)||(c=new Z),c.x=n+r*(o-n),c.y=h+r*(i-h),c};var ie=ne;var a=32767,z=a/2|0,Me=[],ze=[],Xe=[],te=new Ie,E=new A,Ke=[],We=[],Ye=[],Le=[],_e=[],Je=new A,Qe=new de,Ze=new ue,Ge=new Z,$e=new A;function je(n,h){let o=n.isEastChild,i=n.isNorthChild,s=o?z:0,e=o?a:z,g=i?z:0,w=i?a:z,c=Ke,p=We,d=Ye,u=_e;c.length=0,p.length=0,d.length=0,u.length=0;let r=Le;r.length=0;let l={},I=n.vertices,C=n.indices;C=C.subarray(0,n.indexCountWithoutSkirts);let R=Ne.clone(n.encoding),O=R.hasVertexNormals,W=0,Y=n.vertexCountWithoutSkirts,se=n.minimumHeight,ae=n.maximumHeight,D=new Array(Y),G=new Array(Y),L=new Array(Y),F=O?new Array(Y*2):void 0,$=20,H,t,k,x,y;for(t=0,k=0;t<Y;++t,k+=2){let v=R.decodeTextureCoordinates(I,t,Ge);if(H=R.decodeHeight(I,t),x=N.clamp(v.x*a|0,0,a),y=N.clamp(v.y*a|0,0,a),L[t]=N.clamp((H-se)/(ae-se)*a|0,0,a),x<$&&(x=0),y<$&&(y=0),a-x<$&&(x=a),a-y<$&&(y=a),D[t]=x,G[t]=y,O){let Q=R.getOctEncodedNormal(I,t,$e);F[k]=Q.x,F[k+1]=Q.y}(o&&x>=z||!o&&x<=z)&&(i&&y>=z||!i&&y<=z)&&(l[t]=W,c.push(x),p.push(y),d.push(L[t]),O&&(u.push(F[k]),u.push(F[k+1])),++W)}let T=[];T.push(new m),T.push(new m),T.push(new m);let B=[];B.push(new m),B.push(new m),B.push(new m);let b,j;for(t=0;t<C.length;t+=3){let v=C[t],Q=C[t+1],Be=C[t+2],De=D[v],Fe=D[Q],ke=D[Be];T[0].initializeIndexed(D,G,L,F,v),T[1].initializeIndexed(D,G,L,F,Q),T[2].initializeIndexed(D,G,L,F,Be);let P=ie.clipTriangleAtAxisAlignedThreshold(z,o,De,Fe,ke,Me);b=0,!(b>=P.length)&&(b=B[0].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[1].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O),b<P.length&&(B[2].clone(B[1]),B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O)))))}let He=o?-a:0,qe=i?-a:0,me=[],ge=[],le=[],we=[],U=Number.MAX_VALUE,_=-U,M=Xe;M.length=0;let re=Ce.clone(n.ellipsoid),J=Se.clone(n.childRectangle),Ee=J.north,Re=J.south,ce=J.east,xe=J.west;for(ce<xe&&(ce+=N.TWO_PI),t=0;t<c.length;++t)x=Math.round(c[t]),x<=s?(me.push(t),x=0):x>=e?(le.push(t),x=a):x=x*2+He,c[t]=x,y=Math.round(p[t]),y<=g?(ge.push(t),y=0):y>=w?(we.push(t),y=a):y=y*2+qe,p[t]=y,H=N.lerp(se,ae,d[t]/a),H<U&&(U=H),H>_&&(_=H),d[t]=H,te.longitude=N.lerp(xe,ce,x/a),te.latitude=N.lerp(Re,Ee,y/a),te.height=H,re.cartographicToCartesian(te,E),M.push(E.x),M.push(E.y),M.push(E.z);let he=de.fromVertices(M,A.ZERO,3,Qe),Ue=ue.fromRectangle(J,U,_,re,Ze),ve=new be(re).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(he.center,M,3,he.center,U,Je),Pe=_-U,X=new Uint16Array(c.length+p.length+d.length);for(t=0;t<c.length;++t)X[t]=c[t];let fe=c.length;for(t=0;t<p.length;++t)X[fe+t]=p[t];for(fe+=p.length,t=0;t<d.length;++t)X[fe+t]=a*(d[t]-U)/Pe;let pe=Ve.createTypedArray(c.length,r),ye;if(O){let v=new Uint8Array(u);h.push(X.buffer,pe.buffer,v.buffer),ye=v.buffer}else h.push(X.buffer,pe.buffer);return{vertices:X.buffer,encodedNormals:ye,indices:pe.buffer,minimumHeight:U,maximumHeight:_,westIndices:me,southIndices:ge,eastIndices:le,northIndices:we,boundingSphere:he,orientedBoundingBox:Ue,horizonOcclusionPoint:ve}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}m.prototype.clone=function(n){return f(n)||(n=new m),n.uBuffer=this.uBuffer,n.vBuffer=this.vBuffer,n.heightBuffer=this.heightBuffer,n.normalBuffer=this.normalBuffer,n.index=this.index,n.first=this.first,n.second=this.second,n.ratio=this.ratio,n};m.prototype.initializeIndexed=function(n,h,o,i,s){this.uBuffer=n,this.vBuffer=h,this.heightBuffer=o,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0};m.prototype.initializeFromClipResult=function(n,h,o){let i=h+1;return n[h]!==-1?o[n[h]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=o[n[i]],++i,this.second=o[n[i]],++i,this.ratio=n[i],++i),i};m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})};m.prototype.isIndexed=function(){return f(this.index)};m.prototype.getH=function(){return f(this.index)?this.heightBuffer[this.index]:N.lerp(this.first.getH(),this.second.getH(),this.ratio)};m.prototype.getU=function(){return f(this.index)?this.uBuffer[this.index]:N.lerp(this.first.getU(),this.second.getU(),this.ratio)};m.prototype.getV=function(){return f(this.index)?this.vBuffer[this.index]:N.lerp(this.first.getV(),this.second.getV(),this.ratio)};var K=new Z,oe=-1,en=[new A,new A],nn=[new A,new A];function Te(n,h){++oe;let o=en[oe],i=nn[oe];return o=ee.octDecode(n.first.getNormalX(),n.first.getNormalY(),o),i=ee.octDecode(n.second.getNormalX(),n.second.getNormalY(),i),E=A.lerp(o,i,n.ratio,E),A.normalize(E,E),ee.octEncode(E,h),--oe,h}m.prototype.getNormalX=function(){return f(this.index)?this.normalBuffer[this.index*2]:(K=Te(this,K),K.x)};m.prototype.getNormalY=function(){return f(this.index)?this.normalBuffer[this.index*2+1]:(K=Te(this,K),K.y)};var S=[];S.push(new m);S.push(new m);S.push(new m);S.push(new m);function Oe(n,h,o,i,s,e,g,w,c){if(g.length===0)return;let p=0,d=0;for(;d<g.length;)d=S[p++].initializeFromClipResult(g,d,w);for(let u=0;u<p;++u){let r=S[u];if(r.isIndexed())r.newIndex=e[r.index],r.uBuffer=n,r.vBuffer=h,r.heightBuffer=o,c&&(r.normalBuffer=i);else{let l=r.getKey();if(f(e[l]))r.newIndex=e[l];else{let I=n.length;n.push(r.getU()),h.push(r.getV()),o.push(r.getH()),c&&(i.push(r.getNormalX()),i.push(r.getNormalY())),r.newIndex=I,e[l]=I}}}p===3?(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex)):p===4&&(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex),s.push(S[0].newIndex),s.push(S[2].newIndex),s.push(S[3].newIndex))}var An=Ae(je);export{An as default}; +import{a as be,c as Ne}from"./chunk-WVRWFNLS.js";import{a as Ae}from"./chunk-JJVL7F22.js";import{a as ue}from"./chunk-XAERMS6D.js";import{a as ee}from"./chunk-QCE33JV5.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import{a as Ve}from"./chunk-AZINMULF.js";import{c as de}from"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import{j as Se}from"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import{a as Ie,b as Z,c as Ce}from"./chunk-KP72RGCH.js";import{a as A}from"./chunk-OSVSBQDY.js";import{a as N}from"./chunk-LZC73BOP.js";import{a as V,b as q}from"./chunk-OU2IPMYE.js";import{f}from"./chunk-H7SJWKIY.js";var ne={};ne.clipTriangleAtAxisAlignedThreshold=function(n,h,o,i,s,e){if(!f(n))throw new V("threshold is required.");if(!f(h))throw new V("keepAbove is required.");if(!f(o))throw new V("u0 is required.");if(!f(i))throw new V("u1 is required.");if(!f(s))throw new V("u2 is required.");f(e)?e.length=0:e=[];let g,w,c;h?(g=o<n,w=i<n,c=s<n):(g=o>n,w=i>n,c=s>n);let p=g+w+c,d,u,r,l,I,C;return p===1?g?(d=(n-o)/(i-o),u=(n-o)/(s-o),e.push(1),e.push(2),u!==1&&(e.push(-1),e.push(0),e.push(2),e.push(u)),d!==1&&(e.push(-1),e.push(0),e.push(1),e.push(d))):w?(r=(n-i)/(s-i),l=(n-i)/(o-i),e.push(2),e.push(0),l!==1&&(e.push(-1),e.push(1),e.push(0),e.push(l)),r!==1&&(e.push(-1),e.push(1),e.push(2),e.push(r))):c&&(I=(n-s)/(o-s),C=(n-s)/(i-s),e.push(0),e.push(1),C!==1&&(e.push(-1),e.push(2),e.push(1),e.push(C)),I!==1&&(e.push(-1),e.push(2),e.push(0),e.push(I))):p===2?!g&&o!==n?(l=(n-i)/(o-i),I=(n-s)/(o-s),e.push(0),e.push(-1),e.push(1),e.push(0),e.push(l),e.push(-1),e.push(2),e.push(0),e.push(I)):!w&&i!==n?(C=(n-s)/(i-s),d=(n-o)/(i-o),e.push(1),e.push(-1),e.push(2),e.push(1),e.push(C),e.push(-1),e.push(0),e.push(1),e.push(d)):!c&&s!==n&&(u=(n-o)/(s-o),r=(n-i)/(s-i),e.push(2),e.push(-1),e.push(0),e.push(2),e.push(u),e.push(-1),e.push(1),e.push(2),e.push(r)):p!==3&&(e.push(0),e.push(1),e.push(2)),e};ne.computeBarycentricCoordinates=function(n,h,o,i,s,e,g,w,c){if(!f(n))throw new V("x is required.");if(!f(h))throw new V("y is required.");if(!f(o))throw new V("x1 is required.");if(!f(i))throw new V("y1 is required.");if(!f(s))throw new V("x2 is required.");if(!f(e))throw new V("y2 is required.");if(!f(g))throw new V("x3 is required.");if(!f(w))throw new V("y3 is required.");let p=o-g,d=g-s,u=e-w,r=i-w,l=1/(u*p+d*r),I=h-w,C=n-g,R=(u*C+d*I)*l,O=(-r*C+p*I)*l,W=1-R-O;return f(c)?(c.x=R,c.y=O,c.z=W,c):new A(R,O,W)};ne.computeLineSegmentLineSegmentIntersection=function(n,h,o,i,s,e,g,w,c){q.typeOf.number("x00",n),q.typeOf.number("y00",h),q.typeOf.number("x01",o),q.typeOf.number("y01",i),q.typeOf.number("x10",s),q.typeOf.number("y10",e),q.typeOf.number("x11",g),q.typeOf.number("y11",w);let p=(g-s)*(h-e)-(w-e)*(n-s),d=(o-n)*(h-e)-(i-h)*(n-s),u=(w-e)*(o-n)-(g-s)*(i-h);if(u===0)return;let r=p/u,l=d/u;if(r>=0&&r<=1&&l>=0&&l<=1)return f(c)||(c=new Z),c.x=n+r*(o-n),c.y=h+r*(i-h),c};var ie=ne;var a=32767,z=a/2|0,Me=[],ze=[],Xe=[],te=new Ie,E=new A,Ke=[],We=[],Ye=[],Le=[],_e=[],Je=new A,Qe=new de,Ze=new ue,Ge=new Z,$e=new A;function je(n,h){let o=n.isEastChild,i=n.isNorthChild,s=o?z:0,e=o?a:z,g=i?z:0,w=i?a:z,c=Ke,p=We,d=Ye,u=_e;c.length=0,p.length=0,d.length=0,u.length=0;let r=Le;r.length=0;let l={},I=n.vertices,C=n.indices;C=C.subarray(0,n.indexCountWithoutSkirts);let R=Ne.clone(n.encoding),O=R.hasVertexNormals,W=0,Y=n.vertexCountWithoutSkirts,se=n.minimumHeight,ae=n.maximumHeight,D=new Array(Y),G=new Array(Y),L=new Array(Y),F=O?new Array(Y*2):void 0,$=20,H,t,k,x,y;for(t=0,k=0;t<Y;++t,k+=2){let v=R.decodeTextureCoordinates(I,t,Ge);if(H=R.decodeHeight(I,t),x=N.clamp(v.x*a|0,0,a),y=N.clamp(v.y*a|0,0,a),L[t]=N.clamp((H-se)/(ae-se)*a|0,0,a),x<$&&(x=0),y<$&&(y=0),a-x<$&&(x=a),a-y<$&&(y=a),D[t]=x,G[t]=y,O){let Q=R.getOctEncodedNormal(I,t,$e);F[k]=Q.x,F[k+1]=Q.y}(o&&x>=z||!o&&x<=z)&&(i&&y>=z||!i&&y<=z)&&(l[t]=W,c.push(x),p.push(y),d.push(L[t]),O&&(u.push(F[k]),u.push(F[k+1])),++W)}let T=[];T.push(new m),T.push(new m),T.push(new m);let B=[];B.push(new m),B.push(new m),B.push(new m);let b,j;for(t=0;t<C.length;t+=3){let v=C[t],Q=C[t+1],Be=C[t+2],De=D[v],Fe=D[Q],ke=D[Be];T[0].initializeIndexed(D,G,L,F,v),T[1].initializeIndexed(D,G,L,F,Q),T[2].initializeIndexed(D,G,L,F,Be);let P=ie.clipTriangleAtAxisAlignedThreshold(z,o,De,Fe,ke,Me);b=0,!(b>=P.length)&&(b=B[0].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[1].initializeFromClipResult(P,b,T),!(b>=P.length)&&(b=B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O),b<P.length&&(B[2].clone(B[1]),B[2].initializeFromClipResult(P,b,T),j=ie.clipTriangleAtAxisAlignedThreshold(z,i,B[0].getV(),B[1].getV(),B[2].getV(),ze),Oe(c,p,d,u,r,l,j,B,O)))))}let He=o?-a:0,qe=i?-a:0,me=[],ge=[],le=[],we=[],U=Number.MAX_VALUE,_=-U,M=Xe;M.length=0;let re=Ce.clone(n.ellipsoid),J=Se.clone(n.childRectangle),Ee=J.north,Re=J.south,ce=J.east,xe=J.west;for(ce<xe&&(ce+=N.TWO_PI),t=0;t<c.length;++t)x=Math.round(c[t]),x<=s?(me.push(t),x=0):x>=e?(le.push(t),x=a):x=x*2+He,c[t]=x,y=Math.round(p[t]),y<=g?(ge.push(t),y=0):y>=w?(we.push(t),y=a):y=y*2+qe,p[t]=y,H=N.lerp(se,ae,d[t]/a),H<U&&(U=H),H>_&&(_=H),d[t]=H,te.longitude=N.lerp(xe,ce,x/a),te.latitude=N.lerp(Re,Ee,y/a),te.height=H,re.cartographicToCartesian(te,E),M.push(E.x),M.push(E.y),M.push(E.z);let he=de.fromVertices(M,A.ZERO,3,Qe),Ue=ue.fromRectangle(J,U,_,re,Ze),ve=new be(re).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(he.center,M,3,he.center,U,Je),Pe=_-U,X=new Uint16Array(c.length+p.length+d.length);for(t=0;t<c.length;++t)X[t]=c[t];let fe=c.length;for(t=0;t<p.length;++t)X[fe+t]=p[t];for(fe+=p.length,t=0;t<d.length;++t)X[fe+t]=a*(d[t]-U)/Pe;let pe=Ve.createTypedArray(c.length,r),ye;if(O){let v=new Uint8Array(u);h.push(X.buffer,pe.buffer,v.buffer),ye=v.buffer}else h.push(X.buffer,pe.buffer);return{vertices:X.buffer,encodedNormals:ye,indices:pe.buffer,minimumHeight:U,maximumHeight:_,westIndices:me,southIndices:ge,eastIndices:le,northIndices:we,boundingSphere:he,orientedBoundingBox:Ue,horizonOcclusionPoint:ve}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}m.prototype.clone=function(n){return f(n)||(n=new m),n.uBuffer=this.uBuffer,n.vBuffer=this.vBuffer,n.heightBuffer=this.heightBuffer,n.normalBuffer=this.normalBuffer,n.index=this.index,n.first=this.first,n.second=this.second,n.ratio=this.ratio,n};m.prototype.initializeIndexed=function(n,h,o,i,s){this.uBuffer=n,this.vBuffer=h,this.heightBuffer=o,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0};m.prototype.initializeFromClipResult=function(n,h,o){let i=h+1;return n[h]!==-1?o[n[h]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=o[n[i]],++i,this.second=o[n[i]],++i,this.ratio=n[i],++i),i};m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})};m.prototype.isIndexed=function(){return f(this.index)};m.prototype.getH=function(){return f(this.index)?this.heightBuffer[this.index]:N.lerp(this.first.getH(),this.second.getH(),this.ratio)};m.prototype.getU=function(){return f(this.index)?this.uBuffer[this.index]:N.lerp(this.first.getU(),this.second.getU(),this.ratio)};m.prototype.getV=function(){return f(this.index)?this.vBuffer[this.index]:N.lerp(this.first.getV(),this.second.getV(),this.ratio)};var K=new Z,oe=-1,en=[new A,new A],nn=[new A,new A];function Te(n,h){++oe;let o=en[oe],i=nn[oe];return o=ee.octDecode(n.first.getNormalX(),n.first.getNormalY(),o),i=ee.octDecode(n.second.getNormalX(),n.second.getNormalY(),i),E=A.lerp(o,i,n.ratio,E),A.normalize(E,E),ee.octEncode(E,h),--oe,h}m.prototype.getNormalX=function(){return f(this.index)?this.normalBuffer[this.index*2]:(K=Te(this,K),K.x)};m.prototype.getNormalY=function(){return f(this.index)?this.normalBuffer[this.index*2+1]:(K=Te(this,K),K.y)};var S=[];S.push(new m);S.push(new m);S.push(new m);S.push(new m);function Oe(n,h,o,i,s,e,g,w,c){if(g.length===0)return;let p=0,d=0;for(;d<g.length;)d=S[p++].initializeFromClipResult(g,d,w);for(let u=0;u<p;++u){let r=S[u];if(r.isIndexed())r.newIndex=e[r.index],r.uBuffer=n,r.vBuffer=h,r.heightBuffer=o,c&&(r.normalBuffer=i);else{let l=r.getKey();if(f(e[l]))r.newIndex=e[l];else{let I=n.length;n.push(r.getU()),h.push(r.getV()),o.push(r.getH()),c&&(i.push(r.getNormalX()),i.push(r.getNormalY())),r.newIndex=I,e[l]=I}}}p===3?(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex)):p===4&&(s.push(S[0].newIndex),s.push(S[1].newIndex),s.push(S[2].newIndex),s.push(S[0].newIndex),s.push(S[2].newIndex),s.push(S[3].newIndex))}var An=Ae(je);export{An as default}; diff --git a/plugins/feature/map/Cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js b/plugins/feature/map/Cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js new file mode 100644 index 000000000..0520bb2f8 --- /dev/null +++ b/plugins/feature/map/Cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js @@ -0,0 +1,26 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.145.0 + * + * 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. + */ + +import{a as f}from"./chunk-3AERAMWF.js";import"./chunk-V23IN42C.js";import"./chunk-WVRWFNLS.js";import{a as u}from"./chunk-JJVL7F22.js";import"./chunk-MQTDGHHT.js";import"./chunk-XAERMS6D.js";import"./chunk-QCE33JV5.js";import"./chunk-C5UTI7P4.js";import"./chunk-DV5LK4D5.js";import"./chunk-ZNBU4MZZ.js";import"./chunk-SIBAZPZR.js";import"./chunk-AZINMULF.js";import"./chunk-THB3EPLO.js";import"./chunk-QQWQKL3T.js";import"./chunk-YZ5ZCI55.js";import"./chunk-HLXNFZAZ.js";import"./chunk-WCOEOHX5.js";import"./chunk-ZJRS2FK6.js";import"./chunk-23IOGON7.js";import"./chunk-KP72RGCH.js";import"./chunk-OSVSBQDY.js";import"./chunk-LZC73BOP.js";import"./chunk-OU2IPMYE.js";import"./chunk-H7SJWKIY.js";function h(c,d){let e=f.upsampleMesh(c),t=e.vertices.buffer,i=e.indices.buffer,s=e.westIndicesSouthToNorth.buffer,o=e.southIndicesEastToWest.buffer,r=e.eastIndicesNorthToSouth.buffer,n=e.northIndicesWestToEast.buffer;return d.push(t,i,s,o,r,n),{verticesBuffer:t,indicesBuffer:i,vertexCountWithoutSkirts:e.vertexCountWithoutSkirts,indexCountWithoutSkirts:e.indexCountWithoutSkirts,encoding:e.encoding,westIndicesBuffer:s,southIndicesBuffer:o,eastIndicesBuffer:r,northIndicesBuffer:n,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:e.boundingSphere3D,orientedBoundingBox:e.orientedBoundingBox,horizonOcclusionPoint:e.horizonOcclusionPoint}}var I=u(h);export{I as default}; diff --git a/plugins/feature/map/Cesium/index.cjs b/plugins/feature/map/Cesium/index.cjs index ee557d019..618c77531 100644 --- a/plugins/feature/map/Cesium/index.cjs +++ b/plugins/feature/map/Cesium/index.cjs @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var xSe=Object.create;var TU=Object.defineProperty;var TSe=Object.getOwnPropertyDescriptor;var ASe=Object.getOwnPropertyNames;var CSe=Object.getPrototypeOf,ESe=Object.prototype.hasOwnProperty;var SSe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uJ=(e,t)=>{for(var n in t)TU(e,n,{get:t[n],enumerable:!0})},fJ=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ASe(t))!ESe.call(e,o)&&o!==n&&TU(e,o,{get:()=>t[o],enumerable:!(i=TSe(t,o))||i.enumerable});return e};var Zo=(e,t,n)=>(n=e!=null?xSe(CSe(e)):{},fJ(t||!e||!e.__esModule?TU(n,"default",{value:e,enumerable:!0}):n,e)),nm=e=>fJ(TU({},"__esModule",{value:!0}),e);var AU=Xn((pDt,dJ)=>{var Tp=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)};Tp.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}};Tp.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};Tp.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};Tp.prototype.random_int31=function(){return this.random_int()>>>1};Tp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Tp.prototype.random=function(){return this.random_int()*(1/4294967296)};Tp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Tp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};dJ.exports=Tp});var BJ=Xn((JA,eC)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof JA=="object"&&JA&&!JA.nodeType&&JA,n=typeof eC=="object"&&eC&&!eC.nodeType&&eC,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,l=26,u=38,f=700,h=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=s-a,C=Math.floor,S=String.fromCharCode,v;function P(V){throw new RangeError(x[V])}function M(V,j){for(var U=V.length,q=[];U--;)q[U]=j(V[U]);return q}function R(V,j){var U=V.split("@"),q="";U.length>1&&(q=U[0]+"@",V=U[1]),V=V.replace(b,".");var Y=V.split("."),te=M(Y,j).join(".");return q+te}function L(V){for(var j=[],U=0,q=V.length,Y,te;U<q;)Y=V.charCodeAt(U++),Y>=55296&&Y<=56319&&U<q?(te=V.charCodeAt(U++),(te&64512)==56320?j.push(((Y&1023)<<10)+(te&1023)+65536):(j.push(Y),U--)):j.push(Y);return j}function F(V){return M(V,function(j){var U="";return j>65535&&(j-=65536,U+=S(j>>>10&1023|55296),j=56320|j&1023),U+=S(j),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function w(V,j){return V+22+75*(V<26)-((j!=0)<<5)}function D(V,j,U){var q=0;for(V=U?C(V/f):V>>1,V+=C(V/j);V>A*l>>1;q+=s)V=C(V/A);return C(q+(A+1)*V/(V+u))}function I(V){var j=[],U=V.length,q,Y=0,te=p,K=h,Z,ee,me,Te,ue,ye,Ae,Pe,Ee;for(Z=V.lastIndexOf(g),Z<0&&(Z=0),ee=0;ee<Z;++ee)V.charCodeAt(ee)>=128&&P("not-basic"),j.push(V.charCodeAt(ee));for(me=Z>0?Z+1:0;me<U;){for(Te=Y,ue=1,ye=s;me>=U&&P("invalid-input"),Ae=_(V.charCodeAt(me++)),(Ae>=s||Ae>C((r-Y)/ue))&&P("overflow"),Y+=Ae*ue,Pe=ye<=K?a:ye>=K+l?l:ye-K,!(Ae<Pe);ye+=s)Ee=s-Pe,ue>C(r/Ee)&&P("overflow"),ue*=Ee;q=j.length+1,K=D(Y-Te,q,Te==0),C(Y/q)>r-te&&P("overflow"),te+=C(Y/q),Y%=q,j.splice(Y++,0,te)}return F(j)}function N(V){var j,U,q,Y,te,K,Z,ee,me,Te,ue,ye=[],Ae,Pe,Ee,ze;for(V=L(V),Ae=V.length,j=p,U=0,te=h,K=0;K<Ae;++K)ue=V[K],ue<128&&ye.push(S(ue));for(q=Y=ye.length,Y&&ye.push(g);q<Ae;){for(Z=r,K=0;K<Ae;++K)ue=V[K],ue>=j&&ue<Z&&(Z=ue);for(Pe=q+1,Z-j>C((r-U)/Pe)&&P("overflow"),U+=(Z-j)*Pe,j=Z,K=0;K<Ae;++K)if(ue=V[K],ue<j&&++U>r&&P("overflow"),ue==j){for(ee=U,me=s;Te=me<=te?a:me>=te+l?l:me-te,!(ee<Te);me+=s)ze=ee-Te,Ee=s-Te,ye.push(S(w(Te+ze%Ee,0))),ee=C(ze/Ee);ye.push(S(w(ee,0))),te=D(U,Pe,q==Y),U=0,++q}++U,++j}return ye.join("")}function k(V){return R(V,function(j){return m.test(j)?I(j.slice(4).toLowerCase()):j})}function z(V){return R(V,function(j){return y.test(j)?"xn--"+N(j):j})}if(o={version:"1.3.2",ucs2:{decode:L,encode:F},decode:I,encode:N,toASCII:z,toUnicode:k},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(eC.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(JA)});var UJ=Xn((kJ,jU)=>{/*! +"use strict";var a3e=Object.create;var eD=Object.defineProperty;var c3e=Object.getOwnPropertyDescriptor;var l3e=Object.getOwnPropertyNames;var u3e=Object.getPrototypeOf,f3e=Object.prototype.hasOwnProperty;var d3e=(e,t,n)=>t in e?eD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var hs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var Yi=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},vq=(e,t)=>{for(var n in t)eD(e,n,{get:t[n],enumerable:!0})},Xle=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l3e(t))!f3e.call(e,r)&&r!==n&&eD(e,r,{get:()=>t[r],enumerable:!(i=c3e(t,r))||i.enumerable});return e};var Qo=(e,t,n)=>(n=e!=null?a3e(u3e(e)):{},Xle(t||!e||!e.__esModule?eD(n,"default",{value:e,enumerable:!0}):n,e)),Fh=e=>Xle(eD({},"__esModule",{value:!0}),e);var ut=(e,t,n)=>d3e(e,typeof t!="symbol"?t+"":t,n);var fj=Yi((h9t,Kle)=>{var eg=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)};eg.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}};eg.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&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(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&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};eg.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};eg.prototype.random_int31=function(){return this.random_int()>>>1};eg.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};eg.prototype.random=function(){return this.random_int()*(1/4294967296)};eg.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};eg.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Kle.exports=eg});var Cue=Yi((ov,sv)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof ov=="object"&&ov&&!ov.nodeType&&ov,n=typeof sv=="object"&&sv&&!sv.nodeType&&sv,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=s-a,T=Math.floor,E=String.fromCharCode,v;function S(B){throw new RangeError(b[B])}function I(B,j){for(var k=B.length,G=[];k--;)G[k]=j(B[k]);return G}function R(B,j){var k=B.split("@"),G="";k.length>1&&(G=k[0]+"@",B=k[1]),B=B.replace(A,".");var q=B.split("."),Q=I(q,j).join(".");return G+Q}function O(B){for(var j=[],k=0,G=B.length,q,Q;k<G;)q=B.charCodeAt(k++),q>=55296&&q<=56319&&k<G?(Q=B.charCodeAt(k++),(Q&64512)==56320?j.push(((q&1023)<<10)+(Q&1023)+65536):(j.push(q),k--)):j.push(q);return j}function L(B){return I(B,function(j){var k="";return j>65535&&(j-=65536,k+=E(j>>>10&1023|55296),j=56320|j&1023),k+=E(j),k}).join("")}function _(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:s}function C(B,j){return B+22+75*(B<26)-((j!=0)<<5)}function w(B,j,k){var G=0;for(B=k?T(B/f):B>>1,B+=T(B/j);B>x*c>>1;G+=s)B=T(B/x);return T(G+(x+1)*B/(B+u))}function P(B){var j=[],k=B.length,G,q=0,Q=p,W=d,J,Z,ae,Ae,fe,xe,ge,we,Se;for(J=B.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)B.charCodeAt(Z)>=128&&S("not-basic"),j.push(B.charCodeAt(Z));for(ae=J>0?J+1:0;ae<k;){for(Ae=q,fe=1,xe=s;ae>=k&&S("invalid-input"),ge=_(B.charCodeAt(ae++)),(ge>=s||ge>T((o-q)/fe))&&S("overflow"),q+=ge*fe,we=xe<=W?a:xe>=W+c?c:xe-W,!(ge<we);xe+=s)Se=s-we,fe>T(o/Se)&&S("overflow"),fe*=Se;G=j.length+1,W=w(q-Ae,G,Ae==0),T(q/G)>o-Q&&S("overflow"),Q+=T(q/G),q%=G,j.splice(q++,0,Q)}return L(j)}function M(B){var j,k,G,q,Q,W,J,Z,ae,Ae,fe,xe=[],ge,we,Se,Re;for(B=O(B),ge=B.length,j=p,k=0,Q=d,W=0;W<ge;++W)fe=B[W],fe<128&&xe.push(E(fe));for(G=q=xe.length,q&&xe.push(g);G<ge;){for(J=o,W=0;W<ge;++W)fe=B[W],fe>=j&&fe<J&&(J=fe);for(we=G+1,J-j>T((o-k)/we)&&S("overflow"),k+=(J-j)*we,j=J,W=0;W<ge;++W)if(fe=B[W],fe<j&&++k>o&&S("overflow"),fe==j){for(Z=k,ae=s;Ae=ae<=Q?a:ae>=Q+c?c:ae-Q,!(Z<Ae);ae+=s)Re=Z-Ae,Se=s-Ae,xe.push(E(C(Ae+Re%Se,0))),Z=T(Re/Se);xe.push(E(C(Z,0))),Q=w(k,we,G==q),k=0,++G}++k,++j}return xe.join("")}function F(B){return R(B,function(j){return m.test(j)?P(j.slice(4).toLowerCase()):j})}function V(B){return R(B,function(j){return y.test(j)?"xn--"+M(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:L},decode:P,encode:M,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(sv.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(ov)});var Sue=Yi((vue,Pj)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ var xSe=Object.create;var TU=Object.defineProperty;var TSe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof jU=="object"&&jU.exports?jU.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(kJ,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,l=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&&(l=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<l)for(s.splice(u,1,"0000");s.length<l;)s.splice(u,0,"0000");for(var f,h=0;h<l;h++){f=s[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[h]=f.join("")}var g=-1,m=0,y=0,b=-1,x=!1;for(h=0;h<l;h++)x?s[h]==="0"?y+=1:(x=!1,y>m&&(g=b,m=y)):s[h]==="0"&&(x=!0,b=h,y=1);y>m&&(g=b,m=y),m>1&&s.splice(g,m,""),a=s.length;var A="";for(s[0]===""&&(A=":"),h=0;h<a&&(A+=s[h],h!==a-1);h++)A+=":";return s[a-1]===""&&(A+=":"),A}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var zJ=Xn((VJ,WU)=>{/*! + */(function(e,t){"use strict";typeof Pj=="object"&&Pj.exports?Pj.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(vue,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.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 u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,m=0,y=0,A=-1,b=!1;for(d=0;d<c;d++)b?s[d]==="0"?y+=1:(b=!1,y>m&&(g=A,m=y)):s[d]==="0"&&(b=!0,A=d,y=1);y>m&&(g=A,m=y),m>1&&s.splice(g,m,""),a=s.length;var x="";for(s[0]===""&&(x=":"),d=0;d<a&&(x+=s[d],d!==a-1);d++)x+=":";return s[a-1]===""&&(x+=":"),x}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Iue=Yi((wue,Dj)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ var xSe=Object.create;var TU=Object.defineProperty;var TSe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof WU=="object"&&WU.exports?WU.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(VJ,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 du=Xn((HJ,qU)=>{/*! + */(function(e,t){"use strict";typeof Dj=="object"&&Dj.exports?Dj.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(wue,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 r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Tf=Yi((Pue,Rj)=>{/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,26 +58,26 @@ var xSe=Object.create;var TU=Object.defineProperty;var TSe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof qU=="object"&&qU.exports?qU.exports=t(BJ(),UJ(),zJ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(HJ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(w,D){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(w,D):new r(w):new r;if(w===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?w=location.href+"":w=""}if(w===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(w),D!==void 0?this.absoluteTo(D):this}function s(w){return/^[0-9]+$/.test(w)}r.version="1.19.11";var a=r.prototype,l=Object.prototype.hasOwnProperty;function u(w){return w.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(w){return w===void 0?"Undefined":String(Object.prototype.toString.call(w)).slice(8,-1)}function h(w){return f(w)==="Array"}function p(w,D){var I={},N,k;if(f(D)==="RegExp")I=null;else if(h(D))for(N=0,k=D.length;N<k;N++)I[D[N]]=!0;else I[D]=!0;for(N=0,k=w.length;N<k;N++){var z=I&&I[w[N]]!==void 0||!I&&D.test(w[N]);z&&(w.splice(N,1),k--,N--)}return w}function g(w,D){var I,N;if(h(D)){for(I=0,N=D.length;I<N;I++)if(!g(w,D[I]))return!1;return!0}var k=f(D);for(I=0,N=w.length;I<N;I++)if(k==="RegExp"){if(typeof w[I]=="string"&&w[I].match(D))return!0}else if(w[I]===D)return!0;return!1}function m(w,D){if(!h(w)||!h(D)||w.length!==D.length)return!1;w.sort(),D.sort();for(var I=0,N=w.length;I<N;I++)if(w[I]!==D[I])return!1;return!0}function y(w){var D=/^\/+|\/+$/g;return w.replace(D,"")}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}\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%.+)?\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(w){if(!(!w||!w.nodeName)){var D=w.nodeName.toLowerCase();if(!(D==="input"&&w.type!=="image"))return r.domAttributes[D]}};function b(w){return escape(w)}function x(w){return encodeURIComponent(w).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=x,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=x,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(w,D){var I=r.encode(w+"");return D===void 0&&(D=r.escapeQuerySpace),D?I.replace(/%20/g,"+"):I},r.decodeQuery=function(w,D){w+="",D===void 0&&(D=r.escapeQuerySpace);try{return r.decode(D?w.replace(/\+/g,"%20"):w)}catch{return w}};var A={encode:"encode",decode:"decode"},C,S=function(w,D){return function(I){try{return r[D](I+"").replace(r.characters[w][D].expression,function(N){return r.characters[w][D].map[N]})}catch{return I}}};for(C in A)r[C+"PathSegment"]=S("pathname",A[C]),r[C+"UrnPathSegment"]=S("urnpath",A[C]);var v=function(w,D,I){return function(N){var k;I?k=function(U){return r[D](r[I](U))}:k=r[D];for(var z=(N+"").split(w),V=0,j=z.length;V<j;V++)z[V]=k(z[V]);return z.join(w)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=S("reserved","encode"),r.parse=function(w,D){var I;return D||(D={preventInvalidHostname:r.preventInvalidHostname}),w=w.replace(r.leading_whitespace_expression,""),w=w.replace(r.ascii_tab_whitespace,""),I=w.indexOf("#"),I>-1&&(D.fragment=w.substring(I+1)||null,w=w.substring(0,I)),I=w.indexOf("?"),I>-1&&(D.query=w.substring(I+1)||null,w=w.substring(0,I)),w=w.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),w=w.replace(/^[/\\]{2,}/i,"//"),w.substring(0,2)==="//"?(D.protocol=null,w=w.substring(2),w=r.parseAuthority(w,D)):(I=w.indexOf(":"),I>-1&&(D.protocol=w.substring(0,I)||null,D.protocol&&!D.protocol.match(r.protocol_expression)?D.protocol=void 0:w.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(w=w.substring(I+3),w=r.parseAuthority(w,D)):(w=w.substring(I+1),D.urn=!0))),D.path=w,D},r.parseHost=function(w,D){w||(w=""),w=w.replace(/\\/g,"/");var I=w.indexOf("/"),N,k;if(I===-1&&(I=w.length),w.charAt(0)==="[")N=w.indexOf("]"),D.hostname=w.substring(1,N)||null,D.port=w.substring(N+2,I)||null,D.port==="/"&&(D.port=null);else{var z=w.indexOf(":"),V=w.indexOf("/"),j=w.indexOf(":",z+1);j!==-1&&(V===-1||j<V)?(D.hostname=w.substring(0,I)||null,D.port=null):(k=w.substring(0,I).split(":"),D.hostname=k[0]||null,D.port=k[1]||null)}return D.hostname&&w.substring(I).charAt(0)!=="/"&&(I++,w="/"+w),D.preventInvalidHostname&&r.ensureValidHostname(D.hostname,D.protocol),D.port&&r.ensureValidPort(D.port),w.substring(I)||"/"},r.parseAuthority=function(w,D){return w=r.parseUserinfo(w,D),r.parseHost(w,D)},r.parseUserinfo=function(w,D){var I=w,N=w.indexOf("\\");N!==-1&&(w=w.replace(/\\/g,"/"));var k=w.indexOf("/"),z=w.lastIndexOf("@",k>-1?k:w.length-1),V;return z>-1&&(k===-1||z<k)?(V=w.substring(0,z).split(":"),D.username=V[0]?r.decode(V[0]):null,V.shift(),D.password=V[0]?r.decode(V.join(":")):null,w=I.substring(z+1)):(D.username=null,D.password=null),w},r.parseQuery=function(w,D){if(!w)return{};if(w=w.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!w)return{};for(var I={},N=w.split("&"),k=N.length,z,V,j,U=0;U<k;U++)z=N[U].split("="),V=r.decodeQuery(z.shift(),D),j=z.length?r.decodeQuery(z.join("="),D):null,V!=="__proto__"&&(l.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(j)):I[V]=j);return I},r.build=function(w){var D="",I=!1;return w.protocol&&(D+=w.protocol+":"),!w.urn&&(D||w.hostname)&&(D+="//",I=!0),D+=r.buildAuthority(w)||"",typeof w.path=="string"&&(w.path.charAt(0)!=="/"&&I&&(D+="/"),D+=w.path),typeof w.query=="string"&&w.query&&(D+="?"+w.query),typeof w.fragment=="string"&&w.fragment&&(D+="#"+w.fragment),D},r.buildHost=function(w){var D="";if(w.hostname)r.ip6_expression.test(w.hostname)?D+="["+w.hostname+"]":D+=w.hostname;else return"";return w.port&&(D+=":"+w.port),D},r.buildAuthority=function(w){return r.buildUserinfo(w)+r.buildHost(w)},r.buildUserinfo=function(w){var D="";return w.username&&(D+=r.encode(w.username)),w.password&&(D+=":"+r.encode(w.password)),D&&(D+="@"),D},r.buildQuery=function(w,D,I){var N="",k,z,V,j;for(z in w)if(z!=="__proto__"&&l.call(w,z))if(h(w[z]))for(k={},V=0,j=w[z].length;V<j;V++)w[z][V]!==void 0&&k[w[z][V]+""]===void 0&&(N+="&"+r.buildQueryParameter(z,w[z][V],I),D!==!0&&(k[w[z][V]+""]=!0));else w[z]!==void 0&&(N+="&"+r.buildQueryParameter(z,w[z],I));return N.substring(1)},r.buildQueryParameter=function(w,D,I){return r.encodeQuery(w,I)+(D!==null?"="+r.encodeQuery(D,I):"")},r.addQuery=function(w,D,I){if(typeof D=="object")for(var N in D)l.call(D,N)&&r.addQuery(w,N,D[N]);else if(typeof D=="string"){if(w[D]===void 0){w[D]=I;return}else typeof w[D]=="string"&&(w[D]=[w[D]]);h(I)||(I=[I]),w[D]=(w[D]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(w,D,I){if(typeof D=="object")for(var N in D)l.call(D,N)&&r.setQuery(w,N,D[N]);else if(typeof D=="string")w[D]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(w,D,I){var N,k,z;if(h(D))for(N=0,k=D.length;N<k;N++)w[D[N]]=void 0;else if(f(D)==="RegExp")for(z in w)D.test(z)&&(w[z]=void 0);else if(typeof D=="object")for(z in D)l.call(D,z)&&r.removeQuery(w,z,D[z]);else if(typeof D=="string")I!==void 0?f(I)==="RegExp"?!h(w[D])&&I.test(w[D])?w[D]=void 0:w[D]=p(w[D],I):w[D]===String(I)&&(!h(I)||I.length===1)?w[D]=void 0:h(w[D])&&(w[D]=p(w[D],I)):w[D]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(w,D,I,N){switch(f(D)){case"String":break;case"RegExp":for(var k in w)if(l.call(w,k)&&D.test(k)&&(I===void 0||r.hasQuery(w,k,I)))return!0;return!1;case"Object":for(var z in D)if(l.call(D,z)&&!r.hasQuery(w,z,D[z]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return D in w;case"Boolean":var V=!!(h(w[D])?w[D].length:w[D]);return I===V;case"Function":return!!I(w[D],D,w);case"Array":if(!h(w[D]))return!1;var j=N?g:m;return j(w[D],I);case"RegExp":return h(w[D])?N?g(w[D],I):!1:!!(w[D]&&w[D].match(I));case"Number":I=String(I);case"String":return h(w[D])?N?g(w[D],I):!1:w[D]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var w=[],D=[],I=0,N=0;N<arguments.length;N++){var k=new r(arguments[N]);w.push(k);for(var z=k.segment(),V=0;V<z.length;V++)typeof z[V]=="string"&&D.push(z[V]),z[V]&&I++}if(!D.length||!I)return new r("");var j=new r("").segment(D);return(w[0].path()===""||w[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},r.commonPath=function(w,D){var I=Math.min(w.length,D.length),N;for(N=0;N<I;N++)if(w.charAt(N)!==D.charAt(N)){N--;break}return N<1?w.charAt(0)===D.charAt(0)&&w.charAt(0)==="/"?"/":"":((w.charAt(N)!=="/"||D.charAt(N)!=="/")&&(N=w.substring(0,N).lastIndexOf("/")),w.substring(0,N+1))},r.withinString=function(w,D,I){I||(I={});var N=I.start||r.findUri.start,k=I.end||r.findUri.end,z=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var U=N.exec(w);if(!U)break;var q=U.index;if(I.ignoreHtml){var Y=w.slice(Math.max(q-3,0),q);if(Y&&j.test(Y))continue}for(var te=q+w.slice(q).search(k),K=w.slice(q,te),Z=-1;;){var ee=V.exec(K);if(!ee)break;var me=ee.index+ee[0].length;Z=Math.max(Z,me)}if(Z>-1?K=K.slice(0,Z)+K.slice(Z).replace(z,""):K=K.replace(z,""),!(K.length<=U[0].length)&&!(I.ignore&&I.ignore.test(K))){te=q+K.length;var Te=D(K,q,te,w);if(Te===void 0){N.lastIndex=te;continue}Te=String(Te),w=w.slice(0,q)+Te+w.slice(te),N.lastIndex=q+Te.length}}return N.lastIndex=0,w},r.ensureValidHostname=function(w,D){var I=!!w,N=!!D,k=!1;if(N&&(k=g(r.hostProtocols,D)),k&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+D);if(w&&w.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(w).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(w){if(w){var D=Number(w);if(!(s(D)&&D>0&&D<65536))throw new TypeError('Port "'+w+'" is not a valid port')}},r.noConflict=function(w){if(w){var D={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(D.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(D.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(D.SecondLevelDomains=i.SecondLevelDomains.noConflict()),D}else i.URI===this&&(i.URI=o);return this},a.build=function(w){return w===!0?this._deferred_build=!0:(w===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 P(w){return function(D,I){return D===void 0?this._parts[w]||"":(this._parts[w]=D||null,this.build(!I),this)}}function M(w,D){return function(I,N){return I===void 0?this._parts[w]||"":(I!==null&&(I=I+"",I.charAt(0)===D&&(I=I.substring(1))),this._parts[w]=I,this.build(!N),this)}}a.protocol=P("protocol"),a.username=P("username"),a.password=P("password"),a.hostname=P("hostname"),a.port=P("port"),a.query=M("query","?"),a.fragment=M("fragment","#"),a.search=function(w,D){var I=this.query(w,D);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(w,D){var I=this.fragment(w,D);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(w,D){if(w===void 0||w===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return w?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=w?r.recodeUrnPath(w):"":this._parts.path=w?r.recodePath(w):"/",this.build(!D),this},a.path=a.pathname,a.href=function(w,D){var I;if(w===void 0)return this.toString();this._string="",this._parts=r._parts();var N=w instanceof r,k=typeof w=="object"&&(w.hostname||w.path||w.pathname);if(w.nodeName){var z=r.getDomAttribute(w);w=w[z]||"",k=!1}if(!N&&k&&w.pathname!==void 0&&(w=w.toString()),typeof w=="string"||w instanceof String)this._parts=r.parse(String(w),this._parts);else if(N||k){var V=N?w._parts:w;for(I in V)I!=="query"&&l.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!D),this},a.is=function(w){var D=!1,I=!1,N=!1,k=!1,z=!1,V=!1,j=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),D=I||N,k=!D,z=k&&n&&n.has(this._parts.hostname),V=k&&r.idn_expression.test(this._parts.hostname),j=k&&r.punycode_expression.test(this._parts.hostname)),w.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return k;case"sld":return z;case"ip":return D;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,L=a.port,F=a.hostname;a.protocol=function(w,D){if(w&&(w=w.replace(/:(\/\/)?$/,""),!w.match(r.protocol_expression)))throw new TypeError('Protocol "'+w+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,w,D)},a.scheme=a.protocol,a.port=function(w,D){return this._parts.urn?w===void 0?"":this:(w!==void 0&&(w===0&&(w=null),w&&(w+="",w.charAt(0)===":"&&(w=w.substring(1)),r.ensureValidPort(w))),L.call(this,w,D))},a.hostname=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(w,I);if(N!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');w=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(w,this._parts.protocol)}return F.call(this,w,D)},a.origin=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var k=r(w);return this.protocol(k.protocol()).authority(k.authority()).build(!D),this}},a.host=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.authority=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.userinfo=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return w[w.length-1]!=="@"&&(w+="@"),r.parseUserinfo(w,this._parts),this.build(!D),this},a.resource=function(w,D){var I;return w===void 0?this.path()+this.search()+this.hash():(I=r.parse(w),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!D),this)},a.subdomain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var N=this._parts.hostname.length-this.domain().length,k=this._parts.hostname.substring(0,N),z=new RegExp("^"+u(k));if(w&&w.charAt(w.length-1)!=="."&&(w+="."),w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return w&&r.ensureValidHostname(w,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(z,w),this.build(!D),this}},a.domain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(D).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!w)throw new TypeError("cannot set domain empty");if(w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(w,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=w;else{var k=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(k,w)}return this.build(!D),this}},a.tld=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return D!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var k;if(w)if(w.match(/[^a-zA-Z0-9-]/))if(n&&n.is(w))k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w);else throw new TypeError('TLD "'+w+'" 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");k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w)}else throw new TypeError("cannot set TLD empty");return this.build(!D),this}},a.directory=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return w?r.decodePath(N):N}else{var k=this._parts.path.length-this.filename().length,z=this._parts.path.substring(0,k),V=new RegExp("^"+u(z));return this.is("relative")||(w||(w="/"),w.charAt(0)!=="/"&&(w="/"+w)),w&&w.charAt(w.length-1)!=="/"&&(w+="/"),w=r.recodePath(w),this._parts.path=this._parts.path.replace(V,w),this.build(!D),this}},a.filename=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return w?r.decodePathSegment(N):N}else{var k=!1;w.charAt(0)==="/"&&(w=w.substring(1)),w.match(/\.?\//)&&(k=!0);var z=new RegExp(u(this.filename())+"$");return w=r.recodePath(w),this._parts.path=this._parts.path.replace(z,w),k?this.normalizePath(D):this.build(!D),this}},a.suffix=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),k,z;return N===-1?"":(k=I.substring(N+1),z=/^[a-z0-9%]+$/i.test(k)?k:"",w?r.decodePathSegment(z):z)}else{w.charAt(0)==="."&&(w=w.substring(1));var V=this.suffix(),j;if(V)w?j=new RegExp(u(V)+"$"):j=new RegExp(u("."+V)+"$");else{if(!w)return this;this._parts.path+="."+r.recodePath(w)}return j&&(w=r.recodePath(w),this._parts.path=this._parts.path.replace(j,w)),this.build(!D),this}},a.segment=function(w,D,I){var N=this._parts.urn?":":"/",k=this.path(),z=k.substring(0,1)==="/",V=k.split(N);if(w!==void 0&&typeof w!="number"&&(I=D,D=w,w=void 0),w!==void 0&&typeof w!="number")throw new Error('Bad segment "'+w+'", must be 0-based integer');if(z&&V.shift(),w<0&&(w=Math.max(V.length+w,0)),D===void 0)return w===void 0?V:V[w];if(w===null||V[w]===void 0)if(h(D)){V=[];for(var j=0,U=D.length;j<U;j++)!D[j].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(y(D[j])))}else(D||typeof D=="string")&&(D=y(D),V[V.length-1]===""?V[V.length-1]=D:V.push(D));else D?V[w]=y(D):V.splice(w,1);return z&&V.unshift(""),this.path(V.join(N),I)},a.segmentCoded=function(w,D,I){var N,k,z;if(typeof w!="number"&&(I=D,D=w,w=void 0),D===void 0){if(N=this.segment(w,D,I),!h(N))N=N!==void 0?r.decode(N):void 0;else for(k=0,z=N.length;k<z;k++)N[k]=r.decode(N[k]);return N}if(!h(D))D=typeof D=="string"||D instanceof String?r.encode(D):D;else for(k=0,z=D.length;k<z;k++)D[k]=r.encode(D[k]);return this.segment(w,D,I)};var _=a.query;return a.query=function(w,D){if(w===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=w.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!D),this}else return w!==void 0&&typeof w!="string"?(this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!D),this):_.call(this,w,D)},a.setQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="string"||w instanceof String)N[w]=D!==void 0?D:null;else if(typeof w=="object")for(var k in w)l.call(w,k)&&(N[k]=w[k]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.addQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,w,D===void 0?null:D),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.removeQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,w,D),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.hasQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,w,D,I)},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(w){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!w)),this},a.normalizeHostname=function(w){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(!w)),this},a.normalizePort=function(w){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!w)),this},a.normalizePath=function(w){var D=this._parts.path;if(!D)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!w),this;if(this._parts.path==="/")return this;D=r.recodePath(D);var I,N="",k,z;for(D.charAt(0)!=="/"&&(I=!0,D="/"+D),(D.slice(-3)==="/.."||D.slice(-2)==="/.")&&(D+="/"),D=D.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=D.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));k=D.search(/\/\.\.(\/|$)/),k!==-1;){if(k===0){D=D.substring(3);continue}z=D.substring(0,k).lastIndexOf("/"),z===-1&&(z=k),D=D.substring(0,z)+D.substring(k+3)}return I&&this.is("relative")&&(D=N+D.substring(1)),this._parts.path=D,this.build(!w),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(w){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(!w)),this},a.normalizeFragment=function(w){return this._parts.fragment||(this._parts.fragment=null,this.build(!w)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var w=r.encode,D=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=w,r.decode=D}return this},a.unicode=function(){var w=r.encode,D=r.decode;r.encode=x,r.decode=unescape;try{this.normalize()}finally{r.encode=w,r.decode=D}return this},a.readable=function(){var w=this.clone();w.username("").password("").normalize();var D="";if(w._parts.protocol&&(D+=w._parts.protocol+"://"),w._parts.hostname&&(w.is("punycode")&&e?(D+=e.toUnicode(w._parts.hostname),w._parts.port&&(D+=":"+w._parts.port)):D+=w.host()),w._parts.hostname&&w._parts.path&&w._parts.path.charAt(0)!=="/"&&(D+="/"),D+=w.path(!0),w._parts.query){for(var I="",N=0,k=w._parts.query.split("&"),z=k.length;N<z;N++){var V=(k[N]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}D+="?"+I.substring(1)}return D+=r.decodeQuery(w.hash(),!0),D},a.absoluteTo=function(w){var D=this.clone(),I=["protocol","username","password","hostname","port"],N,k,z;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w instanceof r||(w=new r(w)),D._parts.protocol||(D._parts.protocol=w._parts.protocol,this._parts.hostname))return D;for(k=0;z=I[k];k++)D._parts[z]=w._parts[z];return D._parts.path?(D._parts.path.substring(-2)===".."&&(D._parts.path+="/"),D.path().charAt(0)!=="/"&&(N=w.directory(),N=N||(w.path().indexOf("/")===0?"/":""),D._parts.path=(N?N+"/":"")+D._parts.path,D.normalizePath())):(D._parts.path=w._parts.path,D._parts.query||(D._parts.query=w._parts.query)),D.build(),D},a.relativeTo=function(w){var D=this.clone().normalize(),I,N,k,z,V;if(D._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w=new r(w).normalize(),I=D._parts,N=w._parts,z=D.path(),V=w.path(),z.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return D.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return D.build();if(z===V)return I.path="",D.build();if(k=r.commonPath(z,V),!k)return D.build();var j=N.path.substring(k.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=j+I.path.substring(k.length)||"./",D.build()},a.equals=function(w){var D=this.clone(),I=new r(w),N={},k={},z={},V,j,U;if(D.normalize(),I.normalize(),D.toString()===I.toString())return!0;if(V=D.query(),j=I.query(),D.query(""),I.query(""),D.toString()!==I.toString()||V.length!==j.length)return!1;N=r.parseQuery(V,this._parts.escapeQuerySpace),k=r.parseQuery(j,this._parts.escapeQuerySpace);for(U in N)if(l.call(N,U)){if(h(N[U])){if(!m(N[U],k[U]))return!1}else if(N[U]!==k[U])return!1;z[U]=!0}for(U in k)if(l.call(k,U)&&!z[U])return!1;return!0},a.preventInvalidHostname=function(w){return this._parts.preventInvalidHostname=!!w,this},a.duplicateQueryParameters=function(w){return this._parts.duplicateQueryParameters=!!w,this},a.escapeQuerySpace=function(w){return this._parts.escapeQuerySpace=!!w,this},r})});var Wre=Xn((s1,h9)=>{var JV=function(){"use strict";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 m=new Uint8Array(g.length),y=0;y<g.length;++y){var b=g.charCodeAt(y);m[y]=b>96?b-97:b>64?b-39:b+4}for(var x=0,y=0;y<g.length;++y)m[x++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,x)}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,m,y,b){var x=n.exports.sbrk,A=x(m.length*4),C=x(y*4),S=new Uint8Array(n.exports.memory.buffer),v=s(m);S.set(v,A),b&&b(A,A,m.length,y);var P=g(C,A,m.length,y);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(y);new Uint8Array(M.buffer).set(S.subarray(C,C+y*4)),v.set(S.subarray(A,A+m.length*4)),x(A-x(0));for(var R=0;R<m.length;++R)m[R]=M[m[R]];return[M,P]}function l(g,m,y,b){var x=n.exports.sbrk,A=x(y*4),C=x(y*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),C),g(A,C,y,b),S=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(S.subarray(A,A+y*4)),x(A-x(0)),v}function u(g,m,y,b,x){var A=n.exports.sbrk,C=A(m),S=A(b*x),v=new Uint8Array(n.exports.memory.buffer);v.set(s(y),S);var P=g(C,m,S,b,x),M=new Uint8Array(P);return M.set(v.subarray(C,C+P)),A(C-A(0)),M}function f(g){for(var m=0,y=0;y<g.length;++y){var b=g[y];m=m<b?b:m}return m}function h(g,m){if(r(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,b,x,A,C){var S=n.exports.sbrk,v=S(y*b),P=S(y*A),M=new Uint8Array(n.exports.memory.buffer);M.set(s(m),P),g(v,y,b,x,P,C);var R=new Uint8Array(y*b);return R.set(M.subarray(v,v+y*b)),S(v-S(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){var b=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,b)},reorderPoints:function(g,m){return r(g instanceof Float32Array),r(g.length%m==0),r(m>=3),l(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){r(y>0&&y<=256),r(y%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,b,g,m,y)},encodeIndexBuffer:function(g,m,y){r(y==2||y==4),r(m%3==0);var b=h(g,y),x=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,x,b,m,4)},encodeIndexSequence:function(g,m,y){r(y==2||y==4);var b=h(g,y),x=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,x,b,m,4)},encodeGltfBuffer:function(g,m,y,b){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(x[b]),x[b](g,m,y)},encodeFilterOct:function(g,m,y,b){return r(y==4||y==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,b,16)},encodeFilterQuat:function(g,m,y,b){return r(y==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,b,16)},encodeFilterExp:function(g,m,y,b,x){r(y>0&&y%4==0),r(b>=1&&b<=24);var A={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,m,y,b,y,x?A[x]:1)}}}();typeof s1=="object"&&typeof h9=="object"?h9.exports=JV:typeof define=="function"&&define.amd?define([],function(){return JV}):typeof s1=="object"?s1.MeshoptEncoder=JV:(typeof self<"u"?self:s1).MeshoptEncoder=JV});var qre=Xn((a1,m9)=>{var ez=function(){"use strict";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(x){r=x.instance,r.exports.__wasm_call_ctors()});function a(x){for(var A=new Uint8Array(x.length),C=0;C<x.length;++C){var S=x.charCodeAt(C);A[C]=S>96?S-97:S>64?S-39:S+4}for(var v=0,C=0;C<x.length;++C)A[v++]=A[C]<60?i[A[C]]:(A[C]-60)*64+A[++C];return A.buffer.slice(0,v)}function l(x,A,C,S,v,P,M){var R=x.exports.sbrk,L=S+3&-4,F=R(L*v),_=R(P.length),w=new Uint8Array(x.exports.memory.buffer);w.set(P,_);var D=A(F,S,v,_,P.length);if(D==0&&M&&M(F,L,v),C.set(w.subarray(F,F+S*v)),R(F-R(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function g(x){var A={object:new Worker(x),pending:0,requests:{}};return A.object.onmessage=function(C){var S=C.data;A.pending-=S.count,A.requests[S.id][S.action](S.value),delete A.requests[S.id]},A}function m(x){for(var A="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+l.toString()+b.toString(),C=new Blob([A],{type:"text/javascript"}),S=URL.createObjectURL(C),v=h.length;v<x;++v)h[v]=g(S);for(var v=x;v<h.length;++v)h[v].object.postMessage({});h.length=x,URL.revokeObjectURL(S)}function y(x,A,C,S,v){for(var P=h[0],M=1;M<h.length;++M)h[M].pending<P.pending&&(P=h[M]);return new Promise(function(R,L){var F=new Uint8Array(C),_=++p;P.pending+=x,P.requests[_]={resolve:R,reject:L},P.object.postMessage({id:_,count:x,size:A,source:F,mode:S,filter:v},[F.buffer])})}function b(x){var A=x.data;if(!A.id)return self.close();self.ready.then(function(C){try{var S=new Uint8Array(A.count*A.size);l(C,C.exports[A.mode],S,A.count,A.size,A.source,C.exports[A.filter]),self.postMessage({id:A.id,count:A.count,action:"resolve",value:S},[S.buffer])}catch(v){self.postMessage({id:A.id,count:A.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(x){m(x)},decodeVertexBuffer:function(x,A,C,S,v){l(r,r.exports.meshopt_decodeVertexBuffer,x,A,C,S,r.exports[u[v]])},decodeIndexBuffer:function(x,A,C,S){l(r,r.exports.meshopt_decodeIndexBuffer,x,A,C,S)},decodeIndexSequence:function(x,A,C,S){l(r,r.exports.meshopt_decodeIndexSequence,x,A,C,S)},decodeGltfBuffer:function(x,A,C,S,v,P){l(r,r.exports[f[v]],x,A,C,S,r.exports[u[P]])},decodeGltfBufferAsync:function(x,A,C,S,v){return h.length>0?y(x,A,C,f[S],u[v]):s.then(function(){var P=new Uint8Array(x*A);return l(r,r.exports[f[S]],P,x,A,C,r.exports[u[v]]),P})}}}();typeof a1=="object"&&typeof m9=="object"?m9.exports=ez:typeof define=="function"&&define.amd?define([],function(){return ez}):typeof a1=="object"?a1.MeshoptDecoder=ez:(typeof self<"u"?self:a1).MeshoptDecoder=ez});var Yre=Xn((c1,p9)=>{var tz=function(){"use strict";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;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdb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efBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIda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eclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b<m.length;++b)y[A++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,A)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,y,b){var x=n.exports.sbrk,A=x(y.length*4),C=x(b*4),S=new Uint8Array(n.exports.memory.buffer),v=s(y);S.set(v,A);var P=m(C,A,y.length,b);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(b);new Uint8Array(M.buffer).set(S.subarray(C,C+b*4)),v.set(S.subarray(A,A+y.length*4)),x(A-x(0));for(var R=0;R<y.length;++R)y[R]=M[y[R]];return[M,P]}function l(m){for(var y=0,b=0;b<m.length;++b){var x=m[b];y=y<x?x:y}return y}function u(m,y,b,x,A,C,S,v,P){var M=n.exports.sbrk,R=M(4),L=M(b*4),F=M(A*C),_=M(b*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(x),F),w.set(s(y),_);var D=m(L,_,b,F,A,C,S,v,P,R);w=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(D);s(I).set(w.subarray(L,L+D*4));var N=new Float32Array(1);return s(N).set(w.subarray(R,R+4)),M(R-M(0)),[I,N[0]]}function f(m,y,b,x,A,C,S,v,P,M,R,L,F){var _=n.exports.sbrk,w=_(4),D=_(b*4),I=_(A*C),N=_(A*v),k=_(P.length*4),z=_(b*4),V=M?_(A):0,j=new Uint8Array(n.exports.memory.buffer);j.set(s(x),I),j.set(s(S),N),j.set(s(P),k),j.set(s(y),z),M&&j.set(s(M),V);var U=m(D,z,b,I,A,C,N,v,k,P.length,V,R,L,F,w);j=new Uint8Array(n.exports.memory.buffer);var q=new Uint32Array(U);s(q).set(j.subarray(D,D+U*4));var Y=new Float32Array(1);return s(Y).set(j.subarray(w,w+4)),_(w-_(0)),[q,Y[0]]}function h(m,y,b,x){var A=n.exports.sbrk,C=A(b*x),S=new Uint8Array(n.exports.memory.buffer);S.set(s(y),C);var v=m(C,b,x);return A(C-A(0)),v}function p(m,y,b,x,A,C,S,v){var P=n.exports.sbrk,M=P(v*4),R=P(b*x),L=P(b*C),F=new Uint8Array(n.exports.memory.buffer);F.set(s(y),R),A&&F.set(s(A),L);var _=m(M,R,b,x,L,C,S,v);F=new Uint8Array(n.exports.memory.buffer);var w=new Uint32Array(_);return s(w).set(F.subarray(M,M+_*4)),P(M-P(0)),w}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var y=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,y,l(m)+1)},simplify:function(m,y,b,x,A,C){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x>=0&&x<=m.length),r(x%3==0),r(A>=0);for(var S=0,v=0;v<(C?C.length:0);++v)r(C[v]in g),r(this.useExperimentalFeatures||C[v]!="Prune"),S|=g[C[v]];var P=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),M=u(n.exports.meshopt_simplify,P,m.length,y,y.length/b,b*4,x,A,S);return M[0]=m instanceof Uint32Array?M[0]:new m.constructor(M[0]),M},simplifyWithAttributes:function(m,y,b,x,A,C,S,v,P,M){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x instanceof Float32Array),r(x.length%A==0),r(A>=0),r(S==null||S instanceof Uint8Array),r(S==null||S.length==y.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(P>=0),r(Array.isArray(C)),r(A>=C.length),r(C.length<=32);for(var R=0;R<C.length;++R)r(C[R]>=0);for(var L=0,R=0;R<(M?M.length:0);++R)r(M[R]in g),L|=g[M[R]];var F=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),_=f(n.exports.meshopt_simplifyWithAttributes,F,m.length,y,y.length/b,b*4,x,A*4,new Float32Array(C),S?new Uint8Array(S):null,v,P,L);return _[0]=m instanceof Uint32Array?_[0]:new m.constructor(_[0]),_},getScale:function(m,y){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),h(n.exports.meshopt_simplifyScale,m,m.length/y,y*4)},simplifyPoints:function(m,y,b,x,A,C){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),r(b>=0&&b<=m.length/y),x?(r(x instanceof Float32Array),r(x.length%A==0),r(A>=3),r(m.length/y==x.length/A),p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,x,A*4,C,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,void 0,0,0,b)}}}();typeof c1=="object"&&typeof p9=="object"?p9.exports=tz:typeof define=="function"&&define.amd?define([],function(){return tz}):typeof c1=="object"?c1.MeshoptSimplifier=tz:(typeof self<"u"?self:c1).MeshoptSimplifier=tz});var Xre=Xn((l1,_9)=>{var nz=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3av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Bdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b<m.length;++b)y[A++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,A)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,l=16;function u(m,y){var b=m.meshlets[y*4+0],x=m.meshlets[y*4+1],A=m.meshlets[y*4+2],C=m.meshlets[y*4+3];return{vertices:m.vertices.subarray(b,b+A),triangles:m.triangles.subarray(x,x+C*3)}}function f(m,y,b,x,A,C,S){var v=n.exports.sbrk,P=n.exports.meshopt_buildMeshletsBound(m.length,A,C),M=v(P*l),R=v(P*A*4),L=v(P*C*3),F=v(m.byteLength),_=v(y.byteLength),w=new Uint8Array(n.exports.memory.buffer);w.set(s(m),F),w.set(s(y),_);var D=n.exports.meshopt_buildMeshlets(M,R,L,F,m.length,_,b,x,A,C,S);w=new Uint8Array(n.exports.memory.buffer);for(var I=w.subarray(M,M+D*l),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),k=0;k<D;++k){var z=N[k*4+0],V=N[k*4+1],b=N[k*4+2],j=N[k*4+3];n.exports.meshopt_optimizeMeshlet(R+z*4,L+V,j,b)}var U=N[(D-1)*4+0],q=N[(D-1)*4+1],Y=N[(D-1)*4+2],te=N[(D-1)*4+3],K=U+Y,Z=q+(te*3+3&-4),ee={meshlets:N,vertices:new Uint32Array(w.buffer,R,K).slice(),triangles:new Uint8Array(w.buffer,L,Z*3).slice(),meshletCount:D};return v(M-v(0)),ee}function h(m){var y=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function p(m,y,b,x){var A=n.exports.sbrk,C=[],S=A(y.byteLength),v=A(m.vertices.byteLength),P=A(m.triangles.byteLength),M=A(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),R.set(s(m.vertices),v),R.set(s(m.triangles),P);for(var L=0;L<m.meshletCount;++L){var F=m.meshlets[L*4+0],_=m.meshlets[L*4+0+1],w=m.meshlets[L*4+0+3];n.exports.meshopt_computeMeshletBounds(M,v+F*4,P+_,w,S,b,x),C.push(h(M))}return A(S-A(0)),C}function g(m,y,b,x){var A=n.exports.sbrk,C=A(a),S=A(m.byteLength),v=A(y.byteLength),P=new Uint8Array(n.exports.memory.buffer);P.set(s(m),S),P.set(s(y),v),n.exports.meshopt_computeClusterBounds(C,S,m.length,v,b,x);var M=h(C);return A(C-A(0)),M}return{ready:i,supported:!0,buildMeshlets:function(m,y,b,x,A,C){r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x<=255||x>0),r(A<=512),r(A%4==0),C=C||0;var S=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(S,y,y.length/b,b*4,x,A,C)},computeClusterBounds:function(m,y,b){r(m.length%3==0),r(m.length/3<=512),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return g(x,y,y.length/b,b*4)},computeMeshletBounds:function(m,y,b){return r(m.meshletCount!=0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),p(m,y,y.length/b,b*4)},extractMeshlet:function(m,y){return r(y>=0&&y<m.meshletCount),u(m,y)}}}();typeof l1=="object"&&typeof _9=="object"?_9.exports=nz:typeof define=="function"&&define.amd?define([],function(){return nz}):typeof l1=="object"?l1.MeshoptClusterizer=nz:(typeof self<"u"?self:l1).MeshoptClusterizer=nz});var $re=Xn((qrn,Kre)=>{var dke=Wre(),hke=qre(),mke=Yre(),pke=Xre();Kre.exports={MeshoptEncoder:dke,MeshoptDecoder:hke,MeshoptSimplifier:mke,MeshoptClusterizer:pke}});var lue=Xn((WRn,cue)=>{"use strict";cue.exports=Eqe;var sL=1e20;function Eqe(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,l,u,f,h,p,g,m,y;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,l=e,t.stride?f=t.stride:f=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),l=g.data,f=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),l=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,l=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*s),m=0,y=Math.floor(u.length/f);m<y;m++)l[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),x=Array(r*s),A=Array(a),C=Array(a),S=Array(a+1),v=Array(a);for(m=0,y=r*s;m<y;m++){var P=l[m];b[m]=P===1?0:P===0?sL:Math.pow(Math.max(0,.5-P),2),x[m]=P===1?sL:P===0?0:Math.pow(Math.max(0,P-.5),2)}sue(b,r,s,A,C,v,S),sue(x,r,s,A,C,v,S);var M=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,y=r*s;m<y;m++)M[m]=Math.min(Math.max(1-((b[m]-x[m])/i+n),0),1);return M}function sue(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var l=0;l<n;l++)i[l]=e[l*t+a];for(aue(i,o,r,s,n),l=0;l<n;l++)e[l*t+a]=o[l]}for(l=0;l<n;l++){for(a=0;a<t;a++)i[a]=e[l*t+a];for(aue(i,o,r,s,t),a=0;a<t;a++)e[l*t+a]=Math.sqrt(o[a])}}function aue(e,t,n,i,o){n[0]=0,i[0]=-sL,i[1]=+sL;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]=+sL}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 mue=Xn((lMn,kz)=>{function Nqe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,l=8,u=9,f=10,h=11,p=12,g=13,m=14,y=15,b=16,x=17,A=0,C=1,S=2,v=3,P=4;function M(_,w){return 55296<=_.charCodeAt(w)&&_.charCodeAt(w)<=56319&&56320<=_.charCodeAt(w+1)&&_.charCodeAt(w+1)<=57343}function R(_,w){w===void 0&&(w=0);var D=_.charCodeAt(w);if(55296<=D&&D<=56319&&w<_.length-1){var I=D,N=_.charCodeAt(w+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=D&&D<=57343&&w>=1){var I=_.charCodeAt(w-1),N=D;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return D}function L(_,w,D){var I=[_].concat(w).concat([D]),N=I[I.length-2],k=D,z=I.lastIndexOf(m);if(z>1&&I.slice(1,z).every(function(U){return U==i})&&[i,g,x].indexOf(_)==-1)return S;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(U){return U==o})&&[p,o].indexOf(N)==-1)return I.filter(function(U){return U==o}).length%2==1?v:P;if(N==e&&k==t)return A;if(N==n||N==e||N==t)return k==m&&w.every(function(U){return U==i})?S:C;if(k==n||k==e||k==t)return C;if(N==s&&(k==s||k==a||k==u||k==f))return A;if((N==u||N==a)&&(k==a||k==l))return A;if((N==f||N==l)&&k==l)return A;if(k==i||k==y)return A;if(k==r)return A;if(N==p)return A;var j=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,x].indexOf(I[j])!=-1&&I.slice(j+1,-1).every(function(U){return U==i})&&k==m||N==y&&[b,x].indexOf(k)!=-1?A:w.indexOf(o)!=-1?S:N==o&&k==o?A:C}this.nextBreak=function(_,w){if(w===void 0&&(w=0),w<0)return 0;if(w>=_.length-1)return _.length;for(var D=F(R(_,w)),I=[],N=w+1;N<_.length;N++)if(!M(_,N-1)){var k=F(R(_,N));if(L(D,I,k))return N;I.push(k)}return _.length},this.splitGraphemes=function(_){for(var w=[],D=0,I;(I=this.nextBreak(_,D))<_.length;)w.push(_.slice(D,I)),D=I;return D<_.length&&w.push(_.slice(D)),w},this.iterateGraphemes=function(_){var w=0,D={next:function(){var I,N;return(N=this.nextBreak(_,w))<_.length?(I=_.slice(w,N),w=N,{value:I,done:!1}):w<_.length?(I=_.slice(w),w=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(D[Symbol.iterator]=function(){return D}),D},this.countGraphemes=function(_){for(var w=0,D=0,I;(I=this.nextBreak(_,D))<_.length;)D=I,w++;return D<_.length&&w++,w};function F(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?l:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?x:h}return this}typeof kz<"u"&&kz.exports&&(kz.exports=Nqe)});var npe=Xn((T7,A7)=>{(function(e,t){typeof T7=="object"&&typeof A7<"u"?A7.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.RBush=t())})(T7,function(){"use strict";function e(C,S,v,P,M){t(C,S,v||0,P||C.length-1,M||i)}function t(C,S,v,P,M){for(;P>v;){if(P-v>600){var R=P-v+1,L=S-v+1,F=Math.log(R),_=.5*Math.exp(2*F/3),w=.5*Math.sqrt(F*_*(R-_)/R)*(L-R/2<0?-1:1),D=Math.max(v,Math.floor(S-L*_/R+w)),I=Math.min(P,Math.floor(S+(R-L)*_/R+w));t(C,S,D,I,M)}var N=C[S],k=v,z=P;for(n(C,v,S),M(C[P],N)>0&&n(C,v,P);k<z;){for(n(C,k,z),k++,z--;M(C[k],N)<0;)k++;for(;M(C[z],N)>0;)z--}M(C[v],N)===0?n(C,v,z):(z++,n(C,z,P)),z<=S&&(v=z+1),S<=z&&(P=z-1)}}function n(C,S,v){var P=C[S];C[S]=C[v],C[v]=P}function i(C,S){return C<S?-1:C>S?1:0}var o=function(S){S===void 0&&(S=9),this._maxEntries=Math.max(4,S),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(S){var v=this.data,P=[];if(!b(S,v))return P;for(var M=this.toBBox,R=[];v;){for(var L=0;L<v.children.length;L++){var F=v.children[L],_=v.leaf?M(F):F;b(S,_)&&(v.leaf?P.push(F):y(S,_)?this._all(F,P):R.push(F))}v=R.pop()}return P},o.prototype.collides=function(S){var v=this.data;if(!b(S,v))return!1;for(var P=[];v;){for(var M=0;M<v.children.length;M++){var R=v.children[M],L=v.leaf?this.toBBox(R):R;if(b(S,L)){if(v.leaf||y(S,L))return!0;P.push(R)}}v=P.pop()}return!1},o.prototype.load=function(S){if(!(S&&S.length))return this;if(S.length<this._minEntries){for(var v=0;v<S.length;v++)this.insert(S[v]);return this}var P=this._build(S.slice(),0,S.length-1,0);if(!this.data.children.length)this.data=P;else if(this.data.height===P.height)this._splitRoot(this.data,P);else{if(this.data.height<P.height){var M=this.data;this.data=P,P=M}this._insert(P,this.data.height-P.height-1,!0)}return this},o.prototype.insert=function(S){return S&&this._insert(S,this.data.height-1),this},o.prototype.clear=function(){return this.data=x([]),this},o.prototype.remove=function(S,v){if(!S)return this;for(var P=this.data,M=this.toBBox(S),R=[],L=[],F,_,w;P||R.length;){if(P||(P=R.pop(),_=R[R.length-1],F=L.pop(),w=!0),P.leaf){var D=r(S,P.children,v);if(D!==-1)return P.children.splice(D,1),R.push(P),this._condense(R),this}!w&&!P.leaf&&y(P,M)?(R.push(P),L.push(F),F=0,_=P,P=P.children[0]):_?(F++,P=_.children[F],w=!1):P=null}return this},o.prototype.toBBox=function(S){return S},o.prototype.compareMinX=function(S,v){return S.minX-v.minX},o.prototype.compareMinY=function(S,v){return S.minY-v.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(S){return this.data=S,this},o.prototype._all=function(S,v){for(var P=[];S;)S.leaf?v.push.apply(v,S.children):P.push.apply(P,S.children),S=P.pop();return v},o.prototype._build=function(S,v,P,M){var R=P-v+1,L=this._maxEntries,F;if(R<=L)return F=x(S.slice(v,P+1)),s(F,this.toBBox),F;M||(M=Math.ceil(Math.log(R)/Math.log(L)),L=Math.ceil(R/Math.pow(L,M-1))),F=x([]),F.leaf=!1,F.height=M;var _=Math.ceil(R/L),w=_*Math.ceil(Math.sqrt(L));A(S,v,P,w,this.compareMinX);for(var D=v;D<=P;D+=w){var I=Math.min(D+w-1,P);A(S,D,I,_,this.compareMinY);for(var N=D;N<=I;N+=_){var k=Math.min(N+_-1,I);F.children.push(this._build(S,N,k,M-1))}}return s(F,this.toBBox),F},o.prototype._chooseSubtree=function(S,v,P,M){for(;M.push(v),!(v.leaf||M.length-1===P);){for(var R=1/0,L=1/0,F=void 0,_=0;_<v.children.length;_++){var w=v.children[_],D=h(w),I=g(S,w)-D;I<L?(L=I,R=D<R?D:R,F=w):I===L&&D<R&&(R=D,F=w)}v=F||v.children[0]}return v},o.prototype._insert=function(S,v,P){var M=P?S:this.toBBox(S),R=[],L=this._chooseSubtree(M,this.data,v,R);for(L.children.push(S),l(L,M);v>=0&&R[v].children.length>this._maxEntries;)this._split(R,v),v--;this._adjustParentBBoxes(M,R,v)},o.prototype._split=function(S,v){var P=S[v],M=P.children.length,R=this._minEntries;this._chooseSplitAxis(P,R,M);var L=this._chooseSplitIndex(P,R,M),F=x(P.children.splice(L,P.children.length-L));F.height=P.height,F.leaf=P.leaf,s(P,this.toBBox),s(F,this.toBBox),v?S[v-1].children.push(F):this._splitRoot(P,F)},o.prototype._splitRoot=function(S,v){this.data=x([S,v]),this.data.height=S.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(S,v,P){for(var M,R=1/0,L=1/0,F=v;F<=P-v;F++){var _=a(S,0,F,this.toBBox),w=a(S,F,P,this.toBBox),D=m(_,w),I=h(_)+h(w);D<R?(R=D,M=F,L=I<L?I:L):D===R&&I<L&&(L=I,M=F)}return M||P-v},o.prototype._chooseSplitAxis=function(S,v,P){var M=S.leaf?this.compareMinX:u,R=S.leaf?this.compareMinY:f,L=this._allDistMargin(S,v,P,M),F=this._allDistMargin(S,v,P,R);L<F&&S.children.sort(M)},o.prototype._allDistMargin=function(S,v,P,M){S.children.sort(M);for(var R=this.toBBox,L=a(S,0,v,R),F=a(S,P-v,P,R),_=p(L)+p(F),w=v;w<P-v;w++){var D=S.children[w];l(L,S.leaf?R(D):D),_+=p(L)}for(var I=P-v-1;I>=v;I--){var N=S.children[I];l(F,S.leaf?R(N):N),_+=p(F)}return _},o.prototype._adjustParentBBoxes=function(S,v,P){for(var M=P;M>=0;M--)l(v[M],S)},o.prototype._condense=function(S){for(var v=S.length-1,P=void 0;v>=0;v--)S[v].children.length===0?v>0?(P=S[v-1].children,P.splice(P.indexOf(S[v]),1)):this.clear():s(S[v],this.toBBox)};function r(C,S,v){if(!v)return S.indexOf(C);for(var P=0;P<S.length;P++)if(v(C,S[P]))return P;return-1}function s(C,S){a(C,0,C.children.length,S,C)}function a(C,S,v,P,M){M||(M=x(null)),M.minX=1/0,M.minY=1/0,M.maxX=-1/0,M.maxY=-1/0;for(var R=S;R<v;R++){var L=C.children[R];l(M,C.leaf?P(L):L)}return M}function l(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function u(C,S){return C.minX-S.minX}function f(C,S){return C.minY-S.minY}function h(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function p(C){return C.maxX-C.minX+(C.maxY-C.minY)}function g(C,S){return(Math.max(S.maxX,C.maxX)-Math.min(S.minX,C.minX))*(Math.max(S.maxY,C.maxY)-Math.min(S.minY,C.minY))}function m(C,S){var v=Math.max(C.minX,S.minX),P=Math.max(C.minY,S.minY),M=Math.min(C.maxX,S.maxX),R=Math.min(C.maxY,S.maxY);return Math.max(0,M-v)*Math.max(0,R-P)}function y(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function b(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function x(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(C,S,v,P,M){for(var R=[S,v];R.length;)if(v=R.pop(),S=R.pop(),!(v-S<=P)){var L=S+Math.ceil((v-S)/P/2)*P;e(C,L,S,v,M),R.push(S,L,L,v)}}return o})});var xge=Xn((R8,bge)=>{(function(e,t){typeof R8=="object"&&typeof bge<"u"?t(R8):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(R8,function(e){"use strict";function t(C){return C}function n(C){if(C==null)return t;var S,v,P=C.scale[0],M=C.scale[1],R=C.translate[0],L=C.translate[1];return function(F,_){_||(S=v=0);var w=2,D=F.length,I=new Array(D);for(I[0]=(S+=F[0])*P+R,I[1]=(v+=F[1])*M+L;w<D;)I[w]=F[w],++w;return I}}function i(C){var S=n(C.transform),v,P=1/0,M=P,R=-P,L=-P;function F(w){w=S(w),w[0]<P&&(P=w[0]),w[0]>R&&(R=w[0]),w[1]<M&&(M=w[1]),w[1]>L&&(L=w[1])}function _(w){switch(w.type){case"GeometryCollection":w.geometries.forEach(_);break;case"Point":F(w.coordinates);break;case"MultiPoint":w.coordinates.forEach(F);break}}C.arcs.forEach(function(w){for(var D=-1,I=w.length,N;++D<I;)N=S(w[D],D),N[0]<P&&(P=N[0]),N[0]>R&&(R=N[0]),N[1]<M&&(M=N[1]),N[1]>L&&(L=N[1])});for(v in C.objects)_(C.objects[v]);return[P,M,R,L]}function o(C,S){for(var v,P=C.length,M=P-S;M<--P;)v=C[M],C[M++]=C[P],C[P]=v}function r(C,S){return typeof S=="string"&&(S=C.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(v){return s(C,v)})}:s(C,S)}function s(C,S){var v=S.id,P=S.bbox,M=S.properties==null?{}:S.properties,R=a(C,S);return v==null&&P==null?{type:"Feature",properties:M,geometry:R}:P==null?{type:"Feature",id:v,properties:M,geometry:R}:{type:"Feature",id:v,bbox:P,properties:M,geometry:R}}function a(C,S){var v=n(C.transform),P=C.arcs;function M(D,I){I.length&&I.pop();for(var N=P[D<0?~D:D],k=0,z=N.length;k<z;++k)I.push(v(N[k],k));D<0&&o(I,z)}function R(D){return v(D)}function L(D){for(var I=[],N=0,k=D.length;N<k;++N)M(D[N],I);return I.length<2&&I.push(I[0]),I}function F(D){for(var I=L(D);I.length<4;)I.push(I[0]);return I}function _(D){return D.map(F)}function w(D){var I=D.type,N;switch(I){case"GeometryCollection":return{type:I,geometries:D.geometries.map(w)};case"Point":N=R(D.coordinates);break;case"MultiPoint":N=D.coordinates.map(R);break;case"LineString":N=L(D.arcs);break;case"MultiLineString":N=D.arcs.map(L);break;case"Polygon":N=_(D.arcs);break;case"MultiPolygon":N=D.arcs.map(_);break;default:return null}return{type:I,coordinates:N}}return w(S)}function l(C,S){var v={},P={},M={},R=[],L=-1;S.forEach(function(w,D){var I=C.arcs[w<0?~w:w],N;I.length<3&&!I[1][0]&&!I[1][1]&&(N=S[++L],S[L]=w,S[D]=N)}),S.forEach(function(w){var D=F(w),I=D[0],N=D[1],k,z;if(k=M[I])if(delete M[k.end],k.push(w),k.end=N,z=P[N]){delete P[z.start];var V=z===k?k:k.concat(z);P[V.start=k.start]=M[V.end=z.end]=V}else P[k.start]=M[k.end]=k;else if(k=P[N])if(delete P[k.start],k.unshift(w),k.start=I,z=M[I]){delete M[z.end];var j=z===k?k:z.concat(k);P[j.start=z.start]=M[j.end=k.end]=j}else P[k.start]=M[k.end]=k;else k=[w],P[k.start=I]=M[k.end=N]=k});function F(w){var D=C.arcs[w<0?~w:w],I=D[0],N;return C.transform?(N=[0,0],D.forEach(function(k){N[0]+=k[0],N[1]+=k[1]})):N=D[D.length-1],w<0?[N,I]:[I,N]}function _(w,D){for(var I in w){var N=w[I];delete D[N.start],delete N.start,delete N.end,N.forEach(function(k){v[k<0?~k:k]=1}),R.push(N)}}return _(M,P),_(P,M),S.forEach(function(w){v[w<0?~w:w]||R.push([w])}),R}function u(C){return a(C,f.apply(this,arguments))}function f(C,S,v){var P,M,R;if(arguments.length>1)P=h(C,S,v);else for(M=0,P=new Array(R=C.arcs.length);M<R;++M)P[M]=M;return{type:"MultiLineString",arcs:l(C,P)}}function h(C,S,v){var P=[],M=[],R;function L(I){var N=I<0?~I:I;(M[N]||(M[N]=[])).push({i:I,g:R})}function F(I){I.forEach(L)}function _(I){I.forEach(F)}function w(I){I.forEach(_)}function D(I){switch(R=I,I.type){case"GeometryCollection":I.geometries.forEach(D);break;case"LineString":F(I.arcs);break;case"MultiLineString":case"Polygon":_(I.arcs);break;case"MultiPolygon":w(I.arcs);break}}return D(S),M.forEach(v==null?function(I){P.push(I[0].i)}:function(I){v(I[0].g,I[I.length-1].g)&&P.push(I[0].i)}),P}function p(C){for(var S=-1,v=C.length,P,M=C[v-1],R=0;++S<v;)P=M,M=C[S],R+=P[0]*M[1]-P[1]*M[0];return Math.abs(R)}function g(C){return a(C,m.apply(this,arguments))}function m(C,S){var v={},P=[],M=[];S.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":L(_.arcs);break;case"MultiPolygon":_.arcs.forEach(L);break}}function L(_){_.forEach(function(w){w.forEach(function(D){(v[D=D<0?~D:D]||(v[D]=[])).push(_)})}),P.push(_)}function F(_){return p(a(C,{type:"Polygon",arcs:[_]}).coordinates[0])}return P.forEach(function(_){if(!_._){var w=[],D=[_];for(_._=1,M.push(w);_=D.pop();)w.push(_),_.forEach(function(I){I.forEach(function(N){v[N<0?~N:N].forEach(function(k){k._||(k._=1,D.push(k))})})})}}),P.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:M.map(function(_){var w=[],D;if(_.forEach(function(V){V.forEach(function(j){j.forEach(function(U){v[U<0?~U:U].length<2&&w.push(U)})})}),w=l(C,w),(D=w.length)>1)for(var I=1,N=F(w[0]),k,z;I<D;++I)(k=F(w[I]))>N&&(z=w[0],w[0]=w[I],w[I]=z,N=k);return w}).filter(function(_){return _.length>0})}}function y(C,S){for(var v=0,P=C.length;v<P;){var M=v+P>>>1;C[M]<S?v=M+1:P=M}return v}function b(C){var S={},v=C.map(function(){return[]});function P(V,j){V.forEach(function(U){U<0&&(U=~U);var q=S[U];q?q.push(j):S[U]=[j]})}function M(V,j){V.forEach(function(U){P(U,j)})}function R(V,j){V.type==="GeometryCollection"?V.geometries.forEach(function(U){R(U,j)}):V.type in L&&L[V.type](V.arcs,j)}var L={LineString:P,MultiLineString:M,Polygon:M,MultiPolygon:function(V,j){V.forEach(function(U){M(U,j)})}};C.forEach(R);for(var F in S)for(var _=S[F],w=_.length,D=0;D<w;++D)for(var I=D+1;I<w;++I){var N=_[D],k=_[I],z;(z=v[N])[F=y(z,k)]!==k&&z.splice(F,0,k),(z=v[k])[F=y(z,N)]!==N&&z.splice(F,0,N)}return v}function x(C){if(C==null)return t;var S,v,P=C.scale[0],M=C.scale[1],R=C.translate[0],L=C.translate[1];return function(F,_){_||(S=v=0);var w=2,D=F.length,I=new Array(D),N=Math.round((F[0]-R)/P),k=Math.round((F[1]-L)/M);for(I[0]=N-S,S=N,I[1]=k-v,v=k;w<D;)I[w]=F[w],++w;return I}}function A(C,S){if(C.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((L=Math.floor(S))>=2))throw new Error("n must be \u22652");_=C.bbox||i(C);var v=_[0],P=_[1],M=_[2],R=_[3],L;S={scale:[M-v?(M-v)/(L-1):1,R-P?(R-P)/(L-1):1],translate:[v,P]}}else _=C.bbox;var F=x(S),_,w,D=C.objects,I={};function N(V){return F(V)}function k(V){var j;switch(V.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:V.geometries.map(k)};break;case"Point":j={type:"Point",coordinates:N(V.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:V.coordinates.map(N)};break;default:return V}return V.id!=null&&(j.id=V.id),V.bbox!=null&&(j.bbox=V.bbox),V.properties!=null&&(j.properties=V.properties),j}function z(V){var j=0,U=1,q=V.length,Y,te=new Array(q);for(te[0]=F(V[0],0);++j<q;)((Y=F(V[j],j))[0]||Y[1])&&(te[U++]=Y);return U===1&&(te[U++]=[0,0]),te.length=U,te}for(w in D)I[w]=k(D[w]);return{type:"Topology",bbox:_,transform:S,objects:I,arcs:C.arcs.map(z)}}e.bbox=i,e.feature=r,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=b,e.quantize=A,e.transform=n,e.untransform=x,Object.defineProperty(e,"__esModule",{value:!0})})});var Vge=Xn(N8=>{"use strict";Object.defineProperty(N8,"__esModule",{value:!0});N8.version=void 0;N8.version="4.1.0"});var IT=Xn(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.isUndefined=zge;cg.isBoolean=irt;cg.defaults=ort;cg.ellipsis=rrt;cg.remove=srt;cg.removeWithPredicate=art;cg.assertNever=crt;function zge(e){return e===void 0}function irt(e){return typeof e=="boolean"}function ort(e,t){for(var n in t)t.hasOwnProperty(n)&&zge(e[n])&&(e[n]=t[n]);return e}function rrt(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function srt(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function art(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function crt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var OT=Xn(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.alphaNumericAndMarksRe=Ii.alphaNumericAndMarksCharsStr=Ii.alphaNumericCharsRe=Ii.decimalNumbersStr=Ii.alphaCharsAndMarksStr=Ii.marksStr=Ii.emojiStr=Ii.alphaCharsStr=Ii.controlCharsRe=Ii.quoteRe=Ii.whitespaceRe=Ii.nonDigitRe=Ii.digitRe=Ii.letterRe=void 0;Ii.letterRe=/[A-Za-z]/;Ii.digitRe=/[\d]/;Ii.nonDigitRe=/[\D]/;Ii.whitespaceRe=/\s/;Ii.quoteRe=/['"]/;Ii.controlCharsRe=/[\x00-\x1F\x7F]/;Ii.alphaCharsStr=/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;Ii.emojiStr=/\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;Ii.marksStr=/\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;Ii.alphaCharsAndMarksStr=Ii.alphaCharsStr+Ii.emojiStr+Ii.marksStr;Ii.decimalNumbersStr=/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;Ii.alphaNumericCharsRe=new RegExp("[".concat(Ii.alphaCharsStr+Ii.decimalNumbersStr,"]"));Ii.alphaNumericAndMarksCharsStr=Ii.alphaCharsAndMarksStr+Ii.decimalNumbersStr;Ii.alphaNumericAndMarksRe=new RegExp("[".concat(Ii.alphaNumericAndMarksCharsStr,"]"))});var k8=Xn(B8=>{"use strict";Object.defineProperty(B8,"__esModule",{value:!0});B8.HtmlTag=void 0;var F8=OT(),lrt=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(F8.whitespaceRe):[],o=t.split(F8.whitespaceRe),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(F8.whitespaceRe):[],o=t.split(F8.whitespaceRe),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}();B8.HtmlTag=lrt});var Hge=Xn(GY=>{"use strict";Object.defineProperty(GY,"__esModule",{value:!0});GY.truncateSmart=urt;function urt(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(A){var C={},S=A,v=S.match(/^([a-z]+):\/\//i);return v&&(C.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(C.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(C.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(C.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(C.fragment=v[1]),C},s=function(A){var C="";return A.scheme&&A.host&&(C+=A.scheme+"://"),A.host&&(C+=A.host),A.path&&(C+="/"+A.path),A.query&&(C+="?"+A.query),A.fragment&&(C+="#"+A.fragment),C},a=function(A,C){var S=C/2,v=Math.ceil(S),P=-1*Math.floor(S),M="";return P<0&&(M=A.substr(P)),A.substr(0,v)+n+M};if(e.length<=t)return e;var l=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=l)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,l+i):a(h,l).substr(0,l+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=l){if((h+p).length==t)return(h+p).substr(0,t);var g=l-h.length;return(h+a(p,g)).substr(0,l+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=l){if((h+m).length==t)return(h+m).substr(0,t);var y=l-h.length;return(h+a(m,y)).substr(0,l+i)}else h+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((h+b).length<l)return(b+h).substr(0,t)}if(h.length<=t)return h;var x="";return l>0&&(x=h.substr(-1*Math.floor(l/2))),(h.substr(0,Math.ceil(l/2))+n+x).substr(0,l+i)}});var Gge=Xn(jY=>{"use strict";Object.defineProperty(jY,"__esModule",{value:!0});jY.truncateMiddle=frt;function frt(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",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 jge=Xn(WY=>{"use strict";Object.defineProperty(WY,"__esModule",{value:!0});WY.truncateEnd=hrt;var drt=IT();function hrt(e,t,n){return(0,drt.ellipsis)(e,t,n)}});var qY=Xn(U8=>{"use strict";Object.defineProperty(U8,"__esModule",{value:!0});U8.AnchorTagBuilder=void 0;var mrt=k8(),prt=Hge(),_rt=Gge(),grt=jge(),yrt=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 mrt.HtmlTag({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"?(0,prt.truncateSmart)(t,i):o==="middle"?(0,_rt.truncateMiddle)(t,i):(0,grt.truncateEnd)(t,i)},e}();U8.AnchorTagBuilder=yrt});var Km={};uJ(Km,{__addDisposableResource:()=>pye,__assign:()=>V8,__asyncDelegator:()=>aye,__asyncGenerator:()=>sye,__asyncValues:()=>cye,__await:()=>jS,__awaiter:()=>eye,__classPrivateFieldGet:()=>dye,__classPrivateFieldIn:()=>mye,__classPrivateFieldSet:()=>hye,__createBinding:()=>H8,__decorate:()=>Yge,__disposeResources:()=>_ye,__esDecorate:()=>Kge,__exportStar:()=>nye,__extends:()=>Wge,__generator:()=>tye,__importDefault:()=>fye,__importStar:()=>uye,__makeTemplateObject:()=>lye,__metadata:()=>Jge,__param:()=>Xge,__propKey:()=>Zge,__read:()=>KY,__rest:()=>qge,__rewriteRelativeImportExtension:()=>gye,__runInitializers:()=>$ge,__setFunctionName:()=>Qge,__spread:()=>iye,__spreadArray:()=>rye,__spreadArrays:()=>oye,__values:()=>z8,default:()=>Trt});function Wge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");YY(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function qge(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function Yge(e,t,n,i){var o=arguments.length,r=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function Xge(e,t){return function(n,i){t(n,i,e)}}function Kge(e,t,n,i,o,r){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}for(var a=i.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),h,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(x){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(s(x||null))};var b=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[l],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=s(b.get))&&(f.get=h),(h=s(b.set))&&(f.set=h),(h=s(b.init))&&o.unshift(h)}else(h=s(b))&&(a==="field"?o.unshift(h):f[l]=h)}u&&Object.defineProperty(u,i.name,f),p=!0}function $ge(e,t,n){for(var i=arguments.length>2,o=0;o<t.length;o++)n=i?t[o].call(e,n):t[o].call(e);return i?n:void 0}function Zge(e){return typeof e=="symbol"?e:"".concat(e)}function Qge(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Jge(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function eye(e,t,n,i){function o(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function a(f){try{u(i.next(f))}catch(h){s(h)}}function l(f){try{u(i.throw(f))}catch(h){s(h)}}function u(f){f.done?r(f.value):o(f.value).then(a,l)}u((i=i.apply(e,t||[])).next())})}function tye(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1],r=u;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(u);break}r[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function nye(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&H8(t,e,n)}function z8(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function KY(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function iye(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(KY(arguments[t]));return e}function oye(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var r=arguments[t],s=0,a=r.length;s<a;s++,o++)i[o]=r[s];return i}function rye(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function jS(e){return this instanceof jS?(this.v=e,this):new jS(e)}function sye(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),o,r=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(g){return function(m){return Promise.resolve(m).then(g,h)}}function a(g,m){i[g]&&(o[g]=function(y){return new Promise(function(b,x){r.push([g,y,b,x])>1||l(g,y)})},m&&(o[g]=m(o[g])))}function l(g,m){try{u(i[g](m))}catch(y){p(r[0][3],y)}}function u(g){g.value instanceof jS?Promise.resolve(g.value.v).then(f,h):p(r[0][2],g)}function f(g){l("next",g)}function h(g){l("throw",g)}function p(g,m){g(m),r.shift(),r.length&&l(r[0][0],r[0][1])}}function aye(e){var t,n;return t={},i("next"),i("throw",function(o){throw o}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(o,r){t[o]=e[o]?function(s){return(n=!n)?{value:jS(e[o](s)),done:!1}:r?r(s):s}:r}}function cye(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof z8=="function"?z8(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=e[r]&&function(s){return new Promise(function(a,l){s=e[r](s),o(a,l,s.done,s.value)})}}function o(r,s,a,l){Promise.resolve(l).then(function(u){r({value:u,done:a})},s)}}function lye(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function uye(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=XY(e),i=0;i<n.length;i++)n[i]!=="default"&&H8(t,e,n[i]);return brt(t,e),t}function fye(e){return e&&e.__esModule?e:{default:e}}function dye(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function hye(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function mye(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function pye(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(o=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function _ye(e){function t(r){e.error=e.hasError?new xrt(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}var n,i=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var r=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(r).then(o,function(s){return t(s),o()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function gye(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,o,r,s){return i?t?".jsx":".js":o&&(!r||!s)?n:o+r+"."+s.toLowerCase()+"js"}):e}var YY,V8,H8,brt,XY,xrt,Trt,$m=SSe(()=>{YY=function(e,t){return YY=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])},YY(e,t)};V8=function(){return V8=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},V8.apply(this,arguments)};H8=Object.create?function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]};brt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},XY=function(e){return XY=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},XY(e)};xrt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};Trt={__extends:Wge,__assign:V8,__rest:qge,__decorate:Yge,__param:Xge,__esDecorate:Kge,__runInitializers:$ge,__propKey:Zge,__setFunctionName:Qge,__metadata:Jge,__awaiter:eye,__generator:tye,__createBinding:H8,__exportStar:nye,__values:z8,__read:KY,__spread:iye,__spreadArrays:oye,__spreadArray:rye,__await:jS,__asyncGenerator:sye,__asyncDelegator:aye,__asyncValues:cye,__makeTemplateObject:lye,__importStar:uye,__importDefault:fye,__classPrivateFieldGet:dye,__classPrivateFieldSet:hye,__classPrivateFieldIn:mye,__addDisposableResource:pye,__disposeResources:_ye,__rewriteRelativeImportExtension:gye}});var RT=Xn(G8=>{"use strict";Object.defineProperty(G8,"__esModule",{value:!0});G8.AbstractMatch=void 0;var Art=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}();G8.AbstractMatch=Art});var yye=Xn(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});MT.tldRegex=MT.tldRegexStr=void 0;MT.tldRegexStr="(?: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)";MT.tldRegex=new RegExp("^"+MT.tldRegexStr+"$")});var j8=Xn(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.tldUrlHostRe=pi.schemeUrlRe=pi.invalidSchemeRe=pi.urlSuffixedCharsNotAllowedAtEndRe=pi.httpSchemePrefixRe=pi.httpSchemeRe=pi.urlSuffixNotAllowedAsLastCharRe=pi.urlSuffixAllowedSpecialCharsRe=pi.urlSuffixStartCharsRe=pi.domainNameCharRegex=void 0;pi.isSchemeStartChar=Ert;pi.isSchemeChar=Srt;pi.isDomainLabelStartChar=bye;pi.isDomainLabelChar=wrt;pi.isPathChar=vrt;pi.isUrlSuffixStartChar=Drt;pi.isKnownTld=xye;pi.isValidSchemeUrl=Prt;pi.isValidTldMatch=Irt;pi.isValidIpV4Address=Mrt;var LT=OT(),Crt=yye();pi.domainNameCharRegex=LT.alphaNumericAndMarksRe;pi.urlSuffixStartCharsRe=/[\/?#]/;pi.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;pi.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;pi.httpSchemeRe=/https?:\/\//i;pi.httpSchemePrefixRe=new RegExp("^"+pi.httpSchemeRe.source,"i");pi.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(pi.urlSuffixNotAllowedAsLastCharRe.source+"$");pi.invalidSchemeRe=/^(javascript|vbscript):/i;pi.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;pi.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function Ert(e){return LT.letterRe.test(e)}function Srt(e){return LT.letterRe.test(e)||LT.digitRe.test(e)||e==="+"||e==="-"||e==="."}function bye(e){return LT.alphaNumericAndMarksRe.test(e)}function wrt(e){return e==="_"||bye(e)}function vrt(e){return LT.alphaNumericAndMarksRe.test(e)||pi.urlSuffixAllowedSpecialCharsRe.test(e)||pi.urlSuffixNotAllowedAsLastCharRe.test(e)}function Drt(e){return pi.urlSuffixStartCharsRe.test(e)}function xye(e){return Crt.tldRegex.test(e.toLowerCase())}function Prt(e){if(pi.invalidSchemeRe.test(e))return!1;var t=e.match(pi.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!LT.letterRe.test(i))}function Irt(e){var t=e.match(pi.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!xye(o)}var Ort=/^(?:(?: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]?)$/,Rrt=/[:/?#]/;function Mrt(e){var t=e.split(Rrt,1)[0];return Ort.test(t)}});var $Y=Xn(W8=>{"use strict";Object.defineProperty(W8,"__esModule",{value:!0});W8.UrlMatch=void 0;var Lrt=($m(),nm(Km)),Nrt=RT(),Frt=j8(),Brt=/^(https?:\/\/)?(www\.)?/i,krt=/^\/\//,Urt=function(e){Lrt.__extends(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Hrt(n)),this.stripPrefix.scheme&&(n=Vrt(n)),this.stripPrefix.www&&(n=zrt(n)),this.stripTrailingSlash&&(n=Grt(n)),this.decodePercentEncoding&&(n=jrt(n)),n},t}(Nrt.AbstractMatch);W8.UrlMatch=Urt;function Vrt(e){return e.replace(Frt.httpSchemePrefixRe,"")}function zrt(e){return e.replace(Brt,"$1")}function Hrt(e){return e.replace(krt,"")}function Grt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function jrt(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}});var Aye=Xn(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});NT.mailtoSchemePrefixRe=void 0;NT.isEmailLocalPartStartChar=Yrt;NT.isEmailLocalPartChar=Xrt;NT.isValidEmail=Krt;var Tye=OT(),Wrt=j8();NT.mailtoSchemePrefixRe=/^mailto:/i;var qrt=new RegExp("[".concat(Tye.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function Yrt(e){return Tye.alphaNumericAndMarksRe.test(e)}function Xrt(e){return qrt.test(e)}function Krt(e){var t=e.split(".").pop()||"";return(0,Wrt.isKnownTld)(t)}});var ZY=Xn(q8=>{"use strict";Object.defineProperty(q8,"__esModule",{value:!0});q8.EmailMatch=void 0;var $rt=($m(),nm(Km)),Zrt=RT(),Qrt=function(e){$rt.__extends(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}(Zrt.AbstractMatch);q8.EmailMatch=Qrt});var QY=Xn(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});WS.hashtagServices=void 0;WS.isHashtagTextChar=est;WS.isValidHashtag=tst;var Jrt=OT();function est(e){return e==="_"||Jrt.alphaNumericAndMarksRe.test(e)}function tst(e){return e.length<=140}WS.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var JY=Xn(Y8=>{"use strict";Object.defineProperty(Y8,"__esModule",{value:!0});Y8.HashtagMatch=void 0;var nst=($m(),nm(Km)),ist=IT(),ost=RT(),rst=function(e){nst.__extends(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(0,ist.assertNever)(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}(ost.AbstractMatch);Y8.HashtagMatch=rst});var eX=Xn(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.mentionServices=void 0;qS.isMentionTextChar=cst;qS.isValidMention=lst;var sst={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},ast=/[-\w.]/;function cst(e){return ast.test(e)}function lst(e,t){var n=sst[t];return n.test(e)}qS.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var tX=Xn(X8=>{"use strict";Object.defineProperty(X8,"__esModule",{value:!0});X8.MentionMatch=void 0;var ust=($m(),nm(Km)),fst=IT(),dst=RT(),hst=function(e){ust.__extends(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(0,fst.assertNever)(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}(dst.AbstractMatch);X8.MentionMatch=hst});var Cye=Xn(MF=>{"use strict";Object.defineProperty(MF,"__esModule",{value:!0});MF.isPhoneNumberSeparatorChar=xst;MF.isPhoneNumberControlChar=Tst;MF.isValidPhoneNumber=Ast;var mst=/[-. ]/,pst=/[-. ()]/,_st=/[,;]/,gst=/(?:(?:(?:(\+)?\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]+#?)*/,yst=/(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})/,bst=new RegExp("^".concat(gst.source,"|").concat(yst.source,"$"));function xst(e){return mst.test(e)}function Tst(e){return _st.test(e)}function Ast(e){var t=e.charAt(0)==="+"||pst.test(e);return t&&bst.test(e)}});var nX=Xn(K8=>{"use strict";Object.defineProperty(K8,"__esModule",{value:!0});K8.PhoneMatch=void 0;var Cst=($m(),nm(Km)),Est=RT(),Sst=function(e){Cst.__extends(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}(Est.AbstractMatch);K8.PhoneMatch=Sst});var aX=Xn(Z8=>{"use strict";Object.defineProperty(Z8,"__esModule",{value:!0});Z8.parseMatches=Ost;Z8.excludeUnbalancedTrailingBracesAndPunctuation=wye;var Wa=OT(),wst=$Y(),vo=IT(),$o=j8(),YS=Aye(),vst=ZY(),iX=QY(),Dst=JY(),oX=eX(),Pst=tX(),XS=Cye(),Ist=nX();function Ost(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,l=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)x(p);else{for(var g=f.length-1;g>=0;g--){var m=f[g];switch(m.state){case 11:M(m,p);break;case 12:R(m,p);break;case 0:A(m,p);break;case 1:C(m,p);break;case 2:S(m,p);break;case 3:v(m,p);break;case 4:P(m,p);break;case 5:L(m,p);break;case 6:F(m,p);break;case 7:_(m,p);break;case 13:w(m,p);break;case 14:D(m,p);break;case 8:I(m,p);break;case 9:N(m,p);break;case 10:k(m,p);break;case 15:z(m,p);break;case 16:V(m,p);break;case 17:j(m,p);break;case 18:U(m,p);break;case 19:q(m,p);break;case 20:Y(m,p);break;case 21:te(m,p);break;case 22:K(m,p);break;case 23:Z(m,p);break;case 24:ee(m,p);break;case 25:me(m,p);break;case 26:Te(m,p);break;case 27:ue(m,p);break;case 28:ye(m,p);break;case 29:Ae(m,p);break;case 30:Pe(m,p);break;case 31:Ee(m,p);break;case 32:qe(m,p);break;case 33:it(m,p);break;case 34:Dt(m,p);break;case 35:jt(m,p);break;case 36:$e(m,p);break;case 37:ze(m,p);break;case 38:un(m,p);break;case 39:zt(m,p);break;case 40:Ct(m,p);break;case 41:Ei(m,p);break;default:(0,vo.assertNever)(m.state)}}if(h>0&&(0,$o.isSchemeStartChar)(p)){var y=e.charAt(h-1);!(0,$o.isSchemeStartChar)(y)&&!f.some(Bst)&&f.push($8(h,0))}}}for(var b=f.length-1;b>=0;b--)f.forEach(function(_e){return an(_e)});return l;function x(_e){if(_e==="#")f.push(Nst(h,28));else if(_e==="@")f.push(Fst(h,30));else if(_e==="/")f.push(rX(h,11));else if(_e==="+")f.push(sX(h,37));else if(_e==="(")f.push(sX(h,32));else{if(Wa.digitRe.test(_e)&&(f.push(sX(h,38)),f.push(Mst(h,13))),(0,YS.isEmailLocalPartStartChar)(_e)){var Ce=_e.toLowerCase()==="m"?15:22;f.push(Lst(h,Ce))}(0,$o.isSchemeStartChar)(_e)&&f.push($8(h,0)),Wa.alphaNumericAndMarksRe.test(_e)&&f.push(rX(h,5))}}function A(_e,Ce){Ce===":"?_e.state=2:Ce==="-"?_e.state=1:(0,$o.isSchemeChar)(Ce)||(0,vo.remove)(f,_e)}function C(_e,Ce){Ce==="-"||(Ce==="/"?((0,vo.remove)(f,_e),f.push(rX(h,11))):(0,$o.isSchemeChar)(Ce)?_e.state=0:(0,vo.remove)(f,_e))}function S(_e,Ce){Ce==="/"?_e.state=3:Ce==="."?(0,vo.remove)(f,_e):(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=5,(0,$o.isSchemeStartChar)(Ce)&&f.push($8(h,0))):(0,vo.remove)(f,_e)}function v(_e,Ce){Ce==="/"?_e.state=4:(0,$o.isPathChar)(Ce)?(_e.state=10,_e.acceptStateReached=!0):an(_e)}function P(_e,Ce){Ce==="/"?_e.state=10:(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=5,_e.acceptStateReached=!0):(0,vo.remove)(f,_e)}function M(_e,Ce){Ce==="/"?_e.state=12:(0,vo.remove)(f,_e)}function R(_e,Ce){(0,$o.isDomainLabelStartChar)(Ce)?_e.state=5:(0,vo.remove)(f,_e)}function L(_e,Ce){Ce==="."?_e.state=7:Ce==="-"?_e.state=6:Ce===":"?_e.state=8:(0,$o.isUrlSuffixStartChar)(Ce)?_e.state=10:(0,$o.isDomainLabelChar)(Ce)||an(_e)}function F(_e,Ce){Ce==="-"||(Ce==="."?an(_e):(0,$o.isDomainLabelStartChar)(Ce)?_e.state=5:an(_e))}function _(_e,Ce){Ce==="."?an(_e):(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=5,_e.acceptStateReached=!0):an(_e)}function w(_e,Ce){Ce==="."?_e.state=14:Ce===":"?_e.state=8:Wa.digitRe.test(Ce)||((0,$o.isUrlSuffixStartChar)(Ce)?_e.state=10:Wa.alphaNumericAndMarksRe.test(Ce)?(0,vo.remove)(f,_e):an(_e))}function D(_e,Ce){Wa.digitRe.test(Ce)?(_e.octetsEncountered++,_e.octetsEncountered===4&&(_e.acceptStateReached=!0),_e.state=13):an(_e)}function I(_e,Ce){Wa.digitRe.test(Ce)?_e.state=9:an(_e)}function N(_e,Ce){Wa.digitRe.test(Ce)||((0,$o.isUrlSuffixStartChar)(Ce)?_e.state=10:an(_e))}function k(_e,Ce){(0,$o.isPathChar)(Ce)||an(_e)}function z(_e,Ce){Ce.toLowerCase()==="a"?_e.state=16:K(_e,Ce)}function V(_e,Ce){Ce.toLowerCase()==="i"?_e.state=17:K(_e,Ce)}function j(_e,Ce){Ce.toLowerCase()==="l"?_e.state=18:K(_e,Ce)}function U(_e,Ce){Ce.toLowerCase()==="t"?_e.state=19:K(_e,Ce)}function q(_e,Ce){Ce.toLowerCase()==="o"?_e.state=20:K(_e,Ce)}function Y(_e,Ce){Ce.toLowerCase()===":"?_e.state=21:K(_e,Ce)}function te(_e,Ce){(0,YS.isEmailLocalPartChar)(Ce)?_e.state=22:(0,vo.remove)(f,_e)}function K(_e,Ce){Ce==="."?_e.state=23:Ce==="@"?_e.state=24:(0,YS.isEmailLocalPartChar)(Ce)?_e.state=22:(0,vo.remove)(f,_e)}function Z(_e,Ce){Ce==="."||Ce==="@"?(0,vo.remove)(f,_e):(0,YS.isEmailLocalPartChar)(Ce)?_e.state=22:(0,vo.remove)(f,_e)}function ee(_e,Ce){(0,$o.isDomainLabelStartChar)(Ce)?_e.state=25:(0,vo.remove)(f,_e)}function me(_e,Ce){Ce==="."?_e.state=27:Ce==="-"?_e.state=26:(0,$o.isDomainLabelChar)(Ce)||an(_e)}function Te(_e,Ce){Ce==="-"||Ce==="."?an(_e):(0,$o.isDomainLabelChar)(Ce)?_e.state=25:an(_e)}function ue(_e,Ce){Ce==="."||Ce==="-"?an(_e):(0,$o.isDomainLabelStartChar)(Ce)?(_e.state=25,_e.acceptStateReached=!0):an(_e)}function ye(_e,Ce){(0,iX.isHashtagTextChar)(Ce)?(_e.state=29,_e.acceptStateReached=!0):(0,vo.remove)(f,_e)}function Ae(_e,Ce){(0,iX.isHashtagTextChar)(Ce)||an(_e)}function Pe(_e,Ce){(0,oX.isMentionTextChar)(Ce)?(_e.state=31,_e.acceptStateReached=!0):(0,vo.remove)(f,_e)}function Ee(_e,Ce){(0,oX.isMentionTextChar)(Ce)||(Wa.alphaNumericAndMarksRe.test(Ce)?(0,vo.remove)(f,_e):an(_e))}function ze(_e,Ce){Wa.digitRe.test(Ce)?_e.state=38:((0,vo.remove)(f,_e),x(Ce))}function qe(_e,Ce){Wa.digitRe.test(Ce)?_e.state=33:(0,vo.remove)(f,_e),x(Ce)}function it(_e,Ce){Wa.digitRe.test(Ce)?_e.state=34:(0,vo.remove)(f,_e)}function Dt(_e,Ce){Wa.digitRe.test(Ce)?_e.state=35:(0,vo.remove)(f,_e)}function jt(_e,Ce){Ce===")"?_e.state=36:(0,vo.remove)(f,_e)}function $e(_e,Ce){Wa.digitRe.test(Ce)?_e.state=38:(0,XS.isPhoneNumberSeparatorChar)(Ce)?_e.state=39:(0,vo.remove)(f,_e)}function un(_e,Ce){_e.acceptStateReached=!0,(0,XS.isPhoneNumberControlChar)(Ce)?_e.state=40:Ce==="#"?_e.state=41:Wa.digitRe.test(Ce)||(Ce==="("?_e.state=32:(0,XS.isPhoneNumberSeparatorChar)(Ce)?_e.state=39:(an(_e),(0,$o.isSchemeStartChar)(Ce)&&f.push($8(h,0))))}function zt(_e,Ce){Wa.digitRe.test(Ce)?_e.state=38:Ce==="("?_e.state=32:(an(_e),x(Ce))}function Ct(_e,Ce){(0,XS.isPhoneNumberControlChar)(Ce)||(Ce==="#"?_e.state=41:Wa.digitRe.test(Ce)?_e.state=38:an(_e))}function Ei(_e,Ce){(0,XS.isPhoneNumberControlChar)(Ce)?_e.state=40:Wa.digitRe.test(Ce)?(0,vo.remove)(f,_e):an(_e)}function an(_e){if((0,vo.remove)(f,_e),!!_e.acceptStateReached){var Ce=_e.startIdx,pn=e.slice(_e.startIdx,h);if(pn=wye(pn),_e.type==="url"){var mt=e.charAt(_e.startIdx-1);if(mt==="@")return;var so=_e.matchType;if(so==="scheme"){var Ro=$o.httpSchemeRe.exec(pn);if(Ro&&(Ce=Ce+Ro.index,pn=pn.slice(Ro.index)),!(0,$o.isValidSchemeUrl)(pn))return}else if(so==="tld"){if(!(0,$o.isValidTldMatch)(pn))return}else if(so==="ipV4"){if(!(0,$o.isValidIpV4Address)(pn))return}else(0,vo.assertNever)(so);l.push(new wst.UrlMatch({tagBuilder:n,matchedText:pn,offset:Ce,urlMatchType:so,url:pn,protocolRelativeMatch:pn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(_e.type==="email")(0,YS.isValidEmail)(pn)&&l.push(new vst.EmailMatch({tagBuilder:n,matchedText:pn,offset:Ce,email:pn.replace(YS.mailtoSchemePrefixRe,"")}));else if(_e.type==="hashtag")(0,iX.isValidHashtag)(pn)&&l.push(new Dst.HashtagMatch({tagBuilder:n,matchedText:pn,offset:Ce,serviceName:s,hashtag:pn.slice(1)}));else if(_e.type==="mention")(0,oX.isValidMention)(pn,a)&&l.push(new Pst.MentionMatch({tagBuilder:n,matchedText:pn,offset:Ce,serviceName:a,mention:pn.slice(1)}));else if(_e.type==="phone"){if(pn=pn.replace(/ +$/g,""),(0,XS.isValidPhoneNumber)(pn)){var aa=pn.replace(/[^0-9,;#]/g,"");l.push(new Ist.PhoneMatch({tagBuilder:n,matchedText:pn,offset:Ce,number:aa,plusSign:pn.charAt(0)==="+"}))}}else(0,vo.assertNever)(_e)}}}var Rst=/[\(\{\[]/,Eye=/[\)\}\]]/,Sye={")":"(","}":"{","]":"["};function wye(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Rst.test(i)?t[i]++:Eye.test(i)&&t[Sye[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Eye.test(r)){var s=Sye[r];if(t[s]<0)t[s]++,o--;else break}else if($o.urlSuffixedCharsNotAllowedAtEndRe.test(r))o--;else break;return e.slice(0,o+1)}function $8(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function rX(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Mst(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Lst(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Nst(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Fst(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function sX(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Bst(e){return e.type==="url"&&e.matchType==="scheme"}});var vye=Xn(cX=>{"use strict";Object.defineProperty(cX,"__esModule",{value:!0});cX.parseHtml=Ust;var Pc=($m(),nm(Km)),_l=OT(),kst=IT();function Ust(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Zm,l=0,u=e.length,f=0,h=0,p=a;l<u;){var g=e.charAt(l);switch(f){case 0:m(g);break;case 1:y(g);break;case 2:x(g);break;case 3:b(g);break;case 4:A(g);break;case 5:C(g);break;case 6:S(g);break;case 7:v(g);break;case 8:P(g);break;case 9:M(g);break;case 10:R(g);break;case 11:L(g);break;case 12:F(g);break;case 13:_(g);break;case 14:w(g);break;case 15:D(g);break;case 16:I(g);break;case 17:N(g);break;case 18:k(g);break;case 19:z(g);break;case 20:V(g);break;default:(0,kst.assertNever)(f)}l++}h<l&&Y();function m(Z){Z==="<"&&U()}function y(Z){Z==="!"?f=13:Z==="/"?(f=2,p=new Zm(Pc.__assign(Pc.__assign({},p),{isClosing:!0}))):Z==="<"?U():_l.letterRe.test(Z)?(f=3,p=new Zm(Pc.__assign(Pc.__assign({},p),{isOpening:!0}))):(f=0,p=a)}function b(Z){_l.whitespaceRe.test(Z)?(p=new Zm(Pc.__assign(Pc.__assign({},p),{name:te()})),f=4):Z==="<"?U():Z==="/"?(p=new Zm(Pc.__assign(Pc.__assign({},p),{name:te()})),f=12):Z===">"?(p=new Zm(Pc.__assign(Pc.__assign({},p),{name:te()})),q()):!_l.letterRe.test(Z)&&!_l.digitRe.test(Z)&&Z!==":"&&j()}function x(Z){Z===">"?j():_l.letterRe.test(Z)?f=3:j()}function A(Z){_l.whitespaceRe.test(Z)||(Z==="/"?f=12:Z===">"?q():Z==="<"?U():Z==="="||_l.quoteRe.test(Z)||_l.controlCharsRe.test(Z)?j():f=5)}function C(Z){_l.whitespaceRe.test(Z)?f=6:Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():_l.quoteRe.test(Z)&&j()}function S(Z){_l.whitespaceRe.test(Z)||(Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():_l.quoteRe.test(Z)?j():f=5)}function v(Z){_l.whitespaceRe.test(Z)||(Z==='"'?f=8:Z==="'"?f=9:/[>=`]/.test(Z)?j():Z==="<"?U():f=10)}function P(Z){Z==='"'&&(f=11)}function M(Z){Z==="'"&&(f=11)}function R(Z){_l.whitespaceRe.test(Z)?f=4:Z===">"?q():Z==="<"&&U()}function L(Z){_l.whitespaceRe.test(Z)?f=4:Z==="/"?f=12:Z===">"?q():Z==="<"?U():(f=4,K())}function F(Z){Z===">"?(p=new Zm(Pc.__assign(Pc.__assign({},p),{isClosing:!0})),q()):f=4}function _(Z){e.substr(l,2)==="--"?(l+=2,p=new Zm(Pc.__assign(Pc.__assign({},p),{type:"comment"})),f=14):e.substr(l,7).toUpperCase()==="DOCTYPE"?(l+=7,p=new Zm(Pc.__assign(Pc.__assign({},p),{type:"doctype"})),f=20):j()}function w(Z){Z==="-"?f=15:Z===">"?j():f=16}function D(Z){Z==="-"?f=18:Z===">"?j():f=16}function I(Z){Z==="-"&&(f=17)}function N(Z){Z==="-"?f=18:f=16}function k(Z){Z===">"?q():Z==="!"?f=19:Z==="-"||(f=16)}function z(Z){Z==="-"?f=17:Z===">"?q():f=16}function V(Z){Z===">"?q():Z==="<"&&U()}function j(){f=0,p=a}function U(){f=1,p=new Zm({idx:l})}function q(){var Z=e.slice(h,p.idx);Z&&o(Z,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)),j(),h=l+1}function Y(){var Z=e.slice(h,l);o(Z,h),h=l+1}function te(){var Z=p.idx+(p.isClosing?2:1);return e.slice(Z,l).toLowerCase()}function K(){l--}}var Zm=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 Q8=Xn(lX=>{"use strict";Object.defineProperty(lX,"__esModule",{value:!0});var Vst=Vge(),Ls=IT(),zst=qY(),Hst=k8(),Gst=aX(),jst=vye(),Wst=eX(),qst=QY(),Yst=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=Xst(t.urls),this.email=(0,Ls.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Ls.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Ls.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Kst(t.stripPrefix),this.stripTrailingSlash=(0,Ls.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Ls.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Wst.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&qst.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=$st(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(0,jst.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var l=/( | |<|<|>|>|"|"|')/gi,u=s.split(l),f=a;u.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,f);r.push.apply(r,g)}f+=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(l,u){return l.getOffset()-u.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||(0,Ls.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Ls.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Ls.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Ls.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Ls.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Ls.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Ls.removeWithPredicate)(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=(0,Gst.parseMatches)(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,"<").replace(/>/g,">"));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 Hst.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new zst.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Vst.version,e}();lX.default=Yst;function Xst(e){return e==null&&(e=!0),(0,Ls.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Ls.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Ls.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Ls.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function Kst(e){return e==null&&(e=!0),(0,Ls.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Ls.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Ls.isBoolean)(e.www)?e.www:!0}}function $st(e){return typeof e=="number"?{length:e,location:"end"}:(0,Ls.defaults)(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}});var Pye=Xn(Dye=>{"use strict";Object.defineProperty(Dye,"__esModule",{value:!0})});var Iye=Xn(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});var FT=($m(),nm(Km));FT.__exportStar(Pye(),lg);FT.__exportStar(ZY(),lg);FT.__exportStar(JY(),lg);FT.__exportStar(RT(),lg);FT.__exportStar(tX(),lg);FT.__exportStar(nX(),lg);FT.__exportStar($Y(),lg)});var Oye=Xn(uX=>{"use strict";Object.defineProperty(uX,"__esModule",{value:!0});var Zst=($m(),nm(Km));Zst.__exportStar(aX(),uX)});var fX=Xn((Nh,Mye)=>{"use strict";Nh=Mye.exports=Q8().default;Object.defineProperty(Nh,"__esModule",{value:!0});Nh.Autolinker=void 0;var KS=($m(),nm(Km)),Rye=KS.__importDefault(Q8());Nh.Autolinker=Rye.default;Nh.default=Rye.default;KS.__exportStar(Q8(),Nh);KS.__exportStar(qY(),Nh);KS.__exportStar(k8(),Nh);KS.__exportStar(Iye(),Nh);KS.__exportStar(Oye(),Nh)});var fZ=Xn((exports,module)=>{/*! - * protobuf.js v7.4.0 (c) 2016, daniel wirtz - * compiled thu, 22 aug 2024 20:30:39 utc + */(function(e,t){"use strict";typeof Rj=="object"&&Rj.exports?Rj.exports=t(Cue(),Sue(),Iue()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Pue,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(C,w){var P=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return P?M?new o(C,w):new o(C):new o;if(C===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(C),w!==void 0?this.absoluteTo(w):this}function s(C){return/^[0-9]+$/.test(C)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,w){var P={},M,F;if(f(w)==="RegExp")P=null;else if(d(w))for(M=0,F=w.length;M<F;M++)P[w[M]]=!0;else P[w]=!0;for(M=0,F=C.length;M<F;M++){var V=P&&P[C[M]]!==void 0||!P&&w.test(C[M]);V&&(C.splice(M,1),F--,M--)}return C}function g(C,w){var P,M;if(d(w)){for(P=0,M=w.length;P<M;P++)if(!g(C,w[P]))return!1;return!0}var F=f(w);for(P=0,M=C.length;P<M;P++)if(F==="RegExp"){if(typeof C[P]=="string"&&C[P].match(w))return!0}else if(C[P]===w)return!0;return!1}function m(C,w){if(!d(C)||!d(w)||C.length!==w.length)return!1;C.sort(),w.sort();for(var P=0,M=C.length;P<M;P++)if(C[P]!==w[P])return!1;return!0}function y(C){var w=/^\/+|\/+$/g;return C.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.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*$/,o.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,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.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"},o.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var w=C.nodeName.toLowerCase();if(!(w==="input"&&C.type!=="image"))return o.domAttributes[w]}};function A(C){return escape(C)}function b(C){return encodeURIComponent(C).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.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"}}}},o.encodeQuery=function(C,w){var P=o.encode(C+"");return w===void 0&&(w=o.escapeQuerySpace),w?P.replace(/%20/g,"+"):P},o.decodeQuery=function(C,w){C+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?C.replace(/\+/g,"%20"):C)}catch{return C}};var x={encode:"encode",decode:"decode"},T,E=function(C,w){return function(P){try{return o[w](P+"").replace(o.characters[C][w].expression,function(M){return o.characters[C][w].map[M]})}catch{return P}}};for(T in x)o[T+"PathSegment"]=E("pathname",x[T]),o[T+"UrnPathSegment"]=E("urnpath",x[T]);var v=function(C,w,P){return function(M){var F;P?F=function(k){return o[w](o[P](k))}:F=o[w];for(var V=(M+"").split(C),B=0,j=V.length;B<j;B++)V[B]=F(V[B]);return V.join(C)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=E("reserved","encode"),o.parse=function(C,w){var P;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),C=C.replace(o.leading_whitespace_expression,""),C=C.replace(o.ascii_tab_whitespace,""),P=C.indexOf("#"),P>-1&&(w.fragment=C.substring(P+1)||null,C=C.substring(0,P)),P=C.indexOf("?"),P>-1&&(w.query=C.substring(P+1)||null,C=C.substring(0,P)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(w.protocol=null,C=C.substring(2),C=o.parseAuthority(C,w)):(P=C.indexOf(":"),P>-1&&(w.protocol=C.substring(0,P)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:C.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(C=C.substring(P+3),C=o.parseAuthority(C,w)):(C=C.substring(P+1),w.urn=!0))),w.path=C,w},o.parseHost=function(C,w){C||(C=""),C=C.replace(/\\/g,"/");var P=C.indexOf("/"),M,F;if(P===-1&&(P=C.length),C.charAt(0)==="[")M=C.indexOf("]"),w.hostname=C.substring(1,M)||null,w.port=C.substring(M+2,P)||null,w.port==="/"&&(w.port=null);else{var V=C.indexOf(":"),B=C.indexOf("/"),j=C.indexOf(":",V+1);j!==-1&&(B===-1||j<B)?(w.hostname=C.substring(0,P)||null,w.port=null):(F=C.substring(0,P).split(":"),w.hostname=F[0]||null,w.port=F[1]||null)}return w.hostname&&C.substring(P).charAt(0)!=="/"&&(P++,C="/"+C),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),C.substring(P)||"/"},o.parseAuthority=function(C,w){return C=o.parseUserinfo(C,w),o.parseHost(C,w)},o.parseUserinfo=function(C,w){var P=C,M=C.indexOf("\\");M!==-1&&(C=C.replace(/\\/g,"/"));var F=C.indexOf("/"),V=C.lastIndexOf("@",F>-1?F:C.length-1),B;return V>-1&&(F===-1||V<F)?(B=C.substring(0,V).split(":"),w.username=B[0]?o.decode(B[0]):null,B.shift(),w.password=B[0]?o.decode(B.join(":")):null,C=P.substring(V+1)):(w.username=null,w.password=null),C},o.parseQuery=function(C,w){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var P={},M=C.split("&"),F=M.length,V,B,j,k=0;k<F;k++)V=M[k].split("="),B=o.decodeQuery(V.shift(),w),j=V.length?o.decodeQuery(V.join("="),w):null,B!=="__proto__"&&(c.call(P,B)?((typeof P[B]=="string"||P[B]===null)&&(P[B]=[P[B]]),P[B].push(j)):P[B]=j);return P},o.build=function(C){var w="",P=!1;return C.protocol&&(w+=C.protocol+":"),!C.urn&&(w||C.hostname)&&(w+="//",P=!0),w+=o.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&P&&(w+="/"),w+=C.path),typeof C.query=="string"&&C.query&&(w+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(w+="#"+C.fragment),w},o.buildHost=function(C){var w="";if(C.hostname)o.ip6_expression.test(C.hostname)?w+="["+C.hostname+"]":w+=C.hostname;else return"";return C.port&&(w+=":"+C.port),w},o.buildAuthority=function(C){return o.buildUserinfo(C)+o.buildHost(C)},o.buildUserinfo=function(C){var w="";return C.username&&(w+=o.encode(C.username)),C.password&&(w+=":"+o.encode(C.password)),w&&(w+="@"),w},o.buildQuery=function(C,w,P){var M="",F,V,B,j;for(V in C)if(V!=="__proto__"&&c.call(C,V))if(d(C[V]))for(F={},B=0,j=C[V].length;B<j;B++)C[V][B]!==void 0&&F[C[V][B]+""]===void 0&&(M+="&"+o.buildQueryParameter(V,C[V][B],P),w!==!0&&(F[C[V][B]+""]=!0));else C[V]!==void 0&&(M+="&"+o.buildQueryParameter(V,C[V],P));return M.substring(1)},o.buildQueryParameter=function(C,w,P){return o.encodeQuery(C,P)+(w!==null?"="+o.encodeQuery(w,P):"")},o.addQuery=function(C,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.addQuery(C,M,w[M]);else if(typeof w=="string"){if(C[w]===void 0){C[w]=P;return}else typeof C[w]=="string"&&(C[w]=[C[w]]);d(P)||(P=[P]),C[w]=(C[w]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(C,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.setQuery(C,M,w[M]);else if(typeof w=="string")C[w]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(C,w,P){var M,F,V;if(d(w))for(M=0,F=w.length;M<F;M++)C[w[M]]=void 0;else if(f(w)==="RegExp")for(V in C)w.test(V)&&(C[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(C,V,w[V]);else if(typeof w=="string")P!==void 0?f(P)==="RegExp"?!d(C[w])&&P.test(C[w])?C[w]=void 0:C[w]=p(C[w],P):C[w]===String(P)&&(!d(P)||P.length===1)?C[w]=void 0:d(C[w])&&(C[w]=p(C[w],P)):C[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(C,w,P,M){switch(f(w)){case"String":break;case"RegExp":for(var F in C)if(c.call(C,F)&&w.test(F)&&(P===void 0||o.hasQuery(C,F,P)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(C,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(P)){case"Undefined":return w in C;case"Boolean":var B=!!(d(C[w])?C[w].length:C[w]);return P===B;case"Function":return!!P(C[w],w,C);case"Array":if(!d(C[w]))return!1;var j=M?g:m;return j(C[w],P);case"RegExp":return d(C[w])?M?g(C[w],P):!1:!!(C[w]&&C[w].match(P));case"Number":P=String(P);case"String":return d(C[w])?M?g(C[w],P):!1:C[w]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var C=[],w=[],P=0,M=0;M<arguments.length;M++){var F=new o(arguments[M]);C.push(F);for(var V=F.segment(),B=0;B<V.length;B++)typeof V[B]=="string"&&w.push(V[B]),V[B]&&P++}if(!w.length||!P)return new o("");var j=new o("").segment(w);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(C,w){var P=Math.min(C.length,w.length),M;for(M=0;M<P;M++)if(C.charAt(M)!==w.charAt(M)){M--;break}return M<1?C.charAt(0)===w.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(M)!=="/"||w.charAt(M)!=="/")&&(M=C.substring(0,M).lastIndexOf("/")),C.substring(0,M+1))},o.withinString=function(C,w,P){P||(P={});var M=P.start||o.findUri.start,F=P.end||o.findUri.end,V=P.trim||o.findUri.trim,B=P.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var k=M.exec(C);if(!k)break;var G=k.index;if(P.ignoreHtml){var q=C.slice(Math.max(G-3,0),G);if(q&&j.test(q))continue}for(var Q=G+C.slice(G).search(F),W=C.slice(G,Q),J=-1;;){var Z=B.exec(W);if(!Z)break;var ae=Z.index+Z[0].length;J=Math.max(J,ae)}if(J>-1?W=W.slice(0,J)+W.slice(J).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(P.ignore&&P.ignore.test(W))){Q=G+W.length;var Ae=w(W,G,Q,C);if(Ae===void 0){M.lastIndex=Q;continue}Ae=String(Ae),C=C.slice(0,G)+Ae+C.slice(Q),M.lastIndex=G+Ae.length}}return M.lastIndex=0,C},o.ensureValidHostname=function(C,w){var P=!!C,M=!!w,F=!1;if(M&&(F=g(o.hostProtocols,w)),F&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(C&&C.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(C){if(C){var w=Number(C);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},o.noConflict=function(C){if(C){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function S(C){return function(w,P){return w===void 0?this._parts[C]||"":(this._parts[C]=w||null,this.build(!P),this)}}function I(C,w){return function(P,M){return P===void 0?this._parts[C]||"":(P!==null&&(P=P+"",P.charAt(0)===w&&(P=P.substring(1))),this._parts[C]=P,this.build(!M),this)}}a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(C,w){var P=this.query(C,w);return typeof P=="string"&&P.length?"?"+P:P},a.hash=function(C,w){var P=this.fragment(C,w);return typeof P=="string"&&P.length?"#"+P:P},a.pathname=function(C,w){if(C===void 0||C===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?o.decodeUrnPath:o.decodePath)(P):P}else return this._parts.urn?this._parts.path=C?o.recodeUrnPath(C):"":this._parts.path=C?o.recodePath(C):"/",this.build(!w),this},a.path=a.pathname,a.href=function(C,w){var P;if(C===void 0)return this.toString();this._string="",this._parts=o._parts();var M=C instanceof o,F=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var V=o.getDomAttribute(C);C=C[V]||"",F=!1}if(!M&&F&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=o.parse(String(C),this._parts);else if(M||F){var B=M?C._parts:C;for(P in B)P!=="query"&&c.call(this._parts,P)&&(this._parts[P]=B[P]);B.query&&this.query(B.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(C){var w=!1,P=!1,M=!1,F=!1,V=!1,B=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,P=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),w=P||M,F=!w,V=F&&n&&n.has(this._parts.hostname),B=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return F;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return M;case"idn":return B;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,O=a.port,L=a.hostname;a.protocol=function(C,w){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(o.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,C,w)},a.scheme=a.protocol,a.port=function(C,w){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),o.ensureValidPort(C))),O.call(this,C,w))},a.hostname=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(C,P);if(M!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=P.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,w)},a.origin=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var P=this.protocol(),M=this.authority();return M?(P?P+"://":"")+this.authority():""}else{var F=o(C);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var P=o.parseHost(C,this._parts);if(P!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var P=o.parseAuthority(C,this._parts);if(P!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var P=o.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),o.parseUserinfo(C,this._parts),this.build(!w),this},a.resource=function(C,w){var P;return C===void 0?this.path()+this.search()+this.hash():(P=o.parse(C),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!w),this)},a.subdomain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var M=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,M),V=new RegExp("^"+u(F));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&o.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,C),this.build(!w),this}},a.domain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(w).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,C)}return this.build(!w),this}},a.tld=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(P+1);return w!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var F;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C);else throw new TypeError('TLD "'+C+'" 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");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return C?o.decodePath(M):M}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),B=new RegExp("^"+u(V));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=o.recodePath(C),this._parts.path=this._parts.path.replace(B,C),this.build(!w),this}},a.filename=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(P+1);return C?o.decodePathSegment(M):M}else{var F=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return C=o.recodePath(C),this._parts.path=this._parts.path.replace(V,C),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),M=P.lastIndexOf("."),F,V;return M===-1?"":(F=P.substring(M+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",C?o.decodePathSegment(V):V)}else{C.charAt(0)==="."&&(C=C.substring(1));var B=this.suffix(),j;if(B)C?j=new RegExp(u(B)+"$"):j=new RegExp(u("."+B)+"$");else{if(!C)return this;this._parts.path+="."+o.recodePath(C)}return j&&(C=o.recodePath(C),this._parts.path=this._parts.path.replace(j,C)),this.build(!w),this}},a.segment=function(C,w,P){var M=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",B=F.split(M);if(C!==void 0&&typeof C!="number"&&(P=w,w=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(V&&B.shift(),C<0&&(C=Math.max(B.length+C,0)),w===void 0)return C===void 0?B:B[C];if(C===null||B[C]===void 0)if(d(w)){B=[];for(var j=0,k=w.length;j<k;j++)!w[j].length&&(!B.length||!B[B.length-1].length)||(B.length&&!B[B.length-1].length&&B.pop(),B.push(y(w[j])))}else(w||typeof w=="string")&&(w=y(w),B[B.length-1]===""?B[B.length-1]=w:B.push(w));else w?B[C]=y(w):B.splice(C,1);return V&&B.unshift(""),this.path(B.join(M),P)},a.segmentCoded=function(C,w,P){var M,F,V;if(typeof C!="number"&&(P=w,w=C,C=void 0),w===void 0){if(M=this.segment(C,w,P),!d(M))M=M!==void 0?o.decode(M):void 0;else for(F=0,V=M.length;F<V;F++)M[F]=o.decode(M[F]);return M}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(F=0,V=w.length;F<V;F++)w[F]=o.encode(w[F]);return this.segment(C,w,P)};var _=a.query;return a.query=function(C,w){if(C===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var P=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=C.call(this,P);return this._parts.query=o.buildQuery(M||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=o.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,C,w)},a.setQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)M[C]=w!==void 0?w:null;else if(typeof C=="object")for(var F in C)c.call(C,F)&&(M[F]=C[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.addQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(M,C,w===void 0?null:w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.removeQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(M,C,w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.hasQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(M,C,w,P)},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(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},a.normalizeHostname=function(C){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(!C)),this},a.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},a.normalizePath=function(C){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var P,M="",F,V;for(w.charAt(0)!=="/"&&(P=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(M=w.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));F=w.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){w=w.substring(3);continue}V=w.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),w=w.substring(0,V)+w.substring(F+3)}return P&&this.is("relative")&&(w=M+w.substring(1)),this._parts.path=w,this.build(!C),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},a.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var C=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.unicode=function(){var C=o.encode,w=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.readable=function(){var C=this.clone();C.username("").password("").normalize();var w="";if(C._parts.protocol&&(w+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(w+=e.toUnicode(C._parts.hostname),C._parts.port&&(w+=":"+C._parts.port)):w+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(w+="/"),w+=C.path(!0),C._parts.query){for(var P="",M=0,F=C._parts.query.split("&"),V=F.length;M<V;M++){var B=(F[M]||"").split("=");P+="&"+o.decodeQuery(B[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),B[1]!==void 0&&(P+="="+o.decodeQuery(B[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+P.substring(1)}return w+=o.decodeQuery(C.hash(),!0),w},a.absoluteTo=function(C){var w=this.clone(),P=["protocol","username","password","hostname","port"],M,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof o||(C=new o(C)),w._parts.protocol||(w._parts.protocol=C._parts.protocol,this._parts.hostname))return w;for(F=0;V=P[F];F++)w._parts[V]=C._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(M=C.directory(),M=M||(C.path().indexOf("/")===0?"/":""),w._parts.path=(M?M+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=C._parts.path,w._parts.query||(w._parts.query=C._parts.query)),w.build(),w},a.relativeTo=function(C){var w=this.clone().normalize(),P,M,F,V,B;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new o(C).normalize(),P=w._parts,M=C._parts,V=w.path(),B=C.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(B.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===M.protocol&&(P.protocol=null),P.username!==M.username||P.password!==M.password||P.protocol!==null||P.username!==null||P.password!==null)return w.build();if(P.hostname===M.hostname&&P.port===M.port)P.hostname=null,P.port=null;else return w.build();if(V===B)return P.path="",w.build();if(F=o.commonPath(V,B),!F)return w.build();var j=M.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=j+P.path.substring(F.length)||"./",w.build()},a.equals=function(C){var w=this.clone(),P=new o(C),M={},F={},V={},B,j,k;if(w.normalize(),P.normalize(),w.toString()===P.toString())return!0;if(B=w.query(),j=P.query(),w.query(""),P.query(""),w.toString()!==P.toString()||B.length!==j.length)return!1;M=o.parseQuery(B,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(k in M)if(c.call(M,k)){if(d(M[k])){if(!m(M[k],F[k]))return!1}else if(M[k]!==F[k])return!1;V[k]=!0}for(k in F)if(c.call(F,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},a.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},a.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},o})});var CJ=Yi((jIn,JM)=>{/*! + * protobuf.js v8.8.0 (c) 2016, daniel wirtz + * compiled thu, 27 aug 2026 00:01:05 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,l=2,u=!0;l<arguments.length;)s[a++]=arguments[l++];return new Promise(function(h,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var y=new Array(arguments.length-1),b=0;b<y.length;)y[b++]=arguments[b];h.apply(null,y)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.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(u,f,h){for(var p=null,g=[],m=0,y=0,b;f<h;){var x=u[f++];switch(y){case 0:g[m++]=o[x>>2],b=(x&3)<<4,y=1;break;case 1:g[m++]=o[b|x>>4],b=(x&15)<<2,y=2;break;case 2:g[m++]=o[b|x>>6],g[m++]=o[x&63],y=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return y&&(g[m++]=o[b],g[m++]=61,y===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,h){for(var p=h,g=0,m,y=0;y<u.length;){var b=u.charCodeAt(y++);if(b===61&&g>1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:m=b,g=1;break;case 1:f[h++]=m<<2|(b&48)>>4,m=b,g=2;break;case 2:f[h++]=(m&15)<<4|(b&60)>>2,m=b,g=3;break;case 3:f[h++]=(m&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],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],l=0;l<a.length;)a[l].fn===s?a.splice(l,1):++l;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],l=1;l<arguments.length;)a.push(arguments[l++]);for(l=0;l<s.length;)s[l].fn.apply(s[l++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(l){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3]}function g(b,x,A){u[0]=b,x[A]=f[3],x[A+1]=f[2],x[A+2]=f[1],x[A+3]=f[0]}l.writeFloatLE=h?p:g,l.writeFloatBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],u[0]}function y(b,x){return f[3]=b[x],f[2]=b[x+1],f[1]=b[x+2],f[0]=b[x+3],u[0]}l.readFloatLE=h?m:y,l.readFloatBE=h?y:m}():function(){function u(h,p,g,m){var y=p<0?1:0;if(y&&(p=-p),p===0)h(1/p>0?0:2147483648,g,m);else if(isNaN(p))h(2143289344,g,m);else if(p>34028234663852886e22)h((y<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)h((y<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var b=Math.floor(Math.log(p)/Math.LN2),x=Math.round(p*Math.pow(2,-b)*8388608)&8388607;h((y<<31|b+127<<23|x)>>>0,g,m)}}l.writeFloatLE=u.bind(null,o),l.writeFloatBE=u.bind(null,r);function f(h,p,g){var m=h(p,g),y=(m>>31)*2+1,b=m>>>23&255,x=m&8388607;return b===255?x?NaN:y*(1/0):b===0?y*1401298464324817e-60*x:y*Math.pow(2,b-150)*(x+8388608)}l.readFloatLE=f.bind(null,s),l.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3],x[A+4]=f[4],x[A+5]=f[5],x[A+6]=f[6],x[A+7]=f[7]}function g(b,x,A){u[0]=b,x[A]=f[7],x[A+1]=f[6],x[A+2]=f[5],x[A+3]=f[4],x[A+4]=f[3],x[A+5]=f[2],x[A+6]=f[1],x[A+7]=f[0]}l.writeDoubleLE=h?p:g,l.writeDoubleBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],f[4]=b[x+4],f[5]=b[x+5],f[6]=b[x+6],f[7]=b[x+7],u[0]}function y(b,x){return f[7]=b[x],f[6]=b[x+1],f[5]=b[x+2],f[4]=b[x+3],f[3]=b[x+4],f[2]=b[x+5],f[1]=b[x+6],f[0]=b[x+7],u[0]}l.readDoubleLE=h?m:y,l.readDoubleBE=h?y:m}():function(){function u(h,p,g,m,y,b){var x=m<0?1:0;if(x&&(m=-m),m===0)h(0,y,b+p),h(1/m>0?0:2147483648,y,b+g);else if(isNaN(m))h(0,y,b+p),h(2146959360,y,b+g);else if(m>17976931348623157e292)h(0,y,b+p),h((x<<31|2146435072)>>>0,y,b+g);else{var A;if(m<22250738585072014e-324)A=m/5e-324,h(A>>>0,y,b+p),h((x<<31|A/4294967296)>>>0,y,b+g);else{var C=Math.floor(Math.log(m)/Math.LN2);C===1024&&(C=1023),A=m*Math.pow(2,-C),h(A*4503599627370496>>>0,y,b+p),h((x<<31|C+1023<<20|A*1048576&1048575)>>>0,y,b+g)}}}l.writeDoubleLE=u.bind(null,o,0,4),l.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,g,m,y){var b=h(m,y+p),x=h(m,y+g),A=(x>>31)*2+1,C=x>>>20&2047,S=4294967296*(x&1048575)+b;return C===2047?S?NaN:A*(1/0):C===0?A*5e-324*S:A*Math.pow(2,C-1075)*(S+4503599627370496)}l.readDoubleLE=f.bind(null,s,0,4),l.readDoubleBE=f.bind(null,a,4,0)}(),l}function o(l,u,f){u[f]=l&255,u[f+1]=l>>>8&255,u[f+2]=l>>>16&255,u[f+3]=l>>>24}function r(l,u,f){u[f]=l>>>24,u[f+1]=l>>>16&255,u[f+2]=l>>>8&255,u[f+3]=l&255}function s(l,u){return(l[u]|l[u+1]<<8|l[u+2]<<16|l[u+3]<<24)>>>0}function a(l,u){return(l[u]<<24|l[u+1]<<16|l[u+2]<<8|l[u+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,l=a>>>1,u=null,f=a;return function(p){if(p<1||p>l)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,l=0;l<r.length;++l)a=r.charCodeAt(l),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(l+1)&64512)===56320?(++l,s+=4):s+=3;return s},i.read=function(r,s,a){var l=a-s;if(l<1)return"";for(var u=null,f=[],h=0,p;s<a;)p=r[s++],p<128?f[h++]=p:p>191&&p<224?f[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,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,s,a){for(var l=a,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-l}},{}],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=l;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,y){return RangeError("index out of range: "+m.pos+" + "+(y||1)+" > "+m.len)}function l(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(y){if(y instanceof Uint8Array||Array.isArray(y))return new l(y);throw Error("illegal buffer")}:function(y){if(Array.isArray(y))return new l(y);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(l.create=function(A){return i.Buffer.isBuffer(A)?new o(A):u(A)})(b)}:u};l.create=f(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var y=4294967295;return function(){if(y=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(y=(y|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return y;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return y}}(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var y=this.uint32();return y>>>1^-(y&1)|0};function h(){var m=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}l.prototype.bool=function(){return this.uint32()!==0};function p(m,y){return(m[y-4]|m[y-3]<<8|m[y-2]<<16|m[y-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.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))}l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var y=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,y},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var y=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,y},l.prototype.bytes=function(){var y=this.uint32(),b=this.pos,x=this.pos+y;if(x>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(b,x);if(b===x){var A=i.Buffer;return A?A.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,x)},l.prototype.string=function(){var y=this.bytes();return s.read(y,0,y.length)},l.prototype.skip=function(y){if(typeof y=="number"){if(this.pos+y>this.len)throw a(this,y);this.pos+=y}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},l._configure=function(m){o=m,l.create=f(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return h.call(this)[y](!1)},uint64:function(){return h.call(this)[y](!0)},sint64:function(){return h.call(this).zzDecode()[y](!1)},fixed64:function(){return g.call(this)[y](!0)},sfixed64:function(){return g.call(this)[y](!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,l,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,l,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return h.emit("error",g,s),f(g);if(m===null)return h.end(!0),undefined;if(!(m instanceof l))try{m=l[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(y){return h.emit("error",y,s),f(y)}return h.emit("data",m,s),f(null,m)})}catch(p){return h.emit("error",p,s),setTimeout(function(){f(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(l,u){this.lo=l>>>0,this.hi=u>>>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(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,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 u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<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,l){var u=a[l];return u!=null&&a.hasOwnProperty(l)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).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,l){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,l):u.toNumber(!!l)};function o(s,a,l){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!l)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(l,u){if(!(this instanceof a))return new a(l,u);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}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 l={},u=0;u<a.length;++u)l[a[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(l[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(l){for(var u=0;u<a.length;++u)a[u]!==l&&delete this[a[u]]}},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(l,u){return new s(l,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(l){return new s(l)}}},{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 l(C,S,v){this.fn=C,this.len=S,this.next=undefined,this.val=v}function u(){}function f(C){this.head=C.head,this.tail=C.tail,this.len=C.len,this.next=C.states}function h(){this.len=0,this.head=new l(u,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(S){return new i.Array(S)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(S,v,P){return this.tail=this.tail.next=new l(S,v,P),this.len+=v,this};function g(C,S,v){S[v]=C&255}function m(C,S,v){for(;C>127;)S[v++]=C&127|128,C>>>=7;S[v]=C}function y(C,S){this.len=C,this.next=undefined,this.val=S}y.prototype=Object.create(l.prototype),y.prototype.fn=m,h.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new y((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},h.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},h.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(C,S,v){for(;C.hi;)S[v++]=C.lo&127|128,C.lo=(C.lo>>>7|C.hi<<25)>>>0,C.hi>>>=7;for(;C.lo>127;)S[v++]=C.lo&127|128,C.lo=C.lo>>>7;S[v++]=C.lo}h.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},h.prototype.bool=function(S){return this._push(g,1,S?1:0)};function x(C,S,v){S[v]=C&255,S[v+1]=C>>>8&255,S[v+2]=C>>>16&255,S[v+3]=C>>>24}h.prototype.fixed32=function(S){return this._push(x,4,S>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(S){var v=r.from(S);return this._push(x,4,v.lo)._push(x,4,v.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},h.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var A=i.Array.prototype.set?function(S,v,P){v.set(S,P)}:function(S,v,P){for(var M=0;M<S.length;++M)v[P+M]=S[M]};h.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var P=h.alloc(v=s.length(S));s.decode(S,P,0),S=P}return this.uint32(v)._push(A,v,S)},h.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new l(u,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 l(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var S=this.head,v=this.tail,P=this.len;return this.reset().uint32(P),P&&(this.tail.next=S.next,this.tail=v,this.len+=P),this},h.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),P=0;S;)S.fn(S.val,v,P),P+=S.len,S=S.next;return v},h._configure=function(C){o=C,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(l,u,f){u.set(l,f)}:function(l,u,f){if(l.copy)l.copy(u,f,0,l.length);else for(var h=0;h<l.length;)u[f++]=l[h++]}},r.prototype.bytes=function(l){o.isString(l)&&(l=o._Buffer_from(l,"base64"));var u=l.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,l),this};function s(a,l,u){a.length<40?o.utf8.write(a,l,u):l.utf8Write?l.utf8Write(a,u):l.write(a,u)}r.prototype.string=function(l){var u=o.Buffer.byteLength(l);return this.uint32(u),u&&this._push(s,u,l),this},r._configure()},{15:15,16:16}]},{},[8])})()});var vEe=Xn((N9i,QG)=>{/* 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(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=l(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,y=r(g,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),b={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(b.maskData=y.resultMask),h.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(b.fileInfo=s(g),h.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,h,p,g,m){var y=0,b=f.pixels.numBlocksX,x=f.pixels.numBlocksY,A=Math.floor(f.width/b),C=Math.floor(f.height/x),S=2*f.maxZError,v=Number.MAX_VALUE,P;p=p||(f.mask?f.mask.bitset:null);var M,R;M=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var L=new Float32Array(A*C),F,_,w=0;w<=x;w++){var D=w!==x?C:f.height%x;if(D!==0)for(var I=0;I<=b;I++){var N=I!==b?A:f.width%b;if(N!==0){var k=w*f.width*C+I*A,z=f.width-N,V=f.pixels.blocks[y],j,U,q;V.encoding<2?(V.encoding===0?j=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),j=L),U=0):V.encoding===2?q=0:q=V.offset;var Y;if(p)for(_=0;_<D;_++){for(k&7&&(Y=p[k>>3],Y<<=k&7),F=0;F<N;F++)k&7||(Y=p[k>>3]),Y&128?(R&&(R[k]=1),P=V.encoding<2?j[U++]:q,v=v>P?P:v,M[k++]=P):(R&&(R[k]=0),M[k++]=g),Y<<=1;k+=z}else if(V.encoding<2)for(_=0;_<D;_++){for(F=0;F<N;F++)P=j[U++],v=v>P?P:v,M[k++]=P;k+=z}else for(v=v>q?q:v,_=0;_<D;_++){for(F=0;F<N;F++)M[k++]=q;k+=z}if(V.encoding===1&&U!==V.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:M,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<h;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},l=function(f,h,p){var g={},m=new Uint8Array(f,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var y=new DataView(f,h,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),h+=24,!p)if(y=new DataView(f,h,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,h,g.mask.numBytes);var x=y.getInt16(0,!0),A=2,C=0;do{if(x>0)for(;x--;)b[C++]=y.getUint8(A++);else{var S=y.getUint8(A++);for(x=-x;x--;)b[C++]=S}x=y.getInt16(A,!0),A+=2}while(A<g.mask.numBytes);if(x!==-32768||C<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,h+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,h,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),h+=16;var v=g.pixels.numBlocksX,P=g.pixels.numBlocksY,M=v+(g.width%v>0?1:0),R=P+(g.height%P>0?1:0);g.pixels.blocks=new Array(M*R);for(var L=0,F=0;F<R;F++)for(var _=0;_<M;_++){var w=0,D=f.byteLength-h;y=new DataView(f,h,Math.min(10,D));var I={};g.pixels.blocks[L++]=I;var N=y.getUint8(0);if(w++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=y.getInt8(1),w++;else if(N===1)I.offset=y.getInt16(1,!0),w+=2;else if(N===0)I.offset=y.getFloat32(1,!0),w+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=y.getUint8(w),w++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=y.getUint8(w),w++;else if(N===1)I.numValidPixels=y.getUint16(w,!0),w+=2;else if(N===0)I.numValidPixels=y.getUint32(w,!0),w+=4;else throw"Invalid valid pixel count type"}if(h+=w,I.encoding!==3){var k,z;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";k=new ArrayBuffer(V*4),z=new Uint8Array(k),z.set(new Uint8Array(f,h,V*4));var j=new Float32Array(k);I.rawData=j,h+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);k=new ArrayBuffer(q*4),z=new Uint8Array(k),z.set(new Uint8Array(f,h,U)),I.stuffedData=new Uint32Array(k),h+=U}}}return g.eofOffset=h,g},u=function(f,h,p,g,m,y,b){var x=(1<<h)-1,A=0,C,S=0,v,P,M=Math.ceil((b-g)/m),R=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*R,C=0;C<p;C++){if(S===0&&(P=f[A++],S=32),S>=h)v=P>>>S-h&x,S-=h;else{var L=h-S;v=(P&x)<<L&x,P=f[A++],S=32-L,v+=P>>>S}y[C]=v<M?g+v*m:b}return y};return o}(),t=function(){"use strict";var o={unstuff:function(l,u,f,h,p,g,m,y){var b=(1<<f)-1,x=0,A,C=0,S,v,P,M,R=l.length*4-Math.ceil(f*h/8);if(l[l.length-1]<<=8*R,p)for(A=0;A<h;A++)C===0&&(v=l[x++],C=32),C>=f?(S=v>>>C-f&b,C-=f):(P=f-C,S=(v&b)<<P&b,v=l[x++],C=32-P,S+=v>>>C),u[A]=p[S];else for(M=Math.ceil((y-g)/m),A=0;A<h;A++)C===0&&(v=l[x++],C=32),C>=f?(S=v>>>C-f&b,C-=f):(P=f-C,S=(v&b)<<P&b,v=l[x++],C=32-P,S+=v>>>C),u[A]=S<M?g+S*m:y},unstuffLUT:function(l,u,f,h,p,g){var m=(1<<u)-1,y=0,b=0,x=0,A=0,C=0,S,v=[],P=l.length*4-Math.ceil(u*f/8);l[l.length-1]<<=8*P;var M=Math.ceil((g-h)/p);for(b=0;b<f;b++)A===0&&(S=l[y++],A=32),A>=u?(C=S>>>A-u&m,A-=u):(x=u-A,C=(S&m)<<x&m,S=l[y++],A=32-x,C+=S>>>A),v[b]=C<M?h+C*p:g;return v.unshift(h),v},unstuff2:function(l,u,f,h,p,g,m,y){var b=(1<<f)-1,x=0,A,C=0,S=0,v,P,M;if(p)for(A=0;A<h;A++)C===0&&(P=l[x++],C=32,S=0),C>=f?(v=P>>>S&b,C-=f,S+=f):(M=f-C,v=P>>>S&b,P=l[x++],C=32-M,v|=(P&(1<<M)-1)<<f-M,S=M),u[A]=p[v];else{var R=Math.ceil((y-g)/m);for(A=0;A<h;A++)C===0&&(P=l[x++],C=32,S=0),C>=f?(v=P>>>S&b,C-=f,S+=f):(M=f-C,v=P>>>S&b,P=l[x++],C=32-M,v|=(P&(1<<M)-1)<<f-M,S=M),u[A]=v<R?g+v*m:y}return u},unstuffLUT2:function(l,u,f,h,p,g){var m=(1<<u)-1,y=0,b=0,x=0,A=0,C=0,S=0,v,P=[],M=Math.ceil((g-h)/p);for(b=0;b<f;b++)A===0&&(v=l[y++],A=32,S=0),A>=u?(C=v>>>S&m,A-=u,S+=u):(x=u-A,C=v>>>S&m,v=l[y++],A=32-x,C|=(v&(1<<x)-1)<<u-x,S=x),P[b]=C<M?h+C*p:g;return P.unshift(h),P},originalUnstuff:function(l,u,f,h){var p=(1<<f)-1,g=0,m,y=0,b,x,A,C=l.length*4-Math.ceil(f*h/8);for(l[l.length-1]<<=8*C,m=0;m<h;m++)y===0&&(x=l[g++],y=32),y>=f?(b=x>>>y-f&p,y-=f):(A=f-y,b=(x&p)<<A&p,x=l[g++],y=32-A,b+=x>>>y),u[m]=b;return u},originalUnstuff2:function(l,u,f,h){var p=(1<<f)-1,g=0,m,y=0,b=0,x,A,C;for(m=0;m<h;m++)y===0&&(A=l[g++],y=32,b=0),y>=f?(x=A>>>b&p,y-=f,b+=f):(C=f-y,x=A>>>b&p,A=l[g++],y=32-C,x|=(A&(1<<C)-1)<<f-C,b=C),u[m]=x;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(l){for(var u=65535,f=65535,h=l.length,p=Math.floor(h/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=l[g++]<<8,f+=u+=l[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=l[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(l,u){var f=u.ptr,h=new Uint8Array(l,f,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;f+=6;var g=new DataView(l,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(l,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(l,f,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),f+=40,u.headerInfo=p,u.ptr=f;var y,b;if(m>=3&&(b=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(l,f-b,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(l,u.ptr,h,p),m=this.readSubArray(l,u.ptr+p,h,p);u.ptr+=2*p;var y,b=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){b=!1;break}return f.minValues=g,f.maxValues=m,b},readSubArray:function(l,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(l,u,h);else{var g=new ArrayBuffer(h),m=new Uint8Array(g);m.set(new Uint8Array(l,u,h)),p=new f(g)}return p},readMask:function(l,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,g=h.numValidPixel,m=new DataView(l,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var b,x;if(g===0)b=new Uint8Array(Math.ceil(p/8)),y.bitset=b,x=new Uint8Array(p),u.pixels.resultMask=x,f+=y.numBytes;else if(y.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(l,f,y.numBytes);var A=m.getInt16(0,!0),C=2,S=0,v=0;do{if(A>0)for(;A--;)b[S++]=m.getUint8(C++);else for(v=m.getUint8(C++),A=-A;A--;)b[S++]=v;A=m.getInt16(C,!0),C+=2}while(C<y.numBytes);if(A!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";x=new Uint8Array(p);var P=0,M=0;for(M=0;M<p;M++)M&7?(P=b[M>>3],P<<=M&7):P=b[M>>3],P&128&&(x[M]=1);u.pixels.resultMask=x,y.bitset=b,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(l,u,f){var h=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,b=p.numValidPixel*r.getDataTypeSize(y)*g,x,A=u.pixels.resultMask;if(f===Uint8Array)x=new Uint8Array(l,h,b);else{var C=new ArrayBuffer(b),S=new Uint8Array(C);S.set(new Uint8Array(l,h,b)),x=new f(C)}if(x.length===m*g)u.pixels.resultPixels=x;else{u.pixels.resultPixels=new f(m*g);var v=0,P=0,M=0,R=0;if(g>1)for(M=0;M<g;M++)for(R=M*m,P=0;P<m;P++)A[P]&&(u.pixels.resultPixels[R+P]=x[v++]);else for(P=0;P<m;P++)A[P]&&(u.pixels.resultPixels[P]=x[v++])}return h+=b,u.ptr=h,!0},readHuffmanTree:function(l,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(l,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),m=h.getInt32(8,!0),y=h.getInt32(12,!0);if(m>=y)return!1;var b=new Uint32Array(y-m);r.decodeBits(l,u,b);var x=[],A,C,S,v;for(A=m;A<y;A++)C=A-(A<g?0:g),x[C]={first:b[A-m],second:null};var P=l.byteLength-u.ptr,M=Math.ceil(P/4),R=new ArrayBuffer(M*4),L=new Uint8Array(R);L.set(new Uint8Array(l,u.ptr,P));var F=new Uint32Array(R),_=0,w,D=0;for(w=F[0],A=m;A<y;A++)C=A-(A<g?0:g),v=x[C].first,v>0&&(x[C].second=w<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,D++,w=F[D])):(_+=v-32,D++,w=F[D],x[C].second|=w>>>32-_));var I=0,N=0,k=new s;for(A=0;A<x.length;A++)x[A]!==void 0&&(I=Math.max(I,x[A].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var z=[],V,j,U,q,Y,te;for(A=m;A<y;A++)if(C=A-(A<g?0:g),v=x[C].first,v>0)if(V=[v,C],v<=N)for(j=x[C].second<<N-v,U=1<<N-v,S=0;S<U;S++)z[j|S]=V;else for(j=x[C].second,te=k,q=v-1;q>=0;q--)Y=j>>>q&1,Y?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),q===0&&!te.val&&(te.val=V[1]);return{decodeLut:z,numBitsLUTQick:N,numBitsLUT:I,tree:k,stuffedData:F,srcPtr:D,bitPos:_}},readHuffman:function(l,u,f){var h=u.headerInfo,p=h.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,b=this.readHuffmanTree(l,u),x=b.decodeLut,A=b.tree,C=b.stuffedData,S=b.srcPtr,v=b.bitPos,P=b.numBitsLUTQick,M=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,L,F,_,w=u.pixels.resultMask,D,I,N,k,z,V,j,U=0;v>0&&(S++,v=0);var q=C[S],Y=u.encodeMode===1,te=new f(y*p),K=te,Z;for(Z=0;Z<h.numDims;Z++){if(p>1&&(K=new f(te.buffer,y*Z,y),U=0),u.headerInfo.numValidPixel===m*g)for(V=0,k=0;k<g;k++)for(z=0;z<m;z++,V++){if(F=0,D=q<<v>>>32-P,I=D,32-v<P&&(D|=C[S+1]>>>64-v-P,I=D),x[I])F=x[I][1],v+=x[I][0];else for(D=q<<v>>>32-M,I=D,32-v<M&&(D|=C[S+1]>>>64-v-M,I=D),L=A,j=0;j<M;j++)if(N=D>>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){F=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=C[S]),_=F-R,Y?(z>0?_+=U:k>0?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}else for(V=0,k=0;k<g;k++)for(z=0;z<m;z++,V++)if(w[V]){if(F=0,D=q<<v>>>32-P,I=D,32-v<P&&(D|=C[S+1]>>>64-v-P,I=D),x[I])F=x[I][1],v+=x[I][0];else for(D=q<<v>>>32-M,I=D,32-v<M&&(D|=C[S+1]>>>64-v-M,I=D),L=A,j=0;j<M;j++)if(N=D>>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){F=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=C[S]),_=F-R,Y?(z>0&&w[V-1]?_+=U:k>0&&w[V-m]?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=te},decodeBits:function(l,u,f,h,p){{var g=u.headerInfo,m=g.fileVersion,y=0,b=new DataView(l,u.ptr,5),x=b.getUint8(0);y++;var A=x>>6,C=A===0?4:3-A,S=(x&32)>0,v=x&31,P=0;if(C===1)P=b.getUint8(y),y++;else if(C===2)P=b.getUint16(y,!0),y+=2;else if(C===4)P=b.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var M=2*g.maxZError,R,L,F,_,w,D,I,N,k,z,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,N=b.getUint8(y),k=v,y++,_=Math.ceil((N-1)*v/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),F=new Uint8Array(L),u.ptr+=y,F.set(new Uint8Array(l,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,z=0;N-1>>>z;)z++;_=Math.ceil(P*z/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),F=new Uint8Array(L),F.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?D=o.unstuffLUT2(I,v,N-1,h,M,V):D=o.unstuffLUT(I,v,N-1,h,M,V),m>=3?o.unstuff2(R,f,z,P,D):o.unstuff(R,f,z,P,D)}else u.counter.bitstuffer++,z=v,u.ptr+=y,z>0&&(_=Math.ceil(P*z/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),F=new Uint8Array(L),F.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?h==null?o.originalUnstuff2(R,f,z,P):o.unstuff2(R,f,z,P,!1,h,M,V):h==null?o.originalUnstuff(R,f,z,P):o.unstuff(R,f,z,P,!1,h,M,V))}},readTiles:function(l,u,f){var h=u.headerInfo,p=h.width,g=h.height,m=h.microBlockSize,y=h.imageType,b=r.getDataTypeSize(y),x=Math.ceil(p/m),A=Math.ceil(g/m);u.pixels.numBlocksY=A,u.pixels.numBlocksX=x,u.pixels.ptr=0;var C=0,S=0,v=0,P=0,M=0,R=0,L=0,F=0,_=0,w=0,D=0,I=0,N=0,k=0,z=0,V=0,j,U,q,Y,te,K,Z=new f(m*m),ee=g%m||m,me=p%m||m,Te,ue,ye=h.numDims,Ae,Pe=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(v=0;v<A;v++)for(M=v!==A-1?m:ee,P=0;P<x;P++)for(R=P!==x-1?m:me,D=v*p*m+P*m,I=p-R,Ae=0;Ae<ye;Ae++){if(ye>1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*Ae*b,p*g)),L=l.byteLength-u.ptr,j=new DataView(l,u.ptr,Math.min(10,L)),U={},V=0,F=j.getUint8(0),V++,_=F>>6&255,w=F>>2&15,w!==(P*m>>3&15))throw"integrity issue";if(K=F&3,K>3)throw u.ptr+=V,"Invalid block encoding ("+K+")";if(K===2){u.counter.constant++,u.ptr+=V;continue}else if(K===0){if(u.counter.uncompressed++,u.ptr+=V,N=M*R*b,k=l.byteLength-u.ptr,N=N<k?N:k,q=new ArrayBuffer(N%b===0?N:N+b-N%b),Y=new Uint8Array(q),Y.set(new Uint8Array(l,u.ptr,N)),te=new f(q),z=0,Pe)for(C=0;C<M;C++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=te[z++]),D++;D+=I}else for(C=0;C<M;C++){for(S=0;S<R;S++)Ee[D++]=te[z++];D+=I}u.ptr+=z*b}else if(Te=r.getDataTypeUsed(y,_),ue=r.getOnePixel(U,V,Te,j),V+=r.getDataTypeSize(Te),K===3)if(u.ptr+=V,u.counter.constantoffset++,Pe)for(C=0;C<M;C++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=ue),D++;D+=I}else for(C=0;C<M;C++){for(S=0;S<R;S++)Ee[D++]=ue;D+=I}else if(u.ptr+=V,r.decodeBits(l,u,Z,ue,Ae),V=0,Pe)for(C=0;C<M;C++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=Z[V++]),D++;D+=I}else for(C=0;C<M;C++){for(S=0;S<R;S++)Ee[D++]=Z[V++];D+=I}}},formatFileInfo:function(l){return{fileIdentifierString:l.headerInfo.fileIdentifierString,fileVersion:l.headerInfo.fileVersion,imageType:l.headerInfo.imageType,height:l.headerInfo.height,width:l.headerInfo.width,numValidPixel:l.headerInfo.numValidPixel,microBlockSize:l.headerInfo.microBlockSize,blobSize:l.headerInfo.blobSize,maxZError:l.headerInfo.maxZError,pixelType:r.getPixelType(l.headerInfo.imageType),eofOffset:l.eofOffset,mask:l.mask?{numBytes:l.mask.numBytes}:null,pixels:{numBlocksX:l.pixels.numBlocksX,numBlocksY:l.pixels.numBlocksY,maxValue:l.headerInfo.zMax,minValue:l.headerInfo.zMin,noDataValue:l.noDataValue}}},constructConstantSurface:function(l){var u=l.headerInfo.zMax,f=l.headerInfo.numDims,h=l.headerInfo.height*l.headerInfo.width,p=h*f,g=0,m=0,y=0,b=l.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(y=g*h,m=0;m<h;m++)b[m]&&(l.pixels.resultPixels[y+m]=u);else for(m=0;m<h;m++)b[m]&&(l.pixels.resultPixels[m]=u);else if(l.pixels.resultPixels.fill)l.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)l.pixels.resultPixels[m]=u},getDataTypeArray:function(l){var u;switch(l){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(l){var u;switch(l){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(l,u){if(u==null)return!1;var f;switch(l){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(l){var u=0;switch(l){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=l}return u},getDataTypeUsed:function(l,u){var f=l;switch(l){case 2:case 4:f=l-u;break;case 3:case 5:f=l-2*u;break;case 6:u===0?f=l:u===1?f=2:f=1;break;case 7:u===0?f=l:f=l-2*u+1;break;default:f=l;break}return f},getOnePixel:function(l,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(l,u,f){this.val=l,this.left=u,this.right=f},a={decode:function(l,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(l,p)){var g=p.headerInfo,m=g.fileVersion,y=r.getDataTypeArray(g.imageType);r.readMask(l,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new y(b*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(m>=4&&r.checkMinMaxRanges(l,p))r.constructConstantSurface(p);else{var x=new DataView(l,p.ptr,2),A=x.getUint8(0);if(p.ptr++,A)r.readDataOneSweep(l,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var C=x.getUint8(1);if(p.ptr++,p.encodeMode=C,C>2||m<4&&C>1)throw"Invalid Huffman flag "+C;C?r.readHuffman(l,p,y):r.readTiles(l,p,y)}else r.readTiles(l,p,y)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={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,f)){var P=p.pixels.resultMask;for(h=0;h<b;h++)P[h]||(v.pixelData[h]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(l){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<l.byteLength-58;)r.readHeaderInfo(l,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};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),l=String.fromCharCode.apply(null,a),u,f;if(l.trim()==="CntZImage")u=e,f=1;else if(l.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+l;for(var h=0,p=o.byteLength-10,g,m=[],y,b,x={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var A=u.decode(o,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=A.fileInfo.eofOffset,h===0&&(g=A.encodedMaskData,b=A.maskData,x.width=A.width,x.height=A.height,x.dimCount=A.dimCount||1,x.pixelType=A.pixelType||A.fileInfo.pixelType,x.mask=A.maskData),f>1&&A.fileInfo.mask&&A.fileInfo.mask.numBytes>0&&m.push(A.maskData),h++,x.pixels.push(A.pixelData),x.statistics.push({minValue:A.minValue,maxValue:A.maxValue,noDataValue:A.noDataValue,dimStats:A.dimStats})}var C,S,v;if(f>1&&m.length>1){for(v=x.width*x.height,x.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),C=1;C<m.length;C++)for(y=m[C],S=0;S<v;S++)b[S]=b[S]&y[S];x.maskData=b}return x}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof QG<"u"&&QG.exports?QG.exports=i:this.Lerc=i})()});var dSe=Xn((yU,JQ)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof yU=="object"&&typeof JQ=="object"?JQ.exports=t():typeof define=="function"&&define.amd?define([],t):typeof yU=="object"?yU.NoSleep=t():e.NoSleep=t()})(yU,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(i,o,r){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:r})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var s in i)n.d(r,s,function(a){return i[a]}.bind(null,s));return r},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var i=function(){function f(h,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(h,m.key,m)}}return function(h,p,g){return p&&f(h.prototype,p),g&&f(h,g),h}}(),o=n(1),r=o.webm,s=o.mp4,a=function(){return 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},l=function(){return"wakeLock"in navigator},u=function(){function f(){var h=this;if(function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}(this,f),this.enabled=!1,l()){this._wakeLock=null;var p=function(){h._wakeLock!==null&&document.visibilityState==="visible"&&h.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){h.noSleepVideo.duration<=1?h.noSleepVideo.setAttribute("loop",""):h.noSleepVideo.addEventListener("timeupdate",function(){h.noSleepVideo.currentTime>.5&&(h.noSleepVideo.currentTime=Math.random())})}))}return i(f,[{key:"_addSourceToVideo",value:function(h,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,h.appendChild(m)}},{key:"enable",value:function(){var h=this;return l()?navigator.wakeLock.request("screen").then(function(p){h._wakeLock=p,h.enabled=!0,console.log("Wake Lock active."),h._wakeLock.addEventListener("release",function(){console.log("Wake Lock released.")})}).catch(function(p){throw h.enabled=!1,console.error(p.name+", "+p.message),p}):a()?(this.disable(),console.warn(` + */(function(e){"use strict";(function(n,i,r){function o(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},o,c,c.exports),c.exports}var s=o(r[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof JM=="object"&&JM&&JM.exports&&(JM.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.utf8;function c(T,E){return RangeError("index out of range: "+T.pos+" + "+(E||1)+" > "+T.len)}function u(T){this.buf=T,this.pos=0,this.len=T.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(T){if(Array.isArray(T)&&(T=new Uint8Array(T)),T instanceof Uint8Array)return new u(T);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(v){return(u.create=function(I){return r.Buffer.isBuffer(I)?new o(I):f(I)})(v)}:f};u.create=d(),u.prototype.raw=function(E,v){return this.buf.subarray(E,v)};function p(T){for(var E=0,v=0;v<4;++v){if(T.pos>=T.len)throw c(T);var S=T.buf[T.pos++];if(E=(E|(S&127)<<v*7)>>>0,S<128)return E}throw c(T)}u.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v++]<128)return this.pos=v,S;for(var I=0;I<5;++I){if(v>=this.len)throw this.pos=v,c(this);if(E[v++]<128)return this.pos=v,S}throw this.pos=v,Error("invalid varint encoding")},u.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v]<128&&(E[v]&112)===0)return this.pos=v+1,S;throw this.pos=v+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var E=this.uint32();return E>>>1^-(E&1)|0};function g(){var T=new s(0,0),E=0;if(this.len-this.pos>4){for(;E<4;++E)if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T;if(T.lo=(T.lo|(this.buf[this.pos]&127)<<28)>>>0,T.hi=(T.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return T;E=0}else{for(;E<4;++E){if(this.pos>=this.len)throw c(this);if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T}throw c(this)}if(this.len-this.pos>4){for(;E<5;++E)if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}else for(;E<5;++E){if(this.pos>=this.len)throw c(this);if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var E=!1,v,S=0;S<10;++S){if(this.pos>=this.len)throw c(this);if(v=this.buf[this.pos++],v&127&&(E=!0),v<128)return E}throw Error("invalid varint encoding")};function m(T,E){return(T[E-4]|T[E-3]<<8|T[E-2]<<16|T[E-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var E=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,E},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var E=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,E},u.prototype.uint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.uint32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.int32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint32());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.bools=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O!==0):(this.pos=R-1,E.push(this.bool()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E};var A=8,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getUint32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.sfixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getInt32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4)|0;if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.floats=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getFloat32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=r.float.readFloatLE(C,O);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.doubles=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>3,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=8)E[R++]=L.getFloat64(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=8)E[R++]=r.float.readDoubleLE(C,O);if(this.pos=O,O!==S)throw c(this,8);return E},u.prototype.uint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.uint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.int64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.fixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.fixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.sfixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.sfixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.bytes=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,this.raw(v,S)},u.prototype.string=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.read(this.buf,v,S)},u.prototype.stringVerify=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.readStrict(this.buf,v,S)},u.prototype.skip=function(E){if(typeof E=="number"){if(this.pos+E>this.len)throw c(this,E);this.pos+=E}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(T,E,v){if(E===e&&(E=0),E>u.recursionLimit)throw Error("max depth exceeded");if(v===0)throw Error("illegal tag: field number 0");switch(T){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var S=this.tag(),I=S>>>3;if(T=S&7,!I)throw Error("illegal tag: field number 0");if(T===4){if(v!==e&&I!==v)throw Error("invalid end group tag");break}this.skipType(T,E+1,I)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+T+" at offset "+this.pos)}return this},u._configure=function(T){o=T,u.create=d(),o._configure();var E=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return g.call(this)[E](!1)},uint64:function(){return g.call(this)[E](!0)},sint64:function(){return g.call(this).zzDecode()[E](!1)},fixed64:function(){return y.call(this)[E](!0)},sfixed64:function(){return y.call(this)[E](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var r=t(2);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(a){r.call(this,a)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},s.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}o.prototype.rpcCall=function s(a,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(s,p,a,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,a),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,a),d(A)}return p.emit("data",y,a),d(null,y)})}catch(g){return p.emit("error",g,a),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,s){for(var a=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)a[c++]=arguments[u++];return new Promise(function(p,g){a[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(s||null,a)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),s=new Array(123),a=0;a<64;)s[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,E;m<y;){var v=g[m++];switch(T){case 0:b[x++]=o[v>>2],E=(v&3)<<4,T=1;break;case 1:b[x++]=o[E|v>>4],E=(v&15)<<2,T=2;break;case 2:b[x++]=o[E|v>>6],b[x++]=o[v&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[E],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&b>1)break;if((E=s[E])===e)throw Error(c);switch(b){case 0:x=E,b=1;break;case 1:m[y++]=x<<2|(E&48)>>4,x=E,b=2;break;case 2:m[y++]=(x&15)<<4|(E&60)>>2,x=E,b=3;break;case 3:m[y++]=(x&3)<<6|E,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},r.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===a?c.splice(u,1):++u}return this},r.prototype.emit=function(s){var a=this._listeners[s];if(a){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,s);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,a),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var E=Math.floor(Math.log(y)/Math.LN2);E===1024&&(E=1023),T=y*Math.pow(2,-E),p(T*4503599627370496>>>0,A,b+g),p((x<<31|E+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,s,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,E=x>>>20&2047,v=4294967296*(x&1048575)+b;return E===2047?v?NaN:T*(1/0):E===0?T*5e-324*v:T*Math.pow(2,E-1075)*(v+4503599627370496)}u.readDoubleLE=d.bind(null,a,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function s(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function a(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return s;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):s},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===a?s:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,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 f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function s(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=s,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&s(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,s,a){var c=a||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=s.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=o}r.length=function(f){for(var d=0,p=0,g=0;g<f.length;++g)p=f.charCodeAt(g),p<128?d+=1:p<2048?d+=2:(p&64512)===55296&&(f.charCodeAt(g+1)&64512)===56320?(++g,d+=4):d+=3;return d};function c(u,f,d,p){var g=d===0&&p===f.length?f:f.subarray(d,p);return u.decode(g)}r.read=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(o,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(o,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(o,f,m,p);g+=String.fromCharCode(y)}return g},r.readStrict=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(s,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(s,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(s,f,m,p);g+=String.fromCharCode(y)}return g},r.write=function(f,d,p){for(var g=p,m,y,A=0;A<f.length;++A)m=f.charCodeAt(A),m<128?d[p++]=m:m<2048?(d[p++]=m>>6|192,d[p++]=m&63|128):(m&64512)===55296&&((y=f.charCodeAt(A+1))&64512)===56320?(m=65536+((m&1023)<<10)+(y&1023),++A,d[p++]=m>>18|240,d[p++]=m>>12&63|128,d[p++]=m>>6&63|128,d[p++]=m&63|128):(d[p++]=m>>12|224,d[p++]=m>>6&63|128,d[p++]=m&63|128);return p-g}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(u.initialBufferSize),this.view=null,this.states=null}u.initialBufferSize=128,Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(E){return new Uint8Array(E)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(E){var v=this.pos+E;if(v>this.buf.length){var S=this.buf.length<<1;S<v&&(S=v);var I=this.constructor.alloc(S);I.set(this.buf.subarray(0,this.pos),0),this.buf=I,this.view=null}};function p(T,E,v){for(var S=0;S<T.length;)E[v++]=T.charCodeAt(S++)}function g(T,E,v){for(;T>127;)E[v++]=T&127|128,T>>>=7;return E[v]=T,v+1}u.prototype.uint32=function(E){E=E>>>0,this._reserve(5);var v=this.pos;return this.pos=g(E,this.buf,v),this},u.prototype.int32=function(E){return(E|=0)<0?(this._reserve(10),m(s.fromNumber(E),this.buf,this.pos),this.pos+=10,this):this.uint32(E)},u.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function m(T,E,v){for(var S=T.lo,I=T.hi;I;)E[v++]=S&127|128,S=(S>>>7|I<<25)>>>0,I>>>=7;for(;S>127;)E[v++]=S&127|128,S=S>>>7;return E[v]=S,v+1}u.prototype.uint64=function(E){var v=s.from(E);this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(E){var v=s.from(E).zzEncode();this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.bool=function(E){return this._reserve(1),this.buf[this.pos++]=E?1:0,this};function y(T,E,v){E[v]=T&255,E[v+1]=T>>>8&255,E[v+2]=T>>>16&255,E[v+3]=T>>>24}u.prototype.fixed32=function(E){return this._reserve(4),y(E>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(E){var v=s.from(E);return this._reserve(8),y(v.lo,this.buf,this.pos),y(v.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(E){return this._reserve(4),r.float.writeFloatLE(E,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(E){return this._reserve(8),r.float.writeDoubleLE(E,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(E)){var S=u.alloc(v=a.length(E));a.decode(E,S,0),E=S}return this.uint32(v),this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this},u.prototype.raw=function(E){var v=E.length>>>0;return v?(this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this):this},u.prototype._delim=function(E,v){var S=d(v);return S>1&&this.buf.copyWithin(E+S,E+1,E+1+v),g(v,this.buf,E),this.pos=E+S+v,this},u.prototype.string=function(E){var v=E.length;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(v<128){this._reserve(v*3+5);var S=this.pos;return this._delim(S,c.write(E,this.buf,S+1))}var I=c.length(E);return this.uint32(I),this._reserve(I),I===E.length?p(E,this.buf,this.pos):c.write(E,this.buf,this.pos),this.pos+=I,this},u.prototype.uint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g(E[O]>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.int32s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O,L=0;L<v;++L)(O=E[L]|0)<0?R=m(s.fromNumber(O),S,R):R=g(O,S,R);return this._delim(I,R-I-1)},u.prototype.sint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g((E[O]<<1^E[O]>>31)>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.uint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]),S,R);return this._delim(I,R-I-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]).zzEncode(),S,R);return this._delim(I,R-I-1)},u.prototype.bools=function(E){var v=E.length;this.uint32(v),this._reserve(v);for(var S=this.buf,I=this.pos,R=0;R<v;++R)S[I++]=E[R]?1:0;return this.pos+=v,this};var A=16,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,b);if(O)for(R=0;R<v;++R)O.setUint32(I,E[R]>>>0,!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)y(E[R]>>>0,L,I),I+=4}return this.pos+=S,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O,L=x(this,v,b);if(L)for(R=0;R<v;++R)O=s.from(E[R]),L.setUint32(I,O.lo,!0),L.setUint32(I+4,O.hi,!0),I+=8;else{var _=this.buf;for(R=0;R<v;++R)O=s.from(E[R]),y(O.lo,_,I),y(O.hi,_,I+4),I+=8}return this.pos+=S,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat32(I,E[R],!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeFloatLE(E[R],L,I),I+=4}return this.pos+=S,this},u.prototype.doubles=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat64(I,E[R],!0),I+=8;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeDoubleLE(E[R],L,I),I+=8}return this.pos+=S,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var E=this.states;return E&&E.length?this.pos=E.pop():this.pos=0,this},u.prototype.ldelim=function(){var E=this.states,v,S;if(E&&E.length){var I=E.pop();v=this.pos-I-1,S=d(v),S>1?(this._reserve(S-1),this.buf.copyWithin(I+S,I+1,I+1+v),this.pos+=S-1,g(v,this.buf,I)):this.buf[I]=v}else v=this.pos,S=d(v),this._reserve(S),this.buf.copyWithin(S,0,v),g(v,this.buf,0),this.pos+=S;return this},u.prototype.finish=function(E){if(E)return this.buf.subarray(0,this.pos);var v=this.constructor.alloc(this.pos);return v.set(this.buf.subarray(0,this.pos),0),v},u.prototype.finishInto=function(E,v){return v===e&&(v=0),E.set(this.buf.subarray(0,this.pos),v),E},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var r=t(15);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(){r.call(this)}var a;s._configure=function(){s.alloc=o.Buffer&&o.Buffer.allocUnsafe,a=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},s.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},s.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):a(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),a(u,this.buf,this.pos),this.pos+=g,this},s._configure()},{12:12,15:15}]},{},[1])})()});var Rve=Yi((Y_i,Dve)=>{"use strict";Dve.exports=Ogt;var ck=1e20;function Ogt(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,y;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");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*s),b=Array(o*s),x=Array(a),T=Array(a),E=Array(a+1),v=Array(a);for(m=0,y=o*s;m<y;m++){var S=c[m];A[m]=S===1?0:S===0?ck:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?ck:S===0?0:Math.pow(Math.max(0,S-.5),2)}Ive(A,o,s,x,T,v,E),Ive(b,o,s,x,T,v,E);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,y=o*s;m<y;m++)I[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return I}function Ive(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Pve(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Pve(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Pve(e,t,n,i,r){n[0]=0,i[0]=-ck,i[1]=+ck;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+ck}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var Bve=Yi((uyi,VG)=>{function jgt(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,E=2,v=3,S=4;function I(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function R(_,C){C===void 0&&(C=0);var w=_.charCodeAt(C);if(55296<=w&&w<=56319&&C<_.length-1){var P=w,M=_.charCodeAt(C+1);return 56320<=M&&M<=57343?(P-55296)*1024+(M-56320)+65536:P}if(56320<=w&&w<=57343&&C>=1){var P=_.charCodeAt(C-1),M=w;return 55296<=P&&P<=56319?(P-55296)*1024+(M-56320)+65536:M}return w}function O(_,C,w){var P=[_].concat(C).concat([w]),M=P[P.length-2],F=w,V=P.lastIndexOf(m);if(V>1&&P.slice(1,V).every(function(k){return k==i})&&[i,g,b].indexOf(_)==-1)return E;var B=P.lastIndexOf(r);if(B>0&&P.slice(1,B).every(function(k){return k==r})&&[p,r].indexOf(M)==-1)return P.filter(function(k){return k==r}).length%2==1?v:S;if(M==e&&F==t)return x;if(M==n||M==e||M==t)return F==m&&C.every(function(k){return k==i})?E:T;if(F==n||F==e||F==t)return T;if(M==s&&(F==s||F==a||F==u||F==f))return x;if((M==u||M==a)&&(F==a||F==c))return x;if((M==f||M==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(M==p)return x;var j=P.indexOf(i)!=-1?P.lastIndexOf(i)-1:P.length-2;return[g,b].indexOf(P[j])!=-1&&P.slice(j+1,-1).every(function(k){return k==i})&&F==m||M==y&&[A,b].indexOf(F)!=-1?x:C.indexOf(r)!=-1?E:M==r&&F==r?x:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var w=L(R(_,C)),P=[],M=C+1;M<_.length;M++)if(!I(_,M-1)){var F=L(R(_,M));if(O(w,P,F))return M;P.push(F)}return _.length},this.splitGraphemes=function(_){for(var C=[],w=0,P;(P=this.nextBreak(_,w))<_.length;)C.push(_.slice(w,P)),w=P;return w<_.length&&C.push(_.slice(w)),C},this.iterateGraphemes=function(_){var C=0,w={next:(function(){var P,M;return(M=this.nextBreak(_,C))<_.length?(P=_.slice(C,M),C=M,{value:P,done:!1}):C<_.length?(P=_.slice(C),C=_.length,{value:P,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var C=0,w=0,P;(P=this.nextBreak(_,w))<_.length;)w=P,C++;return w<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?A:128102<=_&&_<=128105?b:d}return this}typeof VG<"u"&&VG.exports&&(VG.exports=jgt)});var Wne,II,Ue,NE,of,Bo,FPe,LE,BPe,kPe,gr,bc=hs(()=>{Wne=new Date(2107,11,31,23,59,58),II=new Date(1980,0,1),Ue=void 0,NE=1/0,of="undefined",Bo="function",FPe="object",LE="string",BPe="number",kPe="boolean",gr=new Uint8Array});function DI(e){if(e&&typeof e!=Bo)throw new Error(_De);return e}function L5(e){if(e&&(typeof e.addEventListener!=Bo||typeof e.aborted!=kPe))throw new Error(yDe);return e||Ue}function F5(e,t){if(e&&typeof e!=LE||t&&!(t instanceof Uint8Array))throw new Error(Xne)}function Kne(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function RI(e,t,n){e!==Ue&&Kne(e,t,n)}function FE(e){return typeof e==LE&&e.trim()?Number(e):e}var UPe,zPe,VPe,jPe,HPe,C5,v5,S5,w5,GPe,WPe,qPe,YPe,XPe,KPe,$Pe,JPe,I5,P5,D5,R5,ZPe,QPe,eDe,tDe,nDe,iDe,rDe,oDe,sDe,qne,aDe,cDe,J3,PI,lDe,uDe,fDe,dDe,hDe,mDe,Yne,pDe,gDe,O5,M5,pb,N5,X_,_De,yDe,Xne,Z3=hs(()=>{bc();UPe="filenameEncoding",zPe="commentEncoding",VPe="decodeText",jPe="extractPrependedData",HPe="extractAppendedData",C5="password",v5="rawPassword",S5="passThrough",w5="signal",GPe="checkPasswordOnly",WPe="checkOverlappingEntryOnly",qPe="checkOverlappingEntry",YPe="checkAmbiguity",XPe="checkLocalDirectory",KPe="checkSignature",$Pe="checkCrc32",JPe="checkAuthenticationCode",I5="useWebWorkers",P5="useCompressionStream",D5="transferStreams",R5="preventClose",ZPe="encryptionStrength",QPe="extendedTimestamp",eDe="ntfsTimestamp",tDe="keepOrder",nDe="level",iDe="bufferedWrite",rDe="createTempStream",oDe="dataDescriptorSignature",sDe="useUnicodeFileNames",qne="dataDescriptor",aDe="supportZip64SplitFile",cDe="encodeText",J3="offset",PI="usdz",lDe="unixExtraFieldType",uDe="localExtraField",fDe="centralExtraField",dDe="strictness",hDe="filenameValidation",mDe="normalizeFilename",Yne="maxAppendedDataSize",pDe="decryptCentralDirectory",gDe="signCentralDirectory",O5="filename",M5="comment",pb="strict",N5="balanced",X_="tolerant",_De="Invalid option (must be a function)",yDe="Invalid signal (must be an AbortSignal instance)",Xne="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function K_(){return $ne}function Q3(e){return Jne(e.chunkSize)}function Jne(e){return e=FE(e),Number.isInteger(e)&&e>=bDe?Math.max(e,nSt):ADe}function eU(e){Object.assign($ne,wDe(IDe(e)))}function wDe(e){let t={};for(let n of oSt){let i=e[n];i!==Ue&&(t[n]=sSt(n,i))}return t}function sSt(e,t){if(vDe.includes(e)){if(t=FE(t),e==CDe&&(!Number.isInteger(t)||t<bDe))throw new Error(xDe)}else SDe.includes(e)&&DI(t);return t}function IDe(e){e=e||{};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===Ue&&n===Ue)return e;let i=Object.assign({},e);return i.CompressionStreamFallback===Ue&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===Ue&&(i.DecompressionStreamFallback=n),i}function OI(e){let t=wDe(IDe(e));Object.assign(EDe,t),Object.assign($ne,t)}var ADe,nSt,bDe,xDe,TDe,EDe,CDe,iSt,rSt,vDe,SDe,oSt,$ne,C0=hs(()=>{bc();Z3();ADe=64*1024,nSt=64,bDe=1,xDe="Invalid maxWorkers (must be an integer greater than 0)",TDe=2;try{typeof navigator!=of&&navigator.hardwareConcurrency&&(TDe=navigator.hardwareConcurrency)}catch{}EDe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:ADe,maxWorkers:TDe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=of&&CompressionStream,DecompressionStream:typeof DecompressionStream!=of&&DecompressionStream},CDe="maxWorkers",iSt=["baseURI","wasmURI","workerURI"],rSt=["useCompressionStream","useWebWorkers","transferStreams"],vDe=["chunkSize",CDe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],SDe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],oSt=[...iSt,...rSt,...vDe,...SDe],$ne={...EDe}});function Ah(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function B5(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function fi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var BE=hs(()=>{});var tU,PDe,aSt,cSt,lSt,uSt,fSt,dSt,hSt,Jm,nU=hs(()=>{tU=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;tU[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=tU[t-1][e];tU[t][e]=n>>>8^tU[0][n&255]}[PDe,aSt,cSt,lSt,uSt,fSt,dSt,hSt]=tU,Jm=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;r<=s;r+=8){let a=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=hSt[a&255]^dSt[a>>>8&255]^fSt[a>>>16&255]^uSt[a>>>24&255]^lSt[c&255]^cSt[c>>>8&255]^aSt[c>>>16&255]^PDe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^PDe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var iU,DDe=hs(()=>{nU();iU=class extends null{constructor(){let t,n=new Jm;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function MI(e){if(typeof TextEncoder==of){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 Zne=hs(()=>{bc()});var pu,rU,RDe,Qne,eie,gb,ODe=hs(()=>{pu={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=pu.getPartial(n);return i===32?e.concat(t):pu._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+pu.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]=pu.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 r=e.length?e[e.length-1]:0,o=pu.getPartial(r);return i.push(pu.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},rU={bytes:{fromBits(e){let n=pu.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=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(pu.partial(8*(n&3),i)),t}}},RDe={};RDe.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=rU.utf8String.toBits(e));let n=t._buffer=pu.concat(t._buffer,e),i=t._length,r=t._length=i+pu.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.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=pu.concat(t,[pu.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 u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};Qne={};Qne.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],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,A,b,x;for(let T=0;T<i;T++)A=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};eie={};eie.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 r=pu.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return pu.clamp(t,r)}};gb={importKey(e){return new gb.hmacSha1(rU.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=pu;for(t=rU.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};gb.hmacSha1=class{constructor(e){let t=this,n=t._hash=RDe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^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)}}});function k5(e){if(mSt)return crypto.getRandomValues(e);throw new Error(NI)}var mSt,v0,_b,yb,$_,NI,U5=hs(()=>{bc();mSt=typeof crypto!=of&&typeof crypto.getRandomValues==Bo,v0="Invalid password",_b="Invalid signature",yb=_b,$_="zipjs-abort-check-password",NI="Crypto API not supported"});function BDe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:ISt(t,n),strength:i-1,pendingInput:gr})}function kDe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Ah(c,t));let u=t.length-r;n=PSt(n,i+(u-u%LI));let f;for(f=0;f<=u-LI;f+=LI){let d=cU(S0,bh(t,f,f+LI));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(aU(S0,p),f+i)}return e.pendingInput=bh(t,f),n}async function CSt(e,t,n,i){let r=await UDe(e,t,n,bh(i,0,sU[t])),o=bh(i,sU[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(v0)}async function vSt(e,t,n){let i=k5(new Uint8Array(sU[t])),r=await UDe(e,t,n,i);return Ah(i,r)}async function UDe(e,t,n,i){e.password=null;let r=await SSt(pSt,n,ySt,!1,ASt),o=await wSt(Object.assign({salt:i},tie),r,8*(oU[t]*2+2)),s=new Uint8Array(o),a=cU(S0,bh(s,0,oU[t])),c=cU(S0,bh(s,oU[t],oU[t]*2)),u=bh(s,oU[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new TSt(new xSt(a),Array.from(bSt)),hmac:new ESt(c)}),u}async function SSt(e,t,n,i,r){if(MDe)try{return await lU.importKey(e,t,n,i,r)}catch{return MDe=!1,gb.importKey(t)}else return gb.importKey(t)}async function wSt(e,t,n){if(NDe)try{return await lU.deriveBits(e,t,n)}catch{return NDe=!1,gb.pbkdf2(t,e.salt,tie.iterations,n)}else return gb.pbkdf2(t,e.salt,tie.iterations,n)}function ISt(e,t){return t===Ue?MI(e):t}function PSt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function bh(e,t,n){return e.subarray(t,n)}function aU(e,t){return e.fromBits(t)}function cU(e,t){return e.toBits(t)}var LI,pSt,LDe,gSt,_St,ySt,tie,ASt,sU,oU,J_,bSt,j5,lU,FDe,S0,xSt,TSt,ESt,MDe,NDe,z5,V5,zDe=hs(()=>{bc();Zne();BE();ODe();U5();LI=16,pSt="raw",LDe={name:"PBKDF2"},gSt={name:"HMAC"},_St="SHA-1",ySt=Object.assign({hash:gSt},LDe),tie=Object.assign({iterations:1e3,hash:{name:_St}},LDe),ASt=["deriveBits"],sU=[8,12,16],oU=[16,24,32],J_=10,bSt=[0,0,0,0],j5=typeof crypto!=of,lU=j5&&crypto.subtle,FDe=j5&&typeof lU!=of,S0=rU.bytes,xSt=Qne.aes,TSt=eie.ctrGladman,ESt=gb.hmacSha1,MDe=j5&&FDe&&typeof lU.importKey==Bo,NDe=j5&&FDe&&typeof lU.deriveBits==Bo,z5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){BDe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await CSt(c,f,u,bh(s,0,sU[f]+2)),s=bh(s,sU[f]+2),r?a.error(new Error($_)):d()):await p;let g=new Uint8Array(s.length-J_-(s.length-J_)%LI);a.enqueue(kDe(c,s,g,0,J_,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=bh(u,0,u.length-J_),p=bh(u,u.length-J_),g=gr;if(d.length){let A=cU(S0,d);c.update(A);let b=a.update(A);g=aU(S0,b)}let m=bh(aU(S0,c.digest()),0,J_),y=u.length<J_?1:0;for(let A=0;A<J_;A++)y|=m[A]^p[A];if(y&&o)throw new Error(yb);s.enqueue(g)}}})}},V5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){BDe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=gr;a?(d=await vSt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%LI);p.set(d,0),o.enqueue(kDe(s,r,p,d.length,0))},async flush(r){let{ctr:o,hmac:s,pendingInput:a,ready:c}=this;if(s&&o){await c;let u=gr;if(a.length){let d=o.update(cU(S0,a));s.update(d),u=aU(S0,d)}let f=aU(S0,s.digest()).slice(0,J_);r.enqueue(Ah(u,f))}}})}}});function GDe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),DSt(e,t,n)}function VDe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=WDe(e)^t[i],W5(e,n[i]);return n}function jDe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=WDe(e)^t[i],W5(e,t[i]);return n}function DSt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new Jm(i[0]),crcKey2:new Jm(i[2])}),n)for(let r=0;r<n.length;r++)W5(e,n[r]);else for(let r=0;r<t.length;r++)W5(e,t.charCodeAt(r))}function W5(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=HDe(Math.imul(HDe(n+qDe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function WDe(e){let t=e.keys[2]|2;return qDe(Math.imul(t,t^1)>>>8)}function qDe(e){return e&255}function HDe(e){return e&4294967295}var FI,H5,G5,YDe=hs(()=>{nU();U5();FI=12,H5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){GDe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=VDe(a,o.subarray(0,FI));if(a.password=a.rawPassword=null,(c[FI-1]^a.passwordVerification)!=0)throw new Error(v0);o=o.subarray(FI)}r?s.error(new Error($_)):s.enqueue(VDe(a,o))}})}},G5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){GDe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=k5(new Uint8Array(FI));u[FI-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(jDe(s,u),0),c=FI}else a=new Uint8Array(r.length),c=0;a.set(jDe(s,r),c),o.enqueue(a)}})}}});function Zm(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:r}=await t.read();r?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function w0(e,t){e=Zm(e);let n=t?{type:t}:{};if(RSt())return new Response(e).blob().then(r=>t?new Blob([r],n):r);let i=[];return e.pipeTo(new WritableStream({write(r){i.push(r)}})).then(()=>new Blob(i,n))}function RSt(){return typeof Blob.prototype.stream!=Bo||new Blob([]).stream()instanceof ReadableStream}function XDe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var BI=hs(()=>{bc()});function q5(e){return OSt.get(e)}function Y5(e){return nie.get(e)}function MSt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Bo&&typeof i!=Bo)throw new Error(KDe);nie.set(e,{CompressionStream:n,DecompressionStream:i})}async function $De(e,t){!nie.has(e)&&t&&MSt(e,await import(t))}var KDe,OSt,nie,UE=hs(()=>{bc();KDe="Invalid codec module",OSt=new Map,nie=new Map});function BSt(e,t,n){let i=new Jm,r=0,o=!1,s,a,c,u=new Promise((m,y)=>{a=m,c=y});u.catch(()=>{}),n||a();let f=new null({start(m){let y=new Uint8Array(QDe);y.set(LSt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(iie),A=fi(y);A.setUint32(0,i.get(),!0),A.setUint32(4,n,!0),m.enqueue(y)},cancel(m){c(m)}}),d=new null({transform(m,y){i.append(m),r+=m.length,r>=n?a():o&&p(),y.enqueue(m)},cancel(m){c(m)}});return e=Qm(e,f),e=UI(e,t),Qm(e,d);function p(){g(),s=setTimeout(()=>c(new Error(Ab)),FSt)}function g(){clearTimeout(s)}}function oie(e,t){if(!e)return!1;let n=JDe.get(e);n||(n=new Map,JDe.set(e,n));let i=n.get(t);if(i===Ue){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function J5(e){return oie(e,rie)}function sie(e){return oie(e,fU)}function e1e(e,t,n){t=Qm(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function t1e(e,t,n){if(!e)throw new Error(NSt);return new e(t,n)}function n1e(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?ZDe:rie,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return UI(e,a)}function Qm(e,t){return Zm(e).pipeThrough(t)}function UI(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await kSt(n,o),await USt(i,o)}}}async function kSt(e,t){try{await e.abort(t)}catch{}}async function USt(e,t){try{await e.cancel(t)}catch{}}function zSt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(zI);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var Ab,zI,VI,NSt,rie,ZDe,fU,QDe,iie,LSt,FSt,X5,K5,$5,JDe,aie=hs(()=>{nU();DDe();zDe();YDe();U5();bc();BE();BI();UE();Ab="Invalid uncompressed size",zI="Invalid compressed data",VI=_b,NSt="Compression method not supported",rie="deflate-raw",ZDe="deflate64-raw",fU="gzip",QDe=10,iie=8,LSt=[31,139,8],FSt=5e3,X5=class extends null{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:r}){super({});let{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:u,level:f,deflate64:d,format:p,compressionMethod:g,inputSize:m}=t,y=this,A,b,x,T=super.readable,E=p&&Y5(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new iU,T=Qm(T,A)),o)if(E)T=UI(T,t1e(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new K5,T=UI(T,new r(fU)),T=Qm(T,x);else try{T=n1e(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(fU)}catch{throw S}T=UI(T,I),T=Qm(T,new K5)}s&&(c?T=Qm(T,new G5(t)):(b=new V5(t),T=Qm(T,b))),e1e(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},K5=class extends null{constructor(){let t,n=QDe,i=new Uint8Array(0);super({transform(r,o){if(n){let u=Math.min(n,r.length);if(n-=u,r=r.subarray(u),!r.length)return}let s=i.length+r.length;if(s<=iie){i=Ah(i,r);return}let a=s-iie,c=Math.min(a,i.length);o.enqueue(Ah(i.subarray(0,c),r.subarray(0,a-c))),i=Ah(i.subarray(c),r.subarray(a-c))},flush(){let r=fi(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};$5=class extends null{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:s,checkCrc32:a,crc32:c,compressed:u,useCompressionStream:f,deflate64:d,format:p,compressionMethod:g,rawBitFlag:m,outputSize:y}=t,A,b,x=super.readable;if(s&&(o?x=Qm(x,new H5(t)):(b=new z5(t),x=Qm(x,b))),u){let T=p&&Y5(p);if(T)x=UI(x,t1e(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=n1e(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===Ue)throw E;let v;try{v=new r(fU)}catch{throw E}x=BSt(x,v,y)}x=zSt(x)}a&&(A=new iU,x=Qm(x,A)),e1e(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(VI)}})}},JDe=new Map});var VSt,i1e,r1e,o1e,cie,s1e,a1e,jI,Q5,Z5,dU,e9=hs(()=>{bc();aie();VSt=64*1024,i1e="message",r1e="start",o1e="pull",cie="data",s1e="ack",a1e="close",jI="deflate",Q5="inflate",Z5=class extends null{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(jI)?o=X5:r.startsWith(Q5)&&(o=$5),i.outputSize=0;let s=0,a=new o(t,n),c=super.readable,u=new null({transform(d,p){d&&d.length&&(s+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:s})}}),f=new null({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==Ue&&i.outputSize>t.outputSize))throw new Error(Ab)},flush(){let{crc32:d}=a;Object.assign(i,{crc32:d,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},dU=class extends null{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=VSt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(r())},flush(s){i&&s.enqueue(o(n,i))}});function r(){let s=new Uint8Array(t),a=0;for(;a<t;){let c=n[0],u=t-a;c.length<=u?(s.set(c,a),a+=c.length,n.shift()):(s.set(c.subarray(0,u),a),n[0]=c.subarray(u),a+=u)}return i-=t,s}function o(s,a){let c=new Uint8Array(a),u=0;for(let f of s)c.set(f,u),u+=f.length;return c}}}});function l1e({initModule:e}){n9=e}function u1e(e){uie=e}async function f1e(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||J5(t)||sie(t))return!0;if(n)try{return await n9(e),!0}catch{return!1}return!1}function die(e){e.createWorker?c1e=!0:t9=!1}async function lie(e,...t){try{await e(...t)}catch{}}function hie(e,t){return{run:()=>i9(e,t)}}async function i9({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(jI),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!J5(d))try{await n9(r)}catch{}}else try{await n9(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new Z5(e,r),await t.pipeThrough(o).pipeThrough(new dU(Q3(r))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=o;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw o&&(s.outputSize=o.outputSize),s}finally{i()}}var VE,t9,c1e,uie,n9,zE,fie,hU=hs(()=>{bc();C0();e9();VE="Worker startup timeout",n9=()=>{};zE=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:f},d){let{signal:p}=s;return c1e&&(f=Ue),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new dU(Q3(o))).pipeThrough(new fie(s),{signal:p}),writable:i,options:Object.assign({},r),workerURI:u,createWorker:f,transferStreams:c,terminate(){return new Promise(g=>{let{worker:m,busy:y}=t;m?(y?t.resolveTerminated=g:(m.terminate(),g()),t.interface=null):g()})},onTaskFinished(){if(t.busy){let{resolveTerminated:g}=t;g&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),g()),t.busy=!1,d(t)}}}),t9===Ue&&(t9=typeof Worker!=of),(a&&uie&&(t9&&u||f)?uie:hie)(t,o)}},fie=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await lie(t,i)},async transform(s,a){o+=s.length,n&&await lie(n,o,i),a.enqueue(s)},async flush(){r&&await lie(r,o)}})}}});async function a9(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:u,encrypted:f,format:d,codecURI:p}=n,{workerURI:g,createWorker:m,maxWorkers:y}=i;d&&(p&&(n.codecURI=XSt(p,i.baseURI)),await $De(d,n.codecURI)),t.transferStreams=!d&&(r||r===Ue&&i.transferStreams);let A=!a&&!c&&!u&&!f,b=d===Ue||!!n.codecURI;return t.useWebWorkers=!A&&b&&(o||o===Ue&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&g?g:Ue,t.createWorker=t.useWebWorkers&&m?m:Ue,n.useCompressionStream=s||s===Ue&&i.useCompressionStream,(await x()).run();async function x(){let E=jE.find(v=>!v.busy);if(E)return A1e(E),new zE(E,e,t,T);if(jE.length<y){let v={indexWorker:y1e};return y1e++,jE.push(v),new zE(v,e,t,T)}else return new Promise(v=>{HI.push({resolve:v,stream:e,workerOptions:t}),o9=i.workerStarvationTimeout,s9()})}function T(E){if(b1e(),HI.length){let[{resolve:v,stream:S,workerOptions:I}]=HI.splice(0,1);v(new zE(E,S,I,T)),s9()}else E.worker?(A1e(E),JSt(E,t)):jE=jE.filter(v=>v!=E)}}function XSt(e,t){try{return new URL(e,t).toString()}catch{return e}}function s9(){!GI&&HI.length&&Number.isFinite(o9)&&o9>=0&&(GI=setTimeout(KSt,o9))}function b1e(){GI&&(clearTimeout(GI),GI=null)}function KSt(){if(GI=null,HI.length){let[{resolve:e,stream:t,workerOptions:n}]=HI.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:Ue,createWorker:Ue});e(new zE({},t,i,$St)),s9()}}function $St(){b1e(),s9()}function JSt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{jE=jE.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function A1e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var jE,HI,GI,o9,y1e,c9=hs(()=>{bc();e9();UE();hU();jE=[],HI=[],y1e=0});function T1e(e){if(ZSt){let t="";for(let n=0;n<e.length;n++)t+=x1e[e[n]];return t}else return new TextDecoder().decode(e)}var x1e,ZSt,E1e=hs(()=>{x1e="\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\xA0".split(""),ZSt=x1e.length==256});function mU(e,t){return v1e(e,t,!0)}function C1e(e,t){return v1e(e,t,!1)}function v1e(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?T1e(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var Aie=hs(()=>{E1e()});function ewt(){P1e=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();bie=n==1}catch{bie=!1}})()}function d9(e){return!!(e&&e.getData)}async function jc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function twt(e){return e=new Z_(e),await jc(e),(e.size===Ue||!e.readUint8Array)&&(e=new sf(await w0(e.readable)),await jc(e)),e}function Uo(e,t,n){return e.readUint8Array(t,n)}function Tie(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?qI.prototype.createReadable.call(e,t):e.readable}var w1e,I1e,QSt,nji,iji,xie,S1e,WI,qI,l9,pU,bie,P1e,sf,YI,gU,_U,u9,f9,Z_,XI,h9=hs(()=>{bc();C0();BE();BI();Aie();w1e="Writer iterator completed too soon",I1e="Writer not initialized",QSt="text/plain",nji=256*1024,iji=16*1024*1024,xie="writable",S1e=Symbol(),WI=class{constructor(){this.size=0}init(){this.initialized=!0}},qI=class extends WI{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=Q3(K_())}={}){let r=this,o=0;return i=Jne(i),new ReadableStream({async pull(s){let a=n===Ue?i:Math.min(i,n-o),c=await Uo(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},l9=class extends WI{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(I1e);return t.writeUint8Array(B5(i))}});Object.defineProperty(t,xie,{get(){return n}})}writeUint8Array(){}},pU=class extends l9{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,r=n.pendingCharacters,o=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pendingCharacters+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pendingCharacters=r+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};sf=class extends qI{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),P1e||ewt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?Zm(i.stream()):bie?Zm(i.slice(o,o+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,r=t+n,a=await(!t&&r>=i.size?i.sourceBlob:i.sourceBlob.slice(t,r)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},YI=class extends WI{constructor(t){super();let n=this,i=new null;Object.defineProperty(n,xie,{get(){return i.writable}}),n.contentType=t,n.blobPromise=w0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},gU=class extends sf{constructor(t){super(new Blob([t],{type:QSt}))}},_U=class extends YI{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():C1e(new Uint8Array(await i.arrayBuffer()),t)}},u9=class extends qI{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(twt));t.diskOffsets=n.map(i=>{let r=t.size;return t.size+=i.size,r}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,r=n[t];return r===Ue?i:r}async readUint8Array(t,n){let i=this,{readers:r}=this,o,s=0,a=t;for(;r[s]&&a>=r[s].size;)a-=r[s].size,s++;let c=r[s];if(c){let u=c.size;if(a+n<=u)o=await Uo(c,a,n);else{let f=u-a,d=await Uo(c,a,f),p=await i.readUint8Array(t+f,n-f);o=Ah(d,p)}}else o=gr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},f9=class extends WI{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,s,a=new WritableStream({async write(d){if(d===S1e){s&&await u();return}let{availableSize:p}=i;if(s)d.length>=p?(await c(d.subarray(0,p)),await u(),d.length>p&&await this.write(d.subarray(p))):await c(d);else{let{value:g,done:m}=await t.next();if(m&&!g)throw new Error(w1e);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await jc(r),o=g.writable,s=o.getWriter(),await this.write(d)}},async close(){s&&(await s.ready,await f())},async abort(d){s&&await s.abort(d)}});Object.defineProperty(i,xie,{get(){return a}});async function c(d){let p=d.length;p&&(await s.ready,await s.write(d),r.size+=p,i.availableSize-=p)}async function u(){await f(),i.diskOffset+=r.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function f(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(S1e)}finally{t.releaseLock()}}},Z_=class{constructor(t){return Array.isArray(t)&&(t=new u9(t)),(t instanceof ReadableStream||typeof t.getReader==Bo)&&(t={readable:Zm(t)}),t}},XI=class{constructor(t){return t.writable===Ue&&typeof t.next==Bo&&(t=new f9(t)),(t instanceof WritableStream||typeof t.getWriter==Bo)&&(t={writable:XDe(t)}),t.size===Ue&&(t.size=0),t}}});var Eie,Cie,yU,vie,AU,Sie,wie,Iie,KI,$I,bU,Pie,xU,Die,Rie,Oie,m9,p9,Mie,Nie,Lie,g9,Fie,Bie,kie,Uie,HE,zie,nwt,Vie,_9,iwt,y9,rwt,owt,swt,awt,jie,Hie,Gie,Wie,cwt,lwt,uwt,fwt,dwt,hwt,mwt,pwt,gwt,_wt,ywt,Awt,bwt,xwt,Twt,Ewt,bb,qie=hs(()=>{Eie="filename",Cie="rawFilename",yU="comment",vie="rawComment",AU="uncompressedSize",Sie="compressedSize",wie="offset",Iie="diskNumberStart",KI="lastModDate",$I="rawLastModDate",bU="lastAccessDate",Pie="rawLastAccessDate",xU="creationDate",Die="rawCreationDate",Rie="internalFileAttributes",Oie="externalFileAttributes",m9="internalFileAttribute",p9="externalFileAttribute",Mie="msdosAttributesRaw",Nie="msdosAttributes",Lie="msDosCompatible",g9="zip64",Fie="encrypted",Bie="version",kie="versionMadeBy",Uie="zipCrypto",HE="directory",zie="executable",nwt="symlink",Vie="compressionMethod",_9="signature",iwt="crc32",y9="extraField",rwt="extraFieldInfoZip",owt="extraFieldUnix",swt="extraFieldUnixType1",awt="extraFieldPkwareUnix",jie="unixMode",Hie="setuid",Gie="setgid",Wie="sticky",cwt="bitFlag",lwt="rawBitFlag",uwt="filenameLength",fwt="extraFieldLength",dwt="unixExternalUpper",hwt="filenameUTF8",mwt="commentUTF8",pwt="rawExtraField",gwt="extraFieldZip64",_wt="extraFieldUnicodePath",ywt="extraFieldUnicodeComment",Awt="extraFieldAES",bwt="extraFieldNTFS",xwt="extraFieldExtendedTimestamp",Twt="extraFieldUSDZ",Ewt=[Eie,Cie,AU,Sie,KI,$I,yU,vie,bU,Pie,xU,Die,wie,Iie,Rie,Oie,m9,p9,Mie,Nie,Lie,g9,Fie,Bie,kie,Uie,HE,zie,nwt,Vie,_9,iwt,y9,owt,rwt,swt,awt,"uid","gid",jie,dwt,Hie,Gie,Wie,cwt,lwt,uwt,fwt,hwt,mwt,pwt,gwt,_wt,ywt,Awt,bwt,xwt,Twt],bb=class{constructor(t){Ewt.forEach(n=>this[n]=t[n])}}});var iRe={};vq(iRe,{ERR_AMBIGUOUS_ARCHIVE:()=>bre,ERR_BAD_FORMAT:()=>JI,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>mre,ERR_ENCRYPTED:()=>_re,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>xre,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>Are,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>hre,ERR_EOCDR_NOT_FOUND:()=>dre,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>gre,ERR_INVALID_AUTHENTICATION_CODE:()=>yb,ERR_INVALID_COMPRESSED_DATA:()=>zI,ERR_INVALID_CRC32:()=>VI,ERR_INVALID_FILENAME_VALIDATION:()=>Cre,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>vre,ERR_INVALID_PASSWORD:()=>v0,ERR_INVALID_SIGNATURE:()=>_b,ERR_INVALID_STRICTNESS:()=>Ere,ERR_INVALID_UNCOMPRESSED_SIZE:()=>Ab,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>pre,ERR_OVERLAPPING_ENTRY:()=>yre,ERR_SPLIT_ZIP_FILE:()=>E9,ERR_UNSAFE_FILENAME:()=>Tre,ERR_UNSUPPORTED_COMPRESSION:()=>T9,ERR_UNSUPPORTED_ENCRYPTION:()=>x9,ERR_UNSUPPORTED_UINT64:()=>Sre,ERR_WORKER_STARTUP_TIMEOUT:()=>VE,WARNING_APPENDED_DATA:()=>v9,WARNING_COMPRESSED_PATCHED_DATA:()=>Pre,WARNING_DUPLICATE_FILENAME:()=>Mre,WARNING_MALFORMED_EXTRA_FIELD:()=>k9,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Nre,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Lre,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Fre,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>ZI,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Rre,WARNING_PREPENDED_DATA:()=>S9,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Ore,WARNING_UNKNOWN_VERSION:()=>Ire,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Dre,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>wre,WARNING_WRAPPED_ENTRIES_COUNT:()=>C9,ZipReader:()=>YE,ZipReaderStream:()=>I9,isZipFile:()=>X1e});async function X1e(e,t={}){if(e=new Z_(e),await jc(e),(e.size===Ue||!e.readUint8Array)&&(e=new sf(await w0(e.readable)),await jc(e)),e.size<22)return!1;let n=kre(t,{}),i=n!=X_,r=Q1e(t[Yne],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await eRe(e,i,r);if(!o||n==pb&&s>1)return!1;let a=_r(fi(o),20),c=o.offset+22+a;return e.size-c<=r}function Yie(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(Ri(e,n)==134630224)return!0;return!1}function k1e(e,t,n){let i=0;for(;n+46<=t.length&&Ri(e,n)==33639248;)n+=46+_r(e,n+28)+_r(e,n+30)+_r(e,n+32),i++;return i%65536?0:i}function Xie(e){if(e.length>=6){let t=fi(e);if(Ri(t,0)==84233040){let n=_r(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function Bwt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function kwt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=fi(e),i=_r(n,26);Object.assign(t,{compressionMethod:_r(n,0),compressedSize:ad(n,2),uncompressedSize:ad(n,10),encryptionAlgorithm:_r(n,18),bitLength:_r(n,20),flags:_r(n,22),hashAlgorithm:_r(n,24),hashData:e.subarray(28,28+i)})}return t}function K1e(e,t,n){let i=e.rawBitFlag=_r(t,n+2),r=(i&1)==1,o=Ri(t,n+6);Object.assign(e,{encrypted:r,version:_r(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:Qwt(o),filenameLength:_r(t,n+22),extraFieldLength:_r(t,n+24)})}function $1e(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=fi(o),c=0,u=!1;try{for(;c<o.length;){let S=_r(a,c),I=_r(a,c+2);s.set(S,{type:S,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{u=!0}c>o.length&&(u=!0);let f=_r(n,i+4);Object.assign(t,{signature:Ri(n,i+10),crc32:Ri(n,i+10),compressedSize:Ri(n,i+14),uncompressedSize:Ri(n,i+18)});let d=s.get(1);d&&(Uwt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(U1e(p,Eie,Cie,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(U1e(g,yU,vie,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(zwt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(z1e(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(z1e(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(Vwt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=V1e(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(V1e(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(jwt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function Uwt(e,t){t.zip64=!0;let n=fi(e.data),i=Mwt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+F1e[s].bytes,0);if(e.data.length<r)throw new Error(gre);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=F1e[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function U1e(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=fi(e.data),s=new Jm;s.append(r[n]);let a=fi(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ri(o,1),u=Tb(o,0);Object.assign(e,{version:u,[t]:mU(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Ri(a,0)}),e.valid&&(i[t]=e[t],i[t+Owt]=!0)}function zwt(e,t,n){let i=fi(e.data),r=Tb(i,4);Object.assign(e,{vendorVersion:Tb(i,0),vendorId:Tb(i,2),strength:r,originalCompressionMethod:n,compressionMethod:_r(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=Y1e&&(t.crc32=Ue)}function Vwt(e,t){let n=fi(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=_r(n,i),s=_r(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}if(r&&r.length==24){let o=fi(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=Kie(s),f=Kie(a),d=Kie(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function z1e(e,t){if(e.data.length<8)return;let n=fi(e.data),i=new Date((Ri(n,0)|0)*1e3),r=new Date((Ri(n,4)|0)*1e3),o={lastAccessDate:i,lastModDate:r};e.data.length>=12&&(o.uid=_r(n,8),o.gid=_r(n,10)),Object.assign(e,o),Object.assign(t,o)}function V1e(e,t,n){try{let i=fi(e.data),r,o;if(n){let s=0,a=Tb(i,s++),c=Tb(i,s++);r=j1e(e.data.subarray(s,s+c)),s+=c;let u=Tb(i,s++);o=j1e(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=_r(i,0),o=_r(i,2),Object.assign(e,{uid:r,gid:o}));return r!==Ue&&(t.uid=r),o!==Ue&&(t.gid=o),r!==Ue||o!==Ue}catch{}}function j1e(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function jwt(e,t,n){if(!e.data.length)return;let i=fi(e.data),r=Tb(i,0),o=[],s=[];n?((r&1)==1&&(o.push(KI),s.push($I)),(r&2)==2&&(o.push(bU),s.push(Pie)),(r&4)==4&&(o.push(xU),s.push(Die))):e.data.length>=5&&(o.push(KI),s.push($I));let a=1;o.forEach((c,u)=>{if(e.data.length>=a+4){let f=Ri(i,a);t[c]=e[c]=new Date((f|0)*1e3);let d=s[u];e[d]=f}a+=4})}async function Hwt({reader:e,fileEntry:t,index:n,offset:i,crc32:r,compressedSize:o,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(c&&(u?d=20:d=12),d){let g=await Uo(e,a+o,d+4),m=fi(g),y=g.length==d+4&&Ri(m,0)==134695760;if(y){let A=H1e(m,4,u);(t.encrypted&&!t.zipCrypto||A.crc32==r)&&A.compressedSize==o&&A.uncompressedSize==s?d+=4:y=!1}if(g.length>=d){let A=H1e(m,y?4:0,u);A.signature=y,t.localDirectory.dataDescriptor=A}}let p={start:i,end:a+o+d,fileEntry:t};for(let[g,m]of f)if(g!=n&&p.start<m.end&&m.start<p.end){let y=new Error(yre);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function H1e(e,t,n){let i=Ri(e,t),r,o;return n?(r=ad(e,t+4),o=ad(e,t+12)):(r=Ri(e,t+4),o=Ri(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function QI(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function Gwt(e){return await J1e(e)==134695760}async function Wwt(e){let t=await J1e(e);return t==134695760||t==808471376}async function J1e(e){let t=await Uo(e,0,4);return Ri(fi(t))}function Z1e(e){return e===pb||e===N5||e===X_}function qwt(e,t,n){return Math.min(e,n?t*Fwt:t)}function kre(e,t){return G1e(e,G1e(t,N5))}function G1e(e,t){let n=e[dDe];if(n!==Ue){if(!Z1e(n))throw new Error(Ere);return n}let i=e[YPe];return i===Ue?t:i?pb:t==X_?X_:N5}function Ywt(e,t){return e===Ue?t!=X_:!!e}function Xwt(e,t){return e===Ue?t==pb:!!e}function Kwt(e,t){if(e===Ue)return t;if(!Z1e(e))throw new Error(Cre);return e}function $wt(e,t){if(t==X_)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||Rwt.test(e)?!0:t==pb&&(n.includes(".")||n.includes(""))}function Q1e(e,t){if(e!==Ue){let n=FE(e);if(typeof n!=BPe||Number.isNaN(n)||n<0)throw new Error(vre);return n}return t==pb?0:t==X_?1/0:65535}async function eRe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:Lwt},s,a,c=0;for await(let[u,f,d,p,g]of tRe(e,r)){let m=_r(u,p+20);if(g+22+m==i){let y=await nRe(e,u,f,p,g,i,o);if(y==w9){if(s||(s=Jie(d,p,g)),c++,!t||c>1)break}else y==Bre&&!a&&(a=Jie(d,p,g))}}return s||(s=a),s||(s=await Jwt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function Jwt(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,s;for await(let[a,c,u,f,d]of tRe(e,r)){let p=Jie(u,f,d);o||(o=p);let g=await nRe(e,a,c,f,d,i,n);if(g==w9)return p;g==Bre&&!s&&(s=p)}return s||o}async function*tRe(e,t){let n=e.size-t,i=await Uo(e,n,t),r=fi(i);for(let o=i.length-22;o>=0;o--)Ri(r,o)==101010256&&(yield[r,n,i,o,n+o])}function Jie(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function nRe(e,t,n,i,r,o,s){let a=_r(t,i+10),c=Ri(t,i+12),u=Ri(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await W1e(e,t,n,r-20,o,s)==117853008?w9:B1e;if(!a&&!c)return Bre;let f=_r(t,i+6);for(let d of[r-c,QI(e,f)+u])if(await W1e(e,t,n,d,o,s)==33639248)return w9;return B1e}async function W1e(e,t,n,i,r,o){if(i<0||i+4>r)return Ue;if(i>=n)return Ri(t,i-n);if(o.count>0){o.count--;let s=await Uo(e,i,4);return Ri(fi(s),0)}return Ue}function Zwt(e,t,n,i,r){let{rawFilename:o}=e,s=!r,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=o.length||n.some((c,u)=>c!=o[u]))&&D0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&L1e)!=(e.rawBitFlag&L1e)&&D0(s,r,Nre),t.compressionMethod!=e.compressionMethod&&D0(s,r,Lre),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&D0(s,r,Fre)}function D0(e,t,n){e?A9(n):xh(t,n)}function xh(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==Ue&&(i.filename=n),e.push(i)}}function A9(e){let t=new Error(bre);throw t.reason=e,t}function Ns(e,t,n){return t[n]===Ue?e.options[n]:t[n]}function q1e(e,t,n){return DI(Ns(e,t,n))}function Qwt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return i<II?II:i}function Kie(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Tb(e,t){return e.getUint8(t)}function _r(e,t){return e.getUint16(t,!0)}function Ri(e,t){return e.getUint32(t,!0)}function ad(e,t){let n=e.getBigUint64(t,!0);if(n>Nwt)throw new Error(Sre);return Number(n)}var JI,dre,hre,mre,pre,gre,_re,x9,T9,E9,yre,Are,bre,xre,Tre,Ere,Cre,vre,Sre,wre,Ire,Pre,k9,Dre,C9,v9,S9,Rre,Ore,Mre,ZI,Nre,Lre,Fre,Dwt,Rwt,M1e,Owt,N1e,L1e,Y1e,Mwt,F1e,Nwt,Lwt,Fwt,B1e,Bre,w9,YE,I9,$ie,Ure=hs(()=>{bc();C0();UE();c9();h9();Aie();BE();BI();nU();qie();Z3();JI="File format is not recognized",dre="End of central directory not found",hre="End of Zip64 central directory locator not found",mre="Central directory header not found",pre="Local file header not found",gre="Zip64 extra field not found",_re="File contains encrypted entry",x9="Encryption method not supported",T9="Compression method not supported",E9="Split zip file",yre="Overlapping entry found",Are="Entry data out of bounds",bre="Ambiguous archive",xre="Encrypted central directory is not supported",Tre="Unsafe filename",Ere="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Cre="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",vre="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Sre="64-bit value exceeds Number.MAX_SAFE_INTEGER",wre="unsorted central directory",Ire="unknown version needed to extract",Pre="compressed patched data",k9="malformed extra field",Dre="unknown zip64 extensible data",C9="wrapped entries count",v9="appended data",S9="prepended data",Rre="prepended central directory",Ore="trailing central directory data",Mre="duplicate filename",ZI="mismatched zip64 end of central directory record",Nre="mismatched local file header (general purpose bit flag)",Lre="mismatched local file header (compression method)",Fre="mismatched local file header (crc32 or sizes)",Dwt=63,Rwt=/^[a-zA-Z]:/,M1e="utf-8",Owt="UTF8",N1e="cp437",L1e=2057,Y1e=1,Mwt=[[AU,4294967295],[Sie,4294967295],[wie,4294967295],[Iie,65535]],F1e={65535:{getValue:Ri,bytes:4},4294967295:{getValue:ad,bytes:8}},Nwt=BigInt(Number.MAX_SAFE_INTEGER),Lwt=64,Fwt=1032,B1e=0,Bre=1,w9=2,YE=class{constructor(t,n={}){Object.assign(this,{reader:new Z_(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await jc(i),(i.size===Ue||!i.readUint8Array)&&(i=new sf(await w0(i.readable)),await jc(i)),i.size<22)throw new Error(JI);let r=n.warnings=[],o=kre(t,n.options),s=o==pb,a=o!=X_,c=Q1e(Ns(n,t,Yne),o),u=Kwt(Ns(n,t,hDe),o),f=Ns(n,t,mDe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await eRe(i,a,c);if(!d)throw await Gwt(i)?new Error(E9):new Error(dre);a&&p>1&&A9("multiple end of central directory records");let g=fi(d),m=Ri(g,12),y=Ri(g,16),A=d.offset,b=_r(g,20),x=A+22+b,T=i.size-x;T>c&&A9(v9),T>0&&xh(r,v9);let E=_r(g,4),v=i.lastDiskNumber||0,S=_r(g,6),I=_r(g,10),R=0,O,L,_,C,w=56,P,M=y==4294967295||m==4294967295||I==65535||S==65535;if(y!=4294967295&&S!=65535&&(y+=QI(i,S)),M){let He=d.offset>=20?await Uo(i,d.offset-20,20):gr,Xe=fi(He);if(He.length==20&&Ri(Xe,0)==117853008){y=QI(i,Ri(Xe,4))+ad(Xe,8);let $e=await Uo(i,y,56),Pe=fi($e),qe=d.offset-20-56;if(($e.length<56||Ri(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),$e=await Uo(i,y,56),Pe=fi($e)}if($e.length<56||Ri(Pe,0)!=101075792)throw new Error(hre);if(_=!0,C=ad(Pe,4)>44,C){let st=Math.min(ad(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Uo(i,y+56,st);P=kwt(vt)}}E==65535?E=Ri(Pe,16):E!=Ri(Pe,16)&&D0(s,r,ZI),S==65535?S=Ri(Pe,20):S!=Ri(Pe,20)&&D0(s,r,ZI),I==65535?I=ad(Pe,32):I!=ad(Pe,32)&&D0(s,r,ZI),m==4294967295?m=ad(Pe,40):m!=ad(Pe,40)&&D0(s,r,ZI),y=QI(i,S)+ad(Pe,48)+R}}let F=m,V=d.offset-(_?w+20:0);if(y>=i.size&&(R=i.size-y-m-22,y=i.size-m-22),v!=E)throw new Error(E9);if(y<0)throw new Error(JI);let B=0,j=await Uo(i,y,m),k=fi(j);if(m){if(j.length<4)throw new Error(JI);let He=V-m;if(y!=He&&S==E){let Xe=Ri(k,B)==33639248||!!(P&&P.compressedSize)||Yie(k),$e=!Xe;if(!$e&&He>=0&&He+4<=i.size){let Pe=await Uo(i,He,4);$e=Ri(fi(Pe),0)==33639248}if($e){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Xe),j=await Uo(i,y,m),k=fi(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Uo(i,y,m),k=fi(j)),y<0||y>=i.size)throw new Error(JI);n.directoryOffset=y,n.directoryLength=F;let q=q1e(n,t,pDe),Q,W;if(q&&I&&j.length>=4&&Ri(k,0)!=33639248&&(C||Yie(k))){let He=Bwt(P,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),P),k=fi(j),F=j.length,Q=!0}P&&!Q&&(j.length<4||Ri(k,0)==33639248)&&xh(r,Dre),L=y;let J=Ns(n,t,UPe),Z=Ns(n,t,zPe),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=k1e(k,j,B),I&&xh(r,C9));for(let He=0;He<I;He++){let Xe=new $ie(i,n.options);if(B+46>j.length||Ri(k,B)!=33639248)throw He==0&&!Q&&(C||Yie(k))?new Error(xre):new Error(mre);K1e(Xe,k,B+6);let $e=!!Xe.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Xe.filenameLength,st=qe+Xe.extraFieldLength,vt=_r(k,B+4),Gt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=_r(k,B+32),Xt=st+ft,rt=j.subarray(st,Xt),ht=$e,Bi=$e,Xn=Ri(k,B+38),Ai=Xn&255,Wi={readOnly:!!(Ai&1),hidden:!!(Ai&2),system:!!(Ai&4),directory:!!(Ai&16),archive:!!(Ai&32)},wi=Ri(k,B+42),di=q1e(n,t,VPe)||mU,bi=ht?M1e:J||N1e,jn=Bi?M1e:Z||N1e,nn=di(mt,bi,O5);if(nn===Ue&&(nn=mU(mt,bi)),f){let ki=f(nn);ki!==Ue&&(nn=ki)}if($wt(nn,u)){let ki=new Error(Tre);throw ki.filename=nn,ki}let Wn=di(rt,jn,M5);Wn===Ue&&(Wn=mU(rt,jn)),Object.assign(Xe,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:Gt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:wi,diskNumberStart:_r(k,B+34),internalFileAttributes:_r(k,B+36),externalFileAttributes:Xn,msdosAttributesRaw:Ai,msdosAttributes:Wi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Bi,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:nn,comment:Wn}),$1e(Xe,Xe,k,B+6)&&xh(r,k9,nn),Xe.offset+=R;let Zi=QI(i,Xe.diskNumberStart)+Xe.offset;L=Math.min(Zi,L),Zi<fe&&xh(r,wre,nn),fe=Zi,(Xe.version&255)>Dwt&&xh(r,Ire,nn),(Xe.rawBitFlag&32)==32&&xh(r,Pre,nn),ae.has(Xe.filename)&&(Ae=!0),ae.add(Xe.filename);let Mr=Xe.externalFileAttributes>>16&65535;Xe.unixMode===Ue&&(Mr&16877)!=0&&(Xe.unixMode=Mr);let fo=!!(Xe.unixMode&2048),Bs=!!(Xe.unixMode&1024),Ks=!!(Xe.unixMode&512),mi=((Xe.unixMode===Ue?Mr:Xe.unixMode)&61440)==40960,ho=!mi&&(Xe.unixMode!==Ue?(Xe.unixMode&73)!=0:lt&&(Mr&73)!=0),ur=Xe.unixMode!==Ue&&(Xe.unixMode&61440)==16384,Zo=(Mr&61440)==16384;Object.assign(Xe,{setuid:fo,setgid:Bs,sticky:Ks,symlink:mi,unixExternalUpper:Mr,internalFileAttribute:Xe.internalFileAttributes,externalFileAttribute:Xe.externalFileAttributes,executable:ho,directory:ur||Zo||Gt&&Wi.directory||Xe.filename.endsWith("/"),zipCrypto:Xe.encrypted&&!Xe.extraFieldAES});let Bn=new bb(Xe);if(Bn.getData=(ki,Nr)=>Xe.getData(ki,Bn,n.readRanges,Nr),Bn.arrayBuffer=async ki=>{let Nr=new null,Wc=w0(Nr.readable).then(xd=>xd.arrayBuffer());return Wc.catch(()=>{}),await Xe.getData(Nr,Bn,n.readRanges,ki),Wc},B=Xt,He==I-1&&xe){let ki=k1e(k,j,B);ki&&(I+=ki,xh(r,C9))}let{onprogress:qi}=t;if(qi)try{await qi(He+1,I,new bb(Xe))}catch{}yield Bn}let ge=B,we=Xie(j.subarray(B))||(Q?Xie(W):Ue);if(!we&&!Q){let He=y+B,Xe=Math.min(V-He,65541);Xe>=6&&(we=Xie(await Uo(i,He,Xe)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&D0(s,r,Ore),Ae&&D0(s,r,Mre);let Se=Ns(n,t,jPe),Re=Ns(n,t,HPe),Qe=(s||Se)&&I&&L==4&&await Wwt(i)?4:0;return s&&(R||I&&L>Qe)&&A9(S9),(R||I&&L>4)&&xh(r,S9),O&&xh(r,Rre),Se&&(n.prependedData=L>Qe?await Uo(i,Qe,L-Qe):gr),n.comment=b?await Uo(i,A+22,b):gr,Re&&(n.appendedData=x<i.size?await Uo(i,x,i.size-x):gr),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){let{reader:t}=this;!t.readUint8Array&&t.readable&&!t.readable.locked&&await t.readable.cancel()}},I9=class{constructor(t={}){let{readable:n,writable:i}=new null,r=new YE(n,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(o){let{done:s,value:a}=await r.next();if(s)return o.close();let c={...a,readable:(function(){let{readable:u,writable:f}=new null;if(a.getData)return d(),u;async function d(){try{await a.getData(f)}catch(p){try{await f.abort(p)}catch{}}}})()};delete c.getData,o.enqueue(c)}}),this.writable=i}};$ie=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=K_(),{reader:a,index:c,offset:u,diskNumberStart:f,extraFieldAES:d,extraFieldZip64:p,compressionMethod:g,bitFlag:m,rawBitFlag:y,crc32:A,rawLastModDate:b,uncompressedSize:x,compressedSize:T}=o,{dataDescriptor:E}=m,v=n.localDirectory={},S=n.warnings=[],I=QI(a,f)+u,R=await Uo(a,I,30),O=fi(R),L=Ns(o,r,C5),_=Ns(o,r,v5),C=Ns(o,r,S5);if(F5(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(T9);if(R.length<30||Ri(O,0)!=67324752)throw new Error(pre);K1e(v,O,4);let{extraFieldLength:w,filenameLength:P}=v,M=v.dataOffset=I+30+P+w,F=Ns(o,r,XPe),V=kre(r,o.options),B=Ywt(F,V),j=Xwt(F,V),k=gr;if(j&&(P||w)){let ft=await Uo(a,I+30,P+w);k=ft.subarray(0,P),v.rawExtraField=ft.subarray(P)}else v.rawExtraField=w?await Uo(a,I+30+P,w):gr;j&&(v.rawFilename=k),$1e(o,v,O,4,!0)&&xh(S,k9),Zwt(o,v,k,j,B?Ue:S);let{lastAccessDate:G,creationDate:q,uid:Q,gid:W}=v;G&&(n.lastAccessDate=G),q&&(n.creationDate=q),Q!==Ue&&n.uid===Ue&&(n.uid=Q),W!==Ue&&n.gid===Ue&&(n.gid=W);let J=o.encrypted&&v.encrypted&&!C,Z=J&&!d;if(C||(n.zipCrypto=Z),J&&(v.rawBitFlag&64)==64)throw new Error(x9);let ae=C?Ue:q5(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(T9);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(x9);if(!L&&!_)throw new Error(_re)}if(M+T>a.size)throw new Error(Are);let Ae=T,fe=Zm(a.createReadable({offset:M,size:Ae})),xe=L5(Ns(o,r,w5)),ge=Ns(o,r,GPe),we=Ns(o,r,qPe),Se=Ns(o,r,WPe);Se&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Xe=g!=0&&!C,$e=C?T:x,Pe=g==9,qe=Ns(o,r,P5);Pe&&(qe=!1);let st=Ns(o,r,$Pe),vt=(st===Ue?Ns(o,r,KPe):st)&&!C&&(!J||Z||d&&d.vendorVersion==Y1e),Gt={options:{codecType:Q5,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:Ns(o,r,JPe),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:$e,crc32:A,compressed:Xe,encrypted:J,useWebWorkers:Ns(o,r,I5),useCompressionStream:qe,transferStreams:Ns(o,r,D5),deflate64:Pe,format:ae?ae.format:Ue,codecURI:ae?ae.codecURI:Ue,compressionMethod:g,rawBitFlag:y,checkPasswordOnly:ge},config:s,streamOptions:{signal:xe,size:Ae,onstart:Re,onprogress:Qe,onend:He}};we&&await Hwt({reader:a,fileEntry:n,index:c,offset:I,crc32:A,compressedSize:T,uncompressedSize:x,dataOffset:M,dataDescriptor:E||v.bitFlag.dataDescriptor,extraFieldZip64:p||v.extraFieldZip64,readRanges:i});let lt,mt;try{if(!Se){ge&&(t=new WritableStream),t=new XI(t),await jc(t,qwt($e,T,Xe)),{writable:lt}=t;let{outputSize:ft}=await a9({readable:fe,writable:lt},Gt);if(t.size+=ft,ft!=$e)throw new Error(Ab)}}catch(ft){if(ft.outputSize!==Ue&&(t.size+=ft.outputSize),!ge||ft.message!=$_)throw mt=ft,ft}finally{if(!(!d9(t)&&Ns(o,r,R5))&<&&!lt.locked){let Xt=lt.getWriter();if(mt)try{await Xt.abort(mt)}catch{}else await Xt.close()}}return ge||Se?Ue:t.getData?t.getData():lt}}});var mOe=Yi((J9,hOe)=>{(function(e,t){typeof J9=="object"&&typeof hOe<"u"?t(J9):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(J9,function(e){"use strict";function t(T){return T}function n(T){if(T==null)return t;var E,v,S=T.scale[0],I=T.scale[1],R=T.translate[0],O=T.translate[1];return function(L,_){_||(E=v=0);var C=2,w=L.length,P=new Array(w);for(P[0]=(E+=L[0])*S+R,P[1]=(v+=L[1])*I+O;C<w;)P[C]=L[C],++C;return P}}function i(T){var E=n(T.transform),v,S=1/0,I=S,R=-S,O=-S;function L(C){C=E(C),C[0]<S&&(S=C[0]),C[0]>R&&(R=C[0]),C[1]<I&&(I=C[1]),C[1]>O&&(O=C[1])}function _(C){switch(C.type){case"GeometryCollection":C.geometries.forEach(_);break;case"Point":L(C.coordinates);break;case"MultiPoint":C.coordinates.forEach(L);break}}T.arcs.forEach(function(C){for(var w=-1,P=C.length,M;++w<P;)M=E(C[w],w),M[0]<S&&(S=M[0]),M[0]>R&&(R=M[0]),M[1]<I&&(I=M[1]),M[1]>O&&(O=M[1])});for(v in T.objects)_(T.objects[v]);return[S,I,R,O]}function r(T,E){for(var v,S=T.length,I=S-E;I<--S;)v=T[I],T[I++]=T[S],T[S]=v}function o(T,E){return typeof E=="string"&&(E=T.objects[E]),E.type==="GeometryCollection"?{type:"FeatureCollection",features:E.geometries.map(function(v){return s(T,v)})}:s(T,E)}function s(T,E){var v=E.id,S=E.bbox,I=E.properties==null?{}:E.properties,R=a(T,E);return v==null&&S==null?{type:"Feature",properties:I,geometry:R}:S==null?{type:"Feature",id:v,properties:I,geometry:R}:{type:"Feature",id:v,bbox:S,properties:I,geometry:R}}function a(T,E){var v=n(T.transform),S=T.arcs;function I(w,P){P.length&&P.pop();for(var M=S[w<0?~w:w],F=0,V=M.length;F<V;++F)P.push(v(M[F],F));w<0&&r(P,V)}function R(w){return v(w)}function O(w){for(var P=[],M=0,F=w.length;M<F;++M)I(w[M],P);return P.length<2&&P.push(P[0]),P}function L(w){for(var P=O(w);P.length<4;)P.push(P[0]);return P}function _(w){return w.map(L)}function C(w){var P=w.type,M;switch(P){case"GeometryCollection":return{type:P,geometries:w.geometries.map(C)};case"Point":M=R(w.coordinates);break;case"MultiPoint":M=w.coordinates.map(R);break;case"LineString":M=O(w.arcs);break;case"MultiLineString":M=w.arcs.map(O);break;case"Polygon":M=_(w.arcs);break;case"MultiPolygon":M=w.arcs.map(_);break;default:return null}return{type:P,coordinates:M}}return C(E)}function c(T,E){var v={},S={},I={},R=[],O=-1;E.forEach(function(C,w){var P=T.arcs[C<0?~C:C],M;P.length<3&&!P[1][0]&&!P[1][1]&&(M=E[++O],E[O]=C,E[w]=M)}),E.forEach(function(C){var w=L(C),P=w[0],M=w[1],F,V;if(F=I[P])if(delete I[F.end],F.push(C),F.end=M,V=S[M]){delete S[V.start];var B=V===F?F:F.concat(V);S[B.start=F.start]=I[B.end=V.end]=B}else S[F.start]=I[F.end]=F;else if(F=S[M])if(delete S[F.start],F.unshift(C),F.start=P,V=I[P]){delete I[V.end];var j=V===F?F:V.concat(F);S[j.start=V.start]=I[j.end=F.end]=j}else S[F.start]=I[F.end]=F;else F=[C],S[F.start=P]=I[F.end=M]=F});function L(C){var w=T.arcs[C<0?~C:C],P=w[0],M;return T.transform?(M=[0,0],w.forEach(function(F){M[0]+=F[0],M[1]+=F[1]})):M=w[w.length-1],C<0?[M,P]:[P,M]}function _(C,w){for(var P in C){var M=C[P];delete w[M.start],delete M.start,delete M.end,M.forEach(function(F){v[F<0?~F:F]=1}),R.push(M)}}return _(I,S),_(S,I),E.forEach(function(C){v[C<0?~C:C]||R.push([C])}),R}function u(T){return a(T,f.apply(this,arguments))}function f(T,E,v){var S,I,R;if(arguments.length>1)S=d(T,E,v);else for(I=0,S=new Array(R=T.arcs.length);I<R;++I)S[I]=I;return{type:"MultiLineString",arcs:c(T,S)}}function d(T,E,v){var S=[],I=[],R;function O(P){var M=P<0?~P:P;(I[M]||(I[M]=[])).push({i:P,g:R})}function L(P){P.forEach(O)}function _(P){P.forEach(L)}function C(P){P.forEach(_)}function w(P){switch(R=P,P.type){case"GeometryCollection":P.geometries.forEach(w);break;case"LineString":L(P.arcs);break;case"MultiLineString":case"Polygon":_(P.arcs);break;case"MultiPolygon":C(P.arcs);break}}return w(E),I.forEach(v==null?function(P){S.push(P[0].i)}:function(P){v(P[0].g,P[P.length-1].g)&&S.push(P[0].i)}),S}function p(T){for(var E=-1,v=T.length,S,I=T[v-1],R=0;++E<v;)S=I,I=T[E],R+=S[0]*I[1]-S[1]*I[0];return Math.abs(R)}function g(T){return a(T,m.apply(this,arguments))}function m(T,E){var v={},S=[],I=[];E.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":O(_.arcs);break;case"MultiPolygon":_.arcs.forEach(O);break}}function O(_){_.forEach(function(C){C.forEach(function(w){(v[w=w<0?~w:w]||(v[w]=[])).push(_)})}),S.push(_)}function L(_){return p(a(T,{type:"Polygon",arcs:[_]}).coordinates[0])}return S.forEach(function(_){if(!_._){var C=[],w=[_];for(_._=1,I.push(C);_=w.pop();)C.push(_),_.forEach(function(P){P.forEach(function(M){v[M<0?~M:M].forEach(function(F){F._||(F._=1,w.push(F))})})})}}),S.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:I.map(function(_){var C=[],w;if(_.forEach(function(B){B.forEach(function(j){j.forEach(function(k){v[k<0?~k:k].length<2&&C.push(k)})})}),C=c(T,C),(w=C.length)>1)for(var P=1,M=L(C[0]),F,V;P<w;++P)(F=L(C[P]))>M&&(V=C[0],C[0]=C[P],C[P]=V,M=F);return C}).filter(function(_){return _.length>0})}}function y(T,E){for(var v=0,S=T.length;v<S;){var I=v+S>>>1;T[I]<E?v=I+1:S=I}return v}function A(T){var E={},v=T.map(function(){return[]});function S(B,j){B.forEach(function(k){k<0&&(k=~k);var G=E[k];G?G.push(j):E[k]=[j]})}function I(B,j){B.forEach(function(k){S(k,j)})}function R(B,j){B.type==="GeometryCollection"?B.geometries.forEach(function(k){R(k,j)}):B.type in O&&O[B.type](B.arcs,j)}var O={LineString:S,MultiLineString:I,Polygon:I,MultiPolygon:function(B,j){B.forEach(function(k){I(k,j)})}};T.forEach(R);for(var L in E)for(var _=E[L],C=_.length,w=0;w<C;++w)for(var P=w+1;P<C;++P){var M=_[w],F=_[P],V;(V=v[M])[L=y(V,F)]!==F&&V.splice(L,0,F),(V=v[F])[L=y(V,M)]!==M&&V.splice(L,0,M)}return v}function b(T){if(T==null)return t;var E,v,S=T.scale[0],I=T.scale[1],R=T.translate[0],O=T.translate[1];return function(L,_){_||(E=v=0);var C=2,w=L.length,P=new Array(w),M=Math.round((L[0]-R)/S),F=Math.round((L[1]-O)/I);for(P[0]=M-E,E=M,P[1]=F-v,v=F;C<w;)P[C]=L[C],++C;return P}}function x(T,E){if(T.transform)throw new Error("already quantized");if(!E||!E.scale){if(!((O=Math.floor(E))>=2))throw new Error("n must be \u22652");_=T.bbox||i(T);var v=_[0],S=_[1],I=_[2],R=_[3],O;E={scale:[I-v?(I-v)/(O-1):1,R-S?(R-S)/(O-1):1],translate:[v,S]}}else _=T.bbox;var L=b(E),_,C,w=T.objects,P={};function M(B){return L(B)}function F(B){var j;switch(B.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:B.geometries.map(F)};break;case"Point":j={type:"Point",coordinates:M(B.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:B.coordinates.map(M)};break;default:return B}return B.id!=null&&(j.id=B.id),B.bbox!=null&&(j.bbox=B.bbox),B.properties!=null&&(j.properties=B.properties),j}function V(B){var j=0,k=1,G=B.length,q,Q=new Array(G);for(Q[0]=L(B[0],0);++j<G;)((q=L(B[j],j))[0]||q[1])&&(Q[k++]=q);return k===1&&(Q[k++]=[0,0]),Q.length=k,Q}for(C in w)P[C]=F(w[C]);return{type:"Topology",bbox:_,transform:E,objects:P,arcs:T.arcs.map(V)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=A,e.quantize=x,e.transform=n,e.untransform=b,Object.defineProperty(e,"__esModule",{value:!0})})});var np={};vq(np,{__addDisposableResource:()=>rMe,__assign:()=>e7,__asyncDelegator:()=>$Oe,__asyncGenerator:()=>KOe,__asyncValues:()=>JOe,__await:()=>cP,__awaiter:()=>HOe,__classPrivateFieldGet:()=>tMe,__classPrivateFieldIn:()=>iMe,__classPrivateFieldSet:()=>nMe,__createBinding:()=>n7,__decorate:()=>FOe,__disposeResources:()=>oMe,__esDecorate:()=>kOe,__exportStar:()=>WOe,__extends:()=>NOe,__generator:()=>GOe,__importDefault:()=>eMe,__importStar:()=>QOe,__makeTemplateObject:()=>ZOe,__metadata:()=>jOe,__param:()=>BOe,__propKey:()=>zOe,__read:()=>goe,__rest:()=>LOe,__rewriteRelativeImportExtension:()=>sMe,__runInitializers:()=>UOe,__setFunctionName:()=>VOe,__spread:()=>qOe,__spreadArray:()=>XOe,__spreadArrays:()=>YOe,__values:()=>t7,default:()=>yPt});function NOe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");moe(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function LOe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function FOe(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function BOe(e,t){return function(n,i){t(n,i,e)}}function kOe(e,t,n,i,r,o){function s(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(b||null))};var A=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],m);if(a==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(d=s(A.get))&&(f.get=d),(d=s(A.set))&&(f.set=d),(d=s(A.init))&&r.unshift(d)}else(d=s(A))&&(a==="field"?r.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function UOe(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0}function zOe(e){return typeof e=="symbol"?e:"".concat(e)}function VOe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function jOe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function HOe(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?o(f.value):r(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function GOe(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function WOe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&n7(t,e,n)}function t7(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function goe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function qOe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(goe(arguments[t]));return e}function YOe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function XOe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function cP(e){return this instanceof cP?(this.v=e,this):new cP(e)}function KOe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(g){return function(m){return Promise.resolve(m).then(g,d)}}function a(g,m){i[g]&&(r[g]=function(y){return new Promise(function(A,b){o.push([g,y,A,b])>1||c(g,y)})},m&&(r[g]=m(r[g])))}function c(g,m){try{u(i[g](m))}catch(y){p(o[0][3],y)}}function u(g){g.value instanceof cP?Promise.resolve(g.value.v).then(f,d):p(o[0][2],g)}function f(g){c("next",g)}function d(g){c("throw",g)}function p(g,m){g(m),o.shift(),o.length&&c(o[0][0],o[0][1])}}function $Oe(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,o){t[r]=e[r]?function(s){return(n=!n)?{value:cP(e[r](s)),done:!1}:o?o(s):s}:o}}function JOe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof t7=="function"?t7(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}function ZOe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function QOe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=poe(e),i=0;i<n.length;i++)n[i]!=="default"&&n7(t,e,n[i]);return gPt(t,e),t}function eMe(e){return e&&e.__esModule?e:{default:e}}function tMe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function nMe(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function iMe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function rMe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function oMe(e){function t(o){e.error=e.hasError?new _Pt(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var n,i=0;function r(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(r,function(s){return t(s),r()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return r()}function sMe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,r,o,s){return i?t?".jsx":".js":r&&(!o||!s)?n:r+o+"."+s.toLowerCase()+"js"}):e}var moe,e7,n7,gPt,poe,_Pt,yPt,ip=hs(()=>{moe=function(e,t){return moe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},moe(e,t)};e7=function(){return e7=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e7.apply(this,arguments)};n7=Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]});gPt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},poe=function(e){return poe=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},poe(e)};_Pt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};yPt={__extends:NOe,__assign:e7,__rest:LOe,__decorate:FOe,__param:BOe,__esDecorate:kOe,__runInitializers:UOe,__propKey:zOe,__setFunctionName:VOe,__metadata:jOe,__awaiter:HOe,__generator:GOe,__createBinding:n7,__exportStar:WOe,__values:t7,__read:goe,__spread:qOe,__spreadArrays:YOe,__spreadArray:XOe,__await:cP,__asyncGenerator:KOe,__asyncDelegator:$Oe,__asyncValues:JOe,__makeTemplateObject:ZOe,__importStar:QOe,__importDefault:eMe,__classPrivateFieldGet:tMe,__classPrivateFieldSet:nMe,__classPrivateFieldIn:iMe,__addDisposableResource:rMe,__disposeResources:oMe,__rewriteRelativeImportExtension:sMe}});var aMe=Yi(i7=>{"use strict";Object.defineProperty(i7,"__esModule",{value:!0});i7.version=void 0;i7.version="4.1.5"});var Sb=Yi(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});vb.hasOwnProperty=void 0;vb.isBoolean=APt;vb.ellipsis=bPt;vb.removeWithPredicate=xPt;vb.assertNever=TPt;vb.hasOwnProperty=Object.prototype.hasOwnProperty;function APt(e){return typeof e=="boolean"}function bPt(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function xPt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function TPt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var r7=Yi(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.HtmlTag=M0.whitespaceRe=void 0;var EPt=Sb();M0.whitespaceRe=/\s+/;var CPt=(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},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(M0.whitespaceRe):[],r=t.split(M0.whitespaceRe),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(M0.whitespaceRe):[],r=t.split(M0.whitespaceRe),o;i.length&&(o=r.shift());){var s=i.indexOf(o);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(){var t=this.getAttrs(),n=[];for(var i in t)EPt.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();M0.HtmlTag=CPt});var lMe=Yi(yoe=>{"use strict";Object.defineProperty(yoe,"__esModule",{value:!0});yoe.truncateSmart=vPt;function vPt(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,s=SPt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=cMe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=cMe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=o)return s.host.length===t?(s.host.substr(0,t-r)+n).substr(0,o+i):_oe(c,o,n).substr(0,o+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+_oe(u,f,n)).substr(0,o+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+_oe(d,p,n)).substr(0,o+i)}else c+=d}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function SPt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function cMe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function _oe(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}});var uMe=Yi(Aoe=>{"use strict";Object.defineProperty(Aoe,"__esModule",{value:!0});Aoe.truncateMiddle=wPt;function wPt(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}});var fMe=Yi(boe=>{"use strict";Object.defineProperty(boe,"__esModule",{value:!0});boe.truncateEnd=PPt;var IPt=Sb();function PPt(e,t,n){return(0,IPt.ellipsis)(e,t,n)}});var xoe=Yi(o7=>{"use strict";Object.defineProperty(o7,"__esModule",{value:!0});o7.AnchorTagBuilder=void 0;var DPt=r7(),RPt=lMe(),OPt=uMe(),MPt=fMe(),NPt=(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 DPt.HtmlTag({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.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],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);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.length)return t;var i=n.length,r=n.location;return r==="smart"?(0,RPt.truncateSmart)(t,i):r==="middle"?(0,OPt.truncateMiddle)(t,i):(0,MPt.truncateEnd)(t,i)},e})();o7.AnchorTagBuilder=NPt});var tC=Yi(s7=>{"use strict";Object.defineProperty(s7,"__esModule",{value:!0});s7.AbstractMatch=void 0;var LPt=(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})();s7.AbstractMatch=LPt});var nC=Yi(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.isControlChar=FPt;ud.isAsciiLetterChar=BPt;ud.isDigitChar=kPt;ud.isQuoteChar=UPt;ud.isWhitespaceChar=zPt;ud.isAlphaNumericOrMarkChar=VPt;ud.isValidEmailLocalPartSpecialChar=jPt;ud.isUrlSuffixAllowedSpecialChar=HPt;ud.isUrlSuffixNotAllowedAsFinalChar=GPt;ud.isOpenBraceChar=WPt;ud.isCloseBraceChar=qPt;function FPt(e){return e>=0&&e<=31||e==127}function BPt(e){return e>=65&&e<=90||e>=97&&e<=122}function kPt(e){return e>=48&&e<=57}function UPt(e){return e==34||e==39}function zPt(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function VPt(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function jPt(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function HPt(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function GPt(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function WPt(e){return e<91?e==40:e==91||e==123}function qPt(e){return e<93?e==41:e==93||e==125}});var dMe=Yi(a7=>{"use strict";Object.defineProperty(a7,"__esModule",{value:!0});a7.tldRegex=void 0;a7.tldRegex=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|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|சிங்கப்பூர்|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|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|موريتانيا|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|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|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|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|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|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|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|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|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|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|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|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/});var c7=Yi(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.isDomainLabelStartChar=eo.isSchemeStartChar=eo.tldUrlHostRe=eo.schemeUrlRe=eo.invalidSchemeRe=eo.httpSchemePrefixRe=eo.httpSchemeRe=void 0;eo.isSchemeChar=XPt;eo.isDomainLabelChar=KPt;eo.isPathChar=$Pt;eo.isUrlSuffixStartChar=JPt;eo.isKnownTld=hMe;eo.isValidSchemeUrl=ZPt;eo.isValidTldMatch=QPt;eo.isValidIpV4Address=nDt;var iC=nC(),YPt=dMe();eo.httpSchemeRe=/https?:\/\//i;eo.httpSchemePrefixRe=new RegExp("^"+eo.httpSchemeRe.source,"i");eo.invalidSchemeRe=/^(javascript|vbscript):/i;eo.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;eo.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;eo.isSchemeStartChar=iC.isAsciiLetterChar;function XPt(e){return(0,iC.isAsciiLetterChar)(e)||(0,iC.isDigitChar)(e)||e===43||e===45||e===46}eo.isDomainLabelStartChar=iC.isAlphaNumericOrMarkChar;function KPt(e){return e===95||(0,eo.isDomainLabelStartChar)(e)}function $Pt(e){return(0,iC.isAlphaNumericOrMarkChar)(e)||(0,iC.isUrlSuffixAllowedSpecialChar)(e)||(0,iC.isUrlSuffixNotAllowedAsFinalChar)(e)}function JPt(e){return e===47||e===63||e===35}function hMe(e){return YPt.tldRegex.test(e.toLowerCase())}function ZPt(e){if(eo.invalidSchemeRe.test(e))return!1;var t=e.match(eo.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function QPt(e){var t=e.match(eo.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!hMe(r)}var eDt=/^(?:(?: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]?)$/,tDt=/[:/?#]/;function nDt(e){var t=e.split(tDt,1)[0];return eDt.test(t)}});var Toe=Yi(l7=>{"use strict";Object.defineProperty(l7,"__esModule",{value:!0});l7.UrlMatch=void 0;var iDt=(ip(),Fh(np)),rDt=tC(),oDt=c7(),sDt=/^(https?:\/\/)?(?:www\.)?/i,aDt=/^\/\//,cDt=(function(e){iDt.__extends(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=fDt(n)),this.stripPrefix.scheme&&(n=lDt(n)),this.stripPrefix.www&&(n=uDt(n)),this.stripTrailingSlash&&(n=dDt(n)),this.decodePercentEncoding&&(n=hDt(n)),n},t})(rDt.AbstractMatch);l7.UrlMatch=cDt;function lDt(e){return e.replace(oDt.httpSchemePrefixRe,"")}function uDt(e){return e.includes("www.")?e.replace(sDt,"$1"):e}function fDt(e){return e.replace(aDt,"")}function dDt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function hDt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}});var pMe=Yi(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.isEmailLocalPartStartChar=iy.mailtoSchemePrefixRe=void 0;iy.isEmailLocalPartChar=pDt;iy.isValidEmail=gDt;var mMe=nC(),mDt=c7();iy.mailtoSchemePrefixRe=/^mailto:/i;iy.isEmailLocalPartStartChar=mMe.isAlphaNumericOrMarkChar;function pDt(e){return(0,iy.isEmailLocalPartStartChar)(e)||(0,mMe.isValidEmailLocalPartSpecialChar)(e)}function gDt(e){var t=e.split(".").pop();return(0,mDt.isKnownTld)(t)}});var Eoe=Yi(u7=>{"use strict";Object.defineProperty(u7,"__esModule",{value:!0});u7.EmailMatch=void 0;var _Dt=(ip(),Fh(np)),yDt=tC(),ADt=(function(e){_Dt.__extends(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})(yDt.AbstractMatch);u7.EmailMatch=ADt});var Coe=Yi(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:!0});lP.hashtagServices=void 0;lP.isHashtagTextChar=xDt;lP.isValidHashtag=TDt;var bDt=nC();function xDt(e){return e===95||(0,bDt.isAlphaNumericOrMarkChar)(e)}function TDt(e){return e.length<=140}lP.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var voe=Yi(f7=>{"use strict";Object.defineProperty(f7,"__esModule",{value:!0});f7.HashtagMatch=void 0;var EDt=(ip(),Fh(np)),CDt=Sb(),vDt=tC(),SDt=(function(e){EDt.__extends(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:(0,CDt.assertNever)(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})(vDt.AbstractMatch);f7.HashtagMatch=SDt});var Soe=Yi(uP=>{"use strict";Object.defineProperty(uP,"__esModule",{value:!0});uP.mentionServices=void 0;uP.isMentionTextChar=IDt;uP.isValidMention=PDt;var gMe=nC(),wDt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function IDt(e){return e===45||e===46||e===95||(0,gMe.isAsciiLetterChar)(e)||(0,gMe.isDigitChar)(e)}function PDt(e,t){var n=wDt[t];return n.test(e)}uP.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var woe=Yi(d7=>{"use strict";Object.defineProperty(d7,"__esModule",{value:!0});d7.MentionMatch=void 0;var DDt=(ip(),Fh(np)),RDt=Sb(),ODt=tC(),MDt=(function(e){DDt.__extends(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:(0,RDt.assertNever)(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})(ODt.AbstractMatch);d7.MentionMatch=MDt});var _Me=Yi(BU=>{"use strict";Object.defineProperty(BU,"__esModule",{value:!0});BU.isPhoneNumberSeparatorChar=kDt;BU.isPhoneNumberControlChar=UDt;BU.isValidPhoneNumber=zDt;var NDt=/[-. ()]/,LDt=/(?:(?:(?:(\+)?\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]+#?)*/,FDt=/(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})/,BDt=new RegExp("^".concat(LDt.source,"|").concat(FDt.source,"$"));function kDt(e){return e===45||e===46||e===32}function UDt(e){return e===44||e===59}function zDt(e){var t=e.charAt(0)==="+"||NDt.test(e);return t&&BDt.test(e)}});var Ioe=Yi(h7=>{"use strict";Object.defineProperty(h7,"__esModule",{value:!0});h7.PhoneMatch=void 0;var VDt=(ip(),Fh(np)),jDt=tC(),HDt=(function(e){VDt.__extends(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})(jDt.AbstractMatch);h7.PhoneMatch=HDt});var Moe=Yi(_7=>{"use strict";Object.defineProperty(_7,"__esModule",{value:!0});_7.parseMatches=$Dt;_7.excludeUnbalancedTrailingBracesAndPunctuation=bMe;var GDt=Toe(),m7=Sb(),zo=c7(),fP=pMe(),WDt=Eoe(),Roe=Coe(),qDt=voe(),Ooe=Soe(),YDt=woe(),dP=_Me(),XDt=Ioe(),ua=nC(),KDt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),AMe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),AMe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function $Dt(e,t){for(var n=new KDt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)p7(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:n1t(n,s,r);break;case 12:i1t(n,s,r);break;case 0:JDt(n,s,r);break;case 1:ZDt(n,s,r);break;case 2:QDt(n,s,r);break;case 3:e1t(n,s,r);break;case 4:t1t(n,s,i,r);break;case 5:r1t(n,s,r);break;case 6:o1t(n,s,i,r);break;case 7:s1t(n,s,i,r);break;case 13:a1t(n,s,r);break;case 14:c1t(n,s,r);break;case 8:l1t(n,s,r);break;case 9:u1t(n,s,r);break;case 10:f1t(n,s,r);break;case 15:d1t(n,s,i,r);break;case 16:h1t(n,s,i,r);break;case 17:m1t(n,s,i,r);break;case 18:p1t(n,s,i,r);break;case 19:g1t(n,s,i,r);break;case 20:_1t(n,s,r);break;case 21:y1t(n,s,r);break;case 22:rC(n,s,r);break;case 23:A1t(n,s,r);break;case 24:b1t(n,s,r);break;case 25:x1t(n,s,r);break;case 26:T1t(n,s,r);break;case 27:E1t(n,s,r);break;case 28:C1t(n,s,r);break;case 29:v1t(n,s,r);break;case 30:S1t(n,s,r);break;case 31:w1t(n,s,r);break;case 32:P1t(n,s,i,r);break;case 33:D1t(n,s,r);break;case 34:R1t(n,s,r);break;case 35:O1t(n,s,r);break;case 36:M1t(n,s,i,r);break;case 37:I1t(n,s,i,r);break;case 38:N1t(n,s,i,r);break;case 39:L1t(n,s,i,r);break;case 40:F1t(n,s,r);break;case 41:B1t(n,s,r);break;default:(0,m7.assertNever)(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,zo.isSchemeStartChar)(r)){var a=n.text.charCodeAt(n.charIdx-1);(0,zo.isSchemeStartChar)(a)||n.addMachine(g7(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Fs(n,u)});return n.matches}function p7(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(V1t(i,28));else if(n===64)e.addMachine(j1t(i,30));else if(n===47)e.addMachine(Doe(i,11));else if(n===43)e.addMachine(Poe(i,37));else if(n===40)e.addMachine(Poe(i,32));else{if((0,ua.isDigitChar)(n)&&(e.addMachine(Poe(i,38)),e.addMachine(U1t(i,13))),(0,fP.isEmailLocalPartStartChar)(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(z1t(i,r))}(0,zo.isSchemeStartChar)(n)&&e.addMachine(g7(i,0)),(0,ua.isAlphaNumericOrMarkChar)(n)&&e.addMachine(Doe(i,5))}}function JDt(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,zo.isSchemeChar)(n)||e.removeMachine(t)}function ZDt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Doe(i,11))):(0,zo.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function QDt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,zo.isDomainLabelStartChar)(n)?(t.state=5,(0,zo.isSchemeStartChar)(n)&&e.addMachine(g7(i,0))):e.removeMachine(t)}function e1t(e,t,n){n===47?t.state=4:(0,zo.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):Fs(e,t)}function t1t(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function n1t(e,t,n){n===47?t.state=12:e.removeMachine(t)}function i1t(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function r1t(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,zo.isDomainLabelChar)(n)||Fs(e,t)}function o1t(e,t,n,i){i===45||(i===46?Fs(e,t):(0,zo.isDomainLabelStartChar)(i)?t.state=5:Fs(e,t))}function s1t(e,t,n,i){i===46?Fs(e,t):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):Fs(e,t)}function a1t(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,ua.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,ua.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Fs(e,t))}function c1t(e,t,n){(0,ua.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Fs(e,t)}function l1t(e,t,n){(0,ua.isDigitChar)(n)?t.state=9:Fs(e,t)}function u1t(e,t,n){(0,ua.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:Fs(e,t))}function f1t(e,t,n){(0,zo.isPathChar)(n)||Fs(e,t)}function d1t(e,t,n,i){n.toLowerCase()==="a"?t.state=16:rC(e,t,i)}function h1t(e,t,n,i){n.toLowerCase()==="i"?t.state=17:rC(e,t,i)}function m1t(e,t,n,i){n.toLowerCase()==="l"?t.state=18:rC(e,t,i)}function p1t(e,t,n,i){n.toLowerCase()==="t"?t.state=19:rC(e,t,i)}function g1t(e,t,n,i){n.toLowerCase()==="o"?t.state=20:rC(e,t,i)}function _1t(e,t,n){n===58?t.state=21:rC(e,t,n)}function y1t(e,t,n){(0,fP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function rC(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,fP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function A1t(e,t,n){n===46||n===64?e.removeMachine(t):(0,fP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function b1t(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function x1t(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,zo.isDomainLabelChar)(n)||Fs(e,t)}function T1t(e,t,n){n===45||n===46?Fs(e,t):(0,zo.isDomainLabelChar)(n)?t.state=25:Fs(e,t)}function E1t(e,t,n){n===46||n===45?Fs(e,t):(0,zo.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):Fs(e,t)}function C1t(e,t,n){(0,Roe.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function v1t(e,t,n){(0,Roe.isHashtagTextChar)(n)||Fs(e,t)}function S1t(e,t,n){(0,Ooe.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function w1t(e,t,n){(0,Ooe.isMentionTextChar)(n)||((0,ua.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Fs(e,t))}function I1t(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=38:(e.removeMachine(t),p7(e,n,i))}function P1t(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=33:e.removeMachine(t),p7(e,n,i)}function D1t(e,t,n){(0,ua.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function R1t(e,t,n){(0,ua.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function O1t(e,t,n){n===41?t.state=36:e.removeMachine(t)}function M1t(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=38:(0,dP.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function N1t(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,(0,dP.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,ua.isDigitChar)(i)||(i===40?t.state=32:(0,dP.isPhoneNumberSeparatorChar)(i)?t.state=39:(Fs(e,t),(0,zo.isSchemeStartChar)(i)&&e.addMachine(g7(r,0))))}function L1t(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=38:i===40?t.state=32:(Fs(e,t),p7(e,n,i))}function F1t(e,t,n){(0,dP.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,ua.isDigitChar)(n)?t.state=38:Fs(e,t))}function B1t(e,t,n){(0,dP.isPhoneNumberControlChar)(n)?t.state=40:(0,ua.isDigitChar)(n)?e.removeMachine(t):Fs(e,t)}function Fs(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=bMe(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=zo.httpSchemeRe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!(0,zo.isValidSchemeUrl)(p))return;break}case 1:{if(!(0,zo.isValidTldMatch)(p))return;break}case 2:{if(!(0,zo.isValidIpV4Address)(p))return;break}default:(0,m7.assertNever)(t)}n.push(new GDt.UrlMatch({tagBuilder:o,matchedText:p,offset:d,urlMatchType:k1t(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,fP.isValidEmail)(p)&&n.push(new WDt.EmailMatch({tagBuilder:o,matchedText:p,offset:d,email:p.replace(fP.mailtoSchemePrefixRe,"")}));break}case 2:{(0,Roe.isValidHashtag)(p)&&n.push(new qDt.HashtagMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,Ooe.isValidMention)(p,f)&&n.push(new YDt.MentionMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,dP.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new XDt.PhoneMatch({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,m7.assertNever)(t)}}}function k1t(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,m7.assertNever)(e)}}var yMe={")":"(","}":"{","]":"["};function bMe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);(0,ua.isOpenBraceChar)(r)?t[i]++:(0,ua.isCloseBraceChar)(r)&&t[yMe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if((0,ua.isCloseBraceChar)(r)){var s=yMe[i];if(t[s]<0)t[s]++,o--;else break}else if((0,ua.isUrlSuffixNotAllowedAsFinalChar)(r))o--;else break}return e.slice(0,o+1)}function g7(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Doe(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function U1t(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function z1t(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function V1t(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function j1t(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Poe(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function AMe(e){return e.type===0&&e.matchType===0}});var xMe=Yi(Foe=>{"use strict";Object.defineProperty(Foe,"__esModule",{value:!0});Foe.parseHtml=W1t;var vl=(ip(),Fh(np)),_u=nC(),H1t=Sb(),N0=(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})(),Loe=new N0,G1t=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Loe,this.html=t,this.callbacks=n}return e})();function W1t(e,t){for(var n=new G1t(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:q1t(n,r);break;case 1:Y1t(n,r,o);break;case 2:K1t(n,r,o);break;case 3:X1t(n,r,o);break;case 4:$1t(n,r,o);break;case 5:J1t(n,r,o);break;case 6:Z1t(n,r,o);break;case 7:Q1t(n,r,o);break;case 8:eRt(n,r);break;case 9:tRt(n,r);break;case 10:nRt(n,r,o);break;case 11:iRt(n,r,o);break;case 12:rRt(n,r);break;case 13:oRt(n);break;case 14:sRt(n,r);break;case 15:aRt(n,r);break;case 16:cRt(n,r);break;case 17:lRt(n,r);break;case 18:uRt(n,r);break;case 19:fRt(n,r);break;case 20:dRt(n,r);break;default:(0,H1t.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&hRt(n)}function q1t(e,t){t==="<"&&L0(e)}function Y1t(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?L0(e):(0,_u.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Loe)}function X1t(e,t,n){(0,_u.isWhitespaceChar)(n)?(e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{name:Noe(e)})),e.state=4):t==="<"?L0(e):t==="/"?(e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{name:Noe(e)})),e.state=12):t===">"?(e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{name:Noe(e)})),F0(e)):!(0,_u.isAsciiLetterChar)(n)&&!(0,_u.isDigitChar)(n)&&t!==":"&&Eh(e)}function K1t(e,t,n){t===">"?Eh(e):(0,_u.isAsciiLetterChar)(n)?e.state=3:Eh(e)}function $1t(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?F0(e):t==="<"?L0(e):t==="="||(0,_u.isQuoteChar)(n)||(0,_u.isControlChar)(n)?Eh(e):e.state=5)}function J1t(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?F0(e):t==="<"?L0(e):(0,_u.isQuoteChar)(n)&&Eh(e)}function Z1t(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?F0(e):t==="<"?L0(e):(0,_u.isQuoteChar)(n)?Eh(e):e.state=5)}function Q1t(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Eh(e):t==="<"?L0(e):e.state=10)}function eRt(e,t){t==='"'&&(e.state=11)}function tRt(e,t){t==="'"&&(e.state=11)}function nRt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=4:t===">"?F0(e):t==="<"&&L0(e)}function iRt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?F0(e):t==="<"?L0(e):(e.state=4,mRt(e))}function rRt(e,t){t===">"?(e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{isClosing:!0})),F0(e)):Eh(e)}function oRt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new N0(vl.__assign(vl.__assign({},e.currentTag),{type:"doctype"})),e.state=20):Eh(e)}function sRt(e,t){t==="-"?e.state=15:t===">"?Eh(e):e.state=16}function aRt(e,t){t==="-"?e.state=18:t===">"?Eh(e):e.state=16}function cRt(e,t){t==="-"&&(e.state=17)}function lRt(e,t){t==="-"?e.state=18:e.state=16}function uRt(e,t){t===">"?F0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function fRt(e,t){t==="-"?e.state=17:t===">"?F0(e):e.state=16}function dRt(e,t){t===">"?F0(e):t==="<"&&L0(e)}function Eh(e){e.state=0,e.currentTag=Loe}function L0(e){e.state=1,e.currentTag=new N0({idx:e.charIdx})}function F0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Eh(e),e.currentDataIdx=e.charIdx+1}function hRt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Noe(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function mRt(e){e.charIdx--}});var y7=Yi(koe=>{"use strict";Object.defineProperty(koe,"__esModule",{value:!0});var Boe=(ip(),Fh(np)),pRt=aMe(),$a=Sb(),gRt=xoe(),_Rt=r7(),yRt=Moe(),ARt=xMe(),bRt=Soe(),xRt=Coe(),TRt=(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=ERt(t.urls),this.email=(0,$a.isBoolean)(t.email)?t.email:this.email,this.phone=(0,$a.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,$a.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=CRt(t.stripPrefix),this.stripTrailingSlash=(0,$a.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,$a.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&bRt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&xRt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=vRt(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"],r=0,o=[];return(0,ARt.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,Boe.__spreadArray([],Boe.__read(g),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(SRt);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var s=t[n+1].getMatchedText().length>o?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,$a.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=(0,yRt.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),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 _Rt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new gRt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=pRt.version,e})();koe.default=TRt;function ERt(e){return e==null&&(e=!0),(0,$a.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,$a.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,$a.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,$a.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function CRt(e){return e==null&&(e=!0),(0,$a.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,$a.isBoolean)(e.scheme)?e.scheme:!0,www:(0,$a.isBoolean)(e.www)?e.www:!0}}function vRt(e){return typeof e=="number"?{length:e,location:"end"}:Boe.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function SRt(e,t){return e.getOffset()-t.getOffset()}});var EMe=Yi(TMe=>{"use strict";Object.defineProperty(TMe,"__esModule",{value:!0})});var CMe=Yi(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});var oC=(ip(),Fh(np));oC.__exportStar(EMe(),ry);oC.__exportStar(Eoe(),ry);oC.__exportStar(voe(),ry);oC.__exportStar(tC(),ry);oC.__exportStar(woe(),ry);oC.__exportStar(Ioe(),ry);oC.__exportStar(Toe(),ry)});var vMe=Yi(Uoe=>{"use strict";Object.defineProperty(Uoe,"__esModule",{value:!0});var wRt=(ip(),Fh(np));wRt.__exportStar(Moe(),Uoe)});var zoe=Yi((rp,wMe)=>{"use strict";rp=wMe.exports=y7().default;Object.defineProperty(rp,"__esModule",{value:!0});rp.Autolinker=void 0;var hP=(ip(),Fh(np)),SMe=hP.__importDefault(y7());rp.Autolinker=SMe.default;rp.default=SMe.default;hP.__exportStar(y7(),rp);hP.__exportStar(xoe(),rp);hP.__exportStar(r7(),rp);hP.__exportStar(CMe(),rp);hP.__exportStar(vMe(),rp)});var nke=Yi((Gyr,jW)=>{/* 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 r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=s(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=a(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),E=2*f.maxZError,v=Number.MAX_VALUE,S;p=p||(f.mask?f.mask.bitset:null);var I,R;I=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),L,_,C=0;C<=b;C++){var w=C!==b?T:f.height%b;if(w!==0)for(var P=0;P<=A;P++){var M=P!==A?x:f.width%A;if(M!==0){var F=C*f.width*T+P*x,V=f.width-M,B=f.pixels.blocks[y],j,k,G;B.encoding<2?(B.encoding===0?j=B.rawData:(u(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,E,O,f.pixels.maxValue),j=O),k=0):B.encoding===2?G=0:G=B.offset;var q;if(p)for(_=0;_<w;_++){for(F&7&&(q=p[F>>3],q<<=F&7),L=0;L<M;L++)F&7||(q=p[F>>3]),q&128?(R&&(R[F]=1),S=B.encoding<2?j[k++]:G,v=v>S?S:v,I[F++]=S):(R&&(R[F]=0),I[F++]=g),q<<=1;F+=V}else if(B.encoding<2)for(_=0;_<w;_++){for(L=0;L<M;L++)S=j[k++],v=v>S?S:v,I[F++]=S;F+=V}else for(v=v>G?G:v,_=0;_<w;_++){for(L=0;L<M;L++)I[F++]=G;F+=V}if(B.encoding===1&&k!==B.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:I,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var E=y.getUint8(x++);for(b=-b;b--;)A[T++]=E}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=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)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,S=g.pixels.numBlocksY,I=v+(g.width%v>0?1:0),R=S+(g.height%S>0?1:0);g.pixels.blocks=new Array(I*R);for(var O=0,L=0;L<R;L++)for(var _=0;_<I;_++){var C=0,w=f.byteLength-d;y=new DataView(f,d,Math.min(10,w));var P={};g.pixels.blocks[O++]=P;var M=y.getUint8(0);if(C++,P.encoding=M&63,P.encoding>3)throw"Invalid block encoding ("+P.encoding+")";if(P.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,P.offsetType=M,M===2)P.offset=y.getInt8(1),C++;else if(M===1)P.offset=y.getInt16(1,!0),C+=2;else if(M===0)P.offset=y.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(P.encoding===1)if(M=y.getUint8(C),C++,P.bitsPerPixel=M&63,M>>=6,P.numValidPixelsType=M,M===2)P.numValidPixels=y.getUint8(C),C++;else if(M===1)P.numValidPixels=y.getUint16(C,!0),C+=2;else if(M===0)P.numValidPixels=y.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,P.encoding!==3){var F,V;if(P.encoding===0){var B=(g.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";F=new ArrayBuffer(B*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B*4));var j=new Float32Array(F);P.rawData=j,d+=B*4}else if(P.encoding===1){var k=Math.ceil(P.numValidPixels*P.bitsPerPixel/8),G=Math.ceil(k/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k)),P.stuffedData=new Uint32Array(F),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,E=0,v,S,I=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(E===0&&(S=f[x++],E=32),E>=d)v=S>>>E-d&b,E-=d;else{var O=d-E;v=(S&b)<<O&b,S=f[x++],E=32-O,v+=S>>>E}y[T]=v<I?g+v*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E,v,S,I,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=p[E];else for(I=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=E<I?g+E*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E,v=[],S=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*S;var I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32),x>=u?(T=E>>>x-u&m,x-=u):(b=u-x,T=(E&m)<<b&m,E=c[y++],x=32-b,T+=E>>>x),v[A]=T<I?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E=0,v,S,I;if(p)for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=p[v];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=v<R?g+v*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E=0,v,S=[],I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(v=c[y++],x=32,E=0),x>=u?(T=v>>>E&m,x-=u,E+=u):(b=u-x,T=v>>>E&m,v=c[y++],x=32-b,T|=(v&(1<<b)-1)<<u-b,E=b),S[A]=T<I?d+T*p:g;return S.unshift(d),S},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,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),f+=40,u.headerInfo=p,u.ptr=f;var y,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,E=0,v=0;do{if(x>0)for(;x--;)A[E++]=m.getUint8(T++);else for(v=m.getUint8(T++),x=-x;x--;)A[E++]=v;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||E<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var S=0,I=0;for(I=0;I<p;I++)I&7?(S=A[I>>3],S<<=I&7):S=A[I>>3],S&128&&(b[I]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),E=new Uint8Array(T);E.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var v=0,S=0,I=0,R=0;if(g>1)for(I=0;I<g;I++)for(R=I*m,S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[R+S]=b[v++]);else for(S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[S]=b[v++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,E,v;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var S=c.byteLength-u.ptr,I=Math.ceil(S/4),R=new ArrayBuffer(I*4),O=new Uint8Array(R);O.set(new Uint8Array(c,u.ptr,S));var L=new Uint32Array(R),_=0,C,w=0;for(C=L[0],x=m;x<y;x++)T=x-(x<g?0:g),v=b[T].first,v>0&&(b[T].second=C<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,C=L[w])):(_+=v-32,w++,C=L[w],b[T].second|=C>>>32-_));var P=0,M=0,F=new s;for(x=0;x<b.length;x++)b[x]!==void 0&&(P=Math.max(P,b[x].first));P>=f?M=f:M=P,P>=30&&console.log("WARning, large NUM LUT BITS IS "+P);var V=[],B,j,k,G,q,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),v=b[T].first,v>0)if(B=[v,T],v<=M)for(j=b[T].second<<M-v,k=1<<M-v,E=0;E<k;E++)V[j|E]=B;else for(j=b[T].second,Q=F,G=v-1;G>=0;G--)q=j>>>G&1,q?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),G===0&&!Q.val&&(Q.val=B[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:P,tree:F,stuffedData:L,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,E=A.srcPtr,v=A.bitPos,S=A.numBitsLUTQick,I=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,L,_,C=u.pixels.resultMask,w,P,M,F,V,B,j,k=0;v>0&&(E++,v=0);var G=T[E],q=u.encodeMode===1,Q=new f(y*p),W=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(W=new f(Q.buffer,y*J,y),k=0),u.headerInfo.numValidPixel===m*g)for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++){if(L=0,w=G<<v>>>32-S,P=w,32-v<S&&(w|=T[E+1]>>>64-v-S,P=w),b[P])L=b[P][1],v+=b[P][0];else for(w=G<<v>>>32-I,P=w,32-v<I&&(w|=T[E+1]>>>64-v-I,P=w),O=x,j=0;j<I;j++)if(M=w>>>I-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0?_+=k:F>0?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}else for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++)if(C[B]){if(L=0,w=G<<v>>>32-S,P=w,32-v<S&&(w|=T[E+1]>>>64-v-S,P=w),b[P])L=b[P][1],v+=b[P][0];else for(w=G<<v>>>32-I,P=w,32-v<I&&(w|=T[E+1]>>>64-v-I,P=w),O=x,j=0;j<I;j++)if(M=w>>>I-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0&&C[B-1]?_+=k:F>0&&C[B-m]?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,E=(b&32)>0,v=b&31,S=0;if(T===1)S=A.getUint8(y),y++;else if(T===2)S=A.getUint16(y,!0),y+=2;else if(T===4)S=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,R,O,L,_,C,w,P,M,F,V,B=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,M=A.getUint8(y),F=v,y++,_=Math.ceil((M-1)*v/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,_)),P=new Uint32Array(O),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?w=r.unstuffLUT2(P,v,M-1,d,I,B):w=r.unstuffLUT(P,v,M-1,d,I,B),m>=3?r.unstuff2(R,f,V,S,w):r.unstuff(R,f,V,S,w)}else u.counter.bitstuffer++,V=v,u.ptr+=y,V>0&&(_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,S):r.unstuff2(R,f,V,S,!1,d,I,B):d==null?r.originalUnstuff(R,f,V,S):r.unstuff(R,f,V,S,!1,d,I,B))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,E=0,v=0,S=0,I=0,R=0,O=0,L=0,_=0,C=0,w=0,P=0,M=0,F=0,V=0,B=0,j,k,G,q,Q,W,J=new f(m*m),Z=g%m||m,ae=p%m||m,Ae,fe,xe=d.numDims,ge,we=u.pixels.resultMask,Se=u.pixels.resultPixels;for(v=0;v<x;v++)for(I=v!==x-1?m:Z,S=0;S<b;S++)for(R=S!==b-1?m:ae,w=v*p*m+S*m,P=p-R,ge=0;ge<xe;ge++){if(xe>1&&(Se=new f(u.pixels.resultPixels.buffer,p*g*ge*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),k={},B=0,L=j.getUint8(0),B++,_=L>>6&255,C=L>>2&15,C!==(S*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=B,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=B;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=B,M=I*R*A,F=c.byteLength-u.ptr,M=M<F?M:F,G=new ArrayBuffer(M%A===0?M:M+A-M%A),q=new Uint8Array(G),q.set(new Uint8Array(c,u.ptr,M)),Q=new f(G),V=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=Q[V++]),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=Q[V++];w+=P}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),fe=o.getOnePixel(k,B,Ae,j),B+=o.getDataTypeSize(Ae),W===3)if(u.ptr+=B,u.counter.constantoffset++,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=fe),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=fe;w+=P}else if(u.ptr+=B,o.decodeBits(c,u,J,fe,ge),B=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=J[B++]),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=J[B++];w+=P}}},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:o.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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={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&&o.isValidPixelValue(g.imageType,f)){var S=p.pixels.resultMask;for(d=0;d<A;d++)S[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var x=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,E,v;if(f>1&&m.length>1){for(v=b.width*b.height,b.bandMasks=m,A=new Uint8Array(v),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],E=0;E<v;E++)A[E]=A[E]&y[E];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof jW<"u"&&jW.exports?jW.exports=i:this.Lerc=i})()});var Kke=Yi((tj,Fle)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof tj=="object"&&typeof Fle=="object"?Fle.exports=t():typeof define=="function"&&define.amd?define([],t):typeof tj=="object"?tj.NoSleep=t():e.NoSleep=t()})(tj,(function(){return(function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var s in i)n.d(o,s,function(a){return i[a]}.bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)})([function(e,t,n){"use strict";var i=(function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}})(),r=n(1),o=r.webm,s=r.mp4,a=function(){return 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},c=function(){return"wakeLock"in navigator},u=(function(){function f(){var d=this;if((function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",(function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",(function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())}))})))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then((function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p})):a()?(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(function(){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(function(p){return h.enabled=!0,p}).catch(function(p){throw h.enabled=!1,p})}},{key:"disable",value:function(){l()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` + `),this.noSleepTimer=window.setInterval((function(){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((function(p){return d.enabled=!0,p})).catch((function(p){throw d.enabled=!1,p}))}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f}();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwT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imaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSU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AAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])})});var aDt={};uJ(aDt,{AlphaMode:()=>Em,AlphaPipelineStage:()=>YR,AnchorPointDirect:()=>Z1,AnchorPointIndirect:()=>Q1,Animation:()=>Lk,AnimationViewModel:()=>Nk,Appearance:()=>io,ApproximateTerrainHeights:()=>ui,ArcGISTiledElevationTerrainProvider:()=>Y$,ArcGisBaseMapType:()=>Vh,ArcGisMapServerImageryProvider:()=>dg,ArcGisMapService:()=>Zu,ArcType:()=>qt,ArticulationStageType:()=>xc,AssociativeArray:()=>Et,Atmosphere:()=>Ex,AtmospherePipelineStage:()=>vR,AttributeCompression:()=>Ln,AttributeType:()=>nn,AutoExposure:()=>WB,AutomaticUniforms:()=>Ap,Axis:()=>Fo,AxisAlignedBoundingBox:()=>Qg,B3dmLoader:()=>fR,B3dmParser:()=>cR,BaseLayerPicker:()=>Bk,BaseLayerPickerViewModel:()=>Fk,BatchTable:()=>Rb,BatchTableHierarchy:()=>nx,BatchTexture:()=>el,BatchTexturePipelineStage:()=>XR,Billboard:()=>lo,BillboardCollection:()=>Ru,BillboardGraphics:()=>fc,BillboardLoadState:()=>ss,BillboardTexture:()=>T_,BillboardVisualizer:()=>II,BingMapsGeocoderService:()=>K$,BingMapsImageryProvider:()=>b2,BingMapsStyle:()=>cw,BlendEquation:()=>Fa,BlendFunction:()=>Eo,BlendOption:()=>wo,BlendingState:()=>ln,BoundingRectangle:()=>Ke,BoundingSphere:()=>le,BoundingSphereState:()=>lt,BoundingVolumeSemantics:()=>bx,BoxEmitter:()=>VZ,BoxGeometry:()=>La,BoxGeometryUpdater:()=>HO,BoxGraphics:()=>Vb,BoxOutlineGeometry:()=>Ud,BrdfLutGenerator:()=>K2,Buffer:()=>yt,BufferLoader:()=>ax,BufferUsage:()=>Be,CPUStylingPipelineStage:()=>QR,CallbackPositionProperty:()=>GO,CallbackProperty:()=>Wd,Camera:()=>ro,CameraEventAggregator:()=>QB,CameraEventType:()=>Vi,CameraFlightPath:()=>Z2,Cartesian2:()=>H,Cartesian3:()=>d,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>Z$,CatmullRomSpline:()=>Q$,Cesium3DContentGroup:()=>tx,Cesium3DTile:()=>Zf,Cesium3DTileBatchTable:()=>Kp,Cesium3DTileColorBlendMode:()=>Bl,Cesium3DTileContent:()=>zZ,Cesium3DTileContentFactory:()=>Ux,Cesium3DTileContentState:()=>Xo,Cesium3DTileContentType:()=>Ps,Cesium3DTileFeature:()=>Ws,Cesium3DTileFeatureTable:()=>sh,Cesium3DTileOptimizationHint:()=>qf,Cesium3DTileOptimizations:()=>NL,Cesium3DTilePass:()=>Uo,Cesium3DTilePassState:()=>gd,Cesium3DTilePointFeature:()=>A_,Cesium3DTileRefine:()=>qo,Cesium3DTileStyle:()=>NA,Cesium3DTileStyleEngine:()=>zL,Cesium3DTilesInspector:()=>Gk,Cesium3DTilesInspectorViewModel:()=>Hk,Cesium3DTilesVoxelProvider:()=>HZ,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>YL,Cesium3DTilesetCache:()=>kL,Cesium3DTilesetGraphics:()=>Yb,Cesium3DTilesetHeatmap:()=>UL,Cesium3DTilesetMetadata:()=>Kx,Cesium3DTilesetMostDetailedTraversal:()=>jL,Cesium3DTilesetSkipTraversal:()=>$L,Cesium3DTilesetStatistics:()=>gh,Cesium3DTilesetTraversal:()=>Zs,Cesium3DTilesetVisualizer:()=>ZL,CesiumInspector:()=>qk,CesiumInspectorViewModel:()=>Wk,CesiumTerrainProvider:()=>DA,CesiumWidget:()=>q3,Check:()=>T,CheckerboardMaterialProperty:()=>kE,CircleEmitter:()=>sk,CircleGeometry:()=>oZ,CircleOutlineGeometry:()=>rZ,ClassificationModelDrawCommand:()=>jM,ClassificationPipelineStage:()=>KR,ClassificationPrimitive:()=>EC,ClassificationType:()=>Un,ClearCommand:()=>ei,ClippingPlane:()=>xx,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>eE,ClippingPolygonCollection:()=>th,Clock:()=>Ah,ClockRange:()=>$r,ClockStep:()=>mo,ClockViewModel:()=>Ok,CloudCollection:()=>XZ,CloudType:()=>FA,Color:()=>G,ColorBlendMode:()=>bc,ColorGeometryInstanceAttribute:()=>Gt,ColorMaterialProperty:()=>Ut,Command:()=>kQ,ComponentDatatype:()=>$,Composite3DTileContent:()=>QO,CompositeEntityCollection:()=>bq,CompositeMaterialProperty:()=>VE,CompositePositionProperty:()=>ba,CompositeProperty:()=>Sc,CompressedTextureBuffer:()=>Iv,ComputeCommand:()=>Uc,ComputeEngine:()=>Pv,ConditionsExpression:()=>nk,ConeEmitter:()=>$Z,ConstantPositionProperty:()=>qc,ConstantProperty:()=>Kn,ConstantSpline:()=>pR,ContentMetadata:()=>wL,Context:()=>AI,ContextLimits:()=>ut,CoplanarPolygonGeometry:()=>NN,CoplanarPolygonGeometryLibrary:()=>O_,CoplanarPolygonOutlineGeometry:()=>$f,CornerType:()=>Bi,CorrelationGroup:()=>J1,CorridorGeometry:()=>tT,CorridorGeometryLibrary:()=>Wi,CorridorGeometryUpdater:()=>sN,CorridorGraphics:()=>Hb,CorridorOutlineGeometry:()=>rN,Credit:()=>Tt,CreditDisplay:()=>tB,CubeMap:()=>Go,CubeMapFace:()=>Vv,CubicRealPolynomial:()=>gb,CullFace:()=>xi,CullingVolume:()=>_s,CumulusCloud:()=>uf,CustomDataSource:()=>dN,CustomHeightmapTerrainProvider:()=>sZ,CustomShader:()=>pA,CustomShaderMode:()=>y_,CustomShaderPipelineStage:()=>rM,CustomShaderTranslucencyMode:()=>Ly,CylinderGeometry:()=>hN,CylinderGeometryLibrary:()=>nT,CylinderGeometryUpdater:()=>pN,CylinderGraphics:()=>Gb,CylinderOutlineGeometry:()=>mN,CzmlDataSource:()=>SN,DataSource:()=>Kr,DataSourceClock:()=>Ch,DataSourceCollection:()=>wN,DataSourceDisplay:()=>uF,DebugAppearance:()=>tQ,DebugCameraPrimitive:()=>sp,DebugInspector:()=>s3,DebugModelMatrixPrimitive:()=>lk,DefaultProxy:()=>cZ,DepthFunction:()=>dc,DepthPlane:()=>aB,DequantizationPipelineStage:()=>aM,DerivedCommand:()=>ap,DeveloperError:()=>E,DeviceOrientationCameraController:()=>cB,DirectionalLight:()=>nQ,DiscardEmptyTileImagePolicy:()=>lw,DiscardMissingTileImagePolicy:()=>g2,DistanceDisplayCondition:()=>Mt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>xA,DoublyLinkedList:()=>BL,DracoLoader:()=>n_,DrawCommand:()=>Qe,DynamicAtmosphereLightingType:()=>a_,DynamicEnvironmentMapManager:()=>c_,DynamicGeometryBatch:()=>cT,DynamicGeometryUpdater:()=>ni,EarthOrientationParameters:()=>xv,EarthOrientationParametersSample:()=>Bg,EasingFunction:()=>Qr,EllipseGeometry:()=>dl,EllipseGeometryLibrary:()=>$l,EllipseGeometryUpdater:()=>DN,EllipseGraphics:()=>jb,EllipseOutlineGeometry:()=>Hu,Ellipsoid:()=>ie,EllipsoidGeodesic:()=>kp,EllipsoidGeometry:()=>Js,EllipsoidGeometryUpdater:()=>IN,EllipsoidGraphics:()=>Wb,EllipsoidOutlineGeometry:()=>Nu,EllipsoidPrimitive:()=>j2,EllipsoidRhumbLine:()=>Ba,EllipsoidSurfaceAppearance:()=>iQ,EllipsoidTangentPlane:()=>ns,EllipsoidTerrainProvider:()=>np,EllipsoidalOccluder:()=>H_,Empty3DTileContent:()=>SE,EncodedCartesian3:()=>Hn,Entity:()=>nr,EntityCluster:()=>Bu,EntityCollection:()=>Qs,EntityView:()=>dF,Event:()=>pe,EventHelper:()=>gr,Expression:()=>Lf,ExpressionNodeType:()=>_t,ExtrapolationType:()=>cl,FeatureDetection:()=>Vt,FeatureIdPipelineStage:()=>My,Fog:()=>lB,ForEach:()=>Oe,FrameRateMonitor:()=>dk,FrameState:()=>uB,Framebuffer:()=>Ur,FramebufferManager:()=>hi,Frozen:()=>W,FrustumCommands:()=>pB,FrustumGeometry:()=>YT,FrustumOutlineGeometry:()=>oB,Fullscreen:()=>Cr,FullscreenButton:()=>Xk,FullscreenButtonViewModel:()=>Yk,GeoJsonDataSource:()=>T0,GeoJsonLoader:()=>dR,GeocodeType:()=>W0,Geocoder:()=>Qk,GeocoderService:()=>Yw,GeocoderViewModel:()=>Zk,GeographicProjection:()=>Oi,GeographicTilingScheme:()=>Ki,Geometry:()=>ct,Geometry3DTileContent:()=>n1,GeometryAttribute:()=>ve,GeometryAttributes:()=>fn,GeometryFactory:()=>uZ,GeometryInstance:()=>St,GeometryInstanceAttribute:()=>hc,GeometryOffsetAttribute:()=>Zt,GeometryPipeline:()=>Nn,GeometryPipelineStage:()=>fM,GeometryType:()=>xf,GeometryUpdater:()=>ii,GeometryUpdaterSet:()=>bT,GeometryVisualizer:()=>QN,GetFeatureInfoFormat:()=>GT,Globe:()=>V2,GlobeDepth:()=>_B,GlobeSurfaceShaderSet:()=>_2,GlobeSurfaceTile:()=>md,GlobeSurfaceTileProvider:()=>I2,GlobeTranslucency:()=>O2,GlobeTranslucencyFramebuffer:()=>gB,GlobeTranslucencyState:()=>fB,GltfBufferViewLoader:()=>kC,GltfDracoLoader:()=>UC,GltfGpmLoader:()=>tR,GltfGpmLocal:()=>nE,GltfImageLoader:()=>VC,GltfIndexBufferLoader:()=>zC,GltfJsonLoader:()=>GC,GltfLoader:()=>rh,GltfLoaderUtil:()=>Vl,GltfMeshPrimitiveGpmLoader:()=>rR,GltfStructuralMetadataLoader:()=>K1,GltfTextureLoader:()=>jC,GltfVertexBufferLoader:()=>WC,GoogleEarthEnterpriseImageryProvider:()=>rQ,GoogleEarthEnterpriseMapsProvider:()=>A2,GoogleEarthEnterpriseMetadata:()=>Og,GoogleEarthEnterpriseTerrainData:()=>Xw,GoogleEarthEnterpriseTerrainProvider:()=>yZ,GoogleEarthEnterpriseTileInformation:()=>Z3,GoogleGeocoderService:()=>xZ,GoogleMaps:()=>OA,GpxDataSource:()=>BF,GregorianDate:()=>im,GridImageryProvider:()=>sQ,GridMaterialProperty:()=>$E,GroundGeometryUpdater:()=>Gn,GroundPolylineGeometry:()=>Fb,GroundPolylinePrimitive:()=>Vd,GroundPrimitive:()=>jc,GroupMetadata:()=>NE,HeadingPitchRange:()=>cd,HeadingPitchRoll:()=>Oa,Heap:()=>_v,HeightReference:()=>We,HeightmapEncoding:()=>fd,HeightmapTerrainData:()=>qa,HeightmapTessellator:()=>ow,HermitePolynomialApproximation:()=>_N,HermiteSpline:()=>Iy,HilbertOrder:()=>LC,HomeButton:()=>$k,HomeButtonViewModel:()=>Kk,HorizontalOrigin:()=>bi,I3SBuildingSceneLayerExplorer:()=>YQ,I3SBuildingSceneLayerExplorerViewModel:()=>Jk,I3SDataProvider:()=>Jh,I3SDecoder:()=>hk,I3SFeature:()=>mk,I3SField:()=>pk,I3SGeometry:()=>Qw,I3SLayer:()=>zA,I3SNode:()=>Jw,I3SStatistics:()=>yk,I3SSublayer:()=>xk,I3SSymbology:()=>gk,I3dmLoader:()=>mR,I3dmParser:()=>hR,ITwinData:()=>uQ,ITwinPlatform:()=>us,Iau2000Orientation:()=>H2,Iau2006XysData:()=>Tv,Iau2006XysSample:()=>hb,IauOrientationAxes:()=>G2,IauOrientationParameters:()=>z2,ImageBasedLighting:()=>ex,ImageBasedLightingPipelineStage:()=>PR,ImageMaterialProperty:()=>ny,Imagery:()=>pw,ImageryLayer:()=>Xa,ImageryLayerCollection:()=>R2,ImageryLayerFeatureInfo:()=>Uh,ImageryProvider:()=>yl,ImageryState:()=>ai,Implicit3DTileContent:()=>XC,ImplicitAvailabilityBitstream:()=>FC,ImplicitMetadataView:()=>BC,ImplicitSubdivisionScheme:()=>or,ImplicitSubtree:()=>gx,ImplicitSubtreeCache:()=>ok,ImplicitSubtreeMetadata:()=>i1,ImplicitTileCoordinates:()=>Qx,ImplicitTileset:()=>Zx,IndexDatatype:()=>Fe,InfoBox:()=>tU,InfoBoxViewModel:()=>eU,InspectorShared:()=>fu,InstanceAttributeSemantic:()=>rs,InstancingPipelineStage:()=>GR,InterpolationAlgorithm:()=>TZ,InterpolationType:()=>ih,Intersect:()=>Wt,IntersectionTests:()=>Zn,Intersections2D:()=>Pg,Interval:()=>Ma,InvertClassification:()=>ww,Ion:()=>Xd,IonGeocodeProviderType:()=>Rg,IonGeocoderService:()=>RA,IonImageryProvider:()=>hg,IonResource:()=>Cu,IonWorldImageryStyle:()=>mg,Iso8601:()=>Ge,JobScheduler:()=>dB,JobType:()=>pa,JsonMetadataTable:()=>l_,JulianDate:()=>Q,KTX2Transcoder:()=>Ov,KeyboardEventModifier:()=>ra,KeyframeNode:()=>go,KmlCamera:()=>kF,KmlDataSource:()=>kT,KmlLookAt:()=>UF,KmlTour:()=>VF,KmlTourFlyTo:()=>HF,KmlTourWait:()=>GF,Label:()=>Uy,LabelCollection:()=>Om,LabelGraphics:()=>Hd,LabelStyle:()=>Yo,LabelVisualizer:()=>JN,LagrangePolynomialApproximation:()=>gN,LeapSecond:()=>Yi,Light:()=>fQ,LightingModel:()=>Dm,LightingPipelineStage:()=>hM,LinearApproximation:()=>Jy,LinearSpline:()=>Py,ManagedArray:()=>Jc,MapMode2D:()=>ru,MapProjection:()=>EZ,MapboxImageryProvider:()=>C2,MapboxStyleImageryProvider:()=>dQ,Material:()=>Xi,MaterialAppearance:()=>ao,MaterialPipelineStage:()=>pM,MaterialProperty:()=>tr,Math:()=>O,Matrix2:()=>Ri,Matrix3:()=>J,Matrix4:()=>B,Megatexture:()=>Lw,MeshPrimitiveGpmLocal:()=>oR,MetadataClass:()=>Qd,MetadataClassProperty:()=>Tm,MetadataComponentType:()=>Nt,MetadataEntity:()=>Bn,MetadataEnum:()=>v1,MetadataEnumValue:()=>w1,MetadataPicking:()=>hB,MetadataPickingPipelineStage:()=>Pu,MetadataPipelineStage:()=>Uf,MetadataSchema:()=>vu,MetadataSchemaLoader:()=>qC,MetadataSemantic:()=>yx,MetadataTable:()=>Nf,MetadataTableProperty:()=>r1,MetadataType:()=>at,MipmapHint:()=>Cf,Model:()=>lh,Model3DTileContent:()=>Ou,ModelAlphaOptions:()=>MM,ModelAnimation:()=>bR,ModelAnimationChannel:()=>yR,ModelAnimationCollection:()=>xR,ModelAnimationLoop:()=>Hl,ModelAnimationState:()=>ah,ModelArticulation:()=>OR,ModelArticulationStage:()=>IR,ModelClippingPlanesPipelineStage:()=>LR,ModelClippingPolygonsPipelineStage:()=>BR,ModelColorPipelineStage:()=>Ry,ModelComponents:()=>Tn,ModelDrawCommand:()=>WM,ModelDrawCommands:()=>XM,ModelFeature:()=>TR,ModelFeatureTable:()=>CR,ModelGraphics:()=>Gp,ModelLightingOptions:()=>zM,ModelMatrixUpdateStage:()=>jR,ModelNode:()=>kR,ModelRenderResources:()=>LM,ModelRuntimeNode:()=>qR,ModelRuntimePrimitive:()=>OM,ModelSceneGraph:()=>KM,ModelSilhouettePipelineStage:()=>BM,ModelSkin:()=>RM,ModelSplitterPipelineStage:()=>UM,ModelStatistics:()=>$M,ModelType:()=>pr,ModelUtility:()=>$t,ModelVisualizer:()=>eF,Moon:()=>q2,MorphTargetsPipelineStage:()=>gM,MorphWeightSpline:()=>SZ,MortonOrder:()=>Wy,Multiple3DTileContent:()=>PL,MultisampleFramebuffer:()=>CI,NavigationHelpButton:()=>aU,NavigationHelpButtonViewModel:()=>sU,NearFarScalar:()=>Bt,NeverTileDiscardPolicy:()=>mQ,NodeRenderResources:()=>VM,NodeStatisticsPipelineStage:()=>WR,NodeTransformationProperty:()=>qb,OIT:()=>yB,Occluder:()=>Y2,OffsetGeometryInstanceAttribute:()=>eo,OpenCageGeocoderService:()=>vZ,OpenStreetMapImageryProvider:()=>Lg,OrderedGroundPrimitiveCollection:()=>vN,OrientedBoundingBox:()=>Dn,OrthographicFrustum:()=>on,OrthographicOffCenterFrustum:()=>jo,Packable:()=>DZ,PackableForInterpolation:()=>PZ,Particle:()=>nv,ParticleBurst:()=>_Q,ParticleEmitter:()=>gQ,ParticleSystem:()=>yQ,Pass:()=>De,PassState:()=>lc,PathGraphics:()=>jp,PathVisualizer:()=>nF,PeliasGeocoderService:()=>J3,PerInstanceColorAppearance:()=>rn,PerformanceDisplay:()=>yg,PerformanceWatchdog:()=>rU,PerformanceWatchdogViewModel:()=>oU,PerspectiveFrustum:()=>Ci,PerspectiveOffCenterFrustum:()=>bl,PickDepth:()=>mB,PickDepthFramebuffer:()=>xB,PickFramebuffer:()=>AB,PickedMetadataInfo:()=>L3,Picking:()=>wB,PickingPipelineStage:()=>yM,PinBuilder:()=>ag,PixelDatatype:()=>Ue,PixelFormat:()=>ke,Plane:()=>sn,PlaneGeometry:()=>ON,PlaneGeometryUpdater:()=>MN,PlaneGraphics:()=>NO,PlaneOutlineGeometry:()=>RN,PntsLoader:()=>QM,PntsParser:()=>Rx,PointCloud:()=>j3,PointCloudEyeDomeLighting:()=>f_,PointCloudShading:()=>vm,PointCloudStylingPipelineStage:()=>xM,PointGraphics:()=>Xb,PointPrimitive:()=>Os,PointPrimitiveCollection:()=>WE,PointVisualizer:()=>oF,PolygonGeometry:()=>s_,PolygonGeometryLibrary:()=>zn,PolygonGeometryUpdater:()=>BN,PolygonGraphics:()=>Gd,PolygonHierarchy:()=>ka,PolygonOutlineGeometry:()=>FN,PolygonPipeline:()=>si,Polyline:()=>Gf,PolylineArrowMaterialProperty:()=>QE,PolylineCollection:()=>dh,PolylineColorAppearance:()=>is,PolylineDashMaterialProperty:()=>eS,PolylineGeometry:()=>ng,PolylineGeometryUpdater:()=>aF,PolylineGlowMaterialProperty:()=>nS,PolylineGraphics:()=>mc,PolylineMaterialAppearance:()=>ha,PolylineOutlineMaterialProperty:()=>e0,PolylinePipeline:()=>Fi,PolylineVisualizer:()=>lF,PolylineVolumeGeometry:()=>VN,PolylineVolumeGeometryLibrary:()=>yh,PolylineVolumeGeometryUpdater:()=>jN,PolylineVolumeGraphics:()=>Kb,PolylineVolumeOutlineGeometry:()=>GN,PositionProperty:()=>zd,PositionPropertyArray:()=>q_,PostProcessStage:()=>ho,PostProcessStageCollection:()=>XB,PostProcessStageComposite:()=>au,PostProcessStageLibrary:()=>tf,PostProcessStageSampleMode:()=>ef,PostProcessStageTextureCache:()=>rA,PpeMetadata:()=>iR,PpeSource:()=>LQ,PpeTexture:()=>nR,Primitive:()=>Pn,PrimitiveCollection:()=>fl,PrimitiveLoadPlan:()=>vx,PrimitiveOutlineGenerator:()=>wx,PrimitiveOutlinePipelineStage:()=>CM,PrimitivePipeline:()=>Mb,PrimitiveRenderResources:()=>HM,PrimitiveState:()=>Pr,PrimitiveStatisticsPipelineStage:()=>EM,PrimitiveType:()=>Me,ProjectionPicker:()=>iU,ProjectionPickerViewModel:()=>nU,Property:()=>X,PropertyArray:()=>oS,PropertyAttribute:()=>Sx,PropertyAttributeProperty:()=>W1,PropertyBag:()=>Xc,PropertyTable:()=>nl,PropertyTexture:()=>u_,PropertyTextureProperty:()=>j1,ProviderViewModel:()=>ds,Proxy:()=>OZ,QuadraticRealPolynomial:()=>Vc,QuadtreeOccluders:()=>M2,QuadtreePrimitive:()=>U2,QuadtreeTile:()=>L2,QuadtreeTileLoadState:()=>ta,QuadtreeTileProvider:()=>bQ,QuantizedMeshTerrainData:()=>vA,QuarticRealPolynomial:()=>Lv,Quaternion:()=>Le,QuaternionSpline:()=>gR,Queue:()=>Cy,Ray:()=>mn,Rectangle:()=>ce,RectangleCollisionChecker:()=>TT,RectangleGeometry:()=>hT,RectangleGeometryLibrary:()=>Is,RectangleGeometryUpdater:()=>WN,RectangleGraphics:()=>jd,RectangleOutlineGeometry:()=>Hx,ReferenceFrame:()=>Hi,ReferenceProperty:()=>Y_,RenderState:()=>Ve,Renderbuffer:()=>_u,RenderbufferFormat:()=>uc,Request:()=>Qo,RequestErrorEvent:()=>sm,RequestScheduler:()=>sc,RequestState:()=>$n,RequestType:()=>ms,Resource:()=>we,ResourceCache:()=>vi,ResourceCacheKey:()=>zl,ResourceCacheStatistics:()=>I1,ResourceLoader:()=>$i,ResourceLoaderState:()=>gt,Rotation:()=>td,RuntimeError:()=>ae,S2Cell:()=>Qp,SDFSettings:()=>Ks,SampledPositionProperty:()=>Ta,SampledProperty:()=>Vu,Sampler:()=>Qt,ScaledPositionProperty:()=>zm,Scene:()=>F3,SceneFramebuffer:()=>QT,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>SM,SceneModePicker:()=>dU,SceneModePickerViewModel:()=>fU,SceneTransforms:()=>Gi,SceneTransitioner:()=>ZB,ScreenSpaceCameraController:()=>t3,ScreenSpaceEventHandler:()=>of,ScreenSpaceEventType:()=>An,SelectedFeatureIdPipelineStage:()=>Ny,SelectionIndicator:()=>uU,SelectionIndicatorViewModel:()=>lU,SensorVolumePortionToDisplay:()=>cS,ShaderBuilder:()=>wb,ShaderCache:()=>gI,ShaderDestination:()=>ge,ShaderFunction:()=>vI,ShaderProgram:()=>Jt,ShaderSource:()=>He,ShaderStruct:()=>wI,ShadowMap:()=>Tg,ShadowMapShader:()=>up,ShadowMode:()=>xn,ShadowVolumeAppearance:()=>bu,ShowGeometryInstanceAttribute:()=>bn,Simon1994PlanetaryPositions:()=>Xg,SimplePolylineGeometry:()=>RZ,SingleTileImageryProvider:()=>E2,SkinningPipelineStage:()=>vM,SkyAtmosphere:()=>B3,SkyBox:()=>k3,SpatialNode:()=>O3,Spdcf:()=>eR,SpecularEnvironmentCubeMap:()=>Yd,SphereEmitter:()=>TQ,SphereGeometry:()=>MZ,SphereOutlineGeometry:()=>M_,Spherical:()=>yN,Spline:()=>Ni,SplitDirection:()=>Vr,Splitter:()=>kw,StaticGeometryColorBatch:()=>rd,StaticGeometryPerMaterialBatch:()=>sd,StaticGroundGeometryColorBatch:()=>wS,StaticGroundGeometryPerMaterialBatch:()=>ZN,StaticGroundPolylinePerMaterialBatch:()=>cF,StaticOutlineGeometryBatch:()=>PS,StencilConstants:()=>kt,StencilFunction:()=>Vn,StencilOperation:()=>ft,SteppedSpline:()=>_R,Stereographic:()=>yc,StorageType:()=>wm,StripeMaterialProperty:()=>sS,StripeOrientation:()=>Eh,StructuralMetadata:()=>Ys,StyleCommandsNeeded:()=>ch,StyleExpression:()=>AQ,Sun:()=>z3,SunLight:()=>Rp,SunPostProcess:()=>o3,SupportedImageFormats:()=>$1,SvgPathBindingHandler:()=>Pk,TaskProcessor:()=>yi,Terrain:()=>Ek,TerrainData:()=>kh,TerrainEncoding:()=>Oc,TerrainFillMesh:()=>bw,TerrainMesh:()=>hd,TerrainOffsetProperty:()=>$b,TerrainProvider:()=>cs,TerrainQuantization:()=>ea,TerrainState:()=>fo,Texture:()=>Rt,TextureAtlas:()=>vb,TextureCache:()=>yI,TextureMagnificationFilter:()=>li,TextureManager:()=>w3,TextureMinificationFilter:()=>Yt,TexturePacker:()=>_C,TextureUniform:()=>RQ,TextureWrap:()=>gn,TileAvailability:()=>Xh,TileBoundingRegion:()=>Lu,TileBoundingS2Cell:()=>ML,TileBoundingSphere:()=>L_,TileBoundingVolume:()=>CQ,TileCoordinatesImageryProvider:()=>wk,TileDiscardPolicy:()=>SQ,TileEdge:()=>yn,TileImagery:()=>_w,TileMapServiceImageryProvider:()=>D0,TileMetadata:()=>vL,TileOrientedBoundingBox:()=>Yl,TileProviderError:()=>Po,TileReplacementQueue:()=>N2,TileSelectionResult:()=>Yn,TileState:()=>wQ,Tileset3DTileContent:()=>tL,TilesetMetadata:()=>LL,TilesetPipelineStage:()=>ER,TilingScheme:()=>LZ,TimeConstants:()=>qn,TimeDynamicImagery:()=>jT,TimeDynamicPointCloud:()=>Vw,TimeInterval:()=>En,TimeIntervalCollection:()=>Xr,TimeIntervalCollectionPositionProperty:()=>X_,TimeIntervalCollectionProperty:()=>K_,TimeStandard:()=>Wn,Timeline:()=>pU,TimelineHighlightRange:()=>hU,TimelineTrack:()=>mU,Tipsify:()=>Nv,ToggleButtonViewModel:()=>Z0,Tonemapper:()=>Cg,TrackingReferenceFrame:()=>Bp,Transforms:()=>Ot,TranslationRotationScale:()=>iy,TranslucentTileClassification:()=>CB,TridiagonalSystemSolver:()=>lE,TrustedServers:()=>iC,TweenCollection:()=>lA,UniformState:()=>TI,UniformType:()=>hA,UrlTemplateImageryProvider:()=>Ya,VERSION:()=>sDt,VRButton:()=>xU,VRButtonViewModel:()=>bU,VRTheWorldTerrainProvider:()=>FZ,VaryingType:()=>MQ,Vector3DTileBatch:()=>bm,Vector3DTileClampedPolylines:()=>CL,Vector3DTileContent:()=>SL,Vector3DTileGeometry:()=>Zp,Vector3DTilePoints:()=>_L,Vector3DTilePolygons:()=>gL,Vector3DTilePolylines:()=>kx,Vector3DTilePrimitive:()=>rx,VelocityOrientationProperty:()=>xN,VelocityVectorProperty:()=>$_,VertexArray:()=>ti,VertexArrayFacade:()=>Mp,VertexAttributeSemantic:()=>ht,VertexFormat:()=>Ie,VerticalExaggeration:()=>Dr,VerticalExaggerationPipelineStage:()=>PM,VerticalOrigin:()=>Fn,VideoSynchronizer:()=>NZ,View:()=>tA,Viewer:()=>tJ,ViewportQuad:()=>vQ,Visibility:()=>xr,Visualizer:()=>MX,VoxelBoxShape:()=>gA,VoxelCell:()=>a3,VoxelContent:()=>_A,VoxelCylinderShape:()=>yA,VoxelEllipsoidShape:()=>bA,VoxelInspector:()=>gU,VoxelInspectorViewModel:()=>_U,VoxelMetadataOrder:()=>Td,VoxelPrimitive:()=>V0,VoxelProvider:()=>PQ,VoxelRenderResources:()=>A3,VoxelShape:()=>IQ,VoxelShapeType:()=>va,VoxelTraversal:()=>R3,VulkanConstants:()=>BZ,WallGeometry:()=>YN,WallGeometryLibrary:()=>mT,WallGeometryUpdater:()=>$N,WallGraphics:()=>Wp,WallOutlineGeometry:()=>KN,WebGLConstants:()=>ne,WebMapServiceImageryProvider:()=>w2,WebMapTileServiceImageryProvider:()=>D2,WebMercatorProjection:()=>Mi,WebMercatorTilingScheme:()=>ls,WindingOrder:()=>ts,WireframeIndexGenerator:()=>gE,WireframePipelineStage:()=>IM,_shadersAcesTonemappingStage:()=>vB,_shadersAdditiveBlend:()=>n3,_shadersAdjustTranslucentFS:()=>JS,_shadersAllMaterialAppearanceFS:()=>MI,_shadersAllMaterialAppearanceVS:()=>LI,_shadersAmbientOcclusionGenerate:()=>DB,_shadersAmbientOcclusionModulate:()=>PB,_shadersAspectRampMaterial:()=>UI,_shadersAtmosphereCommon:()=>nh,_shadersAtmosphereStageFS:()=>SR,_shadersAtmosphereStageVS:()=>wR,_shadersBasicMaterialAppearanceFS:()=>NI,_shadersBasicMaterialAppearanceVS:()=>FI,_shadersBillboardCollectionFS:()=>nL,_shadersBillboardCollectionVS:()=>iL,_shadersBlackAndWhite:()=>IB,_shadersBloomComposite:()=>OB,_shadersBrdfLutGeneratorFS:()=>YF,_shadersBrightPass:()=>i3,_shadersBrightness:()=>RB,_shadersBumpMapMaterial:()=>VI,_shadersCPUStylingStageFS:()=>ZR,_shadersCPUStylingStageVS:()=>$R,_shadersCheckerboardMaterial:()=>zI,_shadersCloudCollectionFS:()=>XF,_shadersCloudCollectionVS:()=>KF,_shadersCloudNoiseFS:()=>$F,_shadersCloudNoiseVS:()=>ZF,_shadersCompareAndPackTranslucentDepth:()=>QF,_shadersCompositeOITFS:()=>JF,_shadersCompositeTranslucentClassification:()=>eA,_shadersComputeIrradianceFS:()=>B1,_shadersComputeRadianceMapFS:()=>k1,_shadersContrastBias:()=>MB,_shadersConvolveSpecularMapFS:()=>U1,_shadersConvolveSpecularMapVS:()=>V1,_shadersCustomShaderStageFS:()=>eM,_shadersCustomShaderStageVS:()=>JR,_shadersCzmBuiltins:()=>Cb,_shadersDepthOfField:()=>LB,_shadersDepthPlaneFS:()=>e2,_shadersDepthPlaneVS:()=>t2,_shadersDepthView:()=>NB,_shadersDepthViewPacked:()=>OQ,_shadersDotMaterial:()=>HI,_shadersEdgeDetection:()=>FB,_shadersElevationBandMaterial:()=>GI,_shadersElevationContourMaterial:()=>jI,_shadersElevationRampMaterial:()=>WI,_shadersEllipsoidFS:()=>ew,_shadersEllipsoidSurfaceAppearanceFS:()=>uk,_shadersEllipsoidSurfaceAppearanceVS:()=>fk,_shadersEllipsoidVS:()=>tw,_shadersFXAA:()=>UB,_shadersFXAA3_11:()=>n2,_shadersFadeMaterial:()=>qI,_shadersFeatureIdStageFS:()=>tM,_shadersFeatureIdStageVS:()=>nM,_shadersFilmicTonemapping:()=>BB,_shadersGaussianBlur1D:()=>F0,_shadersGeometryStageFS:()=>cM,_shadersGeometryStageVS:()=>lM,_shadersGlobeFS:()=>i2,_shadersGlobeVS:()=>o2,_shadersGridMaterial:()=>YI,_shadersGroundAtmosphere:()=>nw,_shadersHSBToRGB:()=>_P,_shadersHSLToRGB:()=>gP,_shadersImageBasedLightingStageFS:()=>DR,_shadersInstancingStageCommon:()=>UR,_shadersInstancingStageVS:()=>VR,_shadersIntersectBox:()=>m3,_shadersIntersectClippingPlanes:()=>h3,_shadersIntersectCylinder:()=>p3,_shadersIntersectDepth:()=>d3,_shadersIntersectEllipsoid:()=>_3,_shadersIntersectLongitude:()=>Rw,_shadersIntersection:()=>dA,_shadersIntersectionUtils:()=>f3,_shadersLegacyInstancingStageVS:()=>zR,_shadersLensFlare:()=>VB,_shadersLightingStageFS:()=>dM,_shadersMaterialStageFS:()=>mM,_shadersMegatexture:()=>T3,_shadersMetadataStageFS:()=>iM,_shadersMetadataStageVS:()=>oM,_shadersModelClippingPlanesStageFS:()=>MR,_shadersModelClippingPolygonsStageFS:()=>FR,_shadersModelClippingPolygonsStageVS:()=>NR,_shadersModelColorStageFS:()=>RR,_shadersModelFS:()=>YM,_shadersModelSilhouetteStageFS:()=>NM,_shadersModelSilhouetteStageVS:()=>FM,_shadersModelSplitterStageFS:()=>kM,_shadersModelVS:()=>qM,_shadersModifiedReinhardTonemapping:()=>zB,_shadersMorphTargetsStageVS:()=>_M,_shadersNightVision:()=>HB,_shadersNormalMapMaterial:()=>XI,_shadersOctree:()=>x3,_shadersPassThrough:()=>su,_shadersPassThroughDepth:()=>M0,_shadersPbrNeutralTonemapping:()=>kB,_shadersPerInstanceColorAppearanceFS:()=>rO,_shadersPerInstanceColorAppearanceVS:()=>sO,_shadersPerInstanceFlatColorAppearanceFS:()=>Ob,_shadersPerInstanceFlatColorAppearanceVS:()=>aO,_shadersPointCloudEyeDomeLighting:()=>sR,_shadersPointCloudStylingStageVS:()=>bM,_shadersPointPrimitiveCollectionFS:()=>Qy,_shadersPointPrimitiveCollectionVS:()=>aN,_shadersPolygonSignedDistanceFS:()=>N1,_shadersPolylineArrowMaterial:()=>KI,_shadersPolylineColorAppearanceVS:()=>AO,_shadersPolylineCommon:()=>xu,_shadersPolylineDashMaterial:()=>$I,_shadersPolylineFS:()=>kb,_shadersPolylineGlowMaterial:()=>ZI,_shadersPolylineMaterialAppearanceVS:()=>CO,_shadersPolylineOutlineMaterial:()=>QI,_shadersPolylineShadowVolumeFS:()=>yO,_shadersPolylineShadowVolumeMorphFS:()=>bO,_shadersPolylineShadowVolumeMorphVS:()=>xO,_shadersPolylineShadowVolumeVS:()=>TO,_shadersPolylineVS:()=>uL,_shadersPrimitiveOutlineStageFS:()=>AM,_shadersPrimitiveOutlineStageVS:()=>TM,_shadersRGBToHSB:()=>GP,_shadersRGBToHSL:()=>jP,_shadersRGBToXYZ:()=>WP,_shadersReinhardTonemapping:()=>GB,_shadersReprojectWebMercatorFS:()=>r2,_shadersReprojectWebMercatorVS:()=>s2,_shadersRimLightingMaterial:()=>JI,_shadersSelectedFeatureIdStageCommon:()=>_E,_shadersShadowVolumeAppearanceFS:()=>AC,_shadersShadowVolumeAppearanceVS:()=>uO,_shadersShadowVolumeFS:()=>Jg,_shadersSilhouette:()=>jB,_shadersSkinningStageVS:()=>wM,_shadersSkyAtmosphereCommon:()=>iw,_shadersSkyAtmosphereFS:()=>a2,_shadersSkyAtmosphereVS:()=>c2,_shadersSkyBoxFS:()=>l2,_shadersSkyBoxVS:()=>u2,_shadersSlopeRampMaterial:()=>eO,_shadersStripeMaterial:()=>tO,_shadersSunFS:()=>f2,_shadersSunTextureFS:()=>d2,_shadersSunVS:()=>h2,_shadersTexturedMaterialAppearanceFS:()=>BI,_shadersTexturedMaterialAppearanceVS:()=>kI,_shadersVector3DTileClampedPolylinesFS:()=>TL,_shadersVector3DTileClampedPolylinesVS:()=>xL,_shadersVector3DTilePolylinesVS:()=>yL,_shadersVectorTileVS:()=>MC,_shadersVerticalExaggerationStageVS:()=>DM,_shadersViewportQuadFS:()=>m2,_shadersViewportQuadVS:()=>mb,_shadersVoxelFS:()=>l3,_shadersVoxelUtils:()=>c3,_shadersVoxelVS:()=>u3,_shadersWater:()=>iO,_shadersWaterMaskMaterial:()=>nO,_shadersXYZToRGB:()=>pI,_shadersacesTonemapping:()=>LD,_shadersalphaWeight:()=>ND,_shadersantialias:()=>FD,_shadersapplyHSBShift:()=>BD,_shadersapproximateSphericalCoordinates:()=>kD,_shadersapproximateTanh:()=>UD,_shadersbackFacing:()=>VD,_shadersbranchFreeTernary:()=>zD,_shaderscascadeColor:()=>HD,_shaderscascadeDistance:()=>GD,_shaderscascadeMatrix:()=>jD,_shaderscascadeWeights:()=>WD,_shadersclipPolygons:()=>qD,_shaderscolumbusViewMorph:()=>YD,_shaderscomputeAtmosphereColor:()=>XD,_shaderscomputeGroundAtmosphereScattering:()=>KD,_shaderscomputePosition:()=>$D,_shaderscomputeScattering:()=>ZD,_shadersconvertUvToBox:()=>g3,_shadersconvertUvToCylinder:()=>y3,_shadersconvertUvToEllipsoid:()=>b3,_shaderscosineAndSine:()=>QD,_shadersdecompressTextureCoordinates:()=>JD,_shadersdegreesPerRadian:()=>Hv,_shadersdepthClamp:()=>eP,_shadersdepthRange:()=>Gv,_shadersdepthRangeStruct:()=>wD,_shaderseastNorthUpToEyeCoordinates:()=>tP,_shadersellipsoidContainsPoint:()=>nP,_shadersellipsoidTextureCoordinates:()=>iP,_shadersepsilon1:()=>jv,_shadersepsilon2:()=>Wv,_shadersepsilon3:()=>qv,_shadersepsilon4:()=>Yv,_shadersepsilon5:()=>Xv,_shadersepsilon6:()=>Kv,_shadersepsilon7:()=>$v,_shadersequalsEpsilon:()=>oP,_shaderseyeOffset:()=>rP,_shaderseyeToWindowCoordinates:()=>sP,_shadersfastApproximateAtan:()=>aP,_shadersfog:()=>cP,_shadersgammaCorrect:()=>lP,_shadersgeodeticSurfaceNormal:()=>uP,_shadersgetDefaultMaterial:()=>fP,_shadersgetDynamicAtmosphereLightDirection:()=>dP,_shadersgetLambertDiffuse:()=>hP,_shadersgetSpecular:()=>mP,_shadersgetWaterNoise:()=>pP,_shadershue:()=>yP,_shadersinfinity:()=>Zv,_shadersinverseGamma:()=>bP,_shadersisEmpty:()=>xP,_shadersisFull:()=>TP,_shaderslatitudeToWebMercatorFraction:()=>AP,_shaderslineDistance:()=>EP,_shaderslinearToSrgb:()=>CP,_shadersluminance:()=>SP,_shadersmaterial:()=>vD,_shadersmaterialInput:()=>DD,_shadersmaximumComponent:()=>wP,_shadersmetersPerPixel:()=>vP,_shadersmodelMaterial:()=>PD,_shadersmodelToWindowCoordinates:()=>DP,_shadersmodelVertexOutput:()=>ID,_shadersmultiplyWithColorBalance:()=>PP,_shadersnearFarScalar:()=>IP,_shadersoctDecode:()=>OP,_shadersoneOverPi:()=>Qv,_shadersoneOverTwoPi:()=>Jv,_shaderspackDepth:()=>RP,_shaderspassCesium3DTile:()=>eD,_shaderspassCesium3DTileClassification:()=>tD,_shaderspassCesium3DTileClassificationIgnoreShow:()=>nD,_shaderspassClassification:()=>iD,_shaderspassCompute:()=>oD,_shaderspassEnvironment:()=>rD,_shaderspassGlobe:()=>sD,_shaderspassOpaque:()=>aD,_shaderspassOverlay:()=>cD,_shaderspassTerrainClassification:()=>lD,_shaderspassTranslucent:()=>uD,_shaderspassVoxels:()=>fD,_shaderspbrLighting:()=>MP,_shaderspbrNeutralTonemapping:()=>LP,_shadersphong:()=>NP,_shaderspi:()=>dD,_shaderspiOverFour:()=>hD,_shaderspiOverSix:()=>mD,_shaderspiOverThree:()=>pD,_shaderspiOverTwo:()=>_D,_shadersplaneDistance:()=>FP,_shaderspointAlongRay:()=>BP,_shadersradiansPerDegree:()=>gD,_shadersray:()=>OD,_shadersrayEllipsoidIntersectionInterval:()=>kP,_shadersraySegment:()=>RD,_shadersraySphereIntersectionInterval:()=>UP,_shadersreadDepth:()=>VP,_shadersreadNonPerspective:()=>zP,_shadersreverseLogDepth:()=>HP,_shadersround:()=>qP,_shaderssaturation:()=>YP,_shaderssceneMode2D:()=>yD,_shaderssceneMode3D:()=>bD,_shaderssceneModeColumbusView:()=>xD,_shaderssceneModeMorphing:()=>TD,_shadersshadowDepthCompare:()=>XP,_shadersshadowParameters:()=>MD,_shadersshadowVisibility:()=>KP,_shaderssignNotZero:()=>$P,_shaderssolarRadius:()=>AD,_shaderssphericalHarmonics:()=>ZP,_shaderssrgbToLinear:()=>QP,_shaderstangentToEyeSpaceMatrix:()=>JP,_shaderstextureCube:()=>eI,_shadersthreePiOver2:()=>CD,_shaderstransformPlane:()=>tI,_shaderstranslateRelativeToEye:()=>nI,_shaderstranslucentPhong:()=>iI,_shaderstranspose:()=>oI,_shaderstwoPi:()=>ED,_shadersunpackClippingExtents:()=>rI,_shadersunpackDepth:()=>sI,_shadersunpackFloat:()=>aI,_shadersunpackUint:()=>cI,_shadersvalueTransform:()=>lI,_shadersvertexLogDepth:()=>uI,_shaderswebMercatorMaxLatitude:()=>SD,_shaderswindowToEyeCoordinates:()=>fI,_shaderswriteDepthClamp:()=>dI,_shaderswriteLogDepth:()=>hI,_shaderswriteNonPerspective:()=>mI,addBuffer:()=>y1,addDefaults:()=>u1,addExtensionsRequired:()=>p1,addExtensionsUsed:()=>Ff,addPipelineExtras:()=>py,addToArray:()=>vs,appendForwardSlash:()=>dv,arrayRemoveDuplicates:()=>xo,barycentricCoordinates:()=>_b,binarySearch:()=>Lo,buildModuleUrl:()=>tn,buildVoxelDrawCommands:()=>E3,clone:()=>je,combine:()=>xt,computeFlyToLocationForRectangle:()=>VT,createBillboardPointCallback:()=>Lx,createCommand:()=>Sn,createDefaultImageryProviderViewModels:()=>kk,createDefaultTerrainProviderViewModels:()=>Uk,createElevationBandMaterial:()=>ZZ,createGooglePhotorealistic3DTileset:()=>QZ,createGuid:()=>jn,createMaterialPropertyDescriptor:()=>No,createOsmBuildingsAsync:()=>JZ,createPropertyDescriptor:()=>fe,createRawPropertyDescriptor:()=>Yc,createTangentSpaceDebugPrimitive:()=>eQ,createTaskProcessorWorker:()=>NQ,createUniform:()=>wv,createUniformArray:()=>vv,createWorldBathymetryAsync:()=>K3,createWorldImageryAsync:()=>pg,createWorldTerrainAsync:()=>PA,decodeGoogleEarthEnterpriseData:()=>$3,decodeVectorPolylinePositions:()=>EL,defaultValue:()=>lZ,defer:()=>Dl,defined:()=>c,demodernizeShader:()=>_I,deprecationWarning:()=>ws,destroyObject:()=>de,exportKml:()=>MY,findAccessorMinMax:()=>hx,findContentMetadata:()=>Vx,findGroupMetadata:()=>zx,findTileMetadata:()=>DL,forEachTextureInMaterial:()=>HC,formatError:()=>ep,freezeRenderState:()=>Sv,getAbsoluteUri:()=>om,getAccessorByteStride:()=>Ul,getBaseUri:()=>hv,getBinaryAccessor:()=>Eu,getClipAndStyleCode:()=>H3,getClippingFunction:()=>fg,getComponentReader:()=>o_,getElement:()=>In,getExtensionFromUri:()=>rb,getFilenameFromUri:()=>j_,getImageFromTypedArray:()=>S3,getImagePixels:()=>Id,getJsonFromTypedArray:()=>ir,getMagic:()=>Kd,getMetadataClassProperty:()=>M3,getMetadataProperty:()=>N3,getStringFromTypedArray:()=>Fl,getTimestamp:()=>Ti,hasExtension:()=>oi,heightReferenceOnEntityPropertyChanged:()=>qp,isBitSet:()=>Fc,isBlobUri:()=>sb,isCrossOriginUrl:()=>Ug,isDataUri:()=>Ep,isLeapYear:()=>Dd,knockout:()=>xe,knockout_3_5_1:()=>GA,knockout_es5:()=>Dk,loadAndExecuteScript:()=>ab,loadCubeMap:()=>SI,loadImageFromTypedArray:()=>ux,loadKTX2:()=>Il,mergeSort:()=>gg,moveTechniqueRenderStates:()=>m1,moveTechniquesToExtension:()=>_1,numberOfComponentsForType:()=>wu,objectToQuery:()=>cb,oneTimeWarning:()=>dt,parseBatchTable:()=>m_,parseFeatureMetadataLegacy:()=>X1,parseGlb:()=>d1,parseResponseHeaders:()=>mv,parseStructuralMetadata:()=>Y1,pickModel:()=>xE,pointInsideTriangle:()=>IZ,preprocess3DTileContent:()=>I_,processVoxelProperties:()=>C3,queryToObject:()=>hu,readAccessorPacked:()=>b1,removeExtension:()=>mx,removeExtensionsRequired:()=>f1,removeExtensionsUsed:()=>dx,removePipelineExtras:()=>h1,removeUnusedElements:()=>g1,resizeImageToNextPowerOfTwo:()=>yy,sampleTerrain:()=>p2,sampleTerrainMostDetailed:()=>UT,scaleToGeodeticSurface:()=>ob,srgbToLinear:()=>MA,subdivideArray:()=>fO,subscribeAndEvaluate:()=>Da,updateAccessorComponentTypes:()=>x1,updateVersion:()=>T1,usesExtension:()=>mr,viewerCesium3DTilesInspectorMixin:()=>nJ,viewerCesiumInspectorMixin:()=>iJ,viewerDragDropMixin:()=>rJ,viewerPerformanceWatchdogMixin:()=>sJ,viewerVoxelInspectorMixin:()=>aJ,webGLConstantToGlslType:()=>kZ,wrapFunction:()=>tk,writeTextToCanvas:()=>Fx});module.exports=nm(aDt);function wSe(e){return e!=null}var c=wSe;function nb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(nb.prototype=Object.create(Error.prototype),nb.prototype.constructor=nb);nb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` -${this.stack.toString()}`),e};nb.throwInstantiationError=function(){throw new nb("This function defines an interface and should not be called directly.")};var E=nb;var Es={};Es.typeOf={};function vSe(e){return`${e} is required, actual value was undefined`}function YA(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Es.defined=function(e,t){if(!c(t))throw new E(vSe(e))};Es.typeOf.func=function(e,t){if(typeof t!="function")throw new E(YA(typeof t,"function",e))};Es.typeOf.string=function(e,t){if(typeof t!="string")throw new E(YA(typeof t,"string",e))};Es.typeOf.number=function(e,t){if(typeof t!="number")throw new E(YA(typeof t,"number",e))};Es.typeOf.number.lessThan=function(e,t,n){if(Es.typeOf.number(e,t),t>=n)throw new E(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Es.typeOf.number.lessThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t>n)throw new E(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThan=function(e,t,n){if(Es.typeOf.number(e,t),t<=n)throw new E(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Es.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Es.typeOf.number(e,t),t<n)throw new E(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Es.typeOf.object=function(e,t){if(typeof t!="object")throw new E(YA(typeof t,"object",e))};Es.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new E(YA(typeof t,"boolean",e))};Es.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new E(YA(typeof t,"bigint",e))};Es.typeOf.number.equals=function(e,t,n,i){if(Es.typeOf.number(e,n),Es.typeOf.number(t,i),n!==i)throw new E(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var T=Es;var v5=Zo(AU(),1);var st={};st.EPSILON1=.1;st.EPSILON2=.01;st.EPSILON3=.001;st.EPSILON4=1e-4;st.EPSILON5=1e-5;st.EPSILON6=1e-6;st.EPSILON7=1e-7;st.EPSILON8=1e-8;st.EPSILON9=1e-9;st.EPSILON10=1e-10;st.EPSILON11=1e-11;st.EPSILON12=1e-12;st.EPSILON13=1e-13;st.EPSILON14=1e-14;st.EPSILON15=1e-15;st.EPSILON16=1e-16;st.EPSILON17=1e-17;st.EPSILON18=1e-18;st.EPSILON19=1e-19;st.EPSILON20=1e-20;st.EPSILON21=1e-21;st.GRAVITATIONALPARAMETER=3986004418e5;st.SOLAR_RADIUS=6955e5;st.LUNAR_RADIUS=1737400;st.SIXTY_FOUR_KILOBYTES=64*1024;st.FOUR_GIGABYTES=4*1024*1024*1024;st.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};st.signNotZero=function(e){return e<0?-1:1};st.toSNorm=function(e,t){return t=t??255,Math.round((st.clamp(e,-1,1)*.5+.5)*t)};st.fromSNorm=function(e,t){return t=t??255,st.clamp(e,0,t)/t*2-1};st.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:st.clamp((e-t)/n,0,1)};st.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};st.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};st.lerp=function(e,t,n){return(1-n)*e+n*t};st.PI=Math.PI;st.ONE_OVER_PI=1/Math.PI;st.PI_OVER_TWO=Math.PI/2;st.PI_OVER_THREE=Math.PI/3;st.PI_OVER_FOUR=Math.PI/4;st.PI_OVER_SIX=Math.PI/6;st.THREE_PI_OVER_TWO=3*Math.PI/2;st.TWO_PI=2*Math.PI;st.ONE_OVER_TWO_PI=1/(2*Math.PI);st.RADIANS_PER_DEGREE=Math.PI/180;st.DEGREES_PER_RADIAN=180/Math.PI;st.RADIANS_PER_ARCSECOND=st.RADIANS_PER_DEGREE/3600;st.toRadians=function(e){if(!c(e))throw new E("degrees is required.");return e*st.RADIANS_PER_DEGREE};st.toDegrees=function(e){if(!c(e))throw new E("radians is required.");return e*st.DEGREES_PER_RADIAN};st.convertLongitudeRange=function(e){if(!c(e))throw new E("angle is required.");let t=st.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};st.clampToLatitudeRange=function(e){if(!c(e))throw new E("angle is required.");return st.clamp(e,-1*st.PI_OVER_TWO,st.PI_OVER_TWO)};st.negativePiToPi=function(e){if(!c(e))throw new E("angle is required.");return e>=-st.PI&&e<=st.PI?e:st.zeroToTwoPi(e+st.PI)-st.PI};st.zeroToTwoPi=function(e){if(!c(e))throw new E("angle is required.");if(e>=0&&e<=st.TWO_PI)return e;let t=st.mod(e,st.TWO_PI);return Math.abs(t)<st.EPSILON14&&Math.abs(e)>st.EPSILON14?st.TWO_PI:t};st.mod=function(e,t){if(!c(e))throw new E("m is required.");if(!c(t))throw new E("n is required.");if(t===0)throw new E("divisor cannot be 0.");return st.sign(e)===st.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};st.equalsEpsilon=function(e,t,n,i){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");n=n??0,i=i??n;let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};st.lessThan=function(e,t,n){if(!c(e))throw new E("first is required.");if(!c(t))throw new E("second is required.");if(!c(n))throw new E("absoluteEpsilon is required.");return e-t<-n};st.lessThanOrEquals=function(e,t,n){if(!c(e))throw new E("first is required.");if(!c(t))throw new E("second is required.");if(!c(n))throw new E("absoluteEpsilon is required.");return e-t<n};st.greaterThan=function(e,t,n){if(!c(e))throw new E("first is required.");if(!c(t))throw new E("second is required.");if(!c(n))throw new E("absoluteEpsilon is required.");return e-t>n};st.greaterThanOrEquals=function(e,t,n){if(!c(e))throw new E("first is required.");if(!c(t))throw new E("second is required.");if(!c(n))throw new E("absoluteEpsilon is required.");return e-t>-n};var CU=[1];st.factorial=function(e){if(typeof e!="number"||e<0)throw new E("A number greater than or equal to 0 is required.");let t=CU.length;if(e>=t){let n=CU[t-1];for(let i=t;i<=e;i++){let o=n*i;CU.push(o),n=o}}return CU[e]};st.incrementWrap=function(e,t,n){if(n=n??0,!c(e))throw new E("n is required.");if(t<=n)throw new E("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};st.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};st.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new E("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};st.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");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};st.clamp=function(e,t,n){return T.typeOf.number("value",e),T.typeOf.number("min",t),T.typeOf.number("max",n),e<t?t:e>n?n:e};var hJ=new v5.default;st.setRandomNumberSeed=function(e){if(!c(e))throw new E("seed is required.");hJ=new v5.default(e)};st.nextRandomNumber=function(){return hJ.random()};st.randomBetween=function(e,t){return st.nextRandomNumber()*(t-e)+e};st.acosClamped=function(e){if(!c(e))throw new E("value is required.");return Math.acos(st.clamp(e,-1,1))};st.asinClamped=function(e){if(!c(e))throw new E("value is required.");return Math.asin(st.clamp(e,-1,1))};st.chordLength=function(e,t){if(!c(e))throw new E("angle is required.");if(!c(t))throw new E("radius is required.");return 2*t*Math.sin(e*.5)};st.logBase=function(e,t){if(!c(e))throw new E("number is required.");if(!c(t))throw new E("base is required.");return Math.log(e)/Math.log(t)};st.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};st.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};st.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};st.fastApproximateAtan=function(e){return T.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};st.fastApproximateAtan2=function(e,t){T.typeOf.number("x",e),T.typeOf.number("y",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;if(isNaN(r))throw new E("either x or y must be nonzero");return i=st.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?st.PI_OVER_TWO-i:i,i=e<0?st.PI-i:i,i=t<0?-i:i,i};var O=st;function Je(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}Je.fromSpherical=function(e,t){T.typeOf.object("spherical",e),c(t)||(t=new Je);let n=e.clock,i=e.cone,o=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};Je.fromElements=function(e,t,n,i){return c(i)?(i.x=e,i.y=t,i.z=n,i):new Je(e,t,n)};Je.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Je(e.x,e.y,e.z)};Je.fromCartesian4=Je.clone;Je.packedLength=3;Je.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Je.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Je),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Je.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*3;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Je.pack(e[o],t,o*3);return t};Je.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new E("array length must be a multiple of 3.");let n=e.length;c(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=Je.unpack(e,i,t[o])}return t};Je.fromArray=Je.unpack;Je.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)};Je.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)};Je.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};Je.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};Je.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y),s=O.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Je.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z};Je.magnitude=function(e){return Math.sqrt(Je.magnitudeSquared(e))};var SU=new Je;Je.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Je.subtract(e,t,SU),Je.magnitude(SU)};Je.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Je.subtract(e,t,SU),Je.magnitudeSquared(SU)};Je.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Je.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new E("normalized result is not a number");return t};Je.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z};Je.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Je.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Je.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Je.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Je.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Je.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Je.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Je.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var mJ=new Je;Je.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),Je.multiplyByScalar(t,n,mJ),i=Je.multiplyByScalar(e,1-n,i),Je.add(mJ,i,i)};var EU=new Je,D5=new Je;Je.angleBetween=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",t),Je.normalize(e,EU),Je.normalize(t,D5);let n=Je.dot(EU,D5),i=Je.magnitude(Je.cross(EU,D5,EU));return Math.atan2(i,n)};var DSe=new Je;Je.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Je.normalize(e,DSe);return Je.abs(n,n),n.x<=n.y?n.x<=n.z?t=Je.clone(Je.UNIT_X,t):t=Je.clone(Je.UNIT_Z,t):n.y<=n.z?t=Je.clone(Je.UNIT_Y,t):t=Je.clone(Je.UNIT_Z,t),t};Je.projectVector=function(e,t,n){T.defined("a",e),T.defined("b",t),T.defined("result",n);let i=Je.dot(e,t)/Je.dot(t,t);return Je.multiplyByScalar(t,i,n)};Je.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Je.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Je.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)&&O.equalsEpsilon(e.z,t.z,n,i)};Je.cross=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,l=t.z,u=o*l-r*a,f=r*s-i*l,h=i*a-o*s;return n.x=u,n.y=f,n.z=h,n};Je.midpoint=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Je.fromDegrees=function(e,t,n,i,o){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),Je.fromRadians(e,t,n,i,o)};var gf=new Je,XA=new Je;Je._ellipsoidRadiiSquared=new Je(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Je.fromRadians=function(e,t,n,i,o){T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0;let r=c(i)?i.radiiSquared:Je._ellipsoidRadiiSquared,s=Math.cos(t);gf.x=s*Math.cos(e),gf.y=s*Math.sin(e),gf.z=Math.sin(t),gf=Je.normalize(gf,gf),Je.multiplyComponents(r,gf,XA);let a=Math.sqrt(Je.dot(gf,XA));return XA=Je.divideByScalar(XA,a,XA),gf=Je.multiplyByScalar(gf,n,gf),c(o)||(o=new Je),Je.add(XA,gf,o)};Je.fromDegreesArray=function(e,t,n){if(T.defined("coordinates",e),e.length<2||e.length%2!==0)throw new E("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(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]=Je.fromDegrees(r,s,0,t,n[a])}return n};Je.fromRadiansArray=function(e,t,n){if(T.defined("coordinates",e),e.length<2||e.length%2!==0)throw new E("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(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]=Je.fromRadians(r,s,0,t,n[a])}return n};Je.fromDegreesArrayHeights=function(e,t,n){if(T.defined("coordinates",e),e.length<3||e.length%3!==0)throw new E("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(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],l=o/3;n[l]=Je.fromDegrees(r,s,a,t,n[l])}return n};Je.fromRadiansArrayHeights=function(e,t,n){if(T.defined("coordinates",e),e.length<3||e.length%3!==0)throw new E("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(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],l=o/3;n[l]=Je.fromRadians(r,s,a,t,n[l])}return n};Je.ZERO=Object.freeze(new Je(0,0,0));Je.ONE=Object.freeze(new Je(1,1,1));Je.UNIT_X=Object.freeze(new Je(1,0,0));Je.UNIT_Y=Object.freeze(new Je(0,1,0));Je.UNIT_Z=Object.freeze(new Je(0,0,1));Je.prototype.clone=function(e){return Je.clone(this,e)};Je.prototype.equals=function(e){return Je.equals(this,e)};Je.prototype.equalsEpsilon=function(e,t,n){return Je.equalsEpsilon(this,e,t,n)};Je.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var d=Je;function bt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}bt.fromElements=function(e,t,n,i,o){return c(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new bt(e,t,n,i)};bt.fromColor=function(e,t){return T.typeOf.object("color",e),c(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new bt(e.red,e.green,e.blue,e.alpha)};bt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new bt(e.x,e.y,e.z,e.w)};bt.packedLength=4;bt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};bt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new bt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};bt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)bt.pack(e[o],t,o*4);return t};bt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new E("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=bt.unpack(e,i,t[o])}return t};bt.fromArray=bt.unpack;bt.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};bt.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};bt.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};bt.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};bt.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y),s=O.clamp(e.z,t.z,n.z),a=O.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};bt.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};bt.magnitude=function(e){return Math.sqrt(bt.magnitudeSquared(e))};var wU=new bt;bt.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),bt.subtract(e,t,wU),bt.magnitude(wU)};bt.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),bt.subtract(e,t,wU),bt.magnitudeSquared(wU)};bt.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=bt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new E("normalized result is not a number");return t};bt.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};bt.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};bt.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};bt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};bt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};bt.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};bt.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};bt.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};bt.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),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 pJ=new bt;bt.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),bt.multiplyByScalar(t,n,pJ),i=bt.multiplyByScalar(e,1-n,i),bt.add(pJ,i,i)};var PSe=new bt;bt.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=bt.normalize(e,PSe);return bt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=bt.clone(bt.UNIT_X,t):t=bt.clone(bt.UNIT_W,t):n.z<=n.w?t=bt.clone(bt.UNIT_Z,t):t=bt.clone(bt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=bt.clone(bt.UNIT_Y,t):t=bt.clone(bt.UNIT_W,t):n.z<=n.w?t=bt.clone(bt.UNIT_Z,t):t=bt.clone(bt.UNIT_W,t),t};bt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};bt.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]};bt.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)&&O.equalsEpsilon(e.z,t.z,n,i)&&O.equalsEpsilon(e.w,t.w,n,i)};bt.ZERO=Object.freeze(new bt(0,0,0,0));bt.ONE=Object.freeze(new bt(1,1,1,1));bt.UNIT_X=Object.freeze(new bt(1,0,0,0));bt.UNIT_Y=Object.freeze(new bt(0,1,0,0));bt.UNIT_Z=Object.freeze(new bt(0,0,1,0));bt.UNIT_W=Object.freeze(new bt(0,0,0,1));bt.prototype.clone=function(e){return bt.clone(this,e)};bt.prototype.equals=function(e){return bt.equals(this,e)};bt.prototype.equalsEpsilon=function(e,t,n){return bt.equalsEpsilon(this,e,t,n)};bt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var P5=new Float32Array(1),nc=new Uint8Array(P5.buffer),ISe=new Uint32Array([287454020]),OSe=new Uint8Array(ISe.buffer),_J=OSe[0]===68;bt.packFloat=function(e,t){return T.typeOf.number("value",e),c(t)||(t=new bt),P5[0]=e,_J?(t.x=nc[0],t.y=nc[1],t.z=nc[2],t.w=nc[3]):(t.x=nc[3],t.y=nc[2],t.z=nc[1],t.w=nc[0]),t};bt.unpackFloat=function(e){return T.typeOf.object("packedFloat",e),_J?(nc[0]=e.x,nc[1]=e.y,nc[2]=e.z,nc[3]=e.w):(nc[0]=e.w,nc[1]=e.z,nc[2]=e.y,nc[3]=e.x),P5[0]};var se=bt;var I5={};I5.EMPTY_OBJECT=Object.freeze({});I5.EMPTY_ARRAY=Object.freeze([]);var W=I5;function tt(e,t,n,i,o,r,s,a,l){this[0]=e??0,this[1]=i??0,this[2]=s??0,this[3]=t??0,this[4]=o??0,this[5]=a??0,this[6]=n??0,this[7]=r??0,this[8]=l??0}tt.packedLength=9;tt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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};tt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(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};tt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*9;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)tt.pack(e[o],t,o*9);return t};tt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new E("array length must be a multiple of 9.");let n=e.length;c(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(c(e))return c(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 tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return T.defined("values",e),tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return T.defined("values",e),c(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 tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){T.typeOf.object("quaternion",e);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,l=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-s-u+h,g=2*(i-f),m=2*(o+l),y=2*(i+f),b=-n+s-u+h,x=2*(a-r),A=2*(o-l),C=2*(a+r),S=-n-s+u+h;return c(t)?(t[0]=p,t[1]=y,t[2]=A,t[3]=g,t[4]=b,t[5]=C,t[6]=m,t[7]=x,t[8]=S,t):new tt(p,g,m,y,b,x,A,C,S)};tt.fromHeadingPitchRoll=function(e,t){T.typeOf.object("headingPitchRoll",e);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),l=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,h=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,m=-r,y=a*n,b=o*n;return c(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=y,t[6]=f,t[7]=g,t[8]=b,t):new tt(l,u,f,h,p,g,m,y,b)};tt.fromScale=function(e,t){return T.typeOf.object("scale",e),c(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 tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(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 tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return T.typeOf.object("vector",e),c(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 tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return T.typeOf.object("matrix",e),c(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]]};tt.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,2),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,2),e*3+t};tt.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("result",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};tt.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("result",n);let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};tt.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var RSe=new d;tt.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=tt.getScale(e,RSe),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 MSe=new d;tt.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=tt.getScale(e,MSe),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 O5=new d;tt.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],O5)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],O5)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],O5)),t};var gJ=new d;tt.getMaximumScale=function(e){return tt.getScale(e,gJ),d.maximumComponent(gJ)};var LSe=new d;tt.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=tt.getScale(e,LSe);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 NSe=new d;tt.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=tt.getScale(e,NSe);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};tt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",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],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=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]=l,n[6]=u,n[7]=f,n[8]=h,n};tt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};tt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};tt.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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,l=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=l,n};tt.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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};tt.multiplyByScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n),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};tt.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),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};tt.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",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};tt.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],l=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=l,t[7]=u,t[8]=f,t};function FSe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var R5=[1,0,0],M5=[2,2,1];function BSe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(M5[n],R5[n])];t+=2*i*i}return Math.sqrt(t)}function kSe(e,t){let n=O.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex(M5[u],R5[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=R5[o],l=M5[o];if(Math.abs(e[tt.getElementIndex(l,a)])>n){let u=e[tt.getElementIndex(l,l)],f=e[tt.getElementIndex(a,a)],h=e[tt.getElementIndex(l,a)],p=(u-f)/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=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(l,l)]=r,t[tt.getElementIndex(l,a)]=s,t[tt.getElementIndex(a,l)]=-s,t}var vU=new tt,yJ=new tt;tt.computeEigenDecomposition=function(e,t){T.typeOf.object("matrix",e);let n=O.EPSILON20,i=10,o=0,r=0;c(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),l=n*FSe(a);for(;r<i&&BSe(a)>l;)kSe(a,vU),tt.transpose(vU,yJ),tt.multiply(a,vU,a),tt.multiply(yJ,a,a),tt.multiply(s,vU,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};tt.determinant=function(e){T.typeOf.object("matrix",e);let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],l=e[5],u=e[8];return t*(r*u-l*s)+o*(l*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=tt.determinant(e);if(Math.abs(h)<=O.EPSILON15)throw new E("matrix is not invertible");t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=l*a-r*f,t[4]=n*f-l*o,t[5]=r*o-n*a,t[6]=r*u-l*s,t[7]=l*i-n*u,t[8]=n*s-r*i;let p=1/h;return tt.multiplyByScalar(t,p,t)};var USe=new tt;tt.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),tt.inverse(tt.transpose(e,USe),t)};tt.equals=function(e,t){return e===t||c(e)&&c(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]};tt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;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]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f})();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJ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AEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])}))});var o9t={};vq(o9t,{AlphaMode:()=>Wp,AlphaPipelineStage:()=>TB,AnchorPointDirect:()=>vF,AnchorPointIndirect:()=>SF,Animation:()=>C8,AnimationViewModel:()=>v8,Appearance:()=>Dr,ApproximateTerrainHeights:()=>Mi,ArcGISTiledElevationTerrainProvider:()=>dK,ArcGisBaseMapType:()=>wm,ArcGisMapServerImageryProvider:()=>y_,ArcGisMapService:()=>Hf,ArcType:()=>ln,ArticulationStageType:()=>Qc,AssociativeArray:()=>Ut,Atmosphere:()=>WT,AtmospherePipelineStage:()=>QF,AttributeCompression:()=>cn,AttributeType:()=>Vt,AutoExposure:()=>yV,AutomaticUniforms:()=>tg,Axis:()=>zi,AxisAlignedBoundingBox:()=>Pf,Azure2DImageryProvider:()=>r2,B3dmLoader:()=>VF,B3dmParser:()=>kF,BaseLayerPicker:()=>D8,BaseLayerPickerViewModel:()=>P8,BatchTable:()=>yT,BatchTableHierarchy:()=>zT,BatchTexture:()=>su,BatchTexturePipelineStage:()=>EB,Billboard:()=>Br,BillboardCollection:()=>$f,BillboardGraphics:()=>fl,BillboardLoadState:()=>qs,BillboardTexture:()=>E_,BillboardVisualizer:()=>tL,BingMapsGeocoderService:()=>pK,BingMapsImageryProvider:()=>XB,BingMapsStyle:()=>_w,BlendEquation:()=>Fc,BlendFunction:()=>Zr,BlendOption:()=>Fi,BlendingState:()=>tn,BoundingRectangle:()=>et,BoundingSphere:()=>ce,BoundingSphereState:()=>Pt,BoundingVolumeSemantics:()=>LA,BoxEmitter:()=>ece,BoxGeometry:()=>Ic,BoxGeometryUpdater:()=>oF,BoxGraphics:()=>vT,BoxOutlineGeometry:()=>$h,BrdfLutGenerator:()=>pz,Buffer:()=>tt,BufferLoader:()=>vx,BufferPoint:()=>Vc,BufferPointCollection:()=>ef,BufferPointMaterial:()=>Bm,BufferPolygon:()=>No,BufferPolygonCollection:()=>za,BufferPolygonMaterial:()=>Bf,BufferPolyline:()=>xa,BufferPolylineCollection:()=>ul,BufferPolylineMaterial:()=>kf,BufferPrimitive:()=>os,BufferPrimitiveCollection:()=>oa,BufferPrimitiveMaterial:()=>Ql,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>wB,CallbackPositionProperty:()=>sF,CallbackProperty:()=>_m,Camera:()=>Or,CameraEventAggregator:()=>CV,CameraEventType:()=>cr,CameraFlightPath:()=>_z,Cartesian2:()=>U,Cartesian3:()=>h,Cartesian4:()=>se,CartesianRectangle:()=>Iw,Cartographic:()=>he,CartographicGeocoderService:()=>_K,CatmullRomSpline:()=>yK,Cesium3DContentGroup:()=>UT,Cesium3DTile:()=>fh,Cesium3DTileBatchTable:()=>Am,Cesium3DTileColorBlendMode:()=>Yu,Cesium3DTileContent:()=>rce,Cesium3DTileContentFactory:()=>pE,Cesium3DTileContentState:()=>Rr,Cesium3DTileContentType:()=>Sa,Cesium3DTileFeature:()=>sa,Cesium3DTileFeatureTable:()=>Em,Cesium3DTileOptimizationHint:()=>lh,Cesium3DTileOptimizations:()=>Xk,Cesium3DTilePass:()=>ao,Cesium3DTilePassState:()=>Sh,Cesium3DTilePointFeature:()=>C_,Cesium3DTileRefine:()=>bo,Cesium3DTileStyle:()=>P_,Cesium3DTileStyleEngine:()=>Zk,Cesium3DTileVectorFeature:()=>dE,Cesium3DTilesInspector:()=>uj,Cesium3DTilesInspectorViewModel:()=>lj,Cesium3DTilesTerrainData:()=>YO,Cesium3DTilesTerrainGeometryProcessor:()=>Nv,Cesium3DTilesTerrainProvider:()=>O$,Cesium3DTilesVoxelProvider:()=>oce,Cesium3DTileset:()=>Ko,Cesium3DTilesetBaseTraversal:()=>i3,Cesium3DTilesetCache:()=>Kk,Cesium3DTilesetGraphics:()=>OT,Cesium3DTilesetHeatmap:()=>$k,Cesium3DTilesetMetadata:()=>TE,Cesium3DTilesetMostDetailedTraversal:()=>e3,Cesium3DTilesetSkipTraversal:()=>s3,Cesium3DTilesetStatistics:()=>Um,Cesium3DTilesetTraversal:()=>Xa,Cesium3DTilesetVisualizer:()=>a3,CesiumInspector:()=>I8,CesiumInspectorViewModel:()=>w8,CesiumTerrainProvider:()=>Lx,CesiumWidget:()=>N4,Check:()=>Wr,CheckerboardMaterialProperty:()=>Gw,CircleEmitter:()=>G4,CircleGeometry:()=>H$,CircleOutlineGeometry:()=>G$,ClassificationModelDrawCommand:()=>G2,ClassificationPipelineStage:()=>CB,ClassificationPrimitive:()=>HS,ClassificationType:()=>ti,ClearCommand:()=>li,ClippingPlane:()=>aa,ClippingPlaneCollection:()=>Is,ClippingPolygon:()=>tw,ClippingPolygonCollection:()=>Bc,Clock:()=>im,ClockRange:()=>As,ClockStep:()=>zr,ClockViewModel:()=>x8,CloudCollection:()=>uce,CloudType:()=>zP,Color:()=>z,ColorBlendMode:()=>gl,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>Kt,Command:()=>Cle,ComponentDatatype:()=>Y,Composite3DTileContent:()=>lF,CompositeEntityCollection:()=>hne,CompositeMaterialProperty:()=>qw,CompositePositionProperty:()=>_c,CompositeProperty:()=>bl,CompressedTextureBuffer:()=>TD,ComputeCommand:()=>bf,ComputeEngine:()=>xD,ConditionsExpression:()=>Rk,ConeEmitter:()=>dce,ConstantPositionProperty:()=>nu,ConstantProperty:()=>_i,ConstantSpline:()=>TM,ContentMetadata:()=>Vk,Context:()=>Ax,ContextLimits:()=>kt,Controller:()=>lle,ControllerHost:()=>bz,CoplanarPolygonGeometry:()=>PM,CoplanarPolygonGeometryLibrary:()=>Sg,CoplanarPolygonOutlineGeometry:()=>Ud,CornerType:()=>nr,CorrelationGroup:()=>wF,CorridorGeometry:()=>Hx,CorridorGeometryLibrary:()=>dr,CorridorGeometryUpdater:()=>l3,CorridorGraphics:()=>wT,CorridorOutlineGeometry:()=>FM,Credit:()=>It,CreditDisplay:()=>Ez,CubeMap:()=>ns,CubeMapFace:()=>OD,CubeMapPanorama:()=>FC,CubicRealPolynomial:()=>fx,CullFace:()=>Vi,CullingVolume:()=>ta,CumulusCloud:()=>Ad,CustomDataSource:()=>m3,CustomHeightmapTerrainProvider:()=>uJ,CustomShader:()=>W0,CustomShaderMode:()=>__,CustomShaderPipelineStage:()=>NB,CustomShaderTranslucencyMode:()=>zA,CylinderGeometry:()=>UM,CylinderGeometryLibrary:()=>Wx,CylinderGeometryUpdater:()=>p3,CylinderGraphics:()=>IT,CylinderOutlineGeometry:()=>zM,CzmlDataSource:()=>T3,DataSource:()=>Ms,DataSourceClock:()=>jm,DataSourceCollection:()=>E3,DataSourceDisplay:()=>X3,DebugAppearance:()=>_ce,DebugCameraPrimitive:()=>k0,DebugInspector:()=>FV,DebugModelMatrixPrimitive:()=>Y4,DefaultProxy:()=>gJ,DepthFunction:()=>hc,DepthPlane:()=>Iz,DequantizationPipelineStage:()=>FB,DerivedCommand:()=>cp,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>Pz,DirectionalLight:()=>xce,DiscardEmptyTileImagePolicy:()=>yw,DiscardMissingTileImagePolicy:()=>qB,DistanceDisplayCondition:()=>Ht,DistanceDisplayConditionGeometryInstanceAttribute:()=>ei,DoubleEndedPriorityQueue:()=>_g,DoublyLinkedList:()=>WM,DracoLoader:()=>bg,DrawCommand:()=>at,DynamicAtmosphereLightingType:()=>o_,DynamicEnvironmentMapManager:()=>s_,DynamicGeometryBatch:()=>PE,DynamicGeometryUpdater:()=>Ii,EarthOrientationParameters:()=>hD,EarthOrientationParametersSample:()=>Sy,EasingFunction:()=>xs,EdgeDetectionPipelineStage:()=>kB,EdgeDisplayMode:()=>Qd,EdgeFramebuffer:()=>Lz,EdgeVisibilityPipelineStage:()=>VB,EllipseGeometry:()=>ql,EllipseGeometryLibrary:()=>Vu,EllipseGeometryUpdater:()=>v3,EllipseGraphics:()=>PT,EllipseOutlineGeometry:()=>Rf,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>Pg,EllipsoidGeometry:()=>Ua,EllipsoidGeometryUpdater:()=>w3,EllipsoidGraphics:()=>DT,EllipsoidOutlineGeometry:()=>Nf,EllipsoidPrimitive:()=>uz,EllipsoidRhumbLine:()=>Nc,EllipsoidSurfaceAppearance:()=>Tce,EllipsoidTangentPlane:()=>Vs,EllipsoidTerrainProvider:()=>Zp,EllipsoidalOccluder:()=>Xh,Empty3DTileContent:()=>p0,EncodedCartesian3:()=>Sn,Entity:()=>Qr,EntityCluster:()=>ed,EntityCollection:()=>Ka,EntityView:()=>$3,EquirectangularPanorama:()=>Ece,Event:()=>be,EventHelper:()=>Go,Expression:()=>Zd,ExpressionNodeType:()=>Mt,ExtrapolationType:()=>Kl,FeatureDetection:()=>dn,FeatureIdPipelineStage:()=>UA,Fog:()=>Dz,ForEach:()=>ke,FrameRateMonitor:()=>Q4,FrameState:()=>tb,Framebuffer:()=>_s,FramebufferManager:()=>ai,Frozen:()=>H,FrustumCommands:()=>Bz,FrustumGeometry:()=>Xx,FrustumOutlineGeometry:()=>KM,Fullscreen:()=>es,FullscreenButton:()=>N8,FullscreenButtonViewModel:()=>M8,GaussianSplat3DTileContent:()=>JA,GaussianSplatPrimitive:()=>zk,GaussianSplatRenderResources:()=>Lk,GaussianSplatSorter:()=>hE,GaussianSplatTextureGenerator:()=>Nk,GeoJsonDataSource:()=>Cb,GeoJsonLoader:()=>jF,GeoJsonPrimitive:()=>wce,GeocodeType:()=>uA,Geocoder:()=>F8,GeocoderService:()=>gS,GeocoderViewModel:()=>L8,GeographicProjection:()=>Ui,GeographicTilingScheme:()=>Qi,Geometry:()=>St,Geometry3DTileContent:()=>dF,GeometryAttribute:()=>Ne,GeometryAttributes:()=>Tn,GeometryFactory:()=>EJ,GeometryInstance:()=>Ft,GeometryInstanceAttribute:()=>il,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Hn,GeometryPipelineStage:()=>WB,GeometryType:()=>Sd,GeometryUpdater:()=>Pi,GeometryUpdaterSet:()=>OE,GeometryVisualizer:()=>N3,GetFeatureInfoFormat:()=>Im,Globe:()=>lz,GlobeDepth:()=>kz,GlobeSurfaceShaderSet:()=>ZU,GlobeSurfaceTile:()=>Ch,GlobeSurfaceTileProvider:()=>ez,GlobeTranslucency:()=>tz,GlobeTranslucencyFramebuffer:()=>Uz,GlobeTranslucencyState:()=>Rz,GltfBufferViewLoader:()=>Bv,GltfDracoLoader:()=>kv,GltfGpmLoader:()=>PF,GltfGpmLocal:()=>ow,GltfImageLoader:()=>Uv,GltfIndexBufferLoader:()=>zv,GltfJsonLoader:()=>jv,GltfLoader:()=>jf,GltfLoaderUtil:()=>Uu,GltfMeshPrimitiveGpmLoader:()=>MF,GltfSpzLoader:()=>mM,GltfStructuralMetadataLoader:()=>EF,GltfTextureLoader:()=>qv,GltfVertexBufferLoader:()=>Yv,Google2DImageryProvider:()=>i2,GoogleEarthEnterpriseImageryProvider:()=>Pce,GoogleEarthEnterpriseMapsProvider:()=>JB,GoogleEarthEnterpriseMetadata:()=>Bg,GoogleEarthEnterpriseTerrainData:()=>_S,GoogleEarthEnterpriseTerrainProvider:()=>DJ,GoogleEarthEnterpriseTileInformation:()=>ZM,GoogleGeocoderService:()=>OJ,GoogleMaps:()=>Aa,GoogleStreetViewCubeMapPanoramaProvider:()=>Dce,GpxDataSource:()=>VU,GregorianDate:()=>Bh,GridImageryProvider:()=>Rce,GridMaterialProperty:()=>Jw,GroundGeometryUpdater:()=>ii,GroundPolylineGeometry:()=>$x,GroundPolylinePrimitive:()=>dm,GroundPrimitive:()=>tu,GroupMetadata:()=>Vw,HeadingPitchRange:()=>Hd,HeadingPitchRoll:()=>wc,Heap:()=>lD,HeightReference:()=>We,HeightmapEncoding:()=>Md,HeightmapTerrainData:()=>Rc,HeightmapTessellator:()=>vv,HermitePolynomialApproximation:()=>eN,HermiteSpline:()=>Hy,HilbertOrder:()=>AS,HomeButton:()=>k8,HomeButtonViewModel:()=>B8,HorizontalOrigin:()=>Hi,HybridScreenSpacePanCameraController:()=>mle,I3SBuildingSceneLayerExplorer:()=>Ole,I3SBuildingSceneLayerExplorerViewModel:()=>U8,I3SDataProvider:()=>gp,I3SDecoder:()=>e8,I3SFeature:()=>t8,I3SField:()=>n8,I3SGeometry:()=>HP,I3SLayer:()=>qC,I3SNode:()=>GP,I3SStatistics:()=>o8,I3SSublayer:()=>a8,I3SSymbology:()=>r8,I3dmLoader:()=>GF,I3dmParser:()=>HF,ITwinData:()=>Lce,ITwinPlatform:()=>ia,Iau2000Orientation:()=>nN,Iau2006XysData:()=>mD,Iau2006XysSample:()=>ax,IauOrientationAxes:()=>iN,IauOrientationParameters:()=>tN,ImageBasedLighting:()=>kT,ImageBasedLightingPipelineStage:()=>tB,ImageMaterialProperty:()=>DA,Imagery:()=>Sw,ImageryConfiguration:()=>ek,ImageryCoverage:()=>Pw,ImageryFlags:()=>a2,ImageryInput:()=>l2,ImageryLayer:()=>Rs,ImageryLayerCollection:()=>EE,ImageryLayerFeatureInfo:()=>Sm,ImageryPipelineStage:()=>u2,ImageryProvider:()=>Gf,ImageryState:()=>Vn,Implicit3DTileContent:()=>ZS,ImplicitAvailabilityBitstream:()=>Lv,ImplicitMetadataView:()=>Fv,ImplicitSubdivisionScheme:()=>Hs,ImplicitSubtree:()=>Eg,ImplicitSubtreeCache:()=>j4,ImplicitSubtreeMetadata:()=>JO,ImplicitTileCoordinates:()=>qp,ImplicitTileset:()=>Yp,IndexDatatype:()=>je,InfoBox:()=>V8,InfoBoxViewModel:()=>z8,InspectorShared:()=>yf,InstanceAttributeSemantic:()=>Lo,InstancingPipelineStage:()=>yB,InterpolationAlgorithm:()=>YJ,InterpolationType:()=>am,Intersect:()=>$t,IntersectionTests:()=>pi,Intersections2D:()=>Jh,Interval:()=>Us,InvertClassification:()=>SP,Ion:()=>zu,IonGeocodeProviderType:()=>Ug,IonGeocoderService:()=>Jx,IonImageryProvider:()=>lu,IonImageryProviderFactory:()=>Cw,IonResource:()=>Ho,IonSnapGeometryType:()=>$J,IonSnapHeat:()=>JJ,IonSnapMode:()=>oN,IonSnapParentGeometryType:()=>ZJ,IonSnapService:()=>QJ,IonWorldImageryStyle:()=>b_,Iso8601:()=>nt,JobScheduler:()=>Oz,JobType:()=>Oc,JsonMetadataTable:()=>a_,JulianDate:()=>K,KTX2Transcoder:()=>ED,KeyboardEventModifier:()=>Jr,KeyframeNode:()=>Hr,KmlCamera:()=>jU,KmlDataSource:()=>aC,KmlLookAt:()=>HU,KmlTour:()=>GU,KmlTourFlyTo:()=>WU,KmlTourWait:()=>qU,Label:()=>qA,LabelCollection:()=>h0,LabelGraphics:()=>mm,LabelStyle:()=>xo,LabelVisualizer:()=>L3,LagrangePolynomialApproximation:()=>sN,LeapSecond:()=>yr,Light:()=>Fce,LightingModel:()=>u0,LightingPipelineStage:()=>d2,LinearApproximation:()=>mA,LinearSpline:()=>jy,MVTDataProvider:()=>Uce,ManagedArray:()=>Zl,MapMode2D:()=>yu,MapProjection:()=>iZ,MapboxImageryProvider:()=>ZB,MapboxStyleImageryProvider:()=>Bce,MappedPositions:()=>c2,Material:()=>or,MaterialAppearance:()=>Er,MaterialPipelineStage:()=>g2,MaterialProperty:()=>Ao,Math:()=>D,Matrix2:()=>Xi,Matrix3:()=>$,Matrix4:()=>N,Megatexture:()=>a4,MeshPrimitiveGpmLocal:()=>OF,MetadataClass:()=>tm,MetadataClassProperty:()=>jp,MetadataComponentType:()=>Lt,MetadataEntity:()=>Yn,MetadataEnum:()=>_M,MetadataEnumValue:()=>gM,MetadataPicking:()=>Mz,MetadataPickingPipelineStage:()=>Yf,MetadataPipelineStage:()=>eh,MetadataSchema:()=>Gl,MetadataSchemaLoader:()=>Zy,MetadataSemantic:()=>kd,MetadataTable:()=>Ld,MetadataTableProperty:()=>tM,MetadataType:()=>bt,MipmapHint:()=>Pd,Model:()=>Xf,Model3DTileContent:()=>Kf,ModelAlphaOptions:()=>iE,ModelAnimation:()=>qF,ModelAnimationChannel:()=>WF,ModelAnimationCollection:()=>YF,ModelAnimationLoop:()=>Ku,ModelAnimationState:()=>Cm,ModelArticulation:()=>iB,ModelArticulationStage:()=>nB,ModelClippingPlanesPipelineStage:()=>sB,ModelClippingPolygonsPipelineStage:()=>lB,ModelColorPipelineStage:()=>kA,ModelComponents:()=>En,ModelDrawCommand:()=>W2,ModelDrawCommands:()=>X2,ModelFeature:()=>XF,ModelFeatureTable:()=>KF,ModelGraphics:()=>Zg,ModelImagery:()=>tk,ModelImageryMapping:()=>eE,ModelLightingOptions:()=>V2,ModelMatrixUpdateStage:()=>AB,ModelNode:()=>hB,ModelPrimitiveImagery:()=>tE,ModelReader:()=>Ea,ModelRenderResources:()=>N2,ModelRuntimeNode:()=>xB,ModelRuntimePrimitive:()=>O2,ModelSceneGraph:()=>K2,ModelSilhouettePipelineStage:()=>B2,ModelSkin:()=>M2,ModelSplitterPipelineStage:()=>U2,ModelStatistics:()=>$2,ModelType:()=>Yo,ModelUtility:()=>xt,ModelVectorLookupPipelineStage:()=>dB,ModelVisualizer:()=>B3,Moon:()=>dz,MorphTargetsPipelineStage:()=>y2,MorphWeightSpline:()=>aZ,MortonOrder:()=>Qy,MouseButton:()=>ec,Multiple3DTileContent:()=>Gk,MultisampleFramebuffer:()=>vO,NavigationHelpButton:()=>H8,NavigationHelpButtonViewModel:()=>j8,NearFarScalar:()=>qt,NeverTileDiscardPolicy:()=>Vce,NodeRenderResources:()=>z2,NodeStatisticsPipelineStage:()=>bB,NodeTransformationProperty:()=>RT,OIT:()=>Vz,Occluder:()=>aN,OffsetGeometryInstanceAttribute:()=>Tr,OpenCageGeocoderService:()=>uZ,OpenStreetMapImageryProvider:()=>by,OrderedGroundPrimitiveCollection:()=>C3,OrientedBoundingBox:()=>en,OrthographicFrustum:()=>gn,OrthographicOffCenterFrustum:()=>ys,Packable:()=>fZ,PackableForInterpolation:()=>dZ,Panorama:()=>jce,PanoramaProvider:()=>Hce,Particle:()=>YP,ParticleBurst:()=>Wce,ParticleEmitter:()=>qce,ParticleSystem:()=>Yce,Pass:()=>Ie,PassState:()=>sc,PathGraphics:()=>Qg,PathMode:()=>_0,PathVisualizer:()=>V3,PeliasGeocoderService:()=>rN,PerInstanceColorAppearance:()=>yn,PerformanceDisplay:()=>ay,PerformanceWatchdog:()=>W8,PerformanceWatchdogViewModel:()=>G8,PerspectiveFrustum:()=>Ki,PerspectiveOffCenterFrustum:()=>$l,PickDepth:()=>Nz,PickDepthFramebuffer:()=>Hz,PickFramebuffer:()=>Gz,PickId:()=>BD,PickedMetadataInfo:()=>h4,Picking:()=>Zz,PickingPipelineStage:()=>A2,PinBuilder:()=>zg,PixelDatatype:()=>ze,PixelFormat:()=>Ke,PlanarFillIdFramebuffer:()=>Fz,Plane:()=>sn,PlaneGeometry:()=>fN,PlaneGeometryUpdater:()=>I3,PlaneGraphics:()=>ZL,PlaneOutlineGeometry:()=>dN,PntsLoader:()=>Z2,PntsParser:()=>oE,PointCloud:()=>O4,PointCloudEyeDomeLighting:()=>l_,PointCloudShading:()=>a0,PointCloudStylingPipelineStage:()=>x2,PointGraphics:()=>MT,PointPrimitive:()=>Pa,PointPrimitiveCollection:()=>Xw,PointVisualizer:()=>H3,PolygonGeometry:()=>r0,PolygonGeometryLibrary:()=>Qn,PolygonGeometryUpdater:()=>P3,PolygonGraphics:()=>pm,PolygonHierarchy:()=>Lc,PolygonOutlineGeometry:()=>hN,PolygonPipeline:()=>ui,Polyline:()=>oh,PolylineArrowMaterialProperty:()=>Qw,PolylineCollection:()=>Nm,PolylineColorAppearance:()=>Ws,PolylineDashMaterialProperty:()=>tI,PolylineGeometry:()=>Vg,PolylineGeometryUpdater:()=>W3,PolylineGlowMaterialProperty:()=>iI,PolylineGraphics:()=>dl,PolylineMaterialAppearance:()=>mc,PolylineOutlineMaterialProperty:()=>ab,PolylinePipeline:()=>ir,PolylineVisualizer:()=>Y3,PolylineVolumeGeometry:()=>_N,PolylineVolumeGeometryLibrary:()=>rm,PolylineVolumeGeometryUpdater:()=>D3,PolylineVolumeGraphics:()=>NT,PolylineVolumeOutlineGeometry:()=>bN,PositionProperty:()=>hm,PositionPropertyArray:()=>z_,PostProcessStage:()=>Ur,PostProcessStageCollection:()=>xV,PostProcessStageComposite:()=>df,PostProcessStageLibrary:()=>pd,PostProcessStageSampleMode:()=>md,PostProcessStageTextureCache:()=>EC,PpeMetadata:()=>RF,PpeSource:()=>ble,PpeTexture:()=>DF,Primitive:()=>Mn,PrimitiveCollection:()=>El,PrimitiveLoadPlan:()=>KT,PrimitiveOutlineGenerator:()=>XT,PrimitiveOutlinePipelineStage:()=>C2,PrimitivePipeline:()=>AT,PrimitiveRenderResources:()=>j2,PrimitiveState:()=>ss,PrimitiveStatisticsPipelineStage:()=>v2,PrimitiveType:()=>Oe,ProjectionPicker:()=>K8,ProjectionPickerViewModel:()=>X8,Property:()=>X,PropertyArray:()=>oI,PropertyAttribute:()=>qT,PropertyAttributeProperty:()=>AF,PropertyBag:()=>ru,PropertyTable:()=>au,PropertyTexture:()=>c_,PropertyTextureProperty:()=>yF,ProviderViewModel:()=>uo,Proxy:()=>pZ,QuadraticRealPolynomial:()=>kl,QuadtreeOccluders:()=>nz,QuadtreePrimitive:()=>cz,QuadtreeTile:()=>iz,QuadtreeTileLoadState:()=>Ja,QuadtreeTileProvider:()=>Kce,QuantizedMeshTerrainData:()=>Nx,QuarticRealPolynomial:()=>SD,Quaternion:()=>Le,QuaternionSpline:()=>xN,Queue:()=>iA,Ray:()=>pn,Rectangle:()=>ie,RectangleCollisionChecker:()=>iT,RectangleGeometry:()=>rT,RectangleGeometryLibrary:()=>ba,RectangleGeometryUpdater:()=>R3,RectangleGraphics:()=>gm,RectangleOutlineGeometry:()=>oT,ReferenceFrame:()=>ji,ReferenceProperty:()=>V_,RenderState:()=>Ge,Renderbuffer:()=>Sf,RenderbufferFormat:()=>Vl,Request:()=>wo,RequestErrorEvent:()=>wp,RequestScheduler:()=>Kc,RequestState:()=>Ti,RequestType:()=>Zs,Resource:()=>De,ResourceCache:()=>Li,ResourceCacheKey:()=>Wl,ResourceCacheStatistics:()=>bM,ResourceLoader:()=>tr,ResourceLoaderState:()=>Tt,Rotation:()=>hh,RuntimeError:()=>oe,S2Cell:()=>jg,SDFSettings:()=>qa,SampledPositionProperty:()=>yc,SampledProperty:()=>id,Sampler:()=>jt,ScaledPositionProperty:()=>x0,Scene:()=>p4,SceneFramebuffer:()=>yC,SceneMode:()=>re,SceneMode2DPipelineStage:()=>S2,SceneModePicker:()=>Y8,SceneModePickerViewModel:()=>q8,SceneTransforms:()=>hr,SceneTransitioner:()=>EV,ScreenSpaceCameraController:()=>wV,ScreenSpaceElevatorCameraController:()=>p8,ScreenSpaceEventHandler:()=>ra,ScreenSpaceEventType:()=>un,ScreenSpaceInputBindings:()=>yp,ScreenSpaceMapCameraController:()=>g8,ScreenSpaceTiltOrbitCameraController:()=>gle,ScreenSpaceZoomCameraController:()=>yle,SelectedFeatureIdPipelineStage:()=>VA,SelectionIndicator:()=>Z8,SelectionIndicatorViewModel:()=>J8,SensorVolumePortionToDisplay:()=>lI,ShaderBuilder:()=>dg,ShaderCache:()=>AO,ShaderDestination:()=>de,ShaderFunction:()=>PO,ShaderProgram:()=>Qt,ShaderSource:()=>Ye,ShaderStruct:()=>IO,ShadowMap:()=>uy,ShadowMapShader:()=>up,ShadowMode:()=>Dn,ShadowVolumeAppearance:()=>Uf,SharedContext:()=>DO,ShowGeometryInstanceAttribute:()=>Pn,Simon1994PlanetaryPositions:()=>Fy,SimplePolylineGeometry:()=>NZ,SingleTileImageryProvider:()=>QB,SkinningPipelineStage:()=>I2,SkyAtmosphere:()=>y4,SkyBox:()=>E4,SnapFramebuffer:()=>PV,SnapService:()=>LZ,Snapping:()=>RV,SpatialNode:()=>l4,Spdcf:()=>IF,SpecularEnvironmentCubeMap:()=>ym,SphereEmitter:()=>Jce,SphereGeometry:()=>DN,SphereOutlineGeometry:()=>Hg,Spherical:()=>RN,Spline:()=>Ir,SplitDirection:()=>qo,Splitter:()=>BP,StaticGeometryColorBatch:()=>_h,StaticGeometryPerMaterialBatch:()=>yh,StaticGroundGeometryColorBatch:()=>bI,StaticGroundGeometryPerMaterialBatch:()=>M3,StaticGroundPolylinePerMaterialBatch:()=>q3,StaticOutlineGeometryBatch:()=>EI,StencilConstants:()=>Yt,StencilFunction:()=>ni,StencilOperation:()=>Rt,SteppedSpline:()=>ON,Stereographic:()=>sl,StorageType:()=>FA,StripeMaterialProperty:()=>aI,StripeOrientation:()=>Hm,StructuralMetadata:()=>Ha,StyleCommandsNeeded:()=>vm,StyleExpression:()=>Zce,Sun:()=>P4,SunLight:()=>fg,SunPostProcess:()=>NV,SupportedImageFormats:()=>CF,SvgPathBindingHandler:()=>A8,Sync:()=>RO,TaskProcessor:()=>$n,Terrain:()=>d8,TerrainData:()=>Lu,TerrainEncoding:()=>_o,TerrainFillMesh:()=>AP,TerrainMesh:()=>lc,TerrainOffsetProperty:()=>LT,TerrainPicker:()=>jO,TerrainProvider:()=>qr,TerrainQuantization:()=>ka,TerrainState:()=>kr,Texture:()=>Dt,Texture3D:()=>OO,TextureAtlas:()=>xx,TextureCache:()=>bO,TextureMagnificationFilter:()=>Jn,TextureManager:()=>kV,TextureMinificationFilter:()=>Wt,TexturePacker:()=>Tv,TextureUniform:()=>zV,TextureWrap:()=>hn,TileAvailability:()=>Kh,TileBoundingRegion:()=>Zf,TileBoundingS2Cell:()=>qk,TileBoundingSphere:()=>N_,TileBoundingVolume:()=>Qce,TileCoordinatesImageryProvider:()=>m8,TileDiscardPolicy:()=>tle,TileEdge:()=>wn,TileImagery:()=>ww,TileMapServiceImageryProvider:()=>jA,TileMetadata:()=>jk,TileOrientedBoundingBox:()=>tf,TileProviderError:()=>$r,TileReplacementQueue:()=>rz,TileSelectionResult:()=>hi,TileState:()=>nle,Tileset3DTileContent:()=>rk,TilesetMetadata:()=>Yk,TilesetPipelineStage:()=>$F,TilingScheme:()=>BZ,TimeConstants:()=>kn,TimeDynamicImagery:()=>QT,TimeDynamicPointCloud:()=>UP,TimeInterval:()=>Cn,TimeIntervalCollection:()=>vs,TimeIntervalCollectionPositionProperty:()=>j_,TimeIntervalCollectionProperty:()=>H_,TimeStandard:()=>si,Timeline:()=>sj,TimelineHighlightRange:()=>rj,TimelineTrack:()=>oj,Tipsify:()=>wD,ToggleButtonViewModel:()=>Hb,Tonemapper:()=>hy,TrackingReferenceFrame:()=>Gg,Transforms:()=>At,TranslationRotationScale:()=>TA,TranslucentTileClassification:()=>qz,TridiagonalSystemSolver:()=>Rv,TrustedServers:()=>lv,TweenCollection:()=>SC,UniformState:()=>CO,UniformType:()=>G0,UrlTemplate3DTilesDataProvider:()=>l8,UrlTemplateImageryProvider:()=>Ds,VERSION:()=>r9t,VRButton:()=>ij,VRButtonViewModel:()=>nj,VRTheWorldTerrainProvider:()=>oQ,VaryingType:()=>Ale,Vector3DTileBatch:()=>s0,Vector3DTileClampedPolylines:()=>Ck,Vector3DTileContent:()=>vk,Vector3DTileGeometry:()=>r_,Vector3DTilePoints:()=>_k,Vector3DTilePolygons:()=>yk,Vector3DTilePolylines:()=>uE,Vector3DTilePrimitive:()=>HT,VectorGltf3DTileContent:()=>$A,VectorPipeline:()=>ws,VectorProvider:()=>Wg,VelocityOrientationProperty:()=>_3,VelocityVectorProperty:()=>G_,VertexArray:()=>zn,VertexArrayFacade:()=>hg,VertexAttributeSemantic:()=>ct,VertexFormat:()=>Be,VerticalExaggeration:()=>Ar,VerticalExaggerationPipelineStage:()=>D2,VerticalOrigin:()=>Gn,VideoSynchronizer:()=>rQ,View:()=>bC,Viewer:()=>zle,ViewportQuad:()=>ile,Visibility:()=>Wo,Visualizer:()=>lse,VoxelBoundsCollection:()=>gy,VoxelBoxShape:()=>OC,VoxelCell:()=>BV,VoxelContent:()=>RC,VoxelCylinderShape:()=>MC,VoxelEllipsoidShape:()=>NC,VoxelInspector:()=>ej,VoxelInspectorViewModel:()=>Q8,VoxelMetadataOrder:()=>q0,VoxelPrimitive:()=>Vb,VoxelProvider:()=>ole,VoxelRenderResources:()=>n4,VoxelShape:()=>sle,VoxelShapeType:()=>Ec,VoxelTraversal:()=>u4,VulkanConstants:()=>sQ,WallGeometry:()=>$N,WallGeometryLibrary:()=>hT,WallGeometryUpdater:()=>O3,WallGraphics:()=>e_,WallOutlineGeometry:()=>ZN,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>t2,WebMapTileServiceImageryProvider:()=>n2,WebMercatorProjection:()=>gi,WebMercatorTilingScheme:()=>Do,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>kS,WireframePipelineStage:()=>R2,_shadersAcesTonemappingStage:()=>Qz,_shadersAdditiveBlend:()=>OV,_shadersAdjustTranslucentFS:()=>wP,_shadersAllMaterialAppearanceFS:()=>nL,_shadersAllMaterialAppearanceVS:()=>iL,_shadersAmbientOcclusionGenerate:()=>eV,_shadersAmbientOcclusionModulate:()=>tV,_shadersAspectRampMaterial:()=>cL,_shadersAtmosphereCommon:()=>xm,_shadersAtmosphereStageFS:()=>JF,_shadersAtmosphereStageVS:()=>ZF,_shadersBasicMaterialAppearanceFS:()=>rL,_shadersBasicMaterialAppearanceVS:()=>oL,_shadersBillboardCollectionFS:()=>ok,_shadersBillboardCollectionVS:()=>sk,_shadersBlackAndWhite:()=>nV,_shadersBloomComposite:()=>iV,_shadersBrdfLutGeneratorFS:()=>hz,_shadersBrightPass:()=>MV,_shadersBrightness:()=>rV,_shadersBufferPointMaterialFS:()=>wk,_shadersBufferPointMaterialVS:()=>Sk,_shadersBufferPolygonMaterialFS:()=>VN,_shadersBufferPolygonMaterialVS:()=>zN,_shadersBufferPolylineMaterialFS:()=>WN,_shadersBufferPolylineMaterialVS:()=>GN,_shadersBumpMapMaterial:()=>lL,_shadersCPUStylingStageFS:()=>SB,_shadersCPUStylingStageVS:()=>vB,_shadersCheckerboardMaterial:()=>uL,_shadersCloudCollectionFS:()=>L4,_shadersCloudCollectionVS:()=>F4,_shadersCloudNoiseFS:()=>B4,_shadersCloudNoiseVS:()=>k4,_shadersCompareAndPackTranslucentDepth:()=>Wz,_shadersCompositeOITFS:()=>zz,_shadersCompositeTranslucentClassification:()=>AC,_shadersComputeIrradianceFS:()=>hF,_shadersComputeRadianceMapFS:()=>mF,_shadersConstantLodStageFS:()=>p2,_shadersConstantLodStageVS:()=>m2,_shadersContrastBias:()=>oV,_shadersConvolveSpecularMapFS:()=>pF,_shadersConvolveSpecularMapVS:()=>gF,_shadersCubeMapPanoramaVS:()=>x4,_shadersCustomShaderStageFS:()=>PB,_shadersCustomShaderStageVS:()=>IB,_shadersCzmBuiltins:()=>_x,_shadersDepthOfField:()=>sV,_shadersDepthPlaneFS:()=>Cz,_shadersDepthPlaneVS:()=>vz,_shadersDepthView:()=>aV,_shadersDepthViewPacked:()=>ale,_shadersDotMaterial:()=>fL,_shadersEdgeDetection:()=>cV,_shadersEdgeDetectionStageFS:()=>BB,_shadersEdgeVisibilityStageFS:()=>UB,_shadersEdgeVisibilityStageVS:()=>zB,_shadersElevationBandMaterial:()=>dL,_shadersElevationContourMaterial:()=>hL,_shadersElevationRampMaterial:()=>mL,_shadersEllipsoidFS:()=>xP,_shadersEllipsoidSurfaceAppearanceFS:()=>$4,_shadersEllipsoidSurfaceAppearanceVS:()=>J4,_shadersEllipsoidVS:()=>TP,_shadersFXAA:()=>fV,_shadersFXAA3_11:()=>_V,_shadersFadeMaterial:()=>pL,_shadersFeatureIdStageFS:()=>DB,_shadersFeatureIdStageVS:()=>RB,_shadersFilmicTonemapping:()=>lV,_shadersGaussianBlur1D:()=>Ub,_shadersGeometryStageFS:()=>jB,_shadersGeometryStageVS:()=>HB,_shadersGlobeFS:()=>$U,_shadersGlobeVS:()=>JU,_shadersGridMaterial:()=>gL,_shadersGroundAtmosphere:()=>gP,_shadersHSBToRGB:()=>yR,_shadersHSLToRGB:()=>AR,_shadersImageBasedLightingStageFS:()=>eB,_shadersInstancingStageCommon:()=>mB,_shadersInstancingStageVS:()=>pB,_shadersIntersectBox:()=>XV,_shadersIntersectCylinder:()=>KV,_shadersIntersectDepth:()=>qV,_shadersIntersectEllipsoid:()=>$V,_shadersIntersectLongitude:()=>MP,_shadersIntersectPlane:()=>YV,_shadersIntersection:()=>DC,_shadersIntersectionUtils:()=>WV,_shadersLegacyInstancingStageVS:()=>gB,_shadersLensFlare:()=>dV,_shadersLightingStageFS:()=>f2,_shadersMaterialStageFS:()=>h2,_shadersMegatexture:()=>t4,_shadersMetadataStageFS:()=>OB,_shadersMetadataStageVS:()=>MB,_shadersModelClippingPlanesStageFS:()=>oB,_shadersModelClippingPolygonsStageFS:()=>aB,_shadersModelClippingPolygonsStageVS:()=>cB,_shadersModelColorStageFS:()=>rB,_shadersModelFS:()=>Y2,_shadersModelSilhouetteStageFS:()=>L2,_shadersModelSilhouetteStageVS:()=>F2,_shadersModelSplitterStageFS:()=>k2,_shadersModelVS:()=>q2,_shadersModelVectorLookupStageFS:()=>fB,_shadersModelVectorLookupStageVS:()=>uB,_shadersModifiedReinhardTonemapping:()=>hV,_shadersMorphTargetsStageVS:()=>_2,_shadersNightVision:()=>mV,_shadersNormalMapMaterial:()=>_L,_shadersOctree:()=>e4,_shadersPassThrough:()=>ff,_shadersPassThroughDepth:()=>Lb,_shadersPbrNeutralTonemapping:()=>uV,_shadersPerInstanceColorAppearanceFS:()=>IL,_shadersPerInstanceColorAppearanceVS:()=>PL,_shadersPerInstanceFlatColorAppearanceFS:()=>_T,_shadersPerInstanceFlatColorAppearanceVS:()=>DL,_shadersPointCloudEyeDomeLighting:()=>FF,_shadersPointCloudStylingStageVS:()=>b2,_shadersPointPrimitiveCollectionFS:()=>sb,_shadersPointPrimitiveCollectionVS:()=>u3,_shadersPolylineArrowMaterial:()=>yL,_shadersPolylineColorAppearanceVS:()=>UL,_shadersPolylineCommon:()=>eu,_shadersPolylineDashMaterial:()=>AL,_shadersPolylineFS:()=>ET,_shadersPolylineGlowMaterial:()=>bL,_shadersPolylineMaterialAppearanceVS:()=>zL,_shadersPolylineOutlineMaterial:()=>xL,_shadersPolylineShadowVolumeFS:()=>LL,_shadersPolylineShadowVolumeMorphFS:()=>FL,_shadersPolylineShadowVolumeMorphVS:()=>BL,_shadersPolylineShadowVolumeVS:()=>kL,_shadersPolylineVS:()=>dk,_shadersPrimitiveGaussianSplatFS:()=>Bk,_shadersPrimitiveGaussianSplatVS:()=>Fk,_shadersPrimitiveOutlineStageFS:()=>E2,_shadersPrimitiveOutlineStageVS:()=>T2,_shadersRGBToHSB:()=>WR,_shadersRGBToHSL:()=>qR,_shadersRGBToXYZ:()=>YR,_shadersReinhardTonemapping:()=>pV,_shadersReprojectWebMercatorFS:()=>o2,_shadersReprojectWebMercatorVS:()=>s2,_shadersRimLightingMaterial:()=>TL,_shadersSelectedFeatureIdStageCommon:()=>mw,_shadersShadowVolumeAppearanceFS:()=>VS,_shadersShadowVolumeAppearanceVS:()=>RL,_shadersShadowVolumeFS:()=>PA,_shadersSilhouette:()=>gV,_shadersSkinningStageVS:()=>w2,_shadersSkyAtmosphereCommon:()=>NP,_shadersSkyAtmosphereFS:()=>g4,_shadersSkyAtmosphereVS:()=>_4,_shadersSkyBoxFS:()=>A4,_shadersSkyBoxVS:()=>b4,_shadersSlopeRampMaterial:()=>EL,_shadersStripeMaterial:()=>CL,_shadersSunFS:()=>C4,_shadersSunTextureFS:()=>v4,_shadersSunVS:()=>S4,_shadersTexturedMaterialAppearanceFS:()=>sL,_shadersTexturedMaterialAppearanceVS:()=>aL,_shadersVector3DTileClampedPolylinesFS:()=>Tk,_shadersVector3DTileClampedPolylinesVS:()=>xk,_shadersVector3DTilePolylinesVS:()=>Ak,_shadersVectorCommon:()=>g_,_shadersVectorTileVS:()=>$S,_shadersVerticalExaggerationStageVS:()=>P2,_shadersViewportQuadFS:()=>U4,_shadersViewportQuadVS:()=>cx,_shadersVoxelFS:()=>HV,_shadersVoxelUtils:()=>jV,_shadersVoxelVS:()=>GV,_shadersWater:()=>SL,_shadersWaterMaskMaterial:()=>vL,_shadersXYZToRGB:()=>_O,_shadersacesTonemapping:()=>N1,_shadersalphaWeight:()=>L1,_shadersantialias:()=>F1,_shadersapplyHSBShift:()=>B1,_shadersapproximateSphericalCoordinates:()=>k1,_shadersapproximateTanh:()=>U1,_shadersbackFacing:()=>z1,_shadersbranchFreeTernary:()=>V1,_shaderscascadeColor:()=>j1,_shaderscascadeDistance:()=>H1,_shaderscascadeMatrix:()=>G1,_shaderscascadeWeights:()=>W1,_shaderscolumbusViewMorph:()=>q1,_shaderscomputeAtmosphereColor:()=>Y1,_shaderscomputeGroundAtmosphereScattering:()=>X1,_shaderscomputePosition:()=>K1,_shaderscomputeScattering:()=>$1,_shaderscomputeTextureTransform:()=>J1,_shadersconvertLocalToBoxUv:()=>JV,_shadersconvertLocalToCylinderUv:()=>ZV,_shadersconvertLocalToEllipsoidUv:()=>QV,_shaderscosineAndSine:()=>Z1,_shadersdecodeRGB8:()=>Q1,_shadersdecompressTextureCoordinates:()=>eR,_shadersdegreesPerRadian:()=>kD,_shadersdepthClamp:()=>tR,_shadersdepthRange:()=>UD,_shadersdepthRangeStruct:()=>S1,_shaderseastNorthUpToEyeCoordinates:()=>nR,_shadersellipsoidContainsPoint:()=>iR,_shadersellipsoidTextureCoordinates:()=>rR,_shadersepsilon1:()=>zD,_shadersepsilon2:()=>VD,_shadersepsilon3:()=>jD,_shadersepsilon4:()=>HD,_shadersepsilon5:()=>GD,_shadersepsilon6:()=>WD,_shadersepsilon7:()=>qD,_shadersequalsEpsilon:()=>oR,_shaderseyeOffset:()=>sR,_shaderseyeToCartographicDelta:()=>aR,_shaderseyeToWindowCoordinates:()=>cR,_shadersfastApproximateAtan:()=>lR,_shadersfog:()=>uR,_shadersgammaCorrect:()=>fR,_shadersgeodeticSurfaceNormal:()=>dR,_shadersgetDefaultMaterial:()=>hR,_shadersgetDynamicAtmosphereLightDirection:()=>mR,_shadersgetLambertDiffuse:()=>pR,_shadersgetSpecular:()=>gR,_shadersgetWaterNoise:()=>_R,_shadershue:()=>bR,_shadersinfinity:()=>YD,_shadersinverseGamma:()=>xR,_shadersisEmpty:()=>TR,_shadersisFull:()=>ER,_shaderslatitudeToWebMercatorFraction:()=>CR,_shaderslineDistance:()=>SR,_shaderslinearToSrgb:()=>vR,_shadersluminance:()=>wR,_shadersmaterial:()=>w1,_shadersmaterialInput:()=>I1,_shadersmaximumComponent:()=>IR,_shadersmetersPerPixel:()=>PR,_shadersmodelMaterial:()=>P1,_shadersmodelToWindowCoordinates:()=>DR,_shadersmodelVertexOutput:()=>D1,_shadersmultiplyWithColorBalance:()=>RR,_shadersnearFarScalar:()=>OR,_shadersoctDecode:()=>MR,_shadersoneOverPi:()=>XD,_shadersoneOverTwoPi:()=>KD,_shaderspackDepth:()=>NR,_shaderspassCesium3DTile:()=>$D,_shaderspassCesium3DTileClassification:()=>JD,_shaderspassCesium3DTileClassificationIgnoreShow:()=>ZD,_shaderspassCesium3DTileEdges:()=>QD,_shaderspassCesium3DTileEdgesDirect:()=>e1,_shaderspassCesium3DTilePlanarFillId:()=>t1,_shaderspassClassification:()=>n1,_shaderspassCompute:()=>i1,_shaderspassEnvironment:()=>r1,_shaderspassGaussianSplats:()=>o1,_shaderspassGlobe:()=>s1,_shaderspassOpaque:()=>a1,_shaderspassOverlay:()=>c1,_shaderspassTerrainClassification:()=>l1,_shaderspassTranslucent:()=>u1,_shaderspassVoxels:()=>f1,_shaderspbrLighting:()=>LR,_shaderspbrNeutralTonemapping:()=>FR,_shadersphong:()=>BR,_shaderspi:()=>d1,_shaderspiOverFour:()=>h1,_shaderspiOverSix:()=>m1,_shaderspiOverThree:()=>p1,_shaderspiOverTwo:()=>g1,_shadersplaneDistance:()=>kR,_shaderspointAlongRay:()=>UR,_shadersradiansPerDegree:()=>_1,_shadersray:()=>R1,_shadersrayEllipsoidIntersectionInterval:()=>zR,_shadersraySegment:()=>O1,_shadersraySphereIntersectionInterval:()=>VR,_shadersreadDepth:()=>jR,_shadersreadNonPerspective:()=>HR,_shadersreverseLogDepth:()=>GR,_shadersround:()=>XR,_shaderssaturation:()=>KR,_shaderssceneMode2D:()=>y1,_shaderssceneMode3D:()=>A1,_shaderssceneModeColumbusView:()=>b1,_shaderssceneModeMorphing:()=>x1,_shadersshadowDepthCompare:()=>$R,_shadersshadowParameters:()=>M1,_shadersshadowVisibility:()=>JR,_shaderssignNotZero:()=>ZR,_shaderssolarRadius:()=>T1,_shaderssphericalHarmonics:()=>QR,_shaderssrgbToLinear:()=>eO,_shaderstangentToEyeSpaceMatrix:()=>tO,_shaderstextureCube:()=>nO,_shadersthreePiOver2:()=>E1,_shaderstransformPlane:()=>iO,_shaderstranslateRelativeToEye:()=>rO,_shaderstranslucentPhong:()=>oO,_shaderstranspose:()=>sO,_shaderstwoPi:()=>C1,_shadersunpackDepth:()=>aO,_shadersunpackFloat:()=>cO,_shadersunpackTexture:()=>lO,_shadersunpackUint:()=>uO,_shadersvalueTransform:()=>fO,_shadersvertexLogDepth:()=>dO,_shaderswebMercatorMaxLatitude:()=>v1,_shaderswindowToEyeCoordinates:()=>hO,_shaderswriteDepthClamp:()=>mO,_shaderswriteLogDepth:()=>pO,_shaderswriteNonPerspective:()=>gO,addAllToArray:()=>Zn,addBuffer:()=>uM,addDefaults:()=>iM,addExtensionsRequired:()=>aM,addExtensionsUsed:()=>Fd,addPipelineExtras:()=>Xy,addToArray:()=>_a,appendForwardSlash:()=>oD,arrayRemoveDuplicates:()=>Fr,assert:()=>wX,barycentricCoordinates:()=>ux,binarySearch:()=>vr,buildModuleUrl:()=>Zt,buildVectorGltfFromMVT:()=>z4,buildVoxelCustomShader:()=>OP,buildVoxelDrawCommands:()=>i4,clone:()=>Je,combine:()=>Ot,computeFlyToLocationForRectangle:()=>cC,createBillboardPointCallback:()=>cE,createColorRamp:()=>BM,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>R8,createDefaultTerrainProviderViewModels:()=>O8,createElevationBandMaterial:()=>hce,createGooglePhotorealistic3DTileset:()=>mce,createGuid:()=>Kn,createMaterialPropertyDescriptor:()=>oo,createOsmBuildingsAsync:()=>pce,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>iu,createTangentSpaceDebugPrimitive:()=>gce,createTaskProcessorWorker:()=>xle,createUniform:()=>yD,createUniformArray:()=>AD,createVectorTileBuffersFromModelComponents:()=>Ok,createWorldBathymetryAsync:()=>kM,createWorldImageryAsync:()=>x_,createWorldTerrainAsync:()=>Gx,decodeGoogleEarthEnterpriseData:()=>VM,decodeMVT:()=>K4,decodeVectorPolylinePositions:()=>jM,defaultPickWorldPosition:()=>_p,defer:()=>Iu,defined:()=>l,demodernizeShader:()=>yO,deprecationWarning:()=>Yr,destroyObject:()=>ue,exportKml:()=>roe,findAccessorMinMax:()=>Rx,findContentMetadata:()=>gE,findGroupMetadata:()=>_E,findMeshoptExtension:()=>Yy,findTileMetadata:()=>Hk,forEachTextureInMaterial:()=>Vv,formatError:()=>Up,freezeRenderState:()=>_Y,getAbsoluteUri:()=>vd,getAccessorByteStride:()=>ku,getBaseUri:()=>sD,getBinaryAccessor:()=>Jd,getClipAndStyleCode:()=>D4,getClippingFunction:()=>lC,getComponentReader:()=>Tg,getElement:()=>Ln,getExtensionFromUri:()=>ig,getFilenameFromUri:()=>Fg,getImageFromTypedArray:()=>$M,getImagePixels:()=>kh,getJsonFromTypedArray:()=>Ro,getMagic:()=>em,getMeshPrimitives:()=>NF,getMetadataClassProperty:()=>d4,getMetadataProperty:()=>m4,getStringFromTypedArray:()=>Bu,getTimestamp:()=>xn,hasExtension:()=>er,heightReferenceOnEntityPropertyChanged:()=>t_,isBitSet:()=>rl,isBlobUri:()=>ex,isCrossOriginUrl:()=>Iy,isDataUri:()=>Uh,isLeapYear:()=>xf,knockout:()=>ve,knockout_3_5_1:()=>YC,knockout_es5:()=>y8,loadAndExecuteScript:()=>tx,loadCubeMap:()=>wO,loadImageFromTypedArray:()=>xg,loadKTX2:()=>Ru,mergeSort:()=>n0,mostDetailedSurfaceHeight:()=>fm,moveTechniqueRenderStates:()=>sM,moveTechniquesToExtension:()=>cM,numberOfComponentsForType:()=>Df,objectToQuery:()=>nx,oneTimeWarning:()=>_t,parseBatchTable:()=>d_,parseFeatureMetadataLegacy:()=>TF,parseGlb:()=>Dx,parseResponseHeaders:()=>aD,parseStructuralMetadata:()=>xF,pickModel:()=>Rw,pointInsideTriangle:()=>hZ,positionForSurfaceHeight:()=>qg,preprocess3DTileContent:()=>M_,processVoxelProperties:()=>VV,queryToObject:()=>Ef,readAccessorPacked:()=>fM,removeExtension:()=>Ox,removeExtensionsRequired:()=>rM,removeExtensionsUsed:()=>Px,removePipelineExtras:()=>oM,removeUnusedElements:()=>lM,renderBufferPointCollection:()=>Dk,renderBufferPolygonCollection:()=>HN,renderBufferPolylineCollection:()=>XN,resizeImageToNextPowerOfTwo:()=>Jy,sampleTerrain:()=>wN,sampleTerrainMostDetailed:()=>aT,scaleToGeodeticSurface:()=>Qb,srgbToLinear:()=>uT,subdivideArray:()=>MN,subscribeAndEvaluate:()=>Cc,updateAccessorComponentTypes:()=>dM,updateVersion:()=>hM,usesExtension:()=>jo,viewerCesium3DTilesInspectorMixin:()=>jle,viewerCesiumInspectorMixin:()=>Hle,viewerDragDropMixin:()=>Wle,viewerPerformanceWatchdogMixin:()=>qle,viewerVoxelInspectorMixin:()=>Yle,webGLConstantToGlslType:()=>cQ,wrapFunction:()=>QN,writeTextToCanvas:()=>Qx});module.exports=Fh(o9t);function h3e(e){return e!=null}var l=h3e;function Jb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Jb.prototype=Object.create(Error.prototype),Jb.prototype.constructor=Jb);Jb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};Jb.throwInstantiationError=function(){throw new Jb("This function defines an interface and should not be called directly.")};var pe=Jb;var ha={};ha.typeOf={};function m3e(e){return`${e} is required, actual value was undefined`}function QC(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ha.defined=function(e,t){if(!l(t))throw new pe(m3e(e))};ha.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(QC(typeof t,"function",e))};ha.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(QC(typeof t,"string",e))};ha.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(QC(typeof t,"number",e))};ha.typeOf.number.lessThan=function(e,t,n){if(ha.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ha.typeOf.number.lessThanOrEquals=function(e,t,n){if(ha.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ha.typeOf.number.greaterThan=function(e,t,n){if(ha.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ha.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ha.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ha.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(QC(typeof t,"object",e))};ha.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(QC(typeof t,"boolean",e))};ha.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(QC(typeof t,"bigint",e))};ha.typeOf.number.equals=function(e,t,n,i){if(ha.typeOf.number(e,n),ha.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Wr=ha;var Sq=Qo(fj(),1);var yt={};yt.EPSILON1=.1;yt.EPSILON2=.01;yt.EPSILON3=.001;yt.EPSILON4=1e-4;yt.EPSILON5=1e-5;yt.EPSILON6=1e-6;yt.EPSILON7=1e-7;yt.EPSILON8=1e-8;yt.EPSILON9=1e-9;yt.EPSILON10=1e-10;yt.EPSILON11=1e-11;yt.EPSILON12=1e-12;yt.EPSILON13=1e-13;yt.EPSILON14=1e-14;yt.EPSILON15=1e-15;yt.EPSILON16=1e-16;yt.EPSILON17=1e-17;yt.EPSILON18=1e-18;yt.EPSILON19=1e-19;yt.EPSILON20=1e-20;yt.EPSILON21=1e-21;yt.GRAVITATIONALPARAMETER=3986004418e5;yt.SOLAR_RADIUS=6955e5;yt.LUNAR_RADIUS=1737400;yt.SIXTY_FOUR_KILOBYTES=64*1024;yt.FOUR_GIGABYTES=4*1024*1024*1024;yt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};yt.signNotZero=function(e){return e<0?-1:1};yt.toSNorm=function(e,t){return t=t??255,Math.round((yt.clamp(e,-1,1)*.5+.5)*t)};yt.fromSNorm=function(e,t){return t=t??255,yt.clamp(e,0,t)/t*2-1};yt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:yt.clamp((e-t)/n,0,1)};yt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};yt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};yt.lerp=function(e,t,n){return(1-n)*e+n*t};yt.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,s={}){o=Math.max(1e-4,o);let a=2/o,c=a*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=yt.clamp(d,-f,f);let p=e-d,g=(n+a*d)*i;return n=(n-a*g)*u,s.value=p+(d+g)*u,s.velocity=n,s};yt.PI=Math.PI;yt.ONE_OVER_PI=1/Math.PI;yt.PI_OVER_TWO=Math.PI/2;yt.PI_OVER_THREE=Math.PI/3;yt.PI_OVER_FOUR=Math.PI/4;yt.PI_OVER_SIX=Math.PI/6;yt.THREE_PI_OVER_TWO=3*Math.PI/2;yt.TWO_PI=2*Math.PI;yt.ONE_OVER_TWO_PI=1/(2*Math.PI);yt.RADIANS_PER_DEGREE=Math.PI/180;yt.DEGREES_PER_RADIAN=180/Math.PI;yt.RADIANS_PER_ARCSECOND=yt.RADIANS_PER_DEGREE/3600;yt.toRadians=function(e){return e*yt.RADIANS_PER_DEGREE};yt.toDegrees=function(e){return e*yt.DEGREES_PER_RADIAN};yt.convertLongitudeRange=function(e){let t=yt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};yt.clampToLatitudeRange=function(e){return yt.clamp(e,-1*yt.PI_OVER_TWO,yt.PI_OVER_TWO)};yt.negativePiToPi=function(e){return e>=-yt.PI&&e<=yt.PI?e:yt.zeroToTwoPi(e+yt.PI)-yt.PI};yt.zeroToTwoPi=function(e){if(e>=0&&e<=yt.TWO_PI)return e;let t=yt.mod(e,yt.TWO_PI);return Math.abs(t)<yt.EPSILON14&&Math.abs(e)>yt.EPSILON14?yt.TWO_PI:t};yt.mod=function(e,t){return yt.sign(e)===yt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};yt.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};yt.lessThan=function(e,t,n){return e-t<-n};yt.lessThanOrEquals=function(e,t,n){return e-t<n};yt.greaterThan=function(e,t,n){return e-t>n};yt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var dj=[1];yt.factorial=function(e){let t=dj.length;if(e>=t){let n=dj[t-1];for(let i=t;i<=e;i++){let r=n*i;dj.push(r),n=r}}return dj[e]};yt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};yt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};yt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};yt.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};yt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var $le=new Sq.default;yt.setRandomNumberSeed=function(e){$le=new Sq.default(e)};yt.nextRandomNumber=function(){return $le.random()};yt.randomBetween=function(e,t){return yt.nextRandomNumber()*(t-e)+e};yt.acosClamped=function(e){return Math.acos(yt.clamp(e,-1,1))};yt.asinClamped=function(e){return Math.asin(yt.clamp(e,-1,1))};yt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};yt.logBase=function(e,t){return Math.log(e)/Math.log(t)};yt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};yt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};yt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};yt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};yt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=yt.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?yt.PI_OVER_TWO-i:i,i=e<0?yt.PI-i:i,i=t<0?-i:i,i};var D=yt;var po=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y),a=D.clamp(t.z,n.z,i.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,hj),e.magnitude(hj)}static distanceSquared(t,n){return e.subtract(t,n,hj),e.magnitudeSquared(hj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Jle),r=e.multiplyByScalar(t,1-i,r),e.add(Jle,r,r)}static angleBetween(t,n){e.normalize(t,mj),e.normalize(n,wq);let i=e.dot(mj,wq),r=e.magnitude(e.cross(mj,wq,mj));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,p3e);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,s=t.z,a=n.x,c=n.y,u=n.z,f=o*u-s*c,d=s*a-r*u,p=r*c-o*a;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t),n=D.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let s=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,a=Math.cos(n);Td.x=a*Math.cos(t),Td.y=a*Math.sin(t),Td.z=Math.sin(n),Td=e.normalize(Td,Td),e.multiplyComponents(s,Td,ev);let c=Math.sqrt(e.dot(Td,ev));return ev=e.divideByScalar(ev,c,ev),Td=e.multiplyByScalar(Td,i,Td),l(o)||(o=new e),e.add(ev,Td,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromDegrees(s,a,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromRadians(s,a,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(s,a,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(s,a,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};po.fromCartesian4=po.clone;po.packedLength=3;po.fromArray=po.unpack;var hj=new po,Jle=new po,mj=new po,wq=new po,p3e=new po,Td=new po,ev=new po;po._ellipsoidRadiiSquared=new po(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);po.ZERO=Object.freeze(new po(0,0,0));po.ONE=Object.freeze(new po(1,1,1));po.UNIT_X=Object.freeze(new po(1,0,0));po.UNIT_Y=Object.freeze(new po(0,1,0));po.UNIT_Z=Object.freeze(new po(0,0,1));var h=po;var Js=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y),a=D.clamp(t.z,n.z,i.z),c=D.clamp(t.w,n.w,i.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,pj),e.magnitude(pj)}static distanceSquared(t,n){return e.subtract(t,n,pj),e.magnitudeSquared(pj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Zle),r=e.multiplyByScalar(t,1-i,r),e.add(Zle,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,g3e);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)&&D.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),Iq[0]=t,Qle?(n.x=qc[0],n.y=qc[1],n.z=qc[2],n.w=qc[3]):(n.x=qc[3],n.y=qc[2],n.z=qc[1],n.w=qc[0]),n}static unpackFloat(t){return Qle?(qc[0]=t.x,qc[1]=t.y,qc[2]=t.z,qc[3]=t.w):(qc[0]=t.w,qc[1]=t.z,qc[2]=t.y,qc[3]=t.x),Iq[0]}};Js.packedLength=4;Js.fromArray=Js.unpack;var pj=new Js,Zle=new Js,g3e=new Js;Js.ZERO=Object.freeze(new Js(0,0,0,0));Js.ONE=Object.freeze(new Js(1,1,1,1));Js.UNIT_X=Object.freeze(new Js(1,0,0,0));Js.UNIT_Y=Object.freeze(new Js(0,1,0,0));Js.UNIT_Z=Object.freeze(new Js(0,0,1,0));Js.UNIT_W=Object.freeze(new Js(0,0,0,1));var Iq=new Float32Array(1),qc=new Uint8Array(Iq.buffer),_3e=new Uint32Array([287454020]),y3e=new Uint8Array(_3e.buffer),Qle=y3e[0]===68,se=Js;var Pq={};Pq.EMPTY_OBJECT=Object.freeze({});Pq.EMPTY_ARRAY=Object.freeze([]);var H=Pq;var A3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),br=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,A3e,new.target);return f[0]=t??0,f[1]=r??0,f[2]=a??0,f[3]=n??0,f[4]=o??0,f[5]=c??0,f[6]=i??0,f[7]=s??0,f[8]=u??0,f}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(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):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,s=t.x*t.w,a=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-a-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+a-f+p,x=2*(c-s),T=2*(o-u),E=2*(c+s),v=-i-a+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=E,n[6]=y,n[7]=x,n[8]=v,n):new e(g,m,y,A,b,x,T,E,v)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),a=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*a+c*s*r,d=c*a+o*s*r,p=i*a,g=o*r+c*s*a,m=-c*r+o*s*a,y=-s,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],s=t[r+1],a=t[r+2];return i.x=o,i.y=s,i.z=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],s=t[n+6];return i.x=r,i.y=o,i.z=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,b3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,x3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],Dq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],Dq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],Dq)),n}static getMaximumScale(t){return e.getScale(t,eue),h.maximumComponent(eue)}static setRotation(t,n,i){let r=e.getScale(t,T3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,E3e);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}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],s=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=s,i[3]=a,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[3]*o+t[6]*s,c=t[1]*r+t[4]*o+t[7]*s,u=t[2]*r+t[5]*o+t[8]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return 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}static transpose(t,n){let i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=D.EPSILON20,r=10,o=0,s=0;l(n)||(n={});let a=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*v3e(c);for(;s<r&&S3e(c)>u;)w3e(c,gj),e.transpose(gj,tue),e.multiply(c,gj,c),e.multiply(tue,c,c),e.multiply(a,gj,a),++o>2&&(++s,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],c=t[2],u=t[5],f=t[8];return n*(s*f-u*a)+o*(u*r-i*f)+c*(i*a-s*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=a*d-f*c,n[1]=f*o-r*d,n[2]=r*c-a*o,n[3]=u*c-s*d,n[4]=i*d-u*o,n[5]=s*o-i*c,n[6]=s*f-u*a,n[7]=u*r-i*f,n[8]=i*a-s*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,C3e),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var J=tt;function lv(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(lv.prototype=Object.create(Error.prototype),lv.prototype.constructor=lv);lv.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` -${this.stack.toString()}`),e};var ae=lv;function et(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this[0]=e??0,this[1]=o??0,this[2]=l??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=y??0}et.packedLength=16;et.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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};et.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new et),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};et.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*16;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)et.pack(e[o],t,o*16);return t};et.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new E("array length must be a multiple of 16.");let n=e.length;c(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=et.unpack(e,i,t[o])}return t};et.clone=function(e,t){if(c(e))return c(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 et(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])};et.fromArray=et.unpack;et.fromColumnMajorArray=function(e,t){return T.defined("values",e),et.clone(e,t)};et.fromRowMajorArray=function(e,t){return T.defined("values",e),c(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 et(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])};et.fromRotationTranslation=function(e,t,n){return T.typeOf.object("rotation",e),t=t??d.ZERO,c(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 et(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)};et.fromTranslationQuaternionRotationScale=function(e,t,n,i){T.typeOf.object("translation",e),T.typeOf.object("rotation",t),T.typeOf.object("scale",n),c(i)||(i=new et);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,l=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,g=t.y*t.w,m=t.z*t.z,y=t.z*t.w,b=t.w*t.w,x=a-h-m+b,A=2*(l-y),C=2*(u+g),S=2*(l+y),v=-a+h-m+b,P=2*(p-f),M=2*(u-g),R=2*(p+f),L=-a-h+m+b;return i[0]=x*o,i[1]=S*o,i[2]=M*o,i[3]=0,i[4]=A*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=C*s,i[9]=P*s,i[10]=L*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};et.fromTranslationRotationScale=function(e,t){return T.typeOf.object("translationRotationScale",e),et.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};et.fromTranslation=function(e,t){return T.typeOf.object("translation",e),et.fromRotationTranslation(J.IDENTITY,e,t)};et.fromScale=function(e,t){return T.typeOf.object("scale",e),c(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 et(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};et.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(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 et(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};et.fromRotation=function(e,t){return T.typeOf.object("rotation",e),c(t)||(t=new et),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 KA=new d,$A=new d,uv=new d;et.fromCamera=function(e,t){T.typeOf.object("camera",e);let n=e.position,i=e.direction,o=e.up;T.typeOf.object("camera.position",n),T.typeOf.object("camera.direction",i),T.typeOf.object("camera.up",o),d.normalize(i,KA),d.normalize(d.cross(KA,o,$A),$A),d.normalize(d.cross($A,KA,uv),uv);let r=$A.x,s=$A.y,a=$A.z,l=KA.x,u=KA.y,f=KA.z,h=uv.x,p=uv.y,g=uv.z,m=n.x,y=n.y,b=n.z,x=r*-m+s*-y+a*-b,A=h*-m+p*-y+g*-b,C=l*m+u*y+f*b;return c(t)?(t[0]=r,t[1]=h,t[2]=-l,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=x,t[13]=A,t[14]=C,t[15]=1,t):new et(r,s,a,x,h,p,g,A,-l,-u,-f,C,0,0,0,1)};et.computePerspectiveFieldOfView=function(e,t,n,i,o){T.typeOf.number.greaterThan("fovY",e,0),T.typeOf.number.lessThan("fovY",e,Math.PI),T.typeOf.number.greaterThan("near",n,0),T.typeOf.number.greaterThan("far",i,0),T.typeOf.object("result",o);let s=1/Math.tan(e*.5),a=s/t,l=(i+n)/(n-i),u=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]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};et.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.number("far",r),T.typeOf.object("result",s);let a=1/(t-e),l=1/(i-n),u=1/(r-o),f=-(t+e)*a,h=-(i+n)*l,p=-(r+o)*u;return a*=2,l*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=h,s[14]=p,s[15]=1,s};et.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.number("far",r),T.typeOf.object("result",s);let a=2*o/(t-e),l=2*o/(i-n),u=(t+e)/(t-e),f=(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]=l,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};et.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.object("result",r);let s=2*o/(t-e),a=2*o/(i-n),l=(t+e)/(t-e),u=(i+n)/(i-n),f=-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]=l,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};et.computeViewportTransformation=function(e,t,n,i){c(i)||(i=new et),e=e??W.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let l=s*.5,u=a*.5,f=(n-t)*.5,h=l,p=u,g=f,m=o+l,y=r+u,b=t+f,x=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]=m,i[13]=y,i[14]=b,i[15]=x,i};et.computeView=function(e,t,n,i,o){return T.typeOf.object("position",e),T.typeOf.object("direction",t),T.typeOf.object("up",n),T.typeOf.object("right",i),T.typeOf.object("result",o),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]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};et.toArray=function(e,t){return T.typeOf.object("matrix",e),c(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]]};et.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,3),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};et.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("result",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};et.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=et.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};et.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("result",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};et.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=et.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};et.setTranslation=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("translation",t),T.typeOf.object("result",n),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 VSe=new d;et.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=et.getScale(e,VSe),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 zSe=new d;et.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=et.getScale(e,zSe),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 L5=new d;et.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],L5)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],L5)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],L5)),t};var bJ=new d;et.getMaximumScale=function(e){return et.getScale(e,bJ),d.maximumComponent(bJ)};var HSe=new d;et.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=et.getScale(e,HSe);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 GSe=new d;et.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=et.getScale(e,GSe);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};et.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],u=e[6],f=e[7],h=e[8],p=e[9],g=e[10],m=e[11],y=e[12],b=e[13],x=e[14],A=e[15],C=t[0],S=t[1],v=t[2],P=t[3],M=t[4],R=t[5],L=t[6],F=t[7],_=t[8],w=t[9],D=t[10],I=t[11],N=t[12],k=t[13],z=t[14],V=t[15],j=i*C+a*S+h*v+y*P,U=o*C+l*S+p*v+b*P,q=r*C+u*S+g*v+x*P,Y=s*C+f*S+m*v+A*P,te=i*M+a*R+h*L+y*F,K=o*M+l*R+p*L+b*F,Z=r*M+u*R+g*L+x*F,ee=s*M+f*R+m*L+A*F,me=i*_+a*w+h*D+y*I,Te=o*_+l*w+p*D+b*I,ue=r*_+u*w+g*D+x*I,ye=s*_+f*w+m*D+A*I,Ae=i*N+a*k+h*z+y*V,Pe=o*N+l*k+p*z+b*V,Ee=r*N+u*k+g*z+x*V,ze=s*N+f*k+m*z+A*V;return n[0]=j,n[1]=U,n[2]=q,n[3]=Y,n[4]=te,n[5]=K,n[6]=Z,n[7]=ee,n[8]=me,n[9]=Te,n[10]=ue,n[11]=ye,n[12]=Ae,n[13]=Pe,n[14]=Ee,n[15]=ze,n};et.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};et.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};et.multiplyTransformation=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],u=e[8],f=e[9],h=e[10],p=e[12],g=e[13],m=e[14],y=t[0],b=t[1],x=t[2],A=t[4],C=t[5],S=t[6],v=t[8],P=t[9],M=t[10],R=t[12],L=t[13],F=t[14],_=i*y+s*b+u*x,w=o*y+a*b+f*x,D=r*y+l*b+h*x,I=i*A+s*C+u*S,N=o*A+a*C+f*S,k=r*A+l*C+h*S,z=i*v+s*P+u*M,V=o*v+a*P+f*M,j=r*v+l*P+h*M,U=i*R+s*L+u*F+p,q=o*R+a*L+f*F+g,Y=r*R+l*L+h*F+m;return n[0]=_,n[1]=w,n[2]=D,n[3]=0,n[4]=I,n[5]=N,n[6]=k,n[7]=0,n[8]=z,n[9]=V,n[10]=j,n[11]=0,n[12]=U,n[13]=q,n[14]=Y,n[15]=1,n};et.multiplyByMatrix3=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("rotation",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],u=e[8],f=e[9],h=e[10],p=t[0],g=t[1],m=t[2],y=t[3],b=t[4],x=t[5],A=t[6],C=t[7],S=t[8],v=i*p+s*g+u*m,P=o*p+a*g+f*m,M=r*p+l*g+h*m,R=i*y+s*b+u*x,L=o*y+a*b+f*x,F=r*y+l*b+h*x,_=i*A+s*C+u*S,w=o*A+a*C+f*S,D=r*A+l*C+h*S;return n[0]=v,n[1]=P,n[2]=M,n[3]=0,n[4]=R,n[5]=L,n[6]=F,n[7]=0,n[8]=_,n[9]=w,n[10]=D,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};et.multiplyByTranslation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("translation",t),T.typeOf.object("result",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],l=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]=l,n[15]=e[15],n};et.multiplyByScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?et.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)};et.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),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};et.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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,l=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=l,n.z=u,n.w=f,n};et.multiplyByPointAsVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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,l=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=l,n};et.multiplyByPoint=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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],l=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=l,n};et.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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};et.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",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};et.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",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};et.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};et.equals=function(e,t){return e===t||c(e)&&c(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]};et.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};et.getTranslation=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};et.getMatrix3=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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 jSe=new J,WSe=new J,qSe=new se,YSe=new se(0,0,0,1);et.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],l=e[9],u=e[13],f=e[2],h=e[6],p=e[10],g=e[14],m=e[3],y=e[7],b=e[11],x=e[15],A=p*x,C=g*b,S=h*x,v=g*y,P=h*b,M=p*y,R=f*x,L=g*m,F=f*b,_=p*m,w=f*y,D=h*m,I=A*a+v*l+P*u-(C*a+S*l+M*u),N=C*s+R*l+_*u-(A*s+L*l+F*u),k=S*s+L*a+w*u-(v*s+R*a+D*u),z=M*s+F*a+D*l-(P*s+_*a+w*l),V=C*i+S*o+M*r-(A*i+v*o+P*r),j=A*n+L*o+F*r-(C*n+R*o+_*r),U=v*n+R*i+D*r-(S*n+L*i+w*r),q=P*n+_*i+w*o-(M*n+F*i+D*o);A=o*u,C=r*l,S=i*u,v=r*a,P=i*l,M=o*a,R=n*u,L=r*s,F=n*l,_=o*s,w=n*a,D=i*s;let Y=A*y+v*b+P*x-(C*y+S*b+M*x),te=C*m+R*b+_*x-(A*m+L*b+F*x),K=S*m+L*y+w*x-(v*m+R*y+D*x),Z=M*m+F*y+D*b-(P*m+_*y+w*b),ee=S*p+M*g+C*h-(P*g+A*h+v*p),me=F*g+A*f+L*p-(R*p+_*g+C*f),Te=R*h+D*g+v*f-(w*g+S*f+L*h),ue=w*p+P*f+_*h-(F*h+D*p+M*f),ye=n*I+i*N+o*k+r*z;if(Math.abs(ye)<O.EPSILON21){if(J.equalsEpsilon(et.getMatrix3(e,jSe),WSe,O.EPSILON7)&&se.equals(et.getRow(e,3,qSe),YSe))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 ye=1/ye,t[0]=I*ye,t[1]=N*ye,t[2]=k*ye,t[3]=z*ye,t[4]=V*ye,t[5]=j*ye,t[6]=U*ye,t[7]=q*ye,t[8]=Y*ye,t[9]=te*ye,t[10]=K*ye,t[11]=Z*ye,t[12]=ee*ye,t[13]=me*ye,t[14]=Te*ye,t[15]=ue*ye,t};et.inverseTransformation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],l=e[8],u=e[9],f=e[10],h=e[12],p=e[13],g=e[14],m=-n*h-i*p-o*g,y=-r*h-s*p-a*g,b=-l*h-u*p-f*g;return t[0]=n,t[1]=r,t[2]=l,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=y,t[14]=b,t[15]=1,t};var XSe=new et;et.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),et.inverse(et.transpose(e,XSe),t)};et.IDENTITY=Object.freeze(new et(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));et.COLUMN0ROW0=0;et.COLUMN0ROW1=1;et.COLUMN0ROW2=2;et.COLUMN0ROW3=3;et.COLUMN1ROW0=4;et.COLUMN1ROW1=5;et.COLUMN1ROW2=6;et.COLUMN1ROW3=7;et.COLUMN2ROW0=8;et.COLUMN2ROW1=9;et.COLUMN2ROW2=10;et.COLUMN2ROW3=11;et.COLUMN3ROW0=12;et.COLUMN3ROW1=13;et.COLUMN3ROW2=14;et.COLUMN3ROW3=15;Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}});et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.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]};et.prototype.equalsEpsilon=function(e,t){return et.equalsEpsilon(this,e,t)};et.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`}};br.packedLength=9;br.fromArray=br.unpack;br.IDENTITY=new br(1,0,0,0,1,0,0,0,1);br.ZERO=new br(0,0,0,0,0,0,0,0,0);br.COLUMN0ROW0=0;br.COLUMN0ROW1=1;br.COLUMN0ROW2=2;br.COLUMN1ROW0=3;br.COLUMN1ROW1=4;br.COLUMN1ROW2=5;br.COLUMN2ROW0=6;br.COLUMN2ROW1=7;br.COLUMN2ROW2=8;var b3e=new h,x3e=new h,Dq=new h,eue=new h,T3e=new h,E3e=new h,gj=new br,tue=new br,C3e=new br;function v3e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var Rq=[1,0,0],Oq=[2,2,1];function S3e(e){let t=0;for(let n=0;n<3;++n){let i=e[br.getElementIndex(Oq[n],Rq[n])];t+=2*i*i}return Math.sqrt(t)}function w3e(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[br.getElementIndex(Oq[u],Rq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=Rq[r],c=Oq[r];if(Math.abs(e[br.getElementIndex(c,a)])>n){let u=e[br.getElementIndex(c,c)],f=e[br.getElementIndex(a,a)],d=e[br.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=br.clone(br.IDENTITY,t),t[br.getElementIndex(a,a)]=t[br.getElementIndex(c,c)]=o,t[br.getElementIndex(c,a)]=s,t[br.getElementIndex(a,c)]=-s,t}var $=br;function tD(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(tD.prototype=Object.create(Error.prototype),tD.prototype.constructor=tD);tD.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var oe=tD;var I3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),go=class e{constructor(t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){let b=Reflect.construct(Array,I3e,new.target);return b[0]=t??0,b[1]=o??0,b[2]=u??0,b[3]=g??0,b[4]=n??0,b[5]=s??0,b[6]=f??0,b[7]=m??0,b[8]=i??0,b[9]=a??0,b[10]=d??0,b[11]=y??0,b[12]=r??0,b[13]=c??0,b[14]=p??0,b[15]=A??0,b}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,s=i.y,a=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),E=2*(f+m),v=2*(u+A),S=-c+p-y+b,I=2*(g-d),R=2*(f-m),O=2*(g+d),L=-c-p+y+b;return r[0]=x*o,r[1]=v*o,r[2]=R*o,r[3]=0,r[4]=T*s,r[5]=S*s,r[6]=O*s,r[7]=0,r[8]=E*a,r[9]=I*a,r[10]=L*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,tv),h.normalize(h.cross(tv,o,nv),nv),h.normalize(h.cross(nv,tv,nD),nD);let s=nv.x,a=nv.y,c=nv.z,u=tv.x,f=tv.y,d=tv.z,p=nD.x,g=nD.y,m=nD.z,y=i.x,A=i.y,b=i.z,x=s*-y+a*-A+c*-b,T=p*-y+g*-A+m*-b,E=u*y+f*A+d*b;return l(n)?(n[0]=s,n[1]=p,n[2]=-u,n[3]=0,n[4]=a,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=E,n[15]=1,n):new e(s,a,c,x,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let a=1/Math.tan(t*.5),c=a/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,s,a){let c=1/(n-t),u=1/(r-i),f=1/(s-o),d=-(n+t)*c,p=-(r+i)*u,g=-(s+o)*f;return c*=2,u*=2,f*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=f,a[11]=0,a[12]=d,a[13]=p,a[14]=g,a[15]=1,a}static computePerspectiveOffCenter(t,n,i,r,o,s,a){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(s+o)/(s-o),g=-1,m=-2*s*o/(s-o);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=f,a[9]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,s){let a=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*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]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,s=t.y??0,a=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=a*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=s+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],s=t[r+1],a=t[r+2],c=t[r+3];return i.x=o,i.y=s,i.z=a,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],s=t[n+8],a=t[n+12];return i.x=r,i.y=o,i.z=s,i.w=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,P3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,D3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],Mq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],Mq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],Mq)),n}static getMaximumScale(t){return e.getScale(t,nue),h.maximumComponent(nue)}static setRotation(t,n,i){let r=e.getScale(t,R3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,O3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],E=n[0],v=n[1],S=n[2],I=n[3],R=n[4],O=n[5],L=n[6],_=n[7],C=n[8],w=n[9],P=n[10],M=n[11],F=n[12],V=n[13],B=n[14],j=n[15],k=r*E+c*v+p*S+A*I,G=o*E+u*v+g*S+b*I,q=s*E+f*v+m*S+x*I,Q=a*E+d*v+y*S+T*I,W=r*R+c*O+p*L+A*_,J=o*R+u*O+g*L+b*_,Z=s*R+f*O+m*L+x*_,ae=a*R+d*O+y*L+T*_,Ae=r*C+c*w+p*P+A*M,fe=o*C+u*w+g*P+b*M,xe=s*C+f*w+m*P+x*M,ge=a*C+d*w+y*P+T*M,we=r*F+c*V+p*B+A*j,Se=o*F+u*V+g*B+b*j,Re=s*F+f*V+m*B+x*j,Qe=a*F+d*V+y*B+T*j;return i[0]=k,i[1]=G,i[2]=q,i[3]=Q,i[4]=W,i[5]=J,i[6]=Z,i[7]=ae,i[8]=Ae,i[9]=fe,i[10]=xe,i[11]=ge,i[12]=we,i[13]=Se,i[14]=Re,i[15]=Qe,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],E=n[5],v=n[6],S=n[8],I=n[9],R=n[10],O=n[12],L=n[13],_=n[14],C=r*A+a*b+f*x,w=o*A+c*b+d*x,P=s*A+u*b+p*x,M=r*T+a*E+f*v,F=o*T+c*E+d*v,V=s*T+u*E+p*v,B=r*S+a*I+f*R,j=o*S+c*I+d*R,k=s*S+u*I+p*R,G=r*O+a*L+f*_+g,q=o*O+c*L+d*_+m,Q=s*O+u*L+p*_+y;return i[0]=C,i[1]=w,i[2]=P,i[3]=0,i[4]=M,i[5]=F,i[6]=V,i[7]=0,i[8]=B,i[9]=j,i[10]=k,i[11]=0,i[12]=G,i[13]=q,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],E=n[7],v=n[8],S=r*g+a*m+f*y,I=o*g+c*m+d*y,R=s*g+u*m+p*y,O=r*A+a*b+f*x,L=o*A+c*b+d*x,_=s*A+u*b+p*x,C=r*T+a*E+f*v,w=o*T+c*E+d*v,P=s*T+u*E+p*v;return i[0]=S,i[1]=I,i[2]=R,i[3]=0,i[4]=O,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=w,i[10]=P,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,s=n.z,a=r*t[0]+o*t[4]+s*t[8]+t[12],c=r*t[1]+o*t[5]+s*t[9]+t[13],u=r*t[2]+o*t[6]+s*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=a,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,s=n.z;return r===1&&o===1&&s===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=s*t[8],i[9]=s*t[9],i[10]=s*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=n.w,c=t[0]*r+t[4]*o+t[8]*s+t[12]*a,u=t[1]*r+t[5]*o+t[9]*s+t[13]*a,f=t[2]*r+t[6]*o+t[10]*s+t[14]*a,d=t[3]*r+t[7]*o+t[11]*s+t[15]*a;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s,c=t[1]*r+t[5]*o+t[9]*s,u=t[2]*r+t[6]*o+t[10]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s+t[12],c=t[1]*r+t[5]*o+t[9]*s+t[13],u=t[2]*r+t[6]*o+t[10]*s+t[14];return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return 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]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],s=t[6],a=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=s,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,E=m*b,v=p*x,S=m*A,I=p*b,R=g*A,O=d*x,L=m*y,_=d*b,C=g*y,w=d*A,P=p*y,M=T*c+S*u+I*f-(E*c+v*u+R*f),F=E*a+O*u+C*f-(T*a+L*u+_*f),V=v*a+L*c+w*f-(S*a+O*c+P*f),B=R*a+_*c+P*u-(I*a+C*c+w*u),j=E*r+v*o+R*s-(T*r+S*o+I*s),k=T*i+L*o+_*s-(E*i+O*o+C*s),G=S*i+O*r+P*s-(v*i+L*r+w*s),q=I*i+C*r+w*o-(R*i+_*r+P*o);T=o*f,E=s*u,v=r*f,S=s*c,I=r*u,R=o*c,O=i*f,L=s*a,_=i*u,C=o*a,w=i*c,P=r*a;let Q=T*A+S*b+I*x-(E*A+v*b+R*x),W=E*y+O*b+C*x-(T*y+L*b+_*x),J=v*y+L*A+w*x-(S*y+O*A+P*x),Z=R*y+_*A+P*b-(I*y+C*A+w*b),ae=v*g+R*m+E*p-(I*m+T*p+S*g),Ae=_*m+T*d+L*g-(O*g+C*m+E*d),fe=O*p+P*m+S*d-(w*m+v*d+L*p),xe=w*g+I*d+C*p-(_*p+P*g+R*d),ge=i*M+r*F+o*V+s*B;if(Math.abs(ge)<D.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,M3e),N3e,D.EPSILON7)&&se.equals(e.getRow(t,3,L3e),F3e))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=M*ge,n[1]=F*ge,n[2]=V*ge,n[3]=B*ge,n[4]=j*ge,n[5]=k*ge,n[6]=G*ge,n[7]=q*ge,n[8]=Q*ge,n[9]=W*ge,n[10]=J*ge,n[11]=Z*ge,n[12]=ae*ge,n[13]=Ae*ge,n[14]=fe*ge,n[15]=xe*ge,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-s*p-a*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=s,n[2]=u,n[3]=0,n[4]=r,n[5]=a,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,B3e),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){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 B=et;var KSe={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},ne=Object.freeze(KSe);var $Se=new d;function wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ua={};ua[ne.FLOAT]="float";ua[ne.FLOAT_VEC2]="vec2";ua[ne.FLOAT_VEC3]="vec3";ua[ne.FLOAT_VEC4]="vec4";ua[ne.INT]="int";ua[ne.INT_VEC2]="ivec2";ua[ne.INT_VEC3]="ivec3";ua[ne.INT_VEC4]="ivec4";ua[ne.BOOL]="bool";ua[ne.BOOL_VEC2]="bvec2";ua[ne.BOOL_VEC3]="bvec3";ua[ne.BOOL_VEC4]="bvec4";ua[ne.FLOAT_MAT2]="mat2";ua[ne.FLOAT_MAT3]="mat3";ua[ne.FLOAT_MAT4]="mat4";ua[ne.SAMPLER_2D]="sampler2D";ua[ne.SAMPLER_CUBE]="samplerCube";wt.prototype.getDeclaration=function(e){let t=`uniform ${ua[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var ZSe={czm_viewport:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new wt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return B.getTranslation(e.inverseView,$Se)}}),czm_frameNumber:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new wt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new wt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new wt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new wt({size:9,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Ap=ZSe;function QSe(){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 jn=QSe;function JSe(){return!0}function ewe(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){throw new E(t)}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=JSe}var de=ewe;var Vs={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT};Vs.getSizeInBytes=function(e){switch(e){case Vs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Vs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Vs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new E("indexDatatype is required and must be a valid IndexDatatype constant.")};Vs.fromSizeInBytes=function(e){switch(e){case 2:return Vs.UNSIGNED_SHORT;case 4:return Vs.UNSIGNED_INT;case 1:return Vs.UNSIGNED_BYTE;default:throw new E("Size in bytes cannot be mapped to an IndexDatatype")}};Vs.validate=function(e){return c(e)&&(e===Vs.UNSIGNED_BYTE||e===Vs.UNSIGNED_SHORT||e===Vs.UNSIGNED_INT)};Vs.createTypedArray=function(e,t){if(!c(e))throw new E("numberOfVertices is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Vs.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!c(e))throw new E("numberOfVertices is required.");if(!c(t))throw new E("sourceArray is required.");if(!c(n))throw new E("byteOffset is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Vs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Vs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Vs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Vs.UNSIGNED_INT;throw new E("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var Fe=Object.freeze(Vs);var DU={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,validate:function(e){return e===DU.STREAM_DRAW||e===DU.STATIC_DRAW||e===DU.DYNAMIC_DRAW}},Be=Object.freeze(DU);function yf(e){if(e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),!c(e.typedArray)&&!c(e.sizeInBytes))throw new E("Either options.sizeInBytes or options.typedArray is required.");if(c(e.typedArray)&&c(e.sizeInBytes))throw new E("Cannot pass in both options.sizeInBytes and options.typedArray.");if(c(e.typedArray)&&(T.typeOf.object("options.typedArray",e.typedArray),T.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Be.validate(e.usage))throw new E("usage is invalid.");let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=c(i);s&&(o=i.byteLength),T.typeOf.number.greaterThan("sizeInBytes",o,0);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}yf.createVertexBuffer=function(e){return T.defined("options.context",e.context),new yf({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};yf.createIndexBuffer=function(e){if(T.defined("options.context",e.context),!Fe.validate(e.indexDatatype))throw new E("Invalid indexDatatype.");if(e.indexDatatype===Fe.UNSIGNED_INT&&!e.context.elementIndexUint)throw new E("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");let t=e.context,n=e.indexDatatype,i=Fe.getSizeInBytes(n),o=new yf({context:t,bufferTarget:ne.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(yf.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});yf.prototype._getBuffer=function(){return this._buffer};yf.prototype.copyFromArrayView=function(e,t){t=t??0,T.defined("arrayView",e),T.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};yf.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new E("A WebGL 2 context is required.");if(!c(e))throw new E("readBuffer must be defined.");if(!c(i)||i<=0)throw new E("sizeInBytes must be defined and be greater than zero.");if(!c(t)||t<0||t+i>e._sizeInBytes)throw new E("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!c(n)||n<0||n+i>this._sizeInBytes)throw new E("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new E("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===ne.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==ne.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==ne.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===ne.ELEMENT_ARRAY_BUFFER)throw new E("Can not copy an index buffer into another buffer type.");let o=ne.COPY_READ_BUFFER,r=ne.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)};yf.prototype.getBufferData=function(e,t,n,i){if(t=t??0,n=n??0,!this._webgl2)throw new E("A WebGL 2 context is required.");if(!c(e))throw new E("arrayView is required.");let o,r,s=e.byteLength;if(c(i)?(o=i,c(s)?r=1:(s=e.length,r=e.BYTES_PER_ELEMENT)):c(s)?(o=s-n,r=1):(s=e.length,o=s-n,r=e.BYTES_PER_ELEMENT),n<0||n>s)throw new E("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>s)throw new E("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new E("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*r>this._sizeInBytes)throw new E("sourceOffset + length must be less than the buffers size.");let a=this._gl,l=ne.COPY_READ_BUFFER;a.bindBuffer(l,this._buffer),a.getBufferSubData(l,t,e,n,i),a.bindBuffer(l,null)};yf.prototype.isDestroyed=function(){return!1};yf.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),de(this)};var yt=yf;var Fg,Br={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[Br.fullscreenElement]}},changeEventName:{get:function(){if(vl.supportsFullscreen())return Br.fullscreenchange}},errorEventName:{get:function(){if(vl.supportsFullscreen())return Br.fullscreenerror}},enabled:{get:function(){if(vl.supportsFullscreen())return document[Br.fullscreenEnabled]}},fullscreen:{get:function(){if(vl.supportsFullscreen())return vl.element!==null}}});vl.supportsFullscreen=function(){if(c(Fg))return Fg;Fg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Br.requestFullscreen="requestFullscreen",Br.exitFullscreen="exitFullscreen",Br.fullscreenEnabled="fullscreenEnabled",Br.fullscreenElement="fullscreenElement",Br.fullscreenchange="fullscreenchange",Br.fullscreenerror="fullscreenerror",Fg=!0,Fg;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"?(Br.requestFullscreen=n,Fg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Br.requestFullscreen=n,Fg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Br.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Br.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Br.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Br.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Br.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Br.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Br.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Br.fullscreenerror=n)}return Fg};vl.requestFullscreen=function(e,t){vl.supportsFullscreen()&&e[Br.requestFullscreen]({vrDisplay:t})};vl.exitFullscreen=function(){vl.supportsFullscreen()&&document[Br.exitFullscreen]()};vl._names=Br;var Cr=vl;var oc;typeof navigator<"u"?oc=navigator:oc={};function ib(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var PU,xJ;function V5(){if(!c(PU)&&(PU=!1,!NU())){let e=/ Chrome\/([\.0-9]+)/.exec(oc.userAgent);e!==null&&(PU=!0,xJ=ib(e[1]))}return PU}function twe(){return V5()&&xJ}var IU,TJ;function AJ(){if(!c(IU)&&(IU=!1,!V5()&&!NU()&&/ Safari\/[\.0-9]+/.test(oc.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(oc.userAgent);e!==null&&(IU=!0,TJ=ib(e[1]))}return IU}function nwe(){return AJ()&&TJ}var OU,k5;function CJ(){if(!c(OU)){OU=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(oc.userAgent);e!==null&&(OU=!0,k5=ib(e[1]),k5.isNightly=!!e[2])}return OU}function iwe(){return CJ()&&k5}var fv,U5;function EJ(){if(!c(fv)){fv=!1;let e;oc.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(oc.userAgent),e!==null&&(fv=!0,U5=ib(e[1]))):oc.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(oc.userAgent),e!==null&&(fv=!0,U5=ib(e[1])))}return fv}function owe(){return EJ()&&U5}var RU,SJ;function NU(){if(!c(RU)){RU=!1;let e=/ Edg\/([\.0-9]+)/.exec(oc.userAgent);e!==null&&(RU=!0,SJ=ib(e[1]))}return RU}function rwe(){return NU()&&SJ}var MU,z5;function FU(){if(!c(MU)){MU=!1;let e=/Firefox\/([\.0-9]+)/.exec(oc.userAgent);e!==null&&(MU=!0,z5=ib(e[1]))}return MU}var N5;function swe(){return c(N5)||(N5=/Windows/i.test(oc.appVersion)),N5}var F5;function awe(){return c(F5)||(F5=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),F5}function cwe(){return FU()&&z5}var B5;function lwe(){return c(B5)||(B5=!FU()&&typeof PointerEvent<"u"&&(!c(oc.pointerEnabled)||oc.pointerEnabled)),B5}var wJ,LU;function vJ(){if(!c(LU)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;LU=c(t)&&t!=="",LU&&(wJ=t)}return LU}function uwe(){return vJ()?wJ:void 0}function ic(){if(!ic.initialized)throw new E("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return ic._result}ic._promise=void 0;ic._result=void 0;ic.initialize=function(){return c(ic._promise)||(ic._promise=new Promise(e=>{let t=new Image;t.onload=function(){ic._result=t.width>0&&t.height>0,e(ic._result)},t.onerror=function(){ic._result=!1,e(ic._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ic._promise};Object.defineProperties(ic,{initialized:{get:function(){return c(ic._result)}}});var ZA=[];typeof ArrayBuffer<"u"&&(ZA.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&ZA.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&ZA.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&ZA.push(BigInt64Array),typeof BigUint64Array<"u"&&ZA.push(BigUint64Array));var bf={isChrome:V5,chromeVersion:twe,isSafari:AJ,safariVersion:nwe,isWebkit:CJ,webkitVersion:iwe,isInternetExplorer:EJ,internetExplorerVersion:owe,isEdge:NU,edgeVersion:rwe,isFirefox:FU,firefoxVersion:cwe,isWindows:swe,isIPadOrIOS:awe,hardwareConcurrency:oc.hardwareConcurrency??3,supportsPointerEvents:lwe,supportsImageRenderingPixelated:vJ,supportsWebP:ic,imageRenderingValue:uwe,typedArrayTypes:ZA};bf.supportsBasis=function(e){return bf.supportsWebAssembly()&&e.context.supportsBasis};bf.supportsFullscreen=function(){return Cr.supportsFullscreen()};bf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bf.supportsBigInt=function(){return typeof BigInt<"u"};bf.supportsWebWorkers=function(){return typeof Worker<"u"};bf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bf.supportsWebgl2=function(e){return T.defined("scene",e),e.context.webgl2};bf.supportsEsmWebWorkers=function(){return!FU()||parseInt(z5)>=114};var Vt=bf;function H5(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=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}re.fromCartesian4=function(e,t){return T.typeOf.object("cartesian",e),c(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(e??255),t=re.byteToFloat(t??255),n=re.byteToFloat(n??255),i=re.byteToFloat(i??255),c(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 T.typeOf.object("color",e),T.typeOf.number("alpha",t),c(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 G5,j5,Cp;Vt.supportsTypedArrays()&&(G5=new ArrayBuffer(4),j5=new Uint32Array(G5),Cp=new Uint8Array(G5));re.fromRgba=function(e,t){return j5[0]=e,re.fromBytes(Cp[0],Cp[1],Cp[2],Cp[3],t)};re.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;let u=2*n-l;r=H5(u,l,e+1/3),s=H5(u,l,e),a=H5(u,l,e-1/3)}return c(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=e??W.EMPTY_OBJECT;let n=e.red;if(!c(n)){let s=e.minimumRed??0,a=e.maximumRed??1;T.typeOf.number.lessThanOrEquals("minimumRed",s,a),n=s+O.nextRandomNumber()*(a-s)}let i=e.green;if(!c(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;T.typeOf.number.lessThanOrEquals("minimumGreen",s,a),i=s+O.nextRandomNumber()*(a-s)}let o=e.blue;if(!c(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;T.typeOf.number.lessThanOrEquals("minimumBlue",s,a),o=s+O.nextRandomNumber()*(a-s)}let r=e.alpha;if(!c(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;T.typeOf.number.lessThanOrEquals("minimumAlpha",s,a),r=s+O.nextRandomNumber()*(a-s)}return c(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var fwe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,dwe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,hwe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,mwe=/^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){T.typeOf.string("color",e),c(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(c(n))return re.clone(n,t),t;let i=fwe.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(i[4]??"f",16)/15,t):(i=dwe.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(i[4]??"ff",16)/255,t):(i=hwe.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(i[4]??"1.0"),t):(i=mwe.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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.defined("array",e),t=t??0,c(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(c(e))return c(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||c(e)&&c(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||c(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 c(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return Cp[0]=re.floatToByte(this.red),Cp[1]=re.floatToByte(this.green),Cp[2]=re.floatToByte(this.blue),Cp[3]=re.floatToByte(this.alpha),j5[0]};re.prototype.brighten=function(e,t){return T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),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 T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),i.red=O.lerp(e.red,t.red,n),i.green=O.lerp(e.green,t.green,n),i.blue=O.lerp(e.blue,t.blue,n),i.alpha=O.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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 T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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 G=re;function BU(e){e=e??W.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}BU.ALL=Object.freeze(new BU({color:new G(0,0,0,0),depth:1,stencil:0}));BU.prototype.execute=function(e,t){e.clear(this,t)};var ei=BU;var pwe={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},De=Object.freeze(pwe);function DJ(e){e=e??W.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=e.persists??!1,this.pass=De.COMPUTE,this.owner=e.owner}DJ.prototype.execute=function(e){e.execute(this)};var Uc=DJ;function Ft(e,t){this.x=e??0,this.y=t??0}Ft.fromElements=function(e,t,n){return c(n)?(n.x=e,n.y=t,n):new Ft(e,t)};Ft.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t):new Ft(e.x,e.y)};Ft.fromCartesian3=Ft.clone;Ft.fromCartesian4=Ft.clone;Ft.packedLength=2;Ft.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n]=e.y,t};Ft.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Ft),n.x=e[t++],n.y=e[t],n};Ft.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*2;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Ft.pack(e[o],t,o*2);return t};Ft.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new E("array length must be a multiple of 2.");let n=e.length;c(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ft.unpack(e,i,t[o])}return t};Ft.fromArray=Ft.unpack;Ft.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y)};Ft.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y)};Ft.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ft.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ft.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ft.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y};Ft.magnitude=function(e){return Math.sqrt(Ft.magnitudeSquared(e))};var kU=new Ft;Ft.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.subtract(e,t,kU),Ft.magnitude(kU)};Ft.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.subtract(e,t,kU),Ft.magnitudeSquared(kU)};Ft.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Ft.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new E("normalized result is not a number");return t};Ft.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y};Ft.cross=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.y-e.y*t.x};Ft.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n};Ft.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n};Ft.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n};Ft.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n};Ft.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n};Ft.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n};Ft.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t};Ft.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var PJ=new Ft;Ft.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),Ft.multiplyByScalar(t,n,PJ),i=Ft.multiplyByScalar(e,1-n,i),Ft.add(PJ,i,i)};var IJ=new Ft,OJ=new Ft;Ft.angleBetween=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.normalize(e,IJ),Ft.normalize(t,OJ),O.acosClamped(Ft.dot(IJ,OJ))};var _we=new Ft;Ft.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Ft.normalize(e,_we);return Ft.abs(n,n),n.x<=n.y?t=Ft.clone(Ft.UNIT_X,t):t=Ft.clone(Ft.UNIT_Y,t),t};Ft.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y};Ft.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ft.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)};Ft.ZERO=Object.freeze(new Ft(0,0));Ft.ONE=Object.freeze(new Ft(1,1));Ft.UNIT_X=Object.freeze(new Ft(1,0));Ft.UNIT_Y=Object.freeze(new Ft(0,1));Ft.prototype.clone=function(e){return Ft.clone(this,e)};Ft.prototype.equals=function(e){return Ft.equals(this,e)};Ft.prototype.equalsEpsilon=function(e,t,n){return Ft.equalsEpsilon(this,e,t,n)};Ft.prototype.toString=function(){return`(${this.x}, ${this.y})`};var H=Ft;var gwe=new d,ywe=new d;function bwe(e,t,n,i,o){if(!c(e))throw new E("cartesian is required.");if(!c(t))throw new E("oneOverRadii is required.");if(!c(n))throw new E("oneOverRadiiSquared is required.");if(!c(i))throw new E("centerToleranceSquared is required.");let r=e.x,s=e.y,a=e.z,l=t.x,u=t.y,f=t.z,h=r*r*l*l,p=s*s*u*u,g=a*a*f*f,m=h+p+g,y=Math.sqrt(1/m),b=d.multiplyByScalar(e,y,gwe);if(m<i)return isFinite(y)?d.clone(b,o):void 0;let x=n.x,A=n.y,C=n.z,S=ywe;S.x=b.x*x*2,S.y=b.y*A*2,S.z=b.z*C*2;let v=(1-y)*d.magnitude(e)/(.5*d.magnitude(S)),P=0,M,R,L,F,_,w,D,I,N,k,z;do{v-=P,L=1/(1+v*x),F=1/(1+v*A),_=1/(1+v*C),w=L*L,D=F*F,I=_*_,N=w*L,k=D*F,z=I*_,M=h*w+p*D+g*I-1,R=h*N*x+p*k*A+g*z*C;let V=-2*R;P=M/V}while(Math.abs(M)>O.EPSILON12);return c(o)?(o.x=r*L,o.y=s*F,o.z=a*_,o):new d(r*L,s*F,a*_)}var ob=bwe;function zo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}zo.fromRadians=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0,c(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new zo(e,t,n)};zo.fromDegrees=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),zo.fromRadians(e,t,n,i)};var xwe=new d,Twe=new d,Awe=new d;zo._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);zo._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));zo._ellipsoidCenterToleranceSquared=O.EPSILON1;zo.fromCartesian=function(e,t,n){let i=c(t)?t.oneOverRadii:zo._ellipsoidOneOverRadii,o=c(t)?t.oneOverRadiiSquared:zo._ellipsoidOneOverRadiiSquared,r=c(t)?t._centerToleranceSquared:zo._ellipsoidCenterToleranceSquared,s=ob(e,i,o,r,Twe);if(!c(s))return;let a=d.multiplyComponents(s,o,xwe);a=d.normalize(a,a);let l=d.subtract(e,s,Awe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=O.sign(d.dot(l,e))*d.magnitude(l);return c(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new zo(u,f,h)};zo.toCartesian=function(e,t,n){return T.defined("cartographic",e),d.fromRadians(e.longitude,e.latitude,e.height,t,n)};zo.clone=function(e,t){if(c(e))return c(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new zo(e.longitude,e.latitude,e.height)};zo.equals=function(e,t){return e===t||c(e)&&c(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};zo.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};zo.ZERO=Object.freeze(new zo(0,0,0));zo.prototype.clone=function(e){return zo.clone(this,e)};zo.prototype.equals=function(e){return zo.equals(this,e)};zo.prototype.equalsEpsilon=function(e,t){return zo.equalsEpsilon(this,e,t)};zo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=zo;function MJ(e,t,n,i){t=t??0,n=n??0,i=i??0,T.typeOf.number.greaterThanOrEquals("x",t,0),T.typeOf.number.greaterThanOrEquals("y",n,0),T.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(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=O.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,MJ(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(!c(e))return;let n=e._radii;return c(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.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 c(t)||(t=new gi),c(e)&&MJ(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(O.LUNAR_RADIUS,O.LUNAR_RADIUS,O.LUNAR_RADIUS));gi._default=gi.WGS84;Object.defineProperties(gi,{default:{get:function(){return gi._default},set:function(e){T.typeOf.object("value",e),gi._default=e,d._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=d.packedLength;gi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._radii,t,n),t};gi.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t);return gi.fromCartesian3(i,n)};gi.prototype.geocentricSurfaceNormal=d.normalize;gi.prototype.geodeticSurfaceNormalCartographic=function(e,t){T.typeOf.object("cartographic",e);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 c(t)||(t=new d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};gi.prototype.geodeticSurfaceNormal=function(e,t){if(T.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new E("cartesian has a NaN component");if(!d.equalsEpsilon(e,d.ZERO,O.EPSILON14))return c(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var Cwe=new d,Ewe=new d;gi.prototype.cartographicToCartesian=function(e,t){let n=Cwe,i=Ewe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),c(t)||(t=new d),d.add(i,n,t)};gi.prototype.cartographicArrayToCartesianArray=function(e,t){T.defined("cartographics",e);let n=e.length;c(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 Swe=new d,wwe=new d,vwe=new d;gi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,wwe);if(!c(n))return;let i=this.geodeticSurfaceNormal(n,Swe),o=d.subtract(e,n,vwe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=O.sign(d.dot(o,e))*d.magnitude(o);return c(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};gi.prototype.cartesianArrayToCartographicArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(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 ob(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};gi.prototype.scaleToGeocentricSurface=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new d);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 d.multiplyByScalar(e,s,t)};gi.prototype.transformPositionToScaledSpace=function(e,t){return c(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};gi.prototype.transformPositionFromScaledSpace=function(e,t){return c(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};gi.prototype.equals=function(e){return this===e||c(e)&&d.equals(this._radii,e._radii)};gi.prototype.toString=function(){return this._radii.toString()};gi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(T.typeOf.object("position",e),!O.equalsEpsilon(this._radii.x,this._radii.y,O.EPSILON15))throw new E("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");T.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=t??0;let i=this._squaredXOverSquaredZ;if(c(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var Dwe=new d;gi.prototype.getLocalCurvature=function(e,t){T.typeOf.object("surfacePosition",e),c(t)||(t=new H);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,Dwe),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return H.fromElements(1/i,1/r,t)};var Pwe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Iwe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function RJ(e,t,n){T.typeOf.number("a",e),T.typeOf.number("b",t),T.typeOf.func("func",n);let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*Pwe[s];r+=Iwe[s]*(n(i+a)+n(i-a))}return r*=o,r}gi.prototype.surfaceArea=function(e){T.typeOf.object("rectangle",e);let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=O.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,l=r.z,u=s*a;return RJ(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*RJ(t,n,function(g){let m=Math.cos(g),y=Math.sin(g);return Math.sqrt(u*p*p+l*(a*m*m+s*y*y)*h*h)})})};var ie=gi;function UU(e){this._ellipsoid=e??ie.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(UU.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});UU.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};UU.prototype.unproject=function(e,t){if(!c(e))throw new E("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Oi=UU;var Owe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Wt=Object.freeze(Owe);function Rwe(e,t,n){T.defined("array",e),T.defined("itemToFind",t),T.defined("comparator",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 Lo=Rwe;function Mwe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Bg=Mwe;function Lwe(e){if(e===null||isNaN(e))throw new E("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var Dd=Lwe;var LJ=[31,28,31,30,31,30,31,31,30,31,30,31];function Nwe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,y(),b(),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 y(){T.typeOf.number.greaterThanOrEquals("Year",e,1),T.typeOf.number.lessThanOrEquals("Year",e,9999),T.typeOf.number.greaterThanOrEquals("Month",t,1),T.typeOf.number.lessThanOrEquals("Month",t,12),T.typeOf.number.greaterThanOrEquals("Day",n,1),T.typeOf.number.lessThanOrEquals("Day",n,31),T.typeOf.number.greaterThanOrEquals("Hour",i,0),T.typeOf.number.lessThanOrEquals("Hour",i,23),T.typeOf.number.greaterThanOrEquals("Minute",o,0),T.typeOf.number.lessThanOrEquals("Minute",o,59),T.typeOf.bool("IsLeapSecond",a),T.typeOf.number.greaterThanOrEquals("Second",r,0),T.typeOf.number.lessThanOrEquals("Second",r,a?60:59),T.typeOf.number.greaterThanOrEquals("Millisecond",s,0),T.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let x=t===2&&Dd(e)?LJ[t-1]+1:LJ[t-1];if(n>x)throw new E("Month and Day represents invalid date")}}var im=Nwe;function Fwe(e,t){this.julianDate=e,this.offset=t}var Yi=Fwe;var Bwe={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},qn=Object.freeze(Bwe);var kwe={UTC:0,TAI:1},Wn=Object.freeze(kwe);var FJ=new im,VU=[31,28,31,30,31,30,31,31,30,31,30,31],zU=29;function W5(e,t){return It.compare(e.julianDate,t.julianDate)}var QA=new Yi;function GU(e){QA.julianDate=e;let t=It.leapSeconds,n=Lo(t,QA,W5);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&It.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),It.addSeconds(e,i,e)}function NJ(e,t){QA.julianDate=e;let n=It.leapSeconds,i=Lo(n,QA,W5);if(i<0&&(i=~i),i===0)return It.addSeconds(e,-n[0].offset,t);if(i>=n.length)return It.addSeconds(e,-n[i-1].offset,t);let o=It.secondsDifference(n[i].julianDate,e);if(o===0)return It.addSeconds(e,-n[i].offset,t);if(!(o<=1))return It.addSeconds(e,-n[--i].offset,t)}function kg(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function q5(e,t,n,i,o,r,s){let a=(t-14)/12|0,l=e+4800+a,u=(1461*l/4|0)+(367*(t-2-12*a)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var Uwe=/^(\d{4})$/,Vwe=/^(\d{4})-(\d{2})$/,zwe=/^(\d{4})-?(\d{3})$/,Hwe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Gwe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Y5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,jwe=/^(\d{2})(\.\d+)?/.source+Y5.source,Wwe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Y5.source,qwe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Y5.source,Pd="Invalid ISO 8601 date.";function It(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Wn.UTC;let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,kg(i,t,this),n===Wn.UTC&&GU(this)}It.fromGregorianDate=function(e,t){if(!(e instanceof im))throw new E("date must be a valid GregorianDate.");let n=q5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return c(t)?(kg(n[0],n[1],t),GU(t),t):new It(n[0],n[1],Wn.UTC)};It.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new E("date must be a valid JavaScript Date.");let n=q5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return c(t)?(kg(n[0],n[1],t),GU(t),t):new It(n[0],n[1],Wn.UTC)};It.fromIso8601=function(e,t){if(typeof e!="string")throw new E(Pd);e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,l=0,u=0,f=n[0],h=n[1],p,g;if(!c(f))throw new E(Pd);let m;if(n=f.match(Gwe),n!==null){if(m=f.split("-").length-1,m>0&&m!==2)throw new E(Pd);i=+n[1],o=+n[2],r=+n[3]}else if(n=f.match(Vwe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(Uwe),n!==null)i=+n[1];else{let A;if(n=f.match(zwe),n!==null){if(i=+n[1],A=+n[2],g=Dd(i),A<1||g&&A>366||!g&&A>365)throw new E(Pd)}else if(n=f.match(Hwe),n!==null){i=+n[1];let C=+n[2],S=+n[3]||0;if(m=f.split("-").length-1,m>0&&(!c(n[3])&&m!==1||c(n[3])&&m!==2))throw new E(Pd);let v=new Date(Date.UTC(i,0,4));A=C*7+S-v.getUTCDay()-3}else throw new E(Pd);p=new Date(Date.UTC(i,0,1)),p.setUTCDate(A),o=p.getUTCMonth()+1,r=p.getUTCDate()}if(g=Dd(i),o<1||o>12||r<1||(o!==2||!g)&&r>VU[o-1]||g&&o===2&&r>zU)throw new E(Pd);let y;if(c(h)){if(n=h.match(qwe),n!==null){if(m=h.split(":").length-1,m>0&&m!==2&&m!==3)throw new E(Pd);s=+n[1],a=+n[2],l=+n[3],u=+(n[4]||0)*1e3,y=5}else if(n=h.match(Wwe),n!==null){if(m=h.split(":").length-1,m>2)throw new E(Pd);s=+n[1],a=+n[2],l=+(n[3]||0)*60,y=4}else if(n=h.match(jwe),n!==null)s=+n[1],a=+(n[2]||0)*60,y=3;else throw new E(Pd);if(a>=60||l>=61||s>24||s===24&&(a>0||l>0||u>0))throw new E(Pd);let A=n[y],C=+n[y+1],S=+(n[y+2]||0);switch(A){case"+":s=s-C,a=a-S;break;case"-":s=s+C,a=a+S;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let b=l===60;for(b&&l--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?zU:VU[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?zU:VU[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?zU:VU[o-1],r+=p;let x=q5(i,o,r,s,a,l,u);return c(t)?(kg(x[0],x[1],t),GU(t)):t=new It(x[0],x[1],Wn.UTC),b&&It.addSeconds(t,1,t),t};It.now=function(e){return It.fromDate(new Date,e)};var HU=new It(0,0,Wn.TAI);It.toGregorianDate=function(e,t){if(!c(e))throw new E("julianDate is required.");let n=!1,i=NJ(e,HU);c(i)||(It.addSeconds(e,-1,HU),i=NJ(HU,HU),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 l=4e3*(s+1)/1461001|0;s=s-(1461*l/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,p=100*(a-49)+l+s|0,g=r/qn.SECONDS_PER_HOUR|0,m=r-g*qn.SECONDS_PER_HOUR,y=m/qn.SECONDS_PER_MINUTE|0;m=m-y*qn.SECONDS_PER_MINUTE;let b=m|0,x=(m-b)/qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),c(t)?(t.year=p,t.month=h,t.day=f,t.hour=g,t.minute=y,t.second=b,t.millisecond=x,t.isLeapSecond=n,t):new im(p,h,f,g,y,b,x,n)};It.toDate=function(e){if(!c(e))throw new E("julianDate is required.");let t=It.toGregorianDate(e,FJ),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))};It.toIso8601=function(e,t){if(!c(e))throw new E("julianDate is required.");let n=It.toGregorianDate(e,FJ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,l=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&l===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!c(t)&&u!==0){let h=u*.01;return f=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")}:${l.toString().padStart(2,"0")}.${f}Z`}return!c(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")}:${l.toString().padStart(2,"0")}Z`:(f=(u*.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")}:${l.toString().padStart(2,"0")}.${f}Z`)};It.clone=function(e,t){if(c(e))return c(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new It(e.dayNumber,e.secondsOfDay,Wn.TAI)};It.compare=function(e,t){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};It.equals=function(e,t){return e===t||c(e)&&c(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};It.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(It.secondsDifference(e,t))<=n};It.totalDays=function(e){if(!c(e))throw new E("julianDate is required.");return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};It.secondsDifference=function(e,t){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};It.daysDifference=function(e,t){if(!c(e))throw new E("left is required.");if(!c(t))throw new E("right is required.");let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};It.computeTaiMinusUtc=function(e){QA.julianDate=e;let t=It.leapSeconds,n=Lo(t,QA,W5);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};It.addSeconds=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("seconds is required.");if(!c(n))throw new E("result is required.");return kg(e.dayNumber,e.secondsOfDay+t,n)};It.addMinutes=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("minutes is required.");if(!c(n))throw new E("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return kg(e.dayNumber,i,n)};It.addHours=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("hours is required.");if(!c(n))throw new E("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return kg(e.dayNumber,i,n)};It.addDays=function(e,t,n){if(!c(e))throw new E("julianDate is required.");if(!c(t))throw new E("days is required.");if(!c(n))throw new E("result is required.");let i=e.dayNumber+t;return kg(i,e.secondsOfDay,n)};It.lessThan=function(e,t){return It.compare(e,t)<0};It.lessThanOrEquals=function(e,t){return It.compare(e,t)<=0};It.greaterThan=function(e,t){return It.compare(e,t)>0};It.greaterThanOrEquals=function(e,t){return It.compare(e,t)>=0};It.prototype.clone=function(e){return It.clone(this,e)};It.prototype.equals=function(e){return It.equals(this,e)};It.prototype.equalsEpsilon=function(e,t){return It.equalsEpsilon(this,e,t)};It.prototype.toString=function(){return It.toIso8601(this)};It.leapSeconds=[new Yi(new It(2441317,43210,Wn.TAI),10),new Yi(new It(2441499,43211,Wn.TAI),11),new Yi(new It(2441683,43212,Wn.TAI),12),new Yi(new It(2442048,43213,Wn.TAI),13),new Yi(new It(2442413,43214,Wn.TAI),14),new Yi(new It(2442778,43215,Wn.TAI),15),new Yi(new It(2443144,43216,Wn.TAI),16),new Yi(new It(2443509,43217,Wn.TAI),17),new Yi(new It(2443874,43218,Wn.TAI),18),new Yi(new It(2444239,43219,Wn.TAI),19),new Yi(new It(2444786,43220,Wn.TAI),20),new Yi(new It(2445151,43221,Wn.TAI),21),new Yi(new It(2445516,43222,Wn.TAI),22),new Yi(new It(2446247,43223,Wn.TAI),23),new Yi(new It(2447161,43224,Wn.TAI),24),new Yi(new It(2447892,43225,Wn.TAI),25),new Yi(new It(2448257,43226,Wn.TAI),26),new Yi(new It(2448804,43227,Wn.TAI),27),new Yi(new It(2449169,43228,Wn.TAI),28),new Yi(new It(2449534,43229,Wn.TAI),29),new Yi(new It(2450083,43230,Wn.TAI),30),new Yi(new It(2450630,43231,Wn.TAI),31),new Yi(new It(2451179,43232,Wn.TAI),32),new Yi(new It(2453736,43233,Wn.TAI),33),new Yi(new It(2454832,43234,Wn.TAI),34),new Yi(new It(2456109,43235,Wn.TAI),35),new Yi(new It(2457204,43236,Wn.TAI),36),new Yi(new It(2457754,43237,Wn.TAI),37)];var Q=It;var tee=Zo(du(),1);function Ywe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var dv=Ywe;function GJ(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=GJ(o,t)),n[i]=o}return n}var je=GJ;function jJ(e,t,n){n=n??!1;let i={},o=c(e),r=c(t),s,a,l;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(l=t[s],typeof l=="object"?i[s]=jJ(a,l,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(l=t[s],i[s]=l);return i}var xt=jJ;function Xwe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Dl=Xwe;var WJ=Zo(du(),1);function X5(e,t){let n;return typeof document<"u"&&(n=document),X5._implementation(e,t,n)}X5._implementation=function(e,t,n){if(!c(e))throw new E("relative uri is required.");if(!c(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new WJ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var om=X5;var qJ=Zo(du(),1);function Kwe(e,t){if(!c(e))throw new E("uri is required.");let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new qJ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var hv=Kwe;var YJ=Zo(du(),1);function $we(e){if(!c(e))throw new E("uri is required.");let t=new YJ.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 rb=$we;var XJ={};function Zwe(e,t,n){c(t)||(t=e.width),c(n)||(n=e.height);let i=XJ[t];c(i)||(i={},XJ[t]=i);let o=i[n];if(!c(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 Id=Zwe;var Qwe=/^blob:/i;function Jwe(e){return T.typeOf.string("uri",e),Qwe.test(e)}var sb=Jwe;var rm;function eve(e){c(rm)||(rm=document.createElement("a")),rm.href=window.location.href;let t=rm.host,n=rm.protocol;return rm.href=e,rm.href=rm.href,n!==rm.protocol||t!==rm.host}var Ug=eve;var tve=/^data:/i;function nve(e){return T.typeOf.string("uri",e),tve.test(e)}var Ep=nve;function ive(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 ab=ive;function ove(e){if(!c(e))throw new E("obj is required.");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 cb=ove;function rve(e){if(!c(e))throw new E("queryString is required.");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];c(a)?a=decodeURIComponent(a):a="";let l=t[s];typeof l=="string"?t[s]=[l,a]:Array.isArray(l)?l.push(a):t[s]=a}return t}var hu=rve;var sve={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},$n=Object.freeze(sve);var ave={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ms=Object.freeze(ave);function YU(e){e=e??W.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??ms.OTHER,this.serverKey=e.serverKey,this.state=$n.UNISSUED,this.deferred=void 0,this.cancelled=!1}YU.prototype.cancel=function(){this.cancelled=!0};YU.prototype.clone=function(e){return c(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=$n.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new YU(this)};var Qo=YU;function cve(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 mv=cve;function KJ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=mv(this.responseHeaders))}KJ.prototype.toString=function(){let e="Request has failed.";return c(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var sm=KJ;var XU=Zo(du(),1);function pv(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(pv.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});pv.prototype.addEventListener=function(e,t){T.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};pv.prototype.removeEventListener=function(e,t){T.typeOf.func("listener",e);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 lve(e,t){return t-e}pv.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];c(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(lve),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var pe=pv;function lb(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(lb.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);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 K5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}lb.prototype.reserve=function(e){e=e??this._length,this._array.length=e};lb.prototype.heapify=function(e){e=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?(K5(i,o,e),e=o):r=!1}};lb.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};lb.prototype.insert=function(e){T.defined("element",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)K5(t,o,s),o=s;else break}let r;return c(i)&&this._length>i&&(r=t[i],this._length=i),r};lb.prototype.pop=function(e){if(e=e??0,this._length===0)return;T.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return K5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var _v=lb;function uve(e,t){return e.priority-t.priority}var to={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},tC=20,rc=new _v({comparator:uve});rc.maximumLength=tC;rc.reserve(tC);var am=[],Sp={},fve=typeof document<"u"?new XU.default(document.location.href):new XU.default,KU=new pe;function Jo(){}Jo.maximumRequests=50;Jo.maximumRequestsPerServer=18;Jo.requestsByServer={};Jo.throttleRequests=!0;Jo.debugShowStatistics=!1;Jo.requestCompletedEvent=KU;Object.defineProperties(Jo,{statistics:{get:function(){return to}},priorityHeapLength:{get:function(){return tC},set:function(e){if(e<tC)for(;rc.length>e;){let t=rc.pop();ub(t)}tC=e,rc.maximumLength=e,rc.reserve(e)}}});function $J(e){c(e.priorityFunction)&&(e.priority=e.priorityFunction())}Jo.serverHasOpenSlots=function(e,t){t=t??1;let n=Jo.requestsByServer[e]??Jo.maximumRequestsPerServer;return Sp[e]+t<=n};Jo.heapHasOpenSlots=function(e){return rc.length+e<=tC};function ZJ(e){return e.state===$n.UNISSUED&&(e.state=$n.ISSUED,e.deferred=Dl()),e.deferred.promise}function dve(e){return function(t){if(e.state===$n.CANCELLED)return;let n=e.deferred;--to.numberOfActiveRequests,--Sp[e.serverKey],KU.raiseEvent(),e.state=$n.RECEIVED,e.deferred=void 0,n.resolve(t)}}function hve(e){return function(t){e.state!==$n.CANCELLED&&(++to.numberOfFailedRequests,--to.numberOfActiveRequests,--Sp[e.serverKey],KU.raiseEvent(t),e.state=$n.FAILED,e.deferred.reject(t))}}function QJ(e){let t=ZJ(e);return e.state=$n.ACTIVE,am.push(e),++to.numberOfActiveRequests,++to.numberOfActiveRequestsEver,++Sp[e.serverKey],e.requestFunction().then(dve(e)).catch(hve(e)),t}function ub(e){let t=e.state===$n.ACTIVE;if(e.state=$n.CANCELLED,++to.numberOfCancelledRequests,c(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--to.numberOfActiveRequests,--Sp[e.serverKey],++to.numberOfCancelledActiveRequests),c(e.cancelFunction)&&e.cancelFunction()}Jo.update=function(){let e,t,n=0,i=am.length;for(e=0;e<i;++e){if(t=am[e],t.cancelled&&ub(t),t.state!==$n.ACTIVE){++n;continue}n>0&&(am[e-n]=t)}am.length-=n;let o=rc.internalArray,r=rc.length;for(e=0;e<r;++e)$J(o[e]);rc.resort();let s=Math.max(Jo.maximumRequests-am.length,0),a=0;for(;a<s&&rc.length>0;){if(t=rc.pop(),t.cancelled){ub(t);continue}if(t.throttleByServer&&!Jo.serverHasOpenSlots(t.serverKey)){ub(t);continue}QJ(t),++a}mve()};Jo.getServerKey=function(e){T.typeOf.string("url",e);let t=new XU.default(e);t.scheme()===""&&(t=t.absoluteTo(fve),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Sp[n];return c(i)||(Sp[n]=0),n};Jo.request=function(e){if(T.typeOf.object("request",e),T.typeOf.string("request.url",e.url),T.typeOf.func("request.requestFunction",e.requestFunction),Ep(e.url)||sb(e.url))return KU.raiseEvent(),e.state=$n.RECEIVED,e.requestFunction();if(++to.numberOfAttemptedRequests,c(e.serverKey)||(e.serverKey=Jo.getServerKey(e.url)),Jo.throttleRequests&&e.throttleByServer&&!Jo.serverHasOpenSlots(e.serverKey))return;if(!Jo.throttleRequests||!e.throttle)return QJ(e);if(am.length>=Jo.maximumRequests)return;$J(e);let t=rc.insert(e);if(c(t)){if(t===e)return;ub(t)}return ZJ(e)};function mve(){Jo.debugShowStatistics&&(to.numberOfActiveRequests===0&&to.lastNumberOfActiveRequests>0&&(to.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${to.numberOfAttemptedRequests}`),to.numberOfAttemptedRequests=0),to.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${to.numberOfCancelledRequests}`),to.numberOfCancelledRequests=0),to.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${to.numberOfCancelledActiveRequests}`),to.numberOfCancelledActiveRequests=0),to.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${to.numberOfFailedRequests}`),to.numberOfFailedRequests=0)),to.lastNumberOfActiveRequests=to.numberOfActiveRequests)}Jo.clearForSpecs=function(){for(;rc.length>0;){let t=rc.pop();ub(t)}let e=am.length;for(let t=0;t<e;++t)ub(am[t]);am.length=0,Sp={},to.numberOfAttemptedRequests=0,to.numberOfActiveRequests=0,to.numberOfCancelledRequests=0,to.numberOfCancelledActiveRequests=0,to.numberOfFailedRequests=0,to.numberOfActiveRequestsEver=0,to.lastNumberOfActiveRequests=0};Jo.numberOfActiveRequestsByServer=function(e){return Sp[e]};Jo.requestHeap=rc;var sc=Jo;var JJ=Zo(du(),1);var gv={},nC={};gv.add=function(e,t){if(!c(e))throw new E("host is required.");if(!c(t)||t<=0)throw new E("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(nC[n])||(nC[n]=!0)};gv.remove=function(e,t){if(!c(e))throw new E("host is required.");if(!c(t)||t<=0)throw new E("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(nC[n])&&delete nC[n]};function pve(e){let t=new JJ.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}}gv.contains=function(e){if(!c(e))throw new E("url is required.");let t=pve(e);return!!(c(t)&&c(nC[t]))};gv.clear=function(){nC={}};var iC=gv;var nee=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function vt(e){e=e??W.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),T.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=cm(e.templateValues,{}),this._queryParameters=cm(e.queryParameters,{}),this.headers=cm(e.headers,{}),this.request=e.request??new Qo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function cm(e,t){return c(e)?je(e):t}vt.createIfNeeded=function(e){return e instanceof vt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new vt({url:e})};var oC;vt.supportsImageBitmapOptions=function(){return c(oC)?oC:typeof createImageBitmap!="function"?(oC=Promise.resolve(!1),oC):(oC=vt.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=Id(t[0]),i=Id(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),oC)};Object.defineProperties(vt,{isBlobSupported:{get:function(){return nee}}});Object.defineProperties(vt.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 rb(this._url)}},isDataUri:{get:function(){return Ep(this._url)}},isBlobUri:{get:function(){return sb(this._url)}},isCrossOriginUrl:{get:function(){return Ug(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};vt.prototype.parseUrl=function(e,t,n,i){let o=new tee.default(e),r=_ve(o.query());this._queryParameters=t?ZU(r,this.queryParameters,n):r,o.search(""),o.fragment(""),c(i)&&o.scheme()===""&&(o=o.absoluteTo(om(i))),this._url=o.toString()};function _ve(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:hu(e)}function ZU(e,t,n){if(!n)return xt(e,t);let i=je(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];c(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${gve(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 c(s)?encodeURIComponent(s):o})),t&&c(this.proxy)&&(n=this.proxy.getURL(n)),n};function gve(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!c(e[t[0]])?`?${t[0]}`:`?${cb(e)}`}vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=ZU(this._queryParameters,e,!1):this._queryParameters=ZU(e,this._queryParameters,!1)};vt.prototype.appendQueryParameters=function(e){this._queryParameters=ZU(e,this._queryParameters,!0)};vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};vt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,c(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return c(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),c(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),c(e.headers)&&(t.headers=xt(e.headers,t.headers)),c(e.proxy)&&(t.proxy=e.proxy),c(e.request)&&(t.request=e.request),c(e.retryCallback)&&(t.retryCallback=e.retryCallback),c(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};vt.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})};vt.prototype.clone=function(e){return c(e)?(e._url=this._url,e._queryParameters=je(this._queryParameters),e._templateValues=je(this._templateValues),e.headers=je(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new vt({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:c(this.credits)?this.credits.slice():void 0})};vt.prototype.getBaseUri=function(e){return hv(this.getUrlComponent(e),e)};vt.prototype.appendForwardSlash=function(){this._url=dv(this._url)};vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};vt.fetchArrayBuffer=function(e){return new vt(e).fetchArrayBuffer()};vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};vt.fetchBlob=function(e){return new vt(e).fetchBlob()};vt.prototype.fetchImage=function(e){e=e??W.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(Z5(this.request),!nee||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return $5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!c(r))return;let s,a,l,u;return vt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!c(f))return;if(u=f,a)return vt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return l=new vt({url:h}),$5({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(c(f))return f.blob=u,a||window.URL.revokeObjectURL(l.url),f}).catch(function(f){return c(l)&&window.URL.revokeObjectURL(l.url),f.blob=u,Promise.reject(f)})};function $5(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 l=Dl();return vt._Implementations.createImage(r,a,l,n,i,o),l.promise};let s=sc.request(r);if(c(s))return s.catch(function(a){return r.state!==$n.FAILED?Promise.reject(a):t.retryOnError(a).then(function(l){return l?(r.state=$n.UNISSUED,r.deferred=void 0,$5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}vt.fetchImage=function(e){return new vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};vt.fetchText=function(e){return new vt(e).fetchText()};vt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(c(e))return e.then(function(t){if(c(t))return JSON.parse(t)})};vt.fetchJson=function(e){return new vt(e).fetchJson()};vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};vt.fetchXML=function(e){return new vt(e).fetchXML()};vt.prototype.fetchJsonp=function(e){e=e??"callback",Z5(this.request);let t;do t=`loadJsonp${O.nextRandomNumber().toString().substring(2,8)}`;while(c(window[t]));return iee(this,e,t)};function iee(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=Dl();return window[n]=function(l){a.resolve(l);try{delete window[n]}catch{window[n]=void 0}},vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=sc.request(o);if(c(s))return s.catch(function(a){return o.state!==$n.FAILED?Promise.reject(a):e.retryOnError(a).then(function(l){return l?(o.state=$n.UNISSUED,o.deferred=void 0,iee(e,t,n)):Promise.reject(a)})})}vt.fetchJsonp=function(e){return new vt(e).fetchJsonp(e.callbackParameterName)};vt.prototype._makeRequest=function(e){let t=this;Z5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,l=e.method,u=e.data,f=Dl(),h=vt._Implementations.loadWithXhr(i,r,l,u,s,f,a);return c(h)&&c(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=sc.request(n);if(c(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==$n.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=$n.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function Z5(e){if(e.state===$n.ISSUED||e.state===$n.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=$n.UNISSUED,e.deferred=void 0}var yve=/^data:(.*?)(;base64)?,(.*)$/;function $U(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function eee(e,t){let n=$U(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 bve(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return $U(i,o);case"arraybuffer":return eee(i,o);case"blob":return r=eee(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString($U(i,o),n);case"json":return JSON.parse($U(i,o));default:throw new E(`Unhandled responseType: ${t}`)}}vt.prototype.fetch=function(e){return e=cm(e,{}),e.method="GET",this._makeRequest(e)};vt.fetch=function(e){return new vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.delete=function(e){return e=cm(e,{}),e.method="DELETE",this._makeRequest(e)};vt.delete=function(e){return new vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};vt.prototype.head=function(e){return e=cm(e,{}),e.method="HEAD",this._makeRequest(e)};vt.head=function(e){return new vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.options=function(e){return e=cm(e,{}),e.method="OPTIONS",this._makeRequest(e)};vt.options=function(e){return new vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.post=function(e,t){return T.defined("data",e),t=cm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};vt.post=function(e){return new vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.put=function(e,t){return T.defined("data",e),t=cm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};vt.put=function(e){return new vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.patch=function(e,t){return T.defined("data",e),t=cm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};vt.patch=function(e){return new vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt._Implementations={};vt._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&&(iC.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};vt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;vt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){vt._Implementations.loadImageElement(s,t,n);return}let l="blob",u="GET",f=Dl(),h=vt._Implementations.loadWithXhr(s,l,u,void 0,void 0,f,void 0,void 0,void 0);return c(h)&&c(h.abort)&&(e.cancelFunction=function(){h.abort()}),f.promise.then(function(p){if(!c(p)){n.reject(new ae(`Successfully retrieved ${s} but it contained no content.`));return}return vt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};vt.createImageBitmapFromBlob=function(e,t){return T.defined("options",t),T.typeOf.bool("options.flipY",t.flipY),T.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),T.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function xve(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let l={};a.headers.forEach((u,f)=>{l[f]=u}),r.reject(new sm(a.status,a,l));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 sm)})}var Tve=typeof XMLHttpRequest>"u";vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=yve.exec(e);if(a!==null){r.resolve(bve(a,t));return}if(Tve){xve(e,t,n,i,o,r,s);return}let l=new XMLHttpRequest;if(iC.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),c(s)&&c(l.overrideMimeType)&&l.overrideMimeType(s),c(o))for(let f in o)o.hasOwnProperty(f)&&l.setRequestHeader(f,o[f]);c(t)&&(l.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){r.reject(new sm(l.status,l.response,l.getAllResponseHeaders()));return}let f=l.response,h=l.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=l.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let b=y.split(": "),x=b.shift();m[x]=b.join(": ")}),r.resolve(m);return}if(l.status===204)r.resolve(void 0);else if(c(f)&&(!c(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&c(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(h===""||h==="text")&&c(l.responseText)?r.resolve(l.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},l.onerror=function(f){r.reject(new sm)},l.send(i),l};vt._Implementations.loadAndExecuteScript=function(e,t,n){return ab(e,t).catch(function(i){n.reject(i)})};vt._DefaultImplementations={};vt._DefaultImplementations.createImage=vt._Implementations.createImage;vt._DefaultImplementations.loadWithXhr=vt._Implementations.loadWithXhr;vt._DefaultImplementations.loadAndExecuteScript=vt._Implementations.loadAndExecuteScript;vt.DEFAULT=Object.freeze(new vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var we=vt;function bv(e){e=e??W.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=e.addNewLeapSeconds??!0,c(e.data)?oee(this,e.data):oee(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}bv.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.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 bv({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};bv.NONE=Object.freeze({compute:function(e,t){return c(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Bg(0,0,0,0,0),t}});bv.prototype.compute=function(e,t){if(!c(this._samples))return;if(c(t)||(t=new Bg(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(c(i)){let a=n[i],l=n[i+1],u=Q.lessThanOrEquals(a,e),f=!c(l),h=f||Q.greaterThanOrEquals(l,e);if(u&&h)return o=i,!f&&l.equals(e)&&++o,r=o+1,see(this,n,this._samples,e,o,r,t),t}let s=Lo(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,see(this,n,this._samples,e,o,r,t),t};function Ave(e,t){return Q.compare(e.julianDate,t)}function oee(e,t){if(!c(t.columnNames))throw new ae("Error in loaded EOP data: The columnNames property is required.");if(!c(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"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||l<0)throw new ae("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],b=u[g+l],x=y+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new Q(x,b,Wn.TAI);if(f.push(A),p){if(b!==h&&c(h)){let C=Q.leapSeconds,S=Lo(C,A,Ave);if(S<0){let v=new Yi(A,b);C.splice(~S,0,v)}}h=b}}}function ree(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 yv(e,t,n){return t+e*(n-t)}function see(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 l=t[o],u=t[r];if(l.equals(u)||i.equals(l))return ree(e,n,o,a,s),s;if(i.equals(u))return ree(e,n,r,a,s),s;let f=Q.secondsDifference(i,l)/Q.secondsDifference(u,l),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let b=n[h+e._taiMinusUtcSecondsColumn],x=n[p+e._taiMinusUtcSecondsColumn];b!==x&&(u.equals(i)?g=m:m-=x-b)}return s.xPoleWander=yv(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=yv(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=yv(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=yv(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=yv(f,g,m),s}var xv=bv;function ac(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}ac.fromQuaternion=function(e,t){if(!c(e))throw new E("quaternion is required");c(t)||(t=new ac);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=-O.asinClamped(n),t};ac.fromDegrees=function(e,t,n,i){if(!c(e))throw new E("heading is required");if(!c(t))throw new E("pitch is required");if(!c(n))throw new E("roll is required");return c(i)||(i=new ac),i.heading=e*O.RADIANS_PER_DEGREE,i.pitch=t*O.RADIANS_PER_DEGREE,i.roll=n*O.RADIANS_PER_DEGREE,i};ac.clone=function(e,t){if(c(e))return c(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ac(e.heading,e.pitch,e.roll)};ac.equals=function(e,t){return e===t||c(e)&&c(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};ac.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.heading,t.heading,n,i)&&O.equalsEpsilon(e.pitch,t.pitch,n,i)&&O.equalsEpsilon(e.roll,t.roll,n,i)};ac.prototype.clone=function(e){return ac.clone(this,e)};ac.prototype.equals=function(e){return ac.equals(this,e)};ac.prototype.equalsEpsilon=function(e,t,n){return ac.equalsEpsilon(this,e,t,n)};ac.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Oa=ac;var aee={},cee=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Cve(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=cee.exec(i);if(o!==null)return o[1]}}var QU;function lee(e){return typeof document>"u"?e:(c(QU)||(QU=document.createElement("a")),QU.href=e,QU.href)}var fb;function uee(){if(c(fb))return fb;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:c(aee?.url)?e=om(".",aee.url):typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(require.toUrl)?e=om("..",db("Core/buildModuleUrl.js")):e=Cve(),!c(e))throw new E("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return fb=new we({url:lee(e)}),fb.appendForwardSlash(),fb}function Eve(e){return lee(require.toUrl(`../${e}`))}function fee(e){return uee().getDerivedResource({url:e}).url}var JU;function db(e){return c(JU)||(typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(require.toUrl)?JU=Eve:JU=fee),JU(e)}db._cesiumScriptRegex=cee;db._buildModuleUrlFromBaseUrl=fee;db._clearBaseResource=function(){fb=void 0};db.setBaseUrl=function(e){fb=we.DEFAULT.getDerivedResource({url:e})};db.getCesiumBaseUrl=uee;var tn=db;function Sve(e,t,n){this.x=e,this.y=t,this.s=n}var hb=Sve;function ej(e){e=e??W.EMPTY_OBJECT,this._xysFileUrlTemplate=we.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,Wn.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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 wve=new Q(0,0,Wn.TAI);function Q5(e,t,n){let i=wve;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}ej.prototype.preload=function(e,t,n,i){let o=Q5(this,e,t),r=Q5(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 l=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let h=l;h<=u;++h)f.push(J5(this,h));return Promise.all(f)};ej.prototype.computeXysRadians=function(e,t,n){let i=Q5(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 l=!1,u=this._samples;if(c(u[s*3])||(J5(this,s/this._samplesPerXysFile|0),l=!0),c(u[a*3])||(J5(this,a/this._samplesPerXysFile|0),l=!0),l)return;c(n)?(n.x=0,n.y=0,n.s=0):n=new hb(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,b;for(y=0;y<=r;++y)h[y]=f-m[y];for(y=0;y<=r;++y){for(g[y]=1,b=0;b<=r;++b)b!==y&&(g[y]*=h[b]);g[y]*=p[y];let x=(s+y)*3;n.x+=g[y]*u[x++],n.y+=g[y]*u[x++],n.s+=g[y]*u[x]}return n};function J5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;c(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new we({url:tn(`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,l=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[l+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var Tv=ej;function nt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var Av=new d;nt.fromAxisAngle=function(e,t,n){T.typeOf.object("axis",e),T.typeOf.number("angle",t);let i=t/2,o=Math.sin(i);Av=d.normalize(e,Av);let r=Av.x*o,s=Av.y*o,a=Av.z*o,l=Math.cos(i);return c(n)?(n.x=r,n.y=s,n.z=a,n.w=l,n):new nt(r,s,a,l)};var vve=[1,2,0],Dve=new Array(3);nt.fromRotationMatrix=function(e,t){T.typeOf.object("matrix",e);let n,i,o,r,s,a=e[J.COLUMN0ROW0],l=e[J.COLUMN1ROW1],u=e[J.COLUMN2ROW2],f=a+l+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[J.COLUMN1ROW2]-e[J.COLUMN2ROW1])*n,o=(e[J.COLUMN2ROW0]-e[J.COLUMN0ROW2])*n,r=(e[J.COLUMN0ROW1]-e[J.COLUMN1ROW0])*n;else{let h=vve,p=0;l>a&&(p=1),u>a&&u>l&&(p=2);let g=h[p],m=h[g];n=Math.sqrt(e[J.getElementIndex(p,p)]-e[J.getElementIndex(g,g)]-e[J.getElementIndex(m,m)]+1);let y=Dve;y[p]=.5*n,n=.5/n,s=(e[J.getElementIndex(m,g)]-e[J.getElementIndex(g,m)])*n,y[g]=(e[J.getElementIndex(g,p)]+e[J.getElementIndex(p,g)])*n,y[m]=(e[J.getElementIndex(m,p)]+e[J.getElementIndex(p,m)])*n,i=-y[0],o=-y[1],r=-y[2]}return c(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var dee=new nt,hee=new nt,tj=new nt,mee=new nt;nt.fromHeadingPitchRoll=function(e,t){return T.typeOf.object("headingPitchRoll",e),mee=nt.fromAxisAngle(d.UNIT_X,e.roll,dee),tj=nt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=nt.multiply(tj,mee,tj),hee=nt.fromAxisAngle(d.UNIT_Z,-e.heading,dee),nt.multiply(hee,t,t)};var eV=new d,nj=new d,Od=new nt,pee=new nt,tV=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,tV),nt.conjugate(tV,tV);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,Od),nt.multiply(Od,tV,Od),Od.w<0&&nt.negate(Od,Od),nt.computeAxis(Od,eV);let a=nt.computeAngle(Od);c(i)||(i=[]),i[s]=eV.x*a,i[s+1]=eV.y*a,i[s+2]=eV.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){c(o)||(o=new nt),d.fromArray(e,0,nj);let r=d.magnitude(nj);return nt.unpack(t,i*4,pee),r===0?nt.clone(nt.IDENTITY,Od):nt.fromAxisAngle(nj,r,Od),nt.multiply(Od,pee,o)};nt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return T.typeOf.object("quaternion",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return T.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){T.typeOf.object("result",t);let n=1/nt.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};nt.inverse=function(e,t){T.typeOf.object("result",t);let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};nt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};nt.negate=function(e,t){return T.typeOf.object("quaternion",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,l=t.y,u=t.z,f=t.w,h=s*a+i*f+o*u-r*l,p=s*l-i*u+o*f+r*a,g=s*u+i*l-o*a+r*f,m=s*f-i*a-o*l-r*u;return n.x=h,n.y=p,n.z=g,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return T.typeOf.object("quaternion",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return T.typeOf.object("quaternion",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){T.typeOf.object("quaternion",e),T.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<O.EPSILON6||Math.abs(n+1)<O.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};nt.computeAngle=function(e){return T.typeOf.object("quaternion",e),Math.abs(e.w-1)<O.EPSILON6?0:2*Math.acos(e.w)};var ij=new nt;nt.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),ij=nt.multiplyByScalar(t,n,ij),i=nt.multiplyByScalar(e,1-n,i),nt.add(ij,i,i)};var _ee=new nt,oj=new nt,rj=new nt;nt.slerp=function(e,t,n,i){T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i);let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=_ee=nt.negate(t,_ee)),1-o<O.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return oj=nt.multiplyByScalar(e,Math.sin((1-n)*s),oj),rj=nt.multiplyByScalar(r,Math.sin(n*s),rj),i=nt.add(oj,rj,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){T.typeOf.object("quaternion",e),T.typeOf.object("result",t);let n=O.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};nt.exp=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=d.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 Pve=new d,Ive=new d,Cv=new nt,rC=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("q2",n),T.typeOf.object("result",i);let o=nt.conjugate(t,Cv);nt.multiply(o,n,rC);let r=nt.log(rC,Pve);nt.multiply(o,e,rC);let s=nt.log(rC,Ive);return d.add(r,s,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),nt.exp(r,Cv),nt.multiply(t,Cv,i)};nt.squad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.slerp(e,t,o,Cv),a=nt.slerp(n,i,o,rC);return nt.slerp(s,a,2*o*(1-o),r)};var Ove=new nt,gee=1.9011074535173003,nV=Vt.supportsTypedArrays()?new Float32Array(8):[],iV=Vt.supportsTypedArrays()?new Float32Array(8):[],wp=Vt.supportsTypedArrays()?new Float32Array(8):[],vp=Vt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;nV[e]=1/(t*n),iV[e]=t/n}nV[7]=gee/(8*17);iV[7]=gee*8/17;nt.fastSlerp=function(e,t,n,i){T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i);let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,l=n*n,u=a*a;for(let g=7;g>=0;--g)wp[g]=(nV[g]*l-iV[g])*s,vp[g]=(nV[g]*u-iV[g])*s;let f=r*n*(1+wp[0]*(1+wp[1]*(1+wp[2]*(1+wp[3]*(1+wp[4]*(1+wp[5]*(1+wp[6]*(1+wp[7])))))))),h=a*(1+vp[0]*(1+vp[1]*(1+vp[2]*(1+vp[3]*(1+vp[4]*(1+vp[5]*(1+vp[6]*(1+vp[7])))))))),p=nt.multiplyByScalar(e,h,Ove);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.fastSlerp(e,t,o,Cv),a=nt.fastSlerp(n,i,o,rC);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,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){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=nt;var fi={},sj={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"}},sC={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},aj={},Pl={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},Vg=new d,zg=new d,Hg=new d;fi.localFrameToFixedFrameGenerator=function(e,t){if(!sj.hasOwnProperty(e)||!sj[e].hasOwnProperty(t))throw new E("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=sj[e][t],i,o=e+t;return c(aj[o])?i=aj[o]:(i=function(r,s,a){if(!c(r))throw new E("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new E("origin has a NaN component");if(c(a)||(a=new B),d.equalsEpsilon(r,d.ZERO,O.EPSILON14))d.unpack(sC[e],0,Vg),d.unpack(sC[t],0,zg),d.unpack(sC[n],0,Hg);else if(O.equalsEpsilon(r.x,0,O.EPSILON14)&&O.equalsEpsilon(r.y,0,O.EPSILON14)){let l=O.sign(r.z);d.unpack(sC[e],0,Vg),e!=="east"&&e!=="west"&&d.multiplyByScalar(Vg,l,Vg),d.unpack(sC[t],0,zg),t!=="east"&&t!=="west"&&d.multiplyByScalar(zg,l,zg),d.unpack(sC[n],0,Hg),n!=="east"&&n!=="west"&&d.multiplyByScalar(Hg,l,Hg)}else{s=s??ie.default,s.geodeticSurfaceNormal(r,Pl.up);let l=Pl.up,u=Pl.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,Pl.east),d.cross(l,u,Pl.north),d.multiplyByScalar(Pl.up,-1,Pl.down),d.multiplyByScalar(Pl.east,-1,Pl.west),d.multiplyByScalar(Pl.north,-1,Pl.south),Vg=Pl[e],zg=Pl[t],Hg=Pl[n]}return a[0]=Vg.x,a[1]=Vg.y,a[2]=Vg.z,a[3]=0,a[4]=zg.x,a[5]=zg.y,a[6]=zg.z,a[7]=0,a[8]=Hg.x,a[9]=Hg.y,a[10]=Hg.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},aj[o]=i),i};fi.eastNorthUpToFixedFrame=fi.localFrameToFixedFrameGenerator("east","north");fi.northEastDownToFixedFrame=fi.localFrameToFixedFrameGenerator("north","east");fi.northUpEastToFixedFrame=fi.localFrameToFixedFrameGenerator("north","up");fi.northWestUpToFixedFrame=fi.localFrameToFixedFrameGenerator("north","west");var Rve=new Le,Mve=new d(1,1,1),Lve=new B;fi.headingPitchRollToFixedFrame=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t),i=i??fi.eastNorthUpToFixedFrame;let r=Le.fromHeadingPitchRoll(t,Rve),s=B.fromTranslationQuaternionRotationScale(d.ZERO,r,Mve,Lve);return o=i(e,n,o),B.multiply(o,s,o)};var Nve=new B,Fve=new J;fi.headingPitchRollQuaternion=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t);let r=fi.headingPitchRollToFixedFrame(e,t,n,i,Nve),s=B.getMatrix3(r,Fve);return Le.fromRotationMatrix(s,o)};var Bve=new d(1,1,1),kve=new d,yee=new B,Uve=new B,Vve=new J,zve=new Le;fi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){T.defined("transform",e),t=t??ie.default,n=n??fi.eastNorthUpToFixedFrame,c(i)||(i=new Oa);let o=B.getTranslation(e,kve);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=B.inverseTransformation(n(o,t,yee),yee),s=B.setScale(e,Bve,Uve);s=B.setTranslation(s,d.ZERO,s),r=B.multiply(r,s,r);let a=Le.fromRotationMatrix(B.getMatrix3(r,Vve),zve);return a=Le.normalize(a,a),Oa.fromQuaternion(a,i)};var Hve=6*3600+41*60+50.54841,Gve=8640184812866e-6,jve=.093104,Wve=-62e-7,qve=11772758384668e-32,Yve=72921158553e-15,Xve=O.TWO_PI/86400,oV=new Q;fi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=fi.computeIcrfToFixedMatrix(e,t);return c(n)||(n=fi.computeTemeToPseudoFixedMatrix(e,t)),n};fi.computeTemeToPseudoFixedMatrix=function(e,t){if(!c(e))throw new E("date is required.");oV=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),oV);let n=oV.dayNumber,i=oV.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(Hve+o*(Gve+o*(jve+o*Wve)))*Xve%O.TWO_PI,l=Yve+qve*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+l*u,h=Math.cos(f),p=Math.sin(f);return c(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 J(h,p,0,-p,h,0,0,0,1)};fi.iau2006XysData=new Tv;fi.earthOrientationParameters=xv.NONE;var uj=32.184,Kve=2451545;fi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+uj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+uj;return fi.iau2006XysData.preload(t,n,i,o)};fi.computeIcrfToFixedMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=fi.computeFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var $ve=32.184,Zve=2451545,rV=new Oa,Qve=new J,Jve=new Q;fi.computeMoonFixedToIcrfMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=Q.addSeconds(e,$ve,Jve),i=Q.totalDays(n)-Zve,o=O.toRadians(12.112)-O.toRadians(.052992)*i,r=O.toRadians(24.224)-O.toRadians(.105984)*i,s=O.toRadians(227.645)+O.toRadians(13.012)*i,a=O.toRadians(261.105)+O.toRadians(13.340716)*i,l=O.toRadians(358)+O.toRadians(.9856)*i;return rV.pitch=O.toRadians(180)-O.toRadians(3.878)*Math.sin(o)-O.toRadians(.12)*Math.sin(r)+O.toRadians(.07)*Math.sin(s)-O.toRadians(.017)*Math.sin(a),rV.roll=O.toRadians(66.53-90)+O.toRadians(1.543)*Math.cos(o)+O.toRadians(.24)*Math.cos(r)-O.toRadians(.028)*Math.cos(s)+O.toRadians(.007)*Math.cos(a),rV.heading=O.toRadians(244.375-90)+O.toRadians(13.17635831)*i+O.toRadians(3.558)*Math.sin(o)+O.toRadians(.121)*Math.sin(r)-O.toRadians(.064)*Math.sin(s)+O.toRadians(.016)*Math.sin(a)+O.toRadians(.025)*Math.sin(l),J.fromHeadingPitchRoll(rV,Qve)};fi.computeIcrfToMoonFixedMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=fi.computeMoonFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var eDe=new hb(0,0,0),tDe=new Bg(0,0,0,0,0,0),cj=new J,lj=new J;fi.computeFixedToIcrfMatrix=function(e,t){if(!c(e))throw new E("date is required.");c(t)||(t=new J);let n=fi.earthOrientationParameters.compute(e,tDe);if(!c(n))return;let i=e.dayNumber,o=e.secondsOfDay+uj,r=fi.iau2006XysData.computeXysRadians(i,o,eDe);if(!c(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-s*s-a*a)),u=cj;u[0]=1-l*s*s,u[3]=-l*s*a,u[6]=s,u[1]=-l*s*a,u[4]=1-l*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-l*(s*s+a*a);let f=J.fromRotationZ(-r.s,lj),h=J.multiply(u,f,cj),p=e.dayNumber,g=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/qn.SECONDS_PER_DAY,b=.779057273264+y+.00273781191135448*(m+y);b=b%1*O.TWO_PI;let x=J.fromRotationZ(b,lj),A=J.multiply(h,x,cj),C=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),P=Math.sin(n.yPoleWander),M=i-Kve+o/qn.SECONDS_PER_DAY;M/=36525;let R=-47e-6*M*O.RADIANS_PER_DEGREE/3600,L=Math.cos(R),F=Math.sin(R),_=lj;return _[0]=C*L,_[1]=C*F,_[2]=v,_[3]=-S*F+P*v*L,_[4]=S*L+P*v*F,_[5]=-P*C,_[6]=-P*F-S*v*L,_[7]=P*L-S*v*F,_[8]=S*C,J.multiply(A,_,t)};var nDe=new se;fi.pointToWindowCoordinates=function(e,t,n,i){return i=fi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};fi.pointToGLWindowCoordinates=function(e,t,n,i){if(!c(e))throw new E("modelViewProjectionMatrix is required.");if(!c(t))throw new E("viewportTransformation is required.");if(!c(n))throw new E("point is required.");c(i)||(i=new H);let o=nDe;return B.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),B.multiplyByVector(t,o,o),H.fromCartesian4(o,i)};var iDe=new d,oDe=new d,rDe=new d;fi.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!c(e))throw new E("position is required.");if(!c(t))throw new E("velocity is required.");let o=(n??ie.default).geodeticSurfaceNormal(e,iDe),r=d.cross(t,o,oDe);d.equalsEpsilon(r,d.ZERO,O.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,rDe);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),c(i)||(i=new J),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 bee=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),xee=new he,fj=new d,sDe=new d,aDe=new J,dj=new B,Tee=new B;fi.basisTo2D=function(e,t,n){if(!c(e))throw new E("projection is required.");if(!c(t))throw new E("matrix is required.");if(!c(n))throw new E("result is required.");let i=B.getTranslation(t,sDe),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,fj);else{let f=o.cartesianToCartographic(i,xee);r=e.project(f,fj),d.fromElements(r.z,r.x,r.y,r)}let s=fi.eastNorthUpToFixedFrame(i,o,dj),a=B.inverseTransformation(s,Tee),l=B.getMatrix3(t,aDe),u=B.multiplyByMatrix3(a,l,n);return B.multiply(bee,u,n),B.setTranslation(n,r,n),n};fi.ellipsoidTo2DModelMatrix=function(e,t,n){if(!c(e))throw new E("projection is required.");if(!c(t))throw new E("center is required.");if(!c(n))throw new E("result is required.");let i=e.ellipsoid,o=fi.eastNorthUpToFixedFrame(t,i,dj),r=B.inverseTransformation(o,Tee),s=i.cartesianToCartographic(t,xee),a=e.project(s,fj);d.fromElements(a.z,a.x,a.y,a);let l=B.fromTranslation(a,dj);return B.multiply(bee,r,n),B.multiply(l,n,n),n};var Ot=fi;function vn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(vn.prototype,{width:{get:function(){return vn.computeWidth(this)}},height:{get:function(){return vn.computeHeight(this)}}});vn.packedLength=4;vn.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};vn.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};vn.computeWidth=function(e){T.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=O.TWO_PI),t-n};vn.computeHeight=function(e){return T.typeOf.object("rectangle",e),e.north-e.south};vn.fromDegrees=function(e,t,n,i,o){return e=O.toRadians(e??0),t=O.toRadians(t??0),n=O.toRadians(n??0),i=O.toRadians(i??0),c(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new vn(e,t,n,i)};vn.fromRadians=function(e,t,n,i,o){return c(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new vn(e,t,n,i)};vn.fromCartographicArray=function(e,t){T.defined("cartographics",e);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 l=0,u=e.length;l<u;l++){let f=e[l];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+O.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>O.PI&&(i=i-O.TWO_PI),n>O.PI&&(n=n-O.TWO_PI)),c(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new vn(n,s,i,a)};vn.fromCartesianArray=function(e,t,n){T.defined("cartesians",e),t=t??ie.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),l=Math.max(l,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+O.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>O.PI&&(o=o-O.TWO_PI),i>O.PI&&(i=i-O.TWO_PI)),c(n)?(n.west=i,n.south=a,n.east=o,n.north=l,n):new vn(i,a,o,l)};var cDe=new d,lDe=new d,uDe=new d,fDe=new d,dDe=new d,hj=new Array(5);for(let e=0;e<hj.length;++e)hj[e]=new d;vn.fromBoundingSphere=function(e,t,n){T.typeOf.object("boundingSphere",e);let i=e.center,o=e.radius;if(c(t)||(t=ie.default),c(n)||(n=new vn),d.equals(i,d.ZERO))return vn.clone(vn.MAX_VALUE,n),n;let r=Ot.eastNorthUpToFixedFrame(i,t,cDe),s=B.multiplyByPointAsVector(r,d.UNIT_X,lDe);d.normalize(s,s);let a=B.multiplyByPointAsVector(r,d.UNIT_Y,uDe);d.normalize(a,a),d.multiplyByScalar(a,o,a),d.multiplyByScalar(s,o,s);let l=d.negate(a,dDe),u=d.negate(s,fDe),f=hj,h=f[0];return d.add(i,a,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,l,h),h=f[3],d.add(i,s,h),f[4]=i,vn.fromCartesianArray(f,t,n)};vn.clone=function(e,t){if(c(e))return c(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new vn(e.west,e.south,e.east,e.north)};vn.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};vn.prototype.clone=function(e){return vn.clone(this,e)};vn.prototype.equals=function(e){return vn.equals(this,e)};vn.equals=function(e,t){return e===t||c(e)&&c(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};vn.prototype.equalsEpsilon=function(e,t){return vn.equalsEpsilon(this,e,t)};vn._validate=function(e){T.typeOf.object("rectangle",e);let t=e.north;T.typeOf.number.greaterThanOrEquals("north",t,-O.PI_OVER_TWO),T.typeOf.number.lessThanOrEquals("north",t,O.PI_OVER_TWO);let n=e.south;T.typeOf.number.greaterThanOrEquals("south",n,-O.PI_OVER_TWO),T.typeOf.number.lessThanOrEquals("south",n,O.PI_OVER_TWO);let i=e.west;T.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),T.typeOf.number.lessThanOrEquals("west",i,Math.PI);let o=e.east;T.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),T.typeOf.number.lessThanOrEquals("east",o,Math.PI)};vn.southwest=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};vn.northwest=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};vn.northeast=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};vn.southeast=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};vn.center=function(e,t){T.typeOf.object("rectangle",e);let n=e.east,i=e.west;n<i&&(n+=O.TWO_PI);let o=O.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return c(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};vn.intersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=O.TWO_PI:r<s&&i>0&&(r+=O.TWO_PI),i<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);let a=O.negativePiToPi(Math.max(o,s)),l=O.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&l<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return c(n)?(n.west=a,n.south=u,n.east=l,n.north=f,n):new vn(a,u,l,f)};vn.simpleIntersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);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 c(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new vn(i,o,r,s)};vn.union=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t),c(n)||(n=new vn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=O.TWO_PI:r<s&&i>0&&(r+=O.TWO_PI),i<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);let a=O.negativePiToPi(Math.min(o,s)),l=O.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n};vn.expand=function(e,t,n){return T.typeOf.object("rectangle",e),T.typeOf.object("cartographic",t),c(n)||(n=new vn),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};vn.contains=function(e,t){T.typeOf.object("rectangle",e),T.typeOf.object("cartographic",t);let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=O.TWO_PI,n<0&&(n+=O.TWO_PI)),(n>o||O.equalsEpsilon(n,o,O.EPSILON14))&&(n<r||O.equalsEpsilon(n,r,O.EPSILON14))&&i>=e.south&&i<=e.north};var hDe=new he;vn.subsample=function(e,t,n,i){T.typeOf.object("rectangle",e),t=t??ie.default,n=n??0,c(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,l=e.west,u=hDe;u.height=n,u.longitude=l,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*O.PI_OVER_TWO,vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};vn.subsection=function(e,t,n,i,o,r){if(T.typeOf.object("rectangle",e),T.typeOf.number.greaterThanOrEquals("westLerp",t,0),T.typeOf.number.lessThanOrEquals("westLerp",t,1),T.typeOf.number.greaterThanOrEquals("southLerp",n,0),T.typeOf.number.lessThanOrEquals("southLerp",n,1),T.typeOf.number.greaterThanOrEquals("eastLerp",i,0),T.typeOf.number.lessThanOrEquals("eastLerp",i,1),T.typeOf.number.greaterThanOrEquals("northLerp",o,0),T.typeOf.number.lessThanOrEquals("northLerp",o,1),T.typeOf.number.lessThanOrEquals("westLerp",t,i),T.typeOf.number.lessThanOrEquals("southLerp",n,o),c(r)||(r=new vn),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=O.TWO_PI+e.east-e.west;r.west=O.negativePiToPi(e.west+t*a),r.east=O.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};vn.MAX_VALUE=Object.freeze(new vn(-Math.PI,-O.PI_OVER_TWO,Math.PI,O.PI_OVER_TWO));var ce=vn;function kr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}kr.packedLength=4;kr.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};kr.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new kr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};kr.fromPoints=function(e,t){if(c(t)||(t=new kr),!c(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 l=e[a],u=l.x,f=l.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var Aee=new Oi,mDe=new he,pDe=new he;kr.fromRectangle=function(e,t,n){if(c(n)||(n=new kr),!c(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;Aee._ellipsoid=ie.default,t=t??Aee;let i=t.project(ce.southwest(e,mDe)),o=t.project(ce.northeast(e,pDe));return H.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};kr.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new kr(e.x,e.y,e.width,e.height)};kr.union=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),c(n)||(n=new kr);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};kr.expand=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("point",t),n=kr.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};kr.intersect=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",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?Wt.OUTSIDE:Wt.INTERSECTING};kr.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};kr.prototype.clone=function(e){return kr.clone(this,e)};kr.prototype.intersect=function(e){return kr.intersect(this,e)};kr.prototype.equals=function(e){return kr.equals(this,e)};var Ke=kr;var Ra={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};Ra.isLines=function(e){return e===Ra.LINES||e===Ra.LINE_LOOP||e===Ra.LINE_STRIP};Ra.isTriangles=function(e){return e===Ra.TRIANGLES||e===Ra.TRIANGLE_STRIP||e===Ra.TRIANGLE_FAN};Ra.validate=function(e){return e===Ra.POINTS||e===Ra.LINES||e===Ra.LINE_LOOP||e===Ra.LINE_STRIP||e===Ra.TRIANGLES||e===Ra.TRIANGLE_STRIP||e===Ra.TRIANGLE_FAN};var Me=Object.freeze(Ra);var mb=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};go.packedLength=16;go.fromArray=go.unpack;go.IDENTITY=new go(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);go.ZERO=new go(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);go.COLUMN0ROW0=0;go.COLUMN0ROW1=1;go.COLUMN0ROW2=2;go.COLUMN0ROW3=3;go.COLUMN1ROW0=4;go.COLUMN1ROW1=5;go.COLUMN1ROW2=6;go.COLUMN1ROW3=7;go.COLUMN2ROW0=8;go.COLUMN2ROW1=9;go.COLUMN2ROW2=10;go.COLUMN2ROW3=11;go.COLUMN3ROW0=12;go.COLUMN3ROW1=13;go.COLUMN3ROW2=14;go.COLUMN3ROW3=15;var tv=new h,nv=new h,nD=new h,P3e=new h,D3e=new h,Mq=new h,nue=new h,R3e=new h,O3e=new h,M3e=new $,N3e=new $,L3e=new se,F3e=new se(0,0,0,1),B3e=new go,N=go;var iue={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};Object.freeze(iue);var te=iue;var k3e=new h;function Nt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var nc={};nc[te.FLOAT]="float";nc[te.FLOAT_VEC2]="vec2";nc[te.FLOAT_VEC3]="vec3";nc[te.FLOAT_VEC4]="vec4";nc[te.INT]="int";nc[te.INT_VEC2]="ivec2";nc[te.INT_VEC3]="ivec3";nc[te.INT_VEC4]="ivec4";nc[te.BOOL]="bool";nc[te.BOOL_VEC2]="bvec2";nc[te.BOOL_VEC3]="bvec3";nc[te.BOOL_VEC4]="bvec4";nc[te.FLOAT_MAT2]="mat2";nc[te.FLOAT_MAT3]="mat3";nc[te.FLOAT_MAT4]="mat4";nc[te.SAMPLER_2D]="sampler2D";nc[te.SAMPLER_CUBE]="samplerCube";Nt.prototype.getDeclaration=function(e){let t=`uniform ${nc[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var U3e={czm_viewport:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,k3e)}}),czm_frameNumber:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Nt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Nt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Nt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},tg=U3e;function z3e(){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 Kn=z3e;function V3e(){return!0}function j3e(e,t){t=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=V3e}var ue=j3e;var ma={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ma.getSizeInBytes=function(e){switch(e){case ma.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ma.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ma.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ma.fromSizeInBytes=function(e){switch(e){case 2:return ma.UNSIGNED_SHORT;case 4:return ma.UNSIGNED_INT;case 1:return ma.UNSIGNED_BYTE}};ma.validate=function(e){return l(e)&&(e===ma.UNSIGNED_BYTE||e===ma.UNSIGNED_SHORT||e===ma.UNSIGNED_INT)};ma.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ma.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ma.fromTypedArray=function(e){if(e instanceof Uint8Array)return ma.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ma.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ma.UNSIGNED_INT};Object.freeze(ma);var je=ma;var Zb={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};Zb.validate=function(e){return e===Zb.STREAM_DRAW||e===Zb.STATIC_DRAW||e===Zb.DYNAMIC_DRAW||e===Zb.DYNAMIC_READ};Object.freeze(Zb);var Me=Zb;function Yc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Yc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Yc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createVertexBuffer=function(e){return new Yc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Yc({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Yc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yc.prototype._getBuffer=function(){return this._buffer};Yc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Yc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Yc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Yc.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Yc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var tt=Yc;var vy,ms={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},wu={};Object.defineProperties(wu,{element:{get:function(){if(wu.supportsFullscreen())return document[ms.fullscreenElement]}},changeEventName:{get:function(){if(wu.supportsFullscreen())return ms.fullscreenchange}},errorEventName:{get:function(){if(wu.supportsFullscreen())return ms.fullscreenerror}},enabled:{get:function(){if(wu.supportsFullscreen())return document[ms.fullscreenEnabled]}},fullscreen:{get:function(){if(wu.supportsFullscreen())return wu.element!==null}}});wu.supportsFullscreen=function(){if(l(vy))return vy;vy=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ms.requestFullscreen="requestFullscreen",ms.exitFullscreen="exitFullscreen",ms.fullscreenEnabled="fullscreenEnabled",ms.fullscreenElement="fullscreenElement",ms.fullscreenchange="fullscreenchange",ms.fullscreenerror="fullscreenerror",vy=!0,vy;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(ms.requestFullscreen=n,vy=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ms.requestFullscreen=n,vy=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ms.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ms.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ms.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ms.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ms.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ms.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ms.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ms.fullscreenerror=n)}return vy};wu.requestFullscreen=function(e,t){wu.supportsFullscreen()&&e[ms.requestFullscreen]({vrDisplay:t})};wu.exitFullscreen=function(){wu.supportsFullscreen()&&document[ms.exitFullscreen]()};wu._names=ms;var es=wu;var Ed;typeof navigator<"u"?Ed=navigator:Ed={};function iD(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var _j,rue;function kq(){if(!l(_j)&&(_j=!1,!Ej())){let e=/ Chrome\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(_j=!0,rue=iD(e[1]))}return _j}function H3e(){return kq()&&rue}var yj,oue;function sue(){if(!l(yj)&&(yj=!1,!kq()&&!Ej()&&/ Safari\/[\.0-9]+/.test(Ed.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(yj=!0,oue=iD(e[1]))}return yj}function G3e(){return sue()&&oue}var Aj,Bq;function aue(){if(!l(Aj)){Aj=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ed.userAgent);e!==null&&(Aj=!0,Bq=iD(e[1]),Bq.isNightly=!!e[2])}return Aj}function W3e(){return aue()&&Bq}var bj,cue;function Ej(){if(!l(bj)){bj=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(bj=!0,cue=iD(e[1]))}return bj}function q3e(){return Ej()&&cue}var xj,Uq;function Cj(){if(!l(xj)){xj=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(xj=!0,Uq=iD(e[1]))}return xj}var Nq;function Y3e(){return l(Nq)||(Nq=/Windows/i.test(Ed.appVersion)),Nq}var Lq;function X3e(){return l(Lq)||(Lq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Lq}function K3e(){return Cj()&&Uq}var Fq;function $3e(){return l(Fq)||(Fq=!Cj()&&typeof PointerEvent<"u"&&(!l(Ed.pointerEnabled)||Ed.pointerEnabled)),Fq}var lue,Tj;function uue(){if(!l(Tj)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;Tj=l(t)&&t!=="",Tj&&(lue=t)}return Tj}function J3e(){return uue()?lue:void 0}function Ll(){return Ll._result}Ll._promise=void 0;Ll._result=void 0;Ll.initialize=function(){return l(Ll._promise)||(Ll._promise=new Promise(e=>{let t=new Image;t.onload=function(){Ll._result=t.width>0&&t.height>0,e(Ll._result)},t.onerror=function(){Ll._result=!1,e(Ll._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ll._promise};Object.defineProperties(Ll,{initialized:{get:function(){return l(Ll._result)}}});var iv=[];typeof ArrayBuffer<"u"&&(iv.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&iv.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&iv.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&iv.push(BigInt64Array),typeof BigUint64Array<"u"&&iv.push(BigUint64Array));var Cd={isChrome:kq,chromeVersion:H3e,isSafari:sue,safariVersion:G3e,isWebkit:aue,webkitVersion:W3e,isEdge:Ej,edgeVersion:q3e,isFirefox:Cj,firefoxVersion:K3e,isWindows:Y3e,isIPadOrIOS:X3e,hardwareConcurrency:Ed.hardwareConcurrency??3,supportsPointerEvents:$3e,supportsImageRenderingPixelated:uue,supportsWebP:Ll,imageRenderingValue:J3e,typedArrayTypes:iv};Cd.supportsBasis=function(e){return Cd.supportsWebAssembly()&&e.context.supportsBasis};Cd.supportsFullscreen=function(){return es.supportsFullscreen()};Cd.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Cd.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Cd.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Cd.supportsBigInt=function(){return typeof BigInt<"u"};Cd.supportsWebWorkers=function(){return typeof Worker<"u"};Cd.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Cd.supportsWebgl2=function(e){return e.context.webgl2};Cd.supportsEsmWebWorkers=function(){return!Cj()||parseInt(Uq)>=114};var dn=Cd;function zq(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}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return jq[0]=t,e.fromBytes(ng[0],ng[1],ng[2],ng[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let s=i,a=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;s=zq(f,u,t+1/3),a=zq(f,u,t),c=zq(f,u,t-1/3)}return l(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=r,o):new e(s,a,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+D.nextRandomNumber()*(c-a)}let r=t.green;if(!l(r)){let a=t.minimumGreen??0,c=t.maximumGreen??1;r=a+D.nextRandomNumber()*(c-a)}let o=t.blue;if(!l(o)){let a=t.minimumBlue??0,c=t.maximumBlue??1;o=a+D.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+D.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=s,n):new e(i,r,o,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=Z3e.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=Q3e.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=eUe.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=tUe.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return ng[0]=t,ng[1]=n,ng[2]=i,ng[3]=r,jq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=D.lerp(t.red,n.red,i),r.green=D.lerp(t.green,n.green,i),r.blue=D.lerp(t.blue,n.blue,i),r.alpha=D.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Vq,jq,ng;dn.supportsTypedArrays()&&(Vq=new ArrayBuffer(4),jq=new Uint32Array(Vq),ng=new Uint8Array(Vq));var Z3e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,Q3e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,eUe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,tUe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var z=_e;function vj(e){e=e??H.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}vj.ALL=Object.freeze(new vj({color:new z(0,0,0,0),depth:1,stencil:0}));vj.prototype.execute=function(e,t){e.clear(this,t)};var li=vj;var fue={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(fue);var Ie=fue;function due(e){e=e??H.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=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}due.prototype.execute=function(e){e.execute(this)};var bf=due;var ps=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y);return r.x=o,r.y=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,Sj),e.magnitude(Sj)}static distanceSquared(t,n){return e.subtract(t,n,Sj),e.magnitudeSquared(Sj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,hue),r=e.multiplyByScalar(t,1-i,r),e.add(hue,r,r)}static angleBetween(t,n){return e.normalize(t,mue),e.normalize(n,pue),D.acosClamped(e.dot(mue,pue))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,nUe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};ps.fromCartesian3=ps.clone;ps.fromCartesian4=ps.clone;ps.packedLength=2;ps.fromArray=ps.unpack;var Sj=new ps,hue=new ps,mue=new ps,pue=new ps,nUe=new ps;ps.ZERO=Object.freeze(new ps(0,0));ps.ONE=Object.freeze(new ps(1,1));ps.UNIT_X=Object.freeze(new ps(1,0));ps.UNIT_Y=Object.freeze(new ps(0,1));var U=ps;var iUe=new h,rUe=new h;function oUe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,iUe);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=rUe;E.x=A.x*b*2,E.y=A.y*x*2,E.z=A.z*T*2;let v=(1-y)*h.magnitude(e)/(.5*h.magnitude(E)),S=0,I,R,O,L,_,C,w,P,M,F,V;do{v-=S,O=1/(1+v*b),L=1/(1+v*x),_=1/(1+v*T),C=O*O,w=L*L,P=_*_,M=C*O,F=w*L,V=P*_,I=d*C+p*w+g*P-1,R=d*M*b+p*F*x+g*V*T;let B=-2*R;S=I/B}while(Math.abs(I)>D.EPSILON12);return l(r)?(r.x=o*O,r.y=s*L,r.z=a*_,r):new h(o*O,s*L,a*_)}var Qb=oUe;var Fl=class Fl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new Fl(t,n,i)}static fromDegrees(t,n,i,r){return t=D.toRadians(t),n=D.toRadians(n),Fl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:Fl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:Fl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Fl._ellipsoidCenterToleranceSquared,a=Qb(t,r,o,s,aUe);if(!l(a))return;let c=h.multiplyComponents(a,o,sUe);c=h.normalize(c,c);let u=h.subtract(t,a,cUe),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=D.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new Fl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Fl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return Fl.clone(this,t)}equals(t){return Fl.equals(this,t)}equalsEpsilon(t,n){return Fl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(Fl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(Fl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(Fl,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var rD=Fl;rD.ZERO=Object.freeze(new rD(0,0,0));var sUe=new h,aUe=new h,cUe=new h,he=rD;function gue(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(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=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Bl=class e{constructor(t,n,i){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,gue(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&gue(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,he._ellipsoidOneOverRadii=t.oneOverRadii,he._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),s=o*Math.cos(i),a=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,D.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=lUe,r=uUe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,dUe);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,fUe),o=h.subtract(t,i,hUe),s=Math.atan2(r.y,r.x),a=Math.asin(r.z),c=D.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=s,n.latitude=a,n.height=c,n):new he(s,a,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return Qb(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*s.x+r*r*s.y+o*o*s.z);return h.multiplyByScalar(t,a,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new U);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,mUe),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,s=r*o**2;return U.fromElements(1/r,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=D.TWO_PI;let s=this._radiiSquared,a=s.x,c=s.y,u=s.z,f=a*c;return _ue(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*_ue(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+a*A*A)*p*p)})})}};Bl.WGS84=Object.freeze(new Bl(6378137,6378137,6356752314245179e-9));Bl.UNIT_SPHERE=Object.freeze(new Bl(1,1,1));Bl.MOON=Object.freeze(new Bl(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Bl.MARS=Object.freeze(new Bl(3396190,3396190,3376200));Bl._default=Bl.WGS84;Bl.packedLength=h.packedLength;Bl.prototype.geocentricSurfaceNormal=h.normalize;var lUe=new h,uUe=new h,fUe=new h,dUe=new h,hUe=new h,mUe=new h,pUe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],gUe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function _ue(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*pUe[s];o+=gUe[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Bl;var Hq=class{constructor(t){this._ellipsoid=t??ee.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}},Ui=Hq;var yue={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(yue);var $t=yue;function _Ue(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var vr=_Ue;function yUe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var Sy=yUe;function AUe(e){return e%4===0&&e%100!==0||e%400===0}var xf=AUe;var Aue=[31,28,31,30,31,30,31,31,30,31,30,31];function bUe(e,t,n,i,r,o,s,a){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a;function y(){Wr.typeOf.number.greaterThanOrEquals("Year",e,1),Wr.typeOf.number.lessThanOrEquals("Year",e,9999),Wr.typeOf.number.greaterThanOrEquals("Month",t,1),Wr.typeOf.number.lessThanOrEquals("Month",t,12),Wr.typeOf.number.greaterThanOrEquals("Day",n,1),Wr.typeOf.number.lessThanOrEquals("Day",n,31),Wr.typeOf.number.greaterThanOrEquals("Hour",i,0),Wr.typeOf.number.lessThanOrEquals("Hour",i,23),Wr.typeOf.number.greaterThanOrEquals("Minute",r,0),Wr.typeOf.number.lessThanOrEquals("Minute",r,59),Wr.typeOf.bool("IsLeapSecond",a),Wr.typeOf.number.greaterThanOrEquals("Second",o,0),Wr.typeOf.number.lessThanOrEquals("Second",o,a?60:59),Wr.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Wr.typeOf.number.lessThan("Millisecond",s,1e3)}function A(){let b=t===2&&xf(e)?Aue[t-1]+1:Aue[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Bh=bUe;function xUe(e,t){this.julianDate=e,this.offset=t}var yr=xUe;var bue={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};Object.freeze(bue);var kn=bue;var xue={UTC:0,TAI:1};Object.freeze(xue);var si=xue;var Tue=new Bh,Gq=[31,28,31,30,31,30,31,31,30,31,30,31],Wq=29;function Yq(e,t){return xi.compare(e.julianDate,t.julianDate)}var rv=new yr;function wj(e){rv.julianDate=e;let t=xi.leapSeconds,n=vr(t,rv,Yq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&xi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),xi.addSeconds(e,i,e)}function Eue(e,t){rv.julianDate=e;let n=xi.leapSeconds,i=vr(n,rv,Yq);if(i<0&&(i=~i),i===0)return xi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return xi.addSeconds(e,-n[i-1].offset,t);let r=xi.secondsDifference(n[i].julianDate,e);if(r===0)return xi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return xi.addSeconds(e,-n[i-1].offset,t)}function wy(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 qq(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(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 f=o+(i*kn.SECONDS_PER_HOUR+r*kn.SECONDS_PER_MINUTE+s*kn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var TUe=/^(\d{4})$/,EUe=/^(\d{4})-(\d{2})$/,CUe=/^(\d{4})-?(\d{3})$/,vUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,SUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Xq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,wUe=/^(\d{2})(\.\d+)?/.source+Xq.source,IUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Xq.source,PUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Xq.source;var xi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??si.UTC;let r=t|0;n=n+(t-r)*kn.SECONDS_PER_DAY,wy(r,n,this),i===si.UTC&&wj(this)}static fromGregorianDate(t,n){let i=qq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(wy(i[0],i[1],n),wj(n),n):new e(i[0],i[1],si.UTC)}static fromDate(t,n){let i=qq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(wy(i[0],i[1],n),wj(n),n):new e(i[0],i[1],si.UTC)}static fromIso8601(t,n){t=t.replace(",",".");let i=t.split("T"),r,o=1,s=1,a=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(SUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(EUe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(TUe),i!==null)r=+i[1];else{let x;if(i=d.match(CUe),i!==null)r=+i[1],x=+i[2],m=xf(r);else if(i=d.match(vUe),i!==null){r=+i[1];let T=+i[2],E=+i[3]||0,v=new Date(Date.UTC(r,0,4));x=T*7+E-v.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(x),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=xf(r);let y;if(l(p)){i=p.match(PUe),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(IUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(wUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let x=i[y],T=+i[y+1],E=+(i[y+2]||0);switch(x){case"+":a=a-T,c=c-E;break;case"-":a=a+T,c=c+E;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}let A=u===60;for(A&&u--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(g=m&&o===2?Wq:Gq[o-1];s>g;)s-=g,o++,o>12&&(o-=12,r++),g=m&&o===2?Wq:Gq[o-1];for(;c<0;)c+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)o--,o<1&&(o+=12,r--),g=m&&o===2?Wq:Gq[o-1],s+=g;let b=qq(r,o,s,a,c,u,f);return l(n)?(wy(b[0],b[1],n),wj(n)):n=new e(b[0],b[1],si.UTC),A&&e.addSeconds(n,1,n),n}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=Eue(t,Ij);l(r)||(e.addSeconds(t,-1,Ij),r=Eue(Ij,Ij),i=!0);let o=r.dayNumber,s=r.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let u=4e3*(a+1)/1461001|0;a=a-(1461*u/4|0)+31|0;let f=80*a/2447|0,d=a-(2447*f/80|0)|0;a=f/11|0;let p=f+2-12*a|0,g=100*(c-49)+u+a|0,m=s/kn.SECONDS_PER_HOUR|0,y=s-m*kn.SECONDS_PER_HOUR,A=y/kn.SECONDS_PER_MINUTE|0;y=y-A*kn.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/kn.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Bh(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,Tue),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,Tue),r=i.year,o=i.month,s=i.day,a=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&s===1&&a===0&&c===0&&u===0&&f===0&&(r=9999,o=12,s=31,a=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,si.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/kn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*kn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/kn.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){rv.julianDate=t;let n=e.leapSeconds,i=vr(n,rv,Yq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return wy(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_MINUTE;return wy(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_HOUR;return wy(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return wy(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},Ij=new xi(0,0,si.TAI);xi.leapSeconds=[new yr(new xi(2441317,43210,si.TAI),10),new yr(new xi(2441499,43211,si.TAI),11),new yr(new xi(2441683,43212,si.TAI),12),new yr(new xi(2442048,43213,si.TAI),13),new yr(new xi(2442413,43214,si.TAI),14),new yr(new xi(2442778,43215,si.TAI),15),new yr(new xi(2443144,43216,si.TAI),16),new yr(new xi(2443509,43217,si.TAI),17),new yr(new xi(2443874,43218,si.TAI),18),new yr(new xi(2444239,43219,si.TAI),19),new yr(new xi(2444786,43220,si.TAI),20),new yr(new xi(2445151,43221,si.TAI),21),new yr(new xi(2445516,43222,si.TAI),22),new yr(new xi(2446247,43223,si.TAI),23),new yr(new xi(2447161,43224,si.TAI),24),new yr(new xi(2447892,43225,si.TAI),25),new yr(new xi(2448257,43226,si.TAI),26),new yr(new xi(2448804,43227,si.TAI),27),new yr(new xi(2449169,43228,si.TAI),28),new yr(new xi(2449534,43229,si.TAI),29),new yr(new xi(2450083,43230,si.TAI),30),new yr(new xi(2450630,43231,si.TAI),31),new yr(new xi(2451179,43232,si.TAI),32),new yr(new xi(2453736,43233,si.TAI),33),new yr(new xi(2454832,43234,si.TAI),34),new yr(new xi(2456109,43235,si.TAI),35),new yr(new xi(2457204,43236,si.TAI),36),new yr(new xi(2457754,43237,si.TAI),37)];var K=xi;var Gue=Qo(Tf(),1);function DUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var oD=DUe;function Due(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=Due(r,t)),n[i]=r}return n}var Je=Due;function Rue(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Rue(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Ot=Rue;function RUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Iu=RUe;var Oue=Qo(Tf(),1);function Kq(e,t){let n;return typeof document<"u"&&(n=document),Kq._implementation(e,t,n)}Kq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Oue.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var vd=Kq;var Mue=Qo(Tf(),1);function OUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Mue.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var sD=OUe;var Nue=Qo(Tf(),1);function MUe(e){let t=new Nue.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 ig=MUe;var Lue={};function NUe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Lue[t];l(i)||(i={},Lue[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var kh=NUe;var LUe=/^blob:/i;function FUe(e){return LUe.test(e)}var ex=FUe;var Sp;function BUe(e){l(Sp)||(Sp=document.createElement("a")),Sp.href=window.location.href;let t=Sp.host,n=Sp.protocol;return Sp.href=e,Sp.href=Sp.href,n!==Sp.protocol||t!==Sp.host}var Iy=BUe;var kUe=/^data:/i;function UUe(e){return kUe.test(e)}var Uh=UUe;function zUe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var tx=zUe;function VUe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var nx=VUe;function jUe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[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 Ef=jUe;var Fue={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Fue);var Ti=Fue;var Bue={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Bue);var Zs=Bue;function Oj(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??Zs.OTHER,this.serverKey=e.serverKey,this.state=Ti.UNISSUED,this.deferred=void 0,this.cancelled=!1}Oj.prototype.cancel=function(){this.cancelled=!0};Oj.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=Ti.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Oj(this)};var wo=Oj;function HUe(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var aD=HUe;function kue(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=aD(this.responseHeaders))}kue.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var wp=kue;var Mj=Qo(Tf(),1);function cD(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(cD.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});cD.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Jq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Jq(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}cD.prototype.removeEventListener=function(e,t){let n=$q(this,this._listeners,e,t),i=$q(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function $q(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!Jq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}cD.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)Jq(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)$q(this,this._listeners,e,n);this._toRemove.clear()};var be=cD;function ix(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ix.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 Zq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ix.prototype.reserve=function(e){e=e??this._length,this._array.length=e};ix.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(Zq(i,r,e),e=r):o=!1}};ix.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ix.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)Zq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};ix.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Zq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var lD=ix;function GUe(e,t){return e.priority-t.priority}var Sr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},av=20,Xc=new lD({comparator:GUe});Xc.maximumLength=av;Xc.reserve(av);var Ip=[],rg={},WUe=typeof document<"u"?new Mj.default(document.location.href):new Mj.default,Nj=new be;function Io(){}Io.maximumRequests=50;Io.maximumRequestsPerServer=18;Io.requestsByServer={};Io.throttleRequests=!0;Io.debugShowStatistics=!1;Io.requestCompletedEvent=Nj;Object.defineProperties(Io,{statistics:{get:function(){return Sr}},priorityHeapLength:{get:function(){return av},set:function(e){if(e<av)for(;Xc.length>e;){let t=Xc.pop();rx(t)}av=e,Xc.maximumLength=e,Xc.reserve(e)}}});function Uue(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Io.serverHasOpenSlots=function(e,t){t=t??1;let n=Io.requestsByServer[e]??Io.maximumRequestsPerServer;return rg[e]+t<=n};Io.heapHasOpenSlots=function(e){return Xc.length+e<=av};function zue(e){return e.state===Ti.UNISSUED&&(e.state=Ti.ISSUED,e.deferred=Iu()),e.deferred.promise}function qUe(e){return function(t){if(e.state===Ti.CANCELLED)return;let n=e.deferred;--Sr.numberOfActiveRequests,--rg[e.serverKey],Nj.raiseEvent(),e.state=Ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function YUe(e){return function(t){e.state!==Ti.CANCELLED&&(++Sr.numberOfFailedRequests,--Sr.numberOfActiveRequests,--rg[e.serverKey],Nj.raiseEvent(t),e.state=Ti.FAILED,e.deferred.reject(t))}}function Vue(e){let t=zue(e);return e.state=Ti.ACTIVE,Ip.push(e),++Sr.numberOfActiveRequests,++Sr.numberOfActiveRequestsEver,++rg[e.serverKey],e.requestFunction().then(qUe(e)).catch(YUe(e)),t}function rx(e){let t=e.state===Ti.ACTIVE;if(e.state=Ti.CANCELLED,++Sr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Sr.numberOfActiveRequests,--rg[e.serverKey],++Sr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Io.update=function(){let e,t,n=0,i=Ip.length;for(e=0;e<i;++e){if(t=Ip[e],t.cancelled&&rx(t),t.state!==Ti.ACTIVE){++n;continue}n>0&&(Ip[e-n]=t)}Ip.length-=n;let r=Xc.internalArray,o=Xc.length;for(e=0;e<o;++e)Uue(r[e]);Xc.resort();let s=Math.max(Io.maximumRequests-Ip.length,0),a=0;for(;a<s&&Xc.length>0;){if(t=Xc.pop(),t.cancelled){rx(t);continue}if(t.throttleByServer&&!Io.serverHasOpenSlots(t.serverKey)){rx(t);continue}Vue(t),++a}XUe()};Io.getServerKey=function(e){let t=new Mj.default(e);t.scheme()===""&&(t=t.absoluteTo(WUe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=rg[n];return l(i)||(rg[n]=0),n};Io.request=function(e){if(Uh(e.url)||ex(e.url))return Nj.raiseEvent(),e.state=Ti.RECEIVED,e.requestFunction();if(++Sr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Io.getServerKey(e.url)),Io.throttleRequests&&e.throttleByServer&&!Io.serverHasOpenSlots(e.serverKey))return;if(!Io.throttleRequests||!e.throttle)return Vue(e);if(Ip.length>=Io.maximumRequests)return;Uue(e);let t=Xc.insert(e);if(l(t)){if(t===e)return;rx(t)}return zue(e)};function XUe(){Io.debugShowStatistics&&(Sr.numberOfActiveRequests===0&&Sr.lastNumberOfActiveRequests>0&&(Sr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Sr.numberOfAttemptedRequests}`),Sr.numberOfAttemptedRequests=0),Sr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Sr.numberOfCancelledRequests}`),Sr.numberOfCancelledRequests=0),Sr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Sr.numberOfCancelledActiveRequests}`),Sr.numberOfCancelledActiveRequests=0),Sr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Sr.numberOfFailedRequests}`),Sr.numberOfFailedRequests=0)),Sr.lastNumberOfActiveRequests=Sr.numberOfActiveRequests)}Io.clearForSpecs=function(){for(;Xc.length>0;){let t=Xc.pop();rx(t)}let e=Ip.length;for(let t=0;t<e;++t)rx(Ip[t]);Ip.length=0,rg={},Sr.numberOfAttemptedRequests=0,Sr.numberOfActiveRequests=0,Sr.numberOfCancelledRequests=0,Sr.numberOfCancelledActiveRequests=0,Sr.numberOfFailedRequests=0,Sr.numberOfActiveRequestsEver=0,Sr.lastNumberOfActiveRequests=0};Io.numberOfActiveRequestsByServer=function(e){return rg[e]};Io.requestHeap=Xc;var Kc=Io;var jue=Qo(Tf(),1);var uD={},cv={};uD.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(cv[n])||(cv[n]=!0)};uD.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(cv[n])&&delete cv[n]};function KUe(e){let t=new jue.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}}uD.contains=function(e){let t=KUe(e);return!!(l(t)&&l(cv[t]))};uD.clear=function(){cv={}};var lv=uD;var Wue=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function zt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Pp(e.templateValues,{}),this._queryParameters=Pp(e.queryParameters,{}),this.headers=Pp(e.headers,{}),this.request=e.request??new wo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Pp(e,t){return l(e)?Je(e):t}zt.createIfNeeded=function(e){return e instanceof zt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new zt({url:e})};var uv;zt.supportsImageBitmapOptions=function(){return l(uv)?uv:typeof createImageBitmap!="function"?(uv=Promise.resolve(!1),uv):(uv=zt.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=kh(t[0]),i=kh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),uv)};Object.defineProperties(zt,{isBlobSupported:{get:function(){return Wue}}});Object.defineProperties(zt.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 ig(this._url)}},isDataUri:{get:function(){return Uh(this._url)}},isBlobUri:{get:function(){return ex(this._url)}},isCrossOriginUrl:{get:function(){return Iy(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});zt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};zt.prototype.parseUrl=function(e,t,n,i){let r=new Gue.default(e),o=$Ue(r.query());this._queryParameters=t?Fj(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(vd(i))),this._url=r.toString()};function $Ue(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ef(e)}function Fj(e,t,n){if(!n)return Ot(e,t);let i=Je(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}zt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${JUe(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(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function JUe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${nx(e)}`}zt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Fj(this._queryParameters,e,!1):this._queryParameters=Fj(e,this._queryParameters,!1)};zt.prototype.appendQueryParameters=function(e){this._queryParameters=Fj(e,this._queryParameters,!0)};zt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(e,this._templateValues)};zt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Ot(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Ot(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Ot(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};zt.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})};zt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Je(this._queryParameters),e._templateValues=Je(this._templateValues),e.headers=Je(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new zt({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})};zt.prototype.getBaseUri=function(e){return sD(this.getUrlComponent(e),e)};zt.prototype.appendForwardSlash=function(){this._url=oD(this._url)};zt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};zt.fetchArrayBuffer=function(e){return new zt(e).fetchArrayBuffer()};zt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};zt.fetchBlob=function(e){return new zt(e).fetchBlob()};zt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(Qq(this.request),!Wue||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return zt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return zt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new zt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};zt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Iu();return zt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=Kc.request(o);if(l(s))return s.catch(function(a){return o.state!==Ti.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=Ti.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})};zt.fetchImage=function(e){return new zt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};zt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};zt.fetchText=function(e){return new zt(e).fetchText()};zt.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)})};zt.fetchJson=function(e){return new zt(e).fetchJson()};zt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};zt.fetchXML=function(e){return new zt(e).fetchXML()};zt.prototype.fetchJsonp=function(e){e=e??"callback",Qq(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return que(this,e,t)};function que(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=Iu();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},zt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=Kc.request(r);if(l(s))return s.catch(function(a){return r.state!==Ti.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=Ti.UNISSUED,r.deferred=void 0,que(e,t,n)):Promise.reject(a)})})}zt.fetchJsonp=function(e){return new zt(e).fetchJsonp(e.callbackParameterName)};zt.prototype._makeRequest=function(e){let t=this;Qq(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=Ot(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Iu(),d=zt._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=Kc.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==Ti.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=Ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function Qq(e){if(e.state===Ti.ISSUED||e.state===Ti.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=Ti.UNISSUED,e.deferred=void 0}var ZUe=/^data:(.*?)(;base64)?,(.*)$/;function Lj(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Hue(e,t){let n=Lj(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function QUe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return Lj(i,r);case"arraybuffer":return Hue(i,r);case"blob":return o=Hue(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(Lj(i,r),n);case"json":return JSON.parse(Lj(i,r));default:}}zt.prototype.fetch=function(e){return e=Pp(e,{}),e.method="GET",this._makeRequest(e)};zt.fetch=function(e){return new zt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.delete=function(e){return e=Pp(e,{}),e.method="DELETE",this._makeRequest(e)};zt.delete=function(e){return new zt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};zt.prototype.head=function(e){return e=Pp(e,{}),e.method="HEAD",this._makeRequest(e)};zt.head=function(e){return new zt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.options=function(e){return e=Pp(e,{}),e.method="OPTIONS",this._makeRequest(e)};zt.options=function(e){return new zt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.post=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};zt.post=function(e){return new zt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.put=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};zt.put=function(e){return new zt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.patch=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};zt.patch=function(e){return new zt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt._Implementations={};zt._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(r){n.reject(r)},t&&(lv.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};zt._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;zt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){zt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=Iu(),p=zt._Implementations.loadWithXhr(a,u,f,void 0,s,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${a} but it contained no content.`));return}return zt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};zt.createImageBitmapFromBlob=function(e,t){return Wr.defined("options",t),Wr.typeOf.bool("options.flipY",t.flipY),Wr.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Wr.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function eze(e,t,n,i,r,o,s){fetch(e,{method:n,headers:r}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),o.reject(new wp(a.status,a,c));return}switch(t){case"text":o.resolve(a.text());break;case"json":o.resolve(a.json());break;default:o.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new wp)})}var tze=typeof XMLHttpRequest>"u";zt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=ZUe.exec(e);if(a!==null){o.resolve(QUe(a,t));return}if(tze){eze(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(lv.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new wp(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new wp)},c.send(i),c};zt._Implementations.loadAndExecuteScript=function(e,t,n){return tx(e,t).catch(function(i){n.reject(i)})};zt._DefaultImplementations={};zt._DefaultImplementations.createImage=zt._Implementations.createImage;zt._DefaultImplementations.loadWithXhr=zt._Implementations.loadWithXhr;zt._DefaultImplementations.loadAndExecuteScript=zt._Implementations.loadAndExecuteScript;zt.DEFAULT=Object.freeze(new zt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=zt;function dD(e){e=e??H.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=e.addNewLeapSeconds??!0,l(e.data)?Yue(this,e.data):Yue(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}dD.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new dD({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};dD.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 Sy(0,0,0,0,0),t}});dD.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Sy(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,r,o;if(l(i)){let a=n[i],c=n[i+1],u=K.lessThanOrEquals(a,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,Kue(this,n,this._samples,e,r,o,t),t}let s=vr(n,e,K.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,Kue(this,n,this._samples,e,r,o,t),t};function nze(e,t){return K.compare(e.julianDate,t)}function Yue(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+kn.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,si.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,E=vr(T,x,nze);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function Xue(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function fD(e,t,n){return t+e*(n-t)}function Kue(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return Xue(e,n,r,a,s),s;if(i.equals(u))return Xue(e,n,o,a,s),s;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return s.xPoleWander=fD(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=fD(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=fD(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=fD(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=fD(f,g,m),s}var hD=dD;function $c(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}$c.fromQuaternion=function(e,t){l(t)||(t=new $c);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=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,o),t.roll=Math.atan2(r,i),t.pitch=-D.asinClamped(n),t};$c.fromDegrees=function(e,t,n,i){return l(i)||(i=new $c),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};$c.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new $c(e.heading,e.pitch,e.roll)};$c.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};$c.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};$c.prototype.clone=function(e){return $c.clone(this,e)};$c.prototype.equals=function(e){return $c.equals(this,e)};$c.prototype.equalsEpsilon=function(e,t,n){return $c.equalsEpsilon(this,e,t,n)};$c.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var wc=$c;var $ue={},Jue=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function ize(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Jue.exec(i);if(r!==null)return r[1]}}var Bj;function Zue(e){return typeof document>"u"?e:(l(Bj)||(Bj=document.createElement("a")),Bj.href=e,Bj.href)}var ox;function Que(){if(l(ox))return ox;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l($ue?.url)?e=vd(".",$ue.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=vd("..",sx("Core/buildModuleUrl.js")):e=ize(),ox=new De({url:Zue(e)}),ox.appendForwardSlash(),ox}function rze(e){return Zue(require.toUrl(`../${e}`))}function efe(e){return Que().getDerivedResource({url:e}).url}var kj;function sx(e){return l(kj)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?kj=rze:kj=efe),kj(e)}sx._cesiumScriptRegex=Jue;sx._buildModuleUrlFromBaseUrl=efe;sx._clearBaseResource=function(){ox=void 0};sx.setBaseUrl=function(e){ox=De.DEFAULT.getDerivedResource({url:e})};sx.getCesiumBaseUrl=Que;var Zt=sx;function oze(e,t,n){this.x=e,this.y=t,this.s=n}var ax=oze;function Uj(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,si.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var sze=new K(0,0,si.TAI);function eY(e,t,n){let i=sze;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}Uj.prototype.preload=function(e,t,n,i){let r=eY(this,e,t),o=eY(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(tY(this,d));return Promise.all(f)};Uj.prototype.computeXysRadians=function(e,t,n){let i=eY(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(tY(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(tY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new ax(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(s+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};Uj.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function aze(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function tY(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=aze(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var mD=Uj;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var pD=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);pD=h.normalize(e,pD);let o=pD.x*r,s=pD.y*r,a=pD.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new dt(o,s,a,c)};var cze=[1,2,0],lze=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=cze,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=lze;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new dt(i,r,o,s)};var tfe=new dt,nfe=new dt,nY=new dt,ife=new dt;dt.fromHeadingPitchRoll=function(e,t){return ife=dt.fromAxisAngle(h.UNIT_X,e.roll,tfe),nY=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(nY,ife,nY),nfe=dt.fromAxisAngle(h.UNIT_Z,-e.heading,tfe),dt.multiply(nfe,t,t)};var zj=new h,iY=new h,zh=new dt,rfe=new dt,Vj=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,Vj),dt.conjugate(Vj,Vj);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,zh),dt.multiply(zh,Vj,zh),zh.w<0&&dt.negate(zh,zh),dt.computeAxis(zh,zj);let a=dt.computeAngle(zh);l(i)||(i=[]),i[s]=zj.x*a,i[s+1]=zj.y*a,i[s+2]=zj.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,iY);let o=h.magnitude(iY);return dt.unpack(t,i*4,rfe),o===0?dt.clone(dt.IDENTITY,zh):dt.fromAxisAngle(iY,o,zh),dt.multiply(zh,rfe,r)};dt.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 dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.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};dt.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};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};dt.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};dt.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};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.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};dt.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var rY=new dt;dt.lerp=function(e,t,n,i){return rY=dt.multiplyByScalar(t,n,rY),i=dt.multiplyByScalar(e,1-n,i),dt.add(rY,i,i)};var ofe=new dt,oY=new dt,sY=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=ofe=dt.negate(t,ofe)),1-r<D.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return oY=dt.multiplyByScalar(e,Math.sin((1-n)*s),oY),sY=dt.multiplyByScalar(o,Math.sin(n*s),sY),i=dt.add(oY,sY,i),dt.multiplyByScalar(i,1/Math.sin(s),i)};dt.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=h.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 uze=new h,fze=new h,gD=new dt,fv=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,gD);dt.multiply(r,n,fv);let o=dt.log(fv,uze);dt.multiply(r,e,fv);let s=dt.log(fv,fze);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,gD),dt.multiply(t,gD,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,gD),a=dt.slerp(n,i,r,fv);return dt.slerp(s,a,2*r*(1-r),o)};var dze=new dt,sfe=1.9011074535173003,jj=dn.supportsTypedArrays()?new Float32Array(8):[],Hj=dn.supportsTypedArrays()?new Float32Array(8):[],og=dn.supportsTypedArrays()?new Float32Array(8):[],sg=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;jj[e]=1/(t*n),Hj[e]=t/n}jj[7]=sfe/136;Hj[7]=sfe*8/17;dt.fastSlerp=function(e,t,n,i){let r=dt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)og[g]=(jj[g]*c-Hj[g])*s,sg[g]=(jj[g]*u-Hj[g])*s;let f=o*n*(1+og[0]*(1+og[1]*(1+og[2]*(1+og[3]*(1+og[4]*(1+og[5]*(1+og[6]*(1+og[7])))))))),d=a*(1+sg[0]*(1+sg[1]*(1+sg[2]*(1+sg[3]*(1+sg[4]*(1+sg[5]*(1+sg[6]*(1+sg[7])))))))),p=dt.multiplyByScalar(e,d,dze);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,r,o){let s=dt.fastSlerp(e,t,r,gD),a=dt.fastSlerp(n,i,r,fv);return dt.fastSlerp(s,a,2*r*(1-r),o)};dt.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};dt.equalsEpsilon=function(e,t,n){return n=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};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=dt;var Ei={},aY={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"}},dv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},cY={},Pu={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Py=new h,Dy=new h,Ry=new h;Ei.localFrameToFixedFrameGenerator=function(e,t){if(!aY.hasOwnProperty(e)||!aY[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=aY[e][t],i,r=e+t;return l(cY[r])?i=cY[r]:(i=function(o,s,a){if(l(a)||(a=new N),h.equalsEpsilon(o,h.ZERO,D.EPSILON14))h.unpack(dv[e],0,Py),h.unpack(dv[t],0,Dy),h.unpack(dv[n],0,Ry);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);h.unpack(dv[e],0,Py),e!=="east"&&e!=="west"&&h.multiplyByScalar(Py,c,Py),h.unpack(dv[t],0,Dy),t!=="east"&&t!=="west"&&h.multiplyByScalar(Dy,c,Dy),h.unpack(dv[n],0,Ry),n!=="east"&&n!=="west"&&h.multiplyByScalar(Ry,c,Ry)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,Pu.up);let c=Pu.up,u=Pu.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Pu.east),h.cross(c,u,Pu.north),h.multiplyByScalar(Pu.up,-1,Pu.down),h.multiplyByScalar(Pu.east,-1,Pu.west),h.multiplyByScalar(Pu.north,-1,Pu.south),Py=Pu[e],Dy=Pu[t],Ry=Pu[n]}return a[0]=Py.x,a[1]=Py.y,a[2]=Py.z,a[3]=0,a[4]=Dy.x,a[5]=Dy.y,a[6]=Dy.z,a[7]=0,a[8]=Ry.x,a[9]=Ry.y,a[10]=Ry.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},cY[r]=i),i};Ei.eastNorthUpToFixedFrame=Ei.localFrameToFixedFrameGenerator("east","north");Ei.northEastDownToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","east");Ei.northUpEastToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","up");Ei.northWestUpToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","west");var hze=new Le,mze=new h(1,1,1),pze=new N;Ei.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ei.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,hze),s=N.fromTranslationQuaternionRotationScale(h.ZERO,o,mze,pze);return r=i(e,n,r),N.multiply(r,s,r)};var gze=new N,_ze=new $;Ei.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ei.headingPitchRollToFixedFrame(e,t,n,i,gze),s=N.getMatrix3(o,_ze);return Le.fromRotationMatrix(s,r)};var yze=new h(1,1,1),Aze=new h,afe=new N,bze=new N,xze=new $,Tze=new Le;Ei.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??Ei.eastNorthUpToFixedFrame,l(i)||(i=new wc);let r=N.getTranslation(e,Aze);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,afe),afe),s=N.setScale(e,yze,bze);s=N.setTranslation(s,h.ZERO,s),o=N.multiply(o,s,o);let a=Le.fromRotationMatrix(N.getMatrix3(o,xze),Tze);return a=Le.normalize(a,a),wc.fromQuaternion(a,i)};var Eze=6*3600+2460+50.54841,Cze=8640184812866e-6,vze=.093104,Sze=-62e-7,wze=11772758384668e-32,Ize=72921158553e-15,Pze=D.TWO_PI/86400,Gj=new K;Ei.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ei.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ei.computeTemeToPseudoFixedMatrix(e,t)),n};Ei.computeTemeToPseudoFixedMatrix=function(e,t){Gj=K.addSeconds(e,-K.computeTaiMinusUtc(e),Gj);let n=Gj.dayNumber,i=Gj.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/kn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/kn.DAYS_PER_JULIAN_CENTURY;let a=(Eze+r*(Cze+r*(vze+r*Sze)))*Pze%D.TWO_PI,c=Ize+wze*(n-24515455e-1),u=(i+kn.SECONDS_PER_DAY*.5)%kn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};Ei.iau2006XysData=new mD;Ei.earthOrientationParameters=hD.NONE;var fY=32.184,Dze=2451545;Ei.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+fY,i=e.stop.dayNumber,r=e.stop.secondsOfDay+fY;return Ei.iau2006XysData.preload(t,n,i,r)};Ei.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Rze=32.184,Oze=2451545,Wj=new wc,Mze=new $,Nze=new K;Ei.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,Rze,Nze),i=K.totalDays(n)-Oze,r=D.toRadians(12.112)-D.toRadians(.052992)*i,o=D.toRadians(24.224)-D.toRadians(.105984)*i,s=D.toRadians(227.645)+D.toRadians(13.012)*i,a=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return Wj.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(r)-D.toRadians(.12)*Math.sin(o)+D.toRadians(.07)*Math.sin(s)-D.toRadians(.017)*Math.sin(a),Wj.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(r)+D.toRadians(.24)*Math.cos(o)-D.toRadians(.028)*Math.cos(s)+D.toRadians(.007)*Math.cos(a),Wj.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(r)+D.toRadians(.121)*Math.sin(o)-D.toRadians(.064)*Math.sin(s)+D.toRadians(.016)*Math.sin(a)+D.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(Wj,Mze,t)};Ei.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Lze=new ax(0,0,0),Fze=new Sy(0,0,0,0,0,0),lY=new $,uY=new $;Ei.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ei.earthOrientationParameters.compute(e,Fze);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+fY,o=Ei.iau2006XysData.computeXysRadians(i,r,Lze);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=lY;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,uY),d=$.multiply(u,f,lY),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/kn.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*D.TWO_PI;let b=$.fromRotationZ(A,uY),x=$.multiply(d,b,lY),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-Dze+r/kn.SECONDS_PER_DAY;I/=36525;let R=-47e-6*I*D.RADIANS_PER_DEGREE/3600,O=Math.cos(R),L=Math.sin(R),_=uY;return _[0]=T*O,_[1]=T*L,_[2]=v,_[3]=-E*L+S*v*O,_[4]=E*O+S*v*L,_[5]=-S*T,_[6]=-S*L-E*v*O,_[7]=S*O-E*v*L,_[8]=E*T,$.multiply(x,_,t)};var Bze=new se;Ei.pointToWindowCoordinates=function(e,t,n,i){return i=Ei.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ei.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=Bze;return N.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),N.multiplyByVector(t,r,r),U.fromCartesian4(r,i)};var kze=new h,Uze=new h,zze=new h;Ei.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,kze),o=h.cross(t,r,Uze);h.equalsEpsilon(o,h.ZERO,D.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,zze);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ei.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var cfe=new he,dY=new h,Vze=new h,jze=new $,hY=new N,lfe=new N;Ei.basisTo2D=function(e,t,n){let i=N.getTranslation(t,Vze),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,dY);else{let f=r.cartesianToCartographic(i,cfe);o=e.project(f,dY),h.fromElements(o.z,o.x,o.y,o)}let s=Ei.eastNorthUpToFixedFrame(i,r,hY),a=N.inverseTransformation(s,lfe),c=N.getMatrix3(t,jze),u=N.multiplyByMatrix3(a,c,n);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,u,n),N.setTranslation(n,o,n),n};Ei.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ei.eastNorthUpToFixedFrame(t,i,hY),o=N.inverseTransformation(r,lfe),s=i.cartesianToCartographic(t,cfe),a=e.project(s,dY);h.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,hY);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,o,n),N.multiply(c,n,n),n};var At=Ei;var hv=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=D.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),r=D.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+D.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>D.PI&&(r=r-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new e(i,a,r,c)}static fromCartesianArray(t,n,i){n=n??ee.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+D.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-r>a-s&&(r=s,o=a,o>D.PI&&(o=o-D.TWO_PI),r>D.PI&&(r=r-D.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=ee.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=At.eastNorthUpToFixedFrame(r,n,Hze),a=N.multiplyByPointAsVector(s,h.UNIT_X,Gze);h.normalize(a,a);let c=N.multiplyByPointAsVector(s,h.UNIT_Y,Wze);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,Yze),f=h.negate(a,qze),d=mY,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,a,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new he(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new he(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new he(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new he(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=D.TWO_PI);let o=D.negativePiToPi((r+i)*.5),s=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new he(o,s)}static intersection(t,n,i){let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=D.TWO_PI:s<a&&r>0&&(s+=D.TWO_PI),r<o&&a<0?a+=D.TWO_PI:s<a&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.max(o,a)),u=D.negativePiToPi(Math.min(r,s));if(c===D.PI&&u<D.PI&&(c=-D.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||r>=s))return l(i)?(i.west=r,i.south=o,i.east=s,i.north=a,i):new e(r,o,s,a)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=D.TWO_PI:s<a&&r>0&&(s+=D.TWO_PI),r<o&&a<0?a+=D.TWO_PI:s<a&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.min(o,a)),u=D.negativePiToPi(Math.max(r,s));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,s=t.east;return s<o&&(s+=D.TWO_PI,i<0&&(i+=D.TWO_PI)),(i>o||D.equalsEpsilon(i,o,D.EPSILON14))&&(i<s||D.equalsEpsilon(i,s,D.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??ee.default,i=i??0,l(r)||(r=[]);let o=0,s=t.north,a=t.south,c=t.east,u=t.west,f=Xze;f.height=i,f.longitude=u,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,s<0?f.latitude=s:a>0?f.latitude=a:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*D.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+r*c}else{let c=D.TWO_PI+t.east-t.west;s.west=D.negativePiToPi(t.west+n*c),s.east=D.negativePiToPi(t.west+r*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+o*a,n===1&&(s.west=t.east),r===1&&(s.east=t.east),i===1&&(s.south=t.north),o===1&&(s.north=t.north),s}};hv.packedLength=4;var Hze=new N,Gze=new h,Wze=new h,qze=new h,Yze=new h,mY=new Array(5);for(let e=0;e<mY.length;++e)mY[e]=new h;var Xze=new he;hv.MAX_VALUE=Object.freeze(new hv(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ie=hv;function gs(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}gs.packedLength=4;gs.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};gs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new gs),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};gs.fromPoints=function(e,t){if(l(t)||(t=new gs),!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,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var ufe=new Ui,Kze=new he,$ze=new he;gs.fromRectangle=function(e,t,n){if(l(n)||(n=new gs),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;ufe._ellipsoid=ee.default,t=t??ufe;let i=t.project(ie.southwest(e,Kze)),r=t.project(ie.northeast(e,$ze));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};gs.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 gs(e.x,e.y,e.width,e.height)};gs.union=function(e,t,n){l(n)||(n=new gs);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=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=r,n.width=o-i,n.height=s-r,n};gs.expand=function(e,t,n){n=gs.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};gs.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};gs.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};gs.prototype.clone=function(e){return gs.clone(this,e)};gs.prototype.intersect=function(e){return gs.intersect(this,e)};gs.prototype.equals=function(e){return gs.equals(this,e)};var et=gs;var ic={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};ic.isLines=function(e){return e===ic.LINES||e===ic.LINE_LOOP||e===ic.LINE_STRIP};ic.isTriangles=function(e){return e===ic.TRIANGLES||e===ic.TRIANGLE_STRIP||e===ic.TRIANGLE_FAN};ic.validate=function(e){return e===ic.POINTS||e===ic.LINES||e===ic.LINE_LOOP||e===ic.LINE_STRIP||e===ic.TRIANGLES||e===ic.TRIANGLE_STRIP||e===ic.TRIANGLE_FAN};Object.freeze(ic);var Oe=ic;var cx=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; void main() @@ -85,57 +85,61 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var Er={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 Ev(e){e=e??W.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Me.TRIANGLES,this._vertexArray=e.vertexArray,this._count=e.count,this._offset=e.offset??0,this._instanceCount=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=e.cull??!0,this.occlude=e.occlude??!0,this.executeInClosestFrustum=e.executeInClosestFrustum??!1,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.castShadows=e.castShadows??!1,this.receiveShadows=e.receiveShadows??!1,this.pickOnly=e.pickOnly??!1,this.depthForTranslucentClassification=e.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function cc(e,t){return(e._flags&t)===t}function Gg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(Ev.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 cc(this,Er.CULL)},set:function(e){cc(this,Er.CULL)!==e&&(Gg(this,Er.CULL,e),this.dirty=!0)}},occlude:{get:function(){return cc(this,Er.OCCLUDE)},set:function(e){cc(this,Er.OCCLUDE)!==e&&(Gg(this,Er.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 cc(this,Er.CAST_SHADOWS)},set:function(e){cc(this,Er.CAST_SHADOWS)!==e&&(Gg(this,Er.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return cc(this,Er.RECEIVE_SHADOWS)},set:function(e){cc(this,Er.RECEIVE_SHADOWS)!==e&&(Gg(this,Er.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 cc(this,Er.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){cc(this,Er.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Gg(this,Er.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 cc(this,Er.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){cc(this,Er.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Gg(this,Er.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 cc(this,Er.PICK_ONLY)},set:function(e){cc(this,Er.PICK_ONLY)!==e&&(Gg(this,Er.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return cc(this,Er.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){cc(this,Er.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Gg(this,Er.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});Ev.shallowClone=function(e,t){if(c(e))return c(t)||(t=new Ev),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};Ev.prototype.execute=function(e,t){e.draw(this,t)};var Qe=Ev;var di={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};di.toWebGLConstant=function(e,t){switch(e){case di.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case di.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case di.UNSIGNED_INT:return ne.UNSIGNED_INT;case di.FLOAT:return ne.FLOAT;case di.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case di.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case di.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case di.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case di.UNSIGNED_SHORT_5_6_5:return di.UNSIGNED_SHORT_5_6_5}};di.isPacked=function(e){return e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.sizeInBytes=function(e){switch(e){case di.UNSIGNED_BYTE:return 1;case di.UNSIGNED_SHORT:case di.UNSIGNED_SHORT_4_4_4_4:case di.UNSIGNED_SHORT_5_5_5_1:case di.UNSIGNED_SHORT_5_6_5:case di.HALF_FLOAT:return 2;case di.UNSIGNED_INT:case di.FLOAT:case di.UNSIGNED_INT_24_8:return 4}};di.validate=function(e){return e===di.UNSIGNED_BYTE||e===di.UNSIGNED_SHORT||e===di.UNSIGNED_INT||e===di.FLOAT||e===di.HALF_FLOAT||e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.getTypedArrayConstructor=function(e){let t=di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===di.FLOAT?Float32Array:Uint32Array};var Ue=Object.freeze(di);var rt={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.RED||e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=rt.componentsLength(e)*n*i;return new o(r)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let l=0;l<o;++l){let u=l*i*s,f=(o-l-1)*i*s;for(let h=0;h<a;++h)r[f+h]=e[u+h]}return r};rt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===rt.DEPTH_STENCIL)return ne.DEPTH24_STENCIL8;if(e===rt.DEPTH_COMPONENT){if(t===Ue.UNSIGNED_SHORT)return ne.DEPTH_COMPONENT16;if(t===Ue.UNSIGNED_INT)return ne.DEPTH_COMPONENT24}if(t===Ue.FLOAT)switch(e){case rt.RGBA:return ne.RGBA32F;case rt.RGB:return ne.RGB32F;case rt.RG:return ne.RG32F;case rt.RED:return ne.R32F}if(t===Ue.HALF_FLOAT)switch(e){case rt.RGBA:return ne.RGBA16F;case rt.RGB:return ne.RGB16F;case rt.RG:return ne.RG16F;case rt.RED:return ne.R16F}return e};var ke=Object.freeze(rt);var Sr={_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(Sr,{maximumCombinedTextureImageUnits:{get:function(){return Sr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Sr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Sr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Sr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Sr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Sr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Sr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Sr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Sr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Sr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Sr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Sr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Sr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Sr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Sr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Sr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Sr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Sr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Sr._maximumColorAttachments}},maximumSamples:{get:function(){return Sr._maximumSamples}},highpFloatSupported:{get:function(){return Sr._highpFloatSupported}},highpIntSupported:{get:function(){return Sr._highpIntSupported}}});var ut=Sr;function mj(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function sV(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Rd(e){e=e??W.EMPTY_OBJECT;let t=e.context;T.defined("options.context",t);let n=t._gl,i=ut.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=e.destroyAttachments??!0,c(e.colorTextures)&&c(e.colorRenderbuffers))throw new E("Cannot have both color texture and color renderbuffer attachments.");if(c(e.depthTexture)&&c(e.depthRenderbuffer))throw new E("Cannot have both a depth texture and depth renderbuffer attachment.");if(c(e.depthStencilTexture)&&c(e.depthStencilRenderbuffer))throw new E("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");let o=c(e.depthTexture)||c(e.depthRenderbuffer),r=c(e.depthStencilTexture)||c(e.depthStencilRenderbuffer);if(o&&r)throw new E("Cannot have both a depth and depth-stencil attachment.");if(c(e.stencilRenderbuffer)&&r)throw new E("Cannot have both a stencil and depth-stencil attachment.");if(o&&c(e.stencilRenderbuffer))throw new E("Cannot have both a depth and stencil attachment.");if(this._bind(),c(e.colorTextures)){let s=e.colorTextures,a=this._colorTextures.length=this._activeColorAttachments.length=s.length;if(a>i)throw new E("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let u=s[l];if(!ke.isColorFormat(u.pixelFormat))throw new E("The color-texture pixel-format must be a color format.");if(u.pixelDatatype===Ue.FLOAT&&!t.colorBufferFloat)throw new E("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(u.pixelDatatype===Ue.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new E("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");let f=this._gl.COLOR_ATTACHMENT0+l;mj(this,f,u),this._activeColorAttachments[l]=f,this._colorTextures[l]=u}}if(c(e.colorRenderbuffers)){let s=e.colorRenderbuffers,a=this._colorRenderbuffers.length=this._activeColorAttachments.length=s.length;if(a>i)throw new E("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let u=s[l],f=this._gl.COLOR_ATTACHMENT0+l;sV(this,f,u),this._activeColorAttachments[l]=f,this._colorRenderbuffers[l]=u}}if(c(e.depthTexture)){let s=e.depthTexture;if(s.pixelFormat!==ke.DEPTH_COMPONENT)throw new E("The depth-texture pixel-format must be DEPTH_COMPONENT.");mj(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s}if(c(e.depthRenderbuffer)){let s=e.depthRenderbuffer;sV(this,this._gl.DEPTH_ATTACHMENT,s),this._depthRenderbuffer=s}if(c(e.stencilRenderbuffer)){let s=e.stencilRenderbuffer;sV(this,this._gl.STENCIL_ATTACHMENT,s),this._stencilRenderbuffer=s}if(c(e.depthStencilTexture)){let s=e.depthStencilTexture;if(s.pixelFormat!==ke.DEPTH_STENCIL)throw new E("The depth-stencil pixel-format must be DEPTH_STENCIL.");mj(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s}if(c(e.depthStencilRenderbuffer)){let s=e.depthStencilRenderbuffer;sV(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilRenderbuffer=s}this._unBind()}Object.defineProperties(Rd.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)}}});Rd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Rd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Rd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Rd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Rd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Rd.prototype.getColorTexture=function(e){if(!c(e)||e<0||e>=this._colorTextures.length)throw new E("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]};Rd.prototype.getColorRenderbuffer=function(e){if(!c(e)||e<0||e>=this._colorRenderbuffers.length)throw new E("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]};Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];c(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];c(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),de(this)};var Ur=Rd;var aV={CLOCKWISE:ne.CW,COUNTER_CLOCKWISE:ne.CCW};aV.validate=function(e){return e===aV.CLOCKWISE||e===aV.COUNTER_CLOCKWISE};var ts=Object.freeze(aV);function Cee(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]=Cee(e[t]));return Object.freeze(e)}var Sv=Cee;function Eee(e){return e===ne.FUNC_ADD||e===ne.FUNC_SUBTRACT||e===ne.FUNC_REVERSE_SUBTRACT||e===ne.MIN||e===ne.MAX}function cV(e){return e===ne.ZERO||e===ne.ONE||e===ne.SRC_COLOR||e===ne.ONE_MINUS_SRC_COLOR||e===ne.DST_COLOR||e===ne.ONE_MINUS_DST_COLOR||e===ne.SRC_ALPHA||e===ne.ONE_MINUS_SRC_ALPHA||e===ne.DST_ALPHA||e===ne.ONE_MINUS_DST_ALPHA||e===ne.CONSTANT_COLOR||e===ne.ONE_MINUS_CONSTANT_COLOR||e===ne.CONSTANT_ALPHA||e===ne.ONE_MINUS_CONSTANT_ALPHA||e===ne.SRC_ALPHA_SATURATE}function _De(e){return e===ne.FRONT||e===ne.BACK||e===ne.FRONT_AND_BACK}function gDe(e){return e===ne.NEVER||e===ne.LESS||e===ne.EQUAL||e===ne.LEQUAL||e===ne.GREATER||e===ne.NOTEQUAL||e===ne.GEQUAL||e===ne.ALWAYS}function See(e){return e===ne.NEVER||e===ne.LESS||e===ne.EQUAL||e===ne.LEQUAL||e===ne.GREATER||e===ne.NOTEQUAL||e===ne.GEQUAL||e===ne.ALWAYS}function aC(e){return e===ne.ZERO||e===ne.KEEP||e===ne.REPLACE||e===ne.INCR||e===ne.DECR||e===ne.INVERT||e===ne.INCR_WRAP||e===ne.DECR_WRAP}function um(e){let t=e??W.EMPTY_OBJECT,n=t.cull??W.EMPTY_OBJECT,i=t.polygonOffset??W.EMPTY_OBJECT,o=t.scissorTest??W.EMPTY_OBJECT,r=o.rectangle??W.EMPTY_OBJECT,s=t.depthRange??W.EMPTY_OBJECT,a=t.depthTest??W.EMPTY_OBJECT,l=t.colorMask??W.EMPTY_OBJECT,u=t.blending??W.EMPTY_OBJECT,f=u.color??W.EMPTY_OBJECT,h=t.stencilTest??W.EMPTY_OBJECT,p=h.frontOperation??W.EMPTY_OBJECT,g=h.backOperation??W.EMPTY_OBJECT,m=t.sampleCoverage??W.EMPTY_OBJECT,y=t.viewport;if(this.frontFace=t.frontFace??ts.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ne.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:Ke.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??ne.LESS},this.colorMask={red:l.red??!0,green:l.green??!0,blue:l.blue??!0,alpha:l.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new G(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ne.FUNC_ADD,equationAlpha:u.equationAlpha??ne.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ne.ONE,functionSourceAlpha:u.functionSourceAlpha??ne.ONE,functionDestinationRgb:u.functionDestinationRgb??ne.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ne.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ne.ALWAYS,backFunction:h.backFunction??ne.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ne.KEEP,zFail:p.zFail??ne.KEEP,zPass:p.zPass??ne.KEEP},backOperation:{fail:g.fail??ne.KEEP,zFail:g.zFail??ne.KEEP,zPass:g.zPass??ne.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=c(y)?new Ke(y.x,y.y,y.width,y.height):void 0,this.lineWidth<ut.minimumAliasedLineWidth||this.lineWidth>ut.maximumAliasedLineWidth)throw new E("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!ts.validate(this.frontFace))throw new E("Invalid renderState.frontFace.");if(!_De(this.cull.face))throw new E("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new E("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new E("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new E("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new E("renderState.depthRange.far must be less than or equal to one.");if(!gDe(this.depthTest.func))throw new E("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new E("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!Eee(this.blending.equationRgb))throw new E("Invalid renderState.blending.equationRgb.");if(!Eee(this.blending.equationAlpha))throw new E("Invalid renderState.blending.equationAlpha.");if(!cV(this.blending.functionSourceRgb))throw new E("Invalid renderState.blending.functionSourceRgb.");if(!cV(this.blending.functionSourceAlpha))throw new E("Invalid renderState.blending.functionSourceAlpha.");if(!cV(this.blending.functionDestinationRgb))throw new E("Invalid renderState.blending.functionDestinationRgb.");if(!cV(this.blending.functionDestinationAlpha))throw new E("Invalid renderState.blending.functionDestinationAlpha.");if(!See(this.stencilTest.frontFunction))throw new E("Invalid renderState.stencilTest.frontFunction.");if(!See(this.stencilTest.backFunction))throw new E("Invalid renderState.stencilTest.backFunction.");if(!aC(this.stencilTest.frontOperation.fail))throw new E("Invalid renderState.stencilTest.frontOperation.fail.");if(!aC(this.stencilTest.frontOperation.zFail))throw new E("Invalid renderState.stencilTest.frontOperation.zFail.");if(!aC(this.stencilTest.frontOperation.zPass))throw new E("Invalid renderState.stencilTest.frontOperation.zPass.");if(!aC(this.stencilTest.backOperation.fail))throw new E("Invalid renderState.stencilTest.backOperation.fail.");if(!aC(this.stencilTest.backOperation.zFail))throw new E("Invalid renderState.stencilTest.backOperation.zFail.");if(!aC(this.stencilTest.backOperation.zPass))throw new E("Invalid renderState.stencilTest.backOperation.zPass.");if(c(this.viewport)){if(this.viewport.width<0)throw new E("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new E("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>ut.maximumViewportWidth)throw new E(`renderState.viewport.width must be less than or equal to the maximum viewport width (${ut.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>ut.maximumViewportHeight)throw new E(`renderState.viewport.height must be less than or equal to the maximum viewport height (${ut.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}var yDe=0,lm={};um.fromCache=function(e){let t=JSON.stringify(e),n=lm[t];if(c(n))return++n.referenceCount,n.state;let i=new um(e),o=JSON.stringify(i);return n=lm[o],c(n)||(i.id=yDe++,i=Sv(i),n={referenceCount:0,state:i},lm[o]=n),++n.referenceCount,lm[t]={referenceCount:1,state:n.state},n.state};um.removeFromCache=function(e){let t=new um(e),n=JSON.stringify(t),i=lm[n],o=JSON.stringify(e),r=lm[o];c(r)&&(--r.referenceCount,r.referenceCount===0&&(delete lm[o],c(i)&&--i.referenceCount)),c(i)&&i.referenceCount===0&&delete lm[n]};um.getCache=function(){return lm};um.clearCache=function(){lm={}};function pb(e,t,n){n?e.enable(t):e.disable(t)}function wee(e,t){e.frontFace(t.frontFace)}function vee(e,t){let n=t.cull,i=n.enabled;pb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Dee(e,t){e.lineWidth(t.lineWidth)}function Pee(e,t){let n=t.polygonOffset,i=n.enabled;pb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Iee(e,t,n){let i=t.scissorTest,o=c(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(pb(e,e.SCISSOR_TEST,o),o){let r=c(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function Oee(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Ree(e,t){let n=t.depthTest,i=n.enabled;pb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Mee(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Lee(e,t){e.depthMask(t.depthMask)}function Nee(e,t){e.stencilMask(t.stencilMask)}function bDe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Fee(e,t,n){let i=t.blending,o=c(n.blendingEnabled)?n.blendingEnabled:i.enabled;pb(e,e.BLEND,o),o&&(bDe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Bee(e,t){let n=t.stencilTest,i=n.enabled;if(pb(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 l=n.frontOperation,u=l.fail,f=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function kee(e,t){let n=t.sampleCoverage,i=n.enabled;pb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var xDe=new Ke;function Uee(e,t,n){let i=t.viewport??n.viewport;c(i)||(i=xDe,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)}um.apply=function(e,t,n){wee(e,t),vee(e,t),Dee(e,t),Pee(e,t),Oee(e,t),Ree(e,t),Mee(e,t),Lee(e,t),Nee(e,t),Bee(e,t),kee(e,t),Iee(e,t,n),Fee(e,t,n),Uee(e,t,n)};function TDe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(wee),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(vee),e.lineWidth!==t.lineWidth&&n.push(Dee),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Pee),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Oee),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Ree),(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(Mee),e.depthMask!==t.depthMask&&n.push(Lee),e.stencilMask!==t.stencilMask&&n.push(Nee),(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(Bee),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(kee),n}um.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];c(f)||(f=TDe(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let s=c(i.scissorTest)?i.scissorTest:t.scissorTest,a=c(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&Iee(e,n,o);let l=c(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=c(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(l!==u||u&&t.blending!==n.blending)&&Fee(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Uee(e,n,o)};um.getState=function(e){if(!c(e))throw new E("renderState is required.");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:G.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:c(e.viewport)?Ke.clone(e.viewport):void 0}};var Ve=um;function Kt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}Kt.packedLength=4;Kt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Kt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Kt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Kt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new E("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Kt.pack(e[o],t,o*4);return t};Kt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new E("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Kt.unpack(e,i,t[o])}return t};Kt.clone=function(e,t){if(c(e))return c(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Kt(e[0],e[2],e[1],e[3])};Kt.fromArray=Kt.unpack;Kt.fromColumnMajorArray=function(e,t){return T.defined("values",e),Kt.clone(e,t)};Kt.fromRowMajorArray=function(e,t){return T.defined("values",e),c(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Kt(e[0],e[1],e[2],e[3])};Kt.fromScale=function(e,t){return T.typeOf.object("scale",e),c(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Kt(e.x,0,0,e.y)};Kt.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Kt(e,0,0,e)};Kt.fromRotation=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Kt(n,-i,i,n)};Kt.toArray=function(e,t){return T.typeOf.object("matrix",e),c(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]]};Kt.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,1),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};Kt.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("result",n);let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Kt.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=Kt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Kt.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("result",n);let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Kt.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=Kt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var ADe=new H;Kt.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=Kt.getScale(e,ADe),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 CDe=new H;Kt.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=Kt.getScale(e,CDe),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 Vee=new H;Kt.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=H.magnitude(H.fromElements(e[0],e[1],Vee)),t.y=H.magnitude(H.fromElements(e[2],e[3],Vee)),t};var zee=new H;Kt.getMaximumScale=function(e){return Kt.getScale(e,zee),H.maximumComponent(zee)};var EDe=new H;Kt.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=Kt.getScale(e,EDe);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 SDe=new H;Kt.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=Kt.getScale(e,SDe);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};Kt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",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};Kt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};Kt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};Kt.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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};Kt.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Kt.multiplyByScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n),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};Kt.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Kt.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Kt.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",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};Kt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};Kt.equals=function(e,t){return e===t||c(e)&&c(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Kt.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]};Kt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};Kt.IDENTITY=Object.freeze(new Kt(1,0,0,1));Kt.ZERO=Object.freeze(new Kt(0,0,0,0));Kt.COLUMN0ROW0=0;Kt.COLUMN0ROW1=1;Kt.COLUMN1ROW0=2;Kt.COLUMN1ROW1=3;Object.defineProperties(Kt.prototype,{length:{get:function(){return Kt.packedLength}}});Kt.prototype.clone=function(e){return Kt.clone(this,e)};Kt.prototype.equals=function(e){return Kt.equals(this,e)};Kt.prototype.equalsEpsilon=function(e,t){return Kt.equalsEpsilon(this,e,t)};Kt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var Ri=Kt;function wDe(e,t,n,i){switch(t.type){case e.FLOAT:return new Hee(e,t,n,i);case e.FLOAT_VEC2:return new Gee(e,t,n,i);case e.FLOAT_VEC3:return new jee(e,t,n,i);case e.FLOAT_VEC4:return new Wee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new pj(e,t,n,i);case e.INT:case e.BOOL:return new qee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Yee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Xee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Kee(e,t,n,i);case e.FLOAT_MAT2:return new $ee(e,t,n,i);case e.FLOAT_MAT3:return new Zee(e,t,n,i);case e.FLOAT_MAT4:return new Qee(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Hee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Hee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Gee(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}Gee.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function jee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}jee.prototype.set=function(){let e=this.value;if(c(e.red))G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(c(e.x))d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new E(`Invalid vec3 value for uniform "${this.name}".`)};function Wee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Wee.prototype.set=function(){let e=this.value;if(c(e.red))G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(c(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));else throw new E(`Invalid vec4 value for uniform "${this.name}".`)};function pj(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}pj.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};pj.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function qee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}qee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Yee(e,t,n,i){this.name=n,this.value=void 0,this._value=new H,this._gl=e,this._location=i}Yee.prototype.set=function(){let e=this.value;H.equals(e,this._value)||(H.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Xee(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}Xee.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Kee(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}Kee.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 vDe=new Float32Array(4);function $ee(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ri,this._gl=e,this._location=i}$ee.prototype.set=function(){if(!Ri.equalsArray(this.value,this._value,0)){Ri.clone(this.value,this._value);let e=Ri.toArray(this.value,vDe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var DDe=new Float32Array(9);function Zee(e,t,n,i){this.name=n,this.value=void 0,this._value=new J,this._gl=e,this._location=i}Zee.prototype.set=function(){if(!J.equalsArray(this.value,this._value,0)){J.clone(this.value,this._value);let e=J.toArray(this.value,DDe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var PDe=new Float32Array(16);function Qee(e,t,n,i){this.name=n,this.value=void 0,this._value=new B,this._gl=e,this._location=i}Qee.prototype.set=function(){if(!B.equalsArray(this.value,this._value,0)){B.clone(this.value,this._value);let e=B.toArray(this.value,PDe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var wv=wDe;function IDe(e,t,n,i){switch(t.type){case e.FLOAT:return new Jee(e,t,n,i);case e.FLOAT_VEC2:return new ete(e,t,n,i);case e.FLOAT_VEC3:return new tte(e,t,n,i);case e.FLOAT_VEC4:return new nte(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new _j(e,t,n,i);case e.INT:case e.BOOL:return new ite(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new ote(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new rte(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new ste(e,t,n,i);case e.FLOAT_MAT2:return new ate(e,t,n,i);case e.FLOAT_MAT3:return new cte(e,t,n,i);case e.FLOAT_MAT4:return new lte(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Jee(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]}Jee.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 ete(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]}ete.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];H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function tte(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]}tte.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];if(c(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);else if(c(s.x))d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0);else throw new E("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function nte(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]}nte.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];if(c(s.red))G.equalsArray(s,n,o)||(G.pack(s,n,o),i=!0);else if(c(s.x))se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0);else throw new E("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function _j(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}_j.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)}};_j.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 ite(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]}ite.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 ote(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]}ote.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];H.equalsArray(s,n,o)||(H.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function rte(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]}rte.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+=3}i&&this._gl.uniform3iv(this._location,n)};function ste(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]}ste.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 ate(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]}ate.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];Ri.equalsArray(s,n,o)||(Ri.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function cte(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]}cte.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];J.equalsArray(s,n,o)||(J.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function lte(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]}lte.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];B.equalsArray(s,n,o)||(B.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var vv=IDe;var ODe=0;function Dp(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=RDe(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=ODe++}Dp.fromCache=function(e){return e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)};Dp.replaceCache=function(e){return e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Dp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return lV(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return lV(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return lV(this),this._uniformsByName}}});function ute(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(c(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 RDe(e,t){let n={};if(!ut.highpFloatSupported||!ut.highpIntSupported){let i,o,r,s,a=ute(e),l=ute(t),u=a.length,f=l.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===l[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 fm="[Cesium WebGL] ";function MDe(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(c(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let l;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(l=e.getShaderInfoLog(o),c(l)&&l.length>0&&console.log(`${fm}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(r),c(l)&&l.length>0&&console.log(`${fm}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(s),c(l)&&l.length>0&&console.log(`${fm}Shader program link log: ${l}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(l=e.getProgramInfoLog(s),console.error(`${fm}Shader program link log: ${l}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${fm}Vertex shader compile log: ${l}`),console.error(`${fm} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${l}`):(l=e.getShaderInfoLog(r),console.error(`${fm}Fragment shader compile log: ${l}`),console.error(`${fm} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(u);function h(p,g){if(!c(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${fm}${g} shader translation failed.`);return}console.error(`${fm}Translated ${g} shaderSource: -${m}`)}}function LDe(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 NDe(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),l="[0]",u=a.name.indexOf(l,a.name.length-l.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=wv(e,a,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!c(f))continue;h=f._locations,h.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&h.push(g);f=vv(e,a,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function FDe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];c(a)&&(r.name=a,s=a);let l=Ap[s];c(l)?n.push({uniform:r,automaticUniform:l}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function BDe(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 lV(e){c(e._program)||fte(e)}function fte(e){let t=e._program,n=e._gl,i=MDe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=NDe(n,i),s=FDe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=LDe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=BDe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,l,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=l.replace(g," != ");try{fte(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}Dp.prototype._bind=function(){lV(this),this._gl.useProgram(this._program)};Dp.prototype._setUniforms=function(e,t,n){let i,o;if(c(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let l=a[o];if(!c(e[l.name]))throw new E(`Unknown uniform: ${l.name}`);l.value=e[l.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,l=this._program;if(a.validateProgram(l),!a.getProgramParameter(l,a.VALIDATE_STATUS))throw new E(`Program validation failed. Program info log: ${a.getProgramInfoLog(l)}`)}};Dp.prototype.isDestroyed=function(){return!1};Dp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Dp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),de(this)};var Jt=Dp;function uV(e){this._context=e}var Dv,kDe=new Qe({primitiveType:Me.TRIANGLES}),UDe=new ei({color:new G(0,0,0,0)});function VDe(e,t){return new Ur({context:e,colorTextures:[t],destroyAttachments:!1})}function zDe(e,t){return Jt.fromCache({context:e,vertexShaderSource:mb,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function HDe(e,t){return(!c(Dv)||Dv.viewport.width!==e||Dv.viewport.height!==t)&&(Dv=Ve.fromCache({viewport:new Ke(0,0,e,t)})),Dv}uV.prototype.execute=function(e){if(T.defined("computeCommand",e),c(e.preExecute)&&e.preExecute(e),!c(e.fragmentShaderSource)&&!c(e.shaderProgram))throw new E("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");T.defined("computeCommand.outputTexture",e.outputTexture);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=c(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=c(e.shaderProgram)?e.shaderProgram:zDe(o,e.fragmentShaderSource),a=VDe(o,t),l=HDe(n,i),u=e.uniformMap,f=UDe;f.framebuffer=a,f.renderState=l,f.execute(o);let h=kDe;h.vertexArray=r,h.renderState=l,h.shaderProgram=s,h.uniformMap=u,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),c(e.vertexArray)&&r.destroy()),c(e.postExecute)&&e.postExecute(t)};uV.prototype.isDestroyed=function(){return!1};uV.prototype.destroy=function(){return de(this)};var Pv=uV;var wn={BYTE:ne.BYTE,UNSIGNED_BYTE:ne.UNSIGNED_BYTE,SHORT:ne.SHORT,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,INT:ne.INT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,DOUBLE:ne.DOUBLE};wn.getSizeInBytes=function(e){if(!c(e))throw new E("value is required.");switch(e){case wn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case wn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case wn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case wn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case wn.INT:return Int32Array.BYTES_PER_ELEMENT;case wn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case wn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case wn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new E("componentDatatype is not a valid value.")}};wn.fromTypedArray=function(e){if(e instanceof Int8Array)return wn.BYTE;if(e instanceof Uint8Array)return wn.UNSIGNED_BYTE;if(e instanceof Int16Array)return wn.SHORT;if(e instanceof Uint16Array)return wn.UNSIGNED_SHORT;if(e instanceof Int32Array)return wn.INT;if(e instanceof Uint32Array)return wn.UNSIGNED_INT;if(e instanceof Float32Array)return wn.FLOAT;if(e instanceof Float64Array)return wn.DOUBLE;throw new E("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};wn.validate=function(e){return c(e)&&(e===wn.BYTE||e===wn.UNSIGNED_BYTE||e===wn.SHORT||e===wn.UNSIGNED_SHORT||e===wn.INT||e===wn.UNSIGNED_INT||e===wn.FLOAT||e===wn.DOUBLE)};wn.createTypedArray=function(e,t){if(!c(e))throw new E("componentDatatype is required.");if(!c(t))throw new E("valuesOrLength is required.");switch(e){case wn.BYTE:return new Int8Array(t);case wn.UNSIGNED_BYTE:return new Uint8Array(t);case wn.SHORT:return new Int16Array(t);case wn.UNSIGNED_SHORT:return new Uint16Array(t);case wn.INT:return new Int32Array(t);case wn.UNSIGNED_INT:return new Uint32Array(t);case wn.FLOAT:return new Float32Array(t);case wn.DOUBLE:return new Float64Array(t);default:throw new E("componentDatatype is not a valid value.")}};wn.createArrayBufferView=function(e,t,n,i){if(!c(e))throw new E("componentDatatype is required.");if(!c(t))throw new E("buffer is required.");switch(n=n??0,i=i??(t.byteLength-n)/wn.getSizeInBytes(e),e){case wn.BYTE:return new Int8Array(t,n,i);case wn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case wn.SHORT:return new Int16Array(t,n,i);case wn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case wn.INT:return new Int32Array(t,n,i);case wn.UNSIGNED_INT:return new Uint32Array(t,n,i);case wn.FLOAT:return new Float32Array(t,n,i);case wn.DOUBLE:return new Float64Array(t,n,i);default:throw new E("componentDatatype is not a valid value.")}};wn.fromName=function(e){switch(e){case"BYTE":return wn.BYTE;case"UNSIGNED_BYTE":return wn.UNSIGNED_BYTE;case"SHORT":return wn.SHORT;case"UNSIGNED_SHORT":return wn.UNSIGNED_SHORT;case"INT":return wn.INT;case"UNSIGNED_INT":return wn.UNSIGNED_INT;case"FLOAT":return wn.FLOAT;case"DOUBLE":return wn.DOUBLE;default:throw new E("name is not a valid value.")}};var $=Object.freeze(wn);var GDe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},xf=Object.freeze(GDe);function gj(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Me.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??xf.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}gj.computeNumberOfVertices=function(e){T.typeOf.object("geometry",e);let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&c(e.attributes[n])&&c(e.attributes[n].values)){let i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new E("All attribute lists must have the same number of attributes.");t=o}return t};var jDe=new he,WDe=new d,dte=new B,qDe=[new he,new he,new he],YDe=[new H,new H,new H],XDe=[new H,new H,new H],KDe=new d,$De=new Le,ZDe=new B,QDe=new Ri;gj._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,jDe),s=he.toCartesian(r,n,WDe),a=Ot.eastNorthUpToFixedFrame(s,n,dte),l=B.inverse(a,dte),u=YDe,f=qDe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=KDe;for(o=0;o<3;o++)he.toCartesian(f[o],n,h),h=B.multiplyByPointAsVector(l,h,h),u[o].x=h.x,u[o].y=h.y;let p=Le.fromAxisAngle(d.UNIT_Z,-t,$De),g=J.fromQuaternion(p,ZDe),m=e.length,y=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=B.multiplyByPointAsVector(l,e[o],h),h=J.multiplyByVector(g,h,h),y=Math.min(y,h.x),b=Math.min(b,h.y),x=Math.max(x,h.x),A=Math.max(A,h.y);let C=Ri.fromRotation(t,QDe),S=XDe;S[0].x=y,S[0].y=b,S[1].x=y,S[1].y=A,S[2].x=x,S[2].y=b;let v=u[0],P=u[2].x-v.x,M=u[1].y-v.y;for(o=0;o<3;o++){let w=S[o];Ri.multiplyByVector(C,w,w),w.x=(w.x-v.x)/P,w.y=(w.y-v.y)/M}let R=S[0],L=S[1],F=S[2],_=new Array(6);return H.pack(R,_),H.pack(L,_,2),H.pack(F,_,4),_};var ct=gj;function JDe(e){if(e=e??W.EMPTY_OBJECT,!c(e.componentDatatype))throw new E("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new E("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new E("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.values))throw new E("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var ve=JDe;function cC(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(cC.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}}});cC.clone=function(e){if(c(e))return new cC(e._format,e._datatype,e._width,e._height,e._buffer)};cC.prototype.clone=function(){return cC.clone(this)};var Iv=cC;var hte=Zo(du(),1);function mte(){if(!c(fa._canTransferArrayBuffer)){let e=xj("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return fa._canTransferArrayBuffer=!1,fa._canTransferArrayBuffer}fa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=c(r)&&r[0]===t;i(s),e.terminate(),fa._canTransferArrayBuffer=s}})}return fa._canTransferArrayBuffer}var bj=new pe;function yj(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 xj(e){let t=new hte.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Ug(e))s=e;else if(!n){let a=tn(`${fa._workerModulePrefix}/${i}.js`);Ug(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=yj(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${yj(CESIUM_WORKERS)}"); +`;var ts={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},pY=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Oe.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Jc(this,ts.CULL)}set cull(t){Jc(this,ts.CULL)!==t&&(Oy(this,ts.CULL,t),this.dirty=!0)}get occlude(){return Jc(this,ts.OCCLUDE)}set occlude(t){Jc(this,ts.OCCLUDE)!==t&&(Oy(this,ts.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Jc(this,ts.CAST_SHADOWS)}set castShadows(t){Jc(this,ts.CAST_SHADOWS)!==t&&(Oy(this,ts.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Jc(this,ts.RECEIVE_SHADOWS)}set receiveShadows(t){Jc(this,ts.RECEIVE_SHADOWS)!==t&&(Oy(this,ts.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Jc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Jc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Oy(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Jc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Jc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Oy(this,ts.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Jc(this,ts.PICK_ONLY)}set pickOnly(t){Jc(this,ts.PICK_ONLY)!==t&&(Oy(this,ts.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Jc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Jc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Oy(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Jc(e,t){return(e._flags&t)===t}function Oy(e,t,n){n?e._flags|=t:e._flags&=~t}var at=pY;var Oi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Oi.toWebGLConstant=function(e,t){switch(e){case Oi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Oi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Oi.UNSIGNED_INT:return te.UNSIGNED_INT;case Oi.FLOAT:return te.FLOAT;case Oi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Oi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Oi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Oi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Oi.UNSIGNED_SHORT_5_6_5:return Oi.UNSIGNED_SHORT_5_6_5}};Oi.isPacked=function(e){return e===Oi.UNSIGNED_INT_24_8||e===Oi.UNSIGNED_SHORT_4_4_4_4||e===Oi.UNSIGNED_SHORT_5_5_5_1||e===Oi.UNSIGNED_SHORT_5_6_5};Oi.sizeInBytes=function(e){switch(e){case Oi.UNSIGNED_BYTE:return 1;case Oi.UNSIGNED_SHORT:case Oi.UNSIGNED_SHORT_4_4_4_4:case Oi.UNSIGNED_SHORT_5_5_5_1:case Oi.UNSIGNED_SHORT_5_6_5:case Oi.HALF_FLOAT:return 2;case Oi.UNSIGNED_INT:case Oi.FLOAT:case Oi.UNSIGNED_INT_24_8:return 4}};Oi.validate=function(e){return e===Oi.UNSIGNED_BYTE||e===Oi.UNSIGNED_SHORT||e===Oi.UNSIGNED_INT||e===Oi.FLOAT||e===Oi.HALF_FLOAT||e===Oi.UNSIGNED_INT_24_8||e===Oi.UNSIGNED_SHORT_4_4_4_4||e===Oi.UNSIGNED_SHORT_5_5_5_1||e===Oi.UNSIGNED_SHORT_5_6_5};Oi.getTypedArrayConstructor=function(e){let t=Oi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Oi.FLOAT?Float32Array:Uint32Array};Object.freeze(Oi);var ze=Oi;var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,RED_INTEGER:te.RED_INTEGER,RG_INTEGER:te.RG_INTEGER,RGB_INTEGER:te.RGB_INTEGER,RGBA_INTEGER:te.RGBA_INTEGER,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:case ot.RGB_INTEGER:return 3;case ot.RGBA:case ot.RGBA_INTEGER:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:case ot.RG_INTEGER:return 2;case ot.ALPHA:case ot.RED:case ot.RED_INTEGER:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.RED_INTEGER||e===ot.RG_INTEGER||e===ot.RGB_INTEGER||e===ot.RGBA_INTEGER||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let r=ot.componentsLength(e);return ze.isPacked(t)&&(r=1),r*ze.sizeInBytes(t)*n*i};ot.texture3DSizeInBytes=function(e,t,n,i,r){let o=ot.componentsLength(e);return ze.isPacked(t)&&(o=1),o*ze.sizeInBytes(t)*n*i*r};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let r=ze.getTypedArrayConstructor(t),o=ot.componentsLength(e)*n*i;return new r(o)};ot.flipY=function(e,t,n,i,r){if(r===1)return e;let o=ot.createTypedArray(t,n,i,r),s=ot.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===ze.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===ze.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===ze.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===ze.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}if(t===ze.UNSIGNED_BYTE)switch(e){case ot.RGBA:return te.RGBA8;case ot.RGB:return te.RGB8;case ot.RG:return te.RG8;case ot.RED:return te.R8}if(t===ze.INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32I;case ot.RGB_INTEGER:return te.RGB32I;case ot.RG_INTEGER:return te.RG32I;case ot.RED_INTEGER:return te.R32I}if(t===ze.UNSIGNED_INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32UI;case ot.RGB_INTEGER:return te.RGB32UI;case ot.RG_INTEGER:return te.RG32UI;case ot.RED_INTEGER:return te.R32UI}return e};Object.freeze(ot);var Ke=ot;var Vo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize: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(Vo,{maximumCombinedTextureImageUnits:{get:function(){return Vo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Vo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Vo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Vo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Vo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Vo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Vo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Vo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Vo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Vo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Vo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Vo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Vo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Vo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Vo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Vo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Vo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Vo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Vo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Vo._maximumColorAttachments}},maximumSamples:{get:function(){return Vo._maximumSamples}},highpFloatSupported:{get:function(){return Vo._highpFloatSupported}},highpIntSupported:{get:function(){return Vo._highpIntSupported}}});var kt=Vo;function gY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function qj(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Vh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.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=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;gY(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;qj(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;gY(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;qj(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;qj(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;gY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;qj(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Vh.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)}}});Vh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Vh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Vh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Vh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Vh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Vh.prototype.getColorTexture=function(e){return this._colorTextures[e]};Vh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Vh.prototype.isDestroyed=function(){return!1};Vh.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),ue(this)};var _s=Vh;var _D={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};_D.validate=function(e){return e===_D.CLOCKWISE||e===_D.COUNTER_CLOCKWISE};Object.freeze(_D);var Qs=_D;function ffe(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]=ffe(e[t]));return Object.freeze(e)}var _Y=ffe;function Rp(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,s=t.depthRange??H.EMPTY_OBJECT,a=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??Qs.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??te.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:et.clone(o)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??te.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??te.FUNC_ADD,equationAlpha:u.equationAlpha??te.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??te.ONE,functionSourceAlpha:u.functionSourceAlpha??te.ONE,functionDestinationRgb:u.functionDestinationRgb??te.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??te.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??te.ALWAYS,backFunction:d.backFunction??te.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??te.KEEP,zFail:p.zFail??te.KEEP,zPass:p.zPass??te.KEEP},backOperation:{fail:g.fail??te.KEEP,zFail:g.zFail??te.KEEP,zPass:g.zPass??te.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new et(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var Jze=0,Dp={};Rp.fromCache=function(e){let t=JSON.stringify(e),n=Dp[t];if(l(n))return++n.referenceCount,n.state;let i=new Rp(e),r=JSON.stringify(i);return n=Dp[r],l(n)||(i.id=Jze++,n={referenceCount:0,state:i},Dp[r]=n),++n.referenceCount,Dp[t]={referenceCount:1,state:n.state},n.state};Rp.removeFromCache=function(e){let t=new Rp(e),n=JSON.stringify(t),i=Dp[n],r=JSON.stringify(e),o=Dp[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Dp[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Dp[n]};Rp.getCache=function(){return Dp};Rp.clearCache=function(){Dp={}};function lx(e,t,n){n?e.enable(t):e.disable(t)}function dfe(e,t){e.frontFace(t.frontFace)}function hfe(e,t){let n=t.cull,i=n.enabled;lx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function mfe(e,t){e.lineWidth(t.lineWidth)}function pfe(e,t){let n=t.polygonOffset,i=n.enabled;lx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function gfe(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(lx(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function _fe(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function yfe(e,t){let n=t.depthTest,i=n.enabled;lx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Afe(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function bfe(e,t){e.depthMask(t.depthMask)}function xfe(e,t){e.stencilMask(t.stencilMask)}function Zze(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Tfe(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;lx(e,e.BLEND,r),r&&(Zze(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Efe(e,t){let n=t.stencilTest,i=n.enabled;if(lx(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function Cfe(e,t){let n=t.sampleCoverage,i=n.enabled;lx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Qze=new et;function vfe(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=Qze,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)}Rp.apply=function(e,t,n){dfe(e,t),hfe(e,t),mfe(e,t),pfe(e,t),_fe(e,t),yfe(e,t),Afe(e,t),bfe(e,t),xfe(e,t),Efe(e,t),Cfe(e,t),gfe(e,t,n),Tfe(e,t,n),vfe(e,t,n)};function eVe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(dfe),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(hfe),e.lineWidth!==t.lineWidth&&n.push(mfe),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(pfe),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(_fe),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(yfe),(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(Afe),e.depthMask!==t.depthMask&&n.push(bfe),e.stencilMask!==t.stencilMask&&n.push(xfe),(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(Efe),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Cfe),n}Rp.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=eVe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&gfe(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&Tfe(e,n,r),(t!==n||i!==r||i.context!==r.context)&&vfe(e,n,r)};Rp.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:et.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:z.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)?et.clone(e.viewport):void 0}};var Ge=Rp;var tVe=Object.freeze([NaN,NaN,NaN,NaN]),Du=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,tVe,new.target);return o[0]=t??0,o[1]=i??0,o[2]=n??0,o[3]=r??0,o}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],s=t[r+1];return i.x=o,i.y=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,nVe),o=n.x/r.x,s=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,iVe),o=n/r.x,s=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static getScale(t,n){return n.x=U.magnitude(U.fromElements(t[0],t[1],Sfe)),n.y=U.magnitude(U.fromElements(t[2],t[3],Sfe)),n}static getMaximumScale(t){return e.getScale(t,wfe),U.maximumComponent(wfe)}static setRotation(t,n,i){let r=e.getScale(t,rVe);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,oVe);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}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],s=t[1]*n[0]+t[3]*n[1],a=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=s,i[2]=o,i[3]=a,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],s=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`}};Du.packedLength=4;Du.fromArray=Du.unpack;Du.IDENTITY=new Du(1,0,0,1);Du.ZERO=new Du(0,0,0,0);Du.COLUMN0ROW0=0;Du.COLUMN0ROW1=1;Du.COLUMN1ROW0=2;Du.COLUMN1ROW1=3;var nVe=new U,iVe=new U,Sfe=new U,wfe=new U,rVe=new U,oVe=new U,Xi=Du;function sVe(e,t,n,i){switch(t.type){case e.FLOAT:return new yY(e,t,n,i);case e.FLOAT_VEC2:return new AY(e,t,n,i);case e.FLOAT_VEC3:return new bY(e,t,n,i);case e.FLOAT_VEC4:return new xY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new Yj(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new Yj(e,t,n,i);case e.INT:case e.BOOL:return new TY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new EY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new CY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new vY(e,t,n,i);case e.FLOAT_MAT2:return new SY(e,t,n,i);case e.FLOAT_MAT3:return new wY(e,t,n,i);case e.FLOAT_MAT4:return new IY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var yY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},AY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},bY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},xY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},Yj=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},TY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},EY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},CY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},vY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=r}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},aVe=new Float32Array(4),SY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new Xi,this._gl=t,this._location=r}set(){if(!Xi.equalsArray(this.value,this._value,0)){Xi.clone(this.value,this._value);let t=Xi.toArray(this.value,aVe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},cVe=new Float32Array(9),wY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,cVe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},lVe=new Float32Array(16),IY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new N,this._gl=t,this._location=r}set(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);let t=N.toArray(this.value,lVe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},yD=sVe;function uVe(e,t,n,i){switch(t.type){case e.FLOAT:return new PY(e,t,n,i);case e.FLOAT_VEC2:return new DY(e,t,n,i);case e.FLOAT_VEC3:return new RY(e,t,n,i);case e.FLOAT_VEC4:return new OY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new MY(e,t,n,i);case e.INT:case e.BOOL:return new NY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new LY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new FY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new BY(e,t,n,i);case e.FLOAT_MAT2:return new kY(e,t,n,i);case e.FLOAT_MAT3:return new UY(e,t,n,i);case e.FLOAT_MAT4:return new zY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var PY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},DY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},RY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?(a.red!==i[o]||a.green!==i[o+1]||a.blue!==i[o+2])&&(i[o]=a.red,i[o+1]=a.green,i[o+2]=a.blue,r=!0):l(a.x)&&(h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},OY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?z.equalsArray(a,i,o)||(z.pack(a,i,o),r=!0):l(a.x)&&(se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},MY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let s=i[o];t.activeTexture(n+o),t.bindTexture(s._target,s._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},NY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},LY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},FY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},BY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},kY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];Xi.equalsArray(a,i,o)||(Xi.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},UY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$.equalsArray(a,i,o)||($.pack(a,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},zY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];N.equalsArray(a,i,o)||(N.pack(a,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},AD=uVe;var fVe=0;function ag(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=dVe(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=fVe++}ag.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};ag.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(ag.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return Xj(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return Xj(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return Xj(this),this._uniformsByName}}});function Ife(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function dVe(e,t){let n={};if(!kt.highpFloatSupported||!kt.highpIntSupported){let i,r,o,s,a=Ife(e),c=Ife(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Op="[Cesium WebGL] ";function hVe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);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(r),l(c)&&c.length>0&&console.log(`${Op}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Op}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Op}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Op}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Op}Vertex shader compile log: ${c}`),console.error(`${Op} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Op}Fragment shader compile log: ${c}`),console.error(`${Op} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new oe(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Op}${g} shader translation failed.`);return}console.error(`${Op}Translated ${g} shaderSource: +${m}`)}}function mVe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function pVe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=yD(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=AD(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function gVe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=tg[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function _Ve(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function Xj(e){l(e._program)||Pfe(e)}function Pfe(e){let t=e._program,n=e._gl,i=hVe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=pVe(n,i),s=gVe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=mVe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=_Ve(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{Pfe(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}ag.prototype._bind=function(){Xj(this),this._gl.useProgram(this._program)};ag.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};ag.prototype.isDestroyed=function(){return!1};ag.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};ag.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=ag;function Kj(e){this._context=e}var bD,yVe=new at({primitiveType:Oe.TRIANGLES}),AVe=new li({color:new z(0,0,0,0)});function bVe(e,t){return new _s({context:e,colorTextures:[t],destroyAttachments:!1})}function xVe(e,t){return Qt.fromCache({context:e,vertexShaderSource:cx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function TVe(e,t){return(!l(bD)||bD.viewport.width!==e||bD.viewport.height!==t)&&(bD=Ge.fromCache({viewport:new et(0,0,e,t)})),bD}Kj.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:xVe(r,e.fragmentShaderSource),a=bVe(r,t),c=TVe(n,i),u=e.uniformMap,f=AVe;f.framebuffer=a,f.renderState=c,f.execute(r);let d=yVe;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};Kj.prototype.isDestroyed=function(){return!1};Kj.prototype.destroy=function(){return ue(this)};var xD=Kj;var An={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};An.getSizeInBytes=function(e){switch(e){case An.BYTE:return Int8Array.BYTES_PER_ELEMENT;case An.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case An.SHORT:return Int16Array.BYTES_PER_ELEMENT;case An.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case An.INT:return Int32Array.BYTES_PER_ELEMENT;case An.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case An.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case An.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};An.fromTypedArray=function(e){if(e instanceof Int8Array)return An.BYTE;if(e instanceof Uint8Array)return An.UNSIGNED_BYTE;if(e instanceof Int16Array)return An.SHORT;if(e instanceof Uint16Array)return An.UNSIGNED_SHORT;if(e instanceof Int32Array)return An.INT;if(e instanceof Uint32Array)return An.UNSIGNED_INT;if(e instanceof Float32Array)return An.FLOAT;if(e instanceof Float64Array)return An.DOUBLE};An.validate=function(e){return l(e)&&(e===An.BYTE||e===An.UNSIGNED_BYTE||e===An.SHORT||e===An.UNSIGNED_SHORT||e===An.INT||e===An.UNSIGNED_INT||e===An.FLOAT||e===An.DOUBLE)};An.createTypedArray=function(e,t){switch(e){case An.BYTE:return new Int8Array(t);case An.UNSIGNED_BYTE:return new Uint8Array(t);case An.SHORT:return new Int16Array(t);case An.UNSIGNED_SHORT:return new Uint16Array(t);case An.INT:return new Int32Array(t);case An.UNSIGNED_INT:return new Uint32Array(t);case An.FLOAT:return new Float32Array(t);case An.DOUBLE:return new Float64Array(t)}};An.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/An.getSizeInBytes(e),e){case An.BYTE:return new Int8Array(t,n,i);case An.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case An.SHORT:return new Int16Array(t,n,i);case An.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case An.INT:return new Int32Array(t,n,i);case An.UNSIGNED_INT:return new Uint32Array(t,n,i);case An.FLOAT:return new Float32Array(t,n,i);case An.DOUBLE:return new Float64Array(t,n,i)}};An.fromName=function(e){switch(e){case"BYTE":return An.BYTE;case"UNSIGNED_BYTE":return An.UNSIGNED_BYTE;case"SHORT":return An.SHORT;case"UNSIGNED_SHORT":return An.UNSIGNED_SHORT;case"INT":return An.INT;case"UNSIGNED_INT":return An.UNSIGNED_INT;case"FLOAT":return An.FLOAT;case"DOUBLE":return An.DOUBLE}};An.dequantize=function(e,t){switch(t){case An.BYTE:return Math.max(e/127,-1);case An.UNSIGNED_BYTE:return e/255;case An.SHORT:return Math.max(e/32767,-1);case An.UNSIGNED_SHORT:return e/65535;case An.INT:return Math.max(e/2147483647,-1);case An.UNSIGNED_INT:return e/4294967295}};Object.freeze(An);var Y=An;var Dfe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Dfe);var Sd=Dfe;function VY(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Oe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??Sd.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}VY.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 EVe=new he,CVe=new h,Rfe=new N,vVe=[new he,new he,new he],SVe=[new U,new U,new U],wVe=[new U,new U,new U],IVe=new h,PVe=new Le,DVe=new N,RVe=new Xi;VY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,EVe),s=he.toCartesian(o,n,CVe),a=At.eastNorthUpToFixedFrame(s,n,Rfe),c=N.inverse(a,Rfe),u=SVe,f=vVe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=IVe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=N.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,PVe),g=$.fromQuaternion(p,DVe),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=N.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=Xi.fromRotation(t,RVe),E=wVe;E[0].x=y,E[0].y=A,E[1].x=y,E[1].y=x,E[2].x=b,E[2].y=A;let v=u[0],S=u[2].x-v.x,I=u[1].y-v.y;for(r=0;r<3;r++){let C=E[r];Xi.multiplyByVector(T,C,C),C.x=(C.x-v.x)/S,C.y=(C.y-v.y)/I}let R=E[0],O=E[1],L=E[2],_=new Array(6);return U.pack(R,_),U.pack(O,_,2),U.pack(L,_,4),_};var St=VY;function OVe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ne=OVe;function mv(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(mv.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}}});mv.clone=function(e){if(l(e))return new mv(e._format,e._datatype,e._width,e._height,e._buffer)};mv.prototype.clone=function(){return mv.clone(this)};var TD=mv;var Ofe=Qo(Tf(),1);function Mfe(){if(!l(rc._canTransferArrayBuffer)){let e=GY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return rc._canTransferArrayBuffer=!1,rc._canTransferArrayBuffer}rc._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),rc._canTransferArrayBuffer=s}})}return rc._canTransferArrayBuffer}var HY=new be;function jY(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function GY(e){let t=new Ofe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(Iy(e))s=e;else if(!n){let a=Zt(`${rc._workerModulePrefix}/${i}.js`);Iy(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=jY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${jY(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return r=yj(a),new Worker(r,o)}if(r=e,n||(r=tn(`${fa._workerModulePrefix+i}.js`)),!Vt.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 ePe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Vt.supportsWebAssembly()){if(!c(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=tn(t.fallbackModulePath),n}n.wasmBinaryFile=tn(t.wasmBinaryFile);let i=await we.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function fa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var tPe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(c(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 E(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),bj.raiseEvent(s),i(s)}else bj.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},nPe=[];async function iPe(e,t,n){let i=await Promise.resolve(mte());c(n)?i||(n.length=0):n=nPe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",tPe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:tn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function oPe(e,t,n){++e._activeTasks;try{let i=await iPe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}fa.prototype.scheduleTask=function(e,t){if(c(this._worker)||(this._worker=xj(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return oPe(this,e,t)};fa.prototype.initWebAssemblyModule=async function(e){if(c(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=xj(this._workerPath),i=await ePe(this,e),o=await Promise.resolve(mte()),r,s=i.wasmBinary;c(s)&&o&&(r=[s]);let a=new Promise((l,u)=>{n.onmessage=function({data:f}){c(f)?l(f.result):u(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return c(this._worker)&&this._worker.terminate(),de(this)};fa.taskCompletedEvent=bj;fa._defaultWorkerModulePrefix="Workers/";fa._workerModulePrefix=fa._defaultWorkerModulePrefix;fa._canTransferArrayBuffer=void 0;var yi=fa;function Pp(){}Pp._transcodeTaskProcessor=new yi("transcodeKTX2",Number.POSITIVE_INFINITY);Pp._readyPromise=void 0;function rPe(){let e=Pp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Pp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});Pp._readyPromise=e}Pp.transcode=function(e,t){return T.defined("supportedTargetFormats",t),c(Pp._readyPromise)||rPe(),Pp._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 l=s[o[a]];s[o[a]]=new Iv(l.internalFormat,l.datatype,l.width,l.height,l.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 Ov=Pp;var pte;_te.setKTX2SupportedFormats=function(e,t,n,i,o,r){pte={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function _te(e){T.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=we.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return Ov.transcode(n,pte)})}var Il=_te;function sPe(e,t){this.start=e??0,this.stop=t??0}var Ma=sPe;function hn(e,t){this.center=d.clone(e??d.ZERO),this.radius=t??0}var Cj=new d,Ej=new d,Sj=new d,wj=new d,vj=new d,Dj=new d,Pj=new d,da=new d,Ij=new d,Oj=new d,Rj=new d,Mj=new d,aPe=4/3*O.PI;hn.fromPoints=function(e,t){if(c(t)||(t=new hn),!c(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],Pj),i=d.clone(n,Cj),o=d.clone(n,Ej),r=d.clone(n,Sj),s=d.clone(n,wj),a=d.clone(n,vj),l=d.clone(n,Dj),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let R=n.x,L=n.y,F=n.z;R<i.x&&d.clone(n,i),R>s.x&&d.clone(n,s),L<o.y&&d.clone(n,o),L>a.y&&d.clone(n,a),F<r.z&&d.clone(n,r),F>l.z&&d.clone(n,l)}let h=d.magnitudeSquared(d.subtract(s,i,da)),p=d.magnitudeSquared(d.subtract(a,o,da)),g=d.magnitudeSquared(d.subtract(l,r,da)),m=i,y=s,b=h;p>b&&(b=p,m=o,y=a),g>b&&(b=g,m=r,y=l);let x=Ij;x.x=(m.x+y.x)*.5,x.y=(m.y+y.y)*.5,x.z=(m.z+y.z)*.5;let A=d.magnitudeSquared(d.subtract(y,x,da)),C=Math.sqrt(A),S=Oj;S.x=i.x,S.y=o.y,S.z=r.z;let v=Rj;v.x=s.x,v.y=a.y,v.z=l.z;let P=d.midpoint(S,v,Mj),M=0;for(f=0;f<u;f++){d.clone(e[f],n);let R=d.magnitude(d.subtract(n,P,da));R>M&&(M=R);let L=d.magnitudeSquared(d.subtract(n,x,da));if(L>A){let F=Math.sqrt(L);C=(C+F)*.5,A=C*C;let _=F-C;x.x=(C*x.x+_*n.x)/F,x.y=(C*x.y+_*n.y)/F,x.z=(C*x.z+_*n.z)/F}}return C<M?(d.clone(x,t.center),t.radius=C):(d.clone(P,t.center),t.radius=M),t};var gte=new Oi,cPe=new d,lPe=new d,Tj=new he,Aj=new he;hn.fromRectangle2D=function(e,t,n){return hn.fromRectangleWithHeights2D(e,t,0,0,n)};hn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(c(o)||(o=new hn),!c(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;gte._ellipsoid=ie.default,t=t??gte,ce.southwest(e,Tj),Tj.height=n,ce.northeast(e,Aj),Aj.height=i;let r=t.project(Tj,cPe),s=t.project(Aj,lPe),a=s.x-r.x,l=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+l*l+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+l*.5,f.z=r.z+u*.5,o};var uPe=[];hn.fromRectangle3D=function(e,t,n,i){if(t=t??ie.default,n=n??0,c(i)||(i=new hn),!c(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,uPe);return hn.fromPoints(o,i)};hn.fromVertices=function(e,t,n,i){if(c(i)||(i=new hn),!c(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=t??d.ZERO,n=n??3,T.typeOf.number.greaterThanOrEquals("stride",n,3);let o=Pj;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,Cj),s=d.clone(o,Ej),a=d.clone(o,Sj),l=d.clone(o,wj),u=d.clone(o,vj),f=d.clone(o,Dj),h=e.length,p;for(p=0;p<h;p+=n){let F=e[p]+t.x,_=e[p+1]+t.y,w=e[p+2]+t.z;o.x=F,o.y=_,o.z=w,F<r.x&&d.clone(o,r),F>l.x&&d.clone(o,l),_<s.y&&d.clone(o,s),_>u.y&&d.clone(o,u),w<a.z&&d.clone(o,a),w>f.z&&d.clone(o,f)}let g=d.magnitudeSquared(d.subtract(l,r,da)),m=d.magnitudeSquared(d.subtract(u,s,da)),y=d.magnitudeSquared(d.subtract(f,a,da)),b=r,x=l,A=g;m>A&&(A=m,b=s,x=u),y>A&&(A=y,b=a,x=f);let C=Ij;C.x=(b.x+x.x)*.5,C.y=(b.y+x.y)*.5,C.z=(b.z+x.z)*.5;let S=d.magnitudeSquared(d.subtract(x,C,da)),v=Math.sqrt(S),P=Oj;P.x=r.x,P.y=s.y,P.z=a.z;let M=Rj;M.x=l.x,M.y=u.y,M.z=f.z;let R=d.midpoint(P,M,Mj),L=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 F=d.magnitude(d.subtract(o,R,da));F>L&&(L=F);let _=d.magnitudeSquared(d.subtract(o,C,da));if(_>S){let w=Math.sqrt(_);v=(v+w)*.5,S=v*v;let D=w-v;C.x=(v*C.x+D*o.x)/w,C.y=(v*C.y+D*o.y)/w,C.z=(v*C.z+D*o.z)/w}}return v<L?(d.clone(C,i.center),i.radius=v):(d.clone(R,i.center),i.radius=L),i};hn.fromEncodedCartesianVertices=function(e,t,n){if(c(n)||(n=new hn),!c(e)||!c(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=Pj;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,Cj),r=d.clone(i,Ej),s=d.clone(i,Sj),a=d.clone(i,wj),l=d.clone(i,vj),u=d.clone(i,Dj),f=e.length,h;for(h=0;h<f;h+=3){let L=e[h]+t[h],F=e[h+1]+t[h+1],_=e[h+2]+t[h+2];i.x=L,i.y=F,i.z=_,L<o.x&&d.clone(i,o),L>a.x&&d.clone(i,a),F<r.y&&d.clone(i,r),F>l.y&&d.clone(i,l),_<s.z&&d.clone(i,s),_>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(a,o,da)),g=d.magnitudeSquared(d.subtract(l,r,da)),m=d.magnitudeSquared(d.subtract(u,s,da)),y=o,b=a,x=p;g>x&&(x=g,y=r,b=l),m>x&&(x=m,y=s,b=u);let A=Ij;A.x=(y.x+b.x)*.5,A.y=(y.y+b.y)*.5,A.z=(y.z+b.z)*.5;let C=d.magnitudeSquared(d.subtract(b,A,da)),S=Math.sqrt(C),v=Oj;v.x=o.x,v.y=r.y,v.z=s.z;let P=Rj;P.x=a.x,P.y=l.y,P.z=u.z;let M=d.midpoint(v,P,Mj),R=0;for(h=0;h<f;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 L=d.magnitude(d.subtract(i,M,da));L>R&&(R=L);let F=d.magnitudeSquared(d.subtract(i,A,da));if(F>C){let _=Math.sqrt(F);S=(S+_)*.5,C=S*S;let w=_-S;A.x=(S*A.x+w*i.x)/_,A.y=(S*A.y+w*i.y)/_,A.z=(S*A.z+w*i.z)/_}}return S<R?(d.clone(A,n.center),n.radius=S):(d.clone(M,n.center),n.radius=R),n};hn.fromCornerPoints=function(e,t,n){T.typeOf.object("corner",e),T.typeOf.object("oppositeCorner",t),c(n)||(n=new hn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};hn.fromEllipsoid=function(e,t){return T.typeOf.object("ellipsoid",e),c(t)||(t=new hn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var fPe=new d;hn.fromBoundingSpheres=function(e,t){if(c(t)||(t=new hn),!c(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return hn.clone(e[0],t);if(n===2)return hn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=hn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,d.distance(r,a.center,fPe)+a.radius)}return t.radius=s,t};var dPe=new d,hPe=new d,mPe=new d;hn.fromOrientedBoundingBox=function(e,t){T.defined("orientedBoundingBox",e),c(t)||(t=new hn);let n=e.halfAxes,i=J.getColumn(n,0,dPe),o=J.getColumn(n,1,hPe),r=J.getColumn(n,2,mPe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var pPe=new d,_Pe=new d;hn.fromTransformation=function(e,t){T.typeOf.object("transformation",e),c(t)||(t=new hn);let n=B.getTranslation(e,pPe),i=B.getScale(e,_Pe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};hn.clone=function(e,t){if(c(e))return c(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new hn(e.center,e.radius)};hn.packedLength=4;hn.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};hn.unpack=function(e,t,n){T.defined("array",e),t=t??0,c(n)||(n=new hn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var gPe=new d,yPe=new d;hn.union=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),c(n)||(n=new hn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=d.subtract(r,i,gPe),l=d.magnitude(a);if(o>=l+s)return e.clone(n),n;if(s>=l+o)return t.clone(n),n;let u=(o+l+s)*.5,f=d.multiplyByScalar(a,(-o+u)/l,yPe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var bPe=new d;hn.expand=function(e,t,n){T.typeOf.object("sphere",e),T.typeOf.object("point",t),n=hn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,bPe));return i>n.radius&&(n.radius=i),n};hn.intersectPlane=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("plane",t);let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Wt.OUTSIDE:r<i?Wt.INTERSECTING:Wt.INSIDE};hn.transform=function(e,t,n){return T.typeOf.object("sphere",e),T.typeOf.object("transform",t),c(n)||(n=new hn),n.center=B.multiplyByPoint(t,e.center,n.center),n.radius=B.getMaximumScale(t)*e.radius,n};var xPe=new d;hn.distanceSquaredTo=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("cartesian",t);let n=d.subtract(e.center,t,xPe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};hn.transformWithoutScale=function(e,t,n){return T.typeOf.object("sphere",e),T.typeOf.object("transform",t),c(n)||(n=new hn),n.center=B.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var TPe=new d;hn.computePlaneDistances=function(e,t,n,i){T.typeOf.object("sphere",e),T.typeOf.object("position",t),T.typeOf.object("direction",n),c(i)||(i=new Ma);let o=d.subtract(e.center,t,TPe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var yte=new d,APe=new d,CPe=new d,EPe=new d,SPe=new d,wPe=new he,xte=new Array(8);for(let e=0;e<8;++e)xte[e]=new d;var bte=new Oi;hn.projectTo2D=function(e,t,n){T.typeOf.object("sphere",e),bte._ellipsoid=ie.default,t=t??bte;let i=t.ellipsoid,o=e.center,r=e.radius,s;d.equals(o,d.ZERO)?s=d.clone(d.UNIT_X,yte):s=i.geodeticSurfaceNormal(o,yte);let a=d.cross(d.UNIT_Z,s,APe);d.normalize(a,a);let l=d.cross(s,a,CPe);d.normalize(l,l),d.multiplyByScalar(s,r,s),d.multiplyByScalar(l,r,l),d.multiplyByScalar(a,r,a);let u=d.negate(l,SPe),f=d.negate(a,EPe),h=xte,p=h[0];d.add(s,l,p),d.add(p,a,p),p=h[1],d.add(s,l,p),d.add(p,f,p),p=h[2],d.add(s,u,p),d.add(p,f,p),p=h[3],d.add(s,u,p),d.add(p,a,p),d.negate(s,s),p=h[4],d.add(s,l,p),d.add(p,a,p),p=h[5],d.add(s,l,p),d.add(p,f,p),p=h[6],d.add(s,u,p),d.add(p,f,p),p=h[7],d.add(s,u,p),d.add(p,a,p);let g=h.length;for(let x=0;x<g;++x){let A=h[x];d.add(o,A,A);let C=i.cartesianToCartographic(A,wPe);t.project(C,A)}n=hn.fromPoints(h,n),o=n.center;let m=o.x,y=o.y,b=o.z;return o.x=b,o.y=m,o.z=y,n};hn.isOccluded=function(e,t){return T.typeOf.object("sphere",e),T.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};hn.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};hn.prototype.intersectPlane=function(e){return hn.intersectPlane(this,e)};hn.prototype.distanceSquaredTo=function(e){return hn.distanceSquaredTo(this,e)};hn.prototype.computePlaneDistances=function(e,t,n){return hn.computePlaneDistances(this,e,t,n)};hn.prototype.isOccluded=function(e){return hn.isOccluded(this,e)};hn.prototype.equals=function(e){return hn.equals(this,e)};hn.prototype.clone=function(e){return hn.clone(this,e)};hn.prototype.volume=function(){let e=this.radius;return aPe*e*e*e};var le=hn;function vPe(e){e=e??W.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 fn=vPe;var DPe={NONE:0,TOP:1,ALL:2},Zt=Object.freeze(DPe);function ps(e){e=e??W.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ps.POSITION_ONLY=Object.freeze(new ps({position:!0}));ps.POSITION_AND_NORMAL=Object.freeze(new ps({position:!0,normal:!0}));ps.POSITION_NORMAL_AND_ST=Object.freeze(new ps({position:!0,normal:!0,st:!0}));ps.POSITION_AND_ST=Object.freeze(new ps({position:!0,st:!0}));ps.POSITION_AND_COLOR=Object.freeze(new ps({position:!0,color:!0}));ps.ALL=Object.freeze(new ps({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ps.DEFAULT=ps.POSITION_NORMAL_AND_ST;ps.packedLength=6;ps.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=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};ps.unpack=function(e,t,n){if(!c(e))throw new E("array is required");return t=t??0,c(n)||(n=new ps),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};ps.clone=function(e,t){if(c(e))return c(t)||(t=new ps),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 Ie=ps;var PPe=new d;function mu(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let i=e.vertexFormat??Ie.DEFAULT;this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}mu.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new mu({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};mu.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundingBox",e),new mu({minimum:e.minimum,maximum:e.maximum})};mu.packedLength=2*d.packedLength+Ie.packedLength+1;mu.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),Ie.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+Ie.packedLength]=e._offsetAttribute??-1,t};var Ate=new d,Cte=new d,Ete=new Ie,Tte={minimum:Ate,maximum:Cte,vertexFormat:Ete,offsetAttribute:void 0};mu.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Ate),o=d.unpack(e,t+d.packedLength,Cte),r=Ie.unpack(e,t+2*d.packedLength,Ete),s=e[t+2*d.packedLength+Ie.packedLength];return c(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Tte.offsetAttribute=s===-1?void 0:s,new mu(Tte))};mu.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new fn,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 ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}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 ve({componentDatatype:$.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=d.subtract(n,t,PPe),l=d.magnitude(a)*.5;if(c(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===Zt.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new ct({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,l),offsetAttribute:e._offsetAttribute})};var Lj;mu.getUnitBox=function(){return c(Lj)||(Lj=mu.createGeometry(mu.fromDimensions({dimensions:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),Lj};var La=mu;var no={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};no.getMathType=function(e){switch(e){case no.SCALAR:return Number;case no.VEC2:return H;case no.VEC3:return d;case no.VEC4:return se;case no.MAT2:return Ri;case no.MAT3:return J;case no.MAT4:return B;default:throw new E("attributeType is not a valid value.")}};no.getNumberOfComponents=function(e){switch(e){case no.SCALAR:return 1;case no.VEC2:return 2;case no.VEC3:return 3;case no.VEC4:case no.MAT2:return 4;case no.MAT3:return 9;case no.MAT4:return 16;default:throw new E("attributeType is not a valid value.")}};no.getAttributeLocationCount=function(e){switch(e){case no.SCALAR:case no.VEC2:case no.VEC3:case no.VEC4:return 1;case no.MAT2:return 2;case no.MAT3:return 3;case no.MAT4:return 4;default:throw new E("attributeType is not a valid value.")}};no.getGlslType=function(e){switch(T.typeOf.string("attributeType",e),e){case no.SCALAR:return"float";case no.VEC2:return"vec2";case no.VEC3:return"vec3";case no.VEC4:return"vec4";case no.MAT2:return"mat2";case no.MAT3:return"mat3";case no.MAT4:return"mat4";default:throw new E("attributeType is not a valid value.")}};var nn=Object.freeze(no);var Ste=1/256,wte=256,bo={};bo.octEncodeInRange=function(e,t,n){T.defined("vector",e),T.defined("result",n);let i=d.magnitudeSquared(e);if(Math.abs(i-1)>O.EPSILON6)throw new E("vector must be normalized.");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 o=n.x,r=n.y;n.x=(1-Math.abs(r))*O.signNotZero(o),n.y=(1-Math.abs(o))*O.signNotZero(r)}return n.x=O.toSNorm(n.x,t),n.y=O.toSNorm(n.y,t),n};bo.octEncode=function(e,t){return bo.octEncodeInRange(e,255,t)};var Rv=new H,vte=new Uint8Array(1);function fV(e){return vte[0]=e,vte[0]}bo.octEncodeToCartesian4=function(e,t){return bo.octEncodeInRange(e,65535,Rv),t.x=fV(Rv.x*Ste),t.y=fV(Rv.x),t.z=fV(Rv.y*Ste),t.w=fV(Rv.y),t};bo.octDecodeInRange=function(e,t,n,i){if(T.defined("result",i),e<0||e>n||t<0||t>n)throw new E(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=O.fromSNorm(e,n),i.y=O.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))*O.signNotZero(o),i.y=(1-Math.abs(o))*O.signNotZero(i.y)}return d.normalize(i,i)};bo.octDecode=function(e,t,n){return bo.octDecodeInRange(e,t,255,n)};bo.octDecodeFromCartesian4=function(e,t){T.typeOf.object("encoded",e),T.typeOf.object("result",t);let n=e.x,i=e.y,o=e.z,r=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||r<0||r>255)throw new E("x, y, z, and w must be unsigned normalized integers between 0 and 255");let s=n*wte+i,a=o*wte+r;return bo.octDecodeInRange(s,a,65535,t)};bo.octPackFloat=function(e){return T.defined("encoded",e),256*e.x+e.y};var Fj=new H;bo.octEncodeFloat=function(e){return bo.octEncode(e,Fj),bo.octPackFloat(Fj)};bo.octDecodeFloat=function(e,t){T.defined("value",e);let n=e/256,i=Math.floor(n),o=(n-i)*256;return bo.octDecode(i,o,t)};bo.octPack=function(e,t,n,i){T.defined("v1",e),T.defined("v2",t),T.defined("v3",n),T.defined("result",i);let o=bo.octEncodeFloat(e),r=bo.octEncodeFloat(t),s=bo.octEncode(n,Fj);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};bo.octUnpack=function(e,t,n,i){T.defined("packed",e),T.defined("v1",t),T.defined("v2",n),T.defined("v3",i);let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),l=(o-a)*65536;bo.octDecodeFloat(s,t),bo.octDecodeFloat(l,n),bo.octDecode(r,a,i)};bo.compressTextureCoordinates=function(e){T.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};bo.decompressTextureCoordinates=function(e,t){T.defined("compressed",e),T.defined("result",t);let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function Nj(e){return e>>1^-(e&1)}bo.zigZagDeltaDecode=function(e,t,n){T.defined("uBuffer",e),T.defined("vBuffer",t),T.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),c(n)&&T.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=Nj(e[a]),r+=Nj(t[a]),e[a]=o,t[a]=r,c(n)&&(s+=Nj(n[a]),n[a]=s)};bo.dequantize=function(e,t,n,i){T.defined("typedArray",e),T.defined("componentDatatype",t),T.defined("type",n),T.defined("count",i);let o=nn.getNumberOfComponents(n),r;switch(t){case $.BYTE:r=127;break;case $.UNSIGNED_BYTE:r=255;break;case $.SHORT:r=32767;break;case $.UNSIGNED_SHORT:r=65535;break;case $.INT:r=2147483647;break;case $.UNSIGNED_INT:r=4294967295;break;default:throw new E(`Cannot dequantize component datatype: ${t}`)}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let l=0;l<o;l++){let u=a*o+l;s[u]=Math.max(e[u]/r,-1)}return s};bo.decodeRGB565=function(e,t){T.defined("typedArray",e);let n=e.length*3;c(t)&&T.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let i=e.length;c(t)||(t=new Float32Array(i*3));let o=31,r=63,s=1/31,a=1/63;for(let l=0;l<i;l++){let u=e[l],f=u>>11,h=u>>5&r,p=u&o,g=3*l;t[g]=f*s,t[g+1]=h*a,t[g+2]=p*s}return t};var Ln=bo;var Dte=new d,Pte=new d,Ite=new d;function IPe(e,t,n,i,o){T.defined("point",e),T.defined("p0",t),T.defined("p1",n),T.defined("p2",i),c(o)||(o=new d);let r,s,a,l,u,f,h,p;if(c(t.z)){if(d.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,Dte),s=d.subtract(i,t,Pte),a=d.subtract(e,t,Ite),l=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),p=d.dot(s,a)}else{if(H.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(H.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(H.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=H.subtract(n,t,Dte),s=H.subtract(i,t,Pte),a=H.subtract(e,t,Ite),l=H.dot(r,r),u=H.dot(r,s),f=H.dot(r,a),h=H.dot(s,s),p=H.dot(s,a)}o.y=h*f-u*p,o.z=l*p-u*f;let g=l*h-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var _b=IPe;function dm(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}dm.encode=function(e,t){T.typeOf.number("value",e),c(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 Ip={high:0,low:0};dm.fromCartesian=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new dm);let n=t.high,i=t.low;return dm.encode(e.x,Ip),n.x=Ip.high,i.x=Ip.low,dm.encode(e.y,Ip),n.y=Ip.high,i.y=Ip.low,dm.encode(e.z,Ip),n.z=Ip.high,i.z=Ip.low,t};var Bj=new dm;dm.writeElements=function(e,t,n){T.defined("cartesianArray",t),T.typeOf.number("index",n),T.typeOf.number.greaterThanOrEquals("index",n,0),dm.fromCartesian(e,Bj);let i=Bj.high,o=Bj.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 Hn=dm;var kj={};kj.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");return t*t-4*e*n};function Ote(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}kj.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let l=Math.abs(n),u=Math.abs(e);if(l<u&&l/u<O.EPSILON14)return[0,0];if(l>u&&u/l<O.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Ote(o,-r,O.EPSILON14);if(s<0)return[];let a=-.5*Ote(t,O.sign(t)*Math.sqrt(s),O.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Vc=kj;var Vj={};Vj.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");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 Uj(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,l=o*s,u=r*a,f=r*r,h=s*s,p=o*s-f,g=o*a-r*s,m=r*a-h,y=4*p*m-g*g,b,x;if(y<0){let q,Y,te;f*u>=l*h?(q=o,Y=p,te=-2*r*p+o*g):(q=a,Y=m,te=-a*g+2*s*m);let Z=-(te<0?-1:1)*Math.abs(q)*Math.sqrt(-y);x=-te+Z;let ee=x/2,me=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),Te=x===Z?-me:-Y/me;return b=Y<=0?me+Te:-te/(me*me+Te*Te+Y),f*u>=l*h?[(b-r)/o]:[-a/(b+s)]}let A=p,C=-2*r*p+o*g,S=m,v=-a*g+2*s*m,P=Math.sqrt(y),M=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*P,-C)/3);b=2*Math.sqrt(-A);let L=Math.cos(R);x=b*L;let F=b*(-L/2-M*Math.sin(R)),_=x+F>2*r?x-r:F-r,w=o,D=_/w;R=Math.abs(Math.atan2(a*P,-v)/3),b=2*Math.sqrt(-S),L=Math.cos(R),x=b*L,F=b*(-L/2-M*Math.sin(R));let I=-a,N=x+F<2*s?x+s:F+s,k=I/N,z=w*N,V=-_*N-w*I,j=_*I,U=(s*V-r*j)/(-r*V+s*z);return D<=U?D<=k?U<=k?[D,U,k]:[D,k,U]:[k,D,U]:D<=k?[U,D,k]:U<=k?[U,k,D]:[k,U,D]}Vj.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");let o,r;if(e===0)return Vc.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=Vc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Uj(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Uj(e,t,0,i);if(i===0)return o=Vc.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 Uj(e,t,n,i)};var gb=Vj;var zj={};zj.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");if(typeof o!="number")throw new E("e is a required number.");let r=e*e,s=r*e,a=t*t,l=a*t,u=n*n,f=u*n,h=i*i,p=h*i,g=o*o,m=g*o;return a*u*h-4*l*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*s*m+o*(18*l*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function Md(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,l=gb.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(l.length>0){let u=-e/4,f=l[l.length-1];if(Math.abs(f)<O.EPSILON14){let h=Vc.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],g=h[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-y,u+y,u+b]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-s/h)/2,g=(r+f+s/h)/2,m=Vc.computeRealRoots(1,h,p),y=Vc.computeRealRoots(1,-h,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function Mv(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,l=n*e+r-4*i,u=s*i-n*t*e+o,f=gb.computeRealRoots(1,a,l,u);if(f.length>0){let h=f[0],p=t-h,g=p*p,m=e/2,y=p/2,b=g-4*i,x=g+4*Math.abs(i),A=s-4*h,C=s+4*Math.abs(h),S,v;if(h<0||b*C<A*x){let w=Math.sqrt(A);S=w/2,v=w===0?0:(e*y-n)/w}else{let w=Math.sqrt(b);S=w===0?0:(e*y-n)/w,v=w/2}let P,M;m===0&&S===0?(P=0,M=0):O.sign(m)===O.sign(S)?(P=m+S,M=h/P):(M=m-S,P=h/M);let R,L;y===0&&v===0?(R=0,L=0):O.sign(y)===O.sign(v)?(R=y+v,L=i/R):(L=y-v,R=i/L);let F=Vc.computeRealRoots(1,P,R),_=Vc.computeRealRoots(1,M,L);if(F.length!==0)return _.length!==0?F[1]<=_[0]?[F[0],F[1],_[0],_[1]]:_[1]<=F[0]?[_[0],_[1],F[0],F[1]]:F[0]>=_[0]&&F[1]<=_[1]?[_[0],F[0],F[1],_[1]]:_[0]>=F[0]&&_[1]<=F[1]?[F[0],_[0],_[1],F[1]]:F[0]>_[0]&&F[0]<_[1]?[_[0],F[0],_[1],F[1]]:[F[0],_[0],F[1],_[1]]:F;if(_.length!==0)return _}return[]}zj.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new E("a is a required number.");if(typeof t!="number")throw new E("b is a required number.");if(typeof n!="number")throw new E("c is a required number.");if(typeof i!="number")throw new E("d is a required number.");if(typeof o!="number")throw new E("e is a required number.");if(Math.abs(e)<O.EPSILON15)return gb.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,l=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=l<0?u+1:u,u){case 0:return Md(r,s,a,l);case 1:return Mv(r,s,a,l);case 2:return Mv(r,s,a,l);case 3:return Md(r,s,a,l);case 4:return Md(r,s,a,l);case 5:return Mv(r,s,a,l);case 6:return Md(r,s,a,l);case 7:return Md(r,s,a,l);case 8:return Mv(r,s,a,l);case 9:return Md(r,s,a,l);case 10:return Md(r,s,a,l);case 11:return Mv(r,s,a,l);case 12:return Md(r,s,a,l);case 13:return Md(r,s,a,l);case 14:return Md(r,s,a,l);case 15:return Md(r,s,a,l);default:return}};var Lv=zj;function dV(e,t){t=d.clone(t??d.ZERO),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(e??d.ZERO),this.direction=t}dV.clone=function(e,t){if(c(e))return c(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new dV(e.origin,e.direction)};dV.getPoint=function(e,t,n){return T.typeOf.object("ray",e),T.typeOf.number("t",t),c(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var mn=dV;var Ho={};Ho.rayPlane=function(e,t,n){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("plane is required.");c(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,s=d.dot(r,o);if(Math.abs(s)<O.EPSILON15)return;let a=(-t.distance-d.dot(r,i))/s;if(!(a<0))return n=d.multiplyByScalar(o,a,n),d.add(i,n,n)};var OPe=new d,RPe=new d,Ute=new d,Rte=new d,Mte=new d;Ho.rayTriangleParametric=function(e,t,n,i,o){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("p0 is required.");if(!c(n))throw new E("p1 is required.");if(!c(i))throw new E("p2 is required.");o=o??!1;let r=e.origin,s=e.direction,a=d.subtract(n,t,OPe),l=d.subtract(i,t,RPe),u=d.cross(s,l,Ute),f=d.dot(a,u),h,p,g,m,y;if(o){if(f<O.EPSILON6||(h=d.subtract(r,t,Rte),g=d.dot(h,u),g<0||g>f)||(p=d.cross(h,a,Mte),m=d.dot(s,p),m<0||g+m>f))return;y=d.dot(l,p)/f}else{if(Math.abs(f)<O.EPSILON6)return;let b=1/f;if(h=d.subtract(r,t,Rte),g=d.dot(h,u)*b,g<0||g>1||(p=d.cross(h,a,Mte),m=d.dot(s,p)*b,m<0||g+m>1))return;y=d.dot(l,p)*b}return y};Ho.rayTriangle=function(e,t,n,i,o,r){let s=Ho.rayTriangleParametric(e,t,n,i,o);if(!(!c(s)||s<0))return c(r)||(r=new d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var MPe=new mn;Ho.lineSegmentTriangle=function(e,t,n,i,o,r,s){if(!c(e))throw new E("v0 is required.");if(!c(t))throw new E("v1 is required.");if(!c(n))throw new E("p0 is required.");if(!c(i))throw new E("p1 is required.");if(!c(o))throw new E("p2 is required.");let a=MPe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let l=Ho.rayTriangleParametric(a,n,i,o,r);if(!(!c(l)||l<0||l>d.distance(e,t)))return c(s)||(s=new d),d.multiplyByScalar(a.direction,l,s),d.add(a.origin,s,s)};function LPe(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),l=(-t+a)*s,u=(-t-a)*s;return l<u?(i.root0=l,i.root1=u):(i.root0=u,i.root1=l),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var NPe={root0:0,root1:0};function Vte(e,t,n){c(n)||(n=new Ma);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=d.subtract(i,r,Ute),l=d.dot(o,o),u=2*d.dot(o,a),f=d.magnitudeSquared(a)-s,h=LPe(l,u,f,NPe);if(c(h))return n.start=h.root0,n.stop=h.root1,n}Ho.raySphere=function(e,t,n){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("sphere is required.");if(n=Vte(e,t,n),!(!c(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var FPe=new mn;Ho.lineSegmentSphere=function(e,t,n,i){if(!c(e))throw new E("p0 is required.");if(!c(t))throw new E("p1 is required.");if(!c(n))throw new E("sphere is required.");let o=FPe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),s=d.magnitude(r);if(d.normalize(r,r),i=Vte(o,n,i),!(!c(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var BPe=new d,kPe=new d;Ho.rayEllipsoid=function(e,t){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("ellipsoid is required.");let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,BPe),o=d.multiplyComponents(n,e.direction,kPe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,l,u,f,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,l=d.magnitudeSquared(o),u=l*a,p<u)return;if(p>u){f=s*s-u,h=-s+Math.sqrt(f);let m=h/l,y=a/h;return m<y?new Ma(m,y):{start:y,stop:m}}let g=Math.sqrt(a/l);return new Ma(g,g)}else if(r<1)return a=r-1,l=d.magnitudeSquared(o),u=l*a,f=s*s-u,h=-s+Math.sqrt(f),new Ma(0,h/l);if(s<0)return l=d.magnitudeSquared(o),new Ma(0,-s/l)};function yb(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Ho.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[J.COLUMN1ROW1]-e[J.COLUMN2ROW2])*s,l=o*(i*yb(e[J.COLUMN1ROW0],e[J.COLUMN0ROW1],O.EPSILON15)+t.y),u=e[J.COLUMN0ROW0]*r+e[J.COLUMN2ROW2]*s+i*t.x+n,f=s*yb(e[J.COLUMN2ROW1],e[J.COLUMN1ROW2],O.EPSILON15),h=o*(i*yb(e[J.COLUMN2ROW0],e[J.COLUMN0ROW2])+t.z),p,g=[];if(h===0&&f===0){if(p=Vc.computeRealRoots(a,l,u),p.length===0)return g;let R=p[0],L=Math.sqrt(Math.max(1-R*R,0));if(g.push(new d(i,o*R,o*-L)),g.push(new d(i,o*R,o*L)),p.length===2){let F=p[1],_=Math.sqrt(Math.max(1-F*F,0));g.push(new d(i,o*F,o*-_)),g.push(new d(i,o*F,o*_))}return g}let m=h*h,y=f*f,b=a*a,x=h*f,A=b+y,C=2*(l*a+x),S=2*u*a+l*l-y+m,v=2*(u*l-x),P=u*u-m;if(A===0&&C===0&&S===0&&v===0)return g;p=Lv.computeRealRoots(A,C,S,v,P);let M=p.length;if(M===0)return g;for(let R=0;R<M;++R){let L=p[R],F=L*L,_=Math.max(1-F,0),w=Math.sqrt(_),D;O.sign(a)===O.sign(u)?D=yb(a*F+u,l*L,O.EPSILON12):O.sign(u)===O.sign(l*L)?D=yb(a*F,l*L+u,O.EPSILON12):D=yb(a*F+l*L,u,O.EPSILON12);let I=yb(f*L,h,O.EPSILON15),N=D*I;N<0?g.push(new d(i,o*L,o*w)):N>0?g.push(new d(i,o*L,o*-w)):w!==0?(g.push(new d(i,o*L,o*-w)),g.push(new d(i,o*L,o*w)),++R):g.push(new d(i,o*L,o*w))}return g};var Hj=new d,Lte=new d,Nte=new d,hV=new d,UPe=new d,VPe=new J,zPe=new J,HPe=new J,GPe=new J,jPe=new J,Fte=new J,Bte=new J,kte=new d,WPe=new d,qPe=new he;Ho.grazingAltitudeLocation=function(e,t){if(!c(e))throw new E("ray is required.");if(!c(t))throw new E("ellipsoid is required.");let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let P=t.geodeticSurfaceNormal(n,Hj);if(d.dot(i,P)>=0)return n}let o=c(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Hj),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,hV),l=d.normalize(d.cross(a,s,Lte),Lte),u=d.normalize(d.cross(s,l,Nte),Nte),f=VPe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=l.x,f[4]=l.y,f[5]=l.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=J.transpose(f,zPe),p=J.fromScale(t.radii,HPe),g=J.fromScale(t.oneOverRadii,GPe),m=jPe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=J.multiply(J.multiply(h,g,Fte),m,Fte),b=J.multiply(J.multiply(y,p,Bte),f,Bte),x=J.multiplyByVector(y,n,UPe),A=Ho.quadraticVectorExpression(b,d.negate(x,Hj),0,0,1),C,S,v=A.length;if(v>0){let P=d.clone(d.ZERO,WPe),M=Number.NEGATIVE_INFINITY;for(let L=0;L<v;++L){C=J.multiplyByVector(p,J.multiplyByVector(f,A[L],kte),kte);let F=d.normalize(d.subtract(C,n,hV),hV),_=d.dot(F,i);_>M&&(M=_,P=d.clone(C,P))}let R=t.cartesianToCartographic(P,qPe);return M=O.clamp(M,0,1),S=d.magnitude(d.subtract(P,n,hV))*Math.sqrt(1-M*M),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new d)}};var YPe=new d;Ho.lineSegmentPlane=function(e,t,n,i){if(!c(e))throw new E("endPoint0 is required.");if(!c(t))throw new E("endPoint1 is required.");if(!c(n))throw new E("plane is required.");c(i)||(i=new d);let o=d.subtract(t,e,YPe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)<O.EPSILON6)return;let a=d.dot(r,e),l=-(n.distance+a)/s;if(!(l<0||l>1))return d.multiplyByScalar(o,l,i),d.add(e,i,i),i};Ho.trianglePlaneIntersection=function(e,t,n,i){if(!c(e)||!c(t)||!c(n)||!c(i))throw new E("p0, p1, p2, and plane are required.");let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,l=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=l?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return Ho.lineSegmentPlane(e,t,i,f),Ho.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Ho.lineSegmentPlane(t,n,i,f),Ho.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Ho.lineSegmentPlane(n,e,i,f),Ho.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!l)return Ho.lineSegmentPlane(e,n,i,f),Ho.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Ho.lineSegmentPlane(n,t,i,f),Ho.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Ho.lineSegmentPlane(t,e,i,f),Ho.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var Zn=Ho;function zs(e,t){if(T.typeOf.object("normal",e),!O.equalsEpsilon(d.magnitude(e),1,O.EPSILON6))throw new E("normal must be normalized.");T.typeOf.number("distance",t),this.normal=d.clone(e),this.distance=t}zs.fromPointNormal=function(e,t,n){if(T.typeOf.object("point",e),T.typeOf.object("normal",t),!O.equalsEpsilon(d.magnitude(t),1,O.EPSILON6))throw new E("normal must be normalized.");let i=-d.dot(t,e);return c(n)?(d.clone(t,n.normal),n.distance=i,n):new zs(t,i)};var XPe=new d;zs.fromCartesian4=function(e,t){T.typeOf.object("coefficients",e);let n=d.fromCartesian4(e,XPe),i=e.w;if(!O.equalsEpsilon(d.magnitude(n),1,O.EPSILON6))throw new E("normal must be normalized.");return c(t)?(d.clone(n,t.normal),t.distance=i,t):new zs(n,i)};zs.getPointDistance=function(e,t){return T.typeOf.object("plane",e),T.typeOf.object("point",t),d.dot(e.normal,t)+e.distance};var KPe=new d;zs.projectPointOntoPlane=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("point",t),c(n)||(n=new d);let i=zs.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,KPe);return d.subtract(t,o,n)};var $Pe=new B,ZPe=new se,QPe=new d;zs.transform=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("transform",t);let i=e.normal,o=e.distance,r=B.inverseTranspose(t,$Pe),s=se.fromElements(i.x,i.y,i.z,o,ZPe);s=B.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,QPe);return s=se.divideByScalar(s,d.magnitude(a),s),zs.fromCartesian4(s,n)};zs.clone=function(e,t){return T.typeOf.object("plane",e),c(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new zs(e.normal,e.distance)};zs.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.distance===t.distance&&d.equals(e.normal,t.normal)};zs.ORIGIN_XY_PLANE=Object.freeze(new zs(d.UNIT_Z,0));zs.ORIGIN_YZ_PLANE=Object.freeze(new zs(d.UNIT_X,0));zs.ORIGIN_ZX_PLANE=Object.freeze(new zs(d.UNIT_Y,0));var sn=zs;var Gj={};Gj.calculateACMR=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24;if(!c(t))throw new E("indices is required.");let o=t.length;if(o<3||o%3!==0)throw new E("indices length must be a multiple of three.");if(n<=0)throw new E("maximumIndex must be greater than zero.");if(i<3)throw new E("cacheSize must be greater than two.");if(!c(n)){n=0;let a=0,l=t[a];for(;a<o;)l>n&&(n=l),++a,l=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)};Gj.tipsify=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(_,w,D,I){for(;w.length>=1;){let N=w[w.length-1];if(w.splice(w.length-1,1),_[N].numLiveTriangles>0)return N}for(;o<I;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(_,w,D,I,N,k,z){let V=-1,j,U=-1,q=0;for(;q<D.length;){let Y=D[q];I[Y].numLiveTriangles&&(j=0,N-I[Y].timeStamp+2*I[Y].numLiveTriangles<=w&&(j=N-I[Y].timeStamp),(j>U||U===-1)&&(U=j,V=Y)),++q}return V===-1?r(I,k,_,z):V}if(!c(t))throw new E("indices is required.");let a=t.length;if(a<3||a%3!==0)throw new E("indices length must be a multiple of three.");if(n<=0)throw new E("maximumIndex must be greater than zero.");if(i<3)throw new E("cacheSize must be greater than two.");let l=0,u=0,f=t[u],h=a;if(c(n))l=n+1;else{for(;u<h;)f>l&&(l=f),++u,f=t[u];if(l===-1)return 0;++l}let p=[],g;for(g=0;g<l;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,b=i+1;o=1;let x=[],A=[],C,S,v=0,P=[],M=a/3,R=[];for(g=0;g<M;g++)R[g]=!1;let L,F;for(;y!==-1;){x=[],S=p[y],F=S.vertexTriangles.length;for(let _=0;_<F;++_)if(m=S.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let w=0;w<3;++w)L=t[u],x.push(L),A.push(L),P[v]=L,++v,C=p[L],--C.numLiveTriangles,b-C.timeStamp>i&&(C.timeStamp=b,++b),++u}y=s(t,i,x,p,b,A,l)}return P};var Nv=Gj;var zc={};function xV(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function JPe(e){let t=e.length,n=t/3*6,i=Fe.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)xV(i,o,e[r],e[r+1],e[r+2]);return i}function eIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Fe.createTypedArray(t,n);xV(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)xV(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function tIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)xV(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}zc.toWireframe=function(e){if(!c(e))throw new E("geometry is required.");let t=e.indices;if(c(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=JPe(t);break;case Me.TRIANGLE_STRIP:e.indices=eIe(t);break;case Me.TRIANGLE_FAN:e.indices=tIe(t);break;default:throw new E("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=Me.LINES}return e};zc.createLineSegmentsForVectors=function(e,t,n){if(t=t??"normal",!c(e))throw new E("geometry is required.");if(!c(e.attributes.position))throw new E("geometry.attributes.position is required.");if(!c(e.attributes[t]))throw new E(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=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 f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let l,u=e.boundingSphere;return c(u)&&(l=new le(u.center,u.radius+n)),new ct({attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:l})};zc.createAttributeLocations=function(e){if(!c(e))throw new E("geometry is required.");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];c(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!c(i[a])&&(i[a]=o++);return i};zc.reorderForPreVertexCache=function(e){if(!c(e))throw new E("geometry is required.");let t=ct.computeNumberOfVertices(e),n=e.indices;if(c(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Fe.createTypedArray(t,r),a=0,l=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[l]=f:(f=o[a],i[f]=u,s[l]=u,++u),++a,++l;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&c(h[p])&&c(h[p].values)){let g=h[p],m=g.values,y=0,b=g.componentsPerAttribute,x=$.createTypedArray(g.componentDatatype,u*b);for(;y<t;){let A=i[y];if(A!==-1)for(let C=0;C<b;C++)x[b*A+C]=m[b*y+C];++y}g.values=x}}return e};zc.reorderForPostVertexCache=function(e,t){if(!c(e))throw new E("geometry is required.");let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&c(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=Nv.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function zte(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function nIe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(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])}}zc.fitToUnsignedShortIndices=function(e){if(!c(e))throw new E("geometry is required.");if(c(e.indices)&&e.primitiveType!==Me.TRIANGLES&&e.primitiveType!==Me.LINES&&e.primitiveType!==Me.POINTS)throw new E("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let t=[],n=ct.computeNumberOfVertices(e);if(c(e.indices)&&n>=O.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=zte(e.attributes),a=e.indices,l=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<l;f+=u){for(let h=0;h<u;++h){let p=a[f+h],g=i[p];c(g)||(g=r++,i[p]=g,nIe(s,e.attributes,p)),o.push(g)}r+u>=O.SIXTY_FOUR_KILOBYTES&&(t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=zte(e.attributes))}o.length!==0&&t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Hte=new d,iIe=new he;zc.projectTo2D=function(e,t,n,i,o){if(!c(e))throw new E("geometry is required.");if(!c(t))throw new E("attributeName is required.");if(!c(n))throw new E("attributeName3D is required.");if(!c(i))throw new E("attributeName2D is required.");if(!c(e.attributes[t]))throw new E(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new E("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t];o=c(o)?o:new Oi;let s=o.ellipsoid,a=r.values,l=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let h=d.fromArray(a,f,Hte),p=s.cartesianToCartographic(h,iIe);if(!c(p))throw new E(`Could not project point (${h.x}, ${h.y}, ${h.z}) to 2D.`);let g=o.project(p,Hte);l[u++]=g.x,l[u++]=g.y,l[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};var jj={high:0,low:0};zc.encodeAttribute=function(e,t,n,i){if(!c(e))throw new E("geometry is required.");if(!c(t))throw new E("attributeName is required.");if(!c(n))throw new E("attributeHighName is required.");if(!c(i))throw new E("attributeLowName is required.");if(!c(e.attributes[t]))throw new E(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new E("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),l=new Float32Array(s);for(let f=0;f<s;++f)Hn.encode(r[f],jj),a[f]=jj.high,l[f]=jj.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};var Nd=new d;function Wj(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,Nd),B.multiplyByPoint(e,Nd,Nd),d.pack(Nd,n,o)}}function qj(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,Nd),J.multiplyByVector(e,Nd,Nd),Nd=d.normalize(Nd,Nd),d.pack(Nd,n,o)}}var mV=new B,pV=new J;zc.transformToWorldCoordinates=function(e){if(!c(e))throw new E("instance is required.");let t=e.modelMatrix;if(B.equals(t,B.IDENTITY))return e;let n=e.geometry.attributes;Wj(t,n.position),Wj(t,n.prevPosition),Wj(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(B.inverse(t,mV),B.transpose(mV,mV),B.getMatrix3(mV,pV),qj(pV,n.normal),qj(pV,n.tangent),qj(pV,n.bitangent));let i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=B.clone(B.IDENTITY),e};function oIe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&c(o[r])&&c(o[r].values)){let s=o[r],a=s.values.length,l=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!c(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){l=!1;break}a+=f.values.length}l&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:$.createTypedArray(s.componentDatatype,a)}))}return i}var rIe=new d;function Yj(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,l=c(e[0][t].indices),u=e[0][t].primitiveType;for(o=1;o<n;++o){if(!B.equals(e[o].modelMatrix,a))throw new E("All instances must have the same modelMatrix.");if(c(e[o][t].indices)!==l)throw new E("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==u)throw new E("All instance geometries must have the same primitiveType.")}let f=oIe(e,t),h,p,g;for(i in f)if(f.hasOwnProperty(i))for(h=f[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 m;if(l){let A=0;for(o=0;o<n;++o)A+=e[o][t].indices.length;let C=ct.computeNumberOfVertices(new ct({attributes:f,primitiveType:Me.POINTS})),S=Fe.createTypedArray(C,A),v=0,P=0;for(o=0;o<n;++o){let M=e[o][t].indices,R=M.length;for(s=0;s<R;++s)S[v++]=P+M[s];P+=ct.computeNumberOfVertices(e[o][t])}m=S}let y=new d,b=0,x;for(o=0;o<n;++o){if(x=e[o][t].boundingSphere,!c(x)){y=void 0;break}d.add(x.center,y,y)}if(c(y))for(d.divideByScalar(y,n,y),o=0;o<n;++o){x=e[o][t].boundingSphere;let A=d.magnitude(d.subtract(x.center,y,rIe))+x.radius;A>b&&(b=A)}return new ct({attributes:f,indices:m,primitiveType:u,boundingSphere:c(y)?new le(y,b):void 0})}zc.combineInstances=function(e){if(!c(e)||e.length<1)throw new E("instances is required and must have length greater than zero.");let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];c(s.geometry)?t.push(s):c(s.westHemisphereGeometry)&&c(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(Yj(t,"geometry")),n.length>0&&(o.push(Yj(n,"westHemisphereGeometry")),o.push(Yj(n,"eastHemisphereGeometry"))),o};var Tf=new d,Fv=new d,lC=new d,uC=new d;zc.computeNormal=function(e){if(!c(e))throw new E("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new E("geometry.attributes.position.values is required.");if(!c(e.indices))throw new E("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new E("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new E("geometry.primitiveType must be PrimitiveType.TRIANGLES.");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),l=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],y=t[u+1],b=t[u+2],x=m*3,A=y*3,C=b*3;Fv.x=i[x],Fv.y=i[x+1],Fv.z=i[x+2],lC.x=i[A],lC.y=i[A+1],lC.z=i[A+2],uC.x=i[C],uC.y=i[C+1],uC.z=i[C+2],s[m].count++,s[y].count++,s[b].count++,d.subtract(lC,Fv,lC),d.subtract(uC,Fv,uC),a[f]=d.cross(lC,uC,new d),f++}let h=0;for(u=0;u<o;u++)s[u].indexOffset+=h,h+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;l[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,l[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,l[m]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],d.clone(d.ZERO,Tf),p.count>0){for(f=0;f<p.count;f++)d.add(Tf,a[l[p.indexOffset+f]],Tf);d.equalsEpsilon(d.ZERO,Tf,O.EPSILON10)&&d.clone(a[l[p.indexOffset]],Tf)}d.equalsEpsilon(d.ZERO,Tf,O.EPSILON10)&&(Tf.z=1),d.normalize(Tf,Tf),g[m]=Tf.x,g[m+1]=Tf.y,g[m+2]=Tf.z}return e.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g}),e};var sIe=new d,Gte=new d,aIe=new d;zc.computeTangentAndBitangent=function(e){if(!c(e))throw new E("geometry is required.");let t=e.attributes,n=e.indices;if(!c(t.position)||!c(t.position.values))throw new E("geometry.attributes.position.values is required.");if(!c(t.normal)||!c(t.normal.values))throw new E("geometry.attributes.normal.values is required.");if(!c(t.st)||!c(t.st.values))throw new E("geometry.attributes.st.values is required.");if(!c(n))throw new E("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new E("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new E("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let 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,l=new Array(s*3),u;for(u=0;u<l.length;u++)l[u]=0;let f,h,p;for(u=0;u<a;u+=3){let y=n[u],b=n[u+1],x=n[u+2];f=y*3,h=b*3,p=x*3;let A=y*2,C=b*2,S=x*2,v=i[f],P=i[f+1],M=i[f+2],R=r[A],L=r[A+1],F=r[C+1]-L,_=r[S+1]-L,w=1/((r[C]-R)*_-(r[S]-R)*F),D=(_*(i[h]-v)-F*(i[p]-v))*w,I=(_*(i[h+1]-P)-F*(i[p+1]-P))*w,N=(_*(i[h+2]-M)-F*(i[p+2]-M))*w;l[f]+=D,l[f+1]+=I,l[f+2]+=N,l[h]+=D,l[h+1]+=I,l[h+2]+=N,l[p]+=D,l[p+1]+=I,l[p+2]+=N}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,h=f+1,p=f+2;let y=d.fromArray(o,f,sIe),b=d.fromArray(l,f,aIe),x=d.dot(y,b);d.multiplyByScalar(y,x,Gte),d.normalize(d.subtract(b,Gte,b),b),g[f]=b.x,g[h]=b.y,g[p]=b.z,d.normalize(d.cross(y,b,b),b),m[f]=b.x,m[h]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m}),e};var Bv=new H,Ld=new d,jte=new d,Wte=new d,_V=new H;zc.compressVertices=function(e){if(!c(e))throw new E("geometry is required.");let t=e.attributes.extrudeDirection,n,i;if(c(t)){let P=t.values;i=P.length/3;let M=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(d.fromArray(P,n*3,Ld),d.equals(Ld,d.ZERO)){R+=2;continue}_V=Ln.octEncodeInRange(Ld,65535,_V),M[R++]=_V.x,M[R++]=_V.y}return e.attributes.compressedAttributes=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:M}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=c(o),a=c(r);if(!s&&!a)return e;let l=e.attributes.tangent,u=e.attributes.bitangent,f=c(l),h=c(u),p,g,m,y;s&&(p=o.values),a&&(g=r.values),f&&(m=l.values),h&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let A=i,C=a&&s?2:1;C+=f||h?1:0,A*=C;let S=new Float32Array(A),v=0;for(n=0;n<i;++n){a&&(H.fromArray(g,n*2,Bv),S[v++]=Ln.compressTextureCoordinates(Bv));let P=n*3;s&&c(m)&&c(y)?(d.fromArray(p,P,Ld),d.fromArray(m,P,jte),d.fromArray(y,P,Wte),Ln.octPack(Ld,jte,Wte,Bv),S[v++]=Bv.x,S[v++]=Bv.y):(s&&(d.fromArray(p,P,Ld),S[v++]=Ln.octEncodeFloat(Ld)),f&&(d.fromArray(m,P,Ld),S[v++]=Ln.octEncodeFloat(Ld)),h&&(d.fromArray(y,P,Ld),S[v++]=Ln.octEncodeFloat(Ld)))}return e.attributes.compressedAttributes=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:C,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function cIe(e){if(c(e.indices))return e;let t=ct.computeNumberOfVertices(e);if(t<3)throw new E("The number of vertices must be at least three.");if(t%3!==0)throw new E("The number of vertices must be a multiple of three.");let n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function lIe(e){let t=ct.computeNumberOfVertices(e);if(t<3)throw new E("The number of vertices must be at least three.");let n=Fe.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=Me.TRIANGLES,e}function uIe(e){let t=ct.computeNumberOfVertices(e);if(t<3)throw new E("The number of vertices must be at least 3.");let n=Fe.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=Me.TRIANGLES,e}function fIe(e){if(c(e.indices))return e;let t=ct.computeNumberOfVertices(e);if(t<2)throw new E("The number of vertices must be at least two.");if(t%2!==0)throw new E("The number of vertices must be a multiple of 2.");let n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function dIe(e){let t=ct.computeNumberOfVertices(e);if(t<2)throw new E("The number of vertices must be at least two.");let n=Fe.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=Me.LINES,e}function hIe(e){let t=ct.computeNumberOfVertices(e);if(t<2)throw new E("The number of vertices must be at least two.");let n=Fe.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=Me.LINES,e}function mIe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return lIe(e);case Me.TRIANGLE_STRIP:return uIe(e);case Me.TRIANGLES:return cIe(e);case Me.LINE_STRIP:return dIe(e);case Me.LINE_LOOP:return hIe(e);case Me.LINES:return fIe(e)}return e}function jg(e,t){Math.abs(e.y)<O.EPSILON6&&(t?e.y=-O.EPSILON6:e.y=O.EPSILON6)}function pIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){jg(e,e.y<0),jg(t,t.y<0),jg(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=O.sign(e.y):s=O.sign(n.y):o>r?s=O.sign(t.y):s=O.sign(n.y);let a=s<0;jg(e,a),jg(t,a),jg(n,a)}var qte=new d;function Af(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,qte),e.y/(e.y-t.y),qte),n),d.clone(n,i),jg(n,!0),jg(i,!1)}var bb=new d,xb=new d,Tb=new d,Ab=new d,Xj={positions:new Array(7),indices:new Array(3*3)};function _Ie(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;pIe(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=Xj.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Af(e,t,bb,Tb),Af(e,n,xb,Ab),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Af(t,n,bb,Tb),Af(t,e,xb,Ab),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Af(n,e,bb,Tb),Af(n,t,xb,Ab),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||(Af(n,e,bb,Tb),Af(n,t,xb,Ab),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Af(t,n,bb,Tb),Af(t,e,xb,Ab),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Af(e,t,bb,Tb),Af(e,n,xb,Ab),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let l=Xj.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(s===1||s===2)&&(l[3]=bb,l[4]=xb,l[5]=Tb,l[6]=Ab,l.length=7),Xj}function Yte(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){let r=n[o];r.values=$.createTypedArray(r.componentDatatype,r.values)}let i=ct.computeNumberOfVertices(e);return e.indices=Fe.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function dC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ct({attributes:n,indices:[],primitiveType:e.primitiveType})}function Qj(e,t,n){let i=c(e.geometry.boundingSphere);t=Yte(t,i),n=Yte(n,i),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function Jj(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,l,u,f,h,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,o);e.multiplyByScalar(g,l.x,g),e.multiplyByScalar(m,l.y,m),e.multiplyByScalar(y,l.z,y);let b=e.add(g,m,g);e.add(b,y,b),p&&e.normalize(b,b),e.pack(b,f,h*t)}}var gIe=Jj(se,4),bV=Jj(d,3),Jte=Jj(H,2),yIe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,l=o[t]*i.y,u=o[n]*i.z;r[s]=a+l+u>O.EPSILON6?1:0},kv=new d,Kj=new d,$j=new d,bIe=new d;function gV(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){if(!c(r)&&!c(s)&&!c(a)&&!c(l)&&!c(u)&&g===0)return;let b=d.fromArray(o,e*3,kv),x=d.fromArray(o,t*3,Kj),A=d.fromArray(o,n*3,$j),C=_b(i,b,x,A,bIe);if(c(C)){if(c(r)&&bV(e,t,n,C,r,h.normal.values,y,!0),c(u)){let S=d.fromArray(u,e*3,kv),v=d.fromArray(u,t*3,Kj),P=d.fromArray(u,n*3,$j);d.multiplyByScalar(S,C.x,S),d.multiplyByScalar(v,C.y,v),d.multiplyByScalar(P,C.z,P);let M;!d.equals(S,d.ZERO)||!d.equals(v,d.ZERO)||!d.equals(P,d.ZERO)?(M=d.add(S,v,S),d.add(M,P,M),d.normalize(M,M)):(M=kv,M.x=0,M.y=0,M.z=0),d.pack(M,h.extrudeDirection.values,y*3)}if(c(f)&&yIe(e,t,n,C,f,h.applyOffset.values,y),c(s)&&bV(e,t,n,C,s,h.tangent.values,y,!0),c(a)&&bV(e,t,n,C,a,h.bitangent.values,y,!0),c(l)&&Jte(e,t,n,C,l,h.st.values,y),g>0)for(let S=0;S<g;S++){let v=p[S];xIe(e,t,n,C,y,m[v],h[v])}}}function xIe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,l=r.values,u=s.values;switch(a){case 4:gIe(e,t,n,i,l,u,o,!1);break;case 3:bV(e,t,n,i,l,u,o,!1);break;case 2:Jte(e,t,n,i,l,u,o,!1);break;default:u[o]=l[e]*i.x+l[t]*i.y+l[n]*i.z}}function hm(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],l=n[a];return l===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(l),l)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var TIe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Xte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.normal)?n.normal.values:void 0,r=c(n.bitangent)?n.bitangent.values:void 0,s=c(n.tangent)?n.tangent.values:void 0,a=c(n.st)?n.st.values:void 0,l=c(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=c(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let M in n)n.hasOwnProperty(M)&&!TIe[M]&&c(n[M])&&h.push(M);let p=h.length,g=dC(t),m=dC(t),y,b,x,A,C,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,C=0;C<S.length;++C)S[C]=-1,v[C]=-1;let P=f.length;for(C=0;C<P;C+=3){let M=f[C],R=f[C+1],L=f[C+2],F=d.fromArray(i,M*3),_=d.fromArray(i,R*3),w=d.fromArray(i,L*3),D=_Ie(F,_,w);if(c(D)&&D.positions.length>3){let I=D.positions,N=D.indices,k=N.length;for(let z=0;z<k;++z){let V=N[z],j=I[V];j.y<0?(y=m.attributes,b=m.indices,x=S):(y=g.attributes,b=g.indices,x=v),A=hm(y,b,x,f,V<3?C+V:-1,j),gV(M,R,L,j,i,o,s,r,a,l,u,y,h,p,n,A)}}else c(D)&&(F=D.positions[0],_=D.positions[1],w=D.positions[2]),F.y<0?(y=m.attributes,b=m.indices,x=S):(y=g.attributes,b=g.indices,x=v),A=hm(y,b,x,f,C,F),gV(M,R,L,F,i,o,s,r,a,l,u,y,h,p,n,A),A=hm(y,b,x,f,C+1,_),gV(M,R,L,_,i,o,s,r,a,l,u,y,h,p,n,A),A=hm(y,b,x,f,C+2,w),gV(M,R,L,w,i,o,s,r,a,l,u,y,h,p,n,A)}Qj(e,m,g)}var ene=sn.fromPointNormal(d.ZERO,d.UNIT_Y),AIe=new d,CIe=new d;function fC(e,t,n,i,o,r,s){if(!c(s))return;let a=d.fromArray(i,e*3,kv);d.equalsEpsilon(a,n,O.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function Kte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=dC(t),a=dC(t),l,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,l=0;l<f.length;++l)f[l]=-1,h[l]=-1;for(l=0;l<u;l+=2){let p=r[l],g=r[l+1],m=d.fromArray(i,p*3,kv),y=d.fromArray(i,g*3,Kj),b;Math.abs(m.y)<O.EPSILON6&&(m.y<0?m.y=-O.EPSILON6:m.y=O.EPSILON6),Math.abs(y.y)<O.EPSILON6&&(y.y<0?y.y=-O.EPSILON6:y.y=O.EPSILON6);let x=s.attributes,A=s.indices,C=h,S=a.attributes,v=a.indices,P=f,M=Zn.lineSegmentPlane(m,y,ene,$j);if(c(M)){let R=d.multiplyByScalar(d.UNIT_Y,5*O.EPSILON9,AIe);m.y<0&&(d.negate(R,R),x=a.attributes,A=a.indices,C=f,S=s.attributes,v=s.indices,P=h);let L=d.add(M,R,CIe);b=hm(x,A,C,r,l,m),fC(p,g,m,i,b,x,o),b=hm(x,A,C,r,-1,L),fC(p,g,L,i,b,x,o),d.negate(R,R),d.add(M,R,L),b=hm(S,v,P,r,-1,L),fC(p,g,L,i,b,S,o),b=hm(S,v,P,r,l+1,y),fC(p,g,y,i,b,S,o)}else{let R,L,F;m.y<0?(R=a.attributes,L=a.indices,F=f):(R=s.attributes,L=s.indices,F=h),b=hm(R,L,F,r,l,m),fC(p,g,m,i,b,R,o),b=hm(R,L,F,r,l+1,y),fC(p,g,y,i,b,R,o)}}Qj(e,a,s)}var $te=new H,EIe=new H,tne=new d,nne=new d,Zj=new d,SIe=new d,wIe=new d,vIe=new d,Zte=new se;function Qte(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=d.unpack(n,s,tne);if(a.x>0)continue;let l=d.unpack(i,s,nne);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):d.pack(a,i,s));let u=d.unpack(o,s,Zj);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):d.pack(a,o,s))}}var DIe=5*O.EPSILON9,yV=O.EPSILON6;function PIe(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=c(n.st)?n.st.values:void 0,l=c(n.color)?n.color.values:void 0,u=dC(t),f=dC(t),h,p,g,m=!1,y=i.length/3;for(h=0;h<y;h+=4){let b=h,x=h+2,A=d.fromArray(i,b*3,tne),C=d.fromArray(i,x*3,nne);if(Math.abs(A.y)<yV)for(A.y=yV*(C.y<0?-1:1),i[h*3+1]=A.y,i[(h+1)*3+1]=A.y,p=b*3;p<b*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(C.y)<yV)for(C.y=yV*(A.y<0?-1:1),i[(h+2)*3+1]=C.y,i[(h+3)*3+1]=C.y,p=b*3;p<b*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 S=u.attributes,v=u.indices,P=f.attributes,M=f.indices,R=Zn.lineSegmentPlane(A,C,ene,SIe);if(c(R)){m=!0;let L=d.multiplyByScalar(d.UNIT_Y,DIe,wIe);A.y<0&&(d.negate(L,L),S=f.attributes,v=f.indices,P=u.attributes,M=u.indices);let F=d.add(R,L,vIe);S.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.position.values.push(F.x,F.y,F.z),S.position.values.push(F.x,F.y,F.z),S.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),S.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.nextPosition.values.push(F.x,F.y,F.z),S.nextPosition.values.push(F.x,F.y,F.z),S.nextPosition.values.push(F.x,F.y,F.z),S.nextPosition.values.push(F.x,F.y,F.z),d.negate(L,L),d.add(R,L,F),P.position.values.push(F.x,F.y,F.z),P.position.values.push(F.x,F.y,F.z),P.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),P.prevPosition.values.push(F.x,F.y,F.z),P.prevPosition.values.push(F.x,F.y,F.z),P.prevPosition.values.push(F.x,F.y,F.z),P.prevPosition.values.push(F.x,F.y,F.z),P.nextPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),P.nextPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),P.nextPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]);let _=H.fromArray(s,b*2,$te),w=Math.abs(_.y);S.expandAndWidth.values.push(-1,w,1,w),S.expandAndWidth.values.push(-1,-w,1,-w),P.expandAndWidth.values.push(-1,w,1,w),P.expandAndWidth.values.push(-1,-w,1,-w);let D=d.magnitudeSquared(d.subtract(R,A,Zj));if(D/=d.magnitudeSquared(d.subtract(C,A,Zj)),c(l)){let I=se.fromArray(l,b*4,Zte),N=se.fromArray(l,x*4,Zte),k=O.lerp(I.x,N.x,D),z=O.lerp(I.y,N.y,D),V=O.lerp(I.z,N.z,D),j=O.lerp(I.w,N.w,D);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(l[p]);for(S.color.values.push(k,z,V,j),S.color.values.push(k,z,V,j),P.color.values.push(k,z,V,j),P.color.values.push(k,z,V,j),p=x*4;p<x*4+2*4;++p)P.color.values.push(l[p])}if(c(a)){let I=H.fromArray(a,b*2,$te),N=H.fromArray(a,(h+3)*2,EIe),k=O.lerp(I.x,N.x,D);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(k,I.y),S.st.values.push(k,N.y),P.st.values.push(k,I.y),P.st.values.push(k,N.y),p=x*2;p<x*2+2*2;++p)P.st.values.push(a[p])}g=S.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=P.position.values.length/3-4,M.push(g,g+2,g+1),M.push(g+1,g+2,g+3)}else{let L,F;for(A.y<0?(L=f.attributes,F=f.indices):(L=u.attributes,F=u.indices),L.position.values.push(A.x,A.y,A.z),L.position.values.push(A.x,A.y,A.z),L.position.values.push(C.x,C.y,C.z),L.position.values.push(C.x,C.y,C.z),p=h*3;p<h*3+4*3;++p)L.prevPosition.values.push(o[p]),L.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)L.expandAndWidth.values.push(s[p]),c(a)&&L.st.values.push(a[p]);if(c(l))for(p=h*4;p<h*4+4*4;++p)L.color.values.push(l[p]);g=L.position.values.length/3-4,F.push(g,g+2,g+1),F.push(g+1,g+2,g+3)}}m&&(Qte(f),Qte(u)),Qj(e,f,u)}zc.splitLongitude=function(e){if(!c(e))throw new E("instance is required.");let t=e.geometry,n=t.boundingSphere;if(c(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING))return e;if(t.geometryType!==xf.NONE)switch(t.geometryType){case xf.POLYLINES:PIe(e);break;case xf.TRIANGLES:Xte(e);break;case xf.LINES:Kte(e);break}else mIe(t),t.primitiveType===Me.TRIANGLES?Xte(e):t.primitiveType===Me.LINES&&Kte(e);return e};var Nn=zc;function Uv(e,t,n,i,o,r,s,a,l,u,f){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=l,this._flipY=u,this._initialized=f}Object.defineProperties(Uv.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Uv.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new E("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new E("yOffset + options.source.height must be less than or equal to height.");let{width:r,height:s}=i,a=this._context._gl,l=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,b=this._flipY,x=4;c(f)&&(x=ke.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,x),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){let C;t===0&&n===0&&r===h&&s===h?(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,h,h)),C=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),C=i),A=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),C=ke.createTypedArray(p,m,h,h)),a.texImage2D(u,0,g,h,h,0,p,Ue.toWebGLConstant(m,this._context),C),this._initialized=!0}A||(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ue.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ue.toWebGLConstant(m,this._context),i))),a.bindTexture(l,null)};Uv.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new E("xOffset + source.width must be less than or equal to width.");if(t+r>this._size)throw new E("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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};Uv.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){if(e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),e+n>this._size)throw new E("xOffset + source.width must be less than or equal to width.");if(t+i>this._size)throw new E("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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 Vv=Uv;var TV={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===TV.DONT_CARE||e===TV.FASTEST||e===TV.NICEST}},Cf=Object.freeze(TV);var AV={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};AV.validate=function(e){return e===AV.NEAREST||e===AV.LINEAR};var li=Object.freeze(AV);var Wg={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};Wg.validate=function(e){return e===Wg.NEAREST||e===Wg.LINEAR||e===Wg.NEAREST_MIPMAP_NEAREST||e===Wg.LINEAR_MIPMAP_NEAREST||e===Wg.NEAREST_MIPMAP_LINEAR||e===Wg.LINEAR_MIPMAP_LINEAR};var Yt=Object.freeze(Wg);var CV={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===CV.CLAMP_TO_EDGE||e===CV.REPEAT||e===CV.MIRRORED_REPEAT}},gn=Object.freeze(CV);function zv(e){e=e??W.EMPTY_OBJECT;let{wrapS:t=gn.CLAMP_TO_EDGE,wrapT:n=gn.CLAMP_TO_EDGE,minificationFilter:i=Yt.LINEAR,magnificationFilter:o=li.LINEAR,maximumAnisotropy:r=1}=e;if(!gn.validate(t))throw new E("Invalid sampler.wrapS.");if(!gn.validate(n))throw new E("Invalid sampler.wrapT.");if(!Yt.validate(i))throw new E("Invalid sampler.minificationFilter.");if(!li.validate(o))throw new E("Invalid sampler.magnificationFilter.");T.typeOf.number.greaterThanOrEquals("maximumAnisotropy",r,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(zv.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}}});zv.equals=function(e,t){return e===t||c(e)&&c(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};zv.NEAREST=Object.freeze(new zv({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST}));var Qt=zv;function IIe(e,t,n,i){let o=c(t.vertexBuffer),r=c(t.value),s=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!r)throw new E("attribute must have a vertexBuffer or a value.");if(o&&r)throw new E("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(s!==1&&s!==2&&s!==3&&s!==4)throw r?new E("attribute.value.length must be in the range [1, 4]."):new E("attribute.componentsPerAttribute must be in the range [1, 4].");if(c(t.componentDatatype)&&!$.validate(t.componentDatatype))throw new E("attribute must have a valid componentDatatype or not specify it.");if(c(t.strideInBytes)&&t.strideInBytes>255)throw new E("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new E("instanced arrays is not supported");if(c(t.instanceDivisor)&&t.instanceDivisor<0)throw new E("attribute must have an instanceDivisor greater than or equal to zero");if(c(t.instanceDivisor)&&r)throw new E("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new E("attribute zero cannot have an instanceDivisor greater than 0");let a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??$.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(l){let u=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(l){}}e.push(a)}function one(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}c(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Op(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),T.defined("options.attributes",e.attributes);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,l=!1,u=!1,f=i.length;for(r=0;r<f;++r)IIe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let g=s[r];if(c(g.vertexBuffer)&&g.instanceDivisor===0){let m=g.strideInBytes||g.componentsPerAttribute*$.getSizeInBytes(g.componentDatatype);a=g.vertexBuffer.sizeInBytes/m;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(l=!0),c(s[r].value)&&(u=!0);let h={};for(r=0;r<f;++r){let g=s[r].index;if(h[g])throw new E(`Index ${g} is used by more than one attribute.`);h[g]=!0}let p;t.vertexArrayObject&&(p=t.glCreateVertexArray(),t.glBindVertexArray(p),one(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=l,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=p,this._attributes=s,this._indexBuffer=o}function ine(e){return e.values.length/e.componentsPerAttribute}function OIe(e){return $.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function RIe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)&&(o.push(n),e[n].componentDatatype===$.DOUBLE&&(e[n].componentDatatype=$.FLOAT,e[n].values=$.createTypedArray($.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=ine(e[o[0]]),t=1;t<s;++t){let u=ine(e[o[t]]);if(u!==r)throw new ae(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return $.getSizeInBytes(e[f].componentDatatype)-$.getSizeInBytes(e[u].componentDatatype)});let a=0,l={};for(t=0;t<s;++t)n=o[t],i=e[n],l[n]=a,a+=OIe(i);if(a>0){let u=$.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let m=$.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:$.createTypedArray(e[n].componentDatatype,p),index:l[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let y=i.values,b=g[n],x=b.pointer,A=i.componentsPerAttribute;for(let C=0;C<A;++C)x[b.index+C]=y[t*A+C];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:l,vertexSizeInBytes:a}}}Op.fromGeometry=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let t=e.context,n=e.geometry??W.EMPTY_OBJECT,i=e.bufferUsage??Be.DYNAMIC_DRAW,o=e.attributeLocations??W.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,l,u,f=c(s)?s:[],h=n.attributes;if(r){let m=RIe(h);if(c(m)){u=yt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&c(h[a])&&(l=h[a],c(l.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:y[a],strideInBytes:b}):f.push({index:o[a],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&c(h[a])){l=h[a];let m=l.componentDatatype;m===$.DOUBLE&&(m=$.FLOAT),u=void 0,c(l.values)&&(u=yt.createVertexBuffer({context:t,typedArray:$.createTypedArray(m,l.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:l.value,componentDatatype:m,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize})}let p,g=n.indices;return c(g)&&(ct.computeNumberOfVertices(n)>=O.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=yt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Fe.UNSIGNED_INT}):p=yt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Fe.UNSIGNED_SHORT})),new Op({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Op.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Op.prototype.getAttribute=function(e){return T.defined("index",e),this._attributes[e]};function MIe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=ut.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let l=o[s];if(l.enabled){let u=l.instanceDivisor,f=l.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function LIe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&c(r.value)&&r.vertexAttrib(t)}}Op.prototype._bind=function(){c(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&MIe(this),this._hasConstantAttributes&&LIe(this,this._gl)):one(this._gl,this._attributes,this._indexBuffer)};Op.prototype._unBind=function(){if(c(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)}};Op.prototype.isDestroyed=function(){return!1};Op.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;c(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return c(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),c(this._vao)&&this._context.glDeleteVertexArray(this._vao),de(this)};var ti=Op;function Co(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Qt}=e,l=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,{width:u,height:f}=e;if(c(n)){if(!Object.values(Co.FaceName).every(C=>c(n[C])))throw new E(`options.source requires faces ${Object.values(Co.FaceName).join(", ")}.`);({width:u,height:f}=n.positiveX);for(let C of Co.faceNames()){let S=n[C];if(Number(S.width)!==u||Number(S.height)!==f)throw new E("Each face in options.source must have the same width and height.")}}let h=u;if(!c(u)||!c(f))throw new E("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(u!==f)throw new E("Width must equal height.");if(h<=0)throw new E("Width and height must be greater than zero.");if(h>ut.maximumCubeMapSize)throw new E(`Width and height must be less than or equal to the maximum cube map size (${ut.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ke.validate(i))throw new E("Invalid options.pixelFormat.");if(ke.isDepthFormat(i))throw new E("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Ue.validate(o))throw new E("Invalid options.pixelDatatype.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new E("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new E("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let p=ke.textureSizeInBytes(i,o,h,h)*6,g=ke.toInternalFormat(i,o,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=l,this._flipY=r;let x=c(n);function A(C){return new Vv(t,b,y,C,g,i,o,h,l,r,x)}this._positiveX=A(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=A(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=A(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=A(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,rne(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let C of Co.faceNames())e6(this[C],n?.[C],0);m.bindTexture(y,null)}Co.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Ur({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};Co.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*NIe(){yield Co.FaceName.POSITIVEX,yield Co.FaceName.NEGATIVEX,yield Co.FaceName.POSITIVEY,yield Co.FaceName.NEGATIVEY,yield Co.FaceName.POSITIVEZ,yield Co.FaceName.NEGATIVEZ}Co.faceNames=function(){return NIe()};function e6(e,t,n){n=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,l=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!c(t)){h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;c(p)&&(g=ke.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),c(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),l&&(p=ke.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,l),h.texImage2D(i,n,a,r,Ue.toWebGLConstant(s,f),t))}Co.loadFace=e6;Object.defineProperties(Co.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){rne(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}}});Co.getDirection=function(e,t){switch(e){case Co.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case Co.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case Co.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case Co.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case Co.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case Co.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function rne(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ue.FLOAT&&!r.textureFloatLinear||s===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=li.NEAREST);let a=r._gl,l=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,e._texture),a.texParameteri(l,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(l,a.TEXTURE_MAG_FILTER,i),a.texParameteri(l,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(l,a.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&a.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(l,null)}Co.prototype.loadMipmaps=function(e,t){if(T.defined("source",e),!Array.isArray(e))throw new E("source must be an array");let n=Math.log2(this._size);if(e.length!==n)throw new E("all mip levels must be defined");t=t??!1;let i=this._context._gl,o=this._texture,r=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(r,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let s=0;s<e.length;s++){let a=e[s],l=s+1;for(let u of Co.faceNames())e6(this[u],a[u],l)}i.bindTexture(r,null),this._hasMipmap=!0};Co.prototype.generateMipmap=function(e){if(e=e??Cf.DONT_CARE,this._size>1&&!O.isPowerOfTwo(this._size))throw new E("width and height must be a power of two to call generateMipmap().");if(!Cf.validate(e))throw new E("hint is invalid.");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)};Co.createVertexArray=function(e){let t=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return ti.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Be.STATIC_DRAW})};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=de(this._positiveX),this._negativeX=de(this._negativeX),this._positiveY=de(this._positiveY),this._negativeY=de(this._negativeY),this._positiveZ=de(this._positiveZ),this._negativeZ=de(this._negativeZ),de(this)};var Go=Co;function FIe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var lc=FIe;var Hv=`const float czm_degreesPerRadian = 57.29577951308232; -`;var Gv=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var jv=`const float czm_epsilon1 = 0.1; -`;var Wv=`const float czm_epsilon2 = 0.01; -`;var qv=`const float czm_epsilon3 = 0.001; -`;var Yv=`const float czm_epsilon4 = 0.0001; -`;var Xv=`const float czm_epsilon5 = 0.00001; -`;var Kv=`const float czm_epsilon6 = 0.000001; -`;var $v=`const float czm_epsilon7 = 0.0000001; -`;var Zv=`const float czm_infinity = 5906376272000.0; -`;var Qv=`const float czm_oneOverPi = 0.3183098861837907; -`;var Jv=`const float czm_oneOverTwoPi = 0.15915494309189535; -`;var eD=`const float czm_passCesium3DTile = 4.0; -`;var tD=`const float czm_passCesium3DTileClassification = 5.0; -`;var nD=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var iD=`const float czm_passClassification = 7.0; -`;var oD=`const float czm_passCompute = 1.0; -`;var rD=`const float czm_passEnvironment = 0.0; -`;var sD=`const float czm_passGlobe = 2.0; -`;var aD=`const float czm_passOpaque = 7.0; -`;var cD=`const float czm_passOverlay = 10.0; -`;var lD=`const float czm_passTerrainClassification = 3.0; -`;var uD=`const float czm_passTranslucent = 8.0; -`;var fD=`const float czm_passVoxels = 9.0; -`;var dD=`const float czm_pi = 3.141592653589793; -`;var hD=`const float czm_piOverFour = 0.7853981633974483; -`;var mD=`const float czm_piOverSix = 0.5235987755982988; -`;var pD=`const float czm_piOverThree = 1.0471975511965976; -`;var _D=`const float czm_piOverTwo = 1.5707963267948966; -`;var gD=`const float czm_radiansPerDegree = 0.017453292519943295; -`;var yD=`const float czm_sceneMode2D = 2.0; -`;var bD=`const float czm_sceneMode3D = 3.0; -`;var xD=`const float czm_sceneModeColumbusView = 1.0; -`;var TD=`const float czm_sceneModeMorphing = 0.0; -`;var AD=`const float czm_solarRadius = 695500000.0; -`;var CD=`const float czm_threePiOver2 = 4.71238898038469; -`;var ED=`const float czm_twoPi = 6.283185307179586; -`;var SD=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var wD=`struct czm_depthRangeStruct + `;return o=jY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${rc._workerModulePrefix+i}.js`)),!dn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function MVe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!dn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function rc(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var NVe=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let s=o.error;s.name==="RuntimeError"?(s=new oe(o.error.message),s.stack=o.error.stack):s.name==="DeveloperError"?(s=new pe(o.error.message),s.stack=o.error.stack):s.name==="Error"&&(s=new Error(o.error.message),s.stack=o.error.stack),HY.raiseEvent(s),i(s)}else HY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},LVe=[];async function FVe(e,t,n){let i=await Promise.resolve(Mfe());l(n)?i||(n.length=0):n=LVe;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",NVe(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function BVe(e,t,n){++e._activeTasks;try{let i=await FVe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}rc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=GY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return BVe(this,e,t)};rc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=GY(this._workerPath),i=await MVe(this,e),r=await Promise.resolve(Mfe()),o,s=i.wasmBinary;l(s)&&r&&(o=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};rc.taskCompletedEvent=HY;rc._defaultWorkerModulePrefix="Workers/";rc._workerModulePrefix=rc._defaultWorkerModulePrefix;rc._canTransferArrayBuffer=void 0;var $n=rc;function cg(){}cg._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);cg._readyPromise=void 0;function kVe(){let e=cg._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return cg._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});cg._readyPromise=e}cg.transcode=function(e,t){return l(cg._readyPromise)||kVe(),cg._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let s=n[o];for(let a=0;a<r.length;a++){let c=s[r[a]];s[r[a]]=new TD(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var ED=cg;var Nfe;Lfe.setKTX2SupportedFormats=function(e,t,n,i,r,o){Nfe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Lfe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return ED.transcode(n,Nfe)})}var Ru=Lfe;function UVe(e,t){this.start=e??0,this.stop=t??0}var Us=UVe;var $j=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],JY),r=h.clone(i,WY),o=h.clone(i,qY),s=h.clone(i,YY),a=h.clone(i,XY),c=h.clone(i,KY),u=h.clone(i,$Y),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,L=i.y,_=i.z;O<r.x&&h.clone(i,r),O>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,oc)),g=h.magnitudeSquared(h.subtract(c,o,oc)),m=h.magnitudeSquared(h.subtract(u,s,oc)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=ZY;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,oc)),E=Math.sqrt(T),v=QY;v.x=r.x,v.y=o.y,v.z=s.z;let S=eX;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,tX),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,oc));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,oc));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;x.x=(E*x.x+C*i.x)/_,x.y=(E*x.y+C*i.y)/_,x.z=(E*x.z+C*i.z)/_}}return E<R?(h.clone(x,n.center),n.radius=E):(h.clone(I,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Ffe._ellipsoid=ee.default,n=n??Ffe,ie.southwest(t,nX),nX.height=i,ie.northeast(t,iX),iX.height=r;let s=n.project(nX,VVe),a=n.project(iX,jVe),c=a.x-s.x,u=a.y-s.y,f=a.z-s.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=s.x+c*.5,d.y=s.y+u*.5,d.z=s.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??ee.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,HVe);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=JY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,WY),a=h.clone(o,qY),c=h.clone(o,YY),u=h.clone(o,XY),f=h.clone(o,KY),d=h.clone(o,$Y),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,w=t[g+2]+n.z;o.x=_,o.y=C,o.z=w,_<s.x&&h.clone(o,s),_>u.x&&h.clone(o,u),C<a.y&&h.clone(o,a),C>f.y&&h.clone(o,f),w<c.z&&h.clone(o,c),w>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,s,oc)),y=h.magnitudeSquared(h.subtract(f,a,oc)),A=h.magnitudeSquared(h.subtract(d,c,oc)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=ZY;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let v=h.magnitudeSquared(h.subtract(x,E,oc)),S=Math.sqrt(v),I=QY;I.x=s.x,I.y=a.y,I.z=c.z;let R=eX;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,tX),L=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,O,oc));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,oc));if(C>v){let w=Math.sqrt(C);S=(S+w)*.5,v=S*S;let P=w-S;E.x=(S*E.x+P*o.x)/w,E.y=(S*E.y+P*o.y)/w,E.z=(S*E.z+P*o.z)/w}}return S<L?(h.clone(E,r.center),r.radius=S):(h.clone(O,r.center),r.radius=L),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=JY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,WY),s=h.clone(r,qY),a=h.clone(r,YY),c=h.clone(r,XY),u=h.clone(r,KY),f=h.clone(r,$Y),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];r.x=L,r.y=_,r.z=C,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),C<a.z&&h.clone(r,a),C>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,oc)),m=h.magnitudeSquared(h.subtract(u,s,oc)),y=h.magnitudeSquared(h.subtract(f,a,oc)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=ZY;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let E=h.magnitudeSquared(h.subtract(b,T,oc)),v=Math.sqrt(E),S=QY;S.x=o.x,S.y=s.y,S.z=a.z;let I=eX;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,tX),O=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(r,R,oc));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,oc));if(_>E){let C=Math.sqrt(_);v=(v+C)*.5,E=v*v;let w=C-v;T.x=(v*T.x+w*r.x)/C,T.y=(v*T.y+w*r.y)/C,T.z=(v*T.z+w*r.z)/C}}return v<O?(h.clone(T,i.center),i.radius=v):(h.clone(R,i.center),i.radius=O),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let s=n.center,a=n.radius;for(o=0;o<i;o++){let c=t[o];a=Math.max(a,h.distance(s,c.center)+c.radius)}return n.radius=a,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,GVe),o=$.getColumn(i,1,WVe),s=$.getColumn(i,2,qVe);return h.add(r,o,r),h.add(r,s,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=N.getTranslation(t,YVe),r=N.getScale(t,XVe),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,s=n.center,a=n.radius,c=h.subtract(s,r,KVe),u=h.magnitude(c);if(o>=u+a)return t.clone(i),i;if(a>=u+o)return n.clone(i),i;let f=(o+u+a)*.5,d=h.multiplyByScalar(c,(-o+f)/u,$Ve);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,JVe));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,s=h.dot(o,i)+n.distance;return s<-r?$t.OUTSIDE:s<r?$t.INTERSECTING:$t.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=N.multiplyByPoint(n,t.center,i.center),i.radius=N.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,ZVe),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=N.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Us);let o=h.subtract(t.center,n,QVe),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){kfe._ellipsoid=ee.default,n=n??kfe;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,Bfe):a=r.geodeticSurfaceNormal(o,Bfe);let c=h.cross(h.UNIT_Z,a,e4e);h.normalize(c,c);let u=h.cross(a,c,t4e);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,i4e),d=h.negate(c,n4e),p=Ufe,g=p[0];h.add(a,u,g),h.add(g,c,g),g=p[1],h.add(a,u,g),h.add(g,d,g),g=p[2],h.add(a,f,g),h.add(g,d,g),g=p[3],h.add(a,f,g),h.add(g,c,g),h.negate(a,a),g=p[4],h.add(a,u,g),h.add(g,c,g),g=p[5],h.add(a,u,g),h.add(g,d,g),g=p[6],h.add(a,f,g),h.add(g,d,g),g=p[7],h.add(a,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let E=r.cartesianToCartographic(T,r4e);n.project(E,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return zVe*t*t*t}};$j.packedLength=4;var WY=new h,qY=new h,YY=new h,XY=new h,KY=new h,$Y=new h,JY=new h,oc=new h,ZY=new h,QY=new h,eX=new h,tX=new h,zVe=4/3*D.PI,Ffe=new Ui,VVe=new h,jVe=new h,nX=new he,iX=new he,HVe=[],GVe=new h,WVe=new h,qVe=new h,YVe=new h,XVe=new h,KVe=new h,$Ve=new h,JVe=new h,ZVe=new h,QVe=new h,Bfe=new h,e4e=new h,t4e=new h,n4e=new h,i4e=new h,r4e=new he,Ufe=new Array(8);for(let e=0;e<8;++e)Ufe[e]=new h;var kfe=new Ui,ce=$j;function o4e(e){e=e??H.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 Tn=o4e;var zfe={NONE:0,TOP:1,ALL:2};Object.freeze(zfe);var mn=zfe;function ea(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ea.POSITION_ONLY=Object.freeze(new ea({position:!0}));ea.POSITION_AND_NORMAL=Object.freeze(new ea({position:!0,normal:!0}));ea.POSITION_NORMAL_AND_ST=Object.freeze(new ea({position:!0,normal:!0,st:!0}));ea.POSITION_AND_ST=Object.freeze(new ea({position:!0,st:!0}));ea.POSITION_AND_COLOR=Object.freeze(new ea({position:!0,color:!0}));ea.ALL=Object.freeze(new ea({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ea.DEFAULT=ea.POSITION_NORMAL_AND_ST;ea.packedLength=6;ea.pack=function(e,t,n){return n=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};ea.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ea),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};ea.clone=function(e,t){if(l(e))return l(t)||(t=new ea),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 Be=ea;var s4e=new h;function Cf(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Cf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Cf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Cf.fromAxisAlignedBoundingBox=function(e){return new Cf({minimum:e.minimum,maximum:e.maximum})};Cf.packedLength=2*h.packedLength+Be.packedLength+1;Cf.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var jfe=new h,Hfe=new h,Gfe=new Be,Vfe={minimum:jfe,maximum:Hfe,vertexFormat:Gfe,offsetAttribute:void 0};Cf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,jfe),r=h.unpack(e,t+h.packedLength,Hfe),o=Be.unpack(e,t+2*h.packedLength,Gfe),s=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Vfe.offsetAttribute=s===-1?void 0:s,new Cf(Vfe))};Cf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new Tn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),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,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else s=new Float64Array(24),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,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,s4e),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===mn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new St({attributes:r,indices:o,primitiveType:Oe.TRIANGLES,boundingSphere:new ce(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var rX;Cf.getUnitBox=function(){return l(rX)||(rX=Cf.createGeometry(Cf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),rX};var Ic=Cf;var xr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};xr.getMathType=function(e){switch(e){case xr.SCALAR:return Number;case xr.VEC2:return U;case xr.VEC3:return h;case xr.VEC4:return se;case xr.MAT2:return Xi;case xr.MAT3:return $;case xr.MAT4:return N}};xr.getNumberOfComponents=function(e){switch(e){case xr.SCALAR:return 1;case xr.VEC2:return 2;case xr.VEC3:return 3;case xr.VEC4:case xr.MAT2:return 4;case xr.MAT3:return 9;case xr.MAT4:return 16}};xr.getAttributeLocationCount=function(e){switch(e){case xr.SCALAR:case xr.VEC2:case xr.VEC3:case xr.VEC4:return 1;case xr.MAT2:return 2;case xr.MAT3:return 3;case xr.MAT4:return 4}};xr.getGlslType=function(e){switch(e){case xr.SCALAR:return"float";case xr.VEC2:return"vec2";case xr.VEC3:return"vec3";case xr.VEC4:return"vec4";case xr.MAT2:return"mat2";case xr.MAT3:return"mat3";case xr.MAT4:return"mat4"}};Object.freeze(xr);var Vt=xr;var Wfe=1/256,a4e=65536,sX=256,Lr={};Lr.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,r=n.y;n.x=(1-Math.abs(r))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(r)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Lr.octEncode=function(e,t){return Lr.octEncodeInRange(e,255,t)};var CD=new U,qfe=new Uint8Array(1);function Jj(e){return qfe[0]=e,qfe[0]}Lr.octEncodeToCartesian4=function(e,t){return Lr.octEncodeInRange(e,65535,CD),t.x=Jj(CD.x*Wfe),t.y=Jj(CD.x),t.z=Jj(CD.y*Wfe),t.w=Jj(CD.y),t};Lr.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*D.signNotZero(r),i.y=(1-Math.abs(r))*D.signNotZero(i.y)}return h.normalize(i,i)};Lr.octDecode=function(e,t,n){return Lr.octDecodeInRange(e,t,255,n)};Lr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*sX+i,a=r*sX+o;return Lr.octDecodeInRange(s,a,65535,t)};Lr.octPackFloat=function(e){return 256*e.x+e.y};var aX=new U;Lr.octEncodeFloat=function(e){return Lr.octEncode(e,aX),Lr.octPackFloat(aX)};Lr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Lr.octDecode(i,r,t)};Lr.octPack=function(e,t,n,i){let r=Lr.octEncodeFloat(e),o=Lr.octEncodeFloat(t),s=Lr.octEncode(n,aX);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Lr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Lr.octDecodeFloat(s,t),Lr.octDecodeFloat(c,n),Lr.octDecode(o,a,i)};Lr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Lr.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 oX(e){return e>>1^-(e&1)}Lr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=oX(e[a]),o+=oX(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=oX(n[a]),n[a]=s)};Lr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Lr.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*a4e+Math.round(D.clamp(e.green*255,0,255))*sX+Math.round(D.clamp(e.blue*255,0,255))};Lr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};Lr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var cn=Lr;var Yfe=new h,Xfe=new h,Kfe=new h;function c4e(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,Yfe),s=h.subtract(i,t,Xfe),a=h.subtract(e,t,Kfe),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(U.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(U.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(U.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=U.subtract(n,t,Yfe),s=U.subtract(i,t,Xfe),a=U.subtract(e,t,Kfe),c=U.dot(o,o),u=U.dot(o,s),f=U.dot(o,a),d=U.dot(s,s),p=U.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var ux=c4e;function Mp(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Mp.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 lg={high:0,low:0};Mp.fromCartesian=function(e,t){l(t)||(t=new Mp);let n=t.high,i=t.low;return Mp.encode(e.x,lg),n.x=lg.high,i.x=lg.low,Mp.encode(e.y,lg),n.y=lg.high,i.y=lg.low,Mp.encode(e.z,lg),n.z=lg.high,i.z=lg.low,t};var cX=new Mp;Mp.writeElements=function(e,t,n){Mp.fromCartesian(e,cX);let i=cX.high,r=cX.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=Mp;var lX={};lX.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function $fe(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}lX.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),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=$fe(r,-o,D.EPSILON14);if(s<0)return[];let a=-.5*$fe(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var kl=lX;var fX={};fX.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function uX(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,y=4*p*m-g*g,A,b;if(y<0){let G,q,Q;f*u>=c*d?(G=r,q=p,Q=-2*o*p+r*g):(G=a,q=m,Q=-a*g+2*s*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ae=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ae:-q/ae;return A=q<=0?ae+Ae:-Q/(ae*ae+Ae*Ae+q),f*u>=c*d?[(A-o)/r]:[-a/(A+s)]}let x=p,T=-2*o*p+r*g,E=m,v=-a*g+2*s*m,S=Math.sqrt(y),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*S,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let L=A*(-O/2-I*Math.sin(R)),_=b+L>2*o?b-o:L-o,C=r,w=_/C;R=Math.abs(Math.atan2(a*S,-v)/3),A=2*Math.sqrt(-E),O=Math.cos(R),b=A*O,L=A*(-O/2-I*Math.sin(R));let P=-a,M=b+L<2*s?b+s:L+s,F=P/M,V=C*M,B=-_*M-C*P,j=_*P,k=(s*B-o*j)/(-o*B+s*V);return w<=k?w<=F?k<=F?[w,k,F]:[w,F,k]:[F,w,k]:w<=F?[k,w,F]:k<=F?[k,F,w]:[F,k,w]}fX.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return kl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=kl.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return uX(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):uX(e,t,0,i);if(i===0)return r=kl.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return uX(e,t,n,i)};var fx=fX;var dX={};dX.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function jh(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=fx.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let d=kl.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=kl.computeRealRoots(1,d,p),y=kl.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function vD(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=fx.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=s-4*d,T=s+4*Math.abs(d),E,v;if(d<0||A*T<x*b){let C=Math.sqrt(x);E=C/2,v=C===0?0:(e*y-n)/C}else{let C=Math.sqrt(A);E=C===0?0:(e*y-n)/C,v=C/2}let S,I;m===0&&E===0?(S=0,I=0):D.sign(m)===D.sign(E)?(S=m+E,I=d/S):(I=m-E,S=d/I);let R,O;y===0&&v===0?(R=0,O=0):D.sign(y)===D.sign(v)?(R=y+v,O=i/R):(O=y-v,R=i/O);let L=kl.computeRealRoots(1,S,R),_=kl.computeRealRoots(1,I,O);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}dX.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return fx.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return jh(o,s,a,c);case 1:return vD(o,s,a,c);case 2:return vD(o,s,a,c);case 3:return jh(o,s,a,c);case 4:return jh(o,s,a,c);case 5:return vD(o,s,a,c);case 6:return jh(o,s,a,c);case 7:return jh(o,s,a,c);case 8:return vD(o,s,a,c);case 9:return jh(o,s,a,c);case 10:return jh(o,s,a,c);case 11:return vD(o,s,a,c);case 12:return jh(o,s,a,c);case 13:return jh(o,s,a,c);case 14:return jh(o,s,a,c);case 15:return jh(o,s,a,c);default:return}};var SD=dX;var hX=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},pn=hX;var io={};io.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<D.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var l4e=new h,u4e=new h,rde=new h,Jfe=new h,Zfe=new h;io.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,l4e),c=h.subtract(i,t,u4e),u=h.cross(s,c,rde),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<D.EPSILON6||(d=h.subtract(o,t,Jfe),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,Zfe),m=h.dot(s,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,Jfe),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,Zfe),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};io.rayTriangle=function(e,t,n,i,r,o){let s=io.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var f4e=new pn;io.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=f4e;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=io.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function d4e(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var h4e={root0:0,root1:0};function ode(e,t,n){l(n)||(n=new Us);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,rde),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=d4e(c,u,f,h4e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}io.raySphere=function(e,t,n){if(n=ode(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var m4e=new pn;io.lineSegmentSphere=function(e,t,n,i){let r=m4e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=ode(r,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 p4e=new h,g4e=new h;io.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,p4e),r=h.multiplyComponents(n,e.direction,g4e),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Us(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Us(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Us(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Us(0,-s/c)};var _4e=new Us,y4e=new Us,A4e=new Us;io.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Us);let i=mX(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,_4e),r=mX(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,y4e),o=mX(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,A4e);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function mX(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function dx(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}io.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*dx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*dx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*dx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=kl.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,y=f*f,A=a*a,b=d*f,x=A+y,T=2*(c*a+b),E=2*u*a+c*c-y+m,v=2*(u*c-b),S=u*u-m;if(x===0&&T===0&&E===0&&v===0)return g;p=SD.computeRealRoots(x,T,E,v,S);let I=p.length;if(I===0)return g;for(let R=0;R<I;++R){let O=p[R],L=O*O,_=Math.max(1-L,0),C=Math.sqrt(_),w;D.sign(a)===D.sign(u)?w=dx(a*L+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?w=dx(a*L,c*O+u,D.EPSILON12):w=dx(a*L+c*O,u,D.EPSILON12);let P=dx(f*O,d,D.EPSILON15),M=w*P;M<0?g.push(new h(i,r*O,r*C)):M>0?g.push(new h(i,r*O,r*-C)):C!==0?(g.push(new h(i,r*O,r*-C)),g.push(new h(i,r*O,r*C)),++R):g.push(new h(i,r*O,r*C))}return g};var pX=new h,Qfe=new h,ede=new h,Zj=new h,b4e=new h,x4e=new $,T4e=new $,E4e=new $,C4e=new $,v4e=new $,tde=new $,nde=new $,ide=new h,S4e=new h,w4e=new he;io.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,pX);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,pX),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,Zj),c=h.normalize(h.cross(a,s,Qfe),Qfe),u=h.normalize(h.cross(s,c,ede),ede),f=x4e;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,T4e),p=$.fromScale(t.radii,E4e),g=$.fromScale(t.oneOverRadii,C4e),m=v4e;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=$.multiply($.multiply(d,g,tde),m,tde),A=$.multiply($.multiply(y,p,nde),f,nde),b=$.multiplyByVector(y,n,b4e),x=io.quadraticVectorExpression(A,h.negate(b,pX),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,S4e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],ide),ide);let L=h.normalize(h.subtract(T,n,Zj),Zj),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,w4e);return I=D.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,Zj))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var I4e=new h;io.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,I4e),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<D.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};io.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return io.lineSegmentPlane(e,t,i,f),io.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return io.lineSegmentPlane(t,n,i,f),io.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return io.lineSegmentPlane(n,e,i,f),io.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return io.lineSegmentPlane(e,n,i,f),io.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return io.lineSegmentPlane(n,t,i,f),io.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return io.lineSegmentPlane(t,e,i,f),io.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var pi=io;function Na(e,t){this.normal=h.clone(e),this.distance=t}Na.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Na(t,i)};var P4e=new h;Na.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,P4e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Na(n,i)};Na.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var D4e=new h;Na.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Na.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,D4e);return h.subtract(t,r,n)};var R4e=new N,O4e=new se,M4e=new h;Na.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,R4e),s=se.fromElements(i.x,i.y,i.z,r,O4e);s=N.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,M4e);return s=se.divideByScalar(s,h.magnitude(a),s),Na.fromCartesian4(s,n)};Na.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Na(e.normal,e.distance)};Na.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Na.ORIGIN_XY_PLANE=Object.freeze(new Na(h.UNIT_Z,0));Na.ORIGIN_YZ_PLANE=Object.freeze(new Na(h.UNIT_X,0));Na.ORIGIN_ZX_PLANE=Object.freeze(new Na(h.UNIT_Y,0));var sn=Na;var gX={};gX.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};gX.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,C,w,P){for(;C.length>=1;){let M=C[C.length-1];if(C.splice(C.length-1,1),_[M].numLiveTriangles>0)return M}for(;r<P;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,C,w,P,M,F,V){let B=-1,j,k=-1,G=0;for(;G<w.length;){let q=w[G];P[q].numLiveTriangles&&(j=0,M-P[q].timeStamp+2*P[q].numLiveTriangles<=C&&(j=M-P[q].timeStamp),(j>k||k===-1)&&(k=j,B=q)),++G}return B===-1?o(P,F,_,V):B}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,E,v=0,S=[],I=a/3,R=[];for(g=0;g<I;g++)R[g]=!1;let O,L;for(;y!==-1;){b=[],E=p[y],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let C=0;C<3;++C)O=t[u],b.push(O),x.push(O),S[v]=O,++v,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=s(t,i,b,p,A,x,c)}return S};var wD=gX;var Ul={};function o6(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function N4e(e){let t=e.length,n=t/3*6,i=je.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)o6(i,r,e[o],e[o+1],e[o+2]);return i}function L4e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);o6(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)o6(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function F4e(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=je.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)o6(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Ul.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=N4e(t);break;case Oe.TRIANGLE_STRIP:e.indices=L4e(t);break;case Oe.TRIANGLE_FAN:e.indices=F4e(t);break}e.primitiveType=Oe.LINES}return e};Ul.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ce(u.center,u.radius+n)),new St({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};Ul.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};Ul.reorderForPreVertexCache=function(e){let t=St.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=je.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};Ul.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Oe.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=wD.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function sde(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 Ne({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function B4e(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}Ul.fitToUnsignedShortIndices=function(e){let t=[],n=St.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=sde(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Oe.TRIANGLES?u=3:e.primitiveType===Oe.LINES?u=2:e.primitiveType===Oe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,B4e(s,e.attributes,p)),r.push(g)}o+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new St({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=sde(e.attributes))}r.length!==0&&t.push(new St({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ade=new h,k4e=new he;Ul.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Ui;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,ade),p=s.cartesianToCartographic(d,k4e),g=r.project(p,ade);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var _X={high:0,low:0};Ul.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Sn.encode(o[f],_X),a[f]=_X.high,c[f]=_X.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Gh=new h;function yX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Gh),N.multiplyByPoint(e,Gh,Gh),h.pack(Gh,n,r)}}function AX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Gh),$.multiplyByVector(e,Gh,Gh),Gh=h.normalize(Gh,Gh),h.pack(Gh,n,r)}}var Qj=new N,e6=new $;Ul.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;yX(t,n.position),yX(t,n.prevPosition),yX(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(N.inverse(t,Qj),N.transpose(Qj,Qj),N.getMatrix3(Qj,e6),AX(e6,n.normal),AX(e6,n.tangent),AX(e6,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ce.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function U4e(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ne({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Y.createTypedArray(s.componentDatatype,a)}))}return i}var z4e=new h;function bX(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=U4e(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=St.computeNumberOfVertices(new St({attributes:f,primitiveType:Oe.POINTS})),E=je.createTypedArray(T,x),v=0,S=0;for(r=0;r<n;++r){let I=e[r][t].indices,R=I.length;for(s=0;s<R;++s)E[v++]=S+I[s];S+=St.computeNumberOfVertices(e[r][t])}m=E}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,z4e))+b.radius;x>A&&(A=x)}return new St({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ce(y,A):void 0})}Ul.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(bX(t,"geometry")),n.length>0&&(r.push(bX(n,"westHemisphereGeometry")),r.push(bX(n,"eastHemisphereGeometry"))),r};var wd=new h,ID=new h,pv=new h,gv=new h;Ul.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;ID.x=i[b],ID.y=i[b+1],ID.z=i[b+2],pv.x=i[x],pv.y=i[x+1],pv.z=i[x+2],gv.x=i[T],gv.y=i[T+1],gv.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(pv,ID,pv),h.subtract(gv,ID,gv),a[f]=h.cross(pv,gv,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,wd),p.count>0){for(f=0;f<p.count;f++)h.add(wd,a[c[p.indexOffset+f]],wd);h.equalsEpsilon(h.ZERO,wd,D.EPSILON10)&&h.clone(a[c[p.indexOffset]],wd)}h.equalsEpsilon(h.ZERO,wd,D.EPSILON10)&&(wd.z=1),h.normalize(wd,wd),g[m]=wd.x,g[m+1]=wd.y,g[m+2]=wd.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var V4e=new h,cde=new h,j4e=new h;Ul.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,E=b*2,v=i[f],S=i[f+1],I=i[f+2],R=o[x],O=o[x+1],L=o[T+1]-O,_=o[E+1]-O,C=1/((o[T]-R)*_-(o[E]-R)*L),w=(_*(i[d]-v)-L*(i[p]-v))*C,P=(_*(i[d+1]-S)-L*(i[p+1]-S))*C,M=(_*(i[d+2]-I)-L*(i[p+2]-I))*C;c[f]+=w,c[f+1]+=P,c[f+2]+=M,c[d]+=w,c[d+1]+=P,c[d+2]+=M,c[p]+=w,c[p+1]+=P,c[p+2]+=M}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,V4e),A=h.fromArray(c,f,j4e),b=h.dot(y,A);h.multiplyByScalar(y,b,cde),h.normalize(h.subtract(A,cde,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var PD=new U,Hh=new h,lde=new h,ude=new h,t6=new U;Ul.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let S=t.values;i=S.length/3;let I=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(S,n*3,Hh),h.equals(Hh,h.ZERO)){R+=2;continue}t6=cn.octEncodeInRange(Hh,65535,t6),I[R++]=t6.x,I[R++]=t6.y}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let x=i,T=a&&s?2:1;T+=f||d?1:0,x*=T;let E=new Float32Array(x),v=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,PD),E[v++]=cn.compressTextureCoordinates(PD));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,Hh),h.fromArray(m,S,lde),h.fromArray(y,S,ude),cn.octPack(Hh,lde,ude,PD),E[v++]=PD.x,E[v++]=PD.y):(s&&(h.fromArray(p,S,Hh),E[v++]=cn.octEncodeFloat(Hh)),f&&(h.fromArray(m,S,Hh),E[v++]=cn.octEncodeFloat(Hh)),d&&(h.fromArray(y,S,Hh),E[v++]=cn.octEncodeFloat(Hh)))}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function H4e(e){if(l(e.indices))return e;let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function G4e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function W4e(e){let t=St.computeNumberOfVertices(e),n=je.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 r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function q4e(e){if(l(e.indices))return e;let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Y4e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Oe.LINES,e}function X4e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Oe.LINES,e}function K4e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return G4e(e);case Oe.TRIANGLE_STRIP:return W4e(e);case Oe.TRIANGLES:return H4e(e);case Oe.LINE_STRIP:return Y4e(e);case Oe.LINE_LOOP:return X4e(e);case Oe.LINES:return q4e(e)}return e}function My(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function $4e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){My(e,e.y<0),My(t,t.y<0),My(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=D.sign(e.y):s=D.sign(n.y):r>o?s=D.sign(t.y):s=D.sign(n.y);let a=s<0;My(e,a),My(t,a),My(n,a)}var fde=new h;function Id(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,fde),e.y/(e.y-t.y),fde),n),h.clone(n,i),My(n,!0),My(i,!1)}var hx=new h,mx=new h,px=new h,gx=new h,xX={positions:new Array(7),indices:new Array(9)};function J4e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;$4e(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=xX.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Id(e,t,hx,px),Id(e,n,mx,gx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Id(t,n,hx,px),Id(t,e,mx,gx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Id(n,e,hx,px),Id(n,t,mx,gx),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?r?o||(Id(n,e,hx,px),Id(n,t,mx,gx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Id(t,n,hx,px),Id(t,e,mx,gx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Id(e,t,hx,px),Id(e,n,mx,gx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=xX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=hx,c[4]=mx,c[5]=px,c[6]=gx,c.length=7),xX}function dde(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=St.computeNumberOfVertices(e);return e.indices=je.createTypedArray(i,e.indices),t&&(e.boundingSphere=ce.fromVertices(n.position.values)),e}function yv(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ne({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new St({attributes:n,indices:[],primitiveType:e.primitiveType})}function vX(e,t,n){let i=l(e.geometry.boundingSphere);t=dde(t,i),n=dde(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 SX(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var Z4e=SX(se,4),r6=SX(h,3),yde=SX(U,2),Q4e=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>D.EPSILON6?1:0},DD=new h,TX=new h,EX=new h,e8e=new h;function n6(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,DD),b=h.fromArray(r,t*3,TX),x=h.fromArray(r,n*3,EX),T=ux(i,A,b,x,e8e);if(l(T)){if(l(o)&&r6(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,DD),v=h.fromArray(u,t*3,TX),S=h.fromArray(u,n*3,EX);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(v,T.y,v),h.multiplyByScalar(S,T.z,S);let I;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(S,h.ZERO)?(I=h.add(E,v,E),h.add(I,S,I),h.normalize(I,I)):(I=DD,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&Q4e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&r6(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&r6(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&yde(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];t8e(e,t,n,T,y,m[v],d[v])}}}function t8e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:Z4e(e,t,n,i,c,u,r,!1);break;case 3:r6(e,t,n,i,c,u,r,!1);break;case 2:yde(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Np(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var n8e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function hde(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=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,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!n8e[I]&&l(n[I])&&d.push(I);let p=d.length,g=yv(t),m=yv(t),y,A,b,x,T,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,v[T]=-1;let S=f.length;for(T=0;T<S;T+=3){let I=f[T],R=f[T+1],O=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,R*3),C=h.fromArray(i,O*3),w=J4e(L,_,C);if(l(w)&&w.positions.length>3){let P=w.positions,M=w.indices,F=M.length;for(let V=0;V<F;++V){let B=M[V],j=P[B];j.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=Np(y,A,b,f,B<3?T+B:-1,j),n6(I,R,O,j,i,r,s,o,a,c,u,y,d,p,n,x)}}else l(w)&&(L=w.positions[0],_=w.positions[1],C=w.positions[2]),L.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=Np(y,A,b,f,T,L),n6(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=Np(y,A,b,f,T+1,_),n6(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=Np(y,A,b,f,T+2,C),n6(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}vX(e,m,g)}var Ade=sn.fromPointNormal(h.ZERO,h.UNIT_Y),i8e=new h,r8e=new h;function _v(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,DD);h.equalsEpsilon(a,n,D.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function mde(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=yv(t),a=yv(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,DD),y=h.fromArray(i,g*3,TX),A;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(y.y)<D.EPSILON6&&(y.y<0?y.y=-D.EPSILON6:y.y=D.EPSILON6);let b=s.attributes,x=s.indices,T=d,E=a.attributes,v=a.indices,S=f,I=pi.lineSegmentPlane(m,y,Ade,EX);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,i8e);m.y<0&&(h.negate(R,R),b=a.attributes,x=a.indices,T=f,E=s.attributes,v=s.indices,S=d);let O=h.add(I,R,r8e);A=Np(b,x,T,o,c,m),_v(p,g,m,i,A,b,r),A=Np(b,x,T,o,-1,O),_v(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=Np(E,v,S,o,-1,O),_v(p,g,O,i,A,E,r),A=Np(E,v,S,o,c+1,y),_v(p,g,y,i,A,E,r)}else{let R,O,L;m.y<0?(R=a.attributes,O=a.indices,L=f):(R=s.attributes,O=s.indices,L=d),A=Np(R,O,L,o,c,m),_v(p,g,m,i,A,R,r),A=Np(R,O,L,o,c+1,y),_v(p,g,y,i,A,R,r)}}vX(e,a,s)}var pde=new U,o8e=new U,bde=new h,xde=new h,CX=new h,s8e=new h,a8e=new h,c8e=new h,gde=new se;function _de(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,bde);if(a.x>0)continue;let c=h.unpack(i,s,xde);(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]):h.pack(a,i,s));let u=h.unpack(r,s,CX);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var l8e=5*D.EPSILON9,i6=D.EPSILON6;function u8e(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=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,u=yv(t),f=yv(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,bde),T=h.fromArray(i,b*3,xde);if(Math.abs(x.y)<i6)for(x.y=i6*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<i6)for(T.y=i6*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,S=f.attributes,I=f.indices,R=pi.lineSegmentPlane(x,T,Ade,s8e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,l8e,a8e);x.y<0&&(h.negate(O,O),E=f.attributes,v=f.indices,S=u.attributes,I=u.indices);let L=h.add(R,O,c8e);E.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),E.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),E.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(R,O,L),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=U.fromArray(s,A*2,pde),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),S.expandAndWidth.values.push(-1,C,1,C),S.expandAndWidth.values.push(-1,-C,1,-C);let w=h.magnitudeSquared(h.subtract(R,x,CX));if(w/=h.magnitudeSquared(h.subtract(T,x,CX)),l(c)){let P=se.fromArray(c,A*4,gde),M=se.fromArray(c,b*4,gde),F=D.lerp(P.x,M.x,w),V=D.lerp(P.y,M.y,w),B=D.lerp(P.z,M.z,w),j=D.lerp(P.w,M.w,w);for(p=A*4;p<A*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(F,V,B,j),E.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),p=b*4;p<b*4+8;++p)S.color.values.push(c[p])}if(l(a)){let P=U.fromArray(a,A*2,pde),M=U.fromArray(a,(d+3)*2,o8e),F=D.lerp(P.x,M.x,w);for(p=A*2;p<A*2+4;++p)E.st.values.push(a[p]);for(E.st.values.push(F,P.y),E.st.values.push(F,M.y),S.st.values.push(F,P.y),S.st.values.push(F,M.y),p=b*2;p<b*2+4;++p)S.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=S.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let O,L;for(x.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(_de(f),_de(u)),vX(e,f,u)}Ul.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ce.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==Sd.NONE)switch(t.geometryType){case Sd.POLYLINES:u8e(e);break;case Sd.TRIANGLES:hde(e);break;case Sd.LINES:mde(e);break}else K4e(t),t.primitiveType===Oe.TRIANGLES?hde(e):t.primitiveType===Oe.LINES&&mde(e);return e};var Hn=Ul;function RD(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(RD.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});RD.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=Ke.alignmentInBytes(p,m,o)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=Ke.flipY(f,p,m,d,d)),T=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),T=Ke.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,ze.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=Ke.flipY(f,p,m,o,s)),a.texSubImage2D(u,0,t,n,o,s,p,ze.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),a.texSubImage2D(u,0,t,n,p,ze.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};RD.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??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,r,o),s.bindTexture(a,null),this._initialized=!0};RD.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(s,null),this._initialized=!0};var OD=RD;var MD={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===MD.DONT_CARE||e===MD.FASTEST||e===MD.NICEST}};Object.freeze(MD);var Pd=MD;var ND={NEAREST:te.NEAREST,LINEAR:te.LINEAR};ND.validate=function(e){return e===ND.NEAREST||e===ND.LINEAR};Object.freeze(ND);var Jn=ND;var ug={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};ug.validate=function(e){return e===ug.NEAREST||e===ug.LINEAR||e===ug.NEAREST_MIPMAP_NEAREST||e===ug.LINEAR_MIPMAP_NEAREST||e===ug.NEAREST_MIPMAP_LINEAR||e===ug.LINEAR_MIPMAP_LINEAR};Object.freeze(ug);var Wt=ug;var LD={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===LD.CLAMP_TO_EDGE||e===LD.REPEAT||e===LD.MIRRORED_REPEAT}};Object.freeze(LD);var hn=LD;function FD(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=hn.CLAMP_TO_EDGE,wrapS:n=hn.CLAMP_TO_EDGE,wrapT:i=hn.CLAMP_TO_EDGE,minificationFilter:r=Wt.LINEAR,magnificationFilter:o=Jn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(FD.prototype,{wrapR:{get:function(){return this._wrapR}},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}}});FD.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};FD.NEAREST=Object.freeze(new FD({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST}));var jt=FD;function f8e(e,t){if(!e)throw new pe(t)}var wX=f8e;function d8e(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=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 Ede(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Wh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)d8e(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Ede(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function Tde(e){return e.values.length/e.componentsPerAttribute}function h8e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function m8e(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=Tde(e[r[0]]),t=1;t<s;++t){let u=Tde(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=h8e(i);if(a>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Wh.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Me.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=m8e(d);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:A}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[a],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(St.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Wh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Wh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Wh.prototype.getAttribute=function(e){return this._attributes[e]};function p8e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=kt.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function g8e(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Wh.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,s=r.componentsPerAttribute,a=t.constructor,c=n*s*a.BYTES_PER_ELEMENT,u=new a(t.buffer,t.byteOffset+c,i*s);o.copyFromArrayView(u,c)};Wh.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,s=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(s,o)};Wh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&p8e(this),this._hasConstantAttributes&&g8e(this,this._gl)):Ede(this._gl,this._attributes,this._indexBuffer)};Wh.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)}};Wh.prototype.isDestroyed=function(){return!1};Wh.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),ue(this)};var zn=Wh;function Po(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e,c=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=Ke.textureSizeInBytes(i,r,d,d)*6,g=Ke.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new OD(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Cde(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of Po.faceNames())IX(this[T],n?.[T],0);m.bindTexture(y,null)}Po.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new _s({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};Po.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*_8e(){yield Po.FaceName.POSITIVEX,yield Po.FaceName.NEGATIVEX,yield Po.FaceName.POSITIVEY,yield Po.FaceName.NEGATIVEY,yield Po.FaceName.POSITIVEZ,yield Po.FaceName.NEGATIVEZ}Po.faceNames=function(){return _8e()};function IX(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=Ke.alignmentInBytes(o,s,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=Ke.flipY(p,o,s,r,r)),d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,o,ze.toWebGLConstant(s,f),t))}Po.loadFace=IX;Object.defineProperties(Po.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){Cde(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}}});Po.getDirection=function(e,t){switch(e){case Po.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Po.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Po.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Po.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Po.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Po.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Cde(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelDatatype;(s===ze.FLOAT&&!o.textureFloatLinear||s===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST);let a=o._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,a.LINEAR),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)}Po.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let s=e[o],a=o+1;for(let c of Po.faceNames())IX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};Po.prototype.generateMipmap=function(e){e=e??Pd.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)};Po.createVertexArray=function(e){let t=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Hn.createAttributeLocations(t);return zn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Po.prototype.isDestroyed=function(){return!1};Po.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var ns=Po;function y8e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=y8e;var PX=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},BD=PX;var kD=`const float czm_degreesPerRadian = 57.29577951308232; +`;var UD=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); +`;var zD=`const float czm_epsilon1 = 0.1; +`;var VD=`const float czm_epsilon2 = 0.01; +`;var jD=`const float czm_epsilon3 = 0.001; +`;var HD=`const float czm_epsilon4 = 0.0001; +`;var GD=`const float czm_epsilon5 = 0.00001; +`;var WD=`const float czm_epsilon6 = 0.000001; +`;var qD=`const float czm_epsilon7 = 0.0000001; +`;var YD=`const float czm_infinity = 5906376272000.0; +`;var XD=`const float czm_oneOverPi = 0.3183098861837907; +`;var KD=`const float czm_oneOverTwoPi = 0.15915494309189535; +`;var $D=`const float czm_passCesium3DTile = 6.0; +`;var JD=`const float czm_passCesium3DTileClassification = 7.0; +`;var ZD=`const float czm_passCesium3DTileClassificationIgnoreShow = 8.0; +`;var QD=`const float czm_passCesium3DTileEdges = 4.0; +`;var e1=`const float czm_passCesium3DTileEdgesDirect = 12.0; +`;var t1=`const float czm_passCesium3DTilePlanarFillId = 5.0; +`;var n1=`const float czm_passClassification = 8.0; +`;var i1=`const float czm_passCompute = 1.0; +`;var r1=`const float czm_passEnvironment = 0.0; +`;var o1=`const float czm_passGaussianSplats = 12.0; +`;var s1=`const float czm_passGlobe = 2.0; +`;var a1=`const float czm_passOpaque = 9.0; +`;var c1=`const float czm_passOverlay = 13.0; +`;var l1=`const float czm_passTerrainClassification = 3.0; +`;var u1=`const float czm_passTranslucent = 10.0; +`;var f1=`const float czm_passVoxels = 11.0; +`;var d1=`const float czm_pi = 3.141592653589793; +`;var h1=`const float czm_piOverFour = 0.7853981633974483; +`;var m1=`const float czm_piOverSix = 0.5235987755982988; +`;var p1=`const float czm_piOverThree = 1.0471975511965976; +`;var g1=`const float czm_piOverTwo = 1.5707963267948966; +`;var _1=`const float czm_radiansPerDegree = 0.017453292519943295; +`;var y1=`const float czm_sceneMode2D = 2.0; +`;var A1=`const float czm_sceneMode3D = 3.0; +`;var b1=`const float czm_sceneModeColumbusView = 1.0; +`;var x1=`const float czm_sceneModeMorphing = 0.0; +`;var T1=`const float czm_solarRadius = 695500000.0; +`;var E1=`const float czm_threePiOver2 = 4.71238898038469; +`;var C1=`const float czm_twoPi = 6.283185307179586; +`;var v1=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var S1=`struct czm_depthRangeStruct { float near; float far; }; -`;var vD=`struct czm_material +`;var w1=`struct czm_material { vec3 diffuse; float specular; @@ -144,7 +148,7 @@ vec3 normal; vec3 emission; float alpha; }; -`;var DD=`struct czm_materialInput +`;var I1=`struct czm_materialInput { float s; vec2 st; @@ -157,7 +161,7 @@ float slope; float aspect; float waterMask; }; -`;var PD=`struct czm_modelMaterial { +`;var P1=`struct czm_modelMaterial { vec4 baseColor; vec3 diffuse; float alpha; @@ -180,23 +184,23 @@ float clearcoatRoughness; vec3 clearcoatNormal; #endif }; -`;var ID=`struct czm_modelVertexOutput { +`;var D1=`struct czm_modelVertexOutput { vec3 positionMC; float pointSize; }; -`;var OD=`struct czm_ray +`;var R1=`struct czm_ray { vec3 origin; vec3 direction; }; -`;var RD=`struct czm_raySegment +`;var O1=`struct czm_raySegment { float start; float stop; }; const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var MD=`struct czm_shadowParameters +`;var M1=`struct czm_shadowParameters { #ifdef USE_CUBE_MAP_SHADOW vec3 texCoords; @@ -210,7 +214,7 @@ vec2 texelStepSize; float normalShadingSmooth; float darkness; }; -`;var LD=`vec3 czm_acesTonemapping(vec3 color) { +`;var N1=`vec3 czm_acesTonemapping(vec3 color) { float g = 0.985; float a = 0.065; float b = 0.0001; @@ -220,12 +224,12 @@ color = (color * (color + a) - b) / (color * (g * color + c) + d); color = clamp(color, 0.0, 1.0); return color; } -`;var ND=`float czm_alphaWeight(float a) +`;var L1=`float czm_alphaWeight(float a) { float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; 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 FD=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var F1=`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); @@ -239,7 +243,7 @@ vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var BD=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { +`;var B1=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { vec3 hsb = czm_RGBToHSB(rgb); hsb.x += hsbShift.x; hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); @@ -251,20 +255,20 @@ hsb.z = hsb.z + hsbShift.z; hsb.z = clamp(hsb.z, 0.0, 1.0); return czm_HSBToRGB(hsb); } -`;var kD=`vec2 czm_approximateSphericalCoordinates(vec3 normal) { +`;var k1=`vec2 czm_approximateSphericalCoordinates(vec3 normal) { 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 UD=`float czm_approximateTanh(float x) { +`;var U1=`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 VD=`bool czm_backFacing() +`;var z1=`bool czm_backFacing() { return gl_FrontFacing == false; } -`;var zD=`float czm_branchFreeTernary(bool comparison, float a, float b) { +`;var V1=`float czm_branchFreeTernary(bool comparison, float a, float b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } @@ -280,19 +284,19 @@ vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } -`;var HD=`vec4 czm_cascadeColor(vec4 weights) +`;var j1=`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 GD=`uniform vec4 shadowMap_cascadeDistances; +`;var H1=`uniform vec4 shadowMap_cascadeDistances; float czm_cascadeDistance(vec4 weights) { return dot(shadowMap_cascadeDistances, weights); } -`;var jD=`uniform mat4 shadowMap_cascadeMatrices[4]; +`;var G1=`uniform mat4 shadowMap_cascadeMatrices[4]; mat4 czm_cascadeMatrix(vec4 weights) { return shadowMap_cascadeMatrices[0] * weights.x + @@ -300,50 +304,19 @@ shadowMap_cascadeMatrices[1] * weights.y + shadowMap_cascadeMatrices[2] * weights.z + shadowMap_cascadeMatrices[3] * weights.w; } -`;var WD=`uniform vec4 shadowMap_cascadeSplits[2]; +`;var W1=`uniform vec4 shadowMap_cascadeSplits[2]; vec4 czm_cascadeWeights(float depthEye) { vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } -`;var qD=`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) { -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 YD=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var q1=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -vec3 p = mix(position2D.xyz, position3D.xyz, time); +vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; return vec4(p, 1.0); } -`;var XD=`vec4 czm_computeAtmosphereColor( +`;var Y1=`vec4 czm_computeAtmosphereColor( vec3 positionWC, vec3 lightDirection, vec3 rayleighColor, @@ -382,7 +355,7 @@ vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity; return vec4(color, opacity); } -`;var KD=`void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var X1=`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); @@ -397,8 +370,8 @@ mieColor, opacity ); } -`;var $D=`vec4 czm_computePosition(); -`;var ZD=`void czm_computeScattering( +`;var K1=`vec4 czm_computePosition(); +`;var $1=`void czm_computeScattering( czm_ray primaryRay, float primaryRayLength, vec3 lightDirection, @@ -467,7 +440,11 @@ rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; mieColor = czm_atmosphereMieCoefficient * mieAccumulation; opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } -`;var QD=`vec2 cordic(float angle) +`;var J1=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) +{ +return vec2(textureTransform * vec3(texCoord, 1.0)); +} +`;var Z1=`vec2 cordic(float angle) { vec2 vector = vec2(6.0725293500888267e-1, 0.0); float sense = (angle < 0.0) ? -1.0 : 1.0; @@ -631,7 +608,18 @@ else return cordic(angle); } } -`;var JD=`vec2 czm_decompressTextureCoordinates(float encoded) +`;var Q1=`vec4 czm_decodeRGB8(float encoded) { +const float SHIFT_RIGHT16 = 1.0 / 65536.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT8 = 256.0; +vec4 color = vec4(255.0); +color.r = floor(encoded * SHIFT_RIGHT16); +color.g = floor((encoded - color.r * SHIFT_LEFT16) * SHIFT_RIGHT8); +color.b = floor(encoded - color.r * SHIFT_LEFT16 - color.g * SHIFT_LEFT8); +return color / 255.0; +} +`;var eR=`vec2 czm_decompressTextureCoordinates(float encoded) { float temp = encoded / 4096.0; float xZeroTo4095 = floor(temp); @@ -639,7 +627,7 @@ float stx = xZeroTo4095 / 4095.0; float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; return vec2(stx, sty); } -`;var eP=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +`;var tR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) out float v_WindowZ; #endif vec4 czm_depthClamp(vec4 coords) @@ -654,7 +642,7 @@ coords.z = min(coords.z, coords.w); #endif return coords; } -`;var tP=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) +`;var nR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); vec3 tangentEC = normalize(czm_normal3D * tangentMC); @@ -664,16 +652,16 @@ tangentEC.x, tangentEC.y, tangentEC.z, bitangentEC.x, bitangentEC.y, bitangentEC.z, normalEC.x, normalEC.y, normalEC.z); } -`;var nP=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var iR=`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 iP=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) +`;var rR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } -`;var oP=`bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { +`;var oR=`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) { @@ -685,7 +673,7 @@ return all(lessThanEqual(abs(left - right), vec2(epsilon))); bool czm_equalsEpsilon(float left, float right, float epsilon) { return (abs(left - right) <= epsilon); } -`;var rP=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +`;var sR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { vec4 p = positionEC; vec4 zEyeOffset = normalize(p) * eyeOffset.z; @@ -693,14 +681,39 @@ p.xy += eyeOffset.xy + zEyeOffset.xy; p.z += zEyeOffset.z; return p; } -`;var sP=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +`;var aR=`vec3 czm_eyeToCartographicDelta(vec3 positionEC) +{ +vec3 cameraToVertex = czm_eyeToEnu * positionEC; +float cosLatitude = cos(czm_eyeCartographic.y); +float sinLatitude = sin(czm_eyeCartographic.y); +float primeVerticalRadius = 1.0 / czm_eyeEllipsoidCurvature.x; +vec2 cameraEquatorialPos = vec2((primeVerticalRadius + czm_eyeCartographic.z) * cosLatitude, 0.0); +vec2 vertexEquatorialPos = cameraEquatorialPos + vec2(-cameraToVertex.y * sinLatitude + cameraToVertex.z * cosLatitude, cameraToVertex.x); +float deltaLongitude = atan(vertexEquatorialPos.y, vertexEquatorialPos.x); +float sinHalfLongitude = sin(deltaLongitude * 0.5); +float dx = length(vertexEquatorialPos) * 2.0 * sinHalfLongitude * sinHalfLongitude; +vec3 meridionalOffset = vec3( +0.0, +cameraToVertex.y - dx * sinLatitude, +cameraToVertex.z + dx * cosLatitude +); +float meridionalRadius = 1.0 / czm_eyeEllipsoidCurvature.y; +vec2 cameraMeridionalPos = vec2(meridionalRadius + czm_eyeCartographic.z, 0.0); +vec2 vertMeridionalPos = cameraMeridionalPos + vec2(meridionalOffset.z, meridionalOffset.y); +float deltaLatitude = atan(vertMeridionalPos.y, vertMeridionalPos.x); +float sinHalfLatitude = sin(deltaLatitude * 0.5); +float dz = length(vertMeridionalPos) * 2.0 * sinHalfLatitude * sinHalfLatitude; +float deltaHeight = meridionalOffset.z + dz; +return vec3(deltaLongitude, deltaLatitude, deltaHeight); +} +`;var cR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { vec4 q = czm_projection * positionEC; q.xyz /= q.w; q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; return q; } -`;var aP=`float czm_fastApproximateAtan(float x) { +`;var lR=`float czm_fastApproximateAtan(float x) { return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } float czm_fastApproximateAtan(float x, float y) { @@ -714,7 +727,7 @@ t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); t = czm_branchFreeTernary(y < 0.0, -t, t); return t; } -`;var cP=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +`;var uR=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) { float scalar = distanceToCamera * czm_fogDensity; float fog = 1.0 - exp(-(scalar * scalar)); @@ -726,7 +739,7 @@ float scalar = distanceToCamera * czm_fogDensity; float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); return mix(color, fogColor, fog); } -`;var lP=`vec3 czm_gammaCorrect(vec3 color) { +`;var fR=`vec3 czm_gammaCorrect(vec3 color) { #ifdef HDR color = pow(color, vec3(czm_gamma)); #endif @@ -738,11 +751,11 @@ color.rgb = pow(color.rgb, vec3(czm_gamma)); #endif return color; } -`;var uP=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) +`;var dR=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -`;var fP=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +`;var hR=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) { czm_material material; material.diffuse = vec3(0.0); @@ -753,7 +766,7 @@ material.emission = vec3(0.0); material.alpha = 1.0; return material; } -`;var dP=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { +`;var mR=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { const float NONE = 0.0; const float SCENE_LIGHT = 1.0; const float SUNLIGHT = 2.0; @@ -763,17 +776,17 @@ czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) + czm_sunDirectionWC * float(lightEnum == SUNLIGHT); return normalize(lightDirection); } -`;var hP=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var pR=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { return max(dot(lightDirectionEC, normalEC), 0.0); } -`;var mP=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var gR=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); float specular = max(dot(toReflectedLight, toEyeEC), 0.0); return pow(specular, max(shininess, czm_epsilon2)); } -`;var pP=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var _R=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) { float cosAngle = cos(angleInRadians); float sinAngle = sin(angleInRadians); @@ -799,13 +812,13 @@ vec4 noise = (texture(normalMap, uv0)) + (texture(normalMap, uv3)); return ((noise / 4.0) - 0.5) * 2.0; } -`;var _P=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +`;var yR=`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 gP=`vec3 hueToRGB(float hue) +`;var AR=`vec3 hueToRGB(float hue) { float r = abs(hue * 6.0 - 3.0) - 1.0; float g = 2.0 - abs(hue * 6.0 - 2.0); @@ -818,7 +831,7 @@ 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 yP=`vec3 czm_hue(vec3 rgb, float adjustment) +`;var bR=`vec3 czm_hue(vec3 rgb, float adjustment) { const mat3 toYIQ = mat3(0.299, 0.587, 0.114, 0.595716, -0.274453, -0.321263, @@ -832,24 +845,24 @@ 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 bP=`vec3 czm_inverseGamma(vec3 color) { +`;var xR=`vec3 czm_inverseGamma(vec3 color) { return pow(color, vec3(1.0 / czm_gamma)); } -`;var xP=`bool czm_isEmpty(czm_raySegment interval) +`;var TR=`bool czm_isEmpty(czm_raySegment interval) { return (interval.stop < 0.0); } -`;var TP=`bool czm_isFull(czm_raySegment interval) +`;var ER=`bool czm_isFull(czm_raySegment interval) { return (interval.start == 0.0 && interval.stop == czm_infinity); } -`;var AP=`float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) +`;var CR=`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 CP=`vec3 czm_linearToSrgb(vec3 linearIn) +`;var vR=`vec3 czm_linearToSrgb(vec3 linearIn) { return pow(linearIn, vec3(1.0/2.2)); } @@ -858,15 +871,15 @@ vec4 czm_linearToSrgb(vec4 linearIn) vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); return vec4(srgbOut, linearIn.a); } -`;var EP=`float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { +`;var SR=`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 SP=`float czm_luminance(vec3 rgb) +`;var wR=`float czm_luminance(vec3 rgb) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); } -`;var wP=`float czm_maximumComponent(vec2 v) +`;var IR=`float czm_maximumComponent(vec2 v) { return max(v.x, v.y); } @@ -878,7 +891,7 @@ float czm_maximumComponent(vec4 v) { return max(max(max(v.x, v.y), v.z), v.w); } -`;var vP=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) +`;var PR=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) { float width = czm_viewport.z; float height = czm_viewport.w; @@ -910,14 +923,15 @@ float czm_metersPerPixel(vec4 positionEC) { return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var DP=`vec4 czm_modelToWindowCoordinates(vec4 position) +`;var DR=`vec4 czm_modelToWindowCoordinates(vec4 position) { -vec4 q = czm_modelViewProjection * position; +vec4 positionEC = czm_modelView * position; +vec4 q = czm_projection * positionEC; q.xyz /= q.w; q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; return q; } -`;var PP=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) +`;var RR=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 target = left * right; @@ -926,7 +940,7 @@ float rightLuminance = dot(right, W); float targetLuminance = dot(target, W); return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } -`;var IP=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) +`;var OR=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { float valueAtMin = nearFarScalar.y; float valueAtMax = nearFarScalar.w; @@ -936,7 +950,7 @@ float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); t = pow(clamp(t, 0.0, 1.0), 0.2); return mix(valueAtMin, valueAtMax, t); } -`;var OP=`vec3 czm_octDecode(vec2 encoded, float range) +`;var MR=`vec3 czm_octDecode(vec2 encoded, float range) { if (encoded.x == 0.0 && encoded.y == 0.0) { return vec3(0.0, 0.0, 0.0); @@ -972,14 +986,14 @@ vector1 = czm_octDecode(encodedFloat1); vector2 = czm_octDecode(encodedFloat2); vector3 = czm_octDecode(vec2(x, y)); } -`;var RP=`vec4 czm_packDepth(float depth) +`;var NR=`vec4 czm_packDepth(float depth) { 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 MP=`vec3 lambertianDiffuse(vec3 diffuseColor) +`;var LR=`vec3 lambertianDiffuse(vec3 diffuseColor) { return diffuseColor / czm_pi; } @@ -1065,7 +1079,7 @@ vec3 diffuseColor = material.diffuse; vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); return (diffuseContribution + specularContribution) * NdotL; } -`;var LP=`vec3 czm_pbrNeutralTonemapping(vec3 color) { +`;var FR=`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)); @@ -1079,7 +1093,7 @@ 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 NP=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +`;var BR=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { return czm_getLambertDiffuse(lightDirectionEC, material.normal); } @@ -1111,17 +1125,17 @@ color += material.diffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var FP=`float czm_planeDistance(vec4 plane, vec3 point) { +`;var kR=`float czm_planeDistance(vec4 plane, vec3 point) { return (dot(plane.xyz, point) + plane.w); } float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { return (dot(planeNormal, point) + planeDistance); } -`;var BP=`vec3 czm_pointAlongRay(czm_ray ray, float time) +`;var UR=`vec3 czm_pointAlongRay(czm_ray ray, float time) { return ray.origin + (time * ray.direction); } -`;var kP=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) +`;var zR=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; @@ -1193,7 +1207,7 @@ return czm_emptyRaySegment; } } } -`;var UP=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +`;var VR=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) { vec3 o = ray.origin; vec3 d = ray.direction; @@ -1211,11 +1225,11 @@ float t1 = (-b + sqrtDet) / (2.0 * a); czm_raySegment result = czm_raySegment(t0, t1); return result; } -`;var VP=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +`;var jR=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`;var zP=`float czm_readNonPerspective(float value, float oneOverW) { +`;var HR=`float czm_readNonPerspective(float value, float oneOverW) { return value * oneOverW; } vec2 czm_readNonPerspective(vec2 value, float oneOverW) { @@ -1227,7 +1241,7 @@ return value * oneOverW; vec4 czm_readNonPerspective(vec4 value, float oneOverW) { return value * oneOverW; } -`;var HP=`float czm_reverseLogDepth(float logZ) +`;var GR=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH float near = czm_currentFrustum.x; @@ -1238,7 +1252,7 @@ return far * (1.0 - near / (depthFromNear + near)) / (far - near); #endif return logZ; } -`;var GP=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +`;var WR=`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)); @@ -1246,7 +1260,7 @@ 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 jP=`vec3 RGBtoHCV(vec3 rgb) +`;var qR=`vec3 RGBtoHCV(vec3 rgb) { 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); @@ -1261,7 +1275,7 @@ 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 WP=`vec3 czm_RGBToXYZ(vec3 rgb) +`;var YR=`vec3 czm_RGBToXYZ(vec3 rgb) { const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, 0.3576, 0.7152, 0.1192, @@ -1273,7 +1287,7 @@ float temp = dot(vec3(1.0), xyz); Yxy.gb = xyz.rg / temp; return Yxy; } -`;var qP=`float czm_round(float value) { +`;var XR=`float czm_round(float value) { return floor(value + 0.5); } vec2 czm_round(vec2 value) { @@ -1285,13 +1299,13 @@ return floor(value + 0.5); vec4 czm_round(vec4 value) { return floor(value + 0.5); } -`;var YP=`vec3 czm_saturation(vec3 rgb, float adjustment) +`;var KR=`vec3 czm_saturation(vec3 rgb, float adjustment) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 intensity = vec3(dot(rgb, W)); return mix(intensity, rgb, adjustment); } -`;var XP=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) +`;var $R=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { return czm_unpackDepth(czm_textureCube(shadowMap, d)); } @@ -1311,7 +1325,7 @@ float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var KP=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +`;var JR=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { #ifdef USE_NORMAL_SHADING #ifdef USE_NORMAL_SHADING_SMOOTH @@ -1371,7 +1385,7 @@ float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } #endif -`;var $P=`float czm_signNotZero(float value) +`;var ZR=`float czm_signNotZero(float value) { return value >= 0.0 ? 1.0 : -1.0; } @@ -1387,7 +1401,7 @@ vec4 czm_signNotZero(vec4 value) { return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -`;var ZP=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +`;var QR=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) { vec3 L00 = coefficients[0]; vec3 L1_1 = coefficients[1]; @@ -1413,7 +1427,7 @@ L00 + L22 * (x * x - y * y); return max(L, vec3(0.0)); } -`;var QP=`vec3 czm_srgbToLinear(vec3 srgbIn) +`;var eO=`vec3 czm_srgbToLinear(vec3 srgbIn) { return pow(srgbIn, vec3(2.2)); } @@ -1422,7 +1436,7 @@ vec4 czm_srgbToLinear(vec4 srgbIn) vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); } -`;var JP=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +`;var tO=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) { vec3 normal = normalize(normalEC); vec3 tangent = normalize(tangentEC); @@ -1431,7 +1445,7 @@ return mat3(tangent.x , tangent.y , tangent.z, bitangent.x, bitangent.y, bitangent.z, normal.x , normal.y , normal.z); } -`;var eI=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { +`;var nO=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { #if __VERSION__ == 300 return texture(sampler, p); #else @@ -1445,12 +1459,12 @@ return textureLod(sampler, p, lod); return textureCubeLodEXT(sampler, p, lod); #endif } -`;var tI=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { +`;var iO=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { vec4 transformedPlane = transform * plane; float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } -`;var nI=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +`;var rO=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { vec3 highDifference = high - czm_encodedCameraPositionMCHigh; if (length(highDifference) == 0.0) { @@ -1459,7 +1473,7 @@ highDifference = vec3(0); vec3 lowDifference = low - czm_encodedCameraPositionMCLow; return vec4(highDifference + lowDifference, 1.0); } -`;var iI=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +`;var oO=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); if (czm_sceneMode == czm_sceneMode3D) { @@ -1474,7 +1488,7 @@ color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var oI=`mat2 czm_transpose(mat2 matrix) +`;var sO=`mat2 czm_transpose(mat2 matrix) { return mat2( matrix[0][0], matrix[1][0], @@ -1495,24 +1509,11 @@ 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 rI=`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; -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 sI=`float czm_unpackDepth(vec4 packedDepth) +`;var aO=`float czm_unpackDepth(vec4 packedDepth) { return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } -`;var aI=`float czm_unpackFloat(vec4 packedFloat) +`;var cO=`float czm_unpackFloat(vec4 packedFloat) { packedFloat = floor(packedFloat * 255.0 + 0.5); float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; @@ -1525,7 +1526,32 @@ float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + float result = sign * exp2(exponent - 23.0) * mantissa; return result; } -`;var cI=`int czm_unpackUint(float packedValue) { +`;var lO=`uint czm_unpackTexture(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return uint(rounded); +} +uint czm_unpackTexture(vec2 packedValue) { +vec2 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +return byte0 | (byte1 << 8); +} +uint czm_unpackTexture(vec3 packedValue) { +vec3 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +uint byte2 = uint(rounded.z); +return byte0 | (byte1 << 8) | (byte2 << 16); +} +uint czm_unpackTexture(vec4 packedValue) { +vec4 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +uint byte2 = uint(rounded.z); +uint byte3 = uint(rounded.w); +return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24); +} +`;var uO=`int czm_unpackUint(float packedValue) { float rounded = czm_round(packedValue * 255.0); return int(rounded); } @@ -1541,7 +1567,7 @@ 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 lI=`float czm_valueTransform(float offset, float scale, float value) { +`;var fO=`float czm_valueTransform(float offset, float scale, float value) { return scale * value + offset; } vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { @@ -1562,7 +1588,7 @@ return matrixCompMult(scale, value) + offset; mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { return matrixCompMult(scale, value) + offset; } -`;var uI=`#ifdef LOG_DEPTH +`;var dO=`#ifdef LOG_DEPTH out float v_depthFromNearPlusOne; #ifdef SHADOW_MAP out vec3 v_logPositionEC; @@ -1592,7 +1618,7 @@ v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; czm_updatePositionDepth(clipCoords); #endif } -`;var fI=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var hO=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { float x = 2.0 * screenCoordinate.x - 1.0; float y = 2.0 * screenCoordinate.y - 1.0; @@ -1634,7 +1660,6 @@ 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; -return eyeCoordinate; #else vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); @@ -1646,7 +1671,7 @@ vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } -`;var dI=`#if !defined(LOG_DEPTH) +`;var mO=`#if !defined(LOG_DEPTH) in float v_WindowZ; #endif void czm_writeDepthClamp() @@ -1655,7 +1680,7 @@ void czm_writeDepthClamp() gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif } -`;var hI=`#ifdef LOG_DEPTH +`;var pO=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET uniform vec2 u_polygonOffset; @@ -1690,7 +1715,7 @@ void czm_writeLogDepth() { czm_writeLogDepth(v_depthFromNearPlusOne); #endif } -`;var mI=`float czm_writeNonPerspective(float value, float w) { +`;var gO=`float czm_writeNonPerspective(float value, float w) { return value * w; } vec2 czm_writeNonPerspective(vec2 value, float w) { @@ -1702,7 +1727,7 @@ return value * w; vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } -`;var pI=`vec3 czm_XYZToRGB(vec3 Yxy) +`;var _O=`vec3 czm_XYZToRGB(vec3 Yxy) { const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, -1.5371, 1.8760, -0.2040, @@ -1713,7 +1738,7 @@ xyz.g = Yxy.r; xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; return XYZ2RGB * xyz; } -`;var Cb={czm_degreesPerRadian:Hv,czm_depthRange:Gv,czm_epsilon1:jv,czm_epsilon2:Wv,czm_epsilon3:qv,czm_epsilon4:Yv,czm_epsilon5:Xv,czm_epsilon6:Kv,czm_epsilon7:$v,czm_infinity:Zv,czm_oneOverPi:Qv,czm_oneOverTwoPi:Jv,czm_passCesium3DTile:eD,czm_passCesium3DTileClassification:tD,czm_passCesium3DTileClassificationIgnoreShow:nD,czm_passClassification:iD,czm_passCompute:oD,czm_passEnvironment:rD,czm_passGlobe:sD,czm_passOpaque:aD,czm_passOverlay:cD,czm_passTerrainClassification:lD,czm_passTranslucent:uD,czm_passVoxels:fD,czm_pi:dD,czm_piOverFour:hD,czm_piOverSix:mD,czm_piOverThree:pD,czm_piOverTwo:_D,czm_radiansPerDegree:gD,czm_sceneMode2D:yD,czm_sceneMode3D:bD,czm_sceneModeColumbusView:xD,czm_sceneModeMorphing:TD,czm_solarRadius:AD,czm_threePiOver2:CD,czm_twoPi:ED,czm_webMercatorMaxLatitude:SD,czm_depthRangeStruct:wD,czm_material:vD,czm_materialInput:DD,czm_modelMaterial:PD,czm_modelVertexOutput:ID,czm_ray:OD,czm_raySegment:RD,czm_shadowParameters:MD,czm_acesTonemapping:LD,czm_alphaWeight:ND,czm_antialias:FD,czm_applyHSBShift:BD,czm_approximateSphericalCoordinates:kD,czm_approximateTanh:UD,czm_backFacing:VD,czm_branchFreeTernary:zD,czm_cascadeColor:HD,czm_cascadeDistance:GD,czm_cascadeMatrix:jD,czm_cascadeWeights:WD,czm_clipPolygons:qD,czm_columbusViewMorph:YD,czm_computeAtmosphereColor:XD,czm_computeGroundAtmosphereScattering:KD,czm_computePosition:$D,czm_computeScattering:ZD,czm_cosineAndSine:QD,czm_decompressTextureCoordinates:JD,czm_depthClamp:eP,czm_eastNorthUpToEyeCoordinates:tP,czm_ellipsoidContainsPoint:nP,czm_ellipsoidTextureCoordinates:iP,czm_equalsEpsilon:oP,czm_eyeOffset:rP,czm_eyeToWindowCoordinates:sP,czm_fastApproximateAtan:aP,czm_fog:cP,czm_gammaCorrect:lP,czm_geodeticSurfaceNormal:uP,czm_getDefaultMaterial:fP,czm_getDynamicAtmosphereLightDirection:dP,czm_getLambertDiffuse:hP,czm_getSpecular:mP,czm_getWaterNoise:pP,czm_HSBToRGB:_P,czm_HSLToRGB:gP,czm_hue:yP,czm_inverseGamma:bP,czm_isEmpty:xP,czm_isFull:TP,czm_latitudeToWebMercatorFraction:AP,czm_linearToSrgb:CP,czm_lineDistance:EP,czm_luminance:SP,czm_maximumComponent:wP,czm_metersPerPixel:vP,czm_modelToWindowCoordinates:DP,czm_multiplyWithColorBalance:PP,czm_nearFarScalar:IP,czm_octDecode:OP,czm_packDepth:RP,czm_pbrLighting:MP,czm_pbrNeutralTonemapping:LP,czm_phong:NP,czm_planeDistance:FP,czm_pointAlongRay:BP,czm_rayEllipsoidIntersectionInterval:kP,czm_raySphereIntersectionInterval:UP,czm_readDepth:VP,czm_readNonPerspective:zP,czm_reverseLogDepth:HP,czm_RGBToHSB:GP,czm_RGBToHSL:jP,czm_RGBToXYZ:WP,czm_round:qP,czm_saturation:YP,czm_shadowDepthCompare:XP,czm_shadowVisibility:KP,czm_signNotZero:$P,czm_sphericalHarmonics:ZP,czm_srgbToLinear:QP,czm_tangentToEyeSpaceMatrix:JP,czm_textureCube:eI,czm_transformPlane:tI,czm_translateRelativeToEye:nI,czm_translucentPhong:iI,czm_transpose:oI,czm_unpackClippingExtents:rI,czm_unpackDepth:sI,czm_unpackFloat:aI,czm_unpackUint:cI,czm_valueTransform:lI,czm_vertexLogDepth:uI,czm_windowToEyeCoordinates:fI,czm_writeDepthClamp:dI,czm_writeLogDepth:hI,czm_writeNonPerspective:mI,czm_XYZToRGB:pI};function BIe(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,` +`;var _x={czm_degreesPerRadian:kD,czm_depthRange:UD,czm_epsilon1:zD,czm_epsilon2:VD,czm_epsilon3:jD,czm_epsilon4:HD,czm_epsilon5:GD,czm_epsilon6:WD,czm_epsilon7:qD,czm_infinity:YD,czm_oneOverPi:XD,czm_oneOverTwoPi:KD,czm_passCesium3DTile:$D,czm_passCesium3DTileClassification:JD,czm_passCesium3DTileClassificationIgnoreShow:ZD,czm_passCesium3DTileEdges:QD,czm_passCesium3DTileEdgesDirect:e1,czm_passCesium3DTilePlanarFillId:t1,czm_passClassification:n1,czm_passCompute:i1,czm_passEnvironment:r1,czm_passGaussianSplats:o1,czm_passGlobe:s1,czm_passOpaque:a1,czm_passOverlay:c1,czm_passTerrainClassification:l1,czm_passTranslucent:u1,czm_passVoxels:f1,czm_pi:d1,czm_piOverFour:h1,czm_piOverSix:m1,czm_piOverThree:p1,czm_piOverTwo:g1,czm_radiansPerDegree:_1,czm_sceneMode2D:y1,czm_sceneMode3D:A1,czm_sceneModeColumbusView:b1,czm_sceneModeMorphing:x1,czm_solarRadius:T1,czm_threePiOver2:E1,czm_twoPi:C1,czm_webMercatorMaxLatitude:v1,czm_depthRangeStruct:S1,czm_material:w1,czm_materialInput:I1,czm_modelMaterial:P1,czm_modelVertexOutput:D1,czm_ray:R1,czm_raySegment:O1,czm_shadowParameters:M1,czm_acesTonemapping:N1,czm_alphaWeight:L1,czm_antialias:F1,czm_applyHSBShift:B1,czm_approximateSphericalCoordinates:k1,czm_approximateTanh:U1,czm_backFacing:z1,czm_branchFreeTernary:V1,czm_cascadeColor:j1,czm_cascadeDistance:H1,czm_cascadeMatrix:G1,czm_cascadeWeights:W1,czm_columbusViewMorph:q1,czm_computeAtmosphereColor:Y1,czm_computeGroundAtmosphereScattering:X1,czm_computePosition:K1,czm_computeScattering:$1,czm_computeTextureTransform:J1,czm_cosineAndSine:Z1,czm_decodeRGB8:Q1,czm_decompressTextureCoordinates:eR,czm_depthClamp:tR,czm_eastNorthUpToEyeCoordinates:nR,czm_ellipsoidContainsPoint:iR,czm_ellipsoidTextureCoordinates:rR,czm_equalsEpsilon:oR,czm_eyeOffset:sR,czm_eyeToCartographicDelta:aR,czm_eyeToWindowCoordinates:cR,czm_fastApproximateAtan:lR,czm_fog:uR,czm_gammaCorrect:fR,czm_geodeticSurfaceNormal:dR,czm_getDefaultMaterial:hR,czm_getDynamicAtmosphereLightDirection:mR,czm_getLambertDiffuse:pR,czm_getSpecular:gR,czm_getWaterNoise:_R,czm_HSBToRGB:yR,czm_HSLToRGB:AR,czm_hue:bR,czm_inverseGamma:xR,czm_isEmpty:TR,czm_isFull:ER,czm_latitudeToWebMercatorFraction:CR,czm_linearToSrgb:vR,czm_lineDistance:SR,czm_luminance:wR,czm_maximumComponent:IR,czm_metersPerPixel:PR,czm_modelToWindowCoordinates:DR,czm_multiplyWithColorBalance:RR,czm_nearFarScalar:OR,czm_octDecode:MR,czm_packDepth:NR,czm_pbrLighting:LR,czm_pbrNeutralTonemapping:FR,czm_phong:BR,czm_planeDistance:kR,czm_pointAlongRay:UR,czm_rayEllipsoidIntersectionInterval:zR,czm_raySphereIntersectionInterval:VR,czm_readDepth:jR,czm_readNonPerspective:HR,czm_reverseLogDepth:GR,czm_RGBToHSB:WR,czm_RGBToHSL:qR,czm_RGBToXYZ:YR,czm_round:XR,czm_saturation:KR,czm_shadowDepthCompare:$R,czm_shadowVisibility:JR,czm_signNotZero:ZR,czm_sphericalHarmonics:QR,czm_srgbToLinear:eO,czm_tangentToEyeSpaceMatrix:tO,czm_textureCube:nO,czm_transformPlane:iO,czm_translateRelativeToEye:rO,czm_translucentPhong:oO,czm_transpose:sO,czm_unpackDepth:aO,czm_unpackFloat:cO,czm_unpackTexture:lO,czm_unpackUint:uO,czm_valueTransform:fO,czm_vertexLogDepth:dO,czm_windowToEyeCoordinates:hO,czm_writeDepthClamp:mO,czm_writeLogDepth:pO,czm_writeNonPerspective:gO,czm_XYZToRGB:_O};function A8e(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 @@ -1723,15 +1748,14 @@ ${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 _I=BIe;function sne(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 ane(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return c(i)||(t=sne(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function cne(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);c(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Hs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=ane(i,Hs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),cne(o,t)}}))}function kIe(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]);if(i.length!==0){let o=`A circular dependency was found in the following built-in functions/structs/constants: -`;for(let r=0;r<i.length;++r)o=`${o+i[r].name} -`;throw new E(o)}}function UIe(e){let t=[],n=ane("main",e,t);cne(n,t),kIe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} -`;return i.replace(n.glslSource,"")}function lne(e,t,n){let i,o,r="",s=e.sources;if(c(s))for(i=0,o=s.length;i<o;++i)r+=` +${n}`,n}var yO=A8e;function vde(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` +`;return i})}function Sde(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=vde(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function wde(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,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&La._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=Sde(i,La._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),wde(r,t)}}))}function b8e(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function x8e(e){let t=[],n=Sde("main",e,t);wde(n,t),b8e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +`;return i.replace(n.glslSource,"")}function Ide(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` #line 0 -${s[i]}`;r=sne(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,b){if(c(a)&&a!==b)throw new E(`inconsistent versions found: ${a} and ${b}`);return a=b,` -`});let l=[];r=r.replace(/#extension.*\n/gm,function(y){return l.push(y),` -`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;c(u)&&(r=Hs.createPickFragmentShaderSource(r,u));let f="",h=l.length;for(i=0;i<h;i++)f+=l[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH +${r[g]}`;i=vde(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return o=m,` +`});let s=[];i=i.replace(/#extension.*\n/gm,function(g){return s.push(g),` +`}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let a=e.pickColorQualifier;l(a)&&(i=La.createPickFragmentShaderSource(i,a));let c="",u=s.length;for(let g=0;g<u;g++)c+=s[g];t&&(c+=` +#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; precision highp int; #else @@ -1739,26 +1763,27 @@ ${s[i]}`;r=sne(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,b){if(c(a) precision mediump int; #define highp mediump #endif +`),n.webgl2&&(c+=`precision highp sampler3D; -`);let p=e.defines;if(c(p))for(i=0,o=p.length;i<o;++i){let y=p[i];y.length!==0&&(f+=`#define ${y} -`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear +`);let f=e.defines;if(l(f))for(let g=0,m=f.length;g<m;++g){let y=f[g];y.length!==0&&(c+=`#define ${y} +`)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear -`),n.floatingPointTexture&&(f+=`#define OES_texture_float +`),n.floatingPointTexture&&(c+=`#define OES_texture_float -`);let g="";e.includeBuiltIns&&(g=UIe(r)),f+=` +`);let d="";e.includeBuiltIns&&(d=x8e(i)),c+=` #line 0 -`;let m=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor; +`;let p=d+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor; -`),f+=g,f+=r,n.webgl2?f=`#version 300 es -${f}`:f=_I(f,t),f}function Hs(e){e=e??W.EMPTY_OBJECT;let t=e.pickColorQualifier;if(c(t)&&t!=="uniform"&&t!=="in")throw new E("options.pickColorQualifier must be 'uniform' or 'in'.");this.defines=c(e.defines)?e.defines.slice(0):[],this.sources=c(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}Hs.prototype.clone=function(){return new Hs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Hs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Hs.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}`};Hs.prototype.createCombinedVertexShader=function(e){return lne(this,!1,e)};Hs.prototype.createCombinedFragmentShader=function(e){return lne(this,!0,e)};Hs._czmBuiltinsAndUniforms={};for(let e in Cb)Cb.hasOwnProperty(e)&&(Hs._czmBuiltinsAndUniforms[e]=Cb[e]);for(let e in Ap)if(Ap.hasOwnProperty(e)){let t=Ap[e];typeof t.getDeclaration=="function"&&(Hs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Hs.createPickVertexShaderSource=function(e){return`${Hs.replaceMain(e,"czm_old_main")} +`),c+=d,c+=i,n.webgl2?c=`#version 300 es +${c}`:c=yO(c,t),c}function La(e){e=e??H.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=e.includeBuiltIns??!0}La.prototype.clone=function(){return new La({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};La.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};La.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,r=this.sources.join(` +`);return`${t}:${n}:${i}:${r}`};La.prototype.createCombinedVertexShader=function(e){return Ide(this,!1,e)};La.prototype.createCombinedFragmentShader=function(e){return Ide(this,!0,e)};La._czmBuiltinsAndUniforms={};for(let e in _x)_x.hasOwnProperty(e)&&(La._czmBuiltinsAndUniforms[e]=_x[e]);for(let e in tg)if(tg.hasOwnProperty(e)){let t=tg[e];typeof t.getDeclaration=="function"&&(La._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}La.createPickVertexShaderSource=function(e){return`${La.replaceMain(e,"czm_old_main")} in vec4 pickColor; out vec4 czm_pickColor; void main() { czm_old_main(); czm_pickColor = pickColor; -}`};Hs.createPickFragmentShaderSource=function(e,t){let n=Hs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +}`};La.createPickFragmentShaderSource=function(e,t){let n=La.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; void main() { czm_old_main(); @@ -1767,9 +1792,1274 @@ void main() } out_FragColor = czm_pickColor; }`;return`${n} -${i}`};function VIe(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 une(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 fne(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(une(e,o))return o}}var zIe=["v_normalEC","v_normal"];Hs.findNormalVarying=function(e){return une(e,"#ifdef HAS_NORMALS")?VIe(e,"HAS_NORMALS")?"v_normalEC":void 0:fne(e,zIe)};var HIe=["v_positionEC"];Hs.findPositionVarying=function(e){return fne(e,HIe)};var He=Hs;function Fd(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Fd.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Fd.prototype.replaceShaderProgram=function(e){return c(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function GIe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Fd.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new He({sources:[t]})),typeof n=="string"&&(n=new He({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=c(i)?GIe(i):"",a=`${o}:${r}:${s}`,l;if(c(this._shaders[a]))l=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new Jt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});l={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=l,this._shaders[a]=l,++this._numberOfShaders}return++l.count,l.shaderProgram};Fd.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(c(r)){t6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Fd.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(c(o))return o.shaderProgram};Fd.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 He({sources:[r]})),typeof s=="string"&&(s=new He({sources:[s]}));let l=this._context,u=r.createCombinedVertexShader(l),f=s.createCombinedFragmentShader(l),h=new Jt({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,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 t6(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];t6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Fd.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];t6(this,n),--this._numberOfShaders}this._shadersToRelease={}};Fd.prototype.releaseShaderProgram=function(e){if(c(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return de(this)};var gI=Fd;function Bd(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Qt}=e,{width:l,height:u}=e;c(n)&&(c(l)||(l=n.videoWidth??n.naturalWidth??n.width),c(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,h=ke.toInternalFormat(i,o,t),p=ke.isCompressedFormat(h);if(!c(l)||!c(u))throw new E("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(T.typeOf.number.greaterThan("width",l,0),l>ut.maximumTextureSize)throw new E(`Width must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(T.typeOf.number.greaterThan("height",u,0),u>ut.maximumTextureSize)throw new E(`Height must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(!ke.validate(i))throw new E("Invalid options.pixelFormat.");if(!p&&!Ue.validate(o))throw new E("Invalid options.pixelDatatype.");if(i===ke.DEPTH_COMPONENT&&o!==Ue.UNSIGNED_SHORT&&o!==Ue.UNSIGNED_INT)throw new E("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ke.DEPTH_STENCIL&&o!==Ue.UNSIGNED_INT_24_8)throw new E("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new E("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new E("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ke.isDepthFormat(i)){if(c(n))throw new E("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new E("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(p){if(!c(n)||!c(n.arrayBufferView))throw new E("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ke.isDXTFormat(h)&&!t.s3tc)throw new E("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ke.isPVRTCFormat(h)&&!t.pvrtc)throw new E("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ke.isASTCFormat(h)&&!t.astc)throw new E("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ke.isETC2Format(h)&&!t.etc)throw new E("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ke.isETC1Format(h)&&!t.etc1)throw new E("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ke.isBC7Format(h)&&!t.bc7)throw new E("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ke.compressedTextureSizeInBytes(h,l,u)!==n.arrayBufferView.byteLength)throw new E("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let g=t._gl,m=p?ke.compressedTextureSizeInBytes(i,l,u):ke.textureSizeInBytes(i,o,l,u);this._id=e.id??jn(),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=l,this._height=u,this._dimensions=new H(l,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,pne(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),c(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),c(n.arrayBufferView)?ke.isCompressedFormat(h)?jIe(this,n):dne(this,n):c(n.framebuffer)?qIe(this,n):hne(this,n),this._initialized=!0):mne(this),g.bindTexture(this._textureTarget,null)}function jIe(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),c(t.mipLevels)){let l=s,u=a;for(let f=0;f<t.mipLevels.length;++f)l=EV(l),u=EV(u),i.compressedTexImage2D(o,f+1,r,l,u,0,t.mipLevels[f])}}function dne(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:l,pixelDatatype:u,flipY:f}=e,h=ke.alignmentInBytes(l,u,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(f&&(p=ke.flipY(p,l,u,s,a)),i.texImage2D(o,0,r,s,a,0,l,Ue.toWebGLConstant(u,n),p),c(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=EV(g),m=EV(m),i.texImage2D(o,y+1,r,g,m,0,l,Ue.toWebGLConstant(u,n),t.mipLevels[y])}}function WIe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:l,pixelDatatype:u}=e,f=ke.alignmentInBytes(l,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=ke.flipY(t,l,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,l,Ue.toWebGLConstant(u,s),t)}function qIe(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 hne(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,Ue.toWebGLConstant(e.pixelDatatype,n),t)}function YIe(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,Ue.toWebGLConstant(e.pixelDatatype,o),t)}function EV(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function mne(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ue.toWebGLConstant(e._pixelDatatype,t),null)}Bd.create=function(e){return new Bd(e)};Bd.fromFramebuffer=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let t=e.context,n=t._gl,{pixelFormat:i=ke.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:l}=e;if(!ke.validate(i))throw new E("Invalid pixelFormat.");if(ke.isDepthFormat(i)||ke.isCompressedFormat(i))throw new E("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(T.defined("options.context",t),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),o+s>n.drawingBufferWidth)throw new E("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>n.drawingBufferHeight)throw new E("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Bd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:c(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Bd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){pne(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 pne(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=li.NEAREST),r.webgl2&&ke.isDepthFormat(s)&&(n=Yt.NEAREST,i=li.NEAREST);let l=r._gl,u=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,e._texture),l.texParameteri(u,l.TEXTURE_MIN_FILTER,n),l.texParameteri(u,l.TEXTURE_MAG_FILTER,i),l.texParameteri(u,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(u,l.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&l.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(u,null)}Bd.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),ke.isDepthFormat(this._pixelFormat))throw new E("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new E("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),T.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),T.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:l,height:u}=i;c(i.videoWidth)&&c(i.videoHeight)?(l=i.videoWidth,u=i.videoHeight):c(i.naturalWidth)&&c(i.naturalHeight)&&(l=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&l===this._width&&u===this._height?(c(i.arrayBufferView)?dne(this,i):hne(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),mne(this)),this._initialized=!0),f||(c(i.arrayBufferView)?WIe(this,i.arrayBufferView,t,n,l,u):YIe(this,i,t,n)),s.bindTexture(a,null)};Bd.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height,ke.isDepthFormat(this._pixelFormat))throw new E("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Ue.FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new E("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ke.isCompressedFormat(this._pixelFormat))throw new E("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),T.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),T.typeOf.number.lessThanOrEquals("yOffset + height",t+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};Bd.prototype.generateMipmap=function(e){if(e=e??Cf.DONT_CARE,ke.isDepthFormat(this._pixelFormat))throw new E("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new E("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!O.isPowerOfTwo(this._width))throw new E("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!O.isPowerOfTwo(this._height))throw new E("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!Cf.validate(e))throw new E("hint is invalid.");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)};Bd.prototype.isDestroyed=function(){return!1};Bd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),de(this)};var Rt=Bd;function Eb(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Eb.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Eb.prototype.getTexture=function(e){let t=this._textures[e];if(c(t))return delete this._texturesToRelease[e],++t.count,t.texture};Eb.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};Eb.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={}};Eb.prototype.isDestroyed=function(){return!1};Eb.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return de(this)};var yI=Eb;function Ef(e){this.planes=e??[]}var bI=[new d,new d,new d];d.clone(d.UNIT_X,bI[0]);d.clone(d.UNIT_Y,bI[1]);d.clone(d.UNIT_Z,bI[2]);var qg=new d,XIe=new d,_ne=new sn(new d(1,0,0),0);Ef.fromBoundingSphere=function(e,t){if(!c(e))throw new E("boundingSphere is required.");c(t)||(t=new Ef);let n=bI.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 l=bI[a],u=i[s],f=i[s+1];c(u)||(u=i[s]=new se),c(f)||(f=i[s+1]=new se),d.multiplyByScalar(l,-r,qg),d.add(o,qg,qg),u.x=l.x,u.y=l.y,u.z=l.z,u.w=-d.dot(l,qg),d.multiplyByScalar(l,r,qg),d.add(o,qg,qg),f.x=-l.x,f.y=-l.y,f.z=-l.z,f.w=-d.dot(d.negate(l,XIe),qg),s+=2}return t};Ef.prototype.computeVisibility=function(e){if(!c(e))throw new E("boundingVolume is required.");let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(sn.fromCartesian4(t[i],_ne));if(r===Wt.OUTSIDE)return Wt.OUTSIDE;r===Wt.INTERSECTING&&(n=!0)}return n?Wt.INTERSECTING:Wt.INSIDE};Ef.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!c(e))throw new E("boundingVolume is required.");if(!c(t))throw new E("parentPlaneMask is required.");if(t===Ef.MASK_OUTSIDE||t===Ef.MASK_INSIDE)return t;let n=Ef.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))continue;let a=e.intersectPlane(sn.fromCartesian4(i[o],_ne));if(a===Wt.OUTSIDE)return Ef.MASK_OUTSIDE;a===Wt.INTERSECTING&&(n|=s)}return n};Ef.MASK_OUTSIDE=4294967295;Ef.MASK_INSIDE=0;Ef.MASK_INDETERMINATE=2147483647;var _s=Ef;function mm(e){e=e??W.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new _s,this._orthographicMatrix=new B}function gne(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new E("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new E("right must be greater than left.");if(e.bottom>e.top)throw new E("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new E("near must be greater than zero and less than 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=B.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(mm.prototype,{projectionMatrix:{get:function(){return gne(this),this._orthographicMatrix}}});var KIe=new d,$Ie=new d,ZIe=new d,n6=new d;mm.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new E("position is required.");if(!c(t))throw new E("direction is required.");if(!c(n))throw new E("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,KIe);d.normalize(f,f);let h=$Ie;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=ZIe;d.multiplyByScalar(f,a,p),d.add(h,p,p);let g=i[0];return c(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-d.dot(f,p),d.multiplyByScalar(f,s,p),d.add(h,p,p),g=i[1],c(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-d.dot(d.negate(f,n6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),g=i[2],c(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),g=i[3],c(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-d.dot(d.negate(n,n6),p),g=i[4],c(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),g=i[5],c(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-d.dot(d.negate(t,n6),p),this._cullingVolume};mm.prototype.getPixelDimensions=function(e,t,n,i,o){if(gne(this),!c(e)||!c(t))throw new E("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new E("drawingBufferWidth must be greater than zero.");if(t<=0)throw new E("drawingBufferHeight must be greater than zero.");if(!c(n))throw new E("distance is required.");if(!c(i))throw new E("pixelRatio is required.");if(i<=0)throw new E("pixelRatio must be greater than zero.");if(!c(o))throw new E("A result object is required.");let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,l=i*s/t;return o.x=a,o.y=l,o};mm.prototype.clone=function(e){return c(e)||(e=new mm),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};mm.prototype.equals=function(e){return c(e)&&e instanceof mm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};mm.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof mm&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var jo=mm;function Ol(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new jo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}Ol.packedLength=4;Ol.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Ol.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Ol),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Yg(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new E("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new E("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new E("near must be greater than zero and less than 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(Ol.prototype,{projectionMatrix:{get:function(){return Yg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Yg(this),this._offCenterFrustum}}});Ol.prototype.computeCullingVolume=function(e,t,n){return Yg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ol.prototype.getPixelDimensions=function(e,t,n,i,o){return Yg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Ol.prototype.clone=function(e){return c(e)||(e=new Ol),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};Ol.prototype.equals=function(e){return!c(e)||!(e instanceof Ol)?!1:(Yg(this),Yg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ol.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof Ol)?!1:(Yg(this),Yg(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var on=Ol;var i6={};function QIe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var JIe=32.184,eOe=2451545;function Bne(e,t){t=Q.addSeconds(e,JIe,t);let n=Q.totalDays(t)-eOe;return t=Q.addSeconds(t,QIe(n),t),t}var SV=new Q(2451545,0,Wn.TAI),tOe=1e3,Sf=O.RADIANS_PER_DEGREE,pu=O.RADIANS_PER_ARCSECOND,Na=14959787e4,yne=new J;function kne(e,t,n,i,o,r,s){if(n<0&&(n=-n,o+=O.PI),n<0||n>O.PI)throw new E("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let a=e*(1-t),l=i-o,u=o,f=iOe(r-i,t);if(nOe(t,0)==="Hyperbolic"&&Math.abs(O.negativePiToPi(f))>=Math.acos(-1/t))throw new E("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");aOe(l,n,u,yne);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g;if(y<=O.Epsilon10)throw new E("elements cannot be converted to cartesian");let b=p/y;return c(s)?(s.x=b*g,s.y=b*m,s.z=0):s=new d(b*g,b*m,0),J.multiplyByVector(yne,s,s)}function nOe(e,t){if(e<0)throw new E("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function iOe(e,t){if(t<0||t>=1)throw new E("eccentricity out of range.");let n=rOe(e,t);return sOe(n,t)}var bne=50,oOe=O.EPSILON8;function rOe(e,t){if(t<0||t>=1)throw new E("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.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<bne&&Math.abs(o-i)>oOe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}if(r>=bne)throw new E("Kepler equation did not converge");return o=i+n*O.TWO_PI,o}function sOe(e,t){if(t<0||t>=1)throw new E("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=O.zeroToTwoPi(r),e<0&&(r-=O.TWO_PI),r+=n*O.TWO_PI,r}function aOe(e,t,n,i){if(t<0||t>O.PI)throw new E("inclination out of range");let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),l=Math.cos(n),u=Math.sin(n);return c(i)?(i[0]=l*o-u*r*s,i[1]=u*o+l*r*s,i[2]=r*a,i[3]=-l*r-u*o*s,i[4]=-u*r+l*o*s,i[5]=o*a,i[6]=u*a,i[7]=-l*a,i[8]=s):i=new J(l*o-u*r*s,-l*r-u*o*s,u*a,u*o+l*r*s,-u*r+l*o*s,-l*a,r*a,o*a,s),i}var cOe=1.0000010178*Na,lOe=100.46645683*Sf,uOe=129597742283429e-5*pu,xne=16002,Tne=21863,Ane=32004,Cne=10931,Ene=14529,Sne=16368,wne=15318,vne=32794,fOe=64*1e-7*Na,dOe=-152*1e-7*Na,hOe=62*1e-7*Na,mOe=-8*1e-7*Na,pOe=32*1e-7*Na,_Oe=-41*1e-7*Na,gOe=19*1e-7*Na,yOe=-11*1e-7*Na,bOe=-150*1e-7*Na,xOe=-46*1e-7*Na,TOe=68*1e-7*Na,AOe=54*1e-7*Na,COe=14*1e-7*Na,EOe=24*1e-7*Na,SOe=-28*1e-7*Na,wOe=22*1e-7*Na,Dne=10,Pne=16002,Ine=21863,One=10931,Rne=1473,Mne=32004,Lne=4387,Nne=73,vOe=-325*1e-7,DOe=-322*1e-7,POe=-79*1e-7,IOe=232*1e-7,OOe=-52*1e-7,ROe=97*1e-7,MOe=55*1e-7,LOe=-41*1e-7,NOe=-105*1e-7,FOe=-137*1e-7,BOe=258*1e-7,kOe=35*1e-7,UOe=-116*1e-7,VOe=-88*1e-7,zOe=-112*1e-7,HOe=-80*1e-7,hC=new Q(0,0,Wn.TAI);function GOe(e,t){Bne(e,hC);let i=(hC.dayNumber-SV.dayNumber+(hC.secondsOfDay-SV.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=cOe+fOe*Math.cos(xne*o)+bOe*Math.sin(xne*o)+dOe*Math.cos(Tne*o)+xOe*Math.sin(Tne*o)+hOe*Math.cos(Ane*o)+TOe*Math.sin(Ane*o)+mOe*Math.cos(Cne*o)+AOe*Math.sin(Cne*o)+pOe*Math.cos(Ene*o)+COe*Math.sin(Ene*o)+_Oe*Math.cos(Sne*o)+EOe*Math.sin(Sne*o)+gOe*Math.cos(wne*o)+SOe*Math.sin(wne*o)+yOe*Math.cos(vne*o)+wOe*Math.sin(vne*o),s=lOe+uOe*i+vOe*Math.cos(Dne*o)+NOe*Math.sin(Dne*o)+DOe*Math.cos(Pne*o)+FOe*Math.sin(Pne*o)+POe*Math.cos(Ine*o)+BOe*Math.sin(Ine*o)+IOe*Math.cos(One*o)+kOe*Math.sin(One*o)+OOe*Math.cos(Rne*o)+UOe*Math.sin(Rne*o)+ROe*Math.cos(Mne*o)+VOe*Math.sin(Mne*o)+MOe*Math.cos(Lne*o)+zOe*Math.sin(Lne*o)+LOe*Math.cos(Nne*o)+HOe*Math.sin(Nne*o),a=.0167086342-.0004203654*i,l=102.93734808*Sf+11612.3529*pu*i,u=469.97289*pu*i,f=174.87317577*Sf-8679.27034*pu*i;return kne(r,a,u,l,f,s,t)}function Une(e,t){Bne(e,hC);let i=(hC.dayNumber-SV.dayNumber+(hC.secondsOfDay-SV.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,l=.055545526-16e-9*i,u=5.15668983*Sf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Sf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Sf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Sf,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,x=297.85019547*Sf+pu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),A=93.27209062*Sf+pu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),C=134.96340251*Sf+pu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Sf+pu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Sf-pu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),P=2*x,M=4*x,R=6*x,L=2*C,F=3*C,_=4*C,w=2*A;a+=3400.4*Math.cos(P)-635.6*Math.cos(P-C)-235.6*Math.cos(C)+218.1*Math.cos(P-S)+181*Math.cos(P+C),l+=.014216*Math.cos(P-C)+.008551*Math.cos(P-L)-.001383*Math.cos(C)+.001356*Math.cos(P+C)-.001147*Math.cos(M-F)-914e-6*Math.cos(M-L)+869e-6*Math.cos(P-S-C)-627e-6*Math.cos(P)-394e-6*Math.cos(M-_)+282e-6*Math.cos(P-S-L)-279e-6*Math.cos(x-C)-236e-6*Math.cos(L)+231e-6*Math.cos(M)+229e-6*Math.cos(R-_)-201e-6*Math.cos(L-w),f+=486.26*Math.cos(P-w)-40.13*Math.cos(P)+37.51*Math.cos(w)+25.73*Math.cos(L-w)+19.97*Math.cos(P-S-w),p+=-55609*Math.sin(P-C)-34711*Math.sin(P-L)-9792*Math.sin(C)+9385*Math.sin(M-F)+7505*Math.sin(M-L)+5318*Math.sin(P+C)+3484*Math.sin(M-_)-3417*Math.sin(P-S-C)-2530*Math.sin(R-_)-2376*Math.sin(P)-2075*Math.sin(P-F)-1883*Math.sin(L)-1736*Math.sin(R-5*C)+1626*Math.sin(S)-1370*Math.sin(R-F),m+=-5392*Math.sin(P-w)-540*Math.sin(S)-441*Math.sin(P)+423*Math.sin(w)-288*Math.sin(L-w),b+=-3332.9*Math.sin(P)+1197.4*Math.sin(P-C)-662.5*Math.sin(S)+396.3*Math.sin(C)-218*Math.sin(P-S);let D=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(P-w+v)*i+.614*Math.cos(P-w-v)*i-.0297*Math.cos(D)*o-.0335*Math.cos(v)*o+.0012*Math.cos(P-w+D)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(D)*r;let N=2.116*Math.sin(v)*i-.111*Math.sin(P-w-v)*i-.0015*Math.sin(v)*o;p+=N,b+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(P-w+v)*i+1.12*Math.sin(P-v)*i-1.06*Math.sin(w-v)*i+.66*Math.sin(D)*o+.371*Math.sin(v)*o-.035*Math.sin(P-w+D)*o-.015*Math.sin(P-w+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(D)*r,a*=tOe;let k=u+f*pu,z=h+p*pu,V=y+b*pu,j=g+m*pu;return kne(a,l,k,z,j,V,t)}var Fne=.012300034,jOe=Fne/(Fne+1)*-1;function WOe(e,t){return t=Une(e,t),d.multiplyByScalar(t,jOe,t)}var Vne=new J(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),xI=new d;i6.computeSunPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),c(t)||(t=new d),xI=GOe(e,xI),t=d.negate(xI,t),WOe(e,xI),d.subtract(t,xI,t),J.multiplyByVector(Vne,t,t),t};i6.computeMoonPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),t=Une(e,t),J.multiplyByVector(Vne,t,t),t};var Xg=i6;var wV={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};wV.getMorphTime=function(e){return e===wV.SCENE3D?1:e===wV.MORPHING?void 0:0};var oe=Object.freeze(wV);function qOe(e){e=e??W.EMPTY_OBJECT,this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??2}var Rp=qOe;function mC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=B.clone(B.IDENTITY),this._viewportTransformation=B.clone(B.IDENTITY),this._model=B.clone(B.IDENTITY),this._view=B.clone(B.IDENTITY),this._inverseView=B.clone(B.IDENTITY),this._projection=B.clone(B.IDENTITY),this._infiniteProjection=B.clone(B.IDENTITY),this._entireFrustum=new H,this._currentFrustum=new H,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=J.clone(B.IDENTITY),this._view3DDirty=!0,this._view3D=new B,this._inverseView3DDirty=!0,this._inverseView3D=new B,this._inverseModelDirty=!0,this._inverseModel=new B,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new J,this._viewRotation=new J,this._inverseViewRotation=new J,this._viewRotation3D=new J,this._inverseViewRotation3D=new J,this._inverseProjectionDirty=!0,this._inverseProjection=new B,this._modelViewDirty=!0,this._modelView=new B,this._modelView3DDirty=!0,this._modelView3D=new B,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new B,this._inverseModelViewDirty=!0,this._inverseModelView=new B,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new B,this._viewProjectionDirty=!0,this._viewProjection=new B,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new B,this._modelViewProjectionDirty=!0,this._modelViewProjection=new B,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new B,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new B,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new B,this._normalDirty=!0,this._normal=new J,this._normal3DDirty=!0,this._normal3D=new J,this._inverseNormalDirty=!0,this._inverseNormal=new J,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new J,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Hn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new H,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new H,this._modelToEnu=new B,this._enuToModel=new B,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new G,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 d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,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(mC.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 Hne(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Hne(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){B.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,B.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,B.getMatrix3(this.inverseModel,e),J.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return r6(this),this._view3D}},viewRotation:{get:function(){return r6(this),this._viewRotation}},viewRotation3D:{get:function(){return r6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Wne(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Wne(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return i1e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return o1e(this),this._modelView}},modelView3D:{get:function(){return r1e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return f1e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return s1e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return a1e(this),this._inverseModelView3D}},viewProjection:{get:function(){return c1e(this),this._viewProjection}},inverseViewProjection:{get:function(){return l1e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return u1e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return d1e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return h1e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return m1e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return p1e(this),this._normal}},normal3D:{get:function(){return _1e(this),this._normal3D}},inverseNormal:{get:function(){return g1e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return y1e(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 jne(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return jne(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 this._ellipsoid??ie.default}}});function YOe(e,t){B.clone(t,e._view),B.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 XOe(e,t){B.clone(t,e._inverseView),B.getMatrix3(t,e._inverseViewRotation)}function KOe(e,t){B.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function $Oe(e,t){B.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var zne=new d,ZOe=new B;function QOe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(c(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,zne)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,zne)),e._encodedCameraPositionMCDirty=!0,!c(i))return;e._eyeEllipsoidNormalEC=J.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ot.eastNorthUpToFixedFrame(i,n,ZOe);e._enuToModel=B.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=B.inverseTransformation(e._enuToModel,e._modelToEnu),O.equalsEpsilon(n._radii.x,n._radii.y,O.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var o6=new J,JOe=new he;function e1e(e,t){Ot.computeIcrfToCentralBodyFixedMatrix(t.time,o6);let n=Xg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);J.multiplyByVector(o6,n,n),d.normalize(n,e._sunDirectionWC),n=J.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=Xg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),J.multiplyByVector(o6,n,n),J.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,JOe);i.project(r,e._sunPositionColumbusView)}mC.prototype.updateCamera=function(e){YOe(this,e.viewMatrix),XOe(this,e.inverseViewMatrix),QOe(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 on};mC.prototype.updateFrustum=function(e){KOe(this,e.projectionMatrix),c(e.infiniteProjectionMatrix)&&$Oe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=O.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;c(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};mC.prototype.updatePass=function(e){this._pass=e};var t1e=[],n1e=new Rp;mC.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),e1e(this,e);let n=e.light??n1e;n instanceof Rp?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=J.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=c(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??t1e,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let l=e.atmosphere;c(l)&&(this._atmosphereHsbShift=d.fromElements(l.hueShift,l.saturationShift,l.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=l.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(l.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=l.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(l.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=l.mieScaleHeight,this._atmosphereMieAnisotropy=l.mieAnisotropy,this._atmosphereDynamicLighting=l.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ot.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;c(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,G.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Hne(e){if(e._viewportDirty){let t=e._viewport;B.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),B.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function i1e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?B.inverse(e._projection,e._inverseProjection):B.clone(B.ZERO,e._inverseProjection))}function o1e(e){e._modelViewDirty&&(e._modelViewDirty=!1,B.multiplyTransformation(e._view,e._model,e._modelView))}function r1e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,B.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function s1e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,B.inverse(e.modelView,e._inverseModelView))}function a1e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,B.inverse(e.modelView3D,e._inverseModelView3D))}function c1e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,B.multiply(e._projection,e._view,e._viewProjection))}function l1e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,B.inverse(e.viewProjection,e._inverseViewProjection))}function u1e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,B.multiply(e._projection,e.modelView,e._modelViewProjection))}function f1e(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 d1e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,B.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function h1e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,B.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function m1e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,B.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function p1e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;B.getMatrix3(e.inverseModelView,t),J.transpose(t,t)}}function _1e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;B.getMatrix3(e.inverseModelView3D,t),J.transpose(t,t)}}function g1e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;B.getMatrix3(e.modelView,t),J.transpose(t,t)}}function y1e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;B.getMatrix3(e.modelView3D,t),J.transpose(t,t)}}var Gne=new d;function jne(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,B.multiplyByPoint(e.inverseModel,e._cameraPosition,Gne),Hn.fromCartesian(Gne,e._encodedCameraPositionMC))}var b1e=new d,x1e=new d,T1e=new d,A1e=new d,C1e=new he,E1e=new d,S1e=new B;function w1e(e,t,n,i,o,r,s,a){let l=b1e;l.x=e.y,l.y=e.z,l.z=e.x;let u=x1e;u.x=n.y,u.y=n.z,u.z=n.x;let f=T1e;f.x=i.y,f.y=i.z,f.z=i.x;let h=A1e;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(l.z=o*.5);let p=s.unproject(l,C1e);p.longitude=O.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=O.clamp(p.latitude,-O.PI_OVER_TWO,O.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,E1e),y=Ot.eastNorthUpToFixedFrame(m,g,S1e);return B.multiplyByPointAsVector(y,u,u),B.multiplyByPointAsVector(y,f,f),B.multiplyByPointAsVector(y,h,h),c(a)||(a=new B),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,m),a[13]=-d.dot(f,m),a[14]=d.dot(h,m),a[15]=1,a}function r6(e){e._view3DDirty&&(e._mode===oe.SCENE3D?B.clone(e._view,e._view3D):w1e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),B.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Wne(e){e._inverseView3DDirty&&(B.inverseTransformation(e.view3D,e._inverseView3D),B.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var TI=mC;function wf(e,t){T.defined("canvas",e);let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let s=c(n)?n(e,o):v1e(e,o,i),l=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=l,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new gI(this),this._textureCache=new yI;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),ut._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ut._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),ut._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),ut._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),ut._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),ut._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),ut._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),ut._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),ut._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ut._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),ut._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);ut._minimumAliasedLineWidth=f[0],ut._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);ut._minimumAliasedPointSize=h[0],ut._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);ut._maximumViewportWidth=p[0],ut._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);ut._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);ut._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!wr(u,["OES_standard_derivatives"]),this._blendMinmax=!!wr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!wr(u,["OES_element_index_uint"]),this._depthTexture=!!wr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!wr(u,["EXT_frag_depth"]),this._debugShaders=wr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!wr(u,["OES_texture_float"]),this._textureHalfFloat=!!wr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!wr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!wr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!wr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!wr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!wr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!wr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!wr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!wr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!wr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!wr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!wr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!wr(u,["EXT_texture_compression_bptc"]),Il.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?wr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,ut._maximumTextureFilterAnisotropy=c(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,A,C,S,v,P,M,R,L;if(l){let D=this;b=function(){return D._gl.createVertexArray()},x=function(I){D._gl.bindVertexArray(I)},A=function(I){D._gl.deleteVertexArray(I)},C=function(I,N,k,z,V){u.drawElementsInstanced(I,N,k,z,V)},S=function(I,N,k,z){u.drawArraysInstanced(I,N,k,z)},v=function(I,N){u.vertexAttribDivisor(I,N)},P=function(I){u.drawBuffers(I)}}else M=wr(u,["OES_vertex_array_object"]),c(M)&&(b=function(){return M.createVertexArrayOES()},x=function(D){M.bindVertexArrayOES(D)},A=function(D){M.deleteVertexArrayOES(D)}),R=wr(u,["ANGLE_instanced_arrays"]),c(R)&&(C=function(D,I,N,k,z){R.drawElementsInstancedANGLE(D,I,N,k,z)},S=function(D,I,N,k){R.drawArraysInstancedANGLE(D,I,N,k)},v=function(D,I){R.vertexAttribDivisorANGLE(D,I)}),L=wr(u,["WEBGL_draw_buffers"]),c(L)&&(P=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=A,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=P,this._vertexArrayObject=!!M,this._instancedArrays=!!R,this._drawBuffers=!!L,ut._maximumDrawBuffers=this.drawBuffers?u.getParameter(ne.MAX_DRAW_BUFFERS):1,ut._maximumColorAttachments=this.drawBuffers?u.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new G(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new TI,_=new lc(this),w=Ve.fromCache();this._defaultPassState=_,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=w,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D<ut._maximumVertexAttributes;D++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,w,_)}function v1e(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(!c(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function D1e(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 P1e(e,t,n,i){let o=`${D1e(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function I1e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(P1e(e,t,n,i))}function O1e(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 R1e(e,t){if(!c(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,O1e(e,o,t))}return i}function wr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var M1e={};Object.defineProperties(wf.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=R1e(this._originalGLContext,e?I1e:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Rt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,0])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Rt({context:this,pixelFormat:ke.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 Rt({context:this,pixelFormat:ke.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 Go({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 M1e}}});function L1e(e){if(e.validateFramebuffer){let t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let i;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";break}throw new E(i)}}}function qne(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var s6;typeof WebGLRenderingContext<"u"&&(s6=[ne.BACK]);function a6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=s6;if(c(t))t._bind(),L1e(e),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var N1e=new ei;wf.prototype.clear=function(e,t){e=e??N1e,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;c(o)&&(G.equals(this._clearColor,o)||(G.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),c(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),c(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;qne(this,a,t,!0);let l=e.framebuffer??t.framebuffer;a6(this,l),n.clear(i)};function F1e(e,t,n,i,o){if(c(t)&&o.depthTest&&o.depthTest.enabled&&!t.hasDepthAttachment)throw new E("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");a6(e,t),qne(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function B1e(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,l=t.instanceCount;if(!Me.validate(o))throw new E("drawCommand.primitiveType is required and must be valid.");if(T.defined("drawCommand.vertexArray",r),T.typeOf.number.greaterThanOrEquals("drawCommand.offset",s,0),c(a)&&T.typeOf.number.greaterThanOrEquals("drawCommand.count",a,0),T.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new E("Instanced arrays extension is not supported");e._us.model=t._modelMatrix??B.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;c(u)?(s=s*u.bytesPerIndex,c(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,l===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,l)):(c(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,l===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,l)),r._unBind()}wf.prototype.draw=function(e,t,n,i){T.defined("drawCommand",e),T.defined("drawCommand.shaderProgram",e._shaderProgram),t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,F1e(this,o,t,n,r),B1e(this,e,n,i)};wf.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=s6;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)};wf.prototype.readPixels=function(e){let t=this._gl;e=e??W.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??t.drawingBufferWidth,r=e.height??t.drawingBufferHeight,s=e.framebuffer;T.typeOf.number.greaterThan("readState.width",o,0),T.typeOf.number.greaterThan("readState.height",r,0);let a=Ue.UNSIGNED_BYTE;c(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let l=ke.createTypedArray(ke.RGBA,a,o,r);return a6(this,s),t.readPixels(n,i,o,r,ke.RGBA,Ue.toWebGLConstant(a,this),l),l};var Yne={position:0,textureCoordinates:1};wf.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!c(e)){let t=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ti.fromGeometry({context:this,geometry:t,attributeLocations:Yne,bufferUsage:Be.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};wf.prototype.createViewportQuadCommand=function(e,t){return t=t??W.EMPTY_OBJECT,new Qe({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:Jt.fromCache({context:this,vertexShaderSource:mb,fragmentShaderSource:e,attributeLocations:Yne}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};wf.prototype.getObjectByPickColor=function(e){return T.defined("pickColor",e),this._pickObjects[e.toRgba()]};function c6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(c6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});c6.prototype.destroy=function(){delete this._pickObjects[this.key]};wf.prototype.createPickId=function(e){T.defined("object",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 c6(this._pickObjects,t,G.fromRgba(t))};wf.prototype.isDestroyed=function(){return!1};wf.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];c(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(),de(this)};var AI=wf;function pC(e){e=e??W.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:l}=e;if(T.defined("options.context",t),T.defined("options.width",n),T.defined("options.height",i),this._width=n,this._height=i,c(o)!==c(r))throw new E("Both color renderbuffer and texture attachments must be provided.");if(c(s)!==c(a))throw new E("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Ur({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:l}),this._colorFramebuffer=new Ur({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:l})}pC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};pC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};pC.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),c(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)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),de(this)};var CI=pC;var Rl={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===Rl.RGBA4||e===Rl.RGBA8||e===Rl.RGBA16F||e===Rl.RGBA32F||e===Rl.RGB5_A1||e===Rl.RGB565||e===Rl.DEPTH_COMPONENT16||e===Rl.STENCIL_INDEX8||e===Rl.DEPTH_STENCIL||e===Rl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?Rl.RGBA32F:e===ne.HALF_FLOAT_OES?Rl.RGBA16F:Rl.RGBA8}},uc=Object.freeze(Rl);function EI(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let n=e.context._gl,i=ut.maximumRenderbufferSize,o=e.format??uc.RGBA4,r=c(e.width)?e.width:n.drawingBufferWidth,s=c(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;if(!uc.validate(o))throw new E("Invalid format.");if(T.typeOf.number.greaterThan("width",r,0),r>i)throw new E(`Width must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);if(T.typeOf.number.greaterThan("height",s,0),s>i)throw new E(`Height must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);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(EI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});EI.prototype._getRenderbuffer=function(){return this._renderbuffer};EI.prototype.isDestroyed=function(){return!1};EI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),de(this)};var _u=EI;function Ss(e){if(e=e??W.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,!this._color&&!this._depth&&!this._depthStencil)throw new E("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new E("Cannot have both a depth and depth-stencil attachment.");this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=c(i)&&this._pixelDatatype!==i||c(o)&&this._pixelFormat!==o,l=n===1?c(this._framebuffer):c(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!l||this._color&&!c(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(!c(t)||!c(n))throw new E("width and height must be defined.");if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ke.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 Rt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Qt.NEAREST}),this._numSamples>1){let a=uc.getColorFormat(o);this._colorRenderbuffers[s]=new _u({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:uc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:uc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Qt.NEAREST}):this._depthRenderbuffer=new _u({context:e,width:t,height:n,format:uc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new CI({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 Ur({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");return this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){if(t=t??0,this._createColorAttachments)throw new E("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){if(t=t??0,this._createColorAttachments)throw new E("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new E("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new E("createDepthAttachments must be false if setDepthStencilTexture is called.");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&&c(i)&&!i.isDestroyed()&&i.destroy(),c(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&c(o)&&!o.isDestroyed()&&o.destroy(),c(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()),c(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),c(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()),c(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),c(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=Ss;function k1e(e,t,n){if(T.defined("context",e),T.defined("urls",t),Object.values(Go.FaceName).some(r=>!c(t[r])))throw new E("urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[we.createIfNeeded(t.positiveX).fetchImage(i),we.createIfNeeded(t.negativeX).fetchImage(i),we.createIfNeeded(t.positiveY).fetchImage(i),we.createIfNeeded(t.negativeY).fetchImage(i),we.createIfNeeded(t.positiveZ).fetchImage(i),we.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Go({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var SI=k1e;var Sb={VERTEX:0,FRAGMENT:1,BOTH:2};Sb.includesVertexShader=function(e){return T.typeOf.number("destination",e),e===Sb.VERTEX||e===Sb.BOTH};Sb.includesFragmentShader=function(e){return T.typeOf.number("destination",e),e===Sb.FRAGMENT||e===Sb.BOTH};var ge=Object.freeze(Sb);function l6(e){this.name=e,this.fields=[]}l6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};l6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var wI=l6;function u6(e){this.signature=e,this.body=[]}u6.prototype.addLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new E(`Expected lines to be a string or an array of strings, actual value was ${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}`)};u6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var vI=u6;function Hc(){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(Hc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Hc.prototype.addDefine=function(e,t,n){T.typeOf.string("identifier",e),n=n??ge.BOTH;let i=e;c(t)&&(i+=` ${t.toString()}`),ge.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Hc.prototype.addStruct=function(e,t,n){T.typeOf.string("structId",e),T.typeOf.string("structName",t),T.typeOf.number("destination",n),this._structs[e]=new wI(t),ge.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Hc.prototype.addStructField=function(e,t,n){T.typeOf.string("structId",e),T.typeOf.string("type",t),T.typeOf.string("identifier",n),this._structs[e].addField(t,n)};Hc.prototype.addFunction=function(e,t,n){T.typeOf.string("functionName",e),T.typeOf.string("signature",t),T.typeOf.number("destination",n),this._functions[e]=new vI(t),ge.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Hc.prototype.addFunctionLines=function(e,t){if(T.typeOf.string("functionName",e),typeof t!="string"&&!Array.isArray(t))throw new E(`Expected lines to be a string or an array of strings, actual value was ${t}`);this._functions[e].addLines(t)};Hc.prototype.addUniform=function(e,t,n){T.typeOf.string("type",e),T.typeOf.string("identifier",t),n=n??ge.BOTH;let i=`uniform ${e} ${t};`;ge.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Hc.prototype.setPositionAttribute=function(e,t){if(T.typeOf.string("type",e),T.typeOf.string("identifier",t),c(this._positionAttributeLine))throw new E("setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()");return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Hc.prototype.addAttribute=function(e,t){T.typeOf.string("type",e),T.typeOf.string("identifier",t);let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=V1e(e),i};Hc.prototype.addVarying=function(e,t,n){T.typeOf.string("type",e),T.typeOf.string("identifier",t),n=c(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Hc.prototype.addVertexLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new E(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Hc.prototype.addFragmentLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new E(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Hc.prototype.buildShaderProgram=function(e){T.typeOf.object("context",e);let t=c(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=U1e(this),i=z1e(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` -`),r=new He({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new He({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Jt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Hc.prototype.clone=function(){return je(this,!0)};function U1e(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 V1e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function z1e(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 wb=Hc;function DI({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 f6({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new DI({x:n,y:n,width:e-2*n,height:t-2*n})}f6.prototype.pack=function(e,{width:t,height:n}){T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.greaterThanOrEquals("image.width",t,1),T.typeOf.number.greaterThanOrEquals("image.height",n,1);let i=this._findNode(this._root,{width:t,height:n});if(c(i))return i.index=e,i};f6.prototype._findNode=function(e,{width:t,height:n}){if(c(e)){if(!c(e.childNode1)&&!c(e.childNode2)){if(c(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 DI({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new DI({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new DI({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new DI({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 _C=f6;var Xne=16;function Ml(e){e=e??W.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new H(Xne,Xne);T.typeOf.number.greaterThanOrEquals("options.borderWidthInPixels",t,0),T.typeOf.number.greaterThan("options.initialSize.x",n.x,0),T.typeOf.number.greaterThan("options.initialSize.y",n.y,0),this._pixelFormat=e.pixelFormat??ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Ml.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 c(this._texture)?this._texture.sizeInBytes:0}}});Ml.prototype.computeTextureCoordinates=function(e,t){T.typeOf.number.greaterThanOrEquals("index",e,0);let n=this._texture,i=this._rectangles[e];if(c(t)||(t=new Ke),!c(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,l=i.x,u=i.y,f=this._subRegions.get(e);if(c(f)){let h=this._rectangles[f];l+=h.x,u+=h.y}return t.x=l/o,t.y=u/r,t.width=s/o,t.height=a/r,t};Ml.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Rt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,l=s._textureTarget,u=this._texture,f=new Ur({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(l,s._texture),f._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;g<h.length;++g){let m=i[g],y=h[g];if(!c(m)||!c(y)||c(p.get(g)))continue;let{x:b,y:x,width:A,height:C}=m;a.copyTexSubImage2D(l,0,b,x,y.x,y.y,A,C)}return a.bindTexture(l,null),s._initialized=!0,f._unBind(),f.destroy(),s};Ml.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,l=this._subRegions,u=i.map((A,C)=>new Kne({index:C,image:A})).filter((A,C)=>c(A.image)&&!c(l.get(C))),f=0,h=0,p=0;for(let A=t;A<o.length;++A){let{width:C,height:S}=o[A].image;f=Math.max(f,C),h=Math.max(h,S),p+=C*S,u.push(o[A])}s=Math.max(f,s),a=Math.max(h,a),e.webgl2||(s=O.nextPowerOfTwo(s),a=O.nextPowerOfTwo(a));let g=p,m=1;for(;g/s/a>=1;)m*=2,s>a?a*=m:s*=m;u.sort(({image:A},{image:C})=>C.height*C.width-A.height*A.width);let y=new Array(this._nextIndex);for(let A of this._subRegions.keys())c(l.get(A))&&(y[A]=i[A]);let b,x=!1;for(;!x;){b=new _C({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:C,image:S}=u[A];if(!c(S))continue;let v=b.pack(C,S);if(!c(v)){s>a?a*=2:s*=2;break}y[C]=v.rectangle}x=A===u.length}this._texturePacker=b,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=jn()};Ml.prototype.getImageIndex=function(e){return T.typeOf.string("id",e),this._indexById.get(e)};Ml.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}),c(n)&&n(e)}catch(s){if(c(i)){i(s);return}}};function Kne({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Ml.prototype._addImage=function(e,t){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.defined("image",t),new Promise((n,i)=>{this._imagesToAddQueue.push(new Kne({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Ml.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(!c(a)){try{this._resize(e,n)}catch(l){i=l,c(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(c(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];c(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};Ml.prototype.update=function(e){if(!c(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Rt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new _C({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function H1e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof we)&&(e=we.createIfNeeded(e).fetchImage()),e}Ml.prototype.addImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t);let n=this._indexPromiseById.get(e);if(c(n))return n;let i=this._nextIndex++;return this._indexById.set(e,i),n=(async()=>(t=await H1e(t,e),T.defined("image",t),this.isDestroyed()||!c(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Ml.prototype.addImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t);let n=this._indexById.get(e);if(!c(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(l=>l===-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 T.typeOf.number.lessThanOrEquals("subRegion.x",t.x,s.width),T.typeOf.number.lessThanOrEquals("subRegion.x + subRegion.width",t.x+t.width,s.width),T.typeOf.number.lessThanOrEquals("subRegion.y",t.y,s.height),T.typeOf.number.lessThanOrEquals("subRegion.y + subRegion.height",t.y+t.height,s.height),o})};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{c(e)&&e(-1)}),de(this)};var vb=Ml;function Gs(e,t,n,i){if(T.defined("context",e),!t||t.length===0)throw new E("At least one attribute is required.");let o=Gs._verifyAttributes(t);n=n??0;let r=[],s={},a,l,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}l=p.usage,a=s[l],c(a)||(a=s[l]=[]),a.push(p)}function f(h,p){return $.getSizeInBytes(p.componentDatatype)-$.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(l in s)if(s.hasOwnProperty(l)){a=s[l],a.sort(f);let h=Gs._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Gs._createArrayViews(a,h)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Gs._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??$.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Be.STATIC_DRAW};if(t.push(r),r.componentsPerAttribute!==1&&r.componentsPerAttribute!==2&&r.componentsPerAttribute!==3&&r.componentsPerAttribute!==4)throw new E("attribute.componentsPerAttribute must be in the range [1, 4].");let s=r.componentDatatype;if(!$.validate(s))throw new E("Attribute must have a valid componentDatatype or not specify it.");if(!Be.validate(r.usage))throw new E("Attribute must have a valid usage or not specify it.")}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;if(n[r])throw new E(`Index ${r} is used by more than one attribute.`);n[r]=!0}return t};Gs._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*$.getSizeInBytes(a.componentDatatype)}let i=n>0?$.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Gs._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/$.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*$.getSizeInBytes(a)}return n};Gs.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];Gs._resize(o,this._size),Gs._appendWriters(this.writers,o)}d6(this)};Gs._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(c(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let l=0;l<a;++l)r[l]=s[l]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=$.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var G1e=[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 l=i*n;t[l]=o,t[l+1]=r,t[l+2]=s,t[l+3]=a,e.needsCommit=!0}}];Gs._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]=G1e[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Gs.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=j1e(this,i)||t;if(t||!c(this.va)){d6(this);let s=this.va=[],a=O.SIXTY_FOUR_KILOBYTES-4,l=c(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<l;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*a);Gs._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),s.push({va:new ti({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==l-1?a:this._size%a)})}}};function j1e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=yt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Gs._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})}};Gs.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new E("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new E("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)W1e(n[i],e,t)};function W1e(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)}}Gs.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function d6(e){let t=e.va;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Gs.prototype.isDestroyed=function(){return!1};Gs.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 d6(this),de(this)};var Mp=Gs;function Kg(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new pe,this.setValue(e)}Object.defineProperties(Kg.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Kg.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Kg.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=c(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))}};Kg.prototype.equals=function(e){return this===e||e instanceof Kg&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Kg.prototype.valueOf=function(){return this._value};Kg.prototype.toString=function(){return String(this._value)};var Kn=Kg;function q1e(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];c(a)&&(a(),this[n]=void 0),r!==void 0&&(!c(r)||!c(r.getValue))&&c(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),c(r)&&c(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function Y1e(e){return new Kn(e)}function X1e(e,t,n){return q1e(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??Y1e)}var fe=X1e;function PI(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(PI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),image:fe("image"),scale:fe("scale"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),color:fe("color"),rotation:fe("rotation"),alignedAxis:fe("alignedAxis"),sizeInMeters:fe("sizeInMeters"),width:fe("width"),height:fe("height"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),imageSubRegion:fe("imageSubRegion"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});PI.prototype.clone=function(e){return c(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 PI(this)};PI.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var fc=PI;function Db(){this._array=[],this._hash={}}Object.defineProperties(Db.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Db.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new E("key is required to be a string or number.");return c(this._hash[e])};Db.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new E("key is required to be a string or number.");let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Db.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new E("key is required to be a string or number.");return this._hash[e]};Db.prototype.remove=function(e){if(c(e)&&typeof e!="string"&&typeof e!="number")throw new E("key is required to be a string or number.");let t=this._hash[e],n=c(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Db.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Et=Db;function gu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(gu.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}}});gu.packedLength=2;gu.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,t[n++]=e.near,t[n]=e.far,t};gu.unpack=function(e,t,n){if(!c(e))throw new E("array is required");return t=t??0,c(n)||(n=new gu),n.near=e[t++],n.far=e[t],n};gu.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.far===t.far};gu.clone=function(e,t){if(c(e))return c(t)||(t=new gu),t.near=e.near,t.far=e.far,t};gu.prototype.clone=function(e){return gu.clone(this,e)};gu.prototype.equals=function(e){return gu.equals(this,e)};var Mt=gu;function vf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}vf.clone=function(e,t){if(c(e))return c(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new vf(e.near,e.nearValue,e.far,e.farValue)};vf.packedLength=4;vf.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};vf.unpack=function(e,t,n){if(!c(e))throw new E("array is required");return t=t??0,c(n)||(n=new vf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};vf.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};vf.prototype.clone=function(e){return vf.clone(this,e)};vf.prototype.equals=function(e){return vf.equals(this,e)};var Bt=vf;var Pb={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,CLIP_TO_GROUND:7},We=Object.freeze(Pb);function Df(e){return e===Pb.CLAMP_TO_GROUND||e===Pb.CLAMP_TO_3D_TILE||e===Pb.CLAMP_TO_TERRAIN}function gC(e){return e===Pb.RELATIVE_TO_GROUND||e===Pb.RELATIVE_TO_3D_TILE||e===Pb.RELATIVE_TO_TERRAIN}var K1e={CENTER:0,LEFT:1,RIGHT:-1},bi=Object.freeze(K1e);var $1e={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Fn=Object.freeze($1e);var Z1e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),lt=Z1e;function kd(){E.throwInstantiationError()}Object.defineProperties(kd.prototype,{isConstant:{get:E.throwInstantiationError},definitionChanged:{get:E.throwInstantiationError}});kd.prototype.getValue=E.throwInstantiationError;kd.prototype.equals=E.throwInstantiationError;kd.equals=function(e,t){return e===t||c(e)&&e.equals(t)};kd.arrayEquals=function(e,t){if(e===t)return!0;if(!c(e)||!c(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!kd.equals(e[i],t[i]))return!1;return!0};kd.isConstant=function(e){return!c(e)||e.isConstant};kd.getValueOrUndefined=function(e,t,n){return c(e)?e.getValue(t,n):void 0};kd.getValueOrDefault=function(e,t,n,i){return c(e)?e.getValue(t,i)??n:n};kd.getValueOrClonedDefault=function(e,t,n,i){let o;return c(e)&&(o=e.getValue(t,i)),c(o)||(o=n.clone(o)),o};var X=kd;var Q1e={LEFT:-1,NONE:0,RIGHT:1},Vr=Object.freeze(Q1e);var J1e=G.WHITE,eRe=d.ZERO,tRe=We.NONE,nRe=H.ZERO,iRe=1,oRe=0,rRe=d.ZERO,sRe=bi.CENTER,aRe=Fn.CENTER,cRe=!1,lRe=Vr.NONE,uRe=new d,fRe=new G,dRe=new d,hRe=new H,mRe=new Bt,pRe=new Bt,_Re=new Bt,gRe=new Ke,yRe=new Mt;function $ne(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function $g(e,t){if(!c(e))throw new E("entityCluster is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener($g.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}$g.prototype.update=function(e){if(!c(e))throw new E("time is required.");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,l,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),h;if(f&&(h=X.getValueOrUndefined(s._position,e,uRe),l=X.getValueOrUndefined(a._image,e),f=c(h)&&c(l)),!f){h6(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),c(u)||(u=n.getBillboard(s),u.id=s,r.billboard=u,r.textureValue=void 0),u.show=f,r.textureValue!==l&&(u.image=l,r.textureValue=l),u.position=h,u.color=X.getValueOrDefault(a._color,e,J1e,fRe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,eRe,dRe),u.heightReference=X.getValueOrDefault(a._heightReference,e,tRe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,nRe,hRe),u.scale=X.getValueOrDefault(a._scale,e,iRe),u.rotation=X.getValueOrDefault(a._rotation,e,oRe),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,rRe),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,sRe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,aRe),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,mRe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,pRe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,_Re),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,cRe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,yRe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,lRe);let p=X.getValueOrUndefined(a._imageSubRegion,e,gRe);c(p)&&u.setImageSubRegion(u.image,p)}return!0};$g.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.billboard))return lt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=d.clone(i.position,t.center);else{if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};$g.prototype.isDestroyed=function(){return!1};$g.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($g.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return de(this)};$g.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],c(r._billboard)&&c(r._position)&&s.set(r.id,new $ne(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._billboard)&&c(r._position)?s.contains(r.id)||s.set(r.id,new $ne(r)):(h6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],h6(s.get(r.id),r,a),s.remove(r.id)};function h6(e,t,n){c(e)&&(e.billboard=void 0,n.removeBillboard(t))}var II=$g;var bRe=new d;function pm(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}pm.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new pm({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};pm.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundindBox",e),new pm({minimum:e.minimum,maximum:e.maximum})};pm.packedLength=2*d.packedLength+1;pm.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=e._offsetAttribute??-1,t};var Qne=new d,Jne=new d,Zne={minimum:Qne,maximum:Jne,offsetAttribute:void 0};pm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Qne),o=d.unpack(e,t+d.packedLength,Jne),r=e[t+d.packedLength*2];return c(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Zne.offsetAttribute=r===-1?void 0:r,new pm(Zne))};pm.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new fn,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 ve({componentDatatype:$.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=d.subtract(n,t,bRe),a=d.magnitude(s)*.5;if(c(e._offsetAttribute)){let l=r.length,u=e._offsetAttribute===Zt.NONE?0:1,f=new Uint8Array(l/3).fill(u);i.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ct({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var Ud=pm;function yC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([G.floatToByte(e),G.floatToByte(t),G.floatToByte(n),G.floatToByte(i)])}Object.defineProperties(yC.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});yC.fromColor=function(e){if(!c(e))throw new E("color is required.");return new yC(e.red,e.green,e.blue,e.alpha)};yC.toValue=function(e,t){if(!c(e))throw new E("color is required.");return c(t)?e.toBytes(t):new Uint8Array(e.toBytes())};yC.equals=function(e,t){return e===t||c(e)&&c(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 Gt=yC;function OI(e,t){if(e=e??0,t=t??Number.MAX_VALUE,t<=e)throw new E("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(OI.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});OI.fromDistanceDisplayCondition=function(e){if(!c(e))throw new E("distanceDisplayCondition is required.");if(e.far<=e.near)throw new E("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new OI(e.near,e.far)};OI.toValue=function(e,t){if(!c(e))throw new E("distanceDisplayCondition is required.");return c(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=OI;function xRe(e){if(e=e??W.EMPTY_OBJECT,!c(e.geometry))throw new E("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var St=xRe;function er(e){e=e??W.EMPTY_OBJECT,this.start=c(e.start)?Q.clone(e.start):new Q,this.stop=c(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(er.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var bC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};er.fromIso8601=function(e,t){T.typeOf.object("options",e),T.typeOf.string("options.iso8601",e.iso8601);let n=e.iso8601.split("/");if(n.length!==2)throw new E("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return c(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(bC.start=i,bC.stop=o,bC.isStartIncluded=r,bC.isStopIncluded=s,bC.data=a,new er(bC))};er.toIso8601=function(e,t){return T.typeOf.object("timeInterval",e),`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};er.clone=function(e,t){if(c(e))return c(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new er(e)};er.equals=function(e,t,n){return e===t||c(e)&&c(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||c(n)&&n(e.data,t.data)))};er.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||c(e)&&c(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||c(i)&&i(e.data,t.data)))};er.intersect=function(e,t,n,i){if(T.typeOf.object("left",e),!c(t))return er.clone(er.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,l=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),u=!l&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!l&&!u)return er.clone(er.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Q.lessThan(r,a);return c(n)||(n=new er),n.start=l?s:o,n.isStartIncluded=f&&p||!Q.equals(s,o)&&(l&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?h:h&&g||!Q.equals(a,r)&&g,n.data=c(i)?i(e.data,t.data):e.data,n};er.contains=function(e,t){if(T.typeOf.object("timeInterval",e),T.typeOf.object("julianDate",t),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};er.prototype.clone=function(e){return er.clone(this,e)};er.prototype.equals=function(e,t){return er.equals(this,e,t)};er.prototype.equalsEpsilon=function(e,t,n){return er.equalsEpsilon(this,e,t,n)};er.prototype.toString=function(){return er.toIso8601(this)};er.EMPTY=Object.freeze(new er({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var En=er;var eie=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),tie=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),TRe=Object.freeze(new En({start:eie,stop:tie})),ARe={MINIMUM_VALUE:eie,MAXIMUM_VALUE:tie,MAXIMUM_INTERVAL:TRe},Ge=ARe;function RI(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(RI.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});RI.fromCartesian3=function(e){return T.defined("offset",e),new RI(e.x,e.y,e.z)};RI.toValue=function(e,t){return T.defined("offset",e),c(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var eo=RI;function vV(e){e=e??!0,this.value=vV.toValue(e)}Object.defineProperties(vV.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});vV.toValue=function(e,t){if(!c(e))throw new E("show is required.");return c(t)?(t[0]=e,t):new Uint8Array([e])};var bn=vV;var MI=`in vec3 v_positionEC; +${i}`};function T8e(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function Pde(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Dde(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Pde(e,r))return r}}var E8e=["v_normalEC","v_normal"];La.findNormalVarying=function(e){return Pde(e,"#ifdef HAS_NORMALS")?T8e(e,"HAS_NORMALS")?"v_normalEC":void 0:Dde(e,E8e)};var C8e=["v_positionEC"];La.findPositionVarying=function(e){return Dde(e,C8e)};var Ye=La;function qh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(qh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});qh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function v8e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}qh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ye({sources:[t]})),typeof n=="string"&&(n=new Ye({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?v8e(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,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};qh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){DX(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};qh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};qh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Ye({sources:[o]})),typeof s=="string"&&(s=new Ye({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function DX(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];DX(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}qh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];DX(this,n),--this._numberOfShaders}this._shadersToRelease={}};qh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var AO=qh;function Dd(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,d=Ke.toInternalFormat(i,r,t),p=Ke.isCompressedFormat(d),g=t._gl,m=p?Ke.compressedTextureSizeInBytes(i,c,u):Ke.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,Nde(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)?Ke.isCompressedFormat(d)?S8e(this,n):Rde(this,n):l(n.framebuffer)?I8e(this,n):Ode(this,n),this._initialized=!0):Mde(this),g.bindTexture(this._textureTarget,null)}function S8e(e,t){let i=e._context._gl,r=e._textureTarget,o=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(r,0,o,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=s6(c),u=s6(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Rde(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=Ke.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=Ke.flipY(p,c,u,s,a)),i.texImage2D(r,0,o,s,a,0,c,ze.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=s6(g),m=s6(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function w8e(e,t,n,i,r,o){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=Ke.alignmentInBytes(c,u,r);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=Ke.flipY(t,c,u,r,o)),a.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ze.toWebGLConstant(u,s),t)}function I8e(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 Ode(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,ze.toWebGLConstant(e.pixelDatatype,n),t)}function P8e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,r),t)}function s6(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Mde(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}Dd.create=function(e){return new Dd(e)};Dd.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=Ke.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new Dd({context:t,width:o,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:s}})};Object.defineProperties(Dd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Nde(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 Nde(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),o.webgl2&&Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Dd.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Rde(this,i):Ode(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Mde(this)),this._initialized=!0),f||(l(i.arrayBufferView)?w8e(this,i.arrayBufferView,t,n,c,u):P8e(this,i,t,n)),s.bindTexture(a,null)};Dd.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??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,r,o),s.bindTexture(a,null),this._initialized=!0};Dd.prototype.generateMipmap=function(e){e=e??Pd.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)};Dd.prototype.isDestroyed=function(){return!1};Dd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};Dd.defaultColor=z.WHITE;var Dt=Dd;function yx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(yx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});yx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};yx.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};yx.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={}};yx.prototype.isDestroyed=function(){return!1};yx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var bO=yx;function Rd(e){this.planes=e??[]}var xO=[new h,new h,new h];h.clone(h.UNIT_X,xO[0]);h.clone(h.UNIT_Y,xO[1]);h.clone(h.UNIT_Z,xO[2]);var Ny=new h,D8e=new h,Lde=new sn(new h(1,0,0),0);function Fde(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Rd.fromBoundingSphere=function(e,t){l(t)||(t=new Rd);let n=xO.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=xO[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,Ny),h.add(r,Ny,Ny),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Ny),h.multiplyByScalar(c,o,Ny),h.add(r,Ny,Ny),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,D8e),Ny),s+=2}return t};Rd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(Fde(t[i],Lde));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};Rd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Rd.MASK_OUTSIDE||t===Rd.MASK_INSIDE)return t;let n=Rd.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(Fde(i[r],Lde));if(a===$t.OUTSIDE)return Rd.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};Rd.MASK_OUTSIDE=4294967295;Rd.MASK_INSIDE=0;Rd.MASK_INDETERMINATE=2147483647;var ta=Rd;function Lp(e){e=e??H.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ta,this._orthographicMatrix=new N}function Bde(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=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Lp.prototype,{projectionMatrix:{get:function(){return Bde(this),this._orthographicMatrix}}});var R8e=new h,O8e=new h,M8e=new h,RX=new h;Lp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,R8e);h.normalize(f,f);let d=O8e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=M8e;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,RX),p),h.multiplyByScalar(n,o,p),h.add(d,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=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,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=-h.dot(h.negate(n,RX),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=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.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=-h.dot(h.negate(t,RX),p),this._cullingVolume};Lp.prototype.getPixelDimensions=function(e,t,n,i,r){Bde(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Lp.prototype.clone=function(e){return l(e)||(e=new Lp),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};Lp.prototype.equals=function(e){return l(e)&&e instanceof Lp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Lp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Lp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var ys=Lp;function Ou(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new ys,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}Ou.packedLength=4;Ou.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Ou.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ou),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Ly(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(Ou.prototype,{projectionMatrix:{get:function(){return Ly(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Ly(this),this._offCenterFrustum}}});Ou.prototype.computeCullingVolume=function(e,t,n){return Ly(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ou.prototype.getPixelDimensions=function(e,t,n,i,r){return Ly(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Ou.prototype.clone=function(e){return l(e)||(e=new Ou),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};Ou.prototype.equals=function(e){return!l(e)||!(e instanceof Ou)?!1:(Ly(this),Ly(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ou.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Ou)?!1:(Ly(this),Ly(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var gn=Ou;var OX={};function N8e(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var L8e=32.184,F8e=2451545;function nhe(e,t){t=K.addSeconds(e,L8e,t);let n=K.totalDays(t)-F8e;return t=K.addSeconds(t,N8e(n),t),t}var a6=new K(2451545,0,si.TAI),B8e=1e3,Od=D.RADIANS_PER_DEGREE,vf=D.RADIANS_PER_ARCSECOND,Pc=14959787e4,kde=new $;function ihe(e,t,n,i,r,o,s){n<0&&(n=-n,r+=D.PI);let a=e*(1-t),c=i-r,u=r,f=U8e(o-i,t),d=k8e(t,0);G8e(c,n,u,kde);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(s)?(s.x=A*g,s.y=A*m,s.z=0):s=new h(A*g,A*m,0),$.multiplyByVector(kde,s,s)}function k8e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function U8e(e,t){let n=j8e(e,t);return H8e(n,t)}var z8e=50,V8e=D.EPSILON8;function j8e(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<z8e&&Math.abs(r-i)>V8e;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*D.TWO_PI,r}function H8e(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=D.zeroToTwoPi(o),e<0&&(o-=D.TWO_PI),o+=n*D.TWO_PI,o}function G8e(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var W8e=1.0000010178*Pc,q8e=100.46645683*Od,Y8e=129597742283429e-5*vf,Ude=16002,zde=21863,Vde=32004,jde=10931,Hde=14529,Gde=16368,Wde=15318,qde=32794,X8e=64*1e-7*Pc,K8e=-152*1e-7*Pc,$8e=62*1e-7*Pc,J8e=-8*1e-7*Pc,Z8e=32*1e-7*Pc,Q8e=-41*1e-7*Pc,eje=19*1e-7*Pc,tje=-11*1e-7*Pc,nje=-150*1e-7*Pc,ije=-46*1e-7*Pc,rje=68*1e-7*Pc,oje=54*1e-7*Pc,sje=14*1e-7*Pc,aje=24*1e-7*Pc,cje=-28*1e-7*Pc,lje=22*1e-7*Pc,Yde=10,Xde=16002,Kde=21863,$de=10931,Jde=1473,Zde=32004,Qde=4387,ehe=73,uje=-325*1e-7,fje=-322*1e-7,dje=-79*1e-7,hje=232*1e-7,mje=-52*1e-7,pje=97*1e-7,gje=55*1e-7,_je=-41*1e-7,yje=-105*1e-7,Aje=-137*1e-7,bje=258*1e-7,xje=35*1e-7,Tje=-116*1e-7,Eje=-88*1e-7,Cje=-112*1e-7,vje=-80*1e-7,Av=new K(0,0,si.TAI);function Sje(e,t){nhe(e,Av);let i=(Av.dayNumber-a6.dayNumber+(Av.secondsOfDay-a6.secondsOfDay)/kn.SECONDS_PER_DAY)/(kn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=W8e+X8e*Math.cos(Ude*r)+nje*Math.sin(Ude*r)+K8e*Math.cos(zde*r)+ije*Math.sin(zde*r)+$8e*Math.cos(Vde*r)+rje*Math.sin(Vde*r)+J8e*Math.cos(jde*r)+oje*Math.sin(jde*r)+Z8e*Math.cos(Hde*r)+sje*Math.sin(Hde*r)+Q8e*Math.cos(Gde*r)+aje*Math.sin(Gde*r)+eje*Math.cos(Wde*r)+cje*Math.sin(Wde*r)+tje*Math.cos(qde*r)+lje*Math.sin(qde*r),s=q8e+Y8e*i+uje*Math.cos(Yde*r)+yje*Math.sin(Yde*r)+fje*Math.cos(Xde*r)+Aje*Math.sin(Xde*r)+dje*Math.cos(Kde*r)+bje*Math.sin(Kde*r)+hje*Math.cos($de*r)+xje*Math.sin($de*r)+mje*Math.cos(Jde*r)+Tje*Math.sin(Jde*r)+pje*Math.cos(Zde*r)+Eje*Math.sin(Zde*r)+gje*Math.cos(Qde*r)+Cje*Math.sin(Qde*r)+_je*Math.cos(ehe*r)+vje*Math.sin(ehe*r),a=.0167086342-.0004203654*i,c=102.93734808*Od+11612.3529*vf*i,u=469.97289*vf*i,f=174.87317577*Od-8679.27034*vf*i;return ihe(o,a,u,c,f,s,t)}function rhe(e,t){nhe(e,Av);let i=(Av.dayNumber-a6.dayNumber+(Av.secondsOfDay-a6.secondsOfDay)/kn.SECONDS_PER_DAY)/kn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Od,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Od,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Od,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*Od,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*Od+vf*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*Od+vf*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*Od+vf*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*Od+vf*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*Od-vf*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),S=2*b,I=4*b,R=6*b,O=2*T,L=3*T,_=4*T,C=2*x;a+=3400.4*Math.cos(S)-635.6*Math.cos(S-T)-235.6*Math.cos(T)+218.1*Math.cos(S-E)+181*Math.cos(S+T),c+=.014216*Math.cos(S-T)+.008551*Math.cos(S-O)-.001383*Math.cos(T)+.001356*Math.cos(S+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-O)+869e-6*Math.cos(S-E-T)-627e-6*Math.cos(S)-394e-6*Math.cos(I-_)+282e-6*Math.cos(S-E-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-C),f+=486.26*Math.cos(S-C)-40.13*Math.cos(S)+37.51*Math.cos(C)+25.73*Math.cos(O-C)+19.97*Math.cos(S-E-C),p+=-55609*Math.sin(S-T)-34711*Math.sin(S-O)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-O)+5318*Math.sin(S+T)+3484*Math.sin(I-_)-3417*Math.sin(S-E-T)-2530*Math.sin(R-_)-2376*Math.sin(S)-2075*Math.sin(S-L)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(E)-1370*Math.sin(R-L),m+=-5392*Math.sin(S-C)-540*Math.sin(E)-441*Math.sin(S)+423*Math.sin(C)-288*Math.sin(O-C),A+=-3332.9*Math.sin(S)+1197.4*Math.sin(S-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(S-E);let w=2*v,P=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(S-C+v)*i+.614*Math.cos(S-C-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(S-C+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(P)*o+4e-5*Math.cos(w)*o;let M=2.116*Math.sin(v)*i-.111*Math.sin(S-C-v)*i-.0015*Math.sin(v)*r;p+=M,A+=M,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(S-C+v)*i+1.12*Math.sin(S-v)*i-1.06*Math.sin(C-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(S-C+w)*r-.015*Math.sin(S-C+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(P)*o-9e-4*Math.sin(w)*o,a*=B8e;let F=u+f*vf,V=d+p*vf,B=y+A*vf,j=g+m*vf;return ihe(a,c,F,V,j,B,t)}var the=.012300034,wje=the/(the+1)*-1;function Ije(e,t){return t=rhe(e,t),h.multiplyByScalar(t,wje,t)}var ohe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),TO=new h;OX.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),TO=Sje(e,TO),t=h.negate(TO,t),Ije(e,TO),h.subtract(t,TO,t),$.multiplyByVector(ohe,t,t),t};OX.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=rhe(e,t),$.multiplyByVector(ohe,t,t),t};var Fy=OX;var EO={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};EO.getMorphTime=function(e){return e===EO.SCENE3D?1:e===EO.MORPHING?void 0:0};Object.freeze(EO);var re=EO;function Pje(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var fg=Pje;function bv(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=N.clone(N.IDENTITY),this._viewportTransformation=N.clone(N.IDENTITY),this._model=N.clone(N.IDENTITY),this._view=N.clone(N.IDENTITY),this._inverseView=N.clone(N.IDENTITY),this._projection=N.clone(N.IDENTITY),this._infiniteProjection=N.clone(N.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(N.IDENTITY),this._view3DDirty=!0,this._view3D=new N,this._inverseView3DDirty=!0,this._inverseView3D=new N,this._inverseModelDirty=!0,this._inverseModel=new N,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new N,this._modelViewDirty=!0,this._modelView=new N,this._modelView3DDirty=!0,this._modelView3D=new N,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new N,this._inverseModelViewDirty=!0,this._inverseModelView=new N,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new N,this._viewProjectionDirty=!0,this._viewProjection=new N,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new N,this._modelViewProjectionDirty=!0,this._modelViewProjection=new N,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new N,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new N,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new N,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 Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new U,this._eyeToEnu=new $,this._modelToEnu=new N,this._enuToModel=new N,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,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 h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,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(bv.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.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 che(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return che(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){N.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,N.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,N.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return NX(this),this._view3D}},viewRotation:{get:function(){return NX(this),this._viewRotation}},viewRotation3D:{get:function(){return NX(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return fhe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return fhe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return zje(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return Vje(this),this._modelView}},modelView3D:{get:function(){return jje(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Xje(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return Hje(this),this._inverseModelView}},inverseModelView3D:{get:function(){return Gje(this),this._inverseModelView3D}},viewProjection:{get:function(){return Wje(this),this._viewProjection}},inverseViewProjection:{get:function(){return qje(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return Yje(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Kje(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return $je(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Jje(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Zje(this),this._normal}},normal3D:{get:function(){return Qje(this),this._normal3D}},inverseNormal:{get:function(){return e6e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return t6e(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}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},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 uhe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return uhe(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 this._ellipsoid??ee.default}}});function Dje(e,t){N.clone(t,e._view),N.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 Rje(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function Oje(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function Mje(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var she=new h,Nje=new N,ahe=new $;function Lje(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeCartographic=h.fromElements(r.longitude,r.latitude,r.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,she)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,she)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,Nje);e._enuToModel=N.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=N.inverseTransformation(e._enuToModel,e._modelToEnu);let s=N.getRotation(o,ahe),a=$.multiply(e._viewRotation,s,ahe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var MX=new $,Fje=new he;function Bje(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,MX);let n=Fy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(MX,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Fy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(MX,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,Fje);i.project(o,e._sunPositionColumbusView)}bv.prototype.updateCamera=function(e){Dje(this,e.viewMatrix),Rje(this,e.inverseViewMatrix),Lje(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof gn};bv.prototype.updateFrustum=function(e){Oje(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&Mje(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.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};bv.prototype.updatePass=function(e){this._pass=e};var kje=[],Uje=new fg;bv.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===re.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),Bje(this,e);let n=e.light??Uje;n instanceof fg?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??kje,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=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.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=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function che(e){if(e._viewportDirty){let t=e._viewport;N.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),N.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function zje(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?N.inverse(e._projection,e._inverseProjection):N.clone(N.ZERO,e._inverseProjection))}function Vje(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function jje(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function Hje(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function Gje(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function Wje(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function qje(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function Yje(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function Xje(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 Kje(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function $je(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function Jje(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function Zje(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function Qje(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function e6e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;N.getMatrix3(e.modelView,t),$.transpose(t,t)}}function t6e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;N.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var lhe=new h;function uhe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,lhe),Sn.fromCartesian(lhe,e._encodedCameraPositionMC))}var n6e=new h,i6e=new h,r6e=new h,o6e=new h,s6e=new he,a6e=new h,c6e=new N;function l6e(e,t,n,i,r,o,s,a){let c=n6e;c.x=e.y,c.y=e.z,c.z=e.x;let u=i6e;u.x=n.y,u.y=n.z,u.z=n.x;let f=r6e;f.x=i.y,f.y=i.z,f.z=i.x;let d=o6e;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,s6e);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,a6e),y=At.eastNorthUpToFixedFrame(m,g,c6e);return N.multiplyByPointAsVector(y,u,u),N.multiplyByPointAsVector(y,f,f),N.multiplyByPointAsVector(y,d,d),l(a)||(a=new N),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function NX(e){e._view3DDirty&&(e._mode===re.SCENE3D?N.clone(e._view,e._view3D):l6e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),N.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function fhe(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var CO=bv;function Mu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0,transparentDefaultTexture:s=!1}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):u6e(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new AO(this),this._textureCache=new bO,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),kt._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),kt._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),kt._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),kt._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),kt._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),kt._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),kt._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),kt._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),kt._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),kt._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),kt._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),kt._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);kt._minimumAliasedLineWidth=d[0],kt._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);kt._minimumAliasedPointSize=p[0],kt._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);kt._maximumViewportWidth=g[0],kt._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);kt._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);kt._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!is(f,["OES_standard_derivatives"]),this._blendMinmax=!!is(f,["EXT_blend_minmax"]),this._elementIndexUint=!!is(f,["OES_element_index_uint"]),this._depthTexture=!!is(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!is(f,["EXT_frag_depth"]),this._debugShaders=is(f,["WEBGL_debug_shaders"]),this._textureFloat=!!is(f,["OES_texture_float"]),this._textureHalfFloat=!!is(f,["OES_texture_half_float"]),this._textureFloatLinear=!!is(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!is(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!is(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!is(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!is(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!is(f,["EXT_color_buffer_half_float"]),this._s3tc=!!is(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!is(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!is(f,["WEBGL_compressed_texture_astc"]),this._etc=!!is(f,["WEBG_compressed_texture_etc"]),this._etc1=!!is(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!is(f,["EXT_texture_compression_bptc"]),Ru.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?is(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,kt._maximumTextureFilterAnisotropy=l(A)?f.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,E,v,S,I,R,O,L;if(u){let P=this;b=function(){return P._gl.createVertexArray()},x=function(M){P._gl.bindVertexArray(M)},T=function(M){P._gl.deleteVertexArray(M)},E=function(M,F,V,B,j){f.drawElementsInstanced(M,F,V,B,j)},v=function(M,F,V,B){f.drawArraysInstanced(M,F,V,B)},S=function(M,F){f.vertexAttribDivisor(M,F)},I=function(M){f.drawBuffers(M)}}else R=is(f,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(P){R.bindVertexArrayOES(P)},T=function(P){R.deleteVertexArrayOES(P)}),O=is(f,["ANGLE_instanced_arrays"]),l(O)&&(E=function(P,M,F,V,B){O.drawElementsInstancedANGLE(P,M,F,V,B)},v=function(P,M,F,V){O.drawArraysInstancedANGLE(P,M,F,V)},S=function(P,M){O.vertexAttribDivisorANGLE(P,M)}),L=is(f,["WEBGL_draw_buffers"]),l(L)&&(I=function(P){L.drawBuffersWEBGL(P)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=v,this.glVertexAttribDivisor=S,this.glDrawBuffers=I,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,kt._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,kt._maximumColorAttachments=this.drawBuffers?f.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let _=new CO,C=new sc(this),w=Ge.fromCache();this._defaultPassState=C,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=_,this._currentRenderState=w,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let P=0;P<kt._maximumVertexAttributes;P++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o,transparentDefaultTexture:s},this.cache={},Ge.apply(f,w,C)}function u6e(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function f6e(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 d6e(e,t,n,i){let r=`${f6e(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function h6e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(d6e(e,t,n,i))}function m6e(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 p6e(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,m6e(e,r,t))}return i}function is(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var g6e={};Object.defineProperties(Mu.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=p6e(this._originalGLContext,e?h6e:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Dt.defaultColor;this._defaultTexture=new Dt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Dt({context:this,pixelFormat:Ke.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 Dt({context:this,pixelFormat:Ke.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 ns({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 g6e}}});function dhe(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ge.partialApply(e._gl,r,t,o,n,i)}var LX;typeof WebGLRenderingContext<"u"&&(LX=[te.BACK]);function c6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=LX;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var _6e=new li;Mu.prototype.clear=function(e,t){e=e??_6e,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;dhe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;c6(this,c),n.clear(i)};function y6e(e,t,n,i,r){c6(e,t),dhe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function A6e(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??N.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,o.numberOfVertices):a=o.numberOfVertices,c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Mu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,y6e(this,r,t,n,o),A6e(this,e,n,i)};Mu.prototype.beginFrame=function(){};Mu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=LX;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)};Mu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:Ke.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return c6(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};Mu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=Ke.createTypedArray(c,a,r,o);return c6(this,s),t.readPixels(n,i,r,o,Ke.RGBA,ze.toWebGLConstant(a,this),u),u};var hhe={position:0,textureCoordinates:1};Mu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new St({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Oe.TRIANGLES});e=zn.fromGeometry({context:this,geometry:t,attributeLocations:hhe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Mu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:cx,fragmentShaderSource:e,attributeLocations:hhe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Mu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Mu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new BD(this._pickObjects,t,z.fromRgba(t))};Mu.prototype.isDestroyed=function(){return!1};Mu.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(),ue(this)};var Ax=Mu;function xv(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))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 _s({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new _s({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}xv.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};xv.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};xv.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)};xv.prototype.isDestroyed=function(){return!1};xv.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var vO=xv;var zl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===zl.RGBA4||e===zl.RGBA8||e===zl.RGBA16F||e===zl.RGBA32F||e===zl.RGB5_A1||e===zl.RGB565||e===zl.DEPTH_COMPONENT16||e===zl.STENCIL_INDEX8||e===zl.DEPTH_STENCIL||e===zl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?zl.RGBA32F:e===te.HALF_FLOAT_OES?zl.RGBA16F:zl.RGBA8}};Object.freeze(zl);var Vl=zl;function SO(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumRenderbufferSize,r=e.format??Vl.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(SO.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});SO.prototype._getRenderbuffer=function(){return this._renderbuffer};SO.prototype.isDestroyed=function(){return!1};SO.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Sf=SO;function pa(e){e=e??H.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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(pa.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}}});pa.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};pa.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ze.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??Ke.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Dt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:jt.NEAREST}),this._numSamples>1){let a=Vl.getColorFormat(r);this._colorRenderbuffers[s]=new Sf({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Sf({context:e,width:t,height:n,format:Vl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Sf({context:e,width:t,height:n,format:Vl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:jt.NEAREST}):this._depthRenderbuffer=new Sf({context:e,width:t,height:n,format:Vl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new vO({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 _s({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};pa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};pa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};pa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};pa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};pa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};pa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};pa.prototype.getDepthTexture=function(){return this._depthTexture};pa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};pa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};pa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};pa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};pa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};pa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};pa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};pa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};pa.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 r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.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 ai=pa;function b6e(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new ns({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var wO=b6e;var By={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};By.includesVertexShader=function(e){return(e&By.VERTEX)!==0};By.includesFragmentShader=function(e){return(e&By.FRAGMENT)!==0};By.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};By.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(By);var de=By;function FX(e){this.name=e,this.fields=[]}FX.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};FX.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var IO=FX;function BX(e){this.signature=e,this.body=[]}BX.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}`)};BX.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var PO=BX;function x6e(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Zn=x6e;function jl(){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(jl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});jl.prototype.addDefine=function(e,t,n){n=n??de.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),de.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};jl.prototype.addStruct=function(e,t,n){this._structs[e]=new IO(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};jl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};jl.prototype.addFunction=function(e,t,n){this._functions[e]=new PO(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};jl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};jl.prototype.addUniform=function(e,t,n){n=n??de.BOTH;let i=`uniform ${e} ${t};`;de.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};jl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};jl.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+=E6e(e),i};jl.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}`)};jl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};jl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};jl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=T6e(this),i=C6e(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +`),o=new Ye({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` +`),a=new Ye({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};jl.prototype.clone=function(){return Je(this,!0)};function T6e(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}function E6e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function C6e(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}var dg=jl;function l6(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new Ax(this._canvas,Je(e?.contextOptions)),this._canvases=[]}l6.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return s;default:return Reflect.get(c,u,f)}}})};l6.prototype.destroy=function(){this._context.destroy(),ue(this)};l6.prototype.isDestroyed=function(){return!1};var DO=l6;function bx(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}bx.create=function(e){return new bx(e)};bx.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};bx.prototype.isDestroyed=function(){return!1};bx.prototype.destroy=function(){return this._gl.deleteSync(this._sync),ue(this)};bx.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,s){return()=>{n.getStatus()===te.SIGNALED?r():s<=0?o(new oe("Wait for signal timeout")):e(i(r,o,s-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var RO=bx;function ky(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,p=Ke.toInternalFormat(i,r,t),g=Ke.isCompressedFormat(p),m=t._gl,y=Ke.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,ghe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");mhe(this,n),this._initialized=!0}else phe(this);m.bindTexture(this._textureTarget,null)}function mhe(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=Ke.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,s,a,c),i.texSubImage3D(r,0,0,0,0,s,a,c,u,ze.toWebGLConstant(f,n),g),m>1){let y=s,A=a,b=c;for(let x=0;x<t.mipLevels.length;++x)y=kX(y),A=kX(A),b=kX(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}ky.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(mhe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),phe(this)),this._initialized=!0),d||v6e(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function v6e(e,t,n,i,r,o,s,a){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=Ke.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,s,a,f,ze.toWebGLConstant(d,c),t)}function kX(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function phe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}ky.create=function(e){return new ky(e)};Object.defineProperties(ky.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){ghe(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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function ghe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}ky.prototype.generateMipmap=function(e){e=e??Pd.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)};ky.prototype.isDestroyed=function(){return!1};ky.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var OO=ky;function MO({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function UX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new MO({x:n,y:n,width:e-2*n,height:t-2*n})}UX.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};UX.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,r=i.width,o=i.height,s=r-t,a=o-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new MO({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new MO({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new MO({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new MO({x:i.x,y:i.y+n+c,width:r,height:u})),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 Tv=UX;var _he=16;function Hl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(_he,_he);this._pixelFormat=e.pixelFormat??Ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Hl.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}}});Hl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=s/r,t.height=a/o,t};Hl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,s=new Dt({context:e,height:n,width:t,pixelFormat:r,sampler:o}),a=e._gl,c=s._textureTarget,u=this._texture,f=new _s({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;a.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};Hl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,s=o.width,a=o.height,c=this._subRegions,u=i.map((A,b)=>new yhe({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(s=D.nextPowerOfTwo(Math.max(f,s)),a=D.nextPowerOfTwo(Math.max(d,a));p>=s*a;)s>a?a*=2:s*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new Tv({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){s>a?a*=2:s*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,s,a,g),o.destroy(),this._rectangles=g,this._guid=Kn()};Hl.prototype.getImageIndex=function(e){return this._indexById.get(e)};Hl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function yhe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Hl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new yhe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};Hl.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 r=t[n],{image:o,index:s}=r,a=this._texturePacker.pack(s,o);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};Hl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new Tv({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function S6e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}Hl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let a=await S6e(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(o,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};Hl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(a=>a===-1?-1:r):r};Hl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let s=this._rectangles[o];return i}))};Hl.prototype.isDestroyed=function(){return!1};Hl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var xx=Hl;function Fa(e,t,n,i){let r=Fa._verifyAttributes(t);n=n??0;let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Fa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Fa._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Fa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Me.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Fa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Y.getSizeInBytes(a.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Fa._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Y.getSizeInBytes(a)}return n};Fa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Fa._resize(r,this._size),Fa._appendWriters(this.writers,r)}zX(this)};Fa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=Y.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var w6e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Fa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=w6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Fa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=I6e(this,i)||t;if(t||!l(this.va)){zX(this);let s=this.va=[],a=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);Fa._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new zn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function I6e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Fa._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[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})}};Fa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)P6e(n[i],e,t)};function P6e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Fa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function zX(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}Fa.prototype.isDestroyed=function(){return!1};Fa.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 zX(this),ue(this)};var hg=Fa;var VX=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new Ui(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=D.toDegrees(t.west),r=D.toDegrees(t.south),o=D.toDegrees(t.east),s=D.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new ie(i,r,o,s)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,s=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=o.width/s,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/a,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=r.height/s,u=t.longitude;r.east<r.west&&(u+=D.TWO_PI);let f=(u-r.west)/a|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=s&&(d=s-1),l(i)?(i.x=f,i.y=d,i):new U(f,d)}},Qi=VX;var Ahe=new h,bhe=new h,xhe=new he,jX=new h,D6e=new h,The=new ce,R6e=new Qi,NO=[new he,new he,new he,new he],LO=new U,zs={};zs.initialize=function(){let e=zs._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){zs._terrainHeights=t}),zs._initPromise=e),e};zs.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=Ehe(e),i=zs._defaultMinTerrainHeight,r=zs._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=zs._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,xhe),Ahe),t.cartographicToCartesian(ie.southwest(e,xhe),bhe),h.midpoint(bhe,Ahe,jX);let a=t.scaleToGeodeticSurface(jX,D6e);if(l(a)){let c=h.distance(jX,a);i=Math.min(i,-c)}else i=zs._defaultMinTerrainHeight}return i=Math.max(zs._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};zs.getBoundingSphere=function(e,t){t=t??ee.default;let n=Ehe(e),i=zs._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=zs._terrainHeights[o];l(s)&&(i=s[1])}let r=ce.fromRectangle3D(e,t,0);return ce.fromRectangle3D(e,t,i,The),ce.union(r,The,r)};function Ehe(e){he.fromRadians(e.east,e.north,0,NO[0]),he.fromRadians(e.west,e.north,0,NO[1]),he.fromRadians(e.east,e.south,0,NO[2]),he.fromRadians(e.west,e.south,0,NO[3]);let t=0,n=0,i=0,r=0,o=zs._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=NO[c];if(R6e.positionToTileXY(u,s,LO),c===0)i=LO.x,r=LO.y;else if(i!==LO.x||r!==LO.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}zs._terrainHeightsMaxLevel=6;zs._defaultMaxTerrainHeight=9e3;zs._defaultMinTerrainHeight=-1e5;zs._terrainHeights=void 0;zs._initPromise=void 0;Object.defineProperties(zs,{initialized:{get:function(){return l(zs._terrainHeights)}}});var Mi=zs;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function Che(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function O6e(e){if(Array.isArray(e))return e}function M6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function N6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L6e(e,t){return O6e(e)||M6e(e,t)||F6e(e,t)||N6e()}function F6e(e,t){if(e){if(typeof e=="string")return Che(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Che(e,t):void 0}}var Uhe=Object.entries,vhe=Object.setPrototypeOf,B6e=Object.isFrozen,k6e=Object.getPrototypeOf,U6e=Object.getOwnPropertyDescriptor,Ba=Object.freeze,ac=Object.seal,Ev=Object.create,zhe=typeof Reflect<"u"&&Reflect,KX=zhe.apply,$X=zhe.construct;Ba||(Ba=function(t){return t});ac||(ac=function(t){return t});KX||(KX=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});$X||($X=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var Ex=ga(Array.prototype.forEach),z6e=ga(Array.prototype.lastIndexOf),She=ga(Array.prototype.pop),FO=ga(Array.prototype.push),V6e=ga(Array.prototype.splice),Cv=Array.isArray,UO=ga(String.prototype.toLowerCase),HX=ga(String.prototype.toString),whe=ga(String.prototype.match),BO=ga(String.prototype.replace),Ihe=ga(String.prototype.indexOf),j6e=ga(String.prototype.trim),H6e=ga(Number.prototype.toString),G6e=ga(Boolean.prototype.toString),Phe=typeof BigInt>"u"?null:ga(BigInt.prototype.toString),Dhe=typeof Symbol>"u"?null:ga(Symbol.prototype.toString),Nu=ga(Object.prototype.hasOwnProperty),kO=ga(Object.prototype.toString),Zc=ga(RegExp.prototype.test),Tx=W6e(TypeError);function ga(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return KX(e,t,i)}}function W6e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return $X(e,n)}}function wr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:UO;if(vhe&&vhe(e,null),!Cv(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(B6e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function q6e(e){for(let t=0;t<e.length;t++)Nu(e,t)||(e[t]=null);return e}function If(e){let t=Ev(null);for(let i of Uhe(e)){var n=L6e(i,2);let r=n[0],o=n[1];Nu(e,r)&&(Cv(o)?t[r]=q6e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=If(o):t[r]=o)}return t}function Y6e(e){switch(typeof e){case"string":return e;case"number":return H6e(e);case"boolean":return G6e(e);case"bigint":return Phe?Phe(e):"0";case"symbol":return Dhe?Dhe(e):"Symbol()";case"undefined":return kO(e);case"function":case"object":{if(e===null)return kO(e);let t=e,n=Yh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:kO(i)}return kO(e)}default:return kO(e)}}function Yh(e,t){for(;e!==null;){let i=U6e(e,t);if(i){if(i.get)return ga(i.get);if(typeof i.value=="function")return ga(i.value)}e=k6e(e)}function n(){return null}return n}function X6e(e){try{return Zc(e,""),!0}catch{return!1}}var Rhe=Ba(["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","search","section","select","shadow","slot","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"]),GX=Ba(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),WX=Ba(["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"]),K6e=Ba(["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"]),qX=Ba(["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"]),$6e=Ba(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ohe=Ba(["#text"]),Mhe=Ba(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),YX=Ba(["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","dominant-baseline","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","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),Nhe=Ba(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),u6=Ba(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),J6e=ac(/{{[\w\W]*|^[\w\W]*}}/g),Z6e=ac(/<%[\w\W]*|^[\w\W]*%>/g),Q6e=ac(/\${[\w\W]*/g),eHe=ac(/^data-[\-\w.\u00B7-\uFFFF]+$/),tHe=ac(/^aria-[\-\w]+$/),Lhe=ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nHe=ac(/^(?:\w+script|data):/i),iHe=ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rHe=ac(/^html$/i),oHe=ac(/^[a-z][.\w]*(-[.\w]+)+$/i),Fhe=ac(/<[/\w!]/g),Bhe=ac(/<[/\w]/g),sHe=ac(/<\/no(script|embed|frames)/i),aHe=ac(/\/>/i),wf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Vhe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],cHe=Ba(wr({},Vhe)),lHe=(function(){let e={};return Ex(Vhe,t=>{e[t]=ac(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ba(e)})(),uHe=function(){return typeof window>"u"?null:window},fHe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},khe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Uy=function(t,n,i,r){return Nu(t,n)&&Cv(t[n])?wr(r.base?If(r.base):{},t[n],r.transform):i},XX=function(t,n,i){let r=Nu(t,n)?t[n]:void 0;return r&&typeof r=="object"?If(r):i()};function jhe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:uHe(),t=Ct=>jhe(Ct);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==wf.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=a.prototype,g=Yh(p,"cloneNode"),m=Yh(p,"remove"),y=Yh(p,"nextSibling"),A=Yh(p,"childNodes"),b=Yh(p,"parentNode"),x=Yh(p,"shadowRoot"),T=Yh(p,"attributes"),E=s&&s.prototype?Yh(s.prototype,"nodeType"):null,v=s&&s.prototype?Yh(s.prototype,"nodeName"):null,S=s&&s.prototype?Yh(s.prototype,"ownerDocument"):null,I=function(ye){return E?E(ye):ye.nodeType},R=function(ye){return v?v(ye):ye.nodeName};if(typeof o=="function"){let Ct=n.createElement("template");Ct.content&&Ct.content.ownerDocument&&(n=Ct.content.ownerDocument)}let O,L="",_,C=!1,w=0,P=function(){if(w>0)throw Tx('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(ye){P(),w++;try{return O.createHTML(ye)}finally{w--}},F=function(ye){P(),w++;try{return O.createScriptURL(ye)}finally{w--}},V=function(){return C||(_=fHe(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=khe();t.isSupported=typeof Uhe=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=J6e,Z=Z6e,ae=Q6e,Ae=eHe,fe=tHe,xe=nHe,ge=iHe,we=oHe,Se=Lhe,Re=null,Qe=wr({},[...Rhe,...GX,...WX,...qX,...Ohe]),He=null,Xe=wr({},[...Mhe,...YX,...Nhe,...u6]),$e=Object.seal(Ev(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}})),Pe=null,qe=null,st=Object.seal(Ev(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),vt=!0,Gt=!0,lt=!1,mt=!0,ft=!1,Xt=!0,rt=!1,ht=!1,Bi=null,Xn=null,Ai=!1,Wi=!1,wi=!1,di=!1,bi=!0,jn=!1,nn="user-content-",Wn=!0,Zi=!1,Mr={},fo=null,Bs=wr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Ks=null,no=wr({},["audio","video","img","source","image","track"]),mi=null,ho=wr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ur="http://www.w3.org/1998/Math/MathML",Zo="http://www.w3.org/2000/svg",Bn="http://www.w3.org/1999/xhtml",qi=Bn,ki=!1,Nr=null,Wc=wr({},[ur,Zo,Bn],HX),xd=Ba(["mi","mo","mn","ms","mtext"]),xp=wr({},xd),Nh=Ba(["annotation-xml"]),da=wr({},Nh),Tp=wr({},["title","style","font","a","script"]),ks=null,tc=["application/xhtml+xml","text/html"],Yb="text/html",ri=null,Kr=null,Ol=n.createElement("form"),Z0=function(ye){return ye instanceof RegExp||ye instanceof Function},Ma=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kr&&Kr===ye)return;(!ye||typeof ye!="object")&&(ye={}),ye=If(ye),ks=tc.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Yb:ye.PARSER_MEDIA_TYPE,ri=ks==="application/xhtml+xml"?HX:UO,Re=Uy(ye,"ALLOWED_TAGS",Qe,{transform:ri}),He=Uy(ye,"ALLOWED_ATTR",Xe,{transform:ri}),Nr=Uy(ye,"ALLOWED_NAMESPACES",Wc,{transform:HX}),mi=Uy(ye,"ADD_URI_SAFE_ATTR",ho,{transform:ri,base:ho}),Ks=Uy(ye,"ADD_DATA_URI_TAGS",no,{transform:ri,base:no}),fo=Uy(ye,"FORBID_CONTENTS",Bs,{transform:ri}),Pe=Uy(ye,"FORBID_TAGS",If({}),{transform:ri}),qe=Uy(ye,"FORBID_ATTR",If({}),{transform:ri}),Mr=Nu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?If(ye.USE_PROFILES):ye.USE_PROFILES:!1,vt=ye.ALLOW_ARIA_ATTR!==!1,Gt=ye.ALLOW_DATA_ATTR!==!1,lt=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=ye.SAFE_FOR_TEMPLATES||!1,Xt=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,Wi=ye.RETURN_DOM||!1,wi=ye.RETURN_DOM_FRAGMENT||!1,di=ye.RETURN_TRUSTED_TYPE||!1,Ai=ye.FORCE_BODY||!1,bi=ye.SANITIZE_DOM!==!1,jn=ye.SANITIZE_NAMED_PROPS||!1,Wn=ye.KEEP_CONTENT!==!1,Zi=ye.IN_PLACE||!1,Se=X6e(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:Lhe,qi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Bn,xp=XX(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>wr({},xd)),da=XX(ye,"HTML_INTEGRATION_POINTS",()=>wr({},Nh));let Fe=XX(ye,"CUSTOM_ELEMENT_HANDLING",()=>Ev(null));if($e=Ev(null),Nu(Fe,"tagNameCheck")&&Z0(Fe.tagNameCheck)&&($e.tagNameCheck=Fe.tagNameCheck),Nu(Fe,"attributeNameCheck")&&Z0(Fe.attributeNameCheck)&&($e.attributeNameCheck=Fe.attributeNameCheck),Nu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),ac($e),ft&&(Gt=!1),wi&&(Wi=!0),Mr&&(Re=wr({},Ohe),He=Ev(null),Mr.html===!0&&(wr(Re,Rhe),wr(He,Mhe)),Mr.svg===!0&&(wr(Re,GX),wr(He,YX),wr(He,u6)),Mr.svgFilters===!0&&(wr(Re,WX),wr(He,YX),wr(He,u6)),Mr.mathMl===!0&&(wr(Re,qX),wr(He,Nhe),wr(He,u6))),st.tagCheck=null,st.attributeCheck=null,Nu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:Cv(ye.ADD_TAGS)&&(Re===Qe&&(Re=If(Re)),wr(Re,ye.ADD_TAGS,ri))),Nu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:Cv(ye.ADD_ATTR)&&(He===Xe&&(He=If(He)),wr(He,ye.ADD_ATTR,ri))),Nu(ye,"ADD_FORBID_CONTENTS")&&Cv(ye.ADD_FORBID_CONTENTS)&&(fo===Bs&&(fo=If(fo)),wr(fo,ye.ADD_FORBID_CONTENTS,ri)),Wn&&(Re["#text"]=!0),rt&&wr(Re,["html","head","body"]),Re.table&&(wr(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw Tx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Tx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let gt=O;O=ye.TRUSTED_TYPES_POLICY;try{L=M("")}catch(on){throw O=gt,on}}else ye.TRUSTED_TYPES_POLICY===null?(O=void 0,L=""):(O===void 0&&(O=V()),O&&typeof L=="string"&&(L=M("")));Ba&&Ba(ye),Kr=ye},Ep=wr({},[...GX,...WX,...K6e]),Ey=wr({},[...qX,...$6e]),Aq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="svg":Fe.namespaceURI===ur?ye==="svg"&&(gt==="annotation-xml"||xp[gt]):!!Ep[ye]},bq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="math":Fe.namespaceURI===Zo?ye==="math"&&da[gt]:!!Ey[ye]},xq=function(ye,Fe,gt){return Fe.namespaceURI===Zo&&!da[gt]||Fe.namespaceURI===ur&&!xp[gt]?!1:!Ey[ye]&&(Tp[ye]||!Ep[ye])},Tq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:qi,tagName:"template"});let gt=UO(ye.tagName),on=UO(Fe.tagName);return Nr[ye.namespaceURI]?ye.namespaceURI===Zo?Aq(gt,Fe,on):ye.namespaceURI===ur?bq(gt,Fe,on):ye.namespaceURI===Bn?xq(gt,Fe,on):!!(ks==="application/xhtml+xml"&&Nr[ye.namespaceURI]):!1},Cp=function(ye){FO(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw Tx("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},$C=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},Xb=function(ye){Kb(ye);let Fe=A(ye);if(Fe){let on=[];Ex(Fe,In=>{FO(on,In)}),Ex(on,In=>{try{m(In)}catch{}})}let gt=T(ye);if(gt)for(let on=gt.length-1;on>=0;--on){let In=gt[on],oi=In&&In.name;typeof oi=="string"&&$C(ye,In,oi)}},Lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}FO(t.removed,{attribute:gt||null,from:Fe});try{gt?Fe.removeAttributeNode(gt):Fe.removeAttribute(ye)}catch{try{Fe.removeAttribute(ye)}catch{}}if(ye==="is")if(Wi||wi)try{Cp(Fe)}catch{}else try{Fe.setAttribute(ye,"")}catch{}},Eq=function(ye){let Fe=T(ye);if(Fe)for(let gt=Fe.length-1;gt>=0;--gt){let on=Fe[gt],In=on&&on.name;typeof In!="string"||He[ri(In)]||$C(ye,on,In)}},Kb=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===wf.element&&Eq(gt);let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},JC=function(ye,Fe){return Xt?ye==="patchsrc"?!0:ye==="for"&&Fe!=="label"&&Fe!=="output":!1},vp=function(ye){if(!Xt)return;let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop(),on=I(gt);if(on===wf.processingInstruction||on===wf.comment&&Zc(Bhe,gt.data)){try{m(gt)}catch{}continue}if(on===wf.element){let oi=gt,So=ri(R(gt));try{oi.hasAttribute&&oi.hasAttribute("patchsrc")&&oi.removeAttribute("patchsrc"),oi.hasAttribute&&oi.hasAttribute("for")&&JC("for",So)&&oi.removeAttribute("for")}catch{}}let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},$b=function(ye){let Fe=null,gt=null;if(Ai)ye="<remove></remove>"+ye;else{let oi=whe(ye,/^[\r\n\t ]+/);gt=oi&&oi[0]}ks==="application/xhtml+xml"&&qi===Bn&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");let on=O?M(ye):ye;if(qi===Bn)try{Fe=new f().parseFromString(on,ks)}catch{}if(!Fe||!Fe.documentElement){Fe=j.createDocument(qi,"template",null);try{Fe.documentElement.innerHTML=ki?L:on}catch{}}let In=Fe.body||Fe.documentElement;return ye&>&&In.insertBefore(n.createTextNode(gt),In.childNodes[0]||null),qi===Bn?q.call(Fe,rt?"html":"body")[0]:rt?Fe.documentElement:In},QP=function(ye){let Fe=S?S(ye):ye.ownerDocument;return k.call(Fe||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ZC=function(ye){return ye=BO(ye,J," "),ye=BO(ye,Z," "),ye=BO(ye,ae," "),ye},Cy=function(ye){var Fe;ye.normalize();let gt=S?S(ye):ye.ownerDocument,on=k.call(gt||ye,ye,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),In=on.nextNode();for(;In;)In.data=ZC(In.data),In=on.nextNode();let oi=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");oi&&Ex(oi,So=>{ne(So.content)&&Cy(So.content)})},le=function(ye){let Fe=v?v(ye):null;return typeof Fe!="string"||ri(Fe)!=="form"?!1:typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||ye.attributes!==T(ye)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function"||ye.nodeType!==E(ye)||ye.childNodes!==A(ye)},ne=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return E(ye)===wf.documentFragment}catch{return!1}},Te=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return typeof E(ye)=="number"}catch{return!1}};function Ce(Ct,ye,Fe){Ct.length!==0&&Ex(Ct,gt=>{gt.call(t,ye,Fe,Kr)})}let Ze=function(ye,Fe){return!!(Xt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&Zc(Fhe,ye.textContent)&&Zc(Fhe,ye.innerHTML)||Xt&&ye.namespaceURI===Bn&&cHe[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&Zc(lHe[Fe],ye.textContent))||ye.nodeType===wf.processingInstruction||Xt&&ye.nodeType===wf.comment&&Zc(Bhe,ye.data))},Et=function(ye,Fe){if(ye instanceof RegExp)return Zc(ye,Fe);if(ye instanceof Function){for(var gt=arguments.length,on=new Array(gt>2?gt-2:0),In=2;In<gt;In++)on[In-2]=arguments[In];return!!ye(Fe,...on)}return!1},pt=function(ye,Fe,gt){if(!Pe[Fe]&&mo(Fe)&&Et($e.tagNameCheck,Fe))return!1;if(Wn&&!fo[Fe]){let on=b(ye),In=A(ye);if(In&&on){let oi=In.length;for(let So=oi-1;So>=0;--So){let ds=ye===gt?g(In[So],!0):In[So];on.insertBefore(ds,y(ye))}}}return Cp(ye),!0},wt=function(ye,Fe,gt,on){return ye.length===0?Fe:Fe===gt||Fe===on?If(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Zi&&Kb(ye),!0)},qn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(le(ye))return Cp(ye),!0;let gt=ri(R(ye));if(Re=wt(W.uponSanitizeElement,Re,Qe,Bi),Ce(W.uponSanitizeElement,ye,{tagName:gt,allowedTags:Re}),bn(ye,Fe))return!0;if(Ze(ye,gt))return Cp(ye),!0;if(Pe[gt]||!(st.tagCheck instanceof Function&&st.tagCheck(gt))&&!Re[gt]){let In=pt(ye,gt,Fe);return In===!1&&Ce(W.afterSanitizeElements,ye,null),In}if(I(ye)===wf.element&&!Tq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&Zc(sHe,ye.innerHTML))return Cp(ye),!0;if(ft&&ye.nodeType===wf.text){let In=ZC(ye.textContent);ye.textContent!==In&&(FO(t.removed,{element:ye.cloneNode()}),ye.textContent=In)}return Ce(W.afterSanitizeElements,ye,null),!1},_n=function(ye,Fe,gt){if(qe[Fe]||JC(Fe,ye)||bi&&(Fe==="id"||Fe==="name")&&(gt in n||gt in Ol))return!1;let on=He[Fe]||st.attributeCheck instanceof Function&&st.attributeCheck(Fe,ye);return Gt&&Zc(Ae,Fe)||vt&&Zc(fe,Fe)?!0:on?mi[Fe]||Zc(Se,BO(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&Ihe(gt,"data:")===0&&Ks[ye]||lt&&!Zc(xe,BO(gt,ge,""))?!0:!gt:mo(ye)&&Et($e.tagNameCheck,ye)&&Et($e.attributeNameCheck,Fe,ye)||Fe==="is"&&$e.allowCustomizedBuiltInElements&&Et($e.tagNameCheck,gt)},vo=wr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),mo=function(ye){return!vo[UO(ye)]&&Zc(we,ye)},$s=function(ye,Fe,gt,on){if(O&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!gt)switch(d.getAttributeType(ye,Fe)){case"TrustedHTML":return M(on);case"TrustedScriptURL":return F(on)}return on},Sc=function(ye,Fe,gt,on){try{gt?ye.setAttributeNS(gt,Fe,on):ye.setAttribute(Fe,on),le(ye)?Cp(ye):She(t.removed)}catch{Lh(Fe,ye)}},Ml=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||le(ye))return;He=wt(W.uponSanitizeAttribute,He,Xe,Xn);let gt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0},on=Fe.length,In=ri(ye.nodeName);for(;on--;){let oi=Fe[on],So=oi.name,ds=oi.namespaceURI,vu=oi.value,Su=ri(So),Cq=vu,Nl=So==="value"?Cq:j6e(Cq);if(gt.attrName=Su,gt.attrValue=Nl,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Nl=gt.attrValue,jn&&(Su==="id"||Su==="name")&&Ihe(Nl,nn)!==0&&(Lh(So,ye,oi),Nl=nn+Nl),Xt&&Zc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nl)){Lh(So,ye,oi);continue}if(Su==="attributename"&&whe(Nl,"href")){Lh(So,ye,oi);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){Lh(So,ye,oi);continue}if(!mt&&Zc(aHe,Nl)){Lh(So,ye,oi);continue}if(ft&&(Nl=ZC(Nl)),!_n(In,Su,Nl)){Lh(So,ye,oi);continue}Nl=$s(In,Su,ds,Nl),Nl!==Cq&&Sc(ye,So,ds,Nl)}}Ce(W.afterSanitizeAttributes,ye,null)},Cu=function(ye){let Fe=null,gt=QP(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),qn(Fe,ye),Ml(Fe),ne(Fe.content)&&Cu(Fe.content),I(Fe)===wf.element){let on=x(Fe);ne(on)&&(Q0(on),Cu(on))}Ce(W.afterSanitizeShadowDOM,ye,null)},Q0=function(ye){let Fe=[{node:ye,shadow:null}];for(;Fe.length>0;){let gt=Fe.pop();if(gt.shadow){Cu(gt.shadow);continue}let on=gt.node,oi=I(on)===wf.element,So=A(on);if(So)for(let ds=So.length-1;ds>=0;--ds)Fe.push({node:So[ds],shadow:null});if(oi){let ds=v?v(on):null;if(typeof ds=="string"&&ri(ds)==="template"){let vu=on.content;ne(vu)&&Fe.push({node:vu,shadow:null})}}if(oi){let ds=x(on);ne(ds)&&Fe.push({node:null,shadow:ds},{node:ds,shadow:null})}}};return t.sanitize=function(Ct){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,gt=null,on=null,In=null;if(ki=!Ct,ki&&(Ct="<!-->"),typeof Ct!="string"&&!Te(Ct)&&(Ct=Y6e(Ct),typeof Ct!="string"))throw Tx("dirty is not a string, aborting");if(!t.isSupported)return Ct;ht?(Re=Bi,He=Xn):Ma(ye),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(Re=If(Re)),W.uponSanitizeAttribute.length>0&&(He=If(He)),t.removed=[];let oi=Zi&&typeof Ct!="string"&&Te(Ct);if(oi){vp(Ct);let vu=R(Ct);if(typeof vu=="string"){let Su=ri(vu);if(!Re[Su]||Pe[Su])throw Xb(Ct),Tx("root node is forbidden and cannot be sanitized in-place")}if(le(Ct))throw Xb(Ct),Tx("root node is clobbered and cannot be sanitized in-place");try{Q0(Ct)}catch(Su){throw Xb(Ct),Su}}else if(Te(Ct))Fe=$b("<!---->"),gt=Fe.ownerDocument.importNode(Ct,!0),gt.nodeType===wf.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),Q0(gt);else{if(!Wi&&!ft&&!rt&&Ct.indexOf("<")===-1)return O&&di?M(Ct):Ct;if(Fe=$b(Ct),!Fe)return Wi?null:di?L:""}Fe&&Ai&&Cp(Fe.firstChild);let So=oi?Ct:Fe;try{let vu=QP(So);for(;on=vu.nextNode();)qn(on,So),Ml(on),ne(on.content)&&Cu(on.content)}catch(vu){throw oi&&(Xb(Ct),Ex(t.removed,Su=>{Su.element&&Kb(Su.element)})),vu}if(oi)return Ex(t.removed,vu=>{vu.element&&Kb(vu.element)}),ft&&Cy(Ct),Ct;if(Wi){if(ft&&Cy(Fe),wi)for(In=G.call(Fe.ownerDocument);Fe.firstChild;)In.appendChild(Fe.firstChild);else In=Fe;return(He.shadowroot||He.shadowrootmode)&&(In=Q.call(i,In,!0)),In}let ds=rt?Fe.outerHTML:Fe.innerHTML;return rt&&Re["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&Zc(rHe,Fe.ownerDocument.doctype.name)&&(ds="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> +`+ds),ft&&(ds=ZC(ds)),O&&di?M(ds):ds},t.setConfig=function(){let Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(Ct),ht=!0,Bi=Re,Xn=He},t.clearConfig=function(){Kr=null,ht=!1,Bi=null,Xn=null,O=_,L=""},t.isValidAttribute=function(Ct,ye,Fe){Kr||Ma({});let gt=ri(Ct),on=ri(ye);return _n(gt,on,Fe)},t.addHook=function(Ct,ye){typeof ye=="function"&&Nu(W,Ct)&&FO(W[Ct],ye)},t.removeHook=function(Ct,ye){if(Nu(W,Ct)){if(ye!==void 0){let Fe=z6e(W[Ct],ye);return Fe===-1?void 0:V6e(W[Ct],Fe,1)[0]}return She(W[Ct])}},t.removeHooks=function(Ct){Nu(W,Ct)&&(W[Ct]=[])},t.removeAllHooks=function(){W=khe()},t}var Hhe=jhe();var dHe=0,JX={},ZX=class e{constructor(t,n){let i,r=t;l(JX[r])?i=JX[r]:(i=dHe++,JX[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=Hhe.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},It=ZX;var Ghe={NONE:0,LERC:1};Object.freeze(Ghe);var Md=Ghe;function cc(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}cc.fromCorners=function(e,t,n){return l(n)||(n=new cc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};cc.fromPoints=function(e,t){if(l(t)||(t=new cc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(y,r),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};cc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new cc(e.minimum,e.maximum,e.center)};cc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var f6=new h;cc.intersectPlane=function(e,t){f6=h.subtract(e.maximum,e.minimum,f6);let n=h.multiplyByScalar(f6,.5,f6),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};cc.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};cc.prototype.clone=function(e){return cc.clone(this,e)};cc.prototype.intersectPlane=function(e){return cc.intersectPlane(this,e)};cc.prototype.intersectAxisAlignedBoundingBox=function(e){return cc.intersectAxisAlignedBoundingBox(this,e)};cc.prototype.equals=function(e){return cc.equals(this,e)};var Pf=cc;function Fp(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Fp.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=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Whe=new h;Fp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Whe);return eK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Fp.prototype.isScaledSpacePointVisible=function(e){return eK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var hHe=new h;Fp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=hHe,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),eK(e,r,i)};Fp.prototype.computeHorizonCullingPoint=function(e,t,n){return Xhe(this._ellipsoid,e,t,n)};var qhe=ee.clone(ee.UNIT_SPHERE);Fp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Yhe(this._ellipsoid,n,qhe);return Xhe(r,e,t,i)};Fp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return Khe(this._ellipsoid,e,t,n,i,r)};Fp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=Yhe(this._ellipsoid,r,qhe);return Khe(s,e,t,n,i,o)};var mHe=[];Fp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,mHe),r=ce.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var pHe=new h;function Yhe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,pHe);e=ee.fromCartesian3(i,n)}return e}function Xhe(e,t,n,i){l(i)||(i=new h);let r=Zhe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=$he(e,c,r);if(u<0)return;o=Math.max(o,u)}return Jhe(r,o,i)}var d6=new h;function Khe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=Zhe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){d6.x=n[c]+r.x,d6.y=n[c+1]+r.y,d6.z=n[c+2]+r.z;let f=$he(e,d6,s);if(f<0)return;a=Math.max(a,f)}return Jhe(s,a,o)}function eK(e,t,n){let i=t,r=n,o=h.subtract(e,i,Whe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var gHe=new h,_He=new h;function $he(e,t,n){let i=e.transformPositionToScaledSpace(t,gHe),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,_He);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function Jhe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var QX=new h;function Zhe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,QX),h.normalize(QX,QX))}var Xh=Fp;var tK=new se;function Bp(e,t){t=t??ee.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(N.getColumn(n,0,tK)),this._yAxis=h.fromCartesian4(N.getColumn(n,1,tK));let i=h.fromCartesian4(N.getColumn(n,2,tK));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Bp.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 yHe=new Pf;Bp.fromPoints=function(e,t){let n=Pf.fromPoints(e,yHe);return new Bp(n.center,t)};var Qhe=new pn,h6=new h;Bp.prototype.projectPointOntoPlane=function(e,t){let n=Qhe;n.origin=e,h.normalize(e,n.direction);let i=pi.rayPlane(n,this._plane,h6);if(l(i)||(h.negate(n.direction,n.direction),i=pi.rayPlane(n,this._plane,h6)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new U(o,s)}};Bp.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Bp.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Qhe;n.origin=e,h.clone(this._plane.normal,n.direction);let i=pi.rayPlane(n,this._plane,h6);l(i)||(h.negate(n.direction,n.direction),i=pi.rayPlane(n,this._plane,h6));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};Bp.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 AHe=new h;Bp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=AHe;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Bp.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 Vs=Bp;function fr(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}fr.packedLength=h.packedLength+$.packedLength;fr.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};fr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new fr),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var bHe=new h,xHe=new h,THe=new h,EHe=new h,CHe=new h,vHe=new h,SHe=new $,wHe={unitary:new $,diagonal:new $};fr.fromPoints=function(e,t){if(l(t)||(t=new fr),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],bHe);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,xHe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=SHe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,wHe),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,EHe),b=$.getColumn(y,1,CHe),x=$.getColumn(y,2,vHe),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),E=Math.max(h.dot(b,p),E),v=Math.max(h.dot(x,p),v),S=Math.min(h.dot(A,p),S),I=Math.min(h.dot(b,p),I),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(S+T),A),b=h.multiplyByScalar(b,.5*(I+E),b),x=h.multiplyByScalar(x,.5*(R+v),x);let O=h.add(A,b,t.center);h.add(O,x,O);let L=THe;return L.x=T-S,L.y=E-I,L.z=v-R,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var ome=new h,IHe=new h;function eme(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new fr);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=ome;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=IHe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var tme=new he,PHe=new h,DHe=new he,RHe=new he,OHe=new he,MHe=new he,NHe=new he,LHe=new h,nme=new h,FHe=new h,ime=new h,BHe=new h,kHe=new U,UHe=new U,zHe=new U,VHe=new U,jHe=new U,HHe=new h,GHe=new h,WHe=new h,qHe=new h,YHe=new U,XHe=new h,KHe=new h,$He=new h,JHe=new sn(h.UNIT_X,0);fr.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??ee.default;let o,s,a,c,u,f,d;if(e.width<=D.PI){let I=ie.center(e,tme),R=i.cartographicToCartesian(I,PHe),O=new Vs(R,i);d=O.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,C=he.fromRadians(L,e.north,n,DHe),w=he.fromRadians(e.west,e.north,n,RHe),P=he.fromRadians(e.west,_,n,OHe),M=he.fromRadians(e.west,e.south,n,MHe),F=he.fromRadians(L,e.south,n,NHe),V=i.cartographicToCartesian(C,LHe),B=i.cartographicToCartesian(w,nme),j=i.cartographicToCartesian(P,FHe),k=i.cartographicToCartesian(M,ime),G=i.cartographicToCartesian(F,BHe),q=O.projectPointToNearestOnPlane(V,kHe),Q=O.projectPointToNearestOnPlane(B,UHe),W=O.projectPointToNearestOnPlane(j,zHe),J=O.projectPointToNearestOnPlane(k,VHe),Z=O.projectPointToNearestOnPlane(G,jHe);return o=Math.min(Q.x,W.x,J.x),s=-o,c=Math.max(Q.y,q.y),a=Math.min(J.y,Z.y),w.height=M.height=t,B=i.cartographicToCartesian(w,nme),k=i.cartographicToCartesian(M,ime),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,eme(O.origin,O.xAxis,O.yAxis,O.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,tme).longitude,A=h.fromRadians(y,m,n,i,HHe);A.z=0;let x=Math.abs(A.x)<D.EPSILON10&&Math.abs(A.y)<D.EPSILON10?h.UNIT_X:h.normalize(A,GHe),T=h.UNIT_Z,E=h.cross(x,T,WHe);d=sn.fromPointNormal(A,x,JHe);let v=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,qHe);s=h.dot(sn.projectPointOntoPlane(d,v,YHe),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,XHe).z,a=h.fromRadians(0,e.south,p?t:n,i,KHe).z;let S=h.fromRadians(e.east,m,n,i,$He);return u=sn.getPointDistance(d,S),f=0,eme(A,E,T,x,o,s,a,c,u,f,r)};fr.fromTransformation=function(e,t){return l(t)||(t=new fr),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};fr.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new fr(e.center,e.halfAxes)};fr.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?$t.OUTSIDE:u>=c?$t.INSIDE:$t.INTERSECTING};var sme=new h,ame=new h,cme=new h,ZHe=new h,rme=new h,QHe=new h;fr.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,ome),i=e.halfAxes,r=$.getColumn(i,0,sme),o=$.getColumn(i,1,ame),s=$.getColumn(i,2,cme),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let E=r;m=o,y=s,d?p||(E=s,y=r):(E=o,m=r),A=h.cross(m,y,rme),E===r?r=A:E===o?o=A:E===s&&(s=A)}else if(g===2){m=r,d?m=o:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,D.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,ZHe),h.normalize(y,y),A=h.cross(m,y,rme),h.normalize(A,A),m===r?(o=y,s=A):m===o?(s=y,r=A):m===s&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let b=QHe;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,s);let x=0,T;return b.x<-a?(T=b.x+a,x+=T*T):b.x>a&&(T=b.x-a,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var eGe=new h,tGe=new h;fr.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Us);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,sme),u=$.getColumn(a,1,ame),f=$.getColumn(a,2,cme),d=h.add(c,u,eGe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,tGe),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var nGe=new h,iGe=new h,rGe=new h;fr.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,nGe),o=$.getColumn(i,1,iGe),s=$.getColumn(i,2,rGe);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var oGe=new $;fr.computeTransformation=function(e,t){l(t)||(t=new N);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,oGe);return N.fromRotationTranslation(i,n,t)};var sGe=new ce;fr.isOccluded=function(e,t){let n=ce.fromOrientedBoundingBox(e,sGe);return!t.isBoundingSphereVisible(n)};fr.prototype.intersectPlane=function(e){return fr.intersectPlane(this,e)};fr.prototype.distanceSquaredTo=function(e){return fr.distanceSquaredTo(this,e)};fr.prototype.computePlaneDistances=function(e,t,n){return fr.computePlaneDistances(this,e,t,n)};fr.prototype.computeCorners=function(e){return fr.computeCorners(this,e)};fr.prototype.computeTransformation=function(e){return fr.computeTransformation(this,e)};fr.prototype.isOccluded=function(e){return fr.isOccluded(this,e)};fr.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};fr.prototype.clone=function(e){return fr.clone(this,e)};fr.prototype.equals=function(e){return fr.equals(this,e)};var en=fr;var m6={};m6.getHeight=function(e,t,n){return(e-n)*t+n};var aGe=new he;m6.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,aGe);if(!l(o))return h.clone(e,r);let s=m6.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var Ar=m6;var lme={NONE:0,BITS12:1};Object.freeze(lme);var ka=lme;var zO=new h,cGe=new h,Nd=new U,lGe=new N,uGe=new N,fGe=Math.pow(2,12);function Dc(e,t,n,i,r,o,s,a,c,u){let f=ka.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,cGe),A=i-n;Math.max(h.maximumComponent(y),A)<fGe-1?f=ka.BITS12:f=ka.NONE;let x=N.fromScale(y,lGe);x=N.setTranslation(x,g,x);let T=N.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,zO),uGe);T=N.multiplyByTranslation(T,h.negate(g,zO),T),p=N.clone(r,new N);let E=N.getTranslation(r,zO);E=h.subtract(E,e,zO),p=N.setTranslation(p,E,p),p=N.multiply(p,x,p),d=N.inverseTransformation(r,new N),d=N.multiply(T,d,d),r=N.multiply(r,x,new N)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Dc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===ka.BITS12){n=N.multiplyByPoint(this.toScaledENU,n,zO),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((r-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,Nd);let p=cn.compressTextureCoordinates(Nd);U.fromElements(n.z,d,Nd);let g=cn.compressTextureCoordinates(Nd);U.fromElements(c,u,Nd);let m=cn.compressTextureCoordinates(Nd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Nd);let y=cn.compressTextureCoordinates(Nd);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=cn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var dGe=new h,ume=new h;Dc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,dGe),c=n.geodeticSurfaceNormal(a,ume),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Dc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};Dc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===ka.BITS12){let i=cn.decompressTextureCoordinates(e[t],Nd);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Nd);return n.z=r.x,N.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Dc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,ume),a=this.decodeHeight(e,t),c=Ar.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Dc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===ka.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};Dc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===ka.BITS12?cn.decompressTextureCoordinates(e[t+1],Nd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Dc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===ka.BITS12?cn.decompressTextureCoordinates(e[t+3],Nd).x:e[t+6]};Dc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return U.fromElements(r,o,n)};Dc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};Dc.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};Dc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===ka.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var p6={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},g6={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Dc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===ka.NONE){s(p6.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(p6.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(p6.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(g6.compressed0,a?4:3),c&&s(g6.compressed1,1),this.hasGeodeticSurfaceNormals&&s(g6.geodeticSurfaceNormal,3)}return o};Dc.prototype.getAttributeLocations=function(){return this.quantization===ka.NONE?p6:g6};Dc.clone=function(e,t){if(l(e))return l(t)||(t=new Dc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=N.clone(e.toScaledENU),t.fromScaledENU=N.clone(e.fromScaledENU),t.matrix=N.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 _o=Dc;var VO=class e{constructor(t){this._ellipsoid=t??ee.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}};VO.MaximumLatitude=VO.mercatorAngleToGeodeticLatitude(Math.PI);var gi=VO;var kp={};kp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var nK=new h,hGe=new N,mGe=new h,pGe=new h;kp.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=D.PI_OVER_TWO,a=D.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??ee.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,E,v;l(b)?(x=b.west,T=b.south,E=b.east,v=b.north):g?(x=a(A.west),T=a(A.south),E=a(A.east),v=a(A.north)):(x=A.west*y,T=s-2*r(o(-A.south*y)),E=A.east*y,v=s-2*r(o(-A.north*y)));let S=e.relativeToCenter,I=l(S);S=I?S:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=O!==1,w=e.structure??kp.DEFAULT_STRUCTURE,P=w.heightScale??kp.DEFAULT_STRUCTURE.heightScale,M=w.heightOffset??kp.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??kp.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??kp.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??kp.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??kp.DEFAULT_STRUCTURE.isBigEndian,k=ie.computeWidth(A),G=ie.computeHeight(A),q=k/(u-1),Q=G/(f-1);g||(k*=y,G*=y);let W=m.radiiSquared,J=W.x,Z=W.y,ae=W.z,Ae=65536,fe=-65536,xe=At.eastNorthUpToFixedFrame(S,m),ge=N.inverseTransformation(xe,hGe),we,Se;R&&(we=gi.geodeticLatitudeToMercatorAngle(T),Se=1/(gi.geodeticLatitudeToMercatorAngle(v)-we));let Re=mGe;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=pGe;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let He=Number.POSITIVE_INFINITY,Xe=u*f,$e=d>0?u*2+f*2:0,Pe=Xe+$e,qe=new Array(Pe),st=new Array(Pe),vt=new Array(Pe),Gt=R?new Array(Pe):[],lt=C?new Array(Pe):[],mt=0,ft=f,Xt=0,rt=u;p&&(--mt,++ft,--Xt,++rt);let ht=1e-5;for(let jn=mt;jn<ft;++jn){let nn=jn;nn<0&&(nn=0),nn>=f&&(nn=f-1);let Wn=A.north-Q*nn;g?Wn=a(Wn):Wn=s-2*r(o(-Wn*y));let Zi=(Wn-T)/(v-T);Zi=D.clamp(Zi,0,1);let Mr=jn===mt,fo=jn===ft-1;d>0&&(Mr?Wn+=ht*G:fo&&(Wn-=ht*G));let Bs=t(Wn),Ks=n(Wn),no=ae*Ks,mi;R&&(mi=(gi.geodeticLatitudeToMercatorAngle(Wn)-we)*Se);for(let ho=Xt;ho<rt;++ho){let ur=ho;ur<0&&(ur=0),ur>=u&&(ur=u-1);let Zo=nn*(u*V)+ur*V,Bn;if(F===1)Bn=c[Zo];else{Bn=0;let Kr;if(j)for(Kr=0;Kr<F;++Kr)Bn=Bn*B+c[Zo+Kr];else for(Kr=F-1;Kr>=0;--Kr)Bn=Bn*B+c[Zo+Kr]}Bn=Bn*P+M,fe=Math.max(fe,Bn),Ae=Math.min(Ae,Bn);let qi=A.west+q*ur;g?qi=a(qi):qi=qi*y;let ki=(qi-x)/(E-x);ki=D.clamp(ki,0,1);let Nr=nn*u+ur;if(d>0){let Kr=ho===Xt,Ol=ho===rt-1,Z0=Mr||fo||Kr||Ol;if((Mr||fo)&&(Kr||Ol))continue;Z0&&(Bn-=d,Kr?(Nr=Xe+(f-nn-1),qi-=ht*k):fo?Nr=Xe+f+(u-ur-1):Ol?(Nr=Xe+f+u+nn,qi+=ht*k):Mr&&(Nr=Xe+f+u+f+ur))}let Wc=Bs*t(qi),xd=Bs*n(qi),xp=J*Wc,Nh=Z*xd,Tp=1/i(xp*Wc+Nh*xd+no*Ks),ks=xp*Tp,tc=Nh*Tp,Yb=no*Tp,ri=new h;ri.x=ks+Wc*Bn,ri.y=tc+xd*Bn,ri.z=Yb+Ks*Bn,N.multiplyByPoint(ge,ri,nK),h.minimumByComponent(nK,Re,Re),h.maximumByComponent(nK,Qe,Qe),He=Math.min(He,Bn),qe[Nr]=ri,vt[Nr]=new U(ki,Zi),st[Nr]=Bn,R&&(Gt[Nr]=mi),C&&(lt[Nr]=m.geodeticSurfaceNormal(ri))}}let Bi=ce.fromPoints(qe),Xn;l(b)&&(Xn=en.fromRectangle(b,Ae,fe,m));let Ai;I&&(Ai=new Xh(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let Wi=new Pf(Re,Qe,S),wi=new _o(S,Wi,He,fe,xe,!1,R,C,O,L),di=new Float32Array(Pe*wi.stride),bi=0;for(let jn=0;jn<Pe;++jn)bi=wi.encode(di,bi,qe[jn],vt[jn],st[jn],void 0,Gt[jn],lt[jn]);return{vertices:di,maximumHeight:fe,minimumHeight:Ae,encoding:wi,boundingSphere3D:Bi,orientedBoundingBox:Xn,occludeePointInScaledSpace:Ai}};var vv=kp;function zy(){pe.throwInstantiationError()}Object.defineProperties(zy.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});zy.prototype.interpolateHeight=pe.throwInstantiationError;zy.prototype.isChildAvailable=pe.throwInstantiationError;zy.prototype.createMesh=pe.throwInstantiationError;zy.prototype.upsample=pe.throwInstantiationError;zy.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;zy.maximumAsynchronousTasks=5;var Lu=zy;var gGe=3,rK=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new N,this._needsRebuild=!0,this._rootNode=new oK}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&AGe(this,n);let s=this._inverseTransform,a=yGe;a.origin=N.multiplyByPoint(s,t.origin,a.origin),a.direction=N.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return dme(this._rootNode,a,c),CGe(this,c,t,i,r,o)}},_Ge=new $n("incrementallyBuildTerrainPicker"),oK=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=fme(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=fme(n.x,n.y,n.level),this.children[t]=n}},yGe=new pn,_6=[new h,new h,new h];function AGe(e,t){N.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var bGe=new h,xGe=new h;function fme(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,bGe),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,xGe);return Pf.fromCorners(r,o)}function TGe(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var EGe=new Us;function dme(e,t,n){let i=pi.rayAxisAlignedBoundingBox(t,e.aabb,EGe);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Us(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)dme(e.children[o],t,n)}function CGe(e,t,n,i,r,o){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=vGe(e,n,u.node,i,r,o);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return pn.getPoint(n,a)}function vGe(e,t,n,i,r,o){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=gGe)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=iK(a,r,o,t,u,c[3*A],_6[0]),x=iK(a,r,o,t,u,c[3*A+1],_6[1]),T=iK(a,r,o,t,u,c[3*A+2],_6[2]),E=pi.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&TGe(g,m,_6,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);wGe(e._inverseTransform,n,m,g)}return s}var SGe=new he;function iK(e,t,n,i,r,o,s){let a=e.getExaggeratedPosition(r,o,s);if(t===re.SCENE3D)return a;let u=n.ellipsoid.cartesianToCartographic(a,SGe);a=n.project(u,s),a=h.fromElements(a.z,a.x,a.y,s);let f=D.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-a.y)/f);return a.y+=d*f,a}async function wGe(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);N.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let s={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},a=[o.buffer,r.buffer,n.buffer,i.buffer],c=_Ge.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var jO=rK;function HO(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new N,this._lastPickSceneMode=void 0,this._terrainPicker=new jO(t,n,p)}HO.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?IGe(this,this._transform):LGe(this,t,this._transform))};function IGe(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=Ar.getHeight(e.minimumHeight,n,i),o=Ar.getHeight(e.maximumHeight,n,i),s=en.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return en.computeTransformation(s,t),N.getScale(t,sK).z<=D.EPSILON16&&(sK.z=1,N.setScale(t,sK,t)),t}var PGe=new h,DGe=new h,RGe=new he,OGe=new he,MGe=new h,NGe=new h,sK=new h;function LGe(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=Ar.getHeight(e.minimumHeight,i,r),s=Ar.getHeight(e.maximumHeight,i,r),a=t.project(he.fromRadians(e.rectangle.west,e.rectangle.south,0,RGe),PGe),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,OGe),DGe),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,MGe),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,NGe);return N.fromTranslation(d,n),N.setScale(n,f,n),N.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}HO.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};HO.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};HO.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var lc=HO;function js(){pe.throwInstantiationError()}Object.defineProperties(js.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 hme=[];js.getRegularGridIndices=function(e,t){let n=hme[e];l(n)||(hme[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),_me(e,t,i,0)),i};var mme=[];js.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=mme[e];l(n)||(mme[e]=n=[]);let i=n[t];if(!l(i)){let r=js.getRegularGridIndices(e,t),o=gme(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var pme=[];js.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=pme[e];l(n)||(pme[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=gme(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);_me(e,t,y,0),js.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};js.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};js.getSkirtIndexCount=function(e){return(e-4)*2*3};js.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};js.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=y6(e,a,o,s),a+=e.length,s=y6(t,a,o,s),a+=t.length,s=y6(n,a,o,s),a+=n.length,y6(i,a,o,s)};js.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){js.addSkirtIndices(e,t,n,i,r,o,s);let a=js.getSkirtVertexCount(e,t,n,i),c=js.getSkirtIndexCount(a),u=s+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,E=T+1,v=E+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=v,o[u+9]=d,o[u+10]=E,o[u+11]=y};function gme(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function _me(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function y6(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}js.heightmapTerrainQuality=.25;js.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*js.heightmapTerrainQuality/(t*n)};js.prototype.requestTileGeometry=pe.throwInstantiationError;js.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;js.prototype.getTileDataAvailable=pe.throwInstantiationError;js.prototype.loadTileDataAvailability=pe.throwInstantiationError;var qr=js;function mg(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Md.NONE;let t=vv.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Md.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(mg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var yme="createVerticesFromHeightmap",FGe=new $n(yme),BGe=new $n(yme,Lu.maximumAsynchronousTasks);mg.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?BGe:FGe).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ui,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=qr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=qr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new lc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ce.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),_o.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};mg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ie.center(u)),d=this._structure,g=qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=vv.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ui,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=qr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=qr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new lc(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};mg.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===Md.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=Ame(A,b,f,d,e,i,r,t,n)}else y=kGe(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};mg.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,s),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,S=Math.pow(E,T-1);for(let I=0;I<u;++I){let R=D.lerp(A.north,A.south,I/(u-1));for(let O=0;O<c;++O){let L=D.lerp(A.west,A.east,O/(c-1)),_=Ame(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,UGe(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new mg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};mg.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};mg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function kGe(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let A=f-p,b=d-m;m=a-1-m,y=a-1-y;let x=A6(e,t,n,i,r,m*s+p),T=A6(e,t,n,i,r,m*s+g),E=A6(e,t,n,i,r,y*s+p),v=A6(e,t,n,i,r,y*s+g);return bme(A,b,x,T,E,v)}function Ame(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-d,A=f-g;g=s-1-g,m=s-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,E=(t.decodeHeight(e,m*o+p)-n)/i;return bme(y,A,b,x,T,E)}function bme(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function A6(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function UGe(e,t,n,i,r,o,s,a){s*=r;let c;if(o)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 Rc=mg;function Iv(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Cx=new ie;function zGe(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}Iv.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)zGe(e,g,p,s)||s.push(new Sv(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,Cx);let a=Cx.west,c=Cx.north;o.tileXYToRectangle(i,r,e,Cx);let u=Cx.east,f=Cx.south,d=new WGe(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];aK(g.extent,d)&&qGe(this._maximumLevel,g,d)}};Iv.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(wv(i.extent,e)){t=i;break}}return l(t)?GO(void 0,t,e):-1};var VGe=[],jGe=[],HGe=new ie,GGe=new ie;Iv.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=VGe;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,HGe)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,GGe))):t.push(e);let n=jGe;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)WO(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 xme=new he;Iv.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Cx);return ie.center(i,xme),this.computeMaximumLevelAtPosition(xme)>=e};Iv.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function Sv(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(Sv.prototype,{nw:{get:function(){return this._nw||(this._nw=new Sv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Sv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Sv(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Sv(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function WGe(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function aK(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function qGe(e,t,n){for(;t.level<e;)if(b6(t.nw.extent,n))t=t.nw;else if(b6(t.ne.extent,n))t=t.ne;else if(b6(t.sw.extent,n))t=t.sw;else if(b6(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=vr(t.rectangles,n.level,YGe);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function YGe(e,t){return e.level-t}function b6(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function wv(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function GO(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&wv(t._nw.extent,n),s=t._ne&&wv(t._ne.extent,n),a=t._sw&&wv(t._sw.extent,n),c=t._se&&wv(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,GO(t,t._nw,n))),s&&(i=Math.max(i,GO(t,t._ne,n))),a&&(i=Math.max(i,GO(t,t._sw,n))),c&&(i=Math.max(i,GO(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];wv(a,n)&&(i=a.level)}t=t.parent}return i}function WO(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||aK(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=XGe(e[s.level],s)}WO(e,t._nw,n),WO(e,t._ne,n),WO(e,t._sw,n),WO(e,t._se,n)}function XGe(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];aK(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var Kh=Iv;function KGe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` +${r}`),t}var Up=KGe;function x6(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=s}x6.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new x6(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Up(i)}`),c};x6.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var $r=x6;var cK=new he,lK=new he,Tme=new h,Eme=new h,uK=class{constructor(t){ut(this,"_rectangleSouthwestInMeters");ut(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new gi(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-r,-r),this._rectangleNortheastInMeters=new U(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,Tme),this._projection.unproject(Tme,cK),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Eme),this._projection.unproject(Eme,lK),this._rectangle=new ie(cK.longitude,cK.latitude,lK.longitude,lK.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*a,u=this._rectangleSouthwestInMeters.x+(t+1)*a,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),s=this._projection,a=s.unproject(new h(o.west,o.south)),c=s.unproject(new h(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=s&&(A=s-1),l(i)?(i.x=y,i.y=A,i):new U(y,A)}},Do=uK;var $Ge=15;function Cme(e){this.ellipsoid=e.ellipsoid??ee.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}Cme.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 JGe(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new Qi(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(o.xmin,o.ymin),s.rectangleNortheastInMeters=new U(o.xmax,o.ymax),e.tilingScheme=new Do(s)}else throw new oe("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new oe("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Md.LERC:Md.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Kh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Kh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=qr.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 ZGe(e,t,n){try{let i=await t.fetchJson();JGe(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw $r.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function Vy(){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(Vy.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}}});Vy.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new Cme(t);await ZGe(r,i);let o=new Vy(t);return r.build(o),o._resource=n,o};Vy.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(fK(this,n+1,e*2,t*2))){let d=vme(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new Rc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):$Ge,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Ti.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ti.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function fK(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}Vy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Vy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=fK(this,n,e,t);if(l(i))return i;vme(this,n,e,t)};Vy.prototype.loadTileDataAvailability=function(e,t,n){};function QGe(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function e5e(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=QGe(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function vme(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=e5e(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return fK(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var dK=Vy;var Sme={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Sme);var ln=Sme;var wme=D.EPSILON10;function t5e(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,wme)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],wme)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Fr=t5e;var Ime={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(Ime);var Qc=Ime;var hK=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},Ut=hK;var Pme="https://dev.virtualearth.net/REST/v1/Locations";function mK(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:Pme,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(mK.prototype,{url:{get:function(){return Pme}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});mK.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(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(a,s,u,c)}})})};var pK=mK;var n5e=new h;function zp(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}zp.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new zp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};zp.fromAxisAlignedBoundingBox=function(e){return new zp({minimum:e.minimum,maximum:e.maximum})};zp.packedLength=2*h.packedLength+1;zp.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Rme=new h,Ome=new h,Dme={minimum:Rme,maximum:Ome,offsetAttribute:void 0};zp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Rme),r=h.unpack(e,t+h.packedLength,Ome),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(Dme.offsetAttribute=o===-1?void 0:o,new zp(Dme))};zp.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new Tn,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,n5e),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===mn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new St({attributes:i,indices:r,primitiveType:Oe.LINES,boundingSphere:new ce(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var $h=zp;function gK(){}Object.defineProperties(gK.prototype,{credit:{get:function(){}}});gK.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],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.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(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var _K=gK;function Pv(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}Pv.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};Pv.prototype.evaluate=pe.throwInstantiationError;Pv.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=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 r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};Pv.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};Pv.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Ir=Pv;function Dv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Ir.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(Dv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});Dv.prototype.findTimeInterval=Ir.prototype.findTimeInterval;Dv.prototype.wrapTime=Ir.prototype.wrapTime;Dv.prototype.clampTime=Ir.prototype.clampTime;Dv.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var jy=Dv;var Mme={};Mme.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var Rv=Mme;var Nme=[],Lme=[],Fme=[],Bme=[];function i5e(e,t,n){let i=Nme,r=Fme,o=Lme,s=Bme;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),Rv.solve(i,o,r,s)}function r5e(e){let t=Nme,n=Fme,i=Lme,r=Bme;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),Rv.solve(t,i,n,r)}function Fu(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Ir.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Fu.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}}});Fu.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Fu({times:t,points:n,inTangents:o,outTangents:r})};Fu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new jy({points:n,times:t});let i=r5e(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Fu({times:t,points:n,inTangents:o,outTangents:r})};Fu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Ir.getPointType(n[0]);if(n.length<3)return new jy({points:n,times:t});let s=i5e(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Fu({times:t,points:n,inTangents:c,outTangents:a})};Fu.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Fu.prototype.findTimeInterval=Ir.prototype.findTimeInterval;var o5e=new se,Ov=new h;Fu.prototype.wrapTime=Ir.prototype.wrapTime;Fu.prototype.clampTime=Ir.prototype.clampTime;Fu.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=o5e;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=N.multiplyByVector(Fu.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,Ov),d.add(t,Ov,t),d.multiplyByScalar(o[s],f.z,Ov),d.add(t,Ov,t),d.multiplyByScalar(r[s],f.w,Ov),d.add(t,Ov,t))};var Hy=Fu;var s5e=new se,kme=new h,Mv=new h;function a5e(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=s5e;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,kme),h.multiplyByScalar(d,.5,d),p=N.multiplyByVector(Hy.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],kme),h.multiplyByScalar(f,.5,f),p=N.multiplyByVector(Hy.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(Gy.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,Mv),h.add(r,Mv,r),h.multiplyByScalar(f,p.z,Mv),h.add(r,Mv,r),h.multiplyByScalar(d,p.w,Mv),h.add(r,Mv,r)}}var c5e=new h,l5e=new h;function Gy(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=c5e,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=l5e,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=a5e(this),this._lastTimeIndex=0}Object.defineProperties(Gy.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}}});Gy.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Gy.prototype.findTimeInterval=Ir.prototype.findTimeInterval;Gy.prototype.wrapTime=Ir.prototype.wrapTime;Gy.prototype.clampTime=Ir.prototype.clampTime;Gy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var yK=Gy;var ldn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo: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;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb: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:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,x),A&&A(x,x,m.length,y);var S=g(T,x,m.length,y);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(y);new Uint8Array(I.buffer).set(E.subarray(T,T+y*4)),v.set(E.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=I[m[R]];return[I,S]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),T),g(x,T,y,A),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(E.subarray(x,x+y*4)),b(x-b(0)),v}function u(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(m),S=E(A*b),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),S);var R=g(v,m,S,A,b,x,T),O=new Uint8Array(R);return O.set(I.subarray(v,v+R)),E(v-E(0)),O}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(y*A),S=E(y*x),I=new Uint8Array(n.exports.memory.buffer);I.set(s(m),S),g(v,y,A,b,S,T);var R=new Uint8Array(y*A);return R.set(I.subarray(v,v+y*A)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var Wy=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W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9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaC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8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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 r=WebAssembly.validate(n)?a(t):a(e),o,s=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function a(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var E=b.charCodeAt(T);x[T]=E>96?E-97:E>64?E-39:E+4}for(var v=0,T=0;T<b.length;++T)x[v++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(b,x,T,E,v,S,I){var R=b.exports.sbrk,O=E+3&-4,L=R(O*v),_=R(S.length),C=new Uint8Array(b.exports.memory.buffer);C.set(S,_);var w=x(L,E,v,_,S.length);if(w==0&&I&&I(L,O,v),T.set(C.subarray(L,L+E*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var E=T.data;x.pending-=E.count,x.requests[E.id][E.action](E.value),delete x.requests[E.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),E=URL.createObjectURL(T),v=d.length;v<b;++v)d[v]=g(E);for(var v=b;v<d.length;++v)d[v].object.postMessage({});d.length=b,URL.revokeObjectURL(E)}function y(b,x,T,E,v){for(var S=d[0],I=1;I<d.length;++I)d[I].pending<S.pending&&(S=d[I]);return new Promise(function(R,O){var L=new Uint8Array(T),_=++p;S.pending+=b,S.requests[_]={resolve:R,reject:O},S.object.postMessage({id:_,count:b,size:x,source:L,mode:E,filter:v},[L.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var E=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],E,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,E,v){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,E,o.exports[u[v]])},decodeIndexBuffer:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,E)},decodeIndexSequence:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,E)},decodeGltfBuffer:function(b,x,T,E,v,S){c(o,o.exports[f[v]],b,x,T,E,o.exports[u[S]])},decodeGltfBufferAsync:function(b,x,T,E,v){return d.length>0?y(b,x,T,f[E],u[v]):s.then(function(){var S=new Uint8Array(b*x);return c(o,o.exports[f[E]],S,b,x,T,o.exports[u[v]]),S})}}})();var ddn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjj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BaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Ac8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAk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YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NM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aRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86a8XN:tg85a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Va8VMMa8:NanMMM:lNJbb;aZNJ:983:g81M9Emba8JaBUdwa8Ja85Udla8Ja87UdbkaXcefgXal9hmbkdnaCmbcbhCxdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:t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qavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),E=0;E<x.length;++E){var v=x.charCodeAt(E);T[E]=v>96?v-97:v>64?v-39:v+4}for(var S=0,E=0;E<x.length;++E)T[S++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,S)}function o(x){if(!x)throw new Error("Assertion failed")}function s(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function a(x,T,E,v){var S=n.exports.sbrk,I=S(E*4),R=S(E*v*4),O=new Uint8Array(n.exports.memory.buffer);O.set(s(T),R),x(I,R,E,v*4),O=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(O.subarray(I,I+E*4)),S(I-S(0)),L}function c(x,T,E){var v=n.exports.sbrk,S=v(T.length*4),I=v(E*4),R=new Uint8Array(n.exports.memory.buffer),O=s(T);R.set(O,S);var L=x(I,S,T.length,E);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(R.subarray(I,I+E*4)),v(S-v(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(x){for(var T=0,E=0;E<x.length;++E){var v=x[E];T=T<v?v:T}return T}function f(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),P=_(S*I),M=_(E*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(v),P),F.set(s(T),M);var V=x(w,M,E,P,S,I,R,O,L,C);F=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(V);s(B).set(F.subarray(w,w+V*4));var j=new Float32Array(1);return s(j).set(F.subarray(C,C+4)),_(C-_(0)),[B,j[0]]}function d(x,T,E,v,S,I,R,O,L,_,C,w,P){var M=n.exports.sbrk,F=M(4),V=M(E*4),B=M(S*I),j=M(S*O),k=M(L.length*4),G=M(E*4),q=_?M(S):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(s(v),B),Q.set(s(R),j),Q.set(s(L),k),Q.set(s(T),G),_&&Q.set(s(_),q);var W=x(V,G,E,B,S,I,j,O,k,L.length,q,C,w,P,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(W);s(J).set(Q.subarray(V,V+W*4));var Z=new Float32Array(1);return s(Z).set(Q.subarray(F,F+4)),M(F-M(0)),[J,Z[0]]}function p(x,T,E,v,S,I,R,O,L,_,C,w,P){var M=n.exports.sbrk,F=M(4),V=M(S*I),B=M(S*O),j=M(L.length*4),k=M(E*4),G=_?M(S):0,q=new Uint8Array(n.exports.memory.buffer);q.set(s(v),V),q.set(s(R),B),q.set(s(L),j),q.set(s(T),k),_&&q.set(s(_),G);var Q=x(k,E,V,S,I,B,O,j,L.length,G,C,w,P,F);q=new Uint8Array(n.exports.memory.buffer),s(T).set(q.subarray(k,k+Q*4)),s(v).set(q.subarray(V,V+S*I)),s(R).set(q.subarray(B,B+S*O));var W=new Float32Array(1);return s(W).set(q.subarray(F,F+4)),M(F-M(0)),[Q,W[0]]}function g(x,T,E,v){var S=n.exports.sbrk,I=S(E*v),R=new Uint8Array(n.exports.memory.buffer);R.set(s(T),I);var O=x(I,E,v);return S(I-S(0)),O}function m(x,T,E,v,S,I,R,O){var L=n.exports.sbrk,_=L(O*4),C=L(E*v),w=S?L(E*I):0,P=new Uint8Array(n.exports.memory.buffer);P.set(s(T),C),S&&P.set(s(S),w);var M=x(_,C,E,v,w,I,R,O);P=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(M);return s(F).set(P.subarray(_,_+M*4)),L(_-L(0)),F}function y(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),P=_(S*I),M=_(E*4),F=R?_(S):0,V=new Uint8Array(n.exports.memory.buffer);V.set(s(v),P),V.set(s(T),M),R&&V.set(s(R),F);var B=x(w,M,E,P,S,I,F,O,L,C);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(V.subarray(w,w+B*4));var k=new Float32Array(1);return s(k).set(V.subarray(C,C+4)),_(C-_(0)),[j,k[0]]}function A(x,T,E,v,S,I,R){var O=n.exports.sbrk,L=O(E*4),_=O(S*I),C=O(E*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(v),_),w.set(s(T),C);var P=x(L,C,E,_,S,I,R);w=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(P);return s(M).set(w.subarray(L,L+P*4)),O(L-O(0)),M}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var v=0;v<T.length;++v)x[v]=T[v];return E},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),a(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0&&v<=x.length),o(v%3==0),o(S>=0);for(var R=0,O=0;O<(I?I.length:0);++O)o(I[O]in b),R|=b[I[O]];var L=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,L,x.length,T,T.length/E,E*4,v,S,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=d(n.exports.meshopt_simplifyWithAttributes,P,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);return M[0]=x instanceof Uint32Array?M[0]:new x.constructor(M[0]),M},simplifyWithUpdate:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=p(n.exports.meshopt_simplifyWithUpdate,P,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);if(x!==P)for(var C=0;C<M[0];++C)x[C]=P[C];return M},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,E,v,S,I){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(E>=0&&E<=x.length/T),v?(o(v instanceof Float32Array),o(v.length%S==0),o(S>=3),o(x.length/T==v.length/S),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,v,S*4,I||0,E)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v==null||v instanceof Uint8Array),o(v==null||v.length==T.length/E),o(S>=0&&S<=x.length),o(S%3==0),o(I>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/E,E*4,v,S,I);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},simplifyPrune:function(x,T,E,v){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0);var S=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),I=A(n.exports.meshopt_simplifyPrune,S,x.length,T,T.length/E,E*4,v);return I=x instanceof Uint32Array?I:new x.constructor(I),I}}})();var mdn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9U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ci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var a=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],E=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+E*3)}}function f(y,A,b,x,T,E,v,S,I,R){var O=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(A.length,E,v),_=O(L*c),C=O(A.length*4),w=O(A.length),P=O(A.byteLength),M=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(s(A),P),F.set(s(b),M);var V=y(_,C,w,P,A.length,M,x,T,E,v,S,I,R);F=new Uint8Array(n.exports.memory.buffer);for(var B=F.subarray(_,_+V*c),j=new Uint32Array(B.buffer,B.byteOffset,B.byteLength/4).slice(),k=0;k<V;++k){var G=j[k*4+0],q=j[k*4+1],x=j[k*4+2],Q=j[k*4+3];n.exports.meshopt_optimizeMeshlet(C+G*4,w+q,Q,x)}var W=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,C,W).slice(),triangles:new Uint8Array(F.buffer,w,J).slice(),meshletCount:V};return O(_-O(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,a/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,E=[],v=T(A.byteLength),S=T(y.vertices.byteLength),I=T(y.triangles.byteLength),R=T(a),O=new Uint8Array(n.exports.memory.buffer);O.set(s(A),v),O.set(s(y.vertices),S),O.set(s(y.triangles),I);for(var L=0;L<y.meshletCount;++L){var _=y.meshlets[L*4+0],C=y.meshlets[L*4+1],w=y.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(R,S+_*4,I+C,w,v,b,x),E.push(d(R))}return T(v-T(0)),E}function g(y,A,b,x){var T=n.exports.sbrk,E=T(a),v=T(y.byteLength),S=T(A.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),v),I.set(s(A),S),n.exports.meshopt_computeClusterBounds(E,v,y.length,S,b,x);var R=d(E);return T(E-T(0)),R}function m(y,A,b,x,T){var E=n.exports.sbrk,v=E(a),S=E(y.byteLength),I=x?E(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),x&&R.set(s(x),I),n.exports.meshopt_computeSphereBounds(v,S,A,b,I,x?T:0);var O=d(v);return E(v-E(0)),O}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),E=E||0;var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,v,A,A.length/b,b*4,x,T,T,E,0)},buildMeshletsFlex:function(y,A,b,x,T,E,v,S){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0,S=S||0;var I=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,I,A,A.length/b,b*4,x,T,E,v,S)},buildMeshletsSpatial:function(y,A,b,x,T,E,v){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0;var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,S,A,A.length/b,b*4,x,T,E,v)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var gdn=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8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:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOxekaxazc:e:G:cjbfydbcdtfhAaxazcj:G:cjbfydbcdtfhrawhOkaHasIdbggaoamaOcdtfydbgQaC2cdtfgOIdbg8KasIdwg8FaOIdwg8JNaga8KNasIdlg8EaOIdlggNMMghN:tgaJbbbbJbbjZa8Fa8JahN:tg8Fa8FNaaaaNa8EagahN:tghahNMMga:r:vaaJbbbb9BEJ;As6nJbbjZaiarydbaX2cdtfgOIdwaiaQaX2cdtfgrIdwg5:tgaa8Jaaa8JNaOIdbarIdbgy:tg8Pa8KNagaOIdlarIdlgI:tg8RNMMgaN:tg8EaiaAydbaX2cdtfgOIdwa5:tg5a8Ja5a8JNaOIdbay:tg8Sa8KNagaOIdlaI:tgINMMg5N:tg8JNa8Pa8KaaN:tgya8Sa8Ka5N:tg8KNa8RagaaN:tgaaIaga5N:tggNMMJbbbbJbbjZa8Ea8ENayayNaaaaNMMa8Ja8JNa8Ka8KNagagNMMNg8K:rg8J:va8KJbbbb9BENgg:lg8Ka8KJbbjZ9EEg8Ka8KJ7;A9s89NJ:L9t9s::MNJ;ob;jZMJbbjZa8K:t:rNg8K:ta8KagJbbbb9DENg8Ka8Ja8KNaEEg8KNaHIdbMUdbaHaha8KNaHIdlMUdlaHa8Fa8KNaHIdwMUdwawcefhwazclfgzcx9hmbkkaYcxfhYa3cxfh3a8Vcifh8Va8Wcefg8WaP9hmbkcbhrinarhzdnaravarcdtfgsydbgHSmbinasavaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkaKarc8W2fgHc3fJbbjZJbbj:;a8AazfRbbceGEg8KUdbaHc8Sfa8KUdbaHa8KUdxarcefgraP9hmbkkaqcdGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",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(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function s(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function a(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,E=T(f*16),v=u?T(u.byteLength):0,S=T(d.byteLength),I=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(s(u),v),O.set(s(d),S),O.set(s(m),I),O.set(s(A),R),n.exports.meshopt_generateTangents(E,v,f,S,p,g*4,I,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var L=new Float32Array(O.buffer,E,f*4).slice();return T(E-T(0)),L}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,E=u?u.length:T,v=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return a(v,E,f,T,d,p,g,m,y,b)}}})();var Vp={X:0,Y:1,Z:2};Vp.Y_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Vp.Z_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Vp.X_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Vp.Z_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Vp.X_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Vp.Y_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Vp.fromName=function(e){return Vp[e]};Object.freeze(Vp);var zi=Vp;var AK={},u5e={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},f5e=new he,d5e=new h,h5e=new N,m5e=new N,p5e=new N,g5e=new h,_5e=new h,y5e=new h,A5e=new h,b5e=new he,x5e=new U,qO=new h,T5e=new U,E5e=new h,C5e=new h,T6=function(e,t){return e-t};AK.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,d=ce.clone(e.boundingSphere,new ce),p=en.clone(e.orientedBoundingBox,new en),g=h.clone(e.horizonOcclusionPoint,new h),m=ee.clone(e.ellipsoid,new ee),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?Wy.ready:Promise.resolve(void 0));let x=y.west,T=y.south,E=y.north,v=y.width,S=y.height,I=ie.center(y,f5e);I.height=.5*(s+a);let R=he.toCartesian(I,m,d5e),O=At.eastNorthUpToFixedFrame(R,m,h5e),L=N.inverseTransformation(O,m5e),_=N.unpack(o.nodes[0].matrix,0,p5e);_=N.multiply(zi.Y_UP_TO_Z_UP,_,_);let C=i9e(o,i,u5e),w=qr.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),P=C.positions,M=C.normals,F=C.indices,V=P.length/3,B=V+w,j=F.length,k=qr.getSkirtIndexCountWithFilledCorners(w),G=B<=65535?Uint16Array:Uint32Array,q=new G(j+k);q.set(F);let Q=new G(C.edgeIndicesWest),W=new G(C.edgeIndicesSouth),J=new G(C.edgeIndicesEast),Z=new G(C.edgeIndicesNorth),ae=new G(Q).sort(),Ae=new G(W).sort(),fe=new G(J).sort(),xe=new G(Z).sort(),ge=gi.geodeticLatitudeToMercatorAngle(T),Se=1/(gi.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,g5e),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,_5e),He=new _o(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),Xe=He.stride,$e=new Float32Array(B*Xe),Pe=0;for(let st=0;st<V;st++){let vt=h.unpack(P,st*3,y5e),Gt=N.multiplyByPoint(_,vt,A5e),lt=he.fromCartesian(Gt,m,b5e),{longitude:mt,latitude:ft,height:Xt}=lt,rt=(mt-x)/v,ht=(ft-T)/S;rt=D.clamp(rt,0,1),ht=D.clamp(ht,0,1),vr(ae,st,T6)>=0?rt=0:vr(fe,st,T6)>=0&&(rt=1),vr(Ae,st,T6)>=0?ht=0:vr(xe,st,T6)>=0&&(ht=1);let Bi=U.fromElements(rt,ht,x5e),Xn;if(i){let di=h.unpack(M,st*3,qO);di=N.multiplyByPointAsVector(_,di,qO),di=h.normalize(di,qO),Xn=cn.octEncode(di,T5e)}let Ai;r&&(Ai=(gi.geodeticLatitudeToMercatorAngle(ft)-ge)*Se);let Wi;f&&(Wi=m.geodeticSurfaceNormal(Gt,E5e)),Pe=He.encode($e,Pe,Gt,Bi,Xt,Xn,Ai,Wi);let wi=N.multiplyByPoint(L,Gt,C5e);Re=h.minimumByComponent(wi,Re,Re),Qe=h.maximumByComponent(wi,Qe,Qe)}let qe=new lc(h.clone(He.center,new h),$e,q,j,V,s,a,y,ce.clone(d,new ce),h.clone(g,new h),Xe,en.clone(p,new en),He,Q,W,J,Z);return Wme(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var v5e=new U,S5e=new U,w5e=new Array(6),I5e=new U,P5e=new U,D5e=new U,R5e=new h,O5e=new h,M5e=new h,N5e=new he,L5e=new h,F5e=new he,B5e=new he,Ume=new h,k5e=new h,U5e=new h,z5e=new h,V5e=new h,j5e=new h,H5e=new h,G5e=new h,W5e=new N,q5e=new N,zme=new U,Y5e=new U,X5e=new h,K5e=new ce,$5e=new en,J5e=new Pf,Vme=new h,jme=new U,Z5e=new U,Hme=new h,Q5e=new h;function e9e(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);Wy.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,a);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function t9e(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);Wy.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,a);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*D.signNotZero(A),g=(1-Math.abs(A))*D.signNotZero(b)}let y=qO;y.x=p,y.y=g,y.z=m,y=h.normalize(y,qO),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function n9e(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),u=new o(r);return Wy.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function E6(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,s=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(o),d=a.byteStride;return Wy.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function i9e(e,t,n){return n.positions=e9e(e),n.normals=t?t9e(e):void 0,n.indices=n9e(e),n.edgeIndicesWest=E6(e,"left"),n.edgeIndicesSouth=E6(e,"bottom"),n.edgeIndicesEast=E6(e,"right"),n.edgeIndicesNorth=E6(e,"top"),n}AK.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=_o.clone(e.parentEncoding,new _o),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=ee.clone(e.ellipsoid),T=[],E=[],v=[],S=[],I=[],R=[],O=[],L=[];g9e(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,N5e);_.height=.5*(i+r);let C=he.toCartesian(_,x,L5e),w=T.length,P=new _o(C,void 0,void 0,void 0,void 0,d,p,A,g,m),M=P.stride,F=qr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=qr.getSkirtIndexCountWithFilledCorners(F),k=B+j,G=V<=65535?Uint16Array:Uint32Array,q=new G(k);q.set(S);let Q=new G(I),W=new G(R),J=new G(O),Z=new G(L),ae=new Float32Array(V*M),Ae=0,fe=At.eastNorthUpToFixedFrame(C,x,W5e),xe=N.inverseTransformation(fe,q5e),ge=b.west,we=b.east,Se=b.south,Re=b.north,Qe=gi.geodeticLatitudeToMercatorAngle(Se),Xe=1/(gi.geodeticLatitudeToMercatorAngle(Re)-Qe),$e=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,H5e),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G5e);for(let Xt=0;Xt<w;Xt++){let rt=T[Xt],ht=a[rt*3+0],Bi=a[rt*3+1],Xn=a[rt*3+2],Ai=Y5e;Ai.x=E[Xt*2+0],Ai.y=E[Xt*2+1];let Wi=Ai.x,wi=Ai.y,di=v[Xt*2+0],bi=v[Xt*2+1],jn=1-di-bi,nn=f.decodeHeight(u,ht),Wn=f.decodeHeight(u,Bi),Zi=f.decodeHeight(u,Xn),Mr=nn*di+Wn*bi+Zi*jn;$e=Math.min(Mr,$e),Pe=Math.max(Mr,Pe);let fo=D.lerp(ge,we,Wi),Bs=D.lerp(Se,Re,wi),Ks=he.fromRadians(fo,Bs,Mr,B5e),no=he.toCartesian(Ks,x,k5e),mi=N.multiplyByPoint(xe,no,z5e);qe=h.minimumByComponent(mi,qe,qe),st=h.maximumByComponent(mi,st,st);let ho;if(d){let Bn=f.decodeNormal(u,ht,R5e),qi=f.decodeNormal(u,Bi,O5e),ki=f.decodeNormal(u,Xn,M5e),Nr=h.fromElements(Bn.x*di+qi.x*bi+ki.x*jn,Bn.y*di+qi.y*bi+ki.y*jn,Bn.z*di+qi.z*bi+ki.z*jn,Vme);Nr=h.normalize(Nr,Vme),ho=cn.octEncode(Nr,Z5e)}let ur;p&&(ur=(gi.geodeticLatitudeToMercatorAngle(Bs)-Qe)*Xe);let Zo;A&&(Zo=x.geodeticSurfaceNormal(no,Q5e)),Ae=P.encode(ae,Ae,no,Ai,Mr,ho,ur,Zo)}let vt=en.fromRectangle(b,$e,Pe,x,$5e),Gt=ce.fromVertices(ae,P.center,M,K5e),mt=new Xh(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(P.center,ae,M,P.center,$e,X5e),ft=new lc(h.clone(P.center,new h),ae,q,B,w,$e,Pe,b,ce.clone(Gt),h.clone(mt),M,en.clone(vt),P,Q,W,J,Z);return Wme(ft,b,x,qe,st,fe,xe,o),ft};function Wme(e,t,n,i,r,o,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,E=T-b,v=e.indices,S=e.indexCountWithoutSkirts,I=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;qr.addSkirtIndicesWithFilledCorners(I,R,O,L,b,v,S);let _=0,C=_+I.length,w=C+R.length,P=w+O.length,M=[I,R,O,L],F=[_,C,w,P],V=[-1,0,1,0],B=[0,-1,0,1],j=h.clone(i,V5e),k=h.clone(r,j5e),G=e.maximumHeight,q=e.minimumHeight-a;for(let J=0;J<E;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ae=M[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ae,zme),fe=1e-4,xe=Ae.x+V[Z]*fe,ge=Ae.y+B[Z]*fe,we=D.lerp(t.west,t.east,xe),Se=D.clamp(D.lerp(t.south,t.north,ge),-D.PI_OVER_TWO,+D.PI_OVER_TWO),Qe=c.decodeHeight(f,ae)-a,He=he.fromRadians(we,Se,Qe,F5e),Xe=he.toCartesian(He,n,Ume),$e;d&&($e=c.getOctEncodedNormal(f,ae,jme));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Xe,Hme)),x=c.encode(f,x,Xe,Ae,Qe,$e,Pe,qe);let st=N.multiplyByPoint(s,Xe,U5e);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=Pf.fromCorners(j,k,J5e),W=new _o(c.center,Q,q,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==W.quantization){let J=W,Z=J.stride,ae=new Float32Array(T*Z),Ae=0;for(let fe=0;fe<T;fe++)Ae=J.encode(ae,Ae,c.decodePosition(f,fe,Ume),c.decodeTextureCoordinates(f,fe,zme),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,jme):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,Hme):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var bK=0,r9e=1,xK=2,TK=3,o9e=4,s9e=new h,a9e=[new h,new h,new h,new h,new h,new h],c9e=[new U,new U,new U,new U,new U,new U],l9e=[new h,new h,new h,new h,new h,new h],u9e=[new U,new U,new U,new U,new U,new U];function Gme(e,t,n,i){switch(n){case bK:return D.sign(i.x-e.x);case xK:return D.sign(t.x-i.x);case TK:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function f9e(e,t,n,i,r,o){let s,a,c;switch(n){case bK:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case xK:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case TK:s=(e.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,o)}var d9e={length:0,coordinates:[new U,new U,new U,new U,new U,new U],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function h9e(e,t,n,i,r,o,s,a){let c,u=c9e,f=a9e,d=3,p=u9e;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=l9e;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%o9e,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],E=f[x],v=Gme(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=Gme(n,i,y,I);if(v*O===-1){let L=f9e(n,i,y,T,I,s9e),{x:_,y:C,z:w}=L,P=1-w,M=E.x*P+R.x*w,F=E.y*P+R.y*w,V=E.z*P+R.z*w;U.fromElements(_,C,p[d]),h.fromElements(M,F,V,g[d]),d++}O>=0&&(U.clone(I,p[d]),h.clone(R,g[d]),d++),T=I,E=R,v=O}if(d===0)break}a.length=d;for(let m=0;m<d;m++)U.clone(p[m],a.coordinates[m]),h.clone(g[m],a.barycentricCoordinates[m]);return a}function m9e(e,t,n,i,r,o,s,a){return h9e(e?t?TK:bK:t?xK:r9e,2,n,i,r,o,s,a)}var p9e=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function g9e(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,E=v5e;E.x=A,E.y=x;let v=S5e;v.x=b,v.y=T;let S=0;for(let I=0;I<n;I+=3){let R=i[I+0],O=i[I+1],L=i[I+2],_=s.decodeTextureCoordinates(o,R,I5e),C=s.decodeTextureCoordinates(o,O,P5e),w=s.decodeTextureCoordinates(o,L,D5e),P=m9e(e,t,E,v,_,C,w,d9e),M=P.length;if(M<3)continue;let F=w5e;for(let k=0;k<M;k++){let G=P.barycentricCoordinates[k],q=G.x,Q=G.y,W=G.z,J=Math.ceil(q)|Math.ceil(Q)<<1|Math.ceil(W)<<2,Z=p9e[J],ae,Ae=!1;if(Z.length===1){let fe=Z[0],ge=i[I+fe];ae=y[ge],ae===void 0&&(Ae=!0,ae=S++,y[ge]=ae)}else if(Z.length===2){let fe=Z[0],xe=Z[1],ge=i[I+fe],we=i[I+xe],Se=P.barycentricCoordinates[(k+M-1)%M],Re=Math.ceil(Se.x)|Math.ceil(Se.y)<<1|Math.ceil(Se.z)<<2,Qe=J===Re,He=Math.min(ge,we),Xe=Math.max(ge,we),$e=r+2*(He*r+Xe),Pe=$e+0,qe=$e+1,st=y[Pe],vt=y[qe],Gt=!Qe==(st===void 0||vt===void 0);if(ae=Gt?st:vt,ae===void 0){Ae=!0,ae=S++;let lt=Gt?Pe:qe;y[lt]=ae}}else Ae=!0,ae=S++;if(F[k]=ae,Ae){let fe=I/3;p.push(fe);let xe=P.coordinates[k],ge=(xe.x-A)/(b-A),we=(xe.y-x)/(T-x);m.push(ge,we),g.push(q,Q),ge===0?c.push(ae):ge===1&&f.push(ae),we===0?u.push(ae):we===1&&d.push(ae)}}let V=F[0],B=F[1],j=F[2];a.push(V,B,j);for(let k=3;k<M;k++)B=j,j=F[k],a.push(V,B,j)}c.sort(function(I,R){return m[I*2+1]-m[R*2+1]}),u.sort(function(I,R){return m[R*2+0]-m[I*2+0]}),f.sort(function(I,R){return m[R*2+1]-m[I*2+1]}),d.sort(function(I,R){return m[I*2+0]-m[R*2+0]})}var Nv=AK;var C6={};C6.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};C6.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,y=e-s,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};C6.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Jh=C6;function gg(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ce.clone(e.boundingSphere,new ce),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(gg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});gg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:Yme(i,e,t,n)};gg.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var qme="createVerticesFromCesium3DTilesTerrain",_9e=new $n(qme),y9e=new $n(qme,Lu.maximumAsynchronousTasks);gg.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?y9e:_9e,i=e.tilingScheme,r=i.ellipsoid,o=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(o,s,a,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=_o.clone(g.encoding,new _o),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),E=new x(g.westIndicesBuffer),v=new x(g.eastIndicesBuffer),S=new x(g.southIndicesBuffer),I=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=ce.clone(d._boundingSphere,new ce),w=h.clone(d._horizonOcclusionPoint,new h),P=en.clone(d._orientedBoundingBox,new en),M=new lc(_,y,T,R,b,O,L,c,C,w,m.stride,P,m,E,S,v,I);return d._mesh=M,Promise.resolve(M)})};gg.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,s=t.tileXYToRectangle(i,r,o,new ie),a=Nv.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(u){return c._mesh=u,Promise.resolve(u)})};gg.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:v6(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};gg.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:v6(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};gg.prototype.wasCreatedByUpsampling=function(){return!1};function pg(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}pg.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};pg.prototype.upsample=function(e,t,n,i,r,o,s){return v6(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};pg.prototype._upsampleSync=function(e,t,n,i,r,o,s){return v6(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};pg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return Yme(i,e,t,n)};pg.prototype.wasCreatedByUpsampling=function(){return!0};pg.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(pg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var A9e=new $n("upsampleVerticesFromCesium3DTilesTerrain",Lu.maximumAsynchronousTasks);function v6(e,t,n,i,r,o,s,a,c,u,f){if(f-a>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=s*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=Nv.upsampleMesh(b),E=new pg({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=A9e.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=_o.clone(T.encoding,new _o),v=E.stride,S=new Float32Array(T.verticesBuffer),I=S.length/v,R=T.vertexCountWithoutSkirts,O=I<=65535?Uint16Array:Uint32Array,L=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),C=new O(T.eastIndicesBuffer),w=new O(T.southIndicesBuffer),P=new O(T.northIndicesBuffer),M=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,B=h.clone(E.center,new h),j=ce.clone(T.boundingSphere,new ce),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new lc(B,S,L,M,R,F,V,y,j,k,v,G,E,_,w,C,P),Q=new pg({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var b9e=new U,x9e=new U,T9e=new U,E9e=new h;function Yme(e,t,n,i){let r=D.clamp((n-t.west)/t.width,0,1),o=D.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=a.decodeTextureCoordinates(s,f,b9e),m=a.decodeTextureCoordinates(s,d,x9e),y=a.decodeTextureCoordinates(s,p,T9e),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let E=Jh.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,E9e);if(E.x>=0&&E.y>=0&&E.z>=0){let v=a.decodeHeight(s,f),S=a.decodeHeight(s,d),I=a.decodeHeight(s,p);return E.x*v+E.y*S+E.z*I}}}return 0}var YO=gg;function Zh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Zh.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}}});Zh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Zh({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Zh.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};Zh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Xme(this,t)};Zh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Xme(this,i),t};Zh.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],Kme(this,0)),this._array[e-1]=void 0,t};Zh.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=EK(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Kme(this,n)}return this._array[e-1]=void 0,t};Zh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Zh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[EK(this,1,2)?1:2]};function S6(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function XO(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function EK(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Xme(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=XO(e,t,i);for(r!==n&&(S6(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(XO(e,t,o)!==r)break;S6(e,t,o),t=o}}function Kme(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){XO(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;XO(e,f,o)===i&&(o=f)}}if(XO(e,o,t)===i&&(S6(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);EK(e,o,a)===i&&S6(e,o,a)}t=o}}var _g=Zh;function qy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),qy.decode(e)}qy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};qy.decodeWithFromCharCode=function(e){let t="",n=C9e(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function KO(e,t,n){return t<=e&&e<=n}function C9e(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(KO(u,0,127)){s.push(u);continue}if(KO(u,194,223)){i=1,t=u&31;continue}if(KO(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(KO(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!KO(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?qy.decode=qy.decodeWithTextDecoder:qy.decode=qy.decodeWithFromCharCode;var Bu=qy;function v9e(e,t,n){return JSON.parse(Bu(e,t,n))}var Ro=v9e;function S9e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var er=S9e;function CK(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=w9e(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function w9e(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(CK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});CK.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 Lv=CK;function yg(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(yg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yg.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};yg.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};yg.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};yg.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};yg.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};yg.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};yg.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Fv=yg;var $O={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};$O.getBranchingFactor=function(e){switch(e){case $O.OCTREE:return 8;case $O.QUADTREE:return 4}};Object.freeze($O);var Hs=$O;function uc(){}Object.defineProperties(uc.prototype,{class:{get:function(){pe.throwInstantiationError()}}});uc.prototype.hasProperty=function(e){pe.throwInstantiationError()};uc.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};uc.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};uc.prototype.getProperty=function(e){pe.throwInstantiationError()};uc.prototype.setProperty=function(e,t){pe.throwInstantiationError()};uc.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};uc.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};uc.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};uc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};uc.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};uc.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&l(r.slice)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Je(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};uc.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};uc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return uc.getProperty(r.id,t,n)};uc.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?uc.setProperty(o.id,t,n,i):!1};var Yn=uc;function Ag(e){e=e??H.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(Ag.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ag.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Ag.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Ag.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Ag.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Ag.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Ag.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Ag.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var JO=Ag;var $me={};function ZO(e,t){l($me[e])||($me[e]=!0,console.warn(t??e))}ZO.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.";ZO.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";ZO.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";ZO.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var _t=ZO;var fn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},el={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};fn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:el.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:el.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:el.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:el.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:el.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:el.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:el.INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:el.UNSIGNED_INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:el.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:el.FLOAT,downcastFunction:e=>Math.fround(e)}};fn.getMinimum=function(e){return fn.typeInfo[e].minimumValue};fn.getMaximum=function(e){return fn.typeInfo[e].maximumValue};fn.isIntegerType=function(e){return fn.typeInfo[e].category!==el.FLOAT};fn.isUnsignedIntegerType=function(e){return fn.typeInfo[e].category===el.UNSIGNED_INTEGER};fn.isVectorCompatible=function(e){return fn.typeInfo[e].vectorCompatible};fn.category=function(e){return fn.typeInfo[e].category};fn.gpuComponentType=function(e){switch(e){case fn.INT64:return"INT32";case fn.UINT64:return"UINT32";case fn.FLOAT64:return"FLOAT32";default:return e}};fn.normalize=function(e,t){return Math.max(Number(e)/Number(fn.getMaximum(t)),-1)};fn.unnormalize=function(e,t){let n=fn.getMaximum(t),i=fn.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===fn.INT64||t===fn.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};fn.applyValueTransform=function(e,t,n){return n*e+t};fn.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};fn.getSizeInBytes=function(e){return fn.typeInfo[e].size};fn.clampToLimits=function(e,t){let n=fn.getMinimum(t),i=fn.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};fn.downcastFunction=function(e){let n=fn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};fn.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return fn.INT8;case Y.UNSIGNED_BYTE:return fn.UINT8;case Y.SHORT:return fn.INT16;case Y.UNSIGNED_SHORT:return fn.UINT16;case Y.INT:return fn.INT32;case Y.UNSIGNED_INT:return fn.UINT32;case Y.FLOAT:return fn.FLOAT32;case Y.DOUBLE:return fn.FLOAT64}};fn.toComponentDatatype=function(e){switch(e){case fn.INT8:return Y.BYTE;case fn.UINT8:return Y.UNSIGNED_BYTE;case fn.INT16:return Y.SHORT;case fn.UINT16:return Y.UNSIGNED_SHORT;case fn.INT32:return Y.INT;case fn.UINT32:return Y.UNSIGNED_INT;case fn.FLOAT32:return Y.FLOAT;case fn.FLOAT64:return Y.DOUBLE}};fn.getDataViewAccessors=function(e,t){return{[fn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[fn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[fn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[fn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[fn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[fn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[fn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[fn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[fn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[fn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(fn);var Lt=fn;var ro={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};ro.isVectorType=function(e){switch(e){case ro.VEC2:case ro.VEC3:case ro.VEC4:return!0;default:return!1}};ro.isMatrixType=function(e){switch(e){case ro.MAT2:case ro.MAT3:case ro.MAT4:return!0;default:return!1}};ro.getComponentCount=function(e){switch(e){case ro.SCALAR:case ro.STRING:case ro.ENUM:case ro.BOOLEAN:return 1;case ro.VEC2:return 2;case ro.VEC3:return 3;case ro.VEC4:return 4;case ro.MAT2:return 4;case ro.MAT3:return 9;case ro.MAT4:return 16}};ro.getMathType=function(e){switch(e){case ro.VEC2:return U;case ro.VEC3:return h;case ro.VEC4:return se;case ro.MAT2:return Xi;case ro.MAT3:return $;case ro.MAT4:return N;default:return}};Object.freeze(ro);var bt=ro;function rs(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Lt.isIntegerType(i);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=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Je(e.min,!0),this._max=Je(e.max,!0),this._normalized=o;let s=Je(e.offset,!0),a=Je(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Je(e.noData,!0),this._default=Je(e.default,!0),this._required=e.required??!0,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}rs.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=I9e(n),r=P9e(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new rs({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(rs.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 I9e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Lt[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 P9e(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Lt[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Lt[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}rs.prototype.normalize=function(e){return this._normalized?vK(e,this._valueType,Lt.normalize):e};rs.prototype.unnormalize=function(e){return this._normalized?vK(e,this._valueType,Lt.unnormalize):e};rs.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:rs.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};rs.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:rs.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};rs.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=bt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};rs.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!epe(e,t))return e};function QO(e){return Array.isArray(e)&&!(e instanceof Xi)&&!(e instanceof $)&&!(e instanceof N)}function epe(e,t){if(!QO(e))return e===t;if(!QO(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!epe(e[n],t[n]))return!1;return!0}rs.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};rs.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};rs.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?D9e(this,e):tpe(this,e)};function D9e(e,t){if(!QO(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 r=tpe(e,t[i]);if(l(r))return r}}function tpe(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?R9e(t,n,i):bt.isMatrixType(n)?O9e(t,n,i):n===bt.STRING?M9e(t):n===bt.BOOLEAN?N9e(t):n===bt.ENUM?L9e(t,r):F9e(t,i,o)}function R9e(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function O9e(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof Xi))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof N))return`matrix value ${e} must be a Matrix4`}function M9e(e){if(typeof e!="string")return w6(e,bt.STRING)}function N9e(e){if(typeof e!="boolean")return w6(e,bt.BOOLEAN)}function L9e(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 F9e(e,t,n){let i=typeof e;switch(t){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return i!=="number"?w6(e,t):isFinite(e)?Zme(e,t,n):Qme(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?w6(e,t):i==="number"&&!isFinite(e)?Qme(e,t):Zme(e,t,n)}}function w6(e,t){return`value ${e} does not match type ${t}`}function Jme(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Zme(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Jme(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return Jme(e,t,n)}function Qme(e,t){return`value ${e} of type ${t} must be finite`}function vK(e,t,n){if(!QO(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=vK(e[i],t,n);return e}rs.valueTransformInPlace=function(e,t,n,i){if(!QO(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=rs.valueTransformInPlace(e[r],t[r],n[r],i);return e};rs.prototype.cpuBytesPerElement=function(){return npe(this,this.valueType)};rs.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return npe(this,e)};function npe(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}rs.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var SK=[void 0,"float","vec2","vec3","vec4"],ipe=[void 0,"int","ivec2","ivec3","ivec4"],B9e=[void 0,"uint","uvec2","uvec3","uvec4"],k9e={[el.FLOAT]:"uintBitsToFloat",[el.INTEGER]:"int",[el.UNSIGNED_INTEGER]:""};rs.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?SK[e]:ipe[e]};rs.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Lt.isIntegerType(e)||this.normalized?SK[t]:Lt.isUnsignedIntegerType(e)?B9e[t]:ipe[t]};rs.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Lt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=bt.getComponentCount(a)*(this.isArray?this.arrayLength:1),u=Math.floor(s/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${SK[s]} ${f} = ${e};`;i.push(y);let A=k9e[Lt.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),E=s>1?`.${T}`:"",v=`${d} = czm_unpackTexture(${f}${E});`,S="";b&&(S=`[${x}]`);let I="",R="";if(this.normalized){let L=Lt.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};rs.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var jp=rs;function eM(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===bt.STRING,d=o===bt.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new wK(r[C],_,t+1),p+=g.typedArray.byteLength}let m=bt.getComponentCount(o),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new wK(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Lt.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,E=new wK(r[T],c,x);p+=E.typedArray.byteLength;let v=n.offset,S=n.scale,I=i.hasValueTransform||l(v)||l(S);v=v??i.offset,S=S??i.scale,v=rpe(v),S=rpe(S);let R,O,L=this;f?R=function(_){return V9e(_,L._values,L._stringOffsets)}:d?(R=function(_){return j9e(_,L._values)},O=function(_,C){H9e(_,L._values,C)}):l(u)?(R=function(_){let C=L._values.get(_);return u.namesByValue[C]},O=function(_,C){let w=u.valuesByName[C];L._values.set(_,w)}):(R=function(_){return L._values.get(_)},O=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=S,this._hasValueTransform=I,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(eM.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}},classProperty:{get:function(){return this._classProperty}}});eM.prototype.get=function(e){let t=U9e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=J9e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};eM.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=Z9e(this,t),t=n.unnormalize(t),z9e(this,e,t)};eM.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function rpe(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Zn(t,i):t.push(i)}return t}function U9e(e,t){spe(e)&&ape(e);let n=e._classProperty,i=n.isArray,r=n.type,o=bt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Je(s,!0):s}return!i&&o===1?e._getValue(t):ope(e,n,t)}function ope(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=bt.getComponentCount(t.type);i*=s,r*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function z9e(e,t,n){K9e(e,t,n)&&ape(e);let i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Je(n,!0)),e._unpackedValues[t]=n;return}if(!r&&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 f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function V9e(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Bu(t.typedArray,i,r)}function j9e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function H9e(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function G9e(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function W9e(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function q9e(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function Y9e(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function X9e(e){switch(e){case Lt.INT8:return Y.BYTE;case Lt.UINT8:return Y.UNSIGNED_BYTE;case Lt.INT16:return Y.SHORT;case Lt.UINT16:return Y.UNSIGNED_SHORT;case Lt.INT32:return Y.INT;case Lt.UINT32:return Y.UNSIGNED_INT;case Lt.FLOAT32:return Y.FLOAT;case Lt.FLOAT64:return Y.DOUBLE}}function spe(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Lt.INT64&&!dn.supportsBigInt64Array()||i===Lt.UINT64&&!dn.supportsBigUint64Array()}function K9e(e,t,n){if(spe(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function ape(e){e._unpackedValues=$9e(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function $9e(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(!r&&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]=ope(e,i,a);return n}function J9e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:jp.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function Z9e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:jp.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function wK(e,t,n){let i=this,r,o,s;if(t===Lt.INT64)dn.supportsBigInt()?dn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return W9e(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."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return G9e(a,i)});else if(t===Lt.UINT64)dn.supportsBigInt()?dn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return Y9e(a,i)}):(_t("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return q9e(a,i)});else{let a=X9e(t);r=Y.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var tM=eM;function Qh(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new tM({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Qh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});Qh.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Qh.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Qh.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Qh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=Q9e(this._class,t),i};Qh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Qh.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)};Qh.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Qh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Qh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function Q9e(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Je(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var Ld=Qh;var IK=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` +${n.message}`);let i=new oe(t);return l(n)&&(i.stack=`Original stack: +${n.stack} +Handler stack: +${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),ue(this)}},tr=IK;var cpe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(cpe);var Tt=cpe;var I6=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=e7e(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function e7e(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await I6._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Tt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Tt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var vx=I6;function t7e(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var Yy=t7e;var PK=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=Yy(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=n7e(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function n7e(e){try{let t=i7e(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 r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);Wy.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Tt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load buffer view",t)}}function i7e(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})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var Bv=PK;var Sx=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};Sx._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Sx._decoderTaskProcessor=void 0;Sx._taskProcessorReady=!1;Sx._error=void 0;var bg=Sx;var On={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function r7e(e){switch(e){case On.POSITION:return"positionMC";case On.NORMAL:return"normalMC";case On.TANGENT:return"tangentMC";case On.TEXCOORD:return"texCoord";case On.COLOR:return"color";case On.JOINTS:return"joints";case On.WEIGHTS:return"weights";case On.FEATURE_ID:return"featureId";case On.SCALE:return"scale";case On.ROTATION:return"rotation";case On.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}On.hasSetIndex=function(e){switch(e){case On.POSITION:case On.NORMAL:case On.TANGENT:case On.CUMULATIVE_DISTANCE:return!1;case On.TEXCOORD:case On.COLOR:case On.JOINTS:case On.WEIGHTS:case On.FEATURE_ID:case On.SCALE:case On.ROTATION:return!0}};On.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return On.POSITION;case"NORMAL":return On.NORMAL;case"TANGENT":return On.TANGENT;case"TEXCOORD":return On.TEXCOORD;case"COLOR":return On.COLOR;case"JOINTS":return On.JOINTS;case"WEIGHTS":return On.WEIGHTS;case"_FEATURE_ID":return On.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return On.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return On.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return On.CUMULATIVE_DISTANCE}};On.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return On.POSITION;case"RGBA":case"RGB":case"RGB565":return On.COLOR;case"NORMAL":case"NORMAL_OCT16P":return On.NORMAL;case"BATCH_ID":return On.FEATURE_ID}};On.getGlslType=function(e){switch(e){case On.POSITION:case On.NORMAL:case On.TANGENT:return"vec3";case On.TEXCOORD:return"vec2";case On.COLOR:return"vec4";case On.JOINTS:return"ivec4";case On.WEIGHTS:return"vec4";case On.FEATURE_ID:return"int";case On.SCALE:return"vec3";case On.ROTATION:return"vec4";case On.CUMULATIVE_DISTANCE:return"float";case On.OPACITY:return"float"}};On.getVariableName=function(e,t){let n=r7e(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(On);var ct=On;var DK=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Tt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=o7e(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._dracoError)&&lpe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,s=n.bufferView,a=o[s],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=a7e(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=bg.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=s7e(this,d)}unload(){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}};async function o7e(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=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;lpe(e,n)}}function lpe(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load Draco",t)}async function s7e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Tt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var wx={};wx[ct.POSITION]="POSITION";wx[ct.NORMAL]="NORMAL";wx[ct.COLOR]="COLOR";wx[ct.TEXCOORD]="TEX_COORD";function a7e(e){for(let t in wx)if(wx.hasOwnProperty(t)&&e.startsWith(t))return wx[t]}var kv=DK;function c7e(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).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 xg=c7e;var nM=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=l7e(this),this._promise):(this._promise=u7e(this),this._promise)}unload(){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}};function upe(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 l7e(e){e._state=Tt.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,r=await d7e(i);if(e.isDestroyed())return;let o=upe(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(n){return e.isDestroyed()?void 0:fpe(e,n,"Failed to load embedded image")}}async function u7e(e){e._state=Tt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await m7e(i);if(e.isDestroyed())return;let o=upe(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(r){return e.isDestroyed()?void 0:fpe(e,r,`Failed to load image: ${n}`)}}function fpe(e,t,n){return e.unload(),e._state=Tt.FAILED,Promise.reject(e.getError(n,t))}function f7e(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 oe("Image format is not recognized")}async function d7e(e){let t=f7e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ru(n)}return nM._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var h7e=/(^data:image\/ktx2)|(\.ktx2$)/i;function m7e(e){let t=e.getUrlComponent(!1,!0);return h7e.test(t)?Ru(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}nM._loadImageFromTypedArray=xg;var Uv=nM;function p7e(e,t){_t(e,t)}var Yr=p7e;var dpe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(dpe);var Oc=dpe;var RK=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=a,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=_7e(this),this._promise):(this._promise=y7e(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){MK(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=g7e;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Oc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=hpe(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=Tt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.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}},OK=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=hpe(this.typedArray,this.indexDatatype,this.context)}};function hpe(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var g7e=new OK;async function _7e(e){e._state=Tt.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=Tt.LOADED,e)}catch(n){if(e.isDestroyed())return;MK(e,n)}}async function y7e(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=Tt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=A7e(e,a),e._state=Tt.PROCESSING,e}catch(s){if(e.isDestroyed())return;MK(e,s)}}function A7e(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=je.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Yr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===je.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===je.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===je.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function MK(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load index buffer",t)}var zv=RK;function b7e(e,t){return t=t??0,Bu(e,t,Math.min(4,e.length))}var em=b7e;function x7e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var _a=x7e;function T7e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var jo=T7e;function rn(){}rn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};rn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};rn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?rn.objectLegacy(i,n):rn.object(i,n)};rn.accessor=function(e,t){return rn.topLevel(e,"accessors",t)};rn.accessorWithSemantic=function(e,t,n){let i={};return rn.mesh(e,function(r){return rn.meshPrimitive(r,function(o){let s=rn.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:rn.meshPrimitiveTarget(o,function(a){return rn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};rn.accessorContainingVertexAttributeData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=rn.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:rn.meshPrimitiveTarget(r,function(s){return rn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};rn.accessorContainingIndexData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};rn.animation=function(e,t){return rn.topLevel(e,"animations",t)};rn.animationChannel=function(e,t){let n=e.channels;return rn.object(n,t)};rn.animationSampler=function(e,t){let n=e.samplers;return rn.object(n,t)};rn.buffer=function(e,t){return rn.topLevel(e,"buffers",t)};rn.bufferView=function(e,t){return rn.topLevel(e,"bufferViews",t)};rn.camera=function(e,t){return rn.topLevel(e,"cameras",t)};rn.image=function(e,t){return rn.topLevel(e,"images",t)};rn.material=function(e,t){return rn.topLevel(e,"materials",t)};rn.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 r=t(n[i],i);if(l(r))return r}};rn.mesh=function(e,t){return rn.topLevel(e,"meshes",t)};rn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};rn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};rn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};rn.node=function(e,t){return rn.topLevel(e,"nodes",t)};rn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=rn.nodeInTree(e,u,n),l(c)))return c}}}};rn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return rn.nodeInTree(e,i,n)};rn.program=function(e,t){return jo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.programs,t):rn.topLevel(e,"programs",t)};rn.sampler=function(e,t){return rn.topLevel(e,"samplers",t)};rn.scene=function(e,t){return rn.topLevel(e,"scenes",t)};rn.shader=function(e,t){return jo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.shaders,t):rn.topLevel(e,"shaders",t)};rn.skin=function(e,t){return rn.topLevel(e,"skins",t)};rn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};rn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.technique=function(e,t){return jo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.techniques,t):rn.topLevel(e,"techniques",t)};rn.texture=function(e,t){return rn.topLevel(e,"textures",t)};var ke=rn;function E7e(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 Df=E7e;function C7e(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 Y.getSizeInBytes(t.componentType)*Df(t.type)}var ku=C7e;function v7e(e){ke.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),ke.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){if(i.mode=i.mode??te.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=_a(e.materials,r)}})}),ke.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=ku(e,i),o.target=te.ARRAY_BUFFER}}),ke.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),ke.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let o=i.KHR_techniques_webgl;l(o)&&ke.materialValue(n,function(c){l(c.index)&&Ix(c)}),Ix(n.emissiveTexture),Ix(n.normalTexture),Ix(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,Ix(s.baseColorTexture),Ix(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,Ix(a.specularGlossinessTexture))}),ke.animation(e,function(n){ke.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=S7e(e);return ke.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),ke.sampler(e,function(n){n.wrapS=n.wrapS??te.REPEAT,n.wrapT=n.wrapT??te.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function S7e(e){let t={};return ke.animation(e,function(n){ke.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function Ix(e){l(e)&&(e.texCoord=e.texCoord??0)}var iM=v7e;function w7e(e){return ke.shader(e,function(t){P6(t)}),ke.buffer(e,function(t){P6(t)}),ke.image(e,function(t){P6(t)}),P6(e),e}function P6(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Xy=w7e;function I7e(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 rM=I7e;function P7e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),rM(e,t),n.length===0&&delete e.extensionsUsed}}var Px=P7e;var D7e=4;function R7e(e){if(em(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=mpe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?O7e(e,n):M7e(e,n)}function mpe(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*D7e,!0);return r}function O7e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=Bu(e,o,i),c=JSON.parse(a);Xy(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return Px(c,"KHR_binary_glTF"),c}function M7e(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=mpe(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Bu(u);r=JSON.parse(f),Xy(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var Dx=R7e;function N7e(e){return ke.shader(e,function(t){D6(t)}),ke.buffer(e,function(t){D6(t)}),ke.image(e,function(t){D6(t)}),D6(e),e}function D6(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var oM=N7e;function L7e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),_a(n,t,!0)}var Fd=L7e;function F7e(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case Y.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var Tg=F7e;function B7e(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=Df(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=ku(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=Tg(y);for(let E=0;E<p;E++){T(b,m,o,A,x);for(let v=0;v<o;v++){let S=x[v];s[v]=Math.min(s[v],S),a[v]=Math.max(a[v],S)}m+=g}return{min:s,max:a}}var Rx=B7e;var k7e=[te.FUNC_ADD,te.FUNC_ADD],U7e=[te.ONE,te.ZERO,te.ONE,te.ZERO];function ppe(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var z7e=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function V7e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(z7e.indexOf(e[n])===-1)return t;return e}function j7e(e){let t={},n={},i=e.techniques;return l(i)&&(ke.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(ppe(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??k7e,blendFactors:V7e(c.blendFuncSeparate,U7e)})}ppe(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Fd(e,"KHR_blend")),ke.material(e,function(r){if(l(r.technique)){let o=n[r.technique];ke.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var sM=j7e;function H7e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),_a(n,t,!0),Fd(e,t)}var aM=H7e;function G7e(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,ke.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(ke.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),ke.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=_a(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=_a(o.shaders,m,!0),u.program=_a(o.programs,p),r[a.program]=u.program}i[c]=_a(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Fd(e,"KHR_techniques_webgl"),aM(e,"KHR_techniques_webgl"))}return ke.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};ke.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var cM=G7e;function W7e(e,t){Wr.typeOf.object("material",e),Wr.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,s=t(o.index,o);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,s=t(o.index,o);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:u,specularColorTexture:f}=s;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let u=a.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=ke.materialValue(e,function(o){if(l(o.index)){let s=t(o.index,o);if(l(s))return s}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,s=t(o.index,o);if(l(s))return s}if(l(e.normalTexture)){let o=e.normalTexture,s=t(o.index,o);if(l(s))return s}if(l(e.occlusionTexture)){let o=e.occlusionTexture,s=t(o.index,o);if(l(s))return s}}var Vv=W7e;var gpe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function q7e(e,t){return t=t??gpe,gpe.forEach(function(n){t.indexOf(n)>-1&&X7e(e,n)}),e}var Y7e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function X7e(e,t){let n=Y7e[t],i=e[n];if(l(i)){let r=0,o=Gp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Hp[t](e,a-r),r++)}}function Hp(){}Hp.accessor=function(e,t){e.accessors.splice(t,1),ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){ke.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),ke.meshPrimitiveTarget(r,function(a){ke.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),ke.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ke.animation(e,function(i){ke.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Hp.buffer=function(e,t){e.buffers.splice(t,1),ke.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let s=r.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};Hp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ke.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ke.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ke.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),jo(e,"KHR_draco_mesh_compression")&&ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),jo(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(jo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Hp.image=function(e,t){e.images.splice(t,1),ke.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Hp.mesh=function(e,t){e.meshes.splice(t,1),ke.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Hp.node=function(e,t){e.nodes.splice(t,1),ke.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),ke.animation(e,function(i){ke.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),ke.technique(e,function(i){ke.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),ke.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),ke.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Hp.material=function(e,t){e.materials.splice(t,1),ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Hp.sampler=function(e,t){e.samplers.splice(t,1),ke.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Hp.texture=function(e,t){if(e.textures.splice(t,1),ke.material(e,function(i){Vv(i,function(r,o){o.index>t&&--o.index})}),jo(e,"EXT_feature_metadata")){ke.mesh(e,function(o){ke.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(jo(e,"EXT_mesh_features")&&ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),jo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Gp(){}Gp.accessor=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){ke.meshPrimitiveAttribute(i,function(o){t[o]=!0}),ke.meshPrimitiveTarget(i,function(o){ke.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),ke.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ke.animation(e,function(n){ke.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),jo(e,"EXT_mesh_gpu_instancing")&&ke.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 r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),jo(e,"CESIUM_primitive_outline")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Gp.buffer=function(e){let t={};return ke.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};Gp.bufferView=function(e){let t={};if(ke.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ke.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ke.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),jo(e,"KHR_draco_mesh_compression")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),jo(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].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(jo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Gp.image=function(e){let t={};return ke.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};Gp.mesh=function(e){let t={};return ke.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 _pe(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(r){return!_pe(e,r,n)}).length===0}Gp.node=function(e){let t={};return ke.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ke.skinJoint(n,function(i){t[i]=!0})}),ke.animation(e,function(n){ke.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ke.technique(e,function(n){ke.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ke.node(e,function(n,i){_pe(e,i,t)||(t[i]=!0)}),t};Gp.material=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Gp.texture=function(e){let t={};if(ke.material(e,function(n){Vv(n,function(i){t[i]=!0})}),jo(e,"EXT_feature_metadata")){ke.mesh(e,function(r){ke.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(jo(e,"EXT_mesh_features")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),jo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Gp.sampler=function(e){let t={};return ke.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var lM=q7e;function K7e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:_a(e.buffers,n),byteOffset:0,byteLength:t.length};return _a(e.bufferViews,r)}var uM=K7e;function $7e(e,t){let n=ku(e,t),i=Y.getSizeInBytes(t.componentType),r=Df(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=Tg(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var fM=$7e;function J7e(e){let t;return ke.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?R6(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&R6(e,i,Y.UNSIGNED_SHORT)}),ke.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?R6(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&R6(e,i,Y.UNSIGNED_SHORT)}),e}function R6(e,t,n){let i=Y.createTypedArray(n,fM(e,t)),r=new Uint8Array(i.buffer);t.bufferView=uM(e,r),t.componentType=n,t.byteOffset=0}var dM=J7e;function Z7e(e,t){return Px(e,t),t==="CESIUM_RTC"&&Q7e(e),NK(e,t)}function Q7e(e){ke.technique(e,function(t){ke.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function NK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)NK(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 r in e)Object.prototype.hasOwnProperty.call(e,r)&&NK(e[r],t);return i}}var Ox=Z7e;var O6={.8:oWe,"1.0":SWe,"2.0":void 0};function eWe(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(O6,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(O6,i)||(i="1.0"));let r=O6[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=O6[i];return t.keepLegacyExtensions||(PWe(e,t),DWe(e)),e}function bpe(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function tWe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.primitive??te.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function nWe(e){let t=e.nodes,n=new h,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function iWe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],E=r[x.buffer].extras._pipeline.source,v=E.byteOffset+x.byteOffset+b.byteOffset,S=b.componentType,I=b.count,R=Df(b.type),O=b.count*R,L=Y.createArrayBufferView(S,E.buffer,v,O);for(let _=0;_<I;_++){let C=_*R;h.unpack(L,C,s);let w=L[C+3];Le.fromAxisAngle(s,w,a),Le.pack(a,L,C)}}}}}}function rWe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function oWe(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,bpe(e),tWe(e),nWe(e),iWe(e),rWe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Fd(e,"KHR_materials_common")}}function sWe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function ype(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function aWe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=ype(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),ke.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),ke.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),ke.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}}),ke.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),ke.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),ke.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]})})}),ke.mesh(e,function(s){ke.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),ke.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),ke.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,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=_a(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}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 f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),ke.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),ke.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]]}}),ke.animation(e,function(s){let a={};s.samplers=ype(s.samplers,a),ke.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),ke.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),ke.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),ke.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&ke.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),ke.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}}),ke.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function cWe(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){delete n.name})})}function lWe(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]}ke.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function uWe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var fWe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function dWe(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(fWe[r])&&e.extensionsRequired.push(r)}}}function hWe(e){ke.buffer(e,function(t){delete t.type})}function mWe(e){ke.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function pWe(e){ke.mesh(e,function(t){ke.meshPrimitive(t,function(n){ke.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),ke.technique(e,function(t){ke.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var gWe={POSITION:!0,NORMAL:!0,TANGENT:!0},_We={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function yWe(e){let t={};ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){ke.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=_We[a];l(f)?(u=f+c,t[o]=u):l(gWe[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),ke.technique(e,function(n){ke.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function AWe(e){ke.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function FK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:ku(e,t)}function bWe(e){ke.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ke.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=FK(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function xWe(e){let t,n,i,r=e.bufferViews,o={};ke.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};ke.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=FK(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?FK(e,c[t+1]):void 0;if(g!==b){let x=Je(i,!0);o[a]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=_a(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}lM(e,["accessor","bufferView","buffer"])}function TWe(e){ke.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Rx(e,n);n.min=i.min,n.max=i.max}})}function xpe(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)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||N.fromColumnMajorArray(e.matrix).equals(N.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Tpe(e,t){ke.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),ke.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),xpe(n)&&Tpe(e,i))}}),delete e.nodes[t]}function EWe(e){return ke.node(e,function(t,n){xpe(t)&&Tpe(e,n)}),e}function CWe(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=Rx(e,i);i.min=r.min,i.max=r.max}})})}function vWe(e){ke.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Rx(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function SWe(e){e.asset=e.asset??{},e.asset.version="2.0",bpe(e),sWe(e),EWe(e),aWe(e),cWe(e),uWe(e),dWe(e),bWe(e),xWe(e),TWe(e),CWe(e),vWe(e),hWe(e),mWe(e),pWe(e),yWe(e),dM(e),AWe(e),sM(e),cM(e),lWe(e)}var wWe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],IWe=["u_diffuse","u_diffuse_mat"];function BK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function kK(e){return l(e.index)}function UK(e){return Array.isArray(e)&&e.length===4}function Epe(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 PWe(e,t){t=t??{};let n=t.baseColorTextureNames??wWe,i=t.baseColorFactorNames??IWe;ke.material(e,function(r){ke.materialValue(r,function(o,s){n.indexOf(s)!==-1&&kK(o)?(BK(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&UK(o)&&(BK(r),r.pbrMetallicRoughness.baseColorFactor=Epe(o))})}),Ox(e,"KHR_techniques_webgl"),Ox(e,"KHR_blend")}function LK(e,t){l(t)&&(UK(t)?e.pbrMetallicRoughness.baseColorFactor=Epe(t):kK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Ape(e,t){l(t)&&(UK(t)?e.emissiveFactor=t.slice(0,3):kK(t)&&(e.emissiveTexture=t))}function DWe(e){ke.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;BK(t),n.technique==="CONSTANT"?(Fd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},LK(t,s),LK(t,r)):(LK(t,o),Ape(t,r),Ape(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(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),Ox(e,"KHR_materials_common")}var hM=eWe;var Cpe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(Cpe);var Vi=Cpe;function tl(){}tl.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let r=new oe(i);return l(n)&&(r.stack=`Original stack: +${n.stack} +Handler stack: +${r.stack}`),r};tl.getNodeTransform=function(e){return l(e.matrix)?e.matrix:N.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};tl.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};tl.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};tl.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}};tl.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};tl.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ct.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=Vt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var RWe=new h,OWe=new h;tl.getPositionMinMax=function(e,t,n){let i=tl.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,OWe),r=h.add(r,n,RWe)),{min:o,max:r}};tl.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===zi.Y?n=N.clone(zi.Y_UP_TO_Z_UP,n):e===zi.X&&(n=N.clone(zi.X_UP_TO_Z_UP,n)),t===zi.Z&&(n=N.multiplyTransformation(n,zi.Z_UP_TO_X_UP,n)),n};var MWe=new $;tl.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Vi.BACK;let n=N.getMatrix3(e,MWe);return $.determinant(n)<0?Vi.FRONT:Vi.BACK};tl.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};tl.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!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_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!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_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};tl.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!tl.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=tl;var zK=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,s=t.gltfJson,a=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=s,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,l(this._gltfJson)?(this._promise=vpe(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Spe(this,this._typedArray),this._promise):(this._promise=NWe(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function NWe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;VK(e,n)}return Spe(e,t)}function VK(e,t){e.unload(),e._state=Tt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function LWe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!jo(t,"KHR_techniques_webgl")&&!jo(t,"KHR_materials_common"))return Promise.resolve();let n=[];ke.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),hM(t)}function FWe(e){let t=[];return ke.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Uh(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function BWe(e,t){let n=[];return ke.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function vpe(e,t){try{Xy(t),await FWe(t),await LWe(e,t),iM(t),await BWe(e,t),oM(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=Tt.READY,e}catch(n){if(e.isDestroyed())return;VK(e,n)}}async function Spe(e,t){let n;try{em(t)==="glTF"?n=Dx(t):n=Ro(t)}catch(i){if(e.isDestroyed())return;VK(e,i)}return vpe(e,n)}var jv=zK;var wpe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(wpe);var Wp=wpe;var Pr={},jK=class{constructor(){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}},HK=class{constructor(){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}},GK=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},WK=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},qK=class{constructor(){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}},YK=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},XK=class{constructor(){this.attributes=[]}},KK=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},$K=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},JK=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},ZK=class{constructor(){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,this.meshVector=void 0}},QK=class{constructor(){this.nodes=[]}},kWe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},e$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},t$=class{constructor(){this.node=void 0,this.path=void 0}},n$=class{constructor(){this.sampler=void 0,this.target=void 0}},i$=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},r$=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},o$=class{constructor(){this.name=void 0,this.stages=[]}},M6=class{constructor(){this.credits=[]}},s$=class{constructor(){this.asset=new M6,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=N.clone(N.IDENTITY),this.extensions={}}},a$=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},Ky=class Ky{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Ky.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Ky.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Ky.DEFAULT_ROUGHNESS_FACTOR}};ut(Ky,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(Ky,"DEFAULT_METALLIC_FACTOR",1),ut(Ky,"DEFAULT_ROUGHNESS_FACTOR",1);var N6=Ky,$y=class $y{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone($y.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone($y.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=$y.DEFAULT_GLOSSINESS_FACTOR}};ut($y,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut($y,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut($y,"DEFAULT_GLOSSINESS_FACTOR",1);var c$=$y,Hv=class Hv{constructor(){this.specularFactor=Hv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(Hv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(Hv,"DEFAULT_SPECULAR_FACTOR",1),ut(Hv,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var l$=Hv,Gv=class Gv{constructor(){this.anisotropyStrength=Gv.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=Gv.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(Gv,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(Gv,"DEFAULT_ANISOTROPY_ROTATION",0);var u$=Gv,Wv=class Wv{constructor(){this.clearcoatFactor=Wv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=Wv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(Wv,"DEFAULT_CLEARCOAT_FACTOR",0),ut(Wv,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var f$=Wv,d$=class{constructor(){ut(this,"width");ut(this,"pattern")}},L6=class L6{constructor(t={}){let{wireframeFill:n=L6.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(L6,"DEFAULT_WIREFRAME_FILL",0);var h$=L6,F6=class F6{constructor(){this.metallicRoughness=new N6,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=h.clone(F6.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Wp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(F6,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var m$=F6,p$=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},g$=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Pr.Quantization=jK;Pr.Attribute=HK;Pr.Indices=GK;Pr.FeatureIdAttribute=WK;Pr.FeatureIdTexture=YK;Pr.FeatureIdImplicitRange=qK;Pr.MorphTarget=XK;Pr.Primitive=KK;Pr.Instances=$K;Pr.Skin=JK;Pr.Node=ZK;Pr.Scene=QK;Pr.AnimatedPropertyType=Object.freeze(kWe);Pr.AnimationSampler=e$;Pr.AnimationTarget=t$;Pr.AnimationChannel=n$;Pr.Animation=i$;Pr.ArticulationStage=r$;Pr.Articulation=o$;Pr.Asset=M6;Pr.Components=s$;Pr.TextureReader=a$;Pr.MetallicRoughness=N6;Pr.SpecularGlossiness=c$;Pr.Specular=l$;Pr.Anisotropy=u$;Pr.Clearcoat=f$;Pr.PlanarFill=h$;Pr.LineStyle=d$;Pr.Material=m$;Pr.Vector=g$;Pr.Polygon=p$;var En=Pr;var B6={};B6.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};B6.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=hn.REPEAT,o=hn.REPEAT,s=Wt.LINEAR,a=Jn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==Wt.LINEAR&&s!==Wt.NEAREST&&(s===Wt.NEAREST_MIPMAP_NEAREST||s===Wt.NEAREST_MIPMAP_LINEAR?s=Wt.NEAREST:s=Wt.LINEAR),hn.validate(r)||(r=hn.REPEAT),hn.validate(o)||(o=hn.REPEAT),Wt.validate(s)||(s=Wt.LINEAR),Jn.validate(a)||(a=Jn.LINEAR),new jt({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var UWe=new U(1,1);B6.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,s=t.extensions?.KHR_texture_transform;if(l(s)){r=s.texCoord??r;let u=l(s.offset)?U.unpack(s.offset):U.ZERO,f=s.rotation??0,d=l(s.scale)?U.unpack(s.scale):UWe;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let a=new En.TextureReader;a.index=t.index,a.texture=i,a.texCoord=r,a.scale=t.scale,a.transform=o,a.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(a.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?U.unpack(c.offset):U.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),a};var Uu=B6;function zWe(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Jy=zWe;var _$=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,s=t.baseResource,a=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=Uu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:a});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=s,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=jWe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Tt.PROCESSING;let n;if(this._asynchronous){let i=VWe;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Oc.TEXTURE))return!1;n=i.texture}else n=Ipe(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=Tt.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){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}},y$=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,s){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=s}execute(){this.texture=Ipe(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function Ipe(e,t,n,i,r,o){let s=i.internalFormat,a=!1;Ke.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=Uu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===hn.REPEAT||f===hn.MIRRORED_REPEAT||d===hn.REPEAT||d===hn.MIRRORED_REPEAT,y=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),A=m&&y,b;return l(s)?(!o.webgl2&&Ke.isCompressedFormat(s)&&y&&m&&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."),b=Dt.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=Jy(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var VWe=new y$;async function jWe(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=Tt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load texture",n)}}var qv=_$;var A$=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,s=t.bufferViewId,a=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=s,this._primitive=a,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=WWe(this),this._promise):HWe(this._draco,this._attributeSemantic)?(this._promise=KWe(this),this._promise):(this._promise=JWe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){k6(this,r)}$We(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){k6(this,r)}XWe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=ZWe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Oc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=Ppe(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=Tt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function HWe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function GWe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new En.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Vt.VEC2,a.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function WWe(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch{if(e.isDestroyed())return}}function qWe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function YWe(e){let t=qWe(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function XWe(e){e._state=Tt.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=D.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=D.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=D.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=D.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=YWe(e._attributeSemantic),o=n.shDegree,s=0,a=[0,9,24];switch(o){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*s+a[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function KWe(e){e._state=Tt.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=Tt.LOADED,e)}catch{if(e.isDestroyed())return;k6(e)}}function $We(e){e._state=Tt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=GWe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function JWe(e){e._state=Tt.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=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;k6(e,n)}}function k6(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load vertex buffer",t)}var b$=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Ppe(this.typedArray,this.context)}};function Ppe(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var ZWe=new b$,Yv=A$;var Dpe={};async function QWe(e={}){var t,n,i,r,o=e,s=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:le}=await Promise.resolve().then(()=>rqe);var u=le(Dpe.url)}var f="./this.program",d=Dpe.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(s||a)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(le){for(var ne=0,Te=le.length,Ce=new Uint8Array(Te),Ze;ne<Te;++ne)Ze=le.charCodeAt(ne),Ce[ne]=~Ze>>8&Ze;return Ce}var A,b,x,T,E,v,S,I,R,O,L,_,C=!1;function w(){var le=$b.buffer;x=new Int8Array(le),E=new Int16Array(le),o.HEAPU8=T=new Uint8Array(le),v=new Uint16Array(le),S=new Int32Array(le),I=new Uint32Array(le),o.HEAPF32=R=new Float32Array(le),O=new Float64Array(le),L=new BigInt64Array(le),_=new BigUint64Array(le)}function P(le){var ne;throw(ne=o.onAbort)==null||ne.call(o,le),le="Aborted("+le+")",g(le),m=!0,le=new WebAssembly.RuntimeError(le+". Build with -sASSERTIONS for more info."),b?.(le),le}var M;async function F(le){return le}async function V(le){var ne=M;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,le)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),P(Ce)}}async function B(le){return V(le)}var j=le=>{for(;0<le.length;)le.shift()(o)},k=[],G=[],q=()=>{var le=o.preRun.shift();G.push(le)},Q={},W=le=>{for(;le.length;){var ne=le.pop();le.pop()(ne)}};function J(le){return this.O(I[le>>2])}var Z={},ae={},Ae={},fe=class extends Error{constructor(le){super(le),this.name="InternalError"}},xe=(le,ne,Te)=>{function Ce(wt){if(wt=Te(wt),wt.length!==le.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<le.length;++bn)Qe(le[bn],wt[bn])}le.forEach(wt=>Ae[wt]=ne);var Ze=Array(ne.length),Et=[],pt=0;for(let[wt,bn]of ne.entries())ae.hasOwnProperty(bn)?Ze[wt]=ae[bn]:(Et.push(bn),Z.hasOwnProperty(bn)||(Z[bn]=[]),Z[bn].push(()=>{Ze[wt]=ae[bn],++pt,pt===Et.length&&Ce(Ze)}));Et.length===0&&Ce(Ze)},ge=le=>{for(var ne="";;){var Te=T[le++];if(!Te)return ne;ne+=String.fromCharCode(Te)}},we=class extends Error{constructor(le){super(le),this.name="BindingError"}},Se=le=>{throw new we(le)};function Re(le,ne,Te={}){var Ce=ne.name;if(!le)throw new we(`type "${Ce}" must have a positive integer typeid pointer`);if(ae.hasOwnProperty(le)){if(Te.Aa)return;throw new we(`Cannot register type '${Ce}' twice`)}ae[le]=ne,delete Ae[le],Z.hasOwnProperty(le)&&(ne=Z[le],delete Z[le],ne.forEach(Ze=>Ze()))}function Qe(le,ne,Te={}){return Re(le,ne,Te)}var He=(le,ne,Te)=>{switch(ne){case 1:return Te?Ce=>x[Ce]:Ce=>T[Ce];case 2:return Te?Ce=>E[Ce>>1]:Ce=>v[Ce>>1];case 4:return Te?Ce=>S[Ce>>2]:Ce=>I[Ce>>2];case 8:return Te?Ce=>L[Ce>>3]:Ce=>_[Ce>>3];default:throw new TypeError(`invalid integer width (${ne}): ${le}`)}},Xe=le=>{throw new we(le.M.R.N.name+" instance already deleted")},$e=!1,Pe=()=>{},qe=le=>globalThis.FinalizationRegistry?($e=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),qe=ne=>{var Te=ne.M;return Te.V&&$e.register(ne,{M:Te},ne),ne},Pe=ne=>{$e.unregister(ne)},qe(le)):(qe=ne=>ne,le);function st(){}var vt=(le,ne)=>Object.defineProperty(ne,"name",{value:le}),Gt={},lt=(le,ne,Te)=>{if(le[ne].U===void 0){var Ce=le[ne];le[ne]=function(...Ze){if(!le[ne].U.hasOwnProperty(Ze.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Ze.length}) - expects one of (${le[ne].U})!`);return le[ne].U[Ze.length].apply(this,Ze)},le[ne].U=[],le[ne].U[Ce.$]=Ce}},mt=(le,ne,Te)=>{if(o.hasOwnProperty(le)){if(Te===void 0||o[le].U!==void 0&&o[le].U[Te]!==void 0)throw new we(`Cannot register public name '${le}' twice`);if(lt(o,le,le),o[le].U.hasOwnProperty(Te))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${Te})!`);o[le].U[Te]=ne}else o[le]=ne,o[le].$=Te},ft=le=>{le=le.replace(/[^a-zA-Z0-9_]/g,"$");var ne=le.charCodeAt(0);return 48<=ne&&57>=ne?`_${le}`:le};function Xt(le,ne,Te,Ce,Ze,Et,pt,wt){this.name=le,this.constructor=ne,this.ba=Te,this.Z=Ce,this.W=Ze,this.va=Et,this.fa=pt,this.ta=wt,this.Ca=[]}var rt=(le,ne,Te)=>{for(;ne!==Te;){if(!ne.fa)throw new we(`Expected null or instance of ${Te.name}, got an instance of ${ne.name}`);le=ne.fa(le),ne=ne.W}return le},ht=le=>{if(le===null)return"null";var ne=typeof le;return ne==="object"||ne==="array"||ne==="function"?le.toString():""+le};function Bi(le,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function Xn(le,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var Te=this.ka();return le!==null&&le.push(this.Z,Te),Te}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(Te=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)Te=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:Te=ne.M.V;break;case 2:if(ne.M.Y===this)Te=ne.M.V;else{var Ce=ne.clone();Te=this.Da(Te,qi(()=>Ce.delete())),le!==null&&le.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function Ai(le,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var Wi=(le,ne,Te)=>ne===Te?le:Te.W===void 0?null:(le=Wi(le,ne,Te.W),le===null?null:Te.ta(le)),wi={},di=(le,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;le.W;)ne=le.fa(ne),le=le.W;return wi[ne]},bi=(le,ne)=>{if(!ne.R||!ne.P)throw new fe("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new fe("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},qe(Object.create(le,{M:{value:ne,writable:!0}}))};function jn(le,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n){this.name=le,this.N=ne,this.ia=Te,this.ga=Ce,this.ha=Ze,this.Ba=Et,this.Ha=pt,this.pa=wt,this.ka=bn,this.Da=qn,this.Z=_n,Ze||ne.W!==void 0?this.S=Xn:(this.S=Ce?Bi:Ai,this.T=null)}var nn=(le,ne,Te)=>{if(!o.hasOwnProperty(le))throw new fe("Replacing nonexistent public symbol");o[le].U!==void 0&&Te!==void 0?o[le].U[Te]=ne:(o[le]=ne,o[le].$=Te)},Wn=(le,ne)=>{le=ge(le);var Te=QP.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${le}: ${ne}`);return Te};class Zi extends Error{}var Mr=le=>{le=Kb(le);var ne=ge(le);return vp(le),ne},fo=(le,ne)=>{function Te(Et){Ze[Et]||ae[Et]||(Ae[Et]?Ae[Et].forEach(Te):(Ce.push(Et),Ze[Et]=!0))}var Ce=[],Ze={};throw ne.forEach(Te),new Zi(`${le}: `+Ce.map(Mr).join([", "]))},Bs=(le,ne)=>{for(var Te=[],Ce=0;Ce<le;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function Ks(le){for(var ne=1;ne<le.length;++ne)if(le[ne]!==null&&le[ne].T===void 0)return!0;return!1}function no(le,ne,Te,Ce,Ze,Et){var pt=ne.length;if(2>pt)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var wt=ne[1]!==null&&Te!==null,bn=Ks(ne);Te=!ne[0].oa;var qn=ne[0],_n=ne[1];for(Ce=[le,Se,Ce,Ze,W,qn.O.bind(qn),_n?.S.bind(_n)],Ze=2;Ze<pt;++Ze)qn=ne[Ze],Ce.push(qn.S.bind(qn));if(!bn)for(Ze=wt?1:2;Ze<ne.length;++Ze)ne[Ze].T!==null&&Ce.push(ne[Ze].T);for(bn=Ks(ne),Ze=ne.length-2,_n=[],qn=["fn"],wt&&qn.push("thisWired"),pt=0;pt<Ze;++pt)_n.push(`arg${pt}`),qn.push(`arg${pt}Wired`);_n=_n.join(","),qn=qn.join(","),_n=`return function (${_n}) { +`,bn&&(_n+=`var destructors = []; +`);var vo=bn?"destructors":"null",mo="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(wt&&(_n+=`var thisWired = toClassParamWire(${vo}, this); +`),pt=0;pt<Ze;++pt){var $s=`toArg${pt}Wire`;_n+=`var arg${pt}Wired = ${$s}(${vo}, arg${pt}); +`,mo.push($s)}if(_n+=(Te||Et?"var rv = ":"")+`invoker(${qn}); +`,bn)_n+=`runDestructors(destructors); +`;else for(pt=wt?1:2;pt<ne.length;++pt)Et=pt===1?"thisWired":"arg"+(pt-2)+"Wired",ne[pt].T!==null&&(_n+=`${Et}_dtor(${Et}); +`,mo.push(`${Et}_dtor`));return Te&&(_n+=`var ret = fromRetWire(rv); +return ret; +`),ne=new Function(mo,_n+`} +`)(...Ce),vt(le,ne)}var mi=le=>{le=le.trim();let ne=le.indexOf("(");return ne===-1?le:le.slice(0,ne)},ho=[],ur=[0,1,,1,null,1,!0,1,!1,1],Zo=le=>{9<le&&--ur[le+1]===0&&(ur[le]=void 0,ho.push(le))},Bn=le=>{if(!le)throw new we(`Cannot use deleted val. handle = ${le}`);return ur[le]},qi=le=>{switch(le){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ho.pop()||ur.length;return ur[ne]=le,ur[ne+1]=1,ne}},ki={name:"emscripten::val",O:le=>{var ne=Bn(le);return Zo(le),ne},S:(le,ne)=>qi(ne),X:J,T:null},Nr=(le,ne,Te)=>{switch(ne){case 1:return Te?function(Ce){return this.O(x[Ce])}:function(Ce){return this.O(T[Ce])};case 2:return Te?function(Ce){return this.O(E[Ce>>1])}:function(Ce){return this.O(v[Ce>>1])};case 4:return Te?function(Ce){return this.O(S[Ce>>2])}:function(Ce){return this.O(I[Ce>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${le}`)}},Wc=(le,ne)=>{var Te=ae[le];if(Te===void 0)throw le=`${ne} has unknown type ${Mr(le)}`,new we(le);return Te},xd=(le,ne)=>{switch(ne){case 4:return function(Te){return this.O(R[Te>>2])};case 8:return function(Te){return this.O(O[Te>>3])};default:throw new TypeError(`invalid float width (${ne}): ${le}`)}},xp=(le,ne,Te)=>{let Ce=(Ze,Et)=>{let pt=0;return{next(){if(pt>=Ze)return{done:!0};let wt=pt;return pt++,{value:Et(wt),done:!1}},[Symbol.iterator](){return this}}};le[Symbol.iterator]||(le[Symbol.iterator]=function(){let Ze=this[ne]();return Ce(Ze,Et=>this[Te](Et))})},Nh=Object.assign({optional:!0},ki),da=(le,ne,Te)=>{var Ce=T;if(!(0<Te))return 0;var Ze=ne;Te=ne+Te-1;for(var Et=0;Et<le.length;++Et){var pt=le.codePointAt(Et);if(127>=pt){if(ne>=Te)break;Ce[ne++]=pt}else if(2047>=pt){if(ne+1>=Te)break;Ce[ne++]=192|pt>>6,Ce[ne++]=128|pt&63}else if(65535>=pt){if(ne+2>=Te)break;Ce[ne++]=224|pt>>12,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63}else{if(ne+3>=Te)break;Ce[ne++]=240|pt>>18,Ce[ne++]=128|pt>>12&63,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63,Et++}}return Ce[ne]=0,ne-Ze},Tp=le=>{for(var ne=0,Te=0;Te<le.length;++Te){var Ce=le.charCodeAt(Te);127>=Ce?ne++:2047>=Ce?ne+=2:55296<=Ce&&57343>=Ce?(ne+=4,++Te):ne+=3}return ne},ks=new TextDecoder,tc=(le,ne,Te,Ce)=>{if(Te=ne+Te,Ce)return Te;for(;le[ne]&&!(ne>=Te);)++ne;return ne},Yb=new TextDecoder("utf-16le"),ri=(le,ne,Te)=>(le>>=1,Yb.decode(v.subarray(le,tc(v,le,ne/2,Te)))),Kr=(le,ne,Te)=>{if(Te??(Te=2147483647),2>Te)return 0;Te-=2;var Ce=ne;Te=Te<2*le.length?Te/2:le.length;for(var Ze=0;Ze<Te;++Ze)E[ne>>1]=le.charCodeAt(Ze),ne+=2;return E[ne>>1]=0,ne-Ce},Ol=le=>2*le.length,Z0=(le,ne,Te)=>{var Ce="";le>>=2;for(var Ze=0;!(Ze>=ne/4);Ze++){var Et=I[le+Ze];if(!Et&&!Te)break;Ce+=String.fromCodePoint(Et)}return Ce},Ma=(le,ne,Te)=>{if(Te??(Te=2147483647),4>Te)return 0;var Ce=ne;Te=Ce+Te-4;for(var Ze=0;Ze<le.length;++Ze){var Et=le.codePointAt(Ze);if(65535<Et&&Ze++,S[ne>>2]=Et,ne+=4,ne+4>Te)break}return S[ne>>2]=0,ne-Ce},Ep=le=>{for(var ne=0,Te=0;Te<le.length;++Te)65535<le.codePointAt(Te)&&Te++,ne+=4;return ne},Ey=[],Aq=le=>{var ne=Ey.length;return Ey.push(le),ne},bq=(le,ne)=>{for(var Te=Array(le),Ce=0;Ce<le;++Ce)Te[Ce]=Wc(I[ne+4*Ce>>2],`parameter ${Ce}`);return Te},xq=(le,ne,Te)=>{var Ce=[];return le=le(Ce,Te),Ce.length&&(I[ne>>2]=qi(Ce)),le},Tq={},Cp=le=>{var ne=Tq[le];return ne===void 0?ge(le):ne},$C={},Xb=()=>{var le;if(!Lh){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((le=globalThis.navigator)==null?void 0:le.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},Te;for(Te in $C)$C[Te]===void 0?delete ne[Te]:ne[Te]=$C[Te];var Ce=[];for(Te in ne)Ce.push(`${Te}=${ne[Te]}`);Lh=Ce}return Lh},Lh,Eq=[null,[],[]];if((()=>{let le=st.prototype;Object.assign(le,{isAliasOf:function(Te){if(!(this instanceof st&&Te instanceof st))return!1;var Ce=this.M.R.N,Ze=this.M.P;Te.M=Te.M;var Et=Te.M.R.N;for(Te=Te.M.P;Ce.W;)Ze=Ce.fa(Ze),Ce=Ce.W;for(;Et.W;)Te=Et.fa(Te),Et=Et.W;return Ce===Et&&Ze===Te},clone:function(){if(this.M.P||Xe(this),this.M.ea)return this.M.count.value+=1,this;var Te=qe,Ce=Object,Ze=Ce.create,Et=Object.getPrototypeOf(this),pt=this.M;return Te=Te(Ze.call(Ce,Et,{M:{value:{count:pt.count,da:pt.da,ea:pt.ea,P:pt.P,R:pt.R,V:pt.V,Y:pt.Y}}})),Te.M.count.value+=1,Te.M.da=!1,Te},delete(){if(this.M.P||Xe(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var Te=this.M;--Te.count.value,Te.count.value===0&&(Te.V?Te.Y.Z(Te.V):Te.R.N.Z(Te.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||Xe(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(le[ne]=le.delete)})(),Object.assign(jn.prototype,{wa(le){return this.pa&&(le=this.pa(le)),le},ma(le){var ne;(ne=this.Z)==null||ne.call(this,le)},X:J,O:function(le){function ne(){return this.ha?bi(this.N.ba,{R:this.Ba,P:Te,Y:this,V:le}):bi(this.N.ba,{R:this,P:le})}var Te=this.wa(le);if(!Te)return this.ma(le),null;var Ce=di(this.N,Te);if(Ce!==void 0)return Ce.M.count.value===0?(Ce.M.P=Te,Ce.M.V=le,Ce.clone()):(Ce=Ce.clone(),this.ma(le),Ce);if(Ce=this.N.va(Te),Ce=Gt[Ce],!Ce)return ne.call(this);Ce=this.ga?Ce.sa:Ce.pointerType;var Ze=Wi(Te,this.N,Ce.N);return Ze===null?ne.call(this):this.ha?bi(Ce.N.ba,{R:Ce,P:Ze,Y:this,V:le}):bi(Ce.N.ba,{R:Ce,P:Ze})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var Kb,JC,vp,$b,QP,ZC={y:()=>P(""),r:le=>{var ne=Q[le];delete Q[le];var Te=ne.ka,Ce=ne.Z,Ze=ne.na,Et=Ze.map(pt=>pt.za).concat(Ze.map(pt=>pt.Fa));xe([le],Et,pt=>{var wt={},bn,qn;for([bn,qn]of Ze.entries()){let _n=pt[bn],vo=qn.xa,mo=qn.ya,$s=pt[bn+Ze.length],Sc=qn.Ea,Ml=qn.Ga;wt[qn.ua]={read:Cu=>_n.O(vo(mo,Cu)),write:(Cu,Q0)=>{var Ct=[];Sc(Ml,Cu,$s.S(Ct,Q0)),W(Ct)},optional:_n.optional}}return[{name:ne.name,O:_n=>{var vo={},mo;for(mo in wt)vo[mo]=wt[mo].read(_n);return Ce(_n),vo},S:(_n,vo)=>{for(var mo in wt)if(!(mo in vo||wt[mo].optional))throw new TypeError(`Missing field: "${mo}"`);var $s=Te();for(mo in wt)wt[mo].write($s,vo[mo]);return _n!==null&&_n.push(Ce,$s),$s},X:J,T:Ce}]})},o:(le,ne,Te,Ce,Ze)=>{ne=ge(ne),Ce=Ce===0n;let Et=pt=>pt;if(Ce){let pt=8*Te;Et=wt=>BigInt.asUintN(pt,wt),Ze=Et(Ze)}Qe(le,{name:ne,O:Et,S:(pt,wt)=>(typeof wt=="number"&&(wt=BigInt(wt)),wt),X:He(ne,Te,!Ce),T:null})},C:(le,ne,Te,Ce)=>{ne=ge(ne),Qe(le,{name:ne,O:function(Ze){return!!Ze},S:function(Ze,Et){return Et?Te:Ce},X:function(Ze){return this.O(T[Ze])},T:null})},k:(le,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n,vo,mo)=>{_n=ge(_n),Et=Wn(Ze,Et),wt&&(wt=Wn(pt,wt)),qn&&(qn=Wn(bn,qn)),mo=Wn(vo,mo);var $s=ft(_n);mt($s,function(){fo(`Cannot construct ${_n} due to unbound types`,[Ce])}),xe([le,ne,Te],Ce?[Ce]:[],Sc=>{if(Sc=Sc[0],Ce)var Ml=Sc.N,Cu=Ml.ba;else Cu=st.prototype;Sc=vt(_n,function(...Fe){if(Object.getPrototypeOf(this)!==Q0)throw new we(`Use 'new' to construct ${_n}`);if(Ct.aa===void 0)throw new we(`${_n} has no accessible constructor`);var gt=Ct.aa[Fe.length];if(gt===void 0)throw new we(`Tried to invoke ctor of ${_n} with invalid number of parameters (${Fe.length}) - expected (${Object.keys(Ct.aa).toString()}) parameters instead!`);return gt.apply(this,Fe)});var Q0=Object.create(Cu,{constructor:{value:Sc}});Sc.prototype=Q0;var Ct=new Xt(_n,Sc,Q0,mo,Ml,Et,wt,qn);if(Ct.W){var ye;(ye=Ct.W).la??(ye.la=[]),Ct.W.la.push(Ct)}return Ml=new jn(_n,Ct,!0,!1,!1),ye=new jn(_n+"*",Ct,!1,!1,!1),Cu=new jn(_n+" const*",Ct,!1,!0,!1),Gt[le]={pointerType:ye,sa:Cu},nn($s,Sc),[Ml,ye,Cu]})},g:(le,ne,Te,Ce,Ze,Et)=>{var pt=Bs(ne,Te);Ze=Wn(Ce,Ze),xe([],[le],wt=>{wt=wt[0];var bn=`constructor ${wt.name}`;if(wt.N.aa===void 0&&(wt.N.aa=[]),wt.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${wt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return wt.N.aa[ne-1]=()=>{fo(`Cannot construct ${wt.name} due to unbound types`,pt)},xe([],pt,qn=>(qn.splice(1,0,null),wt.N.aa[ne-1]=no(bn,qn,null,Ze,Et),[])),[]})},b:(le,ne,Te,Ce,Ze,Et,pt,wt,bn)=>{var qn=Bs(Te,Ce);ne=ge(ne),ne=mi(ne),Et=Wn(Ze,Et),xe([],[le],_n=>{function vo(){fo(`Cannot call ${mo} due to unbound types`,qn)}_n=_n[0];var mo=`${_n.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),wt&&_n.N.Ca.push(ne);var $s=_n.N.ba,Sc=$s[ne];return Sc===void 0||Sc.U===void 0&&Sc.className!==_n.name&&Sc.$===Te-2?(vo.$=Te-2,vo.className=_n.name,$s[ne]=vo):(lt($s,ne,mo),$s[ne].U[Te-2]=vo),xe([],qn,Ml=>(Ml=no(mo,Ml,_n,Et,pt,bn),$s[ne].U===void 0?(Ml.$=Te-2,$s[ne]=Ml):$s[ne].U[Te-2]=Ml,[])),[]})},A:le=>Qe(le,ki),s:(le,ne,Te,Ce,Ze)=>{switch(ne=ge(ne),Ze=Ze===0?"object":Ze===1?"number":"string",Ze){case"object":let pt=function(){};pt.values={},Qe(le,{name:ne,constructor:pt,valueType:Ze,O:function(wt){return this.constructor.values[wt]},S:(wt,bn)=>bn.value,X:Nr(ne,Te,Ce),T:null}),mt(ne,pt);break;case"number":var Et={};Qe(le,{name:ne,ja:Et,valueType:Ze,O:wt=>wt,S:(wt,bn)=>bn,X:Nr(ne,Te,Ce),T:null}),mt(ne,Et),delete o[ne].$;break;case"string":Et={},Qe(le,{name:ne,ra:{},qa:{},ja:Et,valueType:Ze,O:function(wt){return this.qa[wt]},S:function(wt,bn){return this.ra[bn]},X:Nr(ne,Te,Ce),T:null}),mt(ne,Et),delete o[ne].$}},d:(le,ne,Te)=>{var Ce=Wc(le,"enum");switch(ne=ge(ne),Ce.valueType){case"object":le=Ce.constructor,Ce=Object.create(Ce.constructor.prototype,{value:{value:Te},constructor:{value:vt(`${Ce.name}_${ne}`,function(){})}}),le.values[Te]=Ce,le[ne]=Ce;break;case"number":Ce.ja[ne]=Te;break;case"string":Ce.ra[ne]=Te,Ce.qa[Te]=ne,Ce.ja[ne]=ne}},n:(le,ne,Te)=>{ne=ge(ne),Qe(le,{name:ne,O:Ce=>Ce,S:(Ce,Ze)=>Ze,X:xd(ne,Te),T:null})},m:(le,ne,Te,Ce,Ze,Et,pt)=>{var wt=Bs(ne,Te);le=ge(le),le=mi(le),Ze=Wn(Ce,Ze),mt(le,function(){fo(`Cannot call ${le} due to unbound types`,wt)},ne-1),xe([],wt,bn=>(bn=[bn[0],null].concat(bn.slice(1)),nn(le,no(le,bn,null,Ze,Et,pt),ne-1),[]))},c:(le,ne,Te,Ce,Ze)=>{ne=ge(ne);let Et=wt=>wt;if(Ce===0){var pt=32-8*Te;Et=wt=>wt<<pt>>>pt,Ze=Et(Ze)}Qe(le,{name:ne,O:Et,S:(wt,bn)=>bn,X:He(ne,Te,Ce!==0),T:null})},j:(le,ne,Te,Ce)=>{Te=ge(Te),Ce=ge(Ce),xe([],[le,ne],Ze=>(xp(Ze[0].N.ba,Te,Ce),[]))},a:(le,ne,Te)=>{function Ce(Et){return new Ze(x.buffer,I[Et+4>>2],I[Et>>2])}var Ze=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Te=ge(Te),Qe(le,{name:Te,O:Ce,X:Ce},{Aa:!0})},h:le=>{Qe(le,Nh)},B:(le,ne)=>{ne=ge(ne),Qe(le,{name:ne,O(Te){var Ce=(Ce=Te+4)?ks.decode(T.subarray(Ce,tc(T,Ce,I[Te>>2],!0))):"";return vp(Te),Ce},S(Te,Ce){Ce instanceof ArrayBuffer&&(Ce=new Uint8Array(Ce));var Ze=typeof Ce=="string";if(!(Ze||ArrayBuffer.isView(Ce)&&Ce.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var Et=Ze?Tp(Ce):Ce.length,pt=JC(4+Et+1),wt=pt+4;return I[pt>>2]=Et,Ze?da(Ce,wt,Et+1):T.set(Ce,wt),Te!==null&&Te.push(vp,pt),pt},X:J,T(Te){vp(Te)}})},f:(le,ne,Te)=>{if(Te=ge(Te),ne===2)var Ce=ri,Ze=Kr,Et=Ol;else Ce=Z0,Ze=Ma,Et=Ep;Qe(le,{name:Te,O:pt=>{var wt=Ce(pt+4,I[pt>>2]*ne,!0);return vp(pt),wt},S:(pt,wt)=>{if(typeof wt!="string")throw new we(`Cannot pass non-string to C++ string type ${Te}`);var bn=Et(wt),qn=JC(4+bn+ne);return I[qn>>2]=bn/ne,Ze(wt,qn+4,bn+ne),pt!==null&&pt.push(vp,qn),qn},X:J,T(pt){vp(pt)}})},i:(le,ne,Te,Ce,Ze,Et)=>{Q[le]={name:ge(ne),ka:Wn(Te,Ce),Z:Wn(Ze,Et),na:[]}},e:(le,ne,Te,Ce,Ze,Et,pt,wt,bn,qn)=>{Q[le].na.push({ua:ge(ne),za:Te,xa:Wn(Ce,Ze),ya:Et,Fa:pt,Ea:Wn(wt,bn),Ga:qn})},D:(le,ne)=>{ne=ge(ne),Qe(le,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(le,ne,Te)=>{var[Ce,...Ze]=bq(le,ne);ne=Ce.S.bind(Ce);var Et=Ze.map(bn=>bn.X.bind(bn));le--;var pt={toValue:Bn};switch(le=Et.map((bn,qn)=>{var _n=`argFromPtr${qn}`;return pt[_n]=bn,`${_n}(args${qn?"+"+8*qn:""})`}),Te){case 0:var wt="toValue(handle)";break;case 2:wt="new (toValue(handle))";break;case 3:wt="";break;case 1:pt.getStringOrSymbol=Cp,wt="toValue(handle)[getStringOrSymbol(methodName)]"}return wt+=`(${le})`,Ce.oa||(pt.toReturnWire=ne,pt.emval_returnValue=xq,wt=`return emval_returnValue(toReturnWire, destructorsRef, ${wt})`),wt=`return function (handle, methodName, destructorsRef, args) { +${wt} +}`,Te=new Function(Object.keys(pt),wt)(...Object.values(pt)),wt=`methodCaller<(${Ze.map(bn=>bn.name)}) => ${Ce.name}>`,Aq(vt(wt,Te))},F:Zo,p:(le,ne,Te,Ce,Ze)=>Ey[le](ne,Te,Ce,Ze),E:le=>{var ne=Bn(le);W(ne),Zo(le)},t:(le,ne,Te,Ce)=>{var Ze=new Date().getFullYear(),Et=new Date(Ze,0,1).getTimezoneOffset();Ze=new Date(Ze,6,1).getTimezoneOffset(),I[le>>2]=60*Math.max(Et,Ze),S[ne>>2]=+(Et!=Ze),ne=pt=>{var wt=Math.abs(pt);return`UTC${0<=pt?"-":"+"}${String(Math.floor(wt/60)).padStart(2,"0")}${String(wt%60).padStart(2,"0")}`},le=ne(Et),ne=ne(Ze),Ze<Et?(da(le,Te,17),da(ne,Ce,17)):(da(le,Ce,17),da(ne,Te,17))},z:le=>{var ne=T.length;if(le>>>=0,2147483648<le)return!1;for(var Te=1;4>=Te;Te*=2){var Ce=ne*(1+.2/Te);Ce=Math.min(Ce,le+100663296);e:{Ce=(Math.min(2147483648,65536*Math.ceil(Math.max(le,Ce)/65536))-$b.buffer.byteLength+65535)/65536|0;try{$b.grow(Ce),w();var Ze=1;break e}catch{}Ze=void 0}if(Ze)return!0}return!1},u:(le,ne)=>{var Te=0,Ce=0,Ze;for(Ze of Xb()){var Et=ne+Te;I[le+Ce>>2]=Et,Te+=da(Ze,Et,1/0)+1,Ce+=4}return 0},v:(le,ne)=>{var Te=Xb();I[le>>2]=Te.length,le=0;for(var Ce of Te)le+=Tp(Ce)+1;return I[ne>>2]=le,0},w:()=>52,x:function(){return 70},l:(le,ne,Te,Ce)=>{for(var Ze=0,Et=0;Et<Te;Et++){var pt=I[ne>>2],wt=I[ne+4>>2];ne+=8;for(var bn=0;bn<wt;bn++){var qn=le,_n=T[pt+bn],vo=Eq[qn];_n===0||_n===10?(qn=qn===1?p:g,_n=tc(vo,0),_n=ks.decode(vo.buffer?vo.subarray(0,_n):new Uint8Array(vo.slice(0,_n))),qn(_n),vo.length=0):vo.push(_n)}Ze+=wt}return I[Ce>>2]=Ze,0}},Cy;return Cy=await(async function(){function le(Te){return Te=Cy=Te.exports,Kb=Te.J,JC=o._malloc=Te.K,vp=o._free=Te.L,$b=Te.G,QP=Te.I,w(),Cy}var ne={a:ZC};return o.instantiateWasm?new Promise(Te=>{o.instantiateWasm(ne,(Ce,Ze)=>{Te(le(Ce))})}):(M??(M=y(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F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\0Ak(\0"Axq"\0j!@ Aq\r\0 AqE\r  (\0"k"A\x8C\xD8(\0I\r \0 j!\0@@@A\x90\xD8(\0 G@ (\f! A\xFFM@  (\b"G\rA\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v (!\x07  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v ("AqAG\rA\x84\xD8 \x006\0  A~q6  \0Ar6  \x006\0\v  6\f  6\b\f\vA\0!\v \x07E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  \x07(F@ \x07 6\f\v \x07 6\v E\r\v  \x076 ("@  6  6\v ("E\r\0  6  6\v  O\r\0 ("AqE\r\0@@@@ AqE@A\x94\xD8(\0 F@A\x94\xD8 6\0A\x88\xD8A\x88\xD8(\0 \0j"\x006\0  \0Ar6 A\x90\xD8(\0G\rA\x84\xD8A\x006\0A\x90\xD8A\x006\0\vA\x90\xD8(\0"\x07 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \0j"\x006\0  \0Ar6 \0 j \x006\0\v Axq \0j!\0 (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!\b  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v  A~q6  \0Ar6 \0 j \x006\0\f\vA\0!\v \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  \b(F@ \b 6\f\v \b 6\v E\r\v  \b6 ("@  6  6\v ("E\r\0  6  6\v  \0Ar6 \0 j \x006\0  \x07G\r\0A\x84\xD8 \x006\0\v \0A\xFFM@ \0A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A \0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 \x84!\v\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v !\f\v  \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\vB\0!\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \r\x84B\0!P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\v\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\v\f\v  \r\x84P@B\0!\f\v  \x84P@B\0!\f\v \rB\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xD0\0j  \f  \f \fP"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )X"\fB \x88! )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A@k  +  + +P"\b\x1ByB\xC0\0B\0 \b\x1B|\xA7"\bAk6  \bkAj! )H! + )@!\v \x07 j jA\xFF\xFF\0k!@ +B\x86"B \x88B\x80\x80\x80\x80\b\x84" B \x88"~" B\x86"B \x88" + B\x80\x80\x84"\r~|" T\xAD  B1\x88 \x84B\xFF\xFF\xFF\xFF\x83" \fB\xFF\xFF\xFF\xFF\x83"\f~|" T\xAD|  \r~|   B\x80\x80\xFE\xFF\x83" \f~"  +~|" T\xAD    B\xFF\xFF\xFF\xFF\x83"~|"V\xAD||"V\xAD|  \r~"  \f~|" T\xADB \x86 B \x88\x84|   B \x86|"V\xAD|  \r ~"\r + \f~|"\f  ~|"  ~|"B \x88  V\xAD \f \rT\xAD  \fT\xAD||B \x86\x84|" T\xAD|    ~"\f  +~|"B \x88  \fT\xADB \x86\x84|" + T\xAD + B \x86|" +T\xAD||" + T\xAD| +  B \x86"  ~|" T\xAD|" T\xAD|" +T\xAD|"B\x80\x80\x80\x80\x80\x80\xC0\0\x83PE@ Aj!\f\v B?\x88 B\x86 B?\x88\x84! B\x86 B?\x88\x84! B\x86! B\x86\x84!\v A\xFF\xFFN@ \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v~ A\0L@A k"\x07A\xFF\0M@ A0j   A\xFF\0j"6 A j   6 Aj   \x07g    \x07g )0 )8\x84B\0R\xAD ) )\x84\x84! )( )\x84! )\0! )\b\f\vB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84\v \v\x84!\v P B\0Y B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FQ\x1BE@ \v B|"P\xAD|!\v\f\v  B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84PE@ !\f\v \v  B\x83|" T\xAD|!\v\v \0 7\0 \0 \v7\b A\xE0\0j$\0\v\0 \0!\vr\x7F#\0Ak"$\0  \x006 \0(\0A\x7FG@  Aj6\f  A\fj6\b A\bj!@ \0(\0AF\r\0\v \0(\0E@ \0A6\0 \xF2 \0A\x7F6\0\v\v \0( Aj$\0Ak\v\xB2\x7F#\0Ak"$\0 \0 \0(Aj6  \x006\f@A\xF8\xDE(\0A\xF4\xDE(\0"\0kAu M\x7F@ Aj"\0A\xF8\xDE(\0A\xF4\xDE(\0"kAu"K@#\0A k"\x07$\0@ \0 k"A\xFC\xDE(\0A\xF8\xDE(\0"kAuM@A\xF4\xDE \xB9\f\v A\xF4\xDE(\0kAu j"\0A\x80\x80\x80\x80O@0\0\vA\xFF\xFF\xFF\xFFA\xFC\xDE(\0A\xF4\xDE(\0k"Au" \0 \0 I\x1B A\xFC\xFF\xFF\xFF\x07O\x1B!A\xF8\xDE(\0A\xF4\xDE(\0kAu!A\0! \x07A\fj"\0A\x80\xDF6 \0A\x006\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xD8A\x80\xD8(\0A~ \0wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("\0@  \x006 \0 6\v ("\0E\r\0  \x006 \0 6\v \x07 j!\x07  j"(!\0\v  \0A~q6  \x07Ar6  \x07j \x076\0 \x07A\xFFM@ \x07A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A \x07Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA! \x07A\xFF\xFF\xFF\x07M@ \x07A& \x07A\bvg"\0kvAq \0AtrA>s!\v  6 B\x007 AtA\xAC\xDAj!\0@@A\x80\xD8(\0"A t"qE@A\x80\xD8  r6\0 \0 6\0\f\v \x07A AvkA\0 AG\x1Bt! \0(\0!@ "\0(Axq \x07F\r Av! At! \0 Aqj"("\r\0\v  6\v  \x006  6\f  6\b\f\v \0(\b" 6\f \0 6\b A\x006  \x006\f  6\b\v \bA\bj!\0\f\v@ \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \x07A~ wq"\x076\0\f\v@  \b(F@ \b \x006\f\v \b \x006\v \0E\r\v \0 \b6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v  \x006 B\x007 \0AtA\xAC\xDAj!@@ \x07A \0t"qE@A\x80\xD8  \x07r6\0  6\0  6\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"\x07("\r\0\v \x07 6  6\v  6\f  6\b\f\v (\b"\0 6\f  6\b A\x006  6\f  \x006\b\v A\bj!\0\f\v@ E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \vA~ wq6\0\f\v@  (F@ \x006\f\v \x006\v \0E\r\v \0 6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 \b@ \bAxqA\xA4\xD8j!\0A\x90\xD8(\0!\x7FA \bAvt"\x07 qE@A\xFC\xD7  \x07r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\vA\x90\xD8 6\0A\x84\xD8 6\0\v A\bj!\0\v +Aj$\0 \0\v\0\x9C\0\v;\x7F#\0Ak"$\0  \x006\f (\f"\0(\0"@ \0 6 \0(\b !\v Aj$\0\vu~ \0  ~  ~| B \x88" B \x88"~| B\xFF\xFF\xFF\xFF\x83" B\xFF\xFF\xFF\xFF\x83"~"B \x88  ~|"B \x88|  ~ B\xFF\xFF\xFF\xFF\x83|"B \x88|7\b \0 B\xFF\xFF\xFF\xFF\x83 B \x86\x847\0\v\xC1\x7F \0-\0\0A qE@@ \0("\x7F  \0\xC9\r \0(\v \0("k I@ \0   \0($\0\f\v@@ E \0(PA\0Hr\r\0 !@  j"Ak-\0\0A +G@ Ak"\r\f\v\v \0   \0($\0 I\r  k! \0(!\f\v !\v   Y \0 \0( j6\v\v\v\x7FA9" \0(\x006\0 \v\xC0\x7F@  kAH\r\0 \0( \0,\0\v" A\0H\x1BE\r\0  \x8F \0(\0 \0 \0,\0\v"A\0H"\x1B" \0(  \x1Bj! Ak!\0@@@ -\0\0"Ak! \0 M\r\0 A\xFFqA\xFD\0M@ (\0 G\r\v Aj!   kAJj!\f\v\v A\xFFqA\xFD\0K\r \0(\0Ak I\r\v A6\0\v\vP~@ A\xC0\0q@  A@j\xAD\x86!B\0!\f\v E\r\0  \xAD"\x86 A\xC0\0 k\xAD\x88\x84!  \x86!\v \0 7\0 \0 7\b\vi\x7F#\0A\x80k"$\0 A\x80\xC0q  LrE@    k"A\x80 A\x80I"\x1B\xC6 E@@ \0 A\x803 A\x80k"A\xFFK\r\0\v\v \0  3\v A\x80j$\0\v\0A\0\v<\x7FA \0 \0AM\x1B!@@ /"\0\r\0A\xB4\xEC(\0"E\r\0 \r\0\f\v\v \0E@0\0\v \0\v \0 \0(\0C\v +\0 \0(\0A\xC0\v\xCD \x7F~#\0A\xF0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83! @@ P" B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}B\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FT +P\x1BE@ B\0R B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}"\vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FV \vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FQ\x1B\r\v  +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84! !\f\v P B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\v  +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0   \x85  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84P"\x1B!B\0  \x1B!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P\r  +\x84P@  \x84B\0R\r  \x83!  \x83!\f\v  \x84PE\r\0 ! !\f\v    T +V +Q\x1B"\b\x1B! +   \b\x1B"\fB\xFF\xFF\xFF\xFF\xFF\xFF?\x83!   \b\x1B"\vB0\x88\xA7A\xFF\xFFq!\x07 \fB0\x88\xA7A\xFF\xFFq"E@ A\xE0\0j + + P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6 )h! )\`! +A k!\v   \b\x1B! \vB\xFF\xFF\xFF\xFF\xFF\xFF?\x83! \x07~  A\xD0\0j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B|\xA7"\x07Ak6A \x07k!\x07 )P! )X\vB\x86 B=\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84! B\x86 +B=\x88\x84  \x85!~ B\x86"  \x07F\r\0  \x07k"\x07A\xFF\0K@B\0!B\f\v A@k  A\x80 \x07k6 A0j   \x07g )8! )0 )@ )H\x84B\0R\xAD\x84\v! B\x80\x80\x80\x80\x80\x80\x80\x84!\v +B\x86! +@ B\0S@B\0!B\0! +\x85  \v\x85\x84P\r + }! \v } +V\xAD}"B\xFF\xFF\xFF\xFF\xFF\xFF\xFFV\r A j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B\x84\xA7A\fk"\x076  \x07k! )(! ) !\f\v +|" T\xAD  \v||"B\x80\x80\x80\x80\x80\x80\x80\b\x83P\r\0 B\x83 B?\x86 B\x88\x84\x84! Aj! B\x88!\v \fB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83! A\xFF\xFFN@ B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!B\0!\f\vA\0!\x07@ A\0J@ !\x07\f\v Aj   A\xFF\0j6   A kg )\0 ) )\x84B\0R\xAD\x84! )\b!\v B=\x86 B\x88\x84! B\x88B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \x07\xADB0\x86\x84 \x84!@@ \xA7A\x07q"AG@    AK\xAD|"V\xAD|!\f\v    B\x83|"V\xAD|!\f\v E\r\v\v \0 7\0 \0 7\b A\xF0\0j$\0\v +\0 \0A\x9C\xE0^\v +\0 \0A\xA4\xE0^\v\x84\x7F~#\0Ak"$\0 \0~ E@B\0\f\v   Au"s k"\xADB\0 g"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\0 A\0H\x1B\x84! )\0\v7\0 \0 7\b Aj$\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v -\0\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v -\0\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v (\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v (\0\v\xAA\f\b\x7F\x7FA\0 E\r\0 \0A\x7Fs! AO@@ AqE\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Aj! Ak!\f\v \0! !\f\v \0! !\f\v \0! !\v An"\bAll! +@ \bAk" E@A\0!\f\v !\0A\0!@ \0( \x07s"\x07AvA\xFC\x07q(\xE0S \x07AvA\xFC\x07q(\xE0K \x07AvA\xFC\x07q(\xE0C \x07A\xFFqAt(\xE0;sss!\x07 \0(\f s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\b s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0( s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0(\0 s"AvA\xFC\x07q(\xE0S AvA\xFC\x07q(\xE0K AvA\xFC\x07q(\xE0C A\xFFqAt(\xE0;sss! \0Aj!\0 Ak" \r\0\v  \bAljAk!\v  +j! ( (\f (\b ( (\0 s"\0A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@A\0  \x1B!\0\f\v \0 N@ B\x007 A\x006  6\f  \x006\b  6 B\x007 B\x007$ B\x007, A\x006< B\x81\x80\x80\x80\x80\x80\x80\x8074  Aj  AA\0 (\0(\v\0 (\r\v B\x007 A\x006 A\x98\xC46\f  \x006\b  6 B\x007 B\x007$ B\x007, B\x007\x003 A\x006< A:\0;  Aj AA\0 (\0( +\0A\0!\0@@ ((\0\v (A\0 ($AF\x1BA\0 ( AF\x1BA\0 (,AF\x1B!\0\f\v (AG@ (,\r ( AG\r ($AG\r\v (!\0\v A@k$\0 \0\v\0 \0A\x006\b \0B\x007\0\vc\0 (A\xB0q"A F@ \v@ AG\r\0@@ \0-\0\0"A+k\0\0\v \0Aj\v A0G  \0kAHr\r\0 \0-\0A rA\xF8\0G\r\0 \0Aj!\0\v \0\v1\x7FA\xCC\xCF(\0! \0@A\xCC\xCFA\xD4\xCE \0 \0A\x7FF\x1B6\0\vA\x7F  A\xD4\xCEF\x1B\v\0 \0(\0"\0@ \0H\v\vA\x7F \0 7p \0 \0(, \0("k\xAC7x \0 P  \0(\b"\0 k\xACYr\x7F \0  \xA7j\v6h\vs\x7F \0A\x90\xFC\x006\0 \0(@ \0((!@ @A\0 \0 Ak"At" \0($j(\0 \0( j(\0\x07\0\f\v\v \0Aj\xF3 \0( ! \0($! \0(0! \0(<!\v \0\v\xEC\x7F \0E@A\xC8\xCC(\0@A\xC8\xCC(\0L!\vA\xF8\xCD(\0@A\xF8\xCD(\0L r!\vA\xB0\xCE(\0"\0@@ \0(L \0( \0(G@ \0L r!\v \0(8"\0\r\0\v\v \v \0(LA\0H!@@ \0( \0(F\r\0 \0A\0A\0 \0($\0 \0(\r\0A\x7F!\f\v \0(" \0(\b"G@ \0  k\xACA \0((\0\vA\0! \0A\x006 \0B\x007 \0B\x007 \r\0\v \v-\0 E@ \0( (F\v \0 F@A\v \0( (\x9BE\v\xDB\x7F#\0Ak"$\0  6\fA\0!@ \x7FA \0 A\fj(\r\0A A\xC0\0 \0:" (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Ask6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|! )\0\v7\0 \0 7\b Aj$\0\v\0 \0A\xDF\0q \0 \0A\xE1\0kAI\x1B\v<\0 \0A\x006\b \0B\x007\0 \0 (\x006\0 \0 (6 \0 (\b6\b A\x006\b B\x007\0\v,\x7F \0A\x006\b \0B\x007\0 \0 (\0" ("  k\xC2 \0\vW\x7F~@A\xCC\xCC(\0"\xAD \0\xADB\x07|B\xF8\xFF\xFF\xFF\x83|"B\xFF\xFF\xFF\xFFX@ \xA7"\0?\0AtM\r \0\r\vA\xF8\xD7A06\0A\x7F\vA\xCC\xCC \x006\0 \v\xA7\x7F \0( \0(\0"kAu" I@#\0A k"$\0@  k" \0(\b \0("kAuM@ \0 \xB9\f\v A\fj \0  \0(\0kAu j\x86 \0( \0(\0kAu \0\xB8" \xCF \0 \x96 \xB5\v A j$\0\v  I@ \0  Atj6\v\vt\x7F~ \0B\x80\x80\x80\x80Z@@ Ak" \0" \0B +\x80"\0B +~}\xA7A0r:\0\0 B\xFF\xFF\xFF\xFF\x9FV\r\0\v\v \0PE@ \0\xA7!@ Ak"  A +n"A +lkA0r:\0\0 A K !\r\0\v\v \v}\x7F@@ \0"AqE\r\0 -\0\0E@A\0\v@ Aj"AqE\r -\0\0\r\0\v\f\v@ "Aj!A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v@ "Aj! -\0\0\r\0\v\v  \0k\v\xBF\x7F \0( \0(\0"k" I@#\0A k"$\0@  k" \0(\b \0("kM@ \0 \x96\f\v  A\fj \0  j \0(\0k\x83 \0( \0(\0k \0\x8C"(\b"j!@  G@ A\0:\0\0 Aj!\f\v\v  6\b \0 \xA9 \x87\v A j$\0\v  I@ \0  j6\v\v\v\0  6\0A\v<\0 \0,\0\vA\0H@ \0(\b \0(\0!\v \0 (\b6\b \0 )\x007\0 A\0:\0\v A\x006\0\vK\x7F#\0Ak"$\0 A\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\x07\r !\0\f\v@ E\r\0@ Aq"\x07E@ !\0\f\v !\0@ "Aj! \0Ak!\0  -\0\0j" j! Aj" \x07G\r\0\v\v AI\r\0@  -\0\0j" -\0j" -\0j" -\0j"    jjjj! Aj! \0Ak"\0\r\0\v\v A\xF1\xFFpAt A\xF1\xFFk  A\xF0\xFFK\x1Br\f\vA\0! !\0@ "Aj! \0Ak!\0  -\0\0j" j! Aj" \x07G\r\0\v\v AI\r\0@  -\0\0j" -\0j" -\0j" -\0j"    jjjj! Aj! \0Ak"\0\r\0\v\v A\xF1\xFFp! A\xF1\xFFp!\v At rA\v\v\v:\x7F A\0H@\x85\0\vA\xFF\xFF\xFF\xFF\x07 \0(\b \0(\0k"\0At"   I\x1B \0A\xFF\xFF\xFF\xFFO\x1B\v\0 \0("\0A O@ \0\v\v \0A\x9F\f\xD6\0\v>\x7F A\x80\x80\x80\x80O@\x85\0\vA\xFF\xFF\xFF\xFF \0(\b \0(\0k"\0Au"   I\x1B \0A\xFC\xFF\xFF\xFF\x07O\x1B\v?\x7F \0(! \0(\b!@  G@ \0 Ak"6\b\f\v\v \0(\0"@ \0(\f !\v\vI\x7F \0("A\bu! \0(\0"\0  Aq\x7F (\0 j(\0 \v j A Aq\x1B  \0(\0( +\0\v\xF1\x7FA\xF6\xFF\xFF\xFF\x07 k O@A\xF7\xFF\xFF\xFF\x07!\b \0(\0 \0 \0,\0\vA\0H\x1B! A\xF2\xFF\xFF\xFFM@A\v  j" At"\b  \bK\x1B"A\x07rAj A\vI\x1B!\b\v \b9! @  \xFC +\0\0\v @  j \x07 \xFC +\0\0\v   j" +k"\x07E  +FrE@  j j  j j \x07\xFC +\0\0\v A +G@ !\v \0 6\0 \0 \bA\x80\x80\x80\x80xr6\b \0  j \x07j"\x006 \0 jA\0:\0\0\vi\0\v,\x7F \0 A\xC0\x84=n"At/\xC0\xBB;\0\0 \0Aj  A\xC0\x84=lk\xAB\v\0A\v;\0 \0 6 \0 \x7F 9A\0\v"6\0 \0  j"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vA\x94\xD8(\0 \x07F@A\x88\xD8(\0 \bj"\b M\r   AqrAr6  j" \b k"Ar6A\x88\xD8 6\0A\x94\xD8 6\0\f\vA\x90\xD8(\0 \x07F@A\x84\xD8(\0 \bj" I\r@  k"AO@   AqrAr6  j"\b Ar6  j" 6\0  (A~q6\f\v  Aq rAr6  j" (Ar6A\0!\bA\0!\vA\x90\xD8 \b6\0A\x84\xD8 6\0\f\v \x07("Aq\r Axq \bj"\v I\r \v k!\f \x07(\f!@ A\xFFM@ \x07(\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v \x07(! +@  \x07G@ \x07(\b" 6\f  6\b\f\v@ \x07("\x7F \x07Aj \x07("E\r \x07Aj\v!\b@ \b! "Aj!\b ("\r\0 Aj!\b ("\r\0\v A\x006\0\f\vA\0!\v +E\r\0@ \x07("At"(\xAC\xDA \x07F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \x07 +(F@ + 6\f\v + 6\v E\r\v  +6 \x07("@  6  6\v \x07("E\r\0  6  6\v \fAM@  Aq \vrAr6  \vj" (Ar6\f\v   AqrAr6  j" \fAr6  \vj" (Ar6  \f\xC9\v !\v \v"@ A\bj\v /"E@A\0\v  \0A|Ax \0Ak(\0"Aq\x1B Axqj"   K\x1BY \0! \v\0 \0E@A\0\vA\xF8\xD7 \x006\0A\x7F\v}\x7F#\0Ak"$\0 A +:\0@@ \0("\x7F  \0\xC9\r \0(\v \0("F\r\0 \0(PA +F\r\0 \0 Aj6 A +:\0\0\f\v \0 AjA \0($\0AG\r\0 -\0\v Aj$\0\v\0\v\0A\v\xF4\x7F#\0A@j"\x07B\x007 \x07B\x007( \x07B\x0070 \x07B\x0078@@\x7F@\x7F @ Aq!@ AO@ A|q!@ \x07A j"\f  \bAtj"/\0Atj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 \bAj!\b Aj" G\r\0\v E\r\v@ \x07A j  \bAtj/\0Atj" /\0Aj;\0 \bAj!\b +Aj" + G\r\0\v\v (\0"\b \x07/>"\rE\rA!\v\f\v (\0\v!\bA\0!\r \x07/<@A!\v\f\v \x07/:@A\r!\v\f\v \x07/8@A\f!\v\f\v \x07/6@A\v!\v\f\v \x07/4@A +!\v\f\v \x07/2@A !\v\f\v \x07/0@A\b!\v\f\v \x07/.@A\x07!\v\f\v \x07/,@A!\v\f\v \x07/*@A!\v\f\v \x07/(@A!\v\f\v \x07/&@A!\v\f\v \x07/$@A!\v\f\v \x07/"@A!\fA!\vA!\bA\0\f\v  (\0"\0Aj6\0 \0A\xC06\0  (\0"\0Aj6\0 \0A\xC06\0A!\f\f\v \b \v \b \vI\x1B!A!\b@@ \x07A j \bAtj/\0\r \bAj"\b \vG\r\0\v \v!\b\v  \b  \bK\x1B!\fA\v! A\x7F! + \x07/""AK\rA AtkA\xFE\xFFq \x07/$"k"A\0H\r At \x07/&"k"A\0H\r At \x07/("k"A\0H\r At \x07/*"k"A\0H\r At \x07/,"k"A\0H\r At \x07/."k"A\0H\r At \x07/0"k"A\0H\r At \x07/2"k"A\0H\r At \x07/4"k"A\0H\r At \x07/6"\x1Bk"A\0H\r At \x07/8"k"A\0H\r At \x07/:"k"A\0H\r At \x07/<"k"A\0H\r At" \rI  \rGA\0 \0E r\x1Br\rA\0! + \x07A\0; \x07 ; \x07  j"; \x07  j";\b \x07  j"; + \x07  j";\f \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  \x1Bj"; \x07  j"; \x07  j"; \x07  j;@ E\r\0 AG@ Aq A~q!A\0! @  +Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj +;\0\v  +Ar"Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj ;\0\v +Aj! + Aj" G\r\0\vE\r\v  +Atj/\0"E\r\0 \x07 Atj" /\0"Aj;\0  Atj +;\0\vA!A\0! "!A\0!@@@ \0\0\vA! + \fA K\rA\x81!A\xD0\xED\0!A\x90\xED\0!A!\f\v \0AF!A\0!A\xD0\xEE\0!A\x90\xEE\0! \0AG@\f\vA! + \fA K\r\vA \ft"Ak! (\0!A\0! \f! A\0!A\0!\rA\x7F!@A t!@@\x7FA\0   Atj/\0" AjK\r\0 I@A\0! A\xE0\0\f\v  kAt"\0j/\0! \0 j-\0\0\v!\0A\x7F \b k"t!\x1B  \r vAtj! ! +@  + \x1Bj" +Atj" ;  :\0  \0:\0\0 +\r\0\vA \bAkt! @ "\0Av! \0 \rq\r\0\v \x07A j \bAtj" /\0Ak" ;\0 \0Ak \rq \0jA\0 \0\x1B!\r Aj! A\xFF\xFFqE@ \b \vF\r   Atj/\0Atj/\0!\b\v \b \fM\r\0 \r q"\0 F\r\0\vA \b  \f \x1B"k" t! \b \vI@ \v k! \b! +@@  \x07A j +Atj/\0k"A\0L\r At! Aj" j" + \vI\r\0\v ! \vA t!\vA! +   j"A\xD4Kq  A\xD0Kqr\r (\0" \0Atj" + \f:\0 + :\0\0 +  Atj" kAv; \0!\f\v\v \r@  \rAtj"\0A\0; \0 :\0 \0A\xC0\0:\0\0\v  (\0 Atj6\0\v  \f6\0A\0! +\v +\v\x9C\x7F ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\v (\0!@@@ ("A +M@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFF\x07O\r A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v Aj"@ \0  \xFC +\0\0\v\f\vi\0\v\v\xCC\x7F@A\xF6\xFF\xFF\xFF\x07 k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF\x07! A\xF2\xFF\xFF\xFFM@A\v  j" At"  K\x1B"A\x07rAj A\vI\x1B!\v \0 \x1B! 9! @   \xFC +\0\0\v@  F\r\0  k"\x07E\r\0  j  j \x07\xFC +\0\0\v A +G@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\vi\0\v \0 6\v\0 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F\xBE\vD\x7F#\0Ak"$\0     B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85< )\0! \0 )\b7\b \0 7\0 Aj$\0\v\x9C\x7FA5!@ \0(" \0("AjA\x07pkA\x07jA\x07n  k"A\xF1jA\x07pAIj"A5G@ "\rA4!@@ AjA\x07pAk\0\v \0(A\x90oAk\xB3E\r\vA5\v@@ A\xF3jA\x07pAk\0\v \0(\xB3\r\vA!\v \v\x95\x07\x7F~#\0Ak"\b$\0@@@ A$L@ \0-\0\0"\r \0!\f\vA\xF8\xD7A6\0B\0!\f\v \0!@@ \xC0_E\r -\0! Aj! \r\0\v\f\v@ A\xFFq"A+k\0\0\vA\x7FA\0 A-F\x1B!\x07 Aj!\v\x7F@ ArAG\r\0 -\0\0A0G\r\0A! -\0A\xDFqA\xD8\0F@ Aj!A\f\v Aj! A\b \x1B\f\v A + \x1B\v" +\xAD!\fA\0!@@@ -\0\0"A0k"A\xFFqA +I\r\0 A\xE1\0kA\xFFqAM@ A\xD7\0k!\f\v A\xC1\0kA\xFFqAK\r A7k!\v + A\xFFqL\r\0 \b \fB\0 \vB\02A!@ \b)\bB\0R\r\0 \v \f~"\r \xADB\xFF\x83"B\x7F\x85V\r\0 \r |!\vA! !\v Aj! !\f\v\v @   \0 \x1B6\0\v@@ @A\xF8\xD7A\xC4\x006\0 \x07A\0 B\x83P\x1B!\x07 !\v\f\v  \vV\r\v \x07 \xA7AqrE@A\xF8\xD7A\xC4\x006\0 B}!\f\v  \vZ\r\0A\xF8\xD7A\xC4\x006\0\f\v \v \x07\xAC"\x85 }!\v \bAj$\0 \v\x9A\b\x7F@ \0"Aq@@ -\0\0"E A=Fr\r Aj"Aq\r\0\v\v@@A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r\0@A\x80\x82\x84\b A\xBD\xFA\xF4\xE9s"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r (! Aj"! A\x80\x82\x84\b krA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v\f\v !\v@ "-\0\0"E\r Aj! A=G\r\0\v\v \0 F@A\0\v@ \0  \0k"j-\0\0\r\0A\xEC\xDB(\0"E\r\0 (\0"E\r\0@@\x7F \0!A\0 "E\r\0 \0-\0\0"\x7F@@  -\0\0"\x07G \x07Er\r Ak"E\r Aj! -\0! Aj! \r\0\vA\0!\v A\0\v -\0\0k\vE@ (\0 j"-\0\0A=F\r\v (! Aj! \r\f\v\v Aj!\b\v \b\v \0 \0\x81!\v\0 \0A\fjK \0!\v\0\v\0 \0A\xA8\xF5\x006\0 \0Aj\xF3 \0\v\xFD~\x7F#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!~ B0\x88B\xFF\xFF\x83"\xA7"A\x81\xF8\0kA\xFDM@ B\x86 \0B<\x88\x84! A\x80\xF8\0k\xAD!@ \0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83"\0B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ B|!\f\v \0B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 B\x83 |!\vB\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07V"\x1B!\0 \xAD |\f\v \0 \x84P B\xFF\xFFRrE@ B\x86 \0B<\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84!\0B\xFF\f\v A\xFE\x87K@B\0!\0B\xFF\f\vA\x80\xF8\0A\x81\xF8\0 P"\x1B"\b k"\x07A\xF0\0J@B\0!\0B\0\f\v  B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!A\0!  \bG@ Aj \0 A\x80 \x07k6 ) )\x84B\0R!\v  \0  \x07g )\bB\x86 )\0"B<\x88\x84!\0@ \xAD B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83\x84"B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ \0B|!\0\f\v B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 \0B\x83 \0|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\0\0\f\v \x9F\v (L A\x006L\v\v\x9C\0\v\x88\x7F@@@ \0,\0\v"A\0N@A! AF\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xFF !\v \0 Aj6 \0(\0!\0\v \0 Atj"\0A\x006 \0 6\0\v\x9B\x7FA\xF6\xFF\xFF\xFF k O@A\xF7\xFF\xFF\xFF! \0(\0 \0 \0,\0\vA\0H\x1B! + A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj! \v U!@ E\r\0 At"\bE\r\0  + \b\xFC +\0\0\v@ E\r\0 At"\bE\r\0  Atj \x07 \b\xFC +\0\0\v   j"\bk!\x07@  \bF\r\0 \x07At"E\r\0  At"\bj Atj \b +j Atj \xFC +\0\0\v AG@ +!\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b \0  j \x07j"\x006  \0AtjA\x006\0\v0\0\v\x8A\x7F A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @  6\0 Ak! Aj!\f\v\v \0 AtjA\x006\0\v0\0\v\xA0\x7F \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA + \0,\0\v"A\0H"\x1B" O@ \0(\0 \0 \x1B!@ \x7F @   \xFC +\0\0\v \0,\0\v Av\v\xC0A\0H@ \0 6\f\v \0 A\xFF\0q:\0\v\v  jA\0:\0\0\v \0   k \0(  \x1B"\0A\0 \0  \x89\v\x87\x7F A\xF7\xFF\xFF\xFF\x07I@@ A +M@ \0 :\0\v\f\v A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @  :\0\0 Ak! Aj!\f\v\v \0 jA\0:\0\0\vi\0\v\0 \0 F@ \0A\0:\0x\v !\v<\x7F#\0Ak"$\0@@ AK\r\0 \0-\0xAq\r\0 \0A:\0x\f\v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(\b\xA6\v \0\v\0A\x7F\v\x9D\x07 \x7F  \x006\0AA\0 \x07\x1B! A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! AtAk"@  \r(\0 \r \x1BAj \xFC +\0\0\v   j6\0\v A\xB0q"AG@  A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v  (\x006\0\f\v  (\x006\0 A (\0(,\0!\x07  (\0"Aj6\0  \x076\0\f\v \r( \r,\0\v"\x07 \x07A\0H"\x07\x1BE\r \r(\0 \r \x07\x1B(\0!\x07  (\0"Aj6\0  \x076\0\f\v E\r \f( \f,\0\v"\x07 \x07A\0H"\x1B"E\r (\0!\x07 At"@ \x07 \f(\0 \f \x1B \xFC +\0\0\v  \x07 j6\0\f\v (\0  j"!\x07@@  \x07M\r\0 A\xC0\0 \x07(\0 (\0(\f\0E\r\0 \x07Aj!\x07\f\v\v A\0J@ (\0! !@ E  \x07OrE@ Ak! \x07Ak"\x07(\0!  Aj"6\0  6\0 !\f\v\v \x7F A0 (\0(,\0A\0\v! (\0!@ A\0LE@  Aj"6\0  6\0 Ak! !\f\v\v  (\0"Aj6\0  6\0\v@  \x07F@ A0 (\0(,\0!\x07  (\0"Aj6\0  \x076\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@  \x07F\r@  G@ !\f\v  (\0"Aj6\0  +6\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0  \v \x1B j,\0\0!\v \x07Ak"\x07(\0!  (\0"Aj6\0  6\0 Aj!\f\0\v\0\v (\0\x8F\v Aj!\f\v\v\v\x8A\x7F#\0Ak" +$\0@ \0@ \xFE!\f\v \xFD!\v@ @ +Aj"\0  (\0(,\0  +(6\0\0 \0  (\0( \0\f\v +Aj"\0  (\0((\0  +(6\0\0 \0  (\0(\0\v \b \0| \0    (\0(\f\0\x006\0   (\0(\0\x006\0 +Aj"\0  (\0(\0  \0X \0  \0  (\0(\0 \x07 \0| \0   (\0($\0\x006\0 +Aj$\0\v\x7FA\f9"\0A\x006\b \0B\x007\0 \0\v\xF7 \x7F  \x006\0 A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! Ak"@  \r(\0 \r \x1BAj \xFC +\0\0\v   j6\0\v A\xB0q"AG@  A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v  (\x006\0\f\v  (\x006\0 A (\0(\0!  (\0"Aj6\0  :\0\0\f\v \r( \r,\0\v" A\0H"\x1BE\r \r(\0 \r \x1B-\0\0!  (\0"Aj6\0  :\0\0\f\v E\r \f( \f,\0\v" A\0H"\x1B"E\r (\0! @  \f(\0 \f \x1B \xFC +\0\0\v   j6\0\f\v (\b! (\0  \x07j"!@@  M\r\0 ,\0\0"A\0H\r\0  Atj-\0\0A\xC0\0qE\r\0 Aj!\f\v\v "A\0J@@ E  OrE@ Ak! Ak"-\0\0!  (\0"Aj6\0  :\0\0\f\v\v \x7F A0 (\0(\0A\0\v!@  (\0"Aj6\0 A\0LE@  :\0\0 Ak!\f\v\v  :\0\0\v@  F@ A0 (\0(\0!  (\0"Aj6\0  :\0\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@  F\r@  G@ !\f\v  (\0"Aj6\0  +:\0\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0  \v \x1B j,\0\0!\v Ak"-\0\0!  (\0"Aj6\0  :\0\0 Aj!\f\0\v\0\v (\0c\v Aj!\f\v\v\v\x8A\x7F#\0Ak" +$\0@ \0@ \x83!\f\v \x82!\v@ @ +Aj"\0  (\0(,\0  +(6\0\0 \0  (\0( \0\f\v +Aj"\0  (\0((\0  +(6\0\0 \0  (\0(\0\v \b \0X \0    (\0(\f\0\0:\0\0   (\0(\0\0:\0\0 +Aj"\0  (\0(\0  \0X \0  \0  (\0(\0 \x07 \0X \0   (\0($\0\x006\0 +Aj$\0\v +\0 \0A\xA4\xDE^\v +\0 \0A\xAC\xDE^\v\xD7\x7F@A\xF6\xFF\xFF\xFF k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF! A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj!\v \0 \x1B! U!@ E\r\0 At"\x07E\r\0   \x07\xFC +\0\0\v@  F\r\0  kAt"\x07E\r\0 At" j  j \x07\xFC +\0\0\v AG@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\v0\0\v \0 6\v\xD8\x7F#\0A\x90k"\v$\0 \v +6\x88 \v 6\x8C@ \0 \vA\x8Cj(@  (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j!\f \vA(j \vAj#\0Ak" +$\0@ @ +Aj" \xFE" (\0(,\0\f\v +Aj" \xFD" (\0(,\0\v \v +(6\0\\   (\0( \0 |     (\0(\0 |   \v  (\0(\f\0\x006X \v  (\0(\0\x006T   (\0(\0 X     (\0(\0 \f |   \v  (\0($\0\x006 +Aj$\0 \b(\x006\0 A\x80q!A\0!A\0! +@ +!@@\x7F@@@@ AF\r\0 \0 \vA\x8Cj(\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\f\v AF\r + \x07A \0: \x07(\0(\f\0\r\x07  (\0Ar6\0A\0!\0\f\v AG\r\x07\f \v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0: \v(( \vA(j" \v,\x003"A\0H\x1B(\0G\r\0 \0Q A\0:\0\0   \v(, \v,\x003" A\0H\x1BAK\x1B! +\f +\v \v( \v,\0#" + +A\0H\x1B@ \0: \v( \vAj \v,\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  (\0Ar6\0A\0!\0\f\v (\0 \v(\x88F@ \b \vA\x88jk\v \0:! (\0"Aj6\0  6\0 \v \v(Ak6\f\0\v\0\v ! + (\0 \b(\0G\r\x07  (\0Ar6\0A\0!\0\f\v \0Q A:\0\0 \vAj  \v( \v,\0#" A\0H\x1BAK\x1B! +\f\v@ E\r\0A!\x07@ \x07 ( ,\0\v" A\0H\x1BO\r@ \0 \vA\x8Cj(E@ \0: \x07At (\0  ,\0\vA\0H\x1Bj(\0F\r\v  (\0Ar6\0A\0!\0\f\v \0Q \x07Aj!\x07\f\0\v\0\vA!\0 \v(h" \v(d"F\r\0A\0!\0 \vA\x006\0 \vA\xC8\0j   \v5 \v(\0@  (\0Ar6\0\f\vA!\0\v \vA\bj  \vAj  \vA(j  \vA8j  \vA\xC8\0j  \v(h! \vA\x006h E\r  \v(l\0\f\vA\0\f\vA\v!@ E@ \vA\bj \0(\0B\xDDA!\f\v \0 \vA\x8Cj(\r \x07A \0: \x07(\0(\f\0E\rA\0!\f\0\v\0\v ! +\v Aj!\f\0\v\0\v \vA\x90j$\0 \0\v\0 \0@ \01\v \0!\v +\0 \0A\x94\xDE^\v +\0 \0A\x9C\xDE^\v\xB8\x7F (\0!\x07A\0 \0(\0" \0(A\xE3\0F"\x1BA\x7FA (\0 k"At" AM\x1B A\xFF\xFF\xFF\xFF\x07O\x1B"\b\x9D"@@ E@ \0 6\0\f\v \0(\0! @   \xFC +\0\0\v \0 6\0 E\r\0  \0(\0 \0(\0!\v \0A\xE4\x006   \x07 kj6\0  \0(\0 \bj6\0\v0\0\v\xEE\x7F#\0A\x90k"\v$\0 \v +6\x88 \v 6\x8C@ \0 \vA\x8Cj)@  (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j! \vA(j \vAj#\0Ak" +$\0@ @ +Aj" \x83" (\0(,\0\f\v +Aj" \x82" (\0(,\0\v \v +(6\0\\   (\0( \0 X     (\0(\0 X   \v  (\0(\f\0\0:\0[ \v  (\0(\0\0:\0Z   (\0(\0 X     (\0(\0  X   \v  (\0($\0\x006 +Aj$\0 \b(\x006\0 A\x80q!A\0!A\0! +@@ +!@@@@@@@\x7F@@@ AF\r\0 \0 \vA\x8Cj)\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\v AF\r\r \0;"A\0N@ \x07(\b Atj-\0\0Aq\r\x07\v  (\0Ar6\0A\0!\0\f\v AG\r\f\f\v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0;A\xFFq \v(( \vA(j" \v,\x003"A\0H\x1B-\0\0G\r\0 \0S A\0:\0\0   \v(, \v,\x003" A\0H\x1BAK\x1B! +\f\v \v( \v,\0#" + +A\0H\x1B@ \0;A\xFFq \v( \vAj \v,\0#" +A\0H\x1B-\0\0F\r \v-\x003!\v \v( + +A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r  (\0Ar6\0A\0!\0\f\v E\r\f\v  A\0G:\0\0\f\v\v   AIrrE@A\0! + AF \v-\0_A\0GqE\r\r\v \v(8" \vA8j \v,\0C"\rA\0H"\x1B! E\r\b \fAk-\0\0AK\r\b  \v(< \r \x1Bj! \x07(\b!\f ! +@  +F\r\b +,\0\0"A\0H\r\x07 \f Atj-\0\0AqE\r\x07 +Aj! +\f\0\v\0\v@@ \0 \vA\x8Cj)\r\0\x7F@ \0;" +A\0H\r\0 \x07(\b +Atj-\0\0A\xC0\0qE\r\0 (\0" \v(\x88F@ \b \vA\x88j\x84 (\0!\v Aj6\0  +:\0\0 Aj\f\v \v(L \v,\0S" A\0H\x1BE Er\r \v-\0Z +A\xFFqG\r \v(d" + \v(\`F@ \vA\xE8\0j \vA\xE4\0j \vA\xE0\0jk \v(d! +\v \v +Aj6d + 6\0A\0\v! \0S\f\v\v E \v(d" + \v(h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0\0*!\xB7E\r Aj!\f\0\v\0\v@ +(\b +,\0"\x07 \x07A\0H\x1BE@ \b  (\0 (\0( \0  (\0  \bkj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@  \x07M@  \b \0kj (\0c@ +(" +Aj" +,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v   \x1B \rj,\0\0G\r\0  (\0"\vAj6\0 \v :\0\0A\0!\v \r \r +(\b +,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(\0!  (\0"Aj6\0  :\0\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@  M@ !\x07\f\v Aj!\x07 ,\0\0"A.G\r \f \f(\0(\f\0\0!  (\0"\bAj6\0 \b :\0\0\v \x07  (\0 (\0( \0  (\0  \x07kj"6\0     \0kj  F\x1B6\0 +Aj  +Aj$\0\v  (\0(\0!  (\0"\bAj6\0 \b :\0\0 \x07!\f\0\v\0\v\xB9\x7F#\0A@j"$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A3j!@ E A\x80qEr\r\0 \b@ A0:\x003 A4j!\f\v \x07A\bG\r\0 A0:\x003 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\x004 A5j!\v A(j  A@k  \x94 ((!@ A\x88\x80qA\x88\x80G\r\0@  F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A3j"  G! Aj"\x07 $    Aj" A\fj A\bj \x07\x93 (# \0  (\f (\b  Z A@k$\0\v\xED\b\x7F#\0Ak"$\0A\xA5\bAA\xA0 A\xEE AAA\0A\0\fA\x92\fAA\xF4 A\xA8!AAA\0A\0\fA\x88\xCE-\0\0E@A\x88\xCEA:\0\0A\xAC!A\xB8\xC8\x07\vA\xFC A\x9C%A\xD4%A\0A\x8A&AA\x8D&A\0A\x8D&A\0A\x83A\x8F&A\x07 +A\xFC AA\x94&A\x98&A"A\b#\0Ak"\0$\0 \0A 6\fA\xFC A\x9CAA\x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x82\x84\bk rA\x80\x81\x82\x84xq\r\0@ Ak! "Aj! ("A\x81\x82\x84\bk rA\x80\x81\x82\x84xqE\r\0\v\v \xC0A\0J@ Ak! Aj!\f\v\v A\xFFqA\xC2k"A2K\r Aj! At(\x80\x84!A\0!\x07\f\0\v\0\v@ \x07E@ E\r\x07@@ -\0\0"\x07\xC0"A\0L\r\0 Aq AIrE@@@ (\0"A\x81\x82\x84\bk rA\x80\x81\x82\x84xq\r \0 A\xFFq6\0 \0 -\06 \0 -\06\b \0 -\06\f \0Aj!\0 Aj! Ak"AK\r\0\v -\0\0!\v A\xFFq!\x07 \xC0A\0L\r\v \0 \x076\0 \0Aj!\0 Aj! Ak"\r\f \v\v \x07A\xC2k"A2K\r Aj! At(\x80\x84!A!\x07\f\v -\0\0"\bAv"Ak  AujrA\x07K\r@@\x7F Aj" \bA\x80k Atr"\x07A\0N\r\0 -\0\0A\x80k"A?K\r  \x07At"\br!\x07 Aj" \bA\0N\r\0 -\0\0A\x80k"A?K\r  \x07Atr!\x07 Aj\v! \0 \x076\0 Ak! \0Aj!\0\f\vA\xF8\xD7A6\0 Ak!\f\vA\0!\x07\f\0\v\0\v Ak! \r -\0\0!\v A\xFFq\r\0 \0@ \0A\x006\0 A\x006\0\v  k\vA\xF8\xD7A6\0 \0E\r\v  6\0\vA\x7F\v  6\0 \v#\x7F \0!@ "Aj! (\0\r\0\v  \0kAu\v\0 \0\xBA@ \0!\v\v%\x7F#\0Ak"$\0  6\f \0A\xE9 \xA9 Aj$\0\v3\x7F A\x80\x80\x80\x80O@\x85\0\v \0 U"6 \0 6\0 \0  Atj6\b\v\xC9\x7F~#\0A\x90k"$\0 A\0A\x90\xFC\v\0 A\x7F6L  \x006, A\xE2\x006  \x006T ! !#\0A\xB0k"$\0 (L@@ (E@ \xC8 (E\r\v -\0\0"E\r@@@@@ A\xFFq"\0_@@ "Aj! -\0_\r\0\v B\0J@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v_\r\0\v (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\f\v  \0A\xF1\x81j-\0\0"M\r AlAvA\x07q,\0\xF1\x83!@   t"r! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\x80\x80\x80\xC0\0Iq\r\0\v \xAD! \rB\x7F \xAD"\x88" T\r@ \xADB\xFF\x83  \x86\x84! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r  X\r\0\v\f\v@   lj! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\xC7\xE3\xF18Iq\r\0\v \xAD! \r \xAD!@  ~" \xADB\xFF\x83"B\x7F\x85V\r  |! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r \b B\0 B\02 \b)\bP\r\0\v\v\v  \0A\xF1\x81j-\0\0M\r\0@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\vA\xF1\x81j-\0\0K\r\0\vA\xF8\xD7A\xC4\x006\0A\0!B\x7F!\v )pB\0Y@  (Ak6\v ArE B\x7FQq@A\xF8\xD7A\xC4\x006\0B~!\f\v  \xAC"\x85 }!\v \bAj$\0 )xB\0 ( (,k\xAC}Q\r \x07E \fA\xF0\0GrE@ \x07 >\0\f\v \x07  \xAA\f\v \x07  \xAB8\0\f\v \x07  \xC49\0\f\v \x07 7\0 \x07 7\b\f\vA Aj \fA\xE3\0G"\x1B!\b\x7F AF@ \x07! \v@ \bAt/"E\r\v B\x007\xA8A\0!@@@ !\0@ \x7F (" (hG@  Aj6 -\0\0\f\v %\v"j-\0!E\r  :\0\x1B Aj A\x1BjA A\xA8j\x98"A~F\r\0 A\x7FF@A\0! \f\v \0@ \0 Atj (6\0 Aj!\v \vE  \bGr\r\0\v \0 \bAtAr"\bAt\x9D"\r\0\vA\0! \0! +A!\v\f\b\vA\0! \0 A\xA8j\x7F (\xA8A\0\vE\r\v \0! +\f\v \v@A\0! \b/"E\r@ !\0@ \x7F (" (hG@  Aj6 -\0\0\f\v %\v"j-\0!E@ \0! A\0\f\v \0 j :\0\0 Aj" \bG\r\0\v \0 \bAtAr"\b\x9D"\r\0\vA\0! + \0! A!\v\f\vA\0! \x07@@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0j-\0!@  \x07j \0:\0\0 Aj!\f \x07"\0! A\0\f\v\0\v\0\v@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v j-\0!\r\0\vA\0!\0A\0! A\0\v! + (! )pB\0Y@  Ak"6\v )x  (,k\xAC|"P   QrEr\r \v@ \x07 \x006\0\v \fA\xE3\0F\r\0 +@ + AtjA\x006\0\v E@A\0! \f\v  jA\0:\0\0\v ( (,k\xAC )x ||! \r \x07A\0Gj!\r\v Aj! -\0"\r\f\v\vA!\vA\0! A\0! +\v \rA\x7F \r\x1B!\r\v \vE\r ! +!\f\vA\x7F!\r\v A\xB0j$\0 A\x90j$\0 \r\vC\0@ \0E\r\0@@@@ Aj\0\v \0 <\0\0\v \0 =\0\v \0 >\0\v \0 7\0\v\v\xE4\x7F~#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\x07@ B0\x88B\xFF\xFF\x83"\b\xA7"A\x81\xFF\0kA\xFDM@ \x07B\x88\xA7!@ \0P B\xFF\xFF\xFF\x83"\x07B\x80\x80\x80\bT \x07B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \0 \x07B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\vA\0  A\xFF\xFF\xFFK"\x1B!A\x81\x81\x7FA\x80\x81\x7F \x1B j!\f\v \0 \x07\x84P \bB\xFF\xFFRrE@ \x07B\x88\xA7A\x80\x80\x80r!A\xFF!\f\v A\xFE\x80K@A\xFF!\f\vA\x80\xFF\0A\x81\xFF\0 \bP"\x1B" k"A\xF0\0J@A\0!A\0!\f\v \x07 \x07B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!\x07A\0!  G@ Aj \0 \x07A\x80 k6 ) )\x84B\0R!\v  \0 \x07 g )\b"\0B\x88\xA7!@ )\0 \xAD\x84"\x07P \0B\xFF\xFF\xFF\x83"\0B\x80\x80\x80\bT \0B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \x07 \0B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\v A\x80\x80\x80s  A\xFF\xFF\xFFK"\x1B!\v A j$\0 B \x88\xA7A\x80\x80\x80\x80xq Atr r\xBE\v\x89\x7F~@@\x7F@@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A+k\0\0\v A-F E\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A:k"AuKr\r \0)pB\0S\r \0 \0(Ak6\f\v A:k! !A\0\v! AvI\r\0@ A0kA +O\r\0A\0!@  A +lj\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v!A0k! A\xCC\x99\xB3\xE6\0H A0k"A Mq\r\0\v \xAC! A +O\r\0@ \xAD B +~|!\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A0k"A M B0}"B\xAE\x8F\x85\xD7\xC7\xC2\xEB\xA3Sq\r\0\v A +O\r\0@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\vA0kA +I\r\0\v\v \0)pB\0Y@ \0 \0(Ak6\vB\0 }  \x1B!\f\vB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F! \0)pB\0S\r\0 \0 \0(Ak6B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\v \v\x842\x7F\x07~|#\0A0k"\r$\0@@ AK\r\0 At"(\xDC\x81! (\xD0\x81!@\x7F (" (hG@  Aj6 -\0\0\f\v %\v"_\r\0\vA!\b@@ A+k\0\0\vA\x7FA A-F\x1B!\b (" (hG@  Aj6 -\0\0!\f\v %!\v@@ A_qA\xC9\0F@@ A\x07F\r\x7F (" (hG@  Aj6 -\0\0\f\v %\v! ,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v"A0F\r\0\vA!\vA!\vB\x80\x80\x80\x80\x80\x80\xC0\xFF?!@@ !@@ A0k"\x07A +I\r\0 A.G"\f A r"A\xE1\0kAKq\r \f\r\0 \v\rA!\v !\f\v A\xD7\0k \x07 A9J\x1B!@ B\x07W@  Atj! \f\v BX@ A0j ? A j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFD?+ Aj )0 )8 ) " )("+  ) )  < )\b! )\0!\f\v E +r\r\0 A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ A@k )P )X  <A! + )H! )@!\v B|!A!\v (" (hG\x7F  Aj6 -\0\0 %\v!\f\v\v~ E@@@ )pB\0Y@  ("Ak6 E\r  Ak6 \vE\r  Ak6\f\v \r\v B\0J\v A\xE0\0jD\0\0\0\0\0\0\0\0 \b\xB7\xA6T )\`! )h\f\v B\x07W@ !@ At! B|"B\bR\r\0\v\v@@@ A_qA\xD0\0F@  \xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r @ )pB\0Y\r\f\vB\0! B\0JB\0\f\vB\0! )pB\0S\r\v  (Ak6\vB\0!\v E@ A\xF0\0jD\0\0\0\0\0\0\0\0 \b\xB7\xA6T )p! )x\f\v   \v\x1BB\x86 |B }"A\0 k\xADU@A\xF8\xD7A\xC4\x006\0 A\xA0j \b? A\x90j )\xA0 )\xA8B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A\x80j )\x90 )\x98B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )\x80! )\x88\f\v A\xE2k\xAC W@ A\0N@@ A\xA0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF\xBF\x7F<  B\x80\x80\x80\x80\x80\x80\x80\xFF?\xB2! A\x90j   )\xA0  A\0N"\x1B )\xA8  \x1B<  At"r! B}! )\x98! )\x90! A\0N\r\0\v\v~ A k\xAD|"\xA7"A\0 A\0J\x1B   \xADS\x1B"A\xF1\0O@ A\x80j \b? )\x88! )\x80!B\0\f\v A\xE0jA\x90 k\xC8T A\xD0j \b? )\xD0! A\xF0j )\xE0 )\xE8 )\xD8"\xB1 )\xF8! )\xF0\v! A\xC0j AqE  B\0B\0dA\0G A Iqq"rr A\xB0j   )\xC0 )\xC8+ A\x90j )\xB0 )\xB8  < A\xA0j  B\0  \x1BB\0  \x1B+ A\x80j )\xA0 )\xA8 )\x90 )\x98< A\xF0j )\x80 )\x88  \xBC )\xF0" )\xF8"B\0B\0dE@A\xF8\xD7A\xC4\x006\0\v A\xE0j   \xA7\xB0 )\xE0! )\xE8\f\vA\xF8\xD7A\xC4\x006\0 A\xD0j \b? A\xC0j )\xD0 )\xD8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xB0j )\xC0 )\xC8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )\xB0! )\xB8\v! \r 7 \r 7 A\xB0j$\0 \r)! \r)!\f\v )pB\0S\r\0  (Ak6\v !\x07 ! \b!\f !\bA\0!#\0A\x90\xC6\0k"$\0A\0 k" k!@\x7F@@ A0G@ A.G\r \x07(" \x07(hF\r \x07 Aj6 -\0\0\f\v \x07(" \x07(hG@ \x07 Aj6 -\0\0! \x07%!\vA!\f\v\v \x07%\v"A0F@@ B}!\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A0F\r\0\vA!\vA!\v\v A\x006\x90~@@@@ A.F" A0k"A Mr@@@ Aq@ \vE@ !A!\v\f\v E!\f\v B|! A\xFCL@  \xA7 A0F\x1B! A\x90j Atj" +\x7F  (\0A +ljA0k \v6\0A!A\0 +Aj" A F"\x1B! +  j! \f\v A0F\r\0  (\x80FAr6\x80FA\xDC\x8F!\v\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A.F" A0k"A +Ir\r\0\v\v   \v\x1B! E A_qA\xC5\0GrE@@ \x07 \b\xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r\0 \bE\rB\0! \x07)pB\0S\r\0 \x07 \x07(Ak6\v  |!\f\v E! A\0H\r\v \x07)pB\0S\r\0 \x07 \x07(Ak6\v E\rA\xF8\xD7A6\0\v \x07B\0JB\0!B\0\f\v (\x90"E@ D\0\0\0\0\0\0\0\0 \f\xB7\xA6T )\b! )\0\f\v  R B Ur AMA\0  v\x1BrE@ A0j \f? A j r Aj )0 )8 ) )(+ )! )\f\v Av\xAD S@A\xF8\xD7A\xC4\x006\0 A\xE0\0j \f? A\xD0\0j )\` )hB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A@k )P )XB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )H! )@\f\v A\xE2k\xAC U@A\xF8\xD7A\xC4\x006\0 A\x90j \f? A\x80j )\x90 )\x98B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xF0\0j )\x80 )\x88B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )x! )p\f\v +@ +A\bL@ A\x90j Atj"(\0!@ A +l! +Aj" +A G\r\0\v  6\0\v Aj! \v@ A N BUr \xA7" + Hr\r\0 B Q@ A\xC0j \f? A\xB0j (\x90r A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v B\bW@ A\x90j \f? A\x80j (\x90r A\xF0j )\x90 )\x98 )\x80 )\x88+ A\xE0jA\b +kAt(\xB0\x81? A\xD0j )\xF0 )\xF8 )\xE0 )\xE8\xAF )\xD8! )\xD0\f\v  +A}ljA\x1Bj"ALA\0 (\x90" v\x1B\r\0 A\xE0j \f? A\xD0j r A\xC0j )\xE0 )\xE8 )\xD0 )\xD8+ A\xB0j +AtA\x88\x81j(\0? A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v@ "Ak! A\x90j Atj"Ak(\0E\r\0\vA\0!@ +A o"E@A\0!\f\v A j  B\0S\x1B!@ E@A\0!A\0!\f\vA\x80\x94\xEB\xDCA\0 kAtA\xD0\x81j(\0"\vm!\x07A\0!A\0!A\0!@ A\x90j Atj"\b  \b(\0" \vn"\bj"6\0 AjA\xFFq  E  Fq"\x1B! +A k + \x1B! + \x07 \b \vlkl! Aj" G\r\0\v E\r\0  6\0 Aj!\v + kA j! +\v@ A\x90j Atj! +A$H!\x07@@ \x07E@ +A$G\r (\0A\xD1\xE9\xF9O\r\v A\xFFj! A\0!@ !\b \xAD A\x90j A\xFFq"\vAtj"5\0B\x86|"B\x81\x94\xEB\xDCT\x7FA\0  B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}! \xA7\v!  >\0 \b \b \b \v B\0R\x1B \v \bAkA\xFFq"G\x1B  \vF\x1B! \vAk!  \vG\r\0\v Ak! \b! E\r\0\v AkA\xFFq" F@ A\x90j"\b A\xFEjA\xFFqAtj" (\0 At \bj(\0r6\0 !\v +A j! + A\x90j Atj 6\0\f\v\v@@ AjA\xFFq!\b A\x90j AkA\xFFqAtj!@A A +A-J\x1B!@@ !A\0!@@@  jA\xFFq" F\r\0 A\x90j Atj(\0" At(\xA0\x81"I\r\0  I\r Aj"AG\r\v\v +A$G\r\0B\0!A\0!B\0!@   jA\xFFq"F@ AjA\xFFq"At jA\x006\x8C\v A\x80j A\x90j Atj(\0r A\xF0j  B\0B\x80\x80\x80\x80\xE5\x9A\xB7\x8E\xC0\0+ A\xE0j )\xF0 )\xF8 )\x80 )\x88< )\xE8! )\xE0! Aj"AG\r\0\v A\xD0j \f? A\xC0j   )\xD0 )\xD8+B\0! )\xC8! )\xC0! A\xF1\0j" k" A\0 A\0J\x1B  H"\b\x1B"\x07A\xF0\0M\r\f\v  j! !  F\r\0\vA\x80\x94\xEB\xDC v!\vA\x7F tA\x7Fs!A\0! !@ A\x90j"\x07 Atj"  (\0" vj"6\0 AjA\xFFq  E  Fq"\x1B! +A k + \x1B! + q \vl! AjA\xFFq" G\r\0\v E\r  \bG@ At \x07j 6\0 \b!\f\v  (\0Ar6\0\f\v\v\v A\x90jA\xE1 \x07k\xC8T A\xB0j )\x90 )\x98 \xB1 )\xB8! )\xB0! A\x80jA\xF1\0 \x07k\xC8T A\xA0j   )\x80 )\x88\xAE A\xF0j   )\xA0" )\xA8"\xBC A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\v@ AjA\xFFq" F\r\0@ A\x90j Atj(\0"A\xFF\xC9\xB5\xEEM@ E AjA\xFFq Fq\r A\xF0j \f\xB7D\0\0\0\0\0\0\xD0?\xA2T A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\f\v A\x80\xCA\xB5\xEEG@ A\xD0j \f\xB7D\0\0\0\0\0\0\xE8?\xA2T A\xC0j   )\xD0 )\xD8< )\xC8! )\xC0!\f\v \f\xB7!\x1B  AjA\xFFqF@ A\x90j \x1BD\0\0\0\0\0\0\xE0?\xA2T A\x80j   )\x90 )\x98< )\x88! )\x80!\f\v A\xB0j \x1BD\0\0\0\0\0\0\xE8?\xA2T A\xA0j   )\xB0 )\xB8< )\xA8! )\xA0!\v \x07A\xEF\0K\r\0 A\xD0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?\xAE )\xD0 )\xD8B\0B\0d\r\0 A\xC0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?< )\xC8! )\xC0!\v A\xB0j    < A\xA0j )\xB0 )\xB8  \xBC )\xA8! )\xA0!@ Ak A\xFF\xFF\xFF\xFF\x07qN\r\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x837\x98  7\x90 A\x80j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ )\x90 )\x98B\x80\x80\x80\x80\x80\x80\x80\xB8\xC0\0\xB2! )\x88  A\0N"\x1B! )\x80  \x1B! \b \x07 G A\0Hrq  B\0B\0dA\0GqE   j"A\xEE\0jNq\r\0A\xF8\xD7A\xC4\x006\0\v A\xF0j   \xB0 )\xF8! )\xF0\v! \r 7( \r 7 A\x90\xC6\0j$\0 \r)(! \r) !\f\vB\0!\f\vB\0!\v \0 7\0 \0 7\b \rA0j$\0\v\xC0\x7F~#\0A\x80k"$\0@@@  B\0B\0dE\r\0\x7F B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +\x7F B0\x88\xA7A\xFF\xFFq"\x07A\xFF\xFFG@A \x07\rAA  +\x84P\x1B\f\v  +\x84P\v\vE\r\0 B0\x88\xA7"\bA\xFF\xFFq"A\xFF\xFFG\r\v Aj    +  )" )"  \xAF )\b! )\0!\f\v  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" +  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" dA\0L@  +  d@ !\f\v A\xF0\0j  B\0B\0+ )x! )p!\f\v B0\x88\xA7A\xFF\xFFq!\x07 ~  A\xE0\0j  +B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )h" +B0\x88\xA7A\xF8\0k! )\`\v! \x07E@ A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )X" B0\x88\xA7A\xF8\0k!\x07 )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!\v +B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84! +  \x07J@@~ + \v}  V\xAD}" B\0Y@  }"\x84P@ A j  B\0B\0+ )(! ) !\f\v B\x86 B?\x88\x84\f\v +B\x86 B?\x88\x84\v! + B\x86! Ak" \x07J\r\0\v \x07!\v@ + \v}  V\xAD}" B\0S@ +! \f\v  }"\x84B\0R\r\0 A0j  B\0B\0+ )8! )0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@@ B?\x88 Ak! B\x86! B\x86\x84" B\x80\x80\x80\x80\x80\x80\xC0\0T\r\0\v\v \bA\x80\x80q!\x07 A\0L@ A@k  B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 A\xF8\0j \x07r\xADB0\x86\x84B\0B\x80\x80\x80\x80\x80\x80\xC0\xC3?+ )H! )@!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83  \x07r\xADB0\x86\x84!\v \0 7\0 \0 7\b A\x80j$\0\v\x87\x7F~#\0A\xD0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\f B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq"\bA\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f !\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\f\f\v \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!\f\v  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0 \f  \x84P\x1B!\fB\0!\f\v  \x84P@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xC0j  +  + +P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )\xC8! + )\xC0!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A\xB0j  \v  \v \vP" \x1ByB\xC0\0B\0 \x1B|\xA7" Ak6  jAk! )\xB8!\v )\xB0!\v A\xA0j \vB\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86 B1\x88\x84"B\0B\x80\x80\x80\x80\xB0\xE6\xBC\x82\xF5\0 }"B\02 A\x90jB\0 )\xA8}B\0 B\02 A\x80j )\x98B\x86 )\x90B?\x88\x84"B\0 B\02 A\xF0j B\0B\0 )\x88}B\02 A\xE0j )\xF8B\x86 )\xF0B?\x88\x84"B\0 B\02 A\xD0j B\0B\0 )\xE8}B\02 A\xC0j )\xD8B\x86 )\xD0B?\x88\x84"B\0 B\02 A\xB0j B\0B\0 )\xC8}B\02 A\xA0j B\0 )\xB8B\x86 )\xB0B?\x88\x84B}"B\02 A\x90j B\x86B\0 B\02 A\xF0\0j B\0B\0 )\xA8 )\xA0" )\x98|" T\xAD| BV\xAD|}B\02 A\x80jB }B\0 B\02  \b \x07kj"\bA\xFF\xFF\0j!~ )p"B\x86"\r )\x88"B\x86 )\x80B?\x88\x84|"B\xE7\xEC\0}"B \x88" +B\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86"B \x88"~" B\x86"B \x88"\v  V\xAD \r V\xAD )xB\x86 B?\x88\x84 B?\x88|||B}"B \x88"~|"\r T\xAD \r \r B\xFF\xFF\xFF\xFF\x83" B?\x88" +B\x86\x84B\xFF\xFF\xFF\xFF\x83" +~|"\rV\xAD|  ~|  ~" + ~|" T\xADB \x86 B \x88\x84| \r B \x86|" \rT\xAD|   B\xFF\xFF\xFF\xFF\x83" +~"\r  \v~|" \rT\xAD    B\xFE\xFF\xFF\xFF\x83"\r~|"V\xAD||"V\xAD|   ~" \r ~|"  +~|" + \v ~|"B \x88 + V\xAD  T\xAD  +V\xAD||B \x86\x84|" T\xAD|     \r~" + \v ~|"B \x88  +T\xADB \x86\x84|" + T\xAD + + B \x86|" +V\xAD||"V\xAD|   + B \x86" \r ~| T\xADB\x7F\x85"V  +Rq\xAD|"V\xAD|"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0X@  \x84! A\xD0\0j  B\x80\x80\x80\x80\x80\x80\xC0\0T"\x07\xAD"\v\x86" +  \v\x86 B\x88 \x07A?s\xAD\x88\x84"  2 \bA\xFE\xFF\0j  \x07\x1BAk! B1\x86 )X} )P"B\0R\xAD}!\vB\0 }\f\v A\xE0\0j B?\x86 B\x88\x84" + B\x88"  2 B0\x86 )h} )\`"B\0R\xAD}!\v !B\0 }\v! A\xFF\xFFN@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v~ A\0J@ \vB\x86 B?\x88\x84! B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84!\v B\x86\f\v A\x8F\x7FL@B\0!\f\v A@k + A kg A0j   A\xF0\0j6 A j   )@" + )H"\v2 )8 )(B\x86 ) "B?\x88\x84} )0" B\x86"T\xAD}!  }\v! Aj  BB\02   BB\02 \v +  +B\x83" |"T   T\xAD|" V  Q\x1B\xAD|" +T\xAD|"   B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )V  )"V  Q\x1Bq\xAD|"V\xAD|"  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )\0V  )\b"V  Q\x1Bq\xAD|" T\xAD| \f\x84!\f\v \0 7\0 \0 \f7\b A\xD0j$\0\v\xBF\x7F#\0A\xD0\0k"$\0@ A\x80\x80N@ A j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+ )(! ) ! A\xFF\xFFI@ A\xFF\xFF\0k!\f\v Aj  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+A\xFD\xFF  A\xFD\xFFO\x1BA\xFE\xFFk! )! )!\f\v A\x81\x80\x7FJ\r\0 A@k  B\0B\x80\x80\x80\x80\x80\x80\x809+ )H! )@! A\xF4\x80~K@ A\x8D\xFF\0j!\f\v A0j  B\0B\x80\x80\x80\x80\x80\x80\x809+A\xE8\x81}  A\xE8\x81}M\x1BA\x9A\xFEj! )8! )0!\v   B\0 A\xFF\xFF\0j\xADB0\x86+ \0 )\b7\b \0 )\x007\0 A\xD0\0j$\0\v<\0 \0 7\0 \0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x83B0\x88\xA7 B0\x88\xA7A\x80\x80qr\xADB0\x86\x847\b\v\xC0\x7F~A\x7F!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Rq\r\0 \0  \x84\x84P@A\0\v  \x83B\0Y@  R  Sq\r \0  \x85\x84B\0R\v \0B\0R  U  Q\x1B\r\0 \0  \x85\x84B\0R!\v \v8\0 \0A\xD0k \0 \0A\x93\xF1\xFF\xFF\x07J\x1B"\0Aq@A\0\v \0A\xECj"\0A\xE4\0o@A\v \0A\x90oE\v\x85\x7F~#\0A\x80k"\b$\0 @\x7F@@\x7F@@@ -\0\0"A%G@ \r +\f\x07\vA\0!A! @ -\0"\x07A-k\0\v \x07A\xDF\0F\r \x07\r\v \0 +j :\0\0 +Aj\f\v \x07! -\0!\x07A! \vA\0!@\x7F  j \x07"A+Fj" ,\0\0A0kA M@ \bA\fjA +B\xFF\xFF\xFF\xFF\xBE\xA7! \b(\f\f\v \b 6\fA\0! \v"\x07-\0\0"A\xC3\0k"\vAKA \vtA\x99\x80\x80qEr\r\0 "\r\0 \x07 G!\v A\xCF\0F A\xC5\0Fr\x7F \x07-\0! \x07Aj \x07\v! \bAj!\x07 ! A\0!#\0A\xD0\0k"\v$\0A\x8A !\rA0!A\xA8\x80\b!\f@ \b\x7F@@@@@@@\x7F@@@@@@@@@~@@@@@@@@@@@@@@@@@@@@@@@@@@ \xC0"A%kV!---------------------------'-\x07\b +---\r---- ------\0&-\b-\v--\f--%-\x1B-\v ("AM\r"\f*\v ("AK\r) A\x87\x80\bj\f"\v ("A\vK\r( A\x8E\x80\bj\f!\v ("A\vK\r' A\x9A\x80\bj\f \v 4B\xEC|B\xE4\0\x7F!\f#\vA\xDF\0!\v 4\f!\f!\vA\xD2!\r\f\v 4"B\xEC|!@ ("AL@  B\xEB| \xBDAF\x1B!\f\v A\xE9I\r\0 B\xED|  \xBDAF\x1B!\v A\xE7\0F\r\f \v 4\b!\f\vA! (\b"E@B\f!\f \v \xAC"B\f}  A\fJ\x1B!\f\v (Aj\xAC!A!\f\v (Aj\xAC!\f\x1B\v 4!\f\v \bA6|A\xD4!\f\vA\xA7\x80\bA\xA6\x80\b (\bA\vJ\x1B\f\vA\xF7!\r\f\vA\0!\fA\0!#\0Ak"$\0 4!~ ("\rA\fO@ \r \rA\fm"A\flk"A\fj  A\0H\x1B!\r  Auj\xAC |!\v A\fj! B}B\x88X@ \xA7"\fA\xC4\0kAu!@ \x7F \fAqE@ Ak! E\rA\f\v E\rA\0\v6\0\v \fA\x80\xE7\x84l A\x80\xA3ljA\x80\xD6\xAF\xE3\x07j\xAC\f\v B\xE4\0}" B\x90\x7F"B\x90~}"B?\x87\xA7 \xA7j!@@@ \xA7"A\x90j  B\0S\x1B"\x7F\x7F A\xC8N@ A\xACO@A!\f A\xACk\f\vA!\f A\xC8k\f\v A\xE4\0k  A\xE3\0J"\f\x1B\v"\rA\0A\v! \r\f\v Av! AqE! E\r\v  6\0\v B\x80\xE7\x84~  \fAl A\xE1\0ljj k\xACB\x80\xA3~|B\x80\xAA\xBA\xC3|\v! \rAtA\x80\xFE\0j(\0"A\x80\xA3j  (\f\x1B  \rAJ\x1B! (\f! 4\b! 4! 4\0 Aj$\0  \xAC| Ak\xACB\x80\xA3~| B\x90~| B<~|| 4$}\f\b\v 4\0!\f\v \bA6|A\xD6!\f\vA\xE4!\r\f\v ("A\x07 \x1B\xAC\f\v ( (kA\x07jA\x07n\xAD!\f\v ( (AjA\x07pkA\x07jA\x07n\xAD!\f\v \xBD\xAD!\f\v 4\v!A!\f\vA\xA9\x80\b!\f\f +\vA\xAA\x80\b!\f\f \v 4B\xEC|B\xE4\0\x81" B?\x87"\x85 }!\f +\v 4"B\xEC|! B\xA4?S\r + \v 70 \b \x07A\x9B \vA0je6| \x07!\f\v ( A\0H@ \bA\x006|A\xD7!\f\v \v ($"A\x90m"A\xE4\0l  A\x90lk\xC1A<m\xC1j6@ \b \x07A\xA1 \vA@ke6| \x07!\f\r\v ( A\0H@ \bA\x006|A\xD7!\f\r\v ((A\xB4\xDC(\0E@A\xAC\xDCA\xB0\xDCA\xC0\xDCA\xE0\xDCA\xB8\xDCA\xE0\xDC6\0A\xB4\xDCA\xC0\xDC6\0\v\f\v\v \bA6|A\xEA!\f\v\v B\xE4\0\x81!\f\v A\x80\x80\br\v \xB5\f\x07\vA\xAB\x80\b!\f\v \f \xB5!\r\v \b \x07A\xE4\0 \r  \xB4"6| \x07A\0 \x1B!\f\vA!\f\vA!\v@  \x1B"A\xDF\0G@ A-G\r \v 7 \b \x07A\x9C \vAje6| \x07!\f\v \v 7( \v 6 \b \x07A\x95 \vA je6| \x07!\f\v \v 7\b \v 6\0 \b \x07A\x8E \ve6| \x07!\f\vA\x9C\v"y6|\v \vA\xD0\0j$\0 E\r@ E@ \b(|! \f\v\x7F@@ -\0\0"A+k\0\0\v \b(|\f\v -\0! Aj! \b(|Ak\v! @ A\xFFqA0G\r\0@ ,\0"\x07A0kA K\r Aj! Ak! \x07A0F\r\0\v\v \b 6|A\0!@ "\x07Aj!  \x07j,\0\0A0kA +I\r\0\v  I\x1B!@ \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 6\f  6\b\f\v \0("\x7F \0Aj \0("E\r \0Aj\v!@ !\x07 "Aj! ("\r\0 Aj! ("\r\0\v \x07A\x006\0\f\v ("AqAG\rA\x84\xD8 6\0  A~q6 \0 Ar6  6\0\v  6\f  6\b\f\vA\0!\v E\r\0@ \0("At"(\xAC\xDA \0F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \0 (F@  6\f\v  6\v E\r\v  6 \0("@  6  6\v \0("E\r\0  6  6\v@@@@ ("AqE@A\x94\xD8(\0 F@A\x94\xD8 \x006\0A\x88\xD8A\x88\xD8(\0 j"6\0 \0 Ar6 \0A\x90\xD8(\0G\rA\x84\xD8A\x006\0A\x90\xD8A\x006\0\vA\x90\xD8(\0"\b F@A\x90\xD8 \x006\0A\x84\xD8A\x84\xD8(\0 j"6\0 \0 Ar6 \0 j 6\0\v Axq j! (\f! A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!  G@ (\b" 6\f  6\b\f\v ("\x7F Aj ("E\r Aj\v!@ !\x07 "Aj! ("\r\0 Aj! ("\r\0\v \x07A\x006\0\f\v  A~q6 \0 Ar6 \0 j 6\0\f\vA\0!\v E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("@  6  6\v ("E\r\0  6  6\v \0 Ar6 \0 j 6\0 \0 \bG\r\0A\x84\xD8 6\0\v A\xFFM@ A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \f\v (\b\v!  \x006\b  \x006\f \0 6\f \0 6\b\vA! A\xFF\xFF\xFF\x07M@ A& A\bvg"kvAq AtrA>s!\v \0 6 \0B\x007 AtA\xAC\xDAj!@@A\x80\xD8(\0"A t"\x07qE@A\x80\xD8  \x07r6\0  \x006\0 \0 6\f\v A AvkA\0 AG\x1Bt! (\0!@ "(Axq F\r Av! At!  Aqj"\x07("\r\0\v \x07 \x006 \0 6\v \0 \x006\f \0 \x006\b\v (\b" \x006\f  \x006\b \0A\x006 \0 6\f \0 6\b\v\v\0 \0E@A\0\v \0 \xC5\v\0 \0  A4A5\xD0\v-\0 \0A\xCC\0j1 \0A@k1 \0A4j1 \0A(j1 \0Aj1 \0Aj1\v\xBC\0@@@@@@@@@@@ A k\0\b +\b  + + +\b \x07\v  (\0"Aj6\0 \0 (\x006\0\v  (\0"Aj6\0 \0 2\x007\0\v  (\0"Aj6\0 \0 3\x007\0\v  (\0"Aj6\0 \0 0\0\x007\0\v  (\0"Aj6\0 \0 1\0\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 +\x009\0\v \0  \0\v\v  (\0"Aj6\0 \0 4\x007\0\v  (\0"Aj6\0 \0 5\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 )\x007\0\vo\x7F \0(\0",\0\0A0k"A K@A\0\v@A\x7F! A\xCC\x99\xB3\xE6\0M@A\x7F  A +l"j  A\xFF\xFF\xFF\xFF\x07sK\x1B!\v \0 Aj"6\0 ,\0 ! !A0k"A +I\r\0\v \v\xF5\x7F~#\0A@j"\b$\0 \b 6< \bA)j! \bA'j! \bA(j!@@@@@A\0!\x07@ !\r \x07 A\xFF\xFF\xFF\xFF\x07sJ\r \x07 j!@@@@ "\x07-\0\0"\v@@@@ \vA\xFFq"E@ \x07!\f\v A%G\r \x07!\v@ \v-\0A%G@ \v!\f\v \x07Aj!\x07 \v-\0 \vAj"!\vA%F\r\0\v\v \x07 \rk"\x07 A\xFF\xFF\xFF\xFF\x07s"J\r \0@ \0 \r \x073\v \x07\r\x07 \b 6< Aj!\x07A\x7F!@ ,\0A0k" +A K\r\0 -\0A$G\r\0 Aj!\x07A! +!\v \b \x076<A\0!\f@ \x07,\0\0"\vA k"AK@ \x07! +\f\v \x07! +A t"A\x89\xD1qE\r\0@ \b \x07Aj" +6<  \fr!\f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-\0\x90u \rr:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE Pr\r \x07AvA\x93 j!A!\f\v ! \b)0""\x1BPE@@ Ak" \x1B\xA7A\x07qA0r:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE\r  k"  H\x1B! \f\v \b)0"B\0S@ \bB\0 }"70A!A\x93 \f\v \fA\x80q@A!A\x94 \f\vA\x95 A\x93 \fAq"\x1B\v!  x!\r\v  A\0Hq\r \fA\xFF\xFF{q \f \x1B!\f B\0R rE@ !\rA\0! \f\v P  \rkj"  H\x1B! \f\r\v \b-\x000!\x07\f\v\v \b(0"A\xC4 \x1B"\rA\0A\xFF\xFF\xFF\xFF\x07 A\xFF\xFF\xFF\xFF\x07O\x1B"\x07\xCA" \rk \x07 \x1B" \rj! + A\0N@ \v!\f ! \f\f\v \v!\f ! +-\0\0\r\f\v\v \b)0"\x1BPE\rA\0!\x07\f \v @ \b(0\f\vA\0!\x07 \0A A\0 \f7\f\v \bA\x006\f \b \x1B>\b \b \bA\bj"\x0760A\x7F! \x07\v!\vA\0!\x07@@ \v(\0"\rE\r\0 \bAj \r\xCA"\rA\0H\r \r \x07kK\r\0 \vAj!\v \x07 \rj"\x07 I\r\v\vA=! + \x07A\0H\r\f \0A  \x07 \f7 \x07E@A\0!\x07\f\vA\0! + \b(0!\v@ \v(\0"\rE\r \bAj" \r\xCA"\r +j" + \x07K\r \0 \r3 \vAj!\v \x07 +K\r\0\v\v \0A  \x07 \fA\x80\xC0\0s7  \x07 \x07 H\x1B!\x07\f\b\v  A\0Hq\r A=! + \0 \b+0  \f \x07 \0"\x07A\0N\r\x07\f +\v \x07-\0!\v \x07Aj!\x07\f\0\v\0\v \0\r E\rA!\x07@  \x07Atj(\0"\0@  \x07Atj \0  \xCDA! \x07Aj"\x07A +G\r\f\v\v\v \x07A +O@A!\f +\v@  \x07Atj(\0\rA! \x07Aj"\x07A +G\r\0\v\f \vA! +\f\v \b \x07:\0'A!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\bj!  (6\0 A\bj"\0 \xFC6 \0A\xEC\xCE6\0 \xD2 Aj$\0 \0(! \0A\x006 \0\x84\f\v A\x006\f A\xEC\xCE6\b A\bj\x84A!\v Aj$\0 Aj$\0 \v0\x7F#\0Ak"$\0 \0(\0!\0  :\0   Aj \0\x07\0 Aj$\0\v.\x7F#\0Ak"$\0 \0(\0!\0  :\0  Aj \0\0 Aj$\0\v0\x7F#\0Ak"$\0 \0(\0!\0  8\f   A\fj \0\0 Aj$\0\v\x8D\x7F|#\0Ak"$\0 A\bj   \0(\0\x07\0  )\b7\0#\0Ak"$\0@ -\0AF@#\0Ak"$\0A\x90\xCE-\0\0AqE@AA\xD4&A!\0A\x90\xCEA:\0\0A\x8C\xCE \x006\0\v  *\x008\b A\x006A\x8C\xCE(\0A\0A\0 Aj A\bj!  (6\0 A\bj"\0 \xFC6 \0A\xEC\xCE6\0 \xD2 Aj$\0 \0(! \0A\x006 \0\x84\f\v A\x006\f A\xEC\xCE6\b A\bj\x84A!\v Aj$\0 Aj$\0 \v0\x7F#\0Ak"$\0 \0(\0!\0  8\f   A\fj \0\x07\0 Aj$\0\v.\x7F#\0Ak"$\0 \0(\0!\0  8\f  A\fj \0\0 Aj$\0\v\x7FA9"\0A\x006\0 \0\v\xA9\x7F   \0(\0j"\0G@@ (" (\0"kAu" \0(\b \0(\0"kAuM@  \0(" k"AuK@  G@ @   \xFC +\0\0\v \0(!\v   j"k"E  FrE@   \xFC +\0\0\v \0  j6\f\v  k"E  FrE@   \xFC +\0\0\v \0  j6\f\v \0(\0"@ \0 6 \0(\b ! \0A\x006\b \0B\x007\0\v \0 \0 \x86\xA8 \0(!  k"E  FrE@   \xFC +\0\0\v \0  j6\v\v\v\0  \0(\0j!\0A\f9 \0b\v\0  \0(\0j :\0\0\v\r\0  \0(\0j-\0\0\v\x1B\0 \0 (\b M@    \xA7\v\v8\0 \0 (\b M@    \xA7\v \0(\b"\0      \0(\0(\v\0\v\x92\x7F \0 (\b M@    \xA7\v -\x005 \0(\f! A\0:\x005 -\x004 A\0:\x004 \0Aj"     \xA6 -\x004" +r!\b -\x005"\vr!\x07@ AI\r\0 Atj! \0Aj!@ -\x006\r@ +Aq@ (AF\r \0-\0\bAq\r\f\v \vAqE\r\0 \0-\0\bAqE\r\v A\0;4      \xA6 -\x005"\v \x07rAq!\x07 -\x004" + \brAq!\b A\bj" I\r\0\v\v  \x07Aq:\x005  \bAq:\x004\v\xA4\0@ \0 (\b M@  (G\r (AF\r  6\v \0 (\0 ME\r\0@ ( G@  (G\r\v AG\r A6 \v  6  6  ((Aj6(@ ($AG\r\0 (AG\r\0 A:\x006\v A6,\v\v\x88\0@ \0 (\b M@  (G\r (AF\r  6\v \0 (\0 M@@ ( G@  (G\r\v AG\r A6 \v  6 @ (,AF\r\0 A\0;4 \0(\b"\0   A  \0(\0(\v\0 -\x005AF@ A6, -\x004E\r\f\v A6,\v  6  ((Aj6( ($AG\r (AG\r A:\x006\v \0(\b"\0     \0(\0( +\0\v\v\xC1\x7F@ \0 (\b M@  (G\r (AF\r  6\v@ \0 (\0 M@@ ( G@  (G\r\v AG\r A6 \v  6 (,AF\r \0Aj" \0(\fAtj!\x07A\0!@@@ \x7F@  \x07O\r\0 A\0;4    A \xA6 -\x006\r\0 -\x005AG\r -\x004AF@ (AF\rA!A! \0-\0\bAqE\r\f\vA! \0-\0\bAq\rA\f\vAA \x1B\v6, \r\f\v A6,\f\v A\bj!\f\0\v\0\v \0(\f! \0Aj"    \x88 AI\r  Atj! \0Aj!@ \0(\b"\0AqE@ ($AG\r\v@ -\x006\r     \x88 A\bj" I\r\0\v\f\v \0AqE@@ -\x006\r ($AF\r     \x88 A\bj" I\r\0\f\v\0\v@ -\x006\r ($AF@ (AF\r\v     \x88 A\bj" I\r\0\v\f\v  6  ((Aj6( ($AG\r\0 (AG\r\0 A:\x006\v\v\xCB\x7F#\0A@j"$\0@@@ (A\xA2\xC7F@ A\x006\0\f\v@ \0  \0-\0\bAq\x7FA E\r A\xF8\xC4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80\xE2\v +\0 \0A\xA4\x91j\v +\0 \0A\x91\x80\v\x90\x7F \0\x7F \0(" \0(\bI@  -\0\0:\0\0 Aj\f\v#\0A k"$\0 A\fj \0 \0( \0(\0kAj\x83 \0( \0(\0k \0\x8C"(\b -\0\0:\0\0  (\bAj6\b \0 \xA9 \0( \x87 A j$\0\v6\v +\0 \0A\x90\x91j\v +\0 \0A\x88\x80\v\f\0 \0 Aj\xA3\v\f\0 \0 A\fj\xA3\v\x07\0 \0(\f\v\x07\0 \0,\0 \v\x07\0 \0(\b\v\x07\0 \0,\0\b\v \0 \0\xE5!\v\0A\xB4*\v \0 \0\xE6!\v\0 \0(\0 Atj *\x008\0A\v\0 \0(\b"\0E@A\v \0\xED\v\x87\x7F@@  F  \bMr\r\0A! \0(\b!#\0Ak"\x07$\0 \x07 H6\fA\0   k A\xC0\xDD \x1B\x98! \x07A\fjI \x07Aj$\0@@ Aj\0\v !\v \bAj!\b  j!  j!\f\v\v \vA\x7F \0(\b!#\0Ak"$\0  H6\f A\fjI Aj$\0 \0(\b"\0E@A\v \0\xEDAF\v\x89\x7F#\0Ak"$\0  6\0\x7FA A\fj"A\0 \0(\b\xAF"\0AjAI\r\0A \0Ak"  (\0kK\r\0\x7F \x7F -\0\0!\0  (\0"Aj6\0  \0:\0\0 Ak! Aj!\fA\0\v\v\v Aj$\0\v\xBD\f\x7F#\0Ak"$\0 !\b@@  \bF@ !\b\f\v \b-\0\0E\r\0 \bAj!\b\f\v\v \x07 6\0  6\0@@\x7F@  F  Fr\r\0  )\x007\b \0(\b! #\0Ak"$\0  H6\f \b k!A\0! +#\0A\x90\bk"\f$\0 \f (\0" 6\f  \fAj \x1B!@@@ E  kAuA\x80 \x1B"\rErE@@ A\x83K Av"\v \rOrE@ !\v\f\v  \fA\fj \v \r \v \rI\x1B \xA4! \f(\f!\v A\x7FF@A\0!\rA\x7F! +\f\v \r A\0  \fAjG\x1B"k!\r  Atj! j \vkA\0 \v\x1B! + j! + \vE\r \v! \r\r\0\f\v\0\v !\v\v \vE\r\v \rE Er\r\0 +! @@@  \v  \x98" +AjAM@@@ +Aj\0\v \fA\x006\f\f\v A\x006\0\f\v \f \f(\f +j"\v6\f Aj! \rAk"\r\r\v ! +\f\v Aj!  +k! ! + \r\0\v\v @  \f(\f6\0\v \fA\x90\bj$\0 A\fjI Aj$\0@@@@ +A\x7FF@@@ \x07 6\0  (\0F\r\0A!@@@   \b k A\bj \0(\b\xEE"Aj\b\0\v  6\0\f\v !\v  j! \x07(\0Aj!\f\v\v  6\0\f\v \x07 \x07(\0 +Atj"6\0  F\r (\0!  \bF\r  A  \0(\b\xEEE\r\vA\f\v \x07 \x07(\0Aj"6\0  (\0Aj"6\0 !\b@  \bF\r \b-\0\0E\r \bAj!\b\f\0\v\0\v  6\0A\f\v (\0!\v  G\v Aj$\0\v !\b\f\0\v\0\v\x9F\v\x7F#\0Ak"$\0 !\b@@  \bF@ !\b\f\v \b(\0E\r\0 \bAj!\b\f\v\v \x07 6\0  6\0@@@@  F  Fr\x7F   )\x007\bA! \0(\b! #\0Ak"$\0  H6\f !  k! +A\0!\f#\0Ak"$\0@ (\0"\vE \b kAu"Er\r\0 +A\0 \x1B! +@ A\fj +AI\x1B \v(\0\xC5"\rA\x7FF@A\x7F!\f\f\v \x7F +AM@ + \rI\r A\fj \rY\v + \rk! + \rjA\0\v! \v(\0E@A\0!\v\f\v \f \rj!\f \vAj!\v Ak"\r\0\v\v @  \v6\0\v Aj$\0 A\fjI Aj$\0@@@@ \fAj\0\b\v \x07 6\0@  (\0F\r  (\0 \0(\b\xAF"A\x7FF\r \x07 \x07(\0 j"6\0 Aj!\f\0\v\0\v \x07 \x07(\0 \fj"6\0  F\r  \bF@ (\0! !\b\f\v Aj"A\0 \0(\b\xAF"\bA\x7FF\r  \x07(\0k \bI\r@ \b@ -\0\0! \x07 \x07(\0" Aj6\0 :\0\0 \bAk!\b Aj!\f\v\v  (\0Aj"6\0 !\b@  \bF@ !\b\f\v \b(\0E\r \bAj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0j"\b \xF8  \0 (\f (\b  \\ ! \b  \x07    (\xEC# A\xF0j$\0\v0\0\v\xE4\b\x7F#\0A\xA0\bk"\0$\0 \0 7 \0 7 \0 \0A\xB0\x07j"\x076\xAC\x07 \0A\x90j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xAC\x07j \x07A\xE3 \0P"\x07A\x7FF\r \0(\xAC\x07!\r \x07At/"\v! \vE\r\v \0A\x8Cj"\b $ \b=" \0(\xAC\x07"\b \x07 \bj (\0(0\0 \x07A\0J@ \0(\xAC\x07-\0\0A-F! +\v \0A\x006\xF8 \0B\x007\xF0 \0A\x006\xE8 \0B\x007\xE0 \0A\x006\xD8 \0B\x007\xD0  + \0A\x8Cj \0A\x88j \0A\x84j \0A\x80j \0A\xF0j \0A\xE0j \0A\xD0j \0A\xCCj\xF9@\x7F \0(\xCC"\b \x07H@ \b \x07 \bkAtj \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\f\v \b \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v At/"\f! \fE\r\v  \0A,j \0A(j ( \x07Atj  + \0A\x88j \0(\x84 \0(\x80 \0A\xF0j" + \0A\xE0j"\x07 \0A\xD0j" \b\xF8   \0(, \0((  \\ \f!   \x07  +  \0(\x8C# \v! \r! \0A\xA0\bj$\0\v0\0\v\x99\x07\x7F#\0A\xB0k"$\0 A\xACj"\0 $ \0>! + ( ,\0\v"\0 \0A\0H"\0\x1B@ (\0  \0\x1B-\0\0 +A- +(\0(\0A\xFFqF!\x07\v A\x006\xA0 B\x007\x98 A\x006\x90 B\x007\x88 A\x006\x80 B\x007x  \x07 A\xACj A\xA8j A\xA7j A\xA6j A\x98j A\x88j A\xF8\0j A\xF4\0j\xFC@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (t" J@ \0 kAtj (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\f\v (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0  \b\xC0A\0H"\x1B"\f \f \v \b \x1Bj + \x07 A\xA8j ,\0\xA7 ,\0\xA6 A\x98j" A\x88j"\x07 A\xF8\0j"\b \xFB  \0 (\f (\b  Z ! \b  \x07    (\xAC# A\xB0j$\0\v0\0\v\xDB\b\x7F#\0A\xB0k"\0$\0 \0 7 \0 7 \0 \0A\xC0j"\x076\xBC \0A\xD0j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xBCj \x07A\xE3 \0P"\x07A\x7FF\r \0(\xBC!\r \x07/"\v! \vE\r\v \0A\xCCj"\b $ \b>" \0(\xBC"\b \x07 \bj (\0( \0 \x07A\0J@ \0(\xBC-\0\0A-F! +\v \0A\x006\xC0 \0B\x007\xB8 \0A\x006\xB0 \0B\x007\xA8 \0A\x006\xA0 \0B\x007\x98  + \0A\xCCj \0A\xC8j \0A\xC7j \0A\xC6j \0A\xB8j \0A\xA8j \0A\x98j \0A\x94j\xFC@\x7F \0(\x94"\b \x07H@ \b \x07 \bkAtj \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\f\v \b \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v /"\f! \fE\r\v  \0A,j \0A(j ( \x07 j  + \0A\xC8j \0,\0\xC7 \0,\0\xC6 \0A\xB8j" + \0A\xA8j"\x07 \0A\x98j" \b\xFB   \0(, \0((  Z \f!   \x07  +  \0(\xCC# \v! \r! \0A\xB0j$\0\v0\0\v\xC0\x7F#\0A\xC0k"\0$\0 \0 6\xB8 \0 6\xBC \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07=! \0A\0:\0 \0A\xBCj   \x07 (  \0Aj  \0Aj \0Aj \0A\xB0j\x80@@ ,\0\vA\0H@ (\0A\x006\0 A\x006\f\v A\0:\0\v A\x006\0\v \0-\0AF@  A- (\0(,\0\xDD\v A0 (\0(,\0! \0("Ak! \0(!@@  O\r\0 (\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H" +\x1B"\vO  \v ( +\x1BAtjAjIqE@ \x07  A\0H" \x1B"  k"Au" +j!\x07 + \bA\xFF\xFF\xFF\xFF\x07qAkA \x1B"\b kK@  \b \x07 \bk  \xFF\v At (\0  ,\0\vA\0H\x1Bj! @   \xFC +\0\0\v  jA\x006\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xA2 ( \x07 ,\0"A\0H" +\x1B!@ (\b  +\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b At" @ \b Atj  \xFC +\0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v \b AtjA\x006\0\f\v   j k  A\0  \xDE\v \x07 \v Aj$\0\v \0A\xBCj \0A\xB8j(@  (\0Ar6\0\v \0(\xBC \0(# \0(! \0A\x006 @  \0(\0\v \0A\xC0j$\0\v\xDD\x7F#\0A\xF0k"\x07$\0 \x07 6\xE8 \x07 6\xEC \x07A\xE3\x006\xCC \x07 \x07A\xD0j6\xC8 \x07A\xC0j" $ =!\0 \x07A\0:\0\xBF@ \x07A\xECj    (  \x07A\xBFj \0 \x07A\xC8j \x07A\xC4j \x07A\xE0j\x80E\r\0 \x07A\xEE\x1B(\0\x006\0\xB7 \x07A\xE7\x1B)\0\x007\xB0 \0 \x07A\xB0j \x07A\xBAj \x07A\x80j \0(\0(0\0 \x07Aj!\0@ \x07(\xC4" \x07(\xC8"k"A\x89N@ AvAj/"\0!\b \0E\r\v \0! \x07-\0\xBFAF@ \0A-:\0\0 \0Aj!\v \x07A\xA8j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xB0j \x07A\x80j"  \xB1 kAuj-\0\0:\0\0 Aj! Aj! \x07(\xC4!\f\v\v0\0\v0\0\v \x07A\xECj \x07A\xE8j(@  (\0Ar6\0\v \x07(\xEC \x07(\xC0# \x07(\xC8!\0 \x07A\x006\xC8 \0@ \0 \x07(\xCC\0\v \x07A\xF0j$\0\v\xAE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07>! \0A\0:\0 \0A\x8Cj   \x07 (  \0Aj  \0Aj \0Aj \0A\x84j\x85@@ ,\0\vA\0H@ (\0A\0:\0\0 A\x006\f\v A\0:\0\v A\0:\0\0\v \0-\0AF@  A- (\0(\0\xAA\v A0 (\0(\0 \0("Ak! \0(!A\xFFq!@@  O\r\0 -\0\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H" +\x1B"\vO  \v ( +\x1BjAjIqE@ \x07  A\0H" \x1B"  k"j!\x07  \bA\xFF\xFF\xFF\xFF\x07qAkA + \x1B"\b kK@  \b \x07 \bk  \xA4\v (\0  ,\0\vA\0H\x1B j! @   \xFC +\0\0\v  jA\0:\0\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xCE ( \x07 ,\0"A\0H" +\x1B!@ (\b  +\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA + ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b @  \bj  \xFC +\0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v  \bjA\0:\0\0\f\v   j k  A\0  \x89\v \x07 \v Aj$\0\v \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0(# \0(! \0A\x006 @  \0(\0\v \0A\x90j$\0\v\xD1\x7F#\0A\x90k"\x07$\0 \x07 6\x88 \x07 6\x8C \x07A\xE3\x006\x9C \x07 \x07A\xA0j6\x98 \x07A\x90j" $ >!\0 \x07A\0:\0\x8F@ \x07A\x8Cj    (  \x07A\x8Fj \0 \x07A\x98j \x07A\x94j \x07A\x84j\x85E\r\0 \x07A\xEE\x1B(\0\x006\0\x87 \x07A\xE7\x1B)\0\x007\x80 \0 \x07A\x80j \x07A\x8Aj \x07A\xF6\0j \0(\0( \0 \x07Aj!\0@ \x07(\x94" \x07(\x98"k"A\xE3\0N@ Aj/"\0!\b \0E\r\v \0! \x07-\0\x8FAF@ \0A-:\0\0 \0Aj!\v \x07A\x80j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xF6\0j  \xB4 \x07k \x07j-\0 +:\0\0 Aj! Aj! \x07(\x94!\f\v\v0\0\v0\0\v \x07A\x8Cj \x07A\x88j)@  (\0Ar6\0\v \x07(\x8C \x07(\x90# \x07(\x98!\0 \x07A\x006\x98 \0@ \0 \x07(\x9C\0\v \x07A\x90j$\0\v\0A\xFC \v\xC7\x7F#\0A\xA0k"\b$\0 \b \bA\xA0j"6\f#\0A\x90k"\x07$\0 \x07 \x07A\x84j6 \0A\bj \x07A j" \x07Aj   \x88 \x07B\x007 \x07 6\f \b(\f \bAj"kAu! \0(\b!\0#\0Ak"$\0  \0H6\f  \x07A\fj  \x07Aj\xA4!\0 A\fjI Aj$\0 \0A\x7FF@0\0\v \b  \0Atj6\f \x07A\x90j$\0 \b(\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj (\0\xBE Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 $\0\v\xB8\0#\0A\x80k"$\0  A\xF4\0j6\f \0A\bj Aj" A\fj   \x88 (\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj ,\0\0\xC0 Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 A\x80j$\0\v\xB8\r\x7F#\0A0k"\x07$\0 \x07 6, A\x006\0 \x07 $ \x07=!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07 +\0\b \v\f\r\v\v \0 Aj \x07A,j   \b\x8B\f\v \0 Aj \x07A,j   \b\x8A\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07A\xA8\x86)\x007 \x07A\xA0\x86)\x007 \x07A\x98\x86)\x007\b \x07A\x90\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A\xC8\x86)\x007 \x07A\xC0\x86)\x007 \x07A\xB8\x86)\x007\b \x07A\xB0\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j!\0#\0Ak"$\0  6\f@@ \0 A\fj(\r\0 \bA \0: \b(\0(\f\0E\r\0 \0Q\f\v\v \0 A\fj(@  (\0Ar6\0\v Aj$\0\f\r\v \x07A,j!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x95" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xD0\x86A,\xFC +\0\0 \x07 \0      \x07 \x07A,jV6,\f\v\v \x07A\x90\x87(\x006 \x07A\x88\x87)\x007\b \x07A\x80\x87)\x007\0 \x07 \0      \x07 \x07AjV6,\f +\v \x07A,j   \bAN!\0@ (\0"Aq \0A<JrE@  \x006\0\f\v  Ar6\0\v\f \v \x07A\xB8\x87)\x007 \x07A\xB0\x87)\x007 \x07A\xA8\x87)\x007\b \x07A\xA0\x87)\x007\0 \x07 \0      \x07 \x07A jV6,\f\b\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\f\v  Ar6\0\v\f\x07\v \0      \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v Aj \x07A,j   \b\x89\f\v \x07A,j   \bAN!\0 -\0\0AqE@  \0A\xECk6\v\f\v A%F\r\v  (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A,j" \0A\fj"(\r\0A \b :A\0 \b(\0(4\0A%G\r\0 Q (E\rA\v (\0r6\0\v \0Aj$\0\v \x07(,\v \x07A0j$\0\v \0  \0\0\0\vK\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# Aj A\fj   \x89 (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# \0 Aj A\fj   \x8A (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# \0 Aj A\fj   \x8B (\f Aj$\0\vF\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BAtjV\vX\x7F#\0A k"$\0 A\xB8\x87)\x007 A\xB0\x87)\x007 A\xA8\x87)\x007\b A\xA0\x87)\x007\0 \0       A j"V $\0\v\xDB\f\x7F#\0Ak"\x07$\0 \x07 6\f A\x006\0 \x07 $ \x07>!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07 +\0\b \v\f\r\v\v \0 Aj \x07A\fj   \b\x8E\f\v \0 Aj \x07A\fj   \b\x8D\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07B\xA5\xDA\xBD\xA9\xC2\xEC\xCB\x92\xF9\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07B\xA5\xB2\xB5\xA9\xD2\xAD\xCB\x92\xE4\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj!\0#\0Ak"$\0  6\f@@ \0 A\fj)\r\0 \0;"A\0H\r\0 \b(\b Atj-\0\0AqE\r\0 \0S\f\v\v \0 A\fj)@  (\0Ar6\0\v Aj$\0\f\r\v \x07A\fj!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x97" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xF8\x85(\0\x006\0\x07 \x07A\xF1\x85)\0\x007\0 \x07 \0      \x07 \x07A\vjW6\f\f\v\v \x07A\x80\x86-\0\0:\0 \x07A\xFC\x85(\0\x006\0 \x07 \0      \x07 \x07AjW6\f\f +\v \x07A\fj   \bAO!\0@ (\0"Aq \0A<JrE@  \x006\0\f\v  Ar6\0\v\f \v \x07B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\b\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\f\v  Ar6\0\v\f\x07\v \0      \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v Aj \x07A\fj   \b\x8C\f\v \x07A\fj   \bAO!\0 -\0\0AqE@  \0A\xECk6\v\f\v A%F\r\v  (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A\fj" \0A\fj")\r\0A \b ;A\0 \b(\0($\0A%G\r\0 S )E\rA\v (\0r6\0\v \0Aj$\0\v \x07(\f\v \x07Aj$\0\v\x9B\x7F#\0A\xE0\0k"$\0 A\fj"   (\0 \0\b\0A\xD4\09"\0 -\0\b:\0\b \0 )\x007\0 \0A\fj A\fjb \0Aj Ajb \0A$j A$jb \0A0j A0jb \0A<j A<jb \0A\xC8\0j A\xC8\0jb \xC7 A\xE0\0j$\0 \0\vK\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# Aj A\fj   \x8C (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8D (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8E (\f Aj$\0\vC\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BjW\v;\x7F#\0Ak"$\0 B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\b \0      A\bj Aj"W $\0\v+\x7F  ("A\xB5\xFB~qA\x88r6    \x91  6\v\xB7\x07\x7F\x7F#\0A\x90k"\0$\0 \0B%7\x88 \0A\x88j"\x07ArA\x82 (\x91!\b \0 \0A\xE0j" 6\xDC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xE0j  \0A\x88j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xDCj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xDCj  \0A\x88j \0P\v"A\x7FF\r \0(\xDC\f\vA\0\v \0(\xDC"\x07  \x07j" + G!\v@ \0A\xE0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v +  \0A\xEC\0j \0A\xE8\0j \f\x90 \0(d#   \0(l \0(h  \\! \b!! \0A\x90j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xF0k"\0$\0 \0B%7\xE8 \0A\xE8j"ArA\xD7 (\x91!\x07 \0 \0A\xC0j"\b6\xBC*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\xC0j  \0A\xE8j" \0A0j]"AL\r*! \0 9 \0A\xBCj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\xBCj  \0A\xE8j \0P\v"A\x7FF\r \0(\xBC\f\vA\0\v \0(\xBC"  j" G! +@ \0A\xC0j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $  +  \0A\xCC\0j \0A\xC8\0j \v\x90 \0(D#   \0(L \0(H  \\! \x07!! \0A\xF0j$\0 \f\v0\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\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA + \b\x1B +\x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xF8\0j \0 A\x90j \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (x"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (x!\v A\x83j"\0  G! Aj"\x07 $ \0   Aj"\0 A\fj A\bj \x07\x90 (#  \0 (\f (\b  \\ A\x90j$\0\v\xDE\x7F#\0Ak"$\0  6\f@ -\0AqE@ \0     \0(\0( \0!\f\v  $ n!\0 (\0#  \0 \0(\0AA \x1Bj(\0\0 (\0"  ,\0\v"A\0H\x1B!@   \xC0A\0H"\0\x1B ( A\xFFq \0\x1BAtj F@ (\f!   A\fj (\0\xBE Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v+\x7F  ("A\xB5\xFB~qA\x88r6    \x94  6\v\xB7\x07\x7F\x7F#\0A\xE0k"\0$\0 \0B%7\xD8 \0A\xD8j"\x07ArA\x82 (\x91!\b \0 \0A\xB0j" 6\xAC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xB0j  \0A\xD8j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xACj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xACj  \0A\xD8j \0P\v"A\x7FF\r \0(\xAC\f\vA\0\v \0(\xAC"\x07  \x07j" + G!\v@ \0A\xB0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v +  \0A\xEC\0j \0A\xE8\0j \f\x93 \0(d#   \0(l \0(h  Z! \b!! \0A\xE0j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xC0k"\0$\0 \0B%7\xB8 \0A\xB8j"ArA\xD7 (\x91!\x07 \0 \0A\x90j"\b6\x8C*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\x90j  \0A\xB8j" \0A0j]"AL\r*! \0 9 \0A\x8Cj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\x8Cj  \0A\xB8j \0P\v"A\x7FF\r \0(\x8C\f\vA\0\v \0(\x8C"  j" G! +@ \0A\x90j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $  +  \0A\xCC\0j \0A\xC8\0j \v\x93 \0(D#   \0(L \0(H  Z! \x07!! \0A\xC0j$\0 \f\v0\0\v\v\xC3\x7F#\0A\xF0\0k"\0$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0\0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0P Ar!\f\v \x07A\bG\r\0 \0A0:\0P \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0Q \0A\xD0\0jAr!\v \0A\xC8\0j  \0A\xE8\0j  \x92 \0(H!\x07@ A\x88\x80qA\x88\x80G\r\0@  \x07F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0\0j" \x07 G! \0Aj"\b $   \x07 \0Aj" \0A\fj \0A\bj \b\x93 \0(#   \0(\f \0(\b  Z \0A\xF0\0j$\0\v\r\0    \x94\v\xA5\x7F~#\0A\xF0\0k"$\0 A\xD0\0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@  \x07A\xC0\0F\r A-:\0P \0Ar!\0B\0 }\f\v \v! + \b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA + \b\x1B \x1B!\b@ A\x80qE Pr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A\xD0j$\0\v\x99\x8B.\x7F}|#\0Ak"$\0  6\f A\x006\b B\x007\0    j"  k\xC2#\0A\xE0\0k"%$\0 %A\bj! (\0"! ( k!#\0A\xC0k"$\0 A\x006\xA0 B\x007\x98 A\x006\xB0 B\x007\xA8 A\xB4j"A\x006\b B\x007\0 A\x80\xC0\0\xB6 A\x80\xC0\0\x96 A\fjA\0A0\xFC\v\0  6\b  6@\x7F Aj!\v\x7FAzA\x94-\0\0A1G\r\0A~ \vE\r \vA\x006 \v( "E@ \vA\x006( \vA/6 A/!\v \v($E@ \vA06$\vA| \v((AA\xD07 \0"E\r \v 6 A\x0068  \v6\0 A\xB4\xFE\x006A~!@ \vE\r\0 \v( E\r\0 \v($"E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0@@ (8"@ ((AG\r\v A6( A6\f\f\v \v((  \0 A\x0068 \v( A6( A6\fE\r\v \v($E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0A\0! A\x0064 B\x007, A\x006 \vA\x006\b \vB\x007 (\f"@ \v Aq60\v B\x007< A\x006$ A\x80\x806 B\x80\x80\x80\x80p7 B\xB4\xFE\x007 B\x81\x80\x80\x80p7\xC47  A\xB4 +j"6p  6T  6P\vA\0 E\r\0 \v((  \v($\0 \vA\x006 \v\vE@ A\x006\xAC@@  (\0"6  ( k6A\0!\v#\0Ak"$\0A~!\x1B@ Aj"\rE\r\0 \r( E\r\0 \r($E\r\0 \r("\x07E\r\0 \x07(\0 \rG\r\0 \x07("A\xB4\xFE\0kAK\r\0 \r(\f"E\r\0 \r(\0"E@ \r(\r\v A\xBF\xFE\0F@ \x07A\xC0\xFE\x006A\xC0\xFE\0!\v \x07A\xDC\0j!- \x07A\xF2\0j!. \x07A\xF4j!" \x07A\xD8\0j!& \x07A\xF0\0j!# \x07A\xB4 +j! \x07A\xF4\0j! \x07(@! \x07(<! \r("'! \r("!@@@@@@A}!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xB4\xFE\0k\x07 +\r9:;<%&(\0*@BCD\v \x07(L! \f(\v \x07(L! \f%\v \x07(l! \f!\v \x07(\f!\f9\v AO\r E\r< A\bj! Aj! Ak! -\0\0 t j! AM\r ! ! !\f\v A O\r E\r; Aj! Ak! -\0\0 t j! AM\r\r ! !\f\v AO\r E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07M\r ! ! !\f\v \x07(\f" +E\r@ AO\r\0 E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! ! !\f\v E@ !A\0! ! \v!\f<\v Ar! Ak! -\0 t j! Aj!\v +AqE A\x9F\x96GrE@ \x07((E@ \x07A6(\vA\0! \x07A\0A\0A\0D"6 A\x9F\x96;\f  A\fjAD! \x07A\xB5\xFE\x006 \x07 6A\0! \x07(!\f7\v \x07($"@ A\x7F60\v A\btA\x80\xFEq A\bvjApE +AqqE@ \rA\xD96 \x07A\xD1\xFE\x006 \x07(!\f7\v AqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f7\v Av"Aq" A\bj! + A\x07M \x07(("\x7F  \x07 +6( +\v +OqE@ Ak! \rA\xF46 \x07A\xD1\xFE\x006 ! \x07(!\f7\vA\0! \x07A\x006 \x07A\x80 t6 \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBD\xFE\0A\xBF\xFE\0 A\x80\xC0\0q\x1B6A\0! \x07(!\f6\v E@ !A\0! ! \v!\f:\v Ar! Ak! -\0 t j! Aj!\v \x07 6 A\xFFqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f5\v A\x80\xC0q@ \rA\x90 +6 \x07A\xD1\xFE\x006 \x07(!\f5\v \x07($"@  A\bvAq6\0\v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 A\b:\0\f  A\bv:\0\r \x07 \x07( A\fjAD6\v \x07A\xB6\xFE\x006A\0!A\0!\f\v AK\r\v E\r5 Aj! Ak! -\0\0 t j! AK@ ! !\f\v A\bj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f6\v Ak! -\0 t j! Aj!\v \x07($"@  6\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0  6\f \x07 \x07( A\fjAD6\v \x07A\xB7\xFE\x006A\0!A\0!\f\v AK\r\v E\r2 Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v A\bj! E@ !\f3\v Ak! -\0 t j! Aj!\v \x07($"@  A\bv6\f  A\xFFq6\b\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0  ;\f \x07 \x07( A\fjAD6\v \x07A\xB8\xFE\x006A\0!A\0!A\0! \x07("A\x80\bq\r\f'\v \x07("A\x80\bqE@ !\f'\v ! AK\r\v E@A\0! ! \v!\f1\v Aj! Ak! + -\0\0 t j! A\x07K@ ! +!\f\v A\bj! +E@ !\f0\v Ak! -\0 t j! Aj!\v \x07 6D \x07($"@  6\vA\0!@ A\x80qE\r\0 \x07-\0\fAqE\r\0  ;\f \x07 \x07( A\fjAD6\vA\0!\f%\v A\bj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f.\v Ak! -\0 t j! Aj!\v \x07 AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr"6 \r 60 \x07A\xBE\xFE\x006A\0!A\0!\v \x07(E@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<A!\x1B\f/\v \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBF\xFE\x006\v\x7F@ \x07(\bE@  AK\r \r\f-\v \x07A\xCE\xFE\x006  A\x07qv! Axq! \x07(!\f)\v Ak! -\0\0 t j! Aj! A\br\v \x07 Aq6\bA\xC1\xFE\0!@@@@@ AvAqAk\0\v \x07A\x90\xDC\x006P \x07B\x89\x80\x80\x80\xD0\x007X \x07A\x90\xEC\x006T \x07A\xC7\xFE\x006\f\vA\xC4\xFE\0!\f\v \rA\x976A\xD1\xFE\0!\v \x07 6\vAk! Av! \x07(!\f'\v  A\x07qv!\x7F Axq"\b AK\r\0 E@A\0! \b! \v!\f,\v \bA\bj! Aj! Ak! -\0\0 \bt j! AK@ ! ! \f\v E@ !A\0! ! \v!\f,\v \bAj! + Aj! Ak! -\0 t j! AK@ ! ! +\f\v E@ !A\0! +! \v!\f,\v \bAj! Aj! Ak! -\0 +t j! A\x07K@ ! ! \f\v E@ !A\0! ! \v!\f,\v Ak! -\0 t j! Aj!A \v! A\xFF\xFFq" A\x7FsAvG@ \rA\xC2\v6 \x07A\xD1\xFE\x006 \x07(!\f'\v \x07A\xC2\xFE\x006 \x07 6DA\0!A\0!\v \x07A\xC3\xFE\x006\v \x07(D"@    I\x1B"   I\x1B"E@ \v!\f*\v @   \xFC +\0\0\v \x07 \x07(D k6D  j!  k!  j!  k! \x07(!\f%\v \x07A\xBF\xFE\x006 \x07(!\f$\v E@ !A\0! ! \v!\f(\v Ar! Ak! -\0 t j! Aj!\v \x07 Aq"A\x81j6d \x07 AvAq"Aj6h \x07 A +vAqAj" +6\` Ak! Av! AI AMqE@ \rA\x9E\v6 \x07A\xD1\xFE\x006 \x07(!\f#\v \x07A\xC5\xFE\x006A\0! \x07A\x006l\f\v \x07(l" \x07(\`" +I\r\f\v E\r\r  \x07(D:\0\0 \x07A\xC8\xFE\x006 Ak! Aj! \x07(!\f \v \x07(\f"E@A\0!\f\v@ AK@ ! \f\v E\r# A\bj! Aj! Ak! + -\0\0 t j! AK@ +! !\f\v +E@ !A\0! ! \v!\f%\v Aj! + Aj! Ak!\b -\0 t j! AK@ \b! +!\f\v \bE@ !A\0! +! \v!\f%\v Aj! Aj! Ak!\b -\0 +t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f%\v A r! Aj! Ak! -\0 t j!\v \r  k" + \r(j6 \x07 \x07( +j6 Aq"E  Fr\x7F   +k! \x07(! \x07\x7F \x07(@   +D\f\v   +\x82\v"6 \r 60 \x07(\f"Aq\vE\r \x07(  AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr \x07(\x1BF\r \rA\x876 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \x07A\xC0\xFE\x006\f\v !A\0!A\0! !\v \x07A\xCF\xFE\x006\f\x1B\v@ AM@ E\r Ak! -\0\0 t j! A\br! Aj!\v \x07 Aj"6l  At/\xE0[Atj A\x07q;\0 Ak! Av! " +G\r\0\v +!\v AM@A\0! "Aq"\vAG@@  At/\xE0[AtjA\0;\0 Aj! \v Aj" sAG\r\0\v\v AM@@  At"A\xE0\xDB\0j/\0AtjA\0;\0  A\xE2\xDB\0j/\0AtjA\0;\0  A\xE4\xDB\0j/\0AtjA\0;\0  A\xE6\xDB\0j/\0AtjA\0;\0 Aj"AG\r\0\v\v \x07A6l\v \x07A\x076X \x07 6P \x07 6pA\0! A\0 A # & "\xA2"\v@ \rA\xF7 6 \x07A\xD1\xFE\x006 \x07(!\f\x1B\v \x07A\xC6\xFE\x006 \x07A\x006lA\0!\v\v \x07(d" \x07(hj" K@A\x7F \x07(XtA\x7Fs! \x07(P!@ !\f ! !@@@@@@   q"Atj-\0"\b M@ ! +\f\v@ E\r -\0\0 \ft!\b Aj! Ak! \fA\bj" +!\f +   \bj" q"Atj-\0"\bI\r\0\v\v  Atj/"AM@ \x07 Aj"6l  Atj ;\0 + \bk!  \bv! ! \f\v\x7F\x7F@@@ Ak\0\v \bAj" +K@@ E\r Ak! -\0\0 +t j! Aj! +A\bj" + I\r\0\v\v + \bk!  \bv! + E@ \rA\xCD +6 \x07A\xD1\xFE\x006 ! ! +! \x07(!\f%\v Ak! +Av! +AqAj!\b . Atj/\0\f\v \bAj" +K@@ E\r Ak! -\0\0 +t j! Aj! +A\bj" + I\r\0\v\v + \bkAk!  \bv"Av! A\x07qAj\f\v \bA\x07j" +K@@ E\r Ak! -\0\0 +t j! Aj! +A\bj" + I\r\0\v\v + \bkA\x07k!  \bv"A\x07v! A\xFF\0qA\vj\v!\bA\0\v!\f \b j K\rA\0! + \bAq"E\r \b!@  Atj \f;\0 Aj! Ak! +Aj" + G\r\0\v\f\v  j!  Atj!\f"\v \b!\f\v \rA\xCD +6 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \bAO@@  Atj" \f;\0  \f;  \f;  \f; Aj! Ak"\r\0\v\v \x07 6l\v ! ! I\r\0\v\v \x07/\xF4E@ \rA\xB46 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A 6X \x07 6P \x07 6pA   # & "\xA2"\v@ \rA\xDB 6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A6\\ \x07 \x07(p6TA  \x07(dAtj \x07(h # - "\xA2"\v@ \rA\xA9 +6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC7\xFE\x006A\0!\v\v \x07A\xC8\xFE\x006\v AI A\x82IrE@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6< \r("(4"\bA\x07q!( \b j!/ \b (,"0j!1 \r(\f" \r("j"$A\x81k!)   kj! \r(\0" \r(jAk!*A\x7F (\\tA\x7Fs!A\x7F (XtA\x7Fs! (T!+ (P!, (@! (<!\f (8! + (0!@ AM\x7F -\0\0 t \fj -\0 A\bjtj!\f Aj! Ar \v , \f qAtj"-\0"k! \f v!\f@@@@@ \x7F \r\x7F@@ -\0\0"E@  -\0:\0\0 Aj!\f\b\v Aq@ /!\x7F Aq"E@ ! \f\f\v\x7F  M@ ! \f\v A\bj! -\0\0 t \fj!\f Aj\v!  k! \fA\x7F tA\x7Fsq j! \f v\v! AM@ -\0\0 t j -\0 A\bjtj! Ar! Aj!\v  +  qAtj"-\0" k!  v!\f -\0\0"Aq\r@ A\xC0\0qE@  + /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f -\0\0"AqE\r\f\v\v ! A\x93\f\v A\xC0\0qE@  , /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f\f\v\vA\xBF\xFE\0 A q\rA\xF7\f\v /!\x7F Aq" M@ ! \f\v -\0\0 t \fj!\f Aj  A\bj"M\r\0 -\0 t \fj!\f Aj! Aj\v! \fA\x7F tA\x7Fsq!  k! \f v!\f  j"!  k"M\r ! k" M\r (\xC47E\rA\xA6\v6A\xD1\xFE\0\v6\f\v@@ \bE@ + 0 kj!  O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v  $j jk jAxK\r@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\f\v  \bK@ + 1 kj!  \bk" O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v / $j jk jAxM@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v \b  k"O@ +!\f\vA\0! \b! +! (@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" (G\r\0\v\v \bA\bO@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  !k!  \bk!\f\v + \b kj!  O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v  $j jk jAxK\r\0@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  !k!  k!\v@ AI\r\0A\0! Ak"AnAjAq"@@  -\0\0:\0\0  -\0:\0  -\0:\0 Ak! Aj! Aj! Aj" G\r\0\v\v A I\r\0@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07  -\0\b:\0\b  -\0 :\0  -\0 +:\0 +  -\0\v:\0\v A\fj! A\fj! A\fk"AK\r\0\v\v E@ !\f\v  -\0\0:\0\0 AF\r Aj!\f\v  !k!@ " "-\0\0:\0\0  -\0:\0  -\0:\0 Aj! Aj! Ak"AK\r\0\v E\r  -\0\0:\0 AG@ Aj!\f\v  -\0:\0 Aj!\f\v  -\0:\0 Aj!\v *O\r\0  )I\r\v\v \r 6\f \r Avk"6\0 \r ) kA\x81j6 \r * kAj6  A\x07q"6@  \fA\x7F tA\x7Fsq6< \x07(@! \x07(<! \r(! \r(\0! \r(! \r(\f! \x07(A\xBF\xFE\0G\r \x07A\x7F6\xC87 \x07(!\f\v \x07A\x006\xC87 ! ! !@ \x07(P" A\x7F \x07(XtA\x7Fs"qAtj"\b-\0"\f M@ ! +\f\v@ E\r\r -\0\0 t!\b Aj! Ak! A\bj" +! +   \bj" qAtj"\b-\0"\fI\r\0\v\v \f! \b/!@ \b-\0\0"\bAkA\xFFqAK@A\0! ! !\f\v ! !@ +"   Atj" A\x7F  \bjtA\x7Fs"q vAtj"-\0"\fjO@ +!\b\f\v@ E\r\r -\0\0 t!\f Aj! Ak! A\bj"\b!    \fj" q vAtj"-\0"\fj \bK\r\0\v\v \b k! +  v! -\0\0!\b /!\v \x07 A\xFF\xFFq6D \x07  \fj6\xC87 + \fk!  \fv! \bA\xFFq"E@ \x07A\xCD\xFE\x006 \x07(!\f\v A q@ \x07A\xBF\xFE\x006 \x07A\x7F6\xC87 \x07(!\f\v A\xC0\0q@ \rA\xF76 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC9\xFE\x006 \x07 Aq" 6L\v ! + !\b@ E@ \x07(D!\f\v ! !  I@@ E\r\v Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(D A\x7F tA\x7Fsqj"6D  k!  v!\v \x07A\xCA\xFE\x006 \x07 6\xCC7\v ! ! !@ \x07(T" A\x7F \x07(\\tA\x7Fs"qAtj"\b-\0"\f M@ ! +\f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj" +! +   \bj" qAtj"\b-\0"\fI\r\0\v\v \b/! \x07\x7F \b-\0\0" AO@ ! ! \f!\b \x07(\xC87\f\v ! !@ +" \f  Atj" A\x7F \fjtA\x7Fs"q \fvAtj"-\0"\bjO@ ! \f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj" ! \f   \bj" q \fvAtj"-\0"\bj K\r\0\v\v \fk! +  \fv! -\0\0! /! \x07(\xC87 \fj\v \bj6\xC87 + \bk!  \bv! A\xC0\0q@ \rA\x936 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xCB\xFE\x006 \x07 Aq" 6L \x07 A\xFF\xFFq6H\v ! + !\b @ ! !  I@@ E\r Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(H A\x7F tA\x7Fsqj6H  v!  k!\v \x07A\xCC\xFE\x006\v \r\vA\0! \v!\f\v\x7F \x07(H"  k"K@@  k" \x07(0M\r\0 \x07(\xC47E\r\0 \rA\xA66 \x07A\xD1\xFE\x006 \x07(!\f\v\x7F \x07(4" I@ \x07(8 \x07(,  k"kj\f\v \x07(8  kj\v!  \x07(D"  I\x1B\f\v  k! \x07(D" \v! \x07    I\x1B" +k6D +Ak!\fA\0! +A\x07q"\bE\r +!@  -\0\0:\0\0 Ak! Aj! Aj! Aj" \bG\r\0\v\f\x07\v \b +j!  \bAtj!\f\v  j! + Atj!\f\v  j!  Atj!\f\v \b +j!  \bAtj!\f\v  j! + Atj!\f\v  j!  Atj!\f\v +!\v \fA\x07O@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  +k! \x07(D\r\0 \x07A\xC8\xFE\x006 \x07(!\f \v \x07(!\f\b\vA\0! ! +! \v!\f\v\v \x07($"@ A\x006\v !\v \x07A\xB9\xFE\x006\v@ \x07(" A\x80\bqE\r\0 \x07(D"   K\x1B"\f@@ \x07($"\bE\r\0 \b(" +E\r\0 \b(" \b( k"M\r\0  k \f  \fj K\x1B"@  +j  \xFC +\0\0\v \x07(! \v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  \fD6\v \x07 \x07(D \fk"6D  \fk!  \fj!\v E\r\0 \v!\f \v \x07A\xBA\xFE\x006 \x07A\x006D\v@ \x07-\0A\bq@A\0! E\r\b@  j-\0\0!\b@ \x07($" +E\r\0 +("E\r\0 \x07(D" +( O\r\0 \x07 Aj6D  j \b:\0\0\v \bA\0  Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  D6\v  j!  k! \bE\r \v!\f \v \x07($"E\r\0 A\x006\v \x07A\xBB\xFE\x006 \x07A\x006D\v@ \x07-\0Aq@A\0! E\r\x07@  j-\0\0!\b@ \x07($" +E\r\0 +($"E\r\0 \x07(D" +((O\r\0 \x07 Aj6D  j \b:\0\0\v \bA\0  Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  D6\v  j!  k! \bE\r \v!\f\b\v \x07($"E\r\0 A\x006$\v \x07A\xBC\xFE\x006\v \x07(" +A\x80q@@ AK@ !\f\v E\r A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v E@ !A\0! ! \v!\f\b\v Ar! Aj! Ak! -\0 t j!\v@ \x07-\0\fAqE\r\0  \x07/F\r\0 \rA\xCB6 \x07A\xD1\xFE\x006 ! \x07(!\f\vA\0!A\0! !\v \x07($"@ A60  +A vAq6,\v \x07A\0A\0A\0D"6 \r 60 \x07A\xBF\xFE\x006 \x07(!\f\v E\r \x07(E\r@ AK@ !\f\v E\r A\bj! Aj! Ak! + -\0\0 t j! AK@ +! !\f\v +E@ !A\0! ! \v!\f\v Aj! + Aj! Ak!\b -\0 t j! AK@ \b! +!\f\v \bE@ !A\0! +! \v!\f\v Aj! Aj! Ak!\b -\0 +t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f\v A r! Aj! Ak! -\0 t j!\v@ AqE\r\0  \x07( F\r\0 \rA\xF06 \x07A\xD1\xFE\x006 ! \x07(!\f\v\v !A\0!A\0!\v \x07A\xD0\xFE\x006\vA!\f\vA\0! \v!\v \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<@@ \x07(,E@  F\r \x07(A\xD0\xFE\0K\r\v\x7F  k! @@ \r(" +(8"\vE@A! + \r((A +((tA \r( \0"\v68 \vE\r\v +(,"E@ +B\x0070 +A +((t"6,\v  M@ @ \v  k \xFC +\0\0\v +A\x0064\f\v  +(4"k"  I\x1B"@  \vj  k \xFC +\0\0\v  I@ k"@ +(8  k \xFC +\0\0\v + 64\f\vA\0! + +(4 j"A\0  +(,"G\x1B64  +(0"M\r\0 +  j60\v \f\v + +(,60A\0\v\r \r(! \r(!\v \r \r(\b ' kj6\b \r  k" \r(j6 \x07 \x07( j6 \x07-\0\fAqE  FrE@ \r(\f k! \x07(! \x07\x7F \x07(@   D\f\v   \x82\v"6 \r 60\v \r \x07(@A\xC0\0A\0 \x07(\b\x1BjA\x80A\0 \x07("A\xBF\xFE\0F\x1BjA\x80A\x80A\0 A\xC2\xFE\0F\x1B A\xC7\xFE\0F\x1Bj6, A{ \x1B   F\x1B   'F\x1B!\x1B\f\v \x07A\xD2\xFE\x006\vA|!\x1B\v Aj$\0 \x1BAK\r A\xA8j! + (\xAC!\b (\0! ( (k!#\0A k"$\0@  k" A\0L\r\0 +(\b +("\vk N@ \v \bk" H@   j"k"E  FrE@ \v  \xFC +\0\0\v +  \vj6 A\0L\r + \b \v \b j\xD1  \bj!@  \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v + \b \v \b j"\xD1@  \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v A\fj + +(\0k \vj\x83 \b +(\0k +\x8C"\v(\b"j!@  G@  -\0\0:\0\0 Aj! Aj!\f\v\v \v 6\b \v( +( \bk"@ \v(\b \b \xFC +\0\0\v \v \v(\b +( \bkj6\b + \b6 \v( +(\0" \bkj! \b k"@   \xFC +\0\0\v \v 6 + +(\0"6 + \v(6\0 \v 6 +(! + \v(\b6 \v 6\b +(\b! + \v(\f6\b \v 6\f \v \v(6\0 \v\x87\v A j$\0 \x1BAG\r\0\v \r\xCB 1 A\x98j" (\xA8" (\xAC k\xE0 +1 \rA\x006\\ \rA\xF8\xF9\x006@ \rA\xD0\xF9\x006\0 \rA\xE4\xF9\x006\b \rA\x88\xFA\0(\0"6\0 \r A\fk(\0jA\x8C\xFA\0(\x006\0 \rA\x006 \r \r(\0A\fk(\0j"A\x006  \rA\fj""6 A\x006\f B\x82\xA0\x80\x80\xE0\x007  E6 A jA\0A(\xFC\v\0 Aj\xF4 A\0:\0P B\x80\x80\x80\x80p7H \rA\x90\xFA\0(\0"6\b A\fk(\0 \rA\bjjA\x94\xFA\0(\x006\0 \rA\x84\xFA\0(\0"6\0 \r A\fk(\0jA\x98\xFA\0(\x006\0 \rA\x9C\xFA\0(\x006\b \r"A\xD0\xF9\x006\0 A\xE4\xF9\x006\b A\xF8\xF9\x006@ A\xA8\xF5\x006\0 Aj\xF4 B\x007 B\x007 B\x007\b B\x007 A\xE8\xF5\x006\0 B\x007( A60  A j"\vG@@ ,\0\v! \v,\0\vA\0H@ (\0  A\0H"\x1B!@ (  \x1B" \v(\bA\xFF\xFF\xFF\xFF\x07q"I@ \v 6 \v(\0! @   \xFC +\0\0\v  jA\0:\0\0\f\v \v Ak  kAj \v("A\0   \x89\v\f\v A\0H@ (\0!@ ("A +M@ \v :\0\v @ \v  \xFC +\0\0\v  \vjA\0:\0\0\f\v \vA + A +k \v-\0\vA\xFF\0q"A\0   \x89\v\f\v \v (\b6\b \v )\x007\0\v\v A\x006, ( A j" ,\0+"A\0H"\x1B! + ($  \x1B! (0"A\bq@  +6\f  +6\b  +j"6  6,\v@ AqE\r\0  +j6, A + ((A\xFF\xFF\xFF\xFF\x07qAk A\0N\x1B"  +6  +6  + ($ ,\0+" A\0H\x1Bj6 -\x000AqE\r\0@ A\0H@  +A\xFF\xFF\xFF\xFF\x07j" +6 A\xFF\xFF\xFF\xFF\x07k! \f\v\v E\r\0  +j6\v#\0A\xC0k"\b$\0 \bB\x007\xB8 \bB\xCE\x8E\xCD\x8257\xB0  \bA\xB0jAf@@  (\0A\fk(\0j-\0AqE@ \b(\xB0A\xCE\x8E\xCD\x82F\r\vA\xD5\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB4AkA|M@A\xD9 \bA\xB4j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB8"A\x81\xAD\xE2O@A\xDB \bA\xB8j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b-\0\xBC"AO@ \b 6\0A\x97 \ba\`A\xB0\xF1\0(\0L B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \xCD! \b(\xB4! \bA:\0e \bA\xE8\0j" +A\0A\xC8\0\xFC\v\0 \b 6X \b \b-\0\xBC6\\ \b \b-\0\xBD6\` \b \b-\0\xBEAq:\0d + Al"AA AF\x1Blz \bA\xF4\0j"\v z \b AK":\0e \bA\x80j"AA \x1B lz \bA\x8Cj" z \bA\x98j" z \bA\xA4j"  lz  \b(h \bA\xCC\0j +u" ( (\0kf 1  \b(\x8C \bA@k u"( (\0kf 1  \b(\x98 \bA4j u"( (\0kf 1  \b(t \bA(j \vu"( (\0kf 1  \b(\x80 \bAj u"( (\0kf 1  \b(\xA4 \bAj u"( (\0kf 1@  (\0A\fk(\0j-\0Aq@A\xB6\f\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v  \bA\xD8\0j")7  )\x007\0 Aj Ajt Aj Ajt A(j A(jt A4j A4jt A@k A@kt A\xCC\0j A\xCC\0jt\v \bA\xD8\0j\xCC\v \bA\xC0j$\0 \x81\f\v Aj\xCB\v 1 A\xA8j1 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\v A\x98j  A\xC0j$\0#\0A\x90k"\b$\0 (\0! (\xCD!@@@ ( (k"\v Al" +AA \v (\0"Al"F\x1BlG@ \bA\xA568 \bA\xF8\x0064 \bA\x9F60A\xED\v \bA0ja\`A\xB0\xF1\0(\0L\f\v + ( (kG@ \bA\xF9\x006< \bA<jA\xF5\xD0\f\v (, ((kAA -\0\r"Aq\x1B lG@ \bA\xCD6( \bA\xFA\x006$ \bA\x9F6 A\xED\v \bA ja\`A\xB0\xF1\0(\0L\f\v (8 (4kG@ \bA\x9E6 \bA\xFB\x006 \bA\x9F6A\xED\v \bAja\`A\xB0\xF1\0(\0L\f\v + (D (@kG@ \bA\xFC\x006< \bA<jA\xCB\xD0\f\v (P (Lk"  +lF\r \bA\x9F6\b \bA\xFD\x006 \bA\x9F6\0A\xED\v \ba\`A\xB0\xF1\0(\0L\v \0A\0:\0\b \0B\x007\0 \0A\fjA\0A\xC8\0\xFC\v\0\f\v \0A\fj"A\0A\xC8\0\xFC\v\0 \0 6\0 \0 (6 \0 -\0\f:\0\b  +w \0Aj +w \0A$j Atw \0A0j w \0A<j +w \0A\xC8\0j w@  \vF@ (\0! (!A\0!\f@ + \fF\r  \fAtj}C\0\0\x80?C\0\0\x80\xBF  \fAtj/\0"\xC1A\0N\x1B!2 A\xFF\x07q!@ A +vAq"AG@ \r 2C\0\0\x808\x94 \xB3\x94C\0\0\x80:\x94\f\vC\0\0\xC0\x7F 2C\0\0\x80\x7F\x94 \x1B\f\vC\0\0\x80?!3@ Ak"A\x80N@C\0\0\0\x7F!3 A\xFFI@ A\xFF\0k!\f\vC\0\0\x80\x7F!3A\xFD  A\xFDO\x1BA\xFEk!\f\v A\x81\x7FJ\r\0C\0\0\x80\f!3 A\x9B~K@ A\xE6\0j!\f\vC\0\0\0\0!3A\xB6}  A\xB6}M\x1BA\xCCj!\v \xB3C\0\0\x80:\x94C\0\0\x80?\x92 2 3 AtA\x80\x80\x80\xFCj\xBE\x94\x94\x94\v8\0 \fAj!\f\f\0\v\0\vD\0\0\0\0\0\0\xF0?A (\bt\xB7\xA3\xB6!2 (\0! (!A\0!\f@ + \fF\r  \fAtj 2  \fAlj"/\0\0 ,\0"A\xFFqAtrA\x80\x80\x80xA\0 A\0H\x1Br\xB2\x948\0 \fAj!\f\f\0\v\0\v \0(! (!A\0!\f@ + \fF@ \bA\xD4\0j!\vA\0!\f Aq!\x7F \fF\x7F \0(0! (4!A\0@ @ \0($ ((! \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC +\0\0 \fAtj! \bA<j!C\0\0\0\0!3  \fAtj"/\0\0 -\0Atr -\0"Atr! Av!A!\x7F A\0H\x7F  AtjC\0\0\x80? 3\x93\x918\0 A\fj!A\0  G@  Atj A\xFFq\xB3C\xF35?\x94C\0\x80\xFFC\x95"2\x8C 2 A\x80q\x1B"28\0 2 2\x94 3\x92!3 A +v!\v Ak!\f\v\v!@ AG@  At"j"  j*\0 *\0\x948\0 Aj!\f\v\v\f\v \0($ (( \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC +\0\0#\0Ak"$\0 \fAlj"-\0! -\0!  -\0\0\xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*H\x948  \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*L\x948\b  \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*P\x94"28\f \fAtj" 28\b  )7\0 C\0\0\x80? *\f *\f\x94 * *\x94 *\b *\b\x94\x92\x92\x93"2C\0\0\0\0 2C\0\0\0\0^\x1B\x918\f Aj$\0\v \fAj!\f\f\v\v!\f@ \fG@  \fAtj}C\0\0\0\0  \fj-\0\0\xB3C\0\0\x7FC\x95"2C\0\0\x80? 2\x93\x95"3\xBC"A\x80\x80\x80\xFCF\r\0@ A\x80\x80\x80\xFC\x07kA\xFF\xFF\xFF\x87xM@ At"E@#\0Ak"C\0\0\x80\xBF8\f *\fC\0\0\0\0\x95\f\v A\x80\x80\x80\xFC\x07F\r A\x80\x80\x80xI A\0NqE@ 3 3\x93"2 2\x95\f\v 3C\0\0\0K\x94\xBCA\x80\x80\x80\xDC\0k!\vA\x98\xF1\0+\0  A\x80\x80\xCC\xF9k"A\x80\x80\x80|qk\xBE\xBB AvA\xF0q"+\x90o\xA2D\0\0\0\0\0\0\xF0\xBF\xA0"7 7\xA2"8\xA2A\xA0\xF1\0+\0 7\xA2A\xA8\xF1\0+\0\xA0\xA0 8\xA2 Au\xB7A\x90\xF1\0+\0\xA2 +\x98o\xA0 7\xA0\xA0\xB6!3\v 3\v8\0 \fAj!\f\f\v\v \0(<! (@!A\0!\f@ + \fF@ (P (L"k! \0(H!A\0!@  F@ (\f!A\0!#\0A\xE0\0k"\v$\0#\0Ak"$\0A!\x7FA!A A\0L\r\0 AkAs"A\x7FsAq! AqE! AqE\v!  :\0  :\0  :\0\r -\0! -\0! -\0\r! \vA\x80\x80\x80\xFC6@ \vA\x80\x80\x80\xFC68 \vC\0\0\x80?C\0\0\x80\xBF \x1B"68\\ \vC\0\0\x80?C\0\0\x80\xBF \x1B"58X \v 68T \v 58P \vC\0\0\x80?C\0\0\x80\xBF \x1B"48L \v 48D \v 68, \v 58( \v 48$ \v 58 \v 48 \v 68\f \v 6 5\x94"38< \v 4 5\x94"284 \v 6 4\x94"480 \v 48 \v 38 \v 28 \v 4 5\x948H Aj$\0 \0( \0(\f"kAu!@  M@ \0(( \0($"kAu!A\0!@  M@@ \0(L \0(H"kAuAn" \0(\0n! \vA$j!\0A\0!A\0!@A\0!\f  M\r@  \fM@  j!\f  Atj" \0 \fAtj*\0"2 *\0\x948\0  2 *\x948  2 *\b\x948\b Aj! \fAj!\f\f\v\0\v\0\v\0\v  Atj" \v* *\0\x948\0  \v* *\x948  \v* *\b\x948\b Aj!\f\v\v \vA\xE0\0j$\0  Atj" \v*\f *\0\x948\0  \v* *\x948  \v* *\b\x948\b Aj!\f\v\v  Atj  j-\0\0\xB3C\0\0\0\xC3\x92C\0\0\0<\x948\0 Aj!\f\v\v  \fAtj  \fj-\0\0\xB3C\0\0\x7FC\x95C\0\0\0\xBF\x92C\x9A\x99>\x958\0 \fAj!\f\f\v\v  \fAtj  \fj-\0\0\xB3C\0\0\x80=\x94C\0\0 \xC1\x928\0 \fAj!\f\f\v\v\v \bA\x90j$\0 \xCC %A\xE0\0j$\0 1 Aj$\0\v\x81\x7F#\0A k"$\0  6@ -\0AqE@ A\x7F6\0 \0      \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v  $ =! (\0#  $ n!\0 (\0#  \0 \0(\0(\0 A\fr \0 \0(\0(\0  Aj   Aj"  A\x95 F:\0\0 (!@ A\fk " G\r\0\v\v A j$\0 \v\xEE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\x006\xD8 \0B\x007\xD0 \0Aj" $ >"A\xD0\x85A\xEA\x85 \0A\xE0j (\0( \0 \0(# \0A\x006\xC8 \0B\x007\xC0 \0A\xC0j"A +" \0 \0(\xC0  \0,\0\xCBA\0H\x1B"6\xBC \0 6\f \0A\x006\b@@ \0A\x8Cj \0A\x88j)\r\0 \0(\xBC  \0(\xC4 \0,\0\xCB" A\0H\x1B"jF@ \0A\xC0j" At" A + \0(\xC8A\xFF\xFF\xFF\xFF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\v A j$\0 \v@\x7FA\0!\0\x7F  F\x7F \0 (\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0  \xA2\vT\x7F@@  G@A\x7F!\0  F\r (\0" (\0"H\r  J@A Aj! Aj!\f\v\0\v\v  G!\0\v \0\v@\x7FA\0!\0\x7F  F\x7F \0 ,\0\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0  \xCE\v^\x7F   kj!@@  G@A\x7F!\0  F\r ,\0\0" ,\0\0"\x07H\r  \x07J@A Aj! Aj!\f\v\0\v\v  G!\0\v \0\vT\x7F  \0(T" A\0 A\x80j"\xCA" k  \x1B"   K\x1B"Y \0  j"6T \0 6\b \0  j6 \v\xA8\x7F \0(T"(\0! (" \0( \0("\x07k"  I\x1B"@  \x07 Y  (\0 j"6\0  ( k"6\v    K\x1B"@   Y  (\0 j"6\0  ( k6\v A\0:\0\0 \0 \0(,"6 \0 6 \v\b\0 \0K!\v\0 \0 \0(\0A\fk(\0j\xC0\v\0 \0 \0(\0A\fk(\0j\x81\v +\0 \0A\bk\xC0\v +\0 \0A\bk\x81\v\0 \0  )\bA\0  (\0(\0\v \0 \0\xB0!\v\x95\x7F~ (," ("I@  6, !\vB\x7F! +@ Aq"\x07E AF \x07AFqr\r\0 @  ( A j ,\0+A\0H\x1Bk\xAC! \v@@@ \0\v A\bq@ (\f (\bk\xAC!\b\f\v  (k\xAC!\b\f\v !\b\v  \b|"B\0S  Ur\r\0 A\bq!@ P\r\0 @ (\fE\r\v AqE\r\0 E\r\v @  6  (\b \xA7j6\f\v Aq@  ( \xA7j6\v ! +\v \0 +7\b \0B\x007\0\v\x99\b\x7F A\x7FF@A\0\v \0(\b! \0(\f! \0\x7F \0(" \0(G@ \0(,\f\v \0-\x000AqE@A\x7F\v \0(,!\x07 \0(! \0A j"A\0\xAA A + \0((A\xFF\xFF\xFF\xFF\x07qAk \0,\0+A\0N\x1B" \0 \0(  \0,\0+"\bA\0H" \x1B"6 \0  \0($ \b \x1Bj6 \0   kj"6  \x07 kj\v" Aj"  I\x1B"6, \0-\x000A\bq@ \0 6 \0 \0( \0A j \0,\0+A\0H\x1B"6\b \0   kj6\f\v \0 \xC0\xC3\v\x8E\x7F \0(," \0("I@ \0 6, !\v\x7FA\x7F \0(\f" \0(\bM\r\0 A\x7FF@ \0 6 \0 Ak6\fA\0\v \0-\x000AqE@A\x7F Ak-\0\0 A\xFFqG\r\v \0 6 \0 Ak"\x006\f \0 :\0\0 \v\v_\x7F \0(," \0("I@ \0 6, !\vA\x7F!@ \0-\x000A\bqE\r\0  \0("K\x7F \0 6  \v \0(\f"\0M\r\0 \0-\0\0!\v \v\0 \0 \0(\0A\fk(\0j\xC1\v +\0 \0A\bk\xC1\v \0 \0A\f\xA5\v\0 \0AjK \0A\bk\v\f\0 \0A\fjK \0\v\0 \0 \0(\0A\fk(\0j\xC1\v \0 \0A\xA5\v\f\0 \0AjK \0\v\0 \0 \0(\0A\fk(\0j\xC5\v \0 \0A\b\xA5\v\f\0 \0A\bjK \0\v\x96\x7F@@  L\r\0 \0(" \0("O@ \0 -\0\0 \0(\0(4\0A\x7FF\r Aj! Aj!\f \0  k"  k"  J\x1B"\x7F @   \xFC +\0\0\v \0( \v j6  j!  j!\f\v\0\v\v \v3\x7FA\x7F! \0 \0(\0($\0\0A\x7FG@ \0(\f"-\0\0! \0 Aj6\f\v \v\0A\x7F\v\x91\x7F@@  L\r\0@ \0(\f" \0("I@ \0  k"  k"  J\x1B"\x7F @   \xFC +\0\0\v \0(\f \v j6\f\f\v \0 \0(\0((\0\0"A\x7FF\r  :\0\0A!\v  j!  j!\f\v\v \v\0 \0B\x7F7\b \0B\x007\0\v\0 \0B\x7F7\b \0B\x007\0\v\0 \0\v\f\0 \0\xC3 \0!\v\f\0 \0(<\x9E\v;\x7F \0(<#\0Ak"\0$\0  A\xFFq \0A\bj\x9E! \0)\b! \0Aj$\0B\x7F  \x1B\v)\0  (\0A\x07jAxq"Aj6\0 \0 )\0 )\b\xC49\0\v\xB4\x7F|~#\0A\xB0k"\v$\0 \vA\x006,@ \xBD"B\0S@A!A\x9D ! \x9A"\xBD!\f\v A\x80q@A!A\xA0 !\f\vA\xA3 A\x9E Aq"\x1B! E!\v@ B\x80\x80\x80\x80\x80\x80\x80\xF8\xFF\0\x83B\x80\x80\x80\x80\x80\x80\x80\xF8\xFF\0Q@ \0A  Aj" A\xFF\xFF{q7 \0  3 \0A\xFB\rA\xED A q"\x1BA\xCEA\x97 \x1B  b\x1BA3 \0A   A\x80\xC0\0s7    J\x1B!\r\f\v \vAj!@@@  \vA,j\xD1" \xA0"D\0\0\0\0\0\0\0\0b@ \v \v(,"Ak6, A r"A\xE1\0G\r\f\v A r"A\xE1\0F\r \v(,!\f\f\v \v Ak"\f6, D\0\0\0\0\0\0\xB0A\xA2!\vA  A\0H\x1B! + \vA0jA\xA0A\0 \fA\0N\x1Bj"!\x07@ \x07 \xFC"6\0 \x07Aj!\x07  \xB8\xA1D\0\0\0\0e\xCD\xCDA\xA2"D\0\0\0\0\0\0\0\0b\r\0\v@ \fA\0L@ \f! \x07! !\b\f\v !\b \f! @A AO\x1B!@ \x07Ak" \bI\r\0 \xAD!\x1BB\0!@  5\0 \x1B\x86 |" B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}>\0 Ak" \bO\r\0\v B\x80\x94\xEB\xDCT\r\0 \bAk"\b >\0\v@ \b \x07"I@ Ak"\x07(\0E\r\v\v \v \v(, k" 6, !\x07 A\0J\r\0\v\v A\0H@ +AjA nAj! A\xE6\0F!@A A\0 k" A O\x1B!\r@  \bM@A\0A \b(\0\x1B!\x07\f\vA\x80\x94\xEB\xDC \rv!A\x7F \rtA\x7Fs!A\0! \b!\x07@ \x07 \x07(\0" \rv j6\0  q l! \x07Aj"\x07 I\r\0\vA\0A \b(\0\x1B!\x07 E\r\0  6\0 Aj!\v \v \v(, \rj" 6,  \x07 \bj"\b \x1B" Atj   kAu J\x1B! A\0H\r\0\v\vA\0! @  \bM\r\0  \bkAuA l! A +!\x07 \b(\0"A +I\r\0@ Aj!  \x07A +l"\x07O\r\0\v\v + A\0 A\xE6\0G\x1Bk A\xE7\0F +A\0Gqk"  kAuA lA kH@ \vA0jA\x84\`A\xA4b \fA\0H\x1Bj A\x80\xC8\0j"\fA m"Atj!\rA +!\x07 \f A lk"A\x07L@@ \x07A +l!\x07 Aj"A\bG\r\0\v\v@ \r(\0"\f \f \x07n" \x07lk"E \rAj" Fq\r\0@ AqE@D\0\0\0\0\0\0@C! \x07A\x80\x94\xEB\xDCG \b \rOr\r \rAk-\0\0AqE\r\vD\0\0\0\0\0@C!\vD\0\0\0\0\0\0\xE0?D\0\0\0\0\0\0\xF0?D\0\0\0\0\0\0\xF8?  F\x1BD\0\0\0\0\0\0\xF8?  \x07Av"F\x1B  K\x1B!@ \r\0 -\0\0A-G\r\0 \x9A! \x9A!\v \r \f k"6\0  \xA0 a\r\0 \r  \x07j"6\0 A\x80\x94\xEB\xDCO@@ \rA\x006\0 \b \rAk"\rK@ \bAk"\bA\x006\0\v \r \r(\0Aj"6\0 A\xFF\x93\xEB\xDCK\r\0\v\v  \bkAuA l! A +!\x07 \b(\0"A +I\r\0@ Aj!  \x07A +l"\x07O\r\0\v\v \rAj"   I\x1B!\v@ "\f \bM"\x07E@ Ak"(\0E\r\v\v@ A\xE7\0G@ A\bq!\f\v A\x7FsA\x7F +A +\x1B" J A{Jq"\x1B j! +A\x7FA~ \x1B j! A\bq"\r\0Aw!@ \x07\r\0 \fAk(\0"E\r\0A +!A\0! A +p\r\0@ "\x07Aj!  A +l"pE\r\0\v \x07A\x7Fs!\v \f kAuA l! A_qA\xC6\0F@A\0! +  jA k"A\0 A\0J\x1B"  +J\x1B! +\f\vA\0! +  j jA k"A\0 A\0J\x1B"  +J\x1B! +\vA\x7F!\r +A\xFD\xFF\xFF\xFF\x07A\xFE\xFF\xFF\xFF\x07 + r"\x1BJ\r + A\0GjAj!@ A_q"\x07A\xC6\0F@ A\xFF\xFF\xFF\xFF\x07sJ\r A\0 A\0J\x1B!\f\v  Au"s k\xAD x"kAL@@ Ak"A0:\0\0  kAH\r\0\v\v Ak" :\0\0 AkA-A+ A\0H\x1B:\0\0  k" A\xFF\xFF\xFF\xFF\x07sJ\r\v  j" A\xFF\xFF\xFF\xFF\x07sJ\r \0A   j" 7 \0  3 \0A0  A\x80\x80s7@@@ \x07A\xC6\0F@ \vAjA r!  \b \b K\x1B"!\b@ \b5\0 x!@  \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v  G\r\0 Ak"A0:\0\0\v \0   k3 \bAj"\b M\r\0\v @ \0A\x9AA3\v +A\0L \b \fOr\r@ \b5\0 x" \vAjK@@ Ak"A0:\0\0  \vAjK\r\0\v\v \0 A + +A N\x1B3 +A k! \bAj"\b \fO\r +A J ! +\r\0\v\f\v@ +A\0H\r\0 \f \bAj \b \fI\x1B! \vAjA r!\f \b!\x07@ \f \x075\0 \fx"F@ Ak"A0:\0\0\v@ \x07 \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v \0 A3 Aj! + rE\r\0 \0A\x9AA3\v \0  \f k" +  +H\x1B3 + k! + \x07Aj"\x07 O\r +A\0N\r\0\v\v \0A0 +AjAA\07 \0   k3\f\v +!\v \0A0 A jA A\07\v \0A  A\x80\xC0\0s7   J\x1B!\r\f\v  AtAuA qj! @ A\vK\r\0A\f k!D\0\0\0\0\0\x000@!@ D\0\0\0\0\0\x000@\xA2! Ak"\r\0\v -\0\0A-F@  \x9A \xA1\xA0\x9A!\f\v  \xA0 \xA1!\v  \v(,"\x07 \x07Au"s k\xAD x"F@ Ak"A0:\0\0 \v(,!\x07\v Ar! + A q!\f Ak" Aj:\0\0 AkA-A+ \x07A\0H\x1B:\0\0 A\bqE A\0Lq!\b \vAj!\x07@ \x07" \xFC"A\x90\xF5\0j-\0\0 \fr:\0\0  \xB7\xA1D\0\0\0\0\0\x000@\xA2"D\0\0\0\0\0\0\0\0a \bq \x07Aj"\x07 \vAjkAGrE@ A.:\0 Aj!\x07\v D\0\0\0\0\0\0\0\0b\r\0\vA\x7F!\r A\xFD\xFF\xFF\xFF\x07 +  k"\bj"kJ\r\0 \0A   Aj \x07 \vAj"k"\x07 \x07Ak H\x1B \x07 \x1B"j" 7 \0 +3 \0A0   A\x80\x80s7 \0  \x073 \0A0  \x07kA\0A\07 \0  \b3 \0A   A\x80\xC0\0s7    J\x1B!\r\v \vA\xB0j$\0 \r\v\0B\0\v\xD6\x07\x7F#\0A k"$\0  \0("6 \0(!  6  6   k"6  j! Aj!A!\x07\x7F@@@ \0(< A A\fj\v\x9E@ !\f\v@  (\f"F\r A\0H@ !\f\v A\bA\0  ("\bK" \x1Bj"  \bA\0 \x1Bk"\b (\0j6\0 A\fA \x1Bj" (\0 \bk6\0  k! \0(< " \x07 k"\x07 A\fj\v\x9EE\r\0\v\v A\x7FG\r\v \0 \0(,"6 \0 6 \0  \0(0j6 \f\v \0A\x006 \0B\x007 \0 \0(\0A r6\0A\0 \x07AF\r\0  (k\v A j$\0\v\x89\x7F#\0Ak"\0$\0@ \0A\fj \0A\bj\r\0A\xEC\xDB \0(\fAtAj/"6\0 E\r\0 \0(\b/"@A\xEC\xDB(\0" \0(\fAtjA\x006\0  E\r\vA\xEC\xDBA\x006\0\v \0Aj$\0A\x84\xCEA\x006\0A\x80\xCEA6\0\x95A\x84\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\x80\xCE6\0A\xA4\xCEA.6\0A\xA8\xCEA\x006\0\xCCA\xA8\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\xA4\xCE6\0A\xCC\xCFA\xD4\xCE6\0A\xA4\xCFA\x80\x806\0A\xA0\xCFA\xC0\xEC6\0A\x84\xCFA*6\0A\xA8\xCFA\xB0\xCB(\x006\0\v\v\xBF\xBE(\0A\x80\b\v\x940123456789abcdefghijklmnopqrstuvwxyz\0load_spz\0infinity\0February\0January\0July\0Thursday\0Tuesday\0Wednesday\0Saturday\0Sunday\0Monday\0Friday\0May\0%m/%d/%y\0-+ 0X0x\0-0X+0X 0X-0x+0x 0x\0Nov\0Thu\0August\0unsigned short\0unsigned int\0invalid literal/lengths set\0invalid code lengths set\0unknown header flags set\0invalid distances set\0get\0Oct\0float\0invalid bit length repeat\0Sat\0numPoints\0colors\0UnpackOptions\0positions\0rotations\0too many length or distance symbols\0invalid stored block lengths\0scales\0alphas\0[SPZ: ERROR] Check failed: %s:%d: %s\0vf32_ptr\0Apr\0vector\0money_get error\0[SPZ ERROR] deserializePackedGaussians: read error\0October\0November\0September\0December\0unsigned char\0Mar\0/emsdk/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp\0Sep\0%I:%M:%S %p\0Sun\0Jun\0Mon\0nan\0Jan\0coordinateSystem\0CoordinateSystem\0Jul\0bool\0April\0invalid code -- missing end-of-block\0incorrect header check\0incorrect length check\0incorrect data check\0push_back\0invalid distance too far back\0Fri\0sh\0header crc mismatch\0March\0Aug\0unsigned long long\0unsigned long\0std::wstring\0basic_string\0std::string\0std::u16string\0std::u32string\0inf\x000123456789abcdef\0%.0Lf\0%Lf\0resize\0invalid window size\0true\0Tue\0false\0invalid block type\0June\0double\0shDegree\0bad_array_new_length was thrown in -fno-exceptions mode\0invalid literal/length code\0invalid distance code\0RawGaussianCloud\0unknown compression method\0[SPZ ERROR] deserializePackedGaussians: header not found\0%0*lld\0%*lld\0+%lld\0%+.4ld\0void\0locale not supported\0antialiased\0Wed\0%Y-%m-%d\0[SPZ ERROR] deserializePackedGaussians: Too many points: %d\0[SPZ ERROR] deserializePackedGaussians: Unsupported SH degree: %d\0[SPZ ERROR] deserializePackedGaussians: version not supported: %d\0Dec\0./spz/src/cc/load-spz.cc\0Feb\0%a %b %d %H:%M:%S %Y\0POSIX\0VectorUInt8T\0%H:%M:%S\0NAN\0PM\0AM\0%H:%M\0LC_ALL\0ASCII\0LANG\0RUF\0LUF\0INF\0RDF\0LDF\0UNSPECIFIED\0C\0RUB\0LUB\0RDB\0LDB\0catching a class without an object?\0emscripten::memory_view<short>\0emscripten::memory_view<unsigned short>\0emscripten::memory_view<int>\0emscripten::memory_view<unsigned int>\0emscripten::memory_view<float>\0emscripten::memory_view<uint8_t>\0emscripten::memory_view<int8_t>\0emscripten::memory_view<uint16_t>\0emscripten::memory_view<int16_t>\0emscripten::memory_view<uint64_t>\0emscripten::memory_view<int64_t>\0emscripten::memory_view<uint32_t>\0emscripten::memory_view<int32_t>\0emscripten::memory_view<char>\0emscripten::memory_view<unsigned char>\0emscripten::memory_view<signed char>\0emscripten::memory_view<long>\0emscripten::memory_view<unsigned long>\0emscripten::memory_view<double>\x000123456789\0C.UTF-8\x0001234567\0VectorFloat32\x0001\x001.3.1\0.\0-\0(packed.alphas.size()) == (numPoints)\0(null)\0(packed.colors.size()) == (numPoints * 3)\0(packed.scales.size()) == (numPoints * 3)\0(packed.sh.size()) == (numPoints * shDim * 3)\0(packed.rotations.size()) == (numPoints * (packed.usesQuaternionSmallestThree ? 4 : 3))\0(packed.positions.size()) == (numPoints * 3 * (usesFloat16 ? 2 : 3))\0%\0length_error was thrown in -fno-exceptions mode with message "%s"\0[SPZ: ERROR] Unsupported SH degree: %d +\0 \0\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0A\xA0 \v\xB60\0\0\xF0c\0\0\xF0c\0\0P\0\0\xA4d\0\x008\0\0N3spz13GaussianCloudE\0\0\0\xA4d\0\0X\0\0N3spz13UnpackOptionsE\0ppiip\0\xF0c\0\0|\0\0\xA4d\0\0\x84\0\0NSt3__26vectorIfNS_9allocatorIfEEEE\0ipp\0(e\0\0\xD4\0\0\0\0\0\0\0\0\0\xEC\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIfEE\0\0\0\0\xCCd\0\0\xF8\0\0(\0\0NSt3__227__optional_move_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\x004\0\0d\0\0NSt3__227__optional_copy_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\0p\0\0\x98\0\0NSt3__220__optional_move_baseIfLb1EEE\0\0\0\xCCd\0\0\xA4\0\0\xCC\0\0NSt3__220__optional_copy_baseIfLb1EEE\0\0\0\xCCd\0\0\xD8\0\0\0\0NSt3__223__optional_storage_baseIfLb0EEE\0\0\0\0\xA4d\0\0\f\0\0NSt3__224__optional_destruct_baseIfLb1EEE\0\0\0\xA4d\0\0@\0\0NSt3__218__sfinae_ctor_baseILb1ELb1EEE\0\0\xA4d\0\0p\0\0NSt3__220__sfinae_assign_baseILb1ELb1EEE\0\0\0\0\x84e\0\0\xAC\0\0\0\0\0\0|\0\0PNSt3__26vectorIfNS_9allocatorIfEEEE\0\0\0\0\x84e\0\0\xE4\0\0\0\0\0|\0\0PKNSt3__26vectorIfNS_9allocatorIfEEEE\0pp\0v\0vp\0\0\0\x9C\0\0pp\0\0\x98c\0\0|\0\x008d\0\0vppf\0\0\0\0\x98c\0\0|\0\0\xFCc\0\x008d\0\0vppif\0\0\0\xFCc\0\0|\0\0ipp\0\\\0\x008d\0\0\xA4d\0\0d\0\0N10emscripten3valE\0\0\xAC\0\0|\0\0\xFCc\0\0pppi\0\0\0\0\0\0\0\0\xA8c\0\0|\0\0\xFCc\0\x008d\0\0ippif\0\0\0(e\0\0\xD0\0\0\0\0\0\0\0\0\0\xE8\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIhEE\0\0\0\0\xCCd\0\0\xF4\0\0$\0\0NSt3__227__optional_move_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\x000\0\0\`\0\0NSt3__227__optional_copy_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\0l\0\0\x94\0\0NSt3__220__optional_move_baseIhLb1EEE\0\0\0\xCCd\0\0\xA0\0\0\xC8\0\0NSt3__220__optional_copy_baseIhLb1EEE\0\0\0\xCCd\0\0\xD4\0\0\0\0\0NSt3__223__optional_storage_baseIhLb0EEE\0\0\0\0\xA4d\0\0\b\0\0NSt3__224__optional_destruct_baseIhLb1EEE\0\0\0\xA4d\0\0<\0\0NSt3__26vectorIhNS_9allocatorIhEEEE\0\x84e\0\0p\0\0\0\0\0\x004\0\0PNSt3__26vectorIhNS_9allocatorIhEEEE\0\0\0\0\x84e\0\0\xA8\0\0\0\0\x004\0\0PKNSt3__26vectorIhNS_9allocatorIhEEEE\0pp\0vp\0\`\0\0pp\0\0\x98c\0\x004\0\0\xC0c\0\0vppi\0\0\0\0\x98c\0\x004\0\0\xFCc\0\0\xC0c\0\0vppii\0\0\0\xFCc\0\x004\0\0ipp\0\\\0\0\xC0c\0\0\xA8\0\x004\0\0\xFCc\0\0pppi\0\0\0\0\xA8c\0\x004\0\0\xFCc\0\0\xC0c\0\0ippii\0p\0vp\0ipp\0vppi\0ipp\0vppi\0ppp\0vppp\0\0\0Xd\0\0p\0\0N3spz16CoordinateSystemE\0p\0vp\0ipp\0vppi\0\0\0\0\0\0\0\0\0\b\0\0\0\0\0\0\xA4d\0\0\xB0\0\0NSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\xA4d\0\0\xF8\0\0NSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE\0\0\xA4d\0\0@\0\0NSt3__212basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE\0\0\0\xA4d\0\0\x8C\0\0NSt3__212basic_stringIDiNS_11char_traitsIDiEENS_9allocatorIDiEEEE\0\0\0\xA4d\0\0\xD8\0\0N10emscripten11memory_viewIcEE\0\0\xA4d\0\0\0\0\0N10emscripten11memory_viewIaEE\0\0\xA4d\0\0(\0\0N10emscripten11memory_viewIhEE\0\0\xA4d\0\0P\0\0N10emscripten11memory_viewIsEE\0\0\xA4d\0\0x\0\0N10emscripten11memory_viewItEE\0\0\xA4d\0\0\xA0\0\0N10emscripten11memory_viewIiEE\0\0\xA4d\0\0\xC8\0\0N10emscripten11memory_viewIjEE\0\0\xA4d\0\0\xF0\0\0N10emscripten11memory_viewIlEE\0\0\xA4d\0\0\0\0N10emscripten11memory_viewImEE\0\0\xA4d\0\0@\0\0N10emscripten11memory_viewIxEE\0\0\xA4d\0\0h\0\0N10emscripten11memory_viewIyEE\0\0\xA4d\0\0\x90\0\0N10emscripten11memory_viewIfEE\0\0\xA4d\0\0\xB8\0\0N10emscripten11memory_viewIdEE\0A\xE43\v\xA1(\x960\x07w,a\xEE\xBAQ \x99\xC4m\x07\x8F\xF4jp5\xA5c\xE9\xA3\x95d\x9E2\x88\xDB\xA4\xB8\xDCy\xE9\xD5\xE0\x88\xD9\xD2\x97+L\xB6 \xBD|\xB1~\x07-\xB8\xE7\x91\xBF\x90d\xB7\xF2 \xB0jHq\xB9\xF3\xDEA\xBE\x84}\xD4\xDA\xEB\xE4\xDDmQ\xB5\xD4\xF4\xC7\x85\xD3\x83V\x98l\xC0\xA8kdz\xF9b\xFD\xEC\xC9e\x8AO\\\xD9lcc=\xFA\xF5\r\b\x8D\xC8 n;^iL\xE4A\`\xD5rqg\xA2\xD1\xE4<G\xD4K\xFD\x85\r\xD2k\xB5 +\xA5\xFA\xA8\xB55l\x98\xB2B\xD6\xC9\xBB\xDB@\xF9\xBC\xAC\xE3l\xD82u\\\xDFE\xCF\r\xD6\xDCY=\xD1\xAB\xAC0\xD9&:\0\xDEQ\x80Q\xD7\xC8a\xD0\xBF\xB5\xF4\xB4!#\xC4\xB3V\x99\x95\xBA\xCF\xA5\xBD\xB8\x9E\xB8(\b\x88_\xB2\xD9\f\xC6$\xE9\v\xB1\x87|o/LhX\xABa\xC1=-f\xB6\x90A\xDCvq\xDB\xBC \xD2\x98*\xD5\xEF\x89\x85\xB1q\xB5\xB6\xA5\xE4\xBF\x9F3\xD4\xB8\xE8\xA2\xC9\x07x4\xF9\0\x8E\xA8 \x96\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\vGLC_CTYPE\0\0\0\0LC_NUMERIC\0\0LC_TIME\0\0\0\0\0LC_COLLATE\0\0LC_MONETARY\0LC_MESSAGES\0A\x84\xFE\0\v-\x80\xDE(\0\x80\xC8M\0\0\xA7v\0\x004\x9E\0\x80\xC7\0\x80\x9F\xEE\0\0~\x80\\@\x80\xE9g\0\xC8\x90\0U\xB8.\0A\xC0\xFE\0\v\xD2Sun\0Mon\0Tue\0Wed\0Thu\0Fri\0Sat\0Sunday\0Monday\0Tuesday\0Wednesday\0Thursday\0Friday\0Saturday\0Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec\0January\0February\0March\0April\0May\0June\0July\0August\0September\0October\0November\0December\0AM\0PM\0%a %b %e %T %Y\0%m/%d/%y\0%H:%M:%S\0%I:%M:%S %p\0\0\0%m/%d/%y\x000123456789\0%a %b %e %T %Y\0%H:%M:%S\0\0\0\0\0^[yY]\0^[nN]\0yes\0no\0A\xA0\x81\v\xE1\xD1t\x9E\0W\x9D\xBD*\x80pR\xFF\xFF>' +\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\0\x005\0\0\0q\0\0\0k\xFF\xFF\xFF\xCE\xFB\xFF\xFF\x92\xBF\xFF\xFF\0\0\0\0\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x07\b \xFF\xFF\xFF\xFF\xFF\xFF\xFF +\v\f\r\x1B !"#\xFF\xFF\xFF\xFF\xFF\xFF +\v\f\r\x1B !"#\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xF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\x9CI\0\0\0\0\0\xC4N\0\0\0\0\0\0NSt3__27num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0(e\0\0\xDCN\0\0\0\0\0\0\0\0\0\xF4N\0\0\0\0\0\0NSt3__29__num_getIcEE\0\0\0\xA4d\0\0\xFCN\0\0NSt3__214__num_get_baseE\0\0\0\0\0\0\0\0XO\0\0\x98\0\0\0\xE5\0\0\0v\0\0\0\xE6\0\0\0\xE7\0\0\0\xE8\0\0\0\xE9\0\0\0\xEA\0\0\0\xEB\0\0\0\xEC\0\0\0\xED\0\0\0\xEE\0\0\0\xEF\0\0\0\xF0\0\0\0(e\0\0xO\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xBCO\0\0\0\0\0\0NSt3__27num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\xD4O\0\0\0\0\0\0\0\0\0\xF4N\0\0\0\0\0\0NSt3__29__num_getIwEE\0\0\0\0\0\0\0 P\0\0\x98\0\0\0\xF1\0\0\0v\0\0\0\xF2\0\0\0\xF3\0\0\0\xF4\0\0\0\xF5\0\0\0\xF6\0\0\0\xF7\0\0\0\xF8\0\0\0\xF9\0\0\0(e\0\0@P\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x84P\0\0\0\0\0\0NSt3__27num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0(e\0\0\x9CP\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIcEE\0\0\0\xA4d\0\0\xBCP\0\0NSt3__214__num_put_baseE\0\0\0\0\0\0\0\0\fQ\0\0\x98\0\0\0\xFA\0\0\0v\0\0\0\xFB\0\0\0\xFC\0\0\0\xFD\0\0\0\xFE\0\0\0\xFF\0\0\0\0\0\0\0\0\0\0(e\0\0,Q\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0pQ\0\0\0\0\0\0NSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\x88Q\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIwEE\0\0\0\0\0\0\0\xF4Q\0\0\0\0\0\0v\0\0\0\0\0\0\0\x07\0\0\b\0\0 \0\0 +\0\0\v\0\0\xF8\xFF\xFF\xFF\xF4Q\0\0\f\0\0\r\0\0\0\0\0\0\0\0\0\0\0\0(e\0\0R\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0\x80R\0\0\0\b\0\0NSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0lR\0\0NSt3__29time_baseE\0\0\xA4d\0\0\x88R\0\0NSt3__220__time_get_c_storageIcEE\0\0\0\0\0\0\0\0S\0\0\0\0\0\0v\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1B\0\0\xF8\xFF\xFF\xFF\0S\0\0\0\0\0\0\0\0\0\0 \0\0!\0\0"\0\0(e\0\0(S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0pS\0\0\0\b\0\0NSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\xA4d\0\0xS\0\0NSt3__220__time_get_c_storageIwEE\0\0\0\0\0\0\0\xB4S\0\0#\0\0$\0\0v\0\0\0%\0\0(e\0\0\xD4S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0$T\0\0NSt3__210__time_putE\0\0\0\0\0\0\0\0TT\0\0&\0\0'\0\0v\0\0\0(\0\0(e\0\0tT\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\0\0\0\0\xF4T\0\0\x98\0\0\0)\0\0v\0\0\0*\0\0+\0\0,\0\0-\0\0.\0\0/\0\x000\0\x001\0\x002\0\0(e\0\0U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb0EEE\0\xA4d\0\x008U\0\0NSt3__210money_baseE\0\0\0\0\0\0\0\0\x88U\0\0\x98\0\0\x003\0\0v\0\0\x004\0\x005\0\x006\0\x007\0\x008\0\x009\0\0:\0\0;\0\0<\0\0(e\0\0\xA8U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb1EEE\0\0\0\0\0\xFCU\0\0\x98\0\0\0=\0\0v\0\0\0>\0\0?\0\0@\0\0A\0\0B\0\0C\0\0D\0\0E\0\0F\0\0(e\0\0V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb0EEE\0\0\0\0\0pV\0\0\x98\0\0\0G\0\0v\0\0\0H\0\0I\0\0J\0\0K\0\0L\0\0M\0\0N\0\0O\0\0P\0\0(e\0\0\x90V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb1EEE\0\0\0\0\0\xC8V\0\0\x98\0\0\0Q\0\0v\0\0\0R\0\0S\0\0(e\0\0\xE8V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000W\0\0\0\0\0\0NSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\x008W\0\0NSt3__211__money_getIcEE\0\0\0\0\0\0\0\0pW\0\0\x98\0\0\0T\0\0v\0\0\0U\0\0V\0\0(e\0\0\x90W\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xD8W\0\0\0\0\0\0NSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\0\xE0W\0\0NSt3__211__money_getIwE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\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0\0\0\0\0A\0\0\0M\0\0\0\0\0\0\0P\0\0\0M\0A\x94\xBB\v\x98 +\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0 +\0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0\0g\0\0h\0\0i\0\0j\0\0k\0\0\xCCd\0\0pc\0\0b\0\0N10__cxxabiv123__fundamental_type_infoE\0Pc\0\0\xA0c\0\0v\0Dn\0\0\0\0Pc\0\0\xB0c\0\0b\0\0\0Pc\0\0\xBCc\0\0c\0\0\0Pc\0\0\xC8c\0\0h\0\0\0Pc\0\0\xD4c\0\0a\0\0\0Pc\0\0\xE0c\0\0s\0\0\0Pc\0\0\xECc\0\0t\0\0\0Pc\0\0\xF8c\0\0i\0\0\0Pc\0\0d\0\0j\0\0\0Pc\0\0d\0\0l\0\0\0Pc\0\0d\0\0m\0\0\0Pc\0\0(d\0\0x\0\0\0Pc\0\x004d\0\0y\0\0\0Pc\0\0@d\0\0f\0\0\0Pc\0\0Ld\0\0d\0\0\0\0\0\0\0ld\0\0g\0\0l\0\0i\0\0j\0\0m\0\0\xCCd\0\0xd\0\0b\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0\0\0\0\0Hb\0\0g\0\0n\0\0i\0\0j\0\0o\0\0p\0\0q\0\0r\0\0\0\0\0\0\xECd\0\0g\0\0s\0\0i\0\0j\0\0o\0\0t\0\0u\0\0v\0\0\xCCd\0\0\xF8d\0\0Hb\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0He\0\0g\0\0w\0\0i\0\0j\0\0o\0\0x\0\0y\0\0z\0\0\xCCd\0\0Te\0\0Hb\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0\xA8b\0\0g\0\0{\0\0i\0\0j\0\0|\0\0\xA4d\0\0\xA0e\0\0St9type_info\0A\xB1\xCB\v\b \0\0\0\0\0\0\0A\xC4\xCB\v1\0A\xDC\xCB\v2\0\0\x003\0\0\0\xF8g\0\0\0\0A\xF4\xCB\v\0A\x84\xCC\v\xFF\xFF\xFF\xFF +\0A\xC8\xCC\v!\xB8e\0\0@v\0%m/%d/%y\0\0\0\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v +2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),le((await B(ne)).instance))})(),(function(){function le(){var ne;if(o.calledRun=!0,!m){if(C=!0,Cy.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var Te=o.postRun.shift();k.push(Te)}j(k)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)q();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),le()},1)):le()})(),C?r=o:r=new Promise((le,ne)=>{A=le,b=ne}),r}var Xv=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,s=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let a=0;a<r;a++)s[a]=n(s[a]);return s},eqe=e=>1/(1+Math.exp(-e)),tqe=e=>t=>t*e+.5,nqe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:Xv(e,t.positions),scales:Xv(e,t.scales,Math.exp),rotations:Xv(e,t.rotations),alphas:Xv(e,t.alphas,eqe),colors:Xv(e,t.colors,tqe(i)),sh:Xv(e,t.sh)}},iqe=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},Rpe=async(e,t)=>{var n;let i=await QWe(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(o,r.length,{coordinateSystem:s}),c=nqe(i,a,t);return iqe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var rqe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var oqe=[0,9,24,45],sqe=14,aqe=1.6*1024*1024*1024;function cqe(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(o=Math.max(o,parseInt(a[1],10)))}return{numPoints:r.count,shDegree:o}}function lqe(e,t){let n=sqe+(oqe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var x$=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Tt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=uqe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._spzError)&&T$(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=cqe(this._gltf,this._primitive);if(l(n)){let r=lqe(n.numPoints,n.shDegree);if(r>aqe){let o=Math.round(r/1048576);return T$(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=Rpe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=fqe(this,i)}unload(){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}};async function uqe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;T$(e,n)}}function T$(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load SPZ",t)}async function fqe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Tt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var mM=x$;function pM(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}pM.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=jp.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new pM({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(pM.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}}});pM.BATCH_TABLE_CLASS_NAME="_batchTable";var tm=pM;function U6(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}U6.fromJson=function(e){return new U6({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(U6.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 gM=U6;function z6(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=e.valueType??Lt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}z6.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return gM.fromJson(r)});return new z6({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(z6.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 _M=z6;function V6(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=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=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}V6.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=_M.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]=tm.fromJson({id:i,class:e.classes[i],enums:t}));return new V6({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(V6.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 Gl=V6;var E$=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Gl.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=dqe(this),this._promise)}unload(){this._schema=void 0}};async function dqe(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Gl.fromJson(n),e._state=Tt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Tt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var Zy=E$;var Bd={};function Kv(e){return vd(e.url)}function yM(e){let{byteOffset:t,byteLength:n}=e,i=Yy(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function hqe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function Ope(e,t){return`${Kv(e)}-buffer-id-${t}`}function $v(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return Kv(r)}return Ope(n,t)}function C$(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=$v(a,s,n,i),u=yM(o);return`${c}-range-${u}`}function Mpe(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=$v(a,s,n,i),u=yM(o);return`${c}-range-${u}`}function Npe(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return Kv(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=$v(u,c,n,i),d=yM(a);return`${f}-range-${d}`}function mqe(e,t){let n=Uu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Bd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${Kv(n)}`};Bd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${Kv(t)}`};Bd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Ope(t,n)}`};Bd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${Kv(t)}`};Bd.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s],c=Yy(o);l(c)&&(s=c.buffer);let u=$v(a,s,i,r),f=yM(o);return`buffer-view:${u}-range-${f}`};Bd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${C$(t,n,i,r)}`};Bd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${Mpe(t,n,i,r)}`};Bd.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${Mpe(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${C$(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=$v(y,m,n,i),b=yM(g);return`vertex-buffer:${A}-range-${b}${p}`};Bd.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${C$(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=$v(m,g,i,r),A=hqe(f,p);return`index-buffer:${y}-accessor-${A}${u}`};Bd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${Npe(t,n,i,r)}`};Bd.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}=e,a=n.index,c=Uu.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=Npe(t,c,i,r),f=mqe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Wl=Bd;function AM(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}AM.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};AM.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,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};AM.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};AM.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 bM=AM;function Nn(){}Nn.cacheEntries={};Nn.statistics=new bM;function pqe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new pqe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Wl.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new Zy({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=Wl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new vx({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=Wl.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new vx({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=Wl.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new jv({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=Wl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new Bv({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,s=Wl.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new kv({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,s=Wl.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new mM({resourceCache:Nn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=Wl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Nn.get(y);return l(A)?A:(A=new Yv({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Nn.add(A))};Nn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=Wl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:u,loadTypedArray:f}),p=Nn.get(d);return l(p)?p:(p=new zv({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=Wl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new Uv({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a=!0}=e,c=Wl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new qv({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[Yv,zv,kv,qv,Uv,Bv,vx,Zy,jv],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Li=Nn;function fc(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(fc.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}}});fc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};fc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};fc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};fc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};fc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};fc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};fc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};fc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Hs.OCTREE&&(t=3),e>>t};fc.fromSubtreeJson=async function(e,t,n,i,r){let o=new fc(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=gqe(n);let a=s.json;o._subtreeJson=a;let c;if(er(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let x=a.tileMetadata;c=a.propertyTables[x]}let u=[];if(l(a.contentMetadata)){let x=a.contentMetadata.length;for(let T=0;T<x;T++){let E=a.contentMetadata[T];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new JO({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],er(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=_qe(a.buffers),y=yqe(a.bufferViews,m);Aqe(a,y),l(c)&&Lpe(c,y);for(let x=0;x<u.length;x++){let T=u[x];Lpe(T,y)}let A=await bqe(o,m,s.binary),b=Tqe(y,A);return Eqe(o,a,i,b),l(c)&&(Cqe(o,i,b),Sqe(o)),vqe(o,i,b),wqe(o),o._ready=!0,o};function gqe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Ro(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function _qe(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 yqe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function Aqe(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 r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Lpe(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=o.values??o.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=o.stringOffsets??o.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function bqe(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=xqe(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function xqe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Li.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function Tqe(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function Eqe(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=er(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=v$(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=v$(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=v$(t.childSubtreeAvailability,i,a)}function v$(e,t,n,i){if(l(e.constant))return new Lv({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new Lv({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Cqe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new Ld({class:a,count:r,properties:i.properties,bufferViews:n})}function vqe(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new Ld({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function Fpe(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function Sqe(e){let t=Fpe(e._tileAvailability);e._tileJumpBuffer=t}function wqe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=Fpe(r);t.push(o)}}fc.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};fc.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function Iqe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Pqe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}fc.prototype.getTileMetadataView=function(e){let t=Iqe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Fv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};fc.prototype.getContentMetadataView=function(e,t){let n=Pqe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new Fv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};fc.prototype.isDestroyed=function(){return!1};fc.prototype.destroy=function(){return l(this._bufferLoader)&&Li.unload(this._bufferLoader),ue(this)};var Eg=fc;var xM={};function Bpe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function S$(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function kpe(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 w$(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}xM.encode2D=function(e,t){return(Bpe(e)|Bpe(t)<<1)>>>0};xM.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=kpe(e),t[1]=kpe(e>>1),t};xM.encode3D=function(e,t,n){return S$(e)|S$(t)<<1|S$(n)<<2};xM.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=w$(e),t[1]=w$(e>>1),t[2]=w$(e>>2),t};var Qy=xM;function yo(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===Hs.OCTREE&&(this.z=e.z)}Object.defineProperties(yo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Hs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Hs.OCTREE?Qy.encode3D(this.x,this.y,this.z):Qy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Hs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});yo.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===Hs.OCTREE){let r=(this.z<<e.level)+e.z;return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};yo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===Hs.OCTREE){let o=Math.floor(this.z/t);return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};yo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Hs.OCTREE){let o=e.z%n;return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};yo.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===Hs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new yo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};yo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};yo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};yo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===Hs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};yo.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===Hs.OCTREE?this.z===e.z:!0)};yo.prototype.isImplicitTilesetRoot=function(){return this.level===0};yo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};yo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};yo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Hs.OCTREE&&(e.z=this.z),e};var Upe=[0,0,0];yo.fromMortonIndex=function(e,t,n,i){let r;return e===Hs.OCTREE?(r=Qy.decode3D(i,Upe),new yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Qy.decode2D(i,Upe),new yo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};yo.fromTileIndex=function(e,t,n){let i,r,o;return e===Hs.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(D.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),yo.fromMortonIndex(e,t,i,o)};var qp=yo;var P$=Qo(Tf(),1);var I$,zpe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",j6={};j6.defaultAccessToken=zpe;j6.defaultServer=new De({url:"https://api.cesium.com/"});j6.getDefaultTokenCredit=function(e){if(e===zpe){if(!l(I$)){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>`;I$=new It(t,!0)}return I$}};var zu=j6;function nl(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:Dqe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new P$.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(nl.prototype=Object.create(De.prototype),nl.prototype.constructor=nl);nl.fromAssetId=function(e,t){let n=nl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new nl(i,n)})};Object.defineProperties(nl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=nl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});nl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=zu.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};nl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(nl.prototype),De.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};nl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};nl.prototype._makeRequest=function(e){return this._isExternal||new P$.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=D$(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};nl._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??zu.defaultServer,i=t.accessToken??zu.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=D$(r.headers),n.getDerivedResource(r)};function D$(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}nl._addClientHeaders=D$;function Dqe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Ho=nl;function Rqe(e,t,n){let i=er(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!er(r,"3DTILES_bounding_volume_S2")&&!er(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=Oqe(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Je(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Mqe(t),this.subdivisionScheme=Hs[i.subdivisionScheme],this.branchingFactor=Hs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Oqe(e){if(er(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 Mqe(e){let t=Je(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 Yp=Rqe;var Vpe={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"};Object.freeze(Vpe);var kd=Vpe;function Xp(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??ee.WGS84,this._tilingScheme=new Qi({ellipsoid:this._ellipsoid}),this._subtreeCache=new Mx({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}Xp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new Xp(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=Gl.fromJson(c);return r._tileset0=new Yp(n,s,u),r._tileset1=new Yp(n,a,u),r};Xp.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return Xp.fromUrl(n,t)};var Nqe=new Array(3);Xp.prototype.requestTileGeometry=async function(e,t,n,i){let r=Hpe(n,e),o=r===0?this._tileset0:this._tileset1,s=Gpe(o,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,a),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(r,a),u===void 0){let v=new Uint8Array(E);u=await Eg.fromSubtreeJson(d._resource,void 0,v,o,a),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>Dx(new Uint8Array(x))),b=Nqe;b[0]=p,b[1]=A,b[2]=f?A.then(x=>Lqe(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],E=x[1],v=x[2],S=T.getTileMetadataView(s),I=S.getPropertyBySemantic(kd.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(kd.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(kd.TILE_BOUNDING_SPHERE),L=ce.unpack(O,0,new ce),_=S.getPropertyBySemantic(kd.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),P=d._ellipsoid,M=en.fromRectangle(w,I,R,P,new en),F=d.getLevelMaximumGeometricError(n)*5,V=H6(o,T,s,0,0),B=H6(o,T,s,1,0),j=H6(o,T,s,0,1),k=H6(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new YO({gltf:E,minimumHeight:I,maximumHeight:R,boundingSphere:L,orientedBoundingBox:M,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:v});return Promise.resolve(q)}catch(x){console.log(`Could not load subtree: ${r} ${a.level} ${a.x} ${a.y}: ${x}`),console.log(`Could not load tile: ${r} ${s.level} ${s.x} ${s.y}: ${x}`);return}};Xp.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=Hpe(n,e),o=r===0?this._tileset0:this._tileset1,s=Gpe(o,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(r,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let u=a.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function Hpe(e,t){let n=1<<e;return t/n|0}function Gpe(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new qp({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function Lqe(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new Zy({schema:n.schema});await i.load();let r=i.schema,o,s;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],s=o.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===o.id);if(!l(a))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=a.properties[s.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Li.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await xg({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function H6(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=R$(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function R$(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new qp({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}Xp.prototype.loadTileDataAvailability=function(e,t,n){};Xp.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(Xp.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function Fqe(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function Mx(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new _g({comparator:Mx.comparator}),this._provider=e.provider}Mx.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};Mx.prototype.addSubtree=function(e,t){let n=new Fqe(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};Mx.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===s)return c.subtree}};Mx.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,s=o.subtreeLevels,a=R$(o,0,0,0),c=this.find(r,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-D.PI,m=+D.PI,y=D.lerp(g,m,r/2),A=D.lerp(g,m,(r+1)/2),b=-D.PI*.5,x=+D.PI*.5,T=0,E=0,v=!0;for(;v;){let I=1/(1<<p),R=(A-y)*I,O=y+f*R,L=(x-b)*I,_=b+d*L;T=(t-O)/R,E=(n-_)/L;let C=jpe(o,u,T,E,s);if(c.childSubtreeIsAvailableAtCoordinates(C)){let w=this.find(r,C);if(w!==void 0)c=w,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else v=!1}let S;for(let I=0;I<s;I++){let R=jpe(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function jpe(e,t,n,i,r){let o=1<<r,s=D.clamp(n*o|0,0,o-1),a=D.clamp(i*o|0,0,o-1),c=R$(e,r,s,a);return t.getDescendantCoordinates(c)}Mx.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var O$=Xp;function eA(e){e=e??H.EMPTY_OBJECT,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 r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=W6(e.westIndices,r,t),this._southIndices=W6(e.southIndices,o,t),this._eastIndices=W6(e.eastIndices,r,t),this._northIndices=W6(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(eA.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 G6=[];function W6(e,t,n){G6.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)G6[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(G6.sort(t),je.createTypedArray(n,G6)):e}var Wpe="createVerticesFromQuantizedTerrainMesh",Bqe=new $n(Wpe),kqe=new $n(Wpe,Lu.maximumAsynchronousTasks);eA.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?kqe:Bqe).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=je.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,S=p._orientedBoundingBox,I=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=_o.clone(g.encoding);return p._mesh=new lc(x,b,A,g.indexCountWithoutSkirts,m,T,E,u,v,I,R,S,O,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 Uqe=new $n("upsampleQuantizedTerrainMesh",Lu.maximumAsynchronousTasks);eA.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=Uqe.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:u,childRectangle:d,ellipsoid:f});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 m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),v=je.createTypedArray(E.length/3,T.indices),S;return l(T.encodedNormals)&&(S=new Uint8Array(T.encodedNormals)),new eA({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ce.clone(T.boundingSphere),orientedBoundingBox:en.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var M$=32767,qpe=new h;eA.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=M$;let r=D.clamp((n-e.south)/e.height,0,1);return r*=M$,l(this._mesh)?Hqe(this,i,r):Gqe(this,i,r)};function Ype(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var zqe=new U,Vqe=new U,jqe=new U;function Hqe(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,zqe),g=o.decodeTextureCoordinates(r,f,Vqe),m=o.decodeTextureCoordinates(r,d,jqe);if(Ype(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=Jh.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,qpe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function Gqe(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(Ype(t,n,p,y,g,A,m,b)){let x=Jh.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,qpe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return D.lerp(e._minimumHeight,e._maximumHeight,T/M$)}}}}eA.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};eA.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Nx=eA;function Wqe(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 Kpe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ee.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=[]}Kpe.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 $pe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=$r.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=$r.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!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}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=$r.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Do({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=$r.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=$r.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;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&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new Kh(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],E=b-T.endY-1,v=b-T.startY-1;e.overallAvailability[y].push([T.startX,E,T.endX,v]),g.addAvailableTileRange(y,T.startX,E,T.endX,v)}}}else l(d)&&(f=new Kh(e.tilingScheme,u),g=new Kh(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Wqe({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await F$(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function qqe(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=$r.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return F$(e,n);throw new oe(i)}async function Yqe(e,t,n){await $pe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new Kh(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function F$(e,t){try{let n=await e.layerJsonResource.fetchJson();return Yqe(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await $pe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):qqe(e,n,t)}}function nm(e){e=e??H.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new It(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 N$={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Xpe(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 Xqe(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Rc({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Kqe(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let T=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ce(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let S=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let I=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,I),L=R.subarray(I,2*I),_=R.subarray(I*2,3*I);cn.zigZagDeltaDecode(O,L,_),a%y!==0&&(a+=y-a%y);let C=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=je.createTypedArrayFromArrayBuffer(I,t,a,C*m);a+=C*A;let P=0,M=w.length;for(let fe=0;fe<M;++fe){let xe=w[fe];w[fe]=P-xe,xe===0&&++P}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=je.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=je.createTypedArrayFromArrayBuffer(I,t,a,B);a+=B*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=je.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*y;let q=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=je.createTypedArrayFromArrayBuffer(I,t,a,q);a+=q*y;let W,J;for(;a<b.byteLength;){let fe=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,fe===N$.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===N$.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===N$.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let Se=Ro(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(Se))for(let Re=0;Re<Se.length;++Re){let Qe=n+Re+1,He=Se[Re],Xe=e._tilingScheme.getNumberOfYTilesAtLevel(Qe);for(let $e=0;$e<He.length;++$e){let Pe=He[$e],qe=Xe-Pe.endY-1,st=Xe-Pe.startY-1;e.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st),o.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=xe}let Z=e.getLevelMaximumGeometricError(n)*5,ae=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=en.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new Nx({center:x,minimumHeight:T,maximumHeight:E,boundingSphere:v,orientedBoundingBox:Ae,horizonOcclusionPoint:S,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}nm.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=B$(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):Jpe(this,e,t,n,o,i)};function Jpe(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let s=r.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&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Xpe(void 0)):u=Xpe(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?Xqe(e,m,i,t,n):Kqe(e,m,i,t,n,r):Promise.reject(new oe("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 Ho.fromAssetId(e);return nm.fromUrl(n,t)};nm.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new Kpe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await F$(i);let r=new nm(t);return i.build(r),r};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,r=i.length;for(let o=0;o<r;++o)if(B$(this,e,t,n,i[o],o===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,r=i.length;for(let o=0;o<r;++o){let s=B$(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function L$(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function B$(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=L$(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});d=Jpe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=L$(r,f.x,f.y,f.level)}return{result:!1}}nm._getAvailabilityTile=L$;var Lx=nm;var U$={},q6=new h,Zpe=new h,Qpe=new Le,e0e=new $;function Jv(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),q6),h.multiplyByScalar(n,Math.sin(f),Zpe),h.add(q6,Zpe,q6);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(q6,m,Qpe),$.fromQuaternion(Qpe,e0e),$.multiplyByVector(e0e,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var t0e=new h,n0e=new h,k$=new h,$qe=new h;U$.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,t0e);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,n0e),y=i.geodeticSurfaceNormal(g,$qe),A=h.multiplyByScalar(y,r,k$);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var Jqe=new h,Zqe=new h,Qqe=new h;U$.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,Jqe),g=h.cross(h.UNIT_Z,s,Zqe);g=h.normalize(g,g);let m=h.cross(p,g,Qqe),y=1+Math.ceil(D.PI_OVER_TWO/a),A=D.PI_OVER_TWO/(y-1),b=D.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,E=0,v=t0e,S=n0e,I=y*4*3,R=I-1,O=0,L=n?new Array(I):void 0,_,C,w,P,M;for(b=D.PI_OVER_TWO,v=Jv(b,o,m,g,c,f,u,d,p,v),t&&(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),b=D.PI_OVER_TWO-A,_=1;_<y+1;++_){if(v=Jv(b,o,m,g,c,f,u,d,p,v),S=Jv(Math.PI-b,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*_+2,C=1;C<w-1;++C)P=C/(w-1),M=h.lerp(v,S,P,k$),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z),b=D.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=D.PI_OVER_TWO-(_-1)*A,v=Jv(-b,o,m,g,c,f,u,d,p,v),S=Jv(b+Math.PI,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*(_-1)+2,C=1;C<w-1;++C)P=C/(w-1),M=h.lerp(v,S,P,k$),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z)}b=D.PI_OVER_TWO,v=Jv(-b,o,m,g,c,f,u,d,p,v);let F={};return t&&(T[E++]=v.x,T[E++]=v.y,T[E]=v.z,F.positions=T,F.numPts=y),n&&(L[R--]=v.z,L[R--]=v.y,L[R]=v.x,F.outerPositions=L),F};var Vu=U$;function eYe(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Ft=eYe;var Zv=new h,z$=new h,V$=new h,i0e=new h,ya=new U,r0e=new $,tYe=new $,j$=new Le,o0e=new h,s0e=new h,a0e=new h,K6=new he,c0e=new h,l0e=new U,u0e=new U;function f0e(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=o0e,x=s0e,T=a0e,E=new Ui(a),v=E.project(a.cartesianToCartographic(r,K6),c0e),S=a.scaleToGeodeticSurface(r,Zv);a.geodeticSurfaceNormal(S,S);let I=r0e,R=tYe;if(c!==0){let M=Le.fromAxisAngle(S,c,j$);I=$.fromQuaternion(M,I),M=Le.fromAxisAngle(S,-c,j$),R=$.fromQuaternion(M,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,l0e),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,u0e),_=e.length,C=n?_:0,w=C/3*2;for(let M=0;M<_;M+=3){let F=M+1,V=M+2,B=h.fromArray(e,M,Zv);if(i.st){let j=$.multiplyByVector(I,B,z$),k=E.project(a.cartesianToCartographic(j,K6),V$);h.subtract(k,v,k),ya.x=(k.x+o)/(2*o),ya.y=(k.y+s)/(2*s),O.x=Math.min(ya.x,O.x),O.y=Math.min(ya.y,O.y),L.x=Math.max(ya.x,L.x),L.y=Math.max(ya.y,L.y),n&&(d[A+w]=ya.x,d[A+1+w]=ya.y),d[A++]=ya.x,d[A++]=ya.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(B,b),f&&(y[M+C]=-b.x,y[F+C]=-b.y,y[V+C]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[M]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[M+C]=-b.x,p[F+C]=-b.y,p[V+C]=-b.z)),i.tangent&&(g[M]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[M+C]=-x.x,g[F+C]=-x.y,g[V+C]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[M]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[M+C]=T.x,m[F+C]=T.y,m[V+C]=T.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-O.x)/(L.x-O.x),d[M+1]=(d[M+1]-O.y)/(L.y-O.y)}let P=new Tn;if(i.position){let M=Vu.raisePositionsToHeight(e,t,n);P.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(P.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(P.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(P.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(P.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(P.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)M=M.fill(1,0,u/2);else{let F=t.offsetAttribute===mn.NONE?0:1;M=M.fill(F)}P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return P}function d0e(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var Fx=new h;function nYe(e){let t=e.center;Fx=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Fx),e.height,Fx),Fx=h.add(t,Fx,Fx);let n=new ce(Fx,e.semiMajorAxis),i=Vu.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=f0e(r,e,!1),a=d0e(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function iYe(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=o0e,E=s0e,v=a0e,S=new Ui(s),I=S.project(s.cartesianToCartographic(i,K6),c0e),R=s.scaleToGeodeticSurface(i,Zv);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,j$),L=$.fromQuaternion(O,r0e),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,l0e),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,u0e),w=e.length,P=w/3*2;for(let F=0;F<w;F+=3){let V=F+1,B=F+2,j=h.fromArray(e,F,Zv),k;if(n.st){let q=$.multiplyByVector(L,j,z$),Q=S.project(s.cartesianToCartographic(q,K6),V$);h.subtract(Q,I,Q),ya.x=(Q.x+r)/(2*r),ya.y=(Q.y+o)/(2*o),_.x=Math.min(ya.x,_.x),_.y=Math.min(ya.y,_.y),C.x=Math.max(ya.x,C.x),C.y=Math.max(ya.y,C.y),p[x+P]=ya.x,p[x+1+P]=ya.y,p[x++]=ya.x,p[x++]=ya.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,z$),T=s.geodeticSurfaceNormal(j,T),A&&(b[F+w]=-T.x,b[V+w]=-T.y,b[B+w]=-T.z);let G=h.multiplyByScalar(T,a,i0e);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),k=h.add(k,G,k),n.position&&(d[F+w]=k.x,d[V+w]=k.y,d[B+w]=k.z,d[F]=j.x,d[V]=j.y,d[B]=j.z),n.normal||n.tangent||n.bitangent){v=h.clone(T,v);let q=h.fromArray(e,(F+3)%w,i0e);h.subtract(q,j,q);let Q=h.subtract(k,j,V$);T=h.normalize(h.cross(Q,q,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[B]=T.z,g[F+w]=T.x,g[V+w]=T.y,g[B+w]=T.z),n.tangent&&(E=h.normalize(h.cross(v,T,E),E),m[F]=E.x,m[V]=E.y,m[B]=E.z,m[F+w]=E.x,m[F+1+w]=E.y,m[F+2+w]=E.z),n.bitangent&&(y[F]=v.x,y[V]=v.y,y[B]=v.z,y[F+w]=v.x,y[V+w]=v.y,y[B+w]=v.z)}}if(n.st){w=p.length;for(let F=0;F<w;F+=2)p[F]=(p[F]-_.x)/(C.x-_.x),p[F+1]=(p[F+1]-_.y)/(C.y-_.y)}let M=new Tn;if(n.position&&(M.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(M.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(M.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===mn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===mn.NONE?0:1;F=F.fill(V)}M.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return M}function rYe(e){let t=e.length/3,n=je.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var Y6=new ce,X6=new ce;function oYe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Zv),e.height,Zv);Y6.center=h.add(t,r,Y6.center),Y6.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),X6.center=h.add(t,r,X6.center),X6.radius=i;let o=Vu.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ce.union(Y6,X6),f=f0e(s,e,!0),d=d0e(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=je.createTypedArray(g*2/3,d),y=new St({attributes:f,indices:m,primitiveType:Oe.TRIANGLES}),A=iYe(c,e);d=rYe(c);let b=je.createTypedArray(c.length*2/3,d),x=new St({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Hn.combineInstances([new Ft({geometry:y}),new Ft({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function h0e(e,t,n,i,r,o,s){let c=Vu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,s);return d.width>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function $p(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.vertexFormat??Be.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Be.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}$p.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;$p.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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]=e._offsetAttribute??-1,t};var m0e=new h,p0e=new ee,g0e=new Be,Kp={center:m0e,ellipsoid:p0e,vertexFormat:g0e,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};$p.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,m0e);t+=h.packedLength;let r=ee.unpack(e,t,p0e);t+=ee.packedLength;let o=Be.unpack(e,t,g0e);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Kp.height=f,Kp.extrudedHeight=p,Kp.granularity=d,Kp.stRotation=u,Kp.rotation=c,Kp.semiMajorAxis=s,Kp.semiMinorAxis=a,Kp.shadowVolume=g,Kp.offsetAttribute=m===-1?void 0:m,new $p(Kp))};$p.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ee.default,r=e.semiMajorAxis,o=e.semiMinorAxis,s=e.granularity??D.RADIANS_PER_DEGREE,a=e.rotation??0;return h0e(n,r,o,a,s,i,t)};$p.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={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},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=oYe(r);else if(o=nYe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new St({attributes:o.attributes,indices:o.indices,primitiveType:Oe.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};$p.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new $p({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function sYe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Vu.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return St._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties($p.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=h0e(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=sYe(this)),this._textureCoordinateRotationPoints}}});var ql=$p;function Cg(e){e=e??H.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 ql(n),this._workerName="createCircleGeometry"}Cg.packedLength=ql.packedLength;Cg.pack=function(e,t,n){return ql.pack(e._ellipseGeometry,t,n)};var _0e=new ql({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Mc={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Cg.unpack=function(e,t,n){let i=ql.unpack(e,t,_0e);return Mc.center=h.clone(i._center,Mc.center),Mc.ellipsoid=ee.clone(i._ellipsoid,Mc.ellipsoid),Mc.ellipsoid=ee.clone(i._ellipsoid,_0e._ellipsoid),Mc.height=i._height,Mc.extrudedHeight=i._extrudedHeight,Mc.granularity=i._granularity,Mc.vertexFormat=Be.clone(i._vertexFormat,Mc.vertexFormat),Mc.stRotation=i._stRotation,Mc.shadowVolume=i._shadowVolume,l(n)?(Mc.semiMajorAxis=i._semiMajorAxis,Mc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ql(Mc),n):(Mc.radius=i._semiMajorAxis,new Cg(Mc))};Cg.createGeometry=function(e){return ql.createGeometry(e._ellipseGeometry)};Cg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new Cg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Cg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var H$=Cg;var y0e=new h,Bx=new h;function aYe(e){let t=e.center;Bx=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Bx),e.height,Bx),Bx=h.add(t,Bx,Bx);let n=new ce(Bx,e.semiMajorAxis),i=Vu.computeEllipsePositions(e,!1,!0).outerPositions,r=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Vu.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=je.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var $6=new ce,J6=new ce;function cYe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,y0e),e.height,y0e);$6.center=h.add(t,r,$6.center),$6.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),J6.center=h.add(t,r,J6.center),J6.radius=i;let o=Vu.computeEllipsePositions(e,!1,!0).outerPositions,s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Vu.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ce.union($6,J6),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===mn.NONE?0:1;m=m.fill(y)}s.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=je.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function Qv(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}Qv.packedLength=h.packedLength+ee.packedLength+8;Qv.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.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]=e._offsetAttribute??-1,t};var A0e=new h,b0e=new ee,vg={center:A0e,ellipsoid:b0e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Qv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,A0e);t+=h.packedLength;let r=ee.unpack(e,t,b0e);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(vg.height=c,vg.extrudedHeight=f,vg.granularity=u,vg.rotation=a,vg.semiMajorAxis=o,vg.semiMinorAxis=s,vg.numberOfVerticalLines=d,vg.offsetAttribute=p===-1?void 0:p,new Qv(vg))};Qv.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=cYe(r);else if(o=aYe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new St({attributes:o.attributes,indices:o.indices,primitiveType:Oe.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var Rf=Qv;function eS(e){e=e??H.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 Rf(n),this._workerName="createCircleOutlineGeometry"}eS.packedLength=Rf.packedLength;eS.pack=function(e,t,n){return Rf.pack(e._ellipseGeometry,t,n)};var lYe=new Rf({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Of={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};eS.unpack=function(e,t,n){let i=Rf.unpack(e,t,lYe);return Of.center=h.clone(i._center,Of.center),Of.ellipsoid=ee.clone(i._ellipsoid,Of.ellipsoid),Of.height=i._height,Of.extrudedHeight=i._extrudedHeight,Of.granularity=i._granularity,Of.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Of.semiMajorAxis=i._semiMajorAxis,Of.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Rf(Of),n):(Of.radius=i._semiMajorAxis,new eS(Of))};eS.createGeometry=function(e){return Rf.createGeometry(e._ellipseGeometry)};var G$=eS;var x0e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(x0e);var As=x0e;var T0e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(T0e);var zr=T0e;var W$;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?W$=function(){return performance.now()}:W$=function(){return Date.now()};var xn=W$;function q$(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??As.UNBOUNDED,this.canAnimate=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=xn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??zr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(q$.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===zr.SYSTEM_CLOCK&&(this._clockStep=zr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===zr.SYSTEM_CLOCK&&(this._clockStep=zr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===zr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===zr.SYSTEM_CLOCK&&(this._clockStep=zr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});q$.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===zr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===zr.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=K.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===As.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,s)&&(t=K.clone(s,t),this.onStop.raiseEvent(this));else if(r===As.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,s);)t=K.addSeconds(o,K.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var im=q$;function tS(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(tS.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});tS.fromColor=function(e){return new tS(e.red,e.green,e.blue,e.alpha)};tS.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};tS.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 Jt=tS;function nS(e){this._value=e,this._valueType=Ir.getPointType(e)}Object.defineProperties(nS.prototype,{value:{get:function(){return this._value}}});nS.prototype.findTimeInterval=function(e){};nS.prototype.wrapTime=function(e){return 0};nS.prototype.clampTime=function(e){return 0};nS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var TM=nS;var EM={},uYe=new h,E0e=new h,C0e=new h,v0e=new h,S0e=new en;EM.validOutline=function(e){let n=en.fromPoints(e,S0e).halfAxes,i=$.getColumn(n,0,E0e),r=$.getColumn(n,1,C0e),o=$.getColumn(n,2,v0e),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};EM.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,S0e),o=r.halfAxes,s=$.getColumn(o,0,E0e),a=$.getColumn(o,1,C0e),c=$.getColumn(o,2,v0e),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function w0e(e,t,n,i,r){let o=h.subtract(e,t,uYe),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}EM.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=w0e(i[o],e,t,n);return r}};EM.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return w0e(i,e,t,n,r)}};var Sg=EM;function X$(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/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)*m+1001*c/8388608*y)}function fYe(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),S=Math.sin(10*i),I=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*E+(8011*p/2621440+8011*g/1048576)*S+293393*g/251658240*R}function iS(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function dYe(e,t,n,i,r){let o=iS(e._ellipticity,n),s=iS(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),s-o)}function hYe(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u;if(D.equalsEpsilon(Math.abs(a),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(r)*D.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=X$(e._ellipticity,t,r);u=(X$(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var mYe=new h,Y$=new h;function I0e(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,Y$),mYe),o=h.normalize(i.cartographicToCartesian(n,Y$),Y$),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/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=dYe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=hYe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function P0e(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=X$(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=fYe(p,r,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let g=iS(r,e.latitude),m=iS(r,c);u=Math.tan(t)*(m-g),a=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=D.negativePiToPi(e.longitude+u):a=D.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function wg(e,t,n){let i=n??ee.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)&&I0e(this,e,t,i)}Object.defineProperties(wg.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}}});wg.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??ee.default,s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let d=P0e(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new wg(e,d,o):(r.setEndPoints(e,d),r)};wg.prototype.setEndPoints=function(e,t){I0e(this,e,t,this._ellipsoid)};wg.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};wg.prototype.interpolateUsingSurfaceDistance=function(e,t){return P0e(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};wg.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(D.PI_OVER_TWO-r)<=D.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-r),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,o.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(D.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};wg.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let o=iS(n,r.latitude),s=iS(n,e),a=Math.tan(i)*(s-o),c=D.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Nc=wg;function pYe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Lc=pYe;function J$(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=R0e(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=bYe(e,t,o,n)),e.length>80*n){a=e[0],c=e[1];let f=a,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return vM(o,s,n,a,c,u,0),s}function R0e(e,t,n,i,r){let o;if(r===RYe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=D0e(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=D0e(s/i|0,e[s],e[s+1],o);return o&&rS(o,o.next)&&(wM(o),o=o.next),o}function kx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(rS(n,n.next)||bs(n.prev,n,n.next)===0)){if(wM(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function vM(e,t,n,i,r,o,s){if(!e)return;!s&&o&&vYe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?_Ye(e,i,r,o):gYe(e)){t.push(c.i,e.i,u.i),wM(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=yYe(kx(e),t),vM(e,t,n,i,r,o,2)):s===2&&AYe(e,t,n,i,r,o):vM(kx(e),t,n,i,r,o,1);break}}}function gYe(e){let t=e.prev,n=e,i=e.next;if(bs(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(r,o,s),d=Math.min(a,c,u),p=Math.max(r,o,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&CM(r,a,o,c,s,u,m.x,m.y)&&bs(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function _Ye(e,t,n,i){let r=e.prev,o=e,s=e.next;if(bs(r,o,s)>=0)return!1;let a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),A=Math.max(f,d,p),b=K$(g,m,t,n,i),x=K$(y,A,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=b&&E&&E.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&CM(a,f,c,d,u,p,T.x,T.y)&&bs(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&CM(a,f,c,d,u,p,E.x,E.y)&&bs(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&CM(a,f,c,d,u,p,T.x,T.y)&&bs(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&CM(a,f,c,d,u,p,E.x,E.y)&&bs(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function yYe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!rS(i,r)&&M0e(i,n,n.next,r)&&SM(i,r)&&SM(r,i)&&(t.push(i.i,n.i,r.i),wM(n),wM(n.next),n=e=r),n=n.next}while(n!==e);return kx(n)}function AYe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&IYe(s,a)){let c=N0e(s,a);s=kx(s,s.next),c=kx(c,c.next),vM(s,t,n,i,r,o,0),vM(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function bYe(e,t,n,i){let r=[];for(let o=0,s=t.length;o<s;o++){let a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=R0e(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(wYe(u))}r.sort(xYe);for(let o=0;o<r.length;o++)n=TYe(r[o],n);return n}function xYe(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),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function TYe(e,t){let n=EYe(e,t);if(!n)return t;let i=N0e(n,e);return kx(i,i.next),kx(n,n.next)}function EYe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(rS(e,n))return n;do{if(rS(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&O0e(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);SM(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&CYe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function CYe(e,t){return bs(e.prev,e,t.prev)<0&&bs(t.next,e,e.next)<0}function vYe(e,t,n,i){let r=e;do r.z===0&&(r.z=K$(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,SYe(r)}function SYe(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(t>1);return e}function K$(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|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 wYe(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 O0e(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function CM(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&O0e(e,t,n,i,r,o,s,a)}function IYe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!PYe(e,t)&&(SM(e,t)&&SM(t,e)&&DYe(e,t)&&(bs(e.prev,e,t.prev)||bs(e,t.prev,t))||rS(e,t)&&bs(e.prev,e,e.next)>0&&bs(t.prev,t,t.next)>0)}function bs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function rS(e,t){return e.x===t.x&&e.y===t.y}function M0e(e,t,n,i){let r=Q6(bs(e,t,n)),o=Q6(bs(e,t,i)),s=Q6(bs(n,i,e)),a=Q6(bs(n,i,t));return!!(r!==o&&s!==a||r===0&&Z6(e,n,t)||o===0&&Z6(e,i,t)||s===0&&Z6(n,e,i)||a===0&&Z6(n,t,i))}function Z6(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 Q6(e){return e>0?1:e<0?-1:0}function PYe(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&&M0e(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function SM(e,t){return bs(e.prev,e,e.next)<0?bs(e,t,e.next)>=0&&bs(e,e.prev,t)>=0:bs(e,t,e.prev)<0||bs(e,e.next,t)<0}function DYe(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function N0e(e,t){let n=$$(e.i,e.x,e.y),i=$$(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function D0e(e,t,n,i){let r=$$(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function wM(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 $$(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function RYe(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}var OYe=new h,MYe=new h,tA={};tA.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};tA.computeWindingOrder2D=function(e){return tA.computeArea2D(e)>0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};tA.triangulate=function(e,t){let n=U.packArray(e);return J$(n,t,2)};var k0e=new h,U0e=new h,z0e=new h,L0e=new h,F0e=new h,B0e=new h,Ig=new h,V0e=new U,j0e=new U,H0e=new U,oS=new U;tA.computeSubdivision=function(e,t,n,i,r){r=r??D.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},y=e.maximumRadius,A=D.chordLength(r,y),b=A*A;for(;s.length>0;){let T=s.pop(),E=s.pop(),v=s.pop(),S=h.fromArray(u,v*3,k0e),I=h.fromArray(u,E*3,U0e),R=h.fromArray(u,T*3,z0e),O,L,_;o&&(O=U.fromArray(f,v*2,V0e),L=U.fromArray(f,E*2,j0e),_=U.fromArray(f,T*2,H0e));let C=h.multiplyByScalar(h.normalize(S,L0e),y,L0e),w=h.multiplyByScalar(h.normalize(I,F0e),y,F0e),P=h.multiplyByScalar(h.normalize(R,B0e),y,B0e),M=h.magnitudeSquared(h.subtract(C,w,Ig)),F=h.magnitudeSquared(h.subtract(w,P,Ig)),V=h.magnitudeSquared(h.subtract(P,C,Ig)),B=Math.max(M,F,V),j,k,G;B>b?M===B?(j=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[j],l(a)||(k=h.add(S,I,Ig),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(O,L,oS),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(v,a,T),s.push(a,E,T)):F===B?(j=`${Math.min(E,T)} ${Math.max(E,T)}`,a=m[j],l(a)||(k=h.add(I,R,Ig),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(L,_,oS),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(E,a,v),s.push(a,T,v)):V===B&&(j=`${Math.min(T,v)} ${Math.max(T,v)}`,a=m[j],l(a)||(k=h.add(R,S,Ig),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(_,O,oS),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(T,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(T))}let x={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(x.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new St(x)};var NYe=new he,LYe=new he,FYe=new he,Z$=new he;tA.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??D.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,A=D.chordLength(r,y),b=new Nc(void 0,void 0,e),x=new Nc(void 0,void 0,e),T=new Nc(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),S=s.pop(),I=s.pop(),R=h.fromArray(u,I*3,k0e),O=h.fromArray(u,S*3,U0e),L=h.fromArray(u,v*3,z0e),_,C,w;o&&(_=U.fromArray(f,I*2,V0e),C=U.fromArray(f,S*2,j0e),w=U.fromArray(f,v*2,H0e));let P=e.cartesianToCartographic(R,NYe),M=e.cartesianToCartographic(O,LYe),F=e.cartesianToCartographic(L,FYe);b.setEndPoints(P,M);let V=b.surfaceDistance;x.setEndPoints(M,F);let B=x.surfaceDistance;T.setEndPoints(F,P);let j=T.surfaceDistance,k=Math.max(V,B,j),G,q,Q,W,J;k>A?V===k?(G=`${Math.min(I,S)} ${Math.max(I,S)}`,a=m[G],l(a)||(q=b.interpolateUsingFraction(.5,Z$),Q=(P.height+M.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Ig),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,oS),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(I,a,v),s.push(a,S,v)):B===k?(G=`${Math.min(S,v)} ${Math.max(S,v)}`,a=m[G],l(a)||(q=x.interpolateUsingFraction(.5,Z$),Q=(M.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Ig),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,oS),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(S,a,I),s.push(a,v,I)):j===k&&(G=`${Math.min(v,I)} ${Math.max(v,I)}`,a=m[G],l(a)||(q=T.interpolateUsingFraction(.5,Z$),Q=(F.height+P.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Ig),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,oS),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(v,a,S),s.push(a,I,S)):(g.push(I),g.push(S),g.push(v))}let E={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(E.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new St(E)};tA.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=OYe,o=MYe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var ui=tA;function nA(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(nA.prototype,{length:{get:function(){return this._length}}});nA.prototype.enqueue=function(e){this._array.push(e),this._length++};nA.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};nA.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};nA.prototype.contains=function(e){return this._array.indexOf(e)!==-1};nA.prototype.clear=function(){this._array.length=this._offset=this._length=0};nA.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var iA=nA;var Oo={};Oo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Oo.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};Oo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=Oo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var Ux=new U;function q0e(e,t,n,i){return U.subtract(t,e,Ux),U.multiplyByScalar(Ux,n/i,Ux),U.add(e,Ux,Ux),[Ux.x,Ux.y]}var rA=new h;function BYe(e,t,n,i){return h.subtract(t,e,rA),h.multiplyByScalar(rA,n/i,rA),h.add(e,rA,rA),[rA.x,rA.y,rA.z]}Oo.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(D.log2(r)));return Math.pow(2,o)};var tH=new he,nH=new he,kYe=new he,UYe=new h,eH=new Nc;Oo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,tH),o=e.cartesianToCartographic(n,nH),a=new Nc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};Oo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=Oo.subdivideLineCount(n,i,r),a=U.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=q0e(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Oo.subdivideLine=function(e,t,n,i){let r=Oo.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=BYe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Oo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,tH),c=n.cartesianToCartographic(r,nH);eH.setEndPoints(a,c);let u=eH.surfaceDistance/o,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=U.distance(e,t),g=p/d,m=s;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=q0e(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};Oo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,tH),s=e.cartesianToCartographic(n,nH),a=new Nc(o,s,e);if(l(r)||(r=[]),a.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,kYe),A=e.cartographicToCartesian(y,UYe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var zYe=new h,VYe=new h,jYe=new h,HYe=new h;Oo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=zYe,s=VYe,a=jYe,c=HYe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};Oo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new iA;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Fr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Fr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};var GYe=new he;function WYe(e,t,n){let i=n.cartesianToCartographic(e,tH),r=n.cartesianToCartographic(t,nH);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;eH.setEndPoints(i,r);let o=eH.findIntersectionWithLatitude(0,GYe);if(!l(o))return;let s=Math.min(i.longitude,r.longitude),a=Math.max(i.longitude,r.longitude);if(Math.abs(a-s)>D.PI){let c=s;s=a,a=c}if(!(o.longitude<s||o.longitude>a))return n.cartographicToCartesian(o)}function qYe(e,t,n,i){if(i===ln.RHUMB)return WYe(e,t,n);let r=pi.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var YYe=new he;function XYe(e,t,n){let i=[],r,o,s,a,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],s=D.sign(r.z),a=D.sign(o.z);let f=d=>t.cartesianToCartographic(d,YYe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=qYe(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function Y0e(e,t,n,i,r,o,s){let a=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&A>0||o===c&&!s&&A<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(s?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&a.length<n.length);e.splice(t,r,a);for(let d of f)t=Y0e(e,t+1,n,i,0,d,!s);return t}Oo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],s=o.slice();if(o.length<3){i[r]=s,++r;continue}let a=XYe(s,t,n);if(s.length===o.length||a.length<=1){i[r]=s,++r;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;r=Y0e(i,r,s,a,1,0,c)}return i};Oo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new iA;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Fr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=ui.computeWindingOrder2D(y);if(b===Qs.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let S=[d];if(S=o(S,S),S.length>1){for(let I of S)c.enqueue(new Lc(I,p));continue}}let x=d.slice(),T=l(p)?p.length:0,E=[],v;for(g=0;g<T;g++){let S=p[g],I=S.positions;if(i)for(m=I.length,v=0;v<m;++v)r.scaleToGeodeticSurface(I[v],I[v]);if(t||(I=Fr(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=ui.computeWindingOrder2D(R),b===Qs.CLOCKWISE&&(R.reverse(),I=I.slice().reverse()),E.push(I),A.push(x.length),x=x.concat(I),y=y.concat(R);let O=0;for(l(S.holes)&&(O=S.holes.length),v=0;v<O;v++)c.enqueue(S.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:x,positions2D:y,holes:A})}return{hierarchy:s,polygons:a}};var KYe=new U,$Ye=new h,JYe=new Le,ZYe=new $;Oo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,JYe),s=$.fromQuaternion(o,ZYe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],$Ye);$.multiplyByVector(s,g,g);let m=t(g,KYe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};Oo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=ui.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Oe.TRIANGLES};u&&(m.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let y=new St(m);return o.normal?Hn.computeNormal(y):y}if(s===ln.GEODESIC)return ui.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return ui.computeRhumbLineSubdivision(e,c,a,f,i)};var G0e=[],W0e=[],QYe=new h,eXe=new h;Oo.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(a=y*3*2,s=new Array(a*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[A]=s[A+a]=u.x,++A,s[A]=s[A+a]=u.y,++A,s[A]=s[A+a]=u.z,++A,s[A]=s[A+a]=f.x,++A,s[A]=s[A+a]=f.y,++A,s[A]=s[A+a]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=D.chordLength(i,n.maximumRadius),O=0;if(o===ln.GEODESIC)for(c=0;c<y;c++)O+=Oo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=Oo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(a=(O+y)*3,s=new Array(a*2),x&&(m=(O+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,_;x&&(d=T[c],p=T[(c+1)%y]),o===ln.GEODESIC?(L=Oo.subdivideLine(u,f,R,W0e),x&&(_=Oo.subdivideTexcoordLine(d,p,u,f,R,G0e))):o===ln.RHUMB&&(L=Oo.subdivideRhumbLine(n,u,f,R,W0e),x&&(_=Oo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,G0e)));let C=L.length;for(let w=0;w<C;++w,++A)s[A]=L[w],s[A+a]=L[w];if(s[A]=f.x,s[A+a]=f.x,++A,s[A]=f.y,s[A+a]=f.y,++A,s[A]=f.z,s[A+a]=f.z,++A,x){let w=_.length;for(let P=0;P<w;++P,++b)g[b]=_[P],g[b+m]=_[P];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=s.length;let E=je.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,c=0;c<y;c++){let R=c,O=R+1,L=R+y,_=L+1;u=h.fromArray(s,R*3,QYe),f=h.fromArray(s,O*3,eXe),!h.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(E[v++]=R,E[v++]=L,E[v++]=O,E[v++]=O,E[v++]=L,E[v++]=_)}let S={attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Oe.TRIANGLES};return x&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new St(S)};var Qn=Oo;var tXe=new h,nXe=new et,iXe=new U,rXe=new U,oXe=new h,sXe=new h,aXe=new h,IM=new h,cXe=new h,lXe=new h,X0e=new Le,uXe=new $,fXe=new $,dXe=new h;function hXe(e,t,n,i,r,o,s,a,c){let u=e.positions,f=ui.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=je.createTypedArray(u.length,f.length);d.set(f);let p=uXe;if(i!==0){let _=Le.fromAxisAngle(s,i,X0e);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,X0e);let C=$.fromQuaternion(_,fXe);a=h.normalize($.multiplyByVector(C,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=rXe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,S=0,I=0,R=0,O=0;for(let _=0;_<m;_++){let C=u[_];if(A[v++]=C.x,A[v++]=C.y,A[v++]=C.z,t.st)if(l(r)&&r.positions.length===m)E[O++]=r.positions[_].x,E[O++]=r.positions[_].y;else{let w=$.multiplyByVector(p,C,tXe),P=o(w,iXe);U.subtract(P,g,P);let M=D.clamp(P.x/n.width,0,1),F=D.clamp(P.y/n.height,0,1);E[O++]=M,E[O++]=F}t.normal&&(b[S++]=s.x,b[S++]=s.y,b[S++]=s.z),t.tangent&&(x[R++]=a.x,x[R++]=a.y,x[R++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new Tn;return t.position&&(L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(L.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(L.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new St({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function zx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Qn.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?Qn.computeHierarchyPackedLength(n,U):1)+2}zx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new zx(t)};zx.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Qn.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var mXe=ee.clone(ee.UNIT_SPHERE),pXe=new Be,gXe={polygonHierarchy:{}};zx.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,mXe);t+=ee.packedLength;let o=Be.unpack(e,t,pXe);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:Qn.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new zx(gXe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};zx.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Fr(s,h.equalsEpsilon,!0),s.length<3)return;let a=oXe,c=sXe,u=aXe,f=cXe,d=lXe;if(!Sg.computeProjectTo2DArguments(s,IM,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(IM,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(IM,dXe);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=Sg.createProjectPointsTo2DFunction(IM,f,d),m=Sg.createProjectPointTo2DFunction(IM,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=Qn.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?Qn.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ce.fromPoints(s),v=Qn.computeBoundingRectangle(a,m,s,i,nXe),S=[];for(let O=0;O<b.length;O++){let L=new Ft({geometry:hXe(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Hn.combineInstances(S)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=je.createTypedArray(I.attributes.position.values.length/3,I.indices);let R=I.attributes;return t.position||delete R.position,new St({attributes:R,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:E})};var PM=zx;function _Xe(e){let t=e.length,n=new Float64Array(t*3),i=je.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new St({attributes:s,indices:i,primitiveType:Oe.LINES})}function Vx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Qn.computeHierarchyPackedLength(t,h)+1}Vx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new Vx(t)};Vx.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var yXe={polygonHierarchy:{}};Vx.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new Vx(yXe)),n._polygonHierarchy=i,n.packedLength=r,n};Vx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Fr(n,h.equalsEpsilon,!0),n.length<3||!Sg.validOutline(n))return;let r=Qn.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Ft({geometry:_Xe(r[c])});o.push(u)}let s=Hn.combineInstances(o)[0],a=ce.fromPoints(t.positions);return new St({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Ud=Vx;var K0e={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(K0e);var nr=K0e;function AXe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,E=1-y+15*A/8-35*b/8,v=1-3*y+35*A/4,S=1-5*y,I=T*f-E*Math.sin(2*f)*y/2-v*Math.sin(4*f)*A/16-S*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=E,R.a2=v,R.a3=S,R.distanceRatio=I}function bXe(e,t){return e*t*(4+e*(4-3*t))/16}function $0e(e,t,n,i,r,o,s){let a=bXe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function xXe(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,E,v,S,I,R,O,L,_;do{v=Math.cos(T),S=Math.sin(T);let k=A-x*v;O=Math.sqrt(g*g*S*S+k*k),R=b+y*v,I=Math.atan2(O,R);let G;O===0?(G=0,L=1):(G=y*S/O,L=1-G*G),E=T,_=R-2*b/L,isFinite(_)||(_=0),T=c+$0e(a,G,L,I,O,R,_)}while(Math.abs(T-E)>D.EPSILON12);let C=L*(t*t-n*n)/(n*n),w=1+C*(4096+C*(C*(320-175*C)-768))/16384,P=C*(256+C*(C*(74-47*C)-128))/1024,M=_*_,F=P*O*(_+P*(R*(2*M-1)-P*_*(4*O*O-3)*(4*M-3)/6)/4),V=n*w*(I-F),B=Math.atan2(g*S,A-x*v),j=Math.atan2(d*S,A*v-x);e._distance=V,e._startHeading=B,e._endHeading=j,e._uSquared=C}var TXe=new h,Q$=new h;function J0e(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,Q$),TXe),o=h.normalize(i.cartographicToCartesian(n,Q$),Q$);xXe(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,AXe(e)}function DM(e,t,n){let i=n??ee.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)&&J0e(this,e,t,i)}Object.defineProperties(DM.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}}});DM.prototype.setEndPoints=function(e,t){J0e(this,e,t,this._ellipsoid)};DM.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};DM.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*s/16)+(m/2-A+71*y/32-85*g/16)*a+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let E=Math.cos(2*n.sigma+b),v=Math.sin(b),S=Math.cos(b),I=n.cosineU*S,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,I-R*n.cosineHeading)-$0e(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,v,S,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new he(this._start.longitude+L,T,0)};var Pg=DM;var Yl={};Yl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Yl.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 EXe=new he;Yl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,EXe).height}return i};var CXe=new N,vXe=new h,Z0e=new h,SXe=new sn(h.UNIT_X,0),Q0e=new h,wXe=new sn(h.UNIT_X,0),IXe=new h,PXe=new h,tJ=[];function tge(e,t,n){let i=tJ;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var rH=new he,iH=new he,oA=new h,nJ=new h,DXe=new h,eJ=new Pg,RM=new Nc;function RXe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,nJ),u=i.scaleToGeodeticSurface(t,DXe),f=Yl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,rH),p=i.cartesianToCartographic(u,iH),g=tge(f,r,o);eJ.setEndPoints(d,p);let m=eJ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,oA);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=eJ.interpolateUsingSurfaceDistance(b*m,iH);x.height=g[b],A=i.cartographicToCartesian(x,oA),h.pack(A,s,y),y+=3}return y}function OXe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,rH),u=i.cartesianToCartographic(t,iH),f=Yl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=tge(f,r,o);RM.ellipsoid.equals(i)||(RM=new Nc(void 0,void 0,i)),RM.setEndPoints(c,u);let p=RM.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,oA);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=RM.interpolateUsingSurfaceDistance(y*p,iH);A.height=d[y],m=i.cartographicToCartesian(A,oA),h.pack(m,s,g),g+=3}return g}Yl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??N.IDENTITY;let r=N.inverseTransformation(t,CXe),o=N.multiplyByPoint(r,h.ZERO,vXe),s=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_Y,Z0e),Z0e),a=sn.fromPointNormal(o,s,SXe),c=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_X,Q0e),Q0e),u=sn.fromPointNormal(o,c,wXe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,d)<0||sn.getPointDistance(u,m)<0){let y=pi.lineSegmentPlane(d,m,a,IXe);if(l(y)){let A=h.multiplyByScalar(s,5e-9,PXe);sn.getPointDistance(a,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};Yl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],nJ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,oA);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??D.RADIANS_PER_DEGREE;s=D.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Yl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=RXe(y,A,s,i,b,x,f,d)}tJ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,rH);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,oA);return h.pack(m,f,u-3),f};var ege=new he,MXe=new he;Yl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],nJ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,oA);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let s=e.granularity??D.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],ege),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],MXe),a+=Yl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,ege);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,E=o?r[c+1]:r;g=OXe(b,x,s,i,T,E,p,g)}tJ.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,rH);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,oA);return h.pack(A,p,d-3),p};Yl.generateCartesianArc=function(e){let t=Yl.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};Yl.generateCartesianRhumbArc=function(e){let t=Yl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var ir=Yl;var dc=[new h,new h],NXe=new h,LXe=new h,FXe=new h,BXe=new h,kXe=new h,UXe=new h,zXe=new h,VXe=new h,jXe=new h,sS=new h,oH=new h,OM={},iJ=new he;function HXe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];iJ=t.cartesianToCartographic(r,iJ),n[i]=iJ.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function rJ(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var sH=new h,aH=new h;function GXe(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,sH),sH),s=r.projectPointOntoPlane(h.add(n,t,aH),aH),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var WXe=new h(-1,0,0),jx=new N,qXe=new N,oJ=new $,YXe=$.IDENTITY.clone(),XXe=new h,KXe=new se,nge=new h;function Dg(e,t,n,i,r,o,s,a){let c=XXe,u=KXe;jx=At.eastNorthUpToFixedFrame(e,r,jx),c=N.multiplyByPointAsVector(jx,WXe,c),c=h.normalize(c,c);let f=GXe(c,t,e,r);oJ=$.fromRotationZ(f,oJ),nge.z=o,jx=N.multiplyTransformation(jx,N.fromRotationTranslation(oJ,nge,qXe),jx);let d=YXe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=N.multiplyByPoint(jx,u,u),i.push(u.x,u.y,u.z);return i}var $Xe=new h;function sJ(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,$Xe);i=Dg(c,t,n,i,r,o[a/3],s,1)}return i}function JXe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r]=a.y-s,i}function ige(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var rge=new Le,oge=new h,sge=new $;function age(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,sS),h.subtract(n,e,oH)),d=i===nr.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,sS),f/(d+1),rge),sge):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),rge),sge);let g,m;if(t=h.clone(t,oge),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,sS),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,oH),s=Dg(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,sS),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,oH),s=Dg(m,g,a,s,o,c,1,1),n=h.clone(n,oge),g=h.subtract(n,e,sS),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,oH),s=Dg(m,g,a,s,o,c,1,1);return s}OM.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];U.equals(o,s)||n.push(s)}return n};OM.angleIsGreaterThanPi=function(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,sH),sH),s=r.projectPointOntoPlane(h.add(n,t,aH),aH);return s.x*o.y-s.y*o.x>=0};var ZXe=new h,QXe=new h;OM.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=HXe(e,o),a=i._granularity,c=i._cornerType,u=r?JXe(t,n):ige(t,n),f=r?ige(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=NXe,b=LXe,x=FXe,T=BXe,E=kXe,v=UXe,S=zXe,I=VXe,R=jXe,O=e[0],L=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(L,O,A),A=h.normalize(A,A),I=h.cross(T,A,I),I=h.normalize(I,I);let _=s[0],C=s[1];r&&(y=Dg(O,I,f,y,o,_+d,1,1)),R=h.clone(O,R),O=L,b=h.negate(A,b);let w,P;for(let V=1;V<g-1;V++){let B=r?2:1;if(L=e[V+1],O.equals(L)){_t("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(L,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),ZXe);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),QXe);if(h.subtract(b,k,k),h.normalize(k,k),!D.equalsEpsilon(Math.abs(h.dot(j,k)),1,D.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let q=1/Math.max(.25,h.magnitude(h.cross(x,b,sS))),Q=OM.angleIsGreaterThanPi(A,b,O,o);Q?(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,p,v),v),dc[0]=h.clone(R,dc[0]),dc[1]=h.clone(v,dc[1]),w=rJ(dc,_+d,C+d,a),P=ir.generateArc({positions:dc,granularity:a,ellipsoid:o}),m=sJ(P,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,p,S),S),c===nr.ROUNDED||c===nr.BEVELED?age(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=Dg(O,x,u,m,o,C+d,q,B)),R=h.clone(S,R)):(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,-p,v),v),dc[0]=h.clone(R,dc[0]),dc[1]=h.clone(v,dc[1]),w=rJ(dc,_+d,C+d,a),P=ir.generateArc({positions:dc,granularity:a,ellipsoid:o}),m=sJ(P,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,-p,S),S),c===nr.ROUNDED||c===nr.BEVELED?age(E,v,S,c,Q,o,m,u,C+d,r):m=Dg(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=Dg(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}dc[0]=h.clone(R,dc[0]),dc[1]=h.clone(O,dc[1]),w=rJ(dc,_+d,C+d,a),P=ir.generateArc({positions:dc,granularity:a,ellipsoid:o}),m=sJ(P,I,u,m,o,w,1),r&&(y=Dg(O,I,f,y,o,C+d,1,1)),g=m.length;let M=r?g+y.length:g,F=new Float64Array(M);return F.set(m),r&&F.set(y,g),F};var rm=OM;var cJ={},aS=new h,dge=new h,eKe=new h,cge=new h,Xl=[new h,new h],hge=new h,mge=new h,pge=new h,tKe=new h,nKe=new h,iKe=new h,rKe=new h,oKe=new h,sKe=new h,aKe=new h,lge=new Le,uge=new $;function cH(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,aS),h.subtract(n,e,dge)),s=i===nr.BEVELED?1:Math.ceil(o/D.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 u;r?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,aS),o/s,lge),uge):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,lge),uge);let f=0;t=h.clone(t,aS);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function cKe(e){let t=hge,n=mge,i=pge,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=cH(t,n,i,nr.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=cH(t,n,i,nr.ROUNDED,!1);return[o,c]}function fge(e,t,n,i){let r=aS;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function aJ(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,aS),a=h.negate(s,dge),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,eKe),p=h.add(d,a,cge);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,cge);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}cJ.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var lKe=new h,uKe=new h;cJ.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=hge,c=mge,u=pge,f=tKe,d=nKe,p=iKe,g=rKe,m=oKe,y=sKe,A=aKe,b=[],x=s?[]:void 0,T=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let S,I=[],R,O=n.length;for(R=1;R<O-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),lKe);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),uKe);if(h.subtract(u,C,C),h.normalize(C,C),!D.equalsEpsilon(Math.abs(h.dot(_,C)),1,D.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let P=r/Math.max(.25,h.magnitude(h.cross(d,u,aS))),M=rm.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,P,d),M?(m=h.add(E,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),Xl[0]=h.clone(g,Xl[0]),Xl[1]=h.clone(A,Xl[1]),S=ir.generateArc({positions:Xl,granularity:t,ellipsoid:i}),b=aJ(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===nr.ROUNDED||o===nr.BEVELED?I.push({leftPositions:cH(m,p,y,o,M)}):I.push({leftPositions:fge(E,h.negate(d,d),y,M)})):(y=h.add(E,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),Xl[0]=h.clone(g,Xl[0]),Xl[1]=h.clone(A,Xl[1]),S=ir.generateArc({positions:Xl,granularity:t,ellipsoid:i}),b=aJ(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===nr.ROUNDED||o===nr.BEVELED?I.push({rightPositions:cH(y,p,m,o,M)}):I.push({rightPositions:fge(E,d,m,M)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),Xl[0]=h.clone(g,Xl[0]),Xl[1]=h.clone(E,Xl[1]),S=ir.generateArc({positions:Xl,granularity:t,ellipsoid:i}),b=aJ(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===nr.ROUNDED&&(L=cKe(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var dr=cJ;var yge=new h,Age=new h,lH=new h,uH=new h,fKe=new h,bge=new h,sA=new h,cS=new h;function xge(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function om(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,sA),sA);o.normal&&dr.addAttribute(s,t,i,r),o.tangent&&dr.addAttribute(a,u,i,r),o.bitangent&&dr.addAttribute(c,n,i,r)}function Tge(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new Tn,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,v={normals:x,tangents:T,bitangents:E},S=0,I=A-1,R,O,L,_,C=yge,w=Age,P,M,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){M=lH,P=uH;let J=o[0];for(C=h.fromArray(a,0,C),w=h.fromArray(s,0,w),d=0;d<F;d++)M=h.fromArray(J,(F-1-d)*3,M),P=h.fromArray(J,(F+d)*3,P),dr.addAttribute(b,P,S),dr.addAttribute(b,M,void 0,I),om(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}let j=0,k=0,G=i[j++],q=i[j++];b.set(G,S),b.set(q,I-q.length+1),w=h.fromArray(s,k,w);let Q,W;for(g=q.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,sA),sA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,cS),cS),C=h.normalize(h.add(Q,W,C),C),om(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,sA),sA),W=n.geodeticSurfaceNormal(h.fromArray(q,g,cS),cS),C=h.normalize(h.add(Q,W,C),C),k+=3,d=0;d<r.length;d++){let J,Z=r[d],ae=Z.leftPositions,Ae=Z.rightPositions,fe,xe,ge=bge,we=lH,Se=uH;if(C=h.fromArray(a,k,C),l(ae)){for(om(v,C,w,void 0,I,t),I-=3,fe=_,xe=L,J=0;J<ae.length/3;J++)ge=h.fromArray(ae,J*3,ge),V[B++]=fe,V[B++]=xe-J-1,V[B++]=xe-J,dr.addAttribute(b,ge,void 0,I),we=h.fromArray(b,(xe-J-1)*3,we),Se=h.fromArray(b,fe*3,Se),w=h.normalize(h.subtract(we,Se,w),w),om(v,C,w,void 0,I,t),I-=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,xe*3,we),ge,we),Se=h.subtract(h.fromArray(b,(xe-J)*3,Se),ge,Se),w=h.normalize(h.add(we,Se,w),w),om(v,C,w,S,void 0,t),S+=3}else{for(om(v,C,w,S,void 0,t),S+=3,fe=L,xe=_,J=0;J<Ae.length/3;J++)ge=h.fromArray(Ae,J*3,ge),V[B++]=fe,V[B++]=xe+J,V[B++]=xe+J+1,dr.addAttribute(b,ge,S),we=h.fromArray(b,fe*3,we),Se=h.fromArray(b,(xe+J)*3,Se),w=h.normalize(h.subtract(we,Se,w),w),om(v,C,w,S,void 0,t),S+=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,(xe+J)*3,we),ge,we),Se=h.subtract(h.fromArray(b,xe*3,Se),ge,Se),w=h.normalize(h.negate(h.add(Se,we,w),w),w),om(v,C,w,void 0,I,t),I-=3}for(G=i[j++],q=i[j++],G.splice(0,3),q.splice(q.length-3,3),b.set(G,S),b.set(q,I-q.length+1),g=q.length-3,k+=3,w=h.fromArray(s,k,w),J=0;J<q.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,sA),sA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,cS),cS),C=h.normalize(h.add(Q,W,C),C),om(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;S-=3,I+=3}if(C=h.fromArray(a,a.length-3,C),om(v,C,w,S,I,t),m){S+=3,I-=3,M=lH,P=uH;let J=o[1];for(d=0;d<F;d++)M=h.fromArray(J,(y-d-1)*3,M),P=h.fromArray(J,d*3,P),dr.addAttribute(b,M,void 0,I),dr.addAttribute(b,P,S),om(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}if(c.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ae,Ae=0;if(m){u/=3,f/=3;let fe=Math.PI/(y+1);ae=1/(u-y+1),Z=1/(f-y+1);let xe,ge=y/2;for(d=ge+1;d<y+1;d++)xe=D.PI_OVER_TWO+fe*d,J[Ae++]=Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ge;d--)xe=D.PI_OVER_TWO-d*fe,J[Ae++]=1-Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=ge;d>0;d--)xe=D.PI_OVER_TWO-fe*d,J[Ae++]=1-ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=u-y;d>0;d--)J[Ae++]=d*ae,J[Ae++]=1;for(d=1;d<ge+1;d++)xe=D.PI_OVER_TWO+fe*d,J[Ae++]=ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe))}else{for(u/=3,f/=3,ae=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ae,J[Ae++]=1}c.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.normals})),t.tangent&&(c.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.tangents})),t.bitangent&&(c.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.bitangents})),{attributes:c,indices:V}}function dKe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=yge,m=Age,y=lH,A=uH,b=fKe,x=bge,T=c;for(u=0;u<s;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(dr.addAttribute(f,A,E),dr.addAttribute(f,A,E+3),dr.addAttribute(f,A,T),dr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(dr.addAttribute(p,x,E),dr.addAttribute(p,x,E+3),dr.addAttribute(p,x,T),dr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),dr.addAttribute(d,b,E),dr.addAttribute(d,b,E+3),dr.addAttribute(d,b,T),dr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function lJ(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 r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function hKe(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=dr.computePositions(e),o=Tge(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=ui.scaleToGeodeticHeight(f,s,i),m=lJ(f,0,m),g=ui.scaleToGeodeticHeight(g,a,i),m=lJ(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=dKe(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=lJ(O,d*4,L),c.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(A*6);if(e.offsetAttribute===mn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===mn.NONE?0:1;O=O.fill(L)}c.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let b=u.length,x=A+A,T=je.createTypedArray(p.length/3,b*2+x*3);T.set(u);let E=b;for(y=0;y<b;y+=3){let O=u[y],L=u[y+1],_=u[y+2];T[E++]=_+A,T[E++]=L+A,T[E++]=O+A}let v,S,I,R;for(y=0;y<x;y+=2)v=y+x,S=v+x,I=v+1,R=S+1,T[E++]=v,T[E++]=S,T[E++]=I,T[E++]=I,T[E++]=S,T[E++]=R;return{attributes:c,indices:T}}var gge=new h,MM=new h,Vd=new he;function _ge(e,t,n,i,r,o){let s=h.subtract(t,e,gge);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,MM),c=h.cross(s,a,gge);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,MM),n.cartesianToCartographic(MM,Vd);let g=Vd.latitude,m=Vd.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,MM),n.cartesianToCartographic(MM,Vd),g=Vd.latitude,m=Vd.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var zd=new h,NM=new h,ju=new he,Hu=new he;function Ege(e,t,n,i,r){e=xge(e,t);let o=Fr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;ju.latitude=Number.POSITIVE_INFINITY,ju.longitude=Number.POSITIVE_INFINITY,Hu.latitude=Number.NEGATIVE_INFINITY,Hu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===nr.ROUNDED){let p=o[0];h.subtract(p,o[1],zd),h.normalize(zd,zd),h.multiplyByScalar(zd,a,zd),h.add(p,zd,NM),t.cartesianToCartographic(NM,Vd),c=Vd.latitude,u=Vd.longitude,ju.latitude=Math.min(ju.latitude,c),ju.longitude=Math.min(ju.longitude,u),Hu.latitude=Math.max(Hu.latitude,c),Hu.longitude=Math.max(Hu.longitude,u)}for(let p=0;p<s-1;++p)_ge(o[p],o[p+1],t,a,ju,Hu);let f=o[s-1];h.subtract(f,o[s-2],zd),h.normalize(zd,zd),h.multiplyByScalar(zd,a,zd),h.add(f,zd,NM),_ge(f,NM,t,a,ju,Hu),i===nr.ROUNDED&&(t.cartesianToCartographic(NM,Vd),c=Vd.latitude,u=Vd.longitude,ju.latitude=Math.min(ju.latitude,c),ju.longitude=Math.min(ju.longitude,u),Hu.latitude=Math.max(Hu.latitude,c),Hu.longitude=Math.max(Hu.longitude,u));let d=l(r)?r:new ie;return d.north=Hu.latitude,d.south=ju.latitude,d.east=Hu.longitude,d.west=ju.longitude,d}function Og(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??nr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Be.packedLength+7}Og.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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]=e._offsetAttribute??-1,t};var Cge=ee.clone(ee.UNIT_SPHERE),vge=new Be,Rg={positions:void 0,ellipsoid:Cge,vertexFormat:vge,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Og.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=ee.unpack(e,t,Cge);t+=ee.packedLength;let s=Be.unpack(e,t,vge);t+=Be.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Rg.positions=r,Rg.width=a,Rg.height=c,Rg.extrudedHeight=u,Rg.cornerType=f,Rg.granularity=d,Rg.shadowVolume=p,Rg.offsetAttribute=g===-1?void 0:g,new Og(Rg))};Og.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??nr.ROUNDED;return Ege(n,r,i,o,t)};Og.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=xge(t,i);let r=Fr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=hKe(u,c);else{let g=dr.computePositions(u);if(f=Tge(g,c,i),f.attributes.position.values=ui.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===mn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=ce.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new St({attributes:d,indices:f.indices,primitiveType:Oe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Og.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Og({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Og.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ege(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Hx=Og;var Sge=new h,wge=new h,mKe=new h;function pKe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Ige(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new Tn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let M=r[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,E,v,S,I,R,O=m/2,L=je.createTypedArray(y/3,d+4),_=0;if(L[_++]=b/3,L[_++]=(x-2)/3,g){n.push(b/3),R=Sge,I=wge;let M=o[0];for(f=0;f<O;f++)R=h.fromArray(M,(O-1-f)*3,R),I=h.fromArray(M,(O+f)*3,I),dr.addAttribute(A,I,b),dr.addAttribute(A,R,void 0,x),E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3}let C=0,w=i[C++],P=i[C++];for(A.set(w,b),A.set(P,x-P.length+1),p=P.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;for(f=0;f<r.length;f++){let M;a=r[f];let F=a.leftPositions,V=a.rightPositions,B,j=mKe;if(l(F)){for(x-=3,B=v,n.push(S),M=0;M<F.length/3;M++)j=h.fromArray(F,M*3,j),L[_++]=B-M-1,L[_++]=B-M,dr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===nr.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,B=S,n.push(v),M=0;M<V.length/3;M++)j=h.fromArray(V,M*3,j),L[_++]=B+M,L[_++]=B+M+1,dr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===nr.BEVELED&&n.push(b/3-1),x-=3}for(w=i[C++],P=i[C++],w.splice(0,3),P.splice(P.length-3,3),A.set(w,b),A.set(P,x-P.length+1),M=0;M<P.length;M+=3)S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=Sge,I=wge;let M=o[1];for(f=0;f<O;f++)R=h.fromArray(M,(m-f-1)*3,R),I=h.fromArray(M,f*3,I),dr.addAttribute(A,R,void 0,x),dr.addAttribute(A,I,b),S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return L[_++]=b/3,L[_]=(x-2)/3,s.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:L,wallIndices:n}}function gKe(e){let t=e.ellipsoid,n=dr.computePositions(e),i=Ige(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=ui.scaleToGeodeticHeight(u,o,t),d=ui.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===mn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===mn.NONE?0:1;T=T.fill(E)}a.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=je.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];y[A++]=T+f,y[A++]=E+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:a,indices:y}}function LM(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??nr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}LM.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var Pge=ee.clone(ee.UNIT_SPHERE),aA={positions:void 0,ellipsoid:Pge,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};LM.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=ee.unpack(e,t,Pge);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(aA.positions=r,aA.width=s,aA.height=a,aA.extrudedHeight=c,aA.cornerType=u,aA.granularity=f,aA.offsetAttribute=d===-1?void 0:d,new LM(aA))};LM.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=pKe(t,i);let r=Fr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=gKe(c);else{let p=dr.computePositions(c);if(u=Ige(p,c.cornerType),u.attributes.position.values=ui.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=ce.fromVertices(f.position.values,void 0,3);return new St({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var FM=LM;function _Ke(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var BM=_Ke;function yKe(e){return e=e??H.EMPTY_OBJECT,Lx.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var kM=yKe;function AKe(e){return e=e??H.EMPTY_OBJECT,Lx.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var Gx=AKe;function lS(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n}Object.defineProperties(lS.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}}});lS.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Rc({buffer:c,width:o,height:s})})};lS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};lS.prototype.getTileDataAvailable=function(e,t,n){};lS.prototype.loadTileDataAvailability=function(e,t,n){};var uJ=lS;var Dge={};Dge.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*D.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,E=A*t,v=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=o)}return u};var Wx=Dge;var fJ=new U,bKe=new h,xKe=new h,TKe=new h,EKe=new h;function Mg(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Mg.packedLength=Be.packedLength+5;Mg.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Rge=new Be,uS={vertexFormat:Rge,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Mg.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,Rge);t+=Be.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(uS.length=r,uS.topRadius=o,uS.bottomRadius=s,uS.slices=a,uS.offsetAttribute=c===-1?void 0:c,new Mg(uS))};Mg.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=Wx.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let I=r.tangent||r.bitangent,R=0,O=0,L=0,_=Math.atan2(i-n,t),C=bKe;C.z=Math.sin(_);let w=Math.cos(_),P=TKe,M=xKe;for(m=0;m<o;m++){let F=m/o*D.TWO_PI,V=w*Math.cos(F),B=w*Math.sin(F);y&&(C.x=V,C.y=B,I&&(P=h.normalize(h.cross(h.UNIT_Z,C,P),P)),r.normal&&(d[R++]=C.x,d[R++]=C.y,d[R++]=C.z,d[R++]=C.x,d[R++]=C.y,d[R++]=C.z),r.tangent&&(p[O++]=P.x,p[O++]=P.y,p[O++]=P.z,p[O++]=P.x,p[O++]=P.y,p[O++]=P.z),r.bitangent&&(M=h.normalize(h.cross(C,P,M),M),g[L++]=M.x,g[L++]=M.y,g[L++]=M.z,g[L++]=M.x,g[L++]=M.y,g[L++]=M.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let A=12*o-12,b=je.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=s-2,b[x++]=0,b[x++]=1,b[x++]=s-2,b[x++]=1,b[x++]=s-1,m=1;m<o-1;m++)b[x++]=s+m+1,b[x++]=s+m,b[x++]=s;for(m=1;m<o-1;m++)b[x++]=a,b[x++]=a+m,b[x++]=a+m+1;let E=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,EKe);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new Tn;r.position&&(v.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),fJ.x=t*.5,fJ.y=Math.max(i,n);let S=new ce(h.ZERO,U.magnitude(fJ));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===mn.NONE?0:1,R=new Uint8Array(t/3).fill(I);v.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new St({attributes:v,indices:b,primitiveType:Oe.TRIANGLES,boundingSphere:S,offsetAttribute:e._offsetAttribute})};var dJ;Mg.getUnitCylinder=function(){return l(dJ)||(dJ=Mg.createGeometry(new Mg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),dJ};var UM=Mg;var hJ=new U;function fS(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}fS.packedLength=6;fS.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var qx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};fS.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(qx.length=i,qx.topRadius=r,qx.bottomRadius=o,qx.slices=s,qx.numberOfVerticalLines=a,qx.offsetAttribute=c===-1?void 0:c,new fS(qx))};fS.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=Wx.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=je.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new Tn;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),hJ.x=t*.5,hJ.y=Math.max(i,n);let m=new ce(h.ZERO,U.magnitude(hJ));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===mn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new St({attributes:g,indices:f,primitiveType:Oe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var zM=fS;var CKe=1953029805,vKe=2917034100;function mJ(e,t){if(mJ.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===CKe||r===vKe)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}mJ.passThroughDataForTesting=!1;var VM=mJ;var pJ=32767,SKe=new he,wKe=new h;function IKe(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);cn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=D.lerp(t.west,t.east,d/pJ),y=D.lerp(t.south,t.north,p/pJ),A=D.lerp(n,i,g/pJ),b=he.fromRadians(m,y,A,SKe),x=r.cartographicToCartesian(b,wKe);h.pack(x,u,f*3)}return u}var jM=IKe;function Oge(e){this.proxy=e}Oge.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var gJ=Oge;function Mf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Mf.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}}});Mf.packedLength=2;Mf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Mf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Mf),n.near=e[t++],n.far=e[t],n};Mf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Mf.clone=function(e,t){if(l(e))return l(t)||(t=new Mf),t.near=e.near,t.far=e.far,t};Mf.prototype.clone=function(e){return Mf.clone(this,e)};Mf.prototype.equals=function(e){return Mf.equals(this,e)};var Ht=Mf;function HM(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(HM.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});HM.fromDistanceDisplayCondition=function(e){return new HM(e.near,e.far)};HM.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ei=HM;function GM(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(GM.prototype,{length:{get:function(){return this._length}}});function PKe(e,t,n){this.item=e,this.previous=t,this.next=n}GM.prototype.add=function(e){let t=new PKe(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 Mge(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}GM.prototype.remove=function(e){l(e)&&(Mge(this,e),--this._length)};GM.prototype.splice=function(e,t){if(e===t)return;Mge(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 WM=GM;var rr=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-rr.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?rr.Bounce.In(e*2)*.5:rr.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}}}}),qM=function(){return performance.now()},DKe=(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 r=0,o=n;r<o.length;r++){var s=o[r];(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,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=qM()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),dS={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=dS.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=dS.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=dS.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=dS.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,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},Nge=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),_J=new DKe,Lge=(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=rr.Linear.None,this._interpolationFunction=dS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Nge.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=_J,_J.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=qM()),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 r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}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,r,o){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(a,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var A=a;for(var b in A)n[s][b]=A[b];r[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[s]=d=x}this._setupProperties(A,n[s],d,r[s],o)}else(typeof n[s]>"u"||o)&&(n[s]=a),c||(n[s]*=1),f?r[s]=i[s].slice().reverse():r[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=qM()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=qM()),!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=rr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=dS.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,r;if(t===void 0&&(t=qM()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;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+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),A=s-y*a,b=Math.min(A/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];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,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},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 XSn=Nge.nextId,Jp=_J,KSn=Jp.getAll.bind(Jp),$Sn=Jp.removeAll.bind(Jp),JSn=Jp.add.bind(Jp),ZSn=Jp.remove.bind(Jp),QSn=Jp.update.bind(Jp);var RKe={LINEAR_NONE:rr.Linear.None,QUADRATIC_IN:rr.Quadratic.In,QUADRATIC_OUT:rr.Quadratic.Out,QUADRATIC_IN_OUT:rr.Quadratic.InOut,CUBIC_IN:rr.Cubic.In,CUBIC_OUT:rr.Cubic.Out,CUBIC_IN_OUT:rr.Cubic.InOut,QUARTIC_IN:rr.Quartic.In,QUARTIC_OUT:rr.Quartic.Out,QUARTIC_IN_OUT:rr.Quartic.InOut,QUINTIC_IN:rr.Quintic.In,QUINTIC_OUT:rr.Quintic.Out,QUINTIC_IN_OUT:rr.Quintic.InOut,SINUSOIDAL_IN:rr.Sinusoidal.In,SINUSOIDAL_OUT:rr.Sinusoidal.Out,SINUSOIDAL_IN_OUT:rr.Sinusoidal.InOut,EXPONENTIAL_IN:rr.Exponential.In,EXPONENTIAL_OUT:rr.Exponential.Out,EXPONENTIAL_IN_OUT:rr.Exponential.InOut,CIRCULAR_IN:rr.Circular.In,CIRCULAR_OUT:rr.Circular.Out,CIRCULAR_IN_OUT:rr.Circular.InOut,ELASTIC_IN:rr.Elastic.In,ELASTIC_OUT:rr.Elastic.Out,ELASTIC_IN_OUT:rr.Elastic.InOut,BACK_IN:rr.Back.In,BACK_OUT:rr.Back.Out,BACK_IN_OUT:rr.Back.InOut,BOUNCE_IN:rr.Bounce.In,BOUNCE_OUT:rr.Bounce.Out,BOUNCE_IN_OUT:rr.Bounce.InOut},xs=Object.freeze(RKe);var OKe=new h,MKe=new h,NKe=new h,LKe=new h,FKe=new h,BKe=new h(1,1,1),Fge=Math.cos,Bge=Math.sin;function Ng(e){e=e??H.EMPTY_OBJECT;let t=e.radii??BKe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Ng.packedLength=2*h.packedLength+Be.packedLength+7;Ng.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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._offsetAttribute??-1,t};var kge=new h,Uge=new h,zge=new Be,cA={radii:kge,innerRadii:Uge,vertexFormat:zge,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Ng.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,kge);t+=h.packedLength;let r=h.unpack(e,t,Uge);t+=h.packedLength;let o=Be.unpack(e,t,zge);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(cA.minimumClock=s,cA.maximumClock=a,cA.minimumCone=c,cA.maximumCone=u,cA.stackPartitions=f,cA.slicePartitions=d,cA.offsetAttribute=p===-1?void 0:p,new Ng(cA))};Ng.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,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/D.TWO_PI),u=Math.round(u*Math.abs(s-o)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,S=!1;T&&(x=2,o>0&&(E=!0,b+=c-1),s<Math.PI&&(v=!0,b+=c-1),(r-i)%D.TWO_PI?(S=!0,b+=(u-1)*2+1):b+=1);let I=A*y*x,R=new Float64Array(I*3),O=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*x,C=6*(_+b+1-(c+u)*x),w=je.createTypedArray(_,C),P=a.normal?new Float32Array(I*3):void 0,M=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,V=a.st?new Float32Array(I*2):void 0,B=new Array(y),j=new Array(y);for(f=0;f<y;f++)B[f]=Bge(g[f]),j[f]=Fge(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=Fge(m[d]),k[d]=Bge(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*B[f]*G[d],R[p++]=t.y*B[f]*k[d],R[p++]=t.z*j[f];let q=I/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*B[f]*G[d],R[p++]=n.y*B[f]*k[d],R[p++]=n.z*j[f],O[q]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(L[q]=!0),q++;p=0;let Q,W;for(f=1;f<y-2;f++)for(Q=f*A,W=(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=Q+d;if(T){let He=y*A;for(f=1;f<y-2;f++)for(Q=He+f*A,W=He+(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=Q+d,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=W+d+1}let J,Z;if(T){if(E)for(Z=y*A,f=1;f<A-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)w[p++]=J+f+1,w[p++]=J+f,w[p++]=Z+f,w[p++]=J+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(S){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,w[p++]=Z,w[p++]=J+A,w[p++]=J,w[p++]=Z,w[p++]=Z+A,w[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,w[p++]=J+A,w[p++]=Z,w[p++]=J,w[p++]=J+A,w[p++]=Z+A,w[p++]=Z}let ae=new Tn;a.position&&(ae.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,fe=0,xe=0,ge=0,we=I/2,Se,Re=ee.fromCartesian3(t),Qe=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){Se=O[f]?Qe:Re;let He=h.fromArray(R,f*3,OKe),Xe=Se.geodeticSurfaceNormal(He,MKe);if(L[f]&&h.negate(Xe,Xe),a.st){let $e=U.negate(Xe,FKe);V[Ae++]=Math.atan2($e.y,$e.x)/D.TWO_PI+.5,V[Ae++]=Math.asin(Xe.z)/Math.PI+.5}if(a.normal&&(P[fe++]=Xe.x,P[fe++]=Xe.y,P[fe++]=Xe.z),a.tangent||a.bitangent){let $e=NKe,Pe=0,qe;if(O[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+A*2?qe=h.UNIT_X:qe=h.UNIT_Z,h.cross(qe,Xe,$e),h.normalize($e,$e),a.tangent&&(M[xe++]=$e.x,M[xe++]=$e.y,M[xe++]=$e.z),a.bitangent){let st=h.cross(Xe,$e,LKe);h.normalize(st,st),F[ge++]=st.x,F[ge++]=st.y,F[ge++]=st.z}}}a.st&&(ae.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(ae.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:P})),a.tangent&&(ae.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:M})),a.bitangent&&(ae.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let He=R.length,Xe=e._offsetAttribute===mn.NONE?0:1,$e=new Uint8Array(He/3).fill(Xe);ae.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:$e})}return new St({attributes:ae,indices:w,primitiveType:Oe.TRIANGLES,boundingSphere:ce.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var yJ;Ng.getUnitEllipsoid=function(){return l(yJ)||(yJ=Ng.createGeometry(new Ng({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),yJ};var Ua=Ng;var kKe=new h(1,1,1),fH=Math.cos,dH=Math.sin;function hS(e){e=e??H.EMPTY_OBJECT;let t=e.radii??kKe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}hS.packedLength=2*h.packedLength+8;hS.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.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]=e._offsetAttribute??-1,t};var Vge=new h,jge=new h,Lg={radii:Vge,innerRadii:jge,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};hS.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Vge);t+=h.packedLength;let r=h.unpack(e,t,jge);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(Lg.minimumClock=o,Lg.maximumClock=s,Lg.minimumCone=a,Lg.maximumCone=c,Lg.stackPartitions=u,Lg.slicePartitions=f,Lg.subdivisions=d,Lg.offsetAttribute=p===-1?void 0:p,new hS(Lg))};hS.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,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/D.TWO_PI),f=Math.round(f*Math.abs(s-o)/D.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let A=a*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=je.createTypedArray(A,x),E,v,S,I,R=0,O=new Array(f),L=new Array(f);for(E=0;E<f;E++)I=o+E*(s-o)/(f-1),O[E]=dH(I),L[E]=fH(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=dH(S),C[E]=fH(S);for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(O.length=a,L.length=a,E=0;E<a;E++)I=o+E*(s-o)/(a-1),O[E]=dH(I),L[E]=fH(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=dH(S),C[E]=fH(S);for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(R=0,E=0;E<f*p;E++){let M=E*a;for(v=0;v<a-1;v++)T[R++]=M+v,T[R++]=M+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g){let M=f*a*p,F=M+a*u;if(m)for(E=0;E<u;E++)T[R++]=M+E,T[R++]=F+E;if(y)for(M+=a*u-u,F+=a*u-u,E=0;E<u;E++)T[R++]=M+E,T[R++]=F+E}let P=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let M=b.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(M/3).fill(F);P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new St({attributes:P,indices:T,primitiveType:Oe.LINES,boundingSphere:ce.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Nf=hS;function mS(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(mS.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(){}}});mS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Rc({buffer:new Uint8Array(256),width:16,height:16}))};mS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};mS.prototype.getTileDataAvailable=function(e,t,n){};mS.prototype.loadTileDataAvailability=function(e,t,n){};var Zp=mS;function AJ(){this._removalFunctions=[]}AJ.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};AJ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Go=AJ;var Hge={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(Hge);var Kl=Hge;function Qp(e){e=e??H.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ta,this._perspectiveMatrix=new N,this._infinitePerspective=new N}function bJ(e){let{top:t,bottom:n,right:i,left:r,near:o,far:s}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=N.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=N.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(Qp.prototype,{projectionMatrix:{get:function(){return bJ(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return bJ(this),this._infinitePerspective}}});var UKe=new h,zKe=new h,VKe=new h,jKe=new h;Qp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,UKe),d=zKe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=VKe;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=jKe;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};Qp.prototype.getPixelDimensions=function(e,t,n,i,r){bJ(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};Qp.prototype.clone=function(e){return l(e)||(e=new Qp),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};Qp.prototype.equals=function(e){return l(e)&&e instanceof Qp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Qp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Qp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var $l=Qp;function Gu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new $l,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}Gu.packedLength=6;Gu.pack=function(e,t,n){return n=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};Gu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Gu),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 sm(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(Gu.prototype,{projectionMatrix:{get:function(){return sm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return sm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return sm(this),this._fovy}},sseDenominator:{get:function(){return sm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return sm(this),this._offCenterFrustum}}});Gu.prototype.computeCullingVolume=function(e,t,n){return sm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Gu.prototype.getPixelDimensions=function(e,t,n,i,r){return sm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Gu.prototype.clone=function(e){return l(e)||(e=new Gu),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};Gu.prototype.equals=function(e){return!l(e)||!(e instanceof Gu)?!1:(sm(this),sm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Gu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Gu)?!1:(sm(this),sm(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ki=Gu;var hH=0,HKe=1;function Yx(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof Ki?(s=hH,a=Ki.packedLength):t instanceof gn&&(s=HKe,a=gn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength+Be.packedLength}Yx.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===hH?(Ki.pack(r,t,n),n+=Ki.packedLength):(gn.pack(r,t,n),n+=gn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var GKe=new Ki,WKe=new gn,qKe=new Le,YKe=new h,XKe=new Be;Yx.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===hH?(r=Ki.unpack(e,t,GKe),t+=Ki.packedLength):(r=gn.unpack(e,t,WKe),t+=gn.packedLength);let o=h.unpack(e,t,YKe);t+=h.packedLength;let s=Le.unpack(e,t,qKe);t+=Le.packedLength;let a=Be.unpack(e,t,XKe);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new Yx({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Be.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function pS(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.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;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var KKe=new $,$Ke=new N,xJ=new N,Gge=new h,Wge=new h,qge=new h,JKe=new h,ZKe=new h,QKe=new h,lA=new Array(3),YM=new Array(4);YM[0]=new se(-1,-1,1,1);YM[1]=new se(1,-1,1,1);YM[2]=new se(1,1,1,1);YM[3]=new se(-1,1,1,1);var Yge=new Array(4);for(let e=0;e<4;++e)Yge[e]=new se;Yx._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,KKe),u=o??Gge,f=s??Wge,d=a??qge;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=N.computeView(e,d,f,u,$Ke),g,m,y=i.projectionMatrix;if(n===hH){let A=N.multiply(y,p,xJ);m=N.inverse(A,xJ)}else g=N.inverseTransformation(p,xJ);l(m)?(lA[0]=i.near,lA[1]=i.far):(lA[0]=0,lA[1]=i.near,lA[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(YM[b],Yge[b]);if(l(m)){x=N.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let E=h.dot(d,x);h.multiplyByScalar(x,lA[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=lA[A],v=lA[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(E-v)-E-v)*.5,x.w=1,N.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};Yx.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(72);Yx._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new Tn({position:new Ne({componentDatatype:Y.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(12*a):void 0,m=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,A=Gge,b=Wge,x=qge,T=h.negate(A,JKe),E=h.negate(b,ZKe),v=h.negate(x,QKe);u=0,o&&(pS(u,p,g,m,y,v,A,b),u+=12),pS(u,p,g,m,y,x,T,b),u+=12,pS(u,p,g,m,y,T,v,b),u+=12,pS(u,p,g,m,y,E,v,T),u+=12,pS(u,p,g,m,y,A,x,b),u+=12,pS(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new St({attributes:f,indices:d,primitiveType:Oe.TRIANGLES,boundingSphere:ce.fromVertices(c)})};var Xx=Yx;var TJ=0,e$e=1;function XM(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Ki?(o=TJ,s=Ki.packedLength):t instanceof gn&&(o=e$e,s=gn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength}XM.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===TJ?(Ki.pack(r,t,n),n+=Ki.packedLength):(gn.pack(r,t,n),n+=gn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var t$e=new Ki,n$e=new gn,i$e=new Le,r$e=new h;XM.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===TJ?(r=Ki.unpack(e,t,t$e),t+=Ki.packedLength):(r=gn.unpack(e,t,n$e),t+=gn.packedLength);let o=h.unpack(e,t,r$e);t+=h.packedLength;let s=Le.unpack(e,t,i$e);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new XM({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};XM.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);Xx._computeNearFarPlanes(i,r,t,n,s);let a=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new St({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:ce.fromVertices(s)})};var KM=XM;function mH(){pe.throwInstantiationError()}Object.defineProperties(mH.prototype,{credit:{get:pe.throwInstantiationError}});mH.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};mH.prototype.geocode=pe.throwInstantiationError;var gS=mH;var Xge={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(Xge);var uA=Xge;function Kge(){pe.throwInstantiationError()}Kge.createGeometry=function(e){pe.throwInstantiationError()};var EJ=Kge;function o$e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var il=o$e;var $ge=Qo(Tf(),1);function s$e(e){let t=new $ge.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Fg=s$e;function a$e(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var $M=a$e;var h$e=Qo(CJ(),1);function c$e(e,t){return(e&t)!==0}var rl=c$e;var l$e=[1,2,4,8],Jge=15,u$e=16,f$e=64,d$e=128;function e0(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}e0.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 e0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};e0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};e0.prototype.hasSubtree=function(){return rl(this._bits,u$e)};e0.prototype.hasImagery=function(){return rl(this._bits,f$e)};e0.prototype.hasTerrain=function(){return rl(this._bits,d$e)};e0.prototype.hasChildren=function(){return rl(this._bits,Jge)};e0.prototype.hasChild=function(e){return rl(this._bits,l$e[e])};e0.prototype.getChildBitmask=function(){return this._bits&Jge};var ZM=e0;function m$e(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var p$e=m$e(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB +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9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 +\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Lf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Lf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Lf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new Lf;i._resource=n;try{await g$e(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${Qge(i,"",1).url}: ${r}`;throw new oe(o)}return i};Lf.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;rl(t,o)?rl(e,o)&&(s|=1):(s|=2,rl(e,o)||(s|=1)),i+=s}return i};Lf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];rl(s,2)?rl(s,1)||(t|=o):(n|=o,rl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Lf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Zge=new $n("decodeGoogleEarthEnterprisePacket");Lf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=Qge(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return Zge.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let b=ZM.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};Lf.prototype.populateSubtree=function(e,t,n,i){let r=Lf.tileXYToQuadKey(e,t,n);return wJ(this,r,i)};function wJ(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new wo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),wJ(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new wo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),wJ(e,t,s)}).finally(function(){delete a[r]})}Lf.prototype.getTileInformation=function(e,t,n){let i=Lf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Lf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Qge(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var vJ,SJ;function g$e(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(SJ)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;SJ=tx(n).then(function(){vJ=window.cesiumGoogleEarthDbRootParser(h$e),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return SJ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=vJ.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return Zge.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=vJ.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=p$e})}var Bg=Lf;function Kx(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(Kx.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var n_e="createVerticesFromGoogleEarthEnterpriseBuffer",_$e=new $n(n_e),y$e=new $n(n_e,Lu.maximumAsynchronousTasks),e_e=new ie,pH=new ie;Kx.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,e_e),t.tileXYToRectangle(n,i,r,pH);let u=c.cartographicToCartesian(ie.center(pH)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?y$e:_$e).scheduleTask({buffer:this._buffer,nativeRectangle:e_e,rectangle:pH,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new lc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,pH,ce.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),_o.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};Kx.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),r=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?E$e(this,i,r):S$e(this,i,r,e)};var A$e=new $n("upsampleQuantizedTerrainMesh",Lu.maximumAsynchronousTasks);Kx.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=A$e.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:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=je.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new Nx({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ce.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};Kx.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};Kx.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var b$e=new U,x$e=new U,T$e=new U,i_e=new h;function E$e(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,b$e),g=o.decodeTextureCoordinates(r,f,x$e),m=o.decodeTextureCoordinates(r,d,T$e),y=Jh.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,i_e);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var C$e=Uint16Array.BYTES_PER_ELEMENT,t_e=Uint32Array.BYTES_PER_ELEMENT,IJ=Int32Array.BYTES_PER_ELEMENT,v$e=Float32Array.BYTES_PER_ELEMENT,PJ=Float64Array.BYTES_PER_ELEMENT;function S$e(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=t_e;u+=t_e,u+=2*PJ;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=PJ;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=PJ;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=IJ;let y=c.getInt32(u,!0)*3;u+=IJ,u+=IJ;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=s+c.getUint8(u++)*p,b[T]=a+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=v$e;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=C$e;for(T=0;T<y;T+=3){let v=E[T],S=E[T+1],I=E[T+2],R=A[v],O=A[S],L=A[I],_=b[v],C=b[S],w=b[I],P=Jh.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,i_e);if(P.x>=-1e-15&&P.y>=-1e-15&&P.z>=-1e-15)return P.x*x[v]+P.y*x[S]+P.z*x[I]}}var _S=Kx;var jd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},gH=new K;function _H(){this._terrainCache={},this._lastTidy=K.now()}_H.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};_H.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};_H.prototype.tidy=function(){if(K.now(gH),K.secondsDifference(gH,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(gH,o.timestamp)>10&&delete e[r]}K.clone(gH,this._lastTidy)}};function fA(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new _H,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(fA.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(){}}});fA.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new fA(t);return n._metadata=e,n};var w$e=new $n("decodeGoogleEarthEnterprisePacket");function r_e(e,t,n){let i=t.getChildBitmask();if(t.terrainState===jd.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}fA.prototype.requestTileGeometry=function(e,t,n,i){let r=Bg.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=jd.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new _S({buffer:u,childTileMask:r_e(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===jd.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new Rc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case jd.SELF:p=a.terrainVersion;break;case jd.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case jd.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=I$e(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?w$e.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=jd.SELF,o.add(d,T[0]);let v=E.terrainProvider,S=T.length-1;for(let I=0;I<S;++I){let R=d+I.toString(),O=s.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[I+1]),O.terrainState=jd.PARENT,O.terrainProvider===0&&(O.terrainProvider=v))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=s.providers[a.terrainProvider];return new _S({buffer:b,childTileMask:r_e(r,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===Ti.CANCELLED?(i.state=A.state,Promise.reject(b)):(a.terrainState=jd.NONE,Promise.reject(b))})};fA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};fA.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=Bg.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===jd.NONE)return!1;if((!l(s)||s===jd.UNKNOWN)&&(o.terrainState=jd.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};fA.prototype.loadTileDataAvailability=function(e,t,n){};function I$e(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 DJ=fA;var P$e="https://maps.googleapis.com/maps/api/geocode/json",o_e='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function RJ(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:P$e,queryParameters:{key:t}}),this._credit=new It(o_e,!0)}Object.defineProperties(RJ.prototype,{credit:{get:function(){return this._credit}}});RJ.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 oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,s=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,s.lng,s.lat),attribution:{html:o_e,collapsible:!1}}})};var OJ=RJ;var yS={};yS.defaultApiKey=void 0;yS.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});yS.defaultStreetViewStaticApiKey=void 0;yS.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});yS.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Aa=yS;var zJ=[Ui,gi],D$e=zJ.length,v_e=Math.cos(D.toRadians(30)),s_e=Math.cos(D.toRadians(150)),S_e=0,w_e=1e3;function hA(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(hA.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});hA.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<D$e;i++)if(t instanceof zJ[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var R$e=new h,a_e=new h,c_e=new h;function UJ(e,t,n,i,r){let o=Jl(i,e,0,R$e),s=Jl(i,e,n,a_e),a=Jl(i,t,0,c_e),c=kg(s,o,a_e),u=kg(a,o,c_e);return h.cross(u,c,r),h.normalize(r,r)}var O$e=new he,M$e=new h,N$e=new h,L$e=new h;function MJ(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new Pg(e,t,s):o===ln.RHUMB&&(d=new Nc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=UJ(e,t,i,s,L$e),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=a.length;for(let T=0;T<b;T++){let E=d.interpolateUsingSurfaceDistance(A,O$e),v=Jl(s,E,n,M$e),S=Jl(s,E,i,N$e);h.pack(g,a,x),h.pack(v,c,x),h.pack(S,u,x),f.push(E.latitude),f.push(E.longitude),x+=3,A+=y}}var NJ=new he;function Jl(e,t,n,i){return he.clone(t,NJ),NJ.height=n,he.toCartesian(NJ,e,i)}hA.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};hA.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new hA({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function kg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function l_e(e,t,n,i){return i=kg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var F$e=new h,B$e=new h,k$e=new h,I_e=new h,U$e=0,z$e=-1;function LJ(e,t,n,i,r){let o=kg(n,t,I_e),s=l_e(e,t,o,F$e),a=l_e(i,t,o,B$e);if(D.equalsEpsilon(h.dot(s,a),z$e,D.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,k$e);return h.dot(a,c)<U$e&&(r=h.negate(r,r)),r}var xH=sn.fromPointNormal(h.ZERO,h.UNIT_Y),V$e=new h,j$e=new h,H$e=new h,G$e=new h,W$e=new h,yH=new h,AH=new he,u_e=new he,f_e=new he;hA.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new zJ[e._projectionIndex](i),a=S_e,c=w_e,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Nc(void 0,void 0,i),x,T,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=pi.lineSegmentPlane(g,m,xH,yH),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,AH).longitude,y=i.cartesianToCartographic(g,AH),A=i.cartesianToCartographic(m,u_e),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,f_e),x=i.cartographicToCartesian(T,yH),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&v.push(h.clone(x)))),v.push(m);n&&(g=d[p-1],m=d[0],x=pi.lineSegmentPlane(g,m,xH,yH),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,AH).longitude,y=i.cartesianToCartographic(g,AH),A=i.cartesianToCartographic(m,u_e),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,f_e),x=i.cartographicToCartesian(T,yH),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&v.push(h.clone(x)))));let S=v.length,I=new Array(S);for(f=0;f<S;f++){let q=he.fromCartesian(v[f],i);q.height=0,I[f]=q}if(I=Fr(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=V$e,w=j$e,P=H$e,M=G$e,F=W$e,V=I[0],B=I[1],j=I[S-1];for(C=Jl(i,j,a,C),M=Jl(i,B,a,M),w=Jl(i,V,a,w),P=Jl(i,V,c,P),n?F=LJ(C,w,P,M,F):F=UJ(V,B,c,i,F),h.pack(F,O,0),h.pack(w,L,0),h.pack(P,_,0),R.push(V.latitude),R.push(V.longitude),MJ(V,B,a,c,r,o,i,O,L,_,R),f=1;f<S-1;++f){C=h.clone(w,C),w=h.clone(M,w);let q=I[f];Jl(i,q,c,P),Jl(i,I[f+1],a,M),LJ(C,w,P,M,F),u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(P,_,u),R.push(q.latitude),R.push(q.longitude),MJ(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=Jl(i,k,a,w),P=Jl(i,k,c,P),n){let q=I[0];C=Jl(i,G,a,C),M=Jl(i,q,a,M),F=LJ(C,w,P,M,F)}else F=UJ(G,k,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(P,_,u),R.push(k.latitude),R.push(k.longitude),n){for(MJ(k,V,a,c,r,o,i,O,L,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return _Je(n,s,L,_,O,R,t)};var q$e=new h,Y$e=new $,X$e=new Le;function d_e(e,t,n,i){let r=kg(n,t,q$e),o=h.dot(r,e);if(o>v_e||o<s_e){let s=kg(i,n,I_e),a=o<s_e?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,X$e),u=$.fromQuaternion(c,Y$e);return $.multiplyByVector(u,e,e),!0}return!1}var h_e=new he,K$e=new h,m_e=new h;function QM(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,K$e),s=h.add(o,n,m_e),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,h_e);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,m_e),u=c.cartesianToCartographic(s,h_e)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var $$e=new h,p_e=new h;function g_e(e,t,n,i,r,o){let s=h.subtract(t,e,$$e);h.normalize(s,s);let a=n-S_e,c=h.multiplyByScalar(s,a,p_e);h.add(e,c,r);let u=i-w_e;c=h.multiplyByScalar(s,u,p_e),h.add(t,c,o)}var J$e=new h;function bH(e,t){let n=sn.getPointDistance(xH,e),i=sn.getPointDistance(xH,t),r=J$e;D.equalsEpsilon(n,0,D.EPSILON2)?(r=kg(t,e,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=kg(e,t,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(t,r,t))}function Z$e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let r=D.sign(t.longitude);return e.longitude=r*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let r=D.sign(e.longitude);return t.longitude=r*(i-D.EPSILON11),2}return 0}var P_e=new he,D_e=new he,__e=new h,FJ=new h,y_e=new h,A_e=new h,Q$e=new h,b_e=new h,eJe=[P_e,D_e],tJe=new ie,nJe=new h,iJe=new h,rJe=new h,oJe=new h,sJe=new h,aJe=new h,BJ=new h,kJ=new h,cJe=new h,lJe=new h,uJe=new h,x_e=new h,fJe=new h,dJe=new h,hJe=new Sn,mJe=new Sn,T_e=new h,pJe=new h,E_e=new h,gJe=[new ce,new ce],R_e=[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],C_e=R_e.length;function _Je(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),v,S,I,R;s&&(v=new Float32Array(p),S=new Float32Array(p),I=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,L=0,_=P_e;_.height=0;let C=D_e;C.height=0;let w=__e,P=FJ;if(s)for(c=0,a=1;a<O;a++)_.latitude=o[c],_.longitude=o[c+1],C.latitude=o[c+2],C.longitude=o[c+3],w=t.project(_,w),P=t.project(C,P),L+=h.distance(w,P),c+=2;let M=i.length/3;P=h.unpack(i,0,P);let F=0;for(c=3,a=1;a<M;a++)w=h.clone(P,w),P=h.unpack(i,c,P),F+=h.distance(w,P),c+=3;let V;c=3;let B=0,j=0,k=0,G=0,q=!1,Q=h.unpack(n,0,A_e),W=h.unpack(i,0,FJ),J=h.unpack(r,0,b_e);if(e){let Se=h.unpack(n,n.length-6,y_e);d_e(J,Se,Q,W)&&(J=h.negate(J,J))}let Z=0,ae=0,Ae=0;for(a=0;a<f;a++){let Se=h.clone(Q,y_e),Re=h.clone(W,__e),Qe=h.clone(J,Q$e);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,A_e),W=h.unpack(i,c,FJ),J=h.unpack(r,c,b_e),q=d_e(J,Se,Q,W),_.latitude=o[B],_.longitude=o[B+1],C.latitude=o[B+2],C.longitude=o[B+3];let He,Xe,$e,Pe;if(s){let mi=Z$e(_,C);He=t.project(_,sJe),Xe=t.project(C,aJe);let ho=kg(Xe,He,T_e);ho.y=Math.abs(ho.y),$e=BJ,Pe=kJ,mi===0||h.dot(ho,h.UNIT_Y)>v_e?($e=QM(t,_,Qe,He,BJ),Pe=QM(t,C,J,Xe,kJ)):mi===1?(Pe=QM(t,C,J,Xe,kJ),$e.x=0,$e.y=D.sign(_.longitude-Math.abs(C.longitude)),$e.z=0):($e=QM(t,_,Qe,He,BJ),Pe.x=0,Pe.y=D.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(Se,hJe),vt=h.subtract(Q,Se,cJe),Gt=h.normalize(vt,x_e),lt=h.subtract(Re,Se,lJe);lt=h.normalize(lt,lt);let mt=h.cross(Gt,lt,x_e);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,fJe);ft=h.normalize(ft,ft);let Xt=h.subtract(W,Q,uJe);Xt=h.normalize(Xt,Xt);let rt=h.cross(J,Xt,dJe);rt=h.normalize(rt,rt);let ht=qe/F,Bi=Z/F,Xn=0,Ai,Wi,wi,di=0,bi=0;if(s){Xn=h.distance(He,Xe),Ai=Sn.fromCartesian(He,mJe),Wi=h.subtract(Xe,He,T_e),wi=h.normalize(Wi,pJe);let mi=wi.x;wi.x=wi.y,wi.y=-mi,di=Xn/L,bi=ae/L}for(V=0;V<8;V++){let mi=G+V*4,ho=j+V*2,ur=mi+3,Zo=V<4?1:-1,Bn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,mi),A[ur]=vt.x,h.pack(st.low,b,mi),b[ur]=vt.y,h.pack(ft,x,mi),x[ur]=vt.z,h.pack(rt,T,mi),T[ur]=ht*Zo,h.pack(mt,E,mi);let qi=Bi*Bn;qi===0&&Bn<0&&(qi=9),E[ur]=qi,s&&(v[mi]=Ai.high.x,v[mi+1]=Ai.high.y,v[mi+2]=Ai.low.x,v[mi+3]=Ai.low.y,I[mi]=-$e.y,I[mi+1]=$e.x,I[mi+2]=Pe.y,I[mi+3]=-Pe.x,S[mi]=Wi.x,S[mi+1]=Wi.y,S[mi+2]=wi.x,S[mi+3]=wi.y,R[ho]=di*Zo,qi=bi*Bn,qi===0&&Bn<0&&(qi=9),R[ho+1]=qi)}let jn=rJe,nn=oJe,Wn=nJe,Zi=iJe,Mr=ie.fromCartographicArray(eJe,tJe),fo=Mi.getMinimumMaximumHeights(Mr,u),Bs=fo.minimumTerrainHeight,Ks=fo.maximumTerrainHeight;Ae+=Math.abs(Bs),Ae+=Math.abs(Ks),g_e(Se,Re,Bs,Ks,jn,Wn),g_e(Q,W,Bs,Ks,nn,Zi);let no=h.multiplyByScalar(mt,D.EPSILON5,E_e);h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),bH(jn,nn),bH(Wn,Zi),h.pack(jn,y,k),h.pack(nn,y,k+3),h.pack(Zi,y,k+6),h.pack(Wn,y,k+9),no=h.multiplyByScalar(mt,-2*D.EPSILON5,E_e),h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),bH(jn,nn),bH(Wn,Zi),h.pack(jn,y,k+12),h.pack(nn,y,k+15),h.pack(Zi,y,k+18),h.pack(Wn,y,k+21),B+=2,c+=3,j+=16,k+=24,G+=32,Z+=qe,ae+=Xn}c=0;let fe=0;for(a=0;a<f;a++){for(V=0;V<C_e;V++)m[c+V]=R_e[V]+fe;fe+=8,c+=C_e}let xe=gJe;ce.fromVertices(n,h.ZERO,3,xe[0]),ce.fromVertices(i,h.ZERO,3,xe[1]);let ge=ce.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:dA(A),startLoAndForwardOffsetY:dA(b),startNormalAndForwardOffsetZ:dA(x),endNormalAndTextureCoordinateNormalizationX:dA(T),rightNormalAndTextureCoordinateNormalizationY:dA(E)};return s&&(we.startHiLo2D=dA(v),we.offsetAndRight2D=dA(S),we.startEndNormals2D=dA(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new St({attributes:we,indices:m,boundingSphere:ge})}function dA(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}hA._projectNormal=QM;var $x=hA;function VJ(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}VJ.clone=function(e,t){if(l(e))return l(t)||(t=new VJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Hd=VJ;var yJe=D.factorial;function jJ(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=jJ(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var AJe=[],HJ=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u,f,d,p=n.length,g=new Array(r);for(s=0;s<r;s++){o[s]=0;let b=new Array(p);for(g[s]=b,a=0;a<p;a++)b[a]=[]}let m=p,y=new Array(m);for(s=0;s<m;s++)y[s]=s;let A=p-1;for(u=0;u<r;u++){for(a=0;a<m;a++)d=y[a]*r+u,g[u][0].push(i[d]);for(s=1;s<m;s++){let b=!1;for(a=0;a<m-s;a++){let x=n[y[a]],T=n[y[a+s]],E;T-x<=0?(d=y[a]*r+r*s+u,E=i[d],g[u][s].push(E/yJe(s))):(E=g[u][s-1][a+1]-g[u][s-1][a],g[u][s].push(E/(T-x))),b=b||E!==0}b||(A=s-1)}}for(c=0,f=0;c<=f;c++)for(s=c;s<=A;s++){let b=jJ(t,y,n,c,s,[]);for(u=0;u<r;u++){let x=g[u][s][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,s,a){let c=r*(s+1);l(a)||(a=new Array(c));for(let x=0;x<c;x++)a[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=AJe,m=bJe(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,s);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=jJ(t,f,n,x,d,y),E=Math.floor(d*(1-d)/2)+p*d;for(let v=0;v<r;v++){let S=Math.floor(v*A),I=g[S+E];a[v+x*r]+=I*T}}return a}};function bJe(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(s=0;s<u-g;s++){let b=n[t[s]],x=n[t[s+g]],T,E;if(x-b<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],E=T/D.factorial(g),e[p+y+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],E=T/(x-b),e[p+y+m]=E,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var eN=HJ;var GJ={};GJ.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),O_e(i,r,o,s);return c};GJ.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),O_e(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function O_e(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var AS=GJ;function xJe(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var tN=xJe;var q_e={},TJe=32.184,EJe=2451545,M_e=-.0529921,N_e=-.1059842,L_e=13.0120009,F_e=13.3407154,B_e=.9856003,k_e=26.4057084,U_e=13.064993,z_e=.3287146,V_e=1.7484877,j_e=-.1589763,H_e=.0036096,G_e=.1643573,W_e=12.9590088,WJ=new K;q_e.ComputeMoon=function(e,t){l(e)||(e=K.now()),WJ=K.addSeconds(e,TJe,WJ);let n=K.totalDays(WJ)-EJe,i=n/kn.DAYS_PER_JULIAN_CENTURY,r=(125.045+M_e*n)*D.RADIANS_PER_DEGREE,o=(250.089+N_e*n)*D.RADIANS_PER_DEGREE,s=(260.008+L_e*n)*D.RADIANS_PER_DEGREE,a=(176.625+F_e*n)*D.RADIANS_PER_DEGREE,c=(357.529+B_e*n)*D.RADIANS_PER_DEGREE,u=(311.589+k_e*n)*D.RADIANS_PER_DEGREE,f=(134.963+U_e*n)*D.RADIANS_PER_DEGREE,d=(276.617+z_e*n)*D.RADIANS_PER_DEGREE,p=(34.226+V_e*n)*D.RADIANS_PER_DEGREE,g=(15.134+j_e*n)*D.RADIANS_PER_DEGREE,m=(119.743+H_e*n)*D.RADIANS_PER_DEGREE,y=(239.961+G_e*n)*D.RADIANS_PER_DEGREE,A=(25.053+W_e*n)*D.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(s),E=Math.sin(a),v=Math.sin(c),S=Math.sin(u),I=Math.sin(f),R=Math.sin(d),O=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(y),w=Math.sin(A),P=Math.cos(r),M=Math.cos(o),F=Math.cos(s),V=Math.cos(a),B=Math.cos(c),j=Math.cos(u),k=Math.cos(f),G=Math.cos(d),q=Math.cos(p),Q=Math.cos(g),W=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ae=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*E+.0072*S-.0052*L+.0043*w)*D.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*P+.0239*M-.0278*F+.0068*V-.0029*j+9e-4*k+8e-4*Q-9e-4*Z)*D.RADIANS_PER_DEGREE,fe=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*E+.0252*v-.0066*S-.0047*I-.0046*R+.0028*O+.0052*L+.004*_+.0019*C-.0044*w)*D.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*P*M_e+.1208*M*N_e-.0642*F*L_e+.0158*V*F_e+.0252*B*B_e-.0066*j*k_e-.0047*k*U_e-.0046*G*z_e+.0028*q*V_e+.0052*Q*j_e+.004*W*H_e+.0019*J*G_e-.0044*Z*W_e)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new tN),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var nN=q_e;function Y_e(e){(!l(e)||typeof e!="function")&&(e=nN.ComputeMoon),this._computeFunction=e}var CJe=new h,vJe=new h,SJe=new h;function wJe(e,t,n){let i=CJe;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=SJe;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,vJe);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var IJe=new $,PJe=new Le;Y_e.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=wJe(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,PJe),s=$.fromQuaternion(Le.conjugate(o,o),IJe);return $.multiply(s,i,i)};var iN=Y_e;var qJ=class{constructor(){ut(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,s,a){pe.throwInstantiationError()}},YJ=qJ;var X_e={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(X_e);var am=X_e;var K_e={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(K_e);var Ug=K_e;function XJ(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(XJ.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});XJ.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===uA.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ie.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var rN=XJ;function DJe(e){if(!Object.values(Ug).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var $_e=Object.freeze({[Ug.GOOGLE]:"google",[Ug.BING]:"bing",[Ug.DEFAULT]:void 0});function RJe(e){return $_e[e]}function OJe(e){return Object.entries($_e).find(t=>t[1]===e)[0]}function KJ(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??Ug.DEFAULT,n=e.accessToken??zu.defaultAccessToken,i=De.createIfNeeded(e.server??zu.defaultServer);i.appendForwardSlash();let r=zu.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new rN(o),this.geocodeProviderType=t}Object.defineProperties(KJ.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return OJe(this._pelias.url.queryParameters.geocoder)},set:function(e){DJe(e);let t={...this._pelias.url.queryParameters,geocoder:RJe(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});KJ.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var Jx=KJ;var J_e={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(J_e);var $J=J_e;var Z_e={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(Z_e);var JJ=Z_e;var Q_e={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(Q_e);var oN=Q_e;var eye={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(eye);var ZJ=eye;function tye(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function nye(e){let t=he.fromCartesian(e);return{longitude:D.toDegrees(t.longitude),latitude:D.toDegrees(t.latitude),height:t.height}}function MJe(e){let t=[],n=new se;for(let i=0;i<4;i++)N.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function NJe(e,t,n){return N.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var LJe=new N,FJe=new N,TH=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??H.EMPTY_OBJECT;let i=n.accessToken??zu.defaultAccessToken,r=De.createIfNeeded(n.server??zu.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:Ho._addClientHeaders()};l(i)&&(o.queryParameters={access_token:i});let s=r.getDerivedResource(o),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new oe(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=N.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,r){r=r??new N;let o=NJe(n,i,LJe);return N.multiply(t.viewMatrix,this.ecefTransform,r),N.multiply(t.frustum.projectionMatrix,r,r),N.multiply(o,r,r)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,FJe),i={testPoint:nye(t.testPoint),closePoint:nye(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??oN.NEAREST,worldToView:MJe(n)},r;try{r=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(r))return;let o={heat:r.heat,geometryType:r.geomType,parentGeometryType:r.parentGeomType,normal:r.normal,curve:r.curve};return o.snapPoint=tye(r.snapPoint),o.hitPoint=tye(r.hitPoint),o}};TH.DEFAULT_SNAP_APERTURE=12;var QJ=TH;function Mo(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Mo.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var bS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Mo.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=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(bS.start=i,bS.stop=r,bS.isStartIncluded=o,bS.isStopIncluded=s,bS.data=a,new Mo(bS))};Mo.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Mo.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 Mo(e)};Mo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Mo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Mo.intersect=function(e,t,n,i){if(!l(t))return Mo.clone(Mo.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=K.greaterThanOrEquals(s,r)&&K.greaterThanOrEquals(o,s),u=!c&&K.lessThanOrEquals(s,r)&&K.lessThanOrEquals(r,a);if(!c&&!u)return Mo.clone(Mo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,a);return l(n)||(n=new Mo),n.start=c?s:r,n.isStartIncluded=f&&p||!K.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!K.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Mo.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Mo.prototype.clone=function(e){return Mo.clone(this,e)};Mo.prototype.equals=function(e,t){return Mo.equals(this,e,t)};Mo.prototype.equalsEpsilon=function(e,t,n){return Mo.equalsEpsilon(this,e,t,n)};Mo.prototype.toString=function(){return Mo.toIso8601(this)};Mo.EMPTY=Object.freeze(new Mo({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Cn=Mo;var iye=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),rye=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),BJe=Object.freeze(new Cn({start:iye,stop:rye})),kJe={MINIMUM_VALUE:iye,MAXIMUM_VALUE:rye,MAXIMUM_INTERVAL:BJe},nt=kJe;var na={};na.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});na.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});na.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});na.defaultAccessToken=void 0;na.defaultShareKey=void 0;na._getAuthorizationHeader=function(){return l(na.defaultShareKey)?`Basic ${na.defaultShareKey}`:`Bearer ${na.defaultAccessToken}`};na.apiEndpoint=new De({url:"https://api.bentley.com"});na.getExports=async function(e,t){let n=new De({url:`${na.apiEndpoint}mesh-export`,headers:{Authorization:na._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:na.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};na.getRealityDataMetadata=async function(e,t){let n=new De({url:`${na.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:na._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};na.getRealityDataURL=async function(e,t,n){let i=new De({url:`${na.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:na._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,s=new URL(o);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let s=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var ia=na;var oye={SHIFT:0,CTRL:1,ALT:2};Object.freeze(oye);var Jr=oye;var eZ=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c=n.length;for(s=0;s<r;s++)o[s]=0;for(s=0;s<c;s++){let u=1;for(a=0;a<c;a++)if(a!==s){let f=n[s]-n[a];u*=(t-n[a])/f}for(a=0;a<r;a++)o[a]+=u*i[s*r+a]}return o}},sN=eZ;var tZ=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u=n[0],f=n[1];for(s=0;s<r;s++)a=i[s],c=i[s+r],o[s]=((c-a)*t+f*a-u*c)/(f-u);return o}},mA=tZ;function t0(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(t0.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}}});t0.prototype.get=function(e){return this._array[e]};t0.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};t0.prototype.peek=function(){return this._array[this._length-1]};t0.prototype.push=function(e){let t=this.length++;this._array[t]=e};t0.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};t0.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};t0.prototype.resize=function(e){this.length=e};t0.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Zl=t0;var nZ=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},iZ=nZ;var rZ=[],oZ=[];function UJe(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=rZ,u=oZ,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function sZ(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);sZ(e,t,n,i,o),sZ(e,t,n,o+1,r),UJe(e,t,n,i,o,r)}function zJe(e,t,n){let i=e.length,r=Math.ceil(i*.5);rZ.length=r,oZ.length=r,sZ(e,t,n,0,i-1),rZ.length=0,oZ.length=0}var n0=zJe;function xS(e){e=e??H.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(xS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});xS.prototype.findTimeInterval=Ir.prototype.findTimeInterval;xS.prototype.wrapTime=Ir.prototype.wrapTime;xS.prototype.clampTime=Ir.prototype.clampTime;xS.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var aZ=xS;function Gd(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Gd.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 Gd(e.near,e.nearValue,e.far,e.farValue)};Gd.packedLength=4;Gd.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Gd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Gd),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Gd.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};Gd.prototype.clone=function(e){return Gd.clone(this,e)};Gd.prototype.equals=function(e){return Gd.equals(this,e)};var qt=Gd;var sye={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(sye);var Wo=sye;function ol(e,t){this._occluderPosition=h.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 EH=new h;Object.defineProperties(ol.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,EH),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,EH);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,EH),EH)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});ol.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new ol(e,t)};var cye=new h;ol.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,cye),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var VJe=new h;ol.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,VJe),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,cye),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var jJe=new h;ol.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Wo.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,jJe),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?Wo.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?Wo.FULL:Wo.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Wo.PARTIAL:Wo.FULL))}}return Wo.NONE};var CH=new h;ol.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,CH),CH),c=-h.dot(a,r),u=ol._anyRotationVector(r,a,c),f=ol._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=ol._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,CH),CH)};var HJe=[];ol.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,HJe),i=ce.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return ol.computeOccludeePoint(new ce(r,t.minimumRadius),i.center,n)};var GJe=new h;ol._anyRotationVector=function(e,t,n){let i=h.abs(t,GJe),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var WJe=new h;ol._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,WJe);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>D.EPSILON13)return h.normalize(s,new h)}return r};var cZ=new h,qJe=new h,vH=new h,aye=new h;ol._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,cZ),s=h.clone(e.center,qJe),a=e.radius,c=h.subtract(s,o,vH),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,aye),aye),x=Math.sqrt(d-A*A),T=this._rotationVector(s,t,n,o,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,cZ);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,cZ);T=h.normalize(h.subtract(h.add(b,v,vH),s,vH),vH);let S=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,v,T),s,T),T);let I=h.dot(t,T);return S<I?S:I};var aN=ol;function cN(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(cN.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});cN.fromCartesian3=function(e){return new cN(e.x,e.y,e.z)};cN.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 Tr=cN;function lZ(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(lZ.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});lZ.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Ot(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:s,lat:a}=i.geometry;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var uZ=lZ;var YJe={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},fZ=YJe;var XJe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},dZ=XJe;function KJe(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),s=Math.max(r+o,1);return{width:n.width,height:s,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var Zx;function $Je(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,s=t.backgroundColor??z.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Zx)||(l(f.imageSmoothingEnabled)?Zx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Zx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Zx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Zx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[Zx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=KJe(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+a+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[Zx]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??z.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+a,x)}if(r){let T=t.fillColor??z.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+a,x)}return u}var Qx=$Je;function uN(){this._cache={}}uN.prototype.fromColor=function(e,t){return SH(void 0,void 0,e,t,this._cache)};uN.prototype.fromUrl=function(e,t,n){return SH(e,void 0,t,n,this._cache)};uN.prototype.fromMakiIconId=function(e,t,n){return SH(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};uN.prototype.fromText=function(e,t,n){return SH(void 0,e,t,n,this._cache)};var JJe=new z;function ZJe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,JJe).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 lye(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var lN=new Array(4);function SH(e,t,n,i,r){lN[0]=e,lN[1]=t,lN[2]=n,lN[3]=i;let o=JSON.stringify(lN),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(ZJe(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return lye(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=Qx(t,{font:`bold ${i}px sans-serif`});lye(c,u,i)}return r[o]=a,a}var zg=uN;function TS(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}TS.packedLength=Be.packedLength;TS.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var uye=new Be,QJe={vertexFormat:uye};TS.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,uye);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new TS(QJe)};var wH=new h(-.5,-.5,0),IH=new h(.5,.5,0);TS.createGeometry=function(e){let t=e._vertexFormat,n=new Tn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=wH.x,r[1]=wH.y,r[2]=0,r[3]=IH.x,r[4]=wH.y,r[5]=0,r[6]=IH.x,r[7]=IH.y,r[8]=0,r[9]=wH.x,r[10]=IH.y,r[11]=0,n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new St({attributes:n,indices:i,primitiveType:Oe.TRIANGLES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var fN=TS;function ES(){this._workerName="createPlaneOutlineGeometry"}ES.packedLength=0;ES.pack=function(e,t){return t};ES.unpack=function(e,t,n){return l(n)?n:new ES};var pA=new h(-.5,-.5,0),PH=new h(.5,.5,0);ES.createGeometry=function(){let e=new Tn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=pA.x,n[1]=pA.y,n[2]=pA.z,n[3]=PH.x,n[4]=pA.y,n[5]=pA.z,n[6]=PH.x,n[7]=PH.y,n[8]=pA.z,n[9]=pA.x,n[10]=PH.y,n[11]=pA.z,e.position=new Ne({componentDatatype:Y.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 St({attributes:e,indices:t,primitiveType:Oe.LINES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var dN=ES;var eZe=new h;function tZe(e,t,n,i){let r=ux(e,t,n,i,eZe);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var hZ=tZe;function Ts(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ts.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ts.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=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var CS=new he,nZe=new h;Ts.prototype.getLatitude=function(e){l(e)||(e=ee.default),CS.latitude=this.conformalLatitude,CS.longitude=this.longitude,CS.height=0;let t=this.ellipsoid.cartographicToCartesian(CS,nZe);return e.cartesianToCartographic(t,CS),CS.latitude};var iZe=new pn,rZe=new h,oZe=new h;Ts.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=Ts.NORTH_POLE_TANGENT_PLANE,r=Ts.SOUTH_POLE;n<0&&(i=Ts.SOUTH_POLE_TANGENT_PLANE,r=Ts.NORTH_POLE);let o=iZe;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,rZe),h.normalize(o.direction,o.direction);let s=pi.rayPlane(o,i.plane,oZe),a=h.subtract(s,r,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new Ts(new U(c,u),i)};Ts.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]=Ts.fromCartesian(e[i],t[i]);return t};Ts.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ts(e.position,e.tangentPlane)};Ts.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Ts.NORTH_POLE=Object.freeze(new h(0,0,.5));Ts.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ts.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Vs(Ts.NORTH_POLE,Ts.HALF_UNIT_SPHERE));Ts.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Vs(Ts.SOUTH_POLE,Ts.HALF_UNIT_SPHERE));var sl=Ts;var sZe=new he,fye=new he;function aZe(e,t,n,i){let o=i.cartesianToCartographic(e,sZe).height,s=i.cartesianToCartographic(t,fye);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,fye);a.height=o-100,i.cartographicToCartesian(a,n)}var dye=new et,cZe=new h,lZe=new h,uZe=new h,fZe=new h,dZe=new h,hZe=new h,DH=new h,i0=new h,vS=new h,mZe=new U,pZe=new U,gZe=new h,hye=new Le,_Ze=new $,yZe=new $;function mZ(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=mZe;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,x;t.normal&&(y&&c&&!a?x=n.attributes.normal.values:x=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,S=0,I=0,R=lZe,O=uZe,L=fZe,_=!0,C=_Ze,w=yZe;if(m!==0){let F=Le.fromAxisAngle(d,m,hye);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,hye),w=$.fromQuaternion(F,w)}else C=$.clone($.IDENTITY,C),w=$.clone($.IDENTITY,w);let P=0,M=0;c&&u&&(P=s/2,M=s/3,s/=2);for(let F=0;F<s;F+=3){let V=h.fromArray(r,F,gZe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,cZe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],pZe)[0];U.subtract(j,A,j);let k=D.clamp(j.x/f.width,0,1),G=D.clamp(j.y/f.height,0,1);u&&(b[S+M]=k,b[S+1+M]=G),c&&(b[S]=k,b[S+1]=G),S+=2}if(t.normal||t.tangent||t.bitangent||i){let B=I+1,j=I+2;if(a){if(F+3<s){let k=h.fromArray(r,F+3,dZe);if(_){let G=h.fromArray(r,F+s,hZe);y&&aZe(V,k,G,g),h.subtract(k,V,k),h.subtract(G,V,G),R=h.normalize(h.cross(G,k,R),R),_=!1}h.equalsEpsilon(k,V,D.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(V,L),t.tangent&&(O=h.normalize(h.cross(L,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(DH=h.fromArray(x,I,DH),i0=h.cross(h.UNIT_Z,DH,i0),i0=h.normalize($.multiplyByVector(w,i0,i0),i0),t.bitangent&&(vS=h.normalize(h.cross(DH,i0,vS),vS))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(w,O,O),O),t.bitangent&&(L=h.normalize(h.cross(R,O,L),L)));t.normal&&(e.wall?(x[I+P]=R.x,x[B+P]=R.y,x[j+P]=R.z):u&&(x[I+P]=-R.x,x[B+P]=-R.y,x[j+P]=-R.z),(c&&!y||a)&&(x[I]=R.x,x[B]=R.y,x[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(V,R)),v[I+P]=-R.x,v[B+P]=-R.y,v[j+P]=-R.z),t.tangent&&(e.wall?(T[I+P]=O.x,T[B+P]=O.y,T[j+P]=O.z):u&&(T[I+P]=-O.x,T[B+P]=-O.y,T[j+P]=-O.z),c&&(y?(T[I]=i0.x,T[B]=i0.y,T[j]=i0.z):(T[I]=O.x,T[B]=O.y,T[j]=O.z))),t.bitangent&&(u&&(E[I+P]=L.x,E[B+P]=L.y,E[j+P]=L.z),c&&(y?(E[I]=vS.x,E[B]=vS.y,E[j]=vS.z):(E[I]=L.x,E[B]=L.y,E[j]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===mn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var mye=[];function AZe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=Qn.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,E=x.indices,v,S;if(s&&a){let I=T.concat(T);v=I.length/3,S=je.createTypedArray(v,E.length*2),S.set(E);let R=E.length,O=v/2;for(d=0;d<R;d+=3){let L=S[d]+O,_=S[d+1]+O,C=S[d+2]+O;S[d+R]=C,S[d+1+R]=_,S[d+2+R]=L}if(x.attributes.position.values=I,o&&c.normal){let L=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(I.length),x.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=x.attributes.st.values;x.attributes.st.values=new Float32Array(v*2),x.attributes.st.values=L.concat(L)}x.indices=S}else if(a){for(v=T.length/3,S=je.createTypedArray(v,E.length),d=0;d<E.length;d+=3)S[d]=E[d+2],S[d+1]=E[d+1],S[d+2]=E[d];x.indices=S}f.topAndBottom=new Ft({geometry:x})}let p=r.outerRing,g=Vs.fromPoints(p,e),m=g.projectPointsOntoPlane(p,mye),y=ui.computeWindingOrder2D(m);y===Qs.CLOCKWISE&&(p=p.slice().reverse());let A=Qn.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Ft({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,mye),y=ui.computeWindingOrder2D(m),y===Qs.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=Qn.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Ft({geometry:A}))}return f}function qd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??ee.default,r=e.granularity??D.RADIANS_PER_DEGREE,o=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=ee.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Qn.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?Qn.computeHierarchyPackedLength(s,U):1)+12}qd.fromPositions=function(e){e=e??H.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 qd(t)};qd.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=Qn.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var bZe=ee.clone(ee.UNIT_SPHERE),xZe=new Be,TZe={polygonHierarchy:{}};qd.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,bZe);t+=ee.packedLength;let o=Be.unpack(e,t,xZe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:Qn.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new qd(TZe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var EZe=new U,CZe=new U,vZe=new sl;function pye(e,t,n,i,r,o){let s=e.longitude,a=s>=0?s:s+D.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,a),r.eastOverIdl=Math.max(r.eastOverIdl,a),o.west=Math.min(o.west,s),o.east=Math.max(o.east,s);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==ln.RHUMB){let p=U.subtract(t.position,e.position,EZe),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let m=U.add(t.position,U.multiplyByScalar(p,-g,p),CZe),y=sl.clone(t,vZe);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=U.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var gye=new sl,SZe=new sl,Wd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};qd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),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,Wd.northAngle=0,Wd.southAngle=0,Wd.westOverIdl=Number.POSITIVE_INFINITY,Wd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=sl.fromCartesian(e[0],SZe);for(let s=1;s<r;s++){let a=sl.fromCartesian(e[s],gye);pye(a,o,t,n,Wd,i),o=sl.clone(a,o)}return pye(sl.fromCartesian(e[0],gye),o,t,n,Wd,i),i.east-i.west>Wd.eastOverIdl-Wd.westOverIdl&&(i.west=Wd.westOverIdl,i.east=Wd.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(Wd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(Wd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var wZe=new sl;function IZe(e,t,n){return e.height>=D.PI||e.width>=D.PI?sl.fromCartesian(t[0],wZe).tangentPlane:Vs.fromPoints(t,n)}var _ye=new he;function PZe(e,t,n){return(i,r)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],_ye);r[s]=new U(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return r.length=i.length,r}return sl.fromCartesianArray(i,r)}return Vs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function DZe(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(r,o)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(r,_ye);return l(o)||(o=new U),o.x=s.longitude/D.PI,o.y=s.latitude/D.PI_OVER_TWO,o}return sl.fromCartesian(r,o)};let i=Vs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function RZe(e,t,n,i){return(r,o)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?Qn.splitPolygonsOnEquator(r,t,n,o):r}function OZe(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,dye);let r=e,o=Vs.fromPoints(r,n);return Qn.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,dye)}qd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=Qn.polygonsFromHierarchy(o,d,PZe(g,p,n),!s,n,RZe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(P){return P},x=d?Qn.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=OZe(T,g,n,r),v=[],S=e._height,I=e._extrudedHeight,R=e._perPositionHeightExtrude||!D.equalsEpsilon(S,I,0,D.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:IZe(g,T,n).plane.normal,projectTo2d:DZe(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<A.length;L++){let P=AZe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),M;a&&c?(M=P.topAndBottom,O.geometry=Qn.scaleToGeodeticHeightExtruded(M.geometry,S,I,n,s)):a?(M=P.topAndBottom,M.geometry.attributes.position.values=ui.scaleToGeodeticHeight(M.geometry.attributes.position.values,S,n,!s),O.geometry=M.geometry):c&&(M=P.topAndBottom,M.geometry.attributes.position.values=ui.scaleToGeodeticHeight(M.geometry.attributes.position.values,I,n,!0),O.geometry=M.geometry),(a||c)&&(O.wall=!1,M.geometry=mZ(O),v.push(M));let F=P.walls;O.wall=!0;for(let V=0;V<F.length;V++){let B=F[V];O.geometry=Qn.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=mZ(O),v.push(B)}}else for(L=0;L<A.length;L++){let P=new Ft({geometry:Qn.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(P.geometry.attributes.position.values=ui.scaleToGeodeticHeight(P.geometry.attributes.position.values,S,n,!s),O.geometry=P.geometry,P.geometry=mZ(O),l(e._offsetAttribute)){let M=P.geometry.attributes.position.values.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(M/3).fill(F);P.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}v.push(P)}let _=Hn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ce.fromVertices(C.position.values);return t.position||delete C.position,new St({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};qd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new qd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function MZe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return St._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(qd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=qd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=MZe(this)),this._textureCoordinateRotationPoints}}});var r0=qd;var yye=[],RH=[];function NZe(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,yye);ui.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)m+=Qn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=Qn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===ln.GEODESIC?y=Qn.subdivideLine(t[u],t[(u+1)%f],n,RH):r===ln.RHUMB&&(y=Qn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,RH));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=je.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Ft({geometry:new St({attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function LZe(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,yye);ui.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)A+=Qn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=Qn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===ln.GEODESIC?b=Qn.subdivideLine(t[u],t[(u+1)%f],n,RH):r===ln.RHUMB&&(b=Qn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,RH));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=je.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Ft({geometry:new St({attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function eT(e){let t=e.polygonHierarchy,n=e.ellipsoid??ee.default,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Qn.computeHierarchyPackedLength(t,h)+ee.packedLength+8}eT.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var FZe=ee.clone(ee.UNIT_SPHERE),BZe={polygonHierarchy:{}};eT.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,FZe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new eT(BZe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};eT.fromPositions=function(e){e=e??H.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 eT(t)};eT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=Qn.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=LZe(t,s[m],u,r,o),a.geometry=Qn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===mn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===mn.NONE?0:1,x=x.fill(g)),a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}else for(m=0;m<s.length;m++){if(a=NZe(t,s[m],u,r,o),a.geometry.attributes.position.values=ui.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===mn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}let y=Hn.combineInstances(c)[0],A=ce.fromVertices(y.attributes.position.values);return new St({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var hN=eT;var Eye=[];function kZe(e,t,n,i,r){let o=Eye;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let y=(d-a)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*y,c+s*A,u+s*b,f+s*x);return o}function mN(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+Be.packedLength+4}mN.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Cye=ee.clone(ee.UNIT_SPHERE),vye=new Be,tT={positions:void 0,colors:void 0,ellipsoid:Cye,vertexFormat:vye,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};mN.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Cye);t+=ee.packedLength;let c=Be.unpack(e,t,vye);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(tT.positions=o,tT.colors=s,tT.width=u,tT.colorsPerVertex=f,tT.arcType=d,tT.granularity=p,new mN(tT))};var Aye=new h,bye=new h,xye=new h,Tye=new h;mN.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Fr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,F=d[0];i=i.filter(function(V,B){let j;return r?j=B===F||B===0&&F===1:j=B+1===F,j?(M++,F=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===ln.GEODESIC||o===ln.RHUMB){let M,F;o===ln.GEODESIC?(M=D.chordLength(s,a.maximumRadius),F=ir.numberOfPoints):(M=s,F=ir.numberOfPointsRhumbLine);let V=ir.extractHeights(p,a);if(l(i)){let B=1;for(c=0;c<g-1;++c)B+=F(p[c],p[c+1],M);let j=new Array(B),k=0;for(c=0;c<g-1;++c){let G=p[c],q=p[c+1],Q=i[c],W=F(G,q,M);if(r&&c<B){let J=i[c+1],Z=kZe(G,q,Q,J,W),ae=Z.length;for(u=0;u<ae;++u)j[k++]=Z[u]}else for(u=0;u<W;++u)j[k++]=z.clone(Q)}j[k]=z.clone(i[i.length-1]),i=j,Eye.length=0}o===ln.GEODESIC?p=ir.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:V}):p=ir.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:a,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,S=0,I=0,R=0,O;for(u=0;u<g;++u){u===0?(O=Aye,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,xye),h.clone(p[u],bye),u===g-1?(O=Aye,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,Tye);let M,F;l(E)&&(u!==0&&!r?M=i[u-1]:M=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,B=u===g-1?2:4;for(f=V;f<B;++f){h.pack(bye,y,v),h.pack(xye,A,v),h.pack(Tye,b,v),v+=3;let j=f-2<0?-1:1;if(x[S++]=2*(f%2)-1,x[S++]=j*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(x[S-2],0)),l(E)){let k=f<2?M:F;E[R++]=z.floatToByte(k.red),E[R++]=z.floatToByte(k.green),E[R++]=z.floatToByte(k.blue),E[R++]=z.floatToByte(k.alpha)}}}let L=new Tn;L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.nextPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=je.createTypedArray(m,g*6-6),C=0,w=0,P=g-1;for(u=0;u<P;++u)_[w++]=C,_[w++]=C+2,_[w++]=C+1,_[w++]=C+1,_[w++]=C+2,_[w++]=C+3,C+=4;return new St({attributes:L,indices:_,primitiveType:Oe.TRIANGLES,boundingSphere:ce.fromPoints(p),geometryType:Sd.POLYLINES})};var Vg=mN;function UZe(e,t,n,i){let r=new Tn;i.position&&(r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=ui.triangulate(t),u=(a-1)*o*6+c.length*2,f=je.createTypedArray(s,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),S=1/(a-1),I=1/n.height,R=n.height/2,O,L,_=0;for(d=0;d<a;d++){for(O=d*S,L=I*(t[0].y+R),v[_++]=O,v[_++]=L,p=1;p<o;p++)L=I*(t[p].y+R),v[_++]=O,v[_++]=L,v[_++]=O,v[_++]=L;L=I*(t[0].y+R),v[_++]=O,v[_++]=L}for(p=0;p<o;p++)O=0,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;for(p=0;p<o;p++)O=(a-1)*S,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,S=c[d+1]+T,I=c[d+2]+T;f[x++]=v,f[x++]=S,f[x++]=I,f[x++]=I+o,f[x++]=S+o,f[x++]=v+o}let E=new St({attributes:r,indices:f,boundingSphere:ce.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Hn.computeNormal(E)),i.tangent||i.bitangent){try{E=Hn.computeTangentAndBitangent(E)}catch{_t("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function gN(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??nr.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Be.packedLength+2}gN.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Sye=ee.clone(ee.UNIT_SPHERE),wye=new Be,pN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Sye,vertexFormat:wye,cornerType:void 0,granularity:void 0};gN.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Sye);t+=ee.packedLength;let c=Be.unpack(e,t,wye);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(pN.polylinePositions=o,pN.shapePositions=s,pN.cornerType=u,pN.granularity=f,new gN(pN))};var zZe=new et;gN.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=rm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,zZe),o=rm.computePositions(n,i,r,e,!0);return UZe(o,i,r,e._vertexFormat)};var _N=gN;function VZe(e,t){let n=new Tn;n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=je.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new St({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:ce.fromVertices(e),primitiveType:Oe.LINES})}function AN(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??nr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}AN.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Iye=ee.clone(ee.UNIT_SPHERE),yN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Iye,height:void 0,cornerType:void 0,granularity:void 0};AN.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Iye);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(yN.polylinePositions=o,yN.shapePositions=s,yN.cornerType=c,yN.granularity=u,new AN(yN))};var jZe=new et;AN.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=rm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,jZe),o=rm.computePositions(n,i,r,e,!1);return VZe(o,i)};var bN=AN;function Pye(){pe.throwInstantiationError()}Pye.prototype.getURL=pe.throwInstantiationError;var pZ=Pye;function HZe(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function SS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=HZe(this),this._lastTimeIndex=0}Object.defineProperties(SS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});SS.prototype.findTimeInterval=Ir.prototype.findTimeInterval;SS.prototype.wrapTime=Ir.prototype.wrapTime;SS.prototype.clampTime=Ir.prototype.clampTime;SS.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var xN=SS;function OH(e,t,n=0,i=e.length-1,r=GZe){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));OH(e,t,g,m,r)}let o=e[t],s=n,a=i;for(TN(e,n,t),r(e[i],o)>0&&TN(e,n,i);s<a;){for(TN(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?TN(e,n,a):(a++,TN(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function TN(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function GZe(e,t){return e<t?-1:e>t?1:0}var vN=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!NH(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?r(a):a;NH(t,c)&&(n.leaf?i.push(a):_Z(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!NH(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],s=n.leaf?this.toBBox(o):o;if(NH(t,s)){if(n.leaf||_Z(t,s))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=IS([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],s=[],a,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],a=s.pop(),u=!0),i.leaf){let f=WZe(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&_Z(i,r)?(o.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,s=this._maxEntries,a;if(o<=s)return a=IS(t.slice(n,i+1)),wS(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=IS([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));Dye(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);Dye(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);a.children.push(this._build(t,p,g,r-1))}}return wS(a,this.toBBox),a}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=gZ(u),d=XZe(t,u)-f;d<s?(s=d,o=f<o?f:o,a=u):d===s&&f<o&&(o=f,a=u)}n=a||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],s=this._chooseSubtree(r,this.data,n,o);for(s.children.push(t),CN(s,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let s=this._chooseSplitIndex(i,o,r),a=IS(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,wS(i,this.toBBox),wS(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=IS([t,n]),this.data.height=t.height+1,this.data.leaf=!1,wS(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=EN(t,0,a,this.toBBox),u=EN(t,a,i,this.toBBox),f=KZe(c,u),d=gZ(c)+gZ(u);f<o?(o=f,r=a,s=d<s?d:s):f===o&&d<s&&(s=d,r=a)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:qZe,o=t.leaf?this.compareMinY:YZe,s=this._allDistMargin(t,n,i,r),a=this._allDistMargin(t,n,i,o);s<a&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,s=EN(t,0,n,o),a=EN(t,i-n,i,o),c=MH(s)+MH(a);for(let u=n;u<i-n;u++){let f=t.children[u];CN(s,t.leaf?o(f):f),c+=MH(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];CN(a,t.leaf?o(f):f),c+=MH(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)CN(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():wS(t[n],this.toBBox)}};function WZe(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function wS(e,t){EN(e,0,e.children.length,t,e)}function EN(e,t,n,i,r){r||(r=IS(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let s=e.children[o];CN(r,e.leaf?i(s):s)}return r}function CN(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function qZe(e,t){return e.minX-t.minX}function YZe(e,t){return e.minY-t.minY}function gZ(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function MH(e){return e.maxX-e.minX+(e.maxY-e.minY)}function XZe(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function KZe(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function _Z(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function NH(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function IS(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Dye(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;OH(e,s,t,n,r),o.push(t,s,s,n)}}function LH(){this._tree=new vN}function nT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}nT.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};LH.prototype.insert=function(e,t){let n=nT.fromRectangleAndId(e,t,new nT);this._tree.insert(n)};function $Ze(e,t){return e.id===t.id}var JZe=new nT;LH.prototype.remove=function(e,t){let n=nT.fromRectangleAndId(e,t,JZe);this._tree.remove(n,$Ze)};var ZZe=new nT;LH.prototype.collides=function(e){let t=nT.fromRectangleAndId("",e,ZZe);return this._tree.collides(t)};var iT=LH;var Rye=Math.cos,Oye=Math.sin,QZe=Math.sqrt,yZ={};yZ.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Rye(f),p=Oye(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Rye(m),A=d*Oye(m),b=a.x*y,x=a.y*A,T=QZe(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+r*e.stGranXSin,m=E.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var eQe=new Xi,Yd=new h,tQe=new he,FH=new h,SN=new Ui;function Mye(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;SN._ellipsoid=ee.default,Yd=SN.project(e,Yd),Yd=h.subtract(Yd,FH,Yd);let g=Xi.fromRotation(t,eQe);Yd=Xi.multiplyByVector(g,Yd,Yd),Yd=h.add(Yd,FH,Yd),e=SN.unproject(Yd,e),o-=1,s-=1;let m=e.latitude,y=m+o*p,A=m-c*s,b=m-c*s+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),E=e.longitude,v=E+o*u,S=E+s*d,I=E+s*d+o*u,R=Math.max(E,v,S,I),O=Math.min(E,v,S,I);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}yZ.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=D.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),E=ie.center(e,tQe);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=D.TWO_PI),SN._ellipsoid=ee.default,FH=SN.project(E,FH));let v=x,S=b,I=0,R=0,O=ie.clone(e,r),L={granYCos:v,granYSin:I,granXCos:S,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Mye(T,n,b,x,E,y,A);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,s),C=Mye(_,n,b,x,E,y,A);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var ba=yZ;var AZ=new h,Fye=new h,Bye=new h,kye=new h,Uye=new ie,nQe=new U,iQe=new ce,rQe=new ce;function zye(e,t){let n=new St({attributes:new Tn,primitiveType:Oe.TRIANGLES});return n.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function oQe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=kye,f=Bye,d=Fye;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,AZ),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return zye(t,{positions:e,normals:o,tangents:s,bitangents:a})}var bZ=new h,Vye=new h;function sQe(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=kye,p=Bye,g=Fye;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,AZ),A=h.fromArray(e,(m+6)%i,bZ);if(f){let b=h.fromArray(e,(m+3)%i,Vye);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return zye(t,{positions:e,normals:r,tangents:o,bitangents:s})}function jye(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=AZ,b=nQe,x=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let w=0;w<o;++w)ba.computePosition(t,i,n.st,C,w,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y));if(s&&(ba.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,E=b.x,v=b.y)),a&&(ba.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y))),n.st&&(x<0||T<0||E>1||v>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-x)/(E-x),g[C+1]=(g[C+1]-T)/(v-T);let S=oQe(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let R=je.createTypedArray(d,I),O=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<o-1;++C){let w=O,P=w+o,M=P+1,F=w+1;R[L++]=w,R[L++]=P,R[L++]=F,R[L++]=F,R[L++]=P,R[L++]=M,++O}++O}if(s||a){let C=d-1,w=d-1;s&&a&&(C=d-2);let P,M;if(O=0,s)for(_=0;_<o-1;_++)P=O,M=P+1,R[L++]=C,R[L++]=P,R[L++]=M,++O;if(a)for(O=(f-1)*o,_=0;_<o-1;_++)P=O,M=P+1,R[L++]=P,R[L++]=w,R[L++]=M,++O}return S.indices=R,n.st&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),S}function PS(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function DS(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 xZ=new Be;function aQe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Be.clone(r,xZ);Pe.normal=!0,e._vertexFormat=Pe}let d=jye(e,t);n&&(e._vertexFormat=r);let p=ui.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=ui.scaleToGeodeticHeight(d.attributes.position.values,o,a);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,E=r.st?new Float32Array(m/3*2):void 0,v,S;if(r.normal){for(S=d.attributes.normal.values,b.set(S),f=0;f<g;f++)S[f]=-S[f];b.set(S,g),d.attributes.normal.values=b}if(n){S=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)S[f]=-S[f];Pe.set(S,g),d.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let I,R=l(i);if(R){let Pe=g/3*2,qe=new Uint8Array(Pe);i===mn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===mn.NONE?0:1,qe=qe.fill(I)),d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}if(r.tangent){let Pe=d.attributes.tangent.values;for(x.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];x.set(Pe,g),d.attributes.tangent.values=x}if(r.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let O=d.indices,L=O.length,_=g/3,C=je.createTypedArray(m/3,L*2);for(C.set(O),f=0;f<L;f+=3)C[f+L]=O[f+2]+_,C[f+1+L]=O[f+1]+_,C[f+2+L]=O[f]+_;d.indices=C;let w=t.northCap,P=t.southCap,M=c,F=2,V=0,B=4,j=4;w&&(F-=1,M-=1,V+=1,B-=2,j-=1),P&&(F-=1,M-=1,V+=1,B-=2,j-=1),V+=F*u+2*M-B;let k=(V+j)*2,G=new Float64Array(k*3),q=n?new Float32Array(k*3):void 0,Q=R?new Uint8Array(k):void 0,W=r.st?new Float32Array(k*2):void 0,J=i===mn.TOP;R&&!J&&(I=i===mn.ALL?1:0,Q=Q.fill(I));let Z=0,ae=0,Ae=0,fe=0,xe=u*M,ge;for(f=0;f<xe;f+=u)ge=f*3,G=PS(G,Z,ge,p,A),Z+=6,r.st&&(W=DS(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(P){let Pe=w?xe+1:xe;for(ge=Pe*3,f=0;f<2;f++)G=PS(G,Z,ge,p,A),Z+=6,r.st&&(W=DS(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=xe-u;f<xe;f++)ge=f*3,G=PS(G,Z,ge,p,A),Z+=6,r.st&&(W=DS(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);for(f=xe-1;f>0;f-=u)ge=f*3,G=PS(G,Z,ge,p,A),Z+=6,r.st&&(W=DS(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(w){let Pe=xe;for(ge=Pe*3,f=0;f<2;f++)G=PS(G,Z,ge,p,A),Z+=6,r.st&&(W=DS(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=u-1;f>=0;f--)ge=f*3,G=PS(G,Z,ge,p,A),Z+=6,r.st&&(W=DS(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);let we=sQe(G,r,a);r.st&&(we.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:W})),n&&(we.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),R&&(we.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let Se=je.createTypedArray(k,V*6),Re,Qe,He,Xe;g=G.length/3;let $e=0;for(f=0;f<g-1;f+=2){Re=f,Xe=(Re+2)%g;let Pe=h.fromArray(G,Re*3,bZ),qe=h.fromArray(G,Xe*3,Vye);h.equalsEpsilon(Pe,qe,D.EPSILON10)||(Qe=(Re+1)%g,He=(Qe+2)%g,Se[$e++]=Re,Se[$e++]=Qe,Se[$e++]=Xe,Se[$e++]=Xe,Se[$e++]=Qe,Se[$e++]=He)}return we.indices=Se,we=Hn.combineInstances([new Ft({geometry:d}),new Ft({geometry:we})]),we[0]}var cQe=[new h,new h,new h,new h],Hye=new he,lQe=new he;function TZ(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=ba.computeOptions(e,t,n,0,Uye,Hye),s=o.height,a=o.width,c=cQe;return ba.computePosition(o,i,!1,0,0,c[0]),ba.computePosition(o,i,!1,0,a-1,c[1]),ba.computePosition(o,i,!1,s-1,0,c[2]),ba.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function o0(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}o0.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;o0.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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]=e._offsetAttribute??-1,t};var Gye=new ie,Wye=ee.clone(ee.UNIT_SPHERE),gA={rectangle:Gye,ellipsoid:Wye,vertexFormat:xZ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};o0.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Gye);t+=ie.packedLength;let r=ee.unpack(e,t,Wye);t+=ee.packedLength;let o=Be.unpack(e,t,xZ);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(gA.granularity=s,gA.height=a,gA.rotation=c,gA.stRotation=u,gA.extrudedHeight=f,gA.shadowVolume=d,gA.offsetAttribute=p===-1?void 0:p,new o0(gA))};o0.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??ee.default,o=e.rotation??0;return TZ(n,i,o,r,t)};var uQe=new $,Nye=new Le,fQe=new he;o0.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=ba.computeOptions(t,e._granularity,i,r,Uye,Hye,lQe),a=uQe;if(r!==0||i!==0){let g=ie.center(t,fQe),m=n.geodeticSurfaceNormalCartographic(g,bZ);Le.fromAxisAngle(m,-r,Nye),$.fromQuaternion(Nye,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=aQe(e,s);let g=ce.fromRectangle3D(t,n,c,rQe),m=ce.fromRectangle3D(t,n,u,iQe);p=ce.union(g,m)}else{if(d=jye(e,s),d.attributes.position.values=ui.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ce.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new St({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};o0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new o0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var Lye=new ie,dQe=[new U,new U,new U],hQe=new Xi,mQe=new he;function pQe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,Lye),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=TZ(t,n,r,i,Lye),s=dQe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=Xi.fromRotation(e._stRotation,hQe),u=ie.center(a,mQe);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,Xi.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return U.pack(f,g),U.pack(d,g,2),U.pack(p,g,4),g}Object.defineProperties(o0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=TZ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=pQe(this)),this._textureCoordinateRotationPoints}}});var rT=o0;var gQe=new ce,_Qe=new ce,yQe=new h,AQe=new ie;function qye(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,y=yQe;if(o)ba.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)ba.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)ba.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)ba.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)ba.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=je.createTypedArray(d.length/3,A),x=0;for(let E=0;E<d.length/3-1;E++)b[x++]=E,b[x++]=E+1;b[x++]=d.length/3-1,b[x]=0;let T=new St({attributes:new Tn,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function bQe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=qye(e,t),s=t.height,a=t.width,c=ui.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=ui.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=je.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=s-1;else{let T=a-1;A[b++]=T,A[b++]=T+u,x=a+s-2}if(A[b++]=x,A[b++]=x+u,!g){let T=a+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function OS(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??ee.default,r=e.rotation??0,o=e.height??0,s=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}OS.packedLength=ie.packedLength+ee.packedLength+5;OS.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Yye=new ie,Xye=ee.clone(ee.UNIT_SPHERE),RS={rectangle:Yye,ellipsoid:Xye,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};OS.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Yye);t+=ie.packedLength;let r=ee.unpack(e,t,Xye);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(RS.granularity=o,RS.height=s,RS.rotation=a,RS.extrudedHeight=c,RS.offsetAttribute=u===-1?void 0:u,new OS(RS))};var xQe=new he;OS.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=ba.computeOptions(t,e._granularity,e._rotation,0,AQe,xQe),r,o;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!D.equalsEpsilon(s,a,0,D.EPSILON2),u;if(c){if(r=bQe(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===mn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===mn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ce.fromRectangle3D(t,n,s,_Qe),d=ce.fromRectangle3D(t,n,a,gQe);o=ce.union(f,d)}else{if(r=qye(e,i),r.attributes.position.values=ui.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===mn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ce.fromRectangle3D(t,n,s)}return new St({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var oT=OS;var Kye={FIXED:0,INERTIAL:1};Object.freeze(Kye);var ji=Kye;var sT=30,TQe=1<<sT,EQe=1<<sT+1>>>0,EZ=2*sT+1,_A=4,Zye=[],Qye=[],CQe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],yA=1,MS=2,BH=[yA,0,0,yA|MS];function Gs(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Gs.getLevel(e)}Gs.fromToken=function(e){return new Gs(Gs.getIdFromToken(e))};Gs.isValidId=function(e){return!(e<=0||e>>BigInt(EZ)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Gs.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Gs.isValidId(Gs.getIdFromToken(e)):!1};Gs.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Gs.getTokenFromId=function(e){let t=Math.floor(NQe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Gs.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return sT-(t>>1)};Gs.prototype.getChild=function(e){let t=nAe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Gs(n)};Gs.prototype.getParent=function(){let e=nAe(this._cellId)<<BigInt(2);return new Gs(this._cellId&~e+BigInt(1)|e)};Gs.prototype.getParentAtLevel=function(e){let t=OQe(e);return new Gs(this._cellId&-t|t)};Gs.prototype.getCenter=function(e){e=e??ee.WGS84;let t=vQe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Gs.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=SQe(this._cellId,this._level,e);n=h.normalize(n,n);let i=he.fromCartesian(n,ee.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Gs.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(EZ-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Gs(a)};function vQe(e,t){let n=wQe(e,t);return IQe(n[0],n[1],n[2])}function SQe(e,t,n){let i=eAe(e,t),r=PQe([i[1],i[2]],t),o=n>>1&1;return tAe(i[0],r[0][o^n&1],r[1][o])}function wQe(e,t){let n=eAe(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function eAe(e){Zye.length===0&&RQe();let t=Number(e>>BigInt(EZ)),n=t&yA,i=(1<<_A)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?sT-7*_A:_A))-1;n+=Number(e>>BigInt(s*2*_A+1)&BigInt(c))<<2,n=Qye[n];let u=s*_A;r+=n>>_A+2<<u,o+=(n>>2&i)<<u,n&=yA|MS}return[t,r,o]}function IQe(e,t,n){let i=$ye(t),r=$ye(n),o=kH(i),s=kH(r);return tAe(e,o,s)}function tAe(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function kH(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function $ye(e){return 1/EQe*e}function PQe(e,t){let n=[[],[]],i=DQe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=kH(Jye(o)),n[r][1]=kH(Jye(s))}return n}function DQe(e){return 1<<sT-e>>>0}function Jye(e){return 1/TQe*e}function AA(e,t,n,i,r,o){if(e===_A){let s=(t<<_A)+n;Zye[(s<<2)+i]=(r<<2)+o,Qye[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=CQe[o];AA(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^BH[0]),AA(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^BH[1]),AA(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^BH[2]),AA(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^BH[3])}}function RQe(){AA(0,0,0,0,0,0),AA(0,0,0,yA,0,yA),AA(0,0,0,MS,0,MS),AA(0,0,0,yA|MS,0,yA|MS)}function nAe(e){return e&~e+BigInt(1)}function OQe(e){return BigInt(1)<<BigInt(2*(sT-e))}var MQe=[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 NQe(e){return MQe[(-e&e)%BigInt(67)]}var jg=Gs;async function LQe(e,t,n,i){return l(i)||(i=!1),kQe(e,t,n,i)}function FQe(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(rAe(i)):o=r.then(rAe(i)).catch(UQe(i)),e.shift(),t.push(o),!0}function BQe(e){return new Promise(function(t){setTimeout(t,e)})}function CZ(e,t,n){return e.length?FQe(e,t,n)?CZ(e,t,n):BQe(100).then(()=>CZ(e,t,n)):Promise.resolve()}function kQe(e,t,n,i){let r=e.tilingScheme,o,s=[],a={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[o])}let c=[];return CZ(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function iAe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function rAe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!iAe(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];iAe(s,i,n)}}):Promise.resolve()}}function UQe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var wN=LQe;var vZ=new U;async function oAe(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,vZ);let p=e.loadTileDataAvailability(vZ.x,vZ.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return wN(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&a.push(u)}return a.length>0&&await oAe(e,a,n),t}var aT=oAe;var sAe={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};Object.freeze(sAe);var un=sAe;function bA(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function RZ(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function cT(e){let t=[];if(e.shiftKey&&t.push(Jr.SHIFT),e.ctrlKey&&t.push(Jr.CTRL),e.altKey&&t.push(Jr.ALT),t.length)return t}var Es={LEFT:0,MIDDLE:1,RIGHT:2};function Ff(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function zQe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(Ff(e,"pointerdown",t,qQe),Ff(e,"pointerup",t,gAe),Ff(e,"pointermove",t,YQe),Ff(e,"pointercancel",t,gAe)):(Ff(e,"mousedown",t,_Ae),Ff(e,"mouseup",n,yAe),Ff(e,"mousemove",n,AAe),Ff(e,"touchstart",t,GQe),Ff(e,"touchend",n,fAe),Ff(e,"touchmove",n,WQe),Ff(e,"touchcancel",n,fAe)),Ff(e,"dblclick",t,jQe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ff(e,i,t,HQe)}function VQe(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var aAe={position:new U};function OZ(e){e._lastSeenTouchEvent=xn()}function MZ(e){return xn()-e._lastSeenTouchEvent>cm.mouseEmulationIgnoreMilliseconds}function DZ(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function _Ae(e,t){if(!MZ(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Es.LEFT)i=un.LEFT_DOWN;else if(n===Es.MIDDLE)i=un.MIDDLE_DOWN;else if(n===Es.RIGHT)i=un.RIGHT_DOWN;else return;let r=bA(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=cT(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,aAe.position),s(aAe),t.preventDefault())}var cAe={position:new U},lAe={position:new U};function SZ(e,t,n,i){let r=cT(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=bA(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,cAe.position),o(cAe)),l(s)){let c=e._primaryStartPosition;DZ(c,a,e._clickPixelTolerance)&&(U.clone(a,lAe.position),s(lAe))}}}function yAe(e,t){if(!MZ(e))return;let n=t.button;n!==Es.LEFT&&n!==Es.MIDDLE&&n!==Es.RIGHT||(e._buttonDown[Es.LEFT]&&(SZ(e,un.LEFT_UP,un.LEFT_CLICK,t),e._buttonDown[Es.LEFT]=!1),e._buttonDown[Es.MIDDLE]&&(SZ(e,un.MIDDLE_UP,un.MIDDLE_CLICK,t),e._buttonDown[Es.MIDDLE]=!1),e._buttonDown[Es.RIGHT]&&(SZ(e,un.RIGHT_UP,un.RIGHT_CLICK,t),e._buttonDown[Es.RIGHT]=!1))}var wZ={startPosition:new U,endPosition:new U};function AAe(e,t){if(!MZ(e))return;let n=cT(t),i=bA(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(un.MOUSE_MOVE,n);l(o)&&(U.clone(r,wZ.startPosition),U.clone(i,wZ.endPosition),o(wZ)),U.clone(i,r),(e._buttonDown[Es.LEFT]||e._buttonDown[Es.MIDDLE]||e._buttonDown[Es.RIGHT])&&t.preventDefault()}var uAe={position:new U};function jQe(e,t){let n=t.button,i;if(n===Es.LEFT)i=un.LEFT_DOUBLE_CLICK;else return;let r=cT(t),o=e.getInputAction(i,r);l(o)&&(bA(e,t,uAe.position),o(uAe))}function HQe(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===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=cT(t),r=e.getInputAction(un.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function GQe(e,t){OZ(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,bA(e,o,new U));UH(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,U.clone(a.get(s)))}function fAe(e,t){OZ(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);UH(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var dAe={position:new U},IZ={position1:new U,position2:new U},hAe={position:new U},mAe={position:new U},pAe={position:new U};function UH(e,t){let n=cT(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[Es.LEFT]){if(e._buttonDown[Es.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(un.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,hAe.position),o(hAe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(un.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];DZ(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,mAe.position),s(mAe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(un.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[Es.LEFT]=!0,o=e.getInputAction(un.LEFT_DOWN,n),l(o)&&(U.clone(c,dAe.position),o(dAe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(un.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];DZ(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,pAe.position),s(pAe))}},cm.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(un.PINCH_START,n),l(o)&&(U.clone(i.values[0],IZ.position1),U.clone(i.values[1],IZ.position2),o(IZ),t.preventDefault()))}function WQe(e,t){OZ(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&bA(e,o,u)}bAe(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,U.clone(a.get(s),c.get(s))}var PZ={startPosition:new U,endPosition:new U},IN={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function bAe(e,t){let n=cT(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[Es.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(un.MOUSE_MOVE,n),l(s)&&(U.clone(c,PZ.startPosition),U.clone(a,PZ.endPosition),s(PZ)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(un.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(y,m);U.fromElements(0,A,IN.distance.startPosition),U.fromElements(0,g,IN.distance.endPosition),U.fromElements(E,x,IN.angleAndHeight.startPosition),U.fromElements(T,b,IN.angleAndHeight.endPosition),s(IN)}}function qQe(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,bA(e,t,new U)),UH(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else _Ae(e,t)}function gAe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),UH(e,t),e._previousPositions.remove(i)}else yAe(e,t)}function YQe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;bA(e,t,r),bAe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else AAe(e,t)}function cm(e){this._inputEvents={},this._buttonDown={[Es.LEFT]:!1,[Es.MIDDLE]:!1,[Es.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-cm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new Ut,this._previousPositions=new Ut,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,zQe(this)}cm.prototype.setInputAction=function(e,t,n){let i=RZ(t,n);this._inputEvents[i]=e};cm.prototype.getInputAction=function(e,t){let n=RZ(e,t);return this._inputEvents[n]};cm.prototype.removeInputAction=function(e,t){let n=RZ(e,t);delete this._inputEvents[n]};cm.prototype.isDestroyed=function(){return!1};cm.prototype.destroy=function(){return VQe(this),ue(this)};cm.mouseEmulationIgnoreMilliseconds=800;cm.touchHoldDelayMilliseconds=1500;var ra=cm;function zH(e){e=e??!0,this.value=zH.toValue(e)}Object.defineProperties(zH.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});zH.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Pn=zH;function XQe(e,t,n,i,r,o,s){let a=ir.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let b=(g-u)/a,x=(m-f)/a,T=(y-d)/a,E=(A-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*b),o[v++]=z.floatToByte(f+c*x),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*E);return v}function PN(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ee.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+3}PN.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};PN.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new PN({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var VH=new Array(2),jH=new Array(2),KQe={positions:VH,height:jH,ellipsoid:void 0,minDistance:void 0,granularity:void 0};PN.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=D.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===ln.GEODESIC||r===ln.RHUMB){let E,v,S;r===ln.GEODESIC?(E=D.chordLength(o,s.maximumRadius),v=ir.numberOfPoints,S=ir.generateArc):(E=o,v=ir.numberOfPointsRhumbLine,S=ir.generateRhumbArc);let I=ir.extractHeights(t,s),R=KQe;if(r===ln.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=v(t[u],t[u+1],E)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=VH,R.height=jH;let L=0;for(u=0;u<f-1;++u){VH[0]=t[u],VH[1]=t[u+1],jH[0]=I[u],jH[1]=I[u+1];let _=S(R);if(l(n)){let C=_.length/3;m=n[u];for(let w=0;w<C;++w)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=I,d=new Float64Array(S(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],w=n[u+1];y=XQe(L,_,C,w,a,g,y)}let O=n[f-1];g[y++]=z.floatToByte(O.red),g[y++]=z.floatToByte(O.green),g[y++]=z.floatToByte(O.blue),g[y]=z.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let S=t[u];if(c&&u>0&&(h.pack(S,d,E),E+=3,m=n[u-1],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(S,d,E),E+=3,l(n)&&(m=n[u],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha))}}let A=new Tn;A.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=je.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new St({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:ce.fromPoints(t)})};var NZ=PN;var HH=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};HH.DEFAULT_SNAP_APERTURE=void 0;var LZ=HH;function NS(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ua(i),this._workerName="createSphereGeometry"}NS.packedLength=Ua.packedLength;NS.pack=function(e,t,n){return Ua.pack(e._ellipsoidGeometry,t,n)};var $Qe=new Ua,xA={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};NS.unpack=function(e,t,n){let i=Ua.unpack(e,t,$Qe);return xA.vertexFormat=Be.clone(i._vertexFormat,xA.vertexFormat),xA.stackPartitions=i._stackPartitions,xA.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,xA.radii),n._ellipsoidGeometry=new Ua(xA),n):(xA.radius=i._radii.x,new NS(xA))};NS.createGeometry=function(e){return Ua.createGeometry(e._ellipsoidGeometry)};var DN=NS;function LS(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Nf(i),this._workerName="createSphereOutlineGeometry"}LS.packedLength=Nf.packedLength;LS.pack=function(e,t,n){return Nf.pack(e._ellipsoidGeometry,t,n)};var JQe=new Nf,lT={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};LS.unpack=function(e,t,n){let i=Nf.unpack(e,t,JQe);return lT.stackPartitions=i._stackPartitions,lT.slicePartitions=i._slicePartitions,lT.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,lT.radii),n._ellipsoidGeometry=new Nf(lT),n):(lT.radius=i._radii.x,new LS(lT))};LS.createGeometry=function(e){return Nf.createGeometry(e._ellipsoidGeometry)};var Hg=LS;function al(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}al.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new al),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};al.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new al(e.clock,e.cone,e.magnitude)};al.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new al(e.clock,e.cone,1)};al.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};al.equalsEpsilon=function(e,t,n){return n=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};al.prototype.equals=function(e){return al.equals(this,e)};al.prototype.clone=function(e){return al.clone(this,e)};al.prototype.equalsEpsilon=function(e,t){return al.equalsEpsilon(this,e,t)};al.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var RN=al;function ZQe(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var uT=ZQe;function FS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Ir.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(FS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});FS.prototype.findTimeInterval=Ir.prototype.findTimeInterval;FS.prototype.wrapTime=Ir.prototype.wrapTime;FS.prototype.clampTime=Ir.prototype.clampTime;FS.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var ON=FS;function QQe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var MN=QQe;var eet={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},wn=eet;var FZ=class{constructor(t){ut(this,"ellipsoid");ut(this,"rectangle");ut(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},BZ=FZ;function zZ(e,t){return K.compare(e.start,t.start)}function Cs(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(Cs.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}}});Cs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Cs))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!Cn.equals(n[o],i[o],t))return!1;return!0};Cs.prototype.get=function(e){return this._intervals[e]};Cs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Cs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Cs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Cs.prototype.contains=function(e){return this.indexOf(e)>=0};var kZ=new Cn;Cs.prototype.indexOf=function(e){let t=this._intervals;kZ.start=e,kZ.stop=e;let n=vr(t,kZ,zZ);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&&Cn.contains(t[n-1],e)?n-1:~n)};Cs.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};Cs.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=vr(n,e,zZ);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 r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({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):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({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 Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({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)};Cs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=vr(t,e,zZ);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.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 Cn({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 Cn({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 Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.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 Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Cs.prototype.intersect=function(e,t,n){let i=new Cs,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Cn.intersect(c,u,new Cn,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};Cs.fromJulianDateArray=function(e,t){l(t)||(t=new Cs);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new Cn({start:nt.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new Cn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new Cn({start:n[i-1],stop:nt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var cl=new Bh,NN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function UZ(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,cl);let i=cl.millisecond+t.millisecond,r=cl.second+t.second,o=cl.minute+t.minute,s=cl.hour+t.hour,a=cl.day+t.day,c=cl.month+t.month,u=cl.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),NN[2]=xf(u)?29:28;a>NN[c]||c>=13;)a>NN[c]&&(a-=NN[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),NN[2]=xf(u)?29:28;return cl.millisecond=i,cl.second=r,cl.minute=o,cl.hour=s,cl.day=a,cl.month=c,cl.year=u,K.fromGregorianDate(cl,n)}var tet=new K,net=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function xAe(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(net);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"),K.toGregorianDate(K.fromIso8601(e,tet),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var LN=new Bh;Cs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!xAe(n[2],LN))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=UZ(s,LN),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return Cs.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Cs.fromIso8601DateArray=function(e,t){return Cs.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Cs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],s,a,c=i.length;for(let u=0;u<c;++u)(xAe(i[u],LN)||u===0)&&(r&&l(a)?s=UZ(a,LN):s=UZ(n,LN),o.push(s),a=s);return Cs.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var vs=Cs;var TAe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(TAe);var Gg=TAe;var iet=new h(1,1,1),ret=h.ZERO,oet=Le.IDENTITY;function EAe(e,t,n){this.translation=h.clone(e??ret),this.rotation=Le.clone(t??oet),this.scale=h.clone(n??iet)}EAe.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var TA=EAe;var lm=class lm{constructor(){ut(this,"_collection",null);ut(this,"_index",-1);ut(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(lm.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(lm.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(lm.Layout.SHOW_U8)===1}set show(t){this._setUint8(lm.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(lm.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+lm.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(lm.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(lm.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};ut(lm,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var VZ=lm,os=VZ;var CAe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(CAe);var Fi=CAe;var EA={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,CLIP_TO_GROUND:7};Object.freeze(EA);var We=EA;function Ss(e){return e===EA.CLAMP_TO_GROUND||e===EA.CLAMP_TO_3D_TILE||e===EA.CLAMP_TO_TERRAIN}function CA(e){return e===EA.RELATIVE_TO_GROUND||e===EA.RELATIVE_TO_3D_TILE||e===EA.RELATIVE_TO_TERRAIN}var FN=class FN{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??Fi.TRANSLUCENT,this._modelMatrix=N.clone(t.modelMatrix??N.IDENTITY),this._boundingVolume=ce.clone(t.boundingVolume??new ce,new ce),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._customPickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??FN.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??FN.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._customPickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,s=new i,a=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,s),this.get(d,a)));for(let f=0;f<o;f++)n[c[f]]=f;let u=this._cloneEmpty();for(let f=0;f<o;f++){let d=this.get(c[f],s),p=u.add({},a);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n,i){if(l(i))return this._cloneFiltered(t,n,i);let r=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),s=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*r.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=t._customPickObjects,c=n._customPickObjects;c.length=0;let u=new s;for(let f=0,d=n.primitiveCount;f<d;f++)c[f]=a[f],n.get(f,u)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneFiltered(t,n,i){let r=t._getPrimitiveClass(),o=new r,s=new r,a=t._customPickObjects,c=n._customPickObjects;c.length=0;for(let u=0,f=t._primitiveCount;u<f;u++){if(t.get(u,o),!i(o,u))continue;let d=n._primitiveCount;r.clone(o,n.add({},s)),l(a[u])&&(c[d]=a[u])}return n}static fromCollection(t,n=H.EMPTY_OBJECT,i){let r=t._cloneEmpty(n);return t._getCollectionClass().clone(t,r,i),r}_cloneEmptyBaseArgs(t){return{primitiveCountMax:this.primitiveCountMax,vertexCountMax:this.vertexCountMax,positionDatatype:this.positionDatatype,positionNormalized:this.positionNormalized,modelMatrix:this._modelMatrix,show:this.show,debugShowBoundingVolume:this.debugShowBoundingVolume,blendOption:this._blendOption,allowPicking:this._allowPicking,boundingVolume:this._boundingVolumeAutoUpdate?void 0:this._boundingVolume,...t}}_cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=cn.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),ce.fromVertices(t,h.ZERO,3,this._boundingVolume),ce.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let s=n.length,a=this._primitiveCount;s<a;s++){this.get(s,o);let c=this._customPickObjects[s]||{collection:this,index:s,get primitive(){return i.get(s,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._customPickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&_t("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!Ss(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};ut(FN,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var GH=FN;GH.DEFAULT_CAPACITY=1024;var oa=GH;var{ERR_CAPACITY:mBn,ERR_RESIZE:pBn,ERR_OUT_OF_RANGE:gBn}=oa.Error,Xd=class Xd extends os{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(Xd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Xd.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i.vertexCount+s-o;i._positionCount=a,this._setUint32(Xd.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Xd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Xd.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let s=o.byteOffset+i*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r)}for(let s=0;s<r;s++)n[s]=o[i+s];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,s=n.length,a=i.holeCount+s-o;i._holeCount=a,this._setUint32(Xd.Layout.HOLE_COUNT_U32,s);let c=i._holeIndexView;for(let u=0;u<s;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],s=this.getHoleVertexCount(n);return this._getPositionsRange(o,s,i)}_getPositionsRange(n,i,r){let o=this._collection,s=this._collection._positionView,a=this.vertexOffset+n;if(!l(r)){let c=s.byteOffset+a*3*s.BYTES_PER_ELEMENT,u=s.constructor;return new u(s.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=s[(a+c)*3],r[c*3+1]=s[(a+c)*3+1],r[c*3+2]=s[(a+c)*3+2];return r}get triangleOffset(){return this._getUint32(Xd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Xd.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,s=n.length/3,a=i.triangleCount+s-o;i._triangleCount+=s-o,this._setUint32(Xd.Layout.TRIANGLE_COUNT_U32,s);let c=i._triangleIndexView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};ut(Xd,"Layout",{...os.Layout,POSITION_OFFSET_U32:os.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:os.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:os.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:os.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:os.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:os.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:os.Layout.__BYTE_LENGTH+24});var jZ=Xd,No=jZ;var BN=class{constructor(t=H.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};ut(BN,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(BN,"DEFAULT_MATERIAL");var Ql=BN;var WH=class WH extends Ql{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(WH,"DEFAULT_MATERIAL",Object.freeze(new WH));var HZ=WH,Bf=HZ;var{ERR_RESIZE:DBn,ERR_CAPACITY:RBn}=oa.Error,BS=class BS extends os{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(BS.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(BS.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i._positionCount+s-o;i._positionCount=a,this._setUint32(BS.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};ut(BS,"Layout",{...os.Layout,POSITION_OFFSET_U32:os.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:os.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:os.Layout.__BYTE_LENGTH+8});var GZ=BS,xa=GZ;var kN=class kN extends Ql{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setFloat32(this.Layout.WIDTH_F32+i,t.width,!0)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getFloat32(this.Layout.WIDTH_F32+n,!0),i}toJSON(){return{...super.toJSON(),width:this.width}}};ut(kN,"Layout",{...Ql.Layout,WIDTH_F32:Ql.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Ql.Layout.__BYTE_LENGTH+4}),ut(kN,"DEFAULT_MATERIAL",Object.freeze(new kN));var WZ=kN,kf=WZ;var vAe=16,set=.35,SAe=new xa,aet=new kf,wAe=new No,cet=new Bf,uet=new h,fet=new h,det=new he,het=new U,met=new U,UN=new z,YZ=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=NAe(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4),d=t.widthUnits==="meters";for(let p=0;p<r;p++){let g=t.get(p,SAe),m=g.getMaterial(aet);c[p]=d?-m.width:m.width,u[p*4]=z.floatToByte(m.color.red),u[p*4+1]=z.floatToByte(m.color.green),u[p*4+2]=z.floatToByte(m.color.blue),u[p*4+3]=z.floatToByte(m.color.alpha),IAe(f,p,g._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,widthInMeters:d,colors:u,pickColors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,SAe);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(D.EPSILON3,PAe(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,het),y=U.fromArray(a,(d+g+1)*2,met);pet(m,y,i,o),get(m,y,p)&&(r.polylineSegments.push([m.x,m.y,y.x,y.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),s>0&&(r.hasPixelWidths||(r.hasPixelWidths=!n.widthInMeters),r.hasMeterWidths||(r.hasMeterWidths=n.widthInMeters)),r.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/vAe))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=set/r,c=qH(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,PAe(c[i[A]],t)),T=Math.max(0,Math.min(b[0],b[2])-x),E=Math.min(1,Math.max(b[0],b[2])+x),v=Math.max(0,Math.min(b[1],b[3])-x),S=Math.min(1,Math.max(b[1],b[3])+x),I=vA(Math.floor(T*r),r),R=vA(Math.floor(E*r),r),O=vA(Math.floor(v*r),r),L=vA(Math.floor(S*r),r);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++)o[_*r+C].push(A),s++}let[u,f]=YH(s),d=u*f,p=new Float32Array(d*4).fill(-1),g=new Float32Array(d).fill(-1),m=new Uint32Array(o.length+2);m[0]=r,m[1]=r;let y=0;for(let A=0;A<o.length;A++){let b=o[A];for(let x=0;x<b.length;x++){let T=b[x],E=n[T];p[y*4]=E[0],p[y*4+1]=E[1],p[y*4+2]=E[2],p[y*4+3]=E[3];let v=i[T];g[y]=v,y++}m[A+2]=y}t.polylineSegmentTexels=p,t.polylineSegmentTextureWidth=u,t.polylineSegmentTextureHeight=f,t.polylineSegmentPrimitiveIndicesTexels=g,t.polylineGridCellIndices=m}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=NAe(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let p=t.get(d,wAe),g=p.getMaterial(cet);u[d*4]=z.floatToByte(g.color.red),u[d*4+1]=z.floatToByte(g.color.green),u[d*4+2]=z.floatToByte(g.color.blue),u[d*4+3]=z.floatToByte(g.color.alpha),IAe(f,d,p._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,colors:u,pickColors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,wAe);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=_et(a,f+m,A,i,o),x=OAe(b,A,-D.EPSILON3,1+D.EPSILON3,-D.EPSILON3,1+D.EPSILON3,RAe);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),r.primitiveCount+=s}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/vAe))),s=new Array(o*o);for(let y=0;y<s.length;y++)s[y]=[];let a=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,E=1/0,v=-1/0,S=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),v=Math.max(v,A[_*2]),E=Math.min(E,A[_*2+1]),S=Math.max(S,A[_*2+1]);let I=vA(Math.floor(T*o),o),R=vA(Math.floor(v*o),o),O=vA(Math.floor(E*o),o),L=vA(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=OAe(A,x,C/o-D.EPSILON5,(C+1)/o+D.EPSILON5,_/o-D.EPSILON5,(_+1)/o+D.EPSILON5,RAe),P=w.vertexCount;if(P<3)continue;let M=w.positions,F=s[_*o+C];for(let V=0;V<P;V++){let B=(V+1)%P,j=M[V*2],k=M[V*2+1],G=M[B*2],q=M[B*2+1];k!==q&&(F.push(j,k,G,q,b),a++)}}}let[c,u]=YH(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(s.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<s.length;y++){let A=s[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=YH(n.primitiveCount),o=new Float32Array(i*r);o.set(qH(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:jt.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(qH(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:jt.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(qH(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:jt.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:jt.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:jt.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=MAe(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:jt.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:jt.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=MAe(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.pickColorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function IAe(e,t,n){z.fromRgba(n,UN),e[t*4]=z.floatToByte(UN.red),e[t*4+1]=z.floatToByte(UN.green),e[t*4+2]=z.floatToByte(UN.blue),e[t*4+3]=z.floatToByte(UN.alpha)}function PAe(e,t){if(e>=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function pet(e,t,n,i){let r=e.x,o=t.x;o=r+D.negativePiToPi(o-r);let s=n.west+i*.5,a=s+D.negativePiToPi(r-s)-r;r+=a,o+=a;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function get(e,t,n){let i=-n,r=1+n,o=0,s=1,a=e.x,c=e.y,u=t.x,f=t.y,d=u-a,p=f-c,g=[-d,d,-p,p],m=[a-i,r-a,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):s=Math.min(s,A),o>s)return!1}return e.x=a+o*d,e.y=c+o*p,t.x=a+s*d,t.y=c+s*p,!0}function vA(e,t){return Math.max(0,Math.min(t-1,e))}var qZ=new Float64Array(512),DAe=new Float64Array(512),RAe={positions:new Float64Array(512),vertexCount:0};function _et(e,t,n,i,r){qZ.length<n*2&&(qZ=new Float64Array(n*4));let o=qZ,s=i.north-i.south,a=e[t*2];o[0]=a,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=a+D.negativePiToPi(e[(t+d)*2]-a);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],a=p}let c=i.west+r*.5,u=o[0],f=c+D.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/s;return o}function OAe(e,t,n,i,r,o,s){let a=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?DAe:s.positions;y.length<g&&(y=new Float64Array(g*2),m?DAe=y:s.positions=y);let A=0,b=a[(c-1)*2],x=a[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let E=0;E<c;E++){let v=a[E*2],S=a[E*2+1],I=d*((f===0?v:S)-p)>=0;if(I!==T){let R=f===0?(p-b)/(v-b):(p-x)/(S-x);y[A*2]=f===0?p:b+R*(v-b),y[A*2+1]=f===0?x+R*(S-x):p,A++}I&&(y[A*2]=v,y[A*2+1]=S,A++),b=v,x=S,T=I}if(A===0)return s.vertexCount=0,s;a=y,c=A}return s.vertexCount=c,s}function YH(e){let t=D.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=D.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function MAe(e,t){let[n,i]=YH(t.length),r=new Float32Array(n*i);return r.set(t),new Dt({context:e,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:jt.NEAREST,flipY:!1})}function NAe(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let s=h.fromArray(i,o*3,uet),a=N.multiplyByPoint(r,s,fet),c=t.cartesianToCartographic(a,det);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function qH(e){let t=0;for(let o of e)t+=o.byteLength;let n=e[0].constructor,i=new n(t/n.BYTES_PER_ELEMENT),r=0;for(let o of e)i.set(o,r),r+=o.length;return i}var ws=YZ;var LAe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(LAe);var Fc=LAe;var FAe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE};Object.freeze(FAe);var Zr=FAe;var BAe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fc.ADD,equationAlpha:Fc.ADD,functionSourceRgb:Zr.SOURCE_ALPHA,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fc.ADD,equationAlpha:Fc.ADD,functionSourceRgb:Zr.ONE,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Fc.ADD,equationAlpha:Fc.ADD,functionSourceRgb:Zr.SOURCE_ALPHA,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE,functionDestinationAlpha:Zr.ONE})};Object.freeze(BAe);var tn=BAe;var zN=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +#else +in vec3 position; +#endif +in vec4 pickColor; +in vec3 showColorAlpha; +out vec4 v_pickColor; +out vec4 v_color; +void main() +{ +float show = showColorAlpha.x; +vec4 color = czm_decodeRGB8(showColorAlpha.y); +float alpha = showColorAlpha.z; +#ifdef USE_FLOAT64 +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +#endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha * show; +gl_Position *= show; +} +`;var VN=`in vec4 v_pickColor; +in vec4 v_color; +void main() +{ +if (v_color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var XZ={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},kAe={position:0,pickColor:1,showColorAlpha:2},Ta=new No,KZ=new Bf,jN=new z,UAe=new h,$Z=new Sn;function yet(e,t,n){let i=t.context;n=n||{destroy:bet};let r=e._positionDatatype===Y.DOUBLE,o=r?XZ:kAe;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=je.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,Ta),!Ta._dirty)continue;let x=Ta.triangleOffset,T=Ta.vertexOffset,E=Ta.getTriangles();for(let R=0,O=Ta.triangleCount;R<O;R++)g[x*3]=T+E[R*3],g[x*3+1]=T+E[R*3+1],g[x*3+2]=T+E[R*3+2],x++;let v=Ta.show,S=r?Ta.getPositions():null;Ta.getMaterial(KZ);let I=cn.encodeRGB8(KZ.color);z.fromRgba(Ta._pickId,jN);for(let R=0,O=Ta.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,UAe),Sn.fromCartesian(UAe,$Z),h.pack($Z.high,d,T*3),h.pack($Z.low,p,T*3)),m[T*4]=z.floatToByte(jN.red),m[T*4+1]=z.floatToByte(jN.green),m[T*4+2]=z.floatToByte(jN.blue),m[T*4+3]=z.floatToByte(jN.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=KZ.color.alpha,T++;Ta._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Aet(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new zn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:XZ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:XZ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:kAe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Fi.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[zN],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[VN]}),attributeLocations:o}));let s=e.triangleCount*3;l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Fi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function Aet(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,Ta);let i=Ta.vertexOffset,r=Ta.triangleOffset*3;e.get(t+n-1,Ta);let o=Ta.vertexOffset+Ta.vertexCount-i,s=(Ta.triangleOffset+Ta.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function bet(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var HN=yet;var{ERR_CAPACITY:z2n}=oa.Error,JZ=class e extends oa{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??oa.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??oa.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return No}_getMaterialClass(){return Bf}_allocateHoleIndexBuffer(){this._holeIndexView=je.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=je.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new No){super.add(t,n);let i=this._positionCount;n._setUint32(No.Layout.POSITION_OFFSET_U32,i),n._setUint32(No.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(No.Layout.HOLE_OFFSET_U32,r),n._setUint32(No.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(No.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(No.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=HN(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},za=JZ;var GN=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +in vec3 prevPositionHigh; +in vec3 prevPositionLow; +in vec3 nextPositionHigh; +in vec3 nextPositionLow; +#else +in vec3 position; +in vec3 prevPosition; +in vec3 nextPosition; +#endif +in vec4 pickColor; +in vec4 showColorWidthAndTexCoord; +in float alpha; +out vec4 v_pickColor; +out vec4 v_color; +out vec2 v_st; +out float v_width; +out float v_polylineAngle; +void main() +{ +float show = showColorWidthAndTexCoord.x; +vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y); +float signedWidth = showColorWidthAndTexCoord.z; +float texCoord = showColorWidthAndTexCoord.w; +bool usePrevious = texCoord == 1.0; +float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0; +float polylineAngle; +#ifdef USE_FLOAT64 +vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow); +vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow); +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0); +vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0); +#endif +float width = abs(signedWidth); +if (signedWidth < 0.0) +{ +width /= max(czm_metersPerPixel(positionEC), czm_epsilon7); +} +#ifdef USE_FLOAT64 +vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); +#else +vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); +#endif +gl_Position = czm_viewportOrthographic * positionWC * show; +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha / 255.0 * show; +v_st.s = texCoord; +v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); +v_width = width; +v_polylineAngle = polylineAngle; +} +`;var WN=`in vec4 v_pickColor; +in vec4 v_color; +void main() +{ +if (v_color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var eu=`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); +float endPoint0Distance = czm_currentFrustum.x + p0.z; +float denominator = -direction.z; +if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) +{ +culledByNearPlane = true; +} +else if (endPoint0Distance > 0.0) +{ +float t = endPoint0Distance / denominator; +if (t < 0.0 || t > magnitude) +{ +culledByNearPlane = true; +} +else +{ +p0 = p0 + t * direction; +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) +{ +#ifdef POLYLINE_DASH +vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); +vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); +vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); +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; +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 (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; +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); +vec2 u = -thisSegmentForwardWC; +vec2 v = leftWC; +float sinAngle = abs(u.x * v.y - u.y * v.x); +expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); +} +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 fT={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},XH={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},ll=new xa,qN=new kf,YN=new z,zAe=new h,VAe=new h,jAe=new h,ZZ=new Sn,QZ=new Sn,eQ=new Sn;function xet(e,t,n){let i=t.context;n=n||{destroy:Cet};let r=e._positionDatatype===Y.DOUBLE,o=r?fT:XH;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=je.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=e.widthUnits==="meters",d=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:g,alpha:m,position:y,prevPosition:A,nextPosition:b,positionHigh:x,positionLow:T,prevPositionHigh:E,prevPositionLow:v,nextPositionHigh:S,nextPositionLow:I}=n.attributeArrays;for(let R=c,O=c+u;R<O;R++){if(e.get(R,ll),!ll._dirty)continue;ll.getMaterial(qN);let L=cn.encodeRGB8(qN.color),_=qN.color.alpha,C=f?-qN.width:qN.width;z.fromRgba(ll._pickId,YN);let w=ll.show,P=ll.vertexOffset*2,M=(ll.vertexOffset-R)*6,F=e._positionView,V=ll.vertexOffset*3;for(let B=0,j=ll.vertexCount;B<j;B++){let k=B===0,G=B===j-1,q=F[V+B*3],Q=F[V+B*3+1],W=F[V+B*3+2],J,Z,ae,Ae,fe,xe;k?(Ae=F[V+3],fe=F[V+3+1],xe=F[V+3+2],J=2*q-Ae,Z=2*Q-fe,ae=2*W-xe):G?(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=2*q-J,fe=2*Q-Z,xe=2*W-ae):(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=F[V+(B+1)*3],fe=F[V+(B+1)*3+1],xe=F[V+(B+1)*3+2]),G||(d[M]=P,d[M+1]=P+1,d[M+2]=P+2,d[M+3]=P+2,d[M+4]=P+1,d[M+5]=P+3,M+=6),r&&(h.fromElements(q,Q,W,zAe),h.fromElements(J,Z,ae,VAe),h.fromElements(Ae,fe,xe,jAe),Sn.fromCartesian(zAe,ZZ),Sn.fromCartesian(VAe,QZ),Sn.fromCartesian(jAe,eQ));for(let ge=0;ge<2;ge++)r?(h.pack(ZZ.high,x,P*3),h.pack(ZZ.low,T,P*3),h.pack(QZ.high,E,P*3),h.pack(QZ.low,v,P*3),h.pack(eQ.high,S,P*3),h.pack(eQ.low,I,P*3)):(y[P*3]=q,y[P*3+1]=Q,y[P*3+2]=W,A[P*3]=J,A[P*3+1]=Z,A[P*3+2]=ae,b[P*3]=Ae,b[P*3+1]=fe,b[P*3+2]=xe),p[P*4]=z.floatToByte(YN.red),p[P*4+1]=z.floatToByte(YN.green),p[P*4+2]=z.floatToByte(YN.blue),p[P*4+3]=z.floatToByte(YN.alpha),g[P*4]=w?1:0,g[P*4+1]=L,g[P*4+2]=C,g[P*4+3]=B/(j-1),m[P]=_*255,P++}ll._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Eet(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new zn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:fT.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:fT.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:fT.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:fT.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:fT.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:fT.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:XH.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:XH.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:XH.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:tt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Fi.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[eu,GN],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[WN]}),attributeLocations:o}));let s=Tet(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Fi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function Tet(e){return(e.vertexCount-e.primitiveCount)*6}function Eet(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ll);let i=ll.vertexOffset*2,o=(ll.vertexOffset-t)*6;e.get(t+n-1,ll);let s=(ll.vertexOffset+ll.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function Cet(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var XN=xet;var tQ=class e extends oa{constructor(t=H.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return xa}_getMaterialClass(){return kf}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new xa){super.add(t,n);let i=this._positionCount;return n._setUint32(xa.Layout.POSITION_OFFSET_U32,i),n._setUint32(xa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=XN(this,t,this._renderContext))}},ul=tQ;var WAe=new ie,HAe=new ie,nQ=new ie,KH=new Map;KH.set(ul,{packCollectionData:ws.packPolylineCollectionData,packTilePrimitives:ws.packPolylineSegments});KH.set(za,{packCollectionData:ws.packPolygonCollectionData,packTilePrimitives:ws.packPolygonRings});var iQ=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return KH.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r,o){let s=this._tilingScheme.tileXYToRectangle(t,n,i,WAe);return this.requestDataForRectangle(s,r,o)}requestDataForRectangle(t,n,i){let r=this._tilingScheme,o=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:ie.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:vet(t,r.ellipsoid)};for(let[u,f]of o){if(!GAe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,HAe);if(!!!ie.intersection(t,d,nQ))continue;let g=KH.get(u.constructor),m=this._getCollectionDataCached(u,g.packCollectionData);s.collectionVersions.set(u,m.version),g.packTilePrimitives(u,m,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(ws.packPolylineGrid(s),ws.packPolylineTextures(n,s)),c&&(ws.packPolygonGrid(s),ws.packPolygonTextures(n,s)),ws.packPrimitiveTextures(n,s),s)}releaseTileData(t){ws.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return wet(t,n,i,a,c)?(this.releaseTileData(o),this.requestTileData(t,n,i,r,s)):o}updateDataForRectangle(t,n,i,r){return this._isStale(i,t,r)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,r)):i}_isStale(t,n,i){if(!ie.equals(t.rectangle,n))return!0;let r=t.collectionVersions,o=this._heightReferenceByCollection,s=0;for(let[a,c]of o){if(!GAe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,HAe),f=!!ie.intersection(n,u,nQ),d=r.get(a);if(!f){if(l(d))return!0;continue}if(!l(d)||(s++,a._dirtyCount>0||d!==a._version))return!0}return s!==r.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(ie.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function GAe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function vet(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new U(e.width*n*Math.cos(i),e.height*n)}function wet(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,WAe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],nQ))return!0;return!1}var Wg=iQ;function dT(e){e=e??H.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=e.epoch??nt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(dT.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(dT.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=Iet(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});dT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};dT.prototype.isDestroyed=function(){return!1};dT.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};dT.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 r=e.currentTime,o=this.epoch??nt.MINIMUM_VALUE,s=K.secondsDifference(r,o),a=t.duration,c,u=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 f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function Iet(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var rQ=dT;function Pet(e,t){this.rectangle=e,this.maxLevel=t}function qAe(e){this.ellipsoid=e.ellipsoid??ee.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}qAe.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 Det(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Qi({ellipsoid:e.ellipsoid});else throw new oe(`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=qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=D.toRadians(parseFloat(s.getAttribute("minx"))),c=D.toRadians(parseFloat(s.getAttribute("miny"))),u=D.toRadians(parseFloat(s.getAttribute("maxx"))),f=D.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Pet(new ie(a,c,u,f),d))}}function Ret(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),$r.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Oet(e,t,n){try{let i=await t.fetchXML();Det(e,i)}catch(i){Ret(t,i,n)}}function SA(e){e=e??H.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 It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(SA.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(){}}});SA.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new qAe(t),i=De.createIfNeeded(e);await Oet(n,i);let r=new SA(t);return n.build(r),r._resource=i,r};SA.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-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 Rc({buffer:kh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Met(a,e,t,n),structure:a._terrainDataStructure})})};SA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var YAe=new ie;function Met(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,s,YAe);l(d)&&($H(r,f,t*2,n*2,i+1)&&(a|=4),$H(r,f,t*2+1,n*2,i+1)&&(a|=8),$H(r,f,t*2,n*2+1,i+1)&&(a|=1),$H(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function $H(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,YAe))}SA.prototype.getTileDataAvailable=function(e,t,n){};SA.prototype.loadTileDataAvailability=function(e,t,n){};var oQ=SA;var XAe={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};Object.freeze(XAe);var sQ=XAe;var KAe={};function Net(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var Let=new he,Fet=new he;function Bet(e,t,n,i){t=Fr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,Let);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,Fet);s&&(x.height=n[A]),m=m&&x.height===0,Net(d,x)?d.height<x.height&&(c[y-1]=x.height):(a[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],he.clone(x,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var ket=new Array(2),Uet=new Array(2),zet={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};KAe.computePositions=function(e,t,n,i,r,o){let s=Bet(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=D.chordLength(r,e.maximumRadius),p=zet;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=ir.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=ket,A=Uet;p.positions=y,p.height=A;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=ir.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(ir.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(ir.generateArc(p)),p.height=i,f=new Float64Array(ir.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var hT=KAe;var aQ=new h,JH=new h,Vet=new h,$Ae=new h,jet=new h,Het=new h,Get=new h;function mT(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Be.packedLength+1}mT.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var JAe=ee.clone(ee.UNIT_SPHERE),ZAe=new Be,KN={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:JAe,vertexFormat:ZAe,granularity:void 0};mT.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,JAe);t+=ee.packedLength;let u=Be.unpack(e,t,ZAe);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(KN.positions=o,KN.minimumHeights=s,KN.maximumHeights=a,KN.granularity=f,new mT(KN))};mT.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new mT(c)};mT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=hT.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,E=0,v=0,S=0,I=Get,R=Het,O=jet,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,aQ),k=h.fromArray(c,B,JH);if(r.position&&(g[x++]=k.x,g[x++]=k.y,g[x++]=k.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[S++]=C,b[S++]=0,b[S++]=C,b[S++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,$Ae),q=h.subtract(j,s.geodeticSurfaceNormal(j,JH),JH);if(_+1<d&&(G=h.fromArray(u,B+3,$Ae)),L){let Q=h.subtract(G,j,Vet),W=h.subtract(q,j,aQ);I=h.normalize(h.cross(W,Q,I),I),L=!1}h.equalsEpsilon(j,G,D.EPSILON10)?L=!0:(C+=w,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(I,R,O),O))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),r.bitangent&&(A[E++]=O.x,A[E++]=O.y,A[E++]=O.z,A[E++]=O.x,A[E++]=O.y,A[E++]=O.z)}}let P=new Tn;r.position&&(P.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(P.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(P.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(P.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(P.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let M=p/3;p-=6*(f+1);let F=je.createTypedArray(M,p),V=0;for(_=0;_<M-2;_+=2){let B=_,j=_+2,k=h.fromArray(g,B*3,aQ),G=h.fromArray(g,j*3,JH);if(h.equalsEpsilon(k,G,D.EPSILON10))continue;let q=_+1,Q=_+3;F[V++]=q,F[V++]=B,F[V++]=Q,F[V++]=Q,F[V++]=B,F[V++]=j}return new St({attributes:P,indices:F,primitiveType:Oe.TRIANGLES,boundingSphere:ce.fromVertices(g)})};var $N=mT;var QAe=new h,ebe=new h;function pT(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=ee.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}pT.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var tbe=ee.clone(ee.UNIT_SPHERE),JN={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:tbe,granularity:void 0};pT.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,tbe);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(JN.positions=o,JN.minimumHeights=s,JN.maximumHeights=a,JN.granularity=u,new pT(JN))};pT.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new pT(c)};pT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=hT.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,QAe),E=h.fromArray(a,x,ebe);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=je.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,E=h.fromArray(d,x*3,QAe),v=h.fromArray(d,T*3,ebe);if(h.equalsEpsilon(E,v,D.EPSILON10))continue;let S=g+1,I=g+3;A[b++]=S,A[b++]=x,A[b++]=S,A[b++]=I,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new St({attributes:m,indices:A,primitiveType:Oe.LINES,boundingSphere:ce.fromVertices(d)})};var ZN=pT;function Wet(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var cQ=Wet;var lQ={};function qet(e){let t=je.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function Yet(e,t){let n=t.length,i=je.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function Xet(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function Ket(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function $et(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function Jet(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}lQ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?Yet(t,n):qet(t);if(e===Oe.TRIANGLE_STRIP)return i?Ket(t,n):Xet(t);if(e===Oe.TRIANGLE_FAN)return i?Jet(t,n):$et(t)};lQ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var kS=lQ;function Zet(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var QN=Zet;function wA(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(wA.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});wA.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};wA.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};wA.prototype.equals=function(e){return this===e||e instanceof wA&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};wA.prototype.valueOf=function(){return this._value};wA.prototype.toString=function(){return String(this._value)};var _i=wA;function Qet(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function ett(e){return new _i(e)}function ttt(e,t,n){return Qet(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??ett)}var me=ttt;function eL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(eL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});eL.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 eL(this)};eL.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var fl=eL;var nbe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(nbe);var Hi=nbe;var ibe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(ibe);var Gn=ibe;var ntt=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=ntt;function um(){pe.throwInstantiationError()}Object.defineProperties(um.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});um.prototype.getValue=pe.throwInstantiationError;um.prototype.equals=pe.throwInstantiationError;um.equals=function(e,t){return e===t||l(e)&&e.equals(t)};um.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(!um.equals(e[i],t[i]))return!1;return!0};um.isConstant=function(e){return!l(e)||e.isConstant};um.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};um.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};um.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=um;var itt=500;function rtt(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>itt&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==re.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ee.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){r()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){r()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var fm=rtt;var ott=new he;function stt(e,t,n,i,r){let o=i.cartesianToCartographic(e,ott);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):Ss(n)?o.height=t:CA(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var qg=stt;var rbe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(rbe);var qo=rbe;var att=z.WHITE,ctt=h.ZERO,ltt=We.NONE,utt=U.ZERO,ftt=1,dtt=0,htt=h.ZERO,mtt=Hi.CENTER,ptt=Gn.CENTER,gtt=!1,_tt=qo.NONE,ytt=new h,Att=new z,btt=new h,xtt=new U,Ttt=new qt,Ett=new qt,Ctt=new qt,vtt=new et,Stt=new Ht;function obe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function IA(e,t){t.collectionChanged.addEventListener(IA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}IA.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,ytt),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){uQ(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(a._color,e,att,Att),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,ctt,btt),u.heightReference=X.getValueOrDefault(a._heightReference,e,ltt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,utt,xtt),u.scale=X.getValueOrDefault(a._scale,e,ftt),u.rotation=X.getValueOrDefault(a._rotation,e,dtt),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,htt),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,mtt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,ptt),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,Ttt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Ett),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Ctt),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,gtt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Stt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,_tt),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,vtt);l(p)&&u.setImageSubRegion(u.image,p)}return!0};IA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Pt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=fm(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=qg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};IA.prototype.isDestroyed=function(){return!1};IA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(IA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};IA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new obe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new obe(o)):(uQ(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],uQ(s.get(o.id),o,a),s.remove(o.id)};function uQ(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var tL=IA;var nL=`in vec3 v_positionEC; in vec3 v_normalEC; in vec3 v_tangentEC; in vec3 v_bitangentEC; @@ -1794,7 +3084,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var LI=`in vec3 position3DHigh; +`;var iL=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec3 tangent; @@ -1816,7 +3106,7 @@ v_bitangentEC = czm_normal * bitangent; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var NI=`in vec3 v_positionEC; +`;var rL=`in vec3 v_positionEC; in vec3 v_normalEC; void main() { @@ -1835,7 +3125,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var FI=`in vec3 position3DHigh; +`;var oL=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in float batchId; @@ -1848,7 +3138,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_normalEC = czm_normal * normal; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var BI=`in vec3 v_positionEC; +`;var sL=`in vec3 v_positionEC; in vec3 v_normalEC; in vec2 v_st; void main() @@ -1869,7 +3159,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var kI=`in vec3 position3DHigh; +`;var aL=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec2 st; @@ -1885,8 +3175,8 @@ v_normalEC = czm_normal * normal; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var CRe={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},Fa=Object.freeze(CRe);var ERe={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},Eo=Object.freeze(ERe);var SRe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.SOURCE_ALPHA,functionSourceAlpha:Eo.ONE,functionDestinationRgb:Eo.ONE,functionDestinationAlpha:Eo.ONE})},ln=Object.freeze(SRe);var wRe={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},xi=Object.freeze(wRe);function xC(e){e=e??W.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(xC.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}}});xC.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),c(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};xC.prototype.isTranslucent=function(){return c(this.material)&&this.material.isTranslucent()||!c(this.material)&&this.translucent};xC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=ln.ALPHA_BLEND):t.depthMask=!0,t};xC.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=ln.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:xi.BACK}),c(n)&&(i=xt(n,i,!0)),i};var io=xC;var UI=`uniform sampler2D image; +`;function US(e){e=e??H.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(US.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}}});US.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(` +`)};US.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};US.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=tn.ALPHA_BLEND):t.depthMask=!0,t};US.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=tn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Vi.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var Dr=US;var cL=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -1896,7 +3186,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var VI=`uniform sampler2D image; +`;var lL=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -1917,7 +3207,7 @@ material.normal = normalEC; material.diffuse = vec3(0.01); return material; } -`;var zI=`uniform vec4 lightColor; +`;var uL=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -1937,7 +3227,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var HI=`uniform vec4 lightColor; +`;var fL=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -1950,7 +3240,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var GI=`uniform sampler2D heights; +`;var dL=`uniform sampler2D heights; uniform sampler2D colors; float getHeight(int idx, float invTexSize) { @@ -2004,7 +3294,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var jI=`uniform vec4 color; +`;var hL=`uniform vec4 color; uniform float spacing; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2024,7 +3314,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var WI=`uniform sampler2D image; +`;var mL=`uniform sampler2D image; uniform float minimumHeight; uniform float maximumHeight; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2037,7 +3327,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var qI=`uniform vec4 fadeInColor; +`;var pL=`uniform vec4 fadeInColor; uniform vec4 fadeOutColor; uniform float maximumDistance; uniform bool repeat; @@ -2068,7 +3358,7 @@ material.emission = color.rgb; material.alpha = color.a; return material; } -`;var YI=`uniform vec4 color; +`;var gL=`uniform vec4 color; uniform float cellAlpha; uniform vec2 lineCount; uniform vec2 lineThickness; @@ -2110,7 +3400,7 @@ material.emission = halfColor.rgb; material.alpha = halfColor.a; return material; } -`;var XI=`uniform sampler2D image; +`;var _L=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2125,7 +3415,7 @@ vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; material.normal = normalEC; return material; } -`;var KI=`uniform vec4 color; +`;var yL=`uniform vec4 color; float getPointOnLine(vec2 p0, vec2 p1, float x) { float slope = (p0.y - p1.y) / (p0.x - p1.x); @@ -2176,7 +3466,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var $I=`uniform vec4 color; +`;var AL=`uniform vec4 color; uniform vec4 gapColor; uniform float dashLength; uniform float dashPattern; @@ -2206,7 +3496,7 @@ material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } -`;var ZI=`uniform vec4 color; +`;var bL=`uniform vec4 color; uniform float glowPower; uniform float taperPower; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2219,13 +3509,13 @@ 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.a = clamp(glow, 0.0, 1.0) * color.a; fragColor = czm_gammaCorrect(fragColor); material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } -`;var QI=`uniform vec4 color; +`;var xL=`uniform vec4 color; uniform vec4 outlineColor; uniform float outlineWidth; in float v_width; @@ -2246,7 +3536,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var JI=`uniform vec4 color; +`;var TL=`uniform vec4 color; uniform vec4 rimColor; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2261,7 +3551,7 @@ material.emission = outRimColor.rgb * s; material.alpha = mix(outColor.a, outRimColor.a, s); return material; } -`;var eO=`uniform sampler2D image; +`;var EL=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -2271,7 +3561,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var tO=`uniform vec4 evenColor; +`;var CL=`uniform vec4 evenColor; uniform vec4 oddColor; uniform float offset; uniform float repeat; @@ -2289,7 +3579,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var nO=`uniform vec4 waterColor; +`;var vL=`uniform vec4 waterColor; uniform vec4 landColor; czm_material czm_getMaterial(czm_materialInput materialInput) { @@ -2300,7 +3590,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var iO=`uniform sampler2D specularMap; +`;var SL=`uniform sampler2D specularMap; uniform sampler2D normalMap; uniform vec4 baseWaterColor; uniform vec4 blendColor; @@ -2330,16 +3620,16 @@ material.specular = specularIntensity; material.shininess = 10.0; return material; } -`;function Ye(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=e.minificationFilter??Yt.LINEAR,this._magnificationFilter=e.magnificationFilter??li.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,vRe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),c(Ye._uniformList[this.type])||(Ye._uniformList[this.type]=Object.keys(this._uniforms))}Ye._uniformList={};Ye.fromType=function(e,t){if(!c(Ye._materialCache.getMaterial(e)))throw new E(`material with type '${e}' does not exist.`);let n=new Ye({fabric:{type:e}});if(c(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Ye.prototype.isTranslucent=function(){if(c(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};Ye.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let l=i[t];n=l.id;let u=l.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let h=new Qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;c(u.internalFormat)?p=new Rt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new Rt({context:e,source:u,sampler:h});let g=this._textures[n];c(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let l=r[t];n=l.id;let u=l.images,f=new Go({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}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 l in a)a.hasOwnProperty(l)&&a[l].update(e)};Ye.prototype.isDestroyed=function(){return!1};Ye.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 de(this)};function vRe(e,t){e=e??W.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=je(e.fabric??W.EMPTY_OBJECT),t._template.uniforms=je(t._template.uniforms??W.EMPTY_OBJECT),t._template.materials=je(t._template.materials??W.EMPTY_OBJECT),t.type=c(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Ye._materialCache.getMaterial(t.type);if(c(i)){let r=je(i.fabric,!0);t._template=xt(t._template,r,!0),n=i.translucent}ORe(t),c(i)||Ye._materialCache.addMaterial(t.type,t),MRe(t),BRe(t),URe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,c(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function m6(e,t,n,i){if(c(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function nie(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){let o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new E(n)}function DRe(e,t){let n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new E(n)}var PRe=["type","materials","uniforms","components","source"],IRe=["diffuse","specular","shininess","normal","emission","alpha"];function ORe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(c(o)&&c(t.source))throw new E("fabric: cannot have source and components in the same template.");m6(t,PRe,nie,!0),m6(o,IRe,nie,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);m6(n,r,DRe,!1)}function RRe(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 MRe(e){let t=e._template.components,n=e._template.source;if(c(n))e.shaderSource+=`${n} +`;function it(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=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??Jn.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,this._initializationPromises=[],this._initializationError=void 0,wtt(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(it._uniformList[this.type])||(it._uniformList[this.type]=Object.keys(this._uniforms))}it._uniformList={};it.fromType=function(e,t){let n=new it({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};it.fromTypeAsync=async function(e,t){let n=[],i=new it({fabric:{type:e,uniforms:t}});if(cbe(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function cbe(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];cbe(r,t)}}it.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 r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};it.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new ns({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};it.prototype.isDestroyed=function(){return!1};it.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 ue(this)};function wtt(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Je(e.fabric??H.EMPTY_OBJECT),t.fabric=Je(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Je(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Je(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=it._materialCache.getMaterial(t.type);if(l(i)){let o=Je(i.fabric,!0);t._template=Ot(t._template,o,!0),n=i.translucent}Rtt(t),Mtt(t),Btt(t),Utt(t),l(i)||it._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function fQ(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function sbe(e,t){}function Itt(e,t){}var Ptt=["type","materials","uniforms","components","source"],Dtt=["diffuse","specular","shininess","normal","emission","alpha"];function Rtt(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;fQ(t,Ptt,sbe,!0),fQ(r,Dtt,sbe,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);fQ(n,o,Itt,!1)}function Ott(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 Mtt(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); -`,c(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&&RRe(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]}; +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&Ott(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; +`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${r} = ${t[r]}; `}e.shaderSource+=`return material; } -`}}var iie={mat2:Ri,mat3:J,mat4:B},LRe=/\.ktx2$/i;function NRe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!c(r)||r===Ye.DefaultImageId;t=r;let l=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&c(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!c(l)||l===i.defaultTexture){let p=new Qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Rt({context:i,source:r,sampler:p}),n._textures[e]=l;return}l.copyFrom({source:r})}else c(l)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Rt&&r!==l){n._texturePaths[e]=void 0;let p=n._textures[e];c(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&c(l)&&a&&(l!==n._defaultTexture&&l.destroy(),l=void 0),c(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=l._width,f.y=l._height)),a)return;let h=r instanceof we;if(!c(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:we.createIfNeeded(r),g;LRe.test(p.url)?g=Il(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){c(l)&&l!==n._defaultTexture&&l.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 FRe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Go){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(c(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Ye.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[we.createIfNeeded(i.positiveX).fetchImage(),we.createIfNeeded(i.negativeX).fetchImage(),we.createIfNeeded(i.positiveY).fetchImage(),we.createIfNeeded(i.negativeY).fetchImage(),we.createIfNeeded(i.positiveZ).fetchImage(),we.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function BRe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&oie(e,n)}function oie(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=kRe(o);if(!c(r))throw new E(`fabric: uniform '${t}' has invalid type.`);let s;if(r==="channels"){if(s=oO(e,t,o,!1),s===0&&n)throw new E(`strict: shader source does not use channels '${t}'.`)}else{if(r==="sampler2D"){let u=`${t}Dimensions`;VRe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},oie(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let l=`${t}_${e._count++}`;if(s=oO(e,t,l),s===1&&n)throw new E(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,r==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(NRe(t));else if(r==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(FRe(t));else if(r.indexOf("mat")!==-1){let u=new iie[r];e._uniforms[l]=function(){return iie[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function kRe(e){let t=e.type;if(!c(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Ye.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 URe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Ye({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;oO(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`;if(oO(e,i,a)===0&&t)throw new E(`strict: shader source does not use material '${i}'.`)}}function oO(e,t,n,i){i=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(l,u,f){return u||f?l:(o+=1,n)}),o}function VRe(e,t,n){return oO(e,t,t,n)}Ye._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Ye.DefaultImageId="czm_defaultImage";Ye.DefaultCubeMapId="czm_defaultCubeMap";Ye.ColorType="Color";Ye._materialCache.addMaterial(Ye.ColorType,{fabric:{type:Ye.ColorType,uniforms:{color:new G(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.ImageType="Image";Ye._materialCache.addMaterial(Ye.ImageType,{fabric:{type:Ye.ImageType,uniforms:{image:Ye.DefaultImageId,repeat:new H(1,1),color:new G(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}});Ye.DiffuseMapType="DiffuseMap";Ye._materialCache.addMaterial(Ye.DiffuseMapType,{fabric:{type:Ye.DiffuseMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.AlphaMapType="AlphaMap";Ye._materialCache.addMaterial(Ye.AlphaMapType,{fabric:{type:Ye.AlphaMapType,uniforms:{image:Ye.DefaultImageId,channel:"a",repeat:new H(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Ye.SpecularMapType="SpecularMap";Ye._materialCache.addMaterial(Ye.SpecularMapType,{fabric:{type:Ye.SpecularMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",repeat:new H(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Ye.EmissionMapType="EmissionMap";Ye._materialCache.addMaterial(Ye.EmissionMapType,{fabric:{type:Ye.EmissionMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new H(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.BumpMapType="BumpMap";Ye._materialCache.addMaterial(Ye.BumpMapType,{fabric:{type:Ye.BumpMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",strength:.8,repeat:new H(1,1)},source:VI},translucent:!1});Ye.NormalMapType="NormalMap";Ye._materialCache.addMaterial(Ye.NormalMapType,{fabric:{type:Ye.NormalMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",strength:.8,repeat:new H(1,1)},source:XI},translucent:!1});Ye.GridType="Grid";Ye._materialCache.addMaterial(Ye.GridType,{fabric:{type:Ye.GridType,uniforms:{color:new G(0,1,0,1),cellAlpha:.1,lineCount:new H(8,8),lineThickness:new H(1,1),lineOffset:new H(0,0)},source:YI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Ye.StripeType="Stripe";Ye._materialCache.addMaterial(Ye.StripeType,{fabric:{type:Ye.StripeType,uniforms:{horizontal:!0,evenColor:new G(1,1,1,.5),oddColor:new G(0,0,1,.5),offset:0,repeat:5},source:tO},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Ye.CheckerboardType="Checkerboard";Ye._materialCache.addMaterial(Ye.CheckerboardType,{fabric:{type:Ye.CheckerboardType,uniforms:{lightColor:new G(1,1,1,.5),darkColor:new G(0,0,0,.5),repeat:new H(5,5)},source:zI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.DotType="Dot";Ye._materialCache.addMaterial(Ye.DotType,{fabric:{type:Ye.DotType,uniforms:{lightColor:new G(1,1,0,.75),darkColor:new G(0,1,1,.75),repeat:new H(5,5)},source:HI},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.WaterType="Water";Ye._materialCache.addMaterial(Ye.WaterType,{fabric:{type:Ye.WaterType,uniforms:{baseWaterColor:new G(.2,.3,.6,1),blendColor:new G(0,1,.699,1),specularMap:Ye.DefaultImageId,normalMap:Ye.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:iO},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Ye.RimLightingType="RimLighting";Ye._materialCache.addMaterial(Ye.RimLightingType,{fabric:{type:Ye.RimLightingType,uniforms:{color:new G(1,0,0,.7),rimColor:new G(1,1,1,.4),width:.3},source:JI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Ye.FadeType="Fade";Ye._materialCache.addMaterial(Ye.FadeType,{fabric:{type:Ye.FadeType,uniforms:{fadeInColor:new G(1,0,0,1),fadeOutColor:new G(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new H(.5,.5)},source:qI},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Ye.PolylineArrowType="PolylineArrow";Ye._materialCache.addMaterial(Ye.PolylineArrowType,{fabric:{type:Ye.PolylineArrowType,uniforms:{color:new G(1,1,1,1)},source:KI},translucent:!0});Ye.PolylineDashType="PolylineDash";Ye._materialCache.addMaterial(Ye.PolylineDashType,{fabric:{type:Ye.PolylineDashType,uniforms:{color:new G(1,0,1,1),gapColor:new G(0,0,0,0),dashLength:16,dashPattern:255},source:$I},translucent:!0});Ye.PolylineGlowType="PolylineGlow";Ye._materialCache.addMaterial(Ye.PolylineGlowType,{fabric:{type:Ye.PolylineGlowType,uniforms:{color:new G(0,.5,1,1),glowPower:.25,taperPower:1},source:ZI},translucent:!0});Ye.PolylineOutlineType="PolylineOutline";Ye._materialCache.addMaterial(Ye.PolylineOutlineType,{fabric:{type:Ye.PolylineOutlineType,uniforms:{color:new G(1,1,1,1),outlineColor:new G(1,0,0,1),outlineWidth:1},source:QI},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Ye.ElevationContourType="ElevationContour";Ye._materialCache.addMaterial(Ye.ElevationContourType,{fabric:{type:Ye.ElevationContourType,uniforms:{spacing:100,color:new G(1,0,0,1),width:1},source:jI},translucent:!1});Ye.ElevationRampType="ElevationRamp";Ye._materialCache.addMaterial(Ye.ElevationRampType,{fabric:{type:Ye.ElevationRampType,uniforms:{image:Ye.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:WI},translucent:!1});Ye.SlopeRampMaterialType="SlopeRamp";Ye._materialCache.addMaterial(Ye.SlopeRampMaterialType,{fabric:{type:Ye.SlopeRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:eO},translucent:!1});Ye.AspectRampMaterialType="AspectRamp";Ye._materialCache.addMaterial(Ye.AspectRampMaterialType,{fabric:{type:Ye.AspectRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:UI},translucent:!1});Ye.ElevationBandType="ElevationBand";Ye._materialCache.addMaterial(Ye.ElevationBandType,{fabric:{type:Ye.ElevationBandType,uniforms:{heights:Ye.DefaultImageId,colors:Ye.DefaultImageId},source:GI},translucent:!0});Ye.WaterMaskType="WaterMask";Ye._materialCache.addMaterial(Ye.WaterMaskType,{fabric:{type:Ye.WaterMaskType,source:nO,uniforms:{waterColor:new G(1,1,1,1),landColor:new G(0,0,0,0)}},translucent:!1});var Xi=Ye;function Ib(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Ib.MaterialSupport.TEXTURED;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(Ib.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}}});Ib.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Ib.prototype.isTranslucent=io.prototype.isTranslucent;Ib.prototype.getRenderState=io.prototype.getRenderState;Ib.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:FI,fragmentShaderSource:NI}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:kI,fragmentShaderSource:BI}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:LI,fragmentShaderSource:MI})};var ao=Ib;var rO=`in vec3 v_positionEC; +`}}var abe={mat2:Xi,mat3:$,mat4:N},Ntt=/\.ktx2$/i;function Ltt(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===it.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Dt&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!a){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}lbe(n,e)}}}function lbe(e,t){let i=e.uniforms[t];if(i===it.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let a;return Ntt.test(r.url)?a=Ru(r.url):a=r.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function Ftt(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ns){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),ube(t,e)}}function ube(e,t){let i=e.uniforms[t];if(i===it.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(o);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=r,s}function Btt(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&fbe(e,n)}function fbe(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=ktt(r),s;if(o==="channels")s=wL(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;ztt(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},fbe(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=wL(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Ltt(t)),e._initializationPromises.push(lbe(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Ftt(t)),e._initializationPromises.push(ube(e,t));else if(o.indexOf("mat")!==-1){let u=new abe[o];e._uniforms[c]=function(){return abe[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function ktt(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 De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===it.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 r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function Utt(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new it({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Ot(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;wL(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=wL(e,i,a)}}function wL(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function ztt(e,t,n){return wL(e,t,t,n)}it._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};it.DefaultImageId="czm_defaultImage";it.DefaultCubeMapId="czm_defaultCubeMap";it.ColorType="Color";it._materialCache.addMaterial(it.ColorType,{fabric:{type:it.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.ImageType="Image";it._materialCache.addMaterial(it.ImageType,{fabric:{type:it.ImageType,uniforms:{image:it.DefaultImageId,repeat:new U(1,1),color:new z(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}});it.DiffuseMapType="DiffuseMap";it._materialCache.addMaterial(it.DiffuseMapType,{fabric:{type:it.DiffuseMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.AlphaMapType="AlphaMap";it._materialCache.addMaterial(it.AlphaMapType,{fabric:{type:it.AlphaMapType,uniforms:{image:it.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});it.SpecularMapType="SpecularMap";it._materialCache.addMaterial(it.SpecularMapType,{fabric:{type:it.SpecularMapType,uniforms:{image:it.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});it.EmissionMapType="EmissionMap";it._materialCache.addMaterial(it.EmissionMapType,{fabric:{type:it.EmissionMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.BumpMapType="BumpMap";it._materialCache.addMaterial(it.BumpMapType,{fabric:{type:it.BumpMapType,uniforms:{image:it.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:lL},translucent:!1});it.NormalMapType="NormalMap";it._materialCache.addMaterial(it.NormalMapType,{fabric:{type:it.NormalMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:_L},translucent:!1});it.GridType="Grid";it._materialCache.addMaterial(it.GridType,{fabric:{type:it.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:gL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});it.StripeType="Stripe";it._materialCache.addMaterial(it.StripeType,{fabric:{type:it.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:CL},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});it.CheckerboardType="Checkerboard";it._materialCache.addMaterial(it.CheckerboardType,{fabric:{type:it.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:uL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.DotType="Dot";it._materialCache.addMaterial(it.DotType,{fabric:{type:it.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:fL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.WaterType="Water";it._materialCache.addMaterial(it.WaterType,{fabric:{type:it.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:it.DefaultImageId,normalMap:it.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:SL},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});it.RimLightingType="RimLighting";it._materialCache.addMaterial(it.RimLightingType,{fabric:{type:it.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:TL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});it.FadeType="Fade";it._materialCache.addMaterial(it.FadeType,{fabric:{type:it.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:pL},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});it.PolylineArrowType="PolylineArrow";it._materialCache.addMaterial(it.PolylineArrowType,{fabric:{type:it.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:yL},translucent:!0});it.PolylineDashType="PolylineDash";it._materialCache.addMaterial(it.PolylineDashType,{fabric:{type:it.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:AL},translucent:!0});it.PolylineGlowType="PolylineGlow";it._materialCache.addMaterial(it.PolylineGlowType,{fabric:{type:it.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:bL},translucent:!0});it.PolylineOutlineType="PolylineOutline";it._materialCache.addMaterial(it.PolylineOutlineType,{fabric:{type:it.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:xL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});it.ElevationContourType="ElevationContour";it._materialCache.addMaterial(it.ElevationContourType,{fabric:{type:it.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:hL},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:mL},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:EL},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:cL},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:dL},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:vL,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var or=it;function gT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??gT.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:or.fromType(or.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Dr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(gT.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}}});gT.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;gT.prototype.isTranslucent=Dr.prototype.isTranslucent;gT.prototype.getRenderState=Dr.prototype.getRenderState;gT.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:oL,fragmentShaderSource:rL}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:aL,fragmentShaderSource:sL}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:iL,fragmentShaderSource:nL})};var Er=gT;var IL=`in vec3 v_positionEC; in vec3 v_normalEC; in vec4 v_color; void main() @@ -2358,7 +3648,7 @@ material.diffuse = color.rgb; material.alpha = color.a; out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); } -`;var sO=`in vec3 position3DHigh; +`;var PL=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec4 color; @@ -2374,12 +3664,12 @@ v_normalEC = czm_normal * normal; v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var Ob=`in vec4 v_color; +`;var _T=`in vec4 v_color; void main() { out_FragColor = czm_gammaCorrect(v_color); } -`;var aO=`in vec3 position3DHigh; +`;var DL=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; in float batchId; @@ -2390,7 +3680,7 @@ vec4 p = czm_computePosition(); v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function Lp(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?aO:sO,r=i?Ob:rO,s=i?Lp.FLAT_VERTEX_FORMAT:Lp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Lp.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}}});Lp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;Lp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;Lp.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Lp.prototype.isTranslucent=io.prototype.isTranslucent;Lp.prototype.getRenderState=io.prototype.getRenderState;var rn=Lp;function TC(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(TC.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});TC.prototype.getType=function(e){return"Color"};var zRe=new Q;TC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(zRe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};TC.prototype.equals=function(e){return this===e||e instanceof TC&&X.equals(this._color,e._color)};var Ut=TC;function Zg(e){e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new Oi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Zg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Zg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Zg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Zg.prototype.rectangleToNativeRectangle=function(e,t){T.defined("rectangle",e);let n=O.toDegrees(e.west),i=O.toDegrees(e.south),o=O.toDegrees(e.east),r=O.toDegrees(e.north);return c(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};Zg.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=O.toDegrees(o.west),o.south=O.toDegrees(o.south),o.east=O.toDegrees(o.east),o.north=O.toDegrees(o.north),o};Zg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,l=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,h=o.north-t*f,p=o.north-(t+1)*f;return c(i)||(i=new ce(l,p,u,h)),i.west=l,i.south=p,i.east=u,i.north=h,i};Zg.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,l=e.longitude;i.east<i.west&&(l+=O.TWO_PI);let u=(l-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),c(n)?(n.x=u,n.y=f,n):new H(u,f)};var Ki=Zg;var rie=new d,sie=new d,aie=new he,p6=new d,HRe=new d,cie=new le,GRe=new Ki,cO=[new he,new he,new he,new he],lO=new H,vr={};vr.initialize=function(){let e=vr._initPromise;return c(e)||(e=we.fetchJson(tn("Assets/approximateTerrainHeights.json")).then(function(t){vr._terrainHeights=t}),vr._initPromise=e),e};vr.getMinimumMaximumHeights=function(e,t){if(T.defined("rectangle",e),!c(vr._terrainHeights))throw new E("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=lie(e),i=vr._defaultMinTerrainHeight,o=vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=vr._terrainHeights[r];c(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,aie),rie),t.cartographicToCartesian(ce.southwest(e,aie),sie),d.midpoint(sie,rie,p6);let a=t.scaleToGeodeticSurface(p6,HRe);if(c(a)){let l=d.distance(p6,a);i=Math.min(i,-l)}else i=vr._defaultMinTerrainHeight}return i=Math.max(vr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};vr.getBoundingSphere=function(e,t){if(T.defined("rectangle",e),!c(vr._terrainHeights))throw new E("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=lie(e),i=vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=vr._terrainHeights[r];c(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,cie),le.union(o,cie,o)};function lie(e){he.fromRadians(e.east,e.north,0,cO[0]),he.fromRadians(e.west,e.north,0,cO[1]),he.fromRadians(e.east,e.south,0,cO[2]),he.fromRadians(e.west,e.south,0,cO[3]);let t=0,n=0,i=0,o=0,r=vr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let l=0;l<4;++l){let u=cO[l];if(GRe.positionToTileXY(u,s,lO),l===0)i=lO.x,o=lO.y;else if(i!==lO.x||o!==lO.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}}vr._terrainHeightsMaxLevel=6;vr._defaultMaxTerrainHeight=9e3;vr._defaultMinTerrainHeight=-1e5;vr._terrainHeights=void 0;vr._initPromise=void 0;Object.defineProperties(vr,{initialized:{get:function(){return c(vr._terrainHeights)}}});var ui=vr;function Gc(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),c(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}Gc.fromCorners=function(e,t,n){return T.defined("minimum",e),T.defined("maximum",t),c(n)||(n=new Gc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};Gc.fromPoints=function(e,t){if(c(t)||(t=new Gc),!c(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.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,l=e.length;for(let h=1;h<l;h++){let p=e[h],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=d.midpoint(u,f,t.center),t};Gc.clone=function(e,t){if(c(e))return c(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new Gc(e.minimum,e.maximum,e.center)};Gc.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var DV=new d;Gc.intersectPlane=function(e,t){T.defined("box",e),T.defined("plane",t),DV=d.subtract(e.maximum,e.minimum,DV);let n=d.multiplyByScalar(DV,.5,DV),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?Wt.INSIDE:r+o<0?Wt.OUTSIDE:Wt.INTERSECTING};Gc.prototype.clone=function(e){return Gc.clone(this,e)};Gc.prototype.intersectPlane=function(e){return Gc.intersectPlane(this,e)};Gc.prototype.equals=function(e){return Gc.equals(this,e)};var Qg=Gc;var _6=new se;function _m(e,t){if(T.defined("origin",e),t=t??ie.default,e=t.scaleToGeodeticSurface(e),!c(e))throw new E("origin must not be at the center of the ellipsoid.");let n=Ot.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(B.getColumn(n,0,_6)),this._yAxis=d.fromCartesian4(B.getColumn(n,1,_6));let i=d.fromCartesian4(B.getColumn(n,2,_6));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(_m.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 jRe=new Qg;_m.fromPoints=function(e,t){T.defined("cartesians",e);let n=Qg.fromPoints(e,jRe);return new _m(n.center,t)};var uie=new mn,PV=new d;_m.prototype.projectPointOntoPlane=function(e,t){T.defined("cartesian",e);let n=uie;n.origin=e,d.normalize(e,n.direction);let i=Zn.rayPlane(n,this._plane,PV);if(c(i)||(d.negate(n.direction,n.direction),i=Zn.rayPlane(n,this._plane,PV)),c(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return c(t)?(t.x=r,t.y=s,t):new H(r,s)}};_m.prototype.projectPointsOntoPlane=function(e,t){T.defined("cartesians",e),c(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);c(r)&&(t[n]=r,n++)}return t.length=n,t};_m.prototype.projectPointToNearestOnPlane=function(e,t){T.defined("cartesian",e),c(t)||(t=new H);let n=uie;n.origin=e,d.clone(this._plane.normal,n.direction);let i=Zn.rayPlane(n,this._plane,PV);c(i)||(d.negate(n.direction,n.direction),i=Zn.rayPlane(n,this._plane,PV));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return t.x=r,t.y=s,t};_m.prototype.projectPointsToNearestOnPlane=function(e,t){T.defined("cartesians",e),c(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 WRe=new d;_m.prototype.projectPointOntoEllipsoid=function(e,t){T.defined("cartesian",e),c(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=WRe;return d.multiplyByScalar(o,e.x,s),t=d.add(i,s,t),d.multiplyByScalar(r,e.y,s),d.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};_m.prototype.projectPointsOntoEllipsoid=function(e,t){T.defined("cartesians",e);let n=e.length;c(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 ns=_m;function zi(e,t){this.center=d.clone(e??d.ZERO),this.halfAxes=J.clone(t??J.ZERO)}zi.packedLength=d.packedLength+J.packedLength;zi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e.center,t,n),J.pack(e.halfAxes,t,n+d.packedLength),t};zi.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new zi),d.unpack(e,t,n.center),J.unpack(e,t+d.packedLength,n.halfAxes),n};var qRe=new d,YRe=new d,XRe=new d,KRe=new d,$Re=new d,ZRe=new d,QRe=new J,JRe={unitary:new J,diagonal:new J};zi.fromPoints=function(e,t){if(c(t)||(t=new zi),!c(e)||e.length===0)return t.halfAxes=J.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],qRe);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let s=0,a=0,l=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,YRe),s+=p.x*p.x,a+=p.x*p.y,l+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,l*=r,u*=r,f*=r,h*=r;let g=QRe;g[0]=s,g[1]=a,g[2]=l,g[3]=a,g[4]=u,g[5]=f,g[6]=l,g[7]=f,g[8]=h;let m=J.computeEigenDecomposition(g,JRe),y=J.clone(m.unitary,t.halfAxes),b=J.getColumn(y,0,KRe),x=J.getColumn(y,1,$Re),A=J.getColumn(y,2,ZRe),C=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,P=Number.MAX_VALUE,M=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],C=Math.max(d.dot(b,p),C),S=Math.max(d.dot(x,p),S),v=Math.max(d.dot(A,p),v),P=Math.min(d.dot(b,p),P),M=Math.min(d.dot(x,p),M),R=Math.min(d.dot(A,p),R);b=d.multiplyByScalar(b,.5*(P+C),b),x=d.multiplyByScalar(x,.5*(M+S),x),A=d.multiplyByScalar(A,.5*(R+v),A);let L=d.add(b,x,t.center);d.add(L,A,L);let F=XRe;return F.x=C-P,F.y=S-M,F.z=v-R,d.multiplyByScalar(F,.5,F),J.multiplyByScale(t.halfAxes,F,t.halfAxes),t};var _ie=new d,eMe=new d;function fie(e,t,n,i,o,r,s,a,l,u,f){if(!c(o)||!c(r)||!c(s)||!c(a)||!c(l)||!c(u))throw new E("all extents (minimum/maximum X/Y/Z) are required.");c(f)||(f=new zi);let h=f.halfAxes;J.setColumn(h,0,t,h),J.setColumn(h,1,n,h),J.setColumn(h,2,i,h);let p=_ie;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(l+u)/2;let g=eMe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-l)/2;let m=f.center;return p=J.multiplyByVector(h,p,p),d.add(e,p,m),J.multiplyByScale(h,g,h),f}var die=new he,tMe=new d,nMe=new he,iMe=new he,oMe=new he,rMe=new he,sMe=new he,aMe=new d,hie=new d,cMe=new d,mie=new d,lMe=new d,uMe=new H,fMe=new H,dMe=new H,hMe=new H,mMe=new H,pMe=new d,_Me=new d,gMe=new d,yMe=new d,bMe=new H,xMe=new d,TMe=new d,AMe=new d,CMe=new sn(d.UNIT_X,0);zi.fromRectangle=function(e,t,n,i,o){if(!c(e))throw new E("rectangle is required");if(e.width<0||e.width>O.TWO_PI)throw new E("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>O.PI)throw new E("Rectangle height must be between 0 and pi");if(c(i)&&!O.equalsEpsilon(i.radii.x,i.radii.y,O.EPSILON15))throw new E("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=t??0,n=n??0,i=i??ie.default;let r,s,a,l,u,f,h;if(e.width<=O.PI){let M=ce.center(e,die),R=i.cartographicToCartesian(M,tMe),L=new ns(R,i);h=L.plane;let F=M.longitude,_=e.south<0&&e.north>0?0:M.latitude,w=he.fromRadians(F,e.north,n,nMe),D=he.fromRadians(e.west,e.north,n,iMe),I=he.fromRadians(e.west,_,n,oMe),N=he.fromRadians(e.west,e.south,n,rMe),k=he.fromRadians(F,e.south,n,sMe),z=i.cartographicToCartesian(w,aMe),V=i.cartographicToCartesian(D,hie),j=i.cartographicToCartesian(I,cMe),U=i.cartographicToCartesian(N,mie),q=i.cartographicToCartesian(k,lMe),Y=L.projectPointToNearestOnPlane(z,uMe),te=L.projectPointToNearestOnPlane(V,fMe),K=L.projectPointToNearestOnPlane(j,dMe),Z=L.projectPointToNearestOnPlane(U,hMe),ee=L.projectPointToNearestOnPlane(q,mMe);return r=Math.min(te.x,K.x,Z.x),s=-r,l=Math.max(te.y,Y.y),a=Math.min(Z.y,ee.y),D.height=N.height=t,V=i.cartographicToCartesian(D,hie),U=i.cartographicToCartesian(N,mie),u=Math.min(sn.getPointDistance(h,V),sn.getPointDistance(h,U)),f=n,fie(L.origin,L.xAxis,L.yAxis,L.zAxis,r,s,a,l,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ce.center(e,die).longitude,b=d.fromRadians(y,m,n,i,pMe);b.z=0;let A=Math.abs(b.x)<O.EPSILON10&&Math.abs(b.y)<O.EPSILON10?d.UNIT_X:d.normalize(b,_Me),C=d.UNIT_Z,S=d.cross(A,C,gMe);h=sn.fromPointNormal(b,A,CMe);let v=d.fromRadians(y+O.PI_OVER_TWO,m,n,i,yMe);s=d.dot(sn.projectPointOntoPlane(h,v,bMe),S),r=-s,l=d.fromRadians(0,e.north,g?t:n,i,xMe).z,a=d.fromRadians(0,e.south,p?t:n,i,TMe).z;let P=d.fromRadians(e.east,m,n,i,AMe);return u=sn.getPointDistance(h,P),f=0,fie(b,S,C,A,r,s,a,l,u,f,o)};zi.fromTransformation=function(e,t){return T.typeOf.object("transformation",e),c(t)||(t=new zi),t.center=B.getTranslation(e,t.center),t.halfAxes=B.getMatrix3(e,t.halfAxes),t.halfAxes=J.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};zi.clone=function(e,t){if(c(e))return c(t)?(d.clone(e.center,t.center),J.clone(e.halfAxes,t.halfAxes),t):new zi(e.center,e.halfAxes)};zi.intersectPlane=function(e,t){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("plane is required.");let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,l=Math.abs(r*o[J.COLUMN0ROW0]+s*o[J.COLUMN0ROW1]+a*o[J.COLUMN0ROW2])+Math.abs(r*o[J.COLUMN1ROW0]+s*o[J.COLUMN1ROW1]+a*o[J.COLUMN1ROW2])+Math.abs(r*o[J.COLUMN2ROW0]+s*o[J.COLUMN2ROW1]+a*o[J.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-l?Wt.OUTSIDE:u>=l?Wt.INSIDE:Wt.INTERSECTING};var gie=new d,yie=new d,bie=new d,EMe=new d,pie=new d,SMe=new d;zi.distanceSquaredTo=function(e,t){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("cartesian is required.");let n=d.subtract(t,e.center,_ie),i=e.halfAxes,o=J.getColumn(i,0,gie),r=J.getColumn(i,1,yie),s=J.getColumn(i,2,bie),a=d.magnitude(o),l=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,p=!0;a>0?d.divideByScalar(o,a,o):f=!1,l>0?d.divideByScalar(r,l,r):h=!1,u>0?d.divideByScalar(s,u,s):p=!1;let g=!f+!h+!p,m,y,b;if(g===1){let S=o;m=r,y=s,h?p||(S=s,y=o):(S=r,m=o),b=d.cross(m,y,pie),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(g===2){m=o,h?m=r:p&&(m=s);let S=d.UNIT_Y;S.equalsEpsilon(m,O.EPSILON3)&&(S=d.UNIT_X),y=d.cross(m,S,EMe),d.normalize(y,y),b=d.cross(m,y,pie),d.normalize(b,b),m===o?(r=y,s=b):m===r?(s=y,o=b):m===s&&(o=y,r=b)}else g===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let x=SMe;x.x=d.dot(n,o),x.y=d.dot(n,r),x.z=d.dot(n,s);let A=0,C;return x.x<-a?(C=x.x+a,A+=C*C):x.x>a&&(C=x.x-a,A+=C*C),x.y<-l?(C=x.y+l,A+=C*C):x.y>l&&(C=x.y-l,A+=C*C),x.z<-u?(C=x.z+u,A+=C*C):x.z>u&&(C=x.z-u,A+=C*C),A};var wMe=new d,vMe=new d;zi.computePlaneDistances=function(e,t,n,i){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("position is required.");if(!c(n))throw new E("direction is required.");c(i)||(i=new Ma);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,l=J.getColumn(a,0,gie),u=J.getColumn(a,1,yie),f=J.getColumn(a,2,bie),h=d.add(l,u,wMe);d.add(h,f,h),d.add(h,s,h);let p=d.subtract(h,t,vMe),g=d.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var DMe=new d,PMe=new d,IMe=new d;zi.computeCorners=function(e,t){T.typeOf.object("box",e),c(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=J.getColumn(i,0,DMe),r=J.getColumn(i,1,PMe),s=J.getColumn(i,2,IMe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],s,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],s,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],s,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],s,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],s,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],s,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],s,t[7]),t};var OMe=new J;zi.computeTransformation=function(e,t){T.typeOf.object("box",e),c(t)||(t=new B);let n=e.center,i=J.multiplyByUniformScale(e.halfAxes,2,OMe);return B.fromRotationTranslation(i,n,t)};var RMe=new le;zi.isOccluded=function(e,t){if(!c(e))throw new E("box is required.");if(!c(t))throw new E("occluder is required.");let n=le.fromOrientedBoundingBox(e,RMe);return!t.isBoundingSphereVisible(n)};zi.prototype.intersectPlane=function(e){return zi.intersectPlane(this,e)};zi.prototype.distanceSquaredTo=function(e){return zi.distanceSquaredTo(this,e)};zi.prototype.computePlaneDistances=function(e,t,n){return zi.computePlaneDistances(this,e,t,n)};zi.prototype.computeCorners=function(e){return zi.computeCorners(this,e)};zi.prototype.computeTransformation=function(e){return zi.computeTransformation(this,e)};zi.prototype.isOccluded=function(e){return zi.isOccluded(this,e)};zi.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&J.equals(e.halfAxes,t.halfAxes)};zi.prototype.clone=function(e){return zi.clone(this,e)};zi.prototype.equals=function(e){return zi.equals(this,e)};var Dn=zi;var IV={};IV.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new E("scale must be a finite number.");if(!Number.isFinite(n))throw new E("relativeHeight must be a finite number.");return(e-n)*t+n};var MMe=new he;IV.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,MMe);if(!c(r))return d.clone(e,o);let s=IV.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Dr=IV;var uO=`in vec3 position3DHigh; +`;function Yg(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?DL:PL,o=i?_T:IL,s=i?Yg.FLAT_VERTEX_FORMAT:Yg.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Dr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Yg.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}}});Yg.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;Yg.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;Yg.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;Yg.prototype.isTranslucent=Dr.prototype.isTranslucent;Yg.prototype.getRenderState=Dr.prototype.getRenderState;var yn=Yg;function zS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(zS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});zS.prototype.getType=function(e){return"Color"};var Vtt=new K;zS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Vtt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};zS.prototype.equals=function(e){return this===e||e instanceof zS&&X.equals(this._color,e._color)};var Kt=zS;var RL=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; #ifdef EXTRUDED_GEOMETRY @@ -2465,7 +3755,7 @@ v_color = czm_batchTable_color(batchId); #endif gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } -`;var Jg=`#ifdef VECTOR_TILE +`;var PA=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif void main(void) @@ -2477,7 +3767,7 @@ out_FragColor = vec4(1.0); #endif czm_writeDepthClamp(); } -`;var xie={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};xie.NUMBER_OF_CLASSIFICATION_TYPES=3;var Un=Object.freeze(xie);var LMe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},dc=Object.freeze(LMe);function NMe(e,t){if(!c(e))throw new E("array is required.");if(!c(t)||t<1)throw new E("numberOfArrays must be greater than 0.");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 fO=NMe;function Np(e,t,n){if(!c(e))throw new E("context is required");if(!c(t))throw new E("attributes is required");if(!c(n))throw new E("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=FMe(t),o=e.floatingPointTexture,r=i===Ue.FLOAT&&!o,s=BMe(t,r),a=kMe(s,t,r),l=Math.floor(ut.maximumTextureSize/a),u=Math.min(n,l),f=a*u,h=Math.ceil(n/u),p=1/f,g=p*.5,m=1/h,y=m*.5;this._textureDimensions=new H(f,h),this._textureStep=new se(p,g,m,y),this._pixelDatatype=r?Ue.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*h;this._batchValues=i===Ue.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(Np.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function FMe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==$.UNSIGNED_BYTE){t=!0;break}return t?Ue.FLOAT:Ue.UNSIGNED_BYTE}function Aie(e,t){let n=e[t].componentsPerAttribute;return n===2?H:n===3?d:n===4?se:Number}function BMe(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!==$.UNSIGNED_BYTE&&t?i+=4:++i}return n}function kMe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==$.UNSIGNED_BYTE&&n?o+4:o+1}var dO=new se;function UMe(e,t,n){let i=se.unpack(e,t,dO),o=se.unpackFloat(i);i=se.unpack(e,t+4,dO);let r=se.unpackFloat(i);i=se.unpack(e,t+8,dO);let s=se.unpackFloat(i);i=se.unpack(e,t+12,dO);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function VMe(e,t,n){let i=se.packFloat(e.x,dO);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 Tie=new se;Np.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new E("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new E("attributeIndex is out of range");let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?a=UMe(this._batchValues,s,Tie):a=se.unpack(this._batchValues,s,Tie);let l=Aie(i,t);return c(l.fromCartesian4)?l.fromCartesian4(a,n):c(l.clone)?l.clone(a,n):a.x};var zMe=[void 0,void 0,new H,new d,new se],HMe=new se;Np.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new E("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new E("attributeIndex is out of range");if(!c(n))throw new E("value is required.");let i=this._attributes,o=zMe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Aie(this._attributes,t);if(c(s.equals)?s.equals(r,n):r===n)return;let l=HMe;l.x=c(n.x)?n.x:n,l.y=c(n.y)?n.y:0,l.z=c(n.z)?n.z:0,l.w=c(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?VMe(l,this._batchValues,h):se.pack(l,this._batchValues,h),this._batchValuesDirty=!0};function GMe(e,t){let n=e._textureDimensions;e._texture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Qt.NEAREST,flipY:!1})}function jMe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Np.prototype.update=function(e){c(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,c(this._texture)||GMe(this,e.context),jMe(this))};Np.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function WMe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +`;var dQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};dQ.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(dQ);var ti=dQ;var dbe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(dbe);var hc=dbe;function Xg(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=jtt(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=Htt(t,o),a=Gtt(s,t,o),c=Math.floor(kt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new U(f,d),this._textureStep=new se(p,g,m,y),this._pixelDatatype=o?ze.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let A=4*f*d;this._batchValues=i===ze.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(Xg.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function jtt(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ze.FLOAT:ze.UNSIGNED_BYTE}function mbe(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function Htt(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function Gtt(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var OL=new se;function Wtt(e,t,n){let i=se.unpack(e,t,OL),r=se.unpackFloat(i);i=se.unpack(e,t+4,OL);let o=se.unpackFloat(i);i=se.unpack(e,t+8,OL);let s=se.unpackFloat(i);i=se.unpack(e,t+12,OL);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function qtt(e,t,n){let i=se.packFloat(e.x,OL);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 hbe=new se;Xg.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?a=Wtt(this._batchValues,s,hbe):a=se.unpack(this._batchValues,s,hbe);let c=mbe(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var Ytt=[void 0,void 0,new U,new h,new se],Xtt=new se;Xg.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=Ytt[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=mbe(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=Xtt;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 u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?qtt(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function Ktt(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:jt.NEAREST,flipY:!1})}function $tt(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Xg.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||Ktt(this,e.context),$tt(this))};Xg.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Ot(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function Jtt(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; vec2 computeSt(float batchId) { float stepX = batchTextureStep.x; @@ -2498,41 +3788,41 @@ vec2 computeSt(float batchId) float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); } -`}function qMe(e){return e===1?"float":`vec${e}`}function YMe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function XMe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=qMe(o),a=YMe(o),l=e._offsets[t],u=`${s} ${r}(float batchId) +`}function Ztt(e){return e===1?"float":`vec${e}`}function Qtt(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function ent(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=Ztt(r),a=Qtt(r),c=e._offsets[t],u=`${s} ${o}(float batchId) { vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${l}); -`;return e._packFloats&&i.componentDatatype!==Ue.UNSIGNED_BYTE?u+=`vec4 textureValue; + st.x += batchTextureStep.x * float(${c}); +`;return e._packFloats&&i.componentDatatype!==ze.UNSIGNED_BYTE?u+=`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))); `:u+=` vec4 textureValue = texture(batchTexture, st); `,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===Ue.UNSIGNED_BYTE&&i.componentDatatype===$.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===Ue.FLOAT&&i.componentDatatype===$.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; +`,e._pixelDatatype===ze.UNSIGNED_BYTE&&i.componentDatatype===Y.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; +`:e._pixelDatatype===ze.FLOAT&&i.componentDatatype===Y.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; `),u+=` return value; } -`,u}Np.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${WMe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=XMe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} +`,u}Xg.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${Jtt(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=ent(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} ${t} -${s}`}};Np.prototype.isDestroyed=function(){return!1};Np.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),de(this)};var Rb=Np;function Ll(e){this._ellipsoid=e??ie.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Ll.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Ll.mercatorAngleToGeodeticLatitude=function(e){return O.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Ll.geodeticLatitudeToMercatorAngle=function(e){e>Ll.MaximumLatitude?e=Ll.MaximumLatitude:e<-Ll.MaximumLatitude&&(e=-Ll.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Ll.MaximumLatitude=Ll.mercatorAngleToGeodeticLatitude(Math.PI);Ll.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Ll.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};Ll.prototype.unproject=function(e,t){if(!c(e))throw new E("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=Ll.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Mi=Ll;function KMe(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(!B.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)c(e[r].geometry)&&Nn.transformToWorldCoordinates(e[r]);else B.multiplyTransformation(t,e[0].modelMatrix,t)}function g6(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function $Me(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];c(i.geometry)?g6(i.geometry,n):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&(g6(i.westHemisphereGeometry,n),g6(i.eastHemisphereGeometry,n))}}function ZMe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,l,u,f,h=t.length;for(l=0;l<h;++l)if(c(t[l].geometry)){f=t[l].geometry.primitiveType;break}for(l=1;l<h;++l)if(c(t[l].geometry)&&t[l].geometry.primitiveType!==f)throw new E("All instance geometries must have the same primitiveType.");if(KMe(t,a,o),!o)for(l=0;l<h;++l)c(t[l].geometry)&&Nn.splitLongitude(t[l]);if($Me(t),r)for(l=0;l<h;++l){let g=t[l];c(g.geometry)?(Nn.reorderForPostVertexCache(g.geometry),Nn.reorderForPreVertexCache(g.geometry)):c(g.westHemisphereGeometry)&&c(g.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(g.westHemisphereGeometry),Nn.reorderForPreVertexCache(g.westHemisphereGeometry),Nn.reorderForPostVertexCache(g.eastHemisphereGeometry),Nn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(h=p.length,l=0;l<h;++l){u=p[l];let g=u.attributes;if(o)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===$.DOUBLE&&Nn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===$.DOUBLE){let y=`${m}3D`,b=`${m}2D`;Nn.projectTo2D(u,m,y,b,n),c(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),Nn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Nn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Nn.compressVertices(u)}if(!i){let g=[];for(h=p.length,l=0;l<h;++l)u=p[l],g=g.concat(Nn.fitToUnsignedShortIndices(u));p=g}return p}function y6(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let l=e.length;for(let u=0;u<l;++u){let h=e[u][t];if(!c(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 QMe(e,t){let n=[];return y6(e,"geometry",t,n),y6(e,"westHemisphereGeometry",t,n),y6(e,"eastHemisphereGeometry",t,n),n}var Fp={};Fp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=ZMe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=QMe(i,t))),c(i[0].attributes)&&c(i[0].attributes.offset)&&(s=new Array(o),a=!0));let l=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;c(p)&&(l[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;c(g)&&c(m)&&(c(g.boundingSphere)&&c(m.boundingSphere)&&(l[f]=le.union(g.boundingSphere,m.boundingSphere)),c(g.boundingSphereCV)&&c(m.boundingSphereCV)&&(u[f]=le.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:l,boundingSpheresCV:u}};function JMe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];c(o)&&c(o.values)&&t.push(o.values.buffer)}c(e.indices)&&t.push(e.indices.buffer)}function eLe(e,t){let n=e.length;for(let i=0;i<n;++i)JMe(e[i],t)}function tLe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!c(o))continue;let r=o.attributes;t+=7+2*le.packedLength+(c(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&c(r[s])){let a=r[s];t+=5+a.values.length}}return t}Fp.packCreateGeometryResults=function(e,t){let n=new Float64Array(tLe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let l=e[a],u=c(l);if(n[s++]=u?1:0,!u)continue;n[s++]=l.primitiveType,n[s++]=l.geometryType,n[s++]=l.offsetAttribute??-1;let f=c(l.boundingSphere)?1:0;n[s++]=f,f&&le.pack(l.boundingSphere,n,s),s+=le.packedLength;let h=c(l.boundingSphereCV)?1:0;n[s++]=h,h&&le.pack(l.boundingSphereCV,n,s),s+=le.packedLength;let p=l.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&c(p[y])&&(g.push(y),c(o[y])||(o[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let b=g[y],x=p[b];n[s++]=o[b],n[s++]=x.componentDatatype,n[s++]=x.componentsPerAttribute,n[s++]=x.normalize?1:0,n[s++]=x.values.length,n.set(x.values,s),s+=x.values.length}let m=c(l.indices)?l.indices.length:0;n[s++]=m,m>0&&(n.set(l.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Fp.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 l=n[s++],u=n[s++],f=n[s++];f===-1&&(f=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 y,b,x,A=new fn,C=n[s++];for(i=0;i<C;i++){let v=t[n[s++]],P=n[s++];x=n[s++];let M=n[s++]!==0;y=n[s++],b=$.createTypedArray(P,y);for(let R=0;R<y;R++)b[R]=n[s++];A[v]=new ve({componentDatatype:P,componentsPerAttribute:x,normalize:M,values:b})}let S;if(y=n[s++],y>0){let v=b.length/x;for(S=Fe.createTypedArray(v,y),i=0;i<y;i++)S[i]=n[s++]}o[r++]=new ct({primitiveType:l,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:S,attributes:A,offsetAttribute:f})}return o};function nLe(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(B.pack(s.modelMatrix,i,o),o+=B.packedLength,c(s.attributes)&&c(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 iLe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=B.unpack(t,o),s;o+=B.packedLength,c(t[o])&&(s={offset:new eo(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Fp.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:nLe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Oi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Fp.unpackCombineGeometryParameters=function(e){let t=iLe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let l=Fp.unpackCreateGeometryResults(n[a]),u=l.length;for(let f=0;f<u;f++){let h=l[f],p=t[o];p.geometry=h,++o}}let r=ie.clone(e.ellipsoid),s=e.isGeographic?new Oi(r):new Mi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:B.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Cie(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];c(s)?(i[o++]=1,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function Eie(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}Fp.packCombineGeometryResults=function(e,t){c(e.geometries)&&eLe(e.geometries,t);let n=Cie(e.boundingSpheres),i=Cie(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}};Fp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Eie(e.boundingSpheres),boundingSpheresCV:Eie(e.boundingSpheresCV)}};var Mb=Fp;var oLe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Pr=Object.freeze(oLe);var yu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};yu.NUMBER_OF_SHADOW_MODES=4;yu.castShadows=function(e){return e===yu.ENABLED||e===yu.CAST_ONLY};yu.receiveShadows=function(e){return e===yu.ENABLED||e===yu.RECEIVE_ONLY};yu.fromCastReceive=function(e,t){return e&&t?yu.ENABLED:e?yu.CAST_ONLY:t?yu.RECEIVE_ONLY:yu.DISABLED};var xn=Object.freeze(yu);function Ir(e){if(e=e??W.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=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=new B,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,c(this.rtcCenter)&&(!c(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new E("Relative-to-center rendering only supports one geometry instance.");this.shadows=e.shadows??xn.DISABLED,this._translucent=void 0,this._state=Pr.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(Ir.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 rLe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&c(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let l=e[a].attributes[o];if(!c(l)||r.componentDatatype!==l.componentDatatype||r.componentsPerAttribute!==l.componentsPerAttribute||r.normalize!==l.normalize){s=!1;break}}s&&n.push(o)}return n}var sLe=new H,aLe=new d,Mie=new se;function Lie(e){let t=e.length;if(t===1)return e[0];if(t===2)return H.unpack(e,0,sLe);if(t===3)return d.unpack(e,0,aLe);if(t===4)return se.unpack(e,0,Mie)}function cLe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=rLe(i),s=r.length,a=[],l={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=r[g],y=p[m],l[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:$.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:$.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,x=new Rb(t,a,o);for(g=0;g<o;++g){let A=i[g];p=A.attributes;for(let M=0;M<s;++M){m=r[M],y=p[m];let R=Lie(y.value),L=l[m];x.setBatchedAttribute(g,L,R)}let C={primitive:A.pickPrimitive??e};c(A.id)&&(C.id=A.id);let S=t.createPickId(C);e._pickIds.push(S);let v=S.color,P=Mie;P.x=G.floatToByte(v.red),P.y=G.floatToByte(v.green),P.z=G.floatToByte(v.blue),P.w=G.floatToByte(v.alpha),x.setBatchedAttribute(g,b-1,P)}e._batchTable=x,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function lLe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function uLe(e){let t=e.attributes,n=new fn;for(let o in t)t.hasOwnProperty(o)&&c(t[o])&&(n[o]=lLe(t[o]));let i;if(c(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ct({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function fLe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:B.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var dLe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Ir._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=dLe.exec(t))!==null;){let a=i[1],l=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;l!=="vec4 czm_computePosition()"&&(o+=`${l}; -`),c(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+=`${l} +${s}`}};Xg.prototype.isDestroyed=function(){return!1};Xg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var yT=Xg;function tnt(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!N.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Hn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function hQ(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function nnt(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?hQ(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(hQ(i.westHemisphereGeometry,n),hQ(i.eastHemisphereGeometry,n))}}function int(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(tnt(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Hn.splitLongitude(t[c]);if(nnt(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Hn.reorderForPostVertexCache(g.geometry),Hn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Hn.reorderForPostVertexCache(g.westHemisphereGeometry),Hn.reorderForPreVertexCache(g.westHemisphereGeometry),Hn.reorderForPostVertexCache(g.eastHemisphereGeometry),Hn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Hn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Hn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Hn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ce.fromVertices(u.attributes.position2D.values)),Hn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Hn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Hn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Hn.fitToUnsignedShortIndices(u));p=g}return p}function mQ(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function rnt(e,t){let n=[];return mQ(e,"geometry",t,n),mQ(e,"westHemisphereGeometry",t,n),mQ(e,"eastHemisphereGeometry",t,n),n}var Kg={};Kg.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=int(e),t.length>0&&(n=Hn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=rnt(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ce.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ce.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function ont(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function snt(e,t){let n=e.length;for(let i=0;i<n;++i)ont(e[i],t)}function ant(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ce.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}Kg.packCreateGeometryResults=function(e,t){let n=new Float64Array(ant(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ce.pack(c.boundingSphere,n,s),s+=ce.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ce.pack(c.boundingSphereCV,n,s),s+=ce.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[s++]=r[A],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Kg.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ce.unpack(n,s)),s+=ce.packedLength,n[s++]===1&&(p=ce.unpack(n,s)),s+=ce.packedLength;let y,A,b,x=new Tn,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],S=n[s++];b=n[s++];let I=n[s++]!==0;y=n[s++],A=Y.createTypedArray(S,y);for(let R=0;R<y;R++)A[R]=n[s++];x[v]=new Ne({componentDatatype:S,componentsPerAttribute:b,normalize:I,values:A})}let E;if(y=n[s++],y>0){let v=A.length/b;for(E=je.createTypedArray(v,y),i=0;i<y;i++)E[i]=n[s++]}r[o++]=new St({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function cnt(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(N.pack(s.modelMatrix,i,r),r+=N.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function lnt(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=N.unpack(t,r),s;r+=N.packedLength,l(t[r])&&(s={offset:new Tr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}Kg.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:cnt(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ui,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Kg.unpackCombineGeometryParameters=function(e){let t=lnt(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=Kg.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=ee.clone(e.ellipsoid),s=e.isGeographic?new Ui(o):new gi(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function pbe(e){let t=e.length,n=1+(ce.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ce.pack(e[o],i,r)):i[r++]=0,r+=ce.packedLength}return i}function gbe(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ce.unpack(e,i)),++n,i+=ce.packedLength;return t}Kg.packCombineGeometryResults=function(e,t){l(e.geometries)&&snt(e.geometries,t);let n=pbe(e.boundingSpheres),i=pbe(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}};Kg.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:gbe(e.boundingSpheres),boundingSpheresCV:gbe(e.boundingSpheresCV)}};var AT=Kg;var _be={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(_be);var ss=_be;var Wu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Wu.NUMBER_OF_SHADOW_MODES=4;Wu.castShadows=function(e){return e===Wu.ENABLED||e===Wu.CAST_ONLY};Wu.receiveShadows=function(e){return e===Wu.ENABLED||e===Wu.RECEIVE_ONLY};Wu.fromCastReceive=function(e,t){return e&&t?Wu.ENABLED:e?Wu.CAST_ONLY:t?Wu.RECEIVE_ONLY:Wu.DISABLED};Object.freeze(Wu);var Dn=Wu;function as(e){e=e??H.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=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Dn.DISABLED,this._translucent=void 0,this._state=ss.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(as.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 unt(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var fnt=new U,dnt=new h,Sbe=new se;function wbe(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,fnt);if(t===3)return h.unpack(e,0,dnt);if(t===4)return se.unpack(e,0,Sbe)}function hnt(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=unt(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=o[g],y=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=a.length,b=new yT(t,a,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let I=0;I<s;++I){m=o[I],y=p[m];let R=wbe(y.value),O=c[m];b.setBatchedAttribute(g,O,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let E=t.createPickId(T);e._pickIds.push(E);let v=E.color,S=Sbe;S.x=z.floatToByte(v.red),S.y=z.floatToByte(v.green),S.z=z.floatToByte(v.blue),S.w=z.floatToByte(v.alpha),b.setBatchedAttribute(g,A-1,S)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function mnt(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ne({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function pnt(e){let t=e.attributes,n=new Tn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=mnt(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new St({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ce.clone(e.boundingSphere)})}function gnt(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var _nt=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;as._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=_nt.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${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,""),r+=`uniform mat4 u_modifiedModelView; +`,o+=`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+=`${l} +`,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; +`:(o+=`in vec3 ${a}2DHigh; in vec3 ${a}2DLow; -`,s+=`${l} +`,s+=`${c} { vec4 p; if (czm_morphTime == 1.0) @@ -2553,36 +3843,36 @@ in vec3 ${a}2DLow; return p; } -`)}return[o,r,t,s].join(` -`)};Ir._appendShowToShader=function(e,t){return c(e._batchTableAttributeIndices.show)?`${He.replaceMain(t,"czm_non_show_main")} +`)}return[r,o,t,s].join(` +`)};as._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Ye.replaceMain(t,"czm_non_show_main")} void main() { czm_non_show_main(); gl_Position *= czm_batchTable_show(batchId); -}`:t};Ir._updateColorAttribute=function(e,t,n){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;if(n&&!c(e._batchTableAttributeIndices.depthFailColor))throw new E("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");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 Sie(e){return`${He.replaceMain(e,"czm_non_pick_main")} +}`:t};as._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 ybe(e){return`${Ye.replaceMain(e,"czm_non_pick_main")} out vec4 v_pickColor; void main() { czm_non_pick_main(); v_pickColor = czm_batchTable_pickColor(batchId); -}`}function wie(e){return`in vec4 v_pickColor; -${e}`}Ir._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};Ir._appendOffsetToShader=function(e,t){if(!c(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};Ir._appendDistanceDisplayConditionToShader=function(e,t,n){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=He.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() +}`}function Abe(e){return`in vec4 v_pickColor; +${e}`}as._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};as._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),r=`vec4 $1 = czm_computePosition(); +`;return r+=` if (czm_sceneMode == czm_sceneMode3D) +`,r+=` { +`,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` } +`,r+=` else +`,r+=` { +`,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` } +`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};as._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Ye.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`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); +`;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); +`:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); vec4 centerRTE; if (czm_morphTime == 1.0) @@ -2600,7 +3890,7 @@ ${e}`}Ir._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), czm_morphTime); } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; +`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; float distanceSq; if (czm_sceneMode == czm_sceneMode2D) { @@ -2616,26 +3906,26 @@ ${e}`}Ir._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} -${o}`};function vie(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",l="compressedAttributes",u=`in ${a} ${l};`,f="",h="";if(i){f+=`vec2 st; -`;let m=s>1?`${l}.x`:l;h+=` st = czm_decompressTextureCoordinates(${m}); -`}n&&o&&r?(f+=`vec3 normal; +${r}`};function bbe(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 r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); +`}n&&r&&o?(f+=`vec3 normal; vec3 tangent; vec3 bitangent; -`,h+=` czm_octDecode(${l}.${i?"yz":"xy"}, normal, tangent, bitangent); +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); `):(n&&(f+=`vec3 normal; -`,h+=` normal = czm_octDecode(${l}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(f+=`vec3 tangent; -`,h+=` tangent = czm_octDecode(${l}.${i&&n?"z":"y"}); -`),r&&(f+=`vec3 bitangent; -`,h+=` bitangent = czm_octDecode(${l}.${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=He.replaceMain(p,"czm_non_compressed_main");let g=`void main() +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),r&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),o&&(f+=`vec3 bitangent; +`,d+=` 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=Ye.replaceMain(p,"czm_non_compressed_main");let g=`void main() { -${h} czm_non_compressed_main(); +${d} czm_non_compressed_main(); }`;return[u,f,p,g].join(` -`)}function hLe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`)}function ynt(e){let t=Ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} -`,t}function mLe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`,t}function Ant(e){let t=Ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); @@ -2643,7 +3933,7 @@ ${h} czm_non_compressed_main(); czm_writeDepthClamp(); #endif } -`,t}function Die(e,t){let n=e.vertexAttributes;for(let i in n)if(n.hasOwnProperty(i)&&!c(t[i]))throw new E(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function pLe(e,t){return function(){return e[t]}}var b6=Math.max(Vt.hardwareConcurrency-1,1),OV,_Le=new yi("combineGeometry");function gLe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Pr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,l=[],u=[];for(o=0;o<a;++o){if(i=n[o].geometry,s.push(n[o].id),c(i._workerName)&&c(i._workerPath)||!c(i._workerName)&&!c(i._workerPath))throw new E("Must define either _workerName or _workerPath for asynchronous geometry.");u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!c(OV))for(OV=new Array(b6),o=0;o<b6;o++)OV[o]=new yi("createGeometry");let f;for(u=fO(u,b6),o=0;o<u.length;o++){let h=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,c(i.constructor.pack)&&(f.offset=h,h+=i.constructor.packedLength??i.packedLength);let m;if(h>0){let y=new Float64Array(h);for(m=[y.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}l.push(OV[o].scheduleTask({subTasks:u[o]},m))}e._state=Pr.CREATING,Promise.all(l).then(function(h){e._createGeometryResults=h,e._state=Pr.CREATED}).catch(function(h){mO(e,t,Pr.FAILED,h)})}else if(e._state===Pr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let l=t.scene3DOnly,u=t.mapProjection,f=_Le.scheduleTask(Mb.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Pr.COMBINING,Promise.resolve(f).then(function(h){let p=Mb.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=B.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Pr.COMBINED):mO(e,t,Pr.FAILED,void 0)}).catch(function(h){mO(e,t,Pr.FAILED,h)})}}function yLe(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,l=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;c(p.attributes)&&c(p.primitiveType)?g=uLe(p):g=p.constructor.createGeometry(p),o[l++]=fLe(s,g),r.push(s.id)}o.length=l;let u=t.scene3DOnly,f=t.mapProjection,h=Mb.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=B.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Pr.COMBINED):mO(e,t,Pr.FAILED,void 0)}function bLe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!c(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!c(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 y=a[i],b=e._batchTable.getBatchedAttribute(i,n,new d);y=r[i].clone(y),kie(y,b,o[i])}let l=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||le.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING?l.push(y):(u.push(y),f.push(y))}let h=l[0],p=f[0],g=u[0];for(i=1;i<l.length;i++)h=le.union(h,l[i]);for(i=1;i<f.length;i++)p=le.union(p,f[i]);for(i=1;i<u.length;i++)g=le.union(g,u[i]);let m=[];for(c(h)&&m.push(h),c(p)&&m.push(p),c(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=le.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Ir._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Pie=new Hn,Nie=new he,Fie=new d,Bie=new le;function xLe(e,t){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,l=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!c(y))continue;let b=e.modelMatrix;c(b)&&(y=le.transform(y,b,Bie));let x=y.center,A=y.radius,C=Hn.fromCartesian(x,Pie);if(h.setBatchedAttribute(m,o,C.high),h.setBatchedAttribute(m,r,C.low),!t.scene3DOnly){let S=f.cartesianToCartographic(x,Nie),v=u.project(S,Fie);C=Hn.fromCartesian(v,Pie),h.setBatchedAttribute(m,s,C.high),h.setBatchedAttribute(m,a,C.low)}h.setBatchedAttribute(m,l,A)}e._batchTableBoundingSpheresUpdated=!0}var x6=new d,TLe=new d;function Iie(e,t){if(!c(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,l=a.length;for(let u=0;u<l;++u){let f=a[u];if(!c(f))continue;let h=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){s.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;c(p)&&(f=le.transform(f,p,Bie));let g=f.center;g=r.scaleToGeodeticSurface(g,TLe);let m=r.cartesianToCartographic(g,Nie),y=o.project(m,Fie),b=d.add(h,g,x6);m=r.cartesianToCartographic(b,m);let x=o.project(m,x6),A=d.subtract(x,y,x6),C=A.x;A.x=A.z,A.z=A.y,A.y=C,s.setBatchedAttribute(u,i,A)}e._batchTableOffsetsUpdated=!0}function ALe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let l=0;l<a;++l){let u=i[l];if(s.push(ti.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Be.STATIC_DRAW,interleave:e._interleave})),c(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,g=f.z;f.x=g,f.y=h,f.z=p,e._boundingSphereCV.push(le.clone(u.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,mO(e,t,Pr.COMPLETE,void 0)}function CLe(e,t,n,i){let o=n.getRenderState(),r;i?(r=je(o,!1),r.cull={enabled:!0,face:xi.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=xi.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=je(o,!1),c(e._depthFailAppearance)&&(r.depthTest.enabled=!1),c(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=je(o,!1),r.depthTest.func=dc.GREATER,i?(r.cull={enabled:!0,face:xi.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=xi.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function ELe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Ir._appendOffsetToShader(e,r),r=Ir._appendShowToShader(e,r),r=Ir._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Sie(r),r=Ir._updateColorAttribute(e,r,!1),r=vie(e,r),r=Ir._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=wie(s),e._sp=Jt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Die(e._sp,o),c(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Ir._appendShowToShader(e,r),r=Ir._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Sie(r),r=Ir._updateColorAttribute(e,r,!0),r=vie(e,r),r=Ir._modifyShaderPosition(e,r,t.scene3DOnly),r=hLe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=wie(s),s=mLe(s),e._spDepthFail=Jt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Die(e._spDepthFail,o))}var hO=new B,Oie=new d;function Rie(e,t,n,i){let o=c(n)?n._uniforms:void 0,r={},s=t.uniforms;if(c(s)){for(let l in s)if(s.hasOwnProperty(l)){if(c(o)&&c(o[l]))throw new E(`Appearance and material have a uniform with the same name: ${l}`);r[l]=pLe(s,l)}}let a=xt(r,o);return a=e._batchTable.getUniformMapCallback()(a),c(e.rtcCenter)&&(a.u_modifiedModelView=function(){let l=i.context.uniformState.view;return B.multiply(l,e._modelMatrix,hO),B.multiplyByPoint(hO,e.rtcCenter,Oie),B.setTranslation(hO,Oie,hO),hO}),a}function SLe(e,t,n,i,o,r,s,a){let l=Rie(e,t,n,a),u;c(e._depthFailAppearance)&&(u=Rie(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?De.TRANSLUCENT:De.OPAQUE,h=o?2:1;h*=c(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,g=0;for(let m=0;m<p;++m){let y;o&&(y=r[m],c(y)||(y=r[m]=new Qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=l,y.pass=f,++m),y=r[m],c(y)||(y=r[m]=new Qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=l,y.pass=f,c(e._depthFailAppearance)&&(o&&(++m,y=r[m],c(y)||(y=r[m]=new Qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=r[m],c(y)||(y=r[m]=new Qe({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}Ir._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!B.equals(n,e._modelMatrix))for(B.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],c(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(c(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let l=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;l.radius=s.radius+f}};function wLe(e,t,n,i,o,r,s,a){if(t.mode!==oe.SCENE3D&&!B.equals(o,B.IDENTITY))throw new E("Primitive.modelMatrix is only supported in 3D mode.");Ir._updateBoundingVolumes(e,t,o);let l;t.mode===oe.SCENE3D?l=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===oe.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=xn.castShadows(e.shadows),g=xn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=c(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let x=Math.floor(b/y),A=n[b];A.modelMatrix=o,A.boundingVolume=l[x],A.cull=r,A.debugShowBoundingVolume=s,A.castShadows=p,A.receiveShadows=g,h?A.pickId="v_pickColor":A.pickId=void 0,u.push(A)}}}Ir.prototype.update=function(e){if(!c(this.geometryInstances)&&this._va.length===0||c(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!c(this.appearance)||e.mode!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(c(this._error))throw this._error;if(c(this.rtcCenter)&&!e.scene3DOnly)throw new E("RTC rendering is only available for 3D only scenes.");if(this._state===Pr.FAILED)return;let t=e.context;if(c(this._batchTable)||cLe(this,t),this._batchTable.attributes.length>0){if(ut.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!==Pr.COMPLETE&&this._state!==Pr.COMBINED&&(this.asynchronous?gLe(this,e):yLe(this,e)),this._state===Pr.COMBINED&&(xLe(this,e),Iie(this,e),ALe(this,e)),!this.show||this._state!==Pr.COMPLETE)return;this._batchTableOffsetsUpdated||Iie(this,e),this._recomputeBoundingSpheres&&bLe(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=c(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 l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),c(this._material)&&this._material.update(t);let u=n.closed&&l;o&&(this._createRenderStatesFunction??CLe)(this,t,n,u),r&&(this._createShaderProgramFunction??ELe)(this,e,n),(o||r)&&(this._createCommandsFunction??SLe)(this,n,i,l,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??wLe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var vLe=new le,DLe=new le;function kie(e,t,n){if(n===Zt.TOP){let i=le.clone(e,vLe),o=le.clone(e,DLe);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===Zt.ALL&&(e.center=d.add(e.center,t,e.center));return e}function PLe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=$.createTypedArray(o.componentDatatype,r);return c(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function ILe(e,t,n,i,o){return function(r){if(!c(r)||!c(r.length)||r.length<1||r.length>4)throw new E("value must be and array with length between 1 and 4.");let s=Lie(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var OLe=new d;function RLe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(c(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;c(r)&&kie(i,d.fromArray(r.get(),0,OLe),e._offsetInstanceExtend[n]),c(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function MLe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Ir.prototype.getGeometryInstanceAttributes=function(e){if(!c(e))throw new E("id is required");if(!c(this._batchTable))throw new E("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(c(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let l={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];l[u]={get:PLe(s,n,f),set:ILe(s,n,f,this,u)}}return RLe(this,l,n),MLe(this,l,n),Object.defineProperties(t,l),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Ir.prototype.isDestroyed=function(){return!1};Ir.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,de(this)};function mO(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Pr.COMPLETE||e._state===Pr.FAILED})}var Pn=Ir;function LLe(e){if(e=e??W.EMPTY_OBJECT,!c(e.componentDatatype))throw new E("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new E("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new E("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.value))throw new E("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var hc=LLe;var AC=`#ifdef TEXTURE_COORDINATES +`,t}function xbe(e,t){let n=e.vertexAttributes}function bnt(e,t){return function(){return e[t]}}var pQ=Math.max(dn.hardwareConcurrency-1,1),ZH,xnt=new $n("combineGeometry");function Tnt(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===ss.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(ZH))for(ZH=new Array(pQ),r=0;r<pQ;r++)ZH[r]=new $n("createGeometry");let f;for(u=MN(u,pQ),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(ZH[r].scheduleTask({subTasks:u[r]},m))}e._state=ss.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=ss.CREATED}).catch(function(d){NL(e,t,ss.FAILED,d)})}else if(e._state===ss.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=xnt.scheduleTask(AT.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,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=ss.COMBINING,Promise.resolve(f).then(function(d){let p=AT.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.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=ss.COMBINED):NL(e,t,ss.FAILED,void 0)}).catch(function(d){NL(e,t,ss.FAILED,d)})}}function Ent(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=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=pnt(p):g=p.constructor.createGeometry(p),r[c++]=gnt(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=AT.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=N.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=ss.COMBINED):NL(e,t,ss.FAILED,void 0)}function Cnt(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ce;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),Rbe(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ce.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ce.union(d,c[i]);for(i=1;i<f.length;i++)p=ce.union(p,f[i]);for(i=1;i<u.length;i++)g=ce.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=ce.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}as._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Tbe=new Sn,Ibe=new he,Pbe=new h,Dbe=new ce;function vnt(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=ce.transform(y,A,Dbe));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,Tbe);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,Ibe),v=u.project(E,Pbe);T=Sn.fromCartesian(v,Tbe),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var gQ=new h,Snt=new h;function Ebe(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ce.transform(f,p,Dbe));let g=f.center;g=o.scaleToGeodeticSurface(g,Snt);let m=o.cartesianToCartographic(g,Ibe),y=r.project(m,Pbe),A=h.add(d,g,gQ);m=o.cartesianToCartographic(A,m);let b=r.project(m,gQ),x=h.subtract(b,y,gQ),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function wnt(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(zn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ce.clone(u.boundingSphere)),e._boundingSphereWC.push(new ce),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ce.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ce),e._boundingSphereMorph.push(new ce)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,NL(e,t,ss.COMPLETE,void 0)}function Int(e,t,n,i){let r=n.getRenderState(),o;i?(o=Je(r,!1),o.cull={enabled:!0,face:Vi.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=Vi.FRONT,e._backFaceRS=Ge.fromCache(o)):(e._frontFaceRS=Ge.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Je(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Je(r,!1),o.depthTest.func=hc.GREATER,i?(o.cull={enabled:!0,face:Vi.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=Vi.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function Pnt(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=as._appendOffsetToShader(e,o),o=as._appendShowToShader(e,o),o=as._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=ybe(o),o=as._updateColorAttribute(e,o,!1),o=bbe(e,o),o=as._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Abe(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),xbe(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=as._appendShowToShader(e,o),o=as._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=ybe(o),o=as._updateColorAttribute(e,o,!0),o=bbe(e,o),o=as._modifyShaderPosition(e,o,t.scene3DOnly),o=ynt(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=Abe(s),s=Ant(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),xbe(e._spDepthFail,r))}var ML=new N,Cbe=new h;function vbe(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=bnt(s,c));let a=Ot(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return N.multiply(c,e._modelMatrix,ML),N.multiplyByPoint(ML,e.rtcCenter,Cbe),N.setTranslation(ML,Cbe,ML),ML}),a}function Dnt(e,t,n,i,r,o,s,a){let c=vbe(e,t,n,a),u;l(e._depthFailAppearance)&&(u=vbe(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}as._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ce.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ce.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ce.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function Rnt(e,t,n,i,r,o,s,a){as._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Dn.castShadows(e.shadows),g=Dn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=s,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}as.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!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===ss.FAILED)return;let t=e.context;if(l(this._batchTable)||hnt(this,t),this._batchTable.attributes.length>0){if(kt.maximumVertexTextureImageUnits===0)throw new oe("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!==ss.COMPLETE&&this._state!==ss.COMBINED&&(this.asynchronous?Tnt(this,e):Ent(this,e)),this._state===ss.COMBINED&&(vnt(this,e),Ebe(this,e),wnt(this,e)),!this.show||this._state!==ss.COMPLETE)return;this._batchTableOffsetsUpdated||Ebe(this,e),this._recomputeBoundingSpheres&&Cnt(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??Int)(this,t,n,u),o&&(this._createShaderProgramFunction??Pnt)(this,e,n),(r||o)&&(this._createCommandsFunction??Dnt)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??Rnt)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var Ont=new ce,Mnt=new ce;function Rbe(e,t,n){if(n===mn.TOP){let i=ce.clone(e,Ont),r=ce.clone(e,Mnt);r.center=h.add(r.center,t,r.center),e=ce.union(i,r,e)}else n===mn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function Nnt(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function Lnt(e,t,n,i,r){return function(o){let s=wbe(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var Fnt=new h;function Bnt(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&Rbe(i,h.fromArray(o.get(),0,Fnt),e._offsetInstanceExtend[n]),l(r)&&(i=ce.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function knt(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}as.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:Nnt(s,n,f),set:Lnt(s,n,f,this,u)}}return Bnt(this,c,n),knt(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};as.prototype.isDestroyed=function(){return!1};as.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,ue(this)};function NL(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===ss.COMPLETE||e._state===ss.FAILED,!0})}var Mn=as;var VS=`#ifdef TEXTURE_COORDINATES #ifdef SPHERICAL in vec4 v_sphericalExtents; #else // SPHERICAL @@ -2698,21 +3988,17 @@ uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_i uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; #endif // SPHERICAL #endif // TEXTURE_COORDINATES -#ifdef PICK -#ifdef CULL_FRAGMENTS -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; -czm_writeDepthClamp(); -} -#else // CULL_FRAGMENTS -out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK #ifdef CULL_FRAGMENTS if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { discard; } #endif +#ifdef PICK +out_FragColor.a = 1.0; +#ifdef CULL_FRAGMENTS +czm_writeDepthClamp(); +#endif // CULL_FRAGMENTS +#else // PICK #ifdef NORMAL_EC vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); @@ -2758,14 +4044,14 @@ out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); #endif // PICK } -`;function Pf(e,t,n){T.typeOf.bool("extentsCulling",e),T.typeOf.bool("planarExtents",t),T.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new T6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new T6;if(o.requiresTextureCoordinates=e,n instanceof rn)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}Pf.prototype.createFragmentShader=function(e){T.typeOf.bool("columbusView2D",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 rn&&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 rn||(o=t.material.shaderSource),new He({defines:i,sources:[o,AC]})};Pf.prototype.createPickFragmentShader=function(e){T.typeOf.bool("columbusView2D",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 He({defines:n,sources:[AC],pickColorQualifier:"in"})};Pf.prototype.createVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),qie(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Pf.prototype.createPickVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),qie(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Uie=new d,Vie=new he,zie={high:0,low:0};function qie(e,t,n,i,o,r,s,a){let l=i.slice();if(a.eastMostYhighDefine===""){let u=Vie;u.longitude=O.PI,u.latitude=0,u.height=0;let f=s.project(u,Uie),h=Hn.encode(f.x,zie);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=Vie;p.longitude=-O.PI,p.latitude=0,p.height=0;let g=s.project(p,Uie);h=Hn.encode(g.x,zie),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&&(l.push(a.eastMostYhighDefine),l.push(a.eastMostYlowDefine),l.push(a.westMostYhighDefine),l.push(a.westMostYlowDefine)),c(r)&&r instanceof rn&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new He({defines:l,sources:[o]})}function T6(){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(T6.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 Hie(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)/H.distance(t,e)}var NLe=[new H,new H,new H,new H];function Yie(e,t){let n=NLe,i=H.unpack(t,0,n[0]),o=H.unpack(t,2,n[1]),r=H.unpack(t,4,n[2]);e.uMaxVmax=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Hie(i,o,r),a=1/Hie(i,r,o);e.uvMinAndExtents=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Xie=new he,Kie=new d,FLe=new d,BLe=new d,RV={high:0,low:0};function $ie(e,t,n){let i=Xie;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Kie);i.latitude=e.north;let r=t.project(i,FLe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,BLe),a=[0,0,0,0],l=[0,0,0,0],u=Hn.encode(o.x,RV);a[0]=u.high,l[0]=u.low,u=Hn.encode(o.y,RV),a[1]=u.high,l[1]=u.low,u=Hn.encode(r.y,RV),a[2]=u.high,l[2]=u.low,u=Hn.encode(s.x,RV),a[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}var kLe=new B,ULe=new B,Gie=new d,VLe=new he,zLe=[new he,new he,new he,new he,new he,new he,new he,new he];function HLe(e,t,n,i,o,r){let s=ce.center(e,VLe);s.height=n;let a=he.toCartesian(s,t,Gie),l=Ot.eastNorthUpToFixedFrame(a,t,kLe),u=B.inverse(l,ULe),f=e.west,h=e.east,p=e.north,g=e.south,m=zLe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=g,m[3].longitude=h;let y=(f+h)*.5,b=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=h;let x=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let L=he.toCartesian(m[R],t,Gie);B.multiplyByPoint(u,L,L),L.z=0,x=Math.min(x,L.x),A=Math.max(A,L.x),C=Math.min(C,L.y),S=Math.max(S,L.y)}let v=i;v.x=x,v.y=C,v.z=0,B.multiplyByPoint(l,v,v);let P=o;P.x=A,P.y=C,P.z=0,B.multiplyByPoint(l,P,P),d.subtract(P,v,o);let M=r;M.x=x,M.y=S,M.z=0,B.multiplyByPoint(l,M,M),d.subtract(M,v,r)}var GLe=new d,jLe=new d,WLe=new Hn;Pf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let r=Kie,s=GLe,a=jLe;HLe(e,n,o??0,r,s,a);let l={};Yie(l,t);let u=Hn.fromCartesian(r,WLe);return l.southWest_HIGH=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),l.southWest_LOW=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),l.eastward=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),l.northward=new hc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),$ie(e,i,l),l};var qLe=new d;function jie(e,t,n,i){let o=Xie;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,qLe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=O.fastApproximateAtan2(s,r.z),l=O.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=l,i}var Wie=new H;Pf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let o=jie(e.south,e.west,n,Wie),r=o.x,s=o.y,a=jie(e.north,e.east,n,Wie),l=a.x,u=a.y,f=0;s>u&&(f=O.PI-s,s=-O.PI,u+=f),r-=O.EPSILON5,s-=O.EPSILON5,l+=O.EPSILON5,u+=O.EPSILON5;let h=1/(u-s),p=1/(l-r),g={sphericalExtents:new hc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new hc({componentDatatype:$.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Yie(g,t),$ie(e,i,g),g};Pf.hasAttributesForTextureCoordinatePlanes=function(e){return c(e.southWest_HIGH)&&c(e.southWest_LOW)&&c(e.northward)&&c(e.eastward)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};Pf.hasAttributesForSphericalExtents=function(e){return c(e.sphericalExtents)&&c(e.longitudeRotation)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};function YLe(e){return Math.max(e.width,e.height)>Pf.MAX_WIDTH_FOR_PLANAR_EXTENTS}Pf.shouldUseSphericalCoordinates=function(e){return T.typeOf.object("rectangle",e),YLe(e)};Pf.MAX_WIDTH_FOR_PLANAR_EXTENTS=O.toRadians(1);var bu=Pf;var XLe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Vn=Object.freeze(XLe);var KLe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},ft=Object.freeze(KLe);var MV={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};MV.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:MV.CESIUM_3D_TILE_MASK,mask:MV.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(MV);function Lb(e){e=e??W.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Lb.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}}});Lb.isSupported=function(e){return e.context.stencilBuffer};function CC(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}function C6(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}}var $Le={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function ZLe(e,t,n,i){if(c(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(CC(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(CC(o,!0)),e._rsColorPass=Ve.fromCache(C6(o,!1)),e._rsPickPass=Ve.fromCache($Le)}function QLe(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=He.replaceMain(s,"czm_non_compressed_main");let a=`void main() +`;function Kd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new _Q;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new _Q;if(r.requiresTextureCoordinates=e,n instanceof yn)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Kd.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 yn&&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 r="";return t instanceof yn||(r=t.material.shaderSource),new Ye({defines:i,sources:[r,VS]})};Kd.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 Ye({defines:n,sources:[VS],pickColorQualifier:"in"})};Kd.prototype.createVertexShader=function(e,t,n,i){return Ube(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Kd.prototype.createPickVertexShader=function(e,t,n,i){return Ube(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Obe=new h,Mbe=new he,Nbe={high:0,low:0};function Ube(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Mbe;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,Obe),d=Sn.encode(f.x,Nbe);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=Mbe;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=s.project(p,Obe);d=Sn.encode(g.x,Nbe),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof yn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ye({defines:c,sources:[r]})}function _Q(){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(_Q.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 Lbe(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)/U.distance(t,e)}var Unt=[new U,new U,new U,new U];function zbe(e,t){let n=Unt,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Lbe(i,r,o),a=1/Lbe(i,o,r);e.uvMinAndExtents=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Vbe=new he,jbe=new h,znt=new h,Vnt=new h,QH={high:0,low:0};function Hbe(e,t,n){let i=Vbe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,jbe);i.latitude=e.north;let o=t.project(i,znt);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Vnt),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,QH);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,QH),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,QH),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,QH),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var jnt=new N,Hnt=new N,Fbe=new h,Gnt=new he,Wnt=[new he,new he,new he,new he,new he,new he,new he,new he];function qnt(e,t,n,i,r,o){let s=ie.center(e,Gnt);s.height=n;let a=he.toCartesian(s,t,Fbe),c=At.eastNorthUpToFixedFrame(a,t,jnt),u=N.inverse(c,Hnt),f=e.west,d=e.east,p=e.north,g=e.south,m=Wnt;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let O=he.toCartesian(m[R],t,Fbe);N.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),E=Math.max(E,O.y)}let v=i;v.x=b,v.y=T,v.z=0,N.multiplyByPoint(c,v,v);let S=r;S.x=x,S.y=T,S.z=0,N.multiplyByPoint(c,S,S),h.subtract(S,v,r);let I=o;I.x=b,I.y=E,I.z=0,N.multiplyByPoint(c,I,I),h.subtract(I,v,o)}var Ynt=new h,Xnt=new h,Knt=new Sn;Kd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=jbe,s=Ynt,a=Xnt;qnt(e,n,r??0,o,s,a);let c={};zbe(c,t);let u=Sn.fromCartesian(o,Knt);return c.southWest_HIGH=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new il({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Hbe(e,i,c),c};var $nt=new h;function Bbe(e,t,n,i){let r=Vbe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,$nt),s=Math.sqrt(o.x*o.x+o.y*o.y),a=D.fastApproximateAtan2(s,o.z),c=D.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var kbe=new U;Kd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Bbe(e.south,e.west,n,kbe),o=r.x,s=r.y,a=Bbe(e.north,e.east,n,kbe),c=a.x,u=a.y,f=0;s>u&&(f=D.PI-s,s=-D.PI,u+=f),o-=D.EPSILON5,s-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new il({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new il({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return zbe(g,t),Hbe(e,i,g),g};Kd.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)};Kd.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 Jnt(e){return Math.max(e.width,e.height)>Kd.MAX_WIDTH_FOR_PLANAR_EXTENTS}Kd.shouldUseSphericalCoordinates=function(e){return Jnt(e)};Kd.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Uf=Kd;var Gbe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(Gbe);var ni=Gbe;var Wbe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP};Object.freeze(Wbe);var Rt=Wbe;var eG={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};eG.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ni.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ni.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:eG.CESIUM_3D_TILE_MASK,mask:eG.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(eG);function bT(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(bT.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}}});bT.isSupported=function(e){return e.context.stencilBuffer};function jS(e,t){let n=t?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:n,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}function AQ(e){return{stencilTest:{enabled:e,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND}}var Znt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Qnt(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(jS(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(jS(r,!0)),e._rsColorPass=Ge.fromCache(AQ(r,!1)),e._rsPickPass=Ge.fromCache(Znt)}function eit(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; +`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ye.replaceMain(s,"czm_non_compressed_main");let a=`void main() { -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function JLe(e,t){let n=t.context,i=e._primitive,o=uO;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Pn._appendDistanceDisplayConditionToShader(i,o),o=Pn._modifyShaderPosition(e,o,t.scene3DOnly),o=Pn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=QLe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",l=new He({defines:[a],sources:[o]}),u=new He({sources:[Jg]}),f=e._primitive._attributeLocations,h=new bu(s,r,e.appearance);if(e._spStencil=Jt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=He.createPickVertexShaderSource(o);m=Pn._appendShowToShader(i,m),m=Pn._updatePickColorAttribute(m);let y=h.createPickFragmentShader(!1),b=h.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Jt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f}),s){let x=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!c(x)){let A=h.createPickFragmentShader(!0),C=h.createPickVertexShader([a],m,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:C,fragmentShaderSource:A,attributeLocations:f})}e._spPick2D=x}}else e._spPick=Jt.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});o=Pn._appendShowToShader(i,o),l=new He({defines:[a],sources:[o]}),e._sp=Jt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Jt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!c(m)){let y=h.createFragmentShader(!0),b=h.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function eNe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],c(r)||(r=t[o]=new Qe({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=l,r.pass=De.TERRAIN_CLASSIFICATION,s=Qe.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=De.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],c(r)||(r=t[o+1]=new Qe({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=De.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(c(y)&&(l=xt(l,y._uniforms)),r.uniformMap=l,s=Qe.shallowClone(r,r.derivedCommands.tileset),s.pass=De.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=Qe.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=Qe.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=Qe.shallowClone(t[p],f[g]);m.shaderProgram=h,m.pass=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function tNe(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 l,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(l=0;l<o;l+=2){let m=i._va[h++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[l],c(u)||(u=t[l]=new Qe({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=De.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Qe.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=De.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[l+1],c(u)||(u=t[l+1]=new Qe({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=De.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Qe.shallowClone(u,u.derivedCommands.tileset),f.pass=De.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=Qe.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=Qe.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function nNe(e,t,n,i,o,r,s){eNe(e,r),tNe(e,s)}function Zie(e,t){return Math.floor(e%t/2)}function A6(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Qie(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function iNe(e,t,n,i,o,r,s,a){let l=e._primitive;Pn._updateBoundingVolumes(l,t,o);let u;t.mode===oe.SCENE3D?u=l._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===oe.SCENE2D&&c(l._boundingSphere2D)?u=l._boundingSphere2D:c(l._boundingSphereMorph)&&(u=l._boundingSphereMorph);let f=e.classificationType,h=f!==Un.CESIUM_3D_TILE,p=f!==Un.TERRAIN,g=t.passes,m,y,b;if(g.render){let x=n.length;for(m=0;m<x;++m)y=u[Zie(m,x)],h&&(b=n[m],A6(b,t,o,r,y,s)),p&&(b=n[m].derivedCommands.tileset,A6(b,t,o,r,y,s));if(t.invertClassification){let A=e._commandsIgnoreShow,C=A.length;for(m=0;m<C;++m)y=u[m],b=A[m],A6(b,t,o,r,y,s)}}if(g.pick){let x=i.length,A=l._pickOffsets;for(m=0;m<x;++m){let C=A[Zie(m,x)];y=u[C.index],h&&(b=i[m],Qie(b,t,o,r,y)),p&&(b=i[m].derivedCommands.tileset,Qie(b,t,o,r,y))}}}Lb.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;let t=this.appearance;c(t)&&c(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!c(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,l,u=!1,f=!0,h,p=!1,g=!1;for(r>0&&(l=o[0].attributes,p=bu.hasAttributesForSphericalExtents(l),g=bu.hasAttributesForTextureCoordinatePlanes(l),h=l.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;if(c(y))u=!0;else if(u)throw new E("All GeometryInstances must have color attributes to use per-instance color.");f=f&&c(y)&&Gt.equals(h,y)}if(!f&&!p&&!g)throw new E("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(u&&!c(t)&&(t=new rn({flat:!0}),this.appearance=t),!u&&t instanceof rn)throw new E("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(c(t.material)&&!p&&!g)throw new E("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new St({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,c(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,b){n._createBoundingVolumeFunction(y,b)}),i._createRenderStatesFunction=function(y,b,x,A){ZLe(n,b)},i._createShaderProgramFunction=function(y,b,x){JLe(n,b)},i._createCommandsFunction=function(y,b,x,A,C,S,v){nNe(n,void 0,void 0,!0,!1,S,v)},c(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,b,x,A,C,S,v,P){n._updateAndQueueCommandsFunction(y,b,x,A,C,S,v,P)}:i._updateAndQueueCommandsFunction=function(y,b,x,A,C,S,v,P){iNe(n,b,x,A,C,S,v,P)},this._primitive=new Pn(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(CC(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(CC(!1,!0)),this._rsColorPass=Ve.fromCache(C6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(CC(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(CC(!0,!0)),this._rsColorPass=Ve.fromCache(C6(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&c(t.material))throw new E("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof rn)throw new E("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Lb.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new E("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Lb.prototype.isDestroyed=function(){return!1};Lb.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,de(this)};var EC=Lb;var oNe={u_globeMinimumAltitude:function(){return 55e3}};function Nl(e){e=e??W.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!c(t)&&c(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(c(a)&&c(a.color)){t=new rn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ui._defaultMaxTerrainHeight,this._minTerrainHeight=ui._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:oNe}}Object.defineProperties(Nl.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}}});Nl.isSupported=EC.isSupported;function Jie(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function eoe(e){return function(t,n){return e._minHeight}}var rNe=new d,sNe=new d,aNe=new d,cNe=new he,lNe=new ce;function LV(e,t){let n=e.mapProjection.ellipsoid;if(!c(t.attributes)||!c(t.attributes.position3DHigh))return c(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,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,rNe),g=d.unpack(o,h,sNe),m=d.add(p,g,aNe),y=n.cartesianToCartographic(m,cNe),b=y.latitude,x=y.longitude;s=Math.min(s,b),a=Math.min(a,x),l=Math.max(l,b),u=Math.max(u,x)}let f=lNe;return f.north=l,f.south=s,f.east=u,f.west=a,f}function uNe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function fNe(e,t,n){let i=t.mapProjection.ellipsoid,o=LV(t,n),r=Dn.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);d.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function E6(e,t){return Math.floor(e%t/2)}function S6(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 toe(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 dNe(e,t,n,i,o,r,s,a){let l;t.mode===oe.SCENE3D?l=e._boundingVolumes:l=e._boundingVolumes2D;let u=e.classificationType,f=u!==Un.CESIUM_3D_TILE,h=u!==Un.TERRAIN,p=t.passes,g=e._primitive,m,y,b;if(p.render){let x=n.length;for(m=0;m<x;++m)y=l[E6(m,x)],f&&(b=n[m],S6(e,b,t,o,r,y,s)),h&&(b=n[m].derivedCommands.tileset,S6(e,b,t,o,r,y,s));if(t.invertClassification){let A=g._commandsIgnoreShow,C=A.length;for(m=0;m<C;++m)y=l[m],b=A[m],S6(e,b,t,o,r,y,s)}}if(p.pick){let x=i.length,A;for(e._useFragmentCulling||(A=g._primitive._pickOffsets),m=0;m<x;++m){if(y=l[E6(m,x)],!e._useFragmentCulling){let C=A[E6(m,x)];y=l[C.index]}f&&(b=i[m],toe(e,b,t,o,r,y)),h&&(b=i[m].derivedCommands.tileset,toe(e,b,t,o,r,y))}}}Nl.initializeTerrainHeights=function(){return ui.initialize()};Nl.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!ui.initialized){if(!this.asynchronous)throw new E("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");Nl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!c(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],l=a.length,u=new Array(l),f,h;for(f=0;f<l;++f){o=a[f],r=o.geometry;let y=LV(e,r);c(h)?c(y)&&ce.union(h,y,h):h=ce.clone(y);let b=o.id;if(c(b)&&c(y)){let x=ui.getBoundingSphere(y,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(x)}if(s=r.constructor,!c(s)||!c(s.createShadowVolume))throw new E("Not all of the geometry instances have GroundPrimitive support.")}uNe(this,h,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Dr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Dr.getHeight(this._maxTerrainHeight,p,g);let m=Nl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,b=!0;for(f=0;f<l;++f)if(o=a[f],r=o.geometry,h=LV(e,r),bu.shouldUseSphericalCoordinates(h)){b=!1;break}for(f=0;f<l;++f){o=a[f],r=o.geometry,s=r.constructor;let x=LV(e,r),A=r.textureCoordinateRotationPoints;b?y=bu.getPlanarTextureCoordinateAttributes(x,A,i,e.mapProjection,this._maxHeight):y=bu.getSphericalExtentGeometryInstanceAttributes(x,A,i,e.mapProjection);let C=o.attributes;for(let S in C)C.hasOwnProperty(S)&&(y[S]=C[S]);u[f]=new St({geometry:s.createShadowVolume(r,eoe(this),Jie(this)),attributes:y,id:o.id})}}else for(f=0;f<l;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new St({geometry:s.createShadowVolume(r,eoe(this),Jie(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,b){fNe(t,y,b)},n._updateAndQueueCommandsFunction=function(y,b,x,A,C,S,v,P){dNe(t,b,x,A,C,S,v,P)},this._primitive=new EC(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&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Nl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Nl.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new E("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Nl.prototype.isDestroyed=function(){return!1};Nl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};Nl._supportsMaterials=function(e){return e.depthTexture};Nl.supportsMaterials=function(e){return T.typeOf.object("scene",e),Nl._supportsMaterials(e.frameState.context)};var jc=Nl;function SC(){E.throwInstantiationError()}Object.defineProperties(SC.prototype,{isConstant:{get:E.throwInstantiationError},definitionChanged:{get:E.throwInstantiationError}});SC.prototype.getType=E.throwInstantiationError;SC.prototype.getValue=E.throwInstantiationError;SC.prototype.equals=E.throwInstantiationError;var hNe=new Q;SC.getValue=function(e,t,n){let i;return c(e)||(e=Q.now(hNe)),c(t)&&(i=t.getType(e),c(i))?((!c(n)||n.type!==i)&&(n=Xi.fromType(i)),t.getValue(e,n.uniforms),n):((!c(n)||n.type!==Xi.ColorType)&&(n=Xi.fromType(Xi.ColorType)),G.clone(G.WHITE,n.uniforms.color),n)};var tr=SC;function Nb(e,t,n){T.defined("geometryUpdater",e),T.defined("primitives",t),T.defined("orderedGroundPrimitives",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}Nb.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Nb.prototype._setOptions=E.throwInstantiationError;Nb.prototype.update=function(e){T.defined("time",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),l=this._options;if(!c(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,h,p=t._getIsClosed(l);if(f)h=new rn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=tr.getValue(e,u,this._material);this._material=g,h=new ao({material:g,translucent:g.isTranslucent(),closed:p})}if(n)l.vertexFormat=rn.VERTEX_FORMAT,this._primitive=o.add(new jc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Pn({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&c(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Pn({geometryInstances:u,appearance:new rn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Nb.prototype.getBoundingSphere=function(e){if(!c(e))throw new E("result is required.");let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return c(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(n)&&!n.ready||c(i)&&!i.ready?lt.PENDING:lt.FAILED};Nb.prototype.isDestroyed=function(){return!1};Nb.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),de(this)};var ni=Nb;var noe={};function pO(e,t){if(!c(e))throw new E("identifier is required.");c(noe[e])||(noe[e]=!0,console.warn(t??e))}pO.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.";pO.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";pO.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";pO.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var dt=pO;var mNe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Bp=Object.freeze(mNe);var pNe={NONE:0,GEODESIC:1,RHUMB:2},qt=Object.freeze(pNe);var ioe=O.EPSILON10;function _Ne(e,t,n,i){if(T.defined("equalsEpsilon",t),!c(e))return;n=n??!1;let o=c(i),r=e.length;if(r<2)return e;let s,a=e[0],l,u,f=0,h=-1;for(s=1;s<r;++s)l=e[s],t(a,l,ioe)?(c(u)||(u=e.slice(0,s),f=s-1,h=0),o&&i.push(s)):(c(u)&&(u.push(l),f=s,o&&(h=i.length)),a=l);return n&&t(e[0],e[r-1],ioe)&&(o&&(c(u)?i.splice(h,0,f):i.push(r-1)),c(u)?u.length-=1:u=e.slice(0,-1)),c(u)?u:e}var xo=_Ne;function gNe(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),l=1/Math.sqrt(1+a*a),u=l*a,f=Math.atan2(a,r),h=l*s,p=h*h,g=1-p,m=Math.sqrt(g),y=t/4,b=y*y,x=b*y,A=b*b,C=1+y-3*b/4+5*x/4-175*A/64,S=1-y+15*b/8-35*x/8,v=1-3*y+35*b/4,P=1-5*y,M=C*f-S*Math.sin(2*f)*y/2-v*Math.sin(4*f)*b/16-P*Math.sin(6*f)*x/48-Math.sin(8*f)*5*A/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=l,R.sineU=u,R.sigma=f,R.sineAlpha=h,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=b,R.u6Over64=x,R.u8Over256=A,R.a0=C,R.a1=S,R.a2=v,R.a3=P,R.distanceRatio=M}function yNe(e,t){return e*t*(4+e*(4-3*t))/16}function ooe(e,t,n,i,o,r,s){let a=yNe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function bNe(e,t,n,i,o,r,s){let a=(t-n)/t,l=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),h=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=h*g,b=h*m,x=p*m,A=p*g,C=l,S=O.TWO_PI,v=Math.cos(C),P=Math.sin(C),M,R,L,F,_;do{v=Math.cos(C),P=Math.sin(C);let U=b-A*v;L=Math.sqrt(g*g*P*P+U*U),R=x+y*v,M=Math.atan2(L,R);let q;L===0?(q=0,F=1):(q=y*P/L,F=1-q*q),S=C,_=R-2*x/F,isFinite(_)||(_=0),C=l+ooe(a,q,F,M,L,R,_)}while(Math.abs(C-S)>O.EPSILON12);let w=F*(t*t-n*n)/(n*n),D=1+w*(4096+w*(w*(320-175*w)-768))/16384,I=w*(256+w*(w*(74-47*w)-128))/1024,N=_*_,k=I*L*(_+I*(R*(2*N-1)-I*_*(4*L*L-3)*(4*N-3)/6)/4),z=n*D*(M-k),V=Math.atan2(g*P,b-A*v),j=Math.atan2(h*P,b*v-A);e._distance=z,e._startHeading=V,e._endHeading=j,e._uSquared=w}var xNe=new d,w6=new d;function roe(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,w6),xNe),r=d.normalize(i.cartographicToCartesian(n,w6),w6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125),bNe(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,gNe(e)}function _O(e,t,n){let i=n??ie.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,c(e)&&c(t)&&roe(this,e,t,i)}Object.defineProperties(_O.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return T.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return T.defined("distance",this._distance),this._endHeading}}});_O.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),roe(this,e,t,this._ellipsoid)};_O.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};_O.prototype.interpolateUsingSurfaceDistance=function(e,t){T.defined("distance",this._distance);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),l=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,b=n.u4Over16,x=2*p*g*o/3+i*(1-m+7*b/4-15*y/4+579*g/64-(b-15*y/4+187*g/16)*o-(5*y/4-115*g/16)*r-29*g*s/16)+(m/2-b+71*y/32-85*g/16)*a+(5*b/16-5*y/4+383*g/96)*l-h*((y-11*g/2)*a+5*g*l/2)+(29*y/96-29*g/16)*u+539*g*f/1536,A=Math.asin(Math.sin(x)*n.cosineAlpha),C=Math.atan(n.a/n.b*Math.tan(A));x=x-n.sigma;let S=Math.cos(2*n.sigma+x),v=Math.sin(x),P=Math.cos(x),M=n.cosineU*P,R=n.sineU*v,F=Math.atan2(v*n.sineHeading,M-R*n.cosineHeading)-ooe(n.f,n.sineAlpha,n.cosineSquaredAlpha,x,v,P,S);return c(t)?(t.longitude=this._start.longitude+F,t.latitude=C,t.height=0,t):new he(this._start.longitude+F,C,0)};var kp=_O;function D6(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,l=a*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*l/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*l/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*l/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*l/1048576)*p+(315*s/131072+2205*a/524288+43659*l/8388608)*g-(693*a/1310720+6237*l/5242880)*m+1001*l/8388608*y)}function TNe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,l=a*a,u=l*l,f=u*l,h=f*l,p=h*l,g=p*l,m=Math.sin(2*i),y=Math.cos(2*i),b=Math.sin(4*i),x=Math.cos(4*i),A=Math.sin(6*i),C=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),P=Math.sin(10*i),M=Math.cos(10*i),R=Math.sin(12*i);return i+i*l/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*y+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*x+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*C+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*M+(3*l/8+3*u/16+213*f/2048-3*o*f/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)*m+(21*u/256+21*f/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)*b+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*A+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*P+293393*g/251658240*R}function wC(e,t){if(e===0)return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function ANe(e,t,n,i,o){let r=wC(e._ellipticity,n),s=wC(e._ellipticity,o);return Math.atan2(O.negativePiToPi(i-t),s-r)}function CNe(e,t,n,i,o,r,s){let a=e._heading,l=r-i,u=0;if(O.equalsEpsilon(Math.abs(a),O.PI_OVER_TWO,O.EPSILON8))if(t===n)u=t*Math.cos(o)*O.negativePiToPi(l);else{let f=Math.sin(o);u=t*Math.cos(o)*O.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=D6(e._ellipticity,t,o);u=(D6(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var ENe=new d,v6=new d;function soe(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,v6),ENe),r=d.normalize(i.cartographicToCartesian(n,v6),v6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125);let s=i.maximumRadius,a=i.minimumRadius,l=s*s,u=a*a;e._ellipticitySquared=(l-u)/l,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=ANe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=CNe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function aoe(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,l,u;if(Math.abs(O.PI_OVER_TWO-Math.abs(t))>O.EPSILON8){let f=D6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(l=TNe(p,o,i),Math.abs(t)<O.EPSILON10)a=O.negativePiToPi(e.longitude);else{let g=wC(o,e.latitude),m=wC(o,l);u=Math.tan(t)*(m-g),a=O.negativePiToPi(e.longitude+u)}}else{l=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}u=n/f,t>0?a=O.negativePiToPi(e.longitude+u):a=O.negativePiToPi(e.longitude-u)}return c(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new he(a,l,0)}function Up(e,t,n){let i=n??ie.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,c(e)&&c(t)&&soe(this,e,t,i)}Object.defineProperties(Up.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return T.defined("distance",this._distance),this._heading}}});Up.fromStartHeadingDistance=function(e,t,n,i,o){T.defined("start",e),T.defined("heading",t),T.defined("distance",n),T.typeOf.number.greaterThan("distance",n,0);let r=i??ie.default,s=r.maximumRadius,a=r.minimumRadius,l=s*s,u=a*a,f=Math.sqrt((l-u)/l);t=O.negativePiToPi(t);let h=aoe(e,t,n,r.maximumRadius,f);return!c(o)||c(i)&&!i.equals(o.ellipsoid)?new Up(e,h,r):(o.setEndPoints(e,h),o)};Up.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),soe(this,e,t,this._ellipsoid)};Up.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Up.prototype.interpolateUsingSurfaceDistance=function(e,t){if(T.typeOf.number("distance",e),!c(this._distance)||this._distance===0)throw new E("EllipsoidRhumbLine must have distinct start and end set.");return aoe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Up.prototype.findIntersectionWithLongitude=function(e,t){if(T.typeOf.number("intersectionLongitude",e),!c(this._distance)||this._distance===0)throw new E("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=O.negativePiToPi(e),O.equalsEpsilon(Math.abs(e),Math.PI,O.EPSILON14)&&(e=O.sign(r.longitude)*Math.PI),c(t)||(t=new he),Math.abs(O.PI_OVER_TWO-o)<=O.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(O.equalsEpsilon(Math.abs(O.PI_OVER_TWO-o),O.PI_OVER_TWO,O.EPSILON8))return O.equalsEpsilon(e,r.longitude,O.EPSILON12)?void 0:(t.longitude=e,t.latitude=O.PI_OVER_TWO*O.sign(O.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),l=Math.tan(.5*(O.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),g=(1+p)/(1-p);f=2*Math.atan(l*Math.pow(g/u,n/2))-O.PI_OVER_TWO}while(!O.equalsEpsilon(f,h,O.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Up.prototype.findIntersectionWithLatitude=function(e,t){if(T.typeOf.number("intersectionLatitude",e),!c(this._distance)||this._distance===0)throw new E("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=this._start;if(O.equalsEpsilon(Math.abs(i),O.PI_OVER_TWO,O.EPSILON8))return;let r=wC(n,o.latitude),s=wC(n,e),a=Math.tan(i)*(s-r),l=O.negativePiToPi(o.longitude+a);return c(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new he(l,e,0)};var Ba=Up;var F6=[Oi,Mi],SNe=F6.length,voe=Math.cos(O.toRadians(30)),coe=Math.cos(O.toRadians(150)),Doe=0,Poe=1e3;function ty(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t)||t.length<2)throw new E("At least two positions are required.");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new E("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??qt.GEODESIC,this._ellipsoid=ie.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ty.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ie.packedLength+1+1}}});ty.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<SNe;i++)if(t instanceof F6[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var wNe=new d,loe=new d,uoe=new d;function N6(e,t,n,i,o){let r=Wc(i,e,0,wNe),s=Wc(i,e,n,loe),a=Wc(i,t,0,uoe),l=Vp(s,r,loe),u=Vp(a,r,uoe);return d.cross(u,l,o),d.normalize(o,o)}var vNe=new he,DNe=new d,PNe=new d,INe=new d;function P6(e,t,n,i,o,r,s,a,l,u,f){if(o===0)return;let h;r===qt.GEODESIC?h=new kp(e,t,s):r===qt.RHUMB&&(h=new Ba(e,t,s));let p=h.surfaceDistance;if(p<o)return;let g=N6(e,t,i,s,INe),m=Math.ceil(p/o),y=p/m,b=y,x=m-1,A=a.length;for(let C=0;C<x;C++){let S=h.interpolateUsingSurfaceDistance(b,vNe),v=Wc(s,S,n,DNe),P=Wc(s,S,i,PNe);d.pack(g,a,A),d.pack(v,l,A),d.pack(P,u,A),f.push(S.latitude),f.push(S.longitude),A+=3,b+=y}}var I6=new he;function Wc(e,t,n,i){return he.clone(t,I6),I6.height=n,he.toCartesian(I6,e,i)}ty.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t);let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];d.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ie.pack(e._ellipsoid,t,i),i+=ie.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};ty.unpack=function(e,t,n){T.defined("array",e);let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,l=e[i++],u=ie.unpack(e,i);i+=ie.packedLength;let f=e[i++],h=e[i++]===1;return c(n)||(n=new ty({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=l,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function Vp(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function foe(e,t,n,i){return i=Vp(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var ONe=new d,RNe=new d,MNe=new d,Ioe=new d,LNe=0,NNe=-1;function O6(e,t,n,i,o){let r=Vp(n,t,Ioe),s=foe(e,t,r,ONe),a=foe(i,t,r,RNe);if(O.equalsEpsilon(d.dot(s,a),NNe,O.EPSILON5))return o=d.cross(r,s,o),o=d.normalize(o,o),o;o=d.add(a,s,o),o=d.normalize(o,o);let l=d.cross(r,o,MNe);return d.dot(a,l)<LNe&&(o=d.negate(o,o)),o}var kV=sn.fromPointNormal(d.ZERO,d.UNIT_Y),FNe=new d,BNe=new d,kNe=new d,UNe=new d,VNe=new d,NV=new d,FV=new he,doe=new he,hoe=new he;ty.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new F6[e._projectionIndex](i),a=Doe,l=Poe,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let g,m,y,b,x=new Ba(void 0,void 0,i),A,C,S,v=[h[0]];for(f=0;f<p-1;f++)g=h[f],m=h[f+1],A=Zn.lineSegmentPlane(g,m,kV,NV),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&(e.arcType===qt.GEODESIC?v.push(d.clone(A)):e.arcType===qt.RHUMB&&(S=i.cartesianToCartographic(A,FV).longitude,y=i.cartesianToCartographic(g,FV),b=i.cartesianToCartographic(m,doe),x.setEndPoints(y,b),C=x.findIntersectionWithLongitude(S,hoe),A=i.cartographicToCartesian(C,NV),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&v.push(d.clone(A)))),v.push(m);n&&(g=h[p-1],m=h[0],A=Zn.lineSegmentPlane(g,m,kV,NV),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&(e.arcType===qt.GEODESIC?v.push(d.clone(A)):e.arcType===qt.RHUMB&&(S=i.cartesianToCartographic(A,FV).longitude,y=i.cartesianToCartographic(g,FV),b=i.cartesianToCartographic(m,doe),x.setEndPoints(y,b),C=x.findIntersectionWithLongitude(S,hoe),A=i.cartographicToCartesian(C,NV),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&v.push(d.clone(A)))));let P=v.length,M=new Array(P);for(f=0;f<P;f++){let Y=he.fromCartesian(v[f],i);Y.height=0,M[f]=Y}if(M=xo(M,he.equalsEpsilon),P=M.length,P<2)return;let R=[],L=[],F=[],_=[],w=FNe,D=BNe,I=kNe,N=UNe,k=VNe,z=M[0],V=M[1],j=M[P-1];for(w=Wc(i,j,a,w),N=Wc(i,V,a,N),D=Wc(i,z,a,D),I=Wc(i,z,l,I),n?k=O6(w,D,I,N,k):k=N6(z,V,l,i,k),d.pack(k,L,0),d.pack(D,F,0),d.pack(I,_,0),R.push(z.latitude),R.push(z.longitude),P6(z,V,a,l,o,r,i,L,F,_,R),f=1;f<P-1;++f){w=d.clone(D,w),D=d.clone(N,D);let Y=M[f];Wc(i,Y,l,I),Wc(i,M[f+1],a,N),O6(w,D,I,N,k),u=L.length,d.pack(k,L,u),d.pack(D,F,u),d.pack(I,_,u),R.push(Y.latitude),R.push(Y.longitude),P6(M[f],M[f+1],a,l,o,r,i,L,F,_,R)}let U=M[P-1],q=M[P-2];if(D=Wc(i,U,a,D),I=Wc(i,U,l,I),n){let Y=M[0];w=Wc(i,q,a,w),N=Wc(i,Y,a,N),k=O6(w,D,I,N,k)}else k=N6(q,U,l,i,k);if(u=L.length,d.pack(k,L,u),d.pack(D,F,u),d.pack(I,_,u),R.push(U.latitude),R.push(U.longitude),n){for(P6(U,z,a,l,o,r,i,L,F,_,R),u=L.length,f=0;f<3;++f)L[u+f]=L[f],F[u+f]=F[f],_[u+f]=_[f];R.push(z.latitude),R.push(z.longitude)}return dFe(n,s,F,_,L,R,t)};var zNe=new d,HNe=new J,GNe=new Le;function moe(e,t,n,i){let o=Vp(n,t,zNe),r=d.dot(o,e);if(r>voe||r<coe){let s=Vp(i,n,Ioe),a=r<coe?O.PI_OVER_TWO:-O.PI_OVER_TWO,l=Le.fromAxisAngle(s,a,GNe),u=J.fromQuaternion(l,HNe);return J.multiplyByVector(u,e,e),!0}return!1}var poe=new he,jNe=new d,_oe=new d;function gO(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,jNe),s=d.add(r,n,_oe),a=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,poe);Math.abs(t.longitude-u.longitude)>O.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,_oe),u=l.cartesianToCartographic(s,poe)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var WNe=new d,goe=new d;function yoe(e,t,n,i,o,r){let s=d.subtract(t,e,WNe);d.normalize(s,s);let a=n-Doe,l=d.multiplyByScalar(s,a,goe);d.add(e,l,o);let u=i-Poe;l=d.multiplyByScalar(s,u,goe),d.add(t,l,r)}var qNe=new d;function BV(e,t){let n=sn.getPointDistance(kV,e),i=sn.getPointDistance(kV,t),o=qNe;O.equalsEpsilon(n,0,O.EPSILON2)?(o=Vp(t,e,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(e,o,e)):O.equalsEpsilon(i,0,O.EPSILON2)&&(o=Vp(e,t,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(t,o,t))}function YNe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(O.equalsEpsilon(n,O.PI,O.EPSILON11)){let o=O.sign(t.longitude);return e.longitude=o*(n-O.EPSILON11),1}else if(O.equalsEpsilon(i,O.PI,O.EPSILON11)){let o=O.sign(e.longitude);return t.longitude=o*(i-O.EPSILON11),2}return 0}var Ooe=new he,Roe=new he,boe=new d,R6=new d,xoe=new d,Toe=new d,XNe=new d,Aoe=new d,KNe=[Ooe,Roe],$Ne=new ce,ZNe=new d,QNe=new d,JNe=new d,eFe=new d,tFe=new d,nFe=new d,M6=new d,L6=new d,iFe=new d,oFe=new d,rFe=new d,Coe=new d,sFe=new d,aFe=new d,cFe=new Hn,lFe=new Hn,Eoe=new d,uFe=new d,Soe=new d,fFe=[new le,new le],Moe=[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],woe=Moe.length;function dFe(e,t,n,i,o,r,s){let a,l,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,g=f*36,m=h>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(h*3),b=new Float32Array(p),x=new Float32Array(p),A=new Float32Array(p),C=new Float32Array(p),S=new Float32Array(p),v,P,M,R;s&&(v=new Float32Array(p),P=new Float32Array(p),M=new Float32Array(p),R=new Float32Array(h*2));let L=r.length/2,F=0,_=Ooe;_.height=0;let w=Roe;w.height=0;let D=boe,I=R6;if(s)for(l=0,a=1;a<L;a++)_.latitude=r[l],_.longitude=r[l+1],w.latitude=r[l+2],w.longitude=r[l+3],D=t.project(_,D),I=t.project(w,I),F+=d.distance(D,I),l+=2;let N=i.length/3;I=d.unpack(i,0,I);let k=0;for(l=3,a=1;a<N;a++)D=d.clone(I,D),I=d.unpack(i,l,I),k+=d.distance(D,I),l+=3;let z;l=3;let V=0,j=0,U=0,q=0,Y=!1,te=d.unpack(n,0,Toe),K=d.unpack(i,0,R6),Z=d.unpack(o,0,Aoe);if(e){let Ee=d.unpack(n,n.length-6,xoe);moe(Z,Ee,te,K)&&(Z=d.negate(Z,Z))}let ee=0,me=0,Te=0;for(a=0;a<f;a++){let Ee=d.clone(te,xoe),ze=d.clone(K,boe),qe=d.clone(Z,XNe);Y&&(qe=d.negate(qe,qe)),te=d.unpack(n,l,Toe),K=d.unpack(i,l,R6),Z=d.unpack(o,l,Aoe),Y=moe(Z,Ee,te,K),_.latitude=r[V],_.longitude=r[V+1],w.latitude=r[V+2],w.longitude=r[V+3];let it,Dt,jt,$e;if(s){let _i=YNe(_,w);it=t.project(_,tFe),Dt=t.project(w,nFe);let ca=Vp(Dt,it,Eoe);ca.y=Math.abs(ca.y),jt=M6,$e=L6,_i===0||d.dot(ca,d.UNIT_Y)>voe?(jt=gO(t,_,qe,it,M6),$e=gO(t,w,Z,Dt,L6)):_i===1?($e=gO(t,w,Z,Dt,L6),jt.x=0,jt.y=O.sign(_.longitude-Math.abs(w.longitude)),jt.z=0):(jt=gO(t,_,qe,it,M6),$e.x=0,$e.y=O.sign(_.longitude-w.longitude),$e.z=0)}let un=d.distance(ze,K),zt=Hn.fromCartesian(Ee,cFe),Ct=d.subtract(te,Ee,iFe),Ei=d.normalize(Ct,Coe),an=d.subtract(ze,Ee,oFe);an=d.normalize(an,an);let _e=d.cross(Ei,an,Coe);_e=d.normalize(_e,_e);let Ce=d.cross(an,qe,sFe);Ce=d.normalize(Ce,Ce);let pn=d.subtract(K,te,rFe);pn=d.normalize(pn,pn);let mt=d.cross(Z,pn,aFe);mt=d.normalize(mt,mt);let so=un/k,Ro=ee/k,aa=0,Nr,Cs,Ne,ot=0,Xe=0;if(s){aa=d.distance(it,Dt),Nr=Hn.fromCartesian(it,lFe),Cs=d.subtract(Dt,it,Eoe),Ne=d.normalize(Cs,uFe);let _i=Ne.x;Ne.x=Ne.y,Ne.y=-_i,ot=aa/F,Xe=me/F}for(z=0;z<8;z++){let _i=q+z*4,ca=j+z*2,Jr=_i+3,El=z<4?1:-1,yo=z===2||z===3||z===6||z===7?1:-1;d.pack(zt.high,b,_i),b[Jr]=Ct.x,d.pack(zt.low,x,_i),x[Jr]=Ct.y,d.pack(Ce,A,_i),A[Jr]=Ct.z,d.pack(mt,C,_i),C[Jr]=so*El,d.pack(_e,S,_i);let Fr=Ro*yo;Fr===0&&yo<0&&(Fr=9),S[Jr]=Fr,s&&(v[_i]=Nr.high.x,v[_i+1]=Nr.high.y,v[_i+2]=Nr.low.x,v[_i+3]=Nr.low.y,M[_i]=-jt.y,M[_i+1]=jt.x,M[_i+2]=$e.y,M[_i+3]=-$e.x,P[_i]=Cs.x,P[_i+1]=Cs.y,P[_i+2]=Ne.x,P[_i+3]=Ne.y,R[ca]=ot*El,Fr=Xe*yo,Fr===0&&yo<0&&(Fr=9),R[ca+1]=Fr)}let Ze=JNe,pt=eFe,Ht=ZNe,Cn=QNe,Mo=ce.fromCartographicArray(KNe,$Ne),Ao=ui.getMinimumMaximumHeights(Mo,u),Za=Ao.minimumTerrainHeight,Qa=Ao.maximumTerrainHeight;Te+=Math.abs(Za),Te+=Math.abs(Qa),yoe(Ee,ze,Za,Qa,Ze,Ht),yoe(te,K,Za,Qa,pt,Cn);let Si=d.multiplyByScalar(_e,O.EPSILON5,Soe);d.add(Ze,Si,Ze),d.add(pt,Si,pt),d.add(Ht,Si,Ht),d.add(Cn,Si,Cn),BV(Ze,pt),BV(Ht,Cn),d.pack(Ze,y,U),d.pack(pt,y,U+3),d.pack(Cn,y,U+6),d.pack(Ht,y,U+9),Si=d.multiplyByScalar(_e,-2*O.EPSILON5,Soe),d.add(Ze,Si,Ze),d.add(pt,Si,pt),d.add(Ht,Si,Ht),d.add(Cn,Si,Cn),BV(Ze,pt),BV(Ht,Cn),d.pack(Ze,y,U+12),d.pack(pt,y,U+15),d.pack(Cn,y,U+18),d.pack(Ht,y,U+21),V+=2,l+=3,j+=16,U+=24,q+=32,ee+=un,me+=aa}l=0;let ue=0;for(a=0;a<f;a++){for(z=0;z<woe;z++)m[l+z]=Moe[z]+ue;ue+=8,l+=woe}let ye=fFe;le.fromVertices(n,d.ZERO,3,ye[0]),le.fromVertices(i,d.ZERO,3,ye[1]);let Ae=le.fromBoundingSpheres(ye);Ae.radius+=Te/(f*2);let Pe={position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:ey(b),startLoAndForwardOffsetY:ey(x),startNormalAndForwardOffsetZ:ey(A),endNormalAndTextureCoordinateNormalizationX:ey(C),rightNormalAndTextureCoordinateNormalizationY:ey(S)};return s&&(Pe.startHiLo2D=ey(v),Pe.offsetAndRight2D=ey(P),Pe.startEndNormals2D=ey(M),Pe.texcoordNormalization2D=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new ct({attributes:Pe,indices:m,boundingSphere:Ae})}function ey(e){return new ve({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ty._projectNormal=gO;var Fb=ty;var yO=`in vec4 v_startPlaneNormalEcAndHalfWidth; +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function tit(e,t){let n=t.context,i=e._primitive,r=RL;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Mn._appendDistanceDisplayConditionToShader(i,r),r=Mn._modifyShaderPosition(e,r,t.scene3DOnly),r=Mn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=eit(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ye({defines:[a],sources:[r]}),u=new Ye({sources:[PA]}),f=e._primitive._attributeLocations,d=new Uf(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ye.createPickVertexShaderSource(r);m=Mn._appendShowToShader(i,m),m=Mn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Mn._appendShowToShader(i,r),c=new Ye({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function nit(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ie.TERRAIN_CLASSIFICATION,s=at.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ie.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Ot(c,y._uniforms)),o.uniformMap=c,s=at.shallowClone(o,o.derivedCommands.tileset),s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let A=at.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=at.shallowClone(s,s.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=at.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function iit(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=at.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=at.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function rit(e,t,n,i,r,o,s){nit(e,o),iit(e,s)}function qbe(e,t){return Math.floor(e%t/2)}function yQ(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Ybe(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function oit(e,t,n,i,r,o,s,a){let c=e._primitive;Mn._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==ti.CESIUM_3D_TILE,p=f!==ti.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[qbe(m,b)],d&&(A=n[m],yQ(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,yQ(A,t,r,o,y,s));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],yQ(A,t,r,o,y,s)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[qbe(m,b)];y=u[T.index],d&&(A=i[m],Ybe(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,Ybe(A,t,r,o,y))}}}bT.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 r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=Uf.hasAttributesForSphericalExtents(c),g=Uf.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Jt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new yn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new Ft({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){Qnt(n,A)},i._createShaderProgramFunction=function(y,A,b){tit(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){rit(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n._updateAndQueueCommandsFunction(y,A,b,x,T,E,v,S)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){oit(n,A,b,x,T,E,v,S)},this._primitive=new Mn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(jS(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(jS(!1,!0)),this._rsColorPass=Ge.fromCache(AQ(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(jS(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(jS(!0,!0)),this._rsColorPass=Ge.fromCache(AQ(!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))})};bT.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};bT.prototype.isDestroyed=function(){return!1};bT.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,ue(this)};var HS=bT;var sit={u_globeMinimumAltitude:function(){return 55e3}};function qu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let s=0;s<o;s++){let a=r[s].attributes;if(l(a)&&l(a.color)){t=new yn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Mi._defaultMaxTerrainHeight,this._minTerrainHeight=Mi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:sit}}Object.defineProperties(qu.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}}});qu.isSupported=HS.isSupported;function Xbe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function Kbe(e){return function(t,n){return e._minHeight}}var ait=new h,cit=new h,lit=new h,uit=new he,fit=new ie;function tG(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,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,ait),g=h.unpack(r,d,cit),m=h.add(p,g,lit),y=n.cartesianToCartographic(m,uit),A=y.latitude,b=y.longitude;s=Math.min(s,A),a=Math.min(a,b),c=Math.max(c,A),u=Math.max(u,b)}let f=fit;return f.north=c,f.south=s,f.east=u,f.west=a,f}function dit(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function hit(e,t,n){let i=t.mapProjection.ellipsoid,r=tG(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ce.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function bQ(e,t){return Math.floor(e%t/2)}function xQ(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function $be(e,t,n,i,r,o){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function mit(e,t,n,i,r,o,s,a){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==ti.CESIUM_3D_TILE,d=u!==ti.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[bQ(m,b)],f&&(A=n[m],xQ(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,xQ(e,A,t,r,o,y,s));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],xQ(e,A,t,r,o,y,s)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[bQ(m,b)],!e._useFragmentCulling){let T=x[bQ(m,b)];y=c[T.index]}f&&(A=i[m],$be(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,$be(e,A,t,r,o,y))}}}qu.initializeTerrainHeights=function(){return Mi.initialize()};qu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){qu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let y=tG(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Mi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}s=o.constructor,!l(s)||l(s.createShadowVolume)}dit(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Ar.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Ar.getHeight(this._maxTerrainHeight,p,g);let m=qu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=tG(e,o),Uf.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=tG(e,o),x=o.textureCoordinateRotationPoints;A?y=Uf.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Uf.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let E in T)T.hasOwnProperty(E)&&(y[E]=T[E]);u[f]=new Ft({geometry:s.createShadowVolume(o,Kbe(this),Xbe(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Ft({geometry:s.createShadowVolume(o,Kbe(this),Xbe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){hit(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){mit(t,A,b,x,T,E,v,S)},this._primitive=new HS(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))})};qu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};qu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};qu.prototype.isDestroyed=function(){return!1};qu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};qu._supportsMaterials=function(e){return e.depthTexture};qu.supportsMaterials=function(e){return qu._supportsMaterials(e.frameState.context)};var tu=qu;function GS(){pe.throwInstantiationError()}Object.defineProperties(GS.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});GS.prototype.getType=pe.throwInstantiationError;GS.prototype.getValue=pe.throwInstantiationError;GS.prototype.equals=pe.throwInstantiationError;var pit=new K;GS.getValue=function(e,t,n){let i;return l(e)||(e=K.now(pit)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=or.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==or.ColorType)&&(n=or.fromType(or.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Ao=GS;function xT(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}xT.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};xT.prototype._setOptions=pe.throwInstantiationError;xT.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,d,p=t._getIsClosed(c);if(f)d=new yn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Ao.getValue(e,u,this._material);this._material=g,d=new Er({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=yn.VERTEX_FORMAT,this._primitive=r.add(new tu({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Mn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Mn({geometryInstances:u,appearance:new yn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};xT.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ce.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ce.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};xT.prototype.isDestroyed=function(){return!1};xT.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),ue(this)};var Ii=xT;var LL=`in vec4 v_startPlaneNormalEcAndHalfWidth; in vec4 v_endPlaneNormalEcAndBatchId; in vec4 v_rightPlaneEC; in vec4 v_endEcAndStartEcX; @@ -2822,7 +4108,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); } -`;var bO=`in vec3 v_forwardDirectionEC; +`;var FL=`in vec3 v_forwardDirectionEC; in vec3 v_texcoordNormalizationAndHalfWidth; in float v_batchId; #ifdef PER_INSTANCE_COLOR @@ -2855,7 +4141,7 @@ czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #endif // PER_INSTANCE_COLOR } -`;var xO=`in vec3 position3DHigh; +`;var BL=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 startHiAndForwardOffsetX; in vec4 startLoAndForwardOffsetY; @@ -2975,7 +4261,7 @@ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && ap v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var TO=`in vec3 position3DHigh; +`;var kL=`in vec3 position3DHigh; in vec3 position3DLow; #ifndef COLUMBUS_VIEW_2D in vec4 startHiAndForwardOffsetX; @@ -3079,7 +4365,7 @@ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && ap v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var AO=`in vec3 position3DHigh; +`;var UL=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 prevPosition3DHigh; in vec3 prevPosition3DLow; @@ -3102,119 +4388,9 @@ vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, gl_Position = czm_viewportOrthographic * positionWC; v_color = color; } -`;var xu=`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); -float endPoint0Distance = czm_currentFrustum.x + p0.z; -float denominator = -direction.z; -if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) -{ -culledByNearPlane = true; -} -else if (endPoint0Distance > 0.0) -{ -float t = endPoint0Distance / denominator; -if (t < 0.0 || t > magnitude) -{ -culledByNearPlane = true; -} -else -{ -p0 = p0 + t * direction; -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) -{ -#ifdef POLYLINE_DASH -vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); -vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); -vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); -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; -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 (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; -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); -vec2 u = -thisSegmentForwardWC; -vec2 v = leftWC; -float sinAngle = abs(u.x * v.y - u.y * v.x); -expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); -} -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 B6=`${xu} -${AO}`,hFe=Ob;Vt.isInternetExplorer()||(B6=`#define CLIP_POLYLINE -${B6}`);function Bb(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Bb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??B6,this._fragmentShaderSource=e.fragmentShaderSource??hFe,this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Bb.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}}});Bb.VERTEX_FORMAT=Ie.POSITION_ONLY;Bb.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Bb.prototype.isTranslucent=io.prototype.isTranslucent;Bb.prototype.getRenderState=io.prototype.getRenderState;var is=Bb;var CO=`in vec3 position3DHigh; +`;var git=`#define CLIP_POLYLINE +${eu} +${UL}`,_it=_T;function TT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=TT.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??git,this._fragmentShaderSource=e.fragmentShaderSource??_it,this._renderState=Dr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(TT.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}}});TT.VERTEX_FORMAT=Be.POSITION_ONLY;TT.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;TT.prototype.isTranslucent=Dr.prototype.isTranslucent;TT.prototype.getRenderState=Dr.prototype.getRenderState;var Ws=TT;var zL=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 prevPosition3DHigh; in vec3 prevPosition3DLow; @@ -3242,7 +4418,7 @@ v_st.s = st.s; v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); v_polylineAngle = angle; } -`;var kb=`#ifdef VECTOR_TILE +`;var ET=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_st; @@ -3261,11 +4437,10 @@ out_FragColor *= u_highlightColor; #endif czm_writeLogDepth(); } -`;var k6=`${xu} -${CO}`,mFe=kb;Vt.isInternetExplorer()||(k6=`#define CLIP_POLYLINE -${k6}`);function Ub(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ub.VERTEX_FORMAT;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??k6,this._fragmentShaderSource=e.fragmentShaderSource??mFe,this._renderState=io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ub.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}}});Ub.VERTEX_FORMAT=Ie.POSITION_AND_ST;Ub.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;Ub.prototype.isTranslucent=io.prototype.isTranslucent;Ub.prototype.getRenderState=io.prototype.getRenderState;var ha=Ub;function zp(e){e=e??W.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;c(t)||(t=new ha),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=Loe(!1),this._renderState3DTiles=Loe(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(zp.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}}});zp.initializeTerrainHeights=function(){return ui.initialize()};function pFe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(TO);s=Pn._appendShowToShader(o,s),s=Pn._appendDistanceDisplayConditionToShader(o,s),s=Pn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(xO);a=Pn._appendShowToShader(o,a),a=Pn._appendDistanceDisplayConditionToShader(o,a),a=Pn._modifyShaderPosition(e,a,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(yO),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";c(n.material)?(h=c(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new He({defines:u,sources:[s]}),m=new He({defines:p,sources:[h,l]});e._sp=Jt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!c(y)){let x=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:x,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=y;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!c(b)){let x=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${ui._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});l=o._batchTable.getVertexShaderCallback()(bO);let A=new He({defines:p,sources:[h,l]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:r})}e._spMorph=b}function Loe(e){return Ve.fromCache({cull:{enabled:!0},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function _Fe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof is?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h<a;h++){let p=s._va[h],g=o[h];c(g)||(g=o[h]=new Qe({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=De.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=Qe.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=De.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=Qe.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let b=Qe.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let x=Qe.shallowClone(g,g.derivedCommands.colorMorph);x.renderState=e._renderStateMorph,x.shaderProgram=e._spMorph,x.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=x}}function Noe(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 gFe(e,t,n,i,o,r,s){let a=e._primitive;Pn._updateBoundingVolumes(a,t,o);let l;t.mode===oe.SCENE3D?l=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?l=a._boundingSphereCV:t.mode===oe.SCENE2D&&c(a._boundingSphere2D)?l=a._boundingSphere2D:c(a._boundingSphereMorph)&&(l=a._boundingSphereMorph);let u=t.mode===oe.MORPHING,f=e.classificationType,h=f!==Un.CESIUM_3D_TILE,p=f!==Un.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let b=0;b<y;++b){let x=l[b];h&&(g=n[b],Noe(e,g,t,o,r,x,s)),p&&(g=n[b].derivedCommands.tileset,Noe(e,g,t,o,r,x,s))}}}zp.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!ui.initialized){if(!this.asynchronous)throw new E("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");zp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!c(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,!c(a)||!c(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let l=o[t];a={};let u=l.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);c(a.width)||(a.width=new hc({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,Fb.setProjectionAndEllipsoid(l.geometry,e.mapProjection),s[t]=new St({geometry:l.geometry,attributes:a,id:l.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,f){pFe(n,u,f)},i._createCommandsFunction=function(l,u,f,h,p,g,m){_Fe(n,u,f,h,g,m)},i._updateAndQueueCommandsFunction=function(l,u,f,h,p,g,m,y){gFe(n,u,f,h,p,g,m)},this._primitive=new Pn(i)}if(this.appearance instanceof is&&!this._hasPerInstanceColors)throw new E("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&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};zp.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new E("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};zp.isSupported=function(e){return e.frameState.context.depthTexture};zp.prototype.isDestroyed=function(){return!1};zp.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,de(this)};var Vd=zp;var yFe=new H(1,1),bFe=!1,xFe=G.WHITE;function vC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(vC.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:fe("image"),repeat:fe("repeat"),color:fe("color"),transparent:fe("transparent")});vC.prototype.getType=function(e){return"Image"};var TFe=new Q;vC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(TFe)),c(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,yFe,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,xFe,t.color),X.getValueOrDefault(this._transparent,e,bFe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};vC.prototype.equals=function(e){return this===e||e instanceof vC&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var ny=vC;function AFe(e){if(e instanceof G)return new Ut(e);if(typeof e=="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new ny;return t.image=e,t}throw new E(`Unable to infer material type: ${e}`)}function CFe(e,t){return fe(e,t,AFe)}var No=CFe;function EO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(EO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),dimensions:fe("dimensions"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});EO.prototype.clone=function(e){return c(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 EO(this)};EO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Vb=EO;var EFe={FIXED:0,INERTIAL:1},Hi=Object.freeze(EFe);function DC(){E.throwInstantiationError()}Object.defineProperties(DC.prototype,{isConstant:{get:E.throwInstantiationError},definitionChanged:{get:E.throwInstantiationError},referenceFrame:{get:E.throwInstantiationError}});DC.prototype.getValue=E.throwInstantiationError;DC.prototype.getValueInReferenceFrame=E.throwInstantiationError;DC.prototype.equals=E.throwInstantiationError;var Foe=new J;DC.convertToReferenceFrame=function(e,t,n,i,o){if(!c(t))return t;if(c(o)||(o=new d),n===i)return d.clone(t,o);let r=Ot.computeIcrfToCentralBodyFixedMatrix(e,Foe);if(n===Hi.INERTIAL)return J.multiplyByVector(r,t,o);if(n===Hi.FIXED)return J.multiplyByVector(J.transpose(r,Foe),t,o)};var zd=DC;function zb(e,t){this._definitionChanged=new pe,this._value=d.clone(e),this._referenceFrame=t??Hi.FIXED}Object.defineProperties(zb.prototype,{isConstant:{get:function(){return!c(this._value)||this._referenceFrame===Hi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var SFe=new Q;zb.prototype.getValue=function(e,t){return c(e)||(e=Q.now(SFe)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};zb.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),c(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};zb.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");return zd.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};zb.prototype.equals=function(e){return this===e||e instanceof zb&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var qc=zb;function SO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(SO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});SO.prototype.clone=function(e){return c(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 SO(this)};SO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Hb=SO;function wFe(e){return e}function vFe(e,t){return fe(e,t,wFe)}var Yc=vFe;function wO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(wO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),length:fe("length"),topRadius:fe("topRadius"),bottomRadius:fe("bottomRadius"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),slices:fe("slices"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});wO.prototype.clone=function(e){return c(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 wO(this)};wO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Gb=wO;function vO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(vO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),semiMajorAxis:fe("semiMajorAxis"),semiMinorAxis:fe("semiMinorAxis"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});vO.prototype.clone=function(e){return c(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 vO(this)};vO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var jb=vO;function DO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(DO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),radii:fe("radii"),innerRadii:fe("innerRadii"),minimumClock:fe("minimumClock"),maximumClock:fe("maximumClock"),minimumCone:fe("minimumCone"),maximumCone:fe("maximumCone"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),stackPartitions:fe("stackPartitions"),slicePartitions:fe("slicePartitions"),subdivisions:fe("subdivisions"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});DO.prototype.clone=function(e){return c(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 DO(this)};DO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Wb=DO;function PO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(PO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),text:fe("text"),font:fe("font"),style:fe("style"),scale:fe("scale"),showBackground:fe("showBackground"),backgroundColor:fe("backgroundColor"),backgroundPadding:fe("backgroundPadding"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),fillColor:fe("fillColor"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),scaleByDistance:fe("scaleByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance")});PO.prototype.clone=function(e){return c(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 PO(this)};PO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Hd=PO;var DFe=new d(1,1,1),PFe=d.ZERO,IFe=Le.IDENTITY;function Boe(e,t,n){this.translation=d.clone(e??PFe),this.rotation=Le.clone(t??IFe),this.scale=d.clone(n??DFe)}Boe.prototype.equals=function(e){return this===e||c(e)&&d.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var iy=Boe;var U6=new iy;function IO(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(IO.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:fe("translation"),rotation:fe("rotation"),scale:fe("scale")});var OFe=new Q;IO.prototype.getValue=function(e,t){return c(e)||(e=Q.now(OFe)),c(t)||(t=new iy),t.translation=X.getValueOrClonedDefault(this._translation,e,U6.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,U6.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,U6.scale,t.scale),t};IO.prototype.equals=function(e){return this===e||e instanceof IO&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var qb=IO;function Hp(e,t){this._propertyNames=[],this._definitionChanged=new pe,c(e)&&this.merge(e,t)}Object.defineProperties(Hp.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(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Hp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function RFe(e){return new Kn(e)}Hp.prototype.addProperty=function(e,t,n){let i=this._propertyNames;if(!c(e))throw new E("propertyName is required.");if(i.indexOf(e)!==-1)throw new E(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,fe(e,!0,n??RFe)),c(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Hp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new E("propertyName is required.");if(n===-1)throw new E(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var MFe=new Q;Hp.prototype.getValue=function(e,t){c(e)||(e=Q.now(MFe)),c(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=X.getValueOrUndefined(this[r],e,t[r])}return t};Hp.prototype.merge=function(e,t){if(!c(e))throw new E("source is required.");let n=this._propertyNames,i=c(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],l=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),l!==void 0&&(a!==void 0?c(a)&&c(a.merge)&&a.merge(l):c(l)&&c(l.merge)&&c(l.clone)?this[s]=l.clone():this[s]=l)}};function LFe(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||!X.equals(e[s],t[s]))return!1}return!0}Hp.prototype.equals=function(e){return this===e||e instanceof Hp&&LFe(this,e)};var Xc=Hp;function koe(e){return new qb(e)}function NFe(e){return new Xc(e,koe)}function FFe(e){return new Xc(e)}function BFe(e){return new Xc(e)}function OO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(OO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),scale:fe("scale"),enableVerticalExaggeration:fe("enableVerticalExaggeration"),minimumPixelSize:fe("minimumPixelSize"),maximumScale:fe("maximumScale"),incrementallyLoadTextures:fe("incrementallyLoadTextures"),runAnimations:fe("runAnimations"),clampAnimations:fe("clampAnimations"),shadows:fe("shadows"),heightReference:fe("heightReference"),silhouetteColor:fe("silhouetteColor"),silhouetteSize:fe("silhouetteSize"),color:fe("color"),colorBlendMode:fe("colorBlendMode"),colorBlendAmount:fe("colorBlendAmount"),imageBasedLightingFactor:fe("imageBasedLightingFactor"),environmentMapOptions:fe("environmentMapOptions",void 0,BFe),lightColor:fe("lightColor"),distanceDisplayCondition:fe("distanceDisplayCondition"),nodeTransformations:fe("nodeTransformations",void 0,NFe),articulations:fe("articulations",void 0,FFe),clippingPlanes:fe("clippingPlanes"),customShader:fe("customShader")});OO.prototype.clone=function(e){return c(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 OO(this)};OO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(c(t)){let i=this.nodeTransformations;c(i)?i.merge(t):this.nodeTransformations=new Xc(t,koe)}let n=e.articulations;if(c(n)){let i=this.articulations;c(i)?i.merge(n):this.articulations=new Xc(n)}};var Gp=OO;function RO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(RO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),maximumScreenSpaceError:fe("maximumScreenSpaceError")});RO.prototype.clone=function(e){return c(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new RO(this)};RO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Yb=RO;function MO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(MO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),leadTime:fe("leadTime"),trailTime:fe("trailTime"),width:fe("width"),resolution:fe("resolution"),material:No("material"),distanceDisplayCondition:fe("distanceDisplayCondition")});MO.prototype.clone=function(e){return c(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 MO(this)};MO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var jp=MO;function LO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(LO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),plane:fe("plane"),dimensions:fe("dimensions"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});LO.prototype.clone=function(e){return c(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 LO(this)};LO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var NO=LO;function FO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(FO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),pixelSize:fe("pixelSize"),heightReference:fe("heightReference"),color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});FO.prototype.clone=function(e){return c(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 FO(this)};FO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Xb=FO;function kFe(e,t){this.positions=c(e)?e:[],this.holes=c(t)?t:[]}var ka=kFe;function UFe(e){return Array.isArray(e)&&(e=new ka(e)),new Kn(e)}function BO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(BO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),hierarchy:fe("hierarchy",void 0,UFe),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),perPositionHeight:fe("perPositionHeight"),closeTop:fe("closeTop"),closeBottom:fe("closeBottom"),arcType:fe("arcType"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex"),textureCoordinates:fe("textureCoordinates")});BO.prototype.clone=function(e){return c(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 BO(this)};BO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var Gd=BO;function kO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(kO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),granularity:fe("granularity"),material:No("material"),depthFailMaterial:No("depthFailMaterial"),arcType:fe("arcType"),clampToGround:fe("clampToGround"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});kO.prototype.clone=function(e){return c(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 kO(this)};kO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var mc=kO;function UO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(UO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),shape:fe("shape"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});UO.prototype.clone=function(e){return c(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 UO(this)};UO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Kb=UO;function VO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(VO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),coordinates:fe("coordinates"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});VO.prototype.clone=function(e){return c(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 VO(this)};VO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var jd=VO;function zO(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(zO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),minimumHeights:fe("minimumHeights"),maximumHeights:fe("maximumHeights"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});zO.prototype.clone=function(e){return c(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 zO(this)};zO.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Wp=zO;var VFe=new he,V6=[];function zFe(e){return new qc(e)}function HFe(e){return fe(e,void 0,zFe)}function js(e,t){return fe(e,void 0,function(n){return n instanceof t?n:new t(n)})}function If(e){e=e??W.EMPTY_OBJECT;let t=e.id;c(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new pe,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Bp.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",...V6],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 z6(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)&&z6(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(If.prototype,{availability:Yc("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Yc("name"),show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&z6(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Yc("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!c(this.entityCollection)||this.entityCollection.show)&&(!c(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(c(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,c(e)&&e._children.push(this);let i=this.isShowing;n!==i&&z6(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:js("billboard",fc),box:js("box",Vb),corridor:js("corridor",Hb),cylinder:js("cylinder",Gb),description:fe("description"),ellipse:js("ellipse",jb),ellipsoid:js("ellipsoid",Wb),label:js("label",Hd),model:js("model",Gp),tileset:js("tileset",Yb),orientation:fe("orientation"),path:js("path",jp),plane:js("plane",NO),point:js("point",Xb),polygon:js("polygon",Gd),polyline:js("polyline",mc),polylineVolume:js("polylineVolume",Kb),properties:js("properties",Xc),position:HFe("position"),rectangle:js("rectangle",jd),viewFrom:fe("viewFrom"),wall:js("wall",Wp)});If.registerEntityType=function(e,t){Object.defineProperties(If.prototype,{[e]:js(e,t)}),V6.includes(e)||V6.push(e)};If.prototype.isAvailable=function(e){if(!c(e))throw new E("time is required.");let t=this._availability;return!c(t)||t.contains(e)};If.prototype.addProperty=function(e){let t=this._propertyNames;if(!c(e))throw new E("propertyName is required.");if(t.indexOf(e)!==-1)throw new E(`${e} is already a registered property.`);if(e in this)throw new E(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,Yc(e,!0))};If.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new E("propertyName is required.");if(n===-1)throw new E(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]};If.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=c(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];!c(s)&&t.indexOf(r)===-1&&this.addProperty(r),c(a)&&(c(s)?c(s.merge)&&s.merge(a):c(a.merge)&&c(a.clone)?this[r]=a.clone():this[r]=a)}};var Uoe=new J,Voe=new d,zoe=new Le;If.prototype.computeModelMatrix=function(e,t){T.typeOf.object("time",e);let n=X.getValueOrUndefined(this._position,e,Voe);if(!c(n))return;let i=X.getValueOrUndefined(this._orientation,e,zoe);return c(i)?t=B.fromRotationTranslation(J.fromQuaternion(i,Uoe),n,t):t=Ot.eastNorthUpToFixedFrame(n,void 0,t),t};If.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){T.typeOf.object("time",e);let r=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,Voe);if(r===We.NONE||!c(s)||d.equalsEpsilon(s,d.ZERO,O.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,VFe);r===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):Df(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let l=X.getValueOrUndefined(this._orientation,e,zoe);return c(l)?o=B.fromRotationTranslation(J.fromQuaternion(l,Uoe),s,o):o=Ot.eastNorthUpToFixedFrame(s,void 0,o),o};If.supportsMaterialsforEntitiesOnTerrain=function(e){return jc.supportsMaterials(e)};If.supportsPolylinesOnTerrain=function(e){return Vd.isSupported(e)};var nr=If;var GFe=new Ut(G.WHITE),jFe=new Kn(!0),WFe=new Kn(!0),qFe=new Kn(!1),YFe=new Kn(G.BLACK),XFe=new Kn(xn.DISABLED),KFe=new Kn(new Mt),$Fe=new Kn(Un.BOTH);function Kc(e){T.defined("options.entity",e.entity),T.defined("options.scene",e.scene),T.defined("options.geometryOptions",e.geometryOptions),T.defined("options.geometryPropertyName",e.geometryPropertyName),T.defined("options.observedPropertyNames",e.observedPropertyNames);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 pe,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=nr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Kc.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||!c(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!c(this._entity.availability)&&X.isConstant(this._showProperty)&&X.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}}});Kc.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Kc.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Kc.prototype.createFillGeometryInstance=E.throwInstantiationError;Kc.prototype.createOutlineGeometryInstance=E.throwInstantiationError;Kc.prototype.isDestroyed=function(){return!1};Kc.prototype.destroy=function(){de(this)};Kc.prototype._isHidden=function(e,t){let n=t.show;return c(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};Kc.prototype._isOnTerrain=function(e,t){return!1};Kc.prototype._getIsClosed=function(e){return!0};Kc.prototype._isDynamic=E.throwInstantiationError;Kc.prototype._setStaticOptions=E.throwInstantiationError;Kc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=c(r)&&r.isConstant?r.getValue(Ge.MINIMUM_VALUE):!0,a=o.outline,l=c(a);if(l&&a.isConstant&&(l=a.getValue(Ge.MINIMUM_VALUE)),!s&&!l){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??GFe,this._fillProperty=r??WFe,this._showProperty=u??jFe,this._showOutlineProperty=o.outline??qFe,this._outlineColorProperty=l?o.outlineColor??YFe:void 0,this._shadowsProperty=o.shadows??XFe,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??KFe,this._classificationTypeProperty=o.classificationType??$Fe,this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(l&&f&&(dt(dt.geometryOutlines),l=!1),this._onTerrain=f,this._outlineEnabled=l,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=c(h)?h.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Kc.prototype.createDynamicUpdater=function(e,t){if(T.defined("primitives",e),T.defined("groundPrimitives",t),!this._dynamic)throw new E("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ii=Kc;function PC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(PC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var ZFe=new Q;PC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(ZFe)),this._callback(e,t)};PC.prototype.setCallback=function(e,t){if(!c(e))throw new E("callback is required.");if(!c(t))throw new E("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};PC.prototype.equals=function(e){return this===e||e instanceof PC&&this._callback===e._callback&&this._isConstant===e._isConstant};var Wd=PC;var Hoe=new d;function IC(e,t,n,i){T.defined("scene",e),T.defined("positionProperty",t),this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new he,this._normal=new d,this._definitionChanged=new pe,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(c(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ge.MINIMUM_VALUE,Hoe);if(!c(r)||d.equals(r,d.ZERO)||!c(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(IC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});IC.prototype._updateClamping=function(){c(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);c(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 QFe=new Q;IC.prototype.getValue=function(e,t){c(e)||(e=Q.now(QFe));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!gC(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Hoe);if(!c(r)||d.equals(r,d.ZERO)||!c(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,O.EPSILON10)&&n!==We.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===We.CLIP_TO_GROUND){let l=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=l.height?d.multiplyByScalar(s,this._terrainHeight-l.height,t):d.clone(d.ZERO,t)}return d.multiplyByScalar(s,this._terrainHeight,t)};IC.prototype.isDestroyed=function(){return!1};IC.prototype.destroy=function(){return c(this._removeEventListener)&&this._removeEventListener(),c(this._removeModeListener)&&this._removeModeListener(),c(this._removeCallbackFunc)&&this._removeCallbackFunc(),de(this)};var $b=IC;function JFe(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(c(r)){let s=new Wd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new $b(this._scene,s,r)}}var qp=JFe;var Goe=d.ZERO,joe=new d,e2e=new d,Woe=new G;function t2e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Tu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new t2e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}c(Object.create)&&(Tu.prototype=Object.create(ii.prototype),Tu.prototype.constructor=Tu);Object.defineProperties(Tu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Tu.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Woe)),c(a)||(a=G.WHITE),s.color=Gt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Goe,joe))),new St({id:t,geometry:La.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Tu.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Woe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Goe,joe))),new St({id:t,geometry:Ud.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Tu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Tu.prototype._isHidden=function(e,t){return!c(t.dimensions)||!c(e.position)||ii.prototype._isHidden.call(this,e,t)};Tu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Tu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?Zt.ALL:void 0};Tu.prototype._onEntityPropertyChanged=qp;Tu.DynamicGeometryUpdater=OC;function OC(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(OC.prototype=Object.create(ni.prototype),OC.prototype.constructor=OC);OC.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,e2e),o=this._options.dimensions;return!c(i)||!c(o)||ni.prototype._isHidden.call(this,e,t,n)};OC.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),o=this._options;o.dimensions=X.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==We.NONE?Zt.ALL:void 0};var HO=Tu;function Zb(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Hi.FIXED,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(Zb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var n2e=new Q;Zb.prototype.getValue=function(e,t){return c(e)||(e=Q.now(n2e)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};Zb.prototype.setCallback=function(e,t){if(!c(e))throw new E("callback is required.");if(!c(t))throw new E("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Zb.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");let i=this._callback(e,n);return zd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Zb.prototype.equals=function(e){return this===e||e instanceof Zb&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var GO=Zb;/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */var{entries:tre,setPrototypeOf:qoe,isFrozen:i2e,getPrototypeOf:o2e,getOwnPropertyDescriptor:r2e}=Object,{freeze:Zc,seal:Of,create:nre}=Object,{apply:Y6,construct:X6}=typeof Reflect<"u"&&Reflect;Zc||(Zc=function(t){return t});Of||(Of=function(t){return t});Y6||(Y6=function(t,n,i){return t.apply(n,i)});X6||(X6=function(t,n){return new t(...n)});var UV=Au(Array.prototype.forEach),Yoe=Au(Array.prototype.pop),jO=Au(Array.prototype.push),zV=Au(String.prototype.toLowerCase),H6=Au(String.prototype.toString),Xoe=Au(String.prototype.match),WO=Au(String.prototype.replace),s2e=Au(String.prototype.indexOf),a2e=Au(String.prototype.trim),qd=Au(Object.prototype.hasOwnProperty),$c=Au(RegExp.prototype.test),qO=c2e(TypeError);function Au(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 Y6(e,t,i)}}function c2e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return X6(e,n)}}function Li(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zV;qoe&&qoe(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(i2e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function l2e(e){for(let t=0;t<e.length;t++)qd(e,t)||(e[t]=null);return e}function Qb(e){let t=nre(null);for(let[n,i]of tre(e))qd(e,n)&&(Array.isArray(i)?t[n]=l2e(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Qb(i):t[n]=i);return t}function YO(e,t){for(;e!==null;){let i=r2e(e,t);if(i){if(i.get)return Au(i.get);if(typeof i.value=="function")return Au(i.value)}e=o2e(e)}function n(){return null}return n}var Koe=Zc(["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"]),G6=Zc(["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"]),j6=Zc(["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"]),u2e=Zc(["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"]),W6=Zc(["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"]),f2e=Zc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$oe=Zc(["#text"]),Zoe=Zc(["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"]),q6=Zc(["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"]),Qoe=Zc(["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"]),VV=Zc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),d2e=Of(/\{\{[\w\W]*|[\w\W]*\}\}/gm),h2e=Of(/<%[\w\W]*|[\w\W]*%>/gm),m2e=Of(/\$\{[\w\W]*}/gm),p2e=Of(/^data-[\-\w.\u00B7-\uFFFF]+$/),_2e=Of(/^aria-[\-\w]+$/),ire=Of(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),g2e=Of(/^(?:\w+script|data):/i),y2e=Of(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ore=Of(/^html$/i),b2e=Of(/^[a-z][.\w]*(-[.\w]+)+$/i),Joe=Object.freeze({__proto__:null,ARIA_ATTR:_2e,ATTR_WHITESPACE:y2e,CUSTOM_ELEMENT:b2e,DATA_ATTR:p2e,DOCTYPE_NAME:ore,ERB_EXPR:h2e,IS_ALLOWED_URI:ire,IS_SCRIPT_OR_DATA:g2e,MUSTACHE_EXPR:d2e,TMPLIT_EXPR:m2e}),XO={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},x2e=function(){return typeof window>"u"?null:window},T2e=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}},ere=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function rre(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x2e(),t=cn=>rre(cn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==XO.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,m=l.prototype,y=YO(m,"cloneNode"),b=YO(m,"remove"),x=YO(m,"nextSibling"),A=YO(m,"childNodes"),C=YO(m,"parentNode");if(typeof s=="function"){let cn=n.createElement("template");cn.content&&cn.content.ownerDocument&&(n=cn.content.ownerDocument)}let S,v="",{implementation:P,createNodeIterator:M,createDocumentFragment:R,getElementsByTagName:L}=n,{importNode:F}=i,_=ere();t.isSupported=typeof tre=="function"&&typeof C=="function"&&P&&P.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:w,ERB_EXPR:D,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:z,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:j}=Joe,{IS_ALLOWED_URI:U}=Joe,q=null,Y=Li({},[...Koe,...G6,...j6,...W6,...$oe]),te=null,K=Li({},[...Zoe,...q6,...Qoe,...VV]),Z=Object.seal(nre(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,me=null,Te=!0,ue=!0,ye=!1,Ae=!0,Pe=!1,Ee=!0,ze=!1,qe=!1,it=!1,Dt=!1,jt=!1,$e=!1,un=!0,zt=!1,Ct="user-content-",Ei=!0,an=!1,_e={},Ce=null,pn=Li({},["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"]),mt=null,so=Li({},["audio","video","img","source","image","track"]),Ro=null,aa=Li({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nr="http://www.w3.org/1998/Math/MathML",Cs="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",ot=Ne,Xe=!1,Ze=null,pt=Li({},[Nr,Cs,Ne],H6),Ht=Li({},["mi","mo","mn","ms","mtext"]),Cn=Li({},["annotation-xml"]),Mo=Li({},["title","style","font","a","script"]),Ao=null,Za=["application/xhtml+xml","text/html"],Qa="text/html",Si=null,_i=null,ca=n.createElement("form"),Jr=function(Se){return Se instanceof RegExp||Se instanceof Function},El=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_i&&_i===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=Qb(Se),Ao=Za.indexOf(Se.PARSER_MEDIA_TYPE)===-1?Qa:Se.PARSER_MEDIA_TYPE,Si=Ao==="application/xhtml+xml"?H6:zV,q=qd(Se,"ALLOWED_TAGS")?Li({},Se.ALLOWED_TAGS,Si):Y,te=qd(Se,"ALLOWED_ATTR")?Li({},Se.ALLOWED_ATTR,Si):K,Ze=qd(Se,"ALLOWED_NAMESPACES")?Li({},Se.ALLOWED_NAMESPACES,H6):pt,Ro=qd(Se,"ADD_URI_SAFE_ATTR")?Li(Qb(aa),Se.ADD_URI_SAFE_ATTR,Si):aa,mt=qd(Se,"ADD_DATA_URI_TAGS")?Li(Qb(so),Se.ADD_DATA_URI_TAGS,Si):so,Ce=qd(Se,"FORBID_CONTENTS")?Li({},Se.FORBID_CONTENTS,Si):pn,ee=qd(Se,"FORBID_TAGS")?Li({},Se.FORBID_TAGS,Si):{},me=qd(Se,"FORBID_ATTR")?Li({},Se.FORBID_ATTR,Si):{},_e=qd(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,Te=Se.ALLOW_ARIA_ATTR!==!1,ue=Se.ALLOW_DATA_ATTR!==!1,ye=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=Se.SAFE_FOR_TEMPLATES||!1,Ee=Se.SAFE_FOR_XML!==!1,ze=Se.WHOLE_DOCUMENT||!1,Dt=Se.RETURN_DOM||!1,jt=Se.RETURN_DOM_FRAGMENT||!1,$e=Se.RETURN_TRUSTED_TYPE||!1,it=Se.FORCE_BODY||!1,un=Se.SANITIZE_DOM!==!1,zt=Se.SANITIZE_NAMED_PROPS||!1,Ei=Se.KEEP_CONTENT!==!1,an=Se.IN_PLACE||!1,U=Se.ALLOWED_URI_REGEXP||ire,ot=Se.NAMESPACE||Ne,Ht=Se.MATHML_TEXT_INTEGRATION_POINTS||Ht,Cn=Se.HTML_INTEGRATION_POINTS||Cn,Z=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&Jr(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&Jr(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(ue=!1),jt&&(Dt=!0),_e&&(q=Li({},$oe),te=[],_e.html===!0&&(Li(q,Koe),Li(te,Zoe)),_e.svg===!0&&(Li(q,G6),Li(te,q6),Li(te,VV)),_e.svgFilters===!0&&(Li(q,j6),Li(te,q6),Li(te,VV)),_e.mathMl===!0&&(Li(q,W6),Li(te,Qoe),Li(te,VV))),Se.ADD_TAGS&&(q===Y&&(q=Qb(q)),Li(q,Se.ADD_TAGS,Si)),Se.ADD_ATTR&&(te===K&&(te=Qb(te)),Li(te,Se.ADD_ATTR,Si)),Se.ADD_URI_SAFE_ATTR&&Li(Ro,Se.ADD_URI_SAFE_ATTR,Si),Se.FORBID_CONTENTS&&(Ce===pn&&(Ce=Qb(Ce)),Li(Ce,Se.FORBID_CONTENTS,Si)),Ei&&(q["#text"]=!0),ze&&Li(q,["html","head","body"]),q.table&&(Li(q,["tbody"]),delete ee.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw qO('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qO('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Se.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=T2e(g,o)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Zc&&Zc(Se),_i=Se}},yo=Li({},[...G6,...j6,...u2e]),Fr=Li({},[...W6,...f2e]),xp=function(Se){let Pt=C(Se);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:ot,tagName:"template"});let _n=zV(Se.tagName),Ar=zV(Pt.tagName);return Ze[Se.namespaceURI]?Se.namespaceURI===Cs?Pt.namespaceURI===Ne?_n==="svg":Pt.namespaceURI===Nr?_n==="svg"&&(Ar==="annotation-xml"||Ht[Ar]):!!yo[_n]:Se.namespaceURI===Nr?Pt.namespaceURI===Ne?_n==="math":Pt.namespaceURI===Cs?_n==="math"&&Cn[Ar]:!!Fr[_n]:Se.namespaceURI===Ne?Pt.namespaceURI===Cs&&!Cn[Ar]||Pt.namespaceURI===Nr&&!Ht[Ar]?!1:!Fr[_n]&&(Mo[_n]||!yo[_n]):!!(Ao==="application/xhtml+xml"&&Ze[Se.namespaceURI]):!1},es=function(Se){jO(t.removed,{element:Se});try{C(Se).removeChild(Se)}catch{b(Se)}},hf=function(Se,Pt){try{jO(t.removed,{attribute:Pt.getAttributeNode(Se),from:Pt})}catch{jO(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Se),Se==="is")if(Dt||jt)try{es(Pt)}catch{}else try{Pt.setAttribute(Se,"")}catch{}},Ja=function(Se){let Pt=null,_n=null;if(it)Se="<remove></remove>"+Se;else{let Ia=Xoe(Se,/^[\r\n\t ]+/);_n=Ia&&Ia[0]}Ao==="application/xhtml+xml"&&ot===Ne&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");let Ar=S?S.createHTML(Se):Se;if(ot===Ne)try{Pt=new p().parseFromString(Ar,Ao)}catch{}if(!Pt||!Pt.documentElement){Pt=P.createDocument(ot,"template",null);try{Pt.documentElement.innerHTML=Xe?v:Ar}catch{}}let tc=Pt.body||Pt.documentElement;return Se&&_n&&tc.insertBefore(n.createTextNode(_n),tc.childNodes[0]||null),ot===Ne?L.call(Pt,ze?"html":"body")[0]:ze?Pt.documentElement:tc},tb=function(Se){return M.call(Se.ownerDocument||Se,Se,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},la=function(Se){return Se instanceof h&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof f)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},Sl=function(Se){return typeof a=="function"&&Se instanceof a};function ec(cn,Se,Pt){UV(cn,_n=>{_n.call(t,Se,Pt,_i)})}let hs=function(Se){let Pt=null;if(ec(_.beforeSanitizeElements,Se,null),la(Se))return es(Se),!0;let _n=Si(Se.nodeName);if(ec(_.uponSanitizeElement,Se,{tagName:_n,allowedTags:q}),Se.hasChildNodes()&&!Sl(Se.firstElementChild)&&$c(/<[/\w]/g,Se.innerHTML)&&$c(/<[/\w]/g,Se.textContent)||Se.nodeType===XO.progressingInstruction||Ee&&Se.nodeType===XO.comment&&$c(/<[/\w]/g,Se.data))return es(Se),!0;if(!q[_n]||ee[_n]){if(!ee[_n]&&pf(_n)&&(Z.tagNameCheck instanceof RegExp&&$c(Z.tagNameCheck,_n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(_n)))return!1;if(Ei&&!Ce[_n]){let Ar=C(Se)||Se.parentNode,tc=A(Se)||Se.childNodes;if(tc&&Ar){let Ia=tc.length;for(let wl=Ia-1;wl>=0;--wl){let tm=y(tc[wl],!0);tm.__removalCount=(Se.__removalCount||0)+1,Ar.insertBefore(tm,x(Se))}}}return es(Se),!0}return Se instanceof l&&!xp(Se)||(_n==="noscript"||_n==="noembed"||_n==="noframes")&&$c(/<\/no(script|embed|frames)/i,Se.innerHTML)?(es(Se),!0):(Pe&&Se.nodeType===XO.text&&(Pt=Se.textContent,UV([w,D,I],Ar=>{Pt=WO(Pt,Ar," ")}),Se.textContent!==Pt&&(jO(t.removed,{element:Se.cloneNode()}),Se.textContent=Pt)),ec(_.afterSanitizeElements,Se,null),!1)},mf=function(Se,Pt,_n){if(un&&(Pt==="id"||Pt==="name")&&(_n in n||_n in ca))return!1;if(!(ue&&!me[Pt]&&$c(N,Pt))){if(!(Te&&$c(k,Pt))){if(!te[Pt]||me[Pt]){if(!(pf(Se)&&(Z.tagNameCheck instanceof RegExp&&$c(Z.tagNameCheck,Se)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(Se))&&(Z.attributeNameCheck instanceof RegExp&&$c(Z.attributeNameCheck,Pt)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(Pt))||Pt==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&$c(Z.tagNameCheck,_n)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(_n))))return!1}else if(!Ro[Pt]){if(!$c(U,WO(_n,V,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Se!=="script"&&s2e(_n,"data:")===0&&mt[Se])){if(!(ye&&!$c(z,WO(_n,V,"")))){if(_n)return!1}}}}}}return!0},pf=function(Se){return Se!=="annotation-xml"&&Xoe(Se,j)},_f=function(Se){ec(_.beforeSanitizeAttributes,Se,null);let{attributes:Pt}=Se;if(!Pt||la(Se))return;let _n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},Ar=Pt.length;for(;Ar--;){let tc=Pt[Ar],{name:Ia,namespaceURI:wl,value:tm}=tc,cv=Si(Ia),kc=Ia==="value"?tm:a2e(tm);if(_n.attrName=cv,_n.attrValue=kc,_n.keepAttr=!0,_n.forceKeepAttr=void 0,ec(_.uponSanitizeAttribute,Se,_n),kc=_n.attrValue,zt&&(cv==="id"||cv==="name")&&(hf(Ia,Se),kc=Ct+kc),Ee&&$c(/((--!?|])>)|<\/(style|title)/i,kc)){hf(Ia,Se);continue}if(_n.forceKeepAttr||(hf(Ia,Se),!_n.keepAttr))continue;if(!Ae&&$c(/\/>/i,kc)){hf(Ia,Se);continue}Pe&&UV([w,D,I],lJ=>{kc=WO(kc,lJ," ")});let cJ=Si(Se.nodeName);if(mf(cJ,cv,kc)){if(S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!wl)switch(g.getAttributeType(cJ,cv)){case"TrustedHTML":{kc=S.createHTML(kc);break}case"TrustedScriptURL":{kc=S.createScriptURL(kc);break}}try{wl?Se.setAttributeNS(wl,Ia,kc):Se.setAttribute(Ia,kc),la(Se)?es(Se):Yoe(t.removed)}catch{}}}ec(_.afterSanitizeAttributes,Se,null)},Vo=function cn(Se){let Pt=null,_n=tb(Se);for(ec(_.beforeSanitizeShadowDOM,Se,null);Pt=_n.nextNode();)ec(_.uponSanitizeShadowNode,Pt,null),hs(Pt),_f(Pt),Pt.content instanceof r&&cn(Pt.content);ec(_.afterSanitizeShadowDOM,Se,null)};return t.sanitize=function(cn){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,_n=null,Ar=null,tc=null;if(Xe=!cn,Xe&&(cn="<!-->"),typeof cn!="string"&&!Sl(cn))if(typeof cn.toString=="function"){if(cn=cn.toString(),typeof cn!="string")throw qO("dirty is not a string, aborting")}else throw qO("toString is not a function");if(!t.isSupported)return cn;if(qe||El(Se),t.removed=[],typeof cn=="string"&&(an=!1),an){if(cn.nodeName){let tm=Si(cn.nodeName);if(!q[tm]||ee[tm])throw qO("root node is forbidden and cannot be sanitized in-place")}}else if(cn instanceof a)Pt=Ja("<!---->"),_n=Pt.ownerDocument.importNode(cn,!0),_n.nodeType===XO.element&&_n.nodeName==="BODY"||_n.nodeName==="HTML"?Pt=_n:Pt.appendChild(_n);else{if(!Dt&&!Pe&&!ze&&cn.indexOf("<")===-1)return S&&$e?S.createHTML(cn):cn;if(Pt=Ja(cn),!Pt)return Dt?null:$e?v:""}Pt&&it&&es(Pt.firstChild);let Ia=tb(an?cn:Pt);for(;Ar=Ia.nextNode();)hs(Ar),_f(Ar),Ar.content instanceof r&&Vo(Ar.content);if(an)return cn;if(Dt){if(jt)for(tc=R.call(Pt.ownerDocument);Pt.firstChild;)tc.appendChild(Pt.firstChild);else tc=Pt;return(te.shadowroot||te.shadowrootmode)&&(tc=F.call(i,tc,!0)),tc}let wl=ze?Pt.outerHTML:Pt.innerHTML;return ze&&q["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&$c(ore,Pt.ownerDocument.doctype.name)&&(wl="<!DOCTYPE "+Pt.ownerDocument.doctype.name+`> -`+wl),Pe&&UV([w,D,I],tm=>{wl=WO(wl,tm," ")}),S&&$e?S.createHTML(wl):wl},t.setConfig=function(){let cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(cn),qe=!0},t.clearConfig=function(){_i=null,qe=!1},t.isValidAttribute=function(cn,Se,Pt){_i||El({});let _n=Si(cn),Ar=Si(Se);return mf(_n,Ar,Pt)},t.addHook=function(cn,Se){typeof Se=="function"&&jO(_[cn],Se)},t.removeHook=function(cn){return Yoe(_[cn])},t.removeHooks=function(cn){_[cn]=[]},t.removeAllHooks=function(){_=ere()},t}var sre=rre();var A2e=0,K6={};function gm(e,t){T.typeOf.string("html",e);let n,i=e;c(K6[i])?n=K6[i]:(n=A2e++,K6[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(gm.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(!c(this._element)){let e=sre.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}}});gm.equals=function(e,t){return e===t||c(e)&&c(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};gm.prototype.equals=function(e){return gm.equals(this,e)};gm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};gm.getIonCredit=function(e){let t=c(e.collapsible)&&!e.collapsible;return new gm(e.html,t)};gm.clone=function(e){if(c(e))return new gm(e.html,e.showOnScreen)};var Tt=gm;function C2e(e,t){if(!c(e)||!c(t))throw new E("identifier and message are required.");dt(e,t)}var ws=C2e;function Jb(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 pe}Object.defineProperties(Jb.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}}});Jb.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function $6(e){e._cubeMapBuffers=void 0}Jb.prototype.update=function(e){let{context:t}=e;if(!Jb.isSupported(t))return;if(c(this._texture)){$6(this);return}if(!c(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);c(f)&&($6(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!c(n)&&!this._loading){let f=this;Il(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!c(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;c(i)||(i=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT);let o=ke.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(Go.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<a;h++)n.push(f)}let l=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),u=new Go({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:l});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Jb.prototype.isDestroyed=function(){return!1};Jb.prototype.destroy=function(){return $6(this),this._texture=this._texture&&this._texture.destroy(),de(this)};var Yd=Jb;function KO(e){e=e??W.EMPTY_OBJECT;let t=c(e.imageBasedLightingFactor)?H.clone(e.imageBasedLightingFactor):new H(1,1);T.typeOf.object("options.imageBasedLightingFactor",t),T.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.x",t.x,0),T.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.x",t.x,1),T.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.y",t.y,0),T.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.y",t.y,1),this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;if(c(n)&&(!Array.isArray(n)||n.length!==9))throw new E("options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");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=H.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(KO.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){T.typeOf.object("imageBasedLightingFactor",e),T.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),T.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),T.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),T.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),this._previousImageBasedLightingFactor=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=H.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if(c(e)&&(!Array.isArray(e)||e.length!==9))throw new E("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");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 c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function E2e(e,t){if(Yd.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),c(e._specularEnvironmentMaps)){let n=new Yd(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}KO.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;H.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=H.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||c(this._previousSphericalHarmonicCoefficients)!==c(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(E2e(this,t),this._specularEnvironmentCubeMapDirty=!1),c(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!c(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!c(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)};KO.prototype.isDestroyed=function(){return!1};KO.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),de(this)};var ex=KO;var Q6=Zo(du(),1);var Z6,are="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",HV={};HV.defaultAccessToken=are;HV.defaultServer=new we({url:"https://api.cesium.com/"});HV.getDefaultTokenCredit=function(e){if(e===are){if(!c(Z6)){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>`;Z6=new Tt(t,!0)}return Z6}};var Xd=HV;function Qc(e,t){T.defined("endpoint",e),T.defined("endpointResource",t);let n,i=e.externalType,o=c(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:S2e};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.");we.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new Q6.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}c(Object.create)&&(Qc.prototype=Object.create(we.prototype),Qc.prototype.constructor=Qc);Qc.fromAssetId=function(e,t){let n=Qc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Qc(i,n)})};Object.defineProperties(Qc.prototype,{credits:{get:function(){return c(this._ionRoot)?this._ionRoot.credits:c(this._credits)?this._credits:(this._credits=Qc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Qc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Tt.getIonCredit),i=Xd.getDefaultTokenCredit(t.queryParameters.access_token);return c(i)&&n.push(Tt.clone(i)),n};Qc.prototype.clone=function(e){let t=this._ionRoot??this;return c(e)||(e=new Qc(t._ionEndpoint,t._ionEndpointResource)),e=we.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Qc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},c(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return we.prototype.fetchImage.call(this,e)};Qc.prototype._makeRequest=function(e){return this._isExternal||new Q6.default(this.url).authority()!==this._ionEndpointDomain?we.prototype._makeRequest.call(this,e):(c(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),we.prototype._makeRequest.call(this,e))};Qc._createEndpointResource=function(e,t){T.defined("assetId",e),t=t??W.EMPTY_OBJECT;let n=t.server??Xd.defaultServer,i=t.accessToken??Xd.defaultAccessToken;n=we.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return c(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function S2e(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!c(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(c(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 Cu=Qc;function ym(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(ym.prototype,{length:{get:function(){return this._length},set:function(e){T.typeOf.number.greaterThanOrEquals("length",e,0);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}}});ym.prototype.get=function(e){return T.typeOf.number.lessThan("index",e,this._array.length),this._array[e]};ym.prototype.set=function(e,t){T.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t};ym.prototype.peek=function(){return this._array[this._length-1]};ym.prototype.push=function(e){let t=this.length++;this._array[t]=e};ym.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};ym.prototype.reserve=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)};ym.prototype.resize=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e};ym.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Jc=ym;var Yp={X:0,Y:1,Z:2};Yp.Y_UP_TO_Z_UP=B.fromRotationTranslation(J.fromArray([1,0,0,0,0,1,0,-1,0]));Yp.Z_UP_TO_Y_UP=B.fromRotationTranslation(J.fromArray([1,0,0,0,0,-1,0,1,0]));Yp.X_UP_TO_Z_UP=B.fromRotationTranslation(J.fromArray([0,0,1,0,1,0,-1,0,0]));Yp.Z_UP_TO_X_UP=B.fromRotationTranslation(J.fromArray([0,0,-1,0,1,0,1,0,0]));Yp.X_UP_TO_Y_UP=B.fromRotationTranslation(J.fromArray([0,1,0,-1,0,0,0,0,1]));Yp.Y_UP_TO_X_UP=B.fromRotationTranslation(J.fromArray([0,-1,0,1,0,0,0,0,1]));Yp.fromName=function(e){return T.typeOf.string("name",e),Yp[e]};var Fo=Object.freeze(Yp);function cre(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties(cre.prototype,{metadata:{get:function(){return this._metadata}}});var tx=cre;function oy(e,t,n){if(!c(e))throw new E("uint8Array is required.");if(t<0)throw new E("byteOffset cannot be negative.");if(n<0)throw new E("byteLength cannot be negative.");if(t+n>e.byteLength)throw new E("sub-region exceeds array bounds.");return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),oy.decode(e)}oy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};oy.decodeWithFromCharCode=function(e){let t="",n=w2e(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 $O(e,t,n){return t<=e&&e<=n}function w2e(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let l=0;l<a;++l){let u=e[l];if(i===0){if($O(u,0,127)){s.push(u);continue}if($O(u,194,223)){i=1,t=u&31;continue}if($O(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if($O(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new ae("String decoding failed.")}if(!$O(u,o,r)){t=i=n=0,o=128,r=191,--l;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?oy.decode=oy.decodeWithTextDecoder:oy.decode=oy.decodeWithFromCharCode;var Fl=oy;function v2e(e,t){return t=t??0,Fl(e,t,Math.min(4,e.length))}var Kd=v2e;function Rf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,c(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Rf.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 ZO=Uint32Array.BYTES_PER_ELEMENT;Rf.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=ZO;let l=a.getUint32(o,!0);if(l!==1)throw new ae(`Only Composite Tile version 1 is supported. Version ${l} is not.`);o+=ZO,o+=ZO;let u=a.getUint32(o,!0);o+=ZO;let f=n.queryParameters.compositeIndex;c(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let y=Kd(s,o),b=a.getUint32(o+ZO*2,!0),x=r[y],A=`${f}${m}`,C=n.getDerivedResource({queryParameters:{compositeIndex:A}});if(c(x))h[m]=Promise.resolve(x(e,t,C,i,o));else throw new ae(`Unknown tile content type, ${y}, inside Composite tile`);o+=b}let p=await Promise.all(h);return new Rf(e,t,n,p)};Rf.prototype.hasProperty=function(e,t){return!1};Rf.prototype.getFeature=function(e){};Rf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Rf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Rf.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)};Rf.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 l=r[a].pick(e,t,n);if(!c(l))continue;let u=d.distance(e.origin,l);u<o&&(i=l,o=u)}if(c(i))return n};Rf.prototype.isDestroyed=function(){return!1};Rf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var QO=Rf;function D2e(e,t,n){return JSON.parse(Fl(e,t,n))}var ir=D2e;function pc(e){T.typeOf.number("options.featuresLength",e.featuresLength),T.typeOf.object("options.owner",e.owner),this._id=jn();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,ut.maximumTextureSize),r=Math.ceil(t/ut.maximumTextureSize),s=1/o,a=s*.5,l=1/r,u=l*.5;n=new H(o,r),i=new se(s,a,l,u)}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(pc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return c(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),c(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}}});pc.DEFAULT_COLOR_VALUE=G.WHITE;pc.DEFAULT_SHOW_VALUE=!0;function lre(e){let t=e._textureDimensions;return t.x*t.y*4}function ure(e){if(!c(e._batchValues)){let t=lre(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function fre(e){if(!c(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function JO(e,t){if(!c(e)||e<0||e>=t)throw new E(`batchId is required and between zero and featuresLength - 1 (${t}`-+").")}pc.prototype.setShow=function(e,t){if(JO(e,this._featuresLength),T.typeOf.bool("show",t),t&&!c(this._showAlphaProperties))return;let n=fre(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=ure(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};pc.prototype.setAllShow=function(e){T.typeOf.bool("show",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};pc.prototype.getShow=function(e){if(JO(e,this._featuresLength),!c(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var P2e=new Array(4);pc.prototype.setColor=function(e,t){if(JO(e,this._featuresLength),T.typeOf.object("color",t),G.equals(t,pc.DEFAULT_COLOR_VALUE)&&!c(this._batchValues))return;let n=t.toBytes(P2e),i=n[3],o=ure(this),r=e*4,s=fre(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 l=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!l?++this._translucentFeaturesLength:!f&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,c(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};pc.prototype.setAllColor=function(e){T.typeOf.object("color",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};pc.prototype.getColor=function(e,t){if(JO(e,this._featuresLength),T.typeOf.object("result",t),!c(this._batchValues))return G.clone(pc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return G.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};pc.prototype.getPickColor=function(e){return JO(e,this._featuresLength),this._pickIds[e]};function dre(e,t,n){let i=e._textureDimensions;return new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Qt.NEAREST})}function I2e(e,t){let n=e._featuresLength;if(!c(e._pickTexture)&&n>0){let i=e._pickIds,o=lre(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l<n;++l){let u=t.createPickId(s.getFeature(l));i.push(u);let f=u.color,h=l*4;r[h]=G.floatToByte(f.red),r[h+1]=G.floatToByte(f.green),r[h+2]=G.floatToByte(f.blue),r[h+3]=G.floatToByte(f.alpha)}e._pickTexture=dre(e,t,r),c(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function O2e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}pc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&I2e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,c(this._batchTexture)||(this._batchTexture=dre(this,n,this._batchValues),c(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),O2e(this))};pc.prototype.isDestroyed=function(){return!1};pc.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 de(this)};var el=pc;var R2e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},M2e={SCALAR:void 0,VEC2:H,VEC3:d,VEC4:se,MAT2:Ri,MAT3:J,MAT4:B};function L2e(e){let t=e.componentType,n;typeof t=="string"?n=$.fromName(t):n=t;let i=R2e[e.type],o=M2e[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return $.createArrayBufferView(n,r,s,i*a)}}}var Eu=L2e;function Xp(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,T.typeOf.object("options.extension",e.extension),N2e(this,e.extension,e.binaryBody),U2e(this)}Object.defineProperties(Xp.prototype,{byteLength:{get:function(){return this._byteLength}}});function N2e(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,l=t.classIds,u=t.parentCounts,f=t.parentIds,h=s,p=0;c(l.byteOffset)&&(l.componentType=l.componentType??$.UNSIGNED_SHORT,l.type=nn.SCALAR,r=Eu(l),l=r.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,s),p+=l.byteLength);let g;if(c(u)){for(c(u.byteOffset)&&(u.componentType=u.componentType??$.UNSIGNED_SHORT,u.type=nn.SCALAR,r=Eu(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=u[i];p+=g.byteLength}c(f)&&c(f.byteOffset)&&(f.componentType=f.componentType??$.UNSIGNED_SHORT,f.type=nn.SCALAR,r=Eu(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let x=a[i].length,A=a[i].instances,C=F2e(x,A,n);p+=B2e(C),a[i].instances=xt(C,A)}let y=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=l[i],b[i]=y[o],++y[o];p+=b.byteLength,e._classes=a,e._classIds=l,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function F2e(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new ae("componentType is required.");if(!c(l))throw new ae("type is required.");if(!c(n))throw new ae(`Property ${o} requires a batch table binary.`);let u=Eu(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function B2e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var k2e=[];function U2e(e){let t=k2e;t.length=0;let i=e._classIds.length;for(let o=0;o<i;++o)hre(e,o,t)}function hre(e,t,n){let i=e._parentCounts,o=e._parentIds,r=e._parentIndexes,a=e._classIds.length;if(!c(o))return;if(t>=a)throw new E(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new E("Circular dependency detected in the batch table hierarchy.");n.push(t);let l=c(i)?i[t]:1,u=c(i)?r[t]:t;for(let f=0;f<l;++f){let h=o[u+f];h!==t&&hre(e,h,n)}n.pop(t)}var V2e=[],z2e=[],H2e=0;function G2e(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,l=V2e;l.length=Math.max(l.length,a);let u=++H2e,f=z2e;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),l[t]===u)continue;l[t]=u;let h=n(e,t);if(c(h))return h;let p=o[t],g=s[t];for(let m=0;m<p;++m){let y=r[g+m];y!==t&&f.push(y)}}}function j2e(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(c(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function e1(e,t,n){let i=e._parentCounts,o=e._parentIds;if(c(o)){if(c(i))return G2e(e,t,n)}else return n(e,t);return j2e(e,t,n)}Xp.prototype.hasProperty=function(e,t){let n=e1(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(c(s[t]))return!0});return c(n)};Xp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(c(o[e]))return!0}return!1};Xp.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,e1(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};Xp.prototype.getProperty=function(e,t){return e1(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(c(a))return c(a.typedArray)?W2e(a,s):je(a[s],!0)})};function W2e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Xp.prototype.setProperty=function(e,t,n){let i=e1(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],l=o._classIndexes[r],u=a.instances[t];if(c(u)){if(r!==e)throw new E(`Inherited property "${t}" is read-only.`);return c(u.typedArray)?q2e(u,l,n):u[l]=je(n,!0),!0}});return c(i)};function q2e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Xp.prototype.isClass=function(e,t){let n=e1(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return c(n)};Xp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var nx=Xp;var Y2e={HIGHLIGHT:0,REPLACE:1,MIX:2},Bl=Object.freeze(Y2e);var J6=el.DEFAULT_COLOR_VALUE,e9=el.DEFAULT_SHOW_VALUE;function To(e,t,n,i,o){this.featuresLength=t;let r;c(n)&&(r=n.extensions),this._extensions=r??{};let s=X2e(n);this._properties=s,this._batchTableHierarchy=K2e(this,n,i);let a=pre(t,s,i);this._binaryPropertiesByteLength=$2e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new el({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}To._deprecationWarning=ws;Object.defineProperties(To.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function X2e(e){let t={};if(!c(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=je(e[n],!0));return t}function K2e(e,t,n){if(!c(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(c(o)&&(To._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),!!c(i))return new nx({extension:i,binaryBody:n})}function pre(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new ae("componentType is required.");if(!c(l))throw new ae("type is required.");if(!c(n))throw new ae(`Property ${o} requires a batch table binary.`);let u=Eu(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function $2e(e){if(!c(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}To.getBinaryProperties=function(e,t,n){return pre(e,t,n)};To.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};To.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};To.prototype.getShow=function(e){return this._batchTexture.getShow(e)};To.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};To.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};To.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};To.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Z2e=new G;To.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(J6),this.setAllShow(e9);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=c(e.color)?e.color.evaluateColor(o,Z2e)??J6:J6,s=c(e.show)?e.show.evaluate(o)??e9:e9;this.setColor(i,r),this.setShow(i,s)}};function Q2e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function J2e(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}function RC(e,t){if(!c(e)||e<0||e>=t)throw new E(`batchId is required and must be between zero and featuresLength - 1 (${t}`-+").")}To.prototype.isClass=function(e,t){RC(e,this.featuresLength),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};To.prototype.isExactClass=function(e,t){return T.typeOf.string("className",t),this.getExactClassName(e)===t};To.prototype.getExactClassName=function(e){RC(e,this.featuresLength);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};To.prototype.hasProperty=function(e,t){return RC(e,this.featuresLength),T.typeOf.string("name",t),c(this._properties[t])||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};To.prototype.hasPropertyBySemantic=function(){return!1};To.prototype.getPropertyIds=function(e,t){RC(e,this.featuresLength),t=c(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};To.prototype.getPropertyBySemantic=function(e,t){};To.prototype.getProperty=function(e,t){if(RC(e,this.featuresLength),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(c(i))return Q2e(i,e)}let n=this._properties[t];if(c(n))return je(n[e],!0);if(c(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(c(i))return i}};To.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(RC(e,i),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(c(r)){J2e(r,e,n);return}}if(c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];c(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=je(n,!0)};function eBe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +`;var yit=`#define CLIP_POLYLINE +${eu} +${zL}`,Ait=ET;function CT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=CT.VERTEX_FORMAT;this.material=l(e.material)?e.material:or.fromType(or.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??yit,this._fragmentShaderSource=e.fragmentShaderSource??Ait,this._renderState=Dr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(CT.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}}});CT.VERTEX_FORMAT=Be.POSITION_AND_ST;CT.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;CT.prototype.isTranslucent=Dr.prototype.isTranslucent;CT.prototype.getRenderState=Dr.prototype.getRenderState;var mc=CT;function $g(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new mc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=Jbe(!1),this._renderState3DTiles=Jbe(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},depthTest:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties($g.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}}});$g.initializeTerrainHeights=function(){return Mi.initialize()};function bit(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(kL);s=Mn._appendShowToShader(r,s),s=Mn._appendDistanceDisplayConditionToShader(r,s),s=Mn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(BL);a=Mn._appendShowToShader(r,a),a=Mn._appendDistanceDisplayConditionToShader(r,a),a=Mn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(LL),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Ye({defines:u,sources:[s]}),m=new Ye({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Ye({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Ye({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Mi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(FL);let x=new Ye({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function Jbe(e){return Ge.fromCache({cull:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function xit(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Ws?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new at({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=at.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=at.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=at.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=at.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function Zbe(e,t,n,i,r,o,s){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Tit(e,t,n,i,r,o,s){let a=e._primitive;Mn._updateBoundingVolumes(a,t,r);let c;t.mode===re.SCENE3D?c=a._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===re.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==ti.CESIUM_3D_TILE,p=f!==ti.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],Zbe(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,Zbe(e,g,t,r,o,b,s))}}}$g.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){$g.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new il({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,$x.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Ft({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){bit(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){xit(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){Tit(n,u,f,d,p,g,m)},this._primitive=new Mn(i)}if(this.appearance instanceof Ws&&!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))})};$g.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};$g.isSupported=function(e){return e.frameState.context.depthTexture};$g.prototype.isDestroyed=function(){return!1};$g.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,ue(this)};var dm=$g;var Eit=new U(1,1),Cit=!1,vit=z.WHITE;function WS(e){e=e??H.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(WS.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});WS.prototype.getType=function(e){return"Image"};var Sit=new K;WS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Sit)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,Eit,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,vit,t.color),X.getValueOrDefault(this._transparent,e,Cit)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};WS.prototype.equals=function(e){return this===e||e instanceof WS&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var DA=WS;function wit(e){if(e instanceof z)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new DA;return t.image=e,t}}function Iit(e,t){return me(e,t,wit)}var oo=Iit;function VL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(VL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});VL.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 VL(this)};VL.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var vT=VL;function qS(){pe.throwInstantiationError()}Object.defineProperties(qS.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});qS.prototype.getValue=pe.throwInstantiationError;qS.prototype.getValueInReferenceFrame=pe.throwInstantiationError;qS.prototype.equals=pe.throwInstantiationError;var Qbe=new $;qS.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=At.computeIcrfToCentralBodyFixedMatrix(e,Qbe);if(n===ji.INERTIAL)return $.multiplyByVector(o,t,r);if(n===ji.FIXED)return $.multiplyByVector($.transpose(o,Qbe),t,r)};var hm=qS;function ST(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??ji.FIXED}Object.defineProperties(ST.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===ji.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Pit=new K;ST.prototype.getValue=function(e,t){return l(e)||(e=K.now(Pit)),this.getValueInReferenceFrame(e,ji.FIXED,t)};ST.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};ST.prototype.getValueInReferenceFrame=function(e,t,n){return hm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};ST.prototype.equals=function(e){return this===e||e instanceof ST&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var nu=ST;function jL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(jL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});jL.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 jL(this)};jL.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var wT=jL;function Dit(e){return e}function Rit(e,t){return me(e,t,Dit)}var iu=Rit;function HL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(HL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});HL.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 HL(this)};HL.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var IT=HL;function GL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(GL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});GL.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 GL(this)};GL.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var PT=GL;function WL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(WL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});WL.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 WL(this)};WL.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var DT=WL;function qL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(qL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});qL.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 qL(this)};qL.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var mm=qL;var TQ=new TA;function YL(e){e=e??H.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(YL.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var Oit=new K;YL.prototype.getValue=function(e,t){return l(e)||(e=K.now(Oit)),l(t)||(t=new TA),t.translation=X.getValueOrClonedDefault(this._translation,e,TQ.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,TQ.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,TQ.scale,t.scale),t};YL.prototype.equals=function(e){return this===e||e instanceof YL&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var RT=YL;function Jg(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(Jg.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(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Jg.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function Mit(e){return new _i(e)}Jg.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??Mit)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Jg.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var Nit=new K;Jg.prototype.getValue=function(e,t){l(e)||(e=K.now(Nit)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};Jg.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],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 Lit(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}Jg.prototype.equals=function(e){return this===e||e instanceof Jg&&Lit(this,e)};var ru=Jg;function exe(e){return new RT(e)}function Fit(e){return new ru(e,exe)}function Bit(e){return new ru(e)}function kit(e){return new ru(e)}function XL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(XL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,kit),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,Fit),articulations:me("articulations",void 0,Bit),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});XL.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 XL(this)};XL.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new ru(t,exe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new ru(n)}};var Zg=XL;function KL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(KL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});KL.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new KL(this)};KL.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var OT=KL;function $L(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._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties($L.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:oo("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});$L.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.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new $L(this)};$L.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var Qg=$L;function JL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(JL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});JL.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 JL(this)};JL.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var ZL=JL;function QL(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(e??H.EMPTY_OBJECT)}Object.defineProperties(QL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});QL.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 QL(this)};QL.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var MT=QL;function Uit(e){return Array.isArray(e)&&(e=new Lc(e)),new _i(e)}function eF(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(e??H.EMPTY_OBJECT)}Object.defineProperties(eF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,Uit),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});eF.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 eF(this)};eF.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var pm=eF;function tF(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(e??H.EMPTY_OBJECT)}Object.defineProperties(tF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:oo("material"),depthFailMaterial:oo("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});tF.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 tF(this)};tF.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var dl=tF;function nF(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(e??H.EMPTY_OBJECT)}Object.defineProperties(nF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});nF.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 nF(this)};nF.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var NT=nF;function iF(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(e??H.EMPTY_OBJECT)}Object.defineProperties(iF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});iF.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 iF(this)};iF.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var gm=iF;function rF(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(e??H.EMPTY_OBJECT)}Object.defineProperties(rF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:oo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});rF.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 rF(this)};rF.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var e_=rF;var zit=new he,EQ=[];function Vit(e){return new nu(e)}function jit(e){return me(e,void 0,Vit)}function Va(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function $d(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Gg.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",...EQ],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 CQ(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&CQ(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties($d.prototype,{availability:iu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:iu("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&&CQ(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:iu("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 r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&CQ(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Va("billboard",fl),box:Va("box",vT),corridor:Va("corridor",wT),cylinder:Va("cylinder",IT),description:me("description"),ellipse:Va("ellipse",PT),ellipsoid:Va("ellipsoid",DT),label:Va("label",mm),model:Va("model",Zg),tileset:Va("tileset",OT),orientation:me("orientation"),path:Va("path",Qg),plane:Va("plane",ZL),point:Va("point",MT),polygon:Va("polygon",pm),polyline:Va("polyline",dl),polylineVolume:Va("polylineVolume",NT),properties:Va("properties",ru),position:jit("position"),rectangle:Va("rectangle",gm),viewFrom:me("viewFrom"),wall:Va("wall",e_)});$d.registerEntityType=function(e,t){Object.defineProperties($d.prototype,{[e]:Va(e,t)}),EQ.includes(e)||EQ.push(e)};$d.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};$d.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,iu(e,!0))};$d.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};$d.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var txe=new $,nxe=new h,ixe=new Le;$d.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,nxe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,ixe);return l(i)?t=N.fromRotationTranslation($.fromQuaternion(i,txe),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};$d.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,nxe);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,zit);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):Ss(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,ixe);return l(c)?r=N.fromRotationTranslation($.fromQuaternion(c,txe),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};$d.supportsMaterialsforEntitiesOnTerrain=function(e){return tu.supportsMaterials(e)};$d.supportsPolylinesOnTerrain=function(e){return dm.isSupported(e)};var Qr=$d;var Hit=new Kt(z.WHITE),Git=new _i(!0),Wit=new _i(!0),qit=new _i(!1),Yit=new _i(z.BLACK),Xit=new _i(Dn.DISABLED),Kit=new _i(new Ht),$it=new _i(ti.BOTH);function ou(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=Qr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(ou.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)&&X.isConstant(this._showProperty)&&X.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)&&X.isConstant(this._showProperty)&&X.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}}});ou.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};ou.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};ou.prototype.createFillGeometryInstance=pe.throwInstantiationError;ou.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;ou.prototype.isDestroyed=function(){return!1};ou.prototype.destroy=function(){ue(this)};ou.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(nt.MINIMUM_VALUE)};ou.prototype._isOnTerrain=function(e,t){return!1};ou.prototype._getIsClosed=function(e){return!0};ou.prototype._isDynamic=pe.throwInstantiationError;ou.prototype._setStaticOptions=pe.throwInstantiationError;ou.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(nt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(nt.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??Hit,this._fillProperty=o??Wit,this._showProperty=u??Git,this._showOutlineProperty=r.outline??qit,this._outlineColorProperty=c?r.outlineColor??Yit:void 0,this._shadowsProperty=r.shadows??Xit,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Kit,this._classificationTypeProperty=r.classificationType??$it,this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(_t(_t.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(nt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};ou.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Pi=ou;function YS(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(YS.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var Jit=new K;YS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Jit)),this._callback(e,t)};YS.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};YS.prototype.equals=function(e){return this===e||e instanceof YS&&this._callback===e._callback&&this._isConstant===e._isConstant};var _m=YS;var rxe=new h;function XS(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(nt.MINIMUM_VALUE,rxe);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(XS.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});XS.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var Zit=new K;XS.prototype.getValue=function(e,t){l(e)||(e=K.now(Zit));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!CA(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,rxe);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,D.EPSILON10)&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);if(n===We.CLIP_TO_GROUND){let c=r.globe.ellipsoid.cartesianToCartographic(o,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};XS.prototype.isDestroyed=function(){return!1};XS.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var LT=XS;function Qit(e,t,n,i){if(Pi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new _m(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new LT(this._scene,s,o)}}var t_=Qit;var oxe=h.ZERO,sxe=new h,ert=new h,axe=new z;function trt(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function zf(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new trt(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(zf.prototype=Object.create(Pi.prototype),zf.prototype.constructor=zf);Object.defineProperties(zf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});zf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ei.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,axe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,oxe,sxe))),new Ft({id:t,geometry:Ic.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};zf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,axe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,oxe,sxe))),new Ft({id:t,geometry:$h.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};zf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};zf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};zf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};zf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};zf.prototype._onEntityPropertyChanged=t_;zf.DynamicGeometryUpdater=KS;function KS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(KS.prototype=Object.create(Ii.prototype),KS.prototype.constructor=KS);KS.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,ert),r=this._options.dimensions;return!l(i)||!l(r)||Ii.prototype._isHidden.call(this,e,t,n)};KS.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?mn.ALL:void 0};var oF=zf;function FT(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??ji.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(FT.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var nrt=new K;FT.prototype.getValue=function(e,t){return l(e)||(e=K.now(nrt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};FT.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};FT.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return hm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};FT.prototype.equals=function(e){return this===e||e instanceof FT&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var sF=FT;function BT(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(BT.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}}});BT.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function vQ(e){e._cubeMapBuffers=void 0}BT.prototype.update=function(e){let{context:t}=e;if(!BT.isSupported(t))return;if(l(this._texture)){vQ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(vQ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Ru(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT);let r=Ke.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(o!==a){let f={};Object.values(ns.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ns({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};BT.prototype.isDestroyed=function(){return!1};BT.prototype.destroy=function(){return vQ(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var ym=BT;function aF(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(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._previousFrameContext=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(aF.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.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 irt(e,t){if(ym.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new ym(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}aF.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.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=U.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&&(irt(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};aF.prototype.isDestroyed=function(){return!1};aF.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var kT=aF;function cxe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(cxe.prototype,{metadata:{get:function(){return this._metadata}}});var UT=cxe;var SQ=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,s){o=o??0;let a=new Uint8Array(r),c=new DataView(r);o+=cF;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=cF,o+=cF;let f=c.getUint32(o,!0);o+=cF;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=em(a,o),b=c.getUint32(o+cF*2,!0),x=s[A],T=`${d}${y}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,E,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}},cF=Uint32Array.BYTES_PER_ELEMENT,lF=SQ;function hl(e){this._id=Kn();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 r=Math.min(t,kt.maximumTextureSize),o=Math.ceil(t/kt.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new U(r,o),i=new se(s,a,c,u)}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(hl.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}}});hl.DEFAULT_COLOR_VALUE=z.WHITE;hl.DEFAULT_SHOW_VALUE=!0;function lxe(e){let t=e._textureDimensions;return t.x*t.y*4}function uxe(e){if(!l(e._batchValues)){let t=lxe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function fxe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}hl.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=fxe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=uxe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};hl.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};hl.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var rrt=new Array(4);hl.prototype.setColor=function(e,t){if(z.equals(t,hl.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(rrt),i=n[3],r=uxe(this),o=e*4,s=fxe(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};hl.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};hl.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(hl.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};hl.prototype.getPickColor=function(e){return this._pickIds[e]};function dxe(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:jt.NEAREST})}function ort(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=lxe(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=dxe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function srt(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}hl.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&ort(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=dxe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),srt(this))};hl.prototype.isDestroyed=function(){return!1};hl.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 ue(this)};var su=hl;var art={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},crt={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:Xi,MAT3:$,MAT4:N};function lrt(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=art[e.type],r=crt[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Jd=lrt;function n_(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,urt(this,e.extension,e.binaryBody)}Object.defineProperties(n_.prototype,{byteLength:{get:function(){return this._byteLength}}});function urt(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Jd(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Jd(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Jd(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,x=a[i].instances,T=Am.getBinaryProperties(b,x,n);p+=frt(T),a[i].instances=Ot(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=a,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function frt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var drt=[],hrt=[],mrt=0;function prt(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=drt;c.length=Math.max(c.length,a);let u=++mrt,f=hrt;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function grt(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function uF(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return prt(e,t,n)}else return n(e,t);return grt(e,t,n)}n_.prototype.hasProperty=function(e,t){let n=uF(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};n_.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};n_.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,uF(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};n_.prototype.getProperty=function(e,t){return uF(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?_rt(a,s):Je(a[s],!0)})};function _rt(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}n_.prototype.setProperty=function(e,t,n){let i=uF(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?yrt(u,c,n):u[c]=Je(n,!0),!0});return l(i)};function yrt(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}n_.prototype.isClass=function(e,t){let n=uF(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};n_.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var zT=n_;var hxe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(hxe);var Yu=hxe;var wQ=su.DEFAULT_COLOR_VALUE,IQ=su.DEFAULT_SHOW_VALUE;function Xr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=Art(n);this._properties=s,this._batchTableHierarchy=brt(this,n,i);let a=pxe(t,s,i);this._binaryPropertiesByteLength=xrt(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new su({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Xr._deprecationWarning=Yr;Object.defineProperties(Xr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Art(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Je(e[n],!0));return t}function brt(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Xr._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"]=r,i=r),!!l(i))return new zT({extension:i,binaryBody:n})}function pxe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Jd(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function xrt(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Xr.getBinaryProperties=function(e,t,n){return pxe(e,t,n)};Xr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Xr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Xr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Xr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Xr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Xr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Xr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Trt=new z;Xr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(wQ),this.setAllShow(IQ);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,Trt)??wQ:wQ,s=l(e.show)?e.show.evaluate(r)??IQ:IQ;this.setColor(i,o),this.setShow(i,s)}};function Ert(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Crt(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Xr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Xr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Xr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Xr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Xr.prototype.hasPropertyBySemantic=function(){return!1};Xr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Zn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Zn(t,i)}return t};Xr.prototype.getPropertyBySemantic=function(e,t){};Xr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return Ert(i,e)}let n=this._properties[t];if(l(n))return Je(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Xr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){Crt(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Je(n,!0)};function vrt(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; vec2 computeSt(float batchId) { float stepX = tile_textureStep.x; @@ -3284,7 +4459,7 @@ vec2 computeSt(float batchId) float yId = floor(batchId / tile_textureDimensions.x); return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); } -`}To.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=_re(o,n,!1),s;return ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`}Xr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=gxe(r,n,!1),s;return kt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; `),s+=`uniform sampler2D tile_batchTexture; out vec4 tile_featureColor; out vec2 tile_featureSt; @@ -3317,8 +4492,8 @@ void main() { tile_color(vec4(1.0)); tile_featureSt = computeSt(${t}); -}`,`${r} -${eBe(i)}${s}`}};function mre(e,t){return e=He.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +}`,`${o} +${vrt(i)}${s}`}};function mxe(e,t){return e=Ye.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; void tile_color(vec4 tile_featureColor) { tile_main(); @@ -3331,7 +4506,7 @@ void tile_color(vec4 tile_featureColor) { tile_main(); } -`}function tBe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let l=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+l+e.slice(r),i=o+l.length,o=e.indexOf(n,i)}return e}function _re(e,t,n){if(!c(t))return mre(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!c(o))return mre(e,n);let r=o[0],s=o[2];e=He.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) +`}function Srt(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function gxe(e,t,n){if(!l(t))return mxe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return mxe(e,n);let o=r[0],s=r[2];e=Ye.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -3341,23 +4516,23 @@ vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; return vec4(diffuse.rgb, sourceDiffuse.a); } -`,l=` tile_featureColor = czm_gammaCorrect(tile_featureColor); +`,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); -`,u;if(s==="vec3"||s==="vec4"){let f=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),u=` vec4 source = ${f}; +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; tile_diffuse = tile_diffuse_final(source, tile_featureColor); tile_main(); -`}else s==="sampler2D"&&(e=tBe(e,t),u=` tile_diffuse = tile_featureColor; +`}else s==="sampler2D"&&(e=Srt(e,t),u=` tile_diffuse = tile_featureColor; tile_main(); `);return e=`uniform float tile_colorBlend; vec4 tile_diffuse = vec4(1.0); -${a}${r} +${a}${o} ${e} void tile_color(vec4 tile_featureColor) { -${u}`,n&&(e+=l),e+=`} -`,e}To.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=_re(i,t,!0),ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +${u}`,n&&(e+=c),e+=`} +`,e}Xr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=gxe(i,t,!0),kt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; in vec2 tile_featureSt; in vec4 tile_featureColor; void main() @@ -3392,115 +4567,30 @@ void main() `),i+=` tile_color(featureProperties); `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; `),i+=`} -`),i}};function nBe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Bl.HIGHLIGHT)return 0;if(n===Bl.REPLACE)return 1;if(n===Bl.MIX)return O.clamp(i,O.EPSILON4,1);throw new E(`Invalid color blend mode "${n}".`)}To.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return nBe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};To.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ry={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};To.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,l=iBe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===De.COMPUTE)continue;let h=f.derivedCommands.tileset;(!c(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=oBe(f),f.dirty=!1);let p=h.originalCommand;l!==ry.ALL_OPAQUE&&f.pass!==De.TRANSLUCENT&&(c(h.translucent)||(h.translucent=rBe(p))),l!==ry.ALL_TRANSLUCENT&&f.pass!==De.TRANSLUCENT&&(c(h.opaque)||(h.opaque=sBe(p)),a&&(r||(c(h.zback)||(h.zback=cBe(e.context,p)),s._backfaceCommands.push(h.zback)),(!c(h.stencil)||o._selectionDepth!==uBe(h.stencil))&&(f.renderState.depthMask?h.stencil=lBe(p,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,m=h.translucent;f.pass!==De.TRANSLUCENT?(l===ry.ALL_OPAQUE&&(n[u]=g),l===ry.ALL_TRANSLUCENT&&(n[u]=m),l===ry.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function iBe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?ry.ALL_OPAQUE:t===e.featuresLength?ry.ALL_TRANSLUCENT:ry.OPAQUE_AND_TRANSLUCENT}function oBe(e){let t=Qe.shallowClone(e),n=t.pass===De.TRANSLUCENT;return t.uniformMap=c(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function rBe(e){let t=Qe.shallowClone(e);return t.pass=De.TRANSLUCENT,t.renderState=fBe(e.renderState),t}function sBe(e){let t=Qe.shallowClone(e);return t.renderState=dBe(e.renderState),t}function aBe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!c(n)){let i=t.fragmentShaderSource.clone();i.defines=c(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 cBe(e,t){let n=Qe.shallowClone(t),i=je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=xi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=je(t.uniformMap);let o=new H(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=aBe(e,t.shaderProgram),n}function lBe(e,t){let n=Qe.shallowClone(e),i=je(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=kt.SKIP_LOD_MASK,i.stencilTest.reference=kt.CESIUM_3D_TILE_MASK|t<<kt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ft.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ft.REPLACE,i.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function uBe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function fBe(e){let t=je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=ln.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function dBe(e){let t=je(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}To.prototype.update=function(e,t){this._batchTexture.update(e,t)};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var Kp=To;function hBe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var bm=hBe;var MC=`in vec3 position; +`),i}};function wrt(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Yu.HIGHLIGHT)return 0;if(n===Yu.REPLACE)return 1;if(n===Yu.MIX)return D.clamp(i,D.EPSILON4,1)}Xr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Ot(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return wrt(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Xr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var RA={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Xr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=Irt(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=Prt(f),f.dirty=!1);let p=d.originalCommand;c!==RA.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=Drt(p))),c!==RA.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=Rrt(p)),a&&(o||(l(d.zback)||(d.zback=Mrt(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Lrt(d.stencil))&&(f.renderState.depthMask?d.stencil=Nrt(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===RA.ALL_OPAQUE&&(n[u]=g),c===RA.ALL_TRANSLUCENT&&(n[u]=m),c===RA.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function Irt(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?RA.ALL_OPAQUE:t===e.featuresLength?RA.ALL_TRANSLUCENT:RA.OPAQUE_AND_TRANSLUCENT}function Prt(e){let t=at.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Drt(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=Frt(e.renderState),t}function Rrt(e){let t=at.shallowClone(e);return t.renderState=Brt(e.renderState),t}function Ort(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 Mrt(e,t){let n=at.shallowClone(t),i=Je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Vi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK,n.renderState=Ge.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Je(t.uniformMap);let r=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=Ort(e,t.shaderProgram),n}function Nrt(e,t){let n=at.shallowClone(e),i=Je(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Yt.SKIP_LOD_MASK,i.stencilTest.reference=Yt.CESIUM_3D_TILE_MASK|t<<Yt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ni.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ni.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Rt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=Ge.fromCache(i),n}function Lrt(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function Frt(e){let t=Je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=tn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function Brt(e){let t=Je(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Xr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Xr.prototype.isDestroyed=function(){return!1};Xr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Am=Xr;function krt(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var s0=krt;var $S=`in vec3 position; in float a_batchId; uniform mat4 u_modifiedModelViewProjection; void main() { gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -`;function Mf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Mf.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 c(this._color)||(this._color=new G),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(c(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)}}});Mf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Mf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Mf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Mf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(c(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(c(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(c(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(c(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),c(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let l=c(e.group)?e.group.metadata:void 0;if(c(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}let u=e.tileset.metadata;if(c(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};Mf.prototype.getPropertyInherited=function(e){return Mf.getPropertyInherited(this._content,this._batchId,e)};Mf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Mf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Mf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Mf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ws=Mf;var t9=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)})}},n9=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,l,u;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)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(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 "+u),o.push(r,t)}for(l=o.length-1,t=o[l];l>1;)t={type:e.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=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)}}},mBe=new t9;Object.assign(kl,{hooks:mBe,plugins:new n9(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 sy=e=>new kl(e).parse(),pBe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(kl).filter(e=>!pBe.includes(e)&&sy[e]===void 0).forEach(e=>{sy[e]=kl[e]});sy.Jsep=kl;var _Be="ConditionalExpression",gBe={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:_Be,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 :")}})}};sy.plugins.register(gBe);var yBe={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},_t=Object.freeze(yBe);function $d(e,t){T.typeOf.string("expression",e),this._expression=e,e=OBe(e,t),e=MBe(RBe(e)),sy.addBinaryOp("=~",0),sy.addBinaryOp("!~",0);let n;try{n=sy(e)}catch(i){throw new ae(i)}this._runtimeAst=wi(this,n)}Object.defineProperties($d.prototype,{expression:{get:function(){return this._expression}}});var Rn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new H],cartesian3Array:[new d],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 H),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};$d.prototype.evaluate=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof G&&n instanceof se?G.fromCartesian4(n,t):n instanceof H||n instanceof d||n instanceof se?n.clone(t):n};$d.prototype.evaluateColor=function(e,t){Rn.reset();let n=this._runtimeAst.evaluate(e);return G.fromCartesian4(n,t)};$d.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +`;var PQ=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},sa=PQ;var DQ=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][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)})}},RQ=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)})}},Xu=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,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);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,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=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 o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):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++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){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+=o}else t+=o}return r||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,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==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)}}},Urt=new DQ;Object.assign(Xu,{hooks:Urt,plugins:new RQ(Xu),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"});Xu.max_unop_len=Xu.getMaxKeyLen(Xu.unary_ops);Xu.max_binop_len=Xu.getMaxKeyLen(Xu.binary_ops);var OA=e=>new Xu(e).parse(),zrt=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Xu).filter(e=>!zrt.includes(e)&&OA[e]===void 0).forEach(e=>{OA[e]=Xu[e]});OA.Jsep=Xu;var Vrt="ConditionalExpression",jrt={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,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:Vrt,test:i,consequent:r,alternate:o},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 :")}})}};OA.plugins.register(jrt);var _xe={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};Object.freeze(_xe);var Mt=_xe;function bm(e,t){this._expression=e,e=tot(e,t),e=iot(not(e)),OA.addBinaryOp("=~",0),OA.addBinaryOp("!~",0);let n;try{n=OA(e)}catch(i){throw new oe(i)}this._runtimeAst=$i(this,n)}Object.defineProperties(bm.prototype,{expression:{get:function(){return this._expression}}});var Un={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new h],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 U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};bm.prototype.evaluate=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof U||n instanceof h||n instanceof se?n.clone(t):n};bm.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};bm.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} { - return ${o}; + return ${r}; } -`,o};$d.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};$d.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var bBe=["!","-","+"],gre=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],t1=/\${(.*?)}/g,xBe=/\\/g,TBe="@#%",ABe=/@#%/g,WV=new G,qV={abs:qs(Math.abs),sqrt:qs(Math.sqrt),cos:qs(Math.cos),sin:qs(Math.sin),tan:qs(Math.tan),acos:qs(Math.acos),asin:qs(Math.asin),atan:qs(Math.atan),radians:qs(O.toRadians),degrees:qs(O.toDegrees),sign:qs(O.sign),floor:qs(Math.floor),ceil:qs(Math.ceil),round:qs(Math.round),exp:qs(Math.exp),exp2:qs(EBe),log:qs(Math.log),log2:qs(SBe),fract:qs(CBe),length:wBe,normalize:vBe},YV={atan2:GV(Math.atan2,!1),pow:GV(Math.pow,!1),min:GV(Math.min,!0),max:GV(Math.max,!0),distance:DBe,dot:PBe,cross:IBe},r9={clamp:yre(O.clamp,!0),mix:yre(O.lerp,!0)};function CBe(e){return e-Math.floor(e)}function EBe(e){return Math.pow(2,e)}function SBe(e){return O.log2(e)}function qs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof H)return H.fromElements(e(n.x),e(n.y),Rn.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),Rn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Rn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function GV(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof H)return H.fromElements(e(i.x,o),e(i.y,o),Rn.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Rn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof H&&o instanceof H)return H.fromElements(e(i.x,o.x),e(i.y,o.y),Rn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Rn.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),Rn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function yre(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 H&&o instanceof H)return H.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Rn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Rn.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),Rn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof H&&o instanceof H&&r instanceof H)return H.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Rn.getCartesian2());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),e(i.z,o.z,r.z),Rn.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),Rn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function wBe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof H)return H.magnitude(t);if(t instanceof d)return d.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 vBe(e,t){if(typeof t=="number")return 1;if(t instanceof H)return H.normalize(t,Rn.getCartesian2());if(t instanceof d)return d.normalize(t,Rn.getCartesian3());if(t instanceof se)return se.normalize(t,Rn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function DBe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof H&&n instanceof H)return H.distance(t,n);if(t instanceof d&&n instanceof d)return d.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 PBe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof H&&n instanceof H)return H.dot(t,n);if(t instanceof d&&n instanceof d)return d.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 IBe(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,Rn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function At(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,GBe(this)}function OBe(e,t){if(!c(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;c(o)&&(e=e.replace(i,o))}return e}function RBe(e){return e.replace(xBe,TBe)}function o9(e){return e.replace(ABe,"\\")}function MBe(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 LBe(e){let t=typeof e.value;if(e.value===null)return new At(_t.LITERAL_NULL,null);if(t==="boolean")return new At(_t.LITERAL_BOOLEAN,e.value);if(t==="number")return new At(_t.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new At(_t.VARIABLE_IN_STRING,e.value):new At(_t.LITERAL_STRING,o9(e.value))}function NBe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let l=t.callee.object;if(o==="test"||o==="exec"){if(!c(l.callee)||l.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new At(_t.LITERAL_BOOLEAN,!1):new At(_t.LITERAL_NULL,null):(s=wi(e,l),a=wi(e,n[0]),new At(_t.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=wi(e,l),new At(_t.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new At(_t.LITERAL_COLOR,o);if(r=wi(e,n[0]),c(n[1])){let l=wi(e,n[1]);return new At(_t.LITERAL_COLOR,o,[r,l])}return new At(_t.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[wi(e,n[0]),wi(e,n[1]),wi(e,n[2])],new At(_t.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[wi(e,n[0]),wi(e,n[1]),wi(e,n[2]),wi(e,n[3])],new At(_t.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let l=0;l<i;++l)r[l]=wi(e,n[l]);return new At(_t.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new At(_t.LITERAL_BOOLEAN,!0):new At(_t.LITERAL_BOOLEAN,!1):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ae(`${o} requires exactly one argument.`);return r=wi(e,n[0]),new At(_t.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new At(_t.UNARY,o)}else if(c(qV[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=wi(e,n[0]),new At(_t.UNARY,o,r)}else if(c(YV[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=wi(e,n[0]),a=wi(e,n[1]),new At(_t.BINARY,o,s,a)}else if(c(r9[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=wi(e,n[0]),a=wi(e,n[1]);let l=wi(e,n[2]);return new At(_t.TERNARY,o,s,a,l)}else{if(o==="Boolean")return i===0?new At(_t.LITERAL_BOOLEAN,!1):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="Number")return i===0?new At(_t.LITERAL_NUMBER,0):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="String")return i===0?new At(_t.LITERAL_STRING,""):(r=wi(e,n[0]),new At(_t.UNARY,o,r));if(o==="regExp")return FBe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function FBe(e,t){let n=t.arguments;if(n.length===0)return new At(_t.LITERAL_REGEX,new RegExp);let i=wi(e,n[0]),o;if(n.length>1){let r=wi(e,n[1]);if(i9(i)&&i9(r)){try{o=new RegExp(o9(String(i._value)),r._value)}catch(s){throw new ae(s)}return new At(_t.LITERAL_REGEX,o)}return new At(_t.REGEX,i,r)}if(i9(i)){try{o=new RegExp(o9(String(i._value)))}catch(r){throw new ae(r)}return new At(_t.LITERAL_REGEX,o)}return new At(_t.REGEX,i)}function BBe(e){if(zBe(e.name)){let t=HBe(e.name);return t.substr(0,8)==="tiles3d_"?new At(_t.BUILTIN_VARIABLE,t):new At(_t.VARIABLE,t)}else{if(e.name==="NaN")return new At(_t.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new At(_t.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new At(_t.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function kBe(e){let t=e.property.name;if(t==="PI")return new At(_t.LITERAL_NUMBER,Math.PI);if(t==="E")return new At(_t.LITERAL_NUMBER,Math.E)}function UBe(e){if(e.property.name==="POSITIVE_INFINITY")return new At(_t.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function VBe(e,t){if(t.object.name==="Math")return kBe(t);if(t.object.name==="Number")return UBe(t);let n,i=wi(e,t.object);return t.computed?(n=wi(e,t.property),new At(_t.MEMBER,"brackets",i,n)):(n=new At(_t.LITERAL_STRING,t.property.name),new At(_t.MEMBER,"dot",i,n))}function i9(e){return e._type>=_t.LITERAL_NULL}function zBe(e){return e.substr(0,4)==="czm_"}function HBe(e){return e.substr(4)}function wi(e,t){let n,i,o,r;if(t.type==="Literal")n=LBe(t);else if(t.type==="CallExpression")n=NBe(e,t);else if(t.type==="Identifier")n=BBe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=wi(e,t.argument);if(bBe.indexOf(i)>-1)n=new At(_t.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=wi(e,t.left),r=wi(e,t.right),gre.indexOf(i)>-1)n=new At(_t.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=wi(e,t.left),r=wi(e,t.right),gre.indexOf(i)>-1&&(n=new At(_t.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=wi(e,t.test);o=wi(e,t.consequent),r=wi(e,t.alternate),n=new At(_t.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=VBe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=wi(e,t.elements[a]);n=new At(_t.ARRAY,s)}else throw t.type==="Compound"?new ae("Provide exactly one expression."):new ae("Cannot parse expression.");return n}function GBe(e){e._type===_t.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===_t.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===_t.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:c(qV[e._value])&&(e.evaluate=WBe(e._value)):e._type===_t.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:c(YV[e._value])&&(e.evaluate=qBe(e._value)):e._type===_t.TERNARY?e.evaluate=YBe(e._value):e._type===_t.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===_t.ARRAY?e.evaluate=e._evaluateArray:e._type===_t.VARIABLE?e.evaluate=e._evaluateVariable:e._type===_t.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===_t.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===_t.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===_t.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===_t.REGEX?e.evaluate=e._evaluateRegExp:e._type===_t.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=jBe):e.evaluate=e._evaluateLiteral}function jBe(e){return c(e)?e.content.tileset.timeSinceLoad:0}function WBe(e){let t=qV[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function qBe(e){let t=YV[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function YBe(e){let t=r9[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 XV(e,t){if(c(e))return e.getPropertyInherited(t)}At.prototype._evaluateLiteral=function(){return this._value};At.prototype._evaluateLiteralColor=function(e){let t=WV,n=this._left;if(this._value==="color")c(n)?n.length>1?(G.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):G.fromCssColorString(n[0].evaluate(e),t):G.fromBytes(255,255,255,255,t);else if(this._value==="rgb")G.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;G.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Rn.getCartesian4())};At.prototype._evaluateLiteralVector=function(e){let t=Rn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let l=i[a].evaluate(e);if(typeof l=="number")t.push(l);else if(l instanceof H)t.push(l.x,l.y);else if(l instanceof d)t.push(l.x,l.y,l.z);else if(l instanceof se)t.push(l.x,l.y,l.z,l.w);else throw new ae(`${n} argument must be a vector or number. Argument is ${l}.`)}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 H.fromArray(t,0,Rn.getCartesian2());if(n==="vec3")return d.fromArray(t,0,Rn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Rn.getCartesian4())};At.prototype._evaluateLiteralString=function(){return this._value};At.prototype._evaluateVariableString=function(e){let t=this._value,n=t1.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=XV(e,o);c(r)||(r=""),t=t.replace(i,r),t1.lastIndex+=r.length-i.length,n=t1.exec(t)}return t};At.prototype._evaluateVariable=function(e){return XV(e,this._value)};function ix(e){return e._value==="feature"}At.prototype._evaluateMemberDot=function(e){if(ix(this._left))return XV(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof d||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]};At.prototype._evaluateMemberBrackets=function(e){if(ix(this._left))return XV(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof H||t instanceof d||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]};At.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};At.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};At.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof H)return H.negate(t,Rn.getCartesian2());if(t instanceof d)return d.negate(t,Rn.getCartesian3());if(t instanceof se)return se.negate(t,Rn.getCartesian4());if(typeof t=="number")return-t;throw new ae(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};At.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof H||t instanceof d||t instanceof se||typeof t=="number"))throw new ae(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};At.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};At.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};At.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};At.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};At.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};At.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};At.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.add(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Rn.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}.`)};At.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.subtract(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Rn.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}.`)};At.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.multiplyComponents(t,n,Rn.getCartesian2());if(n instanceof H&&typeof t=="number")return H.multiplyByScalar(n,t,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.multiplyByScalar(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,Rn.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,Rn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Rn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Rn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Rn.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}.`)};At.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.divideComponents(t,n,Rn.getCartesian2());if(t instanceof H&&typeof n=="number")return H.divideByScalar(t,n,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,Rn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,Rn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Rn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Rn.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}.`)};At.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof H&&t instanceof H)return H.fromElements(t.x%n.x,t.y%n.y,Rn.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Rn.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,Rn.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}.`)};At.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?t.equals(n):t===n};At.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof H&&t instanceof H||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?!t.equals(n):t!==n};At.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)};At.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};At.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};At.prototype._evaluateIsExactClass=function(e){return c(e)?e.isExactClass(this._left.evaluate(e)):!1};At.prototype._evaluateIsClass=function(e){return c(e)?e.isClass(this._left.evaluate(e)):!1};At.prototype._evaluateGetExactClassName=function(e){if(c(e))return e.getExactClassName()};At.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};At.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};At.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};At.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";c(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};At.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)};At.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}.`)};At.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}.`)};At.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 c(i)?i[1]:null};At.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof H||t instanceof d||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function bre(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==_t.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return G.fromHsl(i,o,r,s,WV)}function xre(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==_t.LITERAL_NUMBER)return;let i=WV;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 ay(e){return e%1===0?e.toFixed(1):e.toString()}function XBe(e){let t=ay(e.red),n=ay(e.green),i=ay(e.blue);return`vec3(${t}, ${n}, ${i})`}function jV(e){let t=ay(e.red),n=ay(e.green),i=ay(e.blue),o=ay(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function Tre(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 Are(e,t){return c(t[e])?t[e]:$d.NULL_SENTINEL}$d.NULL_SENTINEL="czm_infinity";At.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,l=this._value;c(this._left)&&(Array.isArray(this._left)?o=Tre(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),c(this._right)&&(r=this._right.getShaderExpression(e,t,this)),c(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=Tre(this._value,e,t,this));let u,f,h;switch(a){case _t.VARIABLE:return ix(this)?void 0:Are(l,e);case _t.UNARY:if(l==="Boolean")return`bool(${o})`;if(l==="Number")return`float(${o})`;if(l==="round")return`floor(${o} + 0.5)`;if(c(qV[l]))return`${l}(${o})`;if(l==="isNaN")return`(${o} != ${o})`;if(l==="isFinite")return`(abs(${o}) < czm_infinity)`;if(l==="String"||l==="isExactClass"||l==="isClass"||l==="getExactClassName")throw new ae(`Error generating style shader: "${l}" is not supported.`);return l+o;case _t.BINARY:return l==="%"?`mod(${o}, ${r})`:l==="==="?`(${o} == ${r})`:l==="!=="?`(${o} != ${r})`:l==="atan2"?`atan(${o}, ${r})`:c(YV[l])?`${l}(${o}, ${r})`:`(${o} ${l} ${r})`;case _t.TERNARY:if(c(r9[l]))return`${l}(${o}, ${r}, ${s})`;break;case _t.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case _t.MEMBER:return ix(this._left)?Are(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 _t.FUNCTION_CALL:throw new ae(`Error generating style shader: "${l}" is not supported.`);case _t.ARRAY:if(l.length===4)return`vec4(${l[0]}, ${l[1]}, ${l[2]}, ${l[3]})`;if(l.length===3)return`vec3(${l[0]}, ${l[1]}, ${l[2]})`;if(l.length===2)return`vec2(${l[0]}, ${l[1]})`;throw new ae("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case _t.REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case _t.VARIABLE_IN_STRING:throw new ae("Error generating style shader: Converting a variable to a string is not supported.");case _t.LITERAL_NULL:return $d.NULL_SENTINEL;case _t.LITERAL_BOOLEAN:return l?"true":"false";case _t.LITERAL_NUMBER:return ay(l);case _t.LITERAL_STRING:if(c(n)&&n._type===_t.MEMBER&&(l==="r"||l==="g"||l==="b"||l==="a"||l==="x"||l==="y"||l==="z"||l==="w"||ix(n._left)))return l;if(i=G.fromCssColorString(l,WV),c(i))return XBe(i);throw new ae("Error generating style shader: String literals are not supported.");case _t.LITERAL_COLOR:if(u=o,l==="color"){if(c(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(l==="rgb")return i=xre(this),c(i)?jV(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(l==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=xre(this),c(i)?jV(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(l==="hsl")return i=bre(this),c(i)?jV(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(l==="hsla")return i=bre(this),c(i)?(i.alpha!==1&&(t.translucent=!0),jV(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case _t.LITERAL_VECTOR:if(!c(o))throw new E("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");f=o.length,h=`${l}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case _t.LITERAL_REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case _t.LITERAL_UNDEFINED:return $d.NULL_SENTINEL;case _t.BUILTIN_VARIABLE:if(l==="tiles3d_tileset_time")return l}};At.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(c(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(c(this._right)&&this._right.getVariables(e,this),c(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 _t.VARIABLE:ix(this)||e.push(s);break;case _t.VARIABLE_IN_STRING:for(a=t1.exec(s);a!==null;)e.push(a[1]),a=t1.exec(s);break;case _t.LITERAL_STRING:c(t)&&t._type===_t.MEMBER&&ix(t._left)&&e.push(s);break}};var Lf=$d;function $p(e){e=e??W.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=e.center??d.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=G.clone(G.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=e.classificationType??Un.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($p.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var KBe={position:0,a_batchId:1};function $Be(e,t){if(c(e._va))return;let n=yt.createVertexBuffer({context:t,typedArray:e._positions,usage:Be.STATIC_DRAW}),i=yt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Be.STATIC_DRAW}),o=yt.createIndexBuffer({context:t,typedArray:e._indices,usage:Be.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:$.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:$.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ti({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ti({context:t,attributes:r,indexBuffer:yt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Be.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function ZBe(e,t){if(c(e._sp))return;let n=e._batchTable,i=e._attributeLocations??KBe,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(c(r)){e._sp=Jt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=He.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +`,r};bm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};bm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Hrt=["!","-","+"],yxe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],fF=/\${(.*?)}/g,Grt=/\\/g,Wrt="@#%",qrt=/@#%/g,rG=new z,oG={abs:ja(Math.abs),sqrt:ja(Math.sqrt),cos:ja(Math.cos),sin:ja(Math.sin),tan:ja(Math.tan),acos:ja(Math.acos),asin:ja(Math.asin),atan:ja(Math.atan),radians:ja(D.toRadians),degrees:ja(D.toDegrees),sign:ja(D.sign),floor:ja(Math.floor),ceil:ja(Math.ceil),round:ja(Math.round),exp:ja(Math.exp),exp2:ja(Xrt),log:ja(Math.log),log2:ja(Krt),fract:ja(Yrt),length:$rt,normalize:Jrt},sG={atan2:nG(Math.atan2,!1),pow:nG(Math.pow,!1),min:nG(Math.min,!0),max:nG(Math.max,!0),distance:Zrt,dot:Qrt,cross:eot},NQ={clamp:Axe(D.clamp,!0),mix:Axe(D.lerp,!0)};function Yrt(e){return e-Math.floor(e)}function Xrt(e){return Math.pow(2,e)}function Krt(e){return D.log2(e)}function ja(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Un.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Un.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Un.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function nG(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof U)return U.fromElements(e(i.x,r),e(i.y,r),Un.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Un.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x),e(i.y,r.y),Un.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Un.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function Axe(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Un.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Un.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof U&&r instanceof U&&o instanceof U)return U.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Un.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Un.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function $rt(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Jrt(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Un.getCartesian2());if(t instanceof h)return h.normalize(t,Un.getCartesian3());if(t instanceof se)return se.normalize(t,Un.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Zrt(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Qrt(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function eot(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Un.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Bt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,hot(this)}function tot(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function not(e){return e.replace(Grt,Wrt)}function MQ(e){return e.replace(qrt,"\\")}function iot(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;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 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{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function rot(e){let t=typeof e.value;if(e.value===null)return new Bt(Mt.LITERAL_NULL,null);if(t==="boolean")return new Bt(Mt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Bt(Mt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Bt(Mt.VARIABLE_IN_STRING,e.value):new Bt(Mt.LITERAL_STRING,MQ(e.value))}function oot(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Bt(Mt.LITERAL_BOOLEAN,!1):new Bt(Mt.LITERAL_NULL,null):(s=$i(e,c),a=$i(e,n[0]),new Bt(Mt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=$i(e,c),new Bt(Mt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Bt(Mt.LITERAL_COLOR,r);if(o=$i(e,n[0]),l(n[1])){let c=$i(e,n[1]);return new Bt(Mt.LITERAL_COLOR,r,[o,c])}return new Bt(Mt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[$i(e,n[0]),$i(e,n[1]),$i(e,n[2])],new Bt(Mt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[$i(e,n[0]),$i(e,n[1]),$i(e,n[2]),$i(e,n[3])],new Bt(Mt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=$i(e,n[c]);return new Bt(Mt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Bt(Mt.LITERAL_BOOLEAN,!0):new Bt(Mt.LITERAL_BOOLEAN,!1):(o=$i(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=$i(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Bt(Mt.UNARY,r)}else if(l(oG[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=$i(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(l(sG[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=$i(e,n[0]),a=$i(e,n[1]),new Bt(Mt.BINARY,r,s,a)}else if(l(NQ[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=$i(e,n[0]),a=$i(e,n[1]);let c=$i(e,n[2]);return new Bt(Mt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Bt(Mt.LITERAL_BOOLEAN,!1):(o=$i(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="Number")return i===0?new Bt(Mt.LITERAL_NUMBER,0):(o=$i(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="String")return i===0?new Bt(Mt.LITERAL_STRING,""):(o=$i(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="regExp")return sot(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function sot(e,t){let n=t.arguments;if(n.length===0)return new Bt(Mt.LITERAL_REGEX,new RegExp);let i=$i(e,n[0]),r;if(n.length>1){let o=$i(e,n[1]);if(OQ(i)&&OQ(o)){try{r=new RegExp(MQ(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i,o)}if(OQ(i)){try{r=new RegExp(MQ(String(i._value)))}catch(o){throw new oe(o)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i)}function aot(e){if(fot(e.name)){let t=dot(e.name);return t.substr(0,8)==="tiles3d_"?new Bt(Mt.BUILTIN_VARIABLE,t):new Bt(Mt.VARIABLE,t)}else{if(e.name==="NaN")return new Bt(Mt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Bt(Mt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Bt(Mt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function cot(e){let t=e.property.name;if(t==="PI")return new Bt(Mt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Bt(Mt.LITERAL_NUMBER,Math.E)}function lot(e){if(e.property.name==="POSITIVE_INFINITY")return new Bt(Mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function uot(e,t){if(t.object.name==="Math")return cot(t);if(t.object.name==="Number")return lot(t);let n,i=$i(e,t.object);return t.computed?(n=$i(e,t.property),new Bt(Mt.MEMBER,"brackets",i,n)):(n=new Bt(Mt.LITERAL_STRING,t.property.name),new Bt(Mt.MEMBER,"dot",i,n))}function OQ(e){return e._type>=Mt.LITERAL_NULL}function fot(e){return e.substr(0,4)==="czm_"}function dot(e){return e.substr(4)}function $i(e,t){let n,i,r,o;if(t.type==="Literal")n=rot(t);else if(t.type==="CallExpression")n=oot(e,t);else if(t.type==="Identifier")n=aot(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=$i(e,t.argument);if(Hrt.indexOf(i)>-1)n=new Bt(Mt.UNARY,i,s);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=$i(e,t.left),o=$i(e,t.right),yxe.indexOf(i)>-1)n=new Bt(Mt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=$i(e,t.left),o=$i(e,t.right),yxe.indexOf(i)>-1&&(n=new Bt(Mt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=$i(e,t.test);r=$i(e,t.consequent),o=$i(e,t.alternate),n=new Bt(Mt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=uot(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=$i(e,t.elements[a]);n=new Bt(Mt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function hot(e){e._type===Mt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Mt.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===Mt.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(oG[e._value])&&(e.evaluate=pot(e._value)):e._type===Mt.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(sG[e._value])&&(e.evaluate=got(e._value)):e._type===Mt.TERNARY?e.evaluate=_ot(e._value):e._type===Mt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Mt.ARRAY?e.evaluate=e._evaluateArray:e._type===Mt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Mt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Mt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Mt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Mt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Mt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Mt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=mot):e.evaluate=e._evaluateLiteral}function mot(e){return l(e)?e.content.tileset.timeSinceLoad:0}function pot(e){let t=oG[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function got(e){let t=sG[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function _ot(e){let t=NQ[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function aG(e,t){if(l(e))return e.getPropertyInherited(t)}Bt.prototype._evaluateLiteral=function(){return this._value};Bt.prototype._evaluateLiteralColor=function(e){let t=rG,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.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;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Un.getCartesian4())};Bt.prototype._evaluateLiteralVector=function(e){let t=Un.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof h)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 oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Un.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Un.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Un.getCartesian4())};Bt.prototype._evaluateLiteralString=function(){return this._value};Bt.prototype._evaluateVariableString=function(e){let t=this._value,n=fF.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=aG(e,r);l(o)||(o=""),t=t.replace(i,o),fF.lastIndex+=o.length-i.length,n=fF.exec(t)}return t};Bt.prototype._evaluateVariable=function(e){return aG(e,this._value)};function VT(e){return e._value==="feature"}Bt.prototype._evaluateMemberDot=function(e){if(VT(this._left))return aG(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||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]};Bt.prototype._evaluateMemberBrackets=function(e){if(VT(this._left))return aG(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||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]};Bt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Bt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Bt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Un.getCartesian2());if(t instanceof h)return h.negate(t,Un.getCartesian3());if(t instanceof se)return se.negate(t,Un.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Bt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof h||t instanceof se||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Bt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Bt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Bt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Bt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Bt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Bt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Bt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Un.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Un.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Un.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Un.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Un.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Un.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Un.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Un.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Un.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,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Bt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Bt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Bt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Bt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Bt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Bt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Bt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Bt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Bt.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(r){throw new oe(r)}return i};Bt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`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)};Bt.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 oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Bt.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 oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`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};Bt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof h||t instanceof se)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function bxe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Mt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,rG)}function xxe(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Mt.LITERAL_NUMBER)return;let i=rG;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 MA(e){return e%1===0?e.toFixed(1):e.toString()}function yot(e){let t=MA(e.red),n=MA(e.green),i=MA(e.blue);return`vec3(${t}, ${n}, ${i})`}function iG(e){let t=MA(e.red),n=MA(e.green),i=MA(e.blue),r=MA(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function Txe(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function Exe(e,t){return l(t[e])?t[e]:bm.NULL_SENTINEL}bm.NULL_SENTINEL="czm_infinity";Bt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=Txe(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=Txe(this._value,e,t,this));let u,f,d;switch(a){case Mt.VARIABLE:return VT(this)?void 0:Exe(c,e);case Mt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(oG[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Mt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(sG[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Mt.TERNARY:if(l(NQ[c]))return`${c}(${r}, ${o}, ${s})`;break;case Mt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Mt.MEMBER:return VT(this._left)?Exe(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Mt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Mt.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 oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Mt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Mt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Mt.LITERAL_NULL:return bm.NULL_SENTINEL;case Mt.LITERAL_BOOLEAN:return c?"true":"false";case Mt.LITERAL_NUMBER:return MA(c);case Mt.LITERAL_STRING:if(l(n)&&n._type===Mt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||VT(n._left)))return c;if(i=z.fromCssColorString(c,rG),l(i))return yot(i);throw new oe("Error generating style shader: String literals are not supported.");case Mt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=xxe(this),l(i)?iG(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=xxe(this),l(i)?iG(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=bxe(this),l(i)?iG(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=bxe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),iG(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Mt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Mt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Mt.LITERAL_UNDEFINED:return bm.NULL_SENTINEL;case Mt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Bt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].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,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case Mt.VARIABLE:VT(this)||e.push(s);break;case Mt.VARIABLE_IN_STRING:for(a=fF.exec(s);a!==null;)e.push(a[1]),a=fF.exec(s);break;case Mt.LITERAL_STRING:l(t)&&t._type===Mt.MEMBER&&VT(t._left)&&e.push(s);break}};var Zd=bm;function i_(e){e=e??H.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=e.center??h.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=z.clone(z.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=e.classificationType??ti.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(i_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Aot={position:0,a_batchId:1};function bot(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new zn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new zn({context:t,attributes:o,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function xot(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??Aot,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ye.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() { czm_non_pick_main(); - out_FragColor = ${o}; + out_FragColor = ${r}; } -`,e._spPick=Jt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(MC),l=n.getFragmentShaderCallback(!1,void 0,!0)(Jg);o=n.getPickId();let u=new He({sources:[a]}),f=new He({defines:["VECTOR_TILE"],sources:[l]});e._sp=Jt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new He({sources:[MC]}),f=new He({defines:["VECTOR_TILE"],sources:[Jg]}),e._spStencil=Jt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),l=He.replaceMain(l,"czm_non_pick_main"),l=`${l} +`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)($S),c=n.getFragmentShaderCallback(!1,void 0,!0)(PA);r=n.getPickId();let u=new Ye({sources:[a]}),f=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ye({sources:[$S]}),f=new Ye({defines:["VECTOR_TILE"],sources:[PA]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ye.replaceMain(c,"czm_non_pick_main"),c=`${c} void main() { czm_non_pick_main(); - out_FragColor = ${o}; + out_FragColor = ${r}; } -`;let h=new He({sources:[a]}),p=new He({defines:["VECTOR_TILE"],sources:[l]});e._spPick=Jt.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function Cre(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:t,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}var QBe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},JBe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function e3e(e){c(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(Cre(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Cre(!0)),e._rsColorPass=Ve.fromCache(QBe),e._rsPickPass=Ve.fromCache(JBe))}var ox=new B,Ere=new d;function t3e(e,t){if(c(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return B.clone(i,ox),B.multiplyByPoint(ox,e._center,Ere),B.setTranslation(ox,Ere,ox),B.multiply(o,ox,ox),ox},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function s9(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,l=r.length;for(let u=0;u<l;++u){let f=r[u],h=s[f],p=i[h],g=o[h],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[h]=n,n+=g}return n}function n3e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),l=[a],u=s9(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(G.equals(f.color,a.color))u=s9(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=s9(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,l.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=l}function a9(e,t,n,i,o,r,s){let a=e.bytesPerIndex,l=r.length;for(let u=0;u<l;++u){let f=r[u],h=s[f],p=i[h],g=o[h];t.copyFromBuffer(e,p*a,n*a,g*a),i[h]=n,n+=g}return n}function i3e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,l=e._vaSwap.indexBuffer,u=a9(a,l,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(G.equals(h.color,r.color))u=a9(a,l,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=a9(a,l,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function o3e(e,t){return t.color.toRgba()-e.color.toRgba()}function r3e(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 l=n[s].color.toRgba();if(c(r[l])){o=!0;break}else r[l]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(o3e),t.webgl2?i3e(e,n):n3e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function s3e(e,t){let n=r3e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(c(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,l=e._sp,u=e._modelMatrix??B.IDENTITY,f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,m=o[p].count,y=i[p*2];c(y)||(y=i[p*2]=new Qe({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=l,y.uniformMap=f,y.boundingVolume=h,y.cull=!1,y.pass=De.TERRAIN_CLASSIFICATION;let b=Qe.shallowClone(y,y.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=De.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=b;let x=i[p*2+1];c(x)||(x=i[p*2+1]=new Qe({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsColorPass,x.shaderProgram=l,x.uniformMap=f,x.boundingVolume=h,x.cull=!1,x.pass=De.TERRAIN_CLASSIFICATION;let A=Qe.shallowClone(x,x.derivedCommands.tileset);A.pass=De.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=A}e._commandsDirty=!0}function a3e(e,t){if(e.classificationType===Un.TERRAIN||!t.invertClassification||c(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 l=0;l<s;++l){let u=i[l]=Qe.shallowClone(n[a],i[l]);u.shaderProgram=o,u.pass=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function c3e(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=e._modelMatrix??B.IDENTITY,a=e._uniformMap;for(let l=0;l<t;++l){let u=e._indexOffsets[l],f=e._indexCounts[l],h=c(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,p=n[l*2];c(p)||(p=n[l*2]=new Qe({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=De.TERRAIN_CLASSIFICATION;let g=Qe.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=De.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[l*2+1];c(m)||(m=n[l*2+1]=new Qe({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=h,m.pass=De.TERRAIN_CLASSIFICATION;let y=Qe.shallowClone(m,m.derivedCommands.tileset);y.pass=De.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}$p.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 Ws(e,r)}};$p.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function l3e(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=G.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=G.clone(G.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var u3e=new G,f3e=G.WHITE,d3e=!0,h3e=/\$/;$p.prototype.applyStyle=function(e,t){if(!c(e)){l3e(this,t);return}let n=e.color,i=n instanceof Lf&&!h3e.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],l=t[a];l.color=c(e.color)?e.color.evaluateColor(l,u3e):f3e,l.show=c(e.show)?e.show.evaluate(l):d3e}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=G.clone(G.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};$p.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!c(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],l=this._batchedIndices,u=l.length,f;for(f=0;f<u;++f){let y=l[f].offset,b=l[f].count;if(s>=y&&s<y+b)break}l.push(new bm({color:G.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],g=l[f].batchIds,m=g.length;for(let y=0;y<m;++y){let b=g[y];if(b===e)continue;let x=n[b];o[x]<s?h.push(b):p.push(b)}p.length!==0&&l.push(new bm({color:G.clone(l[f].color),offset:s+a,count:l[f].offset+l[f].count-(s+a),batchIds:p})),h.length!==0?(l[f].count=s-l[f].offset,l[f].batchIds=h):l.splice(f,1),this._batchDirty=!0};function Sre(e,t,n,i){let o=e.classificationType,r=o!==Un.CESIUM_3D_TILE,s=o!==Un.TERRAIN,a=t.commandList,l=n.length,u,f;for(f=0;f<l;++f)r&&(u=n[f],u.pass=De.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=De.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!c(i)))for(l=i.length,f=0;f<l;++f)a.push(i[f])}function m3e(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=De.OPAQUE,n.push(r)}}function p3e(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;c(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.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}$p.prototype.update=function(e){let t=e.context;$Be(this,t),ZBe(this,t),e3e(this),t3e(this,t);let n=e.passes;n.render&&(s3e(this,t),a3e(this,e),p3e(this),this._debugWireframe?m3e(e,this._commands):Sre(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(c3e(this),Sre(this,e,this._pickCommands))};$p.prototype.isDestroyed=function(){return!1};$p.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(),de(this)};var rx=$p;function Su(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,c(this._center)||(c(this._boundingVolume)?this._center=d.clone(this._boundingVolume.center):this._center=d.clone(d.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=Un.BOTH}Object.defineProperties(Su.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Su.packedBoxLength=B.packedLength+d.packedLength;Su.packedCylinderLength=B.packedLength+2;Su.packedEllipsoidLength=B.packedLength+d.packedLength;Su.packedSphereLength=d.packedLength+1;function _3e(e){let t=new Float64Array(B.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,B.pack(e._modelMatrix,t,n),t}function g3e(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let l=0;l<o;++l)r[l]=le.unpack(t,n),n+=le.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let l=0;l<s;++l){let u=G.unpack(t,n);n+=G.packedLength;let f=t[n++],h=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[l]=new bm({color:u,offset:f,count:h,batchIds:g})}return i}var y3e=new yi("createVectorTileGeometries",5),b3e=new G;function x3e(e){if(!c(e._primitive)&&!c(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,l=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!c(u)){let m=0;c(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),c(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),c(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),c(e._spheres)&&(a=e._sphere=a.slice(),l=e._sphereBatchIds=l.slice(),m+=l.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let b=0;b<m;++b){let x=y.getColor(b,b3e);u[b]=x.toRgba()}f=e._packedBuffer=_3e(e)}let h=[];c(t)&&h.push(t.buffer,n.buffer),c(i)&&h.push(i.buffer,o.buffer),c(r)&&h.push(r.buffer,s.buffer),c(a)&&h.push(a.buffer,l.buffer),h.push(u.buffer,f.buffer);let p={boxes:c(t)?t.buffer:void 0,boxBatchIds:c(t)?n.buffer:void 0,cylinders:c(i)?i.buffer:void 0,cylinderBatchIds:c(i)?o.buffer:void 0,ellipsoids:c(r)?r.buffer:void 0,ellipsoidBatchIds:c(r)?s.buffer:void 0,spheres:c(a)?a.buffer:void 0,sphereBatchIds:c(a)?l.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=y3e.scheduleTask(p,h);return c(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);g3e(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),T3e(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function T3e(e){c(e._primitive)||(e._primitive=new rx({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: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)}Su.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Su.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Su.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Su.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Su.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=x3e(this)),c(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)};Su.prototype.isDestroyed=function(){return!1};Su.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var Zp=Su;function xm(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,E3e(this,i,o)}Object.defineProperties(xm.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return c(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return c(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 A3e(e){return function(t,n){c(e._geometries)&&e._geometries.updateCommands(t,n)}}function C3e(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,l=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&c(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(l>0&&c(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,l)}if(u>0&&c(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&c(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=c(n)||c(i)||c(o)||c(r),p=a>0&&!c(n)||l>0&&!c(i)||u>0&&!c(o)||f>0&&!c(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)&&!c(r)){let m=0;if(!c(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!c(i)&&l>0)for(i=new Uint16Array(l),s=0;s<l;++s)i[s]=m++;if(!c(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!c(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var sx=Uint32Array.BYTES_PER_ELEMENT;function E3e(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=sx;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=sx;let s=o.getUint32(n,!0);if(n+=sx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=sx,a===0)throw new ae("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=sx;let u=o.getUint32(n,!0);n+=sx;let f=o.getUint32(n,!0);n+=sx;let h=ir(i,n,a);n+=a;let p=new Uint8Array(t,n,l);n+=l;let g,m;u>0&&(g=ir(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=h.BOXES_LENGTH??0,b=h.CYLINDERS_LENGTH??0,x=h.ELLIPSOIDS_LENGTH??0,A=h.SPHERES_LENGTH??0,C=y+b+x+A,S=new Kp(e,C,g,m,A3e(e));if(e._batchTable=S,C===0)return;let v=e.tile.computedTransform,P;c(h.RTC_CENTER)&&(P=d.unpack(h.RTC_CENTER),B.multiplyByPoint(v,P,P));let M=C3e(h,p);if(y>0||b>0||x>0||A>0){let R,L,F,_;if(y>0){let w=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,w,Zp.packedBoxLength*y)}if(b>0){let w=p.byteOffset+h.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,w,Zp.packedCylinderLength*b)}if(x>0){let w=p.byteOffset+h.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,w,Zp.packedEllipsoidLength*x)}if(A>0){let w=p.byteOffset+h.SPHERES.byteOffset;_=new Float32Array(p.buffer,w,Zp.packedSphereLength*A)}return e._geometries=new Zp({boxes:R,boxBatchIds:M.boxes,cylinders:L,cylinderBatchIds:M.cylinders,ellipsoids:F,ellipsoidBatchIds:M.ellipsoids,spheres:_,sphereBatchIds:M.spheres,center:P,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function wre(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}xm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};xm.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new E(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return wre(this),this._features[e]};xm.prototype.applyDebugSettings=function(e,t){c(this._geometries)&&this._geometries.applyDebugSettings(e,t)};xm.prototype.applyStyle=function(e){wre(this),c(this._geometries)&&this._geometries.applyStyle(e,this._features)};xm.prototype.update=function(e,t){c(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),c(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};xm.prototype.pick=function(e,t,n){};xm.prototype.isDestroyed=function(){return!1};xm.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};var n1=xm;var c9={};c9.encode2D=function(e,t,n){let i=Math.pow(2,e);if(T.typeOf.number("level",e),T.typeOf.number("x",t),T.typeOf.number("y",n),e<1)throw new E("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new E("Invalid coordinates for given level.");let o={x:t,y:n},r,s,a,l=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,l+=BigInt((3*r^s)*a*a),vre(i,o,r,s);return l};c9.decode2D=function(e,t){if(T.typeOf.number("level",e),T.typeOf.bigint("index",t),e<1)throw new E("Hilbert level cannot be less than 1.");if(t<BigInt(0)||t>=BigInt(Math.pow(4,e)))throw new E("Hilbert index exceeds valid maximum for given level.");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)),vre(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function vre(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 LC=c9;var fy=30,S3e=1<<fy,w3e=1<<fy+1>>>0,l9=2*fy+1,cy=4,Ire=[],Ore=[],v3e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ly=1,NC=2,KV=[ly,0,0,ly|NC];function hr(e){if(!Vt.supportsBigInt())throw new ae("S2 required BigInt support");if(!c(e))throw new E("cell ID is required.");if(!hr.isValidId(e))throw new E("cell ID is invalid.");this._cellId=e,this._level=hr.getLevel(e)}hr.fromToken=function(e){if(T.typeOf.string("token",e),!hr.isValidToken(e))throw new E("token is invalid.");return new hr(hr.getIdFromToken(e))};hr.isValidId=function(e){return T.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(l9)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};hr.isValidToken=function(e){return T.typeOf.string("token",e),/^[0-9a-fA-F]{1,16}$/.test(e)?hr.isValidId(hr.getIdFromToken(e)):!1};hr.getIdFromToken=function(e){return T.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))};hr.getTokenFromId=function(e){T.typeOf.bigint("cellId",e);let t=Math.floor(B3e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};hr.getLevel=function(e){if(T.typeOf.bigint("cellId",e),!hr.isValidId(e))throw new E;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return fy-(t>>1)};hr.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>3)throw new E("child index must be in the range [0-3].");if(this._level===30)throw new E("cannot get child of leaf cell.");let t=Lre(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new hr(n)};hr.prototype.getParent=function(){if(this._level===0)throw new E("cannot get parent of root cell.");let e=Lre(this._cellId)<<BigInt(2);return new hr(this._cellId&~e+BigInt(1)|e)};hr.prototype.getParentAtLevel=function(e){if(this._level===0||e<0||this._level<e)throw new E("cannot get parent at invalid level.");let t=N3e(e);return new hr(this._cellId&-t|t)};hr.prototype.getCenter=function(e){e=e??ie.WGS84;let t=D3e(this._cellId,this._level);t=d.normalize(t,t);let n=new he.fromCartesian(t,ie.UNIT_SPHERE);return he.toCartesian(n,e,new d)};hr.prototype.getVertex=function(e,t){if(T.typeOf.number("index",e),e<0||e>3)throw new E("vertex index must be in the range [0-3].");t=t??ie.WGS84;let n=P3e(this._cellId,this._level,e);n=d.normalize(n,n);let i=new he.fromCartesian(n,ie.UNIT_SPHERE);return he.toCartesian(i,t,new d)};hr.fromFacePositionLevel=function(e,t,n){if(T.typeOf.bigint("position",t),e<0||e>5)throw new E("Invalid S2 Face (must be within 0-5)");if(n<0||n>fy)throw new E("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new E("Invalid Hilbert position for level");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(l9-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new hr(a)};function D3e(e,t){let n=I3e(e,t);return O3e(n[0],n[1],n[2])}function P3e(e,t,n){let i=Rre(e,t),o=R3e([i[1],i[2]],t),r=n>>1&1;return Mre(i[0],o[0][r^n&1],o[1][r])}function I3e(e,t){let n=Rre(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),l=s?1:a?2:0,u=(o<<1)+l,f=(r<<1)+l;return[i,u,f]}function Rre(e){Ire.length===0&&L3e();let t=Number(e>>BigInt(l9)),n=t&ly,i=(1<<cy)-1,o=0,r=0;for(let s=7;s>=0;s--){let l=(1<<2*(s===7?fy-7*cy:cy))-1;n+=Number(e>>BigInt(s*2*cy+1)&BigInt(l))<<2,n=Ore[n];let u=s*cy;o+=n>>cy+2<<u,r+=(n>>2&i)<<u,n&=ly|NC}return[t,o,r]}function O3e(e,t,n){let i=Dre(t),o=Dre(n),r=$V(i),s=$V(o);return Mre(e,r,s)}function Mre(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function $V(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Dre(e){return 1/w3e*e}function R3e(e,t){let n=[[],[]],i=M3e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=$V(Pre(r)),n[o][1]=$V(Pre(s))}return n}function M3e(e){return 1<<fy-e>>>0}function Pre(e){return 1/S3e*e}function uy(e,t,n,i,o,r){if(e===cy){let s=(t<<cy)+n;Ire[(s<<2)+i]=(o<<2)+r,Ore[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=v3e[r];uy(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^KV[0]),uy(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^KV[1]),uy(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^KV[2]),uy(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^KV[3])}}function L3e(){uy(0,0,0,0,0,0),uy(0,0,0,ly,0,ly),uy(0,0,0,NC,0,NC),uy(0,0,0,ly|NC,0,ly|NC)}function Lre(e){return e&~e+BigInt(1)}function N3e(e){return BigInt(1)<<BigInt(2*(fy-e))}var F3e=[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 B3e(e){return F3e[(-e&e)%BigInt(67)]}var Qp=hr;function k3e(e,t){return c(e)&&c(e.extensions)&&c(e.extensions[t])}var oi=k3e;function u9(e){let t=e.lengthBits,n=e.availableCount;T.typeOf.number("options.lengthBits",t);let i=e.constant,o=e.bitstream;if(c(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=e.computeAvailableCountEnabled??!1;!c(n)&&s&&(n=U3e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function U3e(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(u9.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});u9.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new E("Bit index out of bounds.");if(c(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var FC=u9;function Jp(e){e=e??W.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;T.typeOf.object("options.metadataTable",t),T.typeOf.object("options.class",n),T.typeOf.number("options.entityId",i),T.typeOf.object("options.propertyTableJson",o),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var BC=Jp;var ZV={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};ZV.getBranchingFactor=function(e){switch(e){case ZV.OCTREE:return 8;case ZV.QUADTREE:return 4;default:throw new E("subdivisionScheme is not a valid value.")}};var or=Object.freeze(ZV);function ma(){}Object.defineProperties(ma.prototype,{class:{get:function(){E.throwInstantiationError()}}});ma.prototype.hasProperty=function(e){E.throwInstantiationError()};ma.prototype.hasPropertyBySemantic=function(e){E.throwInstantiationError()};ma.prototype.getPropertyIds=function(e){E.throwInstantiationError()};ma.prototype.getProperty=function(e){E.throwInstantiationError()};ma.prototype.setProperty=function(e,t){E.throwInstantiationError()};ma.prototype.getPropertyBySemantic=function(e){E.throwInstantiationError()};ma.prototype.setPropertyBySemantic=function(e,t){E.throwInstantiationError()};ma.hasProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),c(t[e]))return!0;let i=n.properties;if(!c(i))return!1;let o=i[e];return!!(c(o)&&c(o.default))};ma.hasPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return!1;let o=i[e];return c(o)};ma.getPropertyIds=function(e,t,n){T.typeOf.object("properties",e),T.typeOf.object("classDefinition",t),n=c(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&c(e[o])&&n.push(o);let i=t.properties;if(c(i))for(let o in i)i.hasOwnProperty(o)&&!c(e[o])&&c(i[o].default)&&n.push(o);return n};ma.getProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),!c(n.properties[e]))throw new E(`Class definition missing property ${e}`);let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!c(o)&&c(i.default))return o=je(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(c(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ma.setProperty=function(e,t,n,i){if(T.typeOf.string("propertyId",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i),!c(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return c(r)&&(o=r[e]),c(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ma.getPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return;let o=i[e];if(c(o))return ma.getProperty(o.id,t,n)};ma.setPropertyBySemantic=function(e,t,n,i){T.typeOf.string("semantic",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i);let o=i.propertiesBySemantic;if(!c(o))return!1;let r=i.propertiesBySemantic[e];return c(r)?ma.setProperty(r.id,t,n,i):!1};var Bn=ma;function e_(e){e=e??W.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class;T.typeOf.object("options.subtreeMetadata",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(e_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};e_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};e_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};e_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};e_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};e_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};e_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var i1=e_;var Lt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Lt.getMinimum=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:return-128;case Lt.UINT8:return 0;case Lt.INT16:return-32768;case Lt.UINT16:return 0;case Lt.INT32:return-2147483648;case Lt.UINT32:return 0;case Lt.INT64:return Vt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Lt.UINT64:return Vt.supportsBigInt()?BigInt(0):0;case Lt.FLOAT32:return-34028234663852886e22;case Lt.FLOAT64:return-Number.MAX_VALUE}};Lt.getMaximum=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:return 127;case Lt.UINT8:return 255;case Lt.INT16:return 32767;case Lt.UINT16:return 65535;case Lt.INT32:return 2147483647;case Lt.UINT32:return 4294967295;case Lt.INT64:return Vt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Lt.UINT64:return Vt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Lt.FLOAT32:return 34028234663852886e22;case Lt.FLOAT64:return Number.MAX_VALUE}};Lt.isIntegerType=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.INT64:case Lt.UINT64:return!0;default:return!1}};Lt.isUnsignedIntegerType=function(e){switch(T.typeOf.string("type",e),e){case Lt.UINT8:case Lt.UINT16:case Lt.UINT32:case Lt.UINT64:return!0;default:return!1}};Lt.isVectorCompatible=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return!0;default:return!1}};Lt.normalize=function(e,t){if(typeof e!="number"&&typeof e!="bigint")throw new E("value must be a number or a BigInt");if(!Lt.isIntegerType(t))throw new E("type must be an integer type");return Math.max(Number(e)/Number(Lt.getMaximum(t)),-1)};Lt.unnormalize=function(e,t){if(T.typeOf.number("value",e),!Lt.isIntegerType(t))throw new E("type must be an integer type");let n=Lt.getMaximum(t),i=Lt.isUnsignedIntegerType(t)?0:-n;return e=O.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Lt.INT64||t===Lt.UINT64)&&Vt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Lt.applyValueTransform=function(e,t,n){return n*e+t};Lt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Lt.getSizeInBytes=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:case Lt.UINT8:return 1;case Lt.INT16:case Lt.UINT16:return 2;case Lt.INT32:case Lt.UINT32:return 4;case Lt.INT64:case Lt.UINT64:return 8;case Lt.FLOAT32:return 4;case Lt.FLOAT64:return 8}};Lt.fromComponentDatatype=function(e){switch(T.typeOf.number("componentDatatype",e),e){case $.BYTE:return Lt.INT8;case $.UNSIGNED_BYTE:return Lt.UINT8;case $.SHORT:return Lt.INT16;case $.UNSIGNED_SHORT:return Lt.UINT16;case $.INT:return Lt.INT32;case $.UNSIGNED_INT:return Lt.UINT32;case $.FLOAT:return Lt.FLOAT32;case $.DOUBLE:return Lt.FLOAT64}};Lt.toComponentDatatype=function(e){switch(T.typeOf.string("type",e),e){case Lt.INT8:return $.BYTE;case Lt.UINT8:return $.UNSIGNED_BYTE;case Lt.INT16:return $.SHORT;case Lt.UINT16:return $.UNSIGNED_SHORT;case Lt.INT32:return $.INT;case Lt.UINT32:return $.UNSIGNED_INT;case Lt.FLOAT32:return $.FLOAT;case Lt.FLOAT64:return $.DOUBLE}};var Nt=Object.freeze(Lt);var Wo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Wo.isVectorType=function(e){switch(T.typeOf.string("type",e),e){case Wo.VEC2:case Wo.VEC3:case Wo.VEC4:return!0;default:return!1}};Wo.isMatrixType=function(e){switch(T.typeOf.string("type",e),e){case Wo.MAT2:case Wo.MAT3:case Wo.MAT4:return!0;default:return!1}};Wo.getComponentCount=function(e){switch(T.typeOf.string("type",e),e){case Wo.SCALAR:case Wo.STRING:case Wo.ENUM:case Wo.BOOLEAN:return 1;case Wo.VEC2:return 2;case Wo.VEC3:return 3;case Wo.VEC4:return 4;case Wo.MAT2:return 4;case Wo.MAT3:return 9;case Wo.MAT4:return 16;default:throw new E(`Invalid metadata type ${e}`)}};Wo.getMathType=function(e){switch(e){case Wo.VEC2:return H;case Wo.VEC3:return d;case Wo.VEC4:return se;case Wo.MAT2:return Ri;case Wo.MAT3:return J;case Wo.MAT4:return B;default:return}};var at=Object.freeze(Wo);function Ua(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.type;T.typeOf.string("options.id",t),T.typeOf.string("options.type",n);let i=e.componentType,o=e.enumType,r=c(i)&&Nt.isIntegerType(i)&&(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=c(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=je(e.min,!0),this._max=je(e.max,!0),this._normalized=r;let s=je(e.offset,!0),a=je(e.scale,!0),l=c(s)||c(a),u=!0;c(s)||(s=this.expandConstant(0,u)),c(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=l,this._noData=je(e.noData,!0),this._default=je(e.default,!0),this._required=e.required??!0,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}Ua.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.property;T.typeOf.string("options.id",t),T.typeOf.object("options.property",n),T.typeOf.string("options.property.type",n.type);let i=V3e(n),o=z3e(n,e.enums),r;return c(i)?i?r=c(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Ua({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(Ua.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 V3e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===at.SCALAR||at.isMatrixType(t)||at.isVectorType(t))return!1;if(c(Nt[t]))return!0;if(c(e.noData)||c(e.scale)||c(e.offset)||c(e.required)||c(e.count)||c(e.array)||c(e.optional))return!1}function z3e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!c(s)):e.array?(r=!0,s=e.count,a=!c(e.count)):(r=!1,s=void 0,a=!1);let l;if(c(e.enumType)&&(l=t[e.enumType]),n===at.ENUM)return{type:n,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===at.ENUM)return{type:i,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.SCALAR||at.isMatrixType(n)||at.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.BOOLEAN||n===at.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===at.BOOLEAN||i===at.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(i)&&c(Nt[i]))return{type:at.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(Nt[n]))return{type:at.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s};throw new E(`unknown metadata type {type: ${n}, componentType: ${i})`)}Ua.prototype.normalize=function(e){return this._normalized?f9(e,this._valueType,Nt.normalize):e};Ua.prototype.unnormalize=function(e){return this._normalized?f9(e,this._valueType,Nt.unnormalize):e};Ua.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ua.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};Ua.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ua.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};Ua.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=at.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)};Ua.prototype.handleNoData=function(e){let t=this._noData;if(!c(t))return e;if(!kre(e,t))return e};function kre(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(!kre(e[n],t[n]))return!1;return!0}Ua.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Ua.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ua.prototype.validate=function(e){if(!(!c(e)&&c(this._default)))return this._required&&!c(e)?"required property must have a value":this._isArray?H3e(this,e):Ure(this,e)};function H3e(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=Ure(e,t[i]);if(c(o))return o}}function Ure(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return at.isVectorType(n)?G3e(t,n,i):at.isMatrixType(n)?j3e(t,n,i):n===at.STRING?W3e(t):n===at.BOOLEAN?q3e(t):n===at.ENUM?Y3e(t,o):X3e(t,i,r)}function G3e(e,t,n){if(!Nt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===at.VEC2&&!(e instanceof H))return`vector value ${e} must be a Cartesian2`;if(t===at.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===at.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function j3e(e,t,n){if(!Nt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===at.MAT2&&!(e instanceof Ri))return`matrix value ${e} must be a Matrix2`;if(t===at.MAT3&&!(e instanceof J))return`matrix value ${e} must be a Matrix3`;if(t===at.MAT4&&!(e instanceof B))return`matrix value ${e} must be a Matrix4`}function W3e(e){if(typeof e!="string")return QV(e,at.STRING)}function q3e(e){if(typeof e!="boolean")return QV(e,at.BOOLEAN)}function Y3e(e,t){let n=typeof e;if(c(t))return n!=="string"||!c(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function X3e(e,t,n){let i=typeof e;switch(t){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.FLOAT32:case Nt.FLOAT64:return i!=="number"?QV(e,t):isFinite(e)?Fre(e,t,n):Bre(e,t);case Nt.INT64:case Nt.UINT64:return i!=="number"&&i!=="bigint"?QV(e,t):i==="number"&&!isFinite(e)?Bre(e,t):Fre(e,t,n)}}function QV(e,t){return`value ${e} does not match type ${t}`}function Nre(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Fre(e,t,n){if(n){let i=Nt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Nre(e,t,n):void 0}if(e<Nt.getMinimum(t)||e>Nt.getMaximum(t))return Nre(e,t,n)}function Bre(e,t){return`value ${e} of type ${t} must be finite`}function f9(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=f9(e[i],t,n);return e}Ua.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]=Ua.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Tm=Ua;function o1(e){e=e??W.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews;T.typeOf.number.greaterThan("options.count",t,0),T.typeOf.object("options.property",n),T.typeOf.object("options.classProperty",i),T.typeOf.object("options.bufferViews",o);let r=i.type,s=i.isArray,a=i.isVariableLengthArray,l=i.valueType,u=i.enumType,f=r===at.STRING,h=r===at.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Nt[_]??Nt.UINT32;let w=n.arrayOffsets??n.arrayOffsetBufferView;g=new d9(o[w],_,t+1),p+=g.typedArray.byteLength}let m=at.getComponentCount(r),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let b=m*y,x;if(f){let _=n.stringOffsetType??n.offsetType;_=Nt[_]??Nt.UINT32;let w=n.stringOffsets??n.stringOffsetBufferView;x=new d9(o[w],_,b+1),p+=x.typedArray.byteLength}(f||h)&&(l=Nt.UINT8);let A;f?A=x.get(b)-x.get(0):h?A=Math.ceil(b/8):A=b;let C=n.values??n.bufferView,S=new d9(o[C],l,A);p+=S.typedArray.byteLength;let v=n.offset,P=n.scale,M=i.hasValueTransform||c(v)||c(P);v=v??i.offset,P=P??i.scale,v=Vre(v),P=Vre(P);let R,L,F=this;f?R=function(_){return Z3e(_,F._values,F._stringOffsets)}:h?(R=function(_){return Q3e(_,F._values)},L=function(_,w){J3e(_,F._values,w)}):c(u)?(R=function(_){let w=F._values.get(_);return u.namesByValue[w]},L=function(_,w){let D=u.valuesByName[w];F._values.set(_,D)}):(R=function(_){return F._values.get(_)},L=function(_,w){F._values.set(_,w)}),this._arrayOffsets=g,this._stringOffsets=x,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=P,this._hasValueTransform=M,this._getValue=R,this._setValue=L,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(o1.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}}});o1.prototype.get=function(e){zre(this,e);let t=K3e(this,e);return t=this._classProperty.handleNoData(t),c(t)?(t=this._classProperty.normalize(t),t=ake(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};o1.prototype.set=function(e,t){let n=this._classProperty;T.defined("value",t),zre(this,e);let i=n.validate(t);if(c(i))throw new E(i);t=n.packVectorAndMatrixTypes(t),t=cke(this,t),t=n.unnormalize(t),$3e(this,e,t)};o1.prototype.getTypedArray=function(){if(c(this._values))return this._values.typedArray};function Vre(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 zre(e,t){let n=e._count;if(!c(t)||t<0||t>=n){let i=n-1;throw new E(`index is required and between zero and count - 1. Actual value: ${i}`)}}function K3e(e,t){Gre(e)&&jre(e);let n=e._classProperty,i=n.isArray,o=n.type,r=at.getComponentCount(o);if(c(e._unpackedValues)){let s=e._unpackedValues[t];return i?je(s,!0):s}return!i&&r===1?e._getValue(t):Hre(e,n,t)}function Hre(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=at.getComponentCount(t.type);i*=s,o*=s}else{let a=(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 $3e(e,t,n){rke(e,t,n)&&jre(e);let i=e._classProperty,o=i.isArray,r=i.type,s=at.getComponentCount(r);if(c(e._unpackedValues)){i.isArray&&(n=je(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,l;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),l=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,l=f}for(let u=0;u<l;++u)e._setValue(a+u,n[u])}function Z3e(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Fl(t.typedArray,i,o)}function Q3e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function J3e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function eke(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=l*Math.pow(256,a)}return r&&(o=-o),o}function tke(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=BigInt(l)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function nke(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 ike(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 oke(e){switch(e){case Nt.INT8:return $.BYTE;case Nt.UINT8:return $.UNSIGNED_BYTE;case Nt.INT16:return $.SHORT;case Nt.UINT16:return $.UNSIGNED_SHORT;case Nt.INT32:return $.INT;case Nt.UINT32:return $.UNSIGNED_INT;case Nt.FLOAT32:return $.FLOAT;case Nt.FLOAT64:return $.DOUBLE}}function Gre(e){if(c(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===at.STRING||i===Nt.INT64&&!Vt.supportsBigInt64Array()||i===Nt.UINT64&&!Vt.supportsBigUint64Array()}function rke(e,t,n){if(Gre(e))return!0;let i=e._arrayOffsets;if(c(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function jre(e){e._unpackedValues=ske(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function ske(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=at.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]=Hre(e,i,a);return n}function ake(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Tm.valueTransformInPlace(t,e._offset,e._scale,Nt.applyValueTransform)}function cke(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Tm.valueTransformInPlace(t,e._offset,e._scale,Nt.unapplyValueTransform)}function d9(e,t,n){let i=this,o,r,s;if(t===Nt.INT64)Vt.supportsBigInt()?Vt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return tke(a,i)}):(dt("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 eke(a,i)});else if(t===Nt.UINT64)Vt.supportsBigInt()?Vt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return ike(a,i)}):(dt("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 nke(a,i)});else{let a=oke(t);o=$.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(l,u){i.typedArray[l]=u}}c(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 r1=o1;function Zd(e){e=e??W.EMPTY_OBJECT;let t=e.count,n=e.class;T.typeOf.number.greaterThan("options.count",t,0),T.typeOf.object("options.class",n);let i=0,o={};if(c(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new r1({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(Zd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Zd.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Zd.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Zd.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Zd.prototype.getProperty=function(e,t){T.typeOf.string("propertyId",t);let n=this._properties[t],i;return c(n)?i=n.get(e):i=lke(this._class,t),i};Zd.prototype.setProperty=function(e,t,n){T.typeOf.string("propertyId",t);let i=this._properties[t];return c(i)?(i.set(e,n),!0):!1};Zd.prototype.getPropertyBySemantic=function(e,t){T.typeOf.string("semantic",t);let n,i=this._class.propertiesBySemantic;if(c(i)&&(n=i[t]),c(n))return this.getProperty(e,n.id)};Zd.prototype.setPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",t);let i,o=this._class.propertiesBySemantic;return c(o)&&(i=o[t]),c(i)?this.setProperty(e,i.id,n):!1};Zd.prototype.getPropertyTypedArray=function(e){T.typeOf.string("propertyId",e);let t=this._properties[e];if(c(t))return t.getTypedArray()};Zd.prototype.getPropertyTypedArrayBySemantic=function(e){T.typeOf.string("semantic",e);let t,n=this._class.propertiesBySemantic;if(c(n)&&(t=n[e]),c(t))return this.getPropertyTypedArray(t.id)};function lke(e,t){let n=e.properties;if(!c(n))return;let i=n[t];if(c(i)&&c(i.default)){let o=i.default;return i.isArray&&(o=je(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Nf=Zd;function dy(){}Object.defineProperties(dy.prototype,{cacheKey:{get:function(){E.throwInstantiationError()}}});dy.prototype.load=function(){E.throwInstantiationError()};dy.prototype.unload=function(){};dy.prototype.process=function(e){return!1};dy.prototype.getError=function(e,t){T.typeOf.string("errorMessage",e),c(t)&&c(t.message)&&(e+=` -${t.message}`);let n=new ae(e);return c(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){return this.unload(),de(this)};var $i=dy;var uke={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},gt=Object.freeze(uke);function t_(e){e=e??W.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new E("One of options.typedArray and options.resource must be defined.");this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(t_.prototype=Object.create($i.prototype),t_.prototype.constructor=t_);Object.defineProperties(t_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});t_.prototype.load=async function(){return c(this._promise)?this._promise:c(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=fke(this),this._promise)};async function fke(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t_._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}t_._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};t_.prototype.unload=function(){this._typedArray=void 0};var ax=t_;var Zre=Zo($re(),1);function cx(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.bufferViewId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.bufferViews[i],l=a.buffer,u=a.byteOffset,f=a.byteLength,h=!1,p,g,m,y;if(oi(a,"EXT_meshopt_compression")){let x=a.extensions.EXT_meshopt_compression;l=x.buffer,u=x.byteOffset??0,f=x.byteLength,h=!0,p=x.byteStride,g=x.count,m=x.mode,y=x.filter??"NONE"}let b=n.buffers[l];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=m,this._meshoptFilter=y,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=l,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(cx.prototype=Object.create($i.prototype),cx.prototype.constructor=cx);Object.defineProperties(cx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function _ke(e){try{let t=gke(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);Zre.MeshoptDecoder.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}cx.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=_ke(this),this._promise)};function gke(e){let t=e._resourceCache,n=e._buffer;if(c(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}cx.prototype.unload=function(){c(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var kC=cx;function zr(){}zr._maxDecodingConcurrency=Math.max(Vt.hardwareConcurrency-1,1);zr._decoderTaskProcessor=void 0;zr._taskProcessorReady=!1;zr._error=void 0;zr._getDecoderTaskProcessor=function(){if(!c(zr._decoderTaskProcessor)){let e=new yi("decodeDraco",zr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?zr._taskProcessorReady=!0:zr._error=new ae("Draco decoder could not be initialized.")}).catch(t=>{zr._error=t}),zr._decoderTaskProcessor=e}return zr._decoderTaskProcessor};zr.decodePointCloud=function(e){let t=zr._getDecoderTaskProcessor();if(c(zr._error))throw zr._error;if(zr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};zr.decodeBufferView=function(e){let t=zr._getDecoderTaskProcessor();if(c(zr._error))throw zr._error;if(zr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var n_=zr;var ri={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function yke(e){switch(e){case ri.POSITION:return"positionMC";case ri.NORMAL:return"normalMC";case ri.TANGENT:return"tangentMC";case ri.TEXCOORD:return"texCoord";case ri.COLOR:return"color";case ri.JOINTS:return"joints";case ri.WEIGHTS:return"weights";case ri.FEATURE_ID:return"featureId";default:throw new E("semantic is not a valid value.")}}ri.hasSetIndex=function(e){switch(T.typeOf.string("semantic",e),e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return!1;case ri.TEXCOORD:case ri.COLOR:case ri.JOINTS:case ri.WEIGHTS:case ri.FEATURE_ID:return!0;default:throw new E("semantic is not a valid value.")}};ri.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ri.POSITION;case"NORMAL":return ri.NORMAL;case"TANGENT":return ri.TANGENT;case"TEXCOORD":return ri.TEXCOORD;case"COLOR":return ri.COLOR;case"JOINTS":return ri.JOINTS;case"WEIGHTS":return ri.WEIGHTS;case"_FEATURE_ID":return ri.FEATURE_ID}};ri.fromPntsSemantic=function(e){switch(T.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return ri.POSITION;case"RGBA":case"RGB":case"RGB565":return ri.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ri.NORMAL;case"BATCH_ID":return ri.FEATURE_ID;default:throw new E("pntsSemantic is not a valid value.")}};ri.getGlslType=function(e){switch(T.typeOf.string("semantic",e),e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return"vec3";case ri.TEXCOORD:return"vec2";case ri.COLOR:return"vec4";case ri.JOINTS:return"ivec4";case ri.WEIGHTS:return"vec4";case ri.FEATURE_ID:return"int";default:throw new E("semantic is not a valid value.")}};ri.getVariableName=function(e,t){T.typeOf.string("semantic",e);let n=yke(e);return c(t)&&(n+=`_${t}`),n};var ht=Object.freeze(ri);function hy(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.primitive",i),T.typeOf.object("options.draco",o),T.typeOf.object("options.gltfResource",r),T.typeOf.object("options.baseResource",s),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=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}c(Object.create)&&(hy.prototype=Object.create($i.prototype),hy.prototype.constructor=hy);Object.defineProperties(hy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function bke(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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Qre(e,n)}}hy.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=bke(this),this._promise)};function Qre(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function xke(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var lx={};lx[ht.POSITION]="POSITION";lx[ht.NORMAL]="NORMAL";lx[ht.COLOR]="COLOR";lx[ht.TEXCOORD]="TEX_COORD";function Tke(e){for(let t in lx)if(lx.hasOwnProperty(t)&&e.startsWith(t))return lx[t]}hy.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(c(this._dracoError)&&Qre(this,this._dracoError),!c(this._bufferViewTypedArray))||c(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,l=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=Tke(h);c(p)&&i.accessors[n.attributes[h]].componentType===$.FLOAT&&(l.includes(p)||l.push(p))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:l},f=n_.decodeBufferView(u);if(!c(f))return!1;this._decodePromise=xke(this,f)};hy.prototype.unload=function(){c(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 UC=hy;function Ake(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1;T.typeOf.object("uint8Array",t),T.typeOf.string("format",n);let s=new Blob([t],{type:n}),a;return we.supportsImageBitmapOptions().then(function(l){return l?Promise.resolve(we.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new we({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(l){return c(a)&&window.URL.revokeObjectURL(a),l}).catch(function(l){return c(a)&&window.URL.revokeObjectURL(a),Promise.reject(l)})}var ux=Ake;function i_(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.imageId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.images[i],l=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=l,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(i_.prototype=Object.create($i.prototype),i_.prototype.constructor=i_);Object.defineProperties(i_.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});i_.prototype.load=function(){return c(this._promise)?this._promise:c(this._bufferViewId)?(this._promise=Cke(this),this._promise):(this._promise=Eke(this),this._promise)};function Jre(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 Cke(e){e._state=gt.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 wke(i);if(e.isDestroyed())return;let r=Jre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:ese(e,n,"Failed to load embedded image")}}async function Eke(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await Dke(i);if(e.isDestroyed())return;let r=Jre(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:ese(e,o,`Failed to load image: ${n}`)}}function ese(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function Ske(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 wke(e){let t=Ske(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Il(n)}return i_._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var vke=/(^data:image\/ktx2)|(\.ktx2$)/i;function Dke(e){let t=e.getUrlComponent(!1,!0);return vke.test(t)?Il(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}i_.prototype.unload=function(){c(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};i_._loadImageFromTypedArray=ux;var VC=i_;var Pke={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},pa=Object.freeze(Pke);function my(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,l=e.cacheKey,u=e.asynchronous??!0,f=e.loadBuffer??!1,h=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.accessorId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),!f&&!h)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let 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=l,this._asynchronous=u,this._loadBuffer=f,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(my.prototype=Object.create($i.prototype),my.prototype.constructor=my);Object.defineProperties(my.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 Ike=new y9;my.prototype.load=async function(){return c(this._promise)?this._promise:c(this._draco)?(this._promise=Oke(this),this._promise):(this._promise=Rke(this),this._promise)};async function Oke(e){e._state=gt.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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;g9(e,n)}}async function Rke(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.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=Mke(e,a),e._state=gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;g9(e,s)}}function Mke(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Fe.getSizeInBytes(s),l=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,p=new Uint8Array(l,u,h);l=new Uint8Array(p).buffer,u=0,ws("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Fe.UNSIGNED_BYTE?f=new Uint8Array(l,u,r):s===Fe.UNSIGNED_SHORT?f=new Uint16Array(l,u,r):s===Fe.UNSIGNED_INT&&(f=new Uint32Array(l,u,r)),f}function g9(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}function y9(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}y9.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};y9.prototype.execute=function(){this.buffer=tse(this.typedArray,this.indexDatatype,this.context)};function tse(e,t,n){let i=yt.createIndexBuffer({typedArray:e,context:n,usage:Be.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}my.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(c(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=$.fromTypedArray(t),this._indexDatatype=n)}catch(o){g9(this,o)}if(!c(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=Ike;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,pa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=tse(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};my.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 zC=my;function Lke(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var vs=Lke;function Nke(e,t){return c(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var mr=Nke;function Xt(){}Xt.objectLegacy=function(e,t){if(c(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}}};Xt.object=function(e,t){if(c(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(c(r))return r}}};Xt.topLevel=function(e,t,n){let i=e[t];return c(i)&&!Array.isArray(i)?Xt.objectLegacy(i,n):Xt.object(i,n)};Xt.accessor=function(e,t){return Xt.topLevel(e,"accessors",t)};Xt.accessorWithSemantic=function(e,t,n){let i={};return Xt.mesh(e,function(o){return Xt.meshPrimitive(o,function(r){let s=Xt.meshPrimitiveAttribute(r,function(a,l){if(l.indexOf(t)===0&&!c(i[a])){i[a]=!0;let u=n(a);if(c(u))return u}});return c(s)?s:Xt.meshPrimitiveTarget(r,function(a){return Xt.meshPrimitiveTargetAttribute(a,function(l,u){if(u.indexOf(t)===0&&!c(i[l])){i[l]=!0;let f=n(l);if(c(f))return f}})})})})};Xt.accessorContainingVertexAttributeData=function(e,t){let n={};return Xt.mesh(e,function(i){return Xt.meshPrimitive(i,function(o){let r=Xt.meshPrimitiveAttribute(o,function(s){if(!c(n[s])){n[s]=!0;let a=t(s);if(c(a))return a}});return c(r)?r:Xt.meshPrimitiveTarget(o,function(s){return Xt.meshPrimitiveTargetAttribute(s,function(a){if(!c(n[a])){n[a]=!0;let l=t(a);if(c(l))return l}})})})})};Xt.accessorContainingIndexData=function(e,t){let n={};return Xt.mesh(e,function(i){return Xt.meshPrimitive(i,function(o){let r=o.indices;if(c(r)&&!c(n[r])){n[r]=!0;let s=t(r);if(c(s))return s}})})};Xt.animation=function(e,t){return Xt.topLevel(e,"animations",t)};Xt.animationChannel=function(e,t){let n=e.channels;return Xt.object(n,t)};Xt.animationSampler=function(e,t){let n=e.samplers;return Xt.object(n,t)};Xt.buffer=function(e,t){return Xt.topLevel(e,"buffers",t)};Xt.bufferView=function(e,t){return Xt.topLevel(e,"bufferViews",t)};Xt.camera=function(e,t){return Xt.topLevel(e,"cameras",t)};Xt.image=function(e,t){return Xt.topLevel(e,"images",t)};Xt.material=function(e,t){return Xt.topLevel(e,"materials",t)};Xt.materialValue=function(e,t){let n=e.values;c(e.extensions)&&c(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(c(o))return o}};Xt.mesh=function(e,t){return Xt.topLevel(e,"meshes",t)};Xt.meshPrimitive=function(e,t){let n=e.primitives;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(c(s))return s}}};Xt.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(c(o))return o}};Xt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(c(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(c(r))return r}}};Xt.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(c(o))return o}};Xt.node=function(e,t){return Xt.topLevel(e,"nodes",t)};Xt.nodeInTree=function(e,t,n){let i=e.nodes;if(c(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(c(a)){let l=n(a,s);if(c(l))return l;let u=a.children;if(c(u)&&(l=Xt.nodeInTree(e,u,n),c(l)))return l}}}};Xt.nodeInScene=function(e,t,n){let i=t.nodes;if(c(i))return Xt.nodeInTree(e,i,n)};Xt.program=function(e,t){return mr(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.programs,t):Xt.topLevel(e,"programs",t)};Xt.sampler=function(e,t){return Xt.topLevel(e,"samplers",t)};Xt.scene=function(e,t){return Xt.topLevel(e,"scenes",t)};Xt.shader=function(e,t){return mr(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.shaders,t):Xt.topLevel(e,"shaders",t)};Xt.skin=function(e,t){return Xt.topLevel(e,"skins",t)};Xt.skinJoint=function(e,t){let n=e.joints;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(c(s))return s}}};Xt.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(c(o))return o}};Xt.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(c(o))return o}};Xt.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(c(o))return o}};Xt.technique=function(e,t){return mr(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.techniques,t):Xt.topLevel(e,"techniques",t)};Xt.texture=function(e,t){return Xt.topLevel(e,"textures",t)};var Oe=Xt;function Fke(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 wu=Fke;function Bke(e,t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n];if(c(i.byteStride)&&i.byteStride>0)return i.byteStride}return $.getSizeInBytes(t.componentType)*wu(t.type)}var Ul=Bke;function kke(e){Oe.accessor(e,function(n){c(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Oe.bufferView(e,function(n){c(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=i.mode??ne.TRIANGLES,!c(i.material)){c(e.materials)||(e.materials=[]);let o={name:"default"};i.material=vs(e.materials,o)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,c(o)){let r=e.bufferViews[o];r.byteStride=Ul(e,i),r.target=ne.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(c(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=n.extensions??W.EMPTY_OBJECT,o=i.KHR_materials_common;if(c(o)){let l=o.technique,u=c(o.values)?o.values:{};o.values=u,u.ambient=c(u.ambient)?u.ambient:[0,0,0,1],u.emission=c(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,l!=="CONSTANT"&&(u.diffuse=c(u.diffuse)?u.diffuse:[0,0,0,1],l!=="LAMBERT"&&(u.specular=c(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;c(r)&&Oe.materialValue(n,function(l){c(l.index)&&fx(l)}),fx(n.emissiveTexture),fx(n.normalTexture),fx(n.occlusionTexture);let s=n.pbrMetallicRoughness;c(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,fx(s.baseColorTexture),fx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;c(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,fx(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=Uke(e);return Oe.node(e,function(n,i){c(t[i])||c(n.translation)||c(n.rotation)||c(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Oe.sampler(e,function(n){n.wrapS=n.wrapS??ne.REPEAT,n.wrapT=n.wrapT??ne.REPEAT}),c(e.scenes)&&!c(e.scene)&&(e.scene=0),e}function Uke(e){let t={};return Oe.animation(e,function(n){Oe.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 fx(e){c(e)&&(e.texCoord=e.texCoord??0)}var u1=kke;function Vke(e){return Oe.shader(e,function(t){iz(t)}),Oe.buffer(e,function(t){iz(t)}),Oe.image(e,function(t){iz(t)}),iz(e),e}function iz(e){e.extras=c(e.extras)?e.extras:{},e.extras._pipeline=c(e.extras._pipeline)?e.extras._pipeline:{}}var py=Vke;function zke(e,t){let n=e.extensionsRequired;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var f1=zke;function Hke(e,t){let n=e.extensionsUsed;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),f1(e,t),n.length===0&&delete e.extensionsUsed}}var dx=Hke;var Gke=4;function jke(e){if(Kd(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=nse(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?Wke(e,n):qke(e,n)}function nse(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*Gke,!0);return o}function Wke(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=Fl(e,r,i),l=JSON.parse(a);py(l);let u=e.subarray(s,n),f=l.buffers;if(c(f)&&Object.keys(f).length>0){let h=f.binary_glTF??f.KHR_binary_glTF;c(h)&&(h.extras._pipeline.source=u,delete h.uri)}return dx(l,"KHR_binary_glTF"),l}function qke(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=nse(e,i,2),a=s[0],l=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,l===1313821514){let f=Fl(u);o=JSON.parse(f),py(o)}else l===5130562&&(r=u)}if(c(o)&&c(r)){let s=o.buffers;if(c(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var d1=jke;function Yke(e){return Oe.shader(e,function(t){oz(t)}),Oe.buffer(e,function(t){oz(t)}),Oe.image(e,function(t){oz(t)}),oz(e),e}function oz(e){c(e.extras)&&(c(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var h1=Yke;function Xke(e,t){let n=e.extensionsUsed;c(n)||(n=[],e.extensionsUsed=n),vs(n,t,!0)}var Ff=Xke;function Kke(e){switch(e){case $.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case $.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case $.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case $.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 $.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case $.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 $.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case $.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var o_=Kke;function $ke(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=wu(t.type);if(!c(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),l=n[o],u=l.buffer,h=i[u].extras._pipeline.source,p=t.count,g=Ul(e,t),m=t.byteOffset+l.byteOffset+h.byteOffset,y=t.componentType,b=$.getSizeInBytes(y),x=new DataView(h.buffer),A=new Array(r),C=o_(y);for(let S=0;S<p;S++){C(x,m,r,b,A);for(let v=0;v<r;v++){let P=A[v];s[v]=Math.min(s[v],P),a[v]=Math.max(a[v],P)}m+=g}return{min:s,max:a}}var hx=$ke;var Zke=[ne.FUNC_ADD,ne.FUNC_ADD],Qke=[ne.ONE,ne.ZERO,ne.ONE,ne.ZERO];function ise(e,t){let n=e.enable;return c(n)?n.indexOf(t)>-1:!1}var Jke=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function eUe(e,t){if(!c(e))return t;for(let n=0;n<4;n++)if(Jke.indexOf(e[n])===-1)return t;return e}function tUe(e){let t={},n={},i=e.techniques;return c(i)&&(Oe.technique(e,function(o,r){let s=o.states;if(c(s)){let a=n[r]={};if(ise(s,ne.BLEND)){a.alphaMode="BLEND";let l=s.functions;c(l)&&(c(l.blendEquationSeparate)||c(l.blendFuncSeparate))&&(t[r]={blendEquation:l.blendEquationSeparate??Zke,blendFactors:eUe(l.blendFuncSeparate,Qke)})}ise(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(c(e.extensions)||(e.extensions={}),Ff(e,"KHR_blend")),Oe.material(e,function(o){if(c(o.technique)){let r=n[o.technique];Oe.objectLegacy(r,function(a,l){o[l]=a});let s=t[o.technique];c(s)&&(c(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var m1=tUe;function nUe(e,t){let n=e.extensionsRequired;c(n)||(n=[],e.extensionsRequired=n),vs(n,t,!0),Ff(e,t)}var p1=nUe;function iUe(e){let t=e.techniques,n={},i={},o={};if(c(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,l){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(h,p){f=a.parameters[h],u.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(h,p){f=a.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},c(n[l])||(n[l]={}),n[l][h]=p}),c(o[a.program]))u.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=vs(r.shaders,g,!0);let m=e.shaders[h.vertexShader];p.vertexShader=vs(r.shaders,m,!0),u.program=vs(r.programs,p),o[a.program]=u.program}i[l]=vs(r.techniques,u)}),r.techniques.length>0&&(c(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Ff(e,"KHR_techniques_webgl"),p1(e,"KHR_techniques_webgl"))}return Oe.material(e,function(r){if(c(r.technique)){let s={technique:i[r.technique]};Oe.objectLegacy(r.values,function(a,l){c(s.values)||(s.values={});let u=n[r.technique][l];c(u)&&(s.values[u]=a)}),c(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 _1=iUe;function oUe(e,t){T.typeOf.object("material",e),T.defined("handler",t);let n=e.pbrMetallicRoughness;if(c(n)){if(c(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(c(s))return s}if(c(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(c(s))return s}}let{extensions:i}=e;if(c(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(c(r)){if(c(r.diffuseTexture)){let l=r.diffuseTexture,u=t(l.index,l);if(c(u))return u}if(c(r.specularGlossinessTexture)){let l=r.specularGlossinessTexture,u=t(l.index,l);if(c(u))return u}}let s=i.KHR_materials_specular;if(c(s)){let{specularTexture:l,specularColorTexture:u}=s;if(c(l)){let f=t(l.index,l);if(c(f))return f}if(c(u)){let f=t(u.index,u);if(c(f))return f}}let a=i.KHR_materials_common;if(c(a)&&c(a.values)){let{diffuse:l,ambient:u,emission:f,specular:h}=a.values;if(c(l)&&c(l.index)){let p=t(l.index,l);if(c(p))return p}if(c(u)&&c(u.index)){let p=t(u.index,u);if(c(p))return p}if(c(f)&&c(f.index)){let p=t(f.index,f);if(c(p))return p}if(c(h)&&c(h.index)){let p=t(h.index,h);if(c(p))return p}}}let o=Oe.materialValue(e,function(r){if(c(r.index)){let s=t(r.index,r);if(c(s))return s}});if(c(o))return o;if(c(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(c(s))return s}if(c(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(c(s))return s}if(c(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(c(s))return s}}var HC=oUe;var ose=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function rUe(e,t){return t=t??ose,ose.forEach(function(n){t.indexOf(n)>-1&&aUe(e,n)}),e}var sUe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function aUe(e,t){let n=sUe[t],i=e[n];if(c(i)){let o=0,r=Cm[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Am[t](e,a-o),o++)}}function Am(){}Am.accessor=function(e,t){e.accessors.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){Oe.meshPrimitiveAttribute(o,function(a,l){a>t&&o.attributes[l]--}),Oe.meshPrimitiveTarget(o,function(a){Oe.meshPrimitiveTargetAttribute(a,function(l,u){l>t&&a[u]--})});let r=o.indices;c(r)&&r>t&&o.indices--;let s=o.extensions;c(s)&&c(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Oe.skin(e,function(i){c(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(o){c(o.input)&&o.input>t&&o.input--,c(o.output)&&o.output>t&&o.output--})})};Am.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){c(i.buffer)&&i.buffer>t&&i.buffer--,c(i.extensions)&&c(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Am.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),mr(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.extensions)&&c(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),mr(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(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.bufferView)&&u.bufferView>t&&u.bufferView--,c(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,c(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let u in l)if(l.hasOwnProperty(u)){let f=l[u];c(f.values)&&f.values>t&&f.values--,c(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,c(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Am.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){c(i.source)&&i.source>t&&--i.source;let o=i.extensions;c(o)&&c(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:c(o)&&c(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Am.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){c(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Am.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){c(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(o){c(o.target)&&c(o.target.node)&&o.target.node>t&&o.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(o){c(o.node)&&o.node>t&&o.node--})}),Oe.node(e,function(i){c(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Am.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.material)&&o.material>t&&o.material--})})};Am.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){c(i.sampler)&&i.sampler>t&&--i.sampler})};Am.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){HC(i,function(o,r){r.index>t&&--r.index})}),mr(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(s){let a=s.extensions;if(c(a)&&c(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(c(u)){let f=u.length;for(let h=0;h<f;++h){let g=u[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(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let f=a[l].texture;f.index>t&&--f.index}}}}if(mr(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){let r=o.extensions;if(c(r)&&c(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(c(a)){let l=a.length;for(let u=0;u<l;++u){let f=a[u];c(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),mr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let u in l)if(l.hasOwnProperty(u)){let f=l[u];f.index>t&&--f.index}}}}};function Cm(){}Cm.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Oe.meshPrimitiveTarget(i,function(r){Oe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;c(o)&&(t[o]=!0)})}),Oe.skin(e,function(n){c(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){c(i.input)&&(t[i.input]=!0),c(i.output)&&(t[i.output]=!0)})}),mr(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){c(n.extensions)&&c(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})}),mr(e,"CESIUM_primitive_outline")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;c(s)&&(t[s]=!0)}})}),t};Cm.buffer=function(e){let t={};return Oe.bufferView(e,function(n){c(n.buffer)&&(t[n.buffer]=!0),c(n.extensions)&&c(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Cm.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),mr(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.extensions)&&c(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),mr(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(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a];c(l.bufferView)&&(t[l.bufferView]=!0),c(l.arrayOffsetBufferView)&&(t[l.arrayOffsetBufferView]=!0),c(l.stringOffsetBufferView)&&(t[l.stringOffsetBufferView]=!0)}}}}if(mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.values)&&(t[u.values]=!0),c(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),c(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Cm.image=function(e){let t={};return Oe.texture(e,function(n){c(n.source)&&(t[n.source]=!0),c(n.extensions)&&c(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:c(n.extensions)&&c(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Cm.mesh=function(e){let t={};return Oe.node(e,function(n){if(c(n.mesh&&c(e.meshes))){let i=e.meshes[n.mesh];c(i)&&c(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function rse(e,t,n){let i=e.nodes[t];return c(i.mesh)||c(i.camera)||c(i.skin)||c(i.weights)||c(i.extras)||c(i.extensions)&&Object.keys(i.extensions).length!==0||c(n[t])?!1:!c(i.children)||i.children.filter(function(o){return!rse(e,o,n)}).length===0}Cm.node=function(e){let t={};return Oe.skin(e,function(n){c(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){c(i.target)&&c(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){c(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){rse(e,i,t)||(t[i]=!0)}),t};Cm.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.material)&&(t[i.material]=!0)})}),t};Cm.texture=function(e){let t={};if(Oe.material(e,function(n){HC(n,function(i){t[i]=!0})}),mr(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(r){let s=r.extensions;if(c(s)&&c(s.EXT_feature_metadata)){let l=s.EXT_feature_metadata.featureIdTextures;if(c(l)){let u=l.length;for(let f=0;f<u;++f){let p=l[f].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(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(mr(e,"EXT_mesh_features")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(c(s)){let a=s.length;for(let l=0;l<a;++l){let u=s[l];c(u.texture)&&(t[u.texture.index]=!0)}}}})}),mr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];t[u.index]=!0}}}}return t};Cm.sampler=function(e){let t={};return Oe.texture(e,function(n){c(n.sampler)&&(t[n.sampler]=!0)}),t};var g1=rUe;function cUe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:vs(e.buffers,n),byteOffset:0,byteLength:t.length};return vs(e.bufferViews,o)}var y1=cUe;function lUe(e,t){let n=Ul(e,t),i=$.getSizeInBytes(t.componentType),o=wu(t.type),r=t.count,s=new Array(o*r);if(!c(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],l=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+l.byteOffset,f=new DataView(l.buffer),h=new Array(o),p=o_(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,h);for(let m=0;m<o;++m)s[g*o+m]=h[m];u+=n}return s}var b1=lUe;function uUe(e){let t;return Oe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?rz(e,i,$.UNSIGNED_BYTE):t!==ne.UNSIGNED_BYTE&&t!==ne.UNSIGNED_SHORT&&rz(e,i,$.UNSIGNED_SHORT)}),Oe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?rz(e,i,$.UNSIGNED_BYTE):t===ne.SHORT&&rz(e,i,$.UNSIGNED_SHORT)}),e}function rz(e,t,n){let i=$.createTypedArray(n,b1(e,t)),o=new Uint8Array(i.buffer);t.bufferView=y1(e,o),t.componentType=n,t.byteOffset=0}var x1=uUe;function fUe(e,t){return dx(e,t),t==="CESIUM_RTC"&&dUe(e),b9(e,t)}function dUe(e){Oe.technique(e,function(t){Oe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function b9(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)b9(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;c(n)&&(i=n[t],c(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&b9(e[o],t);return i}}var mx=fUe;var sz={.8:yUe,"1.0":UUe,"2.0":void 0};function hUe(e,t){t=t??W.EMPTY_OBJECT;let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(sz,i)||(c(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(sz,i)||(i="1.0"));let o=sz[i];for(;c(o)&&i!==n;)o(e,t),i=e.asset.version,o=sz[i];return t.keepLegacyExtensions||(HUe(e,t),GUe(e)),e}function cse(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;c(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function mUe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],l=a.primitive??ne.TRIANGLES;a.mode=a.mode??l,delete a.primitive}}}}function pUe(e){let t=e.nodes,n=new d,i=new Le;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(c(r.rotation)){let a=r.rotation;d.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;c(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function _Ue(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new d,a=new Le;for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)){let u=t[l],f=u.channels,h=u.parameters,p=u.samplers;if(c(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let b=h[p[y.sampler].output];if(c(r[b]))continue;r[b]=!0;let x=n[b],A=i[x.bufferView],S=o[A.buffer].extras._pipeline.source,v=S.byteOffset+A.byteOffset+x.byteOffset,P=x.componentType,M=x.count,R=wu(x.type),L=x.count*R,F=$.createArrayBufferView(P,S.buffer,v,L);for(let _=0;_<M;_++){let w=_*R;d.unpack(F,w,s);let D=F[w+3];Le.fromAxisAngle(s,D,a),Le.pack(a,F,w)}}}}}}function gUe(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(c(o)){let r=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function yUe(e){c(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(c(e.version)&&delete e.version,cse(e),mUe(e),pUe(e),_Ue(e),gUe(e),c(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),c(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Ff(e,"KHR_materials_common")}}function bUe(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(c(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 sse(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),c(o.name)||(o.name=i)}return n}function xUe(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,c(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&c(n[s])){let a={},l=e[s];e[s]=sse(l,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);c(e.scene)&&(e.scene=n.scenes[e.scene]),Oe.bufferView(e,function(s){c(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Oe.accessor(e,function(s){c(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Oe.shader(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.program(e,function(s){c(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),c(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Oe.technique(e,function(s){c(s.program)&&(s.program=n.programs[s.program]),Oe.techniqueParameter(s,function(a){c(a.node)&&(a.node=n.nodes[a.node]);let l=a.value;typeof l=="string"&&(a.value={index:n.textures[l]})})}),Oe.mesh(e,function(s){Oe.meshPrimitive(s,function(a){c(a.indices)&&(a.indices=n.accessors[a.indices]),Oe.meshPrimitiveAttribute(a,function(l,u){a.attributes[u]=n.accessors[l]}),c(a.material)&&(a.material=n.materials[a.material])})}),Oe.node(e,function(s){let a=s.children;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}if(c(s.meshes)){let l=s.meshes,u=l.length;if(u>0)for(s.mesh=n.meshes[l[0]],t=1;t<u;++t){let f={mesh:n.meshes[l[t]]},h=vs(e.nodes,f);c(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(c(s.camera)&&(s.camera=n.cameras[s.camera]),c(s.skin)&&(s.skin=n.skins[s.skin]),c(s.skeletons)){let l=s.skeletons;if(l.length>0&&c(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[l[0]]}delete s.skeletons}c(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){c(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(c(a)){let l=[],u=a.length;for(t=0;t<u;++t)l[t]=o[a[t]];s.joints=l,delete s.jointNames}}),Oe.scene(e,function(s){let a=s.nodes;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}}),Oe.animation(e,function(s){let a={};s.samplers=sse(s.samplers,a),Oe.animationSampler(s,function(l){l.input=n.accessors[l.input],l.output=n.accessors[l.output]}),Oe.animationChannel(s,function(l){l.sampler=a[l.sampler];let u=l.target;c(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Oe.material(e,function(s){c(s.technique)&&(s.technique=n.techniques[s.technique]),Oe.materialValue(s,function(l,u){typeof l=="string"&&(s.values[u]={index:n.textures[l]})});let a=s.extensions;if(c(a)){let l=a.KHR_materials_common;c(l)&&c(l.values)&&Oe.materialValue(l,function(u,f){typeof u=="string"&&(l.values[f]={index:n.textures[u]})})}}),Oe.image(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],s.mimeType=l.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.texture(e,function(s){c(s.sampler)&&(s.sampler=n.samplers[s.sampler]),c(s.source)&&(s.source=n.images[s.source])})}function TUe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){delete n.name})})}function AUe(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]}Oe.node(e,function(t){c(t.children)&&t.children.length===0&&delete t.children})}function CUe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var EUe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function SUe(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],c(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];c(EUe[o])&&e.extensionsRequired.push(o)}}}function wUe(e){Oe.buffer(e,function(t){delete t.type})}function vUe(e){Oe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function DUe(e){Oe.mesh(e,function(t){Oe.meshPrimitive(t,function(n){Oe.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})}),Oe.technique(e,function(t){Oe.techniqueParameter(t,function(n){let i=n.semantic;c(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var PUe={POSITION:!0,NORMAL:!0,TANGENT:!0},IUe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function OUe(e){let t={};Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,l="_0";s>=0&&(a=r.substring(0,s),l=r.substring(s));let u,f=IUe[a];c(f)?(u=f+l,t[r]=u):c(PUe[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];c(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let o=t[i.semantic];c(o)&&(i.semantic=o)})})}function RUe(e){Oe.camera(e,function(t){let n=t.perspective;if(c(n)){let i=n.aspectRatio;c(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;c(o)&&o===0&&(n.yfov=1)}})}function T9(e,t){return c(t.byteStride)&&t.byteStride!==0?t.byteStride:Ul(e,t)}function MUe(e){Oe.buffer(e,function(t){c(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n],o=T9(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function LUe(e){let t,n,i,o=e.bufferViews,r={};Oe.accessorContainingVertexAttributeData(e,function(a){let l=e.accessors[a];c(l.bufferView)&&(r[l.bufferView]=!0)});let s={};Oe.accessor(e,function(a){c(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let l=s[a];l.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,h=l.length;for(t=0;t<h;++t){let p=l[t],g=T9(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let b=t<h-1,x=b?T9(e,l[t+1]):void 0;if(g!==x){let A=je(i,!0);r[a]&&(A.byteStride=g),A.byteOffset+=u,A.byteLength=m+y-u;let C=vs(o,A);for(n=f;n<=t;++n)p=l[n],p.bufferView=C,p.byteOffset=p.byteOffset-u;u=b?l[t+1].byteOffset:void 0,f=t+1}}}g1(e,["accessor","bufferView","buffer"])}function NUe(e){Oe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!c(n.min)||!c(n.max)){let i=hx(e,n);n.min=i.min,n.max=i.max}})}function lse(e){return(!c(e.children)||e.children.length===0)&&(!c(e.meshes)||e.meshes.length===0)&&!c(e.camera)&&!c(e.skin)&&!c(e.skeletons)&&!c(e.jointName)&&(!c(e.translation)||d.fromArray(e.translation).equals(d.ZERO))&&(!c(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!c(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!c(e.matrix)||B.fromColumnMajorArray(e.matrix).equals(B.IDENTITY))&&!c(e.extensions)&&!c(e.extras)}function use(e,t){Oe.scene(e,function(n){let i=n.nodes;if(c(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Oe.node(e,function(n,i){if(c(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),lse(n)&&use(e,i))}}),delete e.nodes[t]}function FUe(e){return Oe.node(e,function(t,n){lse(t)&&use(e,n)}),e}function BUe(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!c(i.min)||!c(i.max)){let o=hx(e,i);i.min=o.min,i.max=o.max}})})}function kUe(e){Oe.accessor(e,function(t){if(c(t.min)||c(t.max)){let n=hx(e,t);c(t.min)&&(t.min=n.min),c(t.max)&&(t.max=n.max)}})}function UUe(e){e.asset=e.asset??{},e.asset.version="2.0",cse(e),bUe(e),FUe(e),xUe(e),TUe(e),CUe(e),SUe(e),MUe(e),LUe(e),NUe(e),BUe(e),kUe(e),wUe(e),vUe(e),DUe(e),OUe(e),x1(e),RUe(e),m1(e),_1(e),AUe(e)}var VUe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],zUe=["u_diffuse","u_diffuse_mat"];function A9(e){e.pbrMetallicRoughness=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function C9(e){return c(e.index)}function E9(e){return Array.isArray(e)&&e.length===4}function fse(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 HUe(e,t){t=t??W.EMPTY_OBJECT;let n=t.baseColorTextureNames??VUe,i=t.baseColorFactorNames??zUe;Oe.material(e,function(o){Oe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&C9(r)?(A9(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&E9(r)&&(A9(o),o.pbrMetallicRoughness.baseColorFactor=fse(r))})}),mx(e,"KHR_techniques_webgl"),mx(e,"KHR_blend")}function x9(e,t){c(t)&&(E9(t)?e.pbrMetallicRoughness.baseColorFactor=fse(t):C9(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function ase(e,t){c(t)&&(E9(t)?e.emissiveFactor=t.slice(0,3):C9(t)&&(e.emissiveTexture=t))}function GUe(e){Oe.material(e,function(t){let n=(t.extensions??W.EMPTY_OBJECT).KHR_materials_common;if(!c(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,l=n.doubleSided,u=n.transparent;A9(t),n.technique==="CONSTANT"?(Ff(e,"KHR_materials_unlit"),t.extensions=c(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},x9(t,s),x9(t,o)):(x9(t,r),ase(t,o),ase(t,s)),c(l)&&(t.doubleSided=l),c(a)&&(c(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),c(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),mx(e,"KHR_materials_common")}var T1=hUe;function _c(){}_c.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;c(n)&&c(n.message)&&(i+=` -${n.message}`);let o=new ae(i);return c(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};_c.getNodeTransform=function(e){return c(e.matrix)?e.matrix:B.fromTranslationQuaternionRotationScale(c(e.translation)?e.translation:d.ZERO,c(e.rotation)?e.rotation:Le.IDENTITY,c(e.scale)?e.scale:d.ONE)};_c.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=c(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};_c.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}};_c.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}};_c.hasQuantizedAttributes=function(e){if(!c(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(c(n.quantization))return!0}return!1};_c.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;c(t)?(i=ht.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=nn.getGlslType(s);r&&(a="vec4");let l=c(e.quantization),u;return l&&(u=r?"vec4":nn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:l,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var jUe=new d,WUe=new d;_c.getPositionMinMax=function(e,t,n){let i=_c.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return c(n)&&c(t)&&(r=d.add(r,t,WUe),o=d.add(o,n,jUe)),{min:r,max:o}};_c.getAxisCorrectionMatrix=function(e,t,n){return n=B.clone(B.IDENTITY,n),e===Fo.Y?n=B.clone(Fo.Y_UP_TO_Z_UP,n):e===Fo.X&&(n=B.clone(Fo.X_UP_TO_Z_UP,n)),t===Fo.Z&&(n=B.multiplyTransformation(n,Fo.Z_UP_TO_X_UP,n)),n};var qUe=new J;_c.getCullFace=function(e,t){if(!Me.isTriangles(t))return xi.BACK;let n=B.getMatrix3(e,qUe);return J.determinant(n)<0?xi.FRONT:xi.BACK};_c.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};_c.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};_c.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!_c.supportedExtensions[i])throw new ae(`Unsupported glTF Extension: ${i}`)}};var $t=_c;function _y(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),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=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(_y.prototype=Object.create($i.prototype),_y.prototype.constructor=_y);Object.defineProperties(_y.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});_y.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,c(this._gltfJson)?(this._promise=dse(this,this._gltfJson),this._promise):c(this._typedArray)?(this._promise=hse(this,this._typedArray),this._promise):(this._promise=YUe(this),this._promise))};async function YUe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;S9(e,n)}return hse(e,t)}function S9(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function XUe(e,t){if(c(t.asset)&&t.asset.version==="2.0"&&!mr(t,"KHR_techniques_webgl")&&!mr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Oe.buffer(t,function(i){if(!c(i.extras._pipeline.source)&&c(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),T1(t)}function KUe(e){let t=[];return Oe.buffer(e,function(n){let i=n.uri;!c(n.extras._pipeline.source)&&c(i)&&Ep(i)&&(delete n.uri,t.push(we.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function $Ue(e,t){let n=[];return Oe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(c(r)&&!c(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 dse(e,t){try{py(t),await KUe(t),await XUe(e,t),u1(t),await $Ue(e,t),h1(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 c(i)&&$t.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;S9(e,n)}}async function hse(e,t){let n;try{Kd(t)==="glTF"?n=d1(t):n=ir(t)}catch(i){if(e.isDestroyed())return;S9(e,i)}return dse(e,n)}_y.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};_y.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var GC=_y;var ZUe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Em=Object.freeze(ZUe);var So={};function QUe(){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 JUe(){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 eVe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function tVe(){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 nVe(){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 iVe(){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 oVe(){this.attributes=[]}function rVe(){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 sVe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function aVe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function cVe(){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 lVe(){this.nodes=[]}var uVe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function fVe(){this.input=[],this.interpolation=void 0,this.output=[]}function dVe(){this.node=void 0,this.path=void 0}function hVe(){this.sampler=void 0,this.target=void 0}function mVe(){this.name=void 0,this.samplers=[],this.channels=[]}function pVe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function _Ve(){this.name=void 0,this.stages=[]}function mse(){this.credits=[]}function gVe(){this.asset=new mse,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=B.clone(B.IDENTITY),this.extensions={}}function yVe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=J.clone(J.IDENTITY),this.scale=1,this.channels=void 0}function gy(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(gy.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=gy.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=gy.DEFAULT_ROUGHNESS_FACTOR}gy.DEFAULT_BASE_COLOR_FACTOR=se.ONE;gy.DEFAULT_METALLIC_FACTOR=1;gy.DEFAULT_ROUGHNESS_FACTOR=1;function px(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(px.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(px.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=px.DEFAULT_GLOSSINESS_FACTOR}px.DEFAULT_DIFFUSE_FACTOR=se.ONE;px.DEFAULT_SPECULAR_FACTOR=d.ONE;px.DEFAULT_GLOSSINESS_FACTOR=1;function A1(){this.specularFactor=A1.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(A1.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}A1.DEFAULT_SPECULAR_FACTOR=1;A1.DEFAULT_SPECULAR_COLOR_FACTOR=d.ONE;function C1(){this.anisotropyStrength=C1.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=C1.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}C1.DEFAULT_ANISOTROPY_STRENGTH=0;C1.DEFAULT_ANISOTROPY_ROTATION=0;function E1(){this.clearcoatFactor=E1.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=E1.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}E1.DEFAULT_CLEARCOAT_FACTOR=0;E1.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function w9(){this.metallicRoughness=new gy,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=d.clone(w9.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Em.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}w9.DEFAULT_EMISSIVE_FACTOR=d.ZERO;So.Quantization=QUe;So.Attribute=JUe;So.Indices=eVe;So.FeatureIdAttribute=tVe;So.FeatureIdTexture=iVe;So.FeatureIdImplicitRange=nVe;So.MorphTarget=oVe;So.Primitive=rVe;So.Instances=sVe;So.Skin=aVe;So.Node=cVe;So.Scene=lVe;So.AnimatedPropertyType=Object.freeze(uVe);So.AnimationSampler=fVe;So.AnimationTarget=dVe;So.AnimationChannel=hVe;So.Animation=mVe;So.ArticulationStage=pVe;So.Articulation=_Ve;So.Asset=mse;So.Components=gVe;So.TextureReader=yVe;So.MetallicRoughness=gy;So.SpecularGlossiness=px;So.Specular=A1;So.Anisotropy=C1;So.Clearcoat=E1;So.Material=w9;var Tn=So;var az={};az.getImageIdFromTexture=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.textureId",n),T.typeOf.object("options.supportedImageFormats",i);let o=t.textures[n],r=o.extensions;if(c(r)){if(i.webp&&c(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&c(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};az.createSampler=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n);let o=gn.REPEAT,r=gn.REPEAT,s=Yt.LINEAR,a=li.LINEAR,l=n.index,f=t.textures[l].sampler;if(c(f)){let h=t.samplers[f];o=h.wrapS??o,r=h.wrapT??r,s=h.minFilter??s,a=h.magFilter??a}return i&&s!==Yt.LINEAR&&s!==Yt.NEAREST&&(s===Yt.NEAREST_MIPMAP_NEAREST||s===Yt.NEAREST_MIPMAP_LINEAR?s=Yt.NEAREST:s=Yt.LINEAR),new Qt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var bVe=new H(1,1);az.createModelTextureReader=function(e){e=e??W.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e;T.typeOf.object("options.textureInfo",t);let o=t.texCoord??0,r,s=t.extensions?.KHR_texture_transform;if(c(s)){o=s.texCoord??o;let l=c(s.offset)?H.unpack(s.offset):H.ZERO,u=s.rotation??0,f=c(s.scale)?H.unpack(s.scale):bVe;u=-u,r=new J(Math.cos(u)*f.x,-Math.sin(u)*f.y,l.x,Math.sin(u)*f.x,Math.cos(u)*f.y,l.y,0,0,1)}let a=new Tn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var Vl=az;function xVe(e){let t=document.createElement("canvas");return t.width=O.nextPowerOfTwo(e.width),t.height=O.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var yy=xVe;function by(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,l=e.asynchronous??!0;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.textureInfo",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),T.typeOf.object("options.supportedImageFormats",s);let u=i.index,f=Vl.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=l,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(by.prototype=Object.create($i.prototype),by.prototype.constructor=by);Object.defineProperties(by.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var TVe=new v9;async function AVe(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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}by.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=AVe(this),this._promise)};function v9(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}v9.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};v9.prototype.execute=function(){this.texture=pse(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function pse(e,t,n,i,o,r){let s=i.internalFormat,a=!1;ke.isCompressedFormat(s)&&!c(o)&&(a=!0);let l=Vl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=l.minificationFilter,f=l.wrapS,h=l.wrapT,p=u===Yt.NEAREST_MIPMAP_NEAREST||u===Yt.NEAREST_MIPMAP_LINEAR||u===Yt.LINEAR_MIPMAP_NEAREST||u===Yt.LINEAR_MIPMAP_LINEAR,g=!c(s)&&p,m=g||f===gn.REPEAT||f===gn.MIRRORED_REPEAT||h===gn.REPEAT||h===gn.MIRRORED_REPEAT,y=!O.isPowerOfTwo(i.width)||!O.isPowerOfTwo(i.height),b=m&&y,x;return c(s)?(!r.webgl2&&ke.isCompressedFormat(s)&&y&&m&&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."),x=Rt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:l})):(b&&(i=yy(i)),x=Rt.create({id:n,context:r,source:i,sampler:l,flipY:!1,skipColorSpaceConversion:!0})),g&&x.generateMipmap(),x}by.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||c(this._texture)||!c(this._image))return!1;this._state=gt.PROCESSING;let t;if(this._asynchronous){let n=TVe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,pa.TEXTURE))return;t=n.texture}else t=pse(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};by.prototype.unload=function(){c(this._texture)&&this._texture.destroy(),c(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 jC=by;function xy(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,l=e.attributeSemantic,u=e.accessorId,f=e.cacheKey,h=e.asynchronous??!0,p=e.loadBuffer??!1,g=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),!p&&!g)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let m=c(r),y=c(s),b=_se(a,l),x=c(l),A=c(u);if(m===b)throw new E("One of options.bufferViewId and options.draco must be defined.");if(b&&!x)throw new E("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!A)throw new E("When options.draco is defined options.accessorId must also be defined.");if(b&&!y)throw new E("When options.draco is defined options.primitive must also be defined.");b&&(T.typeOf.object("options.primitive",s),T.typeOf.object("options.draco",a),T.typeOf.string("options.attributeSemantic",l),T.typeOf.number("options.accessorId",u)),this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._attributeSemantic=l,this._accessorId=u,this._cacheKey=f,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=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(xy.prototype=Object.create($i.prototype),xy.prototype.constructor=xy);Object.defineProperties(xy.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 _se(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}xy.prototype.load=async function(){return c(this._promise)?this._promise:_se(this._draco,this._attributeSemantic)?(this._promise=EVe(this),this._promise):(this._promise=wVe(this),this._promise)};function CVe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Tn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=nn.VEC2,a.normalizationRange=r;else{let l=nn.getMathType(i);if(l===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=l.unpack(e.minValues),a.normalizationRange=l.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=l.unpack(u);let f=u.map(function(h){return h*s});a.quantizedVolumeStepSize=l.unpack(f)}}return a}async function EVe(e){e._state=gt.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=gt.LOADED,e)}catch{if(e.isDestroyed())return;D9(e)}}function SVe(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,l=o.array,u=o.data.quantization;c(u)&&(e._quantization=CVe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}async function wVe(e){e._state=gt.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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;D9(e,n)}}function D9(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}function P9(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}P9.prototype.set=function(e,t){this.typedArray=e,this.context=t};P9.prototype.execute=function(){this.buffer=gse(this.typedArray,this.context)};function gse(e,t){let n=yt.createVertexBuffer({typedArray:e,context:t,usage:Be.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var vVe=new P9;xy.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(c(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){D9(this,i)}SVe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=vVe;if(i.set(n,e.context),!e.jobScheduler.execute(i,pa.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=gse(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};xy.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 WC=xy;function S1(e){e=e??W.EMPTY_OBJECT;let t=e.id;T.typeOf.string("options.id",t);let n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(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=je(e.extras,!0),this._extensions=je(e.extensions,!0)}S1.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.class;T.typeOf.string("options.id",t),T.typeOf.object("options.class",n);let i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Tm.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new S1({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(S1.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}}});S1.BATCH_TABLE_CLASS_NAME="_batchTable";var Qd=S1;function cz(e){e=e??W.EMPTY_OBJECT;let t=e.value,n=e.name;T.typeOf.number("options.value",t),T.typeOf.string("options.name",n),this._value=t,this._name=n,this._description=e.description,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}cz.fromJson=function(e){return T.typeOf.object("value",e),new cz({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(cz.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 w1=cz;function lz(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.values;T.typeOf.string("options.id",t),T.defined("options.values",n);let i={},o={},r=n.length;for(let a=0;a<r;++a){let l=n[a];i[l.value]=l.name,o[l.name]=l.value}let s=e.valueType??Nt.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=je(e.extras,!0),this._extensions=je(e.extensions,!0)}lz.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.enum;T.typeOf.string("options.id",t),T.typeOf.object("options.enum",n);let i=n.values.map(function(o){return w1.fromJson(o)});return new lz({id:t,values:i,valueType:Nt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(lz.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 v1=lz;function uz(e){e=e??W.EMPTY_OBJECT;let t=e.classes??{},n=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=je(e.extras,!0),this._extensions=je(e.extensions,!0)}uz.fromJson=function(e){T.typeOf.object("schema",e);let t={};if(c(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=v1.fromJson({id:i,enum:e.enums[i]}));let n={};if(c(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Qd.fromJson({id:i,class:e.classes[i],enums:t}));return new uz({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(uz.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 vu=uz;function _x(e){e=e??W.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new E("One of options.schema and options.resource must be defined.");this._schema=c(t)?vu.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(_x.prototype=Object.create($i.prototype),_x.prototype.constructor=_x);Object.defineProperties(_x.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});_x.prototype.load=async function(){return c(this._promise)?this._promise:c(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=DVe(this),this._promise)};async function DVe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=vu.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}_x.prototype.unload=function(){this._schema=void 0};var qC=_x;var Jd={};function YC(e){return om(e.url)}function fz(e){let{byteOffset:t,byteLength:n}=e;if(oi(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function PVe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function yse(e,t){return`${YC(e)}-buffer-id-${t}`}function D1(e,t,n,i){if(c(e.uri)){let o=i.getDerivedResource({url:e.uri});return YC(o)}return yse(n,t)}function I9(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],l=D1(a,s,n,i),u=fz(r);return`${l}-range-${u}`}function bse(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(c(s)){let p=i.getDerivedResource({url:s});return YC(p)}let a=e.bufferViews[r],l=a.buffer,u=e.buffers[l],f=D1(u,l,n,i),h=fz(a);return`${f}-range-${h}`}function IVe(e,t){let n=Vl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Jd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;if(c(t)===c(n))throw new E("One of options.schema and options.resource must be defined.");return c(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${YC(n)}`};Jd.getExternalBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{resource:t}=e;return T.typeOf.object("options.resource",t),`external-buffer:${YC(t)}`};Jd.getEmbeddedBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return T.typeOf.object("options.parentResource",t),T.typeOf.number("options.bufferId",n),`embedded-buffer:${yse(t,n)}`};Jd.getGltfCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t}=e;return T.typeOf.object("options.gltfResource",t),`gltf:${YC(t)}`};Jd.getBufferViewCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.bufferViewId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];oi(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let l=D1(a,s,i,o),u=fz(r);return`buffer-view:${l}-range-${u}`};Jd.getDracoCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return T.typeOf.object("options.gltf",t),T.typeOf.object("options.draco",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),`draco:${I9(t,n,i,o)}`};Jd.getVertexBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:l=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),T.typeOf.object("options.frameState",o);let h=c(r),p=OVe(s,a),g=c(a);if(h===p)throw new E("One of options.bufferViewId and options.draco must be defined.");if(p&&!g)throw new E("When options.draco is defined options.attributeSemantic must also be defined.");if(p&&(T.typeOf.object("options.draco",s),T.typeOf.string("options.attributeSemantic",a)),!u&&!f)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let m="";if(l&&(m+="-dequantize"),u&&(m+="-buffer",m+=`-context-${o.context.id}`),f&&(m+="-typed-array"),c(s))return`vertex-buffer:${I9(t,s,n,i)}-draco-${a}${m}`;let y=t.bufferViews[r],b=y.buffer,x=t.buffers[b],A=D1(x,b,n,i),C=fz(y);return`vertex-buffer:${A}-range-${C}${m}`};function OVe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Jd.getIndexBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:l=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.number("options.accessorId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.frameState",r),!a&&!l)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),l&&(u+="-typed-array"),c(s))return`index-buffer:${I9(t,s,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],g=p.buffer,m=t.buffers[g],y=D1(m,g,i,o),b=PVe(f,p);return`index-buffer:${y}-accessor-${b}${u}`};Jd.getImageCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return T.typeOf.object("options.gltf",t),T.typeOf.number("options.imageId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),`image:${bse(t,n,i,o)}`};Jd.getTextureCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s);let a=n.index,l=Vl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=bse(t,l,i,o),f=IVe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var zl=Jd;function P1(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}P1.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};P1.prototype.addGeometryLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;c(n)&&(o+=n.sizeInBytes),c(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};P1.prototype.addTextureLoader=function(e){T.typeOf.object("loader",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};P1.prototype.removeLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],c(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],c(i)&&(this.texturesByteLength-=i)};var I1=P1;function Mn(){}Mn.cacheEntries={};Mn.statistics=new I1;function RVe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Mn.get=function(e){T.typeOf.string("cacheKey",e);let t=Mn.cacheEntries[e];if(c(t))return++t.referenceCount,t.resourceLoader};Mn.add=function(e){T.typeOf.object("resourceLoader",e);let t=e.cacheKey;if(T.typeOf.string("options.resourceLoader.cacheKey",t),c(Mn.cacheEntries[t]))throw new E(`Resource with this cacheKey is already in the cache: ${t}`);return Mn.cacheEntries[t]=new RVe(e),e};Mn.unload=function(e){T.typeOf.object("resourceLoader",e);let t=e.cacheKey,n=Mn.cacheEntries[t];if(!c(n))throw new E(`Resource is not in the cache: ${t}`);--n.referenceCount,n.referenceCount===0&&(Mn.statistics.removeLoader(e),e.destroy(),delete Mn.cacheEntries[t])};Mn.getSchemaLoader=function(e){e=e??W.EMPTY_OBJECT;let{schema:t,resource:n}=e;if(c(t)===c(n))throw new E("One of options.schema and options.resource must be defined.");let i=zl.getSchemaCacheKey({schema:t,resource:n}),o=Mn.get(i);return c(o)?o:(o=new qC({schema:t,resource:n,cacheKey:i}),Mn.add(o))};Mn.getEmbeddedBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e;T.typeOf.object("options.parentResource",t),T.typeOf.number("options.bufferId",n);let o=zl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Mn.get(o);return c(r)?r:(T.typeOf.object("options.typedArray",i),r=new ax({typedArray:i,cacheKey:o}),Mn.add(r))};Mn.getExternalBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{resource:t}=e;T.typeOf.object("options.resource",t);let n=zl.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return c(i)?i:(i=new ax({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e;T.typeOf.object("options.gltfResource",t),T.typeOf.object("options.baseResource",n);let r=zl.getGltfCacheKey({gltfResource:t}),s=Mn.get(r);return c(s)?s:(s=new GC({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.bufferViewId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=zl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return c(s)?s:(s=new kC({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getDracoLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.primitive",n),T.typeOf.object("options.draco",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let s=zl.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Mn.get(s);return c(a)?a:(a=new UC({resourceCache:Mn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Mn.add(a))};Mn.getVertexBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:u,asynchronous:f=!0,dequantize:h=!1,loadBuffer:p=!1,loadTypedArray:g=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),T.typeOf.object("options.frameState",o),!p&&!g)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let m=c(r),y=c(s),b=MVe(a,l),x=c(l),A=c(u);if(m===b)throw new E("One of options.bufferViewId and options.draco must be defined.");if(b&&!x)throw new E("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!A)throw new E("When options.draco is defined options.haAccessorId must also be defined.");if(b&&!y)throw new E("When options.draco is defined options.primitive must also be defined.");b&&(T.typeOf.object("options.draco",a),T.typeOf.string("options.attributeSemantic",l),T.typeOf.number("options.accessorId",u));let C=zl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:l,dequantize:h,loadBuffer:p,loadTypedArray:g}),S=Mn.get(C);return c(S)?S:(S=new WC({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:u,cacheKey:C,asynchronous:f,dequantize:h,loadBuffer:p,loadTypedArray:g}),Mn.add(S))};function MVe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Mn.getIndexBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:l=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.number("options.accessorId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.frameState",r),!u&&!f)throw new E("At least one of loadBuffer and loadTypedArray must be true.");let h=zl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:u,loadTypedArray:f}),p=Mn.get(h);return c(p)?p:(p=new zC({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:l,loadBuffer:u,loadTypedArray:f}),Mn.add(p))};Mn.getImageLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.imageId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=zl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return c(s)?s:(s=new VC({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getTextureLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s);let l=zl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Mn.get(l);return c(u)?u:(u=new jC({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:l,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[WC,zC,UC,jC,VC,kC,ax,qC,GC],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),l=e.indexOf(s.resourceLoader.constructor);return a-l});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,c(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var vi=Mn;function _a(e,t,n){T.typeOf.object("resource",e),T.typeOf.object("implicitTileset",t),T.typeOf.object("implicitCoordinates",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(_a.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}}});_a.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};_a.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};_a.prototype.contentIsAvailableAtIndex=function(e,t){if(t=t??0,t<0||t>=this._contentAvailabilityBitstreams.length)throw new E("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)};_a.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};_a.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};_a.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};_a.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};_a.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===or.OCTREE&&(t=3),e>>t};_a.fromSubtreeJson=async function(e,t,n,i,o){if(T.typeOf.object("resource",e),c(t)===c(n))throw new E("One of json and subtreeView must be defined.");T.typeOf.object("implicitTileset",i),T.typeOf.object("implicitCoordinates",o);let r=new _a(e,i,o),s;c(t)?s={json:t,binary:void 0}:s=LVe(n);let a=s.json;r._subtreeJson=a;let l;if(oi(a,"3DTILES_metadata"))l=a.extensions["3DTILES_metadata"];else if(c(a.tileMetadata)){let A=a.tileMetadata;l=a.propertyTables[A]}let u=[];if(c(a.contentMetadata)){let A=a.contentMetadata.length;for(let C=0;C<A;C++){let S=a.contentMetadata[C];u.push(a.propertyTables[S])}}let f,h=i.metadataSchema,p=a.subtreeMetadata;if(c(p)){let A=p.class,C=h.classes[A];f=new i1({subtreeMetadata:p,class:C})}r._metadata=f,r._tilePropertyTableJson=l,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],oi(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=NVe(a.buffers),y=FVe(a.bufferViews,m);BVe(a,y),c(l)&&xse(l,y);for(let A=0;A<u.length;A++){let C=u[A];xse(C,y)}let b=await kVe(r,m,s.binary),x=VVe(y,b);return zVe(r,a,i,x),c(l)&&(HVe(r,i,x),jVe(r)),GVe(r,i,x),WVe(r),r._ready=!0,r};function LVe(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=ir(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function NVe(e){e=c(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=c(n.uri),n.isActive=!1}return e}function FVe(e,t){e=c(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 BVe(e,t){let n,i=e.tileAvailability;c(i.bitstream)?n=t[i.bitstream]:c(i.bufferView)&&(n=t[i.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,c(o[s].bitstream)?n=t[o[s].bitstream]:c(o[s].bufferView)&&(n=t[o[s].bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;c(r.bitstream)?n=t[r.bitstream]:c(r.bufferView)&&(n=t[r.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function xse(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=r.values??r.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=r.stringOffsets??r.stringOffsetBufferView;c(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let l=r.arrayOffsets??r.arrayOffsetBufferView;c(l)&&(i=t[l],i.isActive=!0,i.bufferHeader.isActive=!0)}}function kVe(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=UVe(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];c(a)&&(r[s]=a)}return r})}async function UVe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=vi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function VVe(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,l=t[o.buffer].subarray(r,s);n[i]=l}return n}function zVe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),l=oi(t,"3DTILES_metadata"),u=c(e._tilePropertyTableJson),f=l||u;e._tileAvailability=O9(t.tileAvailability,i,s,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=O9(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=O9(t.childSubtreeAvailability,i,a)}function O9(e,t,n,i){if(c(e.constant))return new FC({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return c(e.bitstream)?o=t[e.bitstream]:c(e.bufferView)&&(o=t[e.bufferView]),new FC({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function HVe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Nf({class:a,count:o,properties:i.properties,bufferViews:n})}function GVe(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 l=i[a],f=o[a].availableCount,h=l.class,p=r.classes[h],g=new Nf({class:p,count:f,properties:l.properties,bufferViews:n});s.push(g)}}function Tse(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 jVe(e){let t=Tse(e._tileAvailability);e._tileJumpBuffer=t}function WVe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Tse(o);t.push(r)}}_a.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};_a.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 qVe(e,t){if(!c(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function YVe(e,t,n){let i=e._contentMetadataTables;if(!c(i))return;let o=i[n];if(!c(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}_a.prototype.getTileMetadataView=function(e){let t=qVe(this,e);if(!c(t))return;let n=this._tileMetadataTable;return new BC({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};_a.prototype.getContentMetadataView=function(e,t){let n=YVe(this,e,t);if(!c(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new BC({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return c(this._bufferLoader)&&vi.unload(this._bufferLoader),de(this)};var gx=_a;var XVe={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"},yx=Object.freeze(XVe);var eh={};eh.parseAllBoundingVolumeSemantics=function(e){return T.typeOf.object("tileMetadata",e),{tile:{boundingVolume:eh.parseBoundingVolumeSemantic("TILE",e),minimumHeight:eh._parseMinimumHeight("TILE",e),maximumHeight:eh._parseMaximumHeight("TILE",e)},content:{boundingVolume:eh.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:eh._parseMinimumHeight("CONTENT",e),maximumHeight:eh._parseMaximumHeight("CONTENT",e)}}};eh.parseBoundingVolumeSemantic=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new E("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(c(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(c(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(c(a))return{sphere:a}};eh._parseMinimumHeight=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new E("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};eh._parseMaximumHeight=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new E("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var bx=eh;function tl(e,t,n){T.defined("tile.implicitTileset",t.implicitTileset),T.defined("tile.implicitCoordinates",t.implicitCoordinates);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(tl.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(){throw new E("Implicit3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});tl.fromSubtreeJson=async function(e,t,n,i,o,r){if(T.defined("tile.implicitTileset",t.implicitTileset),T.defined("tile.implicitCoordinates",t.implicitCoordinates),c(i)===c(o))throw new E("One of json and arrayBuffer must be defined.");r=r??0;let s;c(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,l=t.implicitCoordinates,u=await gx.fromSubtreeJson(n,i,s,a,l),f=new tl(e,t,n);return f._implicitSubtree=u,KVe(f,u),f._ready=!0,f};function KVe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=ZVe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=$Ve(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let l=s[a],u=l.tile,f=sze(e,u,l.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function $Ve(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(c(s))for(let a=0;a<o;a++){let l=r*o+a;t.childSubtreeIsAvailableAtIndex(l)&&i.push({tile:s,childIndex:a})}}return i}function ZVe(e,t,n,i){let s=Ase(e,t,n,i,0,!0),a=e._tileset.statistics,l=[s],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),g=f.branchingFactor*l.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),x=l[b],A=m%f.branchingFactor,C=Ase(e,t,x,A,y);x.children.push(C),a.numberOfTilesTotal++,u.push(C)}l=u,u=[]}return{rootTile:s,bottomRow:l}}function Cse(e,t,n){let i=yx.TILE_GEOMETRIC_ERROR;return c(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Ase(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let l,u,f;if(c(t.tilePropertyTableJson)){l=t.getTileMetadataView(a);let P=bx.parseAllBoundingVolumeSemantics(l);u=P.tile,f=P.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let P=0;P<p;P++)if(t.contentIsAvailableAtCoordinates(a,P)){g=!0;break}let m=eze(s,a,i,r,n,u),y=[];for(let P=0;P<s.contentCount;P++){if(!t.contentIsAvailableAtIndex(o,P))continue;let L={uri:s.contentUriTemplates[P].getDerivedResource({templateValues:a.getTemplateValues()}).url},F=tze(m,f);c(F)&&(L.boundingVolume=F),y.push(xt(L,s.contentHeaders[P]))}let b=Cse(l,s,a),x={boundingVolume:m,geometricError:b,refine:s.refine,contents:y},A=!0,C=je(s.tileHeader,A);delete C.boundingVolume,delete C.transform,delete C.metadata;let S=xt(x,C,A),v=Dse(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=l,v.hasImplicitContentMetadata=g,v}function dz(e,t){return c(e)&&c(t)&&(c(t.minimumHeight)||c(t.maximumHeight))&&(oi(e,"3DTILES_bounding_volume_S2")||c(e.region))}function M9(e,t){c(t)&&(oi(e,"3DTILES_bounding_volume_S2")?JVe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):c(e.region)&&QVe(e.region,t.minimumHeight,t.maximumHeight))}function QVe(e,t,n){c(t)&&(e[4]=t),c(n)&&(e[5]=n)}function JVe(e,t,n){c(t)&&(e.minimumHeight=t),c(n)&&(e.maximumHeight=n)}function eze(e,t,n,i,o,r){let s;return!c(r)||!c(r.boundingVolume)||!dz(r.boundingVolume,r)&&dz(e.boundingVolume,r)?s=Ese(e,t,n,i??!1,o):s=r.boundingVolume,M9(s,r),s}function tze(e,t){let n;return c(t)&&(n=t.boundingVolume),dz(n,t)?M9(n,t):dz(e,t)&&(n=je(e,!0),M9(n,t)),n}function Ese(e,t,n,i,o){let r=e.boundingVolume;return oi(r,"3DTILES_bounding_volume_S2")?Sse(i,o,n,t.level,t.x,t.y,t.z):c(r.region)?{region:vse(r.region,t.level,t.x,t.y,t.z)}:{box:wse(r.box,t.level,t.x,t.y,t.z)}}function Sse(e,t,n,i,o,r,s){T.typeOf.bool("parentIsPlaceholderTile",e),T.typeOf.object("parentTile",t),T.typeOf.number("childIndex",n),T.typeOf.number("level",i),T.typeOf.number("x",o),T.typeOf.number("y",r),c(s)&&T.typeOf.number("z",s);let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let l=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=l%2===0?LC.encode2D(i,o,r):LC.encode2D(i,r,o),f=Qp.fromFacePositionLevel(l,BigInt(u),i),h,p;if(c(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:Qp.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var nze=new d,ize=new d,R9=new d,oze=new J;function wse(e,t,n,i,o){if(T.typeOf.object("rootBox",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e;let r=d.unpack(e,0,ize),s=J.unpack(e,3,oze),a=Math.pow(2,-t),l=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,nze);c(o)&&(f=-1+(2*o+1)*a,h.z=a);let p=d.fromElements(l,u,f,R9);p=J.multiplyByVector(s,p,R9),p=d.add(p,r,R9);let g=J.clone(s);g=J.multiplyByScale(g,h,g);let m=new Array(12);return d.pack(p,m),J.pack(g,m,3),m}var rze=new ce;function vse(e,t,n,i,o){if(T.typeOf.object("rootRegion",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e.slice();let r=ce.unpack(e,0,rze),s=e[4],a=e[5],l=Math.pow(2,-t),u=l*r.width,f=O.negativePiToPi(r.west+n*u),h=O.negativePiToPi(f+u),p=l*r.height,g=O.negativePiToPi(r.south+i*p),m=O.negativePiToPi(g+p),y=s,b=a;if(c(o)){let x=l*(a-s);y+=o*x,b=y+x}return[f,g,h,m,y,b]}function sze(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Ese(i,o,n,!1,t),s=Cse(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,l={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Dse(e,i.baseResource,l,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function Dse(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}tl.prototype.hasProperty=function(e,t){return!1};tl.prototype.getFeature=function(e){};tl.prototype.applyDebugSettings=function(e,t){};tl.prototype.applyStyle=function(e){};tl.prototype.update=function(e,t){};tl.prototype.pick=function(e,t,n){};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),de(this)};tl._deriveBoundingBox=wse;tl._deriveBoundingRegion=vse;tl._deriveBoundingVolumeS2=Sse;var XC=tl;var aze={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Hl=Object.freeze(aze);function KC(e,t){T.typeOf.object("normal",e),T.typeOf.number("distance",t),this._distance=t,this._normal=new Pse(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(KC.prototype,{distance:{get:function(){return this._distance},set:function(e){T.typeOf.number("value",e),c(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){T.typeOf.object("value",e),c(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});KC.fromPlane=function(e,t){return T.typeOf.object("plane",e),c(t)?(t.normal=e.normal,t.distance=e.distance):t=new KC(e.normal,e.distance),t};KC.clone=function(e,t){return c(t)?(t.normal=e.normal,t.distance=e.distance,t):new KC(e.normal,e.distance)};function Pse(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(Pse.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){T.typeOf.number("value",e),c(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){T.typeOf.number("value",e),c(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){T.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var xx=KC;function gc(e){e=e??W.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.edgeColor=G.clone(e.edgeColor??G.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Lse:Nse,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(c(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function Lse(e){return e===Wt.OUTSIDE}function Nse(e){return e===Wt.INSIDE}Object.defineProperties(gc.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?Lse:Nse)}},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 Ise(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}gc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Ise(n,i)},e.index=t,Ise(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};gc.prototype.get=function(e){return T.typeOf.number("index",e),this._planes[e]};function Fse(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}gc.prototype.contains=function(e){return Fse(this._planes,e)!==-1};gc.prototype.remove=function(e){let t=this._planes,n=Fse(t,e);if(n===-1)return!1;e instanceof xx&&(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 xx&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};gc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof xx&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var cze=new se,lze=new se;function Ose(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=Ln.octEncodeToCartesian4(a.normal,lze);i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=l.w;let u=se.packFloat(a.distance,cze);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function Rse(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=a.normal;i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=a.distance,r+=4}}function Bse(e,t){let n=ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var uze=new H;gc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=gc.useFloatTexture(n),o=i?this.length:this.length*2;if(c(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(!c(t)){let s=Bse(o,uze);s.y*=2,i?(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.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?(Rse(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Ose(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),Rse(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),Ose(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 fze=new B,Mse=new sn(d.UNIT_X,0);gc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;c(t)&&(o=B.multiply(t,o,fze));let r=Wt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Wt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,o,Mse);let l=e.intersectPlane(Mse);if(l===Wt.INTERSECTING)r=l;else if(this._testIntersection(l))return l}return r};gc.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new E("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[n]=e}};gc.useFloatTexture=function(e){return e.floatingPointTexture};gc.getTextureResolution=function(e,t,n){let i=e.texture;if(c(i))return n.x=i.width,n.y=i.height,n;let o=gc.useFloatTexture(t)?e.length:e.length*2,r=Bse(o,n);return r.y*=2,r};gc.prototype.isDestroyed=function(){return!1};gc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),de(this)};var gs=gc;function F9(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Use(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,l,u;if(i&&(r=_ze(e,t,r,n)),e.length>80*n){a=1/0,l=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<l&&(l=m),g>f&&(f=g),m>h&&(h=m)}u=Math.max(f-a,h-l),u=u!==0?32767/u:0}return R1(r,s,n,a,l,u,0),s}function Use(e,t,n,i,o){let r;if(o===vze(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=kse(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=kse(s/i|0,e[s],e[s+1],r);return r&&$C(r,r.next)&&(L1(r),r=r.next),r}function Tx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&($C(n,n.next)||Hr(n.prev,n,n.next)===0)){if(L1(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function R1(e,t,n,i,o,r,s){if(!e)return;!s&&r&&Tze(e,i,o,r);let a=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(r?hze(e,i,o,r):dze(e)){t.push(l.i,e.i,u.i),L1(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=mze(Tx(e),t),R1(e,t,n,i,o,r,2)):s===2&&pze(e,t,n,i,o,r):R1(Tx(e),t,n,i,o,r,1);break}}}function dze(e){let t=e.prev,n=e,i=e.next;if(Hr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,l=n.y,u=i.y,f=Math.min(o,r,s),h=Math.min(a,l,u),p=Math.max(o,r,s),g=Math.max(a,l,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=g&&O1(o,a,r,l,s,u,m.x,m.y)&&Hr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function hze(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Hr(o,r,s)>=0)return!1;let a=o.x,l=r.x,u=s.x,f=o.y,h=r.y,p=s.y,g=Math.min(a,l,u),m=Math.min(f,h,p),y=Math.max(a,l,u),b=Math.max(f,h,p),x=L9(g,m,t,n,i),A=L9(y,b,t,n,i),C=e.prevZ,S=e.nextZ;for(;C&&C.z>=x&&S&&S.z<=A;){if(C.x>=g&&C.x<=y&&C.y>=m&&C.y<=b&&C!==o&&C!==s&&O1(a,f,l,h,u,p,C.x,C.y)&&Hr(C.prev,C,C.next)>=0||(C=C.prevZ,S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&O1(a,f,l,h,u,p,S.x,S.y)&&Hr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;C&&C.z>=x;){if(C.x>=g&&C.x<=y&&C.y>=m&&C.y<=b&&C!==o&&C!==s&&O1(a,f,l,h,u,p,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;S&&S.z<=A;){if(S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&O1(a,f,l,h,u,p,S.x,S.y)&&Hr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function mze(e,t){let n=e;do{let i=n.prev,o=n.next.next;!$C(i,o)&&zse(i,n,n.next,o)&&M1(i,o)&&M1(o,i)&&(t.push(i.i,n.i,o.i),L1(n),L1(n.next),n=e=o),n=n.next}while(n!==e);return Tx(n)}function pze(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Eze(s,a)){let l=Hse(s,a);s=Tx(s,s.next),l=Tx(l,l.next),R1(s,t,n,i,o,r,0),R1(l,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function _ze(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,l=r<s-1?t[r+1]*i:e.length,u=Use(e,a,l,i,!1);u===u.next&&(u.steiner=!0),o.push(Cze(u))}o.sort(gze);for(let r=0;r<o.length;r++)n=yze(o[r],n);return n}function gze(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 yze(e,t){let n=bze(e,t);if(!n)return t;let i=Hse(n,e);return Tx(i,i.next),Tx(n,n.next)}function bze(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if($C(e,n))return n;do{if($C(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,l=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&Vse(o<u?i:r,o,l,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);M1(n,e)&&(h<f||h===f&&(n.x>s.x||n.x===s.x&&xze(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function xze(e,t){return Hr(e.prev,e,t.prev)<0&&Hr(t.next,e,e.next)<0}function Tze(e,t,n,i){let o=e;do o.z===0&&(o.z=L9(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,Aze(o)}function Aze(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 u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let l=n;for(;a>0||l>0&&s;)a!==0&&(l===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,l--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function L9(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 Cze(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 Vse(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 O1(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Vse(e,t,n,i,o,r,s,a)}function Eze(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Sze(e,t)&&(M1(e,t)&&M1(t,e)&&wze(e,t)&&(Hr(e.prev,e,t.prev)||Hr(e,t.prev,t))||$C(e,t)&&Hr(e.prev,e,e.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function $C(e,t){return e.x===t.x&&e.y===t.y}function zse(e,t,n,i){let o=mz(Hr(e,t,n)),r=mz(Hr(e,t,i)),s=mz(Hr(n,i,e)),a=mz(Hr(n,i,t));return!!(o!==r&&s!==a||o===0&&hz(e,n,t)||r===0&&hz(e,i,t)||s===0&&hz(n,e,i)||a===0&&hz(n,t,i))}function hz(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 mz(e){return e>0?1:e<0?-1:0}function Sze(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&&zse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function M1(e,t){return Hr(e.prev,e,e.next)<0?Hr(e,t,e.next)>=0&&Hr(e,e.prev,t)>=0:Hr(e,t,e.prev)<0||Hr(e,e.next,t)<0}function wze(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 Hse(e,t){let n=N9(e.i,e.x,e.y),i=N9(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 kse(e,t,n,i){let o=N9(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 L1(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 N9(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vze(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 Dze=new d,Pze=new d,Ty={};Ty.computeArea2D=function(e){T.defined("positions",e),T.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);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};Ty.computeWindingOrder2D=function(e){return Ty.computeArea2D(e)>0?ts.COUNTER_CLOCKWISE:ts.CLOCKWISE};Ty.triangulate=function(e,t){T.defined("positions",e);let n=H.packArray(e);return F9(n,t,2)};var qse=new d,Yse=new d,Xse=new d,Gse=new d,jse=new d,Wse=new d,r_=new d,Kse=new H,$se=new H,Zse=new H,ZC=new H;Ty.computeSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a<l;a++){let C=t[a];if(u[h++]=C.x,u[h++]=C.y,u[h++]=C.z,r){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,b=O.chordLength(o,y),x=b*b;for(;s.length>0;){let C=s.pop(),S=s.pop(),v=s.pop(),P=d.fromArray(u,v*3,qse),M=d.fromArray(u,S*3,Yse),R=d.fromArray(u,C*3,Xse),L,F,_;r&&(L=H.fromArray(f,v*2,Kse),F=H.fromArray(f,S*2,$se),_=H.fromArray(f,C*2,Zse));let w=d.multiplyByScalar(d.normalize(P,Gse),y,Gse),D=d.multiplyByScalar(d.normalize(M,jse),y,jse),I=d.multiplyByScalar(d.normalize(R,Wse),y,Wse),N=d.magnitudeSquared(d.subtract(w,D,r_)),k=d.magnitudeSquared(d.subtract(D,I,r_)),z=d.magnitudeSquared(d.subtract(I,w,r_)),V=Math.max(N,k,z),j,U,q;V>x?N===V?(j=`${Math.min(v,S)} ${Math.max(v,S)}`,a=m[j],c(a)||(U=d.add(P,M,r_),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=H.add(L,F,ZC),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(v,a,C),s.push(a,S,C)):k===V?(j=`${Math.min(S,C)} ${Math.max(S,C)}`,a=m[j],c(a)||(U=d.add(M,R,r_),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=H.add(F,_,ZC),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,v),s.push(a,C,v)):z===V&&(j=`${Math.min(C,v)} ${Math.max(C,v)}`,a=m[j],c(a)||(U=d.add(R,P,r_),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=H.add(_,L,ZC),H.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(C,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(C))}let A={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(A.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(A)};var Ize=new he,Oze=new he,Rze=new he,B9=new he;Ty.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a<l;a++){let v=t[a];if(u[h++]=v.x,u[h++]=v.y,u[h++]=v.z,r){let P=i[a];f[p++]=P.x,f[p++]=P.y}}let g=[],m={},y=e.maximumRadius,b=O.chordLength(o,y),x=new Ba(void 0,void 0,e),A=new Ba(void 0,void 0,e),C=new Ba(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),P=s.pop(),M=s.pop(),R=d.fromArray(u,M*3,qse),L=d.fromArray(u,P*3,Yse),F=d.fromArray(u,v*3,Xse),_,w,D;r&&(_=H.fromArray(f,M*2,Kse),w=H.fromArray(f,P*2,$se),D=H.fromArray(f,v*2,Zse));let I=e.cartesianToCartographic(R,Ize),N=e.cartesianToCartographic(L,Oze),k=e.cartesianToCartographic(F,Rze);x.setEndPoints(I,N);let z=x.surfaceDistance;A.setEndPoints(N,k);let V=A.surfaceDistance;C.setEndPoints(k,I);let j=C.surfaceDistance,U=Math.max(z,V,j),q,Y,te,K,Z;U>b?z===U?(q=`${Math.min(M,P)} ${Math.max(M,P)}`,a=m[q],c(a)||(Y=x.interpolateUsingFraction(.5,B9),te=(I.height+N.height)*.5,K=d.fromRadians(Y.longitude,Y.latitude,te,e,r_),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=H.add(_,w,ZC),H.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(M,a,v),s.push(a,P,v)):V===U?(q=`${Math.min(P,v)} ${Math.max(P,v)}`,a=m[q],c(a)||(Y=A.interpolateUsingFraction(.5,B9),te=(N.height+k.height)*.5,K=d.fromRadians(Y.longitude,Y.latitude,te,e,r_),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=H.add(w,D,ZC),H.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(P,a,M),s.push(a,v,M)):j===U&&(q=`${Math.min(v,M)} ${Math.max(v,M)}`,a=m[q],c(a)||(Y=C.interpolateUsingFraction(.5,B9),te=(k.height+I.height)*.5,K=d.fromRadians(Y.longitude,Y.latitude,te,e,r_),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=H.add(D,_,ZC),H.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(v,a,P),s.push(a,M,P)):(g.push(M),g.push(P),g.push(v))}let S={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(S.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(S)};Ty.scaleToGeodeticHeight=function(e,t,n,i){n=n??ie.default;let o=Dze,r=Pze;if(t=t??0,i=i??!0,c(e)){let s=e.length;for(let a=0;a<s;a+=3)d.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var si=Ty;function Ay(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(Ay.prototype,{length:{get:function(){return this._length}}});Ay.prototype.enqueue=function(e){this._array.push(e),this._length++};Ay.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};Ay.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};Ay.prototype.contains=function(e){return this._array.indexOf(e)!==-1};Ay.prototype.clear=function(){this._array.length=this._offset=this._length=0};Ay.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Cy=Ay;var rr={};rr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!c(o))continue;n+=2;let r=o.positions,s=o.holes;if(c(r)&&r.length>0&&(n+=r.length*t.packedLength),c(s)){let a=s.length;for(let l=0;l<a;++l)i.push(s[l])}}return n};rr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!c(r))continue;let s=r.positions,a=r.holes;if(t[n++]=c(s)?s.length:0,t[n++]=c(a)?a.length:0,c(s)){let l=s.length;for(let u=0;u<l;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(c(a)){let l=a.length;for(let u=0;u<l;++u)o.push(a[u])}}return n};rr.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]=rr.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var Ax=new H;function eae(e,t,n,i){return H.subtract(t,e,Ax),H.multiplyByScalar(Ax,n/i,Ax),H.add(e,Ax,Ax),[Ax.x,Ax.y]}var Ey=new d;function Mze(e,t,n,i){return d.subtract(t,e,Ey),d.multiplyByScalar(Ey,n/i,Ey),d.add(e,Ey,Ey),[Ey.x,Ey.y,Ey.z]}rr.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(O.log2(o)));return Math.pow(2,r)};var _z=new he,gz=new he,Lze=new he,Nze=new d,pz=new Ba;rr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,_z),r=e.cartesianToCartographic(n,gz),a=new Ba(o,r,e).surfaceDistance/i,l=Math.max(0,Math.ceil(O.log2(a)));return Math.pow(2,l)};rr.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=rr.subdivideLineCount(n,i,o),a=H.distance(e,t),l=a/s,u=r;u.length=s*2;let f=0;for(let h=0;h<s;h++){let p=eae(e,t,h*l,a);u[f++]=p[0],u[f++]=p[1]}return u};rr.subdivideLine=function(e,t,n,i){let o=rr.subdivideLineCount(e,t,n),r=d.distance(e,t),s=r/o;c(i)||(i=[]);let a=i;a.length=o*3;let l=0;for(let u=0;u<o;u++){let f=Mze(e,t,u*s,r);a[l++]=f[0],a[l++]=f[1],a[l++]=f[2]}return a};rr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,_z),l=n.cartesianToCartographic(o,gz);pz.setEndPoints(a,l);let u=pz.surfaceDistance/r,f=Math.max(0,Math.ceil(O.log2(u))),h=Math.pow(2,f),p=H.distance(e,t),g=p/h,m=s;m.length=h*2;let y=0;for(let b=0;b<h;b++){let x=eae(e,t,b*g,p);m[y++]=x[0],m[y++]=x[1]}return m};rr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,_z),s=e.cartesianToCartographic(n,gz),a=new Ba(r,s,e);if(c(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let l=a.surfaceDistance/i,u=Math.max(0,Math.ceil(O.log2(l))),f=Math.pow(2,u),h=a.surfaceDistance/f,p=o;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*h,Lze),b=e.cartographicToCartesian(y,Nze);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var Fze=new d,Bze=new d,kze=new d,Uze=new d;rr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??ie.default;let r=Fze,s=Bze,a=kze,l=Uze;if(c(e)&&c(e.attributes)&&c(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,a),i.geodeticSurfaceNormal(a,r),l=i.scaleToGeodeticSurface(a,l),s=d.multiplyByScalar(r,n,s),s=d.add(l,s,s),u[h+f]=s.x,u[h+1+f]=s.y,u[h+2+f]=s.z,o&&(l=d.clone(a,l)),s=d.multiplyByScalar(r,t,s),s=d.add(l,s,s),u[h]=s.x,u[h+1]=s.y,u[h+2]=s.z}return e};rr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new Cy;o.enqueue(e);let r,s,a;for(;o.length!==0;){let l=o.dequeue(),u=l.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=xo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=l.holes?l.holes.length:0;for(r=0;r<f;r++){let h=l.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=xo(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(c(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(u)}return i};var Vze=new he;function zze(e,t,n){let i=n.cartesianToCartographic(e,_z),o=n.cartesianToCartographic(t,gz);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;pz.setEndPoints(i,o);let r=pz.findIntersectionWithLatitude(0,Vze);if(!c(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>O.PI){let l=s;s=a,a=l}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function Hze(e,t,n,i){if(i===qt.RHUMB)return zze(e,t,n);let o=Zn.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(c(o))return n.scaleToGeodeticSurface(o,o)}var Gze=new he;function jze(e,t,n){let i=[],o,r,s,a,l,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=O.sign(o.z),a=O.sign(r.z);let f=h=>t.cartesianToCartographic(h,Gze).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(l=Hze(o,r,t,n),++u,!c(l))continue;e.splice(u,0,l),i.push({position:u,type:s,visited:!1,next:a,theta:f(l)})}++u}return i}function tae(e,t,n,i,o,r,s){let a=[],l=r,u=h=>p=>p.position===h,f=[];do{let h=n[l];a.push(h);let p=i.findIndex(u(l)),g=i[p];if(!c(g)){++l;continue}let{visited:m,type:y,next:b}=g;if(g.visited=!0,y===0){if(b===0){let S=i[p-(s?1:-1)];if(S?.position===l+1)S.visited=!0;else{++l;continue}}if(!m&&s&&b>0||r===l&&!s&&b<0){++l;continue}}if(!(s?y>=0:y<=0)){++l;continue}m||f.push(l);let A=p+(s?1:-1),C=i[A];if(!c(C)){++l;continue}l=C.position}while(l<n.length&&l>=0&&l!==r&&a.length<n.length);e.splice(t,o,a);for(let h of f)t=tae(e,++t,n,i,0,h,!s);return t}rr.splitPolygonsOnEquator=function(e,t,n,i){c(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=jze(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let l=s[0].z>=0;o=tae(i,o,s,a,1,0,l)}return i};rr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],l=new Cy;l.enqueue(e);let u=c(r);for(;l.length!==0;){let f=l.dequeue(),h=f.positions,p=f.holes,g,m;if(i)for(m=h.length,g=0;g<m;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=xo(h,d.equalsEpsilon,!0)),h.length<3)continue;let y=n(h);if(!c(y))continue;let b=[],x=si.computeWindingOrder2D(y);if(x===ts.CLOCKWISE&&(y.reverse(),h=h.slice().reverse()),u){u=!1;let P=[h];if(P=r(P,P),P.length>1){for(let M of P)l.enqueue(new ka(M,p));continue}}let A=h.slice(),C=c(p)?p.length:0,S=[],v;for(g=0;g<C;g++){let P=p[g],M=P.positions;if(i)for(m=M.length,v=0;v<m;++v)o.scaleToGeodeticSurface(M[v],M[v]);if(t||(M=xo(M,d.equalsEpsilon,!0)),M.length<3)continue;let R=n(M);if(!c(R))continue;x=si.computeWindingOrder2D(R),x===ts.CLOCKWISE&&(R.reverse(),M=M.slice().reverse()),S.push(M),b.push(A.length),A=A.concat(M),y=y.concat(R);let L=0;for(c(P.holes)&&(L=P.holes.length),v=0;v<L;v++)l.enqueue(P.holes[v])}s.push({outerRing:h,holes:S}),a.push({positions:A,positions2D:y,holes:b})}return{hierarchy:s,polygons:a}};var Wze=new H,qze=new d,Yze=new Le,Xze=new J;rr.computeBoundingRectangle=function(e,t,n,i,o){let r=Le.fromAxisAngle(e,i,Yze),s=J.fromQuaternion(r,Xze),a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let g=d.clone(n[p],qze);J.multiplyByVector(s,g,g);let m=t(g,Wze);c(m)&&(a=Math.min(a,m.x),l=Math.max(l,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=l-a,o.height=f-u,o};rr.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let l=t.positions,u=c(n),f=u?n.positions:void 0;if(o){let h=l.length,p=new Array(h*3),g=0;for(let b=0;b<h;b++){let x=l[b];p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}let m={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:H.packArray(f)}));let y=new ct(m);return r.normal?Nn.computeNormal(y):y}if(s===qt.GEODESIC)return si.computeSubdivision(e,l,a,f,i);if(s===qt.RHUMB)return si.computeRhumbLineSubdivision(e,l,a,f,i)};var Qse=[],Jse=[],Kze=new d,$ze=new d;rr.computeWallGeometry=function(e,t,n,i,o,r){let s,a,l,u,f,h,p,g,m,y=e.length,b=0,x=0,A=c(t),C=A?t.positions:void 0;if(o)for(a=y*3*2,s=new Array(a*2),A&&(m=y*2*2,g=new Array(m*2)),l=0;l<y;l++)u=e[l],f=e[(l+1)%y],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,A&&(h=C[l],p=C[(l+1)%y],g[x]=g[x+m]=h.x,++x,g[x]=g[x+m]=h.y,++x,g[x]=g[x+m]=p.x,++x,g[x]=g[x+m]=p.y,++x);else{let R=O.chordLength(i,n.maximumRadius),L=0;if(r===qt.GEODESIC)for(l=0;l<y;l++)L+=rr.subdivideLineCount(e[l],e[(l+1)%y],R);else if(r===qt.RHUMB)for(l=0;l<y;l++)L+=rr.subdivideRhumbLineCount(n,e[l],e[(l+1)%y],R);for(a=(L+y)*3,s=new Array(a*2),A&&(m=(L+y)*2,g=new Array(m*2)),l=0;l<y;l++){u=e[l],f=e[(l+1)%y];let F,_;A&&(h=C[l],p=C[(l+1)%y]),r===qt.GEODESIC?(F=rr.subdivideLine(u,f,R,Jse),A&&(_=rr.subdivideTexcoordLine(h,p,u,f,R,Qse))):r===qt.RHUMB&&(F=rr.subdivideRhumbLine(n,u,f,R,Jse),A&&(_=rr.subdivideTexcoordRhumbLine(h,p,n,u,f,R,Qse)));let w=F.length;for(let D=0;D<w;++D,++b)s[b]=F[D],s[b+a]=F[D];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,A){let D=_.length;for(let I=0;I<D;++I,++x)g[x]=_[I],g[x+m]=_[I];g[x]=p.x,g[x+m]=p.x,++x,g[x]=p.y,g[x+m]=p.y,++x}}}y=s.length;let S=Fe.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,l=0;l<y;l++){let R=l,L=R+1,F=R+y,_=F+1;u=d.fromArray(s,R*3,Kze),f=d.fromArray(s,L*3,$ze),!d.equalsEpsilon(u,f,O.EPSILON10,O.EPSILON10)&&(S[v++]=R,S[v++]=F,S[v++]=L,S[v++]=L,S[v++]=F,S[v++]=_)}let P={attributes:new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Me.TRIANGLES};return A&&(P.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:g})),new ct(P)};var zn=rr;function Gr(e,t){this.position=e,c(this.position)||(this.position=new H),this.tangentPlane=t,c(this.tangentPlane)||(this.tangentPlane=Gr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Gr.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=H.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(O.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=O.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=O.TWO_PI),e}}});var QC=new he,Zze=new d;Gr.prototype.getLatitude=function(e){c(e)||(e=ie.default),QC.latitude=this.conformalLatitude,QC.longitude=this.longitude,QC.height=0;let t=this.ellipsoid.cartographicToCartesian(QC,Zze);return e.cartesianToCartographic(t,QC),QC.latitude};var Qze=new mn,Jze=new d,e4e=new d;Gr.fromCartesian=function(e,t){T.defined("cartesian",e);let n=O.signNotZero(e.z),i=Gr.NORTH_POLE_TANGENT_PLANE,o=Gr.SOUTH_POLE;n<0&&(i=Gr.SOUTH_POLE_TANGENT_PLANE,o=Gr.NORTH_POLE);let r=Qze;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,Jze),d.normalize(r.direction,r.direction);let s=Zn.rayPlane(r,i.plane,e4e),a=d.subtract(s,o,s),l=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return c(t)?(t.position=new H(l,u),t.tangentPlane=i,t):new Gr(new H(l,u),i)};Gr.fromCartesianArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Gr.fromCartesian(e[i],t[i]);return t};Gr.clone=function(e,t){if(c(e))return c(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Gr(e.position,e.tangentPlane)};Gr.HALF_UNIT_SPHERE=Object.freeze(new ie(.5,.5,.5));Gr.NORTH_POLE=Object.freeze(new d(0,0,.5));Gr.SOUTH_POLE=Object.freeze(new d(0,0,-.5));Gr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new ns(Gr.NORTH_POLE,Gr.HALF_UNIT_SPHERE));Gr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new ns(Gr.SOUTH_POLE,Gr.HALF_UNIT_SPHERE));var yc=Gr;var t4e=new he,nae=new he;function n4e(e,t,n,i){let r=i.cartesianToCartographic(e,t4e).height,s=i.cartesianToCartographic(t,nae);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,nae);a.height=r-100,i.cartographicToCartesian(a,n)}var iae=new Ke,i4e=new d,o4e=new d,r4e=new d,s4e=new d,a4e=new d,c4e=new d,yz=new d,Sm=new d,JC=new d,l4e=new H,u4e=new H,f4e=new d,oae=new Le,d4e=new J,h4e=new J;function k9(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=c(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,l=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,b=l4e;b.x=f.x,b.y=f.y;let x=t.st?new Float32Array(2*(s/3)):void 0,A;t.normal&&(y&&l&&!a?A=n.attributes.normal.values:A=new Float32Array(s));let C=t.tangent?new Float32Array(s):void 0,S=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,P=0,M=0,R=o4e,L=r4e,F=s4e,_=!0,w=d4e,D=h4e;if(m!==0){let k=Le.fromAxisAngle(h,m,oae);w=J.fromQuaternion(k,w),k=Le.fromAxisAngle(h,-m,oae),D=J.fromQuaternion(k,D)}else w=J.clone(J.IDENTITY,w),D=J.clone(J.IDENTITY,D);let I=0,N=0;l&&u&&(I=s/2,N=s/3,s/=2);for(let k=0;k<s;k+=3){let z=d.fromArray(o,k,f4e);if(t.st&&!c(r)){let V=J.multiplyByVector(w,z,i4e);V=g.scaleToGeodeticSurface(V,V);let j=p([V],u4e)[0];H.subtract(j,b,j);let U=O.clamp(j.x/f.width,0,1),q=O.clamp(j.y/f.height,0,1);u&&(x[P+N]=U,x[P+1+N]=q),l&&(x[P]=U,x[P+1]=q),P+=2}if(t.normal||t.tangent||t.bitangent||i){let V=M+1,j=M+2;if(a){if(k+3<s){let U=d.fromArray(o,k+3,a4e);if(_){let q=d.fromArray(o,k+s,c4e);y&&n4e(z,U,q,g),d.subtract(U,z,U),d.subtract(q,z,q),R=d.normalize(d.cross(q,U,R),R),_=!1}d.equalsEpsilon(U,z,O.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(F=g.geodeticSurfaceNormal(z,F),t.tangent&&(L=d.normalize(d.cross(F,R,L),L)))}else R=g.geodeticSurfaceNormal(z,R),(t.tangent||t.bitangent)&&(y&&(yz=d.fromArray(A,M,yz),Sm=d.cross(d.UNIT_Z,yz,Sm),Sm=d.normalize(J.multiplyByVector(D,Sm,Sm),Sm),t.bitangent&&(JC=d.normalize(d.cross(yz,Sm,JC),JC))),L=d.cross(d.UNIT_Z,R,L),L=d.normalize(J.multiplyByVector(D,L,L),L),t.bitangent&&(F=d.normalize(d.cross(R,L,F),F)));t.normal&&(e.wall?(A[M+I]=R.x,A[V+I]=R.y,A[j+I]=R.z):u&&(A[M+I]=-R.x,A[V+I]=-R.y,A[j+I]=-R.z),(l&&!y||a)&&(A[M]=R.x,A[V]=R.y,A[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(z,R)),v[M+I]=-R.x,v[V+I]=-R.y,v[j+I]=-R.z),t.tangent&&(e.wall?(C[M+I]=L.x,C[V+I]=L.y,C[j+I]=L.z):u&&(C[M+I]=-L.x,C[V+I]=-L.y,C[j+I]=-L.z),l&&(y?(C[M]=Sm.x,C[V]=Sm.y,C[j]=Sm.z):(C[M]=L.x,C[V]=L.y,C[j]=L.z))),t.bitangent&&(u&&(S[M+I]=F.x,S[V+I]=F.y,S[j+I]=F.z),l&&(y?(S[M]=JC.x,S[V]=JC.y,S[j]=JC.z):(S[M]=F.x,S[V]=F.y,S[j]=F.z))),M+=3}}t.st&&!c(r)&&(n.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:C})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:S})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&c(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===Zt.TOP)l&&u||a?h=h.fill(1,0,f/2):l&&(h=h.fill(1));else{let p=e.offsetAttribute===Zt.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var rae=[];function m4e(e,t,n,i,o,r,s,a,l,u){let f={walls:[]},h;if(s||a){let A=zn.createGeometryFromPositions(e,t,n,i,r,l,u),C=A.attributes.position.values,S=A.indices,v,P;if(s&&a){let M=C.concat(C);v=M.length/3,P=Fe.createTypedArray(v,S.length*2),P.set(S);let R=S.length,L=v/2;for(h=0;h<R;h+=3){let F=P[h]+L,_=P[h+1]+L,w=P[h+2]+L;P[h+R]=w,P[h+1+R]=_,P[h+2+R]=F}if(A.attributes.position.values=M,r&&l.normal){let F=A.attributes.normal.values;A.attributes.normal.values=new Float32Array(M.length),A.attributes.normal.values.set(F)}if(l.st&&c(n)){let F=A.attributes.st.values;A.attributes.st.values=new Float32Array(v*2),A.attributes.st.values=F.concat(F)}A.indices=P}else if(a){for(v=C.length/3,P=Fe.createTypedArray(v,S.length),h=0;h<S.length;h+=3)P[h]=S[h+2],P[h+1]=S[h+1],P[h+2]=S[h];A.indices=P}f.topAndBottom=new St({geometry:A})}let p=o.outerRing,g=ns.fromPoints(p,e),m=g.projectPointsOntoPlane(p,rae),y=si.computeWindingOrder2D(m);y===ts.CLOCKWISE&&(p=p.slice().reverse());let b=zn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new St({geometry:b}));let x=o.holes;for(h=0;h<x.length;h++){let A=x[h];m=g.projectPointsOntoPlane(A,rae),y=si.computeWindingOrder2D(m),y===ts.COUNTER_CLOCKWISE&&(A=A.slice().reverse()),b=zn.computeWallGeometry(A,n,e,i,r,u),f.walls.push(new St({geometry:b}))}return f}function kf(e){if(T.typeOf.object("options",e),T.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),c(e.perPositionHeight)&&e.perPositionHeight&&c(e.height))throw new E("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new E("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.vertexFormat??Ie.DEFAULT,i=e.ellipsoid??ie.default,o=e.granularity??O.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,l=a&&c(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!l){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=Ie.clone(n),this._ellipsoid=ie.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=l,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??qt.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=zn.computeHierarchyPackedLength(t,d)+ie.packedLength+Ie.packedLength+(s?zn.computeHierarchyPackedLength(s,H):1)+12}kf.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);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 kf(t)};kf.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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++]=e._offsetAttribute??-1,t[n++]=e._arcType,c(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var p4e=ie.clone(ie.UNIT_SPHERE),_4e=new Ie,g4e={polygonHierarchy:{}};kf.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,p4e);t+=ie.packedLength;let r=Ie.unpack(e,t,_4e);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],b=e[t++],x=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,H);c(x)?(t=x.startingIndex,delete x.startingIndex):t++;let A=e[t++];return c(n)||(n=new kf(g4e)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=l,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=b,n._textureCoordinates=x,n.packedLength=A,n};var y4e=new H,b4e=new H,x4e=new yc;function sae(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+O.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 l=e.getLatitude(n),u=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),i!==qt.RHUMB){let p=H.subtract(t.position,e.position,y4e),g=H.dot(t.position,p)/H.dot(p,p);if(g>0&&g<1){let m=H.add(t.position,H.multiplyByScalar(p,-g,p),b4e),y=yc.clone(t,x4e);y.position=m;let b=y.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(l)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=H.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var aae=new yc,T4e=new yc,Bf={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};kf.computeRectangleFromPositions=function(e,t,n,i){if(T.defined("positions",e),c(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,Bf.northAngle=0,Bf.southAngle=0,Bf.westOverIdl=Number.POSITIVE_INFINITY,Bf.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=yc.fromCartesian(e[0],T4e);for(let s=1;s<o;s++){let a=yc.fromCartesian(e[s],aae);sae(a,r,t,n,Bf,i),r=yc.clone(a,r)}return sae(yc.fromCartesian(e[0],aae),r,t,n,Bf,i),i.east-i.west>Bf.eastOverIdl-Bf.westOverIdl&&(i.west=Bf.westOverIdl,i.east=Bf.eastOverIdl,i.east>O.PI&&(i.east=i.east-O.TWO_PI),i.west>O.PI&&(i.west=i.west-O.TWO_PI)),O.equalsEpsilon(Math.abs(Bf.northAngle),O.TWO_PI,O.EPSILON10)&&(i.north=O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),O.equalsEpsilon(Math.abs(Bf.southAngle),O.TWO_PI,O.EPSILON10)&&(i.south=-O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),i};var A4e=new yc;function C4e(e,t,n){return e.height>=O.PI||e.width>=O.PI?yc.fromCartesian(t[0],A4e).tangentPlane:ns.fromPoints(t,n)}var cae=new he;function E4e(e,t,n){return(i,o)=>{if(e.height>=O.PI||e.width>=O.PI){if(e.south<0&&e.north>0){c(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],cae);o[s]=new H(a.longitude/O.PI,a.latitude/O.PI_OVER_TWO)}return o.length=i.length,o}return yc.fromCartesianArray(i,o)}return ns.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function S4e(e,t,n){if(e.height>=O.PI||e.width>=O.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,cae);return c(r)||(r=new H),r.x=s.longitude/O.PI,r.y=s.latitude/O.PI_OVER_TWO,r}return yc.fromCartesian(o,r)};let i=ns.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function w4e(e,t,n,i){return(o,r)=>!i&&(e.height>=O.PI_OVER_TWO||e.width>=2*O.PI_OVER_THREE)?zn.splitPolygonsOnEquator(o,t,n,r):o}function v4e(e,t,n,i){if(t.height>=O.PI||t.width>=O.PI)return Ke.fromRectangle(t,void 0,iae);let o=e,r=ns.fromPoints(o,n);return zn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,iae)}kf.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,l=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=c(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=zn.polygonsFromHierarchy(r,h,E4e(g,p,n),!s,n,w4e(g,n,u,s)),y=m.hierarchy,b=m.polygons,x=function(I){return I},A=h?zn.polygonsFromHierarchy(f,!0,x,!1,n).polygons:void 0;if(y.length===0)return;let C=y[0].outerRing,S=v4e(C,g,n,o),v=[],P=e._height,M=e._extrudedHeight,R=e._perPositionHeightExtrude||!O.equalsEpsilon(P,M,0,O.EPSILON2),L={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:C4e(g,C,n).plane.normal,projectTo2d:S4e(g,C,n),boundingRectangle:S,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},F;if(R)for(L.extrude=!0,L.top=a,L.bottom=l,L.shadowVolume=e._shadowVolume,L.offsetAttribute=e._offsetAttribute,F=0;F<b.length;F++){let I=m4e(n,b[F],h?A[F]:void 0,i,y[F],s,a,l,t,u),N;a&&l?(N=I.topAndBottom,L.geometry=zn.scaleToGeodeticHeightExtruded(N.geometry,P,M,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,P,n,!s),L.geometry=N.geometry):l&&(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,M,n,!0),L.geometry=N.geometry),(a||l)&&(L.wall=!1,N.geometry=k9(L),v.push(N));let k=I.walls;L.wall=!0;for(let z=0;z<k.length;z++){let V=k[z];L.geometry=zn.scaleToGeodeticHeightExtruded(V.geometry,P,M,n,s),V.geometry=k9(L),v.push(V)}}else for(F=0;F<b.length;F++){let I=new St({geometry:zn.createGeometryFromPositions(n,b[F],h?A[F]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=si.scaleToGeodeticHeight(I.geometry.attributes.position.values,P,n,!s),L.geometry=I.geometry,I.geometry=k9(L),c(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,k=e._offsetAttribute===Zt.NONE?0:1,z=new Uint8Array(N/3).fill(k);I.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}v.push(I)}let _=Nn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Fe.createTypedArray(_.attributes.position.values.length/3,_.indices);let w=_.attributes,D=le.fromVertices(w.position.values);return t.position||delete w.position,new ct({attributes:w,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:D,offsetAttribute:e._offsetAttribute})};kf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new kf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function D4e(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 ct._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(kf.prototype,{rectangle:{get:function(){if(!c(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=kf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=D4e(this)),this._textureCoordinateRotationPoints}}});var s_=kf;function Cx(e){T.typeOf.object("options",e),T.typeOf.object("options.positions",e.positions),T.typeOf.number.greaterThanOrEquals("options.positions.length",e.positions.length,3),this._ellipsoid=e.ellipsoid??ie.default,this._positions=[...e.positions]}Object.defineProperties(Cx.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});Cx.clone=function(e,t){return T.typeOf.object("polygon",e),c(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new Cx({positions:e.positions,ellipsoid:e.ellipsoid})};Cx.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};Cx.prototype.computeRectangle=function(e){return s_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var P4e=new ce,lae=new d;Cx.prototype.computeSphericalExtents=function(e){c(e)||(e=new ce);let t=this.computeRectangle(P4e),n=he.toCartesian(ce.southwest(t),this.ellipsoid,lae),i=Math.sqrt(n.x*n.x+n.y*n.y),o=O.fastApproximateAtan2(i,n.z),r=O.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ce.northeast(t),this.ellipsoid,lae),i=Math.sqrt(n.x*n.x+n.y*n.y),o=O.fastApproximateAtan2(i,n.z),r=O.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var eE=Cx;var N1=`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; -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); -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; -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; -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); -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; -} -} -vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; -out_FragColor = min(out_FragColor, result); -} -lastPolygonIndex += positionsLength; -} -} -`;function os(e){e=e??W.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new pe,this.polygonRemoved=new pe,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(c(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(os.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}}});os.prototype.add=function(e){T.typeOf.object("polygon",e);let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};os.prototype.get=function(e){return T.typeOf.number("index",e),this._polygons[e]};os.prototype.contains=function(e){return T.typeOf.object("polygon",e),this._polygons.some(t=>eE.equals(t,e))};os.prototype.remove=function(e){T.typeOf.object("polygon",e);let t=this._polygons,n=t.findIndex(i=>eE.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var I4e=new ce;function O4e(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a);f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let g=t[p];if(c(g)&&c(ce.simpleIntersection(g,f))&&!ce.equals(g,f)){let m=n[p];h.push(...m),m.reduce((y,b)=>ce.union(e[b].computeSphericalExtents(I4e),y,y),a),t[p]=void 0,n[p]=void 0,l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a,f),f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(h)}let o=new Map;return n.filter(c).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(c),extentsIndexByPolygon:o}}os.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 R4e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=O4e(i),s=0;for(let[l,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(l);for(let h=0;h<f;++h){let p=u.positions[h],g=Math.hypot(p.x,p.y),m=O.fastApproximateAtan2(g,p.z),y=O.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=y}}let a=0;for(let l of o){let u=1/(l.east-l.west),f=1/(l.north-l.south);n[a++]=l.south,n[a++]=l.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var U9=new H;os.prototype.update=function(e){let t=e.context;if(!os.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;c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(c(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!c(i)){let s=os.getTextureResolution(i,this.pixelsNeededForPolygonPositions,U9);i=new Rt({context:t,width:s.x,height:s.y,pixelFormat:ke.RG,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(c(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!c(o)){let s=os.getTextureResolution(o,this.pixelsNeededForExtents,U9);o=new Rt({context:t,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(R4e(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}}),!c(r)){let s=os.getClippingDistanceTextureResolution(this,U9);r=new Rt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?ke.RED:ke.LUMINANCE,pixelDatatype:Ue.FLOAT,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=M4e(this)};os.prototype.queueCommands=function(e){c(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function M4e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Uc({fragmentShaderSource:N1,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 uae=new ce,L4e=new ce;os.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Wt.OUTSIDE;this.inverse&&(o=Wt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),l=e.rectangle;if(!c(l)&&c(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();l=ce.fromCartesianArray(f,t,uae)}c(l)||(l=ce.fromBoundingSphere(e.boundingSphere,t,uae));let u=ce.simpleIntersection(l,a,L4e);c(u)&&(o=Wt.INTERSECTING)}return o};os.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new E("ClippingPolygonCollection should only be assigned to one object");e._owner=t,t[n]=e}};os.isSupported=function(e){return e?.context.webgl2};os.getTextureResolution=function(e,t,n){if(c(e))return n.x=e.width,n.y=e.height,n;let i=ut.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};os.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return c(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(ut.maximumTextureSize,4096),t.y=Math.min(ut.maximumTextureSize,4096),t)};os.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return c(n)?(t.x=n.width,t.y=n.height,t):os.getTextureResolution(n,e.pixelsNeededForExtents,t)};os.prototype.isDestroyed=function(){return!1};os.prototype.destroy=function(){return c(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(),de(this)};var th=os;var F1={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};F1.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?F1.SUNLIGHT:F1.SCENE_LIGHT:F1.NONE};var a_=Object.freeze(F1);function fae(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(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=a_.NONE}fae.requiresColorCorrect=function(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))};var Ex=fae;var nh=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +`;let d=new Ye({sources:[a]}),p=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Cxe(e){let t=e?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:t,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}var Tot={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND},Eot={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Cot(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(Cxe(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(Cxe(!0)),e._rsColorPass=Ge.fromCache(Tot),e._rsPickPass=Ge.fromCache(Eot))}var jT=new N,vxe=new h;function vot(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return N.clone(i,jT),N.multiplyByPoint(jT,e._center,vxe),N.setTranslation(jT,vxe,jT),N.multiply(r,jT,jT),jT},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function LQ(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function Sot(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=LQ(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=LQ(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=LQ(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function FQ(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function wot(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=FQ(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=FQ(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=FQ(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function Iot(e,t){return t.color.toRgba()-e.color.toRgba()}function Pot(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(Iot),t.webgl2?wot(e,n):Sot(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Dot(e,t){let n=Pot(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??N.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new at({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Ie.TERRAIN_CLASSIFICATION;let A=at.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new at({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Ie.TERRAIN_CLASSIFICATION;let x=at.shallowClone(b,b.derivedCommands.tileset);x.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function Rot(e,t){if(e.classificationType===ti.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=at.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function Oot(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=e._modelMatrix??N.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new at({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=at.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new at({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let y=at.shallowClone(m,m.derivedCommands.tileset);y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}i_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new sa(e,o)}};i_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Mot(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Not=new z,Lot=z.WHITE,Fot=!0,Bot=/\$/;i_.prototype.applyStyle=function(e,t){if(!l(e)){Mot(this,t);return}let n=e.color,i=n instanceof Zd&&!Bot.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,Not):Lot,c.show=l(e.show)?e.show.evaluate(c):Fot}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};i_.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(s>=y&&s<y+A)break}c.push(new s0({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<s?d.push(A):p.push(A)}p.length!==0&&c.push(new s0({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function Sxe(e,t,n,i){let r=e.classificationType,o=r!==ti.CESIUM_3D_TILE,s=r!==ti.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function kot(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ie.OPAQUE,n.push(o)}}function Uot(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ge.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Oe.LINES):(n=e._rsColorPass,i=Oe.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}i_.prototype.update=function(e){let t=e.context;bot(this,t),xot(this,t),Cot(this),vot(this,t);let n=e.passes;n.render&&(Dot(this,t),Rot(this,e),Uot(this),this._debugWireframe?kot(e,this._commands):Sxe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(Oot(this),Sxe(this,e,this._pickCommands))};i_.prototype.isDestroyed=function(){return!1};i_.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(),ue(this)};var HT=i_;function Vf(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=h.clone(this._boundingVolume.center):this._center=h.clone(h.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=ti.BOTH}Object.defineProperties(Vf.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}}});Vf.packedBoxLength=N.packedLength+h.packedLength;Vf.packedCylinderLength=N.packedLength+2;Vf.packedEllipsoidLength=N.packedLength+h.packedLength;Vf.packedSphereLength=h.packedLength+1;function zot(e){let t=new Float64Array(N.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,N.pack(e._modelMatrix,t,n),t}function Vot(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ce.unpack(t,n),n+=ce.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new s0({color:u,offset:f,count:d,batchIds:g})}return i}var jot=new $n("createVectorTileGeometries",5),Hot=new z;function Got(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,Hot);u[A]=b.toRgba()}f=e._packedBuffer=zot(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.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)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=jot.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Vot(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),Wot(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function Wot(e){l(e._primitive)||(e._primitive=new HT({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: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)}Vf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Vf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Vf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Vf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Vf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Got(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)};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var r_=Vf;var BQ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,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,Xot(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return wxe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){wxe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function qot(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function Yot(e,t){let n,i,r,o,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var GT=Uint32Array.BYTES_PER_ELEMENT;function Xot(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=GT;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=GT;let s=r.getUint32(n,!0);if(n+=GT,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=GT,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=GT;let u=r.getUint32(n,!0);n+=GT;let f=r.getUint32(n,!0);n+=GT;let d=Ro(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Ro(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,E=new Am(e,T,g,m,qot(e));if(e._batchTable=E,T===0)return;let v=e.tile.computedTransform,S;l(d.RTC_CENTER)&&(S=h.unpack(d.RTC_CENTER),N.multiplyByPoint(v,S,S));let I=Yot(d,p);if(y>0||A>0||b>0||x>0){let R,O,L,_;if(y>0){let C=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,C,r_.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,r_.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,r_.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,r_.packedSphereLength*x)}return e._geometries=new r_({boxes:R,boxBatchIds:I.boxes,cylinders:O,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:S,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function wxe(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}}var dF=BQ;var NA={};NA.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:NA.parseBoundingVolumeSemantic(e,t),minimumHeight:NA._parseMinimumHeight(e,t),maximumHeight:NA._parseMaximumHeight(e,t)}};NA.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};NA._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};NA._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var LA=NA;var JS=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=o.getTemplateValues(),a=r.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,s){s=s??0;let a;l(o)&&(a=new Uint8Array(o,s));let c=n.implicitTileset,u=n.implicitCoordinates,f=await Eg.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,Kot(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)}};function Kot(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=Jot(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=$ot(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=sst(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function $ot(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Jot(e,t,n,i){let s=Ixe(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=Ixe(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Pxe(e,t,n){let i=kd.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Ixe(e,t,n,i,r,o){let s=e._implicitTileset,a;o??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=LA.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let v=0;v<d;v++)if(t.contentIsAvailableAtCoordinates(a,v)){p=!0;break}let g=est(s,a,i,o,n,u),m=[];for(let v=0;v<s.contentCount;v++){if(!t.contentIsAvailableAtIndex(r,v))continue;let R={uri:s.contentUriTemplates[v].getDerivedResource({templateValues:a.getTemplateValues()}).url},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(a,v);O=LA.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=tst(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=Pxe(c,s,a),A={boundingVolume:g,geometricError:y,refine:s.refine,contents:m},b=!0,x=Je(s.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Ot(A,x,b),E=Nxe(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function cG(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(er(e,"3DTILES_bounding_volume_S2")||l(e.region))}function UQ(e,t){l(t)&&(er(e,"3DTILES_bounding_volume_S2")?Qot(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Zot(e.region,t.minimumHeight,t.maximumHeight))}function Zot(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Qot(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function est(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!cG(o.boundingVolume,o)&&cG(e.boundingVolume,o)?s=Dxe(e,t,n,i??!1,r):s=o.boundingVolume,UQ(s,o),s}function tst(e,t){let n;return l(t)&&(n=t.boundingVolume),cG(n,t)?UQ(n,t):cG(e,t)&&(n=Je(e,!0),UQ(n,t)),n}function Dxe(e,t,n,i,r){let o=e.boundingVolume;return er(o,"3DTILES_bounding_volume_S2")?Rxe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:Mxe(o.region,t.level,t.x,t.y,t.z)}:{box:Oxe(o.box,t.level,t.x,t.y,t.z)}}function Rxe(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:jg.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?AS.encode2D(i,r,o):AS.encode2D(i,o,r),f=jg.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:jg.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var nst=new h,ist=new h,kQ=new h,rst=new $;function Oxe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,ist),s=$.unpack(e,3,rst),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,nst);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,kQ);p=$.multiplyByVector(s,p,kQ),p=h.add(p,o,kQ);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var ost=new ie;function Mxe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,ost),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=D.negativePiToPi(o.west+n*u),d=D.negativePiToPi(f+u),p=c*o.height,g=D.negativePiToPi(o.south+i*p),m=D.negativePiToPi(g+p),y=s,A=a;if(l(r)){let b=c*(a-s);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function sst(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=Dxe(i,r,n,!1,t),s=Pxe(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Nxe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Nxe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}JS._deriveBoundingBox=Oxe;JS._deriveBoundingRegion=Mxe;JS._deriveBoundingVolumeS2=Rxe;var ZS=JS;var Lxe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Lxe);var Ku=Lxe;function QS(e,t){this._distance=t,this._normal=new Fxe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(QS.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});QS.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new QS(e.normal,e.distance),t};QS.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new QS(e.normal,e.distance)};function Fxe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Fxe.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 aa=QS;function ml(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Vxe:jxe,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 r=0;r<i;++r)this.add(n[r])}}function Vxe(e){return e===$t.OUTSIDE}function jxe(e){return e===$t.INSIDE}Object.defineProperties(ml.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?Vxe:jxe)}},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 Bxe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}ml.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Bxe(n,i)},e.index=t,Bxe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};ml.prototype.get=function(e){return this._planes[e]};function Hxe(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}ml.prototype.contains=function(e){return Hxe(this._planes,e)!==-1};ml.prototype.remove=function(e){let t=this._planes,n=Hxe(t,e);if(n===-1)return!1;e instanceof aa&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof aa&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};ml.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof aa&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var ast=new se,cst=new se;function kxe(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=cn.octEncodeToCartesian4(a.normal,cst);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,ast);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function Uxe(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function Gxe(e,t){let n=kt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var lst=new U;ml.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=ml.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Gxe(r,lst);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(Uxe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(kxe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s,a;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),Uxe(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),kxe(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var ust=new N,zxe=new sn(h.UNIT_X,0);ml.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=N.multiply(t,r,ust));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,r,zxe);let c=e.intersectPlane(zxe);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};ml.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ml.useFloatTexture=function(e){return e.floatingPointTexture};ml.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=ml.useFloatTexture(t)?e.length:e.length*2,o=Gxe(r,n);return o.y*=2,o};ml.prototype.isDestroyed=function(){return!1};ml.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var Is=ml;function ew(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=lG(e.positions),this._holes=l(e.holes)?e.holes.map(lG):[],this._rectangle=r0.computeRectangleFromPositions(this._positions,this._ellipsoid),zQ(this._positions),Wxe(this._holes)}function lG(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function zQ(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function Wxe(e){for(let t=0;t<e.length;t++)zQ(e[t]);return Object.freeze(e)}function fst(e,t){if(!l(e)&&!l(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++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}function dst(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!fst(e[n],t[n]))return!1;return!0}Object.defineProperties(ew.prototype,{length:{get:function(){let e=this._positions.length,t=this._holes;for(let n=0;n<t.length;n++)e+=t[n].length;return e}},positions:{get:function(){return this._positions}},holes:{get:function(){return this._holes}},ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}}});ew.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=lG(e.positions),t._holes=e.holes.map(lG),t._rectangle=r0.computeRectangleFromPositions(t._positions,t._ellipsoid),zQ(t._positions),Wxe(t._holes),t):new ew({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};ew.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&dst(e.holes,t.holes)};ew.prototype.computeRectangle=function(e){return Yr("ClippingPolygon.computeRectangle","ClippingPolygon.computeRectangle is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Use the ClippingPolygon.rectangle property instead."),ie.clone(this._rectangle,e)};var tw=ew;var HQ=new No,VQ="ClippingPolygonCollection.quality is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",jQ="ClippingPolygonCollection.debugShowDistanceTexture is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",hst="ClippingPolygonCollection.isDestroyed is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.",mst="ClippingPolygonCollection.destroy is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.";function pl(e){e=e??H.EMPTY_OBJECT,this._polygons=[];let t=e.polygons??[],n=0,i=0;for(let r=0;r<t.length;++r)n+=t[r].length,i+=t[r].holes.length;this._dirty=!1,this._bufferPolygonCollection=new za({show:!1,allowPicking:!1,primitiveCountMax:2*t.length,vertexCountMax:2*n,holeCountMax:i>0?2*i:0,triangleCountMax:0});for(let r=0;r<t.length;++r){let o=this._bufferPolygonCollection.primitiveCount;this._bufferPolygonCollection.add(Yxe(t[r]),HQ),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&Yr("ClippingPolygonCollection.debugShowDistanceTexture",jQ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&Yr("ClippingPolygonCollection.quality",VQ),this._quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,this.ellipsoid=e.ellipsoid??ee.default,this._owner=void 0,this._vectorCollectionData=ws.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(pl.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return Yr("ClippingPolygonCollection.debugShowDistanceTexture",jQ),this._debugShowDistanceTexture},set:function(e){Yr("ClippingPolygonCollection.debugShowDistanceTexture",jQ),this._debugShowDistanceTexture=e}},quality:{get:function(){return Yr("ClippingPolygonCollection.quality",VQ),this._quality},set:function(e){Yr("ClippingPolygonCollection.quality",VQ),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function Yxe(e){let t=e.positions,n=e.holes,i=new Float64Array(e.length*3),r=0;for(let s=0;s<t.length;s++)h.pack(t[s],i,r*3),r++;if(n.length===0)return{positions:i,holes:void 0};let o=new Uint32Array(n.length);for(let s=0;s<n.length;s++){let a=n[s];o[s]=r;for(let c=0;c<a.length;c++)h.pack(a[c],i,r*3),r++}return{positions:i,holes:o}}function pst(e,t,n){let i=e._bufferPolygonCollection,r=i.primitiveCount+1,o=i.vertexCount+t,s=i.holeCount+n;if(r<=i.primitiveCountMax&&o<=i.vertexCountMax&&s<=i.holeCountMax)return i;let a=e._polygons.length!==i.primitiveCount,c=za.fromCollection(i,{primitiveCountMax:D.nextPowerOfTwo(r),vertexCountMax:D.nextPowerOfTwo(o),holeCountMax:D.nextPowerOfTwo(s)},a?u=>u.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let u=e._polygons;for(let f=0;f<u.length;++f)u[f].bufferIndex=f}return c}function Xxe(e,t){e._bufferPolygonCollection.get(t.bufferIndex,HQ).show=!1,t.bufferIndex=-1}pl.prototype.add=function(e){let t=this._polygons.length,n=pst(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(Yxe(e),HQ),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};pl.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};pl.prototype.contains=function(e){return this._polygons.some(t=>tw.equals(t.clippingPolygon,e))};pl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>tw.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return Xxe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};pl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];Xxe(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};pl.prototype.update=function(e){if(!pl.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=ws.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var qxe=new ie,gst=new ie;pl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=$t.OUTSIDE;this.inverse&&(r=$t.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let s=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(s,t,qxe)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,qxe));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,gst);if(l(c))return $t.INTERSECTING}return r};pl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};pl.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(ws.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(ws.packPolygonGrid(n),ws.packPolygonTextures(t,n)),n};pl.releaseRectangleData=function(e){ws.freeResources(e)};pl.isSupported=function(e){return e?.context.webgl2};pl.prototype.isDestroyed=function(){return Yr("ClippingPolygonCollection.isDestroyed",hst),!1};pl.prototype.destroy=function(){return Yr("ClippingPolygonCollection.destroy",mst),ue(this)};var Bc=pl;var nw={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};nw.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?nw.SUNLIGHT:nw.SCENE_LIGHT:nw.NONE};Object.freeze(nw);var o_=nw;function Kxe(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(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=o_.NONE}Kxe.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var WT=Kxe;var xm=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; uniform float u_atmosphereMieScaleHeight; @@ -3596,7 +4686,7 @@ vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; return vec4(color, opacity); } -`;var B1=`uniform samplerCube u_radianceMap; +`;var hF=`uniform samplerCube u_radianceMap; in vec2 v_textureCoordinates; const float twoSqrtPi = 2.0 * sqrt(czm_pi); float computeShBasis(int index, vec3 s) { @@ -3671,7 +4761,7 @@ vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); out_FragColor += Ylm * color * solidAngle * sinTheta; } } -`;var k1=`precision highp float; +`;var mF=`precision highp float; in vec2 v_textureCoordinates; uniform vec3 u_faceDirection; uniform vec3 u_positionWC; @@ -3750,7 +4840,7 @@ color.rgb = pow(color.rgb, vec3(gamma)); color.rgb = czm_gammaCorrect(color.rgb); out_FragColor = color; } -`;var U1=`precision highp float; +`;var pF=`precision highp float; in vec3 v_textureCoordinates; uniform float u_roughness; uniform samplerCube u_radianceTexture; @@ -3810,7 +4900,7 @@ weight += NdotL; } out_FragColor = color / weight; } -`;var V1=`in vec3 position; +`;var gF=`in vec3 position; out vec3 v_textureCoordinates; uniform vec3 u_faceDirection; vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { @@ -3830,7 +4920,7 @@ v_textureCoordinates.y = -v_textureCoordinates.y; v_textureCoordinates.z = -v_textureCoordinates.z; gl_Position = vec4(position, 1.0); } -`;function Qn(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=e??W.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(ut.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=Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let n=Math.pow(2,t-1);this._textureDimensions=new H(n,n),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??60*60,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Qn.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Qn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.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}}});Qn._maximumComputeCommandCount=8;Qn._activeComputeCommandCount=0;Qn._nextFrameCommandQueue=[];Qn._queueCommand=(e,t)=>{if(Qn._activeComputeCommandCount>=Qn._maximumComputeCommandCount){Qn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Qn._activeComputeCommandCount++};Qn._updateCommandQueue=e=>{if(Qn._maximumComputeCommandCount=Math.log2(ut.maximumCubeMapSize),Qn._nextFrameCommandQueue.length>0&&Qn._activeComputeCommandCount<Qn._maximumComputeCommandCount){let t=Qn._nextFrameCommandQueue.shift();for(;c(t)&&Qn._activeComputeCommandCount<Qn._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Qn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Qn._activeComputeCommandCount++,t=Qn._nextFrameCommandQueue.shift()}c(t)&&Qn._nextFrameCommandQueue.push(t)}};Qn.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new E("DynamicEnvironmentMapManager should only be assigned to one object");e._owner=t,t[n]=e}};Qn.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)c(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)c(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;c(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var N4e=new d,F4e=new d;function B4e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,F4e),s=1.025,a=N4e,l=c(r)?d.magnitude(r):o.maximumRadius;return a.x=l*s,a.y=l,a.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var dae=new d,k4e=new B,U4e=new se,V4e=new G;function z4e(e,t){let n=t.context,i=e._textureDimensions;if(c(e._radianceCubeMap)||(e._radianceCubeMap=new Go({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;c(o)||(o=new He({sources:[nh,k1]}),e._radianceMapFS=o),Ex.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(r,a,k4e),u=U4e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of Go.faceNames()){let p=e._radianceMapTextures[f];c(p)&&!p.isDestroyed()&&p.destroy(),p=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new Uc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>l,u_faceDirection:()=>Go.getDirection(h,dae),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,V4e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Qn._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let b=new Ur({context:n,colorTextures:[e._radianceMapTextures[g]]});b._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),b._unBind(),b.destroy(),Qn._activeComputeCommandCount--,y.some(c)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Qn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function H4e(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,l=0,u=(h,p,g,m,y)=>()=>{if(e.isDestroyed()||h.canceled){Qn._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,g,m,y),l++,Qn._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let x=e._specularMapTextures.length;l>=x&&(e._irradianceCommandDirty=!0,n.sampler=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let h=1;h<i;++h){for(let p of Go.faceNames()){c(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let g=e._specularMapTextures[f]=new Rt({context:a,width:r,height:s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),m=e._va;c(m)||(m=Go.createVertexArray(a,p),e._va=m);let y=e._convolveSP;c(y)||(y=Jt.fromCache({context:a,vertexShaderSource:V1,fragmentShaderSource:U1,attributeLocations:{positions:0}}),e._convolveSP=y);let b=new Uc({shaderProgram:y,vertexArray:m,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Go.getDirection(p,dae)}});b.postExecute=u(b,f,g,p,h),e._convolutionComputeCommands[f]=b,Qn._queueCommand(b,t),++f}r/=2,s/=2}}var hae=new H(3,3);function G4e(e,t){let n=t.context,i=hae,o=e._irradianceMapTexture;c(o)&&!o.isDestroyed()&&o.destroy(),o=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;c(r)||(r=new He({sources:[B1]}),e._irradianceMapFS=r);let s=new Uc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Qn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Qn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Qn._queueCommand(s,t),e._irradianceTextureDirty=!0}function j4e(e,t){let n=t.context;if(!c(e._irradianceMapTexture))return;let i=new Ur({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=hae,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]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Qn.prototype.update=function(e){let t=e.mode;if(!Qn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!c(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}Qn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=B4e(this,e)||i===a_.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&&(z4e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(H4e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(G4e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){j4e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Qn.prototype.isDestroyed=function(){return!1};Qn.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(),c(this._va)&&this._va.destroy(),c(this._convolveSP)&&this._convolveSP.destroy(),de(this)};Qn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Qn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(G.fromCssColorString("#717145"));Qn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var c_=Qn;var z1={HIGHLIGHT:0,REPLACE:1,MIX:2};z1.getColorBlend=function(e,t){if(e===z1.HIGHLIGHT)return 0;if(e===z1.REPLACE)return 1;if(e===z1.MIX)return O.clamp(t,O.EPSILON4,1)};var bc=Object.freeze(z1);var W4e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},xc=Object.freeze(W4e);var q4e={STEP:0,LINEAR:1,CUBICSPLINE:2},ih=Object.freeze(q4e);var mae={};function H1(e){T.typeOf.number.greaterThan("options.count",e.count,0),T.typeOf.object("options.properties",e.properties),this._count=e.count,this._properties=je(e.properties,!0)}H1.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,mae)};H1.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,mae,e)};H1.prototype.getProperty=function(e,t){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new E(`index must be in the range [0, ${this._count})`);let n=this._properties[t];if(c(n))return je(n[e],!0)};H1.prototype.setProperty=function(e,t,n){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new E(`index must be in the range [0, ${this._count})`);let i=this._properties[t];c(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=je(n,!0)};var l_=H1;function Tc(e){e=e??W.EMPTY_OBJECT,T.typeOf.number("options.count",e.count),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(Tc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(c(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 c(this._metadataTable)&&(e+=this._metadataTable.byteLength),c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});Tc.prototype.hasProperty=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("propertyId",t),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(t)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Tc.prototype.hasPropertyBySemantic=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("semantic",t),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Tc.prototype.propertyExists=function(e){return T.typeOf.string("propertyId",e),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(e)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Tc.prototype.propertyExistsBySemantic=function(e){return T.typeOf.string("semantic",e),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var V9=[];Tc.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,c(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(V9)),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,V9)),c(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(V9)),t};Tc.prototype.getProperty=function(e,t){let n;if(c(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),c(n))||c(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),c(n))||c(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),c(n)))return n};Tc.prototype.setProperty=function(e,t,n){c(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(c(this._jsonMetadataTable)||(this._jsonMetadataTable=new l_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Tc.prototype.getPropertyBySemantic=function(e,t){if(c(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Tc.prototype.setPropertyBySemantic=function(e,t,n){return c(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Tc.prototype.getPropertyTypedArray=function(e){if(T.typeOf.string("propertyId",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Tc.prototype.getPropertyTypedArrayBySemantic=function(e){if(T.typeOf.string("semantic",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};function z9(e,t){if(!c(e)||e<0||e>=t)throw new E(`featureId is required and must be between zero and featuresLength - 1 (${t}`-+").")}Tc.prototype.isClass=function(e,t){z9(e,this.count),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};Tc.prototype.isExactClass=function(e,t){return z9(e,this.count),T.typeOf.string("className",t),this.getExactClassName(e)===t};Tc.prototype.getExactClassName=function(e){z9(e,this.count);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};var nl=Tc;function G1(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),T.typeOf.object("options.textures",i);let o=c(t.channels)?t.channels:[0],r=t,s=Vl.createModelTextureReader({textureInfo:r,channels:K4e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,l=t.scale,u=n.hasValueTransform||c(a)||c(l);a=a??n.offset,l=l??n.scale,a=n.unpackVectorAndMatrixTypes(a),l=n.unpackVectorAndMatrixTypes(l),this._offset=a,this._scale=l,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(G1.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}}});G1.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(dt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(dt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==at.SCALAR?(dt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Nt.UINT8?(dt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:at.isVectorType(t)||t===at.SCALAR?n!==Nt.UINT8?(dt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(dt(`Property texture property ${e.id} has an unsupported type`),!1)};var Y4e=[void 0,"float","vec2","vec3","vec4"],X4e=[void 0,"int","ivec2","ivec3","ivec4"];G1.prototype.getGlslType=function(){let e=this._classProperty,t=at.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?Y4e[t]:X4e[t]};G1.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function K4e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var j1=G1;function H9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures;T.typeOf.object("options.propertyTexture",t),T.typeOf.object("options.class",n),T.typeOf.object("options.textures",i);let o=t.extensions,r=t.extras,s={};if(c(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new j1({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(H9.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}}});H9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var u_=H9;function pae(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),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||c(i)||c(o);i=i??n.offset,o=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(pae.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 W1=pae;function G9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class;T.typeOf.object("options.propertyAttribute",t),T.typeOf.object("options.class",n);let i={};if(c(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new W1({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(G9.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}}});G9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var Sx=G9;function q1(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=c(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(q1.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(!c(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}}});q1.prototype.getPropertyTable=function(e){return T.typeOf.number("propertyTableId",e),this._propertyTables[e]};q1.prototype.getPropertyTexture=function(e){return T.typeOf.number("propertyTextureId",e),this._propertyTextures[e]};q1.prototype.getPropertyAttribute=function(e){return T.typeOf.number("propertyAttributeId",e),this._propertyAttributes[e]};var Ys=q1;function $4e(e){e=e??W.EMPTY_OBJECT;let t=e.extension,n=e.schema;T.typeOf.object("options.extension",t),T.typeOf.object("options.schema",n);let i=[];if(c(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],l=n.classes[a.class],u=new Nf({count:a.count,properties:a.properties,class:l,bufferViews:e.bufferViews});i.push(new nl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(c(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new u_({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(c(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new Sx({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ys({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var Y1=$4e;function Z4e(e){e=e??W.EMPTY_OBJECT;let t=e.extension,n=e.schema;T.typeOf.object("options.extension",t),T.typeOf.object("options.schema",n);let i,o=[],r;if(c(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTables[a],u=n.classes[l.class],f=new Nf({count:l.count,properties:l.properties,class:u,bufferViews:e.bufferViews});o.push(new nl({id:a,count:l.count,metadataTable:f,extras:l.extras,extensions:l.extensions}))}let s=[];if(c(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTextures[a];s.push(new u_({id:a,propertyTexture:Q4e(l),class:n.classes[l.class],textures:e.textures}))}return new Ys({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Q4e(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:J4e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=xt(o.texture,r,!0)}return t}function J4e(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 X1=Z4e;function Sy(e){e=e??W.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:l,asynchronous:u=!0}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),T.typeOf.object("options.supportedImageFormats",s),T.typeOf.object("options.frameState",a),!c(e.extension)&&!c(e.extensionLegacy))throw new E("One of options.extension or options.extensionLegacy must be specified");this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=l,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Sy.prototype=Object.create($i.prototype),Sy.prototype.constructor=Sy);Object.defineProperties(Sy.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function e8e(e){try{let t=r8e(e),n=u8e(e),i=f8e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}Sy.prototype.load=function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=e8e(this),this._promise)};function t8e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function n8e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function i8e(e){let t=e.propertyTables,n={};if(c(t))for(let i=0;i<t.length;i++){let o=t[i];t8e(o.properties,n)}return n}function o8e(e){let t=e.featureTables,n={};if(c(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;c(r)&&n8e(r,n)}}return n}async function r8e(e){let t;c(e._extension)?t=i8e(e._extension):t=o8e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=vi.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 s8e(e){let t={},n=e.propertyTextures;if(c(n))for(let i=0;i<n.length;i++){let r=n[i].properties;c(r)&&a8e(r,t)}return t}function a8e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function c8e(e){let t={},n=e.featureTextures;if(c(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;c(r)&&l8e(r,t)}}return t}function l8e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function u8e(e){let t;c(e._extension)?t=s8e(e._extension):t=c8e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,l=[];for(let u in t)if(t.hasOwnProperty(u)){let f=vi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),l.push(f.load())}return Promise.all(l)}async function f8e(e){let t=e._extension??e._extensionLegacy,n;if(c(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=vi.getSchemaLoader({resource:i})}else n=vi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Sy.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let l=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[l]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let l=this._textureIds[a],u=t[a];u.isDestroyed()||(s[l]=u.texture)}return c(this._extension)?this._structuralMetadata=Y1({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=X1({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),_ae(this),this._state=gt.READY,!0};function _ae(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)vi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function d8e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)vi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Sy.prototype.unload=function(){_ae(this),d8e(this),c(this._schemaLoader)&&vi.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var K1=Sy;var tE={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};tE.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return tE.TRANSLATION;case"ROTATION":return tE.ROTATION;case"SCALE":return tE.SCALE;case"_FEATURE_ID":return tE.FEATURE_ID}};var rs=Object.freeze(tE);var h8e=65534,m8e=255;function bz(e){e=e??W.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;T.typeOf.object("options.triangleIndices",t),T.typeOf.object("options.outlineIndices",n),T.typeOf.number("options.originalVertexCount",i),this._triangleIndices=t,this._originalVertexCount=i,this._edges=new bae(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],p8e(this)}Object.defineProperties(bz.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function p8e(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 l=t[a],u=t[a+1],f=t[a+2],h=!1,p=h||n.hasEdge(l,u),g=h||n.hasEdge(u,f),m=h||n.hasEdge(f,l),y=gae(i,l,u,f,p,g,m);for(;c(y);){let b=s[y];if(!c(b)){b=r+o.length;let x=y;for(;x>=r;)x=o[x-r];o.push(x),s[y]=b}b>h8e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>m8e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===l?(l=b,t[a]=b):y===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),y=gae(i,l,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function gae(e,t,n,i,o,r,s){let a=s?1:0,l=o?1:0,u=0,f=j9(e,t,a,l,u);if(f===0)return t;let h=0,p=o?1:0,g=r?1:0,m=j9(e,n,h,p,g);if(m===0)return n;let y=s?1:0,b=0,x=r?1:0,A=j9(e,i,y,b,x);if(A===0)return i;let C=f&m&A,S,v,P;if(C&1)S=0,v=1,P=2;else if(C&2)S=0,P=1,v=2;else if(C&4)v=0,S=1,P=2;else if(C&8)v=0,P=1,S=2;else if(C&16)P=0,S=1,v=2;else if(C&32)P=0,v=1,S=2;else{let F=W9(f),_=W9(m),w=W9(A);return F<_&&F<w?t:_<w?n:i}let M=t*3;e[M+S]=a,e[M+v]=l,e[M+P]=u;let R=n*3;e[R+S]=h,e[R+v]=p,e[R+P]=g;let L=i*3;e[L+S]=y,e[L+v]=b,e[L+P]=x}function j9(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],l=e[r+2];return c(s)?(s===n&&a===i&&l===o)<<0|(s===n&&a===o&&l===i)<<1|(s===i&&a===n&&l===o)<<2|(s===i&&a===o&&l===n)<<3|(s===o&&a===n&&l===i)<<4|(s===o&&a===i&&l===n)<<5:63}function W9(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}bz.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 l=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[l+f]}return s};bz.createTexture=function(e){let t=e.cache.modelOutliningCache;if(c(t)||(t=e.cache.modelOutliningCache={}),c(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,ut.maximumTextureSize),i=n,o=yae(i),r=[];for(;i>1;)i>>=1,r.push(yae(i));let s=new Rt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ke.LUMINANCE,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR_MIPMAP_LINEAR,magnificationFilter:li.LINEAR})});return t.outlineTexture=s,s};function yae(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 bae(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)}}bae.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 wx=bz;function xae(e){T.typeOf.object("attribute",e),this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function _8e(e){T.typeOf.object("indices",e),this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function xz(e){T.typeOf.object("primitive",e),this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}xz.prototype.postProcess=function(e){this.needsOutlines&&(g8e(this),b8e(this,e))};function g8e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new wx({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Fe.fromTypedArray(n.typedArray);let r=y8e(o.outlineCoordinates),s=new xae(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,l=e.attributePlans.length;for(let u=0;u<l;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function y8e(e){let t=new Tn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=$.FLOAT,t.type=nn.VEC3,t.normalized=!1,t.count=e.length/3,t}function b8e(e,t){x8e(e.attributePlans,t),c(e.indicesPlan)&&T8e(e.indicesPlan,t)}function x8e(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=yt.createVertexBuffer({typedArray:s,context:t,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function T8e(e,t){let n=e.indices;if(e.loadBuffer){let i=yt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Be.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}xz.AttributeLoadPlan=xae;xz.IndicesLoadPlan=_8e;var vx=xz;function A8e(e){e=e??W.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var $1=A8e;function Tae(e){T.typeOf.object("options.position",e.position),T.typeOf.object("options.adjustmentParams",e.adjustmentParams),this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Tae.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var Z1=Tae;function Aae(e){T.typeOf.object("options.position",e.position),T.typeOf.object("options.adjustmentParams",e.adjustmentParams),T.typeOf.object("options.covarianceMatrix",e.covarianceMatrix),this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Aae.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var Q1=Aae;function Cae(e){T.typeOf.object("options.groupFlags",e.groupFlags),T.typeOf.object("options.rotationThetas",e.rotationThetas),T.typeOf.object("options.params",e.params),this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Cae.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var J1=Cae;var C8e={Direct:"Direct",Indirect:"Indirect"},wm=Object.freeze(C8e);function Eae(e){if(T.typeOf.string("options.storageType",e.storageType),this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect,this.storageType===wm.Indirect){if(!c(this.anchorPointsIndirect))throw new ae("The anchorPointsIndirect are required for 'Indirect' storage");if(!c(this.intraTileCorrelationGroups))throw new ae("The intraTileCorrelationGroups are required for 'Indirect' storage");if(c(this.anchorPointsDirect))throw new ae("The anchorPointsDirect must be omitted for 'Indirect' storage");if(c(this.covarianceDirect))throw new ae("The covarianceDirect must be omitted for 'Indirect' storage")}else{if(!c(this.anchorPointsDirect))throw new ae("The anchorPointsDirect are required for 'Direct' storage");if(!c(this.covarianceDirect))throw new ae("The covarianceDirect is required for 'Direct' storage");if(c(this.anchorPointsIndirect))throw new ae("The anchorPointsIndirect must be omitted for 'Direct' storage");if(c(this.intraTileCorrelationGroups))throw new ae("The intraTileCorrelationGroups must be omitted for 'Direct' storage")}}Object.defineProperties(Eae.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 nE=Eae;function Sae(e){T.typeOf.number.greaterThan("options.A",e.A,0),T.typeOf.number.lessThanOrEquals("options.A",e.A,1),T.typeOf.number.greaterThanOrEquals("options.alpha",e.alpha,0),T.typeOf.number.lessThan("options.alpha",e.alpha,1),T.typeOf.number.greaterThanOrEquals("options.beta",e.beta,0),T.typeOf.number.lessThanOrEquals("options.beta",e.beta,10),T.typeOf.number.greaterThan("options.T",e.T,0),this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Sae.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 eR=Sae;function iE(){}function wae(e){return new J(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function E8e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new Z1({position:t,adjustmentParams:n})}function S8e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=wae(e.covarianceMatrix);return new Q1({position:t,adjustmentParams:n,covarianceMatrix:i})}function w8e(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let s=new eR({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new J1({groupFlags:t,rotationThetas:n,params:i})}iE.load=function(e){T.typeOf.object("gltfGpmLocalJson",e);let t=e.storageType;if(t===wm.Direct)return iE.loadDirect(e);if(t===wm.Indirect)return iE.loadIndirect(e);throw new ae(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};iE.loadDirect=function(e){T.typeOf.object("gltfGpmLocalJson",e),T.typeOf.object("gltfGpmLocalJson.anchorPointsDirect",e.anchorPointsDirect),T.typeOf.object("gltfGpmLocalJson.covarianceDirectUpperTriangle",e.covarianceDirectUpperTriangle);let t=[],n=e.anchorPointsDirect;for(let r of n){let s=E8e(r);t.push(s)}let i=wae(e.covarianceDirectUpperTriangle);return new nE({storageType:wm.Direct,anchorPointsDirect:t,covarianceDirect:i})};iE.loadIndirect=function(e){T.typeOf.object("gltfGpmLocalJson",e),T.typeOf.object("gltfGpmLocalJson.anchorPointsIndirect",e.anchorPointsIndirect),T.typeOf.object("gltfGpmLocalJson.intraTileCorrelationGroups",e.intraTileCorrelationGroups);let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=S8e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=w8e(s);o.push(a)}return new nE({storageType:wm.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var tR=iE;function vae(e){T.typeOf.object("options.traits",e.traits),T.typeOf.number.greaterThanOrEquals("options.index",e.index,0),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(vae.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 nR=vae;function Dae(e){T.typeOf.string("options.source",e.source),this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Dae.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var iR=Dae;function Pae(e){this._ppeTextures=e}Object.defineProperties(Pae.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var oR=Pae;function Or(e){e=e??W.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,l=e.asynchronous??!0;T.typeOf.object("options.gltf",t),T.typeOf.object("options.extension",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s),this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=l,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Or.prototype=Object.create($i.prototype),Or.prototype.constructor=Or);Object.defineProperties(Or.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Or.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};Or.prototype.load=function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function v8e(e){let t={},n=e.ppeTextures;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}Or.prototype._loadTextures=function(){let e;c(this._extension)&&(e=v8e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let l in e)if(e.hasOwnProperty(l)){let u=vi.getTextureLoader({gltf:t,textureInfo:e[l],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(l),a.push(u.load())}return Promise.all(a)};Or.ppeTexturesMetadataSchemaCache=new Map;Or._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}}}};Or._obtainPpeTexturesMetadataSchema=function(e){let n=Or._collectPpeTexturePropertyIdentifiers(e).toString(),i=Or.ppeTexturesMetadataSchemaCache.get(n);if(c(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Or.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let l=s[a],u=`ppeTexture_${a}`,f=Or._createPpeTextureClassJson(l,a);r.classes[u]=f}return i=vu.fromJson(r),Or.ppeTexturesMetadataSchemaCache.set(n,i),i};Or._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Or._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Or._convertToStructuralMetadata=function(e,t){let n=[],i=Or._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],l=`ppeTexture_${s}`,f=a.traits.source,h=i.classes[l],p={class:l,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new u_({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new Ys({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Or.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],s=this._extension;if(c(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let h=f.traits,p=new iR({min:h.min,max:h.max,source:h.source}),g=new nR({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let a=new oR(r);this._meshPrimitiveGpmLocal=a;let l=Or._convertToStructuralMetadata(a,o);return this._structuralMetadata=l,this._state=gt.READY,!0};Or.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)vi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Or.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var rR=Or;var{Attribute:D8e,Indices:P8e,FeatureIdAttribute:Iae,FeatureIdTexture:Oae,FeatureIdImplicitRange:Rae,MorphTarget:I8e,Primitive:O8e,Instances:R8e,Skin:M8e,Node:L8e,AnimatedPropertyType:N8e,AnimationSampler:F8e,AnimationTarget:B8e,AnimationChannel:k8e,Animation:U8e,ArticulationStage:V8e,Articulation:z8e,Asset:H8e,Scene:G8e,Components:j8e,MetallicRoughness:W8e,SpecularGlossiness:q8e,Specular:Y8e,Anisotropy:q9,Clearcoat:Y9,Material:X8e}=Tn,Bo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function oh(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Fo.Y,forwardAxis:a=Fo.Z,loadAttributesAsTypedArray:l=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:m=!1}=e;T.typeOf.object("options.gltfResource",t);let{baseResource:y=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=y,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Bo.NOT_LOADED,this._textureState=Bo.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}c(Object.create)&&(oh.prototype=Object.create($i.prototype),oh.prototype.constructor=oh);Object.defineProperties(oh.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return c(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function K8e(e){e._state=Bo.LOADING,e._textureState=Bo.LOADING;try{let t=vi.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=Bo.LOADED,e._textureState=Bo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Bo.FAILED,e._textureState=Bo.FAILED,Tz(e,t)}}async function $8e(e,t){Vt.supportsWebP.initialized||await Vt.supportsWebP.initialize(),e._supportedImageFormats=new $1({webp:Vt.supportsWebP(),basis:t.context.supportsBasis});let n=JHe(e,t);return e._state=Bo.PROCESSING,e._textureState=Bo.PROCESSING,c(e._gltfJsonLoader)&&e._releaseGltfJson&&(vi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}oh.prototype.load=async function(){return c(this._promise)?this._promise:(this._promise=K8e(this),this._promise)};function Tz(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function Z8e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&c(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(c(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(c(r)){let s=r.process(t);s&&(c(e._components.structuralMetadata)&&dt("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=Bo.POST_PROCESSING)}function Q8e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&J8e(e,o)}}function J8e(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;c(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let l=r[a];c(l.buffer)&&n.push(l.buffer)}let s=i.indices;c(s)&&c(s.buffer)&&n.push(s.buffer)}oh.prototype._process=function(e){return this._state===Bo.READY?!0:(this._state===Bo.PROCESSING&&Z8e(this,e),this._resourcesLoaded&&this._state===Bo.POST_PROCESSING&&(Q8e(this,e.context),this._state=Bo.PROCESSED),this._resourcesLoaded&&this._state===Bo.PROCESSED?(zae(this),this._typedArray=void 0,this._state=Bo.READY,!0):!1)};oh.prototype._processTextures=function(e){if(this._textureState===Bo.READY)return!0;if(this._textureState!==Bo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&c(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Bo.READY,this._texturesLoaded=!0,!0):!1};oh.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===Bo.LOADED&&!c(this._loadResourcesPromise)&&(this._loadResourcesPromise=$8e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),c(this._processError)){this._state=Bo.FAILED;let o=this._processError;this._processError=void 0,Tz(this,o)}let t=this._textureErrors.pop();if(c(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Bo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Bo.FAILED,Tz(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Bo.FAILED,Tz(this,o)}return this._incrementallyLoadTextures?n:n&&i};function eHe(e,t,n,i,o,r,s,a){let l=e.gltfJson,f=l.accessors[t].bufferView;return vi.getVertexBufferLoader({gltf:l,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:f,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function tHe(e,t,n,i,o,r,s){return vi.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 nHe(e,t){let n=vi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Mae(e,t,n){let i=t.byteOffset,o=Ul(e,t),r=t.count,s=wu(t.type),a=t.componentType,l=$.getSizeInBytes(a),u=l*s,f=r*s;if(o===u)return n=new Uint8Array(n),$.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=$.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=o_(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){m(p,i,s,l,g);for(let b=0;b<s;++b)h[y*s+b]=g[b];i+=o}return h}function iHe(e,t){let n=e.type;if(n===nn.SCALAR)return t.fill(0);let i=nn.getMathType(n);return t.fill(i.clone(i.ZERO))}function oHe(e,t,n,i){let o=e.type,r=e.count;if(o===nn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===nn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Le.unpack(t,s*4);else{let s=nn.getMathType(o),a=nn.getNumberOfComponents(o);for(let l=0;l<r;l++)n[l]=s.unpack(t,l*a)}return n}async function rHe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Mae(r,n,t.typedArray);i=i??!1,oHe(n,s,o,i)}function Az(e,t,n){let i=new Array(t.count),o=t.bufferView;if(c(o)){let r=nHe(e,o),s=rHe(e,r,t,n,i);return e._loaderPromises.push(s),i}return iHe(t,i)}function Du(e,t){if(c(t))return e===Number?t[0]:e.unpack(t)}function sHe(e){return e===Number?0:new e}function aHe(e){switch(e){case $.BYTE:return 127;case $.UNSIGNED_BYTE:return 255;case $.SHORT:return 32767;case $.UNSIGNED_SHORT:return 65535;default:return 1}}var cHe={VEC2:new H(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function lHe(e,t){let n=aHe(e.componentDatatype),i=cHe[e.type],o=e.min;c(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;c(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function uHe(e,t,n){let i=e.decodeMatrix,o=Du(n,e.decodedMin),r=Du(n,e.decodedMax);c(o)&&c(r)&&(t.min=o,t.max=r);let s=new Tn.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 H(i[6],i[7]),s.quantizedVolumeStepSize=new H(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new d(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new d(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=nn.getMathType(r.type),a=r.normalized??!1,l=new D8e;l.name=n,l.semantic=i,l.setIndex=o,l.constant=sHe(s),l.componentDatatype=r.componentType,l.normalized=a,l.count=r.count,l.type=r.type,l.min=Du(s,r.min),l.max=Du(s,r.max),l.byteOffset=r.byteOffset,l.byteStride=Ul(e,r),oi(r,"WEB3D_quantized_attributes")&&uHe(r.extensions.WEB3D_quantized_attributes,l,s);let u=l.semantic===ht.POSITION||l.semantic===ht.NORMAL||l.semantic===ht.TANGENT||l.semantic===ht.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&lHe(l,s),l}function Lae(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var dHe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function X9(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=dHe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function hHe(e){let t=e===ht.POSITION,n=e===ht.FEATURE_ID,i=e===ht.TEXCOORD;return t||n||i}function mHe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=c(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=$.createArrayBufferView(o,t.typedArray.buffer)}}function pHe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Mae(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Nae(e,t,n,i,o,r,s,a){let l=e.gltfJson,u=l.accessors[t],f=u.bufferView,h=n.gltfSemantic,p=n.renamedSemantic,g=n.modelSemantic,m=c(g)?Lae(p):void 0,b=fHe(l,t,h,g,m);if(!c(o)&&!c(f))return b;let x=eHe(e,t,h,i,o,r,s,a),A=e._geometryLoaders.length;e._geometryLoaders.push(x);let C=x.load();return e._loaderPromises.push(C),e._geometryCallbacks[A]=()=>{c(o)&&c(o.attributes)&&c(o.attributes[h])?mHe(b,x,r,s):pHe(l,u,b,x,r,s)},b}function Fae(e,t,n,i,o,r,s,a){let l=n.modelSemantic,u=l===ht.POSITION,f=l===ht.FEATURE_ID,h=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=u&&e._enablePick&&!a.context.webgl2,g=e._loadForClassification&&f,m=e._loadAttributesAsTypedArray,y=!m,b=m||h||p||g,C=Nae(e,t,n,i,o,s?!1:y,s?!0:b,a),S=new vx.AttributeLoadPlan(C);return S.loadBuffer=y,S.loadTypedArray=b,S}function _He(e,t,n,i,o){let r=e.gltfJson.accessors,s=c(n.ROTATION),a=c(n.TRANSLATION)&&c(r[n.TRANSLATION].min)&&c(r[n.TRANSLATION].max),l=X9(e,rs,i),u=l.modelSemantic,f=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,h=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Nae(e,t,l,void 0,void 0,m,p||h&&(!a||y||g),o)}function gHe(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],l=a.bufferView;if(!c(i)&&!c(l))return;let u=new P8e;u.count=a.count;let f=e._loadAttributesAsTypedArray,h=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,m=!f,y=f||h||p,A=tHe(e,t,n,i,r?!1:m,r?!0:y,s),C=e._geometryLoaders.length;e._geometryLoaders.push(A);let S=A.load();e._loaderPromises.push(S),e._geometryCallbacks[C]=()=>{u.indexDatatype=A.indexDatatype,u.buffer=A.buffer,u.typedArray=A.typedArray};let v=new vx.IndicesLoadPlan(u);return v.loadBuffer=m,v.loadTypedArray=y,v}function il(e,t,n,i){let o=e.gltfJson,r=Vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!c(r))return;let s=vi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Vl.createModelTextureReader({textureInfo:t}),l=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Bo.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[l]=()=>{a.texture=s.texture,c(i)&&(a.texture.sampler=i)},a}function yHe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,l=new q8e;return c(i)&&(l.diffuseTexture=il(e,i,n)),c(o)&&(l.specularGlossinessTexture=il(e,o,n)),l.diffuseFactor=Du(se,r),l.specularFactor=Du(d,s),l.glossinessFactor=a,l}function bHe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,l=new W8e;return c(i)&&(l.baseColorTexture=il(e,i,n)),c(o)&&(l.metallicRoughnessTexture=il(e,o,n)),l.baseColorFactor=Du(se,r),l.metallicFactor=s,l.roughnessFactor=a,l}function xHe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Y8e;return c(o)&&(a.specularTexture=il(e,o,n)),c(s)&&(a.specularColorTexture=il(e,s,n)),a.specularFactor=i,a.specularColorFactor=Du(d,r),a}function THe(e,t,n){let{anisotropyStrength:i=q9.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=q9.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new q9;return c(r)&&(s.anisotropyTexture=il(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function AHe(e,t,n){let{clearcoatFactor:i=Y9.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Y9.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,l=new Y9;return c(o)&&(l.clearcoatTexture=il(e,o,n)),c(s)&&(l.clearcoatRoughnessTexture=il(e,s,n)),c(a)&&(l.clearcoatNormalTexture=il(e,a,n)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function CHe(e,t,n){let i=new X8e,o=t.extensions??W.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=c(o.KHR_materials_unlit),c(r)?i.specularGlossiness=yHe(e,r,n):(c(u)&&(i.metallicRoughness=bHe(e,u,n)),c(s)&&!i.unlit&&(i.specular=xHe(e,s,n)),c(a)&&!i.unlit&&(i.anisotropy=THe(e,a,n)),c(l)&&!i.unlit&&(i.clearcoat=AHe(e,l,n))),c(t.emissiveTexture)&&(i.emissiveTexture=il(e,t.emissiveTexture,n)),c(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=il(e,t.normalTexture,n)),c(t.occlusionTexture)&&(i.occlusionTexture=il(e,t.occlusionTexture,n)),i.emissiveFactor=Du(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Bae(e,t){let n=new Iae;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 kae(e,t,n,i){let o=new Iae,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Lae(r.attribute),o.positionalLabel=i,o}function Uae(e,t){let n=new Rae;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 Vae(e,t,n,i){let o=new Rae,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function EHe(e,t,n,i){let o=new Oae;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=il(e,r,n,Qt.NEAREST);let a=(c(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function SHe(e,t,n,i,o,r){let s=new Oae,a=t.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=il(e,l,i,Qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function wHe(e,t,n,i,o){let r=new I8e,s=void 0,a=void 0,l=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let f=t[u],h=X9(e,ht,u),p=Fae(e,f,h,s,a,l,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function vHe(e,t,n,i){let o=new O8e,r=new vx(o);e._primitiveLoadPlans.push(r);let s=t.material;c(s)&&(o.material=CHe(e,e.gltfJson.materials[s],i));let a=t.extensions??W.EMPTY_OBJECT,l=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&c(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=DHe(e,u,r));let f=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(c(g))for(let v in g){if(!g.hasOwnProperty(v))continue;let P=g[v],M=X9(e,ht,v),R=M.modelSemantic;if(f&&!hHe(R))continue;R===ht.FEATURE_ID&&(p=!0);let L=Fae(e,P,M,t,h,n,l,i);r.attributePlans.push(L),o.attributes.push(L.attribute)}let m=t.targets;if(c(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(wHe(e,m[v],l,r,i));let y=t.indices;if(c(y)){let v=gHe(e,y,t,h,p,l,i);c(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,x=a.EXT_mesh_features,A=a.EXT_feature_metadata,C=c(A);c(x)?PHe(e,o,x,i):C&&IHe(e,o,A,i),c(b)?OHe(o,b):C&&RHe(e,o,A);let S=t.mode;if(f&&S!==Me.TRIANGLES)throw new ae("Only triangle meshes can be used for classification.");return o.primitiveType=S,o}function DHe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return Az(e,i,!1)}function PHe(e,t,n,i){let o;c(n)&&c(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,l;c(s.texture)?l=EHe(e,s,i,a):c(s.attribute)?l=Bae(s,a):l=Uae(s,a),t.featureIds.push(l)}}function IHe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(c(s))for(let l=0;l<s.length;++l){let u=s[l],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m;c(u.featureIds.attribute)?m=kae(u,h,p,g):m=Vae(u,h,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(c(a))for(let l=0;l<a.length;++l){let u=a[l],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m=SHe(e,u,h,i,p,g);t.featureIds.push(m)}}function OHe(e,t){if(!c(t))return;let{propertyTextures:n,propertyAttributes:i}=t;c(n)&&(e.propertyTextureIds=n),c(i)&&(e.propertyAttributeIds=i)}function RHe(e,t,n){c(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function MHe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new R8e,r=i.attributes;if(c(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(_He(e,f,r,u,n))}let s=i.extensions??W.EMPTY_OBJECT,a=t.EXT_instance_features,l=s.EXT_feature_metadata;return c(a)?LHe(o,a):c(l)&&NHe(e.gltfJson,o,l,e._sortedPropertyTableIds),o}function LHe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;c(o.attribute)?s=Bae(o,r):s=Uae(o,r),e.featureIds.push(s)}}function NHe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(c(r))for(let s=0;s<r.length;++s){let a=r[s],l=a.featureTable,u=i.indexOf(l),f=o[l].count,h=`instanceFeatureId_${s}`,p;c(a.featureIds.attribute)?p=kae(a,u,f,h):p=Vae(a,u,f,h),t.featureIds.push(p)}}function FHe(e,t,n){let i=new L8e;i.name=t.name,i.matrix=Du(B,t.matrix),i.translation=Du(d,t.translation),i.rotation=Du(Le,t.rotation),i.scale=Du(d,t.scale);let o=t.extensions??W.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(c(r)){if(e._loadForClassification)throw new ae("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=MHe(e,o,n)}c(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(c(a)){let l=e.gltfJson.meshes[a],u=l.primitives;for(let p=0;p<u.length;++p)i.primitives.push(vHe(e,u[p],c(i.instances),n));let f=t.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=c(f)?f.slice():new Array(h.length).fill(0)}return i}function BHe(e,t){let n=e.gltfJson.nodes;if(!c(n))return[];let i=n.map(function(o,r){let s=FHe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(c(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function kHe(e,t,n){let i=new M8e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(c(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=Az(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(B.IDENTITY);return i}function UHe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!c(n))return[];let i=n.map(function(r,s){let a=kHe(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;c(s)&&(t[r].skin=i[s])}return i}async function VHe(e,t,n,i){let o=new K1({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 zHe(e,t,n,i){let o=new rR({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 HHe(e,t){let n=new F8e,i=e.gltfJson.accessors,o=i[t.input];n.input=Az(e,o);let r=t.interpolation;n.interpolation=ih[r]??ih.LINEAR;let s=i[t.output];return n.output=Az(e,s,!0),n}function GHe(e,t){let n=new B8e,i=e.node;if(!c(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=N8e[o],n}function jHe(e,t,n){let i=new k8e,o=e.sampler;return i.sampler=t[o],i.target=GHe(e.target,n),i}function WHe(e,t,n){let i=new U8e;i.name=t.name;let o=t.samplers.map(function(s,a){let l=HHe(e,s);return l.index=a,l}),r=t.channels.map(function(s){return jHe(s,o,n)});return i.samplers=o,i.channels=r,i}function qHe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!c(n)?[]:n.map(function(o,r){let s=WHe(e,o,t);return s.index=r,s})}function YHe(e){let t=new V8e;t.name=e.name;let n=e.type.toUpperCase();return t.type=xc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function XHe(e){let t=new z8e;return t.name=e.name,t.stages=e.stages.map(YHe),t}function KHe(e){let n=(e.extensions??W.EMPTY_OBJECT).AGI_articulations?.articulations;return c(n)?n.map(XHe):[]}function $He(e){let t;return c(e.scenes)&&c(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=c(t)?t:[],t}function ZHe(e,t){let n=new G8e,i=$He(e);return n.nodes=i.map(function(o){return t[o]}),n}var QHe=new d;function JHe(e,t){let n=e.gltfJson,i=n.extensions??W.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(c(r)){let A=r.featureTables,C=r.featureTextures,S=c(A)?A:[],v=c(C)?C:[];e._sortedPropertyTableIds=Object.keys(S).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=BHe(e,t),l=UHe(e,a),u=qHe(e,a),f=KHe(n),h=ZHe(n,a),p=new j8e,g=new H8e,m=n.asset.copyright;if(c(m)){let A=m.split(";").map(function(C){return new Tt(C.trim())});g.credits=A}if(p.asset=g,p.scene=h,p.nodes=a,p.skins=l,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,c(s)){let A=d.fromArray(s.center,0,QHe);p.transform=B.fromTranslation(A,p.transform)}if(e._components=p,c(o)||c(r)){let A=VHe(e,o,r,t);e._loaderPromises.push(A)}let y=i.NGA_gpm_local;if(c(y)){let A=tR.load(y);e._components.extensions.NGA_gpm_local=A}let b=n.meshes;if(c(b))for(let A of b){let C=A.primitives;if(c(C))for(let S of C){let v=S.extensions;if(c(v)){let P=v.NGA_gpm_local;if(c(P)){let M=zHe(e,n,P,t);e._loaderPromises.push(M)}}}}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function eGe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&vi.unload(t[n]);e._textureLoaders.length=0}function zae(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&vi.unload(t[n]);e._bufferViewLoaders.length=0}function tGe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&vi.unload(t[n]);e._geometryLoaders.length=0}function nGe(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 iGe(e){c(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function oGe(e){c(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}oh.prototype.isUnloaded=function(){return this._state===Bo.UNLOADED};oh.prototype.unload=function(){c(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&vi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,eGe(this),zae(this),tGe(this),nGe(this),iGe(this),oGe(this),this._components=void 0,this._typedArray=void 0,this._state=Bo.UNLOADED};var rh=oh;var sR=`uniform sampler2D u_pointCloud_colorGBuffer; +`;function Ci(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=e??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(kt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),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(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ci.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new U(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Ci.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ci.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.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}}});Ci._maximumComputeCommandCount=8;Ci._activeComputeCommandCount=0;Ci._nextFrameCommandQueue=[];Ci._queueCommand=(e,t)=>{if(Ci._activeComputeCommandCount>=Ci._maximumComputeCommandCount){Ci._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ci._activeComputeCommandCount++};Ci._updateCommandQueue=e=>{if(Ci._maximumComputeCommandCount=Math.log2(kt.maximumCubeMapSize),Ci._nextFrameCommandQueue.length>0&&Ci._activeComputeCommandCount<Ci._maximumComputeCommandCount){let t=Ci._nextFrameCommandQueue.shift();for(;l(t)&&Ci._activeComputeCommandCount<Ci._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ci._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ci._activeComputeCommandCount++,t=Ci._nextFrameCommandQueue.shift()}l(t)&&Ci._nextFrameCommandQueue.push(t)}};Ci.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ci.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 _st=new h,yst=new h;function Ast(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,yst),s=1.025,a=_st,c=l(o)?h.magnitude(o):r.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var $xe=new h,bst=new N,xst=new se,Tst=new z;function Est(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ns({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Ye({sources:[xm,mF]}),e._radianceMapFS=r),WT.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(o,a,bst),u=xst;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of ns.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new bf({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ns.getDirection(d,$xe),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Tst)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ci._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new _s({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ci._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ci._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function Cst(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,s=r.y/2,a=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ci._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ci._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of ns.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:a,width:o,height:s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),y=e._va;l(y)||(y=ns.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:gF,fragmentShaderSource:pF,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new bf({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ns.getDirection(g,$xe)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ci._queueCommand(b,t),++d}o/=2,s/=2}u()}var Jxe=new U(3,3);function vst(e,t){let n=t.context,i=Jxe,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Ye({sources:[hF]}),e._irradianceMapFS=o);let s=new bf({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Ci._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ci._activeComputeCommandCount--},e._irradianceComputeCommand=s,Ci._queueCommand(s,t),e._irradianceTextureDirty=!0}function Sst(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new _s({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=Jxe,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(o,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ci.prototype.update=function(e){let t=e.mode;if(!(Ci.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ci._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=Ast(this,e)||i===o_.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Est(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Cst(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(vst(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Sst(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ci.prototype.isDestroyed=function(){return!1};Ci.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(),ue(this)};Ci.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ci.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Ci.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var s_=Ci;var iw={HIGHLIGHT:0,REPLACE:1,MIX:2};iw.getColorBlend=function(e,t){if(e===iw.HIGHLIGHT)return 0;if(e===iw.REPLACE)return 1;if(e===iw.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(iw);var gl=iw;var Zxe={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(Zxe);var Qd=Zxe;var Qxe={};function _F(e){this._count=e.count,this._properties=Je(e.properties,!0)}_F.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,Qxe)};_F.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,Qxe,e)};_F.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Je(n[e],!0)};_F.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Je(n,!0)};var a_=_F;function kc(e){e=e??H.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,this._texture=e.texture}Object.defineProperties(kc.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}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},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}},texture:{get:function(){return this._texture}}});kc.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))};kc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};kc.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))};kc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var GQ=[];kc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(GQ);Zn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,GQ);Zn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(GQ);Zn(t,n)}return t};kc.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};kc.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 a_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};kc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};kc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};kc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};kc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};kc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};kc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};kc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};kc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var au=kc;function eTe(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=Uu.createModelTextureReader({textureInfo:o,channels:wst(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(eTe.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}}});function wst(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var yF=eTe;function WQ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new yF({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=o,this._extensions=r}Object.defineProperties(WQ.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}}});WQ.prototype.getProperty=function(e){return this._properties[e]};var c_=WQ;function tTe(e){e=e??H.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,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(tTe.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 AF=tTe;function qQ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new AF({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(qQ.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}}});qQ.prototype.getProperty=function(e){return this._properties[e]};var qT=qQ;function rw(e){e=e??H.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(rw.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}}});rw.prototype.getPropertyTable=function(e){return this._propertyTables[e]};rw.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};rw.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};rw.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return ue(this)};var Ha=rw;function Ist(e){e=e??H.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],u=Pst(a,e.bufferViews,c,e.context),f=new Ld({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new au({id:s,name:a.name,count:a.count,metadataTable:f,extras:a.extras,extensions:a.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new c_({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new qT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ha({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var bF=4;function Pst(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=Dst(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let a=s.length;if(a===0)return;if(o>kt.maximumTextureSize||a>kt.maximumTextureSize){_t("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${kt.maximumTextureSize}.`);return}let c=Ost(s,o),u=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST});return Dt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:a,arrayBufferView:c}})}function Dst(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(bF))continue;let c=e[s],u=l(c)?t[c.values]:Rst(a,i),f=u.length,d=a.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:a})}return r}function Rst(e,t){let n=e.noData,i=bt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),s=Lt.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Lt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*s,n[d][p])}return new Uint8Array(a)}function Ost(e,t){let n=e.length,i=new Uint8Array(n*t*bF),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let s=e[o],a=s.classProperty,c=o*t*bF,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){Nst(s,r,c);continue}Mst(s,i,c)}return i}function Mst(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let s=0;s<o;s++){let a=s*r,c=n+s*bF;t.set(i.subarray(a,a+r),c)}}function Nst(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Lt.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Lt.getDataViewAccessors(u,o),d=Lt.getDataViewAccessors(t,s),p=Lt.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*bF,A=f.get(m);d.set(y,p(A))}}var xF=Ist;function Lst(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new Ld({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new au({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new c_({id:a,propertyTexture:Fst(c),class:n.classes[c.class],textures:e.textures}))}return new Ha({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Fst(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:Bst(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function Bst(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 TF=Lst;var YQ=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=kst(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);s[u]=d}}let a={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(a[u]=f.texture)}return l(this._extension)?this._structuralMetadata=xF({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=TF({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),nTe(this),this._state=Tt.READY,!0}unload(){nTe(this),$st(this),l(this._schemaLoader)&&Li.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function kst(e){try{let t=Hst(e),n=Xst(e),i=Kst(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Tt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load structural metadata",t)}}function Ust(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function zst(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function Vst(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];Ust(r.properties,n)}return n}function jst(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&zst(o,n)}}return n}async function Hst(e){let t;l(e._extension)?t=Vst(e._extension):t=jst(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Li.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function Gst(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&Wst(o,t)}return t}function Wst(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function qst(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&Yst(o,t)}}return t}function Yst(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function Xst(e){let t;l(e._extension)?t=Gst(e._extension):t=qst(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Li.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function Kst(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Li.getSchemaLoader({resource:i})}else n=Li.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function nTe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function $st(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var EF=YQ;var YT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};YT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return YT.TRANSLATION;case"ROTATION":return YT.ROTATION;case"SCALE":return YT.SCALE;case"_FEATURE_ID":return YT.FEATURE_ID}};Object.freeze(YT);var Lo=YT;var Jst=65534,Zst=255;function uG(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new oTe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],Qst(this)}Object.defineProperties(uG.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function Qst(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=iTe(i,c,u,f,p,g,m);for(;l(y);){let A=s[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),s[y]=A}A>Jst&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>Zst&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[a]=A):y===u?(u=A,t[a+1]=A):(f=A,t[a+2]=A),y=iTe(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function iTe(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=XQ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=XQ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=XQ(e,i,y,A,b);if(x===0)return i;let T=f&m&x,E,v,S;if(T&1)E=0,v=1,S=2;else if(T&2)E=0,S=1,v=2;else if(T&4)v=0,E=1,S=2;else if(T&8)v=0,S=1,E=2;else if(T&16)S=0,E=1,v=2;else if(T&32)S=0,v=1,E=2;else{let L=KQ(f),_=KQ(m),C=KQ(x);return L<_&&L<C?t:_<C?n:i}let I=t*3;e[I+E]=a,e[I+v]=c,e[I+S]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+S]=g;let O=i*3;e[O+E]=y,e[O+v]=A,e[O+S]=b}function XQ(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function KQ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}uG.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};uG.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,kt.maximumTextureSize),i=n,r=rTe(i),o=[];for(;i>1;)i>>=1,o.push(rTe(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:Ke.LUMINANCE,sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Jn.LINEAR})});return t.outlineTexture=s,s};function rTe(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 oTe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}oTe.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var XT=uG;function sTe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function eat(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function fG(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}fG.prototype.postProcess=function(e){this.needsOutlines&&(tat(this),rat(this,e)),this.needsGaussianSplats&&iat(this,e)};function tat(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new XT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=nat(r.outlineCoordinates),s=new sTe(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function nat(e){let t=new En.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function iat(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function rat(e,t){oat(e.attributePlans,t),l(e.indicesPlan)&&sat(e.indicesPlan,t)}function oat(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=tt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function sat(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.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)}fG.AttributeLoadPlan=sTe;fG.IndicesLoadPlan=eat;var KT=fG;function aat(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var CF=aat;function aTe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(aTe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var vF=aTe;function cTe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(cTe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var SF=cTe;function lTe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(lTe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var wF=lTe;var uTe={Direct:"Direct",Indirect:"Indirect"};Object.freeze(uTe);var FA=uTe;function fTe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(fTe.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 ow=fTe;function dTe(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(dTe.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 IF=dTe;function sw(){}function hTe(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function cat(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new vF({position:t,adjustmentParams:n})}function lat(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=hTe(e.covarianceMatrix);return new SF({position:t,adjustmentParams:n,covarianceMatrix:i})}function uat(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new IF({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new wF({groupFlags:t,rotationThetas:n,params:i})}sw.load=function(e){let t=e.storageType;if(t===FA.Direct)return sw.loadDirect(e);if(t===FA.Indirect)return sw.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};sw.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=cat(o);t.push(s)}let i=hTe(e.covarianceDirectUpperTriangle);return new ow({storageType:FA.Direct,anchorPointsDirect:t,covarianceDirect:i})};sw.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=lat(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=uat(s);r.push(a)}return new ow({storageType:FA.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var PF=sw;function mTe(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(mTe.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 DF=mTe;function pTe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(pTe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var RF=pTe;function gTe(e){this._ppeTextures=e}Object.defineProperties(gTe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var OF=gTe;function cs(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Tt.UNLOADED,this._promise=void 0}l(Object.create)&&(cs.prototype=Object.create(tr.prototype),cs.prototype.constructor=cs);Object.defineProperties(cs.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});cs.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Tt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Tt.FAILED,this.getError("Failed to load GPM data",e)}};cs.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=this._loadResources(this),this._promise)};function fat(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}cs.prototype._loadTextures=function(){let e;l(this._extension)&&(e=fat(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Li.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};cs.ppeTexturesMetadataSchemaCache=new Map;cs._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};cs._obtainPpeTexturesMetadataSchema=function(e){let n=cs._collectPpeTexturePropertyIdentifiers(e).toString(),i=cs.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${cs.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=cs._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=Gl.fromJson(o),cs.ppeTexturesMetadataSchemaCache.set(n,i),i};cs._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=cs._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};cs._convertToStructuralMetadata=function(e,t){let n=[],i=cs._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let s=0;s<r.length;s++){let a=r[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new c_({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new Ha({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};cs.prototype.process=function(e){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new RF({min:d.min,max:d.max,source:d.source}),g=new DF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new OF(o);this._meshPrimitiveGpmLocal=a;let c=cs._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Tt.READY,!0};cs.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Li.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};cs.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var MF=cs;function dat(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Zn(r,i);for(let o of n.primitiveGroups){let s=o.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:o.indices};switch(a.mode){case te.TRIANGLE_FAN:case te.TRIANGLE_STRIP:case te.LINE_STRIP:case te.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==a.mode)return i;r[c]=void 0}r[s]=a}return r.filter(l)}var NF=dat;var{Attribute:hat,Indices:mat,FeatureIdAttribute:yTe,FeatureIdTexture:ATe,FeatureIdImplicitRange:bTe,MorphTarget:pat,Primitive:gat,Instances:_at,Skin:yat,Node:Aat,AnimatedPropertyType:bat,AnimationSampler:xat,AnimationTarget:Tat,AnimationChannel:Eat,Animation:Cat,ArticulationStage:vat,Articulation:Sat,Asset:wat,Scene:Iat,Components:Pat,MetallicRoughness:Dat,SpecularGlossiness:Rat,Specular:Oat,Anisotropy:$Q,Clearcoat:JQ,PlanarFill:Mat,LineStyle:Nat,Material:Lat,Vector:Fat,Polygon:Bat}=En,so={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},ZQ=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=zi.Y,forwardAxis:c=zi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=so.NOT_LOADED,this._textureState=so.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}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=kat(this),this._promise)}_process(t){return this._state===so.READY?!0:(this._state===so.PROCESSING&&zat(this,t),this._resourcesLoaded&&this._state===so.POST_PROCESSING&&(Vat(this,t.context),this._state=so.PROCESSED),this._resourcesLoaded&&this._state===so.PROCESSED?(_Te(this),this._typedArray=void 0,this._state=so.READY,!0):!1)}_processTextures(t){if(this._textureState===so.READY)return!0;if(this._textureState!==so.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=so.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===so.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Uat(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=so.FAILED;let o=this._processError;this._processError=void 0,dG(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===so.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=so.FAILED,dG(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=so.FAILED,dG(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===so.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Li.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Qct(this),_Te(this),elt(this),tlt(this),nlt(this),ilt(this),this._components=void 0,this._typedArray=void 0,this._state=so.UNLOADED}};async function kat(e){e._state=so.LOADING,e._textureState=so.LOADING;try{let t=Li.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=so.LOADED,e._textureState=so.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=so.FAILED,e._textureState=so.FAILED,dG(e,t)}}async function Uat(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new CF({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=Zct(e,t);return e._state=so.PROCESSING,e._textureState=so.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Li.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function dG(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function zat(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 r=e._structuralMetadataLoader;if(l(r)){let s=r.process(t);s&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&s}let o=e._meshPrimitiveGpmLoader;if(l(o)){let s=o.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=o.structuralMetadata),n=n&&s}n&&(e._state=so.POST_PROCESSING)}function Vat(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&jat(e,r)}}function jat(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let a=0;a<o.length;a++){let c=o[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function Hat(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Li.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function Gat(e,t,n,i,r,o,s){return Li.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function xTe(e,t){let n=Li.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function QQ(e,t,n){let i=t.byteOffset,r=ku(e,t),o=t.count,s=Df(t.type),a=t.componentType,c=Y.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=Tg(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,s,c,g);for(let A=0;A<s;++A)d[y*s+A]=g[A];i+=r}return d}function Wat(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function qat(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===Vt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=Vt.getMathType(r),a=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function Yat(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=QQ(o,n,t.typedArray);i=i??!1,qat(n,s,r,i)}function LF(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=xTe(e,r),s=Yat(e,o,t,n,i);return e._loaderPromises.push(s),i}return Wat(t,i)}function Tm(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=xTe(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=QQ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function $u(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function Xat(e){return e===Number?0:new e}function Kat(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var $at={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function Jat(e,t){let n=Kat(e.componentDatatype),i=$at[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function Zat(e,t,n){let i=e.decodeMatrix,r=$u(n,e.decodedMin),o=$u(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new En.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 U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(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 Qat(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new hat;c.name=n,c.semantic=i,c.setIndex=r,c.constant=Xat(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=$u(s,o.min),c.max=$u(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=ku(e,o),er(o,"WEB3D_quantized_attributes")&&Zat(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===ct.POSITION||c.semantic===ct.NORMAL||c.semantic===ct.TANGENT||c.semantic===ct.TEXCOORD||c.semantic===ct.FEATURE_ID||c.semantic===ct.SCALE||c.semantic===ct.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&Jat(c,s),c}function TTe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var ect={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function eee(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=ect;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function tct(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function nct(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function ict(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ct.POSITION){let r=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let m=s[g],y=s[g+1],A=s[g+2];a=Math.min(a,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(a,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function rct(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=QQ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function ETe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?TTe(g):void 0,b=Qat(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=Hat(e,t,p,i,r,o,s,a,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?nct(b,x,s,a):l(o)?ict(b,x,s,a):rct(u,f,b,x,s,a)},b}function CTe(e,t,n,i,r,o,s,a,c){let u=n.modelSemantic,f=u===ct.POSITION,d=u===ct.FEATURE_ID,p=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,E=ETe(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new KT.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function oct(e,t,n,i,r){let o=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=eee(e,Lo,i),u=c.modelSemantic,f=u===Lo.TRANSLATION||u===Lo.ROTATION||u===Lo.SCALE,d=u===Lo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return ETe(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function sct(e,t,n,i,r,o){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let d=new mat;d.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,E=Gat(e,t,n,u,r?!1:A,r?!0:b,o),v=e._geometryLoaders.length;e._geometryLoaders.push(E);let S=E.load();e._loaderPromises.push(S),e._geometryCallbacks[v]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let I=new KT.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function act(e,t,n){return new jt({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function cu(e,t,n,i,r){let o=e.gltfJson,s=Uu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Li.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Uu.createModelTextureReader({textureInfo:t}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=so.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{let d=a.texture;c.texture=d,(l(i)||l(r))&&(d.sampler=act(d.sampler,i,r))},c}function cct(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new Rat;return l(i)&&(c.diffuseTexture=cu(e,i,n)),l(r)&&(c.specularGlossinessTexture=cu(e,r,n)),c.diffuseFactor=$u(se,o),c.specularFactor=$u(h,s),c.glossinessFactor=a,c}function lct(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new Dat;return l(i)&&(c.baseColorTexture=cu(e,i,n)),l(r)&&(c.metallicRoughnessTexture=cu(e,r,n)),c.baseColorFactor=$u(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function uct(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new Oat;return l(r)&&(a.specularTexture=cu(e,r,n)),l(s)&&(a.specularColorTexture=cu(e,s,n)),a.specularFactor=i,a.specularColorFactor=$u(h,o),a}function fct(e,t,n){let{anisotropyStrength:i=$Q.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=$Q.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new $Q;return l(o)&&(s.anisotropyTexture=cu(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function dct(e,t,n){let{clearcoatFactor:i=JQ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=JQ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new JQ;return l(r)&&(c.clearcoatTexture=cu(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=cu(e,s,n)),l(a)&&(c.clearcoatNormalTexture=cu(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function hct(e){return new Mat(e)}function mct(e){if(!l(e))return;let t=new Nat;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function pct(e,t,n){let i=new Lat,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,s=r.KHR_materials_specular,a=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=cct(e,o,n):(l(u)&&(i.metallicRoughness=lct(e,u,n)),l(s)&&!i.unlit&&(i.specular=uct(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=fct(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=dct(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=cu(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=cu(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=cu(e,t.occlusionTexture,n)),i.emissiveFactor=$u(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=hct(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=mct(r.BENTLEY_materials_line_style),i}function vTe(e,t){let n=new yTe;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 STe(e,t,n,i){let r=new yTe,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=TTe(o.attribute),r.positionalLabel=i,r}function wTe(e,t){let n=new bTe;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 ITe(e,t,n,i){let r=new bTe,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let s=o.divisor??0;return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function gct(e,t,n,i){let r=new ATe;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=cu(e,o,n,Wt.NEAREST,Jn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function _ct(e,t,n,i,r,o){let s=new ATe,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=cu(e,c,i,Wt.NEAREST,Jn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function yct(e,t,n,i,r){let o=new pat,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=eee(e,ct,f),g=CTe(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function Act(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function PTe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=$u(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function bct(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function xct(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,s=o.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new oe("Edge visibility line string accessor not found!");let c=Tm(e,a),u=bct(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:PTe(e,f)}}return i}function Tct(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=Tm(e,r)}if(n.materialColor=PTe(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=Tm(e,r))}return l(t.lineStrings)&&(n.lineStrings=xct(e,t.lineStrings,t.material)),n}function Ect(e,t,n,i){let r=new gat,o=new KT(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=pct(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=vct(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=Sct(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=Cct(e,d,o)),r.edgeVisibility=Tct(e,a.EXT_mesh_primitive_edge_visibility);let p=Act(a);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=a.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let O in A){if(!A.hasOwnProperty(O))continue;let L=A[O],_=eee(e,ct,O),C=_.modelSemantic;if(g&&!tct(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=CTe(e,L,_,t,m,p,n,f,i);o.attributePlans.push(w),r.attributes.push(w.attribute)}let b=t.targets;if(l(b)&&!g)for(let O=0;O<b.length;++O)r.morphTargets.push(yct(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=sct(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=a.EXT_structural_metadata,E=a.EXT_mesh_features,v=a.EXT_feature_metadata,S=l(v),I=a.NGA_gpm_local;l(E)?wct(e,r,E,i):S&&Ict(e,r,v,i),l(T)?Pct(r,T):S&&Dct(e,r,v),l(I)&&Rct(r,I);let R=t.mode;if(g&&R!==Oe.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function Cct(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return LF(e,i,!1)}function vct(e,t,n){let i=new Bat,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=Tm(e,r[t.indices]),i.loopIndicesOffsets=Tm(e,r[n.indicesOffsets]),i.triangleIndices=Tm(e,r[n.triangleIndices]),i.triangleIndicesOffsets=Tm(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=Tm(e,r[n.loopIndices]),i.loopIndicesOffsets=Tm(e,r[n.loopIndicesOffsets]),i.triangleIndices=Tm(e,r[t.indices]),i.triangleIndicesOffsets=Tm(e,r[n.indicesOffsets])),i}function Sct(e,t){if(!l(t))return;let n=new Fat;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return LF(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function wct(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let s=r[o],a=`featureId_${o}`,c;l(s.texture)?c=gct(e,s,i,a):l(s.attribute)?c=vTe(s,a):c=wTe(s,a),t.featureIds.push(c)}}function Ict(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=STe(u,d,p,g):m=ITe(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=_ct(e,u,d,i,p,g);t.featureIds.push(m)}}function Pct(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function Dct(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Rct(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Oct(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new _at,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(oct(e,f,o,u,n))}let s=i.extensions??H.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?Mct(r,a):l(c)&&Nct(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function Mct(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=vTe(r,o):s=wTe(r,o),e.featureIds.push(s)}}function Nct(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let s=0;s<o.length;++s){let a=o[s],c=a.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=STe(a,u,f,d):p=ITe(a,u,f,d),t.featureIds.push(p)}}function Lct(e,t,n){let i=new Aat;i.name=t.name,i.matrix=$u(N,t.matrix),i.translation=$u(h,t.translation),i.rotation=$u(Le,t.rotation),i.scale=$u(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,s=r.AGI_articulations,a=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Oct(e,r,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=NF(u);for(let g=0;g<f.length;++g)i.primitives.push(Ect(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function Fct(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=Lct(e,r,t);return s.index=o,s});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let s=0;s<o.length;++s)i[r].children.push(i[o[s]])}return i}function Bct(e,t,n){let i=new yat,r=t.joints;i.joints=r.map(s=>n[s]);let o=t.inverseBindMatrices;if(l(o)){let s=e.gltfJson.accessors[o];i.inverseBindMatrices=LF(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(N.IDENTITY);return i}function kct(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=Bct(e,o,t);return a.index=s,a}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let s=r[o].skin;l(s)&&(t[o].skin=i[s])}return i}async function Uct(e,t,n,i){let r=new EF({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function zct(e,t,n,i){let r=new MF({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function Vct(e,t){let n=new xat,i=e.gltfJson.accessors,r=i[t.input];n.input=LF(e,r);let o=t.interpolation;n.interpolation=am[o]??am.LINEAR;let s=i[t.output];return n.output=LF(e,s,!0),n}function jct(e,t){let n=new Tat,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=bat[r],n}function Hct(e,t,n){let i=new Eat,r=e.sampler;return i.sampler=t[r],i.target=jct(e.target,n),i}function Gct(e,t,n){let i=new Cat;i.name=t.name;let r=t.samplers.map(function(s,a){let c=Vct(e,s);return c.index=a,c}),o=t.channels.map(function(s){return Hct(s,r,n)});return i.samplers=r,i.channels=o,i}function Wct(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=Gct(e,r,t);return s.index=o,s})}function qct(e){let t=new vat;t.name=e.name;let n=e.type.toUpperCase();return t.type=Qc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Yct(e){let t=new Sat;return t.name=e.name,t.stages=e.stages.map(qct),t}function Xct(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Yct):[]}function Kct(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function $ct(e,t){let n=new Iat,i=Kct(e);return n.nodes=i.map(function(r){return t[r]}),n}var Jct=new h;function Zct(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,E=l(x)?x:[],v=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=Fct(e,t),c=kct(e,a),u=Wct(e,a),f=Xct(n),d=$ct(n,a),p=new Pat,g=new wat,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new It(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let x=h.fromArray(s.center,0,Jct);p.transform=N.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=Uct(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=PF.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let E of T){let v=E.extensions;if(l(v)){let S=v.NGA_gpm_local;if(l(S)){let I=zct(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Zn(b,e._loaderPromises),e._incrementallyLoadTextures||Zn(b,e._texturesPromises),Promise.all(b)}function Qct(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._textureLoaders.length=0}function _Te(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._bufferViewLoaders.length=0}function elt(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._geometryLoaders.length=0}function tlt(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 nlt(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function ilt(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var jf=ZQ;var FF=`uniform sampler2D u_pointCloud_colorGBuffer; uniform sampler2D u_pointCloud_depthGBuffer; uniform vec2 u_distanceAndEdlStrength; in vec2 v_textureCoordinates; @@ -3873,8 +4963,8 @@ color.rgb *= shade; out_FragColor = vec4(color); gl_FragDepth = depthOrLogDepth; } -`;function oE(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(oE.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 rGe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var K9=new H;function sGe(e,t){let n=new He({defines:["LOG_DEPTH_WRITE"],sources:[sR]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return K9.x=e._radius,K9.y=e._strength,K9}},o=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:De.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ei({framebuffer:e.framebuffer,color:new G(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:De.CESIUM_3D_TILE,owner:e})}function aGe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),sGe(e,t)}function Hae(e){return e.drawBuffers&&e.fragmentDepth}oE.isSupported=Hae;function cGe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!c(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=He.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() +`;function aw(){this._framebuffer=new ai({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(aw.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 rlt(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var tee=new U;function olt(e,t){let n=new Ye({defines:["LOG_DEPTH_WRITE"],sources:[FF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return tee.x=e._radius,tee.y=e._strength,tee}},r=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new li({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function slt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),olt(e,t)}function DTe(e){return e.drawBuffers&&e.fragmentDepth}aw.isSupported=DTe;function alt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=Ye.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() { czm_point_cloud_post_process_main(); #ifdef LOG_DEPTH @@ -3883,7 +4973,7 @@ layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(functio #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}oE.prototype.update=function(e,t,n,i){if(!Hae(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,aGe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===De.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;c(p)&&(f=p.command,h=p.originalShaderProgram),(!c(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=Qe.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=cGe(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,c(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,l=this._drawCommand;l.boundingVolume=i,r.push(l),r.push(a)};oE.prototype.isDestroyed=function(){return!1};oE.prototype.destroy=function(){return rGe(this),de(this)};var f_=oE;function Gae(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}Gae.isSupported=function(e){return f_.isSupported(e.context)};var vm=Gae;var Va={},lGe=new se(0,0,0,1),Ac=new se,uGe=new Ke,$9=new H,Z9=new H;Va.worldToWindowCoordinates=function(e,t,n){return Va.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var jae=new se,Wae=new d;function aR(e,t,n,i){let o=n.viewMatrix,r=B.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,jae),jae),s=d.multiplyComponents(t,d.normalize(r,Wae),Wae);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,B.multiplyByVector(n.frustum.projectionMatrix,r,i)}var fGe=new he(Math.PI,O.PI_OVER_TWO),dGe=new d,hGe=new d;Va.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!c(e))throw new E("scene is required.");if(!c(t))throw new E("position is required.");let o=e.frameState,r=Va.computeActualEllipsoidPosition(o,t,lGe);if(!c(r))return;let s=e.canvas,a=uGe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let l=e.camera,u=!1;if(o.mode===oe.SCENE2D){let f=e.mapProjection,h=fGe,p=f.project(h,dGe),g=d.clone(l.position,hGe),m=l.frustum.clone(),y=B.computeViewportTransformation(a,0,1,new B),b=l.frustum.projectionMatrix,x=l.positionWC.y,A=d.fromElements(O.sign(x)*p.x-x,0,-l.positionWC.x),C=Ot.pointToGLWindowCoordinates(b,y,A);if(x===0||C.x<=0||C.x>=s.clientWidth)u=!0;else{if(C.x>s.clientWidth*.5){a.width=C.x,l.frustum.right=p.x-x,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,$9),a.x+=C.x,l.position.x=-l.position.x;let S=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-S,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,Z9)}else{a.x+=C.x,a.width-=C.x,l.frustum.left=-p.x-x,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,$9),a.x=a.x-a.width,l.position.x=-l.position.x;let S=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-S,Ac=aR(r,n,l,Ac),Va.clipToGLWindowCoordinates(a,Ac,Z9)}d.clone(g,l.position),l.frustum=m.clone(),i=H.clone($9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=Z9.x)}}if(o.mode!==oe.SCENE2D||u){if(Ac=aR(r,n,l,Ac),Ac.z<0&&!(l.frustum instanceof on)&&!(l.frustum instanceof jo))return;i=Va.clipToGLWindowCoordinates(a,Ac,i)}return i.y=s.clientHeight-i.y,i};Va.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Va.worldToWindowCoordinates(e,t,n),!!c(n))return Va.transformWindowToDrawingBuffer(e,n,n)};var d_=new d,mGe=new he;Va.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,mGe);if(!c(r))return;if(o.project(r,d_),i===oe.COLUMBUS_VIEW)return d.fromElements(d_.z,d_.x,d_.y,n);if(i===oe.SCENE2D)return d.fromElements(0,d_.x,d_.y,n);let s=e.morphTime;return d.fromElements(O.lerp(d_.z,t.x,s),O.lerp(d_.x,t.y,s),O.lerp(d_.y,t.z,s),n)};var qae=new d,Yae=new d,Xae=new B;Va.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,qae),B.computeViewportTransformation(e,0,1,Xae),B.multiplyByPoint(Xae,qae,Yae),H.fromCartesian3(Yae,n)};Va.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return H.fromElements(t.x*o,t.y*r,n)};var pGe=new se,Kae=new se;Va.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,l=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=l*(1-a/(m+a))/(l-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,pGe);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(c(p.fovy)){h=B.multiplyByVector(r.inverseViewProjection,f,Kae);let g=1/h.w;d.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;c(g)&&(p=g),h=Kae,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(a-l)-a-l)*.5,h.w=1,h=B.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var Gi=Va;var rE={};rE._deprecationWarning=ws;var h_=Uint32Array.BYTES_PER_ELEMENT;rE.parse=function(e,t){let n=t??0;T.defined("arrayBuffer",e),t=n;let i=new Uint8Array(e),o=new DataView(e);t+=h_;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+=h_;let s=o.getUint32(t,!0);t+=h_;let a=o.getUint32(t,!0);t+=h_;let l=o.getUint32(t,!0);t+=h_;let u=o.getUint32(t,!0);t+=h_;let f=o.getUint32(t,!0);t+=h_;let h;u>=570425344?(t-=h_*2,h=a,u=l,f=0,a=0,l=0,rE._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.")):f>=570425344&&(t-=h_,h=u,u=a,f=l,a=0,l=0,rE._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:h??0}:(p=ir(i,t,a),t+=a);let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=ir(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(rE._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var cR=rE;function lR(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function $ae(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return c(a)||(a=$.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function _Ge(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return c(r)||(r=$.createTypedArray(n,i),o[t]=r),r}lR.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(t=t??$.UNSIGNED_INT,n=n??1,$ae(this,e,t,n,1,i.byteOffset)):i};lR.prototype.hasProperty=function(e){return c(this.json[e])};lR.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(c(i.componentType)&&(t=$.fromName(i.componentType)),$ae(this,e,t,n,this.featuresLength,i.byteOffset)):_Ge(this,e,t,i)};lR.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!c(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 sh=lR;function uR(e){T.typeOf.number("options.count",e.count),T.typeOf.object("options.batchTable",e.batchTable);let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput;if(o&&!c(r))throw new E("customAttributeOutput is required when parsing batch table as property attributes");let s=gGe(n),a;c(s.jsonProperties)&&(a=new l_({count:t,properties:s.jsonProperties}));let l;c(s.hierarchy)&&(l=new nx({extension:s.hierarchy,binaryBody:i}));let u=Qd.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,h,p,g;if(o){let b=bGe(t,u,f,i,r);g=b.transcodedSchema,p=[new Sx({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=yGe(t,u,f,i);g=b.transcodedSchema;let x=b.featureTableJson;h=new Nf({count:x.count,properties:x.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(c(h)||c(a)||c(l)){let b=new nl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:l});m.push(b)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ys(y)}function gGe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;c(t)?(uR._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):c(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 l=e[a];Array.isArray(l)?(r=c(r)?r:{},r[a]=l):s[a]=l}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function yGe(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!c(i))throw new ae(`Property ${h} requires a batch table binary.`);let p=n[h],g=Eu(p);r[h]={bufferView:a},o[h]=Zae(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let l={classes:{}};l.classes[t]={properties:o};let u=vu.fromJson(l);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function bGe(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(!c(i)&&!c(p.typedArray))throw new ae(`Property ${h} requires a batch table binary.`);let g=$t.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=Zae(p);m.name=h,r[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let b=p.typedArray;c(b)||(b=Eu(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let x=new Tn.Attribute;x.name=y,x.count=e,x.type=p.type;let A=$.fromTypedArray(b);(A===$.INT||A===$.UNSIGNED_INT||A===$.DOUBLE)&&(uR._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" 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.`),b=new Float32Array(b)),x.componentDatatype=$.fromTypedArray(b),x.typedArray=b,o.push(x),s[g]={attribute:y}}let l={classes:{}};l.classes[t]={properties:r};let u=vu.fromJson(l);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Zae(e){let t=xGe(e.componentType);return{type:e.type,componentType:t}}function xGe(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"}}uR._deprecationWarning=ws;uR._oneTimeWarning=dt;var m_=uR;var Dx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},TGe=Tn.FeatureIdAttribute;function wy(e){e=e??W.EMPTY_OBJECT;let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadAttributesFor2D??!1,p=e.enablePick??!1,g=e.loadIndicesForWireframe??!1,m=e.loadPrimitiveOutline??!0,y=e.loadForClassification??!1;T.typeOf.object("options.b3dmResource",t),T.typeOf.object("options.arrayBuffer",i),n=c(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=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=m,this._loadForClassification=y,this._state=Dx.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=B.IDENTITY}c(Object.create)&&(wy.prototype=Object.create($i.prototype),wy.prototype.constructor=wy);Object.defineProperties(wy.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});wy.prototype.load=function(){if(c(this._promise))return this._promise;let e=cR.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new sh(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(a)&&(this._transform=B.fromTranslation(d.fromArray(a))),this._batchTable={json:o,binary:r};let l=new rh({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=l,this._state=Dx.LOADING;let u=this;return this._promise=l.load().then(function(){if(!u.isDestroyed())return u._state=Dx.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return AGe(u,f)}),this._promise};function AGe(e,t){return e.unload(),e._state=Dx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}wy.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===Dx.READY)return!0;if(this._state!==Dx.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=B.multiplyTransformation(this._transform,n.transform,n.transform),CGe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=Dx.READY,!0};function CGe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(c(n.json))o=m_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new nl({name:Qd.BATCH_TABLE_CLASS_NAME,count:i});o=new Ys({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Qae(r[a]);t.structuralMetadata=o}function Qae(e){let t=e.children.length;for(let i=0;i<t;i++)Qae(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=$t.getAttributeBySemantic(o,ht.FEATURE_ID);if(c(r)){r.setIndex=0;let s=new TGe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}wy.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var fR=wy;function vy(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.geoJson",e.geoJson),this._geoJson=e.geoJson,this._components=void 0}c(Object.create)&&(vy.prototype=Object.create($i.prototype),vy.prototype.constructor=vy);Object.defineProperties(vy.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});vy.prototype.load=function(){return Promise.resolve(this)};vy.prototype.process=function(e){return T.typeOf.object("frameState",e),c(this._components)||(this._components=FGe(this._geoJson,e),this._geoJson=void 0),!0};function EGe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function SGe(){this.features=[]}function Q9(e){let t=e[0],n=e[1],i=e[2]??0;return new d(t,n,i)}function J9(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=Q9(e[o]);return[n]}function wGe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=J9(e[i])[0];return n}function Jae(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=J9(e[i])[0];return n}function vGe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Jae(e[i]));return n}function DGe(e){return[Q9(e)]}function PGe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=Q9(e[i]);return n}var IGe={LineString:J9,MultiLineString:wGe,MultiPolygon:vGe,Polygon:Jae,MultiPoint:PGe,Point:DGe},OGe={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function ece(e,t){if(!c(e.geometry))return;let n=e.geometry.type,i=IGe[n],o=OGe[n],r=e.geometry.coordinates;if(!c(i)||!c(r))return;let s=new EGe;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function RGe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)ece(n[o],t)}var MGe={FeatureCollection:RGe,Feature:ece},Cz=new d;function LGe(e,t,n){let i=0,o=0,r=e.length;for(let L=0;L<r;L++){let F=e[L];if(c(F.lines)){let _=F.lines.length;for(let w=0;w<_;w++){let D=F.lines[w];i+=D.length,o+=(D.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),l=Fe.createTypedArray(i,o),u=Fe.fromTypedArray(l),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let L=0;L<r;L++){let F=e[L];if(!c(F.lines))continue;let _=F.lines.length;for(let w=0;w<_;w++){let D=F.lines[w],I=D.length;for(let N=0;N<I;N++){let k=D[N],z=d.fromDegrees(k.x,k.y,k.z,ie.WGS84,Cz),V=B.multiplyByPoint(t,z,Cz);d.minimumByComponent(f,V,f),d.maximumByComponent(h,V,h),d.pack(V,s,p*3),a[p]=L,N<I-1&&(l[g*2]=p,l[g*2+1]=p+1,g++),p++}}}let m=yt.createVertexBuffer({typedArray:s,context:n.context,usage:Be.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=yt.createVertexBuffer({typedArray:a,context:n.context,usage:Be.STATIC_DRAW});y.vertexArrayDestroyable=!1;let b=yt.createIndexBuffer({typedArray:l,context:n.context,usage:Be.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let x=new Tn.Attribute;x.semantic=ht.POSITION,x.componentDatatype=$.FLOAT,x.type=nn.VEC3,x.count=i,x.min=f,x.max=h,x.buffer=m;let A=new Tn.Attribute;A.semantic=ht.FEATURE_ID,A.setIndex=0,A.componentDatatype=$.FLOAT,A.type=nn.SCALAR,A.count=i,A.buffer=y;let C=[x,A],S=new Tn.Material;S.unlit=!0;let v=new Tn.Indices;v.indexDatatype=u,v.count=l.length,v.buffer=b;let P=new Tn.FeatureIdAttribute;P.featureCount=r,P.propertyTableId=0,P.setIndex=0,P.positionalLabel="featureId_0";let M=[P],R=new Tn.Primitive;return R.attributes=C,R.indices=v,R.featureIds=M,R.primitiveType=Me.LINES,R.material=S,R}function NGe(e,t,n){let i=0,o=e.length;for(let C=0;C<o;C++){let S=e[C];c(S.points)&&(i+=S.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let C=0;C<o;C++){let S=e[C];if(!c(S.points))continue;let v=S.points.length;for(let P=0;P<v;P++){let M=S.points[P],R=d.fromDegrees(M.x,M.y,M.z,ie.WGS84,Cz),L=B.multiplyByPoint(t,R,Cz);d.minimumByComponent(a,L,a),d.maximumByComponent(l,L,l),d.pack(L,r,u*3),s[u]=C,u++}}let f=yt.createVertexBuffer({typedArray:r,context:n.context,usage:Be.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=yt.createVertexBuffer({typedArray:s,context:n.context,usage:Be.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new Tn.Attribute;p.semantic=ht.POSITION,p.componentDatatype=$.FLOAT,p.type=nn.VEC3,p.count=i,p.min=a,p.max=l,p.buffer=f;let g=new Tn.Attribute;g.semantic=ht.FEATURE_ID,g.setIndex=0,g.componentDatatype=$.FLOAT,g.type=nn.SCALAR,g.count=i,g.buffer=h;let m=[p,g],y=new Tn.Material;y.unlit=!0;let b=new Tn.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let x=[b],A=new Tn.Primitive;return A.attributes=m,A.featureIds=x,A.primitiveType=Me.POINTS,A.material=y,A}function FGe(e,t){let n=new SGe,i=MGe[e.type];c(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 L=0;L<r;L++){let _=o[L].properties??W.EMPTY_OBJECT;for(let w in _)_.hasOwnProperty(w)&&(c(s[w])||(s[w]=new Array(r)))}for(let L=0;L<r;L++){let F=o[L];for(let _ in s)if(s.hasOwnProperty(_)){let w=F.properties[_]??"";s[_][L]=w}}let a=new l_({count:r,properties:s}),u=[new nl({id:0,count:r,jsonMetadataTable:a})],f=vu.fromJson({}),h=new Ys({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let L=0;L<r;L++){let F=o[L];if(c(F.lines)){m=!0;let _=F.lines.length;for(let w=0;w<_;w++){let D=F.lines[w],I=D.length;for(let N=0;N<I;N++)d.minimumByComponent(p,D[N],p),d.maximumByComponent(g,D[N],g)}}if(c(F.points)){y=!0;let _=F.points.length;for(let w=0;w<_;w++){let D=F.points[w];d.minimumByComponent(p,D,p),d.maximumByComponent(g,D,g)}}}let b=d.midpoint(p,g,new d),x=d.fromDegrees(b.x,b.y,b.z,ie.WGS84,new d),A=Ot.eastNorthUpToFixedFrame(x,ie.WGS84,new B),C=B.inverseTransformation(A,new B),S=[];m&&S.push(LGe(o,C,t)),y&&S.push(NGe(o,C,t));let v=new Tn.Node;v.index=0,v.primitives=S;let P=[v],M=new Tn.Scene;M.nodes=P;let R=new Tn.Components;return R.scene=M,R.nodes=P,R.transform=A,R.structuralMetadata=h,R}vy.prototype.unload=function(){this._components=void 0};var dR=vy;var Ez={};Ez._deprecationWarning=ws;var Dy=Uint32Array.BYTES_PER_ELEMENT;Ez.parse=function(e,t){T.defined("arrayBuffer",e);let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Dy;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+=Dy;let s=o.getUint32(t,!0);t+=Dy;let a=o.getUint32(t,!0);if(a===0)throw new ae("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Dy;let l=o.getUint32(t,!0);t+=Dy;let u=o.getUint32(t,!0);t+=Dy;let f=o.getUint32(t,!0);t+=Dy;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+=Dy;let p=ir(i,t,a);t+=a;let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=ir(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(Ez._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var hR=Ez;var p_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Sz=Tn.Attribute,BGe=Tn.FeatureIdAttribute,nce=Tn.Instances;function __(e){e=e??W.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,g=e.enablePick??!1;T.typeOf.object("options.i3dmResource",t),T.typeOf.object("options.arrayBuffer",n),i=c(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=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=p_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}c(Object.create)&&(__.prototype=Object.create($i.prototype),__.prototype.constructor=__);Object.defineProperties(__.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});__.prototype.load=function(){if(c(this._promise))return this._promise;let e=hR.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new sh(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!c(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let l=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(l)&&(this._transform=B.fromTranslation(d.fromArray(l))),this._batchTable={json:i,binary:o};let u={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=Fl(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new rh(u);return this._gltfLoader=f,this._state=p_.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=p_.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw kGe(this,h)}),this._promise};function kGe(e,t){return e.unload(),e._state=p_.FAILED,e.getError("Failed to load i3dm",t)}__.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===p_.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===p_.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=B.multiplyTransformation(this._transform,i.transform,i.transform),zGe(this,i,e),UGe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=p_.READY,!0};function UGe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(c(n.json))o=m_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new nl({name:Qd.BATCH_TABLE_CLASS_NAME,count:i});o=new Ys({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var wz=new d,eW=new Array(4),VGe=new B;function zGe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",$.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),l=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=GGe(o,r),h;l&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=d.unpackArray(f),y=new d,b=new d,x=new d,A=new d,C=new J,S=new Le,v=new Array(4),P=new d,M=new Array(3),R=new B;if(!c(s)||d.equals(d.unpack(s),d.ZERO)){let V=le.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],V.center,wz),f[3*i+0]=wz.x,f[3*i+1]=wz.y,f[3*i+2]=wz.z;let j=B.fromTranslation(V.center,VGe);t.transform=B.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<r;i++){y=d.clone(m[i]),c(s)&&d.add(y,d.unpack(s),y),l&&(jGe(o,a,i,S,y,x,b,A,C,R),Le.pack(S,v,0),h[4*i+0]=v[0],h[4*i+1]=v[1],h[4*i+2]=v[2],h[4*i+3]=v[3]),u&&(WGe(o,i,P),d.pack(P,M,0),p[3*i+0]=M[0],p[3*i+1]=M[1],p[3*i+2]=M[2]);let V=o.getProperty("BATCH_ID",$.UNSIGNED_SHORT,1,i);c(V)||(V=i),g[i]=V}let L=new nce;L.transformInWorldSpace=!0;let F=e._buffers,_=new Sz;if(_.name="Instance Translation",_.semantic=rs.TRANSLATION,_.componentDatatype=$.FLOAT,_.type=nn.VEC3,_.count=r,_.typedArray=f,!l){let V=yt.createVertexBuffer({context:n.context,typedArray:f,usage:Be.STATIC_DRAW});V.vertexArrayDestroyable=!1,F.push(V),_.buffer=V}if(L.attributes.push(_),l){let V=new Sz;V.name="Instance Rotation",V.semantic=rs.ROTATION,V.componentDatatype=$.FLOAT,V.type=nn.VEC4,V.count=r,V.typedArray=h,L.attributes.push(V)}if(u){let V=new Sz;if(V.name="Instance Scale",V.semantic=rs.SCALE,V.componentDatatype=$.FLOAT,V.type=nn.VEC3,V.count=r,l)V.typedArray=p;else{let j=yt.createVertexBuffer({context:n.context,typedArray:p,usage:Be.STATIC_DRAW});j.vertexArrayDestroyable=!1,F.push(j),V.buffer=j}L.attributes.push(V)}let w=new Sz;w.name="Instance Feature ID",w.setIndex=0,w.semantic=rs.FEATURE_ID,w.componentDatatype=$.FLOAT,w.type=nn.SCALAR,w.count=r;let D=yt.createVertexBuffer({context:n.context,typedArray:g,usage:Be.STATIC_DRAW});D.vertexArrayDestroyable=!1,F.push(D),w.buffer=D,L.attributes.push(w);let I=new BGe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",L.featureIds.push(I);let N=t.nodes,k=N.length,z=!1;for(i=0;i<k;i++){let V=N[i];V.primitives.length>0&&(V.instances=z?HGe(L):L,z=!0)}}function HGe(e){let t=new nce;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=je(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function GGe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",$.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(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 l=3*s+a;r[l]=n[l]/65535*o[a]+i[a]}return r}else throw new ae("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var tce=new Array(4);function jGe(e,t,n,i,o,r,s,a,l,u){let f=e.getProperty("NORMAL_UP",$.FLOAT,3,n,eW),h=e.getProperty("NORMAL_RIGHT",$.FLOAT,3,n,tce),p=!1;if(c(f)){if(!c(h))throw new ae("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",$.UNSIGNED_SHORT,2,n,eW),m=e.getProperty("NORMAL_RIGHT_OCT32P",$.UNSIGNED_SHORT,2,n,tce);if(c(g)){if(!c(m))throw new ae("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Ln.octDecodeInRange(g[0],g[1],65535,r),Ln.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Ot.eastNorthUpToFixedFrame(o,ie.WGS84,u),B.getMatrix3(u,l)):J.clone(J.IDENTITY,l)}p&&(d.cross(s,r,a),d.normalize(a,a),J.setColumn(l,0,s,l),J.setColumn(l,1,r,l),J.setColumn(l,2,a,l)),Le.fromRotationMatrix(l,i)}function WGe(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",$.FLOAT,1,t);c(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",$.FLOAT,3,t,eW);c(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function qGe(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}__.prototype.isUnloaded=function(){return this._state===p_.UNLOADED};__.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),qGe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=p_.UNLOADED};var mR=__;var YGe={STOPPED:0,ANIMATING:1},ah=Object.freeze(YGe);function sE(){this.times=void 0,this.points=void 0,E.throwInstantiationError()}sE.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Le)return Le;throw new E("point must be a Cartesian3, Quaternion, or number.")};sE.prototype.evaluate=E.throwInstantiationError;sE.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(T.typeOf.number("time",e),e<n[0]||e>n[i-1])throw new E("time is out of range.");if(t=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};sE.prototype.wrapTime=function(e){T.typeOf.number("time",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};sE.prototype.clampTime=function(e){T.typeOf.number("time",e);let t=this.times;return O.clamp(e,t[0],t[t.length-1])};var Ni=sE;function aE(e){this._value=e,this._valueType=Ni.getPointType(e)}Object.defineProperties(aE.prototype,{value:{get:function(){return this._value}}});aE.prototype.findTimeInterval=function(e){throw new E("findTimeInterval cannot be called on a ConstantSpline.")};aE.prototype.wrapTime=function(e){return T.typeOf.number("time",e),0};aE.prototype.clampTime=function(e){return T.typeOf.number("time",e),0};aE.prototype.evaluate=function(e,t){T.typeOf.number("time",e);let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var pR=aE;function cE(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new E("points and times are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cE.prototype.findTimeInterval=Ni.prototype.findTimeInterval;cE.prototype.wrapTime=Ni.prototype.wrapTime;cE.prototype.clampTime=Ni.prototype.clampTime;cE.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]:(c(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var Py=cE;var ice={};ice.solve=function(e,t,n,i){if(!c(e)||!(e instanceof Array))throw new E("The array lower is required.");if(!c(t)||!(t instanceof Array))throw new E("The array diagonal is required.");if(!c(n)||!(n instanceof Array))throw new E("The array upper is required.");if(!c(i)||!(i instanceof Array))throw new E("The array right is required.");if(t.length!==i.length)throw new E("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new E("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new E("lower and upper must be one less than the length of diagonal.");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 d,s[a]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let l;for(a=1;a<o.length;++a)l=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*l,r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],l,r[a]);for(l=1/(t[a]-o[a-1]*e[a-1]),r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],l,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var lE=ice;var oce=[],rce=[],sce=[],ace=[];function XGe(e,t,n){let i=oce,o=sce,r=rce,s=ace;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let l=s[0];for(c(l)||(l=s[0]=new d),d.clone(t,l),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new d),d.subtract(e[a+1],e[a-1],l),d.multiplyByScalar(l,3,l);return i[a]=0,o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new d),d.subtract(e[a+1],e[a-1],l),d.multiplyByScalar(l,3,l),r[a+1]=1,l=s[a+1],c(l)||(l=s[a+1]=new d),d.clone(n,l),lE.solve(i,r,o,s)}function KGe(e){let t=oce,n=sce,i=rce,o=ace;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(c(s)||(s=o[0]=new d),d.subtract(e[1],e[0],s),d.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],c(s)||(s=o[r]=new d),d.subtract(e[r+1],e[r-1],s),d.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],c(s)||(s=o[r]=new d),d.subtract(e[r],e[r-1],s),d.multiplyByScalar(s,3,s),lE.solve(t,i,n,o)}function Gl(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;if(!c(t)||!c(n)||!c(i)||!c(o))throw new E("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");if(i.length!==o.length||i.length!==t.length-1)throw new E("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._pointType!==Ni.getPointType(i[0])||this._pointType!==Ni.getPointType(o[0]))throw new E("inTangents and outTangents must be of the same type as points.");this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Gl.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}}});Gl.createC1=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents;if(!c(n)||!c(t)||!c(i))throw new E("points, times and tangents are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==i.length)throw new E("times, points and tangents must have the same length.");let o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Gl({times:t,points:n,inTangents:r,outTangents:o})};Gl.createNaturalCubic=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points;if(!c(n)||!c(t))throw new E("points and times are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new E("times.length must be equal to points.length.");if(n.length<3)return new Py({points:n,times:t});let i=KGe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Gl({times:t,points:n,inTangents:r,outTangents:o})};Gl.createClampedCubic=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent;if(!c(n)||!c(t)||!c(i)||!c(o))throw new E("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new E("times.length must be equal to points.length.");let r=Ni.getPointType(n[0]);if(r!==Ni.getPointType(i)||r!==Ni.getPointType(o))throw new E("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new Py({points:n,times:t});let s=XGe(n,i,o),a=s.slice(0,s.length-1),l=s.slice(1,s.length);return new Gl({times:t,points:n,inTangents:l,outTangents:a})};Gl.hermiteCoefficientMatrix=new B(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Gl.prototype.findTimeInterval=Ni.prototype.findTimeInterval;var $Ge=new se,uE=new d;Gl.prototype.wrapTime=Ni.prototype.wrapTime;Gl.prototype.clampTime=Ni.prototype.clampTime;Gl.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],l=(e-i[s])/a,u=$Ge;u.z=l,u.y=l*l,u.x=u.y*l,u.w=1;let f=B.multiplyByVector(Gl.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let h=this._pointType;return h===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(c(t)||(t=new h),t=h.multiplyByScalar(n[s],f.x,t),h.multiplyByScalar(n[s+1],f.y,uE),h.add(t,uE,t),h.multiplyByScalar(r[s],f.z,uE),h.add(t,uE,t),h.multiplyByScalar(o[s],f.w,uE),h.add(t,uE,t))};var Iy=Gl;function fE(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new E("points and times are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(fE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});fE.prototype.findTimeInterval=Ni.prototype.findTimeInterval;fE.prototype.wrapTime=Ni.prototype.wrapTime;fE.prototype.clampTime=Ni.prototype.clampTime;fE.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]:(c(t)||(t=new o),o.clone(n[i],t))};var _R=fE;function ZGe(e){let t=e.points,n=e.times;return function(i,o){c(o)||(o=new Le);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],l=t[r+1];return Le.fastSlerp(a,l,s,o)}}function dE(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new E("points and times are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");this._times=n,this._points=t,this._evaluateFunction=ZGe(this),this._lastTimeIndex=0}Object.defineProperties(dE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});dE.prototype.findTimeInterval=Ni.prototype.findTimeInterval;dE.prototype.wrapTime=Ni.prototype.wrapTime;dE.prototype.clampTime=Ni.prototype.clampTime;dE.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var gR=dE;var hE=Tn.AnimatedPropertyType;function tW(e){e=e??W.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;T.typeOf.object("options.channel",t),T.typeOf.object("options.runtimeAnimation",n),T.typeOf.object("options.runtimeNode",i),this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,n5e(this)}Object.defineProperties(tW.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 QGe(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 Iy({times:e,points:n,inTangents:i,outTangents:o})}function cce(e,t,n,i){if(e.length===1&&t.length===1)return new pR(t[0]);switch(n){case ih.STEP:return new _R({times:e,points:t});case ih.CUBICSPLINE:return QGe(e,t);case ih.LINEAR:return i===hE.ROTATION?new gR({times:e,points:t}):new Py({times:e,points:t})}}function JGe(e,t,n,i,o){let r=[];if(i===hE.WEIGHTS){let a=t.length/o,l,u;for(l=0;l<o;l++){let f=new Array(a),h=l;if(n===ih.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<a;u++)f[u]=t[h],h+=o;r.push(cce(e,f,n,i))}}else r.push(cce(e,t,n,i));return r}var e5e=new d,t5e=new Le;function n5e(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,l=e._runtimeNode,u=c(l.morphWeights)?l.morphWeights.length:1,f=JGe(i,o,r,a,u);e._splines=f,e._path=a}tW.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===hE.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let l=t[a],u=i.clampAnimations?l.clampTime(e):l.wrapTime(e);r[a]=l.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===hE.TRANSLATION||n===hE.SCALE?o[n]=r.evaluate(s,e5e):n===hE.ROTATION&&(o[n]=r.evaluate(s,t5e))}}};var yR=tW;function nW(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Q.clone(n.startTime),this._delay=n.delay??0,this._stopTime=Q.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Hl.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new pe,this.update=new pe,this.stop=new pe,this._state=ah.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,i5e(this)}Object.defineProperties(nW.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}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function i5e(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let l=0;l<s;l++){let u=r[l],f=u.target;if(!c(f))continue;let h=f.node.index,p=i._runtimeNodes[h],g=new yR({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}nW.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var bR=nW;function g_(e){this.animationAdded=new pe,this.animationRemoved=new pe,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(g_.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function iW(e,t,n){let i=e._model,o=new bR(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}g_.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new E("Animations are not loaded. Wait for Model.ready to be true.");let n=t.sceneGraph.components.animations;if(!c(e.name)&&!c(e.index))throw new E("Either options.name or options.index must be defined.");if(c(e.multiplier)&&e.multiplier<=0)throw new E("options.multiplier must be greater than zero.");if(c(e.index)&&(e.index>=n.length||e.index<0))throw new E("options.index must be a valid animation index.");let i=e.index;if(c(i))return iW(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}if(!c(i))throw new E("options.name must be a valid animation name.");return iW(this,n[i],e)};g_.prototype.addAll=function(e){e=e??W.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new E("Animations are not loaded. Wait for Model.ready to be true.");if(c(e.multiplier)&&e.multiplier<=0)throw new E("options.multiplier must be greater than zero.");let n=t.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=iW(this,n[r],e);i.push(s)}return i};g_.prototype.remove=function(e){if(!c(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};g_.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])};g_.prototype.contains=function(e){return c(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};g_.prototype.get=function(e){if(!c(e))throw new E("index is required.");if(e>=this._runtimeAnimations.length||e<0)throw new E("index must be valid within the range of the collection");return this._runtimeAnimations[e]};var vz=[];function o5e(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}g_.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];c(a._computedStartTime)||(a._computedStartTime=Q.addSeconds(a.startTime??o,a.delay,new Q)),c(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let l=a._computedStartTime,u=a._duration,f=a.stopTime,h=Q.lessThanOrEquals(l,o),p=c(f)&&Q.greaterThan(o,f),g=0;if(u!==0){let b=Q.secondsDifference(p?f:o,l);g=c(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===Hl.REPEAT||a.loop===Hl.MIRRORED_REPEAT,y=(h||m&&!c(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let b=a._state===ah.STOPPED;if(y!==b)continue}if(a._prevAnimationDelta=g,y||a._state===ah.ANIMATING){if(y&&a._state===ah.STOPPED&&(a._state=ah.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Hl.REPEAT)g=g-Math.floor(g);else if(a.loop===Hl.MIRRORED_REPEAT){let A=Math.floor(g),C=g-A;g=A%2===1?1-C:C}let b=a.startOffset;a.reverse&&(g=1-g,b=-b);let x=g*u*a.multiplier+b;x=O.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=ah.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&vz.push(a))}}n=vz.length;for(let s=0;s<n;++s){let a=vz[s];t.splice(t.indexOf(a),1),e.afterRender.push(o5e(this,r,a))}return vz.length=0,i};var xR=g_;function Px(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(Px.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return c(this._color)||(this._color=new G),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}}});Px.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};Px.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};Px.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};Px.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};Px.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var TR=Px;var AR={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};AR.getStyleCommandsNeeded=function(e,t){return t===0?AR.ALL_OPAQUE:t===e?AR.ALL_TRANSLUCENT:AR.OPAQUE_AND_TRANSLUCENT};var ch=Object.freeze(AR);var Oy={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Oy.is3DTiles=function(e){switch(T.typeOf.string("modelType",e),e){case Oy.TILE_GLTF:case Oy.TILE_B3DM:case Oy.TILE_I3DM:case Oy.TILE_PNTS:case Oy.TILE_GEOJSON:return!0;case Oy.GLTF:return!1;default:throw new E("modelType is not a valid value.")}};var pr=Object.freeze(Oy);function jr(e){let t=e.model,n=e.propertyTable;T.typeOf.object("propertyTable",n),T.typeOf.object("model",t),this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=ch.ALL_OPAQUE,r5e(this)}Object.defineProperties(jr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return c(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function r5e(e){let t=e._model,n=pr.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 Ws(s,o)}else for(o=0;o<i;o++)r[o]=new TR({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new el({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}jr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=ch.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};jr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};jr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};jr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};jr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};jr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};jr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};jr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};jr.prototype.getFeature=function(e){return this._features[e]};jr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};jr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};jr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};jr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};jr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};jr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};jr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};jr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};jr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var s5e=new G;jr.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(el.DEFAULT_COLOR_VALUE),this.setAllShow(el.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=c(e.color)?e.color.evaluateColor(n,s5e)??el.DEFAULT_COLOR_VALUE:el.DEFAULT_COLOR_VALUE,o=c(e.show)?e.show.evaluate(n)??el.DEFAULT_SHOW_VALUE:el.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};jr.prototype.isDestroyed=function(){return!1};jr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var CR=jr;var lce={name:"TilesetPipelineStage"};lce.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ge.FRAGMENT);let r={u_polygonOffset:function(){return H.ZERO}};e.uniformMap=xt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK};var ER=lce;var SR=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}aw.prototype.update=function(e,t,n,i){if(!DTe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,slt(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Oe.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=at.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=alt(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};aw.prototype.isDestroyed=function(){return!1};aw.prototype.destroy=function(){return rlt(this),ue(this)};var l_=aw;function RTe(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}RTe.isSupported=function(e){return l_.isSupported(e.context)};var a0=RTe;var Uc={},clt=new se(0,0,0,1),_l=new se,llt=new et,nee=new U,iee=new U;Uc.worldToWindowCoordinates=function(e,t,n){return Uc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var OTe=new se,MTe=new h;function BF(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,OTe),OTe),s=h.multiplyComponents(t,h.normalize(o,MTe),MTe);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,N.multiplyByVector(n.frustum.projectionMatrix,o,i)}var ult=new he(Math.PI,D.PI_OVER_TWO),flt=new h,dlt=new h;Uc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Uc.computeActualEllipsoidPosition(r,t,clt);if(!l(o))return;let s=e.canvas,a=llt;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=ult,p=f.project(d,flt),g=h.clone(c.position,dlt),m=c.frustum.clone(),y=N.computeViewportTransformation(a,0,1,new N),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(D.sign(b)*p.x-b,0,-c.positionWC.x),T=At.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-b,_l=BF(o,n,c,_l),Uc.clipToGLWindowCoordinates(a,_l,nee),a.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,_l=BF(o,n,c,_l),Uc.clipToGLWindowCoordinates(a,_l,iee)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,_l=BF(o,n,c,_l),Uc.clipToGLWindowCoordinates(a,_l,nee),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,_l=BF(o,n,c,_l),Uc.clipToGLWindowCoordinates(a,_l,iee)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(nee,i),(i.x<0||i.x>s.clientWidth)&&(i.x=iee.x)}}if(r.mode!==re.SCENE2D||u){if(_l=BF(o,n,c,_l),_l.z<0&&!(c.frustum instanceof gn)&&!(c.frustum instanceof ys))return;i=Uc.clipToGLWindowCoordinates(a,_l,i)}return i.y=s.clientHeight-i.y,i};Uc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Uc.worldToWindowCoordinates(e,t,n),!!l(n))return Uc.transformWindowToDrawingBuffer(e,n,n)};var u_=new h,hlt=new he;Uc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,hlt);if(!l(o))return;if(r.project(o,u_),i===re.COLUMBUS_VIEW)return h.fromElements(u_.z,u_.x,u_.y,n);if(i===re.SCENE2D)return h.fromElements(0,u_.x,u_.y,n);let s=e.morphTime;return h.fromElements(D.lerp(u_.z,t.x,s),D.lerp(u_.x,t.y,s),D.lerp(u_.y,t.z,s),n)};var NTe=new h,LTe=new h,FTe=new N;Uc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,NTe),N.computeViewportTransformation(e,0,1,FTe),N.multiplyByPoint(FTe,NTe,LTe),U.fromCartesian3(LTe,n)};Uc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*r,t.y*o,n)};var mlt=new se,BTe=new se;Uc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,mlt);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=N.multiplyByVector(o.inverseViewProjection,f,BTe);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=BTe,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=N.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var hr=Uc;var cw={};cw._deprecationWarning=Yr;var f_=Uint32Array.BYTES_PER_ELEMENT;cw.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=f_;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=f_;let s=r.getUint32(t,!0);t+=f_;let a=r.getUint32(t,!0);t+=f_;let c=r.getUint32(t,!0);t+=f_;let u=r.getUint32(t,!0);t+=f_;let f=r.getUint32(t,!0);t+=f_;let d;u>=570425344?(t-=f_*2,d=a,u=c,f=0,a=0,c=0,cw._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.")):f>=570425344&&(t-=f_,d=u,u=a,f=c,a=0,c=0,cw._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:d??0}:(p=Ro(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Ro(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(cw._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var kF=cw;function UF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function kTe(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function plt(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}UF.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,kTe(this,e,t,n,1,i.byteOffset)):i};UF.prototype.hasProperty=function(e){return l(this.json[e])};UF.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),kTe(this,e,t,n,this.featuresLength,i.byteOffset)):plt(this,e,t,i)};UF.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var Em=UF;function zF(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=glt(n),a;l(s.jsonProperties)&&(a=new a_({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new zT({extension:s.hierarchy,binaryBody:i}));let u=tm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=ylt(t,u,f,i,o);g=A.transcodedSchema,p=[new qT({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=_lt(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new Ld({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let A=new au({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ha(y)}function glt(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(zF._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function _lt(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Jd(p);o[d]={bufferView:a},r[d]=UTe(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=Gl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function ylt(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=xt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=UTe(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Jd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new En.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(zF._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" 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.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=Gl.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function UTe(e){let t=Alt(e.componentType);return{type:e.type,componentType:t}}function Alt(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"}}zF._deprecationWarning=Yr;zF._oneTimeWarning=_t;var d_=zF;var $T={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},blt=En.FeatureIdAttribute,ree=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??zi.Y,f=t.forwardAxis??zi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=$T.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=N.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=kF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new Em(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=N.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new jf({typedArray:t.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=u,this._state=$T.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=$T.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return xlt(f,d)}),this._promise}process(t){if(this._state===$T.READY)return!0;if(this._state!==$T.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=N.multiplyTransformation(this._transform,i.transform,i.transform),Tlt(this,i),this._components=i,this._arrayBuffer=void 0,this._state=$T.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function xlt(e,t){return e.unload(),e._state=$T.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function Tlt(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=d_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new au({name:tm.BATCH_TABLE_CLASS_NAME,count:i});r=new Ha({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)zTe(o[a]);t.structuralMetadata=r}function zTe(e){let t=e.children.length;for(let i=0;i<t;i++)zTe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=xt.getAttributeBySemantic(r,ct.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new blt;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var VF=ree;var oee=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=Llt(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function Elt(){this.lines=void 0,this.points=void 0,this.properties=void 0}function Clt(){this.features=[]}function see(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function aee(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=see(e[r]);return[n]}function vlt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=aee(e[i])[0];return n}function VTe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=aee(e[i])[0];return n}function Slt(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=VTe(e[i]);Zn(n,r)}return n}function wlt(e){return[see(e)]}function Ilt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=see(e[i]);return n}var Plt={LineString:aee,MultiLineString:vlt,MultiPolygon:Slt,Polygon:VTe,MultiPoint:Ilt,Point:wlt},Dlt={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function jTe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Plt[n],r=Dlt[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new Elt;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function Rlt(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)jTe(n[r],t)}var Olt={FeatureCollection:Rlt,Feature:jTe},hG=new h;function Mlt(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let L=e[O];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=je.createTypedArray(i,r),u=je.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let O=0;O<o;O++){let L=e[O];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],P=w.length;for(let M=0;M<P;M++){let F=w[M],V=h.fromDegrees(F.x,F.y,F.z,ee.WGS84,hG),B=N.multiplyByPoint(t,V,hG);h.minimumByComponent(f,B,f),h.maximumByComponent(d,B,d),h.pack(B,s,p*3),a[p]=O,M<P-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new En.Attribute;b.semantic=ct.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new En.Attribute;x.semantic=ct.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],E=new En.Material;E.unlit=!0;let v=new En.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new En.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new En.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function Nlt(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let E=e[T];if(!l(E.points))continue;let v=E.points.length;for(let S=0;S<v;S++){let I=E.points[S],R=h.fromDegrees(I.x,I.y,I.z,ee.WGS84,hG),O=N.multiplyByPoint(t,R,hG);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=tt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new En.Attribute;p.semantic=ct.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new En.Attribute;g.semantic=ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new En.Material;y.unlit=!0;let A=new En.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new En.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function Llt(e,t){let n=new Clt,i=Olt[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let s={};for(let O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(s[C])||(s[C]=new Array(o)))}for(let O=0;O<o;O++){let L=r[O];for(let _ in s)if(s.hasOwnProperty(_)){let C=L.properties[_]??"";s[_][O]=C}}let a=new a_({count:o,properties:s}),u=[new au({id:0,count:o,jsonMetadataTable:a})],f=Gl.fromJson({}),d=new Ha({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<o;O++){let L=r[O];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],P=w.length;for(let M=0;M<P;M++)h.minimumByComponent(p,w[M],p),h.maximumByComponent(g,w[M],g)}}if(l(L.points)){y=!0;let _=L.points.length;for(let C=0;C<_;C++){let w=L.points[C];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,ee.WGS84,new h),x=At.eastNorthUpToFixedFrame(b,ee.WGS84,new N),T=N.inverseTransformation(x,new N),E=[];m&&E.push(Mlt(r,T,t)),y&&E.push(Nlt(r,T,t));let v=new En.Node;v.index=0,v.primitives=E;let S=[v],I=new En.Scene;I.nodes=S;let R=new En.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var jF=oee;var mG={};mG._deprecationWarning=Yr;var BA=Uint32Array.BYTES_PER_ELEMENT;mG.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=BA;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=BA;let s=r.getUint32(t,!0);t+=BA;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=BA;let c=r.getUint32(t,!0);t+=BA;let u=r.getUint32(t,!0);t+=BA;let f=r.getUint32(t,!0);t+=BA;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=BA;let p=Ro(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Ro(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(mG._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var HF=mG;var h_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},pG=En.Attribute,Flt=En.FeatureIdAttribute,GTe=En.Instances,cee=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??zi.Y,f=t.forwardAxis??zi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=h_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=HF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new Em(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=N.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={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(s===0){let p=Bu(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new jf(f);return this._gltfLoader=d,this._state=h_.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=h_.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw Blt(this,p)}),this._promise}process(t){if(this._state===h_.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===h_.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=N.multiplyTransformation(this._transform,r.transform,r.transform),zlt(this,r,t),klt(this,r),this._components=r,this._arrayBuffer=void 0,this._state=h_.READY,!0}isUnloaded(){return this._state===h_.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Wlt(this),this._components=void 0,this._arrayBuffer=void 0,this._state=h_.UNLOADED}};function Blt(e,t){return e.unload(),e._state=h_.FAILED,e.getError("Failed to load i3dm",t)}function klt(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=d_({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new au({name:tm.BATCH_TABLE_CLASS_NAME,count:i});r=new Ha({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var gG=new h,lee=new Array(4),Ult=new N;function zlt(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=jlt(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,E=new Le,v=new Array(4),S=new h,I=new Array(3),R=new N;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let B=ce.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,gG),f[3*i+0]=gG.x,f[3*i+1]=gG.y,f[3*i+2]=gG.z;let j=N.fromTranslation(B.center,Ult);t.transform=N.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(Hlt(r,a,i,E,y,b,A,x,T,R),Le.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(Glt(r,i,S),h.pack(S,I,0),p[3*i+0]=I[0],p[3*i+1]=I[1],p[3*i+2]=I[2]);let B=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(B)||(B=i),g[i]=B}let O=new GTe;O.transformInWorldSpace=!0;let L=e._buffers,_=new pG;if(_.name="Instance Translation",_.semantic=Lo.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Me.STATIC_DRAW});B.vertexArrayDestroyable=!1,L.push(B),_.buffer=B}if(O.attributes.push(_),c){let B=new pG;B.name="Instance Rotation",B.semantic=Lo.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new pG;if(B.name="Instance Scale",B.semantic=Lo.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});j.vertexArrayDestroyable=!1,L.push(j),B.buffer=j}O.attributes.push(B)}let C=new pG;C.name="Instance Feature ID",C.setIndex=0,C.semantic=Lo.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=tt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),C.buffer=w,O.attributes.push(C);let P=new Flt;P.propertyTableId=0,P.setIndex=0,P.positionalLabel="instanceFeatureId_0",O.featureIds.push(P);let M=t.nodes,F=M.length,V=!1;for(i=0;i<F;i++){let B=M[i];B.primitives.length>0&&(B.instances=V?Vlt(O):O,V=!0)}}function Vlt(e){let t=new GTe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Je(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function jlt(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=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;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var HTe=new Array(4);function Hlt(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,lee),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,HTe),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,lee),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,HTe);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");cn.octDecodeInRange(g[0],g[1],65535,o),cn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(r,ee.WGS84,u),N.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function Glt(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,lee);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Wlt(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var GF=cee;var WTe={STOPPED:0,ANIMATING:1};Object.freeze(WTe);var Cm=WTe;var lw=En.AnimatedPropertyType;function uee(e){e=e??H.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,$lt(this)}Object.defineProperties(uee.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 qlt(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new Hy({times:e,points:n,inTangents:i,outTangents:r})}function qTe(e,t,n,i){if(e.length===1&&t.length===1)return new TM(t[0]);switch(n){case am.STEP:return new ON({times:e,points:t});case am.CUBICSPLINE:return qlt(e,t);case am.LINEAR:return i===lw.ROTATION?new xN({times:e,points:t}):new jy({times:e,points:t})}}function Ylt(e,t,n,i,r){let o=[];if(i===lw.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===am.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(qTe(e,f,n,i))}}else o.push(qTe(e,t,n,i));return o}var Xlt=new h,Klt=new Le;function $lt(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=Ylt(i,r,o,a,u);e._splines=f,e._path=a}uee.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===lw.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===lw.TRANSLATION||n===lw.SCALE?r[n]=o.evaluate(s,Xlt):n===lw.ROTATION&&(r[n]=o.evaluate(s,Klt))}}};var WF=uee;function fee(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Ku.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Cm.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,Jlt(this)}Object.defineProperties(fee.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}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function Jlt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new WF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}fee.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var qF=fee;function m_(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(m_.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function dee(e,t,n){let i=e._model,r=new qF(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}m_.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return dee(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return dee(this,n[i],e)};m_.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=dee(this,n[o],e);i.push(s)}return i};m_.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};m_.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])};m_.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};m_.prototype.get=function(e){return this._runtimeAnimations[e]};var _G=[];function Zlt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}m_.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=K.addSeconds(a.startTime??r,a.delay,new K)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,A):A/u}let m=a.loop===Ku.REPEAT||a.loop===Ku.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===Cm.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===Cm.ANIMATING){if(y&&a._state===Cm.STOPPED&&(a._state=Cm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Ku.REPEAT)g=g-Math.floor(g);else if(a.loop===Ku.MIRRORED_REPEAT){let x=Math.floor(g),T=g-x;g=x%2===1?1-T:T}let A=a.startOffset;a.reverse&&(g=1-g,A=-A);let b=g*u*a.multiplier+A;b=D.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Cm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&_G.push(a))}}n=_G.length;for(let s=0;s<n;++s){let a=_G[s];t.splice(t.indexOf(a),1),e.afterRender.push(Zlt(this,o,a))}return _G.length=0,i};var YF=m_;function JT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(JT.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 z),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}}});JT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};JT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};JT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};JT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};JT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var XF=JT;var uw={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};uw.getStyleCommandsNeeded=function(e,t){return t===0?uw.ALL_OPAQUE:t===e?uw.ALL_TRANSLUCENT:uw.OPAQUE_AND_TRANSLUCENT};Object.freeze(uw);var vm=uw;var p_={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};p_.is3DTiles=function(e){switch(e){case p_.TILE_GLTF:case p_.TILE_B3DM:case p_.TILE_I3DM:case p_.TILE_PNTS:case p_.TILE_GEOJSON:return!0;case p_.GLTF:return!1}};Object.freeze(p_);var Yo=p_;function Ps(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=vm.ALL_OPAQUE,Qlt(this)}Object.defineProperties(Ps.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 Qlt(e){let t=e._model,n=Yo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new sa(s,r)}else for(r=0;r<i;r++)o[r]=new XF({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new su({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Ps.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=vm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Ps.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Ps.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Ps.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Ps.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Ps.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Ps.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Ps.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Ps.prototype.getFeature=function(e){return this._features[e]};Ps.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Ps.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Ps.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Ps.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Ps.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Ps.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Ps.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Ps.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Ps.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var eut=new z;Ps.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(su.DEFAULT_COLOR_VALUE),this.setAllShow(su.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,eut)??su.DEFAULT_COLOR_VALUE:su.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??su.DEFAULT_SHOW_VALUE:su.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};Ps.prototype.isDestroyed=function(){return!1};Ps.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var KF=Ps;var YTe={name:"TilesetPipelineStage"};YTe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,de.FRAGMENT);let o={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Ot(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var $F=YTe;var JF=`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; @@ -3949,7 +5039,7 @@ applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); } else { } } -`;var wR=`void atmosphereStage(ProcessedAttributes attributes) { +`;var ZF=`void atmosphereStage(ProcessedAttributes attributes) { vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); czm_computeGroundAtmosphereScattering( v_positionWC, @@ -3959,7 +5049,7 @@ v_atmosphereMieColor, v_atmosphereOpacity ); } -`;var uce={name:"AtmospherePipelineStage"};uce.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ge.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([wR]),i.addFragmentLines([SR]),i.addUniform("bool","u_isInFog",ge.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return O.fog(o,n.fog.density)>O.EPSILON3}};var vR=uce;var DR=`#ifdef DIFFUSE_IBL +`;var XTe={name:"AtmospherePipelineStage"};XTe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,de.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([ZF]),i.addFragmentLines([JF]),i.addUniform("bool","u_isInFog",de.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(r,n.fog.density)>D.EPSILON3}};var QF=XTe;var eB=`#ifdef DIFFUSE_IBL vec3 sampleDiffuseEnvironment(vec3 cubeDir) { #ifdef CUSTOM_SPHERICAL_HARMONICS @@ -4034,14 +5124,14 @@ vec3 specularContribution = vec3(0.0); return diffuseContribution + specularContribution; } #endif -`;var fce={name:"ImageBasedLightingPipelineStage"},a5e=new H;fce.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;c(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Yd.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),c(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),c(a)&&c(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),c(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||c(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(DR);let l={model_iblFactor:function(){return H.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,a5e)},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}};c(s)&&(l.model_specularEnvironmentMaps=function(){return s},l.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=xt(l,e.uniformMap)};var PR=fce;var c5e=O.EPSILON16;function rW(e){e=e??W.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;T.typeOf.object("options.stage",t),T.typeOf.object("options.runtimeArticulation",n),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(rW.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){T.typeOf.number("value",e),e=O.clamp(e,this.minimumValue,this.maximumValue),O.equalsEpsilon(this._currentValue,e,c5e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var l5e=new d,oW=new J;rW.prototype.applyStageToMatrix=function(e){T.typeOf.object("result",e);let t=this.type,n=this.currentValue,i=l5e,o;switch(t){case xc.XROTATE:o=J.fromRotationX(O.toRadians(n),oW),e=B.multiplyByMatrix3(e,o,e);break;case xc.YROTATE:o=J.fromRotationY(O.toRadians(n),oW),e=B.multiplyByMatrix3(e,o,e);break;case xc.ZROTATE:o=J.fromRotationZ(O.toRadians(n),oW),e=B.multiplyByMatrix3(e,o,e);break;case xc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case xc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=B.multiplyByTranslation(e,i,e);break;case xc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=B.multiplyByTranslation(e,i,e);break;case xc.XSCALE:i.x=n,i.y=1,i.z=1,e=B.multiplyByScale(e,i,e);break;case xc.YSCALE:i.x=1,i.y=n,i.z=1,e=B.multiplyByScale(e,i,e);break;case xc.ZSCALE:i.x=1,i.y=1,i.z=n,e=B.multiplyByScale(e,i,e);break;case xc.UNIFORMSCALE:e=B.multiplyByUniformScale(e,n,e);break;default:break}return e};var IR=rW;function Dz(e){e=e??W.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;T.typeOf.object("options.articulation",t),T.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,u5e(this)}Object.defineProperties(Dz.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 u5e(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],l=new IR({stage:a,runtimeArticulation:e});o.push(l);let u=a.name;r[u]=l}}Dz.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];c(n)&&(n.currentValue=t)};var f5e=new B,d5e=new B;Dz.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=B.clone(B.IDENTITY,f5e),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=B.multiplyTransformation(s.originalTransform,e,d5e);s.transform=a}};var OR=Dz;var RR=`void modelColorStage(inout czm_modelMaterial material) +`;var KTe={name:"ImageBasedLightingPipelineStage"},tut=new U;KTe.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=r.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,de.FRAGMENT),o.addUniform("vec2","model_iblFactor",de.FRAGMENT),ym.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",de.FRAGMENT),l(s)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),l(a)&&l(a[0])?(o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,de.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",de.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,de.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",de.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",de.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT)),o.addFragmentLines(eB);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,tut)},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 r.maximumMipmapLevel}),e.uniformMap=Ot(c,e.uniformMap)};var tB=KTe;var nut=D.EPSILON16;function mee(e){e=e??H.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(mee.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=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,nut)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var iut=new h,hee=new $;mee.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=iut,r;switch(t){case Qc.XROTATE:r=$.fromRotationX(D.toRadians(n),hee),e=N.multiplyByMatrix3(e,r,e);break;case Qc.YROTATE:r=$.fromRotationY(D.toRadians(n),hee),e=N.multiplyByMatrix3(e,r,e);break;case Qc.ZROTATE:r=$.fromRotationZ(D.toRadians(n),hee),e=N.multiplyByMatrix3(e,r,e);break;case Qc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case Qc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case Qc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case Qc.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case Qc.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case Qc.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case Qc.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};var nB=mee;function yG(e){e=e??H.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,rut(this)}Object.defineProperties(yG.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 rut(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new nB({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}yG.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var out=new N,sut=new N;yG.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,out),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=N.multiplyTransformation(s.originalTransform,e,sut);s.transform=a}};var iB=yG;var rB=`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 mE={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};mE.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ge.FRAGMENT),i.addFragmentLines(RR);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=De.TRANSLUCENT),i.addUniform("vec4",mE.COLOR_UNIFORM_NAME,ge.FRAGMENT),o[mE.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",mE.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),o[mE.COLOR_BLEND_UNIFORM_NAME]=function(){return bc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=xt(o,e.uniformMap)};var Ry=mE;var MR=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +`;var fw={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};fw.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(rB);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ie.TRANSLUCENT),i.addUniform("vec4",fw.COLOR_UNIFORM_NAME,de.FRAGMENT),r[fw.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",fw.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[fw.COLOR_BLEND_UNIFORM_NAME]=function(){return gl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var kA=fw;var oB=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE vec4 getClippingPlane( highp sampler2D packedClippingPlanes, int clippingPlaneNumber, @@ -4120,35 +5210,253 @@ if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } -`;var dce={name:"ModelClippingPlanesPipelineStage"},h5e=new H;dce.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=gs.getTextureResolution(i,o,h5e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(MR);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let l=G.clone(i.edgeColor);return l.alpha=i.edgeWidth,l},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var LR=dce;var NR=`void modelClippingPolygonsStage(ProcessedAttributes attributes) +`;var $Te={name:"ModelClippingPlanesPipelineStage"},aut=new U,cut=new N,lut=new N;$Te.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,de.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,de.FRAGMENT),Is.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Is.getTextureResolution(i,r,aut);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,de.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",de.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",de.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",de.FRAGMENT),o.addFragmentLines(oB);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=N.transpose(r.uniformState.inverseView3D,cut);return N.multiply(c,t._clippingPlanesMatrix,lut)}};e.uniformMap=Ot(a,e.uniformMap)};var sB=$Te;var aB=`void modelClippingPolygonsStage() { -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; +bool insideAny = vectorClip(v_clippingUv); +#ifdef CLIPPING_INVERSE +if (!insideAny) +{ +discard; +} +#else +if (insideAny) +{ +discard; +} +#endif +} +`;var cB=`void modelClippingPolygonsStage() +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; +} +`;var g_=`uniform highp sampler2D u_vectorColorTexture; +uniform highp sampler2D u_vectorPickColorTexture; +int vectorPickPrimitiveIndex = -1; +#ifdef HAS_VECTOR_POLYLINES +uniform highp sampler2D u_vectorSegmentTexture; +uniform highp sampler2D u_vectorWidthTexture; +uniform highp sampler2D u_vectorSegmentPrimitiveIndicesTexture; +uniform highp sampler2D u_vectorGridCellIndicesTexture; +#ifdef VECTOR_WIDTH_IN_METERS +uniform vec2 u_vectorMetersPerUv; +#endif +#endif +#ifdef HAS_VECTOR_POLYGONS +uniform highp sampler2D u_vectorPolygonEdgeTexture; +uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture; +uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture; +#endif +uniform highp sampler2D u_clippingEdgeTexture; +uniform highp sampler2D u_clippingEdgePrimitiveIndicesTexture; +uniform highp sampler2D u_clippingGridCellIndicesTexture; +vec2 vectorOffsetToLine(vec2 p, vec4 line) +{ +vec2 a = line.xy; +vec2 b = line.zw; +vec2 ab = b - a; +float abLengthSquared = dot(ab, ab); +if (abLengthSquared < 1.0e-8) +{ +return p - a; +} +float t = clamp(dot(p - a, ab) / abLengthSquared, 0.0, 1.0); +return p - (a + t * ab); +} +ivec2 vectorIndexToUv(int index, ivec2 size) +{ +int v = index / size.x; +int u = index - v * size.x; +return ivec2(u, v); +} +ivec2 vectorCellRange(vec2 uv, highp sampler2D gridCellIndicesTexture) +{ +ivec2 headerSize = textureSize(gridCellIndicesTexture, 0); +if (headerSize.x * headerSize.y < 3) +{ +return ivec2(0); +} +int gridWidth = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r); +int gridHeight = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r); +int cellX = clamp(int(uv.x * float(gridWidth)), 0, gridWidth - 1); +int cellY = clamp(int(uv.y * float(gridHeight)), 0, gridHeight - 1); +int cellIndex = cellX + cellY * gridWidth; +int indexEnd = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r); +int indexStart = cellIndex == 0 +? 0 +: int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r); +return ivec2(indexStart, indexEnd); +} +#ifdef VECTOR_ANTIALIAS +const float vectorCoverageRadius = 0.5; +#else +const float vectorCoverageRadius = 0.0; +#endif +vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor) +{ +#ifdef HAS_VECTOR_POLYLINES +mat2 screenFromUv = inverse(mat2(dFdx(vectorUv), dFdy(vectorUv))); +#ifdef VECTOR_WIDTH_IN_METERS +mat2 metersFromUv = mat2(u_vectorMetersPerUv.x, 0.0, 0.0, u_vectorMetersPerUv.y); +float pixelsPerMeter = 1.0 / max( +length(metersFromUv * dFdx(vectorUv)), +length(metersFromUv * dFdy(vectorUv))); +#endif +ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0); +if (headerSize.x * headerSize.y < 3) +{ +return baseColor; +} +ivec2 range = vectorCellRange(vectorUv, u_vectorGridCellIndicesTexture); +ivec2 segmentTextureSize = textureSize(u_vectorSegmentTexture, 0); +ivec2 primitiveTextureSize = textureSize(u_vectorWidthTexture, 0); +float nearestEdgeDistance = 1.0e30; +int nearestPrimitiveIndex = -1; +for (int i = range.x; i < range.y; i++) +{ +ivec2 segmentUv = vectorIndexToUv(i, segmentTextureSize); +vec4 segment = texelFetch(u_vectorSegmentTexture, segmentUv, 0); +int primitiveIndex = int(texelFetch(u_vectorSegmentPrimitiveIndicesTexture, segmentUv, 0).r); +ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize); +float width = texelFetch(u_vectorWidthTexture, primitiveUv, 0).r; +float halfWidth = abs(width) * 0.5; +vec2 offsetToLine = vectorOffsetToLine(vectorUv, segment); +#if defined(VECTOR_WIDTH_MIXED_UNITS) +float edgeDistance = width < 0.0 +? (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter +: length(screenFromUv * offsetToLine) - halfWidth; +#elif defined(VECTOR_WIDTH_IN_METERS) +float edgeDistance = (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter; +#else +float edgeDistance = length(screenFromUv * offsetToLine) - halfWidth; +#endif +if (edgeDistance < nearestEdgeDistance) +{ +nearestEdgeDistance = edgeDistance; +nearestPrimitiveIndex = primitiveIndex; +} +if (nearestEdgeDistance <= -vectorCoverageRadius) +{ +break; +} +} +if (nearestEdgeDistance > vectorCoverageRadius) +{ +return baseColor; +} +#ifdef VECTOR_ANTIALIAS +float coverage = 1.0 - smoothstep(-vectorCoverageRadius, vectorCoverageRadius, nearestEdgeDistance); +#else +float coverage = 1.0; +#endif +vectorPickPrimitiveIndex = nearestPrimitiveIndex; +ivec2 primitiveUv = vectorIndexToUv(nearestPrimitiveIndex, primitiveTextureSize); +vec4 vectorColor = texelFetch(u_vectorColorTexture, primitiveUv, 0); +vectorColor.a *= coverage; +return vectorColor * vec4(vectorColor.aaa, 1.0) + baseColor * (1.0 - vectorColor.a); +#else +return baseColor; +#endif +} +vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize) +{ +if (!inside || primitiveIndex < 0) +{ +return baseColor; +} +vectorPickPrimitiveIndex = primitiveIndex; +ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize); +vec4 fillColor = texelFetch(u_vectorColorTexture, primitiveUv, 0); +return fillColor * vec4(fillColor.aaa, 1.0) + baseColor * (1.0 - fillColor.a); +} +bool vectorEdgeCrossesRay(vec4 edge, vec2 p) +{ +if ((edge.y > p.y) == (edge.w > p.y)) +{ +return false; +} +float t = (p.y - edge.y) / (edge.w - edge.y); +float xIntersect = edge.x + t * (edge.z - edge.x); +return p.x < xIntersect; +} +vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor) +{ +#ifdef HAS_VECTOR_POLYGONS +ivec2 range = vectorCellRange(vectorUv, u_vectorPolygonGridCellIndicesTexture); +ivec2 edgeTextureSize = textureSize(u_vectorPolygonEdgeTexture, 0); +ivec2 primitiveTextureSize = textureSize(u_vectorColorTexture, 0); +int currentPrimitive = -1; +bool inside = false; +for (int i = range.x; i < range.y; i++) +{ +ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); +vec4 edge = texelFetch(u_vectorPolygonEdgeTexture, edgeUv, 0); +int primitiveIndex = int(texelFetch(u_vectorPolygonEdgePrimitiveIndicesTexture, edgeUv, 0).r); +if (primitiveIndex != currentPrimitive) +{ +baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); +currentPrimitive = primitiveIndex; +inside = false; +} +if (vectorEdgeCrossesRay(edge, vectorUv)) +{ +inside = !inside; +} +} +baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); +return baseColor; +#else +return baseColor; +#endif +} +vec4 vectorPickColorOver(vec4 surfacePickColor) +{ +if (vectorPickPrimitiveIndex < 0) +{ +return surfacePickColor; +} +ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0); +return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0); +} +bool vectorClip(vec2 uv) +{ +uv = clamp(uv, vec2(0.0), vec2(1.0)); +ivec2 range = vectorCellRange(uv, u_clippingGridCellIndicesTexture); +ivec2 edgeTextureSize = textureSize(u_clippingEdgeTexture, 0); +int currentPrimitive = -1; +bool inside = false; +for (int i = range.x; i < range.y; i++) +{ +ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); +int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r); +if (primitiveIndex != currentPrimitive) +{ +if (inside) +{ +return true; +} +currentPrimitive = primitiveIndex; +inside = false; +} +vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0); +if (vectorEdgeCrossesRay(edge, uv)) +{ +inside = !inside; } -float threshold = 0.01; -if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { -v_regionIndex = regionIndex; } +return inside; } +`;var ZTe={name:"ModelClippingPolygonsPipelineStage"},uut=new U,fut=new U,JTe=ie.MAX_VALUE;ZTe.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,de.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,de.FRAGMENT),r.addVarying("vec2","v_clippingUv"),r.addUniform("vec2","u_clippingCameraUv",de.VERTEX),r.addUniform("vec2","u_clippingRectangleInverseSize",de.VERTEX),r.addVertexLines(cB),r.addFragmentLines(g_),r.addFragmentLines(aB);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??JTe,a=s.width*.5,c=s.west+a,u=n.camera.positionCartographic,f=D.negativePiToPi(u.longitude-c)+a;return U.fromElements(f/s.width,(u.latitude-s.south)/s.height,uut)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??JTe;return U.fromElements(1/s.width,1/s.height,fut)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=Ot(o,e.uniformMap)};var lB=ZTe;var uB=`void modelVectorLookupStage(ProcessedAttributes attributes) +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; } -`;var FR=`void modelClippingPolygonsStage() +`;var fB=`void modelVectorLookupStage(inout vec4 color) { -vec2 clippingPosition = v_clippingPosition; -int regionIndex = v_regionIndex; -czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +color = vectorPolygonRender(v_vectorUv, color); +color = vectorPolylineRender(v_vectorUv, color); } -`;var hce={name:"ModelClippingPolygonsPipelineStage"};hce.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(NR),o.addFragmentLines(FR);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=xt(r,e.uniformMap)};var BR=hce;function mce(e,t){T.typeOf.object("model",e),T.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties(mce.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){c(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 kR=mce;var UR=`mat4 getInstancingTransform() +`;var dut={name:"ModelVectorLookupPipelineStage",process:put},hut=new U,mut=new U;function put(e,t,n){let i=e.shaderBuilder,r=t._vectorData,o=r.hasPolylines,s=r.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,de.BOTH),o&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,de.FRAGMENT),r.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,de.FRAGMENT),r.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",de.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",de.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",de.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(uB),i.addFragmentLines(g_),i.addFragmentLines(fB);let a=r.rectangle,c=function(){return n.context.defaultTexture},u={u_vectorCameraUv:function(){let f=t._vectorData?.rectangle??a,d=n.camera.positionCartographic,p=f.width*.5,g=f.west+p,m=D.negativePiToPi(d.longitude-g)+p;return U.fromElements(m/f.width,(d.latitude-f.south)/f.height,hut)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,mut)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};o&&(u.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},u.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},u.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},u.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},r.hasMeterWidths&&(u.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(u.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},u.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},u.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=Ot(u,e.uniformMap)}var dB=dut;function QTe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(QTe.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 hB=QTe;var mB=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES @@ -4206,7 +5514,7 @@ translation2D.x, translation2D.y, translation2D.z, 1.0 return instancingTransform2D; } #endif -`;var VR=`void instancingStage(inout ProcessedAttributes attributes) +`;var pB=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); @@ -4220,7 +5528,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var zR=`void legacyInstancingStage( +`;var gB=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) @@ -4236,7 +5544,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var Pz=new B,m5e=new B,p5e=new B,_ce={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Tce,_transformsToTypedArray:aW};_ce.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(UR);let s=e.model,a=s.sceneGraph,l=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];I5e(e,n,i,h,u,f),M5e(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=B.multiplyTransformation(s.modelMatrix,a.components.transform,Pz);return u?B.multiplyTransformation(n.context.uniformState.view3D,g,Pz):(n.mode!==oe.SCENE3D&&(g=Ot.basisTo2D(n.mapProjection,g,Pz)),B.multiplyTransformation(n.context.uniformState.view,g,Pz))},p.u_instance_nodeTransform=function(){return B.multiplyTransformation(a.axisCorrectionMatrix,l.computedTransform,m5e)},r.addVertexLines(zR)):r.addVertexLines(VR),u){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,m=B.fromTranslation(l.instancingReferencePoint2D,new B);p.u_modelView2D=function(){return B.multiplyTransformation(g.uniformState.view,m,p5e)}}e.uniformMap=xt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var HR=new B,_5e=new d;function g5e(e,t,n,i,o){let r=B.multiplyTransformation(t,e,HR);return r=B.multiplyTransformation(r,n,HR),o=Ot.basisTo2D(i.mapProjection,r,o),o}function y5e(e,t,n,i,o){let r=B.fromTranslation(e,HR),s=B.multiplyTransformation(t,r,HR);s=B.multiplyTransformation(s,n,HR);let a=B.getTranslation(s,_5e);return o=Gi.computeActualEllipsoidPosition(i,a,o),o}function gce(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=B.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=B.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=B.clone(o.computedModelMatrix,t),t=B.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=B.clone(B.IDENTITY,n))}var yce=new B,bce=new B,b5e=new B,x5e=new d;function T5e(e,t,n,i){let o=yce,r=bce;gce(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u<l;u++){let f=e[u],h=g5e(f,o,r,n,b5e),p=B.getTranslation(h,x5e),g=d.subtract(p,a,p);i[u]=B.setTranslation(h,g,i[u])}return i}function A5e(e,t,n,i){let o=yce,r=bce;gce(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u<l;u++){let f=e[u],h=y5e(f,o,r,n,f);i[u]=d.subtract(h,a,i[u])}return i}var C5e=new d,E5e=new d;function xce(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=B.multiplyByPoint(i,n.instancingTranslationMin,C5e),r=Gi.computeActualEllipsoidPosition(t,o,o),s=B.multiplyByPoint(i,n.instancingTranslationMax,E5e),a=Gi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=d.lerp(r,a,.5,new d)}function aW(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 S5e(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 w5e=new d,v5e=new Le,D5e=new d;function Tce(e,t,n){let i=new Array(t),o=$t.getAttributeBySemantic(e,rs.TRANSLATION),r=$t.getAttributeBySemantic(e,rs.ROTATION),s=$t.getAttributeBySemantic(e,rs.SCALE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=c(o),f=c(r),h=c(s),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=Ln.dequantize(g,r.componentDatatype,r.type,t));let m;h?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let x=new d(p[b*3],p[b*3+1],p[b*3+2],w5e);d.maximumByComponent(a,x,a),d.minimumByComponent(l,x,l);let A=new Le(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,v5e),C=new d(m[b*3],m[b*3+1],m[b*3+2],D5e),S=B.fromTranslationQuaternionRotationScale(x,A,C,new B);i[b]=S}let y=n.runtimeNode;return y.instancingTranslationMin=l,y.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function P5e(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<t;l++){let u=new d(o[l*3],o[l*3+1],o[l*3+2]);i[l]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function cW(e,t){let n=yt.createVertexBuffer({context:t.context,typedArray:e,usage:Be.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function I5e(e,t,n,i,o,r){let s=$t.getAttributeBySemantic(n,rs.ROTATION);c(s)?O5e(e,n,i,t,o,r):R5e(e,n,i,t,o)}function O5e(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,l=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!c(p)){h=Tce(t,a,e);let b=aW(h);p=cW(b,i),l._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(pce(e,p,n,f),!o)return;let g=je(i);g.mode=oe.COLUMBUS_VIEW,xce(e,g);let m=u.instancingTransformsBuffer2D;if(!c(m)){let b=T5e(h,e,g,h),x=aW(b);m=cW(x,i),l._modelResources.push(m),u.instancingTransformsBuffer2D=m}pce(e,m,n,"Transform2D")}function R5e(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,l=$t.getAttributeBySemantic(t,rs.TRANSLATION),u=$t.getAttributeBySemantic(t,rs.SCALE);if(c(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),sW(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!c(l))return;let f,h=l.typedArray;if(c(h)?f=P5e(l,l.count,e):c(a.instancingTranslationMin)||(a.instancingTranslationMin=l.min,a.instancingTranslationMax=l.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),sW(e,l.buffer,l.byteOffset,l.byteStride,n,"Translation"),!o&&!r)return;let g=je(i);g.mode=oe.COLUMBUS_VIEW,xce(e,g);let m=a.instancingTranslationBuffer2D;if(!c(m)){let A=A5e(f,e,g,f),C=S5e(A);r&&(a.transformsTypedArray=C),m=cW(C,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;sW(e,m,0,void 0,n,"Translation2D")}function pce(e,t,n,i){let r=$.getSizeInBytes($.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],l=e.shaderBuilder;l.addAttribute("vec4",`a_instancing${i}Row0`),l.addAttribute("vec4",`a_instancing${i}Row1`),l.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function sW(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function M5e(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===rs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:nn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var GR=_ce;var lW={};lW.name="ModelMatrixUpdateStage";lW.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;Ace(e,t,o,e.transformToRoot),e._transformDirty=!1}};function L5e(e,t,n){e.modelMatrix=B.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=$t.getCullFace(e.modelMatrix,e.primitiveType)}function Ace(e,t,n,i){let o;i=B.multiplyTransformation(i,e.transform,new B),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];L5e(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=B.clone(i,a._transformToRoot),Ace(a,t,n,i),a._transformDirty=!1}}var jR=lW;var Cce={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Ece,_countGeneratedBuffers:Sce};Cce.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Ece(i,o),Sce(i,r)};function Ece(e,t){if(!c(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Sce(e,t){c(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),c(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),c(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var WR=Cce;function pE(e){e=e??W.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;T.typeOf.object("options.node",t),T.typeOf.object("options.transform",n),T.typeOf.object("options.transformToRoot",i),T.typeOf.object("options.sceneGraph",o),T.typeOf.object("options.children",r),this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=B.clone(n,this._originalTransform),this._transform=B.clone(n,this._transform),this._transformToRoot=B.clone(i,this._transformToRoot),this._computedTransform=new B,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,N5e(this)}Object.defineProperties(pE.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=B.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 c(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new E("The translation of a node cannot be set if it was defined using a matrix in the model.");let n=t.translation;d.equals(n,e)||(t.translation=d.clone(e,t.translation),uW(this,t))}},rotation:{get:function(){return c(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new E("The rotation of a node cannot be set if it was defined using a matrix in the model.");let n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),uW(this,t))}},scale:{get:function(){return c(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new E("The scale of a node cannot be set if it was defined using a matrix in the model.");let n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),uW(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;if(this._morphWeights.length!==t)throw new E("value must have the same length as the original weights array.");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 N5e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=B.multiply(n,t,i);let o=e.node;c(o.matrix)||(e._transformParameters=new iy(o.translation,o.rotation,o.scale)),c(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(c(r)){let l=e.sceneGraph._runtimeArticulations[r];c(l)&&l.runtimeNodes.push(e)}}function uW(e,t){e._transformDirty=!0,e._transform=B.fromTranslationRotationScale(t,e._transform)}pE.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>=this.children.length)throw new E("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]};pE.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,c(e.instances)&&t.push(GR),t.push(WR),n.push(jR)};pE.prototype.updateComputedTransform=function(){this._computedTransform=B.multiply(this._transformToRoot,this._transform,this._computedTransform)};pE.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!c(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){c(t[o])||(t[o]=new B);let r=B.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=B.inverseTransformation(r,t[o]);t[o]=B.multiplyTransformation(s,n[o],t[o])}};var qR=pE;var wce={name:"AlphaPipelineStage"};wce.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===De.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=ln.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;c(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ge.FRAGMENT),s.addUniform("float","u_alphaCutoff",ge.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var YR=wce;var vce={name:"BatchTexturePipelineStage"};vce.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 l=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return l.batchTexture??l.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return l.textureStep},l.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var XR=vce;var Dce={name:"ClassificationPipelineStage"};Dce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;c(o.batchLengths)||F5e(t,o)};function F5e(e,t){let n=$t.getAttributeBySemantic(e,ht.POSITION);if(!c(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=c(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=$t.getAttributeBySemantic(e,ht.FEATURE_ID,0);if(!c(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let l=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=l[h],g=0;for(let y=1;y<s;y++){let b=r?i[y]:y,x=l[b];if(x!==p){let A=y-g,C=y;u.push(A),f.push(C),g=C,p=x}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var KR=Dce;var $R=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +`;var AG=new N,gut=new N,_ut=new N,tEe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:sEe,_transformsToTypedArray:gee};tEe.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(mB);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];Out(e,n,i,d,u,f),Lut(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",de.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",de.VERTEX),p.u_instance_modifiedModelView=function(){let g=N.multiplyTransformation(s.modelMatrix,a.components.transform,AG);return u?N.multiplyTransformation(n.context.uniformState.view3D,g,AG):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,AG)),N.multiplyTransformation(n.context.uniformState.view,g,AG))},p.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,gut)},o.addVertexLines(gB)):o.addVertexLines(pB),u){o.addDefine("USE_2D_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_modelView2D",de.VERTEX);let g=n.context,m=N.fromTranslation(c.instancingReferencePoint2D,new N);p.u_modelView2D=function(){return N.multiplyTransformation(g.uniformState.view,m,_ut)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Zn(e.attributes,d)};var _B=new N,yut=new h;function Aut(e,t,n,i,r){let o=N.multiplyTransformation(t,e,_B);return o=N.multiplyTransformation(o,n,_B),r=At.basisTo2D(i.mapProjection,o,r),r}function but(e,t,n,i,r){let o=N.fromTranslation(e,_B),s=N.multiplyTransformation(t,o,_B);s=N.multiplyTransformation(s,n,_B);let a=N.getTranslation(s,yut);return r=hr.computeActualEllipsoidPosition(i,a,r),r}function nEe(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(N.multiplyTransformation(i.modelMatrix,r.components.transform,t),N.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=N.clone(r.computedModelMatrix,t),N.multiplyTransformation(t,e.runtimeNode.computedTransform,t),N.clone(N.IDENTITY,n))}var iEe=new N,rEe=new N,xut=new N,Tut=new h;function Eut(e,t,n,i){let r=iEe,o=rEe;nEe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Aut(f,r,o,n,xut),p=N.getTranslation(d,Tut),g=h.subtract(p,a,p);i[u]=N.setTranslation(d,g,i[u])}return i}function Cut(e,t,n,i){let r=iEe,o=rEe;nEe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=but(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var vut=new h,Sut=new h;function oEe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=N.multiplyByPoint(i,n.instancingTranslationMin,vut),o=hr.computeActualEllipsoidPosition(t,r,r),s=N.multiplyByPoint(i,n.instancingTranslationMax,Sut),a=hr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function gee(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function wut(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var Iut=new h,Put=new Le,Dut=new h;function sEe(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,Lo.TRANSLATION),o=xt.getAttributeBySemantic(e,Lo.ROTATION),s=xt.getAttributeBySemantic(e,Lo.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=cn.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],Iut);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let x=new Le(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,Put),T=new h(m[A*3],m[A*3+1],m[A*3+2],Dut),E=N.fromTranslationQuaternionRotationScale(b,x,T,new N);i[A]=E}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function Rut(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function _ee(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Out(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Lo.ROTATION);l(s)||o?Mut(e,n,i,t,r,o):Nut(e,n,i,t,r)}function Mut(e,t,n,i,r,o){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=sEe(t,a,e);let A=gee(d);p=_ee(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(eEe(e,p,n,f),!r)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,oEe(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=Eut(d,e,g,d),b=gee(A);m=_ee(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}eEe(e,m,n,"Transform2D")}function Nut(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,Lo.TRANSLATION),u=xt.getAttributeBySemantic(t,Lo.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),pee(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=Rut(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),pee(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,oEe(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=Cut(f,e,g,f),T=wut(x);o&&(a.transformsTypedArray=T),m=_ee(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;pee(e,m,0,void 0,n,"Translation2D")}function eEe(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*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`),Zn(n,a)}function pee(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function Lut(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===Lo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Vt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var yB=tEe;var aEe=[],yee={};yee.name="ModelMatrixUpdateStage";yee.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let r=i?t._computedModelMatrix2D:t._computedModelMatrix;cEe(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function Fut(e,t,n){e.modelMatrix=N.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function cEe(e,t,n,i,r){let o,s=aEe[r];l(s)||(s=aEe[r]=new N),i=N.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(o=0;o<a;o++){let u=e.runtimePrimitives[o];Fut(u.drawCommand,n,i)}let c=e.children.length;for(o=0;o<c;o++){let u=t._runtimeNodes[e.children[o]];if(u._transformToRoot=N.clone(i,u._transformToRoot),!u.show){u._transformDirty=!0;continue}cEe(u,t,n,i,r+1),u._transformDirty=!1}}var AB=yee;var lEe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:uEe,_countGeneratedBuffers:fEe};lEe.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;uEe(i,r),fEe(i,o)};function uEe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function fEe(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 bB=lEe;function dw(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=N.clone(n,this._originalTransform),this._transform=N.clone(n,this._transform),this._transformToRoot=N.clone(i,this._transformToRoot),this._computedTransform=new N,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,But(this)}Object.defineProperties(dw.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=N.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;h.equals(n,e)||(t.translation=h.clone(e,t.translation),Aee(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),Aee(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),Aee(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 But(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=N.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new TA(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function Aee(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}dw.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};dw.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(yB),t.push(bB),n.push(AB)};dw.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};dw.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 r=0;r<i;r++){l(t[r])||(t[r]=new N);let o=N.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=N.inverseTransformation(o,t[r]);t[r]=N.multiplyTransformation(s,n[r],t[r])}};var xB=dw;var dEe={name:"AlphaPipelineStage"};dEe.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=tn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,de.FRAGMENT),s.addUniform("float","u_alphaCutoff",de.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var TB=dEe;var hEe={name:"BatchTexturePipelineStage"};hEe.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Ot(r,e.uniformMap)};var EB=hEe;var mEe={name:"ClassificationPipelineStage"};mEe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||kut(t,r)};function kut(e,t){let n=xt.getAttributeBySemantic(e,ct.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=xt.getAttributeBySemantic(e,ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<s;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var CB=mEe;var vB=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -4260,7 +5568,7 @@ positionMC *= show; filterByPassType(positionMC, feature.color); #endif } -`;var ZR=`void filterByPassType(vec4 featureColor) +`;var SB=`void filterByPassType(vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -4297,7 +5605,7 @@ material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); #endif material.alpha *= featureColor.a; } -`;var Pce={name:"CPUStylingPipelineStage"};Pce.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines($R),o.addFragmentLines(ZR),o.addDefine("USE_CPU_STYLING",void 0,ge.BOTH),c(i.color)||(o.addUniform("float",Ry.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),e.uniformMap[Ry.COLOR_BLEND_UNIFORM_NAME]=function(){return bc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ge.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===De.TRANSLUCENT}};var QR=Pce;var Ice={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Ice.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var y_=Object.freeze(Ice);var JR=`void customShaderStage( +`;var pEe={name:"CPUStylingPipelineStage"};pEe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(vB),r.addFragmentLines(SB),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",kA.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[kA.COLOR_BLEND_UNIFORM_NAME]=function(){return gl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var wB=pEe;var bee={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};bee.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(bee);var __=bee;var IB=`void customShaderStage( inout czm_modelVertexOutput vsOutput, inout ProcessedAttributes attributes, FeatureIds featureIds, @@ -4314,7 +5622,7 @@ vsInput.metadataStatistics = metadataStatistics; vertexMain(vsInput, vsOutput); attributes.positionMC = vsOutput.positionMC; } -`;var eM=`void customShaderStage( +`;var PB=`void customShaderStage( inout czm_modelMaterial material, ProcessedAttributes attributes, FeatureIds featureIds, @@ -4330,36 +5638,195 @@ fsInput.metadataClass = metadataClass; fsInput.metadataStatistics = metadataStatistics; fragmentMain(fsInput, material); } -`;var tM=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { +`;var DB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); } -`;var nM=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +`;var RB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); setFeatureIdVaryings(); } -`;var ji={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()"};ji.process=function(e,t,n){let i=e.shaderBuilder;B5e(i);let o=e.runtimeNode.node.instances;c(o)&&k5e(e,o,n),U5e(e,t,n),i.addVertexLines(nM),i.addFragmentLines(tM)};function B5e(e){e.addStruct(ji.STRUCT_ID_FEATURE_IDS_VS,ji.STRUCT_NAME_FEATURE_IDS,ge.VERTEX),e.addStruct(ji.STRUCT_ID_FEATURE_IDS_FS,ji.STRUCT_NAME_FEATURE_IDS,ge.FRAGMENT),e.addFunction(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,ji.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.VERTEX),e.addFunction(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,ji.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.FRAGMENT),e.addFunction(ji.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,ji.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.VERTEX),e.addFunction(ji.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,ji.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.FRAGMENT),e.addFunction(ji.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,ji.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ge.VERTEX)}function k5e(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 Tn.FeatureIdAttribute?V5e(e,s,a):Oce(e,s,a,o,1,n);let l=s.label;c(l)&&Rce(e,a,l,ge.BOTH)}}function U5e(e,t,n){let i=t.featureIds,r=$t.getAttributeBySemantic(t,ht.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],l=a.positionalLabel,u=ge.BOTH;a instanceof Tn.FeatureIdAttribute?z5e(e,a,l):a instanceof Tn.FeatureIdImplicitRange?Oce(e,a,l,r,void 0,n):(H5e(e,a,l,s,n),u=ge.FRAGMENT);let f=a.label;c(f)&&Rce(e,l,f,u)}}function V5e(e,t,n){let i=e.shaderBuilder;i.addStructField(ji.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(ji.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,l=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[l]),i.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(ji.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function z5e(e,t,n){let i=e.shaderBuilder;i.addStructField(ji.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(ji.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(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Oce(e,t,n,i,o,r){G5e(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let l=`v_implicit_${n}`;s.addVarying("float",l),s.addStructField(ji.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(ji.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(ji.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${l} = ${a};`]),s.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${l}));`])}function H5e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let l=a.channels,u=e.shaderBuilder;u.addStructField(ji.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,ge.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,g=a.transform;if(c(g)&&!J.equals(g,J.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,ge.FRAGMENT),s[b]=function(){return g},p=`vec2(${b} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${l}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Rce(e,t,n,i){let o=e.shaderBuilder,r=ge.includesVertexShader(i);r&&o.addStructField(ji.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(ji.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(ji.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function G5e(e,t,n,i,o){let r=e.model,s,a;if(c(t.repeat)){let u=j5e(t,n);s=yt.createVertexBuffer({context:o.context,typedArray:u,usage:Be.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let l={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:$.FLOAT,strideInBytes:$.getSizeInBytes($.FLOAT),offsetInBytes:0};e.attributes.push(l)}function j5e(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 My=ji;var iM=`void metadataStage( +`;var mr={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()"};mr.process=function(e,t,n){let i=e.shaderBuilder;Uut(i);let r=e.runtimeNode.node.instances;l(r)&&zut(e,r,n),Vut(e,t,n),i.addVertexLines(RB),i.addFragmentLines(DB)};function Uut(e){e.addStruct(mr.STRUCT_ID_FEATURE_IDS_VS,mr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(mr.STRUCT_ID_FEATURE_IDS_FS,mr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(mr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,mr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function zut(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof En.FeatureIdAttribute?jut(e,s,a):gEe(e,s,a,r,1,n);let c=s.label;l(c)&&_Ee(e,a,c,de.BOTH)}}function Vut(e,t,n){let i=t.featureIds,o=xt.getAttributeBySemantic(t,ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=de.BOTH;a instanceof En.FeatureIdAttribute?Hut(e,a,c):a instanceof En.FeatureIdImplicitRange?gEe(e,a,c,o,void 0,n):(Gut(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&_Ee(e,c,f,u)}}function jut(e,t,n){let i=e.shaderBuilder;i.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(mr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Hut(e,t,n){let i=e.shaderBuilder;i.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function gEe(e,t,n,i,r,o){Wut(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(mr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Gut(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return a.texture??r.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,de.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,de.FRAGMENT),s[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function _Ee(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Wut(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=qut(t,n);s=tt.createVertexBuffer({context:r.context,typedArray:u,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s),o.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function qut(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var UA=mr;var OB=`void metadataStage( +FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes ) { -initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); } -`;var oM=`void metadataStage( +`;var MB=`void metadataStage( +FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes ) { -initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); setMetadataVaryings(); } -`;var Di={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"}]};Di.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,l=W5e(r.propertyAttributes,t,a),u=Y5e(r.propertyTextures,a),f=l.concat(u);K5e(i,f),Q5e(i),i.addVertexLines(oM),i.addFragmentLines(iM);for(let h=0;h<l.length;h++){let p=l[h];J5e(e,p)}for(let h=0;h<u.length;h++){let p=u[h];tje(e,p)}};function W5e(e,t,n){return c(e)?e.flatMap(i=>q5e(i,t,n)):[]}function q5e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=$t,s=e.class.id,a=n?.classes[s],l=Object.entries(e.properties),u=new Array(l.length);for(let f=0;f<l.length;f++){let[h,p]=l[f],g=i(t,p.attribute),{glslType:m,variableName:y}=o(g);u[f]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[h],shaderDestination:ge.BOTH}}return u}function Y5e(e,t){return c(e)?e.flatMap(n=>X5e(n,t)):[]}function X5e(e,t){let{sanitizeGlslIdentifier:n}=$t,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,l])=>l.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[l,u]=r[a];s[a]={metadataVariable:n(l),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[l],shaderDestination:ge.FRAGMENT}}return s}function K5e(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:l,glslType:u,propertyStatistics:f}=t[a];n.add(u),c(f)&&l!==at.ENUM&&i.add(u)}let o=Di.METADATA_CLASS_FIELDS;for(let a of n){let l=`${a}MetadataClass`;s(l,a,o)}let r=Di.METADATA_STATISTICS_FIELDS;for(let a of i){let l=`${a}MetadataStatistics`;s(l,a,r)}function s(a,l,u){e.addStruct(a,a,ge.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?Z5e(l):l;e.addStructField(a,p,h)}}}var $5e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Z5e(e){let t=$5e[e];return c(t)?t:e}function Q5e(e){e.addStruct(Di.STRUCT_ID_METADATA_VS,Di.STRUCT_NAME_METADATA,ge.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_FS,Di.STRUCT_NAME_METADATA,ge.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_VS,Di.STRUCT_NAME_METADATA_CLASS,ge.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_FS,Di.STRUCT_NAME_METADATA_CLASS,ge.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_VS,Di.STRUCT_NAME_METADATA_STATISTICS,ge.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_FS,Di.STRUCT_NAME_METADATA_STATISTICS,ge.FRAGMENT),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.VERTEX),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.FRAGMENT),e.addFunction(Di.FUNCTION_ID_SET_METADATA_VARYINGS,Di.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ge.VERTEX)}function J5e(e,t){eje(e,t),Mce(e.shaderBuilder,t),Lce(e.shaderBuilder,t)}function eje(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Fce({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ge.BOTH,property:o});n.addStructField(Di.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Di.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function tje(e,t){nje(e,t),Mce(e.shaderBuilder,t),Lce(e.shaderBuilder,t)}function nje(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:l,index:u,texture:f,transform:h}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ge.FRAGMENT),i[p]=()=>f),n.addStructField(Di.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,m=g;if(c(h)&&!J.equals(h,J.IDENTITY)){let C=`${p}Transform`;n.addUniform("mat3",C,ge.FRAGMENT),i[C]=function(){return h},m=`vec2(${C} * vec3(${g}, 1.0))`}let y=`texture(${p}, ${m}).${l}`,b=s.unpackInShader(y),x=Fce({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),A=`metadata.${o} = ${x};`;n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,[A])}function Mce(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Nce(Di.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Di.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Di.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Lce(e,t){let{propertyStatistics:n}=t;if(!c(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===at.ENUM)return;let s=Di.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,l=Nce(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,l),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,l))}function Nce(e,t,n,i){function o(r){let s=t[r.specName];if(c(s))return`${n}.${r.shaderName} = ${i}(${s});`}return c(t)?e.map(o).filter(c):[]}function Fce(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:l,shaderDestination:u}=e;s.addUniform(l,o,u),s.addUniform(l,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var Uf=Di;var ije={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Ly=Object.freeze(ije);var ga={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:dt};ga.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:l}=s;c(a)&&(e.lightingOptions.lightingModel=a),l===Ly.TRANSLUCENT?r.pass=De.TRANSLUCENT:l===Ly.OPAQUE&&(r.pass=void 0);let u=fje(s,t);if(!u.customShaderEnabled)return;if(pje(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),c(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),c(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=y_.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[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=xt(e.uniformMap,s.uniformMap)};function oje(e){let t={};for(let n=0;n<e.length;n++){let i=$t.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"},sje={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 Bce(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=rje[t],i=sje[t];if(c(n))return{attributeField:[n,e],value:i}}function aje(e,t){if(!c(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=kce(t,n,!1),o=Uce(t,n,!1),r,s=[],a=[];for(let l in i){if(!i.hasOwnProperty(l))continue;let f=[i[l].glslType,l];s.push(f),r=`vsInput.attributes.${l} = attributes.${l};`,a.push(r)}for(let l=0;l<o.length;l++){let u=o[l],f=Bce(u);if(!c(f))return ga._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function cje(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 lje(e,t){if(!c(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=kce(t,n,!0),o=Uce(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let h=[i[u].glslType,u];s.push(h),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],h=Bce(f);if(!c(h))return ga._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${f} = ${h.value};`,a.push(r)}let l=cje(e);return{enabled:!0,attributeFields:s.concat(l.attributeFields),initializationLines:l.initializationLines.concat(a)}}var uje={positionWC:!0,positionEC:!0};function kce(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 Uce(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||uje.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 fje(e,t){let n=oje(t.attributes),i=aje(e,n),o=lje(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function dje(e,t){let n=ga.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ga.STRUCT_NAME_ATTRIBUTES,ge.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=ga.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ga.STRUCT_NAME_VERTEX_INPUT,ge.VERTEX),e.addStructField(n,ga.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,My.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Uf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Uf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Uf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ga.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ga.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ge.VERTEX),e.addFunctionLines(r,o)}function hje(e,t){let n=ga.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ga.STRUCT_NAME_ATTRIBUTES,ge.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=ga.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ga.STRUCT_NAME_FRAGMENT_INPUT,ge.FRAGMENT),e.addStructField(n,ga.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,My.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Uf.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Uf.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Uf.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ga.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ga.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ge.FRAGMENT),e.addFunctionLines(r,o)}var mje=[];function pje(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=mje;i.enabled&&(dje(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,JR),e.addVertexLines(r)),o.enabled&&(hje(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,eM),e.addFragmentLines(r))}var rM=ga;var sM={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};sM.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=c(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ge.VERTEX),i.addFunction(sM.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,sM.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ge.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let l=s[a],u=l.quantization;if(!c(u))continue;let f=l.semantic===ht.POSITION,h=l.semantic===ht.TEXCOORD;if(r&&!f&&!h)continue;let p=$t.getAttributeInfo(l);gje(i,p),_je(e,p)}};function _je(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,ge.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,l=t.glslType;n.addUniform(l,s,ge.VERTEX),n.addUniform(l,a,ge.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Vce(u,0),f=Vce(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Vce(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function gje(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=yje(n,i):o=bje(n),e.addFunctionLines(sM.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function yje(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 bje(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var aM=sM;var cM=`void geometryStage(out ProcessedAttributes attributes) +`;var Di={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(FeatureIds featureIds, 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"}]};Di.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=fft(r,t),f=Yut(o.propertyAttributes,t,a),d=Kut(o.propertyTextures,a),p=Zut(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);tft(i,g),rft(i),i.addVertexLines(MB),i.addFragmentLines(OB);for(let m=0;m<f.length;m++){let y=f[m];oft(e,y)}for(let m=0;m<d.length;m++){let y=d[m];aft(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];lft(e,y,c)}};function Yut(e,t,n){return l(e)?e.flatMap(i=>Xut(i,t,n)):[]}function Xut(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:de.BOTH}}return u}function Kut(e,t){return l(e)?e.flatMap(n=>$ut(n,t)):[]}function $ut(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:de.FRAGMENT}}return s}var Jut=4;function Zut(e,t,n,i,r){if(!l(e))return[];let o=eft(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Qut(s,o,i,r))}function Qut(e,t,n,i){let{sanitizeGlslIdentifier:r}=xt,o=e.class,s=n?.classes[o.id],a=t.get(String(e.id))??{},c=a.shaderDestination??de.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(Jut))continue;let y=u[g],A=de.intersection(mft(g,i),c);if(A===de.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:s?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return d}function eft(e,t){let n=new Map;function i(a,c){let u=a?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:a.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let a=0;a<r.length;a++){let c=r[a],u=l(c?.textureReader);i(c,u?de.FRAGMENT:de.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,de.BOTH)}return n}function tft(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let r=Di.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Di.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,de.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?ift(c):c;e.addStructField(a,p,d)}}}var nft={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function ift(e){let t=nft[e];return l(t)?t:e}function rft(e){e.addStruct(Di.STRUCT_ID_METADATA_VS,Di.STRUCT_NAME_METADATA,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_FS,Di.STRUCT_NAME_METADATA,de.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_VS,Di.STRUCT_NAME_METADATA_CLASS,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_FS,Di.STRUCT_NAME_METADATA_CLASS,de.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_VS,Di.STRUCT_NAME_METADATA_STATISTICS,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_FS,Di.STRUCT_NAME_METADATA_STATISTICS,de.FRAGMENT),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.VERTEX),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.FRAGMENT),e.addFunction(Di.FUNCTION_ID_SET_METADATA_VARYINGS,Di.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,de.VERTEX)}function oft(e,t){sft(e,t),xee(e.shaderBuilder,t),Tee(e.shaderBuilder,t)}function sft(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=Eee({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:de.BOTH,property:r});n.addStructField(Di.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Di.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function aft(e,t,n){cft(e,t,n),xee(e.shaderBuilder,t),Tee(e.shaderBuilder,t)}function cft(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=a.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,de.FRAGMENT),r[g]=()=>d),i.addStructField(Di.STRUCT_ID_METADATA_FS,s,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let S=`${g}Transform`;i.addUniform("mat3",S,de.FRAGMENT),r[S]=function(){return p},A=`vec2(${S} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=a.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let E=Eee({valueExpression:T,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:de.FRAGMENT,property:a}),v=`metadata.${o} = ${E};`;m.push(v),i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function xee(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=yEe(Di.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Di.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,s),de.includesVertexShader(o)&&(e.addStructField(Di.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Tee(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===bt.ENUM)return;let s=Di.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=yEe(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,c),de.includesVertexShader(t.shaderDestination)&&(e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function lft(e,t,n){uft(e,t,n),xee(e.shaderBuilder,t),Tee(e.shaderBuilder,t)}function uft(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){_t("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,de.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;de.includesVertexShader(g)&&i.addStructField(Di.STRUCT_ID_METADATA_VS,s,o),de.includesFragmentShader(g)&&i.addStructField(Di.STRUCT_ID_METADATA_FS,s,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=Eee({valueExpression:x,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:g,property:a??b}),E=`metadata.${o} = ${T};`;p.push(E),de.includesVertexShader(g)&&i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,p),de.includesFragmentShader(g)&&i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function yEe(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function Eee(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function fft(e,t){let n=new Set,i=new Set;return dft(e,n,i),hft(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function dft(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&n.add(s);let o=i.usedVariablesVertex?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&t.add(s)}function hft(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Oe.POINTS))return;let s=r.color?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let a=r.show?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function mft(e,t){let n=t.usedInFragment.has(e)?de.FRAGMENT:de.NONE,i=t.usedInVertex.has(e)?de.VERTEX:de.NONE;return de.union(n,i)}var eh=Di;var AEe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(AEe);var zA=AEe;var Ga={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};Ga.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:s}=r,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===zA.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===zA.OPAQUE&&(o.pass=void 0);let u=Tft(s,t,e);if(!u.customShaderEnabled)return;if(Sft(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,de.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,de.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,de.FRAGMENT);let p=__.getDefineName(s.mode);i.addDefine(p,void 0,de.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Ot(e.uniformMap,s.uniformMap)};function pft(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var gft={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},_ft={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 bEe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=gft[t],i=_ft[t];if(l(n))return{attributeField:[n,e],value:i}}function yft(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!EEe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=xEe(t,r,!1),s=TEe(t,r,!1),a,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),a=`vsInput.attributes.${f} = attributes.${f};`,u.push(a)}for(let f=0;f<s.length;f++){let d=s[f],p=bEe(d);if(!l(p))return Ga._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${d} = ${p.value};`,u.push(a)}return{enabled:!0,attributeFields:c,initializationLines:u}}function Aft(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 bft(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!EEe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=xEe(t,r,!0),s=TEe(t,r,!0),a,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),a=`fsInput.attributes.${d} = attributes.${d};`,u.push(a)}for(let d=0;d<s.length;d++){let p=s[d],g=bEe(p);if(!l(g))return Ga._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),a=`fsInput.attributes.${p} = ${g.value};`,u.push(a)}let f=Aft(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var xft={positionWC:!0,positionEC:!0};function xEe(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],s=r;n&&r==="normalMC"?s="normalEC":n&&r==="tangentMC"&&(s="tangentEC",o.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=o)}return i}function TEe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||xft.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function Tft(e,t,n){let i=pft(t.attributes),r=wft(t,n.model.structuralMetadata),o=yft(e,i,r),s=bft(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function Eft(e,t){let n=Ga.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ga.STRUCT_NAME_ATTRIBUTES,de.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ga.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ga.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Ga.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,UA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,eh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,eh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,eh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Ga.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Ga.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function Cft(e,t){let n=Ga.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ga.STRUCT_NAME_ATTRIBUTES,de.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ga.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ga.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Ga.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,UA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,eh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,eh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,eh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Ga.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Ga.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var vft=[];function Sft(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=vft;i.enabled&&(Eft(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,IB),e.addVertexLines(o)),r.enabled&&(Cft(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,PB),e.addFragmentLines(o))}function wft(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(a=>a.propertyTableId):[],o=new Set;function s(a,c){for(let u of a){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(r,t.propertyTables),o}function EEe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Ga._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var NB=Ga;var LB={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};LB.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,de.VERTEX),i.addFunction(LB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,LB.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,de.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===ct.POSITION,d=c.semantic===ct.TEXCOORD;if(o&&!f&&!d)continue;let p=xt.getAttributeInfo(c);Pft(i,p),Ift(e,p)}};function Ift(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,de.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,de.VERTEX),n.addUniform(c,a,de.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=CEe(u,0),f=CEe(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function CEe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function Pft(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=Dft(n,i):r=Rft(n),e.addFunctionLines(LB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function Dft(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function Rft(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var FB=LB;var BB=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { +if (u_isEdgePass) { +return; +} +vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw; +vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord); +vec4 edgeId = texture(czm_edgeIdTexture, screenCoord); +float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord)); +float n = czm_currentFrustum.x; +float f = czm_currentFrustum.y; +vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord); +float geomDepthLinear = -geomEC.z; +float z_ndc_edge = edgeDepthWin * 2.0 - 1.0; +float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n)); +float d = abs(edgeDepthLinear - geomDepthLinear); +float pixelStepLinear = fwidth(geomDepthLinear); +float rel = geomDepthLinear * 0.0005; +float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel)); +if (d < eps && edgeId.r > 0.0) { +#ifdef HAS_EDGE_FEATURE_ID +float edgeFeatureId = edgeId.g; +float currentFeatureId = float(featureIds.featureId_0); +#endif +float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); +bool isBackground = geomDepthLinear > globeDepth; +bool drawEdge = isBackground; +#ifdef HAS_EDGE_FEATURE_ID +bool hasEdgeFeature = edgeFeatureId > 0.0; +bool hasCurrentFeature = currentFeatureId > 0.0; +bool featuresMatch = edgeFeatureId == currentFeatureId; +drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch; +#else +drawEdge = true; +#endif +if (drawEdge) { +color = edgeColor; +} +} +} +`;var vEe={name:"EdgeDetectionPipelineStage"};vEe.process=function(e){e.shaderBuilder.addFragmentLines([BB])};var kB=vEe;var UB=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +layout(location = 1) out vec4 out_id; +layout(location = 2) out vec4 out_edgeDepth; +#endif +void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds) +{ +#ifdef HAS_EDGE_VISIBILITY +if (!u_isEdgePass) { +return; +} +float edgeTypeInt = v_edgeType * 255.0; +if (edgeTypeInt < 0.5) { +discard; +} +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +if (v_shouldDiscard > 0.5) { +discard; +} +} +vec4 finalColor = color; +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +if (v_edgeColor.a >= 0.0) { +finalColor = v_edgeColor; +} +#endif +#ifdef HAS_LINE_PATTERN +const float maskLength = 16.0; +float dashPosition = fract(v_lineCoord / maskLength); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(u_linePattern / pow(2.0, maskIndex)); +if (mod(maskTest, 2.0) < 1.0) { +discard; +} +#endif +color = finalColor; +#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +out_id = vec4(0.0); +out_id.r = edgeTypeInt; +#ifdef HAS_EDGE_FEATURE_ID +out_id.g = float(featureIds.featureId_0); +#else +out_id.g = 0.0; +#endif +out_edgeDepth = czm_packDepth(gl_FragCoord.z); +#endif +#endif +} +`;var zB=`#ifdef HAS_EDGE_VISIBILITY +void edgeVisibilityStageVS() { +if (!u_isEdgePass) { +return; +} +v_edgeType = a_edgeType; +v_faceNormalAView = czm_normal * a_faceNormalA; +v_faceNormalBView = czm_normal * a_faceNormalB; +v_edgeOffset = a_edgeOffset; +v_shouldDiscard = 0.0; +float edgeTypeInt = a_edgeType * 255.0; +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +vec3 normalA = normalize(v_faceNormalAView); +vec3 normalB = normalize(v_faceNormalBView); +const float perpTol = 2.5e-4; +vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0); +vec3 toEye1 = normalize(-currentPosEC.xyz); +float dotA1 = dot(normalA, toEye1); +float dotB1 = dot(normalB, toEye1); +vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0); +vec3 toEye2 = normalize(-otherPosEC.xyz); +float dotA2 = dot(normalA, toEye2); +float dotB2 = dot(normalB, toEye2); +if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) { +v_shouldDiscard = 1.0; +} +} +#ifdef HAS_EDGE_FEATURE_ID +v_featureId_0 = a_edgeFeatureId; +#endif +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +v_edgeColor = a_edgeColor; +#endif +#ifdef HAS_LINE_PATTERN +#ifdef HAS_EDGE_CUMULATIVE_DISTANCE +v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld; +#else +vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0); +vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw; +vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0); +vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw; +vec2 windowDir = otherScreen - currentScreen; +const float textureCoordinateBase = 8192.0; +if (abs(windowDir.x) > abs(windowDir.y)) { +v_lineCoord = textureCoordinateBase + currentScreen.x; +} else { +v_lineCoord = textureCoordinateBase + currentScreen.y; +} +#endif +#endif +vec4 posClip = gl_Position; +if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) { +vec4 currentClip = posClip; +vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0); +vec2 currentNDC = currentClip.xy / currentClip.w; +vec2 otherNDC = otherClip.xy / otherClip.w; +vec2 edgeDirNDC = otherNDC - currentNDC; +if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) { +edgeDirNDC = -edgeDirNDC; +} +edgeDirNDC = normalize(edgeDirNDC); +vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x); +float lineWidthPixels = u_lineWidth; +vec2 viewportSize = czm_viewport.zw; +vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w; +vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset; +posClip.xy += offsetClip; +} +gl_Position = posClip; +} +#endif +`;var Cee=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,s=t.count,a=n;return i&&(a=cn.dequantize(n,t.componentDatatype,o,s)),l(r)?e.dequantize(a,s,o,r):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(s),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let v=Y.createTypedArray(s,o);return c.getBufferData(v,u),v}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(s,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),E=e.createComponentsReader(s);for(let v=0;v<i;++v){let S=u+v*b;E(x,S,r,T);for(let I=0;I<r;++I)A[v*r+I]=T[I]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let a=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let o=r.quantizedVolumeStepSize,s=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,s,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,s,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,s,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,s,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,o),cn.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,s*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let s=t[r+0],a=t[r+1],c=t[r+2];i[r+0]=a,i[r+1]=c,i[r+2]=s}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+r;o[s]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new U;for(let a=0;a<n;a++)U.unpack(t,a*2,s),U.multiplyComponents(s,i,s),U.add(s,r,s),U.pack(s,o,a*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,s),h.multiplyComponents(s,i,s),h.add(s,r,s),h.pack(s,o,a*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,r,s),se.pack(s,o,a*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,s,a){let c=o;for(let u=0;u<s;++u)a[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let s=0;s<o;s++)h.unpack(t,s*3,r),N.multiplyByPoint(n,r,r),h.pack(r,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,s=new Float32Array(i);if(l(o))for(let a=0;a<i;a++)s[a]=r+Math.floor(a/o);else s.fill(r);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,s=e.createIndexTypedArray(o,r);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Oe.TRIANGLES)return i;if(n===Oe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Oe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Oe.TRIANGLES}, TRIANGLE_STRIP (${Oe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Oe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case je.UNSIGNED_BYTE:return new Uint8Array(n);case je.UNSIGNED_SHORT:return new Uint16Array(n);case je.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${je.UNSIGNED_BYTE}, UNSIGNED_SHORT (${je.UNSIGNED_SHORT}, or UNSIGNED_INT (${je.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new N,modelMatrix:new N,computedModelMatrix:new N},c=s._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,s,t,a),g=p.computedModelMatrix;l(r)&&(g=At.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,s=N.clone(t.computedTransform,r.nodeComputedTransform),a=N.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(a=N.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=N.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let u=N.multiplyTransformation(a,s,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=s,r.modelMatrix=a,r}static computeInstanceTransforms(t,n,i,r){let o=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,u=a.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(a,c,o);for(let p=0;p<o.length;p++){let g=o[p];a.transformInWorldSpace?(N.multiplyTransformation(g,i,g),N.multiplyTransformation(r,g,g)):N.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=xt.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let s;if("setIndex"in o){let c=xt.getAttributeBySemantic(r,ct.FEATURE_ID,o.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in o&&(s=e.readImplicitRangeAsTypedArray(o,r)),!l(s))return;let a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=s[c];return a}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let s=o*12,a=new N(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6],t[s+7],t[s+8],t[s+9],t[s+10],t[s+11],0,0,0,1);i.push(a)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=xt.getAttributeBySemantic(t,Lo.TRANSLATION),o=xt.getAttributeBySemantic(t,Lo.ROTATION),s=xt.getAttributeBySemantic(t,Lo.SCALE),a=l(r),c=l(o),u=l(s);if(!a&&!c&&!u)return;let f,d,p;a&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let g=0;g<n;g++){let m=a?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=N.fromTranslationQuaternionRotationScale(m,y,A,new N);i.push(b)}}},Ea=Cee;var hw=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),SEe={name:"EdgeVisibilityPipelineStage"};SEe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,de.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,de.FRAGMENT),i.addFragmentLines(UB),i.addVertexLines(zB),i.addUniform("bool","u_isEdgePass",de.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",de.VERTEX);let s=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let a=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=Mft(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=Nft(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,de.BOTH));let x,T,E=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(x=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,de.VERTEX));let v=Oft(p.edgeIndices,p.edgeData,t.edgeVisibility),S=Lft(p.edgeIndices,p.edgeData,e,n.context,s,c,u,a,b,f,d,m,t.edgeVisibility,v,x,T);if(!l(S))return;S.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,de.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let I=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:S.vertexArray,indexCount:S.indexCount,primitiveType:Oe.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:I}};function Oft(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let s=o.length/3,a=new Float32Array(o.length),c=new h;for(let u=0;u<s;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[u*3]=c.x,a[u*3+1]=c.y,a[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==hw.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=a.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=a[g],r[y+1]=a[g+1],r[y+2]=a[g+2],r[y+3]=a[m],r[y+4]=a[m+1],r[y+5]=a[m+2]}return r}function Mft(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,s=l(o)&&o.length>0?o[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!a&&!c)return[];let u=a?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(a){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],E=u[x+1],v=u[x+2];for(let S=0;S<3;S++){let I,R;S===0?(I=T,R=E):S===1?(I=E,R=v):(I=v,R=T);let O=Math.floor(y/4),L=y%4*2;if(y++,O>=b.length)break;let C=b[O]>>L&3;if(C===hw.HIDDEN)continue;let w=Math.min(I,R),P=Math.max(I,R),M=`${w},${P}`;if(p.has(M))continue;p.add(M),f.push(I,R);let F=-1;C===hw.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===hw.REPEATED_HARD?hw.HARD:C,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,E;for(let v=0;v<b.length;v++){let S=b[v];if(l(x)&&S===x){E=void 0;continue}if(!l(E)){E=S;continue}let I=E,R=S;if(E=S,I===R||s>0&&(I<0||I>=s||R<0||R>=s))continue;let O=Math.min(I,R),L=Math.max(I,R),_=`${O},${L}`;p.has(_)||(p.add(_),f.push(I,R),d.push({edgeType:hw.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function Nft(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,ct.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Ea.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!o&&!s&&!a)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:s?d=f/255:a&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function Lft(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,E=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,ct.POSITION),v=l(E.typedArray)?E.typedArray:Ea.readAttributeAsTypedArray(E),S=new Float32Array(x*3),I=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),L=new Float32Array(x*3),_=new Float32Array(x),C=l(m),w=C?new Float32Array(x):void 0,P;C&&(P=l(m.typedArray)?m.typedArray:Ea.readAttributeAsTypedArray(m));let M=l(c),F=M?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,B=l(d)?d.count:0;function j($e){if(!M)return;let Pe=$e*4;F[Pe]=0,F[Pe+1]=0,F[Pe+2]=0,F[Pe+3]=-1}function k($e,Pe){if(!M)return;let qe=$e*4,st=l(Pe.x)?Pe.x:Pe[0],vt=l(Pe.y)?Pe.y:Pe[1],Gt=l(Pe.z)?Pe.z:Pe[2],lt=l(Pe.w)?Pe.w:l(Pe[3])?Pe[3]:1;F[qe]=st,F[qe+1]=vt,F[qe+2]=Gt,F[qe+3]=lt}function G($e,Pe){if(!M)return;if(Pe>=B){j($e);return}let qe=Pe*4,st=$e*4;F[st]=V[qe],F[st+1]=V[qe+1],F[st+2]=V[qe+2],F[st+3]=V[qe+3]}for(let $e=0;$e<A;$e++){let Pe=e[$e*2],qe=e[$e*2+1],vt=t[$e].edgeType/255,Gt=v[Pe*3],lt=v[Pe*3+1],mt=v[Pe*3+2],ft=v[qe*3],Xt=v[qe*3+1],rt=v[qe*3+2],ht=$e*4;S[ht*3]=Gt,S[ht*3+1]=lt,S[ht*3+2]=mt,L[ht*3]=ft,L[ht*3+1]=Xt,L[ht*3+2]=rt,_[ht]=-1,I[ht]=vt,S[(ht+1)*3]=Gt,S[(ht+1)*3+1]=lt,S[(ht+1)*3+2]=mt,L[(ht+1)*3]=ft,L[(ht+1)*3+1]=Xt,L[(ht+1)*3+2]=rt,_[ht+1]=1,I[ht+1]=vt,S[(ht+2)*3]=ft,S[(ht+2)*3+1]=Xt,S[(ht+2)*3+2]=rt,L[(ht+2)*3]=Gt,L[(ht+2)*3+1]=lt,L[(ht+2)*3+2]=mt,_[ht+2]=1,I[ht+2]=vt,S[(ht+3)*3]=ft,S[(ht+3)*3+1]=Xt,S[(ht+3)*3+2]=rt,L[(ht+3)*3]=Gt,L[(ht+3)*3+1]=lt,L[(ht+3)*3+2]=mt,_[ht+3]=-1,I[ht+3]=vt;let Bi=t[$e].color;if(l(Bi))for(let nn=0;nn<4;nn++)k(ht+nn,Bi);else if(l(V))for(let nn=0;nn<4;nn++)G(ht+nn,Pe);else for(let nn=0;nn<4;nn++)j(ht+nn);if(C){let nn=P[Pe],Wn=P[qe];w[ht]=nn,w[ht+1]=nn,w[ht+2]=Wn,w[ht+3]=Wn}let Xn=$e*6,Ai=g[Xn],Wi=g[Xn+1],wi=g[Xn+2],di=g[Xn+3],bi=g[Xn+4],jn=g[Xn+5];for(let nn=0;nn<4;nn++)R[(ht+nn)*3]=Ai,R[(ht+nn)*3+1]=Wi,R[(ht+nn)*3+2]=wi,O[(ht+nn)*3]=di,O[(ht+nn)*3+1]=bi,O[(ht+nn)*3+2]=jn}let q=tt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=tt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=tt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=tt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=tt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=M?tt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?tt.createVertexBuffer({context:i,typedArray:w,usage:Me.STATIC_DRAW}):void 0,ge=A*2*3,we=x>65534,Se=we?new Uint32Array(ge):new Uint16Array(ge);for(let $e=0;$e<A;$e++){let Pe=$e*4,qe=$e*6;Se[qe]=Pe,Se[qe+1]=Pe+1,Se[qe+2]=Pe+2,Se[qe+3]=Pe,Se[qe+4]=Pe+2,Se[qe+5]=Pe+3}let Re=tt.createIndexBuffer({context:i,typedArray:Se,usage:Me.STATIC_DRAW,indexDatatype:we?je.UNSIGNED_INT:je.UNSIGNED_SHORT}),Qe=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:s,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];M&&Qe.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&Qe.push({index:y,vertexBuffer:fe,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let He=n.runtimePrimitive.primitive;if(l(He.featureIds)&&He.featureIds.length>0){let $e=He.featureIds[0];if(l($e.setIndex)){let Pe=He.attributes.find(qe=>qe.semantic===ct.FEATURE_ID&&qe.setIndex===$e.setIndex);if(l(Pe)){let qe=l(Pe.typedArray)?Pe.typedArray:Ea.readAttributeAsTypedArray(Pe),st=new Float32Array(x);for(let Gt=0;Gt<A;Gt++){let lt=e[Gt*2],mt=lt<qe.length?qe[lt]:0;for(let ft=0;ft<4;ft++)st[Gt*4+ft]=mt}let vt=tt.createVertexBuffer({context:i,typedArray:st,usage:Me.STATIC_DRAW});Qe.push({index:a,vertexBuffer:vt,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new zn({context:i,attributes:Qe,indexBuffer:Re}),indexCount:ge,hasEdgeFeatureIds:l(He.featureIds)&&He.featureIds.length>0}}var VB=SEe;var jB=`void geometryStage(out ProcessedAttributes attributes) { attributes.positionMC = v_positionMC; attributes.positionEC = v_positionEC; @@ -4377,7 +5844,7 @@ attributes.bitangentEC = normalize(v_bitangentEC); #endif setDynamicVaryings(attributes); } -`;var lM=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +`;var HB=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { vec4 computedPosition; vec3 positionMC = attributes.positionMC; @@ -4405,7 +5872,7 @@ v_bitangentEC = normalize(normal * attributes.bitangentMC); setDynamicVaryings(attributes); return computedPosition; } -`;var _E=`vec2 computeSt(float featureId) +`;var mw=`vec2 computeSt(float featureId) { float stepX = model_textureStep.x; float centerX = model_textureStep.y; @@ -4443,7 +5910,22 @@ feature.color = vec4(1.0); } #endif } -`;var uM={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};uM.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=xje(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),Tje(i);let l=s.featureIds.nullFeatureId,u=e.uniformMap;c(l)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return l}),s.shaderDestination===ge.BOTH&&i.addVertexLines(_E),i.addFragmentLines(_E)};function zce(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Hce(e){return e instanceof Tn.FeatureIdTexture?ge.FRAGMENT:ge.BOTH}function xje(e,t,n){let i,o;return c(t.instances)&&(o=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Hce(o),featureIdDefine:zce(o)}):(o=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Hce(o),featureIdDefine:zce(o)})}function Tje(e){e.addStructField(uM.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(uM.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(uM.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Ny=uM;var Xs={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)"};Xs.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ge.VERTEX),i.addStruct(Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ge.FRAGMENT),i.addStruct(Ny.STRUCT_ID_SELECTED_FEATURE,Ny.STRUCT_NAME_SELECTED_FEATURE,ge.BOTH),i.addFunction(Xs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Xs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ge.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Xs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.VERTEX),i.addFunction(Xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Xs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.FRAGMENT),o.type===pr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ge.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=c(e.runtimeNode.node.instances),a=r&&!s,l=t.attributes.length;for(let u=0;u<l;u++){let f=t.attributes[u],h=nn.getAttributeLocationCount(f.type);if(!c(f.buffer)&&!c(f.constant))throw new E("Attributes must be provided as a Buffer or constant value");let p=f.semantic===ht.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,Aje(e,f,g,h,r,s)}Oje(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(lM),i.addFragmentLines(cM)};function Aje(e,t,n,i,o,r){let s=e.shaderBuilder,a=$t.getAttributeInfo(t),l=o&&!r;i>1?Sje(e,t,n,i):Eje(e,t,n,l),vje(s,a,l),wje(s,a),c(t.semantic)&&Cje(s,t),Dje(s,a,o),Pje(s,a,l),Ije(s,a)}function Cje(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ht.NORMAL:e.addDefine("HAS_NORMALS");break;case ht.TANGENT:e.addDefine("HAS_TANGENTS");break;case ht.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ht.TEXCOORD:case ht.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Eje(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:l}=c(o)?o:t;r===ht.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===ht.POSITION,f=u?0:n,h=nn.getNumberOfComponents(a),p={index:f,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:$.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Sje(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=c(o)?o:t,u=nn.getNumberOfComponents(s)/i,f=$.getSizeInBytes(a),h=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*h,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(y)}}function wje(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 vje(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===ht.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function Dje(e,t,n){let i=Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Xs.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 Pje(e,t,n){let i=Xs.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 Ije(e,t){let{semantic:n,setIndex:i}=t.attribute;if(c(n)&&!c(i))return;let o=Xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Xs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function Oje(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===ht.NORMAL?n=!0:r.semantic===ht.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Xs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var fM=Xs;var dM=`#ifdef USE_IBL_LIGHTING +`;var GB={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};GB.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=Fft(r,o,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),Bft(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===de.BOTH&&i.addVertexLines(mw),i.addFragmentLines(mw)};function wEe(e){return e instanceof En.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function IEe(e){return e instanceof En.FeatureIdTexture?de.FRAGMENT:de.BOTH}function Fft(e,t,n){let i,r;return l(t.instances)&&(r=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:IEe(r),featureIdDefine:wEe(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:IEe(r),featureIdDefine:wEe(r)})}function Bft(e){e.addStructField(GB.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(GB.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(GB.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var VA=GB;var Wa={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)"};Wa.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(VA.STRUCT_ID_SELECTED_FEATURE,VA.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Wa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Wa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Wa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Wa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Yo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,de.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,s=l(e.runtimeNode.node.instances),a=o&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Oe.POINTS&&n.context.webgl2?"flat":void 0;kft(e,f,g,d,o,s,m)}Yft(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(HB),i.addFragmentLines(jB)};function kft(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Vft(e,t,n,i):zft(e,t,n,u),Hft(a,c,u),jft(a,c,s),l(t.semantic)&&Uft(a,t),Gft(a,c,r),Wft(a,c,u),qft(a,c)}function Uft(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ct.NORMAL:e.addDefine("HAS_NORMALS");break;case ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ct.TEXCOORD:case ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function zft(e,t,n,i){let{quantization:r,semantic:o,setIndex:s}=t,{type:a,componentDatatype:c}=l(r)?r:t;o===ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=o===ct.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Vft(e,t,n,i){let{quantization:r,normalized:o}=t,{type:s,componentDatatype:a}=l(r)?r:t,u=Vt.getNumberOfComponents(s)/i,f=Y.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function jft(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function Hft(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===ct.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function Gft(e,t,n){let i=Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:s}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,s,o),e.addStructField(r,s,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function Wft(e,t,n){let i=Wa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function qft(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Yft(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ct.NORMAL?n=!0:o.semantic===ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var WB=Wa;var vee,PEe="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",pw={};pw.defaultAccessToken=PEe;pw.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});pw.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});pw.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});pw.getDefaultTokenCredit=function(e){if(e===PEe){if(!l(vee)){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>';vee=new It(t,!0)}return vee}};var Hf=pw;function See(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=kh(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}See.prototype.isReady=function(){return this._isReady};See.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=kh(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var qB=See;function wee(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}wee.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="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])};wee.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Sm=wee;function gw(){pe.throwInstantiationError()}Object.defineProperties(gw.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}});gw.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};gw.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};gw.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Xft=/\.ktx2$/i;gw.loadImage=function(e,t){let n=De.createIfNeeded(t);return Xft.test(n.url)?Ru(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Gf=gw;var DEe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(DEe);var wm=DEe;function REe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Qi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}REe.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 qB({missingImageUrl:OEe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Kft(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 Do({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Qi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(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 gi,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.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 oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function $ft(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function Jft(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Kft(i,t)}catch(i){$ft(e,i)}}function c0(e){e=e??H.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Qi({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}c0.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case wm.SATELLITE:{n=t.token??Hf.defaultAccessToken,i=De.createIfNeeded(Hf.defaultWorldImageryServer),i.appendForwardSlash();let o=Hf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case wm.OCEANS:{n=t.token??Hf.defaultAccessToken,i=De.createIfNeeded(Hf.defaultWorldOceanServer),i.appendForwardSlash();let o=Hf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case wm.HILLSHADE:{n=t.token??Hf.defaultAccessToken,i=De.createIfNeeded(Hf.defaultWorldHillshadeServer),i.appendForwardSlash();let o=Hf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return c0.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function OEe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});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 Ui?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(c0.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}}});c0.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new c0(t);i._resource=n;let r=new REe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Jft(n,r),r.build(i),i};c0.prototype.getTileCredits=function(e,t,n){return this._tileCredits};c0.prototype.requestImage=function(e,t,n,i){return Gf.loadImage(this,OEe(this,e,t,n,i))};c0.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ui)s=D.toDegrees(i),a=D.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new Sm;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=he.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new gi;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};c0._metadataCache={};var y_=c0;var MEe={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"};Object.freeze(MEe);var _w=MEe;function YB(e){}YB.prototype.isReady=function(){return!0};YB.prototype.shouldDiscardImage=function(e){return YB.EMPTY_IMAGE===e};var bG;Object.defineProperties(YB,{EMPTY_IMAGE:{get:function(){return l(bG)||(bG=new Image,bG.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),bG}}});var yw=YB;function NEe(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}NEe.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 r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ie(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function Zft(e,t){if(e.resourceSets.length!==1)throw new oe("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(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function Qft(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),$r.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function edt(e,t,n){let i=e.url,r=Ca._metadataCache[i];l(r)||(r=e.fetchJson(),Ca._metadataCache[i]=r);try{let o=await r;return Zft(o,t)}catch(o){Qft(e,o,n)}}function Ca(e){e=e??H.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=e.mapStyle??_w.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new yw),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Ca.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Do({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(Ca.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)}}});Ca.fromUrl=async function(e,t){t=t??H.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=t.mapStyle??_w.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let s=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),a=new Ca(t);a._resource=r;let c=new NEe(t);return await edt(s,c),c.build(a),a};var tdt=new ie;Ca.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,tdt);return rdt(this._attributionList,n,i)};Ca.prototype.requestImage=function(e,t,n,i){let r=Gf.loadImage(this,ndt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?yw.EMPTY_IMAGE:Promise.reject(o)})};Ca.prototype.pickFeatures=function(e,t,n,i,r){};Ca.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};Ca.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};Ca._logoUrl=void 0;Object.defineProperties(Ca,{logoUrl:{get:function(){return l(Ca._logoUrl)||(Ca._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),Ca._logoUrl},set:function(e){Ca._logoUrl=e}}});function ndt(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:Ca.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var idt=new ie;function rdt(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,idt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ca._metadataCache={};var XB=Ca;var LEe=/{[^}]+}/g,FEe={x:cdt,y:udt,z:hdt,s:mdt,reverseX:ldt,reverseY:fdt,reverseZ:ddt,westDegrees:pdt,southDegrees:gdt,eastDegrees:_dt,northDegrees:ydt,westProjected:Adt,southProjected:bdt,eastProjected:xdt,northProjected:Tdt,width:Edt,height:Cdt},odt=Ot(FEe,{i:vdt,j:Sdt,reverseI:wdt,reverseJ:Idt,longitudeDegrees:Ddt,latitudeDegrees:Rdt,longitudeProjected:Odt,latitudeProjected:Mdt,format:Ldt});function KB(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Do({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,s=Ot(FEe,o),a=Ot(odt,o);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=e.enablePickFeatures??!0}Object.defineProperties(KB.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}}});KB.prototype.getTileCredits=function(e,t,n){};KB.prototype.requestImage=function(e,t,n,i){return Gf.loadImage(this,sdt(this,e,t,n,i))};KB.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=adt(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var xG=!1,Wf=new ie,TG=!1,$B=new ie;function sdt(e,t,n,i,r){xG=!1,TG=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(LEe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var Iee=!1,bw=new U,Pee=!1;function adt(e,t,n,i,r,o,s){xG=!1,TG=!1,Iee=!1,Pee=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(LEe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function xw(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function cdt(e,t,n,i){return xw(e,"{x}",t)}function ldt(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return xw(e,"{reverseX}",r)}function udt(e,t,n,i){return xw(e,"{y}",n)}function fdt(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return xw(e,"{reverseY}",r)}function ddt(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return xw(e,"{reverseZ}",o)}function hdt(e,t,n,i){return xw(e,"{z}",i)}function mdt(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function EG(e,t,n,i){xG||(e.tilingScheme.tileXYToRectangle(t,n,i,Wf),Wf.west=D.toDegrees(Wf.west),Wf.south=D.toDegrees(Wf.south),Wf.east=D.toDegrees(Wf.east),Wf.north=D.toDegrees(Wf.north),xG=!0)}function pdt(e,t,n,i){return EG(e,t,n,i),Wf.west}function gdt(e,t,n,i){return EG(e,t,n,i),Wf.south}function _dt(e,t,n,i){return EG(e,t,n,i),Wf.east}function ydt(e,t,n,i){return EG(e,t,n,i),Wf.north}function CG(e,t,n,i){TG||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,$B),TG=!0)}function Adt(e,t,n,i){return CG(e,t,n,i),$B.west}function bdt(e,t,n,i){return CG(e,t,n,i),$B.south}function xdt(e,t,n,i){return CG(e,t,n,i),$B.east}function Tdt(e,t,n,i){return CG(e,t,n,i),$B.north}function Edt(e,t,n,i){return e.tileWidth}function Cdt(e,t,n,i){return e.tileHeight}function vdt(e,t,n,i,r,o,s){return vG(e,t,n,i,r,o),bw.x}function Sdt(e,t,n,i,r,o,s){return vG(e,t,n,i,r,o),bw.y}function wdt(e,t,n,i,r,o,s){return vG(e,t,n,i,r,o),e.tileWidth-bw.x-1}function Idt(e,t,n,i,r,o,s){return vG(e,t,n,i,r,o),e.tileHeight-bw.y-1}var Pdt=new ie,Aw=new h;function vG(e,t,n,i,r,o,s){if(Iee)return;Dee(e,t,n,i,r,o);let a=Aw,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Pdt);bw.x=e.tileWidth*(a.x-c.west)/c.width|0,bw.y=e.tileHeight*(c.north-a.y)/c.height|0,Iee=!0}function Ddt(e,t,n,i,r,o,s){return D.toDegrees(r)}function Rdt(e,t,n,i,r,o,s){return D.toDegrees(o)}function Odt(e,t,n,i,r,o,s){return Dee(e,t,n,i,r,o),Aw.x}function Mdt(e,t,n,i,r,o,s){return Dee(e,t,n,i,r,o),Aw.y}var Ndt=new he;function Dee(e,t,n,i,r,o,s){if(!Pee){if(e.tilingScheme.projection instanceof Ui)Aw.x=D.toDegrees(r),Aw.y=D.toDegrees(o);else{let a=Ndt;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,Aw)}Pee=!0}}function Ldt(e,t,n,i,r,o,s){return s}var Ds=KB;function th(e){Ds.call(this,e)}th._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return th._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof wp)return th._metadataFailure(e,t);throw r}};th.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await th._requestMetadata(t,i,r);return new th(o)};l(Object.create)&&(th.prototype=Object.create(Ds.prototype),th.prototype.constructor=th);function BEe(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 kEe(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}th._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let O=g.item(R).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&$r.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new Qi({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Do({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&$r.reportError(void 0,r,r.errorEvent,m),new oe(m);let S=ie.clone(t.rectangle);if(!l(S)){let R,O,L,_;t.flipXY??!1?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof Ui||w)R=he.fromDegrees(L.x,L.y),O=he.fromDegrees(_.x,_.y);else{let P=v.projection;R=P.unproject(L),O=P.unproject(_)}S=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return S=BEe(S,v),x=kEe(v,S,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:S,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};th._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Do({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=BEe(a,s);let c=kEe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var jA=th;function UEe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}UEe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Fdt(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 r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Do({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Bdt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),$r.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function kdt(e,t,n){try{let i=await e.fetchText();Fdt(i,t)}catch(i){Bdt(i,e,n)}}function Ju(e){e=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 It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Ju.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(Ju.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}}});Ju.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new UEe(n);s.channel=t,await kdt(o,s);let a=new Ju(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Ju.prototype.getTileCredits=function(e,t,n){};Ju.prototype.requestImage=function(e,t,n,i){let r=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 Gf.loadImage(this,r)};Ju.prototype.pickFeatures=function(e,t,n,i,r){};Ju._logoUrl=void 0;Object.defineProperties(Ju,{logoUrl:{get:function(){return l(Ju._logoUrl)||(Ju._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Ju._logoUrl},set:function(e){Ju._logoUrl=e}}});var JB=Ju;var Udt=/\/$/,zEe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function Tw(e){e=e??H.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=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();Udt.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=zEe,this._resource=i,this._imageryProvider=new Ds({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(Tw.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}}});Tw.prototype.getTileCredits=function(e,t,n){};Tw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Tw.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Tw._defaultCredit=zEe;var ZB=Tw;function ZT(e){e=e??H.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=e.rectangle??ie.MAX_VALUE,n=new Qi({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 It(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(ZT.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 zdt(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=$r.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return Ree(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function Ree(e,t,n){try{return await Gf.loadImage(null,e)}catch(i){return zdt(e,i,t,n)}}ZT.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await Ree(n);t=t??H.EMPTY_OBJECT;let r=new ZT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};ZT.prototype.getTileCredits=function(e,t,n){};ZT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await Ree(this._resource,this);return this._image=r,$r.reportSuccess(this._errorEvent),r}return this._image};ZT.prototype.pickFeatures=function(e,t,n,i,r){};var QB=ZT;function Vdt(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=jdt:e==="xml"?n=qdt:(e==="html"||e==="text")&&(n=VEe)),this.callback=n}function jdt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Sm;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var Oee="http://www.mapinfo.com/mxp",Hdt="http://www.esri.com/wms",Gdt="http://www.opengis.net/wfs",Wdt="http://www.opengis.net/gml";function qdt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===Oee)return Ydt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Hdt)return Xdt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Gdt)return Kdt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?$dt(e):Jdt(e)}function Ydt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Oee,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(Oee,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Sm;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Xdt(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(SG(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(SG(a,i))}}return n}function Kdt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Wdt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};Mee(o,s),t.push(SG(o,s))}return t}function $dt(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};Mee(s,a),t.push(SG(s,a))}}return t}function Mee(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&Mee(r,t)&&(t[r.localName]=r.textContent)}return n}function SG(e,t){let n=new Sm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Jdt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Sm;return r.data=e,r.description=n.innerHTML,[r]}var Zdt=/<body>\s*<\/body>/im,Qdt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,eht=/<title>([\s\S]*)<\/title>/im;function VEe(e){if(Zdt.test(e)||Qdt.test(e))return;let t,n=eht.exec(e);n&&n.length>1&&(t=n[1]);let i=new Sm;return i.name=t,i.description=e,i.data=e,[i]}var Im=Vdt;function e2(e){e=e??H.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(e2.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)}}});e2.prototype.getFromCache=function(e,t,n,i){let r=jEe(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};e2.prototype.checkApproachingInterval=function(e,t,n,i){let r=jEe(e,t,n),o=this._tilesRequestedForInterval,s=HEe(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!GEe(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};e2.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=HEe(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=GEe(this,c,o),a||s.push(c)}}};function jEe(e,t,n){return`${e}-${t}-${n}`}function tht(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function HEe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=K.secondsDifference(c.stop,i),++a):(s=K.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function GEe(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=tht(s),c=new wo({throttle:!1,throttleByServer:!0,type:Zs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var QT=e2;var nht=[3034,3035,3042,3043,3044],iht=[4471,4559];function Pm(e){if(e=e??H.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=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Pm.DefaultParameters,!0),n.setQueryParameters(Pm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(WEe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(WEe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new QT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return qEe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof gi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!iht.includes(a)||nht.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof gi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ds({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Qi({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:e.getFeatureInfoFormats??Pm.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function qEe(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function rht(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Pm.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}}});Pm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Pm.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=qEe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Pm.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return rht(this,e,t,n,i,r,s)};Pm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Pm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Pm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Im("json","application/json")),Object.freeze(new Im("xml","text/xml")),Object.freeze(new Im("text","text/html"))]);function WEe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var t2=Pm;function qf(e){e=e??H.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._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,s=e.format??"image/jpeg",a=o.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(o)?(t.setQueryParameters(qf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(qf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(qf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(YEe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(qf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(YEe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new QT({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return XEe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Ds({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Do({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:e.getFeatureInfoFormats??qf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:sht(this)})}function XEe(e,t,n,i,r,o){let s=e._tileProvider;return KEe(e,s._resource,o),s.requestImage(t,n,i,r)}function oht(e,t,n,i,r,o,s){let a=e._tileProvider;return KEe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(qf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});qf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};qf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=XEe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};qf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return oht(this,e,t,n,i,r,s)};qf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});qf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});qf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Im("json","application/json")),Object.freeze(new Im("xml","text/xml")),Object.freeze(new Im("text","text/html"))]);function KEe(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Ot(o,i)),l(r)&&(o=Ot(o,r)),t.setQueryParameters(o)}}function sht(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function YEe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var n2=qf;var $Ee=/\/$/;function A_(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Ho?e.url:De.createIfNeeded(e.url??Aa.mapTilesApiEndpoint),n=t.getUrlComponent();$Ee.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new It(r)));let o=new Ds({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(A_.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}}});A_.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=JEe(e),i=Ho._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),s=o.options.url;return delete o.options.url,o.options={...o.options,...r},Nee(s,o,i)};A_.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Aa.mapTilesApiEndpoint,e.key=e.key??Aa.defaultApiKey;let t=e.overlayLayerType,n=await cht(e);return new A_({...n,...e,credit:e.credit??Aa.getDefaultCredit()})};A_.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};A_.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};A_.prototype.pickFeatures=function(e,t,n,i,r){};A_.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(aht(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r];if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function aht(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function JEe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function cht(e){let{language:t,region:n,key:i,url:r}=e,o=JEe(e),s=r.url??r;$Ee.test(s)||(s+="/");let a=await De.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(a)}var i2=A_;var lht=/\/$/;function Ew(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Ho?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();lht.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new It(o)));let s=new Ds({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(Ew.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}}});Ew.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};Ew.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};Ew.prototype.pickFeatures=function(e,t,n,i,r){};Ew.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(uht(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r].join(",");if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function uht(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var r2=Ew;var fht=async(e,t,n)=>jA.fromUrl(new Ho(t,n)),dht=async(e,{options:t})=>y_.fromUrl(e,t),hht=async(e,{options:t})=>XB.fromUrl(e,t),mht=async(e,{options:t})=>{let n=t.channel;return delete t.channel,JB.fromUrl(e,n,t)},pht=async(e,{options:t})=>new ZB({url:e,...t}),ght=async(e,{options:t})=>QB.fromUrl(e,t),_ht=async(e,{options:t})=>jA.fromUrl(e,t),yht=async(e,{options:t})=>new Ds({url:e,...t}),Aht=async(e,{options:t})=>new t2({url:e,...t}),bht=async(e,{options:t})=>new n2({url:e,...t}),Nee=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ho(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=r,new i2({...t.options,url:i})},xht=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ho(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=r,new r2({...t.options,url:i})},Tht={ARCGIS_MAPSERVER:dht,BING:hht,GOOGLE_EARTH:mht,MAPBOX:pht,SINGLE_TILE:ght,TMS:_ht,URL_TEMPLATE:yht,WMS:Aht,WMTS:bht,GOOGLE_2D_MAPS:Nee,AZURE_MAPS:xht,defaultFactoryCallback:fht},Cw=Object.freeze(Tht);function l0(){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(l0.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(){}}});l0.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Ho._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=l0._endpointCache[i];l(r)||(r=n.fetchJson(),l0._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let s=o.externalType,a=Cw.defaultFactoryCallback;o=Je(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=Cw[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new l0(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Ho.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};l0.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};l0.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};l0.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};l0._endpointCache={};var lu=l0;var ZEe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(ZEe);var b_=ZEe;function Eht(e){e=e??H.EMPTY_OBJECT;let t=e.style??b_.AERIAL;return lu.fromAssetId(t)}var x_=Eht;var o2=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var s2=`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 QEe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(QEe);var Vn=QEe;function vw(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=Vn.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(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}vw.createPlaceholder=function(e){let t=new vw(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};vw.prototype.addReference=function(){++this.referenceCount};vw.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(),ue(this),0):this.referenceCount};vw.prototype.processStateMachine=function(e,t,n){this.state===Vn.UNLOADED&&!n&&(this.state=Vn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Vn.RECEIVED&&(this.state=Vn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Vn.READY&&t&&!this.texture;(this.state===Vn.TEXTURE_LOADED||i)&&(this.state=Vn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var Sw=vw;function Lee(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}Lee.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};Lee.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Vn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==Vn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==Vn.FAILED&&o.state!==Vn.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===Vn.FAILED||i.state===Vn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var ww=Lee;function Gi(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Gi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Gi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Gi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Gi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Gi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Gi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Gi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Gi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new ww(Sw.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=t.colorToAlphaThreshold??Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Gi.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}}});Gi.DEFAULT_BRIGHTNESS=1;Gi.DEFAULT_CONTRAST=1;Gi.DEFAULT_HUE=0;Gi.DEFAULT_SATURATION=1;Gi.DEFAULT_GAMMA=1;Gi.DEFAULT_SPLIT=qo.NONE;Gi.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Gi.DEFAULT_MAGNIFICATION_FILTER=Jn.LINEAR;Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Gi.fromProviderAsync=function(e,t){let n=new Gi(void 0,t);return Iht(n,Promise.resolve(e)),n};Gi.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Gi.fromProviderAsync(x_({style:e.style}),e)};Gi.prototype.isBaseLayer=function(){return this._isBaseLayer};Gi.prototype.isDestroyed=function(){return!1};Gi.prototype.destroy=function(){return ue(this)};var nCe=new ie,eCe=new ie,Fee=new ie,iCe=new ie;Gi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Gi.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 r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof gi&&e.rectangle.north<gi.MaximumLatitude&&e.rectangle.south>-gi.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,nCe),a=ie.intersection(e.rectangle,s,eCe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,P=e.rectangle;a=eCe,P.south>=w.north?a.north=a.south=w.north:P.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(P.south,w.south),a.north=Math.min(P.north,w.north)),P.west>=w.east?a.west=a.east=w.east:P.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(P.west,w.west),a.east=Math.min(P.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Sht(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(a),d),y=g.positionToTileXY(ie.southeast(a),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let E=ie.clone(e.rectangle,iCe),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,Fee),I;o?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),A=E.width/512,b=E.height/512):I=g.tileXYToRectangle.bind(g);let R,O=0,L=1,_;!this.isBaseLayer()&&Math.abs(S.west-E.west)>=A&&(O=Math.min(1,(S.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(S.north-E.north)>=b&&(L=Math.max(0,(S.north-E.south)/E.height));let C=L;for(let w=m.x;w<=y.x;w++)if(R=O,v=I(w,m.y,d),S=ie.simpleIntersection(v,s,Fee),!!l(S)){O=Math.min(1,(S.east-E.west)/E.width),w===y.x&&(this.isBaseLayer()||Math.abs(S.east-E.east)<A)&&(O=1),L=C;for(let P=m.y;P<=y.y;P++){if(_=L,v=I(w,P,d),S=ie.simpleIntersection(v,s,Fee),!l(S))continue;L=Math.max(0,(S.south-E.south)/E.height),P===y.y&&(this.isBaseLayer()||Math.abs(S.south-E.south)<b)&&(L=0);let M=new se(R,L,O,_),F=this.getImageryFromCache(w,P,d);i.imagery.splice(n,0,new ww(F,M,o)),++n}}return!0};Gi.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,nCe),i=c.rectangleToNativeRectangle(i,iCe)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Gi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=Vn.RECEIVED,e.request=void 0,$r.reportSuccess(n._requestImageError)}function r(s){if(e.request.state===Ti.CANCELLED){e.state=Vn.UNLOADED,e.request=void 0;return}e.state=Vn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=$r.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o()}function o(){let s=new wo({throttle:!1,throttleByServer:!0,type:Zs.IMAGERY});e.request=s,e.state=Vn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Vn.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){r(c)})}o()};Gi.prototype._createTextureWebGL=function(e,t){let n=new jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Ke.RGBA:Ke.RGB,sampler:n})};Gi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=Vn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=Vn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof gi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function tCe(e,t,n){return`${e}:${t}:${n}`}Gi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===Jn.LINEAR&&!Ke.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=kt.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=tCe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Pd.NICEST),t.sampler=u}else{let o=tCe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Gi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Ui)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new bf({persists:!0,owner:this,preExecute:function(c){vht(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=Vn.READY,t.releaseReference()},canceled:function(){t.state=Vn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=Vn.READY};Gi.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};Gi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Gi.prototype.getImageryFromCache=function(e,t,n,i){let r=rCe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new Sw(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Gi.prototype.removeImageryFromCache=function(e){let t=rCe(e.x,e.y,e.level);delete this._imageryCache[t]};function rCe(e,t,n){return JSON.stringify([e,t,n])}var wG={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},Cht=dn.supportsTypedArrays()?new Float32Array(128):void 0;function vht(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=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 A=new Float32Array(256),b=0;for(let S=0;S<64;++S){let I=S/63;A[b++]=0,A[b++]=I,A[b++]=1,A[b++]=I}let x={position:0,webMercatorT:1},T=qr.getRegularGridIndices(2,64),E=tt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new zn({context:t,attributes:[{index:x.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Ye({sources:[s2]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:o2,attributeLocations:x}),r.sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;wG.textureDimensions.x=o,wG.textureDimensions.y=s,wG.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Dt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(o)&&D.isPowerOfTwo(s)&&d.generateMipmap(Pd.NICEST);let p=i.south,g=i.north,m=Cht,y=0;for(let A=0;A<64;++A){let b=A/63,x=D.lerp(p,g,b);a=Math.sin(x);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=E,m[y++]=E}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=wG,e.vertexArray=r.vertexArray}function Sht(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ui?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function wht(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Iht(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){wht(e._errorEvent,i)}}var Rs=Gi;var Bee=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},a2=Bee;var kee=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},Iw=kee;var Pht=new ie,oCe=new ie,Dht=new ie,Rht=new ie,Oht=new ie,Mht=new ie,Uee=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),s=ie.intersection(r.rectangle,n.rectangle,Pht),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=Rht;a.rectangleToNativeRectangle(t,u);let f=Oht;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,Dht);if(!l(b))return;let x=Mht;return a.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(ie.northwest(o),r),a=i.positionToTileXY(ie.southeast(o),r),c=new Iw;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,oCe);return l(i)?i:e._clampRectangle(t,n,oCe)}static _computeImageryCoverages(t,n,i,r,o){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=o(a,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(a,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(a,u,i),g=new e(a,u,i,d,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new Iw);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},Pw=Uee;var zee=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new et;et.fromRectangle(i,r,o);let s=e.createProjectedPositions(t,r),a=e.computeTexCoords(s,o);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=Ea.readAttributeAsTypedArray(t),o=t.type,s=Vt.getNumberOfComponents(o),a=e.createIterableCartesian3FromTypedArray(r,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<r;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),r=Math.min(r,a.latitude),o=Math.max(o,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=r,n.east=o,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(N.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new U,r=1/n.width,o=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*r,u=(a.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ct.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new U(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},eE=zee;var Vee=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},c2=Vee;var jee=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new N,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=t[r];this._deleteCoverages(o,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=tt.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!N.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=eE.createCartographicPositions(r,s,d),g=eE.computeCartographicBoundingRectangle(p),m=new c2(p,o,g,d);a.push(m)}return N.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getEllipsoid(o);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getProjection(o);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=eE.createTextureCoordinatesAttributeForMappedPositions(a,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let s=0;s<o;s++){let a=r.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return Pw.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,s=1,a=n.width,c=o.width;n.height>n.width&&(a=n.height,c=o.height);let u=Math.log2(s*c/a);return Pw._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let s=0;s<r;s++){let a=i[s],c=a.length;for(let u=0;u<c;u++){let d=a[u].imagery;d.state===Vn.READY||d.state===Vn.FAILED||d.state===Vn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),ue(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new N);let r=t.sceneGraph;return N.clone(N.IDENTITY,i),N.multiply(i,t.modelMatrix,i),N.multiply(i,r.components.transform,i),N.multiply(i,r.axisCorrectionMatrix,i),N.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},tE=jee;var Hee=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},l2=Hee;var Nht=!1,Lht=new ie,Fht=new ie,Gee=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let s=r.imageryLayers,a=tE._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,o,u);if(f.length===0)return;f.length>10&&(_t("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<s.length;p++)d.push(s.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(o,r),e._defineUniforms(o,s),e._buildSampleAndBlendFunction(o,s),e._createMainImageryShader(o,i,s);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,de.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new a2;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Rs.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Rs.DEFAULT_CONTRAST,n.hue|=r.hue!==Rs.DEFAULT_HUE,n.saturation|=r.saturation!==Rs.DEFAULT_SATURATION,n.gamma|=r.gamma!==Rs.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,de.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),Nht&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",de.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let a=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],s=o.imageryLayer,a=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=a,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=s.alpha,i.imageryTextureBrightness[r]=s.brightness,i.imageryTextureContrast[r]=s.contrast,i.imageryTextureHue[r]=s.hue,i.imageryTextureSaturation[r]=s.saturation,i.imageryTextureOneOverGamma[r]=1/s.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[r]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=s.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let s=t.get(o);if(!s.show)continue;let a=i[o],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(s,p,u,a);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===Vn.FAILED||o.state===Vn.INVALID)return;let s=o.textureWebMercator;if(!l(s)&&(s=o.texture,!l(s))){o.state===Vn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new l2(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,Lht),s=r.rectangleToNativeRectangle(i,Fht);return e._computeTextureTranslationAndScaleFromNative(o,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,s=t.south-n.south,a=o*i,c=s*r,u=t.width*i,f=t.height*r;return new se(a,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let s=t[o],a=n.indexOf(s);i.push(a)}return i}},u2=Gee;var f2=`#ifdef USE_IBL_LIGHTING vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) @@ -4524,7 +6006,7 @@ color = czm_linearToSrgb(color); #endif material.diffuse = color; } -`;var Rje={UNLIT:0,PBR:1},Dm=Object.freeze(Rje);var Gce={name:"LightingPipelineStage"};Gce.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(c(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ge.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ge.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Dm.PBR?o.addDefine("LIGHTING_PBR",void 0,ge.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ge.FRAGMENT),o.addFragmentLines(dM)};var hM=Gce;var mM=`bool isDefaultStyleColor(vec3 color) +`;var sCe={UNLIT:0,PBR:1};Object.freeze(sCe);var u0=sCe;var aCe={name:"LightingPipelineStage"};aCe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,de.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",de.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===u0.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(f2)};var d2=aCe;var h2=`bool isDefaultStyleColor(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -4534,16 +6016,12 @@ 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)); +texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); #endif return texCoord; } @@ -4581,7 +6059,16 @@ vec3 bitangent = normalize(cross(geometryNormal, tangent)); #endif #ifdef HAS_NORMAL_TEXTURE mat3 tbn = mat3(tangent, bitangent, geometryNormal); -vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; +vec3 normalSample; +#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb; +#else +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb; +#endif +#else +normalSample = texture(u_normalTexture, normalTexCoords).rgb; +#endif normalSample = 2.0 * normalSample - 1.0; #ifdef HAS_NORMAL_TEXTURE_SCALE normalSample.xy *= u_normalTextureScale; @@ -4619,7 +6106,16 @@ 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; +vec3 normalSample; +#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb; +#else +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb; +#endif +#else +normalSample = texture(u_normalTexture, normalTexCoords).rgb; +#endif normalSample = 2.0 * normalSample - 1.0; #ifdef HAS_NORMAL_TEXTURE_SCALE normalSample.xy *= u_normalTextureScale; @@ -4671,11 +6167,20 @@ vec4 getBaseColorFromTexture() { vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM -baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); +baseColorTexCoords = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); #endif -vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); -#ifdef HAS_BASE_COLOR_FACTOR -baseColorWithAlpha *= u_baseColorFactor; +vec4 baseColorWithAlpha; +#if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform)); +#else +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); +#endif +#else +baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); +#endif +#ifdef HAS_BASE_COLOR_FACTOR +baseColorWithAlpha *= u_baseColorFactor; #endif return baseColorWithAlpha; } @@ -4685,7 +6190,7 @@ vec3 getEmissiveFromTexture() { vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM -emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); +emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); #endif vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); #ifdef HAS_EMISSIVE_FACTOR @@ -4700,7 +6205,7 @@ 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); +specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); #endif vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); vec3 specular = specularGlossiness.rgb; @@ -4726,7 +6231,7 @@ float glossiness = 1.0; #ifdef HAS_DIFFUSE_TEXTURE vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM -diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); +diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); #endif vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); #ifdef HAS_DIFFUSE_FACTOR @@ -4748,7 +6253,7 @@ 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); +metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); #endif vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; float metalness = clamp(metallicRoughness.b, 0.0, 1.0); @@ -4784,7 +6289,7 @@ 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); +specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); #endif float specularWeight = texture(u_specularTexture, specularTexCoords).a; #ifdef HAS_SPECULAR_FACTOR @@ -4800,7 +6305,7 @@ float specularWeight = 1.0; #ifdef HAS_SPECULAR_COLOR_TEXTURE vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM -specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); +specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); #endif vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); @@ -4829,7 +6334,7 @@ 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); +anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); #endif vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; direction = anisotropySample.rg * 2.0 - vec2(1.0); @@ -4850,7 +6355,7 @@ void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attri #ifdef HAS_CLEARCOAT_TEXTURE vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM -clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); +clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); #endif float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; #ifdef HAS_CLEARCOAT_FACTOR @@ -4866,7 +6371,7 @@ float clearcoatFactor = 0.0; #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM -clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); +clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); #endif float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR @@ -4898,11 +6403,16 @@ material.normalEC = normalInfo.normal; material.normalEC = computeNormal(attributes); #endif vec4 baseColorWithAlpha = vec4(1.0); -#ifdef HAS_BASE_COLOR_TEXTURE +#ifdef HAS_BACKGROUND_FILL +baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor); +#elif defined(HAS_BASE_COLOR_TEXTURE) baseColorWithAlpha = getBaseColorFromTexture(); #elif defined(HAS_BASE_COLOR_FACTOR) baseColorWithAlpha = u_baseColorFactor; #endif +#ifdef HAS_IMAGERY +baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha); +#endif // HAS_IMAGERY #ifdef HAS_POINT_CLOUD_COLOR_STYLE baseColorWithAlpha = v_pointCloudColor; #elif defined(HAS_COLOR_0) @@ -4921,7 +6431,7 @@ material.alpha = baseColorWithAlpha.a; #ifdef HAS_OCCLUSION_TEXTURE vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM -occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); +occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; #endif @@ -4945,7 +6455,87 @@ setClearcoat(material, attributes); #endif #endif } -`;var{Material:Mje,MetallicRoughness:fW,SpecularGlossiness:dW,Specular:jce,Clearcoat:Wce}=Tn,qce={name:"MaterialPipelineStage",_processTexture:jl,_processTextureTransform:Yce};qce.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=c(o.classificationType),l=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;Nje(i,r,s,u,f,h,l),c(i.specularGlossiness)?Fje(i.specularGlossiness,r,s,u,l):(c(i.specular)&&$t.supportedExtensions.KHR_materials_specular&&Bje(i.specular,r,s,u,l),c(i.anisotropy)&&$t.supportedExtensions.KHR_materials_anisotropy&&Uje(i.anisotropy,r,s,u,l),c(i.clearcoat)&&$t.supportedExtensions.KHR_materials_clearcoat&&Vje(i.clearcoat,r,s,u,l),zje(i.metallicRoughness,r,s,u,l));let p=$t.getAttributeBySemantic(t,ht.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=Dm.UNLIT:g.lightingModel=Dm.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let y=e.alphaOptions;i.alphaMode===Em.BLEND?y.pass=De.TRANSLUCENT:i.alphaMode===Em.MASK&&(y.alphaCutoff=i.alphaCutoff),s.addFragmentLines(mM),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ge.BOTH)};function Yce(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ge.FRAGMENT),t[s]=function(){return n.transform}}function Lje(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ge.FRAGMENT),t[s]=function(){return n.scale}}function jl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ge.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ge.FRAGMENT);let l=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,l,ge.FRAGMENT);let f=n.transform;c(f)&&!J.equals(f,J.IDENTITY)&&Yce(e,t,n,i,o);let{scale:h}=n;c(h)&&h!==1&&Lje(e,t,n,i,o)}function Nje(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:l,normalTexture:u,occlusionTexture:f}=e;c(a)&&!d.equals(a,Mje.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ge.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ge.FRAGMENT),c(l)&&!s&&jl(n,t,l,"u_emissiveTexture","EMISSIVE",r)),c(u)&&!s&&jl(n,t,u,"u_normalTexture","NORMAL",o),c(f)&&!s&&jl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function Fje(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:l,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ge.FRAGMENT),c(r)&&!o&&jl(n,t,r,"u_diffuseTexture","DIFFUSE",i),c(s)&&!se.equals(s,dW.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ge.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ge.FRAGMENT)),c(a)&&!o&&jl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),c(l)&&!d.equals(l,dW.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ge.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),c(u)&&u!==dW.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ge.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ge.FRAGMENT))}function Bje(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:l}=e;n.addDefine("USE_SPECULAR",void 0,ge.FRAGMENT),c(r)&&!o&&jl(n,t,r,"u_specularTexture","SPECULAR",i),c(s)&&s!==jce.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ge.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),c(a)&&!o&&jl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),c(l)&&!d.equals(l,jce.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ge.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ge.FRAGMENT))}var kje=new d;function Uje(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ge.FRAGMENT),c(a)&&!o&&jl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let l=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",ge.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(l,u,r,kje)}}function Vje(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:l,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,ge.FRAGMENT),c(r)&&r!==Wce.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ge.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ge.FRAGMENT)),c(s)&&!o&&jl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),c(a)&&r!==Wce.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ge.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT)),c(l)&&!o&&jl(n,t,l,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),c(u)&&!o&&jl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function zje(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ge.FRAGMENT);let r=e.baseColorTexture;c(r)&&!o&&jl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;c(s)&&!se.equals(s,fW.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ge.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ge.FRAGMENT));let a=e.metallicRoughnessTexture;c(a)&&!o&&jl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=e.metallicFactor;c(l)&&l!==fW.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ge.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ge.FRAGMENT));let u=e.roughnessFactor;c(u)&&u!==fW.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ge.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT))}var pM=qce;var ol={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"};ol.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ol.METADATA_PICKING_VALUE_TYPE,"float",ge.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_STRING,"0.0",ge.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ge.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ge.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ge.FRAGMENT),i.addDefine(ol.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ge.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ge.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${ol.METADATA_PICKING_VALUE_TYPE} value = ${ol.METADATA_PICKING_VALUE_TYPE}(${ol.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ol.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ol.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ol.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ol.METADATA_PICKING_VALUE_COMPONENT_W};`],ge.FRAGMENT)};var Pu=ol;var _M=`void morphTargetsStage(inout ProcessedAttributes attributes) +`;var m2=`#ifdef HAS_CONSTANT_LOD +float modelScaleX = length(czm_model[0].xyz); +float modelScaleY = length(czm_model[1].xyz); +float modelScaleZ = length(czm_model[2].xyz); +float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0; +vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz; +v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale; +v_constantLodUvCustom.z = u_constantLodDistance / modelScale; +#endif +`;var p2=`#ifdef HAS_CONSTANT_LOD +vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) { +bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; +bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; +bool atClampBoundary = atMaxClamp || atMinClamp; +float effectiveDistance = atMaxClamp ? constantLodParams.y : +(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z); +float logDepth = log2(effectiveDistance); +logDepth = clamp(logDepth, -10.0, 20.0); +float f = fract(logDepth); +float p = floor(logDepth); +if (atClampBoundary) { +float clampedP = ceil(logDepth); +vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z; +return texture(textureSampler, tc); +} +vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z; +vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z; +return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); +} +vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) { +bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; +bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; +bool atClampBoundary = atMaxClamp || atMinClamp; +float effectiveDistance = atMaxClamp ? constantLodParams.y : +(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z); +float logDepth = log2(effectiveDistance); +logDepth = clamp(logDepth, -10.0, 20.0); +float f = fract(logDepth); +float p = floor(logDepth); +if (atClampBoundary) { +float clampedP = ceil(logDepth); +vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z; +tc = czm_computeTextureTransform(tc, textureTransform); +return texture(textureSampler, tc); +} +vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z; +vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z; +tc1 = czm_computeTextureTransform(tc1, textureTransform); +tc2 = czm_computeTextureTransform(tc2, textureTransform); +return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); +} +#endif +`;var{Material:Bht,MetallicRoughness:Wee,SpecularGlossiness:qee,Specular:cCe,Clearcoat:lCe}=En,uCe={name:"MaterialPipelineStage",_processTexture:Zu,_processTextureTransform:fCe};uCe.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:s}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let E=h.distance(T.positionWC,x.center);return Math.max(E,.1)}return 1});let a=l(r.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;jht(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Hht(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&Ght(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&qht(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&Yht(i.clearcoat,o,s,u,c),Xht(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&kht(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=u0.UNLIT:y.lightingModel=u0.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===Wp.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===Wp.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,de.BOTH),s.addUniform("float","u_pointDiameter",de.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&zht(i.lineStyle,t,n,o,s),s.addFragmentLines(h2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function kht(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,de.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,de.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",a,de.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,de.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,de.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",de.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function Uht(e,t,n,i,r,o){let s=n.constantLod;if(!l(s)||!l(o))return;let a=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(a,void 0,de.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,de.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",de.VERTEX),e.addUniform("float","u_constantLodDistance",de.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",de.VERTEX),e.addFragmentLines(p2);let u=m2.split(` +`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,de.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let u=N.clone(N.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=At.eastNorthUpToFixedFrame(p);N.inverse(g,u),f=!0}}return f?u:N.IDENTITY}}}function zht(e,t,n,i,r){let{width:o,pattern:s}=e;l(o)&&(r.addUniform("float","u_lineWidth",de.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(s)&&(r.addDefine("HAS_LINE_PATTERN",void 0,de.BOTH),r.addUniform("float","u_linePattern",de.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=xt.getAttributeBySemantic(t,ct.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Oe.LINES||t.primitiveType===Oe.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,de.VERTEX),a.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,de.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",de.VERTEX),r.addUniform("float","u_pixelsPerWorld",de.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=xt.getAttributeInfo(a).variableName;r.addVertexLines(` +#ifdef HAS_LINE_CUMULATIVE_DISTANCE +void lineStyleStageVS(in ProcessedAttributes attributes) +{ + float cumDist = attributes.${u}; +#ifdef LINE_CUM_DIST_NORMALIZED + cumDist *= u_cumulativeDistanceMax; +#endif + const float textureCoordinateBase = 8192.0; + v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; +} +#endif +`)}else l(s)&&r.addVertexLines(` +#ifdef HAS_LINE_PATTERN +void lineStyleStageVS(in ProcessedAttributes attributes) +{ + vec4 posClip = gl_Position; + vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw; + + const float textureCoordinateBase = 8192.0; + if (czm_viewport.z > czm_viewport.w) { + v_lineCoord = textureCoordinateBase + screenPos.x; + } else { + v_lineCoord = textureCoordinateBase + screenPos.y; + } +} +#endif +`)}function fCe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,de.FRAGMENT),t[s]=function(){return n.transform}}function Vht(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,de.FRAGMENT),t[s]=function(){return n.scale}}function Zu(e,t,n,i,r,o,s){e.addUniform("sampler2D",i,de.FRAGMENT),t[i]=function(){return n.texture??o};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,de.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,de.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&fCe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Vht(e,t,n,i,r),Uht(e,t,n,i,r,s)}function jht(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Bht.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",de.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,de.FRAGMENT),l(u)&&!s&&Zu(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!s){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Zu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Zu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Hht(e,t,n,i,r,o){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,de.FRAGMENT),l(s)&&!r&&Zu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,qee.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",de.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Zu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,qee.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",de.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(f)&&f!==qee.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",de.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,de.FRAGMENT))}function Ght(e,t,n,i,r){let{specularTexture:o,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,de.FRAGMENT),l(o)&&!r&&Zu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==cCe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",de.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(a)&&!r&&Zu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,cCe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",de.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,de.FRAGMENT))}var Wht=new h;function qht(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Zu(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",de.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,Wht)}}function Yht(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,de.FRAGMENT),l(o)&&o!==lCe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",de.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,de.FRAGMENT)),l(s)&&!r&&Zu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==lCe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",de.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Zu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Zu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Xht(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Zu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,Wee.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",de.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,de.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Zu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==Wee.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",de.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,de.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==Wee.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",de.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,de.FRAGMENT))}var g2=uCe;var uu={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"};uu.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(uu.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",de.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",de.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${uu.METADATA_PICKING_VALUE_TYPE} value = ${uu.METADATA_PICKING_VALUE_TYPE}(${uu.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${uu.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${uu.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${uu.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${uu.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Yf=uu;var _2=`void morphTargetsStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; attributes.positionMC = getMorphedPosition(positionMC); @@ -4958,7 +6548,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = getMorphedTangent(tangentMC); #endif } -`;var za={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)"};za.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ge.VERTEX),Yje(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let l=t.morphTargets[a].attributes,u=l.length;for(let f=0;f<u;f++){let h=l[f],p=h.semantic;p!==ht.POSITION&&p!==ht.NORMAL&&p!==ht.TANGENT||(Gje(e,h,e.attributeIndex,a),e.attributeIndex++)}}Xje(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ge.VERTEX),n.addVertexLines(_M);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=xt(s,e.uniformMap)};var Hje={attributeString:void 0,functionId:void 0};function Gje(e,t,n,i){let o=e.shaderBuilder;jje(e,t,n);let r=Wje(t,Hje);qje(o,r,i)}function jje(e,t,n){let i={index:n,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:nn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Wje(e,t){switch(e.semantic){case ht.POSITION:t.attributeString="Position",t.functionId=za.FUNCTION_ID_GET_MORPHED_POSITION;break;case ht.NORMAL:t.attributeString="Normal",t.functionId=za.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ht.TANGENT:t.attributeString="Tangent",t.functionId=za.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function qje(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 Yje(e){e.addFunction(za.FUNCTION_ID_GET_MORPHED_POSITION,za.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ge.VERTEX),e.addFunctionLines(za.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(za.FUNCTION_ID_GET_MORPHED_NORMAL,za.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ge.VERTEX),e.addFunctionLines(za.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(za.FUNCTION_ID_GET_MORPHED_TANGENT,za.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ge.VERTEX),e.addFunctionLines(za.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Xje(e){e.addFunctionLines(za.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(za.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(za.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var gM=za;var Xce={name:"PickingPipelineStage"};Xce.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)Kje(e,t,a,i);else if(c(a))$je(e,i);else{let l=Kce(e),u=i.createPickId(l);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",ge.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Kce(e,t){let n=e.model;if(c(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(pr.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,c(t)&&(o.instanceId=t),o}function Kje(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;c(i.featureTableId)?o=i.featureTableId:c(n)?(r=$t.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=$t.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let l=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ge.FRAGMENT);let f=l.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function $je(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=Kce(e,h),g=t.createPickId(p);s.push(g),i[h]=g;let m=g.color;o[h*4+0]=G.floatToByte(m.red),o[h*4+1]=G.floatToByte(m.green),o[h*4+2]=G.floatToByte(m.blue),o[h*4+3]=G.floatToByte(m.alpha)}r._pickIds=i;let a=yt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,ge.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var yM=Xce;var Zje={ADD:0,REPLACE:1},qo=Object.freeze(Zje);var bM=`float getPointSizeFromAttenuation(vec3 positionEC) { +`;var zc={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)"};zc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),emt(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ct.POSITION&&p!==ct.NORMAL&&p!==ct.TANGENT||($ht(e,d,e.attributeIndex,a),e.attributeIndex++)}}tmt(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(_2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var Kht={attributeString:void 0,functionId:void 0};function $ht(e,t,n,i){let r=e.shaderBuilder;Jht(e,t,n);let o=Zht(t,Kht);Qht(r,o,i)}function Jht(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Zht(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=zc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=zc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=zc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Qht(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function emt(e){e.addFunction(zc.FUNCTION_ID_GET_MORPHED_POSITION,zc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(zc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(zc.FUNCTION_ID_GET_MORPHED_NORMAL,zc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(zc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(zc.FUNCTION_ID_GET_MORPHED_TANGENT,zc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(zc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function tmt(e){e.addFunctionLines(zc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(zc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(zc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var y2=zc;var dCe={name:"PickingPipelineStage"};function Yee(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}dCe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)nmt(e,t,a,i);else if(l(a))imt(e,i);else{let c=hCe(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",de.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=Yee(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function hCe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Yo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function nmt(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=xt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=xt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",de.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=Yee(e.pickId)}function imt(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=hCe(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,de.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=Yee(e.pickId)}var A2=dCe;var mCe={ADD:0,REPLACE:1};Object.freeze(mCe);var bo=mCe;var b2=`float getPointSizeFromAttenuation(vec3 positionEC) { float pointSize = model_pointCloudParameters.x; float geometricError = model_pointCloudParameters.y; float depthMultiplier = model_pointCloudParameters.z; @@ -4996,10 +6586,10 @@ return 1.0; #endif } #endif -`;var Qje=new se,Zce={name:"PointCloudStylingPipelineStage"};Zce.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=c(s)?s.propertyAttributes:void 0,l=c(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!c(a)&&l;if(c(r)&&!u){let y=n6e(a),b=i6e(r,y);o6e(i,b);let A=r6e(b).indexOf("normalMC")>=0,C=$t.getAttributeBySemantic(t,ht.NORMAL);if(A&&!C)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=De.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,g;pr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===qo.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(bM);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Qje,b=1;p&&(b=g?5:h.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??b,y.x*=n.pixelRatio;let x=Jje(e,t,f,h);y.y=x*f.geometricErrorScale;let A=n.context,C=n.camera.frustum,S;return n.mode===oe.SCENE2D||C instanceof on?S=Number.POSITIVE_INFINITY:S=A.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=S,p&&(y.w=h.tileset.timeSinceLoad),y}};var $ce=new d;function Jje(e,t,n,i){if(c(i)){let f=i.tile.geometricError;if(f>0)return f}if(c(n.baseResolution))return n.baseResolution;let o=$t.getAttributeBySemantic(t,ht.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,$ce);a=B.multiplyByPointAsVector(s,a,$ce);let l=a.x*a.y*a.z;return O.cbrt(l/r)}var e6e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},t6e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function n6e(e){let t=je(t6e);if(!c(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 hW="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function i6e(e,t){let n=e6e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${hW})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${hW})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${hW})`,t,i),n.styleTranslucent=c(n.colorStyleFunction)&&i.translucent,n}function o6e(e,t){let n=t.colorStyleFunction;c(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ge.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;c(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ge.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;c(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ge.VERTEX),e.addVertexLines(o))}function mW(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 r6e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return c(t)&&mW(t,o),c(n)&&mW(n,o),c(i)&&mW(i,o),o}var xM=Zce;var TM=`void primitiveOutlineStage() { +`;var rmt=new se,gCe={name:"PointCloudStylingPipelineStage"};gCe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let y=cmt(a),A=lmt(o,y);umt(i,A);let x=fmt(A).indexOf("normalMC")>=0,T=xt.getAttributeBySemantic(t,ct.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,de.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,de.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,de.VERTEX);let d,p,g;Yo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===bo.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(b2);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=rmt,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=omt(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,E;return n.mode===re.SCENE2D||T instanceof gn?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var pCe=new h;function omt(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=xt.getAttributeBySemantic(t,ct.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,pCe);a=N.multiplyByPointAsVector(s,a,pCe);let c=a.x*a.y*a.z;return D.cbrt(c/o)}var smt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},amt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function cmt(e){let t=Je(amt);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var Xee="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function lmt(e,t){let n=smt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Xee})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Xee})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Xee})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function umt(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,de.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,de.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,de.VERTEX),e.addVertexLines(r))}function Kee(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function fmt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&Kee(t,r),l(n)&&Kee(n,r),l(i)&&Kee(i,r),r}var x2=gCe;var T2=`void primitiveOutlineStage() { v_outlineCoordinates = a_outlineCoordinates; } -`;var AM=`void primitiveOutlineStage(inout czm_modelMaterial material) { +`;var E2=`void primitiveOutlineStage(inout czm_modelMaterial material) { if (!model_showOutline) { return; } @@ -5012,7 +6602,7 @@ 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 Qce={name:"PrimitiveOutlinePipelineStage"};Qce.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ge.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:nn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ge.FRAGMENT);let a=wx.createTexture(n.context);o.model_outlineTexture=function(){return a};let l=e.model;i.addUniform("vec4","model_outlineColor",ge.FRAGMENT),o.model_outlineColor=function(){return l.outlineColor},i.addUniform("bool","model_showOutline",ge.FRAGMENT),o.model_showOutline=function(){return l.showOutline},i.addVertexLines(TM),i.addFragmentLines(AM)};var CM=Qce;var Jce={name:"PrimitiveStatisticsPipelineStage",_countGeometry:ele,_count2DPositions:tle,_countMorphTargetAttributes:nle,_countMaterialTextures:ile,_countFeatureIdTextures:ole,_countBinaryMetadata:rle};Jce.process=function(e,t,n){let i=e.model,o=i.statistics;ele(o,t),tle(o,e.runtimePrimitive),nle(o,t),ile(o,t.material),ole(o,t.featureIds),rle(o,i)};function ele(e,t){let n=c(t.indices)?t.indices.count:$t.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=s6e(i,n));let o=t.attributes,r=o.length;for(let l=0;l<r;l++){let u=o[l];if(c(u.buffer)){let f=c(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;c(s)&&c(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(c(a)&&c(a.buffer)){let l=c(a.typedArray);e.addBuffer(a.buffer,l)}}function s6e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function tle(e,t){let n=t.positionBuffer2D;c(n)&&e.addBuffer(n,!0)}function nle(e,t){let n=t.morphTargets;if(!c(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 l=0;l<a;l++){let u=s[l];c(u.buffer)&&e.addBuffer(u.buffer,i)}}}function ile(e,t){let n=a6e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r)&&c(r.texture)&&e.addTexture(r.texture)}}function a6e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return c(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function ole(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Tn.FeatureIdTexture){let r=o.textureReader;c(r.texture)&&e.addTexture(r.texture)}}}function rle(e,t){let n=t.structuralMetadata;c(n)&&(c6e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!c(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function c6e(e,t){let n=t.propertyTextures;if(!c(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 u=s[a].textureReader;c(u.texture)&&e.addTexture(u.texture)}}}var EM=Jce;var l6e=new B,u6e=new B,sle={name:"SceneMode2DPipelineStage"};sle.process=function(e,t,n){let i=$t.getAttributeBySemantic(t,ht.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,l=B.multiplyTransformation(s,a,l6e),u=h6e(e,l,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(c(h))return;if(c(i.typedArray)){let y=_6e(i,l,u,n);f.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ge.VERTEX),o.addUniform("mat4","u_modelView2D",ge.VERTEX);let p=B.fromTranslation(u.center,new B),g=n.context,m={u_modelView2D:function(){return B.multiplyTransformation(g.uniformState.view,p,u6e)}};e.uniformMap=xt(m,e.uniformMap)};var f6e=new d,d6e=new d;function h6e(e,t,n){let i=B.multiplyByPoint(t,e.positionMin,f6e),o=Gi.computeActualEllipsoidPosition(n,i,i),r=B.multiplyByPoint(t,e.positionMax,d6e),s=Gi.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,s,new le)}var ale=new d;function m6e(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=d.fromArray(e,s,ale),l=d.multiplyComponents(a,r,a),u=d.add(l,o,l);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function p6e(e,t,n,i){let o;c(e.quantization)?o=m6e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=c(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let l=r;l<s;l+=a){let u=d.fromArray(o,l,ale);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=B.multiplyByPoint(t,u,u),h=Gi.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[l]=p.x,o[l+1]=p.y,o[l+2]=p.z}return o}function _6e(e,t,n,i){let o=je(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=p6e(e,t,r,o),a=yt.createVertexBuffer({context:i.context,typedArray:s,usage:Be.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var SM=sle;var wM=`void skinningStage(inout ProcessedAttributes attributes) +`;var _Ce={name:"PrimitiveOutlinePipelineStage"};_Ce.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,de.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",de.FRAGMENT);let a=XT.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",de.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",de.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(T2),i.addFragmentLines(E2)};var C2=_Ce;var yCe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:ACe,_count2DPositions:bCe,_countMorphTargetAttributes:xCe,_countMaterialTextures:TCe,_countFeatureIdTextures:ECe,_countBinaryMetadata:CCe};yCe.process=function(e,t,n){let i=e.model,r=i.statistics;ACe(r,t),bCe(r,e.runtimePrimitive),xCe(r,t),TCe(r,t.material),ECe(r,t.featureIds),CCe(r,i)};function ACe(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Oe.POINTS?e.pointsLength+=n:Oe.isTriangles(i)&&(e.trianglesLength+=dmt(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}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 dmt(e,t){switch(e){case Oe.TRIANGLES:return t/3;case Oe.TRIANGLE_STRIP:case Oe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function bCe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function xCe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function TCe(e,t){let n=hmt(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function hmt(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 ECe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof En.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function CCe(e,t){let n=t.structuralMetadata;l(n)&&(mmt(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function mmt(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var v2=yCe;var pmt=new N,gmt=new N,vCe={name:"SceneMode2DPipelineStage"};vCe.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,ct.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=N.multiplyTransformation(s,a,pmt),u=Amt(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=Tmt(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,de.VERTEX),r.addUniform("mat4","u_modelView2D",de.VERTEX);let p=N.fromTranslation(u.center,new N),g=n.context,m={u_modelView2D:function(){return N.multiplyTransformation(g.uniformState.view,p,gmt)}};e.uniformMap=Ot(m,e.uniformMap)};var _mt=new h,ymt=new h;function Amt(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,_mt),r=hr.computeActualEllipsoidPosition(n,i,i),o=N.multiplyByPoint(t,e.positionMax,ymt),s=hr.computeActualEllipsoidPosition(n,o,o);return ce.fromCornerPoints(r,s,new ce)}var SCe=new h;function bmt(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,SCe),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function xmt(e,t,n,i){let r;l(e.quantization)?r=bmt(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,SCe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=N.multiplyByPoint(t,u,u),d=hr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function Tmt(e,t,n,i){let r=Je(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=xmt(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var S2=vCe;var w2=`void skinningStage(inout ProcessedAttributes attributes) { mat4 skinningMatrix = getSkinningMatrix(); mat3 skinningMatrixMat3 = mat3(skinningMatrix); @@ -5027,7 +6617,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = skinningMatrixMat3 * tangentMC; #endif } -`;var Ix={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Ix.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ge.VERTEX),y6e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ge.VERTEX),n.addVertexLines(wM);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=xt(r,e.uniformMap)};function g6e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===ht.JOINTS||r.semantic===ht.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function y6e(e,t){e.addFunction(Ix.FUNCTION_ID_GET_SKINNING_MATRIX,Ix.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ge.VERTEX),e.addFunctionLines(Ix.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=g6e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let l=r[o],u=`skinnedMatrix += a_weights_${i}.${l} * u_jointMatrices[int(a_joints_${i}.${l})];`;e.addFunctionLines(Ix.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(Ix.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var vM=Ix;var DM=`void verticalExaggerationStage( +`;var nE={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};nE.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),Cmt(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(w2);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function Emt(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ct.JOINTS||o.semantic===ct.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function Cmt(e,t){e.addFunction(nE.FUNCTION_ID_GET_SKINNING_MATRIX,nE.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(nE.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=Emt(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(nE.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(nE.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var I2=nE;var P2=`void verticalExaggerationStage( inout ProcessedAttributes attributes ) { vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); @@ -5036,29 +6626,28 @@ float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCu float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; -vec3 vertexNormal = normalize(centerToVertex); +vec3 vertexEllipsoidNormalEC = normalize(centerToVertex); 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; -float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); +float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexEllipsoidNormalEC); float smallAngleVersine = 0.5 * sinTheta * sinTheta; float versine = isSmallAngle ? smallAngleVersine : exactVersine; -float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; +float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; float vertexHeight = czm_eyeHeight + dHeight; -vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; -vertexNormalMC = normalize(vertexNormalMC); +vec3 exaggerationDirectionScaledMC = (czm_inverseModelView * vec4(vertexEllipsoidNormalEC, 0.0)).xyz; float stretch = u_verticalExaggerationAndRelativeHeight.x; float shift = u_verticalExaggerationAndRelativeHeight.y; float exaggeration = (vertexHeight - shift) * (stretch - 1.0); -attributes.positionMC += exaggeration * vertexNormalMC; +attributes.positionMC += exaggeration * exaggerationDirectionScaledMC; } -`;var cle={name:"VerticalExaggerationPipelineStage"},b6e=new H;cle.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(DM),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ge.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ge.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return H.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,b6e)}};var PM=cle;var pW={};function x6e(e){let t=Fe.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 T6e(e,t){let n=t.length,i=Fe.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],l=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=l,i[o++]=l,i[o++]=s}return i}function A6e(e){let t=e-2,n=2+t*4,i=Fe.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 C6e(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let l=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=l}return r}function E6e(e){let t=e-2,n=2+t*4,i=Fe.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 S6e(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let l=0;l<i;l++){let u=t[l+1],f=t[l+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}pW.createWireframeIndices=function(e,t,n){let i=c(n);if(e===Me.TRIANGLES)return i?T6e(t,n):x6e(t);if(e===Me.TRIANGLE_STRIP)return i?C6e(t,n):A6e(t);if(e===Me.TRIANGLE_FAN)return i?S6e(t,n):E6e(t)};pW.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var gE=pW;var lle={name:"WireframePipelineStage"};lle.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ge.FRAGMENT);let o=e.model,r=w6e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,l=e.count;e.primitiveType=Me.LINES,e.count=gE.getWireframeIndicesCount(a,l)};function w6e(e,t,n){let o=$t.getAttributeBySemantic(e,ht.POSITION).count,r=n.context.webgl2,s;if(c(t)){let f=t.buffer,h=t.count;c(f)&&r?(s=f.sizeInBytes===h?new Uint8Array(h):Fe.createTypedArray(o,h),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,l=gE.createWireframeIndices(a,o,s),u=Fe.fromSizeInBytes(l.BYTES_PER_ELEMENT);return yt.createIndexBuffer({context:n.context,typedArray:l,usage:Be.STATIC_DRAW,indexDatatype:u})}var IM=lle;function ule(e){e=e??W.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;T.typeOf.object("options.primitive",t),T.typeOf.object("options.node",n),T.typeOf.object("options.model",i),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=[]}ule.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,u=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=c(n.morphTargets)&&n.morphTargets.length>0,p=c(i.skin),g=c(r),y=!(g&&c(r.fragmentShaderText))||r.mode!==y_.REPLACE_MATERIAL,b=$t.hasQuantizedAttributes(n.attributes),x=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),A=o.pointCloudShading,C=c(A)&&A.attenuation,S=c(A)&&A.backFaceCulling,v=n.primitiveType===Me.POINTS&&(c(s)||C||S),P=o._enableShowOutline&&c(n.outlineCoordinates),M=v6e(o,i,n),R=c(o.classificationType);u&&t.push(SM),t.push(fM),x&&t.push(IM),R&&t.push(KR),h&&t.push(gM),p&&t.push(vM),v&&t.push(xM),b&&t.push(aM),y&&t.push(pM),t.push(My),t.push(Uf),t.push(Pu),M.hasPropertyTable&&(t.push(Ny),t.push(XR),t.push(QR)),f&&t.push(PM),g&&t.push(rM),t.push(hM),o.allowPicking&&t.push(yM),P&&t.push(CM),t.push(YR),t.push(EM)};function v6e(e,t,n){let i;return c(t.instances)&&(i=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(i))?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:(i=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),c(i)?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var OM=ule;function _W(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.skin",e.skin),T.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],D6e(this)}Object.defineProperties(_W.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 D6e(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 l=0;l<o;l++){let u=i[l].index,f=r[u];s.push(f);let h=n[l],p=fle(f,h,new B);a.push(p)}}function fle(e,t,n){let i=B.multiplyTransformation(e.transformToRoot,e.transform,n);return n=B.multiplyTransformation(i,t,n),n}_W.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]=fle(i,o,e[n])}};var RM=_W;function P6e(){this.pass=void 0,this.alphaCutoff=void 0}var MM=P6e;function I6e(e){T.typeOf.object("model",e),this.shaderBuilder=new wb,this.model=e,this.uniformMap={},this.alphaOptions=new MM,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var LM=I6e;var NM=`void silhouetteStage(inout vec4 color) { +`;var wCe={name:"VerticalExaggerationPipelineStage"},vmt=new U;wCe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(P2),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,de.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",de.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,vmt)}};var D2=wCe;var ICe={name:"WireframePipelineStage"};ICe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=Smt(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Oe.LINES,e.count=kS.getWireframeIndicesCount(a,c)};function Smt(e,t,n){let r=xt.getAttributeBySemantic(e,ct.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):je.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=kS.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var R2=ICe;function PCe(e){e=e??H.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=[]}PCe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==__.REPLACE_MATERIAL,b=xt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Oe.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),T=r.pointCloudShading,E=l(T)&&T.attenuation,v=l(T)&&T.backFaceCulling,S=n.primitiveType===Oe.POINTS&&(l(s)||E||v),I=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=wmt(r,i,n),L=l(r.classificationType);u&&t.push(S2),t.push(WB),x&&t.push(R2),L&&t.push(CB),d&&t.push(y2),p&&t.push(I2),S&&t.push(x2),b&&t.push(FB),g&&(I?_t("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(u2)),A&&t.push(g2),t.push(UA),t.push(eh),t.push(Yf),O.hasPropertyTable&&(t.push(VA),t.push(EB),t.push(wB)),f&&t.push(D2),m&&t.push(NB),t.push(d2),r.allowPicking&&t.push(A2),I&&t.push(C2),R&&(e.edgeVisibilityRequested=!0,t.push(VB),t.push(kB)),t.push(TB),t.push(v2)};function wmt(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var O2=PCe;function $ee(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],Imt(this)}Object.defineProperties($ee.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 Imt(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=DCe(f,d,new N);a.push(p)}}function DCe(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}$ee.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=DCe(i,r,e[n])}};var M2=$ee;function Pmt(){this.pass=void 0,this.alphaCutoff=void 0}var iE=Pmt;function Dmt(e){this.shaderBuilder=new dg,this.model=e,this.uniformMap={},this.alphaOptions=new iE,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var N2=Dmt;var L2=`void silhouetteStage(inout vec4 color) { if(model_silhouettePass) { color = czm_gammaCorrect(model_silhouetteColor); } } -`;var FM=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +`;var F2=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { #ifdef HAS_NORMALS if(model_silhouettePass) { vec3 normal = normalize(czm_normal3D * attributes.normalMC); @@ -5068,14 +6657,14 @@ positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixel } #endif } -`;var Iz={name:"ModelSilhouettePipelineStage"};Iz.silhouettesLength=0;Iz.process=function(e,t,n){c(t._silhouetteId)||(t._silhouetteId=++Iz.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ge.BOTH),i.addVertexLines(FM),i.addFragmentLines(NM),i.addUniform("vec4","model_silhouetteColor",ge.FRAGMENT),i.addUniform("float","model_silhouetteSize",ge.VERTEX),i.addUniform("bool","model_silhouettePass",ge.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=xt(o,e.uniformMap),e.hasSilhouette=!0};var BM=Iz;var kM=`void modelSplitterStage() +`;var IG={name:"ModelSilhouettePipelineStage"};IG.silhouettesLength=0;IG.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++IG.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(F2),i.addFragmentLines(L2),i.addUniform("vec4","model_silhouetteColor",de.FRAGMENT),i.addUniform("float","model_silhouetteSize",de.VERTEX),i.addUniform("bool","model_silhouettePass",de.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Ot(r,e.uniformMap),e.hasSilhouette=!0};var B2=IG;var k2=`void modelSplitterStage() { #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 Oz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Oz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(kM);let o={};i.addUniform("float",Oz.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[Oz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var UM=Oz;function O6e(e,t){T.typeOf.object("modelRenderResources",e),T.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=je(e.uniformMap),this.alphaOptions=je(e.alphaOptions),this.renderStateOptions=je(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 VM=O6e;function R6e(e){e=e??W.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Dm.UNLIT}var zM=R6e;function M6e(e,t){T.typeOf.object("nodeRenderResources",e),T.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=je(e.uniformMap),this.alphaOptions=je(e.alphaOptions),this.renderStateOptions=je(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=c(n.indices)?n.indices.count:$t.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=$t.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new zM,this.pickId=void 0}var HM=M6e;function yW(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let 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!==Un.CESIUM_3D_TILE,this._classifies3DTiles=o!==Un.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],B6e(this)}function L6e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},depthMask:!1}}var N6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND},F6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},mle=[];function B6e(e){let t=e._command,n=mle;if(e._useDebugWireframe){t.pass=De.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=GM(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let l=r[a];l.count*=2,l.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=De.TERRAIN_CLASSIFICATION,s=gW(t,r),a=dle(t,r);n.length=0,n.push(s,a),e._commandListTerrain=GM(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=hle(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=De.CESIUM_3D_TILE_CLASSIFICATION,s=gW(t,r),a=dle(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=GM(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=hle(e,n,e._commandList3DTilesPicking))}}function GM(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let l=0;l<s;l++){let u=o[l],f=r[l];for(let h=0;h<a;h++){let p=t[h],g=Qe.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function gW(e,t){let n=Qe.shallowClone(e);n.cull=!1,n.pass=t;let i=t===De.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=L6e(i);return n.renderState=Ve.fromCache(o),n}function dle(e,t){let n=Qe.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(N6e),n}var k6e=[];function hle(e,t,n){let i=Ve.fromCache(F6e),o=t[0],r=t[1],s=Qe.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=Qe.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let l=k6e;return l.length=0,l.push(s,a),GM(e,l,n)}Object.defineProperties(yW.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=B.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}}});yW.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=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=gW(this._command,o),s=mle;s.length=0,s.push(r),this._commandListIgnoreShow=GM(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 jM=yW;function Rz(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===De.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,l=n.hasSilhouette,u=!r&&!l,f=n.hasSkipLevelOfDetail&&!r,h=l;this._command=t,this._modelMatrix=B.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new B,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=u,this._needsSkipLevelOfDetailCommands=f,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,U6e(this)}function b_(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}b_.clone=function(e){return new b_({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function U6e(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 b_({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new b_({command:q6e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new b_({command:Q6e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new b_({command:J6e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new b_({command:Y6e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new b_({command:X6e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(Rz.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=B.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,z6e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,H6e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,G6e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,j6e(this))}}});function V6e(e,t){let n=e._modelMatrix;e._modelMatrix2D=B.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=O.sign(n[13])*2*O.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function z6e(e){let t=e.shadows,n=xn.castShadows(t),i=xn.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 H6e(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=je(r.renderState,!0);s.cull.enabled=t,r.renderState=Ve.fromCache(s)}}}function G6e(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=je(r.renderState,!0);s.cull.face=t,r.renderState=Ve.fromCache(s)}}}function j6e(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}}}Rz.prototype.pushCommands=function(e,t){let n=ple(this,e);n&&!this._has2DCommands&&(W6e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(V6e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&c(i)&&(i!==ch.ALL_OPAQUE&&bE(t,this._translucentCommand,n),i===ch.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||bE(o._backfaceCommands,this._skipLodBackfaceCommand,n),K6e(this,r,n),bE(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){bE(t,this._silhouetteModelCommand,n);return}return bE(t,this._originalCommand,n),t}};Rz.prototype.pushSilhouetteCommands=function(e,t){let n=ple(this,e);return bE(t,this._silhouetteColorCommand,n),t};function bE(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function ple(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*O.PI;return o<s&&r>s||o<-s&&r>-s}function yE(e,t){if(!c(t))return;let n=b_.clone(t),i=Qe.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 W6e(e){yE(e,e._originalCommand),yE(e,e._translucentCommand),yE(e,e._skipLodBackfaceCommand),yE(e,e._skipLodStencilCommand),yE(e,e._silhouetteModelCommand),yE(e,e._silhouetteColorCommand)}function q6e(e){let t=Qe.shallowClone(e);t.pass=De.TRANSLUCENT;let n=je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=ln.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function Y6e(e,t){let n=t._silhouetteId%255,i=Qe.shallowClone(e),o=je(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function X6e(e,t){let n=t._silhouetteId%255,i=Qe.shallowClone(e),o=je(e.renderState,!0);o.cull.enabled=!1,(e.pass===De.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=De.TRANSLUCENT,o.depthMask=!1,o.blending=ln.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=je(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function K6e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=$6e(o);if(r!==s){let a=Z6e(r),l=je(o.renderState,!0);l.stencilTest.reference=a,o.renderState=Ve.fromCache(l),n&&(i.derivedCommand2D.renderState=l)}}function $6e(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function Z6e(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function Q6e(e){let t=Qe.shallowClone(e),n=je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=xi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=je(t.uniformMap),o=new H(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function J6e(e){let t=Qe.shallowClone(e),n=je(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ft.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ft.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var WM=Rz;var qM=`precision highp float; +`;var PG={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};PG.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(k2);let r={};i.addUniform("float",PG.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[PG.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var U2=PG;function Rmt(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Je(e.uniformMap),this.alphaOptions=Je(e.alphaOptions),this.renderStateOptions=Je(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,this.primitiveRenderResources=[]}var z2=Rmt;function Omt(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??u0.UNLIT}var V2=Omt;function Mmt(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=Je(e.uniformMap),this.alphaOptions=Je(e.alphaOptions),this.renderStateOptions=Je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ce.fromCornerPoints(this.positionMin,this.positionMax,new ce),this.lightingOptions=new V2,this.pickId=void 0,this.snapId=void 0}var j2=Mmt;function Zee(e){e=e??H.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 r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==ti.CESIUM_3D_TILE,this._classifies3DTiles=r!==ti.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Bmt(this)}function Nmt(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:e,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}var Lmt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND},Fmt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},MCe=[];function Bmt(e){let t=e._command,n=MCe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=H2(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ie.TERRAIN_CLASSIFICATION,s=Jee(t,o),a=RCe(t,o);n.length=0,n.push(s,a),e._commandListTerrain=H2(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=OCe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=Jee(t,o),a=RCe(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=H2(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=OCe(e,n,e._commandList3DTilesPicking))}}function H2(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=at.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function Jee(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ni.ALWAYS:ni.EQUAL,r=Nmt(i);return n.renderState=Ge.fromCache(r),n}function RCe(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Lmt),n}var kmt=[];function OCe(e,t,n){let i=Ge.fromCache(Fmt),r=t[0],o=t[1],s=at.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=at.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=kmt;return c.length=0,c.push(s,a),H2(e,c,n)}Object.defineProperties(Zee.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=N.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ce.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});Zee.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Zn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Zn(t,this._commandListTerrain),this._classifies3DTiles&&Zn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=Jee(this._command,r),s=MCe;s.length=0,s.push(o),this._commandListIgnoreShow=H2(this,s,this._commandListIgnoreShow)}Zn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Zn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Zn(t,this._commandList3DTilesPicking)),t};var G2=Zee;function Dw(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Ie.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=N.clone(t.modelMatrix),this._boundingVolume=ce.clone(t.boundingVolume),this._modelMatrix2D=new N,this._boundingVolume2D=new ce,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=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,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._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Umt(this)}function nh(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}nh.clone=function(e){return new nh({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Umt(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new nh({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new nh({command:qmt(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new nh({command:Qmt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new nh({command:ept(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new nh({command:Ymt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new nh({command:Xmt(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,s=o.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new nh({command:NCe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new nh({command:NCe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new nh({command:Kmt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand))}Object.defineProperties(Dw.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=N.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ce.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,Vmt(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,jmt(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Hmt(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Gmt(this))}}});function zmt(e,t){let n=e._modelMatrix;e._modelMatrix2D=N.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ce.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Vmt(e){let t=e.shadows,n=Dn.castShadows(t),i=Dn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function jmt(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Je(o.renderState,!0);s.cull.enabled=t,o.renderState=Ge.fromCache(s)}}}function Hmt(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Je(o.renderState,!0);s.cull.face=t,o.renderState=Ge.fromCache(s)}}}function Gmt(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}Dw.prototype.pushCommands=function(e,t){let n=DG(this,e);n&&!this._has2DCommands&&(Wmt(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(zmt(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==vm.ALL_OPAQUE&&f0(t,this._translucentCommand,n),i===vm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||f0(r._backfaceCommands,this._skipLodBackfaceCommand,n),$mt(this,o,n),f0(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){f0(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Qd.EDGES_ONLY&&this._needsEdgeCommands||f0(t,this._originalCommand,n),t}};Dw.prototype.pushSilhouetteCommands=function(e,t){let n=DG(this,e);return f0(t,this._silhouetteColorCommand,n),t};Dw.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=DG(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),f0(t,s,r),t}if(i.pick){if(n!==Qd.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),f0(t,s,r),t}if(n===Qd.SURFACES_ONLY)return t;let o=n===Qd.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),f0(t,this._edgeCommand,r),t};Dw.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=DG(this,e);return f0(t,this._planarFillIdCommand,n),t};function f0(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function DG(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*D.PI;return r<s&&o>s||r<-s&&o>-s}function T_(e,t){if(!l(t))return;let n=nh.clone(t),i=at.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 Wmt(e){T_(e,e._originalCommand),T_(e,e._translucentCommand),T_(e,e._skipLodBackfaceCommand),T_(e,e._skipLodStencilCommand),T_(e,e._silhouetteModelCommand),T_(e,e._silhouetteColorCommand),T_(e,e._edgeCommand),T_(e,e._edgeSnapCommand),T_(e,e._planarFillIdCommand)}function qmt(e){let t=at.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=Je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=tn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function Ymt(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Je(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ge.fromCache(r),i}function Xmt(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Je(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,r.depthMask=!1,r.blending=tn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Je(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ge.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function NCe(e,t,n){let i=t.edgeGeometry,r=at.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Je(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function Kmt(e){let t=at.shallowClone(e);t.pass=Ie.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Je(e.renderState,!0);n.blending.enabled=!1,t.renderState=Ge.fromCache(n);let i=Je(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function $mt(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=Jmt(r);if(o!==s){let a=Zmt(o),c=Je(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Jmt(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function Zmt(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function Qmt(e){let t=at.shallowClone(e),n=Je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Vi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Je(t.uniformMap),r=new U(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ge.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function ept(e){let t=at.shallowClone(e),n=Je(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Yt.SKIP_LOD_MASK,i.reference=Yt.CESIUM_3D_TILE_MASK,i.frontFunction=ni.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ni.GREATER_OR_EQUAL,i.backOperation.zPass=Rt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=Ge.fromCache(n),t}var W2=Dw;var q2=`precision highp float; czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { czm_modelVertexOutput vsOutput; vsOutput.positionMC = positionMC; @@ -5086,6 +6675,9 @@ void main() { ProcessedAttributes attributes; initializeAttributes(attributes); +#ifdef HAS_IMAGERY +initializeImageryAttributes(); +#endif #ifdef USE_DEQUANTIZATION dequantizationStage(attributes); #endif @@ -5132,7 +6724,7 @@ v_pickColor = a_pickColor; Metadata metadata; MetadataClass metadataClass; MetadataStatistics metadataStatistics; -metadataStage(metadata, metadataClass, metadataStatistics, attributes); +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); #ifdef HAS_VERTICAL_EXAGGERATION verticalExaggerationStage(attributes); #endif @@ -5141,11 +6733,17 @@ czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); #endif vec4 positionClip = geometryStage(attributes, modelView, normal); +#ifdef ENABLE_CLIPPING_POLYGONS +modelClippingPolygonsStage(); +#endif +#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN) +lineStyleStageVS(attributes); +#endif #ifdef HAS_ATMOSPHERE atmosphereStage(attributes); #endif -#ifdef ENABLE_CLIPPING_POLYGONS -modelClippingPolygonsStage(attributes); +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(attributes); #endif #ifdef HAS_SILHOUETTE silhouetteStage(attributes, positionClip); @@ -5166,17 +6764,26 @@ v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); gl_PointSize = vsOutput.pointSize; #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); +#elif defined(HAS_POINT_DIAMETER) +gl_PointSize = u_pointDiameter; #else gl_PointSize = 1.0; #endif gl_PointSize *= show; #endif gl_Position = positionClip; +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStageVS(); +#endif #ifdef HAS_POINT_CLOUD_SHOW_STYLE v_pointCloudShow = show; #endif } -`;var YM=`precision highp float; +`;var Y2=`precision highp float; +const float PLANAR_DEPTH_PULL = 0.9995; +const float BEHIND_DEPTH_PUSH = 1.0002; +const float FEATURE_ID_TOLERANCE = 0.5; +const float FEATURE_ID_OFFSET = 1.0; czm_modelMaterial defaultModelMaterial() { czm_modelMaterial material; @@ -5198,9 +6805,28 @@ discard; #endif return vec4(color, alpha); } +void lineStyleStage() +{ +#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY) +const float maskLength = 16.0; +float dashPosition = fract(v_lineCoord / maskLength); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(u_linePattern / pow(2.0, maskIndex)); +if (mod(maskTest, 2.0) < 1.0) { +discard; +} +#endif +} SelectedFeature selectedFeature; +bool isEdge = false; void main() { +#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER) +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +if (distanceToCenter > 0.5) { +discard; +} +#endif #ifdef HAS_POINT_CLOUD_SHOW_STYLE if (v_pointCloudShow == 0.0) { @@ -5215,10 +6841,20 @@ ProcessedAttributes attributes; geometryStage(attributes); FeatureIds featureIds; featureIdStage(featureIds, attributes); +#ifdef HAS_PLANAR_FILL_ID_PASS +if (u_isPlanarFillIdPass) { +float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET; +out_FragColor = vec4(fid, 0.0, 0.0, 1.0); +#ifdef LOG_DEPTH +czm_writeLogDepth(); +#endif +return; +} +#endif Metadata metadata; MetadataClass metadataClass; MetadataStatistics metadataStatistics; -metadataStage(metadata, metadataClass, metadataStatistics, attributes); +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); #ifndef METADATA_PICKING_ENABLED #ifdef HAS_SELECTED_FEATURE_ID selectedFeatureIdStage(selectedFeature, featureIds); @@ -5245,12 +6881,16 @@ vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); metadataPickingStage(metadata, metadataClass, metadataValues); vec4 color = metadataValues; #endif +lineStyleStage(); #ifdef HAS_CLIPPING_PLANES modelClippingPlanesStage(color); #endif #ifdef ENABLE_CLIPPING_POLYGONS modelClippingPolygonsStage(); #endif +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(color); +#endif #ifndef METADATA_PICKING_ENABLED #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) silhouetteStage(color); @@ -5258,41 +6898,52 @@ silhouetteStage(color); #ifdef HAS_ATMOSPHERE atmosphereStage(color, attributes); #endif +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStage(color, featureIds); +edgeDetectionStage(color, featureIds); +if (u_isEdgePass) { +isEdge = true; +} +#endif #endif out_FragColor = color; +#ifdef LOG_DEPTH +czm_writeLogDepth(); +#endif +#ifdef HAS_PLANAR_FILL_DEPTH +gl_FragDepth *= PLANAR_DEPTH_PULL; +#endif +#ifdef HAS_PLANAR_FILL_BEHIND +{ +vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw; +float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r; +float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET; +float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID); +if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) { +gl_FragDepth *= BEHIND_DEPTH_PUSH; } -`;function _le(){}_le.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=e9e(e,n,t),o=t9e(e,i,t),r=e.model;return c(r.classificationType)?new jM({primitiveRenderResources:e,command:o}):new WM({primitiveRenderResources:e,command:o})};function e9e(e,t,n){t.addVertexLines(qM),t.addFragmentLines(YM);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function t9e(e,t,n){let i=n9e(e),o=new ti({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,l=n.mode===oe.SCENE3D,u,f;if(!l&&!n.scene3DOnly&&r._projectTo2D)u=B.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new B),f=e.runtimePrimitive.boundingSphere2D;else{let x=l?a._computedModelMatrix:a._computedModelMatrix2D;u=B.multiplyTransformation(x,e.runtimeNode.computedTransform,new B),f=le.transform(e.boundingSphere,u)}let h=je(Ve.fromCache(e.renderStateOptions),!0);h.cull.face=$t.getCullFace(u,e.primitiveType),h=Ve.fromCache(h);let p=c(r.classificationType),g=p?!1:xn.castShadows(r.shadows),m=p?!1:xn.receiveShadows(r.shadows),y=p?void 0:e.pickId;return new Qe({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function n9e(e){let t=e.wireframeIndexBuffer;if(c(t))return t;let n=e.indices;if(c(n)){if(!c(n.buffer))throw new E("Indices must be provided as a Buffer");return n.buffer}}var XM=_le;function Iu(e){e=e??W.EMPTY_OBJECT;let t=e.modelComponents;T.typeOf.object("options.model",e.model),T.typeOf.object("options.modelComponents",t),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=B.clone(B.IDENTITY),this._computedModelMatrix2D=B.clone(B.IDENTITY),this._axisCorrectionMatrix=$t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new B),this._runtimeArticulations={},i9e(this)}Object.defineProperties(Iu.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 i9e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;gle(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let A=0;A<s;A++){let C=r[A],S=new OR({articulation:C,sceneGraph:e}),v=S.name;a[v]=S}let l=t.nodes,u=l.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=B.IDENTITY;for(let A=0;A<h;A++){let C=n.nodes[A],S=yle(e,C,p);e._rootNodes.push(S)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let A=0;A<y;A++){let C=g[A];m.push(new RM({skin:C,sceneGraph:e}))}let b=e._skinnedNodes,x=b.length;for(let A=0;A<x;A++){let C=b[A],S=e._runtimeNodes[C],P=l[C].skin.index;S._runtimeSkin=m[P],S.updateJointMatrices()}e.applyArticulations()}function gle(e,t){let n=e._components,i=e._model;e._computedModelMatrix=B.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=B.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=B.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var o9e=new d;function r9e(e,t){let n=e._computedModelMatrix,i=B.getTranslation(n,o9e);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=Ot.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ot.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=B.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function yle(e,t,n){let i=[],o=$t.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=B.multiplyTransformation(n,o,new B),g=yle(e,h,p);i.push(g)}let s=new qR({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new OM({primitive:t.primitives[f],node:t,model:e._model}));let l=t.index;e._runtimeNodes[l]=s,c(t.skin)&&e._skinnedNodes.push(l);let u=t.name;if(c(u)){let f=e._model,h=new kR(f,s);f._nodesByName[u]=h}return l}var s9e=new d,a9e=new d,c9e=new d,l9e=new d;Iu.prototype.buildDrawCommands=function(e){let t=this._model,n=new LM(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=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,s9e),l=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,a9e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!c(u))continue;u.configurePipeline();let f=u.pipelineStages,h=new VM(n,u);for(r=0;r<f.length;r++)f[r].process(h,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let g=u.runtimePrimitives[r];g.configurePipeline(e);let m=g.pipelineStages,y=new HM(h,g);for(s=0;s<m.length;s++)m[s].process(y,g.primitive,e);g.boundingSphere=le.clone(y.boundingSphere,new le);let b=B.multiplyByPoint(p,y.positionMin,c9e),x=B.multiplyByPoint(p,y.positionMax,l9e);d.minimumByComponent(a,b,a),d.minimumByComponent(a,x,a),d.maximumByComponent(l,x,l),d.maximumByComponent(l,b,l);let A=XM.buildModelDrawCommand(y,e);g.drawCommand=A}}this._boundingSphere=le.fromCornerPoints(a,l,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};Iu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;c(n.color)&&t.push(Ry),!c(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(PR),n.isClippingEnabled()&&t.push(LR),n.isClippingPolygonsEnabled()&&t.push(BR),n.hasSilhouette(e)&&t.push(BM),c(n.splitDirection)&&n.splitDirection!==Vr.NONE&&t.push(UM),pr.is3DTiles(n.type)&&t.push(ER),i&&t.push(vR))};Iu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!c(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)}}};Iu.prototype.updateModelMatrix=function(e,t){gle(this,e),t.mode!==oe.SCENE3D&&r9e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Iu.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 ble(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let l=0;l<r;l++){let u=t.getChild(l);ble(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let l=0;l<a;l++){let u=s[l];i(u,o)}}function Mz(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],l=e._runtimeNodes[a];ble(e,l,t,n,i)}}var u9e={backFaceCulling:void 0};Iu.prototype.updateBackFaceCulling=function(e){let t=u9e;t.backFaceCulling=e,Mz(this,!1,f9e,t)};function f9e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var d9e={shadowMode:void 0};Iu.prototype.updateShadows=function(e){let t=d9e;t.shadowMode=e,Mz(this,!1,h9e,t)};function h9e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var m9e={debugShowBoundingVolume:void 0};Iu.prototype.updateShowBoundingVolume=function(e){let t=m9e;t.debugShowBoundingVolume=e,Mz(this,!1,p9e,t)};function p9e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var xle=[],_9e={frameState:void 0,hasSilhouette:void 0};Iu.prototype.pushDrawCommands=function(e){let t=xle;t.length=0;let n=_9e;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,Mz(this,!0,g9e,n),e.commandList.push.apply(e.commandList,t)};function g9e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=xle,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Iu.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];c(r)&&r.setArticulationStage(o,t)};Iu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var KM=Iu;function Fy(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Et}Object.defineProperties(Fy.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}}});Fy.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()};Fy.prototype.addBuffer=function(e,t){if(T.typeOf.object("buffer",e),T.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Fy.prototype.addTexture=function(e){T.typeOf.object("texture",e),this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Fy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Fy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Fy.prototype.addBatchTexture=function(e){T.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var $M=Fy;var Ele=Zo(AU(),1);var Tle={},Ox=Uint32Array.BYTES_PER_ELEMENT;Tle.parse=function(e,t){t=t??0,T.defined("arrayBuffer",e);let n=new Uint8Array(e),i=new DataView(e);t+=Ox;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+=Ox,t+=Ox;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=Ox;let s=i.getUint32(t,!0);t+=Ox;let a=i.getUint32(t,!0);t+=Ox;let l=i.getUint32(t,!0);t+=Ox;let u=ir(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=ir(n,t,a),t+=a,l>0&&(p=new Uint8Array(e,t,l),t+=l));let g=new sh(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!c(m))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(y)&&(y=d.unpack(y));let b=y9e(g,h);if(b.rtcCenter=y,b.pointsLength=m,!b.hasPositions){let x=b9e(g);b.positions=x,b.hasPositions=b.hasPositions||c(x)}if(!b.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let x=T9e(g);b.normals=x,b.hasNormals=b.hasNormals||c(x)}if(!b.hasColors){let x=x9e(g);b.colors=x,b.hasColors=b.hasColors||c(x),b.hasConstantColor=c(b.constantColor),b.isTranslucent=c(x)&&x.isTranslucent}if(!b.hasBatchIds){let x=A9e(g);b.batchIds=x,b.hasBatchIds=b.hasBatchIds||c(x)}if(b.hasBatchIds){let x=g.getGlobalProperty("BATCH_LENGTH");if(!c(x))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=x}return c(p)&&(p=new Uint8Array(p),b.batchTableJson=h,b.batchTableBinary=p),b};function y9e(e,t){let n=e.json,i,o,r,s=c(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=c(t)&&c(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;c(a)&&(r=a.properties);let l,u,f,h,p;if(c(s)){o=s.properties;let m=s.byteOffset,y=s.byteLength;if(!c(o)||!c(m)||!c(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),l=c(o.POSITION),u=c(o.RGB)||c(o.RGBA),f=c(o.NORMAL),h=c(o.BATCH_ID),p=c(o.RGBA)}let g;return c(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:l,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function b9e(e){let t=e.json,n;if(c(t.POSITION))return n=e.getPropertyArray("POSITION",$.FLOAT,3),{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!0,componentDatatype:$.FLOAT,type:nn.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:$.UNSIGNED_SHORT,quantizedType:nn.VEC3}}}function x9e(e){let t=e.json,n;if(c(t.RGBA))return n=e.getPropertyArray("RGBA",$.UNSIGNED_BYTE,4),{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(c(t.RGB))return n=e.getPropertyArray("RGB",$.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(c(t.RGB565))return n=e.getPropertyArray("RGB565",$.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.FLOAT,type:nn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(c(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",$.UNSIGNED_BYTE,4),o=i[3],r=G.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:r,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:s}}}function T9e(e){let t=e.json,n;if(c(t.NORMAL))return n=e.getPropertyArray("NORMAL",$.FLOAT,3),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",$.UNSIGNED_BYTE,2),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:nn.VEC2,quantizedComponentDatatype:$.UNSIGNED_BYTE,componentDatatype:$.FLOAT,type:nn.VEC3}}function A9e(e){let t=e.json;if(c(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",$.UNSIGNED_SHORT,1);return{name:ht.FEATURE_ID,semantic:ht.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:$.fromTypedArray(n),type:nn.SCALAR}}}var Rx=Tle;var C9e=Tn.Components,E9e=Tn.Scene,S9e=Tn.Node,w9e=Tn.Primitive,v9e=Tn.Attribute,Ale=Tn.Quantization,D9e=Tn.FeatureIdAttribute,P9e=Tn.Material,I9e=Tn.MetallicRoughness;function By(e){e=e??W.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;T.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=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=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=B.IDENTITY}c(Object.create)&&(By.prototype=Object.create($i.prototype),By.prototype.constructor=By);Object.defineProperties(By.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});By.prototype.load=function(){if(c(this._promise))return this._promise;this._parsedContent=Rx.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)};By.prototype.process=function(e){if(c(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(c(this._decodePromise))return!1;this._decodePromise=O9e(this,e.context)}return!1};function O9e(e,t){let i=e._parsedContent.draco,o;if(c(i)?o=n_.decodePointCloud(i,t):o=Promise.resolve(),!!c(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return c(r)&&R9e(e,i,r),G9e(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function R9e(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(c(n.POSITION)){if(o={name:"POSITION",semantic:ht.POSITION,typedArray:n.POSITION.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1},c(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,l=a.range,u=d.fromElements(l,l,l),f=d.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT,o.quantizedType=nn.VEC3}i.positions=o}if(c(n.NORMAL)){if(o={name:"NORMAL",semantic:ht.NORMAL,typedArray:n.NORMAL.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},c(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=$.UNSIGNED_BYTE,o.quantizedType=nn.VEC2}i.normals=o}if(c(n.RGBA)?i.colors={name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isTranslucent:!0}:c(n.RGB)&&(i.colors={name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isTranslucent:!1}),c(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ht.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:$.fromTypedArray(a),type:nn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let l=n[a];c(r)||(r={}),i.hasDracoBatchTable=!0;let u=l.data;r[a]={byteOffset:u.byteOffset,type:M9e(u.componentsPerAttribute),componentType:L9e(u.componentDatatype),typedArray:l.array}}i.batchTableJson=r}function M9e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new E("componentsPerAttribute must be a number from 1-4")}}function L9e(e){switch(e){case ne.BYTE:return"BYTE";case ne.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ne.SHORT:return"SHORT";case ne.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ne.INT:return"INT";case ne.UNSIGNED_INT:return"UNSIGNED_INT";case ne.DOUBLE:return"DOUBLE";case ne.FLOAT:return"FLOAT";default:throw new E("value is not a valid WebGL constant")}}function ZM(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Ale,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Ale;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=d.ZERO;let l=t.quantizedVolumeScale;o.quantizedVolumeDimensions=l,o.quantizedVolumeStepSize=d.divideByScalar(l,a,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new v9e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Ln.decodeRGB565(i)),c(t.constantColor)){let a=new Array(4);r.constant=G.pack(t.constantColor,a)}else{let a=yt.createVertexBuffer({typedArray:i,context:n,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===ht.POSITION&&s&&(r.typedArray=i),r}var Cle,Lz;function N9e(e){if(!c(Lz)){Cle=new Ele.default(0),Lz=new Array(e);for(let t=0;t<e;++t)Lz[t]=Cle.random()}return Lz}var F9e=new d,B9e=new d,k9e=new d;function U9e(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=N9e(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=d.fromElements(s,s,s,F9e),u=d.fromElements(a,a,a,B9e),f,h,p;if(e.isQuantized)l=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,k9e),d.minimumByComponent(l,p,l),d.maximumByComponent(u,p,u);e.min=d.clone(l),e.max=d.clone(u)}var V9e={name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:G.DARKGRAY,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:!1};function z9e(e,t,n){let i=[],o,r=t.positions;return c(r)&&(U9e(r),o=ZM(e,r,n),o.count=t.pointsLength,i.push(o)),c(t.normals)&&(o=ZM(e,t.normals,n),i.push(o)),c(t.colors)?(o=ZM(e,t.colors,n),i.push(o)):(o=ZM(e,V9e,n),i.push(o)),c(t.batchIds)&&(o=ZM(e,t.batchIds,n),i.push(o)),i}function H9e(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!c(e.batchIds);return c(o)||e.hasDracoBatchTable?m_({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new Ys({schema:{},propertyTables:[]})}function G9e(e,t){let n=e._parsedContent,i=new I9e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new P9e;o.metallicRoughness=i;let r=n.colors;c(r)&&r.isTranslucent&&(o.alphaMode=Em.BLEND);let s=!c(n.normals);o.unlit=s;let a=new w9e;if(a.attributes=z9e(e,n,t),a.primitiveType=Me.POINTS,a.material=o,c(n.batchIds)){let g=new D9e;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let l=new S9e;l.index=0,l.primitives=[a];let u=new E9e;u.nodes=[l],u.upAxis=Fo.Z,u.forwardAxis=Fo.X;let f=new C9e;f.scene=u,f.nodes=[l];let h=[];f.structuralMetadata=H9e(n,h),h.length>0&&j9e(e,a,h,t),c(n.rtcCenter)&&(f.transform=B.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;c(p)&&p.isQuantized&&(f.transform=B.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function j9e(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=yt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Be.STATIC_DRAW});l.vertexArrayDestroyable=!1,e._buffers.push(l),a.buffer=l,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}By.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 QM=By;var W9e=new d,q9e=new d,Y9e=new d,X9e=new B,K9e=new B,$9e=new B,Z9e=new he,Q9e=new le;function xE(e,t,n,i,o,r,s){if(T.typeOf.object("model",e),T.typeOf.object("ray",t),T.typeOf.object("frameState",n),!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,l=e.sceneGraph,u=l._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,g=B.clone(h.computedTransform,X9e),m=B.clone(l.computedModelMatrix,K9e),y=p.instances;c(y)&&y.transformInWorldSpace&&(m=B.multiplyTransformation(e.modelMatrix,l.components.transform,m),g=B.multiplyTransformation(l.axisCorrectionMatrix,h.computedTransform,g));let b=B.multiplyTransformation(m,g,$9e);n.mode!==oe.SCENE3D&&(b=Ot.basisTo2D(n.mapProjection,b,b));let x=[];if(c(y)){let C=y.attributes[0].count,S=y.attributes[0].componentDatatype,v=12,P=h.transformsTypedArray;if(!c(P)){let M=h.instancingTransformsBuffer;c(M)&&n.context.webgl2&&(P=$.createTypedArray(S,C*v),M.getBufferData(P))}if(c(P))for(let M=0;M<C;M++){let R=M*v,L=new B(P[R],P[R+1],P[R+2],P[R+3],P[R+4],P[R+5],P[R+6],P[R+7],P[R+8],P[R+9],P[R+10],P[R+11],0,0,0,1);y.transformInWorldSpace?(B.multiplyTransformation(L,g,L),B.multiplyTransformation(m,L,L)):B.multiplyTransformation(L,b,L),x.push(L)}}x.length===0&&x.push(b);let A=h.runtimePrimitives.length;for(let C=0;C<A;C++){let S=h.runtimePrimitives[C],v=S.primitive;if(c(S.boundingSphere)&&!c(y)){let Y=le.transform(S.boundingSphere,b,Q9e),te=Zn.raySphere(t,Y);if(!c(te))continue}let P=$t.getAttributeBySemantic(v,ht.POSITION),M=P.byteOffset,R=P.byteStride,L=P.count;if(!c(v.indices))continue;let F=v.indices.typedArray;if(!c(F)){let Y=v.indices.buffer,te=v.indices.count,K=v.indices.indexDatatype;c(Y)&&n.context.webgl2&&(K===Fe.UNSIGNED_BYTE?F=new Uint8Array(te):K===Fe.UNSIGNED_SHORT?F=new Uint16Array(te):K===Fe.UNSIGNED_INT&&(F=new Uint32Array(te)),Y.getBufferData(F))}let _=P.typedArray,w=P.componentDatatype,D=P.type,I=P.quantization;c(I)&&(w=P.quantization.componentDatatype,D=P.quantization.type);let N=nn.getNumberOfComponents(D),k=$.getSizeInBytes(w),z=!c(_)&&c(R)&&R!==N*k,V=N,j=0;z&&(V=R/k,j=M/k);let U=L*V;if(!c(_)){let Y=P.buffer;c(Y)&&n.context.webgl2&&(_=$.createTypedArray(w,U),Y.getBufferData(_,z?0:M,0,U)),I&&P.normalized&&(_=Ln.dequantize(_,w,D,L))}if(!c(F)||!c(_))return;r=r??ie.default,i=i??1,o=o??0;let q=F.length;for(let Y=0;Y<q;Y+=3){let te=F[Y],K=F[Y+1],Z=F[Y+2];for(let ee of x){let me=bW(_,te,j,V,I,ee,i,o,r,W9e),Te=bW(_,K,j,V,I,ee,i,o,r,q9e),ue=bW(_,Z,j,V,I,ee,i,o,r,Y9e),ye=Zn.rayTriangleParametric(t,me,Te,ue,e.backFaceCulling??!0);c(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=mn.getPoint(t,a,s),n.mode!==oe.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(s,Z9e);h.cartographicToCartesian(p,s)}return s}}function bW(e,t,n,i,o,r,s,a,l,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],c(o))if(o.octEncoded){if(u=Ln.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=B.multiplyByPoint(r,u,u),s!==1&&Dr.getPosition(u,l,s,a,u),u}function co(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.loader",e.loader),T.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=e.type??pr.GLTF,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=c(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=J.clone(J.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 xR(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=G.clone(e.color),this._colorBlendMode=e.colorBlendMode??bc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??G.RED;this._silhouetteColor=G.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??De.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;c(o)&&c(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new vm(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;c(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=B.clone(B.IDENTITY);let a=e.clippingPolygons;c(a)&&a.owner===void 0?th.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=c(e.imageBasedLighting)?e.imageBasedLighting:new ex,this._shouldDestroyImageBasedLighting=!c(e.imageBasedLighting),this._environmentMapManager=void 0;let l=new c_(e.environmentMapOptions);c_.setOwner(l,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??xn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===pr.GLTF&&dt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new Tt(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Vr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this._classificationType=e.classificationType,this._statistics=new $M,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function xW(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function J9e(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 CR({model:e,propertyTable:s});n.push(a)}return n}function eWe(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],c(a.instances)&&(s=$t.getFeatureIdsByLabel(a.instances.featureIds,i),c(s)&&c(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 l=a.primitives[r],u=$t.getFeatureIdsByLabel(l.featureIds,n);if(c(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function CW(e,t){if(!c(e)&&!c(t))return!1;if(c(e)!==c(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 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){T.defined("pointCloudShading",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){if(c(e)&&e.far<=e.near)throw new E("far must be greater than near");this._distanceDisplayCondition=Mt.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){CW(e,this._color)&&this.resetDrawCommands(),this._color=G.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(!G.equals(e,this._silhouetteColor)){let t=CW(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=G.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(){if(!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");let e=c(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return vle(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===pr.GLTF&&dt("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}`),T.typeOf.string("value",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}`),T.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(th.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){c(e)!==c(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",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){T.typeOf.object("environmentMapManager",e),e!==this.environmentMapManager&&(c_.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){if(!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return T.typeOf.string("name",e),this._nodesByName[e]};co.prototype.setArticulationStage=function(e,t){if(T.typeOf.number("value",t),!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)};co.prototype.applyArticulations=function(){if(!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()};co.prototype.getExtension=function(e){if(T.typeOf.string("extensionName",e),!this._ready)throw new E("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return this._loader.components.extensions[e]};co.prototype.makeStyleDirty=function(){this._styleDirty=!0};co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var tWe=new B,nWe=new J,iWe=new B;co.prototype.update=function(e){let t=!1;try{t=oWe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")xW(this,n);else{let i=$t.getError("model",this._resource,n);xW(this,i)}}if(rWe(this,e),sWe(this,e),aWe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!c(n)){if(this._loader.isUnloaded())return;let r=$t.getError("model",this._resource,new ae("Failed to load model."));xW(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;c(i)&&i.propertyTableCount>0&&J9e(this,i);let o=new KM({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(cWe(this),lWe(this),uWe(this,e),fWe(this),dWe(this,e),hWe(this,e),mWe(this,e),pWe(this,e),_We(this,e),gWe(this,e),yWe(this,e),this._defaultTexture=e.context.defaultTexture,bWe(this,e),xWe(this,e),TWe(this),AWe(this,e),wWe(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)),EWe(this),vWe(this,e),DWe(this),PWe(this,e)}};function oWe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function rWe(e,t){c(e._customShader)&&e._customShader.update(t)}function sWe(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=!c(e._imageBasedLighting.sphericalHarmonicCoefficients)||!c(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function aWe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function cWe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;c(n)&&n.propertyTableCount>0&&(e.featureTableId=eWe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function lWe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function uWe(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&&wle(e)}function wle(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=ch.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function fWe(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 dWe(e,t){e._silhouetteDirty&&(Dle(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function hWe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function mWe(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 pWe(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 _We(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function gWe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function yWe(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 bWe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function xWe(e,t){if(!B.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==oe.SCENE3D&&e._projectTo2D)throw new E("Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=B.clone(e.modelMatrix,e._modelMatrix)}}var ky=new d,TW=new he;function TWe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;c(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!c(t)||e.heightReference===We.NONE){if(e.heightReference!==We.NONE)throw new E("Height reference is not supported without a scene.");e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ie.default,i=e.modelMatrix;ky.x=i[12],ky.y=i[13],ky.z=i[14];let o=n.cartesianToCartographic(ky);c(e._clampedModelMatrix)||(e._clampedModelMatrix=B.clone(i,new B)),e._removeUpdateHeightCallback=t.updateHeight(o,Sle(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(c(r)){let s=Sle(e,n,o);he.clone(o,TW),TW.height=r,s(TW)}e._heightDirty=!1,e._updateModelMatrix=!0}function AWe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;vle(e,n),CWe(e,n,t)}function vle(e,t){e._clampedScale=c(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.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 CWe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);B.getTranslation(t,ky),e._sceneMode!==oe.SCENE3D&&Gi.computeActualEllipsoidPosition(n,ky,ky);let s=e._boundingSphere.radius,a=IWe(ky,s,n),l=1/a;Math.min(l*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=c(e.maximumScale)?Math.min(e.maximumScale,i):i}function EWe(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 SWe=new J(1,0,0,0,0,1,0,-1,0);function wWe(e,t){let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=nWe,s=tWe;if(s=B.multiply(o.uniformState.view3D,i,s),r=B.getRotation(s,r),r=J.transpose(r,r),e._iblReferenceFrameMatrix=J.multiply(SWe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=iWe;a=B.multiply(o.uniformState.view3D,i,a),a=B.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=B.inverseTranspose(a,e._clippingPlanesMatrix)}}function vWe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=c(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;c(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function DWe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(c(e._credit)){let s=Tt.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=Tt.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=Tt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function PWe(e,t){let n=RWe(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&&(MWe(e,t),e._sceneGraph.pushDrawCommands(t))}var AW=new le;function IWe(e,t,n){return AW.center=e,AW.radius=t,n.camera.getPixelSize(AW,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var Nz=new d;function Sle(e,t,n){return function(i){e.heightReference===We.CLIP_TO_GROUND?n.height>=i.height&&(i.height=n.height):gC(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,Nz);let o=e._clampedModelMatrix;B.clone(e.modelMatrix,o),o[12]=Nz.x,o[13]=Nz.y,o[14]=Nz.z,e._heightDirty=!0}}var OWe=new d;function RWe(e,t){let n=e.distanceDisplayCondition;if(!c(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=B.getTranslation(e.modelMatrix,OWe);Gi.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function MWe(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 c(e)&&e.alpha>0&&e.alpha<1};co.prototype.isInvisible=function(){let e=this.color;return c(e)&&e.alpha===0};function Dle(e){return e.context.stencilBuffer}co.prototype.hasSilhouette=function(e){return Dle(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!c(this._classificationType)};co.prototype.hasSkipLevelOfDetail=function(e){if(!pr.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 c(e)&&e.enabled&&e.length!==0};co.prototype.pick=function(e,t,n,i,o){return xE(this,e,t,n,i,o)};co.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return c(e)&&e.enabled&&e.length!==0};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){let e=this._loader;c(e)&&e.destroy();let t=this._featureTables;if(c(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),c(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;c(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;c(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,de(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){if(e=e??W.EMPTY_OBJECT,!c(e.url)&&!c(e.gltf))throw new E("options.url is required.");let t=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:c(e.classificationType)},i=e.basePath??"",o=we.createIfNeeded(i);c(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=we.createIfNeeded(t);let r=new rh(n),a=c(e.content)?pr.TILE_GLTF:pr.GLTF,l=n.gltfResource,u=JM(r,a,e);u.resource=l,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),$t.getError("model",l,g)}let f=e.gltfCallback;c(f)&&(T.typeOf.func("options.gltfCallback",f),f(r.gltfJson));let h=new co(u),p=h._resource.credits;if(c(p)){let g=p.length;for(let m=0;m<g;m++)h._resourceCredits.push(Tt.clone(p[m]))}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:c(e.classificationType)},n=new fR(t);try{await n.load();let i=JM(n,pr.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 QM(t);try{await n.load();let i=JM(n,pr.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 mR(t);try{await n.load();let i=JM(n,pr.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 dR(t),i=JM(n,pr.TILE_GEOJSON,e);return new co(i)};var LWe=new G;co.prototype.applyColorAndShow=function(e){let t=G.clone(this._color,LWe),n=c(e)&&c(e.color),i=c(e)&&c(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):G.clone(G.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,CW(t,this._color)&&this.resetDrawCommands()};co.prototype.applyStyle=function(e){let t=this.type===pr.TILE_PNTS,n=c(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=c(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=c(i)&&c(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),wle(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function JM(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 lh=co;function Wr(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(Wr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return c(t)&&c(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(c(t)&&c(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}}});Wr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Wr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Wr.prototype.getExtension=function(e){return this._model.getExtension(e)};Wr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;if(!c(n))throw new E("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let i=t.featureTables[n];if(!c(i))throw new E("No feature table found for the selected feature ID set");let o=i.featuresLength;if(!c(e)||e<0||e>=o)throw new E(`featureId is required and must be between 0 and featuresLength - 1 (${o-1}).`);return i.getFeature(e)};Wr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return c(i)?n.featureTables[i].hasProperty(e,t):!1};Wr.prototype.applyDebugSettings=function(e,t){t=e?t:G.WHITE,this.featuresLength===0?this._model.color=t:c(this.batchTable)&&this.batchTable.setAllColor(t)};Wr.prototype.applyStyle=function(e){this._model.style=e};Wr.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,c(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),c(o)&&c(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;c(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),c(s)&&c(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Hl.REPEAT}),this._ready=!0)};Wr.prototype.isDestroyed=function(){return!1};Wr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),de(this)};Wr.fromGltf=async function(e,t,n,i){let o=new Wr(e,t,n),s=eL(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let l=await lh.fromGltfAsync(s);return o._model=l,o};Wr.fromB3dm=async function(e,t,n,i,o){let r=new Wr(e,t,n),a=eL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=l;let u=await lh.fromB3dm(a);return r._model=u,r};Wr.fromI3dm=async function(e,t,n,i,o){let r=new Wr(e,t,n),a=eL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await lh.fromI3dm(a);return r._model=l,r};Wr.fromPnts=async function(e,t,n,i,o){let r=new Wr(e,t,n),a=eL(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await lh.fromPnts(a);return r._model=l,r};Wr.fromGeoJson=async function(e,t,n,i){let o=new Wr(e,t,n),s=eL(e,t,o,{geoJson:i,resource:n}),a=await lh.fromGeoJson(s);return o._model=a,o};Wr.prototype.pick=function(e,t,n){if(!c(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ie.WGS84,n)};function eL(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:De.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 xt(i,o)}var Ou=Wr;function Vf(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(Vf.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}}});Vf.fromJson=function(e,t,n,i){let o=new Vf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Vf.prototype.hasProperty=function(e,t){return!1};Vf.prototype.getFeature=function(e){};Vf.prototype.applyDebugSettings=function(e,t){};Vf.prototype.applyStyle=function(e){};Vf.prototype.update=function(e,t){};Vf.prototype.pick=function(e,t,n){};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){return de(this)};var tL=Vf;var nL=`uniform sampler2D u_atlas; +} +#endif +} +`;function LCe(){}LCe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=tpt(e,n,t),r=npt(e,i,t),o=e.model;return l(o.classificationType)?new G2({primitiveRenderResources:e,command:r}):new W2({primitiveRenderResources:e,command:r})};function tpt(e,t,n){t.addVertexLines(q2),t.addFragmentLines(Y2);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function npt(e,t,n){let i=ipt(e),r=new zn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=e.alphaOptions.pass,a=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=N.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new N),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=N.multiplyTransformation(x,e.runtimeNode.computedTransform,new N),f=ce.transform(e.boundingSphere,u)}let d=Je(Ge.fromCache(e.renderStateOptions),!0);d.cull.face=xt.getCullFace(u,e.primitiveType),d=Ge.fromCache(d);let p=l(o.classificationType),g=p?!1:Dn.castShadows(o.shadows),m=p?!1:Dn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new at({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:s,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function ipt(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var X2=LCe;function yl(e){e=e??H.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._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=N.clone(N.IDENTITY),this._computedModelMatrix2D=N.clone(N.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N),this._runtimeArticulations={},rpt(this)}Object.defineProperties(yl.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 rpt(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;FCe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let x=0;x<s;x++){let T=o[x],E=new iB({articulation:T,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=N.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],E=BCe(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new M2({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],E=e._runtimeNodes[T],S=c[T].skin.index;E._runtimeSkin=m[S],E.updateJointMatrices()}e.applyArticulations()}function FCe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=N.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=N.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=N.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var opt=new h;function spt(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,opt);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=At.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=N.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ce.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function BCe(e,t,n){let i=[],r=xt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=N.multiplyTransformation(n,r,new N),g=BCe(e,d,p);i.push(g)}let s=new xB({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new O2({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new hB(f,s);f._nodesByName[u]=d}return c}var apt=new h,cpt=new h,lpt=new h,upt=new h;yl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};yl.prototype.buildRenderResources=function(e){let t=this._model,n=new N2(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let s=o.pipelineStages,a=new z2(n,o);n.nodeRenderResources[r]=a;for(let c=0;c<s.length;c++)s[c].process(a,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new j2(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};yl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,apt),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,cpt);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let s=e.nodeRenderResources[r],a=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=ce.clone(f.boundingSphere,new ce);let d=N.multiplyByPoint(a,f.positionMin,lpt),p=N.multiplyByPoint(a,f.positionMax,upt);h.minimumByComponent(n,d,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,d,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=ce.fromCornerPoints(n,i,new ce),this._boundingSphere=ce.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ce.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ce.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};yl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=X2.buildModelDrawCommand(a,t);s.drawCommand=c}}};yl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(kA),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(tB),n.isClippingEnabled()&&t.push(sB);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(lB),n.hasDrapedVectors()&&t.push(dB),n.hasSilhouette(e)&&t.push(B2),l(n.splitDirection)&&n.splitDirection!==qo.NONE&&t.push(U2),Yo.is3DTiles(n.type)&&t.push($F),i&&t.push(QF)};yl.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};yl.prototype.updateModelMatrix=function(e,t){FCe(this,e),t.mode!==re.SCENE3D&&spt(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};yl.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 kCe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);kCe(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function RG(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];kCe(e,c,t,n,i)}}var fpt={backFaceCulling:void 0};yl.prototype.updateBackFaceCulling=function(e){let t=fpt;t.backFaceCulling=e,RG(this,!1,dpt,t)};function dpt(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var hpt={shadowMode:void 0};yl.prototype.updateShadows=function(e){let t=hpt;t.shadowMode=e,RG(this,!1,mpt,t)};function mpt(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var ppt={debugShowBoundingVolume:void 0};yl.prototype.updateShowBoundingVolume=function(e){let t=ppt;t.debugShowBoundingVolume=e,RG(this,!1,gpt,t)};function gpt(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var UCe=[],zCe=[],VCe=[],_pt={frameState:void 0,hasSilhouette:void 0};yl.prototype.pushDrawCommands=function(e){let t=UCe;t.length=0;let n=zCe;n.length=0;let i=VCe;i.length=0;let r=_pt;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,RG(this,!0,ypt,r),Zn(e.commandList,t),Zn(e.commandList,n),Zn(e.commandList,i)};function ypt(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=UCe,s=zCe,a=VCe,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}yl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};yl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var K2=yl;function HA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Ut}Object.defineProperties(HA.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}}});HA.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()};HA.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};HA.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};HA.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};HA.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};HA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var $2=HA;var WCe=Qo(fj(),1);var jCe={},rE=Uint32Array.BYTES_PER_ELEMENT;jCe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=rE;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=rE,t+=rE;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=rE;let s=i.getUint32(t,!0);t+=rE;let a=i.getUint32(t,!0);t+=rE;let c=i.getUint32(t,!0);t+=rE;let u=Ro(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Ro(n,t,a),Object.keys(d).length===0&&(d=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new Em(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=bpt(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=xpt(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=Ept(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=Tpt(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=Cpt(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),Apt(A),A};function Apt(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let a=t[o].byteOffset;l(a)&&(i.includes(o)||r.push(o))}for(let o of r)_t("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function bpt(e,t){let n=e.json,i,r,o,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)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Ot(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function xpt(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function Tpt(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:s}}}function Ept(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function Cpt(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ct.FEATURE_ID,semantic:ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var oE=jCe;var vpt=En.Components,Spt=En.Scene,wpt=En.Node,Ipt=En.Primitive,Ppt=En.Attribute,HCe=En.Quantization,Dpt=En.FeatureIdAttribute,Rpt=En.Material,Opt=En.MetallicRoughness,Qee=class extends tr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Tt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=oE.parse(this._arrayBuffer,this._byteOffset),this._state=Tt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Tt.READY)return!0;if(this._state===Tt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Mpt(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Mpt(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=bg.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Npt(e,i,o),Wpt(e,t),e._state=Tt.READY,e}).catch(function(o){e.unload(),e._state=Tt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function Npt(e,t,n){e._state=Tt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Y.fromTypedArray(a),type:Vt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:Lpt(u.componentsPerAttribute),componentType:Fpt(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Lpt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Fpt(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function J2(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new HCe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new HCe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new Ppt;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=cn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=tt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===ct.POSITION&&s&&(o.typedArray=i),o}var GCe,OG;function Bpt(e){if(!l(OG)){GCe=new WCe.default(0),OG=new Array(e);for(let t=0;t<e;++t)OG[t]=GCe.random()}return OG}var kpt=new h,Upt=new h,zpt=new h;function Vpt(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Bpt(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,kpt),u=h.fromElements(a,a,a,Upt),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,zpt),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var jpt={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Hpt(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Vpt(o),r=J2(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=J2(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=J2(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=J2(e,jpt,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=J2(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Gpt(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,s=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?d_({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Ha({schema:{},propertyTables:[]})}function Wpt(e,t){let n=e._parsedContent,i=new Opt;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Rpt;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Wp.BLEND);let s=!l(n.normals);r.unlit=s;let a=new Ipt;if(a.attributes=Hpt(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new Dpt;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new wpt;c.index=0,c.primitives=[a];let u=new Spt;u.nodes=[c],u.upAxis=zi.Z,u.forwardAxis=zi.X;let f=new vpt;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Gpt(n,d),d.length>0&&qpt(e,a,d,t),l(n.rtcCenter)&&(f.transform=N.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=N.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function qpt(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=tt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}var Z2=Qee;var MG=new h,qCe=new h,YCe=new h,Q2=new h,Ypt=new h,Xpt=new h,Kpt=new he,$pt=new ce;function NG(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}var Jpt=32,ete=new Map,tte=[];function Zpt(e,t,n,i,r,o){let s=e.origin.x,a=e.origin.y,c=e.origin.z,u=e.direction.x,f=e.direction.y,d=e.direction.z,p=D.EPSILON6;for(let g=0;g<i;g+=3){let m=n[g]*3,y=n[g+1]*3,A=n[g+2]*3,b=t[m],x=t[m+1],T=t[m+2],E=t[y]-b,v=t[y+1]-x,S=t[y+2]-T,I=t[A]-b,R=t[A+1]-x,O=t[A+2]-T,L=f*O-d*R,_=d*I-u*O,C=u*R-f*I,w=E*L+v*_+S*C,P=s-b,M=a-x,F=c-T,V;if(r){if(w<p)continue;let B=P*L+M*_+F*C;if(B<0||B>w)continue;let j=M*S-F*v,k=F*E-P*S,G=P*v-M*E,q=u*j+f*k+d*G;if(q<0||B+q>w)continue;V=(I*j+R*k+O*G)/w}else{if(Math.abs(w)<p)continue;let B=1/w,j=(P*L+M*_+F*C)*B;if(j<0||j>1)continue;let k=M*S-F*v,G=F*E-P*S,q=P*v-M*E,Q=(u*k+f*G+d*q)*B;if(Q<0||j+Q>1)continue;V=(I*k+R*G+O*q)*B}V>=0&&V<o&&(o=V)}return o}function Rw(e,t,n,i,r,o,s){if(!e._ready||n.mode===re.MORPHING)return;let a=Number.MAX_VALUE;o=o??ee.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(Ea.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ce.transform(u.boundingSphere,p,$pt),E=pi.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=ete.get(f);l(A)||(A={},l(y)&&(A.vertices=Ea.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=Ea.readIndicesAsTypedArray(f.indices)),ete.set(f,A),tte.push(f),tte.length>Jpt&&ete.delete(tte.shift())),l(y)&&(m=Vt.getNumberOfComponents(y.type),g=A.vertices);let b=A.indices;if(!l(b)||!l(g))return;let x=b.length;if(d.length===1&&i===1){let T=d[0].transform;if(!l(A.world)||!N.equals(A.worldTransform,T)){let I=g.length/m,R=new Float64Array(I*3);for(let O=0;O<I;O++)NG(g,O,m,MG),N.multiplyByPoint(T,MG,Q2),R[O*3]=Q2.x,R[O*3+1]=Q2.y,R[O*3+2]=Q2.z;A.world=R,A.worldTransform=N.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Zpt(t,E,b,x,v,a);S<a&&(a=S);return}for(let T=0;T<x;T+=3){let E=b[T],v=b[T+1],S=b[T+2];NG(g,E,m,MG),NG(g,v,m,qCe),NG(g,S,m,YCe);for(let I of d){let R=N.multiplyByPoint(I.transform,MG,Q2),O=N.multiplyByPoint(I.transform,qCe,Ypt),L=N.multiplyByPoint(I.transform,YCe,Xpt);i!==1&&(Ar.getPosition(R,o,i,r,R),Ar.getPosition(O,o,i,r,O),Ar.getPosition(L,o,i,r,L));let _=pi.rayTriangleParametric(t,R,O,L,e.backFaceCulling??!0);l(_)&&_<a&&_>=0&&(a=_)}}}),a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==re.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(s,Kpt);f.cartographicToCartesian(d,s)}return s}}var nte=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},ek=nte;var ite=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let s=n[o],a=s.runtimeNode,c=s.runtimePrimitive,u=new tE(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let s=i[o];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];r.push({runtimeNode:s,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),s=i[r];if(o.show!==s.show||o.alpha!==s.alpha||o.brightness!==s.brightness||o.contrast!==s.contrast||o.hue!==s.hue||o.saturation!==s.saturation||o.gamma!==s.gamma||o.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new ek(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},tk=ite;function Cr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Yo.GLTF,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=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._clippingPlanesMatrix=N.clone(N.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 YF(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??gl.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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 ce,this._initialRadius=void 0,this._heightReference=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new a0(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Is.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Bc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,KCe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new tk(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new kT,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new s_(e.environmentMapOptions);s_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Dn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Qd.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Yo.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new It(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??qo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new $2,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=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 rte(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Qpt(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new KF({model:e,propertyTable:s});n.push(a)}return n}function e0t(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function ate(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(Cr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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=Ht.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){ate(e,this._color)&&this.resetDrawCommands(),this._color=z.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(!z.equals(e,this._silhouetteColor)){let t=ate(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.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}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return JCe(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===Yo.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},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&&(Is.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Bc.setOwner(e,this,"_clippingPolygons"),KCe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Bc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.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&&(s_.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}}});Cr.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ee.default,ie.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};Cr.prototype.getNode=function(e){return this._nodesByName[e]};Cr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Cr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Cr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Cr.prototype.makeStyleDirty=function(){this._styleDirty=!0};Cr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var t0t=new N,n0t=new $,i0t=new N;Cr.prototype.update=function(e){let t=!1;try{t=r0t(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")rte(this,i);else{let r=xt.getError("model",this._resource,i);rte(this,r)}}if(o0t(this,e),s0t(this,e),a0t(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=xt.getError("model",this._resource,new oe("Failed to load model."));rte(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Qpt(this,r);let o=new K2({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(c0t(this),l0t(this),u0t(this,e),f0t(this),d0t(this,e),h0t(this,e),m0t(this,e),p0t(this,e),y0t(this,e),A0t(this,e),b0t(this,e),x0t(this,e),this._defaultTexture=e.context.defaultTexture,T0t(this,e),E0t(this,e),w0t(this),I0t(this,e),O0t(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)),D0t(this),M0t(this,e),N0t(this),F0t(this,e)}};function r0t(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function o0t(e,t){l(e._customShader)&&e._customShader.update(t)}function s0t(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 a0t(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function c0t(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=e0t(t,e),e._styleDirty=!0,e.resetDrawCommands())}function l0t(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function u0t(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&XCe(e)}function XCe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=vm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function f0t(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 d0t(e,t){e._silhouetteDirty&&(ZCe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function h0t(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function m0t(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 KCe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function p0t(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),r=0;i&&(n.owner===e&&n.update(t),r=n.clippingPolygonsState),r!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=r);let o=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(Bc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;o!==s&&e.resetDrawCommands()}var g0t=new ie;function $Ce(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function _0t(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function y0t(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===re.SCENE3D){let o=e._content?.tile?.contentBoundingVolume.rectangle??ie.fromBoundingSphere(e.boundingSphere,n.ellipsoid,g0t);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(o,t.context,e._vectorData,We.CLAMP_TO_3D_TILE):n.requestDataForRectangle(o,t.context,We.CLAMP_TO_3D_TILE)}else $Ce(e);let r=_0t(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function A0t(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function b0t(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function x0t(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 T0t(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function E0t(e,t){N.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=N.clone(e.modelMatrix,e._modelMatrix))}var GA=new h,ote=new he,C0t=new he,v0t=200,S0t=30;function w0t(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)){e._updateModelMatrix=!0;return}l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===We.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ee.default,i=e.modelMatrix;GA.x=i[12],GA.y=i[13],GA.z=i[14];let r=n.cartesianToCartographic(GA,C0t);l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(i,new N));let o=j0t(e,n,r);e._removeUpdateHeightCallback=t.updateHeight(r,p=>{e._lastSurfaceHeight=p.height,o(p)},e.heightReference);let s=t.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<S0t,u=a&&c&&l(e._lastSurfaceHeight)&&r.height>e._lastSurfaceHeight+v0t,f=a&&c&&e._lastSurfaceQueryMissed,d;u||f?d=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,d=t.getHeight(r,e.heightReference),e._lastSurfaceQueryMissed=!l(d),l(d)?e._lastSurfaceHeight=d:d=e._lastSurfaceHeight),l(d)?(he.clone(r,ote),ote.height=d,o(ote)):N.clone(i,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function I0t(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;JCe(e,n),P0t(e,n,t)}function JCe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ce.transform(e._boundingSphere,t,e._boundingSphere)}function P0t(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);N.getTranslation(t,GA),e._sceneMode!==re.SCENE3D&&hr.computeActualEllipsoidPosition(n,GA,GA);let s=e._boundingSphere.radius,a=B0t(GA,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function D0t(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var R0t=new $(1,0,0,0,0,1,0,-1,0);function O0t(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=n0t,s=t0t;if(s=N.multiply(r.uniformState.view3D,i,s),o=N.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(R0t,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=N.multiply(i,e._clippingPlanes.modelMatrix,i0t);e._clippingPlanesMatrix=N.inverseTranspose(a,e._clippingPlanesMatrix)}}function M0t(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),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)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function N0t(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=It.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=It.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++){let a=It.clone(r[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function L0t(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function F0t(e,t){let n=G0t(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!L0t(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(W0t(e,t),e._sceneGraph.pushDrawCommands(t))}var ste=new ce;function B0t(e,t,n){return ste.center=e,ste.radius=t,n.camera.getPixelSize(ste,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var LG=new h,k0t=new h,FG=new h,U0t=new h,z0t=new N;function V0t(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let r=i._positionMin,o=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,U0t),a=N.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,z0t),c=e._computedScale,u=e.modelMatrix,f=0;for(let d=0;d<8;d++){let p=h.fromElements(d&1?o.x:r.x,d&2?o.y:r.y,d&4?o.z:r.z,k0t);h.multiplyByScalar(p,c,p),N.multiplyByPoint(a,p,FG),N.multiplyByPointAsVector(u,FG,FG);let g=h.dot(FG,s);g<f&&(f=g)}return-f}function j0t(e,t,n){return function(i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+V0t(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else CA(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,LG);let r=e._clampedModelMatrix;N.clone(e.modelMatrix,r),r[12]=LG.x,r[13]=LG.y,r[14]=LG.z,e._heightDirty=!0}}var H0t=new h;function G0t(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=N.getTranslation(e.modelMatrix,H0t);hr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function W0t(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}Cr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Cr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function ZCe(e){return e.context.stencilBuffer}Cr.prototype.hasSilhouette=function(e){return ZCe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Cr.prototype.hasSkipLevelOfDetail=function(e){if(!Yo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Cr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Cr.prototype.pick=function(e,t,n,i,r){return Rw(this,e,t,n,i,r)};Cr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Cr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Cr.prototype.isDestroyed=function(){return!1};Cr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let o=0;o<r;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),$Ce(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&Bc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,ue(this)};Cr.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};Cr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Cr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=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=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new jf(n),a=l(e.content)?Yo.TILE_GLTF:Yo.GLTF,c=n.gltfResource,u=nk(o,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new Cr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(It.clone(p[m]))}return d};Cr.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 VF(t);try{await n.load();let i=nk(n,Yo.TILE_B3DM,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new Z2(t);try{await n.load();let i=nk(n,Yo.TILE_PNTS,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.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 GF(t);try{await n.load();let i=nk(n,Yo.TILE_I3DM,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new jF(t),i=nk(n,Yo.TILE_GEOJSON,e);return new Cr(i)};var q0t=new z;Cr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,q0t),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,ate(t,this._color)&&this.resetDrawCommands()};Cr.prototype.applyStyle=function(e){let t=this.type===Yo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),XCe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function nk(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,edgeDisplayMode:n.edgeDisplayMode,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 Xf=Cr;var cte=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let s=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=s),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&r.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&r._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),r.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:Ku.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=ik(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await Xf.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=ik(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Xf.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=ik(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Xf.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=ik(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Xf.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=ik(t,n,o,{geoJson:r,resource:i}),c=await Xf.fromGeoJson(a);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,ee.WGS84,i)}};function ik(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,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 Ot(i,r)}var Kf=cte;var lte=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},rk=lte;var ok=`uniform sampler2D u_atlas; +uniform float u_coarseDepthTestDistance; +uniform float u_threePointDepthTestDistance; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_textureCoordinates; in vec4 v_pickColor; in vec4 v_color; -in float v_splitDirection; +flat in vec2 v_splitDirectionAndEllipsoidDepthEC; #ifdef SDF in vec4 v_outlineColor; in float v_outlineWidth; #endif -#ifdef FRAGMENT_DEPTH_CHECK -in vec4 v_textureCoordinateBounds; -in vec4 v_originTextureCoordinateAndTranslate; in vec4 v_compressed; -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) +float getGlobeDepthAtCoords(vec2 st) { -vec2 lookupVector = imageSize * (depthLookupST - adjustedST); -lookupVector = v_rotationMatrix * lookupVector; -vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); -vec2 translation = v_originTextureCoordinateAndTranslate.zw; -if (applyTranslate) -{ -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) { @@ -5301,7 +6952,6 @@ return 0.0; vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); return eyeCoordinate.z / eyeCoordinate.w; } -#endif #ifdef SDF float getDistance(vec2 position) { @@ -5325,10 +6975,67 @@ return vec4(v_color.rgb, v_color.a * alpha); } } #endif +bool getDepthTestEnabled() { +float temp = v_compressed.y; +temp = temp * SHIFT_RIGHT1; +float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; +return temp2 != 0.0; +} +float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) { +float depthDifferential = eyeDepth - distanceToEllipsoid; +float depthRatio = abs(depthDifferential / distanceToEllipsoid); +if (depthRatio < epsilon) { +return 0.0; +} +return depthDifferential; +} +void doDepthTest(float eyeDepth, float globeDepth) { +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (eyeDepth > -u_threePointDepthTestDistance) { +if (eyeDepth == 0.0) { +discard; +} +return; +} +#endif +bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; +if (useGlobeDepth && globeDepth == 0.0) { +return; +} +if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { +discard; +} +} +#ifdef LOG_DEPTH +void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) { +float depthArg = v_depthFromNearPlusOne; +if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) { +float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0; +float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7); +float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge); +depthArg = min(depthArg, globeOnTop); +} +czm_writeLogDepth(depthArg); +} +#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; +if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { +discard; +} +if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) { +discard; +} +if (getDepthTestEnabled()) { +vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw; +float eyeDepth = v_compressed.x; +float globeDepth = getGlobeDepthAtCoords(fragSt); +float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y; +doDepthTest(eyeDepth, globeDepth); +#ifdef LOG_DEPTH +writeDepth(eyeDepth, globeDepth, distanceToEllipsoid); +#endif +} vec4 color = texture(u_atlas, v_textureCoordinates); #ifdef SDF float outlineWidth = v_outlineWidth; @@ -5374,48 +7081,9 @@ discard; 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); -if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) -{ -float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) -{ -float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) -{ -discard; -} -} } -} -#endif -} -`;var iL=`#ifdef INSTANCED +`;var sk=`uniform float u_threePointDepthTestDistance; in vec2 direction; -#endif in vec4 positionHighAndScale; in vec4 positionLowAndRotation; in vec4 compressedAttribute0; @@ -5427,22 +7095,17 @@ in vec4 pixelOffsetScaleByDistance; in vec4 compressedAttribute3; in vec2 sdf; in float splitDirection; -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) +#ifdef VS_THREE_POINT_DEPTH_CHECK in vec4 textureCoordinateBoundsOrLabelTranslate; #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; -out mat2 v_rotationMatrix; -#endif out vec4 v_pickColor; out vec4 v_color; -out float v_splitDirection; +flat out vec2 v_splitDirectionAndEllipsoidDepthEC; #ifdef SDF out vec4 v_outlineColor; out float v_outlineWidth; @@ -5493,7 +7156,7 @@ positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMete positionEC.xy += (translate + pixelOffset) * mpp; return positionEC; } -#ifdef VERTEX_DEPTH_CHECK +#ifdef VS_THREE_POINT_DEPTH_CHECK float getGlobeDepth(vec4 positionEC) { vec4 posWC = czm_eyeToWindowCoordinates(positionEC); @@ -5526,44 +7189,25 @@ 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.x *= SHIFT_RIGHT2; translate.y += (temp - floor(temp)) * SHIFT_LEFT8; translate.y -= UPPER_BOUND; +translate.y *= SHIFT_RIGHT2; 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) -{ -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; @@ -5572,7 +7216,7 @@ 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) +#ifdef VS_THREE_POINT_DEPTH_CHECK temp = compressedAttribute3.w; temp = temp * SHIFT_RIGHT12; vec2 dimensions; @@ -5587,32 +7231,17 @@ bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; 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); +vec4 color = czm_decodeRGB8(compressedAttribute2.x); +vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y); 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; +pickColor.a /= 255.0; color.a = floor(temp); -color /= 255.0; +color.a /= 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) @@ -5657,22 +7286,45 @@ positionEC.xyz = vec3(0.0); #endif mat2 rotationMatrix; float mpp; +float enableDepthCheck = 1.0; #ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = compressedAttribute3.z; +float disableDepthTestDistanceSq = compressedAttribute3.z; +if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; +} +if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) +{ +enableDepthCheck = 0.0; +} #endif -#ifdef VERTEX_DEPTH_CHECK -if (lengthSq < disableDepthTestDistance) { +v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity; +vec3 ellipsoidCenter = czm_view[3].xyz; +vec3 rayDirection = normalize(positionEC.xyz); +czm_ray ray = czm_ray(vec3(0.0), rayDirection); +vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii; +czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); +if (!czm_isEmpty(intersection)) +{ +v_splitDirectionAndEllipsoidDepthEC.y = intersection.start; +} +v_compressed.y = enableDepthCheck; +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) { 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); +vec2 depthOrigin; +depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); +depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0); +depthOrigin.y = origin.y; +vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), 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); +vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), depthOrigin, vec2(0.0), 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); +vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth3 = getGlobeDepth(pEC3); if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) { @@ -5682,6 +7334,7 @@ positionEC.xyz = vec3(0.0); } } #endif +v_compressed.x = positionEC.z; positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); gl_Position = czm_projection * positionEC; v_textureCoordinates = textureCoordinates; @@ -5689,15 +7342,11 @@ v_textureCoordinates = textureCoordinates; czm_vertexLogDepth(); #endif #ifdef DISABLE_DEPTH_DISTANCE -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) +if (disableDepthTestDistanceSq != 0.0) { 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))) +if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) { gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH @@ -5706,50 +7355,16 @@ v_depthFromNearPlusOne = 1.0; } } #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; +vec4 outlineColor = czm_decodeRGB8(sdf.x); 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; +outlineColor.a /= 255.0; v_outlineWidth = outlineWidth / 255.0; v_outlineColor = outlineColor; v_outlineColor.a *= translucency; @@ -5757,21 +7372,21 @@ v_outlineColor.a *= translucency; v_pickColor = pickColor; v_color = color; v_color.a *= translucency; -v_splitDirection = splitDirection; +v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; } -`;var NWe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ss=NWe;function x_(e){T.defined("billboardCollection",e),this._billboardCollection=e,this._id=void 0,this._loadState=ss.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(x_.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ss.LOADED}},hasImage:{get:function(){return this._loadState!==ss.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});x_.prototype.unload=async function(){this._loadState!==ss.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ss.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};x_.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(c(o)&&t.loadState===ss.LOADING||t.loadState===ss.LOADED){x_.clone(o,this);return}c(o)||(o=new x_(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=ss.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(l){if(o._loadState=ss.ERROR,o._loadError=l,this._id!==e)return;this._loadState=ss.ERROR,this._loadError=l;return}if(!c(r)||r===-1){if(o._loadState=ss.FAILED,o._index=-1,this._id!==e)return;this._loadState=ss.FAILED,this._index=-1;return}o._index=r,o._loadState=ss.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=ss.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};x_.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=ss.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=ss.ERROR,this._loadError=o;return}if(!c(n)||n===-1){this._loadState=ss.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=ss.LOADED,this.dirty=!0};x_.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};x_.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 T_=x_;function mi(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new E("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new E("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new E("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new E("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Mt.clone(r)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=H.clone(e.pixelOffset??H.ZERO),this._translate=new H(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??Fn.CENTER,this._horizontalOrigin=e.horizontalOrigin??bi.CENTER,this._scale=e.scale??1,this._color=G.clone(e.color??G.WHITE),this._rotation=e.rotation??0,this._alignedAxis=d.clone(e.alignedAxis??d.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new T_(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;c(s)&&(c(a)||(typeof s=="string"?a=s:c(s.src)?a=s.src:a=jn()),this._imageTexture.loadImage(a,s)),c(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=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Vr.NONE}var Ple=mi.SHOW_INDEX=0,Bz=mi.POSITION_INDEX=1,Lle=mi.PIXEL_OFFSET_INDEX=2,FWe=mi.EYE_OFFSET_INDEX=3,BWe=mi.HORIZONTAL_ORIGIN_INDEX=4,kWe=mi.VERTICAL_ORIGIN_INDEX=5,UWe=mi.SCALE_INDEX=6,Ile=mi.IMAGE_INDEX_INDEX=7,Ole=mi.COLOR_INDEX=8,VWe=mi.ROTATION_INDEX=9,zWe=mi.ALIGNED_AXIS_INDEX=10,HWe=mi.SCALE_BY_DISTANCE_INDEX=11,GWe=mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,jWe=mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,WWe=mi.DISTANCE_DISPLAY_CONDITION=14,qWe=mi.DISABLE_DEPTH_DISTANCE=15;mi.TEXTURE_COORDINATE_BOUNDS=16;var Rle=mi.SDF_INDEX=17,YWe=mi.SPLIT_DIRECTION_INDEX=18;mi.NUMBER_OF_PROPERTIES=19;function sr(e,t){let n=e._billboardCollection;c(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(mi.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,sr(this,Ple))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),sr(this,Bz))}},heightReference:{get:function(){return this._heightReference},set:function(e){T.typeOf.number("value",e);let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),sr(this,Bz))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){T.typeOf.object("value",e);let t=this._pixelOffset;H.equals(t,e)||(H.clone(e,t),sr(this,Lle))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),sr(this,HWe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),sr(this,GWe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),sr(this,jWe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){T.typeOf.object("value",e);let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),sr(this,FWe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){T.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,sr(this,BWe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){T.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,sr(this,kWe))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.number("value",e),this._scale!==e&&(this._scale=e,sr(this,UWe))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),sr(this,Ole))}},rotation:{get:function(){return this._rotation},set:function(e){T.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,sr(this,VWe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){T.typeOf.object("value",e);let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),sr(this,zWe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){c(e)&&T.typeOf.number("width",e),this._width!==e&&(this._width=e,sr(this,Ile))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){c(e)&&T.typeOf.number("height",e),this._height!==e&&(this._height=e,sr(this,Ile))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,sr(this,Ole))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Mt.equals(e,this._distanceDisplayCondition)){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new E("far distance must be greater than near distance.");this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),sr(this,WWe)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(c(e)&&(T.typeOf.number("value",e),e<0))throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,sr(this,qWe))}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,c(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!c(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof we?t=e._url:c(e.src)?t=e.src:t=jn(),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=d.clone(e,this._actualClampedPosition),sr(this,Bz)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,sr(this,Ple))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),sr(this,Rle))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,sr(this,Rle))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,sr(this,YWe))}}});mi.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};mi.prototype._updateClamping=function(){mi._updateClamping(this._billboardCollection,this)};var oL=new he;mi._updateClamping=function(e,t){if(!c(e)||!c(e._scene)){if(t._heightReference!==We.NONE)throw new E("Height reference is not supported without a scene.");return}let n=e._scene,i=n.ellipsoid??ie.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===We.NONE||r)&&c(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===We.NONE||!c(t._position))return;c(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!c(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);if(gC(t._heightReference))t._mode===oe.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height;else if(t._heightReference===We.CLIP_TO_GROUND)if(t._mode===oe.SCENE3D){let h=i.cartesianToCartographic(u,oL);s.height>=h.height&&(h.height=s.height),i.cartographicToCartesian(h,u)}else s.height>=u.x&&(u.x=s.height);t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,oL);let l=n.getHeight(s,t._heightReference);c(l)&&(oL.height=l),a(oL)};mi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};mi.prototype.setImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t),this._imageTexture.loadImage(e,t)};mi.prototype.setImageTexture=function(e){T.defined("billboardTexture",e),T_.clone(e,this._imageTexture)};mi.prototype.setImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t),this._imageTexture.addImageSubRegion(e,t)};mi.prototype._setTranslate=function(e){if(!c(e))throw new E("value is required.");let t=this._translate;H.equals(t,e)||(H.clone(e,t),sr(this,Lle))};mi.prototype._getActualPosition=function(){return c(this._clampedPosition)?this._clampedPosition:this._actualPosition};mi.prototype._setActualPosition=function(e){c(this._clampedPosition)||d.clone(e,this._actualPosition),sr(this,Bz)};var Mle=new se;mi._computeActualPosition=function(e,t,n,i){return c(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(B.multiplyByPoint(i,t,Mle),Gi.computeActualEllipsoidPosition(n,Mle))};var Nle=new d;mi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=B.multiplyByPoint(e,t,Nle),a=Gi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(c(a))return H.add(a,i,a),a};var Fz=new H(0,0);mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;if(c(t)||(t=new H),!c(n))throw new E("Billboard must be in a collection. Was it removed?");if(!c(e))throw new E("scene is required.");H.clone(this._pixelOffset,Fz),H.add(Fz,this._translate,Fz);let i=n.modelMatrix,o=this._position;if(c(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,l=s.unproject(o,oL);o=a.cartographicToCartesian(l,Nle),i=B.IDENTITY}return mi._computeScreenSpacePosition(i,o,this._eyeOffset,Fz,e,t)};mi.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===bi.RIGHT?s-=i:e.horizontalOrigin===bi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?a-=o:e.verticalOrigin===Fn.CENTER&&(a-=o*.5),c(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};mi.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.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&&G.equals(this._color,e._color)&&H.equals(this._pixelOffset,e._pixelOffset)&&H.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};mi.prototype._destroy=function(){c(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),c(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=mi;var XWe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},wo=Object.freeze(XWe);var KWe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ks=Object.freeze(KWe);var $We=lo.SHOW_INDEX,rL=lo.POSITION_INDEX,Fle=lo.PIXEL_OFFSET_INDEX,Ble=lo.EYE_OFFSET_INDEX,ZWe=lo.HORIZONTAL_ORIGIN_INDEX,QWe=lo.VERTICAL_ORIGIN_INDEX,JWe=lo.SCALE_INDEX,Mx=lo.IMAGE_INDEX_INDEX,kle=lo.COLOR_INDEX,eqe=lo.ROTATION_INDEX,tqe=lo.ALIGNED_AXIS_INDEX,Ule=lo.SCALE_BY_DISTANCE_INDEX,Vle=lo.TRANSLUCENCY_BY_DISTANCE_INDEX,zle=lo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Hle=lo.DISTANCE_DISPLAY_CONDITION,nqe=lo.DISABLE_DEPTH_DISTANCE,iqe=lo.TEXTURE_COORDINATE_BOUNDS,Gle=lo.SDF_INDEX,jle=lo.SPLIT_DIRECTION_INDEX,IW=lo.NUMBER_OF_PROPERTIES,uo,oqe={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},rqe={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 Hf(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;c(t)||(t=new vb),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(IW),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=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??wo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW],this._highlightColor=G.clone(G.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;c(n)&&c(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)c(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Hf.prototype,{length:{get:function(){return OW(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){T.defined("textureAtlas",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 Wle(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Hf.prototype.add=function(e){let t=new lo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Hf.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Hf.prototype.removeAll=function(){Wle(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function OW(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];c(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Hf.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Hf.prototype.contains=function(e){return c(e)&&e._billboardCollection===this};Hf.prototype.get=function(e){return T.typeOf.number("index",e),OW(this),this._billboards[e]};var EW;function sqe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(c(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=yt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function aqe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return c(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function cqe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return c(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Hf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<IW;++i){let o=n[i]===0?Be.STATIC_DRAW:Be.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function lqe(e,t,n,i,o,r){let s=[{index:uo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[rL]},{index:uo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[rL]},{index:uo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Fle]},{index:uo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Vle]},{index:uo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[kle]},{index:uo.eyeOffset,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Ble]},{index:uo.scaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Ule]},{index:uo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[zle]},{index:uo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Hle]},{index:uo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[iqe]},{index:uo.splitDirection,componentsPerAttribute:1,componentDatatype:$.FLOAT,usage:n[jle]}];i&&s.push({index:uo.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:cqe(e)}),c(o)&&s.push({index:uo.a_batchId,componentsPerAttribute:1,componentDatatype:$.FLOAT,bufferUsage:Be.STATIC_DRAW}),r&&s.push({index:uo.sdf,componentsPerAttribute:2,componentDatatype:$.FLOAT,usage:n[Gle]});let a=i?t:4*t;return new Mp(e,s,a,i)}var SW=new Hn;function qle(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),Hn.fromCartesian(a,SW);let l=i.scale,u=i.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let f=SW.high,h=SW.low;e._instanced?(o=i._index,r(o,f.x,f.y,f.z,l),s(o,h.x,h.y,h.z,u)):(o=i._index*4,r(o+0,f.x,f.y,f.z,l),r(o+1,f.x,f.y,f.z,l),r(o+2,f.x,f.y,f.z,l),r(o+3,f.x,f.y,f.z,l),s(o+0,h.x,h.y,h.z,u),s(o+1,h.x,h.y,h.z,u),s(o+2,h.x,h.y,h.z,u),s(o+3,h.x,h.y,h.z,u))}var Wl=new H,zf=32768,TE=65536,wW=4096,Pm=256,uqe=128,fqe=32,dqe=8,Yle=4,hqe=1/256,Xle=0,Kle=2,$le=3,Zle=1,RW=new Ke;function Qle(e,t,n,i){let o,r=n[uo.compressedAttribute0],s=i.pixelOffset,a=s.x,l=s.y,u=i._translate,f=u.x,h=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+f),Math.abs(-l+h));let p=i.horizontalOrigin,g=i._verticalOrigin,m=i.show&&i.clusterShow;i.color.alpha===0&&(m=!1),g===Fn.BASELINE&&(g=Fn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===bi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===Fn.CENTER;let y=0,b=0,x=0,A=0;if(i.ready){let N=i.computeTextureCoordinates(RW);y=N.x,b=N.y,x=N.width,A=N.height}let C=y+x,S=b+A,v=Math.floor(O.clamp(a,-zf,zf)+zf)*uqe;v+=(p+1)*fqe,v+=(g+1)*dqe,v+=(m?1:0)*Yle;let P=Math.floor(O.clamp(l,-zf,zf)+zf)*Pm,M=Math.floor(O.clamp(f,-zf,zf)+zf)*Pm,R=(O.clamp(h,-zf,zf)+zf)*hqe,L=Math.floor(R),F=Math.floor((R-L)*Pm);P+=L,M+=F,Wl.x=y,Wl.y=b;let _=Ln.compressTextureCoordinates(Wl);Wl.x=C;let w=Ln.compressTextureCoordinates(Wl);Wl.y=S;let D=Ln.compressTextureCoordinates(Wl);Wl.x=y;let I=Ln.compressTextureCoordinates(Wl);e._instanced?(o=i._index,r(o,v,P,M,_)):(o=i._index*4,r(o+0,v+Xle,P,M,_),r(o+1,v+Kle,P,M,w),r(o+2,v+$le,P,M,D),r(o+3,v+Zle,P,M,I))}function Jle(e,t,n,i){let o,r=n[uo.compressedAttribute1],s=i.alignedAxis;d.equals(s,d.ZERO)||(e._shaderAlignedAxis=!0);let a=0,l=1,u=1,f=1,h=i.translucencyByDistance;c(h)&&(a=h.near,l=h.nearValue,u=h.far,f=h.farValue,(l!==1||f!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let g=O.clamp(p,0,TE),m=0;Math.abs(d.magnitudeSquared(s)-1)<O.EPSILON6&&(m=Ln.octEncodeFloat(s)),l=O.clamp(l,0,1),l=l===1?255:l*255|0,g=g*Pm+l,f=O.clamp(f,0,1),f=f===1?255:f*255|0,m=m*Pm+f,e._instanced?(o=i._index,r(o,g,m,a,u)):(o=i._index*4,r(o+0,g,m,a,u),r(o+1,g,m,a,u),r(o+2,g,m,a,u),r(o+3,g,m,a,u))}function DW(e,t,n,i){let o,r=n[uo.compressedAttribute2],s=i.color,a=c(e._batchTable)?G.WHITE:i.getPickId(t.context).color,l=i.sizeInMeters?1:0,u=Math.abs(d.magnitudeSquared(i.alignedAxis)-1)<O.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let f=i.height??0;e._maxSize=Math.max(e._maxSize,f);let h=i._labelHorizontalOrigin??-2;h+=2;let p=f*Yle+h,g=G.floatToByte(s.red),m=G.floatToByte(s.green),y=G.floatToByte(s.blue),b=g*TE+m*Pm+y;g=G.floatToByte(a.red),m=G.floatToByte(a.green),y=G.floatToByte(a.blue);let x=g*TE+m*Pm+y,A=G.floatToByte(s.alpha)*TE+G.floatToByte(a.alpha)*Pm;A+=l*2+u,e._instanced?(o=i._index,r(o,b,x,A,p)):(o=i._index*4,r(o+0,b,x,A,p),r(o+1,b,x,A,p),r(o+2,b,x,A,p),r(o+3,b,x,A,p))}function PW(e,t,n,i){let o,r=n[uo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==We.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(Wl.x=0,Wl.y=0,i.ready){let u=i.computeTextureCoordinates(RW);Wl.x=u.width,Wl.y=u.height}let l=Ln.compressTextureCoordinates(Wl);o=i._index,r(o,s.x,s.y,a,l)}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 eue(e,t,n,i){let o,r=n[uo.scaleByDistance],s=0,a=1,l=1,u=1,f=i.scaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,u)):(o=i._index*4,r(o+0,s,a,l,u),r(o+1,s,a,l,u),r(o+2,s,a,l,u),r(o+3,s,a,l,u))}function tue(e,t,n,i){let o,r=n[uo.pixelOffsetScaleByDistance],s=0,a=1,l=1,u=1,f=i.pixelOffsetScaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,u)):(o=i._index*4,r(o+0,s,a,l,u),r(o+1,s,a,l,u),r(o+2,s,a,l,u),r(o+3,s,a,l,u))}function nue(e,t,n,i){let o,r=n[uo.compressedAttribute3],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance,f=Df(i.heightReference)&&t.context.depthTexture;c(u)||(u=f?5e3:0),u*=u,(f||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let h,p;c(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(O.clamp(p,0,wW)),m=Math.floor(O.clamp(h,0,wW)),y=g*wW+m;e._instanced?(o=i._index,r(o,s,a,u,y)):(o=i._index*4,r(o+0,s,a,u,y),r(o+1,s,a,u,y),r(o+2,s,a,u,y),r(o+3,s,a,u,y))}function iue(e,t,n,i){if(Df(i.heightReference)){let p=e._scene,g=t.context,m=t.globeTranslucencyState.translucent,y=c(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!m&&y}let o,r=n[uo.textureCoordinateBoundsOrLabelTranslate];if(ut.maximumVertexTextureImageUnits>0){let p=0,g=0;c(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,l=0,u=0;if(i.ready){let p=i.computeTextureCoordinates(RW);s=p.x,a=p.y,l=p.width,u=p.height}let f=s+l,h=a+u;e._instanced?(o=i._index,r(o,s,a,f,h)):(o=i._index*4,r(o+0,s,a,f,h),r(o+1,s,a,f,h),r(o+2,s,a,f,h),r(o+3,s,a,f,h))}function mqe(e,t,n,i){if(!c(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 oue(e,t,n,i){if(!e._sdf)return;let o,r=n[uo.sdf],s=i.outlineColor,a=i.outlineWidth,l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue),h=l*TE+u*Pm+f,p=a/Ks.RADIUS,g=G.floatToByte(s.alpha)*TE+G.floatToByte(p)*Pm;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+Xle,g),r(o+1,h+Kle,g),r(o+2,h+$le,g),r(o+3,h+Zle,g))}function rue(e,t,n,i){let o=n[uo.splitDirection],r=0,s=i.splitDirection;c(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 pqe(e,t,n,i){qle(e,t,n,i),Qle(e,t,n,i),Jle(e,t,n,i),DW(e,t,n,i),PW(e,t,n,i),eue(e,t,n,i),tue(e,t,n,i),nue(e,t,n,i),iue(e,t,n,i),mqe(e,t,n,i),oue(e,t,n,i),rue(e,t,n,i)}function vW(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 l=0;l<n;++l){let u=t[l],f=u.position,h=lo._computeActualPosition(u,f,i,o);c(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function _qe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!B.equals(r,e.modelMatrix)?(e._mode=n,B.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&vW(e,i,i.length,t,r,!0)):n===oe.MORPHING?vW(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&vW(e,o,e._billboardsToUpdateIndex,t,r,!1)}function gqe(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 yqe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +`;var Y0t=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),qs=Y0t;function Dm(e){this._billboardCollection=e,this._id=void 0,this._loadState=qs.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Dm.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===qs.LOADED}},hasImage:{get:function(){return this._loadState!==qs.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Dm.prototype.unload=async function(){this._loadState!==qs.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=qs.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Dm.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,s=o.get(e);if(l(s)&&t.loadState===qs.LOADING||t.loadState===qs.LOADED){Dm.clone(s,this);return}l(s)||(s=new Dm(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=qs.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?a=f:a=await f}catch(f){if(s._loadState=qs.ERROR,s._loadError=f,this._id!==e)return;this._loadState=qs.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=qs.FAILED,s._index=-1,this._id!==e)return;this._loadState=qs.FAILED,this._index=-1;return}s._index=a,s._loadState=qs.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=qs.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Dm.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Dm.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=qs.LOADING,i=await n}catch(r){this._loadState=qs.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=qs.LOADED,this.setImageSubRegion(i,t))};Dm.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=qs.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Dm.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Dm.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 E_=Dm;function Ni(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Ht.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??Gn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Hi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new E_(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??qo.NONE,this._positionFromParent=!1}var QCe=Ni.SHOW_INDEX=0,kG=Ni.POSITION_INDEX=1,ove=Ni.PIXEL_OFFSET_INDEX=2,X0t=Ni.EYE_OFFSET_INDEX=3,K0t=Ni.HORIZONTAL_ORIGIN_INDEX=4,$0t=Ni.VERTICAL_ORIGIN_INDEX=5,J0t=Ni.SCALE_INDEX=6,eve=Ni.IMAGE_INDEX_INDEX=7,tve=Ni.COLOR_INDEX=8,Z0t=Ni.ROTATION_INDEX=9,Q0t=Ni.ALIGNED_AXIS_INDEX=10,egt=Ni.SCALE_BY_DISTANCE_INDEX=11,tgt=Ni.TRANSLUCENCY_BY_DISTANCE_INDEX=12,ngt=Ni.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,igt=Ni.DISTANCE_DISPLAY_CONDITION=14,rgt=Ni.DISABLE_DEPTH_DISTANCE=15;Ni.TEXTURE_COORDINATE_BOUNDS=16;var nve=Ni.SDF_INDEX=17,ogt=Ni.SPLIT_DIRECTION_INDEX=18;Ni.NUMBER_OF_PROPERTIES=19;function Fo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Ni.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Fo(this,QCe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Fo(this,kG))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Fo(this,kG))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Fo(this,ove))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Fo(this,egt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Fo(this,tgt))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),Fo(this,ngt))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Fo(this,X0t))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Fo(this,K0t))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Fo(this,$0t))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Fo(this,J0t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Fo(this,tve))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Fo(this,Z0t))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Fo(this,Q0t))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Fo(this,eve))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Fo(this,eve))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Fo(this,tve))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Fo(this,igt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Fo(this,rgt))}},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}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},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=h.clone(e,this._actualClampedPosition),Fo(this,kG)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Fo(this,QCe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Fo(this,nve))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Fo(this,nve))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Fo(this,ogt))}}});Ni.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ni.prototype._updateClamping=function(){Ni._updateClamping(this._billboardCollection,this)};var UG=new he,sgt=200,agt=30;Ni._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ee.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===We.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===We.NONE||t._positionFromParent||!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(m){let y=i.cartographicToCartesian(m,t._clampedPosition);CA(t._heightReference)?t._mode===re.SCENE3D?(m.height+=s.height,i.cartographicToCartesian(m,y)):y.x+=s.height:t._heightReference===We.CLIP_TO_GROUND&&s.height>m.height&&(t._mode===re.SCENE3D?(m.height=s.height,i.cartographicToCartesian(m,y)):y.x=s.height),t._clampedPosition=y}t._removeCallbackFunc=n.updateHeight(s,m=>{t._lastSurfaceHeight=m.height,t._clampedToSurface=!0,a(m)},t._heightReference),he.clone(s,UG);let c=n.frameState.frameNumber,u=t._heightReference===We.CLIP_TO_GROUND,f=c-t._lastSurfaceQueryFrame<agt,d=u&&f&&l(t._lastSurfaceHeight)&&s.height>t._lastSurfaceHeight+sgt,p=u&&f&&t._lastSurfaceQueryMissed,g;d||p?g=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=c,g=n.getHeight(s,t._heightReference),t._lastSurfaceQueryMissed=!l(g),l(g)?t._lastSurfaceHeight=g:g=t._lastSurfaceHeight),t._clampedToSurface=l(g),l(g)&&(UG.height=g),a(UG)};Ni.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Ni.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Ni.prototype.setImageTexture=function(e){E_.clone(e,this._imageTexture)};var ive=512;Ni.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&cgt(n)&&(this._imageWidth=Math.min(this._width,ive),this._imageHeight=Math.min(this._height,ive))};function cgt(e){return l(e)?Uh(e)?e.startsWith("data:image/svg+xml"):ig(e)==="svg":!1}Ni.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Ni.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),Fo(this,ove))};Ni.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ni.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Fo(this,kG)};var rve=new se;Ni._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(N.multiplyByPoint(i,t,rve),hr.computeActualEllipsoidPosition(n,rve))};var sve=new h;Ni._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,sve),a=hr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var BG=new U(0,0);Ni.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,BG),U.add(BG,this._translate,BG);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,UG);r=a.cartographicToCartesian(c,sve),i=N.IDENTITY}return Ni._computeScreenSpacePosition(i,r,this._eyeOffset,BG,e,t)};Ni.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===Hi.RIGHT?s-=i:e.horizontalOrigin===Hi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?a-=r:e.verticalOrigin===Gn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Ni.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.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&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ni.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 Br=Ni;var lgt={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},qa=Object.freeze(lgt);var ugt=Br.SHOW_INDEX,ak=Br.POSITION_INDEX,cve=Br.PIXEL_OFFSET_INDEX,lve=Br.EYE_OFFSET_INDEX,fgt=Br.HORIZONTAL_ORIGIN_INDEX,dgt=Br.VERTICAL_ORIGIN_INDEX,hgt=Br.SCALE_INDEX,sE=Br.IMAGE_INDEX_INDEX,uve=Br.COLOR_INDEX,mgt=Br.ROTATION_INDEX,pgt=Br.ALIGNED_AXIS_INDEX,fve=Br.SCALE_BY_DISTANCE_INDEX,dve=Br.TRANSLUCENCY_BY_DISTANCE_INDEX,hve=Br.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,mve=Br.DISTANCE_DISPLAY_CONDITION,ggt=Br.DISABLE_DEPTH_DISTANCE,_gt=Br.TEXTURE_COORDINATE_BOUNDS,pve=Br.SDF_INDEX,gve=Br.SPLIT_DIRECTION_INDEX,pte=Br.NUMBER_OF_PROPERTIES,Vr={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 rh(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new xx),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(pte),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.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=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ee.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ee.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(rh.prototype,{length:{get:function(){return gte(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}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function _ve(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}rh.prototype.add=function(e){let t=new Br(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};rh.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};rh.prototype.removeAll=function(){_ve(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function gte(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}rh.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};rh.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};rh.prototype.get=function(e){return gte(this),this._billboards[e]};function ave(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function ygt(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.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}rh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<pte;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function Agt(e,t,n,i,r){let o=[{index:Vr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ak]},{index:Vr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ak]},{index:Vr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[cve]},{index:Vr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dve]},{index:Vr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[uve]},{index:Vr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[lve]},{index:Vr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[fve]},{index:Vr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[hve]},{index:Vr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[mve]},{index:Vr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[_gt]},{index:Vr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[gve]},{index:Vr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:ygt(e)}];return l(i)&&o.push({index:Vr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:Vr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[pve]}),new hg(e,o,t,!0)}var ute=new Sn;function yve(e,t,n,i){let r=n[Vr.positionHighAndScale],o=n[Vr.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(ce.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,ute);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=ute.high,f=ute.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var WA=new U,ih=32768,_te=65536,fte=4096,aE=256,bgt=128,xgt=32,Tgt=8,zG=4,Egt=1/256,Ave=new et;function bve(e,t,n,i){let r=n[Vr.compressedAttribute0],o=i.pixelOffset,s=o.x,a=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+u),Math.abs(-a+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===Gn.BASELINE&&(p=Gn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Hi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Gn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(Ave);m=I.x,y=I.y}let A=Math.floor(D.clamp(s,-ih,ih)+ih)*bgt;A+=(d+1)*xgt,A+=(p+1)*Tgt,A+=(g?1:0)*zG;let b=Math.floor(D.clamp(a,-ih,ih)+ih)*aE,x=Math.floor(D.clamp(u*zG,-ih,ih)+ih)*aE,T=(D.clamp(f*zG,-ih,ih)+ih)*Egt,E=Math.floor(T),v=Math.floor((T-E)*aE);b+=E,x+=v,WA.x=m,WA.y=y;let S=cn.compressTextureCoordinates(WA);r(i._index,A,b,x,S)}function xve(e,t,n,i){let r=n[Vr.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=D.clamp(d,0,_te),g=0;Math.abs(h.magnitudeSquared(o)-1)<D.EPSILON6&&(g=cn.octEncodeFloat(o)),a=D.clamp(a,0,1),a=a===1?255:a*255|0,p=p*aE+a,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*aE+u,r(i._index,p,g,s,c)}function hte(e,t,n,i){let r=n[Vr.compressedAttribute2],o=i.color,s=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=cn.encodeRGB8(o),m=cn.encodeRGB8(s),y=z.floatToByte(o.alpha)*_te+z.floatToByte(s.alpha)*aE+(a*2+f),A=d*zG+p;r(i._index,g,m,y,A)}function mte(e,t,n,i){let r=n[Vr.eyeOffset],o=i.eyeOffset,s=o.z;if(i._heightReference!==We.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(s)),WA.x=0,WA.y=0,i.ready){let c=i.computeTextureCoordinates(Ave);WA.x=c.width,WA.y=c.height}let a=cn.compressTextureCoordinates(WA);r(i._index,o.x,o.y,s,a)}function Tve(e,t,n,i){let r=n[Vr.scaleByDistance],o=0,s=1,a=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,s,a,c)}function Eve(e,t,n,i){let r=n[Vr.pixelOffsetScaleByDistance],o=0,s=1,a=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,s,a,c)}function Cve(e,t,n,i){let r=n[Vr.compressedAttribute3],o=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(o=a.near,s=a.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=Ss(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(D.clamp(d,0,fte)),g=Math.floor(D.clamp(f,0,fte)),m=p*fte+g;r(i._index,o,s,c,m)}function vve(e,t,n,i){if(Ss(i.heightReference)){let a=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[Vr.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function Cgt(e,t,n,i){if(!l(e._batchTable))return;let r=n[Vr.a_batchId],o=i._batchIndex;r(i._index,o)}function Sve(e,t,n,i){if(!e._sdf)return;let r=n[Vr.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/qa.RADIUS,u=z.floatToByte(o.alpha)*_te+z.floatToByte(c)*aE;r(i._index,a,u)}function wve(e,t,n,i){let r=n[Vr.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function vgt(e,t,n,i){yve(e,t,n,i),bve(e,t,n,i),xve(e,t,n,i),hte(e,t,n,i),mte(e,t,n,i),Tve(e,t,n,i),Eve(e,t,n,i),Cve(e,t,n,i),vve(e,t,n,i),Cgt(e,t,n,i),Sve(e,t,n,i),wve(e,t,n,i)}function dte(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Br._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ce.expand(s,d,s))}o&&ce.fromPoints(a,s)}function Sgt(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&dte(e,i,i.length,t,o,!0)):n===re.MORPHING?dte(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&dte(e,r,e._billboardsToUpdateIndex,t,o,!1)}function wgt(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function Igt(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=De.OVERLAY,i}var bqe=[];Hf.prototype.update=function(e){if(OW(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,uo=this._instanced?rqe:oqe,EW=this._instanced?aqe:sqe;let n=this._billboards,i=n.length,o=!0;for(let R=0;R<i;++R){let L=n[R];c(L.loadError)&&(console.error(`Error loading image for billboard: ${L.loadError}`),L.image=void 0),L.textureDirty&&this._updateBillboard(L,Mx),L.show&&(o=o&&L.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!c(r.texture))return;_qe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,l=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<IW;++R)l[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=lqe(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R<i;++R){let L=this._billboards[R];L._dirty=!1,L.textureDirty=!1,pqe(this,e,h,L)}this._vaf.commit(EW(t))}this._billboardsToUpdateIndex=0}else if(a>0){let R=bqe;R.length=0,(l[rL]||l[eqe]||l[JWe])&&R.push(qle),(l[Mx]||l[Fle]||l[ZWe]||l[QWe]||l[$We])&&(R.push(Qle),this._instanced&&R.push(PW)),(l[Mx]||l[tqe]||l[Vle])&&(R.push(Jle),R.push(DW)),(l[Mx]||l[kle])&&R.push(DW),(l[Mx]||l[Ble])&&R.push(PW),l[Ule]&&R.push(eue),l[zle]&&R.push(tue),(l[Hle]||l[nqe]||l[Mx]||l[rL])&&R.push(nue),(l[Mx]||l[rL])&&R.push(iue),l[Gle]&&R.push(oue),l[jle]&&R.push(rue);let L=R.length;if(h=this._vaf.writers,a/i>.1){for(let F=0;F<a;++F){let _=s[F];_._dirty=!1,_.textureDirty=!1;for(let w=0;w<L;++w)R[w](this,e,h,_)}this._vaf.commit(EW(t))}else{for(let F=0;F<a;++F){let _=s[F];_._dirty=!1,_.textureDirty=!1;for(let w=0;w<L;++w)R[w](this,e,h,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=B.IDENTITY;e.mode===oe.SCENE3D?(y=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),gqe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===wo.OPAQUE||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===wo.TRANSLUCENT;this._blendOption===wo.TRANSLUCENT||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R?ne.LEQUAL:ne.LESS},depthMask:R,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,A,C,S,v,P=ut.maximumVertexTextureImageUnits>0;if(b||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){x=iL,A=nL,v=[],c(this._batchTable)&&(v.push("VECTOR_TILE"),x=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(x),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),C=new He({defines:v,sources:[x]}),this._instanced&&C.defines.push("INSTANCED"),this._shaderRotation&&C.defines.push("ROTATION"),this._shaderAlignedAxis&&C.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&C.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&C.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&C.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&C.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&C.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(P?C.defines.push("VERTEX_DEPTH_CHECK"):C.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-Ks.CUTOFF;this._sdf&&C.defines.push("SDF");let L=c(this._batchTable)?"VECTOR_TILE":"";this._blendOption===wo.OPAQUE_AND_TRANSLUCENT&&(S=new He({defines:["OPAQUE",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo}),S=new He({defines:["TRANSLUCENT",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Jt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo})),this._blendOption===wo.OPAQUE&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:S,attributeLocations:uo})),this._blendOption===wo.TRANSLUCENT&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=Jt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:S,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 M=e.commandList;if(p.render||p.pick){let R=this._colorCommands,L=this._blendOption===wo.OPAQUE,F=this._blendOption===wo.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,w=_.length,D=this._uniforms,I;c(this._batchTable)?(D=this._batchTable.getUniformMapCallback()(D),I=this._batchTable.getPickId()):I="v_pickColor",R.length=w;let N=F?w*2:w;for(let k=0;k<N;++k){let z=R[k];c(z)||(z=R[k]=new Qe);let V=L||F&&k%2===0;z.pass=V||!F?De.OPAQUE:De.TRANSLUCENT,z.owner=this;let j=F?Math.floor(k/2):k;z.boundingVolume=m,z.modelMatrix=y,z.count=_[j].indicesCount,z.shaderProgram=V?this._sp:this._spTranslucent,z.uniformMap=D,z.vertexArray=_[j].va,z.renderState=V?this._rsOpaque:this._rsTranslucent,z.debugShowBoundingVolume=this.debugShowBoundingVolume,z.pickId=I,this._instanced&&(z.count=6,z.instanceCount=i),M.push(z)}this.debugShowTextureAtlas&&(c(this.debugCommand)||(this.debugCommand=yqe(this,e.context)),M.push(this.debugCommand))}this._allBillboardsReady=o};Hf.prototype.isDestroyed=function(){return!1};Hf.prototype.destroy=function(){return c(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(),Wle(this._billboards),de(this)};var Ru=Hf;function xqe(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 Lx=xqe;function ya(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),AE(this)}var Tqe=new he;Object.defineProperties(ya.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=G.clone(e,this._color),AE(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,AE(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=G.clone(e,this._pointOutlineColor),AE(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,AE(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){c(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=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,Tqe);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=G.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&&AE(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}}});ya.defaultColor=G.WHITE;ya.defaultPointOutlineColor=G.BLACK;ya.defaultPointOutlineWidth=0;ya.defaultPointSize=8;function AE(e){let t=e._billboard;if(c(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(c(e._billboardImage))return;let n=e._color??ya.defaultColor,i=e._pointOutlineColor??ya.defaultPointOutlineColor,o=e._pointOutlineWidth??ya.defaultPointOutlineWidth,r=e._pointSize??ya.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,l=e._billboardOutlineWidth,u=e._billboardSize;if(G.equals(n,s)&&G.equals(i,a)&&o===l&&r===u)return;e._billboardColor=G.clone(n,e._billboardColor),e._billboardOutlineColor=G.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,Lx(f,h,p,o,r))}ya.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ya.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ya.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ya.prototype.getPropertyInherited=function(e){return Ws.getPropertyInherited(this._content,this._batchId,e)};ya.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ya.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ya.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ya.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var A_=ya;function Aqe(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",""),l=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,p=h/2;l.width=f,l.height=h;let g=l.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,l.width+1,l.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,h).data,y=m.length,b=f*4,x,A,C,S;for(x=0;x<y;++x)if(m[x]!==255){C=x/b|0;break}for(x=y-1;x>=0;--x)if(m[x]!==255){S=x/b|0;break}let v=-1;for(x=0;x<f&&v===-1;++x)for(A=0;A<h;++A){let P=x*4+A*b;if(m[P]!==255||m[P+1]!==255||m[P+2]!==255||m[P+3]!==255){v=x;break}}return{width:r.width,height:S-C,ascent:p-C,descent:S-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Nx;function Cqe(e,t){if(!c(e))throw new E("text is required.");if(e==="")return;t=t??W.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??G.TRANSPARENT,a=t.padding??0,l=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});c(Nx)||(c(f.imageSmoothingEnabled)?Nx="imageSmoothingEnabled":c(f.mozImageSmoothingEnabled)?Nx="mozImageSmoothingEnabled":c(f.webkitImageSmoothingEnabled)?Nx="webkitImageSmoothingEnabled":c(f.msImageSmoothingEnabled)&&(Nx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Nx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=Aqe(f,e,n,i,o);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=-h.minx,g=Math.ceil(h.width)+p+l,m=h.height+l,y=m-h.ascent+a,b=m-y+l;if(u.width=g,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Nx]=!1,s!==G.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let x=t.strokeColor??G.BLACK;f.strokeStyle=x.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let x=t.fillColor??G.WHITE;f.fillStyle=x.toCssColorString(),f.fillText(e,p+a,b)}return u}var Fx=Cqe;var gue=Zo(lue(),1);var Sqe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Yo=Object.freeze(Sqe);var uue={},fue=0,wqe=256,vqe=new G(.165,.165,.165,.8),Dqe=new H(7,5),ys=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Bx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function aL(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function cL(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function hue(e){let t=uue[e._font];if(!c(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(cL(n,"line-height"));isNaN(i)&&(i=void 0),t={family:cL(n,"font-family"),size:cL(n,"font-size").replace("px",""),style:cL(n,"font-style"),weight:cL(n,"font-weight"),lineHeight:i},document.body.removeChild(n),fue<wqe&&(uue[e._font]=t,fue++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function uh(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new E("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new E("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new E("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new E("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new E("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Mt.clone(r)}this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=G.clone(e.fillColor??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=G.clone(e.backgroundColor??vqe),this._backgroundPadding=H.clone(e.backgroundPadding??Dqe),this._style=e.style??Yo.FILL,this._verticalOrigin=e.verticalOrigin??Fn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??bi.LEFT,this._pixelOffset=H.clone(e.pixelOffset??H.ZERO),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._position=d.clone(e.position??d.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??We.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=e.text??"",this._relativeSize=1,hue(this),this._updateClamping()}Object.defineProperties(uh.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");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;c(r)&&(r.show=e)}let n=this._backgroundBillboard;c(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new E("value is required.");let t=this._position;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].billboard;c(s)&&(s.position=e)}let i=this._backgroundBillboard;c(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!c(e))throw new E("value is required.");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;c(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;c(n)&&(n.heightReference=e),aL(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!c(e))throw new E("value is required.");if(this._text!==e){this._text=e;let t=uh.filterUnsupportedCharacters(e);this._renderedText=uh.enableRightToLeftDetection?Lqe(t):t,Bx(this)}}},font:{get:function(){return this._font},set:function(e){if(!c(e))throw new E("value is required.");this._font!==e&&(this._font=e,Bx(this),hue(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._fillColor;G.equals(t,e)||(G.clone(e,t),Bx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Bx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new E("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Bx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!c(e))throw new E("value is required.");this._showBackground!==e&&(this._showBackground=e,Bx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._backgroundColor;if(!G.equals(t,e)){G.clone(e,t);let n=this._backgroundBillboard;c(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!c(e))throw new E("value is required.");let t=this._backgroundPadding;H.equals(t,e)||(H.clone(e,t),aL(this))}},style:{get:function(){return this._style},set:function(e){if(!c(e))throw new E("value is required.");this._style!==e&&(this._style=e,Bx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!c(e))throw new E("value is required.");let t=this._pixelOffset;if(!H.equals(t,e)){H.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._translucencyByDistance;if(!Bt.equals(t,e)){this._translucencyByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;if(!Bt.equals(t,e)){this._pixelOffsetScaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._scaleByDistance;if(!Bt.equals(t,e)){this._scaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!c(e))throw new E("value is required.");let t=this._eyeOffset;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];c(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!c(e))throw new E("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,aL(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!c(e))throw new E("value is required.");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];c(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;c(n)&&(n.verticalOrigin=e),aL(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!c(e))throw new E("value is required.");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];c(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;c(n)&&(n.scale=e*this._relativeSize),aL(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far must be greater than near");if(!Mt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;c(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(c(e)&&e<0)throw new E("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;c(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!c(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;c(n)&&(n.clusterShow=e)}}}});uh.prototype._updateClamping=function(){lo._updateClamping(this._labelCollection,this)};uh.prototype.computeScreenSpacePosition=function(e,t){if(!c(e))throw new E("scene is required.");c(t)||(t=new H);let i=this._labelCollection.modelMatrix,o=c(this._actualClampedPosition)?this._actualClampedPosition:this._position;return lo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};uh.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,l=e._backgroundBillboard;if(c(l))i=t.x+l._translate.x,o=t.y-l._translate.y,r=l.width*a,s=l.height*a,e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?o-=s:e.verticalOrigin===Fn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let g=0;g<p;++g){let m=h[g],y=m.billboard;if(!c(y))continue;let b=t.x+y._translate.x,x=t.y-y._translate.y,A=m.dimensions.width*a,C=m.dimensions.height*a;e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?x-=C:e.verticalOrigin===Fn.CENTER&&(x-=C*.5),e._verticalOrigin===Fn.TOP?x+=Ks.PADDING*a:(e._verticalOrigin===Fn.BOTTOM||e._verticalOrigin===Fn.BASELINE)&&(x-=Ks.PADDING*a),i=Math.min(i,b),o=Math.min(o,x),u=Math.max(u,b+A),f=Math.max(f,x+C)}r=u-i,s=f-o}return c(n)||(n=new Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};uh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};uh.prototype.equals=function(e){return this===e||c(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&&d.equals(this._position,e._position)&&G.equals(this._fillColor,e._fillColor)&&G.equals(this._outlineColor,e._outlineColor)&&G.equals(this._backgroundColor,e._backgroundColor)&&H.equals(this._backgroundPadding,e._backgroundPadding)&&H.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};uh.prototype.isDestroyed=function(){return!1};uh.enableRightToLeftDetection=!1;function Pqe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ys.LTR,a="",l=e.length;for(let u=0;u<l;++u){let f=e.charAt(u);t.test(f)?a=ys.RTL:n.test(f)?a=ys.LTR:i.test(f)?a=ys.BRACKETS:a=ys.WEAK,u===0&&(s=a),s===a&&a!==ys.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function Iqe(e){return e.split("").reverse().join("")}function lL(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Oqe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Rqe="\u05D0-\u05EA",Mqe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",due=new RegExp(`[${Rqe}${Mqe}]`);function Lqe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=due.test(o.charAt(0)),s=Pqe(o,due),a=0,l="";for(let u=0;u<s.length;++u){let f=s[u],h=f.Type===ys.BRACKETS?Oqe(f.Word):Iqe(f.Word);r?f.Type===ys.RTL?(l=h+l,a=0):f.Type===ys.LTR?(l=lL(l,a,f.Word),a+=f.Word.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(f.Type===ys.WEAK&&s[u-1].Type===ys.BRACKETS?l=h+l:s[u-1].Type===ys.RTL?(l=h+l,a=0):s.length>u+1?s[u+1].Type===ys.RTL?(l=h+l,a=0):(l=lL(l,a,f.Word),a+=f.Word.length):l=lL(l,0,h)):f.Type===ys.RTL?l=lL(l,a,h):f.Type===ys.LTR?(l+=f.Word,a=l.length):(f.Type===ys.WEAK||f.Type===ys.BRACKETS)&&(u>0&&s[u-1].Type===ys.RTL?s.length>u+1?s[u+1].Type===ys.RTL?l=lL(l,a,h):(l+=f.Word,a=l.length):l+=f.Word:(l+=f.Word,a=l.length))}n+=l,i<t.length-1&&(n+=` -`)}return n}var Uy=uh;var yue=Zo(mue(),1);function Fqe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Bqe=1.2,pue="ID_WHITE_PIXEL",MW=new H(4,4),kqe=new Ke(1,1,1,1);function Uqe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=MW.x,o.height=MW.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(pue,o),n.addImageSubRegion(pue,kqe)}let i=e.add({collection:t});return i.setImageTexture(n),i}var C_={};function Vqe(e,t,n,i,o,r){return C_.font=t,C_.fillColor=n,C_.strokeColor=i,C_.strokeWidth=o,C_.padding=Ks.PADDING,C_.fill=r===Yo.FILL||r===Yo.FILL_AND_OUTLINE,C_.stroke=r===Yo.OUTLINE||r===Yo.FILL_AND_OUTLINE,C_.backgroundColor=G.BLACK,Fx(e,C_)}function LW(e,t){let n=t.billboard;c(n)&&(n.show=!1,c(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var zqe=new yue.default,Hqe=/\s/;function Gqe(e,t){let n=t._renderedText,i=zqe.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)LW(e,r[g]);r.length=o;let a=t.show&&t._showBackground&&n.split(` -`).join("").length>0,l=t._backgroundBillboard,u=e._backgroundBillboardCollection;a?(c(l)||(l=Uqe(u,e),t._backgroundBillboard=l),l.color=t._backgroundColor,l.show=t._show,l.position=t._position,l.eyeOffset=t._eyeOffset,l.pixelOffset=t._pixelOffset,l.horizontalOrigin=bi.LEFT,l.verticalOrigin=t._verticalOrigin,l.heightReference=t._heightReference,l.scale=t.totalScale,l.pickPrimitive=t,l.id=t._id,l.translucencyByDistance=t._translucencyByDistance,l.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,l.scaleByDistance=t._scaleByDistance,l.distanceDisplayCondition=t._distanceDisplayCondition,l.disableDepthTestDistance=t._disableDepthTestDistance,l.clusterShow=t.clusterShow):c(l)&&(u.remove(l),t._backgroundBillboard=l=void 0);let f=e._glyphBillboardCollection,h=f.billboardTextureCache,p=e._textDimensionsCache;for(let g=0;g<o;++g){let m=i[g],y=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+y]),x=p[b],A=h.get(b);if(!c(A)||!c(x)){A=new T_(f),h.set(b,A);let P=`${t._fontStyle} ${t._fontWeight} ${Ks.FONT_SIZE}px ${t._fontFamily}`,M=Vqe(m,P,G.WHITE,G.WHITE,0,Yo.FILL);if(x=M.dimensions,p[b]=x,M.width>0&&M.height>0&&!Hqe.test(m)){let R=(0,gue.default)(M,{cutoff:Ks.CUTOFF,radius:Ks.RADIUS}),L=M.getContext("2d"),F=M.width,_=M.height,w=L.getImageData(0,0,F,_);for(let D=0;D<F;D++)for(let I=0;I<_;I++){let N=I*F+D,k=R[N]*255,z=N*4;w.data[z+0]=k,w.data[z+1]=k,w.data[z+2]=k,w.data[z+3]=k}L.putImageData(w,0,0),A.loadImage(b,M)}}let C=r[g];if(c(C)||(C=new Fqe,C.dimensions=x,C.billboardTexture=A,r[g]=C),C.billboardTexture.id!==b&&(C.billboardTexture=A,C.dimensions=x),!A.hasImage){LW(e,C);continue}let S=C.billboard,v=e._spareBillboards;c(S)||(v.length>0?S=v.pop():(S=f.add({collection:e}),S._labelDimensions=new H,S._labelTranslate=new H),C.billboard=S),S.setImageTexture(A),S.show=t._show,S.position=t._position,S.eyeOffset=t._eyeOffset,S.pixelOffset=t._pixelOffset,S.horizontalOrigin=bi.LEFT,S.verticalOrigin=t._verticalOrigin,S.heightReference=t._heightReference,S.scale=t.totalScale,S.pickPrimitive=t,S.id=t._id,S.translucencyByDistance=t._translucencyByDistance,S.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,S.scaleByDistance=t._scaleByDistance,S.distanceDisplayCondition=t._distanceDisplayCondition,S.disableDepthTestDistance=t._disableDepthTestDistance,S._batchIndex=t._batchIndex,S.outlineColor=t.outlineColor,t.style===Yo.FILL_AND_OUTLINE?(S.color=t._fillColor,S.outlineWidth=t.outlineWidth):t.style===Yo.FILL?(S.color=t._fillColor,S.outlineWidth=0):t.style===Yo.OUTLINE&&(S.color=G.TRANSPARENT,S.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function _ue(e,t,n){return t===bi.CENTER?-e/2:t===bi.RIGHT?-(e+n.x):n.x}var _r=new H,jqe=new H;function Wqe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,l=1,u=t.length,f=e._backgroundBillboard,h=H.clone(c(f)?e._backgroundPadding:H.ZERO,jqe);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let L=0;L<u;++L){if(n.charAt(L)===` -`){r.push(i),++l,i=0;continue}let _=t[L].dimensions;c(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,L<u-1&&(i+=t[L+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,b=0,x=r[b],A=_ue(x,m,h),C=(c(e._lineHeight)?e._lineHeight:Bqe*e._fontSize)/e._relativeSize,S=C*(l-1),v=o,P=p+S;c(f)&&(v+=h.x*2,P+=h.y*2,f._labelHorizontalOrigin=m),_r.x=A*g,_r.y=0;let M=!0,R=0;for(let L=0;L<u;++L){if(n.charAt(L)===` -`){++b,R+=C,x=r[b],A=_ue(x,m,h),_r.x=A*g,M=!0;continue}let F=t[L],_=F.dimensions;if(c(_)&&(y===Fn.TOP?(_r.y=_.height-a-h.y,_r.y+=Ks.PADDING):y===Fn.CENTER?_r.y=(S+_.height-a)/2:y===Fn.BASELINE?(_r.y=S,_r.y-=Ks.PADDING):(_r.y=S+s+h.y,_r.y-=Ks.PADDING),_r.y=(_r.y-_.descent-R)*g,M&&(_r.x-=Ks.PADDING*g,M=!1),c(F.billboard)&&(F.billboard._setTranslate(_r),F.billboard._labelDimensions.x=v,F.billboard._labelDimensions.y=P,F.billboard._labelHorizontalOrigin=m),L<u-1)){let w=t[L+1];_r.x+=(_.width-_.minx+w.dimensions.minx)*g}}if(c(f)&&n.split(` -`).join("").length>0&&(m===bi.CENTER?A=-o/2-h.x:m===bi.RIGHT?A=-(o+h.x*2):A=0,_r.x=A*g,y===Fn.TOP?_r.y=p-a-s:y===Fn.CENTER?_r.y=(p-a)/2-s:y===Fn.BASELINE?_r.y=-h.y-s:_r.y=0,_r.y=_r.y*g,f.width=v,f.height=P,f._setTranslate(_r),f._labelTranslate=H.clone(_r,f._labelTranslate)),Df(e.heightReference))for(let L=0;L<u;++L){let _=t[L].billboard;c(_)&&(_._labelTranslate=H.clone(_r,_._labelTranslate))}}function bue(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)LW(e,n[i]);c(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,c(t._removeCallbackFunc)&&t._removeCallbackFunc(),de(t)}function Im(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Ru({scene:this._scene,textureAtlas:new vb({initialSize:MW})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new T_(t),this._glyphBillboardCollection=new Ru({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=G.clone(G.WHITE),this.show=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??wo.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Im.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 c(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});Im.prototype.add=function(e){let t=new Uy(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Im.prototype.remove=function(e){if(c(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),bue(this,e),!0}return!1};Im.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)bue(this,e[t]);e.length=0};Im.prototype.contains=function(e){return c(e)&&e._labelCollection===this};Im.prototype.get=function(e){if(!c(e))throw new E("index is required.");return this._labels[e]};Im.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&&(Gqe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(Wqe(s),s._repositionAllGlyphs=!1);let l=s._glyphs.length-a;this._totalGlyphCount+=l}let o=n.length>0?wo.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)};Im.prototype.isDestroyed=function(){return!1};Im.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),de(this)};var Om=Im;var uL=`in vec3 position3DHigh; +`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var Pgt=[];rh.prototype.update=function(e){if(gte(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(kt.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let I=0;I<i;++I){let R=n[I];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,sE),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;Sgt(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let I=0;I<pte;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=Agt(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let I=0;I<i;++I){let R=this._billboards[I];R._dirty=!1,R.textureDirty=!1,vgt(this,e,d,R)}this._vaf.commit(ave(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=Pgt;I.length=0,(c[ak]||c[mgt]||c[hgt])&&I.push(yve),(c[sE]||c[cve]||c[fgt]||c[dgt]||c[ugt])&&(I.push(bve),I.push(mte)),(c[sE]||c[pgt]||c[dve])&&(I.push(xve),I.push(hte)),(c[sE]||c[uve])&&I.push(hte),(c[sE]||c[lve])&&I.push(mte),c[fve]&&I.push(Tve),c[hve]&&I.push(Eve),(c[mve]||c[ggt]||c[sE]||c[ak])&&I.push(Cve),(c[sE]||c[ak])&&I.push(vve),c[pve]&&I.push(Sve),c[gve]&&I.push(wve);let R=I.length;if(d=this._vaf.writers,a/i>.1){for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L)}this._vaf.commit(ave(t))}else{for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L);this._vaf.subCommit(L._index,1)}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,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=N.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ce.clone(this._baseVolumeWC,this._boundingVolume)):m=ce.clone(this._baseVolume2D,this._boundingVolume),wgt(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Fi.OPAQUE||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===Fi.TRANSLUCENT;this._blendOption===Fi.TRANSLUCENT||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:tn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,E,v;if(A||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){b=sk,x=ok,v=["INSTANCED"],l(this._batchTable)&&(v.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Ye({defines:v,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let I=1-qa.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT&&(E=new Ye({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr}),E=new Ye({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr})),this._blendOption===Fi.OPAQUE&&(E=new Ye({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr})),this._blendOption===Fi.TRANSLUCENT&&(E=new Ye({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr})),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 S=e.commandList;if(p.render||p.pick){let I=this._colorCommands,R=this._blendOption===Fi.OPAQUE,O=this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,w;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),w=this._batchTable.getPickId()):w="v_pickColor",I.length=_;let P=O?_*2:_;for(let M=0;M<P;++M){let F=I[M];l(F)||(F=I[M]=new at);let V=R||O&&M%2===0;F.pass=V||!O?Ie.OPAQUE:Ie.TRANSLUCENT,F.owner=this;let B=O?Math.floor(M/2):M;F.boundingVolume=m,F.modelMatrix=y,F.count=L[B].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=C,F.vertexArray=L[B].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=w,F.count=6,F.instanceCount=i,S.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=Igt(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};rh.prototype.isDestroyed=function(){return!1};rh.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(),_ve(this._billboards),ue(this)};var $f=rh;function Dgt(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.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,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var cE=Dgt;var Rgt=new he,Rm=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,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),Ow(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),Ow(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,Ow(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),Ow(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,Ow(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,Rgt);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&Ow(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return sa.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};ut(Rm,"defaultColor",z.WHITE),ut(Rm,"defaultPointOutlineColor",z.BLACK),ut(Rm,"defaultPointOutlineWidth",0),ut(Rm,"defaultPointSize",8);function Ow(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=e._color??Rm.defaultColor,i=e._pointOutlineColor??Rm.defaultPointOutlineColor,r=e._pointOutlineWidth??Rm.defaultPointOutlineWidth,o=e._pointSize??Rm.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,cE(f,d,p,r,o))}var C_=Rm;var zve=Qo(Rve(),1);var Ove={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Ove);var xo=Ove;var Mve={},Nve=0,Mgt=256,Ngt=new z(.165,.165,.165,.8),Lgt=new U(7,5),ca=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function lE(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function lk(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function uk(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Fve(e){let t=Mve[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(uk(n,"line-height"));isNaN(i)&&(i=void 0),t={family:uk(n,"font-family"),size:uk(n,"font-size").replace("px",""),style:uk(n,"font-style"),weight:uk(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Nve<Mgt&&(Mve[e._font]=t,Nve++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Om(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Ht.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??Ngt),this._backgroundPadding=U.clone(e.backgroundPadding??Lgt),this._style=e.style??xo.FILL,this._verticalOrigin=e.verticalOrigin??Gn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Hi.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??We.NONE,this._distanceDisplayCondition=o,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._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,Fve(this),this._updateClamping()}Object.defineProperties(Om.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,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.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(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].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,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),lk(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Om.filterUnsupportedCharacters(e);this._renderedText=Om.enableRightToLeftDetection?Vgt(t):t,lE(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,lE(this),Fve(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),lE(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),lE(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,lE(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,lE(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.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;U.equals(t,e)||(U.clone(e,t),lk(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,lE(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!qt.equals(t,e)){this._translucencyByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!qt.equals(t,e)){this._pixelOffsetScaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!qt.equals(t,e)){this._scaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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,lk(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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),lk(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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),lk(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Ht.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Om.prototype._updateClamping=function(){Br._updateClamping(this._labelCollection,this)};Om.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Br._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Om.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?r-=s:e.verticalOrigin===Gn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?b-=T:e.verticalOrigin===Gn.CENTER&&(b-=T*.5),e._verticalOrigin===Gn.TOP?b+=qa.PADDING*a:(e._verticalOrigin===Gn.BOTTOM||e._verticalOrigin===Gn.BASELINE)&&(b-=qa.PADDING*a),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,s=f-r}return l(n)||(n=new et),n.x=i,n.y=r,n.width=o,n.height=s,n};Om.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Om.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&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Om.prototype.isDestroyed=function(){return!1};Om.enableRightToLeftDetection=!1;function Fgt(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=ca.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=ca.RTL:n.test(f)?a=ca.LTR:i.test(f)?a=ca.BRACKETS:a=ca.WEAK,u===0&&(s=a),s===a&&a!==ca.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function Bgt(e){return e.split("").reverse().join("")}function fk(e,t,n){return e.slice(0,t)+n+e.slice(t)}function kgt(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Ugt="\u05D0-\u05EA",zgt="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Lve=new RegExp(`[${Ugt}${zgt}]`);function Vgt(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Lve.test(r.charAt(0)),s=Fgt(r,Lve),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===ca.BRACKETS?kgt(f.Word):Bgt(f.Word);o?f.Type===ca.RTL?(c=d+c,a=0):f.Type===ca.LTR?(c=fk(c,a,f.Word),a+=f.Word.length):(f.Type===ca.WEAK||f.Type===ca.BRACKETS)&&(f.Type===ca.WEAK&&s[u-1].Type===ca.BRACKETS?c=d+c:s[u-1].Type===ca.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===ca.RTL?(c=d+c,a=0):(c=fk(c,a,f.Word),a+=f.Word.length):c=fk(c,0,d)):f.Type===ca.RTL?c=fk(c,a,d):f.Type===ca.LTR?(c+=f.Word,a=c.length):(f.Type===ca.WEAK||f.Type===ca.BRACKETS)&&(u>0&&s[u-1].Type===ca.RTL?s.length>u+1?s[u+1].Type===ca.RTL?c=fk(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var qA=Om;var Vve=Qo(Bve(),1);function Hgt(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Ggt=1.2,kve="ID_WHITE_PIXEL",yte=new U(4,4),Wgt=new et(1,1,1,1);function qgt(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=yte.x,r.height=yte.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(kve,r),n.addImageSubRegion(kve,Wgt)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var v_={};function Ygt(e,t,n,i,r,o){return v_.font=t,v_.fillColor=n,v_.strokeColor=i,v_.strokeWidth=r,v_.padding=qa.PADDING,v_.fill=o===xo.FILL||o===xo.FILL_AND_OUTLINE,v_.stroke=o===xo.OUTLINE||o===xo.FILL_AND_OUTLINE,v_.backgroundColor=z.BLACK,Qx(e,v_)}function Ate(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var Xgt=new Vve.default,Kgt=/\s/;function $gt(e,t){let n=t._renderedText,i=Xgt.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/qa.FONT_SIZE,r<s)for(let p=r;p<s;++p)Ate(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=qgt(c,e),t._backgroundBillboard=a),Jgt(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new E_(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${qa.FONT_SIZE}px ${t._fontFamily}`,S=Ygt(g,v,z.WHITE,z.WHITE,0,xo.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!Kgt.test(g)){let I=(0,zve.default)(S,{cutoff:qa.CUTOFF,radius:qa.RADIUS}),R=S.getContext("2d"),O=S.width,L=S.height,_=R.getImageData(0,0,O,L);for(let C=0;C<O;C++)for(let w=0;w<L;w++){let P=w*O+C,M=I[P]*255,F=P*4;_.data[F+0]=M,_.data[F+1]=M,_.data[F+2]=M,_.data[F+3]=M}R.putImageData(_,0,0),b.loadImage(y,S)}}let x=o[p];if(l(x)||(x=new Hgt,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){Ate(e,x);continue}let T=x.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new U,T._labelTranslate=new U,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=Hi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===xo.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===xo.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===xo.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Jgt(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` +`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Hi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function Uve(e,t,n){return t===Hi.CENTER?-e/2:t===Hi.RIGHT?-(e+n.x):n.x}var Xo=new U,Zgt=new U;function Qgt(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=U.clone(l(f)?e._backgroundPadding:U.ZERO,Zgt);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=Uve(b,m,d),T=(l(e._lineHeight)?e._lineHeight:Ggt*e._fontSize)/e._relativeSize,E=T*(c-1),v=r,S=p+E;l(f)&&(v+=d.x*2,S+=d.y*2,f._labelHorizontalOrigin=m),Xo.x=x*g,Xo.y=0;let I=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){++A,R+=T,b=o[A],x=Uve(b,m,d),Xo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Gn.TOP?(Xo.y=_.height-a-d.y,Xo.y+=qa.PADDING):y===Gn.CENTER?Xo.y=(E+_.height-a)/2:y===Gn.BASELINE?(Xo.y=E,Xo.y-=qa.PADDING):(Xo.y=E+s+d.y,Xo.y-=qa.PADDING),Xo.y=(Xo.y-_.descent-R)*g,I&&(Xo.x-=qa.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(Xo),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,Ss(e.heightReference)&&(L.billboard._labelTranslate=U.clone(Xo,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];Xo.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` +`).join("").length>0&&(m===Hi.CENTER?x=-r/2-d.x:m===Hi.RIGHT?x=-(r+d.x*2):x=0,Xo.x=x*g,y===Gn.TOP?Xo.y=p-a-s:y===Gn.CENTER?Xo.y=(p-a)/2-s:y===Gn.BASELINE?Xo.y=-d.y-s:Xo.y=0,Xo.y=Xo.y*g,f.width=v,f.height=S,f._setTranslate(Xo),f._labelTranslate=U.clone(Xo,f._labelTranslate))}function jve(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)Ate(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function d0(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new $f({scene:this._scene,textureAtlas:new xx({initialSize:yte}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new E_(t),this._glyphBillboardCollection=new $f({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(d0.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}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});d0.prototype.add=function(e){let t=new qA(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};d0.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),jve(this,e),!0}return!1};d0.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)jve(this,e[t]);e.length=0};d0.prototype.contains=function(e){return l(e)&&e._labelCollection===this};d0.prototype.get=function(e){return this._labels[e]};d0.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 o=0;o<i;++o){let s=this._labelsToUpdate[o];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&($gt(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(Qgt(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?Fi.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};d0.prototype.isDestroyed=function(){return!1};d0.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var h0=d0;var dk=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 position2DHigh; in vec3 position2DLow; @@ -5862,8 +7477,8 @@ v_width = width; v_pickColor = pickColor; v_polylineAngle = polylineAngle; } -`;var rl={};rl.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};rl.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 qqe=new he;rl.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,qqe).height}return i};var Yqe=new B,Xqe=new d,xue=new d,Kqe=new sn(d.UNIT_X,0),Tue=new d,$qe=new sn(d.UNIT_X,0),Zqe=new d,Qqe=new d,FW=[];function Cue(e,t,n){let i=FW;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 Vz=new he,Uz=new he,Vy=new d,BW=new d,Jqe=new d,NW=new kp,fL=new Ba;function e7e(e,t,n,i,o,r,s,a){let l=i.scaleToGeodeticSurface(e,BW),u=i.scaleToGeodeticSurface(t,Jqe),f=rl.numberOfPoints(e,t,n),h=i.cartesianToCartographic(l,Vz),p=i.cartesianToCartographic(u,Uz),g=Cue(f,o,r);NW.setEndPoints(h,p);let m=NW.surfaceDistance/f,y=a;h.height=o;let b=i.cartographicToCartesian(h,Vy);d.pack(b,s,y),y+=3;for(let x=1;x<f;x++){let A=NW.interpolateUsingSurfaceDistance(x*m,Uz);A.height=g[x],b=i.cartographicToCartesian(A,Vy),d.pack(b,s,y),y+=3}return y}function t7e(e,t,n,i,o,r,s,a){let l=i.cartesianToCartographic(e,Vz),u=i.cartesianToCartographic(t,Uz),f=rl.numberOfPointsRhumbLine(l,u,n);l.height=0,u.height=0;let h=Cue(f,o,r);fL.ellipsoid.equals(i)||(fL=new Ba(void 0,void 0,i)),fL.setEndPoints(l,u);let p=fL.surfaceDistance/f,g=a;l.height=o;let m=i.cartographicToCartesian(l,Vy);d.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let b=fL.interpolateUsingSurfaceDistance(y*p,Uz);b.height=h[y],m=i.cartographicToCartesian(b,Vy),d.pack(m,s,g),g+=3}return g}rl.wrapLongitude=function(e,t){let n=[],i=[];if(c(e)&&e.length>0){t=t??B.IDENTITY;let o=B.inverseTransformation(t,Yqe),r=B.multiplyByPoint(o,d.ZERO,Xqe),s=d.normalize(B.multiplyByPointAsVector(o,d.UNIT_Y,xue),xue),a=sn.fromPointNormal(r,s,Kqe),l=d.normalize(B.multiplyByPointAsVector(o,d.UNIT_X,Tue),Tue),u=sn.fromPointNormal(r,l,$qe),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,h)<0||sn.getPointDistance(u,m)<0){let y=Zn.lineSegmentPlane(h,m,a,Zqe);if(c(y)){let b=d.multiplyByScalar(s,5e-9,Qqe);sn.getPointDistance(a,h)<0&&d.negate(b,b),n.push(d.add(y,b,new d)),i.push(f+1),d.negate(b,b),n.push(d.add(y,b,new d)),f=1}}n.push(d.clone(e[g])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};rl.generateArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new E("options.positions is required.");let n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],BW);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(y,Vy);d.multiplyByScalar(b,o,b),d.add(y,b,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!c(s)){let y=e.granularity??O.RADIANS_PER_DEGREE;s=O.chordLength(y,i.maximumRadius)}let a=0,l;for(l=0;l<n-1;l++)a+=rl.numberOfPoints(t[l],t[l+1],s);let u=(a+1)*3,f=new Array(u),h=0;for(l=0;l<n-1;l++){let y=t[l],b=t[l+1],x=r?o[l]:o,A=r?o[l+1]:o;h=e7e(y,b,s,i,x,A,f,h)}FW.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,Vz);g.height=r?o[n-1]:o;let m=i.cartographicToCartesian(g,Vy);return d.pack(m,f,u-3),f};var Aue=new he,n7e=new he;rl.generateRhumbArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new E("options.positions is required.");let n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],BW);if(o=r?o[0]:o,o!==0){let A=i.geodeticSurfaceNormal(x,Vy);d.multiplyByScalar(A,o,A),d.add(x,A,x)}return[x.x,x.y,x.z]}let s=e.granularity??O.RADIANS_PER_DEGREE,a=0,l,u=i.cartesianToCartographic(t[0],Aue),f;for(l=0;l<n-1;l++)f=i.cartesianToCartographic(t[l+1],n7e),a+=rl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,Aue);let h=(a+1)*3,p=new Array(h),g=0;for(l=0;l<n-1;l++){let x=t[l],A=t[l+1],C=r?o[l]:o,S=r?o[l+1]:o;g=t7e(x,A,s,i,C,S,p,g)}FW.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,Vz);y.height=r?o[n-1]:o;let b=i.cartographicToCartesian(y,Vy);return d.pack(b,p,h-3),p};rl.generateCartesianArc=function(e){let t=rl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};rl.generateCartesianRhumbArc=function(e){let t=rl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Fi=rl;function Mu(e,t){e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,c(this._material)||(this._material=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)}));let n=e.positions;c(n)||(n=[]),this._positions=n,this._actualPositions=xo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;c(t)&&(i=B.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Fi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Sue),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 Eue=Mu.POSITION_INDEX=0,i7e=Mu.SHOW_INDEX=1,o7e=Mu.WIDTH_INDEX=2,r7e=Mu.MATERIAL_INDEX=3,dL=Mu.POSITION_SIZE_INDEX=4,s7e=Mu.DISTANCE_DISPLAY_CONDITION=5,Sue=Mu.NUMBER_OF_PROPERTIES=6;function E_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;c(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Mu.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");e!==this._show&&(this._show=e,E_(this,i7e))}},positions:{get:function(){return this._positions},set:function(e){if(!c(e))throw new E("value is required.");let t=xo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&E_(this,dL),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),E_(this,Eue),this.update()}},material:{get:function(){return this._material},set:function(e){if(!c(e))throw new E("material is required.");this._material!==e&&(this._material=e,E_(this,r7e))}},width:{get:function(){return this._width},set:function(e){if(!c(e))throw new E("value is required.");let t=this._width;e!==t&&(this._width=e,E_(this,o7e))}},loop:{get:function(){return this._loop},set:function(e){if(!c(e))throw new E("value is required.");if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,E_(this,dL)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!c(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");Mt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),E_(this,s7e))}}});Mu.prototype.update=function(){let e=B.IDENTITY;c(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Eue]>0||this._propertiesChanged[dL]>0;if((!B.equals(e,this._modelMatrix)||i)&&(this._segments=Fi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=B.clone(e,this._modelMatrix),this._segments.positions.length!==t)E_(this,dL);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){E_(this,dL);break}}};Mu.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Mu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Sue-1;++t)e[t]=0};Mu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Gf=Mu;var a7e=Gf.SHOW_INDEX,c7e=Gf.WIDTH_INDEX,UW=Gf.POSITION_INDEX,l7e=Gf.MATERIAL_INDEX,wue=Gf.POSITION_SIZE_INDEX,u7e=Gf.DISTANCE_DISPLAY_CONDITION,Mue=Gf.NUMBER_OF_PROPERTIES,ql={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 fh(e){e=e??W.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=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(Mue),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Be.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=G.clone(G.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(fh.prototype,{length:{get:function(){return VW(this),this._polylines.length}}});fh.prototype.add=function(e){let t=new Gf(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};fh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,c(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};fh.prototype.removeAll=function(){zW(this),kue(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};fh.prototype.contains=function(e){return c(e)&&e._polylineCollection===this};fh.prototype.get=function(e){if(!c(e))throw new E("index is required.");return VW(this),this._polylines[e]};function f7e(e,t){c(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:$.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:$.FLOAT,componentsPerAttribute:2}];e._batchTable=new Rb(t,n,e._polylines.length)}var Lue=new Hn,Nue=new se,Fue=new H;fh.prototype.update=function(e){if(VW(this),this._polylines.length===0||!this.show)return;g7e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(ut.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.");f7e(this,t),this._createBatchTable=!1}if(this._createVertexArray||h7e(this))Pue(this,t,n);else if(this._polylinesUpdated){let l=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let u=l.length;for(let f=0;f<u;++f)i=l[f],i.update()}if(o[wue]||o[l7e])Pue(this,t,n);else{let u=l.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=l[h],o=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[UW]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((o[a7e]||o[c7e])&&this._batchTable.setBatchedAttribute(i._index,0,new H(i._width,i._show)),this._batchTable.attributes.length>2){if(o[UW]||o[wue]){let m=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Hn.fromCartesian(m.center,Lue),b=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,Nue);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[u7e]){let m=Fue;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;c(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}l.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let l=0;l<Mue;++l)o[l]=0;let r=B.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!c(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ve.fromCache({depthMask:a,depthTest:{enabled:a}})),(!c(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let l=this._colorCommands;d7e(this,e,l,r)}};var hL=new le,vue=new le;function d7e(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,l=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],b=y.buckets,x=b.length;for(let A=0;A<x;++A){let C=b[A],S=C.offset,v=C.bucket.shaderProgram,P=C.bucket.polylines,M=P.length,R,L,F=0,_,w;for(let D=0;D<M;++D){let I=P[D],N=p7e(I._material);if(N!==R){if(c(R)&&F>0){let j=L.isTranslucent();a>=s?(_=new Qe({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(hL,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=F,_.offset=S,S+=F,F=0,l=!0,r.push(_)}L=I._material,L.update(o),R=N}let k=I._locatorBuckets,z=k.length;for(let j=0;j<z;++j){let U=k[j];U.locator===C&&(F+=U.count)}let V;t.mode===oe.SCENE3D?V=I._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===oe.SCENE2D?c(I._boundingVolume2D)&&(V=le.clone(I._boundingVolume2D,vue),V.center.x=0):c(I._boundingVolumeWC)&&c(I._boundingVolume2D)&&(V=le.union(I._boundingVolumeWC,I._boundingVolume2D,vue)),l?(l=!1,le.clone(V,hL)):le.union(V,hL,hL)}c(R)&&F>0&&(a>=s?(_=new Qe({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(hL,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=F,_.offset=S,l=!0,r.push(_)),R=void 0}}n.length=a}fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){return Bue(this),zW(this),kue(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function h7e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[UW]?(i.bufferUsage!==Be.STREAM_DRAW&&(t=!0,i.bufferUsage=Be.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Be.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Be.STATIC_DRAW):i.frameCount--),t}var Due=[0,0,0];function Pue(e,t,n){e._createVertexArray=!1,zW(e),Bue(e),_7e(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],l=0,u=[[]],f=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),b=new Float32Array(f*4),x,A=0,C=0,S=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(y,b,A,C,S,r,t,n),m===oe.MORPHING&&(c(x)||(x=new Float32Array(6*f*3)),g.writeForMorph(x,A));let w=g.lengthOfPositions;A+=6*w*3,C+=w*4,S+=w*4,l=g.updateIndices(i,a,u,l)}let v=e._positionBufferUsage.bufferUsage,P=Be.STATIC_DRAW;e._positionBuffer=yt.createVertexBuffer({context:t,typedArray:y,usage:v});let M;c(x)&&(M=yt.createVertexBuffer({context:t,typedArray:x,usage:v})),e._texCoordExpandAndBatchIndexBuffer=yt.createVertexBuffer({context:t,typedArray:b,usage:P});let R=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,F=0,_=i.length;for(let w=0;w<_;++w)if(o=i[w],o.length>0){let D=new Uint16Array(o),I=yt.createIndexBuffer({context:t,typedArray:D,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});F+=a[w];let N=6*(w*(R*O.SIXTY_FOUR_KILOBYTES)-F*R),k=R+N,z=R+k,V=R+z,j=R+V,U=R+j,q=w*(L*O.SIXTY_FOUR_KILOBYTES)-F*L,Y=[{index:ql.position3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:ql.position3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:ql.position2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:ql.position2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:ql.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:ql.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:ql.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:ql.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:ql.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:ql.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:ql.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:ql.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:ql.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:$.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],te,K,Z,ee;m===oe.SCENE3D?(K=e._positionBuffer,te="vertexBuffer",Z=Due,ee="value"):m===oe.SCENE2D||m===oe.COLUMBUS_VIEW?(K=Due,te="value",Z=e._positionBuffer,ee="vertexBuffer"):(K=M,te="vertexBuffer",Z=e._positionBuffer,ee="vertexBuffer"),Y[0][te]=K,Y[1][te]=K,Y[2][ee]=Z,Y[3][ee]=Z,Y[4][te]=K,Y[5][te]=K,Y[6][ee]=Z,Y[7][ee]=Z,Y[8][te]=K,Y[9][te]=K,Y[10][ee]=Z,Y[11][ee]=Z;let me=new ti({context:t,attributes:Y,indexBuffer:I});e._vertexArrays.push({va:me,buckets:u[w]})}}}function m7e(e,t){return t instanceof Rt?t.id:t}var zz=[];function p7e(e){let t=Xi._uniformList[e.type],n=t.length;zz.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];zz[i]=r,zz[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(zz,m7e)}`}function _7e(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 l=a.material,u=i[l.type];c(u)||(u=i[l.type]=new Rm(l,t,n)),u.addPolyline(a)}}}function g7e(e,t){let n=t.mode;(e._mode!==n||!B.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=B.clone(e.modelMatrix),e._createVertexArray=!0)}function VW(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 zW(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;c(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Bue(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}fh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function kue(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function kW(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Rm(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Rm.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Rm.prototype.updateShader=function(e,t,n){if(c(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"),Vt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new He({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,kb]}),r=t.getVertexShaderCallback()(uL),s=new He({defines:i,sources:[xu,r]});this.shaderProgram=Jt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:ql})};function Uue(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===Wt.INTERSECTING}Rm.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!Uue(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 Ds=new d,jf=new d,Wf=new d,Hz=new d,y7e=new se,b7e=new H;Rm.prototype.write=function(e,t,n,i,o,r,s,a){let l=this.mode,u=a.ellipsoid.maximumRadius*O.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let g=f[p],m=g.width,y=g.show&&m>0,b=g._index,x=this.getSegments(g,a),A=x.positions,C=x.lengths,S=A.length,v=g.getPickId(s).color,P=0,M=0,R;for(let z=0;z<S;++z){z===0?g._loop?R=A[S-2]:(R=Hz,d.subtract(A[0],A[1],R),d.add(A[0],R,R)):R=A[z-1],d.clone(R,jf),d.clone(A[z],Ds),z===S-1?g._loop?R=A[1]:(R=Hz,d.subtract(A[S-1],A[S-2],R),d.add(A[S-1],R,R)):R=A[z+1],d.clone(R,Wf);let V=C[P];z===M+V&&(M+=V,++P);let j=z-M===0,U=z===M+C[P]-1;l===oe.SCENE2D&&(jf.z=0,Ds.z=0,Wf.z=0),(l===oe.SCENE2D||l===oe.MORPHING)&&(j||U)&&u-Math.abs(Ds.x)<1&&((Ds.x<0&&jf.x>0||Ds.x>0&&jf.x<0)&&d.clone(Ds,jf),(Ds.x<0&&Wf.x>0||Ds.x>0&&Wf.x<0)&&d.clone(Ds,Wf));let q=j?2:0,Y=U?2:4;for(let te=q;te<Y;++te){Hn.writeElements(Ds,e,n),Hn.writeElements(jf,e,n+6),Hn.writeElements(Wf,e,n+12);let K=te-2<0?-1:1;t[o]=z/(S-1),t[o+1]=2*(te%2)-1,t[o+2]=K,t[o+3]=b,n+=6*3,o+=4}}let L=y7e;L.x=G.floatToByte(v.red),L.y=G.floatToByte(v.green),L.z=G.floatToByte(v.blue),L.w=G.floatToByte(v.alpha);let F=b7e;F.x=m,F.y=y?1:0;let _=l===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,w=Hn.fromCartesian(_.center,Lue),D=w.high,I=se.fromElements(w.low.x,w.low.y,w.low.z,_.radius,Nue),N=Fue;N.x=0,N.y=Number.MAX_VALUE;let k=g.distanceDisplayCondition;c(k)&&(N.x=k.near,N.y=k.far),r.setBatchedAttribute(b,0,F),r.setBatchedAttribute(b,1,L),r.attributes.length>2&&(r.setBatchedAttribute(b,2,D),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var x7e=new d,T7e=new d,A7e=new d,Iue=new d;Rm.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,l=s._segments.lengths,u=a.length,f=0,h=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=Iue,d.subtract(a[0],a[1],g),d.add(a[0],g,g)):g=a[p-1],g=B.multiplyByPoint(n,g,T7e);let m=B.multiplyByPoint(n,a[p],x7e),y;p===u-1?s._loop?y=a[1]:(y=Iue,d.subtract(a[u-1],a[u-2],y),d.add(a[u-1],y,y)):y=a[p+1],y=B.multiplyByPoint(n,y,A7e);let b=l[f];p===h+b&&(h+=b,++f);let x=p-h===0,A=p===h+l[f]-1,C=x?2:0,S=A?2:4;for(let v=C;v<S;++v)Hn.writeElements(m,e,t),Hn.writeElements(g,e,t+6),Hn.writeElements(y,e,t+12),t+=6*3}}};var C7e=new Array(1);Rm.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new kW(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],l=0;a.length>0&&(l=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=C7e;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let b=0;b<m;++b){let x=g[b]-1;for(let A=0;A<x;++A)l+4>O.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),l=0,r.count=s,s=0,i=0,r=new kW(0,0,this),n[++o]=[r]),a.push(l,l+2,l+1),a.push(l+1,l+2,l+3),y+=6,s+=6,i+=6,l+=4}p._locatorBuckets.push({locator:r,count:y}),l+4>O.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),l=0,r.count=s,i=0,s=0,r=new kW(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Rm.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 CE={positions:void 0,lengths:void 0},Oue=new Array(1),E7e=new d,S7e=new he;Rm.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return Oue[0]=n.length,CE.positions=n,CE.lengths=Oue,CE;Uue(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,l=E7e;for(let u=0;u<s;++u)a=n[u],l=B.multiplyByPoint(r,a,l),o.push(t.project(i.cartesianToCartographic(l,S7e)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return CE.positions=o,CE.lengths=e._segments.lengths,CE};var Rue;Rm.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*O.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Rue,l=6*s*3;!c(a)||a.length<l?a=Rue=new Float32Array(l):a.length>l&&(a=new Float32Array(a.buffer,0,l));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?y=f[s-2]:(y=Hz,d.subtract(f[0],f[1],y),d.add(f[0],y,y)):y=f[b-1],d.clone(y,jf),d.clone(f[b],Ds),b===s-1?t._loop?y=f[1]:(y=Hz,d.subtract(f[s-1],f[s-2],y),d.add(f[s-1],y,y)):y=f[b+1],d.clone(y,Wf);let x=h[g];b===m+x&&(m+=x,++g);let A=b-m===0,C=b===m+h[g]-1;o===oe.SCENE2D&&(jf.z=0,Ds.z=0,Wf.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(A||C)&&r-Math.abs(Ds.x)<1&&((Ds.x<0&&jf.x>0||Ds.x>0&&jf.x<0)&&d.clone(Ds,jf),(Ds.x<0&&Wf.x>0||Ds.x>0&&Wf.x<0)&&d.clone(Ds,Wf));let S=A?2:0,v=C?2:4;for(let P=S;P<v;++P)Hn.writeElements(Ds,a,p),Hn.writeElements(jf,a,p+6),Hn.writeElements(Wf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var dh=fh;function zy(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 Ru({batchTable:e.batchTable}),this._labelCollection=new Om({batchTable:e.batchTable}),this._polylineCollection=new dh,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(zy.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 w7e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+ie.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ce.pack(n,s,a),a+=ce.packedLength,ie.pack(t,s,a),s}var v7e=new yi("createVectorTilePoints",5),D7e=new d;function P7e(e,t){let n=e._positions,i=e._packedBuffer;c(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=w7e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=v7e.scheduleTask(r,o);if(c(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let l=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let m=h[g],y=d.unpack(n,g*3,D7e),b=l.add();b.position=y,b._batchIndex=m;let x=u.add();x.text=" ",x.position=y,x._batchIndex=m;let A=f.add();A.positions=[d.clone(y),d.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}zy.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 l=r[a],u=n.get(a),f=i.get(a),h=o.get(a);t[l]=new A_(e,l,u,f,h)}};zy.prototype.applyDebugSettings=function(e,t){e?(G.clone(t,this._billboardCollection._highlightColor),G.clone(t,this._labelCollection._highlightColor),G.clone(t,this._polylineCollection._highlightColor)):(G.clone(G.WHITE,this._billboardCollection._highlightColor),G.clone(G.WHITE,this._labelCollection._highlightColor),G.clone(G.WHITE,this._polylineCollection._highlightColor))};function I7e(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=A_.defaultPointSize,s.color=A_.defaultColor,s.pointOutlineColor=A_.defaultPointOutlineColor,s.pointOutlineWidth=A_.defaultPointOutlineWidth,s.labelColor=G.WHITE,s.labelOutlineColor=G.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Yo.FILL,s.labelText=void 0,s.backgroundColor=new G(.165,.165,.165,.8),s.backgroundPadding=new H(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=G.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=bi.CENTER,s.verticalOrigin=Fn.CENTER,s.labelHorizontalOrigin=bi.RIGHT,s.labelVerticalOrigin=Fn.BASELINE}}var O7e=new G,R7e=new G,M7e=new G,L7e=new G,N7e=new G,F7e=new G,mL=new Bt,pL=new Bt,HW=new Mt;zy.prototype.applyStyle=function(e,t){if(!c(e)){I7e(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(c(e.show)&&(s.show=e.show.evaluate(s)),c(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),c(e.color)&&(s.color=e.color.evaluateColor(s,O7e)),c(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,R7e)),c(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),c(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,M7e)),c(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,L7e)),c(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),c(e.font)&&(s.font=e.font.evaluate(s)),c(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),c(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,c(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,N7e)),c(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),c(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),c(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);c(a)?(mL.near=a.x,mL.nearValue=a.y,mL.far=a.z,mL.farValue=a.w,s.scaleByDistance=mL):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(c(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);c(a)?(pL.near=a.x,pL.nearValue=a.y,pL.far=a.z,pL.farValue=a.w,s.translucencyByDistance=pL):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(c(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);c(a)?(HW.near=a.x,HW.far=a.y,s.distanceDisplayCondition=HW):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;c(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),c(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),c(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,F7e)),c(e.image)?s.image=e.image.evaluate(s):s.image=void 0,c(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),c(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),c(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),c(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),c(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};zy.prototype.update=function(e){if(!this._ready&&(c(this._promise)||(this._promise=P7e(this,e.mapProjection.ellipsoid)),c(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};zy.prototype.isDestroyed=function(){return!1};zy.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(),de(this)};var _L=zy;function S_(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=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??d.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=Un.BOTH}Object.defineProperties(S_.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function B7e(e){let t=new Float64Array(3+d.packedLength+ie.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.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]=Dn.unpack(t,n),n+=Dn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let l=G.unpack(t,n);n+=G.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let g=0;g<h;++g)p[g]=t[n++];s[a]=new bm({color:l,offset:u,count:f,batchIds:p})}}var U7e=new yi("createVectorTilePolygons",5),V7e=new G;function z7e(e){if(c(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(!c(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,m=s.length;for(let y=0;y<m;++y){let b=g.getColor(y,V7e);s[y]=b.toRgba()}a=e._packedBuffer=B7e(e)}let l=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;c(f)&&c(h)&&(f=f.slice(),h=h.slice(),l.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=U7e.scheduleTask(u,l);if(c(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 m=new Float64Array(g.packedBuffer),y=m[0];k7e(e,m),e._indices=Fe.getSizeInBytes(y)===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),H7e(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function H7e(e){c(e._primitive)||(e._primitive=new rx({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)}S_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};S_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};S_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};S_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};S_.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=z7e(this)),c(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)};S_.prototype.isDestroyed=function(){return!1};S_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var gL=S_;var yL=`in vec4 currentPosition; +`;function Jf(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=or.fromType(or.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Fr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=N.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=ir.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Gve),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ce.fromPoints(this._actualPositions),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ce}var Hve=Jf.POSITION_INDEX=0,e_t=Jf.SHOW_INDEX=1,t_t=Jf.WIDTH_INDEX=2,n_t=Jf.MATERIAL_INDEX=3,hk=Jf.POSITION_SIZE_INDEX=4,i_t=Jf.DISTANCE_DISPLAY_CONDITION=5,Gve=Jf.NUMBER_OF_PROPERTIES=6;function S_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Jf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,S_(this,e_t))}},positions:{get:function(){return this._positions},set:function(e){let t=Fr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&S_(this,hk),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ce.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),S_(this,Hve),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,S_(this,n_t))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,S_(this,t_t))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,S_(this,hk)}}},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){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),S_(this,i_t))}}});Jf.prototype.update=function(){let e=N.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Hve]>0||this._propertiesChanged[hk]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=ir.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ce.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)S_(this,hk);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){S_(this,hk);break}}};Jf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Jf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Gve-1;++t)e[t]=0};Jf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var oh=Jf;var r_t=oh.SHOW_INDEX,o_t=oh.WIDTH_INDEX,xte=oh.POSITION_INDEX,s_t=oh.MATERIAL_INDEX,Wve=oh.POSITION_SIZE_INDEX,a_t=oh.DISTANCE_DISPLAY_CONDITION,Zve=oh.NUMBER_OF_PROPERTIES,Qu={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 Mm(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=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(Zve),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=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Mm.prototype,{length:{get:function(){return Tte(this),this._polylines.length}}});Mm.prototype.add=function(e){let t=new oh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Mm.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};Mm.prototype.removeAll=function(){Ete(this),iSe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Mm.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Mm.prototype.get=function(e){return Tte(this),this._polylines[e]};function c_t(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new yT(t,n,e._polylines.length)}var Qve=new Sn,eSe=new se,tSe=new U;Mm.prototype.update=function(e){if(Tte(this),this._polylines.length===0||!this.show)return;m_t(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(kt.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");c_t(this,t),this._createBatchTable=!1}if(this._createVertexArray||u_t(this))Xve(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[Wve]||r[s_t])Xve(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[xte]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[r_t]||r[o_t])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[xte]||r[Wve]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,Qve),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,eSe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[a_t]){let m=tSe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<Zve;++c)r[c]=0;let o=N.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ge.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;l_t(this,e,c,o)}};var mk=new ce,qve=new ce;function l_t(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],E=T.offset,v=T.bucket.shaderProgram,S=T.bucket.polylines,I=S.length,R,O,L=0,_,C;for(let w=0;w<I;++w){let P=S[w],M=d_t(P._material);if(M!==R){if(l(R)&&L>0){let j=O.isTranslucent();a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ce.clone(mk,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,o.push(_)}O=P._material,O.update(r),R=M}let F=P._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let k=F[j];k.locator===T&&(L+=k.count)}let B;t.mode===re.SCENE3D?B=P._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?B=P._boundingVolume2D:t.mode===re.SCENE2D?l(P._boundingVolume2D)&&(B=ce.clone(P._boundingVolume2D,qve),B.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(B=ce.union(P._boundingVolumeWC,P._boundingVolume2D,qve)),c?(c=!1,ce.clone(B,mk)):ce.union(B,mk,mk)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ce.clone(mk,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,o.push(_)),R=void 0}}n.length=a}Mm.prototype.isDestroyed=function(){return!1};Mm.prototype.destroy=function(){return nSe(this),Ete(this),iSe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function u_t(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[xte]?(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 Yve=[0,0,0];function Xve(e,t,n){e._createVertexArray=!1,Ete(e),nSe(e),h_t(e);let i=[[]],r,o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,E,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let C=g.lengthOfPositions;x+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,S=Me.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=tt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:A,usage:S});let R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(r=i[C],r.length>0){let w=new Uint16Array(r),P=tt.createIndexBuffer({context:t,typedArray:w,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});L+=a[C];let M=6*(C*(R*D.SIXTY_FOUR_KILOBYTES)-L*R),F=R+M,V=R+F,B=R+V,j=R+B,k=R+j,G=C*(O*D.SIXTY_FOUR_KILOBYTES)-L*O,q=[{index:Qu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Qu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Qu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Qu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Qu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Qu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Qu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Qu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Qu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Qu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Qu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Qu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Qu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=Yve,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=Yve,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(W=I,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),q[0][Q]=W,q[1][Q]=W,q[2][Z]=J,q[3][Z]=J,q[4][Q]=W,q[5][Q]=W,q[6][Z]=J,q[7][Z]=J,q[8][Q]=W,q[9][Q]=W,q[10][Z]=J,q[11][Z]=J;let ae=new zn({context:t,attributes:q,indexBuffer:P});e._vertexArrays.push({va:ae,buckets:u[C]})}}}function f_t(e,t){return t instanceof Dt?t.id:t}var jG=[];function d_t(e){let t=or._uniformList[e.type],n=t.length;jG.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];jG[i]=o,jG[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(jG,f_t)}`}function h_t(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new m0(c,t,n)),u.addPolyline(a)}}}function m_t(e,t){let n=t.mode;(e._mode!==n||!N.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=N.clone(e.modelMatrix),e._createVertexArray=!0)}function Tte(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function Ete(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function nSe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Mm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function iSe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function bte(e,t,n){this.count=e,this.offset=t,this.bucket=n}function m0(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}m0.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};m0.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"),i.push("CLIP_POLYLINE");let r=new Ye({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,ET]}),o=t.getVertexShaderCallback()(dk),s=new Ye({defines:i,sources:[eu,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Qu})};function rSe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}m0.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!rSe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var va=new h,sh=new h,ah=new h,HG=new h,p_t=new se,g_t=new U;m0.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*D.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,a),x=b.positions,T=b.lengths,E=x.length,v=g.getPickId(s).color,S=0,I=0,R;for(let V=0;V<E;++V){V===0?g._loop?R=x[E-2]:(R=HG,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,sh),h.clone(x[V],va),V===E-1?g._loop?R=x[1]:(R=HG,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,ah);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(sh.z=0,va.z=0,ah.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(va.x)<1&&((va.x<0&&sh.x>0||va.x>0&&sh.x<0)&&h.clone(va,sh),(va.x<0&&ah.x>0||va.x>0&&ah.x<0)&&h.clone(va,ah));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(va,e,n),Sn.writeElements(sh,e,n+6),Sn.writeElements(ah,e,n+12);let W=Q-2<0?-1:1;t[r]=V/(E-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=A,n+=18,r+=4}}let O=p_t;O.x=z.floatToByte(v.red),O.y=z.floatToByte(v.green),O.z=z.floatToByte(v.blue),O.w=z.floatToByte(v.alpha);let L=g_t;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,Qve),w=C.high,P=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,eSe),M=tSe;M.x=0,M.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(M.x=F.near,M.y=F.far),o.setBatchedAttribute(A,0,L),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,w),o.setBatchedAttribute(A,3,P),o.setBatchedAttribute(A,4,M))}};var __t=new h,y_t=new h,A_t=new h,Kve=new h;m0.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=Kve,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,y_t);let m=N.multiplyByPoint(n,a[p],__t),y;p===u-1?s._loop?y=a[1]:(y=Kve,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=N.multiplyByPoint(n,y,A_t);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,E=x?2:4;for(let v=T;v<E;++v)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var b_t=new Array(1);m0.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new bte(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=b_t;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new bte(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new bte(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};m0.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var Mw={positions:void 0,lengths:void 0},$ve=new Array(1),x_t=new h,T_t=new he;m0.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return $ve[0]=n.length,Mw.positions=n,Mw.lengths=$ve,Mw;rSe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=x_t;for(let u=0;u<s;++u)a=n[u],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,T_t)));if(r.length>0){e._boundingVolume2D=ce.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return Mw.positions=r,Mw.lengths=e._segments.lengths,Mw};var Jve;m0.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*D.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Jve,c=6*s*3;!l(a)||a.length<c?a=Jve=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let A=0;A<s;++A){A===0?t._loop?y=f[s-2]:(y=HG,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,sh),h.clone(f[A],va),A===s-1?t._loop?y=f[1]:(y=HG,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,ah);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(sh.z=0,va.z=0,ah.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(va.x)<1&&((va.x<0&&sh.x>0||va.x>0&&sh.x<0)&&h.clone(va,sh),(va.x<0&&ah.x>0||va.x>0&&ah.x<0)&&h.clone(va,ah));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(va,a,p),Sn.writeElements(sh,a,p+6),Sn.writeElements(ah,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Nm=Mm;function YA(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._heightReference=e.heightReference,this._billboardCollection=new $f({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new h0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Nm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(YA.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 E_t(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+ee.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ie.pack(n,s,a),a+=ie.packedLength,ee.pack(t,s,a),s}var C_t=new $n("createVectorTilePoints",5),v_t=new h;function S_t(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=E_t(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=C_t.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??We.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,v_t),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}YA.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new C_(e,c,u,f,d)}};YA.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function w_t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=C_.defaultPointSize,s.color=C_.defaultColor,s.pointOutlineColor=C_.defaultPointOutlineColor,s.pointOutlineWidth=C_.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=xo.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(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=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Hi.CENTER,s.verticalOrigin=Gn.CENTER,s.labelHorizontalOrigin=Hi.RIGHT,s.labelVerticalOrigin=Gn.BASELINE}}var I_t=new z,P_t=new z,D_t=new z,R_t=new z,O_t=new z,M_t=new z,pk=new qt,gk=new qt,Cte=new Ht;YA.prototype.applyStyle=function(e,t){if(!l(e)){w_t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];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,I_t)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,P_t)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,D_t)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,R_t)),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,O_t)),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)?(pk.near=a.x,pk.nearValue=a.y,pk.far=a.z,pk.farValue=a.w,s.scaleByDistance=pk):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(gk.near=a.x,gk.nearValue=a.y,gk.far=a.z,gk.farValue=a.w,s.translucencyByDistance=gk):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Cte.near=a.x,Cte.far=a.y,s.distanceDisplayCondition=Cte):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,M_t)),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))}};YA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=S_t(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)};YA.prototype.isDestroyed=function(){return!1};YA.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(),ue(this)};var _k=YA;function w_(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=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.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=ti.BOTH}Object.defineProperties(w_.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 N_t(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,ie.pack(e._rectangle,t,n),t}function L_t(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=en.unpack(t,n),n+=en.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new s0({color:c,offset:u,count:f,batchIds:p})}}var F_t=new $n("createVectorTilePolygons",5),B_t=new z;function k_t(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=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(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let A=g.getColor(y,B_t);s[y]=A.toRgba()}a=e._packedBuffer=N_t(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=F_t.scheduleTask(u,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 m=new Float64Array(g.packedBuffer),y=m[0];L_t(e,m),e._indices=je.getSizeInBytes(y)===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),U_t(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function U_t(e){l(e._primitive)||(e._primitive=new HT({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)}w_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};w_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};w_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};w_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};w_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=k_t(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)};w_.prototype.isDestroyed=function(){return!1};w_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var yk=w_;var Ak=`in vec4 currentPosition; in vec4 previousPosition; in vec4 nextPosition; in vec2 expandAndWidth; @@ -5881,12 +7496,12 @@ float angle; vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; } -`;function hh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(hh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function G7e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var j7e=new yi("createVectorTilePolylines",5),EE={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function W7e(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=G7e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=j7e.scheduleTask(l,a);if(c(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),q7e(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function q7e(e,t){if(!c(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,l=i.byteLength+n.byteLength+o.byteLength;l+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=l;let u=yt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),f=yt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),h=yt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),m=yt.createIndexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),y=[{index:EE.previousPosition,vertexBuffer:u,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:EE.currentPosition,vertexBuffer:f,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:EE.nextPosition,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:EE.expandAndWidth,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:2},{index:EE.a_batchId,vertexBuffer:g,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:y,indexBuffer:m}),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 bL=new B,Vue=new d;function Y7e(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,bL),B.multiplyByPoint(bL,e._center,Vue),B.setTranslation(bL,Vue,bL),bL},u_highlightColor:function(){return e._highlightColor}})}function X7e(e){if(c(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var K7e=`uniform vec4 u_highlightColor; +`;function Lm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.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=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Lm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function z_t(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var V_t=new $n("createVectorTilePolylines",5),Nw={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function j_t(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=z_t(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=V_t.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),H_t(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function H_t(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:Nw.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Nw.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Nw.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Nw.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:Nw.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new zn({context:t,attributes:y,indexBuffer:m}),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 bk=new N,oSe=new h;function G_t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,bk),N.multiplyByPoint(bk,e._center,oSe),N.setTranslation(bk,oSe,bk),bk},u_highlightColor:function(){return e._highlightColor}})}function W_t(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var q_t=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } -`;function $7e(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(yL),o=n.getFragmentShaderCallback(!1,void 0,!1)(K7e),r=new He({defines:["VECTOR_TILE",Vt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xu,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=Jt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:EE})}function Z7e(e,t){if(!c(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:De.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}hh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!c(n)||!c(i))return;let r,s,a=n.length,l=0,u=0;for(r=0;r<a;++r)n[r]===t&&(l+=o[r+1]-o[r]);if(l===0)return;let f=new Float64Array(l*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;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};hh.prototype.getPositions=function(e){return hh.getPolylinePositions(this,e)};hh.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 Ws(e,r)}};hh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Q7e(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=G.WHITE}}var J7e=new G,eYe=G.WHITE,tYe=!0;hh.prototype.applyStyle=function(e,t){if(!c(e)){Q7e(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=c(e.color)?e.color.evaluateColor(s,J7e):eYe,s.show=c(e.show)?e.show.evaluate(s):tYe}};hh.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=W7e(this,t)),c(this._error)){let i=this._error;throw this._error=void 0,i}return}Y7e(this,t),$7e(this,t),X7e(this);let n=e.passes;(n.render||n.pick)&&Z7e(this,e)};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var kx=hh;var xL=`in vec3 startEllipsoidNormal; +`;function Y_t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Ak),r=n.getFragmentShaderCallback(!1,void 0,!1)(q_t),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[eu,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Nw})}function X_t(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Lm.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Lm.prototype.getPositions=function(e){return Lm.getPolylinePositions(this,e)};Lm.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new sa(e,o)}};Lm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function K_t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var $_t=new z,J_t=z.WHITE,Z_t=!0;Lm.prototype.applyStyle=function(e,t){if(!l(e)){K_t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,$_t):J_t,s.show=l(e.show)?e.show.evaluate(s):Z_t}};Lm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=j_t(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}G_t(this,t),Y_t(this,t),W_t(this);let n=e.passes;(n.render||n.pick)&&X_t(this,e)};Lm.prototype.isDestroyed=function(){return!1};Lm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var uE=Lm;var xk=`in vec3 startEllipsoidNormal; in vec3 endEllipsoidNormal; in vec4 startPositionAndHeight; in vec4 endPositionAndHeight; @@ -5932,7 +7547,7 @@ vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); v_halfWidth = endFaceNormalAndHalfWidth.w; } -`;var TL=`in vec4 v_startPlaneEC; +`;var Tk=`in vec4 v_startPlaneEC; in vec4 v_endPlaneEC; in vec4 v_rightPlaneEC; in float v_halfWidth; @@ -5967,19 +7582,245 @@ discard; out_FragColor = u_highlightColor; czm_writeDepthClamp(); } -`;function w_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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 H(ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight),this._boundingVolume=Dn.fromRectangle(e.rectangle,ui._defaultMinTerrainHeight,ui._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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(w_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function nYe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,l=e._rectangle;Dn.fromRectangle(l,o,r,n,a)}function iYe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var oYe=new yi("createVectorTileClampedPolylines"),Hy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function rYe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=iYe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=oYe.scheduleTask(l,a);if(c(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),sYe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function sYe(e,t){if(!c(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=l.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=yt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),m=yt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),y=yt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),b=yt.createVertexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW}),x=yt.createVertexBuffer({context:t,typedArray:l,usage:Be.STATIC_DRAW}),A=yt.createIndexBuffer({context:t,typedArray:u,usage:Be.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),C=[{index:Hy.startEllipsoidNormal,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Hy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Hy.startPositionAndHeight,vertexBuffer:g,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.endPositionAndHeight,vertexBuffer:m,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Hy.a_batchId,vertexBuffer:x,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:C,indexBuffer:A}),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 AL=new B,zue=new d;function aYe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return B.clone(n,AL),B.multiplyByPoint(AL,e._center,zue),B.setTranslation(AL,zue,AL),AL},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Hue(e){return Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:ln.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function cYe(e){c(e._rs)||(e._rs=Hue(!1),e._rs3DTiles=Hue(!0))}function lYe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(xL),o=n.getFragmentShaderCallback(!1,void 0,!0)(TL),r=new He({defines:["VECTOR_TILE",Vt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xu,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=Jt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Hy})}function uYe(e,t){let n=e._command;if(!c(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Qe({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:De.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=Qe.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=De.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Un.TERRAIN||i===Un.BOTH)&&t.commandList.push(n),(i===Un.CESIUM_3D_TILE||i===Un.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}w_.prototype.getPositions=function(e){return kx.getPolylinePositions(this,e)};w_.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 Ws(e,r)}};w_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function fYe(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=G.WHITE}}var dYe=new G,hYe=G.WHITE,mYe=!0;w_.prototype.applyStyle=function(e,t){if(!c(e)){fYe(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=c(e.color)?e.color.evaluateColor(s,dYe):hYe,s.show=c(e.show)?e.show.evaluate(s):mYe}};function pYe(e){return ui.initialize().then(function(){nYe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}w_.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=pYe(this).then(rYe(this,t))),c(this._error)){let i=this._error;throw this._error=void 0,i}return}aYe(this,t),lYe(this,t),cYe(this);let n=e.passes;(n.render||n.pick)&&uYe(this,e)};w_.prototype.isDestroyed=function(){return!1};w_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var CL=w_;var GW=32767,_Ye=new he,gYe=new d;function yYe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),l=e.subarray(2*r,3*r);Ln.zigZagDeltaDecode(s,a,l);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=s[f],p=a[f],g=l[f],m=O.lerp(t.west,t.east,h/GW),y=O.lerp(t.south,t.north,p/GW),b=O.lerp(n,i,g/GW),x=he.fromRadians(m,y,b,_Ye),A=o.cartographicToCartesian(x,gYe);d.pack(A,u,f*3)}return u}var EL=yYe;function ph(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,CYe(this,i,o)}Object.defineProperties(ph.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return c(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.trianglesLength),c(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.geometryByteLength),c(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return c(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return c(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 bYe(e){return function(t,n){c(e._polygons)&&e._polygons.updateCommands(t,n)}}function xYe(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,l=e.POINTS_LENGTH??0;if(s>0&&c(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&c(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(l>0&&c(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,l)}let u=c(n)||c(i)||c(o),f=s>0&&!c(n)||a>0&&!c(i)||l>0&&!c(o);if(u&&f)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)){let p=0;if(!c(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!c(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!c(o)&&l>0)for(o=new Uint16Array(l),r=0;r<l;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var mh=Uint32Array.BYTES_PER_ELEMENT;function TYe(e){return new kx(e)}function AYe(e){return new CL(e)}function CYe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=mh;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=mh;let s=o.getUint32(n,!0);if(n+=mh,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=mh,a===0)throw new ae("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=mh;let u=o.getUint32(n,!0);n+=mh;let f=o.getUint32(n,!0);n+=mh;let h=o.getUint32(n,!0);n+=mh;let p=o.getUint32(n,!0);n+=mh;let g=o.getUint32(n,!0);n+=mh;let m=o.getUint32(n,!0);n+=mh;let y=ir(i,n,a);n+=a;let b=new Uint8Array(t,n,l);n+=l;let x,A;u>0&&(x=ir(i,n,u),n+=u,f>0&&(A=new Uint8Array(t,n,f),A=new Uint8Array(A),n+=f));let C=y.POLYGONS_LENGTH??0,S=y.POLYLINES_LENGTH??0,v=y.POINTS_LENGTH??0,P=C+S+v,M=new Kp(e,P,x,A,bYe(e));if(e._batchTable=M,P===0)return;let R=new sh(y,b),L=R.getGlobalProperty("REGION");if(!c(L))throw new ae("Feature table global property: REGION must be defined");let F=ce.unpack(L),_=L[4],w=L[5],D=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(I)?(I=d.unpack(I),B.multiplyByPoint(D,I,I)):(I=ce.center(F),I.height=O.lerp(_,w,.5),I=ie.WGS84.cartographicToCartesian(I));let N=xYe(y,b);if(n+=(4-n%4)%4,C>0){R.featuresLength=C;let k=R.getPropertyArray("POLYGON_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let z=R.getPropertyArray("POLYGON_INDEX_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_INDEX_COUNT",$.UNSIGNED_INT,1);if(!c(z))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=k.reduce(function(K,Z){return K+Z*2},0),j=z.reduce(function(K,Z){return K+Z},0),U=new Uint32Array(t,n,j);n+=h;let q=new Uint16Array(t,n,V);n+=p;let Y,te;c(y.POLYGON_MINIMUM_HEIGHTS)&&c(y.POLYGON_MAXIMUM_HEIGHTS)&&(Y=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",$.FLOAT,1),te=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",$.FLOAT,1)),e._polygons=new gL({positions:q,counts:k,indexCounts:z,indices:U,minimumHeight:_,maximumHeight:w,polygonMinimumHeights:Y,polygonMaximumHeights:te,center:I,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,batchIds:N.polygons,modelMatrix:D})}if(S>0){R.featuresLength=S;let k=R.getPropertyArray("POLYLINE_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYLINE_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let z=R.getPropertyArray("POLYLINE_WIDTHS",$.UNSIGNED_SHORT,1);if(!c(z)){z=new Uint16Array(S);for(let te=0;te<S;++te)z[te]=2}let V=k.reduce(function(te,K){return te+K*3},0),j=new Uint16Array(t,n,V);n+=g;let U=e._tileset,q=U.examineVectorLinesFunction;if(c(q)){let te=EL(new Uint16Array(j),F,_,w,ie.WGS84);EYe(te,k,N.polylines,M,e.url,q)}let Y=TYe;c(U.classificationType)&&(Y=AYe),e._polylines=Y({positions:j,widths:z,counts:k,batchIds:N.polylines,minimumHeight:_,maximumHeight:w,center:I,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(v>0){let k=new Uint16Array(t,n,v*3);n+=m,e._points=new _L({positions:k,batchIds:N.points,minimumHeight:_,maximumHeight:w,rectangle:F,batchTable:M})}}function jW(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._polygons)&&e._polygons.createFeatures(e,n),c(e._polylines)&&e._polylines.createFeatures(e,n),c(e._points)&&e._points.createFeatures(e,n),e._features=n}}ph.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ph.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new E(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return c(this._features)||jW(this),this._features[e]};ph.prototype.applyDebugSettings=function(e,t){c(this._polygons)&&this._polygons.applyDebugSettings(e,t),c(this._polylines)&&this._polylines.applyDebugSettings(e,t),c(this._points)&&this._points.applyDebugSettings(e,t)};ph.prototype.applyStyle=function(e){c(this._features)||jW(this),c(this._polygons)&&this._polygons.applyStyle(e,this._features),c(this._polylines)&&this._polylines.applyStyle(e,this._features),c(this._points)&&this._points.applyStyle(e,this._features)};ph.prototype.update=function(e,t){let n=!0;c(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),c(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),c(this._points)&&(this._points.update(t),n=n&&this._points.ready),c(this._batchTable)&&n&&(c(this._features)||jW(this),this._batchTable.update(e,t),this._ready=!0)};ph.prototype.pick=function(e,t,n){};ph.prototype.getPolylinePositions=function(e){let t=this._polylines;if(c(t))return t.getPositions(e)};ph.prototype.isDestroyed=function(){return!1};ph.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(),de(this)};function EYe(e,t,n,i,o,r){let s=t.length,a=0;for(let l=0;l<s;l++){let u=t[l]*3,f=e.slice(a,a+u);a+=u,r(f,n[l],o,i)}}var SL=ph;var Gue={b3dm:function(e,t,n,i,o){return Ou.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Ou.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Ou.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return QO.fromTileType(e,t,n,i,o,Gue)},externalTileset:function(e,t,n,i){return tL.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new n1(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new SL(e,t,n,i,o)},subt:function(e,t,n,i,o){return XC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return XC.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),l=new Uint8Array(i,o,a);return Ou.fromGltf(e,t,n,l)},gltf:function(e,t,n,i){return Ou.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Ou.fromGeoJson(e,t,n,i)}},Ux=Gue;var SYe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Xo=Object.freeze(SYe);var _h={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"};_h.isBinaryFormat=function(e){switch(e){case _h.BATCHED_3D_MODEL:case _h.INSTANCED_3D_MODEL:case _h.COMPOSITE:case _h.POINT_CLOUD:case _h.VECTOR:case _h.GEOMETRY:case _h.IMPLICIT_SUBTREE:case _h.VOXEL_BINARY:case _h.GLTF_BINARY:return!0;default:return!1}};var Ps=Object.freeze(_h);var wYe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},qf=Object.freeze(wYe);var $s={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},v_=new Array($s.NUMBER_OF_PASSES);v_[$s.RENDER]=Object.freeze({pass:$s.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});v_[$s.PICK]=Object.freeze({pass:$s.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});v_[$s.SHADOW]=Object.freeze({pass:$s.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});v_[$s.PRELOAD]=Object.freeze({pass:$s.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[$s.PRELOAD_FLIGHT]=Object.freeze({pass:$s.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[$s.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:$s.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[$s.MOST_DETAILED_PRELOAD]=Object.freeze({pass:$s.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});v_[$s.MOST_DETAILED_PICK]=Object.freeze({pass:$s.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});$s.getPassOptions=function(e){return v_[e]};var Uo=Object.freeze($s);function Mm(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Mm.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){throw new E("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new E("Empty3DTileContent cannot have group metadata")}}});Mm.prototype.hasProperty=function(e,t){return!1};Mm.prototype.getFeature=function(e){};Mm.prototype.applyDebugSettings=function(e,t){};Mm.prototype.applyStyle=function(e){};Mm.prototype.update=function(e,t){};Mm.prototype.pick=function(e,t,n){};Mm.prototype.isDestroyed=function(){return!1};Mm.prototype.destroy=function(){return de(this)};var SE=Mm;function D_(e){e=e??W.EMPTY_OBJECT;let t=e.content,n=e.class;T.typeOf.object("options.content",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(D_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});D_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};D_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};D_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};D_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};D_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};D_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};D_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var wL=D_;function WW(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){WW._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=e.schema.classes??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new wL({content:n,class:o})}}WW._oneTimeWarning=dt;var Vx=WW;function vYe(e,t){let n=e.metadataExtension;if(!c(n))return;let i=n.groups,o=oi(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 zx=vYe;function P_(e){e=e??W.EMPTY_OBJECT;let t=e.tile,n=e.class;T.typeOf.object("options.tile",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(P_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});P_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};P_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};P_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};P_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};P_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};P_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};P_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var vL=P_;function qW(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){qW._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=e.schema.classes??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new vL({tile:n,class:o})}}qW._oneTimeWarning=dt;var DL=qW;function DYe(e){let t=new Uint8Array(e),n=Kd(t);if(n==="glTF"&&(n="glb"),Ps.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=PYe(t);if(c(i.root))return{contentType:Ps.EXTERNAL_TILESET,jsonPayload:i};if(c(i.asset))return{contentType:Ps.GLTF,jsonPayload:i};if(c(i.tileAvailability))return{contentType:Ps.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(c(i.type))return{contentType:Ps.GEOJSON,jsonPayload:i};if(c(i.voxelTable))return{contentType:Ps.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function PYe(e){let t;try{t=ir(e)}catch{throw new ae("Invalid tile content.")}return t}var I_=DYe;function Yf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=c(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}),l=sc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=l}}Object.defineProperties(Yf.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(){throw new E("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new E("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function YW(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function jue(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)}Yf.prototype.requestInnerContents=function(){if(!IYe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;YW(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=OYe(this,n,t,this._tile._contentState);return RYe(this)};function IYe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];c(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!sc.serverHasOpenSlots(n,t[n]))return!1;return sc.heapHasOpenSlots(e.length)}function OYe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],l=new Qo({throttle:!0,throttleByServer:!0,type:ms.TILES3D,priorityFunction:s,serverKey:a});o.request=l,e._requests[t]=l;let u=o.fetchArrayBuffer();if(c(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){jue(e,i);return}return YW(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===$n.CANCELLED){jue(e,i);return}YW(e,-1),Wue(e,t,f)}})}async function RYe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>MYe(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(c),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function MYe(e,t,n){if(c(t))try{let i=I_(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Ps.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ps.GEOMETRY||i.contentType===Ps.VECTOR;let a,l=Ux[i.contentType];c(i.binaryPayload)?a=await Promise.resolve(l(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(l(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=Vx(o,u));let f=zx(o,u);return c(f)&&(a.group=new tx({metadata:f})),a}catch(i){Wue(e,n,i)}}function Wue(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=c(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}`))}Yf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];c(t)&&t.cancel()}};Yf.prototype.hasProperty=function(e,t){return!1};Yf.prototype.getFeature=function(e){};Yf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Yf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Yf.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)};Yf.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 l=r[a].pick(e,t,n);if(!c(l))continue;let u=d.distance(e.origin,l);u<o&&(i=l,o=u)}if(c(i))return n};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var PL=Yf;var que=Math.cos,Yue=Math.sin,LYe=Math.sqrt,XW={};XW.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,l=e.nwCorner,u=e.boundingRectangle,f=l.latitude-e.granYCos*i+o*e.granXSin,h=que(f),p=Yue(f),g=a.z*p,m=l.longitude+i*e.granYSin+o*e.granXCos,y=h*que(m),b=h*Yue(m),x=a.x*y,A=a.y*b,C=LYe(x*y+A*b+g*p);if(r.x=x/C,r.y=A/C,r.z=g/C,n){let S=e.stNwCorner;c(S)?(f=S.latitude-e.stGranYCos*i+o*e.stGranXSin,m=S.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var NYe=new Ri,Xf=new d,FYe=new he,Gz=new d,IL=new Oi;function Xue(e,t,n,i,o,r,s){let a=Math.cos(t),l=i*a,u=n*a,f=Math.sin(t),h=i*f,p=n*f;IL._ellipsoid=ie.default,Xf=IL.project(e,Xf),Xf=d.subtract(Xf,Gz,Xf);let g=Ri.fromRotation(t,NYe);Xf=Ri.multiplyByVector(g,Xf,Xf),Xf=d.add(Xf,Gz,Xf),e=IL.unproject(Xf,e),r-=1,s-=1;let m=e.latitude,y=m+r*p,b=m-l*s,x=m-l*s+r*p,A=Math.max(m,y,b,x),C=Math.min(m,y,b,x),S=e.longitude,v=S+r*u,P=S+s*h,M=S+s*h+r*u,R=Math.max(S,v,P,M),L=Math.min(S,v,P,M);return{north:A,south:C,east:R,west:L,granYCos:l,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}XW.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,l=e.west,u=e.north,f=e.south,h=!1,p=!1;u===O.PI_OVER_TWO&&(h=!0),f===-O.PI_OVER_TWO&&(p=!0);let g,m=u-f;l>a?g=O.TWO_PI-l+a:g=a-l;let y=Math.ceil(g/t)+1,b=Math.ceil(m/t)+1,x=g/(y-1),A=m/(b-1),C=ce.northwest(e,r),S=ce.center(e,FYe);(n!==0||i!==0)&&(S.longitude<C.longitude&&(S.longitude+=O.TWO_PI),IL._ellipsoid=ie.default,Gz=IL.project(S,Gz));let v=A,P=x,M=0,R=0,L=ce.clone(e,o),F={granYCos:v,granYSin:M,granXCos:P,granXSin:R,nwCorner:C,boundingRectangle:L,width:y,height:b,northCap:h,southCap:p};if(n!==0){let _=Xue(C,n,x,A,S,y,b);if(u=_.north,f=_.south,a=_.east,l=_.west,u<-O.PI_OVER_TWO||u>O.PI_OVER_TWO||f<-O.PI_OVER_TWO||f>O.PI_OVER_TWO)throw new E("Rotated rectangle is invalid. It crosses over either the north or south pole.");F.granYCos=_.granYCos,F.granYSin=_.granYSin,F.granXCos=_.granXCos,F.granXSin=_.granXSin,L.north=u,L.south=f,L.east=a,L.west=l}if(i!==0){n=n-i;let _=ce.northwest(L,s),w=Xue(_,n,x,A,S,y,b);F.stGranYCos=w.granYCos,F.stGranXCos=w.granXCos,F.stGranYSin=w.granYSin,F.stGranXSin=w.granXSin,F.stNwCorner=_,F.stWest=w.west,F.stSouth=w.south}return F};var Is=XW;var BYe=new le,kYe=new le,UYe=new d,VYe=new ce;function Kue(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,l=2,u=0,f=4;r&&(l-=1,a-=1,u+=1,f-=2),s&&(l-=1,a-=1,u+=1,f-=2),u+=l*o+2*a-f;let h=new Float64Array(u*3),p=0,g=0,m,y=UYe;if(r)Is.computePosition(t,n,!1,g,0,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;else for(m=0;m<o;m++)Is.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=o-1,g=1;g<i;g++)Is.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;if(g=i-1,!s)for(m=o-2;m>=0;m--)Is.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=0,g=i-2;g>0;g--)Is.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;let b=h.length/3*2,x=Fe.createTypedArray(h.length/3,b),A=0;for(let S=0;S<h.length/3-1;S++)x[A++]=S,x[A++]=S+1;x[A++]=h.length/3-1,x[A++]=0;let C=new ct({attributes:new fn,primitiveType:Me.LINES});return C.attributes.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),C.indices=x,C}function zYe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Kue(e,t),s=t.height,a=t.width,l=si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=l.length,f=new Float64Array(u*2);f.set(l);let h=si.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,b=Fe.createTypedArray(f.length/3,y);u=f.length/6;let x=0;for(let C=0;C<u-1;C++)b[x++]=C,b[x++]=C+1,b[x++]=C+u,b[x++]=C+u+1;b[x++]=u-1,b[x++]=0,b[x++]=u+u-1,b[x++]=u,b[x++]=0,b[x++]=u;let A;if(p)A=s-1;else{let C=a-1;b[x++]=C,b[x++]=C+u,A=a+s-2}if(b[x++]=A,b[x++]=A+u,!g){let C=a+A-1;b[x++]=C,b[x]=C+u}return r.indices=b,r}function vE(e){e=e??W.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??O.RADIANS_PER_DEGREE,i=e.ellipsoid??ie.default,o=e.rotation??0;if(!c(t))throw new E("rectangle is required.");if(ce._validate(t),t.north<t.south)throw new E("options.rectangle.north must be greater than options.rectangle.south");let r=e.height??0,s=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"}vE.packedLength=ce.packedLength+ie.packedLength+5;vE.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var $ue=new ce,Zue=ie.clone(ie.UNIT_SPHERE),wE={rectangle:$ue,ellipsoid:Zue,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};vE.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i=ce.unpack(e,t,$ue);t+=ce.packedLength;let o=ie.unpack(e,t,Zue);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t];return c(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=l,n._offsetAttribute=u===-1?void 0:u,n):(wE.granularity=r,wE.height=s,wE.rotation=a,wE.extrudedHeight=l,wE.offsetAttribute=u===-1?void 0:u,new vE(wE))};var HYe=new he;vE.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Is.computeOptions(t,e._granularity,e._rotation,0,VYe,HYe),o,r;if(O.equalsEpsilon(t.north,t.south,O.EPSILON10)||O.equalsEpsilon(t.east,t.west,O.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,l=!O.equalsEpsilon(s,a,0,O.EPSILON2),u;if(l){if(o=zYe(e,i),c(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===Zt.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===Zt.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=le.fromRectangle3D(t,n,s,kYe),h=le.fromRectangle3D(t,n,a,BYe);r=le.union(f,h)}else{if(o=Kue(e,i),o.attributes.position.values=si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),c(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===Zt.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,s)}return new ct({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var Hx=vE;function PE(e){T.typeOf.object("options",e),T.typeOf.object("options.rectangle",e.rectangle),this.rectangle=ce.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=e.ellipsoid??ie.WGS84;YYe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(PE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});PE.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Dn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var Que=new d,jz=new d,Jue=new d,GYe=new d,jYe=new d,WYe=new d,qYe=new d,Kf=new he,efe=new sn(d.UNIT_X,0),DE=new mn;function YYe(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),Kf.longitude=t.west,Kf.latitude=(t.south+t.north)*.5,Kf.height=0;let i=n.cartographicToCartesian(Kf,WYe),o=d.cross(i,d.UNIT_Z,GYe);d.normalize(o,e.westNormal),Kf.longitude=t.east;let r=n.cartographicToCartesian(Kf,qYe),s=d.cross(d.UNIT_Z,r,Que);d.normalize(s,e.eastNormal);let a=d.subtract(i,r,Que);d.magnitude(a)===0&&(a=d.clone(o,a));let l=d.normalize(a,jYe),u=t.south,f;if(u>0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=u;let y=n.cartographicToCartesian(Kf,DE.origin);d.clone(l,DE.direction);let b=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,efe);Zn.rayPlane(DE,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,jz)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),jz);let h=d.cross(f,a,Jue);d.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Kf.longitude=(t.west+t.east)*.5,Kf.latitude=p;let y=n.cartographicToCartesian(Kf,DE.origin);d.negate(l,DE.direction);let b=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,efe);Zn.rayPlane(DE,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,jz)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),jz);let m=d.cross(a,g,Jue);d.normalize(m,e.northNormal)}var XYe=new d,KYe=new d,$Ye=new d(0,-1,0),ZYe=new d(0,0,-1),tfe=new d;function QYe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),XYe),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),KYe),f.z=f.y,f.y=f.x,f.x=0,h=$Ye,g=d.UNIT_Y,p=ZYe,m=d.UNIT_Z);let y=d.subtract(i,u,tfe),b=d.dot(y,h),x=d.dot(y,p),A=d.subtract(i,f,tfe),C=d.dot(A,g),S=d.dot(A,m);b>0?r+=b*b:C>0&&(r+=C*C),x>0?r+=x*x:S>0&&(r+=S*S)}let s,a,l;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,l=e.maximumHeight):(s=i.x,a=0,l=0),s>l){let u=s-l;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}PE.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=QYe(this,e);if(e.mode===oe.SCENE3D&&c(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};PE.prototype.intersectPlane=function(e){return T.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};PE.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new B.clone(B.IDENTITY),n=new Hx({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new St({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var Lu=PE;var OL={},JYe=new d,nfe=new d,ife=new d,ofe=new d,rfe=new Dn;OL.validOutline=function(e){T.defined("positions",e);let n=Dn.fromPoints(e,rfe).halfAxes,i=J.getColumn(n,0,nfe),o=J.getColumn(n,1,ife),r=J.getColumn(n,2,ofe),s=d.magnitude(i),a=d.magnitude(o),l=d.magnitude(r);return!(s===0&&(a===0||l===0)||a===0&&l===0)};OL.computeProjectTo2DArguments=function(e,t,n,i){T.defined("positions",e),T.defined("centerResult",t),T.defined("planeAxis1Result",n),T.defined("planeAxis2Result",i);let o=Dn.fromPoints(e,rfe),r=o.halfAxes,s=J.getColumn(r,0,nfe),a=J.getColumn(r,1,ife),l=J.getColumn(r,2,ofe),u=d.magnitude(s),f=d.magnitude(a),h=d.magnitude(l),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let g,m;return(p===f||p===h)&&(g=s),p===u?g=a:p===h&&(m=a),(p===u||p===f)&&(m=l),d.normalize(g,n),d.normalize(m,i),d.clone(o.center,t),!0};function sfe(e,t,n,i,o){let r=d.subtract(e,t,JYe),s=d.dot(n,r),a=d.dot(i,r);return H.fromElements(s,a,o)}OL.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=sfe(i[r],e,t,n);return o}};OL.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return sfe(i,e,t,n,o)}};var O_=OL;function eXe(e){let t=e.length,n=new Float64Array(t*3),i=Fe.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let l=e[a];n[o++]=l.x,n[o++]=l.y,n[o++]=l.z,i[r++]=a,i[r++]=(a+1)%t}let s=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:n})});return new ct({attributes:s,indices:i,primitiveType:Me.LINES})}function Gx(e){e=e??W.EMPTY_OBJECT;let t=e.polygonHierarchy;T.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,d)+1}Gx.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions}};return new Gx(t)};Gx.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var tXe={polygonHierarchy:{}};Gx.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return c(n)||(n=new Gx(tXe)),n._polygonHierarchy=i,n.packedLength=o,n};Gx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,d.equalsEpsilon,!0),n.length<3||!O_.validOutline(n))return;let o=zn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let l=0;l<o.length;l++){let u=new St({geometry:eXe(o[l])});r.push(u)}let s=Nn.combineInstances(r)[0],a=le.fromPoints(t.positions);return new ct({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var $f=Gx;var Wz=new he;function RL(e){T.typeOf.object("options",e),T.typeOf.string("options.token",e.token);let t=Qp.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ie.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=uXe(t,n,i,o);this._boundingPlanes=r;let s=mXe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=nq(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=d.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=nq(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=nq(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 l=t.getCenter();Wz=o.cartesianToCartographic(l,Wz),Wz.height=(i+n)/2,this.center=o.cartographicToCartesian(Wz,l),this._boundingSphere=le.fromPoints(s)}var nXe=new d,iXe=new he,oXe=new d,rXe=new he,sXe=new d,aXe=new d,cXe=new d,lXe=new d;function uXe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,nXe),a=i.cartesianToCartographic(r,iXe);a.height=n;let l=i.cartographicToCartesian(a,oXe),u=sn.fromPointNormal(l,s);o[0]=u;let f=0,h,p=[],g,m;for(h=0;h<4;h++){g=e.getVertex(h),p[h]=g,m=i.cartesianToCartographic(g,rXe),m.height=t;let b=sn.getPointDistance(u,i.cartographicToCartesian(m,sXe));b<f&&(f=b)}let y=sn.clone(u);for(y.normal=d.negate(y.normal,y.normal),y.distance=y.distance*-1+f,o[1]=y,h=0;h<4;h++){g=p[h];let b=p[(h+1)%4],x=i.geodeticSurfaceNormal(g,aXe),A=d.subtract(b,g,lXe),C=d.cross(A,x,cXe);C=d.normalize(C,C),o[2+h]=sn.fromPointNormal(g,C)}return o}var jx=new d,Wx=new d,qx=new d,KW=new d,$W=new d,ZW=new d,fXe=new d,dXe=new d,hXe=new d,QW=new d,JW=new d,eq=new d,Gy=new d,Lm=new J;function afe(e,t,n){jx=e.normal,Wx=t.normal,qx=n.normal,KW=d.multiplyByScalar(e.normal,-e.distance,KW),$W=d.multiplyByScalar(t.normal,-t.distance,$W),ZW=d.multiplyByScalar(n.normal,-n.distance,ZW),QW=d.multiplyByScalar(d.cross(Wx,qx,fXe),d.dot(KW,jx),QW),JW=d.multiplyByScalar(d.cross(qx,jx,dXe),d.dot($W,Wx),JW),eq=d.multiplyByScalar(d.cross(jx,Wx,hXe),d.dot(ZW,qx),eq),Lm[0]=jx.x,Lm[1]=Wx.x,Lm[2]=qx.x,Lm[3]=jx.y,Lm[4]=Wx.y,Lm[5]=qx.y,Lm[6]=jx.z,Lm[7]=Wx.z,Lm[8]=qx.z;let i=J.determinant(Lm);return Gy=d.add(QW,JW,Gy),Gy=d.add(Gy,eq,Gy),new d(Gy.x/i,Gy.y/i,Gy.z/i)}function mXe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=afe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=afe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var tq=new d,IE=new d;function nq(e,t){let n=[];for(let i=0;i<4;i++)tq=d.subtract(t[(i+1)%4],t[i],tq),IE=d.cross(e.normal,tq,IE),IE=d.normalize(IE,IE),n[i]=d.clone(IE);return n}Object.defineProperties(RL.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var iq=new d;RL.prototype.distanceToCamera=function(e){T.defined("frameState",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,l;if(n.length===1)return l=this._boundingPlanes[n[0]],a=oq(sn.projectPointOntoPlane(l,t,iq),i[0],l,o),d.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=cfe(t,p[0],p[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)l=this._boundingPlanes[n[r]],a=oq(sn.projectPointOntoPlane(l,t,iq),i[r],l,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return a=oq(sn.projectPointOntoPlane(this._boundingPlanes[1],t,iq),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var pXe=new d,_Xe=new d;function cfe(e,t,n){let i=d.subtract(n,t,pXe),o=d.subtract(e,t,_Xe),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var gXe=new sn(d.UNIT_X,0);function oq(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let l=0;l<t.length;l++){let u=sn.fromPointNormal(t[l],i[l],gXe);sn.getPointDistance(u,e)<0||(a=cfe(e,t[l],t[(l+1)%4]),r=d.distance(e,a),r<o&&(o=r,s=a))}return c(s)?s:e}RL.prototype.intersectPlane=function(e){T.defined("plane",e);let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Wt.INSIDE:n===this._vertices.length?Wt.OUTSIDE:Wt.INTERSECTING};RL.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new B.clone(B.IDENTITY),n=new $f({polygonHierarchy:{positions:this._planeVertices[0]}}),i=$f.createGeometry(n),o=new St({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}}),r=new $f({polygonHierarchy:{positions:this._planeVertices[1]}}),s=$f.createGeometry(r),a=new St({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}}),l=[];for(let u=0;u<4;u++){let f=new $f({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=$f.createGeometry(f);l[u]=new St({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Gt.fromColor(e)}})}return new Pn({geometryInstances:[l[0],l[1],l[2],l[3],a,o],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var ML=RL;var yXe=new d(1,1,1),qz=Math.cos,Yz=Math.sin;function OE(e){e=e??W.EMPTY_OBJECT;let t=e.radii??yXe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??O.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??O.PI,a=Math.round(e.stackPartitions??10),l=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);if(a<1)throw new E("options.stackPartitions cannot be less than 1");if(l<0)throw new E("options.slicePartitions cannot be less than 0");if(u<0)throw new E("options.subdivisions must be greater than or equal to zero.");if(c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}OE.packedLength=2*d.packedLength+8;OE.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.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]=e._offsetAttribute??-1,t};var lfe=new d,ufe=new d,R_={radii:lfe,innerRadii:ufe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};OE.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i=d.unpack(e,t,lfe);t+=d.packedLength;let o=d.unpack(e,t,ufe);t+=d.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=l,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(R_.minimumClock=r,R_.maximumClock=s,R_.minimumCone=a,R_.maximumCone=l,R_.stackPartitions=u,R_.slicePartitions=f,R_.subdivisions=h,R_.offsetAttribute=p===-1?void 0:p,new OE(R_))};OE.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,l=ie.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/O.TWO_PI),f=Math.round(f*Math.abs(s-r)/O.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,r>0&&(m=!0,h+=u),s<Math.PI&&(y=!0,h+=u));let b=a*p*(f+u),x=new Float64Array(b*3),A=2*(b+h-(u+f)*p),C=Fe.createTypedArray(b,A),S,v,P,M,R=0,L=new Array(f),F=new Array(f);for(S=0;S<f;S++)M=r+S*(s-r)/(f-1),L[S]=Yz(M),F[S]=qz(M);let _=new Array(a),w=new Array(a);for(S=0;S<a;S++)P=i+S*(o-i)/(a-1),_[S]=Yz(P),w[S]=qz(P);for(S=0;S<f;S++)for(v=0;v<a;v++)x[R++]=t.x*L[S]*w[v],x[R++]=t.y*L[S]*_[v],x[R++]=t.z*F[S];if(g)for(S=0;S<f;S++)for(v=0;v<a;v++)x[R++]=n.x*L[S]*w[v],x[R++]=n.y*L[S]*_[v],x[R++]=n.z*F[S];for(L.length=a,F.length=a,S=0;S<a;S++)M=r+S*(s-r)/(a-1),L[S]=Yz(M),F[S]=qz(M);for(_.length=u,w.length=u,S=0;S<u;S++)P=i+S*(o-i)/(u-1),_[S]=Yz(P),w[S]=qz(P);for(S=0;S<a;S++)for(v=0;v<u;v++)x[R++]=t.x*L[S]*w[v],x[R++]=t.y*L[S]*_[v],x[R++]=t.z*F[S];if(g)for(S=0;S<a;S++)for(v=0;v<u;v++)x[R++]=n.x*L[S]*w[v],x[R++]=n.y*L[S]*_[v],x[R++]=n.z*F[S];for(R=0,S=0;S<f*p;S++){let N=S*a;for(v=0;v<a-1;v++)C[R++]=N+v,C[R++]=N+v+1}let D=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)C[R++]=D+S+v*u,C[R++]=D+S+(v+1)*u;if(g)for(D=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)C[R++]=D+S+v*u,C[R++]=D+S+(v+1)*u;if(g){let N=f*a*p,k=N+a*u;if(m)for(S=0;S<u;S++)C[R++]=N+S,C[R++]=k+S;if(y)for(N+=a*u-u,k+=a*u-u,S=0;S<u;S++)C[R++]=N+S,C[R++]=k+S}let I=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:x})});if(c(e._offsetAttribute)){let N=x.length,k=e._offsetAttribute===Zt.NONE?0:1,z=new Uint8Array(N/3).fill(k);I.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}return new ct({attributes:I,indices:C,primitiveType:Me.LINES,boundingSphere:le.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})};var Nu=OE;function RE(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Nu(i),this._workerName="createSphereOutlineGeometry"}RE.packedLength=Nu.packedLength;RE.pack=function(e,t,n){return T.typeOf.object("value",e),Nu.pack(e._ellipsoidGeometry,t,n)};var bXe=new Nu,Yx={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};RE.unpack=function(e,t,n){let i=Nu.unpack(e,t,bXe);return Yx.stackPartitions=i._stackPartitions,Yx.slicePartitions=i._slicePartitions,Yx.subdivisions=i._subdivisions,c(n)?(d.clone(i._radii,Yx.radii),n._ellipsoidGeometry=new Nu(Yx),n):(Yx.radius=i._radii.x,new RE(Yx))};RE.createGeometry=function(e){return Nu.createGeometry(e._ellipsoidGeometry)};var M_=RE;function ME(e,t){t===0&&(t=O.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(ME.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}}});ME.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};ME.prototype.intersectPlane=function(e){return T.defined("plane",e),le.intersectPlane(this._boundingSphere,e)};ME.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};ME.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new M_({radius:this.radius}),n=B.fromTranslation(this.center,new B.clone(B.IDENTITY)),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Gt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var L_=ME;var xXe=new d,TXe=new d,AXe=new d,CXe=new d;function Xx(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,O.EPSILON7/i,n)}function rq(e,t){let n=d.normalize(e,CXe),i=d.equalsEpsilon(n,d.UNIT_X,O.EPSILON6)?d.UNIT_Y:d.UNIT_X;return Xx(e,i,t)}function ffe(e){let t=J.getColumn(e,0,xXe),n=J.getColumn(e,1,TXe),i=J.getColumn(e,2,AXe),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),s=d.equals(i,d.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=O.EPSILON7,e[4]=O.EPSILON7,e[8]=O.EPSILON7,e):(o&&!r&&!s?t=Xx(n,i,t):!o&&r&&!s?n=Xx(t,i,n):!o&&!r&&s?i=Xx(n,t,i):o?r?s||(t=rq(i,t),n=Xx(i,t,n)):(t=rq(n,t),i=Xx(n,t,i)):(n=rq(t,n),i=Xx(n,t,i)),J.setColumn(e,0,t,e),J.setColumn(e,1,n,e),J.setColumn(e,2,i,e),e)}function LE(e,t){t=ffe(t),this._orientedBoundingBox=new Dn(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(LE.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});LE.prototype.distanceToCamera=function(e){return T.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};LE.prototype.intersectPlane=function(e){return T.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};LE.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=ffe(t),J.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};LE.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new Ud({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=B.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Gt.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var Yl=LE;function ar(e,t,n,i){this._tileset=e,this._header=n;let o=c(n.contents),r=o&&n.contents.length>1||oi(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=c(n.transform)?B.unpack(n.transform):B.clone(B.IDENTITY);let a=c(i)?i.computedTransform:e.modelMatrix,l=B.multiply(a,this.transform,new B),u=c(i)?i._initialTransform:B.IDENTITY;this._initialTransform=B.multiply(u,this.transform,new B),this.computedTransform=l,this.metadata=DL(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,l),this._boundingVolume2D=void 0;let f;c(s)&&c(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,l)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;c(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,l)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,c(this._geometricError)||(this._geometricError=c(i)?i._geometricError:e._geometricError,ar._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;c(n.refine)?((n.refine==="replace"||n.refine==="add")&&ar._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?qo.REPLACE:qo.ADD):c(i)?p=i.refine:p=qo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,b,x;if(t=we.createIfNeeded(t),r)y=Xo.UNLOADED,b=t.clone();else if(c(s)){let v=s.uri;c(s.url)&&(ar._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(ar._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 SE(e,this),m=!0,y=Xo.READY):(y=Xo.UNLOADED,b=t.getDerivedResource({url:v}),x=sc.getServerKey(b.getUrlComponent()))}else g=new SE(e,this),m=!0,y=Xo.READY;this._content=g,this._contentResource=b,this._contentState=y,this._expiredContent=void 0,this._serverKey=x,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let A=n.expire,C,S;c(A)&&(C=A.duration,c(A.date)&&(S=Q.fromIso8601(A.date))),this.expireDuration=C,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=qf.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=G.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}ar._deprecationWarning=ws;Object.defineProperties(ar.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 c(this._color)||(this._color=new G),G.clone(this._color)},set:function(e){this._color=G.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||c(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Xo.READY}},contentUnloaded:{get:function(){return this._contentState===Xo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Xo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Xo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var jy=new d;function EXe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,jy),l=d.add(s.positionWC,a,jy),u=d.subtract(l,r,jy);if(d.magnitude(u)>o){let S=d.normalize(u,jy),v=d.multiplyByScalar(S,o,jy),P=d.add(r,v,jy),M=d.subtract(P,s.positionWC,jy),R=d.normalize(M,jy);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===qo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Uo.PRELOAD_FLIGHT||n._pass===Uo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let b=m-y,x=O.clamp((e._foveatedFactor-y)/b,0,1),A=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,x),C=e._screenSpaceError===0&&c(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-A<=C}var _fe=new Q;ar.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=c(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:l}=e,u=a.frustum,f=l.drawingBufferWidth,h=l.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof on){let g=u.offCenterFrustum;c(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=s/m}else{let g=Math.max(this._distanceToCamera,O.EPSILON7),m=u.sseDenominator;if(p=s*h/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,x=O.fog(g,y)*b;p-=x}}return p/=e.pixelRatio,p};function SXe(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=c(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function wXe(e,t){let n=t.parent,o=c(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}ar.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=c(t)?t.computedTransform:n.modelMatrix,o=c(t)?t._visibilityPlaneMask:_s.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!==_s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=wXe(n,this),this._priorityProgressiveResolution=SXe(n,this),this.priorityDeferred=EXe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ar.prototype.updateExpiration=function(){if(c(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(_fe);Q.lessThan(this.expireDate,e)&&(this._contentState=Xo.EXPIRED,this._expiredContent=this._content)}};function vXe(e){if(!c(e.expireDuration))return;let t=Q.now(_fe);Q.addSeconds(t,e.expireDuration,t),c(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function DXe(e){return function(){return e._priority}}ar.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?PXe(this):OXe(this)};function PXe(e){let t=e._content,n=e._tileset;if(!c(t)){let o=oi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new PL(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(c(i))return e._contentState=Xo.LOADING,i.then(o=>{if(!e.isDestroyed()&&c(o))return e._contentState=Xo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Xo.FAILED,o})}async function IXe(e,t,n,i,o){let r=e._contentState;e._contentState=Xo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Xo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===$n.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await RXe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Xo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Xo.FAILED,a}}function OXe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Qo({throttle:!0,throttleByServer:!0,type:ms.TILES3D,priorityFunction:DXe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!c(r)){++o.statistics.numberOfAttemptedRequests;return}return IXe(e,o,i,n,r)}async function RXe(e,t){let n=I_(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ps.GEOMETRY||n.contentType===Ps.VECTOR,(n.contentType===Ps.IMPLICIT_SUBTREE||n.contentType===Ps.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Ps.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=Ux[n.contentType];if(e.isDestroyed())return;c(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 l=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=l.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=Vx(i,s));let a=zx(i,s);return c(a)&&(o.group=new tx({metadata:a})),o}ar.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ar.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Xo.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 gfe=new le;function aq(e,t){if(t.mode!==oe.SCENE3D&&!c(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,gfe);e._boundingVolume2D=new L_(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function MXe(e,t){if(t.mode!==oe.SCENE3D&&!c(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,gfe);e._contentBoundingVolume2D=new L_(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ar.prototype.visibility=function(e,t){let n=e.cullingVolume,i=aq(this,e),o=this._tileset,r=o.clippingPlanes;if(c(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Wt.INSIDE,a===Wt.OUTSIDE)return _s.MASK_OUTSIDE}let s=o.clippingPolygons;if(c(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Wt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};ar.prototype.contentVisibility=function(e){if(!c(this._contentBoundingVolume))return Wt.INSIDE;if(this._visibilityPlaneMask===_s.MASK_INSIDE)return Wt.INSIDE;let t=e.cullingVolume,n=MXe(this,e),i=this._tileset,o=i.clippingPlanes;if(c(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Wt.INSIDE,s===Wt.OUTSIDE)return Wt.OUTSIDE}let r=i.clippingPolygons;if(c(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Wt.OUTSIDE,s===Wt.INSIDE)return Wt.OUTSIDE}return t.computeVisibility(n)};ar.prototype.distanceToTile=function(e){return aq(this,e).distanceToCamera(e)};var LXe=new d;ar.prototype.distanceToTileCenter=function(e){let n=aq(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,LXe);return d.dot(e.camera.directionWC,i)};ar.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!c(t)||t.distanceToCamera(e)===0};var yfe=new J,bfe=new d,NXe=new J,cq=new d,xfe=new ce,Tfe=new Dn,sq=new B;function FXe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],cq),o=J.fromArray(e,3,NXe);i=B.multiplyByPoint(t,i,i);let r=B.getMatrix3(t,yfe);return o=J.multiply(r,o,o),c(n)?(n.update(i,o),n):new Yl(i,o)}function dfe(e,t,n,i){let o=ce.unpack(e,0,xfe),r=e[4],s=e[5],a=Dn.fromRectangle(o,r,s,ie.WGS84,Tfe),l=a.center,u=a.halfAxes;t=B.multiplyTransformation(t,B.inverseTransformation(n,sq),sq),l=B.multiplyByPoint(t,l,l);let f=B.getMatrix3(t,yfe);return u=J.multiply(f,u,u),c(i)&&i instanceof Yl?(i.update(l,u),i):new Yl(l,u)}function BXe(e,t,n,i){if(!B.equalsEpsilon(t,n,O.EPSILON8))return i instanceof Yl?dfe(e,t,n,i):dfe(e,t,n,void 0);let o=ce.unpack(e,0,xfe);return i instanceof Lu?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ie.WGS84),i):new Lu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function kXe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],cq),o=e[3];i=B.multiplyByPoint(t,i,i);let r=B.getScale(t,bfe),s=d.maximumComponent(r);return o*=s,c(n)?(n.update(i,o),n):new L_(i,o)}ar.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(c(i)&&(o=bx.parseBoundingVolumeSemantic("TILE",i)),c(o)&&(e=o),!c(e))throw new ae("boundingVolume must be defined");if(oi(e,"3DTILES_bounding_volume_S2"))return new ML(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(c(r)){let l=FXe(r,t,n);return this._verticalExaggeration!==1&&hfe(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l}if(c(s)){let l=BXe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(l instanceof Yl?hfe(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(l.minimumHeight=Dr.getHeight(l.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.maximumHeight=Dr.getHeight(l.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.computeBoundingVolumes(ie.WGS84))),l}if(c(a)){let l=kXe(a,t,n);if(this._verticalExaggeration!==1){let u=Dr.getPosition(l.center,ie.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,cq),f=l.radius*this._verticalExaggeration;l.update(u,f)}return l}throw new ae("boundingVolume must contain a sphere, region, or box")};var UXe=d.unpackArray(new Array(8*3).fill(0));function hfe(e,t,n){let i=e.boundingVolume.computeCorners(UXe).map(r=>Dr.getPosition(r,ie.WGS84,t,n,r)),o=Dn.fromPoints(i,Tfe);e.update(o.center,o.halfAxes)}ar.prototype.updateTransform=function(e,t){e=e??B.IDENTITY;let n=B.multiplyTransformation(e,this.transform,sq),i=!B.equals(n,this.computedTransform),o=c(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&B.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),c(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),c(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()};ar.prototype.updateGeometricErrorScale=function(){let e=B.getScale(this.computedTransform,bfe),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!c(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function VXe(e,t,n,i){if(!i.isRender)return;let o=c(e._contentHeader)&&c(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let l;e._finalResolution?e.hasRenderableContent?l=G.WHITE:l=G.DARKGRAY:l=G.YELLOW,c(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(l)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Gt.toValue(l,u.color)}else!r&&c(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(c(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(G.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&c(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&c(e._viewerRequestVolume)?(c(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(G.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&c(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||c(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=G.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function zXe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&c(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(c(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Xo.FAILED,o}}function HXe(e,t){let n=t.clippingPlanes,i=0;c(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function GXe(e,t){let n=t.clippingPolygons,i=0;c(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}ar.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;HXe(this,e),GXe(this,e),VXe(this,e,t,n),zXe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],l=a.pass===De.TRANSLUCENT;a.depthForTranslucentClassification=l}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var mfe=[];ar.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(vXe(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=Xo.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=mfe;try{this._content.update(e,t)}catch(i){throw this._contentState=Xo.FAILED,i}mfe.length=0,t.commandList=n};function pfe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Xz(e,t,n){return Math.max(O.normalize(e,t,n)-O.EPSILON7,0)}ar.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,l=s+a,u=o,f=l+u,h=r,p=Math.pow(10,f),g=f+h,m=r,y=Math.pow(10,g),b=g+m,x=Math.pow(10,b),A=Xz(this._depth,n.depth,i.depth);A=t?1-A:A;let S=!e.isSkippingLevelOfDetail&&this.refine===qo.REPLACE?Xz(this._priorityHolder._distanceToCamera,n.distance,i.distance):Xz(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=pfe(S,a,s),P=this._priorityProgressiveResolution?0:p,M=Xz(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=pfe(M,u,l),L=this.priorityDeferred?y:0,F=e._pass===Uo.PRELOAD_FLIGHT?0:x;this._priority=A+v+P+R+L+F};ar.prototype.isDestroyed=function(){return!1};ar.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(),de(this)};var Zf=ar;function N_(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class;T.typeOf.object("options.group",n),T.typeOf.object("options.class",i);let o=c(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(N_.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}}});N_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};N_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};N_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};N_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};N_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};N_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};N_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var NE=N_;function F_(e){e=e??W.EMPTY_OBJECT;let t=e.tileset,n=e.class;T.typeOf.object("options.tileset",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(F_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});F_.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};F_.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};F_.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};F_.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};F_.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};F_.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};F_.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var LL=F_;function Afe(e){e=e??W.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema;T.typeOf.object("options.metadataJson",t),T.typeOf.object("options.schema",n);let i=t.metadata??t.tileset,o;c(i)&&(o=new LL({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let l=a.length;for(let u=0;u<l;u++){let f=a[u];s.push(new NE({group:f,class:n.classes[f.class]}))}}else if(c(a)){r=Object.keys(a).sort();let l=r.length;for(let u=0;u<l;u++){let f=r[u];if(a.hasOwnProperty(f)){let h=a[f];s.push(new NE({id:f,group:a[f],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(Afe.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 Kx=Afe;var Cfe={},jXe=new d;Cfe.checkChildrenWithinParent=function(e){T.typeOf.object("tile",e);let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Yl||i instanceof Lu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=qf.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Yl||a instanceof Lu)){e._optimChildrenWithinParent=qf.SKIP_OPTIMIZATION;break}let l=a._orientedBoundingBox,u=d.subtract(l.center,o.center,jXe),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(l.halfAxes[0]*u.x)+Math.abs(l.halfAxes[1]*u.y)+Math.abs(l.halfAxes[2]*u.z)+Math.abs(l.halfAxes[3]*u.x)+Math.abs(l.halfAxes[4]*u.y)+Math.abs(l.halfAxes[5]*u.z)+Math.abs(l.halfAxes[6]*u.x)+Math.abs(l.halfAxes[7]*u.y)+Math.abs(l.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=qf.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===qf.USE_OPTIMIZATION};var NL=Cfe;function FL(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(FL.prototype,{length:{get:function(){return this._length}}});function WXe(e,t,n){this.item=e,this.previous=t,this.next=n}FL.prototype.add=function(e){let t=new WXe(e,this.tail,void 0);return c(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Efe(e,t){c(t.previous)&&c(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):c(t.previous)?(t.previous.next=void 0,e.tail=t.previous):c(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}FL.prototype.remove=function(e){c(e)&&(Efe(this,e),--this._length)};FL.prototype.splice=function(e,t){if(e===t)return;Efe(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 BL=FL;function $x(){this._list=new BL,this._sentinel=this._list.add(),this._trimTiles=!1}$x.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};$x.prototype.touch=function(e){let t=e.cacheNode;c(t)&&this._list.splice(this._sentinel,t)};$x.prototype.add=function(e){c(e.cacheNode)||(e.cacheNode=this._list.add(e))};$x.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;c(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};$x.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)}};$x.prototype.trim=function(){this._trimTiles=!0};var kL=$x;function Kz(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 uq(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}Kz.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=uq(e,n),this._referenceMaximum[n]=uq(t,n)};function qXe(e,t){let n=e.tilePropertyName;if(c(n)){let i=uq(t[n],n);return c(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var lq=[new G(.1,.1,.1,1),new G(.153,.278,.878,1),new G(.827,.231,.49,1),new G(.827,.188,.22,1),new G(1,.592,.259,1),new G(1,.843,0,1)];Kz.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!c(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=qXe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+O.EPSILON7,l=O.clamp(i-o,0,s)/s,u=lq.length-1,f=l*u,h=Math.floor(f),p=Math.ceil(f),g=f-h,m=lq[h],y=lq[p],b=G.clone(G.WHITE);b.red=O.lerp(m.red,y.red,g),b.green=O.lerp(m.green,y.green,g),b.blue=O.lerp(m.blue,y.blue,g),e._debugColor=b};Kz.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(c(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=c(t)&&c(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var UL=Kz;function FE(){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}FE.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};FE.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};FE.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Ou))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};FE.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Ou))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};FE.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 gh=FE;function VL(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(VL.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});VL.prototype.makeDirty=function(){this._styleDirty=!0};VL.prototype.resetDirty=function(){this._styleDirty=!1};VL.prototype.applyStyle=function(e){if(!c(e.root)||c(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 l=a.content;a.lastStyleTime=n,l.applyStyle(this._style),i.numberOfFeaturesStyled+=l.featuresLength,++i.numberOfTilesStyled}}};var zL=VL;function YXe(e,t,n){let i=oi(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;T.typeOf.object("implicitTiling",i),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!c(o.box)&&!c(o.region)&&!oi(o,"3DTILES_bounding_volume_S2")&&!oi(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 we({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=XXe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(je(a,!0));let l=new we({url:a.uri});this.contentUriTemplates.push(l)}this.contentCount=this.contentHeaders.length,this.tileHeader=KXe(t),this.subdivisionScheme=or[i.subdivisionScheme],this.branchingFactor=or.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,c(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function XXe(e){if(oi(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return c(t.contents)?t.contents:t.content}return c(e.contents)?e.contents:c(e.content)?[e.content]:[]}function KXe(e){let t=je(e,!0);return c(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 Zx=YXe;var HL={};function Sfe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function fq(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function wfe(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 dq(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}HL.encode2D=function(e,t){if(T.typeOf.number("x",e),T.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new E("inputs must be 16-bit unsigned integers");return(Sfe(e)|Sfe(t)<<1)>>>0};HL.decode2D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new E("input must be a 32-bit unsigned integer");return c(t)||(t=new Array(2)),t[0]=wfe(e),t[1]=wfe(e>>1),t};HL.encode3D=function(e,t,n){if(T.typeOf.number("x",e),T.typeOf.number("y",t),T.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new E("inputs must be 10-bit unsigned integers");return fq(e)|fq(t)<<1|fq(n)<<2};HL.decode3D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new E("input must be a 30-bit unsigned integer");return c(t)||(t=new Array(3)),t[0]=dq(e),t[1]=dq(e>>1),t[2]=dq(e>>2),t};var Wy=HL;function Ko(e){if(T.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),T.typeOf.number("options.subtreeLevels",e.subtreeLevels),T.typeOf.number("options.level",e.level),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),e.subdivisionScheme===or.OCTREE&&T.typeOf.number("options.z",e.z),e.level<0)throw new E("level must be non-negative");if(e.x<0)throw new E("x must be non-negative");if(e.y<0)throw new E("y must be non-negative");if(e.subdivisionScheme===or.OCTREE&&e.z<0)throw new E("z must be non-negative");let t=1<<e.level;if(e.x>=t)throw new E("x is out of range");if(e.y>=t)throw new E("y is out of range");if(e.subdivisionScheme===or.OCTREE&&e.z>=t)throw new E("z is out of range");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===or.OCTREE&&(this.z=e.z)}Object.defineProperties(Ko.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===or.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===or.OCTREE?Wy.encode3D(this.x,this.y,this.z):Wy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===or.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});function hq(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new E("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new E("coordinates must have same subtreeLevels")}Ko.prototype.getDescendantCoordinates=function(e){T.typeOf.object("offsetCoordinates",e),hq(this,e);let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===or.OCTREE){let o=(this.z<<e.level)+e.z;return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Ko.prototype.getAncestorCoordinates=function(e){if(T.typeOf.number("offsetLevels",e),e<0)throw new E("offsetLevels must be non-negative");if(e>this.level)throw new E("ancestor cannot be above the tileset root");let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===or.OCTREE){let r=Math.floor(this.z/t);return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Ko.prototype.getOffsetCoordinates=function(e){if(T.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new E("this is not an ancestor of descendant");hq(this,e);let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===or.OCTREE){let r=e.z%n;return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Ko.prototype.getChildCoordinates=function(e){T.typeOf.number("childIndex",e);let t=or.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new E(`childIndex must be at least 0 and less than ${t}`);let n=this.level+1,i=2*this.x+e%2,o=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===or.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Ko({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Ko.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Ko.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Ko.prototype.isAncestor=function(e){T.typeOf.object("descendantCoordinates",e),hq(this,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===or.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Ko.prototype.isEqual=function(e){return T.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===or.OCTREE?this.z===e.z:!0)};Ko.prototype.isImplicitTilesetRoot=function(){return this.level===0};Ko.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Ko.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Ko.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===or.OCTREE&&(e.z=this.z),e};var vfe=[0,0,0];Ko.fromMortonIndex=function(e,t,n,i){let o;return e===or.OCTREE?(o=Wy.decode3D(i,vfe),new Ko({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Wy.decode2D(i,vfe),new Ko({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Ko.fromTileIndex=function(e,t,n){let i,o,r;return e===or.OCTREE?(i=Math.floor(O.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(O.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Ko.fromMortonIndex(e,t,i,r)};var Qx=Ko;function B_(){}B_.selectTiles=function(e,t){E.throwInstantiationError()};B_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};B_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};B_.selectTile=function(e,t){if(e.contentVisibility(t)===Wt.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)};B_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};B_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};B_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!$Xe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function $Xe(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}B_.updateTile=function(e,t){Dfe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,JXe(e),e._shouldSelect=!1,e._finalResolution=!0};function Dfe(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];Dfe(r,t),e._visible=r._visible;return}if(ZXe(e,t)){e._visible=!1;return}let i=e.refine===qo.REPLACE,o=e._optimChildrenWithinParent===qf.USE_OPTIMIZATION;if(i&&o&&n&&!QXe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function ZXe(e,t){let{parent:n,tileset:i}=e;return!c(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==qo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function QXe(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 JXe(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 Zs=B_;function Pfe(){}var GL={stack:new Jc,stackMaximumLength:0};Pfe.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}=Zs,s=GL.stack;for(s.push(i);s.length>0;){GL.stackMaximumLength=Math.max(GL.stackMaximumLength,s.length);let a=s.pop(),l=a.refine===qo.ADD,u=a.refine===qo.REPLACE,f=eKe(a);f&&tKe(a,s,t),(l||u&&!f)&&(nKe(e,a),o(a,t),iKe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return GL.stack.trim(GL.stackMaximumLength),n};function eKe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function tKe(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 nKe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function iKe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Wt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var jL=Pfe;function Ife(){}var WL={stack:new Jc,stackMaximumLength:0},qL={stack:new Jc,stackMaximumLength:0};Ife.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(Zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;rKe(n,t),WL.stack.trim(WL.stackMaximumLength),qL.stack.trim(qL.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function mq(e,t){e.contentAvailable&&Zs.selectTile(e,t)}function oKe(e,t,n){let i=e.refine===qo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:l}=Zs;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(Zs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let y=r[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),h=!0):(u||o.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),l(y,n)),u){let b;y._inRequestVolume?y.hasRenderableContent?b=y.contentAvailable:b=sKe(y,n):b=!1,f=f&&b}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=y}return f}function rKe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Zs,a=WL.stack;for(a.push(e);a.length>0;){WL.stackMaximumLength=Math.max(WL.stackMaximumLength,a.length);let l=a.pop(),u=l.parent,f=!c(u)||u._refines;l._refines=i(l)?oKe(l,a,t)&&f:!1;let h=!l._refines&&f;l.hasRenderableContent?l.refine===qo.ADD?(mq(l,t),o(l,t)):l.refine===qo.REPLACE&&(o(l,t),h&&mq(l,t)):(n._emptyTiles.push(l),o(l,t),h&&mq(l,t)),r(l,t),s(l,t)}}function sKe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Zs,s=!0,a=qL.stack;for(a.push(e);a.length>0;){qL.stackMaximumLength=Math.max(qL.stackMaximumLength,a.length);let l=a.pop(),u=l.children,f=u.length,h=!l.hasRenderableContent&&n(l);if(!h&&!l.contentAvailable&&(s=!1),i(l,t),l.isVisible||(o(l,t),r(l,t)),h)for(let p=0;p<f;++p){let g=u[p];a.push(g)}}return e.hasEmptyContent||s}var YL=Ife;function Ofe(){}var XL={stack:new Jc,stackMaximumLength:0},KL={stack:new Jc,stackMaximumLength:0},k_={stack:new Jc,stackMaximumLength:0,ancestorStack:new Jc,ancestorStackMaximumLength:0},aKe=2;Ofe.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(Zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;hKe(n,t),mKe(n,t),XL.stack.trim(XL.stackMaximumLength),KL.stack.trim(KL.stackMaximumLength),k_.stack.trim(k_.stackMaximumLength),k_.ancestorStack.trim(k_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function cKe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Zs,r=KL.stack;for(r.push(e);r.length>0;){KL.stackMaximumLength=Math.max(KL.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;l<a.length;++l){let u=a[l];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<aKe&&r.push(u))}}}function $z(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;c(n)?n._shouldSelect=!0:cKe(e,t)}function lKe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!c(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function uKe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||c(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function fKe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Zs;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Zs.sortChildrenByDistanceToCamera);let l=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),l=!0):i.loadSiblings&&(s(f,n),a(f,n))}return l}function dKe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:c(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function hKe(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}=Zs,l=XL.stack;for(l.push(e);l.length>0;){XL.stackMaximumLength=Math.max(XL.stackMaximumLength,l.length);let u=l.pop();lKe(u,t);let f=u.parent,h=!c(f)||f._refines;u._refines=o(u)?fKe(u,l,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===qo.ADD?($z(u,t),r(u,t)):u.refine===qo.REPLACE&&(dKe(u,i)?(r(u,t),p&&$z(u,t)):p?($z(u,t),r(u,t)):uKe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&$z(u,t)),s(u,t),a(u,t)}}function mKe(e,t){let{selectTile:n,canTraverse:i}=Zs,{stack:o,ancestorStack:r}=k_,s;for(o.push(e);o.length>0||r.length>0;){if(k_.stackMaximumLength=Math.max(k_.stackMaximumLength,o.length),k_.ancestorStackMaximumLength=Math.max(k_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!c(a))continue;let l=i(a);if(a._shouldSelect)if(a.refine===qo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!l){n(a,t);continue}r.push(a),a._stackLength=o.length}if(l){let u=a.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var $L=Ofe;function cr(e){e=e??W.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 kL,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Jc,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024,T.typeOf.number.greaterThanOrEquals("cacheBytes",this._cacheBytes,0);let t=e.maximumCacheOverflowBytes??512*1024*1024;T.typeOf.number.greaterThanOrEquals("maximumCacheOverflowBytes",t,0),this._maximumCacheOverflowBytes=t,this._styleEngine=new zL,this._styleApplied=!1,this._modelMatrix=c(e.modelMatrix)?B.clone(e.modelMatrix):B.clone(B.IDENTITY),this._addHeightCallbacks=[],this._statistics=new gh,this._statisticsLast=new gh,this._statisticsPerPass=new Array(Uo.NUMBER_OF_PASSES);for(let o=0;o<Uo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new gh;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 UL(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=O.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=e.ellipsoid??ie.WGS84,this._initialClippingPlanesOriginMatrix=B.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??O.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??xn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Bl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new vm(e.pointCloudShading),this._pointCloudEyeDomeLighting=new f_,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe,this.tileLoad=new pe,this.tileUnload=new pe,this.tileFailed=new pe,this.tileVisible=new pe,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,c(e.clippingPlanes)&&gs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,c(e.clippingPolygons)&&th.setOwner(e.clippingPolygons,this,"_clippingPolygons"),c(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new ex,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new c_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this.splitDirection=e.splitDirection??Vr.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&dt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(cr.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){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){th.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 ws("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){T.typeOf.bool("value",e),this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!c(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){T.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){T.defined("pointCloudShading",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=B.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 c(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(B.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):B.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){T.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),T.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){T.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),T.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",this._imageBasedLighting),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,Ufe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),T.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),T.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}});cr.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await Cu.fromAssetId(e);return cr.fromUrl(n,t)};cr.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await cr.loadJson(n),r=await pKe(n,o),s=new cr(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,Ufe(s);let l=c(o.asset.gltfUpAxis)?Fo.fromName(o.asset.gltfUpAxis):Fo.Y,u=t.modelUpAxis??l,f=t.modelForwardAxis??Fo.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,B.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return c(g)&&g.height>ui._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ot.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=B.clone(s._initialClippingPlanesOriginMatrix),s};cr.loadJson=function(e){return we.createIfNeeded(e).fetchJson()};cr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};cr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!c(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");c(t.extensionsRequired)&&cr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;c(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Rfe(this,e,t.root,n);c(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let l=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===qo.ADD;let u=l._header.children;if(c(u))for(let f=0;f<u.length;++f){let h=u[f],p=Rfe(this,e,h,l);l.children.push(p),p._depth=l._depth+1,a.push(p)}this._cullWithChildrenBounds&&NL.checkChildrenWithinParent(l)}return s};function Rfe(e,t,n,i){if(!(c(n.implicitTiling)||oi(n,"3DTILES_implicit_tiling")))return new Zf(e,t,n,i);let r=e.schema,s=new Zx(t,n,r),a=new Qx({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),l=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=je(n,!0);f.contents=[{uri:l}],delete f.content,delete f.extensions;let h=new Zf(e,t,f,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function pKe(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(c(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=vi.getSchemaLoader({resource:e});else if(c(n.schema))i=vi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new Kx({schema:i.schema,metadataJson:n});return vi.unload(i),o}var Mfe=new d,_Ke=new he,gKe=new B,yKe=new d,bKe=new d,xKe=new d,TKe=new d;function AKe(e,t){let n,i,o,r,s,a=t.camera,l=e._root,u=l.contentBoundingVolume;if(u instanceof Lu)n=d.normalize(a.positionWC,Mfe),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let y=B.inverseTransformation(l.computedTransform,gKe),b=t.mapProjection.ellipsoid,x=u.boundingVolume,A=B.multiplyByPoint(y,x.center,yKe);if(d.magnitude(A)>b.minimumRadius){let C=he.fromCartesian(A,b,_Ke);n=d.normalize(a.positionWC,Mfe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=C.height*2}else{let C=B.multiplyByPoint(y,a.positionWC,bKe);if(n=d.UNIT_Z,i=B.multiplyByPointAsVector(y,a.directionWC,xKe),i=d.normalize(i,i),o=C.z,u instanceof Yl){let S=J.getColumn(x.halfAxes,2,TKe),v=d.magnitude(S);r=A.z-v,s=A.z+v}else if(u instanceof L_){let S=x.radius;r=A.z-S,s=A.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,p=s,g=O.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function CKe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();c(o)&&(o.then(r=>{!c(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{Ffe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?BKe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Nfe(e,t){return e._priority-t._priority}cr.prototype.postPassesUpdate=function(e){c(this._root)&&(EKe(this,e),UKe(this,e),this._cache.unloadTiles(this,kfe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};cr.prototype.prePassesUpdate=function(e){if(!c(this._root))return;OKe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,c(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;c(n)&&n.enabled&&n.update(e),c(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&AKe(this,e),e.newFrame&&this._cache.reset()};function EKe(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!==Xo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function SKe(e){let t=e._requestedTiles;t.sort(Nfe);for(let n=0;n<t.length;++n)CKe(e,t[n])}function Ffe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=c(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 wKe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Xo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var vKe=new he,DKe=new he,PKe=new d;function IKe(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,vKe),l=he.fromCartesian(o.center,s,DKe);c(l)&&(a.height=l.height);let u=he.toCartesian(a,s,PKe);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{c(r.callback)&&r.callback(),r.invoked=!1}))}}function OKe(e,t){wKe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let l=0;l<n.length;++l){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[l];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,Ffe(f,e,u)}}e.totalMemoryUsageInBytes<i?MKe(e):a&&n.length>0&&RKe(e)}function RKe(e){dt("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset. - The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError). - Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Nfe)}function MKe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Zz=new d,LKe={maximumFractionDigits:3};function Lfe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,LKe):Math.round(t).toLocaleString()}function pq(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,Zz);if(c(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(c(n)){let r=d.normalize(i,Zz);r=d.multiplyByScalar(r,.75*n,Zz),o=d.add(r,i,Zz)}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: ${Lfe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${Lfe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +`;function I_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.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 U(Mi._defaultMinTerrainHeight,Mi._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Mi._defaultMinTerrainHeight,Mi._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=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(I_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Q_t(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,r,o,n,a)}function eyt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var tyt=new $n("createVectorTileClampedPolylines"),XA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function nyt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=eyt(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=tyt.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),iyt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function iyt(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=tt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=tt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:XA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:XA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:XA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:XA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:XA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:XA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:XA.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new zn({context:t,attributes:T,indexBuffer:x}),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 Ek=new N,sSe=new h;function ryt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,Ek),N.multiplyByPoint(Ek,e._center,sSe),N.setTranslation(Ek,sSe,Ek),Ek},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function aSe(e){return Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function oyt(e){l(e._rs)||(e._rs=aSe(!1),e._rs3DTiles=aSe(!0))}function syt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(xk),r=n.getFragmentShaderCallback(!1,void 0,!0)(Tk),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[eu,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:XA})}function ayt(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=at.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===ti.TERRAIN||i===ti.BOTH)&&t.commandList.push(n),(i===ti.CESIUM_3D_TILE||i===ti.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}I_.prototype.getPositions=function(e){return uE.getPolylinePositions(this,e)};I_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new sa(e,o)}};I_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function cyt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var lyt=new z,uyt=z.WHITE,fyt=!0;I_.prototype.applyStyle=function(e,t){if(!l(e)){cyt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,lyt):uyt,s.show=l(e.show)?e.show.evaluate(s):fyt}};function dyt(e){return Mi.initialize().then(function(){Q_t(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}I_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=dyt(this).then(nyt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}ryt(this,t),syt(this,t),oyt(this);let n=e.passes;(n.render||n.pick)&&ayt(this,e)};I_.prototype.isDestroyed=function(){return!1};I_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var Ck=I_;var Ste=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,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,_yt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||vte(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||vte(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||vte(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){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(),ue(this)}};function hyt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function myt(e,t){let n,i,r,o,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=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;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Fm=Uint32Array.BYTES_PER_ELEMENT;function pyt(e){return new uE(e)}function gyt(e){return new Ck(e)}function _yt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Fm;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Fm;let s=r.getUint32(n,!0);if(n+=Fm,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Fm,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Fm;let u=r.getUint32(n,!0);n+=Fm;let f=r.getUint32(n,!0);n+=Fm;let d=r.getUint32(n,!0);n+=Fm;let p=r.getUint32(n,!0);n+=Fm;let g=r.getUint32(n,!0);n+=Fm,n+=Fm;let m=Ro(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Ro(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,E=m.POINTS_LENGTH??0,v=x+T+E,S=new Am(e,v,A,b,hyt(e));if(e._batchTable=S,v===0)return;let I=new Em(m,y),R=I.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),L=R[4],_=R[5],C=e._tile.computedTransform,w=I.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(w)?(w=h.unpack(w),N.multiplyByPoint(C,w,w)):(w=ie.center(O),w.height=D.lerp(L,_,.5),w=ee.WGS84.cartographicToCartesian(w));let P=myt(m,y);if(n+=(4-n%4)%4,x>0){I.featuresLength=x;let F=I.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=I.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=F.reduce(function(W,J){return W+J*2},0),j=V.reduce(function(W,J){return W+J},0),k=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,B);n+=p;let q,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(q=I.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=I.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new yk({positions:G,counts:F,indexCounts:V,indices:k,minimumHeight:L,maximumHeight:_,polygonMinimumHeights:q,polygonMaximumHeights:Q,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,batchIds:P.polygons,modelMatrix:C})}let M=e._tileset;if(T>0){I.featuresLength=T;let F=I.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=I.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let q=0;q<T;++q)V[q]=2}let B=F.reduce(function(q,Q){return q+Q*3},0),j=new Uint16Array(t,n,B);n+=g;let k=M.examineVectorLinesFunction;if(l(k)){let q=jM(new Uint16Array(j),O,L,_,ee.WGS84);yyt(q,F,P.polylines,S,e.url,k)}let G=pyt;l(M.classificationType)&&(G=gyt),e._polylines=G({positions:j,widths:V,counts:F,batchIds:P.polylines,minimumHeight:L,maximumHeight:_,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,classificationType:M.classificationType,keepDecodedPositions:M.vectorKeepDecodedPositions})}if(E>0){let F=new Uint16Array(t,n,E*3);e._points=new _k({positions:F,batchIds:P.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:M.heightReference,scene:M.scene})}}function vte(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}}function yyt(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var vk=Ste;var{ERR_CAPACITY:Pxi}=oa.Error,Ayt=new h,GG=class GG extends os{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Ayt)),i}get vertexOffset(){return this._getUint32(GG.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};ut(GG,"Layout",{...os.Layout,POSITION_OFFSET_U32:os.Layout.__BYTE_LENGTH,__BYTE_LENGTH:os.Layout.__BYTE_LENGTH+4});var wte=GG,Vc=wte;var Sk=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +#else +in vec3 position; +#endif +in vec4 pickColor; +in vec4 showPixelSizeColorAlpha; +in vec3 outlineWidthColorAlpha; +out vec4 v_pickColor; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerRadiusFrac; +void main() +{ +float show = showPixelSizeColorAlpha.x; +float pixelSize = showPixelSizeColorAlpha.y; +vec4 color = czm_decodeRGB8(showPixelSizeColorAlpha.z); +float alpha = showPixelSizeColorAlpha.w; +float outlineWidth = outlineWidthColorAlpha.x; +vec4 outlineColor = czm_decodeRGB8(outlineWidthColorAlpha.y); +float outlineAlpha = outlineWidthColorAlpha.z; +float innerRadius = 0.5 * pixelSize * czm_pixelRatio; +float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio; +#ifdef USE_FLOAT64 +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +#endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha * show; +v_outlineColor = outlineColor; +v_outlineColor.a *= outlineAlpha * show; +v_innerRadiusFrac = innerRadius / outerRadius; +gl_PointSize = 2.0 * outerRadius * show; +gl_Position *= show; +} +`;var wk=`in vec4 v_pickColor; +in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerRadiusFrac; +void main() +{ +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +float delta = fwidth(distanceToCenter); +float outerLimit = 0.5; +float innerLimit = 0.5 * v_innerRadiusFrac; +float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter); +float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter); +vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha); +color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha); +if (color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); +} +`;var Ik=class Ik extends Ql{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};ut(Ik,"Layout",{...Ql.Layout,SIZE_U8:Ql.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Ql.Layout.__BYTE_LENGTH+4}),ut(Ik,"DEFAULT_MATERIAL",Object.freeze(new Ik));var Ite=Ik,Bm=Ite;var Pte={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},cSe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},fE=new Vc,km=new Bm,Pk=new z,lSe=new h,Dte=new Sn;function byt(e,t,n){let i=t.context;n=n||{destroy:xyt};let r=e._positionDatatype===Y.DOUBLE,o=r?Pte:cSe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,u=a.positionLow,f=a.pickColor,d=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,fE),fE._dirty&&(r&&(fE.getPosition(lSe),Sn.fromCartesian(lSe,Dte),h.pack(Dte.high,c,y*3),h.pack(Dte.low,u,y*3)),fE.getMaterial(km),z.fromRgba(fE._pickId,Pk),f[y*4]=z.floatToByte(Pk.red),f[y*4+1]=z.floatToByte(Pk.green),f[y*4+2]=z.floatToByte(Pk.blue),f[y*4+3]=z.floatToByte(Pk.alpha),d[y*4]=fE.show?1:0,d[y*4+1]=km.size,d[y*4+2]=cn.encodeRGB8(km.color),d[y*4+3]=km.color.alpha,p[y*3]=km.outlineWidth,p[y*3+1]=cn.encodeRGB8(km.outlineWidth>0?km.outlineColor:km.color),p[y*3+2]=km.outlineWidth>0?km.outlineColor.alpha:km.color.alpha,fE._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in o)if(Object.hasOwn(o,a)){let c=a;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new zn({context:i,attributes:[...r?[{index:Pte.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Pte.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:cSe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Fi.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[Sk],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[wk]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===Fi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function xyt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var Dk=byt;var Rte=class e extends oa{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Vc}_getMaterialClass(){return Bm}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Vc){return super.add(t,n),n._setUint32(Vc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=Dk(this,t,this._renderContext))}},ef=Rte;function Lw(e,t){this._conditionsExpression=Je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Eyt(this,t)}Object.defineProperties(Lw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Tyt(e,t){this.condition=e,this.expression=t}function Eyt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new Tyt(new Zd(a,t),new Zd(c,t)))}e._runtimeConditions=n}Lw.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};Lw.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};Lw.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) + { + return ${f}; + } +`}return o=`${i} ${e} +{ +${o} return ${i}(1.0); +} +`,o};Lw.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 r=t[i];Zn(e,r.condition.getVariables()),Zn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var Rk=Lw;function KA(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._lineWidth=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,Cyt(this,e)}function Cyt(e,t){t=Je(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,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new Zd(r[o],i))}e._meta=n,e._ready=!0}function To(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Zd(String(t));if(typeof t=="string")return new Zd(t,n);if(l(t.conditions))return new Rk(t,n)}else return;return t}function Eo(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(KA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=To(this,e),this._style.show=Eo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=To(this,e),this._style.color=Eo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=To(this,e),this._style.pointSize=Eo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=To(this,e),this._style.pointOutlineColor=Eo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=To(this,e),this._style.pointOutlineWidth=Eo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=To(this,e),this._style.labelColor=Eo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=To(this,e),this._style.labelOutlineColor=Eo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=To(this,e),this._style.labelOutlineWidth=Eo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=To(this,e),this._style.font=Eo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=To(this,e),this._style.labelStyle=Eo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=To(this,e),this._style.labelText=Eo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=To(this,e),this._style.backgroundColor=Eo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=To(this,e),this._style.backgroundPadding=Eo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=To(this,e),this._style.backgroundEnabled=Eo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=To(this,e),this._style.scaleByDistance=Eo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=To(this,e),this._style.translucencyByDistance=Eo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=To(this,e),this._style.distanceDisplayCondition=Eo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=To(this,e),this._style.heightOffset=Eo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=To(this,e),this._style.anchorLineEnabled=Eo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=To(this,e),this._style.anchorLineColor=Eo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=To(this,e),this._style.image=Eo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=To(this,e),this._style.disableDepthTestDistance=Eo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=To(this,e),this._style.horizontalOrigin=Eo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=To(this,e),this._style.verticalOrigin=Eo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=To(this,e),this._style.labelHorizontalOrigin=Eo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=To(this,e),this._style.labelVerticalOrigin=Eo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=To(this,e),this._style.lineWidth=Eo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});KA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new KA(n)})};KA.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)};KA.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)};KA.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)};KA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Zn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Zn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Zn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var P_=KA;var uSe=new Vc,fSe=new xa,dSe=new No,vyt=new Bm,Syt=new kf,wyt=new Bf,Ote=class{constructor(t,n,i=0){ut(this,"_color",new z);ut(this,"_outlineColor",new z);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return z.clone(t.color,this._color);return z.clone(z.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())z.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())z.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())z.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())z.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return sa.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(ef,uSe),yield*this._iteratePrimitivesWith(ul,fSe),yield*this._iteratePrimitivesWith(za,dSe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],s=this._primitivesByCollection.get(r);if(s&&o instanceof t)for(let a of s)o.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(ef,uSe,vyt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ul,fSe,Syt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(za,dSe,wyt)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},dE=Ote;var hSe=new h,Iyt=new Vc,Pyt=new xa,pSe=new No;function Dyt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)gSe(e,n[r],N.IDENTITY,i);return i}function WG(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function Ryt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?Ea.readIndicesAsTypedArray(e.indices):void 0;if(r===Oe.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(r===Oe.LINE_STRIP){let c=n?n.count:mSe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(r===Oe.TRIANGLES||r===Oe.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=mSe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function mSe(e){let t=WG(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Oyt(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?Ea.readAttributeAsRawCompactTypedArray(o):Ea.readAttributeAsTypedArray(o)),a=t.indices?Ea.readIndicesAsTypedArray(t.indices):void 0,c=Myt(e,t,r);n instanceof ef?Nyt(n,i,s,a,c):n instanceof ul?Lyt(n,i,s,a,c):n instanceof za&&(l(t.vector)?Fyt(n,i,s,a,c,t.vector):Byt(n,i,s,c,t.polygon))}function Myt(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof En.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??Ea.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new dE(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function Nyt(e,t,n,i,r){let o=n.length/3;for(let s=0,a=i?i.length:o;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,hSe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:hSe,pickObject:u,featureId:u?.featureId},Iyt)}}function Lyt(e,t,n,i,r){let o=WG(i),s=0,a=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?a=u-s:u+1===i.length&&(a=u+1-s),a===0)continue;let d=s+a,p=i.subarray(s,d),g=_Se(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},Pyt),s=u+1,a=0,c++}}function Fyt(e,t,n,i,r,o){let s=o.polygonAttributeOffsets,a=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=s.length;for(let p=0;p<d;p++){let g=s[p],m=p+1<d?s[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let v=c[p];A=u.slice(p,p+v);for(let S=0;S<v;S++)A[S]-=g}let b=a[p],x=p+1<d?a[p+1]:i.length,T=i.slice(b,x);for(let v=0;v<T.length;v++)T[v]-=g;let E=r(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:E,featureId:E?.featureId},pSe)}}function Byt(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=WG(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=_Se(n,p,3,s),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===a&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let E=0;E<A.length;E++)A[E]=s[A[E]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},pSe)}}function gSe(e,t,n,i){let r=xt.getNodeTransform(t),o=N.multiplyTransformation(n,r,new N),s=t.primitives;for(let c=0;c<s.length;c++){let u=s[c],f=u.primitiveType,d,p=Ryt(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new ef({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new ul({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new za({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(N.clone(o)),i.collectionFeatureTableIds.set(d,b),Oyt(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)gSe(e,a[c],o,i)}function _Se(e,t,n,i){let r=WG(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let s=e.constructor,a=new s(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)a[c*n+d]=e[f*n+d];c++}}return a}var Ok=Dyt;var qG=new Vc,YG=new xa,XG=new No,Mk=new Bm,Mte=new kf,ySe=new Bf,ASe=new N,Nte=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=N.clone(N.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof ef).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof za?t+n.triangleCount:n instanceof ul?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new P_({color:i}))}applyStyle(t){let n=o=>o instanceof ef,i=o=>o instanceof ul,r=o=>o instanceof za;for(let o of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,qG);let u=this.getFeature(qG.featureId,s);l(t.show)&&(qG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Mk.color),l(t.pointSize)&&(Mk.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(Mk.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,Mk.outlineColor),qG.setMaterial(Mk)}}for(let o of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,YG);let u=this.getFeature(YG.featureId,s);l(t.show)&&(YG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Mte.color),l(t.lineWidth)&&(Mte.width=t.lineWidth.evaluate(u)),YG.setMaterial(Mte)}}for(let o of this._collections.filter(r)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,XG);let u=this.getFeature(XG.featureId,s);l(t.show)&&(XG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,ySe.color),XG.setMaterial(ySe)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(Uyt(this),this._ready=!0)}N.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,ASe);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];N.multiplyTransformation(ASe,this._collectionLocalMatrices[s],a.modelMatrix),!Ss(i._heightReference)||!Wg.isSupported(a)?a.update(n):o&&r.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,ue(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=kyt(t,n,o,r),a=await Xf.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function kyt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function Uyt(e){let t=e._model.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N);N.multiplyTransformation(t.transform,n,e._modelMatrix);let i=Ok(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var $A=Nte;function pc(){}pc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);pc._sorterTaskProcessor=void 0;pc._taskProcessorReady=!1;pc._error=void 0;pc._getSorterTaskProcessor=function(){if(!l(pc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",pc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?pc._taskProcessorReady=!0:pc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{pc._error=t}),pc._sorterTaskProcessor=e}return pc._sorterTaskProcessor};pc.radixSortIndexes=function(e){let t=pc._getSorterTaskProcessor();if(l(pc._error))throw pc._error;if(pc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var hE=pc;function gc(){}gc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);gc._textureTaskProcessor=void 0;gc._taskProcessorReady=!1;gc._error=void 0;gc._getTextureTaskProcessor=function(){if(!l(gc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",gc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?gc._taskProcessorReady=!0:gc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{gc._error=t}),gc._textureTaskProcessor=e}return gc._textureTaskProcessor};gc.generateFromAttributes=function(e){let t=gc._getTextureTaskProcessor();if(l(gc._error))throw gc._error;if(!gc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var Nk=gc;function zyt(e){let t=new dg;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL}})),this.alphaOptions=new iE,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var Lk=zyt;var Fk=`#if defined(HAS_SPHERICAL_HARMONICS) +const uint coefficientCount[3] = uint[3](3u,8u,15u); +const float SH_C1 = 0.48860251; +const float SH_C2[5] = float[5]( +1.092548430, +-1.09254843, +0.315391565, +-1.09254843, +0.546274215 +); +const float SH_C3[7] = float[7]( +-0.59004358, +2.890611442, +-0.45704579, +0.373176332, +-0.45704579, +1.445305721, +-0.59004358 +); +uvec2 loadSHCoeff(uint splatID, int index) { +ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0); +uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u]; +uint splatsPerRow = uint(shTexSize.x) / dims; +uint shIndex = (splatID%splatsPerRow) * dims + uint(index); +ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow); +return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg; +} +vec3 halfToVec3(uvec2 packed) { +return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x); +} +vec3 loadAndExpandSHCoeff(uint splatID, int index) { +uvec2 coeff = loadSHCoeff(splatID, index); +return halfToVec3(coeff); +} +vec3 evaluateSH(uint splatID, vec3 viewDir) { +vec3 result = vec3(0.0); +int coeffIndex = 0; +float x = viewDir.x, y = viewDir.y, z = viewDir.z; +if (u_sphericalHarmonicsDegree >= 1.) { +vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3; +if (u_sphericalHarmonicsDegree >= 2.) { +float xx = x * x; +float yy = y * y; +float zz = z * z; +float xy = x * y; +float yz = y * z; +float xz = x * z; +vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += SH_C2[0] * xy * sh4 + +SH_C2[1] * yz * sh5 + +SH_C2[2] * (2.0f * zz - xx - yy) * sh6 + +SH_C2[3] * xz * sh7 + +SH_C2[4] * (xx - yy) * sh8; +if (u_sphericalHarmonicsDegree >= 3.) { +vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 + +SH_C3[1] * xy * z * sh10 + +SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 + +SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 + +SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 + +SH_C3[5] * z * (xx - yy) * sh14 + +SH_C3[6] * x * (xx - 3.0f * yy) * sh15; +} +} +} +return result; +} +#endif +vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) { +vec4 t = vec4(viewPos, 1.0); +vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w); +vec2 J1 = focal / t.z; +vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z); +mat3 J = mat3( +J1.x, 0.0, J2.x, +0.0, J1.y, J2.y, +0.0, 0.0, 0.0 +); +mat3 R = mat3(czm_modelView); +mat3 Vrk_view = R * Vrk * transpose(R); +mat3 cov = transpose(J) * Vrk_view * J; +float diagonal1 = cov[0][0] + .3; +float offDiagonal = cov[0][1]; +float diagonal2 = cov[1][1] + .3; +float mid = 0.5 * (diagonal1 + diagonal2); +float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal)); +float lambda1 = mid + radius; +float lambda2 = max(mid - radius, 0.1); +vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1)); +return vec4( +min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector, +min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x) +); +} +highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0); +void main() { +uint texIdx = uint(a_splatIndex); +uint rowMask = uint(u_splatRowMask); +uint rowShift = uint(u_splatRowShift); +ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift)); +vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) ); +vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0); +vec4 clipPosition = czm_projection * splatViewPos; +float clip = 1.2 * clipPosition.w; +if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip || +clipPosition.y < -clip || clipPosition.y > clip) { +gl_Position = vec4(0.0, 0.0, 2.0, 1.0); +return; +} +ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift)); +uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0)); +gl_Position = clipPosition; +vec2 u1 = unpackHalf2x16(covariance.x) ; +vec2 u2 = unpackHalf2x16(covariance.y); +vec2 u3 = unpackHalf2x16(covariance.z); +mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y); +vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk); +if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) { +gl_Position = discardVec; +return; +} +vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.; +gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0); +gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w)); +v_vertPos = corner ; +v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0; +#if defined(HAS_SPHERICAL_HARMONICS) +vec4 splatWC = czm_inverseView * splatViewPos; +vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz)); +v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb; +#endif +v_splitDirection = u_splitDirection; +} +`;var Bk=`void main() { +if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; +if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +float A = -dot(v_vertPos, v_vertPos); +if (A < -4.) { +discard; +} +float B = exp(A * 4.) * v_splatColor.a ; +out_FragColor = vec4(v_splatColor.rgb * B , B); +} +`;var mE=new N,vSe=new N,kk=new N,vi=new $,Uk=new Le,Vyt=new h,jyt=new Le,Hyt=new h,Gyt=1e-12,KG=1e-5,Lte=1e-7,Ya={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ys={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Wyt=2,qyt=30,Yyt=3,Xyt=.008726646259971648,Kyt=1;function $yt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Yyt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Kyt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Xyt:!1}function bSe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function Jyt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function xSe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function Fte(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function TSe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Zyt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function Qyt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function eAt(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=Qyt(e._snapshot,t);for(let a=0;a<r.length;a++){let c=r[a];if(c.length>=i&&c.buffer!==o)return c}let s=Y.createTypedArray(n,i);return r.push(s),s}function tAt(e,t){return e.length===t?e:e.subarray(0,t)}function nAt(e,t,n){if(!l(t.indexes)||t.state!==Ys.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&TSe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&TSe(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Ya.IDLE,e._dirty=!1}async function iAt(e,t,n,i){try{let r=await i,o=kt.maximumTextureSize,s=o,a=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(a>o){let g=n.numSplats;a=o;let m=s/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=s*a*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:s,height:a,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Ys.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=CSe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=CSe(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=kt.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),E=0;for(let v=0;E<n.shData.length;v+=m*2)T.set(n.shData.subarray(E,E+b),v),E+=b;n.sphericalHarmonicsTexture=oAt(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ys.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ys.BUILDING}}async function rAt(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,s=o,a=r?.length;if(o!==s||a!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ys.SORTING&&(n.snapshot.state=Ys.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ys.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,nAt(e,c,t),e._pendingSnapshot=void 0,fu.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ys.SORTING&&(n.snapshot.state=Ys.TEXTURE_READY),e._sorterState=Ya.ERROR,e._sorterError=r}}async function ESe(e,t,n){try{let i=await n,r=xSe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Ya.IDLE);return}e._indexes=i,e._sorterState=Ya.SORTED}catch(i){if(!xSe(e,t))return;e._sorterState=Ya.ERROR,e._sorterError=i}}function oAt(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RG_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function CSe(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RGBA_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function fu(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new N,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=qo.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new N,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(zi.Y,zi.X,new N),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Ya.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(fu.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ys.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});fu.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};fu.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,Fte(this._pendingSnapshot),Fte(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),ue(this)};fu.prototype.isDestroyed=function(){return this._isDestroyed};fu.prototype.onTileLoad=function(e){this._dirty=!0};fu.prototype.onTileVisible=function(e){};fu.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=N.multiplyTransformation(t,i._axisCorrectionMatrix,mE);N.multiplyTransformation(o,e.content.worldTransform,o);let s=N.inverse(r,vSe),a=N.multiplyTransformation(s,o,mE),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&N.equalsEpsilon(a,c,Gyt))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),g=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),m=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);vi[0]=a[0]/p,vi[1]=a[1]/p,vi[2]=a[2]/p,vi[3]=a[4]/g,vi[4]=a[5]/g,vi[5]=a[6]/g,vi[6]=a[8]/m,vi[7]=a[9]/m,vi[8]=a[10]/m;let y=vi[0]*vi[3]+vi[1]*vi[4]+vi[2]*vi[5],A=vi[0]*vi[6]+vi[1]*vi[7]+vi[2]*vi[8],b=vi[3]*vi[6]+vi[4]*vi[7]+vi[5]*vi[8],x=Math.abs(p-1)<=Lte&&Math.abs(g-1)<=Lte&&Math.abs(m-1)<=Lte,T=Math.abs(y)<=KG&&Math.abs(A)<=KG&&Math.abs(b)<=KG,E=vi[0]*(vi[4]*vi[8]-vi[5]*vi[7])-vi[3]*(vi[1]*vi[8]-vi[2]*vi[7])+vi[6]*(vi[1]*vi[5]-vi[2]*vi[4]),v=x&&T&&Math.abs(E-1)<=KG;Le.fromRotationMatrix(vi,Uk),Le.normalize(Uk,Uk);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=Vyt,L=jyt,_=Hyt;for(let C=0;C<S.length/3;++C)O.x=S[C*3],O.y=S[C*3+1],O.z=S[C*3+2],L.x=I[C*4],L.y=I[C*4+1],L.z=I[C*4+2],L.w=I[C*4+3],_.x=R[C*3],_.y=R[C*3+1],_.z=R[C*3+2],v?(N.multiplyByPoint(a,O,O),Le.multiply(Uk,L,L),Le.normalize(L,L)):(N.fromTranslationQuaternionRotationScale(O,L,_,kk),N.multiplyTransformation(a,kk,kk),N.getTranslation(kk,O),N.getScale(kk,_),Le.multiply(Uk,L,L),Le.normalize(L,L)),u[C*3]=O.x,u[C*3+1]=O.y,u[C*3+2]=O.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=N.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};fu.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ys.BUILDING)return;n.state=Ys.TEXTURE_PENDING;let i=Nk.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Ys.BUILDING;return}iAt(e,t,n,i)};fu.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new Lk(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=tn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",de.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",de.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",de.VERTEX),r.addUniform("float","u_splatScale",de.VERTEX),r.addUniform("vec3","u_cameraPositionWC",de.VERTEX),r.addUniform("mat3","u_inverseModelRotation",de.VERTEX);let s=i.uniformMap;r.addUniform("int","u_splatRowMask",de.VERTEX),r.addUniform("int","u_splatRowShift",de.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",de.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",de.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Oe.TRIANGLE_STRIP,r.addVertexLines(Fk),r.addFragmentLines(Bk);let u=r.buildShaderProgram(t.context),f=Je(Ge.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,Oe.TRIANGLE_STRIP),f=Ge.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new En.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new St({attributes:{screenQuadPosition:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Oe.TRIANGLE_STRIP});e._vertexArray=zn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Me.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=N.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new at({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Oe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};fu.prototype.update=function(e){let t=this._tileset;if(Zyt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Ya.IDLE){let r=t._selectedTiles.length!==0&&Jyt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=Wyt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=o||s||this._snapshotRebuildStallFrames>=qyt;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&N.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Ya.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&Fte(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=N.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,vSe);N.multiplyTransformation(v,E.content.worldTransform??N.IDENTITY,v),N.getRotation(N.inverse(v,v),this._shInverseRotation)}for(let E of u)fu.transformTile(E);let f=u.reduce((E,v)=>E+v.content.pointsLength,0),d=(E,v,S,I)=>{let R,O=0,L=0;for(let _ of u){let C=S(_.content),w=l(I)?I:Vt.getNumberOfComponents(C.type),P=l(C.typedArray)?C.typedArray:C;L+=P.length,l(R)||(R=eAt(this,E,v,f*w))}if(!l(R))return Y.createTypedArray(v,0);for(let _ of u){let C=_.content,w=S(C),P=l(w.typedArray)?w.typedArray:w;R.set(P,O),O+=P.length}return tAt(R,L)},p=()=>{let E=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let v=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<v)&&(this._scratchAggregateShBuffer=new Uint32Array(v));let S=this._scratchAggregateShBuffer,I=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(S.set(O,I),I+=O.length)}return I<S.length?S.subarray(0,I):S},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),y=d("rotations",Y.FLOAT,E=>E.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,E=>xt.getAttributeBySemantic(E.gltfPrimitive,ct.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Ys.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Ys.BUILDING){fu.generateSplatTexture(this,e,u);return}if(u.state===Ys.TEXTURE_PENDING||u.state===Ys.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,mE),u.state===Ys.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=hE.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(mE),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ys.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ys.SORTING;let g=this._pendingSort;rAt(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ys.SORTING&&(u.state=Ys.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,mE),!l(this._sorterPromise)){if(!$yt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=hE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(mE),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){bSe(this,e);let g=this._activeSort;this._sorterState=Ya.SORTING,ESe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Ya.WAITING;return}this._sorterState=Ya.SORTING;return}else if(this._sorterState===Ya.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:s};let a=hE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(mE),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){bSe(this,e);let c=this._activeSort;this._sorterState=Ya.SORTING,ESe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Ya.WAITING;return}this._sorterState=Ya.SORTING;return}else{if(this._sorterState===Ya.SORTING)return;if(this._sorterState===Ya.SORTED)fu.buildGSplatDrawCommand(this,e),this._sorterState=Ya.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Ya.ERROR)throw this._sorterError}this._dirty=!1}};var zk=fu;var kte=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new zk({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Yr("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions + +Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,s=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:zi.Y,forwardAxis:zi.Z};l(r.asset)?(a.gltfJson=r,a.baseResource=s,a.gltfResource=s):r instanceof Uint8Array?(a.typedArray=r,a.baseResource=s,a.gltfResource=s):a.gltfResource=De.createIfNeeded(r);let c=new jf(a);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,ct.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,ct.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,ct.SCALE).typedArray.slice();let{l:r,n:o}=aAt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=fAt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),ue(this)}};function sAt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function aAt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var SSe=new ArrayBuffer(4),cAt=new Float32Array(SSe),lAt=new Uint32Array(SSe);function Bte(e){cAt[0]=e;let t=lAt[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let s=i-127+15;s>=31?o=n<<15|31744:s<=0?o=n<<15:o=n<<15|s<<10|r>>>13}return o}function uAt(e){let t=sAt(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function fAt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=uAt(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=a[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=Bte(o[u].typedArray[y])|Bte(o[u].typedArray[y+1])<<16,r[m+1]=Bte(o[u].typedArray[y+2])}}return r}var JA=kte;var wSe={b3dm:function(e,t,n,i,r){return Kf.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Kf.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Kf.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return lF.fromTileType(e,t,n,i,r,wSe)},externalTileset:function(e,t,n,i){return rk.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new dF(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new vk(e,t,n,i,r)},subt:function(e,t,n,i,r){return ZS.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return ZS.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return JA.tilesetRequiresGaussianSplattingExt(e)?JA.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?$A.fromGltf(e,t,n,c):Kf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return JA.tilesetRequiresGaussianSplattingExt(e)?JA.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?$A.fromGltf(e,t,n,i):Kf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Kf.fromGeoJson(e,t,n,i)}},pE=wSe;var ISe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(ISe);var Rr=ISe;var ch={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"};ch.isBinaryFormat=function(e){switch(e){case ch.BATCHED_3D_MODEL:case ch.INSTANCED_3D_MODEL:case ch.COMPOSITE:case ch.POINT_CLOUD:case ch.VECTOR:case ch.GEOMETRY:case ch.IMPLICIT_SUBTREE:case ch.VOXEL_BINARY:case ch.GLTF_BINARY:return!0;default:return!1}};Object.freeze(ch);var Sa=ch;var PSe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(PSe);var lh=PSe;var wa={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},D_=new Array(wa.NUMBER_OF_PASSES);D_[wa.RENDER]=Object.freeze({pass:wa.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});D_[wa.PICK]=Object.freeze({pass:wa.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});D_[wa.SHADOW]=Object.freeze({pass:wa.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});D_[wa.PRELOAD]=Object.freeze({pass:wa.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});D_[wa.PRELOAD_FLIGHT]=Object.freeze({pass:wa.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});D_[wa.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:wa.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});D_[wa.MOST_DETAILED_PRELOAD]=Object.freeze({pass:wa.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});D_[wa.MOST_DETAILED_PICK]=Object.freeze({pass:wa.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});wa.getPassOptions=function(e){return D_[e]};Object.freeze(wa);var ao=wa;var Ute=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},p0=Ute;function R_(e){e=e??H.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(R_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});R_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};R_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};R_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};R_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};R_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};R_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};R_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Vk=R_;function zte(e,t){let n=er(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){zte._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=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new Vk({content:n,class:r})}}zte._oneTimeWarning=_t;var gE=zte;function dAt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=er(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var _E=dAt;function O_(e){e=e??H.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(O_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});O_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};O_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};O_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};O_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};O_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};O_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};O_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var jk=O_;function Vte(e,t){let n=er(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Vte._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=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new jk({tile:n,class:r})}}Vte._oneTimeWarning=_t;var Hk=Vte;function hAt(e){let t=new Uint8Array(e),n=em(t);if(n==="glTF"&&(n="glb"),Sa.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=mAt(t);if(l(i.root))return{contentType:Sa.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Sa.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Sa.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Sa.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Sa.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function mAt(e){let t;try{t=Ro(e)}catch{throw new oe("Invalid tile content.")}return t}var M_=hAt;var jte=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:o[a].uri}),u=Kc.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!pAt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;Hte(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=gAt(this,i,n,this._tile._contentState);return _At(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}};function Hte(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function DSe(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)}function pAt(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)&&!Kc.serverHasOpenSlots(n,t[n]))return!1;return Kc.heapHasOpenSlots(e.length)}function gAt(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new wo({throttle:!0,throttleByServer:!0,type:Zs.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){DSe(e,i);return}return Hte(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){DSe(e,i);return}Hte(e,-1),RSe(e,t,f)}})}async function _At(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>yAt(e,o,s)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function yAt(e,t,n){if(l(t))try{let i=M_(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===Sa.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Sa.GEOMETRY||i.contentType===Sa.VECTOR;let a,c=pE[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=gE(r,u));let f=_E(r,u);return l(f)&&(a.group=new UT({metadata:f})),a}catch(i){RSe(e,n,i)}}function RSe(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var Gk=jte;function Bw(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ee.WGS84;EAt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(Bw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Bw.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)};var OSe=new h,$G=new h,MSe=new h,AAt=new h,bAt=new h,xAt=new h,TAt=new h,uh=new he,NSe=new sn(h.UNIT_X,0),Fw=new pn;function EAt(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),uh.longitude=t.west,uh.latitude=(t.south+t.north)*.5,uh.height=0;let i=n.cartographicToCartesian(uh,xAt),r=h.cross(i,h.UNIT_Z,AAt);h.normalize(r,e.westNormal),uh.longitude=t.east;let o=n.cartographicToCartesian(uh,TAt),s=h.cross(h.UNIT_Z,o,OSe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,OSe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,bAt),u=t.south,f;if(u>0){uh.longitude=(t.west+t.east)*.5,uh.latitude=u;let y=n.cartographicToCartesian(uh,Fw.origin);h.clone(c,Fw.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,NSe);pi.rayPlane(Fw,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,$G)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),$G);let d=h.cross(f,a,MSe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){uh.longitude=(t.west+t.east)*.5,uh.latitude=p;let y=n.cartographicToCartesian(uh,Fw.origin);h.negate(c,Fw.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,NSe);pi.rayPlane(Fw,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,$G)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),$G);let m=h.cross(a,g,MSe);h.normalize(m,e.northNormal)}var CAt=new h,vAt=new h,SAt=new h(0,-1,0),wAt=new h(0,0,-1),LSe=new h;function IAt(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),CAt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),vAt),f.z=f.y,f.y=f.x,f.x=0,d=SAt,g=h.UNIT_Y,p=wAt,m=h.UNIT_Z);let y=h.subtract(i,u,LSe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,LSe),T=h.dot(x,g),E=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:E>0&&(o+=E*E)}let s,a,c;if(t.mode===re.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}Bw.prototype.distanceToCamera=function(e){let t=IAt(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};Bw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Bw.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new oT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Ft({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var Zf=Bw;var JG=new he;function Wk(e){let t=jg.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??ee.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=BAt(t,n,i,r);this._boundingPlanes=o;let s=VAt(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Jte(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=Jte(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Jte(o[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();JG=r.cartesianToCartographic(c,JG),JG.height=(i+n)/2,this.center=r.cartographicToCartesian(JG,c),this._boundingSphere=ce.fromPoints(s)}var PAt=new h,DAt=new he,RAt=new h,OAt=new he,MAt=new h,NAt=new h,LAt=new h,FAt=new h;function BAt(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,PAt),a=i.cartesianToCartographic(o,DAt);a.height=n;let c=i.cartographicToCartesian(a,RAt),u=sn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,OAt),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,MAt));A<f&&(f=A)}let y=sn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,NAt),x=h.subtract(A,g,FAt),T=h.cross(x,b,LAt);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var yE=new h,AE=new h,bE=new h,Gte=new h,Wte=new h,qte=new h,kAt=new h,UAt=new h,zAt=new h,Yte=new h,Xte=new h,Kte=new h,ZA=new h,g0=new $;function FSe(e,t,n){yE=e.normal,AE=t.normal,bE=n.normal,Gte=h.multiplyByScalar(e.normal,-e.distance,Gte),Wte=h.multiplyByScalar(t.normal,-t.distance,Wte),qte=h.multiplyByScalar(n.normal,-n.distance,qte),Yte=h.multiplyByScalar(h.cross(AE,bE,kAt),h.dot(Gte,yE),Yte),Xte=h.multiplyByScalar(h.cross(bE,yE,UAt),h.dot(Wte,AE),Xte),Kte=h.multiplyByScalar(h.cross(yE,AE,zAt),h.dot(qte,bE),Kte),g0[0]=yE.x,g0[1]=AE.x,g0[2]=bE.x,g0[3]=yE.y,g0[4]=AE.y,g0[5]=bE.y,g0[6]=yE.z,g0[7]=AE.z,g0[8]=bE.z;let i=$.determinant(g0);return ZA=h.add(Yte,Xte,ZA),ZA=h.add(ZA,Kte,ZA),new h(ZA.x/i,ZA.y/i,ZA.z/i)}function VAt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=FSe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=FSe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var $te=new h,kw=new h;function Jte(e,t){let n=[];for(let i=0;i<4;i++)$te=h.subtract(t[(i+1)%4],t[i],$te),kw=h.cross(e.normal,$te,kw),kw=h.normalize(kw,kw),n[i]=h.clone(kw);return n}Object.defineProperties(Wk.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var Zte=new h;Wk.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=Qte(sn.projectPointOntoPlane(c,t,Zte),i[0],c,r),h.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=BSe(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=Qte(sn.projectPointOntoPlane(c,t,Zte),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=Qte(sn.projectPointOntoPlane(this._boundingPlanes[1],t,Zte),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var jAt=new h,HAt=new h;function BSe(e,t,n){let i=h.subtract(n,t,jAt),r=h.subtract(e,t,HAt),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var GAt=new sn(h.UNIT_X,0);function Qte(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],GAt);sn.getPointDistance(u,e)<0||(a=BSe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}Wk.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};Wk.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new Ud({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Ud.createGeometry(n),r=new Ft({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new Ud({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Ud.createGeometry(o),a=new Ft({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Ud({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Ud.createGeometry(f);c[u]=new Ft({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new Mn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var qk=Wk;function Uw(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ce(e,t)}Object.defineProperties(Uw.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}}});Uw.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};Uw.prototype.intersectPlane=function(e){return ce.intersectPlane(this._boundingSphere,e)};Uw.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};Uw.prototype.createDebugVolume=function(e){let t=new Hg({radius:this.radius}),n=N.fromTranslation(this.center,N.clone(N.IDENTITY)),i=new Ft({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var N_=Uw;var WAt=new h,qAt=new h,YAt=new h,XAt=new h;function xE(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function ene(e,t){let n=h.normalize(e,XAt),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return xE(e,i,t)}function kSe(e){let t=$.getColumn(e,0,WAt),n=$.getColumn(e,1,qAt),i=$.getColumn(e,2,YAt),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(r&&!o&&!s?t=xE(n,i,t):!r&&o&&!s?n=xE(t,i,n):!r&&!o&&s?i=xE(n,t,i):r?o?s||(t=ene(i,t),n=xE(i,t,n)):(t=ene(n,t),i=xE(n,t,i)):(n=ene(t,n),i=xE(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function zw(e,t){t=kSe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(zw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});zw.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};zw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};zw.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=kSe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};zw.prototype.createDebugVolume=function(e){let t=new $h({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=N.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Ft({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var tf=zw;function co(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||er(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?N.unpack(n.transform):N.clone(N.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=N.multiply(a,this.transform,new N),u=l(i)?i._initialTransform:N.IDENTITY;this._initialTransform=N.multiply(u,this.transform,new N),this.computedTransform=c,this.metadata=Hk(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,co._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")&&co._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?bo.REPLACE:bo.ADD):l(i)?p=i.refine:p=bo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Rr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(co._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(co._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 p0(e,this),m=!0,y=Rr.READY):(y=Rr.UNLOADED,A=t.getDerivedResource({url:v}),b=Kc.getServerKey(A.getUrlComponent()))}else g=new p0(e,this),m=!0,y=Rr.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,E;l(x)&&(T=x.duration,l(x.date)&&(E=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=lh.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!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=z.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 K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}co._deprecationWarning=Yr;Object.defineProperties(co.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 z),z.clone(this._color)},set:function(e){this._color=z.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===Rr.READY}},contentUnloaded:{get:function(){return this._contentState===Rr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Rr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Rr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var QA=new h;function KAt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,QA),c=h.add(s.positionWC,a,QA),u=h.subtract(c,o,QA);if(h.magnitude(u)>r){let E=h.normalize(u,QA),v=h.multiplyByScalar(E,r,QA),S=h.add(o,v,QA),I=h.subtract(S,s.positionWC,QA),R=h.normalize(I,QA);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===bo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===ao.PRELOAD_FLIGHT||n._pass===ao.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=D.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var GSe=new K;co.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof gn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=D.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function $At(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,s=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function JAt(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}co.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:ta.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,r),this._visible=this._visibilityPlaneMask!==ta.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=JAt(n,this),this._priorityProgressiveResolution=$At(n,this),this.priorityDeferred=KAt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};co.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(GSe);K.lessThan(this.expireDate,e)&&(this._contentState=Rr.EXPIRED,this._expiredContent=this._content)}};function ZAt(e){if(!l(e.expireDuration))return;let t=K.now(GSe);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function QAt(e){return function(){return e._priority}}co.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?ebt(this):nbt(this)};function ebt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=er(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new Gk(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Rr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Rr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Rr.FAILED,r})}async function tbt(e,t,n,i,r){let o=e._contentState;e._contentState=Rr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(WSe(e,a))return i&&(e.expireDate=void 0),e._content=new p0(t,e),USe(e),e._contentState=Rr.PROCESSING,e._content;throw e._contentState=Rr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await ibt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof p0&&USe(e),e._contentState=Rr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Rr.FAILED,a}}function nbt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new wo({throttle:!0,throttleByServer:!0,type:Zs.TILES3D,priorityFunction:QAt(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return tbt(e,r,i,n,o)}function WSe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function USe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}co._isEmptyTile=WSe;async function ibt(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=M_(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===Sa.GEOMETRY||r.contentType===Sa.VECTOR,(r.contentType===Sa.IMPLICIT_SUBTREE||r.contentType===Sa.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===Sa.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=pE[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(s(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(s(n,e,e._contentResource,r.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=gE(n,a));let c=_E(n,a);return l(c)&&(o.group=new UT({metadata:c})),o}co.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};co.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Rr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};co.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Rr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,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 qSe=new ce;function nne(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,qSe);e._boundingVolume2D=new N_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function rbt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,qSe);e._contentBoundingVolume2D=new N_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}co.prototype.visibility=function(e,t){let n=e.cullingVolume,i=nne(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==$t.INSIDE,a===$t.OUTSIDE)return ta.MASK_OUTSIDE}let s=r.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==$t.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};co.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===ta.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=rbt(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return $t.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==$t.OUTSIDE,s===$t.INSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};co.prototype.distanceToTile=function(e){return nne(this,e).distanceToCamera(e)};var obt=new h;co.prototype.distanceToTileCenter=function(e){let n=nne(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,obt);return h.dot(e.camera.directionWC,i)};co.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var YSe=new $,XSe=new h,sbt=new $,ine=new h,KSe=new ie,$Se=new en,tne=new N;function abt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],ine),r=$.fromArray(e,3,sbt);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,YSe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new tf(i,r)}function zSe(e,t,n,i){let r=ie.unpack(e,0,KSe),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,$Se),c=a.center,u=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,tne),tne),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,YSe);return u=$.multiply(f,u,u),l(i)&&i instanceof tf?(i.update(c,u),i):new tf(c,u)}function cbt(e,t,n,i){if(!N.equalsEpsilon(t,n,D.EPSILON8))return i instanceof tf?zSe(e,t,n,i):zSe(e,t,n,void 0);let r=ie.unpack(e,0,KSe);return i instanceof Zf?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Zf({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function lbt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],ine),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,XSe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new N_(i,r)}co.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=LA.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(er(e,"3DTILES_bounding_volume_S2"))return new qk(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=abt(o,t,n);return this._verticalExaggeration!==1&&VSe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=cbt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof tf?VSe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Ar.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Ar.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=lbt(a,t,n);if(this._verticalExaggeration!==1){let u=Ar.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,ine),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var ubt=h.unpackArray(new Array(24).fill(0));function VSe(e,t,n){let i=e.boundingVolume.computeCorners(ubt).map(o=>Ar.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,$Se);e.update(r.center,r.halfAxes)}co.prototype.updateTransform=function(e,t){e=e??N.IDENTITY;let n=N.multiplyTransformation(e,this.transform,tne),i=!N.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&N.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.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(o.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()};co.prototype.updateGeometricErrorScale=function(){let e=N.getScale(this.computedTransform,XSe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function fbt(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.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(z.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=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function dbt(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(r){throw e._contentState=Rr.FAILED,r}}function hbt(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 mbt(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)}co.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;hbt(this,e),mbt(this,e),fbt(this,e,t,n),dbt(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ie.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var jSe=[];co.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(ZAt(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Rr.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=jSe;try{this._content.update(e,t)}catch(i){throw this._contentState=Rr.FAILED,i}jSe.length=0,t.commandList=n};function HSe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function ZG(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}co.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=ZG(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===bo.REPLACE?ZG(this._priorityHolder._distanceToCamera,n.distance,i.distance):ZG(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=HSe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=ZG(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=HSe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===ao.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};co.prototype.isDestroyed=function(){return!1};co.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(),ue(this)};var fh=co;function L_(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(L_.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}}});L_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};L_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};L_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};L_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};L_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};L_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};L_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Vw=L_;function F_(e){e=e??H.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(F_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});F_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};F_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};F_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};F_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};F_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};F_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};F_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Yk=F_;function JSe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new Yk({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new Vw({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new Vw({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(JSe.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 TE=JSe;var ZSe={},pbt=new h;ZSe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof tf||i instanceof Zf){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=lh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof tf||a instanceof Zf)){e._optimChildrenWithinParent=lh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,pbt),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=lh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===lh.USE_OPTIMIZATION};var Xk=ZSe;function eb(){this._list=new WM,this._sentinel=this._list.add(),this._trimTiles=!1}eb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};eb.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};eb.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};eb.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};eb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};eb.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=o.item;o=o.next,this.unloadTile(e,s,t)}};eb.prototype.trim=function(){this._trimTiles=!0};var Kk=eb;function QG(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 one(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}QG.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=one(e,n),this._referenceMaximum[n]=one(t,n)};function gbt(e,t){let n=e.tilePropertyName;if(l(n)){let i=one(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 rne=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];QG.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=gbt(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+D.EPSILON7,c=D.clamp(i-r,0,s)/s,u=rne.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=rne[d],y=rne[p],A=z.clone(z.WHITE);A.red=D.lerp(m.red,y.red,g),A.green=D.lerp(m.green,y.green,g),A.blue=D.lerp(m.blue,y.blue,g),e._debugColor=A};QG.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 $k=QG;function jw(){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}jw.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};jw.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])}};jw.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Kf))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};jw.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Kf))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};jw.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.batchTableByteLength=e.batchTableByteLength};var Um=jw;function Jk(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(Jk.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});Jk.prototype.makeDirty=function(){this._styleDirty=!0};Jk.prototype.resetDirty=function(){this._styleDirty=!1};Jk.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,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var Zk=Jk;function QSe(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.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,snap:!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,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}QSe.maximumFrameNumber=15e6;var tb=QSe;function B_(){}B_.selectTiles=function(e,t){pe.throwInstantiationError()};B_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};B_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};B_.selectTile=function(e,t){if(e.contentVisibility(t)===$t.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)};B_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};B_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};B_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!_bt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function _bt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}B_.updateTile=function(e,t){ewe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,bbt(e),e._shouldSelect=!1,e._finalResolution=!0};function ewe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];ewe(o,t),e._visible=o._visible;return}if(ybt(e,t)){e._visible=!1;return}let i=e.refine===bo.REPLACE,r=e._optimChildrenWithinParent===lh.USE_OPTIMIZATION;if(i&&r&&n&&!Abt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function ybt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==bo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Abt(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function bbt(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 Xa=B_;function twe(){}var Qk={stack:new Zl,stackMaximumLength:0};twe.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:r,visitTile:o}=Xa,s=Qk.stack;for(s.push(i);s.length>0;){Qk.stackMaximumLength=Math.max(Qk.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===bo.ADD,u=a.refine===bo.REPLACE,f=xbt(a);f&&Tbt(a,s,t),(c||u&&!f)&&(Ebt(e,a),r(a,t),Cbt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return Qk.stack.trim(Qk.stackMaximumLength),n};function xbt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Tbt(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function Ebt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Cbt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var e3=twe;function nwe(){}var t3={stack:new Zl,stackMaximumLength:0},n3={stack:new Zl,stackMaximumLength:0};nwe.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(Xa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Sbt(n,t),t3.stack.trim(t3.stackMaximumLength),n3.stack.trim(n3.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function sne(e,t){e.contentAvailable&&Xa.selectTile(e,t)}function vbt(e,t,n){let i=e.refine===bo.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=Xa;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(Xa.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=wbt(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function Sbt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=Xa,a=t3.stack;for(a.push(e);a.length>0;){t3.stackMaximumLength=Math.max(t3.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?vbt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===bo.ADD?(sne(c,t),r(c,t)):c.refine===bo.REPLACE&&(r(c,t),d&&sne(c,t)):(n._emptyTiles.push(c),r(c,t),d&&sne(c,t)),o(c,t),s(c,t)}}function wbt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Xa,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=n3.stack;for(c.push(e);c.length>0;){n3.stackMaximumLength=Math.max(n3.stackMaximumLength,c.length);let u=c.pop(),f=u.children,d=f.length,p=!u.hasRenderableContent&&n(u);if((s?u.hasRenderableContent:!p)&&!u.contentAvailable&&(a=!1),i(u,t),u.isVisible||(r(u,t),o(u,t)),p)for(let m=0;m<d;++m){let y=f[m];c.push(y)}}return e.hasEmptyContent||a}var i3=nwe;function iwe(){}var r3={stack:new Zl,stackMaximumLength:0},o3={stack:new Zl,stackMaximumLength:0},k_={stack:new Zl,stackMaximumLength:0,ancestorStack:new Zl,ancestorStackMaximumLength:0},Ibt=2;iwe.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(Xa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Nbt(n,t),Lbt(n,t),r3.stack.trim(r3.stackMaximumLength),o3.stack.trim(o3.stackMaximumLength),k_.stack.trim(k_.stackMaximumLength),k_.ancestorStack.trim(k_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Pbt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=Xa,o=o3.stack;for(o.push(e);o.length>0;){o3.stackMaximumLength=Math.max(o3.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<Ibt&&o.push(u))}}}function e5(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Pbt(e,t)}function Dbt(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 Rbt(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 Obt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Xa;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(Xa.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function Mbt(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 Nbt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=Xa,c=r3.stack;for(c.push(e);c.length>0;){r3.stackMaximumLength=Math.max(r3.stackMaximumLength,c.length);let u=c.pop();Dbt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Obt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===bo.ADD?(e5(u,t),o(u,t)):u.refine===bo.REPLACE&&(Mbt(u,i)?(o(u,t),p&&e5(u,t)):p?(e5(u,t),o(u,t)):Rbt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&e5(u,t)),s(u,t),a(u,t)}}function Lbt(e,t){let{selectTile:n,canTraverse:i}=Xa,{stack:r,ancestorStack:o}=k_,s;for(r.push(e);r.length>0||o.length>0;){if(k_.stackMaximumLength=Math.max(k_.stackMaximumLength,r.length),k_.ancestorStackMaximumLength=Math.max(k_.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===bo.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var s3=iwe;function Ia(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Ia.prototype,{length:{get:function(){return this._layers.length}}});Ia.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()})};Ia.prototype.addImageryProvider=function(e,t){let n=new Rs(e);return this.add(n,t),n};Ia.prototype.remove=function(e,t){t=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};Ia.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};Ia.prototype.contains=function(e){return this.indexOf(e)!==-1};Ia.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ia.prototype.get=function(e){return this._layers[e]};function t5(e,t){return e.indexOf(t)}function rwe(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}Ia.prototype.raise=function(e){let t=t5(this._layers,e);rwe(this,t,t+1)};Ia.prototype.lower=function(e){let t=t5(this._layers,e);rwe(this,t,t-1)};Ia.prototype.raiseToTop=function(e){let t=t5(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))};Ia.prototype.lowerToBottom=function(e){let t=t5(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 owe=new ie;function swe(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=owe,p=1/1024;d.west=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}Ia.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(swe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var Fbt=new ie,Bbt=new ie,ane=new U,cne=new U,kbt=new he,Ubt=new he;function zbt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,Fbt),s=1/1024,a=Bbt;a.west=D.lerp(o.west,o.east,t.minX-s),a.east=D.lerp(o.west,o.east,t.maxX+s),a.south=D.lerp(o.south,o.north,t.minY-s),a.north=D.lerp(o.south,o.north,t.maxY+s),l(i)||(i=new ie);let c=r.projection;if(c instanceof Ui)return i.west=D.toRadians(a.west),i.south=D.toRadians(a.south),i.east=D.toRadians(a.east),i.north=D.toRadians(a.north),i;ane.x=a.west,ane.y=a.south,cne.x=a.east,cne.y=a.north;let u=c.unproject(ane,kbt),f=c.unproject(cne,Ubt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function Vbt(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let s=r[o],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let u=a[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==Vn.READY||!ie.contains(p.rectangle,t))continue;let A=s.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=zbt(A,d.textureCoordinateRectangle,g,owe);ie.contains(b,t)&&n(p)}}}}Ia.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),s.push(c.imageryLayer))}if(l(t.globe)&&swe(t,r,!0,function(c){a(c)}),l(i)&&Vbt(i,r,function(c){a(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=s[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};Ia.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ia.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ia.prototype.isDestroyed=function(){return!1};Ia.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Ia.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,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(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var EE=Ia;function lo(e){e=e??H.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 Kk,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Zl,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new Zk,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Um,this._statisticsLast=new Um,this._statisticsPerPass=new Array(ao.NUMBER_OF_PASSES);for(let r=0;r<ao.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Um;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 $k(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ee.WGS84,this._initialClippingPlanesOriginMatrix=N.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new EE(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Dn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Yu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new a0(e.pointCloudShading),this._pointCloudEyeDomeLighting=new l_,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=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Is.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Bc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),fwe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new kT,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new s_(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??qo.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=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.edgeDisplayMode=e.edgeDisplayMode??Qd.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(lo.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){Is.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Bc.setOwner(e,this,"_clippingPolygons"),fwe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Yr("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}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=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=N.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&&(N.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):N.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},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,gwe(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}}});lo.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return lo.fromUrl(n,t)};lo.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await lo.loadJson(n),o=await jbt(n,r),s=new lo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras,gwe(s);let c=l(r.asset.gltfUpAxis)?zi.fromName(r.asset.gltfUpAxis):zi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??zi.X;s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,r);let p=s._root.createBoundingVolume(r.root.boundingVolume,N.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Mi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=N.clone(s._initialClippingPlanesOriginMatrix),s};lo.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};lo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};lo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&lo.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=awe(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();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===bo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=awe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&Xk.checkChildrenWithinParent(c)}return s};function awe(e,t,n,i){if(!(l(n.implicitTiling)||er(n,"3DTILES_implicit_tiling")))return new fh(e,t,n,i);let o=e.schema,s=new Yp(t,n,o),a=new qp({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Je(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new fh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function jbt(e,t){let n=er(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Li.getSchemaLoader({resource:e});else if(l(n.schema))i=Li.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new TE({schema:i.schema,metadataJson:n});return Li.unload(i),r}var cwe=new h,Hbt=new he,Gbt=new N,Wbt=new h,qbt=new h,Ybt=new h,Xbt=new h;function Kbt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Zf)n=h.normalize(a.positionWC,cwe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=N.inverseTransformation(c.computedTransform,Gbt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=N.multiplyByPoint(y,b.center,Wbt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,Hbt);n=h.normalize(a.positionWC,cwe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=N.multiplyByPoint(y,a.positionWC,qbt);if(n=h.UNIT_Z,i=N.multiplyByPointAsVector(y,a.directionWC,Ybt),i=h.normalize(i,i),r=T.z,u instanceof tf){let E=$.getColumn(b.halfAxes,2,Xbt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof N_){let E=b.radius;o=x.z-E,s=x.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=D.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function $bt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{dwe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?mwe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function uwe(e,t){return e._priority-t._priority}lo.prototype.postPassesUpdate=function(e){l(this._root)&&(Jbt(this,e),pxt(this,e),this._cache.unloadTiles(this,pwe),hxt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function fwe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}lo.prototype.prePassesUpdate=function(e){if(!l(this._root))return;rxt(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),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Kbt(this,e),e.newFrame&&this._cache.reset()};function Jbt(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Rr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function Zbt(e){let t=e._requestedTiles;t.sort(uwe);for(let n=0;n<t.length;++n)$bt(e,t[n])}function dwe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function Qbt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Rr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var ext=new he,txt=new he,nxt=new h;function ixt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,r=t.boundingSphere,o=i.length;for(let s=0;s<o;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,u=he.clone(a.positionCartographic,ext),f=he.fromCartesian(r.center,c,txt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,nxt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function rxt(e,t){Qbt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,s=i+r,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,dwe(f,e,u)}}e.totalMemoryUsageInBytes<i?sxt(e):a&&n.length>0&&oxt(e)}function oxt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(uwe)}function sxt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var n5=new h,axt={maximumFractionDigits:3};function lwe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,axt):Math.round(t).toLocaleString()}function lne(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,n5);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,n5);o=h.multiplyByScalar(o,.75*n,n5),r=h.add(o,i,n5)}return r}function une(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` +Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` +Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` +Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,r++),i+=` +Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${lwe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${lwe(e.content.geometryByteLength)}`,r+=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 NKe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(c(e.debugPickedTile)){let s=c(e.debugPickPosition)?e.debugPickPosition:pq(e.debugPickedTile),a=_q(e.debugPickedTile,e,s);a.pixelOffset=new H(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];_q(a,e,pq(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&_q(a,e,pq(a))}}e._tileDebugLabels.update(t)}function FKe(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&&(c(e._stencilClearCommand)||(e._stencilClearCommand=new ei({stencil:0,pass:De.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:l,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),IKe(e,y,t),y.update(e,t,n),l.incrementSelectionCounts(y.content),++l.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let b=g-1;b>=0;--b)i[h+y+b]=i[h+b];for(let b=0;b<y;++b)i[h+b]=m[b]}g=i.length-r,l.numberOfCommands=g,f&&(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?(c(e._tileDebugLabels)||(e._tileDebugLabels=new Om),NKe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Bfe=[];function BKe(e,t){let n=t,i=Bfe;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&&(kKe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function kfe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function kKe(e,t){e._cache.unloadTile(e,t,kfe),t.destroy()}cr.prototype.trimLoadedTiles=function(){this._cache.trim()};function UKe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;gh.clone(n,i);let l=o!==s||r!==a;l&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,l&&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 VKe(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 zKe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&c(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!B.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=B.clone(e.modelMatrix,e._previousModelMatrix)))}function HKe(e,t,n,i){if(t.mode===oe.MORPHING||!c(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,VKe(e),zKe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&SKe(e),FKe(e,t,i),gh.clone(o,n),i.isRender){let s=e._credits;if(c(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let l=s[a];t.creditDisplay.addCreditToNextFrame(l)}}return r}function Ufe(e){let t=e._credits;c(t)||(t=[]),t.length=0,c(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Tt.clone(i))});let n=e.asset.extras;if(c(n)&&c(n.cesium)&&c(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Tt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}cr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Uo.MOST_DETAILED_PRELOAD||t===Uo.MOST_DETAILED_PICK?jL:this.isSkippingLevelOfDetail?$L:YL};cr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};cr.prototype.updateForPass=function(e,t){T.typeOf.object("frameState",e),T.typeOf.object("tilesetPassState",t);let n=t.pass;if(n===Uo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Uo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Uo.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=Uo.getPassOptions(n),a=s.ignoreCommands,l=t.commandList??i,u=l.length;if(e.commandList=l,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;c(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;c(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=HKe(this,e,h,s)),a&&(l.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};cr.prototype.hasExtension=function(e){return c(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};cr.prototype.isDestroyed=function(){return!1};cr.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(),c(this._root)){let e=Bfe;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,de(this)};cr.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};cr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!cr.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var GKe=new mn,jKe=new d,WKe=new he;cr.prototype.getHeight=function(e,t){T.typeOf.object("cartographic",e),T.typeOf.object("scene",t);let n=t.ellipsoid;c(n)||(n=ie.WGS84);let i=GKe,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,jKe);if(c(r))return n.cartesianToCartographic(r,WKe)?.height};cr.prototype.updateHeight=function(e,t,n){n=n??ie.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 qKe=new Ma,YKe=new d;cr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let l=0;l<o;++l){let u=i[l],f=Zn.raySphere(e,u.contentBoundingVolume.boundingSphere,qKe);!c(f)||!c(u.content)||r.push(u)}let s=r.length;r.sort((l,u)=>{let f=le.distanceSquaredTo(l.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let l=0;l<s;++l){let f=r[l].content.pick(e,t,YKe);if(c(f))return a=d.clone(f,n),a}};var bs=cr;var XKe=new B;function qy(e,t){if(!c(e))throw new E("scene is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(qy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}qy.prototype.update=function(e){if(!c(e))throw new E("time is required.");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,l,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),h;f&&(h=s.computeModelMatrix(e,XKe),l=we.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=c(u)?u.tilesetPrimitive:void 0;if(!f){c(p)&&(p.show=!1);continue}(!c(u)||l.url!==u.url)&&(c(p)&&i.removeAndDestroy(p),delete n[s.id],KKe(l,n,s,i)),c(p)&&(p.show=!0,c(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};qy.prototype.isDestroyed=function(){return!1};qy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)gq(this,e[i],t,n);return de(this)};qy.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._tilesetHash[e.id];if(!c(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return c(i)?i.show?(le.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};qy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._tileset)?s.set(r.id,r):(gq(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],gq(this,r,a,l),s.remove(r.id)};function gq(e,t,n,i){let o=n[t.id];c(o)&&(c(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function KKe(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),!c(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var ZL=qy;var $Ke=G.WHITE,ZKe=G.BLACK,QKe=new H(2,2);function BE(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(BE.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:fe("evenColor"),oddColor:fe("oddColor"),repeat:fe("repeat")});BE.prototype.getType=function(e){return"Checkerboard"};var JKe=new Q;BE.prototype.getValue=function(e,t){return c(e)||(e=Q.now(JKe)),c(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,$Ke,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,ZKe,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,QKe),t};BE.prototype.equals=function(e){return this===e||e instanceof BE&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var kE=BE;var Vfe={id:void 0};function QL(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 Cc(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new pe,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}Cc.prototype.suspendEvents=function(){this._suspendCount++};Cc.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new E("resumeEvents can not be called before suspendEvents.");this._suspendCount--,QL(this)};Object.defineProperties(Cc.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(!c(e))throw new E("value is required.");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}}});Cc.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(c(s)){let a=s.start,l=s.stop;Q.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),Q.greaterThan(l,t)&&!l.equals(Ge.MAXIMUM_VALUE)&&(t=l)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new En({start:e,stop:t})};Cc.prototype.add=function(e){if(!c(e))throw new E("entity is required.");e instanceof nr||(e=new nr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new E(`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(Cc.prototype._onEntityDefinitionChanged,this),QL(this),e};Cc.prototype.remove=function(e){return c(e)?this.removeById(e.id):!1};Cc.prototype.contains=function(e){if(!c(e))throw new E("entity is required");return this._entities.get(e.id)===e};Cc.prototype.removeById=function(e){if(!c(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(Cc.prototype._onEntityDefinitionChanged,this),QL(this),!0):!1};Cc.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,l=i.get(a);c(l)||(s.definitionChanged.removeEventListener(Cc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),QL(this)};Cc.prototype.getById=function(e){if(!c(e))throw new E("id is required.");return this._entities.get(e)};Cc.prototype.getOrCreateEntity=function(e){if(!c(e))throw new E("id is required.");let t=this._entities.get(e);return c(t)||(Vfe.id=e,t=new nr(Vfe),this.add(t)),t};Cc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),QL(this)};var Qs=Cc;var Qz={id:void 0},UE=new Array(2);function yq(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 zfe(e,t,n,i){UE[0]=n,UE[1]=i.id,t[JSON.stringify(UE)]=i.definitionChanged.addEventListener(qr.prototype._onDefinitionChanged,e)}function Hfe(e,t,n,i){UE[0]=n,UE[1]=i.id;let o=JSON.stringify(UE);t[o](),t[o]=void 0}function Yy(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,l,u,f=e._composite,h=new Qs(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(qr.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--)s=a[l],Hfe(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(qr.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--){s=a[l],zfe(e,p,g,s);let y=h.getById(s.id);c(y)||(y=f.getById(s.id),c(y)?yq(y):(Qz.id=s.id,y=new nr(Qz)),h.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function qr(e,t){this._owner=t,this._composite=new Qs(this),this._suspendCount=0,this._collections=c(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},Yy(this),this._shouldRecomposite=!1}Object.defineProperties(qr.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}}});qr.prototype.addCollection=function(e,t){let n=c(t);if(!c(e))throw new E("collection is required.");if(n){if(t<0)throw new E("index must be greater than or equal to zero.");if(t>this._collections.length)throw new E("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Yy(this)};qr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Yy(this),!0):!1};qr.prototype.removeAllCollections=function(){this._collections.length=0,Yy(this)};qr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};qr.prototype.contains=function(e){return this._composite.contains(e)};qr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};qr.prototype.getCollection=function(e){if(!c(e))throw new E("index is required.","index");return this._collections[e]};qr.prototype.getCollectionsLength=function(){return this._collections.length};function Jz(e,t){if(!c(t))throw new E("collection is required.");let n=e.indexOf(t);if(n===-1)throw new E("collection is not in this composite.");return n}function Gfe(e,t,n){let i=e._collections;if(t=O.clamp(t,0,i.length-1),n=O.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Yy(e)}qr.prototype.raiseCollection=function(e){let t=Jz(this._collections,e);Gfe(this,t,t+1)};qr.prototype.lowerCollection=function(e){let t=Jz(this._collections,e);Gfe(this,t,t-1)};qr.prototype.raiseCollectionToTop=function(e){let t=Jz(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Yy(this))};qr.prototype.lowerCollectionToBottom=function(e){let t=Jz(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Yy(this))};qr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};qr.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new E("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Yy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};qr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};qr.prototype.getById=function(e){return this._composite.getById(e)};qr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,l,u,f=n.length,h=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Hfe(this,h,p,m);let y=m.id;for(a=o-1;a>=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),yq(u)),u.merge(l));c(u)||r.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];zfe(this,h,p,m);let y=m.id;for(a=o-1;a>=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),c(u)?yq(u):(Qz.id=y,u=new nr(Qz),r.add(u))),u.merge(l));u=void 0}r.resumeEvents()};qr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,l=r.getById(a),u=l[t],f=!c(u),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(c(g)){let m=g[t];if(c(m)){if(h)if(h=!1,c(m.merge)&&c(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&l.propertyNames.indexOf(t)===-1&&l.addProperty(t),l[t]=u};var bq=qr;function xq(){this._removalFunctions=[]}xq.prototype.add=function(e,t,n){if(!c(e))throw new E("event is required");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)}};xq.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var gr=xq;function Cq(e,t){return Q.compare(e.start,t.start)}function Yr(e){if(this._intervals=[],this._changedEvent=new pe,c(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Yr.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}}});Yr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Yr))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(!En.equals(n[r],i[r],t))return!1;return!0};Yr.prototype.get=function(e){if(!c(e))throw new E("index is required.");return this._intervals[e]};Yr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Yr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Yr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Yr.prototype.contains=function(e){return this.indexOf(e)>=0};var Tq=new En;Yr.prototype.indexOf=function(e){if(!c(e))throw new E("date is required");let t=this._intervals;Tq.start=e,Tq.stop=e;let n=Lo(t,Tq,Cq);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&&En.contains(t[n-1],e)?n-1:~n)};Yr.prototype.findInterval=function(e){e=e??W.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 l=r[s];if((!c(t)||l.start.equals(t))&&(!c(n)||l.stop.equals(n))&&(!c(i)||l.isStartIncluded===i)&&(!c(o)||l.isStopIncluded===o))return r[s]}};Yr.prototype.addInterval=function(e,t){if(!c(e))throw new E("interval is required");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=Lo(n,e,Cq);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))&&((c(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({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 En({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 En({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(c(t)?t(n[i].data,e.data):n[i].data===e.data)e=new En({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 En({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)};Yr.prototype.removeInterval=function(e){if(!c(e))throw new E("interval is required");if(e.isEmpty)return!1;let t=this._intervals,n=Lo(t,e,Cq);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 En({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 En({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 En({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 En({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new En({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 En({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Yr.prototype.intersect=function(e,t,n){if(!c(e))throw new E("other is required.");let i=new Yr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let l=s[o],u=a[r];if(Q.lessThan(l.stop,u.start))++o;else if(Q.lessThan(u.stop,l.start))++r;else{if(c(n)||c(t)&&t(l.data,u.data)||!c(t)&&u.data===l.data){let f=En.intersect(l,u,new En,n);f.isEmpty||i.addInterval(f,t)}Q.lessThan(l.stop,u.stop)||l.stop.equals(u.stop)&&!l.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Yr.fromJulianDateArray=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.julianDates))throw new E("options.iso8601Array is required.");c(t)||(t=new Yr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,l=e.trailingInterval??!1,u,f=0;a&&(++f,u=new En({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],g=n[h+1];u=new En({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?s:!1}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return l&&(u=new En({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u)),t};var Ec=new im,JL=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Aq(e,t,n){c(n)||(n=new Q),Q.toGregorianDate(e,Ec);let i=Ec.millisecond+t.millisecond,o=Ec.second+t.second,r=Ec.minute+t.minute,s=Ec.hour+t.hour,a=Ec.day+t.day,l=Ec.month+t.month,u=Ec.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),JL[2]=Dd(u)?29:28;a>JL[l]||l>=13;)a>JL[l]&&(a-=JL[l],++l),l>=13&&(--l,u+=Math.floor(l/12),l=l%12,++l),JL[2]=Dd(u)?29:28;return Ec.millisecond=i,Ec.second=o,Ec.minute=r,Ec.hour=s,Ec.day=a,Ec.month=l,Ec.year=u,Q.fromGregorianDate(Ec,n)}var e$e=new Q,t$e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function jfe(e,t){if(!c(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(t$e);if(!c(n))return!1;if(c(n[1])&&(t.year=Number(n[1].replace(",","."))),c(n[2])&&(t.month=Number(n[2].replace(",","."))),c(n[3])&&(t.day=Number(n[3].replace(",","."))*7),c(n[4])&&(t.day+=Number(n[4].replace(",","."))),c(n[5])&&(t.hour=Number(n[5].replace(",","."))),c(n[6])&&(t.minute=Number(n[6].replace(",","."))),c(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,e$e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var eN=new im;Yr.fromIso8601=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.iso8601))throw new E("options.iso8601 is required.");let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!jfe(n[2],eN))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=Aq(s,eN),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Yr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Yr.fromIso8601DateArray=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.iso8601Dates))throw new E("options.iso8601Dates is required.");return Yr.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)};Yr.fromIso8601DurationArray=function(e,t){if(!c(e))throw new E("options is required.");if(!c(e.epoch))throw new E("options.epoch is required.");if(!c(e.iso8601Durations))throw new E("options.iso8601Durations is required.");let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,l=i.length;for(let u=0;u<l;++u)(jfe(i[u],eN)||u===0)&&(o&&c(a)?s=Aq(a,eN):s=Aq(n,eN),r.push(s),a=s);return Yr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Xr=Yr;function n$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 l=i.get(a);c(l.data)&&r.indexOf(l.data)===-1&&t.add(l.data.definitionChanged,o)}}function Jx(){this._eventHelper=new gr,this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(Jx.prototype._intervalsChanged,this)}Object.defineProperties(Jx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var i$e=new Q;Jx.prototype.getValue=function(e,t){c(e)||(e=Q.now(i$e));let n=this._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};Jx.prototype.equals=function(e){return this===e||e instanceof Jx&&this._intervals.equals(e._intervals,X.equals)};Jx.prototype._intervalsChanged=function(){n$e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Sc=Jx;function Xy(){this._definitionChanged=new pe,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Xy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Xy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Xy.prototype.getType=function(e){if(!c(e))throw new E("time is required");let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(t))return t.getType(e)};var o$e=new Q;Xy.prototype.getValue=function(e,t){c(e)||(e=Q.now(o$e));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};Xy.prototype.equals=function(e){return this===e||e instanceof Xy&&this._composite.equals(e._composite,X.equals)};Xy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var VE=Xy;function Ky(e){this._referenceFrame=e??Hi.FIXED,this._definitionChanged=new pe,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Ky.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Ky.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 r$e=new Q;Ky.prototype.getValue=function(e,t){return c(e)||(e=Q.now(r$e)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};Ky.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(i))return i.getValueInReferenceFrame(e,t,n)};Ky.prototype.equals=function(e){return this===e||e instanceof Ky&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};Ky.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ba=Ky;var s$e={ROUNDED:0,MITERED:1,BEVELED:2},Bi=Object.freeze(s$e);var xa=[new d,new d],a$e=new d,c$e=new d,l$e=new d,u$e=new d,f$e=new d,d$e=new d,h$e=new d,m$e=new d,p$e=new d,zE=new d,e4=new d,tN={},Eq=new he;function _$e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Eq=t.cartesianToCartographic(o,Eq),n[i]=Eq.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Sq(e,t,n,i){let o=e[0],r=e[1],s=d.angleBetween(o,r),a=Math.ceil(s/i),l=new Array(a),u;if(t===n){for(u=0;u<a;u++)l[u]=t;return l.push(n),l}let h=(n-t)/a;for(u=1;u<a;u++){let p=t+u*h;l[u]=p}return l[0]=t,l.push(n),l}var t4=new d,n4=new d;function g$e(e,t,n,i){let o=new ns(n,i),r=o.projectPointOntoPlane(d.add(n,e,t4),t4),s=o.projectPointOntoPlane(d.add(n,t,n4),n4),a=H.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var y$e=new d(-1,0,0),eT=new B,b$e=new B,wq=new J,x$e=J.IDENTITY.clone(),T$e=new d,A$e=new se,Wfe=new d;function U_(e,t,n,i,o,r,s,a){let l=T$e,u=A$e;eT=Ot.eastNorthUpToFixedFrame(e,o,eT),l=B.multiplyByPointAsVector(eT,y$e,l),l=d.normalize(l,l);let f=g$e(l,t,e,o);wq=J.fromRotationZ(f,wq),Wfe.z=r,eT=B.multiplyTransformation(eT,B.fromRotationTranslation(wq,Wfe,b$e),eT);let h=x$e;h[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=d.fromArray(n,g,u),u=J.multiplyByVector(h,u,u),u=B.multiplyByPoint(eT,u,u),i.push(u.x,u.y,u.z);return i}var C$e=new d;function vq(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let l=d.fromArray(e,a,C$e);i=U_(l,t,n,i,o,r[a/3],s,1)}return i}function E$e(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 l=1;l<n;l++){a=e[l];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function qfe(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 Yfe=new Le,Xfe=new d,Kfe=new J;function $fe(e,t,n,i,o,r,s,a,l,u){let f=d.angleBetween(d.subtract(t,e,zE),d.subtract(n,e,e4)),h=i===Bi.BEVELED?0:Math.ceil(f/O.toRadians(5)),p;o?p=J.fromQuaternion(Le.fromAxisAngle(d.negate(e,zE),f/(h+1),Yfe),Kfe):p=J.fromQuaternion(Le.fromAxisAngle(e,f/(h+1),Yfe),Kfe);let g,m;if(t=d.clone(t,Xfe),h>0){let y=u?2:1;for(let b=0;b<h;b++)t=J.multiplyByVector(p,t,t),g=d.subtract(t,e,zE),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(t,e4),s=U_(m,g,a,s,r,l,1,y)}else g=d.subtract(t,e,zE),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(t,e4),s=U_(m,g,a,s,r,l,1,1),n=d.clone(n,Xfe),g=d.subtract(n,e,zE),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(n,e4),s=U_(m,g,a,s,r,l,1,1);return s}tN.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];H.equals(r,s)||n.push(s)}return n};tN.angleIsGreaterThanPi=function(e,t,n,i){let o=new ns(n,i),r=o.projectPointOntoPlane(d.add(n,e,t4),t4),s=o.projectPointOntoPlane(d.add(n,t,n4),n4);return s.x*r.y-s.y*r.x>=0};var S$e=new d,w$e=new d;tN.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=_$e(e,r),a=i._granularity,l=i._cornerType,u=o?E$e(t,n):qfe(t,n),f=o?qfe(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,m=[],y=o?[]:void 0,b=a$e,x=c$e,A=l$e,C=u$e,S=f$e,v=d$e,P=h$e,M=m$e,R=p$e,L=e[0],F=e[1];C=r.geodeticSurfaceNormal(L,C),b=d.subtract(F,L,b),b=d.normalize(b,b),M=d.cross(C,b,M),M=d.normalize(M,M);let _=s[0],w=s[1];o&&(y=U_(L,M,f,y,r,_+h,1,1)),R=d.clone(L,R),L=F,x=d.negate(b,x);let D,I;for(let z=1;z<g-1;z++){let V=o?2:1;if(F=e[z+1],L.equals(F)){dt("Positions are too close and are considered equivalent with rounding error.");continue}b=d.subtract(F,L,b),b=d.normalize(b,b),C=r.geodeticSurfaceNormal(L,C);let j=d.multiplyByScalar(C,d.dot(b,C),S$e);d.subtract(b,j,j),d.normalize(j,j);let U=d.multiplyByScalar(C,d.dot(x,C),w$e);if(d.subtract(x,U,U),d.normalize(U,U),!O.equalsEpsilon(Math.abs(d.dot(j,U)),1,O.EPSILON7)){A=d.add(b,x,A),A=d.normalize(A,A),A=d.cross(A,C,A),A=d.cross(C,A,A),A=d.normalize(A,A);let Y=1/Math.max(.25,d.magnitude(d.cross(A,x,zE))),te=tN.angleIsGreaterThanPi(b,x,L,r);te?(S=d.add(L,d.multiplyByScalar(A,Y*p,A),S),v=d.add(S,d.multiplyByScalar(M,p,v),v),xa[0]=d.clone(R,xa[0]),xa[1]=d.clone(v,xa[1]),D=Sq(xa,_+h,w+h,a),I=Fi.generateArc({positions:xa,granularity:a,ellipsoid:r}),m=vq(I,M,u,m,r,D,1),M=d.cross(C,b,M),M=d.normalize(M,M),P=d.add(S,d.multiplyByScalar(M,p,P),P),l===Bi.ROUNDED||l===Bi.BEVELED?$fe(S,v,P,l,te,r,m,u,w+h,o):(A=d.negate(A,A),m=U_(L,A,u,m,r,w+h,Y,V)),R=d.clone(P,R)):(S=d.add(L,d.multiplyByScalar(A,Y*p,A),S),v=d.add(S,d.multiplyByScalar(M,-p,v),v),xa[0]=d.clone(R,xa[0]),xa[1]=d.clone(v,xa[1]),D=Sq(xa,_+h,w+h,a),I=Fi.generateArc({positions:xa,granularity:a,ellipsoid:r}),m=vq(I,M,u,m,r,D,1),M=d.cross(C,b,M),M=d.normalize(M,M),P=d.add(S,d.multiplyByScalar(M,-p,P),P),l===Bi.ROUNDED||l===Bi.BEVELED?$fe(S,v,P,l,te,r,m,u,w+h,o):m=U_(L,A,u,m,r,w+h,Y,V),R=d.clone(P,R)),x=d.negate(b,x)}else m=U_(R,M,u,m,r,_+h,1,1),R=L;_=w,w=s[z+1],L=F}xa[0]=d.clone(R,xa[0]),xa[1]=d.clone(L,xa[1]),D=Sq(xa,_+h,w+h,a),I=Fi.generateArc({positions:xa,granularity:a,ellipsoid:r}),m=vq(I,M,u,m,r,D,1),o&&(y=U_(L,M,f,y,r,w+h,1,1)),g=m.length;let N=o?g+y.length:g,k=new Float64Array(N);return k.set(m),o&&k.set(y,g),k};var yh=tN;var Pq={},HE=new d,tde=new d,v$e=new d,Zfe=new d,sl=[new d,new d],nde=new d,ide=new d,ode=new d,D$e=new d,P$e=new d,I$e=new d,O$e=new d,R$e=new d,M$e=new d,L$e=new d,Qfe=new Le,Jfe=new J;function i4(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,HE),d.subtract(n,e,tde)),s=i===Bi.BEVELED?1:Math.ceil(r/O.toRadians(5))+1,a=s*3,l=new Array(a);l[a-3]=n.x,l[a-2]=n.y,l[a-1]=n.z;let u;o?u=J.fromQuaternion(Le.fromAxisAngle(d.negate(e,HE),r/s,Qfe),Jfe):u=J.fromQuaternion(Le.fromAxisAngle(e,r/s,Qfe),Jfe);let f=0;t=d.clone(t,HE);for(let h=0;h<s;h++)t=J.multiplyByVector(u,t,t),l[f++]=t.x,l[f++]=t.y,l[f++]=t.z;return l}function N$e(e){let t=nde,n=ide,i=ode,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=i4(t,n,i,Bi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=d.fromArray(a,a.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let l=i4(t,n,i,Bi.ROUNDED,!1);return[r,l]}function ede(e,t,n,i){let o=HE;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function Dq(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=d.multiplyByScalar(t,n,HE),a=d.negate(s,tde),l=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,v$e),p=d.add(h,a,Zfe);o[l++]=p.x,o[l++]=p.y,o[l++]=p.z;let g=d.add(h,s,Zfe);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}Pq.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;c(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),c(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var F$e=new d,B$e=new d;Pq.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=nde,l=ide,u=ode,f=D$e,h=P$e,p=I$e,g=O$e,m=R$e,y=M$e,b=L$e,x=[],A=s?[]:void 0,C=s?[]:void 0,S=n[0],v=n[1];l=d.normalize(d.subtract(v,S,l),l),a=i.geodeticSurfaceNormal(S,a),f=d.normalize(d.cross(a,l,f),f),s&&(A.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),g=d.clone(S,g),S=v,u=d.negate(l,u);let P,M=[],R,L=n.length;for(R=1;R<L-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],l=d.normalize(d.subtract(v,S,l),l);let _=d.multiplyByScalar(a,d.dot(l,a),F$e);d.subtract(l,_,_),d.normalize(_,_);let w=d.multiplyByScalar(a,d.dot(u,a),B$e);if(d.subtract(u,w,w),d.normalize(w,w),!O.equalsEpsilon(Math.abs(d.dot(_,w)),1,O.EPSILON7)){h=d.normalize(d.add(l,u,h),h),h=d.cross(h,a,h),h=d.cross(a,h,h),h=d.normalize(h,h);let I=o/Math.max(.25,d.magnitude(d.cross(h,u,HE))),N=yh.angleIsGreaterThanPi(l,u,S,i);h=d.multiplyByScalar(h,I,h),N?(m=d.add(S,h,m),b=d.add(m,d.multiplyByScalar(f,o,b),b),y=d.add(m,d.multiplyByScalar(f,o*2,y),y),sl[0]=d.clone(g,sl[0]),sl[1]=d.clone(b,sl[1]),P=Fi.generateArc({positions:sl,granularity:t,ellipsoid:i}),x=Dq(P,f,o,x),s&&(A.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),p=d.clone(y,p),f=d.normalize(d.cross(a,l,f),f),y=d.add(m,d.multiplyByScalar(f,o*2,y),y),g=d.add(m,d.multiplyByScalar(f,o,g),g),r===Bi.ROUNDED||r===Bi.BEVELED?M.push({leftPositions:i4(m,p,y,r,N)}):M.push({leftPositions:ede(S,d.negate(h,h),y,N)})):(y=d.add(S,h,y),b=d.add(y,d.negate(d.multiplyByScalar(f,o,b),b),b),m=d.add(y,d.negate(d.multiplyByScalar(f,o*2,m),m),m),sl[0]=d.clone(g,sl[0]),sl[1]=d.clone(b,sl[1]),P=Fi.generateArc({positions:sl,granularity:t,ellipsoid:i}),x=Dq(P,f,o,x),s&&(A.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z)),p=d.clone(m,p),f=d.normalize(d.cross(a,l,f),f),m=d.add(y,d.negate(d.multiplyByScalar(f,o*2,m),m),m),g=d.add(y,d.negate(d.multiplyByScalar(f,o,g),g),g),r===Bi.ROUNDED||r===Bi.BEVELED?M.push({rightPositions:i4(y,p,m,r,N)}):M.push({rightPositions:ede(S,h,m,N)})),u=d.negate(l,u)}S=v}a=i.geodeticSurfaceNormal(S,a),sl[0]=d.clone(g,sl[0]),sl[1]=d.clone(S,sl[1]),P=Fi.generateArc({positions:sl,granularity:t,ellipsoid:i}),x=Dq(P,f,o,x),s&&(A.push(f.x,f.y,f.z),C.push(a.x,a.y,a.z));let F;return r===Bi.ROUNDED&&(F=N$e(x)),{positions:x,corners:M,lefts:A,normals:C,endPositions:F}};var Wi=Pq;var ade=new d,cde=new d,o4=new d,r4=new d,k$e=new d,lde=new d,$y=new d,GE=new d;function ude(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function bh(e,t,n,i,o,r){let s=e.normals,a=e.tangents,l=e.bitangents,u=d.normalize(d.cross(n,t,$y),$y);r.normal&&Wi.addAttribute(s,t,i,o),r.tangent&&Wi.addAttribute(a,u,i,o),r.bitangent&&Wi.addAttribute(l,n,i,o)}function fde(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,l=new fn,u,f=0,h=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let ee=o[p].leftPositions;c(ee)?(m=ee.length,f+=m,g+=m):(m=o[p].rightPositions.length,h+=m,g+=m)}let y=c(r),b;y&&(b=r[0].length-3,f+=b,h+=b,b/=3,g+=b*6);let x=f+h,A=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,S=t.tangent?new Float32Array(x):void 0,v=t.bitangent?new Float32Array(x):void 0,P={normals:C,tangents:S,bitangents:v},M=0,R=x-1,L,F,_,w,D=ade,I=cde,N,k,z=b/2,V=Fe.createTypedArray(x/3,g),j=0;if(y){k=o4,N=r4;let ee=r[0];for(D=d.fromArray(a,0,D),I=d.fromArray(s,0,I),p=0;p<z;p++)k=d.fromArray(ee,(z-1-p)*3,k),N=d.fromArray(ee,(z+p)*3,N),Wi.addAttribute(A,N,M),Wi.addAttribute(A,k,void 0,R),bh(P,D,I,M,R,t),F=M/3,w=F+1,L=(R-2)/3,_=L-1,V[j++]=L,V[j++]=F,V[j++]=_,V[j++]=_,V[j++]=F,V[j++]=w,M+=3,R-=3}let U=0,q=0,Y=i[U++],te=i[U++];A.set(Y,M),A.set(te,R-te.length+1),I=d.fromArray(s,q,I);let K,Z;for(m=te.length-3,p=0;p<m;p+=3)K=n.geodeticSurfaceNormal(d.fromArray(Y,p,$y),$y),Z=n.geodeticSurfaceNormal(d.fromArray(te,m-p,GE),GE),D=d.normalize(d.add(K,Z,D),D),bh(P,D,I,M,R,t),F=M/3,w=F+1,L=(R-2)/3,_=L-1,V[j++]=L,V[j++]=F,V[j++]=_,V[j++]=_,V[j++]=F,V[j++]=w,M+=3,R-=3;for(K=n.geodeticSurfaceNormal(d.fromArray(Y,m,$y),$y),Z=n.geodeticSurfaceNormal(d.fromArray(te,m,GE),GE),D=d.normalize(d.add(K,Z,D),D),q+=3,p=0;p<o.length;p++){let ee;u=o[p];let me=u.leftPositions,Te=u.rightPositions,ue,ye,Ae=lde,Pe=o4,Ee=r4;if(D=d.fromArray(a,q,D),c(me)){for(bh(P,D,I,void 0,R,t),R-=3,ue=w,ye=_,ee=0;ee<me.length/3;ee++)Ae=d.fromArray(me,ee*3,Ae),V[j++]=ue,V[j++]=ye-ee-1,V[j++]=ye-ee,Wi.addAttribute(A,Ae,void 0,R),Pe=d.fromArray(A,(ye-ee-1)*3,Pe),Ee=d.fromArray(A,ue*3,Ee),I=d.normalize(d.subtract(Pe,Ee,I),I),bh(P,D,I,void 0,R,t),R-=3;Ae=d.fromArray(A,ue*3,Ae),Pe=d.subtract(d.fromArray(A,ye*3,Pe),Ae,Pe),Ee=d.subtract(d.fromArray(A,(ye-ee)*3,Ee),Ae,Ee),I=d.normalize(d.add(Pe,Ee,I),I),bh(P,D,I,M,void 0,t),M+=3}else{for(bh(P,D,I,M,void 0,t),M+=3,ue=_,ye=w,ee=0;ee<Te.length/3;ee++)Ae=d.fromArray(Te,ee*3,Ae),V[j++]=ue,V[j++]=ye+ee,V[j++]=ye+ee+1,Wi.addAttribute(A,Ae,M),Pe=d.fromArray(A,ue*3,Pe),Ee=d.fromArray(A,(ye+ee)*3,Ee),I=d.normalize(d.subtract(Pe,Ee,I),I),bh(P,D,I,M,void 0,t),M+=3;Ae=d.fromArray(A,ue*3,Ae),Pe=d.subtract(d.fromArray(A,(ye+ee)*3,Pe),Ae,Pe),Ee=d.subtract(d.fromArray(A,ye*3,Ee),Ae,Ee),I=d.normalize(d.negate(d.add(Ee,Pe,I),I),I),bh(P,D,I,void 0,R,t),R-=3}for(Y=i[U++],te=i[U++],Y.splice(0,3),te.splice(te.length-3,3),A.set(Y,M),A.set(te,R-te.length+1),m=te.length-3,q+=3,I=d.fromArray(s,q,I),ee=0;ee<te.length;ee+=3)K=n.geodeticSurfaceNormal(d.fromArray(Y,ee,$y),$y),Z=n.geodeticSurfaceNormal(d.fromArray(te,m-ee,GE),GE),D=d.normalize(d.add(K,Z,D),D),bh(P,D,I,M,R,t),w=M/3,F=w-1,_=(R-2)/3,L=_+1,V[j++]=L,V[j++]=F,V[j++]=_,V[j++]=_,V[j++]=F,V[j++]=w,M+=3,R-=3;M-=3,R+=3}if(D=d.fromArray(a,a.length-3,D),bh(P,D,I,M,R,t),y){M+=3,R-=3,k=o4,N=r4;let ee=r[1];for(p=0;p<z;p++)k=d.fromArray(ee,(b-p-1)*3,k),N=d.fromArray(ee,p*3,N),Wi.addAttribute(A,k,void 0,R),Wi.addAttribute(A,N,M),bh(P,D,I,M,R,t),w=M/3,F=w-1,_=(R-2)/3,L=_+1,V[j++]=L,V[j++]=F,V[j++]=_,V[j++]=_,V[j++]=F,V[j++]=w,M+=3,R-=3}if(l.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:A}),t.st){let ee=new Float32Array(x/3*2),me,Te,ue=0;if(y){f/=3,h/=3;let ye=Math.PI/(b+1);Te=1/(f-b+1),me=1/(h-b+1);let Ae,Pe=b/2;for(p=Pe+1;p<b+1;p++)Ae=O.PI_OVER_TWO+ye*p,ee[ue++]=me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=1;p<h-b+1;p++)ee[ue++]=p*me,ee[ue++]=0;for(p=b;p>Pe;p--)Ae=O.PI_OVER_TWO-p*ye,ee[ue++]=1-me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=Pe;p>0;p--)Ae=O.PI_OVER_TWO-ye*p,ee[ue++]=1-Te*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=f-b;p>0;p--)ee[ue++]=p*Te,ee[ue++]=1;for(p=1;p<Pe+1;p++)Ae=O.PI_OVER_TWO+ye*p,ee[ue++]=Te*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae))}else{for(f/=3,h/=3,Te=1/(f-1),me=1/(h-1),p=0;p<h;p++)ee[ue++]=p*me,ee[ue++]=0;for(p=f;p>0;p--)ee[ue++]=(p-1)*Te,ee[ue++]=1}l.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(l.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.normals})),t.tangent&&(l.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.tangents})),t.bitangent&&(l.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.bitangents})),{attributes:l,indices:V}}function U$e(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,l=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=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=ade,m=cde,y=o4,b=r4,x=k$e,A=lde,C=l;for(u=0;u<s;u+=3){let S=C+l;g=d.fromArray(n,u,g),m=d.fromArray(n,u+s,m),y=d.fromArray(n,(u+3)%s,y),m=d.subtract(m,g,m),y=d.subtract(y,g,y),b=d.normalize(d.cross(m,y,b),b),t.normal&&(Wi.addAttribute(f,b,S),Wi.addAttribute(f,b,S+3),Wi.addAttribute(f,b,C),Wi.addAttribute(f,b,C+3)),(t.tangent||t.bitangent)&&(A=d.fromArray(i,u,A),t.bitangent&&(Wi.addAttribute(p,A,S),Wi.addAttribute(p,A,S+3),Wi.addAttribute(p,A,C),Wi.addAttribute(p,A,C+3)),t.tangent&&(x=d.normalize(d.cross(A,b,x),x),Wi.addAttribute(h,x,S),Wi.addAttribute(h,x,S+3),Wi.addAttribute(h,x,C),Wi.addAttribute(h,x,C+3))),C+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}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 S=e.tangent.values;h.set(S),h.set(S,s),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(a*6);h.set(f),h.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];h[p++]=m,h[p++]=y,h[p++]=m,h[p++]=y}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function Iq(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 V$e(e,t){let n=new Ie({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=Wi.computePositions(e),r=fde(o,n,i),s=e.height,a=e.extrudedHeight,l=r.attributes,u=r.indices,f=l.position.values,h=f.length,p=new Float64Array(h*6),g=new Float64Array(h);g.set(f);let m=new Float64Array(h*4);f=si.scaleToGeodeticHeight(f,s,i),m=Iq(f,0,m),g=si.scaleToGeodeticHeight(g,a,i),m=Iq(g,h*2,m),p.set(f),p.set(g,h),p.set(m,h*2),l.position.values=p,l=U$e(l,t);let y,b=h/3;if(e.shadowVolume){let L=l.normal.values;h=L.length;let F=new Float32Array(h*6);for(y=0;y<h;y++)L[y]=-L[y];F.set(L,h),F=Iq(L,h*4,F),l.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:F}),t.normal||(l.normal=void 0)}if(c(e.offsetAttribute)){let L=new Uint8Array(b*6);if(e.offsetAttribute===Zt.TOP)L=L.fill(1,0,b).fill(1,b*2,b*4);else{let F=e.offsetAttribute===Zt.NONE?0:1;L=L.fill(F)}l.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let x=u.length,A=b+b,C=Fe.createTypedArray(p.length/3,x*2+A*3);C.set(u);let S=x;for(y=0;y<x;y+=3){let L=u[y],F=u[y+1],_=u[y+2];C[S++]=_+b,C[S++]=F+b,C[S++]=L+b}let v,P,M,R;for(y=0;y<A;y+=2)v=y+A,P=v+A,M=v+1,R=P+1,C[S++]=v,C[S++]=P,C[S++]=M,C[S++]=M,C[S++]=P,C[S++]=R;return{attributes:l,indices:C}}var rde=new d,nN=new d,Jf=new he;function sde(e,t,n,i,o,r){let s=d.subtract(t,e,rde);d.normalize(s,s);let a=n.geodeticSurfaceNormal(e,nN),l=d.cross(s,a,rde);d.multiplyByScalar(l,i,l);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,l,nN),n.cartesianToCartographic(nN,Jf);let g=Jf.latitude,m=Jf.longitude;u=Math.min(u,g),f=Math.min(f,m),h=Math.max(h,g),p=Math.max(p,m),d.subtract(e,l,nN),n.cartesianToCartographic(nN,Jf),g=Jf.latitude,m=Jf.longitude,u=Math.min(u,g),f=Math.min(f,m),h=Math.max(h,g),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var Qf=new d,iN=new d,Xl=new he,Kl=new he;function dde(e,t,n,i,o){e=ude(e,t);let r=xo(e,d.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ce;let a=n*.5;Xl.latitude=Number.POSITIVE_INFINITY,Xl.longitude=Number.POSITIVE_INFINITY,Kl.latitude=Number.NEGATIVE_INFINITY,Kl.longitude=Number.NEGATIVE_INFINITY;let l,u;if(i===Bi.ROUNDED){let p=r[0];d.subtract(p,r[1],Qf),d.normalize(Qf,Qf),d.multiplyByScalar(Qf,a,Qf),d.add(p,Qf,iN),t.cartesianToCartographic(iN,Jf),l=Jf.latitude,u=Jf.longitude,Xl.latitude=Math.min(Xl.latitude,l),Xl.longitude=Math.min(Xl.longitude,u),Kl.latitude=Math.max(Kl.latitude,l),Kl.longitude=Math.max(Kl.longitude,u)}for(let p=0;p<s-1;++p)sde(r[p],r[p+1],t,a,Xl,Kl);let f=r[s-1];d.subtract(f,r[s-2],Qf),d.normalize(Qf,Qf),d.multiplyByScalar(Qf,a,Qf),d.add(f,Qf,iN),sde(f,iN,t,a,Xl,Kl),i===Bi.ROUNDED&&(t.cartesianToCartographic(iN,Jf),l=Jf.latitude,u=Jf.longitude,Xl.latitude=Math.min(Xl.latitude,l),Xl.longitude=Math.min(Xl.longitude,u),Kl.latitude=Math.max(Kl.latitude,l),Kl.longitude=Math.max(Kl.longitude,u));let h=c(o)?o:new ce;return h.north=Kl.latitude,h.south=Xl.latitude,h.east=Kl.longitude,h.west=Xl.longitude,h}function z_(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.width;T.defined("options.positions",t),T.defined("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Bi.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+ie.packedLength+Ie.packedLength+7}z_.pack=function(e,t,n){T.defined("value",e),T.defined("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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]=e._offsetAttribute??-1,t};var hde=ie.clone(ie.UNIT_SPHERE),mde=new Ie,V_={positions:void 0,ellipsoid:hde,vertexFormat:mde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};z_.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=ie.unpack(e,t,hde);t+=ie.packedLength;let s=Ie.unpack(e,t,mde);t+=Ie.packedLength;let a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,g=e[t];return c(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=l,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(V_.positions=o,V_.width=a,V_.height=l,V_.extrudedHeight=u,V_.cornerType=f,V_.granularity=h,V_.shadowVolume=p,V_.offsetAttribute=g===-1?void 0:g,new z_(V_))};z_.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.positions,i=e.width;T.defined("options.positions",n),T.defined("options.width",i);let o=e.ellipsoid??ie.default,r=e.cornerType??Bi.ROUNDED;return dde(n,o,i,r,t)};z_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=ude(t,i);let o=xo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!O.equalsEpsilon(r,s,0,O.EPSILON2),l=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=V$e(u,l);else{let g=Wi.computePositions(u);if(f=fde(g,l,i),f.attributes.position.values=si.scaleToGeodeticHeight(f.attributes.position.values,r,i),c(e._offsetAttribute)){let m=e._offsetAttribute===Zt.NONE?0:1,y=f.attributes.position.values.length,b=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let h=f.attributes,p=le.fromVertices(h.position.values,void 0,3);return l.position||(f.attributes.position.values=void 0),new ct({attributes:h,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};z_.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new z_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(z_.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=dde(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var tT=z_;var pde=new d,_de=new d,z$e=new d;function H$e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function gde(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new fn,a,l=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,l+=p,h+=p/3*4,u+=i[f+1].length-3;for(l+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;c(N)?(p=N.length,l+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let g=c(r),m;g&&(m=r[0].length-3,l+=m,u+=m,m/=3,h+=m*4);let y=l+u,b=new Float64Array(y),x=0,A=y-1,C,S,v,P,M,R,L=m/2,F=Fe.createTypedArray(y/3,h+4),_=0;if(F[_++]=x/3,F[_++]=(A-2)/3,g){n.push(x/3),R=pde,M=_de;let N=r[0];for(f=0;f<L;f++)R=d.fromArray(N,(L-1-f)*3,R),M=d.fromArray(N,(L+f)*3,M),Wi.addAttribute(b,M,x),Wi.addAttribute(b,R,void 0,A),S=x/3,P=S+1,C=(A-2)/3,v=C-1,F[_++]=C,F[_++]=v,F[_++]=S,F[_++]=P,x+=3,A-=3}let w=0,D=i[w++],I=i[w++];for(b.set(D,x),b.set(I,A-I.length+1),p=I.length-3,n.push(x/3,(A-2)/3),f=0;f<p;f+=3)S=x/3,P=S+1,C=(A-2)/3,v=C-1,F[_++]=C,F[_++]=v,F[_++]=S,F[_++]=P,x+=3,A-=3;for(f=0;f<o.length;f++){let N;a=o[f];let k=a.leftPositions,z=a.rightPositions,V,j=z$e;if(c(k)){for(A-=3,V=v,n.push(P),N=0;N<k.length/3;N++)j=d.fromArray(k,N*3,j),F[_++]=V-N-1,F[_++]=V-N,Wi.addAttribute(b,j,void 0,A),A-=3;n.push(V-Math.floor(k.length/6)),t===Bi.BEVELED&&n.push((A-2)/3+1),x+=3}else{for(x+=3,V=P,n.push(v),N=0;N<z.length/3;N++)j=d.fromArray(z,N*3,j),F[_++]=V+N,F[_++]=V+N+1,Wi.addAttribute(b,j,x),x+=3;n.push(V+Math.floor(z.length/6)),t===Bi.BEVELED&&n.push(x/3-1),A-=3}for(D=i[w++],I=i[w++],D.splice(0,3),I.splice(I.length-3,3),b.set(D,x),b.set(I,A-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)P=x/3,S=P-1,v=(A-2)/3,C=v+1,F[_++]=C,F[_++]=v,F[_++]=S,F[_++]=P,x+=3,A-=3;x-=3,A+=3,n.push(x/3,(A-2)/3)}if(g){x+=3,A-=3,R=pde,M=_de;let N=r[1];for(f=0;f<L;f++)R=d.fromArray(N,(m-f-1)*3,R),M=d.fromArray(N,f*3,M),Wi.addAttribute(b,R,void 0,A),Wi.addAttribute(b,M,x),P=x/3,S=P-1,v=(A-2)/3,C=v+1,F[_++]=C,F[_++]=v,F[_++]=S,F[_++]=P,x+=3,A-=3;n.push(x/3)}else n.push(x/3,(A-2)/3);return F[_++]=x/3,F[_++]=(A-2)/3,s.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:F,wallIndices:n}}function G$e(e){let t=e.ellipsoid,n=Wi.computePositions(e),i=gde(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,l=i.indices,u=a.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=si.scaleToGeodeticHeight(u,r,t),h=si.scaleToGeodeticHeight(h,s,t),p.set(u),p.set(h,f),a.position.values=p,f/=3,c(e.offsetAttribute)){let C=new Uint8Array(f*2);if(e.offsetAttribute===Zt.TOP)C=C.fill(1,0,f);else{let S=e.offsetAttribute===Zt.NONE?0:1;C=C.fill(S)}a.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:C})}let g,m=l.length,y=Fe.createTypedArray(p.length/3,(m+o.length)*2);y.set(l);let b=m;for(g=0;g<m;g+=2){let C=l[g],S=l[g+1];y[b++]=C+f,y[b++]=S+f}let x,A;for(g=0;g<o.length;g++)x=o[g],A=x+f,y[b++]=x,y[b++]=A;return{attributes:a,indices:y}}function oN(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.width;T.typeOf.object("options.positions",t),T.typeOf.number("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Bi.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+ie.packedLength+6}oN.pack=function(e,t,n){T.typeOf.object("value",e),T.typeOf.object("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var yde=ie.clone(ie.UNIT_SPHERE),Zy={positions:void 0,ellipsoid:yde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};oN.unpack=function(e,t,n){T.typeOf.object("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=ie.unpack(e,t,yde);t+=ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t];return c(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=l,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(Zy.positions=o,Zy.width=s,Zy.height=a,Zy.extrudedHeight=l,Zy.cornerType=u,Zy.granularity=f,Zy.offsetAttribute=h===-1?void 0:h,new oN(Zy))};oN.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=H$e(t,i);let o=xo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!O.equalsEpsilon(r,s,0,O.EPSILON2),l={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)l.height=r,l.extrudedHeight=s,l.offsetAttribute=e._offsetAttribute,u=G$e(l);else{let p=Wi.computePositions(l);if(u=gde(p,l.cornerType),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,r,i),c(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===Zt.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,h=le.fromVertices(f.position.values,void 0,3);return new ct({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var rN=oN;var j$e=new Kn(0);function al(e){ii.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}c(Object.create)&&(al.prototype=Object.create(ii.prototype),al.prototype.constructor=al);Object.defineProperties(al.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});al.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!c(t.height)&&!c(t.extrudedHeight)&&jc.isSupported(this._scene)};al.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||c(n)&&n!==t};al.prototype._computeCenter=E.throwInstantiationError;al.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(o.zIndex)&&(c(o.height)||c(o.extrudedHeight))&&dt(dt.geometryZIndex),this._zIndex=o.zIndex??j$e,c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(c(r)||c(s)){let a=new Wd(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new $b(this._scene,a,r,s)}};al.prototype.destroy=function(){c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ii.prototype.destroy.call(this)};al.getGeometryHeight=function(e,t){if(T.defined("heightReference",t),!c(e)){t!==We.NONE&&dt(dt.geometryHeightReference);return}return Df(t)?0:e};al.getGeometryExtrudedHeight=function(e,t){if(T.defined("extrudedHeightReference",t),!c(e)){t!==We.NONE&&dt(dt.geometryExtrudedHeightReference);return}return Df(t)?al.CLAMP_TO_GROUND:e};al.CLAMP_TO_GROUND="clamp";al.computeGeometryOffsetAttribute=function(e,t,n,i){(!c(e)||!c(t))&&(t=We.NONE),(!c(n)||!c(i))&&(i=We.NONE);let o=0;if(t!==We.NONE&&o++,i===We.RELATIVE_TO_GROUND&&o++,o===2)return Zt.ALL;if(o===1)return Zt.TOP};var Gn=al;var bde=new G,xde=d.ZERO,Tde=new d,Ade=new ce;function W$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 xh(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new W$e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}c(Object.create)&&(xh.prototype=Object.create(Gn.prototype),xh.prototype.constructor=xh);xh.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,bde)),c(o)||(o=G.WHITE),i.color=Gt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,xde,Tde))),new St({id:t,geometry:new tT(this._options),attributes:i})};xh.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,bde),o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return c(this._options.offsetAttribute)&&(o.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,xde,Tde))),new St({id:t,geometry:new rN(this._options),attributes:o})};xh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!c(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};xh.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.width)||ii.prototype._isHidden.call(this,e,t)};xh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};xh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,We.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(tT.computeRectangle(s,Ade)).minimumTerrainHeight),s.extrudedHeight=o};xh.DynamicGeometryUpdater=jE;function jE(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(jE.prototype=Object.create(ni.prototype),jE.prototype.constructor=jE);jE.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.positions)||!c(i.width)||ni.prototype._isHidden.call(this,e,t,n)};jE.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);c(s)&&!c(o)&&(o=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(tT.computeRectangle(i,Ade)).minimumTerrainHeight),i.extrudedHeight=s};var sN=xh;function s4(){E.throwInstantiationError()}Object.defineProperties(s4.prototype,{name:{get:E.throwInstantiationError},clock:{get:E.throwInstantiationError},entities:{get:E.throwInstantiationError},isLoading:{get:E.throwInstantiationError},changedEvent:{get:E.throwInstantiationError},errorEvent:{get:E.throwInstantiationError},loadingEvent:{get:E.throwInstantiationError},show:{get:E.throwInstantiationError},clustering:{get:E.throwInstantiationError}});s4.prototype.update=function(e){E.throwInstantiationError()};s4.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Kr=s4;function Nm(e,t){T.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,c(t)&&(this.cameraPosition=t)}Object.defineProperties(Nm.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=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Cde=new d;Nm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Cde);return Rq(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Nm.prototype.isScaledSpacePointVisible=function(e){return Rq(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var q$e=new d;Nm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return c(t)&&t<0&&n.minimumRadius>-t?(o=q$e,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),Rq(e,o,i)};Nm.prototype.computeHorizonCullingPoint=function(e,t,n){return wde(this._ellipsoid,e,t,n)};var Ede=ie.clone(ie.UNIT_SPHERE);Nm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Sde(this._ellipsoid,n,Ede);return wde(o,e,t,i)};Nm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return vde(this._ellipsoid,e,t,n,i,o)};Nm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Sde(this._ellipsoid,o,Ede);return vde(s,e,t,n,i,r)};var Y$e=[];Nm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){T.typeOf.object("rectangle",e);let i=ce.subsample(e,t,0,Y$e),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var X$e=new d;function Sde(e,t,n){if(c(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,X$e);e=ie.fromCartesian3(i,n)}return e}function wde(e,t,n,i){T.typeOf.object("directionToPoint",t),T.defined("positions",n),c(i)||(i=new d);let o=Ide(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let l=n[s],u=Dde(e,l,o);if(u<0)return;r=Math.max(r,u)}return Pde(o,r,i)}var a4=new d;function vde(e,t,n,i,o,r){T.typeOf.object("directionToPoint",t),T.defined("vertices",n),T.typeOf.number("stride",i),c(r)||(r=new d),i=i??3,o=o??d.ZERO;let s=Ide(e,t),a=0;for(let l=0,u=n.length;l<u;l+=i){a4.x=n[l]+o.x,a4.y=n[l+1]+o.y,a4.z=n[l+2]+o.z;let f=Dde(e,a4,s);if(f<0)return;a=Math.max(a,f)}return Pde(s,a,r)}function Rq(e,t,n){let i=t,o=n,r=d.subtract(e,i,Cde),s=-d.dot(r,i);return!(o<0?s>0:s>o&&s*s/d.magnitudeSquared(r)>o)}var K$e=new d,$$e=new d;function Dde(e,t,n){let i=e.transformPositionToScaledSpace(t,K$e),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,$$e);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),l=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-l*f)}function Pde(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var Oq=new d;function Ide(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,Oq),d.normalize(Oq,Oq))}var H_=Nm;function Rr(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new E("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new E("scaleByDistance.far must be greater than scaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new E("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=Mt.clone(o)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=G.clone(e.color??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Vr.NONE}var Ode=Rr.SHOW_INDEX=0,Lde=Rr.POSITION_INDEX=1,Z$e=Rr.COLOR_INDEX=2,Q$e=Rr.OUTLINE_COLOR_INDEX=3,J$e=Rr.OUTLINE_WIDTH_INDEX=4,eZe=Rr.PIXEL_SIZE_INDEX=5,tZe=Rr.SCALE_BY_DISTANCE_INDEX=6,nZe=Rr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,iZe=Rr.DISTANCE_DISPLAY_CONDITION_INDEX=8,oZe=Rr.DISABLE_DEPTH_DISTANCE_INDEX=9,rZe=Rr.SPLIT_DIRECTION_INDEX=10;Rr.NUMBER_OF_PROPERTIES=11;function Fu(e,t){let n=e._pointPrimitiveCollection;c(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Rr.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new E("value is required.");this._show!==e&&(this._show=e,Fu(this,Ode))}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new E("value is required.");let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),Fu(this,Lde))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Fu(this,tZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Fu(this,nZe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!c(e))throw new E("value is required.");this._pixelSize!==e&&(this._pixelSize=e,Fu(this,eZe))}},color:{get:function(){return this._color},set:function(e){if(!c(e))throw new E("value is required.");let t=this._color;G.equals(t,e)||(G.clone(e,t),Fu(this,Z$e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new E("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Fu(this,Q$e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new E("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Fu(this,J$e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new E("far must be greater than near");Mt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Mt.clone(e,this._distanceDisplayCondition),Fu(this,iZe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!c(e)||e<0)throw new E("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,Fu(this,oZe)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(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,Fu(this,Ode))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Fu(this,rZe))}}});Rr.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Rr.prototype._getActualPosition=function(){return this._actualPosition};Rr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),Fu(this,Lde)};var Rde=new se;Rr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(B.multiplyByPoint(n,e,Rde),Gi.computeActualEllipsoidPosition(t,Rde))};var Mde=new se;Rr._computeScreenSpacePosition=function(e,t,n,i){let o=B.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Mde),Mde);return Gi.worldToWindowCoordinates(n,o,i)};Rr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;if(c(t)||(t=new H),!c(n))throw new E("PointPrimitive must be in a collection.");if(!c(e))throw new E("scene is required.");let i=n.modelMatrix,o=Rr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(c(o))return o.y=e.canvas.clientHeight-o.y,o};Rr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,l=i;return c(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=l,n};Rr.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.equals(this._position,e._position)&&G.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&G.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Mt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Rr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Os=Rr;var Qy=`in vec4 v_color; +- ${s[a]}`;r+=s.length}else i+=` +Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function cxt(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:lne(e.debugPickedTile),a=une(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];une(a,e,lne(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&une(a,e,lne(a))}}e._tileDebugLabels.update(t)}function lxt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new li({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ge.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),ixt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new h0),cxt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var hwe=[],uxt=[];function mwe(e,t){let n=t,i=hwe;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(mxt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function pwe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function i5(e,t){let n=e-t;return n<0?n+tb.maximumFrameNumber:n}var fxt=64;function dxt(e,t,n){let i=uxt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Rr.LOADING||o===Rr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Rr.UNLOADED&&o!==Rr.FAILED||l(r.cacheNode)||Math.min(i5(t,r._visitedFrame),i5(t,r._touchedFrame),i5(t,r._selectedFrame),i5(t,r._requestedFrame))<n)return i.length=0,!0;let c=r.children;for(let u=0;u<c.length;++u)i.push(c[u])}return!1}function hxt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<fxt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,u=n[c];if(u.isDestroyed()||!u.hasTilesetContent||u.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!dxt(u,i,r)&&(mwe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function mxt(e,t){e._cache.unloadTile(e,t,pwe),t.destroy()}lo.prototype.trimLoadedTiles=function(){this._cache.trim()};function pxt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Um.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!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 gxt(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 _xt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!N.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=N.clone(e.modelMatrix,e._previousModelMatrix)))}function yxt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,gxt(e),_xt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Zbt(e),lxt(e,t,i),Um.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return o}function gwe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(It.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new It(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}lo.prototype.getTraversal=function(e){let{pass:t}=e;return t===ao.MOST_DETAILED_PRELOAD||t===ao.MOST_DETAILED_PICK?e3:this.isSkippingLevelOfDetail?s3:i3};lo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};lo.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===ao.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===ao.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===ao.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=ao.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,s.isRender){let d=this._environmentMapManager;l(this._root)&&(d.position=this.boundingSphere.center),d.update(e)}let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=yxt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};lo.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=hwe;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,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,ue(this)};lo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};lo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!lo.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Axt=new pn,bxt=new h,xxt=new h,Txt=new he;lo.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=Axt,r=n.cartographicToCartesian(e,bxt),o=n.geodeticSurfaceNormal(r,i.direction);i.origin=h.add(r,h.multiplyByScalar(o,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(o,i.direction);let s=this.pick(i,t.frameState,xxt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,Txt)?.height};lo.prototype.updateHeight=function(e,t,n){n=n??ee.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,s=o.length;for(let a=0;a<s;++a)if(o[a]===i){o.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var Ext=new h;lo.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let r=this._selectedTiles,o=r.length,s=[],a=e.origin.x,c=e.origin.y,u=e.origin.z,f=e.direction.x,d=e.direction.y,p=e.direction.z,g=f*f+d*d+p*p;for(let b=0;b<o;++b){let x=r[b];if(l(i)&&x.geometricError>i||!l(x.content))continue;let T=x.contentBoundingVolume.boundingSphere,E=T.center,v=a-E.x,S=c-E.y,I=u-E.z,R=2*(f*v+d*S+p*I),O=v*v+S*S+I*I-T.radius*T.radius;R*R-4*g*O<0||s.push(x)}let m=s.length,y,A=Number.POSITIVE_INFINITY;for(let b=0;b<m;++b){let T=s[b].content.pick(e,t,Ext);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};lo.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};lo.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var Ko=lo;var Cxt=new N;function nb(e,t){t.collectionChanged.addEventListener(nb.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}nb.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,Cxt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],vxt(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};nb.prototype.isDestroyed=function(){return!1};nb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(nb.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)fne(this,e[i],t,n);return ue(this)};nb.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Pt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ce.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};nb.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(fne(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],fne(this,o,a,c),s.remove(o.id)};function fne(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function vxt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Ko.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var a3=nb;var Sxt=z.WHITE,wxt=z.BLACK,Ixt=new U(2,2);function Hw(e){e=e??H.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(Hw.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});Hw.prototype.getType=function(e){return"Checkerboard"};var Pxt=new K;Hw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Pxt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,Sxt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,wxt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,Ixt),t};Hw.prototype.equals=function(e){return this===e||e instanceof Hw&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var Gw=Hw;var _we={id:void 0};function c3(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 r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function Al(e){this._owner=e,this._entities=new Ut,this._addedEntities=new Ut,this._removedEntities=new Ut,this._changedEntities=new Ut,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}Al.prototype.suspendEvents=function(){this._suspendCount++};Al.prototype.resumeEvents=function(){this._suspendCount--,c3(this)};Object.defineProperties(Al.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,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Al.prototype.computeAvailability=function(){let e=nt.MAXIMUM_VALUE,t=nt.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;K.lessThan(a,e)&&!a.equals(nt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(nt.MAXIMUM_VALUE)&&(t=c)}}return nt.MAXIMUM_VALUE.equals(e)&&(e=nt.MINIMUM_VALUE),nt.MINIMUM_VALUE.equals(t)&&(t=nt.MAXIMUM_VALUE),new Cn({start:e,stop:t})};Al.prototype.add=function(e){e instanceof Qr||(e=new Qr(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(Al.prototype._onEntityDefinitionChanged,this),c3(this),e};Al.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Al.prototype.contains=function(e){return this._entities.get(e.id)===e};Al.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(Al.prototype._onEntityDefinitionChanged,this),c3(this),!0):!1};Al.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(Al.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),c3(this)};Al.prototype.getById=function(e){return this._entities.get(e)};Al.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(_we.id=e,t=new Qr(_we),this.add(t)),t};Al.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),c3(this)};var Ka=Al;var r5={id:void 0},Ww=new Array(2);function dne(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 ywe(e,t,n,i){Ww[0]=n,Ww[1]=i.id,t[JSON.stringify(Ww)]=i.definitionChanged.addEventListener(Os.prototype._onDefinitionChanged,e)}function Awe(e,t,n,i){Ww[0]=n,Ww[1]=i.id;let r=JSON.stringify(Ww);t[r](),t[r]=void 0}function ib(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Ka(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(Os.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],Awe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(Os.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],ywe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?dne(y):(r5.id=s.id,y=new Qr(r5)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function Os(e,t){this._owner=t,this._composite=new Ka(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},ib(this),this._shouldRecomposite=!1}Object.defineProperties(Os.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}}});Os.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),ib(this)};Os.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),ib(this),!0):!1};Os.prototype.removeAllCollections=function(){this._collections.length=0,ib(this)};Os.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Os.prototype.contains=function(e){return this._composite.contains(e)};Os.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Os.prototype.getCollection=function(e){return this._collections[e]};Os.prototype.getCollectionsLength=function(){return this._collections.length};function o5(e,t){return e.indexOf(t)}function bwe(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,ib(e)}Os.prototype.raiseCollection=function(e){let t=o5(this._collections,e);bwe(this,t,t+1)};Os.prototype.lowerCollection=function(e){let t=o5(this._collections,e);bwe(this,t,t-1)};Os.prototype.raiseCollectionToTop=function(e){let t=o5(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),ib(this))};Os.prototype.lowerCollectionToBottom=function(e){let t=o5(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),ib(this))};Os.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Os.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(ib(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Os.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Os.prototype.getById=function(e){return this._composite.getById(e)};Os.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Awe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),dne(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];ywe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?dne(u):(r5.id=y,u=new Qr(r5),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};Os.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var hne=Os;function Dxt(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function CE(){this._eventHelper=new Go,this._definitionChanged=new be,this._intervals=new vs,this._intervals.changedEvent.addEventListener(CE.prototype._intervalsChanged,this)}Object.defineProperties(CE.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Rxt=new K;CE.prototype.getValue=function(e,t){l(e)||(e=K.now(Rxt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};CE.prototype.equals=function(e){return this===e||e instanceof CE&&this._intervals.equals(e._intervals,X.equals)};CE.prototype._intervalsChanged=function(){Dxt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var bl=CE;function rb(){this._definitionChanged=new be,this._composite=new bl,this._composite.definitionChanged.addEventListener(rb.prototype._raiseDefinitionChanged,this)}Object.defineProperties(rb.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});rb.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Oxt=new K;rb.prototype.getValue=function(e,t){l(e)||(e=K.now(Oxt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};rb.prototype.equals=function(e){return this===e||e instanceof rb&&this._composite.equals(e._composite,X.equals)};rb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var qw=rb;function ob(e){this._referenceFrame=e??ji.FIXED,this._definitionChanged=new be,this._composite=new bl,this._composite.definitionChanged.addEventListener(ob.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ob.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 Mxt=new K;ob.prototype.getValue=function(e,t){return l(e)||(e=K.now(Mxt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};ob.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};ob.prototype.equals=function(e){return this===e||e instanceof ob&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};ob.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var _c=ob;var Nxt=new _i(0);function du(e){Pi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(du.prototype=Object.create(Pi.prototype),du.prototype.constructor=du);Object.defineProperties(du.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});du.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&tu.isSupported(this._scene)};du.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};du.prototype._computeCenter=pe.throwInstantiationError;du.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Pi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&_t(_t.geometryZIndex),this._zIndex=r.zIndex??Nxt,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new _m(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new LT(this._scene,a,o,s)}};du.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Pi.prototype.destroy.call(this)};du.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryHeightReference);return}return Ss(t)?0:e};du.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryExtrudedHeightReference);return}return Ss(t)?du.CLAMP_TO_GROUND:e};du.CLAMP_TO_GROUND="clamp";du.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return mn.ALL;if(r===1)return mn.TOP};var ii=du;var xwe=new z,Twe=h.ZERO,Ewe=new h,Cwe=new ie;function Lxt(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 zm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Lxt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(zm.prototype=Object.create(ii.prototype),zm.prototype.constructor=zm);zm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,xwe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Twe,Ewe))),new Ft({id:t,geometry:new Hx(this._options),attributes:i})};zm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,xwe),r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Twe,Ewe))),new Ft({id:t,geometry:new FM(this._options),attributes:r})};zm.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};zm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Pi.prototype._isHidden.call(this,e,t)};zm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};zm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,nt.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),s.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Mi.getMinimumMaximumHeights(Hx.computeRectangle(s,Cwe)).minimumTerrainHeight),s.extrudedHeight=r};zm.DynamicGeometryUpdater=Yw;function Yw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Yw.prototype=Object.create(Ii.prototype),Yw.prototype.constructor=Yw);Yw.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ii.prototype._isHidden.call(this,e,t,n)};Yw.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(Hx.computeRectangle(i,Cwe)).minimumTerrainHeight),i.extrudedHeight=s};var l3=zm;function s5(){pe.throwInstantiationError()}Object.defineProperties(s5.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}});s5.prototype.update=function(e){pe.throwInstantiationError()};s5.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ms=s5;function ls(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=Ht.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??qo.NONE}var vwe=ls.SHOW_INDEX=0,Iwe=ls.POSITION_INDEX=1,Fxt=ls.COLOR_INDEX=2,Bxt=ls.OUTLINE_COLOR_INDEX=3,kxt=ls.OUTLINE_WIDTH_INDEX=4,Uxt=ls.PIXEL_SIZE_INDEX=5,zxt=ls.SCALE_BY_DISTANCE_INDEX=6,Vxt=ls.TRANSLUCENCY_BY_DISTANCE_INDEX=7,jxt=ls.DISTANCE_DISPLAY_CONDITION_INDEX=8,Hxt=ls.DISABLE_DEPTH_DISTANCE_INDEX=9,Gxt=ls.SPLIT_DIRECTION_INDEX=10;ls.NUMBER_OF_PROPERTIES=11;function Qf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ls.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Qf(this,vwe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Qf(this,Iwe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Qf(this,zxt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Qf(this,Vxt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Qf(this,Uxt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Qf(this,Fxt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Qf(this,Bxt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Qf(this,kxt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Qf(this,jxt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Qf(this,Hxt))}},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,Qf(this,vwe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Qf(this,Gxt))}}});ls.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};ls.prototype._getActualPosition=function(){return this._actualPosition};ls.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Qf(this,Iwe)};var Swe=new se;ls._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(N.multiplyByPoint(n,e,Swe),hr.computeActualEllipsoidPosition(t,Swe))};var wwe=new se;ls._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,wwe),wwe);return hr.worldToWindowCoordinates(n,r,i)};ls.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=ls._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};ls.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new et),n.x=o,n.y=s,n.width=a,n.height=c,n};ls.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};ls.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Pa=ls;var sb=`in vec4 v_color; in vec4 v_outlineColor; in float v_innerPercent; in float v_pixelDistance; @@ -6016,7 +7857,7 @@ discard; out_FragColor = czm_gammaCorrect(color); czm_writeLogDepth(); } -`;var aN=`uniform float u_maxTotalPointSize; +`;var u3=`uniform float u_maxTotalPointSize; in vec4 positionHighAndSize; in vec4 positionLowAndOutline; in vec4 compressedAttribute0; @@ -6049,32 +7890,13 @@ 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; -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); -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); -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); -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 color = czm_decodeRGB8(compressedAttribute0.x); +vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y); +vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z); +vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w); +color.a = alphaPacked.x; +outlineColor.a = alphaPacked.y; +pickColor.a = alphaPacked.z; 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) @@ -6147,2482 +7969,1435 @@ gl_Position *= show; v_pickColor = pickColor; v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var sZe=Os.SHOW_INDEX,Nq=Os.POSITION_INDEX,Nde=Os.COLOR_INDEX,aZe=Os.OUTLINE_COLOR_INDEX,cZe=Os.OUTLINE_WIDTH_INDEX,lZe=Os.PIXEL_SIZE_INDEX,Fde=Os.SCALE_BY_DISTANCE_INDEX,Bde=Os.TRANSLUCENCY_BY_DISTANCE_INDEX,kde=Os.DISTANCE_DISPLAY_CONDITION_INDEX,uZe=Os.DISABLE_DEPTH_DISTANCE_INDEX,fZe=Os.SPLIT_DIRECTION_INDEX,Fq=Os.NUMBER_OF_PROPERTIES,wc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ed(e){e=e??W.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(Fq),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=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??wo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ed.prototype,{length:{get:function(){return Bq(this),this._pointPrimitives.length}}});function Ude(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ed.prototype.add=function(e){let t=new Os(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ed.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ed.prototype.removeAll=function(){Ude(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Bq(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}}ed.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ed.prototype.contains=function(e){return c(e)&&e._pointPrimitiveCollection===this};ed.prototype.get=function(e){if(!c(e))throw new E("index is required.");return Bq(this),this._pointPrimitives[e]};ed.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Fq;++i){let o=n[i]===0?Be.STATIC_DRAW:Be.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function dZe(e,t,n){return new Mp(e,[{index:wc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Nq]},{index:wc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Nq]},{index:wc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Nde]},{index:wc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Bde]},{index:wc.scaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Fde]},{index:wc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[kde]}],t)}var Mq=new Hn;function Vde(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),Hn.fromCartesian(r,Mq);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let l=n[wc.positionHighAndSize],u=Mq.high;l(o,u.x,u.y,u.z,s);let f=n[wc.positionLowAndOutline],h=Mq.low;f(o,h.x,h.y,h.z,a)}var c4=65536,cN=256;function zde(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,l=G.floatToByte(r.red),u=G.floatToByte(r.green),f=G.floatToByte(r.blue),h=l*c4+u*cN+f;l=G.floatToByte(a.red),u=G.floatToByte(a.green),f=G.floatToByte(a.blue);let p=l*c4+u*cN+f;l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue);let g=l*c4+u*cN+f,m=G.floatToByte(r.alpha)*c4+G.floatToByte(a.alpha)*cN+G.floatToByte(s.alpha),y=n[wc.compressedAttribute0];y(o,h,p,g,m)}function Hde(e,t,n,i){let o=i._index,r=0,s=1,a=1,l=1,u=i.translucencyByDistance;c(u)&&(r=u.near,s=u.nearValue,a=u.far,l=u.farValue,(s!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=O.clamp(s,0,1),s=s===1?255:s*255|0;let h=(f?1:0)*cN+s;l=O.clamp(l,0,1),l=l===1?255:l*255|0;let p=l,g=n[wc.compressedAttribute1];g(o,h,p,r,a)}function Gde(e,t,n,i){let o=i._index,r=n[wc.scaleByDistance],s=0,a=1,l=1,u=1,f=i.scaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,l,u)}function jde(e,t,n,i){let o=i._index,r=n[wc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;c(h)&&(f=h),r(o,s,a,u,f)}function hZe(e,t,n,i){Vde(e,t,n,i),zde(e,t,n,i),Hde(e,t,n,i),Gde(e,t,n,i),jde(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 l=0;l<n;++l){let u=t[l],f=u.position,h=Os._computeActualPosition(f,i,o);c(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function mZe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!B.equals(r,e.modelMatrix)?(e._mode=n,B.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 pZe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var _Ze=[];ed.prototype.update=function(e){if(Bq(this),!this.show)return;this._maxTotalPointSize=ut.maximumAliasedPointSize,mZe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,l=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<Fq;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=dZe(l,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let P=this._pointPrimitives[v];P._dirty=!1,hZe(this,l,a,P)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=_Ze;v.length=0,(r[Nq]||r[cZe]||r[lZe])&&v.push(Vde),(r[Nde]||r[aZe])&&v.push(zde),(r[sZe]||r[Bde])&&v.push(Hde),r[Fde]&&v.push(Gde),(r[kde]||r[uZe]||r[fZe])&&v.push(jde);let P=v.length;if(a=this._vaf.writers,o/n>.1){for(let M=0;M<o;++M){let R=i[M];R._dirty=!1;for(let L=0;L<P;++L)v[L](this,l,a,R)}this._vaf.commit()}else{for(let M=0;M<o;++M){let R=i[M];R._dirty=!1;for(let L=0;L<P;++L)v[L](this,l,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=B.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),pZe(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===wo.OPAQUE||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===wo.TRANSLUCENT||this._blendOption===wo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:ln.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new He({sources:[aN]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===wo.OPAQUE_AND_TRANSLUCENT&&(y=new He({defines:["OPAQUE"],sources:[Qy]}),this._sp=Jt.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc}),y=new He({defines:["TRANSLUCENT"],sources:[Qy]}),this._spTranslucent=Jt.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc})),this._blendOption===wo.OPAQUE&&(y=new He({sources:[Qy]}),this._sp=Jt.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc})),this._blendOption===wo.TRANSLUCENT&&(y=new He({sources:[Qy]}),this._spTranslucent=Jt.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:wc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,x,A,C,S=e.commandList;if(u.render||f){let v=this._colorCommands,P=this._blendOption===wo.OPAQUE,M=this._blendOption===wo.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,x=b.length,v.length=x;let R=M?x*2:x;for(C=0;C<R;++C){let L=P||M&&C%2===0;A=v[C],c(A)||(A=v[C]=new Qe),A.primitiveType=Me.POINTS,A.pass=L||!M?De.OPAQUE:De.TRANSLUCENT,A.owner=this;let F=M?Math.floor(C/2):C;A.boundingVolume=h,A.modelMatrix=p,A.shaderProgram=L?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=b[F].va,A.renderState=L?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",S.push(A)}}};ed.prototype.isDestroyed=function(){return!1};ed.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(),Ude(this._pointPrimitives),de(this)};var WE=ed;var Wde=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],kq=1,lN=8,fN=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!==kq)throw new Error(`Got v${o} data when expected v${kq}.`);let r=Wde[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=Wde.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(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,lN,t),this.coords=new this.ArrayType(this.data,lN+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(lN+s+a+l),this.ids=new this.IndexArrayType(this.data,lN,t),this.coords=new this.ArrayType(this.data,lN+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(kq<<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 Vq(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,l=[0,r.length-1,0],u=[];for(;l.length;){let f=l.pop()||0,h=l.pop()||0,p=l.pop()||0;if(h-p<=a){for(let b=p;b<=h;b++){let x=s[2*b],A=s[2*b+1];x>=t&&x<=i&&A>=n&&A<=o&&u.push(r[b])}continue}let g=p+h>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=o&&u.push(r[g]),(f===0?t<=m:n<=y)&&(l.push(p),l.push(g-1),l.push(1-f)),(f===0?i>=m:o>=y)&&(l.push(g+1),l.push(h),l.push(1-f))}return u}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],l=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let b=p;b<=h;b++)qde(r[2*b],r[2*b+1],t,n)<=u&&l.push(o[b]);continue}let g=p+h>>1,m=r[2*g],y=r[2*g+1];qde(m,y,t,n)<=u&&l.push(o[g]),(f===0?t-i<=m:n-i<=y)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=m:n+i>=y)&&(a.push(g+1),a.push(h),a.push(1-f))}return l}};function Vq(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Yde(e,t,s,i,o,r),Vq(e,t,n,i,s-1,1-r),Vq(e,t,n,s+1,o,1-r)}function Yde(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(o,Math.floor(n+(u-f)*p/u+g));Yde(e,t,n,m,y,r)}let s=t[2*n+r],a=i,l=o;for(uN(e,t,i,n),t[2*o+r]>s&&uN(e,t,i,o);a<l;){for(uN(e,t,a,l),a++,l--;t[2*a+r]<s;)a++;for(;t[2*l+r]>s;)l--}t[2*i+r]===s?uN(e,t,i,l):(l++,uN(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function uN(e,t,n,i){Uq(e,n,i),Uq(t,2*n,2*i),Uq(t,2*n+1,2*i+1)}function Uq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function qde(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Th(e){e=e??W.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 pe,this.show=e.show??!0}function Xde(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var gZe=new Ke;function Kde(e,t,n,i,o){if(c(e._labelCollection)&&i._clusterLabels?o=Uy.getScreenSpaceBoundingBox(e,t,o):c(e._billboardCollection)&&i._clusterBillboards?o=lo.getScreenSpaceBoundingBox(e,t,o):c(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Os.getScreenSpaceBoundingBox(e,t,o)),Xde(o,n),i._clusterLabels&&!c(e._labelCollection)&&c(e.id)&&Zde(i,e.id.id)&&c(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Uy.getScreenSpaceBoundingBox(s,t,gZe);Xde(a,n),o=Ke.union(o,a,o)}return o}function yZe(e,t){if(e.clusterShow=!0,!c(e._labelCollection)&&c(e.id)&&Zde(t,e.id.id)&&c(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function $de(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 Zde(e,t){return c(e)&&c(e._collectionIndicesByEntity[t])&&c(e._collectionIndicesByEntity[t].labelIndex)}function zq(e,t,n,i,o){if(!c(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 l=o._clusterLabels&&c(a._labelCollection),u=o._clusterBillboards&&c(a.id._billboard),f=o._clusterPoints&&c(a.id._point);if(l&&(f||u))continue;let h=a.computeScreenSpacePosition(n);c(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var bZe=new Ke,xZe=new Ke,TZe=new Ke;function AZe(e){return function(t){if(c(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!c(i)&&!c(o)&&!c(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,l=e._clusterPointCollection;c(s)?s.removeAll():s=e._clusterLabelCollection=new Om({scene:n}),c(a)?a.removeAll():a=e._clusterBillboardCollection=new Ru({scene:n}),c(l)?l.removeAll():l=e._clusterPointCollection=new WE;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,b=n.camera.positionWC,x=new H_(y,b),A=[];e._clusterLabels&&zq(i,A,n,x,e),e._clusterBillboards&&zq(o,A,n,x,e),e._clusterPoints&&zq(r,A,n,x,e);let C,S,v,P,M,R,L,F,_,w,D,I;if(A.length>0){let N=new fN(A.length,64,Uint32Array);for(let k=0;k<A.length;++k)N.add(A[k].coord.x,A[k].coord.y);if(N.finish(),m<g)for(v=h.length,C=0;C<v;++C){let k=h[C];if(!x.isPointVisible(k.position))continue;let z=lo._computeScreenSpacePosition(B.IDENTITY,k.position,d.ZERO,H.ZERO,n);if(!c(z))continue;let V=1-m/g,j=k.width=k.width*V,U=k.height=k.height*V;j=Math.max(j,k.minimumWidth),U=Math.max(U,k.minimumHeight);let q=z.x-j*.5,Y=z.y-U*.5,te=z.x+j,K=z.y+U;for(M=N.range(q,Y,te,K),R=M.length,w=0,_=[],S=0;S<R;++S)L=M[S],F=A[L],F.clustered||(++w,D=F.collection,I=F.index,_.push(D.get(I).id));if(w>=f)for($de(k.position,w,_,e),p.push(k),S=0;S<R;++S)A[M[S]].clustered=!0}for(v=A.length,C=0;C<v;++C){let k=A[C];if(k.clustered)continue;k.clustered=!0,D=k.collection,I=k.index;let z=D.get(I);P=Kde(z,k.coord,u,e,bZe);let V=Ke.clone(P,xZe);M=N.range(P.x,P.y,P.x+P.width,P.y+P.height),R=M.length;let j=d.clone(z.position);for(w=1,_=[z.id],S=0;S<R;++S)if(L=M[S],F=A[L],!F.clustered){let U=F.collection.get(F.index),q=Kde(U,F.coord,u,e,TZe);d.add(U.position,j,j),Ke.union(V,q,V),++w,_.push(U.id)}if(w>=f){let U=d.multiplyByScalar(j,1/w,j);for($de(U,w,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:P.width,minimumHeight:P.height}),S=0;S<R;++S)A[M[S]].clustered=!0}else yZe(z,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Th.prototype._initialize=function(e){this._scene=e;let t=AZe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Th.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&&(!c(this._billboardCollection)||this._billboardCollection.ready)&&(!c(this._labelCollection)||this._labelCollection.ready)}}});function Gq(e,t,n,i){return function(o){let r=this[e];c(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(c(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),c(r)&&c(s[i]))return r.get(s[i]);c(r)||(r=this[e]=new t({scene:this._scene}));let a,l,u=this[n];u.length>0?(a=u.shift(),l=r.get(a)):(l=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),l}}function jq(e,t){let n=e._collectionIndicesByEntity[t];!c(n.billboardIndex)&&!c(n.labelIndex)&&!c(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Th.prototype.getLabel=Gq("_labelCollection",Om,"_unusedLabelIndices","labelIndex");Th.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._labelCollection)||!c(t)||!c(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,jq(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};Th.prototype.getBillboard=Gq("_billboardCollection",Ru,"_unusedBillboardIndices","billboardIndex");Th.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._billboardCollection)||!c(t)||!c(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,jq(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};Th.prototype.getPoint=Gq("_pointCollection",WE,"_unusedPointIndices","pointIndex");Th.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._pointCollection)||!c(t)||!c(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,jq(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Hq(e){if(!c(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function CZe(e){e.enabled||(c(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),c(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),c(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,Hq(e._labelCollection),Hq(e._billboardCollection),Hq(e._pointCollection))}Th.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;c(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;c(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,CZe(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=c(n)&&!n.ready||c(i)&&!i.ready),c(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),c(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),c(this._clusterPointCollection)&&this._clusterPointCollection.update(e),c(n)&&n.update(e),c(i)&&i.update(e),c(this._pointCollection)&&this._pointCollection.update(e)};Th.prototype.destroy=function(){c(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 Bu=Th;function Wq(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new Qs(this),this._entityCluster=new Bu}Object.defineProperties(Wq.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){Kr.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){if(!c(e))throw new E("value must be defined.");this._entityCluster=e}}});Wq.prototype.update=function(e){return!0};var dN=Wq;var Qde={};Qde.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,l=o?2*a:a,u=new Float64Array(l*3),f,h=0,p=0,g=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*O.TWO_PI,b=Math.cos(y),x=Math.sin(y),A=b*n,C=x*n,S=b*t,v=x*t;u[p+g]=A,u[p+g+1]=C,u[p+g+2]=s,u[p+m]=S,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[h++]=A,u[h++]=C,u[h++]=s,u[h++]=S,u[h++]=v,u[h++]=r)}return u};var nT=Qde;var qq=new H,EZe=new d,SZe=new d,wZe=new d,vZe=new d;function G_(e){e=e??W.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Ie.DEFAULT,r=e.slices??128;if(!c(t))throw new E("options.length must be defined.");if(!c(n))throw new E("options.topRadius must be defined.");if(!c(i))throw new E("options.bottomRadius must be defined.");if(r<3)throw new E("options.slices must be greater than or equal to 3.");if(c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}G_.packedLength=Ie.packedLength+5;G_.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Jde=new Ie,qE={vertexFormat:Jde,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};G_.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i=Ie.unpack(e,t,Jde);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=l===-1?void 0:l,n):(qE.length=o,qE.topRadius=r,qE.bottomRadius=s,qE.slices=a,qE.offsetAttribute=l===-1?void 0:l,new G_(qE))};G_.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,l=s+s,u=nT.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(l*2):void 0,h=o.normal?new Float32Array(l*3):void 0,p=o.tangent?new Float32Array(l*3):void 0,g=o.bitangent?new Float32Array(l*3):void 0,m,y=o.normal||o.tangent||o.bitangent;if(y){let M=o.tangent||o.bitangent,R=0,L=0,F=0,_=Math.atan2(i-n,t),w=EZe;w.z=Math.sin(_);let D=Math.cos(_),I=wZe,N=SZe;for(m=0;m<r;m++){let k=m/r*O.TWO_PI,z=D*Math.cos(k),V=D*Math.sin(k);y&&(w.x=z,w.y=V,M&&(I=d.normalize(d.cross(d.UNIT_Z,w,I),I)),o.normal&&(h[R++]=w.x,h[R++]=w.y,h[R++]=w.z,h[R++]=w.x,h[R++]=w.y,h[R++]=w.z),o.tangent&&(p[L++]=I.x,p[L++]=I.y,p[L++]=I.z,p[L++]=I.x,p[L++]=I.y,p[L++]=I.z),o.bitangent&&(N=d.normalize(d.cross(w,I,N),N),g[F++]=N.x,g[F++]=N.y,g[F++]=N.z,g[F++]=N.x,g[F++]=N.y,g[F++]=N.z))}for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=-1),o.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),o.bitangent&&(g[F++]=0,g[F++]=-1,g[F++]=0);for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=1),o.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),o.bitangent&&(g[F++]=0,g[F++]=1,g[F++]=0)}let b=12*r-12,x=Fe.createTypedArray(l,b),A=0,C=0;for(m=0;m<r-1;m++)x[A++]=C,x[A++]=C+2,x[A++]=C+3,x[A++]=C,x[A++]=C+3,x[A++]=C+1,C+=2;for(x[A++]=s-2,x[A++]=0,x[A++]=1,x[A++]=s-2,x[A++]=1,x[A++]=s-1,m=1;m<r-1;m++)x[A++]=s+m+1,x[A++]=s+m,x[A++]=s;for(m=1;m<r-1;m++)x[A++]=a,x[A++]=a+m,x[A++]=a+m+1;let S=0;if(o.st){let M=Math.max(n,i);for(m=0;m<l;m++){let R=d.fromArray(u,m*3,vZe);f[S++]=(R.x+M)/(2*M),f[S++]=(R.y+M)/(2*M)}}let v=new fn;o.position&&(v.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(v.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(v.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),qq.x=t*.5,qq.y=Math.max(i,n);let P=new le(d.ZERO,H.magnitude(qq));if(c(e._offsetAttribute)){t=u.length;let M=e._offsetAttribute===Zt.NONE?0:1,R=new Uint8Array(t/3).fill(M);v.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new ct({attributes:v,indices:x,primitiveType:Me.TRIANGLES,boundingSphere:P,offsetAttribute:e._offsetAttribute})};var Yq;G_.getUnitCylinder=function(){return c(Yq)||(Yq=G_.createGeometry(new G_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),Yq};var hN=G_;var Xq=new H;function YE(e){e=e??W.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);if(T.typeOf.number("options.positions",t),T.typeOf.number("options.topRadius",n),T.typeOf.number("options.bottomRadius",i),T.typeOf.number.greaterThanOrEquals("options.slices",o,3),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new E("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}YE.packedLength=6;YE.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var iT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};YE.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=l===-1?void 0:l,n):(iT.length=i,iT.topRadius=o,iT.bottomRadius=r,iT.slices=s,iT.numberOfVerticalLines=a,iT.offsetAttribute=l===-1?void 0:l,new YE(iT))};YE.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=nT.computePositions(t,n,i,o,!1),l=o*2,u;if(r>0){let y=Math.min(r,o);u=Math.round(o/y),l+=y}let f=Fe.createTypedArray(s,l*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let g=new fn;g.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:a}),Xq.x=t*.5,Xq.y=Math.max(i,n);let m=new le(d.ZERO,H.magnitude(Xq));if(c(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===Zt.NONE?0:1,b=new Uint8Array(t/3).fill(y);g.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new ct({attributes:g,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var mN=YE;var ehe=d.ZERO,the=new d,DZe=new d,nhe=new G;function PZe(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 ku(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new PZe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}c(Object.create)&&(ku.prototype=Object.create(ii.prototype),ku.prototype.constructor=ku);Object.defineProperties(ku.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ku.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,nhe)),c(a)||(a=G.WHITE),s.color=Gt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,ehe,the))),new St({id:t,geometry:new hN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};ku.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,nhe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,ehe,the))),new St({id:t,geometry:new mN(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};ku.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};ku.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.length)||!c(t.topRadius)||!c(t.bottomRadius)||ii.prototype._isHidden.call(this,e,t)};ku.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};ku.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?Zt.ALL:void 0};ku.prototype._onEntityPropertyChanged=qp;ku.DynamicGeometryUpdater=XE;function XE(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(XE.prototype=Object.create(ni.prototype),XE.prototype.constructor=XE);XE.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,DZe);return!c(o)||!c(i.length)||!c(i.topRadius)||!c(i.bottomRadius)||ni.prototype._isHidden.call(this,e,t,n)};XE.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),o=this._options;o.length=X.getValueOrUndefined(t.length,n),o.topRadius=X.getValueOrUndefined(t.topRadius,n),o.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),o.slices=X.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==We.NONE?Zt.ALL:void 0};var pN=ku;var IZe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},$r=Object.freeze(IZe);var OZe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},mo=Object.freeze(OZe);var RZe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3},cl=Object.freeze(RZe);var ihe=Zo(du(),1);function MZe(e){if(!c(e))throw new E("uri is required.");let t=new ihe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var j_=MZe;var LZe=O.factorial;function Kq(e,t,n,i,o,r){let s=0,a,l,u;if(i>0){for(l=0;l<o;l++){for(a=!1,u=0;u<r.length&&!a;u++)l===r[u]&&(a=!0);a||(r.push(l),s+=Kq(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,l=0;l<o;l++){for(a=!1,u=0;u<r.length&&!a;u++)l===r[u]&&(a=!0);a||(s*=e-n[t[l]])}return s}var l4={type:"Hermite"};l4.getRequiredDataPoints=function(e,t){if(t=t??0,!c(e))throw new E("degree is required.");if(e<0)throw new E("degree must be 0 or greater.");if(t<0)throw new E("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)};l4.interpolateOrderZero=function(e,t,n,i,o){c(o)||(o=new Array(i));let r,s,a,l,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(h);for(p[r]=b,s=0;s<h;s++)b[s]=[]}let g=h,m=new Array(g);for(r=0;r<g;r++)m[r]=r;let y=h-1;for(l=0;l<i;l++){for(s=0;s<g;s++)f=m[s]*i+l,p[l][0].push(n[f]);for(r=1;r<g;r++){let b=!1;for(s=0;s<g-r;s++){let x=t[m[s]],A=t[m[s+r]],C;A-x<=0?(f=m[s]*i+i*r+l,C=n[f],p[l][r].push(C/LZe(r))):(C=p[l][r-1][s+1]-p[l][r-1][s],p[l][r].push(C/(A-x))),b=b||C!==0}b||(y=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=y;r++){let b=Kq(e,m,t,a,r,[]);for(l=0;l<i;l++){let x=p[l][r][0];o[l+a*i]+=x*b}}return o};var NZe=[];l4.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);c(s)||(s=new Array(a));for(let x=0;x<a;x++)s[x]=0;let l=t.length,u=new Array(l*(o+1)),f;for(f=0;f<l;f++)for(let x=0;x<o+1;x++)u[f*(o+1)+x]=f;let h=u.length,p=NZe,g=FZe(p,u,t,n,i,o),m=[],y=h*(h+1)/2,b=Math.min(g,r);for(let x=0;x<=b;x++)for(f=x;f<=g;f++){m.length=0;let A=Kq(e,u,t,x,f,m),C=Math.floor(f*(1-f)/2)+h*f;for(let S=0;S<i;S++){let v=Math.floor(S*y),P=p[v+C];s[S+x*i]+=P*A}}return s};function FZe(e,t,n,i,o,r){let s,a,l=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let x=n[t[s]],A=n[t[s+g]],C,S;if(A-x<=0)a=t[s]*o*(r+1)+o*g+h,C=i[a],S=C/O.factorial(g),e[p+y+m]=S,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);C=e[p+v+s+1]-e[p+v+s],S=C/(A-x),e[p+y+m]=S,m++}b=b||C!==0}b&&(l=Math.max(l,g))}}return l}var _N=l4;var $q={type:"Lagrange"};$q.getRequiredDataPoints=function(e){return Math.max(e+1,2)};$q.interpolateOrderZero=function(e,t,n,i,o){c(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 l=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];l*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=l*n[r*i+s]}return o};var gN=$q;var Zq={type:"Linear"};Zq.getRequiredDataPoints=function(e){return 2};Zq.interpolateOrderZero=function(e,t,n,i,o){if(t.length!==2)throw new E("The xTable provided to the linear interpolator must have exactly two elements.");if(i<=0)throw new E("There must be at least 1 dependent variable for each independent variable.");c(o)||(o=new Array(i));let r,s,a,l=t[0],u=t[1];if(l===u)throw new E("Divide by zero error: xTable[0] and xTable[1] are equal");for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-l*a)/(u-l);return o};var Jy=Zq;function vc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}vc.fromCartesian3=function(e,t){T.typeOf.object("cartesian3",e);let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return c(t)||(t=new vc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};vc.clone=function(e,t){if(c(e))return c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new vc(e.clock,e.cone,e.magnitude)};vc.normalize=function(e,t){return T.typeOf.object("spherical",e),c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new vc(e.clock,e.cone,1)};vc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};vc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};vc.prototype.equals=function(e){return vc.equals(this,e)};vc.prototype.clone=function(e){return vc.clone(this,e)};vc.prototype.equalsEpsilon=function(e,t){return vc.equalsEpsilon(this,e,t)};vc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var yN=vc;var CN=Zo(du(),1);var Qq;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?Qq=function(){return performance.now()}:Qq=function(){return Date.now()};var Ti=Qq;function Jq(e){e=e??W.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;if(c(t)?t=Q.clone(t):c(n)?t=Q.clone(n):c(i)?t=Q.addDays(i,-1,new Q):t=Q.now(),c(n)?n=Q.clone(n):n=Q.clone(t),c(i)?i=Q.clone(i):i=Q.addDays(n,1,new Q),Q.greaterThan(n,i))throw new E("startTime must come before stopTime.");this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??$r.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new pe,this.onStop=new pe,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ti(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??mo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(Jq.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===mo.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===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Jq.prototype.tick=function(){let e=Ti(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===mo.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===mo.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===$r.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===$r.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 Ah=Jq;function oT(){this._definitionChanged=new pe,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(oT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Yc("startTime"),stopTime:Yc("stopTime"),currentTime:Yc("currentTime"),clockRange:Yc("clockRange"),clockStep:Yc("clockStep"),multiplier:Yc("multiplier")});oT.prototype.clone=function(e){return c(e)||(e=new oT),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};oT.prototype.equals=function(e){return this===e||c(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};oT.prototype.merge=function(e){if(!c(e))throw new E("source is required.");this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};oT.prototype.getValue=function(e){return c(e)||(e=new Ah),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Ch=oT;var BZe=G.WHITE,kZe=.1,UZe=new H(8,8),VZe=new H(0,0),zZe=new H(1,1);function KE(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(KE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),cellAlpha:fe("cellAlpha"),lineCount:fe("lineCount"),lineThickness:fe("lineThickness"),lineOffset:fe("lineOffset")});KE.prototype.getType=function(e){return"Grid"};var HZe=new Q;KE.prototype.getValue=function(e,t){return c(e)||(e=Q.now(HZe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,BZe,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,kZe),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,UZe,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,zZe,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,VZe,t.lineOffset),t};KE.prototype.equals=function(e){return this===e||e instanceof KE&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var $E=KE;function ZE(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(ZE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});ZE.prototype.getType=function(e){return"PolylineArrow"};var GZe=new Q;ZE.prototype.getValue=function(e,t){return c(e)||(e=Q.now(GZe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};ZE.prototype.equals=function(e){return this===e||e instanceof ZE&&X.equals(this._color,e._color)};var QE=ZE;var jZe=G.WHITE,WZe=G.TRANSPARENT,qZe=16,YZe=255;function JE(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(JE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),gapColor:fe("gapColor"),dashLength:fe("dashLength"),dashPattern:fe("dashPattern")});JE.prototype.getType=function(e){return"PolylineDash"};var XZe=new Q;JE.prototype.getValue=function(e,t){return c(e)||(e=Q.now(XZe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,jZe,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,WZe,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,qZe,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,YZe,t.dashPattern),t};JE.prototype.equals=function(e){return this===e||e instanceof JE&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var eS=JE;var KZe=G.WHITE,$Ze=.25,ZZe=1;function tS(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(tS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),glowPower:fe("glowPower"),taperPower:fe("taperPower")});tS.prototype.getType=function(e){return"PolylineGlow"};var QZe=new Q;tS.prototype.getValue=function(e,t){return c(e)||(e=Q.now(QZe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,KZe,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,$Ze,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,ZZe,t.taperPower),t};tS.prototype.equals=function(e){return this===e||e instanceof tS&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var nS=tS;var JZe=G.WHITE,eQe=G.BLACK,tQe=1;function iS(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(iS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth")});iS.prototype.getType=function(e){return"PolylineOutline"};var nQe=new Q;iS.prototype.getValue=function(e,t){return c(e)||(e=Q.now(nQe)),c(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,JZe,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,eQe,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,tQe),t};iS.prototype.equals=function(e){return this===e||e instanceof iS&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var e0=iS;function W_(e,t){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new gr,this._referenceFrame=t??Hi.FIXED,this.setValue(e)}Object.defineProperties(W_.prototype,{isConstant:{get:function(){let e=this._value;if(!c(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var iQe=new Q;W_.prototype.getValue=function(e,t){return c(e)||(e=Q.now(iQe)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};W_.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");let i=this._value;if(!c(i))return;let o=i.length;c(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let l=i[r].getValueInReferenceFrame(e,t,n[r]);c(l)&&(n[s]=l,s++),r++}return n.length=s,n};W_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,W_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};W_.prototype.equals=function(e){return this===e||e instanceof W_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};W_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var q_=W_;function t0(e){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new gr,this.setValue(e)}Object.defineProperties(t0.prototype,{isConstant:{get:function(){let e=this._value;if(!c(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var oQe=new Q;t0.prototype.getValue=function(e,t){c(e)||(e=Q.now(oQe));let n=this._value;if(!c(n))return;let i=n.length;c(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);c(a)&&(t[r]=a,r++),o++}return t.length=r,t};t0.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,t0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};t0.prototype.equals=function(e){return this===e||e instanceof t0&&X.arrayEquals(this._value,e._value)};t0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var oS=t0;function rT(e){let t=e._targetProperty;if(!c(t)){let n=e._targetEntity;if(!c(n)){if(n=e._targetCollection.getById(e._targetId),!c(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Uu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&c(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Uu(e,t,n){if(!c(e))throw new E("targetCollection is required.");if(!c(t)||t==="")throw new E("targetId is required.");if(!c(n)||n.length===0)throw new E("targetPropertyNames is required.");for(let i=0;i<n.length;i++){let o=n[i];if(!c(o)||o==="")throw new E("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new pe,e.collectionChanged.addEventListener(Uu.prototype._onCollectionChanged,this)}Object.defineProperties(Uu.prototype,{isConstant:{get:function(){return X.isConstant(rT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=rT(this);return c(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 rT(this)}}});Uu.fromString=function(e,t){if(!c(e))throw new E("targetCollection is required.");if(!c(t))throw new E("referenceString is required.");let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let l=t.charAt(a);r?(s+=l,r=!1):l==="\\"?r=!0:o&&l==="#"?(n=s,o=!1,s=""):!o&&l==="."?(i.push(s),s=""):s+=l}return i.push(s),new Uu(e,n,i)};var rQe=new Q;Uu.prototype.getValue=function(e,t){let n=rT(this);return c(e)||(e=Q.now(rQe)),c(n)?n.getValue(e,t):void 0};Uu.prototype.getValueInReferenceFrame=function(e,t,n){let i=rT(this);return c(i)?i.getValueInReferenceFrame(e,t,n):void 0};Uu.prototype.getType=function(e){let t=rT(this);return c(t)?t.getType(e):void 0};Uu.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};Uu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){c(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Uu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;c(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Uu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):c(i)||(i=rT(this),c(i)&&this._definitionChanged.raiseEvent(this))};var Y_=Uu;var sQe={packedLength:1,pack:function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,t[n]=e,t},unpack:function(e,t,n){if(!c(e))throw new E("array is required");return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){if(!c(e))throw new E("packedArray is required");c(i)||(i=[]),t=t??0,n=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-O.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){if(!c(e))throw new E("array is required");if(!c(t))throw new E("sourceArray is required");return o=e[0],o<0?o+O.TWO_PI:o}},td=sQe;var ohe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function rhe(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 she(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var e7=[],t7=[];function u4(e,t,n,i,o){let r=0,s,a,l,u,f,h;for(;r<i.length;){f=she(i[r],e),l=Lo(t,f,Q.compare);let p=0,g=0;if(l<0){for(l=~l,u=l*o,a=void 0,h=t[l];r<i.length&&(f=she(i[r],e),!(c(a)&&Q.compare(a,f)>=0||c(h)&&Q.compare(f,h)>=0));){for(e7[p++]=f,r=r+1,s=0;s<o;s++)t7[g++]=i[r],r=r+1;a=f}p>0&&(t7.length=g,rhe(n,u,t7),e7.length=p,rhe(t,l,e7))}else{for(s=0;s<o;s++)r++,n[l*o+s]=i[r];r++}}}function nd(e,t){T.defined("type",e);let n=e;n===Number&&(n=ohe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(c(t)){let a=t.length;s=new Array(a);for(let l=0;l<a;l++){let u=t[l];u===Number&&(u=ohe);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,s[l]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Jy,this._lastInterpolationAlgorithm=Jy,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 pe,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=cl.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=cl.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(nd.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 aQe=new Q;nd.prototype.getValue=function(e,t){c(e)||(e=Q.now(aQe));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Lo(n,e,Q.compare);var l=!1;if(a<0){if(a=~a,a===0){let P=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===cl.NONE||o!==0&&Q.secondsDifference(P,e)>o)return;if(this._backwardExtrapolationType===cl.HOLD)return r.unpack(s,0,t);l=this._backwardExtrapolationType===cl.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let P=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===cl.NONE||o!==0&&Q.secondsDifference(e,P)>o)return;if(this._forwardExtrapolationType===cl.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);l=this._forwardExtrapolationType===cl.LINEAR_EXTRAPOLATE}let h=this._xTable,p=this._yTable;var u,f;l?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let P=Math.min(u.getRequiredDataPoints(f,m),i);P!==this._numberOfPoints&&(this._numberOfPoints=P,h.length=P,p.length=P*g)}let y=this._numberOfPoints-1;if(y<1)return;let b=0,x=i-1;if(x-b+1>=y+1){let P=a-(y/2|0)-1;P<b&&(P=b);let M=P+y;M>x&&(M=x,P=M-y,P<b&&(P=b)),b=P,x=M}let C=x-b+1;for(let P=0;P<C;++P)h[P]=Q.secondsDifference(n[b+P],n[x]);if(c(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,b,x,p);else{let P=0,M=this._packedLength,R=b*M,L=(x+1)*M;for(;R<L;)p[P]=s[R],R++,P++}let S=Q.secondsDifference(e,n[x]),v;if(m===0||!c(u.interpolate))v=u.interpolateOrderZero(S,h,p,g,this._interpolationResult);else{let P=Math.floor(g/(m+1));v=u.interpolate(S,h,p,P,m,m,this._interpolationResult)}return c(r.unpackInterpolationResult)?r.unpackInterpolationResult(v,s,b,x,t):r.unpack(v,0,t)}return r.unpack(s,a*this._packedLength,t)};nd.prototype.setInterpolationOptions=function(e){if(!c(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;c(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),c(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};nd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);T.defined("time",e),T.defined("value",t),o&&T.defined("derivatives",n);let r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let l=0;l<a;l++)i[l].pack(n[l],s,s.length)}u4(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);if(T.defined("times",e),T.defined("values",t),e.length!==t.length)throw new E("times and values must be the same length.");if(o&&(!c(n)||n.length!==e.length))throw new E("times and derivativeValues must be the same length.");let r=this._innerType,s=e.length,a=[];for(let l=0;l<s;l++)if(a.push(e[l]),r.pack(t[l],a,a.length),o){let u=n[l],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],a,a.length)}u4(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nd.prototype.getSample=function(e){T.typeOf.number("index",e);let t=this._times,n=t.length;if(c(n))return e<0&&(e+=n),t[e]};nd.prototype.addSamplesPackedArray=function(e,t){T.defined("packedSamples",e),u4(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nd.prototype.removeSample=function(e){T.defined("time",e);let t=Lo(this._times,e,Q.compare);return t<0?!1:(ahe(this,t,1),!0)};function ahe(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)}nd.prototype.removeSamples=function(e){T.defined("timeInterval",e);let t=this._times,n=Lo(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Lo(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,ahe(this,n,i-n)};nd.prototype.equals=function(e){if(this===e)return!0;if(!c(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=c(t),i=e._derivativeTypes,o=c(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,l=e._times;if(s=a.length,s!==l.length)return!1;for(r=0;r<s;r++)if(!Q.equals(a[r],l[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};nd._mergeNewSamples=u4;var Vu=nd;function id(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new Vu(d,n),this._definitionChanged=new pe,this._referenceFrame=e??Hi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(id.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 cQe=new Q;id.prototype.getValue=function(e,t){return c(e)||(e=Q.now(cQe)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};id.prototype.getValueInReferenceFrame=function(e,t,n){if(T.defined("time",e),T.defined("referenceFrame",t),n=this._property.getValue(e,n),c(n))return zd.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};id.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};id.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;if(i>0&&(!c(n)||n.length!==i))throw new E("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)};id.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};id.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};id.prototype.removeSample=function(e){return this._property.removeSample(e)};id.prototype.removeSamples=function(e){this._property.removeSamples(e)};id.prototype.equals=function(e){return this===e||e instanceof id&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ta=id;var lQe={HORIZONTAL:0,VERTICAL:1},Eh=Object.freeze(lQe);var uQe=Eh.HORIZONTAL,fQe=G.WHITE,dQe=G.BLACK,hQe=0,mQe=1;function rS(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(rS.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:fe("orientation"),evenColor:fe("evenColor"),oddColor:fe("oddColor"),offset:fe("offset"),repeat:fe("repeat")});rS.prototype.getType=function(e){return"Stripe"};var pQe=new Q;rS.prototype.getValue=function(e,t){return c(e)||(e=Q.now(pQe)),c(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,uQe)===Eh.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,fQe,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,dQe,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,hQe),t.repeat=X.getValueOrDefault(this._repeat,e,mQe),t};rS.prototype.equals=function(e){return this===e||e instanceof rS&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var sS=rS;function n0(e){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(n0.prototype._intervalsChanged,this),this._referenceFrame=e??Hi.FIXED}Object.defineProperties(n0.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 _Qe=new Q;n0.prototype.getValue=function(e,t){return c(e)||(e=Q.now(_Qe)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};n0.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");let i=this._intervals.findDataForIntervalContainingDate(e);if(c(i))return zd.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};n0.prototype.equals=function(e){return this===e||e instanceof n0&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};n0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var X_=n0;function sT(){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(sT.prototype._intervalsChanged,this)}Object.defineProperties(sT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var gQe=new Q;sT.prototype.getValue=function(e,t){c(e)||(e=Q.now(gQe));let n=this._intervals.findDataForIntervalContainingDate(e);return c(n)&&typeof n.clone=="function"?n.clone(t):n};sT.prototype.equals=function(e){return this===e||e instanceof sT&&this._intervals.equals(e._intervals,X.equals)};sT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var K_=sT;function aS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new pe,this._normalize=t??!0,this.position=e}Object.defineProperties(aS.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(c(t)&&this._subscription(),this._position=e,c(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 yQe=new d,che=new d,lhe=new Q,bQe=new Q,n7=1/60;aS.prototype.getValue=function(e,t){return this._getValue(e,t)};aS.prototype._getValue=function(e,t,n){c(e)||(e=Q.now(bQe)),c(t)||(t=new d);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,yQe),r=i.getValue(Q.addSeconds(e,n7,lhe),che);if(!c(o)||!c(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-n7,lhe),che),!c(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);c(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,n7,t)};aS.prototype.equals=function(e){return this===e||e instanceof aS&&X.equals(this._position,e._position)};var $_=aS;function bN(e,t){this._velocityVectorProperty=new $_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new pe,this.ellipsoid=t??ie.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(bN.prototype,{isConstant:{get:function(){return X.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 uhe=new d,xQe=new d,fhe=new J,TQe=new Q;bN.prototype.getValue=function(e,t){c(e)||(e=Q.now(TQe));let n=this._velocityVectorProperty._getValue(e,xQe,uhe);if(c(n))return Ot.rotationMatrixFromPositionVelocity(uhe,n,this._ellipsoid,fhe),Le.fromRotationMatrix(fhe,t)};bN.prototype.equals=function(e){return this===e||e instanceof bN&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var xN=bN;var Z_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Z_.validate=function(e){return e===Z_.COMPLETE||e===Z_.BELOW_ELLIPSOID_HORIZON||e===Z_.ABOVE_ELLIPSOID_HORIZON};Z_.toString=function(e){switch(e){case Z_.COMPLETE:return"COMPLETE";case Z_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Z_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new E("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var cS=Z_;function i0(){}i0.packedLength=d.packedLength;i0.unpack=d.unpack;i0.pack=d.pack;var i7;function TN(e,t){return t[0]==="#"&&(t=i7+t),Y_.fromString(e,t)}function dhe(e,t,n){if(c(n.reference))return TN(t,n.reference);if(c(n.velocityReference)){let i=TN(t,n.velocityReference);switch(e){case d:case i0:return new $_(i,e===i0);case Le:return new xN(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function AQe(e,t){return new Wd(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var qi=new d,ll=new yN,Dc=new he,aT=new En,f4=new Le;function CQe(e){let t=e.rgbaf;if(c(t))return t;let n=e.rgba;if(!c(n))return;let i=n.length;if(i===G.packedLength)return[G.byteToFloat(n[0]),G.byteToFloat(n[1]),G.byteToFloat(n[2]),G.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=G.byteToFloat(n[o+1]),t[o+2]=G.byteToFloat(n[o+2]),t[o+3]=G.byteToFloat(n[o+3]),t[o+4]=G.byteToFloat(n[o+4]);return t}function hhe(e,t){let n=e.uri??e;return c(t)?t.getDerivedResource({url:n}):we.createIfNeeded(n)}function EQe(e){let t=e.wsen;if(c(t))return t;let n=e.wsenDegrees;if(!c(n))return;let i=n.length;if(i===ce.packedLength)return[O.toRadians(n[0]),O.toRadians(n[1]),O.toRadians(n[2]),O.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=O.toRadians(n[o+1]),t[o+2]=O.toRadians(n[o+2]),t[o+3]=O.toRadians(n[o+3]),t[o+4]=O.toRadians(n[o+4]);return t}function SQe(e){let t=e.length;if(ll.magnitude=1,t===2)return ll.clock=e[0],ll.cone=e[1],d.fromSpherical(ll,qi),[qi.x,qi.y,qi.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],d.fromSpherical(ll,qi),n[o+1]=qi.x,n[o+2]=qi.y,n[o+3]=qi.z;return n}function wQe(e){let t=e.length;if(t===3)return ll.clock=e[0],ll.cone=e[1],ll.magnitude=e[2],d.fromSpherical(ll,qi),[qi.x,qi.y,qi.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],d.fromSpherical(ll,qi),n[i+1]=qi.x,n[i+2]=qi.y,n[i+3]=qi.z;return n}function vQe(e){let t=e.length;if(t===3)return Dc.longitude=e[0],Dc.latitude=e[1],Dc.height=e[2],ie.default.cartographicToCartesian(Dc,qi),[qi.x,qi.y,qi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Dc.longitude=e[i+1],Dc.latitude=e[i+2],Dc.height=e[i+3],ie.default.cartographicToCartesian(Dc,qi),n[i+1]=qi.x,n[i+2]=qi.y,n[i+3]=qi.z;return n}function DQe(e){let t=e.length;if(t===3)return Dc.longitude=O.toRadians(e[0]),Dc.latitude=O.toRadians(e[1]),Dc.height=e[2],ie.default.cartographicToCartesian(Dc,qi),[qi.x,qi.y,qi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Dc.longitude=O.toRadians(e[i+1]),Dc.latitude=O.toRadians(e[i+2]),Dc.height=e[i+3],ie.default.cartographicToCartesian(Dc,qi),n[i+1]=qi.x,n[i+2]=qi.y,n[i+3]=qi.z;return n}function o7(e){let t=e.cartesian;if(c(t))return t;let n=e.cartesianVelocity;if(c(n))return n;let i=e.unitCartesian;if(c(i))return i;let o=e.unitSpherical;if(c(o))return SQe(o);let r=e.spherical;if(c(r))return wQe(r);let s=e.cartographicRadians;if(c(s))return vQe(s);let a=e.cartographicDegrees;if(c(a))return DQe(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function mhe(e,t){d.unpack(e,t,qi),d.normalize(qi,qi),d.pack(qi,e,t)}function PQe(e){let t=o7(e);if(t.length===3)return mhe(t,0),t;for(let n=1;n<t.length;n+=4)mhe(t,n);return t}function phe(e,t){Le.unpack(e,t,f4),Le.normalize(f4,f4),Le.pack(f4,e,t)}function IQe(e){let t=e.unitQuaternion;if(c(t)){if(t.length===4)return phe(t,0),t;for(let n=1;n<t.length;n+=5)phe(t,n)}return t}function _he(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")?H:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?i0:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?G:e.hasOwnProperty("arcType")?qt:e.hasOwnProperty("classificationType")?Un:e.hasOwnProperty("colorBlendMode")?bc:e.hasOwnProperty("cornerType")?Bi:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?bi:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?Yo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Bt:e.hasOwnProperty("distanceDisplayCondition")?Mt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("shadowMode")?xn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Eh:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?CN.default:e.hasOwnProperty("verticalOrigin")?Fn:Object}function OQe(e,t,n){switch(e){case qt:return qt[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Ke:return t.boundingRectangle;case H:return t.cartesian2;case d:return o7(t);case i0:return PQe(t);case G:return CQe(t);case Un:return Un[t.classificationType??t];case bc:return bc[t.colorBlendMode??t];case Bi:return Bi[t.cornerType??t];case We:return We[t.heightReference??t];case bi:return bi[t.horizontalOrigin??t];case Image:return hhe(t,n);case Q:return Q.fromIso8601(t.date??t);case Yo:return Yo[t.labelStyle??t];case Number:return t.number??t;case Bt:return t.nearFarScalar;case Mt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Le:return IQe(t);case td:return t.number??t;case cS:return cS[t.portionToDisplay??t];case xn:return xn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Eh:return Eh[t.stripeOrientation??t];case ce:return EQe(t);case CN.default:return hhe(t,n);case Fn:return Fn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var RQe={HERMITE:_N,LAGRANGE:gN,LINEAR:Jy};function d4(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(c(n)||c(i))&&t.setInterpolationOptions({interpolationAlgorithm:RQe[n],interpolationDegree:i});let o=e.forwardExtrapolationType;c(o)&&(t.forwardExtrapolationType=cl[o]);let r=e.forwardExtrapolationDuration;c(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;c(s)&&(t.backwardExtrapolationType=cl[s]);let a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}var ghe={iso8601:void 0};function yr(e){if(c(e))return ghe.iso8601=e,En.fromIso8601(ghe)}function r7(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function yhe(e){let t=new Sc;return t.intervals.addInterval(r7(e)),t}function bhe(e){let t=new ba(e.referenceFrame);return t.intervals.addInterval(r7(e)),t}function h4(e,t,n,i,o,r,s){let a=yr(i.interval);c(o)&&(c(a)?a=En.intersect(a,o,aT):a=o);let l,u,f,h=!c(i.reference)&&!c(i.velocityReference),p=c(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Ihe(t[n],a)}let g=!1;if(h){if(u=OQe(e,i,r),!c(u))return;l=e.packedLength??1,f=u.length??1,g=!c(i.array)&&typeof u!="string"&&f>l&&e!==Object}let m=typeof e.unpack=="function"&&e!==td;if(!g&&!p){h?t[n]=new Kn(m?e.unpack(u,0):u):t[n]=dhe(e,s,i);return}let y=t[n],b,x=i.epoch;if(c(x)&&(b=Q.fromIso8601(x)),g&&!p){y instanceof Vu||(t[n]=y=new Vu(e)),y.addSamplesPackedArray(u,b),d4(i,y);return}let A;if(!g&&p){a=a.clone(),h?a.data=m?e.unpack(u,0):u:a.data=dhe(e,s,i),c(y)||(t[n]=y=h?new K_:new Sc),h&&y instanceof K_?y.intervals.addInterval(a):y instanceof Sc?(h&&(a.data=new Kn(a.data)),y.intervals.addInterval(a)):(t[n]=y=yhe(y),h&&(a.data=new Kn(a.data)),y.intervals.addInterval(a));return}c(y)||(t[n]=y=new Sc),y instanceof Sc||(t[n]=y=yhe(y));let C=y.intervals;A=C.findInterval(a),(!c(A)||!(A.data instanceof Vu))&&(A=a.clone(),A.data=new Vu(e),C.addInterval(A)),A.data.addSamplesPackedArray(u,b),d4(i,A.data)}function Ihe(e,t){if(e instanceof Vu){e.removeSamples(t);return}else if(e instanceof K_){e.intervals.removeInterval(t);return}else if(e instanceof Sc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,aT);o.isEmpty||Ihe(o.data,t)}n.removeInterval(t);return}}function be(e,t,n,i,o,r,s){if(c(i))if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)h4(e,t,n,i[a],o,r,s);else h4(e,t,n,i,o,r,s)}function xhe(e,t,n,i,o,r){let s=yr(n.interval);c(i)&&(c(s)?s=En.intersect(s,i,aT):s=i);let a=c(n.cartesianVelocity)?1:0,l=d.packedLength*(a+1),u,f,h=!c(n.reference),p=c(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Ohe(e[t],s)}let g,m=!1;if(h&&(c(n.referenceFrame)&&(g=Hi[n.referenceFrame]),g=g??Hi.FIXED,u=o7(n),f=u.length??1,m=f>l),!m&&!p){h?e[t]=new qc(d.unpack(u),g):e[t]=TN(r,n.reference);return}let y=e[t],b,x=n.epoch;if(c(x)&&(b=Q.fromIso8601(x)),m&&!p){(!(y instanceof Ta)||c(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ta(g,a)),y.addSamplesPackedArray(u,b),d4(n,y);return}let A;if(!m&&p){s=s.clone(),h?s.data=d.unpack(u):s.data=TN(r,n.reference),c(y)||(h?y=new X_(g):y=new ba(g),e[t]=y),h&&y instanceof X_&&c(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof ba?(h&&(s.data=new qc(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=bhe(y),h&&(s.data=new qc(s.data,g)),y.intervals.addInterval(s));return}c(y)?y instanceof ba||(e[t]=y=bhe(y)):e[t]=y=new ba(g);let C=y.intervals;A=C.findInterval(s),(!c(A)||!(A.data instanceof Ta)||c(g)&&A.data.referenceFrame!==g)&&(A=s.clone(),A.data=new Ta(g,a),C.addInterval(A)),A.data.addSamplesPackedArray(u,b),d4(n,A.data)}function Ohe(e,t){if(e instanceof Ta){e.removeSamples(t);return}else if(e instanceof X_){e.intervals.removeInterval(t);return}else if(e instanceof ba){let n=e.intervals;for(let i=0;i<n.length;++i){let o=En.intersect(n.get(i),t,aT);o.isEmpty||Ohe(o.data,t)}n.removeInterval(t);return}}function Rhe(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)xhe(e,t,n[s],i,o,r);else xhe(e,t,n,i,o,r)}function The(e,t,n,i){c(n.references)?m4(e,t,n.references,n.interval,i,oS,Sc):(c(n.cartesian2)?n.array=H.unpackArray(n.cartesian2):c(n.cartesian)&&(n.array=H.unpackArray(n.cartesian)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i))}function Ahe(e,t,n,i,o,r){let s=yr(n.interval);c(i)&&(c(s)?s=En.intersect(s,i,aT):s=i);let a=e[t],l,u;if(c(s)){a instanceof VE||(a=new VE,e[t]=a);let h=a.intervals;u=h.findInterval({start:s.start,stop:s.stop}),c(u)?l=u.data:(u=s.clone(),h.addInterval(u))}else l=a;let f;c(n.solidColor)?(l instanceof Ut||(l=new Ut),f=n.solidColor,be(G,l,"color",f.color,void 0,void 0,r)):c(n.grid)?(l instanceof $E||(l=new $E),f=n.grid,be(G,l,"color",f.color,void 0,o,r),be(Number,l,"cellAlpha",f.cellAlpha,void 0,o,r),be(H,l,"lineCount",f.lineCount,void 0,o,r),be(H,l,"lineThickness",f.lineThickness,void 0,o,r),be(H,l,"lineOffset",f.lineOffset,void 0,o,r)):c(n.image)?(l instanceof ny||(l=new ny),f=n.image,be(Image,l,"image",f.image,void 0,o,r),be(H,l,"repeat",f.repeat,void 0,o,r),be(G,l,"color",f.color,void 0,o,r),be(Boolean,l,"transparent",f.transparent,void 0,o,r)):c(n.stripe)?(l instanceof sS||(l=new sS),f=n.stripe,be(Eh,l,"orientation",f.orientation,void 0,o,r),be(G,l,"evenColor",f.evenColor,void 0,o,r),be(G,l,"oddColor",f.oddColor,void 0,o,r),be(Number,l,"offset",f.offset,void 0,o,r),be(Number,l,"repeat",f.repeat,void 0,o,r)):c(n.polylineOutline)?(l instanceof e0||(l=new e0),f=n.polylineOutline,be(G,l,"color",f.color,void 0,o,r),be(G,l,"outlineColor",f.outlineColor,void 0,o,r),be(Number,l,"outlineWidth",f.outlineWidth,void 0,o,r)):c(n.polylineGlow)?(l instanceof nS||(l=new nS),f=n.polylineGlow,be(G,l,"color",f.color,void 0,o,r),be(Number,l,"glowPower",f.glowPower,void 0,o,r),be(Number,l,"taperPower",f.taperPower,void 0,o,r)):c(n.polylineArrow)?(l instanceof QE||(l=new QE),f=n.polylineArrow,be(G,l,"color",f.color,void 0,void 0,r)):c(n.polylineDash)?(l instanceof eS||(l=new eS),f=n.polylineDash,be(G,l,"color",f.color,void 0,void 0,r),be(G,l,"gapColor",f.gapColor,void 0,void 0,r),be(Number,l,"dashLength",f.dashLength,void 0,o,r),be(Number,l,"dashPattern",f.dashPattern,void 0,o,r)):c(n.checkerboard)&&(l instanceof kE||(l=new kE),f=n.checkerboard,be(G,l,"evenColor",f.evenColor,void 0,o,r),be(G,l,"oddColor",f.oddColor,void 0,o,r),be(H,l,"repeat",f.repeat,void 0,o,r)),c(u)?u.data=l:e[t]=l}function zu(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Ahe(e,t,n[s],i,o,r);else Ahe(e,t,n,i,o,r)}function MQe(e,t,n,i){let o=t.name;c(o)&&(e.name=t.name)}function LQe(e,t,n,i){let o=t.description;c(o)&&be(String,e,"description",o,void 0,i,n)}function NQe(e,t,n,i){let o=t.position;c(o)&&Rhe(e,"position",o,void 0,i,n)}function FQe(e,t,n,i){let o=t.viewFrom;c(o)&&be(d,e,"viewFrom",o,void 0,i,n)}function BQe(e,t,n,i){let o=t.orientation;c(o)&&be(Le,e,"orientation",o,void 0,i,n)}function kQe(e,t,n,i){let o=t.properties;if(c(o)){c(e.properties)||(e.properties=new Xc);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,l=s.length;a<l;++a)h4(_he(s[a]),e.properties,r,s[a],void 0,i,n);else h4(_he(s),e.properties,r,s,void 0,i,n)}}}function m4(e,t,n,i,o,r,s){let a=n.map(function(l){return TN(o,l)});if(c(i)){i=yr(i);let l=e[t];if(!(l instanceof s)){let u=new s;u.intervals.addInterval(r7(l)),e[t]=l=u}i.data=new r(a),l.intervals.addInterval(i)}else e[t]=new r(a)}function Che(e,t,n,i){let o=n.references;c(o)?m4(e,t,o,n.interval,i,oS,Sc):be(Array,e,t,n,void 0,void 0,i)}function Ehe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Che(e,t,n[o],i);else Che(e,t,n,i)}function She(e,t,n,i){let o=n.references;c(o)?m4(e,t,o,n.interval,i,q_,ba):(c(n.cartesian)?n.array=d.unpackArray(n.cartesian):c(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,ie.default):c(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,ie.default)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i))}function EN(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)She(e,t,n[o],i);else She(e,t,n,i)}function UQe(e){return d.unpackArray(e)}function VQe(e){return d.fromRadiansArrayHeights(e,ie.default)}function zQe(e){return d.fromDegreesArrayHeights(e,ie.default)}function whe(e,t,n,i){let o=n.references;if(c(o)){let r=o.map(function(s){let a={};return m4(a,"positions",s,n.interval,i,q_,ba),a.positions});e[t]=new q_(r)}else c(n.cartesian)?n.array=n.cartesian.map(UQe):c(n.cartographicRadians)?n.array=n.cartographicRadians.map(VQe):c(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(zQe)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i)}function HQe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)whe(e,t,n[o],i);else whe(e,t,n,i)}function GQe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)The(e,t,n[o],i);else The(e,t,n,i)}function jQe(e,t,n,i){let o=t.availability;if(!c(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)c(r)||(r=new Xr),r.addInterval(yr(o[s]));else r=new Xr,r.addInterval(yr(o));e.availability=r}function WQe(e,t,n,i,o){c(t)&&be(i0,e,"alignedAxis",t,n,i,o)}function qQe(e,t,n,i){let o=t.billboard;if(!c(o))return;let r=yr(o.interval),s=e.billboard;c(s)||(e.billboard=s=new fc),be(Boolean,s,"show",o.show,r,i,n),be(Image,s,"image",o.image,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(H,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(G,s,"color",o.color,r,i,n),be(td,s,"rotation",o.rotation,r,i,n),WQe(s,o.alignedAxis,r,i,n),be(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"height",o.height,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function YQe(e,t,n,i){let o=t.box;if(!c(o))return;let r=yr(o.interval),s=e.box;c(s)||(e.box=s=new Vb),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"dimensions",o.dimensions,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function XQe(e,t,n,i){let o=t.corridor;if(!c(o))return;let r=yr(o.interval),s=e.corridor;c(s)||(e.corridor=s=new Hb),be(Boolean,s,"show",o.show,r,i,n),EN(s,"positions",o.positions,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"height",o.height,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(We,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Bi,s,"cornerType",o.cornerType,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function KQe(e,t,n,i){let o=t.cylinder;if(!c(o))return;let r=yr(o.interval),s=e.cylinder;c(s)||(e.cylinder=s=new Gb),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"length",o.length,r,i,n),be(Number,s,"topRadius",o.topRadius,r,i,n),be(Number,s,"bottomRadius",o.bottomRadius,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(Number,s,"slices",o.slices,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function $Qe(e,t){let n=e.version;if(c(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(!c(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;c(e.name)&&(i.name=e.name);let o=e.clock;if(c(o)){let r=i.clock;c(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ZQe(e,t,n,i){let o=t.ellipse;if(!c(o))return;let r=yr(o.interval),s=e.ellipse;c(s)||(e.ellipse=s=new jb),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),be(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),be(Number,s,"height",o.height,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(We,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(td,s,"rotation",o.rotation,r,i,n),be(td,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function QQe(e,t,n,i){let o=t.ellipsoid;if(!c(o))return;let r=yr(o.interval),s=e.ellipsoid;c(s)||(e.ellipsoid=s=new Wb),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"radii",o.radii,r,i,n),be(d,s,"innerRadii",o.innerRadii,r,i,n),be(Number,s,"minimumClock",o.minimumClock,r,i,n),be(Number,s,"maximumClock",o.maximumClock,r,i,n),be(Number,s,"minimumCone",o.minimumCone,r,i,n),be(Number,s,"maximumCone",o.maximumCone,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"stackPartitions",o.stackPartitions,r,i,n),be(Number,s,"slicePartitions",o.slicePartitions,r,i,n),be(Number,s,"subdivisions",o.subdivisions,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function JQe(e,t,n,i){let o=t.label;if(!c(o))return;let r=yr(o.interval),s=e.label;c(s)||(e.label=s=new Hd),be(Boolean,s,"show",o.show,r,i,n),be(String,s,"text",o.text,r,i,n),be(String,s,"font",o.font,r,i,n),be(Yo,s,"style",o.style,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Boolean,s,"showBackground",o.showBackground,r,i,n),be(G,s,"backgroundColor",o.backgroundColor,r,i,n),be(H,s,"backgroundPadding",o.backgroundPadding,r,i,n),be(H,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(G,s,"fillColor",o.fillColor,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function eJe(e,t,n,i){let o=t.model;if(!c(o))return;let r=yr(o.interval),s=e.model;c(s)||(e.model=s=new Gp),be(Boolean,s,"show",o.show,r,i,n),be(CN.default,s,"uri",o.gltf,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),be(Number,s,"maximumScale",o.maximumScale,r,i,n),be(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),be(Boolean,s,"runAnimations",o.runAnimations,r,i,n),be(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(G,s,"silhouetteColor",o.silhouetteColor,r,i,n),be(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),be(G,s,"color",o.color,r,i,n),be(bc,s,"colorBlendMode",o.colorBlendMode,r,i,n),be(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,l,u=o.nodeTransformations;if(c(u))if(Array.isArray(u))for(a=0,l=u.length;a<l;++a)vhe(s,u[a],r,i,n);else vhe(s,u,r,i,n);let f=o.articulations;if(c(f))if(Array.isArray(f))for(a=0,l=f.length;a<l;++a)Dhe(s,f[a],r,i,n);else Dhe(s,f,r,i,n)}function vhe(e,t,n,i,o){let r=yr(t.interval);c(n)&&(c(r)?r=En.intersect(r,n,aT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let l=0,u=a.length;l<u;++l){let f=a[l];if(f==="interval")continue;let h=t[f];if(!c(h))continue;c(s)||(e.nodeTransformations=s=new Xc),s.hasProperty(f)||s.addProperty(f);let p=s[f];c(p)||(s[f]=p=new qb),be(d,p,"translation",h.translation,r,i,o),be(Le,p,"rotation",h.rotation,r,i,o),be(d,p,"scale",h.scale,r,i,o)}}function Dhe(e,t,n,i,o){let r=yr(t.interval);c(n)&&(c(r)?r=En.intersect(r,n,aT):r=n);let s=e.articulations,a=Object.keys(t);for(let l=0,u=a.length;l<u;++l){let f=a[l];if(f==="interval")continue;let h=t[f];c(h)&&(c(s)||(e.articulations=s=new Xc),s.hasProperty(f)||s.addProperty(f),be(Number,s,f,h,r,i,o))}}function tJe(e,t,n,i){let o=t.path;if(!c(o))return;let r=yr(o.interval),s=e.path;c(s)||(e.path=s=new jp),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"leadTime",o.leadTime,r,i,n),be(Number,s,"trailTime",o.trailTime,r,i,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"resolution",o.resolution,r,i,n),zu(s,"material",o.material,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function nJe(e,t,n,i){let o=t.point;if(!c(o))return;let r=yr(o.interval),s=e.point;c(s)||(e.point=s=new Xb),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"pixelSize",o.pixelSize,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(G,s,"color",o.color,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function AN(e){this.polygon=e,this._definitionChanged=new pe}Object.defineProperties(AN.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!c(e)||e.isConstant)&&(!c(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});AN.prototype.getValue=function(e,t){let n;c(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return c(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),c(i)&&(i=i.map(function(o){return new ka(o)}))),c(t)?(t.positions=n,t.holes=i,t):new ka(n,i)};AN.prototype.equals=function(e){return this===e||e instanceof AN&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function iJe(e,t,n,i){let o=t.polygon;if(!c(o))return;let r=yr(o.interval),s=e.polygon;c(s)||(e.polygon=s=new Gd),be(Boolean,s,"show",o.show,r,i,n),EN(s,"_positions",o.positions,n),HQe(s,"_holes",o.holes,n),(c(s._positions)||c(s._holes))&&(s.hierarchy=new AN(s)),be(Number,s,"height",o.height,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(We,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(td,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),be(Boolean,s,"closeTop",o.closeTop,r,i,n),be(Boolean,s,"closeBottom",o.closeBottom,r,i,n),be(qt,s,"arcType",o.arcType,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function oJe(e){return e?qt.GEODESIC:qt.NONE}function rJe(e,t,n,i){let o=t.polyline;if(!c(o))return;let r=yr(o.interval),s=e.polyline;if(c(s)||(e.polyline=s=new mc),be(Boolean,s,"show",o.show,r,i,n),EN(s,"positions",o.positions,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),zu(s,"material",o.material,r,i,n),zu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),be(qt,s,"arcType",o.arcType,r,i,n),be(Boolean,s,"clampToGround",o.clampToGround,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n),c(o.followSurface)&&!c(o.arcType)){let a={};be(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=AQe(a.followSurface,oJe)}}function sJe(e,t,n,i){let o=t.polylineVolume;if(!c(o))return;let r=yr(o.interval),s=e.polylineVolume;c(s)||(e.polylineVolume=s=new Kb),EN(s,"positions",o.positions,n),GQe(s,"shape",o.shape,n),be(Boolean,s,"show",o.show,r,i,n),be(Bi,s,"cornerType",o.cornerType,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function aJe(e,t,n,i){let o=t.rectangle;if(!c(o))return;let r=yr(o.interval),s=e.rectangle;c(s)||(e.rectangle=s=new jd),be(Boolean,s,"show",o.show,r,i,n),be(ce,s,"coordinates",o.coordinates,r,i,n),be(Number,s,"height",o.height,r,i,n),be(We,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(We,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(td,s,"rotation",o.rotation,r,i,n),be(td,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function cJe(e,t,n,i){let o=t.tileset;if(!c(o))return;let r=yr(o.interval),s=e.tileset;c(s)||(e.tileset=s=new Yb),be(Boolean,s,"show",o.show,r,i,n),be(CN.default,s,"uri",o.uri,r,i,n),be(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function lJe(e,t,n,i){let o=t.wall;if(!c(o))return;let r=yr(o.interval),s=e.wall;c(s)||(e.wall=s=new Wp),be(Boolean,s,"show",o.show,r,i,n),EN(s,"positions",o.positions,n),Ehe(s,"minimumHeights",o.minimumHeights,n),Ehe(s,"maximumHeights",o.maximumHeights,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),zu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(xn,s,"shadows",o.shadows,r,i,n),be(Mt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Phe(e,t,n,i,o){let r=e.id;if(c(r)||(r=jn()),i7=r,!c(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")$Qe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;c(a)&&(s.parent=t.getOrCreateEntity(a));for(let l=n.length-1;l>-1;l--)n[l](s,e,t,i)}i7=void 0}function uJe(e){let t,n=e._documentPacket.clock;if(!c(n)){if(!c(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),l=Math.round(a/120);return t=new Ch,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=$r.LOOP_STOP,t.multiplier=l,t.currentTime=Q.clone(r),t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}c(e._clock)?t=e._clock.clone():(t=new Ch,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=$r.LOOP_STOP,t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=yr(n.interval);return c(i)&&(t.startTime=i.start,t.stopTime=i.stop),c(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),c(n.range)&&(t.clockRange=$r[n.range]??$r.LOOP_STOP),c(n.step)&&(t.clockStep=mo[n.step]??mo.SYSTEM_CLOCK_MULTIPLIER),c(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Mhe(e,t,n,i){if(!c(t))throw new E("czml is required.");n=n??W.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Tt(s)),e._credit=s,typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;f<u;f++)a.push(l[f])}}return r=we.createIfNeeded(r),Kr.setLoading(e,!0),Promise.resolve(o).then(function(a){return fJe(e,a,r,i)}).catch(function(a){return Kr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function fJe(e,t,n,i){Kr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Lhe,o.removeAll()),xs._processCzml(t,o,n,void 0,e);let r=uJe(e),s=e._documentPacket;return c(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!c(e._name)&&c(n)&&(e._name=j_(n.getUrlComponent()),r=!0),Kr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function Lhe(){this.name=void 0,this.clock=void 0}function xs(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._clock=void 0,this._documentPacket=new Lhe,this._version=void 0,this._entityCollection=new Qs(this),this._entityCluster=new Bu,this._credit=void 0,this._resourceCredits=[]}xs.load=function(e,t){return new xs().load(e,t)};Object.defineProperties(xs.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){if(!c(e))throw new E("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});xs.updaters=[qQe,YQe,XQe,KQe,ZQe,QQe,JQe,eJe,MQe,LQe,tJe,nJe,iJe,rJe,sJe,kQe,aJe,NQe,cJe,FQe,lJe,BQe,jQe];xs.registerUpdater=function(e){xs.updaters.includes(e)||xs.updaters.push(e)};xs.unregisterUpdater=function(e){if(xs.updaters.includes(e)){let t=xs.updaters.indexOf(e);xs.updaters.splice(t,1)}};xs.prototype.process=function(e,t){return Mhe(this,e,t,!1)};xs.prototype.load=function(e,t){return Mhe(this,e,t,!0)};xs.prototype.update=function(e){return!0};xs.processPacketData=be;xs.processPositionPacketData=Rhe;xs.processMaterialPacketData=zu;xs._processCzml=function(e,t,n,i,o){if(i=i??xs.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)Phe(e[r],t,i,n,o);else Phe(e,t,i,n,o)};var SN=xs;function ul(){this._dataSources=[],this._dataSourceAdded=new pe,this._dataSourceRemoved=new pe,this._dataSourceMoved=new pe}Object.defineProperties(ul.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}}});ul.prototype.add=function(e){if(!c(e))throw new E("dataSource is required.");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})};ul.prototype.remove=function(e,t){t=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};ul.prototype.removeAll=function(e){e=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=[]};ul.prototype.contains=function(e){return this.indexOf(e)!==-1};ul.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ul.prototype.get=function(e){if(!c(e))throw new E("index is required.");return this._dataSources[e]};ul.prototype.getByName=function(e){if(!c(e))throw new E("name is required.");return this._dataSources.filter(function(t){return t.name===e})};function p4(e,t){if(!c(t))throw new E("dataSource is required.");let n=e.indexOf(t);if(n===-1)throw new E("dataSource is not in this collection.");return n}function Nhe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=O.clamp(t,0,o),n=O.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}ul.prototype.raise=function(e){let t=p4(this._dataSources,e);Nhe(this,t,t+1)};ul.prototype.lower=function(e){let t=p4(this._dataSources,e);Nhe(this,t,t-1)};ul.prototype.raiseToTop=function(e){let t=p4(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))};ul.prototype.lowerToBottom=function(e){let t=p4(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ul.prototype.isDestroyed=function(){return!1};ul.prototype.destroy=function(){return this.removeAll(!0),de(this)};var wN=ul;function Aa(e){e=e??W.EMPTY_OBJECT,this._primitives=[],this._guid=jn(),this._primitiveAdded=new pe,this._primitiveRemoved=new pe,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(Aa.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Aa.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new E("primitive is required.");if(n){if(t<0)throw new E("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new E("index must be less than or equal to the number of primitives.")}let 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};Aa.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};Aa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Aa.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=[]};Aa.prototype.contains=function(e){return!!(c(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function _4(e,t){if(!e.contains(t))throw new E("primitive is not in this collection.");return e._primitives.indexOf(t)}Aa.prototype.raise=function(e){if(c(e)){let t=_4(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Aa.prototype.raiseToTop=function(e){if(c(e)){let t=_4(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Aa.prototype.lower=function(e){if(c(e)){let t=_4(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Aa.prototype.lowerToBottom=function(e){if(c(e)){let t=_4(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Aa.prototype.get=function(e){if(!c(e))throw new E("index is required.");return this._primitives[e]};Aa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Aa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.prePassesUpdate)&&i.prePassesUpdate(e)}};Aa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];c(o.updateForPass)&&o.updateForPass(e,t)}};Aa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.postPassesUpdate)&&i.postPassesUpdate(e)}};Aa.prototype.isDestroyed=function(){return!1};Aa.prototype.destroy=function(){return this.removeAll(),de(this)};var fl=Aa;function Fm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Fm.prototype,{length:{get:function(){return this._length}}});Fm.prototype.add=function(e,t){T.defined("primitive",e),c(t)&&T.typeOf.number("zIndex",t),t=t??0;let n=this._collections[t];if(!c(n)){n=new fl({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};Fm.prototype.set=function(e,t){return T.defined("primitive",e),T.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Fm.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};Fm.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};Fm.prototype.contains=function(e){if(!c(e))return!1;let t=this._collections[e._zIndex];return c(t)&&t.contains(e)};Fm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Fm.prototype.isDestroyed=function(){return!1};Fm.prototype.destroy=function(){return this.removeAll(),de(this)};var vN=Fm;function lS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Et}lS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};lS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);c(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};lS.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};lS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};lS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),c(e)&&c(e.getBoundingSphere)?e.getBoundingSphere(t):lt.FAILED};var cT=lS;var a7={},g4=new d,Fhe=new d,Bhe=new Le,khe=new J;function uS(e,t,n,i,o,r,s,a,l,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),g4),d.multiplyByScalar(n,Math.sin(f),Fhe),d.add(g4,Fhe,g4);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*h+o*p)/a;return Le.fromAxisAngle(g4,m,Bhe),J.fromQuaternion(Bhe,khe),J.multiplyByVector(khe,l,u),d.normalize(u,u),d.multiplyByScalar(u,a,u),u}var Uhe=new d,Vhe=new d,s7=new d,dJe=new d;a7.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),l=e.length,u=n?l:0;for(let f=0;f<l;f+=3){let h=f+1,p=f+2,g=d.fromArray(e,f,Uhe);i.scaleToGeodeticSurface(g,g);let m=d.clone(g,Vhe),y=i.geodeticSurfaceNormal(g,dJe),b=d.multiplyByScalar(y,o,s7);d.add(g,b,g),n&&(d.multiplyByScalar(y,r,b),d.add(m,b,m),a[f+u]=m.x,a[h+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[h]=g.y,a[p]=g.z}return a};var hJe=new d,mJe=new d,pJe=new d;a7.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,l=i*i,u=o*o,f=o*i,h=d.magnitude(s),p=d.normalize(s,hJe),g=d.cross(d.UNIT_Z,s,mJe);g=d.normalize(g,g);let m=d.cross(p,g,pJe),y=1+Math.ceil(O.PI_OVER_TWO/a),b=O.PI_OVER_TWO/(y-1),x=O.PI_OVER_TWO-y*b;x<0&&(y-=Math.ceil(Math.abs(x)/b));let A=2*(y*(y+2)),C=t?new Array(A*3):void 0,S=0,v=Uhe,P=Vhe,M=y*4*3,R=M-1,L=0,F=n?new Array(M):void 0,_,w,D,I,N;for(x=O.PI_OVER_TWO,v=uS(x,r,m,g,l,f,u,h,p,v),t&&(C[S++]=v.x,C[S++]=v.y,C[S++]=v.z),n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x),x=O.PI_OVER_TWO-b,_=1;_<y+1;++_){if(v=uS(x,r,m,g,l,f,u,h,p,v),P=uS(Math.PI-x,r,m,g,l,f,u,h,p,P),t){for(C[S++]=v.x,C[S++]=v.y,C[S++]=v.z,D=2*_+2,w=1;w<D-1;++w)I=w/(D-1),N=d.lerp(v,P,I,s7),C[S++]=N.x,C[S++]=N.y,C[S++]=N.z;C[S++]=P.x,C[S++]=P.y,C[S++]=P.z}n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x,F[L++]=P.x,F[L++]=P.y,F[L++]=P.z),x=O.PI_OVER_TWO-(_+1)*b}for(_=y;_>1;--_){if(x=O.PI_OVER_TWO-(_-1)*b,v=uS(-x,r,m,g,l,f,u,h,p,v),P=uS(x+Math.PI,r,m,g,l,f,u,h,p,P),t){for(C[S++]=v.x,C[S++]=v.y,C[S++]=v.z,D=2*(_-1)+2,w=1;w<D-1;++w)I=w/(D-1),N=d.lerp(v,P,I,s7),C[S++]=N.x,C[S++]=N.y,C[S++]=N.z;C[S++]=P.x,C[S++]=P.y,C[S++]=P.z}n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x,F[L++]=P.x,F[L++]=P.y,F[L++]=P.z)}x=O.PI_OVER_TWO,v=uS(-x,r,m,g,l,f,u,h,p,v);let k={};return t&&(C[S++]=v.x,C[S++]=v.y,C[S++]=v.z,k.positions=C,k.numPts=y),n&&(F[R--]=v.z,F[R--]=v.y,F[R--]=v.x,k.outerPositions=F),k};var $l=a7;var fS=new d,c7=new d,l7=new d,zhe=new d,Rs=new H,Hhe=new J,_Je=new J,u7=new Le,Ghe=new d,jhe=new d,Whe=new d,x4=new he,qhe=new d,Yhe=new H,Xhe=new H;function Khe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,l=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,b=0,x=Ghe,A=jhe,C=Whe,S=new Oi(a),v=S.project(a.cartesianToCartographic(o,x4),qhe),P=a.scaleToGeodeticSurface(o,fS);a.geodeticSurfaceNormal(P,P);let M=Hhe,R=_Je;if(l!==0){let N=Le.fromAxisAngle(P,l,u7);M=J.fromQuaternion(N,M),N=Le.fromAxisAngle(P,-l,u7),R=J.fromQuaternion(N,R)}else M=J.clone(J.IDENTITY,M),R=J.clone(J.IDENTITY,R);let L=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Yhe),F=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Xhe),_=e.length,w=n?_:0,D=w/3*2;for(let N=0;N<_;N+=3){let k=N+1,z=N+2,V=d.fromArray(e,N,fS);if(i.st){let j=J.multiplyByVector(M,V,c7),U=S.project(a.cartesianToCartographic(j,x4),l7);d.subtract(U,v,U),Rs.x=(U.x+r)/(2*r),Rs.y=(U.y+s)/(2*s),L.x=Math.min(Rs.x,L.x),L.y=Math.min(Rs.y,L.y),F.x=Math.max(Rs.x,F.x),F.y=Math.max(Rs.y,F.y),n&&(h[b+D]=Rs.x,h[b+1+D]=Rs.y),h[b++]=Rs.x,h[b++]=Rs.y}(i.normal||i.tangent||i.bitangent||f)&&(x=a.geodeticSurfaceNormal(V,x),f&&(y[N+w]=-x.x,y[k+w]=-x.y,y[z+w]=-x.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(A=d.normalize(d.cross(d.UNIT_Z,x,A),A),J.multiplyByVector(R,A,A)),i.normal&&(p[N]=x.x,p[k]=x.y,p[z]=x.z,n&&(p[N+w]=-x.x,p[k+w]=-x.y,p[z+w]=-x.z)),i.tangent&&(g[N]=A.x,g[k]=A.y,g[z]=A.z,n&&(g[N+w]=-A.x,g[k+w]=-A.y,g[z+w]=-A.z)),i.bitangent&&(C=d.normalize(d.cross(x,A,C),C),m[N]=C.x,m[k]=C.y,m[z]=C.z,n&&(m[N+w]=C.x,m[k+w]=C.y,m[z+w]=C.z))))}if(i.st){_=h.length;for(let N=0;N<_;N+=2)h[N]=(h[N]-L.x)/(F.x-L.x),h[N+1]=(h[N+1]-L.y)/(F.y-L.y)}let I=new fn;if(i.position){let N=$l.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(I.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),n&&c(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===Zt.TOP)N=N.fill(1,0,u/2);else{let k=t.offsetAttribute===Zt.NONE?0:1;N=N.fill(k)}I.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function $he(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 lT=new d;function gJe(e){let t=e.center;lT=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,lT),e.height,lT),lT=d.add(t,lT,lT);let n=new le(lT,e.semiMajorAxis),i=$l.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Khe(o,e,!1),a=$he(r);return a=Fe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function yJe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,l=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,x=b?new Float32Array(f*3):void 0,A=0,C=Ghe,S=jhe,v=Whe,P=new Oi(s),M=P.project(s.cartesianToCartographic(i,x4),qhe),R=s.scaleToGeodeticSurface(i,fS);s.geodeticSurfaceNormal(R,R);let L=Le.fromAxisAngle(R,u,u7),F=J.fromQuaternion(L,Hhe),_=H.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Yhe),w=H.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Xhe),D=e.length,I=D/3*2;for(let k=0;k<D;k+=3){let z=k+1,V=k+2,j=d.fromArray(e,k,fS),U;if(n.st){let Y=J.multiplyByVector(F,j,c7),te=P.project(s.cartesianToCartographic(Y,x4),l7);d.subtract(te,M,te),Rs.x=(te.x+o)/(2*o),Rs.y=(te.y+r)/(2*r),_.x=Math.min(Rs.x,_.x),_.y=Math.min(Rs.y,_.y),w.x=Math.max(Rs.x,w.x),w.y=Math.max(Rs.y,w.y),p[A+I]=Rs.x,p[A+1+I]=Rs.y,p[A++]=Rs.x,p[A++]=Rs.y}j=s.scaleToGeodeticSurface(j,j),U=d.clone(j,c7),C=s.geodeticSurfaceNormal(j,C),b&&(x[k+D]=-C.x,x[z+D]=-C.y,x[V+D]=-C.z);let q=d.multiplyByScalar(C,a,zhe);if(j=d.add(j,q,j),q=d.multiplyByScalar(C,l,q),U=d.add(U,q,U),n.position&&(h[k+D]=U.x,h[z+D]=U.y,h[V+D]=U.z,h[k]=j.x,h[z]=j.y,h[V]=j.z),n.normal||n.tangent||n.bitangent){v=d.clone(C,v);let Y=d.fromArray(e,(k+3)%D,zhe);d.subtract(Y,j,Y);let te=d.subtract(U,j,l7);C=d.normalize(d.cross(te,Y,C),C),n.normal&&(g[k]=C.x,g[z]=C.y,g[V]=C.z,g[k+D]=C.x,g[z+D]=C.y,g[V+D]=C.z),n.tangent&&(S=d.normalize(d.cross(v,C,S),S),m[k]=S.x,m[z]=S.y,m[V]=S.z,m[k+D]=S.x,m[k+1+D]=S.y,m[k+2+D]=S.z),n.bitangent&&(y[k]=v.x,y[z]=v.y,y[V]=v.z,y[k+D]=v.x,y[z+D]=v.y,y[V+D]=v.z)}}if(n.st){D=p.length;for(let k=0;k<D;k+=2)p[k]=(p[k]-_.x)/(w.x-_.x),p[k+1]=(p[k+1]-_.y)/(w.y-_.y)}let N=new fn;if(n.position&&(N.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(N.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(N.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),b&&(N.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:x})),c(t.offsetAttribute)){let k=new Uint8Array(f);if(t.offsetAttribute===Zt.TOP)k=k.fill(1,0,f/2);else{let z=t.offsetAttribute===Zt.NONE?0:1;k=k.fill(z)}N.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return N}function bJe(e){let t=e.length/3,n=Fe.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,l=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=l}return n}var y4=new le,b4=new le;function xJe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,fS),e.height,fS);y4.center=d.add(t,o,y4.center),y4.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),b4.center=d.add(t,o,b4.center),b4.radius=i;let r=$l.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,l=r.outerPositions,u=le.union(y4,b4),f=Khe(s,e,!0),h=$he(a),p=h.length;h.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)h[S+p]=h[S+2]+g,h[S+1+p]=h[S+1]+g,h[S+2+p]=h[S]+g;let m=Fe.createTypedArray(g*2/3,h),y=new ct({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=yJe(l,e);h=bJe(l);let x=Fe.createTypedArray(l.length*2/3,h),A=new ct({attributes:b,indices:x,primitiveType:Me.TRIANGLES}),C=Nn.combineInstances([new St({geometry:y}),new St({geometry:A})]);return{boundingSphere:u,attributes:C[0].attributes,indices:C[0].indices}}function Zhe(e,t,n,i,o,r,s){let l=$l.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=l.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(l,p*3);let h=ce.fromCartesianArray(f,r,s);return h.width>O.PI&&(h.north=h.north>0?O.PI_OVER_TWO-O.EPSILON7:h.north,h.south=h.south<0?O.EPSILON7-O.PI_OVER_TWO:h.south,h.east=O.PI,h.west=-O.PI),h}function km(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.vertexFormat??Ie.DEFAULT;if(T.defined("options.center",t),T.typeOf.number("options.semiMajorAxis",i),T.typeOf.number("options.semiMinorAxis",o),i<o)throw new E("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new E("granularity must be greater than zero.");let a=e.height??0,l=e.extrudedHeight??a;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(l,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(l,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}km.packedLength=d.packedLength+ie.packedLength+Ie.packedLength+9;km.pack=function(e,t,n){return T.defined("value",e),T.defined("array",t),n=n??0,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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]=e._offsetAttribute??-1,t};var Qhe=new d,Jhe=new ie,eme=new Ie,Bm={center:Qhe,ellipsoid:Jhe,vertexFormat:eme,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};km.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Qhe);t+=d.packedLength;let o=ie.unpack(e,t,Jhe);t+=ie.packedLength;let r=Ie.unpack(e,t,eme);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return c(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=l,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Bm.height=f,Bm.extrudedHeight=p,Bm.granularity=h,Bm.stRotation=u,Bm.rotation=l,Bm.semiMajorAxis=s,Bm.semiMinorAxis=a,Bm.shadowVolume=g,Bm.offsetAttribute=m===-1?void 0:m,new km(Bm))};km.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ie.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??O.RADIANS_PER_DEGREE,a=e.rotation??0;if(T.defined("options.center",n),T.typeOf.number("options.semiMajorAxis",o),T.typeOf.number("options.semiMinorAxis",r),o<r)throw new E("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(s<=0)throw new E("granularity must be greater than zero.");return Zhe(n,o,r,a,s,i,t)};km.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!O.equalsEpsilon(t,n,0,O.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=xJe(o);else if(r=gJe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===Zt.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};km.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new km({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function TJe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=$l.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 l=0;l<o;++l)r[l]=d.fromArray(i,l*3);let s=e._ellipsoid,a=e.rectangle;return ct._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(km.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=Zhe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=TJe(this)),this._textureCoordinateRotationPoints}}});var dl=km;var tme=new d,uT=new d;function AJe(e){let t=e.center;uT=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,uT),e.height,uT),uT=d.add(t,uT,uT);let n=new le(uT,e.semiMajorAxis),i=$l.computeEllipsePositions(e,!1,!0).outerPositions,o=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:$l.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Fe.createTypedArray(r,r*2),a=0;for(let l=0;l<r;++l)s[a++]=l,s[a++]=(l+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var T4=new le,A4=new le;function CJe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,tme),e.height,tme);T4.center=d.add(t,o,T4.center),T4.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),A4.center=d.add(t,o,A4.center),A4.radius=i;let r=$l.computeEllipsePositions(e,!1,!0).outerPositions,s=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:$l.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=le.union(T4,A4),l=r.length/3;if(c(e.offsetAttribute)){let m=new Uint8Array(l);if(e.offsetAttribute===Zt.TOP)m=m.fill(1,0,l/2);else{let y=e.offsetAttribute===Zt.NONE?0:1;m=m.fill(y)}s.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=O.clamp(u,0,l/2);let f=Fe.createTypedArray(l,l*2+u*2);l/=2;let h=0,p;for(p=0;p<l;++p)f[h++]=p,f[h++]=(p+1)%l,f[h++]=p+l,f[h++]=(p+1)%l+l;let g;if(u>0){let m=Math.min(u,l);g=Math.round(l/m);let y=Math.min(g*u,l);for(p=0;p<y;p+=g)f[h++]=p,f[h++]=p+l}return{boundingSphere:a,attributes:s,indices:f}}function dS(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE;if(!c(t))throw new E("center is required.");if(!c(i))throw new E("semiMajorAxis is required.");if(!c(o))throw new E("semiMinorAxis is required.");if(i<o)throw new E("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new E("granularity must be greater than zero.");let s=e.height??0,a=e.extrudedHeight??s;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}dS.packedLength=d.packedLength+ie.packedLength+8;dS.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.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]=e._offsetAttribute??-1,t};var nme=new d,ime=new ie,Q_={center:nme,ellipsoid:ime,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};dS.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i=d.unpack(e,t,nme);t+=d.packedLength;let o=ie.unpack(e,t,ime);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=l,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(Q_.height=l,Q_.extrudedHeight=f,Q_.granularity=u,Q_.rotation=a,Q_.semiMajorAxis=r,Q_.semiMinorAxis=s,Q_.numberOfVerticalLines=h,Q_.offsetAttribute=p===-1?void 0:p,new dS(Q_))};dS.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!O.equalsEpsilon(t,n,0,O.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=CJe(o);else if(r=AJe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===Zt.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Hu=dS;var ome=new G,rme=d.ZERO,sme=new d,ame=new ce;function EJe(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 Sh(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new EJe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}c(Object.create)&&(Sh.prototype=Object.create(Gn.prototype),Sh.prototype.constructor=Sh);Sh.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,ome)),c(o)||(o=G.WHITE),i.color=Gt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,rme,sme))),new St({id:t,geometry:new dl(this._options),attributes:i})};Sh.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,ome),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,rme,sme))),new St({id:t,geometry:new Hu(this._options),attributes:r})};Sh.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Sh.prototype._isHidden=function(e,t){let n=e.position;return!c(n)||!c(t.semiMajorAxis)||!c(t.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t)};Sh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Sh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,We.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(dl.computeRectangle(s,ame)).minimumTerrainHeight),s.extrudedHeight=o};Sh.DynamicGeometryUpdater=hS;function hS(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(hS.prototype=Object.create(ni.prototype),hS.prototype.constructor=hS);hS.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.center)||!c(i.semiMajorAxis)||!c(i.semiMinorAxis)||ni.prototype._isHidden.call(this,e,t,n)};hS.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);c(s)&&!c(o)&&(o=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(dl.computeRectangle(i,ame)).minimumTerrainHeight),i.extrudedHeight=s};var DN=Sh;var SJe=new d,wJe=new d,vJe=new d,DJe=new d,PJe=new d,IJe=new d(1,1,1),cme=Math.cos,lme=Math.sin;function J_(e){e=e??W.EMPTY_OBJECT;let t=e.radii??IJe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??O.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??O.PI,a=Math.round(e.stackPartitions??64),l=Math.round(e.slicePartitions??64),u=e.vertexFormat??Ie.DEFAULT;if(l<3)throw new E("options.slicePartitions cannot be less than three.");if(a<3)throw new E("options.stackPartitions cannot be less than three.");this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}J_.packedLength=2*d.packedLength+Ie.packedLength+7;J_.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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._offsetAttribute??-1,t};var ume=new d,fme=new d,dme=new Ie,o0={radii:ume,innerRadii:fme,vertexFormat:dme,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};J_.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i=d.unpack(e,t,ume);t+=d.packedLength;let o=d.unpack(e,t,fme);t+=d.packedLength;let r=Ie.unpack(e,t,dme);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=l,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(o0.minimumClock=s,o0.maximumClock=a,o0.minimumCone=l,o0.maximumCone=u,o0.stackPartitions=f,o0.slicePartitions=h,o0.offsetAttribute=p===-1?void 0:p,new J_(o0))};J_.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,l=e._slicePartitions+1,u=e._stackPartitions+1;l=Math.round(l*Math.abs(o-i)/O.TWO_PI),u=Math.round(u*Math.abs(s-r)/O.PI),l<2&&(l=2),u<2&&(u=2);let f,h,p=0,g=[r],m=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),h=0;h<l;h++)m.push(i+h*(o-i)/(l-1));m.push(o);let y=g.length,b=m.length,x=0,A=1,C=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,P=!1;C&&(A=2,r>0&&(S=!0,x+=l-1),s<Math.PI&&(v=!0,x+=l-1),(o-i)%O.TWO_PI?(P=!0,x+=(u-1)*2+1):x+=1);let M=b*y*A,R=new Float64Array(M*3),L=new Array(M).fill(!1),F=new Array(M).fill(!1),_=l*u*A,w=6*(_+x+1-(l+u)*A),D=Fe.createTypedArray(_,w),I=a.normal?new Float32Array(M*3):void 0,N=a.tangent?new Float32Array(M*3):void 0,k=a.bitangent?new Float32Array(M*3):void 0,z=a.st?new Float32Array(M*2):void 0,V=new Array(y),j=new Array(y);for(f=0;f<y;f++)V[f]=lme(g[f]),j[f]=cme(g[f]);let U=new Array(b),q=new Array(b);for(h=0;h<b;h++)q[h]=cme(m[h]),U[h]=lme(m[h]);for(f=0;f<y;f++)for(h=0;h<b;h++)R[p++]=t.x*V[f]*q[h],R[p++]=t.y*V[f]*U[h],R[p++]=t.z*j[f];let Y=M/2;if(C)for(f=0;f<y;f++)for(h=0;h<b;h++)R[p++]=n.x*V[f]*q[h],R[p++]=n.y*V[f]*U[h],R[p++]=n.z*j[f],L[Y]=!0,f>0&&f!==y-1&&h!==0&&h!==b-1&&(F[Y]=!0),Y++;p=0;let te,K;for(f=1;f<y-2;f++)for(te=f*b,K=(f+1)*b,h=1;h<b-2;h++)D[p++]=K+h,D[p++]=K+h+1,D[p++]=te+h+1,D[p++]=K+h,D[p++]=te+h+1,D[p++]=te+h;if(C){let it=y*b;for(f=1;f<y-2;f++)for(te=it+f*b,K=it+(f+1)*b,h=1;h<b-2;h++)D[p++]=K+h,D[p++]=te+h,D[p++]=te+h+1,D[p++]=K+h,D[p++]=te+h+1,D[p++]=K+h+1}let Z,ee;if(C){if(S)for(ee=y*b,f=1;f<b-2;f++)D[p++]=f,D[p++]=f+1,D[p++]=ee+f+1,D[p++]=f,D[p++]=ee+f+1,D[p++]=ee+f;if(v)for(Z=y*b-b,ee=y*b*A-b,f=1;f<b-2;f++)D[p++]=Z+f+1,D[p++]=Z+f,D[p++]=ee+f,D[p++]=Z+f+1,D[p++]=ee+f,D[p++]=ee+f+1}if(P){for(f=1;f<y-2;f++)ee=b*y+b*f,Z=b*f,D[p++]=ee,D[p++]=Z+b,D[p++]=Z,D[p++]=ee,D[p++]=ee+b,D[p++]=Z+b;for(f=1;f<y-2;f++)ee=b*y+b*(f+1)-1,Z=b*(f+1)-1,D[p++]=Z+b,D[p++]=ee,D[p++]=Z,D[p++]=Z+b,D[p++]=ee+b,D[p++]=ee}let me=new fn;a.position&&(me.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:R}));let Te=0,ue=0,ye=0,Ae=0,Pe=M/2,Ee,ze=ie.fromCartesian3(t),qe=ie.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<M;f++){Ee=L[f]?qe:ze;let it=d.fromArray(R,f*3,SJe),Dt=Ee.geodeticSurfaceNormal(it,wJe);if(F[f]&&d.negate(Dt,Dt),a.st){let jt=H.negate(Dt,PJe);z[Te++]=Math.atan2(jt.y,jt.x)/O.TWO_PI+.5,z[Te++]=Math.asin(Dt.z)/Math.PI+.5}if(a.normal&&(I[ue++]=Dt.x,I[ue++]=Dt.y,I[ue++]=Dt.z),a.tangent||a.bitangent){let jt=vJe,$e=0,un;if(L[f]&&($e=Pe),!S&&f>=$e&&f<$e+b*2?un=d.UNIT_X:un=d.UNIT_Z,d.cross(un,Dt,jt),d.normalize(jt,jt),a.tangent&&(N[ye++]=jt.x,N[ye++]=jt.y,N[ye++]=jt.z),a.bitangent){let zt=d.cross(Dt,jt,DJe);d.normalize(zt,zt),k[Ae++]=zt.x,k[Ae++]=zt.y,k[Ae++]=zt.z}}}a.st&&(me.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:z})),a.normal&&(me.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(me.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(me.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:k}))}if(c(e._offsetAttribute)){let it=R.length,Dt=e._offsetAttribute===Zt.NONE?0:1,jt=new Uint8Array(it/3).fill(Dt);me.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:jt})}return new ct({attributes:me,indices:D,primitiveType:Me.TRIANGLES,boundingSphere:le.fromEllipsoid(ze),offsetAttribute:e._offsetAttribute})};var f7;J_.getUnitEllipsoid=function(){return c(f7)||(f7=J_.createGeometry(new J_({radii:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),f7};var Js=J_;var OJe=new Ut(G.WHITE),d7=d.ZERO,h7=new d,RJe=new d,MJe=new d,m7=new G,LJe=new d(1,1,1);function NJe(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 Gu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new NJe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}c(Object.create)&&(Gu.prototype=Object.create(ii.prototype),Gu.prototype.constructor=Gu);Object.defineProperties(Gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gu.prototype.createFillGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r,s=new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),l=kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:l,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let f;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,m7)),c(f)||(f=G.WHITE),r=Gt.fromColor(f),u.color=r}return c(this._options.offsetAttribute)&&(u.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,d7,h7))),new St({id:i,geometry:new Js(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Gu.prototype.createOutlineGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,m7),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new bn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return c(this._options.offsetAttribute)&&(a.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,d7,h7))),new St({id:i,geometry:new Nu(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Gu.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Gu.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.radii)||ii.prototype._isHidden.call(this,e,t)};Gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};Gu.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?Zt.ALL:void 0};Gu.prototype._onEntityPropertyChanged=qp;Gu.DynamicGeometryUpdater=PN;function PN(e,t,n){ni.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new B,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 d,this._material={}}c(Object.create)&&(PN.prototype=Object.create(ni.prototype),PN.prototype.constructor=PN);PN.prototype.update=function(e){T.defined("time",e);let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,RJe),o=c(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!c(o)||!c(i)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,G.BLACK,m7),l=tr.getValue(e,n.material??OJe,this._material),u=X.getValueOrUndefined(n.innerRadii,e,MJe),f=X.getValueOrUndefined(n.minimumClock,e),h=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),b=X.getValueOrUndefined(n.subdivisions,e),x=X.getValueOrDefault(n.outlineWidth,e,1),A=X.getValueOrDefault(n.heightReference,e,We.NONE),C=A!==We.NONE?Zt.ALL:void 0,S=this._scene.mode,v=S===oe.SCENE3D&&A===We.NONE,P=this._options,M=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),F=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,d7,h7);if(!v||this._lastSceneMode!==S||!c(this._primitive)||P.stackPartitions!==m||P.slicePartitions!==y||c(u)&&!d.equals(P.innerRadii!==u)||P.minimumClock!==f||P.maximumClock!==h||P.minimumCone!==p||P.maximumCone!==g||P.subdivisions!==b||this._lastOutlineWidth!==x||P.offsetAttribute!==C){let w=this._primitives;w.removeAndDestroy(this._primitive),w.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=x,P.stackPartitions=m,P.slicePartitions=y,P.subdivisions=b,P.offsetAttribute=C,P.radii=d.clone(v?LJe:i,P.radii),c(u)?v?P.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,P.innerRadii):P.innerRadii=d.clone(u,P.innerRadii):P.innerRadii=void 0,P.minimumClock=f,P.maximumClock=h,P.minimumCone=p,P.maximumCone=g;let D=new ao({material:l,translucent:l.isTranslucent(),closed:!0});P.vertexFormat=D.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=w.add(new Pn({geometryInstances:I,appearance:D,asynchronous:!1,shadows:M}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=w.add(new Pn({geometryInstances:N,appearance:new rn({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(x)}}),asynchronous:!1,shadows:M})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=G.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=L,this._lastOffset=d.clone(F,this._lastOffset)}else if(this._primitive.ready){let w=this._primitive,D=this._outlinePrimitive;w.show=!0,D.show=!0,w.appearance.material=l;let I=this._attributes;c(I)||(I=w.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=bn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;c(N)||(N=D.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=bn.toValue(s,N.show),this._lastOutlineShow=s),G.equals(a,this._lastOutlineColor)||(N.color=Gt.toValue(a,N.color),G.clone(a,this._lastOutlineColor)),Mt.equals(L,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=kn.toValue(L,I.distanceDisplayCondition),N.distanceDisplayCondition=kn.toValue(L,N.distanceDisplayCondition),Mt.clone(L,this._lastDistanceDisplayCondition)),d.equals(F,this._lastOffset)||(I.offset=eo.toValue(F,I.offset),N.offset=eo.toValue(F,I.offset),d.clone(F,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=B.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var IN=Gu;function mS(e){e=e??W.EMPTY_OBJECT;let t=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}mS.packedLength=Ie.packedLength;mS.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,Ie.pack(e._vertexFormat,t,n),t};var hme=new Ie,FJe={vertexFormat:hme};mS.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=Ie.unpack(e,t,hme);return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new mS(FJe)};var C4=new d(-.5,-.5,0),E4=new d(.5,.5,0);mS.createGeometry=function(e){let t=e._vertexFormat,n=new fn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=C4.x,o[1]=C4.y,o[2]=0,o[3]=E4.x,o[4]=C4.y,o[5]=0,o[6]=E4.x,o[7]=E4.y,o[8]=0,o[9]=C4.x,o[10]=E4.y,o[11]=0,n.position=new ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ct({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var ON=mS;function pS(){this._workerName="createPlaneOutlineGeometry"}pS.packedLength=0;pS.pack=function(e,t){return T.defined("value",e),T.defined("array",t),t};pS.unpack=function(e,t,n){return T.defined("array",e),c(n)?n:new pS};var r0=new d(-.5,-.5,0),S4=new d(.5,.5,0);pS.createGeometry=function(){let e=new fn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=r0.x,n[1]=r0.y,n[2]=r0.z,n[3]=S4.x,n[4]=r0.y,n[5]=r0.z,n[6]=S4.x,n[7]=S4.y,n[8]=r0.z,n[9]=r0.x,n[10]=S4.y,n[11]=r0.z,e.position=new ve({componentDatatype:$.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 ct({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var RN=pS;var BJe=new d,mme=new G;function kJe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function od(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new kJe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}c(Object.create)&&(od.prototype=Object.create(ii.prototype),od.prototype.constructor=od);od.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let g;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,mme)),c(g)||(g=G.WHITE),o=Gt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let l=t.plane,u=this._options,f=t.computeModelMatrix(e),h=X.getValueOrDefault(l.plane,e,u.plane),p=X.getValueOrUndefined(l.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=p7(h,p,f,f),new St({id:t,geometry:new ON(this._options),modelMatrix:f,attributes:i})};od.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,mme),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),l=X.getValueOrDefault(r.plane,e,s.plane),u=X.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=l,s.dimensions=u,a=p7(l,u,a,a),new St({id:t,geometry:new RN,modelMatrix:a,attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};od.prototype._isHidden=function(e,t){return!c(t.plane)||!c(t.dimensions)||!c(e.position)||ii.prototype._isHidden.call(this,e,t)};od.prototype._getIsClosed=function(e){return!1};od.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};od.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};od.DynamicGeometryUpdater=_S;function _S(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(_S.prototype=Object.create(ni.prototype),_S.prototype.constructor=_S);_S.prototype._isHidden=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(e.position,n,BJe);return!c(o)||!c(i.plane)||!c(i.dimensions)||ni.prototype._isHidden.call(this,e,t,n)};_S.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var UJe=new d,VJe=new d,zJe=new d,HJe=new d,GJe=new J,jJe=new J,WJe=new B;function p7(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,zJe),a=d.clone(d.UNIT_Z,VJe);O.equalsEpsilon(Math.abs(d.dot(a,o)),1,O.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let l=d.cross(a,o,UJe);a=d.cross(o,l,a),d.normalize(l,l),d.normalize(a,a);let u=GJe;J.setColumn(u,0,l,u),J.setColumn(u,1,a,u),J.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,HJe),h=J.multiplyByScale(u,f,jJe),p=B.fromRotationTranslation(h,s,WJe);return B.multiplyTransformation(n,p,i)}od.createPrimitiveMatrix=p7;var MN=od;var qJe=new d,YJe=new Ke,XJe=new H,KJe=new H,$Je=new d,ZJe=new d,QJe=new d,LN=new d,JJe=new d,eet=new d,pme=new Le,tet=new J,net=new J,iet=new d;function oet(e,t,n,i,o,r,s,a,l){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Fe.createTypedArray(u.length,f.length);h.set(f);let p=tet;if(i!==0){let _=Le.fromAxisAngle(s,i,pme);if(p=J.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,pme);let w=J.fromQuaternion(_,net);a=d.normalize(J.multiplyByVector(w,a,a),a),t.bitangent&&(l=d.normalize(d.cross(s,a,l),l))}}else p=J.clone(J.IDENTITY,p);let g=KJe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,b=new Float64Array(y),x=t.normal?new Float32Array(y):void 0,A=t.tangent?new Float32Array(y):void 0,C=t.bitangent?new Float32Array(y):void 0,S=t.st?new Float32Array(m*2):void 0,v=0,P=0,M=0,R=0,L=0;for(let _=0;_<m;_++){let w=u[_];if(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z,t.st)if(c(o)&&o.positions.length===m)S[L++]=o.positions[_].x,S[L++]=o.positions[_].y;else{let D=J.multiplyByVector(p,w,qJe),I=r(D,XJe);H.subtract(I,g,I);let N=O.clamp(I.x/n.width,0,1),k=O.clamp(I.y/n.height,0,1);S[L++]=N,S[L++]=k}t.normal&&(x[P++]=s.x,x[P++]=s.y,x[P++]=s.z),t.tangent&&(A[R++]=a.x,A[R++]=a.y,A[R++]=a.z),t.bitangent&&(C[M++]=l.x,C[M++]=l.y,C[M++]=l.z)}let F=new fn;return t.position&&(F.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(F.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(F.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(F.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:C})),t.st&&(F.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:S})),new ct({attributes:F,indices:h,primitiveType:Me.TRIANGLES})}function fT(e){e=e??W.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates;T.defined("options.polygonHierarchy",t);let i=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=zn.computeHierarchyPackedLength(t,d)+Ie.packedLength+ie.packedLength+(c(n)?zn.computeHierarchyPackedLength(n,H):1)+2}fT.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new fT(t)};fT.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,c(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,H):t[n++]=-1,t[n++]=e.packedLength,t};var ret=ie.clone(ie.UNIT_SPHERE),set=new Ie,aet={polygonHierarchy:{}};fT.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,ret);t+=ie.packedLength;let r=Ie.unpack(e,t,set);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,H);c(a)?(t=a.startingIndex,delete a.startingIndex):t++;let l=e[t++];return c(n)||(n=new fT(aet)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=l,n};fT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=c(o),s=n.positions;if(s=xo(s,d.equalsEpsilon,!0),s.length<3)return;let a=$Je,l=ZJe,u=QJe,f=JJe,h=eet;if(!O_.computeProjectTo2DArguments(s,LN,f,h))return;if(a=d.cross(f,h,a),a=d.normalize(a,a),!d.equalsEpsilon(LN,d.ZERO,O.EPSILON6)){let L=e._ellipsoid.geodeticSurfaceNormal(LN,iet);d.dot(a,L)<0&&(a=d.negate(a,a),f=d.negate(f,f))}let g=O_.createProjectPointsTo2DFunction(LN,f,h),m=O_.createProjectPointTo2DFunction(LN,f,h);t.tangent&&(l=d.clone(f,l)),t.bitangent&&(u=d.clone(h,u));let y=zn.polygonsFromHierarchy(n,r,g,!1),b=y.hierarchy,x=y.polygons,A=function(L){return L},C=r?zn.polygonsFromHierarchy(o,!0,A,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=le.fromPoints(s),v=zn.computeBoundingRectangle(a,m,s,i,YJe),P=[];for(let L=0;L<x.length;L++){let F=new St({geometry:oet(x[L],t,v,i,r?C[L]:void 0,m,a,l,u)});P.push(F)}let M=Nn.combineInstances(P)[0];M.attributes.position.values=new Float64Array(M.attributes.position.values),M.indices=Fe.createTypedArray(M.attributes.position.values.length/3,M.indices);let R=M.attributes;return t.position||delete R.position,new ct({attributes:R,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:S})};var NN=fT;var _me=[],w4=[];function cet(e,t,n,i,o){let s=ns.fromPoints(t,e).projectPointsOntoPlane(t,_me);si.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,u,f=t.length,h=0;if(i)for(l=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];l[h++]=m.x,l[h++]=m.y,l[h++]=m.z,l[h++]=y.x,l[h++]=y.y,l[h++]=y.z}else{let m=0;if(o===qt.GEODESIC)for(u=0;u<f;u++)m+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===qt.RHUMB)for(u=0;u<f;u++)m+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(l=new Float64Array(m*3),u=0;u<f;u++){let y;o===qt.GEODESIC?y=zn.subdivideLine(t[u],t[(u+1)%f],n,w4):o===qt.RHUMB&&(y=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,w4));let b=y.length;for(let x=0;x<b;++x)l[h++]=y[x]}}f=l.length/3;let p=f*2,g=Fe.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)g[h++]=u,g[h++]=u+1;return g[h++]=f-1,g[h++]=0,new St({geometry:new ct({attributes:new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})}),indices:g,primitiveType:Me.LINES})})}function uet(e,t,n,i,o){let s=ns.fromPoints(t,e).projectPointsOntoPlane(t,_me);si.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,u,f=t.length,h=new Array(f),p=0;if(i)for(l=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let b=t[u],x=t[(u+1)%f];l[p++]=b.x,l[p++]=b.y,l[p++]=b.z,l[p++]=x.x,l[p++]=x.y,l[p++]=x.z}else{let b=0;if(o===qt.GEODESIC)for(u=0;u<f;u++)b+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===qt.RHUMB)for(u=0;u<f;u++)b+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(l=new Float64Array(b*3*2),u=0;u<f;++u){h[u]=p/3;let x;o===qt.GEODESIC?x=zn.subdivideLine(t[u],t[(u+1)%f],n,w4):o===qt.RHUMB&&(x=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,w4));let A=x.length;for(let C=0;C<A;++C)l[p++]=x[C]}}f=l.length/(3*2);let g=h.length,m=(f*2+g)*2,y=Fe.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=h[u];y[p++]=b,y[p++]=b+f}return new St({geometry:new ct({attributes:new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})}),indices:y,primitiveType:Me.LINES})})}function dT(e){if(T.typeOf.object("options",e),T.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&c(e.height))throw new E("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new E("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.ellipsoid??ie.default,i=e.granularity??O.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&c(e.extrudedHeight),s=e.arcType??qt.GEODESIC,a=e.height??0,l=e.extrudedHeight??a;if(!r){let u=Math.max(a,l);l=Math.min(a,l),a=u}this._ellipsoid=ie.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=l,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,d)+ie.packedLength+8}dT.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var fet=ie.clone(ie.UNIT_SPHERE),det={polygonHierarchy:{}};dT.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,fet);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return c(n)||(n=new dT(det)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=l,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};dT.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);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 dT(t)};dT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=zn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,l=[],u=O.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!O.equalsEpsilon(f,h,0,O.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=uet(t,s[m],u,o,r),a.geometry=zn.scaleToGeodeticHeightExtruded(a.geometry,f,h,t,o),c(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length/3,A=new Uint8Array(x);e._offsetAttribute===Zt.TOP?A=A.fill(1,0,x/2):(g=e._offsetAttribute===Zt.NONE?0:1,A=A.fill(g)),a.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}l.push(a)}else for(m=0;m<s.length;m++){if(a=cet(t,s[m],u,o,r),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),c(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length;g=e._offsetAttribute===Zt.NONE?0:1;let A=new Uint8Array(x/3).fill(g);a.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}l.push(a)}let y=Nn.combineInstances(l)[0],b=le.fromVertices(y.attributes.position.values);return new ct({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var FN=dT;var gme="Entity polygons cannot have both height and perPositionHeight. height will be ignored",yme="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",bme=new G,xme=d.ZERO,Tme=new d,Ame=new ce,het=[],met=new H;function pet(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 ju(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new pet(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}c(Object.create)&&(ju.prototype=Object.create(Gn.prototype),ju.prototype.constructor=ju);ju.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,bme)),c(s)||(s=G.WHITE),o.color=Gt.fromColor(s)}c(i.offsetAttribute)&&(o.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,xme,Tme)));let r;return i.perPositionHeight&&!c(i.extrudedHeight)?r=new NN(i):r=new s_(i),new St({id:t,geometry:r,attributes:o})};ju.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,bme),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};c(i.offsetAttribute)&&(s.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,xme,Tme)));let a;return i.perPositionHeight&&!c(i.extrudedHeight)?a=new $f(i):a=new FN(i),new St({id:t,geometry:a,attributes:s})};ju.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!c(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=ns.fromPoints(i,o),s=r.projectPointsOntoPlane(i,het),a=s.length,l=0,u=a-1,f=new H;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,b=H.add(g,m,met);b=H.multiplyByScalar(b,y,b),f=H.add(f,b,f),l+=y}let h=1/(l*3);return f=H.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};ju.prototype._isHidden=function(e,t){return!c(t.hierarchy)||ii.prototype._isHidden.call(this,e,t)};ju.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=c(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!o};ju.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};ju.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ge.MINIMUM_VALUE),r=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),l=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);r=Gn.getGeometryHeight(r,s);let f;if(u?(c(r)&&(r=void 0,dt(gme)),s!==We.NONE&&u&&(r=void 0,dt(yme))):(c(a)&&!c(r)&&(r=0),f=Gn.computeGeometryOffsetAttribute(r,s,a,l)),i.polygonHierarchy=o,i.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,qt.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,l),a===Gn.CLAMP_TO_GROUND){let h=s_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Ame);a=ui.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};ju.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=c(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};ju.DynamicGeometryUpdater=gS;function gS(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(gS.prototype=Object.create(ni.prototype),gS.prototype.constructor=gS);gS.prototype._isHidden=function(e,t,n){return!c(this._options.polygonHierarchy)||ni.prototype._isHidden.call(this,e,t,n)};gS.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),l=X.getValueOrUndefined(t.perPositionHeight,n);o=Gn.getGeometryHeight(o,s);let u;if(l?(c(o)&&(o=void 0,dt(gme)),r!==We.NONE&&l&&(o=void 0,dt(yme))):(c(a)&&!c(o)&&(o=0),u=Gn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,n,qt.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND){let f=s_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Ame);a=ui.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var BN=ju;function _et(e,t,n,i){let o=new fn;i.position&&(o.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),l=si.triangulate(t),u=(a-1)*r*6+l.length*2,f=Fe.createTypedArray(s,u),h,p,g,m,y,b,x=r*2,A=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)g=p*2+h*r*2,b=g+x,m=g+1,y=m+x,f[A++]=m,f[A++]=g,f[A++]=y,f[A++]=y,f[A++]=g,f[A++]=b;g=r*2-2+h*r*2,m=g+1,y=m+x,b=g+x,f[A++]=m,f[A++]=g,f[A++]=y,f[A++]=y,f[A++]=g,f[A++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),P=1/(a-1),M=1/n.height,R=n.height/2,L,F,_=0;for(h=0;h<a;h++){for(L=h*P,F=M*(t[0].y+R),v[_++]=L,v[_++]=F,p=1;p<r;p++)F=M*(t[p].y+R),v[_++]=L,v[_++]=F,v[_++]=L,v[_++]=F;F=M*(t[0].y+R),v[_++]=L,v[_++]=F}for(p=0;p<r;p++)L=0,F=M*(t[p].y+R),v[_++]=L,v[_++]=F;for(p=0;p<r;p++)L=(a-1)*P,F=M*(t[p].y+R),v[_++]=L,v[_++]=F;o.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let C=s-r*2;for(h=0;h<l.length;h+=3){let v=l[h]+C,P=l[h+1]+C,M=l[h+2]+C;f[A++]=v,f[A++]=P,f[A++]=M,f[A++]=M+r,f[A++]=P+r,f[A++]=v+r}let S=new ct({attributes:o,indices:f,boundingSphere:le.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(S=Nn.computeNormal(S)),i.tangent||i.bitangent){try{S=Nn.computeTangentAndBitangent(S)}catch{dt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function UN(e){e=e??W.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new E("options.polylinePositions is required.");if(!c(n))throw new E("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??Bi.ROUNDED,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+ie.packedLength+Ie.packedLength+2}UN.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Cme=ie.clone(ie.UNIT_SPHERE),Eme=new Ie,kN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Cme,vertexFormat:Eme,cornerType:void 0,granularity:void 0};UN.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=ie.unpack(e,t,Cme);t+=ie.packedLength;let l=Ie.unpack(e,t,Eme);t+=Ie.packedLength;let u=e[t++],f=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(l,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(kN.polylinePositions=r,kN.shapePositions=s,kN.cornerType=u,kN.granularity=f,new UN(kN))};var get=new Ke;UN.createGeometry=function(e){let t=e._positions,n=xo(t,d.equalsEpsilon),i=e._shape;if(i=yh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,get),r=yh.computePositions(n,i,o,e,!0);return _et(r,i,o,e._vertexFormat)};var VN=UN;function yet(e,t){let n=new fn;n.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Fe.createTypedArray(o,2*i*(s+1)),l,u,f=0;l=0;let h=l*i;for(u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,l=s-1,h=l*i,u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,l=0;l<s-1;l++){let g=i*l,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new ct({attributes:n,indices:Fe.createTypedArray(o,a),boundingSphere:le.fromVertices(e),primitiveType:Me.LINES})}function HN(e){e=e??W.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new E("options.polylinePositions is required.");if(!c(n))throw new E("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??Bi.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*H.packedLength,this.packedLength=i+ie.packedLength+2}HN.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=H.packedLength)H.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Sme=ie.clone(ie.UNIT_SPHERE),zN={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Sme,height:void 0,cornerType:void 0,granularity:void 0};HN.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=H.packedLength)s[i]=H.unpack(e,t);let a=ie.unpack(e,t,Sme);t+=ie.packedLength;let l=e[t++],u=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._cornerType=l,n._granularity=u,n):(zN.polylinePositions=r,zN.shapePositions=s,zN.cornerType=l,zN.granularity=u,new HN(zN))};var bet=new Ke;HN.createGeometry=function(e){let t=e._positions,n=xo(t,d.equalsEpsilon),i=e._shape;if(i=yh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,bet),r=yh.computePositions(n,i,o,e,!1);return yet(r,i)};var GN=HN;var wme=new G;function xet(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 Um(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new xet(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}c(Object.create)&&(Um.prototype=Object.create(ii.prototype),Um.prototype.constructor=Um);Um.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,wme)),c(l)||(l=G.WHITE),o=Gt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new VN(this._options),attributes:i})};Um.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,wme),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new GN(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Um.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.shape)||ii.prototype._isHidden.call(this,e,t)};Um.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Um.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,o.shape),o.granularity=c(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,o.cornerType=c(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};Um.DynamicGeometryUpdater=yS;function yS(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(yS.prototype=Object.create(ni.prototype),yS.prototype.constructor=yS);yS.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.polylinePositions)||!c(i.shapePositions)||ni.prototype._isHidden.call(this,e,t,n)};yS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var jN=Um;var _7=new d,Pme=new d,Ime=new d,Ome=new d,Rme=new ce,Tet=new H,Aet=new le,Cet=new le;function Mme(e,t){let n=new ct({attributes:new fn,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Eet(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,l=0,u=Ome,f=Ime,h=Pme;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=d.fromArray(e,p,_7),m=l+1,y=l+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),J.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[l]=h.x,r[m]=h.y,r[y]=h.z),t.tangent&&(s[l]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[l]=u.x,a[m]=u.y,a[y]=u.z),l+=3}return Mme(t,{positions:e,normals:r,tangents:s,bitangents:a})}var g7=new d,Lme=new d;function wet(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,l=0,u=0,f=!0,h=Ome,p=Ime,g=Pme;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=d.fromArray(e,m,_7),b=d.fromArray(e,(m+6)%i,g7);if(f){let x=d.fromArray(e,(m+3)%i,Lme);d.subtract(b,y,b),d.subtract(x,y,x),g=d.normalize(d.cross(x,b,g),g),f=!1}d.equalsEpsilon(b,y,O.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(y,h),t.tangent&&(p=d.normalize(d.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[l++]=p.x,r[l++]=p.y,r[l++]=p.z,r[l++]=p.x,r[l++]=p.y,r[l++]=p.z),t.bitangent&&(s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z)}return Mme(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Nme(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,l=0,u=o,f=o,h=0;s&&(l=1,f-=1,h+=1),a&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,m=0,y=0,b=_7,x=Tet,A=Number.MAX_VALUE,C=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let w=l;w<u;++w)for(let D=0;D<r;++D)Is.computePosition(t,i,n.st,w,D,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[y++]=x.x,g[y++]=x.y,A=Math.min(A,x.x),C=Math.min(C,x.y),S=Math.max(S,x.x),v=Math.max(v,x.y));if(s&&(Is.computePosition(t,i,n.st,0,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[y++]=x.x,g[y++]=x.y,A=x.x,C=x.y,S=x.x,v=x.y)),a&&(Is.computePosition(t,i,n.st,o-1,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(g[y++]=x.x,g[y]=x.y,A=Math.min(A,x.x),C=Math.min(C,x.y),S=Math.max(S,x.x),v=Math.max(v,x.y))),n.st&&(A<0||C<0||S>1||v>1))for(let w=0;w<g.length;w+=2)g[w]=(g[w]-A)/(S-A),g[w+1]=(g[w+1]-C)/(v-C);let P=Eet(p,n,i,t.tangentRotationMatrix),M=6*(r-1)*(f-1);s&&(M+=3*(r-1)),a&&(M+=3*(r-1));let R=Fe.createTypedArray(h,M),L=0,F=0,_;for(_=0;_<f-1;++_){for(let w=0;w<r-1;++w){let D=L,I=D+r,N=I+1,k=D+1;R[F++]=D,R[F++]=I,R[F++]=k,R[F++]=k,R[F++]=I,R[F++]=N,++L}++L}if(s||a){let w=h-1,D=h-1;s&&a&&(w=h-2);let I,N;if(L=0,s)for(_=0;_<r-1;_++)I=L,N=I+1,R[F++]=w,R[F++]=I,R[F++]=N,++L;if(a)for(L=(f-1)*r,_=0;_<r-1;_++)I=L,N=I+1,R[F++]=I,R[F++]=D,R[F++]=N,++L}return P.indices=R,n.st&&(P.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:g})),P}function bS(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 xS(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 y7=new Ie;function vet(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,l=t.height,u=t.width,f;if(n){let $e=Ie.clone(o,y7);$e.normal=!0,e._vertexFormat=$e}let h=Nme(e,t);n&&(e._vertexFormat=o);let p=si.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let b=si.scaleToGeodeticHeight(h.attributes.position.values,r,a);y.set(b,g),h.attributes.position.values=y;let x=o.normal?new Float32Array(m):void 0,A=o.tangent?new Float32Array(m):void 0,C=o.bitangent?new Float32Array(m):void 0,S=o.st?new Float32Array(m/3*2):void 0,v,P;if(o.normal){for(P=h.attributes.normal.values,x.set(P),f=0;f<g;f++)P[f]=-P[f];x.set(P,g),h.attributes.normal.values=x}if(n){P=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let $e=new Float32Array(m);for(f=0;f<g;f++)P[f]=-P[f];$e.set(P,g),h.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:$e})}let M,R=c(i);if(R){let $e=g/3*2,un=new Uint8Array($e);i===Zt.TOP?un=un.fill(1,0,$e/2):(M=i===Zt.NONE?0:1,un=un.fill(M)),h.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:un})}if(o.tangent){let $e=h.attributes.tangent.values;for(A.set($e),f=0;f<g;f++)$e[f]=-$e[f];A.set($e,g),h.attributes.tangent.values=A}if(o.bitangent){let $e=h.attributes.bitangent.values;C.set($e),C.set($e,g),h.attributes.bitangent.values=C}o.st&&(v=h.attributes.st.values,S.set(v),S.set(v,g/3*2),h.attributes.st.values=S);let L=h.indices,F=L.length,_=g/3,w=Fe.createTypedArray(m/3,F*2);for(w.set(L),f=0;f<F;f+=3)w[f+F]=L[f+2]+_,w[f+1+F]=L[f+1]+_,w[f+2+F]=L[f]+_;h.indices=w;let D=t.northCap,I=t.southCap,N=l,k=2,z=0,V=4,j=4;D&&(k-=1,N-=1,z+=1,V-=2,j-=1),I&&(k-=1,N-=1,z+=1,V-=2,j-=1),z+=k*u+2*N-V;let U=(z+j)*2,q=new Float64Array(U*3),Y=n?new Float32Array(U*3):void 0,te=R?new Uint8Array(U):void 0,K=o.st?new Float32Array(U*2):void 0,Z=i===Zt.TOP;R&&!Z&&(M=i===Zt.ALL?1:0,te=te.fill(M));let ee=0,me=0,Te=0,ue=0,ye=u*N,Ae;for(f=0;f<ye;f+=u)Ae=f*3,q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,f*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(I){let $e=D?ye+1:ye;for(Ae=$e*3,f=0;f<2;f++)q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,$e*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=ye-u;f<ye;f++)Ae=f*3,q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,f*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);for(f=ye-1;f>0;f-=u)Ae=f*3,q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,f*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(D){let $e=ye;for(Ae=$e*3,f=0;f<2;f++)q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,$e*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=u-1;f>=0;f--)Ae=f*3,q=bS(q,ee,Ae,p,b),ee+=6,o.st&&(K=xS(K,me,f*2,v),me+=4),n&&(Te+=3,Y[Te++]=P[Ae],Y[Te++]=P[Ae+1],Y[Te++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);let Pe=wet(q,o,a);o.st&&(Pe.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:K})),n&&(Pe.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:Y})),R&&(Pe.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ee=Fe.createTypedArray(U,z*6),ze,qe,it,Dt;g=q.length/3;let jt=0;for(f=0;f<g-1;f+=2){ze=f,Dt=(ze+2)%g;let $e=d.fromArray(q,ze*3,g7),un=d.fromArray(q,Dt*3,Lme);d.equalsEpsilon($e,un,O.EPSILON10)||(qe=(ze+1)%g,it=(qe+2)%g,Ee[jt++]=ze,Ee[jt++]=qe,Ee[jt++]=Dt,Ee[jt++]=Dt,Ee[jt++]=qe,Ee[jt++]=it)}return Pe.indices=Ee,Pe=Nn.combineInstances([new St({geometry:h}),new St({geometry:Pe})]),Pe[0]}var Det=[new d,new d,new d,new d],Fme=new he,Pet=new he;function b7(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=Is.computeOptions(e,t,n,0,Rme,Fme),s=r.height,a=r.width,l=Det;return Is.computePosition(r,i,!1,0,0,l[0]),Is.computePosition(r,i,!1,0,a-1,l[1]),Is.computePosition(r,i,!1,s-1,0,l[2]),Is.computePosition(r,i,!1,s-1,a-1,l[3]),ce.fromCartesianArray(l,i,o)}function Vm(e){e=e??W.EMPTY_OBJECT;let t=e.rectangle;if(T.typeOf.object("rectangle",t),ce._validate(t),t.north<t.south)throw new E("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ce.clone(t),this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Vm.packedLength=ce.packedLength+ie.packedLength+Ie.packedLength+7;Vm.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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]=e._offsetAttribute??-1,t};var Bme=new ce,kme=ie.clone(ie.UNIT_SPHERE),s0={rectangle:Bme,ellipsoid:kme,vertexFormat:y7,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Vm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=ce.unpack(e,t,Bme);t+=ce.packedLength;let o=ie.unpack(e,t,kme);t+=ie.packedLength;let r=Ie.unpack(e,t,y7);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return c(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=l,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(s0.granularity=s,s0.height=a,s0.rotation=l,s0.stRotation=u,s0.extrudedHeight=f,s0.shadowVolume=h,s0.offsetAttribute=p===-1?void 0:p,new Vm(s0))};Vm.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.rectangle;if(T.typeOf.object("rectangle",n),ce._validate(n),n.north<n.south)throw new E("options.rectangle.north must be greater than or equal to options.rectangle.south");let i=e.granularity??O.RADIANS_PER_DEGREE,o=e.ellipsoid??ie.default,r=e.rotation??0;return b7(n,i,r,o,t)};var Iet=new J,vme=new Le,Oet=new he;Vm.createGeometry=function(e){if(O.equalsEpsilon(e._rectangle.north,e._rectangle.south,O.EPSILON10)||O.equalsEpsilon(e._rectangle.east,e._rectangle.west,O.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Is.computeOptions(t,e._granularity,i,o,Rme,Fme,Pet),a=Iet;if(o!==0||i!==0){let g=ce.center(t,Oet),m=n.geodeticSurfaceNormalCartographic(g,g7);Le.fromAxisAngle(m,-o,vme),J.fromQuaternion(vme,a)}else J.clone(J.IDENTITY,a);let l=e._surfaceHeight,u=e._extrudedHeight,f=!O.equalsEpsilon(l,u,0,O.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,f){h=vet(e,s);let g=le.fromRectangle3D(t,n,l,Cet),m=le.fromRectangle3D(t,n,u,Aet);p=le.union(g,m)}else{if(h=Nme(e,s),h.attributes.position.values=si.scaleToGeodeticHeight(h.attributes.position.values,l,n,!1),c(e._offsetAttribute)){let g=h.attributes.position.values.length,m=e._offsetAttribute===Zt.NONE?0:1,y=new Uint8Array(g/3).fill(m);h.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=le.fromRectangle3D(t,n,l)}return r.position||delete h.attributes.position,new ct({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Vm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Vm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var Dme=new ce,Ret=[new H,new H,new H],Met=new Ri,Let=new he;function Net(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,Dme),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=b7(t,n,o,i,Dme),s=Ret;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,l=Ri.fromRotation(e._stRotation,Met),u=ce.center(a,Let);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,Ri.multiplyByVector(l,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],h=s[1],p=s[2],g=new Array(6);return H.pack(f,g),H.pack(h,g,2),H.pack(p,g,4),g}Object.defineProperties(Vm.prototype,{rectangle:{get:function(){return c(this._rotatedRectangle)||(this._rotatedRectangle=b7(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Net(this)),this._textureCoordinateRotationPoints}}});var hT=Vm;var Ume=new G,Vme=d.ZERO,zme=new d,Hme=new ce,Fet=new ce,Bet=new he;function ket(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 wh(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new ket(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}c(Object.create)&&(wh.prototype=Object.create(Gn.prototype),wh.prototype.constructor=wh);wh.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Ume)),c(o)||(o=G.WHITE),i.color=Gt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Vme,zme))),new St({id:t,geometry:new hT(this._options),attributes:i})};wh.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Ume),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Vme,zme))),new St({id:t,geometry:new Hx(this._options),attributes:r})};wh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,Fet);if(!c(n))return;let i=ce.center(n,Bet);return he.toCartesian(i,ie.default,t)};wh.prototype._isHidden=function(e,t){return!c(t.coordinates)||ii.prototype._isHidden.call(this,e,t)};wh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};wh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=X.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),o=X.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,We.NONE);c(r)&&!c(i)&&(i=0);let a=this._options;a.vertexFormat=n?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Gn.getGeometryHeight(i,o),r=Gn.getGeometryExtrudedHeight(r,s),r===Gn.CLAMP_TO_GROUND&&(r=ui.getMinimumMaximumHeights(hT.computeRectangle(a,Hme)).minimumTerrainHeight),a.extrudedHeight=r};wh.DynamicGeometryUpdater=TS;function TS(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(TS.prototype=Object.create(ni.prototype),TS.prototype.constructor=TS);TS.prototype._isHidden=function(e,t,n){return!c(this._options.rectangle)||ni.prototype._isHidden.call(this,e,t,n)};TS.prototype._setOptions=function(e,t,n){let i=this._options,o=X.getValueOrUndefined(t.height,n),r=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);c(s)&&!c(o)&&(o=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(hT.computeRectangle(i,Hme)).minimumTerrainHeight),i.extrudedHeight=s};var WN=wh;var Gme={};function Uet(e,t){return O.equalsEpsilon(e.latitude,t.latitude,O.EPSILON10)&&O.equalsEpsilon(e.longitude,t.longitude,O.EPSILON10)}var Vet=new he,zet=new he;function Het(e,t,n,i){t=xo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=c(i),s=c(n),a=new Array(o),l=new Array(o),u=new Array(o),f=t[0];a[0]=f;let h=e.cartesianToCartographic(f,Vet);s&&(h.height=n[0]),l[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=l[0],g=u[0],m=p===g,y=1;for(let b=1;b<o;++b){let x=t[b],A=e.cartesianToCartographic(x,zet);s&&(A.height=n[b]),m=m&&A.height===0,Uet(h,A)?h.height<A.height&&(l[y-1]=A.height):(a[y]=x,l[y]=A.height,r?u[y]=i[b]:u[y]=0,m=m&&l[y]===u[y],he.clone(A,h),++y)}if(!(m||y<2))return a.length=y,l.length=y,u.length=y,{positions:a,topHeights:l,bottomHeights:u}}var Get=new Array(2),jet=new Array(2),Wet={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Gme.computePositions=function(e,t,n,i,o,r){let s=Het(e,t,n,i);if(!c(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,l=a-2,u,f,h=O.chordLength(o,e.maximumRadius),p=Wet;if(p.minDistance=h,p.ellipsoid=e,r){let g=0,m;for(m=0;m<a-1;m++)g+=Fi.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=Get,b=jet;p.positions=y,p.height=b;let x=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let A=Fi.generateArc(p);u.set(A,x),b[0]=i[m],b[1]=i[m+1],f.set(Fi.generateArc(p),x),x+=A.length}}else p.positions=t,p.height=n,u=new Float64Array(Fi.generateArc(p)),p.height=i,f=new Float64Array(Fi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:l}};var mT=Gme;var x7=new d,v4=new d,qet=new d,jme=new d,Yet=new d,Xet=new d,Ket=new d;function pT(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new E("options.positions is required.");if(c(n)&&n.length!==t.length)throw new E("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new E("options.positions and options.minimumHeights must have the same length.");let o=e.vertexFormat??Ie.DEFAULT,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ie.clone(s),this._workerName="createWallGeometry";let a=1+t.length*d.packedLength+2;c(i)&&(a+=i.length),c(n)&&(a+=n.length),this.packedLength=a+ie.packedLength+Ie.packedLength+1}pT.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var Wme=ie.clone(ie.UNIT_SPHERE),qme=new Ie,qN={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Wme,vertexFormat:qme,granularity:void 0};pT.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.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 l=ie.unpack(e,t,Wme);t+=ie.packedLength;let u=Ie.unpack(e,t,qme);t+=Ie.packedLength;let f=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(l,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(qN.positions=r,qN.minimumHeights=s,qN.maximumHeights=a,qN.granularity=f,new pT(qN))};pT.fromConstantHeights=function(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new E("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new pT(l)};pT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=mT.computePositions(s,t,i,n,r,!0);if(!c(a))return;let l=a.bottomPositions,u=a.topPositions,f=a.numCorners,h=u.length,p=h*2,g=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,x=o.st?new Float32Array(p/3*2):void 0,A=0,C=0,S=0,v=0,P=0,M=Ket,R=Xet,L=Yet,F=!0;h/=3;let _,w=0,D=1/(h-f-1);for(_=0;_<h;++_){let V=_*3,j=d.fromArray(u,V,x7),U=d.fromArray(l,V,v4);if(o.position&&(g[A++]=U.x,g[A++]=U.y,g[A++]=U.z,g[A++]=j.x,g[A++]=j.y,g[A++]=j.z),o.st&&(x[P++]=w,x[P++]=0,x[P++]=w,x[P++]=1),o.normal||o.tangent||o.bitangent){let q=d.clone(d.ZERO,jme),Y=d.subtract(j,s.geodeticSurfaceNormal(j,v4),v4);if(_+1<h&&(q=d.fromArray(u,V+3,jme)),F){let te=d.subtract(q,j,qet),K=d.subtract(Y,j,x7);M=d.normalize(d.cross(K,te,M),M),F=!1}d.equalsEpsilon(j,q,O.EPSILON10)?F=!0:(w+=D,o.tangent&&(R=d.normalize(d.subtract(q,j,R),R)),o.bitangent&&(L=d.normalize(d.cross(M,R,L),L))),o.normal&&(m[C++]=M.x,m[C++]=M.y,m[C++]=M.z,m[C++]=M.x,m[C++]=M.y,m[C++]=M.z),o.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),o.bitangent&&(b[S++]=L.x,b[S++]=L.y,b[S++]=L.z,b[S++]=L.x,b[S++]=L.y,b[S++]=L.z)}}let I=new fn;o.position&&(I.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(I.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:x}));let N=p/3;p-=6*(f+1);let k=Fe.createTypedArray(N,p),z=0;for(_=0;_<N-2;_+=2){let V=_,j=_+2,U=d.fromArray(g,V*3,x7),q=d.fromArray(g,j*3,v4);if(d.equalsEpsilon(U,q,O.EPSILON10))continue;let Y=_+1,te=_+3;k[z++]=Y,k[z++]=V,k[z++]=te,k[z++]=te,k[z++]=V,k[z++]=j}return new ct({attributes:I,indices:k,primitiveType:Me.TRIANGLES,boundingSphere:new le.fromVertices(g)})};var YN=pT;var Yme=new d,Xme=new d;function _T(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new E("options.positions is required.");if(c(n)&&n.length!==t.length)throw new E("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new E("options.positions and options.minimumHeights must have the same length.");let o=e.granularity??O.RADIANS_PER_DEGREE,r=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ie.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*d.packedLength+2;c(i)&&(s+=i.length),c(n)&&(s+=n.length),this.packedLength=s+ie.packedLength+1}_T.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n]=e._granularity,t};var Kme=ie.clone(ie.UNIT_SPHERE),XN={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Kme,granularity:void 0};_T.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.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 l=ie.unpack(e,t,Kme);t+=ie.packedLength;let u=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(l,n._ellipsoid),n._granularity=u,n):(XN.positions=r,XN.minimumHeights=s,XN.maximumHeights=a,XN.granularity=u,new _T(XN))};_T.fromConstantHeights=function(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new E("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new _T(l)};_T.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=mT.computePositions(r,t,i,n,o,!1);if(!c(s))return;let a=s.bottomPositions,l=s.topPositions,u=l.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let A=g*3,C=d.fromArray(l,A,Yme),S=d.fromArray(a,A,Xme);h[p++]=S.x,h[p++]=S.y,h[p++]=S.z,h[p++]=C.x,h[p++]=C.y,h[p++]=C.z}let m=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h})}),y=f/3;f=2*y-4+y;let b=Fe.createTypedArray(y,f),x=0;for(g=0;g<y-2;g+=2){let A=g,C=g+2,S=d.fromArray(h,A*3,Yme),v=d.fromArray(h,C*3,Xme);if(d.equalsEpsilon(S,v,O.EPSILON10))continue;let P=g+1,M=g+3;b[x++]=P,b[x++]=A,b[x++]=P,b[x++]=M,b[x++]=A,b[x++]=C}return b[x++]=y-2,b[x++]=y-1,new ct({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new le.fromVertices(h)})};var KN=_T;var $me=new G;function $et(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 vh(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new $et(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}c(Object.create)&&(vh.prototype=Object.create(ii.prototype),vh.prototype.constructor=vh);vh.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,$me)),c(l)||(l=G.WHITE),o=Gt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new YN(this._options),attributes:i})};vh.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new E("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,$me),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new KN(this._options),attributes:{show:new bn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Gt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};vh.prototype._isHidden=function(e,t){return!c(t.positions)||ii.prototype._isHidden.call(this,e,t)};vh.prototype._getIsClosed=function(e){return!1};vh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};vh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?rn.VERTEX_FORMAT:ao.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=c(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=c(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=c(o)?o.getValue(Ge.MINIMUM_VALUE):void 0};vh.DynamicGeometryUpdater=AS;function AS(e,t,n){ni.call(this,e,t,n)}c(Object.create)&&(AS.prototype=Object.create(ni.prototype),AS.prototype.constructor=AS);AS.prototype._isHidden=function(e,t,n){return!c(this._options.positions)||ni.prototype._isHidden.call(this,e,t,n)};AS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var $N=vh;var gT=[HO,pN,sN,DN,IN,MN,BN,jN,WN,$N];function yT(e,t){this.entity=e,this.scene=t;let n=new Array(gT.length),i=new pe,o=new gr;for(let r=0;r<n.length;r++){let s=new gT[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(yT.prototype._onEntityPropertyChanged,this)}yT.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)};yT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};yT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),de(this)};yT.registerUpdater=function(e){gT.includes(e)||gT.push(e)};yT.unregisterUpdater=function(e){if(gT.includes(e)){let t=gT.indexOf(e);gT.splice(t,1)}};var bT=yT;var Zme=new G,Zet=new Mt,Qet=new Mt,Jet=d.ZERO,ett=new d;function Dh(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 Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.invalidated=!1;let a;c(o)&&(a=o.definitionChanged.addEventListener(Dh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Dh.prototype.onMaterialChanged=function(){this.invalidated=!0};Dh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:c(t)?t.equals(n):!1};Dh.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.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)}))}};Dh.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Dh.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){c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let l;c(this.depthFailAppearanceType)&&(c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),l=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new Pn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:l,shadows:this.shadows}),o.add(i),t=!1}else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||l){let b=u.fillMaterialProperty.color,x=X.getValueOrDefault(b,e,G.WHITE,Zme);G.equals(h._lastColor,x)||(h._lastColor=G.clone(x,h._lastColor),h.color=Gt.toValue(x,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(c(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Ut&&(!u.depthFailMaterialProperty.isConstant||l)){let b=u.depthFailMaterialProperty.color,x=X.getValueOrDefault(b,e,G.WHITE,Zme);G.equals(h._lastDepthFailColor,x)||(h._lastDepthFailColor=G.clone(x,h._lastDepthFailColor),h.depthFailColor=Gt.toValue(x,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=bn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let b=X.getValueOrDefault(m,e,Qet,Zet);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let b=X.getValueOrDefault(y,e,Jet,ett);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=eo.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Dh.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Dh.prototype.contains=function(e){return this.updaters.contains(e.id)};Dh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Dh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),c(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function CS(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}CS.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 l=n[a];if(l.isMaterial(t)){l.add(t,o);return}}let s=new Dh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Qme(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}CS.prototype.remove=function(e){Qme(this._solidItems,e)||Qme(this._translucentItems,e)};function Jme(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,l=a.length;if(l>0)for(r=0;r<l;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function D4(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,l=a.length;for(let u=0;u<l;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}CS.prototype.update=function(e){let t=D4(this,this._solidItems,e,!0);t=D4(this,this._translucentItems,e,t)&&t;let n=Jme(this,this._solidItems,e),i=Jme(this,this._translucentItems,e);return(n||i)&&(t=D4(this,this._solidItems,e,t)&&t,t=D4(this,this._translucentItems,e,t)&&t),t};function epe(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 lt.FAILED}CS.prototype.getBoundingSphere=function(e,t){let n=epe(this._solidItems,e,t);return n===lt.FAILED?epe(this._translucentItems,e,t):n};function tpe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}CS.prototype.removeAllPrimitives=function(){tpe(this._solidItems),tpe(this._translucentItems)};var rd=CS;var ttt=new Mt,ntt=new Mt,itt=d.ZERO,ott=new d;function Ph(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 Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ph.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et}Ph.prototype.onMaterialChanged=function(){this.invalidated=!0};Ph.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=c(t)&&t.equals(n);return r=(!c(i)&&!c(o)||c(i)&&i.equals(o))&&r,r};Ph.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||!X.isConstant(t.distanceDisplayConditionProperty)||!X.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};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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var rtt=new G;Ph.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){c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material);let a;c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=tr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new Pn({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=tr.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 l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);if(c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),c(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!l.depthFailMaterialProperty.isConstant){let b=l.depthFailMaterialProperty.color,x=X.getValueOrDefault(b,e,G.WHITE,rtt);G.equals(h._lastDepthFailColor,x)||(h._lastDepthFailColor=G.clone(x,h._lastDepthFailColor),h.depthFailColor=Gt.toValue(x,h.depthFailColor))}let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=bn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!X.isConstant(m)){let b=X.getValueOrDefault(m,e,ntt,ttt);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=l.terrainOffsetProperty;if(!X.isConstant(y)){let b=X.getValueOrDefault(y,e,itt,ott);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=eo.toValue(b,h.offset))}}this.updateShows(n)}else c(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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=bn.toValue(l,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 lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Ph.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function ES(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}ES.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 Ph(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};ES.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}}};ES.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};ES.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 lt.FAILED};ES.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 sd=ES;var ipe=Zo(npe(),1);function P4(){this._tree=new ipe.default}function xT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}xT.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};P4.prototype.insert=function(e,t){T.typeOf.string("id",e),T.typeOf.object("rectangle",t);let n=xT.fromRectangleAndId(e,t,new xT);this._tree.insert(n)};function stt(e,t){return e.id===t.id}var att=new xT;P4.prototype.remove=function(e,t){T.typeOf.string("id",e),T.typeOf.object("rectangle",t);let n=xT.fromRectangleAndId(e,t,att);this._tree.remove(n,stt)};var ctt=new xT;P4.prototype.collides=function(e){T.typeOf.object("rectangle",e);let t=xT.fromRectangleAndId("",e,ctt);return this._tree.collides(t)};var TT=P4;var ltt=new G,utt=new Mt,ftt=new Mt;function eg(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 Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new TT}eg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};eg.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||!X.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)}))}};eg.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 c(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};eg.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new jc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||l){let y=u.fillMaterialProperty.color,b=X.getValueOrDefault(y,e,G.WHITE,ltt);G.equals(h._lastColor,b)||(h._lastColor=G.clone(b,h._lastColor),h.color=Gt.toValue(b,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=bn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,ftt,utt);Mt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};eg.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};eg.prototype.contains=function(e){return this.updaters.contains(e.id)};eg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getBoundingSphere(e.entity);return c(i)?(i.clone(t),lt.DONE):lt.FAILED};eg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function SS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}SS.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=X.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let l=i[a];if(l.zIndex===o&&!l.overlapping(n.geometry.rectangle)){r=l;break}}return c(r)||(r=new eg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};SS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};SS.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,l=a.length;for(let u=0;u<l;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.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};SS.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 lt.FAILED};SS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var wS=SS;var dtt=new Mt,htt=new Mt;function ad(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(ad.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new TT}ad.prototype.onMaterialChanged=function(){this.invalidated=!0};ad.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};ad.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};ad.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};ad.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 c(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};ad.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=tr.getValue(e,this.materialProperty,this.material),n=new jc({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=tr.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 l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=bn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,htt,dtt);Mt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};ad.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=bn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};ad.prototype.contains=function(e){return this.updaters.contains(e.id)};ad.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};ad.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function vS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}vS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=bu.shouldUseSphericalCoordinates(o.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let l=0;l<i;++l){let u=n[l];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new ad(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};vS.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}}};vS.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};vS.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 lt.FAILED};vS.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 ZN=vS;var mtt=new G,ptt=new Mt,_tt=new Mt,gtt=d.ZERO,ytt=new d;function tg(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 Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.itemsToRemove=[],this.subscriptions=new Et,this.showsUpdated=new Et}tg.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.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)}))}};tg.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};tg.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Pn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new rn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||l){let b=u.outlineColorProperty,x=X.getValueOrDefault(b,e,G.WHITE,mtt);G.equals(h._lastColor,x)||(h._lastColor=G.clone(x,h._lastColor),h.color=Gt.toValue(x,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=h.show[0]===1;p!==g&&(h.show=bn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let b=X.getValueOrDefault(m,e,_tt,ptt);Mt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let b=X.getValueOrDefault(y,e,gtt,ytt);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=eo.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};tg.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=bn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};tg.prototype.contains=function(e){return this.updaters.contains(e.id)};tg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};tg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function DS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Et,this._translucentBatches=new Et}DS.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),c(r)||(r=new tg(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),c(r)||(r=new tg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};DS.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};DS.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,l=a.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<l;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};DS.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 lt.FAILED};DS.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 PS=DS;var btt=[];function Zl(e,t,n,i){T.defined("scene",e),T.defined("entityCollection",t),n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let o=xn.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=nr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new PS(n,e,s,!1),this._outlineBatches[o+s]=new PS(n,e,s,!0),this._closedColorBatches[s]=new rd(n,rn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new rd(n,rn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new sd(n,ao,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new sd(n,ao,void 0,!0,s,!1),this._openColorBatches[s]=new rd(n,rn,void 0,!1,s,!0),this._openColorBatches[o+s]=new rd(n,rn,void 0,!1,s,!1),this._openMaterialBatches[s]=new sd(n,ao,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new sd(n,ao,void 0,!1,s,!1);let a=Un.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new ZN(i,s,ao)),l[s]=new wS(i,s);else for(s=0;s<a;++s)l[s]=new wS(i,s);this._groundColorBatches=l,this._groundMaterialBatches=u,this._dynamicBatch=new cT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Et,this._updaterSets=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Zl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,btt)}Zl.registerUpdater=function(e){bT.registerUpdater(e)};Zl.unregisterUpdater=function(e){bT.unregisterUpdater(e)};Zl.prototype.update=function(e){T.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,u,f,h=this;for(a=s.length-1;a>-1;a--)l=s[a],u=l.id,f=this._updaterSets.get(u),f.entity===l?f.forEach(function(y){h._removeUpdater(y),h._insertUpdaterIntoBatch(e,y)}):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new bT(l,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){h._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Zl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var xtt=[],Ttt=new le;Zl.prototype.getBoundingSphere=function(e,t){T.defined("entity",e),T.defined("result",t);let n=xtt,i=Ttt,o=0,r=lt.DONE,s=this._batches,a=s.length,l=e.id,u=this._updaterSets.get(l).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?lt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),lt.DONE)};Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Zl.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(),de(this)};Zl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Zl.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=xn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(c(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 Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Zl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Zl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var QN=Zl;var Att=1,Ctt="30px sans-serif",Ett=Yo.FILL,Stt=G.WHITE,wtt=G.BLACK,vtt=1,Dtt=!1,Ptt=new G(.165,.165,.165,.8),Itt=new H(7,5),Ott=H.ZERO,Rtt=d.ZERO,Mtt=We.NONE,Ltt=bi.CENTER,Ntt=Fn.CENTER,Ftt=new d,Btt=new G,ktt=new G,Utt=new G,Vtt=new H,ztt=new d,Htt=new H,Gtt=new Bt,jtt=new Bt,Wtt=new Bt,qtt=new Mt;function ope(e){this.entity=e,this.label=void 0,this.index=void 0}function a0(e,t){if(!c(e))throw new E("entityCluster is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(a0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}a0.prototype.update=function(e){if(!c(e))throw new E("time is required.");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,l,u=r.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),h;if(f&&(h=X.getValueOrUndefined(s._position,e,Ftt),l=X.getValueOrUndefined(a._text,e),f=c(h)&&c(l)),!f){C7(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,Mtt);c(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=d.equals(u.position,h)&&u.heightReference===g),u.show=!0,u.position=h,u.text=l,u.scale=X.getValueOrDefault(a._scale,e,Att),u.font=X.getValueOrDefault(a._font,e,Ctt),u.style=X.getValueOrDefault(a._style,e,Ett),u.fillColor=X.getValueOrDefault(a._fillColor,e,Stt,Btt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,wtt,ktt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,vtt),u.showBackground=X.getValueOrDefault(a._showBackground,e,Dtt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,Ptt,Utt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,Itt,Vtt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,Ott,Htt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,Rtt,ztt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,Ltt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,Ntt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Gtt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,jtt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,Wtt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,qtt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};a0.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.label))return lt.FAILED;let i=n.label;return t.center=d.clone(i._clampedPosition??i.position,t.center),t.radius=0,lt.DONE};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(a0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return de(this)};a0.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],c(r._label)&&c(r._position)&&s.set(r.id,new ope(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._label)&&c(r._position)?s.contains(r.id)||s.set(r.id,new ope(r)):(C7(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],C7(s.get(r.id),r,a),s.remove(r.id)};function C7(e,t,n){c(e)&&(e.label=void 0,n.removeLabel(t))}var JN=a0;var Ytt=1,Xtt=!0,Ktt=0,$tt=!0,Ztt=!0,Qtt=xn.ENABLED,Jtt=We.NONE,ent=G.RED,tnt=0,nnt=G.WHITE,int=bc.HIGHLIGHT,ont=.5,rnt=new H(1,1),rpe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},snt=new B,ant=new B,spe=new G,ape=new Array(4),cnt=new d;function c0(e,t){T.typeOf.object("scene",e),T.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(c0.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function lnt(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await lh.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!c(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(l=>{c(s[t.id])&&(console.log(l),l.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!c(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}c0.prototype.update=function(e){if(!c(e))throw new E("time is required.");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,l,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),h;if(f&&(h=s.computeModelMatrix(e,snt),l=we.createIfNeeded(X.getValueOrUndefined(a._uri,e)),f=c(h)&&c(l)),!f){c(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!c(u)||l.url!==u.url){c(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:l.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...rpe}},n[s.id]=u;let m=X.getValueOrDefault(a._incrementallyLoadTextures,e,$tt),y=X.getValueOrDefault(a._environmentMapOptions,e,rpe,u.environmentMapOptionsScratch);lnt(this,s,l,m,y)}let p=u.modelPrimitive;if(!c(p))continue;p.show=!0,p.scale=X.getValueOrDefault(a._scale,e,Ytt),p.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,Xtt),p.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,Ktt),p.maximumScale=X.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=B.clone(h,p.modelMatrix),p.shadows=X.getValueOrDefault(a._shadows,e,Qtt),p.heightReference=X.getValueOrDefault(a._heightReference,e,Jtt),p.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,ent,spe),p.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,tnt),p.color=X.getValueOrDefault(a._color,e,nnt,spe),p.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,int),p.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,ont),p.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,Ztt),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,rnt);let g=X.getValueOrUndefined(a._lightColor,e);if(c(g)&&(G.pack(g,ape,0),g=d.unpack(ape,0,cnt)),p.lightColor=g,p.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:Hl.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(c(y)){let A=Object.keys(y);for(let C=0,S=A.length;C<S;++C){let v=A[C],P=y[v];if(!c(P))continue;let M=p.getNode(v);if(!c(M))continue;let R=B.fromTranslationRotationScale(P,ant);M.matrix=B.multiply(M.originalMatrix,R,R)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(c(x)){let A=Object.keys(x);for(let C=0,S=A.length;C<S;++C){let v=A[C],P=x[v];c(P)&&(b=!0,p.setArticulationStage(v,P))}}b&&p.applyArticulations()}}return!0};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c0.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)E7(this,e[i],t,n);return de(this)};var I4=new d,unt=new he;c0.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._modelHash[e.id];if(!c(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!c(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene,r=o.ellipsoid??ie.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;I4.x=a[12],I4.y=a[13],I4.z=a[14];let l=r.cartesianToCartographic(I4,unt),u=o.getHeight(l,i.heightReference);return c(u)&&(Df(i.heightReference)?l.height=u:l.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(l),lt.DONE}return le.clone(i.boundingSphere,t),lt.DONE};c0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._model)&&c(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._model)&&c(r._position)?(fnt(r,a),s.set(r.id,r)):(E7(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],E7(this,r,a,l),s.remove(r.id)};function E7(e,t,n,i){let o=n[t.id];c(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function fnt(e,t){let n=t[e.id];c(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var eF=c0;function l0(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(l0.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return c(this._value)?this._value.referenceFrame:Hi.FIXED}}});var dnt=new Q;l0.prototype.getValue=function(e,t){return c(e)||(e=Q.now(dnt)),this.getValueInReferenceFrame(e,Hi.FIXED,t)};l0.prototype.setValue=function(e){this._value!==e&&(this._value=e,c(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),c(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};l0.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new E("time is required.");if(!c(t))throw new E("referenceFrame is required.");if(c(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),c(n)?ie.default.scaleToGeodeticSurface(n,n):void 0};l0.prototype.equals=function(e){return this===e||e instanceof l0&&this._value===e._value};l0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var zm=l0;var hnt=60,mnt=1,lpe=new En,S7=new En,w7=new En;function cpe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function pnt(e,t,n,i,o,r,s,a,l){let u=a,f;f=e.getValueInReferenceFrame(t,r,l[u]),c(f)&&(l[u++]=f);let h=!c(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),p=0,g=i.length,m=i[p],y=n,b=!1,x,A,C;for(;p<g;){if(!h&&Q.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,l[u]),c(f)&&(l[u++]=f),h=!0),Q.greaterThan(m,t)&&Q.lessThan(m,y)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,l[u]),c(f)&&(l[u++]=f)),p<g-1){if(s>0&&!b){let S=i[p+1],v=Q.secondsDifference(S,m);b=v>s,b&&(x=Math.ceil(v/s),A=0,C=v/Math.max(x,2),x=Math.max(x-1,1))}if(b&&A<x){m=Q.addSeconds(m,C,new Q),A++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,l[u]),c(f)&&(l[u++]=f),u}function _nt(e,t,n,i,o,r,s,a){let l,u=0,f=s,h=t,p=!c(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(h,n);)!p&&Q.greaterThanOrEquals(h,i)&&(p=!0,l=e.getValueInReferenceFrame(i,o,a[f]),c(l)&&(a[f]=l,f++)),l=e.getValueInReferenceFrame(h,o,a[f]),c(l)&&(a[f]=l,f++),u++,h=Q.addSeconds(t,r*u,new Q);return l=e.getValueInReferenceFrame(n,o,a[f]),c(l)&&(a[f]=l,f++),f}function gnt(e,t,n,i,o,r,s,a){let l,u=0,f=s,h=t,p=Math.max(r,60),g=!c(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(h,n);)!g&&Q.greaterThanOrEquals(h,i)&&(g=!0,l=e.getValueInReferenceFrame(i,o,a[f]),c(l)&&(a[f]=l,f++)),l=e.getValueInReferenceFrame(h,o,a[f]),c(l)&&(a[f]=l,f++),u++,h=Q.addSeconds(t,p*u,new Q);return l=e.getValueInReferenceFrame(n,o,a[f]),c(l)&&(a[f]=l,f++),f}function ynt(e,t,n,i,o,r,s,a){w7.start=t,w7.stop=n;let l=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!En.intersect(h,w7,lpe).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[l]);c(g)&&(a[l]=g,l++)}}return l}function bnt(e,t,n,i,o,r,s,a){let l=e.getValueInReferenceFrame(t,o,a[s]);return c(l)&&(a[s++]=l),s}function xnt(e,t,n,i,o,r,s,a){S7.start=t,S7.stop=n;let l=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!En.intersect(h,S7,lpe).isEmpty){let p=h.start,g=h.stop,m=t;Q.greaterThan(p,m)&&(m=p);let y=n;Q.lessThan(g,y)&&(y=g),l=upe(h.data,m,y,i,o,r,l,a)}}return l}function upe(e,t,n,i,o,r,s,a){for(;e instanceof Y_;)e=e.resolvedProperty;if(e instanceof Ta){let l=e._property._times;s=pnt(e,t,n,l,i,o,r,s,a)}else e instanceof GO?s=_nt(e,t,n,i,o,r,s,a):e instanceof ba?s=xnt(e,t,n,i,o,r,s,a):e instanceof X_?s=ynt(e,t,n,i,o,r,s,a):e instanceof qc||e instanceof zm&&X.isConstant(e)?s=bnt(e,t,n,i,o,r,s,a):s=gnt(e,t,n,i,o,r,s,a);return s}function fpe(e,t,n,i,o,r,s){c(s)||(s=[]);let a=upe(e,t,n,i,o,r,0,s);return s.length=a,s}var Tnt=new J;function tF(e,t){this._unusedIndexes=[],this._polylineCollection=new dh,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}tF.prototype.update=function(e){if(this._referenceFrame===Hi.INERTIAL){let t=Ot.computeIcrfToCentralBodyFixedMatrix(e,Tnt);B.fromRotationTranslation(t,d.ZERO,this._polylineCollection.modelMatrix)}};tF.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,l=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!c(a)||a.getValue(e));if(u){let h=X.getValueOrUndefined(i._leadTime,e),p=X.getValueOrUndefined(i._trailTime,e),g=n._availability,m=c(g),y=c(h),b=c(p);if(u=m||y&&b,u){if(b&&(r=Q.addSeconds(e,-p,new Q)),y&&(s=Q.addSeconds(e,h,new Q)),m){let x=g.start,A=g.stop;(!b||Q.greaterThan(x,r))&&(r=x),(!y||Q.lessThan(A,s))&&(s=A)}u=Q.lessThan(r,s)}}if(!u){c(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0);return}if(!c(l)){let h=this._unusedIndexes;if(h.length>0){let g=h.pop();l=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}let f=X.getValueOrDefault(i._resolution,e,hnt);l.show=!0,l.positions=fpe(o,r,s,e,this._referenceFrame,f,l.positions.slice()),l.material=tr.getValue(e,i._material,l.material),l.width=X.getValueOrDefault(i._width,e,mnt),l.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,l.distanceDisplayCondition)};tF.prototype.removeObject=function(e){let t=e.polyline;c(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};tF.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),de(this)};function u0(e,t){if(!c(e))throw new E("scene is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}u0.prototype.update=function(e){if(!c(e))throw new E("time is required.");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&&c(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,l=r.updater,u=Hi.FIXED;this._scene.mode===oe.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(l===f&&c(f)){f.updateObject(e,r);continue}c(l)&&l.removeObject(r),c(f)||(f=new tF(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,c(f)&&f.updateObject(e,r)}return!0};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(u0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return de(this)};u0.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],c(r._path)&&c(r._position)&&a.set(r.id,new cpe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._path)&&c(r._position)?a.contains(r.id)||a.set(r.id,new cpe(r)):(s=a.get(r.id),c(s)&&(c(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),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};u0._subSample=fpe;var nF=u0;var dpe=G.WHITE,hpe=G.BLACK,mpe=0,ppe=1,_pe=0,gpe=Vr.NONE,ype=new G,Ant=new d,bpe=new G,xpe=new Bt,Tpe=new Bt,Ape=new Mt;function Cpe(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 f0(e,t){if(!c(e))throw new E("entityCluster is required.");if(!c(t))throw new E("entityCollection is required.");t.collectionChanged.addEventListener(f0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}f0.prototype.update=function(e){if(!c(e))throw new E("time is required.");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,l=r.pointPrimitive,u=r.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),h=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(h&&(p=X.getValueOrUndefined(s._position,e,Ant),h=c(p)),!h){iF(r,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!c(u)?(c(l)&&(iF(r,s,n),l=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!c(l)&&(c(u)&&(iF(r,s,n),u=void 0),l=n.getPoint(s),l.id=s,r.pointPrimitive=l),c(l))l.show=!0,l.position=p,l.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,xpe),l.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Tpe),l.color=X.getValueOrDefault(a._color,e,dpe,ype),l.outlineColor=X.getValueOrDefault(a._outlineColor,e,hpe,bpe),l.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,mpe),l.pixelSize=X.getValueOrDefault(a._pixelSize,e,ppe),l.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Ape),l.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,_pe),l.splitDirection=X.getValueOrDefault(a._splitDirection,e,gpe);else if(c(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,xpe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Tpe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Ape),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,_pe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,gpe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,dpe,ype),b=X.getValueOrDefault(a._outlineColor,e,hpe,bpe),x=Math.round(X.getValueOrDefault(a._outlineWidth,e,mpe)),A=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,ppe)));if(x>0?(u.scale=1,g=g||x!==r.outlineWidth||A!==r.pixelSize||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)):(u.scale=A/50,A=50,g=g||x!==r.outlineWidth||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)),g){r.color=G.clone(y,r.color),r.outlineColor=G.clone(b,r.outlineColor),r.pixelSize=A,r.outlineWidth=x;let C=y.alpha,S=y.toCssColorString(),v=b.toCssColorString(),P=JSON.stringify([S,A,v,x]);u.setImage(P,Lx(C,S,v,x,A))}m&&u._updateClamping()}}return!0};f0.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new E("entity is required.");if(!c(t))throw new E("result is required.");let n=this._items.get(e.id);if(!c(n)||!(c(n.pointPrimitive)||c(n.billboard)))return lt.FAILED;if(c(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};f0.prototype.isDestroyed=function(){return!1};f0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return de(this)};f0.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],c(r._point)&&c(r._position)&&s.set(r.id,new Cpe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._point)&&c(r._position)?s.contains(r.id)||s.set(r.id,new Cpe(r)):(iF(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],iF(s.get(r.id),r,a),s.remove(r.id)};function iF(e,t,n){if(c(e)){let i=e.pointPrimitive;if(c(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;c(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var oF=f0;var Dpe=[];function Cnt(e,t,n,i,o){let r=Dpe;r.length=o;let s,a=n.red,l=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,g=i.blue,m=i.alpha;if(G.equals(n,i)){for(s=0;s<o;s++)r[s]=G.clone(n);return r}let y=(h-a)/o,b=(p-l)/o,x=(g-u)/o,A=(m-f)/o;for(s=0;s<o;s++)r[s]=new G(a+s*y,l+s*b,u+s*x,f+s*A);return r}function rF(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new E("At least two positions are required.");if(typeof i!="number")throw new E("width must be a number");if(c(n)&&(o&&n.length<t.length||!o&&n.length<t.length-1))throw new E("colors has an invalid length.");this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=c(n)?1+n.length*G.packedLength:1,this.packedLength=r+ie.packedLength+Ie.packedLength+4}rF.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Ppe=ie.clone(ie.UNIT_SPHERE),Ipe=new Ie,AT={positions:void 0,colors:void 0,ellipsoid:Ppe,vertexFormat:Ipe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};rF.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t,Ppe);t+=ie.packedLength;let l=Ie.unpack(e,t,Ipe);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(l,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(AT.positions=r,AT.colors=s,AT.width=u,AT.colorsPerVertex=f,AT.arcType=h,AT.granularity=p,new rF(AT))};var Epe=new d,Spe=new d,wpe=new d,vpe=new d;rF.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,l,u,f,h=[],p=xo(e._positions,d.equalsEpsilon,!1,h);if(c(i)&&h.length>0){let N=0,k=h[0];i=i.filter(function(z,V){let j=!1;return o?j=V===k||V===0&&k===1:j=V+1===k,j?(N++,k=h[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===qt.GEODESIC||r===qt.RHUMB){let N,k;r===qt.GEODESIC?(N=O.chordLength(s,a.maximumRadius),k=Fi.numberOfPoints):(N=s,k=Fi.numberOfPointsRhumbLine);let z=Fi.extractHeights(p,a);if(c(i)){let V=1;for(l=0;l<g-1;++l)V+=k(p[l],p[l+1],N);let j=new Array(V),U=0;for(l=0;l<g-1;++l){let q=p[l],Y=p[l+1],te=i[l],K=k(q,Y,N);if(o&&l<V){let Z=i[l+1],ee=Cnt(q,Y,te,Z,K),me=ee.length;for(u=0;u<me;++u)j[U++]=ee[u]}else for(u=0;u<K;++u)j[U++]=G.clone(te)}j[U]=G.clone(i[i.length-1]),i=j,Dpe.length=0}r===qt.GEODESIC?p=Fi.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:z}):p=Fi.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:z})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float64Array(m*3),A=new Float32Array(m*2),C=n.st?new Float32Array(m*2):void 0,S=c(i)?new Uint8Array(m*4):void 0,v=0,P=0,M=0,R=0,L;for(u=0;u<g;++u){u===0?(L=Epe,d.subtract(p[0],p[1],L),d.add(p[0],L,L)):L=p[u-1],d.clone(L,wpe),d.clone(p[u],Spe),u===g-1?(L=Epe,d.subtract(p[g-1],p[g-2],L),d.add(p[g-1],L,L)):L=p[u+1],d.clone(L,vpe);let N,k;c(S)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==g-1&&(k=i[u]));let z=u===0?2:0,V=u===g-1?2:4;for(f=z;f<V;++f){d.pack(Spe,y,v),d.pack(wpe,b,v),d.pack(vpe,x,v),v+=3;let j=f-2<0?-1:1;if(A[P++]=2*(f%2)-1,A[P++]=j*t,n.st&&(C[M++]=u/(g-1),C[M++]=Math.max(A[P-2],0)),c(S)){let U=f<2?N:k;S[R++]=G.floatToByte(U.red),S[R++]=G.floatToByte(U.green),S[R++]=G.floatToByte(U.blue),S[R++]=G.floatToByte(U.alpha)}}}let F=new fn;F.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:y}),F.prevPosition=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b}),F.nextPosition=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:x}),F.expandAndWidth=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:A}),n.st&&(F.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:C})),c(S)&&(F.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Fe.createTypedArray(m,g*6-6),w=0,D=0,I=g-1;for(u=0;u<I;++u)_[D++]=w,_[D++]=w+2,_[D++]=w+1,_[D++]=w+1,_[D++]=w+2,_[D++]=w+3,w+=4;return new ct({attributes:F,indices:_,primitiveType:Me.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:xf.POLYLINES})};var ng=rF;var Ent=new Kn(0),O4={},Ope=new G,Snt=new Ut(G.WHITE),wnt=new Kn(!0),vnt=new Kn(xn.DISABLED),Dnt=new Kn(new Mt),Pnt=new Kn(Un.BOTH);function Int(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Ont(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Ih(e,t){if(!c(e))throw new E("entity is required");if(!c(t))throw new E("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Ih.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new pe,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 Int,this._groundGeometryOptions=new Ont,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=nr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Ih.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||!c(this._entity.availability)&&X.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}}});Ih.prototype.isOutlineVisible=function(e){return!1};Ih.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Ih.prototype.createFillGeometryInstance=function(e){if(!c(e))throw new E("time is required.");if(!this._fillEnabled)throw new E("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new bn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Ope)),c(a)||(a=G.WHITE),s.color=Gt.fromColor(a)),this.clampToGround?new St({id:t,geometry:new Fb(this._groundGeometryOptions),attributes:s}):(c(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(c(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Ope)),c(a)||(a=G.WHITE),s.depthFailColor=Gt.fromColor(a)),new St({id:t,geometry:new ng(this._geometryOptions),attributes:s}))};Ih.prototype.createOutlineGeometryInstance=function(e){throw new E("This instance does not represent an outlined geometry.")};Ih.prototype.isDestroyed=function(){return!1};Ih.prototype.destroy=function(){this._entitySubscription(),de(this)};Ih.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!c(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(c(s)&&s.isConstant&&!s.getValue(Ge.MINIMUM_VALUE)||!c(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,l=o.material??Snt,u=l instanceof Ut;this._materialProperty=l,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??wnt,this._shadowsProperty=o.shadows??vnt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??Dnt,this._classificationTypeProperty=o.classificationType??Pnt,this._fillEnabled=!0,this._zIndex=a??Ent;let f=o.width,h=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!X.isConstant(f)||!X.isConstant(h)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=r.getValue(Ge.MINIMUM_VALUE,m.positions);if(!c(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!c(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?b=is.VERTEX_FORMAT:b=ha.VERTEX_FORMAT,m.vertexFormat=b,m.positions=y,m.width=c(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,m.arcType=c(h)?h.getValue(Ge.MINIMUM_VALUE):void 0,m.granularity=c(g)?g.getValue(Ge.MINIMUM_VALUE):void 0;let x=this._groundGeometryOptions;x.positions=y,x.width=m.width,x.arcType=m.arcType,x.granularity=m.granularity,this._clampToGround=c(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&c(a)&&dt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Ih.prototype.createDynamicUpdater=function(e,t){if(T.defined("primitives",e),T.defined("groundPrimitives",t),!this._dynamic)throw new E("This instance does not represent dynamic geometry.");return new sF(e,t,this)};var IS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function sF(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 Rpe(e){if(c(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=O4[n];!c(i)||i.isDestroyed()?(i=new dh,O4[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}sF.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=X.getValueOrUndefined(o,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,qt.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(c(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!c(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Ut)p=new is;else{let g=tr.getValue(e,h,this._material);p=new ha({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Vd({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),c(this._line)&&(this._line.show=!1);return}let a=Rpe(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!c(r)||r.length<2){a.show=!1;return}let l=qt.GEODESIC;l=X.getValueOrDefault(i._arcType,e,l);let u=t._scene.globe,f=t._scene.ellipsoid;l!==qt.NONE&&c(u)&&(IS.ellipsoid=f,IS.positions=r,IS.granularity=X.getValueOrUndefined(i._granularity,e),IS.height=Fi.extractHeights(r,f),l===qt.GEODESIC?r=Fi.generateCartesianArc(IS):r=Fi.generateCartesianRhumbArc(IS)),a.show=!0,a.positions=r.slice(),a.material=tr.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};sF.prototype.getBoundingSphere=function(e){if(T.defined("result",e),this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(c(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(c(n)&&c(n.boundingSphere))return le.clone(n.boundingSphere,e),lt.DONE}return c(t)&&!t.ready?lt.PENDING:lt.DONE}else{let t=Rpe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};sF.prototype.isDestroyed=function(){return!1};sF.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=O4[t];c(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete O4[t])),c(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),de(this)};var aF=Ih;var Rnt=new G,Mnt=new Mt,Lnt=new Mt;function Oh(e,t,n,i,o){let r;n instanceof Ut?r=is:r=ha,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Oh.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=o}Oh.prototype.onMaterialChanged=function(){this.invalidated=!0};Oh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Oh.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Oh.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 c(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Oh.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Vd({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ha&&(this.material=tr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ha&&(this.material=tr.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 l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);if(c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!l.fillMaterialProperty.isConstant){let y=l.fillMaterialProperty.color,b=X.getValueOrDefault(y,e,G.WHITE,Rnt);G.equals(h._lastColor,b)||(h._lastColor=G.clone(b,h._lastColor),h.color=Gt.toValue(b,h.color))}let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=bn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Lnt,Mnt);Mt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Mt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Oh.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=bn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Oh.prototype.contains=function(e){return this.updaters.contains(e.id)};Oh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Oh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function OS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}OS.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let l=n[a];if(l.isMaterial(t)&&l.zIndex===r){l.add(e,t,o);return}}let s=new Oh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};OS.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}}};OS.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};OS.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 lt.FAILED};OS.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 cF=OS;var Nnt=[];function Mpe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Lpe(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;c(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;c(i)&&(r=i+o*xn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Hm(e,t,n,i){T.defined("scene",e),T.defined("entityCollection",t),i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let o,r=xn.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 rd(n,is,void 0,!1,o),this._materialBatches[o]=new sd(n,ha,void 0,!1,o),this._colorBatches[o+r]=new rd(n,is,is,!1,o),this._materialBatches[o+r]=new sd(n,ha,is,!1,o),this._colorBatches[o+r*2]=new rd(n,is,ha,!1,o),this._materialBatches[o+r*2]=new sd(n,ha,ha,!1,o);this._dynamicBatch=new cT(n,i);let s=Un.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new cF(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Et,this._updaters=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Hm.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Nnt)}Hm.prototype.update=function(e){T.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,u,f;for(a=s.length-1;a>-1;a--)l=s[a],u=l.id,f=this._updaters.get(u),f.entity===l?(Mpe(this,f),Lpe(this,e,f)):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaters.get(u),Mpe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new aF(l,this._scene),this._updaters.set(u,f),Lpe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Hm._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 Fnt=[],Bnt=new le;Hm.prototype.getBoundingSphere=function(e,t){T.defined("entity",e),T.defined("result",t);let n=Fnt,i=Bnt,o=0,r=lt.DONE,s=this._batches,a=s.length,l=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(l,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?lt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),lt.DONE)};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hm.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(),de(this)};Hm._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Hm.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var lF=Hm;function Ql(e){T.typeOf.object("options",e),T.typeOf.object("options.scene",e.scene),T.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),jc.initializeTerrainHeights(),Vd.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new gr,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=e.visualizersCallback??Ql.defaultVisualizersCallback;let i=!1,o=new fl,r=new fl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new dN;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,l;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),l(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),l=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=l,this._ready=!1}var RS=[];Ql.registerVisualizer=function(e){RS.includes(e)||RS.push(e)};Ql.unregisterVisualizer=function(e){if(RS.includes(e)){let t=RS.indexOf(e);RS.splice(t,1)}};Ql.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new II(t,i),new QN(e,i,n._primitives,n._groundPrimitives),new JN(t,i),new eF(e,i),new ZL(e,i),new oF(t,i),new nF(e,i),new lF(e,i,n._primitives,n._groundPrimitives),...RS.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),c(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),de(this)};Ql.prototype.update=function(e){if(T.defined("time",e),!ui.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 l=s.get(n);for(c(l.update)&&(t=l.update(e)&&t),o=l._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;c(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)e.creditDisplay.addCreditToNextFrame(s[l])}}};var knt=[],Unt=new le;Ql.prototype.getBoundingSphere=function(e,t,n){if(T.defined("entity",e),T.typeOf.bool("allowPartial",t),T.defined("result",n),!this._ready)return lt.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(!c(r))return lt.FAILED;let s=knt,a=Unt,l=0,u=lt.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(c(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===lt.PENDING)return lt.PENDING;u===lt.DONE&&(s[l]=le.clone(a,s[l]),l++)}}return l===0?lt.FAILED:(s.length=l,le.fromBoundingSpheres(s,n),lt.DONE)};Ql.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new fl),s=o.add(new vN);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,l=a.length;for(let u=0;u<l;u++)a[u].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 uF=Ql;function v7(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}v7.clone=function(e,t){if(c(e))return c(t)||(t=new v7),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var cd=v7;var Npe=new J,Fpe=new J,Bpe=new J,Vnt=new B,R4=new d,kpe=new d,D7=new d,P7=new d,Upe=new d,Vpe=new d,znt=new Le,Hnt=new d,Gnt=new J,MS=new Q,jnt=1.25;function Wnt(e,t,n,i,o,r,s,a,l,u){let f=e.scene.mode,h=o.getValue(l,e._lastCartesian);if(c(h)){let p=!1,g=!1,m,y,b;if(f===oe.SCENE3D){Q.addSeconds(l,.001,MS);let M=o.getValue(MS,R4);if(c(M)||(Q.addSeconds(l,-.001,MS),M=o.getValue(MS,R4),g=!0),c(M)){let R=Ot.computeFixedToIcrfMatrix(l,Npe),L=Ot.computeFixedToIcrfMatrix(MS,Fpe),F;!c(R)||!c(L)?(F=Ot.computeTemeToPseudoFixedMatrix(l,Bpe),R=J.transpose(F,Npe),L=Ot.computeTemeToPseudoFixedMatrix(MS,Fpe),J.transpose(L,L)):F=J.transpose(R,Bpe);let _=J.multiplyByVector(R,h,Upe),w=J.multiplyByVector(L,M,Vpe);d.subtract(_,w,P7);let D=d.magnitude(P7)*1e3,I=O.GRAVITATIONALPARAMETER,N=-I/(D*D-2*I/d.magnitude(_));N<0||N>jnt*u.maximumRadius?(m=kpe,d.normalize(h,m),d.negate(m,m),b=d.clone(d.UNIT_Z,D7),y=d.cross(b,m,R4),d.magnitude(y)>O.EPSILON7&&(d.normalize(m,m),d.normalize(y,y),b=d.cross(m,y,D7),d.normalize(b,b),p=!0)):d.equalsEpsilon(h,M,O.EPSILON7)||(b=kpe,d.normalize(_,b),d.normalize(w,w),y=d.cross(b,w,D7),g&&(y=d.multiplyByScalar(y,-1,y)),d.equalsEpsilon(y,d.ZERO,O.EPSILON7)||(m=d.cross(y,b,R4),J.multiplyByVector(F,m,m),J.multiplyByVector(F,y,y),J.multiplyByVector(F,b,b),d.normalize(m,m),d.normalize(y,y),d.normalize(b,b),p=!0))}}c(e.boundingSphere)&&(h=e.boundingSphere.center);let x,A,C;i&&(x=d.clone(t.position,P7),A=d.clone(t.direction,Upe),C=d.clone(t.up,Vpe));let S=Vnt,v;c(s)&&(v=s.getValue(l,znt));let P=r.getValue(l,Hnt);if(a===Bp.INERTIAL&&c(v))B.fromTranslationQuaternionRotationScale(h,v,d.ONE,S);else if(a===Bp.VELOCITY&&c(P)){let M=Ot.rotationMatrixFromPositionVelocity(h,P,u,Gnt);B.fromRotationTranslation(M,h,S)}else a===Bp.ENU||!p?Ot.eastNorthUpToFixedFrame(h,u,S):(S[0]=m.x,S[1]=m.y,S[2]=m.z,S[3]=0,S[4]=y.x,S[5]=y.y,S[6]=y.z,S[7]=0,S[8]=b.x,S[9]=b.y,S[10]=b.z,S[11]=0,S[12]=h.x,S[13]=h.y,S[14]=h.z,S[15]=0);t._setTransform(S),i&&(d.clone(x,t.position),d.clone(A,t.direction),d.clone(C,t.up),d.cross(A,C,t.right))}if(n){let p=f===oe.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function fF(e,t,n){T.defined("entity",e),T.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=n??ie.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new $_(e.position,!0),this._offset3D=new d}Object.defineProperties(fF,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});fF.defaultOffset3D=new d(-14e3,3500,3500);var M4=new cd,qnt=new d;fF.prototype.update=function(e,t){T.defined("time",e);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(!c(a))return;let l=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=f||h,m=!0;if(f){let y=r.viewFrom,b=c(y);if(!b&&c(t)){M4.pitch=-O.PI_OVER_FOUR,M4.range=0;let x=a.getValue(e,qnt);if(c(x)){let A=2-1/Math.max(1,d.magnitude(x)/i.maximumRadius);M4.pitch*=A}p.viewBoundingSphere(t,M4),this.boundingSphere=t,g=!1,m=!1}else(!b||!c(y.getValue(e,this._offset3D)))&&d.clone(fF._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Wnt(this,p,g,m,a,l,u,s,e,i)};var dF=fF;function V4(e){return z4(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function z4(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?z4(n):n),[])}var zpe=[0,1,2,3].concat(...V4([[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 br(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,h,p,g,m,y,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)h=o.heap[f],g=r[r[h*2+1]*2+1]+1,g>u&&(g=u,b++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,m=0,h>=l&&(m=a[h-l]),y=r[h*2],o.opt_len+=y*(g+m),s&&(o.static_len+=y*(s[h*2+1]+m)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--f],!(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=[],l=0,u,f,h;for(u=1;u<=15;u++)a[u]=l=l+s[u-1]<<1;for(f=0;f<=r;f++)h=o[f*2+1],h!==0&&(o[f*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,l,u,f=-1,h;for(o.heap_len=0,o.heap_max=573,l=0;l<a;l++)r[l*2]!==0?(o.heap[++o.heap_len]=f=l,o.depth[l]=0):r[l*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=f<2?++f:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=f,l=Math.floor(o.heap_len/2);l>=1;l--)o.pqdownheap(r,l);h=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=u,r[h*2]=r[l*2]+r[u*2],o.depth[h]=Math.max(o.depth[l],o.depth[u])+1,r[l*2+1]=r[u*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)}}br._length_code=[0,1,2,3,4,5,6,7].concat(...V4([[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]]));br.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];br.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];br.d_code=function(e){return e<256?zpe[e]:zpe[256+(e>>>7)]};br.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];br.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];br.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];br.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ha(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 Ynt=[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],Xnt=V4([[144,8],[112,9],[24,7],[8,8]]);Ha.static_ltree=z4(Ynt.map((e,t)=>[e,Xnt[t]]));var Knt=[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],$nt=V4([[30,5]]);Ha.static_dtree=z4(Knt.map((e,t)=>[e,$nt[t]]));Ha.static_l_desc=new Ha(Ha.static_ltree,br.extra_lbits,257,286,15);Ha.static_d_desc=new Ha(Ha.static_dtree,br.extra_dbits,0,30,15);Ha.static_bl_desc=new Ha(null,br.extra_blbits,0,19,7);var Znt=9,Qnt=8;function Gm(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 Gpe=0,k4=1,CT=2,Rh=[new Gm(0,0,0,0,Gpe),new Gm(4,4,8,4,k4),new Gm(4,5,16,8,k4),new Gm(4,6,32,32,k4),new Gm(4,4,16,16,CT),new Gm(8,16,32,32,CT),new Gm(8,16,128,128,CT),new Gm(8,32,128,256,CT),new Gm(32,128,258,1024,CT),new Gm(32,258,258,4096,CT)],L4=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ld=0,N4=1,hF=2,F4=3,Jnt=32,I7=42,B4=113,mF=666,O7=8,eit=0,R7=1,tit=2,Mr=3,U4=258,Wu=U4+Mr+1;function Hpe(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function nit(){let e=this,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y,b,x,A,C,S,v,P,M,R,L,F,_,w,D,I,N,k,z,V=new br,j=new br,U=new br;e.depth=[];let q,Y,te,K,Z,ee;e.bl_count=[],e.heap=[],N=[],k=[],z=[];function me(){u=2*r,h[g-1]=0;for(let Ne=0;Ne<g-1;Ne++)h[Ne]=0;F=Rh[_].max_lazy,D=Rh[_].good_length,I=Rh[_].nice_length,L=Rh[_].max_chain,v=0,x=0,M=0,A=R=Mr-1,S=0,p=0}function Te(){let Ne;for(Ne=0;Ne<286;Ne++)N[Ne*2]=0;for(Ne=0;Ne<30;Ne++)k[Ne*2]=0;for(Ne=0;Ne<19;Ne++)z[Ne*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,Y=te=0}function ue(){V.dyn_tree=N,V.stat_desc=Ha.static_l_desc,j.dyn_tree=k,j.stat_desc=Ha.static_d_desc,U.dyn_tree=z,U.stat_desc=Ha.static_bl_desc,Z=0,ee=0,K=8,Te()}e.pqdownheap=function(Ne,ot){let Xe=e.heap,Ze=Xe[ot],pt=ot<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&Hpe(Ne,Xe[pt+1],Xe[pt],e.depth)&&pt++,!Hpe(Ne,Ze,Xe[pt],e.depth));)Xe[ot]=Xe[pt],ot=pt,pt<<=1;Xe[ot]=Ze};function ye(Ne,ot){let Xe=-1,Ze,pt=Ne[0*2+1],Ht=0,Cn=7,Mo=4;pt===0&&(Cn=138,Mo=3),Ne[(ot+1)*2+1]=65535;for(let Ao=0;Ao<=ot;Ao++)Ze=pt,pt=Ne[(Ao+1)*2+1],!(++Ht<Cn&&Ze==pt)&&(Ht<Mo?z[Ze*2]+=Ht:Ze!==0?(Ze!=Xe&&z[Ze*2]++,z[16*2]++):Ht<=10?z[17*2]++:z[18*2]++,Ht=0,Xe=Ze,pt===0?(Cn=138,Mo=3):Ze==pt?(Cn=6,Mo=3):(Cn=7,Mo=4))}function Ae(){let Ne;for(ye(N,V.max_code),ye(k,j.max_code),U.build_tree(e),Ne=18;Ne>=3&&z[br.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Pe(Ne){e.pending_buf[e.pending++]=Ne}function Ee(Ne){Pe(Ne&255),Pe(Ne>>>8&255)}function ze(Ne){Pe(Ne>>8&255),Pe(Ne&255&255)}function qe(Ne,ot){let Xe,Ze=ot;ee>16-Ze?(Xe=Ne,Z|=Xe<<ee&65535,Ee(Z),Z=Xe>>>16-ee,ee+=Ze-16):(Z|=Ne<<ee&65535,ee+=Ze)}function it(Ne,ot){let Xe=Ne*2;qe(ot[Xe]&65535,ot[Xe+1]&65535)}function Dt(Ne,ot){let Xe,Ze=-1,pt,Ht=Ne[0*2+1],Cn=0,Mo=7,Ao=4;for(Ht===0&&(Mo=138,Ao=3),Xe=0;Xe<=ot;Xe++)if(pt=Ht,Ht=Ne[(Xe+1)*2+1],!(++Cn<Mo&&pt==Ht)){if(Cn<Ao)do it(pt,z);while(--Cn!==0);else pt!==0?(pt!=Ze&&(it(pt,z),Cn--),it(16,z),qe(Cn-3,2)):Cn<=10?(it(17,z),qe(Cn-3,3)):(it(18,z),qe(Cn-11,7));Cn=0,Ze=pt,Ht===0?(Mo=138,Ao=3):pt==Ht?(Mo=6,Ao=3):(Mo=7,Ao=4)}}function jt(Ne,ot,Xe){let Ze;for(qe(Ne-257,5),qe(ot-1,5),qe(Xe-4,4),Ze=0;Ze<Xe;Ze++)qe(z[br.bl_order[Ze]*2+1],3);Dt(N,Ne-1),Dt(k,ot-1)}function $e(){ee==16?(Ee(Z),Z=0,ee=0):ee>=8&&(Pe(Z&255),Z>>>=8,ee-=8)}function un(){qe(R7<<1,3),it(256,Ha.static_ltree),$e(),1+K+10-ee<9&&(qe(R7<<1,3),it(256,Ha.static_ltree),$e()),K=7}function zt(Ne,ot){let Xe,Ze,pt;if(e.dist_buf[Y]=Ne,e.lc_buf[Y]=ot&255,Y++,Ne===0?N[ot*2]++:(te++,Ne--,N[(br._length_code[ot]+256+1)*2]++,k[br.d_code(Ne)*2]++),!(Y&8191)&&_>2){for(Xe=Y*8,Ze=v-x,pt=0;pt<30;pt++)Xe+=k[pt*2]*(5+br.extra_dbits[pt]);if(Xe>>>=3,te<Math.floor(Y/2)&&Xe<Math.floor(Ze/2))return!0}return Y==q-1}function Ct(Ne,ot){let Xe,Ze,pt=0,Ht,Cn;if(Y!==0)do Xe=e.dist_buf[pt],Ze=e.lc_buf[pt],pt++,Xe===0?it(Ze,Ne):(Ht=br._length_code[Ze],it(Ht+256+1,Ne),Cn=br.extra_lbits[Ht],Cn!==0&&(Ze-=br.base_length[Ht],qe(Ze,Cn)),Xe--,Ht=br.d_code(Xe),it(Ht,ot),Cn=br.extra_dbits[Ht],Cn!==0&&(Xe-=br.base_dist[Ht],qe(Xe,Cn)));while(pt<Y);it(256,Ne),K=Ne[256*2+1]}function Ei(){ee>8?Ee(Z):ee>0&&Pe(Z&255),Z=0,ee=0}function an(Ne,ot,Xe){Ei(),K=8,Xe&&(Ee(ot),Ee(~ot)),e.pending_buf.set(l.subarray(Ne,Ne+ot),e.pending),e.pending+=ot}function _e(Ne,ot,Xe){qe((eit<<1)+(Xe?1:0),3),an(Ne,ot,!0)}function Ce(Ne,ot,Xe){let Ze,pt,Ht=0;_>0?(V.build_tree(e),j.build_tree(e),Ht=Ae(),Ze=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Ze&&(Ze=pt)):Ze=pt=ot+5,ot+4<=Ze&&Ne!=-1?_e(Ne,ot,Xe):pt==Ze?(qe((R7<<1)+(Xe?1:0),3),Ct(Ha.static_ltree,Ha.static_dtree)):(qe((tit<<1)+(Xe?1:0),3),jt(V.max_code+1,j.max_code+1,Ht+1),Ct(N,k)),Te(),Xe&&Ei()}function pn(Ne){Ce(x>=0?x:-1,v-x,Ne),x=v,t.flush_pending()}function mt(){let Ne,ot,Xe,Ze;do{if(Ze=u-M-v,Ze===0&&v===0&&M===0)Ze=r;else if(Ze==-1)Ze--;else if(v>=r+r-Wu){l.set(l.subarray(r,r+r),0),P-=r,v-=r,x-=r,Ne=g,Xe=Ne;do ot=h[--Xe]&65535,h[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ne=r,Xe=Ne;do ot=f[--Xe]&65535,f[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ze+=r}if(t.avail_in===0)return;Ne=t.read_buf(l,v+M,Ze),M+=Ne,M>=Mr&&(p=l[v]&255,p=(p<<b^l[v+1]&255)&y)}while(M<Wu&&t.avail_in!==0)}function so(Ne){let ot=65535,Xe;for(ot>i-5&&(ot=i-5);;){if(M<=1){if(mt(),M===0&&Ne==0)return ld;if(M===0)break}if(v+=M,M=0,Xe=x+ot,(v===0||v>=Xe)&&(M=v-Xe,v=Xe,pn(!1),t.avail_out===0)||v-x>=r-Wu&&(pn(!1),t.avail_out===0))return ld}return pn(Ne==4),t.avail_out===0?Ne==4?hF:ld:Ne==4?F4:N4}function Ro(Ne){let ot=L,Xe=v,Ze,pt,Ht=R,Cn=v>r-Wu?v-(r-Wu):0,Mo=I,Ao=a,Za=v+U4,Qa=l[Xe+Ht-1],Si=l[Xe+Ht];R>=D&&(ot>>=2),Mo>M&&(Mo=M);do if(Ze=Ne,!(l[Ze+Ht]!=Si||l[Ze+Ht-1]!=Qa||l[Ze]!=l[Xe]||l[++Ze]!=l[Xe+1])){Xe+=2,Ze++;do;while(l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&Xe<Za);if(pt=U4-(Za-Xe),Xe=Za-U4,pt>Ht){if(P=Ne,Ht=pt,pt>=Mo)break;Qa=l[Xe+Ht-1],Si=l[Xe+Ht]}}while((Ne=f[Ne&Ao]&65535)>Cn&&--ot!==0);return Ht<=M?Ht:M}function aa(Ne){let ot=0,Xe;for(;;){if(M<Wu){if(mt(),M<Wu&&Ne==0)return ld;if(M===0)break}if(M>=Mr&&(p=(p<<b^l[v+(Mr-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),ot!==0&&(v-ot&65535)<=r-Wu&&w!=2&&(A=Ro(ot)),A>=Mr)if(Xe=zt(v-P,A-Mr),M-=A,A<=F&&M>=Mr){A--;do v++,p=(p<<b^l[v+(Mr-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v;while(--A!==0);v++}else v+=A,A=0,p=l[v]&255,p=(p<<b^l[v+1]&255)&y;else Xe=zt(0,l[v]&255),M--,v++;if(Xe&&(pn(!1),t.avail_out===0))return ld}return pn(Ne==4),t.avail_out===0?Ne==4?hF:ld:Ne==4?F4:N4}function Nr(Ne){let ot=0,Xe,Ze;for(;;){if(M<Wu){if(mt(),M<Wu&&Ne==0)return ld;if(M===0)break}if(M>=Mr&&(p=(p<<b^l[v+(Mr-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),R=A,C=P,A=Mr-1,ot!==0&&R<F&&(v-ot&65535)<=r-Wu&&(w!=2&&(A=Ro(ot)),A<=5&&(w==1||A==Mr&&v-P>4096)&&(A=Mr-1)),R>=Mr&&A<=R){Ze=v+M-Mr,Xe=zt(v-1-C,R-Mr),M-=R-1,R-=2;do++v<=Ze&&(p=(p<<b^l[v+(Mr-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v);while(--R!==0);if(S=0,A=Mr-1,v++,Xe&&(pn(!1),t.avail_out===0))return ld}else if(S!==0){if(Xe=zt(0,l[v-1]&255),Xe&&pn(!1),v++,M--,t.avail_out===0)return ld}else S=1,v++,M--}return S!==0&&(Xe=zt(0,l[v-1]&255),S=0),pn(Ne==4),t.avail_out===0?Ne==4?hF:ld:Ne==4?F4:N4}function Cs(Ne){return Ne.total_in=Ne.total_out=0,Ne.msg=null,e.pending=0,e.pending_out=0,n=B4,o=0,ue(),me(),0}e.deflateInit=function(Ne,ot,Xe,Ze,pt,Ht){return Ze||(Ze=O7),pt||(pt=Qnt),Ht||(Ht=0),Ne.msg=null,ot==-1&&(ot=6),pt<1||pt>Znt||Ze!=O7||Xe<9||Xe>15||ot<0||ot>9||Ht<0||Ht>2?-2:(Ne.dstate=e,s=Xe,r=1<<s,a=r-1,m=pt+7,g=1<<m,y=g-1,b=Math.floor((m+Mr-1)/Mr),l=new Uint8Array(r*2),f=[],h=[],q=1<<pt+6,e.pending_buf=new Uint8Array(q*4),i=q*4,e.dist_buf=new Uint16Array(q),e.lc_buf=new Uint8Array(q),_=ot,w=Ht,Cs(Ne))},e.deflateEnd=function(){return n!=I7&&n!=B4&&n!=mF?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,f=null,l=null,e.dstate=null,n==B4?-3:0)},e.deflateParams=function(Ne,ot,Xe){let Ze=0;return ot==-1&&(ot=6),ot<0||ot>9||Xe<0||Xe>2?-2:(Rh[_].func!=Rh[ot].func&&Ne.total_in!==0&&(Ze=Ne.deflate(1)),_!=ot&&(_=ot,F=Rh[_].max_lazy,D=Rh[_].good_length,I=Rh[_].nice_length,L=Rh[_].max_chain),w=Xe,Ze)},e.deflateSetDictionary=function(Ne,ot,Xe){let Ze=Xe,pt,Ht=0;if(!ot||n!=I7)return-2;if(Ze<Mr)return 0;for(Ze>r-Wu&&(Ze=r-Wu,Ht=Xe-Ze),l.set(ot.subarray(Ht,Ht+Ze),0),v=Ze,x=Ze,p=l[0]&255,p=(p<<b^l[1]&255)&y,pt=0;pt<=Ze-Mr;pt++)p=(p<<b^l[pt+(Mr-1)]&255)&y,f[pt&a]=h[p],h[p]=pt;return 0},e.deflate=function(Ne,ot){let Xe,Ze,pt,Ht,Cn;if(ot>4||ot<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==mF&&ot!=4)return Ne.msg=L4[4],-2;if(Ne.avail_out===0)return Ne.msg=L4[7],-5;if(t=Ne,Ht=o,o=ot,n==I7&&(Ze=O7+(s-8<<4)<<8,pt=(_-1&255)>>1,pt>3&&(pt=3),Ze|=pt<<6,v!==0&&(Ze|=Jnt),Ze+=31-Ze%31,n=B4,ze(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=Ht&&ot!=4)return t.msg=L4[7],-5;if(n==mF&&t.avail_in!==0)return Ne.msg=L4[7],-5;if(t.avail_in!==0||M!==0||ot!=0&&n!=mF){switch(Cn=-1,Rh[_].func){case Gpe:Cn=so(ot);break;case k4:Cn=aa(ot);break;case CT:Cn=Nr(ot);break;default:}if((Cn==hF||Cn==F4)&&(n=mF),Cn==ld||Cn==hF)return t.avail_out===0&&(o=-1),0;if(Cn==N4){if(ot==1)un();else if(_e(0,0,!1),ot==3)for(Xe=0;Xe<g;Xe++)h[Xe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function jpe(){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}jpe.prototype={deflateInit(e,t){let n=this;return n.dstate=new nit,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 Wpe(e){let t=this,n=new jpe,i=iit(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,l){let u,f,h=0,p=0,g=0,m=[];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,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=h&&(l(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(y){f.set(y,p),p+=y.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,l,u=0,f=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)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(f),h.forEach(function(p){l.set(p,u),u+=p.length}),l}}function iit(e){return e+5*(Math.floor(e/16383)+1)}var qu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],f_e=1440,oit=0,rit=4,sit=9,ait=5,cit=[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],lit=[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],uit=[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],fit=[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],dit=[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],hit=[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],d0=15;function F7(){let e=this,t,n,i,o,r,s;function a(u,f,h,p,g,m,y,b,x,A,C){let S,v,P,M,R,L,F,_,w,D,I,N,k,z,V;D=0,R=h;do i[u[f+D]]++,D++,R--;while(R!==0);if(i[0]==h)return y[0]=-1,b[0]=0,0;for(_=b[0],L=1;L<=d0&&i[L]===0;L++);for(F=L,_<L&&(_=L),R=d0;R!==0&&i[R]===0;R--);for(P=R,_>R&&(_=R),b[0]=_,z=1<<L;L<R;L++,z<<=1)if((z-=i[L])<0)return-3;if((z-=i[R])<0)return-3;for(i[R]+=z,s[1]=L=0,D=1,k=2;--R!==0;)s[k]=L+=i[D],k++,D++;R=0,D=0;do(L=u[f+D])!==0&&(C[s[L]++]=R),D++;while(++R<h);for(h=s[P],s[0]=R=0,D=0,M=-1,N=-_,r[0]=0,I=0,V=0;F<=P;F++)for(S=i[F];S--!==0;){for(;F>N+_;){if(M++,N+=_,V=P-N,V=V>_?_:V,(v=1<<(L=F-N))>S+1&&(v-=S+1,k=F,L<V))for(;++L<V&&!((v<<=1)<=i[++k]);)v-=i[k];if(V=1<<L,A[0]+V>f_e)return-3;r[M]=I=A[0],A[0]+=V,M!==0?(s[M]=R,o[0]=L,o[1]=_,L=R>>>N-_,o[2]=I-r[M-1]-L,x.set(o,(r[M-1]+L)*3)):y[0]=I}for(o[1]=F-N,D>=h?o[0]=192:C[D]<p?(o[0]=C[D]<256?0:96,o[2]=C[D++]):(o[0]=m[C[D]-p]+16+64,o[2]=g[C[D++]-p]),v=1<<F-N,L=R>>>N;L<V;L+=v)x.set(o,(I+L)*3);for(L=1<<F-1;R&L;L>>>=1)R^=L;for(R^=L,w=(1<<N)-1;(R&w)!=s[M];)M--,N-=_,w=(1<<N)-1}return z!==0&&P!=1?-5:0}function l(u){let f;for(t||(t=[],n=[],i=new Int32Array(d0+1),o=[],r=new Int32Array(d0),s=new Int32Array(d0+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<d0+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,d0),0),s.set(i.subarray(0,d0+1),0)}e.inflate_trees_bits=function(u,f,h,p,g){let m;return l(19),t[0]=0,m=a(u,0,19,19,null,null,h,f,p,t,n),m==-3?g.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,h,p,g,m,y,b,x){let A;return l(288),t[0]=0,A=a(h,0,u,257,uit,fit,m,p,b,t,n),A!=0||p[0]===0?(A==-3?x.msg="oversubscribed literal/length tree":A!=-4&&(x.msg="incomplete literal/length tree",A=-3),A):(l(288),A=a(h,u,f,0,dit,hit,y,g,b,t,n),A!=0||g[0]===0&&u>257?(A==-3?x.msg="oversubscribed distance tree":A==-5?(x.msg="incomplete distance tree",A=-3):A!=-4&&(x.msg="empty distance tree with lengths",A=-3),A):0)}}F7.inflate_trees_fixed=function(e,t,n,i){return e[0]=sit,t[0]=ait,n[0]=cit,i[0]=lit,0};var H4=0,qpe=1,Ype=2,Xpe=3,Kpe=4,$pe=5,Zpe=6,M7=7,Qpe=8,G4=9;function mit(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,l=0,u=0,f=0,h,p=0,g,m=0;function y(b,x,A,C,S,v,P,M){let R,L,F,_,w,D,I,N,k,z,V,j,U,q,Y,te;I=M.next_in_index,N=M.avail_in,w=P.bitb,D=P.bitk,k=P.write,z=k<P.read?P.read-k-1:P.end-k,V=qu[b],j=qu[x];do{for(;D<20;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;if(R=w&V,L=A,F=C,te=(F+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],z--;continue}do{if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15,U=L[te+2]+(w&qu[_]),w>>=_,D-=_;D<15;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;R=w&j,L=S,F=v,te=(F+R)*3,_=L[te];do if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15;D<_;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;if(q=L[te+2]+(w&qu[_]),w>>=_,D-=_,z-=U,k>=q)Y=k-q,k-Y>0&&2>k-Y?(P.win[k++]=P.win[Y++],P.win[k++]=P.win[Y++],U-=2):(P.win.set(P.win.subarray(Y,Y+2),k),k+=2,Y+=2,U-=2);else{Y=k-q;do Y+=P.end;while(Y<0);if(_=P.end-Y,U>_){if(U-=_,k-Y>0&&_>k-Y)do P.win[k++]=P.win[Y++];while(--_!==0);else P.win.set(P.win.subarray(Y,Y+_),k),k+=_,Y+=_,_=0;Y=0}}if(k-Y>0&&U>k-Y)do P.win[k++]=P.win[Y++];while(--U!==0);else P.win.set(P.win.subarray(Y,Y+U),k),k+=U,Y+=U,U=0;break}else if(!(_&64))R+=L[te+2],R+=w&qu[_],te=(F+R)*3,_=L[te];else return M.msg="invalid distance code",U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3;while(!0);break}if(_&64)return _&32?(U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,1):(M.msg="invalid literal/length code",U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3);if(R+=L[te+2],R+=w&qu[_],te=(F+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],z--;break}}while(!0)}while(z>=258&&N>=10);return U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,0}e.init=function(b,x,A,C,S,v){t=H4,u=b,f=x,h=A,p=C,g=S,m=v,i=null},e.proc=function(b,x,A){let C,S,v,P=0,M=0,R=0,L,F,_,w;for(R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,F=b.write,_=F<b.read?b.read-F-1:b.end-F;;)switch(t){case H4:if(_>=258&&L>=10&&(b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,A=y(u,f,h,p,g,m,b,x),R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,F=b.write,_=F<b.read?b.read-F-1:b.end-F,A!=0)){t=A==1?M7:G4;break}r=u,i=h,o=p,t=qpe;case qpe:for(C=r;M<C;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}if(S=(o+(P&qu[C]))*3,P>>>=i[S+1],M-=i[S+1],v=i[S],v===0){s=i[S+2],t=Zpe;break}if(v&16){a=v&15,n=i[S+2],t=Ype;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=M7;break}return t=G4,x.msg="invalid literal/length code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);case Ype:for(C=a;M<C;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}n+=P&qu[C],P>>=C,M-=C,r=f,i=g,o=m,t=Xpe;case Xpe:for(C=r;M<C;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}if(S=(o+(P&qu[C]))*3,P>>=i[S+1],M-=i[S+1],v=i[S],v&16){a=v&15,l=i[S+2],t=Kpe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=G4,x.msg="invalid distance code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);case Kpe:for(C=a;M<C;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}l+=P&qu[C],P>>=C,M-=C,t=$pe;case $pe:for(w=F-l;w<0;)w+=b.end;for(;n!==0;){if(_===0&&(F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0&&(b.write=F,A=b.inflate_flush(x,A),F=b.write,_=F<b.read?b.read-F-1:b.end-F,F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0)))return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);b.win[F++]=b.win[w++],_--,w==b.end&&(w=0),n--}t=H4;break;case Zpe:if(_===0&&(F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0&&(b.write=F,A=b.inflate_flush(x,A),F=b.write,_=F<b.read?b.read-F-1:b.end-F,F==b.end&&b.read!==0&&(F=0,_=F<b.read?b.read-F-1:b.end-F),_===0)))return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);A=0,b.win[F++]=s,_--,t=H4;break;case M7:if(M>7&&(M-=8,L++,R--),b.write=F,A=b.inflate_flush(x,A),F=b.write,_=F<b.read?b.read-F-1:b.end-F,b.read!=b.write)return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);t=Qpe;case Qpe:return A=1,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);case G4:return A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A);default:return A=-2,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=F,b.inflate_flush(x,A)}},e.free=function(){}}var Jpe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],LS=0,L7=1,e_e=2,t_e=3,n_e=4,i_e=5,j4=6,W4=7,o_e=8,ET=9;function pit(e,t){let n=this,i=LS,o=0,r=0,s=0,a,l=[0],u=[0],f=new mit,h=0,p=new Int32Array(f_e*3),g=0,m=new F7;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(y,b){b&&(b[0]=g),i==j4&&f.free(y),i=LS,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(y,b){let x,A,C;return A=y.next_out_index,C=n.read,x=(C<=n.write?n.write:n.end)-C,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(C,C+x),A),A+=x,C+=x,C==n.end&&(C=0,n.write==n.end&&(n.write=0),x=n.write-C,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(C,C+x),A),A+=x,C+=x),y.next_out_index=A,n.read=C,b},n.proc=function(y,b){let x,A,C,S,v,P,M,R;for(S=y.next_in_index,v=y.avail_in,A=n.bitb,C=n.bitk,P=n.write,M=P<n.read?n.read-P-1:n.end-P;;){let L,F,_,w,D,I,N,k;switch(i){case LS:for(;C<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<C,C+=8}switch(x=A&7,h=x&1,x>>>1){case 0:A>>>=3,C-=3,x=C&7,A>>>=x,C-=x,i=L7;break;case 1:L=[],F=[],_=[[]],w=[[]],F7.inflate_trees_fixed(L,F,_,w),f.init(L[0],F[0],_[0],0,w[0],0),A>>>=3,C-=3,i=j4;break;case 2:A>>>=3,C-=3,i=t_e;break;case 3:return A>>>=3,C-=3,i=ET,y.msg="invalid block type",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}break;case L7:for(;C<32;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<C,C+=8}if((~A>>>16&65535)!=(A&65535))return i=ET,y.msg="invalid stored block lengths",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);o=A&65535,A=C=0,i=o!==0?e_e:h!==0?W4:LS;break;case e_e:if(v===0||M===0&&(P==n.end&&n.read!==0&&(P=0,M=P<n.read?n.read-P-1:n.end-P),M===0&&(n.write=P,b=n.inflate_flush(y,b),P=n.write,M=P<n.read?n.read-P-1:n.end-P,P==n.end&&n.read!==0&&(P=0,M=P<n.read?n.read-P-1:n.end-P),M===0)))return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(b=0,x=o,x>v&&(x=v),x>M&&(x=M),n.win.set(y.read_buf(S,x),P),S+=x,v-=x,P+=x,M-=x,(o-=x)!==0)break;i=h!==0?W4:LS;break;case t_e:for(;C<14;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<C,C+=8}if(r=x=A&16383,(x&31)>29||(x>>5&31)>29)return i=ET,y.msg="too many length or distance symbols",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(x=258+(x&31)+(x>>5&31),!a||a.length<x)a=[];else for(R=0;R<x;R++)a[R]=0;A>>>=14,C-=14,s=0,i=n_e;case n_e:for(;s<4+(r>>>10);){for(;C<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<C,C+=8}a[Jpe[s++]]=A&7,A>>>=3,C-=3}for(;s<19;)a[Jpe[s++]]=0;if(l[0]=7,x=m.inflate_trees_bits(a,l,u,p,y),x!=0)return b=x,b==-3&&(a=null,i=ET),n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);s=0,i=i_e;case i_e:for(;x=r,!(s>=258+(x&31)+(x>>5&31));){let z,V;for(x=l[0];C<x;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<C,C+=8}if(x=p[(u[0]+(A&qu[x]))*3+1],V=p[(u[0]+(A&qu[x]))*3+2],V<16)A>>>=x,C-=x,a[s++]=V;else{for(R=V==18?7:V-14,z=V==18?11:3;C<x+R;){if(v!==0)b=0;else return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<C,C+=8}if(A>>>=x,C-=x,z+=A&qu[R],A>>>=R,C-=R,R=s,x=r,R+z>258+(x&31)+(x>>5&31)||V==16&&R<1)return a=null,i=ET,y.msg="invalid bit length repeat",b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--z!==0);s=R}}if(u[0]=-1,D=[],I=[],N=[],k=[],D[0]=9,I[0]=6,x=r,x=m.inflate_trees_dynamic(257+(x&31),1+(x>>5&31),a,D,I,N,k,p,y),x!=0)return x==-3&&(a=null,i=ET),b=x,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);f.init(D[0],I[0],p,N[0],p,k[0]),i=j4;case j4:if(n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,(b=f.proc(n,y,b))!=1)return n.inflate_flush(y,b);if(b=0,f.free(y),S=y.next_in_index,v=y.avail_in,A=n.bitb,C=n.bitk,P=n.write,M=P<n.read?n.read-P-1:n.end-P,h===0){i=LS;break}i=W4;case W4:if(n.write=P,b=n.inflate_flush(y,b),P=n.write,M=P<n.read?n.read-P-1:n.end-P,n.read!=n.write)return n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);i=o_e;case o_e:return b=1,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);case ET:return b=-3,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);default:return b=-2,n.bitb=A,n.bitk=C,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}}},n.free=function(y){n.reset(y,null),n.win=null,p=null},n.set_dictionary=function(y,b,x){n.win.set(y.subarray(b,b+x),0),n.read=n.write=x},n.sync_point=function(){return i==L7?1:0}}var _it=32,git=8,yit=0,r_e=1,s_e=2,a_e=3,c_e=4,l_e=5,N7=6,pF=7,u_e=12,h0=13,bit=[0,0,255,255];function xit(){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=pF,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 pit(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==rit?-5:0,o=-5;;)switch(s.mode){case yit: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)!=git){s.mode=h0,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=h0,n.msg="invalid win size",s.marker=5;break}s.mode=r_e;case r_e: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=h0,n.msg="incorrect header check",s.marker=5;break}if(!(r&_it)){s.mode=pF;break}s.mode=s_e;case s_e: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=a_e;case a_e: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=c_e;case c_e: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=l_e;case l_e: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=N7,2);case N7:return s.mode=h0,n.msg="need dictionary",s.marker=0,-2;case pF:if(o=s.blocks.proc(n,o),o==-3){s.mode=h0,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=u_e;case u_e:return n.avail_in=0,1;case h0:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=N7)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=pF,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let l=n.istate;if(l.mode!=h0&&(l.mode=h0,l.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=l.marker;i!==0&&r<4;)n.read_byte(o)==bit[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,l.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,l.mode=pF,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function d_e(){}d_e.prototype={inflateInit(e){let t=this;return t.istate=new xit,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 h_e(e){let t=this,n=new d_e,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=oit,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,l){let u=[],f,h,p=0,g=0,m=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),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=p&&(l(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(h=new Uint8Array(m),u.forEach(function(y){h.set(y,g),g+=y.length})):h=u[0]?new Uint8Array(u[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var NS="/",B7=new Date(2107,11,31),k7=new Date(1980,0,1),Pi=void 0,Yu="undefined",ig="function";var _F=class{constructor(t){return class extends null{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 Tit=64,m_e=2;try{typeof navigator!=Yu&&navigator.hardwareConcurrency&&(m_e=navigator.hardwareConcurrency)}catch{}var Ait={chunkSize:512*1024,maxWorkers:m_e,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Pi,CompressionStreamNative:typeof CompressionStream!=Yu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Yu&&DecompressionStream},p0=Object.assign({},Ait);function gF(){return p0}function q4(e){return Math.max(e.chunkSize,Tit)}function FS(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:u,DecompressionStream:f,workerScripts:h}=e;if(m0("baseURL",t),m0("chunkSize",n),m0("maxWorkers",i),m0("terminateWorkerTimeout",o),m0("useCompressionStream",r),m0("useWebWorkers",s),a&&(p0.CompressionStream=new _F(a)),l&&(p0.DecompressionStream=new _F(l)),m0("CompressionStream",u),m0("DecompressionStream",f),h!==Pi){let{deflate:p,inflate:g}=h;if((p||g)&&(p0.workerScripts||(p0.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");p0.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");p0.workerScripts.inflate=g}}}function m0(e,t){t!==Pi&&(p0[e]=t)}var p_e=[];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;p_e[e]=t}var og=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^p_e[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var yF=class extends null{constructor(){let t,n=new og;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}};function BS(e){if(typeof TextEncoder==Yu){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 hl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=hl.getPartial(n);return i===32?e.concat(t):hl._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+hl.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]=hl.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=hl.getPartial(o);return i.push(hl.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},bF={bytes:{fromBits(e){let n=hl.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(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(hl.partial(8*(n&3),i)),t}}},__e={};__e.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=bF.utf8String.toBits(e));let n=t._buffer=hl.concat(t._buffer,e),i=t._length,o=t._length=i+hl.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=hl.concat(t,[hl.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 u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],l=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+l+i[u]+t._key[Math.floor(u/20)]|0;l=a,a=s,s=t._S(30,r),r=o,o=f}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]+l|0}};var U7={};U7.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,l=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 u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^l<<24,l=l<<1^(l>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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,l,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[l=o[a=o[f]]];let p=u*16843009^l*65537^a*257^f*16843008,g=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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],l=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,b,x,A;for(let C=0;C<i;C++)b=s[h>>>24]^a[p>>16&255]^l[g>>8&255]^u[m&255]^n[y],x=s[p>>>24]^a[g>>16&255]^l[m>>8&255]^u[h&255]^n[y+1],A=s[g>>>24]^a[m>>16&255]^l[h>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[h>>16&255]^l[p>>8&255]^u[g&255]^n[y+3],y+=4,h=b,p=x,g=A;for(let C=0;C<4;C++)o[t?3&-C:C]=f[h>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],b=h,h=p,p=g,g=m,m=b;return o}};var g_e={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}},V7={};V7.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=hl.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 hl.clamp(t,o)}};var _0={importKey(e){return new _0.hmacSha1(bF.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,l,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,g=hl;for(t=bF.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),l=0;l<s.length;l++)r[l]^=s[l];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};_0.hmacSha1=class{constructor(e){let t=this,n=t._hash=__e.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 Cit=typeof crypto!=Yu&&typeof crypto.getRandomValues==ig,g0="Invalid password",ST="Invalid signature",rg="zipjs-abort-check-password";function Y4(e){return Cit?crypto.getRandomValues(e):g_e.getRandomValues(e)}var kS=16,Eit="raw",x_e={name:"PBKDF2"},Sit={name:"HMAC"},wit="SHA-1",vit=Object.assign({hash:Sit},x_e),z7=Object.assign({iterations:1e3,hash:{name:wit}},x_e),Dit=["deriveBits"],TF=[8,12,16],xF=[16,24,32],y0=10,Pit=[0,0,0,0],$4=typeof crypto!=Yu,EF=$4&&crypto.subtle,T_e=$4&&typeof EF!=Yu,jm=bF.bytes,Iit=U7.aes,Oit=V7.ctrGladman,Rit=_0.hmacSha1,y_e=$4&&T_e&&typeof EF.importKey==ig,b_e=$4&&T_e&&typeof EF.deriveBits==ig,X4=class extends null{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:E_e(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let l=this,{password:u,strength:f,resolveReady:h,ready:p}=l;u?(await Mit(l,f,u,ud(s,0,TF[f]+2)),s=ud(s,TF[f]+2),r?a.error(new Error(rg)):h()):await p;let g=new Uint8Array(s.length-y0-(s.length-y0)%kS);a.enqueue(A_e(l,s,g,0,y0,!0))},async flush(s){let{signed:a,ctr:l,hmac:u,pending:f,ready:h}=this;if(u&&l){await h;let p=ud(f,0,f.length-y0),g=ud(f,f.length-y0),m=new Uint8Array;if(p.length){let y=CF(jm,p);u.update(y);let b=l.update(y);m=AF(jm,b)}if(a){let y=ud(AF(jm,u.digest()),0,y0);for(let b=0;b<y0;b++)if(y[b]!=g[b])throw new Error(ST)}s.enqueue(m)}}})}},K4=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:E_e(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:l,strength:u,resolveReady:f,ready:h}=a,p=new Uint8Array;l?(p=await Lit(a,u,l),f()):await h;let g=new Uint8Array(p.length+r.length-r.length%kS);g.set(p,0),s.enqueue(A_e(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:l,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(l.length){let h=s.update(CF(jm,l));a.update(h),f=AF(jm,h)}o.signature=AF(jm,a.digest()).slice(0,y0),r.enqueue(H7(f,o.signature))}}}),o=this}};function A_e(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:l}=e,u=t.length-o;l.length&&(t=H7(l,t),n=Bit(n,u-u%kS));let f;for(f=0;f<=u-kS;f+=kS){let h=CF(jm,ud(t,f,f+kS));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(AF(jm,p),f+i)}return e.pending=ud(t,f),n}async function Mit(e,t,n,i){let o=await C_e(e,t,n,ud(i,0,TF[t])),r=ud(i,TF[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(g0)}async function Lit(e,t,n){let i=Y4(new Uint8Array(TF[t])),o=await C_e(e,t,n,i);return H7(i,o)}async function C_e(e,t,n,i){e.password=null;let o=await Nit(Eit,n,vit,!1,Dit),r=await Fit(Object.assign({salt:i},z7),o,8*(xF[t]*2+2)),s=new Uint8Array(r),a=CF(jm,ud(s,0,xF[t])),l=CF(jm,ud(s,xF[t],xF[t]*2)),u=ud(s,xF[t]*2);return Object.assign(e,{keys:{key:a,authentication:l,passwordVerification:u},ctr:new Oit(new Iit(a),Array.from(Pit)),hmac:new Rit(l)}),u}async function Nit(e,t,n,i,o){if(y_e)try{return await EF.importKey(e,t,n,i,o)}catch{return y_e=!1,_0.importKey(t)}else return _0.importKey(t)}async function Fit(e,t,n){if(b_e)try{return await EF.deriveBits(e,t,n)}catch{return b_e=!1,_0.pbkdf2(t,e.salt,z7.iterations,n)}else return _0.pbkdf2(t,e.salt,z7.iterations,n)}function E_e(e,t){return t===Pi?BS(e):t}function H7(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 Bit(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function ud(e,t,n){return e.subarray(t,n)}function AF(e,t){return e.fromBits(t)}function CF(e,t){return e.toBits(t)}var US=12,Z4=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),D_e(this,t)},transform(o,r){let s=this;if(s.password){let a=S_e(s,o.subarray(0,US));if(s.password=null,a[US-1]!=s.passwordVerification)throw new Error(g0);o=o.subarray(US)}i?r.error(new Error(rg)):r.enqueue(S_e(s,o))}})}},Q4=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),D_e(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let l=Y4(new Uint8Array(US));l[US-1]=r.passwordVerification,s=new Uint8Array(i.length+l.length),s.set(w_e(r,l),0),a=US}else s=new Uint8Array(i.length),a=0;s.set(w_e(r,i),a),o.enqueue(s)}})}};function S_e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=P_e(e)^t[i],G7(e,n[i]);return n}function w_e(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=P_e(e)^t[i],G7(e,t[i]);return n}function D_e(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new og(n[0]),crcKey2:new og(n[2])});for(let i=0;i<t.length;i++)G7(e,t.charCodeAt(i))}function G7(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=v_e(Math.imul(v_e(i+I_e(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function P_e(e){let t=e.keys[2]|2;return I_e(Math.imul(t,t^1)>>>8)}function I_e(e){return e&255}function v_e(e){return e&4294967295}var O_e="deflate-raw",J4=class extends null{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:u,level:f}=t,h=this,p,g,m=R_e(super.readable);(!s||l)&&u&&(p=new yF,m=Wm(m,p)),r&&(m=L_e(m,a,{level:f,chunkSize:n},o,i)),s&&(l?m=Wm(m,new Q4(t)):(g=new K4(t),m=Wm(m,g))),M_e(h,m,()=>{let y;s&&!l&&(y=g.signature),(!s||l)&&u&&(y=new DataView(p.value.buffer).getUint32(0)),h.signature=y})}},e8=class extends null{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:u,useCompressionStream:f}=t,h,p,g=R_e(super.readable);s&&(r?g=Wm(g,new Z4(t)):(p=new X4(t),g=Wm(g,p))),u&&(g=L_e(g,f,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new yF,g=Wm(g,h)),M_e(this,g,()=>{if((!s||r)&&a){let m=new DataView(h.value.buffer);if(l!=m.getUint32(0,!1))throw new Error(ST)}})}};function R_e(e){return Wm(e,new null({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function M_e(e,t,n){t=Wm(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function L_e(e,t,n,i,o){try{let r=t&&i?i:o;e=Wm(e,new r(O_e,n))}catch{if(t)try{e=Wm(e,new o(O_e,n))}catch{return e}else return e}return e}function Wm(e,t){return e.pipeThrough(t)}var N_e="message",F_e="start",B_e="pull",j7="data",k_e="ack",W7="close",i8="deflate",o8="inflate";var t8=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(i8)?r=J4:o.startsWith(o8)&&(r=e8);let s=0,a=0,l=new r(t,n),u=super.readable,f=new null({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new null({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=l;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(l).pipeThrough(h)}})}},n8=class extends null{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 z_e=typeof Worker!=Yu;var VS=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new n8(r.chunkSize)).pipeThrough(new Y7(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:l,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?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,f(t)}}),(a&&z_e?kit:H_e)(t,r)}},Y7=class extends null{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await q7(n,o)},async transform(a,l){s+=a.length,i&&await q7(i,s,o),l.enqueue(a)},async flush(){t.size=s,r&&await q7(r,s)}})}};async function q7(e,...t){try{await e(...t)}catch{}}function H_e(e,t){return{run:()=>Uit(e,t)}}function kit(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Hit(e.scripts[0],n,e)}catch{return z_e=!1,H_e(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Vit(e,{chunkSize:i})}})}return e.interface}async function Uit({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new t8(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{i()}}async function Vit(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:l,closed:u}=zit(e.writable),f=r8({type:F_e,scripts:a.slice(1),options:s,config:t,readable:r,writable:l},e);f||Object.assign(e,{reader:r.getReader(),writer:l.getWriter()});let h=await o;return f||await l.getWriter().close(),await u,h}function zit(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 U_e=!0,V_e=!0;function Hit(e,t,n){let i={type:"module"},o,r;typeof e==ig&&(e=e());try{o=new URL(e,t)}catch{o=e}if(U_e)try{r=new Worker(o)}catch{U_e=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(N_e,s=>Git(s,n)),r}function r8(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,l=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,l.push(e.value)),o&&V_e?(s&&l.push(s),a&&l.push(a)):e.readable=e.writable=null,l.length)try{return t.postMessage(e,l),!0}catch{V_e=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Git({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:l,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(s){let{message:g,stack:m,code:y,name:b}=s,x=new Error(g);Object.assign(x,{stack:m,code:y,name:b}),p(x)}else{if(n==B_e){let{value:g,done:m}=await a.read();r8({type:j7,value:g,done:m,messageId:o},t)}n==j7&&(await l.ready,await l.write(new Uint8Array(i)),r8({type:k_e,messageId:o},t)),n==W7&&p(null,r)}}catch(g){r8({type:W7,messageId:o},t),p(g)}function p(g,m){g?f(g):u(m),l&&l.releaseLock(),h()}}var wT=[],X7=[];var G_e=0;async function s8(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:l,signed:u,encrypted:f}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Pi;let g=!l&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Pi&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Pi&&i.useCompressionStream,(await m()).run();async function m(){let b=wT.find(x=>!x.busy);if(b)return j_e(b),new VS(b,e,t,y);if(wT.length<p){let x={indexWorker:G_e};return G_e++,wT.push(x),new VS(x,e,t,y)}else return new Promise(x=>X7.push({resolve:x,stream:e,workerOptions:t}))}function y(b){if(X7.length){let[{resolve:x,stream:A,workerOptions:C}]=X7.splice(0,1);x(new VS(b,A,C,y))}else b.worker?(j_e(b),jit(b,t)):wT=wT.filter(x=>x!=b)}}function jit(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{wT=wT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function j_e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Wit="Writer iterator completed too soon",qit="text/plain";var Yit="Content-Type";var Xit=64*1024,Z7="writable",zS=class{constructor(){this.size=0}init(){this.initialized=!0}},a8=class extends zS{get readable(){let t=this,{chunkSize:n=Xit}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:l}=this;o.enqueue(await Ga(t,r+l,Math.min(n,s-l),a)),l+n>s?o.close():this.chunkOffset+=n}});return i}},K7=class extends zS{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,Z7,{get(){return n}})}writeUint8Array(){}};var c8=class extends K7{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)}},sg=class extends a8{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)}},SF=class extends zS{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([Yit,t]),Object.defineProperty(n,Z7,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},l8=class extends sg{constructor(t){super(new Blob([t],{type:qit}))}},u8=class extends SF{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 $7=class extends a8{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 l=t;for(;l>=r[a].size;)l-=r[a].size,a++;let u=r[a],f=u.size;if(l+n<=f)s=await Ga(u,l,n);else{let h=f-l;s=new Uint8Array(n),s.set(await Ga(u,l,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},f8=class extends zS{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(f){let{availableSize:h}=i;if(s)f.length>=h?(await l(f.slice(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(h))):await l(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Wit);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Ym(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,Z7,{get(){return a}});async function l(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){r.size=o.size,await s.close()}}};async function Ym(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function d8(e){return Array.isArray(e)&&(e=new $7(e)),e instanceof ReadableStream&&(e={readable:e}),e}function h8(e){e.writable===Pi&&typeof e.next==ig&&(e=new f8(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Pi&&(t.size=0),e instanceof f8||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ga(e,t,n,i){return e.readUint8Array(t,n,i)}var W_e="\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(""),Kit=W_e.length==256;function q_e(e){if(Kit){let t="";for(let n=0;n<e.length;n++)t+=W_e[e[n]];return t}else return new TextDecoder().decode(e)}function wF(e,t){return t&&t.trim().toLowerCase()=="cp437"?q_e(e):new TextDecoder(t).decode(e)}var Q7="filename",J7="rawFilename",eY="comment",tY="rawComment",nY="uncompressedSize",iY="compressedSize",oY="offset",m8="diskNumberStart",HS="lastModDate",p8="rawLastModDate",vF="lastAccessDate",Y_e="rawLastAccessDate",DF="creationDate",X_e="rawCreationDate",rY="internalFileAttribute",sY="externalFileAttribute",aY="msDosCompatible",_8="zip64",cY="encrypted",lY="version",uY="versionMadeBy",fY="zipCrypto",$it=[Q7,J7,iY,nY,HS,p8,eY,tY,vF,DF,oY,m8,m8,rY,sY,aY,_8,cY,lY,uY,fY,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],b0=class{constructor(t){$it.forEach(n=>this[n]=t[n])}};var dY="File format is not recognized",eot="End of central directory not found",tot="End of Zip64 central directory locator not found",not="Central directory header not found",iot="Local file header not found",oot="Zip64 extra field not found",rot="File contains encrypted entry",sot="Encryption method not supported",K_e="Compression method not supported",$_e="Split zip file",Z_e="utf-8",Q_e="cp437",aot=[[nY,4294967295],[iY,4294967295],[oY,4294967295],[m8,65535]],cot={[65535]:{getValue:Ts,bytes:4},[4294967295]:{getValue:g8,bytes:8}},E8=class{constructor(t,n={}){Object.assign(this,{reader:d8(t),options:n,config:gF()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Ym(i),(i.size===Pi||!i.readUint8Array)&&(i=new sg(await new Response(i.readable).blob()),await Ym(i)),i.size<22)throw new Error(dY);i.chunkSize=q4(o);let r=await hot(i,101010256,i.size,22,65535*16);if(!r){let F=await Ga(i,0,4),_=Ea(F);throw Ts(_)==134695760?new Error($_e):new Error(eot)}let s=Ea(r),a=Ts(s,12),l=Ts(s,16),u=r.offset,f=Ca(s,20),h=u+22+f,p=Ca(s,4),g=i.lastDiskNumber||0,m=Ca(s,6),y=Ca(s,8),b=0,x=0;if(l==4294967295||a==4294967295||y==65535||m==65535){let F=await Ga(i,r.offset-20,20),_=Ea(F);if(Ts(_,0)==117853008){l=g8(_,8);let w=await Ga(i,l,56,-1),D=Ea(w),I=r.offset-20-56;if(Ts(D,0)!=101075792&&l!=I){let N=l;l=I,b=l-N,w=await Ga(i,l,56,-1),D=Ea(w)}if(Ts(D,0)!=101075792)throw new Error(tot);p==65535&&(p=Ts(D,16)),m==65535&&(m=Ts(D,20)),y==65535&&(y=g8(D,32)),a==4294967295&&(a=g8(D,40)),l-=a}}if(l>=i.size&&(b=i.size-l-a-22,l=i.size-a-22),g!=p)throw new Error($_e);if(l<0)throw new Error(dY);let A=0,C=await Ga(i,l,a,m),S=Ea(C);if(a){let F=r.offset-a;if(Ts(S,A)!=33639248&&l!=F){let _=l;l=F,b+=l-_,C=await Ga(i,l,a,m),S=Ea(C)}}let v=r.offset-l-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,C=await Ga(i,l,a,m),S=Ea(C)),l<0||l>=i.size)throw new Error(dY);let P=ml(n,t,"filenameEncoding"),M=ml(n,t,"commentEncoding");for(let F=0;F<y;F++){let _=new mY(i,o,n.options);if(Ts(S,A)!=33639248)throw new Error(not);ege(_,S,A+6);let w=!!_.bitFlag.languageEncodingFlag,D=A+46,I=D+_.filenameLength,N=I+_.extraFieldLength,k=Ca(S,A+4),z=(k&0)==0,V=C.subarray(D,I),j=Ca(S,A+32),U=N+j,q=C.subarray(N,U),Y=w,te=w,K=z&&(GS(S,A+38)&16)==16,Z=Ts(S,A+42)+b;Object.assign(_,{versionMadeBy:k,msDosCompatible:z,compressedSize:0,uncompressedSize:0,commentLength:j,directory:K,offset:Z,diskNumberStart:Ca(S,A+34),internalFileAttribute:Ca(S,A+36),externalFileAttribute:Ts(S,A+38),rawFilename:V,filenameUTF8:Y,commentUTF8:te,rawExtraField:C.subarray(I,N)});let ee=ml(n,t,"decodeText")||wF,me=Y?Z_e:P||Q_e,Te=te?Z_e:M||Q_e,ue=ee(V,me);ue===Pi&&(ue=wF(V,me));let ye=ee(q,Te);ye===Pi&&(ye=wF(q,Te)),Object.assign(_,{rawComment:q,filename:ue,comment:ye,directory:K||ue.endsWith(NS)}),x=Math.max(Z,x),tge(_,_,S,A+6),_.zipCrypto=_.encrypted&&!_.extraFieldAES;let Ae=new b0(_);Ae.getData=(Ee,ze)=>_.getData(Ee,Ae,ze),A=U;let{onprogress:Pe}=t;if(Pe)try{await Pe(F+1,y,new b0(_))}catch{}yield Ae}let R=ml(n,t,"extractPrependedData"),L=ml(n,t,"extractAppendedData");return R&&(n.prependedData=x>0?await Ga(i,0,x):new Uint8Array),n.comment=f?await Ga(i,u+22,f):new Uint8Array,L&&(n.appendedData=h<i.size?await Ga(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 mY=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:l,compressionMethod:u,config:f,bitFlag:h,signature:p,rawLastModDate:g,uncompressedSize:m,compressedSize:y}=o,b=n.localDirectory={},x=await Ga(r,s,30,a),A=Ea(x),C=ml(o,i,"password"),S=ml(o,i,"rawPassword"),v=ml(o,i,"passThrough");if(C=C&&C.length&&C,S=S&&S.length&&S,l&&l.originalCompressionMethod!=99)throw new Error(K_e);if(u!=0&&u!=8&&!v)throw new Error(K_e);if(Ts(A,0)!=67324752)throw new Error(iot);ege(b,A,4),b.rawExtraField=b.extraFieldLength?await Ga(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,tge(o,b,A,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let P=o.encrypted&&b.encrypted&&!v,M=P&&!l;if(v||(n.zipCrypto=M),P){if(!M&&l.strength===Pi)throw new Error(sot);if(!C&&!S)throw new Error(rot)}let R=s+30+b.filenameLength+b.extraFieldLength,L=y,F=r.readable;Object.assign(F,{diskNumberStart:a,offset:R,size:L});let _=ml(o,i,"signal"),w=ml(o,i,"checkPasswordOnly");w&&(t=new WritableStream),t=h8(t),await Ym(t,v?y:m);let{writable:D}=t,{onstart:I,onprogress:N,onend:k}=i,z={options:{codecType:o8,password:C,rawPassword:S,zipCrypto:M,encryptionStrength:l&&l.strength,signed:ml(o,i,"checkSignature")&&!v,passwordVerification:M&&(h.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:ml(o,i,"useWebWorkers"),useCompressionStream:ml(o,i,"useCompressionStream"),transferStreams:ml(o,i,"transferStreams"),checkPasswordOnly:w},config:f,streamOptions:{signal:_,size:L,onstart:I,onprogress:N,onend:k}},V=0;try{({outputSize:V}=await s8({readable:F,writable:D},z))}catch(j){if(!w||j.message!=rg)throw j}finally{let j=ml(o,i,"preventClose");D.size+=V,!j&&!D.locked&&await D.getWriter().close()}return w?Pi:t.getData?t.getData():D}};function ege(e,t,n){let i=e.rawBitFlag=Ca(t,n+2),o=(i&1)==1,r=Ts(t,n+6);Object.assign(e,{encrypted:o,version:Ca(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:mot(r),filenameLength:Ca(t,n+22),extraFieldLength:Ca(t,n+24)})}function tge(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Ea(new Uint8Array(r)),l=0;try{for(;l<r.length;){let x=Ca(a,l),A=Ca(a,l+2);s.set(x,{type:x,data:r.slice(l+4,l+4+A)}),l+=4+A}}catch{}let u=Ca(n,i+4);Object.assign(t,{signature:Ts(n,i+10),uncompressedSize:Ts(n,i+18),compressedSize:Ts(n,i+14)});let f=s.get(1);f&&(lot(f,t),t.extraFieldZip64=f);let h=s.get(28789);h&&(J_e(h,Q7,J7,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(J_e(p,eY,tY,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(uot(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=s.get(10);m&&(fot(m,t),t.extraFieldNTFS=m);let y=s.get(21589);y&&(dot(y,t,o),t.extraFieldExtendedTimestamp=y);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function lot(e,t){t.zip64=!0;let n=Ea(e.data),i=aot.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 l=cot[a];t[s]=e[s]=l.getValue(n,r),r+=l.bytes}else if(e[s])throw new Error(oot)}}function J_e(e,t,n,i,o){let r=Ea(e.data),s=new og;s.append(o[n]);let a=Ea(new Uint8Array(4));a.setUint32(0,s.get(),!0);let l=Ts(r,1);Object.assign(e,{version:GS(r,0),[t]:wF(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==Ts(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function uot(e,t,n){let i=Ea(e.data),o=GS(i,4);Object.assign(e,{vendorVersion:GS(i,0),vendorId:GS(i,2),strength:o,originalCompressionMethod:n,compressionMethod:Ca(i,5)}),t.compressionMethod=e.compressionMethod}function fot(e,t){let n=Ea(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=Ca(n,i),s=Ca(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=Ea(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});let u=hY(s),f=hY(a),h=hY(l),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function dot(e,t,n){let i=Ea(e.data),o=GS(i,0),r=[],s=[];n?((o&1)==1&&(r.push(HS),s.push(p8)),(o&2)==2&&(r.push(vF),s.push(Y_e)),(o&4)==4&&(r.push(DF),s.push(X_e))):e.data.length>=5&&(r.push(HS),s.push(p8));let a=1;r.forEach((l,u)=>{if(e.data.length>=a+4){let f=Ts(i,a);t[l]=e[l]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function hot(e,t,n,i,o){let r=new Uint8Array(4),s=Ea(r);pot(s,0,t);let a=i+o;return await l(i)||await l(Math.min(a,n));async function l(u){let f=n-u,h=await Ga(e,f,u);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:f+p,buffer:h.slice(p,p+i).buffer}}}function ml(e,t,n){return t[n]===Pi?e.options[n]:t[n]}function mot(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 hY(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function GS(e,t){return e.getUint8(t)}function Ca(e,t){return e.getUint16(t,!0)}function Ts(e,t){return e.getUint32(t,!0)}function g8(e,t){return Number(e.getBigUint64(t,!0))}function pot(e,t,n){e.setUint32(t,n,!0)}function Ea(e){return new DataView(e.buffer)}var bot="File already exists",xot="Zip file comment exceeds 64KB",Tot="File entry comment exceeds 64KB",Aot="File entry name exceeds 64KB",oge="Version exceeds 65535",Cot="The strength must equal 1, 2, or 3",Eot="Extra field type exceeds 65535",Sot="Extra field data exceeds 64KB",DY="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",wot="Undefined uncompressed size",rge=new Uint8Array([7,0,2,0,65,69,3,0,0]),wY=0,sge=[],v8=class{constructor(t,n={}){t=h8(t);let i=t.availableSize!==Pi&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Pi&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:gF(),files:new Map,filenames:new Set,offset:n.offset===Pi?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;wY<s.maxWorkers?wY++:await new Promise(l=>sge.push(l));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(bot);return o.filenames.add(t),a=vot(o,t,n,i),r.add(a),await a}catch(l){throw o.filenames.delete(t),l}finally{r.delete(a);let l=sge.shift();l?l():wY--}}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 Fot(this,t,n),po(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function vot(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(NS)?t+=NS:i.directory=t.endsWith(NS);let o=po(e,i,"encodeText",BS),r=o(t);if(r===Pi&&(r=BS(t)),Qi(r)>65535)throw new Error(Aot);let s=i.comment||"",a=o(s);if(a===Pi&&(a=BS(s)),Qi(a)>65535)throw new Error(Tot);let l=po(e,i,lY,20);if(l>65535)throw new Error(oge);let u=po(e,i,uY,20);if(u>65535)throw new Error(oge);let f=po(e,i,HS,new Date),h=po(e,i,vF),p=po(e,i,DF),g=po(e,i,aY,!0),m=po(e,i,rY,0),y=po(e,i,sY,0),b=po(e,i,"passThrough"),x,A;b||(x=po(e,i,"password"),A=po(e,i,"rawPassword"));let C=po(e,i,"encryptionStrength",3),S=po(e,i,fY),v=po(e,i,"extendedTimestamp",!0),P=po(e,i,"keepOrder",!0),M=po(e,i,"level"),R=po(e,i,"useWebWorkers"),L=po(e,i,"bufferedWrite"),F=po(e,i,"dataDescriptorSignature",!1),_=po(e,i,"signal"),w=po(e,i,"useUnicodeFileNames",!0),D=po(e,i,"useCompressionStream"),I=po(e,i,"compressionMethod"),N=po(e,i,"dataDescriptor",!0),k=po(e,i,_8);if(!S&&(x!==Pi||A!==Pi)&&!(C>=1&&C<=3))throw new Error(Cot);let z=new Uint8Array,{extraField:V}=i;if(V){let Dt=0,jt=0;V.forEach($e=>Dt+=4+Qi($e)),z=new Uint8Array(Dt),V.forEach(($e,un)=>{if(un>65535)throw new Error(Eot);if(Qi($e)>65535)throw new Error(Sot);Ms(z,new Uint16Array([un]),jt),Ms(z,new Uint16Array([Qi($e)]),jt+2),Ms(z,$e,jt+4),jt+=4+Qi($e)})}let j=0,U=0,q=0;if(b&&({uncompressedSize:q}=i,q===Pi))throw new Error(wot);let Y=k===!0;n&&(n=d8(n),await Ym(n),b?j=age(q):n.size===Pi?(N=!0,(k||k===Pi)&&(k=!0,q=j=4294967296)):(q=n.size,j=age(q)));let{diskOffset:te,diskNumber:K,maxSize:Z}=e.writer,ee=Y||q>4294967295,me=Y||j>4294967295,Te=Y||e.offset+e.pendingEntriesSize-te>4294967295,ye=po(e,i,"supportZip64SplitFile",!0)&&Y||K+Math.ceil(e.pendingEntriesSize/Z)>65535;if(Te||ee||me||ye){if(k===!1||!P)throw new Error(DY);k=!0}k=k||!1;let Ae=po(e,i,cY),{signature:Pe}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:l,versionMadeBy:u,lastModDate:f,lastAccessDate:h,creationDate:p,rawExtraField:z,zip64:k,zip64UncompressedSize:ee,zip64CompressedSize:me,zip64Offset:Te,zip64DiskNumberStart:ye,password:x,rawPassword:A,level:!D&&e.config.CompressionStream===Pi&&e.config.CompressionStreamNative===Pi?0:M,useWebWorkers:R,encryptionStrength:C,extendedTimestamp:v,zipCrypto:S,bufferedWrite:L,keepOrder:P,useUnicodeFileNames:w,dataDescriptor:N,dataDescriptorSignature:F,signal:_,msDosCompatible:g,internalFileAttribute:m,externalFileAttribute:y,useCompressionStream:D,passThrough:b,encrypted:!!(x&&Qi(x)||A&&Qi(A))||b&&Ae,signature:Pe,compressionMethod:I});let Ee=Iot(i),ze=Rot(i),qe=Qi(Ee.localHeaderArray,ze.dataDescriptorArray);U=qe+j,e.options.usdz&&(U+=U+64),e.pendingEntriesSize+=U;let it;try{it=await Dot(e,t,n,{headerInfo:Ee,dataDescriptorInfo:ze,metadataSize:qe},i)}finally{e.pendingEntriesSize-=U}return Object.assign(it,{name:t,comment:s,extraField:V}),new b0(it)}async function Dot(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:l,signal:u}=o,{headerInfo:f}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},m,y,b,x,A,C,S;r.set(t,g);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!l)&&!h?(C=new null,S=new Response(C.readable).blob(),C.writable.size=0,m=!0,e.bufferedWrites++,await Ym(s)):(C=s,await P()),await Ym(C);let{writable:L}=s,{diskOffset:F}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let w=new Uint8Array(4),D=ja(w);Zi(D,0,134695760),await Xm(L,w),e.offset+=4}h&&Oot(i,e.offset-F),m||(await R,await M(L));let{diskNumber:_}=s;if(A=!0,g.diskNumberStart=_,g=await Pot(n,C,g,i,e.config,o),A=!1,r.set(t,g),g.filename=t,m){await C.writable.getWriter().close();let w=await S;await R,await P(),x=!0,l||(w=await Lot(g,w,L,o)),await M(L),g.diskNumberStart=s.diskNumber,F=s.diskOffset,await w.stream().pipeTo(L,{preventClose:!0,preventAbort:!0,signal:u}),L.size+=w.size,x=!1}if(g.offset=e.offset-F,g.zip64)Not(g,o);else if(g.offset>4294967295)throw new Error(DY);return e.offset+=g.size,g}catch(R){if(m&&x||!m&&A){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=C.writable.size:e.offset=C.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),y&&y()}function v(){g.lock=new Promise(R=>b=R)}async function P(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(L=>y=()=>{e.writerLocked=!1,L()}),await R}async function M(R){Qi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Xm(R,new Uint8Array))}}async function Pot(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:l,metadataSize:u}=o,{localHeaderArray:f,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:b,compressionMethod:x,rawExtraFieldExtendedTimestamp:A,extraFieldExtendedTimestampFlag:C,rawExtraFieldNTFS:S,rawExtraFieldAES:v}=a,{dataDescriptorArray:P}=l,{rawFilename:M,lastAccessDate:R,creationDate:L,password:F,rawPassword:_,level:w,zip64:D,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:z,zipCrypto:V,dataDescriptor:j,directory:U,versionMadeBy:q,rawComment:Y,rawExtraField:te,useWebWorkers:K,onstart:Z,onprogress:ee,onend:me,signal:Te,encryptionStrength:ue,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,useCompressionStream:ze,passThrough:qe}=s,it={lock:i,versionMadeBy:q,zip64:D,directory:!!U,filenameUTF8:!0,rawFilename:M,commentUTF8:!0,rawComment:Y,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:S,rawExtraFieldAES:v,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,diskNumberStart:n},{signature:Dt,uncompressedSize:jt}=s,$e=0;qe||(jt=0);let{writable:un}=t;if(e){e.chunkSize=q4(r),await Xm(un,f);let Ct=e.readable,Ei=Ct.size=e.size,an={options:{codecType:i8,level:w,rawPassword:_,password:F,encryptionStrength:ue,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!qe,compressed:y&&!qe,encrypted:m&&!qe,useWebWorkers:K,useCompressionStream:ze,transferStreams:!1},config:r,streamOptions:{signal:Te,size:Ei,onstart:Z,onprogress:ee,onend:me}},_e=await s8({readable:Ct,writable:un},an);$e=_e.outputSize,qe||(jt=_e.inputSize,Dt=_e.signature),un.size+=jt}else await Xm(un,f);let zt;if(D){let Ct=4;I&&(Ct+=8),N&&(Ct+=8),k&&(Ct+=8),z&&(Ct+=4),zt=new Uint8Array(Ct)}else zt=new Uint8Array;return Mot({signature:Dt,rawExtraFieldZip64:zt,compressedSize:$e,uncompressedSize:jt,headerInfo:a,dataDescriptorInfo:l},s),j&&await Xm(un,P),Object.assign(it,{uncompressedSize:jt,compressedSize:$e,lastModDate:p,rawLastModDate:g,creationDate:L,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+$e,compressionMethod:x,version:b,headerArray:h,signature:Dt,rawExtraFieldZip64:zt,extraFieldExtendedTimestampFlag:C,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:z}),it}function Iot(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:l,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:m}=e,{version:y,compressionMethod:b}=e,x=!f&&(r>0||r===Pi&&b!==0),A;if(m&&!a){A=new Uint8Array(Qi(rge)+2);let k=ja(A);oo(k,0,39169),Ms(A,rge,2),D8(k,8,p)}else A=new Uint8Array;let C,S,v;if(g){S=new Uint8Array(9+(i?4:0)+(o?4:0));let k=ja(S);oo(k,0,21589),oo(k,2,Qi(S)-4),v=1+(i?2:0)+(o?4:0),D8(k,4,v);let z=5;Zi(k,z,Math.floor(n.getTime()/1e3)),z+=4,i&&(Zi(k,z,Math.floor(i.getTime()/1e3)),z+=4),o&&Zi(k,z,Math.floor(o.getTime()/1e3));try{C=new Uint8Array(36);let V=ja(C),j=vY(n);oo(V,0,10),oo(V,2,32),oo(V,8,1),oo(V,10,24),Jl(V,12,j),Jl(V,20,vY(i)||j),Jl(V,28,vY(o)||j)}catch{C=new Uint8Array}}else C=S=new Uint8Array;let P=0;l&&(P=P|2048),u&&(P=P|8),b===Pi&&(b=x?8:0),b==8&&(r>=1&&r<3&&(P=P|6),r>=3&&r<5&&(P=P|1),r===9&&(P=P|2)),s&&(y=y>45?y:45),m&&(P=P|1,a||(y=y>51?y:51,A[9]=b,b=99));let M=new Uint8Array(26),R=ja(M);oo(R,0,y),oo(R,2,P),oo(R,4,b);let L=new Uint32Array(1),F=ja(L),_;n<k7?_=k7:n>B7?_=B7:_=n,oo(F,0,(_.getHours()<<6|_.getMinutes())<<5|_.getSeconds()/2),oo(F,2,(_.getFullYear()-1980<<4|_.getMonth()+1)<<5|_.getDate());let w=L[0];Zi(R,6,w),oo(R,22,Qi(t));let D=Qi(A,S,C,h);oo(R,24,D);let I=new Uint8Array(30+Qi(t)+D),N=ja(I);return Zi(N,0,67324752),Ms(I,M,4),Ms(I,t,30),Ms(I,A,30+Qi(t)),Ms(I,S,30+Qi(t,A)),Ms(I,C,30+Qi(t,A,S)),Ms(I,h,30+Qi(t,A,S,C)),{localHeaderArray:I,headerArray:M,headerView:R,lastModDate:n,rawLastModDate:w,encrypted:m,compressed:x,version:y,compressionMethod:b,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:C,rawExtraFieldAES:A,extraFieldLength:D}}function Oot(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=ja(i),s=64-(t+Qi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),l=ja(a);oo(l,0,6534),oo(l,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Qi(u)+s),Ms(i,u),Ms(i,a,Qi(u)),r=ja(i),oo(r,28,o+s),e.metadataSize+=s}function Rot(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=ja(o),i&&(s=4,Zi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Mot(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:l,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:m,zipCrypto:y,dataDescriptor:b}=t;if((!u||y)&&n!==Pi&&(Zi(l,10,n),b&&Zi(f,h,n)),p){let x=ja(i);oo(x,0,1),oo(x,2,Qi(i)-4);let A=4;g&&(Zi(l,18,4294967295),Jl(x,A,BigInt(r)),A+=8),m&&(Zi(l,14,4294967295),Jl(x,A,BigInt(o))),b&&(Jl(f,h+4,BigInt(o)),Jl(f,h+12,BigInt(r)))}else Zi(l,14,o),Zi(l,18,r),b&&(Zi(f,h+4,o),Zi(f,h+8,r))}async function Lot(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)&&Zi(r,14,e.signature),e.zip64?(Zi(r,18,4294967295),Zi(r,22,4294967295)):(Zi(r,18,e.compressedSize),Zi(r,22,e.uncompressedSize)),await Xm(n,new Uint8Array(o)),t.slice(o.byteLength)}function Not(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:l}=t,u=ja(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Jl(u,f,BigInt(i)),f+=8),l&&Zi(u,f,o)}async function Fot(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,l=0,u=0,f=e.offset-r,h=i.size;for(let[,v]of i){let{rawFilename:P,rawExtraFieldZip64:M,rawExtraFieldAES:R,rawComment:L,rawExtraFieldNTFS:F,rawExtraField:_,extendedTimestamp:w,extraFieldExtendedTimestampFlag:D,lastModDate:I}=v,N;if(w){N=new Uint8Array(9);let k=ja(N);oo(k,0,21589),oo(k,2,5),D8(k,4,D),Zi(k,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=N,u+=46+Qi(P,L,M,R,F,N,_)}let p=new Uint8Array(u),g=ja(p);await Ym(o);let m=0;for(let[v,P]of Array.from(i.values()).entries()){let{offset:M,rawFilename:R,rawExtraFieldZip64:L,rawExtraFieldAES:F,rawExtraFieldCDExtendedTimestamp:_,rawExtraFieldNTFS:w,rawExtraField:D,rawComment:I,versionMadeBy:N,headerArray:k,directory:z,zip64:V,zip64UncompressedSize:j,zip64CompressedSize:U,zip64DiskNumberStart:q,zip64Offset:Y,msDosCompatible:te,internalFileAttribute:K,externalFileAttribute:Z,diskNumberStart:ee,uncompressedSize:me,compressedSize:Te}=P,ue=Qi(L,F,_,w,D);Zi(g,l,33639248),oo(g,l+4,N);let ye=ja(k);j||Zi(ye,18,me),U||Zi(ye,14,Te),Ms(p,k,l+6),oo(g,l+30,ue),oo(g,l+32,Qi(I)),oo(g,l+34,V&&q?65535:ee),oo(g,l+36,K),Z?Zi(g,l+38,Z):z&&te&&D8(g,l+38,16),Zi(g,l+42,V&&Y?4294967295:M),Ms(p,R,l+46),Ms(p,L,l+46+Qi(R)),Ms(p,F,l+46+Qi(R,L)),Ms(p,_,l+46+Qi(R,L,F)),Ms(p,w,l+46+Qi(R,L,F,_)),Ms(p,D,l+46+Qi(R,L,F,_,w)),Ms(p,I,l+46+Qi(R)+ue);let Ae=46+Qi(R,I)+ue;if(l-m>o.availableSize&&(o.availableSize=0,await Xm(s,p.slice(m,l)),m=l),l+=Ae,n.onprogress)try{await n.onprogress(v+1,i.size,new b0(P))}catch{}}await Xm(s,m?p.slice(m):p);let y=o.diskNumber,{availableSize:b}=o;b<22&&y++;let x=po(e,n,_8);if(f>4294967295||u>4294967295||h>65535||y>65535){if(x===!1)throw new Error(DY);x=!0}let A=new Uint8Array(x?98:22),C=ja(A);l=0,x&&(Zi(C,0,101075792),Jl(C,4,BigInt(44)),oo(C,12,45),oo(C,14,45),Zi(C,16,y),Zi(C,20,a),Jl(C,24,BigInt(h)),Jl(C,32,BigInt(h)),Jl(C,40,BigInt(u)),Jl(C,48,BigInt(f)),Zi(C,56,117853008),Jl(C,64,BigInt(f)+BigInt(u)),Zi(C,72,y+1),po(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),h=65535,f=4294967295,u=4294967295,l+=76),Zi(C,l,101010256),oo(C,l+4,y),oo(C,l+6,a),oo(C,l+8,h),oo(C,l+10,h),Zi(C,l+12,u),Zi(C,l+16,f);let S=Qi(t);if(S)if(S<=65535)oo(C,l+20,S);else throw new Error(xot);await Xm(s,A),S&&await Xm(s,t)}async function Xm(e,t){let n=e.getWriter();try{await n.ready,e.size+=Qi(t),await n.write(t)}finally{n.releaseLock()}}function vY(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function po(e,t,n,i){let o=t[n]===Pi?e.options[n]:t[n];return o===Pi?i:o}function age(e){return e+5*(Math.floor(e/16383)+1)}function D8(e,t,n){e.setUint8(t,n)}function oo(e,t,n){e.setUint16(t,n,!0)}function Zi(e,t,n){e.setUint32(t,n,!0)}function Jl(e,t,n){e.setBigUint64(t,n,!0)}function Ms(e,t,n){e.set(t,n)}function ja(e){return new DataView(e.buffer)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}FS({Deflate:Wpe,Inflate:h_e});var PY=32,Bot="http://www.opengis.net/kml/2.2",Lh="http://www.google.com/kml/ext/2.2",kot="http://www.w3.org/2000/xmlns/";function P8(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Uot=/^data:image\/([^,;]+)/;P8.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof we){if(e=we.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Uot);n=`texture_${++this._count}`,c(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 Vot(e,t){return function(n){e._files[t]=n}}P8.prototype.model=function(e,t){let n=this._modelCallback;if(!c(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(Vot(this,r))}return o};Object.defineProperties(P8.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function I8(e){this._time=e}I8.prototype.get=function(e,t,n){let i;return c(e)&&(i=c(e.getValue)?e.getValue(this._time,n):e),i??t};I8.prototype.getColor=function(e,t){let n=this.get(e,t);if(c(n))return DT(n)};I8.prototype.getMaterialType=function(e){if(c(e))return e.getType(this._time)};function IY(){this._ids={},this._styles={},this._count=0}IY.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(c(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};IY.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 fge(){this._ids={}}fge.prototype.get=function(e){if(!c(e))return this.get(jn());let t=this._ids;return c(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function OY(e){e=e??W.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1;if(!c(t))throw new E("entities is required.");let i=OY._createState(e),o=t.values.filter(function(u){return!c(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(kot,"xmlns:gx",Lh);let a=r.createElement("Document");s.appendChild(a),hge(i,a,o),i.styleCache.save(a);let l=i.externalFileHandler;return l.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?zot(f,l.files):{kml:f,externalFiles:l.files}})}function zot(e,t){let n=tn("ThirdParty/Workers/z-worker-pako.js");FS({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new SF,o=new v8(i);return o.add("doc.kml",new l8(e)).then(function(){let r=Object.keys(t);return dge(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function dge(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new sg(n[o])).then(function(){return dge(e,t,n,i+1)})}OY._createState=function(e){let t=e.entities,n=new IY,i=t.computeAvailability(),o=c(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new En:Q.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new P8(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Bot,"kml"),ellipsoid:e.ellipsoid??ie.default,idManager:new fge,styleCache:n,externalFileHandler:a,time:o,valueGetter:new I8(o),sampleDuration:s,defaultAvailability:new Xr([r])}};function hge(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,l,u,f;for(let h=0;h<a;++h){let p=n[h];l=[],u=[],f=[],Hot(e,p,u,f),Got(e,p.polyline,u,f),uge(e,p.rectangle,u,f,l),uge(e,p.polygon,u,f,l),Yot(e,p,p.model,u,f);let g,m=p.availability;c(m)&&(g=i.createElement("TimeSpan"),Q.equals(m.start,Ge.MINIMUM_VALUE)||g.appendChild(dn(i,"begin",Q.toIso8601(m.start))),Q.equals(m.stop,Ge.MAXIMUM_VALUE)||g.appendChild(dn(i,"end",Q.toIso8601(m.stop))));for(let x=0;x<l.length;++x){let A=l[x];A.setAttribute("id",s.get(p.id)),A.appendChild(dn(i,"name",p.name)),A.appendChild(dn(i,"visibility",p.show)),A.appendChild(dn(i,"description",p.description)),c(g)&&A.appendChild(g),t.appendChild(A)}let y=u.length;if(y>0){let x=i.createElement("Placemark");x.setAttribute("id",s.get(p.id));let A=p.name,C=p.label;if(c(C)){let v=i.createElement("LabelStyle"),P=r.get(C.text);A=c(P)&&P.length>0?P:A;let M=r.getColor(C.fillColor);c(M)&&(v.appendChild(dn(i,"color",M)),v.appendChild(dn(i,"colorMode","normal")));let R=r.get(C.scale);c(R)&&v.appendChild(dn(i,"scale",R)),f.push(v)}x.appendChild(dn(i,"name",A)),x.appendChild(dn(i,"visibility",p.show)),x.appendChild(dn(i,"description",p.description)),c(g)&&x.appendChild(g),t.appendChild(x);let S=f.length;if(S>0){let v=i.createElement("Style");for(let P=0;P<S;++P)v.appendChild(f[P]);x.appendChild(dn(i,"styleUrl",o.get(v)))}if(u.length===1)x.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let P=0;P<y;++P)v.appendChild(u[P]);x.appendChild(v)}}let b=p._children;if(b.length>0){let x=i.createElement("Folder");x.setAttribute("id",s.get(p.id)),x.appendChild(dn(i,"name",p.name)),x.appendChild(dn(i,"visibility",p.show)),x.appendChild(dn(i,"description",p.description)),t.appendChild(x),hge(e,x,b)}}}var eu=new d,pl=new he,Mh=new Q;function Hot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!c(a)&&!c(t.path))return;let l=t.position;if(!l.isConstant){mge(e,t,a,n,i);return}s.get(l,void 0,eu);let u=dn(o,"coordinates",vT(eu,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(PT(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=a instanceof fc?_ge(e,a):pge(e,a);i.push(p)}function mge(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,l,u=t.position,f=!0;u instanceof ba?(l=u.intervals,f=!1):l=t.availability??e.defaultAvailability;let h=n instanceof Gp,p,g,m,y=[];for(p=0;p<l.length;++p){let x=l.get(p),A=f?u:x.data,C=r.createElement("altitudeMode");A instanceof zm?(A=A._value,C.appendChild(PT(e,We.CLAMP_TO_GROUND))):c(n)?C.appendChild(PT(e,n.heightReference)):C.appendChild(PT(e,We.NONE));let S=[],v=[];if(A.isConstant){a.get(A,void 0,eu);let M=dn(r,"coordinates",vT(eu,s));S.push(Q.toIso8601(x.start)),v.push(M),S.push(Q.toIso8601(x.stop)),v.push(M)}else if(A instanceof Ta)for(m=A._property._times,g=0;g<m.length;++g)S.push(Q.toIso8601(m[g])),A.getValueInReferenceFrame(m[g],Hi.FIXED,eu),v.push(vT(eu,s));else if(A instanceof Vu){m=A._times;let M=A._values;for(g=0;g<m.length;++g)S.push(Q.toIso8601(m[g])),d.fromArray(M,g*3,eu),v.push(vT(eu,s))}else{let M=e.sampleDuration;x.start.clone(Mh),x.isStartIncluded||Q.addSeconds(Mh,M,Mh);let R=x.stop;for(;Q.lessThan(Mh,R);)A.getValue(Mh,eu),S.push(Q.toIso8601(Mh)),v.push(vT(eu,s)),Q.addSeconds(Mh,M,Mh);x.isStopIncluded&&Q.equals(Mh,R)&&(A.getValue(Mh,eu),S.push(Q.toIso8601(Mh)),v.push(vT(eu,s)))}let P=r.createElementNS(Lh,"Track");P.appendChild(C);for(let M=0;M<S.length;++M){let R=dn(r,"when",S[M]),L=dn(r,"coord",v[M],Lh);P.appendChild(R),P.appendChild(L)}h&&P.appendChild(gge(e,n)),y.push(P)}if(y.length===1)i.push(y[0]);else if(y.length>1){let x=r.createElementNS(Lh,"MultiTrack");for(p=0;p<y.length;++p)x.appendChild(y[p]);i.push(x)}if(c(n)&&!h){let x=n instanceof fc?_ge(e,n):pge(e,n);o.push(x)}let b=t.path;if(c(b)){let x=a.get(b.width),A=b.material;if(c(A)||c(x)){let C=r.createElement("LineStyle");c(x)&&C.appendChild(dn(r,"width",x)),RY(e,A,C),o.push(C)}}}function pge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);c(r)&&(o.appendChild(dn(n,"color",r)),o.appendChild(dn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return c(s)&&o.appendChild(dn(n,"scale",s/PY)),o}function _ge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(c(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(dn(n,"href",s));let g=i.get(t.imageSubRegion);c(g)&&(p.appendChild(dn(n,"x",g.x,Lh)),p.appendChild(dn(n,"y",g.y,Lh)),p.appendChild(dn(n,"w",g.width,Lh)),p.appendChild(dn(n,"h",g.height,Lh))),r.appendChild(p)}let a=i.getColor(t.color);c(a)&&(r.appendChild(dn(n,"color",a)),r.appendChild(dn(n,"colorMode","normal")));let l=i.get(t.scale);c(l)&&r.appendChild(dn(n,"scale",l));let u=i.get(t.pixelOffset);if(c(u)){l=l??1,H.divideByScalar(u,l,u);let p=i.get(t.width,PY),g=i.get(t.height,PY),m=i.get(t.horizontalOrigin,bi.CENTER);m===bi.CENTER?u.x-=p*.5:m===bi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Fn.CENTER);y===Fn.TOP?u.y+=g:y===Fn.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return c(f)&&d.equals(d.UNIT_Z,h)&&(f=O.toDegrees(-f),f===0&&(f=360),r.appendChild(dn(n,"heading",f))),r}function Got(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!c(t))return;let a=o.createElement("LineString"),l=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(dn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),l.appendChild(f),a.appendChild(l);let h=t.positions,p=s.get(h),g=dn(o,"coordinates",vT(p,r));a.appendChild(g);let m=s.get(t.zIndex);u&&c(m)&&a.appendChild(dn(o,"drawOrder",m,Lh)),n.push(a);let y=o.createElement("LineStyle"),b=s.get(t.width);c(b)&&y.appendChild(dn(o,"width",b)),RY(e,t.material,y),i.push(y)}function jot(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),l=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,pl),l.push(`${O.toDegrees(pl.longitude)},${O.toDegrees(pl.latitude)},${r}`);let f=dn(i,"coordinates",l.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function lge(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],r,pl),s.push(`${O.toDegrees(pl.longitude)},${O.toDegrees(pl.latitude)},${i?pl.height:n}`);let l=dn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(l),u}function Wot(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=[],l=t.hierarchy,u=o.get(l),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(lge(e,f,r,s)),a.push(h);let p=u.holes;if(c(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(lge(e,p[m].positions,r,s)),a.push(y)}}return a}function uge(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!c(t))return;let a=t instanceof jd;if(a&&s.getMaterialType(t.material)==="Image"){qot(e,t,o);return}let l=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&l.appendChild(dn(r,"extrude",!0));let f=a?jot(e,t,u):Wot(e,t,u),h=f.length;for(let b=0;b<h;++b)l.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(PT(e,t.heightReference)),l.appendChild(p),n.push(l);let g=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(dn(r,"fill",m)),RY(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(dn(r,"outline",y));let b=r.createElement("LineStyle"),x=s.get(t.outlineWidth,1);b.appendChild(dn(r,"width",x));let A=s.getColor(t.outlineColor,G.BLACK);b.appendChild(dn(r,"color",A)),b.appendChild(dn(r,"colorMode","normal")),i.push(b)}i.push(g)}function qot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(PT(e,t.heightReference)),s.appendChild(a);let l=o.get(t.height);c(l)&&s.appendChild(dn(i,"altitude",l));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(dn(i,"north",O.toDegrees(u.north))),f.appendChild(dn(i,"south",O.toDegrees(u.south))),f.appendChild(dn(i,"east",O.toDegrees(u.east))),f.appendChild(dn(i,"west",O.toDegrees(u.west))),s.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),g=i.createElement("Icon");g.appendChild(dn(i,"href",p)),s.appendChild(g);let m=h.color;c(m)&&s.appendChild(dn(i,"color",DT(h.color))),n.push(s)}function gge(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(c(s)){let u=n.createElement("scale");u.appendChild(dn(n,"x",s)),u.appendChild(dn(n,"y",s)),u.appendChild(dn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),l=o.model(t,e.time);return a.appendChild(dn(n,"href",l)),r.appendChild(a),r}function Yot(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!c(n))return;let l=t.position;if(!l.isConstant){mge(e,t,n,i,o);return}let u=gge(e,n),f=r.createElement("altitudeMode");f.appendChild(PT(e,n.heightReference)),u.appendChild(f),a.get(l,void 0,eu),he.fromCartesian(eu,s,pl);let h=r.createElement("Location");h.appendChild(dn(r,"longitude",O.toDegrees(pl.longitude))),h.appendChild(dn(r,"latitude",O.toDegrees(pl.latitude))),h.appendChild(dn(r,"altitude",pl.height)),u.appendChild(h),i.push(u)}function RY(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!c(t))return;let r=o.get(t);if(!c(r))return;let s,a=o.getMaterialType(t),l,u;switch(a){case"Image":s=DT(G.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=DT(r.color);break;case"PolylineOutline":s=DT(r.color),l=DT(r.outlineColor),u=r.outlineWidth,n.appendChild(dn(i,"outerColor",l,Lh)),n.appendChild(dn(i,"outerWidth",u,Lh));break;case"Stripe":s=DT(r.oddColor);break}c(s)&&(n.appendChild(dn(i,"color",s)),n.appendChild(dn(i,"colorMode","normal")))}function PT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,We.NONE),r;switch(o){case We.NONE:r=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function vT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,pl),i.push(`${O.toDegrees(pl.longitude)},${O.toDegrees(pl.latitude)},${pl.height}`);return i.join(" ")}function dn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=c(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 DT(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 MY=OY;function RF(){this._cache={}}RF.prototype.fromColor=function(e,t){if(!c(e))throw new E("color is required");if(!c(t))throw new E("size is required");return O8(void 0,void 0,e,t,this._cache)};RF.prototype.fromUrl=function(e,t,n){if(!c(e))throw new E("url is required");if(!c(t))throw new E("color is required");if(!c(n))throw new E("size is required");return O8(e,void 0,t,n,this._cache)};RF.prototype.fromMakiIconId=function(e,t,n){if(!c(e))throw new E("id is required");if(!c(t))throw new E("color is required");if(!c(n))throw new E("size is required");return O8(tn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};RF.prototype.fromText=function(e,t,n){if(!c(e))throw new E("text is required");if(!c(t))throw new E("color is required");if(!c(n))throw new E("size is required");return O8(void 0,e,t,n,this._cache)};var Xot=new G;function Kot(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Xot).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 yge(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=G.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=G.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var OF=new Array(4);function O8(e,t,n,i,o){OF[0]=e,OF[1]=t,OF[2]=n,OF[3]=i;let r=JSON.stringify(OF),s=o[r];if(c(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let l=a.getContext("2d");if(Kot(l,n,i),c(e)){let f=we.createIfNeeded(e).fetchImage().then(function(h){return yge(l,h,i),o[r]=a,a});return o[r]=f,f}else if(c(t)){let u=Fx(t,{font:`bold ${i}px sans-serif`});yge(l,u,i)}return o[r]=a,a}var ag=RF;var Tge=Zo(xge(),1);function M8(e){return d.fromDegrees(e[0],e[1],e[2])}var LY={"urn:ogc:def:crs:OGC:1.3:CRS84":M8,"EPSG:4326":M8,"urn:ogc:def:crs:EPSG::4326":M8},Age={},Cge={},NY=48,FY,BY=G.ROYALBLUE,kY=G.YELLOW,UY=2,VY=G.fromBytes(255,255,0,100),zY=!1,$ot={small:24,medium:48,large:64},Zot=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Ege(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Zot.indexOf(i)!==-1)continue;let o=e[i];c(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Ege(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 Qot(e,t,n){let i;return function(o,r){return c(i)||(i=e(t,n)),i}}function Jot(e,t){return new Wd(Qot(Ege,e,t),!0)}function L8(e,t,n){let i=e.id;if(!c(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;c(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(c(r)){o.properties=r;let s,a=r.title;if(c(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}c(s)&&(o.name=r[s])}let l=r.description;l!==null&&(o.description=c(l)?new Kn(l):n(r,s))}return o}function HY(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Sge={Feature:vge,FeatureCollection:ert,GeometryCollection:Dge,LineString:Mge,MultiLineString:Lge,MultiPoint:Oge,MultiPolygon:Bge,Point:Ige,Polygon:Fge,Topology:kge},wge={GeometryCollection:Dge,LineString:Mge,MultiLineString:Lge,MultiPoint:Oge,MultiPolygon:Bge,Point:Ige,Polygon:Fge,Topology:kge};function vge(e,t,n,i,o){if(t.geometry===null){L8(t,e._entityCollection,o.describe);return}if(!c(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=wge[r];if(!c(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function ert(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)vge(e,r[s],void 0,i,o)}function Dge(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let l=r[s],u=l.type,f=wge[u];if(!c(f))throw new ae(`Unknown geometry type: ${u}`);f(e,t,l,i,o)}}function Pge(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,l=t.properties;if(c(l)){let g=l["marker-color"];c(g)&&(s=G.fromCssColorString(g)),a=$ot[l["marker-size"]]??a;let m=l["marker-symbol"];c(m)&&(r=m)}let u;c(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new fc;f.verticalOrigin=new Kn(Fn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let h=L8(t,e._entityCollection,o.describe);h.billboard=f,h.position=new qc(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Kn(g)}).catch(function(){f.image=new Kn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Ige(e,t,n,i,o){Pge(e,t,i,n.coordinates,o)}function Oge(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Pge(e,t,i,r[s],o)}function Rge(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(c(a)){let f=a["stroke-width"];c(f)&&(s=new Kn(f));let h,p=a.stroke;c(p)&&(h=G.fromCssColorString(p));let g=a["stroke-opacity"];c(g)&&g!==1&&(c(h)||(h=r.color.getValue().clone()),h.alpha=g),c(h)&&(r=new Ut(h))}let l=L8(t,e._entityCollection,o.describe),u=new mc;l.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Kn(HY(i,n)),u.arcType=qt.RHUMB}function Mge(e,t,n,i,o){Rge(e,t,i,n.coordinates,o)}function Lge(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Rge(e,t,i,r[s],o)}function Nge(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,l=t.properties;if(c(l)){let g=l["stroke-width"];c(g)&&(a=new Kn(g));let m,y=l.stroke;c(y)&&(m=G.fromCssColorString(y));let b=l["stroke-opacity"];c(b)&&b!==1&&(c(m)||(m=r.getValue().clone()),m.alpha=b),c(m)&&(r=new Kn(m));let x,A=l.fill,C=s.color.getValue();c(A)&&(x=G.fromCssColorString(A),x.alpha=C.alpha),b=l["fill-opacity"],c(b)&&b!==C.alpha&&(c(x)||(x=C.clone()),x.alpha=b),c(x)&&(s=new Ut(x))}let u=new Gd;u.outline=new Kn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=qt.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new ka(HY(i[g],n)));let h=i[0];u.hierarchy=new Kn(new ka(HY(h,n),f)),h[0].length>2?u.perPositionHeight=new Kn(!0):o.clampToGround||(u.height=0);let p=L8(t,e._entityCollection,o.describe);p.polygon=u}function Fge(e,t,n,i,o){Nge(e,t,i,n.coordinates,o)}function Bge(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Nge(e,t,i,r[s],o)}function kge(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=Tge.feature(n,n.objects[r]),a=Sge[s.type];a(e,s,s,i,o)}}function x0(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new Qs(this),this._promises=[],this._pinBuilder=new ag,this._entityCluster=new Bu,this._credit=void 0,this._resourceCredits=[]}x0.load=function(e,t){return new x0().load(e,t)};Object.defineProperties(x0,{markerSize:{get:function(){return NY},set:function(e){NY=e}},markerSymbol:{get:function(){return FY},set:function(e){FY=e}},markerColor:{get:function(){return BY},set:function(e){BY=e}},stroke:{get:function(){return kY},set:function(e){kY=e}},strokeWidth:{get:function(){return UY},set:function(e){UY=e}},fill:{get:function(){return VY},set:function(e){VY=e}},clampToGround:{get:function(){return zY},set:function(e){zY=e}},crsNames:{get:function(){return LY}},crsLinkHrefs:{get:function(){return Age}},crsLinkTypes:{get:function(){return Cge}}});Object.defineProperties(x0.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){if(!c(e))throw new E("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});x0.prototype.load=function(e,t){return Uge(this,e,t,!0)};x0.prototype.process=function(e,t){return Uge(this,e,t,!1)};function Uge(e,t,n,i){if(!c(t))throw new E("data is required.");Kr.setLoading(e,!0),n=n??W.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Tt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;f<u;f++)a.push(l[f])}}return n={describe:n.describe??Jot,markerSize:n.markerSize??NY,markerSymbol:n.markerSymbol??FY,markerColor:n.markerColor??BY,strokeWidthProperty:new Kn(n.strokeWidth??UY),strokeMaterialProperty:new Ut(n.stroke??kY),fillMaterialProperty:new Ut(n.fill??VY),clampToGround:n.clampToGround??zY},Promise.resolve(r).then(function(a){return trt(e,a,n,s,i)}).catch(function(a){throw Kr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}x0.prototype.update=function(e){return!0};function trt(e,t,n,i,o){let r;c(i)&&(r=j_(i)),c(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Sge[t.type];if(!c(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,l=a!==null?M8:null;if(c(a)){if(!c(a.properties))throw new ae("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(l=LY[u.name],!c(l))throw new ae(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=Age[u.href];if(c(f)||(f=Cge[u.type]),!c(f))throw new ae(`Unable to resolve crs link: ${JSON.stringify(u)}`);l=f(u)}else if(a.type==="EPSG"){if(l=LY[`EPSG:${u.code}`],!c(l))throw new ae(`Unknown crs EPSG code: ${u.code}`)}else throw new ae(`Unknown crs type: ${a.type}`)}return Promise.resolve(l).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Kr.setLoading(e,!1),e})})}var T0=x0;function nrt(e){if(typeof e=="string"){let t=document.getElementById(e);if(t===null)throw new E(`Element with id "${e}" does not exist in the document.`);e=t}return e}var In=nrt;var Hye=Zo(fX(),1);var Gye;typeof DOMParser<"u"&&(Gye=new DOMParser);var Qst=new Hye.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),J8=32,Lye=2414016,Nye=1,Fye=16093e3,Bye=.1,Jst=[null,void 0,"http://www.topografix.com/GPX/1/1"],Do={gpx:Jst};function eat(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 dX(e,t){let n=FF(e,"id");return n=c(n)?n:jn(),t.getOrCreateEntity(n)}function hX(e){let t=kye(e,"lon"),n=kye(e,"lat"),i=LF(e,"ele",Do.gpx);return d.fromDegrees(t,n,i)}function kye(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function FF(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function A0(e,t,n){if(!c(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 mX(e,t,n){if(!c(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 LF(e,t,n){let i=A0(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function tu(e,t,n){let i=A0(e,t,n);if(c(i))return i.textContent.trim()}function jye(e){let t=new fc;return t.width=J8,t.height=J8,t.scaleByDistance=new Bt(Lye,Nye,Fye,Bye),t.pixelOffsetScaleByDistance=new Bt(Lye,Nye,Fye,Bye),t.verticalOrigin=new Kn(Fn.BOTTOM),t.image=e,t}function tat(){let e=new Hd;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function Wye(e){let t=new mc;return t.width=4,t.material=new e0,t.material.color=c(e)?e:G.RED,t.material.outlineWidth=2,t.material.outlineColor=G.BLACK,t}var Uye={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"}},NF;typeof document<"u"&&(NF=document.createElement("div"));function pX(e,t){let n,i="",o=Object.keys(Uye),r=o.length;for(n=0;n<r;n++){let f=o[n],h=Uye[f];h.value=tu(e,h.tag,Do.gpx)??"",c(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!c(i)||i==="")return;i=Qst.link(i),NF.innerHTML=i;let s=NF.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=G.WHITE,l=G.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${l.toCssColorString()};`,u+='">',u+=`${NF.innerHTML}</div>`,NF.innerHTML="",u}function qye(e,t,n,i){let o=hX(t),r=dX(t,n);r.position=o;let s=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,J8);r.billboard=jye(s);let a=tu(t,"name",Do.gpx);r.name=a,r.label=tat(),r.label.text=a,r.description=pX(t,r),i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND,r.label.heightReference=We.CLAMP_TO_GROUND)}function nat(e,t,n,i){let o=dX(t,n);o.description=pX(t,o);let r=mX(t,"rtept",Do.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)qye(e,r[a],n,i),s[a]=hX(r[a]);o.polyline=Wye(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function iat(e,t,n,i){let o=dX(t,n);o.description=pX(t,o);let r=mX(t,"trkseg",Do.gpx),s=[],a=[],l,u=!0,f=new Ta;for(let h=0;h<r.length;h++)l=oat(r[h]),s=s.concat(l.positions),l.times.length>0?(a=a.concat(l.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,J8);o.billboard=jye(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND),o.availability=new Xr,o.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}o.polyline=Wye(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function oat(e){let t={positions:[],times:[]},n=mX(e,"trkpt",Do.gpx),i;for(let o=0;o<n.length;o++){let r=hX(n[o]);t.positions.push(r),i=tu(n[o],"time",Do.gpx),c(i)&&t.times.push(Q.fromIso8601(i))}return t}function rat(e){let t=A0(e,"metadata",Do.gpx);if(c(t)){let n={name:tu(t,"name",Do.gpx),desc:tu(t,"desc",Do.gpx),author:sat(t),copyright:cat(t),link:Yye(t),time:tu(t,"time",Do.gpx),keywords:tu(t,"keywords",Do.gpx),bounds:lat(t)};if(c(n.name)||c(n.desc)||c(n.author)||c(n.copyright)||c(n.link)||c(n.time)||c(n.keywords)||c(n.bounds))return n}}function sat(e){let t=A0(e,"author",Do.gpx);if(c(t)){let n={name:tu(t,"name",Do.gpx),email:aat(t),link:Yye(t)};if(c(n.name)||c(n.email)||c(n.link))return n}}function aat(e){let t=A0(e,"email",Do.gpx);if(c(t)){let n=tu(t,"id",Do.gpx),i=tu(t,"domain",Do.gpx);return`${n}@${i}`}}function Yye(e){let t=A0(e,"link",Do.gpx);if(c(t)){let n={href:FF(t,"href"),text:tu(t,"text",Do.gpx),mimeType:tu(t,"type",Do.gpx)};if(c(n.href)||c(n.text)||c(n.mimeType))return n}}function cat(e){let t=A0(e,"copyright",Do.gpx);if(c(t)){let n={author:FF(t,"author"),year:tu(t,"year",Do.gpx),license:tu(t,"license",Do.gpx)};if(c(n.author)||c(n.year)||c(n.license))return n}}function lat(e){let t=A0(e,"bounds",Do.gpx);if(c(t)){let n={minLat:LF(t,"minlat",Do.gpx),maxLat:LF(t,"maxlat",Do.gpx),minLon:LF(t,"minlon",Do.gpx),maxLon:LF(t,"maxlon",Do.gpx)};if(c(n.minLat)||c(n.maxLat)||c(n.minLon)||c(n.maxLon))return n}}var Vye={wpt:qye,rte:nat,trk:iat};function uat(e,t,n,i){let o=Object.keys(Vye),r=o.length;for(let s=0;s<r;s++){let a=o[s],l=Vye[a],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===a&&Do.gpx.indexOf(p.namespaceURI)!==-1&&l(e,p,n,i)}}}function zye(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=FF(o,"version"),s=FF(o,"creator"),a,l=rat(o);c(l)&&(a=l.name),o.localName==="gpx"?uat(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,g=Q.equals(h,Ge.MINIMUM_VALUE),m=Q.equals(p,Ge.MAXIMUM_VALUE);if(!g||!m){let b;g&&(b=new Date,b.setHours(0,0,0,0),h=Q.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Q.fromDate(b)),u=new Ch,u.startTime=h,u.stopTime=p,u.currentTime=Q.clone(h),u.clockRange=$r.LOOP_STOP,u.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,h)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),fat(e._metadata,l)&&(e._metadata=l,y=!0),e._version!==r&&(e._version=r,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Kr.setLoading(e,!1),e}function fat(e,t){return!c(e)&&!c(t)?!1:c(e)&&c(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 dat(e,t,n,i){i=i??W.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)r.push(s[l])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?eat(r).then(function(s){let a,l;try{a=Gye.parseFromString(s,"application/xml")}catch(u){l=u.toString()}if(c(l)||a.body||a.documentElement.tagName==="parsererror"){let u=c(l)?l:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new ae(u)}return zye(e,a,i)}):zye(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function $S(){this._changed=new pe,this._error=new pe,this._loading=new pe,this._clock=void 0,this._entityCollection=new Qs(this),this._entityCluster=new Bu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new ag}$S.load=function(e,t){return new $S().load(e,t)};Object.defineProperties($S.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){if(!c(e))throw new E("value must be defined.");this._entityCluster=e}}});$S.prototype.update=function(e){return!0};$S.prototype.load=function(e,t){if(!c(e))throw new E("data is required.");t=t??W.EMPTY_OBJECT,Kr.setLoading(this,!0);let n=this._name,i=this;return dat(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=Q.equals(s,Ge.MINIMUM_VALUE),u=Q.equals(a,Ge.MAXIMUM_VALUE);if(!l||!u){let h;l&&(h=new Date,h.setHours(0,0,0,0),s=Q.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Q.fromDate(h)),o=new Ch,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=$r.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Kr.setLoading(i,!1),i}).catch(function(o){return Kr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var BF=$S;function hat(e,t){this.position=e,this.headingPitchRoll=t}var kF=hat;var a0e=Zo(fX(),1),jF=Zo(du(),1);function mat(e,t){this.position=e,this.headingPitchRange=t}var UF=mat;function eH(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new pe,this.tourEnd=new pe,this.entryStart=new pe,this.entryEnd=new pe,this._activeEntries=[]}eH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};eH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Kye.call(this,e,t,function(i){n.playlistIndex=0,i||Xye(n._activeEntries),n.tourEnd.raiseEvent(i)})};eH.prototype.stop=function(){Xye(this._activeEntries)};function Xye(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Kye(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=pat.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 c(n)&&n(!1)}function pat(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++,Kye.call(this,e,t,n)}}var VF=eH;var ki=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-ki.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?ki.Bounce.In(e*2)*.5:ki.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}}}}),zF=function(){return performance.now()},_at=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=zF()),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}(),ZS={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=ZS.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=ZS.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=ZS.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=ZS.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,l=o*a;return(2*t-2*n+r+s)*l+(-3*t+3*n-2*r-s)*a+r*o+t}}},$ye=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),_X=new _at,Zye=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=ki.Linear.None,this._interpolationFunction=ZS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=$ye.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=_X,_X.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=zF()),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],l=Array.isArray(a),u=l?"array":typeof a,f=!l&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,m=h.length;g<m;g+=1){var y=this._handleRelativeValue(a,h[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||l)&&a&&!f){n[s]=l?[]:{};var b=a;for(var x in b)n[s][x]=b[x];o[s]=l?[]:{};var h=i[s];if(!this._isDynamic){var A={};for(var x in h)A[x]=h[x];i[s]=h=A}this._setupProperties(b,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),l||(n[s]*=1),f?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=zF()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=zF()),!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=ki.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=ZS.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=zF()),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),l=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>l)return 1;var y=Math.trunc(s/a),b=s-y*a,x=Math.min(b/i._duration,1);return x===0&&s===i._duration?1:x},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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,m=this._chainedTweens.length;g<m;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],l=Array.isArray(t[r]),u=Array.isArray(a),f=!l&&u;f?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 Yli=$ye.nextId,Qm=_X,Xli=Qm.getAll.bind(Qm),Kli=Qm.removeAll.bind(Qm),$li=Qm.add.bind(Qm),Zli=Qm.remove.bind(Qm),Qli=Qm.update.bind(Qm);var gat={LINEAR_NONE:ki.Linear.None,QUADRATIC_IN:ki.Quadratic.In,QUADRATIC_OUT:ki.Quadratic.Out,QUADRATIC_IN_OUT:ki.Quadratic.InOut,CUBIC_IN:ki.Cubic.In,CUBIC_OUT:ki.Cubic.Out,CUBIC_IN_OUT:ki.Cubic.InOut,QUARTIC_IN:ki.Quartic.In,QUARTIC_OUT:ki.Quartic.Out,QUARTIC_IN_OUT:ki.Quartic.InOut,QUINTIC_IN:ki.Quintic.In,QUINTIC_OUT:ki.Quintic.Out,QUINTIC_IN_OUT:ki.Quintic.InOut,SINUSOIDAL_IN:ki.Sinusoidal.In,SINUSOIDAL_OUT:ki.Sinusoidal.Out,SINUSOIDAL_IN_OUT:ki.Sinusoidal.InOut,EXPONENTIAL_IN:ki.Exponential.In,EXPONENTIAL_OUT:ki.Exponential.Out,EXPONENTIAL_IN_OUT:ki.Exponential.InOut,CIRCULAR_IN:ki.Circular.In,CIRCULAR_OUT:ki.Circular.Out,CIRCULAR_IN_OUT:ki.Circular.InOut,ELASTIC_IN:ki.Elastic.In,ELASTIC_OUT:ki.Elastic.Out,ELASTIC_IN_OUT:ki.Elastic.InOut,BACK_IN:ki.Back.In,BACK_OUT:ki.Back.Out,BACK_IN_OUT:ki.Back.InOut,BOUNCE_IN:ki.Bounce.In,BOUNCE_OUT:ki.Bounce.Out,BOUNCE_IN_OUT:ki.Bounce.InOut},Qr=Object.freeze(gat);function tH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}tH.prototype.play=function(e,t,n){if(this.activeCamera=t,c(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(c(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)}};tH.prototype.stop=function(){c(this.activeCamera)&&this.activeCamera.cancelFlight(),c(this.activeCallback)&&this.activeCallback(!0)};tH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return c(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Qr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),c(e)&&(t=xt(t,e)),t};var HF=tH;function gX(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}gX.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};gX.prototype.stop=function(){clearTimeout(this.timeout),c(this.activeCallback)&&this.activeCallback(!0)};var GF=gX;var c0e={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=rb(t),c0e[t]}},EX;typeof DOMParser<"u"&&(EX=new DOMParser);var yat=new a0e.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),C0=32,Qye=2414016,Jye=1,e0e=16093e3,t0e=.1,n0e=[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"],i0e=["http://www.google.com/kml/ext/2.2"],bat=["http://www.w3.org/2005/Atom"],Re={kml:n0e,gx:i0e,atom:bat,kmlgx:n0e.concat(i0e)},SX={Document:y0e,Folder:kat,Placemark:Uat,NetworkLink:Xat,GroundOverlay:Wat,PhotoOverlay:T0e,ScreenOverlay:jat,Tour:zat};function Jm(e){this._dataSource=e,this._deferred=Dl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Jm.prototype,{dataSource:{get:function(){return this._dataSource}}});Jm.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Jm.prototype.addPromise=function(e){this._promises.push(e)};Jm.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Jm.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=$u._getTimestamp()),this._process(e)};Jm.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=$u._getTimestamp(),e._process(!0)},0)};Jm.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]};Jm.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Jm.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;c(i);){let o=SX[i.localName];if(c(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||$u._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function xat(e){let t=e.slice(0,Math.min(4,e.size)),n=Dl(),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 Tat(e){let t=Dl(),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 l0e(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&&(c(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return c(n)&&(e=n+i),e}function u0e(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 Aat(e,t){return Promise.resolve(e.getData(new u8)).then(function(n){n=l0e(n),n=u0e(n),t.kml=EX.parseFromString(n,"application/xml")})}function yX(e,t){let n=c0e.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new c8(n))).then(function(i){t[e.filename]=i})}function Xu(e,t,n,i){let o=i.keys,r=new jF.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let l=s[a],u=l.getAttribute(n);if(c(u)){let h=new jF.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let g=o[p];l.setAttribute(n,i[g]),t==="a"&&l.getAttribute("download")===null&&l.setAttribute("download",g)}}}}function Ku(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),l=wX(a,i);c(l)&&s.setAttribute(n,l.url)}}function f0e(e,t,n){let i=Ns(e,"id");i=c(i)&&i.length!==0?i:jn(),c(n)&&(i=n+i);let o=t.getById(i);return c(o)&&(i=jn(),c(n)&&(i=n+i)),o=t.add(new nr({id:i})),c(o.kml)||(o.addProperty("kml"),o.kml=new Qat),o}function WF(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function rH(e,t){if(!c(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!c(n))return d.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,d.fromDegrees(i,o,r,t)}function nH(e,t){if(!c(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!c(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=rH(n[s],t);return o}function E0(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ns(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ui(e,t,n){if(!c(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 o0e(e,t,n){if(!c(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(!c(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 Jn(e,t,n){let i=Ui(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function On(e,t,n){let i=Ui(e,t,n);if(c(i))return i.textContent.trim()}function Bh(e,t,n){let i=Ui(e,t,n);if(c(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function wX(e,t,n){if(!c(e))return;let i;if(c(n)){e=e.replace(/\\/g,"/");let o=n[e];if(c(o))i=new we({url:o});else{let r=new jF.default(t.getUrlComponent()),s=new jF.default(e);o=n[s.absoluteTo(r)],c(o)&&(i=new we({url:o}))}}return c(i)||(i=t.getDerivedResource({url:e})),i}var nu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function AX(e,t){if(!c(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?(nu.maximumRed=r,nu.red=void 0):(nu.maximumRed=void 0,nu.red=0),o>0?(nu.maximumGreen=o,nu.green=void 0):(nu.maximumGreen=void 0,nu.green=0),i>0?(nu.maximumBlue=i,nu.blue=void 0):(nu.maximumBlue=void 0,nu.blue=0),nu.alpha=n,G.fromRandom(nu)):new G(r,o,i,n)}function BT(e,t,n){let i=On(e,t,n);if(c(i))return AX(i,On(e,"colorMode",n)==="random")}function Cat(e){let t=Ui(e,"TimeStamp",Re.kmlgx),n=On(t,"when",Re.kmlgx);if(!c(t)||!c(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Xr;return o.addInterval(new En({start:i,stop:Ge.MAXIMUM_VALUE})),o}function Eat(e){let t=Ui(e,"TimeSpan",Re.kmlgx);if(!c(t))return;let n,i=Ui(t,"begin",Re.kmlgx),o=c(i)?Q.fromIso8601(i.textContent):void 0,r=Ui(t,"end",Re.kmlgx),s=c(r)?Q.fromIso8601(r.textContent):void 0;if(c(o)&&c(s)){if(Q.lessThan(s,o)){let a=o;o=s,s=a}n=new Xr,n.addInterval(new En({start:o,stop:s}))}else c(o)?(n=new Xr,n.addInterval(new En({start:o,stop:Ge.MAXIMUM_VALUE}))):c(s)&&(n=new Xr,n.addInterval(new En({start:Ge.MINIMUM_VALUE,stop:s})));return n}function d0e(){let e=new fc;return e.width=C0,e.height=C0,e.scaleByDistance=new Bt(Qye,Jye,e0e,t0e),e.pixelOffsetScaleByDistance=new Bt(Qye,Jye,e0e,t0e),e}function vX(){let e=new Gd;return e.outline=!0,e.outlineColor=G.WHITE,e}function h0e(){let e=new Hd;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new H(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function DX(e,t,n,i,o){let r=On(e,"href",Re.kml);if(!c(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),l=Jn(e,"x",Re.gx)??0,u=Jn(e,"y",Re.gx)??0;l=Math.min(l/32,7),u=7-Math.min(u/32,7);let f=8*u+l;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=wX(r,n,i);if(o){let a=On(e,"refreshMode",Re.kml),l=On(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?dt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(l==="onStop"||l==="onRegion")&&dt(`kml-refreshMode-${l}`,`KML - Unsupported Icon viewRefreshMode: ${l}`);let u=On(e,"viewBoundScale",Re.kml)??1,f=l==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=On(e,"viewFormat",Re.kml)??f,p=On(e,"httpQuery",Re.kml);c(h)&&s.setQueryParameters(hu(oH(h))),c(p)&&s.setQueryParameters(hu(oH(p)));let g=t._ellipsoid;return IX(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function Sat(e,t,n,i,o){let r=Jn(t,"scale",Re.kml),s=Jn(t,"heading",Re.kml),a=BT(t,"color",Re.kml),l=Ui(t,"Icon",Re.kml),u=DX(l,e,i,o,!1);c(l)&&!c(u)&&(u=!1);let f=Jn(l,"x",Re.gx),h=Jn(l,"y",Re.gx),p=Jn(l,"w",Re.gx),g=Jn(l,"h",Re.gx),m=Ui(t,"hotSpot",Re.kml),y=E0(m,"x"),b=E0(m,"y"),x=Ns(m,"xunits"),A=Ns(m,"yunits"),C=n.billboard;c(C)||(C=d0e(),n.billboard=C),C.image=u,C.scale=r,C.color=a,(c(f)||c(h)||c(p)||c(g))&&(C.imageSubRegion=new Ke(f,h,p,g)),c(s)&&s!==0&&(C.rotation=O.toRadians(-s),C.alignedAxis=d.UNIT_Z),r=r??1;let S,v;c(y)&&(x==="pixels"?S=-y*r:x==="insetPixels"?S=(y-C0)*r:x==="fraction"&&(S=-y*C0*r),S+=C0*.5*r),c(b)&&(A==="pixels"?v=b*r:A==="insetPixels"?v=(-b+C0)*r:A==="fraction"&&(v=b*C0*r),v-=C0*.5*r),(c(S)||c(v))&&(C.pixelOffset=new H(S,v))}function iH(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 l=n.label;c(l)||(l=h0e(),n.label=l),l.scale=Jn(a,"scale",Re.kml)??l.scale,l.fillColor=BT(a,"color",Re.kml)??l.fillColor,l.text=n.name}else if(a.localName==="LineStyle"){let l=n.polyline;c(l)||(l=new mc,n.polyline=l),l.width=Jn(a,"width",Re.kml),l.material=BT(a,"color",Re.kml),c(BT(a,"outerColor",Re.gx))&&dt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c(Jn(a,"outerWidth",Re.gx))&&dt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c(Jn(a,"physicalWidth",Re.gx))&&dt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(Bh(a,"labelVisibility",Re.gx))&&dt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let l=n.polygon;c(l)||(l=vX(),n.polygon=l),l.material=BT(a,"color",Re.kml)??l.material,l.fill=Bh(a,"fill",Re.kml)??l.fill,l.outline=Bh(a,"outline",Re.kml)??l.outline}else if(a.localName==="BalloonStyle"){let l=AX(On(a,"bgColor",Re.kml))??G.WHITE,u=AX(On(a,"textColor",Re.kml))??G.BLACK,f=On(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:l,textColor:u,text:f}}else if(a.localName==="ListStyle"){let l=On(a,"listItemType",Re.kml);(l==="radioFolder"||l==="checkOffOnly")&&dt(`kml-listStyle-${l}`,`KML - Unsupported ListStyle with listItemType: ${l}`)}}}function wat(e,t,n,i,o){let r=new nr,s,a=-1,l=t.childNodes,u=l.length;for(let h=0;h<u;h++){let p=l[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=l[a];if(h.localName==="Style")iH(e,h,r,i,o);else{let p=Fh(h,"Pair",Re.kml);for(let g=0;g<p.length;g++){let m=p[g],y=On(m,"key",Re.kml);if(y==="normal"){let b=On(m,"styleUrl",Re.kml);if(c(b))s=n.getById(b),c(s)||(s=n.getById(`#${b}`)),c(s)&&r.merge(s);else{let x=Ui(m,"Style",Re.kml);iH(e,x,r,i,o)}}else dt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=On(t,"styleUrl",Re.kml);if(c(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(h),c(s)||(s=n.getById(`#${h}`)),c(s)&&r.merge(s)}return r}function vat(e,t,n){return t.fetchXML().then(function(i){return m0e(e,i,n,t,!0)})}function m0e(e,t,n,i,o,r){let s,a,l,u,f=o0e(t,"Style",Re.kml);if(c(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Ns(u,"id"),c(a)&&(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),c(n.getById(a))||(l=new nr({id:a}),n.add(l),iH(e,u,l,i,r)))}let h=o0e(t,"StyleMap",Re.kml);if(c(h)){let y=h.length;for(s=0;s<y;s++){let b=h[s];if(a=Ns(b,"id"),c(a)){let x=Fh(b,"Pair",Re.kml);for(let A=0;A<x.length;A++){let C=x[A],S=On(C,"key",Re.kml);if(S==="normal"){if(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),!c(n.getById(a))){l=n.getOrCreateEntity(a);let v=On(C,"styleUrl",Re.kml);if(c(v)){v[0]!=="#"&&(v=`#${v}`),o&&c(i)&&(v=i.getUrlComponent()+v);let P=n.getById(v);c(P)&&l.merge(P)}else u=Ui(C,"Style",Re.kml),iH(e,u,l,i,r)}}else dt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let b=y.split("#");if(b.length===2){let x=b[0],A=i.getDerivedResource({url:x});p.push(vat(e,A,n))}}}return p}function PX(e,t,n){let i=new Y_(e,t.id,["position"]),o=new zm(t.position);t.polyline=c(n.polyline)?n.polyline.clone():new mc,t.polyline.positions=new q_([i,o])}function p0e(e,t){return!c(e)&&!c(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(dt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(dt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(c(e)?dt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):dt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function Dat(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new zm(e))}function Pat(e,t,n,i){if(!c(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function sH(e,t,n,i){let o=t.label;c(o)||(o=c(n.label)?n.label.clone():h0e(),t.label=o),o.text=t.name;let r=t.billboard;c(r)||(r=c(n.billboard)?n.billboard.clone():d0e(),t.billboard=r),c(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(G.YELLOW,64);let s=1;c(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new H(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function _0e(e,t){let n=e.path;c(n)||(n=new jp,n.leadTime=0,e.path=n);let i=t.polyline;c(i)&&(n.material=i.material,n.width=i.width)}function Iat(e,t,n,i,o){let r=On(n,"coordinates",Re.kml),s=On(n,"altitudeMode",Re.kml),a=On(n,"altitudeMode",Re.gx),l=Bh(n,"extrude",Re.kml),u=e._ellipsoid,f=rH(r,u);return i.position=f,sH(e,i,o,p0e(s,a)),l&&WF(s,a)&&PX(t,i,o),!0}function r0e(e,t,n,i,o){let r=Ui(n,"coordinates",Re.kml),s=On(n,"altitudeMode",Re.kml),a=On(n,"altitudeMode",Re.gx),l=Bh(n,"extrude",Re.kml),u=Bh(n,"tessellate",Re.kml),f=WF(s,a),h=Jn(n,"drawOrder",Re.gx),p=e._ellipsoid,g=nH(r,p),m=o.polyline;if(f&&l){let y=new Wp;i.wall=y,y.positions=g;let b=o.polygon;c(b)&&(y.fill=b.fill,y.material=b.material),y.outline=!0,c(m)?(y.outlineColor=c(m.material)?m.material.color:G.WHITE,y.outlineWidth=m.width):c(b)&&(y.outlineColor=c(b.material)?b.material.color:G.WHITE)}else if(e._clampToGround&&!f&&u){let y=new mc;y.clampToGround=!0,i.polyline=y,y.positions=g,c(m)?(y.material=c(m.material)?m.material.color.getValue(Ge.MINIMUM_VALUE):G.WHITE,y.width=m.width??1):(y.material=G.WHITE,y.width=1),y.zIndex=h}else c(h)&&dt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&dt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=c(m)?m.clone():new mc,i.polyline=m,m.positions=Pat(g,s,a,p),(!u||f)&&(m.arcType=qt.NONE);return!0}function Oat(e,t,n,i,o){let r=Ui(n,"outerBoundaryIs",Re.kml),s=Ui(r,"LinearRing",Re.kml),a=Ui(s,"coordinates",Re.kml),l=e._ellipsoid,u=nH(a,l),f=Bh(n,"extrude",Re.kml),h=On(n,"altitudeMode",Re.kml),p=On(n,"altitudeMode",Re.gx),g=WF(h,p),m=c(o.polygon)?o.polygon.clone():vX(),y=o.polyline;if(c(y)&&(m.outlineColor=c(y.material)?y.material.color:G.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),c(u)){let b=new ka(u),x=Fh(n,"innerBoundaryIs",Re.kml);for(let A=0;A<x.length;A++){s=Fh(x[A],"LinearRing",Re.kml);for(let C=0;C<s.length;C++)a=Ui(s[C],"coordinates",Re.kml),u=nH(a,l),c(u)&&b.holes.push(new ka(u))}m.hierarchy=b}return!0}function Rat(e,t,n,i,o){let r=On(n,"altitudeMode",Re.kml),s=On(n,"altitudeMode",Re.gx),a=Fh(n,"coord",Re.gx),l=Fh(n,"angles",Re.gx),u=Fh(n,"when",Re.kml),f=Bh(n,"extrude",Re.kml),h=WF(r,s),p=e._ellipsoid;l.length>0&&dt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let x=0;x<g;x++){let A=rH(a[x].textContent,p);m.push(A),y.push(Q.fromIso8601(u[x].textContent))}let b=new Ta;return b.addSamples(y,m),i.position=b,sH(e,i,o,p0e(r,s)),_0e(i,o),i.availability=new Xr,u.length>0&&i.availability.addInterval(new En({start:y[0],stop:y[y.length-1]})),h&&f&&PX(t,i,o),!0}function s0e(e,t,n,i,o,r,s,a,l){let u=e[0],f=e[e.length-1],h=new Ta;h.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:Dat(h,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:l,isStopIncluded:l})),o.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:r}))}function Mat(e,t,n,i,o){let r=Bh(n,"interpolate",Re.gx),s=Fh(n,"Track",Re.gx),a,l,u,f=!1,h=new K_,p=new Xr,g=new ba,m=e._ellipsoid;for(let y=0,b=s.length;y<b;y++){let x=s[y],A=Fh(x,"when",Re.kml),C=Fh(x,"coord",Re.gx),S=On(x,"altitudeMode",Re.kml),v=On(x,"altitudeMode",Re.gx),P=WF(S,v),M=Bh(x,"extrude",Re.kml),R=Math.min(C.length,A.length),L=[];a=[];for(let F=0;F<R;F++){let _=rH(C[F].textContent,m);L.push(_),a.push(Q.fromIso8601(A[F].textContent))}r&&(c(l)&&s0e([l,a[0]],[u,L[0]],g,p,h,!1,"absolute",void 0,!1),l=a[R-1],u=L[L.length-1]),s0e(a,L,g,p,h,P&&M,S,v,!0),f=f||P&&M}return i.availability=p,i.position=g,sH(e,i,o),_0e(i,o),f&&(PX(t,i,o),i.polyline.show=h),!0}var g0e={Point:Iat,LineString:r0e,LinearRing:r0e,Polygon:Oat,Track:Rat,MultiTrack:Mat,MultiGeometry:Lat,Model:Nat};function Lat(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let l=0,u=s.length;l<u;l++){let f=s.item(l),h=g0e[f.localName];if(c(h)){let p=f0e(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(a=!0)}}return a}function Nat(e,t,n,i,o){return dt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Fat(e,t){let n=Ui(e,"ExtendedData",Re.kml);if(!c(n))return;c(Ui(n,"SchemaData",Re.kml))&&dt("kml-schemaData","KML - SchemaData is unsupported"),c(Ns(n,"xmlns:prefix"))&&dt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Fh(n,"Data",Re.kml);if(c(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],l=Ns(a,"name");c(l)&&(i[l]={displayName:On(a,"displayName",Re.kml),value:On(a,"value",Re.kml)})}}t.kml.extendedData=i}var _o;typeof document<"u"&&(_o=document.createElement("div"));function Bat(e,t,n,i,o){let r,s,a,l=t.kml,u=l.extendedData,f=On(e,"description",Re.kml),h=t.balloonStyle??n.balloonStyle,p=G.WHITE,g=G.BLACK,m=f;c(h)&&(p=h.bgColor??G.WHITE,g=h.textColor??G.BLACK,m=h.text??f);let y;if(c(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",l.address??""),m=m.replace("$[Snippet]",l.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),c(u)){let A=m.match(/\$\[.+?\]/g);if(A!==null)for(r=0;r<A.length;r++){let C=A[r],S=C.substr(2,C.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),y=u[S],c(y)&&(y=v?y.displayName:y.value),c(y)&&(m=m.replace(C,y??""))}}}else if(c(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!c(m))return;m=yat.link(m),_o.innerHTML=m;let b=_o.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(Xu(_o,"a","href",i),Xu(_o,"link","href",i),Xu(_o,"area","href",i),Xu(_o,"img","src",i),Xu(_o,"iframe","src",i),Xu(_o,"video","src",i),Xu(_o,"audio","src",i),Xu(_o,"source","src",i),Xu(_o,"track","src",i),Xu(_o,"input","src",i),Xu(_o,"embed","src",i),Xu(_o,"script","src",i),Xu(_o,"video","poster",i)),Ku(_o,"a","href",o),Ku(_o,"link","href",o),Ku(_o,"area","href",o),Ku(_o,"img","src",o),Ku(_o,"iframe","src",o),Ku(_o,"video","src",o),Ku(_o,"audio","src",o),Ku(_o,"source","src",o),Ku(_o,"track","src",o),Ku(_o,"input","src",o),Ku(_o,"embed","src",o),Ku(_o,"script","src",o),Ku(_o,"video","poster",o);let x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+=`background-color:${p.toCssColorString()};`,x+=`color:${g.toCssColorString()};`,x+='">',x+=`${_o.innerHTML}</div>`,_o.innerHTML="",t.description=x}function aH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=f0e(t,i,n.context),l=a.kml,u=wat(e,t,n.styleCollection,r,s),f=On(t,"name",Re.kml);a.name=f,a.parent=o;let h=Eat(t);c(h)||(h=Cat(t)),a.availability=h,RX(a);function p(C){return C?C.show&&p(C.parent):!0}let g=Bh(t,"visibility",Re.kml);a.show=p(o)&&(g??!0);let m=Ui(t,"author",Re.atom),y=l.author;y.name=On(m,"name",Re.atom),y.uri=On(m,"uri",Re.atom),y.email=On(m,"email",Re.atom);let b=Ui(t,"link",Re.atom),x=l.link;x.href=Ns(b,"href"),x.hreflang=Ns(b,"hreflang"),x.rel=Ns(b,"rel"),x.type=Ns(b,"type"),x.title=Ns(b,"title"),x.length=Ns(b,"length"),l.address=On(t,"address",Re.kml),l.phoneNumber=On(t,"phoneNumber",Re.kml),l.snippet=On(t,"Snippet",Re.kml),Fat(t,a),Bat(t,a,u,s,r);let A=e._ellipsoid;return x0e(t,a,A),b0e(t,a,A),c(Ui(t,"Region",Re.kml))&&dt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function y0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function kat(e,t,n,i){let o=aH(e,t,n),r=je(n);r.parentEntity=o.entity,y0e(e,t,r,i)}function Uat(e,t,n,i){let o=aH(e,t,n),r=o.entity,s=o.styleEntity,a=!1,l=t.childNodes;for(let u=0,f=l.length;u<f&&!a;u++){let h=l.item(u),p=g0e[h.localName];c(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),sH(e,r,s))}var Vat={FlyTo:Gat,Wait:Hat,SoundCue:bX,AnimatedUpdate:bX,TourControl:bX};function zat(e,t,n,i){let o=On(t,"name",Re.kml),r=Ns(t,"id"),s=new VF(o,r),a=Ui(t,"Playlist",Re.gx);if(a){let l=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=Vat[h.localName];p?p(s,h,l):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function bX(e,t){dt(`KML Tour unsupported node ${t.localName}`)}function Hat(e,t){let n=Jn(t,"duration",Re.gx);e.addPlaylistEntry(new GF(n))}function Gat(e,t,n){let i=Jn(t,"duration",Re.gx),o=On(t,"flyToMode",Re.gx),r={kml:{}};x0e(t,r,n),b0e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new HF(i,o,s);e.addPlaylistEntry(a)}function b0e(e,t,n){let i=Ui(e,"Camera",Re.kml);if(c(i)){let o=Jn(i,"longitude",Re.kml)??0,r=Jn(i,"latitude",Re.kml)??0,s=Jn(i,"altitude",Re.kml)??0,a=Jn(i,"heading",Re.kml)??0,l=Jn(i,"tilt",Re.kml)??0,u=Jn(i,"roll",Re.kml)??0,f=d.fromDegrees(o,r,s,n),h=Oa.fromDegrees(a,l-90,u);t.kml.camera=new kF(f,h)}}function x0e(e,t,n){let i=Ui(e,"LookAt",Re.kml);if(c(i)){let o=Jn(i,"longitude",Re.kml)??0,r=Jn(i,"latitude",Re.kml)??0,s=Jn(i,"altitude",Re.kml)??0,a=Jn(i,"heading",Re.kml),l=Jn(i,"tilt",Re.kml),u=Jn(i,"range",Re.kml)??0;l=O.toRadians(l??0),a=O.toRadians(a??0);let f=new cd(a,l-O.PI_OVER_TWO,u),h=d.fromDegrees(o,r,s,n);t.kml.lookAt=new UF(h,f)}}function jat(e,t,n,i){let o=n.screenOverlayContainer;if(!c(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ui(t,"Icon",Re.kml),l=DX(a,e,r,s,!1);if(!c(l))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=l.url,u.onload=function(){let f=["position: absolute"],h=Ui(t,"screenXY",Re.kml),p=Ui(t,"overlayXY",Re.kml),g=Ui(t,"size",Re.kml),m,y,b,x,A,C;c(g)&&(m=E0(g,"x"),y=E0(g,"y"),b=Ns(g,"xunits"),x=Ns(g,"yunits"),c(m)&&m!==-1&&m!==0&&(b==="fraction"?A=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(A=`width: ${m}px`),f.push(A)),c(y)&&y!==-1&&y!==0&&(x==="fraction"?C=`height: ${Math.floor(y*100)}%`:x==="pixels"&&(C=`height: ${y}px`),f.push(C))),u.style=f.join(";");let S=0,v=u.height;c(p)&&(m=E0(p,"x"),y=E0(p,"y"),b=Ns(p,"xunits"),x=Ns(p,"yunits"),c(m)&&(b==="fraction"?S=m*u.width:(b==="pixels"||b==="insetPixels")&&(S=m)),c(y)&&(x==="fraction"?v=y*u.height:(x==="pixels"||x==="insetPixels")&&(v=y))),c(h)&&(m=E0(h,"x"),y=E0(h,"y"),b=Ns(h,"xunits"),x=Ns(h,"yunits"),c(m)&&(b==="fraction"?A=`left: calc(${Math.floor(m*100)}% - ${S}px)`:b==="pixels"?A=`left: ${m-S}px`:b==="insetPixels"&&(A=`right: ${m-S}px`),f.push(A)),c(y)&&(x==="fraction"?C=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:x==="pixels"?C=`bottom: ${y-v}px`:x==="insetPixels"&&(C=`top: ${y-v}px`),f.push(C))),u.style=f.join(";")},o.appendChild(u)}function Wat(e,t,n,i){let r=aH(e,t,n).entity,s,a=!1,l=e._ellipsoid,u=nH(Ui(t,"LatLonQuad",Re.gx),l),f=Jn(t,"drawOrder",Re.kml);if(c(u))s=vX(),s.hierarchy=new ka(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new jd,s.zIndex=f,r.rectangle=s;let m=Ui(t,"LatLonBox",Re.kml);if(c(m)){let y=Jn(m,"west",Re.kml),b=Jn(m,"south",Re.kml),x=Jn(m,"east",Re.kml),A=Jn(m,"north",Re.kml);c(y)&&(y=O.negativePiToPi(O.toRadians(y))),c(b)&&(b=O.clampToLatitudeRange(O.toRadians(b))),c(x)&&(x=O.negativePiToPi(O.toRadians(x))),c(A)&&(A=O.clampToLatitudeRange(O.toRadians(A))),s.coordinates=new ce(y,b,x,A);let C=Jn(m,"rotation",Re.kml);if(c(C)){let S=O.toRadians(C);s.rotation=S,s.stRotation=S}}}let h=Ui(t,"Icon",Re.kml),p=DX(h,e,n.sourceResource,n.uriResolver,!0);if(c(p)){a&&dt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Jn(h,"x",Re.gx),y=Jn(h,"y",Re.gx),b=Jn(h,"w",Re.gx),x=Jn(h,"h",Re.gx);(c(m)||c(y)||c(b)||c(x))&&dt("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",Re.kml),s.material.transparent=!0}else s.material=BT(t,"color",Re.kml);let g=On(t,"altitudeMode",Re.kml);c(g)?g==="absolute"?(s.height=Jn(t,"altitude",Re.kml),s.zIndex=void 0):g!=="clampToGround"&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=On(t,"altitudeMode",Re.gx),g==="relativeToSeaFloor"?(dt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Jn(t,"altitude",Re.kml),s.zIndex=void 0):g==="clampToSeaFloor"?dt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(g)&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function T0e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),dt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var S0={INTERVAL:0,EXPIRE:1,STOP:2};function oH(e){if(!c(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var qat=new ce,QS=new he,xX=new H,Yat=new d;function IX(e,t,n,i,o,r){function s(u){return u<-O.PI_OVER_TWO?-O.PI_OVER_TWO:u>O.PI_OVER_TWO?O.PI_OVER_TWO:u}function a(u){return u>O.PI?u-O.TWO_PI:u<-O.PI?u+O.TWO_PI:u}let l=cb(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??qat,c(n)&&(xX.x=n.clientWidth*.5,xX.y=n.clientHeight*.5,u=t.pickEllipsoid(xX,r,Yat)),c(u)?f=r.cartesianToCartographic(u,QS):(f=ce.center(o,QS),u=r.cartographicToCartesian(f)),c(i)&&!O.equalsEpsilon(i,1,O.EPSILON9)){let x=o.width*i*.5,A=o.height*i*.5;o=new ce(a(f.longitude-x),s(f.latitude-A),a(f.longitude+x),s(f.latitude+A))}l=l.replace("[bboxWest]",O.toDegrees(o.west).toString()),l=l.replace("[bboxSouth]",O.toDegrees(o.south).toString()),l=l.replace("[bboxEast]",O.toDegrees(o.east).toString()),l=l.replace("[bboxNorth]",O.toDegrees(o.north).toString());let h=O.toDegrees(f.longitude).toString(),p=O.toDegrees(f.latitude).toString();l=l.replace("[lookatLon]",h),l=l.replace("[lookatLat]",p),l=l.replace("[lookatTilt]",O.toDegrees(t.pitch).toString()),l=l.replace("[lookatHeading]",O.toDegrees(t.heading).toString()),l=l.replace("[lookatRange]",d.distance(t.positionWC,u)),l=l.replace("[lookatTerrainLon]",h),l=l.replace("[lookatTerrainLat]",p),l=l.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,QS),l=l.replace("[cameraLon]",O.toDegrees(QS.longitude).toString()),l=l.replace("[cameraLat]",O.toDegrees(QS.latitude).toString()),l=l.replace("[cameraAlt]",O.toDegrees(QS.height).toString());let g=t.frustum,m=g.aspectRatio,y="",b="";if(c(m)){let x=O.toDegrees(g.fov);m>1?(y=x,b=x/m):(b=x,y=x*m)}l=l.replace("[horizFov]",y.toString()),l=l.replace("[vertFov]",b.toString())}else l=l.replace("[bboxWest]","-180"),l=l.replace("[bboxSouth]","-90"),l=l.replace("[bboxEast]","180"),l=l.replace("[bboxNorth]","90"),l=l.replace("[lookatLon]",""),l=l.replace("[lookatLat]",""),l=l.replace("[lookatRange]",""),l=l.replace("[lookatTilt]",""),l=l.replace("[lookatHeading]",""),l=l.replace("[lookatTerrainLon]",""),l=l.replace("[lookatTerrainLat]",""),l=l.replace("[lookatTerrainAlt]",""),l=l.replace("[cameraLon]",""),l=l.replace("[cameraLat]",""),l=l.replace("[cameraAlt]",""),l=l.replace("[horizFov]",""),l=l.replace("[vertFov]","");c(n)?(l=l.replace("[horizPixels]",n.clientWidth),l=l.replace("[vertPixels]",n.clientHeight)):(l=l.replace("[horizPixels]",""),l=l.replace("[vertPixels]","")),l=l.replace("[terrainEnabled]","1"),l=l.replace("[clientVersion]","1"),l=l.replace("[kmlVersion]","2.2"),l=l.replace("[clientName]","Cesium"),l=l.replace("[language]","English"),e.setQueryParameters(hu(l))}function Xat(e,t,n,i){let r=aH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,l=Ui(t,"Link",Re.kml);if(c(l)||(l=Ui(t,"Url",Re.kml)),c(l)){let u=On(l,"href",Re.kml),f,h;if(c(u)){let p=u;if(u=wX(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=On(l,"viewRefreshMode",Re.kml),f==="onRegion"){dt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=On(l,"viewBoundScale",Re.kml)??1;let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",x=On(l,"viewFormat",Re.kml)??b,A=On(l,"httpQuery",Re.kml);c(x)&&u.setQueryParameters(hu(oH(x))),c(A)&&u.setQueryParameters(hu(oH(A)));let C=e._ellipsoid;IX(u,e.camera,e.canvas,h,e._lastCameraView.bbox,C)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new Qs,y=OX(e,m,u,g).then(function(b){let x=e._entityCollection,A=m.values;x.suspendEvents();for(let v=0;v<A.length;v++){let P=A[v];c(P.parent)||(P.parent=r,RX(P)),x.add(P)}x.resumeEvents();let C=On(l,"refreshMode",Re.kml),S=Jn(l,"refreshInterval",Re.kml)??0;if(C==="onInterval"&&S>0||C==="onExpire"||f==="onStop"){let v=Ui(b,"NetworkLinkControl",Re.kml),P=c(v),M=Q.now(),R={id:jn(),href:u,cookie:{},lastUpdated:M,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:M},L=0;if(P&&(R.cookie=hu(On(v,"cookie",Re.kml)??""),L=Jn(v,"minRefreshPeriod",Re.kml)??0),C==="onInterval")P&&(S=Math.max(L,S)),R.refreshMode=S0.INTERVAL,R.time=S;else if(C==="onExpire"){let F;if(P&&(F=On(v,"expires",Re.kml)),c(F))try{let _=Q.fromIso8601(F),w=Q.secondsDifference(_,M);w>0&&w<L&&Q.addSeconds(M,L,_),R.refreshMode=S0.EXPIRE,R.time=_}catch{dt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else dt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else c(e.camera)?(R.refreshMode=S0.STOP,R.time=Jn(l,"viewRefreshTime",Re.kml)??0):dt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");c(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){dt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(y)}}}function Kat(e,t,n,i){let o=SX[t.localName];return c(o)?o(e,t,n,i):T0e(e,t,n,i)}function CX(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,l=a.localName==="Document"?a:Ui(a,"Document",Re.kml),u=On(l,"name",Re.kml);c(u)||(u=j_(i.getUrlComponent())),c(e._name)||(e._name=u);let f=new $u._DeferredLoading(e),h=new Qs(e);return Promise.all(m0e(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let b=m[y];if(c(SX[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Kat(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function $at(e,t,n,i,o){let r=tn("ThirdParty/Workers/z-worker-pako.js");FS({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new E8(new sg(n));return Promise.resolve(s.getEntries()).then(function(a){let l=[],u={},f;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!c(f)||!/\//i.test(p.filename))?(c(f)&&l.push(yX(f,u)),f=p):l.push(yX(p,u)))}return c(f)&&l.push(Aat(f,u)),Promise.all(l).then(function(){if(s.close(),!c(u.kml))throw new ae("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),CX(e,t,u.kml,i,u,o)})})}function OX(e,t,n,i){i=i??W.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,l=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),l=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(c(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=o??we.DEFAULT.clone();return o=we.createIfNeeded(o),c(a)&&(a=In(a)),Promise.resolve(l).then(function(u){return u instanceof Blob?xat(u).then(function(f){return f?$at(e,t,u,o,a):Tat(u).then(function(h){h=l0e(h),h=u0e(h);let p,g;try{p=EX.parseFromString(h,"application/xml")}catch(m){g=m.toString()}if(c(g)||p.body||p.documentElement.tagName==="parsererror"){let m=c(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new ae(m)}return CX(e,t,p,o,r,a,s)})}):CX(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function $u(e){e=e??W.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new pe,this._error=new pe,this._loading=new pe,this._refresh=new pe,this._unsupportedNode=new pe,this._clock=void 0,this._entityCollection=new Qs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new ag,this._networkLinks=new Et,this._entityCluster=new Bu,this.canvas=n,this.camera=t,this._lastCameraView={position:c(t)?d.clone(t.positionWC):void 0,direction:c(t)?d.clone(t.directionWC):void 0,up:c(t)?d.clone(t.upWC):void 0,bbox:c(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=e.ellipsoid??ie.default;let i=e.credit;typeof i=="string"&&(i=new Tt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}$u.load=function(e,t){return t=t??W.EMPTY_OBJECT,new $u(t).load(e,t)};Object.defineProperties($u.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){if(!c(e))throw new E("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});$u.prototype.load=function(e,t){if(!c(e))throw new E("data is required.");t=t??W.EMPTY_OBJECT,Kr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return OX(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=Q.equals(s,Ge.MINIMUM_VALUE),u=Q.equals(a,Ge.MAXIMUM_VALUE);if(!l||!u){let h;l&&(h=new Date,h.setHours(0,0,0,0),s=Q.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Q.fromDate(h)),o=new Ch,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=$r.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Kr.setLoading(i,!1),i}).catch(function(o){return Kr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};$u.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function RX(e){let t=e.parent;if(c(t)){let n=t.availability;if(c(n)){let i=e.availability;c(i)?i.intersect(n):e.availability=n}}}function Zat(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ui(r,"NetworkLinkControl",Re.kml),l=c(a),u=0;if(l){if(c(Ui(a,"Update",Re.kml))){dt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=hu(On(a,"cookie",Re.kml)??""),u=Jn(a,"minRefreshPeriod",Re.kml)??0}let f=Q.now(),h=t.refreshMode;if(h===S0.INTERVAL)c(a)&&(t.time=Math.max(u,t.time));else if(h===S0.EXPIRE){let M;if(c(a)&&(M=On(a,"expires",Re.kml)),c(M))try{let R=Q.fromIso8601(M),L=Q.secondsDifference(R,f);L>0&&L<u&&Q.addSeconds(f,u,R),t.time=R}catch{dt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else dt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(M){g.remove(M);let R=M._children,L=R.length;for(let F=0;F<L;++F)y(R[F])}g.suspendEvents();let b=g.values.slice(),x;for(x=0;x<b.length;++x){let M=b[x];M.parent===p&&(M.parent=void 0,y(M))}for(g.resumeEvents(),g.suspendEvents(),x=0;x<m.length;x++){let M=m[x];c(M.parent)||(M.parent=p,RX(M)),g.add(M)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let A=g.computeAvailability(),C=A.start,S=A.stop,v=Q.equals(C,Ge.MINIMUM_VALUE),P=Q.equals(S,Ge.MAXIMUM_VALUE);if(!v||!P){let M=e._clock;(M.startTime!==C||M.stopTime!==S)&&(M.startTime=C,M.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var TX=new Et;$u.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Q.now(),i=this;TX.removeAll();function o(f){let h=f._children,p=h.length;for(let g=0;g<p;++g){let m=h[g];TX.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;c(a)&&!(a.positionWC.equalsEpsilon(s.position,O.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,O.EPSILON7)&&a.upWC.equalsEpsilon(s.up,O.EPSILON7))&&(s.position=d.clone(a.positionWC),s.direction=d.clone(a.directionWC),s.up=d.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let l=new Et,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!TX.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===S0.INTERVAL?Q.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===S0.EXPIRE?Q.greaterThan(n,f.time)&&(p=!0):f.refreshMode===S0.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Q.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let g=new Qs,m=f.href.clone();m.setQueryParameters(f.cookie);let y=i._ellipsoid??ie.default;IX(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,y),OX(i,g,m,{context:h.id}).then(Zat(i,f,g,l,m)).catch(function(b){let x=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(x),i._error.raiseEvent(i,x)}),u=!0}}l.set(f.id,f)}}),u&&(this._networkLinks=l,this._changed.raiseEvent(this)),!0};function Qat(){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}$u._DeferredLoading=Jm;$u._getTimestamp=Ti;var kT=$u;function qF(){E.throwInstantiationError()}qF.prototype.update=E.throwInstantiationError;qF.prototype.getBoundingSphere=E.throwInstantiationError;qF.prototype.isDestroyed=E.throwInstantiationError;qF.prototype.destroy=E.throwInstantiationError;var MX=qF;var JS=`#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; +`;var Wxt=Pa.SHOW_INDEX,gne=Pa.POSITION_INDEX,Pwe=Pa.COLOR_INDEX,qxt=Pa.OUTLINE_COLOR_INDEX,Yxt=Pa.OUTLINE_WIDTH_INDEX,Xxt=Pa.PIXEL_SIZE_INDEX,Dwe=Pa.SCALE_BY_DISTANCE_INDEX,Rwe=Pa.TRANSLUCENCY_BY_DISTANCE_INDEX,Owe=Pa.DISTANCE_DISPLAY_CONDITION_INDEX,Kxt=Pa.DISABLE_DEPTH_DISTANCE_INDEX,$xt=Pa.SPLIT_DIRECTION_INDEX,_ne=Pa.NUMBER_OF_PROPERTIES,xl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function dh(e){e=e??H.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(_ne),this._maxPixelSize=1,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.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(dh.prototype,{length:{get:function(){return yne(this),this._pointPrimitives.length}}});function Mwe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}dh.prototype.add=function(e){let t=new Pa(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};dh.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};dh.prototype.removeAll=function(){Mwe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function yne(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}dh.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};dh.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};dh.prototype.get=function(e){return yne(this),this._pointPrimitives[e]};dh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<_ne;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function Jxt(e,t,n){return new hg(e,[{index:xl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[gne]},{index:xl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[gne]},{index:xl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Pwe]},{index:xl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Rwe]},{index:xl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Dwe]},{index:xl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Owe]}],t)}var mne=new Sn,a5=new z;function Nwe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ce.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,mne);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[xl.positionHighAndSize],u=mne.high;c(r,u.x,u.y,u.z,s);let f=n[xl.positionLowAndOutline],d=mne.low;f(r,d.x,d.y,d.z,a)}var Zxt=256;function Lwe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;a5.red=o.alpha,a5.green=s.alpha,a5.blue=a.alpha;let c=n[xl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(a5))}function Fwe(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=D.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*Zxt+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[xl.compressedAttribute1];g(r,d,p,o,a)}function Bwe(e,t,n,i){let r=i._index,o=n[xl.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function kwe(e,t,n,i){let r=i._index,o=n[xl.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 u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,s,a,u,f)}function Qxt(e,t,n,i){Nwe(e,t,n,i),Lwe(e,t,n,i),Fwe(e,t,n,i),Bwe(e,t,n,i),kwe(e,t,n,i)}function pne(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Pa._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ce.expand(s,d,s))}o&&ce.fromPoints(a,s)}function eTt(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&pne(e,i,i.length,t,o,!0)):n===re.MORPHING?pne(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&pne(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function tTt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var nTt=[];dh.prototype.update=function(e){if(yne(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,eTt(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<_ne;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Jxt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,Qxt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=nTt;v.length=0,(o[gne]||o[Yxt]||o[Xxt])&&v.push(Nwe),(o[Pwe]||o[qxt])&&v.push(Lwe),(o[Wxt]||o[Rwe])&&v.push(Fwe),o[Dwe]&&v.push(Bwe),(o[Owe]||o[Kxt]||o[$xt])&&v.push(kwe);let S=v.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R)}this._vaf.commit()}else{for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ce.clone(this._baseVolumeWC,this._boundingVolume)):d=ce.clone(this._baseVolume2D,this._boundingVolume),tTt(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Fi.OPAQUE||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Fi.TRANSLUCENT||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:tn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ye({sources:[u3]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT&&(y=new Ye({defines:["OPAQUE"],sources:[sb]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:xl}),y=new Ye({defines:["TRANSLUCENT"],sources:[sb]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:xl})),this._blendOption===Fi.OPAQUE&&(y=new Ye({sources:[sb]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:xl})),this._blendOption===Fi.TRANSLUCENT&&(y=new Ye({sources:[sb]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:xl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,E=e.commandList;if(u.render||f){let v=this._colorCommands,S=this._blendOption===Fi.OPAQUE,I=this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,v.length=b;let R=I?b*2:b;for(T=0;T<R;++T){let O=S||I&&T%2===0;x=v[T],l(x)||(x=v[T]=new at),x.primitiveType=Oe.POINTS,x.pass=O||!I?Ie.OPAQUE:Ie.TRANSLUCENT,x.owner=this;let L=I?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[L].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",E.push(x)}}};dh.prototype.isDestroyed=function(){return!1};dh.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(),Mwe(this._pointPrimitives),ue(this)};var Xw=dh;var Uwe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ane=1,f3=8,us=new Uint32Array(96),h3=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");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 r=i>>4;if(r!==Ane)throw new Error(`Got v${r} data when expected v${Ane}.`);let o=Uwe[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected 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 s=Uwe.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,f3,t),this.coords=new i(o,f3+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(f3+a+c+u);this.ids=new this.IndexArrayType(f,f3,t),this.coords=new i(f,f3+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(Ane<<4)+s]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,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 xne(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;us[0]=0,us[1]=o.length-1,us[2]=0;let c=3,u=[];for(;c>0;){let f=us[--c],d=us[--c],p=us[--c];if(d-p<=a){for(let A=p;A<=d;A++){let b=s[2*A],x=s[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(us[c++]=p,us[c++]=g-1,us[c++]=1-f),(f===0?i>=m:r>=y)&&(us[c++]=g+1,us[c++]=d,us[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;us[0]=0,us[1]=o.length-1,us[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=us[--c],p=us[--c],g=us[--c];if(p-g<=a){for(let b=g;b<=p;b++)zwe(s[2*b],s[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=s[2*m],A=s[2*m+1];zwe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(us[c++]=g,us[c++]=m-1,us[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(us[c++]=m+1,us[c++]=p,us[c++]=1-d)}return u}};function xne(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;Vwe(e,t,s,i,r,o),xne(e,t,n,i,s-1,1-o),xne(e,t,n,s+1,r,1-o)}function Vwe(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));Vwe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(d3(e,t,i,n),t[2*r+o]>s&&d3(e,t,i,r);a<c;){for(d3(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?d3(e,t,i,c):(c++,d3(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function d3(e,t,n,i){bne(e,n,i),bne(t,2*n,2*i),bne(t,2*n+1,2*i+1)}function bne(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function zwe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function Vm(e){e=e??H.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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=e.show??!0}function jwe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var iTt=new et;function Hwe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=qA.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Br.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Pa.getScreenSpaceBoundingBox(e,t,r)),jwe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Wwe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=qA.getScreenSpaceBoundingBox(s,t,iTt);jwe(a,n),r=et.union(r,a,r)}return r}function rTt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Wwe(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 Gwe(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function Wwe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Tne(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var oTt=new et,sTt=new et,aTt=new et;function cTt(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!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 h0({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new $f({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new Xw;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new Xh(y,A),x=[];e._clusterLabels&&Tne(i,x,n,b,e),e._clusterBillboards&&Tne(r,x,n,b,e),e._clusterPoints&&Tne(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,P;if(x.length>0){let M=new h3(x.length,64,Float64Array);for(let F=0;F<x.length;++F)M.add(x[F].coord.x,x[F].coord.y);if(M.finish(),m<g)for(v=d.length,T=0;T<v;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Br._computeScreenSpacePosition(N.IDENTITY,F.position,h.ZERO,U.ZERO,n);if(!l(V))continue;let B=1-m/g,j=F.width=F.width*B,k=F.height=F.height*B;j=Math.max(j,F.minimumWidth),k=Math.max(k,F.minimumHeight);let G=V.x-j*.5,q=V.y-k*.5,Q=V.x+j,W=V.y+k;for(I=M.range(G,q,Q,W),R=I.length,C=0,_=[],E=0;E<R;++E)O=I[E],L=x[O],L.clustered||(++C,w=L.collection,P=L.index,_.push(w.get(P).id));if(C>=f)for(Gwe(F.position,C,_,e),p.push(F),E=0;E<R;++E)x[I[E]].clustered=!0}for(v=x.length,T=0;T<v;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,w=F.collection,P=F.index;let V=w.get(P);S=Hwe(V,F.coord,u,e,oTt);let B=et.clone(S,sTt);I=M.range(S.x,S.y,S.x+S.width,S.y+S.height),R=I.length;let j=h.clone(V.position);for(C=1,_=[V.id],E=0;E<R;++E)if(O=I[E],L=x[O],!L.clustered){let k=L.collection.get(L.index),G=Hwe(k,L.coord,u,e,aTt);h.add(k.position,j,j),et.union(B,G,B),++C,_.push(k.id)}if(C>=f){let k=h.multiplyByScalar(j,1/C,j);for(Gwe(k,C,_,e),p.push({position:k,width:B.width,height:B.height,minimumWidth:S.width,minimumHeight:S.height}),E=0;E<R;++E)x[I[E]].clustered=!0}else rTt(V,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=m}}Vm.prototype._initialize=function(e){this._scene=e;let t=cTt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Vm.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 Cne(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function vne(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Vm.prototype.getLabel=Cne("_labelCollection",h0,"_unusedLabelIndices","labelIndex");Vm.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,vne(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};Vm.prototype.getBillboard=Cne("_billboardCollection",$f,"_unusedBillboardIndices","billboardIndex");Vm.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,vne(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};Vm.prototype.getPoint=Cne("_pointCollection",Xw,"_unusedPointIndices","pointIndex");Vm.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,vne(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Ene(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function lTt(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,Ene(e._labelCollection),Ene(e._billboardCollection),Ene(e._pointCollection))}Vm.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,lTt(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)};Vm.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 ed=Vm;function Sne(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 Ka(this),this._entityCluster=new ed}Object.defineProperties(Sne.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){Ms.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}}});Sne.prototype.update=function(e){return!0};var m3=Sne;var qwe=h.ZERO,Ywe=new h,uTt=new h,Xwe=new z;function fTt(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 td(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new fTt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(td.prototype=Object.create(Pi.prototype),td.prototype.constructor=td);Object.defineProperties(td.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});td.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ei.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Xwe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qwe,Ywe))),new Ft({id:t,geometry:new UM(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};td.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Xwe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qwe,Ywe))),new Ft({id:t,geometry:new zM(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};td.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};td.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Pi.prototype._isHidden.call(this,e,t)};td.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};td.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(nt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(nt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(nt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,nt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};td.prototype._onEntityPropertyChanged=t_;td.DynamicGeometryUpdater=Kw;function Kw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Kw.prototype=Object.create(Ii.prototype),Kw.prototype.constructor=Kw);Kw.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,uTt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ii.prototype._isHidden.call(this,e,t,n)};Kw.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?mn.ALL:void 0};var p3=td;var b3=Qo(Tf(),1);function vE(){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(vE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:iu("startTime"),stopTime:iu("stopTime"),currentTime:iu("currentTime"),clockRange:iu("clockRange"),clockStep:iu("clockStep"),multiplier:iu("multiplier")});vE.prototype.clone=function(e){return l(e)||(e=new vE),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};vE.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};vE.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};vE.prototype.getValue=function(e){return l(e)||(e=new im),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var jm=vE;var dTt=z.WHITE,hTt=.1,mTt=new U(8,8),pTt=new U(0,0),gTt=new U(1,1);function $w(e){e=e??H.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($w.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});$w.prototype.getType=function(e){return"Grid"};var _Tt=new K;$w.prototype.getValue=function(e,t){return l(e)||(e=K.now(_Tt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,dTt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,hTt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,mTt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,gTt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,pTt,t.lineOffset),t};$w.prototype.equals=function(e){return this===e||e instanceof $w&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var Jw=$w;var Kwe={WHOLE:0,PORTIONS:1};Object.freeze(Kwe);var _0=Kwe;function Zw(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Zw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});Zw.prototype.getType=function(e){return"PolylineArrow"};var yTt=new K;Zw.prototype.getValue=function(e,t){return l(e)||(e=K.now(yTt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Zw.prototype.equals=function(e){return this===e||e instanceof Zw&&X.equals(this._color,e._color)};var Qw=Zw;var ATt=z.WHITE,bTt=z.TRANSPARENT,xTt=16,TTt=255;function eI(e){e=e??H.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(eI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});eI.prototype.getType=function(e){return"PolylineDash"};var ETt=new K;eI.prototype.getValue=function(e,t){return l(e)||(e=K.now(ETt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ATt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,bTt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,xTt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,TTt,t.dashPattern),t};eI.prototype.equals=function(e){return this===e||e instanceof eI&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var tI=eI;var CTt=z.WHITE,vTt=.25,STt=1;function nI(e){e=e??H.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(nI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});nI.prototype.getType=function(e){return"PolylineGlow"};var wTt=new K;nI.prototype.getValue=function(e,t){return l(e)||(e=K.now(wTt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,CTt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,vTt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,STt,t.taperPower),t};nI.prototype.equals=function(e){return this===e||e instanceof nI&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var iI=nI;var ITt=z.WHITE,PTt=z.BLACK,DTt=1;function rI(e){e=e??H.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(rI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});rI.prototype.getType=function(e){return"PolylineOutline"};var RTt=new K;rI.prototype.getValue=function(e,t){return l(e)||(e=K.now(RTt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ITt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,PTt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,DTt),t};rI.prototype.equals=function(e){return this===e||e instanceof rI&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var ab=rI;function U_(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Go,this._referenceFrame=t??ji.FIXED,this.setValue(e)}Object.defineProperties(U_.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var OTt=new K;U_.prototype.getValue=function(e,t){return l(e)||(e=K.now(OTt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};U_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};U_.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 r=e[i];l(r)&&t.add(r.definitionChanged,U_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};U_.prototype.equals=function(e){return this===e||e instanceof U_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};U_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var z_=U_;function cb(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Go,this.setValue(e)}Object.defineProperties(cb.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var MTt=new K;cb.prototype.getValue=function(e,t){l(e)||(e=K.now(MTt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};cb.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 r=e[i];l(r)&&t.add(r.definitionChanged,cb.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};cb.prototype.equals=function(e){return this===e||e instanceof cb&&X.arrayEquals(this._value,e._value)};cb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var oI=cb;function SE(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(nd.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function nd(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(nd.prototype._onCollectionChanged,this)}Object.defineProperties(nd.prototype,{isConstant:{get:function(){return X.isConstant(SE(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=SE(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 SE(this)}}});nd.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new nd(e,n,i)};var NTt=new K;nd.prototype.getValue=function(e,t){let n=SE(this);return l(e)||(e=K.now(NTt)),l(n)?n.getValue(e,t):void 0};nd.prototype.getValueInReferenceFrame=function(e,t,n){let i=SE(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};nd.prototype.getType=function(e){let t=SE(this);return l(t)?t.getType(e):void 0};nd.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 r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};nd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};nd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(nd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=SE(this),l(i)&&this._definitionChanged.raiseEvent(this))};var V_=nd;var LTt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-D.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+D.TWO_PI:r}},hh=LTt;var $we={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function Jwe(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function Zwe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var wne=[],Ine=[];function c5(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=Zwe(i[o],e),c=vr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=Zwe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(wne[p++]=f,o=o+1,s=0;s<r;s++)Ine[g++]=i[o],o=o+1;a=f}p>0&&(Ine.length=g,Jwe(n,u,Ine),wne.length=p,Jwe(t,c,wne))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function mh(e,t){let n=e;n===Number&&(n=$we);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=$we);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=mA,this._lastInterpolationAlgorithm=mA,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=Kl.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Kl.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(mh.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 FTt=new K;mh.prototype.getValue=function(e,t){l(e)||(e=K.now(FTt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=vr(n,e,K.compare);var c=!1;if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Kl.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===Kl.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===Kl.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Kl.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===Kl.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===Kl.LINEAR_EXTRAPOLATE}let d=this._xTable,p=this._yTable;var u,f;c?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(u.getRequiredDataPoints(f,m),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,d.length=S,p.length=S*g)}let y=this._numberOfPoints-1;if(y<1)return;let A=0,b=i-1;if(b-A+1>=y+1){let S=a-(y/2|0)-1;S<A&&(S=A);let I=S+y;I>b&&(I=b,S=I-y,S<A&&(S=A)),A=S,b=I}let T=b-A+1;for(let S=0;S<T;++S)d[S]=K.secondsDifference(n[A+S],n[b]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,A,b,p);else{let S=0,I=this._packedLength,R=A*I,O=(b+1)*I;for(;R<O;)p[S]=s[R],R++,S++}let E=K.secondsDifference(e,n[b]),v;if(m===0||!l(u.interpolate))v=u.interpolateOrderZero(E,d,p,g,this._interpolationResult);else{let S=Math.floor(g/(m+1));v=u.interpolate(E,d,p,S,m,m,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(v,s,A,b,t):o.unpack(v,0,t)}return o.unpack(s,a*this._packedLength,t)};mh.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))};mh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}c5(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};mh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}c5(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};mh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};mh.prototype.addSamplesPackedArray=function(e,t){c5(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};mh.prototype.removeSample=function(e){let t=vr(this._times,e,K.compare);return t<0?!1:(Qwe(this,t,1),!0)};function Qwe(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)}mh.prototype.removeSamples=function(e){let t=this._times,n=vr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=vr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,Qwe(this,n,i-n)};mh.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,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!K.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};mh._mergeNewSamples=c5;var id=mh;function ph(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new id(h,n),this._definitionChanged=new be,this._referenceFrame=e??ji.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(ph.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 BTt=new K;ph.prototype.getValue=function(e,t){return l(e)||(e=K.now(BTt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};ph.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return hm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};ph.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};ph.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};ph.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};ph.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};ph.prototype.removeSample=function(e){return this._property.removeSample(e)};ph.prototype.removeSamples=function(e){this._property.removeSamples(e)};ph.prototype.equals=function(e){return this===e||e instanceof ph&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var yc=ph;var eIe={HORIZONTAL:0,VERTICAL:1};Object.freeze(eIe);var Hm=eIe;var kTt=Hm.HORIZONTAL,UTt=z.WHITE,zTt=z.BLACK,VTt=0,jTt=1;function sI(e){e=e??H.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(sI.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});sI.prototype.getType=function(e){return"Stripe"};var HTt=new K;sI.prototype.getValue=function(e,t){return l(e)||(e=K.now(HTt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,kTt)===Hm.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,UTt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,zTt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,VTt),t.repeat=X.getValueOrDefault(this._repeat,e,jTt),t};sI.prototype.equals=function(e){return this===e||e instanceof sI&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var aI=sI;function lb(e){this._definitionChanged=new be,this._intervals=new vs,this._intervals.changedEvent.addEventListener(lb.prototype._intervalsChanged,this),this._referenceFrame=e??ji.FIXED}Object.defineProperties(lb.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 GTt=new K;lb.prototype.getValue=function(e,t){return l(e)||(e=K.now(GTt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};lb.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return hm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};lb.prototype.equals=function(e){return this===e||e instanceof lb&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};lb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var j_=lb;function wE(){this._definitionChanged=new be,this._intervals=new vs,this._intervals.changedEvent.addEventListener(wE.prototype._intervalsChanged,this)}Object.defineProperties(wE.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var WTt=new K;wE.prototype.getValue=function(e,t){l(e)||(e=K.now(WTt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};wE.prototype.equals=function(e){return this===e||e instanceof wE&&this._intervals.equals(e._intervals,X.equals)};wE.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var H_=wE;function cI(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(cI.prototype,{isConstant:{get:function(){return X.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 qTt=new h,tIe=new h,nIe=new K,YTt=new K,Pne=1/60;cI.prototype.getValue=function(e,t){return this._getValue(e,t)};cI.prototype._getValue=function(e,t,n){l(e)||(e=K.now(YTt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,qTt),o=i.getValue(K.addSeconds(e,Pne,nIe),tIe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-Pne,nIe),tIe),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,Pne,t)};cI.prototype.equals=function(e){return this===e||e instanceof cI&&X.equals(this._position,e._position)};var G_=cI;function g3(e,t){this._velocityVectorProperty=new G_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ee.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(g3.prototype,{isConstant:{get:function(){return X.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 iIe=new h,XTt=new h,rIe=new $,KTt=new K;g3.prototype.getValue=function(e,t){l(e)||(e=K.now(KTt));let n=this._velocityVectorProperty._getValue(e,XTt,iIe);if(l(n))return At.rotationMatrixFromPositionVelocity(iIe,n,this._ellipsoid,rIe),Le.fromRotationMatrix(rIe,t)};g3.prototype.equals=function(e){return this===e||e instanceof g3&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var _3=g3;var W_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};W_.validate=function(e){return e===W_.COMPLETE||e===W_.BELOW_ELLIPSOID_HORIZON||e===W_.ABOVE_ELLIPSOID_HORIZON};W_.toString=function(e){switch(e){case W_.COMPLETE:return"COMPLETE";case W_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case W_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var lI=W_;function ub(){}ub.packedLength=h.packedLength;ub.unpack=h.unpack;ub.pack=h.pack;var Dne;function y3(e,t){return t[0]==="#"&&(t=Dne+t),V_.fromString(e,t)}function oIe(e,t,n){if(l(n.reference))return y3(t,n.reference);if(l(n.velocityReference)){let i=y3(t,n.velocityReference);switch(e){case h:case ub:return new G_(i,e===ub);case Le:return new _3(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function $Tt(e,t){return new _m(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var pr=new h,hu=new RN,Tl=new he,IE=new Cn,l5=new Le;function JTt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function sIe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function ZTt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ie.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=D.toRadians(n[r+1]),t[r+2]=D.toRadians(n[r+2]),t[r+3]=D.toRadians(n[r+3]),t[r+4]=D.toRadians(n[r+4]);return t}function QTt(e){let t=e.length;if(hu.magnitude=1,t===2)return hu.clock=e[0],hu.cone=e[1],h.fromSpherical(hu,pr),[pr.x,pr.y,pr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],hu.clock=e[i+1],hu.cone=e[i+2],h.fromSpherical(hu,pr),n[r+1]=pr.x,n[r+2]=pr.y,n[r+3]=pr.z;return n}function eEt(e){let t=e.length;if(t===3)return hu.clock=e[0],hu.cone=e[1],hu.magnitude=e[2],h.fromSpherical(hu,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],hu.clock=e[i+1],hu.cone=e[i+2],hu.magnitude=e[i+3],h.fromSpherical(hu,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function tEt(e){let t=e.length;if(t===3)return Tl.longitude=e[0],Tl.latitude=e[1],Tl.height=e[2],ee.default.cartographicToCartesian(Tl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Tl.longitude=e[i+1],Tl.latitude=e[i+2],Tl.height=e[i+3],ee.default.cartographicToCartesian(Tl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function nEt(e){let t=e.length;if(t===3)return Tl.longitude=D.toRadians(e[0]),Tl.latitude=D.toRadians(e[1]),Tl.height=e[2],ee.default.cartographicToCartesian(Tl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Tl.longitude=D.toRadians(e[i+1]),Tl.latitude=D.toRadians(e[i+2]),Tl.height=e[i+3],ee.default.cartographicToCartesian(Tl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function Rne(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 r=e.unitSpherical;if(l(r))return QTt(r);let o=e.spherical;if(l(o))return eEt(o);let s=e.cartographicRadians;if(l(s))return tEt(s);let a=e.cartographicDegrees;if(l(a))return nEt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function aIe(e,t){h.unpack(e,t,pr),h.normalize(pr,pr),h.pack(pr,e,t)}function iEt(e){let t=Rne(e);if(t.length===3)return aIe(t,0),t;for(let n=1;n<t.length;n+=4)aIe(t,n);return t}function cIe(e,t){Le.unpack(e,t,l5),Le.normalize(l5,l5),Le.pack(l5,e,t)}function rEt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return cIe(t,0),t;for(let n=1;n<t.length;n+=5)cIe(t,n)}return t}function lIe(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")?et:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?ub:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?ti:e.hasOwnProperty("colorBlendMode")?gl:e.hasOwnProperty("cornerType")?nr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?Hi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?xo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?Ht:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?_0:e.hasOwnProperty("shadowMode")?Dn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Hm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?b3.default:e.hasOwnProperty("verticalOrigin")?Gn:Object}function oEt(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case U:return t.cartesian2;case h:return Rne(t);case ub:return iEt(t);case z:return JTt(t);case ti:return ti[t.classificationType??t];case gl:return gl[t.colorBlendMode??t];case nr:return nr[t.cornerType??t];case We:return We[t.heightReference??t];case Hi:return Hi[t.horizontalOrigin??t];case Image:return sIe(t,n);case K:return K.fromIso8601(t.date??t);case xo:return xo[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case Ht:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case _0:return _0[t.pathMode??t];case Le:return rEt(t);case hh:return t.number??t;case lI:return lI[t.portionToDisplay??t];case Dn:return Dn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Hm:return Hm[t.stripeOrientation??t];case ie:return ZTt(t);case b3.default:return sIe(t,n);case Gn:return Gn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var sEt={HERMITE:eN,LAGRANGE:sN,LINEAR:mA};function u5(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:sEt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Kl[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Kl[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var uIe={iso8601:void 0};function $o(e){if(l(e))return uIe.iso8601=e,Cn.fromIso8601(uIe)}function One(e){let t=nt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function fIe(e){let t=new bl;return t.intervals.addInterval(One(e)),t}function dIe(e){let t=new _c(e.referenceFrame);return t.intervals.addInterval(One(e)),t}function f5(e,t,n,i,r,o,s){let a=$o(i.interval);l(r)&&(l(a)?a=Cn.intersect(a,r,IE):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(nt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return EIe(t[n],a)}let g=!1;if(d){if(u=oEt(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==hh;if(!g&&!p){d?t[n]=new _i(m?e.unpack(u,0):u):t[n]=oIe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof id||(t[n]=y=new id(e)),y.addSamplesPackedArray(u,A),u5(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=oIe(e,s,i),l(y)||(t[n]=y=d?new H_:new bl),d&&y instanceof H_?y.intervals.addInterval(a):y instanceof bl?(d&&(a.data=new _i(a.data)),y.intervals.addInterval(a)):(t[n]=y=fIe(y),d&&(a.data=new _i(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new bl),y instanceof bl||(t[n]=y=fIe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof id))&&(x=a.clone(),x.data=new id(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),u5(i,x.data)}function EIe(e,t){if(e instanceof id){e.removeSamples(t);return}else if(e instanceof H_){e.intervals.removeInterval(t);return}else if(e instanceof bl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,IE);r.isEmpty||EIe(r.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)f5(e,t,n,i[a],r,o,s);else f5(e,t,n,i,r,o,s)}function hIe(e,t,n,i,r,o){let s=$o(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,IE):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(nt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return CIe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=ji[n.referenceFrame]),g=g??ji.FIXED,u=Rne(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new nu(h.unpack(u),g):e[t]=y3(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof yc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new yc(g,a)),y.addSamplesPackedArray(u,A),u5(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=y3(o,n.reference),l(y)||(d?y=new j_(g):y=new _c(g),e[t]=y),d&&y instanceof j_&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof _c?(d&&(s.data=new nu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=dIe(y),d&&(s.data=new nu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof _c||(e[t]=y=dIe(y)):e[t]=y=new _c(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof yc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new yc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),u5(n,x.data)}function CIe(e,t){if(e instanceof yc){e.removeSamples(t);return}else if(e instanceof j_){e.intervals.removeInterval(t);return}else if(e instanceof _c){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,IE);r.isEmpty||CIe(r.data,t)}n.removeInterval(t);return}}function vIe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)hIe(e,t,n[s],i,r,o);else hIe(e,t,n,i,r,o)}function mIe(e,t,n,i){l(n.references)?d5(e,t,n.references,n.interval,i,oI,bl):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function pIe(e,t,n,i,r,o){let s=$o(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,IE):s=i);let a=e[t],c,u;if(l(s)){a instanceof qw||(a=new qw,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof Jw||(c=new Jw),f=n.grid,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Ee(U,c,"lineCount",f.lineCount,void 0,r,o),Ee(U,c,"lineThickness",f.lineThickness,void 0,r,o),Ee(U,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof DA||(c=new DA),f=n.image,Ee(Image,c,"image",f.image,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o),Ee(z,c,"color",f.color,void 0,r,o),Ee(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof aI||(c=new aI),f=n.stripe,Ee(Hm,c,"orientation",f.orientation,void 0,r,o),Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(Number,c,"offset",f.offset,void 0,r,o),Ee(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof ab||(c=new ab),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,r,o),Ee(z,c,"outlineColor",f.outlineColor,void 0,r,o),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof iI||(c=new iI),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"glowPower",f.glowPower,void 0,r,o),Ee(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof Qw||(c=new Qw),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof tI||(c=new tI),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,o),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,o),Ee(Number,c,"dashLength",f.dashLength,void 0,r,o),Ee(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof Gw||(c=new Gw),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function rd(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)pIe(e,t,n[s],i,r,o);else pIe(e,t,n,i,r,o)}function aEt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function cEt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function lEt(e,t,n,i){let r=t.position;l(r)&&vIe(e,"position",r,void 0,i,n)}function uEt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function fEt(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function dEt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new ru);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)f5(lIe(s[a]),e.properties,o,s[a],void 0,i,n);else f5(lIe(s),e.properties,o,s,void 0,i,n)}}}function d5(e,t,n,i,r,o,s){let a=n.map(function(c){return y3(r,c)});if(l(i)){i=$o(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(One(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function gIe(e,t,n,i){let r=n.references;l(r)?d5(e,t,r,n.interval,i,oI,bl):Ee(Array,e,t,n,void 0,void 0,i)}function _Ie(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)gIe(e,t,n[r],i);else gIe(e,t,n,i)}function yIe(e,t,n,i){let r=n.references;l(r)?d5(e,t,r,n.interval,i,z_,_c):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function x3(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)yIe(e,t,n[r],i);else yIe(e,t,n,i)}function hEt(e){return h.unpackArray(e)}function mEt(e){return h.fromRadiansArrayHeights(e,ee.default)}function pEt(e){return h.fromDegreesArrayHeights(e,ee.default)}function AIe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return d5(a,"positions",s,n.interval,i,z_,_c),a.positions});e[t]=new z_(o)}else l(n.cartesian)?n.array=n.cartesian.map(hEt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(mEt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(pEt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function gEt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)AIe(e,t,n[r],i);else AIe(e,t,n,i)}function _Et(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)mIe(e,t,n[r],i);else mIe(e,t,n,i)}function yEt(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new vs),o.addInterval($o(r[s]));else o=new vs,o.addInterval($o(r));e.availability=o}function AEt(e,t,n,i,r){l(t)&&Ee(ub,e,"alignedAxis",t,n,i,r)}function bEt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=$o(r.interval),s=e.billboard;l(s)||(e.billboard=s=new fl),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Image,s,"image",r.image,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Hi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Gn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(hh,s,"rotation",r.rotation,o,i,n),AEt(s,r.alignedAxis,o,i,n),Ee(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(et,s,"imageSubRegion",r.imageSubRegion,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function xEt(e,t,n,i){let r=t.box;if(!l(r))return;let o=$o(r.interval),s=e.box;l(s)||(e.box=s=new vT),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"dimensions",r.dimensions,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function TEt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=$o(r.interval),s=e.corridor;l(s)||(e.corridor=s=new wT),Ee(Boolean,s,"show",r.show,o,i,n),x3(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(nr,s,"cornerType",r.cornerType,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function EEt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=$o(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new IT),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"length",r.length,o,i,n),Ee(Number,s,"topRadius",r.topRadius,o,i,n),Ee(Number,s,"bottomRadius",r.bottomRadius,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Number,s,"slices",r.slices,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function CEt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("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 r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function vEt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=$o(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new PT),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),Ee(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(hh,s,"rotation",r.rotation,o,i,n),Ee(hh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function SEt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=$o(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new DT),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"radii",r.radii,o,i,n),Ee(h,s,"innerRadii",r.innerRadii,o,i,n),Ee(Number,s,"minimumClock",r.minimumClock,o,i,n),Ee(Number,s,"maximumClock",r.maximumClock,o,i,n),Ee(Number,s,"minimumCone",r.minimumCone,o,i,n),Ee(Number,s,"maximumCone",r.maximumCone,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"stackPartitions",r.stackPartitions,o,i,n),Ee(Number,s,"slicePartitions",r.slicePartitions,o,i,n),Ee(Number,s,"subdivisions",r.subdivisions,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function wEt(e,t,n,i){let r=t.label;if(!l(r))return;let o=$o(r.interval),s=e.label;l(s)||(e.label=s=new mm),Ee(Boolean,s,"show",r.show,o,i,n),Ee(String,s,"text",r.text,o,i,n),Ee(String,s,"font",r.font,o,i,n),Ee(xo,s,"style",r.style,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Boolean,s,"showBackground",r.showBackground,o,i,n),Ee(z,s,"backgroundColor",r.backgroundColor,o,i,n),Ee(U,s,"backgroundPadding",r.backgroundPadding,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Hi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Gn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"fillColor",r.fillColor,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function IEt(e,t,n,i){let r=t.model;if(!l(r))return;let o=$o(r.interval),s=e.model;l(s)||(e.model=s=new Zg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(b3.default,s,"uri",r.gltf,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),Ee(Number,s,"maximumScale",r.maximumScale,o,i,n),Ee(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Ee(Boolean,s,"runAnimations",r.runAnimations,o,i,n),Ee(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),Ee(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(gl,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)bIe(s,u[a],o,i,n);else bIe(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)xIe(s,f[a],o,i,n);else xIe(s,f,o,i,n)}function bIe(e,t,n,i,r){let o=$o(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,IE):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new ru),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new RT),Ee(h,p,"translation",d.translation,o,i,r),Ee(Le,p,"rotation",d.rotation,o,i,r),Ee(h,p,"scale",d.scale,o,i,r)}}function xIe(e,t,n,i,r){let o=$o(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,IE):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new ru),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function PEt(e,t,n,i){let r=t.path;if(!l(r))return;let o=$o(r.interval),s=e.path;l(s)||(e.path=s=new Qg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"leadTime",r.leadTime,o,i,n),Ee(Number,s,"trailTime",r.trailTime,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"resolution",r.resolution,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(_0,s,"materialMode",r.materialMode,o,i,n)}function DEt(e,t,n,i){let r=t.point;if(!l(r))return;let o=$o(r.interval),s=e.point;l(s)||(e.point=s=new MT),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"pixelSize",r.pixelSize,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function A3(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(A3.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}}});A3.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(r){return new Lc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Lc(n,i)};A3.prototype.equals=function(e){return this===e||e instanceof A3&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function REt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=$o(r.interval),s=e.polygon;l(s)||(e.polygon=s=new pm),Ee(Boolean,s,"show",r.show,o,i,n),x3(s,"_positions",r.positions,n),gEt(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new A3(s)),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(hh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),Ee(Boolean,s,"closeTop",r.closeTop,o,i,n),Ee(Boolean,s,"closeBottom",r.closeBottom,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function OEt(e){return e?ln.GEODESIC:ln.NONE}function MEt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=$o(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new dl),Ee(Boolean,s,"show",r.show,o,i,n),x3(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),rd(s,"material",r.material,o,i,n),rd(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};Ee(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=$Tt(a.followSurface,OEt)}}function NEt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=$o(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new NT),x3(s,"positions",r.positions,n),_Et(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(nr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function LEt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=$o(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new gm),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ie,s,"coordinates",r.coordinates,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(hh,s,"rotation",r.rotation,o,i,n),Ee(hh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function FEt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=$o(r.interval),s=e.tileset;l(s)||(e.tileset=s=new OT),Ee(Boolean,s,"show",r.show,o,i,n),Ee(b3.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function BEt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=$o(r.interval),s=e.wall;l(s)||(e.wall=s=new e_),Ee(Boolean,s,"show",r.show,o,i,n),x3(s,"positions",r.positions,n),_Ie(s,"minimumHeights",r.minimumHeights,n),_Ie(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),rd(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function TIe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),Dne=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")CEt(e,r);else{let s=t.getOrCreateEntity(o),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)}Dne=void 0}function kEt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(nt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new jm,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=As.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new jm,t.startTime=nt.MINIMUM_VALUE.clone(),t.stopTime=nt.MAXIMUM_VALUE.clone(),t.currentTime=nt.MINIMUM_VALUE.clone(),t.clockRange=As.LOOP_STOP,t.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=$o(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=As[n.range]??As.LOOP_STOP),l(n.step)&&(t.clockStep=zr[n.step]??zr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function SIe(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),Ms.setLoading(e,!0),Promise.resolve(r).then(function(a){return UEt(e,a,o,i)}).catch(function(a){return Ms.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function UEt(e,t,n,i){Ms.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new wIe,r.removeAll()),la._processCzml(t,r,n,void 0,e);let o=kEt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=Fg(n.getUrlComponent()),o=!0),Ms.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function wIe(){this.name=void 0,this.clock=void 0}function la(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 wIe,this._version=void 0,this._entityCollection=new Ka(this),this._entityCluster=new ed,this._credit=void 0,this._resourceCredits=[]}la.load=function(e,t){return new la().load(e,t)};Object.defineProperties(la.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}}});la.updaters=[bEt,xEt,TEt,EEt,vEt,SEt,wEt,IEt,aEt,cEt,PEt,DEt,REt,MEt,NEt,dEt,LEt,lEt,FEt,uEt,BEt,fEt,yEt];la.registerUpdater=function(e){la.updaters.includes(e)||la.updaters.push(e)};la.unregisterUpdater=function(e){if(la.updaters.includes(e)){let t=la.updaters.indexOf(e);la.updaters.splice(t,1)}};la.prototype.process=function(e,t){return SIe(this,e,t,!1)};la.prototype.load=function(e,t){return SIe(this,e,t,!0)};la.prototype.update=function(e){return!0};la.processPacketData=Ee;la.processPositionPacketData=vIe;la.processMaterialPacketData=rd;la._processCzml=function(e,t,n,i,r){if(i=i??la.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)TIe(e[o],t,i,n,r);else TIe(e,t,i,n,r)};var T3=la;function mu(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(mu.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}}});mu.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})};mu.prototype.remove=function(e,t){t=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};mu.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};mu.prototype.contains=function(e){return this.indexOf(e)!==-1};mu.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};mu.prototype.get=function(e){return this._dataSources[e]};mu.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function h5(e,t){return e.indexOf(t)}function IIe(e,t,n){let i=e._dataSources,r=i.length-1;if(t=D.clamp(t,0,r),n=D.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}mu.prototype.raise=function(e){let t=h5(this._dataSources,e);IIe(this,t,t+1)};mu.prototype.lower=function(e){let t=h5(this._dataSources,e);IIe(this,t,t-1)};mu.prototype.raiseToTop=function(e){let t=h5(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))};mu.prototype.lowerToBottom=function(e){let t=h5(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var E3=mu;function Ac(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(Ac.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Ac.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};Ac.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._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};Ac.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Ac.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};Ac.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function m5(e,t){return e._primitives.indexOf(t)}Ac.prototype.raise=function(e){if(l(e)){let t=m5(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Ac.prototype.raiseToTop=function(e){if(l(e)){let t=m5(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Ac.prototype.lower=function(e){if(l(e)){let t=m5(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Ac.prototype.lowerToBottom=function(e){if(l(e)){let t=m5(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Ac.prototype.get=function(e){return this._primitives[e]};Ac.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Ac.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)}};Ac.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};Ac.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)}};Ac.prototype.isDestroyed=function(){return!1};Ac.prototype.destroy=function(){return this.removeAll(),ue(this)};var El=Ac;function y0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(y0.prototype,{length:{get:function(){return this._length}}});y0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new El({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};y0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};y0.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};y0.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};y0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};y0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};y0.prototype.isDestroyed=function(){return!1};y0.prototype.destroy=function(){return this.removeAll(),ue(this)};var C3=y0;function uI(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ut}uI.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};uI.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};uI.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};uI.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};uI.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var PE=uI;var PIe=new z,DIe=h.ZERO,RIe=new h,OIe=new ie;function zEt(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 Gm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new zEt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Gm.prototype=Object.create(ii.prototype),Gm.prototype.constructor=Gm);Gm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,PIe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,DIe,RIe))),new Ft({id:t,geometry:new ql(this._options),attributes:i})};Gm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,PIe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,DIe,RIe))),new Ft({id:t,geometry:new Rf(this._options),attributes:o})};Gm.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Gm.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Pi.prototype._isHidden.call(this,e,t)};Gm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Gm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(nt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(nt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(nt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),s.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Mi.getMinimumMaximumHeights(ql.computeRectangle(s,OIe)).minimumTerrainHeight),s.extrudedHeight=r};Gm.DynamicGeometryUpdater=fI;function fI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(fI.prototype=Object.create(Ii.prototype),fI.prototype.constructor=fI);fI.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ii.prototype._isHidden.call(this,e,t,n)};fI.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(ql.computeRectangle(i,OIe)).minimumTerrainHeight),i.extrudedHeight=s};var v3=Gm;var VEt=new Kt(z.WHITE),Mne=h.ZERO,Nne=new h,jEt=new h,HEt=new h,Lne=new z,GEt=new h(1,1,1);function WEt(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 od(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new WEt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(od.prototype=Object.create(Pi.prototype),od.prototype.constructor=od);Object.defineProperties(od.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});od.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ei.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,Lne)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Mne,Nne))),new Ft({id:i,geometry:new Ua(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};od.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Lne),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:ei.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Mne,Nne))),new Ft({id:i,geometry:new Nf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};od.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};od.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Pi.prototype._isHidden.call(this,e,t)};od.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};od.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(nt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,nt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,nt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,nt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,nt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,nt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,nt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};od.prototype._onEntityPropertyChanged=t_;od.DynamicGeometryUpdater=S3;function S3(e,t,n){Ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new N,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 h,this._material={}}l(Object.create)&&(S3.prototype=Object.create(Ii.prototype),S3.prototype.constructor=S3);S3.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,jEt),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,Lne),c=Ao.getValue(e,n.material??VEt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,HEt),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,We.NONE),T=x!==We.NONE?mn.ALL:void 0,E=this._scene.mode,v=E===re.SCENE3D&&x===We.NONE,S=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,Mne,Nne);if(!v||this._lastSceneMode!==E||!l(this._primitive)||S.stackPartitions!==m||S.slicePartitions!==y||l(u)&&!h.equals(S.innerRadii!==u)||S.minimumClock!==f||S.maximumClock!==d||S.minimumCone!==p||S.maximumCone!==g||S.subdivisions!==A||this._lastOutlineWidth!==b||S.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,S.stackPartitions=m,S.slicePartitions=y,S.subdivisions=A,S.offsetAttribute=T,S.radii=h.clone(v?GEt:i,S.radii),l(u)?v?S.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,S.innerRadii):S.innerRadii=h.clone(u,S.innerRadii):S.innerRadii=void 0,S.minimumClock=f,S.maximumClock=d,S.minimumCone=p,S.maximumCone=g;let w=new Er({material:c,translucent:c.isTranslucent(),closed:!0});S.vertexFormat=w.vertexFormat;let P=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=C.add(new Mn({geometryInstances:P,appearance:w,asynchronous:!1,shadows:I}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new Mn({geometryInstances:M,appearance:new yn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,w=this._outlinePrimitive;C.show=!0,w.show=!0,C.appearance.material=c;let P=this._attributes;l(P)||(P=C.getGeometryInstanceAttributes(t),this._attributes=P),o!==this._lastShow&&(P.show=Pn.toValue(o,P.show),this._lastShow=o);let M=this._outlineAttributes;l(M)||(M=w.getGeometryInstanceAttributes(t),this._outlineAttributes=M),s!==this._lastOutlineShow&&(M.show=Pn.toValue(s,M.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(M.color=Jt.toValue(a,M.color),z.clone(a,this._lastOutlineColor)),Ht.equals(O,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=ei.toValue(O,P.distanceDisplayCondition),M.distanceDisplayCondition=ei.toValue(O,M.distanceDisplayCondition),Ht.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(P.offset=Tr.toValue(L,P.offset),M.offset=Tr.toValue(L,P.offset),h.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=N.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var w3=od;var qEt=new h,MIe=new z;function YEt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function gh(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new YEt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(gh.prototype=Object.create(Pi.prototype),gh.prototype.constructor=gh);gh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ei.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,MIe)),l(g)||(g=z.WHITE),r=Jt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=Fne(d,p,f,f),new Ft({id:t,geometry:new fN(this._options),modelMatrix:f,attributes:i})};gh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,MIe),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,s.plane),u=X.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=Fne(c,u,a,a),new Ft({id:t,geometry:new dN,modelMatrix:a,attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r)}})};gh.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};gh.prototype._getIsClosed=function(e){return!1};gh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};gh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(nt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions)};gh.DynamicGeometryUpdater=dI;function dI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(dI.prototype=Object.create(Ii.prototype),dI.prototype.constructor=dI);dI.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,qEt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ii.prototype._isHidden.call(this,e,t,n)};dI.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var XEt=new h,KEt=new h,$Et=new h,JEt=new h,ZEt=new $,QEt=new $,eCt=new N;function Fne(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,$Et),a=h.clone(h.UNIT_Z,KEt);D.equalsEpsilon(Math.abs(h.dot(a,r)),1,D.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,XEt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=ZEt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,JEt),d=$.multiplyByScale(u,f,QEt),p=N.fromRotationTranslation(d,s,eCt);return N.multiplyTransformation(n,p,i)}gh.createPrimitiveMatrix=Fne;var I3=gh;var NIe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",LIe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",FIe=new z,BIe=h.ZERO,kIe=new h,UIe=new ie,tCt=[],nCt=new U;function iCt(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 sd(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new iCt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(sd.prototype=Object.create(ii.prototype),sd.prototype.constructor=sd);sd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,FIe)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,BIe,kIe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new PM(i):o=new r0(i),new Ft({id:t,geometry:o,attributes:r})};sd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,FIe),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:ei.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,BIe,kIe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Ud(i):a=new hN(i),new Ft({id:t,geometry:a,attributes:s})};sd.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=Vs.fromPoints(i,r),s=o.projectPointsOntoPlane(i,tCt),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,A=U.add(g,m,nCt);A=U.multiplyByScalar(A,y,A),f=U.add(f,A,f),c+=y}let d=1/(c*3);return f=U.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};sd.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Pi.prototype._isHidden.call(this,e,t)};sd.prototype._isOnTerrain=function(e,t){let n=ii.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(nt.MINIMUM_VALUE):!0);return n&&!r};sd.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};sd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(nt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,nt.MINIMUM_VALUE,!1);o=ii.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,_t(NIe)),s!==We.NONE&&u&&(o=void 0,_t(LIe))):(l(a)&&!l(o)&&(o=0),f=ii.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,nt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,nt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,nt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,nt.MINIMUM_VALUE),a=ii.getGeometryExtrudedHeight(a,c),a===ii.CLAMP_TO_GROUND){let d=r0.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,UIe);a=Mi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};sd.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)};sd.DynamicGeometryUpdater=hI;function hI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(hI.prototype=Object.create(Ii.prototype),hI.prototype.constructor=hI);hI.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ii.prototype._isHidden.call(this,e,t,n)};hI.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=ii.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,_t(NIe)),o!==We.NONE&&c&&(r=void 0,_t(LIe))):(l(a)&&!l(r)&&(r=0),u=ii.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND){let f=r0.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,UIe);a=Mi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var P3=sd;var zIe=new z;function rCt(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 A0(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new rCt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(A0.prototype=Object.create(Pi.prototype),A0.prototype.constructor=A0);A0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ei.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,zIe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ft({id:t,geometry:new _N(this._options),attributes:i})};A0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,zIe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new bN(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r)}})};A0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Pi.prototype._isHidden.call(this,e,t)};A0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};A0.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Kt;r.vertexFormat=o?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(nt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(nt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(nt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(nt.MINIMUM_VALUE):void 0};A0.DynamicGeometryUpdater=mI;function mI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(mI.prototype=Object.create(Ii.prototype),mI.prototype.constructor=mI);mI.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ii.prototype._isHidden.call(this,e,t,n)};mI.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var D3=A0;var VIe=new z,jIe=h.ZERO,HIe=new h,GIe=new ie,oCt=new ie,sCt=new he;function aCt(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 Wm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new aCt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Wm.prototype=Object.create(ii.prototype),Wm.prototype.constructor=Wm);Wm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,VIe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,jIe,HIe))),new Ft({id:t,geometry:new rT(this._options),attributes:i})};Wm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,VIe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,jIe,HIe))),new Ft({id:t,geometry:new oT(this._options),attributes:o})};Wm.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,oCt);if(!l(n))return;let i=ie.center(n,sCt);return he.toCartesian(i,ee.default,t)};Wm.prototype._isHidden=function(e,t){return!l(t.coordinates)||Pi.prototype._isHidden.call(this,e,t)};Wm.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Wm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(nt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),a.offsetAttribute=ii.computeGeometryOffsetAttribute(i,r,o,s),a.height=ii.getGeometryHeight(i,r),o=ii.getGeometryExtrudedHeight(o,s),o===ii.CLAMP_TO_GROUND&&(o=Mi.getMinimumMaximumHeights(rT.computeRectangle(a,GIe)).minimumTerrainHeight),a.extrudedHeight=o};Wm.DynamicGeometryUpdater=pI;function pI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(pI.prototype=Object.create(Ii.prototype),pI.prototype.constructor=pI);pI.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ii.prototype._isHidden.call(this,e,t,n)};pI.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(rT.computeRectangle(i,GIe)).minimumTerrainHeight),i.extrudedHeight=s};var R3=Wm;var WIe=new z;function cCt(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 qm(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new cCt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(qm.prototype=Object.create(Pi.prototype),qm.prototype.constructor=qm);qm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ei.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,WIe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ft({id:t,geometry:new $N(this._options),attributes:i})};qm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,WIe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new ZN(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r)}})};qm.prototype._isHidden=function(e,t){return!l(t.positions)||Pi.prototype._isHidden.call(this,e,t)};qm.prototype._getIsClosed=function(e){return!1};qm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};qm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=o?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(nt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(nt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(nt.MINIMUM_VALUE):void 0};qm.DynamicGeometryUpdater=gI;function gI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(gI.prototype=Object.create(Ii.prototype),gI.prototype.constructor=gI);gI.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ii.prototype._isHidden.call(this,e,t,n)};gI.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var O3=qm;var DE=[oF,p3,l3,v3,w3,I3,P3,D3,R3,O3];function RE(e,t){this.entity=e,this.scene=t;let n=new Array(DE.length),i=new be,r=new Go;for(let o=0;o<n.length;o++){let s=new DE[o](e,t);r.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[o]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(RE.prototype._onEntityPropertyChanged,this)}RE.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};RE.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};RE.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};RE.registerUpdater=function(e){DE.includes(e)||DE.push(e)};RE.unregisterUpdater=function(e){if(DE.includes(e)){let t=DE.indexOf(e);DE.splice(t,1)}};var OE=RE;var qIe=new z,lCt=new Ht,uCt=new Ht,fCt=h.ZERO,dCt=new h;function Ym(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Ym.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Ym.prototype.onMaterialChanged=function(){this.invalidated=!0};Ym.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Ym.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Ym.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};Ym.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Ao.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Mn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.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)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Ao.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,qIe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,qIe);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,uCt,lCt);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,fCt,dCt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Ym.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Ym.prototype.contains=function(e){return this.updaters.contains(e.id)};Ym.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Ym.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 _I(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}_I.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Ym(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function YIe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}_I.prototype.remove=function(e){YIe(this._solidItems,e)||YIe(this._translucentItems,e)};function XIe(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function p5(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}_I.prototype.update=function(e){let t=p5(this,this._solidItems,e,!0);t=p5(this,this._translucentItems,e,t)&&t;let n=XIe(this,this._solidItems,e),i=XIe(this,this._translucentItems,e);return(n||i)&&(t=p5(this,this._solidItems,e,t)&&t,t=p5(this,this._translucentItems,e,t)&&t),t};function KIe(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return Pt.FAILED}_I.prototype.getBoundingSphere=function(e,t){let n=KIe(this._solidItems,e,t);return n===Pt.FAILED?KIe(this._translucentItems,e,t):n};function $Ie(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}_I.prototype.removeAllPrimitives=function(){$Ie(this._solidItems),$Ie(this._translucentItems)};var _h=_I;var hCt=new Ht,mCt=new Ht,pCt=h.ZERO,gCt=new h;function Xm(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Xm.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut}Xm.prototype.onMaterialChanged=function(){this.invalidated=!0};Xm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};Xm.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||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Xm.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 _Ct=new z;Xm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Ao.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=Ao.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;a=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Mn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({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=Ao.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Ao.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,_Ct);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,mCt,hCt);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,pCt,gCt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Xm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Xm.prototype.contains=function(e){return this.updaters.contains(e.id)};Xm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Xm.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 yI(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}yI.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new Xm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};yI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};yI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};yI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};yI.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 yh=yI;var yCt=new z,ACt=new Ht,bCt=new Ht;function q_(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 Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new iT}q_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};q_.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||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};q_.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};q_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new tu({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.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)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,yCt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,bCt,ACt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};q_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};q_.prototype.contains=function(e){return this.updaters.contains(e.id)};q_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};q_.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 AI(e,t){this._batches=[],this._primitives=e,this._classificationType=t}AI.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new q_(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};AI.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};AI.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};AI.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};AI.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var bI=AI;var xCt=new Ht,TCt=new Ht;function b0(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new iT}b0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};b0.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};b0.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};b0.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};b0.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Ao.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new tu({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new a({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=Ao.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,TCt,xCt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};b0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};b0.prototype.contains=function(e){return this.updaters.contains(e.id)};b0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};b0.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function xI(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}xI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Uf.shouldUseSphericalCoordinates(r.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new b0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};xI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};xI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};xI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};xI.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 M3=xI;var ECt=new z,CCt=new Ht,vCt=new Ht,SCt=h.ZERO,wCt=new h;function Y_(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 Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.itemsToRemove=[],this.subscriptions=new Ut,this.showsUpdated=new Ut}Y_.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Y_.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};Y_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Mn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new yn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.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)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,z.WHITE,ECt);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,vCt,CCt);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,SCt,wCt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Y_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Y_.prototype.contains=function(e){return this.updaters.contains(e.id)};Y_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Y_.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 TI(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ut,this._translucentBatches=new Ut}TI.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new Y_(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new Y_(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};TI.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 r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};TI.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};TI.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Pt.FAILED};TI.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,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var EI=TI;var ICt=[];function nf(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ut,this._removedObjects=new Ut,this._changedObjects=new Ut;let r=Dn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Qr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new EI(n,e,s,!1),this._outlineBatches[r+s]=new EI(n,e,s,!0),this._closedColorBatches[s]=new _h(n,yn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new _h(n,yn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new yh(n,Er,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new yh(n,Er,void 0,!0,s,!1),this._openColorBatches[s]=new _h(n,yn,void 0,!1,s,!0),this._openColorBatches[r+s]=new _h(n,yn,void 0,!1,s,!1),this._openMaterialBatches[s]=new yh(n,Er,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new yh(n,Er,void 0,!1,s,!1);let a=ti.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new M3(i,s,Er)),c[s]=new bI(i,s);else for(s=0;s<a;++s)c[s]=new bI(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new PE(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Ut,this._updaterSets=new Ut,this._entityCollection=t,t.collectionChanged.addEventListener(nf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ICt)}nf.registerUpdater=function(e){OE.registerUpdater(e)};nf.unregisterUpdater=function(e){OE.unregisterUpdater(e)};nf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new OE(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(nf._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var PCt=[],DCt=new ce;nf.prototype.getBoundingSphere=function(e,t){let n=PCt,i=DCt,r=0,o,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ce.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ce.fromBoundingSpheres(n,t),Pt.DONE)};nf.prototype.isDestroyed=function(){return!1};nf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(nf.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 r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};nf.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};nf.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=Dn.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 r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?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 Kt?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)};nf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};nf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var N3=nf;var RCt=1,OCt="30px sans-serif",MCt=xo.FILL,NCt=z.WHITE,LCt=z.BLACK,FCt=1,BCt=!1,kCt=new z(.165,.165,.165,.8),UCt=new U(7,5),zCt=U.ZERO,VCt=h.ZERO,jCt=We.NONE,HCt=Hi.CENTER,GCt=Gn.CENTER,WCt=new h,qCt=new z,YCt=new z,XCt=new z,KCt=new U,$Ct=new h,JCt=new U,ZCt=new qt,QCt=new qt,evt=new qt,tvt=new Ht;function JIe(e){this.entity=e,this.label=void 0,this.index=void 0}function fb(e,t){t.collectionChanged.addEventListener(fb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}fb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,WCt),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){Bne(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,jCt);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,RCt),u.font=X.getValueOrDefault(a._font,e,OCt),u.style=X.getValueOrDefault(a._style,e,MCt),u.fillColor=X.getValueOrDefault(a._fillColor,e,NCt,qCt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,LCt,YCt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,FCt),u.showBackground=X.getValueOrDefault(a._showBackground,e,BCt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,kCt,XCt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,UCt,KCt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,zCt,JCt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,VCt,$Ct),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,HCt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,GCt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,ZCt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,QCt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,evt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,tvt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};fb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Pt.FAILED;let i=n.label;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=fm(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=qg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};fb.prototype.isDestroyed=function(){return!1};fb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(fb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};fb.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new JIe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new JIe(o)):(Bne(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Bne(s.get(o.id),o,a),s.remove(o.id)};function Bne(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var L3=fb;var nvt=1,ivt=!0,rvt=0,ovt=!0,svt=!0,avt=Dn.ENABLED,cvt=We.NONE,lvt=z.RED,uvt=0,fvt=z.WHITE,dvt=gl.HIGHLIGHT,hvt=.5,mvt=new U(1,1),ZIe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},pvt=new N,gvt=new N,QIe=new z,ePe=new Array(4),_vt=new h;function db(e,t){t.collectionChanged.addEventListener(db.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}async function yvt(e,t,n,i,r){let o=e._primitives,s=e._modelHash;try{let a=await Xf.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,o.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}}db.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,pvt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...ZIe}},n[s.id]=u;let m=X.getValueOrDefault(a._incrementallyLoadTextures,e,ovt),y=X.getValueOrDefault(a._environmentMapOptions,e,ZIe,u.environmentMapOptionsScratch);yvt(this,s,c,m,y)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(a._scale,e,nvt),p.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,ivt),p.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,rvt),p.maximumScale=X.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=N.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(a._shadows,e,avt),p.heightReference=X.getValueOrDefault(a._heightReference,e,cvt),p.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,lvt,QIe),p.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,uvt),p.color=X.getValueOrDefault(a._color,e,fvt,QIe),p.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,dvt),p.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,hvt),p.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,svt),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,mvt);let g=X.getValueOrUndefined(a._lightColor,e);if(l(g)&&(z.pack(g,ePe,0),g=h.unpack(ePe,0,_vt)),p.lightColor=g,p.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:Ku.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(y)){let x=Object.keys(y);for(let T=0,E=x.length;T<E;++T){let v=x[T],S=y[v];if(!l(S))continue;let I=p.getNode(v);if(!l(I))continue;let R=N.fromTranslationRotationScale(S,gvt);I.matrix=N.multiply(I.originalMatrix,R,R)}}let A=!1,b=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(b)){let x=Object.keys(b);for(let T=0,E=x.length;T<E;++T){let v=x[T],S=b[v];l(S)&&(A=!0,p.setArticulationStage(v,S))}}A&&p.applyArticulations()}}return!0};db.prototype.isDestroyed=function(){return!1};db.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(db.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)kne(this,e[i],t,n);return ue(this)};var F3=new h,Avt=new he;db.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Pt.FAILED;if(n.loadFailed)return Pt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Pt.PENDING;if(!i.ready||!n.modelUpdated)return Pt.PENDING;let r=this._scene,o=r.ellipsoid??ee.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;F3.x=a[12],F3.y=a[13],F3.z=a[14];let c=o.cartesianToCartographic(F3,Avt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=fm(r,n,F3,[i],()=>f[e.id]===n);if(d===void 0)return Pt.PENDING;d!==null&&(u=d)}return l(u)&&(i.heightReference===We.CLIP_TO_GROUND?c.height<u&&(c.height=u):Ss(i.heightReference)?c.height=u:c.height+=u),ce.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ce.clone(i.boundingSphere,t),Pt.DONE};db.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(bvt(o,a),s.set(o.id,o)):(kne(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],kne(this,o,a,c),s.remove(o.id)};function kne(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function bvt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var B3=db;function hb(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(hb.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:ji.FIXED}}});var xvt=new K;hb.prototype.getValue=function(e,t){return l(e)||(e=K.now(xvt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};hb.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))};hb.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};hb.prototype.equals=function(e){return this===e||e instanceof hb&&this._value===e._value};hb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var x0=hb;var tPe=new $,nPe=new $,iPe=new $,Tvt=new h,rPe=new h,Evt=new h,Cvt=new h,g5=new Le,_5=new N,y5=new $;function U3(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,g5)&&(Le.conjugate(g5,g5),$.fromQuaternion(g5,y5),$.multiplyByVector(y5,r,r));else if(l(Vne(e,i.position,_5)))N.inverse(_5,_5),N.getRotation(_5,y5),$.multiplyByVector(y5,r,r);else return;return r}}function Vne(e,t,n){let i=t.getValue(e,Tvt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,rPe);if(l(o)&&!h.equalsEpsilon(i,o,D.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,tPe),a=At.computeFixedToIcrfMatrix(r,nPe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,iPe),s=$.transpose(c,tPe),a=At.computeTemeToPseudoFixedMatrix(r,nPe),$.transpose(a,a)):c=$.transpose(s,iPe);let u=Evt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,Cvt);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,rPe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new N),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var oPe=60,fPe=1,dPe=new Cn,Une=new Cn,zne=new Cn;function sPe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var A5=new h;function vvt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Qr&&(u=o,f=u.position,o=ji.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,A5),g=U3(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,E=!1,v,S,I;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,A5),l(g)&&l(m)&&(g=U3(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,A5),l(g)&&l(m)&&(g=U3(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(s>0&&!E){let R=i[A+1],O=K.secondsDifference(R,x);E=O>s,E&&(v=Math.ceil(O/s),S=0,I=O/Math.max(v,2),v=Math.max(v-1,1))}if(E&&S<v){x=K.addSeconds(x,I,new K),S++;continue}}E=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,A5),l(g)&&l(m)&&(g=U3(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Svt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function wvt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function Ivt(e,t,n,i,r,o,s,a){zne.start=t,zne.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,zne,dPe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function Pvt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function Dvt(e,t,n,i,r,o,s,a){Une.start=t,Une.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,Une,dPe).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=hPe(d.data,m,y,i,r,o,c,a)}}return c}function hPe(e,t,n,i,r,o,s,a){for(;e instanceof V_;)e=e.resolvedProperty;if(e instanceof yc){let c=e._property._times;s=vvt(e,t,n,c,i,r,o,s,a)}else e instanceof sF?s=Svt(e,t,n,i,r,o,s,a):e instanceof _c?s=Dvt(e,t,n,i,r,o,s,a):e instanceof j_?s=Ivt(e,t,n,i,r,o,s,a):e instanceof nu||e instanceof x0&&X.isConstant(e)?s=Pvt(e,t,n,i,r,o,s,a):s=wvt(e,t,n,i,r,o,s,a);return s}function jne(e,t,n,i,r,o,s){l(s)||(s=[]);let a=hPe(e,t,n,i,r,o,0,s);return s.length=a,s}var aPe=new $,cPe=new Le,lPe=new $,k3=new Cn,b5=new Cn,ME=new Cn;function Rvt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function uPe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Fr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=jne(t,g,m,n,c,a,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=s.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=Ao.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,fPe),d++}return d}function z3(e,t){this._unusedIndexes=[],this._polylineCollection=new Nm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}z3.prototype.update=function(e){let t=this._referenceFrame;if(t===ji.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,aPe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,aPe)),N.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Qr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,cPe))&&($.fromQuaternion(cPe,lPe),N.fromRotationTranslation(lPe,n,this._polylineCollection.modelMatrix)):Vne(e,t.position,this._polylineCollection.modelMatrix)}};z3.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(s=K.addSeconds(e,m,new K)),b){let E=A.start,v=A.stop;(!T||K.greaterThan(E,o))&&(o=E),(!x||K.lessThan(v,s))&&(s=v)}u=K.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,oPe),d=jne(r,o,s,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=Ao.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===_0.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:oPe,y=g.intervals,A=0;if(l(y)){k3.start=o,k3.stop=s,k3.isStartIncluded=!0,k3.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Cn.intersect(x,k3,b5))continue;let T=b5.start,E=b5.stop;if(K.greaterThanOrEquals(T,E))continue;let v=Rvt(x.data),S=[K.clone(T),K.clone(E)];for(let I=0;I<v.length;I++){let R=v[I],O=R.intervals;if(l(O))for(let L=0;L<O.length;L++){let _=O.get(L);Cn.intersect(_,b5,ME)&&(K.greaterThan(ME.start,T)&&K.lessThan(ME.start,E)&&S.push(K.clone(ME.start)),K.greaterThan(ME.stop,T)&&K.lessThan(ME.stop,E)&&S.push(K.clone(ME.stop)))}else if(!X.isConstant(R)){let L=K.clone(T);for(;K.lessThan(L,E);)S.push(K.clone(L)),L=K.addSeconds(L,m,new K)}}A=uPe(S,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(s)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,s);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=uPe(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,fPe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};z3.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);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};z3.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function T0(e,t){t.collectionChanged.addEventListener(T0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}T0.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,r=n.length;i<r;i++){let o=n[i],s=o.entity,a=s._position,c=s._path,u=o.updater,f=!1,d=ji.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=ji.FIXED,p=d.toString()):m==="INERTIAL"?(d=ji.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=a.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new z3(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};T0.prototype.isDestroyed=function(){return!1};T0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(T0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};T0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new sPe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new sPe(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};T0._subSample=jne;T0._computeVvlhTransform=Vne;T0._transformToEntityFrame=U3;var V3=T0;var mPe=z.WHITE,pPe=z.BLACK,gPe=0,_Pe=1,yPe=0,APe=qo.NONE,bPe=new z,Ovt=new h,xPe=new z,TPe=new qt,EPe=new qt,CPe=new Ht;function vPe(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 mb(e,t){t.collectionChanged.addEventListener(mb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}mb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,Ovt),d=l(p)),!d){j3(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(j3(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(j3(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,TPe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,EPe),c.color=X.getValueOrDefault(a._color,e,mPe,bPe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,pPe,xPe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,gPe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,_Pe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,CPe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,yPe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,APe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,TPe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,EPe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,CPe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,yPe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,APe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,mPe,bPe),A=X.getValueOrDefault(a._outlineColor,e,pPe,xPe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,gPe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,_Pe)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)),g){o.color=z.clone(y,o.color),o.outlineColor=z.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,E=y.toCssColorString(),v=A.toCssColorString(),S=JSON.stringify([E,x,v,b]);u.setImage(S,cE(T,E,v,b,x))}m&&u._updateClamping()}}return!0};mb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Pt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=fm(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=qg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};mb.prototype.isDestroyed=function(){return!1};mb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(mb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};mb.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new vPe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new vPe(o)):(j3(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],j3(s.get(o.id),o,a),s.remove(o.id)};function j3(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var H3=mb;var Mvt=new _i(0),x5={},SPe=new z,Nvt=new Kt(z.WHITE),Lvt=new _i(!0),Fvt=new _i(Dn.DISABLED),Bvt=new _i(new Ht),kvt=new _i(ti.BOTH);function Uvt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function zvt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Km(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Km.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 Uvt,this._groundGeometryOptions=new zvt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Qr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Km.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)&&X.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}}});Km.prototype.isOutlineVisible=function(e){return!1};Km.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Km.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ei.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,SPe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Ft({id:t,geometry:new $x(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,SPe)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Ft({id:t,geometry:new Vg(this._geometryOptions),attributes:s}))};Km.prototype.createOutlineGeometryInstance=function(e){};Km.prototype.isDestroyed=function(){return!1};Km.prototype.destroy=function(){this._entitySubscription(),ue(this)};Km.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(nt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??Nvt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??Lvt,this._shadowsProperty=r.shadows??Fvt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Bvt,this._classificationTypeProperty=r.classificationType??kvt,this._fillEnabled=!0,this._zIndex=a??Mvt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(nt.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?A=Ws.VERTEX_FORMAT:A=mc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(nt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(nt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(nt.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(nt.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)}};Km.prototype.createDynamicUpdater=function(e,t){return new G3(e,t,this)};var CI={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function G3(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 wPe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=x5[n];!l(i)||i.isDestroyed()?(i=new Nm,x5[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}G3.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=X.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)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Kt)p=new Ws;else{let g=Ao.getValue(e,d,this._material);p=new mc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new dm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=wPe(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=ln.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(CI.ellipsoid=f,CI.positions=o,CI.granularity=X.getValueOrUndefined(i._granularity,e),CI.height=ir.extractHeights(o,f),c===ln.GEODESIC?o=ir.generateCartesianArc(CI):o=ir.generateCartesianRhumbArc(CI)),a.show=!0,a.positions=o.slice(),a.material=Ao.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};G3.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 ce.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=wPe(this);if(t.show&&t.positions.length>0)return ce.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};G3.prototype.isDestroyed=function(){return!1};G3.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=x5[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete x5[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var W3=Km;var Vvt=new z,jvt=new Ht,Hvt=new Ht;function $m(e,t,n,i,r){let o;n instanceof Kt?o=Ws:o=mc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener($m.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut,this.zIndex=i,this._asynchronous=r}$m.prototype.onMaterialChanged=function(){this.invalidated=!0};$m.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};$m.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};$m.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};$m.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new dm({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===mc&&(this.material=Ao.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===mc&&(this.material=Ao.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,Vvt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Hvt,jvt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};$m.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};$m.prototype.contains=function(e){return this.updaters.contains(e.id)};$m.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};$m.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 vI(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}vI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new $m(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};vI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};vI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};vI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};vI.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 q3=vI;var Gvt=[];function IPe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function PPe(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 r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Kt?1:2);let o;l(i)&&(o=i+r*Dn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function E0(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ut,this._removedObjects=new Ut,this._changedObjects=new Ut;let r,o=Dn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new _h(n,Ws,void 0,!1,r),this._materialBatches[r]=new yh(n,mc,void 0,!1,r),this._colorBatches[r+o]=new _h(n,Ws,Ws,!1,r),this._materialBatches[r+o]=new yh(n,mc,Ws,!1,r),this._colorBatches[r+o*2]=new _h(n,Ws,mc,!1,r),this._materialBatches[r+o*2]=new yh(n,mc,mc,!1,r);this._dynamicBatch=new PE(n,i);let s=ti.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new q3(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ut,this._updaters=new Ut,this._entityCollection=t,t.collectionChanged.addEventListener(E0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Gvt)}E0.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(IPe(this,f),PPe(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),IPe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new W3(c,this._scene),this._updaters.set(u,f),PPe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(E0._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var Wvt=[],qvt=new ce;E0.prototype.getBoundingSphere=function(e,t){let n=Wvt,i=qvt,r=0,o,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ce.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ce.fromBoundingSpheres(n,t),Pt.DONE)};E0.prototype.isDestroyed=function(){return!1};E0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(E0.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(),ue(this)};E0._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};E0.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var Y3=E0;function rf(e){tu.initializeTerrainHeights(),dm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Go,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=e.visualizersCallback??rf.defaultVisualizersCallback;let i=!1,r=new El,o=new El;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new m3;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var SI=[];rf.registerVisualizer=function(e){SI.includes(e)||SI.push(e)};rf.unregisterVisualizer=function(e){if(SI.includes(e)){let t=SI.indexOf(e);SI.splice(t,1)}};rf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new tL(t,i),new N3(e,i,n._primitives,n._groundPrimitives),new L3(t,i),new B3(e,i),new a3(e,i),new H3(t,i),new V3(e,i),new Y3(e,i,n._primitives,n._groundPrimitives),...SI.map(r=>new r(e,i))]};Object.defineProperties(rf.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}}});rf.prototype.isDestroyed=function(){return!1};rf.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)),ue(this)};rf.prototype.update=function(e){if(!Mi.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,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),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};rf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var Yvt=[],Xvt=new ce;rf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Pt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return Pt.FAILED;let s=Yvt,a=Xvt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===Pt.PENDING)return Pt.PENDING;u===Pt.DONE&&(s[c]=ce.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ce.fromBoundingSpheres(s,n),Pt.DONE)};rf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new El),s=r.add(new C3);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};rf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};rf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var X3=rf;var DPe=new $,RPe=new $,OPe=new $,Kvt=new N,T5=new h,MPe=new h,Hne=new h,Gne=new h,NPe=new h,LPe=new h,$vt=new Le,Jvt=new h,Zvt=new $,wI=new K,Qvt=1.25;function eSt(e,t,n,i,r,o,s,a,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,wI);let I=r.getValue(wI,T5);if(l(I)||(K.addSeconds(c,-.001,wI),I=r.getValue(wI,T5),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,DPe),O=At.computeFixedToIcrfMatrix(wI,RPe),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,OPe),R=$.transpose(L,DPe),O=At.computeTemeToPseudoFixedMatrix(wI,RPe),$.transpose(O,O)):L=$.transpose(R,OPe);let _=$.multiplyByVector(R,d,NPe),C=$.multiplyByVector(O,I,LPe);h.subtract(_,C,Gne);let w=h.magnitude(Gne)*1e3,P=D.GRAVITATIONALPARAMETER,M=-P/(w*w-2*P/h.magnitude(_));M<0||M>Qvt*u.maximumRadius?(m=MPe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,Hne),y=h.cross(A,m,T5),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,Hne),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,D.EPSILON7)||(A=MPe,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,Hne),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,A,T5),$.multiplyByVector(L,m,m),$.multiplyByVector(L,y,y),$.multiplyByVector(L,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,Gne),x=h.clone(t.direction,NPe),T=h.clone(t.up,LPe));let E=Kvt,v;l(s)&&(v=s.getValue(c,$vt));let S=o.getValue(c,Jvt);if(a===Gg.INERTIAL&&l(v))N.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===Gg.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,Zvt);N.fromRotationTranslation(I,d,E)}else a===Gg.ENU||!p?At.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=y.x,E[5]=y.y,E[6]=y.z,E[7]=0,E[8]=A.x,E[9]=A.y,E[10]=A.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function K3(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ee.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new G_(e.position,!0),this._offset3D=new h}Object.defineProperties(K3,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});K3.defaultOffset3D=new h(-14e3,3500,3500);var E5=new Hd,tSt=new h;K3.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,s=o.trackingReferenceFrame,a=o.position;if(!l(a))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){E5.pitch=-D.PI_OVER_FOUR,E5.range=0;let b=a.getValue(e,tSt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);E5.pitch*=x}p.viewBoundingSphere(t,E5),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(K3._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,eSt(this,p,g,m,a,c,u,s,e,i)};var $3=K3;C0();bc();BE();e9();hU();var d1e={type:"module"},pie="error",jSt="messageerror",h1e,mie,m1e,gie=!0;try{gie=typeof structuredClone==Bo&&structuredClone(new DOMException("","AbortError")).code!==Ue}catch{}u1e(HSt);function HSt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Bo&&(o=o());let s;try{s=r9(e.workerURI,n,e)}catch{return die(e),hie(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await GSt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return die(e),p1e(e),i9(e,t);if(a&&a.codecImportFailed){if(e.reader)return p1e(e),i9(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function GSt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(VE);throw m.workerStartupFailed=!0,m}let n,i,r=new Promise((g,m)=>{n=g,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:s}=e,{writable:a,closed:c,abortPipe:u}=WSt(e.writable),f;try{f=_ie({type:r1e,options:s,config:t,readable:o,writable:a},e)}catch(g){u();try{await c}catch{}throw e.onTaskFinished(),g}f||Object.assign(e,{reader:o.getReader(),writer:a.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>qSt(e),d));try{let g=await r;return await p(),await c,g}catch(g){await p(),u();try{await c}catch{}throw g}async function p(){if(!f&&!a.locked)try{await a.getWriter().close()}catch{}}}function WSt(e){let t=new AbortController,{writable:n,readable:i}=new null,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function p1e(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function yie(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function r9(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(mie===Ue||h1e!==e){let u=typeof e==Bo;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===Ue&&(i=!1),i&&(c=d1e);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return r9(e,t,n,i,!1);if(i)throw p;return r9(e,t,n,!0,!1)}}else{i===Ue&&(i=!0),i&&(c=d1e);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return r9(e,t,n,!1,r);throw p}}h1e=e,mie=a,m1e=c}else s=new Worker(mie,m1e);return s.addEventListener(i1e,u=>{n.workerAlive=!0,_1e(n),YSt(u,n)}),s.addEventListener(pie,u=>g1e(u,n)),s.addEventListener(jSt,u=>g1e(u,n)),s}function qSt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(yie(e),e.worker=null,t){let i=new Error(VE);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function _1e(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function g1e(e,t){e.preventDefault&&e.preventDefault(),_1e(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;yie(t),n||(t.worker=null);let s=e.error||new Error(e.message||pie);n||(s=Object.assign(new Error(s.message||pie),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function _ie(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=B5(o),c.push(e.value.buffer)),i&&gie&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{gie=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function YSt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(s){let{message:y,stack:A,code:b,name:x,outputSize:T,cause:E,codecImportFailed:v}=s,S=new Error(y);Object.assign(S,{stack:A,code:b,name:x,outputSize:T}),E&&(S.cause=Object.assign(new Error(E.message),{name:E.name})),v&&(S.codecImportFailed=!0),m(S)}else{if(n==o1e){let{value:y,done:A}=await a.read();g()||_ie({type:cie,value:y,done:A,messageId:r},t)}n==cie&&(await c.ready,await c.write(new Uint8Array(i)),g()||_ie({type:s1e,messageId:r},t)),n==a1e&&m(null,o)}}catch(y){g()||(yie(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}Ure();bc();C0();UE();hU();c9();h9();Zne();BE();BI();qie();Z3();var Jre="File already exists",Zre="Zip file comment exceeds 64KB",_Re="Invalid zip file comment (must be a Uint8Array)",yRe="File entry comment exceeds 64KB",ARe="Invalid file entry comment (must be a string)",bRe="Invalid date (must be a valid Date instance)",xRe="File entry name exceeds 64KB",Qre="Version exceeds 65535",TRe="The strength must equal 1, 2, or 3",ERe="Encryption is not supported in USDZ files",CRe="Encryption is not supported when the 'passThrough' option is set",vRe="Invalid extra field (must be a Map)",SRe="Invalid extra field type (must be integer 0..65535)",wRe="Invalid extra field data (must be a Uint8Array)",H9="Extra field data exceeds 64KB",dIt="Compression method not supported",IRe=-2147483648,PRe=2147483647,aRe=BigInt(0),cRe=BigInt("0x7fffffffffffffff"),G9="Zip64 is not supported (set the 'zip64' option to 'true')",DRe="Undefined uncompressed size",RRe="Undefined compression method";var ORe="Undefined reader",MRe="Zip file not empty",NRe="Invalid uid (must be integer 0..2^32-1)",LRe="Invalid gid (must be integer 0..2^32-1)",FRe="Invalid UNIX mode (must be integer 0..65535)",BRe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",kRe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",URe="Invalid msdosAttributesRaw (must be integer 0..255)",zRe="Invalid msdosAttributes (must be an object with boolean flags)",VRe="Invalid level (must be integer 0..9)",jRe="Signature data exceeds 64KB",lRe=new Uint8Array([7,0,2,0,65,69,3,0,0]),hIt=4,mIt=9,pIt=67,gIt=1,qre="infozip",Yre="unix",_It=9,zre=0,uRe=[],PU=class{constructor(t,n={}){t=new XI(t);let{availableSize:i=NE,maxSize:r=NE}=t,o=i>0&&i!==NE&&r>0&&r!==NE;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[J3]===Ue?t.size||t.writable.size||0:n[J3],initialOffset:n[J3]===Ue?0:n[J3]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:Ue})}prependZip(t){return Vre(this,yIt(this,t))}appendZip(t){return Vre(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:r,fileEntries:o}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(f=>s=f);i.add(a);let c=[],u;try{t=new Z_(t),await jc(t),(t.size===Ue||!t.readUint8Array)&&(t=new sf(await w0(t.readable)),await jc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(Ure(),iRe)),d=new f(t),p=await d.getEntries();await d.close(),await jc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(Jre);r.add(A),c.push(A)}),n.writerLocked=!0;let{lockWriter:m}=n;n.lockWriter=new Promise(A=>u=()=>{n.writerLocked=!1,A()}),await m,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await BIt(t)||(await O0(n.writer,GRe()),n.offset+=4));let y=await kIt(n,t,p,g);p.forEach(A=>{let{version:b,rawLastModDate:x,rawFilename:T,bitFlag:E,encrypted:v,uncompressedSize:S,compressedSize:I,extraFieldZip64:R}=A,{compressionMethod:O,rawExtraField:L}=A,{level:_,languageEncodingFlag:C,dataDescriptor:w}=E;L=HRe(L||gr),A.extraFieldAES&&(O=99);let P=sr(L),M=!!R&&R.uncompressedSize!==Ue,F=!!R&&R.compressedSize!==Ue,V=KRe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=XRe({version:b,bitFlag:V,compressionMethod:O,uncompressedSize:S,compressedSize:I,rawLastModDate:x,rawFilename:T,zip64CompressedSize:F,zip64UncompressedSize:M,extraFieldLength:P}),{crc32:k}=A;k!==Ue&&Hc(j,10,k);let{offset:G,diskNumberStart:q}=y.get(A);Object.assign(A,{zip64UncompressedSize:M,zip64CompressedSize:F,offset:G,diskNumberStart:q,zip64DiskNumberStart:!1,rawExtraFieldZip64:gr,rawExtraFieldAES:gr,rawExtraFieldExtendedTimestamp:gr,rawExtraFieldNTFS:gr,rawExtraFieldUnix:gr,rawExtraField:L,rawCentralExtraField:gr,extendedTimestamp:!1,headerArray:B,headerView:j}),o.set(A.filename,A)})}catch(f){throw c.forEach(d=>r.delete(d)),f}finally{s(),i.delete(a),u&&u()}}add(t="",n,i={}){let r=this,{pendingAddFileCalls:o}=r,s=AIt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),Vre(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==LE&&(t=i.get(t)),t&&t.filename!==Ue){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=gr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(_Re);if(sr(t)>65535)throw new Error(Zre);for(;r.size;)await Promise.allSettled(Array.from(r));await Promise.allSettled(i.pendingErrors.map(u=>u.recorded));let a=i.pendingErrors.filter(u=>u.error&&!u.observed);if(a.length){let u=a.map(d=>d.error);a.forEach(d=>d.observed=!0);let[f]=u;try{f.entryErrors=u}catch{}throw f}return await OIt(i,t,n),!d9(o)&&Ji(i,n,R5)||await s.getWriter().close(),o.getData?o.getData():s}};var Xre=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Vre(e,t){let n=new Xre((r,o)=>Promise.prototype.then.call(t,r,o)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,Ue,r=>i.error=r),e.pendingErrors.push(i),n}async function yIt(e,t){if(e.filenames.size)throw new Error(MRe);await e.appendZipEntries(t)}async function AIt(e,t,n,i){if(i=Object.assign({},i),Ji(e,i,HE)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Jre);e.filenames.add(t),zre<K_().maxWorkers?zre++:await new Promise(r=>uRe.push(r));try{return await bIt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=uRe.shift();r?r():zre--}}async function bIt(e,t,n,i){let r=xIt(e,t,i);({name:t}=r);let o=TIt(e,t,i),{comment:s}=o,a=i[y9];e.fileEntries.set(t,Ue);let c=e.lastFileEntry,u={},f;o.resolvedOptions.keepOrder&&(u.lockFileEntry=new Promise(p=>f=p)),e.lastFileEntry=u;let d;try{let{resolvedOptions:p}=o;p.level!=0&&p.compressionMethod===Ue&&!p.passThrough&&!await f1e(K_())&&(p.level=0);let g=await EIt(e,n,o,i);({reader:n}=g);let m=DU(e.writer),y=ty(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[_9],crc32:i.crc32===Ue?i[_9]:i.crc32,offset:e.offset-m,diskNumberStart:y,[PI]:e.options[PI]});let A=wIt(i),b=PIt(i),x=sr(A.localHeaderArray,b.dataDescriptorArray);d=await vIt(e,t,n,{headerInfo:A,dataDescriptorInfo:b,metadataSize:x,fileEntry:u,previousFileEntry:c,releaseLockFileEntry:f},i)}catch(p){throw e.fileEntries.delete(t),p}finally{f&&f(c&&c.lockFileEntry)}return Object.assign(d,{name:t,comment:s,extraField:a,[m9]:d.internalFileAttributes,[p9]:d.externalFileAttributes}),new bb(d)}function xIt(e,t,n){let i=Ji(e,n,Lie),r=Ji(e,n,kie,i?20:768),o=Ji(e,n,zie),s=oP(e,n,"uid"),a=oP(e,n,"gid"),c=oP(e,n,jie),u=Ji(e,n,lDe),f=Ji(e,n,Hie),d=Ji(e,n,Gie),p=Ji(e,n,Wie);if(RI(s,4294967295,NRe),RI(a,4294967295,LRe),RI(c,65535,FRe),u!==Ue&&u!==qre&&u!==Yre)throw new Error(BRe);if(u===Yre&&(s!==Ue&&s>65535||a!==Ue&&a>65535))throw new Error(kRe);u===Ue&&(s!==Ue||a!==Ue)&&(u=qre);let g=oP(e,n,Mie),m=Ji(e,n,Nie),y=s!==Ue||a!==Ue||c!==Ue||u||o,A=g!==Ue||m!==Ue;if(y?(i=!1,r=r&255|768):A&&(i=!0,r=r&255),RI(g,255,URe),m&&(typeof m!==FPe||Array.isArray(m)))throw new Error(zRe);if(r>65535)throw new Error(Qre);let b=YRe(e,n,Oie,p9),x=b!==Ue;x||(b=0),!n[HE]&&t.endsWith("/")&&(n[HE]=!0);let T=Ji(e,n,HE);if(T?(t.endsWith("/")||(t+="/"),x||(b=16,i||(b|=16877<<16))):!i&&!x&&(o?b=493<<16:b=420<<16),!i){let S=c!==Ue||!!(f||d||p),I=b>>16&65535;c=c===Ue?I:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),(!x||S)&&(T?c=c&-61441|16384:c&61440||(c|=32768),b=(c&65535)<<16|b&65535)}({msdosAttributesRaw:g,msdosAttributes:m}=IIt(g,m)),A&&(b=b&4294967295|g&255);let E=b>>16&65535,v=c!==Ue&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:!!i,externalFileAttributes:b,unixExternalUpper:E,uid:s,gid:a,unixMode:c,unixExtraFieldType:u,symlink:v,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function TIt(e,t,n){let i=Kre(e,n,cDe)||MI,r=i(t,O5);if(r===Ue&&(r=MI(t)),sr(r)>65535)throw new Error(xRe);let o=n[yU]||"";if(typeof o!=LE)throw new Error(ARe);let s=i(o,M5);if(s===Ue&&(s=MI(o)),sr(s)>65535)throw new Error(yRe);let a=Ji(e,n,Bie);if(a!==Ue&&a>65535)throw new Error(Qre);let c=Wre(e,n,KI,new Date),u=Ji(e,n,$I),f=Wre(e,n,bU),d=Wre(e,n,xU),p=YRe(e,n,Rie,m9,0),g=Ji(e,n,S5),m=Ji(e,n,C5),y=Ji(e,n,v5);F5(m,y);let A=oP(e,n,ZPe,3),b=Ji(e,n,Uie),x=Ji(e,n,QPe,!0),T=Ji(e,n,eDe),E=Ji(e,n,tDe,!0),v=Ji(e,n,I5),S=Ji(e,n,D5),I=Ji(e,n,iDe),R=Kre(e,n,rDe),O=Ji(e,n,oDe,!0),L=L5(Ji(e,n,w5)),_=Ji(e,n,sDe,!0),C=Ji(e,n,Vie),w=g||C===Ue?Ue:q5(C);if(!g&&C!==Ue&&C!==0&&C!==8&&!w)throw new Error(dIt);let P=oP(e,n,nDe);if(RI(P,_It,VRe),e.options[PI]){if(m!==Ue||y!==Ue)throw new Error(ERe);P===Ue&&C===Ue&&(P=0)}g&&(P=Ue);let M=Ji(e,n,P5),F=Ji(e,n,qne);I&&F===Ue&&(F=!1),(F===Ue||b&&!g)&&(F=!0),P!==Ue&&P!=6&&(M=!1);let V=Ji(e,n,g9);if(!b&&(m!==Ue||y!==Ue)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(TRe);let B=jre(n[y9]),j=jre(n[uDe]),k=jre(n[fDe]);return{comment:o,resolvedOptions:{rawFilename:r,rawComment:s,version:a,lastModDate:c,rawLastModDate:u,lastAccessDate:f,creationDate:d,internalFileAttributes:p,passThrough:g,password:m,rawPassword:y,encryptionStrength:A,zipCrypto:b,extendedTimestamp:x,ntfsTimestamp:T,keepOrder:E,useWebWorkers:v,transferStreams:S,bufferedWrite:I,createTempStream:R,dataDescriptorSignature:O,signal:L,useUnicodeFileNames:_,compressionMethod:C,format:w?w.format:Ue,codecURI:w?w.codecURI:Ue,codecVersionNeeded:w?w.versionNeeded:Ue,level:P,useCompressionStream:M,dataDescriptor:F,zip64:V,rawExtraField:B,rawLocalExtraField:j,rawCentralExtraField:k}}}function jre(e){if(!e)return gr;if(!(e instanceof Map))throw new Error(vRe);let t=0,n=0;e.forEach((o,s)=>{if(Kne(s,65535,SRe),!(o instanceof Uint8Array))throw new Error(wRe);if(sr(o)>65535)throw new Error(H9);t+=4+sr(o)});let i=new Uint8Array(t),r=fi(i);return e.forEach((o,s)=>{R0(r,n,s),R0(r,n+2,sr(o)),MU(i,o,n+4),n+=4+sr(o)}),i}async function EIt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Ji(e,i,HE))throw new Error(ORe);let r;return t&&(t=new Z_(t),await jc(t),{size:r}=t),Object.assign({reader:t},CIt(e,!!t,r,n,i))}function CIt(e,t,n,i,r){let{passThrough:o,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=i,{dataDescriptor:f,zip64:d,level:p,compressionMethod:g}=i,m=0,y=0;if(o&&t){if(y=r[AU],y===Ue)throw new Error(DRe);if(g===Ue)throw new Error(RRe)}let A=d===!0,b=Ji(e,r,Fie);if(t&&o&&!b&&sr(a,c))throw new Error(CRe);let x=t&&(!!(a&&sr(a)||c&&sr(c))||o&&b);t||(p=0,g=0);let T=x?s?12:16+u*4:0;t&&(o?(r.uncompressedSize=y,m=n===Ue?gRe(y)+T:n):n===Ue?(f=!0,(d||d===Ue)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=($re(g,p)?gRe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!$re(g,p);E&&!s&&Ji(e,r,qne)===Ue&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(G9);d=!0}return d=d||!1,{maximumCompressedSize:m,resolvedOptions:{dataDescriptor:f,emptyEntry:E,zip64:d,zip64UncompressedSize:v,zip64CompressedSize:S,uncompressedSize:y,level:p,compressionMethod:g,encrypted:x}}}async function vIt(e,t,n,i,r){let{fileEntries:o,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:u,signal:f}=r,{headerInfo:d,fileEntry:p,previousFileEntry:g,releaseLockFileEntry:m}=i,y=e.options[PI],A=p,b,x,T,E,v,S=0,I,R=a&&g?g.lockFileEntry:Ue;o.set(t,A);try{r.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!u?(b=!0,e.bufferedWrites++,r.createTempStream?I=await r.createTempStream():I=new null(Ue,Ue,{highWaterMark:NE}),I.size=0,await jc(s)):(I=s,await R,await O()),await jc(I);let _=DU(s);e.addSplitZipSignature&&!b&&await hRe(e,s),y&&!b&&fRe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=ty(s),P=RU(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await O0(I,C)),A=await SIt(n,I,A,i,K_(),r),b||(E=!1),o.set(t,A),A.filename=t,b){if(await Promise.all([I.writable.getWriter().close(),R]),await O(),e.addSplitZipSignature&&await hRe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=ty(s),A.offset=RU(e,s),y){let M=i.metadataSize;fRe(i,e.offset-DU(s)),A.size+=i.metadataSize-M}RIt(A,d.localHeaderView,r),await O0(s,d.localHeaderArray),await WRe(I.readable,s,f,M=>S+=M),s.size+=I.size,T=!1}else A.diskNumberStart=w,A.offset=P;return e.offset+=A.size,A}catch(_){if(T||E){if(e.hasCorruptedEntries=!0,_)try{_.corruptedEntry=!0}catch{}e.offset+=s.size-v,b&&(e.offset+=S)}throw o.delete(t),_}finally{if(b&&e.bufferedWrites--,m&&m(R),x&&x(),b&&I&&I.dispose)try{await I.dispose()}catch{}}async function O(){e.writerLocked=!0;let{lockWriter:_}=e;e.lockWriter=new Promise(C=>x=()=>{e.writerLocked=!1,C()}),await _}async function L(){sP(s,sr(d.localHeaderArray))&&await s.closeDisk()}}async function SIt(e,t,{diskNumberStart:n,lockFileEntry:i},r,o,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:v,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R}=a,{dataDescriptorArray:O}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:w,rawPassword:P,level:M,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:B,zipCrypto:j,dataDescriptor:k,directory:G,executable:q,versionMadeBy:Q,rawComment:W,rawExtraField:J,rawCentralExtraField:Z,useWebWorkers:ae,transferStreams:Ae,onstart:fe,onprogress:xe,onend:ge,signal:we,encryptionStrength:Se,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Xe,uid:$e,gid:Pe,unixMode:qe,symlink:st,setuid:vt,setgid:Gt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Xt,useCompressionStream:rt,passThrough:ht,format:Bi,codecURI:Xn}=s,Ai={lockFileEntry:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:W,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R,rawExtraField:J,rawCentralExtraField:Z,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Xe,diskNumberStart:n,uid:$e,gid:Pe,unixMode:qe,symlink:!!st,setuid:vt,setgid:Gt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Xt},{crc32:Wi,uncompressedSize:wi}=s,di=0;ht||(wi=0);let{writable:bi}=t;if(e){let jn=Zm(Tie(e)),nn=e.size,Wn={options:{codecType:jI,inputSize:nn,level:M,rawPassword:P,password:w,encryptionStrength:Se,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:ae,useCompressionStream:rt,transferStreams:Ae,format:Bi,codecURI:Xn,compressionMethod:b},config:o,streamOptions:{signal:we,size:nn,onstart:fe,onprogress:xe,onend:ge}};try{let Zi=await a9({readable:jn,writable:bi},Wn);if(di=Zi.outputSize,t.size+=di,ht||(wi=Zi.inputSize,(!m||j)&&(Wi=Zi.crc32)),!B&&di>=4294967295||!V&&wi>=4294967295)throw new Error(G9)}catch(Zi){throw Zi.outputSize!==Ue&&(t.size+=Zi.outputSize),Zi}}return DIt({crc32:Wi,compressedSize:di,uncompressedSize:wi,headerInfo:a,dataDescriptorInfo:c},s),k&&await O0(t,O),Object.assign(Ai,{uncompressedSize:wi,compressedSize:di,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+di,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:Wi,crc32:m&&!j&&!ht?Ue:Wi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),Ai}function wIt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:r,creationDate:o,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:u,dataDescriptor:f,directory:d,rawExtraField:p,rawLocalExtraField:g,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:A,passThrough:b,encrypted:x,zip64UncompressedSize:T,zip64CompressedSize:E,uncompressedSize:v,crc32:S}=e,{version:I,compressionMethod:R}=e,O=!d&&$re(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=cd(20);if(ge.writeUint16(1),ge.writeUint16(16),L=ge.array,C&&(ge.writeUint64(v),_)){let we=x?c?12:16+m*4:0;ge.writeUint64(b?0:v+we)}}else L=gr;let P;if(x&&!c){let xe=cd(sr(lRe)+2);xe.writeUint16(39169),xe.writeBytes(lRe),P=xe.array,P[8]=m}else P=gr;let M,F,V;if(y){let xe=z9(n),ge=qRe(xe);if(ge){let Se=9+(r?4:0)+(o?4:0),Re=cd(Se);V=1+(r?2:0)+(o?4:0),Re.writeUint16(21589),Re.writeUint16(Se-4),Re.writeUint8(V),Re.writeUint32(xe),r&&Re.writeUint32(mRe(z9(r))),o&&Re.writeUint32(mRe(z9(o))),F=Re.array}else F=gr;if(A===Ue?!ge||!!(r||o):A)try{let Se=Gre(n),Re=cd(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(Se),Re.writeUint64(r?Gre(r):Se),Re.writeUint64(o?Gre(o):Se),M=Re.array}catch{M=gr}else M=gr}else M=F=gr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==qre&&(xe!==Ue||ge!==Ue)){let Se=dRe(xe===Ue?0:xe),Re=dRe(ge===Ue?0:ge),Qe=3+Se.length+Re.length,He=cd(4+Qe);He.writeUint16(30837),He.writeUint16(Qe),He.writeUint8(1),He.writeUint8(Se.length),He.writeBytes(Se),He.writeUint8(Re.length),He.writeBytes(Re),B=He.array}else if(we==Yre&&(xe!==Ue||ge!==Ue)){let Se=cd(8);Se.writeUint16(30805),Se.writeUint16(4),Se.writeUint16((xe===Ue?0:xe)&65535),Se.writeUint16((ge===Ue?0:ge)&65535),B=Se.array}else B=gr}catch{B=gr}R===Ue&&(R=O?8:0),I===Ue&&(I=R==0&&!d&&!x?10:20);let{codecVersionNeeded:j}=e;O&&j!==Ue&&(I=I>j?I:j),a&&(I=I>45?I:45),x&&!c&&(I=I>51?I:51,b&&S!==Ue&&(P[hIt]=gIt),R0(fi(P),mIt,R),R=99);let k=w?sr(L):0,G=k+sr(P,F,M,B,p,g),q=e[PI]?pIt:0;if(G+q>65535)throw new Error(H9);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=XRe({version:I,bitFlag:KRe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<II?II:Q>Wne?Wne:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=cd(30+sr(t)+G),Ae=ae.array,fe=fi(Ae);return ae.writeUint32(67324752),ae.writeBytes(W),ae.writeBytes(t),w&&ae.writeBytes(L),ae.writeBytes(P),ae.writeBytes(F),ae.writeBytes(M),ae.writeBytes(B),ae.writeBytes(p),ae.writeBytes(g),f&&(E||Hc(fe,18,0),T||Hc(fe,22,0)),{localHeaderArray:Ae,localHeaderView:fe,headerArray:W,headerView:J,lastModDate:n,rawLastModDate:Z,encrypted:x,compressed:O,version:I,compressionMethod:R,extraFieldExtendedTimestampFlag:V,rawExtraFieldZip64:gr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:M,rawExtraFieldUnix:B,rawExtraFieldAES:P,extraFieldLength:G}}function fRe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+sr(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=fi(s);R0(a,0,6534),R0(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(sr(c)+o),MU(i,c),MU(i,s,sr(c));let u=fi(i);R0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function dRe(e){let t=new Uint8Array(4);fi(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function IIt(e,t){if(e!==Ue)e=e&255;else if(t!==Ue){let{readOnly:n,hidden:i,system:r,directory:o,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),r&&(a|=4),o&&(a|=16),s&&(a|=32),e=a&255}return t===Ue&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function PIt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=gr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=fi(i),n&&(o=4,Hc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function DIt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:u,encrypted:f}=i,{dataDescriptorView:d,dataDescriptorOffset:p}=r;(!f||s||a)&&e!==Ue&&(Hc(u,10,e),c&&Hc(d,p,e)),o?c&&(OU(d,p+4,BigInt(t)),OU(d,p+12,BigInt(n))):(Hc(u,14,t),Hc(u,18,n),c&&(Hc(d,p+4,t),Hc(d,p+8,n)))}function RIt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:r,compressedSize:o,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},u,{dataDescriptor:f,passThrough:d}){if(f||((!t||d&&r!==Ue)&&Hc(u,14,r),c||Hc(u,18,o),a||Hc(u,22,s)),n&&i){let p=30+sr(e)+4;OU(u,p,BigInt(s)),OU(u,p+8,BigInt(o))}}async function OIt(e,t,n){let i=MIt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await NIt(e,i,n),a=await LIt(e,s,n);await FIt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function MIt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:u,extendedTimestamp:f,extraFieldExtendedTimestampFlag:d,lastModDate:p,zip64UncompressedSize:g,zip64CompressedSize:m,uncompressedSize:y,compressedSize:A}=n,b=n.offset>=4294967295,x=n.diskNumberStart>=65535,T;if(b||x||g||m){let I=4+(g?8:0)+(m?8:0)+(b?8:0)+(x?4:0),R=cd(I);R.writeUint16(1),R.writeUint16(I-4),g&&R.writeUint64(y),m&&R.writeUint64(A),b&&R.writeUint64(n.offset),x&&R.writeUint32(n.diskNumberStart),T=R.array}else T=gr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=z9(p);if(f&&qRe(v)){let I=cd(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=gr;n.rawExtraFieldExtendedTimestamp=E;let S=sr(T,r,s,a,E,c,u);if(S>65535)throw new Error(H9);t+=46+sr(i,o)+S}return t}async function NIt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await jc(r);let s=0,a=0,c=ty(r),u=DU(r),f=0;for(let[d,p]of Array.from(i.values()).entries()){let{offset:g,rawFilename:m,rawExtraFieldZip64:y,rawExtraFieldAES:A,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:x,rawExtraFieldUnix:T,rawExtraField:E,rawCentralExtraField:v,rawComment:S,versionMadeBy:I,headerArray:R,headerView:O,zip64UncompressedSize:L,zip64CompressedSize:_,zip64DiskNumberStart:C,zip64Offset:w,internalFileAttributes:P,externalFileAttributes:M,diskNumberStart:F,uncompressedSize:V,compressedSize:B}=p,j=sr(y,A,b,x,T,E,v),k=46+sr(m,S)+j;sP(r,s+k-a)&&(await O0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=ty(r),u=DU(r)),L||Hc(O,18,V),_||Hc(O,14,B),(w||C)&&p.version<45&&R0(O,0,45);let G=cd(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(sr(S)),G.writeUint16(C?65535:F),G.writeUint16(P),G.writeUint32(M),G.writeUint32(w?4294967295:g),G.writeBytes(m),G.writeBytes(y),G.writeBytes(A),G.writeBytes(b),G.writeBytes(x),G.writeBytes(T),G.writeBytes(E),G.writeBytes(v),G.writeBytes(S),MU(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new bb(p))}catch{}}return await O0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:ty(r),entriesLength:f},directoryArray:o}}async function LIt(e,t,n){let i=Kre(e,n,gDe);if(i){let r=await i(t),o=sr(r);if(o>65535)throw new Error(jRe);let s=cd(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return sP(a,sr(s.array))&&await a.closeDisk(),await O0(a,s.array),6+o}return 0}async function FIt(e,t,n,i){let{writer:r}=e,{directoryStart:o,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,u=e.fileEntries.size,f=o.diskNumber,d=RU(e,o),p=sr(t);if(p>65535)throw new Error(Zre);let g=Ji(e,n,g9),m=ty(r);if(sP(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(G9);g=!0}let y=cd(g?98:22);sP(r,sr(y.array)+p)&&await r.closeDisk(),m=ty(r);let A=m==s.diskNumber?s.entriesLength:0;g&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(m),y.writeUint32(f),y.writeUint64(A),y.writeUint64(u),y.writeUint64(c),y.writeUint64(d),y.writeUint32(117853008),y.writeUint32(m),y.writeUint64(BigInt(RU(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Ji(e,n,aDe,!0)&&(m=65535,f=65535),A=65535,u=65535,d=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(m),y.writeUint16(f),y.writeUint16(A),y.writeUint16(u),y.writeUint32(c),y.writeUint32(d),y.writeUint16(p),await O0(r,y.array),p&&await O0(r,t)}function cd(e){let t=new Uint8Array(e),n=fi(t),i=0;return{array:t,writeUint8:r=>{VIt(n,i,r),i+=1},writeUint16:r=>{R0(n,i,r),i+=2},writeUint32:r=>{Hc(n,i,r),i+=4},writeUint64:r=>{OU(n,i,BigInt(r)),i+=8},writeBytes:r=>{MU(t,r,i),i+=sr(r)},skip:r=>i+=r}}function ty(e){let{diskNumber:t=0}=e;return t}function DU(e){let{diskOffset:t=0}=e;return t}function sP(e,t){let{availableSize:n=NE}=e;return t>n}function RU(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function BIt(e){let t=await Uo(e,0,4);return zIt(fi(t),0)==134695760}function HRe(e){let t=fi(e),n=0;for(;n+4<=sr(e);){let i=4+j9(t,n+2);if(j9(t,n)==1)return HRe(Ah(e.subarray(0,n),e.subarray(Math.min(n+i,sr(e)))));n+=i}return e}async function kIt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>U9(t,c)-U9(t,u)),a=0;for(let c of s){let u=U9(t,c);await Hre(e,t,a,u-a),sP(r,await UIt(t,u))&&await r.closeDisk(),o.set(c,{offset:RU(e,r),diskNumberStart:ty(r)}),a=u}await Hre(e,t,a,i-a)}else{let s=e.offset;await Hre(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+U9(t,a),diskNumberStart:0}))}return o}async function Hre(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await WRe(Tie(t,{offset:n,size:i}),r,Ue,s=>o+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{r.size+=o,e.offset+=o}}}async function UIt(e,t){let n=await Uo(e,t,30);if(sr(n)<30)return 30;let i=fi(n);return 30+j9(i,26)+j9(i,28)}function U9(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function GRe(){let e=new Uint8Array(4);return Hc(fi(e),0,134695760),e}async function hRe(e,t){delete e.addSplitZipSignature,await O0(t,GRe()),e.offset+=4}async function O0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=sr(t),await i.write(t)}finally{i.releaseLock()}}async function WRe(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(sr(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function Gre(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<aRe?aRe:t>cRe?cRe:t}}function z9(e){return Math.floor(e.getTime()/1e3)}function qRe(e){return e>=IRe&&e<=PRe}function mRe(e){return Math.min(PRe,Math.max(IRe,e))}function Ji(e,t,n,i){let r=t[n]===Ue?e.options[n]:t[n];return r===Ue?i:r}function Wre(e,t,n,i){let r=Ji(e,t,n,i);if(r===null)return i;if(r!==Ue&&(typeof r.getTime!=Bo||Number.isNaN(r.getTime())))throw new Error(bRe);return r}function Kre(e,t,n){return DI(Ji(e,t,n))}function YRe(e,t,n,i,r){let o=pRe(t,n,i),s=o===Ue?pRe(e.options,n,i):o;return s===Ue?r:s}function pRe(e,t,n){return e[t]===Ue?e[n]:e[t]}function oP(e,t,n,i){return FE(Ji(e,t,n,i))}function gRe(e){return e+5*(Math.floor(e/16383)+1)}function $re(e,t){return e===Ue?t===Ue||t>0:e!==0}function j9(e,t){return e.getUint16(t,!0)}function zIt(e,t){return e.getUint32(t,!0)}function VIt(e,t,n){e.setUint8(t,n)}function R0(e,t,n){e.setUint16(t,n,!0)}function Hc(e,t,n){e.setUint32(t,n,!0)}function OU(e,t,n){e.setBigUint64(t,n,!0)}function MU(e,t,n){e.set(t,n)}function sr(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function XRe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=cd(26),p=d.array,g=fi(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===Ue){let m=new Uint32Array(1),y=fi(m);R0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),R0(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),s=m[0]}return d.writeUint32(s),d.skip(4),c||r!==Ue?d.writeUint32(c?4294967295:r):d.skip(4),u||i!==Ue?d.writeUint32(u?4294967295:i):d.skip(4),d.writeUint16(sr(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function KRe(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}h9();Z3();C0();UE();bc();C0();UE();aie();var Gji=1024*1024;BI();var Yji=1024*1024;var Kji=1024*1024;var $ji=512*1024;var HIt={};try{OI({baseURI:HIt.url})}catch{}C0();var GIt=[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],WIt=[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],qIt=[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],YIt=[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],XIt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],LU=new Uint8Array(288);LU.fill(8,0,144),LU.fill(9,144,256),LU.fill(7,256,280),LU.fill(8,280,288);var KIt=new Uint8Array(30).fill(5);function NU(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;r<=15;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{l:t,symbols:i}}var ld="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function $Re(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",r=n.length,o=0;for(;o+2<r;o+=3){let a=n[o]<<16|n[o+1]<<8|n[o+2];i+=ld[a>>18&63]+ld[a>>12&63]+ld[a>>6&63]+ld[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=ld[a>>18&63]+ld[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=ld[a>>18&63]+ld[a>>12&63]+ld[a>>6&63]+"="}return i})((function(n){let i=0,r=0,o=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(NU(LU),NU(KIt));else{if(A!=2)throw new Error("invalid deflate block type");p(...g())}}return s.subarray(0,a);function u(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function f(A){for(;o<A;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(a+A);for(let b=0;b<A;b++)s[a++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(x<256)y(a+1),s[a++]=x;else{let T=x-257,E=GIt[T]+f(WIt[T]),v=m(b),S=qIt[v]+f(YIt[v]);y(a+E);let I=a-S;for(let R=0;R<E;R++)s[a++]=s[I+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let I=0;I<x;I++)T[XIt[I]]=f(3);let E=NU(T),v=new Uint8Array(A+b),S=0;for(;S<v.length;){let I=m(E);if(I<16)v[S++]=I;else if(I==16){let R=v[S-1],O=f(2)+3;for(;O--;)v[S++]=R}else S+=I==17?f(3)+3:f(7)+11}return[NU(v.subarray(0,A)),NU(v.subarray(A))]}function m(A){let{l:b,symbols:x}=A,T=0,E=0,v=0;for(let S=1;S<=15;S++){T|=f(1);let I=b[S];if(T-E<I)return x[v+(T-E)];v+=I,E=E+I<<1,T<<=1}throw new Error("invalid huffman code")}function y(A){if(s.length<A){let b=2*s.length;for(;b<A;)b*=2;let x=new Uint8Array(b);x.set(s.subarray(0,a)),s=x}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;o<i;o+=4){let s=ld.indexOf(n[o])<<18|ld.indexOf(n[o+1])<<12|(63&ld.indexOf(n[o+2]))<<6|63&ld.indexOf(n[o+3]);r.push(s>>16&255),n[o+2]!=="="&&r.push(s>>8&255),n[o+3]!=="="&&r.push(255&s)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNtEURRp5axyShkXWxfpx3S7HcVaP2WeMnGqh9pf+u0oS37DHY4f3Xz0wtYXjOqcPf/wudODzY8/cH7z8yqZG12ePX928MDW6c+rNJ+6p9rF6PqxrQtnNre3VTauZfP8Q2rm4Ojy3OntwQNnLpzf/tyjmw+p2Sw8kMaar6Teopi85Kbn5qZuffZXzj6m9s0290atj2rlxg80V7vbfmhzsu3mitveX0xectvzc1O3uO0Ds829pu2Do1rR9oJ7eGtzU5kDzc1dIMSPnj537sIZpTOu9Ozpc2d/ZVO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7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}bc();C0();hU();c9();var Y9="deflate",W9="deflate-raw",JRe="deflate64-raw",q9="gzip",Ls,aP,ny,FU,ZRe;function QRe(e){if(Ls=e,{malloc:aP,free:ny,memory:FU}=Ls,typeof aP!="function"||typeof ny!="function"||!FU)throw Ls=aP=ny=FU=null,new Error("Invalid WASM module")}function eOe(e){ZRe=e}function tOe(e,t,n={}){if(!Ls){let a=new Error("WASM module not loaded");throw a.cause=ZRe,a}let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new null({start(){try{let a;if(this.out=aP(r),this.in=aP(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=Ls.deflate_process,this._last_consumed=Ls.deflate_last_consumed,this._end=Ls.deflate_end,this.streamHandle=Ls.deflate_new(),t===q9?a=Ls.deflate_init_gzip(this.streamHandle,i):t===W9?a=Ls.deflate_init_raw(this.streamHandle,i):a=Ls.deflate_init(this.streamHandle,i)):t===JRe?(this._process=Ls.inflate9_process,this._last_consumed=Ls.inflate9_last_consumed,this._end=Ls.inflate9_end,this.streamHandle=Ls.inflate9_new(),a=Ls.inflate9_init_raw(this.streamHandle)):(this._process=Ls.inflate_process,this._last_consumed=Ls.inflate_last_consumed,this._end=Ls.inflate_end,this.streamHandle=Ls.inflate_new(),t===W9?a=Ls.inflate_init_raw(this.streamHandle):t===q9?a=Ls.inflate_init_gzip(this.streamHandle):a=Ls.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let u=a,f=new Uint8Array(FU.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&ny&&(ny(this.in),this.in=0),this.in=aP(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let E=b>>24&255,v=E&128?E-256:E;if(v<0)throw new Error("process error:"+v)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){s(this),c.error(u)}},flush(a){try{let c=new Uint8Array(FU.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),a.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&ny&&ny(a.in),a.in=0,a.out&&ny&&ny(a.out),a.out=0,c}}var $E=class{constructor(t=Y9,n){return tOe(!0,t,n)}},JE=class{constructor(t=Y9,n){return tOe(!1,t,n)}};$E.requiresModule=!0;JE.requiresModule=!0;$E.supportedFormats=[Y9,W9,q9];JE.supportedFormats=[Y9,W9,q9,JRe];var nOe=!1;async function iOe(e,{baseURI:t}){if(!nOe)try{await $It(e,t),nOe=!0}catch(n){throw eOe(n),n}}async function $It(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=JIt(e);else throw o}let r=await WebAssembly.instantiate(n);QRe(r.instance.exports)}function JIt(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var X9;l1e({initModule:e=>{if(!X9){let{wasmURI:t}=e;typeof t==Bo&&(t=t()),X9=iOe(t,e).catch(n=>{throw X9=null,n})}return X9}});OI({CompressionStreamFallback:$E,DecompressionStreamFallback:JE});$Re(OI);var eoe=32,ZIt="http://www.opengis.net/kml/2.2",tp="http://www.google.com/kml/ext/2.2",QIt="http://www.w3.org/2000/xmlns/";function K9(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var ePt=/^data:image\/([^,;]+)/;K9.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(ePt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function tPt(e,t){return function(n){e._files[t]=n}}K9.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(tPt(this,o))}return r};Object.defineProperties(K9.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function $9(e){this._time=e}$9.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};$9.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return QE(n)};$9.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function toe(){this._ids={},this._styles={},this._count=0}toe.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};toe.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 sOe(){this._ids={}}sOe.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function noe(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=noe._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(QIt,"xmlns:gx",tp);let a=o.createElement("Document");s.appendChild(a),cOe(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?nPt(f,c.files):{kml:f,externalFiles:c.files}})}async function nPt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");eU({workerURI:n,wasmURI:i});let r=new YI("application/vnd.google-earth.kmz"),o=new PU(r);await o.add("doc.kml",new gU(e));let s=Object.keys(t);return await aOe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function aOe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new sf(n[r])),aOe(e,t,n,i+1)}noe._createState=function(e){let t=e.entities,n=new toe,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===nt.MINIMUM_VALUE?o.stop===nt.MAXIMUM_VALUE?o=new Cn:K.addSeconds(o.stop,-10*s,o.start):o.stop===nt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new K9(e.modelCallback);return{kmlDoc:document.implementation.createDocument(ZIt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new sOe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new $9(r),sampleDuration:s,defaultAvailability:new vs([o])}};function cOe(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],iPt(e,p,u,f),rPt(e,p.polyline,u,f),oOe(e,p.rectangle,u,f,c),oOe(e,p.polygon,u,f,c),cPt(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,nt.MINIMUM_VALUE)||g.appendChild(vn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,nt.MAXIMUM_VALUE)||g.appendChild(vn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",s.get(p.id)),x.appendChild(vn(i,"name",p.name)),x.appendChild(vn(i,"visibility",p.show)),x.appendChild(vn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let x=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),S=o.get(T.text);x=l(S)&&S.length>0?S:x;let I=o.getColor(T.fillColor);l(I)&&(v.appendChild(vn(i,"color",I)),v.appendChild(vn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(vn(i,"scale",R)),f.push(v)}b.appendChild(vn(i,"name",x)),b.appendChild(vn(i,"visibility",p.show)),b.appendChild(vn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let E=f.length;if(E>0){let v=i.createElement("Style");for(let S=0;S<E;++S)v.appendChild(f[S]);b.appendChild(vn(i,"styleUrl",r.get(v)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let S=0;S<y;++S)v.appendChild(u[S]);b.appendChild(v)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(vn(i,"name",p.name)),b.appendChild(vn(i,"visibility",p.show)),b.appendChild(vn(i,"description",p.description)),t.appendChild(b),cOe(e,b,A)}}}var cf=new h,gu=new he,ep=new K;function iPt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){lOe(e,t,a,n,i);return}s.get(c,void 0,cf);let u=vn(r,"coordinates",ZE(cf,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(eC(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof fl?fOe(e,a):uOe(e,a);i.push(p)}function lOe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof _c?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof Zg,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof x0?(x=x._value,T.appendChild(eC(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(eC(e,n.heightReference)):T.appendChild(eC(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,cf);let I=vn(o,"coordinates",ZE(cf,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof yc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],ji.FIXED,cf),v.push(ZE(cf,s));else if(x instanceof id){m=x._times;let I=x._values;for(g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),h.fromArray(I,g*3,cf),v.push(ZE(cf,s))}else{let I=e.sampleDuration;b.start.clone(ep),b.isStartIncluded||K.addSeconds(ep,I,ep);let R=b.stop;for(;K.lessThan(ep,R);)x.getValue(ep,cf),E.push(K.toIso8601(ep)),v.push(ZE(cf,s)),K.addSeconds(ep,I,ep);b.isStopIncluded&&K.equals(ep,R)&&(x.getValue(ep,cf),E.push(K.toIso8601(ep)),v.push(ZE(cf,s)))}let S=o.createElementNS(tp,"Track");S.appendChild(T);for(let I=0;I<E.length;++I){let R=vn(o,"when",E[I]),O=vn(o,"coord",v[I],tp);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(dOe(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(tp,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof fl?fOe(e,n):uOe(e,n);r.push(b)}let A=t.path;if(l(A)){let b=a.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(vn(o,"width",b)),ioe(e,x,T),r.push(T)}}}function uOe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(vn(n,"color",o)),r.appendChild(vn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(vn(n,"scale",s/eoe)),r}function fOe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(vn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(vn(n,"x",g.x,tp)),p.appendChild(vn(n,"y",g.y,tp)),p.appendChild(vn(n,"w",g.width,tp)),p.appendChild(vn(n,"h",g.height,tp))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(vn(n,"color",a)),o.appendChild(vn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(vn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,U.divideByScalar(u,c,u);let p=i.get(t.width,eoe),g=i.get(t.height,eoe),m=i.get(t.horizontalOrigin,Hi.CENTER);m===Hi.CENTER?u.x-=p*.5:m===Hi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Gn.CENTER);y===Gn.TOP?u.y+=g:y===Gn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=D.toDegrees(-f),f===0&&(f=360),o.appendChild(vn(n,"heading",f))),o}function rPt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(vn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=vn(r,"coordinates",ZE(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(vn(r,"drawOrder",m,tp)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(vn(r,"width",A)),ioe(e,t.material,y),i.push(y)}function oPt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](a,gu),c.push(`${D.toDegrees(gu.longitude)},${D.toDegrees(gu.latitude)},${o}`);let f=vn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function rOe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,gu),s.push(`${D.toDegrees(gu.longitude)},${D.toDegrees(gu.latitude)},${i?gu.height:n}`);let c=vn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function sPt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(rOe(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(rOe(e,p[m].positions,o,s)),a.push(y)}}return a}function oOe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof gm;if(a&&s.getMaterialType(t.material)==="Image"){aPt(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(vn(o,"extrude",!0));let f=a?oPt(e,t,u):sPt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(eC(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(vn(o,"fill",m)),ioe(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(vn(o,"outline",y));let A=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);A.appendChild(vn(o,"width",b));let x=s.getColor(t.outlineColor,z.BLACK);A.appendChild(vn(o,"color",x)),A.appendChild(vn(o,"colorMode","normal")),i.push(A)}i.push(g)}function aPt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(eC(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(vn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(vn(i,"north",D.toDegrees(u.north))),f.appendChild(vn(i,"south",D.toDegrees(u.south))),f.appendChild(vn(i,"east",D.toDegrees(u.east))),f.appendChild(vn(i,"west",D.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(vn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(vn(i,"color",QE(d.color))),n.push(s)}function dOe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(vn(n,"x",s)),u.appendChild(vn(n,"y",s)),u.appendChild(vn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(vn(n,"href",c)),o.appendChild(a),o}function cPt(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){lOe(e,t,n,i,r);return}let u=dOe(e,n),f=o.createElement("altitudeMode");f.appendChild(eC(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,cf),he.fromCartesian(cf,s,gu);let d=o.createElement("Location");d.appendChild(vn(o,"longitude",D.toDegrees(gu.longitude))),d.appendChild(vn(o,"latitude",D.toDegrees(gu.latitude))),d.appendChild(vn(o,"altitude",gu.height)),u.appendChild(d),i.push(u)}function ioe(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=QE(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=QE(o.color);break;case"PolylineOutline":s=QE(o.color),c=QE(o.outlineColor),u=o.outlineWidth,n.appendChild(vn(i,"outerColor",c,tp)),n.appendChild(vn(i,"outerWidth",u,tp));break;case"Stripe":s=QE(o.oddColor);break}l(s)&&(n.appendChild(vn(i,"color",s)),n.appendChild(vn(i,"colorMode","normal")))}function eC(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function ZE(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,gu),i.push(`${D.toDegrees(gu.longitude)},${D.toDegrees(gu.latitude)},${gu.height}`);return i.join(" ")}function vn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function QE(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 roe=noe;var pOe=Qo(mOe(),1);function Z9(e){return h.fromDegrees(e[0],e[1],e[2])}var ooe={"urn:ogc:def:crs:OGC:1.3:CRS84":Z9,"EPSG:4326":Z9,"urn:ogc:def:crs:EPSG::4326":Z9},gOe={},_Oe={},soe=48,aoe,coe=z.ROYALBLUE,loe=z.YELLOW,uoe=2,foe=z.fromBytes(255,255,0,100),doe=!1,lPt={small:24,medium:48,large:64},uPt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function yOe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||uPt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${yOe(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function fPt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function dPt(e,t){return new _m(fPt(yOe,e,t),!0)}function Q9(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new _i(c):n(o,s))}return r}function hoe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var AOe={Feature:xOe,FeatureCollection:hPt,GeometryCollection:TOe,LineString:wOe,MultiLineString:IOe,MultiPoint:vOe,MultiPolygon:ROe,Point:COe,Polygon:DOe,Topology:OOe},bOe={GeometryCollection:TOe,LineString:wOe,MultiLineString:IOe,MultiPoint:vOe,MultiPolygon:ROe,Point:COe,Polygon:DOe,Topology:OOe};function xOe(e,t,n,i,r){if(t.geometry===null){Q9(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=bOe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function hPt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)xOe(e,o[s],void 0,i,r)}function TOe(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=bOe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function EOe(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=lPt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new fl;f.verticalOrigin=new _i(Gn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=Q9(t,e._entityCollection,r.describe);d.billboard=f,d.position=new nu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new _i(g)}).catch(function(){f.image=new _i(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function COe(e,t,n,i,r){EOe(e,t,i,n.coordinates,r)}function vOe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)EOe(e,t,i,o[s],r)}function SOe(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new _i(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Kt(d))}let c=Q9(t,e._entityCollection,r.describe),u=new dl;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new _i(hoe(i,n)),u.arcType=ln.RHUMB}function wOe(e,t,n,i,r){SOe(e,t,i,n.coordinates,r)}function IOe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)SOe(e,t,i,o[s],r)}function POe(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new _i(g));let m,y=c.stroke;l(y)&&(m=z.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new _i(m));let b,x=c.fill,T=s.color.getValue();l(x)&&(b=z.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(s=new Kt(b))}let u=new pm;u.outline=new _i(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=ln.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Lc(hoe(i[g],n)));let d=i[0];u.hierarchy=new _i(new Lc(hoe(d,n),f)),d[0].length>2?u.perPositionHeight=new _i(!0):r.clampToGround||(u.height=0);let p=Q9(t,e._entityCollection,r.describe);p.polygon=u}function DOe(e,t,n,i,r){POe(e,t,i,n.coordinates,r)}function ROe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)POe(e,t,i,o[s],r)}function OOe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=pOe.feature(n,n.objects[o]),a=AOe[s.type];a(e,s,s,i,r)}}function Eb(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ka(this),this._promises=[],this._pinBuilder=new zg,this._entityCluster=new ed,this._credit=void 0,this._resourceCredits=[]}Eb.load=function(e,t){return new Eb().load(e,t)};Object.defineProperties(Eb,{markerSize:{get:function(){return soe},set:function(e){soe=e}},markerSymbol:{get:function(){return aoe},set:function(e){aoe=e}},markerColor:{get:function(){return coe},set:function(e){coe=e}},stroke:{get:function(){return loe},set:function(e){loe=e}},strokeWidth:{get:function(){return uoe},set:function(e){uoe=e}},fill:{get:function(){return foe},set:function(e){foe=e}},clampToGround:{get:function(){return doe},set:function(e){doe=e}},crsNames:{get:function(){return ooe}},crsLinkHrefs:{get:function(){return gOe}},crsLinkTypes:{get:function(){return _Oe}}});Object.defineProperties(Eb.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}}});Eb.prototype.load=function(e,t){return MOe(this,e,t,!0)};Eb.prototype.process=function(e,t){return MOe(this,e,t,!1)};function MOe(e,t,n,i){Ms.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??dPt,markerSize:n.markerSize??soe,markerSymbol:n.markerSymbol??aoe,markerColor:n.markerColor??coe,strokeWidthProperty:new _i(n.strokeWidth??uoe),strokeMaterialProperty:new Kt(n.stroke??loe),fillMaterialProperty:new Kt(n.fill??foe),clampToGround:n.clampToGround??doe},Promise.resolve(o).then(function(a){return mPt(e,a,n,s,i)}).catch(function(a){throw Ms.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Eb.prototype.update=function(e){return!0};function mPt(e,t,n,i,r){let o;l(i)&&(o=Fg(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=AOe[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?Z9:null;if(l(a)){if(!l(a.properties))throw new oe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=ooe[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=gOe[u.href];if(l(f)||(f=_Oe[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=ooe[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Ms.setLoading(e,!1),e})})}var Cb=Eb;function pPt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Ln=pPt;var FMe=Qo(zoe(),1);var BMe;typeof DOMParser<"u"&&(BMe=new DOMParser);var IRt=new FMe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),A7=32,IMe=2414016,PMe=1,DMe=16093e3,RMe=.1,PRt=[null,void 0,"http://www.topografix.com/GPX/1/1"],to={gpx:PRt};function DRt(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 Voe(e,t){let n=zU(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function joe(e){let t=OMe(e,"lon"),n=OMe(e,"lat"),i=kU(e,"ele",to.gpx);return h.fromDegrees(t,n,i)}function OMe(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 zU(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function wb(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Hoe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function kU(e,t,n){let i=wb(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function lf(e,t,n){let i=wb(e,t,n);if(l(i))return i.textContent.trim()}function kMe(e){let t=new fl;return t.width=A7,t.height=A7,t.scaleByDistance=new qt(IMe,PMe,DMe,RMe),t.pixelOffsetScaleByDistance=new qt(IMe,PMe,DMe,RMe),t.verticalOrigin=new _i(Gn.BOTTOM),t.image=e,t}function RRt(){let e=new mm;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Hi.LEFT,e.font="16px sans-serif",e.style=xo.FILL_AND_OUTLINE,e}function UMe(e){let t=new dl;return t.width=4,t.material=new ab,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var MMe={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"}},UU;typeof document<"u"&&(UU=document.createElement("div"));function Goe(e,t){let n,i="",r=Object.keys(MMe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=MMe[f];d.value=lf(e,d.tag,to.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=IRt.link(i),UU.innerHTML=i;let s=UU.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${UU.innerHTML}</div>`,UU.innerHTML="",u}function zMe(e,t,n,i){let r=joe(t),o=Voe(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,A7);o.billboard=kMe(s);let a=lf(t,"name",to.gpx);o.name=a,o.label=RRt(),o.label.text=a,o.description=Goe(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function ORt(e,t,n,i){let r=Voe(t,n);r.description=Goe(t,r);let o=Hoe(t,"rtept",to.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)zMe(e,o[a],n,i),s[a]=joe(o[a]);r.polyline=UMe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function MRt(e,t,n,i){let r=Voe(t,n);r.description=Goe(t,r);let o=Hoe(t,"trkseg",to.gpx),s=[],a=[],c,u=!0,f=new yc;for(let d=0;d<o.length;d++)c=NRt(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,A7);r.billboard=kMe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new vs,r.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}r.polyline=UMe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function NRt(e){let t={positions:[],times:[]},n=Hoe(e,"trkpt",to.gpx),i;for(let r=0;r<n.length;r++){let o=joe(n[r]);t.positions.push(o),i=lf(n[r],"time",to.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function LRt(e){let t=wb(e,"metadata",to.gpx);if(l(t)){let n={name:lf(t,"name",to.gpx),desc:lf(t,"desc",to.gpx),author:FRt(t),copyright:kRt(t),link:VMe(t),time:lf(t,"time",to.gpx),keywords:lf(t,"keywords",to.gpx),bounds:URt(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=wb(e,"author",to.gpx);if(l(t)){let n={name:lf(t,"name",to.gpx),email:BRt(t),link:VMe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function BRt(e){let t=wb(e,"email",to.gpx);if(l(t)){let n=lf(t,"id",to.gpx),i=lf(t,"domain",to.gpx);return`${n}@${i}`}}function VMe(e){let t=wb(e,"link",to.gpx);if(l(t)){let n={href:zU(t,"href"),text:lf(t,"text",to.gpx),mimeType:lf(t,"type",to.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function kRt(e){let t=wb(e,"copyright",to.gpx);if(l(t)){let n={author:zU(t,"author"),year:lf(t,"year",to.gpx),license:lf(t,"license",to.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function URt(e){let t=wb(e,"bounds",to.gpx);if(l(t)){let n={minLat:kU(t,"minlat",to.gpx),maxLat:kU(t,"maxlat",to.gpx),minLon:kU(t,"minlon",to.gpx),maxLon:kU(t,"maxlon",to.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var NMe={wpt:zMe,rte:ORt,trk:MRt};function zRt(e,t,n,i){let r=Object.keys(NMe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=NMe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&to.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function LMe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=zU(r,"version"),s=zU(r,"creator"),a,c=LRt(r);l(c)&&(a=c.name),r.localName==="gpx"?zRt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,nt.MINIMUM_VALUE),m=K.equals(p,nt.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new jm,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=As.LOOP_STOP,u.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),VRt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Ms.setLoading(e,!1),e}function VRt(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 jRt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?DRt(o).then(function(s){let a,c;try{a=BMe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new oe(u)}return LMe(e,a,i)}):LMe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function mP(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Ka(this),this._entityCluster=new ed,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new zg}mP.load=function(e,t){return new mP().load(e,t)};Object.defineProperties(mP.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}}});mP.prototype.update=function(e){return!0};mP.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Ms.setLoading(this,!0);let n=this._name,i=this;return jRt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,nt.MINIMUM_VALUE),u=K.equals(a,nt.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=K.fromDate(d)),r=new jm,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=As.LOOP_STOP,r.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Ms.setLoading(i,!1),i}).catch(function(r){return Ms.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var VU=mP;function HRt(e,t){this.position=e,this.headingPitchRoll=t}var jU=HRt;var QMe=Qo(zoe(),1),YU=Qo(Tf(),1);function GRt(e,t){this.position=e,this.headingPitchRange=t}var HU=GRt;function b7(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=[]}b7.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};b7.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;HMe.call(this,e,t,function(i){n.playlistIndex=0,i||jMe(n._activeEntries),n.tourEnd.raiseEvent(i)})};b7.prototype.stop=function(){jMe(this._activeEntries)};function jMe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function HMe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=WRt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function WRt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,HMe.call(this,e,t,n)}}var GU=b7;function x7(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}x7.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ce(this.view.position);t.flyToBoundingSphere(r,i)}};x7.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};x7.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=xs.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=Ot(t,e)),t};var WU=x7;function Woe(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Woe.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Woe.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var qU=Woe;var eNe={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=ig(t),eNe[t]}},tse;typeof DOMParser<"u"&&(tse=new DOMParser);var qRt=new QMe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Ib=32,GMe=2414016,WMe=1,qMe=16093e3,YMe=.1,XMe=[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"],KMe=["http://www.google.com/kml/ext/2.2"],YRt=["http://www.w3.org/2005/Atom"],Ve={kml:XMe,gx:KMe,atom:YRt,kmlgx:XMe.concat(KMe)},nse={Document:uNe,Folder:dOt,Placemark:hOt,NetworkLink:TOt,GroundOverlay:AOt,PhotoOverlay:hNe,ScreenOverlay:yOt,Tour:pOt},$oe=class{constructor(t){this._dataSource=t,this._deferred=Iu(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=oy._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=oy._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=nse[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||oy._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function XRt(e){let t=e.slice(0,Math.min(4,e.size)),n=Iu(),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 KRt(e){let t=Iu(),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 tNe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function nNe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function $Rt(e,t){let n=await e.getData(new _U);n=tNe(n),n=nNe(n),t.kml=tse.parseFromString(n,"application/xml")}async function qoe(e,t){let n=eNe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new pU(n));t[e.filename]=i}function fd(e,t,n,i){let r=i.keys,o=new YU.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new YU.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function dd(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=ise(a,i);l(c)&&s.setAttribute(n,c.url)}}function iNe(e,t,n){let i=Da(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new Qr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new ese),r}function XU(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function v7(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function T7(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=v7(n[s],t);return r}function Pb(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 Da(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ar(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function $Me(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function op(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Si(e,t,n){let i=ar(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Fn(e,t,n){let i=ar(e,t,n);if(l(i))return i.textContent.trim()}function sp(e,t,n){let i=ar(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function ise(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new YU.default(t.getUrlComponent()),s=new YU.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var uf={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Joe(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,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(uf.maximumRed=o,uf.red=void 0):(uf.maximumRed=void 0,uf.red=0),r>0?(uf.maximumGreen=r,uf.green=void 0):(uf.maximumGreen=void 0,uf.green=0),i>0?(uf.maximumBlue=i,uf.blue=void 0):(uf.maximumBlue=void 0,uf.blue=0),uf.alpha=n,z.fromRandom(uf)):new z(o,r,i,n)}function sC(e,t,n){let i=Fn(e,t,n);if(l(i))return Joe(i,Fn(e,"colorMode",n)==="random")}function JRt(e){let t=ar(e,"TimeStamp",Ve.kmlgx),n=Fn(t,"when",Ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new vs;return r.addInterval(new Cn({start:i,stop:nt.MAXIMUM_VALUE})),r}function ZRt(e){let t=ar(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=ar(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=ar(t,"end",Ve.kmlgx),s=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(K.lessThan(s,r)){let a=r;r=s,s=a}n=new vs,n.addInterval(new Cn({start:r,stop:s}))}else l(r)?(n=new vs,n.addInterval(new Cn({start:r,stop:nt.MAXIMUM_VALUE}))):l(s)&&(n=new vs,n.addInterval(new Cn({start:nt.MINIMUM_VALUE,stop:s})));return n}function rNe(){let e=new fl;return e.width=Ib,e.height=Ib,e.scaleByDistance=new qt(GMe,WMe,qMe,YMe),e.pixelOffsetScaleByDistance=new qt(GMe,WMe,qMe,YMe),e}function rse(){let e=new pm;return e.outline=!0,e.outlineColor=z.WHITE,e}function oNe(){let e=new mm;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Hi.LEFT,e.font="16px sans-serif",e.style=xo.FILL_AND_OUTLINE,e}function ose(e,t,n,i,r){let o=Fn(e,"href",Ve.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=Si(e,"x",Ve.gx)??0,u=Si(e,"y",Ve.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=ise(o,n,i);if(r){let a=Fn(e,"refreshMode",Ve.kml),c=Fn(e,"viewRefreshMode",Ve.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 u=Fn(e,"viewBoundScale",Ve.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Fn(e,"viewFormat",Ve.kml)??f,p=Fn(e,"httpQuery",Ve.kml);l(d)&&s.setQueryParameters(Ef(C7(d))),l(p)&&s.setQueryParameters(Ef(C7(p)));let g=t._ellipsoid;return ase(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function QRt(e,t,n,i,r){let o=Si(t,"scale",Ve.kml),s=Si(t,"heading",Ve.kml),a=sC(t,"color",Ve.kml),c=ar(t,"Icon",Ve.kml),u=ose(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=Si(c,"x",Ve.gx),d=Si(c,"y",Ve.gx),p=Si(c,"w",Ve.gx),g=Si(c,"h",Ve.gx),m=ar(t,"hotSpot",Ve.kml),y=Pb(m,"x"),A=Pb(m,"y"),b=Da(m,"xunits"),x=Da(m,"yunits"),T=n.billboard;l(T)||(T=rNe(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new et(f,d,p,g)),l(s)&&s!==0&&(T.rotation=D.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=o??1;let E,v;l(y)&&(b==="pixels"?E=-y*o:b==="insetPixels"?E=(y-Ib)*o:b==="fraction"&&(E=-y*Ib*o),E+=Ib*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+Ib)*o:x==="fraction"&&(v=A*Ib*o),v-=Ib*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function E7(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")QRt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=oNe(),n.label=c),c.scale=Si(a,"scale",Ve.kml)??c.scale,c.fillColor=sC(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new dl,n.polyline=c),c.width=Si(a,"width",Ve.kml),c.material=sC(a,"color",Ve.kml),l(sC(a,"outerColor",Ve.gx))&&_t("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Si(a,"outerWidth",Ve.gx))&&_t("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Si(a,"physicalWidth",Ve.gx))&&_t("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(sp(a,"labelVisibility",Ve.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=rse(),n.polygon=c),c.material=sC(a,"color",Ve.kml)??c.material,c.fill=sp(a,"fill",Ve.kml)??c.fill,c.outline=sp(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Joe(Fn(a,"bgColor",Ve.kml))??z.WHITE,u=Joe(Fn(a,"textColor",Ve.kml))??z.BLACK,f=Fn(a,"text",Ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Fn(a,"listItemType",Ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&_t(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function eOt(e,t,n,i,r){let o=new Qr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")E7(e,d,o,i,r);else{let p=op(d,"Pair",Ve.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Fn(m,"key",Ve.kml);if(y==="normal"){let A=Fn(m,"styleUrl",Ve.kml);if(l(A))s=n.getById(A),l(s)||(s=n.getById(`#${A}`)),l(s)&&o.merge(s);else{let b=ar(m,"Style",Ve.kml);E7(e,b,o,i,r)}}else _t(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Fn(t,"styleUrl",Ve.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function tOt(e,t,n){return t.fetchXML().then(function(i){return sNe(e,i,n,t,!0)})}function sNe(e,t,n,i,r,o){let s,a,c,u,f=$Me(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Da(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Qr({id:a}),n.add(c),E7(e,u,c,i,o)))}let d=$Me(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=Da(A,"id"),l(a)){let b=op(A,"Pair",Ve.kml);for(let x=0;x<b.length;x++){let T=b[x],E=Fn(T,"key",Ve.kml);if(E==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Fn(T,"styleUrl",Ve.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let S=n.getById(v);l(S)&&c.merge(S)}else u=ar(T,"Style",Ve.kml),E7(e,u,c,i,o)}}else _t(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(tOt(e,x,n))}}}return p}function sse(e,t,n){let i=new V_(e,t.id,["position"]),r=new x0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new dl,t.polyline.positions=new z_([i,r])}function aNe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(_t("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(_t("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.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.`),We.CLAMP_TO_GROUND)}function nOt(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: ${t??n}`),new x0(e))}function iOt(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: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function S7(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():oNe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():rNe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64),l(o.scale)){let s=o.scale.getValue();s!==0?r.pixelOffset=new U(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function cNe(e,t){let n=e.path;l(n)||(n=new Qg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function rOt(e,t,n,i,r){let o=Fn(n,"coordinates",Ve.kml),s=Fn(n,"altitudeMode",Ve.kml),a=Fn(n,"altitudeMode",Ve.gx),c=sp(n,"extrude",Ve.kml),u=e._ellipsoid,f=v7(o,u);return i.position=f,S7(e,i,r,aNe(s,a)),c&&XU(s,a)&&sse(t,i,r),!0}function JMe(e,t,n,i,r){let o=ar(n,"coordinates",Ve.kml),s=Fn(n,"altitudeMode",Ve.kml),a=Fn(n,"altitudeMode",Ve.gx),c=sp(n,"extrude",Ve.kml),u=sp(n,"tessellate",Ve.kml),f=XU(s,a),d=Si(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=T7(o,p),m=r.polyline;if(f&&c){let y=new e_;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:z.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let y=new dl;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(nt.MINIMUM_VALUE):z.WHITE,y.width=m.width??1):(y.material=z.WHITE,y.width=1),y.zIndex=d}else l(d)&&_t("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&_t("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new dl,i.polyline=m,m.positions=iOt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function oOt(e,t,n,i,r){let o=ar(n,"outerBoundaryIs",Ve.kml),s=ar(o,"LinearRing",Ve.kml),a=ar(s,"coordinates",Ve.kml),c=e._ellipsoid,u=T7(a,c),f=sp(n,"extrude",Ve.kml),d=Fn(n,"altitudeMode",Ve.kml),p=Fn(n,"altitudeMode",Ve.gx),g=XU(d,p),m=l(r.polygon)?r.polygon.clone():rse(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:z.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Lc(u),b=op(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=op(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=ar(s[T],"coordinates",Ve.kml),u=T7(a,c),l(u)&&A.holes.push(new Lc(u))}m.hierarchy=A}return!0}function sOt(e,t,n,i,r){let o=Fn(n,"altitudeMode",Ve.kml),s=Fn(n,"altitudeMode",Ve.gx),a=op(n,"coord",Ve.gx),c=op(n,"angles",Ve.gx),u=op(n,"when",Ve.kml),f=sp(n,"extrude",Ve.kml),d=XU(o,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,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=v7(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new yc;return A.addSamples(y,m),i.position=A,S7(e,i,r,aNe(o,s)),cNe(i,r),i.availability=new vs,u.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),d&&f&&sse(t,i,r),!0}function ZMe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new yc;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:nOt(d,s,a)})),i.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function aOt(e,t,n,i,r){let o=sp(n,"interpolate",Ve.gx),s=op(n,"Track",Ve.gx),a,c,u,f=!1,d=new H_,p=new vs,g=new _c,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=op(b,"when",Ve.kml),T=op(b,"coord",Ve.gx),E=Fn(b,"altitudeMode",Ve.kml),v=Fn(b,"altitudeMode",Ve.gx),S=XU(E,v),I=sp(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=v7(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&ZMe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),ZMe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,S7(e,i,r),cNe(i,r),f&&(sse(t,i,r),i.polyline.show=d),!0}var lNe={Point:rOt,LineString:JMe,LinearRing:JMe,Polygon:oOt,Track:sOt,MultiTrack:aOt,MultiGeometry:cOt,Model:lOt};function cOt(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=lNe[f.localName];if(l(d)){let p=iNe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function lOt(e,t,n,i,r){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function uOt(e,t){let n=ar(e,"ExtendedData",Ve.kml);if(!l(n))return;l(ar(n,"SchemaData",Ve.kml))&&_t("kml-schemaData","KML - SchemaData is unsupported"),l(Da(n,"xmlns:prefix"))&&_t("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=op(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Da(a,"name");l(c)&&(i[c]={displayName:Fn(a,"displayName",Ve.kml),value:Fn(a,"value",Ve.kml)})}}t.kml.extendedData=i}var jr;typeof document<"u"&&(jr=document.createElement("div"));function fOt(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Fn(e,"description",Ve.kml),d=t.balloonStyle??n.balloonStyle,p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=d.bgColor??z.WHITE,g=d.textColor??z.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],E=T.substr(2,T.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),y=u[E],l(y)&&(y=v?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=qRt.link(m),jr.innerHTML=m;let A=jr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(fd(jr,"a","href",i),fd(jr,"link","href",i),fd(jr,"area","href",i),fd(jr,"img","src",i),fd(jr,"iframe","src",i),fd(jr,"video","src",i),fd(jr,"audio","src",i),fd(jr,"source","src",i),fd(jr,"track","src",i),fd(jr,"input","src",i),fd(jr,"embed","src",i),fd(jr,"script","src",i),fd(jr,"video","poster",i)),dd(jr,"a","href",r),dd(jr,"link","href",r),dd(jr,"area","href",r),dd(jr,"img","src",r),dd(jr,"iframe","src",r),dd(jr,"video","src",r),dd(jr,"audio","src",r),dd(jr,"source","src",r),dd(jr,"track","src",r),dd(jr,"input","src",r),dd(jr,"embed","src",r),dd(jr,"script","src",r),dd(jr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${jr.innerHTML}</div>`,jr.innerHTML="",t.description=b}function w7(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=iNe(t,i,n.context),c=a.kml,u=eOt(e,t,n.styleCollection,o,s),f=Fn(t,"name",Ve.kml);a.name=f,a.parent=r;let d=ZRt(t);l(d)||(d=JRt(t)),a.availability=d,cse(a);function p(T){return T?T.show&&p(T.parent):!0}let g=sp(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=ar(t,"author",Ve.atom),y=c.author;y.name=Fn(m,"name",Ve.atom),y.uri=Fn(m,"uri",Ve.atom),y.email=Fn(m,"email",Ve.atom);let A=ar(t,"link",Ve.atom),b=c.link;b.href=Da(A,"href"),b.hreflang=Da(A,"hreflang"),b.rel=Da(A,"rel"),b.type=Da(A,"type"),b.title=Da(A,"title"),b.length=Da(A,"length"),c.address=Fn(t,"address",Ve.kml),c.phoneNumber=Fn(t,"phoneNumber",Ve.kml),c.snippet=Fn(t,"Snippet",Ve.kml),uOt(t,a),fOt(t,a,u,s,o);let x=e._ellipsoid;return dNe(t,a,x),fNe(t,a,x),l(ar(t,"Region",Ve.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function uNe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function dOt(e,t,n,i){let r=w7(e,t,n),o=Je(n);o.parentEntity=r.entity,uNe(e,t,o,i)}function hOt(e,t,n,i){let r=w7(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=lNe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),S7(e,o,s))}var mOt={FlyTo:_Ot,Wait:gOt,SoundCue:Yoe,AnimatedUpdate:Yoe,TourControl:Yoe};function pOt(e,t,n,i){let r=Fn(t,"name",Ve.kml),o=Da(t,"id"),s=new GU(r,o),a=ar(t,"Playlist",Ve.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=mOt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function Yoe(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function gOt(e,t){let n=Si(t,"duration",Ve.gx);e.addPlaylistEntry(new qU(n))}function _Ot(e,t,n){let i=Si(t,"duration",Ve.gx),r=Fn(t,"flyToMode",Ve.gx),o={kml:{}};dNe(t,o,n),fNe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new WU(i,r,s);e.addPlaylistEntry(a)}function fNe(e,t,n){let i=ar(e,"Camera",Ve.kml);if(l(i)){let r=Si(i,"longitude",Ve.kml)??0,o=Si(i,"latitude",Ve.kml)??0,s=Si(i,"altitude",Ve.kml)??0,a=Si(i,"heading",Ve.kml)??0,c=Si(i,"tilt",Ve.kml)??0,u=Si(i,"roll",Ve.kml)??0,f=h.fromDegrees(r,o,s,n),d=wc.fromDegrees(a,c-90,u);t.kml.camera=new jU(f,d)}}function dNe(e,t,n){let i=ar(e,"LookAt",Ve.kml);if(l(i)){let r=Si(i,"longitude",Ve.kml)??0,o=Si(i,"latitude",Ve.kml)??0,s=Si(i,"altitude",Ve.kml)??0,a=Si(i,"heading",Ve.kml),c=Si(i,"tilt",Ve.kml),u=Si(i,"range",Ve.kml)??0;c=D.toRadians(c??0),a=D.toRadians(a??0);let f=new Hd(a,c-D.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new HU(d,f)}}function yOt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=ar(t,"Icon",Ve.kml),c=ose(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=ar(t,"screenXY",Ve.kml),p=ar(t,"overlayXY",Ve.kml),g=ar(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=Pb(g,"x"),y=Pb(g,"y"),A=Da(g,"xunits"),b=Da(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=Pb(p,"x"),y=Pb(p,"y"),A=Da(p,"xunits"),b=Da(p,"yunits"),l(m)&&(A==="fraction"?E=m*u.width:(A==="pixels"||A==="insetPixels")&&(E=m)),l(y)&&(b==="fraction"?v=y*u.height:(b==="pixels"||b==="insetPixels")&&(v=y))),l(d)&&(m=Pb(d,"x"),y=Pb(d,"y"),A=Da(d,"xunits"),b=Da(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${E}px)`:A==="pixels"?x=`left: ${m-E}px`:A==="insetPixels"&&(x=`right: ${m-E}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:b==="pixels"?T=`bottom: ${y-v}px`:b==="insetPixels"&&(T=`top: ${y-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function AOt(e,t,n,i){let o=w7(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=T7(ar(t,"LatLonQuad",Ve.gx),c),f=Si(t,"drawOrder",Ve.kml);if(l(u))s=rse(),s.hierarchy=new Lc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new gm,s.zIndex=f,o.rectangle=s;let m=ar(t,"LatLonBox",Ve.kml);if(l(m)){let y=Si(m,"west",Ve.kml),A=Si(m,"south",Ve.kml),b=Si(m,"east",Ve.kml),x=Si(m,"north",Ve.kml);l(y)&&(y=D.negativePiToPi(D.toRadians(y))),l(A)&&(A=D.clampToLatitudeRange(D.toRadians(A))),l(b)&&(b=D.negativePiToPi(D.toRadians(b))),l(x)&&(x=D.clampToLatitudeRange(D.toRadians(x))),s.coordinates=new ie(y,A,b,x);let T=Si(m,"rotation",Ve.kml);if(l(T)){let E=D.toRadians(T);s.rotation=E,s.stRotation=E}}}let d=ar(t,"Icon",Ve.kml),p=ose(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&_t("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Si(d,"x",Ve.gx),y=Si(d,"y",Ve.gx),A=Si(d,"w",Ve.gx),b=Si(d,"h",Ve.gx);(l(m)||l(y)||l(A)||l(b))&&_t("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=sC(t,"color",Ve.kml),s.material.transparent=!0}else s.material=sC(t,"color",Ve.kml);let g=Fn(t,"altitudeMode",Ve.kml);l(g)?g==="absolute"?(s.height=Si(t,"altitude",Ve.kml),s.zIndex=void 0):g!=="clampToGround"&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Fn(t,"altitudeMode",Ve.gx),g==="relativeToSeaFloor"?(_t("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Si(t,"altitude",Ve.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 hNe(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 Db={INTERVAL:0,EXPIRE:1,STOP:2};function C7(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var bOt=new ie,pP=new he,Xoe=new U,xOt=new h;function ase(e,t,n,i,r,o){function s(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function a(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=nx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??bOt,l(n)&&(Xoe.x=n.clientWidth*.5,Xoe.y=n.clientHeight*.5,u=t.pickEllipsoid(Xoe,o,xOt)),l(u)?f=o.cartesianToCartographic(u,pP):(f=ie.center(r,pP),u=o.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(a(f.longitude-b),s(f.latitude-x),a(f.longitude+b),s(f.latitude+x))}c=c.replace("[bboxWest]",D.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(r.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,pP),c=c.replace("[cameraLon]",D.toDegrees(pP.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(pP.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(pP.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=D.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.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(Ef(c))}function TOt(e,t,n,i){let o=w7(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=ar(t,"Link",Ve.kml);if(l(c)||(c=ar(t,"Url",Ve.kml)),l(c)){let u=Fn(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=ise(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Fn(c,"viewRefreshMode",Ve.kml),f==="onRegion"){_t("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Fn(c,"viewBoundScale",Ve.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Fn(c,"viewFormat",Ve.kml)??A,x=Fn(c,"httpQuery",Ve.kml);l(b)&&u.setQueryParameters(Ef(C7(b))),l(x)&&u.setQueryParameters(Ef(C7(x)));let T=e._ellipsoid;ase(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Ka,y=Qoe(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let v=0;v<x.length;v++){let S=x[v];l(S.parent)||(S.parent=o,cse(S)),b.add(S)}b.resumeEvents();let T=Fn(c,"refreshMode",Ve.kml),E=Si(c,"refreshInterval",Ve.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let v=ar(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Ef(Fn(v,"cookie",Ve.kml)??""),O=Si(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=Db.INTERVAL,R.time=E;else if(T==="onExpire"){let L;if(S&&(L=Fn(v,"expires",Ve.kml)),l(L))try{let _=K.fromIso8601(L),C=K.secondsDifference(_,I);C>0&&C<O&&K.addSeconds(I,O,_),R.refreshMode=Db.EXPIRE,R.time=_}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)?(R.refreshMode=Db.STOP,R.time=Si(c,"viewRefreshTime",Ve.kml)??0):_t("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){_t(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function EOt(e,t,n,i){let r=nse[t.localName];return l(r)?r(e,t,n,i):hNe(e,t,n,i)}function Zoe(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:ar(a,"Document",Ve.kml),u=Fn(c,"name",Ve.kml);l(u)||(u=Fg(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new oy._DeferredLoading(e),d=new Ka(e);return Promise.all(sNe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(nse[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),EOt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function COt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");eU({workerURI:o,wasmURI:s});let a=new YE(new sf(n)),c=await a.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(qoe(d,f)),d=g):u.push(qoe(g,f)))}if(l(d)&&u.push($Rt(d,f)),await Promise.all(u),a.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),Zoe(e,t,f.kml,i,f,r)}function Qoe(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(a)&&(a=Ln(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?XRt(u).then(function(f){return f?COt(e,t,u,r,a):KRt(u).then(function(d){d=tNe(d),d=nNe(d);let p,g;try{p=tse.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return Zoe(e,t,p,r,o,a,s)})}):Zoe(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var oy=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.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 Ka(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new zg,this._networkLinks=new Ut,this._entityCluster=new ed,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ee.default;let r=t.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,Ms.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Qoe(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,nt.MINIMUM_VALUE),f=K.equals(c,nt.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),a=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new jm,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=As.LOOP_STOP,o.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,a)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),Ms.setLoading(r,!1),r}).catch(function(o){return Ms.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;Koe.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];Koe.set(y.id,y),o(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,D.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,D.EPSILON7)&&c.upWC.equalsEpsilon(a.up,D.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let u=new Ut,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!Koe.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===Db.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===Db.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===Db.STOP&&(s&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new Ka,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;ase(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Qoe(r,m,y,{context:p.id}).then(vOt(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function cse(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 vOt(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=ar(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(ar(a,"Update",Ve.kml))){_t("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ef(Fn(a,"cookie",Ve.kml)??""),u=Si(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===Db.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===Db.EXPIRE){let I;if(l(a)&&(I=Fn(a,"expires",Ve.kml)),l(I))try{let R=K.fromIso8601(I),O=K.secondsDifference(R,f);O>0&&O<u&&K.addSeconds(f,u,R),t.time=R}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,m=n.values;function y(I){g.remove(I);let R=I._children,O=R.length;for(let L=0;L<O;++L)y(R[L])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let I=A[b];I.parent===p&&(I.parent=void 0,y(I))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let I=m[b];l(I.parent)||(I.parent=p,cse(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,E=x.stop,v=K.equals(T,nt.MINIMUM_VALUE),S=K.equals(E,nt.MAXIMUM_VALUE);if(!v||!S){let I=e._clock;(I.startTime!==T||I.stopTime!==E)&&(I.startTime=T,I.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Koe=new Ut,ese=class{constructor(){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}};oy._DeferredLoading=$oe;oy._getTimestamp=xn;var aC=oy;function KU(){pe.throwInstantiationError()}KU.prototype.update=pe.throwInstantiationError;KU.prototype.getBoundingSphere=pe.throwInstantiationError;KU.prototype.isDestroyed=pe.throwInstantiationError;KU.prototype.destroy=pe.throwInstantiationError;var lse=KU;async function use(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;let a=n.availability;if(!l(a)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await use._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}use._sampleTerrainMostDetailed=aT;var cC=use;var $U=`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 -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; +#ifdef APPLY_DAY_NIGHT_ALPHA +uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; +uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; #endif -return; -} -discard; -} -`;var YF=`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)); +#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 +#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; +#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); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +#endif +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { -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; +return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +#endif +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() { -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 +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) { -return 0.5 / GGX; +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; +if (split < 0.0 && gl_FragCoord.x > splitPosition) { +alpha = 0.0; } -return 0.0; +else if (split > 0.0 && gl_FragCoord.x < splitPosition) { +alpha = 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++) +#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; +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() { -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 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) { -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; +direction = vec3(0.0, 0.0, -1.0); } +else +{ +direction = normalize(vec3(xy, -czm_currentFrustum.x)); } -return vec2(A, B) / float(NumSamples); +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() { -out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;var XF=`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); +#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; } -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; -} -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); -} -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; -} -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; -} -vec2 phaseShift2D(vec2 p, vec2 freq) { -return (czm_pi / 2.0) * sin(freq.yx * p.yx); +#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)); +vec3 normalEC = czm_normal3D * normalMC; +#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 +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); } -vec2 phaseShift3D(vec3 p, vec2 freq) { -return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +#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; } -const float T0 = 0.6; -const float k = 0.1; -const float C0 = 0.8; -const float FX0 = 0.6; -const float FY0 = 0.6; -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); +else if (czm_sceneMode == czm_sceneModeColumbusView) +{ +cameraDist = -czm_view[3].z; } -return k * sum.x * sum.y; +else +{ +cameraDist = length(czm_view[3]); } -const float a = 0.5; -const float t = 0.4; -const float s = 0.25; -float I(float Id, float Is, float It) { -return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +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; } -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 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); } -float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); -float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); -float It = T(cloudPoint); -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; -float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); -float TR = pow(ndDot, 3.0) - W; -TR *= 1.3; -float minusDot = 0.5 - ndDot; -TR -= min(minusDot * W2, 0.0); -TR -= 0.8 * (minusDot + 0.25) * W3; -float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); -shading = clamp(shading + 0.2, 0.3, 1.0); -vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); -return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +#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; } -void main() { -#ifdef DEBUG_BILLBOARDS -out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); #endif -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; +#ifdef ENABLE_CLIPPING_POLYGONS +bool insideAny = vectorClip(v_textureCoordinates.xy); +#ifdef CLIPPING_INVERSE +if (!insideAny) { +discard; } #else -#ifndef DEBUG_BILLBOARDS -vec4 cloud = drawCloud(rayOrigin, rayDir, -ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); -if(cloud.w < 0.01) { +if (insideAny) { discard; } -out_FragColor = cloud; #endif #endif -} -`;var KF=`#ifdef INSTANCED -in vec2 direction; +#ifdef HIGHLIGHT_FILL_TILE +finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); #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() { -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; +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; #else -vec2 dir = coordinates; +vec3 atmosphereLightDirection = czm_lightDirectionWC; #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 $F=`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)); -} -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 ZF=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; -out vec2 v_position; -void main() +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +if (!czm_backFacing()) { -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; +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; +#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); +#ifdef FOG +vec3 fogColor = groundAtmosphereColor.rgb; +#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 +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 } -`;var QF=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; -in vec2 v_textureCoordinates; -void main() +#endif +#ifdef UNDERGROUND_COLOR +if (czm_backFacing()) { -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); +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); } -`;var JF=`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) +#ifdef HAS_VECTOR_LAYER +finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); +finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); +#endif +#ifdef TRANSLUCENT +if (inTranslucencyRectangle()) { -out_FragColor.a = 1.0; +vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; +finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); } +#endif +out_FragColor = finalColor; } -`;var e2=`in vec4 positionEC; -void main() -{ -vec3 position; -vec3 direction; -if (czm_orthographicIn3D == 1.0) +#ifdef SHOW_REFLECTIVE_OCEAN +float waveFade(float edge0, float edge1, float x) { -vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; -vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); -vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); -position = vec3(mix(minPlane, maxPlane, uv), 0.0); -direction = vec3(0.0, 0.0, -1.0); +float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +return pow(1.0 - y, 5.0); } -else +float linearFade(float edge0, float edge1, float x) { -position = vec3(0.0); -direction = normalize(positionEC.xyz); +return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); } -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)) +const float oceanFrequencyLowAltitude = 825000.0; +const float oceanAnimationSpeedLowAltitude = 0.004; +const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; +const float oceanSpecularIntensity = 0.5; +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) { -out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); -} -else -{ -discard; +vec3 positionToEyeEC = -positionEyeCoordinates; +float positionToEyeECLength = length(positionToEyeEC); +vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); +float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); +#ifdef SHOW_OCEAN_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); +time = czm_frameNumber * oceanAnimationSpeedLowAltitude; +noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); +vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); +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); +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); +float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; +vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); +#ifdef SHOW_OCEAN_WAVES +float tsPerturbationRatio = normalTangentSpace.z; +vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); +#else +vec3 nonDiffuseHighlight = vec3(0.0); +#endif +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); } -czm_writeLogDepth(); +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var JU=`#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; +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 +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); } -`;var t2=`in vec4 position; -out vec4 positionEC; -void main() +float get2DMercatorYPositionFraction(vec2 textureCoordinates) { -positionEC = czm_modelView * position; -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); +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); } -`;var ew=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; -in vec3 v_positionEC; -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +return positionFraction; +} +float get2DGeographicYPositionFraction(vec2 textureCoordinates) { -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; -vec3 normalEC = normalize(czm_normal * normalMC); -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 +return textureCoordinates.y; } -void main() +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) { -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; +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; } -if (t1 < 0.0 && t2 < 0.0) { -discard; +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, 0.0, textureCoordinates); } -float t = min(t1, t2); -if (t < 0.0) { -t = 0.0; +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, height, textureCoordinates); } -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)) +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) { -discard; +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); +vec4 morphPositionEC = czm_modelView * morphPosition; +return czm_projection * morphPositionEC; } -vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); -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 +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; #endif -} -`;var tw=`in vec3 position; -uniform vec3 u_radii; -out vec3 v_positionEC; void main() { -vec4 p = vec4(u_radii * position, 1.0); -v_positionEC = (czm_modelView * p).xyz; -gl_Position = czm_modelViewProjection * p; -gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); -czm_vertexLogDepth(); -} -`;/** - * @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 n2=`#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 +#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) || defined(APPLY_MATERIAL) +float webMercatorT = textureCoordinates.y; +float encodedNormal = compressed0.w; +#else +float webMercatorT = textureCoordinates.y; +float encodedNormal = 0.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 +#else +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 -#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 +vec3 position3DWC = position + u_center3D; +#ifdef GEODETIC_SURFACE_NORMALS +vec3 ellipsoidNormal = geodeticSurfaceNormal; +#else +vec3 ellipsoidNormal = normalize(position3DWC); #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 +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) +float exaggeration = u_verticalExaggerationAndRelativeHeight.x; +float relativeHeight = u_verticalExaggerationAndRelativeHeight.y; +float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; +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 -#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 +gl_Position = getPosition(position, height, textureCoordinates); +v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; +v_positionMC = position3DWC; +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 -#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 +v_normalMC = normalMC; +v_normalEC = czm_normal3D * v_normalMC; #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 +#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 (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 +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else +vec3 atmosphereLightDirection = czm_lightDirectionWC; #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 +vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); +computeAtmosphereScattering( +position3DWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); #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 +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); #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( -FxaaFloat2 pos, -FxaaTex tex, -FxaaFloat2 fxaaQualityRcpFrame, -FxaaFloat fxaaQualitySubpix, -FxaaFloat fxaaQualityEdgeThreshold, -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 -} +#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 } -#endif +`;var gP=`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 +); } -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 i2=`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; -#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) +`;var SOt=new U;function wOt(e,t){let n=e.unionClippingRegions,i=e.length,r=Is.useFloatTexture(t),o=Is.getTextureResolution(e,t,SOt),s=o.x,a=o.y,c=r?DOt(s,a):ROt(s,a);return c+=` +`,c+=n?IOt(i):POt(i),c}function IOt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -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); + 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; + // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6 + break; + } + } + if (breakAndDiscard) { + discard; + } + return clipAmount; } -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +`}function POt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); + 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 DOt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int pixY = clippingPlaneNumber / ${e}; + int pixX = clippingPlaneNumber - (pixY * ${e}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${o}; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); } -#endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() +`}function ROt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { -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; + int clippingPlaneStartIndex = clippingPlaneNumber * 2; + int pixY = clippingPlaneStartIndex / ${e}; + int pixX = clippingPlaneStartIndex - (pixY * ${e}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${o}; + 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 + ${r}, v))); + return czm_transformPlane(plane, transform); } -#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) +`}var lC=wOt;var fse=class{constructor(t,n,i,r,o,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=s}},dse=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,E=t.perFragmentGroundAtmosphere,v=t.hasVertexNormals,S=t.useWebMercatorProjection,I=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,L=t.enableClippingPolygons,_=t.clippingPolygons,C=t.clippedByBoundaries,w=t.hasImageryLayerCutout,P=t.colorCorrect,M=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,B=t.hasExaggeration,j=t.showUndergroundColor,k=t.translucent,G=i.vectorData,q=G?.show,Q=q&&G.hasPolylines,W=q&&G.hasPolygons,J=q&&t.vectorAntialias,Z=Q&&G.hasMeterWidths,ae=Z&&G.hasPixelWidths,Ae=0,fe="",ge=i.renderedMesh.encoding;ge.quantization===ka.BITS12&&(Ae=1,fe="QUANTIZATION_BITS12");let Se=0,Re="";C&&(Se=1,Re="TILE_LIMIT_RECTANGLE");let Qe=0,He="";w&&(Qe=1,He="APPLY_IMAGERY_CUTOUT");let Xe=n.mode,$e=((Xe|+o<<2|+s<<3|+a<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+E<<15|+v<<16|+S<<17|+I<<18|Ae<<19|+p<<20|+R<<21|+L<<22|Se<<23|Qe<<24|+P<<25|+M<<26|+F<<27|+V<<28|+B<<29|+j<<30|+k<<31)>>>0)+(d?4294967296:0)+(q?8589934592:0)+(Q?17179869184:0)+(W?34359738368:0)+(J?68719476736:0)+(Z?137438953472:0)+(ae?274877906944:0),Pe=0;l(O)&&O.length>0&&(Pe=R?O.clippingPlanesState:0);let qe=0;l(_)&&_.length>0&&(qe=L?_.clippingPolygonsState:0);let st=i.surfaceShader;if(l(st)&&st.numberOfDayTextures===r&&st.flags===$e&&st.material===this.material&&st.clippingShaderState===Pe&&st.clippingPolygonShaderState===qe)return st.shaderProgram;let vt=this._shadersByTexturesFlags[r];if(l(vt)||(vt=this._shadersByTexturesFlags[r]=[]),st=vt[$e],!l(st)||st.material!==this.material||st.clippingShaderState!==Pe||st.clippingPolygonShaderState!==qe){let Gt=this.baseVertexShaderSource.clone(),lt=this.baseFragmentShaderSource.clone();Pe!==0&<.sources.unshift(lC(O,n.context)),Gt.defines.push(fe),lt.defines.push(`TEXTURE_UNITS ${r}`,Re,He),o&<.defines.push("APPLY_BRIGHTNESS"),s&<.defines.push("APPLY_CONTRAST"),a&<.defines.push("APPLY_HUE"),c&<.defines.push("APPLY_SATURATION"),u&<.defines.push("APPLY_GAMMA"),f&<.defines.push("APPLY_ALPHA"),d&<.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&<.defines.push("HAS_WATER_MASK"),m&&(lt.defines.push("SHOW_REFLECTIVE_OCEAN"),Gt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&<.defines.push("SHOW_OCEAN_WAVES"),F&<.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(Gt.defines.push("UNDERGROUND_COLOR"),lt.defines.push("UNDERGROUND_COLOR")),k&&(Gt.defines.push("TRANSLUCENT"),lt.defines.push("TRANSLUCENT")),A&&(v?(Gt.defines.push("ENABLE_VERTEX_LIGHTING"),lt.defines.push("ENABLE_VERTEX_LIGHTING")):(Gt.defines.push("ENABLE_DAYNIGHT_SHADING"),lt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(Gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(Gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Gt.defines.push("GROUND_ATMOSPHERE"),lt.defines.push("GROUND_ATMOSPHERE"),E&&(Gt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),lt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Gt.defines.push("INCLUDE_WEB_MERCATOR_Y"),lt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Gt.defines.push("FOG"),lt.defines.push("FOG")),p&<.defines.push("APPLY_SPLIT"),R&<.defines.push("ENABLE_CLIPPING_PLANES"),L&&(lt.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&<.defines.push("CLIPPING_INVERSE")),P&<.defines.push("COLOR_CORRECT"),M&<.defines.push("HIGHLIGHT_FILL_TILE"),V&&Gt.defines.push("GEODETIC_SURFACE_NORMALS"),B&&Gt.defines.push("EXAGGERATION"),q&&(lt.defines.push("HAS_VECTOR_LAYER"),Q&<.defines.push("HAS_VECTOR_POLYLINES"),W&<.defines.push("HAS_VECTOR_POLYGONS"),J&<.defines.push("VECTOR_ANTIALIAS"),Z&<.defines.push("VECTOR_WIDTH_IN_METERS"),ae&<.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(q||L)&<.sources.unshift(g_);let mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + { + vec4 color = initialColor; +`;w&&(mt+=` vec4 cutoutAndColorResult; + bool texelUnclipped; +`);for(let Xt=0;Xt<r;++Xt)w?mt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Xt}]; + texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; + cutoutAndColorResult = sampleAndBlend( +`:mt+=` color = sampleAndBlend( +`,mt+=` color, + u_dayTextures[${Xt}], + u_dayTextureUseWebMercatorT[${Xt}] ? textureCoordinates.xz : textureCoordinates.xy, + u_dayTextureTexCoordsRectangle[${Xt}], + u_dayTextureTranslationAndScale[${Xt}], + ${f?`u_dayTextureAlpha[${Xt}]`:"1.0"}, + ${d?`u_dayTextureNightAlpha[${Xt}]`:"1.0"}, + ${d?`u_dayTextureDayAlpha[${Xt}]`:"1.0"}, + ${o?`u_dayTextureBrightness[${Xt}]`:"0.0"}, + ${s?`u_dayTextureContrast[${Xt}]`:"0.0"}, + ${a?`u_dayTextureHue[${Xt}]`:"0.0"}, + ${c?`u_dayTextureSaturation[${Xt}]`:"0.0"}, + ${u?`u_dayTextureOneOverGamma[${Xt}]`:"0.0"}, + ${p?`u_dayTextureSplit[${Xt}]`:"0.0"}, + ${F?`u_colorsToAlpha[${Xt}]`:"vec4(0.0)"}, + nightBlend); +`,w&&(mt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);mt+=` return color; + }`,lt.sources.push(mt),Gt.sources.push(OOt(Xe)),Gt.sources.push(MOt(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:Gt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[$e]=new fse(r,$e,this.material,ft,Pe,qe)}return i.surfaceShader=st,st.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return ue(this)}};function OOt(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); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function MOt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var ZU=dse;var mNe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(mNe);var Ja=mNe;var pNe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(pNe);var kr=pNe;var B0=class e{constructor(){ut(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ce,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===kr.RECEIVING||t===kr.TRANSFORMING),r=this.imagery;for(let o=0,s=r.length;i&&o<s;++o){let a=r[o];i=!l(a.loadingImagery)||a.loadingImagery.state!==Vn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,r,n,i);return h.clone(s,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(ws.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Bc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===Ja.START&&(NOt(t,n,i,r),t.state=Ja.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===Ja.LOADING&&LOt(t,n,i,r,o,s,a),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===kr.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=Ja.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,s=t.upsampledFromParent,a=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===Vn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else s=!1}let g=p.processStateMachine(t,i,r);c=c&&g,a=a||g||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===Vn.FAILED||p.loadingImagery.state===Vn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){gNe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){gNe(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,u=o.encoding,f=u.exaggeration!==s,d=u.exaggerationRelativeHeight!==a;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=s,u.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),o=n.encoding.getAttributes(r),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=tt.createIndexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new zn({context:t,attributes:o,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,s=o.width,a=o.height,c=s/r.width,u=a/r.height;return i.x=c*(o.west-r.west)/s,i.y=u*(o.south-r.south)/a,i.z=c,i.w=u,i}};function gNe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=_o.clone(s);c.hasGeodeticSurfaceNormals=t,c=_o.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(B0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=B0._createVertexArrayForMesh(i.context,r)):(B0._freeVertexArray(e.vertexArray),e.vertexArray=B0._createVertexArrayForMesh(i.context,r)),B0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function NOt(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(r=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=kr.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function LOt(e,t,n,i,r,o,s){let a=e.data,c=e.parent;if(a.terrainState===kr.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||B0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&FOt(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&BOt(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&UOt(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(zOt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,o)),a.terrainState>=kr.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)jOt(t.context,a);else{let f=a._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(a.waterMaskTexture=d.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,f,a.waterMaskTranslationAndScale))}}function FOt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=Ja.FAILED;return}let u=a.data.terrainData,f=a.x,d=a.y,p=a.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,s);l(g)&&(e.terrainState=kr.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=kr.RECEIVED)}).catch(function(){e.terrainState=kr.FAILED}))}function BOt(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=kr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ti.CANCELLED){e.terrainData=void 0,e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainState=kr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=$r.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=kr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=kr.UNLOADED,e.request=void 0)}a()}var kOt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function UOt(e,t,n,i,r,o){let s=n.tilingScheme,a=kOt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=kr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=kr.TRANSFORMED}).catch(function(){e.terrainState=kr.FAILED}))}function zOt(e,t,n,i,r,o,s){e.vertexArray=B0._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function VOt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function jOt(e,t){let n=t.terrainData.waterMask,i=VOt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Dt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var Ch=B0;var _Ne={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>=_Ne.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},hi=_Ne;function yP(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}yP.prototype.update=function(e,t,n){this.changedThisFrame&&(CNe(e,t,this.tile,n),this.changedThisFrame=!1)};yP.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};yP.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Ch._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var HOt=new iA;yP.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=HOt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);Ra(e,n,c,u,s,wn.EAST,!1,a,i),Ra(e,n,c,f,s,wn.NORTH,!1,a,i),Ra(e,n,c,d,s,wn.WEST,!1,a,i),Ra(e,n,c,p,s,wn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);Ra(e,n,c,g,s,wn.SOUTHEAST,!1,a,i),Ra(e,n,c,y,s,wn.SOUTHWEST,!1,a,i),Ra(e,n,c,m,s,wn.NORTHEAST,!1,a,i),Ra(e,n,c,A,s,wn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ra(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||hi.wasKicked(u._lastSelectionResult)||hi.originalResult(u._lastSelectionResult)===hi.CULLED);){if(s)return;let f=u.parent;if(o>=wn.NORTHWEST&&f!==void 0)switch(o){case wn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case wn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case wn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case wn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===hi.RENDERED){if(l(u.data.vertexArray))return;GOt(e,t,n,u,o,r,a,c);return}if(hi.originalResult(i._lastSelectionResult)!==hi.CULLED)switch(o){case wn.WEST:Ra(e,t,n,i.northwestChild,r,o,!0,a,c),Ra(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.EAST:Ra(e,t,n,i.southeastChild,r,o,!0,a,c),Ra(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTH:Ra(e,t,n,i.southwestChild,r,o,!0,a,c),Ra(e,t,n,i.southeastChild,r,o,!0,a,c);break;case wn.NORTH:Ra(e,t,n,i.northeastChild,r,o,!0,a,c),Ra(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHWEST:Ra(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHEAST:Ra(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTHWEST:Ra(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.SOUTHEAST:Ra(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function GOt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new yP(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),WOt(e,t,n,i,r,a)}function WOt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(CNe(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case wn.WEST:u=s.westMeshes,f=s.westTiles;break;case wn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case wn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case wn.NORTH:u=s.northMeshes,f=s.northTiles;break;case wn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case wn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case wn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case wn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case wn.WEST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.south,m.north,A));++p);break;case wn.SOUTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.east,m.west,A));++p);break;case wn.EAST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.north,m.south,A));++p);break;case wn.NORTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var uC=new he,qOt=new he,_P=new h,gse=new h,hse=new U,mse=new U,hd=new U;function N7(){this.height=0,this.encodedNormal=new U}function I7(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return vNe(e,t,n,i,u,c),c}var YOt={minimumHeight:0,maximumHeight:0},XOt=new h,yNe=new N7,ANe=new N7,bNe=new N7,xNe=new N7,KOt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,$Ot={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function CNe(e,t,n,i){Ch.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=D7(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,bNe),p=D7(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,yNe),g=D7(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,ANe),m=D7(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,xNe);d=I7(o,f,0,1,d,p,m,g,bNe),p=I7(o,f,0,0,p,d,g,m,yNe),g=I7(o,f,1,1,g,p,m,d,ANe),m=I7(o,f,1,1,m,g,d,p,xNe);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),E=Math.max(y,A,b,x),v=(T+E)*.5,S,I,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&E-T<=R){let w=new Rc({width:9,height:9,buffer:KOt,structure:{heightOffset:E}}),P=$Ot;P.tilingScheme=n.tilingScheme,P.x=n.x,P.y=n.y,P.level=n.level,P.exaggeration=a,P.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(P)}else{let w=u,P=ie.center(s,qOt);P.height=v;let M=f.cartographicToCartesian(P,XOt),F=new _o(M,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,B;for(B=o.westMeshes,S=0,I=B.length;S<I;++S)V+=B[S].eastIndicesNorthToSouth.length;for(B=o.southMeshes,S=0,I=B.length;S<I;++S)V+=B[S].northIndicesWestToEast.length;for(B=o.eastMeshes,S=0,I=B.length;S<I;++S)V+=B[S].westIndicesSouthToNorth.length;for(B=o.northMeshes,S=0,I=B.length;S<I;++S)V+=B[S].southIndicesEastToWest.length;let j=YOt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=P7(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=O7(o,f,F,G,q,o.westTiles,o.westMeshes,wn.EAST,j);let W=q;q=P7(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=O7(o,f,F,G,q,o.southTiles,o.southMeshes,wn.NORTH,j);let J=q;q=P7(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=O7(o,f,F,G,q,o.eastTiles,o.eastMeshes,wn.WEST,j);let Z=q;q=P7(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=O7(o,f,F,G,q,o.northTiles,o.northMeshes,wn.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=en.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=gi.geodeticLatitudeToMercatorAngle(s.south),fe=1/(gi.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(gi.geodeticLatitudeToMercatorAngle(P.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(uC,gse),we=cn.octEncode(ge,hse),Se=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,hd),v,we,xe,ge),++q;let Re=q,Qe=Re<256?1:2,He=(Re-1)*3,Xe=He*Qe,$e=(G.length-Re*k)*Float32Array.BYTES_PER_ELEMENT,Pe;if($e>=Xe){let mt=Re*k*Float32Array.BYTES_PER_ELEMENT;Pe=Re<256?new Uint8Array(G.buffer,mt,He):new Uint16Array(G.buffer,mt,He)}else Pe=Re<256?new Uint8Array(He):new Uint16Array(He);G=new Float32Array(G.buffer,0,Re*k);let qe=0;for(S=0;S<Re-2;++S)Pe[qe++]=Se,Pe[qe++]=S,Pe[qe++]=S+1;Pe[qe++]=Se,Pe[qe++]=S,Pe[qe]=0;let st=[];for(S=W;S>=Q;--S)st.push(S);let vt=[];for(S=J;S>=W;--S)vt.push(S);let Gt=[];for(S=Z;S>=J;--S)Gt.push(S);let lt=[];for(lt.push(0),S=Se-1;S>=Z;--S)lt.push(S);o.mesh=new lc(F.center,G,Pe,He,Re,T,E,s,ce.fromOrientedBoundingBox(ae),iMt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,Gt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Ch._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let C=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function P7(e,t,n,i,r,o,s,a,c,u,f){let d=uC;d.longitude=D.lerp(t.west,t.east,o),d.latitude=D.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,_P),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,gse));let m=mse;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var M7=new ie;function QU(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,M7),r.west-=D.TWO_PI,r.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,M7),r.west+=D.TWO_PI,r.east+=D.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);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 JOt=new U;function pse(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var ZOt=new U,QOt=new h;function eMt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=QU(t,n,f.decodeTextureCoordinates(d,r,hd),hd),g=QU(t,n,f.decodeTextureCoordinates(d,o,mse),mse),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;uC.longitude=D.lerp(b.west,b.east,s),uC.latitude=D.lerp(b.south,b.north,a),u.height=uC.height=D.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,JOt),E=f.getOctEncodedNormal(d,o,ZOt),v=cn.octDecode(T.x,T.y,_P),S=cn.octDecode(E.x,E.y,QOt);x=h.lerp(v,S,m,_P),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(uC,_P),cn.octEncode(x,u.encodedNormal)}function vNe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(uC,_P);cn.octEncode(s,o.encodedNormal)}function D7(e,t,n,i,r,o,s,a,c,u,f){if(ENe(e,t,a,s,!1,n,i,f)||ENe(e,t,u,c,!0,n,i,f))return f;let p;if(_se(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],pse(o,p,n,i,f),f;let g;if(n===0?i===0?g=R7(e.westMeshes,e.westTiles,wn.EAST,e.southMeshes,e.southTiles,wn.NORTH,n,i):g=R7(e.northMeshes,e.northTiles,wn.SOUTH,e.westMeshes,e.westTiles,wn.EAST,n,i):i===0?g=R7(e.southMeshes,e.southTiles,wn.NORTH,e.eastMeshes,e.eastTiles,wn.WEST,n,i):g=R7(e.eastMeshes,e.eastTiles,wn.WEST,e.northMeshes,e.northTiles,wn.SOUTH,n,i),l(g))return vNe(e,t,n,i,g,f),f}function R7(e,t,n,i,r,o,s,a){let c=TNe(e,t,!1,n,s,a),u=TNe(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function O7(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=tMt(e,t,n,i,r,o[u],s[u],a,c);return r}function tMt(e,t,n,i,r,o,s,a,c){let u;a===wn.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,M7),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===wn.WEST&&o.x===0&&(u=ie.clone(o.rectangle,M7),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,hd),d=hd.x,p=hd.y);let g,m;switch(a){case wn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case wn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case wn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case wn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=s.encoding,x=s.vertices,T=n.stride,E,v;b.hasWebMercatorT&&(E=gi.geodeticLatitudeToMercatorAngle(f.south),v=1/(gi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,hd);QU(y,A,R,R);let O=R.x,L=R.y,_=m?O:L;if(_<0||_>1||Math.abs(O-d)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let C=Math.abs(O)<D.EPSILON5||Math.abs(O-1)<D.EPSILON5,w=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(C&&w)continue;let P=b.decodePosition(x,I,_P),M=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,hse):(F=hse,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=D.lerp(f.south,f.north,L);V=(gi.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(P,gse)),n.encode(i,r*T,P,R,M,F,V,B),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function TNe(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!_se(d,f))continue;let p;switch(i){case wn.WEST:p=f.westIndicesSouthToNorth;break;case wn.SOUTH:p=f.southIndicesEastToWest;break;case wn.EAST:p=f.eastIndicesNorthToSouth;break;case wn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function _se(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function ENe(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(_se(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,hd);let y=QU(g,e.tile,hd,hd);if(y.x===o&&y.y===s)return pse(m,p,o,s,a),!0;if(d=vr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,hd);let x=QU(g,e.tile,hd,hd);return f?u?x.x-o:x.y-s:u?o-x.x:s-x.y}),d<0){if(d=~d,d>0&&d<c.length)return eMt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return pse(m,c[d],o,s,a),!0}return!1}var nMt=[new h,new h,new h,new h];function iMt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=nMt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var AP=yP;var yse=class e{constructor(t){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=Dn.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=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.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(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.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,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=se.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){Is.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Bc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(sMt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=oMt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(o=>{let s=o.data;l(s.vectorData)?s.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,s.vectorData,We.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(o.x,o.y,o.level,t.context,We.CLAMP_TO_TERRAIN)}),n.makeClean(),uMt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)Ch._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,s=n.length;o<s;++o){let a=n[o];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&r.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:hc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},blending:tn.ALPHA_BLEND});let c=Je(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=Ge.fromCache(c),c=Je(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=Ge.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&AP.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&aMt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,u=a.length;c<u;++c){let f=a[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],m=g.data;cMt(this,g,m,t);let y=m.tileBoundingRegion;NMt(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i){let o=n[i];o.dirty=!0,o.derivedCommands.picking=void 0;let s=o.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),DNe(o,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===hi.CULLED_BUT_NEEDED,o=i.terrainState),Ch.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Wo.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,Ch.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=ONe(this,n);if(n.fog.enabled&&!o&&D.fog(r,n.fog.density)>=1)return Wo.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Wo.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=F7(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,RNe);if(!l(d))return Wo.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=fMt,ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(s.renderedMesh)&&(u=ce.union(a.boundingSphere,u,u))),!l(u))return Wo.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==$t.INSIDE,b===$t.OUTSIDE)return Wo.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(a);t.isClipped=b!==$t.OUTSIDE}let m,y=c.computeVisibility(u);if(y===$t.OUTSIDE?m=Wo.NONE:y===$t.INTERSECTING?m=Wo.PARTIAL:y===$t.INSIDE&&(m=Wo.FULL),m===Wo.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof gn;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:Wo.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=mMt;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===kr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===Vn.FAILED||p.state===Vn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=pMt;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:hi.NONE;if(p===hi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===kr.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],A=y.loadingImagery,b=!l(A)||A.state===Vn.FAILED||A.state===Vn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===hi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(r.center,o,gMt),c=h.magnitude(a);return c<D.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){CMt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-s),d=Math.abs(u-a);f>d?(o.minimumHeight=s,o.maximumHeight=s):(o.minimumHeight=a,o.maximumHeight=a)}let c=o.distanceToCamera(n);return o.minimumHeight=s,o.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),ue(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,u=a.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(a,i,g)&&(a._loadedCallbacks[t._layerIndex]=vMt(p,t,i),a.state=Ja.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=Ja.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==hi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,s=0;for(let a=0,c=r.length;a<c;++a){let u=r[a],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=a),u.freeResources(),++s;else if(o!==-1)break}o!==-1&&r.splice(o,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},rMt=new ie;function oMt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,rMt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function sMt(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}function aMt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Bc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function cMt(e,t,n,i){let r=e._clippingPolygons;!l(r)||!r.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=r.requestRectangleData(t.rectangle,i.context))}function lMt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function uMt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function DNe(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)}var fMt=new ce,RNe=new ie,dMt=new ie,hMt=new he;function F7(e,t){if(t.west<t.east)return t;let n=ie.clone(t,dMt);return ie.center(e,hMt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function ONe(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||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var mMt=[],pMt=[],gMt=new h,SNe=new N,L7=new N,_Mt=new se,yMt=new se,AMt=new se,bMt=new h,wNe=new h,xMt=new h,TMt=new h,EMt=[new h,new h,new h,new h];function INe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=EMt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function CMt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Ch);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Zf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=Ar.getHeight(o.minimumHeight,p,g),o.maximumHeight=Ar.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=en.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ce.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=INe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=INe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function vMt(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}var SMt=new N,wMt=new N;function PNe(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,r=N.multiplyByPoint(i,this.properties.rtc,wNe);return N.setTranslation(i,r,SNe),SNe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,wNe);return N.setTranslation(i,o,L7),N.multiply(r,L7,L7),L7},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,r=l(i)?N.multiply(e.context.uniformState.view,i.modelMatrix,SMt):N.IDENTITY;return N.inverseTranspose(r,wMt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},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},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new N,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new U,scaleAndBias:new N,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new U,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Ot(n,t.materialUniformMap):n}function IMt(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=PMt(e,r,i),n.wireframeVertexArray.mesh=i}}function PMt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Hn.toWireframe(r);let o=r.indices,s=tt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new zn({context:e,attributes:t._attributes,indexBuffer:s})}var MNe,NNe,B7;(function(){let e=new Ft({geometry:$h.fromDimensions({dimensions:new h(2,2,2)})}),t=new Ft({geometry:new Hg({radius:1})}),n=new N,i,r;function o(s){return new Mn({geometryInstances:s,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}MNe=function(s,a){return s===i||(B7(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},NNe=function(s,a){return s===i||(B7(),i=s,n=N.fromTranslation(s.center,n),n=N.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),r=o(t)),r},B7=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var DMt=new se(0,0,0,0),RMt={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,vectorAntialias:void 0},OMt=z.TRANSPARENT,MMt=new qt;function NMt(e,t,n){let i=t.data;if(lMt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new AP(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let mt=o.credits;for(let ft=0,Xt=mt.length;ft<Xt;++ft)r.addCreditToNextFrame(mt[ft])}let s=kt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??OMt,A=e.undergroundColorAlphaByDistance??MMt,b=ONe(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,S=e.oceanNormalMap,I=v&&l(S),R=e.terrainProvider,O=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,C=Dn.castShadows(e.shadows)&&!d,w=Dn.receiveShadows(e.shadows)&&!d,P=e.hueShift,M=e.saturationShift,F=e.brightnessShift,V=!(D.equalsEpsilon(P,0,D.EPSILON7)&&D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(F,0,D.EPSILON7)),B=!1;if(_){let mt=h.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;B=mt>ft}E&&--s,I&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,k=j.center,G=j.encoding,q=i.tileBoundingRegion,Q=n.verticalExaggeration,W=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ae=_Mt,Ae=0,fe=0,xe=0,ge=0,we=!1;if(n.mode!==re.SCENE3D){let mt=n.mapProjection,ft=mt.project(ie.southwest(t.rectangle),xMt),Xt=mt.project(ie.northeast(t.rectangle),TMt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Xt.x,ae.w=Xt.y,n.mode!==re.MORPHING&&(k=bMt,k.x=0,k.y=(ae.z+ae.x)*.5,k.z=(ae.w+ae.y)*.5,ae.x-=k.y,ae.y-=k.z,ae.z-=k.y,ae.w-=k.z),n.mode===re.SCENE2D&&G.quantization===ka.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,ht=(ae.z-ae.x)*rt,Bi=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Bi,ae.z+=ht,ae.w+=Bi}mt instanceof gi&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=gi.geodeticLatitudeToMercatorAngle(Ae),ge=1/(gi.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let Se=RMt;Se.frameState=n,Se.surfaceTile=i,Se.hasWaterMask=E,Se.showReflectiveOcean=v,Se.showOceanWaves=I,Se.enableLighting=e.enableLighting,Se.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Se.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Se.showGroundAtmosphere=_,Se.atmosphereLightIntensity=e.atmosphereLightIntensity,Se.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Se.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Se.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Se.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Se.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Se.perFragmentGroundAtmosphere=B,Se.hasVertexNormals=O,Se.useWebMercatorProjection=we,Se.clippedByBoundaries=i.clippedByBoundaries,Se.hasGeodeticSurfaceNormals=Z,Se.hasExaggeration=J,Se.vectorAntialias=e.vectorProvider.antialias;let Re=i.imagery,Qe=0,He=Re.length,Xe=e.showSkirts&&!u&&!d,$e=e.backFaceCulling&&!u&&!d,Pe=$e?e._renderState:e._disableCullingRenderState,qe=$e?e._blendRenderState:e._disableCullingBlendRenderState,st=Pe,vt=e._firstPassInitialColor,Gt=n.context;if(l(e._debug.boundingSphereTile)||B7(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=PNe(n,e)}do{let mt=0,ft,Xt;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new at,ft.owner=t,ft.cull=!1,ft.boundingVolume=new ce,ft.orientedBoundingBox=void 0,Xt=PNe(n,e),e._drawCommands.push(ft),e._uniformMaps.push(Xt)):(ft=e._drawCommands[e._usedDrawCommands],Xt=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ks=q.boundingVolume,tc=q.boundingSphere;l(ks)?MNe(ks,z.RED).update(n):l(tc)&&NNe(tc,z.RED).update(n)}let rt=Xt.properties;se.clone(vt,rt.initialColor),rt.oceanNormalMap=S,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ht=u?g:p,Bi=u?p:g;l(ht)&&(se.fromElements(ht.near,ht.nearValue,ht.far,ht.farValue,rt.frontFaceAlphaByDistance),se.fromElements(Bi.near,Bi.nearValue,Bi.far,Bi.farValue,rt.backFaceAlphaByDistance)),se.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),z.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let Xn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Xn&&z.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=W,rt.center3D=j.center,h.clone(k,rt.rtc),se.clone(ae,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=fe,rt.southMercatorYAndOneOverHeight.x=xe,rt.southMercatorYAndOneOverHeight.y=ge;let Ai=yMt,Wi=F7(t.rectangle,e.cartographicLimitRectangle),wi=AMt,di=F7(t.rectangle,m);h.fromElements(P,M,F,rt.hsbShift);let bi=t.rectangle,jn=1/bi.width,nn=1/bi.height;Ai.x=(Wi.west-bi.west)*jn,Ai.y=(Wi.south-bi.south)*nn,Ai.z=(Wi.east-bi.west)*jn,Ai.w=(Wi.north-bi.south)*nn,se.clone(Ai,rt.localizedCartographicLimitRectangle),wi.x=(di.west-bi.west)*jn,wi.y=(di.south-bi.south)*nn,wi.z=(di.east-bi.west)*jn,wi.w=(di.north-bi.south)*nn,se.clone(wi,rt.localizedTranslucencyRectangle);let Wn=L&&D.fog(t._distance,n.fog.density)>D.EPSILON3;V=V&&(Wn||_);let Zi=!1,Mr=!1,fo=!1,Bs=!1,Ks=!1,no=!1,mi=!1,ho=!1,ur=!1,Zo=!1;for(;mt<s&&Qe<He;){let ks=Re[Qe],tc=ks.readyImagery;if(++Qe,!l(tc)||tc.imageryLayer.alpha===0)continue;let Yb=ks.useWebMercatorT?tc.textureWebMercator:tc.texture,ri=tc.imageryLayer;l(ks.textureTranslationAndScale)||(ks.textureTranslationAndScale=ri._calculateTextureTranslationAndScale(t,ks)),rt.dayTextures[mt]=Yb,rt.dayTextureTranslationAndScale[mt]=ks.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[mt]=ks.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[mt]=ks.useWebMercatorT,rt.dayTextureAlpha[mt]=ri.alpha,no=no||rt.dayTextureAlpha[mt]!==1,rt.dayTextureNightAlpha[mt]=ri.nightAlpha,mi=mi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ri.dayAlpha,mi=mi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ri.brightness,Zi=Zi||rt.dayTextureBrightness[mt]!==Rs.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ri.contrast,Mr=Mr||rt.dayTextureContrast[mt]!==Rs.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ri.hue,fo=fo||rt.dayTextureHue[mt]!==Rs.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ri.saturation,Bs=Bs||rt.dayTextureSaturation[mt]!==Rs.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ri.gamma,Ks=Ks||rt.dayTextureOneOverGamma[mt]!==1/Rs.DEFAULT_GAMMA,rt.dayTextureSplit[mt]=ri.splitDirection,ho=ho||rt.dayTextureSplit[mt]!==0;let Kr=rt.dayTextureCutoutRectangles[mt];if(l(Kr)||(Kr=rt.dayTextureCutoutRectangles[mt]=new se),se.clone(se.ZERO,Kr),l(ri.cutoutRectangle)){let Ma=F7(bi,ri.cutoutRectangle),Ep=ie.simpleIntersection(Ma,bi,RNe);ur=l(Ep)||ur,Kr.x=(Ma.west-bi.west)*jn,Kr.y=(Ma.south-bi.south)*nn,Kr.z=(Ma.east-bi.west)*jn,Kr.w=(Ma.north-bi.south)*nn}let Ol=rt.colorsToAlpha[mt];l(Ol)||(Ol=rt.colorsToAlpha[mt]=new se);let Z0=l(ri.colorToAlpha)&&ri.colorToAlphaThreshold>0;if(Zo=Zo||Z0,Z0){let Ma=ri.colorToAlpha;Ol.x=Ma.red,Ol.y=Ma.green,Ol.z=Ma.blue,Ol.w=ri.colorToAlphaThreshold}else Ol.w=-1;if(l(tc.credits)){let Ma=tc.credits;for(let Ep=0,Ey=Ma.length;Ep<Ey;++Ep)r.addCreditToNextFrame(Ma[Ep])}++mt}rt.dayTextures.length=mt,rt.waterMask=a,se.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,N.clone(G.matrix,rt.scaleAndBias);let Bn=e._clippingPlanes,qi=l(Bn)&&Bn.enabled&&t.isClipped;qi&&(rt.clippingPlanesEdgeColor=z.clone(Bn.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Bn.edgeWidth);let ki=i.vectorData;l(ki)&&(rt.vectorSegmentTexture=ki.polylineSegmentTexture,rt.vectorWidthTexture=ki.widthTexture,rt.vectorColorTexture=ki.colorTexture,rt.vectorPickColorTexture=ki.pickColorTexture,rt.vectorSegmentPrimitiveIndicesTexture=ki.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=ki.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=ki.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=ki.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=ki.polygonGridCellIndicesTexture,U.clone(ki.metersPerUv,rt.vectorMetersPerUv));let Nr=i.clippingPolygonData;l(Nr)&&(rt.clippingEdgeTexture=Nr.polygonEdgeTexture,rt.clippingEdgePrimitiveIndicesTexture=Nr.polygonEdgePrimitiveIndicesTexture,rt.clippingGridCellIndicesTexture=Nr.polygonGridCellIndicesTexture);let Wc=e._clippingPolygons,xd=(Nr?.polygonRings.length??0)>0,xp=l(Wc)&&Wc.enabled&&Wc.length>0&&t.isClipped&&xd;Se.numberOfDayTextures=mt,Se.applyBrightness=Zi,Se.applyContrast=Mr,Se.applyHue=fo,Se.applySaturation=Bs,Se.applyGamma=Ks,Se.applyAlpha=no,Se.applyDayNightAlpha=mi,Se.applySplit=ho,Se.enableFog=Wn,Se.enableClippingPlanes=qi,Se.clippingPlanes=Bn,Se.enableClippingPolygons=xp,Se.clippingPolygons=Wc,Se.hasImageryLayerCutout=ur,Se.colorCorrect=V,Se.highlightFillTile=Xn,Se.colorToAlpha=Zo,Se.showUndergroundColor=b,Se.translucent=d;let Nh=i.renderedMesh.indices.length;Xe||(Nh=i.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(Se),ft.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ft.castShadows=C,ft.receiveShadows=w,ft.renderState=st,ft.primitiveType=Oe.TRIANGLES,ft.vertexArray=i.vertexArray||i.fill.vertexArray,ft.count=Nh,ft.uniformMap=Xt,ft.pass=Ie.GLOBE,e._debug.wireframe&&(IMt(Gt,t),l(i.wireframeVertexArray)&&(ft.vertexArray=i.wireframeVertexArray,ft.primitiveType=Oe.LINES,ft.count=Nh*2));let da=ft.boundingVolume,Tp=ft.orientedBoundingBox;n.mode!==re.SCENE3D?(ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,da),h.fromElements(da.center.z,da.center.x,da.center.y,da.center),n.mode===re.MORPHING&&ce.union(q.boundingSphere,da,da)):(ft.boundingVolume=ce.clone(q.boundingSphere,da),ft.orientedBoundingBox=en.clone(q.boundingVolume,Tp)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),DNe(ft,n),st=qe,vt=DMt}while(Qe<He)}var ez=yse;function LNe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(LNe.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=qt.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=qt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var tz=LNe;var Ase=class{constructor(t){this._ellipsoid=new Xh(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},nz=Ase;var bse=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},LMt=1e3,xse=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.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=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=hi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new bse(LMt),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)r[o++]=new e({tilingScheme:t,x:a,y:s,level:0});return r}_getCacheKey(t,n){return BMt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];i.add(o),FNe(this,o.positionCartographic)._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];i.has(o)&&i.delete(o),FNe(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<Ja.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),k7(this._southwestChild),this._southwestChild=void 0,k7(this._southeastChild),this._southeastChild=void 0,k7(this._northwestChild),this._northwestChild=void 0,k7(this._northeastChild),this._northeastChild=void 0}},FMt=256;function BMt(e,t,n,i){let r=n.width/FMt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var kMt=new he;function FNe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,kMt),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function k7(e){l(e)&&e.freeResources()}var iz=xse;function U7(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}U7.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};U7.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(),BNe(this,t)),t=i}};function BNe(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}U7.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))&&BNe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var rz=U7;function vh(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._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new rz,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new nz({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(vh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});vh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function UMt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,UNe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let s of o)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}vh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ja.START&&e(t),t=t.replacementNext};vh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};vh.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length,s=!1;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};vh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function UNe(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}vh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(UMt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),UNe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};vh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),HMt(this,e),QMt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function zMt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.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))}vh.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(KMt(this,e),ZMt(this,e),zMt(this,e))};vh.prototype.isDestroyed=function(){return!1};vh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var sz,kNe=new he;function VMt(e,t){let n=ie.center(e.rectangle,kNe),i=n.longitude-sz.longitude,r=n.latitude-sz.latitude;n=ie.center(t.rectangle,kNe);let o=n.longitude-sz.longitude,s=n.latitude-sz.latitude;return i*i+r*r-(o*o+s*s)}var jMt=new h,oz=[];function HMt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=iz.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(oz.length<g){oz=new Array(g);for(let m=0;m<g;++m)oz[m]===void 0&&(oz[m]=new az)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;sz=t.camera.positionCartographic,o.sort(VMt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=N.getTranslation(u.transform,jMt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Gc(e,p,r,t,s,!1,oz[d]):(sy(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function sy(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function az(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function zNe(){this.southwest=new az,this.southeast=new az,this.northwest=new az,this.northeast=new az}zNe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var Ese=new Array(31);for(let e=0;e<Ese.length;++e)Ese[e]=new zNe;function GMt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=YMt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:hi.NONE,g=e.tileProvider;if(s||i){let m=hi.originalResult(p)===hi.RENDERED,y=hi.originalResult(p)===hi.CULLED||p===hi.NONE,A=n.state===Ja.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&sy(e,e._tileLoadQueueMedium,n,t),z7(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===hi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=hi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&sy(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){z7(e,n),sy(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===hi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=hi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=hi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(WMt(e,a,c,u,f,t,i,r),y!==e._tilesToRender.length){let E=r.allAreRenderable,v=r.anyWereRenderedLastFrame,S=r.notYetRenderableCount,I=!1;if(!E&&!v){let R=e._tilesToRender;for(let L=y;L<R.length;++L){let _=R[L];for(;_!==void 0&&_._lastSelectionResult!==hi.KICKED&&_!==n;)_._lastSelectionResult=hi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,z7(e,n),n._lastSelectionResult=hi.RENDERED;let O=p===hi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,sy(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&sy(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=hi.RENDERED,z7(e,n),sy(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===hi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function WMt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Ese[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Gc(e,t,u,o,f,s,p),Gc(e,n,u,o,f,s,g),Gc(e,i,u,o,f,s,m),Gc(e,r,u,o,f,s,y)):(Gc(e,i,u,o,f,s,m),Gc(e,t,u,o,f,s,p),Gc(e,r,u,o,f,s,y),Gc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Gc(e,n,u,o,f,s,g),Gc(e,t,u,o,f,s,p),Gc(e,r,u,o,f,s,y),Gc(e,i,u,o,f,s,m)):(Gc(e,r,u,o,f,s,y),Gc(e,i,u,o,f,s,m),Gc(e,n,u,o,f,s,g),Gc(e,t,u,o,f,s,p)),d.combine(a)}function qMt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Gc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==Wo.NONE)return GMt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,qMt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&sy(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:hi.NONE;c!==hi.CULLED_BUT_NEEDED&&c!==hi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=hi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(sy(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=hi.CULLED):t._lastSelectionResult=hi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function YMt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof gn||t.camera.frustum instanceof ys)return XMt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=D.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function XMt(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function z7(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function KMt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=xn()+e._loadQueueTimeSlice,s=e._tileProvider,a=Tse(e,t,s,o,n,!1);a=Tse(e,t,s,o,i,a),Tse(e,t,s,o,r,a)}function $Mt(e,t){return e._loadPriority-t._loadPriority}function Tse(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort($Mt);for(let s=0,a=r.length;s<a&&(xn()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var bP=new pn,V7=new he,Rb=new h,JMt=[];function ZMt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=JMt;n.length=0;let i=e._tileToUpdateHeights,r=xn(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:hi.NONE;(A===hi.RENDERED||A===hi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,E=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===re.SCENE3D){let v=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,bP.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,bP.origin);if(!l(S)){let I=0;l(d.data.tileBoundingRegion)&&(I=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(I,-11500),O=h.multiplyByScalar(v,Math.abs(R)+1,Rb);h.subtract(A.positionOnEllipsoidSurface,O,bP.origin)}}else he.clone(A.positionCartographic,V7),V7.height=-11500,c.project(V7,Rb),h.fromElements(Rb.z,Rb.x,Rb.y,Rb),h.clone(Rb,bP.origin),h.clone(h.UNIT_X,bP.direction);T=d.data.pick(bP,a,c,!1,Rb),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,V7);A.callback(v)}A.level=d.level}}if(xn()>=s){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function QMt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var cz=vh;function ap(e){e=e??ee.default;let t=new Zp({ellipsoid:e}),n=new EE,i=new Wg({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new ZU,this._material=void 0,this._surface=new cz({tileProvider:new ez({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new qt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new tz,vse(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("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=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Dn.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(ap.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=ie.clone(ie.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,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&vse(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,vse(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=qt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function vse(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[xm,gP];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push($U),e._surfaceShaderSet.baseVertexShaderSource=new Ye({sources:[xm,gP,JU],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ye({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function eNt(e){return function(t,n){let i=ce.distanceSquaredTo(t.pickBoundingSphere,e),r=ce.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var tNt=[],nNt={start:0,stop:0};ap.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=tNt;s.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=ce.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))ce.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=pi.raySphere(e,d,nNt);l(p)&&s.push(f)}s.sort(eNt(e.origin));let a,c=s.length;for(let u=0;u<c&&(a=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(a));++u);return a};var iNt=new he;ap.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,iNt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var rNt=new h,VNe=new h,oNt=new he,sNt=new pn;function Cse(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}ap.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=Cse(n._southwestChild,e)||Cse(n._southeastChild,e)||Cse(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,rNt),u=sNt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,VNe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,VNe);if(l(p))return a.cartesianToCartographic(p,oNt).height};ap.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};ap.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.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===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,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))};ap.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};ap.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};ap.prototype.isDestroyed=function(){return!1};ap.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(),ue(this)};var lz=ap;var xP=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; +in vec3 v_positionEC; +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) { -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; +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; +vec3 normalEC = normalize(czm_normal * normalMC); +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 -color = pow(color, vec3(textureOneOverGamma)); +return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif -#ifdef APPLY_SPLIT -float splitPosition = czm_splitPosition; -if (split < 0.0 && gl_FragCoord.x > splitPosition) { -alpha = 0.0; -} -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; -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) +void main() { -direction = vec3(0.0, 0.0, -1.0); +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; } -else -{ -direction = normalize(vec3(xy, -czm_currentFrustum.x)); +if (t1 < 0.0 && t2 < 0.0) { +discard; } -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; +float t = min(t1, t2); +if (t < 0.0) { +t = 0.0; } -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) +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; } -#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)); -vec3 normalEC = czm_normal3D * normalMC; -#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); +vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); +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 nightBlend = 0.0; +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 -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) +} +`;var TP=`in vec3 position; +uniform vec3 u_radii; +out vec3 v_positionEC; +void main() { -cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; +vec4 p = vec4(u_radii * position, 1.0); +vec4 pEC = czm_modelView * p; +v_positionEC = pEC.xyz; +gl_Position = czm_projection * pEC; +gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); +czm_vertexLogDepth(); } -else if (czm_sceneMode == czm_sceneModeColumbusView) +`;var Sse={position:0};function j7(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ce,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this._computedModelMatrix=new N,this.show=e.show??!0,this.material=e.material??or.fromType(or.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 at({owner:e._owner??this}),this._pickCommand=new at({owner: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 aNt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=zn.fromGeometry({context:e,geometry:n,attributeLocations:Sse,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}j7.prototype.update=function(e){if(!this.show||e.mode!==re.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=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?tn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=aNt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!N.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(N.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),N.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),ce.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,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ye({sources:[TP]}),p=new Ye({sources:[this.material.shaderSource,xP]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Sse}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Ot(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let y=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)||u)&&(d=new Ye({sources:[TP]}),p=new Ye({sources:[this.material.shaderSource,xP],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Sse}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Ot(Ot(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(y)}};j7.prototype.isDestroyed=function(){return!1};j7.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(),ue(this)};var uz=j7;function fz(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ee.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new uz({radii:this.ellipsoid.radii,material:or.fromType(or.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new iN}Object.defineProperties(fz.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var H7=new $,cNt=new $,lNt=new h,G7=[];fz.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(At.computeIcrfToFixedMatrix(n,H7))||At.computeTemeToPseudoFixedMatrix(n,H7);let i=this._axes.evaluate(n,cNt);$.transpose(i,i),$.multiply(H7,i,i);let r=Fy.computeMoonPositionInEarthInertialFrame(n,lNt);$.multiplyByVector(H7,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=G7,G7.length=0,t.update(e),e.commandList=o,G7.length===1?G7[0]:void 0};fz.prototype.isDestroyed=function(){return!1};fz.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var dz=fz;var hz=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; +float vdcRadicalInverse(int i) { -cameraDist = -czm_view[3].z; +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; } -else +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) { -cameraDist = length(czm_view[3]); +return vec2(float(i) / float(N), vdcRadicalInverse(i)); } -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; +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; } -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) +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) { -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); +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; } -#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) +return 0.0; +} +vec2 integrateBrdf(float roughness, float NdotV) { -finalColor = clippingPlanesEdgeColor; +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; } -#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()) +} +return vec2(A, B) / float(NumSamples); +} +void main() { -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; -#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); -#ifdef FOG -vec3 fogColor = groundAtmosphereColor.rgb; -#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 -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 +out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } -#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); +`;function mz(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(mz.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function uNt(e,t,n){let i=t.createViewportQuadCommand(hz,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}mz.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST});this._colorTexture=n;let i=new _s({context:t,colorTextures:[n],destroyAttachments:!1});uNt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};mz.prototype.isDestroyed=function(){return!1};mz.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var pz=mz;var WNe={};function fNt(e,t,n){let i,r,o;if(e instanceof Ki){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof $l)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var dNt=new h,jNe=new h;function qNe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-o)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(r){return D.lerp(e,t,r)}}function Ise(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,dNt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),jNe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),jNe));o=Math.min(fNt(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return D.lerp(n,i,a)}}function gz(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var YNe=new h;function hNt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,YNe),f=c.pitch,d=gz(c.heading,i),p=gz(c.roll,o),g=Ise(c,n,u.z,n.z,s),m=qNe(f,r,g,a);function y(A){let b=A.time/t;c.setView({orientation:{heading:D.lerp(d,i,b),pitch:m(b),roll:D.lerp(p,o,b)}}),U.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function mNt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function pNt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var gNt=new he,_Nt=new he;function yNt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,gNt),m=f.pitch,y=gz(f.heading,i),A=gz(f.roll,o),b=p.cartesianToCartographic(n,_Nt);g.longitude=D.zeroToTwoPi(g.longitude),b.longitude=D.zeroToTwoPi(b.longitude);let x=!1;if(l(a)){let S=D.zeroToTwoPi(a),I=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=S>=I&&S<=R;if(l(c)){let L=Math.abs(g.longitude-b.longitude),_=D.TWO_PI-L;(O?L:_)<(O?_:L)*c&&!O&&(x=!0)}else O||(x=!0)}x?mNt(g,b):pNt(g,b);let T=Ise(f,n,g.height,b.height,s),E=qNe(m,r,T,u);function v(){let S=g.longitude,I=b.longitude,R=g.latitude,O=b.latitude;return function(_){let C=_.time/t,w=h.fromRadians(D.lerp(S,I,C),D.lerp(R,O,C),T(C),p);f.setView({destination:w,orientation:{heading:D.lerp(y,i,C),pitch:E(C),roll:D.lerp(A,o,C)}})}}return v()}function ANt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,YNe),u=gz(a.heading,i),f=a.frustum.right-a.frustum.left,d=Ise(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:D.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let y=d(m),A=a.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var HNe=new he,bNt=new h;function wse(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function GNe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}WNe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return wse();let r=t.convert??!0,o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(s.cartesianToCartographic(n,HNe),n=o.project(HNe,bNt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-D.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=GNe(x,t.complete),E=GNe(x,t.cancel),v=p.frustum,S=e.mode===re.SCENE2D;if(S=S&&U.equalsEpsilon(p.position,n,D.EPSILON6),S=S&&D.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,D.EPSILON6),S=S||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,D.EPSILON10),S=S&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(A),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(b),D.negativePiToPi(p.roll),D.EPSILON10),S)return wse(T,E);let I=new Array(4);if(I[re.SCENE2D]=ANt,I[re.SCENE3D]=yNt,I[re.COLUMBUS_VIEW]=hNt,m<=0)return wse(function(){I[i](e,1,n,y,A,b,a,c,u,f)({time:1}),typeof T=="function"&&T()},E);let R=I[i](e,m,n,y,A,b,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===re.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=xs.CUBIC_OUT:d=xs.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var _z=WNe;var XNe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(XNe);var yu=XNe;function an(e){this._scene=e,this._transform=N.clone(N.IDENTITY),this._invTransform=N.clone(N.IDENTITY),this._actualTransform=N.clone(N.IDENTITY),this._actualInvTransform=N.clone(N.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Ki,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.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 N,this._invViewMatrix=new N,oLe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,_Le(this,an.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*an.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}an.TRANSFORM_2D=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);an.TRANSFORM_2D_INVERSE=N.inverseTransformation(an.TRANSFORM_2D,new N);an.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);an.DEFAULT_VIEW_FACTOR=.5;an.DEFAULT_OFFSET=new Hd(0,-D.PI_OVER_FOUR,0);function oLe(e){N.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),N.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),N.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function xNt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xn()):e.timeSinceMoved=Math.max(xn()-e._lastMovedTimestamp,0)/1e3}}an.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};an.prototype._updateCameraChanged=function(){let e=this;if(xNt(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)%D.TWO_PI;i=i>D.PI?D.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let s=Math.abs(e._changedRoll-o)%D.TWO_PI;s=s>D.PI?D.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=o),(a>t||r>t)&&e._changed.raiseEvent(Math.max(a,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,E=p.y+m.bottom,v=p.y+m.top,S=g.y+y.bottom,I=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),L=Math.max(E,S),_=Math.min(v,I),C;if(R>=O||L>=v)C=1;else{let w=y;A<x&&b>T&&E<S&&v>I&&(w=m),C=1-(O-R)*(_-L)/((w.right-w.left)*(w.top-w.bottom))}C>t&&(e._changed.raiseEvent(C),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function TNt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var ENt=new he,CNt=new h,W7=new h,vNt=new se,SNt=new se,wNt=new se,INt=new se,PNt=new se;function DNt(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,vNt),r=n.cartesianToCartographic(i,ENt),o=t.project(r,CNt),s=SNt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,PNt),c=se.add(N.getColumn(e._transform,0,W7),i,W7);n.cartesianToCartographic(c,r),t.project(r,o);let u=wNt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=INt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(a,u,f);else{let d=se.add(N.getColumn(e._transform,1,W7),i,W7);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<D.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),N.setColumn(e._actualTransform,0,u,e._actualTransform),N.setColumn(e._actualTransform,1,f,e._actualTransform),N.setColumn(e._actualTransform,2,a,e._actualTransform),N.setColumn(e._actualTransform,3,s,e._actualTransform)}var Pse=new h;function wl(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(N.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?N.equals(N.IDENTITY,e._transform)?N.clone(an.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?TNt(e):DNt(e):N.clone(e._transform,e._actualTransform),N.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=N.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=Pse;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,Pse));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,Pse);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=N.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=N.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=N.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&oLe(e)}function sLe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function aLe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function cLe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var X7=new N,K7=new N;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return wl(this),this._invTransform}},viewMatrix:{get:function(){return wl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return wl(this),this._invViewMatrix}},positionCartographic:{get:function(){return wl(this),this._positionCartographic}},positionWC:{get:function(){return wl(this),this._positionWC}},directionWC:{get:function(){return wl(this),this._directionWC}},upWC:{get:function(){return wl(this),this._upWC}},rightWC:{get:function(){return wl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,X7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,K7);this._setTransform(n);let i=sLe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,X7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,K7);this._setTransform(n);let i=aLe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,X7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,K7);this._setTransform(n);let i=cLe(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}}});an.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&dLe(this,this.position)};var RNt=new h,ONt=new h,MNt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,RNt),n=h.clone(this.upWC,ONt),i=h.clone(this.directionWC,MNt);N.clone(e,this._transform),this._transformChanged=!0,wl(this);let r=this._actualInvTransform;N.multiplyByPoint(r,t,this.position),N.multiplyByPointAsVector(r,i,this.direction),N.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),wl(this)};var NNt=new U,LNt=new pn,FNt=new h,BNt=new h;function lLe(e){if(!N.equals(N.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=NNt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,LNt);r=n.pickWorldCoordinates(a,t,!0,FNt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,BNt));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}an.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof gn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=lLe(this)))};var $7=new h,Nse=new N,kNt=new N,Lse=new Le,Fse=new $,uLe=new he;function UNt(e,t,n){let i=N.clone(e.transform,Nse),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,kNt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Lse),s=$.fromQuaternion(o,Fse);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function zNt(e,t,n,i){let r=N.clone(e.transform,Nse);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,uLe);t=a.project(c,$7)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Lse),s=$.fromQuaternion(o,Fse);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function VNt(e,t,n,i){let r=N.clone(e.transform,Nse);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,uLe);t=c.project(u,$7)}U.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===yu.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,Lse),s=$.fromQuaternion(o,Fse);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var jNt=new h,HNt=new h,GNt=new h;function fLe(e,t,n,i){let r=h.clone(n.direction,jNt),o=h.clone(n.up,HNt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,X7),u=N.inverseTransformation(c,K7);N.multiplyByPointAsVector(u,r,r),N.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,GNt);return i.heading=sLe(r,o),i.pitch=aLe(r),i.roll=cLe(r,o,s),i}var Mse={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},EP=new wc;an.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,$7);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,$7),i=!1),l(t.direction)&&(t=fLe(this,r,t,Mse.orientation)),EP.heading=t.heading??0,EP.pitch=t.pitch??-D.PI_OVER_TWO,EP.roll=t.roll??0,n===re.SCENE3D?UNt(this,r,EP):n===re.SCENE2D?VNt(this,r,EP,i):zNt(this,r,EP,i)};var WNt=new h;an.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:an.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:N.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(an.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*an.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:N.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,WNt).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),wl(this),N.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),wl(this),N.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),wl(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),wl(this),N.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),wl(this),N.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),wl(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function dLe(e,t){let n=e._scene.mapMode2D===yu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var KNe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,KNe),h.add(n,KNe,n),this._mode===re.SCENE2D&&dLe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?J7(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?J7(this,-e):this.move(this.direction,-e)};an.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};an.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};an.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};an.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};an.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};an.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};an.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};an.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var qNt=new Le,YNt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,qNt),r=$.fromQuaternion(i,YNt),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};an.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};an.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var XNt=new Le,KNt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,XNt),r=$.fromQuaternion(i,KNt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};an.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,hLe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,hLe(this,-e)};var $Nt=new h,JNt=new h,ZNt=new h,$Ne=new h;function hLe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,$Nt),r=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,$Ne),D.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,JNt),a=h.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=h.dot(i,h.negate(s,$Ne)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(s,i,ZNt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}an.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,mLe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,mLe(this,e)};function mLe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function J7(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 r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===yu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===yu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function pLe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?J7(this,e):pLe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?J7(this,-e):pLe(this,-e)};an.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var QNt=new N;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,QNt);this.lookAtTransform(r,t)};var eLt=new h,tLt=new Le,nLt=new Le,iLt=new $;function gLe(e,t,n,i){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let r=Le.fromAxisAngle(h.UNIT_Y,-t,tLt),o=Le.fromAxisAngle(h.UNIT_Z,-e,nLt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,iLt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}an.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=gLe(t.heading,t.pitch,t.range,eLt):n=t,this._mode===re.SCENE2D){U.clone(U.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<D.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(N.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<D.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var rLt=new N,JNe=new h,oLt=new h,ZNe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=N.clone(this._transform,rLt);this._setTransform(N.IDENTITY);let i=h.subtract(e,this.positionWC,JNe);h.magnitudeSquared(i)<D.EPSILON8&&(i=h.clone(this.directionWC,JNe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,oLt),o=h.cross(i,r,ZNe);h.magnitudeSquared(o)<D.EPSILON8&&(o=h.clone(this.rightWC,ZNe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var yz=new he,sLt=new he,aLt=new h,cLt=new h,lLt=new h,uLt=new h,fLt=new h,dLt=new h,hLt=new h,Dse=new h,mLt={direction:new h,right:new h,up:new h},QNe;function Sl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function _Le(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:mLt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,d;if(a<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&s>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let O=yz;O.longitude=f,O.latitude=s,O.height=0;let L=sLt;L.longitude=f,L.latitude=a,L.height=0;let _=QNe;(!l(_)||_.ellipsoid!==r)&&(QNe=_=new Pg(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,yz).latitude}let p=yz;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,hLt),m=yz;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,aLt);m.longitude=c;let A=r.cartographicToCartesian(m,lLt);m.longitude=f;let b=r.cartographicToCartesian(m,fLt);m.latitude=a;let x=r.cartographicToCartesian(m,dLt);m.longitude=u;let T=r.cartographicToCartesian(m,uLt);m.longitude=c;let E=r.cartographicToCartesian(m,cLt);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(E,g,E),h.subtract(b,g,b),h.subtract(x,g,x);let v=r.geodeticSurfaceNormal(g,o.direction);h.negate(v,v);let S=h.cross(v,h.UNIT_Z,o.right);h.normalize(S,S);let I=h.cross(S,v,o.up),R;if(e.frustum instanceof gn){let O=Math.max(h.distance(y,A),h.distance(T,E)),L=Math.max(h.distance(y,T),h.distance(A,E)),_,C,w=e.frustum._offCenterFrustum,P=w.right/w.top,M=L*P;O>M?(_=O,C=_/P):(C=L,_=M),R=Math.max(_,C)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(R=Math.max(Sl(v,I,A,O),Sl(v,I,T,O),Sl(v,I,y,O),Sl(v,I,E,O),Sl(v,I,b,O),Sl(v,I,x,O),Sl(v,S,A,L),Sl(v,S,T,L),Sl(v,S,y,L),Sl(v,S,E,L),Sl(v,S,b,L),Sl(v,S,x,L)),a<0&&s>0){let _=yz;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,Dse);h.subtract(C,g,C),R=Math.max(R,Sl(v,I,C,O),Sl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,Dse),h.subtract(C,g,C),R=Math.max(R,Sl(v,I,C,O),Sl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,Dse),n)}var pLt=new he,gLt=new h,_Lt=new h;function yLt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=pLt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,gLt);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,_Lt);if(N.multiplyByPoint(r,c,c),N.multiplyByPoint(o,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 u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var ALt=new he,bLt=new h,xLt=new h;function TLt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===yu.INFINITE_SCROLL?r+=D.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=ALt;o.longitude=r,o.latitude=t.north;let s=i.project(o,bLt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,xLt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}an.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return _Le(this,e,t);if(n===re.COLUMBUS_VIEW)return yLt(this,e,t);if(n===re.SCENE2D)return TLt(this,e,t)};var ELt=new pn;function CLt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,ELt),o=pi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return pn.getPoint(r,s,i)}var vLt=new pn;function SLt(e,t,n,i){let o=e.getPickRay(t,vLt).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var wLt=new pn;function ILt(e,t,n,i){let r=e.getPickRay(t,wLt),o=-r.origin.x/r.direction.x;pn.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}an.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ee.default,this._mode===re.SCENE3D)n=CLt(this,e,t,n);else if(this._mode===re.SCENE2D)n=SLt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=ILt(this,e,this._projection,n);else return;return n}};var PLt=new h,DLt=new h,RLt=new h;function OLt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,PLt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,DLt),m=h.multiplyByScalar(e.upWC,f*c*s,RLt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var q7=new h;function MLt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,q7),h.add(q7,f,f),h.multiplyByScalar(e.upWC,u,q7),h.add(q7,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===yu.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=D.mod(f.y+d,2*d)-d}return n}an.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)?OLt(this,e,t):MLt(this,e,t)};var NLt=new h,LLt=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,NLt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),LLt);return Math.max(0,h.magnitude(n)-e.radius)};var FLt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,FLt);return Math.max(r.x,r.y)};function BLt(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:xs.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var kLt=new h,eLe=new h,ULt=new h,zLt=new h;function VLt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,kLt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,eLe),eLe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,ULt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,zLt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(A||b)return BLt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return VLt(this,e)};var jLt=new h,Za={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};an.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};an.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=Za.destination,e.orientation.heading=Za.heading,e.orientation.pitch=Za.pitch,e.orientation.roll=Za.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};an.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,jLt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=fLe(this,t,r,Mse.orientation)),l(e.duration)&&e.duration<=0){let f=Mse;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Za.destination=t,Za.heading=r.heading,Za.pitch=r.pitch,Za.roll=r.roll,Za.duration=e.duration,Za.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Za.cancel=e.cancel,Za.endTransform=e.endTransform,Za.convert=i?!1:e.convert,Za.maximumHeight=e.maximumHeight,Za.pitchAdjustHeight=e.pitchAdjustHeight,Za.flyOverLongitude=e.flyOverLongitude,Za.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Za.easingFunction=e.easingFunction;let a=this._scene,c=_z.createTween(a,Za);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=an.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function HLt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function GLt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var WLt=100;function yLe(e,t,n){n=Hd.clone(l(n)?n:an.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=WLt:e.frustum instanceof gn||e._mode===re.SCENE2D?n.range=GLt(e,s):n.range=HLt(e,s),n.range=D.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=yLe(this,e,t),this.lookAt(e.center,t)};var qLt=new N,tLe=new h,YLt=new h,XLt=new h,KLt=new h,$Lt=new se,JLt=new Le,ZLt=new $;an.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(N.IDENTITY);let i=yLe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,tLe):r=gLe(i.heading,i.pitch,i.range,tLe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,qLt);N.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,YLt),h.normalize(c,c),u=N.multiplyByPointAsVector(a,h.UNIT_Z,XLt),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,JLt),p=$.fromQuaternion(d,ZLt);h.fromCartesian4(N.getColumn(a,1,$Lt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,KLt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,up:u},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 nLe=new h,iLe=new h,Rse=new h,rLe=new h,Az=[new h,new h,new h,new h];function QLt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,nLe),o=h.magnitude(r),s=h.normalize(r,iLe),a,c;h.equalsEpsilon(s,h.UNIT_Z,D.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,Rse),Rse),c=h.normalize(h.cross(s,a,rLe),rLe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,nLe),d=u/o,p=h.multiplyByScalar(a,d,iLe),g=h.multiplyByScalar(c,d,Rse),m=h.add(f,g,Az[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,Az[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,Az[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,Az[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),Az}var Ose=new U,eFt=new h,Ob=[new he,new he,new he,new he];function Y7(e,t,n,i,r,o){Ose.x=e,Ose.y=t;let s=i.pickEllipsoid(Ose,r,eFt);return l(s)?(Ob[n]=r.cartesianToCartographic(s,Ob[n]),1):(Ob[n]=r.cartesianToCartographic(o[n],Ob[n]),0)}an.prototype.computeViewRectangle=function(e,t){e=e??ee.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ce(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=QLt(this,e);if(c+=Y7(0,0,0,this,e,u),c+=Y7(0,a,1,this,e,u),c+=Y7(s,a,2,this,e,u),c+=Y7(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(Ob,t);let f=0,d=Ob[3].longitude;for(let p=0;p<4;++p){let g=Ob[p].longitude,m=Math.abs(g-d);m>D.PI?f+=D.TWO_PI-m:f+=m,d=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,Ob[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};an.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof Ki)return;let e=this._scene;this.frustum=new Ki,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};an.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof gn)return;let e=lLe(this),t=this._scene;this.frustum=new gn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};an.clone=function(e,t){return l(t)||(t=new an(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),N.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Or=an;function tFt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Sh=tFt;var Bse=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},bz=Bse;var CLe=Qo(Tf(),1),ALe=576,nFt=100,xz="#ffffff",Tz="#48b";function vLe(e,t){this.credit=e,this.count=t??1}function iFt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function rFt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var SLe="cesium-credit-delimiter";function bLe(e){let t=document.createElement("span");return t.textContent=e,t.className=SLe,t}function xLe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function TLe(e,t,n,i){let r=e.childNodes,o=-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(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(bLe(n));else{let f=r[u];f.className!==SLe&&e.replaceChild(bLe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(xLe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(xLe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function oFt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<ALe?(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>=ALe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function ELe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function sFt(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); } -#endif -#ifdef TRANSLUCENT -if (inTranslucencyRectangle()) -{ -vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; -finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); + +.cesium-credit-lightbox { + background-color: #303336; + color: ${xz}; + position: relative; + min-height: ${nFt}px; + margin: auto; } -#endif -out_FragColor = finalColor; +.cesium-credit-lightbox > ul > li a, +.cesium-credit-lightbox > ul > li a:visited, +.cesium-credit-wrapper a, +.cesium-credit-wrapper a:visited { + color: ${xz}; } -#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); +.cesium-credit-lightbox > ul > li a:hover { + color: ${Tz}; } -float linearFade(float edge0, float edge1, float x) -{ -return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +.cesium-credit-lightbox.cesium-credit-lightbox-expanded { + border: 1px solid #444; + border-radius: 5px; + max-width: 470px; } -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; -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); -vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); -float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); -#ifdef SHOW_OCEAN_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); -time = czm_frameNumber * oceanAnimationSpeedLowAltitude; -noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); -vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); -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); -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); -float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; -vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); -#ifdef SHOW_OCEAN_WAVES -float tsPerturbationRatio = normalTangentSpace.z; -vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else -vec3 nonDiffuseHighlight = vec3(0.0); -#endif -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); +.cesium-credit-lightbox.cesium-credit-lightbox-mobile { + height: 100%; + width: 100%; } -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var o2=`#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; -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 -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); +.cesium-credit-lightbox-title { + padding: 20px 20px 0 20px; } -float get2DMercatorYPositionFraction(vec2 textureCoordinates) -{ -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); +.cesium-credit-lightbox-close { + font-size: 18pt; + cursor: pointer; + position: absolute; + top: 0; + right: 6px; + color: ${xz}; } -return positionFraction; +.cesium-credit-lightbox-close:hover { + color: ${Tz}; } -float get2DGeographicYPositionFraction(vec2 textureCoordinates) -{ -return textureCoordinates.y; +.cesium-credit-lightbox > ul { + margin: 0; + padding: 12px 20px 12px 40px; + font-size: 13px; } -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; +.cesium-credit-lightbox > ul > li { + padding-bottom: 6px; } -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) -{ -return getPositionPlanarEarth(position, 0.0, textureCoordinates); +.cesium-credit-lightbox > ul > li * { + padding: 0; + margin: 0; } -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) -{ -return getPositionPlanarEarth(position, height, textureCoordinates); + +.cesium-credit-expand-link { + padding-left: 5px; + cursor: pointer; + text-decoration: underline; + color: ${xz}; } -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) -{ -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; +.cesium-credit-expand-link:hover { + color: ${Tz}; } -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; -#endif + +.cesium-credit-expand-link:focus-visible, +.cesium-credit-lightbox-close:focus-visible { + outline: 2px solid ${Tz}; + outline-offset: 2px; +} + +.cesium-credit-text { + color: ${xz}; +} + +.cesium-credit-delimiter { + padding: 0 5px; +} + +.cesium-credit-textContainer *, +.cesium-credit-logoContainer * { + display: inline; +} + +.cesium-credit-textContainer a:hover { + color: ${Tz} +} + +.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { + padding-left: 5px; +} +`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Jo(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label","Data attribution"),r.appendChild(o);function s(y){o.contains(y.target)||i.hideLightbox()}r.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}r.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",o.appendChild(c);let u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.onkeydown=ELe(this.hideLightbox.bind(this)),u.innerHTML="×",u.className="cesium-credit-lightbox-close",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Close data attribution"),o.appendChild(u);let f=document.createElement("ul");o.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.onkeydown=ELe(this.showLightbox.bind(this)),g.textContent="Data attribution",g.setAttribute("role","button"),g.setAttribute("tabindex","0"),g.setAttribute("aria-haspopup","dialog"),g.setAttribute("aria-expanded","false"),e.appendChild(g),sFt(e);let m=It.clone(Jo.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=f,this._lightbox=r,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=g,this._closeButton=u,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ut,lightboxCredits:new Ut},this._defaultCredit=void 0,this.viewport=n,this.container=e}function wLe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new vLe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Jo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(ILe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,wLe(this,t,e)};Jo.prototype.addStaticCredit=function(e){let t=this._staticCredits;iFt(t,e)||t.push(e)};Jo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Jo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Jo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Jo.prototype.update=function(){this._expanded&&oFt(this)};Jo.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 r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o.isIon()&&It.equals(Jo.cesiumCredit,this._cesiumCredit)||wLe(this,s,o,Number.MAX_VALUE)}It.equals(Jo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(Jo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Jo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;TLe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",TLe(this._creditList,t,void 0,"li"),rFt(this)};Jo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Jo.prototype.isDestroyed=function(){return!1};Jo._cesiumCredit=void 0;Jo._cesiumCreditInitialized=!1;var Z7;function ILe(){if(!l(Z7)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new CLe.default(e).path()),Z7=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Jo._cesiumCreditInitialized||(Jo._cesiumCredit=Z7,Jo._cesiumCreditInitialized=!0),Z7}Object.defineProperties(Jo,{cesiumCredit:{get:function(){return ILe(),Jo._cesiumCredit},set:function(e){Jo._cesiumCredit=e,Jo._cesiumCreditInitialized=!0}}});Jo.CreditDisplayElement=vLe;var Ez=Jo;function Q7(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var aFt=new h,cFt=new $,lFt=new Le,uFt=new Ki,fFt=new $l,dFt=new gn,hFt=new ys,mFt=new z,pFt=[1,1e5];Q7.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++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 o=this._camera,s=o.frustum,a;s instanceof Ki?a=uFt:s instanceof $l?a=fFt:s instanceof gn?a=dFt:a=hFt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=pFt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,aFt);let m=cFt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,lFt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Mn({geometryInstances:new Ft({geometry:new Xx({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,mFt))},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Mn({geometryInstances:new Ft({geometry:new KM({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};Q7.prototype.isDestroyed=function(){return!1};Q7.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 ue(this)};var k0=Q7;var Cz=`in vec4 positionEC; 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 -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; -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; -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; +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); +vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); +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); } -#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 +else +{ +discard; } -`;var nw=`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 -); +czm_writeLogDepth(); } -`;var r2=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; +`;var vz=`in vec4 position; +out vec4 positionEC; void main() { -out_FragColor = texture(u_texture, v_textureCoordinates); +positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); } -`;var s2=`in vec4 position; -in float webMercatorT; -uniform vec2 u_textureDimensions; -out vec2 v_textureCoordinates; -void main() +`;function wz(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=e??0}var Sz=dn.supportsTypedArrays()?new Float32Array(12):[],PLe=new h,DLe=new h,kse=new h,RLe=new h,eW=new h;function gFt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof gn)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,PLe),g=h.normalize(p,DLe),m=h.normalize(h.cross(h.UNIT_Z,p,kse),kse),y=h.normalize(h.cross(g,m,RLe),RLe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,PLe);let x=b/A;o=h.multiplyByScalar(m,x,DLe),s=h.multiplyByScalar(y,x,kse)}let a=h.add(r,s,eW);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,Sz,0);let c=h.subtract(r,s,eW);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,Sz,3);let u=h.add(r,s,eW);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,Sz,6);let f=h.subtract(r,s,eW);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,Sz,9),Sz}wz.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new at({renderState:this._rs,boundingVolume:new ce(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Ye({sources:[vz]}),a=new Ye({sources:[Cz]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=gFt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new St({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Oe.TRIANGLES});this._va=zn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};wz.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};wz.prototype.isDestroyed=function(){return!1};wz.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Iz=wz;function fC(){}var _Ft=/\bgl_FragDepth\b/,yFt=/\bdiscard\b/;function AFt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let a=0;a<o.length;++a)if(_Ft.test(o[a])||yFt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() { -v_textureCoordinates = vec2(position.x, webMercatorT); -gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); + out_FragColor = vec4(1.0); } -`;var iw=`float interpolateByDistance(vec4 nearFarScalar, float distance) +`;i=new Ye({sources:[a]})}else if(!r&&s){let a=`void main() { -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); + out_FragColor = vec4(1.0); + czm_writeLogDepth(); } -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +`;i=new Ye({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function bFt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=Ge.fromCache(r);return n[t.id]=o,o}fC.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=at.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=AFt(n,t.shaderProgram),i.depthOnlyCommand.renderState=bFt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var xFt=/\s+czm_writeLogDepth\(/,TFt=/\s+czm_vertexLogDepth\(/;function EFt(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 r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=o.sources;for(let f=0;f<c.length;++f)if(TFt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Ye.replaceMain(c[d],"czm_log_depth_main");c.push(` + +void main() { -float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; -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); -float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; -float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; -vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; -vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); -underTranslucentGlobe = 0.0; -#if defined(GLOBE_TRANSLUCENT) -czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); -if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { -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); -float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); -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); -underTranslucentGlobe = 1.0; -return; + czm_log_depth_main(); + czm_vertexLogDepth(); } -#endif -computeScattering( -primaryRay, -length(cameraToPositionWC), -lightDirection, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); -float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; -float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; -opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); -float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; -opacity *= pow(nightAlpha, 0.5); +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)xFt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ye.replaceMain(c[f],"czm_log_depth_main");u=` +void main() +{ + czm_log_depth_main(); + czm_writeLogDepth(); } -`;var a2=`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) +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}fC.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=EFt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function CFt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { -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 -if (translucent == 0.0) { -color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); -} -out_FragColor = color; -} -`;var c2=`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) + czm_non_pick_main(); + if (${c}.a == 0.0) { + discard; + } + ${c} = ${n}; +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ye.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Ye({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function Use(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=Ge.fromCache(r);return n[t.id]=o,o}fC.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=at.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=CFt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Use(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var vFt=`uint rgba8UnormToUint32(vec4 c) { -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; + uvec4 b = uvec4(c * 255.0 + 0.5); + return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -`;var l2=`uniform samplerCube u_cubeMap; -in vec3 v_texCoord; -void main() +`;function SFt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${vFt} +void main () { -vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); -out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var u2=`in vec3 position; -out vec3 v_texCoord; + czm_non_snap_main(); + if (${c}.a == 0.0) { + discard; + } + ${c} = ${n}; +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ye.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Ye({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}fC.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=at.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=SFt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Use(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function CP(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function wFt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function OLe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function MLe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function IFt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=OLe(n,i,r)}return e.normalized||(n=MLe(n,e.componentType)),n}function PFt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=OLe(r,o,s)}return e.normalized||(r=MLe(r,e.componentType)),r}function DFt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,s=`pickMetadata-${i}-${r}-${o}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=wFt(u);if(p===1)d[0]=IFt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=PFt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Yf.METADATA_PICKING_ENABLED),CP(g,Yf.METADATA_PICKING_VALUE_TYPE,f),CP(g,Yf.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),CP(g,Yf.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),CP(g,Yf.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),CP(g,Yf.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),CP(g,Yf.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Ye({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}fC.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=DFt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Use(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function RFt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}fC.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=RFt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var cp=fC;function tW(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 r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=D.toRadians(r),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var OFt=new Le,NLe=new Le,MFt=new $;function NFt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,NLe),c=Le.fromAxisAngle(o,i,OFt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,NLe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,MFt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}tW.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;NFt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};tW.prototype.isDestroyed=function(){return!1};tW.prototype.destroy=function(){return this._removeListener(),ue(this)};var Pz=tW;function zse(){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(zse.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var LFt=new h;zse.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!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,D.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,LFt),a=Math.abs(h.dot(n.directionWC,s));o*=1-a,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Dz=zse;var xc={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},dC=xc.DERIVED_COMMANDS_MAXIMUM_LENGTH,GLe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function hC(){this._frontFaceAlphaByDistance=new qt(0,1,0,1),this._backFaceAlphaByDistance=new qt(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=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(dC),this._derivedBlendCommandTypes=new Array(dC),this._derivedPickCommandTypes=new Array(dC),this._derivedCommandTypesToUpdate=new Array(dC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(hC.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}}});hC.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=LLe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=LLe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=FLe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=FLe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=UFt(this,e,t),this._sunVisibleThroughGlobe=FFt(this,e),this._environmentVisible=BFt(this,e),this._useDepthPlane=kFt(this,e),this._numberOfTextureUniforms=zFt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),VFt(this,e)};function LLe(e,t,n,i){return e?l(n)?(qt.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 FLe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function FFt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function BFt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function kFt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function UFt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function zFt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function VFt(e,t){e._derivedCommandsLength=Vse(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Vse(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Vse(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 r=0;for(n=0;n<dC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=nBt())}function Vse(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?xc.PICK_FRONT_FACE:u?xc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:xc.TRANSLUCENT_FRONT_FACE,d=i?xc.PICK_BACK_FACE:u?xc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:xc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=xc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=xc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=xc.DEPTH_ONLY_BACK_FACE),r[o++]=xc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=xc.DEPTH_ONLY_FRONT_FACE),r[o++]=xc.OPAQUE_BACK_FACE,r[o++]=f),o)}function wh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function BLe(e,t){return e.indexOf(t)>-1}function jFt(e,t){wh(e.defines,"TRANSLUCENT"),wh(t.defines,"TRANSLUCENT")}function HFt(e,t){wh(e.defines,"GROUND_ATMOSPHERE"),wh(t.defines,"GROUND_ATMOSPHERE"),wh(e.defines,"FOG"),wh(t.defines,"FOG"),wh(e.defines,"TRANSLUCENT"),wh(t.defines,"TRANSLUCENT")}function jse(e,t){if(BLe(t.defines,"TILE_LIMIT_RECTANGLE")||BLe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function Hse(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Ye.replaceMain(n[o],"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 WLe(e,t){Hse(e,t),wh(e.defines,"GROUND_ATMOSPHERE"),wh(t.defines,"GROUND_ATMOSPHERE"),wh(e.defines,"FOG"),wh(t.defines,"FOG")}function GFt(e,t){Hse(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function WFt(e,t){WLe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function kLe(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 qFt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function YFt(e){e.cull.face=Vi.BACK,e.cull.enabled=!0}function XFt(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0}function KFt(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function $Ft(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function JFt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ULe(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function zLe(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function ZFt(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function QFt(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function eBt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ge.getState(e);i(s),o=Ge.fromCache(s),r[e.id]=o}return o}function vP(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function tBt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function lp(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function nBt(){return[new lp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jFt,getRenderStateFunction:YFt,getUniformMapFunction:void 0}),new lp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:HFt,getRenderStateFunction:XFt,getUniformMapFunction:void 0}),new lp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jse,getRenderStateFunction:KFt,getUniformMapFunction:void 0}),new lp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jse,getRenderStateFunction:$Ft,getUniformMapFunction:void 0}),new lp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jse,getRenderStateFunction:JFt,getUniformMapFunction:void 0}),new lp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Hse,getRenderStateFunction:ULe,getUniformMapFunction:vP}),new lp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:WLe,getRenderStateFunction:zLe,getUniformMapFunction:vP}),new lp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:GFt,getRenderStateFunction:ULe,getUniformMapFunction:vP}),new lp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:WFt,getRenderStateFunction:zLe,getUniformMapFunction:vP}),new lp({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:kLe,getRenderStateFunction:ZFt,getUniformMapFunction:vP}),new lp({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:kLe,getRenderStateFunction:QFt,getUniformMapFunction:vP})]}var VLe=new Array(dC),jLe=new Array(dC);hC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)jLe[r]=this._derivedCommandPacks[n[r]],VLe[r]=GLe[n[r]];iBt(this,e,i,n,VLe,jLe,t)}};function iBt(e,t,n,i,r,o,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 u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],E=a[T],v,S,I;l(E)?(v=E.uniformMap,S=E.shaderProgram,I=E.renderState):(v=void 0,S=void 0,I=void 0),E=at.shallowClone(t,E),a[T]=E;let R=E.derivedCommands.uniformMapDirtyFrame??0,O=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,C=m||O<d,w=y||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=x,E.pass=b.pass,E.pickOnly=b.pickOnly,E.uniformMap=tBt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=qFt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=eBt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}hC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=GLe[r[a]];n.commandList.push(s[c])}};function qLe(e,t,n,i,r,o){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(a,i,r)}}function HLe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var rBt=[xc.OPAQUE_FRONT_FACE,xc.OPAQUE_BACK_FACE],oBt=[xc.DEPTH_ONLY_FRONT_FACE,xc.DEPTH_ONLY_BACK_FACE,xc.DEPTH_ONLY_FRONT_AND_BACK_FACE];hC.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ie.GLOBE],a=e.indices[Ie.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),qLe(s,a,t,i,r,rBt))};hC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:s}=o,a=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&HLe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,qLe(a,c,t,i,r,oBt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}HLe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var Rz=hC;var ff=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; void main() { -vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); -gl_Position = czm_projection * vec4(p, 1.0); -v_texCoord = position.xyz; +out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;var f2=`uniform sampler2D u_texture; +`;function U0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new ai({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new ai({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 li({color:new z(0,0,0,0),owner:this}),this._clearCommand=new li({color:new z(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(U0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});U0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var sBt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},aBt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},cBt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:tn.ALPHA_BLEND},lBt=`uniform sampler2D colorTexture; +uniform sampler2D depthTexture; +uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; void main() { -vec4 color = texture(u_texture, v_textureCoordinates); -out_FragColor = czm_gammaCorrect(color); + 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; } -`;var d2=`uniform float u_radiusTS; +`,uBt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; -vec2 rotate(vec2 p, vec2 direction) +void main() { -return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } +#ifdef UNCLASSIFIED + out_FragColor = color * czm_invertClassificationColor; +#else + out_FragColor = color; +#endif } -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +`;U0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Dt({context:e,width:s,height:a,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Sf({context:e,width:s,height:a,format:Vl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ge.fromCache(sBt),this._rsClassified=Ge.fromCache(aBt),this._rsDefault=Ge.fromCache(cBt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?uBt:lBt,f=new Ye({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ye({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{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(ff,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};U0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};U0.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))};U0.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)};U0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};U0.prototype.isDestroyed=function(){return!1};U0.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()),ue(this)};var SP=U0;function nW(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(nW.prototype,{total:{get:function(){return this._total}}});function Mb(e){let t=new Array(Oc.NUMBER_OF_JOB_TYPES);t[Oc.TEXTURE]=new nW(l(e)?e[Oc.TEXTURE]:10),t[Oc.PROGRAM]=new nW(l(e)?e[Oc.PROGRAM]:10),t[Oc.BUFFER]=new nW(l(e)?e[Oc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}Mb.getTimestamp=xn;Object.defineProperties(Mb.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Mb.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Mb.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};Mb.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=Mb.getTimestamp();e.execute();let a=Mb.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Oz=Mb;function iW(e){e=e??H.EMPTY_OBJECT;let t=Ln(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 r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xn(),this._lastMsSampleTime=xn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(iW.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});iW.prototype.update=function(e){let t=xn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};iW.prototype.destroy=function(){return ue(this)};var ay=iW;var Tc={};Tc.decodeRawMetadataValue=function(e,t,n){switch(e){case Lt.INT8:return t.getInt8(n);case Lt.UINT8:return t.getUint8(n);case Lt.INT16:return t.getInt16(n,!0);case Lt.UINT16:return t.getUint16(n,!0);case Lt.INT32:return t.getInt32(n,!0);case Lt.UINT32:return t.getUint32(n,!0);case Lt.INT64:return t.getBigInt64(n,!0);case Lt.UINT64:return t.getBigUint64(n,!0);case Lt.FLOAT32:return t.getFloat32(n,!0);case Lt.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};Tc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=Tc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};Tc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Lt.getSizeInBytes(i),o=e.type,s=bt.getComponentCount(o),a=r*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*r,g=Tc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return Tc.decodeRawMetadataValueComponent(e,t,c)};Tc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let s=0;s<r;s++){let a=Tc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return Tc.decodeRawMetadataValueElement(e,n,0)};Tc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return U.unpack(n,0,new U);case bt.VEC3:return h.unpack(n,0,new h);case bt.VEC4:return se.unpack(n,0,new se);case bt.MAT2:return Xi.unpack(n,0,new Xi);case bt.MAT3:return $.unpack(n,0,new $);case bt.MAT4:return N.unpack(n,0,new N)}throw new oe(`Invalid metadata object type: ${e}`)};Tc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return U.pack(t,Array(2));case bt.VEC3:return h.pack(t,Array(3));case bt.VEC4:return se.pack(t,Array(4));case bt.MAT2:return Xi.pack(t,Array(4));case bt.MAT3:return $.pack(t,Array(9));case bt.MAT4:return N.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};Tc.decodeMetadataValues=function(e,t,n){let i=Tc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=Tc.convertFromObjectType(e.type,t.offset),s=Tc.convertFromObjectType(e.type,t.scale);i=jp.valueTransformInPlace(i,o,s,Lt.applyValueTransform)}if(e.isArray){let o=e.arrayLength,s=Array(o);for(let a=0;a<o;a++){let c=i[a],u=Tc.convertToObjectType(e.type,c);s[a]=u}return s}return Tc.convertToObjectType(e.type,i)};var Mz=Object.freeze(Tc);function mC(){this._framebuffer=new ai,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(mC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function fBt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function dBt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +void main() { -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); + 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:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}mC.prototype.update=function(e,t){fBt(this,e,t),dBt(this,e,t)};var hBt=new se,mBt=new se(1,1/255,1/65025,1/16581375);mC.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}),r=se.unpack(i,0,hBt);return se.divideByScalar(r,255,r),se.dot(r,mBt)};mC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};mC.prototype.isDestroyed=function(){return!1};mC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Nz=mC;function Nb(){this._framebufferManager=new ai({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(Nb.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});Nb.prototype.update=function(e,t,n,i,r){let o=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,s,1,a,Ke.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};Nb.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};Nb.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};Nb.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};Nb.prototype.isDestroyed=function(){return!1};Nb.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var Lz=Nb;function pC(){this._framebufferManager=new ai({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(pC.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});pC.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ze.FLOAT:ze.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,r,1,o,Ke.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};pC.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};pC.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var Fz=pC;function pBt(e,t){this.near=e??0,this.far=t??0;let n=Ie.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var Bz=pBt;var Lb=`uniform highp sampler2D u_depthTexture; +in vec2 v_textureCoordinates; 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); -burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); -burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); -burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); -color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; -out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;var h2=`in vec2 direction; -uniform float u_size; -out vec2 v_textureCoordinates; +`;function z0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),this._outputFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new ai,this._tempCopyDepthFramebuffer=new ai,this._updateDepthFramebuffer=new ai({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 et,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(z0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer: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}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function YLe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let s=!et.equals(o,r.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!et.equals(o,e._rs.viewport)||a)&&(e._rs=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:tn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Lb,{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(ff,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Lb,{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(ff,{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 li({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}z0.prototype.update=function(e,t,n,i,r,o){let{width:s,height:a}=n,c=r?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),YLe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};z0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};z0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};z0.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 r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,s,a),YLe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};z0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};z0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};z0.prototype.isDestroyed=function(){return!1};z0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.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()),ue(this)};var kz=z0;function gC(){this._framebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new ai,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(gC.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 gBt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function _Bt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function yBt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!et.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Lb,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new li({color:new z(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}gC.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;_Bt(this,n,r,o,e),yBt(this,n,r,o,i),this._useHdr=e};gC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};gC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};gC.prototype.isDestroyed=function(){return!1};gC.prototype.destroy=function(){return gBt(this),ue(this)};var Uz=gC;var wP=`#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() { -vec4 position; -if (czm_morphTime == 1.0) -{ -position = vec4(czm_sunPositionWC, 1.0); -} -else +if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) { -position = vec4(czm_sunPositionColumbusView.zxy, 1.0); +#ifdef MRT +out_FragData_0 = u_bgColor; +out_FragData_1 = vec4(u_bgColor.a); +#else +out_FragColor = u_bgColor; +#endif +return; } -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; +discard; } -`;var m2=`in vec2 v_textureCoordinates; +`;var zz=`uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; +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); +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 Jat(e){let t,n=e.name,i=e.message;c(n)&&c(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return c(o)&&(t+=` -${o}`),t}var ep=Jat;async function ect(e,t,n,i){return c(i)||(i=!1),T.typeOf.object("terrainProvider",e),T.typeOf.number("level",t),T.typeOf.bool("rejectOnTileFail",i),T.defined("positions",n),ict(e,t,n,i)}function tct(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(C0e(i)):r=o.then(C0e(i)).catch(oct(i)),e.shift(),t.push(r),!0}function nct(e){return new Promise(function(t){setTimeout(t,e)})}function LX(e,t,n){return e.length?tct(e,t,n)?LX(e,t,n):nct(100).then(()=>LX(e,t,n)):Promise.resolve()}function ict(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!c(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=h,s.push(h)}a[f].positions.push(n[r])}let l=[];return LX(s,l,i).then(function(){return Promise.all(l).then(function(){return n})})}function A0e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function C0e(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(!A0e(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];A0e(s,i,n)}}):Promise.resolve()}}function oct(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var p2=ect;var NX=new H;async function E0e(e,t,n){if(c(n)||(n=!1),!c(e))throw new E("terrainProvider is required.");if(!c(t))throw new E("positions is required.");let i=[],o=[],r=e.availability;if(!c(r))throw new E("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");let s=[];for(let l=0;l<t.length;++l){let u=t[l],f=r.computeMaximumLevelAtPosition(u);if(o[l]=f,f===0){e.tilingScheme.positionToTileXY(u,1,NX);let p=e.loadTileDataAvailability(NX.x,NX.y,1);c(p)&&s.push(p)}let h=i[f];c(h)||(i[f]=h=[]),h.push(u)}await Promise.all(s),await Promise.all(i.map(function(l,u){if(c(l))return p2(e,u,l,n)}));let a=[];for(let l=0;l<t.length;++l){let u=t[l];r.computeMaximumLevelAtPosition(u)!==o[l]&&a.push(u)}return a.length>0&&await E0e(e,a,n),t}var UT=E0e;async function FX(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),!c(n))return r;let a=n.availability;if(!c(a)||t.mode===oe.SCENE2D)return r;let l=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await FX._sampleTerrainMostDetailed(n,l),f=!1,h=u.reduce(function(g,m){return c(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}FX._sampleTerrainMostDetailed=UT;var VT=FX;var rct={NONE:0,LERC:1},fd=Object.freeze(rct);var sct={NONE:0,BITS12:1},ea=Object.freeze(sct);var zT=new d,act=new d,dd=new H,cH=new B,cct=new B,lct=Math.pow(2,12);function Ic(e,t,n,i,o,r,s,a,l,u){let f=ea.NONE,h,p;if(c(t)&&c(n)&&c(i)&&c(o)){let g=t.minimum,m=t.maximum,y=d.subtract(m,g,act),b=i-n;Math.max(d.maximumComponent(y),b)<lct-1?f=ea.BITS12:f=ea.NONE,h=B.inverseTransformation(o,new B);let A=d.negate(g,zT);B.multiply(B.fromTranslation(A,cH),h,h);let C=zT;C.x=1/y.x,C.y=1/y.y,C.z=1/y.z,B.multiply(B.fromScale(C,cH),h,h),p=B.clone(o),B.setTranslation(p,d.ZERO,p),o=B.clone(o,new B);let S=B.fromTranslation(g,cH),v=B.fromScale(y,cct),P=B.multiply(S,v,cH);B.multiply(o,P,o),B.multiply(p,P,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=l??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Ic.prototype.encode=function(e,t,n,i,o,r,s,a){let l=i.x,u=i.y;if(this.quantization===ea.BITS12){n=B.multiplyByPoint(this.toScaledENU,n,zT),n.x=O.clamp(n.x,0,1),n.y=O.clamp(n.y,0,1),n.z=O.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=O.clamp((o-this.minimumHeight)/f,0,1);H.fromElements(n.x,n.y,dd);let p=Ln.compressTextureCoordinates(dd);H.fromElements(n.z,h,dd);let g=Ln.compressTextureCoordinates(dd);H.fromElements(l,u,dd);let m=Ln.compressTextureCoordinates(dd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){H.fromElements(s,0,dd);let y=Ln.compressTextureCoordinates(dd);e[t++]=y}}else d.subtract(n,this.center,zT),e[t++]=zT.x,e[t++]=zT.y,e[t++]=zT.z,e[t++]=o,e[t++]=l,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Ln.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var uct=new d,S0e=new d;Ic.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 f=0;f<i;f++){let h=s*i+f,p=s*r+f;t[p]=e[h]}let a=this.decodePosition(t,s,uct),l=n.geodeticSurfaceNormal(a,S0e),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=l.x,t[u+1]=l.y,t[u+2]=l.z}};Ic.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,l=r*o+s;t[l]=e[a]}};Ic.prototype.decodePosition=function(e,t,n){if(c(n)||(n=new d),t*=this.stride,this.quantization===ea.BITS12){let i=Ln.decompressTextureCoordinates(e[t],dd);n.x=i.x,n.y=i.y;let o=Ln.decompressTextureCoordinates(e[t+1],dd);return n.z=o.x,B.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};Ic.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,S0e),a=this.decodeHeight(e,t),l=Dr.getHeight(a,i,o)-a;n.x+=s.x*l,n.y+=s.y*l,n.z+=s.z*l}return n};Ic.prototype.decodeTextureCoordinates=function(e,t,n){return c(n)||(n=new H),t*=this.stride,this.quantization===ea.BITS12?Ln.decompressTextureCoordinates(e[t+2],n):H.fromElements(e[t+4],e[t+5],n)};Ic.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===ea.BITS12?Ln.decompressTextureCoordinates(e[t+1],dd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Ic.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===ea.BITS12?Ln.decompressTextureCoordinates(e[t+3],dd).x:e[t+6]};Ic.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 H.fromElements(o,r,n)};Ic.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};Ic.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case ea.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 lH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},uH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Ic.prototype.getAttributes=function(e){let t=$.FLOAT,n=$.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,l){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:l,offsetInBytes:o,strideInBytes:i}),o+=l*n}if(this.quantization===ea.NONE){s(lH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(lH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(lH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,l=this.hasWebMercatorT&&this.hasVertexNormals;s(uH.compressed0,a?4:3),l&&s(uH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(uH.geodeticSurfaceNormal,3)}return r};Ic.prototype.getAttributeLocations=function(){return this.quantization===ea.NONE?lH:uH};Ic.clone=function(e,t){if(c(e))return c(t)||(t=new Ic),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=B.clone(e.toScaledENU),t.fromScaledENU=B.clone(e.fromScaledENU),t.matrix=B.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 Oc=Ic;var tp={};tp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var BX=new d,fct=new B,dct=new d,hct=new d;tp.computeVertices=function(e){if(!c(e)||!c(e.heightmap))throw new E("options.heightmap is required.");if(!c(e.width)||!c(e.height))throw new E("options.width and options.height are required.");if(!c(e.nativeRectangle))throw new E("options.nativeRectangle is required.");if(!c(e.skirtHeight))throw new E("options.skirtHeight is required.");let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=O.PI_OVER_TWO,a=O.toRadians,l=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,g=e.isGeographic??!0,m=e.ellipsoid??ie.default,y=1/m.maximumRadius,b=ce.clone(e.nativeRectangle),x=ce.clone(e.rectangle),A,C,S,v;c(x)?(A=x.west,C=x.south,S=x.east,v=x.north):g?(A=a(b.west),C=a(b.south),S=a(b.east),v=a(b.north)):(A=b.west*y,C=s-2*o(r(-b.south*y)),S=b.east*y,v=s-2*o(r(-b.north*y)));let P=e.relativeToCenter,M=c(P);P=M?P:d.ZERO;let R=e.includeWebMercatorT??!1,L=e.exaggeration??1,F=e.exaggerationRelativeHeight??0,w=L!==1,D=e.structure??tp.DEFAULT_STRUCTURE,I=D.heightScale??tp.DEFAULT_STRUCTURE.heightScale,N=D.heightOffset??tp.DEFAULT_STRUCTURE.heightOffset,k=D.elementsPerHeight??tp.DEFAULT_STRUCTURE.elementsPerHeight,z=D.stride??tp.DEFAULT_STRUCTURE.stride,V=D.elementMultiplier??tp.DEFAULT_STRUCTURE.elementMultiplier,j=D.isBigEndian??tp.DEFAULT_STRUCTURE.isBigEndian,U=ce.computeWidth(b),q=ce.computeHeight(b),Y=U/(u-1),te=q/(f-1);g||(U*=y,q*=y);let K=m.radiiSquared,Z=K.x,ee=K.y,me=K.z,Te=65536,ue=-65536,ye=Ot.eastNorthUpToFixedFrame(P,m),Ae=B.inverseTransformation(ye,fct),Pe,Ee;R&&(Pe=Mi.geodeticLatitudeToMercatorAngle(C),Ee=1/(Mi.geodeticLatitudeToMercatorAngle(v)-Pe));let ze=dct;ze.x=Number.POSITIVE_INFINITY,ze.y=Number.POSITIVE_INFINITY,ze.z=Number.POSITIVE_INFINITY;let qe=hct;qe.x=Number.NEGATIVE_INFINITY,qe.y=Number.NEGATIVE_INFINITY,qe.z=Number.NEGATIVE_INFINITY;let it=Number.POSITIVE_INFINITY,Dt=u*f,jt=h>0?u*2+f*2:0,$e=Dt+jt,un=new Array($e),zt=new Array($e),Ct=new Array($e),Ei=R?new Array($e):[],an=w?new Array($e):[],_e=0,Ce=f,pn=0,mt=u;p&&(--_e,++Ce,--pn,++mt);let so=1e-5;for(let Ze=_e;Ze<Ce;++Ze){let pt=Ze;pt<0&&(pt=0),pt>=f&&(pt=f-1);let Ht=b.north-te*pt;g?Ht=a(Ht):Ht=s-2*o(r(-Ht*y));let Cn=(Ht-C)/(v-C);Cn=O.clamp(Cn,0,1);let Mo=Ze===_e,Ao=Ze===Ce-1;h>0&&(Mo?Ht+=so*q:Ao&&(Ht-=so*q));let Za=t(Ht),Qa=n(Ht),Si=me*Qa,_i;R&&(_i=(Mi.geodeticLatitudeToMercatorAngle(Ht)-Pe)*Ee);for(let ca=pn;ca<mt;++ca){let Jr=ca;Jr<0&&(Jr=0),Jr>=u&&(Jr=u-1);let El=pt*(u*z)+Jr*z,yo;if(k===1)yo=l[El];else{yo=0;let Vo;if(j)for(Vo=0;Vo<k;++Vo)yo=yo*V+l[El+Vo];else for(Vo=k-1;Vo>=0;--Vo)yo=yo*V+l[El+Vo]}yo=yo*I+N,ue=Math.max(ue,yo),Te=Math.min(Te,yo);let Fr=b.west+Y*Jr;g?Fr=a(Fr):Fr=Fr*y;let xp=(Fr-A)/(S-A);xp=O.clamp(xp,0,1);let es=pt*u+Jr;if(h>0){let Vo=ca===pn,cn=ca===mt-1,Se=Mo||Ao||Vo||cn;if((Mo||Ao)&&(Vo||cn))continue;Se&&(yo-=h,Vo?(es=Dt+(f-pt-1),Fr-=so*U):Ao?es=Dt+f+(u-Jr-1):cn?(es=Dt+f+u+pt,Fr+=so*U):Mo&&(es=Dt+f+u+f+Jr))}let hf=Za*t(Fr),Ja=Za*n(Fr),tb=Z*hf,la=ee*Ja,ec=1/i(tb*hf+la*Ja+Si*Qa),hs=tb*ec,mf=la*ec,pf=Si*ec,_f=new d;_f.x=hs+hf*yo,_f.y=mf+Ja*yo,_f.z=pf+Qa*yo,B.multiplyByPoint(Ae,_f,BX),d.minimumByComponent(BX,ze,ze),d.maximumByComponent(BX,qe,qe),it=Math.min(it,yo),un[es]=_f,Ct[es]=new H(xp,Cn),zt[es]=yo,R&&(Ei[es]=_i),w&&(an[es]=m.geodeticSurfaceNormal(_f))}}let Ro=le.fromPoints(un),aa;c(x)&&(aa=Dn.fromRectangle(x,Te,ue,m));let Nr;M&&(Nr=new H_(m).computeHorizonCullingPointPossiblyUnderEllipsoid(P,un,Te));let Cs=new Qg(ze,qe,P),Ne=new Oc(P,Cs,it,ue,ye,!1,R,w,L,F),ot=new Float32Array($e*Ne.stride),Xe=0;for(let Ze=0;Ze<$e;++Ze)Xe=Ne.encode(ot,Xe,un[Ze],Ct[Ze],zt[Ze],void 0,Ei[Ze],an[Ze]);return{vertices:ot,maximumHeight:ue,minimumHeight:Te,encoding:Ne,boundingSphere3D:Ro,orientedBoundingBox:aa,occludeePointInScaledSpace:Nr}};var ow=tp;function w0(){E.throwInstantiationError()}Object.defineProperties(w0.prototype,{credits:{get:E.throwInstantiationError},waterMask:{get:E.throwInstantiationError}});w0.prototype.interpolateHeight=E.throwInstantiationError;w0.prototype.isChildAvailable=E.throwInstantiationError;w0.prototype.createMesh=E.throwInstantiationError;w0.prototype.upsample=E.throwInstantiationError;w0.prototype.wasCreatedByUpsampling=E.throwInstantiationError;w0.maximumAsynchronousTasks=5;var kh=w0;function mct(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=f,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=y}var hd=mct;function gl(){E.throwInstantiationError()}Object.defineProperties(gl.prototype,{errorEvent:{get:E.throwInstantiationError},credit:{get:E.throwInstantiationError},tilingScheme:{get:E.throwInstantiationError},hasWaterMask:{get:E.throwInstantiationError},hasVertexNormals:{get:E.throwInstantiationError},availability:{get:E.throwInstantiationError}});var w0e=[];gl.getRegularGridIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new E("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=w0e[e];c(n)||(w0e[e]=n=[]);let i=n[t];return c(i)||(e*t<O.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),I0e(e,t,i,0)),i};var v0e=[];gl.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new E("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=v0e[e];c(n)||(v0e[e]=n=[]);let i=n[t];if(!c(i)){let o=gl.getRegularGridIndices(e,t),r=P0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,l=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:l,northIndicesWestToEast:u}}return i};var D0e=[];gl.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new E("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=D0e[e];c(n)||(D0e[e]=n=[]);let i=n[t];if(!c(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,l=o+s,u=r+a,f=P0e(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=Fe.createTypedArray(l,u);I0e(e,t,y,0),gl.addSkirtIndices(h,p,g,m,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};gl.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=fH(e,a,r,s),a+=e.length,s=fH(t,a,r,s),a+=t.length,s=fH(n,a,r,s),a+=n.length,fH(i,a,r,s)};function P0e(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 I0e(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,l=a+e,u=l+1,f=a+1;n[i++]=a,n[i++]=l,n[i++]=f,n[i++]=f,n[i++]=l,n[i++]=u,++o}++o}}function fH(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}gl.heightmapTerrainQuality=.25;gl.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*gl.heightmapTerrainQuality/(t*n)};gl.prototype.requestTileGeometry=E.throwInstantiationError;gl.prototype.getLevelMaximumGeometricError=E.throwInstantiationError;gl.prototype.getTileDataAvailable=E.throwInstantiationError;gl.prototype.loadTileDataAvailability=E.throwInstantiationError;var cs=gl;function ug(e){if(!c(e)||!c(e.buffer))throw new E("options.buffer is required.");if(!c(e.width))throw new E("options.width is required.");if(!c(e.height))throw new E("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??fd.NONE;let t=ow.DEFAULT_STRUCTURE,n=e.structure;c(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===fd.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(ug.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var O0e="createVerticesFromHeightmap",pct=new yi(O0e),_ct=new yi(O0e,kh.maximumAsynchronousTasks);ug.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=l.cartographicToCartesian(ce.center(f)),p=this._structure,m=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?_ct:pct).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Oi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!c(b))return;let x=this;return Promise.resolve(b).then(function(A){let C;x._skirtHeight>0?C=cs.getRegularGridAndSkirtIndicesAndEdgeIndices(A.gridWidth,A.gridHeight):C=cs.getRegularGridIndicesAndEdgeIndices(A.gridWidth,A.gridHeight);let S=A.gridWidth*A.gridHeight;return x._mesh=new hd(h,new Float32Array(A.vertices),C.indices,C.indexCountWithoutSkirts,S,A.minimumHeight,A.maximumHeight,le.clone(A.boundingSphere3D),d.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,Dn.clone(A.orientedBoundingBox),Oc.clone(A.encoding),C.westIndicesSouthToNorth,C.southIndicesEastToWest,C.eastIndicesNorthToSouth,C.northIndicesWestToEast),x._buffer=void 0,x._mesh})};ug.prototype._createMeshSync=function(e){T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),h=this._structure,g=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let m=ow.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Oi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=cs.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=cs.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new hd(f,m.vertices,y.indices,y.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};ug.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,l=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=c(this._mesh),g=this._encoding===fd.LERC;if(!p&&g)return;let y;if(p){let b=this._mesh.vertices,x=this._mesh.encoding;y=R0e(b,x,f,h,e,i,o,t,n)}else y=gct(this._buffer,a,l,s,u,e,i,o,t,n),y=y*h+f;return y};ug.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new E("tilingScheme is required.");if(!c(t))throw new E("thisX is required.");if(!c(n))throw new E("thisY is required.");if(!c(i))throw new E("thisLevel is required.");if(!c(o))throw new E("descendantX is required.");if(!c(r))throw new E("descendantY is required.");if(!c(s))throw new E("descendantLevel is required.");if(s-i>1)throw new E("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(l))return;let u=this._width,f=this._height,h=this._structure,p=h.stride,g=new this._bufferType(u*f*p),m=l.vertices,y=l.encoding,b=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(o,r,s),A=h.heightOffset,C=h.heightScale,S=h.elementsPerHeight,v=h.elementMultiplier,P=h.isBigEndian,M=Math.pow(v,S-1);for(let R=0;R<f;++R){let L=O.lerp(x.north,x.south,R/(f-1));for(let F=0;F<u;++F){let _=O.lerp(x.west,x.east,F/(u-1)),w=R0e(m,y,A,C,b,u,f,_,L);w=w<h.lowestEncodedHeight?h.lowestEncodedHeight:w,w=w>h.highestEncodedHeight?h.highestEncodedHeight:w,yct(g,S,v,M,p,P,R*u+F,w)}}return Promise.resolve(new ug({buffer:g,width:u,height:f,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};ug.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new E("thisX is required.");if(!c(t))throw new E("thisY is required.");if(!c(n))throw new E("childX is required.");if(!c(i))throw new E("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};ug.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function gct(e,t,n,i,o,r,s,a,l,u){let f=(l-r.west)*(s-1)/(r.east-r.west),h=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=h|0,y=m+1;y>=a&&(y=a-1,m=a-2);let b=f-p,x=h-m;m=a-1-m,y=a-1-y;let A=dH(e,t,n,i,o,m*s+p),C=dH(e,t,n,i,o,m*s+g),S=dH(e,t,n,i,o,y*s+p),v=dH(e,t,n,i,o,y*s+g);return M0e(b,x,A,C,S,v)}function R0e(e,t,n,i,o,r,s,a,l){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(l-o.south)*(s-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-h,b=f-g;g=s-1-g,m=s-1-m;let x=(t.decodeHeight(e,g*r+h)-n)/i,A=(t.decodeHeight(e,g*r+p)-n)/i,C=(t.decodeHeight(e,m*r+h)-n)/i,S=(t.decodeHeight(e,m*r+p)-n)/i;return M0e(y,b,x,A,C,S)}function M0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function dH(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 yct(e,t,n,i,o,r,s,a){s*=o;let l;if(r)for(l=0;l<t-1;++l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;else for(l=t-1;l>0;--l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;e[s+l]=a}var qa=ug;function rw(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._levelZeroMaximumGeometricError=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe}Object.defineProperties(rw.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(){}}});rw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new qa({buffer:new Uint8Array(16*16),width:16,height:16}))};rw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};rw.prototype.getTileDataAvailable=function(e,t,n){};rw.prototype.loadTileDataAvailability=function(e,t,n){};var np=rw;var bct=new H;function xct(e,t){T.typeOf.object("clippingPlaneCollection",e),T.typeOf.object("context",t);let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,bct),s=r.x,a=r.y,l=o?Cct(s,a):Ect(s,a);return l+=` -`,l+=n?Tct(i):Act(i),l}function Tct(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +} +`;function cy(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 ai({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new ai({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new ai({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new ai({createColorAttachments:!1}),this._opaqueClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new li({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new li({color:new z(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 et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function XLe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Gse(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function KLe(e){XLe(e),Gse(e)}function ABt(e,t,n,i){XLe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,width:n,height:i,flipY:!1})}function bBt(e,t){Gse(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=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,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Gse(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(KLe(e),e._translucentMultipassSupport=!1,i=!1)}return i}cy.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,ABt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!bBt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ye({sources:[zz]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ye({defines:["MRT"],sources:[wP]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ye({sources:[wP]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!et.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ge.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 xBt={enabled:!0,color:new z(0,0,0,0),equationRgb:Fc.ADD,equationAlpha:Fc.ADD,functionSourceRgb:Zr.ONE,functionDestinationRgb:Zr.ONE,functionSourceAlpha:Zr.ZERO,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA},TBt={enabled:!0,color:new z(0,0,0,0),equationRgb:Fc.ADD,equationAlpha:Fc.ADD,functionSourceRgb:Zr.ONE,functionDestinationRgb:Zr.ONE,functionSourceAlpha:Zr.ONE,functionDestinationAlpha:Zr.ONE},EBt={enabled:!0,color:new z(0,0,0,0),equationRgb:Fc.ADD,equationAlpha:Fc.ADD,functionSourceRgb:Zr.ZERO,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Zr.ZERO,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA};function Wse(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ge.getState(i);o.depthMask=!1,o.blending=t,r=Ge.fromCache(o),n[i.id]=r}return r}function CBt(e,t,n){return Wse(t,xBt,e._translucentRenderStateCache,n)}function vBt(e,t,n){return Wse(t,TBt,e._translucentRenderStateCache,n)}function SBt(e,t,n){return Wse(t,EBt,e._alphaRenderStateCache,n)}var wBt=` 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); +`,IBt=` 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; +`,PBt=` float ai = czm_out_FragColor.a; + out_FragColor = vec4(ai); +`;function qse(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ye.replaceMain(f,"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,`#define CESIUM_REDIRECTED_COLOR_OUTPUT +vec4 czm_out_FragColor; +bool czm_discard = false; +`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; +${u}`}return a.sources.push(u),a.sources.push(`void main() { - 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 Act(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) + czm_translucent_main(); + if (czm_discard) { discard; } - return clipAmount; -} -`}function Cct(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 Ect(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 fg=xct;function Sct(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 kX(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function wct(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 vct(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 Dct(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 Pct(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}kX.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,l=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,m=e.showOceanWaves,y=e.enableLighting,b=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,A=e.showGroundAtmosphere,C=e.perFragmentGroundAtmosphere,S=e.hasVertexNormals,v=e.useWebMercatorProjection,P=e.enableFog,M=e.enableClippingPlanes,R=e.clippingPlanes,L=e.enableClippingPolygons,F=e.clippingPolygons,_=e.clippedByBoundaries,w=e.hasImageryLayerCutout,D=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,k=e.hasGeodeticSurfaceNormals,z=e.hasExaggeration,V=e.showUndergroundColor,j=e.translucent,U=0,q="",te=n.renderedMesh.encoding;te.quantization===ea.BITS12&&(U=1,q="QUANTIZATION_BITS12");let Z=0,ee="";_&&(Z=1,ee="TILE_LIMIT_RECTANGLE");let me=0,Te="";w&&(me=1,Te="APPLY_IMAGERY_CUTOUT");let ue=t.mode,ye=ue|o<<2|r<<3|s<<4|a<<5|l<<6|u<<7|p<<8|g<<9|m<<10|y<<11|b<<12|x<<13|A<<14|C<<15|S<<16|v<<17|P<<18|U<<19|h<<20|M<<21|L<<22|Z<<23|me<<24|D<<25|I<<26|N<<27|k<<28|z<<29|V<<30|j<<31|f<<32,Ae=0;c(R)&&R.length>0&&(Ae=M?R.clippingPlanesState:0);let Pe=0;c(F)&&F.length>0&&(Pe=L?F.clippingPolygonsState:0);let Ee=n.surfaceShader;if(c(Ee)&&Ee.numberOfDayTextures===i&&Ee.flags===ye&&Ee.material===this.material&&Ee.clippingShaderState===Ae&&Ee.clippingPolygonShaderState===Pe)return Ee.shaderProgram;let ze=this._shadersByTexturesFlags[i];if(c(ze)||(ze=this._shadersByTexturesFlags[i]=[]),Ee=ze[ye],!c(Ee)||Ee.material!==this.material||Ee.clippingShaderState!==Ae||Ee.clippingPolygonShaderState!==Pe){let qe=this.baseVertexShaderSource.clone(),it=this.baseFragmentShaderSource.clone();Ae!==0&&it.sources.unshift(fg(R,t.context)),Pe!==0&&(it.sources.unshift(vct(t.context)),qe.sources.unshift(Dct(t.context))),qe.defines.push(q),it.defines.push(`TEXTURE_UNITS ${i}`,ee,Te),o&&it.defines.push("APPLY_BRIGHTNESS"),r&&it.defines.push("APPLY_CONTRAST"),s&&it.defines.push("APPLY_HUE"),a&&it.defines.push("APPLY_SATURATION"),l&&it.defines.push("APPLY_GAMMA"),u&&it.defines.push("APPLY_ALPHA"),f&&it.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&it.defines.push("HAS_WATER_MASK"),g&&(it.defines.push("SHOW_REFLECTIVE_OCEAN"),qe.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&it.defines.push("SHOW_OCEAN_WAVES"),N&&it.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(qe.defines.push("UNDERGROUND_COLOR"),it.defines.push("UNDERGROUND_COLOR")),j&&(qe.defines.push("TRANSLUCENT"),it.defines.push("TRANSLUCENT")),y&&(S?(qe.defines.push("ENABLE_VERTEX_LIGHTING"),it.defines.push("ENABLE_VERTEX_LIGHTING")):(qe.defines.push("ENABLE_DAYNIGHT_SHADING"),it.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(qe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(qe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),A&&(qe.defines.push("GROUND_ATMOSPHERE"),it.defines.push("GROUND_ATMOSPHERE"),C&&(qe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),it.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),qe.defines.push("INCLUDE_WEB_MERCATOR_Y"),it.defines.push("INCLUDE_WEB_MERCATOR_Y"),P&&(qe.defines.push("FOG"),it.defines.push("FOG")),h&&it.defines.push("APPLY_SPLIT"),M&&it.defines.push("ENABLE_CLIPPING_PLANES"),L&&(it.defines.push("ENABLE_CLIPPING_POLYGONS"),qe.defines.push("ENABLE_CLIPPING_POLYGONS"),F.inverse&&it.defines.push("CLIPPING_INVERSE"),it.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`),qe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`)),D&&it.defines.push("COLOR_CORRECT"),I&&it.defines.push("HIGHLIGHT_FILL_TILE"),k&&qe.defines.push("GEODETIC_SURFACE_NORMALS"),z&&qe.defines.push("EXAGGERATION");let Dt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;w&&(Dt+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let $e=0;$e<i;++$e)w?Dt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${$e}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Dt+=` color = sampleAndBlend( -`,Dt+=` color, - u_dayTextures[${$e}], - u_dayTextureUseWebMercatorT[${$e}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${$e}], - u_dayTextureTranslationAndScale[${$e}], - ${u?`u_dayTextureAlpha[${$e}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${$e}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${$e}]`:"1.0"}, -${o?`u_dayTextureBrightness[${$e}]`:"0.0"}, - ${r?`u_dayTextureContrast[${$e}]`:"0.0"}, - ${s?`u_dayTextureHue[${$e}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${$e}]`:"0.0"}, - ${l?`u_dayTextureOneOverGamma[${$e}]`:"0.0"}, - ${h?`u_dayTextureSplit[${$e}]`:"0.0"}, - ${N?`u_colorsToAlpha[${$e}]`:"vec4(0.0)"}, - nightBlend ); -`,w&&(Dt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Dt+=` return color; - }`,it.sources.push(Dt),qe.sources.push(wct(ue)),qe.sources.push(Pct(v));let jt=Jt.fromCache({context:t.context,vertexShaderSource:qe,fragmentShaderSource:it,attributeLocations:te.getAttributeLocations()});Ee=ze[ye]=new Sct(i,ye,this.material,jt,Ae,Pe)}return n.surfaceShader=Ee,Ee.shaderProgram};kX.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!c(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],c(t)&&t.shaderProgram.destroy())}return de(this)};var _2=kX;var Ict={NONE:-1,PARTIAL:0,FULL:1},xr=Object.freeze(Ict);function hH(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}hH.reportError=function(e,t,n,i,o,r,s,a){let l=e;return c(e)?(l.provider=t,l.message=i,l.x=o,l.y=r,l.level=s,l.retry=!1,l.error=a,++l.timesRetried):l=new hH(t,i,o,r,s,0,a),c(n)&&n.numberOfListeners>0?n.raiseEvent(l):c(t)&&console.log(`An error occurred in "${t.constructor.name}": ${ep(i)}`),l};hH.reportSuccess=function(e){c(e)&&(e.timesRetried=-1)};var Po=hH;var Oct={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(Oct);var Rct={START:0,LOADING:1,DONE:2,FAILED:3},ta=Object.freeze(Rct);var Mct={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},fo=Object.freeze(Mct);function lr(){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 d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=fo.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(lr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===fo.RECEIVING||e===fo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!c(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(c(this.vertexArray))return this.mesh;if(c(this.fill))return this.fill.mesh}}});var Lct=new he;function UX(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(c(t)&&t!==oe.SCENE3D){let l=n.ellipsoid.cartesianToCartographic(s,Lct);s=n.project(l,r),s=d.fromElements(s.z,s.x,s.y,r)}return s}var Nct=new d,Fct=new d,Bct=new d;lr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!c(r))return;let s=r.vertices,a=r.indices,l=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let h=0;h<u;h+=3){let p=a[h],g=a[h+1],m=a[h+2],y=UX(l,t,n,s,p,Nct),b=UX(l,t,n,s,g,Fct),x=UX(l,t,n,s,m,Bct),A=Zn.rayTriangleParametric(e,y,b,x,i);c(A)&&A<f&&A>=0&&(f=A)}return f!==Number.MAX_VALUE?mn.getPoint(e,f,o):void 0};lr.prototype.freeResources=function(){c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=fo.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()};lr.prototype.freeVertexArray=function(){lr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,lr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};lr.initialize=function(e,t,n){let i=e.data;c(i)||(i=e.data=new lr),e.state===ta.START&&(kct(e,t,n),e.state=ta.LOADING)};lr.processStateMachine=function(e,t,n,i,o,r,s){lr.initialize(e,n,i);let a=e.data;if(e.state===ta.LOADING&&Uct(e,t,n,i,o,r),s)return;let l=e.renderable;e.renderable=c(a.vertexArray);let u=a.terrainState===fo.READY;e.upsampledFromParent=c(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){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=ta.DONE}l&&(e.renderable=!0)};lr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,l=o.imagery,u,f;for(u=0,f=l.length;u<f;++u){let h=l[u];if(!c(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===ai.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),l.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=l.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||c(h.readyImagery),r=r&&c(h.loadingImagery)&&(h.loadingImagery.state===ai.FAILED||h.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function L0e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,l=Oc.clone(s);l.hasGeodeticSurfaceNormals=t,l=Oc.clone(l);let u=l.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(lr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=lr._createVertexArrayForMesh(i.context,o)):(lr._freeVertexArray(e.vertexArray),e.vertexArray=lr._createVertexArrayForMesh(i.context,o)),lr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}lr.prototype.addGeodeticSurfaceNormals=function(e,t){L0e(this,!0,e,t)};lr.prototype.removeGeodeticSurfaceNormals=function(e){L0e(this,!1,void 0,e)};lr.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,l=o.encoding,u=l.exaggeration!==r,f=l.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!l.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&l.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(l.exaggeration=r,l.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let g=0;g<p;g++){let m=h[g];m.level=-1}}}};function kct(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!c(i)&&c(e.parent)){let o=e.parent,r=o.data;c(r)&&c(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=fo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Uct(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===fo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||lr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===fo.FAILED&&Vct(s,e,t,n,e.x,e.y,e.level),s.terrainState===fo.UNLOADED&&zct(s,n,e.x,e.y,e.level),s.terrainState===fo.RECEIVED&&Gct(s,t,n,e.x,e.y,e.level),s.terrainState===fo.TRANSFORMED&&(jct(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=fo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)qct(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);c(u)&&c(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function Vct(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=ta.FAILED;return}let l=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!c(l))return;let p=l.upsample(i.tilingScheme,u,f,h,o,r,s);c(p)&&(e.terrainState=fo.RECEIVING,Promise.resolve(p).then(function(g){c(g)&&(e.terrainData=g,e.terrainState=fo.RECEIVED)}).catch(function(){e.terrainState=fo.FAILED}))}function zct(e,t,n,i,o){function r(l){if(!c(l)){e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainData=l,e.terrainState=fo.RECEIVED,e.request=void 0}function s(l){if(e.request.state===$n.CANCELLED){e.terrainData=void 0,e.terrainState=fo.UNLOADED,e.request=void 0;return}e.terrainState=fo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${l}"`;t._requestError=Po.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let l=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN});e.request=l;let u=t.requestTileGeometry(n,i,o,l);c(u)?(e.terrainState=fo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=fo.UNLOADED,e.request=void 0)}a()}var Hct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Gct(e,t,n,i,o,r){let s=n.tilingScheme,a=Hct;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);c(u)&&(e.terrainState=fo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=fo.TRANSFORMED}).catch(function(){e.terrainState=fo.FAILED}))}lr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=yt.createVertexBuffer({context:e,typedArray:n,usage:Be.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!c(s)||s.isDestroyed()){let a=t.indices;s=yt.createIndexBuffer({context:e,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ti({context:e,attributes:o,indexBuffer:s})};lr._freeVertexArray=function(e){if(c(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),c(t)&&!t.isDestroyed()&&c(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function jct(e,t,n,i,o,r,s){e.vertexArray=lr._createVertexArrayForMesh(t,e.mesh),e.terrainState=fo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Wct(e){let t=e.cache.tile_waterMaskData;if(!c(t)){let n=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function qct(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=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.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)}lr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;c(t)&&(!c(t.data)||!c(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};lr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,l=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=l*(o.south-i.south)/s,n.z=a,n.w=l,n};var md=lr;function v0(e){if(e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Mi(this._ellipsoid),c(e.rectangleSouthwestInMeters)&&c(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new H(-i,-i),this._rectangleNortheastInMeters=new H(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(v0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});v0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};v0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};v0.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return c(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)};v0.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,l=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return c(i)?(i.west=a,i.south=h,i.east=l,i.north=f,i):new ce(a,h,l,f)};v0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new H(o.west,o.south)),a=r.unproject(new H(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};v0.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,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,m=p/a|0;m>=o&&(m=o-1);let y=g/u|0;return y>=r&&(y=r-1),c(n)?(n.x=m,n.y=y,n):new H(m,y)};var ls=v0;var VX,N0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",sw={};sw.defaultAccessToken=N0e;sw.defaultWorldImageryServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});sw.defaultWorldHillshadeServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});sw.defaultWorldOceanServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});sw.getDefaultTokenCredit=function(e){if(e===N0e){if(!c(VX)){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>';VX=new Tt(t,!0)}return VX}};var Zu=sw;function zX(e){if(e=e??W.EMPTY_OBJECT,!c(e.missingImageUrl))throw new E("options.missingImageUrl is required.");if(!c(e.pixelsToCheck))throw new E("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=we.createIfNeeded(e.missingImageUrl),n=this;function i(r){c(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Id(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,l=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f<h;++f){let p=u[f],g=p.x*4+p.y*l;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)}zX.prototype.isReady=function(){return this._isReady};zX.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new E("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,n=this._missingImagePixels;if(!c(n)||c(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Id(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],l=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=l+u;if(i[f]!==n[f])return!1}}return!0};var g2=zX;function HX(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}HX.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)}c(n)&&(this.name=e[n])};HX.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];c(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 Uh=HX;function aw(){E.throwInstantiationError()}Object.defineProperties(aw.prototype,{rectangle:{get:E.throwInstantiationError},tileWidth:{get:E.throwInstantiationError},tileHeight:{get:E.throwInstantiationError},maximumLevel:{get:E.throwInstantiationError},minimumLevel:{get:E.throwInstantiationError},tilingScheme:{get:E.throwInstantiationError},tileDiscardPolicy:{get:E.throwInstantiationError},errorEvent:{get:E.throwInstantiationError},credit:{get:E.throwInstantiationError},proxy:{get:E.throwInstantiationError},hasAlphaChannel:{get:E.throwInstantiationError}});aw.prototype.getTileCredits=function(e,t,n){E.throwInstantiationError()};aw.prototype.requestImage=function(e,t,n,i){E.throwInstantiationError()};aw.prototype.pickFeatures=function(e,t,n,i,o){E.throwInstantiationError()};var Yct=/\.ktx2$/i;aw.loadImage=function(e,t){T.defined("url",t);let n=we.createIfNeeded(t);return Yct.test(n.url)?Il(n):c(e)&&c(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var yl=aw;var Xct={SATELLITE:1,OCEANS:2,HILLSHADE:3},Vh=Object.freeze(Xct);function F0e(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Tt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}F0e.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&&!c(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new g2({missingImageUrl:B0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new H(0,0),new H(200,20),new H(20,200),new H(80,110),new H(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Kct(e,t){let n=e.tileInfo;if(!c(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 ls({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({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,c(e.fullExtent)){if(c(e.fullExtent.spatialReference)&&c(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Mi,o=e.fullExtent,r=i.unproject(new d(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 d(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}c(e.copyrightText)&&e.copyrightText.length>0&&(c(t.credit)?t.tileCredits=[new Tt(e.copyrightText)]:t.credit=new Tt(e.copyrightText))}function $ct(e,t){let n=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Zct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Kct(i,t)}catch(i){$ct(e,i)}}function ip(e){e=e??W.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=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 Tt(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new pe}ip.fromBasemapType=async function(e,t){T.defined("style",e),t=t??W.EMPTY_OBJECT;let n,i,o;switch(e){case Vh.SATELLITE:{n=t.token??Zu.defaultAccessToken,i=we.createIfNeeded(Zu.defaultWorldImageryServer),i.appendForwardSlash();let r=Zu.getDefaultTokenCredit(n);c(r)&&(o=Tt.clone(r))}break;case Vh.OCEANS:{n=t.token??Zu.defaultAccessToken,i=we.createIfNeeded(Zu.defaultWorldOceanServer),i.appendForwardSlash();let r=Zu.getDefaultTokenCredit(n);c(r)&&(o=Tt.clone(r))}break;case Vh.HILLSHADE:{n=t.token??Zu.defaultAccessToken,i=we.createIfNeeded(Zu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Zu.getDefaultTokenCredit(n);c(r)&&(o=Tt.clone(r))}break;default:throw new E(`Unsupported basemap type: ${e}`)}return ip.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function B0e(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),l={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Oi?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:l})}return r}Object.defineProperties(ip.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}}});ip.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&n.setQueryParameters({token:t.token});let i=new ip(t);i._resource=n;let o=new F0e(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Zct(n,o),o.build(i),i};ip.prototype.getTileCredits=function(e,t,n){return this._tileCredits};ip.prototype.requestImage=function(e,t,n,i){return yl.loadImage(this,B0e(this,e,t,n,i))};ip.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,l;if(this._tilingScheme.projection instanceof Oi)s=O.toDegrees(i),a=O.toDegrees(o),l="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,l="3857"}let u="visible";c(this._layers)&&(u+=`:${this._layers}`);let f={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:l,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!c(m))return g;for(let y=0;y<m.length;++y){let b=m[y],x=new Uh;if(x.data=b,x.name=b.value,x.properties=b.attributes,x.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let A=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(A===4326||A===4283)x.position=he.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(A===102100||A===900913||A===3857){let C=new Mi;x.position=C.unproject(new d(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(x)}return g})};ip._metadataCache={};var dg=ip;var Qct={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"},cw=Object.freeze(Qct);function y2(e){}y2.prototype.isReady=function(){return!0};y2.prototype.shouldDiscardImage=function(e){return y2.EMPTY_IMAGE===e};var mH;Object.defineProperties(y2,{EMPTY_IMAGE:{get:function(){return c(mH)||(mH=new Image,mH.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),mH}}});var lw=y2;function k0e(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}k0e.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 Tt)break;o.credit=new Tt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let l=r[s],u=l.bbox;l.bbox=new ce(O.toRadians(u[1]),O.toRadians(u[0]),O.toRadians(u[3]),O.toRadians(u[2]))}}};function Jct(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;c(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>c(r.bbox)))),t.attributionList=i}function elt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i+=`: ${t.message}`),Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function tlt(e,t,n){let i=e.url,o=Fs._metadataCache[i];c(o)||(o=e.fetchJsonp("jsonp"),Fs._metadataCache[i]=o);try{let r=await o;return Jct(r,t)}catch(r){elt(e,r,n)}}function Fs(e){e=e??W.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=e.mapStyle??cw.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new lw),this._proxy=e.proxy,this._credit=new Tt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Fs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new ls({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 pe}Object.defineProperties(Fs.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 c(this.mapLayer)}}});Fs.fromUrl=async function(e,t){t=t??W.EMPTY_OBJECT,T.defined("url",e),T.defined("options.key",t.key);let n=t.tileProtocol;c(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??cw.AERIAL,o=we.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};c(t.mapLayer)&&(r.mapLayer=t.mapLayer),c(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Fs(t);a._resource=o;let l=new k0e(t);return await tlt(s,l),l.build(a),a};var nlt=new ce;Fs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,nlt);return rlt(this._attributionList,n,i)};Fs.prototype.requestImage=function(e,t,n,i){let o=yl.loadImage(this,ilt(this,e,t,n,i));if(c(o))return o.catch(function(r){return c(r.blob)&&r.blob.size===0?lw.EMPTY_IMAGE:Promise.reject(r)})};Fs.prototype.pickFeatures=function(e,t,n,i,o){};Fs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Fs.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&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Fs._logoUrl=void 0;Object.defineProperties(Fs,{logoUrl:{get:function(){return c(Fs._logoUrl)||(Fs._logoUrl=tn("Assets/Images/bing_maps_credit.png")),Fs._logoUrl},set:function(e){T.defined("value",e),Fs._logoUrl=e}}});function ilt(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:Fs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var olt=new ce;function rlt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,l=!1;for(let u=0,f=s.coverageAreas.length;!l&&u<f;++u){let h=a[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,olt);c(p)&&(l=!0)}}l&&i.push(s.credit)}return i}Fs._metadataCache={};var b2=Fs;var U0e=/{[^}]+}/g,V0e={x:llt,y:flt,z:mlt,s:plt,reverseX:ult,reverseY:dlt,reverseZ:hlt,westDegrees:_lt,southDegrees:glt,eastDegrees:ylt,northDegrees:blt,westProjected:xlt,southProjected:Tlt,eastProjected:Alt,northProjected:Clt,width:Elt,height:Slt},slt=xt(V0e,{i:wlt,j:vlt,reverseI:Dlt,reverseJ:Plt,longitudeDegrees:Olt,latitudeDegrees:Rlt,longitudeProjected:Mlt,latitudeProjected:Llt,format:Flt});function x2(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,T.defined("options.url",e.url);let t=we.createIfNeeded(e.url),n=we.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():c(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new ls({ellipsoid:e.ellipsoid}),this._rectangle=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 Tt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=xt(V0e,r),a=xt(slt,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=e.enablePickFeatures??!0}Object.defineProperties(x2.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}}});x2.prototype.getTileCredits=function(e,t,n){};x2.prototype.requestImage=function(e,t,n,i){return yl.loadImage(this,alt(this,e,t,n,i))};x2.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!c(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function l(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=clt(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(l):u.type==="xml"?f.fetchXML().then(u.callback).catch(l):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(l):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(l)}return l()};var pH=!1,Qu=new ce,_H=!1,T2=new ce;function alt(e,t,n,i,o){pH=!1,_H=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,l={},u=s.match(U0e);return c(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);c(a[h])&&(l[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:l})}var GX=!1,fw=new H,jX=!1;function clt(e,t,n,i,o,r,s){pH=!1,_H=!1,GX=!1,jX=!1;let a=e._pickFeaturesResource,l=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=l.match(U0e);return c(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);c(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function dw(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 llt(e,t,n,i){return dw(e,"{x}",t)}function ult(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return dw(e,"{reverseX}",o)}function flt(e,t,n,i){return dw(e,"{y}",n)}function dlt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return dw(e,"{reverseY}",o)}function hlt(e,t,n,i){let o=e.maximumLevel,r=c(o)&&i<o?o-i-1:i;return dw(e,"{reverseZ}",r)}function mlt(e,t,n,i){return dw(e,"{z}",i)}function plt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function gH(e,t,n,i){pH||(e.tilingScheme.tileXYToRectangle(t,n,i,Qu),Qu.west=O.toDegrees(Qu.west),Qu.south=O.toDegrees(Qu.south),Qu.east=O.toDegrees(Qu.east),Qu.north=O.toDegrees(Qu.north),pH=!0)}function _lt(e,t,n,i){return gH(e,t,n,i),Qu.west}function glt(e,t,n,i){return gH(e,t,n,i),Qu.south}function ylt(e,t,n,i){return gH(e,t,n,i),Qu.east}function blt(e,t,n,i){return gH(e,t,n,i),Qu.north}function yH(e,t,n,i){_H||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,T2),_H=!0)}function xlt(e,t,n,i){return yH(e,t,n,i),T2.west}function Tlt(e,t,n,i){return yH(e,t,n,i),T2.south}function Alt(e,t,n,i){return yH(e,t,n,i),T2.east}function Clt(e,t,n,i){return yH(e,t,n,i),T2.north}function Elt(e,t,n,i){return e.tileWidth}function Slt(e,t,n,i){return e.tileHeight}function wlt(e,t,n,i,o,r,s){return bH(e,t,n,i,o,r),fw.x}function vlt(e,t,n,i,o,r,s){return bH(e,t,n,i,o,r),fw.y}function Dlt(e,t,n,i,o,r,s){return bH(e,t,n,i,o,r),e.tileWidth-fw.x-1}function Plt(e,t,n,i,o,r,s){return bH(e,t,n,i,o,r),e.tileHeight-fw.y-1}var Ilt=new ce,uw=new d;function bH(e,t,n,i,o,r,s){if(GX)return;WX(e,t,n,i,o,r);let a=uw,l=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Ilt);fw.x=e.tileWidth*(a.x-l.west)/l.width|0,fw.y=e.tileHeight*(l.north-a.y)/l.height|0,GX=!0}function Olt(e,t,n,i,o,r,s){return O.toDegrees(o)}function Rlt(e,t,n,i,o,r,s){return O.toDegrees(r)}function Mlt(e,t,n,i,o,r,s){return WX(e,t,n,i,o,r),uw.x}function Llt(e,t,n,i,o,r,s){return WX(e,t,n,i,o,r),uw.y}var Nlt=new he;function WX(e,t,n,i,o,r,s){if(!jX){if(e.tilingScheme.projection instanceof Oi)uw.x=O.toDegrees(o),uw.y=O.toDegrees(r);else{let a=Nlt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,uw)}jX=!0}}function Flt(e,t,n,i,o,r,s){return s}var Ya=x2;function pd(e){Ya.call(this,e)}pd._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return pd._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof sm)return pd._metadataFailure(e,t);throw o}};pd.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??W.EMPTY_OBJECT;let r=await pd._requestMetadata(t,i,o);return new pd(r)};c(Object.create)&&(pd.prototype=Object.create(Ya.prototype),pd.prototype.constructor=pd);function z0e(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 H0e(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}pd._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,l=/boundingbox/i,u,f,h,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){h=g.item(R);let L=g.item(R).childNodes;for(let F=0;F<L.length;F++)s.test(L.item(F).nodeName)&&p.push(L.item(F))}else l.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!c(h)||!c(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,c(o)&&Po.reportError(void 0,o,o.errorEvent,m),new ae(m);let y=t.fileExtension??u.getAttribute("extension"),b=t.tileWidth??parseInt(u.getAttribute("width"),10),x=t.tileHeight??parseInt(u.getAttribute("height"),10),A=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),C=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),S=h.getAttribute("profile"),v=t.tilingScheme;if(!c(v))if(S==="geodetic"||S==="global-geodetic")v=new Ki({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new ls({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${S}.`,c(o)&&Po.reportError(void 0,o,o.errorEvent,m),new ae(m);let P=ce.clone(t.rectangle);if(!c(P)){let R,L,F,_;t.flipXY??!1?(F=new H(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new H(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(F=new H(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new H(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let D=S==="geodetic"||S==="mercator";if(v.projection instanceof Oi||D)R=he.fromDegrees(F.x,F.y),L=he.fromDegrees(_.x,_.y);else{let I=v.projection;R=I.unproject(F),L=I.unproject(_)}P=new ce(R.longitude,R.latitude,L.longitude,L.latitude)}return P=z0e(P,v),A=H0e(v,P,A),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:P,tileWidth:b,tileHeight:x,minimumLevel:A,maximumLevel:C,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};pd._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=c(e.tilingScheme)?e.tilingScheme:new ls({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=z0e(a,s);let l=H0e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:l,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var D0=pd;function G0e(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}G0e.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Blt(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(!c(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!c(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,c(n.projection)&&n.projection==="flat")t.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!c(n.projection)||n.projection==="mercator")t.tilingScheme=new ls({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function klt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw c(e)&&c(e.message)&&(i+=`: ${e.message}`),Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function Ult(e,t,n){try{let i=await e.fetchText();Blt(i,t)}catch(i){klt(i,e,n)}}function iu(e){e=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 Tt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${iu.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 pe}Object.defineProperties(iu.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}}});iu.fromUrl=async function(e,t,n){T.defined("url",e),T.defined("channel",t),n=n??{};let i=n.path??"/default_map",o=we.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 G0e(n);s.channel=t,await Ult(r,s);let a=new iu(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};iu.prototype.getTileCredits=function(e,t,n){};iu.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 yl.loadImage(this,o)};iu.prototype.pickFeatures=function(e,t,n,i,o){};iu._logoUrl=void 0;Object.defineProperties(iu,{logoUrl:{get:function(){return c(iu._logoUrl)||(iu._logoUrl=tn("Assets/Images/google_earth_credit.png")),iu._logoUrl},set:function(e){T.defined("value",e),iu._logoUrl=e}}});var A2=iu;var Vlt=/\/$/,j0e=new Tt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function hw(e){e=e??W.EMPTY_OBJECT;let t=e.mapId;if(!c(t))throw new E("options.mapId is required.");let n=e.accessToken;if(!c(n))throw new E("options.accessToken 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;let i=we.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Vlt.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;c(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Tt(s))):s=j0e,this._resource=i,this._imageryProvider=new Ya({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(hw.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}}});hw.prototype.getTileCredits=function(e,t,n){};hw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};hw.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};hw._defaultCredit=j0e;var C2=hw;function HT(e){e=e??W.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=e.rectangle??ce.MAX_VALUE,n=new Ki({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 pe;let i=e.credit;typeof i=="string"&&(i=new Tt(i)),this._credit=i,T.defined("options.url",e.url);let o=we.createIfNeeded(e.url);this._resource=o,T.typeOf.number("options.tileWidth",e.tileWidth),T.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(HT.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 zlt(e,t,n,i){let o=`Failed to load image ${e.url}`;c(t)&&c(t.message)&&(o+=`: ${t.message}`);let r=Po.reportError(i,n,c(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return qX(e,n,r);throw c(n)&&(n._hasError=!0),new ae(o)}async function qX(e,t,n){try{return await yl.loadImage(null,e)}catch(i){return zlt(e,i,t,n)}}HT.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e),i=await qX(n);t=t??W.EMPTY_OBJECT;let o=new HT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};HT.prototype.getTileCredits=function(e,t,n){};HT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!c(this._image)){let o=await qX(this._resource,this);return this._image=o,Po.reportSuccess(this._errorEvent),o}return this._image};HT.prototype.pickFeatures=function(e,t,n,i,o){};var E2=HT;function Hlt(e,t,n){if(!c(e))throw new E("type is required.");if(this.type=e,!c(t))if(e==="json")t="application/json";else if(e==="xml")t="text/xml";else if(e==="html")t="text/html";else if(e==="text")t="text/plain";else throw new E('format is required when type is not "json", "xml", "html", or "text".');if(this.format=t,!c(n))if(e==="json")n=Glt;else if(e==="xml")n=Ylt;else if(e==="html")n=W0e;else if(e==="text")n=W0e;else throw new E('callback is required when type is not "json", "xml", "html", or "text".');this.callback=n}function Glt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Uh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),c(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 YX="http://www.mapinfo.com/mxp",jlt="http://www.esri.com/wms",Wlt="http://www.opengis.net/wfs",qlt="http://www.opengis.net/gml";function Ylt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===YX)return Xlt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===jlt)return Klt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Wlt)return $lt(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Zlt(e):Qlt(e)}function Xlt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(YX,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(YX,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();s[h]=p}}let l=new Uh;l.data=r,l.properties=s,l.configureNameFromProperties(s),l.configureDescriptionFromProperties(s),t.push(l)}return t}function Klt(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 l=0;l<a.length;++l){let u=a[l];i[u.name]=u.value}n.push(xH(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let l=a.childNodes;for(let u=0;u<l.length;++u){let f=l[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(xH(a,i))}}return n}function $lt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(qlt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};XX(r,s),t.push(xH(r,s))}return t}function Zlt(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(!c(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={};XX(s,a),t.push(xH(s,a))}}return t}function XX(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()&&XX(o,t)&&(t[o.localName]=o.textContent)}return n}function xH(e,t){let n=new Uh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Qlt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Uh;return o.data=e,o.description=n.innerHTML,[o]}var Jlt=/<body>\s*<\/body>/im,eut=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,tut=/<title>([\s\S]*)<\/title>/im;function W0e(e){if(Jlt.test(e)||eut.test(e))return;let t,n=tut.exec(e);n&&n.length>1&&(t=n[1]);let i=new Uh;return i.name=t,i.description=e,i.data=e,[i]}var GT=Hlt;function S2(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.times",e.times),T.typeOf.func("options.requestImageFunction",e.requestImageFunction),T.typeOf.func("options.reloadFunction",e.reloadFunction),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(S2.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!c(e))throw new E("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!c(e))throw new E("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});S2.prototype.getFromCache=function(e,t,n,i){let o=q0e(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(c(s)&&c(s[o])){let a=s[o];r=a.promise.catch(function(l){throw i.state=a.request.state,l}),delete s[o]}return r};S2.prototype.checkApproachingInterval=function(e,t,n,i){let o=q0e(e,t,n),r=this._tilesRequestedForInterval,s=Y0e(this),a={key:o,priorityFunction:i.priorityFunction};(!c(s)||!X0e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};S2.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=Y0e(this);if(c(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let l=s.pop();a=X0e(this,l,r),a||s.push(l)}}};function q0e(e,t,n){return`${e}-${t}-${n}`}function nut(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Y0e(e){let t=e._times;if(!c(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 l=t.get(a);return r>0?(s=Q.secondsDifference(l.stop,i),++a):(s=Q.secondsDifference(l.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function X0e(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];c(r)||(r=o[i]={});let s=t.key;if(c(r[s]))return!0;let a=nut(s),l=new Qo({throttle:!1,throttleByServer:!0,type:ms.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,l,n);return c(u)?(r[s]={promise:u,request:l},!0):!1}var jT=S2;var iut=[3034,3035,3042,3043,3044],out=[4471,4559];function zh(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new E("options.url is required.");if(!c(e.layers))throw new E("options.layers is required.");if(c(e.times)&&!c(e.clock))throw new E("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=e.getFeatureInfoUrl??e.url;let t=we.createIfNeeded(e.url),n=we.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(zh.DefaultParameters,!0),n.setQueryParameters(zh.GetFeatureInfoDefaultParameters,!0),c(e.parameters)&&t.setQueryParameters(K0e(e.parameters)),c(e.getFeatureInfoParameters)&&n.setQueryParameters(K0e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new jT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,l,u,f){return $0e(i,s,a,l,u,f)},reloadFunction:function(){c(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=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Mi?"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&&!out.includes(a)||iut.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Mi?"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 Ya({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({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:e.getFeatureInfoFormats??zh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function $0e(e,t,n,i,o,r){let s=c(r)?r.data:void 0,a=e._tileProvider;return c(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function rut(e,t,n,i,o,r,s){let a=c(s)?s.data:void 0,l=e._tileProvider;return c(a)&&l._pickFeaturesResource.setQueryParameters(a),l.pickFeatures(t,n,i,o,r)}Object.defineProperties(zh.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}}});zh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};zh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=$0e(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};zh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=c(r)?r.currentInterval:void 0;return rut(this,e,t,n,i,o,s)};zh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});zh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});zh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GT("json","application/json")),Object.freeze(new GT("xml","text/xml")),Object.freeze(new GT("text","text/html"))]);function K0e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var w2=zh;var sut=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function v2(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new E("options.url is required.");if(!c(e.layer))throw new E("options.layer is required.");if(!c(e.style))throw new E("options.style is required.");if(!c(e.tileMatrixSetID))throw new E("options.tileMatrixSetID is required.");if(c(e.times)&&!c(e.clock))throw new E("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;let t=we.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!c(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(sut),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=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new ls({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new jT({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,m,y){return Z0e(s,h,p,g,m,y)},reloadFunction:function(){c(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(l.x-a.x)+1)*(Math.abs(l.y-a.y)+1);if(u>4)throw new E(`The imagery provider's rectangle and minimumLevel indicate that there are ${u} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new Tt(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():c(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Z0e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=c(s)?s[i]:i.toString(),l=e._subdomains,u=e._dimensions,f=c(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),c(u)&&h.setTemplateValues(u),c(f)&&h.setTemplateValues(f);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,c(u)&&(g=xt(g,u)),c(f)&&(g=xt(g,f)),p={s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return yl.loadImage(e,h)}Object.defineProperties(v2.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,c(this._reload)&&this._reload())}}});v2.prototype.getTileCredits=function(e,t,n){};v2.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=Z0e(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};v2.prototype.pickFeatures=function(e,t,n,i,o){};var D2=v2;var aut={ARCGIS_MAPSERVER:dg.fromUrl,BING:async(e,t)=>b2.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,A2.fromUrl(e,n,t)},MAPBOX:(e,t)=>new C2({url:e,...t}),SINGLE_TILE:E2.fromUrl,TMS:D0.fromUrl,URL_TEMPLATE:(e,t)=>new Ya({url:e,...t}),WMS:(e,t)=>new w2({url:e,...t}),WMTS:(e,t)=>new D2({url:e,...t})};function op(e){e=e??W.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 pe}Object.defineProperties(op.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(){}}});op.fromAssetId=async function(e,t){T.typeOf.number("assetId",e),t=t??W.EMPTY_OBJECT;let n=Cu._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=op._endpointCache[i];c(o)||(o=n.fetchJson(),op._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(!c(a))s=await D0.fromUrl(new Cu(r,n));else{let u=aut[a];if(!c(u))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},h=f.url;delete f.url,s=await u(h,f)}let l=new op(t);return s.errorEvent.addEventListener(function(u){u.provider=l,l._errorEvent.raiseEvent(u)}),l._tileCredits=Cu.getCreditsFromEndpoint(r,n),l._imageryProvider=s,l};op.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return c(i)?this._tileCredits.concat(i):this._tileCredits};op.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};op.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};op._endpointCache={};var hg=op;var cut={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},mg=Object.freeze(cut);function lut(e){e=e??W.EMPTY_OBJECT;let t=e.style??mg.AERIAL;return hg.fromAssetId(t)}var pg=lut;function mw(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=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!c(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}mw.createPlaceholder=function(e){let t=new mw(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};mw.prototype.addReference=function(){++this.referenceCount};mw.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),c(this.parent)&&this.parent.releaseReference(),c(this.image)&&c(this.image.destroy)&&this.image.destroy(),c(this.texture)&&this.texture.destroy(),c(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),de(this),0):this.referenceCount};mw.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var pw=mw;function KX(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}KX.prototype.freeResources=function(){c(this.readyImagery)&&this.readyImagery.releaseReference(),c(this.loadingImagery)&&this.loadingImagery.releaseReference()};KX.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return c(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(;c(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!c(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,c(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?c(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var _w=KX;function Ai(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=t??W.EMPTY_OBJECT,e=e??W.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Ai.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ai.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ai.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ai.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ai.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ai.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ai.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ai.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ce.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new _w(pw.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=t.colorToAlphaThreshold??Ai.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ai.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return c(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ai.DEFAULT_BRIGHTNESS=1;Ai.DEFAULT_CONTRAST=1;Ai.DEFAULT_HUE=0;Ai.DEFAULT_SATURATION=1;Ai.DEFAULT_GAMMA=1;Ai.DEFAULT_SPLIT=Vr.NONE;Ai.DEFAULT_MINIFICATION_FILTER=Yt.LINEAR;Ai.DEFAULT_MAGNIFICATION_FILTER=li.LINEAR;Ai.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ai.fromProviderAsync=function(e,t){T.typeOf.object("imageryProviderPromise",e);let n=new Ai(void 0,t);return mut(n,Promise.resolve(e)),n};Ai.fromWorldImagery=function(e){return e=e??W.EMPTY_OBJECT,Ai.fromProviderAsync(pg({style:e.style}),e)};Ai.prototype.isBaseLayer=function(){return this._isBaseLayer};Ai.prototype.isDestroyed=function(){return!1};Ai.prototype.destroy=function(){return de(this)};var ebe=new ce,Q0e=new ce,$X=new ce,tbe=new ce;Ai.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Ai.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!c(t)||c(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||c(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;c(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 Mi&&e.rectangle.north<Mi.MaximumLatitude&&e.rectangle.south>-Mi.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,ebe),a=ce.intersection(e.rectangle,s,Q0e);if(!c(a)){if(!this.isBaseLayer())return!1;let D=s,I=e.rectangle;a=Q0e,I.south>=D.north?a.north=a.south=D.north:I.north<=D.south?a.north=a.south=D.south:(a.south=Math.max(I.south,D.south),a.north=Math.min(I.north,D.north)),I.west>=D.east?a.west=a.east=D.east:I.east<=D.west?a.west=a.east=D.west:(a.west=Math.max(I.west,D.west),a.east=Math.min(I.east,D.east))}let l=0;a.south>0?l=a.south:a.north<0&&(l=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=dut(this,f,l);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),c(o.minimumLevel)){let D=o.minimumLevel;h<D&&(h=D)}let g=o.tilingScheme,m=g.positionToTileXY(ce.northwest(a),h),y=g.positionToTileXY(ce.southeast(a),h),b=e.rectangle.width/512,x=e.rectangle.height/512,A=g.tileXYToRectangle(m.x,m.y,h);Math.abs(A.south-e.rectangle.north)<x&&m.y<y.y&&++m.y,Math.abs(A.east-e.rectangle.west)<b&&m.x<y.x&&++m.x;let C=g.tileXYToRectangle(y.x,y.y,h);Math.abs(C.north-e.rectangle.south)<x&&y.y>m.y&&--y.y,Math.abs(C.west-e.rectangle.east)<b&&y.x>m.x&&--y.x;let S=ce.clone(e.rectangle,tbe),v=g.tileXYToRectangle(m.x,m.y,h),P=ce.intersection(v,s,$X),M;r?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(P,P),g.rectangleToNativeRectangle(s,s),M=g.tileXYToNativeRectangle.bind(g),b=S.width/512,x=S.height/512):M=g.tileXYToRectangle.bind(g);let R,L=0,F=1,_;!this.isBaseLayer()&&Math.abs(P.west-S.west)>=b&&(L=Math.min(1,(P.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(P.north-S.north)>=x&&(F=Math.max(0,(P.north-S.south)/S.height));let w=F;for(let D=m.x;D<=y.x;D++)if(R=L,v=M(D,m.y,h),P=ce.simpleIntersection(v,s,$X),!!c(P)){L=Math.min(1,(P.east-S.west)/S.width),D===y.x&&(this.isBaseLayer()||Math.abs(P.east-S.east)<b)&&(L=1),F=w;for(let I=m.y;I<=y.y;I++){if(_=F,v=M(D,I,h),P=ce.simpleIntersection(v,s,$X),!c(P))continue;F=Math.max(0,(P.south-S.south)/S.height),I===y.y&&(this.isBaseLayer()||Math.abs(P.south-S.south)<x)&&(F=0);let N=new se(R,F,L,_),k=this.getImageryFromCache(D,I,h);i.imagery.splice(n,0,new _w(k,N,r)),++n}}return!0};Ai.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let l=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=l.rectangleToNativeRectangle(n,ebe),i=l.rectangleToNativeRectangle(i,tbe)}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)};Ai.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!c(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Po.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===$n.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Po.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Qo({throttle:!1,throttleByServer:!0,type:ms.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!c(a)){e.state=ai.UNLOADED,e.request=void 0;return}c(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(l){i(l)}).catch(function(l){o(l)})}r()};Ai.prototype._createTextureWebGL=function(e,t){let n=new Qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return c(i.internalFormat)?new Rt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Rt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ke.RGBA:ke.RGB,sampler:n})};Ai.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(c(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(c(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}if(this.minificationFilter!==Yt.NEAREST&&this.minificationFilter!==Yt.LINEAR)throw new E("ImageryLayer minification filter must be NEAREST or LINEAR");let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Mi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function J0e(e,t,n){return`${e}:${t}:${n}`}Ai.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Yt.LINEAR&&i===li.LINEAR&&!ke.isCompressedFormat(t.pixelFormat)&&O.isPowerOfTwo(t.width)&&O.isPowerOfTwo(t.height)){n=Yt.LINEAR_MIPMAP_LINEAR;let r=ut.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=J0e(n,i,s),l=e.cache.imageryLayerMipmapSamplers;c(l)||(l={},e.cache.imageryLayerMipmapSamplers=l);let u=l[a];c(u)||(u=l[a]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Cf.NICEST),t.sampler=u}else{let r=J0e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;c(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];c(a)||(a=s[r]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ai.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Oi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Uc({persists:!0,owner:this,preExecute:function(l){fut(l,r,i,t.rectangle)},postExecute:function(l){t.texture=l,s._finalizeReprojectTexture(r,l),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};Ai.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};Ai.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){c(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ai.prototype.getImageryFromCache=function(e,t,n,i){let o=nbe(e,t,n),r=this._imageryCache[o];return c(r)||(r=new pw(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ai.prototype.removeImageryFromCache=function(e){let t=nbe(e.x,e.y,e.level);delete this._imageryCache[t]};function nbe(e,t,n){return JSON.stringify([e,t,n])}var TH={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new H,texture:void 0},uut=Vt.supportsTypedArrays()?new Float32Array(2*64):void 0;function fut(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!c(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){c(this.framebuffer)&&this.framebuffer.destroy(),c(this.vertexArray)&&this.vertexArray.destroy(),c(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),x=0;for(let P=0;P<64;++P){let M=P/63;b[x++]=0,b[x++]=M,b[x++]=1,b[x++]=M}let A={position:0,webMercatorT:1},C=cs.getRegularGridIndices(2,64),S=yt.createIndexBuffer({context:t,typedArray:C,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});o.vertexArray=new ti({context:t,attributes:[{index:A.position,vertexBuffer:yt.createVertexBuffer({context:t,typedArray:b,usage:Be.STATIC_DRAW}),componentsPerAttribute:2},{index:A.webMercatorT,vertexBuffer:yt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Be.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new He({sources:[s2]});o.shaderProgram=Jt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:r2,attributeLocations:A}),o.sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;TH.textureDimensions.x=r,TH.textureDimensions.y=s,TH.texture=n;let a=Math.sin(i.south),l=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-l),h=new Rt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});O.isPowerOfTwo(r)&&O.isPowerOfTwo(s)&&h.generateMipmap(Cf.NICEST);let p=i.south,g=i.north,m=uut,y=0;for(let b=0;b<64;++b){let x=b/63,A=O.lerp(p,g,x);a=Math.sin(A);let S=(.5*Math.log((1+a)/(1-a))-l)*f;m[y++]=S,m[y++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=TH,e.vertexArray=o.vertexArray}function dut(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Oi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function hut(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function mut(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){hut(e._errorEvent,i)}}var Xa=Ai;var put={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=put;var ibe={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>=ibe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=ibe;function yw(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}yw.prototype.update=function(e,t,n){this.changedThisFrame&&(ube(e,t,this.tile,n),this.changedThisFrame=!1)};yw.prototype.destroy=function(e){this._destroyVertexArray(e),c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};yw.prototype._destroyVertexArray=function(e){c(this.vertexArray)&&(c(e)?e.push(this.vertexArray):md._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var _ut=new Cy;yw.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=_ut;a.clear();for(let u=0;u<t.length;++u){let f=t[u];c(f.data.vertexArray)&&a.enqueue(t[u])}let l=a.dequeue();for(;l!==void 0;){let u=l.findTileToWest(r),f=l.findTileToSouth(r),h=l.findTileToEast(r),p=l.findTileToNorth(r);Bs(e,n,l,u,s,yn.EAST,!1,a,i),Bs(e,n,l,f,s,yn.NORTH,!1,a,i),Bs(e,n,l,h,s,yn.WEST,!1,a,i),Bs(e,n,l,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),y=h.findTileToNorth(r),b=h.findTileToSouth(r);Bs(e,n,l,g,s,yn.SOUTHEAST,!1,a,i),Bs(e,n,l,y,s,yn.SOUTHWEST,!1,a,i),Bs(e,n,l,m,s,yn.NORTHEAST,!1,a,i),Bs(e,n,l,b,s,yn.NORTHWEST,!1,a,i),l=a.dequeue()}};function Bs(e,t,n,i,o,r,s,a,l){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(c(u.data.vertexArray))return;gut(e,t,n,u,r,o,a,l);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case yn.WEST:Bs(e,t,n,i.northwestChild,o,r,!0,a,l),Bs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.EAST:Bs(e,t,n,i.southeastChild,o,r,!0,a,l),Bs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTH:Bs(e,t,n,i.southwestChild,o,r,!0,a,l),Bs(e,t,n,i.southeastChild,o,r,!0,a,l);break;case yn.NORTH:Bs(e,t,n,i.northeastChild,o,r,!0,a,l),Bs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHWEST:Bs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHEAST:Bs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTHWEST:Bs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.SOUTHEAST:Bs(e,t,n,i.southeastChild,o,r,!0,a,l);break;default:throw new E("Invalid edge")}}}function gut(e,t,n,i,o,r,s,a){let l=i.data;if(l.fill===void 0)l.fill=new yw(i);else if(l.fill.visitedFrame===r)return;l.fill.enqueuedFrame!==r&&(l.fill.enqueuedFrame=r,l.fill.changedThisFrame=!1,s.enqueue(i)),yut(e,t,n,i,o,a)}function yut(e,t,n,i,o,r){let s=i.data.fill,a,l=n.data.fill;c(l)?(l.visitedFrame=t.frameNumber,l.changedThisFrame&&(ube(e,t,n,r),l.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=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||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,p,g,m,y=n.rectangle,b,x=i.rectangle;switch(o){case yn.WEST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.north,m.south,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.south,m.north,b));++p);break;case yn.SOUTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.west,m.east,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.east,m.west,b));++p);break;case yn.EAST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.south,m.north,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.north,m.south,b));++p);break;case yn.NORTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.east,m.west,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.west,m.east,b));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,p-h,a),f.splice(h,p-h,n))}var WT=new he,but=new he,gw=new d,eK=new d,ZX=new H,QX=new H,Ju=new H;function DH(){this.height=0,this.encodedNormal=new H}function AH(e,t,n,i,o,r,s,a,l){if(c(o))return o;let u;if(c(r)&&c(s))u=(r.height+s.height)*.5;else if(c(r))u=r.height;else if(c(s))u=s.height;else if(c(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;c(h)&&(p=h.minimumHeight,g=h.maximumHeight),u=(p+g)*.5}return fbe(e,t,n,i,u,l),l}var xut={minimumHeight:0,maximumHeight:0},Tut=new d,obe=new DH,rbe=new DH,sbe=new DH,abe=new DH,Aut=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Cut={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function ube(e,t,n,i){md.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,l=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=EH(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,sbe),p=EH(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,obe),g=EH(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,rbe),m=EH(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,abe);h=AH(r,f,0,1,h,p,m,g,sbe),p=AH(r,f,0,0,p,h,g,m,obe),g=AH(r,f,1,1,g,p,m,h,rbe),m=AH(r,f,1,1,m,g,h,p,abe);let y=p.height,b=g.height,x=h.height,A=m.height,C=Math.min(y,b,x,A),S=Math.max(y,b,x,A),v=(C+S)*.5,P,M,R=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-R,F=Math.acos(L/f.maximumRadius)*4;if(F*=1.5,s.width>F&&S-C<=R){let D=new qa({width:9,height:9,buffer:Aut,structure:{heightOffset:S}}),I=Cut;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=l,r.mesh=D._createMeshSync(I)}else{let D=u,I=ce.center(s,but);I.height=v;let N=f.cartographicToCartesian(I,Tut),k=new Oc(N,void 0,void 0,void 0,void 0,!0,!0,D,a,l),z=5,V;for(V=r.westMeshes,P=0,M=V.length;P<M;++P)z+=V[P].eastIndicesNorthToSouth.length;for(V=r.southMeshes,P=0,M=V.length;P<M;++P)z+=V[P].northIndicesWestToEast.length;for(V=r.eastMeshes,P=0,M=V.length;P<M;++P)z+=V[P].westIndicesSouthToNorth.length;for(V=r.northMeshes,P=0,M=V.length;P<M;++P)z+=V[P].southIndicesEastToWest.length;let j=xut;j.minimumHeight=C,j.maximumHeight=S;let U=k.stride,q=new Float32Array(z*U),Y=0,te=Y;Y=CH(f,s,k,q,Y,0,1,h.height,h.encodedNormal,1,j),Y=wH(r,f,k,q,Y,r.westTiles,r.westMeshes,yn.EAST,j);let K=Y;Y=CH(f,s,k,q,Y,0,0,p.height,p.encodedNormal,0,j),Y=wH(r,f,k,q,Y,r.southTiles,r.southMeshes,yn.NORTH,j);let Z=Y;Y=CH(f,s,k,q,Y,1,0,g.height,g.encodedNormal,0,j),Y=wH(r,f,k,q,Y,r.eastTiles,r.eastMeshes,yn.WEST,j);let ee=Y;Y=CH(f,s,k,q,Y,1,1,m.height,m.encodedNormal,1,j),Y=wH(r,f,k,q,Y,r.northTiles,r.northMeshes,yn.SOUTH,j),C=j.minimumHeight,S=j.maximumHeight;let me=Dn.fromRectangle(s,C,S,n.tilingScheme.ellipsoid),Te=Mi.geodeticLatitudeToMercatorAngle(s.south),ue=1/(Mi.geodeticLatitudeToMercatorAngle(s.north)-Te),ye=(Mi.geodeticLatitudeToMercatorAngle(I.latitude)-Te)*ue,Ae=f.geodeticSurfaceNormalCartographic(WT,eK),Pe=Ln.octEncode(Ae,ZX),Ee=Y;k.encode(q,Y*U,me.center,H.fromElements(.5,.5,Ju),v,Pe,ye,Ae),++Y;let ze=Y,qe=ze<256?1:2,it=(ze-1)*3,Dt=it*qe,jt=(q.length-ze*U)*Float32Array.BYTES_PER_ELEMENT,$e;if(jt>=Dt){let _e=ze*U*Float32Array.BYTES_PER_ELEMENT;$e=ze<256?new Uint8Array(q.buffer,_e,it):new Uint16Array(q.buffer,_e,it)}else $e=ze<256?new Uint8Array(it):new Uint16Array(it);q=new Float32Array(q.buffer,0,ze*U);let un=0;for(P=0;P<ze-2;++P)$e[un++]=Ee,$e[un++]=P,$e[un++]=P+1;$e[un++]=Ee,$e[un++]=P,$e[un++]=0;let zt=[];for(P=K;P>=te;--P)zt.push(P);let Ct=[];for(P=Z;P>=K;--P)Ct.push(P);let Ei=[];for(P=ee;P>=Z;--P)Ei.push(P);let an=[];for(an.push(0),P=Ee-1;P>=ee;--P)an.push(P);r.mesh=new hd(k.center,q,$e,it,ze,C,S,le.fromOrientedBoundingBox(me),Iut(e,me.center,s,C,S),k.stride,me,k,zt,Ct,Ei,an)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=md._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let w=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let D=o._findAncestorTileWithTerrainData(n);c(D)&&c(D.data.waterMaskTexture)&&(r.waterMaskTexture=D.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,D,r.waterMaskTranslationAndScale))}c(w)&&(--w.referenceCount,w.referenceCount===0&&w.destroy())}function CH(e,t,n,i,o,r,s,a,l,u,f){let h=WT;h.longitude=O.lerp(t.west,t.east,r),h.latitude=O.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,gw),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,eK));let m=QX;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,l,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var vH=new ce;function P2(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,vH),o.west-=O.TWO_PI,o.east-=O.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,vH),o.west+=O.TWO_PI,o.east+=O.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,l=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-a)/(l-a),g=(n.y-f)/(h-f);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 Eut=new H;function JX(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 Sut=new H,wut=new d;function vut(e,t,n,i,o,r,s,a,l,u){let f=i.encoding,h=i.vertices,p=P2(t,n,f.decodeTextureCoordinates(h,o,Ju),Ju),g=P2(t,n,f.decodeTextureCoordinates(h,r,QX),QX),m;l?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(h,o),b=f.decodeHeight(h,r),x=n.rectangle;WT.longitude=O.lerp(x.west,x.east,s),WT.latitude=O.lerp(x.south,x.north,a),u.height=WT.height=O.lerp(y,b,m);let A;if(f.hasVertexNormals){let C=f.getOctEncodedNormal(h,o,Eut),S=f.getOctEncodedNormal(h,r,Sut),v=Ln.octDecode(C.x,C.y,gw),P=Ln.octDecode(S.x,S.y,wut);A=d.lerp(v,P,m,gw),d.normalize(A,A),Ln.octEncode(A,u.encodedNormal)}else A=e.geodeticSurfaceNormalCartographic(WT,gw),Ln.octEncode(A,u.encodedNormal)}function fbe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(WT,gw);Ln.octEncode(s,r.encodedNormal)}function EH(e,t,n,i,o,r,s,a,l,u,f){if(lbe(e,t,a,s,!1,n,i,f)||lbe(e,t,u,l,!0,n,i,f))return f;let p;if(tK(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],JX(r,p,n,i,f),f;let g;if(n===0?i===0?g=SH(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=SH(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=SH(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=SH(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),c(g))return fbe(e,t,n,i,g,f),f}function SH(e,t,n,i,o,r,s,a){let l=cbe(e,t,!1,n,s,a),u=cbe(i,o,!0,r,s,a);return c(l)&&c(u)?(l+u)*.5:c(l)?l:u}function wH(e,t,n,i,o,r,s,a,l){for(let u=0;u<r.length;++u)o=Dut(e,t,n,i,o,r[u],s[u],a,l);return o}function Dut(e,t,n,i,o,r,s,a,l){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,vH),u.west-=O.TWO_PI,u.east-=O.TWO_PI):a===yn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,vH),u.west+=O.TWO_PI,u.east+=O.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Ju),h=Ju.x,p=Ju.y);let g,m;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=r,b=e.tile,x=s.encoding,A=s.vertices,C=n.stride,S,v;x.hasWebMercatorT&&(S=Mi.geodeticLatitudeToMercatorAngle(f.south),v=1/(Mi.geodeticLatitudeToMercatorAngle(f.north)-S));for(let P=0;P<g.length;++P){let M=g[P],R=x.decodeTextureCoordinates(A,M,Ju);P2(y,b,R,R);let L=R.x,F=R.y,_=m?L:F;if(_<0||_>1||Math.abs(L-h)<O.EPSILON5&&Math.abs(F-p)<O.EPSILON5)continue;let w=Math.abs(L)<O.EPSILON5||Math.abs(L-1)<O.EPSILON5,D=Math.abs(F)<O.EPSILON5||Math.abs(F-1)<O.EPSILON5;if(w&&D)continue;let I=x.decodePosition(A,M,gw),N=x.decodeHeight(A,M),k;x.hasVertexNormals?k=x.getOctEncodedNormal(A,M,ZX):(k=ZX,k.x=0,k.y=0);let z=F;if(x.hasWebMercatorT){let j=O.lerp(f.south,f.north,F);z=(Mi.geodeticLatitudeToMercatorAngle(j)-S)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,eK)),n.encode(i,o*C,I,R,N,k,z,V),l.minimumHeight=Math.min(l.minimumHeight,N),l.maximumHeight=Math.max(l.maximumHeight,N),++o}return o}function cbe(e,t,n,i,o,r){let s,a,l;n?(s=0,a=e.length,l=1):(s=e.length-1,a=-1,l=-1);for(let u=s;u!==a;u+=l){let f=e[u],h=t[u];if(!tK(h,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(c(g))return f.encoding.decodeHeight(f.vertices,g)}}function tK(e,t){return c(t)&&(!c(e.data.fill)||!e.data.fill.changedThisFrame)}function lbe(e,t,n,i,o,r,s,a){let l,u,f,h,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(tK(g,m)&&(r===0?s===0?(l=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(l=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(l=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(l=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),l.length>0)){h=o?0:l.length-1,p=l[h],m.encoding.decodeTextureCoordinates(m.vertices,p,Ju);let y=P2(g,e.tile,Ju,Ju);if(y.x===r&&y.y===s)return JX(m,p,r,s,a),!0;if(h=Lo(l,u?r:s,function(b,x){m.encoding.decodeTextureCoordinates(m.vertices,b,Ju);let A=P2(g,e.tile,Ju,Ju);return f?u?A.x-r:A.y-s:u?r-A.x:s-A.y}),h<0){if(h=~h,h>0&&h<l.length)return vut(t,g,e.tile,m,l[h-1],l[h],r,s,u,a),!0}else return JX(m,l[h],r,s,a),!0}return!1}var Put=[new d,new d,new d,new d];function Iut(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Put;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}var bw=yw;function ur(e){if(!c(e))throw new E("options is required.");if(c(e.terrainProvider))if(c(e.imageryLayers)){if(!c(e.surfaceShaderSet))throw new E("options.surfaceShaderSet is required.")}else throw new E("options.imageryLayers is required.");else throw new E("options.terrainProvider is required.");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=xn.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 pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(ur.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(ur.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(ur.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(ur.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,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 G(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(ur.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!c(e))throw new E("value is required.");this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!c(e))throw new E("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if(c(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,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){th.setOwner(e,this,"_clippingPolygons")}}});function Out(e,t){let n=e.loadingImagery;c(n)||(n=e.readyImagery);let i=t.loadingImagery;return c(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}ur.prototype.update=function(e){this._imageryLayers._update()};function Rut(e,t){let n=t.creditDisplay,i=e._terrainProvider;c(i)&&c(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&&c(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}ur.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Out)})),Rut(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)md._freeVertexArray(t[i]);t.length=0};ur.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];c(s)&&(s.length=0)}let n=this._clippingPlanes;c(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;c(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};ur.prototype.endUpdate=function(e){if(!c(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:dc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:dc.LESS_OR_EQUAL},blending:ln.ALPHA_BLEND});let s=je(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=je(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&bw.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 l=r[s];if(c(l))for(let u=0,f=l.length;u<f;++u){let h=l[u],p=h.data.tileBoundingRegion;nft(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function _be(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)}ur.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)_be(t[n],e)};ur.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};ur.prototype.getLevelMaximumGeometricError=function(e){return c(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};ur.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;c(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),md.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)!==xr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,md.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Mut=new le,gbe=new ce,Lut=new ce,Nut=new he;function IH(e,t){if(t.west<t.east)return t;let n=ce.clone(t,Lut);return ce.center(e,Nut).longitude>0?n.east=O.PI:n.west=-O.PI,n}function ybe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(c(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(c(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}ur.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=ybe(this,t);if(t.fog.enabled&&!o&&O.fog(i,t.fog.density)>=1)return xr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return xr.PARTIAL;let a=t.cullingVolume,l=s.boundingVolume;c(l)||(l=s.boundingSphere),r.clippedByBoundaries=!1;let u=IH(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,gbe);if(!c(f))return xr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(l=Mut,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,l),d.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===oe.MORPHING&&c(r.renderedMesh)&&(l=le.union(s.boundingSphere,l,l))),!c(l))return xr.PARTIAL;let h=this._clippingPlanes;if(c(h)&&h.enabled){let b=h.computeIntersectionWithBoundingVolume(l);if(e.isClipped=b!==Wt.INSIDE,b===Wt.OUTSIDE)return xr.NONE}let p=this._clippingPolygons;if(c(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Wt.OUTSIDE}let g,m=a.computeVisibility(l);if(m===Wt.OUTSIDE?g=xr.NONE:m===Wt.INTERSECTING?g=xr.PARTIAL:m===Wt.INSIDE&&(g=xr.FULL),g===xr.NONE)return g;let y=t.mode===oe.SCENE3D&&t.camera.frustum instanceof on;if(t.mode===oe.SCENE3D&&!y&&c(n)&&!o){let b=r.occludeePointInScaledSpace;return!c(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?g:xr.NONE}return g};ur.prototype.canRefine=function(e){return c(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Fut=[],But=[];ur.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Fut;i.length=this._imageryLayers.length;let o=!1,r=!1,s;c(n)&&(o=n.terrainState===fo.READY,r=!0,s=n.imagery);let a,l;for(a=0,l=i.length;a<l;++a)i[a]=r;if(c(s))for(a=0,l=s.length;a<l;++a){let h=s[a],p=h.loadingImagery,g=!c(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=But;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:Yn.NONE;if(p===Yn.RENDERED){let g=h.data;if(!c(g))continue;if(!o&&h.data.terrainState===fo.READY)return!1;let m=h.data.imagery;for(a=0,l=m.length;a<l;++a){let y=m[a],b=y.loadingImagery,x=!c(b)||b.state===ai.FAILED||b.state===ai.INVALID,A=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(x&&!i[A])return!1}}else p===Yn.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var kut=new d;ur.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=d.subtract(i.center,o,kut),a=d.magnitude(s);return a<O.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var dbe=new B,PH=new B,Uut=new se,Vut=new se,zut=new se,Hut=new d,hbe=new d,Gut=new d,jut=new d;ur.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,l=i.length;a<l;++a){let u=i[a];c(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];c(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;c(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Wut=[new d,new d,new d,new d];function mbe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Wut;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}ur.prototype.computeDistanceToTile=function(e,t){qut(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 l=t.camera.positionCartographic.height,u=Math.abs(l-r),f=Math.abs(l-s);u>f?(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 qut(e,t,n){let i=e.data;i===void 0&&(i=e.data=new md);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Lu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,l=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,l=!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 m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(l=!1,r.minimumHeight=Dr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Dr.getHeight(r.maximumHeight,p,g)),l)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Dn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),c(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=mbe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=mbe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=l}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}ur.prototype.isDestroyed=function(){return!1};ur.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(),de(this)};function Yut(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,l=a.length,u;for(u=0;u<l;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=c(o)?o.readyImagery??o.loadingImagery:void 0,!c(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}ur.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(c(s._loadedCallbacks[e._layerIndex]))return;let a,l=s.data.imagery,u=l.length,f=-1,h=0;for(a=0;a<u;++a){let g=l[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Yut(h,e,n),s.state=ta.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=ta.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};ur.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 l=i[s],u=l.loadingImagery;if(c(u)||(u=l.readyImagery),u.imageryLayer===e)o===-1&&(o=s),l.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};ur.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};ur.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Xut=new B,Kut=new B;function pbe(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=B.multiplyByPoint(i,this.properties.rtc,hbe);return B.setTranslation(i,o,dbe),dbe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=B.multiplyByPoint(i,this.properties.rtc,hbe);return B.setTranslation(i,r,PH),B.multiply(o,PH,PH),PH},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 c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=c(i)?B.multiply(e.context.uniformState.view,i.modelMatrix,Xut):B.IDENTITY;return B.inverseTranspose(o,Kut)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return c(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return c(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 G(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new H(65e5,9e6),nightFadeDistance:new H(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new B,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new H(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new H,southMercatorYAndOneOverHeight:new H,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new H,scaleAndBias:new B,clippingPlanesEdgeColor:G.clone(G.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:G.clone(G.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return c(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function $ut(e,t,n){let i=n.data,o,r;if(c(i.vertexArray)?(o=i.mesh,r=i.vertexArray):c(i.fill)&&c(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!c(o)||!c(r))){if(c(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Zut(e,r,o),i.wireframeVertexArray.mesh=o}}function Zut(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=yt.createIndexBuffer({context:e,typedArray:r,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ti({context:e,attributes:t._attributes,indexBuffer:s})}var bbe,xbe,OH;(function(){let e=new St({geometry:Ud.fromDimensions({dimensions:new d(2,2,2)})}),t=new St({geometry:new M_({radius:1})}),n=new B,i,o;function r(s){return new Pn({geometryInstances:s,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}bbe=function(s,a){return s===i||(OH(),i=s,n=B.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Gt.fromColor(a),o=r(e)),o},xbe=function(s,a){return s===i||(OH(),i=s,n=B.fromTranslation(s.center,n),n=B.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Gt.fromColor(a),o=r(t)),o},OH=function(){c(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Qut=new se(0,0,0,0),Jut={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},eft=G.TRANSPARENT,tft=new Bt;function nft(e,t,n){let i=t.data;c(i.vertexArray)||(i.fill===void 0&&(i.fill=new bw(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(c(r)&&c(r.credits)){let _e=r.credits;for(let Ce=0,pn=_e.length;Ce<pn;++Ce)o.addCreditToNextFrame(_e[Ce])}let s=ut.maximumTextureImageUnits,a=i.waterMaskTexture,l=i.waterMaskTranslationAndScale;!c(a)&&c(i.fill)&&(a=i.fill.waterMaskTexture,l=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??eft,b=e.undergroundColorAlphaByDistance??tft,x=ybe(e,n)&&n.mode===oe.SCENE3D&&y.alpha>0&&(b.nearValue>0||b.farValue>0),A=e.lambertDiffuseMultiplier,C=e.vertexShadowDarkness,S=e.hasWaterMask&&c(a),v=S&&e.showWaterEffect,P=e.oceanNormalMap,M=v&&c(P),R=e.terrainProvider,L=c(R)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,w=xn.castShadows(e.shadows)&&!h,D=xn.receiveShadows(e.shadows)&&!h,I=e.hueShift,N=e.saturationShift,k=e.brightnessShift,z=!(O.equalsEpsilon(I,0,O.EPSILON7)&&O.equalsEpsilon(N,0,O.EPSILON7)&&O.equalsEpsilon(k,0,O.EPSILON7)),V=!1;if(_){let _e=d.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;V=_e>Ce}S&&--s,M&&--s,c(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,c(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,c(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,U=j.center,q=j.encoding,Y=i.tileBoundingRegion,te=n.verticalExaggeration,K=n.verticalExaggerationRelativeHeight,Z=te!==1,ee=q.hasGeodeticSurfaceNormals,me=Uut,Te=0,ue=0,ye=0,Ae=0,Pe=!1;if(n.mode!==oe.SCENE3D){let _e=n.mapProjection,Ce=_e.project(ce.southwest(t.rectangle),Gut),pn=_e.project(ce.northeast(t.rectangle),jut);if(me.x=Ce.x,me.y=Ce.y,me.z=pn.x,me.w=pn.y,n.mode!==oe.MORPHING&&(U=Hut,U.x=0,U.y=(me.z+me.x)*.5,U.z=(me.w+me.y)*.5,me.x-=U.y,me.y-=U.z,me.z-=U.y,me.w-=U.z),n.mode===oe.SCENE2D&&q.quantization===ea.BITS12){let mt=1/(Math.pow(2,12)-1)*.5,so=(me.z-me.x)*mt,Ro=(me.w-me.y)*mt;me.x-=so,me.y-=Ro,me.z+=so,me.w+=Ro}_e instanceof Mi&&(Te=t.rectangle.south,ue=t.rectangle.north,ye=Mi.geodeticLatitudeToMercatorAngle(Te),Ae=1/(Mi.geodeticLatitudeToMercatorAngle(ue)-ye),Pe=!0)}let Ee=Jut;Ee.frameState=n,Ee.surfaceTile=i,Ee.hasWaterMask=S,Ee.showReflectiveOcean=v,Ee.showOceanWaves=M,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=_,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=V,Ee.hasVertexNormals=L,Ee.useWebMercatorProjection=Pe,Ee.clippedByBoundaries=i.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=ee,Ee.hasExaggeration=Z;let ze=i.imagery,qe=0,it=ze.length,Dt=e.showSkirts&&!u&&!h,jt=e.backFaceCulling&&!u&&!h,$e=jt?e._renderState:e._disableCullingRenderState,un=jt?e._blendRenderState:e._disableCullingBlendRenderState,zt=$e,Ct=e._firstPassInitialColor,Ei=n.context;if(c(e._debug.boundingSphereTile)||OH(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let _e=e._drawCommands.length;for(let Ce=0;Ce<_e;++Ce)e._uniformMaps[Ce]=pbe(n,e)}do{let _e=0,Ce,pn;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new Qe,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new le,Ce.orientedBoundingBox=void 0,pn=pbe(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(pn)):(Ce=e._drawCommands[e._usedDrawCommands],pn=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let la=Y.boundingVolume,Sl=Y.boundingSphere;c(la)?bbe(la,G.RED).update(n):c(Sl)&&xbe(Sl,G.RED).update(n)}let mt=pn.properties;se.clone(Ct,mt.initialColor),mt.oceanNormalMap=P,mt.lightingFadeDistance.x=e.lightingFadeOutDistance,mt.lightingFadeDistance.y=e.lightingFadeInDistance,mt.nightFadeDistance.x=e.nightFadeOutDistance,mt.nightFadeDistance.y=e.nightFadeInDistance,mt.atmosphereLightIntensity=e.atmosphereLightIntensity,mt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,mt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,mt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,mt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,mt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,mt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let so=u?g:p,Ro=u?p:g;c(so)&&(se.fromElements(so.near,so.nearValue,so.far,so.farValue,mt.frontFaceAlphaByDistance),se.fromElements(Ro.near,Ro.nearValue,Ro.far,Ro.farValue,mt.backFaceAlphaByDistance)),se.fromElements(b.near,b.nearValue,b.far,b.farValue,mt.undergroundColorAlphaByDistance),G.clone(y,mt.undergroundColor),mt.lambertDiffuseMultiplier=A,mt.vertexShadowDarkness=C;let aa=!c(i.vertexArray)&&c(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;aa&&G.clone(e.fillHighlightColor,mt.fillHighlightColor),mt.verticalExaggerationAndRelativeHeight.x=te,mt.verticalExaggerationAndRelativeHeight.y=K,mt.center3D=j.center,d.clone(U,mt.rtc),se.clone(me,mt.tileRectangle),mt.southAndNorthLatitude.x=Te,mt.southAndNorthLatitude.y=ue,mt.southMercatorYAndOneOverHeight.x=ye,mt.southMercatorYAndOneOverHeight.y=Ae;let Nr=Vut,Cs=IH(t.rectangle,e.cartographicLimitRectangle),Ne=zut,ot=IH(t.rectangle,m);d.fromElements(I,N,k,mt.hsbShift);let Xe=t.rectangle,Ze=1/Xe.width,pt=1/Xe.height;Nr.x=(Cs.west-Xe.west)*Ze,Nr.y=(Cs.south-Xe.south)*pt,Nr.z=(Cs.east-Xe.west)*Ze,Nr.w=(Cs.north-Xe.south)*pt,se.clone(Nr,mt.localizedCartographicLimitRectangle),Ne.x=(ot.west-Xe.west)*Ze,Ne.y=(ot.south-Xe.south)*pt,Ne.z=(ot.east-Xe.west)*Ze,Ne.w=(ot.north-Xe.south)*pt,se.clone(Ne,mt.localizedTranslucencyRectangle);let Ht=F&&O.fog(t._distance,n.fog.density)>O.EPSILON3;z=z&&(Ht||_);let Cn=!1,Mo=!1,Ao=!1,Za=!1,Qa=!1,Si=!1,_i=!1,ca=!1,Jr=!1,El=!1;for(;_e<s&&qe<it;){let la=ze[qe],Sl=la.readyImagery;if(++qe,!c(Sl)||Sl.imageryLayer.alpha===0)continue;let ec=la.useWebMercatorT?Sl.textureWebMercator:Sl.texture;if(!c(ec))throw new E("readyImagery is not actually ready!");let hs=Sl.imageryLayer;c(la.textureTranslationAndScale)||(la.textureTranslationAndScale=hs._calculateTextureTranslationAndScale(t,la)),mt.dayTextures[_e]=ec,mt.dayTextureTranslationAndScale[_e]=la.textureTranslationAndScale,mt.dayTextureTexCoordsRectangle[_e]=la.textureCoordinateRectangle,mt.dayTextureUseWebMercatorT[_e]=la.useWebMercatorT,mt.dayTextureAlpha[_e]=hs.alpha,Si=Si||mt.dayTextureAlpha[_e]!==1,mt.dayTextureNightAlpha[_e]=hs.nightAlpha,_i=_i||mt.dayTextureNightAlpha[_e]!==1,mt.dayTextureDayAlpha[_e]=hs.dayAlpha,_i=_i||mt.dayTextureDayAlpha[_e]!==1,mt.dayTextureBrightness[_e]=hs.brightness,Cn=Cn||mt.dayTextureBrightness[_e]!==Xa.DEFAULT_BRIGHTNESS,mt.dayTextureContrast[_e]=hs.contrast,Mo=Mo||mt.dayTextureContrast[_e]!==Xa.DEFAULT_CONTRAST,mt.dayTextureHue[_e]=hs.hue,Ao=Ao||mt.dayTextureHue[_e]!==Xa.DEFAULT_HUE,mt.dayTextureSaturation[_e]=hs.saturation,Za=Za||mt.dayTextureSaturation[_e]!==Xa.DEFAULT_SATURATION,mt.dayTextureOneOverGamma[_e]=1/hs.gamma,Qa=Qa||mt.dayTextureOneOverGamma[_e]!==1/Xa.DEFAULT_GAMMA,mt.dayTextureSplit[_e]=hs.splitDirection,ca=ca||mt.dayTextureSplit[_e]!==0;let mf=mt.dayTextureCutoutRectangles[_e];if(c(mf)||(mf=mt.dayTextureCutoutRectangles[_e]=new se),se.clone(se.ZERO,mf),c(hs.cutoutRectangle)){let Vo=IH(Xe,hs.cutoutRectangle),cn=ce.simpleIntersection(Vo,Xe,gbe);Jr=c(cn)||Jr,mf.x=(Vo.west-Xe.west)*Ze,mf.y=(Vo.south-Xe.south)*pt,mf.z=(Vo.east-Xe.west)*Ze,mf.w=(Vo.north-Xe.south)*pt}let pf=mt.colorsToAlpha[_e];c(pf)||(pf=mt.colorsToAlpha[_e]=new se);let _f=c(hs.colorToAlpha)&&hs.colorToAlphaThreshold>0;if(El=El||_f,_f){let Vo=hs.colorToAlpha;pf.x=Vo.red,pf.y=Vo.green,pf.z=Vo.blue,pf.w=hs.colorToAlphaThreshold}else pf.w=-1;if(c(Sl.credits)){let Vo=Sl.credits;for(let cn=0,Se=Vo.length;cn<Se;++cn)o.addCreditToNextFrame(Vo[cn])}++_e}mt.dayTextures.length=_e,mt.waterMask=a,se.clone(l,mt.waterMaskTranslationAndScale),mt.minMaxHeight.x=q.minimumHeight,mt.minMaxHeight.y=q.maximumHeight,B.clone(q.matrix,mt.scaleAndBias);let yo=e._clippingPlanes,Fr=c(yo)&&yo.enabled&&t.isClipped;Fr&&(mt.clippingPlanesEdgeColor=G.clone(yo.edgeColor,mt.clippingPlanesEdgeColor),mt.clippingPlanesEdgeWidth=yo.edgeWidth);let xp=e._clippingPolygons,es=c(xp)&&xp.enabled&&t.isClipped;Ee.numberOfDayTextures=_e,Ee.applyBrightness=Cn,Ee.applyContrast=Mo,Ee.applyHue=Ao,Ee.applySaturation=Za,Ee.applyGamma=Qa,Ee.applyAlpha=Si,Ee.applyDayNightAlpha=_i,Ee.applySplit=ca,Ee.enableFog=Ht,Ee.enableClippingPlanes=Fr,Ee.clippingPlanes=yo,Ee.enableClippingPolygons=es,Ee.clippingPolygons=xp,Ee.hasImageryLayerCutout=Jr,Ee.colorCorrect=z,Ee.highlightFillTile=aa,Ee.colorToAlpha=El,Ee.showUndergroundColor=x,Ee.translucent=h;let hf=i.renderedMesh.indices.length;Dt||(hf=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),Ce.castShadows=w,Ce.receiveShadows=D,Ce.renderState=zt,Ce.primitiveType=Me.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=hf,Ce.uniformMap=pn,Ce.pass=De.GLOBE,e._debug.wireframe&&($ut(Ei,e,t),c(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Me.LINES,Ce.count=hf*2));let Ja=Ce.boundingVolume,tb=Ce.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Y.minimumHeight,Y.maximumHeight,Ja),d.fromElements(Ja.center.z,Ja.center.x,Ja.center.y,Ja.center),n.mode===oe.MORPHING&&(Ja=le.union(Y.boundingSphere,Ja,Ja))):(Ce.boundingVolume=le.clone(Y.boundingSphere,Ja),Ce.orientedBoundingBox=Dn.clone(Y.boundingVolume,tb)),Ce.dirty=!0,h&&f.updateDerivedCommands(Ce,n),_be(Ce,n),zt=un,Ct=Qut}while(qe<it)}var I2=ur;function Tbe(){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(Tbe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){T.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new E("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new E("far distance must be greater than near distance.");this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){c(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var O2=Tbe;function ks(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(ks.prototype,{length:{get:function(){return this._layers.length}}});ks.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new E("layer is required.");if(n){if(t<0)throw new E("index must be greater than or equal to zero.");if(t>this._layers.length)throw new E("index must be less than or equal to the number of layers.")}n?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()})};ks.prototype.addImageryProvider=function(e,t){if(!c(e))throw new E("imageryProvider is required.");let n=new Xa(e);return this.add(n,t),n};ks.prototype.remove=function(e,t){t=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};ks.prototype.removeAll=function(e){e=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=[]};ks.prototype.contains=function(e){return this.indexOf(e)!==-1};ks.prototype.indexOf=function(e){return this._layers.indexOf(e)};ks.prototype.get=function(e){if(!c(e))throw new E("index is required.","index");return this._layers[e]};function RH(e,t){if(!c(t))throw new E("layer is required.");let n=e.indexOf(t);if(n===-1)throw new E("layer is not in this collection.");return n}function Abe(e,t,n){let i=e._layers;if(t=O.clamp(t,0,i.length-1),n=O.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)}ks.prototype.raise=function(e){let t=RH(this._layers,e);Abe(this,t,t+1)};ks.prototype.lower=function(e){let t=RH(this._layers,e);Abe(this,t,t-1)};ks.prototype.raiseToTop=function(e){let t=RH(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))};ks.prototype.lowerToBottom=function(e){let t=RH(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 ift=new ce;function Cbe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!c(r)&&a<o.length;++a){let l=o[a];ce.contains(l.rectangle,t)&&(r=l)}if(!c(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let l=s[a],u=l.readyImagery;if(!c(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!c(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=ift,p=1/1024;h.west=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.x-p),h.east=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.z+p),h.south=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.y-p),h.north=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(u)}}ks.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(Cbe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};ks.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(Cbe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let l=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);c(l)&&(o.push(l),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let l=0;l<s.length;++l){let u=s[l],f=r[l];if(c(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,c(p.position)||(p.position=i),a.push(p)}}return a})};ks.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ks.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ks.prototype.isDestroyed=function(){return!1};ks.prototype.destroy=function(){return this.removeAll(!0),de(this)};ks.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&&(c(i._show)&&(c(n)||(n=[]),n.push(i)),i._show=i.show);if(c(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var R2=ks;function Ebe(e){this._ellipsoid=new H_(e.ellipsoid,d.ZERO)}Object.defineProperties(Ebe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var M2=Ebe;var nK=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}clear(){this.cache.clear()}},oft=1e3;function na(e){if(!c(e))throw new E("options is required.");if(c(e.x))if(c(e.y)){if(e.x<0||e.y<0)throw new E("options.x and options.y must be greater than or equal to zero.")}else throw new E("options.y is required.");else throw new E("options.x is required.");if(!c(e.level))throw new E("options.level is required and must be greater than or equal to zero.");if(!c(e.tilingScheme))throw new E("options.tilingScheme is required.");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=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new nK(oft),this.state=ta.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}na.createLevelZeroTiles=function(e){if(!c(e))throw new E("tilingScheme is required.");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 na({tilingScheme:e,x:s,y:r,level:0});return i};var rft=256;function sft(e,t,n,i){let o=n.width/rft*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}na.prototype._getCacheKey=function(e,t){return sft(e.longitude,e.latitude,this._rectangle,t)};na.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};na.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};na.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};na.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(c(t)&&c(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(c(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let l=a.customData;for(o=0;o<l.length;++o)r=l[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(na.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 c(this._southwestChild)||(this._southwestChild=new na({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return c(this._southeastChild)||(this._southeastChild=new na({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 c(this._northwestChild)||(this._northwestChild=new na({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return c(this._northeastChild)||(this._northeastChild=new na({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<ta.DONE}},eligibleForUnloading:{get:function(){let e=!0;return c(this.data)&&(e=this.data.eligibleForUnloading,c(e)||(e=!0)),e}}});na.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]};na.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};na.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};na.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};na.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};na.prototype.freeResources=function(){this.clearPositionCache(),this.state=ta.START,this.renderable=!1,this.upsampledFromParent=!1,c(this.data)&&c(this.data.freeResources)&&this.data.freeResources(),MH(this._southwestChild),this._southwestChild=void 0,MH(this._southeastChild),this._southeastChild=void 0,MH(this._northwestChild),this._northwestChild=void 0,MH(this._northeastChild),this._northeastChild=void 0};function MH(e){c(e)&&e.freeResources()}var L2=na;function LH(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}LH.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};LH.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&c(this._lastBeforeStartOfFrame)&&this.count>e&&c(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Sbe(this,t)),t=i}};function Sbe(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}LH.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!c(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(c(e.replacementPrevious)||c(e.replacementNext))&&Sbe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var N2=LH;function _d(e){if(!c(e)||!c(e.tileProvider))throw new E("options.tileProvider is required.");if(c(e.tileProvider.quadtree))throw new E("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");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 N2,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=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new M2({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(_d.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});_d.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function aft(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,vbe(e);let n=e._levelZeroTiles;if(c(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 l=r[a];l.level=0,e._addHeightCallbacks.push(l)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}_d.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;c(t);)t.state!==ta.START&&e(t),t=t.replacementNext};_d.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};_d.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};_d.prototype.update=function(e){c(this._tileProvider.update)&&this._tileProvider.update(e)};function vbe(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}_d.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(aft(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),vbe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};_d.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),fft(this,e),Tft(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function cft(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.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))}_d.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(gft(this,e),xft(this,e),cft(this,e))};_d.prototype.isDestroyed=function(){return!1};_d.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var B2,wbe=new he;function lft(e,t){let n=ce.center(e.rectangle,wbe),i=n.longitude-B2.longitude,o=n.latitude-B2.latitude;n=ce.center(t.rectangle,wbe);let r=n.longitude-B2.longitude,s=n.latitude-B2.latitude;return i*i+o*o-(r*r+s*s)}var uft=new d,F2=[];function fft(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!c(e._levelZeroTiles)){let y=r.tilingScheme;if(c(y)){let b=r.tilingScheme;e._levelZeroTiles=L2.createLevelZeroTiles(b);let x=e._levelZeroTiles.length;if(F2.length<x)for(F2=new Array(x),o=0;o<x;++o)F2[o]===void 0&&(F2[o]=new k2)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,l=a.length>1?e._occluders:void 0;B2=t.camera.positionCartographic,a.sort(lft);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,h=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=B.getTranslation(g.transform,uft);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ka(e,s,r,t,l,!1,F2[o]):(_g(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function _g(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function k2(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Dbe(){this.southwest=new k2,this.southeast=new k2,this.northwest=new k2,this.northeast=new k2}Dbe.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 oK=new Array(31);for(let e=0;e<oK.length;++e)oK[e]=new Dbe;function dft(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=pft(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,l=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Yn.NONE,g=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,y=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===ta.DONE,x=m||y||b;if(x||c(g.canRenderWithoutLosingDetail)&&(x=g.canRenderWithoutLosingDetail(n)),x){s&&_g(e,e._tileLoadQueueMedium,n,t),NH(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&_g(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&l.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){NH(e,n),_g(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let y=e._tilesToRender.length,b=e._tileLoadQueueLow.length,x=e._tileLoadQueueMedium.length,A=e._tileLoadQueueHigh.length,C=e._tileToUpdateHeights.length;if(hft(e,a,l,u,f,t,i,o),y!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,P=o.notYetRenderableCount,M=!1;if(!S&&!v){let R=e._tilesToRender;for(let F=y;F<R.length;++F){let _=R[F];for(;_!==void 0&&_._lastSelectionResult!==Yn.KICKED&&_!==n;)_._lastSelectionResult=Yn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=C,NH(e,n),n._lastSelectionResult=Yn.RENDERED;let L=p===Yn.RENDERED;!L&&P>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=x,e._tileLoadQueueHigh.length=A,_g(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,M=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!M&&_g(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,NH(e,n),_g(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function hft(e,t,n,i,o,r,s,a){let l=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=oK[t.level],p=h.southwest,g=h.southeast,m=h.northwest,y=h.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(Ka(e,t,u,r,f,s,p),Ka(e,n,u,r,f,s,g),Ka(e,i,u,r,f,s,m),Ka(e,o,u,r,f,s,y)):(Ka(e,i,u,r,f,s,m),Ka(e,t,u,r,f,s,p),Ka(e,o,u,r,f,s,y),Ka(e,n,u,r,f,s,g)):l.latitude<t.rectangle.north?(Ka(e,n,u,r,f,s,g),Ka(e,t,u,r,f,s,p),Ka(e,o,u,r,f,s,y),Ka(e,i,u,r,f,s,m)):(Ka(e,o,u,r,f,s,y),Ka(e,i,u,r,f,s,m),Ka(e,n,u,r,f,s,g),Ka(e,t,u,r,f,s,p)),h.combine(a)}function mft(e,t){let n=t.rectangle;return c(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||c(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ka(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==xr.NONE)return dft(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,mft(e,t)){(!c(t.data)||!c(t.data.vertexArray))&&_g(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;l!==Yn.CULLED_BUT_NEEDED&&l!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(_g(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function pft(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof on||t.camera.frustum instanceof jo)return _ft(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-=O.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function _ft(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;c(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,l=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,l),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=O.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function NH(e,t){e._tilesToRender.push(t)}function gft(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=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=iK(e,t,s,r,n,!1);a=iK(e,t,s,r,i,a),iK(e,t,s,r,o,a)}function yft(e,t){return e._loadPriority-t._loadPriority}function iK(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(yft);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let l=o[s];e._tileReplacementQueue.markTileRendered(l),n.loadTile(t,l),r=!0}return r}var xw=new mn,FH=new he,P0=new d,bft=[];function xft(e,t){if(!c(e.tileProvider.tilingScheme))return;let n=bft;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,l=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!c(h.data)||!c(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Yn.NONE;(y===Yn.RENDERED||y===Yn.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let y=p[f],b=h.data.terrainData,x=c(b)&&b.wasCreatedByUpsampling();if(h.level>y.level&&!x){let A,C=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(c(C))A=C;else{if(c(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=d.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),a===oe.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,xw.direction),v=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,xw.origin);if(!c(v)){let P=0;c(h.data.tileBoundingRegion)&&(P=h.data.tileBoundingRegion.minimumHeight);let M=Math.min(P,-11500),R=d.multiplyByScalar(S,Math.abs(M)+1,P0);d.subtract(y.positionOnEllipsoidSurface,R,xw.origin)}}else he.clone(y.positionCartographic,FH),FH.height=-11500,l.project(FH,P0),d.fromElements(P0.z,P0.x,P0.y,P0),d.clone(P0,xw.origin),d.clone(d.UNIT_X,xw.direction);A=h.data.pick(xw,a,l,!1,P0),c(A)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,A)}if(c(A)){if(c(y.callback)){let S=u.cartesianToCartographic(A,FH);y.callback(S)}y.level=h.level}}if(Ti()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Tft(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 U2=_d;function Hh(e){e=e??ie.default;let t=new np({ellipsoid:e}),n=new R2;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new _2,this._material=void 0,this._surface=new U2({tileProvider:new I2({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=G.clone(G.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new O2,sK(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new we({url:tn("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=ie.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=O.PI*e.minimumRadius,this.nightFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*O.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=xn.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(Hh.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 c(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){c(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),c(this._material)&&sK(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,sK(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=G.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new E("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function sK(e){let t=[],n=c(e._material)&&(c(e._material.shaderSource.match(/slope/))||c(e._material.shaderSource.match("normalEC"))),i=[nh,nw];c(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(i2),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[nh,nw,o2],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Aft(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var Cft=[],Eft={start:0,stop:0};Hh.prototype.pickWorldCoordinates=function(e,t,n,i){if(!c(e))throw new E("ray is required");if(!c(t))throw new E("scene is required");n=n??!0;let o=t.mode,r=t.mapProjection,s=Cft;s.length=0;let a=this._surface._tilesToRender,l=a.length,u,f;for(f=0;f<l;++f){u=a[f];let p=u.data;if(!c(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),d.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(c(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=Zn.raySphere(e,g,Eft);c(m)&&s.push(p)}s.sort(Aft(e.origin));let h;for(l=s.length,f=0;f<l&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!c(h));++f);return h};var Sft=new he;Hh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),c(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Sft);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var wft=new d,Pbe=new d,vft=new he,Dft=new mn;function rK(e,t){return c(e)&&ce.contains(e.rectangle,t)?e:void 0}Hh.prototype.getHeight=function(e){if(!c(e))throw new E("cartographic is required");let t=this._surface._levelZeroTiles;if(!c(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(;c(n);)n=rK(n._southwestChild,e)||rK(n._southeastChild,e)||rK(n._northwestChild,e)||n._northeastChild,c(n)&&c(n.data)&&c(n.data.renderedMesh)&&(r=n);if(n=r,!c(n)||!c(n.data)||!c(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,l=d.fromRadians(e.longitude,e.latitude,0,a,wft),u=Dft,f=a.geodeticSurfaceNormal(l,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(l,11500,u.origin);if(!c(h)){let g;c(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=d.multiplyByScalar(f,Math.abs(m)+1,Pbe);d.subtract(l,y,u.origin)}let p=n.data.pick(u,void 0,s,!1,Pbe);if(c(p))return a.cartesianToCartographic(p,vft).height};Hh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Hh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=c(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,l=a.url;if(c(l)){let u=this;a.fetchImage().then(function(f){l===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Rt({context:e.context,source:f}))})}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))};Hh.prototype.render=function(e){this.show&&(c(this._material)&&this._material.update(e.context),this._surface.render(e))};Hh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Hh.prototype.isDestroyed=function(){return!1};Hh.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(),de(this)};var V2=Hh;function Pft(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var z2=Pft;var Gbe={},Ift=32.184,Oft=2451545,Ibe=-.0529921,Obe=-.1059842,Rbe=13.0120009,Mbe=13.3407154,Lbe=.9856003,Nbe=26.4057084,Fbe=13.064993,Bbe=.3287146,kbe=1.7484877,Ube=-.1589763,Vbe=.0036096,zbe=.1643573,Hbe=12.9590088,aK=new Q;Gbe.ComputeMoon=function(e,t){c(e)||(e=Q.now()),aK=Q.addSeconds(e,Ift,aK);let n=Q.totalDays(aK)-Oft,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Ibe*n)*O.RADIANS_PER_DEGREE,r=(250.089+Obe*n)*O.RADIANS_PER_DEGREE,s=(260.008+Rbe*n)*O.RADIANS_PER_DEGREE,a=(176.625+Mbe*n)*O.RADIANS_PER_DEGREE,l=(357.529+Lbe*n)*O.RADIANS_PER_DEGREE,u=(311.589+Nbe*n)*O.RADIANS_PER_DEGREE,f=(134.963+Fbe*n)*O.RADIANS_PER_DEGREE,h=(276.617+Bbe*n)*O.RADIANS_PER_DEGREE,p=(34.226+kbe*n)*O.RADIANS_PER_DEGREE,g=(15.134+Ube*n)*O.RADIANS_PER_DEGREE,m=(119.743+Vbe*n)*O.RADIANS_PER_DEGREE,y=(239.961+zbe*n)*O.RADIANS_PER_DEGREE,b=(25.053+Hbe*n)*O.RADIANS_PER_DEGREE,x=Math.sin(o),A=Math.sin(r),C=Math.sin(s),S=Math.sin(a),v=Math.sin(l),P=Math.sin(u),M=Math.sin(f),R=Math.sin(h),L=Math.sin(p),F=Math.sin(g),_=Math.sin(m),w=Math.sin(y),D=Math.sin(b),I=Math.cos(o),N=Math.cos(r),k=Math.cos(s),z=Math.cos(a),V=Math.cos(l),j=Math.cos(u),U=Math.cos(f),q=Math.cos(h),Y=Math.cos(p),te=Math.cos(g),K=Math.cos(m),Z=Math.cos(y),ee=Math.cos(b),me=(269.9949+.0031*i-3.8787*x-.1204*A+.07*C-.0172*S+.0072*P-.0052*F+.0043*D)*O.RADIANS_PER_DEGREE,Te=(66.5392+.013*i+1.5419*I+.0239*N-.0278*k+.0068*z-.0029*j+9e-4*U+8e-4*te-9e-4*ee)*O.RADIANS_PER_DEGREE,ue=(38.3213+13.17635815*n-14e-13*n*n+3.561*x+.1208*A-.0642*C+.0158*S+.0252*v-.0066*P-.0047*M-.0046*R+.0028*L+.0052*F+.004*_+.0019*w-.0044*D)*O.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*Ibe+.1208*N*Obe-.0642*k*Rbe+.0158*z*Mbe+.0252*V*Lbe-.0066*j*Nbe-.0047*U*Fbe-.0046*q*Bbe+.0028*Y*kbe+.0052*te*Ube+.004*K*Vbe+.0019*Z*zbe-.0044*ee*Hbe)/86400*O.RADIANS_PER_DEGREE;return c(t)||(t=new z2),t.rightAscension=me,t.declination=Te,t.rotation=ue,t.rotationRate=ye,t};var H2=Gbe;function jbe(e){(!c(e)||typeof e!="function")&&(e=H2.ComputeMoon),this._computeFunction=e}var Rft=new d,Mft=new d,Lft=new d;function Nft(e,t,n){let i=Rft;i.x=Math.cos(e+O.PI_OVER_TWO),i.y=Math.sin(e+O.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=Lft;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,Mft);return c(n)||(n=new J),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 Fft=new J,Bft=new Le;jbe.prototype.evaluate=function(e,t){c(e)||(e=Q.now());let n=this._computeFunction(e),i=Nft(n.rightAscension,n.declination,t),o=O.zeroToTwoPi(n.rotation),r=Le.fromAxisAngle(d.UNIT_Z,o,Bft),s=J.fromQuaternion(Le.conjugate(r,r),Fft);return J.multiply(s,i,i)};var G2=jbe;var cK={position:0};function BH(e){e=e??W.EMPTY_OBJECT,this.center=d.clone(e.center??d.ZERO),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new le,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=new B,this._computedModelMatrix=new B,this.show=e.show??!0,this.material=e.material??Xi.fromType(Xi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 Qe({owner:e._owner??this}),this._pickCommand=new Qe({owner: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 kft(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(c(t))return t;let n=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ti.fromGeometry({context:e,geometry:n,attributeLocations:cK,bufferUsage:Be.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}BH.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!c(this.center)||!c(this.radii))return;if(!c(this.material))throw new E("this.material must be defined.");let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!c(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?ln.ALPHA_BLEND:void 0})),c(this._va)||(this._va=kft(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!B.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(B.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),B.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.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 l=e.useLogDepth,u=this._useLogDepth!==l;this._useLogDepth=l;let f=this._colorCommand,h,p;(s||a||i||u)&&(h=new He({sources:[tw]}),p=new He({sources:[this.material.shaderSource,ew]}),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=Jt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:cK}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=xt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!c(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||!c(this._pickSP)||u)&&(h=new He({sources:[tw]}),p=new He({sources:[this.material.shaderSource,ew],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=Jt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:cK}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(y)}};BH.prototype.isDestroyed=function(){return!1};BH.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(),de(this)};var j2=BH;function W2(e){e=e??W.EMPTY_OBJECT;let t=e.textureUrl;c(t)||(t=tn("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ie.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new j2({radii:this.ellipsoid.radii,material:Xi.fromType(Xi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new G2}Object.defineProperties(W2.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var kH=new J,Uft=new J,Vft=new d,UH=[];W2.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;c(Ot.computeIcrfToFixedMatrix(n,kH))||Ot.computeTemeToPseudoFixedMatrix(n,kH);let i=this._axes.evaluate(n,Uft);J.transpose(i,i),J.multiply(kH,i,i);let o=Xg.computeMoonPositionInEarthInertialFrame(n,Vft);J.multiplyByVector(kH,o,o),B.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=UH,UH.length=0,t.update(e),e.commandList=r,UH.length===1?UH[0]:void 0};W2.prototype.isDestroyed=function(){return!1};W2.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),de(this)};var q2=W2;var lK=[],uK=[];function zft(e,t,n,i,o,r){let s=o-i+1,a=r-o,l=lK,u=uK,f,h;for(f=0;f<s;++f)l[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let g=l[f],m=u[h];f<s&&(h>=a||t(g,m,n)<=0)?(e[p]=g,++f):h<a&&(e[p]=m,++h)}}function fK(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);fK(e,t,n,i,r),fK(e,t,n,r+1,o),zft(e,t,n,i,r,o)}function Hft(e,t,n){if(!c(e))throw new E("array is required.");if(!c(t))throw new E("comparator is required.");let i=e.length,o=Math.ceil(i*.5);lK.length=o,uK.length=o,fK(e,t,n,0,i-1),lK.length=0,uK.length=0}var gg=Hft;function Rc(e,t){if(!c(e))throw new E("occluderBoundingSphere is required.");if(!c(t))throw new E("camera position is required.");this._occluderPosition=d.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 VH=new d;Object.defineProperties(Rc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!c(e))throw new E("cameraPosition is required.");e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,VH),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,VH);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,VH),VH)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Rc.fromBoundingSphere=function(e,t,n){if(!c(e))throw new E("occluderBoundingSphere is required.");if(!c(t))throw new E("camera position is required.");return c(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Rc(e,t)};var qbe=new d;Rc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,qbe),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var Gft=new d;Rc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,Gft),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,qbe),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.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 jft=new d;Rc.prototype.computeVisibility=function(e){if(!c(e))throw new E("occludeeBS is required.");let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return xr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,jft),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let s=d.magnitudeSquared(i);return o*o+n*n<s?xr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?xr.FULL:xr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?xr.PARTIAL:xr.FULL))}}return xr.NONE};var zH=new d;Rc.computeOccludeePoint=function(e,t,n){if(!c(e))throw new E("occluderBoundingSphere is required.");if(!c(n))throw new E("positions is required.");if(n.length===0)throw new E("positions must contain at least one element");let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length;if(d.equals(o,t))throw new E("occludeePosition must be different than occluderBoundingSphere.center");let a=d.normalize(d.subtract(i,o,zH),zH),l=-d.dot(a,o),u=Rc._anyRotationVector(o,a,l),f=Rc._horizonToPlaneNormalDotProduct(e,a,l,u,n[0]);if(!f)return;let h;for(let g=1;g<s;++g){if(h=Rc._horizonToPlaneNormalDotProduct(e,a,l,u,n[g]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(a,p,zH),zH)};var Wft=[];Rc.computeOccludeePointFromRectangle=function(e,t){if(!c(e))throw new E("rectangle is required.");t=t??ie.default;let n=ce.subsample(e,t,0,Wft),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return Rc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var qft=new d;Rc._anyRotationVector=function(e,t,n){let i=d.abs(t,qft),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var Yft=new d;Rc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,Yft);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>O.EPSILON13)return d.normalize(s,new d)}return o};var dK=new d,Xft=new d,HH=new d,Wbe=new d;Rc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,dK),s=d.clone(e.center,Xft),a=e.radius,l=d.subtract(s,r,HH),u=d.magnitudeSquared(l),f=a*a;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),b=p*m*p;l=d.normalize(l,l);let x=d.add(r,d.multiplyByScalar(l,b,Wbe),Wbe),A=Math.sqrt(h-b*b),C=this._rotationVector(s,t,n,r,i),S=d.fromElements(C.x*C.x*l.x+(C.x*C.y-C.z)*l.y+(C.x*C.z+C.y)*l.z,(C.x*C.y+C.z)*l.x+C.y*C.y*l.y+(C.y*C.z-C.x)*l.z,(C.x*C.z-C.y)*l.x+(C.y*C.z+C.x)*l.y+C.z*C.z*l.z,dK);S=d.normalize(S,S);let v=d.multiplyByScalar(S,A,dK);C=d.normalize(d.subtract(d.add(x,v,HH),s,HH),HH);let P=d.dot(t,C);C=d.normalize(d.subtract(d.subtract(x,v,C),s,C),C);let M=d.dot(t,C);return P<M?P:M};var Y2=Rc;function rp(e){e=e??W.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new _s,this._perspectiveMatrix=new B,this._infinitePerspective=new B}function hK(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new E("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;if(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new E("near must be greater than zero and less than far.");e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=B.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=B.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective)}}Object.defineProperties(rp.prototype,{projectionMatrix:{get:function(){return hK(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return hK(this),this._infinitePerspective}}});var Kft=new d,$ft=new d,Zft=new d,Qft=new d;rp.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new E("position is required.");if(!c(t))throw new E("direction is required.");if(!c(n))throw new E("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,Kft),h=$ft;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=Zft;d.multiplyByScalar(t,u,p),d.add(e,p,p);let g=Qft;d.multiplyByScalar(f,a,g),d.add(h,g,g),d.subtract(g,e,g),d.normalize(g,g),d.cross(g,n,g),d.normalize(g,g);let m=i[0];return c(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(f,s,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(n,g,g),d.normalize(g,g),m=i[1],c(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,r,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(f,g,g),d.normalize(g,g),m=i[2],c(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,o,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(g,f,g),d.normalize(g,g),m=i[3],c(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),m=i[4],c(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,g),m=i[5],c(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,p),this._cullingVolume};rp.prototype.getPixelDimensions=function(e,t,n,i,o){if(hK(this),!c(e)||!c(t))throw new E("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new E("drawingBufferWidth must be greater than zero.");if(t<=0)throw new E("drawingBufferHeight must be greater than zero.");if(!c(n))throw new E("distance is required.");if(!c(i))throw new E("pixelRatio is required");if(i<=0)throw new E("pixelRatio must be greater than zero.");if(!c(o))throw new E("A result object is required.");let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let l=2*i*n*s/e;return o.x=l,o.y=a,o};rp.prototype.clone=function(e){return c(e)||(e=new rp),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};rp.prototype.equals=function(e){return c(e)&&e instanceof rp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};rp.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof rp&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var bl=rp;function ou(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new bl,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}ou.packedLength=6;ou.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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};ou.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new ou),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 Gh(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new E("fov, aspectRatio, near, or far parameters are not set.");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;if(T.typeOf.number.greaterThanOrEquals("fov",e.fov,0),T.typeOf.number.lessThan("fov",e.fov,Math.PI),T.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),T.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new E("near must be less than far.");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(ou.prototype,{projectionMatrix:{get:function(){return Gh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Gh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Gh(this),this._fovy}},sseDenominator:{get:function(){return Gh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Gh(this),this._offCenterFrustum}}});ou.prototype.computeCullingVolume=function(e,t,n){return Gh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ou.prototype.getPixelDimensions=function(e,t,n,i,o){return Gh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};ou.prototype.clone=function(e){return c(e)||(e=new ou),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};ou.prototype.equals=function(e){return!c(e)||!(e instanceof ou)?!1:(Gh(this),Gh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ou.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof ou)?!1:(Gh(this),Gh(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ci=ou;function X2(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(X2.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Jft(e,t,n){let i=t.createViewportQuadCommand(YF,{framebuffer:n,renderState:Ve.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}X2.prototype.update=function(e){if(!c(this._colorTexture)){let t=e.context,n=new Rt({context:t,width:256,height:256,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST});this._colorTexture=n;let i=new Ur({context:t,colorTextures:[n],destroyAttachments:!1});Jft(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};X2.prototype.isDestroyed=function(){return!1};X2.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),de(this)};var K2=X2;var $be={};function edt(e,t,n){let i,o,r;if(e instanceof Ci){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 bl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var tdt=new d,Ybe=new d;function Zbe(e,t,n,i){if(c(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,l=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return O.lerp(e,-O.PI_OVER_TWO,p)}let h=(f-r)/l;return O.lerp(-O.PI_OVER_TWO,t,1-h)}}return function(o){return O.lerp(e,t,o)}}function pK(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!c(r)){let a=e.position,l=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(a,l,tdt),g=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),Ybe)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),Ybe));r=Math.min(edt(h,g,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return O.lerp(n,i,a)}}function $2(e,t){return O.equalsEpsilon(e,O.TWO_PI,O.EPSILON11)&&(e=0),t>e+Math.PI?e+=O.TWO_PI:t<e-Math.PI&&(e-=O.TWO_PI),e}var Qbe=new d;function ndt(e,t,n,i,o,r,s,a){let l=e.camera,u=d.clone(l.position,Qbe),f=l.pitch,h=$2(l.heading,i),p=$2(l.roll,r),g=pK(l,n,u.z,n.z,s),m=Zbe(f,o,g,a);function y(b){let x=b.time/t;l.setView({orientation:{heading:O.lerp(h,i,x),pitch:m(x),roll:O.lerp(p,r,x)}}),H.lerp(u,n,x,l.position),l.position.z=g(x)}return y}function idt(e,t){e.longitude<t.longitude?e.longitude+=O.TWO_PI:t.longitude+=O.TWO_PI}function odt(e,t){let n=e.longitude-t.longitude;n<-O.PI?e.longitude+=O.TWO_PI:n>O.PI&&(t.longitude+=O.TWO_PI)}var rdt=new he,sdt=new he;function adt(e,t,n,i,o,r,s,a,l,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,rdt),m=f.pitch,y=$2(f.heading,i),b=$2(f.roll,r),x=p.cartesianToCartographic(n,sdt);g.longitude=O.zeroToTwoPi(g.longitude),x.longitude=O.zeroToTwoPi(x.longitude);let A=!1;if(c(a)){let P=O.zeroToTwoPi(a),M=Math.min(g.longitude,x.longitude),R=Math.max(g.longitude,x.longitude),L=P>=M&&P<=R;if(c(l)){let F=Math.abs(g.longitude-x.longitude),_=O.TWO_PI-F;(L?F:_)<(L?_:F)*l&&!L&&(A=!0)}else L||(A=!0)}A?idt(g,x):odt(g,x);let C=pK(f,n,g.height,x.height,s),S=Zbe(m,o,C,u);function v(){let P=g.longitude,M=x.longitude,R=g.latitude,L=x.latitude;return function(_){let w=_.time/t,D=d.fromRadians(O.lerp(P,M,w),O.lerp(R,L,w),C(w),p);f.setView({destination:D,orientation:{heading:O.lerp(y,i,w),pitch:S(w),roll:O.lerp(b,r,w)}})}}return v()}function cdt(e,t,n,i,o,r,s){let a=e.camera,l=d.clone(a.position,Qbe),u=$2(a.heading,i),f=a.frustum.right-a.frustum.left,h=pK(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:O.lerp(u,i,m)}}),H.lerp(l,n,m,a.position);let y=h(m),b=a.frustum,x=b.top/b.right,A=(y-(b.right-b.left))*.5;b.right+=A,b.left-=A,b.top=x*b.right,b.bottom=-b.top}return p}var Xbe=new he,ldt=new d;function mK(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Kbe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}$be.createTween=function(e,t){t=t??W.EMPTY_OBJECT;let n=t.destination;if(!c(e))throw new E("scene is required.");if(!c(n))throw new E("destination is required.");let i=e.mode;if(i===oe.MORPHING)return mK();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,Xbe),n=r.project(Xbe,ldt));let p=e.camera,g=t.endTransform;c(g)&&p._setTransform(g);let m=t.duration;c(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,b=t.pitch??-O.PI_OVER_TWO,x=t.roll??0,A=e.screenSpaceCameraController;A.enableInputs=!1;let C=Kbe(A,t.complete),S=Kbe(A,t.cancel),v=p.frustum,P=e.mode===oe.SCENE2D;if(P=P&&H.equalsEpsilon(p.position,n,O.EPSILON6),P=P&&O.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,O.EPSILON6),P=P||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,p.position,O.EPSILON10),P=P&&O.equalsEpsilon(O.negativePiToPi(y),O.negativePiToPi(p.heading),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(b),O.negativePiToPi(p.pitch),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(x),O.negativePiToPi(p.roll),O.EPSILON10),P)return mK(C,S);let M=new Array(4);if(M[oe.SCENE2D]=cdt,M[oe.SCENE3D]=adt,M[oe.COLUMBUS_VIEW]=ndt,m<=0)return mK(function(){M[i](e,1,n,y,b,x,a,l,u,f)({time:1}),typeof C=="function"&&C()},S);let R=M[i](e,m,n,y,b,x,a,l,u,f);if(!c(h)){let L=p.positionCartographic.height,F=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>F&&L>11500?h=Qr.CUBIC_OUT:h=Qr.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:C,cancel:S}};var Z2=$be;var udt={ROTATE:0,INFINITE_SCROLL:1},ru=Object.freeze(udt);function en(e){if(!c(e))throw new E("scene is required.");this._scene=e,this._transform=B.clone(B.IDENTITY),this._invTransform=B.clone(B.IDENTITY),this._actualTransform=B.clone(B.IDENTITY),this._actualInvTransform=B.clone(B.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.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 pe,this._moveEnd=new pe,this._changed=new pe,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 B,this._invViewMatrix=new B,sxe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,O.PI_OVER_TWO)),this._max2Dfrustum=void 0,yxe(this,en.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*en.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}en.TRANSFORM_2D=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);en.TRANSFORM_2D_INVERSE=B.inverseTransformation(en.TRANSFORM_2D,new B);en.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);en.DEFAULT_VIEW_FACTOR=.5;en.DEFAULT_OFFSET=new cd(0,-O.PI_OVER_FOUR,0);function sxe(e){B.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),B.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),B.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function fdt(e){if(!c(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}en.prototype.canPreloadFlight=function(){return c(this._currentFlight)&&this._mode!==oe.SCENE2D};en.prototype._updateCameraChanged=function(){let e=this;if(fdt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;c(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%O.TWO_PI;i=i>O.PI?O.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;c(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%O.TWO_PI;s=s>O.PI?O.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(!c(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,b=p.x+m.left,x=p.x+m.right,A=g.x+y.left,C=g.x+y.right,S=p.y+m.bottom,v=p.y+m.top,P=g.y+y.bottom,M=g.y+y.top,R=Math.max(b,A),L=Math.min(x,C),F=Math.max(S,P),_=Math.min(v,M),w;if(R>=L||F>=v)w=1;else{let D=y;b<A&&x>C&&S<P&&v>M&&(D=m),w=1-(L-R)*(_-F)/((D.right-D.left)*(D.top-D.bottom))}w>t&&(e._changed.raiseEvent(w),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!c(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let l=O.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;c(e.frustum.fovy)?u=l/(e.frustum.fovy*.5):u=l;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function ddt(e){Ot.basisTo2D(e._projection,e._transform,e._actualTransform)}var hdt=new he,mdt=new d,GH=new d,pdt=new se,_dt=new se,gdt=new se,ydt=new se,bdt=new se;function xdt(e){let t=e._projection,n=t.ellipsoid,i=B.getColumn(e._transform,3,pdt),o=n.cartesianToCartographic(i,hdt),r=t.project(o,mdt),s=_dt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,bdt),l=se.add(B.getColumn(e._transform,0,GH),i,GH);n.cartesianToCartographic(l,o),t.project(o,r);let u=gdt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=ydt;if(d.magnitudeSquared(u)>O.EPSILON10)d.cross(a,u,f);else{let h=se.add(B.getColumn(e._transform,1,GH),i,GH);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,s,f),f.x=0,d.magnitudeSquared(f)<O.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),B.setColumn(e._actualTransform,0,u,e._actualTransform),B.setColumn(e._actualTransform,1,f,e._actualTransform),B.setColumn(e._actualTransform,2,a,e._actualTransform),B.setColumn(e._actualTransform,3,s,e._actualTransform)}var _K=new d;function Lc(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=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let l=e._up,u=!d.equals(l,e.up);u&&(d.normalize(e.up,e.up),l=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(B.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?B.equals(B.IDENTITY,e._transform)?B.clone(en.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?ddt(e):xdt(e):B.clone(e._transform,e._actualTransform),B.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=B.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=_K;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===oe.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||h){let m=d.dot(s,d.cross(l,f,_K));if(Math.abs(1-m)>O.EPSILON2){let y=1/d.magnitudeSquared(l),b=d.dot(l,s)*y,x=d.multiplyByScalar(s,b,_K);l=d.normalize(d.subtract(l,x,e._up),e._up),d.clone(l,e.up),f=d.cross(s,l,e._right),d.clone(f,e.right)}}(a||p)&&(e._directionWC=B.multiplyByPointAsVector(g,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=B.multiplyByPointAsVector(g,l,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=B.multiplyByPointAsVector(g,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||p)&&sxe(e)}function axe(e,t){let n;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)?n=Math.atan2(t.y,t.x)-O.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-O.PI_OVER_TWO,O.TWO_PI-O.zeroToTwoPi(n)}function cxe(e){return O.PI_OVER_TWO-O.acosClamped(e.z)}function lxe(e,t,n){let i=0;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=O.zeroToTwoPi(i+O.TWO_PI)),i}var qH=new B,YH=new B;Object.defineProperties(en.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Lc(this),this._invTransform}},viewMatrix:{get:function(){return Lc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Lc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Lc(this),this._positionCartographic}},positionWC:{get:function(){return Lc(this),this._positionWC}},directionWC:{get:function(){return Lc(this),this._directionWC}},upWC:{get:function(){return Lc(this),this._upWC}},rightWC:{get:function(){return Lc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,qH),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,YH);this._setTransform(n);let i=axe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,qH),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,YH);this._setTransform(n);let i=cxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=B.clone(this._transform,qH),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,YH);this._setTransform(n);let i=lxe(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}}});en.prototype.update=function(e){if(!c(e))throw new E("mode is required.");if(e===oe.SCENE2D&&!(this.frustum instanceof jo))throw new E("An OrthographicOffCenterFrustum is required in 2D.");if((e===oe.SCENE3D||e===oe.COLUMBUS_VIEW)&&!(this.frustum instanceof Ci)&&!(this.frustum instanceof on))throw new E("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");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();if(!(n instanceof jo))throw new E("The camera frustum is expected to be orthographic for 2D camera control.");let 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&&hxe(this,this.position)};var Tdt=new d,Adt=new d,Cdt=new d;en.prototype._setTransform=function(e){let t=d.clone(this.positionWC,Tdt),n=d.clone(this.upWC,Adt),i=d.clone(this.directionWC,Cdt);B.clone(e,this._transform),this._transformChanged=!0,Lc(this);let o=this._actualInvTransform;B.multiplyByPoint(o,t,this.position),B.multiplyByPointAsVector(o,i,this.direction),B.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),Lc(this)};var Edt=new H,Sdt=new mn,wdt=new d,vdt=new d;function uxe(e){if(!B.equals(B.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=Edt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(c(n)){let a=e.getPickRay(i,Sdt);o=n.pickWorldCoordinates(a,t,!0,wdt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,vdt));let s;if(c(o)||c(r)){let a=c(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,l=c(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,l)}else s=Math.max(e.positionCartographic.height,0);return s}en.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof on&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=uxe(this)))};var XH=new d,TK=new B,Ddt=new B,AK=new Le,CK=new J,fxe=new he;function Pdt(e,t,n){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new E("position has a NaN component");let i=B.clone(e.transform,TK),o=Ot.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Ddt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,AK),s=J.fromQuaternion(r,CK);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Idt(e,t,n,i){let o=B.clone(e.transform,TK);if(e._setTransform(B.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,l=a.ellipsoid.cartesianToCartographic(t,fxe);t=a.project(l,XH)}d.clone(t,e.position)}n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,AK),s=J.fromQuaternion(r,CK);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Odt(e,t,n,i){let o=B.clone(e.transform,TK);if(e._setTransform(B.IDENTITY),!d.equals(t,e.positionWC)){if(i){let l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,fxe);t=l.project(u,XH)}H.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let l=a.top/a.right;a.right=s,a.left=r,a.top=a.right*l,a.bottom=-a.top}}if(e._scene.mapMode2D===ru.ROTATE){n.heading=n.heading-O.PI_OVER_TWO,n.pitch=-O.PI_OVER_TWO,n.roll=0;let r=Le.fromHeadingPitchRoll(n,AK),s=J.fromQuaternion(r,CK);J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Rdt=new d,Mdt=new d,Ldt=new d;function dxe(e,t,n,i){let o=d.clone(n.direction,Rdt),r=d.clone(n.up,Mdt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(t,a,qH),u=B.inverseTransformation(l,YH);B.multiplyByPointAsVector(u,o,o),B.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,Ldt);return i.heading=axe(o,r),i.pitch=cxe(o),i.roll=lxe(o,r,s),i}var xK={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},Tw=new Oa;en.prototype.setView=function(e){e=e??W.EMPTY_OBJECT;let t=e.orientation??W.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;c(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,XH);if(c(o)&&c(o.west)){if(o=this.getRectangleCameraCoordinates(o,XH),isNaN(o.x)||isNaN(o.y))throw new E("destination has a NaN component");i=!1}c(t.direction)&&(t=dxe(this,o,t,xK.orientation)),Tw.heading=t.heading??0,Tw.pitch=t.pitch??-O.PI_OVER_TWO,Tw.roll=t.roll??0,n===oe.SCENE3D?Pdt(this,o,Tw):n===oe.SCENE2D?Odt(this,o,Tw,i):Idt(this,o,Tw,i)};var Ndt=new d;en.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:en.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:B.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(en.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*en.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:B.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,Ndt).z),roll:0},endTransform:B.IDENTITY,convert:!1})}};en.prototype.worldToCameraCoordinates=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new se),Lc(this),B.multiplyByVector(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPoint(this._actualInvTransform,e,t)};en.prototype.worldToCameraCoordinatesVector=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPointAsVector(this._actualInvTransform,e,t)};en.prototype.cameraToWorldCoordinates=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new se),Lc(this),B.multiplyByVector(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPoint(this._actualTransform,e,t)};en.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!c(e))throw new E("cartesian is required.");return c(t)||(t=new d),Lc(this),B.multiplyByPointAsVector(this._actualTransform,e,t)};function hxe(e,t){let n=e._scene.mapMode2D===ru.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 Jbe=new d;en.prototype.move=function(e,t){if(!c(e))throw new E("direction is required.");let n=this.position;d.multiplyByScalar(e,t,Jbe),d.add(n,Jbe,n),this._mode===oe.SCENE2D&&hxe(this,n),this._adjustOrthographicFrustum(!0)};en.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?KH(this,e):this.move(this.direction,e)};en.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?KH(this,-e):this.move(this.direction,-e)};en.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};en.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};en.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};en.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};en.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};en.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};en.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};en.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var Fdt=new Le,Bdt=new J;en.prototype.look=function(e,t){if(!c(e))throw new E("axis is required.");let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,Fdt),o=J.fromQuaternion(i,Bdt),r=this.direction,s=this.up,a=this.right;J.multiplyByVector(o,r,r),J.multiplyByVector(o,s,s),J.multiplyByVector(o,a,a)};en.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};en.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var kdt=new Le,Udt=new J;en.prototype.rotate=function(e,t){if(!c(e))throw new E("axis is required.");let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,kdt),o=J.fromQuaternion(i,Udt);J.multiplyByVector(o,this.position,this.position),J.multiplyByVector(o,this.direction,this.direction),J.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};en.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,mxe(this,e)};en.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,mxe(this,-e)};var Vdt=new d,zdt=new d,Hdt=new d,exe=new d;function mxe(e,t){let n=e.position;if(c(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,O.EPSILON2)){let i=d.normalize(n,Vdt),o=d.equalsEpsilon(i,e.constrainedAxis,O.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,exe),O.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,zdt),a=d.dot(i,s),l=O.acosClamped(a);t>0&&t>l&&(t=l-O.EPSILON4),a=d.dot(i,d.negate(s,exe)),l=O.acosClamped(a),t<0&&-t>l&&(t=-l+O.EPSILON4);let u=d.cross(s,i,Hdt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}en.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,pxe(this,-e)};en.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,pxe(this,e)};function pxe(e,t){c(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function KH(e,t){let n=e.frustum;if(!(n instanceof jo)||!c(n.left)||!c(n.right)||!c(n.bottom)||!c(n.top))throw new E("The camera frustum is expected to be orthographic for 2D camera control.");let 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===ru.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===ru.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 _xe(e,t){e.move(e.direction,t)}en.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?KH(this,e):_xe(this,e)};en.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?KH(this,-e):_xe(this,-e)};en.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return d.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 Gdt=new B;en.prototype.lookAt=function(e,t){if(!c(e))throw new E("target is required");if(!c(t))throw new E("offset is required");if(this._mode===oe.MORPHING)throw new E("lookAt is not supported while morphing.");let i=this._scene.ellipsoid??ie.default,o=Ot.eastNorthUpToFixedFrame(e,i,Gdt);this.lookAtTransform(o,t)};var jdt=new d,Wdt=new Le,qdt=new Le,Ydt=new J;function gxe(e,t,n){t=O.clamp(t,-O.PI_OVER_TWO,O.PI_OVER_TWO),e=O.zeroToTwoPi(e)-O.PI_OVER_TWO;let i=Le.fromAxisAngle(d.UNIT_Y,-t,Wdt),o=Le.fromAxisAngle(d.UNIT_Z,-e,qdt),r=Le.multiply(o,i,o),s=J.fromQuaternion(r,Ydt),a=d.clone(d.UNIT_X,jdt);return J.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}en.prototype.lookAtTransform=function(e,t){if(!c(e))throw new E("transform is required");if(this._mode===oe.MORPHING)throw new E("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!c(t))return;let n;if(c(t.heading)?n=gxe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){H.clone(H.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<O.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(B.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<O.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var Q2=new he,Xdt=new he,Kdt=new d,$dt=new d,Zdt=new d,Qdt=new d,Jdt=new d,eht=new d,tht=new d,gK=new d,nht={direction:new d,right:new d,up:new d},txe;function Mc(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function yxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:nht,{north:s,south:a,west:l}=t,{east:u}=t;l>u&&(u+=O.TWO_PI);let f=(l+u)*.5,h;if(a<-O.PI_OVER_TWO+O.RADIANS_PER_DEGREE&&s>O.PI_OVER_TWO-O.RADIANS_PER_DEGREE)h=0;else{let L=Q2;L.longitude=f,L.latitude=s,L.height=0;let F=Xdt;F.longitude=f,F.latitude=a,F.height=0;let _=txe;(!c(_)||_.ellipsoid!==o)&&(txe=_=new kp(void 0,void 0,o)),_.setEndPoints(L,F),h=_.interpolateUsingFraction(.5,Q2).latitude}let p=Q2;p.longitude=f,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,tht),m=Q2;m.longitude=u,m.latitude=s;let y=o.cartographicToCartesian(m,Kdt);m.longitude=l;let b=o.cartographicToCartesian(m,Zdt);m.longitude=f;let x=o.cartographicToCartesian(m,Jdt);m.latitude=a;let A=o.cartographicToCartesian(m,eht);m.longitude=u;let C=o.cartographicToCartesian(m,Qdt);m.longitude=l;let S=o.cartographicToCartesian(m,$dt);d.subtract(b,g,b),d.subtract(C,g,C),d.subtract(y,g,y),d.subtract(S,g,S),d.subtract(x,g,x),d.subtract(A,g,A);let v=o.geodeticSurfaceNormal(g,r.direction);d.negate(v,v);let P=d.cross(v,d.UNIT_Z,r.right);d.normalize(P,P);let M=d.cross(P,v,r.up),R;if(e.frustum instanceof on){let L=Math.max(d.distance(y,b),d.distance(C,S)),F=Math.max(d.distance(y,C),d.distance(b,S)),_,w,D=e.frustum._offCenterFrustum,I=D.right/D.top,N=F*I;L>N?(_=L,w=_/I):(w=F,_=N),R=Math.max(_,w)}else{let L=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*L;if(R=Math.max(Mc(v,M,b,L),Mc(v,M,C,L),Mc(v,M,y,L),Mc(v,M,S,L),Mc(v,M,x,L),Mc(v,M,A,L),Mc(v,P,b,F),Mc(v,P,C,F),Mc(v,P,y,F),Mc(v,P,S,F),Mc(v,P,x,F),Mc(v,P,A,F)),a<0&&s>0){let _=Q2;_.longitude=l,_.latitude=0,_.height=0;let w=o.cartographicToCartesian(_,gK);d.subtract(w,g,w),R=Math.max(R,Mc(v,M,w,L),Mc(v,P,w,F)),_.longitude=u,w=o.cartographicToCartesian(_,gK),d.subtract(w,g,w),R=Math.max(R,Mc(v,M,w,L),Mc(v,P,w,F))}}return d.add(g,d.multiplyByScalar(v,-R,gK),n)}var iht=new he,oht=new d,rht=new d;function sht(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=iht;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,oht);B.multiplyByPoint(o,a,a),B.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let l=i.project(s,rht);if(B.multiplyByPoint(o,l,l),B.multiplyByPoint(r,l,l),n.x=(a.x-l.x)*.5+l.x,n.y=(a.y-l.y)*.5+l.y,c(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-l.x)/f,(a.y-l.y)/u)*.5}else{let u=a.x-l.x,f=a.y-l.y;n.z=Math.max(u,f)}return n}var aht=new he,cht=new d,lht=new d;function uht(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===ru.INFINITE_SCROLL?o+=O.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=aht;r.longitude=o,r.latitude=t.north;let s=i.project(r,cht);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,lht),l=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,p=e.frustum.right/e.frustum.top,g=u*p;return l>g?(f=l,h=f/p):(h=u,f=g),u=Math.max(2*f,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=u,n=i.project(r,n),n}en.prototype.getRectangleCameraCoordinates=function(e,t){if(!c(e))throw new E("rectangle is required");let n=this._mode;if(c(t)||(t=new d),n===oe.SCENE3D)return yxe(this,e,t);if(n===oe.COLUMBUS_VIEW)return sht(this,e,t);if(n===oe.SCENE2D)return uht(this,e,t)};var fht=new mn;function dht(e,t,n,i){n=n??ie.default;let o=e.getPickRay(t,fht),r=Zn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return mn.getPoint(o,s,i)}var hht=new mn;function mht(e,t,n,i){let r=e.getPickRay(t,hht).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var pht=new mn;function _ht(e,t,n,i){let o=e.getPickRay(t,pht),r=-o.origin.x/o.direction.x;mn.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}en.prototype.pickEllipsoid=function(e,t,n){if(!c(e))throw new E("windowPosition is required.");let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(c(n)||(n=new d),t=t??ie.default,this._mode===oe.SCENE3D)n=dht(this,e,t,n);else if(this._mode===oe.SCENE2D)n=mht(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=_ht(this,e,this._projection,n);else return;return n}};var ght=new d,yht=new d,bht=new d;function xht(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,l=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,l,ght);d.add(h,p,p);let g=d.multiplyByScalar(e.rightWC,u*l*a,yht),m=d.multiplyByScalar(e.upWC,f*l*s,bht),y=d.add(p,g,n.direction);return d.add(y,m,y),d.subtract(y,h,y),d.normalize(y,y),n}var jH=new d;function Tht(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2/o*t.x-1;l*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,l,jH),d.add(jH,f,f),d.multiplyByScalar(e.upWC,u,jH),d.add(jH,f,f),d.clone(e.directionWC,n.direction),n}en.prototype.getPickRay=function(e,t){if(!c(e))throw new E("windowPosition is required.");c(t)||(t=new mn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return c(i.aspectRatio)&&c(i.fov)&&c(i.near)?xht(this,e,t):Tht(this,e,t)};var Aht=new d,Cht=new d;en.prototype.distanceToBoundingSphere=function(e){if(!c(e))throw new E("boundingSphere is required.");let t=d.subtract(this.positionWC,e.center,Aht),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),Cht);return Math.max(0,d.magnitude(n)-e.radius)};var Eht=new H;en.prototype.getPixelSize=function(e,t,n){if(!c(e))throw new E("boundingSphere is required.");if(!c(t))throw new E("drawingBufferWidth is required.");if(!c(n))throw new E("drawingBufferHeight is required.");let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Eht);return Math.max(o.x,o.y)};function Sht(e,t,n,i,o,r){let s=d.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(l){let u=d.lerp(t,s,l.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Qr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var wht=new d,nxe=new d,vht=new d,Dht=new d;function Pht(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,wht),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,nxe),nxe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,vht);let a=Math.tan(e.frustum.fovy*.5),l=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,Dht)),f=l*u,h=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(h-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let b=s.y<-m||s.y>m,x=s.z<-y||s.z>y;if(b||x)return Sht(e,n,s,m,y,t)}}en.prototype.createCorrectPositionTween=function(e){if(!c(e))throw new E("duration is required.");if(this._mode===oe.COLUMBUS_VIEW)return Pht(this,e)};var Iht=new d,ia={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};en.prototype.cancelFlight=function(){c(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};en.prototype.completeFlight=function(){if(c(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ia.destination,e.orientation.heading=ia.heading,e.orientation.pitch=ia.pitch,e.orientation.roll=ia.roll,this.setView(e),c(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};en.prototype.flyTo=function(e){e=e??W.EMPTY_OBJECT;let t=e.destination;if(!c(t))throw new E("destination is required.");if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,Iht));let o=e.orientation??W.EMPTY_OBJECT;if(c(o.direction)&&(o=dxe(this,t,o,xK.orientation)),c(e.duration)&&e.duration<=0){let f=xK;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;ia.destination=t,ia.heading=o.heading,ia.pitch=o.pitch,ia.roll=o.roll,ia.duration=e.duration,ia.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),c(e.complete)&&e.complete()},ia.cancel=e.cancel,ia.endTransform=e.endTransform,ia.convert=i?!1:e.convert,ia.maximumHeight=e.maximumHeight,ia.pitchAdjustHeight=e.pitchAdjustHeight,ia.flyOverLongitude=e.flyOverLongitude,ia.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ia.easingFunction=e.easingFunction;let a=this._scene,l=Z2.createTween(a,ia);if(l.duration===0){typeof l.complete=="function"&&l.complete();return}s=a.tweens.add(l),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(c(u)||(u=en.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function Oht(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Rht(e,t){let n=e.frustum,i=n.offCenterFrustum;c(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 Mht=100;function bxe(e,t,n){n=cd.clone(c(n)?n:en.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!c(r)||r===0){let s=t.radius;s===0?n.range=Mht:e.frustum instanceof on||e._mode===oe.SCENE2D?n.range=Rht(e,s):n.range=Oht(e,s),n.range=O.clamp(n.range,i,o)}return n}en.prototype.viewBoundingSphere=function(e,t){if(!c(e))throw new E("boundingSphere is required.");if(this._mode===oe.MORPHING)throw new E("viewBoundingSphere is not supported while morphing.");t=bxe(this,e,t),this.lookAt(e.center,t)};var Lht=new B,Nht=new d,Fht=new d,Bht=new d,kht=new d,Uht=new se,Vht=new Le,zht=new J;en.prototype.flyToBoundingSphere=function(e,t){if(!c(e))throw new E("boundingSphere is required.");t=t??W.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(B.IDENTITY);let i=bxe(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,Nht):o=gxe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??ie.default,a=Ot.eastNorthUpToFixedFrame(e.center,s,Lht);B.multiplyByPoint(a,o,o);let l,u;if(!n){if(l=d.subtract(e.center,o,Fht),d.normalize(l,l),u=B.multiplyByPointAsVector(a,d.UNIT_Z,Bht),1-Math.abs(d.dot(l,u))<O.EPSILON6){let h=Le.fromAxisAngle(l,i.heading,Vht),p=J.fromQuaternion(h,zht);d.fromCartesian4(B.getColumn(a,1,Uht),u),J.multiplyByVector(p,u,u)}let f=d.cross(l,u,kht);d.cross(f,l,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:l,up:u},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 ixe=new d,oxe=new d,yK=new d,rxe=new d,J2=[new d,new d,new d,new d];function Hht(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,ixe),r=d.magnitude(o),s=d.normalize(o,oxe),a,l;d.equalsEpsilon(s,d.UNIT_Z,O.EPSILON10)?(a=new d(0,1,0),l=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,yK),yK),l=d.normalize(d.cross(s,a,rxe),rxe));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,ixe),h=u/r,p=d.multiplyByScalar(a,h,oxe),g=d.multiplyByScalar(l,h,yK),m=d.add(f,g,J2[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let y=d.subtract(f,g,J2[1]);d.subtract(y,p,y),d.multiplyComponents(n,y,y);let b=d.subtract(f,g,J2[2]);d.add(b,p,b),d.multiplyComponents(n,b,b);let x=d.add(f,g,J2[3]);return d.add(x,p,x),d.multiplyComponents(n,x,x),J2}var bK=new H,Ght=new d,I0=[new he,new he,new he,new he];function WH(e,t,n,i,o,r){bK.x=e,bK.y=t;let s=i.pickEllipsoid(bK,o,Ght);return c(s)?(I0[n]=o.cartesianToCartographic(s,I0[n]),1):(I0[n]=o.cartesianToCartographic(r[n],I0[n]),0)}en.prototype.computeViewRectangle=function(e,t){e=e??ie.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Wt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,l=0,u=Hht(this,e);if(l+=WH(0,0,0,this,e,u),l+=WH(0,a,1,this,e,u),l+=WH(s,a,2,this,e,u),l+=WH(s,0,3,this,e,u),l<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(I0,t);let f=0,h=I0[3].longitude;for(let p=0;p<4;++p){let g=I0[p].longitude,m=Math.abs(g-h);m>O.PI?f+=O.TWO_PI-m:f+=m,h=g}return O.equalsEpsilon(Math.abs(f),O.TWO_PI,O.EPSILON9)&&(t.west=-O.PI,t.east=O.PI,I0[0].latitude>=0?t.north=O.PI_OVER_TWO:t.south=-O.PI_OVER_TWO),t};en.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Ci)return;let e=this._scene;this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.toRadians(60)};en.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof on)return;let e=uxe(this),t=this._scene;this.frustum=new on,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};en.clone=function(e,t){return c(t)||(t=new en(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),B.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=en;function jht(e){T.typeOf.object("options",e),T.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var gd=jht;var Exe=Zo(du(),1),xxe=576,Wht=100,eB="#ffffff",$H="#48b";function Sxe(e,t){this.credit=e,this.count=t??1}function qht(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Tt.equals(o,t))return!0}return!1}function Yht(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Tt.equals(n,t)||(c(t)&&e._cesiumCreditContainer.removeChild(t.element),c(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var wxe="cesium-credit-delimiter";function Txe(e){let t=document.createElement("span");return t.textContent=e,t.className=wxe,t}function Axe(e,t){if(c(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function Cxe(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(c(a)){if(r=s,c(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(Txe(n));else{let f=o[u];f.className!==wxe&&e.replaceChild(Txe(n),f)}}let l=a.element;if(o.length<=r)e.appendChild(Axe(l,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Axe(l,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Xht(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<xxe?(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>=xxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Kht(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: ${eB}; - position: relative; - min-height: ${Wht}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: ${eB}; -} -.cesium-credit-lightbox > ul > li a:hover { - color: ${$H}; -} -.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: ${eB}; -} -.cesium-credit-lightbox-close:hover { - color: ${$H}; -} -.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: ${eB}; -} -.cesium-credit-expand-link:hover { - color: ${$H}; -} - -.cesium-credit-text { - color: ${eB}; -} - -.cesium-credit-delimiter { - padding: 0 5px; -} - -.cesium-credit-textContainer *, -.cesium-credit-logoContainer * { - display: inline; -} - -.cesium-credit-textContainer a:hover { - color: ${$H} -} - -.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=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Tr(e,t,n){T.defined("container",e);let i=this;n=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(m){r.contains(m.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 l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",r.appendChild(l);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);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),Kht(e);let g=Tt.clone(Tr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,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 Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function vxe(e,t,n,i){i=i??1;let o=t.get(n.id);if(c(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 Sxe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Tr.prototype.addCreditToNextFrame=function(e){if(T.defined("credit",e),e.isIon()){c(this._defaultCredit)||(this._defaultCredit=Tt.clone(Dxe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,vxe(this,t,e)};Tr.prototype.addStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits;qht(t,e)||t.push(e)};Tr.prototype.removeStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Tr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Tr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Tr.prototype.update=function(){this._expanded&&Xht(this)};Tr.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()&&Tt.equals(Tr.cesiumCredit,this._cesiumCredit)||vxe(this,s,r,Number.MAX_VALUE)}Tt.equals(Tr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Tt.clone(Tr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Tr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;Cxe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",Cxe(this._creditList,t,void 0,"li"),Yht(this)};Tr.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),de(this)};Tr.prototype.isDestroyed=function(){return!1};Tr._cesiumCredit=void 0;Tr._cesiumCreditInitialized=!1;var ZH;function Dxe(){if(!c(ZH)){let e=tn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Exe.default(e).path()),ZH=new Tt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Tr._cesiumCreditInitialized||(Tr._cesiumCredit=ZH,Tr._cesiumCreditInitialized=!0),ZH}Object.defineProperties(Tr,{cesiumCredit:{get:function(){return Dxe(),Tr._cesiumCredit},set:function(e){Tr._cesiumCredit=e,Tr._cesiumCreditInitialized=!0}}});Tr.CreditDisplayElement=Sxe;var tB=Tr;var QH=0,$ht=1;function qT(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Ie.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Ci?(s=QH,a=Ci.packedLength):t instanceof on&&(s=$ht,a=on.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Le.packedLength+Ie.packedLength}qT.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===QH?(Ci.pack(o,t,n),n+=Ci.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var Zht=new Ci,Qht=new on,Jht=new Le,emt=new d,tmt=new Ie;qT.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===QH?(o=Ci.unpack(e,t,Zht),t+=Ci.packedLength):(o=on.unpack(e,t,Qht),t+=on.packedLength);let r=d.unpack(e,t,emt);t+=d.packedLength;let s=Le.unpack(e,t,Jht);t+=Le.packedLength;let a=Ie.unpack(e,t,tmt);t+=Ie.packedLength;let l=e[t]===1;if(!c(n))return new qT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:l});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=l,n};function Aw(e,t,n,i,o,r,s,a){let l=e/3*2;for(let u=0;u<4;++u)c(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),c(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),c(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[l]=0,o[l+1]=0,o[l+2]=1,o[l+3]=0,o[l+4]=1,o[l+5]=1,o[l+6]=0,o[l+7]=1}var nmt=new J,imt=new B,EK=new B,Pxe=new d,Ixe=new d,Oxe=new d,omt=new d,rmt=new d,smt=new d,O0=new Array(3),nB=new Array(4);nB[0]=new se(-1,-1,1,1);nB[1]=new se(1,-1,1,1);nB[2]=new se(1,1,1,1);nB[3]=new se(-1,1,1,1);var Rxe=new Array(4);for(let e=0;e<4;++e)Rxe[e]=new se;qT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let l=J.fromQuaternion(t,nmt),u=r??Pxe,f=s??Ixe,h=a??Oxe;u=J.getColumn(l,0,u),f=J.getColumn(l,1,f),h=J.getColumn(l,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=B.computeView(e,h,f,u,imt),g,m,y=i.projectionMatrix;if(n===QH){let b=B.multiply(y,p,EK);m=B.inverse(b,EK)}else g=B.inverseTransformation(p,EK);c(m)?(O0[0]=i.near,O0[1]=i.far):(O0[0]=0,O0[1]=i.near,O0[2]=i.far);for(let b=0;b<2;++b)for(let x=0;x<4;++x){let A=se.clone(nB[x],Rxe[x]);if(c(m)){A=B.multiplyByVector(m,A,A);let C=1/A.w;d.multiplyByScalar(A,C,A),d.subtract(A,e,A),d.normalize(A,A);let S=d.dot(h,A);d.multiplyByScalar(A,O0[b]/S,A),d.add(A,e,A)}else{let C=i.offCenterFrustum;c(C)&&(i=C);let S=O0[b],v=O0[b+1];A.x=(A.x*(i.right-i.left)+i.left+i.right)*.5,A.y=(A.y*(i.top-i.bottom)+i.bottom+i.top)*.5,A.z=(A.z*(S-v)-S-v)*.5,A.w=1,B.multiplyByVector(g,A,A)}o[12*b+x*3]=A.x,o[12*b+x*3+1]=A.y,o[12*b+x*3+2]=A.z}};qT.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,l=new Float64Array(3*4*6);qT._computeNearFarPlanes(i,o,t,n,l);let u=3*4*2;l[u]=l[3*4],l[u+1]=l[3*4+1],l[u+2]=l[3*4+2],l[u+3]=l[0],l[u+4]=l[1],l[u+5]=l[2],l[u+6]=l[3*3],l[u+7]=l[3*3+1],l[u+8]=l[3*3+2],l[u+9]=l[3*7],l[u+10]=l[3*7+1],l[u+11]=l[3*7+2],u+=3*4,l[u]=l[3*5],l[u+1]=l[3*5+1],l[u+2]=l[3*5+2],l[u+3]=l[3],l[u+4]=l[4],l[u+5]=l[5],l[u+6]=l[0],l[u+7]=l[1],l[u+8]=l[2],l[u+9]=l[3*4],l[u+10]=l[3*4+1],l[u+11]=l[3*4+2],u+=3*4,l[u]=l[3],l[u+1]=l[4],l[u+2]=l[5],l[u+3]=l[3*5],l[u+4]=l[3*5+1],l[u+5]=l[3*5+2],l[u+6]=l[3*6],l[u+7]=l[3*6+1],l[u+8]=l[3*6+2],l[u+9]=l[3*2],l[u+10]=l[3*2+1],l[u+11]=l[3*2+2],u+=3*4,l[u]=l[3*2],l[u+1]=l[3*2+1],l[u+2]=l[3*2+2],l[u+3]=l[3*6],l[u+4]=l[3*6+1],l[u+5]=l[3*6+2],l[u+6]=l[3*7],l[u+7]=l[3*7+1],l[u+8]=l[3*7+2],l[u+9]=l[3*3],l[u+10]=l[3*3+1],l[u+11]=l[3*3+2],r||(l=l.subarray(3*4));let f=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})});if(c(s.normal)||c(s.tangent)||c(s.bitangent)||c(s.st)){let p=c(s.normal)?new Float32Array(12*a):void 0,g=c(s.tangent)?new Float32Array(3*4*a):void 0,m=c(s.bitangent)?new Float32Array(3*4*a):void 0,y=c(s.st)?new Float32Array(2*4*a):void 0,b=Pxe,x=Ixe,A=Oxe,C=d.negate(b,omt),S=d.negate(x,rmt),v=d.negate(A,smt);u=0,r&&(Aw(u,p,g,m,y,v,b,x),u+=3*4),Aw(u,p,g,m,y,A,C,x),u+=3*4,Aw(u,p,g,m,y,C,v,x),u+=3*4,Aw(u,p,g,m,y,S,v,C),u+=3*4,Aw(u,p,g,m,y,b,A,x),u+=3*4,Aw(u,p,g,m,y,x,A,C),c(p)&&(f.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),c(g)&&(f.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),c(m)&&(f.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),c(y)&&(f.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:y}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;h[g]=m,h[g+1]=m+1,h[g+2]=m+2,h[g+3]=m,h[g+4]=m+2,h[g+5]=m+3}return new ct({attributes:f,indices:h,primitiveType:Me.TRIANGLES,boundingSphere:le.fromVertices(l)})};var YT=qT;var SK=0,amt=1;function iB(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Ci?(r=SK,s=Ci.packedLength):t instanceof on&&(r=amt,s=on.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Le.packedLength}iB.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===SK?(Ci.pack(o,t,n),n+=Ci.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var cmt=new Ci,lmt=new on,umt=new Le,fmt=new d;iB.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===SK?(o=Ci.unpack(e,t,cmt),t+=Ci.packedLength):(o=on.unpack(e,t,lmt),t+=on.packedLength);let r=d.unpack(e,t,fmt);t+=d.packedLength;let s=Le.unpack(e,t,umt);t+=Le.packedLength;let a=e[t]===1;if(!c(n))return new iB({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};iB.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);YT._computeNearFarPlanes(i,o,t,n,s);let a=new fn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),l,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)l=r?p*8:0,u=p*4,h[l]=u,h[l+1]=u+1,h[l+2]=u+1,h[l+3]=u+2,h[l+4]=u+2,h[l+5]=u+3,h[l+6]=u+3,h[l+7]=u;for(p=0;p<2;++p)l=(f+p)*8,u=p*4,h[l]=u,h[l+1]=u+4,h[l+2]=u+1,h[l+3]=u+5,h[l+4]=u+2,h[l+5]=u+6,h[l+6]=u+3,h[l+7]=u+7;return new ct({attributes:a,indices:h,primitiveType:Me.LINES,boundingSphere:le.fromVertices(s)})};var oB=iB;function JH(e){if(e=e??W.EMPTY_OBJECT,!c(e.camera))throw new E("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??G.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var dmt=new d,hmt=new J,mmt=new Le,pmt=new Ci,_mt=new bl,gmt=new on,ymt=new jo,bmt=new G,xmt=[1,1e5];JH.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 Ci?a=pmt:s instanceof bl?a=_mt:s instanceof on?a=gmt:a=ymt,a=s.clone(a);let l,u=this._frustumSplits;!c(u)||u.length<=1?(u=xmt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,l=1):l=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=d.negate(g,dmt);let m=hmt;J.setColumn(m,0,g,m),J.setColumn(m,1,p,m),J.setColumn(m,2,h,m);let y=Le.fromRotationMatrix(m,mmt);for(t.length=n.length=l,i=0;i<l;++i)a.near=u[i],a.far=u[i+1],t[i]=new Pn({geometryInstances:new St({geometry:new YT({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(G.fromAlpha(this._color,.1,bmt))},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Pn({geometryInstances:new St({geometry:new oB({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Gt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};JH.prototype.isDestroyed=function(){return!1};JH.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 de(this)};var sp=JH;function sB(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=e??0}var rB=Vt.supportsTypedArrays()?new Float32Array(12):[],Mxe=new d,Lxe=new d,wK=new d,Nxe=new d,eG=new d;function Tmt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof on)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,Mxe),g=d.normalize(p,Lxe),m=d.normalize(d.cross(d.UNIT_Z,p,wK),wK),y=d.normalize(d.cross(g,m,Nxe),Nxe),b=d.magnitude(p),x=Math.sqrt(b*b-1);o=d.multiplyByScalar(g,1/b,Mxe);let A=x/b;r=d.multiplyByScalar(m,A,Lxe),s=d.multiplyByScalar(y,A,wK)}let a=d.add(o,s,eG);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,rB,0);let l=d.subtract(o,s,eG);d.subtract(l,r,l),d.multiplyComponents(n,l,l),d.pack(l,rB,3);let u=d.add(o,s,eG);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,rB,6);let f=d.subtract(o,s,eG);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,rB,9),rB}sB.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 ie(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(c(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Qe({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:De.OPAQUE,owner:this})),!c(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new He({sources:[t2]}),a=new He({sources:[e2]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Jt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Tmt(i,e);if(c(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ti.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Be.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};sB.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};sB.prototype.isDestroyed=function(){return!1};sB.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var aB=sB;function Ew(){}var Amt=/\bgl_FragDepth\b/,Cmt=/\bdiscard\b/;function Emt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(c(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(Amt.test(r[a])||Cmt.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 He({sources:[a]})}else if(!o&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`;i=new He({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Smt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(c(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}Ew.createDepthOnlyDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=Qe.shallowClone(t,i.depthOnlyCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Emt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Smt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var wmt=/\s+czm_writeLogDepth\(/,vmt=/\s+czm_vertexLogDepth\(/;function Dmt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(c(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=c(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,l=r.sources;for(let f=0;f<l.length;++f)if(vmt.test(l[f])){a=!0;break}if(!a){for(let h=0;h<l.length;++h)l[h]=He.replaceMain(l[h],"czm_log_depth_main");l.push(` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`)}l=s.sources,a=!1;for(let f=0;f<l.length;++f)wmt.test(l[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<l.length;f++)l[f]=He.replaceMain(l[f],"czm_log_depth_main");u=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}return l.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}Ew.createLogDepthCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Qe.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Dmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Pmt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(c(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,l=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () +${i}} +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function DBt(e,t){return qse(e,t,"translucentMRT",wBt)}function RBt(e,t){return qse(e,t,"translucentMultipass",IBt)}function OBt(e,t){return qse(e,t,"alphaMultipass",PBt)}cy.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=at.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=DBt(t,e.shaderProgram),n.translucentCommand.renderState=CBt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),n.alphaCommand=at.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=RBt(t,e.shaderProgram),n.translucentCommand.renderState=vBt(this,t,e.renderState),n.alphaCommand.shaderProgram=OBt(t,e.shaderProgram),n.alphaCommand.renderState=SBt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function MBt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.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 m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function NBt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}cy.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){NBt(this,e,t,n,i,r);return}MBt(this,e,t,n,i,r)};cy.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};cy.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.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};cy.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){return KLe(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()),ue(this)};var Vz=cy;function jz(){this._framebuffer=new ai({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(jz.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function LBt(e){e._framebuffer.destroy()}function FBt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new sc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}jz.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&FBt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};jz.prototype.isDestroyed=function(){return!1};jz.prototype.destroy=function(){return LBt(this),ue(this)};var Hz=jz;function _C(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ai({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function $Le(e,t,n,i,r=1){let o=Math.max(n,i),s=o*o,a=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<s;++m){if(-a<=u&&u<=a&&-c<=f&&f<=c){let y=4*((c-f)*n+u+a),A=z.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}_C.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};_C.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,s=this._fb.framebuffer,a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:s}),f=RO.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=Ke.createTypedArray(c,a,i,r);return u.getBufferData(d),$Le(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};_C.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return $Le(r,o,n,i,t)};_C.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+o);return r.slice(a,a+4)};_C.prototype.isDestroyed=function(){return!1};_C.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var Gz=_C;function ly(){this._numSamples=1,this._colorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,owner:this})}function BBt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(ly.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});ly.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};ly.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};ly.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};ly.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};ly.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};ly.prototype.isDestroyed=function(){return!1};ly.prototype.destroy=function(){return BBt(this),ue(this)};var yC=ly;function Fb(){}var kBt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};Fb.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return kBt[n]===!0})};Fb.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};Fb.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Ye.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Ye.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC; +void main() { - czm_non_pick_main(); - if (${l}.a == 0.0) { - discard; - } - ${l} = ${n}; -} `,f=r.length,h=new Array(f+1);for(let g=0;g<f;++g)h[g]=He.replaceMain(r[g],"czm_non_pick_main");h[f]=u;let p=new He({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Fxe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(c(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}Ew.createPickDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=Qe.shallowClone(t,i.pickCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Pmt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Fxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function Cw(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 Bxe(e){return e.isArray?e.arrayLength:at.getComponentCount(e.type)}function Imt(e){let t=Bxe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function kxe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function Uxe(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function Omt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=kxe(n,i,o)}return e.normalized||(n=Uxe(n,e.componentType)),n}function Rmt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=kxe(o,r,s)}return e.normalized||(o=Uxe(o,e.componentType)),o}function Mmt(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(c(a))return a;let l=n.metadataProperty,u=n.classProperty,f=Imt(u),h=["0.0","0.0","0.0","0.0"],p=Bxe(u);if(p===1)h[0]=Omt(u,l);else{let b=["x","y","z","w"];for(let x=0;x<p;x++)h[x]=Rmt(u,l,b[x])}let g=t.fragmentShaderSource.defines.slice();g.push(Pu.METADATA_PICKING_ENABLED),Cw(g,Pu.METADATA_PICKING_VALUE_TYPE,f),Cw(g,Pu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),Cw(g,Pu.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new He({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}Ew.createPickMetadataDerivedCommand=function(e,t,n,i){return c(i)||(i={}),i.pickMetadataCommand=Qe.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Mmt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Fxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function Lmt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(c(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=c(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}Ew.createHdrCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Qe.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Lmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var ap=Ew;function tG(e){if(!c(e))throw new E("scene is required.");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(!c(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=O.toRadians(o),t._beta=O.toRadians(i.beta),t._gamma=O.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var Nmt=new Le,Vxe=new Le,Fmt=new J;function Bmt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Le.fromAxisAngle(o,n,Vxe),l=Le.fromAxisAngle(r,i,Nmt),u=Le.multiply(l,a,l),f=Le.fromAxisAngle(s,t,Vxe);Le.multiply(f,u,u);let h=J.fromQuaternion(u,Fmt);J.multiplyByVector(h,r,r),J.multiplyByVector(h,s,s),J.multiplyByVector(h,o,o)}tG.prototype.update=function(){if(!c(this._alpha))return;c(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;Bmt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};tG.prototype.isDestroyed=function(){return!1};tG.prototype.destroy=function(){return this._removeListener(),de(this)};var cB=tG;function vK(){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(vK.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){if(c(e)&&e<0)throw new E("value must be positive.");this._heightFalloff=e}}});var kmt=new d;vK.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!c(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,O.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,kmt),a=Math.abs(d.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 lB=vK;function Umt(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 uB=Umt;var Sa={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},XT=Sa.DERIVED_COMMANDS_MAXIMUM_LENGTH,$xe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function KT(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(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(XT),this._derivedBlendCommandTypes=new Array(XT),this._derivedPickCommandTypes=new Array(XT),this._derivedCommandTypesToUpdate=new Array(XT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(KT.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}}});KT.prototype.update=function(e){let t=e.globe;if(!c(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=zxe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=zxe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Hxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Hxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Gmt(this,e,t),this._sunVisibleThroughGlobe=Vmt(this,e),this._environmentVisible=zmt(this,e),this._useDepthPlane=Hmt(this,e),this._numberOfTextureUniforms=jmt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Wmt(this,e)};function zxe(e,t,n,i){return e?c(n)?(Bt.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 Hxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Vmt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function zmt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Hmt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Gmt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function jmt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Wmt(e,t){e._derivedCommandsLength=DK(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=DK(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=DK(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<XT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!c(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=spt())}function DK(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let l=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?Sa.PICK_FRONT_FACE:u?Sa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Sa.TRANSLUCENT_FRONT_FACE,h=i?Sa.PICK_BACK_FACE:u?Sa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Sa.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=Sa.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=Sa.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):l?(n||(o[r++]=Sa.DEPTH_ONLY_BACK_FACE),o[r++]=Sa.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=Sa.DEPTH_ONLY_FRONT_FACE),o[r++]=Sa.OPAQUE_BACK_FACE,o[r++]=f),r)}function yd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Gxe(e,t){return e.indexOf(t)>-1}function qmt(e,t){yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function Ymt(e,t){yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG"),yd(e.defines,"TRANSLUCENT"),yd(t.defines,"TRANSLUCENT")}function PK(e,t){if(Gxe(t.defines,"TILE_LIMIT_RECTANGLE")||Gxe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() + czm_shadow_cast_main(); + v_positionEC = (czm_inverseProjection * gl_Position).xyz; +}`)}return new Ye({defines:i,sources:r})};Fb.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),s=e.sources.slice(0);o.push("SHADOW_MAP");let a=Ye.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let u=s.length;for(let d=0;d<u;++d)s[d]=Ye.replaceMain(s[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC; +`),f+=`uniform vec4 shadowMap_lightPositionEC; +`),i&&r?f+=`void main() { - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function IK(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=He.replaceMain(n[r],"czm_globe_translucency_main");n.push(` - -uniform sampler2D u_classificationTexture; -void main() + czm_shadow_cast_main(); +`:i?f+=`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) +`:f+=`void main() +{ + czm_shadow_cast_main(); + if (out_FragColor.a == 0.0) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } + discard; } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) +`,t?f+=` float distance = length(${a}); + if (distance >= shadowMap_lightPositionEC.w) { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; + discard; } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`)}function Zxe(e,t){IK(e,t),yd(e.defines,"GROUND_ATMOSPHERE"),yd(t.defines,"GROUND_ATMOSPHERE"),yd(e.defines,"FOG"),yd(t.defines,"FOG")}function Xmt(e,t){IK(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Kmt(e,t){Zxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function jxe(e,t){let n=`uniform sampler2D u_classificationTexture; -void main() + distance /= shadowMap_lightPositionEC.w; // radius + out_FragColor = czm_packDepth(distance); +`:n?f+=` out_FragColor = vec4(1.0); +`:f+=` out_FragColor = czm_packDepth(gl_FragCoord.z); +`,f+=`} +`,s.push(f),new Ye({defines:o,sources:s})};Fb.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};Fb.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Ye({defines:i,sources:r})};Fb.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Ye.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Ye.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let S=0;S<T;++S)x[S]=Ye.replaceMain(x[S],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube; +`:E+=`uniform sampler2D shadowMap_texture; +`;let v;return c?v=` return vec4(${a}, 1.0); +`:v=`#ifndef LOG_DEPTH + return czm_windowToEyeCoordinates(gl_FragCoord); +#else + return vec4(v_logPositionEC, 1.0); +#endif +`,E+=`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() { - vec2 st = gl_FragCoord.xy / czm_viewport.zw; - vec4 pickColor = texture(u_classificationTexture, st); - if (pickColor == vec4(0.0)) +${v}} +vec3 getNormalEC() +{ +${s?` return normalize(${o}); +`:` return vec3(1.0); +`}} +void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) +{ +${A.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; + float normalOffsetScale = 1.0 - nDotL; + vec3 offset = normalOffset * normalOffsetScale * normalEC; + positionEC.xyz += offset; +`:""}} +`,E+=`void main() +{ + czm_shadow_receive_main(); + vec4 positionEC = getPositionEC(); + vec3 normalEC = getNormalEC(); + float depth = -positionEC.z; +`,E+=` czm_shadowParameters shadowParameters; + shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; + shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; + shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; + shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; +`,i?E+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); +`:f||(E+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); +`),d?E+=` 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) { - discard; - } - out_FragColor = pickColor; -} -`;t.sources=[n]}function $mt(e,t,n,i,o,r){if(!c(o))return t;if(!i&&c(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!c(s)){let a=t._attributeLocations,l=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();l.defines=c(l.defines)?l.defines.slice(0):[],u.defines=c(u.defines)?u.defines.slice(0):[],o(l,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:a})}return s}function Zmt(e){e.cull.face=xi.BACK,e.cull.enabled=!0}function Qmt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0}function Jmt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ept(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function tpt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Wxe(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function qxe(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=ln.ALPHA_BLEND}function npt(e){e.cull.face=xi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function ipt(e){e.cull.face=xi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function opt(e,t,n,i,o){if(!c(i))return e;if(!n&&c(t))return t;let r=o[e.id];if(!c(r)){let s=Ve.getState(e);i(s),r=Ve.fromCache(s),o[e.id]=r}return r}function Sw(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function rpt(e,t,n,i,o){return c(o)?!i&&c(n)?n:xt(t,o(e),!1):t}function jh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function spt(){return[new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:qmt,getRenderStateFunction:Zmt,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:Ymt,getRenderStateFunction:Qmt,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:PK,getRenderStateFunction:Jmt,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:PK,getRenderStateFunction:ept,getUniformMapFunction:void 0}),new jh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:PK,getRenderStateFunction:tpt,getUniformMapFunction:void 0}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:IK,getRenderStateFunction:Wxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Zxe,getRenderStateFunction:qxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Xmt,getRenderStateFunction:Wxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Kmt,getRenderStateFunction:qxe,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:jxe,getRenderStateFunction:npt,getUniformMapFunction:Sw}),new jh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:jxe,getRenderStateFunction:ipt,getUniformMapFunction:Sw})]}var Yxe=new Array(XT),Xxe=new Array(XT);KT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Xxe[o]=this._derivedCommandPacks[n[o]],Yxe[o]=$xe[n[o]];apt(this,e,i,n,Yxe,Xxe,t)}};function apt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!c(a)||l){t.dirty=!1,c(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let x=r[b],A=i[b],C=o[b],S=a[C],v,P,M;c(S)?(v=S.uniformMap,P=S.shaderProgram,M=S.renderState):(v=void 0,P=void 0,M=void 0),S=Qe.shallowClone(t,S),a[C]=S;let R=S.derivedCommands.uniformMapDirtyFrame??0,L=S.derivedCommands.shaderProgramDirtyFrame??0,F=S.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,w=m||L<h,D=y||F<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),w&&(S.derivedCommands.shaderProgramDirtyFrame=u),D&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=A,S.pass=x.pass,S.pickOnly=x.pickOnly,S.uniformMap=rpt(e,t.uniformMap,v,_,x.getUniformMapFunction),S.shaderProgram=$mt(s.context,t.shaderProgram,P,w,x.getShaderProgramFunction,C),S.renderState=opt(t.renderState,M,D,x.getRenderStateFunction,x.renderStateCache)}}}KT.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 l=$xe[o[a]];n.commandList.push(s[l])}};function Qxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],l=a.derivedCommands.type;(!c(r)||r.indexOf(l)>-1)&&n(a,i,o)}}function Kxe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var cpt=[Sa.OPAQUE_FRONT_FACE,Sa.OPAQUE_BACK_FACE],lpt=[Sa.DEPTH_ONLY_FRONT_FACE,Sa.DEPTH_ONLY_BACK_FACE,Sa.DEPTH_ONLY_FRONT_AND_BACK_FACE];KT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[De.GLOBE],a=e.indices[De.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Qxe(s,a,t,i,o,cpt))};KT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[De.GLOBE],l=e.indices[De.GLOBE],u=e.commands[De.TERRAIN_CLASSIFICATION],f=e.indices[De.TERRAIN_CLASSIFICATION];if(l===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&Kxe(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Qxe(a,l,t,i,o,lpt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}Kxe(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=m};var fB=KT;var su=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;function cp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({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 ei({color:new G(0,0,0,0),owner:this}),this._clearCommand=new ei({color:new G(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(cp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});cp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var upt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},fpt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:ln.ALPHA_BLEND},dpt={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:ln.ALPHA_BLEND},hpt=`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; -} -`,mpt=`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 -} -`;cp.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,l=!c(i)||i.width!==s||i.height!==a;if((l||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._previousFramebuffer)||(this._depthStencilTexture=new Rt({context:e,width:s,height:a,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:s,height:a,format:uc.DEPTH24_STENCIL8,numSamples:t})))),!c(this._fbo.framebuffer)||l||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;c(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),c(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),c(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(c(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(upt),this._rsClassified=Ve.fromCache(fpt),this._rsDefault=Ve.fromCache(dpt)),!c(this._unclassifiedCommand)||o||r){c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=c(this._previousFramebuffer)?mpt:hpt,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),h=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:c(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:c(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),c(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),c(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(su,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};cp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};cp.prototype.clear=function(e,t){c(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};cp.prototype.executeClassified=function(e,t){if(!c(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)};cp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),de(this)};var ww=cp;function nG(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(nG.prototype,{total:{get:function(){return this._total}}});function R0(e){if(c(e)&&e.length!==pa.NUMBER_OF_JOB_TYPES)throw new E("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let t=new Array(pa.NUMBER_OF_JOB_TYPES);t[pa.TEXTURE]=new nG(c(e)?e[pa.TEXTURE]:10),t[pa.PROGRAM]=new nG(c(e)?e[pa.PROGRAM]:10),t[pa.BUFFER]=new nG(c(e)?e[pa.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}R0.getTimestamp=Ti;Object.defineProperties(R0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});R0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};R0.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};R0.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 l=n.length,u;for(u=0;u<l&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===l&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=R0.getTimestamp();e.execute();let a=R0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var dB=R0;function iG(e){e=e??W.EMPTY_OBJECT;let t=In(e.container);if(!c(t))throw new E("container is required");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=Ti(),this._lastMsSampleTime=Ti(),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(iG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});iG.prototype.update=function(e){let t=Ti(),n=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}};iG.prototype.destroy=function(){return de(this)};var yg=iG;var wa={};wa.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};wa.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=wa.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};wa.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=at.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=wa.decodeRawMetadataValueComponent(e,t,p);f[h]=g}return f}let l=n*a;return wa.decodeRawMetadataValueComponent(e,t,l)};wa.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=wa.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return wa.decodeRawMetadataValueElement(e,n,0)};wa.convertToObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case at.VEC2:return H.unpack(n,0,new H);case at.VEC3:return d.unpack(n,0,new d);case at.VEC4:return se.unpack(n,0,new se);case at.MAT2:return Ri.unpack(n,0,new Ri);case at.MAT3:return J.unpack(n,0,new J);case at.MAT4:return B.unpack(n,0,new B)}throw new ae(`Invalid metadata object type: ${e}`)};wa.convertFromObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;switch(e){case at.VEC2:return H.pack(t,Array(2));case at.VEC3:return d.pack(t,Array(3));case at.VEC4:return se.pack(t,Array(4));case at.MAT2:return Ri.pack(t,Array(4));case at.MAT3:return J.pack(t,Array(9));case at.MAT4:return B.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};wa.decodeMetadataValues=function(e,t,n){let i=wa.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=wa.convertFromObjectType(e.type,t.offset),s=wa.convertFromObjectType(e.type,t.scale);i=Tm.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let l=i[a],u=wa.convertToObjectType(e.type,l);s[a]=u}return s}return wa.convertToObjectType(e.type,i)};var hB=Object.freeze(wa);function $T(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties($T.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ppt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function _pt(e,t,n){c(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:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}$T.prototype.update=function(e,t){ppt(this,e,t),_pt(this,e,t)};var gpt=new se,ypt=new se(1,1/255,1/65025,1/16581375);$T.prototype.getDepth=function(e,t,n){if(!c(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,gpt);return se.divideByScalar(o,255,o),se.dot(o,ypt)};$T.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};$T.prototype.isDestroyed=function(){return!1};$T.prototype.destroy=function(){return this._framebuffer.destroy(),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=c(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),de(this)};var mB=$T;function bpt(e,t){this.near=e??0,this.far=t??0;let n=De.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 pB=bpt;var M0=`uniform highp sampler2D u_depthTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function lp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({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(lp.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 Jxe(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),(!c(e._rs)||!Ke.equals(r,e._rs.viewport)||a)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,c(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,c(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,c(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,c(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ei({color:new G(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}lp.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,l=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,l),this._copyDepthFramebuffer.update(e,s,a),Jxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};lp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};lp.prototype.executeCopyDepth=function(e,t){c(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};lp.prototype.executeUpdateDepth=function(e,t,n){let i=c(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){c(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!c(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!c(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),Jxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};lp.prototype.executeCopyColor=function(e,t){c(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};lp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;c(i)&&(G.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),c(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),c(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),c(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),de(this)};var _B=lp;function ZT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,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(ZT.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 xpt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Tpt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Apt(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),(!c(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(M0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),c(e._clearCommand)||(e._clearCommand=new ei({color:new G(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}ZT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Tpt(this,n,o,r,e),Apt(this,n,o,r,i),this._useHdr=e};ZT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};ZT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};ZT.prototype.isDestroyed=function(){return!1};ZT.prototype.destroy=function(){return xpt(this),de(this)};var gB=ZT;function bg(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 hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ei({color:new G(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ei({color:new G(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ei({color:new G(0,0,0,0),owner:this}),this._alphaClearCommand=new ei({color:new G(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 eTe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function OK(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function tTe(e){eTe(e),OK(e)}function Cpt(e,t,n,i){eTe(e),e._accumulationTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function Ept(e,t){OK(e);let n=ne.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)&&(OK(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,l=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!l||!u)&&(tTe(e),e._translucentMultipassSupport=!1,i=!1)}return i}bg.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,l=!c(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((l||u)&&(this._numSamples=o,Cpt(this,e,r,s)),(!c(this._translucentFBO.framebuffer)||l||u)&&!Ept(this,e))return;this._useHDR=i;let f=this,h,p;c(this._compositeCommand)||(h=new He({sources:[JF]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),c(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new He({defines:["MRT"],sources:[JS]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new He({sources:[JS]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._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),m=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),m=!0),(!c(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),c(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Spt={enabled:!0,color:new G(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA},wpt={enabled:!0,color:new G(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ONE,functionDestinationRgb:Eo.ONE,functionSourceAlpha:Eo.ONE,functionDestinationAlpha:Eo.ONE},vpt={enabled:!0,color:new G(0,0,0,0),equationRgb:Fa.ADD,equationAlpha:Fa.ADD,functionSourceRgb:Eo.ZERO,functionDestinationRgb:Eo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Eo.ZERO,functionDestinationAlpha:Eo.ONE_MINUS_SOURCE_ALPHA};function RK(e,t,n,i){let o=n[i.id];if(!c(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function Dpt(e,t,n){return RK(t,Spt,e._translucentRenderStateCache,n)}function Ppt(e,t,n){return RK(t,wpt,e._translucentRenderStateCache,n)}function Ipt(e,t,n){return RK(t,vpt,e._alphaRenderStateCache,n)}var Opt=` 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); -`,Rpt=` 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; -`,Mpt=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function MK(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(c(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return He.replaceMain(f,"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 l=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<l.length;f++){let h=l[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]}; -${u}`}return a.sources.push(u),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 Lpt(e,t){return MK(e,t,"translucentMRT",Opt)}function Npt(e,t){return MK(e,t,"translucentMultipass",Rpt)}function Fpt(e,t){return MK(e,t,"alphaMultipass",Mpt)}bg.prototype.createDerivedCommands=function(e,t,n){if(c(n)||(n={}),this._translucentMRTSupport){let a,l;return c(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,l=n.translucentCommand.renderState),n.translucentCommand=Qe.shallowClone(e,n.translucentCommand),!c(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Lpt(t,e.shaderProgram),n.translucentCommand.renderState=Dpt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=l),n}let i,o,r,s;return c(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Qe.shallowClone(e,n.translucentCommand),n.alphaCommand=Qe.shallowClone(e,n.alphaCommand),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Npt(t,e.shaderProgram),n.translucentCommand.renderState=Ppt(this,t,e.renderState),n.alphaCommand.shaderProgram=Fpt(t,e.shaderProgram),n.alphaCommand.renderState=Ipt(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 Bpt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.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 m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=h}function kpt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=h}bg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){kpt(this,e,t,n,i,o);return}Bpt(this,e,t,n,i,o)};bg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};bg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,G.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};bg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return tTe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),de(this)};var yB=bg;function bB(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(bB.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Upt(e){e._framebuffer.destroy()}function Vpt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new lc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}bB.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Vpt(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};bB.prototype.isDestroyed=function(){return!1};bB.prototype.destroy=function(){return Upt(this),de(this)};var xB=bB;function vw(e){let t=new lc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}vw.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 TB=new G;vw.prototype.end=function(e){let t=e.width??1,n=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),l=Math.floor(n*.5),u=0,f=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-l<=f&&f<=l){let m=4*((l-f)*t+u+a);TB.red=G.byteToFloat(o[m]),TB.green=G.byteToFloat(o[m+1]),TB.blue=G.byteToFloat(o[m+2]),TB.alpha=G.byteToFloat(o[m+3]);let y=i.getObjectByPickColor(TB);if(c(y))return y}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=h;h=-p,p=m}u+=h,f+=p}};vw.prototype.readCenterPixel=function(e){let t=e.width??1,n=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)};vw.prototype.isDestroyed=function(){return!1};vw.prototype.destroy=function(){return this._fb.destroy(),de(this)};var AB=vw;function xg(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new G(0,0,0,0),this._clearCommand=new ei({color:new G(0,0,0,0),depth:1,owner:this})}function zpt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(xg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});xg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};xg.prototype.clear=function(e,t,n){G.clone(n,this._clearCommand.color),G.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};xg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};xg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};xg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){return zpt(this),de(this)};var QT=xg;function JT(){}JT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};JT.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=He.findPositionVarying(e),s=c(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=He.replaceMain(o[u],"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 He({defines:i,sources:o})};JT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=He.findPositionVarying(e),a=c(s);a||(s="v_positionEC");let l=r.length;for(let f=0;f<l;++f)r[f]=He.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,r.push(u),new He({defines:o,sources:r})};JT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${l}${u}${f}${t}${n}${i}`};JT.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 He({defines:i,sources:o})};JT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=He.findNormalVarying(e),s=!i&&c(r)||i&&o,a=He.findPositionVarying(e),l=c(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,b=h?t._pointBias:i?t._terrainBias:t._primitiveBias,x=e.defines.slice(0),A=e.sources.slice(0),C=A.length;for(let P=0;P<C;++P)A[P]=He.replaceMain(A[P],"czm_shadow_receive_main");h?x.push("USE_CUBE_MAP_SHADOW"):u&&x.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!h&&x.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?x.push("ENABLE_VERTEX_LIGHTING"):x.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(x.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&x.push("USE_NORMAL_SHADING_SMOOTH"));let S="";h?S+=`uniform samplerCube shadowMap_textureCube; -`:S+=`uniform sampler2D shadowMap_texture; -`;let v;return l?v=` return vec4(${a}, 1.0); -`:v=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,S+=`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() -{ -${v}} -vec3 getNormalEC() -{ -${s?` return normalize(${r}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,S+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,S+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),h?S+=` 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; + 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?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); +`:p?E+=` 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; @@ -8637,7 +9412,7 @@ ${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanc shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; +`:g?E+=` float maxDepth = shadowMap_cascadeSplits[1].w; // Stop early if the eye depth exceeds the last cascade if (depth > maxDepth) { @@ -8661,7 +9436,7 @@ ${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanc visibility = mix(visibility, 1.0, fade); ${m?` // Draw cascade colors for debugging out_FragColor *= czm_cascadeColor(weights); -`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); +`:""}`:E+=` 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 @@ -8673,9 +9448,9 @@ ${m?` // Draw cascade colors for debugging shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`,S+=` out_FragColor.rgb *= visibility; +`,E+=` out_FragColor.rgb *= visibility; } -`,A.push(S),new He({defines:x,sources:A})};var up=JT;function fp(e){e=e??W.EMPTY_OBJECT;let t=e.context;if(!c(t))throw new E("context is required.");if(!c(e.lightCamera))throw new E("lightCamera is required.");if(c(e.numberOfCascades)&&e.numberOfCascades!==1&&e.numberOfCascades!==4)throw new E("Only one or four cascades are supported.");this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Vt.isInternetExplorer()||Vt.isEdge()||(Vt.isChrome()||Vt.isFirefox())&&Vt.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 B,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new oG,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new H,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new jo:c(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new B,new B,new B,new B],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 Hpt(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,NK(this),this._clearCommand=new ei({depth:1,color:new G}),this._clearPassState=new lc(t),this._size=e.size??2048,this.size=this._size}fp.MAXIMUM_DISTANCE=2e4;function Hpt(e){this.camera=new oG,this.passState=new lc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function LK(e,t){return Ve.fromCache({cull:{enabled:!0,face:xi.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 NK(e){let t=!e._usesDepthTexture;e._primitiveRenderState=LK(t,e._primitiveBias),e._terrainRenderState=LK(t,e._terrainBias),e._pointRenderState=LK(t,e._pointBias)}fp.prototype.debugCreateRenderStates=function(){NK(this)};Object.defineProperties(fp.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){Xpt(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 FK(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;c(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Gpt(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uc.DEPTH_COMPONENT16}),i=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=new Ur({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 jpt(e,t){let n=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),i=new Ur({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 Wpt(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uc.DEPTH_COMPONENT16}),i=new Go({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.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 Ur({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 oTe(e,t){e._isPointLight?Wpt(e,t):e._usesDepthTexture?jpt(e,t):Gpt(e,t)}function qpt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,NK(e),FK(e),oTe(e,t))}function Ypt(e,t){(!c(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(FK(e),oTe(e,t),qpt(e,t),rTe(e,t))}function rTe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Xpt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=ut.maximumCubeMapSize>=t?t:ut.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=ut.maximumTextureSize>=t?t:ut.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=ut.maximumTextureSize>=t*2?t:ut.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,l=a.x/o.x,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new B(f,0,0,l,0,h,0,u,0,0,1,0,0,0,0,1)}}var Kpt=new Ke;function $pt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,x.push(E),new Ye({defines:b,sources:x})};var up=Fb;function V0(e){e=e??H.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(dn.isEdge()||(dn.isChrome()||dn.isFirefox())&&dn.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 N,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new rW,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ce,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ys:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new N,new N,new N,new N],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new UBt(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,Xse(this),this._clearCommand=new li({depth:1,color:new z}),this._clearPassState=new sc(t),this._size=e.size??2048,this.size=this._size}V0.MAXIMUM_DISTANCE=2e4;function UBt(e){this.camera=new rW,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Yse(e,t){return Ge.fromCache({cull:{enabled:!0,face:Vi.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 Xse(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Yse(t,e._primitiveBias),e._terrainRenderState=Yse(t,e._terrainBias),e._pointRenderState=Yse(t,e._pointBias)}V0.prototype.debugCreateRenderStates=function(){Xse(this)};Object.defineProperties(V0.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){WBt(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 Kse(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function zBt(e,t){let n=new Sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Vl.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST}),r=new _s({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function VBt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),i=new _s({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function jBt(e,t){let n=new Sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Vl.DEPTH_COMPONENT16}),i=new ns({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new _s({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function QLe(e,t){e._isPointLight?jBt(e,t):e._usesDepthTexture?VBt(e,t):zBt(e,t)}function HBt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Xse(e),Kse(e),QLe(e,t))}function GBt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Kse(e),QLe(e,t),HBt(e,t),eFe(e,t))}function eFe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function WBt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=kt.maximumCubeMapSize>=t?t:kt.maximumCubeMapSize,r.x=t,r.y=t;let o=new et(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=kt.maximumTextureSize>=t?t:kt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=kt.maximumTextureSize>=t*2?t:kt.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new N(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var qBt=new et;function YBt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -8736,7 +9511,17 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` 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=De.OVERLAY,i}function Zpt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Kpt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;c(a)||(a=$pt(e,n),e._debugShadowViewCommand=a),(!c(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ve.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 L0=new B,BK=new Array(8);for(let e=0;e<8;++e)BK[e]=new se;function Qpt(e,t){let n=new St({geometry:new Ud({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Gt.fromColor(t)}}),i=new St({geometry:new M_({radius:.5}),attributes:{color:Gt.fromColor(t)}});return new Pn({geometryInstances:[n,i],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Jpt=[G.RED,G.GREEN,G.BLUE,G.MAGENTA],e_t=new d;function t_t(e,t){Zpt(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 sp({camera:e._sceneCamera,color:G.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new sp({camera:e._shadowMapCamera,color:G.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 sp({camera:e._passes[i].camera,color:Jpt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!c(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Le.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,e_t),a=B.fromTranslationQuaternionRotationScale(i,o,s,L0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Qpt(a,G.YELLOW)}e._debugLightFrustum.update(t)}else(!c(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new sp({camera:e._shadowMapCamera,color:G.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function oG(){this.viewMatrix=new B,this.inverseViewMatrix=new B,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new B}oG.prototype.clone=function(e){B.clone(e.viewMatrix,this.viewMatrix),B.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var n_t=new B(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);oG.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return B.multiply(t,e,this.viewProjectionMatrix),B.multiply(n_t,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var i_t=new Array(5),o_t=new Ci,r_t=new Array(4),sTe=new d,aTe=new d;function s_t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,l=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=r_t,g=i_t;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,_=o*Math.pow(u,F),w=o+l*F,D=O.lerp(w,_,f);g[a+1]=D,p[a]=D-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,b=m.right,x=m.bottom,A=m.top,C=m.near,S=m.far,v=n.positionWC,P=n.directionWC,M=n.upWC,R=i.frustum.clone(o_t),L=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let F=B.multiply(R.projectionMatrix,i.viewMatrix,L0),_=B.inverse(F,L0),w=B.multiply(L,_,L0),D=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sTe),I=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aTe);for(let j=0;j<8;++j){let U=se.clone(dp[j],BK[j]);B.multiplyByVector(w,U,U),d.divideByScalar(U,U.w,U),d.minimumByComponent(U,D,D),d.maximumByComponent(U,I,I)}D.x=Math.max(D.x,0),D.y=Math.max(D.y,0),D.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],k=N.camera;k.clone(n);let z=k.frustum;z.left=y+D.x*(b-y),z.right=y+I.x*(b-y),z.bottom=x+D.y*(A-x),z.top=x+I.y*(A-x),z.near=C+D.z*(S-C),z.far=C+I.z*(S-C),N.cullingVolume=k.frustum.computeCullingVolume(v,P,M);let V=e._cascadeMatrices[a];B.multiply(k.getViewProjection(),i.inverseViewMatrix,V),B.multiply(N.textureOffsets,V,V)}}var a_t=new B,c_t=new d,l_t=new d,nTe=new d;function u_t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=B.multiply(i.frustum.projectionMatrix,i.viewMatrix,L0),r=B.inverse(o,L0),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,O.EPSILON10)&&(a=i.upWC);let l=d.cross(s,a,c_t);a=d.cross(l,s,l_t),d.normalize(a,a),d.normalize(l,l);let u=d.fromElements(0,0,0,nTe),f=B.computeView(u,s,a,l,a_t),h=B.multiply(f,r,L0),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sTe),g=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aTe);for(let S=0;S<8;++S){let v=se.clone(dp[S],BK[S]);B.multiplyByVector(h,v,v),d.divideByScalar(v,v.w,v),d.minimumByComponent(v,p,p),d.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=nTe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=B.fromTranslation(m,L0);f=B.multiply(y,f,f);let b=.5*(g.x-p.x),x=.5*(g.y-p.y),A=g.z-p.z,C=n.frustum;C.left=-b,C.right=b,C.bottom=-x,C.top=x,C.near=.01,C.far=A,B.clone(f,n.viewMatrix),B.inverse(f,n.inverseViewMatrix),B.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(l,n.rightWC)}var f_t=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],d_t=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],h_t=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function m_t(e,t){let n=new Ci;n.fov=O.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=f_t[i],o.upWC=d_t[i],o.rightWC=h_t[i],B.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),B.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var p_t=new d,__t=new d,cTe=new le,iTe=cTe.center;function g_t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=cTe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,p_t),s=d.negate(i.directionWC,__t),a=d.dot(r,s);if(e.fadingEnabled){let l=O.clamp(a/.1,0,1);e._darkness=O.lerp(1,e.darkness,l)}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)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,iTe),iTe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function y_t(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;B.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),B.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,l;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),l=Math.min(t.shadowState.farPlane,e.maximumDistance),l=Math.max(l,a+1)):(a=n.frustum.near,l=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=l,e._distance=l-a,g_t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}fp.prototype.update=function(e){if(y_t(this,e),this._needsUpdate)if(Ypt(this,e.context),this._isPointLight&&m_t(this,e),this._cascadesEnabled&&(u_t(this,e),this._numberOfCascades>1&&s_t(this,e)),this._isPointLight)this._shadowMapCullingVolume=_s.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;B.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&t_t(this,e)};fp.prototype.updatePass=function(e,t){rTe(this,e,t)};var b_t=new H;function lTe(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=b_t;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 xt(t,o,!1)}function x_t(e,t,n,i,o,r){let s,a,l;if(c(r)&&(s=r.shaderProgram,a=r.renderState,l=r.uniformMap),r=Qe.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!c(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===De.GLOBE,h=n.pass!==De.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=up.getShadowCastShaderKeyword(p,f,g,h);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!c(s)){let b=u.vertexShaderSource,x=u.fragmentShaderSource,A=up.createShadowCastVertexShader(b,p,f),C=up.createShadowCastFragmentShader(x,p,g,h);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:A,fragmentShaderSource:C,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=je(a,!1),a.cull=je(a.cull,!1),a.cull.enabled=!1,a=Ve.fromCache(a)),l=lTe(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=l,r}fp.createReceiveDerivedCommand=function(e,t,n,i,o){c(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,l=s.fragmentShaderSource,u=t.pass===De.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;c(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=Qe.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!c(h)||m||n||g){let y=up.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,y),!c(h)){let b=up.createShadowReceiveVertexShader(a,u,f),x=up.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:s._attributeLocations})}p=lTe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};fp.createCastDerivedCommand=function(e,t,n,i,o){if(c(o)||(o={}),t.castShadows){let r=o.castCommands;c(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let l=0;l<a;++l)r[l]=x_t(e[l],n,t,i,s,r[l]);o.castShaderProgramId=t.shaderProgram.id}return o};fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){FK(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 de(this)};var Tg=fp;var eA=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function XBt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=qBt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=YBt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!et.equals(a.renderState.viewport,s))&&(a.renderState=Ge.fromCache({viewport:et.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var j0=new Array(8);j0[0]=new se(-1,-1,-1,1);j0[1]=new se(1,-1,-1,1);j0[2]=new se(1,1,-1,1);j0[3]=new se(-1,1,-1,1);j0[4]=new se(-1,-1,1,1);j0[5]=new se(1,-1,1,1);j0[6]=new se(1,1,1,1);j0[7]=new se(-1,1,1,1);var Bb=new N,$se=new Array(8);for(let e=0;e<8;++e)$se[e]=new se;function KBt(e,t){let n=new Ft({geometry:new $h({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Ft({geometry:new Hg({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Mn({geometryInstances:[n,i],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var $Bt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],JBt=new h;function ZBt(e,t){XBt(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 k0({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new k0({camera:e._shadowMapCamera,color:z.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 k0({camera:e._passes[i].camera,color:$Bt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,JBt),a=N.fromTranslationQuaternionRotationScale(i,r,s,Bb);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=KBt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new k0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function rW(){this.viewMatrix=new N,this.inverseViewMatrix=new N,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new N}rW.prototype.clone=function(e){N.clone(e.viewMatrix,this.viewMatrix),N.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var QBt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);rW.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(QBt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var e2t=new Array(5),t2t=new Ki,n2t=new Array(4),tFe=new h,nFe=new h;function i2t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=n2t,g=e2t;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),C=r+c*L,w=D.lerp(C,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,E=m.far,v=n.positionWC,S=n.directionWC,I=n.upWC,R=i.frustum.clone(t2t),O=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let L=N.multiply(R.projectionMatrix,i.viewMatrix,Bb),_=N.inverse(L,Bb),C=N.multiply(O,_,Bb),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,tFe),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,nFe);for(let j=0;j<8;++j){let k=se.clone(j0[j],$se[j]);N.multiplyByVector(C,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,P,P)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,P.x=Math.min(P.x,1),P.y=Math.min(P.y,1),P.z=Math.min(P.z,1);let M=e._passes[a],F=M.camera;F.clone(n);let V=F.frustum;V.left=y+w.x*(A-y),V.right=y+P.x*(A-y),V.bottom=b+w.y*(x-b),V.top=b+P.y*(x-b),V.near=T+w.z*(E-T),V.far=T+P.z*(E-T),M.cullingVolume=F.frustum.computeCullingVolume(v,S,I);let B=e._cascadeMatrices[a];N.multiply(F.getViewProjection(),i.inverseViewMatrix,B),N.multiply(M.textureOffsets,B,B)}}var r2t=new N,o2t=new h,s2t=new h,JLe=new h;function a2t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,Bb),o=N.inverse(r,Bb),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,o2t);a=h.cross(c,s,s2t),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,JLe),f=N.computeView(u,s,a,c,r2t),d=N.multiply(f,o,Bb),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,tFe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,nFe);for(let E=0;E<8;++E){let v=se.clone(j0[E],$se[E]);N.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=JLe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=N.fromTranslation(m,Bb);f=N.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,N.clone(f,n.viewMatrix),N.inverse(f,n.inverseViewMatrix),N.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var c2t=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],l2t=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],u2t=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function f2t(e,t){let n=new Ki;n.fov=D.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=c2t[i],r.upWC=l2t[i],r.rightWC=u2t[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var d2t=new h,h2t=new h,iFe=new ce,ZLe=iFe.center;function m2t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=iFe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,d2t),s=h.negate(i.directionWC,h2t),a=h.dot(o,s);if(e.fadingEnabled){let c=D.clamp(a/.1,0,1);e._darkness=D.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)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ce.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,ZLe),ZLe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ce.clone(r,e._boundingSphere)}}function p2t(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;N.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),N.multiplyByPoint(n.viewMatrix,o.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=Or.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,m2t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}V0.prototype.update=function(e){if(p2t(this,e),this._needsUpdate)if(GBt(this,e.context),this._isPointLight&&f2t(this,e),this._cascadesEnabled&&(a2t(this,e),this._numberOfCascades>1&&i2t(this,e)),this._isPointLight)this._shadowMapCullingVolume=ta.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;N.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&ZBt(this,e)};V0.prototype.updatePass=function(e,t){eFe(this,e,t)};var g2t=new U;function rFe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={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 o=g2t;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.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 Ot(t,r,!1)}function _2t(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=at.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&up.hasClippingForShadowCast(y),b=up.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=up.createShadowCastVertexShader(m,p,f),E=up.createShadowCastFragmentShader(y,p,g,d,A);s=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Je(a,!1),a.cull=Je(a.cull,!1),a.cull.enabled=!1,a=Ge.fromCache(a)),c=rFe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}V0.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=at.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=up.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=up.createShadowReceiveVertexShader(a,u,f),b=up.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=rFe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};V0.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=_2t(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){Kse(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 ue(this)};var uy=V0;var Wz=`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 AC=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -8762,7 +9547,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var T_t=!1;function N0(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,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 ei({color:new G(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ei({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(N0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function uTe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function fTe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function A_t(e,t,n,i){uTe(e),e._translucentDepthStencilTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST})}function C_t(e,t,n,i){fTe(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 E_t(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)&&(A_t(e,t,o,r),C_t(e,t,o,r));let s,a;if(c(e._packDepthCommand)||(s=new He({sources:[QF]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!c(e._compositeCommand)){s=new He({sources:[eA]}),a={colorTexture:function(){return e._textureToComposite}},T_t&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new He({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=Qe.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}c(e._copyCommand)||(s=new He({sources:[eA]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),c(e._accumulateCommand)||(s=new He({sources:[eA]}),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 l=!Ke.equals(e._viewport,n.viewport),u=l!==e._useScissorTest;e._useScissorTest=l,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!c(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!c(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),c(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!c(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:ln.ALPHA_BLEND})),c(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}N0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){E_t(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};N0.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(De.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let l=i.commands[De.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[De.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(l[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};N0.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),S_t(this,e,t)};function S_t(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}N0.prototype.isSupported=function(){return this._supported};N0.prototype.isDestroyed=function(){return!1};N0.prototype.destroy=function(){return uTe(this),fTe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),de(this)};var CB=N0;function w_t(){this.command=void 0,this.near=void 0,this.far=void 0}function rG(e,t,n){let i=e.context,o;i.depthTexture&&(o=new _B);let r;e._useOIT&&i.depthTexture&&(r=new yB(i));let s=new lc(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 AB(i),this.pickDepthFramebuffer=new xB,this.sceneFramebuffer=new QT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new gB,this.oit=r,this.translucentTileClassification=new CB(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var kK=new d,UK=new d;function v_t(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,kK)),d.maximumComponent(d.abs(t.position,UK))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,kK),d.multiplyByScalar(t.position,o,UK),d.equalsEpsilon(kK,UK,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&B.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}rG.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return v_t(t,n,O.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),ro.clone(t,n),!0)};function D_t(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+O.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;l?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let g,m;l?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g));let y=h[p];c(y)?(y.near=g,y.far=m):y=h[p]=new pB(g,m)}}function P_t(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 l=s[a];if(o>l.far)continue;if(r<l.near)break;let u=i.pass,f=l.indices[u]++;if(l.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:l}=i,u=a.commandsInFrustums;u[l]=c(u[l])?u[l]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var dTe=new _s,I_t=new Ma;rG.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,l=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let L=0;L<f.length;++L)for(let F=0;F<De.NUMBER_OF_PASSES;++F)f[L].indices[F]=0;l.length=0,u.length=0;let h=this._commandExtents,p=h.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:b}=o,x=+Number.MAX_VALUE,A=-Number.MAX_VALUE,C=Number.MAX_VALUE,S=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,P=dTe.planes;for(let L=0;L<5;++L)P[L]=v.planes[L];v=dTe;for(let L=0;L<i.length;++L){let F=i[L],{pass:_,boundingVolume:w}=F;if(_===De.COMPUTE)l.push(F);else if(_===De.OVERLAY)u.push(F);else{let D,I;if(c(w)){if(!e.isVisible(v,F,S))continue;let k=w.computePlaneDistances(r,s,I_t);if(D=k.start,I=k.stop,m=Math.min(m,D),y=Math.max(y,I),b&&F.receiveShadows&&D<Tg.MAXIMUM_DISTANCE&&!(_===De.GLOBE&&D<-100&&I>100)){let z=I-D;_!==De.GLOBE&&D<100&&(C=Math.min(C,z)),x=Math.min(x,D),A=Math.max(A,I)}}else F instanceof ei?(D=a.near,I=a.far):(D=a.near,I=a.far,m=Math.min(m,D),y=Math.max(y,I));let N=h[g];c(N)||(N=h[g]=new w_t),N.command=F,N.near=D,N.far=I,g++}}b&&(x=Math.min(Math.max(x,a.near),a.far),A=Math.max(Math.min(A,a.far),x),o.nearPlane=x,o.farPlane=A,o.closestObjectSize=C),D_t(this,e,m,y);for(let L=0;L<g;L++)P_t(this,e,h[L]);if(g<p)for(let L=g;L<p;L++){let F=h[L];if(!c(F.command))break;F.command=void 0}let M=f.length,{frustumSplits:R}=t;R.length=M+1;for(let L=0;L<M;++L)R[L]=f[L].near,L===M-1&&(R[L+1]=f[L].far)};rG.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 tA=rG;var mTe=.1,O_t=new gd({pass:Uo.MOST_DETAILED_PRELOAD}),R_t=new gd({pass:Uo.MOST_DETAILED_PICK}),EB=new gd({pass:Uo.PICK});function oa(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 on({width:mTe,aspectRatio:1,near:.1}),this._pickOffscreenView=new tA(e,n,t)}oa.prototype.update=function(){this._pickPositionCacheDirty=!0};oa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return c(i)||(i=new mB,n[t]=i),i};var M_t=new jo,L_t=new d,sG=new d,N_t=new H,F_t=new B;function B_t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2*(t.x-o.x)/o.width-1;l*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=B.clone(r.transform,F_t);r._setTransform(B.IDENTITY);let h=d.clone(r.position,L_t);d.multiplyByScalar(r.right,l,sG),d.add(sG,h,h),d.multiplyByScalar(r.up,u,sG),d.add(sG,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,N_t),g=M_t;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 k_t=new bl,U_t=new H;function V_t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,l=Math.tan(s.fovy*.5),u=s.aspectRatio*l,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=h*a*l,m=s.getPixelDimensions(o.width,o.height,1,1,U_t),y=m.x*n*.5,b=m.y*i*.5,x=k_t;return x.top=g+b,x.bottom=g-b,x.right=p+y,x.left=p-y,x.near=a,x.far=s.far,x.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function aG(e,t,n,i,o){let r=e.camera.frustum;return r instanceof on||r instanceof jo?B_t(e,t,n,i,o):V_t(e,t,n,i,o)}var cG=new Ke(0,0,3,3),lG=new H,SB=new G(0,0,0,0);function VK(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}oa.prototype.pick=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Gi.transformWindowToDrawingBuffer(e,t,lG),h=VK(o.drawingBufferHeight,f,n,i,cG);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=aG(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=EB,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,SB),e.resolveFramebuffers(u);let p=l.end(h);return o.endFrame(),p};oa.prototype.pickVoxelCoordinate=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Gi.transformWindowToDrawingBuffer(e,t,lG),h=VK(o.drawingBufferHeight,f,n,i,cG);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=aG(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=EB,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,SB),e.resolveFramebuffers(u);let p=l.readCenterPixel(h);return o.endFrame(),p};oa.prototype.pickMetadata=function(e,t,n){T.typeOf.object("windowPosition",t),T.typeOf.object("pickedMetadataInfo",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 l=r.passState;l.viewport=Ke.clone(s,l.viewport);let u=Gi.transformWindowToDrawingBuffer(e,t,lG),f=VK(i.drawingBufferHeight,u,1,1,cG);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=aG(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=EB,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),l=a.begin(f,s),e.updateAndExecuteCommands(l,SB);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(l),e._environmentState.useOIT=h;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,hB.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function z_t(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 l=n.passState;l.viewport=Ke.clone(s,l.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=aG(e,t,1,1,s),o.tilesetPassState=EB,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,l=a.update(i,t,s),e.updateAndExecuteCommands(l,SB),e.resolveFramebuffers(l),i.endFrame()}var H_t=new Ci,G_t=new bl,j_t=new on,W_t=new jo;oa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(T.defined("windowPosition",t),!e.context.depthTexture)throw new E("Picking from the depth buffer is not supported. Check pickPositionSupported.");let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:l}=o;e.view=a;let u=Gi.transformWindowToDrawingBuffer(e,t,lG);e.pickTranslucentDepth?z_t(e,u):(e.updateFrameState(),l.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;c(s.frustum.fov)?f=s.frustum.clone(H_t):c(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(G_t):c(s.frustum.width)?f=s.frustum.clone(j_t):f=s.frustum.clone(W_t);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(c(y)&&y>0&&y<1){let b=h[g],x;return e.mode===oe.SCENE2D?(x=s.position.z,s.position.z=x-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,l.update(r),l.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,l.updateFrustum(f)),n=Gi.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===oe.SCENE2D&&(s.position.z=x,l.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var q_t=new he;oa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),c(n)&&e.mode!==oe.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,q_t);o.cartographicToCartesian(r,n)}return n};function pTe(e,t){let n,i,o=[],r=[],s=[],a=[];c(e)||(e=Number.MAX_VALUE);let l=t();for(;c(l);){let u=l.object,f=l.position,h=l.exclude;if(c(f)&&!c(u)){o.push(l);break}if(!c(u)||!c(u.primitive)||!h&&(o.push(l),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&c(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),c(i)&&c(i.show)&&(g=!0,i.show=bn.toValue(!1,i.show),s.push(i))),u instanceof Ws&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),l=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=bn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}oa.prototype.drillPick=function(e,t,n,i,o){let r=this;return pTe(n,function(){let l=r.pick(e,t,i,o);if(c(l))return{object:l,position:void 0,exclude:!1}}).map(function(l){return l.object})};var hTe=new d,Y_t=new d;function X_t(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 _Te(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,hTe),s=d.cross(o,r,hTe),a=d.cross(o,s,Y_t);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??mTe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function K_t(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,l=_Te(e,o,r,a),u=O_t;u.camera=a,u.cullingVolume=l;let f=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}oa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)K_t(this,e,t[n])&&t.splice(n--,1)};function gTe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(c(o.isCesium3DTileset)?(!c(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof fl&&gTe(o,t,n))}}function uG(e,t,n,i,o,r){let s=[];if(gTe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new X_t(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function $_t(e,t){return!c(e)||!c(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Z_t(e,t,n,i,o,r,s){let{context:a,frameState:l}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,_Te(e,n,o,f.camera);let h=Ke.clone(f.viewport,cG),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=R_t:l.tilesetPassState=EB,u.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(p,SB),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:y}=f,b=y.length;for(let x=0;x<b;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(c(C)&&C>0&&C<1){let S=y[x],v=S.near*(x!==0?t.opaqueFrustumNearOffset:1),P=S.far,M=v+C*(P-v);g=mn.getPoint(n,M);break}}}if(t.view=t.defaultView,a.endFrame(),c(m)||c(g))return{object:m,position:g,exclude:!c(g)&&r||$_t(m,i)}}function yTe(e,t,n,i,o,r,s,a){return pTe(i,function(){return Z_t(e,t,n,o,r,s,a)})}function Dw(e,t,n,i,o,r,s){let a=yTe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function bTe(e,t,n,i,o,r,s,a){return yTe(e,t,n,i,o,r,s,a)}function fG(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)})})}oa.prototype.pickFromRay=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");return Dw(this,e,t,n,i,!1,!1)};oa.prototype.drillPickFromRay=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");return bTe(this,e,t,n,i,o,!1,!1)};oa.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");let o=this;return t=mn.clone(t),n=c(n)?n.slice():n,fG(e,uG(o,e,t,n,i,function(){return Dw(o,e,t,n,i,!1,!0)}))};oa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new E("Ray intersections are only supported in 3D mode.");let r=this;return t=mn.clone(t),i=c(i)?i.slice():i,fG(e,uG(r,e,t,i,o,function(){return bTe(r,e,t,n,i,o,!1,!0)}))};var Q_t=new d,J_t=new d,egt=new mn,xTe=new he;function zK(e,t){let n=e.ellipsoid,i=ui._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,J_t),r=he.toCartesian(t,n,Q_t),s=egt;s.origin=r,s.direction=o;let a=new mn;return mn.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function TTe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,xTe);return zK(e,i)}function ATe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,xTe).height}function tgt(e,t,n,i,o){let r=zK(t,n);return uG(e,t,r,i,o,function(){let s=Dw(e,t,r,i,o,!0,!0);if(c(s))return ATe(t,s.position)})}function ngt(e,t,n,i,o,r){let s=TTe(t,n);return uG(e,t,s,i,o,function(){let a=Dw(e,t,s,i,o,!0,!0);if(c(a))return d.clone(a.position,r)})}oa.prototype.sampleHeight=function(e,t,n,i){if(T.defined("position",t),e.mode!==oe.SCENE3D)throw new E("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new E("sampleHeight requires depth texture support. Check sampleHeightSupported.");let o=zK(e,t),r=Dw(this,e,o,n,i,!0,!1);if(c(r))return ATe(e,r.position)};oa.prototype.clampToHeight=function(e,t,n,i,o){if(T.defined("cartesian",t),e.mode!==oe.SCENE3D)throw new E("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new E("clampToHeight requires depth texture support. Check clampToHeightSupported.");let r=TTe(e,t),s=Dw(this,e,r,n,i,!0,!1);if(c(s))return d.clone(s.position,o)};oa.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(T.defined("positions",t),e.mode!==oe.SCENE3D)throw new E("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new E("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=tgt(this,e,t[s],n,i);return fG(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l].height=s[l];return t}))};oa.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(T.defined("cartesians",t),e.mode!==oe.SCENE3D)throw new E("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new E("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=ngt(this,e,t[s],n,i,t[s]);return fG(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l]=s[l];return t}))};oa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var wB=oa;var vB=`uniform sampler2D colorTexture; +`;var y2t=!1;function kb(e){this._drawClassificationFBO=new ai({createDepthAttachments:!1}),this._accumulationFBO=new ai({createDepthAttachments:!1}),this._packFBO=new ai,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 li({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new li({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,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(kb.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function oFe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function sFe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function A2t(e,t,n,i){oFe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST})}function b2t(e,t,n,i){sFe(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 x2t(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(A2t(e,t,r,o),b2t(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Ye({sources:[Wz]}),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 Ye({sources:[AC]}),a={colorTexture:function(){return e._textureToComposite}},y2t&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ye({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=at.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Ye({sources:[AC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ye({sources:[AC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:tn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}kb.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){x2t(this,s,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};kb.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ie.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};kb.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),T2t(this,e,t)};function T2t(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}kb.prototype.isSupported=function(){return this._supported};kb.prototype.isDestroyed=function(){return!1};kb.prototype.destroy=function(){return oFe(this),sFe(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()),ue(this)};var qz=kb;function E2t(){this.command=void 0,this.near=void 0,this.far=void 0}function oW(e,t,n){let i=e.context,r;i.depthTexture&&(r=new kz);let o;e._useOIT&&i.depthTexture&&(o=new Vz(i));let s=new sc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Or.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new Gz(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new Hz,this.sceneFramebuffer=new yC,this.edgeFramebuffer=new Lz,this.planarFillIdFramebuffer=new Fz,this.globeDepth=r,this.globeTranslucencyFramebuffer=new Uz,this.oit=o,this.translucentTileClassification=new qz(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Jse=new h,Zse=new h;function C2t(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Jse)),h.maximumComponent(h.abs(t.position,Zse))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,Jse),h.multiplyByScalar(t.position,r,Zse),h.equalsEpsilon(Jse,Zse,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&N.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}oW.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return C2t(t,n,D.EPSILON15)?(this._cameraStartFired&&xn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xn(),Or.clone(t,n),!0)};function v2t(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:s}=r,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new Bz(g,m)}}function S2t(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var aFe=new ta,w2t=new Us;oW.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,S=aFe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=aFe;for(let O=0;O<i.length;++O){let L=i[O],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let w,P;if(l(C)){if(!e.isVisible(v,L,E))continue;let F=C.computePlaneDistances(o,s,w2t);if(w=F.start,P=F.stop,m=Math.min(m,w),y=Math.max(y,P),A&&L.receiveShadows&&w<uy.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&w<-100&&P>100)){let V=P-w;_!==Ie.GLOBE&&w<100&&(T=Math.min(T,V)),b=Math.min(b,w),x=Math.max(x,P)}}else L instanceof li?(w=a.near,P=a.far):(w=a.near,P=a.far,m=Math.min(m,w),y=Math.max(y,P));let M=d[g];l(M)||(M=d[g]=new E2t),M.command=L,M.near=w,M.far=P,g++}}A&&(b=Math.min(Math.max(b,a.near),a.far),x=Math.max(Math.min(x,a.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),v2t(this,e,m,y);for(let O=0;O<g;O++)S2t(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}let I=f.length,{frustumSplits:R}=t;R.length=I+1;for(let O=0;O<I;++O)R[O]=f[O].near,O===I-1&&(R[O+1]=f[O].far)};oW.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.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 bC=oW;var lFe=.1,I2t=new Sh({pass:ao.MOST_DETAILED_PRELOAD}),P2t=new Sh({pass:ao.MOST_DETAILED_PICK}),Yz=new Sh({pass:ao.PICK});function Oa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Or(e);n.frustum=new gn({width:lFe,aspectRatio:1,near:.1}),this._pickOffscreenView=new bC(e,n,t)}Oa.prototype.update=function(){this._pickPositionCacheDirty=!0};Oa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new Nz,n[t]=i),i};var D2t=new ys,R2t=new h,sW=new h,O2t=new U,M2t=new N;function N2t(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=N.clone(o.transform,M2t);o._setTransform(N.IDENTITY);let d=h.clone(o.position,R2t);h.multiplyByScalar(o.right,c,sW),h.add(sW,d,d),h.multiplyByScalar(o.up,u,sW),h.add(sW,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,O2t),g=D2t;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(d,o.directionWC,o.upWC)}var L2t=new $l,F2t=new U;function B2t(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,F2t),y=m.x*n*.5,A=m.y*i*.5,b=L2t;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function aW(e,t,n,i,r){let o=e.camera.frustum;return o instanceof gn||o instanceof ys?N2t(e,t,n,i,r):B2t(e,t,n,i,r)}var Xz=new et(0,0,3,3),cW=new U,Kz=new z(0,0,0,0);function Qse(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function $z(e,t,n,i,r,o){let{context:s,frameState:a,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=s.drawingBufferWidth,u.height=s.drawingBufferHeight;let p=c.passState;p.viewport=et.clone(u,p.viewport);let g=hr.transformWindowToDrawingBuffer(e,t,cW);Qse(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=aW(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=Yz,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,Kz),e.resolveFramebuffers(p)}function Jz(e){let{context:t}=e;t.endFrame()}Oa.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=Xz;$z(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,s,r):(f=c.end(u,r),f=Promise.resolve(f),_t("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),Jz(e),f};Oa.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=Xz;$z(e,t,a,n,i);let c=s.end(a,r);return Jz(e),c};Oa.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight;let u=s.passState;u.viewport=et.clone(a,u.viewport);let f=hr.transformWindowToDrawingBuffer(e,t,cW),d=Qse(r.drawingBufferHeight,f,n,i,Xz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=aW(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=Yz,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,Kz),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Oa.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:s,pickFramebuffer:a}=o;e.view=o,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=o.passState;c.viewport=et.clone(s,c.viewport);let u=hr.transformWindowToDrawingBuffer(e,t,cW),f=Qse(i.drawingBufferHeight,u,1,1,Xz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=aW(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=Yz,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,Kz);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,Mz.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function k2t(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=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=et.clone(s,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=aW(e,t,1,1,s),r.tilesetPassState=Yz,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Kz),e.resolveFramebuffers(c),i.endFrame()}var U2t=new Ki,z2t=new $l,V2t=new gn,j2t=new ys;Oa.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 h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:s,defaultView:a}=e,{uniformState:c}=r;e.view=a;let u=hr.transformWindowToDrawingBuffer(e,t,cW);e.pickTranslucentDepth?k2t(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(U2t):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(z2t):l(s.frustum.width)?f=s.frustum.clone(V2t):f=s.frustum.clone(j2t);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=s.position.z,s.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=hr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(s.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var H2t=new he;Oa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,H2t);r.cartographicToCartesian(o,n)}return n};function G2t(e,t,n,i,r,o){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=f.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(d=!0,p.show=Pn.toValue(!1,p.show),r.push(p))}a instanceof sa&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function uFe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!G2t(s,t,n,i,r,o);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<r.length;++a){let c=r[a];c.show=Pn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}Oa.prototype.drillPick=function(e,t,n,i,r){return uFe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var cFe=new h,W2t=new h;function q2t(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function fFe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,cFe),s=h.cross(r,o,cFe),a=h.cross(r,s,W2t);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??lFe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Y2t(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=fFe(e,r,o,a),u=I2t;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Oa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Y2t(this,e,t[n])&&t.splice(n--,1)};function dFe(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof El&&dFe(r,t,n))}}function lW(e,t,n,i,r,o){let s=[];if(dFe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new q2t(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function X2t(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 K2t(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,fFe(e,n,r,f.camera);let d=et.clone(f.viewport,Xz),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=P2t:c.tilesetPassState=Yz,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,Kz),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(a,0,0);if(l(T)&&T>0&&T<1){let E=y[b],v=E.near*(b!==0?t.opaqueFrustumNearOffset:1),S=E.far,I=v+T*(S-v);g=pn.getPoint(n,I);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||X2t(m,i)}}function eae(e,t,n,i,r,o,s,a){return uFe(function(){let u=K2t(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function IP(e,t,n,i,r,o,s){let a=eae(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function uW(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Oa.prototype.pickFromRay=function(e,t,n,i){return IP(this,e,t,n,i,!1,!1)};Oa.prototype.drillPickFromRay=function(e,t,n,i,r){return eae(this,e,t,n,i,r,!1,!1)};Oa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=pn.clone(t),n=l(n)?n.slice():n,uW(e,lW(r,e,t,n,i,function(){return IP(r,e,t,n,i,!1,!0)}))};Oa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=pn.clone(t),i=l(i)?i.slice():i,uW(e,lW(o,e,t,i,r,function(){return eae(o,e,t,n,i,r,!1,!0)}))};var $2t=new h,J2t=new h,Z2t=new pn,hFe=new he;function tae(e,t){let n=e.ellipsoid,i=Mi._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,J2t),o=he.toCartesian(t,n,$2t),s=Z2t;s.origin=o,s.direction=r;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function mFe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,hFe);return tae(e,i)}function pFe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,hFe).height}function Q2t(e,t,n,i,r){let o=tae(t,n);return lW(e,t,o,i,r,function(){let s=IP(e,t,o,i,r,!0,!0);if(l(s))return pFe(t,s.position)})}function ekt(e,t,n,i,r,o){let s=mFe(t,n);return lW(e,t,s,i,r,function(){let a=IP(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}Oa.prototype.sampleHeight=function(e,t,n,i){let r=tae(e,t),o=IP(this,e,r,n,i,!0,!1);if(l(o))return pFe(e,o.position)};Oa.prototype.clampToHeight=function(e,t,n,i,r){let o=mFe(e,t),s=IP(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};Oa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=Q2t(this,e,t[s],n,i);return uW(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Oa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=ekt(this,e,t[s],n,i,t[s]);return uW(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Oa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Zz=Oa;var Qz=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -8782,7 +9567,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var DB=`precision highp float; +`;var eV=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -8890,7 +9675,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var PB=`uniform sampler2D colorTexture; +`;var tV=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -8900,7 +9685,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var IB=`uniform sampler2D colorTexture; +`;var nV=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -8917,7 +9702,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var OB=`uniform sampler2D colorTexture; +`;var iV=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -8933,7 +9718,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var RB=`uniform sampler2D colorTexture; +`;var rV=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -8942,7 +9727,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var MB=`uniform sampler2D colorTexture; +`;var oV=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -8956,7 +9741,7 @@ 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 LB=`uniform sampler2D colorTexture; +`;var sV=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -8991,14 +9776,14 @@ vec4 posInCamera = toEye(v_textureCoordinates, depth); float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var NB=`uniform sampler2D depthTexture; +`;var aV=`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 FB=`uniform sampler2D depthTexture; +`;var cV=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -9048,7 +9833,7 @@ vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var BB=`uniform sampler2D colorTexture; +`;var lV=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -9077,7 +9862,7 @@ float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var kB=`uniform sampler2D colorTexture; +`;var uV=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -9097,7 +9882,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var UB=`in vec2 v_textureCoordinates; +`;var fV=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -9115,221 +9900,718 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var F0=`#define SAMPLES 8 -uniform float delta; -uniform float sigma; -uniform float direction; -uniform sampler2D colorTexture; -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; -#endif -in vec2 v_textureCoordinates; -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; +`;var Ub=`#define SAMPLES 8 +uniform float delta; +uniform float sigma; +uniform float direction; +uniform sampler2D colorTexture; +#ifdef USE_STEP_SIZE +uniform float stepSize; +#else +uniform vec2 step; +#endif +in vec2 v_textureCoordinates; +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 dV=`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; +#define DISTANCE_TO_SPACE 6500000.0 +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); +} +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)); +} +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; +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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) +{ +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); +vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; +vec3 direction = normalize(vec3(ghostVec, 0.0)); +vec4 result = vec4(0.0); +vec4 ghost = vec4(0.0); +for (int i = 0; i < 4; ++i) +{ +vec2 offset = fract(texcoord + ghostVec * float(i)); +ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); +} +result += ghost; +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; +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); +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 hV=`uniform sampler2D colorTexture; +uniform vec3 white; +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 +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 mV=`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 pV=`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 +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 gV=`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); +} +`;/** + * @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 _V=`#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( +FxaaFloat2 pos, +FxaaTex tex, +FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat fxaaQualitySubpix, +FxaaFloat fxaaQualityEdgeThreshold, +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 -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 VB=`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; -#define DISTANCE_TO_SPACE 6500000.0 -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); -} -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)); -} -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; -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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) -{ -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); -vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; -vec3 direction = normalize(vec3(ghostVec, 0.0)); -vec4 result = vec4(0.0); -vec4 ghost = vec4(0.0); -for (int i = 0; i < 4; ++i) -{ -vec2 offset = fract(texcoord + ghostVec * float(i)); -ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); -} -result += ghost; -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; -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); -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; +#endif } -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; +#endif } -result += texture(colorTexture, v_textureCoordinates); -out_FragColor = result; +#endif } -`;var zB=`uniform sampler2D colorTexture; -uniform vec3 white; -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 -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 HB=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -float rand(vec2 co) -{ -return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); +#endif } -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); +#endif } -`;var GB=`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 -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 jB=`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); +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); } -`;function nA(){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 hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new H,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(nA.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(c(e))return e[e.length-1].getColorTexture(0)}}});function CTe(e){let t=e._framebuffers;if(!c(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 igt(e,t){CTe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let l=0;l<r;++l)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[l]=new hi,s[l].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 ETe(e){let t=e._commands;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function ogt(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 rgt(e,t){let n=`uniform sampler2D colorTexture; +`;function xC(){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 ai,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(xC.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 gFe(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 tkt(e,t){gFe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new ai,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function _Fe(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 nkt(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 ikt(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); @@ -9366,7 +10648,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function sgt(e,t){ETe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(rgt(r,i),{framebuffer:n[r].framebuffer,uniformMap:ogt(e,r)});e._commands=o}nA.prototype.clear=function(e){let t=this._framebuffers;if(!c(t))return;let n=this._clearCommand;c(n)||(n=this._clearCommand=new ei({color:new G(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};nA.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,igt(this,e),sgt(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};nA.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};nA.prototype.isDestroyed=function(){return!1};nA.prototype.destroy=function(){return CTe(this),ETe(this),de(this)};var WB=nA;var agt={NEAREST:0,LINEAR:1},ef=agt;function iA(e){e=e??W.EMPTY_OBJECT;let{name:t=jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=ef.NEAREST,pixelFormat:a=ke.RGBA,pixelDatatype:l=Ue.UNSIGNED_BYTE,clearColor:u=G.BLACK,scissorRectangle:f}=e;if(T.typeOf.string("options.fragmentShader",n),T.typeOf.number.greaterThan("options.textureScale",o,0),T.typeOf.number.lessThanOrEquals("options.textureScale",o,1),!ke.isColorFormat(a))throw new E("options.pixelFormat must be a color format.");this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=l,this._clearColor=u,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 lc;h.scissorTest={enabled:!0,rectangle:c(f)?Ke.clone(f):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(iA.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(c(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(c(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 cgt=/uniform\s+sampler2D\s+depthTexture/g;iA.prototype._isSupported=function(e){return!cgt.test(this._fragmentShader)||e.depthTexture};function lgt(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];c(a)&&a!==r&&a instanceof Rt&&!c(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Rt&&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 ugt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function fgt(e,t){return function(){let n=e[t]();if(c(n))return n.dimensions}}function dgt(e){if(c(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]=ugt(e,r),n[r]=lgt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Rt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=fgt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(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 hgt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function rkt(e,t){_Fe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(ikt(o,i),{framebuffer:n[o].framebuffer,uniformMap:nkt(e,o)});e._commands=r}xC.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new li({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};xC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,tkt(this,e),rkt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};xC.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};xC.prototype.isDestroyed=function(){return!1};xC.prototype.destroy=function(){return gFe(this),_Fe(this),ue(this)};var yV=xC;var okt={NEAREST:0,LINEAR:1},md=okt;function fy(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=md.NEAREST,pixelFormat:a=Ke.RGBA,pixelDatatype:c=ze.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,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 d=new sc;d.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=d,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(fy.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 skt=/uniform\s+sampler2D\s+depthTexture/g;fy.prototype._isSupported=function(e){return!skt.test(this._fragmentShader)||e.depthTexture};function akt(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(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Dt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function ckt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function lkt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function ukt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=ckt(e,o),n[o]=akt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=lkt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Ot(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 fkt(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; @@ -9390,30 +10672,30 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function mgt(e,t){if(c(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(c(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=hgt(n,o)}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function pgt(e){let t=e._sampleMode,n,i;t===ef.LINEAR?(n=Yt.LINEAR,i=li.LINEAR):(n=Yt.NEAREST,i=li.NEAREST);let o=e._sampler;(!c(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function _gt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function ggt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ygt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let l=n[a];l=l&&l.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:l,source:u}=i[a];e._actualUniforms[l]=new Rt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!c(e._texturePromise)){e._ready=!0;return}if(o.length===0||c(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let l=o[a],u=r[l],f=e._textureCache.getStageByName(u);if(c(f))e._actualUniforms[l]=ggt(e,u);else if(typeof u=="string"){let h=new we({url:u});s.push(h.fetchImage().then(_gt(e,l)))}else e._texturesToCreate.push({name:l,source:u})}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 STe(e){c(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(!c(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 Rt&&(c(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function bgt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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 xgt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!c(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];c(a.pickIds)?i+=a.pickIds.length:c(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.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(c(a.pickIds)){let l=a.pickIds,u=l.length;for(let f=0;f<u;++f){let h=l[f].color;r[o]=G.floatToByte(h.red),r[o+1]=G.floatToByte(h.green),r[o+2]=G.floatToByte(h.blue),r[o+3]=G.floatToByte(h.alpha),o+=4}}else if(c(a.pickId)){let l=a.pickId.color;r[o]=G.floatToByte(l.red),r[o+1]=G.floatToByte(l.green),r[o+2]=G.floatToByte(l.blue),r[o+3]=G.floatToByte(l.alpha),o+=4}}e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Qt.NEAREST})}iA.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&STe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=bgt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0,xgt(this,e),dgt(this),ygt(this,e),mgt(this,e),pgt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!c(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!c(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};iA.prototype.execute=function(e,t,n,i){if(!c(this._command)||!c(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;c(o)&&(o.context=e),this._command.execute(e,o)};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){return STe(this),de(this)};var ho=iA;function oA(e){e=e??W.EMPTY_OBJECT,T.defined("options.stages",e.stages),T.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;c(t)||(t=jn()),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(oA.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}}});oA.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};oA.prototype.get=function(e){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,this.length),this._stages[e]};function Tgt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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}oA.prototype.update=function(e,t){this._selectedDirty=Tgt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(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)}};oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var au=oA;var Lr={};function HK(e){let o=`#define USE_STEP_SIZE -${F0}`,r=new ho({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ef.LINEAR}),s=new ho({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ef.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(l){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=l}},sigma:{get:function(){return r.uniforms.sigma},set:function(l){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=l}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(l){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=l}}}),new au({name:e,stages:[r,s],uniforms:a})}Lr.createBlurStage=function(){return HK("czm_blur")};Lr.createDepthOfFieldStage=function(){let e=HK("czm_depth_of_field_blur"),t=new ho({name:"czm_depth_of_field_composite",fragmentShader:LB,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 au({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Lr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Lr.createEdgeDetectionStage=function(){let e=jn();return new ho({name:`czm_edge_detection_${e}`,fragmentShader:FB,uniforms:{length:.25,color:G.clone(G.BLACK)}})};Lr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Agt(e){if(!c(e))return Lr.createEdgeDetectionStage();let t=new au({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); +${e}`}function dkt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=fkt(n,r)}let i=new Ye({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function hkt(e){let t=e._sampleMode,n,i;t===md.LINEAR?(n=Wt.LINEAR,i=Jn.LINEAR):(n=Wt.NEAREST,i=Jn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function mkt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function pkt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function gkt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,s=[];for(let a=0;a<r.length;++a){let c=r[a],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=pkt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(mkt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.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 yFe(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 r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Dt&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function _kt(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 r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function ykt(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 c=0;c<n.length;++c){let u=n[c];l(u.pickIds)?i+=u.pickIds.length:l(u.pickId)&&++i}let r=kt.maximumTextureSize;if(i>r&&(fy._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${r}). Features beyond the limit will not have the post-process effect applied.`),i=r),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:jt.NEAREST});return}let o=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&o<s;++c){let u=n[c];if(l(u.pickIds)){let f=u.pickIds,d=f.length;for(let p=0;p<d&&o<s;++p){let g=f[p].color;a[o]=z.floatToByte(g.red),a[o+1]=z.floatToByte(g.green),a[o+2]=z.floatToByte(g.blue),a[o+3]=z.floatToByte(g.alpha),o+=4}}else if(l(u.pickId)){let f=u.pickId.color;a[o]=z.floatToByte(f.red),a[o+1]=z.floatToByte(f.green),a[o+2]=z.floatToByte(f.blue),a[o+3]=z.floatToByte(f.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:jt.NEAREST})}fy.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&yFe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=_kt(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,ykt(this,e),ukt(this),gkt(this,e),dkt(this,e),hkt(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),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ge.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=r};fy.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,jt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};fy.prototype.isDestroyed=function(){return!1};fy.prototype.destroy=function(){return yFe(this),ue(this)};fy._oneTimeWarning=_t;var Ur=fy;function TC(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),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(TC.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}}});TC.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};TC.prototype.get=function(e){return this._stages[e]};function Akt(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 r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}TC.prototype.update=function(e,t){this._selectedDirty=Akt(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 r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};TC.prototype.isDestroyed=function(){return!1};TC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var df=TC;var fs={};function nae(e){let r=`#define USE_STEP_SIZE +${Ub}`,o=new Ur({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:md.LINEAR}),s=new Ur({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:md.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new df({name:e,stages:[o,s],uniforms:a})}fs.createBlurStage=function(){return nae("czm_blur")};fs.createDepthOfFieldStage=function(){let e=nae("czm_depth_of_field_blur"),t=new Ur({name:"czm_depth_of_field_composite",fragmentShader:sV,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 df({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isDepthOfFieldSupported=function(e){return e.context.depthTexture};fs.createEdgeDetectionStage=function(){let e=Kn();return new Ur({name:`czm_edge_detection_${e}`,fragmentShader:cV,uniforms:{length:.25,color:z.clone(z.BLACK)}})};fs.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function bkt(e){if(!l(e))return fs.createEdgeDetectionStage();let t=new df({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +`,r+=` 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; +`,n[`edgeTexture${a}`]=e[a].name;let o=`${i}in vec2 v_textureCoordinates; void main() { vec4 color = vec4(0.0); for (int i = 0; i < ${e.length}; i++) { -${o} } +${r} } out_FragColor = color; } -`,s=new ho({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new au({name:"czm_edge_detection_composite",stages:[t,s]})}Lr.createSilhouetteStage=function(e){let t=Agt(e),n=new ho({name:"czm_silhouette_color_edges",fragmentShader:jB,uniforms:{silhouetteTexture:t.name}});return new au({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Lr.isSilhouetteSupported=function(e){return e.context.depthTexture};Lr.createBloomStage=function(){let e=new ho({name:"czm_bloom_contrast_bias",fragmentShader:MB,uniforms:{contrast:128,brightness:-.3}}),t=HK("czm_bloom_blur"),n=new au({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new ho({name:"czm_bloom_generate_composite",fragmentShader:OB,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 au({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Lr.createAmbientOcclusionStage=function(){let e=new ho({name:"czm_ambient_occlusion_generate",fragmentShader:DB,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new ho({name:"czm_ambient_occlusion_composite",fragmentShader:PB,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 au({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Lr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Cgt=`#define FXAA_QUALITY_PRESET 39 -${n2} -${UB}`;Lr.createFXAAStage=function(){return new ho({name:"czm_FXAA",fragmentShader:Cgt,sampleMode:ef.LINEAR})};Lr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=vB,new ho({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=BB,new ho({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=kB,new ho({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=GB,new ho({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Lr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=zB,new ho({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:G.WHITE,autoExposure:void 0,exposure:1}})};Lr.createAutoExposureStage=function(){return new WB};Lr.createBlackAndWhiteStage=function(){return new ho({name:"czm_black_and_white",fragmentShader:IB,uniforms:{gradations:5}})};Lr.createBrightnessStage=function(){return new ho({name:"czm_brightness",fragmentShader:RB,uniforms:{brightness:.5}})};Lr.createNightVisionStage=function(){return new ho({name:"czm_night_vision",fragmentShader:HB})};Lr.createDepthViewStage=function(){return new ho({name:"czm_depth_view",fragmentShader:NB})};Lr.createLensFlareStage=function(){return new ho({name:"czm_lens_flare",fragmentShader:VB,uniforms:{dirtTexture:tn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:tn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ie.WGS84.maximumRadius}})};var tf=Lr;function Ag(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function YB(e){for(;c(e.length);)e=e.get(e.length-1);return e.name}function GK(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(c(o)){let a=e.getStageByName(o);r[YB(a)]=!0}let s=i.uniforms;if(c(s)){let a=Object.getOwnPropertyNames(s),l=a.length;for(let u=0;u<l;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);c(h)&&(r[YB(h)]=!0)}}}return i.name}function qB(e,t,n,i,o){if(c(i.enabled)&&!i.enabled||c(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!c(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,l=i.length;for(let h=0;h<l;++h){let p=i.get(h);c(p.length)?a=qB(e,t,n,p,o):a=GK(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<l;++u)f=YB(i.get(u)),c(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<l;++u){f=YB(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[YB(i.get(p))]=!0}return a}function Egt(e,t){let n={};if(c(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=qB(e,t,n,i,void 0);a=qB(e,t,n,o,a),a=GK(e,t,n,r,a),a=qB(e,t,n,e,a),GK(e,t,n,s,a)}else qB(e,t,n,e,void 0);return n}function Sgt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,l=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(h=p[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||l!==h.pixelDatatype||!G.equals(u,h.clearColor))continue;let m=h.stages,y=m.length,b=!1;for(let x=0;x<y;++x)if(n[m[x]]){b=!0;break}if(!b)break}return c(h)&&f<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:l,clearColor:u,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:l}),clear:void 0},p.push(h),h)}function wgt(e,t){let n=Egt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Sgt(e,i,n[i]))}function jK(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function vgt(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],l=a.textureScale,u=Math.ceil(n*l),f=Math.ceil(i*l),h=Math.min(u,f);a.forcePowerOfTwo&&(O.isPowerOfTwo(h)||(h=O.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ei({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}Ag.prototype.updateDependencies=function(){this._updateDependencies=!0};Ag.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=c(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=c(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=c(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=c(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!c(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(jK(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&wgt(this,e);let l=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==l||this._height!==u;!n&&!f||(this._width=l,this._height=u,this._updateDependencies=!1,jK(this),vgt(this,e))};Ag.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Ag.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Ag.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Ag.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(c(t))return t.buffer.framebuffer};Ag.prototype.isDestroyed=function(){return!1};Ag.prototype.destroy=function(){return jK(this),de(this)};var rA=Ag;var Pw={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};function wTe(e){return e===Pw.REINHARD||e===Pw.MODIFIED_REINHARD||e===Pw.FILMIC||e===Pw.ACES||e===Pw.PBR_NEUTRAL}var Cg=Object.freeze(Pw);var WK=[];function xl(){let e=tf.createFXAAStage(),t=tf.createAmbientOcclusionStage(),n=tf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=tf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Cg.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new rA(this),r={},s=WK;for(s.push(e,t,n,i);s.length>0;){let l=s.pop();r[l.name]=l,l._textureCache=o;let u=l.length;if(c(u))for(let f=0;f<u;++f)s.push(l.get(f))}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(xl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let l=t[a];e=e||l.ready&&l.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 qK(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(c(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(!c(t))continue;if(c(t.selected))return!0;let n=t.length;if(c(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;if(!wTe(e))throw new E("tonemapper was set to an invalid value.");c(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case Cg.REINHARD:n=tf.createReinhardTonemappingStage(t);break;case Cg.MODIFIED_REINHARD:n=tf.createModifiedReinhardTonemappingStage(t);break;case Cg.FILMIC:n=tf.createFilmicTonemappingStage(t);break;case Cg.PBR_NEUTRAL:n=tf.createPbrNeutralTonemappingStage(t);break;default:n=tf.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,c(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 qK(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}xl.prototype.add=function(e){T.typeOf.object("stage",e);let t=this._stageNames,n=WK;for(n.push(e);n.length>0;){let o=n.pop();if(c(t[o.name]))throw new E(`${o.name} has already been added to the collection or does not have a unique name.`);t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(c(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};xl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=WK;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(c(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};xl.prototype.contains=function(e){return c(e)&&c(e._index)&&e._textureCache===this._textureCache};xl.prototype.get=function(e){qK(this);let t=this._stages,n=t.length;return T.typeOf.number.greaterThanOrEquals("stages length",n,0),T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,n),t[e]};xl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};xl.prototype.getStageByName=function(e){return this._stageNames[e]};xl.prototype.update=function(e,t,n){qK(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 x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&(o[s++]=A)}o.length=s;let a=s!==i.length;if(!a){for(let x=0;x<s;++x)if(o[x]!==i[x]){a=!0;break}}let l=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=l.enabled&&l._isSupported(e),m=u.enabled&&u._isSupported(e),y=h.enabled&&h._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=b,this._textureCacheDirty=!1),c(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!c(this._randomTexture)&&g){let A=new Uint8Array(196608);for(let C=0;C<196608;C+=3)A[C]=Math.floor(Math.random()*255);this._randomTexture=new Rt({context:e,pixelFormat:ke.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:A,width:256,height:256},sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})})}this._textureCache.update(e),p.update(e,t),l.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let x=0;x<r.length;++x)r[x].update(e,t);s=0;for(let x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};xl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function sA(e){for(;c(e.length);)e=e.get(e.length-1);return e.outputTexture}xl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(c(t))return sA(t)};function hp(e,t,n,i,o){if(c(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){hp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)hp(e.get(r),t,sA(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)hp(e.get(r),t,n,i,o)}xl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,l=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),p=l.enabled&&l._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!h&&!p&&!m&&r===0)return;let b=t;h&&a.ready&&(hp(a,e,b,n,i),b=sA(a)),p&&l.ready&&(hp(l,e,b,n,i),b=sA(l)),g&&u.ready&&hp(u,e,b,n,i),m&&f.ready&&(hp(f,e,b,n,i),b=sA(f));let x=b;if(r>0){hp(o[0],e,b,n,i);for(let A=1;A<r;++A)hp(o[A],e,sA(o[A-1]),n,i);x=sA(o[r-1])}y&&s.ready&&hp(s,e,x,n,i)};xl.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};xl.prototype.isDestroyed=function(){return!1};xl.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(),de(this)};var XB=xl;var Dgt={SHIFT:0,CTRL:1,ALT:2},ra=Object.freeze(Dgt);var Pgt={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},An=Object.freeze(Pgt);function B0(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 QK(e,t){let n=e;return c(t)&&(n+=`+${t}`),n}function aA(e){if(e.shiftKey)return ra.SHIFT;if(e.ctrlKey)return ra.CTRL;if(e.altKey)return ra.ALT}var Us={LEFT:0,MIDDLE:1,RIGHT:2};function nf(e,t,n,i){function o(r){i(e,r)}Vt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Igt(e){let t=e._element,n=c(t.disableRootEvents)?t:document;Vt.supportsPointerEvents()?(nf(e,"pointerdown",t,Fgt),nf(e,"pointerup",t,FTe),nf(e,"pointermove",t,Bgt),nf(e,"pointercancel",t,FTe)):(nf(e,"mousedown",t,BTe),nf(e,"mouseup",n,kTe),nf(e,"mousemove",n,UTe),nf(e,"touchstart",t,Lgt),nf(e,"touchend",n,OTe),nf(e,"touchmove",n,Ngt),nf(e,"touchcancel",n,OTe)),nf(e,"dblclick",t,Rgt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",nf(e,i,t,Mgt)}function Ogt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var vTe={position:new H};function JK(e){e._lastSeenTouchEvent=Ti()}function e$(e){return Ti()-e._lastSeenTouchEvent>Wh.mouseEmulationIgnoreMilliseconds}function ZK(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function BTe(e,t){if(!e$(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Us.LEFT)i=An.LEFT_DOWN;else if(n===Us.MIDDLE)i=An.MIDDLE_DOWN;else if(n===Us.RIGHT)i=An.RIGHT_DOWN;else return;let o=B0(e,t,e._primaryPosition);H.clone(o,e._primaryStartPosition),H.clone(o,e._primaryPreviousPosition);let r=aA(t),s=e.getInputAction(i,r);c(s)&&(H.clone(o,vTe.position),s(vTe),t.preventDefault())}var DTe={position:new H},PTe={position:new H};function YK(e,t,n,i){let o=aA(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(c(r)||c(s)){let a=B0(e,i,e._primaryPosition);if(c(r)&&(H.clone(a,DTe.position),r(DTe)),c(s)){let l=e._primaryStartPosition;ZK(l,a,e._clickPixelTolerance)&&(H.clone(a,PTe.position),s(PTe))}}}function kTe(e,t){if(!e$(e))return;let n=t.button;n!==Us.LEFT&&n!==Us.MIDDLE&&n!==Us.RIGHT||(e._buttonDown[Us.LEFT]&&(YK(e,An.LEFT_UP,An.LEFT_CLICK,t),e._buttonDown[Us.LEFT]=!1),e._buttonDown[Us.MIDDLE]&&(YK(e,An.MIDDLE_UP,An.MIDDLE_CLICK,t),e._buttonDown[Us.MIDDLE]=!1),e._buttonDown[Us.RIGHT]&&(YK(e,An.RIGHT_UP,An.RIGHT_CLICK,t),e._buttonDown[Us.RIGHT]=!1))}var XK={startPosition:new H,endPosition:new H};function UTe(e,t){if(!e$(e))return;let n=aA(t),i=B0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(An.MOUSE_MOVE,n);c(r)&&(H.clone(o,XK.startPosition),H.clone(i,XK.endPosition),r(XK)),H.clone(i,o),(e._buttonDown[Us.LEFT]||e._buttonDown[Us.MIDDLE]||e._buttonDown[Us.RIGHT])&&t.preventDefault()}var ITe={position:new H};function Rgt(e,t){let n=t.button,i;if(n===Us.LEFT)i=An.LEFT_DOUBLE_CLICK;else return;let o=aA(t),r=e.getInputAction(i,o);c(r)&&(B0(e,t,ITe.position),r(ITe))}function Mgt(e,t){let n;if(c(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(!c(n))return;let i=aA(t),o=e.getInputAction(An.WHEEL,i);c(o)&&(o(n),t.preventDefault())}function Lgt(e,t){JK(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,B0(e,r,new H));dG(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.set(s,H.clone(a.get(s)))}function OTe(e,t){JK(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);dG(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.remove(s)}var RTe={position:new H},KK={position1:new H,position2:new H},MTe={position:new H},LTe={position:new H},NTe={position:new H};function dG(e,t){let n=aA(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Us.LEFT]){if(e._buttonDown[Us.LEFT]=!1,c(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(An.LEFT_UP,n),c(r)&&(H.clone(e._primaryPosition,MTe.position),r(MTe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(An.LEFT_CLICK,n),c(s))){let l=e._primaryStartPosition,u=e._previousPositions.values[0];ZK(l,u,e._clickPixelTolerance)&&(H.clone(e._primaryPosition,LTe.position),s(LTe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(An.PINCH_END,n),c(r)&&r()),o===1&&!a){let l=i.values[0];H.clone(l,e._primaryPosition),H.clone(l,e._primaryStartPosition),H.clone(l,e._primaryPreviousPosition),e._buttonDown[Us.LEFT]=!0,r=e.getInputAction(An.LEFT_DOWN,n),c(r)&&(H.clone(l,RTe.position),r(RTe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(An.RIGHT_CLICK,n),c(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];ZK(u,f,e._holdPixelTolerance)&&(H.clone(e._primaryPosition,NTe.position),s(NTe))}},Wh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(An.PINCH_START,n),c(r)&&(H.clone(i.values[0],KK.position1),H.clone(i.values[1],KK.position2),r(KK),t.preventDefault()))}function Ngt(e,t){JK(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 u=a.get(s);c(u)&&B0(e,r,u)}VTe(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,H.clone(a.get(s),l.get(s))}var $K={startPosition:new H,endPosition:new H},KB={distance:{startPosition:new H,endPosition:new H},angleAndHeight:{startPosition:new H,endPosition:new H}};function VTe(e,t){let n=aA(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Us.LEFT]){let a=i.values[0];H.clone(a,e._primaryPosition);let l=e._primaryPreviousPosition;s=e.getInputAction(An.MOUSE_MOVE,n),c(s)&&(H.clone(l,$K.startPosition),H.clone(a,$K.endPosition),s($K)),H.clone(a,l),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(An.PINCH_MOVE,n),c(s))){let a=i.values[0],l=i.values[1],u=o.values[0],f=o.values[1],h=l.x-a.x,p=l.y-a.y,g=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,y=f.y-u.y,b=Math.sqrt(m*m+y*y)*.25,x=(l.y+a.y)*.125,A=(f.y+u.y)*.125,C=Math.atan2(p,h),S=Math.atan2(y,m);H.fromElements(0,b,KB.distance.startPosition),H.fromElements(0,g,KB.distance.endPosition),H.fromElements(S,A,KB.angleAndHeight.startPosition),H.fromElements(C,x,KB.angleAndHeight.endPosition),s(KB)}}function Fgt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,B0(e,t,new H)),dG(e,t),e._previousPositions.set(i,H.clone(n.get(i)))}else BTe(e,t)}function FTe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),dG(e,t),e._previousPositions.remove(i)}else kTe(e,t)}function Bgt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!c(o))return;B0(e,t,o),VTe(e,t);let r=e._previousPositions;H.clone(n.get(i),r.get(i))}else UTe(e,t)}function Wh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Wh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new H,this._primaryPosition=new H,this._primaryPreviousPosition=new H,this._positions=new Et,this._previousPositions=new Et,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,Igt(this)}Wh.prototype.setInputAction=function(e,t,n){if(!c(e))throw new E("action is required.");if(!c(t))throw new E("type is required.");let i=QK(t,n);this._inputEvents[i]=e};Wh.prototype.getInputAction=function(e,t){if(!c(e))throw new E("type is required.");let n=QK(e,t);return this._inputEvents[n]};Wh.prototype.removeInputAction=function(e,t){if(!c(e))throw new E("type is required.");let n=QK(e,t);delete this._inputEvents[n]};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){return Ogt(this),de(this)};Wh.mouseEmulationIgnoreMilliseconds=800;Wh.touchHoldDelayMilliseconds=1500;var of=Wh;function cA(e){T.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}cA.prototype.completeMorph=function(){c(this._completeMorph)&&this._completeMorph()};cA.prototype.morphTo2D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof on,!(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(B.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?_yt(this,e):Cyt(this,e,t),e===0&&c(this._completeMorph)&&this._completeMorph())};var kgt=new d,Ugt=new d,Vgt=new d,zgt=new d,Hgt=new d,Ggt=new d,jgt=new d,Wgt=new he,qgt=new B,Ygt=new Ci,Xgt=new on,Kgt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};cA.prototype.morphToColumbusView=function(e,t){c(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(B.IDENTITY);let i=kgt,o=Ugt,r=Vgt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,jgt),h=Ot.eastNorthUpToFixedFrame(f,t,qgt);B.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Wgt),i),B.multiplyByPointAsVector(h,o,o),B.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=Xgt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Ygt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=O.toRadians(60));let a=Kgt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let l=Syt(a);$B(this,l),this._previousMode===oe.SCENE2D?Eyt(this,e,a,l):(a.position2D=B.multiplyByPoint(ro.TRANSFORM_2D,i,zgt),a.direction2D=B.multiplyByPointAsVector(ro.TRANSFORM_2D,o,Hgt),a.up2D=B.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Ggt),n._mode=oe.MORPHING,ZTe(this,e,a,l)),e===0&&c(this._completeMorph)&&this._completeMorph()};var i$={position:new d,direction:new d,up:new d,frustum:void 0},HTe=new Ci;cA.prototype.morphTo3D=function(e,t){c(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(B.IDENTITY),this._previousMode===oe.SCENE2D)syt(this,e,t);else{let i;e>0?(i=i$,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=GTe(this,t);let o,r=n.camera;r.frustum instanceof on?o=r.frustum.clone():(o=HTe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=O.toRadians(60)),i.frustum=o;let s=JTe(i);$B(this,s),n$(this,e,i,s)}e===0&&c(this._completeMorph)&&this._completeMorph()}};cA.prototype.isDestroyed=function(){return!1};cA.prototype.destroy=function(){return hG(this),de(this)};function $B(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new of(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,An.LEFT_DOWN),e._morphHandler.setInputAction(n,An.MIDDLE_DOWN),e._morphHandler.setInputAction(n,An.RIGHT_DOWN),e._morphHandler.setInputAction(n,An.WHEEL)}}function hG(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 $gt=new he,Zgt=new d,Qgt=new B;function GTe(e,t){let n=e._scene,i=n.camera,o=i$,r=o.position,s=o.direction,a=o.up,l=n.mapProjection.unproject(i.position,$gt);t.cartographicToCartesian(l,r);let u=t.scaleToGeodeticSurface(r,Zgt),f=Ot.eastNorthUpToFixedFrame(u,t,Qgt);return B.multiplyByPointAsVector(f,i.direction,s),B.multiplyByPointAsVector(f,i.up,a),o}var Jgt=new d,eyt=new d,tyt=new d,nyt=new d,iyt=new d,oyt=new d;function n$(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,Jgt),a=d.clone(r.direction,eyt),l=d.clone(r.up,tyt),u=B.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,nyt),f=B.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,iyt),h=B.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,oyt);function p(m){bd(s,u,m.time,r.position),bd(a,f,m.time,r.direction),bd(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){QTe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var ryt=new on,jTe=new d,WTe=new d,qTe=new d,o$=new d,YTe=new d,XTe=new d;function syt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=i$,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=GTe(e,n));let s;e._morphToOrthographic?(s=ryt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=HTe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=O.toRadians(60)),r.frustum=s;let a=JTe(r);$B(e,a);let l;e._morphToOrthographic?l=function(){n$(e,t,r,a)}:l=function(){$Te(e,t,r,function(){n$(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,o$),complete:function(){i._mode=oe.MORPHING,l()}})):l()}function bd(e,t,n,i){return d.lerp(e,t,n,i)}function KTe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof on)return;let a=s.frustum.fov,l=O.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(l*.5)+1e7;function f(p){s.frustum.fov=O.lerp(a,l,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var ayt=new d,cyt=new d,lyt=new d,t$=new d,uyt=new d,fyt=new d,dyt=new jo,hyt=new mn,myt=new d,pyt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function _yt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,ayt),r=d.clone(i.direction,cyt),s=d.clone(i.up,lyt),a=d.negate(d.UNIT_Z,uyt),l=d.clone(d.UNIT_Y,fyt),u=t$;if(t>0)d.clone(d.ZERO,t$),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,t$);let b=hyt;B.multiplyByPoint(ro.TRANSFORM_2D,o,b.origin),B.multiplyByPointAsVector(ro.TRANSFORM_2D,r,b.direction);let x=n.globe;if(c(x)){let A=x.pickWorldCoordinates(b,n,!0,myt);c(A)&&(B.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,A,u),u.z+=d.distance(o,u))}}let f=dyt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=pyt;h.position=u,h.direction=a,h.up=l,h.frustum=f;let p=eAe(h);$B(e,p);function g(b){bd(o,u,b.time,i.position),bd(r,a,b.time,i.direction),bd(s,l,b.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,x){b.position.z=x}let y=n.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){KTe(e,t,h,m,p)}});e._currentTweens.push(y)}var zTe=new he,gyt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new jo},yyt={position:new d,direction:new d,up:new d,frustum:void 0},byt=new d,xyt=new mn,Tyt=new B,Ayt=new d;function Cyt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=gyt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,zTe),i.mapProjection.project(zTe,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=xyt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,Ayt),m=Ot.eastNorthUpToFixedFrame(g,n,Tyt);B.inverseTransformation(m,m),B.multiplyByPointAsVector(m,p,p),B.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let y=i.globe;if(c(y)){let b=y.pickWorldCoordinates(h,i,!0,byt);if(c(b)){let x=d.distance(r.position2D,b);b.x+=x,d.clone(b,r.position2D)}}}function s(h,p){h.position.x=p}B.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),B.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),B.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 l=yyt;B.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,l.position),d.clone(r.direction,l.direction),d.clone(r.up,l.up),l.frustum=a;let u=eAe(l);$B(e,u);function f(){KTe(e,t,r,s,u)}ZTe(e,t,r,f)}function $Te(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,l=O.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(l*.5)+1e7,r.frustum.fov=l;function f(p){r.frustum.fov=O.lerp(l,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function Eyt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,o$),a=d.clone(n.direction,YTe),l=d.clone(n.up,XTe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,jTe),h=d.clone(r.direction,WTe),p=d.clone(r.up,qTe);f.z=s.z;function g(y){bd(f,s,y.time,r.position),bd(h,a,y.time,r.direction),bd(p,l,y.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():$Te(e,0,n,u)}function ZTe(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,jTe),a=d.clone(r.direction,WTe),l=d.clone(r.up,qTe),u=d.clone(n.position2D,o$),f=d.clone(n.direction2D,YTe),h=d.clone(n.up2D,XTe);function p(m){bd(s,u,m.time,r.position),bd(a,f,m.time,r.direction),bd(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){QTe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function QTe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Qr.QUARTIC_OUT};c(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function JTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),hG(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function eAe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),hG(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function Syt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),hG(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var ZB=cA;var wyt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Vi=Object.freeze(wyt);function sa(e,t){let n=`${e}`;return c(t)&&(n+=`+${t}`),n}function vyt(e,t){H.clone(e.distance.startPosition,t.distance.startPosition),H.clone(e.distance.endPosition,t.distance.endPosition),H.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),H.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function tAe(e,t,n){let i=sa(Vi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,l=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new H;let u=e._movement[i];c(u)||(u=e._movement[i]={}),u.distance={startPosition:new H,endPosition:new H},u.angleAndHeight={startPosition:new H,endPosition:new H},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,H.lerp(f.position1,f.position2,.5,s[i])},An.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,l[i]=new Date},An.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(vyt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(H.clone(f.distance.endPosition,u.distance.endPosition),H.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},An.PINCH_MOVE,t)}function nAe(e,t){let n=sa(Vi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];c(s)||(s=e._movement[n]={});let a=e._lastMovement[n];c(a)||(a=e._lastMovement[n]={startPosition:new H,endPosition:new H,valid:!1}),s.startPosition=new H,H.clone(H.ZERO,s.startPosition),s.endPosition=new H,e._eventHandler.setInputAction(function(l){let u=7.5*O.toRadians(l);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,H.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},An.WHEEL,t)}function Iw(e,t,n){let i=sa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new H;let a=e._lastMovement[i];c(a)||(a=e._lastMovement[i]={startPosition:new H,endPosition:new H,valid:!1});let l,u;n===Vi.LEFT_DRAG?(l=An.LEFT_DOWN,u=An.LEFT_UP):n===Vi.RIGHT_DRAG?(l=An.RIGHT_DOWN,u=An.RIGHT_UP):n===Vi.MIDDLE_DRAG&&(l=An.MIDDLE_DOWN,u=An.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,H.clone(f.position,r[i])},l,t),e._eventHandler.setInputAction(function(){r$(sa(n,void 0),e);for(let f of Object.values(ra)){let h=sa(n,f);r$(h,e)}},u,t)}function r$(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 iAe(e,t){H.clone(e.startPosition,t.startPosition),H.clone(e.endPosition,t.endPosition)}function Dyt(e,t,n){let i=n._isDown,o=!1,r=sa(e,t);for(let[l,u]of Object.entries(i))l.startsWith(e)&&u&&l!==r&&(o=!0,r$(l,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];c(a)||(a=n._lastMovement[r]={startPosition:new H,endPosition:new H,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function oAe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Vi)if(Vi.hasOwnProperty(s)){let a=Vi[s];if(c(a)){let l=sa(a,t);n[l]=!0,c(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new H,endPosition:new H,valid:!1}),c(e._movement[l])||(e._movement[l]={startPosition:new H,endPosition:new H})}}e._eventHandler.setInputAction(function(s){for(let a in Vi)if(Vi.hasOwnProperty(a)){let l=Vi[a];if(c(l)){let u=sa(l,t);Dyt(l,t,e),r[u]&&(n[u]?(iAe(i[u],o[u]),o[u].valid=!0,iAe(s,i[u]),n[u]=!1):H.clone(s.endPosition,i[u].endPosition))}}H.clone(s.endPosition,e._currentMousePosition)},An.MOUSE_MOVE,t)}function xd(e){if(!c(e))throw new E("canvas is required.");this._eventHandler=new of(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new H,nAe(this,void 0),tAe(this,void 0,e),Iw(this,void 0,Vi.LEFT_DRAG),Iw(this,void 0,Vi.RIGHT_DRAG),Iw(this,void 0,Vi.MIDDLE_DRAG),oAe(this,void 0);for(let t in ra)if(ra.hasOwnProperty(t)){let n=ra[t];c(n)&&(nAe(this,n),tAe(this,n,e),Iw(this,n,Vi.LEFT_DRAG),Iw(this,n,Vi.RIGHT_DRAG),Iw(this,n,Vi.MIDDLE_DRAG),oAe(this,n))}}Object.defineProperties(xd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[sa(Vi.WHEEL)]||!this._update[sa(Vi.WHEEL,ra.SHIFT)]||!this._update[sa(Vi.WHEEL,ra.CTRL)]||!this._update[sa(Vi.WHEEL,ra.ALT)];return this._buttonsDown>0||e}}});xd.prototype.isMoving=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return!this._update[n]};xd.prototype.getMovement=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._movement[n]};xd.prototype.getLastMovement=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t),i=this._lastMovement[n];if(i.valid)return i};xd.prototype.isButtonDown=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._isDown[n]};xd.prototype.getStartMousePosition=function(e,t){if(!c(e))throw new E("type is required.");if(e===Vi.WHEEL)return this._currentMousePosition;let n=sa(e,t);return this._eventStartPosition[n]};xd.prototype.getButtonPressTime=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._pressTime[n]};xd.prototype.getButtonReleaseTime=function(e,t){if(!c(e))throw new E("type is required.");let n=sa(e,t);return this._releaseTime[n]};xd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};xd.prototype.isDestroyed=function(){return!1};xd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),de(this)};var QB=xd;function mG(e,t,n,i,o,r,s,a,l,u){this._tweens=e,this._tweenjs=t,this._startObject=je(n),this._stopObject=je(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=l,this.cancel=u,this.needsStart=!0}Object.defineProperties(mG.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}}});mG.prototype.cancelTween=function(){this._tweens.remove(this)};function qh(){this._tweens=[]}Object.defineProperties(qh.prototype,{length:{get:function(){return this._tweens.length}}});qh.prototype.add=function(e){if(e=e??W.EMPTY_OBJECT,!c(e.startObject)||!c(e.stopObject))throw new E("options.startObject and options.stopObject are required.");if(!c(e.duration)||e.duration<0)throw new E("options.duration is required and must be positive.");if(e.duration===0)return c(e.complete)&&e.complete(),new mG(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/qn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Qr.LINEAR_NONE,r=e.startObject,s=new Zye(r);s.to(je(e.stopObject),t),s.delay(i),s.easing(o),c(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new mG(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};qh.prototype.addProperty=function(e){e=e??W.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;if(!c(t)||!c(e.property))throw new E("options.object and options.property are required.");if(!c(t[n]))throw new E("options.object must have the specified property.");if(!c(i)||!c(o))throw new E("options.startValue and options.stopValue are required.");function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};qh.prototype.addAlpha=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new E("options.material is required.");let n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&c(t.uniforms[o])&&c(t.uniforms[o].alpha)&&n.push(o);if(n.length===0)throw new E("material has no properties with alpha components.");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:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};qh.prototype.addOffsetIncrement=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new E("material is required.");if(!c(t.uniforms.offset))throw new E("material.uniforms must have an offset property.");let n=t.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})};qh.prototype.remove=function(e){if(!c(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),c(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};qh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),c(n.cancel)&&n.cancel()}e.length=0};qh.prototype.contains=function(e){return c(e)&&this._tweens.indexOf(e)!==-1};qh.prototype.get=function(e){if(!c(e))throw new E("index is required.");return this._tweens[e]};qh.prototype.update=function(e){let t=this._tweens,n=0;for(e=c(e)?e/qn.SECONDS_PER_MILLISECOND:Ti();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 lA=qh;function e3(e){if(!c(e))throw new E("scene is required.");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=Vi.LEFT_DRAG,this.zoomEventTypes=[Vi.RIGHT_DRAG,Vi.WHEEL,Vi.PINCH],this.rotateEventTypes=Vi.LEFT_DRAG,this.tiltEventTypes=[Vi.MIDDLE_DRAG,Vi.PINCH,{eventType:Vi.LEFT_DRAG,modifier:ra.CTRL},{eventType:Vi.RIGHT_DRAG,modifier:ra.CTRL}],this.lookEventTypes={eventType:Vi.LEFT_DRAG,modifier:ra.SHIFT};let t=e.ellipsoid??ie.default;this.minimumPickingTerrainHeight=ie.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ie.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ie.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ie.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 QB(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 lA,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new H(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new H(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new H,this._strafeEndMousePosition=new H,this._zoomMouseStart=new H(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new H,this._panLastWorldPosition=new d,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,O.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 Pyt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Iyt(e){return H.equalsEpsilon(e.startPosition,e.endPosition,O.EPSILON14)}var Oyt=.4;function Ryt(e,t,n,i,o,r,s){let a=r[s];c(a)||(a=r[s]={startPosition:new H,endPosition:new H,motion:new H,inertiaEnabled:!0});let l=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=l&&u&&(u.getTime()-l.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(l&&u&&f<Oyt){let g=Pyt(p,i),m=e.getLastMovement(t,n);if(!c(m)||Iyt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=H.clone(m.startPosition,a.startPosition),a.endPosition=H.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=H.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||H.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function Myt(e,t){if(c(t)){let n=e[t];c(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(c(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],c(n)&&(n.inertiaEnabled=!1)}}}var rAe=[];function Tl(e,t,n,i,o,r){if(!c(n))return;let s=e._aggregator;Array.isArray(n)||(rAe[0]=n,n=rAe);let a=n.length;for(let l=0;l<a;++l){let u=n[l],f=c(u.eventType)?u.eventType:u,h=u.modifier,p=s.isMoving(f,h)&&s.getMovement(f,h),g=s.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,g,p),Myt(e,r)):o<1&&Ryt(s,f,h,o,i,e,r))}}var pG=new mn,Lyt=new d,Nyt=new H,Fyt=new d,Byt=new H,kyt=new d,Uyt=new d,Vyt=new d,zyt=new d,gAe=new d,Hyt=new d,Gyt=new d,jyt=new d,Wyt=new d,qyt=new d,Yyt=new d,Xyt=new d,Kyt=new d,$yt=new d,Zyt=new d,uA=new d,sAe=new d,aAe=new d,s$={orientation:new Oa};function m$(e,t,n,i,o,r){let s=1;c(r)&&(s=O.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=O.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!c(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let y=e._scene,b=y.camera,x=y.mode,A=s$.orientation;A.heading=b.heading,A.pitch=b.pitch,A.roll=b.roll;let C=n.inertiaEnabled??H.equals(t,e._zoomMouseStart),S=e._zoomingOnVector,v=e._rotatingZoom,P;if(C||(e._zoomMouseStart=H.clone(t,e._zoomMouseStart),c(e._globe)&&x===oe.SCENE2D?(P=b.getPickRay(t,pG).origin,P=d.fromElements(P.y,P.z,P.x)):c(e._globe)&&(P=Eg(e,t,Lyt)),c(P)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let M=x===oe.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!C||v){if(x===oe.SCENE2D){let R=e._zoomWorldPosition,L=b.position;if(!d.equals(R,L)&&b.positionCartographic.height<e._maxCoord.x*2){let F=b.position.x,_=d.subtract(R,L,Fyt);d.normalize(_,_);let w=d.distance(R,L)*m/(b.getMagnitude()*.5);b.move(_,w*.5),(b.position.x<0&&F>0||b.position.x>0&&F<0)&&(P=b.getPickRay(t,pG).origin,P=d.fromElements(P.y,P.z,P.x),e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition))}}else if(x===oe.SCENE3D){let R=d.normalize(b.position,gAe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(d.dot(b.direction,R))<.6)M=!0;else{let L=y.canvas,F=Byt;F.x=L.clientWidth/2,F.y=L.clientHeight/2;let _=Eg(e,F,kyt);if(!c(_))M=!0;else if(b.positionCartographic.height<1e6)if(d.dot(b.direction,R)>=-.5)M=!0;else{let w=Gyt;d.clone(b.position,w);let D=e._zoomWorldPosition,I=Hyt;if(I=d.normalize(D,I),d.dot(I,R)<0)return;let N=Zyt,k=qyt;d.clone(b.direction,k),d.add(w,d.multiplyByScalar(k,1e3,uA),N);let z=Yyt,V=Xyt;d.subtract(D,w,z),d.normalize(z,V);let j=d.dot(R,V);if(j>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-j),q=d.magnitude(w),Y=d.magnitude(D),te=q-m,K=d.magnitude(z),Z=Math.asin(O.clamp(K/Y*Math.sin(U),-1,1)),ee=Math.asin(O.clamp(te/Y*Math.sin(U),-1,1)),me=Z-ee+U,Te=jyt;d.normalize(w,Te);let ue=Wyt;ue=d.cross(V,Te,ue),ue=d.normalize(ue,ue),d.normalize(d.cross(Te,ue,uA),k),d.multiplyByScalar(d.normalize(N,uA),d.magnitude(N)-m,N),d.normalize(w,w),d.multiplyByScalar(w,te,w);let ye=Kyt;d.multiplyByScalar(d.add(d.multiplyByScalar(Te,Math.cos(me)-1,sAe),d.multiplyByScalar(k,Math.sin(me),aAe),uA),te,ye),d.add(w,ye,w),d.normalize(N,Te),d.normalize(d.cross(Te,ue,uA),k);let Ae=$yt;d.multiplyByScalar(d.add(d.multiplyByScalar(Te,Math.cos(me)-1,sAe),d.multiplyByScalar(k,Math.sin(me),aAe),uA),d.magnitude(N),Ae),d.add(N,Ae,N),d.clone(w,b.position),d.normalize(d.subtract(N,w,uA),b.direction),d.clone(b.direction,b.direction),d.cross(b.direction,b.up,b.right),d.cross(b.right,b.direction,b.up),b.setView(s$);return}else{let w=d.normalize(_,Uyt),D=d.normalize(e._zoomWorldPosition,Vyt),I=d.dot(D,w);if(I>0&&I<1){let N=O.acosClamped(I),k=d.cross(D,w,zyt),z=Math.abs(N)>O.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/z;b.rotate(k,N*V)}}}}e._rotatingZoom=!M}if(!C&&M||S){let R,L=Gi.worldToWindowCoordinates(y,e._zoomWorldPosition,Nyt);x!==oe.COLUMBUS_VIEW&&H.equals(t,e._zoomMouseStart)&&c(L)?R=b.getPickRay(L,pG):R=b.getPickRay(t,pG);let F=R.direction;(x===oe.COLUMBUS_VIEW||x===oe.SCENE2D)&&d.fromElements(F.y,F.z,F.x,F),b.move(F,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(s$)}var Qyt=new mn,Jyt=new mn,e0t=new d;function t0t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Qyt).origin,s=o.getPickRay(n.endPosition,Jyt).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,e0t),l=d.magnitude(a);l>0&&(d.normalize(a,a),o.move(a,l))}function cAe(e,t,n){c(n.distance)&&(n=n.distance);let o=e._scene.camera;m$(e,t,n,e.zoomFactor,o.getMagnitude())}var n0t=new H,i0t=new H;function lAe(e,t,n){if(c(n.angleAndHeight)){o0t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,l=n0t;l.x=2/s*n.startPosition.x-1,l.y=2/a*(a-n.startPosition.y)-1,l=H.normalize(l,l);let u=i0t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=H.normalize(u,u);let f=O.acosClamped(l.x);l.y<0&&(f=O.TWO_PI-f);let h=O.acosClamped(u.x);u.y<0&&(h=O.TWO_PI-h);let p=h-f;o.twistRight(p)}function o0t(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 l=i*a*Math.PI*4;r.twistRight(l)}function r0t(e){let t=e._scene.mapMode2D===ru.ROTATE;B.equals(B.IDENTITY,e._scene.camera.transform)?(Tl(e,e.enableTranslate,e.translateEventTypes,t0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,cAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Tl(e,e.enableRotate,e.tiltEventTypes,lAe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Tl(e,e.enableZoom,e.zoomEventTypes,cAe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Tl(e,e.enableRotate,e.translateEventTypes,lAe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var yAe=new mn,s0t=new d,a0t=new d;function Eg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,s0t)),!c(o))return d.clone(s,n);let a=!e._cameraUnderground,l=r.getPickRay(t,yAe),u=o.pickWorldCoordinates(l,i,a,a0t),f=c(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=c(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var c0t=new he;function AG(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let l=t.cartesianToCartographic(i.position,c0t);c(l)&&(r=l.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var l0t=new d;function bAe(e,t){let n=t.origin,i=t.direction,o=AG(e),r=d.normalize(n,l0t),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function xAe(e,t,n,i){let o=d.distance(t.origin,n),r=AG(e),s=O.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),mn.getPoint(t,o,i)}function TAe(e,t,n,i){let o;return c(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=AG(e))):o=AG(e),mn.getPoint(t,o,i)}var u0t=new H;function AAe(e,t){let n=t.endPosition,i=H.subtract(t.endPosition,t.startPosition,u0t),o=e._strafeEndMousePosition;H.add(o,i,o),t.endPosition=o,p$(e,t,e._strafeStartPosition),t.endPosition=n}var uAe=new mn,f0t=new mn,a$=new d,d0t=new d,h0t=new d,m0t=new d,p0t=new sn(d.UNIT_X,0),_0t=new H,g0t=new H;function y0t(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){sf(e,t,n);return}if(e._strafing){AAe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=H.clone(n.startPosition,_0t),a=H.clone(n.endPosition,g0t),l=o.getPickRay(s,uAe),u=d.clone(d.ZERO,m0t),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=Eg(e,s,a$),c(h)&&(u.x=h.x)),r||u.x>o.position.z&&c(h)){let C=h;r&&(C=TAe(e,l,h,a$)),H.clone(t,e._strafeMousePosition),H.clone(t,e._strafeEndMousePosition),d.clone(C,e._strafeStartPosition),e._strafing=!0,p$(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,p0t);l=o.getPickRay(s,uAe);let g=Zn.rayPlane(l,p,a$),m=o.getPickRay(a,f0t),y=Zn.rayPlane(m,p,d0t);if(!c(g)||!c(y)){e._looking=!0,sf(e,t,n),H.clone(t,e._translateMousePosition);return}let b=d.subtract(g,y,h0t),x=b.x;b.x=b.y,b.y=b.z,b.z=x;let A=d.magnitude(b);A>O.EPSILON6&&(d.normalize(b,b),o.move(b,A))}var CAe=new H,yG=new mn,bG=new d,b0t=new d,EAe=new B,x0t=new B,T0t=new d,A0t=new sn(d.UNIT_X,0),c$=new d,f$=new he,SAe=new B,C0t=new Le,E0t=new J,xG=new d;function S0t(e,t,n){if(c(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){sf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,w0t(e,t,n)):v0t(e,t,n)}function w0t(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=CAe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,yG),l=d.UNIT_X,u=a.origin,f=a.direction,h,p=d.dot(l,f);if(Math.abs(p)>O.EPSILON6&&(h=-d.dot(l,u)/p),!c(h)||h<=0){e._looking=!0,sf(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}let g=d.multiplyByScalar(f,h,bG);d.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;d.fromElements(g.y,g.z,g.x,g);let b=m.unproject(g,f$);y.cartographicToCartesian(b,g);let x=Ot.eastNorthUpToFixedFrame(g,y,EAe),A=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=B.clone(o.transform,SAe);o._setTransform(x),rf(e,t,n,d.UNIT_Z),o._setTransform(S),e._globe=A,e._ellipsoid=C;let v=C.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function v0t(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,l=d.UNIT_X;if(H.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,bG);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=Eg(e,t,bG)),!c(s)){a=o.getPickRay(t,yG);let _=a.origin,w=a.direction,D,I=d.dot(l,w);if(Math.abs(I)>O.EPSILON6&&(D=-d.dot(l,_)/I),!c(D)||D<=0){e._looking=!0,sf(e,t,n),H.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(w,D,bG),d.add(_,s,s)}r&&(c(a)||(a=o.getPickRay(t,yG)),xAe(e,a,s,s)),H.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=CAe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,yG);let h=d.clone(d.ZERO,T0t);h.x=s.x;let p=sn.fromPointNormal(h,l,A0t),g=Zn.rayPlane(a,p,b0t),m=o._projection,y=m.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,f$);y.cartographicToCartesian(b,s);let x=Ot.eastNorthUpToFixedFrame(s,y,EAe),A;c(g)?(d.fromElements(g.y,g.z,g.x,g),b=m.unproject(g,f$),y.cartographicToCartesian(b,g),A=Ot.eastNorthUpToFixedFrame(g,y,x0t)):A=x;let C=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=B.clone(o.transform,SAe);o._setTransform(x);let M=d.cross(d.UNIT_Z,d.normalize(o.position,c$),c$),R=d.dot(o.right,M);if(rf(e,t,n,v,!1,!0),o._setTransform(A),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let w=o.constrainedAxis;o.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),o.constrainedAxis=w}else rf(e,t,n,v,!0,!1);if(c(o.constrainedAxis)){let _=d.cross(o.direction,o.constrainedAxis,xG);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,o.right)<0&&d.negate(_,_),d.cross(_,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(P),e._globe=C,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let F=d.clone(o.positionWC,c$);if(e.enableCollisionDetection&&y$(e,!0),!d.equals(o.positionWC,F)){o._setTransform(A),o.worldToCameraCoordinatesPoint(F,F);let _=d.magnitudeSquared(F);d.magnitudeSquared(o.position)>_&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(_),o.position));let w=d.angleBetween(F,o.position),D=d.cross(F,o.position,F);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,C0t),N=J.fromQuaternion(I,E0t);J.multiplyByVector(N,o.direction,o.direction),J.multiplyByVector(N,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(P)}}var wAe=new H,vAe=new mn,DAe=new d;function D0t(e,t,n){c(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=wAe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let l=o.getPickRay(a,vAe),u=l.origin,f=l.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=Eg(e,a,DAe));let g;if(c(p)&&(g=d.distance(u,p)),s){let m=bAe(e,l,h);c(g)?g=Math.min(g,m):g=m}if(!c(g)){let m=d.UNIT_X;g=-d.dot(m,u)/d.dot(m,f)}m$(e,t,n,e.zoomFactor,g)}function P0t(e){let n=e._scene.camera;if(!B.equals(B.IDENTITY,n.transform))Tl(e,e.enableRotate,e.rotateEventTypes,rf,e.inertiaSpin,"_lastInertiaSpinMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,IAe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Tl(e,e.enableTilt,e.tiltEventTypes,S0t,e.inertiaSpin,"_lastInertiaTiltMovement"),Tl(e,e.enableTranslate,e.translateEventTypes,y0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,D0t,e.inertiaZoom,"_lastInertiaZoomMovement"),Tl(e,e.enableLook,e.lookEventTypes,sf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);c(o)&&(e._tween=i.add(o))}i.update()}}var I0t=new mn,O0t=new sn(d.UNIT_X,0),R0t=new d,M0t=new d;function p$(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,I0t),s=d.clone(o.direction,M0t);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,O0t),l=Zn.rayPlane(r,a,R0t);c(l)&&(s=d.subtract(n,l,s),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var fAe=new d,PAe=new he,d$=new d,h$=new ie,L0t=new d,N0t=new d,F0t=new d;function B0t(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!B.equals(o.transform,B.IDENTITY)){rf(e,t,n);return}let a,l,u=s.geodeticSurfaceNormal(o.position,L0t);if(H.equals(t,e._rotateMousePosition)){if(e._looking)sf(e,t,n,u);else if(e._rotating)rf(e,t,n);else if(e._strafing)AAe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),l=d$,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,h$),u$(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,PAe).height,h=e._globe;if(c(h)&&f<e._minimumPickingTerrainHeight){let p=Eg(e,n.startPosition,F0t);if(c(p)){let g=!1,m=o.getPickRay(n.startPosition,yAe);if(r)g=!0,TAe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,N0t);Math.abs(d.dot(m.direction,y))<.05?g=!0:g=d.magnitude(o.position)<d.magnitude(p)}g?(H.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,p$(e,n,e._strafeStartPosition)):(a=d.magnitude(p),l=d$,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,h$),u$(e,t,n,s),d.clone(p,e._rotateStartPosition))}else e._looking=!0,sf(e,t,n,u)}else c(o.pickEllipsoid(n.startPosition,e._ellipsoid,fAe))?(u$(e,t,n,e._ellipsoid),d.clone(fAe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,rf(e,t,n)):(e._looking=!0,sf(e,t,n,u));H.clone(t,e._rotateMousePosition)}function rf(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,l=s.canvas,u=a.constrainedAxis;c(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/l.clientWidth,g=(n.startPosition.y-n.endPosition.y)/l.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=h*p*Math.PI*2,y=h*g*Math.PI;if(c(i)&&c(e.maximumTiltAngle)){let b=e.maximumTiltAngle,x=d.dot(a.direction,i),A=Math.PI-Math.acos(x)+y;A>b&&(y-=A-b)}o||a.rotateRight(m),r||a.rotateUp(y),a.constrainedAxis=u}var l$=se.clone(se.UNIT_W),dAe=se.clone(se.UNIT_W),_G=new d,Ow=new d,gG=new d,hAe=new d,k0t=new H,U0t=new H,V0t=new H,z0t=new H,H0t=new mn;function u$(e,t,n,i){let o=e._scene,r=o.camera,s=H.clone(n.startPosition,k0t),a=H.clone(n.endPosition,U0t),l=i.cartesianToCartographic(r.positionWC,PAe).height,u,f;if(!n.inertiaEnabled&&l<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,l$),!c(e._globe)&&!H.equalsEpsilon(s,e._panLastMousePosition)&&(u=Eg(e,s,l$)),!c(e._globe)&&c(u))){let h=d.subtract(u,r.positionWC,Ow),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),Ow),g=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,z0t),y=H.subtract(a,s,V0t),b=d.multiplyByScalar(r.rightWC,y.x*m.x,Ow),x=d.normalize(r.positionWC,gAe),A=r.getPickRay(a,H0t).direction,C=d.subtract(A,d.projectVector(A,r.rightWC,gG),gG),S=d.angleBetween(C,r.directionWC),v=1;c(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let P=Math.abs(d.dot(r.directionWC,x)),M=-y.y*m.y*2/Math.sqrt(v)*(1-P),R=d.multiplyByScalar(A,M,gG);P=Math.abs(d.dot(r.upWC,x));let L=d.multiplyByScalar(r.upWC,-y.y*(1-P)*m.y,hAe);f=d.add(u,b,dAe),f=d.add(f,R,f),f=d.add(f,L,f),d.clone(f,e._panLastWorldPosition),H.clone(a,e._panLastMousePosition)}if((!c(u)||!c(f))&&(u=r.pickEllipsoid(s,i,l$),f=r.pickEllipsoid(a,i,dAe)),!c(u)||!c(f)){e._rotating=!0,rf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),c(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,_G);d.cross(p,h,p),d.normalize(p,p);let g=d.cross(h,p,Ow),m=d.magnitude(u),y=d.dot(h,u),b=Math.acos(y/m),x=d.multiplyByScalar(h,y,gG);d.subtract(u,x,x),d.normalize(x,x);let A=d.magnitude(f),C=d.dot(h,f),S=Math.acos(C/A),v=d.multiplyByScalar(h,C,hAe);d.subtract(f,v,v),d.normalize(v,v);let P=Math.acos(d.dot(x,p));d.dot(x,g)<0&&(P=O.TWO_PI-P);let M=Math.acos(d.dot(v,p));d.dot(v,g)<0&&(M=O.TWO_PI-M);let R=P-M,L;d.equalsEpsilon(h,r.position,O.EPSILON2)?L=r.right:L=d.cross(h,r.position,_G);let F=d.cross(h,L,_G),_=d.dot(F,d.subtract(u,h,Ow)),w=d.dot(F,d.subtract(f,h,Ow)),D;_>0&&w>0?D=S-b:_>0&&w<=0?d.dot(r.position,h)>0?D=-b-S:D=b+S:D=b-S,r.rotateRight(R),r.rotateUp(D)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,_G);if(h<1&&!d.equalsEpsilon(p,d.ZERO,O.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var G0t=new d,j0t=new he,mAe=0;function IAe(e,t,n){c(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,l=e._cameraUnderground,u;l?u=t:(u=wAe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,vAe),h,p=o.cartesianToCartographic(s.position,j0t).height,g=Math.abs(mAe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=Eg(e,u,DAe));let y;if(c(h)&&(y=d.distance(f.origin,h),mAe=y),l){let x=bAe(e,f,p);c(y)?y=Math.min(y,x):y=x}c(y)||(y=p);let b=d.normalize(s.position,G0t);m$(e,t,n,e.zoomFactor,y,d.dot(b,s.direction))}var OAe=new H,TG=new mn,JB=new d,W0t=new d,RAe=new B,q0t=new B,MAe=new B,Y0t=new Le,X0t=new J,_$=new he,g$=new d;function K0t(e,t,n){let o=e._scene.camera;if(!B.equals(o.transform,B.IDENTITY))return;if(c(n.angleAndHeight)&&(n=n.angleAndHeight),H.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,g$);sf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,_$);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Z0t(e,t,n)):Q0t(e,t,n)}var $0t=new he;function Z0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,$0t).height;if(a-s-1<O.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let l=o.canvas,u=OAe;u.x=l.clientWidth/2,u.y=l.clientHeight/2;let f=r.getPickRay(u,TG),h,p=Zn.rayEllipsoid(f,i);if(c(p))h=mn.getPoint(f,p.start,JB);else if(a>e._minimumTrackBallHeight){let A=Zn.grazingAltitudeLocation(f,i);if(!c(A))return;let C=i.cartesianToCartographic(A,_$);C.height=0,h=i.cartographicToCartesian(C,JB)}else{e._looking=!0;let A=e._ellipsoid.geodeticSurfaceNormal(r.position,g$);sf(e,t,n,A),H.clone(t,e._tiltCenterMousePosition);return}let g=Ot.eastNorthUpToFixedFrame(h,i,RAe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=B.clone(r.transform,MAe);r._setTransform(g),rf(e,t,n,d.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=y;let x=y.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function Q0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,l,u;if(H.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,JB);else{if(a=Eg(e,t,JB),!c(a)){if(l=r.getPickRay(t,TG),u=Zn.rayEllipsoid(l,i),!c(u)){if(i.cartesianToCartographic(r.position,_$).height<=e._minimumTrackBallHeight){e._looking=!0;let w=e._ellipsoid.geodeticSurfaceNormal(r.position,g$);sf(e,t,n,w),H.clone(t,e._tiltCenterMousePosition)}return}a=mn.getPoint(l,u.start,JB)}s&&(c(l)||(l=r.getPickRay(t,TG)),xAe(e,l,a,a)),H.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=OAe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,l=r.getPickRay(h,TG);let p=d.magnitude(a),g=d.fromElements(p,p,p,d$),m=ie.fromCartesian3(g,h$);if(u=Zn.rayEllipsoid(l,m),!c(u))return;let y=d.magnitude(l.origin)>p?u.start:u.stop,b=mn.getPoint(l,y,W0t),x=Ot.eastNorthUpToFixedFrame(a,i,RAe),A=Ot.eastNorthUpToFixedFrame(b,m,q0t),C=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=B.clone(r.transform,MAe);r._setTransform(A);let M=d.cross(b,r.positionWC,xG);if(d.dot(r.rightWC,M)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let w=r.constrainedAxis;r.constrainedAxis=void 0,rf(e,t,n,v,!0,!1),r.constrainedAxis=w}else rf(e,t,n,v,!0,!1);if(r._setTransform(x),rf(e,t,n,v,!1,!0),c(r.constrainedAxis)){let _=d.cross(r.direction,r.constrainedAxis,xG);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,r.right)<0&&d.negate(_,_),d.cross(_,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(P),e._globe=C,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let F=d.clone(r.positionWC,xG);if(e.enableCollisionDetection&&y$(e,!0),!d.equals(r.positionWC,F)){r._setTransform(A),r.worldToCameraCoordinatesPoint(F,F);let _=d.magnitudeSquared(F);d.magnitudeSquared(r.position)>_&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(_),r.position));let w=d.angleBetween(F,r.position),D=d.cross(F,r.position,F);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,Y0t),N=J.fromQuaternion(I,X0t);J.multiplyByVector(N,r.direction,r.direction),J.multiplyByVector(N,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(P)}}var J0t=new H,ebt=new H,pAe=new mn,_Ae=new mn,tbt=new d,nbt=new d;function sf(e,t,n,i){let r=e._scene.camera,s=J0t;s.x=n.startPosition.x,s.y=0;let a=ebt;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,pAe),u=r.getPickRay(a,_Ae),f=0,h,p;r.frustum instanceof on?(h=l.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=l.direction,p=u.direction);let g=d.dot(h,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(c(i)?r.look(i,-f):c(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,pAe),u=r.getPickRay(a,_Ae),f=0,r.frustum instanceof on?(h=l.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=l.direction,p=u.direction),g=d.dot(h,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,c(i)){let y=r.direction,b=d.negate(i,tbt),x=d.equalsEpsilon(y,i,O.EPSILON2),A=d.equalsEpsilon(y,b,O.EPSILON2);if(!x&&!A){g=d.dot(y,i);let C=O.acosClamped(g);f>0&&f>C&&(f=C-O.EPSILON4),g=d.dot(y,b),C=O.acosClamped(g),f<0&&-f>C&&(f=-C+O.EPSILON4);let S=d.cross(i,y,nbt);r.look(S,f)}else(x&&f<0||A&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function ibt(e){Tl(e,e.enableRotate,e.rotateEventTypes,B0t,e.inertiaSpin,"_lastInertiaSpinMovement"),Tl(e,e.enableZoom,e.zoomEventTypes,IAe,e.inertiaZoom,"_lastInertiaZoomMovement"),Tl(e,e.enableTilt,e.tiltEventTypes,K0t,e.inertiaSpin,"_lastInertiaTiltMovement"),Tl(e,e.enableLook,e.lookEventTypes,sf)}var obt=new B,rbt=new he;function y$(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=n.ellipsoid??ie.WGS84,s=n.mapProjection,a,l;B.equals(o.transform,B.IDENTITY)||(a=B.clone(o.transform,obt),l=d.magnitude(o.position),o._setTransform(B.IDENTITY));let u=rbt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(c(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}c(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(l,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}e3.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 sbt=new d,abt=new d;e3.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;B.equals(t.transform,B.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ie.default):(this._globe=void 0,this._ellipsoid=ie.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Dr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Dr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Dr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&c(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=d.clone(t.positionWC,sbt),l=d.clone(t.directionWC,abt);if(i===oe.SCENE2D?r0t(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,P0t(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,ibt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(l,t.directionWC);y$(this,u)}this._aggregator.reset()};e3.prototype.isDestroyed=function(){return!1};e3.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),de(this)};var t3=e3;var n3=`uniform sampler2D colorTexture; +`,s=new Ur({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new df({name:"czm_edge_detection_composite",stages:[t,s]})}fs.createSilhouetteStage=function(e){let t=bkt(e),n=new Ur({name:"czm_silhouette_color_edges",fragmentShader:gV,uniforms:{silhouetteTexture:t.name}});return new df({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};fs.isSilhouetteSupported=function(e){return e.context.depthTexture};fs.createBloomStage=function(){let e=new Ur({name:"czm_bloom_contrast_bias",fragmentShader:oV,uniforms:{contrast:128,brightness:-.3}}),t=nae("czm_bloom_blur"),n=new df({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ur({name:"czm_bloom_generate_composite",fragmentShader:iV,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new df({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};fs.createAmbientOcclusionStage=function(){let e=new Ur({name:"czm_ambient_occlusion_generate",fragmentShader:eV,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ur({name:"czm_ambient_occlusion_composite",fragmentShader:tV,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 df({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var xkt=`#define FXAA_QUALITY_PRESET 39 +${_V} +${fV}`;fs.createFXAAStage=function(){return new Ur({name:"czm_FXAA",fragmentShader:xkt,sampleMode:md.LINEAR})};fs.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=Qz,new Ur({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=lV,new Ur({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=uV,new Ur({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=pV,new Ur({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=hV,new Ur({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};fs.createAutoExposureStage=function(){return new yV};fs.createBlackAndWhiteStage=function(){return new Ur({name:"czm_black_and_white",fragmentShader:nV,uniforms:{gradations:5}})};fs.createBrightnessStage=function(){return new Ur({name:"czm_brightness",fragmentShader:rV,uniforms:{brightness:.5}})};fs.createNightVisionStage=function(){return new Ur({name:"czm_night_vision",fragmentShader:mV})};fs.createDepthViewStage=function(){return new Ur({name:"czm_depth_view",fragmentShader:aV})};fs.createLensFlareStage=function(){return new Ur({name:"czm_lens_flare",fragmentShader:dV,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var pd=fs;function dy(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function bV(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function iae(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[bV(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[bV(d)]=!0)}}}return i.name}function AV(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=AV(e,t,n,p,r):a=iae(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=bV(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=bV(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[bV(i.get(p))]=!0}return a}function Tkt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=AV(e,t,n,i,void 0);a=AV(e,t,n,r,a),a=iae(e,t,n,o,a),a=AV(e,t,n,e,a),iae(e,t,n,s,a)}else AV(e,t,n,e,void 0);return n}function Ekt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new ai({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function Ckt(e,t){let n=Tkt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Ekt(e,i,n[i]))}function rae(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function vkt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new li({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}dy.prototype.updateDependencies=function(){this._updateDependencies=!0};dy.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=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||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(rae(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Ckt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,rae(this),vkt(this,e))};dy.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};dy.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};dy.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};dy.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){return rae(this),ue(this)};var EC=dy;var AFe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(AFe);var hy=AFe;var oae=[];function Au(){let e=pd.createFXAAStage(),t=pd.createAmbientOcclusionStage(),n=pd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=pd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=hy.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new EC(this),o={},s=oae;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}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=o,this._textureCache=r}Object.defineProperties(Au.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,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.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 sae(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 r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.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 hy.REINHARD:n=pd.createReinhardTonemappingStage(t);break;case hy.MODIFIED_REINHARD:n=pd.createModifiedReinhardTonemappingStage(t);break;case hy.FILMIC:n=pd.createFilmicTonemappingStage(t);break;case hy.PBR_NEUTRAL:n=pd.createPbrNeutralTonemappingStage(t);break;default:n=pd.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 sae(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}Au.prototype.add=function(e){let t=this._stageNames,n=oae;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Au.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=oae;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Au.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Au.prototype.get=function(e){return sae(this),this._stages[e]};Au.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Au.prototype.getStageByName=function(e){return this._stageNames[e]};Au.prototype.update=function(e,t,n){sae(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[s++]=x)}r.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(r[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:Ke.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new jt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&s++}a=s!==r.length,a&&this.update(e,t,n)};Au.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function CC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Au.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return CC(t)};function H0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){H0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)H0(e.get(o),t,CC(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)H0(e.get(o),t,n,i,r)}Au.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&a.ready&&(H0(a,e,A,n,i),A=CC(a)),p&&c.ready&&(H0(c,e,A,n,i),A=CC(c)),g&&u.ready&&H0(u,e,A,n,i),m&&f.ready&&(H0(f,e,A,n,i),A=CC(f));let b=A;if(o>0){H0(r[0],e,A,n,i);for(let x=1;x<o;++x)H0(r[x],e,CC(r[x-1]),n,i);b=CC(r[o-1])}y&&s.ready&&H0(s,e,b,n,i)};Au.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ff,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Au.prototype.isDestroyed=function(){return!1};Au.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(),ue(this)};var xV=Au;function vC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}vC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};vC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof gn,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?r3t(this,e):f3t(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Skt=new h,wkt=new h,Ikt=new h,Pkt=new h,Dkt=new h,Rkt=new h,Okt=new h,Mkt=new he,Nkt=new N,Lkt=new Ki,Fkt=new gn,Bkt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};vC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(N.IDENTITY);let i=Skt,r=wkt,o=Ikt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,Okt),d=At.eastNorthUpToFixedFrame(f,t,Nkt);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,Mkt),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=Fkt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Lkt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=Bkt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=h3t(a);TV(this,c),this._previousMode===re.SCENE2D?d3t(this,e,a,c):(a.position2D=N.multiplyByPoint(Or.TRANSFORM_2D,i,Pkt),a.direction2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,r,Dkt),a.up2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,Rkt),n._mode=re.MORPHING,DFe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var lae={position:new h,direction:new h,up:new h,frustum:void 0},xFe=new Ki;vC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===re.SCENE2D)Xkt(this,e,t);else{let i;e>0?(i=lae,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=TFe(this,t);let r,o=n.camera;o.frustum instanceof gn?r=o.frustum.clone():(r=xFe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let s=OFe(i);TV(this,s),cae(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};vC.prototype.isDestroyed=function(){return!1};vC.prototype.destroy=function(){return fW(this),ue(this)};function TV(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ra(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,un.LEFT_DOWN),e._morphHandler.setInputAction(n,un.MIDDLE_DOWN),e._morphHandler.setInputAction(n,un.RIGHT_DOWN),e._morphHandler.setInputAction(n,un.WHEEL)}}function fW(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 kkt=new he,Ukt=new h,zkt=new N;function TFe(e,t){let n=e._scene,i=n.camera,r=lae,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,kkt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,Ukt),f=At.eastNorthUpToFixedFrame(u,t,zkt);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var Vkt=new h,jkt=new h,Hkt=new h,Gkt=new h,Wkt=new h,qkt=new h;function cae(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,Vkt),a=h.clone(o.direction,jkt),c=h.clone(o.up,Hkt),u=N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,n.position,Gkt),f=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.direction,Wkt),d=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.up,qkt);function p(m){Ih(s,u,m.time,o.position),Ih(a,f,m.time,o.direction),Ih(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:xs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){RFe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var Ykt=new gn,EFe=new h,CFe=new h,vFe=new h,uae=new h,SFe=new h,wFe=new h;function Xkt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=lae,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=TFe(e,n));let s;e._morphToOrthographic?(s=Ykt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=xFe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),o.frustum=s;let a=OFe(o);TV(e,a);let c;e._morphToOrthographic?c=function(){cae(e,t,o,a)}:c=function(){PFe(e,t,o,function(){cae(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,uae),complete:function(){i._mode=re.MORPHING,c()}})):c()}function Ih(e,t,n,i){return h.lerp(e,t,n,i)}function IFe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof gn)return;let a=s.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=D.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:xs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var Kkt=new h,$kt=new h,Jkt=new h,aae=new h,Zkt=new h,Qkt=new h,e3t=new ys,t3t=new pn,n3t=new h,i3t={position:void 0,direction:void 0,up:void 0,frustum:void 0};function r3t(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,Kkt),o=h.clone(i.direction,$kt),s=h.clone(i.up,Jkt),a=h.negate(h.UNIT_Z,Zkt),c=h.clone(h.UNIT_Y,Qkt),u=aae;if(t>0)h.clone(h.ZERO,aae),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,aae);let A=t3t;N.multiplyByPoint(Or.TRANSFORM_2D,r,A.origin),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,n3t);l(x)&&(N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=e3t;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=i3t;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=MFe(d);TV(e,p);function g(A){Ih(r,u,A.time,i.position),Ih(o,a,A.time,i.direction),Ih(s,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:xs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){IFe(e,t,d,m,p)}});e._currentTweens.push(y)}var bFe=new he,o3t={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ys},s3t={position:new h,direction:new h,up:new h,frustum:void 0},a3t=new h,c3t=new pn,l3t=new N,u3t=new h;function f3t(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=o3t;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,bFe),i.mapProjection.project(bFe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=c3t;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,u3t),m=At.eastNorthUpToFixedFrame(g,n,l3t);N.inverseTransformation(m,m),N.multiplyByPointAsVector(m,p,p),N.multiplyByPointAsVector(Or.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,a3t);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function s(d,p){d.position.x=p}N.multiplyByPoint(Or.TRANSFORM_2D,o.position,o.position2D),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o.direction,o.direction2D),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=s3t;N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=MFe(c);TV(e,u);function f(){IFe(e,t,o,s,u)}DFe(e,t,o,f)}function PFe(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=D.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:xs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function d3t(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,uae),a=h.clone(n.direction,SFe),c=h.clone(n.up,wFe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,EFe),d=h.clone(o.direction,CFe),p=h.clone(o.up,vFe);f.z=s.z;function g(y){Ih(f,s,y.time,o.position),Ih(d,a,y.time,o.direction),Ih(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:xs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():PFe(e,0,n,u)}function DFe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,EFe),a=h.clone(o.direction,CFe),c=h.clone(o.up,vFe),u=h.clone(n.position2D,uae),f=h.clone(n.direction2D,SFe),d=h.clone(n.up2D,wFe);function p(m){Ih(s,u,m.time,o.position),Ih(a,f,m.time,o.direction),Ih(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:xs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){RFe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function RFe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:xs.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function OFe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),fW(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function MFe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),fW(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function h3t(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),fW(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var EV=vC;var NFe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(NFe);var cr=NFe;var UFe=[Jr.SHIFT,Jr.CTRL,Jr.ALT,[Jr.SHIFT,Jr.CTRL],[Jr.SHIFT,Jr.ALT],[Jr.CTRL,Jr.ALT],[Jr.SHIFT,Jr.CTRL,Jr.ALT]];function Qa(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function m3t(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function LFe(e,t,n){let i=Qa(cr.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},un.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},un.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(m3t(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},un.PINCH_MOVE,t)}function FFe(e,t){let n=Qa(cr.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[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 U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},un.WHEEL,t)}function PP(e,t,n){let i=Qa(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime;r[i]=!1,o[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===cr.LEFT_DRAG?(c=un.LEFT_DOWN,u=un.LEFT_UP):n===cr.RIGHT_DRAG?(c=un.RIGHT_DOWN,u=un.RIGHT_UP):n===cr.MIDDLE_DRAG&&(c=un.MIDDLE_DOWN,u=un.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,r[i]=!0,s[i]=new Date,U.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){fae(Qa(n,void 0),e);for(let f of UFe){let d=Qa(n,f);fae(d,e)}},u,t)}function fae(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 BFe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function p3t(e,t,n){let i=n._isDown,r=!1,o=Qa(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,fae(c,n));if(!r)return;let s=n._pressTime,a=n._lastMovement[o];l(a)||(a=n._lastMovement[o]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[o]=!0,s[o]=new Date}function kFe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in cr)if(cr.hasOwnProperty(s)){let a=cr[s];if(l(a)){let c=Qa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in cr)if(cr.hasOwnProperty(a)){let c=cr[a];if(l(c)){let u=Qa(c,t);p3t(c,t,e),o[u]&&(n[u]?(BFe(i[u],r[u]),r[u].valid=!0,BFe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},un.MOUSE_MOVE,t)}function Ph(e){this._eventHandler=new ra(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,FFe(this,void 0),LFe(this,void 0,e),PP(this,void 0,cr.LEFT_DRAG),PP(this,void 0,cr.RIGHT_DRAG),PP(this,void 0,cr.MIDDLE_DRAG),kFe(this,void 0);for(let t of UFe)FFe(this,t),LFe(this,t,e),PP(this,t,cr.LEFT_DRAG),PP(this,t,cr.RIGHT_DRAG),PP(this,t,cr.MIDDLE_DRAG),kFe(this,t)}Object.defineProperties(Ph.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Qa(cr.WHEEL)]||!this._update[Qa(cr.WHEEL,Jr.SHIFT)]||!this._update[Qa(cr.WHEEL,Jr.CTRL)]||!this._update[Qa(cr.WHEEL,Jr.ALT)];return this._buttonsDown>0||e}}});Ph.prototype.isMoving=function(e,t){let n=Qa(e,t);return!this._update[n]};Ph.prototype.getMovement=function(e,t){let n=Qa(e,t);return this._movement[n]};Ph.prototype.getLastMovement=function(e,t){let n=Qa(e,t),i=this._lastMovement[n];if(i.valid)return i};Ph.prototype.isButtonDown=function(e,t){let n=Qa(e,t);return this._isDown[n]};Ph.prototype.getStartMousePosition=function(e,t){if(e===cr.WHEEL)return this._currentMousePosition;let n=Qa(e,t);return this._eventStartPosition[n]};Ph.prototype.getButtonPressTime=function(e,t){let n=Qa(e,t);return this._pressTime[n]};Ph.prototype.getButtonReleaseTime=function(e,t){let n=Qa(e,t);return this._releaseTime[n]};Ph.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Ph.prototype.isDestroyed=function(){return!1};Ph.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var CV=Ph;function dW(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Je(n),this._stopObject=Je(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(dW.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}}});dW.prototype.cancelTween=function(){this._tweens.remove(this)};function fp(){this._tweens=[]}Object.defineProperties(fp.prototype,{length:{get:function(){return this._tweens.length}}});fp.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new dW(this);let t=e.duration/kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/kn.SECONDS_PER_MILLISECOND,r=e.easingFunction??xs.LINEAR_NONE,o=e.startObject,s=new Lge(o);s.to(Je(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new dW(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};fp.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};fp.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};fp.prototype.addOffsetIncrement=function(e){e=e??H.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})};fp.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};fp.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};fp.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};fp.prototype.get=function(e){return this._tweens[e]};fp.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/kn.SECONDS_PER_MILLISECOND:xn();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var SC=fp;function SV(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=cr.LEFT_DRAG,this.zoomEventTypes=[cr.RIGHT_DRAG,cr.WHEEL,cr.PINCH],this.rotateEventTypes=cr.LEFT_DRAG,this.tiltEventTypes=[cr.MIDDLE_DRAG,cr.PINCH,{eventType:cr.LEFT_DRAG,modifier:Jr.CTRL},{eventType:cr.RIGHT_DRAG,modifier:Jr.CTRL}],this.lookEventTypes={eventType:cr.LEFT_DRAG,modifier:Jr.SHIFT};let t=e.ellipsoid??ee.default;this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.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 CV(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 SC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new h,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,D.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 g3t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function _3t(e){return U.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var y3t=.4;function A3t(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<y3t){let g=g3t(p,i),m=e.getLastMovement(t,n);if(!l(m)||_3t(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,a)}}}function b3t(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var zFe=[];function bu(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(zFe[0]=n,n=zFe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),b3t(e,o)):r<1&&A3t(s,f,d,r,i,e,o))}}var hW=new pn,x3t=new h,T3t=new U,E3t=new h,C3t=new U,v3t=new h,S3t=new h,w3t=new h,I3t=new h,ZFe=new h,P3t=new h,D3t=new h,R3t=new h,O3t=new h,M3t=new h,N3t=new h,L3t=new h,F3t=new h,B3t=new h,k3t=new h,wC=new h,VFe=new h,jFe=new h,dae={orientation:new wc};function bae(e,t,n,i,r,o){let s=1;l(o)&&(s=D.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=dae.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,v=e._rotatingZoom,S;if(T||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(S=A.getPickRay(t,hW).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=my(e,t,x3t)),l(S)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let I=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(v=!0),!T||v){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let L=A.position.x,_=h.subtract(R,O,E3t);h.normalize(_,_);let C=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,C*.5),(A.position.x<0&&L>0||A.position.x>0&&L<0)&&(S=A.getPickRay(t,hW).origin,S=h.fromElements(S.y,S.z,S.x),e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,ZFe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)I=!0;else{let O=y.canvas,L=C3t;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=my(e,L,v3t);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=D3t;h.clone(A.position,C);let w=e._zoomWorldPosition,P=P3t;if(P=h.normalize(w,P),h.dot(P,R)<0)return;let M=k3t,F=M3t;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,wC),M);let V=N3t,B=L3t;h.subtract(w,C,V),h.normalize(V,B);let j=h.dot(R,B);if(j>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-j),G=h.magnitude(C),q=h.magnitude(w),Q=G-m,W=h.magnitude(V),J=Math.asin(D.clamp(W/q*Math.sin(k),-1,1)),Z=Math.asin(D.clamp(Q/q*Math.sin(k),-1,1)),ae=J-Z+k,Ae=R3t;h.normalize(C,Ae);let fe=O3t;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,wC),F),h.multiplyByScalar(h.normalize(M,wC),h.magnitude(M)-m,M),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=F3t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,VFe),h.multiplyByScalar(F,Math.sin(ae),jFe),wC),Q,xe),h.add(C,xe,C),h.normalize(M,Ae),h.normalize(h.cross(Ae,fe,wC),F);let ge=B3t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,VFe),h.multiplyByScalar(F,Math.sin(ae),jFe),wC),h.magnitude(M),ge),h.add(M,ge,M),h.clone(C,A.position),h.normalize(h.subtract(M,C,wC),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(dae);return}else{let C=h.normalize(_,S3t),w=h.normalize(e._zoomWorldPosition,w3t),P=h.dot(w,C);if(P>0&&P<1){let M=D.acosClamped(P),F=h.cross(w,C,I3t),V=Math.abs(M)>D.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,B=m/V;A.rotate(F,M*B)}}}}e._rotatingZoom=!I}if(!T&&I||E){let R,O=hr.worldToWindowCoordinates(y,e._zoomWorldPosition,T3t);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,hW):R=A.getPickRay(t,hW);let L=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),A.move(L,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(dae)}var U3t=new pn,z3t=new pn,V3t=new h;function j3t(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,U3t).origin,s=r.getPickRay(n.endPosition,z3t).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,V3t),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function HFe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;bae(e,t,n,e.zoomFactor,r.getMagnitude())}var H3t=new U,G3t=new U;function GFe(e,t,n){if(l(n.angleAndHeight)){W3t(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=H3t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=G3t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;r.twistRight(p)}function W3t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function q3t(e){let t=e._scene.mapMode2D===yu.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(bu(e,e.enableTranslate,e.translateEventTypes,j3t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bu(e,e.enableZoom,e.zoomEventTypes,HFe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bu(e,e.enableRotate,e.tiltEventTypes,GFe,e.inertiaSpin,"_lastInertiaTiltMovement")):(bu(e,e.enableZoom,e.zoomEventTypes,HFe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bu(e,e.enableRotate,e.translateEventTypes,GFe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var QFe=new pn,Y3t=new h,X3t=new h;function my(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Y3t)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,QFe),u=r.pickWorldCoordinates(c,i,a,X3t),f=l(s)?h.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var K3t=new he;function bW(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,K3t);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var $3t=new h;function eBe(e,t){let n=t.origin,i=t.direction,r=bW(e),o=h.normalize(n,$3t),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function tBe(e,t,n,i){let r=h.distance(t.origin,n),o=bW(e),s=D.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),pn.getPoint(t,r,i)}function nBe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=bW(e))):r=bW(e),pn.getPoint(t,r,i)}var J3t=new U;function iBe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,J3t),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,xae(e,t,e._strafeStartPosition),t.endPosition=n}var WFe=new pn,Z3t=new pn,hae=new h,Q3t=new h,eUt=new h,tUt=new h,nUt=new sn(h.UNIT_X,0),iUt=new U,rUt=new U;function oUt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){_d(e,t,n);return}if(e._strafing){iBe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,iUt),a=U.clone(n.endPosition,rUt),c=r.getPickRay(s,WFe),u=h.clone(h.ZERO,tUt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=my(e,s,hae),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=nBe(e,c,d,hae)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,xae(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,nUt);c=r.getPickRay(s,WFe);let g=pi.rayPlane(c,p,hae),m=r.getPickRay(a,Z3t),y=pi.rayPlane(m,p,Q3t);if(!l(g)||!l(y)){e._looking=!0,_d(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,eUt),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>D.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var rBe=new U,gW=new pn,_W=new h,sUt=new h,oBe=new N,aUt=new N,cUt=new h,lUt=new sn(h.UNIT_X,0),mae=new h,_ae=new he,sBe=new N,uUt=new Le,fUt=new $,yW=new h;function dUt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){_d(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,hUt(e,t,n)):mUt(e,t,n)}function hUt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=rBe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,gW),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,_d(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,_W);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,_ae);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,oBe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=N.clone(r.transform,sBe);r._setTransform(b),gd(e,t,n,h.UNIT_Z),r._setTransform(E),e._globe=x,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function mUt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,_W);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=my(e,t,_W)),!l(s)){a=r.getPickRay(t,gW);let _=a.origin,C=a.direction,w,P=h.dot(c,C);if(Math.abs(P)>D.EPSILON6&&(w=-h.dot(c,_)/P),!l(w)||w<=0){e._looking=!0,_d(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,_W),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,gW)),tBe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=rBe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,gW);let d=h.clone(h.ZERO,cUt);d.x=s.x;let p=sn.fromPointNormal(d,c,lUt),g=pi.rayPlane(a,p,sUt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,_ae);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,oBe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,_ae),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,aUt)):x=b;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=N.clone(r.transform,sBe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,mae),mae),R=h.dot(r.right,I);if(gd(e,t,n,v,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,gd(e,t,n,v,!0,!1),r.constrainedAxis=C}else gd(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,yW);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,mae);if(e.enableCollisionDetection&&Cae(e,!0),!h.equals(r.positionWC,L)){r._setTransform(x),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),w=h.cross(L,r.position,L);h.normalize(w,w);let P=Le.fromAxisAngle(w,C,uUt),M=$.fromQuaternion(P,fUt);$.multiplyByVector(M,r.direction,r.direction),$.multiplyByVector(M,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(S)}}var aBe=new U,cBe=new pn,lBe=new h;function pUt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=aBe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,cBe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=my(e,a,lBe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=eBe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}bae(e,t,n,e.zoomFactor,g)}function gUt(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))bu(e,e.enableRotate,e.rotateEventTypes,gd,e.inertiaSpin,"_lastInertiaSpinMovement"),bu(e,e.enableZoom,e.zoomEventTypes,fBe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),bu(e,e.enableTilt,e.tiltEventTypes,dUt,e.inertiaSpin,"_lastInertiaTiltMovement"),bu(e,e.enableTranslate,e.translateEventTypes,oUt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bu(e,e.enableZoom,e.zoomEventTypes,pUt,e.inertiaZoom,"_lastInertiaZoomMovement"),bu(e,e.enableLook,e.lookEventTypes,_d),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var _Ut=new pn,yUt=new sn(h.UNIT_X,0),AUt=new h,bUt=new h;function xae(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,_Ut),s=h.clone(r.direction,bUt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,yUt),c=pi.rayPlane(o,a,AUt);l(c)&&(s=h.subtract(n,c,s),i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var qFe=new h,uBe=new he,yae=new h,Aae=new ee,xUt=new h,TUt=new h,EUt=new h;function CUt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){gd(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,xUt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)_d(e,t,n,u);else if(e._rotating)gd(e,t,n);else if(e._strafing)iBe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=yae,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Aae),gae(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,uBe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=my(e,n.startPosition,EUt);if(l(p)){let g,m=r.getPickRay(n.startPosition,QFe);if(o)g=!0,nBe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,TUt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,xae(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=yae,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Aae),gae(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,_d(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,qFe))?(gae(e,t,n,e._ellipsoid),h.clone(qFe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,gd(e,t,n)):(e._looking=!0,_d(e,t,n,u));U.clone(t,e._rotateMousePosition)}function gd(e,t,n,i,r,o){r=r??!1,o=o??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=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 m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(a.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||a.rotateRight(m),o||a.rotateUp(y),a.constrainedAxis=u}var pae=se.clone(se.UNIT_W),YFe=se.clone(se.UNIT_W),mW=new h,DP=new h,pW=new h,XFe=new h,vUt=new U,SUt=new U,wUt=new U,IUt=new U,PUt=new pn;function gae(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,vUt),a=U.clone(n.endPosition,SUt),c=i.cartesianToCartographic(o.positionWC,uBe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,pae),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=my(e,s,pae)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,DP),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),DP),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,IUt),y=U.subtract(a,s,wUt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,DP),b=h.normalize(o.positionWC,ZFe),x=o.getPickRay(a,PUt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,pW),pW),E=h.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let S=Math.abs(h.dot(o.directionWC,b)),I=-y.y*m.y*2/Math.sqrt(v)*(1-S),R=h.multiplyByScalar(x,I,pW);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,XFe);f=h.add(u,A,YFe),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,pae),f=o.pickEllipsoid(a,i,YFe)),!l(u)||!l(f)){e._rotating=!0,gd(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,mW);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,DP),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,pW);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/x),v=h.multiplyByScalar(d,T,XFe);h.subtract(f,v,v),h.normalize(v,v);let S=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(S=D.TWO_PI-S);let I=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(I=D.TWO_PI-I);let R=S-I,O;h.equalsEpsilon(d,o.position,D.EPSILON2)?O=o.right:O=h.cross(d,o.position,mW);let L=h.cross(d,O,mW),_=h.dot(L,h.subtract(u,d,DP)),C=h.dot(L,h.subtract(f,d,DP)),w;_>0&&C>0?w=E-A:_>0&&C<=0?h.dot(o.position,d)>0?w=-A-E:w=A+E:w=A-E,o.rotateRight(R),o.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,mW);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var DUt=new h,RUt=new he,KFe=0;function fBe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=aBe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,cBe),d,p=r.cartesianToCartographic(s.position,RUt).height,g=Math.abs(KFe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=my(e,u,lBe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(KFe=y),c){let b=eBe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,DUt);bae(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var dBe=new U,AW=new pn,vV=new h,OUt=new h,hBe=new N,MUt=new N,mBe=new N,NUt=new Le,LUt=new $,Tae=new he,Eae=new h;function FUt(e,t,n){let r=e._scene.camera;if(!N.equals(r.transform,N.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,Eae);_d(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Tae);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,kUt(e,t,n)):UUt(e,t,n)}var BUt=new he;function kUt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,BUt).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=dBe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,AW),d,p=pi.rayEllipsoid(f,i);if(l(p))d=pn.getPoint(f,p.start,vV);else if(a>e._minimumTrackBallHeight){let x=pi.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,Tae);T.height=0,d=i.cartographicToCartesian(T,vV)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Eae);_d(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,hBe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=N.clone(o.transform,mBe);o._setTransform(g),gd(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function UUt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,vV);else{if(a=my(e,t,vV),!l(a)){if(c=o.getPickRay(t,AW),u=pi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Tae).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Eae);_d(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,vV)}s&&(l(c)||(c=o.getPickRay(t,AW)),tBe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=dBe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,AW);let p=h.magnitude(a),g=h.fromElements(p,p,p,yae),m=ee.fromCartesian3(g,Aae);if(u=pi.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=pn.getPoint(c,y,OUt),b=At.eastNorthUpToFixedFrame(a,i,hBe),x=At.eastNorthUpToFixedFrame(A,m,MUt),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=N.clone(o.transform,mBe);o._setTransform(x);let I=h.cross(A,o.positionWC,yW);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,gd(e,t,n,v,!0,!1),o.constrainedAxis=C}else gd(e,t,n,v,!0,!1);if(o._setTransform(b),gd(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,yW);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,yW);if(e.enableCollisionDetection&&Cae(e,!0),!h.equals(o.positionWC,L)){o._setTransform(x),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),w=h.cross(L,o.position,L);h.normalize(w,w);let P=Le.fromAxisAngle(w,C,NUt),M=$.fromQuaternion(P,LUt);$.multiplyByVector(M,o.direction,o.direction),$.multiplyByVector(M,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(S)}}var zUt=new U,VUt=new U,$Fe=new pn,JFe=new pn,jUt=new h,HUt=new h;function _d(e,t,n,i){let o=e._scene.camera,s=zUt;s.x=n.startPosition.x,s.y=0;let a=VUt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,$Fe),u=o.getPickRay(a,JFe),f=0,d,p;o.frustum instanceof gn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,$Fe),u=o.getPickRay(a,JFe),f=0,o.frustum instanceof gn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,jUt),b=h.equalsEpsilon(y,i,D.EPSILON2),x=h.equalsEpsilon(y,A,D.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=D.acosClamped(g);f>0&&f>T&&(f=T-D.EPSILON4),g=h.dot(y,A),T=D.acosClamped(g),f<0&&-f>T&&(f=-T+D.EPSILON4);let E=h.cross(i,y,HUt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function GUt(e){bu(e,e.enableRotate,e.rotateEventTypes,CUt,e.inertiaSpin,"_lastInertiaSpinMovement"),bu(e,e.enableZoom,e.zoomEventTypes,fBe,e.inertiaZoom,"_lastInertiaZoomMovement"),bu(e,e.enableTilt,e.tiltEventTypes,FUt,e.inertiaSpin,"_lastInertiaTiltMovement"),bu(e,e.enableLook,e.lookEventTypes,_d)}var WUt=new N,qUt=new he;function Cae(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??ee.WGS84,s=n.mapProjection,a,c;N.equals(r.transform,N.IDENTITY)||(a=N.clone(r.transform,WUt),c=h.magnitude(r.position),r._setTransform(N.IDENTITY));let u=qUt;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}SV.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var YUt=new h,XUt=new h;SV.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;N.equals(t.transform,N.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ee.default):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=Ar.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=Ar.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=Ar.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,YUt),c=h.clone(t.directionWC,XUt);if(i===re.SCENE2D?q3t(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,gUt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,GUt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Cae(this,u)}this._aggregator.reset()};SV.prototype.isDestroyed=function(){return!1};SV.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var wV=SV;function IV(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ai({depthStencil:!0,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),this._passState=t}function KUt(e,t,n,i){let r=Math.max(n,i),o=r*r,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-s<=c&&c<=s&&-a<=u&&u<=a){let m=4*((a-u)*n+c+s),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}IV.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};IV.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ze.FLOAT,framebuffer:this._fb.framebuffer});return KUt(i,r,t,n)};IV.prototype.isDestroyed=function(){return!1};IV.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var PV=IV;var DV={},$Ut=new et(0,0,3,3),JUt=new U,ZUt=new U,QUt=new pn,ezt=new h,tzt=3,nzt=.1,pBe=9;function vae(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function gBe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&vae(s)<=tzt&&(t=Math.min(t,s.depth));let n=t*(1+nzt),i=e.filter(s=>!s.isEdge||s.depth<=n),r=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===r).reduce((s,a)=>vae(a)<vae(s)?a:s)}function _Be(e,t){let n,i=Number.POSITIVE_INFINITY;for(let r of e){if(r.isEdge||r.object!==t)continue;let o=r.x*r.x+r.y*r.y;o<i&&(n=r,i=o)}return n}function Sae(e,t,n){let i=JUt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,QUt);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let s=n.depth/o,a=h.multiplyByScalar(r.direction,s,ezt);return h.add(r.origin,a,new h)}DV.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:s}=e;if(!o.colorBufferFloat){_t("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new PV(o));let a=s.snapFramebuffer,c=$Ut;$z(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(Jz(e),u.length===0)return;let f=gBe(u);if(!l(f))return;let d=Sae(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=ZUt;g.x=t.x+f.x,g.y=t.y+f.y,$z(e,g,c,pBe,pBe,{framebuffer:a,snap:!0});let m=a.end(c);Jz(e);let y=_Be(m,f.object);p=l(y)?Sae(e,g,y):void 0}return{object:f.object,isEdge:f.isEdge,position:d,surfacePosition:p,screenPosition:new U(t.x+f.x,t.y+f.y)}};DV._selectBestHit=gBe;DV._nearestSurfaceHit=_Be;DV._snapHitToWorld=Sae;var RV=DV;var OV=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -9426,7 +10708,7 @@ float x = length(gl_FragCoord.xy - center) / radius; float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var i3=`uniform sampler2D colorTexture; +`;var MV=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -9447,46 +10729,51 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function Sg(){this._sceneFramebuffer=new QT;let e=.125,t=new Array(6);t[0]=new ho({fragmentShader:su,textureScale:e,forcePowerOfTwo:!0,sampleMode:ef.LINEAR});let n=t[1]=new ho({fragmentShader:i3,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new H,t[2]=new ho({fragmentShader:F0,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:F0,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:su,sampleMode:ef.LINEAR}),this._uCenter=new H,this._uRadius=void 0,t[5]=new ho({fragmentShader:n3,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new au({stages:t});let o=new rA(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Sg.prototype.get=function(e){return this._stages.get(e)};Sg.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 cbt=new se,LAe=new H,lbt=new H,NAe=new B;function ubt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,l=B.computeViewportTransformation(n,0,1,NAe),u=B.multiplyByPoint(r,o,cbt),f=Ot.pointToGLWindowCoordinates(s,l,o,LAe);u.x+=O.SOLAR_RADIUS;let h=Ot.pointToGLWindowCoordinates(a,l,u,u),p=H.magnitude(H.subtract(h,f,h))*30*2,g=lbt;g.x=p,g.y=p,e._uCenter=H.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,b=e._stages,x=b.get(0),A=x.outputTexture.width,C=x.outputTexture.height,S=new Ke;S.width=A,S.height=C,l=B.computeViewportTransformation(S,0,1,NAe),f=Ot.pointToGLWindowCoordinates(s,l,o,LAe),g.x*=A/m,g.y*=C/y;let v=x.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let P=1;P<4;++P)Ke.clone(v,b.get(P).scissorRectangle)}Sg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Sg.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),ubt(this,t,n),o};Sg.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)};Sg.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(su,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Sg.prototype.isDestroyed=function(){return!1};Sg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),de(this)};var o3=Sg;function FAe(){this._cachedShowFrustumsShaders={}}function fbt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function dbt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=He.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function py(){this._sceneFramebuffer=new yC;let e=.125,t=new Array(6);t[0]=new Ur({fragmentShader:ff,textureScale:e,forcePowerOfTwo:!0,sampleMode:md.LINEAR});let n=t[1]=new Ur({fragmentShader:MV,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new Ur({fragmentShader:Ub,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 Ur({fragmentShader:Ub,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 Ur({fragmentShader:ff,sampleMode:md.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new Ur({fragmentShader:OV,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new df({stages:t});let r=new EC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}py.prototype.get=function(e){return this._stages.get(e)};py.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 izt=new se,yBe=new U,rzt=new U,ABe=new N;function ozt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=N.computeViewportTransformation(n,0,1,ABe),u=N.multiplyByPoint(o,r,izt),f=At.pointToGLWindowCoordinates(s,c,r,yBe);u.x+=D.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=rzt;g.x=p,g.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,E=new et;E.width=x,E.height=T,c=N.computeViewportTransformation(E,0,1,ABe),f=At.pointToGLWindowCoordinates(s,c,r,yBe),g.x*=x/m,g.y*=T/y;let v=b.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let S=1;S<4;++S)et.clone(v,A.get(S).scissorRectangle)}py.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};py.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),ozt(this,t,n),r};py.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 r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};py.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(ff,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};py.prototype.isDestroyed=function(){return!1};py.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var NV=py;function bBe(){this._cachedShowFrustumsShaders={}}function szt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function azt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Ye.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { czm_Debug_main(); -`;let l;if(s>0)for(l=0;l<s;++l)a+=` out_FragData_${r[l]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${r[l]}.rgb *= debugShowFrustumsColor; +`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor; +`,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=fbt(i);return Jt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var r3=new G;function hbt(e,t){let n;return c(t.uniformMap)?n=t.uniformMap:n={},c(n.debugShowCommandsColor)||c(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(c(t._debugColor)||(t._debugColor=G.fromRandom()),t._debugColor):G.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(r3.red=t.debugOverlappingFrustums&1?1:0,r3.green=t.debugOverlappingFrustums&2?1:0,r3.blue=t.debugOverlappingFrustums&4?1:0,r3.alpha=1,r3):G.WHITE}),n}var mbt=new Qe;FAe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];c(o)||(o=dbt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=Qe.shallowClone(t,mbt);r.shaderProgram=o,r.uniformMap=hbt(e,t),r.execute(e.context,n)};var s3=FAe;function fA(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Dn}fA.fromKeyframeNode=function(e,t,n,i){T.typeOf.object("primitive",e),T.typeOf.number("tileIndex",t),T.typeOf.number("sampleIndex",n),T.typeOf.object("keyframeNode",i);let o=new fA(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=pbt(e,s,n),o._orientedBoundingBox=gbt(e,r,n,o._orientedBoundingBox),o};function pbt(e,t,n){if(!c(t)||!c(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let l=i[a],u=at.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[l]=f}return s}var BAe=new d,_bt=new d;function gbt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,l=Math.floor(a/o.x),u=a-l*o.x,f=d.fromElements(u,l,s,BAe),h=d.divideComponents(d.subtract(f,e._paddingBefore,BAe),e.dimensions,_bt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(fA.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()}}});fA.prototype.hasProperty=function(e){return c(this._metadata[e])};fA.prototype.getNames=function(){return Object.keys(this._metadata)};fA.prototype.getProperty=function(e){return this._metadata[e]};var a3=fA;var c3=`struct Ray { +`;a+="}",r.sources.push(a);let u=szt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var LV=new z;function czt(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=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(LV.red=t.debugOverlappingFrustums&1?1:0,LV.green=t.debugOverlappingFrustums&2?1:0,LV.blue=t.debugOverlappingFrustums&4?1:0,LV.alpha=1,LV):z.WHITE}),n}var lzt=new at;bBe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=azt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,lzt);o.shaderProgram=r,o.uniformMap=czt(e,t),o.execute(e.context,n)};var FV=bBe;function IC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}IC.fromKeyframeNode=function(e,t,n,i){let r=new IC(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=uzt(e,s,n),r._orientedBoundingBox=dzt(e,o,n,r._orientedBoundingBox),r};function uzt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=bt.getComponentCount(r[a]),f=o[a].slice(n*u,(n+1)*u);s[c]=f}return s}var xBe=new h,fzt=new h;function dzt(e,t,n,i){let r=t.dimensions,o=r.x*r.y,s=Math.floor(n/o),a=n-s*o,c=Math.floor(a/r.x),u=a-c*r.x,f=h.fromElements(u,c,s,xBe),d=h.divideComponents(h.subtract(f,e._paddingBefore,xBe),e.dimensions,fzt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(IC.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()}}});IC.prototype.hasProperty=function(e){return l(this._metadata[e])};IC.prototype.getNames=function(){return Object.keys(this._metadata)};IC.prototype.getProperty=function(e){return this._metadata[e]};var BV=IC;var TBe={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"};Object.freeze(TBe);var G0=TBe;function RP(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}RP.prototype.getTexture=function(e){return this._textures[e]};function hzt(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})}RP.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):hzt(this,e,t)};function mzt(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?xW(r,o,n):pzt(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function xW(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?CBe(e,n):new Dt({context:n,source:t,sampler:r});return EBe(r)&&o.generateMipmap(),o}function pzt(e,t,n){let{typedArray:i,sampler:r}=e,o=EBe(r),s=r.wrapS===hn.REPEAT||r.wrapS===hn.MIRRORED_REPEAT||r.wrapT===hn.REPEAT||r.wrapT===hn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(D.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let d=$M(i,a,c),p=Jy(d);return xW({sampler:r},p,n)}}else{let d=Jy(t);return xW(e,d,n)}else return xW(e,t,n);return o?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."),CBe(e,n)}function EBe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function CBe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}RP.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 r=n[i];mzt(this,r,t)}n.length=0};RP.prototype.isDestroyed=function(){return!1};RP.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 ue(this)};var kV=RP;function UV(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??__.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??zA.INHERIT,this._textureManager=new kV,this._defaultTexture=void 0,this.uniformMap=gzt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Azt(this),bzt(this)}function gzt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===G0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=_zt(e,i)):n[i]=yzt(e,i)}return n}function _zt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function yzt(e,t){return function(){return e.uniforms[t].value}}function PC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function Azt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,PC(o,t,r),r=e.usedVariablesVertex.featureIdSet,PC(o,n,r),r=e.usedVariablesVertex.metadataSet,PC(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,PC(s,t,r),r=e.usedVariablesFragment.featureIdSet,PC(s,n,r),r=e.usedVariablesFragment.metadataSet,PC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;PC(s,a,c)}}function vBe(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 Il(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${vBe(t)} is not available in the ${i} shader. Did you mean ${vBe(n)} instead?`;throw new pe(r)}}function bzt(e){let t=e.usedVariablesVertex.attributeSet;Il(t,"position","positionMC","vertex"),Il(t,"normal","normalMC","vertex"),Il(t,"tangent","tangentMC","vertex"),Il(t,"bitangent","bitangentMC","vertex"),Il(t,"positionWC","positionMC","vertex"),Il(t,"positionEC","positionMC","vertex"),Il(t,"normalEC","normalMC","vertex"),Il(t,"tangentEC","tangentMC","vertex"),Il(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Il(n,"position","positionEC","fragment"),Il(n,"normal","normalEC","fragment"),Il(n,"tangent","tangentEC","fragment"),Il(n,"bitangent","bitangentEC","fragment"),Il(n,"normalMC","normalEC","fragment"),Il(n,"tangentMC","tangentEC","fragment"),Il(n,"bitangentMC","bitangentEC","fragment")}UV.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===G0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};UV.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};UV.prototype.isDestroyed=function(){return!1};UV.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var W0=UV;function xzt(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Ke.RGBA,this.pixelDatatype=e.pixelDatatype??ze.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?hn.REPEAT:hn.CLAMP_TO_EDGE;this.sampler=new jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var zV=xzt;function Tzt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!Ezt(r?.[s],o?.[s]))continue;let a=Czt(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function Ezt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function Czt(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return vzt(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return Szt(e,i,r)}function vzt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new W0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +{ + material.diffuse = fsInput.metadata.${e}.rgb; + material.alpha = fsInput.metadata.${e}.a; +}`})}function Szt(e,t,n){let r=BM([new z(.267,.004,.329),new z(.282,.14,.457),new z(.254,.265,.53),new z(.207,.372,.553),new z(.164,.471,.558),new z(.128,.567,.551),new z(.135,.659,.518),new z(.194,.741,.443),new z(.282,.819,.369),new z(.396,.898,.301),new z(.538,.965,.236),new z(.741,.998,.149),new z(.993,1,.144)],128),o=new zV({typedArray:r,width:128,height:1});return new W0({uniforms:{u_colorMap:{type:G0.SAMPLER_2D,value:o},u_minimumValue:{type:G0.FLOAT,value:t[0]},u_maximumValue:{type:G0.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) + { + float value = fsInput.metadata.${e}; + vec3 voxelNormal = fsInput.attributes.normalEC; + float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); + float lighting = 0.5 + 0.5 * diffuse; + + if (value >= u_minimumValue && value <= u_maximumValue) { + float lerp = (value - u_minimumValue) / (u_maximumValue - u_minimumValue); + material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting; + material.alpha = 1.0; + } + }`})}var OP=Tzt;function wzt(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,de.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=TW(r[_]),P=`PropertyStatistics_${C}`,M=`PropertyStatistics_${C}`;n.addStruct(P,M,de.FRAGMENT),n.addStructField(P,w,"min"),n.addStructField(P,w,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=`PropertyStatistics_${C}`,P=C;n.addStructField(f,w,P)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,de.FRAGMENT);for(let _=0;_<c;_++){let C=TW(r[_]);n.addStructField(g,C,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,de.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",E="Voxel",v="voxel";n.addStruct(T,E,de.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let S="FragmentInput";n.addStruct(S,"FragmentInput",de.FRAGMENT),n.addStructField(S,d,p),n.addStructField(S,m,y),n.addStructField(S,b,x),n.addStructField(S,E,v);let R="Properties",O="Properties",L="properties";n.addStruct(R,O,de.FRAGMENT);for(let _=0;_<c;_++){let C=TW(r[_]);n.addStructField(R,C,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=TW(r[C],o[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${w}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = propertiesA.${w} + propertiesB.${w};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${O} scaleProperties(${O} ${L}, float scale)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = mix(propertiesA.${w}, propertiesB.${w}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${O} ${L}, inout ${m} ${y})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${y}.${w} = ${L}.${w};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C],P=r[C],M=bt.getComponentCount(P);for(let F=0;F<M;F++){let V=Pzt(P,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${SBe(B)};`,`${p}.${w}.max${V} = ${SBe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=r[C],P=o[C],M=Izt(w,P);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${L};`])}}function TW(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function Izt(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function SBe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Pzt(e,t){return e===bt.SCALAR?"":`[${t}]`}var VV=wzt;function dp(e){let{planes:t,modelMatrix:n=N.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=N.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?wBe:IBe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function wBe(e){return e===$t.OUTSIDE}function IBe(e){return e===$t.INSIDE}Object.defineProperties(dp.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?wBe:IBe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});dp.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};dp.prototype.get=function(e){return this._planes[e]};function PBe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}dp.prototype.contains=function(e){return PBe(this._planes,e)!==-1};dp.prototype.remove=function(e){let t=this._planes,n=PBe(t,e);if(n===-1)return!1;e instanceof aa&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof aa&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};dp.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof aa&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var Dzt=new sn(h.fromElements(1,0,0),0);function Rzt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=Mzt(i[o],t,Dzt);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var wae=new se,Ozt=new h;function Mzt(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,wae),s=N.multiplyByVector(t,o,wae),a=h.fromCartesian4(s,Ozt);return s=se.divideByScalar(s,h.magnitude(a),wae),sn.fromCartesian4(s,n)}function DBe(e,t){return t.x=Math.min(e,kt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var Nzt=new U;dp.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=DBe(i,Nzt);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;Rzt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};dp.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=DBe(r,n);return o.y*=2,o};dp.prototype.isDestroyed=function(){return!1};dp.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var gy=dp;var jV=`struct Ray { vec3 pos; vec3 dir; -vec3 rawDir; }; -#if defined(JITTER) -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 l3=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +`;var HV=`#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 mat4 u_transformPositionViewToLocal; uniform mat3 u_transformDirectionViewToLocal; -uniform vec3 u_cameraPositionUv; +uniform vec3 u_cameraPositionLocal; +uniform vec3 u_cameraDirectionLocal; uniform float u_stepSize; #if defined(PICKING) uniform vec4 u_pickColor; @@ -9517,10 +10804,11 @@ 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) { -vec3 gradient = 2.0 * viewRay.rawDir * jacobianT; +vec3 gradient = viewRay.dir * jacobianT; vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient; RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay); -vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz); +vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz; +voxelNormal = normalize(czm_normal * voxelNormal); vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w); vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry); float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize; @@ -9549,57 +10837,65 @@ vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinat ivec3 sampleIndex = ivec3(floor(inputCoordinate)); return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z); } +Ray getViewRayLocal() { +vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord); +vec3 origin; +vec3 direction; +if (czm_orthographicIn3D == 1.0) { +eyeCoordinates.z = 0.0; +origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz; +direction = u_cameraDirectionLocal; +} else { +origin = u_cameraPositionLocal; +direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz); +} +return Ray(origin, direction); +} +Ray getViewRayEC() { +vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord); +vec3 viewPosEC = (czm_orthographicIn3D == 1.0) +? vec3(eyeCoordinates.xy, 0.0) +: vec3(0.0); +vec3 viewDirEC = normalize(eyeCoordinates.xyz); +return Ray(viewPosEC, viewDirEC); +} void main() { -vec4 fragCoord = gl_FragCoord; -vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; -vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); -vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); -vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); -vec3 viewPosUv = u_cameraPositionUv; -#if defined(SHAPE_ELLIPSOID) -vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv; -Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir); -#else -Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv); -#endif +Ray viewRayLocal = getViewRayLocal(); +Ray viewRayEC = getViewRayEC(); Intersections ix; -RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); +vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; +RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix); 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); +vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir; +TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC); +vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir; +mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal); 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); -currentT += noise * step.w; -positionUv += noise * step.w * viewDirUv; -#endif +traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas); +vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT); FragmentInput fragmentInput; #if defined(STATISTICS) -setStatistics(fragmentInput.metadata.statistics); +setStatistics(fragmentInput.metadataStatistics); #endif +czm_modelMaterial materialOutput; vec4 colorAccum = vec4(0.0); for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); 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.attributes.positionEC = positionEC; +fragmentInput.attributes.normalEC = normalize(step.xyz); +fragmentInput.voxel.viewDirUv = viewRayLocal.dir; fragmentInput.voxel.travelDistance = step.w; fragmentInput.voxel.stepCount = stepCount; fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex; fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]); -czm_modelMaterial materialOutput; +fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT; fragmentMain(fragmentInput, materialOutput); vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); color.rgb = max(color.rgb, vec3(0.0)); @@ -9610,10 +10906,9 @@ colorAccum.a = ALPHA_ACCUM_MAX; break; } if (step.w == 0.0) { -step.w == 0.00001; +step.w = 0.001; } currentT += step.w; -positionUv = viewPosUv + currentT * viewDirUv; if (currentT > endT) { #if (INTERSECTION_COUNT == 1) break; @@ -9624,13 +10919,15 @@ break; } else { currentT = shapeIntersection.entry.w; endT = shapeIntersection.exit.w; -positionUv = viewPosUv + currentT * viewDirUv; } #endif } -pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); -traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas); -step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); +positionEC = viewRayEC.pos + currentT * viewRayEC.dir; +tileAndUv = getTileAndUvCoordinate(positionEC); +positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir; +jacobianT = convertLocalToShapeSpaceDerivative(positionLocal); +traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas); +step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT); } colorAccum.a /= ALPHA_ACCUM_MAX; #if defined(PICKING) @@ -9649,7 +10946,7 @@ out_FragColor = vec4(megatextureId, sampleIndex); out_FragColor = colorAccum; #endif } -`;var u3=`in vec2 position; +`;var GV=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; void main() { vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; @@ -9658,7 +10955,7 @@ vec2 translation = 0.5 * (aabbMax + aabbMin); vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var f3=`#define NO_HIT (-czm_infinity) +`;var WV=`#define NO_HIT (-czm_infinity) #define INF_HIT (czm_infinity * 0.5) struct RayShapeIntersection { vec4 entry; @@ -9693,6 +10990,7 @@ return RayShapeIntersection(entry, exit); } struct Intersections { vec4 intersections[INTERSECTION_COUNT * 2]; +float distanceToDepthBuffer; #if (INTERSECTION_COUNT > 1) int index; int surroundCount; @@ -9738,1110 +11036,1649 @@ const int passCount = INTERSECTION_COUNT * 2; if (ix.index == passCount) { return shapeIntersection; } -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; +for (int i = 0; i < passCount; ++i) { +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 = intersectionType % 2 == 0; +ix.surroundCount += enter ? +1 : -1; +ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; +if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { +shapeIntersection.entry = surfaceIntersection; +} +bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; +bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; +if (exitPositive || enterNegativeFromPositive) { +shapeIntersection.exit = surfaceIntersection; +if (exitPositive) { +ix.index = passCount; +} +break; +} +} +return shapeIntersection; +} +#endif +`;var qV=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); +float entry; +float exit; +if (logDepthOrDepth != 0.0) { +vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); +eyeCoordinateDepth /= eyeCoordinateDepth.w; +entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir); +exit = +INF_HIT; +} else { +entry = NO_HIT; +exit = NO_HIT; +} +ix.distanceToDepthBuffer = entry; +#if defined(DEPTH_TEST) +setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); +#endif +} +`;var YV=`uniform sampler2D u_clippingPlanesTexture; +uniform mat4 u_clippingPlanesMatrix; +vec4 intersectPlane(in Ray ray, in vec4 plane) { +vec3 n = plane.xyz; +float w = plane.w; +float a = dot(ray.pos, n); +float b = dot(ray.dir, n); +float t = -(w + a) / b; +return vec4(n, t); +} +#ifdef CLIPPING_PLANES +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) +vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0); +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); +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); +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 +} +#endif +`;var MP=`vec4 transformNormalToEC(in vec4 intersection) { +return vec4(normalize(czm_normal * intersection.xyz), intersection.w); +} +RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { +return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit)); +} +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] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false)); +intersections[1] = transformNormalsToEC(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); +bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true); +farSide = transformNormalToEC(farSide); +if (hitPositiveSide) { +intersection = transformNormalToEC(intersection); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w); +intersections[1].entry = intersection; +intersections[1].exit = farSide; +} else { +vec4 miss = vec4(normalize(czm_normal * 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) +{ +vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); +vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); +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) { +return transformNormalsToEC(RayShapeIntersection(first, last)); +} else if (!exitFromInside && enterFromOutside) { +return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first)); +} else if (exitFromInside && !enterFromOutside) { +return transformNormalsToEC(RayShapeIntersection(last, farSide)); +} else { +return transformNormalsToEC(RayShapeIntersection(miss, miss)); +} +} +`;var XV=`uniform sampler2D u_renderBoundPlanesTexture; +RayShapeIntersection intersectBoundPlanes(in Ray ray) { +vec4 lastEntry = vec4(ray.dir, -INF_HIT); +vec4 firstExit = vec4(-ray.dir, +INF_HIT); +for (int i = 0; i < 6; i++) { +vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i); +vec4 intersection = intersectPlane(ray, boundPlane); +if (dot(ray.dir, boundPlane.xyz) < 0.0) { +lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry; +} else { +firstExit = intersection.w < firstExit.w ? intersection: firstExit; +} +} +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); +} +} +void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) +{ +RayShapeIntersection intersection = intersectBoundPlanes(rayEC); +setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +} +`;var KV=`uniform vec2 u_cylinderRenderRadiusMinMax; +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) +uniform vec2 u_cylinderRenderAngleMinMax; +#endif +uniform sampler2D u_renderBoundPlanesTexture; +RayShapeIntersection intersectBoundPlanes(in Ray ray) { +vec4 lastEntry = vec4(ray.dir, -INF_HIT); +vec4 firstExit = vec4(-ray.dir, +INF_HIT); +for (int i = 0; i < 2; i++) { +vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i); +vec4 intersection = intersectPlane(ray, boundPlane); +if (dot(ray.dir, boundPlane.xyz) < 0.0) { +lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry; +} else { +firstExit = intersection.w < firstExit.w ? intersection: firstExit; +} +} +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); +} +} +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; +vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0); +vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0); +vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1); +vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2); +return RayShapeIntersection(intersect1, intersect2); +} +RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius) +{ +RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true); +RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC); +return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection); +} +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) +{ +RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y); +setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); +if (outerIntersect.entry.w == NO_HIT) { +return; +} +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) +RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); +setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); +setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); +setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); +setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +#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 $V=`#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 height, in bool convex) +{ +vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height); +vec3 position = ray.pos * radiiCorrection; +vec3 direction = ray.dir * radiiCorrection; +float a = dot(direction, direction); +float b = dot(direction, position); +float c = dot(position, position) - 1.0; +float determinant = b * b - a * c; +if (determinant < 0.0) { +vec4 miss = vec4(normalize(direction), NO_HIT); +return RayShapeIntersection(miss, miss); +} +determinant = sqrt(determinant); +float signB = b < 0.0 ? -1.0 : 1.0; +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 * (position + tmin * direction); +vec3 d2 = directionScale * (position + tmax * direction); +vec3 normal1 = normalize(czm_normal * d1); +vec3 normal2 = normalize(czm_normal * d2); +return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax)); } -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; -if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { -shapeIntersection.entry = surfaceIntersection; +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; +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) { +return (b == 0.0) +? vec2(NO_HIT) +: vec2(-0.5 * c / b, NO_HIT); } -bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; -bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; -if (exitPositive || enterNegativeFromPositive) { -shapeIntersection.exit = surfaceIntersection; -if (exitPositive) { -ix.index = passCount; +determinant = sqrt(determinant); +float signB = b < 0.0 ? -1.0 : 1.0; +float t1 = (-b - signB * determinant) / a; +float t2 = c / (a * t1); +float tmin = min(t1, t2); +float tmax = max(t1, t2); +return vec2(tmin, tmax); } -break; +vec3 getConeNormal(in vec3 p, in bool convex) { +vec2 radial = -abs(p.z) * normalize(p.xy); +float zSign = (p.z < 0.0) ? -1.0 : 1.0; +float z = length(p.xy) * zSign; +float flip = (convex) ? -1.0 : 1.0; +return normalize(vec3(radial, z) * flip); } +float getLatitudeConeShift(in float sinLatitude) { +float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; +float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2); +return primeVerticalRadius * u_eccentricitySquared * sinLatitude; } -return shapeIntersection; +void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { +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); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = farSide; +intersections[1].entry = miss; +intersections[1].exit = miss; +if (intersect.x == NO_HIT) { +return; } -#endif -`;var d3=`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) { -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)); +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) { +} else if (p0InShadowCone) { +intersections[0].exit = intersect1; +} else if (p1InShadowCone) { +intersections[0].entry = intersect0; } else { -setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); +intersections[0].exit = intersect0; +intersections[1].entry = intersect1; +intersections[1].exit = farSide; } } -`;var h3=`uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; -vec4 intersectPlane(in Ray ray, in vec4 plane) { -vec3 n = plane.xyz; -float w = plane.w; -float a = dot(ray.pos, n); -float b = dot(ray.dir, n); -float t = -(w + a) / b; -return vec4(n, t); +RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { +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); } -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) -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; +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 { -lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; -} +return RayShapeIntersection(intersect0, intersect1); } -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; } +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { +RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); +setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); +if (outerIntersect.entry.w == NO_HIT) { +return; } -if (lastTransmission.w < firstReflection.w) { -clippingVolume.entry = lastTransmission; -clippingVolume.exit = firstReflection; +RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); +if (innerIntersect.entry.w == NO_HIT) { +setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); } else { -clippingVolume.entry = vec4(-ray.dir, NO_HIT); -clippingVolume.exit = vec4(ray.dir, NO_HIT); +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); +setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); +setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); +setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); } -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); +#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 +#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 +#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 Rw=`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); +`;var DC=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { +intersectShape(ray, rayEC, ix); +RayShapeIntersection intersection = getFirstIntersection(ix); +if (intersection.entry.w == NO_HIT) { +return intersection; +} +#if defined(CLIPPING_PLANES) +intersectClippingPlanes(ray, ix); +#endif +intersectDepth(screenCoord, rayEC, ix); +#if (INTERSECTION_COUNT > 1) +initializeIntersections(ix); +for (int i = 0; i < INTERSECTION_COUNT; ++i) { +intersection = nextIntersection(ix); +if (intersection.exit.w > 0.0) { +intersection.entry.w = max(intersection.entry.w, 0.0); +break; } -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); } +#else +intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +return 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); +`;var JV=`uniform vec3 u_boxLocalToShapeUvScale; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +uniform mat3 u_boxEcToXyz; +mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) { +return mat3(1.0); } -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; +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +return shapeUv / u_boxLocalToShapeUvScale; +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 dPosition = u_boxEcToXyz * positionEC; +return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1)); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); +} +`;var ZV=`uniform vec3 u_cylinderLocalToShapeUvScale; +uniform float u_cylinderShapeUvAngleRangeOrigin; +uniform mat3 u_cylinderEcToRadialTangentUp; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +uniform vec3 u_cameraShapePosition; +mat3 convertLocalToShapeSpaceDerivative(in vec3 position) { +vec3 radial = normalize(vec3(position.xy, 0.0)); +vec3 z = vec3(0.0, 0.0, 1.0); +vec3 east = normalize(vec3(-position.y, position.x, 0.0)); +return mat3(radial, east / length(position.xy), z); } -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; +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float radius = shapeUv.x / u_cylinderLocalToShapeUvScale.x; +float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvScale.y; +float height = shapeUv.z / u_cylinderLocalToShapeUvScale.z; +return vec3(radius, angle, height); } +vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) { +float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x); +vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle)); +float sinHalfAngle = sin(dAngle / 2.0); +float versine = 2.0 * sinHalfAngle * sinHalfAngle; +float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine; +return vec2(dRadial, dAngle); +} +vec3 convertEcToDeltaShape(in vec3 positionEC) { +vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC; +vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x); +return vec3(dPolar.xy, rtu.z); +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 deltaShape = convertEcToDeltaShape(positionEC); +float dx = u_cylinderLocalToShapeUvScale.x * deltaShape.x; +float dy = deltaShape.y / czm_twoPi; +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) +float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi; +float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin); +float rawOutputUvAngle = cameraUvAngleShift + dy; +float rotation = floor(rawOutputUvAngle); +dy -= rotation; +#endif +dy *= u_cylinderLocalToShapeUvScale.y; +float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1; +tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate); +tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate); +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +if (tileCoordinate.y < 0) { +tileCoordinate.y += (maxTileCoordinate + 1); +} else if (tileCoordinate.y > maxTileCoordinate) { +tileCoordinate.y -= (maxTileCoordinate + 1); } -RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) -{ -vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); -vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); -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) { -return RayShapeIntersection(first, last); -} else if (!exitFromInside && enterFromOutside) { -return RayShapeIntersection(-1.0 * farSide, first); -} else if (exitFromInside && !enterFromOutside) { -return RayShapeIntersection(last, farSide); -} else { -return RayShapeIntersection(miss, miss); +#else +tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +#endif +vec3 tileUv = tileUvSum - vec3(tileCoordinateChange); +tileUv.x = clamp(tileUv.x, 0.0, 1.0); +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0); +#else +tileUv.y = clamp(tileUv.y, 0.0, 1.0); +#endif +tileUv.z = clamp(tileUv.z, 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } +`;var QV=`uniform vec3 u_cameraPositionCartographic; +uniform vec2 u_ellipsoidCurvatureAtLatitude; +uniform mat3 u_ellipsoidEcToEastNorthUp; +uniform vec3 u_ellipsoidRadii; +uniform vec2 u_evoluteScale; +uniform vec3 u_ellipsoidInverseRadiiSquared; +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +uniform float u_ellipsoidShapeUvLongitudeRangeOrigin; +#endif +uniform vec3 u_ellipsoidLocalToShapeUvScale; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { +vec2 p = abs(pos); +vec2 inverseRadii = 1.0 / radii; +vec2 tTrigs = vec2(0.7071067811865476); +vec2 v = radii * tTrigs; +vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; +const int iterations = 3; +for (int i = 0; i < iterations; ++i) { +vec2 q = normalize(p - evolute) * length(v - evolute); +tTrigs = (q + evolute) * inverseRadii; +tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); +v = radii * tTrigs; +evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; } -`;var m3=`uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; -RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound) -{ -vec3 t0 = (minBound - ray.pos) / ray.dir; -vec3 t1 = (maxBound - ray.pos) / ray.dir; -vec3 entries = min(t0, t1); -vec3 exits = max(t0, t1); -vec3 directions = sign(ray.dir); -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 vec3(v * sign(pos), length(v - evolute)); } -return RayShapeIntersection(entry, exit); +mat3 convertLocalToShapeSpaceDerivative(in vec3 position) { +vec3 east = normalize(vec3(-position.y, position.x, 0.0)); +float distanceFromZAxis = length(position.xy); +vec2 posEllipse = vec2(distanceFromZAxis, position.z); +vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz); +vec2 surfacePoint = surfacePointAndRadius.xy; +vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz); +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)); +return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up); } -void intersectShape(in Ray ray, inout Intersections ix) -{ -RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); -setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float longitude = shapeUv.x * czm_twoPi; +#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +longitude /= u_ellipsoidLocalToShapeUvScale.x; +#endif +float latitude = shapeUv.y * czm_pi; +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) +latitude /= u_ellipsoidLocalToShapeUvScale.y; +#endif +float height = shapeUv.z / u_ellipsoidLocalToShapeUvScale.z; +return vec3(longitude, latitude, height); } -`;var p3=`uniform vec2 u_cylinderRenderRadiusMinMax; -uniform vec2 u_cylinderRenderHeightMinMax; -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) -uniform vec2 u_cylinderRenderAngleMinMax; +vec3 convertEcToDeltaShape(in vec3 positionEC) { +vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC; +float cosLatitude = cos(u_cameraPositionCartographic.y); +float sinLatitude = sin(u_cameraPositionCartographic.y); +float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x; +vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0); +vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x); +float dLongitude = atan(positionXY.y, positionXY.x); +float sinHalfLongitude = sin(dLongitude / 2.0); +float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude; +enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude); +float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y; +vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0); +vec2 positionZX = cameraZX + vec2(enu.z, enu.y); +float dLatitude = atan(positionZX.y, positionZX.x); +float sinHalfLatitude = sin(dLatitude / 2.0); +float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude; +float dHeight = enu.z + dz; +return vec3(dLongitude, dLatitude, dHeight); +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 deltaShape = convertEcToDeltaShape(positionEC); +float dx = deltaShape.x / czm_twoPi; +#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi; +float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin); +float rawOutputUvLongitude = cameraUvLongitudeShift + dx; +float rotation = floor(rawOutputUvLongitude); +dx -= rotation; +dx *= u_ellipsoidLocalToShapeUvScale.x; +#endif +float dy = deltaShape.y / czm_pi; +#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)) +dy *= u_ellipsoidLocalToShapeUvScale.y; +#endif +float dz = u_ellipsoidLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1; +tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate); +tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate); +#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +if (tileCoordinate.x < 0) { +tileCoordinate.x += (maxTileCoordinate + 1); +} else if (tileCoordinate.x > maxTileCoordinate) { +tileCoordinate.x -= (maxTileCoordinate + 1); +} +#else +tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +#endif +vec3 tileUv = tileUvSum - vec3(tileCoordinateChange); +#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0); +#else +tileUv.x = clamp(tileUv.x, 0.0, 1.0); +#endif +tileUv.y = clamp(tileUv.y, 0.0, 1.0); +tileUv.z = clamp(tileUv.z, 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); +} +`;var e4=`#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 -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; -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); +uniform ivec3 u_dimensions; +uniform ivec3 u_inputDimensions; +#if defined(PADDING) +uniform ivec3 u_paddingBefore; +#endif +struct OctreeNodeData { +int data; +int flag; +}; +struct TraversalData { +ivec4 octreeCoords; +int parentOctreeIndex; +}; +struct TileAndUvCoordinate { +ivec4 tileCoords; +vec3 tileUv; +}; +struct SampleData { +int megatextureIndex; +ivec4 tileCoords; +vec3 tileUv; +vec3 inputCoordinate; +#if (SAMPLE_COUNT > 1) +float weight; +#endif +}; +int normU8_toInt(in float value) { +return int(value * 255.0); } -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); +int normU8x2_toInt(in vec2 value) { +return int(value.x * 255.0) + 256 * int(value.y * 255.0); } -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); +float normU8x2_toFloat(in vec2 value) { +return float(normU8x2_toInt(value)) / 65535.0; } -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); +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; } -void intersectShape(Ray ray, inout Intersections ix) -{ -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; +OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { +int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; +int octreeCoordX = (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); } -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) -RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); -setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); -#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) -RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); +int getOctreeParentIndex(in int octreeIndex) { +int octreeCoordX = (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; +} +vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) { +int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w; +float scalar = exp2(-1.0 * float(levelDifference)); +vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar; +return tileAndUv.tileUv * scalar + originShift; +} +vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) { +vec3 tileUv = getTileUv(tileAndUv, octreeCoords); +return clamp(tileUv, vec3(0.0), vec3(1.0)); +} +void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) { +vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords); +vec3 inputCoordinate = tileUv * vec3(u_dimensions); +#if defined(PADDING) +inputCoordinate += vec3(u_paddingBefore); +#endif +#if defined(Y_UP_METADATA_ORDER) +#if defined(SHAPE_BOX) +float inputY = inputCoordinate.y; +inputCoordinate.y = inputCoordinate.z; +inputCoordinate.z = float(u_inputDimensions.z) - inputY; +#elif defined(SHAPE_CYLINDER) +float angle = inputCoordinate.y; +float height = inputCoordinate.z; +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +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 -#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 +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; +float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; +float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; +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; +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; +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); } -`;var _3=`#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); +OctreeNodeData traverseOctreeDownwards(in ivec4 tileCoordinate, inout TraversalData traversalData) { +OctreeNodeData childData; +for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { +int level = traversalData.octreeCoords.w + 1; +int levelDifference = tileCoordinate.w - level; +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +traversalData.octreeCoords = ivec4(coordinateAtLevel, level); +ivec3 childCoordinate = coordinateAtLevel & 1; +childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate); +if (childData.flag != OCTREE_FLAG_INTERNAL) { +break; } +traversalData.parentOctreeIndex = childData.data; } -RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex) -{ -vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight); -vec3 position = ray.pos * radiiCorrection; -vec3 direction = ray.dir * radiiCorrection; -float a = dot(direction, direction); -float b = dot(direction, position); -float c = dot(position, position) - 1.0; -float determinant = b * b - a * c; -if (determinant < 0.0) { -vec4 miss = vec4(normalize(direction), NO_HIT); -return RayShapeIntersection(miss, miss); +return childData; } -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -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)); +void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, 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(tileAndUv.tileCoords, traversalData); } -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; -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) { -return (b == 0.0) -? vec2(NO_HIT) -: vec2(-0.5 * c / b, NO_HIT); +#if (SAMPLE_COUNT == 1) +getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +#else +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); +#endif } -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -float t1 = (-b - signB * determinant) / a; -float t2 = c / (a * t1); -float tmin = min(t1, t2); -float tmax = max(t1, t2); -return vec2(tmin, tmax); +bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { +int levelDifference = tileCoordinate.w - octreeCoords.w; +if (levelDifference < 0) { +return false; } -vec3 getConeNormal(in vec3 p, in bool convex) { -vec2 radial = -abs(p.z) * normalize(p.xy); -float zSign = (p.z < 0.0) ? -1.0 : 1.0; -float z = length(p.xy) * zSign; -float flip = (convex) ? -1.0 : 1.0; -return normalize(vec3(radial, z) * flip); +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +return coordinateAtLevel == octreeCoords.xyz; } -float getLatitudeConeShift(in float sinLatitude) { -float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; -float primeVerticalRadius = inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; +void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { +ivec4 tileCoords = tileAndUv.tileCoords; +if (insideTile(tileCoords, traversalData.octreeCoords)) { +for (int i = 0; i < SAMPLE_COUNT; i++) { +addSampleCoordinates(tileAndUv, sampleDatas[i]); } -void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -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); -intersections[0].entry = -1.0 * farSide; -intersections[0].exit = farSide; -intersections[1].entry = miss; -intersections[1].exit = miss; -if (intersect.x == NO_HIT) { return; } -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) { -} 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; +for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { +traversalData.octreeCoords.xyz /= 2; +traversalData.octreeCoords.w -= 1; +if (insideTile(tileCoords, traversalData.octreeCoords)) { +break; } +traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); } -RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -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); +OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData); +#if (SAMPLE_COUNT == 1) +getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +#else +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); +#endif } -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); +`;var t4=`uniform ivec3 u_megatextureTileCounts; +vec3 index1DTo3DTexCoord(int index) +{ +int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y; +int iz = index / tilesPerZ; +int remainder = index - iz * tilesPerZ; +int iy = remainder / u_megatextureTileCounts.x; +int ix = remainder - iy * u_megatextureTileCounts.x; +return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts); } +Properties getPropertiesFromMegatexture(in SampleData sampleData) { +int tileIndex = sampleData.megatextureIndex; +vec3 voxelCoord = sampleData.inputCoordinate; +vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex); +vec3 tileDimensions = vec3(u_inputDimensions); +vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5)); +vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts); +return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv); } -void intersectShape(in Ray ray, inout Intersections ix) { -ray.pos = ray.pos * 2.0 - 1.0; -ray.dir *= 2.0; -RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); -if (outerIntersect.entry.w == NO_HIT) { +Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { +#if (SAMPLE_COUNT == 1) +return getPropertiesFromMegatexture(sampleDatas[0]); +#else +Properties properties = clearProperties(); +for (int i = 0; i < SAMPLE_COUNT; ++i) { +float weight = sampleDatas[i].weight; +if (weight > 0.0) { +Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); +tempProperties = scaleProperties(tempProperties, weight); +properties = sumProperties(properties, tempProperties); +} +} +return properties; +#endif +} +`;var RBe={Z_UP:0,Y_UP:1};Object.freeze(RBe);var q0=RBe;function Lzt(e){let t=new dg;this.shaderBuilder=t;let n=e._customShader,i=Ot(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,de.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",de.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([GV]),e.provider.metadataOrder===q0.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,de.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,de.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,de.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,de.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",e4,jV,t4,WV,YV,qV]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,de.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,de.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,de.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,de.FRAGMENT),u==="BOX"?t.addFragmentLines([JV,XV,DC]):u==="CYLINDER"?t.addFragmentLines([ZV,MP,KV,DC]):u==="ELLIPSOID"&&t.addFragmentLines([QV,MP,$V,DC]),t.addFragmentLines([HV]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,de.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,de.FRAGMENT),s===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,de.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,de.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,de.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,de.FRAGMENT)}var n4=Lzt;var OBe=new U;function Fzt(e,t){let n=new n4(e);VV(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(o>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=Is.getTextureResolution(r,t,OBe),S=MBe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}if(a>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=gy.getTextureResolution(s,t,OBe),S=MBe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}let c=i.clone();c.addDefine("PICKING",void 0,de.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,de.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ge.fromCache({cull:{enabled:!0,face:Vi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new at({vertexArray:m,primitiveType:Oe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=at.shallowClone(A,new at);b.shaderProgram=d,b.pickOnly=!0;let x=at.shallowClone(A,new at);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function MBe(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let s=`${r}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; + int pixX = planeNumber - (pixY * ${t}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${o}; + float v = (float(pixY) + 0.5) * ${s}; + return texture(packedPlanes, vec2(u, v));`}var i4=Fzt;function _y(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(_y.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});_y.fromMetadataArray=function(e){return new _y({metadata:e})};_y.fromGltf=async function(e){let t=new jf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new _y({loader:t})};_y.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:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=Bzt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function Bzt(e,t,n){let{className:i,names:r,types:o,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Lt.toComponentDatatype(s[f]),m=bt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}_y.prototype.isDestroyed=function(){return!1};_y.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var RC=_y;function Pl(){this._orientedBoundingBox=new en,this._boundingSphere=new ce,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=Pl.DefaultMinBounds.clone(),this._maxBounds=Pl.DefaultMaxBounds.clone(),this._renderMinBounds=Pl.DefaultMinBounds.clone(),this._renderMaxBounds=Pl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Pl,n=[new aa(h.negate(h.UNIT_X,new h),e.x),new aa(h.negate(h.UNIT_Y,new h),e.y),new aa(h.negate(h.UNIT_Z,new h),e.z),new aa(h.UNIT_X,-t.x),new aa(h.UNIT_Y,-t.y),new aa(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new gy({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Pl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var kzt=new h,Uzt=new h,zzt=new $,Vzt=new h,jzt=new h;Pl.prototype.update=function(e,t,n,i,r){i=i??t.clone(Vzt),r=r??n.clone(jzt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),s=h.clamp(n,i,r,this._renderMaxBounds),a=N.getScale(e,Uzt);if(o.x>s.x||o.y>s.y||o.z>s.z||(o.x===s.x)+(o.y===s.y)+(o.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=N.clone(e,this._shapeTransform),this._orientedBoundingBox=Dae(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(Iae(p.x,g.x),Iae(p.y,g.y),Iae(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function Iae(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var Hzt=new N;Pl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,Hzt),i=N.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};Pl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var EW=new h,Pae=new h;Pl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,s.x,a*t),D.lerp(o.y,s.y,a*n),D.lerp(o.z,s.z,a*i),EW),u=h.fromElements(D.lerp(o.x,s.x,a*(t+1)),D.lerp(o.y,s.y,a*(n+1)),D.lerp(o.z,s.z,a*(i+1)),Pae);return Dae(c,u,this._shapeTransform,r)};var NBe=new h;Pl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,NBe),s=h.multiplyByScalar(o,r,NBe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,EW),r,EW),c=h.add(a,s,Pae),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),EW),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Pae);return Dae(d,p,this._shapeTransform,i)};Pl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Pl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var LBe=new h;function Dae(e,t,n,i){let r=Pl.DefaultMinBounds,o=Pl.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=N.getTranslation(n,i.center),i.halfAxes=N.getMatrix3(n,i.halfAxes);else{let a=N.getScale(n,LBe),c=h.midpoint(e,t,kzt);i.center=N.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),LBe);let u=N.getRotation(n,zzt);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var OC=Pl;function yd(){this._orientedBoundingBox=new en,this._boundingSphere=new ce,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=yd.DefaultMinBounds.clone(),this._maxBounds=yd.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=yd,n=[new aa(h.negate(h.UNIT_Z,new h),e.z),new aa(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new gy({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,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_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(yd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var Gzt=new h,Wzt=new h,qzt=new h,Yzt=new h,Xzt=new h,Kzt=new N,$zt=new h,FBe=new U;yd.prototype.update=function(e,t,n,i,r){i=i??t.clone(Wzt),r=r??n.clone(qzt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=yd,a=s.y-o.y,c=.5*a,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),r.y=D.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,Yzt),p=h.minimumByComponent(n,r,Xzt),g=N.getScale(e,Gzt);if(p.x===0||d.x>p.x||d.z>p.z||D.equalsEpsilon(g.x,0,void 0,u)||D.equalsEpsilon(g.y,0,void 0,u)||D.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=N.clone(e,this._shapeTransform),this._orientedBoundingBox=Mae(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*a,b=p.y<d.y,x=p.y-d.y+b*a,T=x>=c-f&&x<a-f,E=x>f&&x<c-f,v=x<=f,S=T||E||v,I=this._shaderUniforms,R=this._shaderDefines;for(let q in R)R.hasOwnProperty(q)&&(R[q]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,A<a-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),I.cylinderRenderRadiusMinMax=U.fromElements(d.x,p.x,I.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let w=n.z-t.z,P=0,M=1;w!==0&&(P=1/w,M=-t.z*P),S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):E?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):v&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),I.cylinderRenderAngleMinMax=U.fromElements(d.y,p.y,I.cylinderRenderAngleMinMax));let F=(t.y-o.y)/a,V=(n.y-o.y)/a,B=1-A/a,j=(V+.5*B)%1;I.cylinderShapeUvAngleRangeOrigin=j;let k=0,G=1;if(A>f){k=a/A;let q=F-j;G=-k*(q-Math.floor(q))}return I.cylinderLocalToShapeUvScale=h.fromElements(_,k,P,I.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,G,M,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var Jzt=new $,Zzt=new $,Qzt=new N;yd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,Kzt),i=N.multiplyByPoint(n,e.camera.positionWC,$zt);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,FBe),FBe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],Jzt),s=e.context.uniformState.inverseView,a=N.multiplyTransformation(n,s,Qzt),c=N.getMatrix3(a,Zzt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};yd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*o.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*o.y+a.y,r=r*o.z+a.z,h.fromElements(n,i,r,t)};var CW=new h,Oae=new h;yd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,s.x,t*a),D.lerp(o.y,s.y,n*a),D.lerp(o.z,s.z,i*a),CW),u=h.fromElements(D.lerp(o.x,s.x,(t+1)*a),D.lerp(o.y,s.y,(n+1)*a),D.lerp(o.z,s.z,(i+1)*a),Oae);return Mae(c,u,this._shapeTransform,r)};var BBe=new h;yd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,BBe),s=h.multiplyByScalar(o,r,BBe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,CW),r,CW),c=h.add(a,s,Oae),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),CW),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Oae);return Mae(d,p,this._shapeTransform,i)};yd.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));yd.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var eVt=5,tVt=new Array(eVt),nVt=new h,iVt=new $,rVt=new N,oVt=new N,sVt=new N,Rae=new N,aVt=new h,cVt=new h,lVt=new h,UBe=new Array(8);for(let e=0;e<8;e++)UBe[e]=new h;function kBe(e,t,n){return Math.abs(se.dot(e,t))<n}function uVt(e){let t=N.getColumn(e,0,aVt),n=N.getColumn(e,1,cVt),i=N.getColumn(e,2,lVt),r=D.EPSILON4;return kBe(t,n,r)&&kBe(n,i,r)}function fVt(e,t){let n=UBe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)N.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var dVt=new h;function Mae(e,t,n,i){let r=e.x,o=t.x,s=e.y,a=t.y<s?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=tVt,g=0;p[g++]=s,p[g++]=a,p[g++]=d,f>D.PI&&(p[g++]=d-D.PI_OVER_TWO,p[g++]=d+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,B=Math.cos(V),j=Math.sin(V),k=B*r,G=j*r,q=B*o,Q=j*o;m=Math.min(m,k,q),y=Math.min(y,G,Q),A=Math.max(A,k,q),b=Math.max(b,G,Q)}let x=A-m,T=b-y,E=u-c,v=(m+A)*.5,S=(y+b)*.5,I=(c+u)*.5,R=h.fromElements(v,S,I,nVt),O=$.fromRotationZ(d,iVt),L=h.fromElements(x,T,E,dVt),_=N.fromScale(L,sVt),C=N.fromRotation(O,oVt),w=N.fromTranslation(R,rVt),P=N.multiplyTransformation(C,N.multiplyTransformation(w,_,Rae),Rae),M=N.multiplyTransformation(n,P,Rae);return uVt(M)?en.fromTransformation(M,i):fVt(M,i)}var MC=yd;function Dh(){this._orientedBoundingBox=new en,this._boundingSphere=new ce,this._boundTransform=new N,this._shapeTransform=new N,this._rectangle=new ie,this._minimumHeight=Dh.DefaultMinBounds.z,this._maximumHeight=Dh.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new U,ellipsoidCurvatureAtLatitude:new U,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new U,clipMinMaxHeight:new U},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_SHAPE_BOUNDS_LONGITUDE: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}Object.defineProperties(Dh.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var hVt=new h,mVt=new h,pVt=new h,gVt=new h,_Vt=new h,yVt=new h,AVt=new h,bVt=new h,zBe=new h,VBe=new h,xVt=new ie;Dh.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Dh;i=i??o,r=r??s;let a=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=N.getScale(e,bVt),p=h.clone(o,hVt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,mVt),m=h.clamp(n,p,s,pVt),y=h.clamp(i,p,s,gVt),A=h.clamp(r,p,s,_Vt),b=h.maximumByComponent(g,y,yVt),x=h.minimumByComponent(m,A,AVt),T=h.add(d,h.fromElements(m.z,m.z,m.z,zBe),zBe),E=h.add(d,h.fromElements(x.z,x.z,x.z,VBe),VBe);if(b.y>x.y||b.y===s.y||x.y===o.y||b.z>x.z||D.equalsEpsilon(E,h.ZERO,void 0,a))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=N.getTranslation(e,this._translation),this._rotation=N.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let v=ie.fromRadians(b.x,b.y,x.x,x.y,xVt);this._orientedBoundingBox=Nae(v,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=N.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let S=s.x-o.x,I=.5*S,R=x.x<b.x,O=x.x-b.x+R*S,L=O<=c,_=O>=I-c&&O<S-c,C=O>c&&O<I-c,w=L||_||C,P=m.x<g.x,M=m.x-g.x+P*S,F=M>I+c&&M<S-c,V=M>=I-c&&M<=I+c,B=M<I-c,j=F||V||B,k=x.y<-f,G=x.y>=-f&&x.y<=+f,q=x.y>+f&&x.y<s.y-u,Q=k||G||q,W=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ae=W||J||Z,Ae=Q||ae,fe=m.y-g.y,xe=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<s.y-u,Se=xe||ge||we,Re=g.y>o.y+u&&g.y<-f,Qe=g.y>=-f&&g.y<=+f,He=g.y>+f,$e=Se||(Re||Qe||He),Pe=this._shaderUniforms,qe=this._shaderDefines;for(let Xn in qe)qe.hasOwnProperty(Xn)&&(qe[Xn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:st,z:vt}=Pe.ellipsoidRadii,Gt=vt/st;Pe.eccentricitySquared=1-Gt*Gt,Pe.evoluteScale=U.fromElements((st*st-vt*vt)/st,(vt*vt-st*st)/vt,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let lt=0;qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,Pe.clipMinMaxHeight=U.fromElements(b.z-m.z,x.z-m.z,Pe.clipMinMaxHeight);let mt=m.z-g.z,ft=mt===0?0:1/mt;w&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,_?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):C?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):L&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),Pe.ellipsoidRenderLongitudeMinMax=U.fromElements(b.x,x.x,Pe.ellipsoidRenderLongitudeMinMax));let Xt=0,rt=1;if(j){qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Xn=(g.x-o.x)/S,Ai=(m.x-o.x)/S,Wi=1-M/S,wi=(Ai+.5*Wi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=wi,M>c){Xt=S/M;let di=Xn-wi;rt=-Xt*(di-Math.floor(di))}}Ae&&(ae&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,W?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):J?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):Z&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,k?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):G?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(b.y),Math.sin(x.y),Pe.ellipsoidRenderLatitudeSinMinMax));let ht=0,Bi=1;return $e&&(qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,fe>u&&(ht=(s.y-o.y)/fe,Bi=(o.y-g.y)/fe)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(Xt,ht,ft,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,Bi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=lt,!0};var TVt=new he,EVt=new h,CVt=new N,jBe=new $;Dh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,TVt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,EVt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,CVt),a=N.getRotation(s,jBe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,jBe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var KBe=new ie;Dh.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,s,c,a,u,KBe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return Nae(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var vVt=new U,SVt=new U,r4=new U,HBe=new U,GBe=new U,o4=new U;function wVt(e,t,n,i){let r=U.abs(e,vVt),o=U.fromElements(1/t.x,1/t.y,SVt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,r4),a=U.multiplyComponents(t,s,HBe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,GBe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,o4)),d=U.normalize(U.subtract(r,c,o4),o4),p=U.multiplyByScalar(d,f,o4);s=U.multiplyComponents(U.add(p,c,r4),o,r4),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,r4),r4),a=U.multiplyComponents(t,s,HBe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,GBe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,o4)),i)}var IVt=new U,WBe=new U,PVt=new h,qBe=new U;Dh.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=U.fromElements(u,e.z,WBe),d=wVt(f,U.fromElements(i.x,i.z,IVt),r,PVt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,qBe),qBe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,WBe),A=m*U.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*a.y+c.y),A=1+A*a.z,h.fromElements(n,g,A,t)};var YBe=new h,XBe=new h,DVt=new h;Dh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,YBe),s=h.multiplyByScalar(o,r,YBe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,XBe),r,XBe),c=h.add(a,s,DVt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,KBe),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return Nae(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Nae(e,t,n,i,r,o,s){return s=en.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Dh.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-ee.WGS84.minimumRadius));Dh.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var NC=Dh;var hf={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};hf.getMinBounds=function(e){switch(e){case hf.BOX:return OC.DefaultMinBounds;case hf.ELLIPSOID:return NC.DefaultMinBounds;case hf.CYLINDER:return MC.DefaultMinBounds}};hf.getMaxBounds=function(e){switch(e){case hf.BOX:return OC.DefaultMaxBounds;case hf.ELLIPSOID:return NC.DefaultMaxBounds;case hf.CYLINDER:return MC.DefaultMaxBounds}};hf.getShapeConstructor=function(e){switch(e){case hf.BOX:return OC;case hf.ELLIPSOID:return NC;case hf.CYLINDER:return MC}};Object.freeze(hf);var Ec=hf;var Lae=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function s4(e,t){this.spatialNode=e,this.keyframe=t,this.state=Lae.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}s4.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Lae.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};s4.priorityComparator=function(e,t){return e.priority-t.priority};s4.searchComparator=function(e,t){return e.keyframe-t.keyframe};s4.LoadState=Lae;var Hr=s4;function Y0(e,t,n,i,r=134217728,o){let s=RVt(i),a=OVt(n),c=n*Lt.getSizeInBytes(i),u=Y0.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new OO({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new jt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new MVt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(Y0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=jt.NEAREST:this.texture.sampler=new jt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR}),this._nearestSampling=e)}}});function RVt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function OVt(e){switch(e){case 1:return Ke.RED;case 2:return Ke.RG;case 3:return Ke.RGB;case 4:return Ke.RGBA}}function MVt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Y0.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};Y0.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--};Y0.prototype.isFull=function(){return this.emptyList===void 0};Y0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=kt;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,s=Math.floor(n/o);if(s<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=a.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=$Be(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}$Be(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=a[f];u[d]=c[f]*p}return u};function $Be(e){return e.reduce((t,n)=>t*n)}Y0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,s=Math.floor(e/o),a=e-s*o,c=Math.floor(a/n.x),u=a-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(f)};Y0.prototype.isDestroyed=function(){return!1};Y0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var a4=Y0;function Rh(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var NVt=new h;Rh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,NVt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Rh.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,s=i*2,a=r*2,c=s+1,u=o+1,f=a+1,d=t+1,p=[[d,o,s,a],[d,u,s,a],[d,o,c,a],[d,u,c,a],[d,o,s,f],[d,u,s,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new Rh(g,m,y,A,this,e,this.dimensions))};Rh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Rh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var JBe={keyframe:0};function c4(e,t){return JBe.keyframe=e,vr(t,JBe,Hr.searchComparator)}Rh.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=LVt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=ZBe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=ZBe(n-t.level,x);if(T<c&&(c=T,s=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function LVt(e,t){let n=c4(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function ZBe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Rh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Rh.prototype.createKeyframeNode=function(e){let t=c4(e,this.keyframeNodes);if(t<0){t=~t;let n=new Hr(this,e);this.keyframeNodes.splice(t,0,n)}};Rh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=c4(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 o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=c4(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};Rh.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 o=0;o<t.length;o++){let s=t[o];e.megatextureIndex=s.add(n[o])}let i=this.renderableKeyframeNodes,r=c4(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};Rh.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 l4=Rh;function zb(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:s}=e,{types:a,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<a.length;b++){let x=a[b],T=bt.getComponentCount(x),E=c[b];this.megatextures[b]=new a4(t,s,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new l4(0,0,0,0,void 0,d,o),this._priorityQueue=new _g({maximumLength:f,comparator:Hr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,Fae(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}zb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Fae(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,Fae(e,t,r-1,i+1),Fae(e,r+1,n,i+1)}zb.simultaneousRequestCountMaximum=50;zb.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Dt({context:o,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,a-1),n&&QBe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();kVt(this,e),UVt(this,e);let m=xn();GVt(this,d,c);let y=xn(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;HVt(this,e,b,x,T)}};zb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};zb.prototype.isDestroyed=function(){return!1};zb.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(),ue(this)};function QBe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];QBe(e,i)}}function FVt(e,t){if(e._simultaneousRequestCount>=zb.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Hr.LoadState.PROCESSING:Hr.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Hr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Hr.LoadState.RECEIVING,u.then(s).catch(a))}function BVt(e){return e/(1+e)}function kVt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),e2e(e.rootNode,ta.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,r[o]=s,o++;e._highPriorityKeyframeNodeCount=o}function UVt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(zVt);let o=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=o[u];if(!(f.state===Hr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Hr.LoadState.UNLOADED&&FVt(e,f),f.state===Hr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!VVt(d.metadata,e)){f.content=void 0,f.state=Hr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Hr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function zVt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function VVt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:s}=i[r],{x:a,y:c,z:u}=o,f=a*c*u,d=e[r],p=f*s;if(d.length!==p)return!1}return!0}function e2e(e,t,n,i){let{camera:r,context:o,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===ta.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=D.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let I=0;I<A;I++)e.createKeyframeNode(I);let{screenSpaceError:T,keyframeNodes:E}=e,v=BVt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+jVt(b,R.keyframe,x,n),R.state!==Hr.LoadState.UNAVAILABLE&&R.state!==Hr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===Hr.LoadState.LOADED&&(S=!0)}if(T<m||!S){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let I=0;I<8;I++){let R=e.children[I];e2e(R,t,n,i)}}function jVt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-r/o,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(a,s,.15+.85*s)}function HVt(e,t,n,i,r){let o=e._keyframeCount,s=e.rootNode,a=Object.keys(Hr.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let S=0;S<a;S++){let I=new Array(o).fill(0);c[S]=I,u[S]=0}function d(S){let I=S.keyframeNodes;for(let R=0;R<I.length;R++){let O=I[R],L=O.keyframe,_=O.state;c[_][L]+=1,u[_]+=1,f++}if(l(S.children))for(let R=0;R<8;R++){let O=S.children[R];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Hr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Hr.LoadState.RECEIVING],g=u[Hr.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(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 A=`KEYFRAMES: ${c[Hr.LoadState.LOADED]}`,b=`UNLOADED: ${u[Hr.LoadState.UNLOADED]} | RECEIVING: ${u[Hr.LoadState.RECEIVING]} | PROCESSING: ${u[Hr.LoadState.PROCESSING]} | LOADED: ${u[Hr.LoadState.LOADED]} | FAILED: ${u[Hr.LoadState.FAILED]} | UNAVAILABLE: ${u[Hr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(r*100)/100,v=`LOAD: ${x} | OCT: ${T} | ALL: ${E}`;console.log(`${A} || ${b} || ${v}`)}var vW={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function GVt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(r),E.isRenderable(o)&&(x=!0)}if(x){u[b]=vW.INTERNAL<<16|m,u[y]=A,a++,A=m,b=A*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=a,y=m*9+0,d(E,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let T=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,S=E.spatialNode.parent,I=l(S)?S.renderableKeyframeNodePrevious:E,R=WVt(g,i,n),O=v,L=1,_=E.megatextureIndex,C=I.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[b]=vW.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?vW.LEAF:vW.PACKED_LEAF_FROM_PARENT;u[b]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),qVt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&YVt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function WVt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return D.clamp(s,0,1)}function qVt(e,t,n,i){let r=Ke.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function YVt(e,t,n,i){let r=Ke.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=D.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var u4=zb;function X0(e){e=e??H.EMPTY_OBJECT;let{provider:t=X0.DefaultProvider,modelMatrix:n=N.IDENTITY,customShader:i=OP(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Um,this._calculateStatistics=o;let{shape:s,minBounds:a=Ec.getMinBounds(s),maxBounds:c=Ec.getMaxBounds(s),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=XVt(u,f,d,p),this._availableLevels=g,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=N.clone(n),this._modelMatrixOld=N.clone(this._modelMatrix),this._customShader=i??X0.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new N,this._transformPositionWorldToLocal=new N,this._transformPlaneLocalToView=new N,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Nm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Ec.getShapeConstructor(s);this._shape=new m,n2e(this),this._shapeVisible=i2e(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new N,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new N,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}KVt(this,this._shape),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}function XVt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===q0.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function KVt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let s=`u_${o}`;n[s]=function(){return i[o]}}e._shapeDefinesOld=Je(r,!0)}Object.defineProperties(X0.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=N.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}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.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=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Is.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=OP(this._provider);this._customShader=r??X0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var $Vt=new se,JVt=new se,ZVt=new N,QVt=new N,e4t=new h,t4t=new se;X0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){c4t(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=n2e(this),o=a4t(this,e);if((r||o)&&(this._shapeVisible=i2e(this),y4t(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=A4t(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,r,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&w4t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),b4t(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=U.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(i4(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=E4t(p,d,JVt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=N.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=N.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=N.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=r4t(this,n.cameraPositionLocal,t4t);n.cameraTileCoordinates=se.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,n4t(this),i4t(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function n4t(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function i4t(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function r4t(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,e4t),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var o4t=new h,Bae=new h,s4t=new he;function a4t(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function c4t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new u4(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,_4t(e._traversal,i)}function n2e(e){return f4(e,"_modelMatrix","_modelMatrixOld")+f4(e,"_minBounds","_minBoundsOld")+f4(e,"_maxBounds","_maxBoundsOld")+f4(e,"_minClippingBounds","_minClippingBoundsOld")+f4(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function f4(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var l4t=new h,u4t=new h,f4t=new h,d4t=new h,h4t=new N,m4t=new N;function i2e(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,l4t),r=h.clone(e._maxBounds,u4t),o=h.clone(e._minClippingBounds,f4t),s=h.clone(e._maxClippingBounds,d4t),a=N.clone(e._modelMatrix,h4t);if(e.shape===Ec.ELLIPSOID)i.z=Ar.getHeight(e._minBounds.z,t,n),r.z=Ar.getHeight(e._maxBounds.z,t,n),o.z=Ar.getHeight(e._minClippingBounds.z,t,n),s.z=Ar.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,o4t);N.multiplyByScale(a,m,a),N.multiplyByTranslation(a,g4t(e),a)}let c=e._provider,u=c.shapeTransform??N.IDENTITY,f=c.globalTransform??N.IDENTITY,d=N.multiplyTransformation(f,a,m4t);N.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,s)?(e._transformPositionLocalToWorld=N.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=N.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=N.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var p4t=new h;function g4t(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=N.IDENTITY,globalTransform:r=N.IDENTITY}=e._provider,o=N.getTranslation(i,Bae),s=N.multiplyByPoint(e._modelMatrix,o,Bae),a=N.multiplyByPoint(r,s,Bae),u=ee.WGS84.cartesianToCartographic(a,s4t),f=0;l(u)&&(f=u.height);let d=Ar.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,p4t)}function _4t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function y4t(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Je(t,!0)),n}function A4t(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),a=K.secondsDifference(n,i.start)/o;return r+a}function b4t(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=N.transpose(N.multiplyTransformation(N.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}X0.prototype.isDestroyed=function(){return!1};X0.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(),ue(this)};var t2e=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)),x4t=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),T4t=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function E4t(e,t,n){let i=N.fromRotationTranslation(e.halfAxes,e.center,ZVt),r=N.multiply(t,i,QVt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=T4t,d=t2e.length;for(u=0;u<d;u++)N.multiplyByVector(r,t2e[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=x4t[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=se.lerp(p,y,x,$Vt),E=T.x/T.w,v=T.y/T.w;o=Math.min(o,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return o=D.clamp(o,-1,1),a=D.clamp(a,-1,1),s=D.clamp(s,-1,1),c=D.clamp(c,-1,1),n=se.fromElements(o,a,s,c,n),n}var kae=3e7,C4t=new h(kae,0,0),v4t=new h(0,kae,0),S4t=new h(0,0,kae);function w4t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:or.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(h.ZERO,C4t,z.RED,a),r(h.ZERO,v4t,z.LIME,a),r(h.ZERO,S4t,z.BLUE,a),i.update(t)}X0.DefaultCustomShader=new W0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +{ + vec3 voxelNormal = fsInput.attributes.normalEC; + float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); + float lighting = 0.5 + 0.5 * diffuse; + material.diffuse = vec3(lighting); + material.alpha = 1.0; +}`});function r2e(){this.shape=Ec.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}r2e.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new RC({metadata:[new Float32Array(1)]});return Promise.resolve(n)};X0.DefaultProvider=new r2e;var Vb=X0;function I4t(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let a=(o.properties||{})[i];if(l(a))return a}var d4=I4t;function P4t(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var h4=P4t;function D4t(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let a=r.properties[n];if(l(a))return a}}var m4=D4t;var wW=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function yi(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof DO;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Je(e.contextOptions);this._context=new Ax(t,u)}let o=this._context,s=l(n);s||(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=Kn(),this._jobScheduler=new Oz,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new tb(o,new Ez(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new xD(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new Rz,this._primitives=new El({countReferences:r}),this._groundPrimitives=new El({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=yi.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new SC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Iz(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new li({color:new z,stencil:0,owner:this}),this._depthClearCommand=new li({depth:1,owner:this}),this._stencilClearCommand=new li({stencil:0}),this._classificationStencilClearCommand=new li({stencil:0,renderState:Ge.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new EV(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new bz,this._minimumDisableDepthTestDistance=0,this._debugInspector=new FV,this._msaaSamples=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=z.clone(z.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ui(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 WT,this.fog=new Dz,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Or.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Or(this),this.shadowMap=new uy({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new SP,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new xV,this._brdfLutGenerator=new pz,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new wV(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??yu.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Kc.requestCompletedEvent.addEventListener(wW(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(wW(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Or(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Or(this),this.preloadFlightCullingVolume=void 0,this._picking=new Zz(this),this._defaultView=new bC(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 fg,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,u2e(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}yi.defaultLogDepthBuffer=!0;function R4t(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(wW(e))),n.push(t.terrainProviderChanged.addEventListener(wW(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(yi.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 kt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return kt.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 ym.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,R4t(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}},controllerHost:{get:function(){return this._controllerHost}},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}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},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===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.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 Or(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Pz(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,kt.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}}});yi.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 O4t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function o2e(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=cp.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=cp.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=cp.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=cp.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=cp.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=uy.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}yi.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&O4t(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=uy.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=cp.createLogDepthCommand(e,o,t.logDepth),o2e(this,t.logDepth.command,s)),(d||m)&&o2e(this,e,s)};var M4t=new Sh({pass:ao.RENDER}),Uae=new Sh({pass:ao.PRELOAD}),zae=new Sh({pass:ao.PRELOAD_FLIGHT}),N4t=new Sh({pass:ao.REQUEST_RENDER_MODE_DEFER_CHECK}),s2e=new ce,Vae;function L4t(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return s2e.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Vae=aN.fromBoundingSphere(s2e,e.camera.positionWC,Vae),Vae}yi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function u2e(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}yi.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=L4t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof gn||this.camera.frustum instanceof ys),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=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),SP.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};yi.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===$t.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var SW=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);SW=N.inverseTransformation(SW,SW);function F4t(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(r.mode!==re.SCENE3D){a=N.multiplyByPoint(SW,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=Ua.createGeometry(new Ua({radii:new h(f,f,f),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromTranslation(a)):(c=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromRotationTranslation(s.halfAxes,a,new N)),t._debugVolume=new Mn({geometryInstances:new Ft({geometry:Hn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new yn({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=cp.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function xu(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof li){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&F4t(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.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(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function a2e(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.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(o,n)),l(s)?(e=s.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function f2e(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var B4t=new h;function c2e(e,t){let n=h.subtract(e,t,B4t),i=Math.max(0,h.magnitude(n));return i*i}function k4t(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return c2e(r.center,n)-c2e(i.center,n)}function U4t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function z4t(e,t,n,i,r){n0(i,f2e,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function V4t(e,t,n,i,r){n0(i,U4t,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function j4t(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],n0(i,f2e,e.camera.positionWC);for(let r=0;r<i.length;++r)xu(i[r],e,t)}function H4t(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],n0(i,k4t,e.camera.positionWC);for(let r=0;r<i.length;++r)xu(i[r],e,t)}var G4t=new Ki,W4t=new $l,q4t=new gn,Y4t=new ys;function X4t(e){let{frustum:t}=e;return l(t.fov)?t.clone(G4t):l(t.infiniteProjectionMatrix)?t.clone(W4t):l(t.width)?t.clone(q4t):t.clone(Y4t)}function K4t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?z4t:V4t}function $4t(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:s}=i.passes,a=o||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=K4t(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,xu,t,f,c)}function J4t(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,xu,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,xu,t,n)}function Z4t(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Ie.CESIUM_3D_TILE_EDGES],o=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let s=0;s<o;++s)xu(r[s],e,t);t.framebuffer=i}function Q4t(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Ie.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,s=o&&o.planarFillIdFramebuffer,a=n.commands[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let u=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new z(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)xu(a[d],e,t);t.framebuffer=u}}function e8t(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)xu(i[o],e,t)}function Hae(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=X4t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||t8t(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,E=e._globeTranslucencyState,v=e._depthClearCommand,S=e._stencilClearCommand,I=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function L(C,w){o.updatePass(w);let P=C.commands[w],M=C.indices[w];for(let F=0;F<M;++F)xu(P[F],e,t);return M}function _(C,w){o.updatePass(w);let P=C.commands[w],M=C.indices[w];for(let F=0;F<M;++F)a2e(P[F],e,t)}for(let C=0;C<T;++C){let w=T-C-1,P=x[w];e.mode===re.SCENE2D?(n.position.z=O-P.near+1,s.far=Math.max(1,P.far-P.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&S.execute(i,t),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(P,xu,A,e,t)):L(P,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(P,xu,A,e,t)):L(P,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let M;if(Z4t(e,t,P),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let B=e._view.edgeFramebuffer.idTexture;l(B)?e.context.uniformState.edgeIdTexture=B:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(Q4t(e,t,P),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)M=L(P,Ie.CESIUM_3D_TILE),M>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L(P,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),M>0&&i.stencilBuffer&&I.execute(i,t),M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(M>0&&i.stencilBuffer&&S.execute(i,t),j4t(e,t,P),L(P,Ie.OPAQUE),e8t(e,t,P),H4t(e,t,P),w!==0&&e.mode!==re.SCENE2D&&(s.near=P.near,o.updateFrustum(s)),$4t(e,t,P),J4t(e,t,P),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,w);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(P,a2e,A,e,t)):_(P,Ie.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(P,Ie.CESIUM_3D_TILE),_(P,Ie.OPAQUE),_(P,Ie.TRANSLUCENT),t.framebuffer=F}}function t8t(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&xu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&xu(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=r.globeDepth.framebuffer:i.usePostProcess?s=r.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let s=o.length-1;s>=0;s--){let a=o[s];l(a.shaderProgram)?xu(o[s],e,t):o.splice(s,1)}}function d2e(e){e.context.uniformState.updatePass(Ie.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 n8t(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function i8t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,s=o.length,a=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function h2e(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:s}=o;for(let a=0;a<r.length;++a){let c=r[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;i8t(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[a];xu(A,e,d.passState)}}}}var r8t=new h;yi.prototype.updateAndExecuteCommands=function(e,t){y8t(this,e,t),this._environmentState.useWebVR?o8t(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===yu.ROTATE?jb(!0,this,e):m8t(this,e)};function o8t(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;p2e(e),n.createPotentiallyVisibleSet(e),d2e(e),o||h2e(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Or.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,r8t);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,Hae(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,Hae(e,t),Or.clone(a,i)}var s8t=new he(Math.PI,D.PI_OVER_TWO),a8t=new h,c8t=new h,l8t=new N,u8t=new N,f8t=new h,d8t=new h,h8t=new et;function m8t(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,h8t);t.viewport=s;let a=s8t,c=a8t;e.mapProjection.project(a,c);let f=h.clone(i.position,c8t),d=N.clone(i.transform,u8t),p=i.frustum.clone();i._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,l8t),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,f8t),b=At.pointToGLWindowCoordinates(m,g,A,d8t);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)jb(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),jb(!0,e,t),s.x=b.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),r.update(n),jb(!1,e,t);else if(b.x>x+T*.5){s.width=b.x-x;let E=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),jb(!0,e,t),s.x=b.x,s.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),jb(!1,e,t)}else{s.x=b.x,s.width=x+T-b.x;let E=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),jb(!0,e,t),s.x=x,s.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),jb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function jb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),p2e(t),i.createPotentiallyVisibleSet(t),e&&(d2e(t),r||h2e(t)),Hae(t,n)}var l2e=new ta;function m2e(e,t,n){if(!e.show)return;let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);if(o instanceof El){m2e(o,t,n);continue}o.show&&Wg.isSupported(o)&&Ss(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function p8t(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;m2e(e._primitives,n,i)}yi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof gn||!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(o_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;s.setDynamicLighting(b),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 A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=l2e.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=l2e,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new ym(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),p8t(this,e)};function g8t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new k0({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 _8t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,s=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<o;++a)if(r[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<o;++a){let c=r[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 p2e(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,g8t(e),_8t(e),e._globe&&e._globe.render(t)}function y8t(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,a=r.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new NV: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 f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let E=e._invertClassification.unclassifiedCommand,v=E.derivedCommands;v.oit=p.createDerivedCommands(E,i,v.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}yi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,r.executeCopyColor(t,e))};function A8t(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function b8t(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function g2e(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof El){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=g2e(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}yi.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,r=this._heightQueryCache.get(i);if(r!==void 0)return r===null?void 0:r;let o=x8t(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function x8t(e,t,n){let i=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,r=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE;if(!l(t))return;let o=Number.NEGATIVE_INFINITY;if(!i){let a=g2e(e.primitives,t,e);l(a)&&a>o&&(o=a)}let s=e._globe;if(!r&&l(s)&&s.show){let a=s.getHeight(t);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o}var jae=new he;yi.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,jae);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(jae.height=m,t(jae))},o=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function T8t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}yi.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=b8t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=T8t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function E8t(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 r=new ay({container:n});e._performanceDisplay=r,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 C8t(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 v8t(e){e.primitives.postPassesUpdate(e._frameState),Kc.update()}var S8t=new z;function w8t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=M4t;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,S8t),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,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 fg?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,n8t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function LC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function I8t(e){return e._picking.updateMostDetailedRayPicks(e)}yi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=D.incrementWrap(t.frameNumber,tb.maximumFrameNumber,1);u2e(this,r,e),t.newFrame=!0}LC(this,C8t),this.primitives.show&&(LC(this,I8t),LC(this,P8t),LC(this,D8t),i||LC(this,R8t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),LC(this,w8t)),E8t(this,i),LC(this,v8t),A8t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};yi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};yi.prototype.requestRender=function(){this._renderRequested=!0};yi.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};yi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};yi.prototype.snap=function(e,t){return RV.snap(this,e,t)};yi.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};yi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof Vb))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*o[0]+o[1],a=r._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*o[2]+o[3];return BV.fromKeyframeNode(r,s,c,a)};yi.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let s=o.schema,a=d4(s,t,n,i);if(!l(a))return;let c=m4(o,n,i);if(!l(c))return;let u=new h4(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};yi.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};yi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};yi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};yi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function P8t(e){let t=e._frameState;Uae.camera=t.camera,Uae.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Uae)}function D8t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;zae.camera=e.preloadFlightCamera,zae.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,zae)}function R8t(e){e.primitives.updateForPass(e._frameState,N4t)}yi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};yi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};yi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};yi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};yi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};yi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};yi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};yi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};yi.prototype.cartesianToCanvasCoordinates=function(e,t){return hr.worldToWindowCoordinates(this,e,t)};yi.prototype.completeMorph=function(){this._transitioner.completeMorph()};yi.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};yi.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};yi.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function O8t(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()})}yi.prototype.setTerrain=function(e){return O8t(this,e),e};yi.prototype.isDestroyed=function(){return!1};yi.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),ue(this)};var p4=yi;var NP=`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; +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); +float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; +float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; +vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; +vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); +czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); +underTranslucentGlobe = 0.0; +#if defined(GLOBE_TRANSLUCENT) +czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); +if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { +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); +float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); +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); +underTranslucentGlobe = 1.0; return; } -RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); -if (innerIntersect.entry.w == NO_HIT) { -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); -} else { -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); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +#endif +computeScattering( +primaryRay, +length(cameraToPositionWC), +lightDirection, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; +float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; +opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); +float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; +opacity *= pow(nightAlpha, 0.5); } -#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]); +`;var g4=`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 -#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); +vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); +#ifndef HDR +color.rgb = czm_pbrNeutralTonemapping(color.rgb); +color.rgb = czm_inverseGamma(color.rgb); #endif -#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]); +#ifdef COLOR_CORRECT +const bool ignoreBlackPixels = true; +color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); #endif +if (translucent == 0.0) { +color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } -`;var dA=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { -intersectShape(ray, ix); -RayShapeIntersection intersection = getFirstIntersection(ix); -if (intersection.entry.w == NO_HIT) { -return intersection; +out_FragColor = color; } -#if defined(CLIPPING_PLANES) -intersectClippingPlanes(ray, ix); +`;var _4=`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 -#if defined(DEPTH_TEST) -intersectDepth(screenCoord, ray, ix); +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 -#if (INTERSECTION_COUNT > 1) -initializeIntersections(ix); -for (int i = 0; i < INTERSECTION_COUNT; ++i) { -intersection = nextIntersection(ix); -if (intersection.exit.w > 0.0) { -intersection.entry.w = max(intersection.entry.w, 0.0); -break; -} +v_outerPositionWC = positionWC.xyz; +vec4 positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; } -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; +`;function LP(e){e=e??ee.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=N.fromScale(n),this._modelMatrix=new N,this._command=new at({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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 h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(LP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});LP.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Gae=new N;LP.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=N.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,Gae),r=N.multiplyTransformation(i,zi.Y_UP_TO_Z_UP,Gae),o=N.multiply(this._scaleMatrix,r,Gae);N.clone(o,this._modelMatrix);let s=e.context,a=M8t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Ua.createGeometry(new Ua({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=zn.fromGeometry({context:s,geometry:p,attributeLocations:Hn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},blending:tn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ye({defines:p,sources:[xm,NP,_4]}),m=new Ye({defines:p,sources:[xm,NP,g4]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function M8t(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}LP.prototype.isDestroyed=function(){return!1};LP.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var y4=LP;var A4=`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 g3=`#if defined(BOX_HAS_SHAPE_BOUNDS) -uniform vec3 u_boxUvToShapeUvScale; -uniform vec3 u_boxUvToShapeUvTranslate; -#endif -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -return PointJacobianT(positionUv, mat3(0.5)); +`;var b4=`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; } -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; -#else -return positionShape; -#endif +`;var x4=`uniform mat3 u_cubeMapPanoramaTransform; +in vec3 position; +out vec3 v_texCoord; +void main() +{ +vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +`;function T4(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new at({modelMatrix:N.clone(N.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t}Object.defineProperties(T4.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});T4.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:s}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?wO(o,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ns({context:o,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Hn.createAttributeLocations(c);a.vertexArray=zn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Me.STATIC_DRAW}),a.renderState=Ge.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:tn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Ye({defines:[t?"HDR":""],sources:[A4]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?x4:b4,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};T4.prototype.isDestroyed=function(){return!1};T4.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(),ue(this)};var FC=T4;function BC(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new FC({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(BC.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});BC.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};BC.prototype.isDestroyed=function(){return!1};BC.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function FP(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}BC.createEarthSkyBox=function(){return new BC({sources:{positiveX:FP("px"),negativeX:FP("mx"),positiveY:FP("py"),negativeY:FP("my"),positiveZ:FP("pz"),negativeZ:FP("mz")}})};var E4=BC;var C4=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ +vec4 color = texture(u_texture, v_textureCoordinates); +out_FragColor = czm_gammaCorrect(color); } -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif +`;var v4=`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); } -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return shapeUv / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif +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); } -`;var y3=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) -uniform vec2 u_cylinderUvToShapeUvRadius; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) -uniform vec2 u_cylinderUvToShapeUvHeight; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) -uniform vec2 u_cylinderUvToShapeUvAngle; -#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) { -vec3 position = positionUv * 2.0 - 1.0; -float radius = length(position.xy); -vec3 radial = normalize(vec3(position.xy, 0.0)); -float height = positionUv.z; -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); +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); +burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); +burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); +burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); +burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); +burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); +burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); +color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; +out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); } -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) -angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); -#endif -#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); +`;var S4=`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); } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +else +{ +position = vec4(czm_sunPositionColumbusView.zxy, 1.0); } -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); +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; } -`;var b3=`uniform vec3 u_ellipsoidRadiiUv; -uniform vec2 u_evoluteScale; -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; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -uniform vec2 u_ellipsoidUvToShapeUvLatitude; +`;function I4(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.TRIANGLES,boundingVolume:new ce,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ce,this._boundingVolume2D=new ce,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(I4.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var N8t=new U,L8t=new U,F8t=new se,w4=new se;I4.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(o,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?r.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new Dt({context:r,width:E,height:E,pixelFormat:Ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let S=this,I={u_radiusTS:function(){return S._radiusTS}};this._commands.computeCommand=new bf({fragmentShaderSource:v4,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){S._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(8);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let S=tt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});a.vertexArray=new zn({context:r,attributes:I,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:S4,fragmentShaderSource:C4,attributeLocations:E}),a.renderState=Ge.fromCache({blending:tn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?ce.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ce.clone(d,a.boundingVolume);let p=hr.computeActualEllipsoidPosition(e,c,w4),g=h.magnitude(h.subtract(p,e.camera.position,w4)),m=r.uniformState.projection,y=F8t;y.x=0,y.y=0,y.z=-g,y.w=1;let A=N.multiplyByVector(m,y,w4),b=hr.clipToGLWindowCoordinates(t.viewport,A,N8t);y.x=D.SOLAR_RADIUS;let x=N.multiplyByVector(m,y,w4),T=hr.clipToGLWindowCoordinates(t.viewport,x,L8t);return this._size=U.magnitude(U.subtract(T,b,w4)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};I4.prototype.isDestroyed=function(){return!1};I4.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(),ue(this)};var P4=I4;var A2e=Qo(fj(),1);function B8t(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 D4=B8t;var k8t={modifyFragmentShader:function(t){return t=Ye.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 -uniform float u_ellipsoidInverseHeightDifferenceUv; -vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { -vec2 p = abs(pos); -vec2 inverseRadii = 1.0 / radii; -vec2 tTrigs = vec2(0.7071067811865476); -vec2 v = radii * tTrigs; -vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; -const int iterations = 3; -for (int i = 0; i < iterations; ++i) { -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; + czm_splitter_main(); +} +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},BP=k8t;var kC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function R4(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.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=kC.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=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=N.clone(N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.time=0,this.shadows=Dn.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=e.splitDirection??qo.NONE,this._splittingEnabled=!1,this._error=void 0,U8t(this,e)}Object.defineProperties(R4.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ce.clone(e,this._boundingSphere)}}});function U8t(e,t){let n=oE.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=Am.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=kC.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 r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.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 z8t=new h,V8t=new h,j8t=new h,_2e,IW;function H8t(e){if(!l(IW)){_2e=new A2e.default(0),IW=new Array(e);for(let t=0;t<e;++t)IW[t]=_2e.random()}return IW}function G8t(e){let n=e.length/3,i=Math.min(n,20),r=H8t(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,z8t),c=h.fromElements(s,s,s,V8t);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,j8t);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ce.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function y2e(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.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 W8t=new se,q8t=new se,Y8t=new z,b2e=0,PW=1,Kae=2,x2e=3,X8t=4,Wae=new N,K8t=new N;function $8t(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,S,I,R=[],O={};if(e._styleableShaderAttributes=O,f){let B=X8t;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=y2e(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=tt.createVertexBuffer({context:n,typedArray:G,usage:Me.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let Q={index:B,vertexBuffer:q,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:B,componentCount:S},++B}}let L=tt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=y2e(c.typedArray,"batchIds"),w=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let P=[];if(d?I=Y.UNSIGNED_SHORT:p?I=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:I=Y.FLOAT,P.push({index:b2e,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ce.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=G8t(o.typedArray)),T)if(b)P.push({index:PW,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;P.push({index:PW,vertexBuffer:_,componentsPerAttribute:B,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(S=2,I=Y.UNSIGNED_BYTE):m?(S=2,I=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(S=3,I=Y.FLOAT),P.push({index:Kae,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&P.push({index:x2e,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(P=P.concat(R));let M=new zn({context:n,attributes:P}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:tn.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(F.stencilTest=Yt.setCesium3DTileBit(),F.stencilMask=Yt.CESIUM_3D_TILE_MASK,V.stencilTest=Yt.setCesium3DTileBit(),V.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ge.fromCache(F),e._translucentRenderState=Ge.fromCache(V),e._drawCommand=new at({boundingVolume:new ce,cull:e._cull,modelMatrix:new N,primitiveType:Oe.POINTS,vertexArray:M,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function J8t(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=W8t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof gn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}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 z.TRANSPARENT;let c=z.clone(a.edgeColor,Y8t);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return N.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;N.multiply(n.uniformState.view3D,c,Wae);let u=N.multiply(Wae,a.modelMatrix,Wae);return N.inverseTranspose(u,K8t)}};BP.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=q8t;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function qae(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Yae(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Xae(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var Z8t={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 Q8t(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,S,I,R,O=g,L=Je(Z8t),_={},C=e._styleableShaderAttributes;for(r in C)C.hasOwnProperty(r)&&(o=C[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let fe={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)";S=n.getColorShaderFunction(`getColorFromStyle${xe}`,L,fe),I=n.getShowShaderFunction(`getShowFromStyle${xe}`,L,fe),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,L,fe),l(S)&&fe.translucent&&(O=!0)}e._styleTranslucent=O;let w=l(S),P=l(I),M=l(R),F=e.isClipped,V=[],B=[];w&&(qae(S,V),Yae(S,B)),P&&(qae(I,V),Yae(I,B)),M&&(qae(R,V),Yae(R,B));let j=B.indexOf("COLOR")>=0,k=B.indexOf("NORMAL")>=0;if(k&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in C)if(C.hasOwnProperty(r)){o=C[r];let fe=V.indexOf(o.location)>=0,xe=Xae(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=Xae(T,PW);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=Xae(T,Kae);fe.enabled=q}let Q={a_position:b2e};G&&(Q.a_color=PW),q&&(Q.a_normal=Kae),A&&(Q.a_batchId=x2e);let W="",J=V.length;for(i=0;i<J;++i){let fe=V[i];o=_[fe];let xe=o.componentCount,ge=`czm_3dtiles_property_${fe}`,we;xe===1?we="float":we=`vec${xe}`,W+=`in ${we} ${ge}; +`,Q[ge]=o.location}J8t(e,t);let Z=`in vec3 a_position; +out vec4 v_color; +uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; +uniform vec4 u_constantColor; +uniform vec4 u_highlightColor; +`;Z+=`float u_pointSize; +float tiles3d_tileset_time; +`,v&&(Z+=`float u_geometricError; +float u_depthMultiplier; +`),Z+=W,G&&(g?Z+=`in vec4 a_color; +`:p?Z+=`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; +`:Z+=`in vec3 a_color; +`),q&&(f||d?Z+=`in vec2 a_normal; +`:Z+=`in vec3 a_normal; +`),A&&(Z+=`in float a_batchId; +`),(c||u||d)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; +`),w&&(Z+=S),P&&(Z+=I),M&&(Z+=R),Z+=`void main() +{ + u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; + tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; +`,v&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; + u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; +`),G?g?Z+=` vec4 color = a_color; +`:p?Z+=` 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); +`:Z+=` vec4 color = vec4(a_color, 1.0); +`:Z+=` vec4 color = u_constantColor; +`,c||u?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; +`:Z+=` vec3 position = a_position; +`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); +`,q?(f?Z+=` vec3 normal = czm_octDecode(a_normal); +`:d?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; +`:Z+=` vec3 normal = a_normal; +`,Z+=` vec3 normalEC = czm_normal * normal; +`):Z+=` vec3 normal = vec3(1.0); +`,w&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal); +`),P&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); +`),M?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; +`:v?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); + float depth = -positionEC.z; + gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); +`:Z+=` gl_PointSize = u_pointSize; +`,Z+=` color = color * u_highlightColor; +`,q&&x&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); + diffuseStrength = max(diffuseStrength, 0.4); + color.xyz *= diffuseStrength * czm_lightColor; +`),Z+=` v_color = color; + gl_Position = czm_modelViewProjection * vec4(position, 1.0); +`,q&&b&&(Z+=` float visible = step(-normalEC.z, 0.0); + gl_Position *= visible; + gl_PointSize *= visible; +`),P&&(Z+=` gl_Position.w *= float(show); + gl_PointSize *= float(show); +`),Z+=`} +`;let ae=`in vec4 v_color; +`;F&&(ae+=`uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +`,ae+=` +`,ae+=lC(E,s),ae+=` +`),ae+=`void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +`,F&&(ae+=D4("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} +`,e.splitDirection!==qo.NONE&&(ae=BP.modifyFragmentShader(ae)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ae=e._fragmentShaderLoaded(ae));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:ae,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function ejt(e,t){if(e._decodingState===kC.READY)return!1;if(e._decodingState===kC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=bg.decodePointCloud(i,t);l(r)&&(e._decodingState=kC.DECODING,r.then(function(o){e._decodingState=kC.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=kC.FAILED,e._error=o}))}return!0}var tjt=new se,njt=new h;R4.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(ejt(this,t))return;let i=!1,r=!N.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||($8t(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){N.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(N.clone(this._modelMatrix,u),l(this._rtcCenter)&&N.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&N.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=N.getColumn(u,3,tjt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ce.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(u,d,d);let p=N.getScale(u,njt);f.radius*=h.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 o=this.splitDirection!==qo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&Q8t(this,e,this._style),this._drawCommand.castShadows=Dn.castShadows(this.shadows),this._drawCommand.receiveShadows=Dn.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?Ie.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};R4.prototype.isDestroyed=function(){return!1};R4.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var O4=R4;function zC(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.shadows=e.shadows??Dn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new a0(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 l_,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(zC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Is.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function ijt(e){return`uniform vec4 czm_pickColor; +${e}`}function rjt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function ojt(){return"czm_pickColor"}zC.prototype.makeStyleDirty=function(){this._styleDirty=!0};zC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var sjt=new K;function Jae(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function UC(e,t){return e._intervals.indexOf(t.start)}function ajt(e,t){let n=e._intervals,i=e._clock,r=Jae(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,sjt),a=n.indexOf(s),c=UC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function cjt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function ljt(e,t,n){let i=Jae(e),r=UC(e,t),o=UC(e,n);return i>=0?r>=o:r<=o}function E2e(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 ujt(e,t,n){let i=UC(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?N.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:xn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new O4({arrayBuffer:u,cull:!0,fragmentShaderLoaded:ijt,uniformMapLoaded:rjt(e),pickIdLoaded:ojt})}).catch(E2e(e,c))}return o}function fjt(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 djt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(C2e(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;fjt(e,a)}}t.touchedFrameNumber=i.frameNumber}var hjt=new N;function mjt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function pjt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var gjt=new a0;function C2e(e,t,n,i){let r=e.shading??gjt,o=t.pointCloud,s=t.transform??N.IDENTITY;o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,hjt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=mjt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=pjt(e);try{o.update(i)}catch(a){E2e(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function $ae(e,t,n,i){let r=ujt(e,t,i);djt(e,r,n,i)}function _jt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function v2e(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function yjt(e,t){let n=UC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function T2e(e,t,n,i,r){return l(n)?n.ready?!0:($ae(e,t,i,r),n.ready):!1}function Ajt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=UC(e,n),d=UC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],T2e(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],T2e(e,s,a,i,r))return s;return t}function bjt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var kP={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};zC.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&bjt(this,r,s),kP.timeSinceLoad=t,kP.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=cjt(this);if(!l(g))return;let m=!1,y=Jae(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||ljt(this,g,p))&&(p=ajt(this,g)),d=Ajt(this,d,g,kP,e);let b=yjt(this,d);l(b)||($ae(this,d,kP,e),b=this._lastRenderedFrame),l(b)&&C2e(this,b,kP,e),l(p)&&$ae(this,p,kP,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&v2e(this,_jt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};zC.prototype.isDestroyed=function(){return!1};zC.prototype.destroy=function(){return v2e(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var UP=zC;function I2e(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function xjt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function P2e(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function D2e(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=P2e(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function R2e(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function Gr(e,t){e=Ln(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=dn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=dn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Ln(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Ln(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,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 im,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),D2e(this);try{let p=t.ellipsoid??ee.default,g=new p4({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly: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=h.UNIT_Z,P2e(this),R2e(this);let m=t.globe;l(m)||(m=new lz(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Dn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=E4.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new P4,ee.WGS84.equals(p)&&(g.moon=new dz));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new y4(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Rs.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new ra(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new E3,E=!0);let v=new X3({scene:g,dataSourceCollection:T}),S=new Go;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=S,this._canAnimateUpdateCallback=this._updateCanAnimate,S.add(this._clock.onTick,Gr.prototype._onTick,this),S.add(g.morphStart,Gr.prototype._clearTrackedObject,this),S.add(T.dataSourceAdded,Gr.prototype._onDataSourceAdded,this),S.add(T.dataSourceRemoved,Gr.prototype._onDataSourceRemoved,this),S.add(g.postRender,Gr.prototype._postRender,this);let I=T.length;for(let R=0;R<I;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),S.add(T.dataSourceAdded,Gr.prototype._dataSourceAdded,this),S.add(T.dataSourceRemoved,Gr.prototype._dataSourceRemoved,this)}catch(p){throw f&&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(Gr.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&&xjt(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,Zae(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(N.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,I2e(this.clock,e))}}});Gr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.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 u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=Up(n);u||(typeof n=="string"&&(n=new Error(n)),t=Up({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +${t} +${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);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(r)},d.appendChild(p),i.appendChild(r)};Gr.prototype.isDestroyed=function(){return!1};Gr.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()),ue(this)};Gr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,D2e(this),R2e(this),this._scene.requestRender())};Gr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Gr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Gr.prototype._onEntityCollectionChanged,this)};Gr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Gr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Gr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var Tjt=new ce;Gr.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)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??Tjt)===Pt.DONE&&i.update(t)}};Gr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};Gr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Gr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&I2e(this.clock,e)};Gr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Gr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Gr.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 r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Gr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Gr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Gr.prototype.zoomTo=function(e,t){return O2e(this,e,{offset:t},!1)};Gr.prototype.flyTo=function(e,t){return O2e(this,e,t,!0)};function O2e(e,t,n,i){Zae(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Rs){let s;l(o.imageryProvider)?s=Promise.resolve(o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return cC(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Ko||o instanceof UP||o instanceof Vb||o instanceof oa){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function M4(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Zae(e){let t=e._zoomPromise;l(t)&&(M4(e),e._completeZoom(!1))}Gr.prototype._postRender=function(){Ejt(this),Cjt(this)};var S2e=new ce;function Ejt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function s(f){l(r.offset)||(r.offset=new Hd(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),M4(e)}if(t instanceof UP){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Ko||t instanceof Vb){s(t.boundingSphere);return}if(t instanceof oa){s(t.boundingVolume);return}if(t instanceof he){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),M4(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,S2e);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ce.clone(S2e))}if(c.length===0){Zae(e);return}e.trackedEntity=void 0;let u=ce.fromBoundingSpheres(c);e._zoomIsFlight?(M4(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(N.IDENTITY),M4(e),e._completeZoom(!0))}var w2e=new ce;function Cjt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,w2e);if(o===Pt.PENDING)return;let s=r.mode;(s===re.COLUMBUS_VIEW||s===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===re.COLUMBUS_VIEW||s===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==Pt.FAILED?w2e:void 0;e._entityView=new $3(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var N4=Gr;var L4=`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 vec3(v * sign(pos), length(v - evolute)); +return mod(value, rangeLength); } -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -vec3 position = positionUv * 2.0 - 1.0; -position = position * u_ellipsoidRadiiUv; -float longitude = atan(position.y, position.x); -vec3 east = normalize(vec3(-position.y, position.x, 0.0)); -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 wrapVec(vec3 value, float rangeLength) { +return vec3(wrap(value.x, rangeLength), +wrap(value.y, rangeLength), +wrap(value.z, rangeLength)); } -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -float longitude = (positionShape.x + czm_pi) / czm_twoPi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) -longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); -#endif -#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 -float latitude = (positionShape.y + czm_piOverTwo) / czm_pi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; -#endif -float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv; -return vec3(longitude, latitude, height); +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; } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +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); } -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -float longitude = shapeUv.x * czm_twoPi; -#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) -longitude /= u_ellipsoidUvToShapeUvLongitude.x; -#endif -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); +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); } -`;var x3=`#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; -uniform ivec3 u_inputDimensions; -#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 -}; -int intMod(in int a, in int b) { -return a - (b * (a / b)); +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; } -int normU8_toInt(in float value) { -return int(value * 255.0); +float root = sqrt(discriminant); +float t = (-B - root) / A; +if(t < 0.0) { +t = (-B + root) / A; } -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); +point = origin + t * dir; +if(slice >= 0.0) { +point.z = (slice / 2.0) - 0.5; +if(length(point) > 0.5) { +return false; } -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; +normal = normalize(point); +point -= czm_epsilon2 * normal; +return true; } -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); +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; } -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; +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; } -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -float dimAtLevel = exp2(float(octreeCoords.w)); -return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +return intersected; } -vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -vec3 tileUv = getTileUv(shapePosition, octreeCoords); -return clamp(tileUv, vec3(0.0), vec3(1.0)); +vec2 phaseShift2D(vec2 p, vec2 freq) { +return (czm_pi / 2.0) * sin(freq.yx * p.yx); } -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(Y_UP_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)) -if (sampleData.tileCoords.w == 0) { -float angleCount = float(u_inputDimensions.z); -angle = mod(angle + angleCount / 2.0, angleCount); +vec2 phaseShift3D(vec3 p, vec2 freq) { +return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); } -#endif -inputCoordinate.y = height; -inputCoordinate.z = angle; -#endif -#endif -sampleData.tileUv = tileUv; -sampleData.inputCoordinate = inputCoordinate; +const float T0 = 0.6; +const float k = 0.1; +const float C0 = 0.8; +const float FX0 = 0.6; +const float FY0 = 0.6; +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); } -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; +return k * sum.x * sum.y; } -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { -int leafIndex = data.data; -int leafNodeTexelCount = 2; -float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; -float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; -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; -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; -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); +const float a = 0.5; +const float t = 0.4; +const float s = 0.25; +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); +float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); +float It = T(cloudPoint); +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; +float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); +float TR = pow(ndDot, 3.0) - W; +TR *= 1.3; +float minusDot = 0.5 - ndDot; +TR -= min(minusDot * W2, 0.0); +TR -= 0.8 * (minusDot + 0.25) * W3; +float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); +shading = clamp(shading + 0.2, 0.3, 1.0); +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 -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) { -vec3 center = 0.5 * (start + end); -vec3 childCoord = step(center, shapePosition); -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) { -break; -} -start = mix(start, center, childCoord); -end = mix(center, end, childCoord); -traversalData.parentOctreeIndex = childData.data; +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; } -return childData; +#else +#ifndef DEBUG_BILLBOARDS +vec4 cloud = drawCloud(rayOrigin, rayDir, +ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); +if(cloud.w < 0.01) { +discard; } -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); +out_FragColor = cloud; +#endif +#endif } -#if (SAMPLE_COUNT == 1) -getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[0]); +`;var F4=`#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() { +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 -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(shapePosition, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[1]); +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; } -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)); -return inside || octreeCoords.w == 0; +`;var B4=`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); } -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 mod(value, rangeLength); } -return; +vec3 wrapVec(vec3 value, float rangeLength) { +return vec3(wrap(value.x, rangeLength), +wrap(value.y, rangeLength), +wrap(value.z, rangeLength)); } -for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { -traversalData.octreeCoords.xyz /= 2; -traversalData.octreeCoords.w -= 1; -if (insideTile(shapePosition, traversalData.octreeCoords)) { -break; +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)); } -traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); +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; } -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 +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; } -`;var T3=`uniform ivec2 u_megatextureSliceDimensions; -uniform ivec2 u_megatextureTileDimensions; -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; -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; +return shortestDistance; } -Properties getPropertiesFromMegatexture(in SampleData sampleData) { -int tileIndex = sampleData.megatextureIndex; -vec3 voxelCoord = sampleData.inputCoordinate; -#if defined(NEAREST_SAMPLING) -voxelCoord = floor(voxelCoord) + vec3(0.5); -#endif -vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -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); -vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -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 +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; } -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { -#if (SAMPLE_COUNT == 1) -return getPropertiesFromMegatexture(sampleDatas[0]); -#else -Properties properties = clearProperties(); -for (int i = 0; i < SAMPLE_COUNT; ++i) { -float weight = sampleDatas[i].weight; -if (weight > 0.0) { -Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); -tempProperties = scaleProperties(tempProperties, weight); -properties = sumProperties(properties, tempProperties); +noise += worleyNoise(p * scale, freq * scale) * persistence; +persistence *= 0.5; +freq *= 2.0; } +return noise; } -return properties; -#endif +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 ybt={Z_UP:0,Y_UP:1},Td=Object.freeze(ybt);function bbt(e){let t=new wb;this.shaderBuilder=t;let n=e._customShader,i=xt(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,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=c(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([u3]),e.provider.metadataOrder===Td.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,ge.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,ge.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,ge.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",x3,c3,f3,T3]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([h3])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([d3])),a==="BOX"?t.addFragmentLines([g3,m3,dA]):a==="CYLINDER"?t.addFragmentLines([y3,Rw,p3,dA]):a==="ELLIPSOID"&&t.addFragmentLines([b3,Rw,_3,dA]),t.addFragmentLines([l3]);let l=e._shape,u=l.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];c(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let f=l.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,ge.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,ge.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,ge.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var A3=bbt;function xbt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,l=o.length,u=c(s)&&c(a);n.addDefine("METADATA_COUNT",l,ge.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=o[R],_=`PropertyStatistics_${L}`,w=`PropertyStatistics_${L}`;n.addStruct(_,w,ge.FRAGMENT);let D=CG(F);n.addStructField(_,D,"min"),n.addStructField(_,D,"max")}let f="Statistics",h="Statistics",p="statistics";n.addStruct(f,h,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=`PropertyStatistics_${L}`,_=L;n.addStructField(f,F,_)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,ge.FRAGMENT),n.addStructField(g,h,p);for(let R=0;R<l;R++){let L=i[R],F=o[R],_=CG(F);n.addStructField(g,_,L)}for(let R=0;R<l;R++){let L=i[R],F=o[R],_=Abt(F),w=`VoxelProperty_${L}`,D=`VoxelProperty_${L}`;n.addStruct(w,D,ge.FRAGMENT),n.addStructField(w,_,"partialDerivativeLocal"),n.addStructField(w,_,"partialDerivativeWorld"),n.addStructField(w,_,"partialDerivativeView"),n.addStructField(w,_,"partialDerivativeValid")}let b="Voxel",x="Voxel",A="voxel";n.addStruct(b,x,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=`VoxelProperty_${L}`;n.addStructField(b,F,L)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let C="FragmentInput";n.addStruct(C,"FragmentInput",ge.FRAGMENT),n.addStructField(C,m,y),n.addStructField(C,x,A);let v="Properties",P="Properties",M="properties";n.addStruct(v,P,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],F=o[R],_=CG(F);n.addStructField(v,_,L)}{let R="clearProperties";n.addFunction(R,`${P} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L],_=o[L],w=r[L],D=CG(_,w);n.addFunctionLines(R,[`${M}.${F} = ${D}(0.0);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="sumProperties";n.addFunction(R,`${P} sumProperties(${P} propertiesA, ${P} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`${M}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(R,[`return ${M};`])}{let R="scaleProperties";n.addFunction(R,`${P} scaleProperties(${P} ${M}, float scale)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} scaledProperties = ${M};`]);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${P} mixProperties(${P} propertiesA, ${P} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`${M}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${P} ${M}, inout ${m} ${y})`,ge.FRAGMENT);for(let L=0;L<l;L++){let F=i[L];n.addFunctionLines(R,[`${y}.${F} = ${M}.${F};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let L=0;L<l;L++){let F=i[L],_=o[L],w=at.getComponentCount(_);for(let D=0;D<w;D++){let I=Cbt(_,D),N=s[L][D],k=a[L][D];!c(N)||!c(k)||n.addFunctionLines(R,[`${p}.${F}.min${I} = ${kAe(N)};`,`${p}.${F}.max${I} = ${kAe(k)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${P} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let F=i[L],_=o[L],w=r[L],D=Tbt(_,w);n.addFunctionLines(R,[`properties.${F} = texture(u_megatextureTextures[${L}], texcoord)${D};`])}n.addFunctionLines(R,[`return ${M};`])}}function CG(e){if(e===at.SCALAR)return"float";if(e===at.VEC2)return"vec2";if(e===at.VEC3)return"vec3";if(e===at.VEC4)return"vec4"}function Tbt(e){if(e===at.SCALAR)return".r";if(e===at.VEC2)return".ra";if(e===at.VEC3)return".rgb";if(e===at.VEC4)return""}function Abt(e){if(e===at.SCALAR)return"vec3";if(e===at.VEC2)return"mat2";if(e===at.VEC3)return"mat3";if(e===at.VEC4)return"mat4"}function kAe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Cbt(e,t){return e===at.SCALAR?"":`[${t}]`}var C3=xbt;function Ebt(e,t){let n=new A3(e);C3(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let x="getClippingPlane",A=fg(o,t),C=0,S=A.indexOf(")")+1,v=A.indexOf("{",S)+1,P=A.indexOf("}",v),M=A.slice(C,S),R=A.slice(v,P);i.addFunction(x,M,ge.FRAGMENT),i.addFunctionLines(x,[R])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let l=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),h=Ve.fromCache({cull:{enabled:!0,face:xi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:ln.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,m=new Qe({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:h,shaderProgram:l,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:De.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),y=Qe.shallowClone(m,new Qe);y.shaderProgram=u,y.pickOnly=!0;let b=Qe.shallowClone(m,new Qe);if(b.shaderProgram=f,b.pickOnly=!0,c(e._drawCommand)){let x=e._drawCommand;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPick)){let x=e._drawCommandPick;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPickVoxel)){let x=e._drawCommandPickVoxel;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=y,e._drawCommandPickVoxel=b}var E3=Ebt;var Sbt={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"},hA=Object.freeze(Sbt);function wbt(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 S3=wbt;function Mw(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Mw.prototype.getTexture=function(e){return this._textures[e]};function vbt(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];c(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}Mw.prototype.loadTexture2D=function(e,t){c(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):vbt(this,e,t)};function Dbt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?EG(o,r,n):Pbt(o,r,n),a=e._textures[i];c(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function EG(e,t,n){let{typedArray:i,sampler:o}=e,r=c(i)?VAe(e,n):new Rt({context:n,source:t,sampler:o});return UAe(o)&&r.generateMipmap(),r}function Pbt(e,t,n){let{typedArray:i,sampler:o}=e,r=UAe(o),s=o.wrapS===gn.REPEAT||o.wrapS===gn.MIRRORED_REPEAT||o.wrapT===gn.REPEAT||o.wrapT===gn.MIRRORED_REPEAT,{width:a,height:l}=c(i)?e:t,u=[a,l].every(O.isPowerOfTwo);if((r||s)&&!u)if(c(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let h=S3(i,a,l),p=yy(h);return EG({sampler:o},p,n)}}else{let h=yy(t);return EG(e,h,n)}else return EG(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."),VAe(e,n)}function UAe(e){return[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function VAe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Rt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}Mw.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];Dbt(this,o,t)}n.length=0};Mw.prototype.isDestroyed=function(){return!1};Mw.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 de(this)};var w3=Mw;function v3(e){e=e??W.EMPTY_OBJECT,this.mode=e.mode??y_.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??W.EMPTY_OBJECT,this.varyings=e.varyings??W.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Ly.INHERIT,this._textureManager=new w3,this._defaultTexture=void 0,this.uniformMap=Ibt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Mbt(this),Lbt(this)}function Ibt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i],r=o.type;if(r===hA.SAMPLER_CUBE)throw new E("CustomShader does not support samplerCube uniforms");r===hA.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Obt(e,i)):n[i]=Rbt(e,i)}return n}function Obt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function Rbt(e,t){return function(){return e.uniforms[t].value}}function mA(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Mbt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;c(r)&&(o=e.usedVariablesVertex.attributeSet,mA(r,t,o),o=e.usedVariablesVertex.featureIdSet,mA(r,n,o),o=e.usedVariablesVertex.metadataSet,mA(r,i,o));let s=e.fragmentShaderText;if(c(s)){o=e.usedVariablesFragment.attributeSet,mA(s,t,o),o=e.usedVariablesFragment.featureIdSet,mA(s,n,o),o=e.usedVariablesFragment.metadataSet,mA(s,i,o);let a=/material\.(\w+)/g,l=e.usedVariablesFragment.materialSet;mA(s,a,l)}}function zAe(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 Nc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${zAe(t)} is not available in the ${i} shader. Did you mean ${zAe(n)} instead?`;throw new E(o)}}function Lbt(e){let t=e.usedVariablesVertex.attributeSet;Nc(t,"position","positionMC","vertex"),Nc(t,"normal","normalMC","vertex"),Nc(t,"tangent","tangentMC","vertex"),Nc(t,"bitangent","bitangentMC","vertex"),Nc(t,"positionWC","positionMC","vertex"),Nc(t,"positionEC","positionMC","vertex"),Nc(t,"normalEC","normalMC","vertex"),Nc(t,"tangentEC","tangentMC","vertex"),Nc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Nc(n,"position","positionEC","fragment"),Nc(n,"normal","normalEC","fragment"),Nc(n,"tangent","tangentEC","fragment"),Nc(n,"bitangent","bitangentEC","fragment"),Nc(n,"normalMC","normalEC","fragment"),Nc(n,"tangentMC","tangentEC","fragment"),Nc(n,"bitangentMC","bitangentEC","fragment")}v3.prototype.setUniform=function(e,t){if(T.typeOf.string("uniformName",e),T.defined("value",t),!c(this.uniforms[e]))throw new E(`Uniform ${e} must be declared in the CustomShader constructor.`);let n=this.uniforms[e];n.type===hA.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):c(t.clone)?n.value=t.clone(n.value):n.value=t};v3.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};v3.prototype.isDestroyed=function(){return!1};v3.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),de(this)};var pA=v3;function wg(e){if(T.typeOf.object("options",e),!c(e.loader)){if(!c(e.metadata))throw new E("One of loader and metadata must be defined.");if(!Array.isArray(e.metadata))throw new E("metadata must be an array of TypedArrays.")}let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(wg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});wg.fromMetadataArray=function(e){if(T.typeOf.object("metadata",e),!Array.isArray(e))throw new E("metadata must be an array of TypedArrays.");return new wg({metadata:e})};wg.fromGltf=async function(e){T.typeOf.object("resource",e);let t=new rh({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new wg({loader:t})};wg.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!c(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=Nbt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function Nbt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:l}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=l[o[f]].attribute,p=e.find(b=>b.name===h);if(!c(p))continue;let g=Nt.toComponentDatatype(s[f]),m=at.getComponentCount(r[f]),y=p.count*m;u[f]=$.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}wg.prototype.isDestroyed=function(){return!1};wg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),de(this)};var _A=wg;function mp(){this.orientedBoundingBox=new Dn,this.boundingSphere=new le,this.boundTransform=new B,this.shapeTransform=new B,this._minBounds=mp.DefaultMinBounds.clone(),this._maxBounds=mp.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new d,renderMaxBounds:new d,boxUvToShapeUvScale:new d,boxUvToShapeUvTranslate:new d},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var Fbt=new d,b$=new d,Bbt=new J,kbt=new d,Ubt=new d,Vbt=new d,zbt=new d,HAe=B.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new B);mp.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(kbt),o=o??n.clone(Ubt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,Vbt),s=d.clamp(n,i,o,zbt),a=B.getScale(e,b$);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=T$(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:l,shaderDefines:u}=this;for(let g in u)u.hasOwnProperty(g)&&(u[g]=void 0);let f=0;u.BOX_INTERSECTION_INDEX=f,f+=1,l.renderMinBounds=B.multiplyByPoint(HAe,r,l.renderMinBounds),l.renderMaxBounds=B.multiplyByPoint(HAe,s,l.renderMaxBounds),u.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,p=n;return l.boxUvToShapeUvScale=d.fromElements(2/(h.x===p.x?1:p.x-h.x),2/(h.y===p.y?1:p.y-h.y),2/(h.z===p.z?1:p.z-h.z),l.boxUvToShapeUvScale),l.boxUvToShapeUvTranslate=d.fromElements(-l.boxUvToShapeUvScale.x*(h.x*.5+.5),-l.boxUvToShapeUvScale.y*(h.y*.5+.5),-l.boxUvToShapeUvScale.z*(h.z*.5+.5),l.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=f,!0};var SG=new d,x$=new d;mp.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,a*t),O.lerp(r.y,s.y,a*n),O.lerp(r.z,s.z,a*i),SG),u=d.fromElements(O.lerp(r.x,s.x,a*(t+1)),O.lerp(r.y,s.y,a*(n+1)),O.lerp(r.z,s.z,a*(i+1)),x$);return T$(l,u,this.shapeTransform,o)};var GAe=new d;mp.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,GAe),s=d.multiplyByScalar(r,o,GAe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,SG),o,SG),l=d.add(a,s,x$),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),SG),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),x$);return T$(h,p,this.shapeTransform,i)};mp.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));mp.DefaultMaxBounds=Object.freeze(new d(1,1,1));function T$(e,t,n,i){let o=mp.DefaultMinBounds,r=mp.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=B.getTranslation(n,i.center),i.halfAxes=B.getMatrix3(n,i.halfAxes);else{let a=B.getScale(n,b$),l=d.midpoint(e,t,Fbt);i.center=B.multiplyByPoint(n,l,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),b$);let u=B.getRotation(n,Bbt);i.halfAxes=J.setScale(u,a,i.halfAxes)}return i}var gA=mp;function vg(){this.orientedBoundingBox=new Dn,this.boundingSphere=new le,this.boundTransform=new B,this.shapeTransform=new B,this._minBounds=vg.DefaultMinBounds.clone(),this._maxBounds=vg.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new H,cylinderRenderAngleMinMax:new H,cylinderRenderHeightMinMax:new H,cylinderUvToShapeUvRadius:new H,cylinderUvToShapeUvAngle:new H,cylinderUvToShapeUvHeight:new H,cylinderShapeUvAngleMinMax:new H,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 qAe=new d,Hbt=new d,Gbt=new d,jbt=new d,Wbt=new d;vg.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(Hbt),o=o??n.clone(Gbt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=vg,a=s.y-r.y,l=.5*a,u=O.EPSILON10,f=O.EPSILON3,h=O.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=O.negativePiToPi(t.y),n.y=O.negativePiToPi(n.y),i.y=O.negativePiToPi(i.y),o.y=O.negativePiToPi(o.y);let p=d.maximumByComponent(t,i,jbt),g=d.minimumByComponent(n,o,Wbt),m=B.getScale(e,qAe);if(g.x===0||p.x>g.x||p.z>g.z||O.equalsEpsilon(m.x,0,void 0,u)||O.equalsEpsilon(m.y,0,void 0,u)||O.equalsEpsilon(m.z,0,void 0,u))return!1;this.shapeTransform=B.clone(e,this.shapeTransform),this.orientedBoundingBox=E$(p,g,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let y=t.x===r.x&&n.x===s.x,b=n.y<t.y,x=n.y-t.y+b*a,A=x>l+h&&x<a-h,C=x<l-h,S=x>=l-h&&x<=l+h,v=A||C||S,P=O.equalsEpsilon(t.y,r.y,void 0,f),M=O.equalsEpsilon(n.y,s.y,void 0,f),R=t.z===r.z&&n.z===s.z,L=p.x===r.x,F=g.y<p.y,_=g.y-p.y+F*a,w=_>=l-h&&_<a-h,D=_>h&&_<l-h,I=_<=h,N=w||D||I,{shaderUniforms:k,shaderDefines:z}=this;for(let j in z)z.hasOwnProperty(j)&&(z[j]=void 0);let V=0;if(z.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=V,V+=1,L||(z.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,z.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=V,V+=1),k.cylinderRenderRadiusMinMax=H.fromElements(p.x,g.x,k.cylinderRenderRadiusMinMax),p.x===g.x&&(z.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!y){z.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let j=n.x-t.x,U=0,q=1;j!==0&&(U=1/j,q=-t.x/j),k.cylinderUvToShapeUvRadius=H.fromElements(U,q,k.cylinderUvToShapeUvRadius)}if(!R){z.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let j=n.z-t.z,U=0,q=1;j!==0&&(U=2/j,q=-(t.z+1)/j),k.cylinderUvToShapeUvHeight=H.fromElements(U,q,k.cylinderUvToShapeUvHeight)}if(k.cylinderRenderHeightMinMax=H.fromElements(p.z,g.z,k.cylinderRenderHeightMinMax),b&&(z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),N&&(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,z.CYLINDER_INTERSECTION_INDEX_ANGLE=V,w?(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,V+=1):D?(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,V+=2):I&&(z.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,V+=2),k.cylinderRenderAngleMinMax=H.fromElements(p.y,g.y,k.cylinderRenderAngleMinMax)),v){z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,P&&(z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),M&&(z.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let j=(t.y-r.y)/a,U=(n.y-r.y)/a,q=1-x/a;if(k.cylinderShapeUvAngleMinMax=H.fromElements(j,U,k.cylinderShapeUvAngleMinMax),k.cylinderShapeUvAngleRangeZeroMid=(U+.5*q)%1,x<=h)k.cylinderUvToShapeUvAngle=H.fromElements(0,1,k.cylinderUvToShapeUvAngle);else{let Y=a/x,te=-(t.y-r.y)/x;k.cylinderUvToShapeUvAngle=H.fromElements(Y,te,k.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=V,!0};var wG=new d,C$=new d;vg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,t*a),O.lerp(r.y,s.y,n*a),O.lerp(r.z,s.z,i*a),wG),u=d.fromElements(O.lerp(r.x,s.x,(t+1)*a),O.lerp(r.y,s.y,(n+1)*a),O.lerp(r.z,s.z,(i+1)*a),C$);return E$(l,u,this.shapeTransform,o)};var jAe=new d;vg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,jAe),s=d.multiplyByScalar(r,o,jAe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,wG),o,wG),l=d.add(a,s,C$),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),wG),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),C$);return E$(h,p,this.shapeTransform,i)};vg.DefaultMinBounds=Object.freeze(new d(0,-O.PI,-1));vg.DefaultMaxBounds=Object.freeze(new d(1,+O.PI,1));var qbt=5,Ybt=new Array(qbt),Xbt=new d,Kbt=new J,$bt=new B,Zbt=new B,Qbt=new B,A$=new B,Jbt=new d,ext=new d,txt=new d,YAe=new Array(8);for(let e=0;e<8;e++)YAe[e]=new d;function WAe(e,t,n){return Math.abs(se.dot(e,t))<n}function nxt(e){let t=B.getColumn(e,0,Jbt),n=B.getColumn(e,1,ext),i=B.getColumn(e,2,txt),o=O.EPSILON4;return WAe(t,n,o)&&WAe(n,i,o)}function ixt(e,t){let n=YAe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)B.multiplyByPoint(e,n[i],n[i]);return Dn.fromPoints(n,t)}function E$(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+O.TWO_PI:t.y,l=e.z,u=t.z,f=a-s,h=s+f*.5,p=Ybt,g=0;p[g++]=s,p[g++]=a,p[g++]=h,f>O.PI&&(p[g++]=h-O.PI_OVER_TWO,p[g++]=h+O.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let k=0;k<g;++k){let z=p[k]-h,V=Math.cos(z),j=Math.sin(z),U=V*o,q=j*o,Y=V*r,te=j*r;m=Math.min(m,U,Y),y=Math.min(y,q,te),b=Math.max(b,U,Y),x=Math.max(x,q,te)}let A=b-m,C=x-y,S=u-l,v=(m+b)*.5,P=(y+x)*.5,M=(l+u)*.5,R=d.fromElements(v,P,M,Xbt),L=J.fromRotationZ(h,Kbt),F=d.fromElements(A,C,S,qAe),_=B.fromScale(F,Qbt),w=B.fromRotation(L,Zbt),D=B.fromTranslation(R,$bt),I=B.multiplyTransformation(w,B.multiplyTransformation(D,_,A$),A$),N=B.multiplyTransformation(n,I,A$);return nxt(N)?Dn.fromTransformation(N,i):ixt(N,i)}var yA=vg;function Dg(){this.orientedBoundingBox=new Dn,this.boundingSphere=new le,this.boundTransform=new B,this.shapeTransform=new B,this._rectangle=new ce,this._minimumHeight=Dg.DefaultMinBounds.z,this._maximumHeight=Dg.DefaultMaxBounds.z,this._ellipsoid=new ie,this._translation=new d,this._rotation=new J,this.shaderUniforms={ellipsoidRadiiUv:new d,eccentricitySquared:0,evoluteScale:new H,ellipsoidInverseRadiiSquaredUv:new d,ellipsoidRenderLongitudeMinMax:new H,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidUvToShapeUvLongitude:new H,ellipsoidUvToShapeUvLatitude:new H,ellipsoidRenderLatitudeSinMinMax:new H,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new H},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 oxt=new d,rxt=new d,sxt=new d,axt=new d,cxt=new d,lxt=new d,uxt=new d,fxt=new d,dxt=new J,XAe=new d,KAe=new d,hxt=new ce;Dg.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Dg;i=i??r,o=o??s,T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n);let a=O.EPSILON10,l=O.EPSILON3,u=O.EPSILON10,f=O.EPSILON10,h=O.EPSILON3,p=B.getScale(e,fxt),g=d.clone(r,oxt);g.z=-d.minimumComponent(p);let m=d.clamp(t,g,s,rxt),y=d.clamp(n,g,s,sxt),b=d.clamp(i,g,s,axt),x=d.clamp(o,g,s,cxt),A=d.maximumByComponent(m,b,lxt),C=d.minimumByComponent(y,x,uxt),S=d.add(p,d.fromElements(y.z,y.z,y.z,XAe),XAe),v=d.maximumComponent(S),P=d.add(p,d.fromElements(C.z,C.z,C.z,KAe),KAe);if(A.y>C.y||A.y===s.y||C.y===r.y||A.z>C.z||O.equalsEpsilon(P,d.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(m.x,m.y,y.x,y.y),this._translation=B.getTranslation(e,this._translation),this._rotation=B.getRotation(e,this._rotation),this._ellipsoid=ie.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=y.z;let M=ce.fromRadians(A.x,A.y,C.x,C.y,hxt);this.orientedBoundingBox=S$(M,A.z,C.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=B.fromRotationTranslation(J.setScale(this._rotation,S,dxt),this._translation,this.shapeTransform),this.boundTransform=B.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,L=.5*R,F=C.x<A.x,_=C.x-A.x+F*R,w=_<=u,D=_>=L-u&&_<R-u,I=_>u&&_<L-u,N=w||D||I,k=y.x<m.x,z=y.x-m.x+k*R,V=z>L+u&&z<R-u,j=z>=L-u&&z<=L+u,U=z<L-u,q=V||j||U,Y=C.y<-h,te=C.y>=-h&&C.y<=+h,K=C.y>+h&&C.y<s.y-f,Z=Y||te||K,ee=A.y>r.y+f&&A.y<-h,me=A.y>=-h&&A.y<=+h,Te=A.y>+h,ue=ee||me||Te,ye=Z||ue,Ae=y.y-m.y,Pe=y.y<-h,Ee=y.y>=-h&&y.y<=+h,ze=y.y>+h&&y.y<s.y-f,qe=Pe||Ee||ze,it=m.y>r.y+f&&m.y<-h,Dt=m.y>=-h&&m.y<=+h,jt=m.y>+h,un=qe||(it||Dt||jt),{shaderUniforms:zt,shaderDefines:Ct}=this;for(let mt in Ct)Ct.hasOwnProperty(mt)&&(Ct[mt]=void 0);zt.ellipsoidRadiiUv=d.divideByScalar(S,v,zt.ellipsoidRadiiUv);let{x:Ei,z:an}=zt.ellipsoidRadiiUv,_e=an/Ei;zt.eccentricitySquared=1-_e*_e,zt.evoluteScale=H.fromElements((Ei*Ei-an*an)/Ei,(an*an-Ei*Ei)/an,zt.evoluteScale),zt.ellipsoidInverseRadiiSquaredUv=d.divideComponents(d.ONE,d.multiplyComponents(zt.ellipsoidRadiiUv,zt.ellipsoidRadiiUv,zt.ellipsoidInverseRadiiSquaredUv),zt.ellipsoidInverseRadiiSquaredUv);let Ce=0;Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ce,Ce+=1,Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ce,Ce+=1,zt.clipMinMaxHeight=H.fromElements((A.z-y.z)/v,(C.z-y.z)/v,zt.clipMinMaxHeight);let pn=(y.z-m.z)/v;if(zt.ellipsoidInverseHeightDifferenceUv=1/pn,m.z===y.z&&(zt.ellipsoidInverseHeightDifferenceUv=0),N&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ce,D?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ce+=1):I?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ce+=2):w&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ce+=2),zt.ellipsoidRenderLongitudeMinMax=H.fromElements(A.x,C.x,zt.ellipsoidRenderLongitudeMinMax)),q)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<m.x&&(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),z<=u)zt.ellipsoidUvToShapeUvLongitude=H.fromElements(0,1,zt.ellipsoidUvToShapeUvLongitude);else{let so=R/z,Ro=-(m.x-r.x)/z;zt.ellipsoidUvToShapeUvLongitude=H.fromElements(so,Ro,zt.ellipsoidUvToShapeUvLongitude)}if(N){let mt=O.equalsEpsilon(A.x,r.x,void 0,l),so=O.equalsEpsilon(C.x,s.x,void 0,l);mt&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),so&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Ro=(m.x-r.x)/R,aa=(y.x-r.x)/R,Nr=(C.x-r.x)/R,Cs=1-_/R,Ne=(Nr+.5*Cs)%1;zt.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(Ro,aa,Ne,zt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(ue&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ce,ee?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ce+=1):me?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ce+=1):Te&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ce+=2)),Z&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ce,Y?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ce+=2):te?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ce+=1):K&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ce+=1)),zt.ellipsoidRenderLatitudeSinMinMax=H.fromElements(Math.sin(A.y),Math.sin(C.y),zt.ellipsoidRenderLatitudeSinMinMax)),un)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ae<f)zt.ellipsoidUvToShapeUvLatitude=H.fromElements(0,1,zt.ellipsoidUvToShapeUvLatitude);else{let so=(s.y-r.y)/Ae,Ro=(r.y-m.y)/Ae;zt.ellipsoidUvToShapeUvLatitude=H.fromElements(so,Ro,zt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ce,!0};var QAe=new ce;Dg.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,l=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,l,a,u,QAe),g=O.lerp(this._minimumHeight,this._maximumHeight,f),m=O.lerp(this._minimumHeight,this._maximumHeight,h);return S$(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var $Ae=new d,ZAe=new d,mxt=new d;Dg.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,$Ae),s=d.multiplyByScalar(r,o,$Ae),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,ZAe),o,ZAe),l=d.add(a,s,mxt),u=ce.subsection(this._rectangle,a.x,a.y,l.x,l.y,QAe),f=O.lerp(this._minimumHeight,this._maximumHeight,a.z),h=O.lerp(this._minimumHeight,this._maximumHeight,l.z);return S$(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function S$(e,t,n,i,o,r,s){return s=Dn.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=J.multiply(s.halfAxes,r,s.halfAxes),s}Dg.DefaultMinBounds=Object.freeze(new d(-O.PI,-O.PI_OVER_TWO,-ie.WGS84.minimumRadius));Dg.DefaultMaxBounds=Object.freeze(new d(O.PI,O.PI_OVER_TWO,10*ie.WGS84.maximumRadius));var bA=Dg;var af={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};af.getMinBounds=function(e){switch(e){case af.BOX:return gA.DefaultMinBounds;case af.ELLIPSOID:return bA.DefaultMinBounds;case af.CYLINDER:return yA.DefaultMinBounds;default:throw new E(`Invalid shape type ${e}`)}};af.getMaxBounds=function(e){switch(e){case af.BOX:return gA.DefaultMaxBounds;case af.ELLIPSOID:return bA.DefaultMaxBounds;case af.CYLINDER:return yA.DefaultMaxBounds;default:throw new E(`Invalid shape type ${e}`)}};af.getShapeConstructor=function(e){switch(e){case af.BOX:return gA;case af.ELLIPSOID:return bA;case af.CYLINDER:return yA;default:throw new E(`Invalid shape type ${e}`)}};var va=Object.freeze(af);function Yh(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),c(e.maximumLength)&&T.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=c(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Yh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(c(e)){for(T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Yh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Yh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Yh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(c(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Yh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)JAe(this,t)};Yh.prototype.insert=function(e){let t,n=this._maximumLength;if(c(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++,JAe(this,i),t};Yh.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],eCe(this,0)),this._array[e-1]=void 0,t};Yh.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=w$(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&eCe(this,n)}return this._array[e-1]=void 0,t};Yh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Yh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[w$(this,1,2)?1:2]};function vG(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function D3(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function w$(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function JAe(e,t){if(t===0)return;let n=Math.floor(O.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=D3(e,t,i);for(o!==n&&(vG(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(D3(e,t,r)!==o)break;vG(e,t,r),t=r}}function eCe(e,t){let n=e._length,i=Math.floor(O.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){D3(e,s,r)===i&&(r=s);let a=2*o+1,l=Math.max(Math.min(n-a,4),0);for(let u=0;u<l;u++){let f=a+u;D3(e,f,r)===i&&(r=f)}}if(D3(e,r,t)===i&&(vG(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);w$(e,r,a)===i&&vG(e,r,a)}t=r}}var xA=Yh;var v$=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function P3(e,t){this.spatialNode=e,this.keyframe=t,this.state=v$.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}P3.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=v$.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};P3.priorityComparator=function(e,t){return e.priority-t.priority};P3.searchComparator=function(e,t){return e.keyframe-t.keyframe};P3.LoadState=v$;var go=P3;function k0(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32),i===Nt.FLOAT32&&!e.floatingPointTexture)throw new ae("Floating point texture not supported");let s=pxt(i),a=_xt(n,e.webgl2),l=Nt.getSizeInBytes(i),u=gxt(o,n,l),f=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/f),p=f*t.x,g=h*t.y,m=Math.floor(u/p),y=Math.floor(u/g);if(m===0||y===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=l*n*u**2,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=m*y,this.regionCountPerMegatexture=new H(m,y),this.voxelCountPerRegion=new H(p,g),this.sliceCountPerRegion=new H(f,h),this.voxelSizeUv=new H(1/u,1/u),this.sliceSizeUv=new H(t.x/u,t.y/u),this.regionSizeUv=new H(p/u,g/u),this.texture=new Rt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR})});let b=Nt.toComponentDatatype(i);this.tileVoxelDataTemp=$.createTypedArray(b,p*g*n),this.nodes=new Array(this.maximumTileCount);for(let x=0;x<this.maximumTileCount;x++)this.nodes[x]=new yxt(x);for(let x=0;x<this.maximumTileCount;x++){let A=this.nodes[x];A.previousNode=x>0?this.nodes[x-1]:void 0,A.nextNode=x<this.maximumTileCount-1?this.nodes[x+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function pxt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function _xt(e,t){if(e===1)return t?ke.RED:ke.LUMINANCE;if(e===2)return t?ke.RG:ke.LUMINANCE_ALPHA;if(e===3)return ke.RGB;if(e===4)return ke.RGBA}function gxt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(ut.maximumTextureSize,O.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function yxt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}k0.prototype.add=function(e){if(this.isFull())throw new E("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,c(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,c(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};k0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new E("Megatexture index out of bounds");let t=this.nodes[e];c(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),c(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,c(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};k0.prototype.isFull=function(){return this.emptyList===void 0};k0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32);let o=Nt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),l=s*t.x,u=a*t.y,f=O.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/l),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};k0.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:l}=this;for(let g=0;g<o.z;g++){let m=g%r.x*o.x,y=Math.floor(g/r.x)*o.y;for(let b=0;b<o.y;b++){let x=bxt(o,b,g),A=(y+b)*s.x+m;for(let C=0;C<o.x;C++){let S=x+C,v=A+C;for(let P=0;P<a;P++)i[v*a+P]=n[S*a+P]}}}let u=e%l.x*s.x,f=Math.floor(e/l.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(p)};function bxt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),de(this)};var Lw=k0;function Ad(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=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Dn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var xxt=new d;Ad.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=J.getScale(this.orientedBoundingBox.halfAxes,xxt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};Ad.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,l=s+1,u=r+1,f=a+1,h=t+1,p=[[h,r,s,a],[h,u,s,a],[h,r,l,a],[h,u,l,a],[h,r,s,f],[h,u,s,f],[h,r,l,f],[h,u,l,f]];this.children=p.map(([g,m,y,b])=>new Ad(g,m,y,b,this,e,this.dimensions))};Ad.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Ad.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,O.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var tCe={keyframe:0};function I3(e,t){return tCe.keyframe=e,Lo(t,tCe,go.searchComparator)}Ad.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;c(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=Txt(i,h),g=h[p],m=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),y=h[m],b=i-g.keyframe,x=nCe(n-t.level,b);x<a&&(a=x,r=g);let A=y.keyframe-o,C=nCe(n-t.level,A);if(C<l&&(l=C,s=y),b===0&&A===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!c(r)||!c(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:O.clamp((e-u)/(f-u),0,1)};function Txt(e,t){let n=I3(e,t);return n<0?O.clamp(~n-1,0,t.length-1):n}function nCe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Ad.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Ad.prototype.createKeyframeNode=function(e){let t=I3(e,this.keyframeNodes);if(t<0){t=~t;let n=new go(this,e);this.keyframeNodes.splice(t,0,n)}};Ad.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=I3(n,this.keyframeNodes);if(i<0)throw new E("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=I3(n,this.renderableKeyframeNodes);if(o<0)throw new E("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Ad.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new E("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=I3(e.keyframe,i);if(o>=0)throw new E("Keyframe already renderable");o=~o,i.splice(o,0,e)};Ad.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return c(t)&&c(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var O3=Ad;function U0(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:l,componentTypes:u,metadataOrder:f}=o,h=d.add(r,s,new d);if(d.add(h,a,h),f===Td.Y_UP){let C=h.y;h.y=h.z,h.z=C}!c(i)&&c(o.maximumTileCount)&&(i=Lxt(o.maximumTileCount,h,l,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(l.length);for(let C=0;C<l.length;C++){let S=l[C],v=at.getComponentCount(S),P=u[C];this.megatextures[C]=new Lw(t,h,v,P,i),this.textureMemoryByteLength+=this.megatextures[C].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let g=e._shape;this.rootNode=new O3(0,0,0,0,void 0,g,r),this._priorityQueue=new xA({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 m=this._binaryTreeKeyframeWeighting;m[0]=0,m[n-1]=0,D$(m,1,n-2,0);let y=9,b=2048,x=Math.floor(b/y),A=Math.ceil(p/x);this.internalNodeTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:b,height:A,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})}),this.internalNodeTilesPerRow=x,this.internalNodeTexelSizeUv=new H(1/b,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new H}U0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function D$(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,D$(e,t,o-1,i+1),D$(e,o+1,n,i+1)}U0.simultaneousRequestCountMaximum=50;U0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,l=o._levelBlendFactor,u=l>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!c(this.leafNodeTexture)){let C=Math.floor(512),S=Math.ceil(s/C);this.leafNodeTexture=new Rt({context:r,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:S,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})}),this.leafNodeTexelSizeUv=H.fromElements(1/1024,1/S,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=C}else!p&&c(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=O.clamp(t,0,a-1),n&&iCe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ti();Ext(this,e),Sxt(this,e);let m=Ti();Ixt(this,h,l);let y=Ti(),b=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||b){let x=m-g,A=y-m,C=y-g;Pxt(this,e,x,A,C)}};U0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};U0.prototype.isDestroyed=function(){return!1};U0.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(),de(this)};function iCe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),c(t.children))for(let n=0;n<8;n++){let i=t.children[n];iCe(e,i)}}function Axt(e,t){if(e._simultaneousRequestCount>=U0.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(c(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=c(f)?go.LoadState.PROCESSING:go.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let l={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(l);c(u)&&(e._simultaneousRequestCount++,t.state=go.LoadState.RECEIVING,u.then(s).catch(a))}function Cxt(e){return e/(1+e)}function Ext(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),oCe(e.rootNode,_s.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 Sxt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(wxt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,l=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===go.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===go.LoadState.UNLOADED&&Axt(e,f),f.state===go.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!vxt(h.metadata,e)){f.content=void 0,f.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+l,l++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=go.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function wxt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function vxt(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:l,z:u}=r,f=a*l*u,h=e[o],p=f*s;if(h.length!==p)return!1}return!0}function oCe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:l,frustum:u}=o,h=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(l,h),t=e.visibility(i,t),t===_s.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,b=n._keyframeCount,x=O.clamp(Math.floor(n._keyframeLocation),0,b-2),A=x+1;if(b===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==b)for(let M=0;M<b;M++)e.createKeyframeNode(M);let{screenSpaceError:C,keyframeNodes:S}=e,v=Cxt(C),P=!1;for(let M=0;M<S.length;M++){let R=S[M];R.priority=10*v+Dxt(x,R.keyframe,A,n),R.state!==go.LoadState.UNAVAILABLE&&R.state!==go.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===go.LoadState.LOADED&&(P=!0)}if(C<m||!P){e.children=void 0;return}c(e.children)||e.constructChildNodes(g);for(let M=0;M<8;M++){let R=e.children[M];oCe(R,t,n,i)}}function Dxt(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 O.lerp(a,s,.15+.85*s)}function Pxt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(go.LoadState).length,l=new Array(a),u=new Array(a),f=0;for(let P=0;P<a;P++){let M=new Array(r).fill(0);l[P]=M,u[P]=0}function h(P){let M=P.keyframeNodes;for(let R=0;R<M.length;R++){let L=M[R],F=L.keyframe,_=L.state;l[_][F]+=1,u[_]+=1,f++}if(c(P.children))for(let R=0;R<8;R++){let L=P.children[R];h(L)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=u[go.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[go.LoadState.RECEIVING],g=u[go.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(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 b=`KEYFRAMES: ${l[go.LoadState.LOADED]}`,x=`UNLOADED: ${u[go.LoadState.UNLOADED]} | RECEIVING: ${u[go.LoadState.RECEIVING]} | PROCESSING: ${u[go.LoadState.PROCESSING]} | LOADED: ${u[go.LoadState.LOADED]} | FAILED: ${u[go.LoadState.FAILED]} | UNAVAILABLE: ${u[go.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,A=Math.round(n*100)/100,C=Math.round(i*100)/100,S=Math.round(o*100)/100,v=`LOAD: ${A} | OCT: ${C} | ALL: ${S}`;console.log(`${b} || ${x} || ${v}`)}var DG={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Ixt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,l=0,u=[],f=[];function h(g,m,y,b,x){let A=!1;if(c(g.children))for(let C=0;C<8;C++){let S=g.children[C];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(A=!0)}if(A){u[x]=DG.INTERNAL<<16|m,u[y]=b,a++,b=m,x=b*9+1;for(let C=0;C<8;C++){let S=g.children[C];m=a,y=m*9+0,h(S,m,y,b,x+C)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let C=l*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,P=S.spatialNode.parent,M=c(P)?P.renderableKeyframeNodePrevious:S,R=Oxt(g,i,n),L=v,F=1,_=S.megatextureIndex,w=M.megatextureIndex;f[C+0]=R,f[C+1]=L,f[C+2]=F,f[C+3]=_,f[C+4]=w,u[x]=DG.LEAF<<16|l}else{let C=g.renderableKeyframeNodePrevious,v=g.level-C.spatialNode.level===0?DG.LEAF:DG.PACKED_LEAF_FROM_PARENT;u[x]=v<<16|C.megatextureIndex}l++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),Rxt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&Mxt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Oxt(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 O.clamp(s,0,1)}function Rxt(e,t,n,i){let o=ke.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)),l=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let m=0;m<o;m++)l[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:l,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function Mxt(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),l=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*l*o);for(let p=0;p<s;p++){let g=e[p*r+0],m=e[p*r+1],y=e[p*r+2],b=e[p*r+3],x=e[p*r+4],A=O.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=A>>>0&255,u[p*8+1]=A>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=x>>>0&255,u[p*8+7]=x>>>8&255}let h={source:{arrayBufferView:u,width:a,height:l},xOffset:0,yOffset:0};i.copyFrom(h)}function Lxt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=i[s],u=at.getComponentCount(a);o+=Lw.getApproximateTextureMemoryByteLength(e,t,u,l)}return o}var R3=U0;function pp(e){e=e??W.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??pp.DefaultProvider,this._traversal=void 0,this._statistics=new gh,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new d,this._inputDimensions=new d,this._paddingBefore=new d,this._paddingAfter=new d,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._exaggeratedMinBounds=new d,this._exaggeratedMinBoundsOld=new d,this._exaggeratedMaxBounds=new d,this._exaggeratedMaxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._exaggeratedModelMatrix=B.clone(this._modelMatrix),this._compoundModelMatrix=new B,this._compoundModelMatrixOld=new B,this._customShader=e.customShader??pp.DefaultCustomShader,this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new B,this._transformPositionUvToWorld=new B,this._transformDirectionWorldToLocal=new J,this._transformNormalLocalToWorld=new J,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new dh,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new H,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new H,megatextureTextures:[],megatextureSliceDimensions:new H,megatextureTileDimensions:new H,megatextureVoxelSizeUv:new H,megatextureSliceSizeUv:new H,megatextureTileSizeUv:new H,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToUv:new B,transformPositionUvToView:new B,transformDirectionViewToLocal:new J,transformNormalLocalToWorld:new J,cameraPositionUv:new d,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new B,stepSize:0,pickColor:new G},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 pe,this.tileVisible=new pe,this.tileFailed=new pe,this.tileUnload=new pe,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe;let i=this._provider;Nxt(this,i)}function Nxt(e,t){let{shape:n,minBounds:i=va.getMinBounds(n),maxBounds:o=va.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=B.clone(e._modelMatrix,e._exaggeratedModelMatrix),sCe(e,t);let r=va.getShapeConstructor(n);e._shape=new r,e._shapeVisible=aCe(e,e._shape,t)}Object.defineProperties(pp.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){T.typeOf.object("modelMatrix",e),this._modelMatrix=B.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){T.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){T.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){T.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){T.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){T.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){T.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=O.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){T.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){T.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){T.defined("minBounds",e),this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){T.defined("maxBounds",e),this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){T.defined("minClippingBounds",e),this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){T.defined("maxClippingBounds",e),this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.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];c(e)?this._customShader=e:this._customShader=pp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var Fxt=new se,Bxt=new se,kxt=new d,Uxt=new d,Vxt=new J,zxt=new J,Hxt=new B,Gxt=new B,jxt=new B,Wxt=B.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new B),qxt=B.fromRotationTranslation(J.fromUniformScale(2,new J),new d(-1,-1,-1),new B);pp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Qxt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}$xt(this,e);let i=sCe(this,t),o=this._shape;if(i&&(this._shapeVisible=aCe(this,o,t),eTt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=tTt(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&&lTt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),nTt(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;c(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=H.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(E3(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=rTt(p,h,Bxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=se.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;f.transformPositionViewToUv=B.multiplyTransformation(this._transformPositionWorldToUv,y,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=B.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let x=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=J.multiply(this._transformDirectionWorldToLocal,x,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=J.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let A=e.camera.positionWC;f.cameraPositionUv=B.multiplyByPoint(this._transformPositionWorldToUv,A,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let C=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;C.boundingVolume=o.boundingSphere,e.commandList.push(C)};var Yxt=new d,P$=new d,Xxt=new he,Kxt=new d;function $xt(e,t){if(e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===va.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{let n=d.fromElements(1,1,t.verticalExaggeration,Yxt);e._exaggeratedModelMatrix=B.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=B.multiplyByTranslation(e._exaggeratedModelMatrix,Zxt(e,t),e._exaggeratedModelMatrix)}}function Zxt(e,t){let{shapeTransform:n=B.IDENTITY,globalTransform:i=B.IDENTITY}=e._provider,o=B.getTranslation(n,P$),r=B.multiplyByPoint(e._modelMatrix,o,P$),s=B.multiplyByPoint(i,r,P$),l=ie.WGS84.cartesianToCartographic(s,Xxt),u=0;c(l)&&(u=l.height);let f=Dr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return d.fromElements(0,0,(f-u)/t.verticalExaggeration,Kxt)}function Qxt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=G.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=je(o,!0);let s=e._uniformMap;for(let l in r)if(r.hasOwnProperty(l)){let u=`u_${l}`;c(s[u])&&dt(`VoxelPrimitive: Uniform name "${u}" is already defined`),s[u]=function(){return r[l]}}if(e._dimensions=d.clone(t.dimensions,e._dimensions),i.dimensions=d.clone(e._dimensions,i.dimensions),e._paddingBefore=d.clone(t.paddingBefore??d.ZERO,e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(t.paddingAfter??d.ZERO,e._paddingAfter),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=d.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=d.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===Td.Y_UP){let l=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=l}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new R3(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,Jxt(e._traversal,i)}function sCe(e,t){let n=t.shapeTransform??B.IDENTITY,i=t.globalTransform??B.IDENTITY;return B.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),B.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),TA(e,"_compoundModelMatrix","_compoundModelMatrixOld")+TA(e,"_minBounds","_minBoundsOld")+TA(e,"_maxBounds","_maxBoundsOld")+TA(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+TA(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+TA(e,"_minClippingBounds","_minClippingBoundsOld")+TA(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function TA(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function aCe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=B.inverse(o,Hxt),s=B.getRotation(o,Vxt),a=B.getScale(o,kxt),l=d.maximumComponent(a),u=d.divideByScalar(a,l,Uxt),f=J.multiplyByScale(s,u,zxt);return e._transformPositionWorldToUv=B.multiplyTransformation(Wxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=B.multiplyTransformation(o,qxt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=B.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=J.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function Jxt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=H.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=H.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=H.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=H.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=H.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=H.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function eTt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=je(n,!0)),i}function tTt(e,t){if(!c(e)||!c(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 nTt(e,t){let n=e.clippingPlanes;if(!c(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=B.transpose(B.multiplyTransformation(B.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)}pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){let e=this._drawCommand;c(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return c(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(),de(this)};var rCe=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)),iTt=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),oTt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function rTt(e,t,n){let i=B.fromRotationTranslation(e.halfAxes,e.center,Gxt),o=B.multiply(t,i,jxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,l=-Number.MAX_VALUE,u,f=oTt,h=rCe.length;for(u=0;u<h;u++)B.multiplyByVector(o,rCe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,m),l=Math.max(l,m)}else for(let g=0;g<3;g++){let m=iTt[u*3+g],y=f[m];if(y.z>=-y.w){let b=p.z+p.w,x=y.z+y.w,A=b/(b-x),C=se.lerp(p,y,A,Fxt),S=C.x/C.w,v=C.y/C.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),l=Math.max(l,v)}}}return r=O.clamp(r,-1,1),a=O.clamp(a,-1,1),s=O.clamp(s,-1,1),l=O.clamp(l,-1,1),n=se.fromElements(r,a,s,l,n),n}var I$=3e7,sTt=new d(I$,0,0),aTt=new d(0,I$,0),cTt=new d(0,0,I$);function lTt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(l,u,f,h){i.add({positions:[l,u],width:h,material:Xi.fromType("Color",{color:f})})}function r(l,u,f){let h=l.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function s(l){if(!n.isRenderable(l))return;let u=l.level,h=Math.max(1,5/Math.pow(2,u)),g=[G.RED,G.LIME,G.BLUE][u%3];if(r(l.orientedBoundingBox,g,h),c(l.children))for(let m=0;m<8;m++)s(l.children[m])}r(e._shape.orientedBoundingBox,G.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,sTt,G.RED,a),o(d.ZERO,aTt,G.LIME,a),o(d.ZERO,cTt,G.BLUE,a),i.update(t)}pp.DefaultCustomShader=new pA({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;var k4=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; +out vec2 v_position; +void main() { - material.diffuse = vec3(1.0); - material.alpha = 1.0; -}`});function cCe(){this.ready=!0,this.shape=va.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[at.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}cCe.prototype.requestData=function(e){if((c(e)?e.tileLevel??0:0)>=1)return;let n=new _A({metadata:[new Float32Array(1)]});return Promise.resolve(n)};pp.DefaultProvider=new cCe;var V0=pp;function uTt(e,t,n,i){if(!c(e)||c(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!c(r))return;let a=(r.properties||{})[i];if(c(a))return a}var M3=uTt;function fTt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var L3=fTt;function dTt(e,t,n){if(!c(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(c(a))return a}}var N3=dTt;var IG=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ci(e){e=e??W.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=je(e.contextOptions);if(!c(t))throw new E("options and options.canvas are required.");let r=c(n),s=new AI(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)),c(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new dB,this._frameState=new uB(s,new tB(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new Pv(s),this._ellipsoid=e.ellipsoid??ie.default,this._globe=void 0,this._globeTranslucencyState=new fB,this._primitives=new fl,this._groundPrimitives=new fl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ci.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new lA,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new aB(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ei({color:new G,stencil:0,owner:this}),this._depthClearCommand=new ei({depth:1,owner:this}),this._stencilClearCommand=new ei({stencil:0}),this._classificationStencilClearCommand=new ei({stencil:0,renderState:Ve.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new ZB(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new s3,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,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=G.clone(G.BLACK),this._mode=oe.SCENE3D,this._mapProjection=c(e.mapProjection)?e.mapProjection:new Oi(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 Ex,this.fog=new lB,this.fog.enabled=ie.WGS84.equals(this._ellipsoid),ie.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new Tg({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=G.clone(G.WHITE),this._actualInvertClassificationColor=G.clone(this._invertClassificationColor),this._invertClassification=new ww,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new XB,this._brdfLutGenerator=new K2,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new t3(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??ru.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=sc.requestCompletedEvent.addEventListener(IG(this)),this._removeTaskProcessorListenerCallback=yi.taskCompletedEvent.addEventListener(IG(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),l=new ro(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new wB(this),this._defaultView=new tA(this,l,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 Rp,hCe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}ci.defaultLogDepthBuffer=!0;function hTt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];c(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(IG(e))),n.push(t.terrainProviderChanged.addEventListener(IG(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ci.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 ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ut.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 Yd.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,hTt(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(c(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(c(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),c(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(c(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){if(this.scene3DOnly&&e!==oe.SCENE3D)throw new E("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===oe.SCENE2D)this.morphTo2D(0);else if(e===oe.SCENE3D)this.morphTo3D(0);else if(e===oe.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new E("value must be a valid SceneMode enumeration.");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){if(this.camera.frustum instanceof on)throw new E("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new cB(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){if(!c(e)||e<0)throw new E("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");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,ut.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}}});ci.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 mTt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function lCe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,l=t.derivedCommands;c(t.pickId)&&(l.picking=ap.createPickDerivedCommand(e,t,o,l.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,c(t.pickedMetadataInfo)&&(l.pickingMetadata=ap.createPickMetadataDerivedCommand(e,t,o,l.pickingMetadata))),t.pickOnly||(l.depth=ap.createDepthOnlyDerivedCommand(e,t,o,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=ap.createHdrCommand(t,o,l.hdr),t=l.hdr.command,l=t.derivedCommands),a&&t.receiveShadows&&(l.shadows=Tg.createReceiveDerivedCommand(s,t,n,o,l.shadows)),t.pass===De.TRANSLUCENT&&c(r)&&r.isSupported()&&(a&&t.receiveShadows?(l.oit=c(l.oit)?l.oit:{},l.oit.shadows=r.createDerivedCommands(l.shadows.receiveCommand,o,l.oit.shadows)):l.oit=r.createDerivedCommands(t,o,l.oit))}ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!c(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 l=this._hdr,u=c(t.logDepth),f=c(t.hdr),h=c(t.originalCommand),p=o&&!u,g=l&&!f,m=(!o||!l)&&!h,y=n.pickingMetadata&&mTt(e,n);if(e.dirty=e.dirty||p||g||m||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=Tg.createCastDerivedCommand(x,e,s,r,t.shadows)),(u||p)&&(t.logDepth=ap.createLogDepthCommand(e,r,t.logDepth),lCe(this,t.logDepth.command,s)),(h||m)&&lCe(this,e,s)};var pTt=new gd({pass:Uo.RENDER}),O$=new gd({pass:Uo.PRELOAD}),R$=new gd({pass:Uo.PRELOAD_FLIGHT}),_Tt=new gd({pass:Uo.REQUEST_RENDER_MODE_DEFER_CHECK}),uCe=new le,M$;function gTt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return uCe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,M$=Y2.fromBoundingSphere(uCe,e.camera.positionWC,M$),M$}ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function hCe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}ci.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=gTt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof on||this.camera.frustum instanceof jo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;c(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,c(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=G.clone(this.invertClassificationColor,this._actualInvertClassificationColor),ww.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,c(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ci.prototype.isVisible=function(e,t,n){if(!c(t))return!1;let{boundingVolume:i}=t;return!c(i)||!t.cull?!0:e.computeVisibility(i)===Wt.OUTSIDE?!1:!c(n)||!t.occlude||!i.isOccluded(n)};var PG=new B(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);PG=B.inverseTransformation(PG,PG);function yTt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==oe.SCENE3D){a=B.multiplyByPoint(PG,a,a);let m=o.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let l,u,{radius:f}=s;c(f)?(l=Js.createGeometry(new Js({radii:new d(f,f,f),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=B.fromTranslation(a)):(l=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=B.fromRotationTranslation(s.halfAxes,a,new B)),t._debugVolume=new Pn({geometryInstances:new St({geometry:Nn.toWireframe(l),modelMatrix:u,attributes:{color:new Gt(1,0,0,1)}}),appearance:new rn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=ap.createLogDepthCommand(e,r).command);let g;c(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),c(g)&&(n.framebuffer=g),o.commandList=h}function _p(e,t,n,i){let o=t._frameState,r=t._context;if(c(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ei){e.execute(r,n);return}e.debugShowBoundingVolume&&c(e.boundingVolume)&&yTt(e,t,n,i),o.useLogDepth&&c(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&c(e.derivedCommands)&&c(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&c(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&c(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(c(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&&c(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function fCe(e,t,n){let{derivedCommands:i}=e;if(!c(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&c(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:l}=e.derivedCommands;c(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),c(s)?(e=s.pickCommand,e.execute(r,n)):c(l)&&(e=l.depthOnlyCommand,e.execute(r,n))}function mCe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function bTt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+O.EPSILON12}function xTt(e,t,n,i,o){gg(i,mCe,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function TTt(e,t,n,i,o){gg(i,bTt,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ATt(e,t,n){e.context.uniformState.updatePass(De.VOXELS);let i=n.commands[De.VOXELS];i.length=n.indices[De.VOXELS],gg(i,mCe,e.camera.positionWC);for(let o=0;o<i.length;++o)_p(i[o],e,t)}var CTt=new Ci,ETt=new bl,STt=new on,wTt=new jo;function vTt(e){let{frustum:t}=e;return c(t.fov)?t.clone(CTt):c(t.infiniteProjectionMatrix)?t.clone(ETt):c(t.width)?t.clone(STt):t.clone(wTt)}function DTt(e){if(e._environmentState.useOIT){if(!c(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?xTt:TTt}function PTt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,l;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=e._invertClassification);let u=DTt(e);o.uniformState.updatePass(De.TRANSLUCENT);let f=n.commands[De.TRANSLUCENT];f.length=n.indices[De.TRANSLUCENT],u(e,_p,t,f,l)}function ITt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[De.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[De.TRANSLUCENT];i.executeTranslucentCommands(e,_p,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,_p,t,n)}function N$(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=vTt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,l=a.pick||a.pickVoxel;l||OTt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:b,sceneFramebuffer:x,frustumCommandsList:A}=e._view,C=A.length,S=e._globeTranslucencyState,v=e._depthClearCommand,P=e._stencilClearCommand,M=e._classificationStencilClearCommand,R=e._depthPlane,L=n.position.z;function F(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)_p(I[k],e,t);return N}function _(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)fCe(I[k],e,t)}for(let w=0;w<C;++w){let D=C-w-1,I=A[D];e.mode===oe.SCENE2D?(n.position.z=L-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&P.execute(i,t),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,_p,b,e,t)):F(I,De.GLOBE),p&&y.executeCopyDepth(i,t),f||(S.translucent?(r.updatePass(De.TERRAIN_CLASSIFICATION),S.executeGlobeClassificationCommands(I,_p,b,e,t)):F(I,De.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),h&&R.execute(i,t));let N;if(!g||l||f)N=F(I,De.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=F(I,De.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let z=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=F(I,De.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=F(I,De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=z,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&M.execute(i,t),N=F(I,De.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&P.execute(i,t),ATt(e,t,I),F(I,De.OPAQUE),D!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),PTt(e,t,I),ITt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let z=e._picking.getPickDepth(e,D);z.update(i,y.depthStencilTexture),z.executeCopyDepth(i,t)}if(l||!m)continue;let k=t.framebuffer;t.framebuffer=x.getIdFramebuffer(),s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,fCe,b,e,t)):_(I,De.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&h&&R.execute(i,t),_(I,De.CESIUM_3D_TILE),_(I,De.OPAQUE),_(I,De.TRANSLUCENT),t.framebuffer=k}}function OTt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(De.ENVIRONMENT),c(i.skyBoxCommand)&&_p(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&_p(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 pCe(e){e.context.uniformState.updatePass(De.COMPUTE);let t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function RTt(e,t){e.context.uniformState.updatePass(De.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function MTt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[De.GLOBE,De.CESIUM_3D_TILE,De.OPAQUE,De.TRANSLUCENT];for(let l=0;l<t.length;++l){let u=t[l];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function _Ce(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 l=o[a];if(l.outOfView)continue;let{passes:u}=l;for(let f=0;f<u.length;++f)u[f].commandList.length=0;MTt(e,n,l);for(let f=0;f<u.length;++f){let h=l.passes[f],{camera:p,commandList:g}=h;s.updateCamera(p),l.updatePass(r,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let b=y.derivedCommands.shadows.castCommands[a];_p(b,e,h.passState)}}}}var LTt=new d;ci.prototype.updateAndExecuteCommands=function(e,t){YTt(this,e,t),this._environmentState.useWebVR?NTt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===ru.ROTATE?z0(!0,this,e):jTt(this,e)};function NTt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;gCe(e),n.createPotentiallyVisibleSet(e),pCe(e),r||_Ce(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 l=i.frustum.near,u=l*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(a.right,f*.5,LTt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*l/u;d.add(a.position,h,i.position),i.frustum.xOffset=p,N$(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-p,N$(e,t),ro.clone(a,i)}var FTt=new he(Math.PI,O.PI_OVER_TWO),BTt=new d,kTt=new d,UTt=new B,VTt=new B,zTt=new d,HTt=new d,GTt=new Ke;function jTt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Ke.clone(r,GTt);t.viewport=s;let a=FTt,l=BTt;e.mapProjection.project(a,l);let f=d.clone(i.position,kTt),h=B.clone(i.transform,VTt),p=i.frustum.clone();i._setTransform(B.IDENTITY);let g=B.computeViewportTransformation(s,0,1,UTt),m=i.frustum.projectionMatrix,y=i.positionWC.y,b=d.fromElements(O.sign(y)*l.x-y,0,-i.positionWC.x,zTt),x=Ot.pointToGLWindowCoordinates(m,g,b,HTt);x.x=Math.floor(x.x);let A=s.x,C=s.width;if(y===0||x.x<=A||x.x>=A+C)z0(!0,e,t);else if(Math.abs(A+C*.5-x.x)<1)s.width=x.x-s.x,i.position.x*=O.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!0,e,t),s.x=x.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),z0(!1,e,t);else if(x.x>A+C*.5){s.width=x.x-A;let S=i.frustum.right;i.frustum.right=l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!0,e,t),s.x=x.x,s.width=A+C-x.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=S-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!1,e,t)}else{s.x=x.x,s.width=A+C-x.x;let S=i.frustum.left;i.frustum.left=-l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!0,e,t),s.x=A,s.width=x.x-A,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=S-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),z0(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function z0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),gCe(t),i.createPotentiallyVisibleSet(t),e&&(pCe(t),o||_Ce(t)),N$(t,n)}var dCe=new _s;ci.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,l=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof on||!l.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(c(s)){if(c(a))s.setDynamicLighting(a_.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let x=r.dynamicLighting;s.setDynamicLighting(x),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),c(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=c(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=c(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=c(b)?b.drawCommand:void 0,n.sunComputeCommand=c(b)?b.computeCommand:void 0,n.moonCommand=c(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=c(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!l.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=dCe.planes;for(let b=0;b<5;++b)g[b]=p.planes[b];p=dCe,n.isSkyAtmosphereVisible=c(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;c(m)&&y?.url!==m?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new Yd(m)):!c(m)&&c(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function WTt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new sp({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),c(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function qTt(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 l=o[a];l.update(t),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function gCe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),WTt(e),qTt(e),e._globe&&e._globe.render(t)}function YTt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,l=a.pick||a.pickVoxel;c(s.globeDepth)&&(s.globeDepth.picking=l);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new o3:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;G.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=c(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=!l&&c(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 m=e.postProcessStages,y=r.usePostProcess=!l&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),y=r.usePostProcess=m.ready,r.usePostProcessSelected=y&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),c(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!l&&c(t.framebuffer)&&e.invertClassification){let x;if(o.invertClassificationColor.alpha===1&&h&&(x=s.globeDepth.framebuffer),c(x)||i.depthTexture){if(e._invertClassification.previousFramebuffer=x,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let A=e._invertClassification.unclassifiedCommand,C=A.derivedCommands;C.oit=p.createDerivedCommands(A,i,C.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;c(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:l,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=l?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),b=p.getColorTexture(0),x=(f??h).getDepthStencilTexture();m.execute(t,y,x,b),m.copy(t,u)}!s&&!l&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function XTt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function KTt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function yCe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof fl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=yCe(s,t,n);c(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(c(o)&&o>i)return o}return i}ci.prototype.getHeight=function(e,t){if(!c(e))return;let n=t===We.CLAMP_TO_TERRAIN||t===We.RELATIVE_TO_TERRAIN,i=t===We.CLAMP_TO_3D_TILE||t===We.RELATIVE_TO_3D_TILE;if(!c(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=yCe(this.primitives,e,this);c(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&c(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var L$=new he;ci.prototype.updateHeight=function(e,t,n){T.typeOf.func("callback",t);let i=this._ellipsoid,o=g=>{he.clone(e,L$);let m;c(g)&&(m=g.height),c(m)||(m=this.getHeight(e,n)),c(m)&&(L$.height=m,t(L$))},r=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&c(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let l={},u=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,o,i);l[g.id]=m};if(!r){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(c(l[g.id])&&l[g.id](),delete l[g.id])});return()=>{a=a&&a(),Object.values(l).forEach(g=>g()),l={},f(),h()}};function $Tt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!c(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 c(r)&&o.height<r}ci.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=KTt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=$Tt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function ZTt(e,t){if(e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new yg({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function QTt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),c(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function JTt(e){e.primitives.postPassesUpdate(e._frameState),sc.update()}var eAt=new G;function tAt(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=pTt;let r=e.backgroundColor??G.BLACK;e._hdr&&(r=G.clone(r,eAt),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;c(s)&&s.enabled&&(!c(e.light)||e.light instanceof Rp?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.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 l=o.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=Ke.clone(a,l.viewport),c(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,r),e.resolveFramebuffers(l),l.framebuffer=void 0,RTt(e,l),c(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function AA(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function nAt(e){return e._picking.updateMostDetailedRayPicks(e)}ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,c(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&&c(this.maximumRenderTimeChange)&&c(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=O.incrementWrap(t.frameNumber,15e6,1);hCe(this,o,e),t.newFrame=!0}AA(this,QTt),this.primitives.show&&(AA(this,nAt),AA(this,iAt),AA(this,oAt),i||AA(this,rAt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),AA(this,tAt)),ZTt(this,i),AA(this,JTt),XTt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ci.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ci.prototype.requestRender=function(){this._renderRequested=!0};ci.prototype.clampLineWidth=function(e){return Math.max(ut.minimumAliasedLineWidth,Math.min(e,ut.maximumAliasedLineWidth))};ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!c(i))return;let o=i.primitive;if(!(o instanceof V0))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!c(a))return;let l=255*r[2]+r[3];return a3.fromKeyframeNode(o,s,l,a)};ci.prototype.pickMetadata=function(e,t,n,i){T.typeOf.object("windowPosition",e),T.typeOf.string("className",n),T.typeOf.string("propertyName",i);let o=this.pick(e);if(!c(o))return;let r=o.detail?.model?.structuralMetadata;if(!c(r))return;let s=r.schema,a=M3(s,t,n,i);if(!c(a))return;let l=N3(r,n,i);if(!c(l))return;let u=new L3(t,n,i,a,l);return this._picking.pickMetadata(this,e,u)};ci.prototype.pickMetadataSchema=function(e){T.typeOf.object("windowPosition",e);let t=this.pick(e);return c(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ci.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ci.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ci.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function iAt(e){let t=e._frameState;O$.camera=t.camera,O$.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,O$)}function oAt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;R$.camera=e.preloadFlightCamera,R$.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,R$)}function rAt(e){e.primitives.updateForPass(e._frameState,_Tt)}ci.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ci.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ci.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ci.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ci.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ci.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ci.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ci.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ci.prototype.cartesianToCanvasCoordinates=function(e,t){return Gi.worldToWindowCoordinates(this,e,t)};ci.prototype.completeMorph=function(){this._transitioner.completeMorph()};ci.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};ci.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};ci.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function sAt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){c(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{c(e)&&c(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ci.prototype.setTerrain=function(e){return T.typeOf.object("terrain",e),sAt(this,e),e};ci.prototype.isDestroyed=function(){return!1};ci.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(),c(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,c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),de(this)};var F3=ci;function Nw(e){e=e??ie.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=B.fromScale(n),this._modelMatrix=new B,this._command=new Qe({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(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 d;let i=new d;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(Nw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Nw.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var F$=new B;Nw.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=B.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,F$),o=B.multiplyTransformation(i,Fo.Y_UP_TO_Z_UP,F$),r=B.multiply(this._scaleMatrix,o,F$);B.clone(r,this._modelMatrix);let s=e.context,a=aAt(this),l=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||l||!c(t)||!t.show,f=this._command;if(!c(f.vertexArray)){let p=Js.createGeometry(new Js({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ti.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Be.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:xi.FRONT},blending:ln.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|l<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),l&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[nh,iw,c2]}),m=new He({defines:p,sources:[nh,iw,a2]});this._spSkyAtmosphere=Jt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function aAt(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))}Nw.prototype.isDestroyed=function(){return!1};Nw.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),de(this)};var B3=Nw;function Bw(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new Qe({modelMatrix:B.clone(B.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}Bw.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;if(T.defined("this.sources",a),Object.values(Go.FaceName).some(u=>!c(a[u])))throw new E("this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let l=typeof a.positiveX;if(Object.values(Go.FaceName).some(u=>typeof a[u]!==l))throw new E("this.sources properties must all be the same type.");typeof a.positiveX=="string"?SI(r,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Go({context:r,source:a}))}let s=this._command;if(!c(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=La.createGeometry(La.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),l=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=ti.fromGeometry({context:r,geometry:a,attributeLocations:l,bufferUsage:Be.STATIC_DRAW}),s.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND})}if(!c(s.shaderProgram)||this._useHdr!==t){let a=new He({defines:[t?"HDR":""],sources:[l2]});s.shaderProgram=Jt.fromCache({context:r,vertexShaderSource:u2,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(c(this._cubeMap))return s};Bw.prototype.isDestroyed=function(){return!1};Bw.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(),de(this)};function Fw(e){return tn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}Bw.createEarthSkyBox=function(){return new Bw({sources:{positiveX:Fw("px"),negativeX:Fw("mx"),positiveY:Fw("py"),negativeY:Fw("my"),positiveZ:Fw("pz"),negativeZ:Fw("mz")}})};var k3=Bw;function V3(){this.show=!0,this._drawCommand=new Qe({primitiveType:Me.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(V3.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var cAt=new H,lAt=new H,uAt=new se,U3=new se;V3.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(!c(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 S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new Rt({context:o,width:S,height:S,pixelFormat:ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let P=this,M={u_radiusTS:function(){return P._radiusTS}};this._commands.computeCommand=new Uc({fragmentShaderSource:d2,outputTexture:this._texture,uniformMap:M,persists:!1,owner:this,postExecute:function(){P._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!c(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let P=yt.createVertexBuffer({context:o,typedArray:v,usage:Be.STATIC_DRAW}),M=[{index:S.direction,vertexBuffer:P,componentsPerAttribute:2,normalize:!0,componentDatatype:$.UNSIGNED_BYTE}],R=yt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});a.vertexArray=new ti({context:o,attributes:M,indexBuffer:R}),a.shaderProgram=Jt.fromCache({context:o,vertexShaderSource:h2,fragmentShaderSource:f2,attributeLocations:S}),a.renderState=Ve.fromCache({blending:ln.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let l=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(l,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=O.SOLAR_RADIUS+O.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=Gi.computeActualEllipsoidPosition(e,l,U3),g=d.magnitude(d.subtract(p,e.camera.position,U3)),m=o.uniformState.projection,y=uAt;y.x=0,y.y=0,y.z=-g,y.w=1;let b=B.multiplyByVector(m,y,U3),x=Gi.clipToGLWindowCoordinates(t.viewport,b,cAt);y.x=O.SOLAR_RADIUS;let A=B.multiplyByVector(m,y,U3),C=Gi.clipToGLWindowCoordinates(t.viewport,A,lAt);return this._size=H.magnitude(H.subtract(C,x,U3)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};V3.prototype.isDestroyed=function(){return!1};V3.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(),de(this)};var z3=V3;var TCe=Zo(AU(),1);function fAt(e,t,n){return T.typeOf.string("samplerUniformName",e),T.typeOf.string("matrixUniformName",t),T.typeOf.string("styleUniformName",n),` 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 H3=fAt;var dAt={modifyFragmentShader:function(t){return t=He.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}}},kw=dAt;var CA={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function G3(e){T.typeOf.object("options",e),T.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=G.clone(G.DARKGRAY),this._highlightColor=G.clone(G.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=CA.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=e.opaquePass??De.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=B.clone(B.IDENTITY),this._modelMatrix=B.clone(B.IDENTITY),this.time=0,this.shadows=xn.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=e.splitDirection??Vr.NONE,this._splittingEnabled=!1,this._error=void 0,hAt(this,e)}Object.defineProperties(G3.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return G.clone(this._highlightColor)},set:function(e){this._highlightColor=G.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function hAt(e,t){let n=Rx.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&&c(n.batchTableBinary)&&(n.styleableProperties=Kp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),c(n.draco)){let a=n.draco;e._decodingState=CA.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;c(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;c(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;c(r)&&(c(r.constantColor)&&(e._constantColor=G.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;c(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 mAt=new d,pAt=new d,_At=new d,bCe,OG;function gAt(e){if(!c(OG)){bCe=new TCe.default(0),OG=new Array(e);for(let t=0;t<e;++t)OG[t]=bCe.random()}return OG}function yAt(e){let n=e.length/3,i=Math.min(n,20),o=gAt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,mAt),l=d.fromElements(s,s,s,pAt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,_At);d.minimumByComponent(a,p,a),d.maximumByComponent(l,p,l)}let u=le.fromCornerPoints(a,l);return u.radius+=O.EPSILON2,u}function xCe(e,t){let n=$.fromTypedArray(e);return n===$.INT||n===$.UNSIGNED_INT||n===$.DOUBLE?(dt("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 bAt=new se,xAt=new se,TAt=new G,ACe=0,RG=1,z$=2,CCe=3,AAt=4,B$=new B,CAt=new B;function EAt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,l=i.batchIds,u=i.styleableProperties,f=c(u),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,b=e._octEncodedRange,x=e._isRGB565,A=e._isTranslucent,C=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,P,M,R=[],L={};if(e._styleableShaderAttributes=L,f){let V=AAt;for(let j in u)if(u.hasOwnProperty(j)){let U=u[j],q=xCe(U.typedArray,j);P=U.componentCount,M=$.fromTypedArray(q);let Y=yt.createVertexBuffer({context:n,typedArray:q,usage:Be.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let te={index:V,vertexBuffer:Y,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(te),L[j]={location:V,componentCount:P},++V}}let F=yt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Be.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let _;C&&(_=yt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let w;S&&(w=yt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D;v&&(l.typedArray=xCe(l.typedArray,"batchIds"),D=yt.createVertexBuffer({context:n,typedArray:l.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes);let I=[];if(h?M=$.UNSIGNED_SHORT:p?M=y<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT:M=$.FLOAT,I.push({index:ACe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=yAt(r.typedArray)),C)if(x)I.push({index:RG,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:$.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=A?4:3;I.push({index:RG,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(P=2,M=$.UNSIGNED_BYTE):m?(P=2,M=b<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT):(P=3,M=$.FLOAT),I.push({index:z$,vertexBuffer:w,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:CCe,vertexBuffer:D,componentsPerAttribute:1,componentDatatype:$.fromTypedArray(l.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let N=new ti({context:n,attributes:I}),k={depthTest:{enabled:!0}},z={depthTest:{enabled:!0},depthMask:!1,blending:ln.ALPHA_BLEND};e._opaquePass===De.CESIUM_3D_TILE&&(k.stencilTest=kt.setCesium3DTileBit(),k.stencilMask=kt.CESIUM_3D_TILE_MASK,z.stencilTest=kt.setCesium3DTileBit(),z.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(k),e._translucentRenderState=Ve.fromCache(z),e._drawCommand=new Qe({boundingVolume:new le,cull:e._cull,modelMatrix:new B,primitiveType:Me.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:A?e._translucentRenderState:e._opaqueRenderState,pass:A?De.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function SAt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=bAt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let l=t.camera.frustum,u;t.mode===oe.SCENE2D||l instanceof on?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}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(!c(a))return G.TRANSPARENT;let l=G.clone(a.edgeColor,TAt);return l.alpha=a.edgeWidth,l},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!c(a))return B.IDENTITY;let l=e.clippingPlanesOriginMatrix??e._modelMatrix;B.multiply(n.uniformState.view3D,l,B$);let u=B.multiply(B$,a.modelMatrix,B$);return B.inverseTranspose(u,CAt)}};kw.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=xAt;if(c(e._quantizedVolumeScale)){let l=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(l,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),c(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function k$(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 U$(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 V$(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 wAt={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 vAt(e,t,n){let i,o,r,s=t.context,a=c(n),l=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,b=e._hasBatchIds,x=e._backFaceCulling,A=e._normalShading,C=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,P,M,R,L=g,F=je(wAt),_={},w=e._styleableShaderAttributes;for(o in w)w.hasOwnProperty(o)&&(r=w[o],F[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let ue={translucent:!1},ye="(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)";P=n.getColorShaderFunction(`getColorFromStyle${ye}`,F,ue),M=n.getShowShaderFunction(`getShowFromStyle${ye}`,F,ue),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,F,ue),c(P)&&ue.translucent&&(L=!0)}e._styleTranslucent=L;let D=c(P),I=c(M),N=c(R),k=e.isClipped,z=[],V=[];D&&(k$(P,z),U$(P,V)),I&&(k$(M,z),U$(M,V)),N&&(k$(R,z),U$(R,V));let j=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in w)if(w.hasOwnProperty(o)){r=w[o];let ue=z.indexOf(r.location)>=0,ye=V$(C,r.location);ye.enabled=ue}let q=m&&(!D||j);if(m){let ue=V$(C,RG);ue.enabled=q}let Y=y&&(A||x||U);if(y){let ue=V$(C,z$);ue.enabled=Y}let te={a_position:ACe};q&&(te.a_color=RG),Y&&(te.a_normal=z$),b&&(te.a_batchId=CCe);let K="",Z=z.length;for(i=0;i<Z;++i){let ue=z[i];r=_[ue];let ye=r.componentCount,Ae=`czm_3dtiles_property_${ue}`,Pe;ye===1?Pe="float":Pe=`vec${ye}`,K+=`in ${Pe} ${Ae}; -`,te[Ae]=r.location}SAt(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; -`,v&&(ee+=`float u_geometricError; -float u_depthMultiplier; -`),ee+=K,q&&(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; -`),Y&&(f||h?ee+=`in vec2 a_normal; -`:ee+=`in vec3 a_normal; -`),b&&(ee+=`in float a_batchId; -`),(l||u||h)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),D&&(ee+=P),I&&(ee+=M),N&&(ee+=R),ee+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,v&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),q?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; -`,l||u?ee+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:ee+=` vec3 position = a_position; -`,ee+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,Y?(f?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); -`,D&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),N?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:v?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; -`,Y&&A&&(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); -`,Y&&x&&(ee+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(ee+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),ee+=`} -`;let me=`in vec4 v_color; -`;k&&(me+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,me+=` -`,me+=fg(S,s),me+=` -`),me+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,k&&(me+=H3("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} -`,e.splitDirection!==Vr.NONE&&(me=kw.modifyFragmentShader(me)),c(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),c(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let Te=e._drawCommand;c(Te.shaderProgram)&&Te.shaderProgram.destroy(),Te.shaderProgram=Jt.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:me,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 DAt(e,t){if(e._decodingState===CA.READY)return!1;if(e._decodingState===CA.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=n_.decodePointCloud(i,t);c(o)&&(e._decodingState=CA.DECODING,o.then(function(r){e._decodingState=CA.READY;let s=c(r.POSITION)?r.POSITION.array:void 0,a=c(r.RGB)?r.RGB.array:void 0,l=c(r.RGBA)?r.RGBA.array:void 0,u=c(r.NORMAL)?r.NORMAL.array:void 0,f=c(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=c(s)&&c(r.POSITION.data.quantization),p=c(u)&&c(r.NORMAL.data.quantization);if(h){let b=r.POSITION.data.quantization,x=b.range;e._quantizedVolumeScale=d.fromElements(x,x,x),e._quantizedVolumeOffset=d.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let x=r[b];c(g)||(g={}),g[b]={typedArray:x.array,componentCount:x.data.componentsPerAttribute}}c(s)&&(n.positions={typedArray:s});let y=l??a;c(y)&&(n.colors={typedArray:y}),c(u)&&(n.normals={typedArray:u}),c(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=CA.FAILED,e._error=r}))}return!0}var PAt=new se,IAt=new d;G3.prototype.update=function(e){let t=e.context;if(c(this._error)){let u=this._error;throw this._error=void 0,u}if(DAt(this,t))return;let i=!1,o=!B.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(EAt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){B.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(B.clone(this._modelMatrix,u),c(this._rtcCenter)&&B.multiplyByTranslation(u,this._rtcCenter,u),c(this._quantizedVolumeOffset)&&B.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=B.getColumn(u,3,PAt);se.equals(p,se.UNIT_W)||Ot.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;B.multiplyByPoint(u,h,h);let p=B.getScale(u,IAt);f.radius*=d.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!==Vr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&vAt(this,e,this._style),this._drawCommand.castShadows=xn.castShadows(this.shadows),this._drawCommand.receiveShadows=xn.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?De.TRANSLUCENT:this._opaquePass;let a=e.commandList,l=e.passes;(l.render||l.pick)&&a.push(this._drawCommand)};G3.prototype.isDestroyed=function(){return!1};G3.prototype.destroy=function(){let e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),de(this)};var j3=G3;function SA(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.intervals",e.intervals),this.show=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this.shadows=e.shadows??xn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new vm(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new f_,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(SA.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(c(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function OAt(e){return`uniform vec4 czm_pickColor; -${e}`}function RAt(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function MAt(){return"czm_pickColor"}SA.prototype.makeStyleDirty=function(){this._styleDirty=!0};SA.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var LAt=new Q;function G$(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function EA(e,t){return e._intervals.indexOf(t.start)}function NAt(e,t){let n=e._intervals,i=e._clock,o=G$(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,LAt),a=n.indexOf(s),l=EA(e,t);return a===l&&(o>=0?++a:--a),n.get(a)}function FAt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function BAt(e,t,n){let i=G$(e),o=EA(e,t),r=EA(e,n);return i>=0?o>=r:o<=r}function SCe(e,t){return function(n){let i=c(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 kAt(e,t,n){let i=EA(e,t),o=e._frames,r=o[i];if(!c(r)){let s=t.data.transform,a=c(s)?B.fromArray(s):void 0,l=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:l},o[i]=r,we.fetchArrayBuffer({url:l}).then(function(u){r.pointCloud=new j3({arrayBuffer:u,cull:!0,fragmentShaderLoaded:OAt,uniformMapLoaded:RAt(e),pickIdLoaded:MAt})}).catch(SCe(e,l))}return r}function UAt(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 VAt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(c(o)&&!t.ready){let r=i.commandList,s=r.length;if(wCe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;UAt(e,a)}}t.touchedFrameNumber=i.frameNumber}var zAt=new B;function HAt(e,t){let n=e.shading;return c(n)&&c(n.baseResolution)?n.baseResolution:c(t.boundingSphere)?O.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function GAt(e){let t=e.shading;return c(t)&&c(t.maximumAttenuation)?t.maximumAttenuation:10}var jAt=new vm;function wCe(e,t,n,i){let o=e.shading??jAt,r=t.pointCloud,s=t.transform??B.IDENTITY;r.modelMatrix=B.multiplyTransformation(e.modelMatrix,s,zAt),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=HAt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=GAt(e);try{r.update(i)}catch(a){SCe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function H$(e,t,n,i){let o=kAt(e,t,i);VAt(e,o,n,i)}function WAt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function vCe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(c(r)&&(!c(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),c(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function qAt(e,t){let n=EA(e,t),i=e._frames[n];if(c(i)&&i.ready)return i}function ECe(e,t,n,i,o){return c(n)?n.ready?!0:(H$(e,t,i,o),n.ready):!1}function YAt(e,t,n,i,o){let r,s,a,l=e._intervals,u=e._frames,f=EA(e,n),h=EA(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=l.get(r),a=u[r],ECe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=l.get(r),a=u[r],ECe(e,s,a,i,o))return s;return t}function XAt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];c(s)&&c(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var Uw={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};SA.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;c(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),c(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=c(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)&&XAt(this,o,s),Uw.timeSinceLoad=t,Uw.isClipped=r;let a=this.shading,l=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,g=FAt(this);if(!c(g))return;let m=!1,y=G$(this),b=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!c(h)||b)&&(h=g),(!c(p)||m||BAt(this,g,p))&&(p=NAt(this,g)),h=YAt(this,h,g,Uw,e);let x=qAt(this,h);c(x)||(H$(this,h,Uw,e),x=this._lastRenderedFrame),c(x)&&wCe(this,x,Uw,e),c(p)&&H$(this,p,Uw,e);let A=this;c(x)&&!c(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),c(x)&&x!==this._lastRenderedFrame&&A.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return A.frameChanged.raiseEvent(A),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=x;let C=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;C>S&&vCe(this,WAt(e));let P=u.length-f;c(a)&&a.attenuation&&a.eyeDomeLighting&&P>0&&l.update(e,f,a,this.boundingSphere)};SA.prototype.isDestroyed=function(){return!1};SA.prototype.destroy=function(){return vCe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var Vw=SA;function ICe(e,t){if(c(t)){let n=t.clock;c(n)&&n.getValue(e)}}function KAt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!c(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 OCe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,c(e._scene)&&(e._scene.pixelRatio=t),t}function RCe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=OCe(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 MCe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;c(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Io(e,t){if(!c(e))throw new E("container is required.");e=In(e),t=t??W.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Vt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Vt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(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 l=c(t.creditContainer)?In(t.creditContainer):n;l.appendChild(a);let u=c(t.creditViewport)?In(t.creditViewport):n,f=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=l,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,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 pe,this._allowDataSourcesToSuspendAnimation=!0,this._clock=c(t.clock)?t.clock:new Ah,c(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),RCe(this);try{let p=t.ellipsoid??ie.default,g=new F3({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly: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=d.UNIT_Z,OCe(this),MCe(this);let m=t.globe;c(m)||(m=new V2(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??xn.RECEIVE_ONLY);let y=t.skyBox;!c(y)&&ie.WGS84.equals(p)&&(y=k3.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new z3,ie.WGS84.equals(p)&&(g.moon=new q2));let b=t.skyAtmosphere;!c(b)&&ie.WGS84.equals(p)&&(b=new B3(p),b.show=t.globe!==!1&&m.show),b!==!1&&(g.skyAtmosphere=b);let x=t.baseLayer;if(t.globe!==!1&&x!==!1&&(c(x)||(x=Xa.fromWorldImagery()),g.imageryLayers.add(x)),c(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),c(t.terrain)&&t.globe!==!1){if(c(t.terrainProvider))throw new E("Specify either options.terrainProvider or options.terrain.");g.setTerrain(t.terrain)}this._screenSpaceEventHandler=new of(i),c(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=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let A=this;this._onRenderError=function(R,L){A._useDefaultRenderLoop=!1,A._renderLoopRunning=!1,A._showRenderLoopErrors&&A.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,L)},g.renderError.addEventListener(this._onRenderError);let C=t.dataSources,S=!1;c(C)||(C=new wN,S=!0);let v=new uF({scene:g,dataSourceCollection:C}),P=new gr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=C,this._destroyDataSourceCollection=S,this._dataSourceDisplay=v,this._eventHelper=P,this._canAnimateUpdateCallback=this._updateCanAnimate,P.add(this._clock.onTick,Io.prototype._onTick,this),P.add(g.morphStart,Io.prototype._clearTrackedObject,this),P.add(C.dataSourceAdded,Io.prototype._onDataSourceAdded,this),P.add(C.dataSourceRemoved,Io.prototype._onDataSourceRemoved,this),P.add(g.postRender,Io.prototype._postRender,this);let M=C.length;for(let R=0;R<M;R++)this._dataSourceAdded(C,C.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),P.add(C.dataSourceAdded,Io.prototype._dataSourceAdded,this),P.add(C.dataSourceRemoved,Io.prototype._dataSourceRemoved,this)}catch(p){throw f&&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(Io.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){if(e<=0)throw new E("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&KAt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new E("resolutionScale must be greater than 0.");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,j$(this);let t=this.scene,n=t.mode;!c(e)||!c(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(B.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,ICe(this.clock,e))}}});Io.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 l(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}l(),c(window.addEventListener)&&window.addEventListener("resize",l,!1);let u=c(t),f=c(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=ep(n);u||(typeof n=="string"&&(n=new Error(n)),t=ep({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),y.appendChild(b),y.onclick=function(x){y.removeChild(b),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}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(){c(l)&&c(window.removeEventListener)&&window.removeEventListener("resize",l,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Io.prototype.isDestroyed=function(){return!1};Io.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(),c(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()),de(this)};Io.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,RCe(this),MCe(this),this._scene.requestRender())};Io.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Io.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Io.prototype._onEntityCollectionChanged,this)};Io.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Io.prototype._onEntityCollectionChanged,this),c(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Io.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var $At=new le;Io.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(c(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??$At)===lt.DONE&&i.update(t)}};Io.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)}};Io.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Io.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&ICe(this.clock,e)};Io.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Io.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Io.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}};Io.prototype.zoomTo=function(e,t){return LCe(this,e,{offset:t},!1)};Io.prototype.flyTo=function(e,t){return LCe(this,e,t,!0)};function LCe(e,t,n,i){if(!c(t))throw new E("zoomTarget is required.");j$(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 Xa){let s;c(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let l=r.readyEvent.addEventListener(()=>{l(),a(r.getImageryRectangle())})}),s.then(function(a){return VT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof Vw||r instanceof V0){e._zoomTarget=r;return}if(r.isLoading&&c(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,c(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function W3(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function j$(e){let t=e._zoomPromise;c(t)&&(W3(e),e._completeZoom(!1))}Io.prototype._postRender=function(){ZAt(this),QAt(this)};var DCe=new le;function ZAt(e){let t=e._zoomTarget;if(!c(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){c(o.offset)||(o.offset=new cd(0,-.5,f.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(f,o.offset),i.lookAtTransform(B.IDENTITY),e._completeZoom(!0)),W3(e)}if(t instanceof Vw){if(c(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof bs||t instanceof V0){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)),W3(e);return}let a=t,l=[];for(let f=0,h=a.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,DCe);if(p===lt.PENDING)return;p!==lt.FAILED&&l.push(le.clone(DCe))}if(l.length===0){j$(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(l);e._zoomIsFlight?(W3(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(B.IDENTITY),W3(e),e._completeZoom(!0))}var PCe=new le;function QAt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!c(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,PCe);if(r===lt.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!==lt.FAILED?PCe:void 0;e._entityView=new dF(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var q3=Io;function Gw(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var wA=new ce;function JAt(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}Gw.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)JAt(e,g,p,s)||s.push(new zw(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,wA);let a=wA.west,l=wA.north;r.tileXYToRectangle(i,o,e,wA);let u=wA.east,f=wA.south,h=new oCt(e,a,f,u,l);for(let p=0;p<s.length;++p){let g=s[p];W$(g.extent,h)&&rCt(this._maximumLevel,g,h)}};Gw.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Hw(i.extent,e)){t=i;break}}return c(t)?Y3(void 0,t,e):-1};var eCt=[],tCt=[],nCt=new ce,iCt=new ce;Gw.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=eCt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,nCt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,iCt))):t.push(e);let n=tCt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)X3(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(c(n[i])&&n[i].length===0)return i;return 0};var NCe=new he;Gw.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,wA);return ce.center(i,NCe),this.computeMaximumLevelAtPosition(NCe)>=e};Gw.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 zw(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(zw.prototype,{nw:{get:function(){return this._nw||(this._nw=new zw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new zw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new zw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new zw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function oCt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function W$(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 rCt(e,t,n){for(;t.level<e;)if(MG(t.nw.extent,n))t=t.nw;else if(MG(t.ne.extent,n))t=t.ne;else if(MG(t.sw.extent,n))t=t.sw;else if(MG(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=Lo(t.rectangles,n.level,sCt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function sCt(e,t){return e.level-t}function MG(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Hw(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function Y3(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&Hw(t._nw.extent,n),s=t._ne&&Hw(t._ne.extent,n),a=t._sw&&Hw(t._sw.extent,n),l=t._se&&Hw(t._se.extent,n);if(r+s+a+l>1){r&&(i=Math.max(i,Y3(t,t._nw,n))),s&&(i=Math.max(i,Y3(t,t._ne,n))),a&&(i=Math.max(i,Y3(t,t._sw,n))),l&&(i=Math.max(i,Y3(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:l?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];Hw(a,n)&&(i=a.level)}t=t.parent}return i}function X3(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||W$(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]=aCt(e[s.level],s)}X3(e,t._nw,n),X3(e,t._ne,n),X3(e,t._sw,n),X3(e,t._se,n)}function aCt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];W$(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 Xh=Gw;var cCt=15;function FCe(e){this.ellipsoid=e.ellipsoid??ie.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}FCe.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 lCt(e,t){let n=t.copyrightText;c(n)&&(e.credit=new Tt(n));let i=t.spatialReference,o=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 Ki(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new H(r.xmin,r.ymin),s.rectangleNortheastInMeters=new H(r.xmax,r.ymax),e.tilingScheme=new ls(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!c(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?fd.LERC:fd.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Xh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Xh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=cs.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."),c(t.minValues)&&c(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function uCt(e,t,n){try{let i=await t.fetchJson();lCt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,o),i}}function H0(e){e=e??W.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 pe}Object.defineProperties(H0.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}}});H0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new FCe(t);await uCt(o,i);let r=new H0(t);return o.build(r),r._resource=n,r};H0.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&&!c(q$(this,n+1,e*2,t*2))){let h=BCe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let l=o.fetchArrayBuffer();if(!c(l)||!c(s))return;let u=this,f=this._tilesAvailable;return Promise.all([l,s]).then(function(h){return new qa({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):cCt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(c(a)&&a.state===$n.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=$n.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function q$(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}H0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};H0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=q$(this,n,e,t);if(c(i))return i;BCe(this,n,e,t)};H0.prototype.loadTileDataAvailability=function(e,t,n){};function fCt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],l={startX:e.x,startY:e.y,endX:0,endY:0},u=new H(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,g=h?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new H(u.x,e.y)),--u.x,--p,l.endX=u.x):u.x===o?(l.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){h=!0;break}h?(a.push(new H(e.x,u.y)),--u.y,l.endY=u.y):u.y===r?(l.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:l,value:s}}function dCt(e,t,n,i,o){let r=[];if(o.every(function(l){return l===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new H(0,0)];for(;a.length>0;){let l=a.pop(),u=fCt(l,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function BCe(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}`,l=e._availableCache;if(c(l[a]))return l[a];let u=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return c(h)?(h=h.then(function(p){let g=dCt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let b=g[y];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return q$(e,t,n,i)}),l[a]={promise:h,request:u},h=h.finally(function(p){return delete l[a],p}),{promise:h,request:u}):{}}var Y$=H0;var kCe="https://dev.virtualearth.net/REST/v1/Locations";function X$(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new E("options.key is required.");this._key=t;let n={key:t};c(e.culture)&&(n.culture=e.culture),this._resource=new we({url:kCe,queryParameters:n}),this._credit=new Tt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(X$.prototype,{url:{get:function(){return kCe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});X$.prototype.geocode=async function(e){return T.typeOf.string("query",e),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],l=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,l)}})})};var K$=X$;function $$(){}Object.defineProperties($$.prototype,{credit:{get:function(){}}});$$.prototype.geocode=function(e){T.typeOf.string("query",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:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Z$=$$;var hCt=new se,UCe=new d,jw=new d;function mCt(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,l){c(l)||(l=new d);let u=(a-i)*o;return d.lerp(r,s,u,l)}}return function(i,o){c(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=hCt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let l,u,f,h,p;return r===0?(l=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],l,UCe),d.multiplyByScalar(h,.5,h),p=B.multiplyByVector(Iy.hermiteCoefficientMatrix,a,a)):r===t.length-2?(l=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],UCe),d.multiplyByScalar(f,.5,f),p=B.multiplyByVector(Iy.hermiteCoefficientMatrix,a,a)):(l=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=B.multiplyByVector(G0.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(l,p.x,o),d.multiplyByScalar(u,p.y,jw),d.add(o,jw,o),d.multiplyByScalar(f,p.z,jw),d.add(o,jw,o),d.multiplyByScalar(h,p.w,jw),d.add(o,jw,o)}}var pCt=new d,_Ct=new d;function G0(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(T.defined("points",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("points.length",t.length,2),T.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(c(i)||(i=pCt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!c(o))){let r=t.length-1;o=_Ct,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=mCt(this),this._lastTimeIndex=0}Object.defineProperties(G0.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}}});G0.catmullRomCoefficientMatrix=new B(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);G0.prototype.findTimeInterval=Ni.prototype.findTimeInterval;G0.prototype.wrapTime=Ni.prototype.wrapTime;G0.prototype.clampTime=Ni.prototype.clampTime;G0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Q$=G0;var LG={};LG.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){if(!c(e))throw new E("threshold is required.");if(!c(t))throw new E("keepAbove is required.");if(!c(n))throw new E("u0 is required.");if(!c(i))throw new E("u1 is required.");if(!c(o))throw new E("u2 is required.");c(r)?r.length=0:r=[];let s,a,l;t?(s=n<e,a=i<e,l=o<e):(s=n>e,a=i>e,l=o>e);let u=s+a+l,f,h,p,g,m,y;return u===1?s?(f=(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)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):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))):l&&(m=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(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(m)):!a&&i!==e?(y=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(f)):!l&&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)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};LG.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,l){if(!c(e))throw new E("x is required.");if(!c(t))throw new E("y is required.");if(!c(n))throw new E("x1 is required.");if(!c(i))throw new E("y1 is required.");if(!c(o))throw new E("x2 is required.");if(!c(r))throw new E("y2 is required.");if(!c(s))throw new E("x3 is required.");if(!c(a))throw new E("y3 is required.");let u=n-s,f=s-o,h=r-a,p=i-a,g=1/(h*u+f*p),m=t-a,y=e-s,b=(h*y+f*m)*g,x=(-p*y+u*m)*g,A=1-b-x;return c(l)?(l.x=b,l.y=x,l.z=A,l):new d(b,x,A)};LG.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,l){T.typeOf.number("x00",e),T.typeOf.number("y00",t),T.typeOf.number("x01",n),T.typeOf.number("y01",i),T.typeOf.number("x10",o),T.typeOf.number("y10",r),T.typeOf.number("x11",s),T.typeOf.number("y11",a);let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=u/h,g=f/h;if(p>=0&&p<=1&&g>=0&&g<=1)return c(l)||(l=new H),l.x=e+p*(n-e),l.y=t+p*(i-t),l};var Pg=LG;function j0(e){if(!c(e)||!c(e.quantizedVertices))throw new E("options.quantizedVertices is required.");if(!c(e.indices))throw new E("options.indices is required.");if(!c(e.minimumHeight))throw new E("options.minimumHeight is required.");if(!c(e.maximumHeight))throw new E("options.maximumHeight is required.");if(!c(e.maximumHeight))throw new E("options.maximumHeight is required.");if(!c(e.boundingSphere))throw new E("options.boundingSphere is required.");if(!c(e.horizonOcclusionPoint))throw new E("options.horizonOcclusionPoint is required.");if(!c(e.westIndices))throw new E("options.westIndices is required.");if(!c(e.southIndices))throw new E("options.southIndices is required.");if(!c(e.eastIndices))throw new E("options.eastIndices is required.");if(!c(e.northIndices))throw new E("options.northIndices is required.");if(!c(e.westSkirtHeight))throw new E("options.westSkirtHeight is required.");if(!c(e.southSkirtHeight))throw new E("options.southSkirtHeight is required.");if(!c(e.eastSkirtHeight))throw new E("options.eastSkirtHeight is required.");if(!c(e.northSkirtHeight))throw new E("options.northSkirtHeight is required.");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=FG(e.westIndices,o,t),this._southIndices=FG(e.southIndices,r,t),this._eastIndices=FG(e.eastIndices,o,t),this._northIndices=FG(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(j0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return c(this._mesh)}}});var NG=[];function FG(e,t,n){NG.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)NG[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(NG.sort(t),Fe.createTypedArray(n,NG)):e}var VCe="createVerticesFromQuantizedTerrainMesh",gCt=new yi(VCe),yCt=new yi(VCe,kh.maximumAsynchronousTasks);j0.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(a?yCt:gCt).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:l,exaggeration:r,exaggerationRelativeHeight:s});if(!c(h))return;let p=this;return Promise.resolve(h).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Fe.createTypedArray(y,g.indices),x=new Float32Array(g.vertices),A=g.center,C=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,P=p._orientedBoundingBox,M=d.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,L=Oc.clone(g.encoding);return p._mesh=new hd(A,x,b,g.indexCountWithoutSkirts,m,C,S,v,M,R,P,L,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 bCt=new yi("upsampleQuantizedTerrainMesh",kh.maximumAsynchronousTasks);j0.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new E("tilingScheme is required.");if(!c(t))throw new E("thisX is required.");if(!c(n))throw new E("thisY is required.");if(!c(i))throw new E("thisLevel is required.");if(!c(o))throw new E("descendantX is required.");if(!c(r))throw new E("descendantY is required.");if(!c(s))throw new E("descendantLevel is required.");if(s-i>1)throw new E("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=bCt.scheduleTask({vertices:l.vertices,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=Math.min(this._westSkirtHeight,this._eastSkirtHeight);m=Math.min(m,this._southSkirtHeight),m=Math.min(m,this._northSkirtHeight);let y=u?m*.5:this._westSkirtHeight,b=f?m*.5:this._southSkirtHeight,x=u?this._eastSkirtHeight:m*.5,A=f?this._northSkirtHeight:m*.5,C=this._credits;return Promise.resolve(g).then(function(S){let v=new Uint16Array(S.vertices),P=Fe.createTypedArray(v.length/3,S.indices),M;return c(S.encodedNormals)&&(M=new Uint8Array(S.encodedNormals)),new j0({quantizedVertices:v,indices:P,encodedNormals:M,minimumHeight:S.minimumHeight,maximumHeight:S.maximumHeight,boundingSphere:le.clone(S.boundingSphere),orientedBoundingBox:Dn.clone(S.orientedBoundingBox),horizonOcclusionPoint:d.clone(S.horizonOcclusionPoint),westIndices:S.westIndices,southIndices:S.southIndices,eastIndices:S.eastIndices,northIndices:S.northIndices,westSkirtHeight:y,southSkirtHeight:b,eastSkirtHeight:x,northSkirtHeight:A,childTileMask:0,credits:C,createdByUpsampling:!0})})};var J$=32767,zCe=new d;j0.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1);i*=J$;let o=O.clamp((n-e.south)/e.height,0,1);return o*=J$,c(this._mesh)?CCt(this,i,o):ECt(this,i,o)};function HCe(e,t,n,i,o,r,s,a){let l=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=l&&e<=u&&t>=f&&t<=h}var xCt=new H,TCt=new H,ACt=new H;function CCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,xCt),g=r.decodeTextureCoordinates(o,f,TCt),m=r.decodeTextureCoordinates(o,h,ACt);if(HCe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=Pg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,zCe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}}function ECt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=i[u],g=i[f],m=i[h],y=o[u],b=o[f],x=o[h];if(HCe(t,n,p,y,g,b,m,x)){let A=Pg.computeBarycentricCoordinates(t,n,p,y,g,b,m,x,zCe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let C=A.x*r[u]+A.y*r[f]+A.z*r[h];return O.lerp(e._minimumHeight,e._maximumHeight,C/J$)}}}}j0.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new E("thisX is required.");if(!c(t))throw new E("thisY is required.");if(!c(n))throw new E("childX is required.");if(!c(i))throw new E("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};j0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var vA=j0;function SCt(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 jCe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ie.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=[]}jCe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=c(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 WCe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,c(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 y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let l=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new ls({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let f;c(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:c(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),c(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),c(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(c(p)&&!c(h)){g=new Xh(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let b=p[y],x=e.tilingScheme.getNumberOfYTilesAtLevel(y);c(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let A=0;A<b.length;++A){let C=b[A],S=x-C.endY-1,v=x-C.startY-1;e.overallAvailability[y].push([C.startX,S,C.endX,v]),g.addAvailableTileRange(y,C.startX,S,C.endX,v)}}}else c(h)&&(f=new Xh(e.tilingScheme,u),g=new Xh(e.tilingScheme,u),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,c(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new SCt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:l,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return c(m)?c(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await nZ(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function wCt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(c(t)&&(i+=` -${t.message}`),e.previousError=Po.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,i),e.previousError.retry)return nZ(e,n);throw new ae(i)}async function vCt(e,t,n){await WCe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Xh(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 l=s[a];o.addAvailableTileRange(r,l[0],l[1],l[2],l[3])}}}if(e.attribution.length>0){let o=new Tt(e.attribution);e.tileCredits.push(o)}return!0}async function nZ(e,t){try{let n=await e.layerJsonResource.fetchJson();return vCt(e,n,t)}catch(n){return c(n)&&n.statusCode===404?(await WCe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):wCt(e,n,t)}}function Kh(e){e=e??W.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new Tt(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 eZ={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function GCe(e){return!c(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 DCt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new qa({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 PCt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,l=3,u=l+1,f=Float64Array.BYTES_PER_ELEMENT*l,h=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,b=y*m,x=new DataView(t),A=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let C=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new le(new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0)),x.getFloat64(a+f,!0));a+=h;let P=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let M=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,M*3);a+=M*g,M>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,b=y*m);let L=R.subarray(0,M),F=R.subarray(M,2*M),_=R.subarray(M*2,3*M);Ln.zigZagDeltaDecode(L,F,_),a%y!==0&&(a+=y-a%y);let w=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Fe.createTypedArrayFromArrayBuffer(M,t,a,w*m);a+=w*b;let I=0,N=D.length;for(let ue=0;ue<N;++ue){let ye=D[ue];D[ue]=I-ye,ye===0&&++I}let k=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Fe.createTypedArrayFromArrayBuffer(M,t,a,k);a+=k*y;let V=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=Fe.createTypedArrayFromArrayBuffer(M,t,a,V);a+=V*y;let U=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let q=Fe.createTypedArrayFromArrayBuffer(M,t,a,U);a+=U*y;let Y=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Fe.createTypedArrayFromArrayBuffer(M,t,a,Y);a+=Y*y;let K,Z;for(;a<x.byteLength;){let ue=x.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=x.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ue===eZ.OCT_VERTEX_NORMALS&&e._requestVertexNormals)K=new Uint8Array(t,a,M*2);else if(ue===eZ.WATER_MASK&&e._requestWaterMask)Z=new Uint8Array(t,a,ye);else if(ue===eZ.METADATA&&e._requestMetadata){let Ae=x.getUint32(a,!0);if(Ae>0){let Ee=ir(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ae).available;if(c(Ee))for(let ze=0;ze<Ee.length;++ze){let qe=n+ze+1,it=Ee[ze],Dt=e._tilingScheme.getNumberOfYTilesAtLevel(qe);for(let jt=0;jt<it.length;++jt){let $e=it[jt],un=Dt-$e.endY-1,zt=Dt-$e.startY-1;e.availability.addAvailableTileRange(qe,$e.startX,un,$e.endX,zt),r.availability.addAvailableTileRange(qe,$e.startX,un,$e.endX,zt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,o,n),Te=Dn.fromRectangle(me,C,S,e._tilingScheme.ellipsoid);return new vA({center:A,minimumHeight:C,maximumHeight:S,boundingSphere:v,orientedBoundingBox:Te,horizonOcclusionPoint:P,quantizedVertices:R,encodedNormals:K,indices:D,westIndices:z,southIndices:j,eastIndices:q,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:Z,credits:e._tileCredits})}Kh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,l=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!c(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=iZ(this,e,t,n,f,u===0);h.result&&(a=!0,l=l.then(()=>h.promise))}return!c(r)&&a?l.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):qCe(this,e,t,n,r,i)};function qCe(e,t,n,i,o,r){if(!c(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 l=[];e._requestVertexNormals&&o.hasVertexNormals&&l.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&l.push("watermask"),e._requestMetadata&&o.hasMetadata&&l.push("metadata");let u,f,h=s[(t+a+i)%s.length],p=o.resource;c(p._ionEndpoint)&&!c(p._ionEndpoint.externalType)?(l.length!==0&&(f={extensions:l.join("-")}),u=GCe(void 0)):u=GCe(l);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(c(g))return g.then(function(m){return c(m)?c(e._heightmapStructure)?DCt(e,m,i,t,n):PCt(e,m,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(Kh.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}}});Kh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Kh.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await Cu.fromAssetId(e);return Kh.fromUrl(n,t)};Kh.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=new jCe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await nZ(i);let o=new Kh(t);return i.build(o),o};Kh.prototype.getTileDataAvailable=function(e,t,n){if(!c(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(iZ(this,e,t,n,i[r],r===0).result)return;return!1};Kh.prototype.loadTileDataAvailability=function(e,t,n){if(!c(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=iZ(this,e,t,n,i[r],r===0);if(c(s.promise))return s.promise}};function tZ(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,l=n/s|0;return{level:r,x:a,y:l}}function iZ(e,t,n,i,o,r){if(!c(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},l=o.availabilityTilesLoaded,u=o.availability,f=tZ(o,t,n,i);for(;c(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!l.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!c(h))){let p=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN});h=qCe(e,f.x,f.y,f.level,o,p),c(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=tZ(o,f.x,f.y,f.level)}return{result:!1}}Kh._getAvailabilityTile=tZ;var DA=Kh;function Ig(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let 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 dl(n),this._workerName="createCircleGeometry"}Ig.packedLength=dl.packedLength;Ig.pack=function(e,t,n){return T.typeOf.object("value",e),dl.pack(e._ellipseGeometry,t,n)};var YCe=new dl({center:new d,semiMajorAxis:1,semiMinorAxis:1}),$a={center:new d,radius:void 0,ellipsoid:ie.clone(ie.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Ig.unpack=function(e,t,n){let i=dl.unpack(e,t,YCe);return $a.center=d.clone(i._center,$a.center),$a.ellipsoid=ie.clone(i._ellipsoid,$a.ellipsoid),$a.ellipsoid=ie.clone(i._ellipsoid,YCe._ellipsoid),$a.height=i._height,$a.extrudedHeight=i._extrudedHeight,$a.granularity=i._granularity,$a.vertexFormat=Ie.clone(i._vertexFormat,$a.vertexFormat),$a.stRotation=i._stRotation,$a.shadowVolume=i._shadowVolume,c(n)?($a.semiMajorAxis=i._semiMajorAxis,$a.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new dl($a),n):($a.radius=i._semiMajorAxis,new Ig($a))};Ig.createGeometry=function(e){return dl.createGeometry(e._ellipseGeometry)};Ig.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new Ig({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Ig.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var oZ=Ig;function Ww(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let 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 Hu(n),this._workerName="createCircleOutlineGeometry"}Ww.packedLength=Hu.packedLength;Ww.pack=function(e,t,n){return T.typeOf.object("value",e),Hu.pack(e._ellipseGeometry,t,n)};var ICt=new Hu({center:new d,semiMajorAxis:1,semiMinorAxis:1}),cf={center:new d,radius:void 0,ellipsoid:ie.clone(ie.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};Ww.unpack=function(e,t,n){let i=Hu.unpack(e,t,ICt);return cf.center=d.clone(i._center,cf.center),cf.ellipsoid=ie.clone(i._ellipsoid,cf.ellipsoid),cf.height=i._height,cf.extrudedHeight=i._extrudedHeight,cf.granularity=i._granularity,cf.numberOfVerticalLines=i._numberOfVerticalLines,c(n)?(cf.semiMajorAxis=i._semiMajorAxis,cf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Hu(cf),n):(cf.radius=i._semiMajorAxis,new Ww(cf))};Ww.createGeometry=function(e){return Hu.createGeometry(e._ellipseGeometry)};var rZ=Ww;function OCt(e){return e=e??W.EMPTY_OBJECT,DA.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var K3=OCt;function RCt(e){return e=e??W.EMPTY_OBJECT,DA.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ie.WGS84})}var PA=RCt;function qw(e){e=e??W.EMPTY_OBJECT,T.defined("options.callback",e.callback),T.defined("options.width",e.width),T.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=cs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe;let n=e.credit;typeof n=="string"&&(n=new Tt(n)),this._credit=n}Object.defineProperties(qw.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}}});qw.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!c(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let l=a;return Array.isArray(l)&&(l=new Float64Array(l)),new qa({buffer:l,width:r,height:s})})};qw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};qw.prototype.getTileDataAvailable=function(e,t,n){};qw.prototype.loadTileDataAvailability=function(e,t,n){};var sZ=qw;var MCt=1953029805,LCt=2917034100;function aZ(e,t){if(aZ.passThroughDataForTesting)return t;T.typeOf.object("key",e),T.typeOf.object("data",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===MCt||o===LCt)return t;let r=new DataView(e),s=0,a=t.byteLength,l=a-a%8,u=n,f,h=8;for(;s<l;)for(h=(h+8)%24,f=h;s<l&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}aZ.passThroughDataForTesting=!1;var $3=aZ;function XCe(e){this.proxy=e}XCe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var cZ=XCe;function KCe(e,t){return ws("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty(KCe,"EMPTY_OBJECT",{get:function(){return ws("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),W.EMPTY_OBJECT}});var lZ=KCe;function BG(){E.throwInstantiationError()}Object.defineProperties(BG.prototype,{credit:{get:E.throwInstantiationError}});BG.getCreditsFromResult=function(e){if(c(e.attributions))return e.attributions.map(Tt.getIonCredit)};BG.prototype.geocode=E.throwInstantiationError;var Yw=BG;var NCt={SEARCH:0,AUTOCOMPLETE:1},W0=Object.freeze(NCt);function $Ce(){E.throwInstantiationError()}$Ce.createGeometry=function(e){E.throwInstantiationError()};var uZ=$Ce;var zCt=Zo(fZ(),1);function FCt(e,t){return(e&t)!==0}var Fc=FCt;var BCt=[1,2,4,8],ZCe=15,kCt=16,UCt=64,VCt=128;function gp(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}gp.clone=function(e,t){return c(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 gp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};gp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};gp.prototype.hasSubtree=function(){return Fc(this._bits,kCt)};gp.prototype.hasImagery=function(){return Fc(this._bits,UCt)};gp.prototype.hasTerrain=function(){return Fc(this._bits,VCt)};gp.prototype.hasChildren=function(){return Fc(this._bits,ZCe)};gp.prototype.hasChild=function(e){return Fc(this._bits,BCt[e])};gp.prototype.getChildBitmask=function(){return this._bits&ZCe};var Z3=gp;function HCt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var GCt=HCt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\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x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function lf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=O.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(lf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});lf.fromUrl=async function(e){T.defined("resourceOrUrl",e);let t=e;typeof t!="string"&&!(t instanceof we)&&(T.typeOf.string("resourceOrUrl.url",e.url),t=e.url);let n=we.createIfNeeded(t);n.appendForwardSlash();let i=new lf;i._resource=n;try{await jCt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${JCe(i,"",1).url}: ${o}`;throw new ae(r)}return i};lf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Fc(t,r)?Fc(e,r)&&(s|=1):(s|=2,Fc(e,r)||(s|=1)),i+=s}return i};lf.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];Fc(s,2)?Fc(s,1)||(t|=r):(n|=r,Fc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};lf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(c(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),c(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var QCe=new yi("decodeGoogleEarthEnterprisePacket");lf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=JCe(this,e,t,n).fetchArrayBuffer();if(!c(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return QCe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let x=Z3.clone(u[y]),A=y.length;if(A===h)x.setParent(f);else if(A>1){let C=r[y.substring(0,y.length-1)];x.setParent(C)}r[y]=x}else r[y]=null}})})};lf.prototype.populateSubtree=function(e,t,n,i){let o=lf.tileXYToQuadKey(e,t,n);return mZ(this,o,i)};function mZ(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(c(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,l=a[o];if(c(l))return l.then(function(){return s=new Qo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),mZ(e,t,s)});if(!c(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(l=e.getQuadTreePacket(o,r.cnodeVersion,n),!!c(l))return a[o]=l,l.then(function(){return s=new Qo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),mZ(e,t,s)}).finally(function(){delete a[o]})}lf.prototype.getTileInformation=function(e,t,n){let i=lf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};lf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function JCe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var dZ,hZ;function jCt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!c(hZ)){let n=tn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;hZ=ab(n).then(function(){dZ=window.cesiumGoogleEarthDbRootParser(zCt),c(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return hZ.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=dZ.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 l=o.buffer.slice(r,s);return QCe.scheduleTask({buffer:l,type:"DbRoot",key:a},[l])}).then(function(n){let i=dZ.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,c(i.endSnippet)&&c(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}c(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let l=r[a],u=l.copyrightString;c(u)&&(o[l.providerId]=new Tt(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=GCt})}var Og=lf;function IA(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.buffer",e.buffer),T.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),T.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(IA.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var nEe="createVerticesFromGoogleEarthEnterpriseBuffer",WCt=new yi(nEe),qCt=new yi(nEe,kh.maximumAsynchronousTasks),eEe=new ce,pZ=new ce;IA.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,eEe),t.tileXYToRectangle(n,i,o,pZ);let u=l.cartographicToCartesian(ce.center(pZ)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?qCt:WCt).scheduleTask({buffer:this._buffer,nativeRectangle:eEe,rectangle:pZ,relativeToCenter:u,ellipsoid:l,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!c(g))return;let m=this;return g.then(function(y){return m._mesh=new hd(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,le.clone(y.boundingSphere3D),d.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Dn.clone(y.orientedBoundingBox),Oc.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};IA.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1),o=O.clamp((n-e.south)/e.height,0,1);return c(this._mesh)?ZCt(this,i,o):eEt(this,i,o,e)};var YCt=new yi("upsampleQuantizedTerrainMesh",kh.maximumAsynchronousTasks);IA.prototype.upsample=function(e,t,n,i,o,r,s){if(T.typeOf.object("tilingScheme",e),T.typeOf.number("thisX",t),T.typeOf.number("thisY",n),T.typeOf.number("thisLevel",i),T.typeOf.number("descendantX",o),T.typeOf.number("descendantY",r),T.typeOf.number("descendantLevel",s),s-i>1)throw new E("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=YCt.scheduleTask({vertices:l.vertices,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=this;return g.then(function(y){let b=new Uint16Array(y.vertices),x=Fe.createTypedArray(b.length/3,y.indices),A=m._skirtHeight;return new vA({quantizedVertices:b,indices:x,minimumHeight:y.minimumHeight,maximumHeight:y.maximumHeight,boundingSphere:le.clone(y.boundingSphere),orientedBoundingBox:Dn.clone(y.orientedBoundingBox),horizonOcclusionPoint:d.clone(y.horizonOcclusionPoint),westIndices:y.westIndices,southIndices:y.southIndices,eastIndices:y.eastIndices,northIndices:y.northIndices,westSkirtHeight:A,southSkirtHeight:A,eastSkirtHeight:A,northSkirtHeight:A,childTileMask:0,createdByUpsampling:!0,credits:m._credits})})};IA.prototype.isChildAvailable=function(e,t,n,i){T.typeOf.number("thisX",e),T.typeOf.number("thisY",t),T.typeOf.number("childX",n),T.typeOf.number("childY",i);let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};IA.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var XCt=new H,KCt=new H,$Ct=new H,iEe=new d;function ZCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,XCt),g=r.decodeTextureCoordinates(o,f,KCt),m=r.decodeTextureCoordinates(o,h,$Ct),y=Pg.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,iEe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}var QCt=Uint16Array.BYTES_PER_ELEMENT,tEe=Uint32Array.BYTES_PER_ELEMENT,_Z=Int32Array.BYTES_PER_ELEMENT,JCt=Float32Array.BYTES_PER_ELEMENT,gZ=Float64Array.BYTES_PER_ELEMENT;function eEt(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 l=new DataView(o),u=0;for(let v=0;v<r;++v)u+=l.getUint32(u,!0),u+=tEe;u+=tEe,u+=2*gZ;let f=O.toRadians(l.getFloat64(u,!0)*180);u+=gZ;let h=O.toRadians(l.getFloat64(u,!0)*180);u+=gZ;let p=i.width/f/2,g=i.height/h/2,m=l.getInt32(u,!0);u+=_Z;let y=l.getInt32(u,!0)*3;u+=_Z,u+=_Z;let b=new Array(m),x=new Array(m),A=new Array(m),C;for(C=0;C<m;++C)b[C]=s+l.getUint8(u++)*p,x[C]=a+l.getUint8(u++)*g,A[C]=l.getFloat32(u,!0)*6371010,u+=JCt;let S=new Array(y);for(C=0;C<y;++C)S[C]=l.getUint16(u,!0),u+=QCt;for(C=0;C<y;C+=3){let v=S[C],P=S[C+1],M=S[C+2],R=b[v],L=b[P],F=b[M],_=x[v],w=x[P],D=x[M],I=Pg.computeBarycentricCoordinates(t,n,R,_,L,w,F,D,iEe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*A[v]+I.y*A[P]+I.z*A[M]}}var Xw=IA;var Cd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},kG=new Q;function UG(){this._terrainCache={},this._lastTidy=Q.now()}UG.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};UG.prototype.get=function(e){let n=this._terrainCache[e];if(c(n))return delete this._terrainCache[e],n.buffer};UG.prototype.tidy=function(){if(Q.now(kG),Q.secondsDifference(kG,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(kG,r.timestamp)>10&&delete e[o]}Q.clone(kG,this._lastTidy)}};function q0(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new UG,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe}Object.defineProperties(q0.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(){}}});q0.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new q0(t);return n._metadata=e,n};var tEt=new yi("decodeGoogleEarthEnterprisePacket");function oEe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Cd.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());c(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}q0.prototype.requestTileGeometry=function(e,t,n,i){let o=Og.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!c(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let l=a.terrainState;c(l)||(l=a.terrainState=Cd.UNKNOWN);let u=r.get(o);if(c(u)){let x=s.providers[a.terrainProvider];return Promise.resolve(new Xw({buffer:u,childTileMask:oEe(o,a,s),credits:c(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(l===Cd.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new qa({buffer:new Uint8Array(16*16),width:16,height:16}));let f,h=o,p=-1;switch(l){case Cd.SELF:p=a.terrainVersion;break;case Cd.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case Cd.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),c(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,b;if(c(g[h]))y=g[h],b=m[h];else{b=i;let x=nEt(this,h,p,b).fetchArrayBuffer();if(!c(x))return;y=x.then(function(A){return c(A)?tEt.scheduleTask({buffer:A,type:"Terrain",key:s.key},[A]).then(function(C){let S=s.getTileInformationFromQuadKey(h);S.terrainState=Cd.SELF,r.add(h,C[0]);let v=S.terrainProvider,P=C.length-1;for(let M=0;M<P;++M){let R=h+M.toString(),L=s.getTileInformationFromQuadKey(R);c(L)&&(r.add(R,C[M+1]),L.terrainState=Cd.PARENT,L.terrainProvider===0&&(L.terrainProvider=v))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=y,m[h]=b,y=y.finally(function(){delete g[h],delete m[h]})}return y.then(function(){let x=r.get(o);if(c(x)){let A=s.providers[a.terrainProvider];return new Xw({buffer:x,childTileMask:oEe(o,a,s),credits:c(A)?[A]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(x){return b.state===$n.CANCELLED?(i.state=b.state,Promise.reject(x)):(a.terrainState=Cd.NONE,Promise.reject(x))})};q0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};q0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=Og.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(c(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Cd.NONE)return!1;if((!c(s)||s===Cd.UNKNOWN)&&(r.terrainState=Cd.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!c(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Qo({throttle:!1,throttleByServer:!0,type:ms.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};q0.prototype.loadTileDataAvailability=function(e,t,n){};function nEt(e,t,n,i){return n=c(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var yZ=q0;var iEt="https://maps.googleapis.com/maps/api/geocode/json",rEe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function bZ(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new E("options.key is required.");this._resource=new we({url:iEt,queryParameters:{key:t}}),this._credit=new Tt(rEe,!0)}Object.defineProperties(bZ.prototype,{credit:{get:function(){return this._credit}}});bZ.prototype.geocode=async function(e){T.typeOf.string("query",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:rEe,collapsible:!1}}})};var xZ=bZ;var VG={};VG.defaultApiKey=void 0;VG.mapTilesApiEndpoint=new we({url:"https://tile.googleapis.com/v1/"});VG.getDefaultCredit=function(){return new Tt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var OA=VG;var Q3={};Q3.type=void 0;Q3.getRequiredDataPoints=E.throwInstantiationError;Q3.interpolateOrderZero=E.throwInstantiationError;Q3.interpolate=E.throwInstantiationError;var TZ=Q3;var oEt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},Rg=Object.freeze(oEt);function AZ(e){T.defined("url",e),this._url=we.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(AZ.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});AZ.prototype.geocode=async function(e,t){return T.typeOf.string("query",e),this._url.getDerivedResource({url:t===W0.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(c(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],l=o.geometry.coordinates[1];r=d.fromDegrees(a,l)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var J3=AZ;function sEe(e){if(!Object.values(Rg).some(t=>t===e))throw new E(`Invalid geocodeProviderType: "${e}"`)}var aEe=Object.freeze({[Rg.GOOGLE]:"google",[Rg.BING]:"bing",[Rg.DEFAULT]:void 0});function rEt(e){return aEe[e]}function sEt(e){return Object.entries(aEe).find(t=>t[1]===e)[0]}function CZ(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.scene",e.scene);let t=e.geocodeProviderType??Rg.DEFAULT;sEe(t);let n=e.accessToken??Xd.defaultAccessToken,i=we.createIfNeeded(e.server??Xd.defaultServer);i.appendForwardSlash();let o=Xd.getDefaultTokenCredit(n);c(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Tt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});c(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new J3(r),this.geocodeProviderType=t}Object.defineProperties(CZ.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return sEt(this._pelias.url.queryParameters.geocoder)},set:function(e){sEe(e);let t={...this._pelias.url.queryParameters,geocoder:rEt(e)};c(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});CZ.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var RA=CZ;var Oo={};Oo.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Oo.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Oo.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Oo.defaultAccessToken=void 0;Oo.defaultShareKey=void 0;Oo._getAuthorizationHeader=function(){if(!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");return c(Oo.defaultShareKey)?`Basic ${Oo.defaultShareKey}`:`Bearer ${Oo.defaultAccessToken}`};Oo.apiEndpoint=new we({url:"https://api.bentley.com"});Oo.getExports=async function(e){if(T.typeOf.string("iModelId",e),!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let t=new we({url:`${Oo.apiEndpoint}mesh-export`,headers:{Authorization:Oo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Oo.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);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden");if(n.statusCode===422)throw new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${n.statusCode}`)}};Oo.getRealityDataMetadata=async function(e,t){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let n=new we({url:`${Oo.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Oo._getAuthorizationHeader(),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);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};Oo.getRealityDataURL=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),T.typeOf.string("rootDocument",n),!c(Oo.defaultAccessToken)&&!c(Oo.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=new we({url:`${Oo.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Oo._getAuthorizationHeader(),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);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var us=Oo;function zG(){E.throwInstantiationError()}Object.defineProperties(zG.prototype,{ellipsoid:{get:E.throwInstantiationError}});zG.prototype.project=E.throwInstantiationError;zG.prototype.unproject=E.throwInstantiationError;var EZ=zG;function Kw(e){e=e??W.EMPTY_OBJECT;let t=e.weights,n=e.times;if(T.defined("weights",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!==0)throw new E("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(Kw.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});Kw.prototype.findTimeInterval=Ni.prototype.findTimeInterval;Kw.prototype.wrapTime=Ni.prototype.wrapTime;Kw.prototype.clampTime=Ni.prototype.clampTime;Kw.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]);c(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 SZ=Kw;function wZ(e,t,n){T.defined("url",e),T.defined("apiKey",t),c(n)&&T.typeOf.object("params",n),e=we.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Tt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(wZ.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});wZ.prototype.geocode=async function(e){return T.typeOf.string("query",e),this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(c(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=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var vZ=wZ;var aEt={packedLength:void 0,pack:E.throwInstantiationError,unpack:E.throwInstantiationError},DZ=aEt;var cEt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:E.throwInstantiationError,unpackInterpolationResult:E.throwInstantiationError},PZ=cEt;var lEt=new d;function uEt(e,t,n,i){let o=_b(e,t,n,i,lEt);return c(o)?o.x>0&&o.y>0&&o.z>0:!1}var IZ=uEt;function cEe(){E.throwInstantiationError()}cEe.prototype.getURL=E.throwInstantiationError;var OZ=cEe;function fEt(e,t,n,i,o,r,s){let a=Fi.numberOfPoints(e,t,o),l,u=n.red,f=n.green,h=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,b=i.alpha;if(G.equals(n,i)){for(l=0;l<a;l++)r[s++]=G.floatToByte(u),r[s++]=G.floatToByte(f),r[s++]=G.floatToByte(h),r[s++]=G.floatToByte(p);return s}let x=(g-u)/a,A=(m-f)/a,C=(y-h)/a,S=(b-p)/a,v=s;for(l=0;l<a;l++)r[v++]=G.floatToByte(u+l*x),r[v++]=G.floatToByte(f+l*A),r[v++]=G.floatToByte(h+l*C),r[v++]=G.floatToByte(p+l*S);return v}function ek(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new E("At least two positions are required.");if(c(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new E("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ie.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=c(n)?1+n.length*G.packedLength:1,this.packedLength=o+ie.packedLength+3}ek.pack=function(e,t,n){if(!c(e))throw new E("value is required");if(!c(t))throw new E("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};ek.unpack=function(e,t,n){if(!c(e))throw new E("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t);t+=ie.packedLength;let l=e[t++]===1,u=e[t++],f=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=l,n._arcType=u,n._granularity=f,n):new ek({positions:r,colors:s,ellipsoid:a,colorsPerVertex:l,arcType:u,granularity:f})};var HG=new Array(2),GG=new Array(2),dEt={positions:HG,height:GG,ellipsoid:void 0,minDistance:void 0,granularity:void 0};ek.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=O.chordLength(r,s.maximumRadius),l=c(n)&&!i,u,f=t.length,h,p,g,m,y=0;if(o===qt.GEODESIC||o===qt.RHUMB){let S,v,P;o===qt.GEODESIC?(S=O.chordLength(r,s.maximumRadius),v=Fi.numberOfPoints,P=Fi.generateArc):(S=r,v=Fi.numberOfPointsRhumbLine,P=Fi.generateRhumbArc);let M=Fi.extractHeights(t,s),R=dEt;if(o===qt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,l){let L=0;for(u=0;u<f-1;u++)L+=v(t[u],t[u+1],S)+1;h=new Float64Array(L*3),g=new Uint8Array(L*4),R.positions=HG,R.height=GG;let F=0;for(u=0;u<f-1;++u){HG[0]=t[u],HG[1]=t[u+1],GG[0]=M[u],GG[1]=M[u+1];let _=P(R);if(c(n)){let w=_.length/3;m=n[u];for(let D=0;D<w;++D)g[F++]=G.floatToByte(m.red),g[F++]=G.floatToByte(m.green),g[F++]=G.floatToByte(m.blue),g[F++]=G.floatToByte(m.alpha)}h.set(_,y),y+=_.length}}else if(R.positions=t,R.height=M,h=new Float64Array(P(R)),c(n)){for(g=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let F=t[u],_=t[u+1],w=n[u],D=n[u+1];y=fEt(F,_,w,D,a,g,y)}let L=n[f-1];g[y++]=G.floatToByte(L.red),g[y++]=G.floatToByte(L.green),g[y++]=G.floatToByte(L.blue),g[y++]=G.floatToByte(L.alpha)}}else{p=l?f*2-2:f,h=new Float64Array(p*3),g=c(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let P=t[u];if(l&&u>0&&(d.pack(P,h,S),S+=3,m=n[u-1],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha)),l&&u===f-1)break;d.pack(P,h,S),S+=3,c(n)&&(m=n[u],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha))}}let b=new fn;b.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),c(n)&&(b.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let x=(p-1)*2,A=Fe.createTypedArray(p,x),C=0;for(u=0;u<p-1;++u)A[C++]=u,A[C++]=u+1;return new ct({attributes:b,indices:A,primitiveType:Me.LINES,boundingSphere:le.fromPoints(t)})};var RZ=ek;function $w(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Js(i),this._workerName="createSphereGeometry"}$w.packedLength=Js.packedLength;$w.pack=function(e,t,n){return T.typeOf.object("value",e),Js.pack(e._ellipsoidGeometry,t,n)};var hEt=new Js,Y0={radius:void 0,radii:new d,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};$w.unpack=function(e,t,n){let i=Js.unpack(e,t,hEt);return Y0.vertexFormat=Ie.clone(i._vertexFormat,Y0.vertexFormat),Y0.stackPartitions=i._stackPartitions,Y0.slicePartitions=i._slicePartitions,c(n)?(d.clone(i._radii,Y0.radii),n._ellipsoidGeometry=new Js(Y0),n):(Y0.radius=i._radii.x,new $w(Y0))};$w.createGeometry=function(e){return Js.createGeometry(e._ellipsoidGeometry)};var MZ=$w;function mEt(e){return T.defined("value",e),e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var MA=mEt;function X0(e){throw new E("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(X0.prototype,{ellipsoid:{get:E.throwInstantiationError},rectangle:{get:E.throwInstantiationError},projection:{get:E.throwInstantiationError}});X0.prototype.getNumberOfXTilesAtLevel=E.throwInstantiationError;X0.prototype.getNumberOfYTilesAtLevel=E.throwInstantiationError;X0.prototype.rectangleToNativeRectangle=E.throwInstantiationError;X0.prototype.tileXYToNativeRectangle=E.throwInstantiationError;X0.prototype.tileXYToRectangle=E.throwInstantiationError;X0.prototype.positionToTileXY=E.throwInstantiationError;var LZ=X0;function LA(e){e=e??W.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=e.epoch??Ge.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(LA.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(c(t)&&(this._clockSubscription(),this._clockSubscription=void 0),c(e)&&(this._clockSubscription=e.onTick.addEventListener(LA.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(c(t)&&t.removeEventListener("seeked",this._seekFunction,!1),c(e)&&(this._seeking=!1,this._seekFunction=pEt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});LA.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,de(this)};LA.prototype.isDestroyed=function(){return!1};LA.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};LA.prototype._onTick=function(e){let t=this._element;if(!c(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=this.epoch??Ge.MINIMUM_VALUE,s=Q.secondsDifference(o,r),a=t.duration,l,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),l=s):s>a?l=a:s<0?l=0:l=s;let f=i?this.tolerance??1:.001;Math.abs(l-u)>f&&(this._seeking=!0,t.currentTime=l)};function pEt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var NZ=LA;function _Et(e,t){this.rectangle=e,this.maxLevel=t}function lEe(e){this.ellipsoid=e.ellipsoid??ie.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}lEe.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 gEt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({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=cs.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=O.toRadians(parseFloat(s.getAttribute("minx"))),l=O.toRadians(parseFloat(s.getAttribute("miny"))),u=O.toRadians(parseFloat(s.getAttribute("maxx"))),f=O.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new _Et(new ce(a,l,u,f),h))}}function yEt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i=`${i}: ${t.message}`),Po.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function bEt(e,t,n){try{let i=await t.fetchXML();gEt(e,i)}catch(i){yEt(t,i,n)}}function K0(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,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 Tt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(K0.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(){}}});K0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=new lEe(t),i=we.createIfNeeded(e);await bEt(n,i);let o=new K0(t);return n.build(o),o._resource=i,o};K0.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(!c(s))return;let a=this;return Promise.resolve(s).then(function(l){return new qa({buffer:Id(l),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:xEt(a,e,t,n),structure:a._terrainDataStructure})})};K0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var uEe=new ce;function xEt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let l=0;l<r.length&&a!==15;++l){let u=r[l];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,s,uEe);c(h)&&(jG(o,f,t*2,n*2,i+1)&&(a|=4),jG(o,f,t*2+1,n*2,i+1)&&(a|=8),jG(o,f,t*2,n*2+1,i+1)&&(a|=1),jG(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function jG(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return c(ce.intersection(r,t,uEe))}K0.prototype.getTileDataAvailable=function(e,t,n){};K0.prototype.loadTileDataAvailability=function(e,t,n){};var FZ=K0;var TEt={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},BZ=Object.freeze(TEt);function AEt(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var kZ=AEt;function CEt(e,t,n){if(typeof t!="function")throw new E("oldFunction is required to be a function.");if(typeof n!="function")throw new E("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}}var tk=CEt;var EEt=new d(1,1,1);function UZ(e){e=e??EEt,T.defined("dimensions",e),T.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=d.clone(e)}Object.defineProperties(UZ.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){T.defined("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),T.typeOf.number.greaterThanOrEquals("value.z",e.z,0),d.clone(e,this._dimensions)}}});var SEt=new d;UZ.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,SEt),i=O.randomBetween(-n.x,n.x),o=O.randomBetween(-n.y,n.y),r=O.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var VZ=UZ;function yp(){this.featurePropertiesDirty=!1}Object.defineProperties(yp.prototype,{featuresLength:{get:function(){E.throwInstantiationError()}},pointsLength:{get:function(){E.throwInstantiationError()}},trianglesLength:{get:function(){E.throwInstantiationError()}},geometryByteLength:{get:function(){E.throwInstantiationError()}},texturesByteLength:{get:function(){E.throwInstantiationError()}},batchTableByteLength:{get:function(){E.throwInstantiationError()}},innerContents:{get:function(){E.throwInstantiationError()}},ready:{get:function(){E.throwInstantiationError()}},tileset:{get:function(){E.throwInstantiationError()}},tile:{get:function(){E.throwInstantiationError()}},url:{get:function(){E.throwInstantiationError()}},batchTable:{get:function(){E.throwInstantiationError()}},metadata:{get:function(){E.throwInstantiationError()},set:function(e){E.throwInstantiationError()}},group:{get:function(){E.throwInstantiationError()},set:function(e){E.throwInstantiationError()}}});yp.prototype.hasProperty=function(e,t){E.throwInstantiationError()};yp.prototype.getFeature=function(e){E.throwInstantiationError()};yp.prototype.applyDebugSettings=function(e,t){E.throwInstantiationError()};yp.prototype.applyStyle=function(e){E.throwInstantiationError()};yp.prototype.update=function(e,t){E.throwInstantiationError()};yp.prototype.pick=function(e,t,n){E.throwInstantiationError()};yp.prototype.isDestroyed=function(){E.throwInstantiationError()};yp.prototype.destroy=function(){E.throwInstantiationError()};var zZ=yp;function Zw(e,t){this._conditionsExpression=je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,vEt(this,t)}Object.defineProperties(Zw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function wEt(e,t){this.condition=e,this.expression=t}function vEt(e,t){let n=[],i=e._conditions;if(!c(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),l=String(s[1]);n.push(new wEt(new Lf(a,t),new Lf(l,t)))}e._runtimeConditions=n}Zw.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!c(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)}};Zw.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!c(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)}};Zw.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!c(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let l=o[a],u=l.condition.getShaderExpression(t,n),f=l.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) - { - return ${f}; - } -`}return r=`${i} ${e} +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 U4=`in vec2 v_textureCoordinates; +void main() { -${r} return ${i}(1.0); +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); } -`,r};Zw.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!c(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 nk=Zw;function $0(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,DEt(this,e)}function DEt(e,t){t=je(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(c(t.meta)){let i=t.defines,o=t.meta??W.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Lf(o[r],i))}e._meta=n,e._ready=!0}function fr(e,t){let n=(e._style??W.EMPTY_OBJECT).defines;if(c(t)){if(typeof t=="boolean"||typeof t=="number")return new Lf(String(t));if(typeof t=="string")return new Lf(t,n);if(c(t.conditions))return new nk(t,n)}else return;return t}function dr(e){if(c(e)){if(c(e.expression))return e.expression;if(c(e.conditionsExpression))return je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties($0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=fr(this,e),this._style.show=dr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=fr(this,e),this._style.color=dr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=fr(this,e),this._style.pointSize=dr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=fr(this,e),this._style.pointOutlineColor=dr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=fr(this,e),this._style.pointOutlineWidth=dr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=fr(this,e),this._style.labelColor=dr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=fr(this,e),this._style.labelOutlineColor=dr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=fr(this,e),this._style.labelOutlineWidth=dr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=fr(this,e),this._style.font=dr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=fr(this,e),this._style.labelStyle=dr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=fr(this,e),this._style.labelText=dr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=fr(this,e),this._style.backgroundColor=dr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=fr(this,e),this._style.backgroundPadding=dr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=fr(this,e),this._style.backgroundEnabled=dr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=fr(this,e),this._style.scaleByDistance=dr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=fr(this,e),this._style.translucencyByDistance=dr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=fr(this,e),this._style.distanceDisplayCondition=dr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=fr(this,e),this._style.heightOffset=dr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=fr(this,e),this._style.anchorLineEnabled=dr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=fr(this,e),this._style.anchorLineColor=dr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=fr(this,e),this._style.image=dr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=fr(this,e),this._style.disableDepthTestDistance=dr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=fr(this,e),this._style.horizontalOrigin=dr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=fr(this,e),this._style.verticalOrigin=dr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=fr(this,e),this._style.labelHorizontalOrigin=dr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=fr(this,e),this._style.labelVerticalOrigin=dr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});$0.fromUrl=function(e){if(!c(e))throw new E("url is required");return we.createIfNeeded(e).fetchJson(e).then(function(n){return new $0(n)})};$0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,c(this.color)&&c(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};$0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,c(this.show)&&c(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};$0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,c(this.pointSize)&&c(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};$0.prototype.getVariables=function(){let e=[];return c(this.color)&&c(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),c(this.show)&&c(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),c(this.pointSize)&&c(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var NA=$0;function ik(e){e=e??W.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new xA({comparator:ik.comparator})}ik.prototype.addSubtree=function(e){let t=new PEt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates();if(this.find(i)===void 0)throw new E("parent node needs to exist")}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};ik.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}};ik.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 PEt(e,t){this.subtree=e,this.stamp=t}var ok=ik;function rk(e){e=e??W.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=d.ZERO.clone(),paddingAfter:l=d.ZERO.clone(),globalTransform:u=B.IDENTITY.clone(),shapeTransform:f=B.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;T.typeOf.string("className",t),T.typeOf.object("names",n),T.typeOf.object("types",i),T.typeOf.object("componentTypes",o),T.typeOf.string("shape",r),T.typeOf.object("dimensions",s),this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=l,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===va.ELLIPSOID?Td.Z_UP:Td.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new ok}Object.defineProperties(rk.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}}});rk.fromUrl=async function(e){T.defined("url",e);let t=we.createIfNeeded(e),n=await t.fetchJson();OEt(n);let i=kEt(n,t);await i.load();let{root:o}=n,r=oi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new Kx({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],l=a.class,u=UEt(s,l);Object.assign(u,REt(o)),c(o.transform)?u.globalTransform=B.unpack(o.transform):u.globalTransform=B.clone(B.IDENTITY),u.dimensions=d.unpack(a.dimensions),u.maximumTileCount=IEt(s),c(a.padding)&&(u.paddingBefore=d.unpack(a.padding.before),u.paddingAfter=d.unpack(a.padding.after));let f=new rk(u),h=new Zx(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,vi.unload(i),f};function IEt(e){if(c(e.tileset))return e.tileset.getPropertyBySemantic(yx.TILESET_TILE_COUNT)}function OEt(e){let t=e.root;if(!c(t.content))throw new ae("Root must have content");if(!oi(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!oi(t,"3DTILES_implicit_tiling")&&!c(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!c(e.schema)&&!c(e.schemaUri)&&!oi(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function REt(e){let t=e.boundingVolume;if(c(t.box))return FEt(t.box);if(c(t.region))return MEt(t.region);if(oi(t,"3DTILES_bounding_volume_cylinder"))return BEt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function MEt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=B.fromScale(ie.WGS84.radii),l=new d(t,n,r),u=new d(i,o,s);return{shape:va.ELLIPSOID,minBounds:l,maxBounds:u,shapeTransform:a}}var LEt=new d,NEt=new J;function FEt(e){let t=Dn.unpack(e),n=J.getScale(t.halfAxes,LEt),i=J.getRotation(t.halfAxes,NEt);return{shape:va.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:B.fromRotationTranslation(i,t.center)}}function BEt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-O.PI,maxAngle:r=O.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e;T.typeOf.number("minRadius",t),T.typeOf.number("maxRadius",n),T.typeOf.number("height",i),T.typeOf.number("minAngle",o),T.typeOf.number("maxAngle",r),T.typeOf.object("translation",s),T.typeOf.object("rotation",a);let l=-.5*i+s[2],u=.5*i+s[2],f=B.fromTranslationQuaternionRotationScale(d.unpack(s),Le.unpack(a),d.ONE);return{shape:va.CYLINDER,minBounds:d.fromElements(t,o,l),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function kEt(e,t){let{schemaUri:n,schema:i}=e;return c(n)?vi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):vi.getSchemaLoader({schema:i})}function UEt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,m])=>{let{type:y,componentType:b}=m,x=o?.properties[g].min,A=o?.properties[g].max,C=at.getComponentCount(y),S=fEe(x,C),v=fEe(A,C);return{id:g,type:y,componentType:b,minValue:S,maxValue:v}}),a=s.map(g=>g.id),l=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=f.some(c);return{className:t,names:a,types:l,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?h:void 0}}function fEe(e,t){if(!c(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function VEt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(c(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),c(o))return o;let l=I_(a);return o=await gx.fromSubtreeJson(s,l.jsonPayload,l.binaryPayload,n,t),i.addSubtree(o),o}rk.prototype.requestData=async function(e){e=e??W.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 Qx({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=a.isSubtreeRoot()&&a.level>0,u=l?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await VEt(this,u);if(!(l?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:m,baseResource:y}=s,b=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),x=y.getDerivedResource({url:b.url});return _A.fromGltf(x)};var HZ=rk;function GZ(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(GZ.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});GZ.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var sk=GZ;var jZ={CUMULUS:0};jZ.validate=function(e){return e===jZ.CUMULUS};var FA=Object.freeze(jZ);function $h(e,t){if(e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!c(e.scale)&&c(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new H(this._maximumSize.x,this._maximumSize.y);else{this._scale=H.clone(e.scale??new H(20,12));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=G.clone(e.color??G.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var zEt=$h.SHOW_INDEX=0,HEt=$h.POSITION_INDEX=1,GEt=$h.SCALE_INDEX=2,jEt=$h.MAXIMUM_SIZE_INDEX=3,WEt=$h.SLICE_INDEX=4,qEt=$h.BRIGHTNESS_INDEX=5,YEt=$h.COLOR_INDEX=6;$h.NUMBER_OF_PROPERTIES=7;function BA(e,t){let n=e._cloudCollection;c(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties($h.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,BA(this,zEt))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),BA(this,HEt))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.object("value",e);let t=this._scale;H.equals(t,e)||(H.clone(e,t),BA(this,GEt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){T.typeOf.object("value",e);let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),BA(this,jEt))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),BA(this,YEt))}},slice:{get:function(){return this._slice},set:function(e){T.typeOf.number("value",e),this._slice!==e&&(this._slice=e,BA(this,WEt))}},brightness:{get:function(){return this._brightness},set:function(e){T.typeOf.number("value",e),this._brightness!==e&&(this._brightness=e,BA(this,qEt))}}});$h.prototype._destroy=function(){this._cloudCollection=void 0};var uf=$h;var ff,WG=new d,XEt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},KEt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},$Et=uf.SHOW_INDEX,ZEt=uf.POSITION_INDEX,QEt=uf.SCALE_INDEX,JEt=uf.MAXIMUM_SIZE_INDEX,eSt=uf.SLICE_INDEX,tSt=uf.BRIGHTNESS_INDEX,nSt=uf.NUMBER_OF_PROPERTIES,iSt=uf.COLOR_INDEX;function Zh(e){e=e??W.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(nSt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=d.clone(e.noiseOffset??d.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:dEe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function dEe(e){return function(){return WG.x=e._textureSliceWidth,WG.y=e._noiseTextureRows,WG.z=1/e._noiseTextureRows,WG}}Object.defineProperties(Zh.prototype,{length:{get:function(){return qZ(this),this._clouds.length}}});function hEe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Zh.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=e.cloudType??FA.CUMULUS;if(!FA.validate(t))throw new E("invalid cloud type");let n;return t===FA.CUMULUS&&(n=new uf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Zh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Zh.prototype.removeAll=function(){hEe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function qZ(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];c(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Zh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Zh.prototype.contains=function(e){return c(e)&&e._cloudCollection===this};Zh.prototype.get=function(e){return T.typeOf.number("index",e),qZ(this),this._clouds[e]};var oSt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),rSt=new Uint16Array([0,1,2,0,2,3]);function sSt(e){let t=yt.createVertexBuffer({context:e,typedArray:oSt,usage:Be.STATIC_DRAW}),n=yt.createIndexBuffer({context:e,typedArray:rSt,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:$.FLOAT}];return new ti({context:e,attributes:i,indexBuffer:n})}var YZ;function aSt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(c(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=yt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function cSt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return c(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function lSt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return c(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function uSt(e,t,n){let i=[{index:ff.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.packedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.packedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ff.color,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,usage:Be.STATIC_DRAW}];n&&i.push({index:ff.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:lSt(e)});let o=n?t:4*t;return new Mp(e,i,o,n)}var WZ=new Hn;function mEe(e,t,n,i){let o,r=n[ff.positionHighAndScaleX],s=n[ff.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,WZ);let l=i.scale,u=WZ.high,f=WZ.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,l.x),s(o,f.x,f.y,f.z,l.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,l.x),r(o+1,u.x,u.y,u.z,l.x),r(o+2,u.x,u.y,u.z,l.x),r(o+3,u.x,u.y,u.z,l.x),s(o+0,f.x,f.y,f.z,l.y),s(o+1,f.x,f.y,f.z,l.y),s(o+2,f.x,f.y,f.z,l.y),s(o+3,f.x,f.y,f.z,l.y))}function pEe(e,t,n,i){let o,r=n[ff.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 _Ee(e,t,n,i){let o,r=n[ff.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 gEe(e,t,n,i){let o,r=n[ff.color],s=i.color,a=G.floatToByte(s.red),l=G.floatToByte(s.green),u=G.floatToByte(s.blue),f=G.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,l,u,f)):(o=i._index*4,r(o+0,a,l,u,f),r(o+1,a,l,u,f),r(o+2,a,l,u,f),r(o+3,a,l,u,f))}function fSt(e,t,n,i){mEe(e,t,n,i),pEe(e,t,n,i),_Ee(e,t,n,i),gEe(e,t,n,i)}function dSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows;if(r/s<1||r%s!==0)throw new E("noiseTextureRows must evenly divide textureSliceWidth");let a=t.context;o._vaNoise=sSt(a),o._spNoise=Jt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let l=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Rt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA,sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})});let f=new Uc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:dEe(o),u_noiseDetail:function(){return l},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function hSt(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=uSt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let l=o[a];fSt(e,t,s,l)}n._vaf.commit(YZ(i))}}var mSt=[];function pSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,l=i._propertiesChanged,u=mSt;u.length=0,(l[ZEt]||l[QEt])&&u.push(mEe),(l[$Et]||l[tSt])&&u.push(pEe),(l[JEt]||l[eSt])&&u.push(_Ee),l[iSt]&&u.push(gEe);let f=u.length,h=i._vaf.writers,p,g,m;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,h,g);i._vaf.commit(YZ(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](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 _St(e,t,n,i){let o=t.context,r=e,s=new He({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new He({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Jt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:ff}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:ln.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function gSt(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,l=a.length;s.length=l;for(let u=0;u<l;u++){let f=s[u];c(f)||(f=s[u]=new Qe),f.pass=De.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}Zh.prototype.update=function(e){if(qZ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:c(this._noiseTexture),!this._ready&&!this._loading&&!t&&dSt(this,e,ZF,$F),this._instanced=e.context.instancedArrays,ff=this._instanced?KEt:XEt,YZ=this._instanced?cSt:aSt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?hSt(this,e):r>0&&pSt(this,e),r>i*1.5&&(o.length=i),!(!c(this._vaf)||!c(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&_St(this,e,KF,XF),gSt(this,e))};Zh.prototype.isDestroyed=function(){return!1};Zh.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(),hEe(this._clouds),de(this)};var XZ=Zh;var ySt=O.toRadians(30);function KZ(e){this._angle=e??ySt}Object.defineProperties(KZ.prototype,{angle:{get:function(){return this._angle},set:function(e){T.typeOf.number("value",e),this._angle=e}}});KZ.prototype.emit=function(e){let t=Math.tan(this._angle),n=O.randomBetween(0,O.TWO_PI),i=O.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var $Z=KZ;var bSt=new G,xSt=new G,TSt=new G,ASt=new G,yEe=new se,ak=new Uint8Array(4);function bEe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return G.lerp(t.color,n.color,o,i)}function qG(e,t){return{height:e,color:G.clone(t)}}function xEe(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?G.equals(t.color,i[n-1].color):!1,a=r?G.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?G.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function CSt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length;if(!Array.isArray(s)||a===0)throw new E("entries must be an array with size > 0.");let l=[];for(n=0;n<a;n++){let g=s[n];if(!c(g.height))throw new E("entry requires a height.");if(!c(g.color))throw new E("entry requires a color.");let m=O.clamp(g.height,cu._minimumHeight,cu._maximumHeight),y=G.clone(g.color,bSt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,l.push(qG(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=l[n+0],m=l[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?l=l.reverse():u||gg(l,function(g,m){return O.sign(g.height-m.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;l.length===1&&!h&&!p&&(h=!0,p=!0),h&&l.splice(0,0,qG(cu._minimumHeight,l[0].color)),p&&l.splice(l.length,0,qG(cu._maximumHeight,l[l.length-1].color)),l=xEe(l),i.push(l)}return i}function ESt(e){let t=CSt(e),n=[],i=[],o;function r(u,f){n.push(qG(u,f))}function s(u,f,h){let p=G.multiplyByScalar(h,1-f.alpha,ASt);p=G.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||h<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,x=h<g?i[h]:void 0,A=h>0?i[h-1]:void 0,C=h<g-1?i[h+1]:void 0;if(c(m)&&c(x)&&m.height===x.height){let S=c(C)&&x.height===C.height,v=!c(A),P=!c(C),M=c(b)&&m.height===b.height,R=!c(y),L=!c(b);S?M?(s(m.height,m.color,x.color),s(m.height,b.color,C.color)):R?(r(m.height,x.color),s(m.height,m.color,C.color)):L?(s(m.height,m.color,x.color),r(m.height,C.color)):(s(m.height,m.color,x.color),s(m.height,m.color,C.color)):v?M?(r(m.height,m.color),s(m.height,b.color,x.color)):L?(r(m.height,m.color),r(m.height,x.color)):(R||r(m.height,m.color),s(m.height,m.color,x.color)):P?M?(s(m.height,m.color,x.color),r(m.height,b.color)):R?(r(m.height,x.color),r(m.height,m.color)):L?s(m.height,m.color,x.color):(s(m.height,m.color,x.color),r(m.height,m.color)):M?(s(m.height,m.color,x.color),s(m.height,b.color,x.color)):R?(r(m.height,x.color),s(m.height,m.color,x.color)):L?(s(m.height,m.color,x.color),r(m.height,x.color)):s(m.height,m.color,x.color),f+=M?2:1,h+=S?2:1}else if(c(m)&&c(x)&&c(A)&&m.height<x.height){let S=bEe(m.height,A,x,TSt);c(y)?c(b)?s(m.height,m.color,S):(s(m.height,m.color,S),r(m.height,S)):(r(m.height,S),s(m.height,m.color,S)),f++}else if(c(x)&&c(m)&&c(y)&&x.height<m.height){let S=bEe(x.height,y,m,xSt);c(A)?c(C)?s(x.height,S,x.color):(s(x.height,S,x.color),r(x.height,S)):(r(x.height,S),s(x.height,S,x.color)),h++}else c(m)&&(!c(x)||m.height<x.height)?(c(x)&&!c(A)&&!c(b)?(r(m.height,m.color),r(m.height,cu._emptyColor),r(x.height,cu._emptyColor)):(!c(x)&&c(A)&&!c(y)&&(r(A.height,cu._emptyColor),r(m.height,cu._emptyColor)),r(m.height,m.color)),f++):c(x)&&(!c(m)||x.height<m.height)&&(r(x.height,x.color),h++)}}return xEe(n)}function cu(e){let{scene:t,layers:n}=e??W.EMPTY_OBJECT;T.typeOf.object("options.scene",t),T.defined("options.layers",n),T.typeOf.number.greaterThan("options.layers.length",n.length,0);let{context:i}=t,o=ESt(n),r=o.length,s,a,l;if(!cu._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,l=ke.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,yEe),se.pack(yEe,s,g*4)}else{a=Ue.FLOAT,l=i.webgl2?ke.RED:ke.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Rt.create({context:i,pixelFormat:l,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:li.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(ak),h[g*4+0]=ak[0],h[g*4+1]=ak[1],h[g*4+2]=ak[2],h[g*4+3]=ak[3];let p=Rt.create({context:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:li.LINEAR})});return Xi.fromType("ElevationBand",{heights:f,colors:p})}cu._useFloatTexture=function(e){return e.floatingPointTexture};cu._maximumHeight=5906376425472;cu._minimumHeight=-5906376425472;cu._emptyColor=new G(0,0,0,0);var ZZ=cu;async function SSt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??W.EMPTY_OBJECT,T.typeOf.object("apiOptions",e),e.onlyUsingWithGoogleGeocoder||dt("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=e.key??OA.defaultApiKey;if(!c(n))return wSt(t);let i,o=OA.getDefaultCredit();c(o)&&(i=[o]);let r=new we({url:`${OA.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var TEe={};async function wSt(e){let i=TEe[2275207];c(i)||(i=Cu.fromAssetId(2275207),TEe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var QZ=SSt;async function vSt(e){let t=await bs.fromIonAssetId(96188,e);e=e??W.EMPTY_OBJECT;let n=e.style;if(!c(n)){let i=(e.defaultColor??G.WHITE).toCssColorString();n=new NA({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var JZ=vSt;function DSt(e){e=e??W.EMPTY_OBJECT;let t=[],n=e.geometry;if(!c(n))throw new E("options.geometry is required.");(!c(n.attributes)||!c(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=B.clone(e.modelMatrix??B.IDENTITY),r=e.length??1e4;if(c(i.normal)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Gt(1,0,0,1)},modelMatrix:o})),c(i.tangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Gt(0,1,0,1)},modelMatrix:o})),c(i.bitangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Gt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Pn({asynchronous:!1,geometryInstances:t,appearance:new rn({flat:!0,translucent:!1})})}var eQ=DSt;function ck(e){e=e??W.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;if(!c(t))throw new E("options.attributeName is required.");c(n)||(n=!1);let i=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;default:throw new E("options.glslDatatype must be float, vec2, vec3, or vec4.")}let s=`in vec3 position3DHigh; +`;var vjt=new h(1,1,1);function Qae(e){e=e??vjt,this._dimensions=h.clone(e)}Object.defineProperties(Qae.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var Sjt=new h;Qae.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,Sjt),i=D.randomBetween(-n.x,n.x),r=D.randomBetween(-n.y,n.y),o=D.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var ece=Qae;var tce=0,M2e=new h,DW=new h,wjt=new Do;function Ijt(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=wjt.tileXYToRectangle(i,r,o),c=ie.center(a),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let B=(4-x%4)%4;B>0&&(b.push(new Uint8Array(B)),x+=B)}function E(B,j){T();let k=x;b.push(new Uint8Array(B.buffer,B.byteOffset,B.byteLength)),x+=B.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:k,byteLength:B.byteLength,target:j}),G}function v(B,j){let k=E(B,j.target),G=bt.getComponentCount(j.type),q={bufferView:k,byteOffset:0,componentType:j.componentType,count:B.length/G,type:j.type};l(j.min)&&(q.min=j.min),l(j.max)&&(q.max=j.max);let Q=A.length;return A.push(q),Q}function S(B){let j=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,W=Number.NEGATIVE_INFINITY;for(let J=0;J<B.length;J+=3){let Z=B[J],ae=B[J+1],Ae=B[J+2];Z<j&&(j=Z),ae<k&&(k=ae),Ae<G&&(G=Ae),Z>q&&(q=Z),ae>Q&&(Q=ae),Ae>W&&(W=Ae)}return{min:[j,k,G],max:[q,Q,W]}}function I(B,j,k){if(k.length===0)return;let G=new Uint32Array(k),q=v(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER});B._FEATURE_ID_0=q;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(B,j){j=j??4;let k=(j-x%j)%j;k>0&&(b.push(new Uint8Array(k)),x+=k);let G=x;b.push(B),x+=B.byteLength;let q=y.length;return y.push({buffer:0,byteOffset:G,byteLength:B.byteLength}),q}function O(){if(m.size===0)return;let B=new Map;for(let q of m.values())for(let[Q,W]of Object.entries(q)){if(!l(W))continue;let J=typeof W,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ae=B.get(Q);l(ae)?ae!==Z&&B.set(Q,"STRING"):B.set(Q,Z)}if(B.size===0)return;let j={};for(let[q,Q]of B)Q==="SCALAR"?j[q]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[q]={type:"BOOLEAN"}:j[q]={type:"STRING"};let k={},G=g.size;for(let[q,Q]of B)if(Q==="SCALAR"){let W=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[q];W[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(W.buffer,W.byteOffset,W.byteLength),8);k[q]={values:J}}else if(Q==="BOOLEAN"){let W=Math.ceil(G/8),J=new Uint8Array(W);for(let ae=0;ae<G;ae++)m.get(ae)?.[q]&&(J[ae>>3]|=1<<(ae&7));let Z=R(J);k[q]={values:Z}}else{let W=new TextEncoder,J=[],Z=new Uint32Array(G+1),ae=0;for(let we=0;we<G;we++){Z[we]=ae;let Re=m.get(we)?.[q],Qe;Re==null?Qe="":typeof Re=="string"?Qe=Re:Qe=String(Re);let He=W.encode(Qe);J.push(He),ae+=He.byteLength}Z[G]=ae;let Ae=new Uint8Array(ae),fe=0;for(let we of J)Ae.set(we,fe),fe+=we.byteLength;let xe=R(Ae),ge=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));k[q]={values:xe,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:k}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let B of e.layers){let j=B.extent,k=[],G=[],q=[],Q=[],W=[],J=0,Z=[],ae=[],Ae=[],fe=[],xe=[],ge=[],we=[],Se=0;for(let He of B.features){let Xe=l(s)?Djt(He,s,g)??d:Pjt(He,g);if(Xe!==d&&!m.has(Xe)){let $e=Object.assign({},He.properties);$e._layer=B.name??"",m.set(Xe,$e)}if(He.type==="Point"){let $e=He.geometry;for(let Pe of $e)nce(Pe,i,r,o,j,tce,u,k),G.push(Xe);continue}if(He.type==="LineString"){let $e=He.geometry;for(let Pe of $e){let qe=q.length/3;for(let st of Pe)nce(st,i,r,o,j,tce,u,q),Q.push(Xe);for(let st=0;st<Pe.length;st++)W.push(qe+st);W.push(p),J++}continue}if(He.type==="Polygon"){let $e=He.geometry,Pe=Rjt($e);for(let qe of Pe){let st=[qe.outerRing,...qe.holes],vt=[],Gt=[],lt=[],mt=0;for(let ht=0;ht<st.length;ht++){let Bi=st[ht];ht>0&<.push(mt);for(let Xn of Bi)vt.push(new U(Xn.x,Xn.y)),nce(Xn,i,r,o,j,tce,u,Gt),mt++}if(vt.length<3)continue;let ft=ui.triangulate(vt,lt.length>0?lt:void 0);if(!l(ft)||ft.length===0){_t("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let Xt=Z.length/3,rt=Ae.length;fe.push(Xt),xe.push(rt),ge.push(lt.length);for(let ht=0;ht<lt.length;ht++)we.push(Xt+lt[ht]);for(let ht=0;ht<Gt.length;ht++)Z.push(Gt[ht]);for(let ht=0;ht<Gt.length/3;ht++)ae.push(Xe);for(let ht=0;ht<ft.length;ht++)Ae.push(ft[ht]+Xt);Se++}}}if(k.length===0&&q.length===0&&Z.length===0)continue;W.length>0&&W[W.length-1]===p&&W.pop();let Re=[];if(k.length>0){let He=new Float32Array(k),Xe=S(He),Pe={POSITION:v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Xe.min,max:Xe.max})},qe={CESIUM_mesh_vector:{vector:!0,count:He.length/3}};I(Pe,qe,G),Re.push({mode:Oe.POINTS,attributes:Pe,extensions:qe})}if(q.length>0&&W.length>1){let He=new Float32Array(q),Xe=new Uint32Array(W),$e=S(He),Pe=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:$e.min,max:$e.max}),qe=v(Xe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),st={POSITION:Pe},vt={CESIUM_mesh_vector:{vector:!0,count:J}};I(st,vt,Q),Re.push({mode:Oe.LINE_STRIP,indices:qe,attributes:st,extensions:vt})}if(Z.length>0&&Ae.length>=3){let He=new Float32Array(Z),Xe=new Uint32Array(Ae),$e=new Uint32Array(fe),Pe=new Uint32Array(xe),qe=we.length>0,st=qe?new Uint32Array(ge):void 0,vt=qe?new Uint32Array(we):void 0,Gt=S(He),lt=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Gt.min,max:Gt.max}),mt=v(Xe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),ft=v($e,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),Xt=v(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),rt=l(st)?v(st,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,ht=l(vt)?v(vt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,Bi={POSITION:lt},Xn={CESIUM_mesh_vector:{vector:!0,count:Se,polygonAttributeOffsets:ft,polygonIndicesOffsets:Xt}};qe&&(Xn.CESIUM_mesh_vector.polygonHoleCounts=rt,Xn.CESIUM_mesh_vector.polygonHoleOffsets=ht),I(Bi,Xn,ae),Re.push({mode:Oe.TRIANGLES,indices:mt,attributes:Bi,extensions:Xn})}if(Re.length===0)continue;let Qe=L.length;L.push({primitives:Re}),_.push({name:B.name,mesh:Qe,translation:C})}if(_.length===0)return;let w=O(),P=Ljt(b,x),M=["CESIUM_mesh_vector"];g.size>0&&M.push("EXT_mesh_features"),l(w)&&M.push("EXT_structural_metadata");let F=_.map((B,j)=>j),V={asset:{version:"2.0"},extensionsUsed:M,scene:0,scenes:[{nodes:F}],nodes:_,meshes:L,accessors:A,bufferViews:y,buffers:[{byteLength:P.byteLength}],extensions:void 0};return l(w)&&(V.extensions={EXT_structural_metadata:w}),Njt(V,P)}function Pjt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function Djt(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,s=n.get(o);return l(s)||(s=n.size,n.set(o,s)),s}function Rjt(e){let t=[];for(let n of e){let i=Mjt(n);if(i.length<3)continue;Ojt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function Ojt(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function Mjt(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function nce(e,t,n,i,r,o,s,a){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,M2e),h.subtract(M2e,s,DW),a.push(DW.x,DW.y,DW.z)}function Njt(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+a+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,a,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=a,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function Ljt(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var z4=Ijt;var ice=class{constructor(){ut(this,"featuresLength");ut(this,"pointsLength");ut(this,"trianglesLength");ut(this,"geometryByteLength");ut(this,"texturesByteLength");ut(this,"batchTableByteLength");ut(this,"innerContents");ut(this,"ready");ut(this,"tileset");ut(this,"tile");ut(this,"url");ut(this,"batchTable");ut(this,"metadata");ut(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},rce=ice;function V4(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new _g({comparator:V4.comparator})}V4.prototype.addSubtree=function(e){let t=new Fjt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};V4.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};V4.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 Fjt(e,t){this.subtree=e,this.stamp=t}var j4=V4;function H4(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=N.IDENTITY.clone(),shapeTransform:f=N.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Ec.ELLIPSOID?q0.Z_UP:q0.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new j4}Object.defineProperties(H4.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}}});H4.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();kjt(n);let i=Wjt(n,t);await i.load();let{root:r}=n,o=er(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new TE({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=qjt(s,c);Object.assign(u,Ujt(r)),l(r.transform)?u.globalTransform=N.unpack(r.transform):u.globalTransform=N.clone(N.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=Bjt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new H4(u),d=new Yp(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Li.unload(i),f};function Bjt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(kd.TILESET_TILE_COUNT)}function kjt(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!er(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!er(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!er(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function Ujt(e){let t=e.boundingVolume;if(l(t.box))return Hjt(t.box);if(l(t.region))return zjt(t.region);if(er(t,"3DTILES_bounding_volume_cylinder"))return Gjt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function zjt(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=N.fromScale(ee.WGS84.radii),c=new h(t,n,o),u=new h(i,r,s);return{shape:Ec.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var Vjt=new h,jjt=new $;function Hjt(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,Vjt),i=$.getRotation(t.halfAxes,jjt);return{shape:Ec.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:N.fromRotationTranslation(i,t.center)}}function Gjt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-D.PI,maxAngle:o=D.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=N.fromTranslationQuaternionRotationScale(h.unpack(s),Le.unpack(a),h.ONE);return{shape:Ec.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function Wjt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Li.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Li.getSchemaLoader({schema:i})}function qjt(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,s=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=bt.getComponentCount(y),E=N2e(b,T),v=N2e(x,T);return{id:g,type:y,componentType:A,minValue:E,maxValue:v}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),d=s.map(g=>g.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function N2e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function Yjt(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=M_(a);return r=await Eg.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}H4.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new qp({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await Yjt(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=s,A=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return RC.fromGltf(b)};var oce=H4;function sce(e){e=e??1,this._radius=e??1}Object.defineProperties(sce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});sce.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var G4=sce;var RW={CUMULUS:0};RW.validate=function(e){return e===RW.CUMULUS};Object.freeze(RW);var zP=RW;function hp(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var Xjt=hp.SHOW_INDEX=0,Kjt=hp.POSITION_INDEX=1,$jt=hp.SCALE_INDEX=2,Jjt=hp.MAXIMUM_SIZE_INDEX=3,Zjt=hp.SLICE_INDEX=4,Qjt=hp.BRIGHTNESS_INDEX=5,e6t=hp.COLOR_INDEX=6;hp.NUMBER_OF_PROPERTIES=7;function VC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(hp.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,VC(this,Xjt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),VC(this,Kjt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),VC(this,$jt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),VC(this,Jjt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),VC(this,e6t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,VC(this,Zjt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,VC(this,Qjt))}}});hp.prototype._destroy=function(){this._cloudCollection=void 0};var Ad=hp;var bd,OW=new h,t6t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},n6t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},i6t=Ad.SHOW_INDEX,r6t=Ad.POSITION_INDEX,o6t=Ad.SCALE_INDEX,s6t=Ad.MAXIMUM_SIZE_INDEX,a6t=Ad.SLICE_INDEX,c6t=Ad.BRIGHTNESS_INDEX,l6t=Ad.NUMBER_OF_PROPERTIES,u6t=Ad.COLOR_INDEX;function mp(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(l6t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:L2e(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function L2e(e){return function(){return OW.x=e._textureSliceWidth,OW.y=e._noiseTextureRows,OW.z=1/e._noiseTextureRows,OW}}Object.defineProperties(mp.prototype,{length:{get:function(){return cce(this),this._clouds.length}}});function F2e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}mp.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??zP.CUMULUS,n;return t===zP.CUMULUS&&(n=new Ad(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};mp.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};mp.prototype.removeAll=function(){F2e(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function cce(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}mp.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};mp.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};mp.prototype.get=function(e){return cce(this),this._clouds[e]};var f6t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),d6t=new Uint16Array([0,1,2,0,2,3]);function h6t(e){let t=tt.createVertexBuffer({context:e,typedArray:f6t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:d6t,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new zn({context:e,attributes:i,indexBuffer:n})}var lce;function m6t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=tt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function p6t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function g6t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.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 _6t(e,t,n){let i=[{index:bd.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:bd.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:g6t(e)});let r=n?t:4*t;return new hg(e,i,r,n)}var ace=new Sn;function B2e(e,t,n,i){let r,o=n[bd.positionHighAndScaleX],s=n[bd.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,ace);let c=i.scale,u=ace.high,f=ace.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function k2e(e,t,n,i){let r,o=n[bd.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function U2e(e,t,n,i){let r,o=n[bd.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function z2e(e,t,n,i){let r,o=n[bd.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function y6t(e,t,n,i){B2e(e,t,n,i),k2e(e,t,n,i),U2e(e,t,n,i),z2e(e,t,n,i)}function A6t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=h6t(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Dt({context:a,width:o*o/s,height:o*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA,sampler:new jt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})});let f=new bf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:L2e(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function b6t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=_6t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];y6t(e,t,s,c)}n._vaf.commit(lce(i))}}var x6t=[];function T6t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=x6t;u.length=0,(c[r6t]||c[o6t])&&u.push(B2e),(c[i6t]||c[c6t])&&u.push(k2e),(c[s6t]||c[a6t])&&u.push(U2e),c[u6t]&&u.push(z2e);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(lce(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function E6t(e,t,n,i){let r=t.context,o=e,s=new Ye({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Ye({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:bd}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:tn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function C6t(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new at),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}mp.prototype.update=function(e){if(cce(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&A6t(this,e,k4,B4),this._instanced=e.context.instancedArrays,bd=this._instanced?n6t:t6t,lce=this._instanced?p6t:m6t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?b6t(this,e):o>0&&T6t(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&E6t(this,e,F4,L4),C6t(this,e))};mp.prototype.isDestroyed=function(){return!1};mp.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(),F2e(this._clouds),ue(this)};var uce=mp;var v6t=D.toRadians(30);function fce(e){this._angle=e??v6t}Object.defineProperties(fce.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});fce.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var dce=fce;var S6t=new z,w6t=new z,I6t=new z,P6t=new z,V2e=new se,W4=new Uint8Array(4);function j2e(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function MW(e,t){return{height:e,color:z.clone(t)}}function H2e(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function D6t(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=D.clamp(g.height,mf._minimumHeight,mf._maximumHeight),y=z.clone(g.color,S6t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(MW(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||n0(c,function(g,m){return D.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,MW(mf._minimumHeight,c[0].color)),p&&c.splice(c.length,0,MW(mf._maximumHeight,c[c.length-1].color)),c=H2e(c),i.push(c)}return i}function R6t(e){let t=D6t(e),n=[],i,r;function o(u,f){n.push(MW(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,P6t);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let E=l(T)&&b.height===T.height,v=!l(x),S=!l(T),I=l(A)&&m.height===A.height,R=!l(y),O=!l(A);E?I?(s(m.height,m.color,b.color),s(m.height,A.color,T.color)):R?(o(m.height,b.color),s(m.height,m.color,T.color)):O?(s(m.height,m.color,b.color),o(m.height,T.color)):(s(m.height,m.color,b.color),s(m.height,m.color,T.color)):v?I?(o(m.height,m.color),s(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),s(m.height,m.color,b.color)):S?I?(s(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),o(m.height,m.color)):I?(s(m.height,m.color,b.color),s(m.height,A.color,b.color)):R?(o(m.height,b.color),s(m.height,m.color,b.color)):O?(s(m.height,m.color,b.color),o(m.height,b.color)):s(m.height,m.color,b.color),f+=I?2:1,d+=E?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let E=j2e(m.height,x,b,I6t);l(y)?l(A)?s(m.height,m.color,E):(s(m.height,m.color,E),o(m.height,E)):(o(m.height,E),s(m.height,m.color,E)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let E=j2e(b.height,y,m,w6t);l(x)?l(T)?s(b.height,E,b.color):(s(b.height,E,b.color),o(b.height,E)):(o(b.height,E),s(b.height,E,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,mf._emptyColor),o(b.height,mf._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,mf._emptyColor),o(m.height,mf._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return H2e(n)}function mf(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=R6t(n),o=r.length,s,a,c;if(!mf._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=Ke.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)se.packFloat(r[g].height,V2e),se.pack(V2e,s,g*4)}else{a=ze.FLOAT,c=i.webgl2?Ke.RED:Ke.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(W4),d[g*4+0]=W4[0],d[g*4+1]=W4[1],d[g*4+2]=W4[2],d[g*4+3]=W4[3];let p=Dt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})});return or.fromType("ElevationBand",{heights:f,colors:p})}mf._useFloatTexture=function(e){return e.floatingPointTexture};mf._maximumHeight=5906376425472;mf._minimumHeight=-5906376425472;mf._emptyColor=new z(0,0,0,0);var hce=mf;async function O6t(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??H.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=e.key??Aa.defaultApiKey;if(!l(n))return M6t(t);let i,r=Aa.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Aa.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Ko.fromUrl(o,t)}var G2e={};async function M6t(e){let i=G2e[2275207];l(i)||(i=Ho.fromAssetId(2275207),G2e[2275207]=i);let r=await i;return Ko.fromUrl(r,e)}var mce=O6t;async function N6t(e){let t=await Ko.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new P_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var pce=N6t;function L6t(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=N.clone(e.modelMatrix??N.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Mn({asynchronous:!1,geometryInstances:t,appearance:new yn({flat:!0,translucent:!1})})}var gce=L6t;function q4(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } +`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } +`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } +`;break;case"vec4":o=`vec4 getColor() { return ${r}; } +`;break}let s=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; ${n?"":`in ${i} ${t}; -`}out ${i} ${o}; +`}out ${i} ${r}; void main() { vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${o} = czm_batchTable_${t}(batchId); -`:`${o} = ${t}; +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; `}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${o}; -${r} +}`,a=`in ${i} ${r}; +${o} void main() { out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=io.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(ck.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}}});ck.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;ck.prototype.isTranslucent=io.prototype.isTranslucent;ck.prototype.getRenderState=io.prototype.getRenderState;var tQ=ck;function YG(e){e=e??W.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._modelMatrix=new B,this.id=e.id,this._id=void 0,this._primitive=void 0}YG.prototype.update=function(e){if(this.show){if(!c(this._primitive)||!B.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=B.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,c(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new St({geometry:new ng({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[G.RED,G.RED],arcType:qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),n=new St({geometry:new ng({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[G.GREEN,G.GREEN],arcType:qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this}),i=new St({geometry:new ng({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:is.VERTEX_FORMAT,colors:[G.BLUE,G.BLUE],arcType:qt.NONE}),modelMatrix:B.multiplyByUniformScale(this.modelMatrix,this.length,new B),id:this.id,pickPrimitive:this});this._primitive=new Pn({geometryInstances:[t,n,i],appearance:new is,asynchronous:!1})}this._primitive.update(e)}};YG.prototype.isDestroyed=function(){return!1};YG.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var lk=YG;function PSt(e){if(T.typeOf.object("options",e),T.typeOf.object("options.direction",e.direction),d.equals(e.direction,d.ZERO))throw new E("options.direction cannot be zero-length");this.direction=d.clone(e.direction),this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??1}var nQ=PSt;var uk=`in vec3 v_positionMC; +}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Dr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(q4.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}}});q4.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;q4.prototype.isTranslucent=Dr.prototype.isTranslucent;q4.prototype.getRenderState=Dr.prototype.getRenderState;var _ce=q4;function NW(e){e=e??H.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this.id=e.id,this._id=void 0,this._primitive=void 0}NW.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!N.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=N.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 Ft({geometry:new Vg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ws.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),n=new Ft({geometry:new Vg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ws.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),i=new Ft({geometry:new Vg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ws.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this});this._primitive=new Mn({geometryInstances:[t,n,i],appearance:new Ws,asynchronous:!1})}this._primitive.update(e)}};NW.prototype.isDestroyed=function(){return!1};NW.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Y4=NW;var F6t=new TextDecoder,LW={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},B6t={LAYERS:3},X4={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},yce={TAGS:2,TYPE:3,GEOMETRY:4},jC={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},k6t=["Unknown","Point","LineString","Polygon"];function U6t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=FW(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===B6t.LAYERS&&s===2){let a=yy(t,i,t.length);i=a.newPos;let c=pf(i,a.value,t.length,"layer");n.push(z6t(t,i,c)),i=c}else i=BW(t,i,s,t.length)}return{layers:n}}function z6t(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=FW(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===X4.NAME&&p===2){let g=yy(e,i,n);i=g.newPos;let m=pf(i,g.value,n,"layer name");r=bce(e,i,g.value),i=m}else if(d===X4.FEATURES&&p===2){let g=yy(e,i,n);i=g.newPos;let m=pf(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===X4.KEYS&&p===2){let g=yy(e,i,n);i=g.newPos;let m=pf(i,g.value,n,"key");s.push(bce(e,i,g.value)),i=m}else if(d===X4.VALUES&&p===2){let g=yy(e,i,n);i=g.newPos;let m=pf(i,g.value,n,"value"),y=H6t(e,i,m);a.push(y),i=m}else if(d===X4.EXTENT&&p===0){let g=VP(e,i,n);o=g.value,i=g.newPos}else i=BW(e,i,p,n)}let u=c.map(({start:f,end:d})=>V6t(e,f,d,s,a));return{name:r,extent:o,features:u}}function V6t(e,t,n,i,r){let o=t,s=LW.UNKNOWN,a=[],c=[];for(;o<n;){let d=FW(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===yce.TYPE&&g===0){let m=VP(e,o,n);s=m.value,o=m.newPos}else if(p===yce.TAGS&&g===2){let m=yy(e,o,n);o=m.newPos;let y=pf(o,m.value,n,"feature tags");for(;o<y;){let A=VP(e,o,y);a.push(A.value),o=A.newPos}}else if(p===yce.GEOMETRY&&g===2){let m=yy(e,o,n);o=m.newPos;let y=pf(o,m.value,n,"feature geometry");for(;o<y;){let A=VP(e,o,y);c.push(A.value),o=A.newPos}}else o=BW(e,o,g,n)}let u={};for(let d=0;d<a.length-1;d+=2){let p=i[a[d]],g=r[a[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=j6t(s,c);return{type:k6t[s]??"Unknown",geometry:f,properties:u}}function j6t(e,t){let n=0,i=0,r=0;if(e===LW.POINT){let o=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let u=0;u<c;u++)i+=K0(t[n++]),r+=K0(t[n++]),o.push({x:i,y:r})}return o}if(e===LW.LINESTRING){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===LW.POLYGON){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),o.push(s),s=null)}return s!==null&&o.push(s),o}return[]}function H6t(e,t,n){let i=t;for(;i<n;){let r=FW(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===jC.STRING&&s===2){let a=yy(e,i,n);i=a.newPos;let c=pf(i,a.value,n,"string value");return bce(e,i,c-i)}else{if(o===jC.FLOAT&&s===5)return pf(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===jC.DOUBLE&&s===1)return pf(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===jC.INT64&&s===0){let a=jP(e,i,n);return Ace(a.value)}else if(o===jC.UINT64&&s===0){let a=jP(e,i,n);return Ace(a.value)}else if(o===jC.SINT64&&s===0){let a=jP(e,i,n);return Ace(G6t(a.value))}else if(o===jC.BOOL&&s===0)return VP(e,i,n).value!==0}i=BW(e,i,s,n)}}function FW(e,t,n){let i=VP(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function VP(e,t,n){let i=jP(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function yy(e,t,n){let i=jP(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function jP(e,t,n,i){let r=0n,o=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,s++,(c&128)===0)break;if(s>=a)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function bce(e,t,n){let i=pf(t,n,e.length,"string");return F6t.decode(e.subarray(t,i))}function pf(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function BW(e,t,n,i){if(n===0)return jP(e,t,i).newPos;if(n===1)return pf(t,8,i,"fixed64 field");if(n===2){let r=yy(e,t,i);return pf(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return pf(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function K0(e){return e>>>1^-(e&1)}function G6t(e){return e>>1n^-(e&1n)}function Ace(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var K4=U6t;function W6t(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var xce=W6t;var $4=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; void main() @@ -10865,7 +12702,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var fk=`in vec3 position3DHigh; +`;var J4=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -10880,7 +12717,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function kA(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??fk,this._fragmentShaderSource=e.fragmentShaderSource??uk,this._renderState=io.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(kA.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 kA.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});kA.VERTEX_FORMAT=Ie.POSITION_AND_ST;kA.prototype.getFragmentShaderSource=io.prototype.getFragmentShaderSource;kA.prototype.isTranslucent=io.prototype.isTranslucent;kA.prototype.getRenderState=io.prototype.getRenderState;var iQ=kA;function lu(e){if(!c(e)||!c(e.scene))throw new E("options.scene is required.");this._scene=e.scene,this.samplingWindow=e.samplingWindow??lu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??lu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??lu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??lu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??lu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new pe,this._nominalFrameRate=new pe,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){ISt(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(){OSt(t)}this._visibilityChangeRemoveListener=void 0,c(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}lu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};lu.fromScene=function(e){if(!c(e))throw new E("scene is required.");return(!c(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new lu({scene:e})),e._frameRateMonitor};Object.defineProperties(lu.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}}});lu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};lu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};lu.prototype.isDestroyed=function(){return!1};lu.prototype.destroy=function(){return this._preUpdateRemoveListener(),c(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),de(this)};function ISt(e,t){if(e._pauseCount>0)return;let n=Ti();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.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 OSt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var dk=lu;var AEe=Zo(fZ(),1);function oQ(){this._image=new Image}oQ.prototype.isReady=function(){return!0};oQ.prototype.shouldDiscardImage=function(e){return e===this._image};function UA(e){e=e??W.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 Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Tt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new oQ),this._errorEvent=new pe}Object.defineProperties(UA.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}}});UA.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new UA(t);return n._metadata=e,n};UA.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(c(o)){let r=i.providers[o.imageryProvider];if(c(r))return[r]}};UA.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=Og.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!c(a)){if(r.isValid(s)){let u=new Qo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let l=RSt(this,a,e,t,n,i).fetchArrayBuffer();if(c(l))return l.then(function(u){$3(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!c(p)||!p)&&(h=MSt(f)),!c(h)&&(!c(p)||p)){let g=LSt(f);h=g.imageType,f=g.imageData}return!c(h)||!c(f)?o:ux({uint8Array:f,format:h,flipY:!0})})};UA.prototype.pickFeatures=function(e,t,n,i,o){};function RSt(e,t,n,i,o,r){let s=Og.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=c(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function MSt(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 LSt(e){let t=AEe.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,c(a)||(a=i.copyrightIds=[]),(s&7)===2){let l=t.uint32()+t.pos;for(;t.pos<l;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(c(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 c(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var rQ=UA;var NSt=new G(1,1,1,.4),FSt=new G(0,1,0,.05),BSt=new G(0,.5,0,.2);function VA(e){e=e??W.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=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??NSt,this._glowColor=e.glowColor??FSt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??BSt,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(VA.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}}});VA.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()};VA.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};VA.prototype.getTileCredits=function(e,t,n){};VA.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};VA.prototype.pickFeatures=function(e,t,n,i,o){};var sQ=VA;function Qh(){}Qh._maxDecodingConcurrency=Math.max(Vt.hardwareConcurrency-1,1);Qh._decodeTaskProcessor=new yi("decodeI3S",Qh._maxDecodingConcurrency);Qh._promise=void 0;async function kSt(){if(await Qh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Qh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}Qh.decode=async function(e,t,n,i,o){return T.typeOf.string("url",e),T.defined("defaultGeometrySchema",t),T.defined("geometryData",n),c(Qh._promise)||(Qh._promise=kSt()),Qh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,l=0,u=0,f=0;c(s.obb)?(l=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):c(s.mbs)&&(l=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=J.fromRotationX(-O.PI_OVER_TWO),p=new J;J.multiply(h,a,p);let g=he.fromDegrees(l,u,f),m=ie.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:c(i)&&c(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ie.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var hk=Qh;function aQ(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,c(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(aQ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});aQ.prototype.load=async function(){return this._data=await Jh.loadJson(this._resource),this._data};var mk=aQ;function Mg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;c(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(Mg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(c(this._values)){if(c(this._values.attributeValues))return this._values.attributeValues;if(c(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function XG(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 USt(e){return e==="String"?1:XG(e)}async function VSt(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)}Mg.prototype.load=function(){return c(this._loadPromise)?this._loadPromise:(this._loadPromise=VSt(this).catch(function(e){console.error(e)}),this._loadPromise)};Mg.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}};Mg.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};Mg.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(c(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],l="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(l+=f.value),t=f.offset}this._values[o].push(l)}}}};Mg.prototype._getBodyOffset=function(e){let t=0;return c(this._storageInfo.attributeValues)?t=XG(this._storageInfo.attributeValues.valueType):c(this._storageInfo.objectIds)&&(t=XG(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Mg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=USt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Mg.prototype._validateBody=function(e,t){if(!c(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(c(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=XG(s.valueType);t+=a*this._header.count}else{if(!c(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 l=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=l.value,n=l.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 pk=Mg;function _k(e,t){let n=e._dataProvider,i=e._layer,o;c(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(_k.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});_k.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var zSt=new d,HSt=new d,GSt=new d,jSt=new d,WSt=new d;function cQ(e,t,n,i){let o=d.subtract(i,n,zSt),r=d.cross(o,d.subtract(e,n,HSt),jSt),s=d.cross(o,d.subtract(t,n,GSt),WSt);return d.dot(r,s)>=0}var qSt=new d,YSt=new d,XSt=new d,KSt=new d,$St=new d,ZSt=new d,QSt=new d,JSt=new d,ewt=new d,twt=new d;_k.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(c(this._customAttributes)&&c(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,J.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,l,u=this._customAttributes.positions,f=this._customAttributes.indices,h;c(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let g,m,y;c(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let b=d.fromElements(u[g*3],u[g*3+1],u[g*3+2],qSt),x=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],YSt),A=new d(u[y*3],u[y*3+1],u[y*3+2],XSt);if(!cQ(i,b,x,A)||!cQ(i,x,b,A)||!cQ(i,A,b,x))continue;let C=d.subtract(x,b,KSt),S=d.subtract(A,b,$St),v=d.cross(C,S,ZSt);if(d.magnitude(v)===0)continue;let P=d.normalize(v,QSt),M=d.subtract(i,b,JSt),R=Math.abs(d.dot(M,P));if(R<o){o=R,r=p;let L=d.magnitudeSquared(d.subtract(i,b,M)),F=d.magnitudeSquared(d.subtract(i,x,ewt)),_=d.magnitudeSquared(d.subtract(i,A,twt));L<F&&L<_?(a=g,l=b,s=L):F<_?(a=m,l=x,s=F):(a=y,l=A,s=_)}}if(c(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(l)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function CEe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(MA(e[i])):t.push(e[i]);return t}_k.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let l={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(c(this._parent._data.mesh)&&c(this._layer._data.materialDefinitions)){let C=this._parent._data.mesh.material.definition;if(C>=0&&C<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[C],l=f,c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorTexture)){u=!0,l.pbrMetallicRoughness.baseColorTexture.index=0;let S="0";if(c(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let P=this._layer._data.textureSetDefinitions[v];for(let M=0;M<P.formats.length;M++){let R=P.formats[M];if(R.format==="jpg"){S=R.name;break}}}c(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/${S}`}).url)}c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorFactor)&&(l.pbrMetallicRoughness.baseColorFactor=CEe(l.pbrMetallicRoughness.baseColorFactor)),c(l.emissiveFactor)&&(l.emissiveFactor=CEe(l.emissiveFactor))}}else c(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,l.pbrMetallicRoughness.baseColorTexture={index:0});c(l.alphaMode)&&(l.alphaMode=l.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],b=n.length;for(let A=0;A<b;A++){let C=n[A].primitives,S=C.length;for(let v=0;v<S;v++){let P=C[v];if(c(P.material)){for(;P.material>=y.length;){let R=je(l,!0);y.push(R)}let M=y[P.material];c(P.extra)&&P.extra.isTransparent?c(M.alphaMode)||(M.alphaMode="BLEND"):M.alphaMode==="BLEND"&&(M.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var Qw=_k;function Bc(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(Bc.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}}});Bc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Zf(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!c(this._nodeIndex)){let o=await Jh.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/":c(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),c(i)&&c(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function EEe(e,t){let n=new pk(e,t);return e._fields[t.name]=n,n.load()}Bc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(c(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];c(o)?t.push(o.load()):t.push(EEe(this,i))}return Promise.all(t)};Bc.prototype.loadField=function(e){T.defined("name",e);let t=this._fields[e];if(c(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return EEe(this,o)}return Promise.resolve()};Bc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!c(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)};Bc.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};Bc.prototype._loadChildren=function(){let e=this;if(c(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(c(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Bc(e,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};Bc.prototype._loadGeometryData=function(){let e=[];if(c(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Qw(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(c(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new Qw(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Bc.prototype._loadFeatureData=function(){let e=[];if(c(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new mk(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Bc.prototype._clearGeometryData=function(){this._geometryData=[]};Bc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!c(e)&&!c(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(c(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),c(this._dataProvider._geoidDataList)&&c(n))for(let x=0;x<this._dataProvider._geoidDataList.length;x++){let A=this._dataProvider._geoidDataList[x],C=A.projection.project(n);if(C.x>A.nativeExtent.west&&C.x<A.nativeExtent.east&&C.y>A.nativeExtent.south&&C.y<A.nativeExtent.north){n.height+=rwt(C.x,C.y,A);break}}let i={},o,r=0;c(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=ie.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ie.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(c(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let x=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/x}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let x=this._data.lodThreshold;s=r/x}else console.error("Invalid lodSelectionMetricType in Layer");else if(c(this._data.lodSelection))for(let x=0;x<this._data.lodSelection.length;x++)this._data.lodSelection[x].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[x].maxError);s===1/0&&(s=1e5);let a=s*16,l=new Oa(0,0,0),u=Ot.headingPitchRollQuaternion(o,l);c(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=J.fromQuaternion(u),h=J.inverse(f,new J),p=new B(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=B.inverse(p,new B),m=B.clone(p);c(this._parent._globalTransform)&&B.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let y=[];for(let x=0;x<this._children.length;x++)y.push(this._children[x]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:c(this._resource)?this._resource.url:void 0},geometricError:a}};Bc.prototype._loadSymbology=async function(){!c(this._symbologyData)&&c(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Bc.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),c(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 hk.decode(o,r,s,this._featureData[0],this._symbologyData);if(!c(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 nwt(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 iwt(e,t,n){if(!c(n.values)||n.values.length===0)return!1;let i=c(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 SEe(e,t){let n=e._tile.content.batchTable;if(c(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await nwt(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(!iwt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Bc.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(c(this._geometryData)&&this._geometryData.length>0&&c(t)&&t.ready){t.show=!1;let n=SEe(this,t);e.push(n)}return Promise.all(e)};Zf.prototype._hookedRequestContent=Zf.prototype.requestContent;Zf.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(!c(t)){e._isLoading=!1;return}return e._contentResource=new we({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return c(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&c(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{SEe(e._i3sNode,n)})),e._isLoading=!1,t})}};function owt(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 KG(e,t,n,i){let o=e+t*n;return i[o]}function rwt(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 l=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=KG(s,a,n.width,n.buffer),h=KG(l,a,n.width,n.buffer),p=KG(s,u,n.width,n.buffer),g=KG(l,u,n.width,n.buffer),m=owt(o,r,f,h,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Zf.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var Jw=Bc;function $G(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties($G.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lQ(e,t){let n=[];for(let i=0;i<e.length;i++){let o=G.byteToFloat(e[i]);i<3?n.push(MA(o)):n.push(o)}return n.length===3&&(c(t)?n.push(1-t/100):n.push(1)),n}function ev(e,t){let n={edges:void 0,material:void 0};if(c(e)&&c(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(c(r)?(n.edges={},c(r.color)&&(n.edges.color=lQ(r.color,r.transparency))):c(s)&&(n.edges={},c(s.color)&&(n.edges.color=lQ(s.color,s.transparency))),!t){let a=o.material;c(a)&&(n.material={colorMixMode:a.colorMixMode},c(a.color)&&(n.material.color=lQ(a.color,a.transparency)))}break}}return n}function swt(e,t){if(c(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(c(o))for(let r=0;r<o.length;r++){let s=ev(o[r].symbol,t),a=o[r].values;for(let l=0;l<a.length;l++){let u=a[l],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=s:(c(f[p])||(f[p]={}),f=f[p])}}}}return n}if(c(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=ev(o.symbol,t)}return n}}function awt(e,t){if(c(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};c(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];c(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),c(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(ev(r.symbol,t)))}return i.symbols.push(void 0),i}}$G.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(c(e)&&c(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=c(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=ev(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=ev(i.defaultSymbol,n),this._valueFields.push(i.field1),c(i.field2)&&this._valueFields.push(i.field2),c(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=swt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=ev(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=awt(i,n))}};function wEe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return c(s)&&++n<t.length?wEe(s,t,n,i):s}}function cwt(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 lwt(e,t,n){let i=t[n],o=cwt(e.ranges,i);return e.symbols[o]}$G.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(c(this._uniqueValueHash)?o=r=>wEe(this._uniqueValueHash,i,0,r):c(this._classBreaksHash)&&(o=r=>lwt(this._classBreaksHash,i[0],r)),c(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);c(a)&&(t[s]=a)}}}return t};var gk=$G;function uu(e,t,n){this._dataProvider=e,this._parent=n,!c(t.href)&&c(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 we({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(uu.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(c(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});uu.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 gk(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()};uu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],c(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(c(r.compressedAttributes)&&e){a=!0;let l=r.compressedAttributes.attributes;for(let u=0;u<l.length;u++)s.push(l[u])}else for(let l in r)l!=="offset"&&s.push(l);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)}};uu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(c(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(c(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};uu.prototype._loadRootNode=function(e){if(c(this._data.nodePages)){let t=0;c(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new Jw(this,t,!0)}else this._rootNode=new Jw(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};uu.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]})};uu._fetchJson=function(e){return e.fetchJson()};uu.prototype._loadNodePage=function(e){let t=this;if(!c(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=uu._fetchJson(n).then(function(o){return c(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};uu.prototype._computeExtent=function(){c(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):c(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]))};uu.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;c(o)&&!c(e?.outlineColor)&&(e=c(e)?je(e):{},e.outlineColor=G.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){c(r._i3sNode)&&r._i3sNode._loadChildren()})};uu.prototype._updateVisibility=function(){c(this._tileset)&&(this._tileset.show=this._parent.show)};uu.prototype.filterByAttributes=function(e){this._filters=c(e)?je(e,!0):[];let t=this._rootNode;return c(t)?t._filterFeatures():Promise.resolve()};var zA=uu;function ZG(e,t){this._dataProvider=e,this._resource=new we({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(ZG.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});ZG.prototype.load=async function(){return this._data=await Jh.loadJson(this._resource),this._data};ZG.prototype._getValues=function(e){let t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return c(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var yk=ZG;function bk(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(bk.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(T.defined("value",e),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}}});bk._fromData=async function(e,t,n,i){let o=new bk(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(c(r)){let s=[];for(let l=0;l<r.length;l++){let u=bk._fromData(e,t,r[l],o);s.push(u)}let a=await Promise.all(s);for(let l=0;l<a.length;l++){let u=a[l];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new we({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Jh.loadJson(o._resource),l=new zA(e,a,o);o._i3sLayers.push(l)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var xk=bk;var PEe=Zo(vEe(),1);function As(e){e=e??W.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??W.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(As.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(T.defined("value",e),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}}});As.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)c(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return de(this)};As.prototype.isDestroyed=function(){return!1};As.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};As.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};As.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};As.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)c(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function uwt(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 DEe(e,t,n){if(t.layerType==="Building"){c(n.showFeatures)||(e._showFeatures=!0),c(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),c(n.applySymbology)||(e._applySymbology=!0),c(n.calculateNormals)||(e._calculateNormals=!0);let i=uwt(e,t.id);if(c(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=xk._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(c(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new yk(e,o);await r.load(),e._attributeStatistics.push(r)}if(c(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"){!c(n.calculateNormals)&&!c(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new zA(e,t,e);e._layers.push(i),c(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}As.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await As.loadJson(n),o=new As(t);if(o._resource=n,o._data=i,c(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let l=DEe(o,i.layers[a],t);s.push(l)}await Promise.all(s)}else await DEe(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};As._fetchJson=function(e){return e.fetchJson()};As.loadJson=async function(e){let t=await As._fetchJson(e);if(c(t.error)){if(console.error("Failed to fetch I3S ",e.url),c(t.error.message)&&console.error(t.error.message),c(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};As.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};As.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 fwt=new H;function dwt(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),l=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=l.x;h<=u.x;h++)for(let p=l.y;p<=u.y;p++){let g=H.fromElements(h,p,fwt),m=g.toString();if(!o.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=y,i.push(y)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(h){let p=[];for(let g=0;g<h.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=h[g],b="Geographic";n._projection instanceof Mi&&(b="WebMercator");let x={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===fd.LERC){let A=PEe.default.decode(y._buffer);x.buffer=A.pixels[0]}else x.buffer=y._buffer;p.push(x)}return p})}async function hwt(e){let t=e._geoidTiledTerrainProvider;if(c(t))try{let n=await dwt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}As.prototype.loadGeoidData=async function(){return c(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=hwt(this),this._geoidDataPromise)};As.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];c(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};As.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};As.prototype.getAttributeValues=function(e){T.defined("name",e);for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(c(n))return n}return[]};As.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 Jh=As;var Tk={};Tk.createTilesetFromIModelId=async function(e,t){let{exports:n}=await us.getExports(e);if(n.length>0&&n.every(a=>a.status===us.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===us.ExportStatus.Complete);if(!c(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new we({url:r});return bs.fromUrl(s,t)};Tk.createTilesetForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await us.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![us.RealityDataType.Cesium3DTiles,us.RealityDataType.PNTS,us.RealityDataType.RealityMesh3DTiles,us.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await us.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};Tk.createDataSourceForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await us.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![us.RealityDataType.KML,us.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await us.getRealityDataURL(e,t,i);return n===us.RealityDataType.GeoJSON?T0.load(r):kT.load(r)};Tk.loadGeospatialFeatures=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("collectionId",t),c(n)&&(T.typeOf.number("limit",n),T.typeOf.number.lessThanOrEquals("limit",n,1e4),T.typeOf.number.greaterThanOrEquals("limit",n,1)),!c(us.defaultAccessToken)&&!c(us.defaultShareKey))throw new E("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=n??1e4,o=`${us.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new we({url:o,headers:{Authorization:us._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return T0.load(r)};var uQ=Tk;function IEe(){}Object.defineProperties(IEe.prototype,{color:{get:E.throwInstantiationError},intensity:{get:E.throwInstantiationError}});var fQ=IEe;var mwt=/\/$/,OEe=new Tt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function tv(e){e=e??W.EMPTY_OBJECT;let t=e.styleId;if(!c(t))throw new E("options.styleId is required.");let n=e.accessToken;if(!c(n))throw new E("options.accessToken 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;let i=we.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=c(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();mwt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let l;c(e.credit)?(l=e.credit,typeof l=="string"&&(l=new Tt(l))):l=OEe,this._resource=i,this._imageryProvider=new Ya({url:i,credit:l,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(tv.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}}});tv.prototype.getTileCredits=function(e,t,n){};tv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};tv.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};tv._defaultCredit=OEe;var dQ=tv;function hQ(e){}hQ.prototype.isReady=function(){return!0};hQ.prototype.shouldDiscardImage=function(e){return!1};var mQ=hQ;var pwt=new Tt("MapQuest, Open Street Map and contributors, CC-BY-SA");function JG(e){e=e??W.EMPTY_OBJECT;let t=we.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new ls({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,l=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(f>4)throw new E(`The rectangle and minimumLevel indicate that there are ${f} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let h=e.credit??pwt;typeof h=="string"&&(h=new Tt(h)),Ya.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}c(Object.create)&&(JG.prototype=Object.create(Ya.prototype),JG.prototype.constructor=JG);var Lg=JG;var _wt=new H(1,1);function pQ(e){e=e??W.EMPTY_OBJECT,this.mass=e.mass??1,this.position=d.clone(e.position??d.ZERO),this.velocity=d.clone(e.velocity??d.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=G.clone(e.startColor??G.WHITE),this.endColor=G.clone(e.endColor??G.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=H.clone(e.imageSize??_wt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(pQ.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var REe=new d;pQ.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,REe),d.add(this.position,REe,this.position),c(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 nv=pQ;function MEe(e){e=e??W.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(MEe.prototype,{complete:{get:function(){return this._complete}}});var _Q=MEe;function LEe(e){throw new E("This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}LEe.prototype.emit=function(e){E.throwInstantiationError()};var gQ=LEe;var NEe=new H(1,1);function Ak(e){e=e??W.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;c(t)||(t=new sk(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=B.clone(e.modelMatrix??B.IDENTITY),this._emitterModelMatrix=B.clone(e.emitterModelMatrix??B.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new B,this._startColor=G.clone(e.color??e.startColor??G.WHITE),this._endColor=G.clone(e.color??e.endColor??G.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=H.clone(e.imageSize??e.minimumImageSize??NEe),this._maximumImageSize=H.clone(e.imageSize??e.maximumImageSize??NEe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(Ak.prototype,{emitter:{get:function(){return this._emitter},set:function(e){T.defined("value",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){T.defined("value",e),this._matrixDirty=this._matrixDirty||!B.equals(this._modelMatrix,e),B.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){T.defined("value",e),this._matrixDirty=this._matrixDirty||!B.equals(this._emitterModelMatrix,e),B.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){T.defined("value",e),G.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){T.defined("value",e),G.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function gwt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(c(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),l=e._particles,u=e._particlePool,f=Math.max(a-l.length-u.length,0);for(let h=0;h<f;++h){let p=new nv;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function ywt(e){let t=e._particlePool.pop();return c(t)||(t=new nv),t}function bwt(e,t){e._particlePool.push(t)}function xwt(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 l=a;l<r;++l){let u=n[l];i.remove(u._billboard)}n.length=a}function Twt(e){c(e._billboard)&&(e._billboard.show=!1)}function FEe(e,t){let n=t._billboard;c(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=O.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=O.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=O.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=O.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new G(i,o,r,s),n.scale=O.lerp(t.startScale,t.endScale,t.normalizedAge)}function Awt(e,t){t.startColor=G.clone(e._startColor,t.startColor),t.endColor=G.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=O.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=O.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=O.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=O.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=O.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function Cwt(e,t){if(e._isComplete)return 0;t=O.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),c(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;c(s)&&!s._complete&&a>s.time&&(i+=O.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var e5=new d;Ak.prototype.update=function(e){if(!this.show)return;c(this._billboardCollection)||(this._billboardCollection=new Ru),this._updateParticlePool&&(gwt(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)?FEe(this,s):(Twt(s),bwt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let l=Cwt(this,t);if(l>0&&c(i)){this._matrixDirty&&(this._combinedMatrix=B.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<l;r++)s=ywt(this),this._emitter.emit(s),d.add(s.position,s.velocity,e5),B.multiplyByPoint(u,e5,e5),s.position=B.multiplyByPoint(u,s.position,s.position),d.subtract(e5,s.position,s.velocity),d.normalize(s.velocity,s.velocity),Awt(this,s),FEe(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=O.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&xwt(this)};Ak.prototype.isDestroyed=function(){return!1};Ak.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),de(this)};var yQ=Ak;function df(){E.throwInstantiationError()}df.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(df.prototype,{quadtree:{get:E.throwInstantiationError,set:E.throwInstantiationError},tilingScheme:{get:E.throwInstantiationError},errorEvent:{get:E.throwInstantiationError}});df.prototype.update=E.throwInstantiationError;df.prototype.beginUpdate=E.throwInstantiationError;df.prototype.endUpdate=E.throwInstantiationError;df.prototype.getLevelMaximumGeometricError=E.throwInstantiationError;df.prototype.loadTile=E.throwInstantiationError;df.prototype.computeTileVisibility=E.throwInstantiationError;df.prototype.showTileThisFrame=E.throwInstantiationError;df.prototype.computeDistanceToTile=E.throwInstantiationError;df.prototype.isDestroyed=E.throwInstantiationError;df.prototype.destroy=E.throwInstantiationError;var bQ=df;function xQ(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(xQ.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});xQ.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,O.PI),i=O.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=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var TQ=xQ;function Ck(){}Ck.prototype.evaluate=function(e,t){E.throwInstantiationError()};Ck.prototype.evaluateColor=function(e,t){E.throwInstantiationError()};Ck.prototype.getShaderFunction=function(e,t,n,i){E.throwInstantiationError()};Ck.prototype.getVariables=function(){E.throwInstantiationError()};var AQ=Ck;function iv(e){T.typeOf.object("terrainProviderPromise",e),this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,Swt(this,e)}Object.defineProperties(iv.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}}});iv.fromWorldTerrain=function(e){return new iv(PA(e))};iv.fromWorldBathymetry=function(e){return new iv(K3(e))};function Ewt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Swt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){Ewt(e._errorEvent,i)}}var Ek=iv;function ov(){}ov.prototype.boundingVolume=void 0;ov.prototype.boundingSphere=void 0;ov.prototype.distanceToCamera=function(e){E.throwInstantiationError()};ov.prototype.intersectPlane=function(e){E.throwInstantiationError()};ov.prototype.createDebugVolume=function(e){E.throwInstantiationError()};var CQ=ov;function Sk(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??G.YELLOW,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=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(Sk.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}}});Sk.prototype.getTileCredits=function(e,t,n){};Sk.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)};Sk.prototype.pickFeatures=function(e,t,n,i,o){};var wk=Sk;function EQ(e){E.throwInstantiationError()}EQ.prototype.isReady=E.throwInstantiationError;EQ.prototype.shouldDiscardImage=E.throwInstantiationError;var SQ=EQ;var wwt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},wQ=Object.freeze(wwt);function t5(e,t){this.show=!0,c(e)||(e=new Ke),this.rectangle=Ke.clone(e),c(t)||(t=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}t5.prototype.update=function(e){if(!this.show)return;if(!c(this.material))throw new E("this.material must be defined.");if(!c(this.rectangle))throw new E("this.rectangle must be defined.");let t=this._rs;if((!c(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:ln.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!c(this._overlayCommand)){this._material=this.material,c(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new He({sources:[this._material.shaderSource,m2]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=De.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};t5.prototype.isDestroyed=function(){return!1};t5.prototype.destroy=function(){return c(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),de(this)};var vQ=t5;function DQ(){E.throwInstantiationError()}Object.defineProperties(DQ.prototype,{globalTransform:{get:E.throwInstantiationError},shapeTransform:{get:E.throwInstantiationError},shape:{get:E.throwInstantiationError},minBounds:{get:E.throwInstantiationError},maxBounds:{get:E.throwInstantiationError},dimensions:{get:E.throwInstantiationError},paddingBefore:{get:E.throwInstantiationError},paddingAfter:{get:E.throwInstantiationError},names:{get:E.throwInstantiationError},types:{get:E.throwInstantiationError},componentTypes:{get:E.throwInstantiationError},minimumValues:{get:E.throwInstantiationError},maximumValues:{get:E.throwInstantiationError},maximumTileCount:{get:E.throwInstantiationError},availableLevels:{get:E.throwInstantiationError},keyframeCount:{get:E.throwInstantiationError},timeIntervalCollection:{get:E.throwInstantiationError}});DQ.prototype.requestData=function(e){E.throwInstantiationError()};var PQ=DQ;function HA(){E.throwInstantiationError()}Object.defineProperties(HA.prototype,{orientedBoundingBox:{get:E.throwInstantiationError},boundingSphere:{get:E.throwInstantiationError},boundTransform:{get:E.throwInstantiationError},shapeTransform:{get:E.throwInstantiationError},shaderUniforms:{get:E.throwInstantiationError},shaderDefines:{get:E.throwInstantiationError},shaderMaximumIntersectionsLength:{get:E.throwInstantiationError}});HA.prototype.update=E.throwInstantiationError;HA.prototype.computeOrientedBoundingBoxForTile=E.throwInstantiationError;HA.prototype.computeOrientedBoundingBoxForSample=E.throwInstantiationError;HA.DefaultMinBounds=E.throwInstantiationError;HA.DefaultMaxBounds=E.throwInstantiationError;var IQ=HA;var OQ=`uniform sampler2D u_depthTexture; +`;function HC(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:or.fromType(or.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??J4,this._fragmentShaderSource=e.fragmentShaderSource??$4,this._renderState=Dr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(HC.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 HC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});HC.VERTEX_FORMAT=Be.POSITION_AND_ST;HC.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;HC.prototype.isTranslucent=Dr.prototype.isTranslucent;HC.prototype.getRenderState=Dr.prototype.getRenderState;var Tce=HC;var q6t=1e5;function Z4(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._radius=l(e.radius)?e.radius:q6t,this._image=e.image,this._transform=l(e.transform)?e.transform:N.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new DN({radius:this._radius,vertexFormat:Be.ALL}),i=new Ft({geometry:n,modelMatrix:this._transform}),r=new or({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Mn({geometryInstances:i,appearance:new Er({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(Z4.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});Z4.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};Z4.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Z4.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var Ece=Z4;function gf(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??gf.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??gf.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??gf.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??gf.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??gf.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(r,o){Y6t(t,o)}),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(){X6t(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}gf.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};gf.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new gf({scene:e})),e._frameRateMonitor};Object.defineProperties(gf.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}}});gf.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};gf.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};gf.prototype.isDestroyed=function(){return!1};gf.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function Y6t(e,t){if(e._pauseCount>0)return;let n=xn();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 r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?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 X6t(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var Q4=gf;var vce=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=K6t(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??ee.default,o=new Float64Array(0);function s(g){return o.length<g&&(o=new Float64Array(g)),o}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??We.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new ef({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new ul({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new za({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let u=new h,f=0,d=0,p=0;for(let g=0;g<n.features.length;g++){let m=n.features[g],y=m.featureId,A=this._properties[y];for(let b=0;b<m.points.length;b++){let x=f++;this._points.add({featureId:y,position:$2e(m.points[b],r,u),pickObject:i?Cce(this,x,this._points,Vc,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:W2e(m.polylines[b],r,s),pickObject:i?Cce(this,x,this._polylines,xa,A):void 0})}for(let b=0;b<m.polygons.length;b++){let x=m.polygons[b],T=p++;this._polygons.add({featureId:y,positions:W2e(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?Cce(this,T,this._polygons,No,A):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,r=this._polygons,o=t.frameNumber,s=this._heightReference,a=Ss(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,o,s):i.update(t)),l(r)&&(l(a)?a.markForFrame(r,o,s):r.update(t))}destroy(){let t=Ss(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),ue(this)}isDestroyed(){return!1}};function Cce(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function K6t(e){let t=$6t(e),n=[],i=[],r=[],o=0,s=0,a=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(q2e(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(aHt(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)a+=m.polylines[A].length;o+=m.points.length,s+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function $6t(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(oHt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function q2e(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":Y2e(e.coordinates,t.points);return;case"MultiPoint":Z6t(e.coordinates,t.points);return;case"LineString":X2e(e.coordinates,t.polylines);return;case"MultiLineString":Q6t(e.coordinates,t.polylines);return;case"Polygon":K2e(e.coordinates,t.polygons);return;case"MultiPolygon":eHt(e.coordinates,t.polygons);return;case"GeometryCollection":J6t(e.geometries,t);return;default:return}}function J6t(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)q2e(e[n],t)}function Y2e(e,t){let n=Sce(e);l(n)&&t.push(n)}function Z6t(e,t){for(let n=0;n<e.length;n++)Y2e(e[n],t)}function X2e(e,t){let n=tHt(e);l(n)&&n.length>=2&&t.push(n)}function Q6t(e,t){for(let n=0;n<e.length;n++)X2e(e[n],t)}function K2e(e,t){let n=nHt(e);l(n)&&t.push(n)}function eHt(e,t){for(let n=0;n<e.length;n++)K2e(e[n],t)}function tHt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Sce(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function nHt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=iHt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new U(f[0],f[1]))}}}if(r.length<3)return;let s=ui.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function iHt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Sce(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&rHt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Sce(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function rHt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function oHt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function $2e(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var sHt=new h;function W2e(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=$2e(e[o],t,sHt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function aHt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var wce=vce;var J2e=Qo(CJ(),1);function Ice(){this._image=new Image}Ice.prototype.isReady=function(){return!0};Ice.prototype.shouldDiscardImage=function(e){return e===this._image};function GC(e){e=e??H.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 Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Ice),this._errorEvent=new be}Object.defineProperties(GC.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}}});GC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new GC(t);return n._metadata=e,n};GC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};GC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=Bg.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new wo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=cHt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){VM(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=lHt(f)),!l(d)&&(!l(p)||p)){let g=uHt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:xg({uint8Array:f,format:d,flipY:!0})})};GC.prototype.pickFeatures=function(e,t,n,i,r){};function cHt(e,t,n,i,r,o){let s=Bg.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function lHt(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 uHt(e){let t=J2e.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 r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var Pce=GC;var fHt=600;function $0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Aa.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Aa.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??fHt}Object.defineProperties($0.prototype,{});$0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let s=Aa.getDefaultCredit(),a=h.fromDegrees(D.toDegrees(t.longitude),D.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=At.localFrameToFixedFrameGenerator("north","down"),A=N.getMatrix3(y(a,ee.default),new $);return new FC({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};$0.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};$0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};$0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};$0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};$0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Aa.defaultStreetViewStaticApiKey??Aa.defaultApiKey,!l(e.key)&&!l(Aa.defaultStreetViewStaticApiKey)&&!l(Aa.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new $0({...e})};$0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var Dce=$0;var dHt=new z(1,1,1,.4),hHt=new z(0,1,0,.05),mHt=new z(0,.5,0,.2);function WC(e){e=e??H.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 Qi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??dHt,this._glowColor=e.glowColor??hHt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??mHt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(WC.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}}});WC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};WC.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"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,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};WC.prototype.getTileCredits=function(e,t,n){};WC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};WC.prototype.pickFeatures=function(e,t,n,i,r){};var Rce=WC;function pp(){}pp._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);pp._decodeTaskProcessor=new $n("decodeI3S",pp._maxDecodingConcurrency);pp._promise=void 0;async function pHt(){if(await pp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return pp._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}pp.decode=async function(e,t,n,i,r){return l(pp._promise)||(pp._promise=pHt()),pp._promise.then(function(o){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-D.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=he.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var e8=pp;function Oce(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(Oce.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Oce.prototype.load=async function(){return this._data=await gp.loadJson(this._resource),this._data};var t8=Oce;function Ay(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(Ay.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 kW(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 gHt(e){return e==="String"?1:kW(e)}async function _Ht(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}Ay.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=_Ht(this).catch(function(e){console.error(e)}),this._loadPromise)};Ay.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 r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-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}};Ay.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],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};Ay.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let s=0;s<this._header.count;++s)if(o.valueType!=="String"){let a=this._parseValue(e,o.valueType,t);this._values[r].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};Ay.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=kW(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=kW(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Ay.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=gHt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Ay.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`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 r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,s=this._storageInfo[o];if(l(s))if(s.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let a=kW(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new oe(`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 oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var n8=Ay;function i8(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(i8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});i8.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var yHt=new h,AHt=new h,bHt=new h,xHt=new h,THt=new h;function Mce(e,t,n,i){let r=h.subtract(i,n,yHt),o=h.cross(r,h.subtract(e,n,AHt),xHt),s=h.cross(r,h.subtract(t,n,bHt),THt);return h.dot(o,s)>=0}var EHt=new h,CHt=new h,vHt=new h,SHt=new h,wHt=new h,IHt=new h,PHt=new h,DHt=new h,RHt=new h,OHt=new h;i8.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(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 r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],EHt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],CHt),x=new h(u[y*3],u[y*3+1],u[y*3+2],vHt);if(!Mce(i,A,b,x)||!Mce(i,b,A,x)||!Mce(i,x,A,b))continue;let T=h.subtract(b,A,SHt),E=h.subtract(x,A,wHt),v=h.cross(T,E,IHt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,PHt),I=h.subtract(i,A,DHt),R=Math.abs(h.dot(I,S));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,I)),L=h.magnitudeSquared(h.subtract(i,b,RHt)),_=h.magnitudeSquared(h.subtract(i,x,OHt));O<L&&O<_?(a=g,c=A,s=O):L<_?(a=m,c=b,s=L):(a=y,c=x,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function Z2e(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(uT(e[i])):t.push(e[i]);return t}i8.prototype._generateGltf=function(e,t,n,i,r,o,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let S=this._layer._data.textureSetDefinitions[v];for(let I=0;I<S.formats.length;I++){let R=S.formats[I];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=Z2e(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=Z2e(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=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=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,E=T.length;for(let v=0;v<E;v++){let S=T[v];if(l(S.material)){for(;S.material>=y.length;){let R=Je(c,!0);y.push(R)}let I=y[S.material];l(S.extra)&&S.extra.isTransparent?l(I.alphaMode)||(I.alphaMode="BLEND"):I.alphaMode==="BLEND"&&(I.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var HP=i8;function Dl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,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(Dl.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}}});Dl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new fh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await gp.loadJson(this._resource);e._data=r,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 Q2e(e,t){let n=new n8(e,t);return e._fields[t.name]=n,n.load()}Dl.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],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(Q2e(this,i))}return Promise.all(t)};Dl.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 r=n[i];if(r.name===e)return Q2e(this,r)}return Promise.resolve()};Dl.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)};Dl.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};Dl.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],r=new Dl(e,i.href??i,!1);e._children.push(r),t.push(r.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};Dl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new HP(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 HP(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Dl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new t8(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Dl.prototype._clearGeometryData=function(){this._geometryData=[]};Dl.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 b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=FHt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=ee.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new wc(0,0,0),u=At.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new N(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=N.inverse(p,new N),m=N.clone(p);l(this._parent._globalTransform)&&N.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Dl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Dl.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 r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await e8.decode(r,o,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 MHt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function NHt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===r){o=!0;break}return o}async function eke(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await MHt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let s=i[o];if(!NHt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}Dl.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=eke(this,t);e.push(n)}return Promise.all(e)};fh.prototype._hookedRequestContent=fh.prototype.requestContent;fh.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 De({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(()=>{eke(e._i3sNode,n)})),e._isLoading=!1,t})}};function LHt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function UW(e,t,n,i){let r=e+t*n;return i[r]}function FHt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=UW(s,a,n.width,n.buffer),d=UW(c,a,n.width,n.buffer),p=UW(s,u,n.width,n.buffer),g=UW(c,u,n.width,n.buffer),m=LHt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(fh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var GP=Dl;function zW(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(zW.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Nce(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(uT(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function WP(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 r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,s=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=Nce(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=Nce(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=Nce(a.color,a.transparency)))}break}}return n}function BHt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let s=WP(r[o].symbol,t),a=r[o].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=WP(r.symbol,t)}return n}}function kHt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let s=r.classMaxValue??r.classMinValue,a=o.classMaxValue??o.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(WP(o.symbol,t)))}return i.symbols.push(void 0),i}}zW.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=WP(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=WP(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=BHt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=WP(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=kHt(i,n))}};function tke(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],s=e[o];return l(s)&&++n<t.length?tke(s,t,n,i):s}}function UHt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function zHt(e,t,n){let i=t[n],r=UHt(e.ranges,i);return e.symbols[r]}zW.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>tke(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>zHt(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let s=0;s<o.length;s++){let a=r(s);l(a)&&(t[s]=a)}}}return t};var r8=zW;function _f(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(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),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(_f.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}}});_f.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new r8(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()};_f.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 r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};_f.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};_f.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 GP(this,t,!0)}else this._rootNode=new GP(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};_f.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]})};_f._fetchJson=function(e){return e.fetchJson()};_f.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=_f._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};_f.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};_f.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),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Je(e):{},e.outlineColor=z.fromCartesian4(se.fromArray(r))),this._tileset=await Ko.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};_f.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};_f.prototype.filterByAttributes=function(e){this._filters=l(e)?Je(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var qC=_f;function VW(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(VW.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}}});VW.prototype.load=async function(){return this._data=await gp.loadJson(this._resource),this._data};VW.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 o8=VW;function s8(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(s8.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}}});s8._fromData=async function(e,t,n,i){let r=new s8(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let s=[];for(let c=0;c<o.length;c++){let u=s8._fromData(e,t,o[c],r);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),s=new De({url:o});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),r._resource=s;let a=await gp.loadJson(r._resource),c=new qC(e,a,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var a8=s8;var rke=Qo(nke(),1);function fa(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??H.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(fa.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}}});fa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};fa.prototype.isDestroyed=function(){return!1};fa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};fa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};fa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};fa.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 VHt(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 ike(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=VHt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=a8._fromData(e,i,t.sublayers[s],e);r.push(a)}let o=await Promise.all(r);for(let s=0;s<o.length;s++){let a=o[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new o8(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new qC(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.`)}fa.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await fa.loadJson(n),r=new fa(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=ike(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await ike(r,i,t);r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};fa._fetchJson=function(e){return e.fetchJson()};fa.loadJson=async function(e){let t=await fa._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 oe(t.error)}return t};fa.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 oe(`Failed to load binary: ${e.url}`);return t};fa.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={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 r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var jHt=new U;function HHt(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=U.fromElements(d,p,jHt),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof gi&&(A="WebMercator");let b={projectionType:A,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===Md.LERC){let x=rke.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function GHt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await HHt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}fa.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=GHt(this),this._geoidDataPromise)};fa.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};fa.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};fa.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[]};fa.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 gp=fa;var c8={};c8.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ia.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ia.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===ia.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let s=o.toString(),a=new De({url:s});return Ko.fromUrl(a,n)};c8.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await ia.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ia.RealityDataType.Cesium3DTiles,ia.RealityDataType.PNTS,ia.RealityDataType.RealityMesh3DTiles,ia.RealityDataType.Terrain3DTiles,ia.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await ia.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Ko.fromUrl(s,a)};c8.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ia.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ia.RealityDataType.KML,ia.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await ia.getRealityDataURL(e,t,i);return n===ia.RealityDataType.GeoJSON?Cb.load(o):aC.load(o)};c8.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${ia.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:ia._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return Cb.load(o)};var Lce=c8;function oke(){}Object.defineProperties(oke.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var Fce=oke;var WHt=/\/$/,ske=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function qP(e){e=e??H.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=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();WHt.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 It(c))):c=ske,this._resource=i,this._imageryProvider=new Ds({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(qP.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}}});qP.prototype.getTileCredits=function(e,t,n){};qP.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};qP.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};qP._defaultCredit=ske;var Bce=qP;var qHt=0,YHt=14,XHt=-1e3,KHt=1e4,$Ht=2*Math.PI*ee.WGS84.maximumRadius,JHt=256,ZHt=new ie,QHt=new ie,kce=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??qHt,this._maxZoom=n.maxZoom??YHt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=eGt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Ko.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,ue(this)}};function eGt(e,t){let n=new Do,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=nGt(n,i,t.minZoom),o={boundingVolume:{region:lke(i)},geometricError:cke(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=ake(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function ake(e,t,n,i,r,o,s){if(!iGt(e,i,o,s,n,ZHt,QHt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:lke(a)},geometricError:i<r?cke(i):0,refine:"REPLACE",content:{uri:tGt(t,i,o,s)}};if(i>=r)return c;let u=i+1,f=[];for(let d=s*2;d<=s*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=ake(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function tGt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return vd(o)}function cke(e){return $Ht/((1<<e)*JHt)}function lke(e){return[e.west,e.south,e.east,e.north,XHt,KHt]}function nGt(e,t,n){let i=(1<<n)-1,r=he.fromRadians(t.west,t.north),o=he.fromRadians(t.east,t.south),s=e.positionToTileXY(r,n),a=e.positionToTileXY(o,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:D.clamp(Math.min(s.x,a.x),0,i),maxX:D.clamp(Math.max(s.x,a.x),0,i),minY:D.clamp(Math.min(s.y,a.y),0,i),maxY:D.clamp(Math.max(s.y,a.y),0,i)}}function iGt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var l8=kce;var HW=class extends l8{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=zi.Z,t._modelForwardAxis=zi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=K4(o),a=uke(r.getUrlComponent(!0)),c=z4(s,a,{featureIdProperty:t});if(!l(c)){if(!rGt(s))return new p0(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return $A.fromGltf(n,i,r,c)}}}};function uke(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(_t("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function rGt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}HW._parseTileCoordinates=uke;var Uce=HW;function zce(e){}zce.prototype.isReady=function(){return!0};zce.prototype.shouldDiscardImage=function(e){return!1};var Vce=zce;var oGt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function GW(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Do({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(a),o),u=n.positionToTileXY(ie.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??oGt;typeof d=="string"&&(d=new It(d)),Ds.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(GW.prototype=Object.create(Ds.prototype),GW.prototype.constructor=GW);var by=GW;function fke(){pe.throwInstantiationError()}Object.defineProperties(fke.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var jce=fke;function WW(){pe.throwInstantiationError()}Object.defineProperties(WW.prototype,{});WW.fromUrl=function(e){pe.throwInstantiationError()};WW.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var Hce=WW;var sGt=new U(1,1);function Gce(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??sGt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Gce.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var dke=new h;Gce.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,dke),h.add(this.position,dke,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 YP=Gce;function hke(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(hke.prototype,{complete:{get:function(){return this._complete}}});var Wce=hke;function mke(e){}mke.prototype.emit=function(e){pe.throwInstantiationError()};var qce=mke;var pke=new U(1,1);function u8(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new G4(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._emitterModelMatrix=N.clone(e.emitterModelMatrix??N.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new N,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??pke),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??pke),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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(u8.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||!N.equals(this._modelMatrix,e),N.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._emitterModelMatrix,e),N.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.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 aGt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new YP;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function cGt(e){let t=e._particlePool.pop();return l(t)||(t=new YP),t}function lGt(e,t){e._particlePool.push(t)}function uGt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function fGt(e){l(e._billboard)&&(e._billboard.show=!1)}function gke(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=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function dGt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function hGt(e,t){if(e._isComplete)return 0;t=D.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 r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=D.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var qW=new h;u8.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new $f),this._updateParticlePool&&(aGt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?gke(this,s):(fGt(s),lGt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=hGt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=N.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=cGt(this),this._emitter.emit(s),h.add(s.position,s.velocity,qW),N.multiplyByPoint(u,qW,qW),s.position=N.multiplyByPoint(u,s.position,s.position),h.subtract(qW,s.position,s.velocity),h.normalize(s.velocity,s.velocity),dGt(this,s),gke(this,s)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&uGt(this)};u8.prototype.isDestroyed=function(){return!1};u8.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Yce=u8;var Xce=class{constructor(){ut(this,"quadtree");ut(this,"tilingScheme");ut(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},Kce=Xce;function $ce(e){e=e??1,this._radius=e??1}Object.defineProperties($ce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});$ce.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Jce=$ce;function f8(){}f8.prototype.evaluate=function(e,t){pe.throwInstantiationError()};f8.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};f8.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};f8.prototype.getVariables=function(){pe.throwInstantiationError()};var Zce=f8;function XP(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,pGt(this,e)}Object.defineProperties(XP.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}}});XP.fromWorldTerrain=function(e){return new XP(Gx(e))};XP.fromWorldBathymetry=function(e){return new XP(kM(e))};function mGt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function pGt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){mGt(e._errorEvent,i)}}var d8=XP;function KP(){}KP.prototype.boundingVolume=void 0;KP.prototype.boundingSphere=void 0;KP.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};KP.prototype.intersectPlane=function(e){pe.throwInstantiationError()};KP.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var Qce=KP;function h8(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=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(h8.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}}});h8.prototype.getTileCredits=function(e,t,n){};h8.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};h8.prototype.pickFeatures=function(e,t,n,i,r){};var m8=h8;function ele(e){pe.throwInstantiationError()}ele.prototype.isReady=pe.throwInstantiationError;ele.prototype.shouldDiscardImage=pe.throwInstantiationError;var tle=ele;var _ke={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(_ke);var nle=_ke;function YW(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=or.fromType(or.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}YW.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ge.fromCache({blending:tn.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 r=new Ye({sources:[this._material.shaderSource,U4]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};YW.prototype.isDestroyed=function(){return!1};YW.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var ile=YW;var rle=class{constructor(){ut(this,"globalTransform");ut(this,"shapeTransform");ut(this,"shape");ut(this,"minBounds");ut(this,"maxBounds");ut(this,"dimensions");ut(this,"paddingBefore");ut(this,"paddingAfter");ut(this,"names");ut(this,"types");ut(this,"componentTypes");ut(this,"minimumValues");ut(this,"maximumValues");ut(this,"maximumTileCount");ut(this,"availableLevels");ut(this,"keyframeCount");ut(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},ole=rle;function xy(){pe.throwInstantiationError()}Object.defineProperties(xy.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}});xy.prototype.update=pe.throwInstantiationError;xy.prototype.updateViewTransforms=pe.throwInstantiationError;xy.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;xy.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;xy.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;xy.DefaultMinBounds=pe.throwInstantiationError;xy.DefaultMaxBounds=pe.throwInstantiationError;var sle=xy;var ale=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -10892,49 +12729,42 @@ 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); } -`;function vwt(e){e=e??W.EMPTY_OBJECT;let t=c(e.typedArray),n=c(e.url);if(t===n)throw new E("exactly one of options.typedArray, options.url must be defined");if(t&&(!c(e.width)||!c(e.height)))throw new E("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ke.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let i=e.url;typeof i=="string"&&(i=we.createIfNeeded(i)),this.resource=i;let r=e.repeat??!0?gn.REPEAT:gn.CLAMP_TO_EDGE;this.sampler=new Qt({wrapS:r,wrapT:r,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var RQ=vwt;var Dwt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},MQ=Object.freeze(Dwt);var Pwt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},LQ=Object.freeze(Pwt);function Iwt(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: ${ep(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 NQ=Iwt;globalThis.CESIUM_VERSION="1.129";var vk;typeof ko<"u"&&(vk=ko);(function(){/*! +`;var cle=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},lle=cle;var yke=new h,gGt=new sn(h.UNIT_X,0),_Gt=new pn,yGt=new U(1,1,1);function _p(e,t,n,i=yGt){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,yke);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,yke),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,gGt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,_Gt);return pi.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var Ake={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(Ake);var ec=Ake;function AGt(e){if(e===ec.LEFT)return un.LEFT_DOWN;if(e===ec.MIDDLE)return un.MIDDLE_DOWN;if(e===ec.RIGHT)return un.RIGHT_DOWN}function bGt(e){if(e===ec.LEFT)return un.LEFT_UP;if(e===ec.MIDDLE)return un.MIDDLE_UP;if(e===ec.RIGHT)return un.RIGHT_UP}var ule=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=AGt(s.button),c=bGt(s.button);l(a)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},a,s.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,s.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(s.modifier)}for(let s of r)t.setInputAction((...a)=>{o.isDragging&&l(i.change)&&i.change(...a)},un.MOUSE_MOVE,s);return o}},yp=ule;var fle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=_p,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ra(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let E=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=E,this._panVelocity.y*=E,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(s)<=D.EPSILON3&&Math.abs(a)<=D.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);s=D.clamp(s,-T,T),this._panVelocity.x=s/n,s*=this.panSpeed*x.x,a=D.clamp(a,-T,T),this._panVelocity.y=a/n,a*=this.panSpeed*x.y,i.move(p,s),i.move(g,a),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},p8=fle;var dle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=_p,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ra(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let S=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=S,this._panVelocity.y*=S,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:u}=a;if(n===0||c===0||u===0||Math.abs(i)<=D.EPSILON3&&Math.abs(r)<=D.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=s.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));D.lessThan(y,1,D.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,E=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),v=this.maximumMovementRatio*Math.max(c,u);i=D.clamp(i,-v,v),this._panVelocity.x=i/n,i*=this.panSpeed*E.x,r=D.clamp(r,-v,v),this._panVelocity.y=r/n,r*=this.panSpeed*E.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},g8=dle;var hle=class{constructor(){this._elevatorController=new p8,this._mapController=new g8,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=D.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},mle=hle;var ple=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT,modifier:Jr.CTRL}),Object.freeze({button:ec.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.pickWorldPosition=_p,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=D.PI,this.minimumTiltVelocity=D.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=D.TWO_PI,this.minimumOrbitVelocity=D.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Le,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new N,this._orbitTargetEast=new h,this._orbitQuaternion=new Le,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ra(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,s=ee.default){let a=At.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=N.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=D.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Le.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),E=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let v=h.add(n,E,this._orbitOrigin);t.lookAtWorldPosition(v,s)}tilt(t,n,i,r,o,s=ee.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let a=h.angleBetween(t.direction,i);(a<D.PI_OVER_TWO&&r>0||a>D.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(a)));let c=a+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;D.smoothDamp(a,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-a,p=$.fromQuaternion(Le.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,s)}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=r/2,a.y=o/2);let c=this.pickWorldPosition(t,a,this._target),u=l(c);this._hasTarget=u,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(s,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*D.TWO_PI,this.orbit(a,s,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*D.PI,this.tilt(a,s,f,d,n,c)}}this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}},gle=ple;var _le=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.MIDDLE})]}static _getDefaultScrollInputs(){return[un.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.zoomSensitivity=.2,this.pickWorldPosition=_p,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=D.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ra(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),un.MOUSE_MOVE),this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:s}=r;if(i===0||o===0||s===0){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=D.EPSILON3&&a>=-D.EPSILON3&&this.zoomVelocity<=D.EPSILON3){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=D.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=s/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=D.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=a*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=D.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},yle=_le;var bke={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(bke);var Ale=bke;var xke={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(xke);var ble=xke;function xGt(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,r);o.result=s}catch(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${Up(s)} + with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}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 xle=xGt;globalThis.CESIUM_VERSION="1.145.0";var _8;typeof ko<"u"&&(_8=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 l(_,w){return _===null||typeof _ in y?_===w:!1}function u(_,w){var D;return function(){D||(D=m.a.setTimeout(function(){D=e,_()},w))}}function f(_,w){var D;return function(){clearTimeout(D),D=m.a.setTimeout(_,w)}}function h(_,w){w&&w!=="change"?w==="beforeChange"?this.pc(_):this.gb(_,w):this.qc(_)}function p(_,w){w!==null&&w.s&&w.s()}function g(_,w){var D=this.qd,I=D[S];I.ra||(this.Qb&&this.mb[w]?(D.uc(w,_,this.mb[w]),this.mb[w]=null,--this.Qb):I.I[w]||D.uc(w,_,I.J?{da:_}:D.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,w){for(var D=_.split("."),I=m,N=0;N<D.length-1;N++)I=I[D[N]];I[D[D.length-1]]=w},m.L=function(_,w,D){_[w]=D},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(K,Z){for(var ee in K)N.call(K,ee)&&Z(ee,K[ee])}function w(K,Z){if(Z)for(var ee in Z)N.call(Z,ee)&&(K[ee]=Z[ee]);return K}function D(K,Z){return K.__proto__=Z,K}function I(K,Z,ee,me){var Te=K[Z].match(Y)||[];m.a.D(ee.match(Y),function(ue){m.a.Na(Te,ue,me)}),K[Z]=Te.join(" ")}var N=Object.prototype.hasOwnProperty,k={__proto__:[]}instanceof Array,z=typeof Symbol=="function",V={},j={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(K,Z){if(Z.length)for(var ee=0,me=Z.length;ee<me;ee++)j[Z[ee]]=K});var U={propertychange:!0},q=n&&function(){for(var K=3,Z=n.createElement("div"),ee=Z.getElementsByTagName("i");Z.innerHTML="<!--[if gt IE "+ ++K+"]><i></i><![endif]-->",ee[0];);return 4<K?K:e}(),Y=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(K,Z,ee){for(var me=0,Te=K.length;me<Te;me++)Z.call(ee,K[me],me,K)},A:typeof Array.prototype.indexOf=="function"?function(K,Z){return Array.prototype.indexOf.call(K,Z)}:function(K,Z){for(var ee=0,me=K.length;ee<me;ee++)if(K[ee]===Z)return ee;return-1},Lb:function(K,Z,ee){for(var me=0,Te=K.length;me<Te;me++)if(Z.call(ee,K[me],me,K))return K[me];return e},Pa:function(K,Z){var ee=m.a.A(K,Z);0<ee?K.splice(ee,1):ee===0&&K.shift()},wc:function(K){var Z=[];return K&&m.a.D(K,function(ee){0>m.a.A(Z,ee)&&Z.push(ee)}),Z},Mb:function(K,Z,ee){var me=[];if(K)for(var Te=0,ue=K.length;Te<ue;Te++)me.push(Z.call(ee,K[Te],Te));return me},jb:function(K,Z,ee){var me=[];if(K)for(var Te=0,ue=K.length;Te<ue;Te++)Z.call(ee,K[Te],Te)&&me.push(K[Te]);return me},Nb:function(K,Z){if(Z instanceof Array)K.push.apply(K,Z);else for(var ee=0,me=Z.length;ee<me;ee++)K.push(Z[ee]);return K},Na:function(K,Z,ee){var me=m.a.A(m.a.bc(K),Z);0>me?ee&&K.push(Z):ee||K.splice(me,1)},Ba:k,extend:w,setPrototypeOf:D,Ab:k?D:w,P:_,Ga:function(K,Z,ee){if(!K)return K;var me={},Te;for(Te in K)N.call(K,Te)&&(me[Te]=Z.call(ee,K[Te],Te,K));return me},Tb:function(K){for(;K.firstChild;)m.removeNode(K.firstChild)},Yb:function(K){K=m.a.la(K);for(var Z=(K[0]&&K[0].ownerDocument||n).createElement("div"),ee=0,me=K.length;ee<me;ee++)Z.appendChild(m.oa(K[ee]));return Z},Ca:function(K,Z){for(var ee=0,me=K.length,Te=[];ee<me;ee++){var ue=K[ee].cloneNode(!0);Te.push(Z?m.oa(ue):ue)}return Te},va:function(K,Z){if(m.a.Tb(K),Z)for(var ee=0,me=Z.length;ee<me;ee++)K.appendChild(Z[ee])},Xc:function(K,Z){var ee=K.nodeType?[K]:K;if(0<ee.length){for(var me=ee[0],Te=me.parentNode,ue=0,ye=Z.length;ue<ye;ue++)Te.insertBefore(Z[ue],me);for(ue=0,ye=ee.length;ue<ye;ue++)m.removeNode(ee[ue])}},Ua:function(K,Z){if(K.length){for(Z=Z.nodeType===8&&Z.parentNode||Z;K.length&&K[0].parentNode!==Z;)K.splice(0,1);for(;1<K.length&&K[K.length-1].parentNode!==Z;)K.length--;if(1<K.length){var ee=K[0],me=K[K.length-1];for(K.length=0;ee!==me;)K.push(ee),ee=ee.nextSibling;K.push(me)}}return K},Zc:function(K,Z){7>q?K.setAttribute("selected",Z):K.selected=Z},Db:function(K){return K===null||K===e?"":K.trim?K.trim():K.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(K,Z){return K=K||"",Z.length>K.length?!1:K.substring(0,Z.length)===Z},vd:function(K,Z){if(K===Z)return!0;if(K.nodeType===11)return!1;if(Z.contains)return Z.contains(K.nodeType!==1?K.parentNode:K);if(Z.compareDocumentPosition)return(Z.compareDocumentPosition(K)&16)==16;for(;K&&K!=Z;)K=K.parentNode;return!!K},Sb:function(K){return m.a.vd(K,K.ownerDocument.documentElement)},kd:function(K){return!!m.a.Lb(K,m.a.Sb)},R:function(K){return K&&K.tagName&&K.tagName.toLowerCase()},Ac:function(K){return m.onError?function(){try{return K.apply(this,arguments)}catch(Z){throw m.onError&&m.onError(Z),Z}}:K},setTimeout:function(K,Z){return setTimeout(m.a.Ac(K),Z)},Gc:function(K){setTimeout(function(){throw m.onError&&m.onError(K),K},0)},B:function(K,Z,ee){var me=m.a.Ac(ee);if(ee=U[Z],m.options.useOnlyNativeEvents||ee||!o)if(ee||typeof K.addEventListener!="function")if(typeof K.attachEvent<"u"){var Te=function(ye){me.call(K,ye)},ue="on"+Z;K.attachEvent(ue,Te),m.a.K.za(K,function(){K.detachEvent(ue,Te)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else K.addEventListener(Z,me,!1);else te||(te=typeof o(K).on=="function"?"on":"bind"),o(K)[te](Z,me)},Fb:function(K,Z){if(!K||!K.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(m.a.R(K)==="input"&&K.type&&Z.toLowerCase()=="click"?(ee=K.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,m.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof K.dispatchEvent=="function")ee=n.createEvent(j[Z]||"HTMLEvents"),ee.initEvent(Z,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,K),K.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&K.click)K.click();else if(typeof K.fireEvent<"u")K.fireEvent("on"+Z);else throw Error("Browser doesn't support triggering events");else o(K).trigger(Z)},f:function(K){return m.O(K)?K():K},bc:function(K){return m.O(K)?K.v():K},Eb:function(K,Z,ee){var me;Z&&(typeof K.classList=="object"?(me=K.classList[ee?"add":"remove"],m.a.D(Z.match(Y),function(Te){me.call(K.classList,Te)})):typeof K.className.baseVal=="string"?I(K.className,"baseVal",Z,ee):I(K,"className",Z,ee))},Bb:function(K,Z){var ee=m.a.f(Z);(ee===null||ee===e)&&(ee="");var me=m.h.firstChild(K);!me||me.nodeType!=3||m.h.nextSibling(me)?m.h.va(K,[K.ownerDocument.createTextNode(ee)]):me.data=ee,m.a.Ad(K)},Yc:function(K,Z){if(K.name=Z,7>=q)try{var ee=K.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});K.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(K){9<=q&&(K=K.nodeType==1?K:K.parentNode,K.style&&(K.style.zoom=K.style.zoom))},wd:function(K){if(q){var Z=K.style.width;K.style.width=0,K.style.width=Z}},Pd:function(K,Z){K=m.a.f(K),Z=m.a.f(Z);for(var ee=[],me=K;me<=Z;me++)ee.push(me);return ee},la:function(K){for(var Z=[],ee=0,me=K.length;ee<me;ee++)Z.push(K[ee]);return Z},Da:function(K){return z?Symbol(K):K},Zd:q===6,$d:q===7,W:q,Lc:function(K,Z){for(var ee=m.a.la(K.getElementsByTagName("input")).concat(m.a.la(K.getElementsByTagName("textarea"))),me=typeof Z=="string"?function(ye){return ye.name===Z}:function(ye){return Z.test(ye.name)},Te=[],ue=ee.length-1;0<=ue;ue--)me(ee[ue])&&Te.push(ee[ue]);return Te},Nd:function(K){return typeof K=="string"&&(K=m.a.Db(K))?r&&r.parse?r.parse(K):new Function("return "+K)():null},hc:function(K,Z,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(m.a.f(K),Z,ee)},Od:function(K,Z,ee){ee=ee||{};var me=ee.params||{},Te=ee.includeFields||this.Jc,ue=K;if(typeof K=="object"&&m.a.R(K)==="form")for(var ue=K.action,ye=Te.length-1;0<=ye;ye--)for(var Ae=m.a.Lc(K,Te[ye]),Pe=Ae.length-1;0<=Pe;Pe--)me[Ae[Pe].name]=Ae[Pe].value;Z=m.a.f(Z);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=ue,Ee.method="post";for(var ze in Z)K=n.createElement("input"),K.type="hidden",K.name=ze,K.value=m.a.hc(m.a.f(Z[ze])),Ee.appendChild(K);_(me,function(qe,it){var Dt=n.createElement("input");Dt.type="hidden",Dt.name=qe,Dt.value=it,Ee.appendChild(Dt)}),n.body.appendChild(Ee),ee.submitter?ee.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var w=this;if(arguments.length===1)return function(){return w.apply(_,arguments)};var D=Array.prototype.slice.call(arguments,1);return function(){var I=D.slice(0);return I.push.apply(I,arguments),w.apply(_,I)}}),m.a.g=new function(){var _=0,w="__ko__"+new Date().getTime(),D={},I,N;return m.a.W?(I=function(k,z){var V=k[w];if(!V||V==="null"||!D[V]){if(!z)return e;V=k[w]="ko"+_++,D[V]={}}return D[V]},N=function(k){var z=k[w];return z?(delete D[z],k[w]=null,!0):!1}):(I=function(k,z){var V=k[w];return!V&&z&&(V=k[w]={}),V},N=function(k){return k[w]?(delete k[w],!0):!1}),{get:function(k,z){var V=I(k,!1);return V&&V[z]},set:function(k,z,V){(k=I(k,V!==e))&&(k[z]=V)},Ub:function(k,z,V){return k=I(k,!0),k[z]||(k[z]=V)},clear:N,Z:function(){return _+++w}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(z,V){var j=m.a.g.get(z,I);return j===e&&V&&(j=[],m.a.g.set(z,I,j)),j}function w(z){var V=_(z,!1);if(V)for(var V=V.slice(0),j=0;j<V.length;j++)V[j](z);m.a.g.clear(z),m.a.K.cleanExternalData(z),k[z.nodeType]&&D(z.childNodes,!0)}function D(z,V){for(var j=[],U,q=0;q<z.length;q++)if((!V||z[q].nodeType===8)&&(w(j[j.length]=U=z[q]),z[q]!==U))for(;q--&&m.a.A(j,z[q])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},k={1:!0,9:!0};return{za:function(z,V){if(typeof V!="function")throw Error("Callback must be a function");_(z,!0).push(V)},yb:function(z,V){var j=_(z,!1);j&&(m.a.Pa(j,V),j.length==0&&m.a.g.set(z,I,e))},oa:function(z){return m.u.G(function(){N[z.nodeType]&&(w(z),k[z.nodeType]&&D(z.getElementsByTagName("*")))}),z},removeNode:function(z){m.oa(z),z.parentNode&&z.parentNode.removeChild(z)},cleanExternalData:function(z){o&&typeof o.cleanData=="function"&&o.cleanData([z])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var _=[0,"",""],w=[1,"<table>","</table>"],D=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:w,tbody:w,tfoot:w,tr:[2,"<table><tbody>","</tbody></table>"],td:D,th:D,option:I,optgroup:I},k=8>=m.a.W;m.a.ua=function(z,V){var j;if(o){if(o.parseHTML)j=o.parseHTML(z,V)||[];else if((j=o.clean([z],V))&&j[0]){for(var U=j[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(j=V)||(j=n);var U=j.parentWindow||j.defaultView||t,q=m.a.Db(z).toLowerCase(),Y=j.createElement("div"),te;for(te=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[q[1]]||_,q=te[0],te="ignored<div>"+te[1]+z+te[2]+"</div>",typeof U.innerShiv=="function"?Y.appendChild(U.innerShiv(te)):(k&&j.body.appendChild(Y),Y.innerHTML=te,k&&Y.parentNode.removeChild(Y));q--;)Y=Y.lastChild;j=m.a.la(Y.lastChild.childNodes)}return j},m.a.Md=function(z,V){var j=m.a.ua(z,V);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(z,V){if(m.a.Tb(z),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(z).html(V);else for(var j=m.a.ua(V,z.ownerDocument),U=0;U<j.length;U++)z.appendChild(j[U])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(D,I){if(D){if(D.nodeType==8){var N=m.aa.Uc(D.nodeValue);N!=null&&I.push({ud:D,Kd:N})}else if(D.nodeType==1)for(var N=0,k=D.childNodes,z=k.length;N<z;N++)_(k[N],I)}}var w={};return{Xb:function(D){if(typeof D!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return w[I]=D,"<!--[ko_memo:"+I+"]-->"},bd:function(D,I){var N=w[D];if(N===e)throw Error("Couldn't find any memo with ID "+D+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete w[D]}},cd:function(D,I){var N=[];_(D,N);for(var k=0,z=N.length;k<z;k++){var V=N[k].ud,j=[V];I&&m.a.Nb(j,I),m.aa.bd(N[k].Kd,j),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(D){return(D=D.match(/^\[ko_memo\:(.*?)\]$/))?D[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function _(){if(N){for(var V=N,j=0,U;z<N;)if(U=I[z++]){if(z>V){if(5e3<=++j){z=N,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}V=N}try{U()}catch(q){m.a.Gc(q)}}}}function w(){_(),z=N=I.length=0}var D,I=[],N=0,k=1,z=0;return t.MutationObserver?D=function(V){var j=n.createElement("div");return new MutationObserver(V).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}}(w):D=n&&"onreadystatechange"in n.createElement("script")?function(V){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,V()},n.documentElement.appendChild(j)}:function(V){setTimeout(V,0)},{scheduler:D,zb:function(V){return N||m.na.scheduler(w),I[N++]=V,k++},cancel:function(V){V=V-(k-N),V>=z&&V<N&&(I[V]=null)},resetForTesting:function(){var V=N-z;return z=N=I.length=0,V},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,w){_.throttleEvaluation=w;var D=null;return m.$({read:_,write:function(I){clearTimeout(D),D=m.a.setTimeout(function(){_(I)},w)}})},rateLimit:function(_,w){var D,I,N;typeof w=="number"?D=w:(D=w.timeout,I=w.method),_.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(k){return N(k,D,w)})},deferred:function(_,w){if(w!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(D){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(D);try{N=!0,_.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(_,w){_.equalityComparer=w=="always"?null:l}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,w,D){this.da=_,this.lc=w,this.mc=D,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,w,D){var I=this;D=D||"change";var N=new m.ic(I,w?_.bind(w):_,function(){m.a.Pa(I.U[D],N),I.hb&&I.hb(D)});return I.Qa&&I.Qa(D),I.U[D]||(I.U[D]=[]),I.U[D].push(N),N},notifySubscribers:function(_,w){if(w=w||"change",w==="change"&&this.Gb(),this.Wa(w)){var D=w==="change"&&this.ed||this.U[w].slice(0);try{m.u.xc();for(var I=0,N;N=D[I];++I)N.Ib||N.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var w=this,D=m.O(w),I,N,k,z,V;w.gb||(w.gb=w.notifySubscribers,w.notifySubscribers=h);var j=_(function(){w.Ja=!1,D&&z===w&&(z=w.nc?w.nc():w());var U=N||V&&w.sb(k,z);V=N=I=!1,U&&w.gb(k=z)});w.qc=function(U,q){q&&w.Ja||(V=!q),w.ed=w.U.change.slice(0),w.Ja=I=!0,z=U,j()},w.pc=function(U){I||(k=U,w.gb(U,"beforeChange"))},w.rc=function(){V=!0},w.gd=function(){w.sb(k,w.v(!0))&&(N=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var w=0;return m.a.P(this.U,function(D,I){D!=="dirty"&&(w+=I.length)}),w},sb:function(_,w){return!this.equalityComparer||!this.equalityComparer(_,w)},toString:function(){return"[object Object]"},extend:function(_){var w=this;return _&&m.a.P(_,function(D,I){var N=m.Ta[D];typeof N=="function"&&(w=N(w,I)||w)}),w}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(k){D.push(I),I=k}function w(){I=D.pop()}var D=[],I,N=0;return{xc:_,end:w,cc:function(k){if(I){if(!m.Qc(k))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,k,k.fd||(k.fd=++N))}},G:function(k,z,V){try{return _(),k.apply(z,V||[])}finally{w()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var x=m.a.Da("_latestValue");m.ta=function(_){function w(){return 0<arguments.length?(w.sb(w[x],arguments[0])&&(w.ya(),w[x]=arguments[0],w.xa()),this):(m.u.cc(w),w[x])}return w[x]=_,m.a.Ba||m.a.extend(w,m.T.fn),m.T.fn.qb(w),m.a.Ab(w,A),m.options.deferUpdates&&m.Ta.deferred(w,!0),w};var A={equalityComparer:l,v:function(){return this[x]},xa:function(){this.notifySubscribers(this[x],"spectate"),this.notifySubscribers(this[x])},ya:function(){this.notifySubscribers(this[x],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(A,m.T.fn);var C=m.ta.Ma="__ko_proto__";A[C]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[C])&&_!==A[C]&&_!==m.o.fn[C])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[C]===A[C]||_[C]===m.o.fn[C]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",A),m.L(A,"peek",A.v),m.L(A,"valueHasMutated",A.xa),m.L(A,"valueWillMutate",A.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var w=this.v(),D=[],I=typeof _!="function"||m.O(_)?function(z){return z===_}:_,N=0;N<w.length;N++){var k=w[N];if(I(k)){if(D.length===0&&this.ya(),w[N]!==k)throw Error("Array modified during remove; cannot remove item");D.push(k),w.splice(N,1),N--}}return D.length&&this.xa(),D},removeAll:function(_){if(_===e){var w=this.v(),D=w.slice(0);return this.ya(),w.splice(0,w.length),this.xa(),D}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var w=this.v(),D=typeof _!="function"||m.O(_)?function(k){return k===_}:_;this.ya();for(var I=w.length-1;0<=I;I--){var N=w[I];D(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(w){return 0<=m.a.A(_,w)}):[]},indexOf:function(_){var w=this();return m.a.A(w,_)},replace:function(_,w){var D=this.indexOf(_);0<=D&&(this.ya(),this.v()[D]=w,this.xa())},sorted:function(_){var w=this().slice(0);return _?w.sort(_):w.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var w=this.v();this.ya(),this.zc(w,_,arguments);var D=w[_].apply(w,arguments);return this.xa(),D===w?this:D}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var w=this();return w[_].apply(w,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,w){function D(){function Y(){if(V){var te=[].concat(_.v()||[]),K;_.Wa("arrayChange")&&((!N||1<V)&&(N=m.a.Pb(j,te,_.Ob)),K=N),j=te,N=null,V=0,K&&K.length&&_.notifySubscribers(K,"arrayChange")}}I?Y():(I=!0,z=_.subscribe(function(){++V},null,"spectate"),j=[].concat(_.v()||[]),N=null,k=_.subscribe(Y))}if(_.Ob={},w&&typeof w=="object"&&m.a.extend(_.Ob,w),_.Ob.sparse=!0,!_.zc){var I=!1,N=null,k,z,V=0,j,U=_.Qa,q=_.hb;_.Qa=function(Y){U&&U.call(_,Y),Y==="arrayChange"&&D()},_.hb=function(Y){q&&q.call(_,Y),Y!=="arrayChange"||_.Wa("arrayChange")||(k&&k.s(),z&&z.s(),z=k=null,I=!1,j=e)},_.zc=function(Y,te,K){function Z(Ee,ze,qe){return ee[ee.length]={status:Ee,value:ze,index:qe}}if(I&&!V){var ee=[],me=Y.length,Te=K.length,ue=0;switch(te){case"push":ue=me;case"unshift":for(te=0;te<Te;te++)Z("added",K[te],ue+te);break;case"pop":ue=me-1;case"shift":me&&Z("deleted",Y[ue],ue);break;case"splice":te=Math.min(Math.max(0,0>K[0]?me+K[0]:K[0]),me);for(var me=Te===1?me:Math.min(te+(K[1]||0),me),Te=te+Te-2,ue=Math.max(me,Te),ye=[],Ae=[],Pe=2;te<ue;++te,++Pe)te<me&&Ae.push(Z("deleted",Y[te],te)),te<Te&&ye.push(Z("added",K[Pe],te));m.a.Kc(Ae,ye);break;default:return}N=ee}}}};var S=m.a.Da("_state");m.o=m.$=function(_,w,D){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(k.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 k.ra||m.u.cc(I),(k.ka||k.J&&I.Xa())&&I.ha(),k.X}if(typeof _=="object"?D=_:(D=D||{},_&&(D.read=_)),typeof D.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=D.write,k={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:D.read,nb:w||D.owner,l:D.disposeWhenNodeIsRemoved||D.l||null,Sa:D.disposeWhen||D.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=k,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),D.pure?(k.wb=!0,k.J=!0,m.a.extend(I,P)):D.deferEvaluation&&m.a.extend(I,M),m.options.deferUpdates&&m.Ta.deferred(I,!0),k.l&&(k.jc=!0,k.l.nodeType||(k.l=null)),k.J||D.deferEvaluation||I.ha(),k.l&&I.ja()&&m.a.K.za(k.l,k.Rb=function(){I.s()}),I};var v={equalityComparer:l,qa:function(){return this[S].V},Va:function(){var _=[];return m.a.P(this[S].I,function(w,D){_[D.Ka]=D.da}),_},Vb:function(_){if(!this[S].V)return!1;var w=this.Va();return m.a.A(w,_)!==-1?!0:!!m.a.Lb(w,function(D){return D.Vb&&D.Vb(_)})},uc:function(_,w,D){if(this[S].wb&&w===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=D,D.Ka=this[S].V++,D.La=w.ob()},Xa:function(){var _,w,D=this[S].I;for(_ in D)if(Object.prototype.hasOwnProperty.call(D,_)&&(w=D[_],this.Ia&&w.da.Ja||w.da.Dd(w.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var w=_.subscribe(this.Jd,this,"dirty"),D=_.subscribe(this.Rd,this);return{da:_,s:function(){w.s(),D.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,w=_.throttleEvaluation;w&&0<=w?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){_.ha(!0)},w)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var w=this[S],D=w.Sa,I=!1;if(!w.rb&&!w.ra){if(w.l&&!m.a.Sb(w.l)||D&&D()){if(!w.jc){this.s();return}}else w.jc=!1;w.rb=!0;try{I=this.zd(_)}finally{w.rb=!1}return I}},zd:function(_){var w=this[S],I=!1,D=w.wb?e:!w.V,I={qd:this,mb:w.I,Qb:w.V};m.u.xc({pd:I,od:g,o:this,Ya:D}),w.I={},w.V=0;var N=this.yd(w,I);return w.V?I=this.sb(w.X,N):(this.s(),I=!0),I&&(w.J?this.Gb():this.notifySubscribers(w.X,"beforeChange"),w.X=N,this.notifySubscribers(w.X,"spectate"),!w.J&&_&&this.notifySubscribers(w.X),this.rc&&this.rc()),D&&this.notifySubscribers(w.X,"awake"),I},yd:function(_,w){try{var D=_.Wc;return _.nb?D.call(_.nb):D()}finally{m.u.end(),w.Qb&&!_.J&&m.a.P(w.mb,p),_.sa=_.ka=!1}},v:function(_){var w=this[S];return(w.ka&&(_||!w.V)||w.J&&this.Xa())&&this.ha(),w.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(w){this.pc(this[S].X),this[S].ka=!0,w&&(this[S].sa=!0),this.qc(this,!w)}},s:function(){var _=this[S];!_.J&&_.I&&m.a.P(_.I,function(w,D){D.s&&D.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},P={Qa:function(_){var w=this,D=w[S];if(!D.ra&&D.J&&_=="change"){if(D.J=!1,D.sa||w.Xa())D.I=null,D.V=0,w.ha()&&w.Gb();else{var I=[];m.a.P(D.I,function(N,k){I[k.Ka]=N}),m.a.D(I,function(N,k){var z=D.I[N],V=w.$c(z.da);V.Ka=k,V.La=z.La,D.I[N]=V}),w.Xa()&&w.ha()&&w.Gb()}D.ra||w.notifySubscribers(D.X,"awake")}},hb:function(_){var w=this[S];w.ra||_!="change"||this.Wa("change")||(m.a.P(w.I,function(D,I){I.s&&(w.I[D]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),w.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},M={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[S]&&_[S].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,w){return typeof _=="function"?m.o(_,w,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,w))},m.b("pureComputed",m.xb),function(){function _(I,N,k){if(k=k||new D,I=N(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var z=I instanceof Array?[]:{};return k.save(I,z),w(I,function(V){var j=N(I[V]);switch(typeof j){case"boolean":case"number":case"string":case"function":z[V]=j;break;case"object":case"undefined":var U=k.get(j);z[V]=U!==e?U:_(j,N,k)}}),z}function w(I,N){if(I instanceof Array){for(var k=0;k<I.length;k++)N(k);typeof I.toJSON=="function"&&N("toJSON")}else for(k in I)N(k)}function D(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(N){for(var k=0;m.O(N)&&10>k;k++)N=N();return N})},m.toJSON=function(I,N,k){return I=m.ad(I),m.a.hc(I,N,k)},D.prototype={constructor:D,save:function(I,N){var k=m.a.A(this.keys,I);0<=k?this.values[k]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,w,D){function I(N){var k=m.xb(_,D).extend({ma:"always"}),z=k.subscribe(function(V){V&&(z.s(),N(V))});return k.notifySubscribers(k.v()),z}return typeof Promise!="function"||w?I(w.bind(D)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,w,D){switch(m.a.R(_)){case"option":typeof w=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=w):(m.a.g.set(_,m.c.options.$b,w),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof w=="number"?w:"");break;case"select":(w===""||w===null)&&(w=e);for(var I=-1,N=0,k=_.options.length,z;N<k;++N)if(z=m.w.M(_.options[N]),z==w||z===""&&w===e){I=N;break}(D||0<=I||w===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(w===null||w===e)&&(w=""),_.value=w}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` -,`;var j=[],U=V.match(I),q,Y=[],te=0;if(1<U.length){for(var K=0,Z;Z=U[K];++K){var ee=Z.charCodeAt(0);if(ee===44){if(0>=te){j.push(q&&Y.length?{key:q,value:Y.join("")}:{unknown:q||Y.join("")}),q=te=0,Y=[];continue}}else if(ee===58){if(!te&&!q&&Y.length===1){q=Y.pop();continue}}else{if(ee===47&&1<Z.length&&(Z.charCodeAt(1)===47||Z.charCodeAt(1)===42))continue;ee===47&&K&&1<Z.length?(ee=U[K-1].match(N))&&!k[ee[0]]&&(V=V.substr(V.indexOf(Z)+1),U=V.match(I),K=-1,Z="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:q||Y.length||ee!==34&&ee!==39||(Z=Z.slice(1,-1))}Y.push(Z)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var w=["true","false","null","undefined"],D=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,k={in:1,return:1,typeof:1},z={};return{Ra:[],wa:z,ac:_,vb:function(V,j){function U(ee,me){var Te;if(!K){var ue=m.getBindingHandler(ee);if(ue&&ue.preprocess&&!(me=ue.preprocess(me,ee,U)))return;(ue=z[ee])&&(Te=me,0<=m.a.A(w,Te)?Te=!1:(ue=Te.match(D),Te=ue===null?!1:ue[1]?"Object("+ue[1]+")"+ue[2]:Te),ue=Te),ue&&Y.push("'"+(typeof z[ee]=="string"?z[ee]:ee)+"':function(_z){"+Te+"=_z}")}te&&(me="function(){return "+me+" }"),q.push("'"+ee+"':"+me)}j=j||{};var q=[],Y=[],te=j.valueAccessors,K=j.bindingParams,Z=typeof V=="string"?_(V):V;return m.a.D(Z,function(ee){U(ee.key||ee.unknown,ee.value)}),Y.length&&U("_ko_property_writers","{"+Y.join(",")+" }"),q.join(",")},Id:function(V,j){for(var U=0;U<V.length;U++)if(V[U].key==j)return!0;return!1},eb:function(V,j,U,q,Y){V&&m.O(V)?!m.Za(V)||Y&&V.v()===q||V(q):(V=j.get("_ko_property_writers"))&&V[U]&&V[U](q)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function _(U){return U.nodeType==8&&k.test(N?U.text:U.nodeValue)}function w(U){return U.nodeType==8&&z.test(N?U.text:U.nodeValue)}function D(U,q){for(var Y=U,te=1,K=[];Y=Y.nextSibling;){if(w(Y)&&(m.a.g.set(Y,j,!0),te--,te===0))return K;K.push(Y),_(Y)&&te++}if(!q)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,q){var Y=D(U,q);return Y?0<Y.length?Y[Y.length-1].nextSibling:U.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",k=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,z=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(U){return _(U)?D(U):U.childNodes},Ea:function(U){if(_(U)){U=m.h.childNodes(U);for(var q=0,Y=U.length;q<Y;q++)m.removeNode(U[q])}else m.a.Tb(U)},va:function(U,q){if(_(U)){m.h.Ea(U);for(var Y=U.nextSibling,te=0,K=q.length;te<K;te++)Y.parentNode.insertBefore(q[te],Y)}else m.a.va(U,q)},Vc:function(U,q){var Y;_(U)?(Y=U.nextSibling,U=U.parentNode):Y=U.firstChild,Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)},Wb:function(U,q,Y){Y?(Y=Y.nextSibling,_(U)&&(U=U.parentNode),Y?q!==Y&&U.insertBefore(q,Y):U.appendChild(q)):m.h.Vc(U,q)},firstChild:function(U){if(_(U))return!U.nextSibling||w(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&w(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&w(U.nextSibling)){var q=U.nextSibling;if(w(q)&&!m.a.g.get(q,j))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(N?U.text:U.nodeValue).match(k))?U[1]:null},Sc:function(U){if(V[m.a.R(U)]){var q=U.firstChild;if(q)do if(q.nodeType===1){var Y;Y=q.firstChild;var te=null;if(Y)do if(te)te.push(Y);else if(_(Y)){var K=I(Y,!0);K?Y=K:te=[Y]}else w(Y)&&(te=[Y]);while(Y=Y.nextSibling);if(Y=te)for(te=q.nextSibling,K=0;K<Y.length;K++)te?U.insertBefore(Y[K],te):U.appendChild(Y[K])}while(q=q.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_):null;return m.j.tc(D,_,w,!1)},getBindingAccessors:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_,{valueAccessors:!0}):null;return m.j.tc(D,_,w,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,w,D,I){try{var N=this.nd,k=_+(I&&I.valueAccessors||""),z;if(!(z=N[k])){var V,j="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";V=new Function("$context","$element",j),z=N[k]=V}return z(w,D)}catch(U){throw U.message=`Unable to parse bindings. + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),(function(s){s(t.ko={})})(function(s,a){function c(_,C){return _===null||typeof _ in y?_===C:!1}function u(_,C){var w;return function(){w||(w=m.a.setTimeout(function(){w=e,_()},C))}}function f(_,C){var w;return function(){clearTimeout(w),w=m.a.setTimeout(_,C)}}function d(_,C){C&&C!=="change"?C==="beforeChange"?this.pc(_):this.gb(_,C):this.qc(_)}function p(_,C){C!==null&&C.s&&C.s()}function g(_,C){var w=this.qd,P=w[E];P.ra||(this.Qb&&this.mb[C]?(w.uc(C,_,this.mb[C]),this.mb[C]=null,--this.Qb):P.I[C]||w.uc(C,_,P.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,C){for(var w=_.split("."),P=m,M=0;M<w.length-1;M++)P=P[w[M]];P[w[w.length-1]]=C},m.L=function(_,C,w){_[C]=w},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=(function(){function _(W,J){for(var Z in W)M.call(W,Z)&&J(Z,W[Z])}function C(W,J){if(J)for(var Z in J)M.call(J,Z)&&(W[Z]=J[Z]);return W}function w(W,J){return W.__proto__=J,W}function P(W,J,Z,ae){var Ae=W[J].match(q)||[];m.a.D(Z.match(q),function(fe){m.a.Na(Ae,fe,ae)}),W[J]=Ae.join(" ")}var M=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,V=typeof Symbol=="function",B={},j={};B[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],B.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(B,function(W,J){if(J.length)for(var Z=0,ae=J.length;Z<ae;Z++)j[J[Z]]=W});var k={propertychange:!0},G=n&&(function(){for(var W=3,J=n.createElement("div"),Z=J.getElementsByTagName("i");J.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",Z[0];);return 4<W?W:e})(),q=/\S+/g,Q;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,J,Z){for(var ae=0,Ae=W.length;ae<Ae;ae++)J.call(Z,W[ae],ae,W)},A:typeof Array.prototype.indexOf=="function"?function(W,J){return Array.prototype.indexOf.call(W,J)}:function(W,J){for(var Z=0,ae=W.length;Z<ae;Z++)if(W[Z]===J)return Z;return-1},Lb:function(W,J,Z){for(var ae=0,Ae=W.length;ae<Ae;ae++)if(J.call(Z,W[ae],ae,W))return W[ae];return e},Pa:function(W,J){var Z=m.a.A(W,J);0<Z?W.splice(Z,1):Z===0&&W.shift()},wc:function(W){var J=[];return W&&m.a.D(W,function(Z){0>m.a.A(J,Z)&&J.push(Z)}),J},Mb:function(W,J,Z){var ae=[];if(W)for(var Ae=0,fe=W.length;Ae<fe;Ae++)ae.push(J.call(Z,W[Ae],Ae));return ae},jb:function(W,J,Z){var ae=[];if(W)for(var Ae=0,fe=W.length;Ae<fe;Ae++)J.call(Z,W[Ae],Ae)&&ae.push(W[Ae]);return ae},Nb:function(W,J){if(J instanceof Array)W.push.apply(W,J);else for(var Z=0,ae=J.length;Z<ae;Z++)W.push(J[Z]);return W},Na:function(W,J,Z){var ae=m.a.A(m.a.bc(W),J);0>ae?Z&&W.push(J):Z||W.splice(ae,1)},Ba:F,extend:C,setPrototypeOf:w,Ab:F?w:C,P:_,Ga:function(W,J,Z){if(!W)return W;var ae={},Ae;for(Ae in W)M.call(W,Ae)&&(ae[Ae]=J.call(Z,W[Ae],Ae,W));return ae},Tb:function(W){for(;W.firstChild;)m.removeNode(W.firstChild)},Yb:function(W){W=m.a.la(W);for(var J=(W[0]&&W[0].ownerDocument||n).createElement("div"),Z=0,ae=W.length;Z<ae;Z++)J.appendChild(m.oa(W[Z]));return J},Ca:function(W,J){for(var Z=0,ae=W.length,Ae=[];Z<ae;Z++){var fe=W[Z].cloneNode(!0);Ae.push(J?m.oa(fe):fe)}return Ae},va:function(W,J){if(m.a.Tb(W),J)for(var Z=0,ae=J.length;Z<ae;Z++)W.appendChild(J[Z])},Xc:function(W,J){var Z=W.nodeType?[W]:W;if(0<Z.length){for(var ae=Z[0],Ae=ae.parentNode,fe=0,xe=J.length;fe<xe;fe++)Ae.insertBefore(J[fe],ae);for(fe=0,xe=Z.length;fe<xe;fe++)m.removeNode(Z[fe])}},Ua:function(W,J){if(W.length){for(J=J.nodeType===8&&J.parentNode||J;W.length&&W[0].parentNode!==J;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==J;)W.length--;if(1<W.length){var Z=W[0],ae=W[W.length-1];for(W.length=0;Z!==ae;)W.push(Z),Z=Z.nextSibling;W.push(ae)}}return W},Zc:function(W,J){7>G?W.setAttribute("selected",J):W.selected=J},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,J){return W=W||"",J.length>W.length?!1:W.substring(0,J.length)===J},vd:function(W,J){if(W===J)return!0;if(W.nodeType===11)return!1;if(J.contains)return J.contains(W.nodeType!==1?W.parentNode:W);if(J.compareDocumentPosition)return(J.compareDocumentPosition(W)&16)==16;for(;W&&W!=J;)W=W.parentNode;return!!W},Sb:function(W){return m.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!m.a.Lb(W,m.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return m.onError?function(){try{return W.apply(this,arguments)}catch(J){throw m.onError&&m.onError(J),J}}:W},setTimeout:function(W,J){return setTimeout(m.a.Ac(W),J)},Gc:function(W){setTimeout(function(){throw m.onError&&m.onError(W),W},0)},B:function(W,J,Z){var ae=m.a.Ac(Z);if(Z=k[J],m.options.useOnlyNativeEvents||Z||!r)if(Z||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var Ae=function(xe){ae.call(W,xe)},fe="on"+J;W.attachEvent(fe,Ae),m.a.K.za(W,function(){W.detachEvent(fe,Ae)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(J,ae,!1);else Q||(Q=typeof r(W).on=="function"?"on":"bind"),r(W)[Q](J,ae)},Fb:function(W,J){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(m.a.R(W)==="input"&&W.type&&J.toLowerCase()=="click"?(Z=W.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,m.options.useOnlyNativeEvents||!r||Z)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")Z=n.createEvent(j[J]||"HTMLEvents"),Z.initEvent(J,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+J);else throw Error("Browser doesn't support triggering events");else r(W).trigger(J)},f:function(W){return m.O(W)?W():W},bc:function(W){return m.O(W)?W.v():W},Eb:function(W,J,Z){var ae;J&&(typeof W.classList=="object"?(ae=W.classList[Z?"add":"remove"],m.a.D(J.match(q),function(Ae){ae.call(W.classList,Ae)})):typeof W.className.baseVal=="string"?P(W.className,"baseVal",J,Z):P(W,"className",J,Z))},Bb:function(W,J){var Z=m.a.f(J);(Z===null||Z===e)&&(Z="");var ae=m.h.firstChild(W);!ae||ae.nodeType!=3||m.h.nextSibling(ae)?m.h.va(W,[W.ownerDocument.createTextNode(Z)]):ae.data=Z,m.a.Ad(W)},Yc:function(W,J){if(W.name=J,7>=G)try{var Z=W.name.replace(/[&<>'"]/g,function(ae){return"&#"+ae.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(W){9<=G&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(G){var J=W.style.width;W.style.width=0,W.style.width=J}},Pd:function(W,J){W=m.a.f(W),J=m.a.f(J);for(var Z=[],ae=W;ae<=J;ae++)Z.push(ae);return Z},la:function(W){for(var J=[],Z=0,ae=W.length;Z<ae;Z++)J.push(W[Z]);return J},Da:function(W){return V?Symbol(W):W},Zd:G===6,$d:G===7,W:G,Lc:function(W,J){for(var Z=m.a.la(W.getElementsByTagName("input")).concat(m.a.la(W.getElementsByTagName("textarea"))),ae=typeof J=="string"?function(xe){return xe.name===J}:function(xe){return J.test(xe.name)},Ae=[],fe=Z.length-1;0<=fe;fe--)ae(Z[fe])&&Ae.push(Z[fe]);return Ae},Nd:function(W){return typeof W=="string"&&(W=m.a.Db(W))?o&&o.parse?o.parse(W):new Function("return "+W)():null},hc:function(W,J,Z){if(!o||!o.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 o.stringify(m.a.f(W),J,Z)},Od:function(W,J,Z){Z=Z||{};var ae=Z.params||{},Ae=Z.includeFields||this.Jc,fe=W;if(typeof W=="object"&&m.a.R(W)==="form")for(var fe=W.action,xe=Ae.length-1;0<=xe;xe--)for(var ge=m.a.Lc(W,Ae[xe]),we=ge.length-1;0<=we;we--)ae[ge[we].name]=ge[we].value;J=m.a.f(J);var Se=n.createElement("form");Se.style.display="none",Se.action=fe,Se.method="post";for(var Re in J)W=n.createElement("input"),W.type="hidden",W.name=Re,W.value=m.a.hc(m.a.f(J[Re])),Se.appendChild(W);_(ae,function(Qe,He){var Xe=n.createElement("input");Xe.type="hidden",Xe.name=Qe,Xe.value=He,Se.appendChild(Xe)}),n.body.appendChild(Se),Z.submitter?Z.submitter(Se):Se.submit(),setTimeout(function(){Se.parentNode.removeChild(Se)},0)}}})(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var C=this;if(arguments.length===1)return function(){return C.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var P=w.slice(0);return P.push.apply(P,arguments),C.apply(_,P)}}),m.a.g=new function(){var _=0,C="__ko__"+new Date().getTime(),w={},P,M;return m.a.W?(P=function(F,V){var B=F[C];if(!B||B==="null"||!w[B]){if(!V)return e;B=F[C]="ko"+_++,w[B]={}}return w[B]},M=function(F){var V=F[C];return V?(delete w[V],F[C]=null,!0):!1}):(P=function(F,V){var B=F[C];return!B&&V&&(B=F[C]={}),B},M=function(F){return F[C]?(delete F[C],!0):!1}),{get:function(F,V){var B=P(F,!1);return B&&B[V]},set:function(F,V,B){(F=P(F,B!==e))&&(F[V]=B)},Ub:function(F,V,B){return F=P(F,!0),F[V]||(F[V]=B)},clear:M,Z:function(){return _+++C}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(V,B){var j=m.a.g.get(V,P);return j===e&&B&&(j=[],m.a.g.set(V,P,j)),j}function C(V){var B=_(V,!1);if(B)for(var B=B.slice(0),j=0;j<B.length;j++)B[j](V);m.a.g.clear(V),m.a.K.cleanExternalData(V),F[V.nodeType]&&w(V.childNodes,!0)}function w(V,B){for(var j=[],k,G=0;G<V.length;G++)if((!B||V[G].nodeType===8)&&(C(j[j.length]=k=V[G]),V[G]!==k))for(;G--&&m.a.A(j,V[G])==-1;);}var P=m.a.g.Z(),M={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(V,B){if(typeof B!="function")throw Error("Callback must be a function");_(V,!0).push(B)},yb:function(V,B){var j=_(V,!1);j&&(m.a.Pa(j,B),j.length==0&&m.a.g.set(V,P,e))},oa:function(V){return m.u.G(function(){M[V.nodeType]&&(C(V),F[V.nodeType]&&w(V.getElementsByTagName("*")))}),V},removeNode:function(V){m.oa(V),V.parentNode&&V.parentNode.removeChild(V)},cleanExternalData:function(V){r&&typeof r.cleanData=="function"&&r.cleanData([V])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),(function(){var _=[0,"",""],C=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],P=[1,"<select multiple='multiple'>","</select>"],M={thead:C,tbody:C,tfoot:C,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:P,optgroup:P},F=8>=m.a.W;m.a.ua=function(V,B){var j;if(r){if(r.parseHTML)j=r.parseHTML(V,B)||[];else if((j=r.clean([V],B))&&j[0]){for(var k=j[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(j=B)||(j=n);var k=j.parentWindow||j.defaultView||t,G=m.a.Db(V).toLowerCase(),q=j.createElement("div"),Q;for(Q=(G=G.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[G[1]]||_,G=Q[0],Q="ignored<div>"+Q[1]+V+Q[2]+"</div>",typeof k.innerShiv=="function"?q.appendChild(k.innerShiv(Q)):(F&&j.body.appendChild(q),q.innerHTML=Q,F&&q.parentNode.removeChild(q));G--;)q=q.lastChild;j=m.a.la(q.lastChild.childNodes)}return j},m.a.Md=function(V,B){var j=m.a.ua(V,B);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(V,B){if(m.a.Tb(V),B=m.a.f(B),B!==null&&B!==e)if(typeof B!="string"&&(B=B.toString()),r)r(V).html(B);else for(var j=m.a.ua(B,V.ownerDocument),k=0;k<j.length;k++)V.appendChild(j[k])}})(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=(function(){function _(w,P){if(w){if(w.nodeType==8){var M=m.aa.Uc(w.nodeValue);M!=null&&P.push({ud:w,Kd:M})}else if(w.nodeType==1)for(var M=0,F=w.childNodes,V=F.length;M<V;M++)_(F[M],P)}}var C={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var P=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return C[P]=w,"<!--[ko_memo:"+P+"]-->"},bd:function(w,P){var M=C[w];if(M===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return M.apply(null,P||[]),!0}finally{delete C[w]}},cd:function(w,P){var M=[];_(w,M);for(var F=0,V=M.length;F<V;F++){var B=M[F].ud,j=[B];P&&m.a.Nb(j,P),m.aa.bd(M[F].Kd,j),B.nodeValue="",B.parentNode&&B.parentNode.removeChild(B)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}})(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=(function(){function _(){if(M){for(var B=M,j=0,k;V<M;)if(k=P[V++]){if(V>B){if(5e3<=++j){V=M,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}B=M}try{k()}catch(G){m.a.Gc(G)}}}}function C(){_(),V=M=P.length=0}var w,P=[],M=0,F=1,V=0;return t.MutationObserver?w=(function(B){var j=n.createElement("div");return new MutationObserver(B).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}})(C):w=n&&"onreadystatechange"in n.createElement("script")?function(B){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,B()},n.documentElement.appendChild(j)}:function(B){setTimeout(B,0)},{scheduler:w,zb:function(B){return M||m.na.scheduler(C),P[M++]=B,F++},cancel:function(B){B=B-(F-M),B>=V&&B<M&&(P[B]=null)},resetForTesting:function(){var B=M-V;return V=M=P.length=0,B},Sd:_}})(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,C){_.throttleEvaluation=C;var w=null;return m.$({read:_,write:function(P){clearTimeout(w),w=m.a.setTimeout(function(){_(P)},C)}})},rateLimit:function(_,C){var w,P,M;typeof C=="number"?w=C:(w=C.timeout,P=C.method),_.Hb=!1,M=typeof P=="function"?P:P=="notifyWhenChangesStop"?f:u,_.ub(function(F){return M(F,w,C)})},deferred:function(_,C){if(C!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var P,M=!1;return function(){if(!M){m.na.cancel(P),P=m.na.zb(w);try{M=!0,_.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(_,C){_.equalityComparer=C=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,C,w){this.da=_,this.lc=C,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,A),A.qb(this)};var A={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,C,w){var P=this;w=w||"change";var M=new m.ic(P,C?_.bind(C):_,function(){m.a.Pa(P.U[w],M),P.hb&&P.hb(w)});return P.Qa&&P.Qa(w),P.U[w]||(P.U[w]=[]),P.U[w].push(M),M},notifySubscribers:function(_,C){if(C=C||"change",C==="change"&&this.Gb(),this.Wa(C)){var w=C==="change"&&this.ed||this.U[C].slice(0);try{m.u.xc();for(var P=0,M;M=w[P];++P)M.Ib||M.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var C=this,w=m.O(C),P,M,F,V,B;C.gb||(C.gb=C.notifySubscribers,C.notifySubscribers=d);var j=_(function(){C.Ja=!1,w&&V===C&&(V=C.nc?C.nc():C());var k=M||B&&C.sb(F,V);B=M=P=!1,k&&C.gb(F=V)});C.qc=function(k,G){G&&C.Ja||(B=!G),C.ed=C.U.change.slice(0),C.Ja=P=!0,V=k,j()},C.pc=function(k){P||(F=k,C.gb(k,"beforeChange"))},C.rc=function(){B=!0},C.gd=function(){C.sb(F,C.v(!0))&&(M=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var C=0;return m.a.P(this.U,function(w,P){w!=="dirty"&&(C+=P.length)}),C},sb:function(_,C){return!this.equalityComparer||!this.equalityComparer(_,C)},toString:function(){return"[object Object]"},extend:function(_){var C=this;return _&&m.a.P(_,function(w,P){var M=m.Ta[w];typeof M=="function"&&(C=M(C,P)||C)}),C}};m.L(A,"init",A.qb),m.L(A,"subscribe",A.subscribe),m.L(A,"extend",A.extend),m.L(A,"getSubscriptionsCount",A.Bd),m.a.Ba&&m.a.setPrototypeOf(A,Function.prototype),m.T.fn=A,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=(function(){function _(F){w.push(P),P=F}function C(){P=w.pop()}var w=[],P,M=0;return{xc:_,end:C,cc:function(F){if(P){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");P.od.call(P.pd,F,F.fd||(F.fd=++M))}},G:function(F,V,B){try{return _(),F.apply(V,B||[])}finally{C()}},qa:function(){if(P)return P.o.qa()},Va:function(){if(P)return P.o.Va()},Ya:function(){if(P)return P.Ya},o:function(){if(P)return P.o}}})(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var b=m.a.Da("_latestValue");m.ta=function(_){function C(){return 0<arguments.length?(C.sb(C[b],arguments[0])&&(C.ya(),C[b]=arguments[0],C.xa()),this):(m.u.cc(C),C[b])}return C[b]=_,m.a.Ba||m.a.extend(C,m.T.fn),m.T.fn.qb(C),m.a.Ab(C,x),m.options.deferUpdates&&m.Ta.deferred(C,!0),C};var x={equalityComparer:c,v:function(){return this[b]},xa:function(){this.notifySubscribers(this[b],"spectate"),this.notifySubscribers(this[b])},ya:function(){this.notifySubscribers(this[b],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(x,m.T.fn);var T=m.ta.Ma="__ko_proto__";x[T]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[T])&&_!==x[T]&&_!==m.o.fn[T])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[T]===x[T]||_[T]===m.o.fn[T]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",x),m.L(x,"peek",x.v),m.L(x,"valueHasMutated",x.xa),m.L(x,"valueWillMutate",x.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var C=this.v(),w=[],P=typeof _!="function"||m.O(_)?function(V){return V===_}:_,M=0;M<C.length;M++){var F=C[M];if(P(F)){if(w.length===0&&this.ya(),C[M]!==F)throw Error("Array modified during remove; cannot remove item");w.push(F),C.splice(M,1),M--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var C=this.v(),w=C.slice(0);return this.ya(),C.splice(0,C.length),this.xa(),w}return _?this.remove(function(P){return 0<=m.a.A(_,P)}):[]},destroy:function(_){var C=this.v(),w=typeof _!="function"||m.O(_)?function(F){return F===_}:_;this.ya();for(var P=C.length-1;0<=P;P--){var M=C[P];w(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(C){return 0<=m.a.A(_,C)}):[]},indexOf:function(_){var C=this();return m.a.A(C,_)},replace:function(_,C){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=C,this.xa())},sorted:function(_){var C=this().slice(0);return _?C.sort(_):C.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var C=this.v();this.ya(),this.zc(C,_,arguments);var w=C[_].apply(C,arguments);return this.xa(),w===C?this:w}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var C=this();return C[_].apply(C,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,C){function w(){function q(){if(B){var Q=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!M||1<B)&&(M=m.a.Pb(j,Q,_.Ob)),W=M),j=Q,M=null,B=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}P?q():(P=!0,V=_.subscribe(function(){++B},null,"spectate"),j=[].concat(_.v()||[]),M=null,F=_.subscribe(q))}if(_.Ob={},C&&typeof C=="object"&&m.a.extend(_.Ob,C),_.Ob.sparse=!0,!_.zc){var P=!1,M=null,F,V,B=0,j,k=_.Qa,G=_.hb;_.Qa=function(q){k&&k.call(_,q),q==="arrayChange"&&w()},_.hb=function(q){G&&G.call(_,q),q!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),V&&V.s(),V=F=null,P=!1,j=e)},_.zc=function(q,Q,W){function J(Se,Re,Qe){return Z[Z.length]={status:Se,value:Re,index:Qe}}if(P&&!B){var Z=[],ae=q.length,Ae=W.length,fe=0;switch(Q){case"push":fe=ae;case"unshift":for(Q=0;Q<Ae;Q++)J("added",W[Q],fe+Q);break;case"pop":fe=ae-1;case"shift":ae&&J("deleted",q[fe],fe);break;case"splice":Q=Math.min(Math.max(0,0>W[0]?ae+W[0]:W[0]),ae);for(var ae=Ae===1?ae:Math.min(Q+(W[1]||0),ae),Ae=Q+Ae-2,fe=Math.max(ae,Ae),xe=[],ge=[],we=2;Q<fe;++Q,++we)Q<ae&&ge.push(J("deleted",q[Q],Q)),Q<Ae&&xe.push(J("added",W[we],Q));m.a.Kc(ge,xe);break;default:return}M=Z}}}};var E=m.a.Da("_state");m.o=m.$=function(_,C,w){function P(){if(0<arguments.length){if(typeof M=="function")M.apply(F.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 F.ra||m.u.cc(P),(F.ka||F.J&&P.Xa())&&P.ha(),F.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=w.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:C||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return P[E]=F,P.Nc=typeof M=="function",m.a.Ba||m.a.extend(P,m.T.fn),m.T.fn.qb(P),m.a.Ab(P,v),w.pure?(F.wb=!0,F.J=!0,m.a.extend(P,S)):w.deferEvaluation&&m.a.extend(P,I),m.options.deferUpdates&&m.Ta.deferred(P,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||w.deferEvaluation||P.ha(),F.l&&P.ja()&&m.a.K.za(F.l,F.Rb=function(){P.s()}),P};var v={equalityComparer:c,qa:function(){return this[E].V},Va:function(){var _=[];return m.a.P(this[E].I,function(C,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[E].V)return!1;var C=this.Va();return m.a.A(C,_)!==-1?!0:!!m.a.Lb(C,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,C,w){if(this[E].wb&&C===this)throw Error("A 'pure' computed must not be called recursively");this[E].I[_]=w,w.Ka=this[E].V++,w.La=C.ob()},Xa:function(){var _,C,w=this[E].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(C=w[_],this.Ia&&C.da.Ja||C.da.Dd(C.La)))return!0},Jd:function(){this.Ia&&!this[E].rb&&this.Ia(!1)},ja:function(){var _=this[E];return _.ka||0<_.V},Rd:function(){this.Ja?this[E].ka&&(this[E].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var C=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){C.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,C=_.throttleEvaluation;C&&0<=C?(clearTimeout(this[E].Ic),this[E].Ic=m.a.setTimeout(function(){_.ha(!0)},C)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var C=this[E],w=C.Sa,P=!1;if(!C.rb&&!C.ra){if(C.l&&!m.a.Sb(C.l)||w&&w()){if(!C.jc){this.s();return}}else C.jc=!1;C.rb=!0;try{P=this.zd(_)}finally{C.rb=!1}return P}},zd:function(_){var C=this[E],P=!1,w=C.wb?e:!C.V,P={qd:this,mb:C.I,Qb:C.V};m.u.xc({pd:P,od:g,o:this,Ya:w}),C.I={},C.V=0;var M=this.yd(C,P);return C.V?P=this.sb(C.X,M):(this.s(),P=!0),P&&(C.J?this.Gb():this.notifySubscribers(C.X,"beforeChange"),C.X=M,this.notifySubscribers(C.X,"spectate"),!C.J&&_&&this.notifySubscribers(C.X),this.rc&&this.rc()),w&&this.notifySubscribers(C.X,"awake"),P},yd:function(_,C){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{m.u.end(),C.Qb&&!_.J&&m.a.P(C.mb,p),_.sa=_.ka=!1}},v:function(_){var C=this[E];return(C.ka&&(_||!C.V)||C.J&&this.Xa())&&this.ha(),C.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[E].J||(this[E].sa?this.ha():this[E].ka=!1),this[E].X},this.Ia=function(C){this.pc(this[E].X),this[E].ka=!0,C&&(this[E].sa=!0),this.qc(this,!C)}},s:function(){var _=this[E];!_.J&&_.I&&m.a.P(_.I,function(C,w){w.s&&w.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},S={Qa:function(_){var C=this,w=C[E];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||C.Xa())w.I=null,w.V=0,C.ha()&&C.Gb();else{var P=[];m.a.P(w.I,function(M,F){P[F.Ka]=M}),m.a.D(P,function(M,F){var V=w.I[M],B=C.$c(V.da);B.Ka=F,B.La=V.La,w.I[M]=B}),C.Xa()&&C.ha()&&C.Gb()}w.ra||C.notifySubscribers(w.X,"awake")}},hb:function(_){var C=this[E];C.ra||_!="change"||this.Wa("change")||(m.a.P(C.I,function(w,P){P.s&&(C.I[w]={da:P.da,Ka:P.Ka,La:P.La},P.s())}),C.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[E];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},I={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[E]&&_[E].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,C){return typeof _=="function"?m.o(_,C,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,C))},m.b("pureComputed",m.xb),(function(){function _(P,M,F){if(F=F||new w,P=M(P),typeof P!="object"||P===null||P===e||P instanceof RegExp||P instanceof Date||P instanceof String||P instanceof Number||P instanceof Boolean)return P;var V=P instanceof Array?[]:{};return F.save(P,V),C(P,function(B){var j=M(P[B]);switch(typeof j){case"boolean":case"number":case"string":case"function":V[B]=j;break;case"object":case"undefined":var k=F.get(j);V[B]=k!==e?k:_(j,M,F)}}),V}function C(P,M){if(P instanceof Array){for(var F=0;F<P.length;F++)M(F);typeof P.toJSON=="function"&&M("toJSON")}else for(F in P)M(F)}function w(){this.keys=[],this.values=[]}m.ad=function(P){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(P,function(M){for(var F=0;m.O(M)&&10>F;F++)M=M();return M})},m.toJSON=function(P,M,F){return P=m.ad(P),m.a.hc(P,M,F)},w.prototype={constructor:w,save:function(P,M){var F=m.a.A(this.keys,P);0<=F?this.values[F]=M:(this.keys.push(P),this.values.push(M))},get:function(P){return P=m.a.A(this.keys,P),0<=P?this.values[P]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,C,w){function P(M){var F=m.xb(_,w).extend({ma:"always"}),V=F.subscribe(function(B){B&&(V.s(),M(B))});return F.notifySubscribers(F.v()),V}return typeof Promise!="function"||C?P(C.bind(w)):new Promise(P)},m.b("when",m.Wd),(function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,C,w){switch(m.a.R(_)){case"option":typeof C=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=C):(m.a.g.set(_,m.c.options.$b,C),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof C=="number"?C:"");break;case"select":(C===""||C===null)&&(C=e);for(var P=-1,M=0,F=_.options.length,V;M<F;++M)if(V=m.w.M(_.options[M]),V==C||V===""&&C===e){P=M;break}(w||0<=P||C===e&&1<_.size)&&(_.selectedIndex=P,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=P},0));break;default:(C===null||C===e)&&(C=""),_.value=C}}}})(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=(function(){function _(B){B=m.a.Db(B),B.charCodeAt(0)===123&&(B=B.slice(1,-1)),B+=` +,`;var j=[],k=B.match(P),G,q=[],Q=0;if(1<k.length){for(var W=0,J;J=k[W];++W){var Z=J.charCodeAt(0);if(Z===44){if(0>=Q){j.push(G&&q.length?{key:G,value:q.join("")}:{unknown:G||q.join("")}),G=Q=0,q=[];continue}}else if(Z===58){if(!Q&&!G&&q.length===1){G=q.pop();continue}}else{if(Z===47&&1<J.length&&(J.charCodeAt(1)===47||J.charCodeAt(1)===42))continue;Z===47&&W&&1<J.length?(Z=k[W-1].match(M))&&!F[Z[0]]&&(B=B.substr(B.indexOf(J)+1),k=B.match(P),W=-1,J="/"):Z===40||Z===123||Z===91?++Q:Z===41||Z===125||Z===93?--Q:G||q.length||Z!==34&&Z!==39||(J=J.slice(1,-1))}q.push(J)}if(0<Q)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var C=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,P=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(B,j){function k(Z,ae){var Ae;if(!W){var fe=m.getBindingHandler(Z);if(fe&&fe.preprocess&&!(ae=fe.preprocess(ae,Z,k)))return;(fe=V[Z])&&(Ae=ae,0<=m.a.A(C,Ae)?Ae=!1:(fe=Ae.match(w),Ae=fe===null?!1:fe[1]?"Object("+fe[1]+")"+fe[2]:Ae),fe=Ae),fe&&q.push("'"+(typeof V[Z]=="string"?V[Z]:Z)+"':function(_z){"+Ae+"=_z}")}Q&&(ae="function(){return "+ae+" }"),G.push("'"+Z+"':"+ae)}j=j||{};var G=[],q=[],Q=j.valueAccessors,W=j.bindingParams,J=typeof B=="string"?_(B):B;return m.a.D(J,function(Z){k(Z.key||Z.unknown,Z.value)}),q.length&&k("_ko_property_writers","{"+q.join(",")+" }"),G.join(",")},Id:function(B,j){for(var k=0;k<B.length;k++)if(B[k].key==j)return!0;return!1},eb:function(B,j,k,G,q){B&&m.O(B)?!m.Za(B)||q&&B.v()===G||B(G):(B=j.get("_ko_property_writers"))&&B[k]&&B[k](G)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function _(k){return k.nodeType==8&&F.test(M?k.text:k.nodeValue)}function C(k){return k.nodeType==8&&V.test(M?k.text:k.nodeValue)}function w(k,G){for(var q=k,Q=1,W=[];q=q.nextSibling;){if(C(q)&&(m.a.g.set(q,j,!0),Q--,Q===0))return W;W.push(q),_(q)&&Q++}if(!G)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function P(k,G){var q=w(k,G);return q?0<q.length?q[q.length-1].nextSibling:k.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",F=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,B={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=m.h.childNodes(k);for(var G=0,q=k.length;G<q;G++)m.removeNode(k[G])}else m.a.Tb(k)},va:function(k,G){if(_(k)){m.h.Ea(k);for(var q=k.nextSibling,Q=0,W=G.length;Q<W;Q++)q.parentNode.insertBefore(G[Q],q)}else m.a.va(k,G)},Vc:function(k,G){var q;_(k)?(q=k.nextSibling,k=k.parentNode):q=k.firstChild,q?G!==q&&k.insertBefore(G,q):k.appendChild(G)},Wb:function(k,G,q){q?(q=q.nextSibling,_(k)&&(k=k.parentNode),q?G!==q&&k.insertBefore(G,q):k.appendChild(G)):m.h.Vc(k,G)},firstChild:function(k){if(_(k))return!k.nextSibling||C(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&C(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=P(k)),k.nextSibling&&C(k.nextSibling)){var G=k.nextSibling;if(C(G)&&!m.a.g.get(G,j))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(M?k.text:k.nodeValue).match(F))?k[1]:null},Sc:function(k){if(B[m.a.R(k)]){var G=k.firstChild;if(G)do if(G.nodeType===1){var q;q=G.firstChild;var Q=null;if(q)do if(Q)Q.push(q);else if(_(q)){var W=P(q,!0);W?q=W:Q=[q]}else C(q)&&(Q=[q]);while(q=q.nextSibling);if(q=Q)for(Q=G.nextSibling,W=0;W<q.length;W++)Q?k.insertBefore(q[W],Q):k.appendChild(q[W])}while(G=G.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_):null;return m.j.tc(w,_,C,!1)},getBindingAccessors:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_,{valueAccessors:!0}):null;return m.j.tc(w,_,C,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,C,w,P){try{var M=this.nd,F=_+(P&&P.valueAccessors||""),V;if(!(V=M[F])){var B,j="with($context){with($data||{}){return{"+m.m.vb(_,P)+"}}}";B=new Function("$context","$element",j),V=M[F]=B}return V(C,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` -Message: `+U.message,U}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ue){var ye=(ue=m.a.g.get(ue,Te))&&ue.N;ye&&(ue.N=null,ye.Tc())}function w(ue,ye,Ae){this.node=ue,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(ue,_),Ae&&Ae.N&&(Ae.N.kb.push(ue),this.Kb=Ae)}function D(ue){return function(){return ue}}function I(ue){return ue()}function N(ue){return m.a.Ga(m.u.G(ue),function(ye,Ae){return function(){return ue()[Ae]}})}function k(ue,ye,Ae){return typeof ue=="function"?N(ue.bind(null,ye,Ae)):m.a.Ga(ue,D)}function z(ue,ye){return N(this.getBindings.bind(this,ue,ye))}function V(ue,ye){var Ae=m.h.firstChild(ye);if(Ae){var Pe,Ee=m.ga.instance,ze=Ee.preprocessNode;if(ze){for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),ze.call(Ee,Pe);Ae=m.h.firstChild(ye)}for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),j(ue,Pe)}m.i.ma(ye,m.i.H)}function j(ue,ye){var Ae=ue,Pe=ye.nodeType===1;Pe&&m.h.Sc(ye),(Pe||m.ga.instance.nodeHasBindings(ye))&&(Ae=q(ye,null,ue).bindingContextForDescendants),Ae&&!ee[m.a.R(ye)]&&V(Ae,ye)}function U(ue){var ye=[],Ae={},Pe=[];return m.a.P(ue,function Ee(ze){if(!Ae[ze]){var qe=m.getBindingHandler(ze);qe&&(qe.after&&(Pe.push(ze),m.a.D(qe.after,function(it){if(ue[it]){if(m.a.A(Pe,it)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));Ee(it)}}),Pe.length--),ye.push({key:ze,Mc:qe})),Ae[ze]=!0}}),ye}function q(ue,ye,Ae){var Pe=m.a.g.Ub(ue,Te,{}),Ee=Pe.hd;if(!ye){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}Ee||(Pe.context=Ae),Pe.Zb||(Pe.Zb={});var ze;if(ye&&typeof ye!="function")ze=ye;else{var qe=m.ga.instance,it=qe.getBindingAccessors||z,Dt=m.$(function(){return(ze=ye?ye(Ae,ue):it.call(qe,ue,Ae))&&(Ae[te]&&Ae[te](),Ae[Z]&&Ae[Z]()),ze},null,{l:ue});ze&&Dt.ja()||(Dt=null)}var jt=Ae,$e;if(ze){var un=function(){return m.a.Ga(Dt?Dt():ze,I)},zt=Dt?function(Ct){return function(){return I(Dt()[Ct])}}:function(Ct){return ze[Ct]};un.get=function(Ct){return ze[Ct]&&I(zt(Ct))},un.has=function(Ct){return Ct in ze},m.i.H in ze&&m.i.subscribe(ue,m.i.H,function(){var Ct=(0,ze[m.i.H])();if(Ct){var Ei=m.h.childNodes(ue);Ei.length&&Ct(Ei,m.Ec(Ei[0]))}}),m.i.pa in ze&&(jt=m.i.Cb(ue,Ae),m.i.subscribe(ue,m.i.pa,function(){var Ct=(0,ze[m.i.pa])();Ct&&m.h.firstChild(ue)&&Ct(ue)})),Pe=U(ze),m.a.D(Pe,function(Ct){var Ei=Ct.Mc.init,an=Ct.Mc.update,_e=Ct.key;if(ue.nodeType===8&&!m.h.ea[_e])throw Error("The binding '"+_e+"' cannot be used with virtual elements");try{typeof Ei=="function"&&m.u.G(function(){var Ce=Ei(ue,zt(_e),un,jt.$data,jt);if(Ce&&Ce.controlsDescendantBindings){if($e!==e)throw Error("Multiple bindings ("+$e+" and "+_e+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");$e=_e}}),typeof an=="function"&&m.$(function(){an(ue,zt(_e),un,jt.$data,jt)},null,{l:ue})}catch(Ce){throw Ce.message='Unable to process binding "'+_e+": "+ze[_e]+`" -Message: `+Ce.message,Ce}})}return Pe=$e===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&jt}}function Y(ue,ye){return ue&&ue instanceof m.fa?ue:new m.fa(ue,e,e,ye)}var te=m.a.Da("_subscribable"),K=m.a.Da("_ancestorBindingInfo"),Z=m.a.Da("_dataDependency");m.c={};var ee={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ue){return m.c[ue]};var me={};m.fa=function(ue,ye,Ae,Pe,Ee){function ze(){var zt=jt?Dt():Dt,Ct=m.a.f(zt);return ye?(m.a.extend(qe,ye),K in ye&&(qe[K]=ye[K])):(qe.$parents=[],qe.$root=Ct,qe.ko=m),qe[te]=$e,it?Ct=qe.$data:(qe.$rawData=zt,qe.$data=Ct),Ae&&(qe[Ae]=Ct),Pe&&Pe(qe,ye,Ct),ye&&ye[te]&&!m.S.o().Vb(ye[te])&&ye[te](),un&&(qe[Z]=un),qe.$data}var qe=this,it=ue===me,Dt=it?e:ue,jt=typeof Dt=="function"&&!m.O(Dt),$e,un=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?ze():($e=m.xb(ze),$e.v(),$e.ja()?$e.equalityComparer=null:qe[te]=e)},m.fa.prototype.createChildContext=function(ue,ye,Ae,Pe){if(!Pe&&ye&&typeof ye=="object"&&(Pe=ye,ye=Pe.as,Ae=Pe.extend),ye&&Pe&&Pe.noChildContext){var Ee=typeof ue=="function"&&!m.O(ue);return new m.fa(me,this,null,function(ze){Ae&&Ae(ze),ze[ye]=Ee?ue():ue},Pe)}return new m.fa(ue,this,ye,function(ze,qe){ze.$parentContext=qe,ze.$parent=qe.$data,ze.$parents=(qe.$parents||[]).slice(0),ze.$parents.unshift(ze.$parent),Ae&&Ae(ze)},Pe)},m.fa.prototype.extend=function(ue,ye){return new m.fa(me,this,null,function(Ae){m.a.extend(Ae,typeof ue=="function"?ue(Ae):ue)},ye)};var Te=m.a.g.Z();w.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},w.prototype.sd=function(ue){m.a.Pa(this.kb,ue),!this.kb.length&&this.H&&this.Cc()},w.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ue,ye,Ae,Pe,Ee){var ze=m.a.g.Ub(ue,Te,{});return ze.Fa||(ze.Fa=new m.T),Ee&&Ee.notifyImmediately&&ze.Zb[ye]&&m.u.G(Ae,Pe,[ue]),ze.Fa.subscribe(Ae,Pe,ye)},ma:function(ue,ye){var Ae=m.a.g.get(ue,Te);if(Ae&&(Ae.Zb[ye]=!0,Ae.Fa&&Ae.Fa.notifySubscribers(ue,ye),ye==m.i.H)){if(Ae.N)Ae.N.Cc();else if(Ae.N===e&&Ae.Fa&&Ae.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ue,ye){var Ae=m.a.g.Ub(ue,Te,{});return Ae.N||(Ae.N=new w(ue,Ae,ye[K])),ye[K]==Ae?ye:ye.extend(function(Pe){Pe[K]=Ae})}},m.Td=function(ue){return(ue=m.a.g.get(ue,Te))&&ue.context},m.ib=function(ue,ye,Ae){return ue.nodeType===1&&m.h.Sc(ue),q(ue,ye,Y(Ae))},m.ld=function(ue,ye,Ae){return Ae=Y(Ae),m.ib(ue,k(ye,Ae,ue),Ae)},m.Oa=function(ue,ye){ye.nodeType!==1&&ye.nodeType!==8||V(Y(ue),ye)},m.vc=function(ue,ye,Ae){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(Y(ue,Ae),ye)},m.Dc=function(ue){return!ue||ue.nodeType!==1&&ue.nodeType!==8?e:m.Td(ue)},m.Ec=function(ue){return(ue=m.Dc(ue))?ue.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(_){function w(z,V){var j=Object.prototype.hasOwnProperty.call(N,z)?N[z]:_,U;j?j.subscribe(V):(j=N[z]=new m.T,j.subscribe(V),D(z,function(q,Y){var te=!(!Y||!Y.synchronous);k[z]={definition:q,Gd:te},delete N[z],U||te?j.notifySubscribers(q):m.na.zb(function(){j.notifySubscribers(q)})}),U=!0)}function D(z,V){I("getConfig",[z],function(j){j?I("loadComponent",[z,j],function(U){V(U,j)}):V(null,null)})}function I(z,V,j,U){U||(U=m.j.loaders.slice(0));var q=U.shift();if(q){var Y=q[z];if(Y){var te=!1;if(Y.apply(q,V.concat(function(K){te?j(null):K!==null?j(K):I(z,V,j,U)}))!==_&&(te=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(z,V,j,U)}else j(null)}var N={},k={};m.j={get:function(z,V){var j=Object.prototype.hasOwnProperty.call(k,z)?k[z]:_;j?j.Gd?m.u.G(function(){V(j.definition)}):m.na.zb(function(){V(j.definition)}):w(z,V)},Bc:function(z){delete k[z]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(j,U,q,Y){function te(){--Z===0&&Y(K)}var K={},Z=2,ee=q.template;q=q.viewModel,ee?N(U,ee,function(me){m.j.oc("loadTemplate",[j,me],function(Te){K.template=Te,te()})}):te(),q?N(U,q,function(me){m.j.oc("loadViewModel",[j,me],function(Te){K[V]=Te,te()})}):te()}function w(j,U,q){if(typeof U=="function")q(function(te){return new U(te)});else if(typeof U[V]=="function")q(U[V]);else if("instance"in U){var Y=U.instance;q(function(){return Y})}else"viewModel"in U?w(j,U.viewModel,q):j("Unknown viewModel value: "+U)}function D(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(I(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function I(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,U,q){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),q(Y)}):j("Uses require, but no AMD loader is present"):q(U)}function k(j){return function(U){throw Error("Component '"+j+"': "+U)}}var z={};m.j.register=function(j,U){if(!U)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");z[j]=U},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(z,j)},m.j.unregister=function(j){delete z[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,U){U(m.j.tb(j)?z[j]:null)},loadComponent:function(j,U,q){var Y=k(j);N(Y,U,function(te){_(j,Y,te,q)})},loadTemplate:function(j,U,q){if(j=k(j),typeof U=="string")q(m.a.ua(U));else if(U instanceof Array)q(U);else if(I(U))q(m.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)q(D(U));else if(typeof U=="string"){var Y=n.getElementById(U);Y?q(D(Y)):j("Cannot find element with ID "+U)}else j("Unknown element type: "+U);else j("Unknown template value: "+U)},loadViewModel:function(j,U,q){w(k(j),U,q)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=z}(),function(){function _(D,I){var N=D.getAttribute("params");if(N){var N=w.parseBindingsString(N,I,D,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(V){return m.o(V,null,{l:D})}),k=m.a.Ga(N,function(V){var j=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(j)&&function(U){V()(U)},l:D}):j});return Object.prototype.hasOwnProperty.call(k,"$raw")||(k.$raw=N),k}return{$raw:{}}}m.j.getComponentNameForNode=function(D){var I=m.a.R(D);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+D=="[object HTMLUnknownElement]"||8>=m.a.W&&D.tagName===I))return I},m.j.tc=function(D,I,N,k){if(I.nodeType===1){var z=m.j.getComponentNameForNode(I);if(z){if(D=D||{},D.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:z,params:_(I,N)};D.component=k?function(){return V}:V}}return D};var w=new m.ga;9>m.a.W&&(m.j.register=function(D){return function(I){return D.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(D){return function(){var I=D(),N=m.j.dd,k;for(k in N);return I}}(n.createDocumentFragment))}(),function(){function _(I,N,k){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(k,I)}function w(I,N,k){var z=I.createViewModel;return z?z.call(I,N,k):N}var D=0;m.c.component={init:function(I,N,k,z,V){function j(){var K=U&&U.dispose;typeof K=="function"&&K.call(U),Y&&Y.s(),q=U=Y=null}var U,q,Y,te=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,j),m.o(function(){var K=m.a.f(N()),Z,ee;if(typeof K=="string"?Z=K:(Z=m.a.f(K.name),ee=m.a.f(K.params)),!Z)throw Error("No component name specified");var me=m.i.Cb(I,V),Te=q=++D;m.j.get(Z,function(ue){if(q===Te){if(j(),!ue)throw Error("Unknown component '"+Z+"'");_(Z,ue,I);var ye=w(ue,ee,{element:I,templateNodes:te});ue=me.createChildContext(ye,{extend:function(Ae){Ae.$component=ye,Ae.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(Y=m.i.subscribe(I,m.i.pa,ye.koDescendantsComplete,ye)),U=ye,m.Oa(ue,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};m.c.attr={update:function(_,w){var D=m.a.f(w())||{};m.a.P(D,function(I,N){N=m.a.f(N);var k=I.indexOf(":"),k="lookupNamespaceURI"in _&&0<k&&_.lookupNamespaceURI(I.substr(0,k)),z=N===!1||N===null||N===e;z?k?_.removeAttributeNS(k,I):_.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in L?(I=L[I],z?_.removeAttribute(I):_[I]=N):z||(k?_.setAttributeNS(k,I,N):_.setAttribute(I,N)),I==="name"&&m.a.Yc(_,z?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(_,w,D){function I(){var K=_.checked,Z=k();if(!m.S.Ya()&&(K||!V&&!m.S.qa())){var ee=m.u.G(w);if(U){var me=q?ee.v():ee,Te=te;te=Z,Te!==Z?K&&(m.a.Na(me,Z,!0),m.a.Na(me,Te,!1)):m.a.Na(me,Z,K),q&&m.Za(ee)&&ee(me)}else z&&(Z===e?Z=K:K||(Z=e)),m.m.eb(ee,D,"checked",Z,!0)}}function N(){var K=m.a.f(w()),Z=k();U?(_.checked=0<=m.a.A(K,Z),te=Z):_.checked=z&&Z===e?!!K:k()===K}var k=m.xb(function(){if(D.has("checkedValue"))return m.a.f(D.get("checkedValue"));if(Y)return D.has("value")?m.a.f(D.get("value")):_.value}),z=_.type=="checkbox",V=_.type=="radio";if(z||V){var j=w(),U=z&&m.a.f(j)instanceof Array,q=!(U&&j.push&&j.splice),Y=V||U,te=U?k():e;V&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,w){_.value=m.a.f(w())}}}(),m.c.class={update:function(_,w){var D=m.a.Db(m.a.f(w()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=D,m.a.Eb(_,D,!0)}},m.c.css={update:function(_,w){var D=m.a.f(w());D!==null&&typeof D=="object"?m.a.P(D,function(I,N){N=m.a.f(N),m.a.Eb(_,I,N)}):m.c.class.update(_,w)}},m.c.enable={update:function(_,w){var D=m.a.f(w());D&&_.disabled?_.removeAttribute("disabled"):D||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,w){m.c.enable.update(_,function(){return!m.a.f(w())})}},m.c.event={init:function(_,w,D,I,N){var k=w()||{};m.a.P(k,function(z){typeof z=="string"&&m.a.B(_,z,function(V){var j,U=w()[z];if(U){try{var q=m.a.la(arguments);I=N.$data,q.unshift(I),j=U.apply(I,q)}finally{j!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}D.get(z+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var w=_(),D=m.a.bc(w);return!D||typeof D.length=="number"?{foreach:w,templateEngine:m.ba.Ma}:(m.a.f(w),{foreach:D.data,as:D.as,noChildContext:D.noChildContext,includeDestroyed:D.includeDestroyed,afterAdd:D.afterAdd,beforeRemove:D.beforeRemove,afterRender:D.afterRender,beforeMove:D.beforeMove,afterMove:D.afterMove,templateEngine:m.ba.Ma})}},init:function(_,w){return m.c.template.init(_,m.c.foreach.Rc(w))},update:function(_,w,D,I,N){return m.c.template.update(_,m.c.foreach.Rc(w),D,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,w,D){function I(z){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var j;try{j=V.activeElement}catch{j=V.body}z=j===_}V=w(),m.m.eb(V,D,"hasfocus",z,!0),_.__ko_hasfocusLastValue=z,_.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),k=I.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",k),m.a.B(_,"focusout",k),_.__ko_hasfocusLastValue=!1},update:function(_,w){var D=!!m.a.f(w());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===D||(D?_.focus():_.blur(),!D&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,D?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.fc(_,w())}},function(){function _(w,D,I){m.c[w]={init:function(N,k,z,V,j){var U,q,Y={},te,K,Z;if(D){V=z.get("as");var ee=z.get("noChildContext");Z=!(V&&ee),Y={as:V,noChildContext:ee,exportDependencies:Z}}return K=(te=z.get("completeOn")=="render")||z.has(m.i.pa),m.o(function(){var me=m.a.f(k()),Te=!I!=!me,ue=!q,ye;(Z||Te!==U)&&(K&&(j=m.i.Cb(N,j)),Te&&((!D||Z)&&(Y.dataDependency=m.S.o()),ye=D?j.createChildContext(typeof me=="function"?me:k,Y):m.S.qa()?j.extend(null,Y):j),ue&&m.S.qa()&&(q=m.a.Ca(m.h.childNodes(N),!0)),Te?(ue||m.h.va(N,m.a.Ca(q)),m.Oa(ye,N)):(m.h.Ea(N),te||m.i.ma(N,m.i.H)),U=Te)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[w]=!1,m.h.ea[w]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,w,D,I,N){return w=N.extend(w),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var F={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,w,D){function I(){return m.a.jb(_.options,function(ee){return ee.selected})}function N(ee,me,Te){var ue=typeof me;return ue=="function"?me(ee):ue=="string"?ee[me]:Te}function k(ee,me){if(K&&U)m.i.ma(_,m.i.H);else if(te.length){var Te=0<=m.a.A(te,m.w.M(me[0]));m.a.Zc(me[0],Te),K&&!Te&&m.u.G(m.a.Fb,null,[_,"change"])}}var z=_.multiple,V=_.length!=0&&z?_.scrollTop:null,j=m.a.f(w()),U=D.get("valueAllowUnset")&&D.has("value"),q=D.get("optionsIncludeDestroyed");w={};var Y,te=[];U||(z?te=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&te.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),Y=m.a.jb(j,function(ee){return q||ee===e||ee===null||!m.a.f(ee._destroy)}),D.has("optionsCaption")&&(j=m.a.f(D.get("optionsCaption")),j!==null&&j!==e&&Y.unshift(F)));var K=!1;if(w.beforeRemove=function(ee){_.removeChild(ee)},j=k,D.has("optionsAfterRender")&&typeof D.get("optionsAfterRender")=="function"&&(j=function(ee,me){k(0,me),m.u.G(D.get("optionsAfterRender"),null,[me[0],ee!==F?ee:e])}),m.a.ec(_,Y,function(ee,me,Te){return Te.length&&(te=!U&&Te[0].selected?[m.w.M(Te[0])]:[],K=!0),me=_.ownerDocument.createElement("option"),ee===F?(m.a.Bb(me,D.get("optionsCaption")),m.w.cb(me,e)):(Te=N(ee,D.get("optionsValue"),ee),m.w.cb(me,m.a.f(Te)),ee=N(ee,D.get("optionsText"),Te),m.a.Bb(me,ee)),[me]},w,j),!U){var Z;z?Z=te.length&&I().length<te.length:Z=te.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==te[0]:te.length||0<=_.selectedIndex,Z&&m.u.G(m.a.Fb,null,[_,"change"])}(U||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,w,D){function I(){var z=w(),V=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&V.push(m.w.M(j))}),m.m.eb(z,D,"selectedOptions",V)}function N(){var z=m.a.f(w()),V=_.scrollTop;z&&typeof z.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var U=0<=m.a.A(z,m.w.M(j));j.selected!=U&&m.a.Zc(j,U)}),_.scrollTop=V}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var k;m.i.subscribe(_,m.i.H,function(){k?I():(m.a.B(_,"change",I),k=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,w){var D=m.a.f(w()||{});m.a.P(D,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(_).css(I,N);else if(/^--/.test(I))_.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(z,V){return V.toUpperCase()});var k=_.style[I];_.style[I]=N,N===k||_.style[I]!=k||isNaN(N)||(_.style[I]=N+"px")}})}},m.c.submit={init:function(_,w,D,I,N){if(typeof w()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(k){var z,V=w();try{z=V.call(N.$data,_)}finally{z!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.Bb(_,w())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(Y){if(Y)return parseFloat(Y[1])},w=t.navigator.userAgent,D,I,N,k,z;(D=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(z=_(w.match(/Edge\/([^ ]+)$/)))||_(w.match(/Chrome\/([^ ]+)/))||(I=_(w.match(/Version\/([^ ]+) Safari/)))||(N=_(w.match(/Firefox\/([^ ]+)/)))||(k=m.a.W||_(w.match(/MSIE ([^ ]+)/)))||(k=_(w.match(/rv:([^ )]+)/)))}if(8<=k&&10>k)var V=m.a.g.Z(),j=m.a.g.Z(),U=function(Y){var te=this.activeElement;(te=te&&m.a.g.get(te,j))&&te(Y)},q=function(Y,te){var K=Y.ownerDocument;m.a.g.get(K,V)||(m.a.g.set(K,V,!0),m.a.B(K,"selectionchange",U)),m.a.g.set(Y,j,te)};m.c.textInput={init:function(Y,te,K){function Z(ze,qe){m.a.B(Y,ze,qe)}function ee(){var ze=m.a.f(te());(ze===null||ze===e)&&(ze=""),Ae!==e&&ze===Ae?m.a.setTimeout(ee,4):Y.value!==ze&&(Ee=!0,Y.value=ze,Ee=!1,ue=Y.value)}function me(){ye||(Ae=Y.value,ye=m.a.setTimeout(Te,4))}function Te(){clearTimeout(ye),Ae=ye=e;var ze=Y.value;ue!==ze&&(ue=ze,m.m.eb(te(),K,"textInput",ze))}var ue=Y.value,ye,Ae,Pe=m.a.W==9?me:Te,Ee=!1;k&&Z("keypress",Te),11>k&&Z("propertychange",function(ze){Ee||ze.propertyName!=="value"||Pe(ze)}),k==8&&(Z("keyup",Te),Z("keydown",Te)),q&&(q(Y,Pe),Z("dragend",me)),(!k||9<=k)&&Z("input",Pe),5>I&&m.a.R(Y)==="textarea"?(Z("keydown",me),Z("paste",me),Z("cut",me)):11>D?Z("keydown",me):4>N?(Z("DOMAutoComplete",Te),Z("dragdrop",Te),Z("drop",Te)):z&&Y.type==="number"&&Z("keydown",me),Z("change",Te),Z("blur",Te),m.o(ee,null,{l:Y})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(Y,te,K){K("textInput",Y)}}}(),m.c.uniqueName={init:function(_,w){if(w()){var D="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,D)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,w,D,I,N){var k;return D.has("as")&&(k={as:D.get("as"),noChildContext:D.get("noChildContext")}),w=N.createChildContext(w,k),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,w,D){var I=m.a.R(_),N=I=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var k=[],z=D.get("valueUpdate"),V=!1,j=null;z&&(typeof z=="string"?k=[z]:k=m.a.wc(z),m.a.Pa(k,"change"));var U=function(){j=null,V=!1;var te=w(),K=m.w.M(_);m.m.eb(te,D,"value",K)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(k,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){V=!0}),m.a.B(_,"focus",function(){V=!1}),m.a.B(_,"blur",function(){V&&U()})),m.a.D(k,function(te){var K=U;m.a.Ud(te,"after")&&(K=function(){j=m.w.M(_),m.a.setTimeout(U,0)},te=te.substring(5)),m.a.B(_,te,K)});var q;if(q=N&&_.type=="file"?function(){var te=m.a.f(w());te===null||te===e||te===""?_.value="":m.u.G(U)}:function(){var te=m.a.f(w()),K=m.w.M(_);j!==null&&te===j?m.a.setTimeout(q,0):(te!==K||K===e)&&(I==="select"?(K=D.get("valueAllowUnset"),m.w.cb(_,te,K),K||te===m.w.M(_)||m.u.G(U)):m.w.cb(_,te))},I==="select"){var Y;m.i.subscribe(_,m.i.H,function(){Y?D.get("valueAllowUnset")?q():U():(m.a.B(_,"change",U),Y=m.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",U),m.o(q,null,{l:_})}else m.ib(_,{checkedValue:w})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,w){var D=m.a.f(w()),I=_.style.display!="none";D&&!I?_.style.display="":!D&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,w){m.c.visible.update(_,function(){return!m.a.f(w())})}},function(_){m.c[_]={init:function(w,D,I,N,k){return m.c.event.init.call(this,w,function(){var z={};return z[_]=D(),z},I,N,k)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,w){if(typeof _=="string"){w=w||n;var D=w.getElementById(_);if(!D)throw Error("Cannot find template with ID "+_);return new m.C.F(D)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,w,D,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,w,D,I)},m.ca.prototype.isTemplateRewritten=function(_,w){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,w).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,w,D){_=this.makeTemplateSource(_,D),w=w(_.text()),_.text(w),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(I,N,k,z){I=m.m.ac(I);for(var V=m.m.Ra,j=0;j<I.length;j++){var U=I[j].key;if(Object.prototype.hasOwnProperty.call(V,U)){var q=V[U];if(typeof q=="function"){if(U=q(I[j].value))throw Error(U)}else if(!q)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return k="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+k.toLowerCase()+"')",z.createJavaScriptEvaluatorBlock(k)+N}var w=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,D=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,k){N.isTemplateRewritten(I,k)||N.rewriteTemplate(I,function(z){return m.kc.Ld(z,N)},k)},Ld:function(I,N){return I.replace(w,function(k,z,V,j,U){return _(U,z,V,N)}).replace(D,function(k,z){return _(z,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(k,z){var V=k.nextSibling;V&&V.nodeName.toLowerCase()===N&&m.ib(V,I,z)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(D){if(this.F=D){var I=m.a.R(D);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&D.content&&D.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var D=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[D];var I=arguments[0];D==="innerHTML"?m.a.fc(this.F,I):this.F[D]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(D){if(arguments.length===1)return m.a.g.get(this.F,_+D);m.a.g.set(this.F,_+D,arguments[1])};var w=m.a.g.Z();m.C.F.prototype.nodes=function(){var D=this.F;if(arguments.length==0){var I=m.a.g.get(D,w)||{},N=I.lb||(this.ab===3?D.content:this.ab===4?D:e);if(!N||I.jd){var k=this.text();k&&k!==I.bb&&(N=m.a.Md(k,D.ownerDocument),m.a.g.set(D,w,{lb:N,bb:k,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(D,w,{lb:I})},m.C.ia=function(D){this.F=D},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var D=m.a.g.get(this.F,w)||{};return D.bb===e&&D.lb&&(D.bb=D.lb.innerHTML),D.bb}m.a.g.set(this.F,w,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(j,U,q){var Y;for(U=m.h.nextSibling(U);j&&(Y=j)!==U;)j=m.h.nextSibling(Y),q(Y,j)}function w(j,U){if(j.length){var q=j[0],Y=j[j.length-1],te=q.parentNode,K=m.ga.instance,Z=K.preprocessNode;if(Z){if(_(q,Y,function(ee,me){var Te=ee.previousSibling,ue=Z.call(K,ee);ue&&(ee===q&&(q=ue[0]||me),ee===Y&&(Y=ue[ue.length-1]||Te))}),j.length=0,!q)return;q===Y?j.push(q):(j.push(q,Y),m.a.Ua(j,te))}_(q,Y,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.vc(U,ee)}),_(q,Y,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.aa.cd(ee,[U])}),m.a.Ua(j,te)}}function D(j){return j.nodeType?j:0<j.length?j[0]:null}function I(j,U,q,Y,te){te=te||{};var K=(j&&D(j)||q||{}).ownerDocument,Z=te.templateEngine||k;if(m.kc.xd(q,Z,K),q=Z.renderTemplate(q,Y,te,K),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(K=!1,U){case"replaceChildren":m.h.va(j,q),K=!0;break;case"replaceNode":m.a.Xc(j,q),K=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return K&&(w(q,Y),te.afterRender&&m.u.G(te.afterRender,null,[q,Y[te.as||"$data"]]),U=="replaceChildren"&&m.i.ma(j,m.i.H)),q}function N(j,U,q){return m.O(j)?j():typeof j=="function"?j(U,q):j}var k;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");k=j},m.dc=function(j,U,q,Y,te){if(q=q||{},(q.templateEngine||k)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",Y){var K=D(Y);return m.$(function(){var ee=U&&U instanceof m.fa?U:new m.fa(U,null,null,null,{exportDependencies:!0}),Z=N(j,ee.$data,ee),ee=I(Y,te,Z,ee,q);te=="replaceNode"&&(Y=ee,K=D(Y))},null,{Sa:function(){return!K||!m.a.Sb(K)},l:K&&te=="replaceNode"?K.parentNode:K})}return m.aa.Xb(function(Z){m.dc(j,U,q,Z,"replaceNode")})},m.Qd=function(j,U,q,Y,te){function K(Ae,Pe){m.u.G(m.a.ec,null,[Y,Ae,ee,q,Z,Pe]),m.i.ma(Y,m.i.H)}function Z(Ae,Pe){w(Pe,me),q.afterRender&&q.afterRender(Pe,Ae),me=null}function ee(Ae,Pe){me=te.createChildContext(Ae,{as:Te,noChildContext:q.noChildContext,extend:function(ze){ze.$index=Pe,Te&&(ze[Te+"Index"]=Pe)}});var Ee=N(j,Ae,me);return I(Y,"ignoreTargetNode",Ee,me,q)}var me,Te=q.as,ue=q.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!q.includeDestroyed;if(ue||q.beforeRemove||!m.Pc(U))return m.$(function(){var Ae=m.a.f(U)||[];typeof Ae.length>"u"&&(Ae=[Ae]),ue&&(Ae=m.a.jb(Ae,function(Pe){return Pe===e||Pe===null||!m.a.f(Pe._destroy)})),K(Ae)},null,{l:Y});K(U.v());var ye=U.subscribe(function(Ae){K(U(),Ae)},null,"arrayChange");return ye.l(Y),ye};var z=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(j,U){var q=m.a.f(U());if(typeof q=="string"||"name"in q)m.h.Ea(j);else if("nodes"in q){if(q=q.nodes||[],m.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=q[0]&&q[0].parentNode;Y&&m.a.g.get(Y,V)||(Y=m.a.Yb(q),m.a.g.set(Y,V,!0)),new m.C.ia(j).nodes(Y)}else if(q=m.h.childNodes(j),0<q.length)Y=m.a.Yb(q),new m.C.ia(j).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,U,q,Y,te){var K=U();U=m.a.f(K),q=!0,Y=null,typeof U=="string"?U={}:(K="name"in U?U.name:j,"if"in U&&(q=m.a.f(U.if)),q&&"ifnot"in U&&(q=!m.a.f(U.ifnot)),q&&!K&&(q=!1)),"foreach"in U?Y=m.Qd(K,q&&U.foreach||[],U,j,te):q?(q=te,"data"in U&&(q=te.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),Y=m.dc(K,q,U,j)):m.h.Ea(j),te=Y,(U=m.a.g.get(j,z))&&typeof U.s=="function"&&U.s(),m.a.g.set(j,z,!te||te.ja&&!te.ja()?e:te)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,w,D){if(_.length&&w.length){var I,N,k,z,V;for(I=N=0;(!D||I<D)&&(z=_[N]);++N){for(k=0;V=w[k];++k)if(z.value===V.value){z.moved=V.index,V.moved=z.index,w.splice(k,1),I=k=0;break}I+=k}}},m.a.Pb=function(){function _(w,D,I,N,k){var z=Math.min,V=Math.max,j=[],U,q=w.length,Y,te=D.length,K=te-q||1,Z=q+te+1,ee,me,Te;for(U=0;U<=q;U++)for(me=ee,j.push(ee=[]),Te=z(te,U+K),Y=V(0,U-1);Y<=Te;Y++)ee[Y]=Y?U?w[U-1]===D[Y-1]?me[Y-1]:z(me[Y]||Z,ee[Y-1]||Z)+1:Y+1:U+1;for(z=[],V=[],K=[],U=q,Y=te;U||Y;)te=j[U][Y]-1,Y&&te===j[U][Y-1]?V.push(z[z.length]={status:I,value:D[--Y],index:Y}):U&&te===j[U-1][Y]?K.push(z[z.length]={status:N,value:w[--U],index:U}):(--Y,--U,k.sparse||z.push({status:"retained",value:D[Y]}));return m.a.Kc(K,V,!k.dontLimitMoves&&10*q),z.reverse()}return function(w,D,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},w=w||[],D=D||[],w.length<D.length?_(w,D,"added","deleted",I):_(D,w,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(I,N,k,z,V){var j=[],U=m.$(function(){var q=N(k,V,m.a.Ua(j,I))||[];0<j.length&&(m.a.Xc(j,q),z&&m.u.G(z,null,[k,q,V])),j.length=0,m.a.Nb(j,q)},null,{l:I,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:U.ja()?U:e}}var w=m.a.g.Z(),D=m.a.g.Z();m.a.ec=function(I,N,k,z,V,j){function U(Ct){Ee={Aa:Ct,pb:m.ta(me++)},Z.push(Ee),K||Pe.push(Ee)}function q(Ct){Ee=te[Ct],me!==Ee.pb.v()&&Ae.push(Ee),Ee.pb(me++),m.a.Ua(Ee.Y,I),Z.push(Ee)}function Y(Ct,Ei){if(Ct)for(var an=0,_e=Ei.length;an<_e;an++)m.a.D(Ei[an].Y,function(Ce){Ct(Ce,an,Ei[an].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),z=z||{};var te=m.a.g.get(I,w),K=!te,Z=[],ee=0,me=0,Te=[],ue=[],ye=[],Ae=[],Pe=[],Ee,ze=0;if(K)m.a.D(N,U);else{if(!j||te&&te._countWaitingForRemove){var qe=m.a.Mb(te,function(Ct){return Ct.Aa});j=m.a.Pb(qe,N,{dontLimitMoves:z.dontLimitMoves,sparse:!0})}for(var qe=0,it,Dt,jt;it=j[qe];qe++)switch(Dt=it.moved,jt=it.index,it.status){case"deleted":for(;ee<jt;)q(ee++);Dt===e&&(Ee=te[ee],Ee.$&&(Ee.$.s(),Ee.$=e),m.a.Ua(Ee.Y,I).length&&(z.beforeRemove&&(Z.push(Ee),ze++,Ee.Aa===D?Ee=null:ye.push(Ee)),Ee&&Te.push.apply(Te,Ee.Y))),ee++;break;case"added":for(;me<jt;)q(ee++);Dt!==e?(ue.push(Z.length),q(Dt)):U(it.value)}for(;me<N.length;)q(ee++);Z._countWaitingForRemove=ze}m.a.g.set(I,w,Z),Y(z.beforeMove,Ae),m.a.D(Te,z.beforeRemove?m.oa:m.removeNode);var $e,un,zt;try{zt=I.ownerDocument.activeElement}catch{}if(ue.length)for(;(qe=ue.shift())!=e;){for(Ee=Z[qe],$e=e;qe;)if((un=Z[--qe].Y)&&un.length){$e=un[un.length-1];break}for(N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e)}for(qe=0;Ee=Z[qe];qe++){for(Ee.Y||m.a.extend(Ee,_(I,k,Ee.Aa,V,Ee.pb)),N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e);!Ee.Ed&&V&&(V(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,$e=Ee.Y[Ee.Y.length-1])}for(zt&&I.ownerDocument.activeElement!=zt&&zt.focus(),Y(z.beforeRemove,ye),qe=0;qe<ye.length;++qe)ye[qe].Aa=D;Y(z.afterMove,Ae),Y(z.afterAdd,Pe)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,w,D,I){return(w=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(w.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var w=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(D,I,N,k){if(k=k||n,N=N||{},2>w)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var z=D.data("precompiled");return z||(z=D.text()||"",z=o.template(null,"{{ko_with $item.koBindingContext}}"+z+"{{/ko_with}}"),D.data("precompiled",z)),D=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(z,D,I),I.appendTo(k.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(D){return"{{ko_code ((function() { return "+D+" })()) }}"},this.addTemplate=function(D,I){n.write("<script type='text/html' id='"+D+"'>"+I+"</script>")},0<w&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var Owt=ko;typeof window<"u"?(ko=window.ko,typeof vk<"u"?window.ko=vk:delete window.ko):(ko=global.ko,typeof vk<"u"?global.ko=vk:delete global.ko);var GA=Owt;/** +Message: `+k.message,k}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function _(fe){var xe=(fe=m.a.g.get(fe,Ae))&&fe.N;xe&&(fe.N=null,xe.Tc())}function C(fe,xe,ge){this.node=fe,this.yc=xe,this.kb=[],this.H=!1,xe.N||m.a.K.za(fe,_),ge&&ge.N&&(ge.N.kb.push(fe),this.Kb=ge)}function w(fe){return function(){return fe}}function P(fe){return fe()}function M(fe){return m.a.Ga(m.u.G(fe),function(xe,ge){return function(){return fe()[ge]}})}function F(fe,xe,ge){return typeof fe=="function"?M(fe.bind(null,xe,ge)):m.a.Ga(fe,w)}function V(fe,xe){return M(this.getBindings.bind(this,fe,xe))}function B(fe,xe){var ge=m.h.firstChild(xe);if(ge){var we,Se=m.ga.instance,Re=Se.preprocessNode;if(Re){for(;we=ge;)ge=m.h.nextSibling(we),Re.call(Se,we);ge=m.h.firstChild(xe)}for(;we=ge;)ge=m.h.nextSibling(we),j(fe,we)}m.i.ma(xe,m.i.H)}function j(fe,xe){var ge=fe,we=xe.nodeType===1;we&&m.h.Sc(xe),(we||m.ga.instance.nodeHasBindings(xe))&&(ge=G(xe,null,fe).bindingContextForDescendants),ge&&!Z[m.a.R(xe)]&&B(ge,xe)}function k(fe){var xe=[],ge={},we=[];return m.a.P(fe,function Se(Re){if(!ge[Re]){var Qe=m.getBindingHandler(Re);Qe&&(Qe.after&&(we.push(Re),m.a.D(Qe.after,function(He){if(fe[He]){if(m.a.A(we,He)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+we.join(", "));Se(He)}}),we.length--),xe.push({key:Re,Mc:Qe})),ge[Re]=!0}}),xe}function G(fe,xe,ge){var we=m.a.g.Ub(fe,Ae,{}),Se=we.hd;if(!xe){if(Se)throw Error("You cannot apply bindings multiple times to the same element.");we.hd=!0}Se||(we.context=ge),we.Zb||(we.Zb={});var Re;if(xe&&typeof xe!="function")Re=xe;else{var Qe=m.ga.instance,He=Qe.getBindingAccessors||V,Xe=m.$(function(){return(Re=xe?xe(ge,fe):He.call(Qe,fe,ge))&&(ge[Q]&&ge[Q](),ge[J]&&ge[J]()),Re},null,{l:fe});Re&&Xe.ja()||(Xe=null)}var $e=ge,Pe;if(Re){var qe=function(){return m.a.Ga(Xe?Xe():Re,P)},st=Xe?function(vt){return function(){return P(Xe()[vt])}}:function(vt){return Re[vt]};qe.get=function(vt){return Re[vt]&&P(st(vt))},qe.has=function(vt){return vt in Re},m.i.H in Re&&m.i.subscribe(fe,m.i.H,function(){var vt=(0,Re[m.i.H])();if(vt){var Gt=m.h.childNodes(fe);Gt.length&&vt(Gt,m.Ec(Gt[0]))}}),m.i.pa in Re&&($e=m.i.Cb(fe,ge),m.i.subscribe(fe,m.i.pa,function(){var vt=(0,Re[m.i.pa])();vt&&m.h.firstChild(fe)&&vt(fe)})),we=k(Re),m.a.D(we,function(vt){var Gt=vt.Mc.init,lt=vt.Mc.update,mt=vt.key;if(fe.nodeType===8&&!m.h.ea[mt])throw Error("The binding '"+mt+"' cannot be used with virtual elements");try{typeof Gt=="function"&&m.u.G(function(){var ft=Gt(fe,st(mt),qe,$e.$data,$e);if(ft&&ft.controlsDescendantBindings){if(Pe!==e)throw Error("Multiple bindings ("+Pe+" and "+mt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Pe=mt}}),typeof lt=="function"&&m.$(function(){lt(fe,st(mt),qe,$e.$data,$e)},null,{l:fe})}catch(ft){throw ft.message='Unable to process binding "'+mt+": "+Re[mt]+`" +Message: `+ft.message,ft}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&$e}}function q(fe,xe){return fe&&fe instanceof m.fa?fe:new m.fa(fe,e,e,xe)}var Q=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(fe){return m.c[fe]};var ae={};m.fa=function(fe,xe,ge,we,Se){function Re(){var st=$e?Xe():Xe,vt=m.a.f(st);return xe?(m.a.extend(Qe,xe),W in xe&&(Qe[W]=xe[W])):(Qe.$parents=[],Qe.$root=vt,Qe.ko=m),Qe[Q]=Pe,He?vt=Qe.$data:(Qe.$rawData=st,Qe.$data=vt),ge&&(Qe[ge]=vt),we&&we(Qe,xe,vt),xe&&xe[Q]&&!m.S.o().Vb(xe[Q])&&xe[Q](),qe&&(Qe[J]=qe),Qe.$data}var Qe=this,He=fe===ae,Xe=He?e:fe,$e=typeof Xe=="function"&&!m.O(Xe),Pe,qe=Se&&Se.dataDependency;Se&&Se.exportDependencies?Re():(Pe=m.xb(Re),Pe.v(),Pe.ja()?Pe.equalityComparer=null:Qe[Q]=e)},m.fa.prototype.createChildContext=function(fe,xe,ge,we){if(!we&&xe&&typeof xe=="object"&&(we=xe,xe=we.as,ge=we.extend),xe&&we&&we.noChildContext){var Se=typeof fe=="function"&&!m.O(fe);return new m.fa(ae,this,null,function(Re){ge&&ge(Re),Re[xe]=Se?fe():fe},we)}return new m.fa(fe,this,xe,function(Re,Qe){Re.$parentContext=Qe,Re.$parent=Qe.$data,Re.$parents=(Qe.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),ge&&ge(Re)},we)},m.fa.prototype.extend=function(fe,xe){return new m.fa(ae,this,null,function(ge){m.a.extend(ge,typeof fe=="function"?fe(ge):fe)},xe)};var Ae=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(fe){m.a.Pa(this.kb,fe),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(fe,xe,ge,we,Se){var Re=m.a.g.Ub(fe,Ae,{});return Re.Fa||(Re.Fa=new m.T),Se&&Se.notifyImmediately&&Re.Zb[xe]&&m.u.G(ge,we,[fe]),Re.Fa.subscribe(ge,we,xe)},ma:function(fe,xe){var ge=m.a.g.get(fe,Ae);if(ge&&(ge.Zb[xe]=!0,ge.Fa&&ge.Fa.notifySubscribers(fe,xe),xe==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(fe,xe){var ge=m.a.g.Ub(fe,Ae,{});return ge.N||(ge.N=new C(fe,ge,xe[W])),xe[W]==ge?xe:xe.extend(function(we){we[W]=ge})}},m.Td=function(fe){return(fe=m.a.g.get(fe,Ae))&&fe.context},m.ib=function(fe,xe,ge){return fe.nodeType===1&&m.h.Sc(fe),G(fe,xe,q(ge))},m.ld=function(fe,xe,ge){return ge=q(ge),m.ib(fe,F(xe,ge,fe),ge)},m.Oa=function(fe,xe){xe.nodeType!==1&&xe.nodeType!==8||B(q(fe),xe)},m.vc=function(fe,xe,ge){if(!r&&t.jQuery&&(r=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");j(q(fe,ge),xe)},m.Dc=function(fe){return!fe||fe.nodeType!==1&&fe.nodeType!==8?e:m.Td(fe)},m.Ec=function(fe){return(fe=m.Dc(fe))?fe.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(V,B){var j=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,k;j?j.subscribe(B):(j=M[V]=new m.T,j.subscribe(B),w(V,function(G,q){var Q=!(!q||!q.synchronous);F[V]={definition:G,Gd:Q},delete M[V],k||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),k=!0)}function w(V,B){P("getConfig",[V],function(j){j?P("loadComponent",[V,j],function(k){B(k,j)}):B(null,null)})}function P(V,B,j,k){k||(k=m.j.loaders.slice(0));var G=k.shift();if(G){var q=G[V];if(q){var Q=!1;if(q.apply(G,B.concat(function(W){Q?j(null):W!==null?j(W):P(V,B,j,k)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else P(V,B,j,k)}else j(null)}var M={},F={};m.j={get:function(V,B){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){B(j.definition)}):m.na.zb(function(){B(j.definition)}):C(V,B)},Bc:function(V){delete F[V]},oc:P},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,k,G,q){function Q(){--J===0&&q(W)}var W={},J=2,Z=G.template;G=G.viewModel,Z?M(k,Z,function(ae){m.j.oc("loadTemplate",[j,ae],function(Ae){W.template=Ae,Q()})}):Q(),G?M(k,G,function(ae){m.j.oc("loadViewModel",[j,ae],function(Ae){W[B]=Ae,Q()})}):Q()}function C(j,k,G){if(typeof k=="function")G(function(Q){return new k(Q)});else if(typeof k[B]=="function")G(k[B]);else if("instance"in k){var q=k.instance;G(function(){return q})}else"viewModel"in k?C(j,k.viewModel,G):j("Unknown viewModel value: "+k)}function w(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(P(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function P(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function M(j,k,G){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),G(q)}):j("Uses require, but no AMD loader is present"):G(k)}function F(j){return function(k){throw Error("Component '"+j+"': "+k)}}var V={};m.j.register=function(j,k){if(!k)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=k},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,k){k(m.j.tb(j)?V[j]:null)},loadComponent:function(j,k,G){var q=F(j);M(q,k,function(Q){_(j,q,Q,G)})},loadTemplate:function(j,k,G){if(j=F(j),typeof k=="string")G(m.a.ua(k));else if(k instanceof Array)G(k);else if(P(k))G(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)G(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?G(w(q)):j("Cannot find element with ID "+k)}else j("Unknown element type: "+k);else j("Unknown template value: "+k)},loadViewModel:function(j,k,G){C(F(j),k,G)}};var B="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=V})(),(function(){function _(w,P){var M=w.getAttribute("params");if(M){var M=C.parseBindingsString(M,P,w,{valueAccessors:!0,bindingParams:!0}),M=m.a.Ga(M,function(B){return m.o(B,null,{l:w})}),F=m.a.Ga(M,function(B){var j=B.v();return B.ja()?m.o({read:function(){return m.a.f(B())},write:m.Za(j)&&function(k){B()(k)},l:w}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=M),F}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var P=m.a.R(w);if(m.j.tb(P)&&(P.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===P))return P},m.j.tc=function(w,P,M,F){if(P.nodeType===1){var V=m.j.getComponentNameForNode(P);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var B={name:V,params:_(P,M)};w.component=F?function(){return B}:B}}return w};var C=new m.ga;9>m.a.W&&(m.j.register=(function(w){return function(P){return w.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(w){return function(){var P=w(),M=m.j.dd,F;for(F in M);return P}})(n.createDocumentFragment))})(),(function(){function _(P,M,F){if(M=M.template,!M)throw Error("Component '"+P+"' has no template");P=m.a.Ca(M),m.h.va(F,P)}function C(P,M,F){var V=P.createViewModel;return V?V.call(P,M,F):M}var w=0;m.c.component={init:function(P,M,F,V,B){function j(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),q&&q.s(),G=k=q=null}var k,G,q,Q=m.a.la(m.h.childNodes(P));return m.h.Ea(P),m.a.K.za(P,j),m.o(function(){var W=m.a.f(M()),J,Z;if(typeof W=="string"?J=W:(J=m.a.f(W.name),Z=m.a.f(W.params)),!J)throw Error("No component name specified");var ae=m.i.Cb(P,B),Ae=G=++w;m.j.get(J,function(fe){if(G===Ae){if(j(),!fe)throw Error("Unknown component '"+J+"'");_(J,fe,P);var xe=C(fe,Z,{element:P,templateNodes:Q});fe=ae.createChildContext(xe,{extend:function(ge){ge.$component=xe,ge.$componentTemplateNodes=Q}}),xe&&xe.koDescendantsComplete&&(q=m.i.subscribe(P,m.i.pa,xe.koDescendantsComplete,xe)),k=xe,m.Oa(fe,P)}})},null,{l:P}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var w=m.a.f(C())||{};m.a.P(w,function(P,M){M=m.a.f(M);var F=P.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(P.substr(0,F)),V=M===!1||M===null||M===e;V?F?_.removeAttributeNS(F,P):_.removeAttribute(P):M=M.toString(),8>=m.a.W&&P in O?(P=O[P],V?_.removeAttribute(P):_[P]=M):V||(F?_.setAttributeNS(F,P,M):_.setAttribute(P,M)),P==="name"&&m.a.Yc(_,V?"":M)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,w){function P(){var W=_.checked,J=F();if(!m.S.Ya()&&(W||!B&&!m.S.qa())){var Z=m.u.G(C);if(k){var ae=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?W&&(m.a.Na(ae,J,!0),m.a.Na(ae,Ae,!1)):m.a.Na(ae,J,W),G&&m.Za(Z)&&Z(ae)}else V&&(J===e?J=W:W||(J=e)),m.m.eb(Z,w,"checked",J,!0)}}function M(){var W=m.a.f(C()),J=F();k?(_.checked=0<=m.a.A(W,J),Q=J):_.checked=V&&J===e?!!W:F()===W}var F=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),V=_.type=="checkbox",B=_.type=="radio";if(V||B){var j=C(),k=V&&m.a.f(j)instanceof Array,G=!(k&&j.push&&j.splice),q=B||k,Q=k?F():e;B&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(P,null,{l:_}),m.a.B(_,"click",P),m.o(M,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var w=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,C){var w=m.a.f(C());w!==null&&typeof w=="object"?m.a.P(w,function(P,M){M=m.a.f(M),m.a.Eb(_,P,M)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var w=m.a.f(C());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,w,P,M){var F=C()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(B){var j,k=C()[V];if(k){try{var G=m.a.la(arguments);P=M.$data,G.unshift(P),j=k.apply(P,G)}finally{j!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}w.get(V+"Bubble")===!1&&(B.cancelBubble=!0,B.stopPropagation&&B.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),w=m.a.bc(C);return!w||typeof w.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,w,P,M){return m.c.template.update(_,m.c.foreach.Rc(C),w,P,M)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,w){function P(V){_.__ko_hasfocusUpdating=!0;var B=_.ownerDocument;if("activeElement"in B){var j;try{j=B.activeElement}catch{j=B.body}V=j===_}B=C(),m.m.eb(B,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=P.bind(null,!0),F=P.bind(null,!1);m.a.B(_,"focus",M),m.a.B(_,"focusin",M),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,C){var w=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,w,P){m.c[C]={init:function(M,F,V,B,j){var k,G,q={},Q,W,J;if(w){B=V.get("as");var Z=V.get("noChildContext");J=!(B&&Z),q={as:B,noChildContext:Z,exportDependencies:J}}return W=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ae=m.a.f(F()),Ae=!P!=!ae,fe=!G,xe;(J||Ae!==k)&&(W&&(j=m.i.Cb(M,j)),Ae&&((!w||J)&&(q.dataDependency=m.S.o()),xe=w?j.createChildContext(typeof ae=="function"?ae:F,q):m.S.qa()?j.extend(null,q):j),fe&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(M),!0)),Ae?(fe||m.h.va(M,m.a.Ca(G)),m.Oa(xe,M)):(m.h.Ea(M),Q||m.i.ma(M,m.i.H)),k=Ae)},null,{l:M}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,w,P,M){return C=M.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,w){function P(){return m.a.jb(_.options,function(Z){return Z.selected})}function M(Z,ae,Ae){var fe=typeof ae;return fe=="function"?ae(Z):fe=="string"?Z[ae]:Ae}function F(Z,ae){if(W&&k)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ae[0]));m.a.Zc(ae[0],Ae),W&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,B=_.length!=0&&V?_.scrollTop:null,j=m.a.f(C()),k=w.get("valueAllowUnset")&&w.has("value"),G=w.get("optionsIncludeDestroyed");C={};var q,Q=[];k||(V?Q=m.a.Mb(P(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),q=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),w.has("optionsCaption")&&(j=m.a.f(w.get("optionsCaption")),j!==null&&j!==e&&q.unshift(L)));var W=!1;if(C.beforeRemove=function(Z){_.removeChild(Z)},j=F,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(j=function(Z,ae){F(0,ae),m.u.G(w.get("optionsAfterRender"),null,[ae[0],Z!==L?Z:e])}),m.a.ec(_,q,function(Z,ae,Ae){return Ae.length&&(Q=!k&&Ae[0].selected?[m.w.M(Ae[0])]:[],W=!0),ae=_.ownerDocument.createElement("option"),Z===L?(m.a.Bb(ae,w.get("optionsCaption")),m.w.cb(ae,e)):(Ae=M(Z,w.get("optionsValue"),Z),m.w.cb(ae,m.a.f(Ae)),Z=M(Z,w.get("optionsText"),Ae),m.a.Bb(ae,Z)),[ae]},C,j),!k){var J;V?J=Q.length&&P().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),B&&20<Math.abs(B-_.scrollTop)&&(_.scrollTop=B)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,w){function P(){var V=C(),B=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&B.push(m.w.M(j))}),m.m.eb(V,w,"selectedOptions",B)}function M(){var V=m.a.f(C()),B=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var k=0<=m.a.A(V,m.w.M(j));j.selected!=k&&m.a.Zc(j,k)}),_.scrollTop=B}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?P():(m.a.B(_,"change",P),F=m.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var w=m.a.f(C()||{});m.a.P(w,function(P,M){if(M=m.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(P,M);else if(/^--/.test(P))_.style.setProperty(P,M);else{P=P.replace(/-(\w)/g,function(V,B){return B.toUpperCase()});var F=_.style[P];_.style[P]=M,M===F||_.style[P]!=F||isNaN(M)||(_.style[P]=M+"px")}})}},m.c.submit={init:function(_,C,w,P,M){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,B=C();try{V=B.call(M.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,w,P,M,F,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(P=_(C.match(/Version\/([^ ]+) Safari/)))||(M=_(C.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(F=_(C.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var B=m.a.g.Z(),j=m.a.g.Z(),k=function(q){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(q)},G=function(q,Q){var W=q.ownerDocument;m.a.g.get(W,B)||(m.a.g.set(W,B,!0),m.a.B(W,"selectionchange",k)),m.a.g.set(q,j,Q)};m.c.textInput={init:function(q,Q,W){function J(Re,Qe){m.a.B(q,Re,Qe)}function Z(){var Re=m.a.f(Q());(Re===null||Re===e)&&(Re=""),ge!==e&&Re===ge?m.a.setTimeout(Z,4):q.value!==Re&&(Se=!0,q.value=Re,Se=!1,fe=q.value)}function ae(){xe||(ge=q.value,xe=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(xe),ge=xe=e;var Re=q.value;fe!==Re&&(fe=Re,m.m.eb(Q(),W,"textInput",Re))}var fe=q.value,xe,ge,we=m.a.W==9?ae:Ae,Se=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Re){Se||Re.propertyName!=="value"||we(Re)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(q,we),J("dragend",ae)),(!F||9<=F)&&J("input",we),5>P&&m.a.R(q)==="textarea"?(J("keydown",ae),J("paste",ae),J("cut",ae)):11>w?J("keydown",ae):4>M?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&q.type==="number"&&J("keydown",ae),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,Q,W){W("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,w,P,M){var F;return w.has("as")&&(F={as:w.get("as"),noChildContext:w.get("noChildContext")}),C=M.createChildContext(C,F),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,w){var P=m.a.R(_),M=P=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var F=[],V=w.get("valueUpdate"),B=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var k=function(){j=null,B=!1;var Q=C(),W=m.w.M(_);m.m.eb(Q,w,"value",W)};!m.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){B=!0}),m.a.B(_,"focus",function(){B=!1}),m.a.B(_,"blur",function(){B&&k()})),m.a.D(F,function(Q){var W=k;m.a.Ud(Q,"after")&&(W=function(){j=m.w.M(_),m.a.setTimeout(k,0)},Q=Q.substring(5)),m.a.B(_,Q,W)});var G;if(G=M&&_.type=="file"?function(){var Q=m.a.f(C());Q===null||Q===e||Q===""?_.value="":m.u.G(k)}:function(){var Q=m.a.f(C()),W=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==W||W===e)&&(P==="select"?(W=w.get("valueAllowUnset"),m.w.cb(_,Q,W),W||Q===m.w.M(_)||m.u.G(k)):m.w.cb(_,Q))},P==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?G():k():(m.a.B(_,"change",k),q=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var w=m.a.f(C()),P=_.style.display!="none";w&&!P?_.style.display="":!w&&P&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,w,P,M,F){return m.c.event.init.call(this,C,function(){var V={};return V[_]=w(),V},P,M,F)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var w=C.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,w,P){return _=this.makeTemplateSource(_,P),this.renderTemplateSource(_,C,w,P)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,w){_=this.makeTemplateSource(_,w),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(P,M,F,V){P=m.m.ac(P);for(var B=m.m.Ra,j=0;j<P.length;j++){var k=P[j].key;if(Object.prototype.hasOwnProperty.call(B,k)){var G=B[k];if(typeof G=="function"){if(k=G(P[j].value))throw Error(k)}else if(!G)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(P,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+M}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(P,M,F){M.isTemplateRewritten(P,F)||M.rewriteTemplate(P,function(V){return m.kc.Ld(V,M)},F)},Ld:function(P,M){return P.replace(C,function(F,V,B,j,k){return _(k,V,B,M)}).replace(w,function(F,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(P,M){return m.aa.Xb(function(F,V){var B=F.nextSibling;B&&B.nodeName.toLowerCase()===M&&m.ib(B,P,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(w){if(this.F=w){var P=m.a.R(w);this.ab=P==="script"?1:P==="textarea"?2:P=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var P=arguments[0];w==="innerHTML"?m.a.fc(this.F,P):this.F[w]=P};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var P=m.a.g.get(w,C)||{},M=P.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!M||P.jd){var F=this.text();F&&F!==P.bb&&(M=m.a.Md(F,w.ownerDocument),m.a.g.set(w,C,{lb:M,bb:F,jd:!0}))}return M}P=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,C,{lb:P})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,C)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(j,k,G){var q;for(k=m.h.nextSibling(k);j&&(q=j)!==k;)j=m.h.nextSibling(q),G(q,j)}function C(j,k){if(j.length){var G=j[0],q=j[j.length-1],Q=G.parentNode,W=m.ga.instance,J=W.preprocessNode;if(J){if(_(G,q,function(Z,ae){var Ae=Z.previousSibling,fe=J.call(W,Z);fe&&(Z===G&&(G=fe[0]||ae),Z===q&&(q=fe[fe.length-1]||Ae))}),j.length=0,!G)return;G===q?j.push(G):(j.push(G,q),m.a.Ua(j,Q))}_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(k,Z)}),_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[k])}),m.a.Ua(j,Q)}}function w(j){return j.nodeType?j:0<j.length?j[0]:null}function P(j,k,G,q,Q){Q=Q||{};var W=(j&&w(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,W),G=J.renderTemplate(G,q,Q,W),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":m.h.va(j,G),W=!0;break;case"replaceNode":m.a.Xc(j,G),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(C(G,q),Q.afterRender&&m.u.G(Q.afterRender,null,[G,q[Q.as||"$data"]]),k=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function M(j,k,G){return m.O(j)?j():typeof j=="function"?j(k,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,k,G,q,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",q){var W=w(q);return m.$(function(){var Z=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),J=M(j,Z.$data,Z),Z=P(q,Q,J,Z,G);Q=="replaceNode"&&(q=Z,W=w(q))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(J){m.dc(j,k,G,J,"replaceNode")})},m.Qd=function(j,k,G,q,Q){function W(ge,we){m.u.G(m.a.ec,null,[q,ge,Z,G,J,we]),m.i.ma(q,m.i.H)}function J(ge,we){C(we,ae),G.afterRender&&G.afterRender(we,ge),ae=null}function Z(ge,we){ae=Q.createChildContext(ge,{as:Ae,noChildContext:G.noChildContext,extend:function(Re){Re.$index=we,Ae&&(Re[Ae+"Index"]=we)}});var Se=M(j,ge,ae);return P(q,"ignoreTargetNode",Se,ae,G)}var ae,Ae=G.as,fe=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(fe||G.beforeRemove||!m.Pc(k))return m.$(function(){var ge=m.a.f(k)||[];typeof ge.length>"u"&&(ge=[ge]),fe&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),W(ge)},null,{l:q});W(k.v());var xe=k.subscribe(function(ge){W(k(),ge)},null,"arrayChange");return xe.l(q),xe};var V=m.a.g.Z(),B=m.a.g.Z();m.c.template={init:function(j,k){var G=m.a.f(k());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var q=G[0]&&G[0].parentNode;q&&m.a.g.get(q,B)||(q=m.a.Yb(G),m.a.g.set(q,B,!0)),new m.C.ia(j).nodes(q)}else if(G=m.h.childNodes(j),0<G.length)q=m.a.Yb(G),new m.C.ia(j).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,k,G,q,Q){var W=k();k=m.a.f(W),G=!0,q=null,typeof k=="string"?k={}:(W="name"in k?k.name:j,"if"in k&&(G=m.a.f(k.if)),G&&"ifnot"in k&&(G=!m.a.f(k.ifnot)),G&&!W&&(G=!1)),"foreach"in k?q=m.Qd(W,G&&k.foreach||[],k,j,Q):G?(G=Q,"data"in k&&(G=Q.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(W,G,k,j)):m.h.Ea(j),Q=q,(k=m.a.g.get(j,V))&&typeof k.s=="function"&&k.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,w){if(_.length&&C.length){var P,M,F,V,B;for(P=M=0;(!w||P<w)&&(V=_[M]);++M){for(F=0;B=C[F];++F)if(V.value===B.value){V.moved=B.index,B.moved=V.index,C.splice(F,1),P=F=0;break}P+=F}}},m.a.Pb=(function(){function _(C,w,P,M,F){var V=Math.min,B=Math.max,j=[],k,G=C.length,q,Q=w.length,W=Q-G||1,J=G+Q+1,Z,ae,Ae;for(k=0;k<=G;k++)for(ae=Z,j.push(Z=[]),Ae=V(Q,k+W),q=B(0,k-1);q<=Ae;q++)Z[q]=q?k?C[k-1]===w[q-1]?ae[q-1]:V(ae[q]||J,Z[q-1]||J)+1:q+1:k+1;for(V=[],B=[],W=[],k=G,q=Q;k||q;)Q=j[k][q]-1,q&&Q===j[k][q-1]?B.push(V[V.length]={status:P,value:w[--q],index:q}):k&&Q===j[k-1][q]?W.push(V[V.length]={status:M,value:C[--k],index:k}):(--q,--k,F.sparse||V.push({status:"retained",value:w[q]}));return m.a.Kc(W,B,!F.dontLimitMoves&&10*G),V.reverse()}return function(C,w,P){return P=typeof P=="boolean"?{dontLimitMoves:P}:P||{},C=C||[],w=w||[],C.length<w.length?_(C,w,"added","deleted",P):_(w,C,"deleted","added",P)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(P,M,F,V,B){var j=[],k=m.$(function(){var G=M(F,B,m.a.Ua(j,P))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,B])),j.length=0,m.a.Nb(j,G)},null,{l:P,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:k.ja()?k:e}}var C=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(P,M,F,V,B,j){function k(vt){Se={Aa:vt,pb:m.ta(ae++)},J.push(Se),W||we.push(Se)}function G(vt){Se=Q[vt],ae!==Se.pb.v()&&ge.push(Se),Se.pb(ae++),m.a.Ua(Se.Y,P),J.push(Se)}function q(vt,Gt){if(vt)for(var lt=0,mt=Gt.length;lt<mt;lt++)m.a.D(Gt[lt].Y,function(ft){vt(ft,lt,Gt[lt].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var Q=m.a.g.get(P,C),W=!Q,J=[],Z=0,ae=0,Ae=[],fe=[],xe=[],ge=[],we=[],Se,Re=0;if(W)m.a.D(M,k);else{if(!j||Q&&Q._countWaitingForRemove){var Qe=m.a.Mb(Q,function(vt){return vt.Aa});j=m.a.Pb(Qe,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var Qe=0,He,Xe,$e;He=j[Qe];Qe++)switch(Xe=He.moved,$e=He.index,He.status){case"deleted":for(;Z<$e;)G(Z++);Xe===e&&(Se=Q[Z],Se.$&&(Se.$.s(),Se.$=e),m.a.Ua(Se.Y,P).length&&(V.beforeRemove&&(J.push(Se),Re++,Se.Aa===w?Se=null:xe.push(Se)),Se&&Ae.push.apply(Ae,Se.Y))),Z++;break;case"added":for(;ae<$e;)G(Z++);Xe!==e?(fe.push(J.length),G(Xe)):k(He.value)}for(;ae<M.length;)G(Z++);J._countWaitingForRemove=Re}m.a.g.set(P,C,J),q(V.beforeMove,ge),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var Pe,qe,st;try{st=P.ownerDocument.activeElement}catch{}if(fe.length)for(;(Qe=fe.shift())!=e;){for(Se=J[Qe],Pe=e;Qe;)if((qe=J[--Qe].Y)&&qe.length){Pe=qe[qe.length-1];break}for(M=0;Z=Se.Y[M];Pe=Z,M++)m.h.Wb(P,Z,Pe)}for(Qe=0;Se=J[Qe];Qe++){for(Se.Y||m.a.extend(Se,_(P,F,Se.Aa,B,Se.pb)),M=0;Z=Se.Y[M];Pe=Z,M++)m.h.Wb(P,Z,Pe);!Se.Ed&&B&&(B(Se.Aa,Se.Y,Se.pb),Se.Ed=!0,Pe=Se.Y[Se.Y.length-1])}for(st&&P.ownerDocument.activeElement!=st&&st.focus(),q(V.beforeRemove,xe),Qe=0;Qe<xe.length;++Qe)xe[Qe].Aa=w;q(V.afterMove,ge),q(V.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,w,P){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,P))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(w,P,M,F){if(F=F||n,M=M||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[P.$data],P=r.extend({koBindingContext:P},M.templateOptions),P=r.tmpl(V,w,P),P.appendTo(F.createElement("div")),r.fragments={},P},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,P){n.write("<script type='text/html' id='"+w+"'>"+P+"</script>")},0<C&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var TGt=ko;typeof window<"u"?(ko=window.ko,typeof _8<"u"?window.ko=_8:delete window.ko):(ko=global.ko,typeof _8<"u"?global.ko=_8:delete global.ko);var YC=TGt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var FQ="__knockoutObservables",BQ="__knockoutSubscribable";function BEe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=kEe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===FQ||o===BQ)&&!(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&&Mwt(n,a)}}),e}function kEe(e,t){var n=e[FQ];return!n&&t&&(n={},Object.defineProperty(e,FQ,{value:n})),n}function Rwt(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),BEe.call(i,e,[t]),e}function Mwt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Lwt(e,t,i))})}function Lwt(e,t,n){var i=Nwt(e,n);return i.subscribe(t)}function Nwt(e,t){var n=t[BQ];if(!n){n=new e.subscribable,Object.defineProperty(t,BQ,{value:n});var i={};Fwt(t,n,i),Bwt(e,t,n,i)}return n}function Fwt(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 Bwt(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 UEe(e,t){if(!e)return null;var n=kEe(e,!1);return n&&n[t]||null}function kwt(e,t){var n=UEe(e,t);n&&n.valueHasMutated()}function Uwt(e){e.track=BEe,e.getObservable=UEe,e.valueHasMutated=kwt,e.defineProperty=Rwt}var Dk={attachToKo:Uwt};var VEe="http://www.w3.org/2000/svg",zEe="cesium-svgPath-svg",Vwt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(VEe,"svg:svg");i.setAttribute("class",zEe);let o=document.createElementNS(VEe,"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",`${zEe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},Pk=Vwt;Dk.attachToKo(GA);Pk.register(GA);var xe=GA;function Ik(e){c(e)||(e=new Ah),this._clock=e,this._eventHelper=new gr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=xe.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=xe.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=xe.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=xe.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=xe.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),xe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(Ik.prototype,{clock:{get:function(){return this._clock}}});Ik.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};Ik.prototype.isDestroyed=function(){return!1};Ik.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var Ok=Ik;function zwt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,E.throwInstantiationError()}var kQ=zwt;function Hwt(e,t){if(!c(e))throw new E("func is required.");t=t??!0;let n=new pe,i=new pe;function o(){if(!o.canExecute)throw new E("Cannot execute command, canExecute is false.");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,xe.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Sn=Hwt;var rv={};rv.createCheckbox=function(e,t,n){T.typeOf.string("labelText",e),T.typeOf.string("checkedBinding",t);let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return c(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};rv.createSection=function(e,t,n,i){T.defined("panel",e),T.typeOf.string("headerText",t),T.typeOf.string("sectionVisibleBinding",n),T.typeOf.string("toggleSectionVisibilityBinding",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};rv.createRangeInput=function(e,t,n,i,o,r){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),T.typeOf.number("min",n),T.typeOf.number("max",i),r=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=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let l=document.createElement("div");l.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(l),u};rv.createRangeInputWithDynamicMinMax=function(e,t,n,i){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};rv.createButton=function(e,t,n){T.typeOf.string("buttonText",e),T.typeOf.string("clickedBinding",t);let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return c(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var fu=rv;function Gwt(e,t,n,i,o){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,o)}var Da=Gwt;function HEe(e,t){if(!c(e))throw new E("command is required.");this._command=e,t=t??W.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",xe.track(this,["toggled","tooltip"])}Object.defineProperties(HEe.prototype,{command:{get:function(){return this._command}}});var Z0=HEe;var jA="http://www.w3.org/2000/svg",WEe="http://www.w3.org/1999/xlink",n5,Rk=G.fromCssColorString("rgba(247,250,255,0.384)"),i5=G.fromCssColorString("rgba(143,191,255,0.216)"),UQ=G.fromCssColorString("rgba(153,197,255,0.098)"),o5=G.fromCssColorString("rgba(255,255,255,0.086)"),jwt=G.fromCssColorString("rgba(255,255,255,0.267)"),Wwt=G.fromCssColorString("rgba(255,255,255,0)"),GEe=G.fromCssColorString("rgba(66,67,68,0.3)"),jEe=G.fromCssColorString("rgba(0,0,0,0.5)");function Q0(e){return G.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var Mk={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 em(e){let t=document.createElementNS(jA,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(em(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(WEe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function VQ(e,t,n){let i=document.createElementNS(jA,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(jA,"tspan");return o.textContent=n,i.appendChild(o),i}function qwt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var r5=new G;function fs(e,t){let n=t.alpha,i=1-n;return r5.red=e.red*i+t.red*n,r5.green=e.green*i+t.green*n,r5.blue=e.blue*i+t.blue*n,r5.toCssColorString()}function zQ(e,t,n){let i=Mk[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 em(o)}function Ywt(e,t,n){let i=Mk[n],o=Mk.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 em(r)}function Xwt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&n5!==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(),l,u;if(t.type==="touchstart"||t.type==="touchmove"?(l=t.touches[0].clientX,u=t.touches[0].clientY):(l=t.clientX,u=t.clientY),!i&&(l>a.right||l<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=l-o-a.left,p=u-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||l<f.right&&l>f.left&&u>f.top&&u<f.bottom?(n5=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===n5&&(n5=void 0),n.shuttleRingDragging=!1}function Ng(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=[Da(t,"toggled",this.setToggled,this),Da(t,"tooltip",this.setTooltip,this),Da(t.command,"canExecute",this.setEnabled,this)]}Ng.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();de(this)};Ng.prototype.isDestroyed=function(){return!1};Ng.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")}};Ng.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")))};Ng.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function sv(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("viewModel is required.");e=In(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(jA,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",WEe);let s=document.createElementNS(jA,"g");this._topG=s,this._realtimeSVG=new Ng(Ywt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ng(zQ(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ng(zQ(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ng(zQ(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(jA,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let l=em({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;let u=Mk.animation_pathSwooshFX,f=Mk.animation_pathPointer,h=em({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=em({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=em({tagName:"g",transform:"translate(100,100)"});this._knobOuter=em({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=em({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=VQ(0,-24,""),this._knobTime=VQ(0,-7,""),this._knobStatus=VQ(0,-41,"");let y=em({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(jA,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(l),b.appendChild(h),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let x=this;function A(M){Xwt(x,M)}this._mouseCallback=A,l.addEventListener("mousedown",A,!0),l.addEventListener("touchstart",A,!0),h.addEventListener("mousedown",A,!0),h.addEventListener("touchstart",A,!0),n.addEventListener("mousemove",A,!0),n.addEventListener("touchmove",A,!0),n.addEventListener("mouseup",A,!0),n.addEventListener("touchend",A,!0),n.addEventListener("touchcancel",A,!0),this._shuttleRingPointer.addEventListener("mousedown",A,!0),this._shuttleRingPointer.addEventListener("touchstart",A,!0),this._knobOuter.addEventListener("mousedown",A,!0),this._knobOuter.addEventListener("touchstart",A,!0);let C=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],P;this._subscriptions=[Da(t.pauseViewModel,"toggled",function(M){P!==M&&(P=M,P?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Da(t,"shuttleRingAngle",function(M){qwt(x._shuttleRingPointer,x._knobOuter,M)}),Da(t,"dateLabel",function(M){S.textContent!==M&&(S.textContent=M)}),Da(t,"timeLabel",function(M){C.textContent!==M&&(C.textContent=M)}),Da(t,"multiplierLabel",function(M){v.textContent!==M&&(v.textContent=M)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(sv.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sv.prototype.isDestroyed=function(){return!1};sv.prototype.destroy=function(){c(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 de(this)};sv.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,l=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},${l})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t};sv.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(c(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Q0(this._themeNormal),n=Q0(this._themeHover),i=Q0(this._themeSelect),o=Q0(this._themeDisabled),r=Q0(this._themeKnob),s=Q0(this._themePointer),a=Q0(this._themeSwoosh),l=Q0(this._themeSwooshHover),u=em({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(t,Rk)},{tagName:"stop",offset:"12%","stop-color":fs(t,i5)},{tagName:"stop",offset:"46%","stop-color":fs(t,UQ)},{tagName:"stop",offset:"81%","stop-color":fs(t,o5)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(n,Rk)},{tagName:"stop",offset:"12%","stop-color":fs(n,i5)},{tagName:"stop",offset:"46%","stop-color":fs(n,UQ)},{tagName:"stop",offset:"81%","stop-color":fs(n,o5)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(i,Rk)},{tagName:"stop",offset:"12%","stop-color":fs(i,i5)},{tagName:"stop",offset:"46%","stop-color":fs(i,UQ)},{tagName:"stop",offset:"81%","stop-color":fs(i,o5)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":fs(o,jwt)},{tagName:"stop",offset:"75%","stop-color":fs(o,Wwt)}]},{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":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.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":fs(s,jEe)},{tagName:"stop",offset:"100%","stop-color":fs(s,jEe)}]},{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":fs(r,Rk)},{tagName:"stop",offset:"60%","stop-color":fs(r,GEe)},{tagName:"stop",offset:"85%","stop-color":fs(r,i5)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":fs(r,GEe)},{tagName:"stop",offset:"60%","stop-color":fs(r,Rk)},{tagName:"stop",offset:"85%","stop-color":fs(r,o5)}]}]});c(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var Lk=sv;var Kwt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],J0=15,av=105;function qEe(e,t){return e-t}function HQ(e,t){let n=Lo(t,e,qEe);return n<0?~n:n}function $wt(e,t){if(Math.abs(e)<=J0)return e/J0;let n=J0,i=av,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 Zwt(e,t,n){if(n.clockStep===mo.SYSTEM_CLOCK)return J0;if(Math.abs(e)<=1)return e*J0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=J0,r=av,s,a=0,l;return e>0?(s=Math.log(i),l=(s-a)/(r-o),(Math.log(e)-a)/l+o):(s=Math.log(-t[0]),l=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/l+o))}function Ed(e){if(!c(e))throw new E("clockViewModel is required.");let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Ed.defaultDateFormatter,this._timeFormatter=Ed.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Ed.defaultTicks),this.timeLabel=void 0,xe.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,xe.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,xe.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===mo.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,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return Zwt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,av),-av);let a=t._allShuttleRingTicks,l=t._clockViewModel;if(l.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===av){l.multiplier=s>0?a[a.length-1]:a[0];return}let u=$wt(s,a);if(t.snapToTicks)u=a[HQ(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>J0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}l.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===$r.UNBOUNDED)return!0;let l=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===$r.LOOP_STOP)h=Q.greaterThan(u,f)||u.equals(f)&&l>0;else{let p=s.stopTime;h=Q.greaterThan(u,f)&&Q.lessThan(u,p)||u.equals(f)&&l>0||u.equals(p)&&l<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===$r.UNBOUNDED)return!0;let l=s.systemTime;return Q.greaterThanOrEquals(l,s.startTime)&&Q.lessThanOrEquals(l,s.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Sn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Z0(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Z0(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Sn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Z0(o,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==mo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Sn(function(){t._clockViewModel.clockStep=mo.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Z0(r,{toggled:xe.computed(function(){return e.clockStep===mo.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=HQ(l,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Sn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=HQ(l,a)+1;u<a.length&&(s.multiplier=a[u])})}Ed.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${Kwt[n.month-1]} ${n.day} ${n.year}`};Ed.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];Ed.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`};Ed.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Ed.prototype.setShuttleRingTicks=function(e){if(!c(e))throw new E("positiveTicks is required.");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(qEe);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(Ed.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){if(typeof e!="function")throw new E("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if(typeof e!="function")throw new E("timeFormatter must be a function");this._timeFormatter=e}}});Ed._maxShuttleRingAngle=av;Ed._realtimeShuttleRingAngle=J0;var Nk=Ed;function YEe(e){e=e??W.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??W.EMPTY_ARRAY,i=e.terrainProviderViewModels??W.EMPTY_ARRAY;if(!c(t))throw new E("globe is required");this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,xe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=xe.getObservable(this,"imageryProviderViewModels"),r=xe.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._imageryProviders=r;let s=xe.getObservable(this,"terrainProviderViewModels"),a=xe.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=c(h)?h.name:void 0,m=c(p)?p.name:void 0;return c(g)&&c(m)?`${g} -${m}`:c(g)?g:m}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(c(h))return h.iconUrl}),this.selectedImagery=void 0;let l=xe.observable();this._currentImageryLayers=[],xe.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(h){if(l()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let x=y.length;for(let A=0;A<x;A++){let C=y.get(A);if(C===g[p]){y.remove(C),b=!0;break}}}if(c(h)){let x=h.creationCommand();if(Array.isArray(x)){let A=x.length;for(this._currentImageryLayers=[],p=A-1;p>=0;p--){let C=Xa.fromProviderAsync(x[p]);y.add(C,0),this._currentImageryLayers.push(C)}}else{this._currentImageryLayers=[];let A=Xa.fromProviderAsync(x);if(A.name=h.name,b)y.add(A,0);else{let C=y.get(0);c(C)&&y.remove(C),y.add(A,0)}this._currentImageryLayers.push(A)}}l(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(c(h)&&(p=h.creationCommand()),c(p)&&!c(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof np),this._globe.terrainProvider=p;else if(c(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),b=new Ek(p).readyEvent.addEventListener(x=>{g||(this._globe.depthTestAgainstTerrain=!(x instanceof np),this._globe.terrainProvider=x,b())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Sn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(YEe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var Fk=YEe;function s5(e,t){if(!c(e))throw new E("container is required.");e=In(e);let n=new Fk(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 l=document.createElement("div");l.className="cesium-baseLayerPicker-category",a.appendChild(l);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),l.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),l.appendChild(f);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; }'),f.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 m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",y.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-categoryTitle",x.setAttribute("data-bind","text: name"),b.appendChild(x);let A=document.createElement("div");A.className="cesium-baseLayerPicker-choices",A.setAttribute("data-bind","foreach: providers"),b.appendChild(A);let C=document.createElement("div");C.className="cesium-baseLayerPicker-item",C.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),A.appendChild(C);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),C.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),C.appendChild(v),xe.applyBindings(n,i),xe.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(P){i.contains(P.target)||r.contains(P.target)||(n.dropDownVisible=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(s5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});s5.prototype.isDestroyed=function(){return!1};s5.prototype.destroy=function(){return Vt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._element),xe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),de(this)};var Bk=s5;function XEe(e){if(!c(e.name))throw new E("options.name is required.");if(!c(e.tooltip))throw new E("options.tooltip is required.");if(!c(e.iconUrl))throw new E("options.iconUrl is required.");if(typeof e.creationFunction!="function")throw new E("options.creationFunction is required.");let t=e.creationFunction;c(t.canExecute)||(t=Sn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(XEe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ds=XEe;function Qwt(){let e=[],t=devicePixelRatio>=2;return e.push(new ds({name:"Bing Maps Aerial",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return pg({style:mg.AERIAL})}})),e.push(new ds({name:"Bing Maps Aerial with Labels",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return pg({style:mg.AERIAL_WITH_LABELS})}})),e.push(new ds({name:"Bing Maps Roads",iconUrl:tn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return pg({style:mg.ROAD})}})),e.push(new ds({name:"ArcGIS World Imagery",iconUrl:tn("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 dg.fromBasemapType(Vh.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ds({name:"ArcGIS World Hillshade",iconUrl:tn("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 dg.fromBasemapType(Vh.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ds({name:"Esri World Ocean",iconUrl:tn("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 dg.fromBasemapType(Vh.OCEANS,{enablePickFeatures:!1})}})),e.push(new ds({name:"Open\xADStreet\xADMap",iconUrl:tn("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 Lg({url:"https://tile.openstreetmap.org/"})}})),e.push(new ds({name:"Stadia x Stamen Watercolor",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var Tle="__knockoutObservables",Ele="__knockoutSubscribable";function Tke(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Eke(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Tle||r===Ele)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&CGt(n,a)}}),e}function Eke(e,t){var n=e[Tle];return!n&&t&&(n={},Object.defineProperty(e,Tle,{value:n})),n}function EGt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.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".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),Tke.call(i,e,[t]),e}function CGt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=vGt(e,t,i))})}function vGt(e,t,n){var i=SGt(e,n);return i.subscribe(t)}function SGt(e,t){var n=t[Ele];if(!n){n=new e.subscribable,Object.defineProperty(t,Ele,{value:n});var i={};wGt(t,n,i),IGt(e,t,n,i)}return n}function wGt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function IGt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function Cke(e,t){if(!e)return null;var n=Eke(e,!1);return n&&n[t]||null}function PGt(e,t){var n=Cke(e,t);n&&n.valueHasMutated()}function DGt(e){e.track=Tke,e.getObservable=Cke,e.valueHasMutated=PGt,e.defineProperty=EGt}var y8={attachToKo:DGt};var vke="http://www.w3.org/2000/svg",Ske="cesium-svgPath-svg",RGt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(vke,"svg:svg");i.setAttribute("class",Ske);let r=document.createElementNS(vke,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${Ske} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},A8=RGt;y8.attachToKo(YC);A8.register(YC);var ve=YC;function b8(e){l(e)||(e=new im),this._clock=e,this._eventHelper=new Go,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=ve.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=ve.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=ve.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=ve.observable(e.currentTime),this.currentTime.equalityComparer=K.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=ve.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=ve.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=ve.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=ve.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=ve.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),ve.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(b8.prototype,{clock:{get:function(){return this._clock}}});b8.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.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};b8.prototype.isDestroyed=function(){return!1};b8.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var x8=b8;function OGt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var Cle=OGt;function MGt(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,ve.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var Rn=MGt;var $P={};$P.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};$P.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};$P.createRangeInput=function(e,t,n,i,r,o){o=o??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=r??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};$P.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(r),a.appendChild(s),a};$P.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var yf=$P;function NGt(e,t,n,i,r){return n.call(i,e[t]),ve.getObservable(e,t).subscribe(n,i,r)}var Cc=NGt;function wke(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",ve.track(this,["toggled","tooltip"])}Object.defineProperties(wke.prototype,{command:{get:function(){return this._command}}});var Hb=wke;var Rl="http://www.w3.org/2000/svg",Rke="http://www.w3.org/1999/xlink",XW,T8=z.fromCssColorString("rgba(247,250,255,0.384)"),KW=z.fromCssColorString("rgba(143,191,255,0.216)"),vle=z.fromCssColorString("rgba(153,197,255,0.098)"),$W=z.fromCssColorString("rgba(255,255,255,0.086)"),LGt=z.fromCssColorString("rgba(255,255,255,0.267)"),FGt=z.fromCssColorString("rgba(255,255,255,0)"),Ike=z.fromCssColorString("rgba(66,67,68,0.3)"),Pke=z.fromCssColorString("rgba(0,0,0,0.5)");function Gb(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var E8={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 Ap(e){let t=document.createElementNS(Rl,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Ap(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Rke,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function wle(e,t,n){let i=document.createElementNS(Rl,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(Rl,"tspan");return r.textContent=n,i.appendChild(r),i}function BGt(e,t){let n=wle(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["month","day","year"];for(let a=0;a<o.length;++a){if(a>0){let f=document.createElementNS(Rl,"tspan");f.textContent=" ",r.push(f),n.appendChild(f)}let c=o[a],u=document.createElementNS(Rl,"tspan");u.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),u.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=u,n.appendChild(u)}let s=document.createElementNS(Rl,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:r}}function kGt(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",r[0].textContent="",r[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],r[0].textContent=" ",r[1].textContent=" ",e.fallback.textContent=""}function UGt(e,t){let n=wle(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["hour","minute","second"];for(let f=0;f<o.length;++f){if(f>0){let g=document.createElementNS(Rl,"tspan");g.textContent=":",r.push(g),n.appendChild(g)}let d=o[f],p=document.createElementNS(Rl,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${d}`),p.setAttribute("aria-label",`Adjust ${d} with mouse wheel`),i[d]=p,n.appendChild(p)}let s=document.createElementNS(Rl,"tspan");n.appendChild(s);let a=document.createElementNS(Rl,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(Rl,"tspan");n.appendChild(c);let u=document.createElementNS(Rl,"tspan");return n.appendChild(u),{decimalPoint:s,element:n,fallback:u,parts:i,separators:r,suffix:c}}function zGt(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",r[0].textContent="",r[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],r[0].textContent=":",r[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function Dke(e,t,n){let i=Object.keys(t);for(let r=0;r<i.length;++r){let o=i[r],s=t[o],a=function(c){c.deltaY!==0&&(n(o,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function VGt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var JW=new z;function Xs(e,t){let n=t.alpha,i=1-n;return JW.red=e.red*i+t.red*n,JW.green=e.green*i+t.green*n,JW.blue=e.blue*i+t.blue*n,JW.toCssColorString()}function Sle(e,t,n){let i=E8[n],r={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 Ap(r)}function jGt(e,t,n){let i=E8[n],r=E8.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ap(o)}function HGt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&XW!==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 r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(XW=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===XW&&(XW=void 0),n.shuttleRingDragging=!1}function Ty(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=[Cc(t,"toggled",this.setToggled,this),Cc(t,"tooltip",this.setTooltip,this),Cc(t.command,"canExecute",this.setEnabled,this)]}Ty.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();ue(this)};Ty.prototype.isDestroyed=function(){return!1};Ty.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")}};Ty.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")))};Ty.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function JP(e,t){e=Ln(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 r=document.createElement("div");r.className="cesium-animation-theme",r.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=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(Rl,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Rke);let s=document.createElementNS(Rl,"g");this._topG=s,this._realtimeSVG=new Ty(jGt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ty(Sle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ty(Sle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ty(Sle(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Rl,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Ap({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=E8.animation_pathSwooshFX,f=E8.animation_pathPointer,d=Ap({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Ap({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Ap({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Ap({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Ap({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g}),y=BGt(0,-24);this._knobDate=y.element;let A=UGt(0,-7);this._knobTime=A.element,this._knobStatus=wle(0,-41,"");let b=Ap({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(Rl,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobStatus),p.appendChild(b),p.appendChild(this._knobDate),p.appendChild(this._knobTime),o.appendChild(s),e.appendChild(o);let T=this;function E(I){HGt(T,I)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),d.addEventListener("mousedown",E,!0),d.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let v=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],Dke(this,y.parts,function(I,R){t.adjustDate(I,R)}),Dke(this,A.parts,function(I,R){t.adjustTime(I,R)});let S;this._subscriptions=[Cc(t.pauseViewModel,"toggled",function(I){S!==I&&(S=I,S?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Cc(t,"shuttleRingAngle",function(I){VGt(T._shuttleRingPointer,T._knobOuter,I)}),Cc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&kGt(y,I)}),Cc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&zGt(A,I)}),Cc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(JP.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});JP.prototype.isDestroyed=function(){return!1};JP.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);let n=this._fieldWheelListeners;for(let r=0;r<n.length;++r){let o=n[r];o.element.removeEventListener("wheel",o.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let r=0,o=i.length;r<o;r++)i[r].dispose();return ue(this)};JP.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,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${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};JP.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=Gb(this._themeNormal),n=Gb(this._themeHover),i=Gb(this._themeSelect),r=Gb(this._themeDisabled),o=Gb(this._themeKnob),s=Gb(this._themePointer),a=Gb(this._themeSwoosh),c=Gb(this._themeSwooshHover),u=Ap({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(t,T8)},{tagName:"stop",offset:"12%","stop-color":Xs(t,KW)},{tagName:"stop",offset:"46%","stop-color":Xs(t,vle)},{tagName:"stop",offset:"81%","stop-color":Xs(t,$W)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(n,T8)},{tagName:"stop",offset:"12%","stop-color":Xs(n,KW)},{tagName:"stop",offset:"46%","stop-color":Xs(n,vle)},{tagName:"stop",offset:"81%","stop-color":Xs(n,$W)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(i,T8)},{tagName:"stop",offset:"12%","stop-color":Xs(i,KW)},{tagName:"stop",offset:"46%","stop-color":Xs(i,vle)},{tagName:"stop",offset:"81%","stop-color":Xs(i,$W)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(r,LGt)},{tagName:"stop",offset:"75%","stop-color":Xs(r,FGt)}]},{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":Xs(s,Pke)},{tagName:"stop",offset:"100%","stop-color":Xs(s,Pke)}]},{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":Xs(o,T8)},{tagName:"stop",offset:"60%","stop-color":Xs(o,Ike)},{tagName:"stop",offset:"85%","stop-color":Xs(o,KW)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,Ike)},{tagName:"stop",offset:"60%","stop-color":Xs(o,T8)},{tagName:"stop",offset:"85%","stop-color":Xs(o,$W)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var C8=JP;var GGt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wb=15,ZP=105,WGt=[31,28,31,30,31,30,31,31,30,31,30,31];function qGt(e,t){return t===2&&xf(e)?29:WGt[t-1]}function Oke(e,t,n){return K.fromGregorianDate(new Bh(t,n,Math.min(e.day,qGt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function Mke(e,t){return e-t}function Ile(e,t){let n=vr(t,e,Mke);return n<0?~n:n}function YGt(e,t){if(Math.abs(e)<=Wb)return e/Wb;let n=Wb,i=ZP,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function XGt(e,t,n){if(n.clockStep===zr.SYSTEM_CLOCK)return Wb;if(Math.abs(e)<=1)return e*Wb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Wb,o=ZP,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Af(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Af.defaultDateFormatter,this._timeFormatter=Af.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ve.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Af.defaultTicks),this.timeLabel=void 0,ve.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,ve.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,ve.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===zr.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,ve.defineProperty(this,"shuttleRingAngle",{get:function(){return XGt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,ZP),-ZP);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===ZP){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=YGt(s,a);if(t.snapToTicks)u=a[Ile(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Wb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,ve.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===As.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===As.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,ve.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===As.UNBOUNDED)return!0;let c=s.systemTime;return K.greaterThanOrEquals(c,s.startTime)&&K.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,ve.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 Hb(n,{toggled:ve.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 Hb(i,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Hb(r,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==zr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Rn(function(){t._clockViewModel.clockStep=zr.SYSTEM_CLOCK},ve.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Hb(o,{toggled:ve.computed(function(){return e.clockStep===zr.SYSTEM_CLOCK}),tooltip:ve.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,u=Ile(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Ile(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Af.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${GGt[n.month-1]} ${n.day} ${n.year}`};Af.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];Af.defaultTimeFormatter=function(e,t){let n=K.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`};Af.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Af.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(Mke);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Zn(s,o),this._allShuttleRingTicks=s};Af.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r=K.toGregorianDate(i),o;if(e==="day"){o=K.addDays(i,t,new K);let s=K.toGregorianDate(o);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((r.year-1)*12+r.month-1+t,0),119987),c=Math.floor(a/12)+1,u=a%12+1;o=Oke(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=Oke(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};Af.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r;if(e==="hour")r=K.addHours(i,t,new K);else if(e==="minute")r=K.addMinutes(i,t,new K);else{let s=e==="second"?t:t/1e3;r=K.addSeconds(i,s,new K)}let o=K.toGregorianDate(r);o.year<1||o.year>9999||(n.shouldAnimate=!1,n.currentTime=r)};Object.defineProperties(Af.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}}});Af._maxShuttleRingAngle=ZP;Af._realtimeShuttleRingAngle=Wb;var v8=Af;function KGt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Ple(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var $Gt=new pn,JGt=new h;function S8(e,t){let n=this,i=e.canvas,r=new ra(i);this._eventHandler=r,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 o=this._scene.globe;o.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="",ve.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=ve.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=ve.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=ve.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new ay({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=ve.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new Y4({modelMatrix:u}),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=ve.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=ve.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=ve.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=ve.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Ple(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Ple(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=ve.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new m8({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=ve.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=ve.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=ve.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=ve.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,$Gt),g=o.pick(p,n._scene,JGt);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=ve.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(S8.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}}});S8.prototype._update=function(){this.frustums&&(this.frustumStatisticText=KGt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Ple(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}`};S8.prototype.isDestroyed=function(){return!1};S8.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(),ue(this)};var w8=S8;function ZW(e,t){e=Ln(e);let n=document.createElement("div"),i=new w8(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.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",r.appendChild(s);let a=yf.createSection,c=yf.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let S=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",S.appendChild(I);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",I.appendChild(v);let O=document.createElement("div");I.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let P=document.createElement("input");P.type="button",P.value="SE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(M),O.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),B=document.createElement("tr"),j=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let G=document.createElement("td");G.appendChild(_);let q=document.createElement("td");q.appendChild(C),B.appendChild(k),B.appendChild(G),B.appendChild(q);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let J=document.createElement("td");J.appendChild(P),j.appendChild(Q),j.appendChild(W),j.appendChild(J),V.appendChild(B),V.appendChild(j),O.appendChild(V),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),S.appendChild(c("Wireframe","wireframe")),S.appendChild(c("Suspend LOD update","suspendUpdates")),S.appendChild(c("Show tile coordinates","tileCoordinates")),ve.applyBindings(i,this._element)}Object.defineProperties(ZW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZW.prototype.isDestroyed=function(){return!1};ZW.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var I8=ZW;function Nke(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,ve.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=ve.getObservable(this,"imageryProviderViewModels"),o=ve.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let s=ve.getObservable(this,"terrainProviderViewModels"),a=ve.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,ve.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} +${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,ve.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=ve.observable();this._currentImageryLayers=[],ve.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=Rs.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Rs.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=ve.observable();ve.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Zp),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new d8(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof Zp),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Rn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(Nke.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var P8=Nke;function QW(e,t){e=Ln(e);let n=new P8(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 r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),ve.applyBindings(n,i),ve.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(S){i.contains(S.target)||o.contains(S.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(QW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QW.prototype.isDestroyed=function(){return!1};QW.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._element),ve.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var D8=QW;function Lke(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=e.category??"",ve.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(Lke.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var uo=Lke;function ZGt(){let e=[],t=devicePixelRatio>=2;return e.push(new uo({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return x_({style:b_.AERIAL})}})),e.push(new uo({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return x_({style:b_.AERIAL_WITH_LABELS})}})),e.push(new uo({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return x_({style:b_.ROAD})}})),e.push(new uo({name:"ArcGIS World Imagery",iconUrl:Zt("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 y_.fromBasemapType(wm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new uo({name:"ArcGIS World Hillshade",iconUrl:Zt("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 y_.fromBasemapType(wm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new uo({name:"Esri World Ocean",iconUrl:Zt("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 y_.fromBasemapType(wm.OCEANS,{enablePickFeatures:!1})}})),e.push(new uo({name:"Open\xADStreet\xADMap",iconUrl:Zt("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 by({url:"https://tile.openstreetmap.org/"})}})),e.push(new uo({name:"Stadia x Stamen Watercolor",iconUrl:Zt("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 by({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia x Stamen Toner",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Stadia x Stamen Toner",iconUrl:Zt("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 by({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Stadia Alidade Smooth",iconUrl:Zt("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 by({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Stadia Alidade Smooth Dark",iconUrl:tn("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 Lg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Stadia Alidade Smooth Dark",iconUrl:Zt("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 by({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ds({name:"Sentinel-2",iconUrl:tn("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 hg.fromAssetId(3954)}})),e.push(new ds({name:"Blue Marble",iconUrl:tn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return hg.fromAssetId(3845)}})),e.push(new ds({name:"Earth at night",iconUrl:tn("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 hg.fromAssetId(3812)}})),e.push(new ds({name:"Natural Earth\xA0II",iconUrl:tn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return D0.fromUrl(tn("Assets/Textures/NaturalEarthII"))}})),e}var kk=Qwt;function Jwt(){let e=[];return e.push(new ds({name:"WGS84 Ellipsoid",iconUrl:tn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new np({ellipsoid:ie.WGS84})}})),e.push(new ds({name:"Cesium World Terrain",iconUrl:tn("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 PA({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var Uk=Jwt;function evt(e){return function(t){let n=e._scene.pick(t.position);c(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function $Ee(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);c(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},An.MOUSE_MOVE):(e._eventHandler.removeInputAction(An.MOUSE_MOVE),e.picking=e.picking)}var tvt={maximumFractionDigits:3};function Vk(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,tvt):Math.round(t).toLocaleString()}function zk(e,t){if(!c(e))return"";let n=t?e._statisticsPerPass[Uo.PICK]:e._statisticsPerPass[Uo.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>${Vk(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${Vk(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${Vk(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function ZEe(){let e=vi.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${Vk(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${Vk(e.texturesByteLength)}</li> - </ul> - `}var nvt=[{text:"Highlight",value:Bl.HIGHLIGHT},{text:"Replace",value:Bl.REPLACE},{text:"Mix",value:Bl.MIX}],KEe=new G(1,1,0,.4),ivt=new G,a5=new G;function Pa(e,t){T.typeOf.object("scene",e),T.typeOf.object("performanceContainer",t);let n=this,i=e.canvas;this._eventHandler=new of(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new yg({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,xe.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=xe.observable({}),this.properties=[],xe.defineProperty(this,"properties",function(){let U=[],q=n._properties();for(let Y in q)q.hasOwnProperty(Y)&&U.push(Y);return U});let o=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),c(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Bl.HIGHLIGHT;let s=xe.observable(),a=xe.observable();xe.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(q){let Y=e.pick(q.endPosition);if(Y instanceof Ws?(n.feature=Y,n.tile=Y.content.tile):c(Y)&&c(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!c(n._tileset)){if(s&&c(Y)&&c(Y.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(q.endPosition),c(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},An.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(An.MOUSE_MOVE))}}),this.picking=!0;let l=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return l()},set:function(U){l(U),c(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),c(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),c(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(U){h(U),c(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),c(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),c(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),c(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(U){m(U),c(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let y=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(U){y(U),c(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(U){b(U),c(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let x=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return x()},set:function(U){x(U),c(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let A=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),c(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let C=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(U){U=Number(U),isNaN(U)||(C(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(U){let q=Math.pow(U,6);C(q),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=q)}});let S=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let v=evt(this),P=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return P()},set:function(U){P(U),U?n._eventHandler.setInputAction(v,An.LEFT_CLICK):n._eventHandler.removeInputAction(An.LEFT_CLICK)}});let M=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return M()},set:function(U){M(U),c(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let R=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),c(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let L=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),c(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let F=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),c(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let w=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(U){U=Number(U),isNaN(U)||(w(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let D=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(U){U=Number(U),isNaN(U)||(D(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),c(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let N=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),c(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let k=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),c(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let z=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return z()},set:function(U){U=Number(U),isNaN(U)||(z(U),c(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),c(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(U){j(U),c(n._tileset)&&(n._tileset.loadSiblings=U)}}),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()}),c(this._tileset)||$Ee(this,!0)}Object.defineProperties(Pa.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 nvt}},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,c(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=zk(e,!1),this._pickStatisticsText=zk(e,!0),this._resourceCacheStatisticsText=ZEe(),$Ee(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;c(t)&&!t.content.isDestroyed()&&(!this.colorize&&c(this._style)?t.color=c(this._style.color)?this._style.color.evaluateColor(t,ivt):G.WHITE:t.color=a5,this._scene.requestRender()),c(e)&&(G.clone(e.color,a5),e.color=KEe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;c(t)&&!t.isDestroyed()&&!GQ(t.content)&&(t.color=a5,this._scene.requestRender()),c(e)&&!GQ(e.content)&&(G.clone(e.color,a5),e.color=KEe,this._scene.requestRender()),this._tile=e}}});function GQ(e){if(!c(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)if(!GQ(t[i]))return!1;return!0}return!1}Pa.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Pa.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Pa.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Pa.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Pa.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Pa.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Pa.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Pa.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Pa.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Pa.prototype.trimTilesCache=function(){c(this._tileset)&&this._tileset.trimLoadedTiles()};Pa.prototype.compileStyle=function(){let e=this._tileset;if(!(!c(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new NA(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Pa.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(` -`),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+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};Pa.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),c(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=zk(e,!1),this._pickStatisticsText=zk(e,!0),this._resourceCacheStatisticsText=ZEe())};Pa.prototype.isDestroyed=function(){return!1};Pa.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),de(this)};Pa.getStatistics=zk;var Hk=Pa;function c5(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=In(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new Hk(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=fu.createSection,l=fu.createCheckbox,u=fu.createRangeInput,f=fu.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),x=a(s,"Optimization","optimizationVisible","toggleOptimization"),A=document.createElement("div");A.className="field-group";let C=document.createElement("label");C.className="field-label",C.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),A.appendChild(C),A.appendChild(S),h.appendChild(A),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(l("Enable Picking","picking")),p.appendChild(l("Colorize","colorize"));let v=p.appendChild(l("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),P=document.createElement("p");P.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),P.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),P.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(P),p.appendChild(l("Bounding Volumes","showBoundingVolumes")),p.appendChild(l("Content Volumes","showContentBoundingVolumes")),p.appendChild(l("Request Volumes","showRequestVolumes")),p.appendChild(l("Point Cloud Shading","pointCloudShading"));let M=document.createElement("div");M.setAttribute("data-bind","visible: pointCloudShading"),M.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),M.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),M.appendChild(u("Base Resolution","baseResolution",0,1,.01)),M.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(M);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),M.appendChild(R),g.appendChild(l("Freeze Frame","freezeFrame")),g.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(F),m.appendChild(l("Performance","performance")),m.appendChild(i),m.appendChild(l("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(l("Pick Statistics","showPickStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(w),m.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));let D=document.createElement("div");D.className="cesium-3dTilesInspector-statistics",D.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(D);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let k=document.createElement("textarea");k.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(k);let z=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(z);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),y.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(l("Geometric Error","showGeometricError")),y.appendChild(l("Rendering Statistics","showRenderingStatistics")),y.appendChild(l("Memory Usage (MB)","showMemoryUsage")),y.appendChild(l("Url","showUrl")),x.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),x.appendChild(j);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),x.appendChild(U);let q=document.createElement("div");q.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),x.appendChild(q),x.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(l("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(o,n)}Object.defineProperties(c5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c5.prototype.isDestroyed=function(){return!1};c5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var Gk=c5;function ovt(e){let t;if(c(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 l=Math.pow(2,a);o>=l&&(s.push(a+1),o-=l)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function jQ(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var rvt=new mn,svt=new d;function jk(e,t){if(!c(e))throw new E("scene is required");if(!c(t))throw new E("performanceContainer is required");let n=this,i=e.canvas,o=new of(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="",xe.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=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Sn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Sn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Sn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=xe.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=xe.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=xe.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new yg({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Sn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Sn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new lk({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else c(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=xe.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Sn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return c(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:c(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=xe.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=xe.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=xe.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Sn(function(){let u=n.depthFrustum+1;return n.depthFrustum=jQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Sn(function(){let u=n.depthFrustum-1;return n.depthFrustum=jQ(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=xe.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Sn(function(){return n.tileCoordinates&&!c(s)?s=e.imageryLayers.addImageryProvider(new wk({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&c(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=xe.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=xe.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Sn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Sn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],c(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=xe.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});c(f)&&(n.primitive=c(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Sn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,An.LEFT_CLICK):o.removeInputAction(An.LEFT_CLICK)});function l(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,rvt),g=r.pick(p,n._scene,svt);if(c(g)){let m=h.cartesianToCartographic(g),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<y.length;++b){let x=y[b];if(c(x))for(let A=0;!f&&A<x.length;++A){let C=x[A];ce.contains(C.rectangle,m)&&(f=C)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Sn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(l,An.LEFT_CLICK):o.removeInputAction(An.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(jk.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 Sn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Sn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,c(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,c(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(c(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;c(n)&&c(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}}});jk.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ovt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=jQ(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}`};jk.prototype.isDestroyed=function(){return!1};jk.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(),de(this)};var Wk=jk;function l5(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let n=document.createElement("div"),i=new Wk(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=fu.createSection,l=fu.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=l("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(l("Show Frustum Planes","frustumPlanes")),u.appendChild(l("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let x=document.createElement("input");x.type="button",x.value="+",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(x);let A=a(s,"Primitives","primitivesVisible","togglePrimitives"),C=document.createElement("div");C.className="cesium-cesiumInspector-pickSection",A.appendChild(C);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),C.appendChild(v),C.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),C.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),C.appendChild(this._primitiveOnly);let P=a(s,"Terrain","terrainVisible","toggleTerrain"),M=document.createElement("div");M.className="cesium-cesiumInspector-pickSection",P.appendChild(M);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",M.appendChild(v);let L=document.createElement("div");M.appendChild(L);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let w=document.createElement("input");w.type="button",w.value="NE",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectNE");let D=document.createElement("input");D.type="button",D.value="SW",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(N),L.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let k=document.createElement("div");k.className="cesium-cesiumInspector-relativeText",k.textContent="Select relative:",L.appendChild(k);let z=document.createElement("table"),V=document.createElement("tr"),j=document.createElement("tr"),U=document.createElement("td");U.appendChild(F);let q=document.createElement("td");q.appendChild(_);let Y=document.createElement("td");Y.appendChild(w),V.appendChild(U),V.appendChild(q),V.appendChild(Y);let te=document.createElement("td"),K=document.createElement("td");K.appendChild(D);let Z=document.createElement("td");Z.appendChild(I),j.appendChild(te),j.appendChild(K),j.appendChild(Z),z.appendChild(V),z.appendChild(j),L.appendChild(z),M.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),M.appendChild(l("Show only selected","filterTile","hasPickedTile")),P.appendChild(l("Wireframe","wireframe")),P.appendChild(l("Suspend LOD update","suspendUpdates")),P.appendChild(l("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(l5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var qk=l5;function u5(e,t){c(t)||(t=document.body),t=In(t);let n=this,i=xe.observable(Cr.fullscreen),o=xe.observable(Cr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,xe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,xe.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Cr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Sn(function(){Cr.fullscreen?Cr.exitFullscreen():Cr.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=In(e)??r.body,this._callback=function(){i(Cr.fullscreen)},r.addEventListener(Cr.changeEventName,this._callback)}Object.defineProperties(u5.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new E("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}});u5.prototype.isDestroyed=function(){return!1};u5.prototype.destroy=function(){document.removeEventListener(Cr.changeEventName,this._callback),de(this)};var Yk=u5;var avt="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",cvt="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 f5(e,t){if(!c(e))throw new E("container is required.");e=In(e);let n=new Yk(t,e);n._exitFullScreenPath=cvt,n._enterFullScreenPath=avt;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),xe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(f5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});f5.prototype.isDestroyed=function(){return!1};f5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var Xk=f5;function QEe(e,t){if(!c(e))throw new E("scene is required.");this._scene=e,this._duration=t;let n=this;this._command=Sn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties(QEe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(c(e)&&e<0)throw new E("value must be positive.");this._duration=e}}});var Kk=QEe;function d5(e,t,n){if(!c(e))throw new E("container is required.");e=In(e);let i=new Kk(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),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(d5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});d5.prototype.isDestroyed=function(){return!1};d5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var $k=d5;var JEe=1e3;function Sd(e){if(!c(e)||!c(e.scene))throw new E("options.scene is required.");c(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new RA({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 pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=tSe,this._handleArrowUp=eSe;let t=this;this._suggestionsVisible=xe.pureComputed(function(){let o=xe.getObservable(t,"_suggestions")().length>0,r=xe.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Sn(function(i){if(i=i??W0.SEARCH,t._focusTextbox=!1,c(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)mvt(t);else return dvt(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?eSe(t):r?tSe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;oSe(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=e.autocomplete??!0,this.destinationFound=e.destinationFound??Sd.flyToDestination,this._focusTextbox=!1,xe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=xe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Sd._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,xe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,xe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){if(typeof i!="string")throw new E("value must be a valid string.");this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){if(c(i)&&i<0)throw new E("value must be positive.");this._flightDuration=i}})}Object.defineProperties(Sd.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}}});Sd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function eSe(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],Sd._adjustSuggestionsScroll(e,n)}function tSe(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],Sd._adjustSuggestionsScroll(e,i)}function lvt(e,t){let n=c(t)?t.availability:void 0;return c(n)?UT(t,[e]).then(function(i){return e=i[0],e.height+=JEe,e}):(e.height+=JEe,Promise.resolve(e))}function uvt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?O.equalsEpsilon(t.south,t.north,O.EPSILON7)&&O.equalsEpsilon(t.east,t.west,O.EPSILON7)?t=ce.center(t):a=VT(t,n):t=i.cartesianToCartographic(t),c(a)||(a=lvt(t,r)),a.then(function(l){s=i.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:B.IDENTITY})})}async function fvt(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 dvt(e,t,n){let i=e._searchText;if(iSe(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 fvt(t[o],i,n),c(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,qQ(e);let s=r.value;if(r.state==="fulfilled"&&c(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=nSe(e,Yw.getCreditsFromResult(s[0]));c(a)||WQ(e,t[o].credit);return}e._searchText=`${i} (not found)`}function WQ(e,t){c(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function nSe(e,t){return c(t)&&t.forEach(n=>WQ(e,n)),t}function qQ(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function hvt(e,t){let n=In(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 mvt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function iSe(e){return/^\s*$/.test(e)}function oSe(e){xe.getObservable(e,"_suggestions").removeAll()}async function pvt(e){if(!e.autoComplete)return;let t=e._searchText;if(oSe(e),qQ(e),!iSe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,W0.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=Yw.getCreditsFromResult(r);o=o&&!c(s),nSe(e,s)}),o&&WQ(e,n.credit)}if(e._suggestions.length>=5)return}}Sd.flyToDestination=uvt;Sd._updateSearchSuggestions=pvt;Sd._adjustSuggestionsScroll=hvt;Sd.prototype.isDestroyed=function(){return!1};Sd.prototype.destroy=function(){return qQ(this),de(this)};var Zk=Sd;var _vt="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",gvt="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 h5(e){if(!c(e)||!c(e.container))throw new E("options.container is required.");if(!c(e.scene))throw new E("options.scene is required.");let t=In(e.container),n=new Zk(e);n._startSearchPath=_vt,n._stopSearchPath=gvt;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 l=document.createElement("li");a.appendChild(l),l.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),xe.applyBindings(n,i),xe.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},Vt.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(h5.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});h5.prototype.isDestroyed=function(){return!1};h5.prototype.destroy=function(){let e=this._container;return Vt.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(),xe.cleanNode(this._form),xe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),de(this)};var Qk=h5;function yvt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function sSe(e,t){xe.track(e);for(let n=0;n<e.sublayers.length;n++)sSe(e.sublayers[n],t)}function m5(e){return e.modelName==="FullModel"}function aSe(e){return e.modelName==="Overview"}function cSe(e){return aSe(e)||m5(e)}function rSe(e,t){if(cSe(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:xe.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function bvt(e,t){if(cSe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");m5(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function xvt(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 Tvt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:xe.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:xe.observable(!0),index:-1}],currentLayer:xe.observable(),expandClickHandler:yvt,setOptionDisable:function(i,o){xe.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){bvt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){sSe(n[i],this.viewModel);let o=rSe(n[i],this.viewModel);c(o)&&(aSe(o)||!c(this.viewModel.defaultLayer)&&m5(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=rSe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=m5(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return xvt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var Jk=Tvt;function Avt(e,t){let n=document.getElementById(e);T.defined("container",n),T.defined("i3sProvider",t);let i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Sentinel-2",iconUrl:Zt("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 lu.fromAssetId(3954)}})),e.push(new uo({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3845)}})),e.push(new uo({name:"Earth at night",iconUrl:Zt("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 lu.fromAssetId(3812)}})),e.push(new uo({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return jA.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new uo({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830182)}})),e.push(new uo({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830183)}})),e.push(new uo({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830184)}})),e.push(new uo({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830186)}})),e.push(new uo({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3891168)}})),e.push(new uo({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3891169)}})),e}var R8=ZGt;function QGt(){let e=[];return e.push(new uo({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Zp({ellipsoid:ee.WGS84})}})),e.push(new uo({name:"Cesium World Terrain",iconUrl:Zt("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 Gx({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var O8=QGt;function eq(e,t){l(t)||(t=document.body),t=Ln(t);let n=this,i=ve.observable(es.fullscreen),r=ve.observable(es.enabled),o=t.ownerDocument;this.isFullscreen=void 0,ve.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,ve.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&es.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){es.fullscreen?es.exitFullscreen():es.requestFullscreen(n._fullscreenElement)},ve.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Ln(e)??o.body,this._callback=function(){i(es.fullscreen)},o.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(eq.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});eq.prototype.isDestroyed=function(){return!1};eq.prototype.destroy=function(){document.removeEventListener(es.changeEventName,this._callback),ue(this)};var M8=eq;var e5t="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",t5t="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 tq(e,t){e=Ln(e);let n=new M8(t,e);n._exitFullScreenPath=t5t,n._enterFullScreenPath=e5t;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),ve.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(tq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tq.prototype.isDestroyed=function(){return!1};tq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var N8=tq;var Fke=1e3;function bp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new Jx({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=kke,this._handleArrowUp=Bke;let t=this;this._suggestionsVisible=ve.pureComputed(function(){let r=ve.getObservable(t,"_suggestions")().length>0,o=ve.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=Rn(function(i){if(i=i??uA.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)a5t(t);else return o5t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?Bke(t):o?kke(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;Vke(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??bp.flyToDestination,this._focusTextbox=!1,ve.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=ve.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){bp._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,ve.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,ve.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,ve.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(bp.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}}});function Bke(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],bp._adjustSuggestionsScroll(e,n)}function kke(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],bp._adjustSuggestionsScroll(e,i)}function n5t(e,t){let n=l(t)?t.availability:void 0;return l(n)?aT(t,[e]).then(function(i){return e=i[0],e.height+=Fke,e}):(e.height+=Fke,Promise.resolve(e))}function i5t(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,s=t,a;return t instanceof ie?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ie.center(t):a=cC(t,n):t=i.cartesianToCartographic(t),l(a)||(a=n5t(t,o)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:N.IDENTITY})})}async function r5t(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 o5t(e,t,n){let i=e._searchText;if(zke(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await r5t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Rle(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=Uke(e,gS.getCreditsFromResult(s[0]));l(a)||Dle(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Dle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function Uke(e,t){return l(t)&&t.forEach(n=>Dle(e,n)),t}function Rle(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function s5t(e,t){let n=Ln(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function a5t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function zke(e){return/^\s*$/.test(e)}function Vke(e){ve.getObservable(e,"_suggestions").removeAll()}async function c5t(e){if(!e.autoComplete)return;let t=e._searchText;if(Vke(e),Rle(e),!zke(t))for(let n of e._geocoderServices){let i=await n.geocode(t,uA.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=gS.getCreditsFromResult(o);r=r&&!l(s),Uke(e,s)}),r&&Dle(e,n.credit)}if(e._suggestions.length>=5)return}}bp.flyToDestination=i5t;bp._updateSearchSuggestions=c5t;bp._adjustSuggestionsScroll=s5t;bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Rle(this),ue(this)};var L8=bp;var l5t="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",u5t="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 nq(e){let t=Ln(e.container),n=new L8(e);n._startSearchPath=l5t,n._stopSearchPath=u5t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.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(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),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),ve.applyBindings(n,i),ve.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},dn.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(nq.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});nq.prototype.isDestroyed=function(){return!1};nq.prototype.destroy=function(){let e=this._container;return dn.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(),ve.cleanNode(this._form),ve.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var F8=nq;function jke(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",ve.track(this,["tooltip"])}Object.defineProperties(jke.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 B8=jke;function iq(e,t,n){e=Ln(e);let i=new B8(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 r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),ve.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(iq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});iq.prototype.isDestroyed=function(){return!1};iq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var k8=iq;function f5t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function Gke(e,t){ve.track(e);for(let n=0;n<e.sublayers.length;n++)Gke(e.sublayers[n],t)}function rq(e){return e.modelName==="FullModel"}function Wke(e){return e.modelName==="Overview"}function qke(e){return Wke(e)||rq(e)}function Hke(e,t){if(qke(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:ve.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function d5t(e,t){if(qke(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");rq(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function h5t(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function m5t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:ve.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:ve.observable(!0),index:-1}],currentLayer:ve.observable(),expandClickHandler:f5t,setOptionDisable:function(i,r){ve.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){d5t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){Gke(n[i],this.viewModel);let r=Hke(n[i],this.viewModel);l(r)&&(Wke(r)||!l(this.viewModel.defaultLayer)&&rq(r))&&(this.viewModel.defaultLayer=r)}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=Hke(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=rq(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return h5t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var U8=m5t;function p5t(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" @@ -10976,9 +12806,16 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new Jk(t);xe.track(o),xe.applyBindings(o,n),c(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var YQ=Avt;var Cvt="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",Evt="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 XQ(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",xe.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,xe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?Evt:Cvt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!c(this.description)||this.description.length===0}})}XQ.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(XQ.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var eU=XQ;function p5(e){T.defined("container",e),e=In(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="×",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 eU;xe.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 l=r.contentDocument,u=l.createElement("link");u.href=tn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=l.createElement("div");f.className="cesium-infoBox-description",l.head.appendChild(u),l.body.appendChild(f),a._descriptionSubscription=Da(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let y=window.getComputedStyle(g);if(y!==null){let b=y["background-color"],x=G.fromCssColorString(b);c(x)&&x.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(p5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});p5.prototype.isDestroyed=function(){return!1};p5.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),c(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),de(this)};var tU=p5;function _5(e){if(!c(e))throw new E("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof on,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,xe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;xe.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Sn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new gr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof on}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=c(e.camera._currentFlight)}),this._switchToPerspective=Sn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Sn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(_5.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}}});_5.prototype.isDestroyed=function(){return!1};_5.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var nU=_5;var Svt="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",wvt="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 g5(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let n=new nU(t);n._perspectivePath=Svt,n._orthographicPath=wvt;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),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(g5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});g5.prototype.isDestroyed=function(){return!1};g5.prototype.destroy=function(){return this._viewModel.destroy(),Vt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var iU=g5;function KQ(e){if(!c(e)||!c(e.scene))throw new E("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=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,xe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Sn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=dk.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(KQ.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});KQ.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),de(this)};var oU=KQ;function y5(e){if(!c(e)||!c(e.container))throw new E("options.container is required.");if(!c(e.scene))throw new E("options.scene is required.");let t=In(e.container),n=new oU(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="×",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),xe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(y5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y5.prototype.isDestroyed=function(){return!1};y5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var rU=y5;function lSe(){this.showInstructions=!1;let e=this;this._command=Sn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Sn(function(){e._touch=!1}),this._showTouch=Sn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(lSe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var sU=lSe;function b5(e){if(!c(e)||!c(e.container))throw new E("options.container is required.");let t=In(e.container),n=new sU,i=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 l=document.createElement("img");l.src=tn("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",a.appendChild(l),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=tn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);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="${tn("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="${tn("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="${tn("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="${tn("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="${tn("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="${tn("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="${tn("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),xe.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(b5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b5.prototype.isDestroyed=function(){return!1};b5.prototype.destroy=function(){return Vt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var aU=b5;var vvt=new H,x5="-1000px";function cU(e,t,n){if(!c(e))throw new E("scene is required.");if(!c(t))throw new E("selectionIndicatorElement is required.");if(!c(n))throw new E("container is required.");this._scene=e,this._screenPositionX=x5,this._screenPositionY=x5,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,xe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,xe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&c(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Gi.worldToWindowCoordinates(e,i,o)}}cU.prototype.update=function(){if(this.showSelection&&c(this.position)){let e=this.computeScreenSpacePosition(this.position,vvt);if(!c(e))this._screenPositionX=x5,this._screenPositionY=x5;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`}}};cU.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};cU.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};Object.defineProperties(cU.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var lU=cU;function T5(e,t){if(!c(e))throw new E("container is required.");e=In(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 l=new lU(t,this._element,this._container);this._viewModel=l,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(T5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});T5.prototype.isDestroyed=function(){return!1};T5.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),de(this)};var uU=T5;function A5(e,t){if(!c(e))throw new E("scene is required.");this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new gr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",xe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,xe.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Sn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Sn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Sn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Sn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(A5.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new E("duration value must be positive.");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}}});A5.prototype.isDestroyed=function(){return!1};A5.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var fU=A5;var Dvt="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",Pvt="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",Ivt="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 C5(e,t,n){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let i=new fU(t,n);i._globePath=Dvt,i._flatMapPath=Pvt,i._columbusViewPath=Ivt;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 l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.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(l),xe.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},Vt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(C5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});C5.prototype.isDestroyed=function(){return!1};C5.prototype.destroy=function(){return this._viewModel.destroy(),Vt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var dU=C5;function WA(e,t,n){this._color=e,this._height=t,this._base=n??0}WA.prototype.getHeight=function(){return this._height};WA.prototype.getBase=function(){return this._base};WA.prototype.getStartTime=function(){return this._start};WA.prototype.getStopTime=function(){return this._stop};WA.prototype.setRange=function(e,t){this._start=e,this._stop=t};WA.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 hU=WA;function uSe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new G(.5,.5,.5,1),this.backgroundColor=i||new G(0,0,0,0)}uSe.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,l;for(s=0;s<t.timeBarWidth;++s){let u=Q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Q);!c(a)&&Q.greaterThanOrEquals(u,n)?a=s:!c(l)&&Q.greaterThanOrEquals(u,i)&&(l=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),c(a)&&(c(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(l-a,1),this.height))}};var mU=uSe;var $Q=1e12,wd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Al={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},eb=[.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],Ovt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cl(e,t){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("clock is required.");e=In(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=wd.none,this._touchMode=Al.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=Rvt(this),this._onMouseUp=Mvt(this),this._onMouseMove=Lvt(this),this._onMouseWheel=Nvt(this),this._onTouchStart=Fvt(this),this._onTouchMove=kvt(this),this._onTouchEnd=Bvt(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()}Cl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cl.prototype.isDestroyed=function(){return!1};Cl.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),de(this)};Cl.prototype.addHighlightRange=function(e,t,n){let i=new hU(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cl.prototype.addTrack=function(e,t,n,i){let o=new mU(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Cl.prototype.zoomTo=function(e,t){if(!c(e))throw new E("startTime is required.");if(!c(t))throw new E("stopTime is required");if(Q.lessThanOrEquals(t,e))throw new E("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==$r.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)};Cl.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 ZQ(e){return e<10?`0${e.toString()}`:e.toString()}Cl.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`${Ovt[t.month-1]} ${t.day} ${t.year} ${ZQ(t.hour)}:${ZQ(t.minute)}:${ZQ(t.second)}${i}`};Cl.prototype.smallestTicInPixels=7;Cl.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,l=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):h>l&&(h=l,this._timeBarSecondsSpan=l,this._endJulian=Q.addSeconds(this._startJulian,l,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(h/p*1e-5,.4),y,b=Q.toGregorianDate(g);h>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):h>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):h>86400?y=Q.fromDate(new Date(Date.UTC(b.year,0))):y=Q.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let x=Q.secondsDifference(this._startJulian,Q.addSeconds(y,m,new Q)),A=x+h;this._epochJulian=y;function C(U){return Math.floor(x/U)*U}function S(U,q){return Math.ceil(U/q+.5)*q}function v(U){return(U-x)/h}function P(U,q){return U-q*Math.round(U/q)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let M=this._rulerEle.offsetWidth+20;M<30&&(M=180);let R=f;f-=u;let L={startTime:x,startJulian:g,epochJulian:y,duration:h,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(U){s+=U.render(L)});let F=0,_=0,w=0,D=M/p;D>1&&(D=1),D*=this._timeBarSecondsSpan;let I=-1,N=-1,k=eb.length,z;for(z=0;z<k;++z){let U=eb[z];if(++I,F=U,U>D&&U>f)break;N<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(P(F,eb[I]))<1e-5){eb[I]>=f&&(_=eb[I]);break}if(N>=0)for(;N<I;){if(Math.abs(P(_,eb[N]))<1e-5&&eb[N]>=f){w=eb[N];break}++N}}f=R,f>u&&w<1e-5&&Math.abs(f-F)>u&&(w=f,f<=F+u&&(_=0));let V=-999999,j;if(p*(w/this._timeBarSecondsSpan)>=3)for(o=C(w);o<=A;o=S(o,w))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=C(_);o<=A;o=S(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,A+=F,o=C(F);let U=Q.computeTaiMinusUtc(y);for(;o<=A;){let q=Q.addSeconds(g,o-x,new Q);if(F>2.1){let Z=Q.computeTaiMinusUtc(q);Math.abs(Z-U)>.1&&(o+=Z-U,q=Q.addSeconds(g,o-x,new Q))}let Y=Math.round(p*v(o)),te=this.makeLabel(q);this._rulerEle.innerHTML=te,j=this._rulerEle.offsetWidth,j<10&&(j=M);let K=Y-(j/2-1);K>V?(V=K+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${K.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,o=S(o,F)}}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),L.y=0,this._trackList.forEach(function(U){U.render(r._context,L),L.y+=U.height})};Cl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(c(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`)}c(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)))};Cl.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 Rvt(e){return function(t){e._mouseMode!==wd.touchOnly&&(t.button===0?(e._mouseMode=wd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=wd.zoom:e._mouseMode=wd.slide)),t.preventDefault()}}function Mvt(e){return function(t){e._mouseMode=wd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function Lvt(e){return function(t){let n;if(e._mouseMode===wd.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===wd.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===wd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Nvt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;$Q=Math.max(Math.min(Math.abs(n),$Q),1),n/=$Q,e.zoomFrom(Math.pow(1.05,-n))}}function Fvt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=wd.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=Al.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Al.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Al.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=Al.ignore}}function Bvt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Al.singleTap?(e._touchMode=Al.scrub,e._onTouchMove(t)):e._touchMode===Al.scrub&&e._onTouchMove(t),e._mouseMode=wd.touchOnly,n!==1?e._touchMode=n>0?Al.ignore:Al.none:e._touchMode===Al.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function kvt(e){return function(t){let n,i,o,r,s,a,l=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Al.singleTap&&(e._touchMode=Al.slideZoom),e._mouseMode=wd.touchOnly,e._touchMode===Al.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Al.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),c(r)&&(s>0&&e._touchState.spanX>0?(l=e._touchState.spanX/s,a=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*l)/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*l,new Q)),e._touchState.centerX=r,e._touchState.spanX=s))}}Cl.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 pU=Cl;function fSe(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 l=t[a];l.match(o)[0].length>=s&&(l=l.slice(s)),i+=`${l} -`}return i}function vd(e){T.typeOf.object("scene",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(f){t._voxelPrimitive[r]=f});let l=o.getPrimitiveFunction;l===!0&&(l=function(){t[r]=t._voxelPrimitive[r]}),c(l)&&t._getPrimitiveFunctions.push(l);let u=xe.observable();return xe.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),c(a)&&c(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}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=fSe(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===va.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===va.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===va.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-O.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:O.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.translationX=B.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.translationY=B.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.translationZ=B.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.scaleX=B.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.scaleY=B.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)},getPrimitiveFunction:function(){t.scaleZ=B.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&bp(t)}})}var Uvt=new d,Vvt=new d,zvt=new Oa,Hvt=new J;function bp(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,Uvt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,Vvt),i=zvt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=J.fromHeadingPitchRoll(i,Hvt),r=J.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=B.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(vd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(c(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!c(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=fSe(i),c(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,bp(t)}}});vd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};vd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};vd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};vd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};vd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};vd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};vd.prototype.compileShader=function(){c(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new pA({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};vd.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(` -`),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+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};vd.prototype.isDestroyed=function(){return!1};vd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),de(this)};var _U=vd;function E5(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=In(e);let n=document.createElement("div"),i=new _U(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{createSection:s,createCheckbox:a,createRangeInput:l,createButton:u}=fu,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),g=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(l("Screen Space Error","screenSpaceError",0,128)),f.appendChild(l("Step Size","stepSize",0,2));let m=10,y=10,b=O.PI;h.appendChild(l("Translation X","translationX",-m,+m)),h.appendChild(l("Translation Y","translationY",-m,+m)),h.appendChild(l("Translation Z","translationZ",-m,+m)),h.appendChild(l("Scale X","scaleX",0,+y)),h.appendChild(l("Scale Y","scaleY",0,+y)),h.appendChild(l("Scale Z","scaleZ",0,+y)),h.appendChild(l("Heading","angleX",-b,+b)),h.appendChild(l("Pitch","angleY",-b,+b)),h.appendChild(l("Roll","angleZ",-b,+b)),QQ("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),QQ("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),QQ("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let x=document.createElement("div");g.appendChild(x);let A=document.createElement("textarea");A.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(A);let C=u("Compile (Ctrl+Enter)","compileShader");x.appendChild(C);let S=document.createElement("label");S.style.display="block",S.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),x.appendChild(S),xe.applyBindings(i,n)}Object.defineProperties(E5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});E5.prototype.isDestroyed=function(){return!1};E5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};function QQ(e,t,n,i,o,r,s,a,l,u,f,h,p,g){let m=fu.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,l)),y.appendChild(m(i,u)),y.appendChild(m(o,f)),y.appendChild(m(r,h))}var gU=E5;var hSe=Zo(dSe(),1);function Gvt(e){let t=!1,n=window.screen;return c(n)&&(c(n.lockOrientation)?t=n.lockOrientation(e):c(n.mozLockOrientation)?t=n.mozLockOrientation(e):c(n.msLockOrientation)?t=n.msLockOrientation(e):c(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function mSe(){let e=window.screen;c(e)&&(c(e.unlockOrientation)?e.unlockOrientation():c(e.mozUnlockOrientation)?e.mozUnlockOrientation():c(e.msUnlockOrientation)?e.msUnlockOrientation():c(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function jvt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(mSe(),e._locked=!1),e._noSleep.disable(),Cr.exitFullscreen(),n(!1)):(Cr.fullscreen||Cr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=Gvt("landscape")),t.useWebVR=!0,n(!0)))}function S5(e,t){if(!c(e))throw new E("scene is required.");let n=this,i=xe.observable(Cr.enabled),o=xe.observable(!1);this.isVRMode=void 0,xe.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,xe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Cr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=xe.observable(!1);this._isOrthographic=void 0,xe.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new gr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof on)}),this._locked=!1,this._noSleep=new hSe.default,this._command=Sn(function(){jvt(n,e,o,r)},xe.getObservable(this,"isVREnabled")),this._vrElement=In(t)??document.body,this._callback=function(){!Cr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(mSe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Cr.changeEventName,this._callback)}Object.defineProperties(S5.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new E("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}});S5.prototype.isDestroyed=function(){return!1};S5.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Cr.changeEventName,this._callback),de(this)};var bU=S5;var Wvt="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",qvt="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 w5(e,t,n){if(!c(e))throw new E("container is required.");if(!c(t))throw new E("scene is required.");e=In(e);let i=new bU(t,n);i._exitVRPath=qvt,i._enterVRPath=Wvt;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),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(w5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});w5.prototype.isDestroyed=function(){return!1};w5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var xU=w5;var pSe=new le;function ySe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function Yvt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);c(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 Xvt(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(c(r)&&r!=="")return r}return"Unnamed Feature"}function _Se(e,t){let n=e.scene.pick(t.position);if(c(n)){let i=n.id??n.primitive.id;if(i instanceof nr)return i;if(n instanceof Ws)return new nr({name:Xvt(n),description:Yvt(n),feature:n})}if(c(e.scene.globe))return Zvt(e,t.position)}var Kvt=new Q;function eJ(e,t){if(c(t)){let n=t.clock;if(c(n)&&c(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,O.EPSILON2,Kvt)),e.updateFromClock(),e.zoomTo(i,o)}}}var $vt=new d;function Zvt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!c(o))return;let r=new nr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!c(s)||s.length===0){e.selectedEntity=gSe();return}let a=s[0],l=new nr({id:a.name,description:a.description});if(c(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,$vt);l.position=new qc(u)}e.selectedEntity=l},function(){e.selectedEntity===r&&(e.selectedEntity=gSe())}),r}function gSe(){return new nr({id:"None",description:"No features found."})}function Qvt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,l=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(c(n)&&(n.container.style.visibility=p),c(i)&&(i.container.style.visibility=p),c(o)&&(o.container.style.visibility=p),c(r)&&(r.container.style.visibility=p),c(s)&&(s.container.style.visibility=p),c(a)&&(a.container.style.visibility=p),c(l)&&(l.container.style.visibility=p),c(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),c(f)&&(f.container.style.visibility=p),c(h)&&(h.container.style.visibility=p),e._container){let g=t||!c(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ji(e,t){if(!c(e))throw new E("container is required.");if(e=In(e),t=t??W.EMPTY_OBJECT,t.globe===!1&&c(t.baseLayer)&&t.baseLayer!==!1)throw new E("Cannot use baseLayer when globe is disabled.");let n=(!c(t.globe)||t.globe!==!1)&&(!c(t.baseLayerPicker)||t.baseLayerPicker!==!1);if(!n&&c(t.selectedImageryProviderViewModel))throw new E("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.baseLayer instead or set options.baseLayerPicker to true.");if(!n&&c(t.selectedTerrainProviderViewModel))throw new E("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");let 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=t.scene3DOnly??!1,l,u,f=!1;c(t.clockViewModel)?(u=t.clockViewModel,l=u.clock):(l=new Ah,u=new Ok(l),f=!0);let h=new q3(r,{baseLayer:n&&c(t.selectedImageryProviderViewModel)||c(t.baseLayer)||c(t.imageryProvider)?!1:void 0,clock:l,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:c(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 gr;g.add(l.onTick,Ji.prototype._onTick,this);let m;if(!c(t.selectionIndicator)||t.selectionIndicator!==!1){let q=document.createElement("div");q.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(q),m=new uU(q,p)}let y;if(!c(t.infoBox)||t.infoBox!==!1){let q=document.createElement("div");q.className="cesium-viewer-infoBoxContainer",o.appendChild(q),y=new tU(q);let Y=y.viewModel;g.add(Y.cameraClicked,Ji.prototype._onInfoBoxCameraClicked,this),g.add(Y.closeClicked,Ji.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let x;if(!c(t.geocoder)||t.geocoder!==!1){let q=document.createElement("div");q.className="cesium-viewer-geocoderContainer",b.appendChild(q);let Y;typeof t.geocoder=="string"?Y=[new RA({scene:p,geocodeProviderType:t.geocoder})]:c(t.geocoder)&&typeof t.geocoder!="boolean"&&(Y=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),x=new Qk({container:q,geocoderServices:Y,scene:p}),g.add(x.viewModel.search.beforeExecute,Ji.prototype._clearObjects,this)}let A;if((!c(t.homeButton)||t.homeButton!==!1)&&(A=new $k(b,p),c(x)&&g.add(A.viewModel.command.afterExecute,function(){let q=x.viewModel;q.searchText="",q.isSearchInProgress&&q.search()}),g.add(A.viewModel.command.beforeExecute,Ji.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&a)throw new E("options.sceneModePicker is not available when options.scene3DOnly is set to true.");let C;!a&&(!c(t.sceneModePicker)||t.sceneModePicker!==!1)&&(C=new dU(b,p));let S;t.projectionPicker&&(S=new iU(b,p));let v,P;if(n){let q=t.imageryProviderViewModels??kk(),Y=t.terrainProviderViewModels??Uk();v=new Bk(b,{globe:p.globe,imageryProviderViewModels:q,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Y,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),P=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(c(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),c(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),c(t.terrain)){if(c(t.terrainProvider))throw new E("Specify either options.terrainProvider or options.terrain.");n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain)}let M;if(!c(t.navigationHelpButton)||t.navigationHelpButton!==!1){let q=!0;try{if(c(window.localStorage)){let Y=window.localStorage.getItem("cesium-hasSeenNavHelp");c(Y)&&Y?q=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new aU({container:b,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??q})}let R;if(!c(t.animation)||t.animation!==!1){let q=document.createElement("div");q.className="cesium-viewer-animationContainer",o.appendChild(q),R=new Lk(q,new Nk(u))}let L;if(!c(t.timeline)||t.timeline!==!1){let q=document.createElement("div");q.className="cesium-viewer-timelineContainer",o.appendChild(q),L=new pU(q,l),L.addEventListener("settime",ySe,!1),L.zoomTo(l.startTime,l.stopTime)}let F,_,w;(!c(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),F=new Xk(w,t.fullscreenElement),_=Da(F.viewModel,"isFullscreenEnabled",function(q){w.style.display=q?"block":"none",c(L)&&(L.container.style.right=`${w.clientWidth}px`,L.resize())}));let D,I,N;if(t.vrButton){let q=document.createElement("div");q.className="cesium-viewer-vrContainer",o.appendChild(q),D=new xU(q,p,t.fullScreenElement),I=Da(D.viewModel,"isVREnabled",function(Y){q.style.display=Y?"block":"none",c(F)&&(q.style.right=`${w.clientWidth}px`),c(L)&&(L.container.style.right=`${q.clientWidth}px`,L.resize())}),N=Da(D.viewModel,"isVRMode",function(Y){Qvt(i,Y)})}this._baseLayerPickerDropDown=P,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=A,this._sceneModePicker=C,this._projectionPicker=S,this._baseLayerPicker=v,this._navigationHelpButton=M,this._animation=R,this._timeline=L,this._fullscreenButton=F,this._vrButton=D,this._geocoder=x,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=c(y)||c(m),this._selectedEntity=void 0,this._selectedEntityChanged=new pe;let k=this._cesiumWidget.dataSources,z=this._cesiumWidget.dataSourceDisplay;g.add(k.dataSourceAdded,Ji.prototype._onDataSourceAdded,this),g.add(k.dataSourceRemoved,Ji.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,Ji.prototype.resize,this);let V=k.length;for(let q=0;q<V;q++)this._dataSourceAdded(k,k.get(q));this._dataSourceAdded(void 0,z.defaultDataSource),g.add(k.dataSourceAdded,Ji.prototype._dataSourceAdded,this),g.add(k.dataSourceRemoved,Ji.prototype._dataSourceRemoved,this);function j(q){let Y=_Se(i,q);c(Y)?X.getValueOrUndefined(Y.position,i.clock.currentTime)?i.trackedEntity=Y:i.zoomTo(Y):c(i.trackedEntity)&&(i.trackedEntity=void 0)}function U(q){i.selectedEntity=_Se(i,q)}h.screenSpaceEventHandler.setInputAction(U,An.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(j,An.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Ji.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=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(e)?c(t)&&t.animateAppear():c(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,eJ(this._timeline,e))}}});Ji.prototype.extend=function(e,t){if(!c(e))throw new E("mixin is required.");e(this,t)};Ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=c(this._animation),r=c(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(c(a)&&(a.style.maxHeight=`${s}px`),c(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}c(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let l=this._timeline,u,f=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,b=l.container,x=b.style;p=b.clientHeight+3,x.left=`${f}px`;let A=0;c(m)&&(A+=m.container.clientWidth),c(y)&&(A+=y.container.clientWidth),x.right=`${A}px`,l.resize()}!r&&c(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};Ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ji.prototype.render=function(){this._cesiumWidget.render()};Ji.prototype.isDestroyed=function(){return!1};Ji.prototype.destroy=function(){return c(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(An.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(An.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),c(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),c(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),c(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),c(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),c(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),c(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),c(this._timeline)&&(this._timeline.removeEventListener("settime",ySe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),c(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),c(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),c(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),c(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(),de(this)};Ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ji.prototype._onEntityCollectionChanged,this)};Ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ji.prototype._onEntityCollectionChanged,this),c(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=c(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,pSe)!==lt.FAILED?n=pSe.center:c(o.position)&&(n=o.position.getValue(t,n)),i=c(n));let s=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(s)&&(s.position=d.clone(n,s.position),s.showSelection=r&&i,s.update());let a=c(this._infoBox)?this._infoBox.viewModel:void 0;c(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=X.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};Ji.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)}};Ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;c(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&eJ(this.timeline,e)};Ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&eJ(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var tJ=Ji;function Jvt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Gk(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var nJ=Jvt;function eDt(e){if(!c(e))throw new E("viewer is required.");let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new qk(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var iJ=eDt;function tDt(e,t){if(!c(e))throw new E("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new E("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new E("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new E("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new E("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new E("flyToOnDrop is already defined by another mixin.");t=t??W.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new pe,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,l=t.proxy;s=In(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){if(!c(f))throw new E("value is required.");bSe(s,u),s=f,oJ(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?oJ(s,u):bSe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return l},set:function(f){l=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){qA(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let m=h[g],y=new FileReader;y.onload=nDt(e,m,l,a),y.onerror=iDt(e,m),y.readAsText(m)}}oJ(s,u),e.destroy=tk(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function qA(e){e.stopPropagation(),e.preventDefault()}function bSe(e,t){let n=e;c(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",qA,!1),n.removeEventListener("dragover",qA,!1),n.removeEventListener("dragexit",qA,!1))}function oJ(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",qA,!1),e.addEventListener("dragover",qA,!1),e.addEventListener("dragexit",qA,!1)}function nDt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=SN.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=T0.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=kT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=BF.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}c(a)&&e.dataSources.add(a).then(function(l){e.flyToOnDrop&&e.flyTo(l)}).catch(function(l){e.dropError.raiseEvent(e,s,l)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function iDt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var rJ=tDt;function oDt(e,t){if(!c(e))throw new E("viewer is required.");t=t??W.EMPTY_OBJECT;let n=new rU({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var sJ=oDt;function rDt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new gU(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var aJ=rDt;globalThis.CESIUM_VERSION="1.129";var sDt="1.129";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainProvider,TerrainQuantization,TerrainState,Texture,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectClippingPlanes,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shadersconvertUvToBox,_shadersconvertUvToCylinder,_shadersconvertUvToEllipsoid,_shaderscosineAndSine,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defaultValue,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); + </div>`,n.appendChild(i);let r=new U8(t);ve.track(r),ve.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var Ole=p5t;var g5t="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",_5t="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 Mle(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",ve.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,ve.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?_5t:g5t}}),ve.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Mle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Mle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var z8=Mle;function oq(e){e=Ln(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=t.ownerDocument,r,o,s,a,c;function u(b){!l(r)||l(b)&&b.pointerId!==r||(r=void 0,t.classList.remove("cesium-infoBox-dragging"))}function f(b){if(!(b.button!==0||b.isPrimary===!1)){r=b.pointerId,o=b.clientX,s=b.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(b.pointerId)}catch{}b.preventDefault()}}function d(b){!l(r)||b.pointerId!==r||(t.style.left=`${a+b.clientX-o}px`,t.style.top=`${c+b.clientY-s}px`,b.preventDefault())}n.addEventListener("pointerdown",f),i.addEventListener("pointermove",d),i.addEventListener("pointerup",u),i.addEventListener("pointercancel",u);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.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(p);let g=document.createElement("button");g.type="button",g.className="cesium-infoBox-close",g.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),g.innerHTML="×",t.appendChild(g);let m=document.createElement("iframe");m.className="cesium-infoBox-iframe",m.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),m.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),m.setAttribute("allowfullscreen",!0),t.appendChild(m);let y=new z8;ve.applyBindings(y,t),this._container=e,this._element=t,this._frame=m,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=f,this._handlePointerMove=d,this._stopDragging=u;let A=this;m.addEventListener("load",function(){let b=m.contentDocument,x=b.createElement("link");x.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),x.rel="stylesheet",x.type="text/css";let T=b.createElement("div");T.className="cesium-infoBox-description",b.head.appendChild(x),b.body.appendChild(T),A._descriptionSubscription=Cc(y,"description",function(E){m.style.height="5px",T.innerHTML=E;let v=null,S=T.firstElementChild;if(S!==null&&T.childNodes.length===1){let R=window.getComputedStyle(S);if(R!==null){let O=R["background-color"],L=z.fromCssColorString(O);l(L)&&L.alpha!==0&&(v=R["background-color"])}}t.style["background-color"]=v;let I=T.getBoundingClientRect().height;m.style.height=`${I}px`})}),m.setAttribute("src","about:blank")}Object.defineProperties(oq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});oq.prototype.isDestroyed=function(){return!1};oq.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),ve.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var V8=oq;function Yke(){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",ve.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(Yke.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var j8=Yke;function sq(e){let t=Ln(e.container),n=new j8,i=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 r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.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=Zt("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 u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Zt("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="${Zt("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="${Zt("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(d);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="${Zt("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="${Zt("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="${Zt("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="${Zt("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),ve.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(sq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sq.prototype.isDestroyed=function(){return!1};sq.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var H8=sq;function Nle(e){this._scene=e.scene,this.lowFrameRateMessage=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,ve.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=Q4.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(Nle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Nle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var G8=Nle;function aq(e){let t=Ln(e.container),n=new G8(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),ve.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(aq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aq.prototype.isDestroyed=function(){return!1};aq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var W8=aq;function cq(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Go,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",ve.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,ve.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.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=re}Object.defineProperties(cq.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}}});cq.prototype.isDestroyed=function(){return!1};cq.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var q8=cq;var y5t="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",A5t="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",b5t="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 lq(e,t,n){e=Ln(e);let i=new q8(t,n);i._globePath=y5t,i._flatMapPath=A5t,i._columbusViewPath=b5t;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.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'),o.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 -->',r.appendChild(o);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 }'),r.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 }'),r.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 }'),r.appendChild(c),ve.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(lq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lq.prototype.isDestroyed=function(){return!1};lq.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Y8=lq;function uq(e){this._scene=e,this._orthographic=e.camera.frustum instanceof gn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,ve.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;ve.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Go,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof gn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(uq.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}}});uq.prototype.isDestroyed=function(){return!1};uq.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var X8=uq;var x5t="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",T5t="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 fq(e,t){e=Ln(e);let n=new X8(t);n._perspectivePath=x5t,n._orthographicPath=T5t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.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'),r.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(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.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(o);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),ve.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(fq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});fq.prototype.isDestroyed=function(){return!1};fq.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var K8=fq;var E5t=new U,dq="-1000px";function $8(e,t,n){this._scene=e,this._screenPositionX=dq,this._screenPositionY=dq,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,ve.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,ve.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),ve.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return hr.worldToWindowCoordinates(e,i,r)}}$8.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,E5t);if(!l(e))this._screenPositionX=dq,this._screenPositionY=dq;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};$8.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:xs.EXPONENTIAL_OUT})};$8.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:xs.EXPONENTIAL_OUT})};Object.defineProperties($8.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var J8=$8;function hq(e,t){e=Ln(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",r="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",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new J8(t,this._element,this._container);this._viewModel=c,ve.applyBindings(this._viewModel,this._element)}Object.defineProperties(hq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});hq.prototype.isDestroyed=function(){return!1};hq.prototype.destroy=function(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),ue(this)};var Z8=hq;function Xke(e){let t=e.split(` +`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} +`}return i}function Oh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=ve.observable();return ve.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=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 r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Xke(r)}}),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 r=t._voxelPrimitive.shape;t.shapeIsBox=r===Ec.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Ec.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Ec.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationX=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationY=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationZ=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleX=N.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleY=N.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleZ=N.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}})}var C5t=new h,v5t=new h,S5t=new wc,w5t=new $;function J0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,C5t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,v5t),i=S5t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,w5t),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=N.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Oh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Xke(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,J0(t)}}});Oh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Oh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Oh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Oh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Oh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Oh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Oh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new W0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Oh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Oh.prototype.isDestroyed=function(){return!1};Oh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),ue(this)};var Q8=Oh;function mq(e,t){e=Ln(e);let n=document.createElement("div"),i=new Q8(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=yf,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Clipping","clippingVisible","toggleClipping"),g=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=D.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Lle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Lle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Lle("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(E),ve.applyBindings(i,n)}Object.defineProperties(mq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});mq.prototype.isDestroyed=function(){return!1};mq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Lle(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=yf.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var ej=mq;var $ke=Qo(Kke(),1);function I5t(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 Jke(){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 P5t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(Jke(),e._locked=!1),e._noSleep.disable(),es.exitFullscreen(),n(!1)):(es.fullscreen||es.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=I5t("landscape")),t.useWebVR=!0,n(!0)))}function pq(e,t){let n=this,i=ve.observable(es.enabled),r=ve.observable(!1);this.isVRMode=void 0,ve.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,ve.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&es.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=ve.observable(!1);this._isOrthographic=void 0,ve.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Go,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof gn)}),this._locked=!1,this._noSleep=new $ke.default,this._command=Rn(function(){P5t(n,e,r,o)},ve.getObservable(this,"isVREnabled")),this._vrElement=Ln(t)??document.body,this._callback=function(){!es.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(Jke(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(pq.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});pq.prototype.isDestroyed=function(){return!1};pq.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(es.changeEventName,this._callback),ue(this)};var nj=pq;var D5t="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",R5t="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 gq(e,t,n){e=Ln(e);let i=new nj(t,n);i._exitVRPath=R5t,i._enterVRPath=D5t;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.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(r),ve.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(gq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gq.prototype.isDestroyed=function(){return!1};gq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var ij=gq;function XC(e,t,n){this._color=e,this._height=t,this._base=n??0}XC.prototype.getHeight=function(){return this._height};XC.prototype.getBase=function(){return this._base};XC.prototype.getStartTime=function(){return this._start};XC.prototype.getStopTime=function(){return this._stop};XC.prototype.setRange=function(e,t){this._start=e,this._stop=t};XC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var rj=XC;function Zke(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}Zke.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=K.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new K);!l(a)&&K.greaterThanOrEquals(u,n)?a=s:!l(c)&&K.greaterThanOrEquals(u,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 oj=Zke;var Ble=1e12,Mh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Tu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},qb=[.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],O5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Eu(e,t){e=Ln(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=Mh.none,this._touchMode=Tu.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=M5t(this),this._onMouseUp=N5t(this),this._onMouseMove=L5t(this),this._onMouseWheel=F5t(this),this._onTouchStart=B5t(this),this._onTouchMove=U5t(this),this._onTouchEnd=k5t(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Eu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Eu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Eu.prototype.isDestroyed=function(){return!1};Eu.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),ue(this)};Eu.prototype.addHighlightRange=function(e,t,n){let i=new rj(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Eu.prototype.addTrack=function(e,t,n,i){let r=new oj(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Eu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==As.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),s=K.secondsDifference(i,this._startJulian),a=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=K.addSeconds(this._endJulian,s,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=K.addSeconds(this._startJulian,a,new K),this._endJulian=r,this._timeBarSecondsSpan=K.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)};Eu.prototype.zoomFrom=function(e){let t=K.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(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function kle(e){return e<10?`0${e.toString()}`:e.toString()}Eu.prototype.makeLabel=function(e){let t=K.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`${O5t[t.month-1]} ${t.day} ${t.year} ${kle(t.hour)}:${kle(t.minute)}:${kle(t.second)}${i}`};Eu.prototype.smallestTicInPixels=7;Eu.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=K.addSeconds(this._startJulian,a,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(k){return Math.floor(b/k)*k}function E(k,G){return Math.ceil(k/G+.5)*G}function v(k){return(k-b)/d}function S(k,G){return k-G*Math.round(k/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-a,new K));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(O)});let L=0,_=0,C=0,w=I/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let P=-1,M=-1,F=qb.length,V;for(V=0;V<F;++V){let k=qb[V];if(++P,L=k,k>w&&k>f)break;M<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=P)}if(P>0){for(;P>0;)if(--P,Math.abs(S(L,qb[P]))<1e-5){qb[P]>=f&&(_=qb[P]);break}if(M>=0)for(;M<P;){if(Math.abs(S(_,qb[M]))<1e-5&&qb[M]>=f){C=qb[M];break}++M}}f=R,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let B=-999999,j;if(p*(C/this._timeBarSecondsSpan)>=3)for(r=T(C);r<=x;r=E(r,C))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=E(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,x+=L,r=T(L);let k=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(L>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-k)>.1&&(r+=J-k,G=K.addSeconds(g,r-b,new K))}let q=Math.round(p*v(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=I);let W=q-(j/2-1);W>B?(B=W+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,r=E(r,L)}}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),O.y=0,this._trackList.forEach(function(k){k.render(o._context,O),O.y+=k.height})};Eu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.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(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};Eu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),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 M5t(e){return function(t){e._mouseMode!==Mh.touchOnly&&(t.button===0?(e._mouseMode=Mh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Mh.zoom:e._mouseMode=Mh.slide)),t.preventDefault()}}function N5t(e){return function(t){e._mouseMode=Mh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function L5t(e){return function(t){let n;if(e._mouseMode===Mh.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===Mh.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===Mh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function F5t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Ble=Math.max(Math.min(Math.abs(n),Ble),1),n/=Ble,e.zoomFrom(Math.pow(1.05,-n))}}function B5t(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Mh.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Tu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Tu.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Tu.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Tu.ignore}}function k5t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Tu.singleTap?(e._touchMode=Tu.scrub,e._onTouchMove(t)):e._touchMode===Tu.scrub&&e._onTouchMove(t),e._mouseMode=Mh.touchOnly,n!==1?e._touchMode=n>0?Tu.ignore:Tu.none:e._touchMode===Tu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function U5t(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Tu.singleTap&&(e._touchMode=Tu.slideZoom),e._mouseMode=Mh.touchOnly,e._touchMode===Tu.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Tu.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,a=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(a,K.addSeconds(a,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=s))}}Eu.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 sj=Eu;var Qke=new ce;function n3e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function z5t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function V5t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function e3e(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Qr)return i;if(n instanceof sa||n instanceof dE)return new Qr({name:V5t(n),description:z5t(n),feature:n})}return W5t(e,t.position)}var j5t=new K;function Ule(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,D.EPSILON2,j5t)),e.updateFromClock(),e.zoomTo(i,r)}}}var H5t=new h;function G5t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Ko)return i}}function W5t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=G5t(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new Qr({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=t3e();return}let c=a[0],u=new Qr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,H5t);u.position=new nu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=t3e())}),s}function t3e(){return new Qr({id:"None",description:"No features found."})}function q5t(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.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(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function lr(e,t){e=Ln(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new im,u=new x8(c),f=!0);let d=new N4(o,{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=d.scene,g=new Go;g.add(c.onTick,lr.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new Z8(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new V8(G);let q=y.viewModel;g.add(q.cameraClicked,lr.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,lr.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let q;typeof t.geocoder=="string"?q=[new Jx({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new F8({container:G,geocoderServices:q,scene:p}),g.add(b.viewModel.search.beforeExecute,lr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new k8(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,lr.prototype._clearTrackedObject,this));let T;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new Y8(A,p));let E;t.projectionPicker&&(E=new K8(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??R8(),q=t.terrainProviderViewModels??O8();v=new D8(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),S=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let I;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}I=new H8({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new C8(G,new v8(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new sj(G,c),O.addEventListener("settime",n3e,!1),O.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",r.appendChild(C),L=new N8(C,t.fullscreenElement),_=Cc(L.viewModel,"isFullscreenEnabled",function(G){C.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${C.clientWidth}px`,O.resize())}));let w,P,M;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),w=new ij(G,p,t.fullScreenElement),P=Cc(w.viewModel,"isVREnabled",function(q){G.style.display=q?"block":"none",l(L)&&(G.style.right=`${C.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),M=Cc(w.viewModel,"isVRMode",function(q){q5t(i,q)})}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=_,this._vrSubscription=P,this._vrModeSubscription=M,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=I,this._animation=R,this._timeline=O,this._fullscreenButton=L,this._vrButton=w,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,lr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,lr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,lr.prototype.resize,this);let B=F.length;for(let G=0;G<B;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,lr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,lr.prototype._dataSourceRemoved,this);function j(G){let q=e3e(i,G);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(G){i.selectedEntity=e3e(i,G)}d.screenSpaceEventHandler.setInputAction(k,un.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,un.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(lr.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,Ule(this._timeline,e))}}});lr.prototype.extend=function(e,t){e(this,t)};lr.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=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 m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};lr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};lr.prototype.render=function(){this._cesiumWidget.render()};lr.prototype.isDestroyed=function(){return!1};lr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(un.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(un.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",n3e,!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(),ue(this)};lr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(lr.prototype._onEntityCollectionChanged,this)};lr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(lr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};lr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};lr.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,Qke)!==Pt.FAILED?n=Qke.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=o&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=o,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(a.titleText=r.name??r.id,a.description=X.getValueOrDefault(r.description,t,"")):(a.titleText="",a.description=""))};lr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};lr.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)}};lr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};lr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};lr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};lr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Ule(this.timeline,e)};lr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Ule(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,lr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};lr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};lr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};lr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};lr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};lr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var zle=lr;function Y5t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Ko&&(e.tileset=n.primitive),e.pickActive=!1}}function r3e(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Ko&&(e.tileset=i.primitive)},un.MOUSE_MOVE):(e._eventHandler.removeInputAction(un.MOUSE_MOVE),e.picking=e.picking)}var X5t={maximumFractionDigits:3};function aj(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,X5t):Math.round(t).toLocaleString()}function cj(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[ao.PICK]:e._statisticsPerPass[ao.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>${aj(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${aj(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${aj(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function o3e(){let e=Li.statistics;return` + <ul class="cesium-cesiumInspector-statistics"> + <li><strong>Geometry Memory (MB): </strong>${aj(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${aj(e.texturesByteLength)}</li> + </ul> + `}var K5t=[{text:"Highlight",value:Yu.HIGHLIGHT},{text:"Replace",value:Yu.REPLACE},{text:"Mix",value:Yu.MIX}],i3e=new z(1,1,0,.4),$5t=new z,_q=new z;function vc(e,t){let n=this,i=e.canvas;this._eventHandler=new ra(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new ay({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,ve.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=ve.observable({}),this.properties=[],ve.defineProperty(this,"properties",function(){let k=[],G=n._properties();for(let q in G)G.hasOwnProperty(q)&&k.push(q);return k});let r=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=ve.observable();ve.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Yu.HIGHLIGHT;let s=ve.observable(),a=ve.observable();ve.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(G){let q=e.pick(G.endPosition);if(q instanceof sa?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},un.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(un.MOUSE_MOVE))}}),this.picking=!0;let c=ve.observable();ve.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 u=ve.observable();ve.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=ve.observable();ve.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=ve.observable();ve.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=ve.observable();ve.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=ve.observable();ve.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,ve.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 m=ve.observable();ve.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let y=ve.observable();ve.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(k){y(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=ve.observable();ve.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(k){A(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=ve.observable();ve.defineProperty(this,"showUrl",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let x=ve.observable();ve.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(k){k=Number(k),isNaN(k)||(x(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,ve.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(k){let G=Math.pow(k,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let E=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=Y5t(this),S=ve.observable();ve.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,un.LEFT_CLICK):n._eventHandler.removeInputAction(un.LEFT_CLICK)}});let I=ve.observable();ve.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=ve.observable();ve.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let O=ve.observable();ve.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=ve.observable();ve.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=ve.observable();ve.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let C=ve.observable();ve.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=ve.observable();ve.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let P=ve.observable();ve.defineProperty(this,"skipLevelOfDetail",{get:function(){return P()},set:function(k){P(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let M=ve.observable();ve.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let F=ve.observable();ve.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=ve.observable();ve.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let B=ve.observable();ve.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(k){B(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=ve.observable();ve.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(k){j(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)||r3e(this,!0)}Object.defineProperties(vc.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 K5t}},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 r=0;r<n;++r){let o=t[r];this[o]=this[o]}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=cj(e,!1),this._pickStatisticsText=cj(e,!0),this._resourceCacheStatisticsText=o3e(),r3e(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,$5t):z.WHITE:t.color=_q,this._scene.requestRender()),l(e)&&(z.clone(e.color,_q),e.color=i3e,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()&&!Vle(t.content)&&(t.color=_q,this._scene.requestRender()),l(e)&&!Vle(e.content)&&(z.clone(e.color,_q),e.color=i3e,this._scene.requestRender()),this._tile=e}}});function Vle(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(!Vle(t[i]))return!1;return!0}return!1}vc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};vc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};vc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};vc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};vc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};vc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};vc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};vc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};vc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};vc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};vc.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 P_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};vc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};vc.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=cj(e,!1),this._pickStatisticsText=cj(e,!0),this._resourceCacheStatisticsText=o3e())};vc.prototype.isDestroyed=function(){return!1};vc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),ue(this)};vc.getStatistics=cj;var lj=vc;function yq(e,t){e=Ln(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new lj(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),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=yf.createSection,c=yf.createCheckbox,u=yf.createRangeInput,f=yf.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(E),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),S=document.createElement("p");S.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),S.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),S.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(S),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 I=document.createElement("div");I.setAttribute("data-bind","visible: pointCloudShading"),I.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),I.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),I.appendChild(u("Base Resolution","baseResolution",0,1,.01)),I.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(I);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),I.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let P=document.createElement("div");A.appendChild(P),P.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),P.appendChild(M);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");P.appendChild(V);let B=document.createElement("div");B.className="cesium-cesiumInspector-error",B.setAttribute("data-bind","text: editorError"),P.appendChild(B),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(k);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),ve.applyBindings(r,n)}Object.defineProperties(yq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yq.prototype.isDestroyed=function(){return!1};yq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var uj=yq;function J5t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new uj(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var jle=J5t;function Z5t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new I8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Hle=Z5t;function Q5t(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Ln(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){s3e(s,u),s=f,Gle(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Gle(s,u):s3e(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){KC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=e9t(e,m,c,a),y.onerror=t9t(e,m),y.readAsText(m)}}Gle(s,u),e.destroy=QN(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function KC(e){e.stopPropagation(),e.preventDefault()}function s3e(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",KC,!1),n.removeEventListener("dragover",KC,!1),n.removeEventListener("dragexit",KC,!1))}function Gle(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",KC,!1),e.addEventListener("dragover",KC,!1),e.addEventListener("dragexit",KC,!1)}function e9t(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=T3.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Cb.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=aC.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=VU.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 t9t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Wle=Q5t;function n9t(e,t){t=t??H.EMPTY_OBJECT;let n=new W8({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var qle=n9t;function i9t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new ej(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Yle=i9t;globalThis.CESIUM_VERSION="1.145.0";var r9t="1.145.0";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,Azure2DImageryProvider,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferPoint,BufferPointCollection,BufferPointMaterial,BufferPolygon,BufferPolygonCollection,BufferPolygonMaterial,BufferPolyline,BufferPolylineCollection,BufferPolylineMaterial,BufferPrimitive,BufferPrimitiveCollection,BufferPrimitiveMaterial,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,CartesianRectangle,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTileVectorFeature,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesTerrainData,Cesium3DTilesTerrainGeometryProcessor,Cesium3DTilesTerrainProvider,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,Controller,ControllerHost,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubeMapPanorama,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EdgeDetectionPipelineStage,EdgeDisplayMode,EdgeFramebuffer,EdgeVisibilityPipelineStage,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,EquirectangularPanorama,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GaussianSplat3DTileContent,GaussianSplatPrimitive,GaussianSplatRenderResources,GaussianSplatSorter,GaussianSplatTextureGenerator,GeoJsonDataSource,GeoJsonLoader,GeoJsonPrimitive,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfSpzLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,Google2DImageryProvider,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GoogleStreetViewCubeMapPanoramaProvider,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,HybridScreenSpacePanCameraController,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryConfiguration,ImageryCoverage,ImageryFlags,ImageryInput,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryPipelineStage,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonImageryProviderFactory,IonResource,IonSnapGeometryType,IonSnapHeat,IonSnapMode,IonSnapParentGeometryType,IonSnapService,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,MVTDataProvider,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,MappedPositions,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelImagery,ModelImageryMapping,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelPrimitiveImagery,ModelReader,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVectorLookupPipelineStage,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,MouseButton,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Panorama,PanoramaProvider,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathMode,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickId,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,PlanarFillIdFramebuffer,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceElevatorCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,ScreenSpaceInputBindings,ScreenSpaceMapCameraController,ScreenSpaceTiltOrbitCameraController,ScreenSpaceZoomCameraController,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,SharedContext,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SnapFramebuffer,SnapService,Snapping,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,Sync,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainPicker,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplate3DTilesDataProvider,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VectorGltf3DTileContent,VectorPipeline,VectorProvider,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoundsCollection,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBufferPointMaterialFS,_shadersBufferPointMaterialVS,_shadersBufferPolygonMaterialFS,_shadersBufferPolygonMaterialVS,_shadersBufferPolylineMaterialFS,_shadersBufferPolylineMaterialVS,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersConstantLodStageFS,_shadersConstantLodStageVS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCubeMapPanoramaVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersEdgeDetectionStageFS,_shadersEdgeVisibilityStageFS,_shadersEdgeVisibilityStageVS,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersectPlane,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModelVectorLookupStageFS,_shadersModelVectorLookupStageVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveGaussianSplatFS,_shadersPrimitiveGaussianSplatVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorCommon,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shaderscomputeTextureTransform,_shadersconvertLocalToBoxUv,_shadersconvertLocalToCylinderUv,_shadersconvertLocalToEllipsoidUv,_shaderscosineAndSine,_shadersdecodeRGB8,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToCartographicDelta,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassCesium3DTileEdges,_shaderspassCesium3DTileEdgesDirect,_shaderspassCesium3DTilePlanarFillId,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGaussianSplats,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackTexture,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addAllToArray,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,assert,barycentricCoordinates,binarySearch,buildModuleUrl,buildVectorGltfFromMVT,buildVoxelCustomShader,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createColorRamp,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createVectorTileBuffersFromModelComponents,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeMVT,decodeVectorPolylinePositions,defaultPickWorldPosition,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findMeshoptExtension,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMeshPrimitives,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,mostDetailedSurfaceHeight,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,positionForSurfaceHeight,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,renderBufferPointCollection,renderBufferPolygonCollection,renderBufferPolylineCollection,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); //# sourceMappingURL=index.cjs.map diff --git a/plugins/feature/map/Cesium/index.js b/plugins/feature/map/Cesium/index.js index 704491daa..4115380f6 100644 --- a/plugins/feature/map/Cesium/index.js +++ b/plugins/feature/map/Cesium/index.js @@ -1,7 +1,7 @@ /** * @license * Cesium - https://github.com/CesiumGS/cesium - * Version 1.129 + * Version 1.145.0 * * Copyright 2011-2022 Cesium Contributors * @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var cEe=Object.create;var eZ=Object.defineProperty;var lEe=Object.getOwnPropertyDescriptor;var uEe=Object.getOwnPropertyNames;var fEe=Object.getPrototypeOf,dEe=Object.prototype.hasOwnProperty;var cO=(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 Wu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var hEe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of uEe(t))!dEe.call(e,o)&&o!==n&&eZ(e,o,{get:()=>t[o],enumerable:!(i=lEe(t,o))||i.enumerable});return e};var jr=(e,t,n)=>(n=e!=null?cEe(fEe(e)):{},hEe(t||!e||!e.__esModule?eZ(n,"default",{value:e,enumerable:!0}):n,e));var lO=Wu((YSt,tZ)=>{var np=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)};np.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}};np.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};np.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};np.prototype.random_int31=function(){return this.random_int()>>>1};np.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};np.prototype.random=function(){return this.random_int()*(1/4294967296)};np.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};np.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};tZ.exports=np});var wZ=Wu((cT,lT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof cT=="object"&&cT&&!cT.nodeType&&cT,n=typeof lT=="object"&&lT&&!lT.nodeType&&lT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,l=26,u=38,f=700,h=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=s-a,E=Math.floor,S=String.fromCharCode,v;function P(V){throw new RangeError(x[V])}function M(V,j){for(var U=V.length,q=[];U--;)q[U]=j(V[U]);return q}function R(V,j){var U=V.split("@"),q="";U.length>1&&(q=U[0]+"@",V=U[1]),V=V.replace(b,".");var X=V.split("."),te=M(X,j).join(".");return q+te}function L(V){for(var j=[],U=0,q=V.length,X,te;U<q;)X=V.charCodeAt(U++),X>=55296&&X<=56319&&U<q?(te=V.charCodeAt(U++),(te&64512)==56320?j.push(((X&1023)<<10)+(te&1023)+65536):(j.push(X),U--)):j.push(X);return j}function B(V){return M(V,function(j){var U="";return j>65535&&(j-=65536,U+=S(j>>>10&1023|55296),j=56320|j&1023),U+=S(j),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function w(V,j){return V+22+75*(V<26)-((j!=0)<<5)}function D(V,j,U){var q=0;for(V=U?E(V/f):V>>1,V+=E(V/j);V>A*l>>1;q+=s)V=E(V/A);return E(q+(A+1)*V/(V+u))}function I(V){var j=[],U=V.length,q,X=0,te=p,K=h,Z,ee,me,xe,ue,ye,Ae,Pe,Ee;for(Z=V.lastIndexOf(g),Z<0&&(Z=0),ee=0;ee<Z;++ee)V.charCodeAt(ee)>=128&&P("not-basic"),j.push(V.charCodeAt(ee));for(me=Z>0?Z+1:0;me<U;){for(xe=X,ue=1,ye=s;me>=U&&P("invalid-input"),Ae=_(V.charCodeAt(me++)),(Ae>=s||Ae>E((r-X)/ue))&&P("overflow"),X+=Ae*ue,Pe=ye<=K?a:ye>=K+l?l:ye-K,!(Ae<Pe);ye+=s)Ee=s-Pe,ue>E(r/Ee)&&P("overflow"),ue*=Ee;q=j.length+1,K=D(X-xe,q,xe==0),E(X/q)>r-te&&P("overflow"),te+=E(X/q),X%=q,j.splice(X++,0,te)}return B(j)}function N(V){var j,U,q,X,te,K,Z,ee,me,xe,ue,ye=[],Ae,Pe,Ee,Ve;for(V=L(V),Ae=V.length,j=p,U=0,te=h,K=0;K<Ae;++K)ue=V[K],ue<128&&ye.push(S(ue));for(q=X=ye.length,X&&ye.push(g);q<Ae;){for(Z=r,K=0;K<Ae;++K)ue=V[K],ue>=j&&ue<Z&&(Z=ue);for(Pe=q+1,Z-j>E((r-U)/Pe)&&P("overflow"),U+=(Z-j)*Pe,j=Z,K=0;K<Ae;++K)if(ue=V[K],ue<j&&++U>r&&P("overflow"),ue==j){for(ee=U,me=s;xe=me<=te?a:me>=te+l?l:me-te,!(ee<xe);me+=s)Ve=ee-xe,Ee=s-xe,ye.push(S(w(xe+Ve%Ee,0))),ee=E(Ve/Ee);ye.push(S(w(ee,0))),te=D(U,Pe,q==X),U=0,++q}++U,++j}return ye.join("")}function k(V){return R(V,function(j){return m.test(j)?I(j.slice(4).toLowerCase()):j})}function H(V){return R(V,function(j){return y.test(j)?"xn--"+N(j):j})}if(o={version:"1.3.2",ucs2:{decode:L,encode:B},decode:I,encode:N,toASCII:H,toUnicode:k},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(lT.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(cT)});var DZ=Wu((vZ,OO)=>{/*! +var pke=Object.create;var QM=Object.defineProperty;var gke=Object.getOwnPropertyDescriptor;var _ke=Object.getOwnPropertyNames;var yke=Object.getPrototypeOf,Ake=Object.prototype.hasOwnProperty;var bke=(e,t,n)=>t in e?QM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var eN=(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 Cs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var uh=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},xke=(e,t)=>{for(var n in t)QM(e,n,{get:t[n],enumerable:!0})},Tke=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _ke(t))!Ake.call(e,r)&&r!==n&&QM(e,r,{get:()=>t[r],enumerable:!(i=gke(t,r))||i.enumerable});return e};var js=(e,t,n)=>(n=e!=null?pke(yke(e)):{},Tke(t||!e||!e.__esModule?QM(n,"default",{value:e,enumerable:!0}):n,e));var ut=(e,t,n)=>bke(e,typeof t!="symbol"?t+"":t,n);var tN=uh((tGt,Bae)=>{var P0=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)};P0.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}};P0.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&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(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&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};P0.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};P0.prototype.random_int31=function(){return this.random_int()>>>1};P0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};P0.prototype.random=function(){return this.random_int()*(1/4294967296)};P0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};P0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Bae.exports=P0});var dce=uh((bE,xE)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof bE=="object"&&bE&&!bE.nodeType&&bE,n=typeof xE=="object"&&xE&&!xE.nodeType&&xE,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=s-a,T=Math.floor,E=String.fromCharCode,v;function S(B){throw new RangeError(b[B])}function I(B,j){for(var k=B.length,G=[];k--;)G[k]=j(B[k]);return G}function R(B,j){var k=B.split("@"),G="";k.length>1&&(G=k[0]+"@",B=k[1]),B=B.replace(A,".");var q=B.split("."),Q=I(q,j).join(".");return G+Q}function O(B){for(var j=[],k=0,G=B.length,q,Q;k<G;)q=B.charCodeAt(k++),q>=55296&&q<=56319&&k<G?(Q=B.charCodeAt(k++),(Q&64512)==56320?j.push(((q&1023)<<10)+(Q&1023)+65536):(j.push(q),k--)):j.push(q);return j}function L(B){return I(B,function(j){var k="";return j>65535&&(j-=65536,k+=E(j>>>10&1023|55296),j=56320|j&1023),k+=E(j),k}).join("")}function _(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:s}function C(B,j){return B+22+75*(B<26)-((j!=0)<<5)}function w(B,j,k){var G=0;for(B=k?T(B/f):B>>1,B+=T(B/j);B>x*c>>1;G+=s)B=T(B/x);return T(G+(x+1)*B/(B+u))}function D(B){var j=[],k=B.length,G,q=0,Q=p,W=d,J,Z,ae,Ae,fe,xe,ge,we,ve;for(J=B.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)B.charCodeAt(Z)>=128&&S("not-basic"),j.push(B.charCodeAt(Z));for(ae=J>0?J+1:0;ae<k;){for(Ae=q,fe=1,xe=s;ae>=k&&S("invalid-input"),ge=_(B.charCodeAt(ae++)),(ge>=s||ge>T((o-q)/fe))&&S("overflow"),q+=ge*fe,we=xe<=W?a:xe>=W+c?c:xe-W,!(ge<we);xe+=s)ve=s-we,fe>T(o/ve)&&S("overflow"),fe*=ve;G=j.length+1,W=w(q-Ae,G,Ae==0),T(q/G)>o-Q&&S("overflow"),Q+=T(q/G),q%=G,j.splice(q++,0,Q)}return L(j)}function N(B){var j,k,G,q,Q,W,J,Z,ae,Ae,fe,xe=[],ge,we,ve,Re;for(B=O(B),ge=B.length,j=p,k=0,Q=d,W=0;W<ge;++W)fe=B[W],fe<128&&xe.push(E(fe));for(G=q=xe.length,q&&xe.push(g);G<ge;){for(J=o,W=0;W<ge;++W)fe=B[W],fe>=j&&fe<J&&(J=fe);for(we=G+1,J-j>T((o-k)/we)&&S("overflow"),k+=(J-j)*we,j=J,W=0;W<ge;++W)if(fe=B[W],fe<j&&++k>o&&S("overflow"),fe==j){for(Z=k,ae=s;Ae=ae<=Q?a:ae>=Q+c?c:ae-Q,!(Z<Ae);ae+=s)Re=Z-Ae,ve=s-Ae,xe.push(E(C(Ae+Re%ve,0))),Z=T(Re/ve);xe.push(E(C(Z,0))),Q=w(k,we,G==q),k=0,++G}++k,++j}return xe.join("")}function F(B){return R(B,function(j){return m.test(j)?D(j.slice(4).toLowerCase()):j})}function V(B){return R(B,function(j){return y.test(j)?"xn--"+N(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:L},decode:D,encode:N,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(xE.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(bE)});var mce=uh((hce,AN)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ var cEe=Object.create;var eZ=Object.defineProperty;var lEe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof OO=="object"&&OO.exports?OO.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(vZ,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,l=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&&(l=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<l)for(s.splice(u,1,"0000");s.length<l;)s.splice(u,0,"0000");for(var f,h=0;h<l;h++){f=s[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[h]=f.join("")}var g=-1,m=0,y=0,b=-1,x=!1;for(h=0;h<l;h++)x?s[h]==="0"?y+=1:(x=!1,y>m&&(g=b,m=y)):s[h]==="0"&&(x=!0,b=h,y=1);y>m&&(g=b,m=y),m>1&&s.splice(g,m,""),a=s.length;var A="";for(s[0]===""&&(A=":"),h=0;h<a&&(A+=s[h],h!==a-1);h++)A+=":";return s[a-1]===""&&(A+=":"),A}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var IZ=Wu((PZ,RO)=>{/*! + */(function(e,t){"use strict";typeof AN=="object"&&AN.exports?AN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(hce,function(e){"use strict";var t=e&&e.IPv6;function n(r){var o=r.toLowerCase(),s=o.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 u;for(u=0;u<a&&s[u]!=="";u++);if(u<c)for(s.splice(u,1,"0000");s.length<c;)s.splice(u,0,"0000");for(var f,d=0;d<c;d++){f=s[d].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[d]=f.join("")}var g=-1,m=0,y=0,A=-1,b=!1;for(d=0;d<c;d++)b?s[d]==="0"?y+=1:(b=!1,y>m&&(g=A,m=y)):s[d]==="0"&&(b=!0,A=d,y=1);y>m&&(g=A,m=y),m>1&&s.splice(g,m,""),a=s.length;var x="";for(s[0]===""&&(x=":"),d=0;d<a&&(x+=s[d],d!==a-1);d++)x+=":";return s[a-1]===""&&(x+=":"),x}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var gce=uh((pce,bN)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ var cEe=Object.create;var eZ=Object.defineProperty;var lEe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof RO=="object"&&RO.exports?RO.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(PZ,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 ql=Wu((OZ,MO)=>{/*! + */(function(e,t){"use strict";typeof bN=="object"&&bN.exports?bN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(pce,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 r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(o+1,r)+" ")>=0:!1},is:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return!1;var o=i.lastIndexOf(".",r-1);if(o>=0)return!1;var s=n.list[i.slice(r+1)];return s?s.indexOf(" "+i.slice(0,r)+" ")>=0:!1},get:function(i){var r=i.lastIndexOf(".");if(r<=0||r>=i.length-1)return null;var o=i.lastIndexOf(".",r-1);if(o<=0||o>=r-1)return null;var s=n.list[i.slice(r+1)];return!s||s.indexOf(" "+i.slice(o+1,r)+" ")<0?null:i.slice(o+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var Qu=uh((_ce,xN)=>{/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,26 +58,26 @@ var cEe=Object.create;var eZ=Object.defineProperty;var lEe=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof MO=="object"&&MO.exports?MO.exports=t(wZ(),DZ(),IZ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(OZ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(w,D){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(w,D):new r(w):new r;if(w===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?w=location.href+"":w=""}if(w===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(w),D!==void 0?this.absoluteTo(D):this}function s(w){return/^[0-9]+$/.test(w)}r.version="1.19.11";var a=r.prototype,l=Object.prototype.hasOwnProperty;function u(w){return w.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(w){return w===void 0?"Undefined":String(Object.prototype.toString.call(w)).slice(8,-1)}function h(w){return f(w)==="Array"}function p(w,D){var I={},N,k;if(f(D)==="RegExp")I=null;else if(h(D))for(N=0,k=D.length;N<k;N++)I[D[N]]=!0;else I[D]=!0;for(N=0,k=w.length;N<k;N++){var H=I&&I[w[N]]!==void 0||!I&&D.test(w[N]);H&&(w.splice(N,1),k--,N--)}return w}function g(w,D){var I,N;if(h(D)){for(I=0,N=D.length;I<N;I++)if(!g(w,D[I]))return!1;return!0}var k=f(D);for(I=0,N=w.length;I<N;I++)if(k==="RegExp"){if(typeof w[I]=="string"&&w[I].match(D))return!0}else if(w[I]===D)return!0;return!1}function m(w,D){if(!h(w)||!h(D)||w.length!==D.length)return!1;w.sort(),D.sort();for(var I=0,N=w.length;I<N;I++)if(w[I]!==D[I])return!1;return!0}function y(w){var D=/^\/+|\/+$/g;return w.replace(D,"")}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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:)))(%.+)?\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(w){if(!(!w||!w.nodeName)){var D=w.nodeName.toLowerCase();if(!(D==="input"&&w.type!=="image"))return r.domAttributes[D]}};function b(w){return escape(w)}function x(w){return encodeURIComponent(w).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=x,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=x,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(w,D){var I=r.encode(w+"");return D===void 0&&(D=r.escapeQuerySpace),D?I.replace(/%20/g,"+"):I},r.decodeQuery=function(w,D){w+="",D===void 0&&(D=r.escapeQuerySpace);try{return r.decode(D?w.replace(/\+/g,"%20"):w)}catch{return w}};var A={encode:"encode",decode:"decode"},E,S=function(w,D){return function(I){try{return r[D](I+"").replace(r.characters[w][D].expression,function(N){return r.characters[w][D].map[N]})}catch{return I}}};for(E in A)r[E+"PathSegment"]=S("pathname",A[E]),r[E+"UrnPathSegment"]=S("urnpath",A[E]);var v=function(w,D,I){return function(N){var k;I?k=function(U){return r[D](r[I](U))}:k=r[D];for(var H=(N+"").split(w),V=0,j=H.length;V<j;V++)H[V]=k(H[V]);return H.join(w)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=S("reserved","encode"),r.parse=function(w,D){var I;return D||(D={preventInvalidHostname:r.preventInvalidHostname}),w=w.replace(r.leading_whitespace_expression,""),w=w.replace(r.ascii_tab_whitespace,""),I=w.indexOf("#"),I>-1&&(D.fragment=w.substring(I+1)||null,w=w.substring(0,I)),I=w.indexOf("?"),I>-1&&(D.query=w.substring(I+1)||null,w=w.substring(0,I)),w=w.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),w=w.replace(/^[/\\]{2,}/i,"//"),w.substring(0,2)==="//"?(D.protocol=null,w=w.substring(2),w=r.parseAuthority(w,D)):(I=w.indexOf(":"),I>-1&&(D.protocol=w.substring(0,I)||null,D.protocol&&!D.protocol.match(r.protocol_expression)?D.protocol=void 0:w.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(w=w.substring(I+3),w=r.parseAuthority(w,D)):(w=w.substring(I+1),D.urn=!0))),D.path=w,D},r.parseHost=function(w,D){w||(w=""),w=w.replace(/\\/g,"/");var I=w.indexOf("/"),N,k;if(I===-1&&(I=w.length),w.charAt(0)==="[")N=w.indexOf("]"),D.hostname=w.substring(1,N)||null,D.port=w.substring(N+2,I)||null,D.port==="/"&&(D.port=null);else{var H=w.indexOf(":"),V=w.indexOf("/"),j=w.indexOf(":",H+1);j!==-1&&(V===-1||j<V)?(D.hostname=w.substring(0,I)||null,D.port=null):(k=w.substring(0,I).split(":"),D.hostname=k[0]||null,D.port=k[1]||null)}return D.hostname&&w.substring(I).charAt(0)!=="/"&&(I++,w="/"+w),D.preventInvalidHostname&&r.ensureValidHostname(D.hostname,D.protocol),D.port&&r.ensureValidPort(D.port),w.substring(I)||"/"},r.parseAuthority=function(w,D){return w=r.parseUserinfo(w,D),r.parseHost(w,D)},r.parseUserinfo=function(w,D){var I=w,N=w.indexOf("\\");N!==-1&&(w=w.replace(/\\/g,"/"));var k=w.indexOf("/"),H=w.lastIndexOf("@",k>-1?k:w.length-1),V;return H>-1&&(k===-1||H<k)?(V=w.substring(0,H).split(":"),D.username=V[0]?r.decode(V[0]):null,V.shift(),D.password=V[0]?r.decode(V.join(":")):null,w=I.substring(H+1)):(D.username=null,D.password=null),w},r.parseQuery=function(w,D){if(!w)return{};if(w=w.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!w)return{};for(var I={},N=w.split("&"),k=N.length,H,V,j,U=0;U<k;U++)H=N[U].split("="),V=r.decodeQuery(H.shift(),D),j=H.length?r.decodeQuery(H.join("="),D):null,V!=="__proto__"&&(l.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(j)):I[V]=j);return I},r.build=function(w){var D="",I=!1;return w.protocol&&(D+=w.protocol+":"),!w.urn&&(D||w.hostname)&&(D+="//",I=!0),D+=r.buildAuthority(w)||"",typeof w.path=="string"&&(w.path.charAt(0)!=="/"&&I&&(D+="/"),D+=w.path),typeof w.query=="string"&&w.query&&(D+="?"+w.query),typeof w.fragment=="string"&&w.fragment&&(D+="#"+w.fragment),D},r.buildHost=function(w){var D="";if(w.hostname)r.ip6_expression.test(w.hostname)?D+="["+w.hostname+"]":D+=w.hostname;else return"";return w.port&&(D+=":"+w.port),D},r.buildAuthority=function(w){return r.buildUserinfo(w)+r.buildHost(w)},r.buildUserinfo=function(w){var D="";return w.username&&(D+=r.encode(w.username)),w.password&&(D+=":"+r.encode(w.password)),D&&(D+="@"),D},r.buildQuery=function(w,D,I){var N="",k,H,V,j;for(H in w)if(H!=="__proto__"&&l.call(w,H))if(h(w[H]))for(k={},V=0,j=w[H].length;V<j;V++)w[H][V]!==void 0&&k[w[H][V]+""]===void 0&&(N+="&"+r.buildQueryParameter(H,w[H][V],I),D!==!0&&(k[w[H][V]+""]=!0));else w[H]!==void 0&&(N+="&"+r.buildQueryParameter(H,w[H],I));return N.substring(1)},r.buildQueryParameter=function(w,D,I){return r.encodeQuery(w,I)+(D!==null?"="+r.encodeQuery(D,I):"")},r.addQuery=function(w,D,I){if(typeof D=="object")for(var N in D)l.call(D,N)&&r.addQuery(w,N,D[N]);else if(typeof D=="string"){if(w[D]===void 0){w[D]=I;return}else typeof w[D]=="string"&&(w[D]=[w[D]]);h(I)||(I=[I]),w[D]=(w[D]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(w,D,I){if(typeof D=="object")for(var N in D)l.call(D,N)&&r.setQuery(w,N,D[N]);else if(typeof D=="string")w[D]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(w,D,I){var N,k,H;if(h(D))for(N=0,k=D.length;N<k;N++)w[D[N]]=void 0;else if(f(D)==="RegExp")for(H in w)D.test(H)&&(w[H]=void 0);else if(typeof D=="object")for(H in D)l.call(D,H)&&r.removeQuery(w,H,D[H]);else if(typeof D=="string")I!==void 0?f(I)==="RegExp"?!h(w[D])&&I.test(w[D])?w[D]=void 0:w[D]=p(w[D],I):w[D]===String(I)&&(!h(I)||I.length===1)?w[D]=void 0:h(w[D])&&(w[D]=p(w[D],I)):w[D]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(w,D,I,N){switch(f(D)){case"String":break;case"RegExp":for(var k in w)if(l.call(w,k)&&D.test(k)&&(I===void 0||r.hasQuery(w,k,I)))return!0;return!1;case"Object":for(var H in D)if(l.call(D,H)&&!r.hasQuery(w,H,D[H]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return D in w;case"Boolean":var V=!!(h(w[D])?w[D].length:w[D]);return I===V;case"Function":return!!I(w[D],D,w);case"Array":if(!h(w[D]))return!1;var j=N?g:m;return j(w[D],I);case"RegExp":return h(w[D])?N?g(w[D],I):!1:!!(w[D]&&w[D].match(I));case"Number":I=String(I);case"String":return h(w[D])?N?g(w[D],I):!1:w[D]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var w=[],D=[],I=0,N=0;N<arguments.length;N++){var k=new r(arguments[N]);w.push(k);for(var H=k.segment(),V=0;V<H.length;V++)typeof H[V]=="string"&&D.push(H[V]),H[V]&&I++}if(!D.length||!I)return new r("");var j=new r("").segment(D);return(w[0].path()===""||w[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},r.commonPath=function(w,D){var I=Math.min(w.length,D.length),N;for(N=0;N<I;N++)if(w.charAt(N)!==D.charAt(N)){N--;break}return N<1?w.charAt(0)===D.charAt(0)&&w.charAt(0)==="/"?"/":"":((w.charAt(N)!=="/"||D.charAt(N)!=="/")&&(N=w.substring(0,N).lastIndexOf("/")),w.substring(0,N+1))},r.withinString=function(w,D,I){I||(I={});var N=I.start||r.findUri.start,k=I.end||r.findUri.end,H=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var U=N.exec(w);if(!U)break;var q=U.index;if(I.ignoreHtml){var X=w.slice(Math.max(q-3,0),q);if(X&&j.test(X))continue}for(var te=q+w.slice(q).search(k),K=w.slice(q,te),Z=-1;;){var ee=V.exec(K);if(!ee)break;var me=ee.index+ee[0].length;Z=Math.max(Z,me)}if(Z>-1?K=K.slice(0,Z)+K.slice(Z).replace(H,""):K=K.replace(H,""),!(K.length<=U[0].length)&&!(I.ignore&&I.ignore.test(K))){te=q+K.length;var xe=D(K,q,te,w);if(xe===void 0){N.lastIndex=te;continue}xe=String(xe),w=w.slice(0,q)+xe+w.slice(te),N.lastIndex=q+xe.length}}return N.lastIndex=0,w},r.ensureValidHostname=function(w,D){var I=!!w,N=!!D,k=!1;if(N&&(k=g(r.hostProtocols,D)),k&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+D);if(w&&w.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(w).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(w){if(w){var D=Number(w);if(!(s(D)&&D>0&&D<65536))throw new TypeError('Port "'+w+'" is not a valid port')}},r.noConflict=function(w){if(w){var D={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(D.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(D.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(D.SecondLevelDomains=i.SecondLevelDomains.noConflict()),D}else i.URI===this&&(i.URI=o);return this},a.build=function(w){return w===!0?this._deferred_build=!0:(w===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 P(w){return function(D,I){return D===void 0?this._parts[w]||"":(this._parts[w]=D||null,this.build(!I),this)}}function M(w,D){return function(I,N){return I===void 0?this._parts[w]||"":(I!==null&&(I=I+"",I.charAt(0)===D&&(I=I.substring(1))),this._parts[w]=I,this.build(!N),this)}}a.protocol=P("protocol"),a.username=P("username"),a.password=P("password"),a.hostname=P("hostname"),a.port=P("port"),a.query=M("query","?"),a.fragment=M("fragment","#"),a.search=function(w,D){var I=this.query(w,D);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(w,D){var I=this.fragment(w,D);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(w,D){if(w===void 0||w===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return w?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=w?r.recodeUrnPath(w):"":this._parts.path=w?r.recodePath(w):"/",this.build(!D),this},a.path=a.pathname,a.href=function(w,D){var I;if(w===void 0)return this.toString();this._string="",this._parts=r._parts();var N=w instanceof r,k=typeof w=="object"&&(w.hostname||w.path||w.pathname);if(w.nodeName){var H=r.getDomAttribute(w);w=w[H]||"",k=!1}if(!N&&k&&w.pathname!==void 0&&(w=w.toString()),typeof w=="string"||w instanceof String)this._parts=r.parse(String(w),this._parts);else if(N||k){var V=N?w._parts:w;for(I in V)I!=="query"&&l.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!D),this},a.is=function(w){var D=!1,I=!1,N=!1,k=!1,H=!1,V=!1,j=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),D=I||N,k=!D,H=k&&n&&n.has(this._parts.hostname),V=k&&r.idn_expression.test(this._parts.hostname),j=k&&r.punycode_expression.test(this._parts.hostname)),w.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return k;case"sld":return H;case"ip":return D;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,L=a.port,B=a.hostname;a.protocol=function(w,D){if(w&&(w=w.replace(/:(\/\/)?$/,""),!w.match(r.protocol_expression)))throw new TypeError('Protocol "'+w+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,w,D)},a.scheme=a.protocol,a.port=function(w,D){return this._parts.urn?w===void 0?"":this:(w!==void 0&&(w===0&&(w=null),w&&(w+="",w.charAt(0)===":"&&(w=w.substring(1)),r.ensureValidPort(w))),L.call(this,w,D))},a.hostname=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(w,I);if(N!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');w=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(w,this._parts.protocol)}return B.call(this,w,D)},a.origin=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var k=r(w);return this.protocol(k.protocol()).authority(k.authority()).build(!D),this}},a.host=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.authority=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.userinfo=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return w[w.length-1]!=="@"&&(w+="@"),r.parseUserinfo(w,this._parts),this.build(!D),this},a.resource=function(w,D){var I;return w===void 0?this.path()+this.search()+this.hash():(I=r.parse(w),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!D),this)},a.subdomain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var N=this._parts.hostname.length-this.domain().length,k=this._parts.hostname.substring(0,N),H=new RegExp("^"+u(k));if(w&&w.charAt(w.length-1)!=="."&&(w+="."),w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return w&&r.ensureValidHostname(w,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(H,w),this.build(!D),this}},a.domain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(D).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!w)throw new TypeError("cannot set domain empty");if(w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(w,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=w;else{var k=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(k,w)}return this.build(!D),this}},a.tld=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return D!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var k;if(w)if(w.match(/[^a-zA-Z0-9-]/))if(n&&n.is(w))k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w);else throw new TypeError('TLD "'+w+'" 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");k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w)}else throw new TypeError("cannot set TLD empty");return this.build(!D),this}},a.directory=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return w?r.decodePath(N):N}else{var k=this._parts.path.length-this.filename().length,H=this._parts.path.substring(0,k),V=new RegExp("^"+u(H));return this.is("relative")||(w||(w="/"),w.charAt(0)!=="/"&&(w="/"+w)),w&&w.charAt(w.length-1)!=="/"&&(w+="/"),w=r.recodePath(w),this._parts.path=this._parts.path.replace(V,w),this.build(!D),this}},a.filename=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return w?r.decodePathSegment(N):N}else{var k=!1;w.charAt(0)==="/"&&(w=w.substring(1)),w.match(/\.?\//)&&(k=!0);var H=new RegExp(u(this.filename())+"$");return w=r.recodePath(w),this._parts.path=this._parts.path.replace(H,w),k?this.normalizePath(D):this.build(!D),this}},a.suffix=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),k,H;return N===-1?"":(k=I.substring(N+1),H=/^[a-z0-9%]+$/i.test(k)?k:"",w?r.decodePathSegment(H):H)}else{w.charAt(0)==="."&&(w=w.substring(1));var V=this.suffix(),j;if(V)w?j=new RegExp(u(V)+"$"):j=new RegExp(u("."+V)+"$");else{if(!w)return this;this._parts.path+="."+r.recodePath(w)}return j&&(w=r.recodePath(w),this._parts.path=this._parts.path.replace(j,w)),this.build(!D),this}},a.segment=function(w,D,I){var N=this._parts.urn?":":"/",k=this.path(),H=k.substring(0,1)==="/",V=k.split(N);if(w!==void 0&&typeof w!="number"&&(I=D,D=w,w=void 0),w!==void 0&&typeof w!="number")throw new Error('Bad segment "'+w+'", must be 0-based integer');if(H&&V.shift(),w<0&&(w=Math.max(V.length+w,0)),D===void 0)return w===void 0?V:V[w];if(w===null||V[w]===void 0)if(h(D)){V=[];for(var j=0,U=D.length;j<U;j++)!D[j].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(y(D[j])))}else(D||typeof D=="string")&&(D=y(D),V[V.length-1]===""?V[V.length-1]=D:V.push(D));else D?V[w]=y(D):V.splice(w,1);return H&&V.unshift(""),this.path(V.join(N),I)},a.segmentCoded=function(w,D,I){var N,k,H;if(typeof w!="number"&&(I=D,D=w,w=void 0),D===void 0){if(N=this.segment(w,D,I),!h(N))N=N!==void 0?r.decode(N):void 0;else for(k=0,H=N.length;k<H;k++)N[k]=r.decode(N[k]);return N}if(!h(D))D=typeof D=="string"||D instanceof String?r.encode(D):D;else for(k=0,H=D.length;k<H;k++)D[k]=r.encode(D[k]);return this.segment(w,D,I)};var _=a.query;return a.query=function(w,D){if(w===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=w.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!D),this}else return w!==void 0&&typeof w!="string"?(this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!D),this):_.call(this,w,D)},a.setQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="string"||w instanceof String)N[w]=D!==void 0?D:null;else if(typeof w=="object")for(var k in w)l.call(w,k)&&(N[k]=w[k]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.addQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,w,D===void 0?null:D),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.removeQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,w,D),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.hasQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,w,D,I)},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(w){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!w)),this},a.normalizeHostname=function(w){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(!w)),this},a.normalizePort=function(w){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!w)),this},a.normalizePath=function(w){var D=this._parts.path;if(!D)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!w),this;if(this._parts.path==="/")return this;D=r.recodePath(D);var I,N="",k,H;for(D.charAt(0)!=="/"&&(I=!0,D="/"+D),(D.slice(-3)==="/.."||D.slice(-2)==="/.")&&(D+="/"),D=D.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=D.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));k=D.search(/\/\.\.(\/|$)/),k!==-1;){if(k===0){D=D.substring(3);continue}H=D.substring(0,k).lastIndexOf("/"),H===-1&&(H=k),D=D.substring(0,H)+D.substring(k+3)}return I&&this.is("relative")&&(D=N+D.substring(1)),this._parts.path=D,this.build(!w),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(w){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(!w)),this},a.normalizeFragment=function(w){return this._parts.fragment||(this._parts.fragment=null,this.build(!w)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var w=r.encode,D=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=w,r.decode=D}return this},a.unicode=function(){var w=r.encode,D=r.decode;r.encode=x,r.decode=unescape;try{this.normalize()}finally{r.encode=w,r.decode=D}return this},a.readable=function(){var w=this.clone();w.username("").password("").normalize();var D="";if(w._parts.protocol&&(D+=w._parts.protocol+"://"),w._parts.hostname&&(w.is("punycode")&&e?(D+=e.toUnicode(w._parts.hostname),w._parts.port&&(D+=":"+w._parts.port)):D+=w.host()),w._parts.hostname&&w._parts.path&&w._parts.path.charAt(0)!=="/"&&(D+="/"),D+=w.path(!0),w._parts.query){for(var I="",N=0,k=w._parts.query.split("&"),H=k.length;N<H;N++){var V=(k[N]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}D+="?"+I.substring(1)}return D+=r.decodeQuery(w.hash(),!0),D},a.absoluteTo=function(w){var D=this.clone(),I=["protocol","username","password","hostname","port"],N,k,H;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w instanceof r||(w=new r(w)),D._parts.protocol||(D._parts.protocol=w._parts.protocol,this._parts.hostname))return D;for(k=0;H=I[k];k++)D._parts[H]=w._parts[H];return D._parts.path?(D._parts.path.substring(-2)===".."&&(D._parts.path+="/"),D.path().charAt(0)!=="/"&&(N=w.directory(),N=N||(w.path().indexOf("/")===0?"/":""),D._parts.path=(N?N+"/":"")+D._parts.path,D.normalizePath())):(D._parts.path=w._parts.path,D._parts.query||(D._parts.query=w._parts.query)),D.build(),D},a.relativeTo=function(w){var D=this.clone().normalize(),I,N,k,H,V;if(D._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w=new r(w).normalize(),I=D._parts,N=w._parts,H=D.path(),V=w.path(),H.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return D.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return D.build();if(H===V)return I.path="",D.build();if(k=r.commonPath(H,V),!k)return D.build();var j=N.path.substring(k.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=j+I.path.substring(k.length)||"./",D.build()},a.equals=function(w){var D=this.clone(),I=new r(w),N={},k={},H={},V,j,U;if(D.normalize(),I.normalize(),D.toString()===I.toString())return!0;if(V=D.query(),j=I.query(),D.query(""),I.query(""),D.toString()!==I.toString()||V.length!==j.length)return!1;N=r.parseQuery(V,this._parts.escapeQuerySpace),k=r.parseQuery(j,this._parts.escapeQuerySpace);for(U in N)if(l.call(N,U)){if(h(N[U])){if(!m(N[U],k[U]))return!1}else if(N[U]!==k[U])return!1;H[U]=!0}for(U in k)if(l.call(k,U)&&!H[U])return!1;return!0},a.preventInvalidHostname=function(w){return this._parts.preventInvalidHostname=!!w,this},a.duplicateQueryParameters=function(w){return this._parts.duplicateQueryParameters=!!w,this},a.escapeQuerySpace=function(w){return this._parts.escapeQuerySpace=!!w,this},r})});var Wae=Wu((FOn,jae)=>{"use strict";jae.exports=cWe;var Zv=1e20;function cWe(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,l,u,f,h,p,g,m,y;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,l=e,t.stride?f=t.stride:f=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),l=g.data,f=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),l=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,l=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*s),m=0,y=Math.floor(u.length/f);m<y;m++)l[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),x=Array(r*s),A=Array(a),E=Array(a),S=Array(a+1),v=Array(a);for(m=0,y=r*s;m<y;m++){var P=l[m];b[m]=P===1?0:P===0?Zv:Math.pow(Math.max(0,.5-P),2),x[m]=P===1?Zv:P===0?0:Math.pow(Math.max(0,P-.5),2)}Hae(b,r,s,A,E,v,S),Hae(x,r,s,A,E,v,S);var M=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,y=r*s;m<y;m++)M[m]=Math.min(Math.max(1-((b[m]-x[m])/i+n),0),1);return M}function Hae(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var l=0;l<n;l++)i[l]=e[l*t+a];for(Gae(i,o,r,s,n),l=0;l<n;l++)e[l*t+a]=o[l]}for(l=0;l<n;l++){for(a=0;a<t;a++)i[a]=e[l*t+a];for(Gae(i,o,r,s,t),a=0;a<t;a++)e[l*t+a]=Math.sqrt(o[a])}}function Gae(e,t,n,i,o){n[0]=0,i[0]=-Zv,i[1]=+Zv;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]=+Zv}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 $ae=Wu((e1n,OB)=>{function bWe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,l=8,u=9,f=10,h=11,p=12,g=13,m=14,y=15,b=16,x=17,A=0,E=1,S=2,v=3,P=4;function M(_,w){return 55296<=_.charCodeAt(w)&&_.charCodeAt(w)<=56319&&56320<=_.charCodeAt(w+1)&&_.charCodeAt(w+1)<=57343}function R(_,w){w===void 0&&(w=0);var D=_.charCodeAt(w);if(55296<=D&&D<=56319&&w<_.length-1){var I=D,N=_.charCodeAt(w+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=D&&D<=57343&&w>=1){var I=_.charCodeAt(w-1),N=D;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return D}function L(_,w,D){var I=[_].concat(w).concat([D]),N=I[I.length-2],k=D,H=I.lastIndexOf(m);if(H>1&&I.slice(1,H).every(function(U){return U==i})&&[i,g,x].indexOf(_)==-1)return S;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(U){return U==o})&&[p,o].indexOf(N)==-1)return I.filter(function(U){return U==o}).length%2==1?v:P;if(N==e&&k==t)return A;if(N==n||N==e||N==t)return k==m&&w.every(function(U){return U==i})?S:E;if(k==n||k==e||k==t)return E;if(N==s&&(k==s||k==a||k==u||k==f))return A;if((N==u||N==a)&&(k==a||k==l))return A;if((N==f||N==l)&&k==l)return A;if(k==i||k==y)return A;if(k==r)return A;if(N==p)return A;var j=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,x].indexOf(I[j])!=-1&&I.slice(j+1,-1).every(function(U){return U==i})&&k==m||N==y&&[b,x].indexOf(k)!=-1?A:w.indexOf(o)!=-1?S:N==o&&k==o?A:E}this.nextBreak=function(_,w){if(w===void 0&&(w=0),w<0)return 0;if(w>=_.length-1)return _.length;for(var D=B(R(_,w)),I=[],N=w+1;N<_.length;N++)if(!M(_,N-1)){var k=B(R(_,N));if(L(D,I,k))return N;I.push(k)}return _.length},this.splitGraphemes=function(_){for(var w=[],D=0,I;(I=this.nextBreak(_,D))<_.length;)w.push(_.slice(D,I)),D=I;return D<_.length&&w.push(_.slice(D)),w},this.iterateGraphemes=function(_){var w=0,D={next:function(){var I,N;return(N=this.nextBreak(_,w))<_.length?(I=_.slice(w,N),w=N,{value:I,done:!1}):w<_.length?(I=_.slice(w),w=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(D[Symbol.iterator]=function(){return D}),D},this.countGraphemes=function(_){for(var w=0,D=0,I;(I=this.nextBreak(_,D))<_.length;)D=I,w++;return D<_.length&&w++,w};function B(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?l:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?x:h}return this}typeof OB<"u"&&OB.exports&&(OB.exports=bWe)});var Ude=Wu((Fq,Bq)=>{(function(e,t){typeof Fq=="object"&&typeof Bq<"u"?Bq.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(Fq,function(){"use strict";function e(b,x,A,E,S){(function v(P,M,R,L,B){for(;L>R;){if(L-R>600){var _=L-R+1,w=M-R+1,D=Math.log(_),I=.5*Math.exp(2*D/3),N=.5*Math.sqrt(D*I*(_-I)/_)*(w-_/2<0?-1:1),k=Math.max(R,Math.floor(M-w*I/_+N)),H=Math.min(L,Math.floor(M+(_-w)*I/_+N));v(P,M,k,H,B)}var V=P[M],j=R,U=L;for(t(P,R,M),B(P[L],V)>0&&t(P,R,L);j<U;){for(t(P,j,U),j++,U--;B(P[j],V)<0;)j++;for(;B(P[U],V)>0;)U--}B(P[R],V)===0?t(P,R,U):t(P,++U,L),U<=M&&(R=U+1),M<=U&&(L=U-1)}})(b,x,A||0,E||b.length-1,S||n)}function t(b,x,A){var E=b[x];b[x]=b[A],b[A]=E}function n(b,x){return b<x?-1:b>x?1:0}var i=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,x,A){if(!A)return x.indexOf(b);for(var E=0;E<x.length;E++)if(A(b,x[E]))return E;return-1}function r(b,x){s(b,0,b.children.length,x,b)}function s(b,x,A,E,S){S||(S=m(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var v=x;v<A;v++){var P=b.children[v];a(S,b.leaf?E(P):P)}return S}function a(b,x){return b.minX=Math.min(b.minX,x.minX),b.minY=Math.min(b.minY,x.minY),b.maxX=Math.max(b.maxX,x.maxX),b.maxY=Math.max(b.maxY,x.maxY),b}function l(b,x){return b.minX-x.minX}function u(b,x){return b.minY-x.minY}function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function h(b){return b.maxX-b.minX+(b.maxY-b.minY)}function p(b,x){return b.minX<=x.minX&&b.minY<=x.minY&&x.maxX<=b.maxX&&x.maxY<=b.maxY}function g(b,x){return x.minX<=b.maxX&&x.minY<=b.maxY&&x.maxX>=b.minX&&x.maxY>=b.minY}function m(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(b,x,A,E,S){for(var v=[x,A];v.length;)if(!((A=v.pop())-(x=v.pop())<=E)){var P=x+Math.ceil((A-x)/E/2)*E;e(b,P,x,A,S),v.push(x,P,P,A)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var x=this.data,A=[];if(!g(b,x))return A;for(var E=this.toBBox,S=[];x;){for(var v=0;v<x.children.length;v++){var P=x.children[v],M=x.leaf?E(P):P;g(b,M)&&(x.leaf?A.push(P):p(b,M)?this._all(P,A):S.push(P))}x=S.pop()}return A},i.prototype.collides=function(b){var x=this.data;if(!g(b,x))return!1;for(var A=[];x;){for(var E=0;E<x.children.length;E++){var S=x.children[E],v=x.leaf?this.toBBox(S):S;if(g(b,v)){if(x.leaf||p(b,v))return!0;A.push(S)}}x=A.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var x=0;x<b.length;x++)this.insert(b[x]);return this}var A=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===A.height)this._splitRoot(this.data,A);else{if(this.data.height<A.height){var E=this.data;this.data=A,A=E}this._insert(A,this.data.height-A.height-1,!0)}else this.data=A;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(b,x){if(!b)return this;for(var A,E,S,v=this.data,P=this.toBBox(b),M=[],R=[];v||M.length;){if(v||(v=M.pop(),E=M[M.length-1],A=R.pop(),S=!0),v.leaf){var L=o(b,v.children,x);if(L!==-1)return v.children.splice(L,1),M.push(v),this._condense(M),this}S||v.leaf||!p(v,P)?E?(A++,v=E.children[A],S=!1):v=null:(M.push(v),R.push(A),A=0,E=v,v=v.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,x){return b.minX-x.minX},i.prototype.compareMinY=function(b,x){return b.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,x){for(var A=[];b;)b.leaf?x.push.apply(x,b.children):A.push.apply(A,b.children),b=A.pop();return x},i.prototype._build=function(b,x,A,E){var S,v=A-x+1,P=this._maxEntries;if(v<=P)return r(S=m(b.slice(x,A+1)),this.toBBox),S;E||(E=Math.ceil(Math.log(v)/Math.log(P)),P=Math.ceil(v/Math.pow(P,E-1))),(S=m([])).leaf=!1,S.height=E;var M=Math.ceil(v/P),R=M*Math.ceil(Math.sqrt(P));y(b,x,A,R,this.compareMinX);for(var L=x;L<=A;L+=R){var B=Math.min(L+R-1,A);y(b,L,B,M,this.compareMinY);for(var _=L;_<=B;_+=M){var w=Math.min(_+M-1,B);S.children.push(this._build(b,_,w,E-1))}}return r(S,this.toBBox),S},i.prototype._chooseSubtree=function(b,x,A,E){for(;E.push(x),!x.leaf&&E.length-1!==A;){for(var S=1/0,v=1/0,P=void 0,M=0;M<x.children.length;M++){var R=x.children[M],L=f(R),B=(_=b,w=R,(Math.max(w.maxX,_.maxX)-Math.min(w.minX,_.minX))*(Math.max(w.maxY,_.maxY)-Math.min(w.minY,_.minY))-L);B<v?(v=B,S=L<S?L:S,P=R):B===v&&L<S&&(S=L,P=R)}x=P||x.children[0]}var _,w;return x},i.prototype._insert=function(b,x,A){var E=A?b:this.toBBox(b),S=[],v=this._chooseSubtree(E,this.data,x,S);for(v.children.push(b),a(v,E);x>=0&&S[x].children.length>this._maxEntries;)this._split(S,x),x--;this._adjustParentBBoxes(E,S,x)},i.prototype._split=function(b,x){var A=b[x],E=A.children.length,S=this._minEntries;this._chooseSplitAxis(A,S,E);var v=this._chooseSplitIndex(A,S,E),P=m(A.children.splice(v,A.children.length-v));P.height=A.height,P.leaf=A.leaf,r(A,this.toBBox),r(P,this.toBBox),x?b[x-1].children.push(P):this._splitRoot(A,P)},i.prototype._splitRoot=function(b,x){this.data=m([b,x]),this.data.height=b.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,x,A){for(var E,S,v,P,M,R,L,B=1/0,_=1/0,w=x;w<=A-x;w++){var D=s(b,0,w,this.toBBox),I=s(b,w,A,this.toBBox),N=(S=D,v=I,P=void 0,M=void 0,R=void 0,L=void 0,P=Math.max(S.minX,v.minX),M=Math.max(S.minY,v.minY),R=Math.min(S.maxX,v.maxX),L=Math.min(S.maxY,v.maxY),Math.max(0,R-P)*Math.max(0,L-M)),k=f(D)+f(I);N<B?(B=N,E=w,_=k<_?k:_):N===B&&k<_&&(_=k,E=w)}return E||A-x},i.prototype._chooseSplitAxis=function(b,x,A){var E=b.leaf?this.compareMinX:l,S=b.leaf?this.compareMinY:u;this._allDistMargin(b,x,A,E)<this._allDistMargin(b,x,A,S)&&b.children.sort(E)},i.prototype._allDistMargin=function(b,x,A,E){b.children.sort(E);for(var S=this.toBBox,v=s(b,0,x,S),P=s(b,A-x,A,S),M=h(v)+h(P),R=x;R<A-x;R++){var L=b.children[R];a(v,b.leaf?S(L):L),M+=h(v)}for(var B=A-x-1;B>=x;B--){var _=b.children[B];a(P,b.leaf?S(_):_),M+=h(P)}return M},i.prototype._adjustParentBBoxes=function(b,x,A){for(var E=A;E>=0;E--)a(x[E],b)},i.prototype._condense=function(b){for(var x=b.length-1,A=void 0;x>=0;x--)b[x].children.length===0?x>0?(A=b[x-1].children).splice(A.indexOf(b[x]),1):this.clear():r(b[x],this.toBBox)},i})});var r$=Wu((exports,module)=>{/*! - * protobuf.js v7.4.0 (c) 2016, daniel wirtz - * compiled thu, 22 aug 2024 20:30:39 utc + */(function(e,t){"use strict";typeof xN=="object"&&xN.exports?xN.exports=t(dce(),mce(),gce()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(_ce,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(C,w){var D=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof o))return D?N?new o(C,w):new o(C):new o;if(C===void 0){if(D)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&D)throw new TypeError("null is not a valid argument for URI");return this.href(C),w!==void 0?this.absoluteTo(w):this}function s(C){return/^[0-9]+$/.test(C)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,w){var D={},N,F;if(f(w)==="RegExp")D=null;else if(d(w))for(N=0,F=w.length;N<F;N++)D[w[N]]=!0;else D[w]=!0;for(N=0,F=C.length;N<F;N++){var V=D&&D[C[N]]!==void 0||!D&&w.test(C[N]);V&&(C.splice(N,1),F--,N--)}return C}function g(C,w){var D,N;if(d(w)){for(D=0,N=w.length;D<N;D++)if(!g(C,w[D]))return!1;return!0}var F=f(w);for(D=0,N=C.length;D<N;D++)if(F==="RegExp"){if(typeof C[D]=="string"&&C[D].match(w))return!0}else if(C[D]===w)return!0;return!1}function m(C,w){if(!d(C)||!d(w)||C.length!==w.length)return!1;C.sort(),w.sort();for(var D=0,N=C.length;D<N;D++)if(C[D]!==w[D])return!1;return!0}function y(C){var w=/^\/+|\/+$/g;return C.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.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*$/,o.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,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.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"},o.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var w=C.nodeName.toLowerCase();if(!(w==="input"&&C.type!=="image"))return o.domAttributes[w]}};function A(C){return escape(C)}function b(C){return encodeURIComponent(C).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.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"}}}},o.encodeQuery=function(C,w){var D=o.encode(C+"");return w===void 0&&(w=o.escapeQuerySpace),w?D.replace(/%20/g,"+"):D},o.decodeQuery=function(C,w){C+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?C.replace(/\+/g,"%20"):C)}catch{return C}};var x={encode:"encode",decode:"decode"},T,E=function(C,w){return function(D){try{return o[w](D+"").replace(o.characters[C][w].expression,function(N){return o.characters[C][w].map[N]})}catch{return D}}};for(T in x)o[T+"PathSegment"]=E("pathname",x[T]),o[T+"UrnPathSegment"]=E("urnpath",x[T]);var v=function(C,w,D){return function(N){var F;D?F=function(k){return o[w](o[D](k))}:F=o[w];for(var V=(N+"").split(C),B=0,j=V.length;B<j;B++)V[B]=F(V[B]);return V.join(C)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=E("reserved","encode"),o.parse=function(C,w){var D;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),C=C.replace(o.leading_whitespace_expression,""),C=C.replace(o.ascii_tab_whitespace,""),D=C.indexOf("#"),D>-1&&(w.fragment=C.substring(D+1)||null,C=C.substring(0,D)),D=C.indexOf("?"),D>-1&&(w.query=C.substring(D+1)||null,C=C.substring(0,D)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(w.protocol=null,C=C.substring(2),C=o.parseAuthority(C,w)):(D=C.indexOf(":"),D>-1&&(w.protocol=C.substring(0,D)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:C.substring(D+1,D+3).replace(/\\/g,"/")==="//"?(C=C.substring(D+3),C=o.parseAuthority(C,w)):(C=C.substring(D+1),w.urn=!0))),w.path=C,w},o.parseHost=function(C,w){C||(C=""),C=C.replace(/\\/g,"/");var D=C.indexOf("/"),N,F;if(D===-1&&(D=C.length),C.charAt(0)==="[")N=C.indexOf("]"),w.hostname=C.substring(1,N)||null,w.port=C.substring(N+2,D)||null,w.port==="/"&&(w.port=null);else{var V=C.indexOf(":"),B=C.indexOf("/"),j=C.indexOf(":",V+1);j!==-1&&(B===-1||j<B)?(w.hostname=C.substring(0,D)||null,w.port=null):(F=C.substring(0,D).split(":"),w.hostname=F[0]||null,w.port=F[1]||null)}return w.hostname&&C.substring(D).charAt(0)!=="/"&&(D++,C="/"+C),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),C.substring(D)||"/"},o.parseAuthority=function(C,w){return C=o.parseUserinfo(C,w),o.parseHost(C,w)},o.parseUserinfo=function(C,w){var D=C,N=C.indexOf("\\");N!==-1&&(C=C.replace(/\\/g,"/"));var F=C.indexOf("/"),V=C.lastIndexOf("@",F>-1?F:C.length-1),B;return V>-1&&(F===-1||V<F)?(B=C.substring(0,V).split(":"),w.username=B[0]?o.decode(B[0]):null,B.shift(),w.password=B[0]?o.decode(B.join(":")):null,C=D.substring(V+1)):(w.username=null,w.password=null),C},o.parseQuery=function(C,w){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var D={},N=C.split("&"),F=N.length,V,B,j,k=0;k<F;k++)V=N[k].split("="),B=o.decodeQuery(V.shift(),w),j=V.length?o.decodeQuery(V.join("="),w):null,B!=="__proto__"&&(c.call(D,B)?((typeof D[B]=="string"||D[B]===null)&&(D[B]=[D[B]]),D[B].push(j)):D[B]=j);return D},o.build=function(C){var w="",D=!1;return C.protocol&&(w+=C.protocol+":"),!C.urn&&(w||C.hostname)&&(w+="//",D=!0),w+=o.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&D&&(w+="/"),w+=C.path),typeof C.query=="string"&&C.query&&(w+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(w+="#"+C.fragment),w},o.buildHost=function(C){var w="";if(C.hostname)o.ip6_expression.test(C.hostname)?w+="["+C.hostname+"]":w+=C.hostname;else return"";return C.port&&(w+=":"+C.port),w},o.buildAuthority=function(C){return o.buildUserinfo(C)+o.buildHost(C)},o.buildUserinfo=function(C){var w="";return C.username&&(w+=o.encode(C.username)),C.password&&(w+=":"+o.encode(C.password)),w&&(w+="@"),w},o.buildQuery=function(C,w,D){var N="",F,V,B,j;for(V in C)if(V!=="__proto__"&&c.call(C,V))if(d(C[V]))for(F={},B=0,j=C[V].length;B<j;B++)C[V][B]!==void 0&&F[C[V][B]+""]===void 0&&(N+="&"+o.buildQueryParameter(V,C[V][B],D),w!==!0&&(F[C[V][B]+""]=!0));else C[V]!==void 0&&(N+="&"+o.buildQueryParameter(V,C[V],D));return N.substring(1)},o.buildQueryParameter=function(C,w,D){return o.encodeQuery(C,D)+(w!==null?"="+o.encodeQuery(w,D):"")},o.addQuery=function(C,w,D){if(typeof w=="object")for(var N in w)c.call(w,N)&&o.addQuery(C,N,w[N]);else if(typeof w=="string"){if(C[w]===void 0){C[w]=D;return}else typeof C[w]=="string"&&(C[w]=[C[w]]);d(D)||(D=[D]),C[w]=(C[w]||[]).concat(D)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(C,w,D){if(typeof w=="object")for(var N in w)c.call(w,N)&&o.setQuery(C,N,w[N]);else if(typeof w=="string")C[w]=D===void 0?null:D;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(C,w,D){var N,F,V;if(d(w))for(N=0,F=w.length;N<F;N++)C[w[N]]=void 0;else if(f(w)==="RegExp")for(V in C)w.test(V)&&(C[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(C,V,w[V]);else if(typeof w=="string")D!==void 0?f(D)==="RegExp"?!d(C[w])&&D.test(C[w])?C[w]=void 0:C[w]=p(C[w],D):C[w]===String(D)&&(!d(D)||D.length===1)?C[w]=void 0:d(C[w])&&(C[w]=p(C[w],D)):C[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(C,w,D,N){switch(f(w)){case"String":break;case"RegExp":for(var F in C)if(c.call(C,F)&&w.test(F)&&(D===void 0||o.hasQuery(C,F,D)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(C,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(D)){case"Undefined":return w in C;case"Boolean":var B=!!(d(C[w])?C[w].length:C[w]);return D===B;case"Function":return!!D(C[w],w,C);case"Array":if(!d(C[w]))return!1;var j=N?g:m;return j(C[w],D);case"RegExp":return d(C[w])?N?g(C[w],D):!1:!!(C[w]&&C[w].match(D));case"Number":D=String(D);case"String":return d(C[w])?N?g(C[w],D):!1:C[w]===D;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var C=[],w=[],D=0,N=0;N<arguments.length;N++){var F=new o(arguments[N]);C.push(F);for(var V=F.segment(),B=0;B<V.length;B++)typeof V[B]=="string"&&w.push(V[B]),V[B]&&D++}if(!w.length||!D)return new o("");var j=new o("").segment(w);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(C,w){var D=Math.min(C.length,w.length),N;for(N=0;N<D;N++)if(C.charAt(N)!==w.charAt(N)){N--;break}return N<1?C.charAt(0)===w.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(N)!=="/"||w.charAt(N)!=="/")&&(N=C.substring(0,N).lastIndexOf("/")),C.substring(0,N+1))},o.withinString=function(C,w,D){D||(D={});var N=D.start||o.findUri.start,F=D.end||o.findUri.end,V=D.trim||o.findUri.trim,B=D.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var k=N.exec(C);if(!k)break;var G=k.index;if(D.ignoreHtml){var q=C.slice(Math.max(G-3,0),G);if(q&&j.test(q))continue}for(var Q=G+C.slice(G).search(F),W=C.slice(G,Q),J=-1;;){var Z=B.exec(W);if(!Z)break;var ae=Z.index+Z[0].length;J=Math.max(J,ae)}if(J>-1?W=W.slice(0,J)+W.slice(J).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(D.ignore&&D.ignore.test(W))){Q=G+W.length;var Ae=w(W,G,Q,C);if(Ae===void 0){N.lastIndex=Q;continue}Ae=String(Ae),C=C.slice(0,G)+Ae+C.slice(Q),N.lastIndex=G+Ae.length}}return N.lastIndex=0,C},o.ensureValidHostname=function(C,w){var D=!!C,N=!!w,F=!1;if(N&&(F=g(o.hostProtocols,w)),F&&!D)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(C&&C.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(C){if(C){var w=Number(C);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},o.noConflict=function(C){if(C){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function S(C){return function(w,D){return w===void 0?this._parts[C]||"":(this._parts[C]=w||null,this.build(!D),this)}}function I(C,w){return function(D,N){return D===void 0?this._parts[C]||"":(D!==null&&(D=D+"",D.charAt(0)===w&&(D=D.substring(1))),this._parts[C]=D,this.build(!N),this)}}a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(C,w){var D=this.query(C,w);return typeof D=="string"&&D.length?"?"+D:D},a.hash=function(C,w){var D=this.fragment(C,w);return typeof D=="string"&&D.length?"#"+D:D},a.pathname=function(C,w){if(C===void 0||C===!0){var D=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?o.decodeUrnPath:o.decodePath)(D):D}else return this._parts.urn?this._parts.path=C?o.recodeUrnPath(C):"":this._parts.path=C?o.recodePath(C):"/",this.build(!w),this},a.path=a.pathname,a.href=function(C,w){var D;if(C===void 0)return this.toString();this._string="",this._parts=o._parts();var N=C instanceof o,F=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var V=o.getDomAttribute(C);C=C[V]||"",F=!1}if(!N&&F&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=o.parse(String(C),this._parts);else if(N||F){var B=N?C._parts:C;for(D in B)D!=="query"&&c.call(this._parts,D)&&(this._parts[D]=B[D]);B.query&&this.query(B.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(C){var w=!1,D=!1,N=!1,F=!1,V=!1,B=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,D=o.ip4_expression.test(this._parts.hostname),N=o.ip6_expression.test(this._parts.hostname),w=D||N,F=!w,V=F&&n&&n.has(this._parts.hostname),B=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return F;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return D;case"ip6":case"ipv6":case"inet6":return N;case"idn":return B;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,O=a.port,L=a.hostname;a.protocol=function(C,w){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(o.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,C,w)},a.scheme=a.protocol,a.port=function(C,w){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),o.ensureValidPort(C))),O.call(this,C,w))},a.hostname=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var D={preventInvalidHostname:this._parts.preventInvalidHostname},N=o.parseHost(C,D);if(N!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=D.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,w)},a.origin=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var D=this.protocol(),N=this.authority();return N?(D?D+"://":"")+this.authority():""}else{var F=o(C);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var D=o.parseHost(C,this._parts);if(D!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var D=o.parseAuthority(C,this._parts);if(D!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var D=o.buildUserinfo(this._parts);return D&&D.substring(0,D.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),o.parseUserinfo(C,this._parts),this.build(!w),this},a.resource=function(C,w){var D;return C===void 0?this.path()+this.search()+this.hash():(D=o.parse(C),this._parts.path=D.path,this._parts.query=D.query,this._parts.fragment=D.fragment,this.build(!w),this)},a.subdomain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,D)||""}else{var N=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,N),V=new RegExp("^"+u(F));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&o.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,C),this.build(!w),this}},a.domain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.match(/\./g);if(D&&D.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(w).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,C)}return this.build(!w),this}},a.tld=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(D+1);return w!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var F;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C);else throw new TypeError('TLD "'+C+'" 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");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var D=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,D)||(this._parts.hostname?"/":"");return C?o.decodePath(N):N}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),B=new RegExp("^"+u(V));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=o.recodePath(C),this._parts.path=this._parts.path.replace(B,C),this.build(!w),this}},a.filename=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var D=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(D+1);return C?o.decodePathSegment(N):N}else{var F=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return C=o.recodePath(C),this._parts.path=this._parts.path.replace(V,C),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var D=this.filename(),N=D.lastIndexOf("."),F,V;return N===-1?"":(F=D.substring(N+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",C?o.decodePathSegment(V):V)}else{C.charAt(0)==="."&&(C=C.substring(1));var B=this.suffix(),j;if(B)C?j=new RegExp(u(B)+"$"):j=new RegExp(u("."+B)+"$");else{if(!C)return this;this._parts.path+="."+o.recodePath(C)}return j&&(C=o.recodePath(C),this._parts.path=this._parts.path.replace(j,C)),this.build(!w),this}},a.segment=function(C,w,D){var N=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",B=F.split(N);if(C!==void 0&&typeof C!="number"&&(D=w,w=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(V&&B.shift(),C<0&&(C=Math.max(B.length+C,0)),w===void 0)return C===void 0?B:B[C];if(C===null||B[C]===void 0)if(d(w)){B=[];for(var j=0,k=w.length;j<k;j++)!w[j].length&&(!B.length||!B[B.length-1].length)||(B.length&&!B[B.length-1].length&&B.pop(),B.push(y(w[j])))}else(w||typeof w=="string")&&(w=y(w),B[B.length-1]===""?B[B.length-1]=w:B.push(w));else w?B[C]=y(w):B.splice(C,1);return V&&B.unshift(""),this.path(B.join(N),D)},a.segmentCoded=function(C,w,D){var N,F,V;if(typeof C!="number"&&(D=w,w=C,C=void 0),w===void 0){if(N=this.segment(C,w,D),!d(N))N=N!==void 0?o.decode(N):void 0;else for(F=0,V=N.length;F<V;F++)N[F]=o.decode(N[F]);return N}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(F=0,V=w.length;F<V;F++)w[F]=o.encode(w[F]);return this.segment(C,w,D)};var _=a.query;return a.query=function(C,w){if(C===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var D=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=C.call(this,D);return this._parts.query=o.buildQuery(N||D,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=o.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,C,w)},a.setQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)N[C]=w!==void 0?w:null;else if(typeof C=="object")for(var F in C)c.call(C,F)&&(N[F]=C[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.addQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(N,C,w===void 0?null:w),this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.removeQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(N,C,w),this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.hasQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(N,C,w,D)},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(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},a.normalizeHostname=function(C){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(!C)),this},a.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},a.normalizePath=function(C){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var D,N="",F,V;for(w.charAt(0)!=="/"&&(D=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),D&&(N=w.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));F=w.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){w=w.substring(3);continue}V=w.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),w=w.substring(0,V)+w.substring(F+3)}return D&&this.is("relative")&&(w=N+w.substring(1)),this._parts.path=w,this.build(!C),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},a.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var C=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.unicode=function(){var C=o.encode,w=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.readable=function(){var C=this.clone();C.username("").password("").normalize();var w="";if(C._parts.protocol&&(w+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(w+=e.toUnicode(C._parts.hostname),C._parts.port&&(w+=":"+C._parts.port)):w+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(w+="/"),w+=C.path(!0),C._parts.query){for(var D="",N=0,F=C._parts.query.split("&"),V=F.length;N<V;N++){var B=(F[N]||"").split("=");D+="&"+o.decodeQuery(B[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),B[1]!==void 0&&(D+="="+o.decodeQuery(B[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+D.substring(1)}return w+=o.decodeQuery(C.hash(),!0),w},a.absoluteTo=function(C){var w=this.clone(),D=["protocol","username","password","hostname","port"],N,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof o||(C=new o(C)),w._parts.protocol||(w._parts.protocol=C._parts.protocol,this._parts.hostname))return w;for(F=0;V=D[F];F++)w._parts[V]=C._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(N=C.directory(),N=N||(C.path().indexOf("/")===0?"/":""),w._parts.path=(N?N+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=C._parts.path,w._parts.query||(w._parts.query=C._parts.query)),w.build(),w},a.relativeTo=function(C){var w=this.clone().normalize(),D,N,F,V,B;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new o(C).normalize(),D=w._parts,N=C._parts,V=w.path(),B=C.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(B.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(D.protocol===N.protocol&&(D.protocol=null),D.username!==N.username||D.password!==N.password||D.protocol!==null||D.username!==null||D.password!==null)return w.build();if(D.hostname===N.hostname&&D.port===N.port)D.hostname=null,D.port=null;else return w.build();if(V===B)return D.path="",w.build();if(F=o.commonPath(V,B),!F)return w.build();var j=N.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return D.path=j+D.path.substring(F.length)||"./",w.build()},a.equals=function(C){var w=this.clone(),D=new o(C),N={},F={},V={},B,j,k;if(w.normalize(),D.normalize(),w.toString()===D.toString())return!0;if(B=w.query(),j=D.query(),w.query(""),D.query(""),w.toString()!==D.toString()||B.length!==j.length)return!1;N=o.parseQuery(B,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(k in N)if(c.call(N,k)){if(d(N[k])){if(!m(N[k],F[k]))return!1}else if(N[k]!==F[k])return!1;V[k]=!0}for(k in F)if(c.call(F,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},a.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},a.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},o})});var j$=uh((RSn,aD)=>{/*! + * protobuf.js v8.8.0 (c) 2016, daniel wirtz + * compiled thu, 27 aug 2026 00:01:05 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,l=2,u=!0;l<arguments.length;)s[a++]=arguments[l++];return new Promise(function(h,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var y=new Array(arguments.length-1),b=0;b<y.length;)y[b++]=arguments[b];h.apply(null,y)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.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(u,f,h){for(var p=null,g=[],m=0,y=0,b;f<h;){var x=u[f++];switch(y){case 0:g[m++]=o[x>>2],b=(x&3)<<4,y=1;break;case 1:g[m++]=o[b|x>>4],b=(x&15)<<2,y=2;break;case 2:g[m++]=o[b|x>>6],g[m++]=o[x&63],y=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return y&&(g[m++]=o[b],g[m++]=61,y===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,h){for(var p=h,g=0,m,y=0;y<u.length;){var b=u.charCodeAt(y++);if(b===61&&g>1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:m=b,g=1;break;case 1:f[h++]=m<<2|(b&48)>>4,m=b,g=2;break;case 2:f[h++]=(m&15)<<4|(b&60)>>2,m=b,g=3;break;case 3:f[h++]=(m&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],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],l=0;l<a.length;)a[l].fn===s?a.splice(l,1):++l;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],l=1;l<arguments.length;)a.push(arguments[l++]);for(l=0;l<s.length;)s[l].fn.apply(s[l++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(l){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3]}function g(b,x,A){u[0]=b,x[A]=f[3],x[A+1]=f[2],x[A+2]=f[1],x[A+3]=f[0]}l.writeFloatLE=h?p:g,l.writeFloatBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],u[0]}function y(b,x){return f[3]=b[x],f[2]=b[x+1],f[1]=b[x+2],f[0]=b[x+3],u[0]}l.readFloatLE=h?m:y,l.readFloatBE=h?y:m}():function(){function u(h,p,g,m){var y=p<0?1:0;if(y&&(p=-p),p===0)h(1/p>0?0:2147483648,g,m);else if(isNaN(p))h(2143289344,g,m);else if(p>34028234663852886e22)h((y<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)h((y<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var b=Math.floor(Math.log(p)/Math.LN2),x=Math.round(p*Math.pow(2,-b)*8388608)&8388607;h((y<<31|b+127<<23|x)>>>0,g,m)}}l.writeFloatLE=u.bind(null,o),l.writeFloatBE=u.bind(null,r);function f(h,p,g){var m=h(p,g),y=(m>>31)*2+1,b=m>>>23&255,x=m&8388607;return b===255?x?NaN:y*(1/0):b===0?y*1401298464324817e-60*x:y*Math.pow(2,b-150)*(x+8388608)}l.readFloatLE=f.bind(null,s),l.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3],x[A+4]=f[4],x[A+5]=f[5],x[A+6]=f[6],x[A+7]=f[7]}function g(b,x,A){u[0]=b,x[A]=f[7],x[A+1]=f[6],x[A+2]=f[5],x[A+3]=f[4],x[A+4]=f[3],x[A+5]=f[2],x[A+6]=f[1],x[A+7]=f[0]}l.writeDoubleLE=h?p:g,l.writeDoubleBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],f[4]=b[x+4],f[5]=b[x+5],f[6]=b[x+6],f[7]=b[x+7],u[0]}function y(b,x){return f[7]=b[x],f[6]=b[x+1],f[5]=b[x+2],f[4]=b[x+3],f[3]=b[x+4],f[2]=b[x+5],f[1]=b[x+6],f[0]=b[x+7],u[0]}l.readDoubleLE=h?m:y,l.readDoubleBE=h?y:m}():function(){function u(h,p,g,m,y,b){var x=m<0?1:0;if(x&&(m=-m),m===0)h(0,y,b+p),h(1/m>0?0:2147483648,y,b+g);else if(isNaN(m))h(0,y,b+p),h(2146959360,y,b+g);else if(m>17976931348623157e292)h(0,y,b+p),h((x<<31|2146435072)>>>0,y,b+g);else{var A;if(m<22250738585072014e-324)A=m/5e-324,h(A>>>0,y,b+p),h((x<<31|A/4294967296)>>>0,y,b+g);else{var E=Math.floor(Math.log(m)/Math.LN2);E===1024&&(E=1023),A=m*Math.pow(2,-E),h(A*4503599627370496>>>0,y,b+p),h((x<<31|E+1023<<20|A*1048576&1048575)>>>0,y,b+g)}}}l.writeDoubleLE=u.bind(null,o,0,4),l.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,g,m,y){var b=h(m,y+p),x=h(m,y+g),A=(x>>31)*2+1,E=x>>>20&2047,S=4294967296*(x&1048575)+b;return E===2047?S?NaN:A*(1/0):E===0?A*5e-324*S:A*Math.pow(2,E-1075)*(S+4503599627370496)}l.readDoubleLE=f.bind(null,s,0,4),l.readDoubleBE=f.bind(null,a,4,0)}(),l}function o(l,u,f){u[f]=l&255,u[f+1]=l>>>8&255,u[f+2]=l>>>16&255,u[f+3]=l>>>24}function r(l,u,f){u[f]=l>>>24,u[f+1]=l>>>16&255,u[f+2]=l>>>8&255,u[f+3]=l&255}function s(l,u){return(l[u]|l[u+1]<<8|l[u+2]<<16|l[u+3]<<24)>>>0}function a(l,u){return(l[u]<<24|l[u+1]<<16|l[u+2]<<8|l[u+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,l=a>>>1,u=null,f=a;return function(p){if(p<1||p>l)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,l=0;l<r.length;++l)a=r.charCodeAt(l),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(l+1)&64512)===56320?(++l,s+=4):s+=3;return s},i.read=function(r,s,a){var l=a-s;if(l<1)return"";for(var u=null,f=[],h=0,p;s<a;)p=r[s++],p<128?f[h++]=p:p>191&&p<224?f[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,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,s,a){for(var l=a,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-l}},{}],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=l;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,y){return RangeError("index out of range: "+m.pos+" + "+(y||1)+" > "+m.len)}function l(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(y){if(y instanceof Uint8Array||Array.isArray(y))return new l(y);throw Error("illegal buffer")}:function(y){if(Array.isArray(y))return new l(y);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(l.create=function(A){return i.Buffer.isBuffer(A)?new o(A):u(A)})(b)}:u};l.create=f(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var y=4294967295;return function(){if(y=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(y=(y|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return y;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return y}}(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var y=this.uint32();return y>>>1^-(y&1)|0};function h(){var m=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}l.prototype.bool=function(){return this.uint32()!==0};function p(m,y){return(m[y-4]|m[y-3]<<8|m[y-2]<<16|m[y-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.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))}l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var y=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,y},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var y=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,y},l.prototype.bytes=function(){var y=this.uint32(),b=this.pos,x=this.pos+y;if(x>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(b,x);if(b===x){var A=i.Buffer;return A?A.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,x)},l.prototype.string=function(){var y=this.bytes();return s.read(y,0,y.length)},l.prototype.skip=function(y){if(typeof y=="number"){if(this.pos+y>this.len)throw a(this,y);this.pos+=y}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},l._configure=function(m){o=m,l.create=f(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return h.call(this)[y](!1)},uint64:function(){return h.call(this)[y](!0)},sint64:function(){return h.call(this).zzDecode()[y](!1)},fixed64:function(){return g.call(this)[y](!0)},sfixed64:function(){return g.call(this)[y](!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,l,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,l,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return h.emit("error",g,s),f(g);if(m===null)return h.end(!0),undefined;if(!(m instanceof l))try{m=l[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(y){return h.emit("error",y,s),f(y)}return h.emit("data",m,s),f(null,m)})}catch(p){return h.emit("error",p,s),setTimeout(function(){f(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(l,u){this.lo=l>>>0,this.hi=u>>>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(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,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 u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<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,l){var u=a[l];return u!=null&&a.hasOwnProperty(l)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).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,l){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,l):u.toNumber(!!l)};function o(s,a,l){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!l)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(l,u){if(!(this instanceof a))return new a(l,u);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}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 l={},u=0;u<a.length;++u)l[a[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(l[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(l){for(var u=0;u<a.length;++u)a[u]!==l&&delete this[a[u]]}},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(l,u){return new s(l,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(l){return new s(l)}}},{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 l(E,S,v){this.fn=E,this.len=S,this.next=undefined,this.val=v}function u(){}function f(E){this.head=E.head,this.tail=E.tail,this.len=E.len,this.next=E.states}function h(){this.len=0,this.head=new l(u,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(S){return new i.Array(S)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(S,v,P){return this.tail=this.tail.next=new l(S,v,P),this.len+=v,this};function g(E,S,v){S[v]=E&255}function m(E,S,v){for(;E>127;)S[v++]=E&127|128,E>>>=7;S[v]=E}function y(E,S){this.len=E,this.next=undefined,this.val=S}y.prototype=Object.create(l.prototype),y.prototype.fn=m,h.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new y((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},h.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},h.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(E,S,v){for(;E.hi;)S[v++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)S[v++]=E.lo&127|128,E.lo=E.lo>>>7;S[v++]=E.lo}h.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},h.prototype.bool=function(S){return this._push(g,1,S?1:0)};function x(E,S,v){S[v]=E&255,S[v+1]=E>>>8&255,S[v+2]=E>>>16&255,S[v+3]=E>>>24}h.prototype.fixed32=function(S){return this._push(x,4,S>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(S){var v=r.from(S);return this._push(x,4,v.lo)._push(x,4,v.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},h.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var A=i.Array.prototype.set?function(S,v,P){v.set(S,P)}:function(S,v,P){for(var M=0;M<S.length;++M)v[P+M]=S[M]};h.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var P=h.alloc(v=s.length(S));s.decode(S,P,0),S=P}return this.uint32(v)._push(A,v,S)},h.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new l(u,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 l(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var S=this.head,v=this.tail,P=this.len;return this.reset().uint32(P),P&&(this.tail.next=S.next,this.tail=v,this.len+=P),this},h.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),P=0;S;)S.fn(S.val,v,P),P+=S.len,S=S.next;return v},h._configure=function(E){o=E,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(l,u,f){u.set(l,f)}:function(l,u,f){if(l.copy)l.copy(u,f,0,l.length);else for(var h=0;h<l.length;)u[f++]=l[h++]}},r.prototype.bytes=function(l){o.isString(l)&&(l=o._Buffer_from(l,"base64"));var u=l.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,l),this};function s(a,l,u){a.length<40?o.utf8.write(a,l,u):l.utf8Write?l.utf8Write(a,u):l.write(a,u)}r.prototype.string=function(l){var u=o.Buffer.byteLength(l);return this.uint32(u),u&&this._push(s,u,l),this},r._configure()},{15:15,16:16}]},{},[8])})()});var BAe=Wu((A9i,OH)=>{/* 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(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=l(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,y=r(g,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),b={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(b.maskData=y.resultMask),h.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(b.fileInfo=s(g),h.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,h,p,g,m){var y=0,b=f.pixels.numBlocksX,x=f.pixels.numBlocksY,A=Math.floor(f.width/b),E=Math.floor(f.height/x),S=2*f.maxZError,v=Number.MAX_VALUE,P;p=p||(f.mask?f.mask.bitset:null);var M,R;M=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var L=new Float32Array(A*E),B,_,w=0;w<=x;w++){var D=w!==x?E:f.height%x;if(D!==0)for(var I=0;I<=b;I++){var N=I!==b?A:f.width%b;if(N!==0){var k=w*f.width*E+I*A,H=f.width-N,V=f.pixels.blocks[y],j,U,q;V.encoding<2?(V.encoding===0?j=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),j=L),U=0):V.encoding===2?q=0:q=V.offset;var X;if(p)for(_=0;_<D;_++){for(k&7&&(X=p[k>>3],X<<=k&7),B=0;B<N;B++)k&7||(X=p[k>>3]),X&128?(R&&(R[k]=1),P=V.encoding<2?j[U++]:q,v=v>P?P:v,M[k++]=P):(R&&(R[k]=0),M[k++]=g),X<<=1;k+=H}else if(V.encoding<2)for(_=0;_<D;_++){for(B=0;B<N;B++)P=j[U++],v=v>P?P:v,M[k++]=P;k+=H}else for(v=v>q?q:v,_=0;_<D;_++){for(B=0;B<N;B++)M[k++]=q;k+=H}if(V.encoding===1&&U!==V.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:M,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<h;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},l=function(f,h,p){var g={},m=new Uint8Array(f,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var y=new DataView(f,h,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),h+=24,!p)if(y=new DataView(f,h,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,h,g.mask.numBytes);var x=y.getInt16(0,!0),A=2,E=0;do{if(x>0)for(;x--;)b[E++]=y.getUint8(A++);else{var S=y.getUint8(A++);for(x=-x;x--;)b[E++]=S}x=y.getInt16(A,!0),A+=2}while(A<g.mask.numBytes);if(x!==-32768||E<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,h+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,h,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),h+=16;var v=g.pixels.numBlocksX,P=g.pixels.numBlocksY,M=v+(g.width%v>0?1:0),R=P+(g.height%P>0?1:0);g.pixels.blocks=new Array(M*R);for(var L=0,B=0;B<R;B++)for(var _=0;_<M;_++){var w=0,D=f.byteLength-h;y=new DataView(f,h,Math.min(10,D));var I={};g.pixels.blocks[L++]=I;var N=y.getUint8(0);if(w++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=y.getInt8(1),w++;else if(N===1)I.offset=y.getInt16(1,!0),w+=2;else if(N===0)I.offset=y.getFloat32(1,!0),w+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=y.getUint8(w),w++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=y.getUint8(w),w++;else if(N===1)I.numValidPixels=y.getUint16(w,!0),w+=2;else if(N===0)I.numValidPixels=y.getUint32(w,!0),w+=4;else throw"Invalid valid pixel count type"}if(h+=w,I.encoding!==3){var k,H;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";k=new ArrayBuffer(V*4),H=new Uint8Array(k),H.set(new Uint8Array(f,h,V*4));var j=new Float32Array(k);I.rawData=j,h+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);k=new ArrayBuffer(q*4),H=new Uint8Array(k),H.set(new Uint8Array(f,h,U)),I.stuffedData=new Uint32Array(k),h+=U}}}return g.eofOffset=h,g},u=function(f,h,p,g,m,y,b){var x=(1<<h)-1,A=0,E,S=0,v,P,M=Math.ceil((b-g)/m),R=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*R,E=0;E<p;E++){if(S===0&&(P=f[A++],S=32),S>=h)v=P>>>S-h&x,S-=h;else{var L=h-S;v=(P&x)<<L&x,P=f[A++],S=32-L,v+=P>>>S}y[E]=v<M?g+v*m:b}return y};return o}(),t=function(){"use strict";var o={unstuff:function(l,u,f,h,p,g,m,y){var b=(1<<f)-1,x=0,A,E=0,S,v,P,M,R=l.length*4-Math.ceil(f*h/8);if(l[l.length-1]<<=8*R,p)for(A=0;A<h;A++)E===0&&(v=l[x++],E=32),E>=f?(S=v>>>E-f&b,E-=f):(P=f-E,S=(v&b)<<P&b,v=l[x++],E=32-P,S+=v>>>E),u[A]=p[S];else for(M=Math.ceil((y-g)/m),A=0;A<h;A++)E===0&&(v=l[x++],E=32),E>=f?(S=v>>>E-f&b,E-=f):(P=f-E,S=(v&b)<<P&b,v=l[x++],E=32-P,S+=v>>>E),u[A]=S<M?g+S*m:y},unstuffLUT:function(l,u,f,h,p,g){var m=(1<<u)-1,y=0,b=0,x=0,A=0,E=0,S,v=[],P=l.length*4-Math.ceil(u*f/8);l[l.length-1]<<=8*P;var M=Math.ceil((g-h)/p);for(b=0;b<f;b++)A===0&&(S=l[y++],A=32),A>=u?(E=S>>>A-u&m,A-=u):(x=u-A,E=(S&m)<<x&m,S=l[y++],A=32-x,E+=S>>>A),v[b]=E<M?h+E*p:g;return v.unshift(h),v},unstuff2:function(l,u,f,h,p,g,m,y){var b=(1<<f)-1,x=0,A,E=0,S=0,v,P,M;if(p)for(A=0;A<h;A++)E===0&&(P=l[x++],E=32,S=0),E>=f?(v=P>>>S&b,E-=f,S+=f):(M=f-E,v=P>>>S&b,P=l[x++],E=32-M,v|=(P&(1<<M)-1)<<f-M,S=M),u[A]=p[v];else{var R=Math.ceil((y-g)/m);for(A=0;A<h;A++)E===0&&(P=l[x++],E=32,S=0),E>=f?(v=P>>>S&b,E-=f,S+=f):(M=f-E,v=P>>>S&b,P=l[x++],E=32-M,v|=(P&(1<<M)-1)<<f-M,S=M),u[A]=v<R?g+v*m:y}return u},unstuffLUT2:function(l,u,f,h,p,g){var m=(1<<u)-1,y=0,b=0,x=0,A=0,E=0,S=0,v,P=[],M=Math.ceil((g-h)/p);for(b=0;b<f;b++)A===0&&(v=l[y++],A=32,S=0),A>=u?(E=v>>>S&m,A-=u,S+=u):(x=u-A,E=v>>>S&m,v=l[y++],A=32-x,E|=(v&(1<<x)-1)<<u-x,S=x),P[b]=E<M?h+E*p:g;return P.unshift(h),P},originalUnstuff:function(l,u,f,h){var p=(1<<f)-1,g=0,m,y=0,b,x,A,E=l.length*4-Math.ceil(f*h/8);for(l[l.length-1]<<=8*E,m=0;m<h;m++)y===0&&(x=l[g++],y=32),y>=f?(b=x>>>y-f&p,y-=f):(A=f-y,b=(x&p)<<A&p,x=l[g++],y=32-A,b+=x>>>y),u[m]=b;return u},originalUnstuff2:function(l,u,f,h){var p=(1<<f)-1,g=0,m,y=0,b=0,x,A,E;for(m=0;m<h;m++)y===0&&(A=l[g++],y=32,b=0),y>=f?(x=A>>>b&p,y-=f,b+=f):(E=f-y,x=A>>>b&p,A=l[g++],y=32-E,x|=(A&(1<<E)-1)<<f-E,b=E),u[m]=x;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(l){for(var u=65535,f=65535,h=l.length,p=Math.floor(h/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=l[g++]<<8,f+=u+=l[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=l[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(l,u){var f=u.ptr,h=new Uint8Array(l,f,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;f+=6;var g=new DataView(l,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(l,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(l,f,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),f+=40,u.headerInfo=p,u.ptr=f;var y,b;if(m>=3&&(b=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(l,f-b,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(l,u.ptr,h,p),m=this.readSubArray(l,u.ptr+p,h,p);u.ptr+=2*p;var y,b=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){b=!1;break}return f.minValues=g,f.maxValues=m,b},readSubArray:function(l,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(l,u,h);else{var g=new ArrayBuffer(h),m=new Uint8Array(g);m.set(new Uint8Array(l,u,h)),p=new f(g)}return p},readMask:function(l,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,g=h.numValidPixel,m=new DataView(l,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var b,x;if(g===0)b=new Uint8Array(Math.ceil(p/8)),y.bitset=b,x=new Uint8Array(p),u.pixels.resultMask=x,f+=y.numBytes;else if(y.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(l,f,y.numBytes);var A=m.getInt16(0,!0),E=2,S=0,v=0;do{if(A>0)for(;A--;)b[S++]=m.getUint8(E++);else for(v=m.getUint8(E++),A=-A;A--;)b[S++]=v;A=m.getInt16(E,!0),E+=2}while(E<y.numBytes);if(A!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";x=new Uint8Array(p);var P=0,M=0;for(M=0;M<p;M++)M&7?(P=b[M>>3],P<<=M&7):P=b[M>>3],P&128&&(x[M]=1);u.pixels.resultMask=x,y.bitset=b,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(l,u,f){var h=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,b=p.numValidPixel*r.getDataTypeSize(y)*g,x,A=u.pixels.resultMask;if(f===Uint8Array)x=new Uint8Array(l,h,b);else{var E=new ArrayBuffer(b),S=new Uint8Array(E);S.set(new Uint8Array(l,h,b)),x=new f(E)}if(x.length===m*g)u.pixels.resultPixels=x;else{u.pixels.resultPixels=new f(m*g);var v=0,P=0,M=0,R=0;if(g>1)for(M=0;M<g;M++)for(R=M*m,P=0;P<m;P++)A[P]&&(u.pixels.resultPixels[R+P]=x[v++]);else for(P=0;P<m;P++)A[P]&&(u.pixels.resultPixels[P]=x[v++])}return h+=b,u.ptr=h,!0},readHuffmanTree:function(l,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(l,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),m=h.getInt32(8,!0),y=h.getInt32(12,!0);if(m>=y)return!1;var b=new Uint32Array(y-m);r.decodeBits(l,u,b);var x=[],A,E,S,v;for(A=m;A<y;A++)E=A-(A<g?0:g),x[E]={first:b[A-m],second:null};var P=l.byteLength-u.ptr,M=Math.ceil(P/4),R=new ArrayBuffer(M*4),L=new Uint8Array(R);L.set(new Uint8Array(l,u.ptr,P));var B=new Uint32Array(R),_=0,w,D=0;for(w=B[0],A=m;A<y;A++)E=A-(A<g?0:g),v=x[E].first,v>0&&(x[E].second=w<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,D++,w=B[D])):(_+=v-32,D++,w=B[D],x[E].second|=w>>>32-_));var I=0,N=0,k=new s;for(A=0;A<x.length;A++)x[A]!==void 0&&(I=Math.max(I,x[A].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var H=[],V,j,U,q,X,te;for(A=m;A<y;A++)if(E=A-(A<g?0:g),v=x[E].first,v>0)if(V=[v,E],v<=N)for(j=x[E].second<<N-v,U=1<<N-v,S=0;S<U;S++)H[j|S]=V;else for(j=x[E].second,te=k,q=v-1;q>=0;q--)X=j>>>q&1,X?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),q===0&&!te.val&&(te.val=V[1]);return{decodeLut:H,numBitsLUTQick:N,numBitsLUT:I,tree:k,stuffedData:B,srcPtr:D,bitPos:_}},readHuffman:function(l,u,f){var h=u.headerInfo,p=h.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,b=this.readHuffmanTree(l,u),x=b.decodeLut,A=b.tree,E=b.stuffedData,S=b.srcPtr,v=b.bitPos,P=b.numBitsLUTQick,M=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,L,B,_,w=u.pixels.resultMask,D,I,N,k,H,V,j,U=0;v>0&&(S++,v=0);var q=E[S],X=u.encodeMode===1,te=new f(y*p),K=te,Z;for(Z=0;Z<h.numDims;Z++){if(p>1&&(K=new f(te.buffer,y*Z,y),U=0),u.headerInfo.numValidPixel===m*g)for(V=0,k=0;k<g;k++)for(H=0;H<m;H++,V++){if(B=0,D=q<<v>>>32-P,I=D,32-v<P&&(D|=E[S+1]>>>64-v-P,I=D),x[I])B=x[I][1],v+=x[I][0];else for(D=q<<v>>>32-M,I=D,32-v<M&&(D|=E[S+1]>>>64-v-M,I=D),L=A,j=0;j<M;j++)if(N=D>>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){B=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=E[S]),_=B-R,X?(H>0?_+=U:k>0?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}else for(V=0,k=0;k<g;k++)for(H=0;H<m;H++,V++)if(w[V]){if(B=0,D=q<<v>>>32-P,I=D,32-v<P&&(D|=E[S+1]>>>64-v-P,I=D),x[I])B=x[I][1],v+=x[I][0];else for(D=q<<v>>>32-M,I=D,32-v<M&&(D|=E[S+1]>>>64-v-M,I=D),L=A,j=0;j<M;j++)if(N=D>>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){B=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=E[S]),_=B-R,X?(H>0&&w[V-1]?_+=U:k>0&&w[V-m]?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=te},decodeBits:function(l,u,f,h,p){{var g=u.headerInfo,m=g.fileVersion,y=0,b=new DataView(l,u.ptr,5),x=b.getUint8(0);y++;var A=x>>6,E=A===0?4:3-A,S=(x&32)>0,v=x&31,P=0;if(E===1)P=b.getUint8(y),y++;else if(E===2)P=b.getUint16(y,!0),y+=2;else if(E===4)P=b.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var M=2*g.maxZError,R,L,B,_,w,D,I,N,k,H,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,N=b.getUint8(y),k=v,y++,_=Math.ceil((N-1)*v/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),B=new Uint8Array(L),u.ptr+=y,B.set(new Uint8Array(l,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,H=0;N-1>>>H;)H++;_=Math.ceil(P*H/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),B=new Uint8Array(L),B.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?D=o.unstuffLUT2(I,v,N-1,h,M,V):D=o.unstuffLUT(I,v,N-1,h,M,V),m>=3?o.unstuff2(R,f,H,P,D):o.unstuff(R,f,H,P,D)}else u.counter.bitstuffer++,H=v,u.ptr+=y,H>0&&(_=Math.ceil(P*H/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),B=new Uint8Array(L),B.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?h==null?o.originalUnstuff2(R,f,H,P):o.unstuff2(R,f,H,P,!1,h,M,V):h==null?o.originalUnstuff(R,f,H,P):o.unstuff(R,f,H,P,!1,h,M,V))}},readTiles:function(l,u,f){var h=u.headerInfo,p=h.width,g=h.height,m=h.microBlockSize,y=h.imageType,b=r.getDataTypeSize(y),x=Math.ceil(p/m),A=Math.ceil(g/m);u.pixels.numBlocksY=A,u.pixels.numBlocksX=x,u.pixels.ptr=0;var E=0,S=0,v=0,P=0,M=0,R=0,L=0,B=0,_=0,w=0,D=0,I=0,N=0,k=0,H=0,V=0,j,U,q,X,te,K,Z=new f(m*m),ee=g%m||m,me=p%m||m,xe,ue,ye=h.numDims,Ae,Pe=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(v=0;v<A;v++)for(M=v!==A-1?m:ee,P=0;P<x;P++)for(R=P!==x-1?m:me,D=v*p*m+P*m,I=p-R,Ae=0;Ae<ye;Ae++){if(ye>1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*Ae*b,p*g)),L=l.byteLength-u.ptr,j=new DataView(l,u.ptr,Math.min(10,L)),U={},V=0,B=j.getUint8(0),V++,_=B>>6&255,w=B>>2&15,w!==(P*m>>3&15))throw"integrity issue";if(K=B&3,K>3)throw u.ptr+=V,"Invalid block encoding ("+K+")";if(K===2){u.counter.constant++,u.ptr+=V;continue}else if(K===0){if(u.counter.uncompressed++,u.ptr+=V,N=M*R*b,k=l.byteLength-u.ptr,N=N<k?N:k,q=new ArrayBuffer(N%b===0?N:N+b-N%b),X=new Uint8Array(q),X.set(new Uint8Array(l,u.ptr,N)),te=new f(q),H=0,Pe)for(E=0;E<M;E++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=te[H++]),D++;D+=I}else for(E=0;E<M;E++){for(S=0;S<R;S++)Ee[D++]=te[H++];D+=I}u.ptr+=H*b}else if(xe=r.getDataTypeUsed(y,_),ue=r.getOnePixel(U,V,xe,j),V+=r.getDataTypeSize(xe),K===3)if(u.ptr+=V,u.counter.constantoffset++,Pe)for(E=0;E<M;E++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=ue),D++;D+=I}else for(E=0;E<M;E++){for(S=0;S<R;S++)Ee[D++]=ue;D+=I}else if(u.ptr+=V,r.decodeBits(l,u,Z,ue,Ae),V=0,Pe)for(E=0;E<M;E++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=Z[V++]),D++;D+=I}else for(E=0;E<M;E++){for(S=0;S<R;S++)Ee[D++]=Z[V++];D+=I}}},formatFileInfo:function(l){return{fileIdentifierString:l.headerInfo.fileIdentifierString,fileVersion:l.headerInfo.fileVersion,imageType:l.headerInfo.imageType,height:l.headerInfo.height,width:l.headerInfo.width,numValidPixel:l.headerInfo.numValidPixel,microBlockSize:l.headerInfo.microBlockSize,blobSize:l.headerInfo.blobSize,maxZError:l.headerInfo.maxZError,pixelType:r.getPixelType(l.headerInfo.imageType),eofOffset:l.eofOffset,mask:l.mask?{numBytes:l.mask.numBytes}:null,pixels:{numBlocksX:l.pixels.numBlocksX,numBlocksY:l.pixels.numBlocksY,maxValue:l.headerInfo.zMax,minValue:l.headerInfo.zMin,noDataValue:l.noDataValue}}},constructConstantSurface:function(l){var u=l.headerInfo.zMax,f=l.headerInfo.numDims,h=l.headerInfo.height*l.headerInfo.width,p=h*f,g=0,m=0,y=0,b=l.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(y=g*h,m=0;m<h;m++)b[m]&&(l.pixels.resultPixels[y+m]=u);else for(m=0;m<h;m++)b[m]&&(l.pixels.resultPixels[m]=u);else if(l.pixels.resultPixels.fill)l.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)l.pixels.resultPixels[m]=u},getDataTypeArray:function(l){var u;switch(l){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(l){var u;switch(l){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(l,u){if(u==null)return!1;var f;switch(l){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(l){var u=0;switch(l){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=l}return u},getDataTypeUsed:function(l,u){var f=l;switch(l){case 2:case 4:f=l-u;break;case 3:case 5:f=l-2*u;break;case 6:u===0?f=l:u===1?f=2:f=1;break;case 7:u===0?f=l:f=l-2*u+1;break;default:f=l;break}return f},getOnePixel:function(l,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(l,u,f){this.val=l,this.left=u,this.right=f},a={decode:function(l,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(l,p)){var g=p.headerInfo,m=g.fileVersion,y=r.getDataTypeArray(g.imageType);r.readMask(l,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new y(b*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(m>=4&&r.checkMinMaxRanges(l,p))r.constructConstantSurface(p);else{var x=new DataView(l,p.ptr,2),A=x.getUint8(0);if(p.ptr++,A)r.readDataOneSweep(l,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var E=x.getUint8(1);if(p.ptr++,p.encodeMode=E,E>2||m<4&&E>1)throw"Invalid Huffman flag "+E;E?r.readHuffman(l,p,y):r.readTiles(l,p,y)}else r.readTiles(l,p,y)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={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,f)){var P=p.pixels.resultMask;for(h=0;h<b;h++)P[h]||(v.pixelData[h]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(l){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<l.byteLength-58;)r.readHeaderInfo(l,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};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),l=String.fromCharCode.apply(null,a),u,f;if(l.trim()==="CntZImage")u=e,f=1;else if(l.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+l;for(var h=0,p=o.byteLength-10,g,m=[],y,b,x={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var A=u.decode(o,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=A.fileInfo.eofOffset,h===0&&(g=A.encodedMaskData,b=A.maskData,x.width=A.width,x.height=A.height,x.dimCount=A.dimCount||1,x.pixelType=A.pixelType||A.fileInfo.pixelType,x.mask=A.maskData),f>1&&A.fileInfo.mask&&A.fileInfo.mask.numBytes>0&&m.push(A.maskData),h++,x.pixels.push(A.pixelData),x.statistics.push({minValue:A.minValue,maxValue:A.maxValue,noDataValue:A.noDataValue,dimStats:A.dimStats})}var E,S,v;if(f>1&&m.length>1){for(v=x.width*x.height,x.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),E=1;E<m.length;E++)for(y=m[E],S=0;S<v;S++)b[S]=b[S]&y[S];x.maskData=b}return x}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof OH<"u"&&OH.exports?OH.exports=i:this.Lerc=i})()});var qCe=Wu((M_o,WCe)=>{WCe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLj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jmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHy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AAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var XCe=Wu((L_o,YCe)=>{var{webm:TSt,mp4:ASt}=qCe(),Y$=()=>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,X$=()=>"wakeLock"in navigator,K$=class{constructor(){if(this.enabled=!1,X$()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else Y$()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",TSt),this._addSourceToVideo(this.noSleepVideo,"mp4",ASt),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 X$()?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}):Y$()?(this.disable(),console.warn(` + */(function(e){"use strict";(function(n,i,r){function o(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},o,c,c.exports),c.exports}var s=o(r[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof aD=="object"&&aD&&aD.exports&&(aD.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.utf8;function c(T,E){return RangeError("index out of range: "+T.pos+" + "+(E||1)+" > "+T.len)}function u(T){this.buf=T,this.pos=0,this.len=T.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(T){if(Array.isArray(T)&&(T=new Uint8Array(T)),T instanceof Uint8Array)return new u(T);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(v){return(u.create=function(I){return r.Buffer.isBuffer(I)?new o(I):f(I)})(v)}:f};u.create=d(),u.prototype.raw=function(E,v){return this.buf.subarray(E,v)};function p(T){for(var E=0,v=0;v<4;++v){if(T.pos>=T.len)throw c(T);var S=T.buf[T.pos++];if(E=(E|(S&127)<<v*7)>>>0,S<128)return E}throw c(T)}u.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v++]<128)return this.pos=v,S;for(var I=0;I<5;++I){if(v>=this.len)throw this.pos=v,c(this);if(E[v++]<128)return this.pos=v,S}throw this.pos=v,Error("invalid varint encoding")},u.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v]<128&&(E[v]&112)===0)return this.pos=v+1,S;throw this.pos=v+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var E=this.uint32();return E>>>1^-(E&1)|0};function g(){var T=new s(0,0),E=0;if(this.len-this.pos>4){for(;E<4;++E)if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T;if(T.lo=(T.lo|(this.buf[this.pos]&127)<<28)>>>0,T.hi=(T.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return T;E=0}else{for(;E<4;++E){if(this.pos>=this.len)throw c(this);if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T}throw c(this)}if(this.len-this.pos>4){for(;E<5;++E)if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}else for(;E<5;++E){if(this.pos>=this.len)throw c(this);if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var E=!1,v,S=0;S<10;++S){if(this.pos>=this.len)throw c(this);if(v=this.buf[this.pos++],v&127&&(E=!0),v<128)return E}throw Error("invalid varint encoding")};function m(T,E){return(T[E-4]|T[E-3]<<8|T[E-2]<<16|T[E-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var E=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,E},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var E=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,E},u.prototype.uint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.uint32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.int32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint32());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.bools=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O!==0):(this.pos=R-1,E.push(this.bool()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E};var A=8,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getUint32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.sfixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getInt32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4)|0;if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.floats=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getFloat32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=r.float.readFloatLE(C,O);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.doubles=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>3,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=8)E[R++]=L.getFloat64(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=8)E[R++]=r.float.readDoubleLE(C,O);if(this.pos=O,O!==S)throw c(this,8);return E},u.prototype.uint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.uint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.int64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.fixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.fixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.sfixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.sfixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.bytes=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,this.raw(v,S)},u.prototype.string=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.read(this.buf,v,S)},u.prototype.stringVerify=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.readStrict(this.buf,v,S)},u.prototype.skip=function(E){if(typeof E=="number"){if(this.pos+E>this.len)throw c(this,E);this.pos+=E}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(T,E,v){if(E===e&&(E=0),E>u.recursionLimit)throw Error("max depth exceeded");if(v===0)throw Error("illegal tag: field number 0");switch(T){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var S=this.tag(),I=S>>>3;if(T=S&7,!I)throw Error("illegal tag: field number 0");if(T===4){if(v!==e&&I!==v)throw Error("invalid end group tag");break}this.skipType(T,E+1,I)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+T+" at offset "+this.pos)}return this},u._configure=function(T){o=T,u.create=d(),o._configure();var E=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return g.call(this)[E](!1)},uint64:function(){return g.call(this)[E](!0)},sint64:function(){return g.call(this).zzDecode()[E](!1)},fixed64:function(){return y.call(this)[E](!0)},sfixed64:function(){return y.call(this)[E](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var r=t(2);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(a){r.call(this,a)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},s.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}o.prototype.rpcCall=function s(a,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(s,p,a,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,a),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,a),d(A)}return p.emit("data",y,a),d(null,y)})}catch(g){return p.emit("error",g,a),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,s){for(var a=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)a[c++]=arguments[u++];return new Promise(function(p,g){a[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(s||null,a)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),s=new Array(123),a=0;a<64;)s[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,E;m<y;){var v=g[m++];switch(T){case 0:b[x++]=o[v>>2],E=(v&3)<<4,T=1;break;case 1:b[x++]=o[E|v>>4],E=(v&15)<<2,T=2;break;case 2:b[x++]=o[E|v>>6],b[x++]=o[v&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[E],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&b>1)break;if((E=s[E])===e)throw Error(c);switch(b){case 0:x=E,b=1;break;case 1:m[y++]=x<<2|(E&48)>>4,x=E,b=2;break;case 2:m[y++]=(x&15)<<4|(E&60)>>2,x=E,b=3;break;case 3:m[y++]=(x&3)<<6|E,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},r.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===a?c.splice(u,1):++u}return this},r.prototype.emit=function(s){var a=this._listeners[s];if(a){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,s);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,a),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var E=Math.floor(Math.log(y)/Math.LN2);E===1024&&(E=1023),T=y*Math.pow(2,-E),p(T*4503599627370496>>>0,A,b+g),p((x<<31|E+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,s,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,E=x>>>20&2047,v=4294967296*(x&1048575)+b;return E===2047?v?NaN:T*(1/0):E===0?T*5e-324*v:T*Math.pow(2,E-1075)*(v+4503599627370496)}u.readDoubleLE=d.bind(null,a,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function s(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function a(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return s;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):s},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===a?s:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,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 f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function s(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=s,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&s(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,s,a){var c=a||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=s.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=o}r.length=function(f){for(var d=0,p=0,g=0;g<f.length;++g)p=f.charCodeAt(g),p<128?d+=1:p<2048?d+=2:(p&64512)===55296&&(f.charCodeAt(g+1)&64512)===56320?(++g,d+=4):d+=3;return d};function c(u,f,d,p){var g=d===0&&p===f.length?f:f.subarray(d,p);return u.decode(g)}r.read=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(o,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(o,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(o,f,m,p);g+=String.fromCharCode(y)}return g},r.readStrict=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(s,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(s,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(s,f,m,p);g+=String.fromCharCode(y)}return g},r.write=function(f,d,p){for(var g=p,m,y,A=0;A<f.length;++A)m=f.charCodeAt(A),m<128?d[p++]=m:m<2048?(d[p++]=m>>6|192,d[p++]=m&63|128):(m&64512)===55296&&((y=f.charCodeAt(A+1))&64512)===56320?(m=65536+((m&1023)<<10)+(y&1023),++A,d[p++]=m>>18|240,d[p++]=m>>12&63|128,d[p++]=m>>6&63|128,d[p++]=m&63|128):(d[p++]=m>>12|224,d[p++]=m>>6&63|128,d[p++]=m&63|128);return p-g}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(u.initialBufferSize),this.view=null,this.states=null}u.initialBufferSize=128,Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(E){return new Uint8Array(E)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(E){var v=this.pos+E;if(v>this.buf.length){var S=this.buf.length<<1;S<v&&(S=v);var I=this.constructor.alloc(S);I.set(this.buf.subarray(0,this.pos),0),this.buf=I,this.view=null}};function p(T,E,v){for(var S=0;S<T.length;)E[v++]=T.charCodeAt(S++)}function g(T,E,v){for(;T>127;)E[v++]=T&127|128,T>>>=7;return E[v]=T,v+1}u.prototype.uint32=function(E){E=E>>>0,this._reserve(5);var v=this.pos;return this.pos=g(E,this.buf,v),this},u.prototype.int32=function(E){return(E|=0)<0?(this._reserve(10),m(s.fromNumber(E),this.buf,this.pos),this.pos+=10,this):this.uint32(E)},u.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function m(T,E,v){for(var S=T.lo,I=T.hi;I;)E[v++]=S&127|128,S=(S>>>7|I<<25)>>>0,I>>>=7;for(;S>127;)E[v++]=S&127|128,S=S>>>7;return E[v]=S,v+1}u.prototype.uint64=function(E){var v=s.from(E);this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(E){var v=s.from(E).zzEncode();this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.bool=function(E){return this._reserve(1),this.buf[this.pos++]=E?1:0,this};function y(T,E,v){E[v]=T&255,E[v+1]=T>>>8&255,E[v+2]=T>>>16&255,E[v+3]=T>>>24}u.prototype.fixed32=function(E){return this._reserve(4),y(E>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(E){var v=s.from(E);return this._reserve(8),y(v.lo,this.buf,this.pos),y(v.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(E){return this._reserve(4),r.float.writeFloatLE(E,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(E){return this._reserve(8),r.float.writeDoubleLE(E,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(E)){var S=u.alloc(v=a.length(E));a.decode(E,S,0),E=S}return this.uint32(v),this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this},u.prototype.raw=function(E){var v=E.length>>>0;return v?(this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this):this},u.prototype._delim=function(E,v){var S=d(v);return S>1&&this.buf.copyWithin(E+S,E+1,E+1+v),g(v,this.buf,E),this.pos=E+S+v,this},u.prototype.string=function(E){var v=E.length;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(v<128){this._reserve(v*3+5);var S=this.pos;return this._delim(S,c.write(E,this.buf,S+1))}var I=c.length(E);return this.uint32(I),this._reserve(I),I===E.length?p(E,this.buf,this.pos):c.write(E,this.buf,this.pos),this.pos+=I,this},u.prototype.uint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g(E[O]>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.int32s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O,L=0;L<v;++L)(O=E[L]|0)<0?R=m(s.fromNumber(O),S,R):R=g(O,S,R);return this._delim(I,R-I-1)},u.prototype.sint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g((E[O]<<1^E[O]>>31)>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.uint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]),S,R);return this._delim(I,R-I-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]).zzEncode(),S,R);return this._delim(I,R-I-1)},u.prototype.bools=function(E){var v=E.length;this.uint32(v),this._reserve(v);for(var S=this.buf,I=this.pos,R=0;R<v;++R)S[I++]=E[R]?1:0;return this.pos+=v,this};var A=16,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,b);if(O)for(R=0;R<v;++R)O.setUint32(I,E[R]>>>0,!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)y(E[R]>>>0,L,I),I+=4}return this.pos+=S,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O,L=x(this,v,b);if(L)for(R=0;R<v;++R)O=s.from(E[R]),L.setUint32(I,O.lo,!0),L.setUint32(I+4,O.hi,!0),I+=8;else{var _=this.buf;for(R=0;R<v;++R)O=s.from(E[R]),y(O.lo,_,I),y(O.hi,_,I+4),I+=8}return this.pos+=S,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat32(I,E[R],!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeFloatLE(E[R],L,I),I+=4}return this.pos+=S,this},u.prototype.doubles=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat64(I,E[R],!0),I+=8;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeDoubleLE(E[R],L,I),I+=8}return this.pos+=S,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var E=this.states;return E&&E.length?this.pos=E.pop():this.pos=0,this},u.prototype.ldelim=function(){var E=this.states,v,S;if(E&&E.length){var I=E.pop();v=this.pos-I-1,S=d(v),S>1?(this._reserve(S-1),this.buf.copyWithin(I+S,I+1,I+1+v),this.pos+=S-1,g(v,this.buf,I)):this.buf[I]=v}else v=this.pos,S=d(v),this._reserve(S),this.buf.copyWithin(S,0,v),g(v,this.buf,0),this.pos+=S;return this},u.prototype.finish=function(E){if(E)return this.buf.subarray(0,this.pos);var v=this.constructor.alloc(this.pos);return v.set(this.buf.subarray(0,this.pos),0),v},u.prototype.finishInto=function(E,v){return v===e&&(v=0),E.set(this.buf.subarray(0,this.pos),v),E},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var r=t(15);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(){r.call(this)}var a;s._configure=function(){s.alloc=o.Buffer&&o.Buffer.allocUnsafe,a=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},s.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},s.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):a(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),a(u,this.buf,this.pos),this.pos+=g,this},s._configure()},{12:12,15:15}]},{},[1])})()});var $Ee=uh((F0i,KEe)=>{"use strict";KEe.exports=j0t;var G1=1e20;function j0t(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,y;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");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*s),b=Array(o*s),x=Array(a),T=Array(a),E=Array(a+1),v=Array(a);for(m=0,y=o*s;m<y;m++){var S=c[m];A[m]=S===1?0:S===0?G1:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?G1:S===0?0:Math.pow(Math.max(0,S-.5),2)}YEe(A,o,s,x,T,v,E),YEe(b,o,s,x,T,v,E);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,y=o*s;m<y;m++)I[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return I}function YEe(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(XEe(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(XEe(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function XEe(e,t,n,i,r){n[0]=0,i[0]=-G1,i[1]=+G1;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+G1}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var nCe=uh((Q0i,s8)=>{function Z0t(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,E=2,v=3,S=4;function I(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function R(_,C){C===void 0&&(C=0);var w=_.charCodeAt(C);if(55296<=w&&w<=56319&&C<_.length-1){var D=w,N=_.charCodeAt(C+1);return 56320<=N&&N<=57343?(D-55296)*1024+(N-56320)+65536:D}if(56320<=w&&w<=57343&&C>=1){var D=_.charCodeAt(C-1),N=w;return 55296<=D&&D<=56319?(D-55296)*1024+(N-56320)+65536:N}return w}function O(_,C,w){var D=[_].concat(C).concat([w]),N=D[D.length-2],F=w,V=D.lastIndexOf(m);if(V>1&&D.slice(1,V).every(function(k){return k==i})&&[i,g,b].indexOf(_)==-1)return E;var B=D.lastIndexOf(r);if(B>0&&D.slice(1,B).every(function(k){return k==r})&&[p,r].indexOf(N)==-1)return D.filter(function(k){return k==r}).length%2==1?v:S;if(N==e&&F==t)return x;if(N==n||N==e||N==t)return F==m&&C.every(function(k){return k==i})?E:T;if(F==n||F==e||F==t)return T;if(N==s&&(F==s||F==a||F==u||F==f))return x;if((N==u||N==a)&&(F==a||F==c))return x;if((N==f||N==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(N==p)return x;var j=D.indexOf(i)!=-1?D.lastIndexOf(i)-1:D.length-2;return[g,b].indexOf(D[j])!=-1&&D.slice(j+1,-1).every(function(k){return k==i})&&F==m||N==y&&[A,b].indexOf(F)!=-1?x:C.indexOf(r)!=-1?E:N==r&&F==r?x:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var w=L(R(_,C)),D=[],N=C+1;N<_.length;N++)if(!I(_,N-1)){var F=L(R(_,N));if(O(w,D,F))return N;D.push(F)}return _.length},this.splitGraphemes=function(_){for(var C=[],w=0,D;(D=this.nextBreak(_,w))<_.length;)C.push(_.slice(w,D)),w=D;return w<_.length&&C.push(_.slice(w)),C},this.iterateGraphemes=function(_){var C=0,w={next:(function(){var D,N;return(N=this.nextBreak(_,C))<_.length?(D=_.slice(C,N),C=N,{value:D,done:!1}):C<_.length?(D=_.slice(C),C=_.length,{value:D,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var C=0,w=0,D;(D=this.nextBreak(_,w))<_.length;)w=D,C++;return w<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?A:128102<=_&&_<=128105?b:d}return this}typeof s8<"u"&&s8.exports&&(s8.exports=Z0t)});var Vte,uw,ke,lT,zu,Do,nIe,uT,iIe,rIe,dr,lc=Cs(()=>{Vte=new Date(2107,11,31,23,59,58),uw=new Date(1980,0,1),ke=void 0,lT=1/0,zu="undefined",Do="function",nIe="object",uT="string",iIe="number",rIe="boolean",dr=new Uint8Array});function dw(e){if(e&&typeof e!=Do)throw new Error(BIe);return e}function r6(e){if(e&&(typeof e.addEventListener!=Do||typeof e.aborted!=rIe))throw new Error(kIe);return e||ke}function o6(e,t){if(e&&typeof e!=uT||t&&!(t instanceof Uint8Array))throw new Error(Gte)}function Wte(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function hw(e,t,n){e!==ke&&Wte(e,t,n)}function fT(e){return typeof e==uT&&e.trim()?Number(e):e}var oIe,sIe,aIe,cIe,lIe,Yj,Xj,Kj,$j,uIe,fIe,dIe,hIe,mIe,pIe,gIe,_Ie,Jj,Zj,Qj,e6,yIe,AIe,bIe,xIe,TIe,EIe,CIe,vIe,SIe,jte,wIe,IIe,jR,fw,PIe,DIe,RIe,OIe,MIe,NIe,Hte,LIe,FIe,t6,n6,DA,i6,Wg,BIe,kIe,Gte,HR=Cs(()=>{lc();oIe="filenameEncoding",sIe="commentEncoding",aIe="decodeText",cIe="extractPrependedData",lIe="extractAppendedData",Yj="password",Xj="rawPassword",Kj="passThrough",$j="signal",uIe="checkPasswordOnly",fIe="checkOverlappingEntryOnly",dIe="checkOverlappingEntry",hIe="checkAmbiguity",mIe="checkLocalDirectory",pIe="checkSignature",gIe="checkCrc32",_Ie="checkAuthenticationCode",Jj="useWebWorkers",Zj="useCompressionStream",Qj="transferStreams",e6="preventClose",yIe="encryptionStrength",AIe="extendedTimestamp",bIe="ntfsTimestamp",xIe="keepOrder",TIe="level",EIe="bufferedWrite",CIe="createTempStream",vIe="dataDescriptorSignature",SIe="useUnicodeFileNames",jte="dataDescriptor",wIe="supportZip64SplitFile",IIe="encodeText",jR="offset",fw="usdz",PIe="unixExtraFieldType",DIe="localExtraField",RIe="centralExtraField",OIe="strictness",MIe="filenameValidation",NIe="normalizeFilename",Hte="maxAppendedDataSize",LIe="decryptCentralDirectory",FIe="signCentralDirectory",t6="filename",n6="comment",DA="strict",i6="balanced",Wg="tolerant",BIe="Invalid option (must be a function)",kIe="Invalid signal (must be an AbortSignal instance)",Gte="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function qg(){return qte}function GR(e){return Yte(e.chunkSize)}function Yte(e){return e=fT(e),Number.isInteger(e)&&e>=zIe?Math.max(e,dvt):UIe}function WR(e){Object.assign(qte,YIe(XIe(e)))}function YIe(e){let t={};for(let n of pvt){let i=e[n];i!==ke&&(t[n]=gvt(n,i))}return t}function gvt(e,t){if(WIe.includes(e)){if(t=fT(t),e==GIe&&(!Number.isInteger(t)||t<zIe))throw new Error(VIe)}else qIe.includes(e)&&dw(t);return t}function XIe(e){e=e||{};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===ke&&n===ke)return e;let i=Object.assign({},e);return i.CompressionStreamFallback===ke&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===ke&&(i.DecompressionStreamFallback=n),i}function mw(e){let t=YIe(XIe(e));Object.assign(HIe,t),Object.assign(qte,t)}var UIe,dvt,zIe,VIe,jIe,HIe,GIe,hvt,mvt,WIe,qIe,pvt,qte,Jp=Cs(()=>{lc();HR();UIe=64*1024,dvt=64,zIe=1,VIe="Invalid maxWorkers (must be an integer greater than 0)",jIe=2;try{typeof navigator!=zu&&navigator.hardwareConcurrency&&(jIe=navigator.hardwareConcurrency)}catch{}HIe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:UIe,maxWorkers:jIe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=zu&&CompressionStream,DecompressionStream:typeof DecompressionStream!=zu&&DecompressionStream},GIe="maxWorkers",hvt=["baseURI","wasmURI","workerURI"],mvt=["useCompressionStream","useWebWorkers","transferStreams"],WIe=["chunkSize",GIe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],qIe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],pvt=[...hvt,...mvt,...WIe,...qIe],qte={...HIe}});function qd(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function s6(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function li(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var dT=Cs(()=>{});var qR,KIe,_vt,yvt,Avt,bvt,xvt,Tvt,Evt,fm,YR=Cs(()=>{qR=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;qR[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=qR[t-1][e];qR[t][e]=n>>>8^qR[0][n&255]}[KIe,_vt,yvt,Avt,bvt,xvt,Tvt,Evt]=qR,fm=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;r<=s;r+=8){let a=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=Evt[a&255]^Tvt[a>>>8&255]^xvt[a>>>16&255]^bvt[a>>>24&255]^Avt[c&255]^yvt[c>>>8&255]^_vt[c>>>16&255]^KIe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^KIe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var XR,$Ie=Cs(()=>{YR();XR=class extends TransformStream{constructor(){let t,n=new fm;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function pw(e){if(typeof TextEncoder==zu){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 Xte=Cs(()=>{lc()});var Xl,KR,JIe,Kte,$te,RA,ZIe=Cs(()=>{Xl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Xl.getPartial(n);return i===32?e.concat(t):Xl._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+Xl.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]=Xl.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 r=e.length?e[e.length-1]:0,o=Xl.getPartial(r);return i.push(Xl.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},KR={bytes:{fromBits(e){let n=Xl.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=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(Xl.partial(8*(n&3),i)),t}}},JIe={};JIe.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=KR.utf8String.toBits(e));let n=t._buffer=Xl.concat(t._buffer,e),i=t._length,r=t._length=i+Xl.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.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=Xl.concat(t,[Xl.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 u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};Kte={};Kte.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],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,A,b,x;for(let T=0;T<i;T++)A=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};$te={};$te.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 r=Xl.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return Xl.clamp(t,r)}};RA={importKey(e){return new RA.hmacSha1(KR.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=Xl;for(t=KR.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};RA.hmacSha1=class{constructor(e){let t=this,n=t._hash=JIe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^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)}}});function a6(e){if(Cvt)return crypto.getRandomValues(e);throw new Error(gw)}var Cvt,Zp,OA,MA,Yg,gw,c6=Cs(()=>{lc();Cvt=typeof crypto!=zu&&typeof crypto.getRandomValues==Do,Zp="Invalid password",OA="Invalid signature",MA=OA,Yg="zipjs-abort-check-password",gw="Crypto API not supported"});function iPe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:kvt(t,n),strength:i-1,pendingInput:dr})}function rPe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=qd(c,t));let u=t.length-r;n=Uvt(n,i+(u-u%_w));let f;for(f=0;f<=u-_w;f+=_w){let d=QR(Qp,Yd(t,f,f+_w));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(ZR(Qp,p),f+i)}return e.pendingInput=Yd(t,f),n}async function Nvt(e,t,n,i){let r=await oPe(e,t,n,Yd(i,0,JR[t])),o=Yd(i,JR[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(Zp)}async function Lvt(e,t,n){let i=a6(new Uint8Array(JR[t])),r=await oPe(e,t,n,i);return qd(i,r)}async function oPe(e,t,n,i){e.password=null;let r=await Fvt(vvt,n,Ivt,!1,Pvt),o=await Bvt(Object.assign({salt:i},Jte),r,8*($R[t]*2+2)),s=new Uint8Array(o),a=QR(Qp,Yd(s,0,$R[t])),c=QR(Qp,Yd(s,$R[t],$R[t]*2)),u=Yd(s,$R[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Ovt(new Rvt(a),Array.from(Dvt)),hmac:new Mvt(c)}),u}async function Fvt(e,t,n,i,r){if(QIe)try{return await eO.importKey(e,t,n,i,r)}catch{return QIe=!1,RA.importKey(t)}else return RA.importKey(t)}async function Bvt(e,t,n){if(ePe)try{return await eO.deriveBits(e,t,n)}catch{return ePe=!1,RA.pbkdf2(t,e.salt,Jte.iterations,n)}else return RA.pbkdf2(t,e.salt,Jte.iterations,n)}function kvt(e,t){return t===ke?pw(e):t}function Uvt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Yd(e,t,n){return e.subarray(t,n)}function ZR(e,t){return e.fromBits(t)}function QR(e,t){return e.toBits(t)}var _w,vvt,tPe,Svt,wvt,Ivt,Jte,Pvt,JR,$R,Xg,Dvt,f6,eO,nPe,Qp,Rvt,Ovt,Mvt,QIe,ePe,l6,u6,sPe=Cs(()=>{lc();Xte();dT();ZIe();c6();_w=16,vvt="raw",tPe={name:"PBKDF2"},Svt={name:"HMAC"},wvt="SHA-1",Ivt=Object.assign({hash:Svt},tPe),Jte=Object.assign({iterations:1e3,hash:{name:wvt}},tPe),Pvt=["deriveBits"],JR=[8,12,16],$R=[16,24,32],Xg=10,Dvt=[0,0,0,0],f6=typeof crypto!=zu,eO=f6&&crypto.subtle,nPe=f6&&typeof eO!=zu,Qp=KR.bytes,Rvt=Kte.aes,Ovt=$te.ctrGladman,Mvt=RA.hmacSha1,QIe=f6&&nPe&&typeof eO.importKey==Do,ePe=f6&&nPe&&typeof eO.deriveBits==Do,l6=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){iPe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await Nvt(c,f,u,Yd(s,0,JR[f]+2)),s=Yd(s,JR[f]+2),r?a.error(new Error(Yg)):d()):await p;let g=new Uint8Array(s.length-Xg-(s.length-Xg)%_w);a.enqueue(rPe(c,s,g,0,Xg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=Yd(u,0,u.length-Xg),p=Yd(u,u.length-Xg),g=dr;if(d.length){let A=QR(Qp,d);c.update(A);let b=a.update(A);g=ZR(Qp,b)}let m=Yd(ZR(Qp,c.digest()),0,Xg),y=u.length<Xg?1:0;for(let A=0;A<Xg;A++)y|=m[A]^p[A];if(y&&o)throw new Error(MA);s.enqueue(g)}}})}},u6=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){iPe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=dr;a?(d=await Lvt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%_w);p.set(d,0),o.enqueue(rPe(s,r,p,d.length,0))},async flush(r){let{ctr:o,hmac:s,pendingInput:a,ready:c}=this;if(s&&o){await c;let u=dr;if(a.length){let d=o.update(QR(Qp,a));s.update(d),u=ZR(Qp,d)}let f=ZR(Qp,s.digest()).slice(0,Xg);r.enqueue(qd(u,f))}}})}}});function uPe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),zvt(e,t,n)}function aPe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=fPe(e)^t[i],m6(e,n[i]);return n}function cPe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=fPe(e)^t[i],m6(e,t[i]);return n}function zvt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new fm(i[0]),crcKey2:new fm(i[2])}),n)for(let r=0;r<n.length;r++)m6(e,n[r]);else for(let r=0;r<t.length;r++)m6(e,t.charCodeAt(r))}function m6(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=lPe(Math.imul(lPe(n+dPe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function fPe(e){let t=e.keys[2]|2;return dPe(Math.imul(t,t^1)>>>8)}function dPe(e){return e&255}function lPe(e){return e&4294967295}var yw,d6,h6,hPe=Cs(()=>{YR();c6();yw=12,d6=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){uPe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=aPe(a,o.subarray(0,yw));if(a.password=a.rawPassword=null,(c[yw-1]^a.passwordVerification)!=0)throw new Error(Zp);o=o.subarray(yw)}r?s.error(new Error(Yg)):s.enqueue(aPe(a,o))}})}},h6=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){uPe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=a6(new Uint8Array(yw));u[yw-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(cPe(s,u),0),c=yw}else a=new Uint8Array(r.length),c=0;a.set(cPe(s,r),c),o.enqueue(a)}})}}});function dm(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:r}=await t.read();r?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function e0(e,t){e=dm(e);let n=t?{type:t}:{};if(Vvt())return new Response(e).blob().then(r=>t?new Blob([r],n):r);let i=[];return e.pipeTo(new WritableStream({write(r){i.push(r)}})).then(()=>new Blob(i,n))}function Vvt(){return typeof Blob.prototype.stream!=Do||new Blob([]).stream()instanceof ReadableStream}function mPe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var Aw=Cs(()=>{lc()});function p6(e){return jvt.get(e)}function g6(e){return Zte.get(e)}function Hvt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Do&&typeof i!=Do)throw new Error(pPe);Zte.set(e,{CompressionStream:n,DecompressionStream:i})}async function gPe(e,t){!Zte.has(e)&&t&&Hvt(e,await import(t))}var pPe,jvt,Zte,mT=Cs(()=>{lc();pPe="Invalid codec module",jvt=new Map,Zte=new Map});function Yvt(e,t,n){let i=new fm,r=0,o=!1,s,a,c,u=new Promise((m,y)=>{a=m,c=y});u.catch(()=>{}),n||a();let f=new TransformStream({start(m){let y=new Uint8Array(APe);y.set(Wvt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(Qte),A=li(y);A.setUint32(0,i.get(),!0),A.setUint32(4,n,!0),m.enqueue(y)},cancel(m){c(m)}}),d=new TransformStream({transform(m,y){i.append(m),r+=m.length,r>=n?a():o&&p(),y.enqueue(m)},cancel(m){c(m)}});return e=hm(e,f),e=xw(e,t),hm(e,d);function p(){g(),s=setTimeout(()=>c(new Error(NA)),qvt)}function g(){clearTimeout(s)}}function tne(e,t){if(!e)return!1;let n=_Pe.get(e);n||(n=new Map,_Pe.set(e,n));let i=n.get(t);if(i===ke){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function b6(e){return tne(e,ene)}function nne(e){return tne(e,nO)}function bPe(e,t,n){t=hm(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function xPe(e,t,n){if(!e)throw new Error(Gvt);return new e(t,n)}function TPe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?yPe:ene,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return xw(e,a)}function hm(e,t){return dm(e).pipeThrough(t)}function xw(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await Xvt(n,o),await Kvt(i,o)}}}async function Xvt(e,t){try{await e.abort(t)}catch{}}async function Kvt(e,t){try{await e.cancel(t)}catch{}}function $vt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(Tw);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var NA,Tw,Ew,Gvt,ene,yPe,nO,APe,Qte,Wvt,qvt,_6,y6,A6,_Pe,ine=Cs(()=>{YR();$Ie();sPe();hPe();c6();lc();dT();Aw();mT();NA="Invalid uncompressed size",Tw="Invalid compressed data",Ew=OA,Gvt="Compression method not supported",ene="deflate-raw",yPe="deflate64-raw",nO="gzip",APe=10,Qte=8,Wvt=[31,139,8],qvt=5e3,_6=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:r}){super({});let{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:u,level:f,deflate64:d,format:p,compressionMethod:g,inputSize:m}=t,y=this,A,b,x,T=super.readable,E=p&&g6(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new XR,T=hm(T,A)),o)if(E)T=xw(T,xPe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new y6,T=xw(T,new r(nO)),T=hm(T,x);else try{T=TPe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(nO)}catch{throw S}T=xw(T,I),T=hm(T,new y6)}s&&(c?T=hm(T,new h6(t)):(b=new u6(t),T=hm(T,b))),bPe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},y6=class extends TransformStream{constructor(){let t,n=APe,i=new Uint8Array(0);super({transform(r,o){if(n){let u=Math.min(n,r.length);if(n-=u,r=r.subarray(u),!r.length)return}let s=i.length+r.length;if(s<=Qte){i=qd(i,r);return}let a=s-Qte,c=Math.min(a,i.length);o.enqueue(qd(i.subarray(0,c),r.subarray(0,a-c))),i=qd(i.subarray(c),r.subarray(a-c))},flush(){let r=li(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};A6=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:s,checkCrc32:a,crc32:c,compressed:u,useCompressionStream:f,deflate64:d,format:p,compressionMethod:g,rawBitFlag:m,outputSize:y}=t,A,b,x=super.readable;if(s&&(o?x=hm(x,new d6(t)):(b=new l6(t),x=hm(x,b))),u){let T=p&&g6(p);if(T)x=xw(x,xPe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=TPe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===ke)throw E;let v;try{v=new r(nO)}catch{throw E}x=Yvt(x,v,y)}x=$vt(x)}a&&(A=new XR,x=hm(x,A)),bPe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(Ew)}})}},_Pe=new Map});var Jvt,EPe,CPe,vPe,rne,SPe,wPe,Cw,T6,x6,iO,E6=Cs(()=>{lc();ine();Jvt=64*1024,EPe="message",CPe="start",vPe="pull",rne="data",SPe="ack",wPe="close",Cw="deflate",T6="inflate",x6=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(Cw)?o=_6:r.startsWith(T6)&&(o=A6),i.outputSize=0;let s=0,a=new o(t,n),c=super.readable,u=new TransformStream({transform(d,p){d&&d.length&&(s+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:s})}}),f=new TransformStream({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==ke&&i.outputSize>t.outputSize))throw new Error(NA)},flush(){let{crc32:d}=a;Object.assign(i,{crc32:d,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},iO=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=Jvt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(r())},flush(s){i&&s.enqueue(o(n,i))}});function r(){let s=new Uint8Array(t),a=0;for(;a<t;){let c=n[0],u=t-a;c.length<=u?(s.set(c,a),a+=c.length,n.shift()):(s.set(c.subarray(0,u),a),n[0]=c.subarray(u),a+=u)}return i-=t,s}function o(s,a){let c=new Uint8Array(a),u=0;for(let f of s)c.set(f,u),u+=f.length;return c}}}});function PPe({initModule:e}){v6=e}function DPe(e){sne=e}async function RPe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||b6(t)||nne(t))return!0;if(n)try{return await v6(e),!0}catch{return!1}return!1}function cne(e){e.createWorker?IPe=!0:C6=!1}async function one(e,...t){try{await e(...t)}catch{}}function lne(e,t){return{run:()=>S6(e,t)}}async function S6({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(Cw),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!b6(d))try{await v6(r)}catch{}}else try{await v6(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new x6(e,r),await t.pipeThrough(o).pipeThrough(new iO(GR(r))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=o;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw o&&(s.outputSize=o.outputSize),s}finally{i()}}var gT,C6,IPe,sne,v6,pT,ane,rO=Cs(()=>{lc();Jp();E6();gT="Worker startup timeout",v6=()=>{};pT=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:f},d){let{signal:p}=s;return IPe&&(f=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new iO(GR(o))).pipeThrough(new ane(s),{signal:p}),writable:i,options:Object.assign({},r),workerURI:u,createWorker:f,transferStreams:c,terminate(){return new Promise(g=>{let{worker:m,busy:y}=t;m?(y?t.resolveTerminated=g:(m.terminate(),g()),t.interface=null):g()})},onTaskFinished(){if(t.busy){let{resolveTerminated:g}=t;g&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),g()),t.busy=!1,d(t)}}}),C6===ke&&(C6=typeof Worker!=zu),(a&&sne&&(C6&&u||f)?sne:lne)(t,o)}},ane=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await one(t,i)},async transform(s,a){o+=s.length,n&&await one(n,o,i),a.enqueue(s)},async flush(){r&&await one(r,o)}})}}});async function D6(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:u,encrypted:f,format:d,codecURI:p}=n,{workerURI:g,createWorker:m,maxWorkers:y}=i;d&&(p&&(n.codecURI=rSt(p,i.baseURI)),await gPe(d,n.codecURI)),t.transferStreams=!d&&(r||r===ke&&i.transferStreams);let A=!a&&!c&&!u&&!f,b=d===ke||!!n.codecURI;return t.useWebWorkers=!A&&b&&(o||o===ke&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&g?g:ke,t.createWorker=t.useWebWorkers&&m?m:ke,n.useCompressionStream=s||s===ke&&i.useCompressionStream,(await x()).run();async function x(){let E=_T.find(v=>!v.busy);if(E)return UPe(E),new pT(E,e,t,T);if(_T.length<y){let v={indexWorker:kPe};return kPe++,_T.push(v),new pT(v,e,t,T)}else return new Promise(v=>{vw.push({resolve:v,stream:e,workerOptions:t}),I6=i.workerStarvationTimeout,P6()})}function T(E){if(zPe(),vw.length){let[{resolve:v,stream:S,workerOptions:I}]=vw.splice(0,1);v(new pT(E,S,I,T)),P6()}else E.worker?(UPe(E),aSt(E,t)):_T=_T.filter(v=>v!=E)}}function rSt(e,t){try{return new URL(e,t).toString()}catch{return e}}function P6(){!Sw&&vw.length&&Number.isFinite(I6)&&I6>=0&&(Sw=setTimeout(oSt,I6))}function zPe(){Sw&&(clearTimeout(Sw),Sw=null)}function oSt(){if(Sw=null,vw.length){let[{resolve:e,stream:t,workerOptions:n}]=vw.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new pT({},t,i,sSt)),P6()}}function sSt(){zPe(),P6()}function aSt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{_T=_T.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function UPe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var _T,vw,Sw,I6,kPe,R6=Cs(()=>{lc();E6();mT();rO();_T=[],vw=[],kPe=0});function jPe(e){if(cSt){let t="";for(let n=0;n<e.length;n++)t+=VPe[e[n]];return t}else return new TextDecoder().decode(e)}var VPe,cSt,HPe=Cs(()=>{VPe="\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\xA0".split(""),cSt=VPe.length==256});function oO(e,t){return WPe(e,t,!0)}function GPe(e,t){return WPe(e,t,!1)}function WPe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?jPe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var pne=Cs(()=>{HPe()});function uSt(){KPe=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();gne=n==1}catch{gne=!1}})()}function L6(e){return!!(e&&e.getData)}async function Ic(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function fSt(e){return e=new Kg(e),await Ic(e),(e.size===ke||!e.readUint8Array)&&(e=new Vu(await e0(e.readable)),await Ic(e)),e}function Ro(e,t,n){return e.readUint8Array(t,n)}function yne(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?Iw.prototype.createReadable.call(e,t):e.readable}var YPe,XPe,lSt,WVi,qVi,_ne,qPe,ww,Iw,O6,sO,gne,KPe,Vu,Pw,aO,cO,M6,N6,Kg,Dw,F6=Cs(()=>{lc();Jp();dT();Aw();pne();YPe="Writer iterator completed too soon",XPe="Writer not initialized",lSt="text/plain",WVi=256*1024,qVi=16*1024*1024,_ne="writable",qPe=Symbol(),ww=class{constructor(){this.size=0}init(){this.initialized=!0}},Iw=class extends ww{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=GR(qg())}={}){let r=this,o=0;return i=Yte(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-o),c=await Ro(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},O6=class extends ww{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(XPe);return t.writeUint8Array(s6(i))}});Object.defineProperty(t,_ne,{get(){return n}})}writeUint8Array(){}},sO=class extends O6{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,r=n.pendingCharacters,o=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pendingCharacters+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pendingCharacters=r+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};Vu=class extends Iw{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),KPe||uSt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?dm(i.stream()):gne?dm(i.slice(o,o+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,r=t+n,a=await(!t&&r>=i.size?i.sourceBlob:i.sourceBlob.slice(t,r)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},Pw=class extends ww{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,_ne,{get(){return i.writable}}),n.contentType=t,n.blobPromise=e0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},aO=class extends Vu{constructor(t){super(new Blob([t],{type:lSt}))}},cO=class extends Pw{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():GPe(new Uint8Array(await i.arrayBuffer()),t)}},M6=class extends Iw{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(fSt));t.diskOffsets=n.map(i=>{let r=t.size;return t.size+=i.size,r}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,r=n[t];return r===ke?i:r}async readUint8Array(t,n){let i=this,{readers:r}=this,o,s=0,a=t;for(;r[s]&&a>=r[s].size;)a-=r[s].size,s++;let c=r[s];if(c){let u=c.size;if(a+n<=u)o=await Ro(c,a,n);else{let f=u-a,d=await Ro(c,a,f),p=await i.readUint8Array(t+f,n-f);o=qd(d,p)}}else o=dr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},N6=class extends ww{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,s,a=new WritableStream({async write(d){if(d===qPe){s&&await u();return}let{availableSize:p}=i;if(s)d.length>=p?(await c(d.subarray(0,p)),await u(),d.length>p&&await this.write(d.subarray(p))):await c(d);else{let{value:g,done:m}=await t.next();if(m&&!g)throw new Error(YPe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Ic(r),o=g.writable,s=o.getWriter(),await this.write(d)}},async close(){s&&(await s.ready,await f())},async abort(d){s&&await s.abort(d)}});Object.defineProperty(i,_ne,{get(){return a}});async function c(d){let p=d.length;p&&(await s.ready,await s.write(d),r.size+=p,i.availableSize-=p)}async function u(){await f(),i.diskOffset+=r.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function f(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(qPe)}finally{t.releaseLock()}}},Kg=class{constructor(t){return Array.isArray(t)&&(t=new M6(t)),(t instanceof ReadableStream||typeof t.getReader==Do)&&(t={readable:dm(t)}),t}},Dw=class{constructor(t){return t.writable===ke&&typeof t.next==Do&&(t=new N6(t)),(t instanceof WritableStream||typeof t.getWriter==Do)&&(t={writable:mPe(t)}),t.size===ke&&(t.size=0),t}}});var Ane,bne,lO,xne,uO,Tne,Ene,Cne,Rw,Ow,fO,vne,dO,Sne,wne,Ine,B6,k6,Pne,Dne,Rne,U6,One,Mne,Nne,Lne,yT,Fne,dSt,Bne,z6,hSt,V6,mSt,pSt,gSt,_St,kne,Une,zne,Vne,ySt,ASt,bSt,xSt,TSt,ESt,CSt,vSt,SSt,wSt,ISt,PSt,DSt,RSt,OSt,MSt,LA,jne=Cs(()=>{Ane="filename",bne="rawFilename",lO="comment",xne="rawComment",uO="uncompressedSize",Tne="compressedSize",Ene="offset",Cne="diskNumberStart",Rw="lastModDate",Ow="rawLastModDate",fO="lastAccessDate",vne="rawLastAccessDate",dO="creationDate",Sne="rawCreationDate",wne="internalFileAttributes",Ine="externalFileAttributes",B6="internalFileAttribute",k6="externalFileAttribute",Pne="msdosAttributesRaw",Dne="msdosAttributes",Rne="msDosCompatible",U6="zip64",One="encrypted",Mne="version",Nne="versionMadeBy",Lne="zipCrypto",yT="directory",Fne="executable",dSt="symlink",Bne="compressionMethod",z6="signature",hSt="crc32",V6="extraField",mSt="extraFieldInfoZip",pSt="extraFieldUnix",gSt="extraFieldUnixType1",_St="extraFieldPkwareUnix",kne="unixMode",Une="setuid",zne="setgid",Vne="sticky",ySt="bitFlag",ASt="rawBitFlag",bSt="filenameLength",xSt="extraFieldLength",TSt="unixExternalUpper",ESt="filenameUTF8",CSt="commentUTF8",vSt="rawExtraField",SSt="extraFieldZip64",wSt="extraFieldUnicodePath",ISt="extraFieldUnicodeComment",PSt="extraFieldAES",DSt="extraFieldNTFS",RSt="extraFieldExtendedTimestamp",OSt="extraFieldUSDZ",MSt=[Ane,bne,uO,Tne,Rw,Ow,lO,xne,fO,vne,dO,Sne,Ene,Cne,wne,Ine,B6,k6,Pne,Dne,Rne,U6,One,Mne,Nne,Lne,yT,Fne,dSt,Bne,z6,hSt,V6,pSt,mSt,gSt,_St,"uid","gid",kne,TSt,Une,zne,Vne,ySt,ASt,bSt,xSt,ESt,CSt,vSt,SSt,wSt,ISt,PSt,DSt,RSt,OSt],LA=class{constructor(t){MSt.forEach(n=>this[n]=t[n])}}});var EDe={};xke(EDe,{ERR_AMBIGUOUS_ARCHIVE:()=>gie,ERR_BAD_FORMAT:()=>Mw,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>uie,ERR_ENCRYPTED:()=>hie,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>_ie,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>pie,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>lie,ERR_EOCDR_NOT_FOUND:()=>cie,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>die,ERR_INVALID_AUTHENTICATION_CODE:()=>MA,ERR_INVALID_COMPRESSED_DATA:()=>Tw,ERR_INVALID_CRC32:()=>Ew,ERR_INVALID_FILENAME_VALIDATION:()=>bie,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>xie,ERR_INVALID_PASSWORD:()=>Zp,ERR_INVALID_SIGNATURE:()=>OA,ERR_INVALID_STRICTNESS:()=>Aie,ERR_INVALID_UNCOMPRESSED_SIZE:()=>NA,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>fie,ERR_OVERLAPPING_ENTRY:()=>mie,ERR_SPLIT_ZIP_FILE:()=>q6,ERR_UNSAFE_FILENAME:()=>yie,ERR_UNSUPPORTED_COMPRESSION:()=>W6,ERR_UNSUPPORTED_ENCRYPTION:()=>G6,ERR_UNSUPPORTED_UINT64:()=>Tie,ERR_WORKER_STARTUP_TIMEOUT:()=>gT,WARNING_APPENDED_DATA:()=>X6,WARNING_COMPRESSED_PATCHED_DATA:()=>vie,WARNING_DUPLICATE_FILENAME:()=>Pie,WARNING_MALFORMED_EXTRA_FIELD:()=>aH,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Die,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Rie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Oie,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>Nw,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>wie,WARNING_PREPENDED_DATA:()=>K6,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Iie,WARNING_UNKNOWN_VERSION:()=>Cie,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Sie,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Eie,WARNING_WRAPPED_ENTRIES_COUNT:()=>Y6,ZipReader:()=>TT,ZipReaderStream:()=>J6,isZipFile:()=>mDe});async function mDe(e,t={}){if(e=new Kg(e),await Ic(e),(e.size===ke||!e.readUint8Array)&&(e=new Vu(await e0(e.readable)),await Ic(e)),e.size<22)return!1;let n=Nie(t,{}),i=n!=Wg,r=ADe(t[Hte],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await bDe(e,i,r);if(!o||n==DA&&s>1)return!1;let a=hr(li(o),20),c=o.offset+22+a;return e.size-c<=r}function Hne(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(Pi(e,n)==134630224)return!0;return!1}function rDe(e,t,n){let i=0;for(;n+46<=t.length&&Pi(e,n)==33639248;)n+=46+hr(e,n+28)+hr(e,n+30)+hr(e,n+32),i++;return i%65536?0:i}function Gne(e){if(e.length>=6){let t=li(e);if(Pi(t,0)==84233040){let n=hr(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function YSt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function XSt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=li(e),i=hr(n,26);Object.assign(t,{compressionMethod:hr(n,0),compressedSize:Of(n,2),uncompressedSize:Of(n,10),encryptionAlgorithm:hr(n,18),bitLength:hr(n,20),flags:hr(n,22),hashAlgorithm:hr(n,24),hashData:e.subarray(28,28+i)})}return t}function pDe(e,t,n){let i=e.rawBitFlag=hr(t,n+2),r=(i&1)==1,o=Pi(t,n+6);Object.assign(e,{encrypted:r,version:hr(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:lwt(o),filenameLength:hr(t,n+22),extraFieldLength:hr(t,n+24)})}function gDe(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=li(o),c=0,u=!1;try{for(;c<o.length;){let S=hr(a,c),I=hr(a,c+2);s.set(S,{type:S,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{u=!0}c>o.length&&(u=!0);let f=hr(n,i+4);Object.assign(t,{signature:Pi(n,i+10),crc32:Pi(n,i+10),compressedSize:Pi(n,i+14),uncompressedSize:Pi(n,i+18)});let d=s.get(1);d&&(KSt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(oDe(p,Ane,bne,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(oDe(g,lO,xne,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?($St(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(sDe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(sDe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(JSt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=aDe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(aDe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(ZSt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function KSt(e,t){t.zip64=!0;let n=li(e.data),i=HSt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+nDe[s].bytes,0);if(e.data.length<r)throw new Error(die);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=nDe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function oDe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=li(e.data),s=new fm;s.append(r[n]);let a=li(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Pi(o,1),u=BA(o,0);Object.assign(e,{version:u,[t]:oO(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Pi(a,0)}),e.valid&&(i[t]=e[t],i[t+jSt]=!0)}function $St(e,t,n){let i=li(e.data),r=BA(i,4);Object.assign(e,{vendorVersion:BA(i,0),vendorId:BA(i,2),strength:r,originalCompressionMethod:n,compressionMethod:hr(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=hDe&&(t.crc32=ke)}function JSt(e,t){let n=li(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=hr(n,i),s=hr(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}if(r&&r.length==24){let o=li(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=Wne(s),f=Wne(a),d=Wne(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function sDe(e,t){if(e.data.length<8)return;let n=li(e.data),i=new Date((Pi(n,0)|0)*1e3),r=new Date((Pi(n,4)|0)*1e3),o={lastAccessDate:i,lastModDate:r};e.data.length>=12&&(o.uid=hr(n,8),o.gid=hr(n,10)),Object.assign(e,o),Object.assign(t,o)}function aDe(e,t,n){try{let i=li(e.data),r,o;if(n){let s=0,a=BA(i,s++),c=BA(i,s++);r=cDe(e.data.subarray(s,s+c)),s+=c;let u=BA(i,s++);o=cDe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=hr(i,0),o=hr(i,2),Object.assign(e,{uid:r,gid:o}));return r!==ke&&(t.uid=r),o!==ke&&(t.gid=o),r!==ke||o!==ke}catch{}}function cDe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function ZSt(e,t,n){if(!e.data.length)return;let i=li(e.data),r=BA(i,0),o=[],s=[];n?((r&1)==1&&(o.push(Rw),s.push(Ow)),(r&2)==2&&(o.push(fO),s.push(vne)),(r&4)==4&&(o.push(dO),s.push(Sne))):e.data.length>=5&&(o.push(Rw),s.push(Ow));let a=1;o.forEach((c,u)=>{if(e.data.length>=a+4){let f=Pi(i,a);t[c]=e[c]=new Date((f|0)*1e3);let d=s[u];e[d]=f}a+=4})}async function QSt({reader:e,fileEntry:t,index:n,offset:i,crc32:r,compressedSize:o,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(c&&(u?d=20:d=12),d){let g=await Ro(e,a+o,d+4),m=li(g),y=g.length==d+4&&Pi(m,0)==134695760;if(y){let A=lDe(m,4,u);(t.encrypted&&!t.zipCrypto||A.crc32==r)&&A.compressedSize==o&&A.uncompressedSize==s?d+=4:y=!1}if(g.length>=d){let A=lDe(m,y?4:0,u);A.signature=y,t.localDirectory.dataDescriptor=A}}let p={start:i,end:a+o+d,fileEntry:t};for(let[g,m]of f)if(g!=n&&p.start<m.end&&m.start<p.end){let y=new Error(mie);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function lDe(e,t,n){let i=Pi(e,t),r,o;return n?(r=Of(e,t+4),o=Of(e,t+12)):(r=Pi(e,t+4),o=Pi(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function Lw(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function ewt(e){return await _De(e)==134695760}async function twt(e){let t=await _De(e);return t==134695760||t==808471376}async function _De(e){let t=await Ro(e,0,4);return Pi(li(t))}function yDe(e){return e===DA||e===i6||e===Wg}function nwt(e,t,n){return Math.min(e,n?t*qSt:t)}function Nie(e,t){return uDe(e,uDe(t,i6))}function uDe(e,t){let n=e[OIe];if(n!==ke){if(!yDe(n))throw new Error(Aie);return n}let i=e[hIe];return i===ke?t:i?DA:t==Wg?Wg:i6}function iwt(e,t){return e===ke?t!=Wg:!!e}function rwt(e,t){return e===ke?t==DA:!!e}function owt(e,t){if(e===ke)return t;if(!yDe(e))throw new Error(bie);return e}function swt(e,t){if(t==Wg)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||VSt.test(e)?!0:t==DA&&(n.includes(".")||n.includes(""))}function ADe(e,t){if(e!==ke){let n=fT(e);if(typeof n!=iIe||Number.isNaN(n)||n<0)throw new Error(xie);return n}return t==DA?0:t==Wg?1/0:65535}async function bDe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:WSt},s,a,c=0;for await(let[u,f,d,p,g]of xDe(e,r)){let m=hr(u,p+20);if(g+22+m==i){let y=await TDe(e,u,f,p,g,i,o);if(y==$6){if(s||(s=Yne(d,p,g)),c++,!t||c>1)break}else y==Mie&&!a&&(a=Yne(d,p,g))}}return s||(s=a),s||(s=await awt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function awt(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,s;for await(let[a,c,u,f,d]of xDe(e,r)){let p=Yne(u,f,d);o||(o=p);let g=await TDe(e,a,c,f,d,i,n);if(g==$6)return p;g==Mie&&!s&&(s=p)}return s||o}async function*xDe(e,t){let n=e.size-t,i=await Ro(e,n,t),r=li(i);for(let o=i.length-22;o>=0;o--)Pi(r,o)==101010256&&(yield[r,n,i,o,n+o])}function Yne(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function TDe(e,t,n,i,r,o,s){let a=hr(t,i+10),c=Pi(t,i+12),u=Pi(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await fDe(e,t,n,r-20,o,s)==117853008?$6:iDe;if(!a&&!c)return Mie;let f=hr(t,i+6);for(let d of[r-c,Lw(e,f)+u])if(await fDe(e,t,n,d,o,s)==33639248)return $6;return iDe}async function fDe(e,t,n,i,r,o){if(i<0||i+4>r)return ke;if(i>=n)return Pi(t,i-n);if(o.count>0){o.count--;let s=await Ro(e,i,4);return Pi(li(s),0)}return ke}function cwt(e,t,n,i,r){let{rawFilename:o}=e,s=!r,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=o.length||n.some((c,u)=>c!=o[u]))&&i0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&tDe)!=(e.rawBitFlag&tDe)&&i0(s,r,Die),t.compressionMethod!=e.compressionMethod&&i0(s,r,Rie),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&i0(s,r,Oie)}function i0(e,t,n){e?j6(n):Xd(t,n)}function Xd(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function j6(e){let t=new Error(gie);throw t.reason=e,t}function As(e,t,n){return t[n]===ke?e.options[n]:t[n]}function dDe(e,t,n){return dw(As(e,t,n))}function lwt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return i<uw?uw:i}function Wne(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function BA(e,t){return e.getUint8(t)}function hr(e,t){return e.getUint16(t,!0)}function Pi(e,t){return e.getUint32(t,!0)}function Of(e,t){let n=e.getBigUint64(t,!0);if(n>GSt)throw new Error(Tie);return Number(n)}var Mw,cie,lie,uie,fie,die,hie,G6,W6,q6,mie,pie,gie,_ie,yie,Aie,bie,xie,Tie,Eie,Cie,vie,aH,Sie,Y6,X6,K6,wie,Iie,Pie,Nw,Die,Rie,Oie,zSt,VSt,QPe,jSt,eDe,tDe,hDe,HSt,nDe,GSt,WSt,qSt,iDe,Mie,$6,TT,J6,qne,Lie=Cs(()=>{lc();Jp();mT();R6();F6();pne();dT();Aw();YR();jne();HR();Mw="File format is not recognized",cie="End of central directory not found",lie="End of Zip64 central directory locator not found",uie="Central directory header not found",fie="Local file header not found",die="Zip64 extra field not found",hie="File contains encrypted entry",G6="Encryption method not supported",W6="Compression method not supported",q6="Split zip file",mie="Overlapping entry found",pie="Entry data out of bounds",gie="Ambiguous archive",_ie="Encrypted central directory is not supported",yie="Unsafe filename",Aie="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",bie="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",xie="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Tie="64-bit value exceeds Number.MAX_SAFE_INTEGER",Eie="unsorted central directory",Cie="unknown version needed to extract",vie="compressed patched data",aH="malformed extra field",Sie="unknown zip64 extensible data",Y6="wrapped entries count",X6="appended data",K6="prepended data",wie="prepended central directory",Iie="trailing central directory data",Pie="duplicate filename",Nw="mismatched zip64 end of central directory record",Die="mismatched local file header (general purpose bit flag)",Rie="mismatched local file header (compression method)",Oie="mismatched local file header (crc32 or sizes)",zSt=63,VSt=/^[a-zA-Z]:/,QPe="utf-8",jSt="UTF8",eDe="cp437",tDe=2057,hDe=1,HSt=[[uO,4294967295],[Tne,4294967295],[Ene,4294967295],[Cne,65535]],nDe={65535:{getValue:Pi,bytes:4},4294967295:{getValue:Of,bytes:8}},GSt=BigInt(Number.MAX_SAFE_INTEGER),WSt=64,qSt=1032,iDe=0,Mie=1,$6=2,TT=class{constructor(t,n={}){Object.assign(this,{reader:new Kg(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Ic(i),(i.size===ke||!i.readUint8Array)&&(i=new Vu(await e0(i.readable)),await Ic(i)),i.size<22)throw new Error(Mw);let r=n.warnings=[],o=Nie(t,n.options),s=o==DA,a=o!=Wg,c=ADe(As(n,t,Hte),o),u=owt(As(n,t,MIe),o),f=As(n,t,NIe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await bDe(i,a,c);if(!d)throw await ewt(i)?new Error(q6):new Error(cie);a&&p>1&&j6("multiple end of central directory records");let g=li(d),m=Pi(g,12),y=Pi(g,16),A=d.offset,b=hr(g,20),x=A+22+b,T=i.size-x;T>c&&j6(X6),T>0&&Xd(r,X6);let E=hr(g,4),v=i.lastDiskNumber||0,S=hr(g,6),I=hr(g,10),R=0,O,L,_,C,w=56,D,N=y==4294967295||m==4294967295||I==65535||S==65535;if(y!=4294967295&&S!=65535&&(y+=Lw(i,S)),N){let He=d.offset>=20?await Ro(i,d.offset-20,20):dr,Ye=li(He);if(He.length==20&&Pi(Ye,0)==117853008){y=Lw(i,Pi(Ye,4))+Of(Ye,8);let Ke=await Ro(i,y,56),Pe=li(Ke),qe=d.offset-20-56;if((Ke.length<56||Pi(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),Ke=await Ro(i,y,56),Pe=li(Ke)}if(Ke.length<56||Pi(Pe,0)!=101075792)throw new Error(lie);if(_=!0,C=Of(Pe,4)>44,C){let st=Math.min(Of(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Ro(i,y+56,st);D=XSt(vt)}}E==65535?E=Pi(Pe,16):E!=Pi(Pe,16)&&i0(s,r,Nw),S==65535?S=Pi(Pe,20):S!=Pi(Pe,20)&&i0(s,r,Nw),I==65535?I=Of(Pe,32):I!=Of(Pe,32)&&i0(s,r,Nw),m==4294967295?m=Of(Pe,40):m!=Of(Pe,40)&&i0(s,r,Nw),y=Lw(i,S)+Of(Pe,48)+R}}let F=m,V=d.offset-(_?w+20:0);if(y>=i.size&&(R=i.size-y-m-22,y=i.size-m-22),v!=E)throw new Error(q6);if(y<0)throw new Error(Mw);let B=0,j=await Ro(i,y,m),k=li(j);if(m){if(j.length<4)throw new Error(Mw);let He=V-m;if(y!=He&&S==E){let Ye=Pi(k,B)==33639248||!!(D&&D.compressedSize)||Hne(k),Ke=!Ye;if(!Ke&&He>=0&&He+4<=i.size){let Pe=await Ro(i,He,4);Ke=Pi(li(Pe),0)==33639248}if(Ke){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Ye),j=await Ro(i,y,m),k=li(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Ro(i,y,m),k=li(j)),y<0||y>=i.size)throw new Error(Mw);n.directoryOffset=y,n.directoryLength=F;let q=dDe(n,t,LIe),Q,W;if(q&&I&&j.length>=4&&Pi(k,0)!=33639248&&(C||Hne(k))){let He=YSt(D,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),D),k=li(j),F=j.length,Q=!0}D&&!Q&&(j.length<4||Pi(k,0)==33639248)&&Xd(r,Sie),L=y;let J=As(n,t,oIe),Z=As(n,t,sIe),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=rDe(k,j,B),I&&Xd(r,Y6));for(let He=0;He<I;He++){let Ye=new qne(i,n.options);if(B+46>j.length||Pi(k,B)!=33639248)throw He==0&&!Q&&(C||Hne(k))?new Error(_ie):new Error(uie);pDe(Ye,k,B+6);let Ke=!!Ye.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Ye.filenameLength,st=qe+Ye.extraFieldLength,vt=hr(k,B+4),jt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=hr(k,B+32),Yt=st+ft,rt=j.subarray(st,Yt),ht=Ke,Li=Ke,Yn=Pi(k,B+38),gi=Yn&255,zi={readOnly:!!(gi&1),hidden:!!(gi&2),system:!!(gi&4),directory:!!(gi&16),archive:!!(gi&32)},Si=Pi(k,B+42),ui=dDe(n,t,aIe)||oO,_i=ht?QPe:J||eDe,zn=Li?QPe:Z||eDe,tn=ui(mt,_i,t6);if(tn===ke&&(tn=oO(mt,_i)),f){let Fi=f(tn);Fi!==ke&&(tn=Fi)}if(swt(tn,u)){let Fi=new Error(yie);throw Fi.filename=tn,Fi}let Hn=ui(rt,zn,n6);Hn===ke&&(Hn=oO(rt,zn)),Object.assign(Ye,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:jt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:Si,diskNumberStart:hr(k,B+34),internalFileAttributes:hr(k,B+36),externalFileAttributes:Yn,msdosAttributesRaw:gi,msdosAttributes:zi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Li,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:tn,comment:Hn}),gDe(Ye,Ye,k,B+6)&&Xd(r,aH,tn),Ye.offset+=R;let Ki=Lw(i,Ye.diskNumberStart)+Ye.offset;L=Math.min(Ki,L),Ki<fe&&Xd(r,Eie,tn),fe=Ki,(Ye.version&255)>zSt&&Xd(r,Cie,tn),(Ye.rawBitFlag&32)==32&&Xd(r,vie,tn),ae.has(Ye.filename)&&(Ae=!0),ae.add(Ye.filename);let wr=Ye.externalFileAttributes>>16&65535;Ye.unixMode===ke&&(wr&16877)!=0&&(Ye.unixMode=wr);let so=!!(Ye.unixMode&2048),Ts=!!(Ye.unixMode&1024),zs=!!(Ye.unixMode&512),hi=((Ye.unixMode===ke?wr:Ye.unixMode)&61440)==40960,ao=!hi&&(Ye.unixMode!==ke?(Ye.unixMode&73)!=0:lt&&(wr&73)!=0),nr=Ye.unixMode!==ke&&(Ye.unixMode&61440)==16384,jo=(wr&61440)==16384;Object.assign(Ye,{setuid:so,setgid:Ts,sticky:zs,symlink:hi,unixExternalUpper:wr,internalFileAttribute:Ye.internalFileAttributes,externalFileAttribute:Ye.externalFileAttributes,executable:ao,directory:nr||jo||jt&&zi.directory||Ye.filename.endsWith("/"),zipCrypto:Ye.encrypted&&!Ye.extraFieldAES});let Fn=new LA(Ye);if(Fn.getData=(Fi,Ir)=>Ye.getData(Fi,Fn,n.readRanges,Ir),Fn.arrayBuffer=async Fi=>{let Ir=new TransformStream,Mc=e0(Ir.readable).then(qf=>qf.arrayBuffer());return Mc.catch(()=>{}),await Ye.getData(Ir,Fn,n.readRanges,Fi),Mc},B=Yt,He==I-1&&xe){let Fi=rDe(k,j,B);Fi&&(I+=Fi,Xd(r,Y6))}let{onprogress:Vi}=t;if(Vi)try{await Vi(He+1,I,new LA(Ye))}catch{}yield Fn}let ge=B,we=Gne(j.subarray(B))||(Q?Gne(W):ke);if(!we&&!Q){let He=y+B,Ye=Math.min(V-He,65541);Ye>=6&&(we=Gne(await Ro(i,He,Ye)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&i0(s,r,Iie),Ae&&i0(s,r,Pie);let ve=As(n,t,cIe),Re=As(n,t,lIe),Qe=(s||ve)&&I&&L==4&&await twt(i)?4:0;return s&&(R||I&&L>Qe)&&j6(K6),(R||I&&L>4)&&Xd(r,K6),O&&Xd(r,wie),ve&&(n.prependedData=L>Qe?await Ro(i,Qe,L-Qe):dr),n.comment=b?await Ro(i,A+22,b):dr,Re&&(n.appendedData=x<i.size?await Ro(i,x,i.size-x):dr),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){let{reader:t}=this;!t.readUint8Array&&t.readable&&!t.readable.locked&&await t.readable.cancel()}},J6=class{constructor(t={}){let{readable:n,writable:i}=new TransformStream,r=new TT(n,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(o){let{done:s,value:a}=await r.next();if(s)return o.close();let c={...a,readable:(function(){let{readable:u,writable:f}=new TransformStream;if(a.getData)return d(),u;async function d(){try{await a.getData(f)}catch(p){try{await f.abort(p)}catch{}}}})()};delete c.getData,o.enqueue(c)}}),this.writable=i}};qne=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=qg(),{reader:a,index:c,offset:u,diskNumberStart:f,extraFieldAES:d,extraFieldZip64:p,compressionMethod:g,bitFlag:m,rawBitFlag:y,crc32:A,rawLastModDate:b,uncompressedSize:x,compressedSize:T}=o,{dataDescriptor:E}=m,v=n.localDirectory={},S=n.warnings=[],I=Lw(a,f)+u,R=await Ro(a,I,30),O=li(R),L=As(o,r,Yj),_=As(o,r,Xj),C=As(o,r,Kj);if(o6(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(W6);if(R.length<30||Pi(O,0)!=67324752)throw new Error(fie);pDe(v,O,4);let{extraFieldLength:w,filenameLength:D}=v,N=v.dataOffset=I+30+D+w,F=As(o,r,mIe),V=Nie(r,o.options),B=iwt(F,V),j=rwt(F,V),k=dr;if(j&&(D||w)){let ft=await Ro(a,I+30,D+w);k=ft.subarray(0,D),v.rawExtraField=ft.subarray(D)}else v.rawExtraField=w?await Ro(a,I+30+D,w):dr;j&&(v.rawFilename=k),gDe(o,v,O,4,!0)&&Xd(S,aH),cwt(o,v,k,j,B?ke:S);let{lastAccessDate:G,creationDate:q,uid:Q,gid:W}=v;G&&(n.lastAccessDate=G),q&&(n.creationDate=q),Q!==ke&&n.uid===ke&&(n.uid=Q),W!==ke&&n.gid===ke&&(n.gid=W);let J=o.encrypted&&v.encrypted&&!C,Z=J&&!d;if(C||(n.zipCrypto=Z),J&&(v.rawBitFlag&64)==64)throw new Error(G6);let ae=C?ke:p6(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(W6);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(G6);if(!L&&!_)throw new Error(hie)}if(N+T>a.size)throw new Error(pie);let Ae=T,fe=dm(a.createReadable({offset:N,size:Ae})),xe=r6(As(o,r,$j)),ge=As(o,r,uIe),we=As(o,r,dIe),ve=As(o,r,fIe);ve&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Ye=g!=0&&!C,Ke=C?T:x,Pe=g==9,qe=As(o,r,Zj);Pe&&(qe=!1);let st=As(o,r,gIe),vt=(st===ke?As(o,r,pIe):st)&&!C&&(!J||Z||d&&d.vendorVersion==hDe),jt={options:{codecType:T6,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:As(o,r,_Ie),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:Ke,crc32:A,compressed:Ye,encrypted:J,useWebWorkers:As(o,r,Jj),useCompressionStream:qe,transferStreams:As(o,r,Qj),deflate64:Pe,format:ae?ae.format:ke,codecURI:ae?ae.codecURI:ke,compressionMethod:g,rawBitFlag:y,checkPasswordOnly:ge},config:s,streamOptions:{signal:xe,size:Ae,onstart:Re,onprogress:Qe,onend:He}};we&&await QSt({reader:a,fileEntry:n,index:c,offset:I,crc32:A,compressedSize:T,uncompressedSize:x,dataOffset:N,dataDescriptor:E||v.bitFlag.dataDescriptor,extraFieldZip64:p||v.extraFieldZip64,readRanges:i});let lt,mt;try{if(!ve){ge&&(t=new WritableStream),t=new Dw(t),await Ic(t,nwt(Ke,T,Ye)),{writable:lt}=t;let{outputSize:ft}=await D6({readable:fe,writable:lt},jt);if(t.size+=ft,ft!=Ke)throw new Error(NA)}}catch(ft){if(ft.outputSize!==ke&&(t.size+=ft.outputSize),!ge||ft.message!=Yg)throw mt=ft,ft}finally{if(!(!L6(t)&&As(o,r,e6))&<&&!lt.locked){let Yt=lt.getWriter();if(mt)try{await Yt.abort(mt)}catch{}else await Yt.close()}}return ge||ve?ke:t.getData?t.getData():lt}}});var SBe=uh((Dyr,P7)=>{/* 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 r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=s(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=a(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),E=2*f.maxZError,v=Number.MAX_VALUE,S;p=p||(f.mask?f.mask.bitset:null);var I,R;I=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),L,_,C=0;C<=b;C++){var w=C!==b?T:f.height%b;if(w!==0)for(var D=0;D<=A;D++){var N=D!==A?x:f.width%A;if(N!==0){var F=C*f.width*T+D*x,V=f.width-N,B=f.pixels.blocks[y],j,k,G;B.encoding<2?(B.encoding===0?j=B.rawData:(u(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,E,O,f.pixels.maxValue),j=O),k=0):B.encoding===2?G=0:G=B.offset;var q;if(p)for(_=0;_<w;_++){for(F&7&&(q=p[F>>3],q<<=F&7),L=0;L<N;L++)F&7||(q=p[F>>3]),q&128?(R&&(R[F]=1),S=B.encoding<2?j[k++]:G,v=v>S?S:v,I[F++]=S):(R&&(R[F]=0),I[F++]=g),q<<=1;F+=V}else if(B.encoding<2)for(_=0;_<w;_++){for(L=0;L<N;L++)S=j[k++],v=v>S?S:v,I[F++]=S;F+=V}else for(v=v>G?G:v,_=0;_<w;_++){for(L=0;L<N;L++)I[F++]=G;F+=V}if(B.encoding===1&&k!==B.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:I,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var E=y.getUint8(x++);for(b=-b;b--;)A[T++]=E}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=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)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,S=g.pixels.numBlocksY,I=v+(g.width%v>0?1:0),R=S+(g.height%S>0?1:0);g.pixels.blocks=new Array(I*R);for(var O=0,L=0;L<R;L++)for(var _=0;_<I;_++){var C=0,w=f.byteLength-d;y=new DataView(f,d,Math.min(10,w));var D={};g.pixels.blocks[O++]=D;var N=y.getUint8(0);if(C++,D.encoding=N&63,D.encoding>3)throw"Invalid block encoding ("+D.encoding+")";if(D.encoding===2){d++;continue}if(N!==0&&N!==2){if(N>>=6,D.offsetType=N,N===2)D.offset=y.getInt8(1),C++;else if(N===1)D.offset=y.getInt16(1,!0),C+=2;else if(N===0)D.offset=y.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(D.encoding===1)if(N=y.getUint8(C),C++,D.bitsPerPixel=N&63,N>>=6,D.numValidPixelsType=N,N===2)D.numValidPixels=y.getUint8(C),C++;else if(N===1)D.numValidPixels=y.getUint16(C,!0),C+=2;else if(N===0)D.numValidPixels=y.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,D.encoding!==3){var F,V;if(D.encoding===0){var B=(g.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";F=new ArrayBuffer(B*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B*4));var j=new Float32Array(F);D.rawData=j,d+=B*4}else if(D.encoding===1){var k=Math.ceil(D.numValidPixels*D.bitsPerPixel/8),G=Math.ceil(k/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k)),D.stuffedData=new Uint32Array(F),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,E=0,v,S,I=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(E===0&&(S=f[x++],E=32),E>=d)v=S>>>E-d&b,E-=d;else{var O=d-E;v=(S&b)<<O&b,S=f[x++],E=32-O,v+=S>>>E}y[T]=v<I?g+v*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E,v,S,I,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=p[E];else for(I=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=E<I?g+E*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E,v=[],S=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*S;var I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32),x>=u?(T=E>>>x-u&m,x-=u):(b=u-x,T=(E&m)<<b&m,E=c[y++],x=32-b,T+=E>>>x),v[A]=T<I?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E=0,v,S,I;if(p)for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=p[v];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=v<R?g+v*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E=0,v,S=[],I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(v=c[y++],x=32,E=0),x>=u?(T=v>>>E&m,x-=u,E+=u):(b=u-x,T=v>>>E&m,v=c[y++],x=32-b,T|=(v&(1<<b)-1)<<u-b,E=b),S[A]=T<I?d+T*p:g;return S.unshift(d),S},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,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),f+=40,u.headerInfo=p,u.ptr=f;var y,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,E=0,v=0;do{if(x>0)for(;x--;)A[E++]=m.getUint8(T++);else for(v=m.getUint8(T++),x=-x;x--;)A[E++]=v;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||E<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var S=0,I=0;for(I=0;I<p;I++)I&7?(S=A[I>>3],S<<=I&7):S=A[I>>3],S&128&&(b[I]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),E=new Uint8Array(T);E.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var v=0,S=0,I=0,R=0;if(g>1)for(I=0;I<g;I++)for(R=I*m,S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[R+S]=b[v++]);else for(S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[S]=b[v++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,E,v;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var S=c.byteLength-u.ptr,I=Math.ceil(S/4),R=new ArrayBuffer(I*4),O=new Uint8Array(R);O.set(new Uint8Array(c,u.ptr,S));var L=new Uint32Array(R),_=0,C,w=0;for(C=L[0],x=m;x<y;x++)T=x-(x<g?0:g),v=b[T].first,v>0&&(b[T].second=C<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,C=L[w])):(_+=v-32,w++,C=L[w],b[T].second|=C>>>32-_));var D=0,N=0,F=new s;for(x=0;x<b.length;x++)b[x]!==void 0&&(D=Math.max(D,b[x].first));D>=f?N=f:N=D,D>=30&&console.log("WARning, large NUM LUT BITS IS "+D);var V=[],B,j,k,G,q,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),v=b[T].first,v>0)if(B=[v,T],v<=N)for(j=b[T].second<<N-v,k=1<<N-v,E=0;E<k;E++)V[j|E]=B;else for(j=b[T].second,Q=F,G=v-1;G>=0;G--)q=j>>>G&1,q?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),G===0&&!Q.val&&(Q.val=B[1]);return{decodeLut:V,numBitsLUTQick:N,numBitsLUT:D,tree:F,stuffedData:L,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,E=A.srcPtr,v=A.bitPos,S=A.numBitsLUTQick,I=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,L,_,C=u.pixels.resultMask,w,D,N,F,V,B,j,k=0;v>0&&(E++,v=0);var G=T[E],q=u.encodeMode===1,Q=new f(y*p),W=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(W=new f(Q.buffer,y*J,y),k=0),u.headerInfo.numValidPixel===m*g)for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++){if(L=0,w=G<<v>>>32-S,D=w,32-v<S&&(w|=T[E+1]>>>64-v-S,D=w),b[D])L=b[D][1],v+=b[D][0];else for(w=G<<v>>>32-I,D=w,32-v<I&&(w|=T[E+1]>>>64-v-I,D=w),O=x,j=0;j<I;j++)if(N=w>>>I-j-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0?_+=k:F>0?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}else for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++)if(C[B]){if(L=0,w=G<<v>>>32-S,D=w,32-v<S&&(w|=T[E+1]>>>64-v-S,D=w),b[D])L=b[D][1],v+=b[D][0];else for(w=G<<v>>>32-I,D=w,32-v<I&&(w|=T[E+1]>>>64-v-I,D=w),O=x,j=0;j<I;j++)if(N=w>>>I-j-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0&&C[B-1]?_+=k:F>0&&C[B-m]?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,E=(b&32)>0,v=b&31,S=0;if(T===1)S=A.getUint8(y),y++;else if(T===2)S=A.getUint16(y,!0),y+=2;else if(T===4)S=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,R,O,L,_,C,w,D,N,F,V,B=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,N=A.getUint8(y),F=v,y++,_=Math.ceil((N-1)*v/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,_)),D=new Uint32Array(O),u.ptr+=_,V=0;N-1>>>V;)V++;_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?w=r.unstuffLUT2(D,v,N-1,d,I,B):w=r.unstuffLUT(D,v,N-1,d,I,B),m>=3?r.unstuff2(R,f,V,S,w):r.unstuff(R,f,V,S,w)}else u.counter.bitstuffer++,V=v,u.ptr+=y,V>0&&(_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,S):r.unstuff2(R,f,V,S,!1,d,I,B):d==null?r.originalUnstuff(R,f,V,S):r.unstuff(R,f,V,S,!1,d,I,B))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,E=0,v=0,S=0,I=0,R=0,O=0,L=0,_=0,C=0,w=0,D=0,N=0,F=0,V=0,B=0,j,k,G,q,Q,W,J=new f(m*m),Z=g%m||m,ae=p%m||m,Ae,fe,xe=d.numDims,ge,we=u.pixels.resultMask,ve=u.pixels.resultPixels;for(v=0;v<x;v++)for(I=v!==x-1?m:Z,S=0;S<b;S++)for(R=S!==b-1?m:ae,w=v*p*m+S*m,D=p-R,ge=0;ge<xe;ge++){if(xe>1&&(ve=new f(u.pixels.resultPixels.buffer,p*g*ge*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),k={},B=0,L=j.getUint8(0),B++,_=L>>6&255,C=L>>2&15,C!==(S*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=B,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=B;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=B,N=I*R*A,F=c.byteLength-u.ptr,N=N<F?N:F,G=new ArrayBuffer(N%A===0?N:N+A-N%A),q=new Uint8Array(G),q.set(new Uint8Array(c,u.ptr,N)),Q=new f(G),V=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=Q[V++]),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=Q[V++];w+=D}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),fe=o.getOnePixel(k,B,Ae,j),B+=o.getDataTypeSize(Ae),W===3)if(u.ptr+=B,u.counter.constantoffset++,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=fe),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=fe;w+=D}else if(u.ptr+=B,o.decodeBits(c,u,J,fe,ge),B=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=J[B++]),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=J[B++];w+=D}}},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:o.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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={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&&o.isValidPixelValue(g.imageType,f)){var S=p.pixels.resultMask;for(d=0;d<A;d++)S[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var x=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,E,v;if(f>1&&m.length>1){for(v=b.width*b.height,b.bandMasks=m,A=new Uint8Array(v),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],E=0;E<v;E++)A[E]=A[E]&y[E];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof P7<"u"&&P7.exports?P7.exports=i:this.Lerc=i})()});var K2e=uh((YHr,X2e)=>{X2e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxh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AAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUW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AAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var J2e=uh((XHr,$2e)=>{var{webm:gHt,mp4:_Ht}=K2e(),Pae=()=>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,Dae=()=>"wakeLock"in navigator,Rae=class{constructor(){if(this.enabled=!1,Dae()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else Pae()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",gHt),this._addSourceToVideo(this.noSleepVideo,"mp4",_Ht),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 r=document.createElement("source");r.src=i,r.type=`video/${n}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return Dae()?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}):Pae()?(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(){X$()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):Y$()?this.noSleepTimer&&(console.warn(` + `),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(){Dae()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):Pae()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};YCe.exports=K$});function mEe(e){return e!=null}var c=mEe;function w0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(w0.prototype=Object.create(Error.prototype),w0.prototype.constructor=w0);w0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` -${this.stack.toString()}`),e};w0.throwInstantiationError=function(){throw new w0("This function defines an interface and should not be called directly.")};var C=w0;var _s={};_s.typeOf={};function pEe(e){return`${e} is required, actual value was undefined`}function tT(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}_s.defined=function(e,t){if(!c(t))throw new C(pEe(e))};_s.typeOf.func=function(e,t){if(typeof t!="function")throw new C(tT(typeof t,"function",e))};_s.typeOf.string=function(e,t){if(typeof t!="string")throw new C(tT(typeof t,"string",e))};_s.typeOf.number=function(e,t){if(typeof t!="number")throw new C(tT(typeof t,"number",e))};_s.typeOf.number.lessThan=function(e,t,n){if(_s.typeOf.number(e,t),t>=n)throw new C(`Expected ${e} to be less than ${n}, actual value was ${t}`)};_s.typeOf.number.lessThanOrEquals=function(e,t,n){if(_s.typeOf.number(e,t),t>n)throw new C(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};_s.typeOf.number.greaterThan=function(e,t,n){if(_s.typeOf.number(e,t),t<=n)throw new C(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};_s.typeOf.number.greaterThanOrEquals=function(e,t,n){if(_s.typeOf.number(e,t),t<n)throw new C(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};_s.typeOf.object=function(e,t){if(typeof t!="object")throw new C(tT(typeof t,"object",e))};_s.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(tT(typeof t,"boolean",e))};_s.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(tT(typeof t,"bigint",e))};_s.typeOf.number.equals=function(e,t,n,i){if(_s.typeOf.number(e,n),_s.typeOf.number(t,i),n!==i)throw new C(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var T=_s;var YG=jr(lO(),1);var st={};st.EPSILON1=.1;st.EPSILON2=.01;st.EPSILON3=.001;st.EPSILON4=1e-4;st.EPSILON5=1e-5;st.EPSILON6=1e-6;st.EPSILON7=1e-7;st.EPSILON8=1e-8;st.EPSILON9=1e-9;st.EPSILON10=1e-10;st.EPSILON11=1e-11;st.EPSILON12=1e-12;st.EPSILON13=1e-13;st.EPSILON14=1e-14;st.EPSILON15=1e-15;st.EPSILON16=1e-16;st.EPSILON17=1e-17;st.EPSILON18=1e-18;st.EPSILON19=1e-19;st.EPSILON20=1e-20;st.EPSILON21=1e-21;st.GRAVITATIONALPARAMETER=3986004418e5;st.SOLAR_RADIUS=6955e5;st.LUNAR_RADIUS=1737400;st.SIXTY_FOUR_KILOBYTES=64*1024;st.FOUR_GIGABYTES=4*1024*1024*1024;st.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};st.signNotZero=function(e){return e<0?-1:1};st.toSNorm=function(e,t){return t=t??255,Math.round((st.clamp(e,-1,1)*.5+.5)*t)};st.fromSNorm=function(e,t){return t=t??255,st.clamp(e,0,t)/t*2-1};st.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:st.clamp((e-t)/n,0,1)};st.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};st.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};st.lerp=function(e,t,n){return(1-n)*e+n*t};st.PI=Math.PI;st.ONE_OVER_PI=1/Math.PI;st.PI_OVER_TWO=Math.PI/2;st.PI_OVER_THREE=Math.PI/3;st.PI_OVER_FOUR=Math.PI/4;st.PI_OVER_SIX=Math.PI/6;st.THREE_PI_OVER_TWO=3*Math.PI/2;st.TWO_PI=2*Math.PI;st.ONE_OVER_TWO_PI=1/(2*Math.PI);st.RADIANS_PER_DEGREE=Math.PI/180;st.DEGREES_PER_RADIAN=180/Math.PI;st.RADIANS_PER_ARCSECOND=st.RADIANS_PER_DEGREE/3600;st.toRadians=function(e){if(!c(e))throw new C("degrees is required.");return e*st.RADIANS_PER_DEGREE};st.toDegrees=function(e){if(!c(e))throw new C("radians is required.");return e*st.DEGREES_PER_RADIAN};st.convertLongitudeRange=function(e){if(!c(e))throw new C("angle is required.");let t=st.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};st.clampToLatitudeRange=function(e){if(!c(e))throw new C("angle is required.");return st.clamp(e,-1*st.PI_OVER_TWO,st.PI_OVER_TWO)};st.negativePiToPi=function(e){if(!c(e))throw new C("angle is required.");return e>=-st.PI&&e<=st.PI?e:st.zeroToTwoPi(e+st.PI)-st.PI};st.zeroToTwoPi=function(e){if(!c(e))throw new C("angle is required.");if(e>=0&&e<=st.TWO_PI)return e;let t=st.mod(e,st.TWO_PI);return Math.abs(t)<st.EPSILON14&&Math.abs(e)>st.EPSILON14?st.TWO_PI:t};st.mod=function(e,t){if(!c(e))throw new C("m is required.");if(!c(t))throw new C("n is required.");if(t===0)throw new C("divisor cannot be 0.");return st.sign(e)===st.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};st.equalsEpsilon=function(e,t,n,i){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");n=n??0,i=i??n;let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};st.lessThan=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t<-n};st.lessThanOrEquals=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t<n};st.greaterThan=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t>n};st.greaterThanOrEquals=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t>-n};var uO=[1];st.factorial=function(e){if(typeof e!="number"||e<0)throw new C("A number greater than or equal to 0 is required.");let t=uO.length;if(e>=t){let n=uO[t-1];for(let i=t;i<=e;i++){let o=n*i;uO.push(o),n=o}}return uO[e]};st.incrementWrap=function(e,t,n){if(n=n??0,!c(e))throw new C("n is required.");if(t<=n)throw new C("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};st.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};st.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new C("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};st.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");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};st.clamp=function(e,t,n){return T.typeOf.number("value",e),T.typeOf.number("min",t),T.typeOf.number("max",n),e<t?t:e>n?n:e};var nZ=new YG.default;st.setRandomNumberSeed=function(e){if(!c(e))throw new C("seed is required.");nZ=new YG.default(e)};st.nextRandomNumber=function(){return nZ.random()};st.randomBetween=function(e,t){return st.nextRandomNumber()*(t-e)+e};st.acosClamped=function(e){if(!c(e))throw new C("value is required.");return Math.acos(st.clamp(e,-1,1))};st.asinClamped=function(e){if(!c(e))throw new C("value is required.");return Math.asin(st.clamp(e,-1,1))};st.chordLength=function(e,t){if(!c(e))throw new C("angle is required.");if(!c(t))throw new C("radius is required.");return 2*t*Math.sin(e*.5)};st.logBase=function(e,t){if(!c(e))throw new C("number is required.");if(!c(t))throw new C("base is required.");return Math.log(e)/Math.log(t)};st.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};st.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};st.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};st.fastApproximateAtan=function(e){return T.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};st.fastApproximateAtan2=function(e,t){T.typeOf.number("x",e),T.typeOf.number("y",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;if(isNaN(r))throw new C("either x or y must be nonzero");return i=st.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?st.PI_OVER_TWO-i:i,i=e<0?st.PI-i:i,i=t<0?-i:i,i};var O=st;function Qe(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}Qe.fromSpherical=function(e,t){T.typeOf.object("spherical",e),c(t)||(t=new Qe);let n=e.clock,i=e.cone,o=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};Qe.fromElements=function(e,t,n,i){return c(i)?(i.x=e,i.y=t,i.z=n,i):new Qe(e,t,n)};Qe.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Qe(e.x,e.y,e.z)};Qe.fromCartesian4=Qe.clone;Qe.packedLength=3;Qe.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Qe.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Qe),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Qe.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*3;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Qe.pack(e[o],t,o*3);return t};Qe.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new C("array length must be a multiple of 3.");let n=e.length;c(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.fromArray=Qe.unpack;Qe.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)};Qe.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)};Qe.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};Qe.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};Qe.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y),s=O.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Qe.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z};Qe.magnitude=function(e){return Math.sqrt(Qe.magnitudeSquared(e))};var dO=new Qe;Qe.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Qe.subtract(e,t,dO),Qe.magnitude(dO)};Qe.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Qe.subtract(e,t,dO),Qe.magnitudeSquared(dO)};Qe.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Qe.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new C("normalized result is not a number");return t};Qe.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z};Qe.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Qe.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Qe.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Qe.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Qe.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Qe.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Qe.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Qe.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var iZ=new Qe;Qe.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),Qe.multiplyByScalar(t,n,iZ),i=Qe.multiplyByScalar(e,1-n,i),Qe.add(iZ,i,i)};var fO=new Qe,XG=new Qe;Qe.angleBetween=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",t),Qe.normalize(e,fO),Qe.normalize(t,XG);let n=Qe.dot(fO,XG),i=Qe.magnitude(Qe.cross(fO,XG,fO));return Math.atan2(i,n)};var _Ee=new Qe;Qe.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Qe.normalize(e,_Ee);return Qe.abs(n,n),n.x<=n.y?n.x<=n.z?t=Qe.clone(Qe.UNIT_X,t):t=Qe.clone(Qe.UNIT_Z,t):n.y<=n.z?t=Qe.clone(Qe.UNIT_Y,t):t=Qe.clone(Qe.UNIT_Z,t),t};Qe.projectVector=function(e,t,n){T.defined("a",e),T.defined("b",t),T.defined("result",n);let i=Qe.dot(e,t)/Qe.dot(t,t);return Qe.multiplyByScalar(t,i,n)};Qe.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Qe.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Qe.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)&&O.equalsEpsilon(e.z,t.z,n,i)};Qe.cross=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,l=t.z,u=o*l-r*a,f=r*s-i*l,h=i*a-o*s;return n.x=u,n.y=f,n.z=h,n};Qe.midpoint=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Qe.fromDegrees=function(e,t,n,i,o){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),Qe.fromRadians(e,t,n,i,o)};var qu=new Qe,nT=new Qe;Qe._ellipsoidRadiiSquared=new Qe(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Qe.fromRadians=function(e,t,n,i,o){T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0;let r=c(i)?i.radiiSquared:Qe._ellipsoidRadiiSquared,s=Math.cos(t);qu.x=s*Math.cos(e),qu.y=s*Math.sin(e),qu.z=Math.sin(t),qu=Qe.normalize(qu,qu),Qe.multiplyComponents(r,qu,nT);let a=Math.sqrt(Qe.dot(qu,nT));return nT=Qe.divideByScalar(nT,a,nT),qu=Qe.multiplyByScalar(qu,n,qu),c(o)||(o=new Qe),Qe.add(nT,qu,o)};Qe.fromDegreesArray=function(e,t,n){if(T.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(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]=Qe.fromDegrees(r,s,0,t,n[a])}return n};Qe.fromRadiansArray=function(e,t,n){if(T.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(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]=Qe.fromRadians(r,s,0,t,n[a])}return n};Qe.fromDegreesArrayHeights=function(e,t,n){if(T.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(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],l=o/3;n[l]=Qe.fromDegrees(r,s,a,t,n[l])}return n};Qe.fromRadiansArrayHeights=function(e,t,n){if(T.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(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],l=o/3;n[l]=Qe.fromRadians(r,s,a,t,n[l])}return n};Qe.ZERO=Object.freeze(new Qe(0,0,0));Qe.ONE=Object.freeze(new Qe(1,1,1));Qe.UNIT_X=Object.freeze(new Qe(1,0,0));Qe.UNIT_Y=Object.freeze(new Qe(0,1,0));Qe.UNIT_Z=Object.freeze(new Qe(0,0,1));Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.prototype.equalsEpsilon=function(e,t,n){return Qe.equalsEpsilon(this,e,t,n)};Qe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var d=Qe;function yt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}yt.fromElements=function(e,t,n,i,o){return c(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new yt(e,t,n,i)};yt.fromColor=function(e,t){return T.typeOf.object("color",e),c(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new yt(e.red,e.green,e.blue,e.alpha)};yt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new yt(e.x,e.y,e.z,e.w)};yt.packedLength=4;yt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};yt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new yt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};yt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)yt.pack(e[o],t,o*4);return t};yt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=yt.unpack(e,i,t[o])}return t};yt.fromArray=yt.unpack;yt.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};yt.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};yt.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};yt.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),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};yt.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y),s=O.clamp(e.z,t.z,n.z),a=O.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};yt.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};yt.magnitude=function(e){return Math.sqrt(yt.magnitudeSquared(e))};var hO=new yt;yt.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),yt.subtract(e,t,hO),yt.magnitude(hO)};yt.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),yt.subtract(e,t,hO),yt.magnitudeSquared(hO)};yt.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=yt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new C("normalized result is not a number");return t};yt.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};yt.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};yt.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};yt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};yt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};yt.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};yt.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};yt.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};yt.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),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 oZ=new yt;yt.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),yt.multiplyByScalar(t,n,oZ),i=yt.multiplyByScalar(e,1-n,i),yt.add(oZ,i,i)};var gEe=new yt;yt.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=yt.normalize(e,gEe);return yt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=yt.clone(yt.UNIT_X,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=yt.clone(yt.UNIT_Y,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t),t};yt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};yt.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]};yt.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)&&O.equalsEpsilon(e.z,t.z,n,i)&&O.equalsEpsilon(e.w,t.w,n,i)};yt.ZERO=Object.freeze(new yt(0,0,0,0));yt.ONE=Object.freeze(new yt(1,1,1,1));yt.UNIT_X=Object.freeze(new yt(1,0,0,0));yt.UNIT_Y=Object.freeze(new yt(0,1,0,0));yt.UNIT_Z=Object.freeze(new yt(0,0,1,0));yt.UNIT_W=Object.freeze(new yt(0,0,0,1));yt.prototype.clone=function(e){return yt.clone(this,e)};yt.prototype.equals=function(e){return yt.equals(this,e)};yt.prototype.equalsEpsilon=function(e,t,n){return yt.equalsEpsilon(this,e,t,n)};yt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var KG=new Float32Array(1),Ga=new Uint8Array(KG.buffer),yEe=new Uint32Array([287454020]),bEe=new Uint8Array(yEe.buffer),rZ=bEe[0]===68;yt.packFloat=function(e,t){return T.typeOf.number("value",e),c(t)||(t=new yt),KG[0]=e,rZ?(t.x=Ga[0],t.y=Ga[1],t.z=Ga[2],t.w=Ga[3]):(t.x=Ga[3],t.y=Ga[2],t.z=Ga[1],t.w=Ga[0]),t};yt.unpackFloat=function(e){return T.typeOf.object("packedFloat",e),rZ?(Ga[0]=e.x,Ga[1]=e.y,Ga[2]=e.z,Ga[3]=e.w):(Ga[0]=e.w,Ga[1]=e.z,Ga[2]=e.y,Ga[3]=e.x),KG[0]};var se=yt;var $G={};$G.EMPTY_OBJECT=Object.freeze({});$G.EMPTY_ARRAY=Object.freeze([]);var W=$G;function tt(e,t,n,i,o,r,s,a,l){this[0]=e??0,this[1]=i??0,this[2]=s??0,this[3]=t??0,this[4]=o??0,this[5]=a??0,this[6]=n??0,this[7]=r??0,this[8]=l??0}tt.packedLength=9;tt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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};tt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(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};tt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*9;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)tt.pack(e[o],t,o*9);return t};tt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new C("array length must be a multiple of 9.");let n=e.length;c(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(c(e))return c(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 tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return T.defined("values",e),tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return T.defined("values",e),c(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 tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){T.typeOf.object("quaternion",e);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,l=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-s-u+h,g=2*(i-f),m=2*(o+l),y=2*(i+f),b=-n+s-u+h,x=2*(a-r),A=2*(o-l),E=2*(a+r),S=-n-s+u+h;return c(t)?(t[0]=p,t[1]=y,t[2]=A,t[3]=g,t[4]=b,t[5]=E,t[6]=m,t[7]=x,t[8]=S,t):new tt(p,g,m,y,b,x,A,E,S)};tt.fromHeadingPitchRoll=function(e,t){T.typeOf.object("headingPitchRoll",e);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),l=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,h=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,m=-r,y=a*n,b=o*n;return c(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=y,t[6]=f,t[7]=g,t[8]=b,t):new tt(l,u,f,h,p,g,m,y,b)};tt.fromScale=function(e,t){return T.typeOf.object("scale",e),c(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 tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(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 tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return T.typeOf.object("vector",e),c(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 tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return T.typeOf.object("matrix",e),c(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]]};tt.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,2),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,2),e*3+t};tt.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("result",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};tt.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("result",n);let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};tt.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var xEe=new d;tt.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=tt.getScale(e,xEe),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 TEe=new d;tt.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=tt.getScale(e,TEe),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 ZG=new d;tt.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],ZG)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],ZG)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],ZG)),t};var sZ=new d;tt.getMaximumScale=function(e){return tt.getScale(e,sZ),d.maximumComponent(sZ)};var AEe=new d;tt.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=tt.getScale(e,AEe);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 CEe=new d;tt.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=tt.getScale(e,CEe);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};tt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",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],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=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]=l,n[6]=u,n[7]=f,n[8]=h,n};tt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};tt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};tt.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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,l=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=l,n};tt.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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};tt.multiplyByScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n),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};tt.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),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};tt.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",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};tt.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],l=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=l,t[7]=u,t[8]=f,t};function EEe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var QG=[1,0,0],JG=[2,2,1];function SEe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(JG[n],QG[n])];t+=2*i*i}return Math.sqrt(t)}function wEe(e,t){let n=O.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex(JG[u],QG[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=QG[o],l=JG[o];if(Math.abs(e[tt.getElementIndex(l,a)])>n){let u=e[tt.getElementIndex(l,l)],f=e[tt.getElementIndex(a,a)],h=e[tt.getElementIndex(l,a)],p=(u-f)/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=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(l,l)]=r,t[tt.getElementIndex(l,a)]=s,t[tt.getElementIndex(a,l)]=-s,t}var mO=new tt,aZ=new tt;tt.computeEigenDecomposition=function(e,t){T.typeOf.object("matrix",e);let n=O.EPSILON20,i=10,o=0,r=0;c(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),l=n*EEe(a);for(;r<i&&SEe(a)>l;)wEe(a,mO),tt.transpose(mO,aZ),tt.multiply(a,mO,a),tt.multiply(aZ,a,a),tt.multiply(s,mO,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};tt.determinant=function(e){T.typeOf.object("matrix",e);let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],l=e[5],u=e[8];return t*(r*u-l*s)+o*(l*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=tt.determinant(e);if(Math.abs(h)<=O.EPSILON15)throw new C("matrix is not invertible");t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=l*a-r*f,t[4]=n*f-l*o,t[5]=r*o-n*a,t[6]=r*u-l*s,t[7]=l*i-n*u,t[8]=n*s-r*i;let p=1/h;return tt.multiplyByScalar(t,p,t)};var vEe=new tt;tt.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),tt.inverse(tt.transpose(e,vEe),t)};tt.equals=function(e,t){return e===t||c(e)&&c(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]};tt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;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]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};$2e.exports=Rae});function Eke(e){return e!=null}var l=Eke;function db(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(db.prototype=Object.create(Error.prototype),db.prototype.constructor=db);db.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};db.throwInstantiationError=function(){throw new db("This function defines an interface and should not be called directly.")};var pe=db;var ia={};ia.typeOf={};function Cke(e){return`${e} is required, actual value was undefined`}function hE(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ia.defined=function(e,t){if(!l(t))throw new pe(Cke(e))};ia.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(hE(typeof t,"function",e))};ia.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(hE(typeof t,"string",e))};ia.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(hE(typeof t,"number",e))};ia.typeOf.number.lessThan=function(e,t,n){if(ia.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ia.typeOf.number.lessThanOrEquals=function(e,t,n){if(ia.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ia.typeOf.number.greaterThan=function(e,t,n){if(ia.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ia.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ia.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ia.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(hE(typeof t,"object",e))};ia.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(hE(typeof t,"boolean",e))};ia.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(hE(typeof t,"bigint",e))};ia.typeOf.number.equals=function(e,t,n,i){if(ia.typeOf.number(e,n),ia.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var qr=ia;var nq=js(tN(),1);var _t={};_t.EPSILON1=.1;_t.EPSILON2=.01;_t.EPSILON3=.001;_t.EPSILON4=1e-4;_t.EPSILON5=1e-5;_t.EPSILON6=1e-6;_t.EPSILON7=1e-7;_t.EPSILON8=1e-8;_t.EPSILON9=1e-9;_t.EPSILON10=1e-10;_t.EPSILON11=1e-11;_t.EPSILON12=1e-12;_t.EPSILON13=1e-13;_t.EPSILON14=1e-14;_t.EPSILON15=1e-15;_t.EPSILON16=1e-16;_t.EPSILON17=1e-17;_t.EPSILON18=1e-18;_t.EPSILON19=1e-19;_t.EPSILON20=1e-20;_t.EPSILON21=1e-21;_t.GRAVITATIONALPARAMETER=3986004418e5;_t.SOLAR_RADIUS=6955e5;_t.LUNAR_RADIUS=1737400;_t.SIXTY_FOUR_KILOBYTES=64*1024;_t.FOUR_GIGABYTES=4*1024*1024*1024;_t.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};_t.signNotZero=function(e){return e<0?-1:1};_t.toSNorm=function(e,t){return t=t??255,Math.round((_t.clamp(e,-1,1)*.5+.5)*t)};_t.fromSNorm=function(e,t){return t=t??255,_t.clamp(e,0,t)/t*2-1};_t.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:_t.clamp((e-t)/n,0,1)};_t.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};_t.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};_t.lerp=function(e,t,n){return(1-n)*e+n*t};_t.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,s={}){o=Math.max(1e-4,o);let a=2/o,c=a*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=_t.clamp(d,-f,f);let p=e-d,g=(n+a*d)*i;return n=(n-a*g)*u,s.value=p+(d+g)*u,s.velocity=n,s};_t.PI=Math.PI;_t.ONE_OVER_PI=1/Math.PI;_t.PI_OVER_TWO=Math.PI/2;_t.PI_OVER_THREE=Math.PI/3;_t.PI_OVER_FOUR=Math.PI/4;_t.PI_OVER_SIX=Math.PI/6;_t.THREE_PI_OVER_TWO=3*Math.PI/2;_t.TWO_PI=2*Math.PI;_t.ONE_OVER_TWO_PI=1/(2*Math.PI);_t.RADIANS_PER_DEGREE=Math.PI/180;_t.DEGREES_PER_RADIAN=180/Math.PI;_t.RADIANS_PER_ARCSECOND=_t.RADIANS_PER_DEGREE/3600;_t.toRadians=function(e){return e*_t.RADIANS_PER_DEGREE};_t.toDegrees=function(e){return e*_t.DEGREES_PER_RADIAN};_t.convertLongitudeRange=function(e){let t=_t.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};_t.clampToLatitudeRange=function(e){return _t.clamp(e,-1*_t.PI_OVER_TWO,_t.PI_OVER_TWO)};_t.negativePiToPi=function(e){return e>=-_t.PI&&e<=_t.PI?e:_t.zeroToTwoPi(e+_t.PI)-_t.PI};_t.zeroToTwoPi=function(e){if(e>=0&&e<=_t.TWO_PI)return e;let t=_t.mod(e,_t.TWO_PI);return Math.abs(t)<_t.EPSILON14&&Math.abs(e)>_t.EPSILON14?_t.TWO_PI:t};_t.mod=function(e,t){return _t.sign(e)===_t.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};_t.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};_t.lessThan=function(e,t,n){return e-t<-n};_t.lessThanOrEquals=function(e,t,n){return e-t<n};_t.greaterThan=function(e,t,n){return e-t>n};_t.greaterThanOrEquals=function(e,t,n){return e-t>-n};var nN=[1];_t.factorial=function(e){let t=nN.length;if(e>=t){let n=nN[t-1];for(let i=t;i<=e;i++){let r=n*i;nN.push(r),n=r}}return nN[e]};_t.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};_t.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};_t.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};_t.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};_t.clamp=function(e,t,n){return e<t?t:e>n?n:e};var kae=new nq.default;_t.setRandomNumberSeed=function(e){kae=new nq.default(e)};_t.nextRandomNumber=function(){return kae.random()};_t.randomBetween=function(e,t){return _t.nextRandomNumber()*(t-e)+e};_t.acosClamped=function(e){return Math.acos(_t.clamp(e,-1,1))};_t.asinClamped=function(e){return Math.asin(_t.clamp(e,-1,1))};_t.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};_t.logBase=function(e,t){return Math.log(e)/Math.log(t)};_t.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};_t.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};_t.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};_t.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};_t.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=_t.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?_t.PI_OVER_TWO-i:i,i=e<0?_t.PI-i:i,i=t<0?-i:i,i};var P=_t;var lo=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y),a=P.clamp(t.z,n.z,i.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,iN),e.magnitude(iN)}static distanceSquared(t,n){return e.subtract(t,n,iN),e.magnitudeSquared(iN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Uae),r=e.multiplyByScalar(t,1-i,r),e.add(Uae,r,r)}static angleBetween(t,n){e.normalize(t,rN),e.normalize(n,iq);let i=e.dot(rN,iq),r=e.magnitude(e.cross(rN,iq,rN));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,vke);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)&&P.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,s=t.z,a=n.x,c=n.y,u=n.z,f=o*u-s*c,d=s*a-r*u,p=r*c-o*a;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=P.toRadians(t),n=P.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let s=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,a=Math.cos(n);Yf.x=a*Math.cos(t),Yf.y=a*Math.sin(t),Yf.z=Math.sin(n),Yf=e.normalize(Yf,Yf),e.multiplyComponents(s,Yf,mE);let c=Math.sqrt(e.dot(Yf,mE));return mE=e.divideByScalar(mE,c,mE),Yf=e.multiplyByScalar(Yf,i,Yf),l(o)||(o=new e),e.add(mE,Yf,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromDegrees(s,a,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromRadians(s,a,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(s,a,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(s,a,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};lo.fromCartesian4=lo.clone;lo.packedLength=3;lo.fromArray=lo.unpack;var iN=new lo,Uae=new lo,rN=new lo,iq=new lo,vke=new lo,Yf=new lo,mE=new lo;lo._ellipsoidRadiiSquared=new lo(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);lo.ZERO=Object.freeze(new lo(0,0,0));lo.ONE=Object.freeze(new lo(1,1,1));lo.UNIT_X=Object.freeze(new lo(1,0,0));lo.UNIT_Y=Object.freeze(new lo(0,1,0));lo.UNIT_Z=Object.freeze(new lo(0,0,1));var h=lo;var Hs=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y),a=P.clamp(t.z,n.z,i.z),c=P.clamp(t.w,n.w,i.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,oN),e.magnitude(oN)}static distanceSquared(t,n){return e.subtract(t,n,oN),e.magnitudeSquared(oN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,zae),r=e.multiplyByScalar(t,1-i,r),e.add(zae,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Ske);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)&&P.equalsEpsilon(t.z,n.z,i,r)&&P.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),rq[0]=t,Vae?(n.x=Nc[0],n.y=Nc[1],n.z=Nc[2],n.w=Nc[3]):(n.x=Nc[3],n.y=Nc[2],n.z=Nc[1],n.w=Nc[0]),n}static unpackFloat(t){return Vae?(Nc[0]=t.x,Nc[1]=t.y,Nc[2]=t.z,Nc[3]=t.w):(Nc[0]=t.w,Nc[1]=t.z,Nc[2]=t.y,Nc[3]=t.x),rq[0]}};Hs.packedLength=4;Hs.fromArray=Hs.unpack;var oN=new Hs,zae=new Hs,Ske=new Hs;Hs.ZERO=Object.freeze(new Hs(0,0,0,0));Hs.ONE=Object.freeze(new Hs(1,1,1,1));Hs.UNIT_X=Object.freeze(new Hs(1,0,0,0));Hs.UNIT_Y=Object.freeze(new Hs(0,1,0,0));Hs.UNIT_Z=Object.freeze(new Hs(0,0,1,0));Hs.UNIT_W=Object.freeze(new Hs(0,0,0,1));var rq=new Float32Array(1),Nc=new Uint8Array(rq.buffer),wke=new Uint32Array([287454020]),Ike=new Uint8Array(wke.buffer),Vae=Ike[0]===68,se=Hs;var oq={};oq.EMPTY_OBJECT=Object.freeze({});oq.EMPTY_ARRAY=Object.freeze([]);var H=oq;var Pke=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),_r=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,Pke,new.target);return f[0]=t??0,f[1]=r??0,f[2]=a??0,f[3]=n??0,f[4]=o??0,f[5]=c??0,f[6]=i??0,f[7]=s??0,f[8]=u??0,f}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(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):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,s=t.x*t.w,a=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-a-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+a-f+p,x=2*(c-s),T=2*(o-u),E=2*(c+s),v=-i-a+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=E,n[6]=y,n[7]=x,n[8]=v,n):new e(g,m,y,A,b,x,T,E,v)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),a=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*a+c*s*r,d=c*a+o*s*r,p=i*a,g=o*r+c*s*a,m=-c*r+o*s*a,y=-s,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],s=t[r+1],a=t[r+2];return i.x=o,i.y=s,i.z=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],s=t[n+6];return i.x=r,i.y=o,i.z=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,Dke),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,Rke),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],sq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],sq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],sq)),n}static getMaximumScale(t){return e.getScale(t,jae),h.maximumComponent(jae)}static setRotation(t,n,i){let r=e.getScale(t,Oke);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,Mke);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}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],s=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=s,i[3]=a,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[3]*o+t[6]*s,c=t[1]*r+t[4]*o+t[7]*s,u=t[2]*r+t[5]*o+t[8]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return 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}static transpose(t,n){let i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=P.EPSILON20,r=10,o=0,s=0;l(n)||(n={});let a=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*Lke(c);for(;s<r&&Fke(c)>u;)Bke(c,sN),e.transpose(sN,Hae),e.multiply(c,sN,c),e.multiply(Hae,c,c),e.multiply(a,sN,a),++o>2&&(++s,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],c=t[2],u=t[5],f=t[8];return n*(s*f-u*a)+o*(u*r-i*f)+c*(i*a-s*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=a*d-f*c,n[1]=f*o-r*d,n[2]=r*c-a*o,n[3]=u*c-s*d,n[4]=i*d-u*o,n[5]=s*o-i*c,n[6]=s*f-u*a,n[7]=u*r-i*f,n[8]=i*a-s*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,Nke),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`};var J=tt;function jS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(jS.prototype=Object.create(Error.prototype),jS.prototype.constructor=jS);jS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=` -${this.stack.toString()}`),e};var ae=jS;function et(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this[0]=e??0,this[1]=o??0,this[2]=l??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=y??0}et.packedLength=16;et.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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};et.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new et),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};et.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*16;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)et.pack(e[o],t,o*16);return t};et.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new C("array length must be a multiple of 16.");let n=e.length;c(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=et.unpack(e,i,t[o])}return t};et.clone=function(e,t){if(c(e))return c(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 et(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])};et.fromArray=et.unpack;et.fromColumnMajorArray=function(e,t){return T.defined("values",e),et.clone(e,t)};et.fromRowMajorArray=function(e,t){return T.defined("values",e),c(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 et(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])};et.fromRotationTranslation=function(e,t,n){return T.typeOf.object("rotation",e),t=t??d.ZERO,c(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 et(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)};et.fromTranslationQuaternionRotationScale=function(e,t,n,i){T.typeOf.object("translation",e),T.typeOf.object("rotation",t),T.typeOf.object("scale",n),c(i)||(i=new et);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,l=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,g=t.y*t.w,m=t.z*t.z,y=t.z*t.w,b=t.w*t.w,x=a-h-m+b,A=2*(l-y),E=2*(u+g),S=2*(l+y),v=-a+h-m+b,P=2*(p-f),M=2*(u-g),R=2*(p+f),L=-a-h+m+b;return i[0]=x*o,i[1]=S*o,i[2]=M*o,i[3]=0,i[4]=A*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=E*s,i[9]=P*s,i[10]=L*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};et.fromTranslationRotationScale=function(e,t){return T.typeOf.object("translationRotationScale",e),et.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};et.fromTranslation=function(e,t){return T.typeOf.object("translation",e),et.fromRotationTranslation(J.IDENTITY,e,t)};et.fromScale=function(e,t){return T.typeOf.object("scale",e),c(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 et(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};et.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(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 et(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};et.fromRotation=function(e,t){return T.typeOf.object("rotation",e),c(t)||(t=new et),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 iT=new d,oT=new d,WS=new d;et.fromCamera=function(e,t){T.typeOf.object("camera",e);let n=e.position,i=e.direction,o=e.up;T.typeOf.object("camera.position",n),T.typeOf.object("camera.direction",i),T.typeOf.object("camera.up",o),d.normalize(i,iT),d.normalize(d.cross(iT,o,oT),oT),d.normalize(d.cross(oT,iT,WS),WS);let r=oT.x,s=oT.y,a=oT.z,l=iT.x,u=iT.y,f=iT.z,h=WS.x,p=WS.y,g=WS.z,m=n.x,y=n.y,b=n.z,x=r*-m+s*-y+a*-b,A=h*-m+p*-y+g*-b,E=l*m+u*y+f*b;return c(t)?(t[0]=r,t[1]=h,t[2]=-l,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=x,t[13]=A,t[14]=E,t[15]=1,t):new et(r,s,a,x,h,p,g,A,-l,-u,-f,E,0,0,0,1)};et.computePerspectiveFieldOfView=function(e,t,n,i,o){T.typeOf.number.greaterThan("fovY",e,0),T.typeOf.number.lessThan("fovY",e,Math.PI),T.typeOf.number.greaterThan("near",n,0),T.typeOf.number.greaterThan("far",i,0),T.typeOf.object("result",o);let s=1/Math.tan(e*.5),a=s/t,l=(i+n)/(n-i),u=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]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};et.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.number("far",r),T.typeOf.object("result",s);let a=1/(t-e),l=1/(i-n),u=1/(r-o),f=-(t+e)*a,h=-(i+n)*l,p=-(r+o)*u;return a*=2,l*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=h,s[14]=p,s[15]=1,s};et.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.number("far",r),T.typeOf.object("result",s);let a=2*o/(t-e),l=2*o/(i-n),u=(t+e)/(t-e),f=(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]=l,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};et.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.object("result",r);let s=2*o/(t-e),a=2*o/(i-n),l=(t+e)/(t-e),u=(i+n)/(i-n),f=-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]=l,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};et.computeViewportTransformation=function(e,t,n,i){c(i)||(i=new et),e=e??W.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let l=s*.5,u=a*.5,f=(n-t)*.5,h=l,p=u,g=f,m=o+l,y=r+u,b=t+f,x=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]=m,i[13]=y,i[14]=b,i[15]=x,i};et.computeView=function(e,t,n,i,o){return T.typeOf.object("position",e),T.typeOf.object("direction",t),T.typeOf.object("up",n),T.typeOf.object("right",i),T.typeOf.object("result",o),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]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};et.toArray=function(e,t){return T.typeOf.object("matrix",e),c(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]]};et.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,3),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};et.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("result",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};et.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=et.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};et.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("result",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};et.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=et.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};et.setTranslation=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("translation",t),T.typeOf.object("result",n),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 DEe=new d;et.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=et.getScale(e,DEe),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 PEe=new d;et.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=et.getScale(e,PEe),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 e5=new d;et.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],e5)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],e5)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],e5)),t};var cZ=new d;et.getMaximumScale=function(e){return et.getScale(e,cZ),d.maximumComponent(cZ)};var IEe=new d;et.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=et.getScale(e,IEe);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 OEe=new d;et.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=et.getScale(e,OEe);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};et.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],u=e[6],f=e[7],h=e[8],p=e[9],g=e[10],m=e[11],y=e[12],b=e[13],x=e[14],A=e[15],E=t[0],S=t[1],v=t[2],P=t[3],M=t[4],R=t[5],L=t[6],B=t[7],_=t[8],w=t[9],D=t[10],I=t[11],N=t[12],k=t[13],H=t[14],V=t[15],j=i*E+a*S+h*v+y*P,U=o*E+l*S+p*v+b*P,q=r*E+u*S+g*v+x*P,X=s*E+f*S+m*v+A*P,te=i*M+a*R+h*L+y*B,K=o*M+l*R+p*L+b*B,Z=r*M+u*R+g*L+x*B,ee=s*M+f*R+m*L+A*B,me=i*_+a*w+h*D+y*I,xe=o*_+l*w+p*D+b*I,ue=r*_+u*w+g*D+x*I,ye=s*_+f*w+m*D+A*I,Ae=i*N+a*k+h*H+y*V,Pe=o*N+l*k+p*H+b*V,Ee=r*N+u*k+g*H+x*V,Ve=s*N+f*k+m*H+A*V;return n[0]=j,n[1]=U,n[2]=q,n[3]=X,n[4]=te,n[5]=K,n[6]=Z,n[7]=ee,n[8]=me,n[9]=xe,n[10]=ue,n[11]=ye,n[12]=Ae,n[13]=Pe,n[14]=Ee,n[15]=Ve,n};et.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};et.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};et.multiplyTransformation=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],u=e[8],f=e[9],h=e[10],p=e[12],g=e[13],m=e[14],y=t[0],b=t[1],x=t[2],A=t[4],E=t[5],S=t[6],v=t[8],P=t[9],M=t[10],R=t[12],L=t[13],B=t[14],_=i*y+s*b+u*x,w=o*y+a*b+f*x,D=r*y+l*b+h*x,I=i*A+s*E+u*S,N=o*A+a*E+f*S,k=r*A+l*E+h*S,H=i*v+s*P+u*M,V=o*v+a*P+f*M,j=r*v+l*P+h*M,U=i*R+s*L+u*B+p,q=o*R+a*L+f*B+g,X=r*R+l*L+h*B+m;return n[0]=_,n[1]=w,n[2]=D,n[3]=0,n[4]=I,n[5]=N,n[6]=k,n[7]=0,n[8]=H,n[9]=V,n[10]=j,n[11]=0,n[12]=U,n[13]=q,n[14]=X,n[15]=1,n};et.multiplyByMatrix3=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("rotation",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],u=e[8],f=e[9],h=e[10],p=t[0],g=t[1],m=t[2],y=t[3],b=t[4],x=t[5],A=t[6],E=t[7],S=t[8],v=i*p+s*g+u*m,P=o*p+a*g+f*m,M=r*p+l*g+h*m,R=i*y+s*b+u*x,L=o*y+a*b+f*x,B=r*y+l*b+h*x,_=i*A+s*E+u*S,w=o*A+a*E+f*S,D=r*A+l*E+h*S;return n[0]=v,n[1]=P,n[2]=M,n[3]=0,n[4]=R,n[5]=L,n[6]=B,n[7]=0,n[8]=_,n[9]=w,n[10]=D,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};et.multiplyByTranslation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("translation",t),T.typeOf.object("result",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],l=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]=l,n[15]=e[15],n};et.multiplyByScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?et.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)};et.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),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};et.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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,l=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=l,n.z=u,n.w=f,n};et.multiplyByPointAsVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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,l=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=l,n};et.multiplyByPoint=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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],l=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=l,n};et.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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};et.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",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};et.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",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};et.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};et.equals=function(e,t){return e===t||c(e)&&c(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]};et.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};et.getTranslation=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};et.getMatrix3=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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 REe=new J,MEe=new J,LEe=new se,NEe=new se(0,0,0,1);et.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],l=e[9],u=e[13],f=e[2],h=e[6],p=e[10],g=e[14],m=e[3],y=e[7],b=e[11],x=e[15],A=p*x,E=g*b,S=h*x,v=g*y,P=h*b,M=p*y,R=f*x,L=g*m,B=f*b,_=p*m,w=f*y,D=h*m,I=A*a+v*l+P*u-(E*a+S*l+M*u),N=E*s+R*l+_*u-(A*s+L*l+B*u),k=S*s+L*a+w*u-(v*s+R*a+D*u),H=M*s+B*a+D*l-(P*s+_*a+w*l),V=E*i+S*o+M*r-(A*i+v*o+P*r),j=A*n+L*o+B*r-(E*n+R*o+_*r),U=v*n+R*i+D*r-(S*n+L*i+w*r),q=P*n+_*i+w*o-(M*n+B*i+D*o);A=o*u,E=r*l,S=i*u,v=r*a,P=i*l,M=o*a,R=n*u,L=r*s,B=n*l,_=o*s,w=n*a,D=i*s;let X=A*y+v*b+P*x-(E*y+S*b+M*x),te=E*m+R*b+_*x-(A*m+L*b+B*x),K=S*m+L*y+w*x-(v*m+R*y+D*x),Z=M*m+B*y+D*b-(P*m+_*y+w*b),ee=S*p+M*g+E*h-(P*g+A*h+v*p),me=B*g+A*f+L*p-(R*p+_*g+E*f),xe=R*h+D*g+v*f-(w*g+S*f+L*h),ue=w*p+P*f+_*h-(B*h+D*p+M*f),ye=n*I+i*N+o*k+r*H;if(Math.abs(ye)<O.EPSILON21){if(J.equalsEpsilon(et.getMatrix3(e,REe),MEe,O.EPSILON7)&&se.equals(et.getRow(e,3,LEe),NEe))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 ye=1/ye,t[0]=I*ye,t[1]=N*ye,t[2]=k*ye,t[3]=H*ye,t[4]=V*ye,t[5]=j*ye,t[6]=U*ye,t[7]=q*ye,t[8]=X*ye,t[9]=te*ye,t[10]=K*ye,t[11]=Z*ye,t[12]=ee*ye,t[13]=me*ye,t[14]=xe*ye,t[15]=ue*ye,t};et.inverseTransformation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],l=e[8],u=e[9],f=e[10],h=e[12],p=e[13],g=e[14],m=-n*h-i*p-o*g,y=-r*h-s*p-a*g,b=-l*h-u*p-f*g;return t[0]=n,t[1]=r,t[2]=l,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=y,t[14]=b,t[15]=1,t};var FEe=new et;et.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),et.inverse(et.transpose(e,FEe),t)};et.IDENTITY=Object.freeze(new et(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));et.COLUMN0ROW0=0;et.COLUMN0ROW1=1;et.COLUMN0ROW2=2;et.COLUMN0ROW3=3;et.COLUMN1ROW0=4;et.COLUMN1ROW1=5;et.COLUMN1ROW2=6;et.COLUMN1ROW3=7;et.COLUMN2ROW0=8;et.COLUMN2ROW1=9;et.COLUMN2ROW2=10;et.COLUMN2ROW3=11;et.COLUMN3ROW0=12;et.COLUMN3ROW1=13;et.COLUMN3ROW2=14;et.COLUMN3ROW3=15;Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}});et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.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]};et.prototype.equalsEpsilon=function(e,t){return et.equalsEpsilon(this,e,t)};et.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`}};_r.packedLength=9;_r.fromArray=_r.unpack;_r.IDENTITY=new _r(1,0,0,0,1,0,0,0,1);_r.ZERO=new _r(0,0,0,0,0,0,0,0,0);_r.COLUMN0ROW0=0;_r.COLUMN0ROW1=1;_r.COLUMN0ROW2=2;_r.COLUMN1ROW0=3;_r.COLUMN1ROW1=4;_r.COLUMN1ROW2=5;_r.COLUMN2ROW0=6;_r.COLUMN2ROW1=7;_r.COLUMN2ROW2=8;var Dke=new h,Rke=new h,sq=new h,jae=new h,Oke=new h,Mke=new h,sN=new _r,Hae=new _r,Nke=new _r;function Lke(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var aq=[1,0,0],cq=[2,2,1];function Fke(e){let t=0;for(let n=0;n<3;++n){let i=e[_r.getElementIndex(cq[n],aq[n])];t+=2*i*i}return Math.sqrt(t)}function Bke(e,t){let n=P.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[_r.getElementIndex(cq[u],aq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=aq[r],c=cq[r];if(Math.abs(e[_r.getElementIndex(c,a)])>n){let u=e[_r.getElementIndex(c,c)],f=e[_r.getElementIndex(a,a)],d=e[_r.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=_r.clone(_r.IDENTITY,t),t[_r.getElementIndex(a,a)]=t[_r.getElementIndex(c,c)]=o,t[_r.getElementIndex(c,a)]=s,t[_r.getElementIndex(a,c)]=-s,t}var $=_r;function OI(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(OI.prototype=Object.create(Error.prototype),OI.prototype.constructor=OI);OI.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var oe=OI;var kke=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),uo=class e{constructor(t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){let b=Reflect.construct(Array,kke,new.target);return b[0]=t??0,b[1]=o??0,b[2]=u??0,b[3]=g??0,b[4]=n??0,b[5]=s??0,b[6]=f??0,b[7]=m??0,b[8]=i??0,b[9]=a??0,b[10]=d??0,b[11]=y??0,b[12]=r??0,b[13]=c??0,b[14]=p??0,b[15]=A??0,b}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,s=i.y,a=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),E=2*(f+m),v=2*(u+A),S=-c+p-y+b,I=2*(g-d),R=2*(f-m),O=2*(g+d),L=-c-p+y+b;return r[0]=x*o,r[1]=v*o,r[2]=R*o,r[3]=0,r[4]=T*s,r[5]=S*s,r[6]=O*s,r[7]=0,r[8]=E*a,r[9]=I*a,r[10]=L*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,pE),h.normalize(h.cross(pE,o,gE),gE),h.normalize(h.cross(gE,pE,MI),MI);let s=gE.x,a=gE.y,c=gE.z,u=pE.x,f=pE.y,d=pE.z,p=MI.x,g=MI.y,m=MI.z,y=i.x,A=i.y,b=i.z,x=s*-y+a*-A+c*-b,T=p*-y+g*-A+m*-b,E=u*y+f*A+d*b;return l(n)?(n[0]=s,n[1]=p,n[2]=-u,n[3]=0,n[4]=a,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=E,n[15]=1,n):new e(s,a,c,x,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let a=1/Math.tan(t*.5),c=a/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,s,a){let c=1/(n-t),u=1/(r-i),f=1/(s-o),d=-(n+t)*c,p=-(r+i)*u,g=-(s+o)*f;return c*=2,u*=2,f*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=f,a[11]=0,a[12]=d,a[13]=p,a[14]=g,a[15]=1,a}static computePerspectiveOffCenter(t,n,i,r,o,s,a){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(s+o)/(s-o),g=-1,m=-2*s*o/(s-o);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=f,a[9]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,s){let a=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*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]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,s=t.y??0,a=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=a*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=s+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(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]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],s=t[r+1],a=t[r+2],c=t[r+3];return i.x=o,i.y=s,i.z=a,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],s=t[n+8],a=t[n+12];return i.x=r,i.y=o,i.z=s,i.w=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,Uke),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,zke),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],lq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],lq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],lq)),n}static getMaximumScale(t){return e.getScale(t,Gae),h.maximumComponent(Gae)}static setRotation(t,n,i){let r=e.getScale(t,Vke);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,jke);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],E=n[0],v=n[1],S=n[2],I=n[3],R=n[4],O=n[5],L=n[6],_=n[7],C=n[8],w=n[9],D=n[10],N=n[11],F=n[12],V=n[13],B=n[14],j=n[15],k=r*E+c*v+p*S+A*I,G=o*E+u*v+g*S+b*I,q=s*E+f*v+m*S+x*I,Q=a*E+d*v+y*S+T*I,W=r*R+c*O+p*L+A*_,J=o*R+u*O+g*L+b*_,Z=s*R+f*O+m*L+x*_,ae=a*R+d*O+y*L+T*_,Ae=r*C+c*w+p*D+A*N,fe=o*C+u*w+g*D+b*N,xe=s*C+f*w+m*D+x*N,ge=a*C+d*w+y*D+T*N,we=r*F+c*V+p*B+A*j,ve=o*F+u*V+g*B+b*j,Re=s*F+f*V+m*B+x*j,Qe=a*F+d*V+y*B+T*j;return i[0]=k,i[1]=G,i[2]=q,i[3]=Q,i[4]=W,i[5]=J,i[6]=Z,i[7]=ae,i[8]=Ae,i[9]=fe,i[10]=xe,i[11]=ge,i[12]=we,i[13]=ve,i[14]=Re,i[15]=Qe,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],E=n[5],v=n[6],S=n[8],I=n[9],R=n[10],O=n[12],L=n[13],_=n[14],C=r*A+a*b+f*x,w=o*A+c*b+d*x,D=s*A+u*b+p*x,N=r*T+a*E+f*v,F=o*T+c*E+d*v,V=s*T+u*E+p*v,B=r*S+a*I+f*R,j=o*S+c*I+d*R,k=s*S+u*I+p*R,G=r*O+a*L+f*_+g,q=o*O+c*L+d*_+m,Q=s*O+u*L+p*_+y;return i[0]=C,i[1]=w,i[2]=D,i[3]=0,i[4]=N,i[5]=F,i[6]=V,i[7]=0,i[8]=B,i[9]=j,i[10]=k,i[11]=0,i[12]=G,i[13]=q,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],E=n[7],v=n[8],S=r*g+a*m+f*y,I=o*g+c*m+d*y,R=s*g+u*m+p*y,O=r*A+a*b+f*x,L=o*A+c*b+d*x,_=s*A+u*b+p*x,C=r*T+a*E+f*v,w=o*T+c*E+d*v,D=s*T+u*E+p*v;return i[0]=S,i[1]=I,i[2]=R,i[3]=0,i[4]=O,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=w,i[10]=D,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,s=n.z,a=r*t[0]+o*t[4]+s*t[8]+t[12],c=r*t[1]+o*t[5]+s*t[9]+t[13],u=r*t[2]+o*t[6]+s*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=a,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,s=n.z;return r===1&&o===1&&s===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=s*t[8],i[9]=s*t[9],i[10]=s*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=n.w,c=t[0]*r+t[4]*o+t[8]*s+t[12]*a,u=t[1]*r+t[5]*o+t[9]*s+t[13]*a,f=t[2]*r+t[6]*o+t[10]*s+t[14]*a,d=t[3]*r+t[7]*o+t[11]*s+t[15]*a;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s,c=t[1]*r+t[5]*o+t[9]*s,u=t[2]*r+t[6]*o+t[10]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s+t[12],c=t[1]*r+t[5]*o+t[9]*s+t[13],u=t[2]*r+t[6]*o+t[10]*s+t[14];return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return 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]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],s=t[6],a=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=s,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,E=m*b,v=p*x,S=m*A,I=p*b,R=g*A,O=d*x,L=m*y,_=d*b,C=g*y,w=d*A,D=p*y,N=T*c+S*u+I*f-(E*c+v*u+R*f),F=E*a+O*u+C*f-(T*a+L*u+_*f),V=v*a+L*c+w*f-(S*a+O*c+D*f),B=R*a+_*c+D*u-(I*a+C*c+w*u),j=E*r+v*o+R*s-(T*r+S*o+I*s),k=T*i+L*o+_*s-(E*i+O*o+C*s),G=S*i+O*r+D*s-(v*i+L*r+w*s),q=I*i+C*r+w*o-(R*i+_*r+D*o);T=o*f,E=s*u,v=r*f,S=s*c,I=r*u,R=o*c,O=i*f,L=s*a,_=i*u,C=o*a,w=i*c,D=r*a;let Q=T*A+S*b+I*x-(E*A+v*b+R*x),W=E*y+O*b+C*x-(T*y+L*b+_*x),J=v*y+L*A+w*x-(S*y+O*A+D*x),Z=R*y+_*A+D*b-(I*y+C*A+w*b),ae=v*g+R*m+E*p-(I*m+T*p+S*g),Ae=_*m+T*d+L*g-(O*g+C*m+E*d),fe=O*p+D*m+S*d-(w*m+v*d+L*p),xe=w*g+I*d+C*p-(_*p+D*g+R*d),ge=i*N+r*F+o*V+s*B;if(Math.abs(ge)<P.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,Hke),Gke,P.EPSILON7)&&se.equals(e.getRow(t,3,Wke),qke))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=N*ge,n[1]=F*ge,n[2]=V*ge,n[3]=B*ge,n[4]=j*ge,n[5]=k*ge,n[6]=G*ge,n[7]=q*ge,n[8]=Q*ge,n[9]=W*ge,n[10]=J*ge,n[11]=Z*ge,n[12]=ae*ge,n[13]=Ae*ge,n[14]=fe*ge,n[15]=xe*ge,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-s*p-a*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=s,n[2]=u,n[3]=0,n[4]=r,n[5]=a,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,Yke),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){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 F=et;var BEe={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},ne=Object.freeze(BEe);var kEe=new d;function wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Qs={};Qs[ne.FLOAT]="float";Qs[ne.FLOAT_VEC2]="vec2";Qs[ne.FLOAT_VEC3]="vec3";Qs[ne.FLOAT_VEC4]="vec4";Qs[ne.INT]="int";Qs[ne.INT_VEC2]="ivec2";Qs[ne.INT_VEC3]="ivec3";Qs[ne.INT_VEC4]="ivec4";Qs[ne.BOOL]="bool";Qs[ne.BOOL_VEC2]="bvec2";Qs[ne.BOOL_VEC3]="bvec3";Qs[ne.BOOL_VEC4]="bvec4";Qs[ne.FLOAT_MAT2]="mat2";Qs[ne.FLOAT_MAT3]="mat3";Qs[ne.FLOAT_MAT4]="mat4";Qs[ne.SAMPLER_2D]="sampler2D";Qs[ne.SAMPLER_CUBE]="samplerCube";wt.prototype.getDeclaration=function(e){let t=`uniform ${Qs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var UEe={czm_viewport:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new wt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,kEe)}}),czm_frameNumber:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new wt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new wt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new wt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new wt({size:9,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},N_=UEe;function VEe(){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 jn=VEe;function zEe(){return!0}function HEe(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){throw new C(t)}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=zEe}var de=HEe;var Is={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT};Is.getSizeInBytes=function(e){switch(e){case Is.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Is.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Is.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")};Is.fromSizeInBytes=function(e){switch(e){case 2:return Is.UNSIGNED_SHORT;case 4:return Is.UNSIGNED_INT;case 1:return Is.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}};Is.validate=function(e){return c(e)&&(e===Is.UNSIGNED_BYTE||e===Is.UNSIGNED_SHORT||e===Is.UNSIGNED_INT)};Is.createTypedArray=function(e,t){if(!c(e))throw new C("numberOfVertices is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Is.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!c(e))throw new C("numberOfVertices is required.");if(!c(t))throw new C("sourceArray is required.");if(!c(n))throw new C("byteOffset is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Is.fromTypedArray=function(e){if(e instanceof Uint8Array)return Is.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Is.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Is.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var Fe=Object.freeze(Is);var pO={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,validate:function(e){return e===pO.STREAM_DRAW||e===pO.STATIC_DRAW||e===pO.DYNAMIC_DRAW}},Be=Object.freeze(pO);function Yu(e){if(e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),!c(e.typedArray)&&!c(e.sizeInBytes))throw new C("Either options.sizeInBytes or options.typedArray is required.");if(c(e.typedArray)&&c(e.sizeInBytes))throw new C("Cannot pass in both options.sizeInBytes and options.typedArray.");if(c(e.typedArray)&&(T.typeOf.object("options.typedArray",e.typedArray),T.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Be.validate(e.usage))throw new C("usage is invalid.");let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=c(i);s&&(o=i.byteLength),T.typeOf.number.greaterThan("sizeInBytes",o,0);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Yu.createVertexBuffer=function(e){return T.defined("options.context",e.context),new Yu({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yu.createIndexBuffer=function(e){if(T.defined("options.context",e.context),!Fe.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===Fe.UNSIGNED_INT&&!e.context.elementIndexUint)throw new C("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");let t=e.context,n=e.indexDatatype,i=Fe.getSizeInBytes(n),o=new Yu({context:t,bufferTarget:ne.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(Yu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yu.prototype._getBuffer=function(){return this._buffer};Yu.prototype.copyFromArrayView=function(e,t){t=t??0,T.defined("arrayView",e),T.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Yu.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new C("A WebGL 2 context is required.");if(!c(e))throw new C("readBuffer must be defined.");if(!c(i)||i<=0)throw new C("sizeInBytes must be defined and be greater than zero.");if(!c(t)||t<0||t+i>e._sizeInBytes)throw new C("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!c(n)||n<0||n+i>this._sizeInBytes)throw new C("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new C("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===ne.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==ne.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==ne.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===ne.ELEMENT_ARRAY_BUFFER)throw new C("Can not copy an index buffer into another buffer type.");let o=ne.COPY_READ_BUFFER,r=ne.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)};Yu.prototype.getBufferData=function(e,t,n,i){if(t=t??0,n=n??0,!this._webgl2)throw new C("A WebGL 2 context is required.");if(!c(e))throw new C("arrayView is required.");let o,r,s=e.byteLength;if(c(i)?(o=i,c(s)?r=1:(s=e.length,r=e.BYTES_PER_ELEMENT)):c(s)?(o=s-n,r=1):(s=e.length,o=s-n,r=e.BYTES_PER_ELEMENT),n<0||n>s)throw new C("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>s)throw new C("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new C("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*r>this._sizeInBytes)throw new C("sourceOffset + length must be less than the buffers size.");let a=this._gl,l=ne.COPY_READ_BUFFER;a.bindBuffer(l,this._buffer),a.getBufferSubData(l,t,e,n,i),a.bindBuffer(l,null)};Yu.prototype.isDestroyed=function(){return!1};Yu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),de(this)};var bt=Yu;var F_,Pr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},al={};Object.defineProperties(al,{element:{get:function(){if(al.supportsFullscreen())return document[Pr.fullscreenElement]}},changeEventName:{get:function(){if(al.supportsFullscreen())return Pr.fullscreenchange}},errorEventName:{get:function(){if(al.supportsFullscreen())return Pr.fullscreenerror}},enabled:{get:function(){if(al.supportsFullscreen())return document[Pr.fullscreenEnabled]}},fullscreen:{get:function(){if(al.supportsFullscreen())return al.element!==null}}});al.supportsFullscreen=function(){if(c(F_))return F_;F_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Pr.requestFullscreen="requestFullscreen",Pr.exitFullscreen="exitFullscreen",Pr.fullscreenEnabled="fullscreenEnabled",Pr.fullscreenElement="fullscreenElement",Pr.fullscreenchange="fullscreenchange",Pr.fullscreenerror="fullscreenerror",F_=!0,F_;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"?(Pr.requestFullscreen=n,F_=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Pr.requestFullscreen=n,F_=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Pr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Pr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Pr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Pr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Pr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Pr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Pr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Pr.fullscreenerror=n)}return F_};al.requestFullscreen=function(e,t){al.supportsFullscreen()&&e[Pr.requestFullscreen]({vrDisplay:t})};al.exitFullscreen=function(){al.supportsFullscreen()&&document[Pr.exitFullscreen]()};al._names=Pr;var Ir=al;var Wa;typeof navigator<"u"?Wa=navigator:Wa={};function v0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var _O,lZ;function s5(){if(!c(_O)&&(_O=!1,!AO())){let e=/ Chrome\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(_O=!0,lZ=v0(e[1]))}return _O}function GEe(){return s5()&&lZ}var gO,uZ;function fZ(){if(!c(gO)&&(gO=!1,!s5()&&!AO()&&/ Safari\/[\.0-9]+/.test(Wa.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(gO=!0,uZ=v0(e[1]))}return gO}function jEe(){return fZ()&&uZ}var yO,o5;function dZ(){if(!c(yO)){yO=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Wa.userAgent);e!==null&&(yO=!0,o5=v0(e[1]),o5.isNightly=!!e[2])}return yO}function WEe(){return dZ()&&o5}var qS,r5;function hZ(){if(!c(qS)){qS=!1;let e;Wa.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Wa.userAgent),e!==null&&(qS=!0,r5=v0(e[1]))):Wa.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Wa.userAgent),e!==null&&(qS=!0,r5=v0(e[1])))}return qS}function qEe(){return hZ()&&r5}var bO,mZ;function AO(){if(!c(bO)){bO=!1;let e=/ Edg\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(bO=!0,mZ=v0(e[1]))}return bO}function YEe(){return AO()&&mZ}var xO,a5;function CO(){if(!c(xO)){xO=!1;let e=/Firefox\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(xO=!0,a5=v0(e[1]))}return xO}var t5;function XEe(){return c(t5)||(t5=/Windows/i.test(Wa.appVersion)),t5}var n5;function KEe(){return c(n5)||(n5=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),n5}function $Ee(){return CO()&&a5}var i5;function ZEe(){return c(i5)||(i5=!CO()&&typeof PointerEvent<"u"&&(!c(Wa.pointerEnabled)||Wa.pointerEnabled)),i5}var pZ,TO;function _Z(){if(!c(TO)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;TO=c(t)&&t!=="",TO&&(pZ=t)}return TO}function QEe(){return _Z()?pZ:void 0}function ja(){if(!ja.initialized)throw new C("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return ja._result}ja._promise=void 0;ja._result=void 0;ja.initialize=function(){return c(ja._promise)||(ja._promise=new Promise(e=>{let t=new Image;t.onload=function(){ja._result=t.width>0&&t.height>0,e(ja._result)},t.onerror=function(){ja._result=!1,e(ja._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ja._promise};Object.defineProperties(ja,{initialized:{get:function(){return c(ja._result)}}});var rT=[];typeof ArrayBuffer<"u"&&(rT.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&rT.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&rT.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&rT.push(BigInt64Array),typeof BigUint64Array<"u"&&rT.push(BigUint64Array));var Xu={isChrome:s5,chromeVersion:GEe,isSafari:fZ,safariVersion:jEe,isWebkit:dZ,webkitVersion:WEe,isInternetExplorer:hZ,internetExplorerVersion:qEe,isEdge:AO,edgeVersion:YEe,isFirefox:CO,firefoxVersion:$Ee,isWindows:XEe,isIPadOrIOS:KEe,hardwareConcurrency:Wa.hardwareConcurrency??3,supportsPointerEvents:ZEe,supportsImageRenderingPixelated:_Z,supportsWebP:ja,imageRenderingValue:QEe,typedArrayTypes:rT};Xu.supportsBasis=function(e){return Xu.supportsWebAssembly()&&e.context.supportsBasis};Xu.supportsFullscreen=function(){return Ir.supportsFullscreen()};Xu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Xu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Xu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Xu.supportsBigInt=function(){return typeof BigInt<"u"};Xu.supportsWebWorkers=function(){return typeof Worker<"u"};Xu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Xu.supportsWebgl2=function(e){return T.defined("scene",e),e.context.webgl2};Xu.supportsEsmWebWorkers=function(){return!CO()||parseInt(a5)>=114};var zt=Xu;function c5(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=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}re.fromCartesian4=function(e,t){return T.typeOf.object("cartesian",e),c(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(e??255),t=re.byteToFloat(t??255),n=re.byteToFloat(n??255),i=re.byteToFloat(i??255),c(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 T.typeOf.object("color",e),T.typeOf.number("alpha",t),c(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 l5,u5,ip;zt.supportsTypedArrays()&&(l5=new ArrayBuffer(4),u5=new Uint32Array(l5),ip=new Uint8Array(l5));re.fromRgba=function(e,t){return u5[0]=e,re.fromBytes(ip[0],ip[1],ip[2],ip[3],t)};re.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;let u=2*n-l;r=c5(u,l,e+1/3),s=c5(u,l,e),a=c5(u,l,e-1/3)}return c(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=e??W.EMPTY_OBJECT;let n=e.red;if(!c(n)){let s=e.minimumRed??0,a=e.maximumRed??1;T.typeOf.number.lessThanOrEquals("minimumRed",s,a),n=s+O.nextRandomNumber()*(a-s)}let i=e.green;if(!c(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;T.typeOf.number.lessThanOrEquals("minimumGreen",s,a),i=s+O.nextRandomNumber()*(a-s)}let o=e.blue;if(!c(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;T.typeOf.number.lessThanOrEquals("minimumBlue",s,a),o=s+O.nextRandomNumber()*(a-s)}let r=e.alpha;if(!c(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;T.typeOf.number.lessThanOrEquals("minimumAlpha",s,a),r=s+O.nextRandomNumber()*(a-s)}return c(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var JEe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,eSe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,tSe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,nSe=/^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){T.typeOf.string("color",e),c(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(c(n))return re.clone(n,t),t;let i=JEe.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(i[4]??"f",16)/15,t):(i=eSe.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(i[4]??"ff",16)/255,t):(i=tSe.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(i[4]??"1.0"),t):(i=nSe.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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.defined("array",e),t=t??0,c(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(c(e))return c(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||c(e)&&c(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||c(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 c(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return ip[0]=re.floatToByte(this.red),ip[1]=re.floatToByte(this.green),ip[2]=re.floatToByte(this.blue),ip[3]=re.floatToByte(this.alpha),u5[0]};re.prototype.brighten=function(e,t){return T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),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 T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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 T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),i.red=O.lerp(e.red,t.red,n),i.green=O.lerp(e.green,t.green,n),i.blue=O.lerp(e.blue,t.blue,n),i.alpha=O.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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 T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),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 G=re;function EO(e){e=e??W.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}EO.ALL=Object.freeze(new EO({color:new G(0,0,0,0),depth:1,stencil:0}));EO.prototype.execute=function(e,t){e.clear(this,t)};var ti=EO;var iSe={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},De=Object.freeze(iSe);function gZ(e){e=e??W.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=e.persists??!1,this.pass=De.COMPUTE,this.owner=e.owner}gZ.prototype.execute=function(e){e.execute(this)};var cl=gZ;function Ft(e,t){this.x=e??0,this.y=t??0}Ft.fromElements=function(e,t,n){return c(n)?(n.x=e,n.y=t,n):new Ft(e,t)};Ft.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t):new Ft(e.x,e.y)};Ft.fromCartesian3=Ft.clone;Ft.fromCartesian4=Ft.clone;Ft.packedLength=2;Ft.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n]=e.y,t};Ft.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Ft),n.x=e[t++],n.y=e[t],n};Ft.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*2;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Ft.pack(e[o],t,o*2);return t};Ft.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new C("array length must be a multiple of 2.");let n=e.length;c(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ft.unpack(e,i,t[o])}return t};Ft.fromArray=Ft.unpack;Ft.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y)};Ft.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y)};Ft.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ft.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ft.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ft.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y};Ft.magnitude=function(e){return Math.sqrt(Ft.magnitudeSquared(e))};var SO=new Ft;Ft.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.subtract(e,t,SO),Ft.magnitude(SO)};Ft.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.subtract(e,t,SO),Ft.magnitudeSquared(SO)};Ft.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Ft.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new C("normalized result is not a number");return t};Ft.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y};Ft.cross=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.y-e.y*t.x};Ft.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n};Ft.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n};Ft.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n};Ft.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n};Ft.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n};Ft.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n};Ft.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t};Ft.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var yZ=new Ft;Ft.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),Ft.multiplyByScalar(t,n,yZ),i=Ft.multiplyByScalar(e,1-n,i),Ft.add(yZ,i,i)};var bZ=new Ft,xZ=new Ft;Ft.angleBetween=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.normalize(e,bZ),Ft.normalize(t,xZ),O.acosClamped(Ft.dot(bZ,xZ))};var oSe=new Ft;Ft.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Ft.normalize(e,oSe);return Ft.abs(n,n),n.x<=n.y?t=Ft.clone(Ft.UNIT_X,t):t=Ft.clone(Ft.UNIT_Y,t),t};Ft.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y};Ft.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ft.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)};Ft.ZERO=Object.freeze(new Ft(0,0));Ft.ONE=Object.freeze(new Ft(1,1));Ft.UNIT_X=Object.freeze(new Ft(1,0));Ft.UNIT_Y=Object.freeze(new Ft(0,1));Ft.prototype.clone=function(e){return Ft.clone(this,e)};Ft.prototype.equals=function(e){return Ft.equals(this,e)};Ft.prototype.equalsEpsilon=function(e,t,n){return Ft.equalsEpsilon(this,e,t,n)};Ft.prototype.toString=function(){return`(${this.x}, ${this.y})`};var z=Ft;var rSe=new d,sSe=new d;function aSe(e,t,n,i,o){if(!c(e))throw new C("cartesian is required.");if(!c(t))throw new C("oneOverRadii is required.");if(!c(n))throw new C("oneOverRadiiSquared is required.");if(!c(i))throw new C("centerToleranceSquared is required.");let r=e.x,s=e.y,a=e.z,l=t.x,u=t.y,f=t.z,h=r*r*l*l,p=s*s*u*u,g=a*a*f*f,m=h+p+g,y=Math.sqrt(1/m),b=d.multiplyByScalar(e,y,rSe);if(m<i)return isFinite(y)?d.clone(b,o):void 0;let x=n.x,A=n.y,E=n.z,S=sSe;S.x=b.x*x*2,S.y=b.y*A*2,S.z=b.z*E*2;let v=(1-y)*d.magnitude(e)/(.5*d.magnitude(S)),P=0,M,R,L,B,_,w,D,I,N,k,H;do{v-=P,L=1/(1+v*x),B=1/(1+v*A),_=1/(1+v*E),w=L*L,D=B*B,I=_*_,N=w*L,k=D*B,H=I*_,M=h*w+p*D+g*I-1,R=h*N*x+p*k*A+g*H*E;let V=-2*R;P=M/V}while(Math.abs(M)>O.EPSILON12);return c(o)?(o.x=r*L,o.y=s*B,o.z=a*_,o):new d(r*L,s*B,a*_)}var sT=aSe;function Ro(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}Ro.fromRadians=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0,c(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Ro(e,t,n)};Ro.fromDegrees=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),Ro.fromRadians(e,t,n,i)};var cSe=new d,lSe=new d,uSe=new d;Ro._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);Ro._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Ro._ellipsoidCenterToleranceSquared=O.EPSILON1;Ro.fromCartesian=function(e,t,n){let i=c(t)?t.oneOverRadii:Ro._ellipsoidOneOverRadii,o=c(t)?t.oneOverRadiiSquared:Ro._ellipsoidOneOverRadiiSquared,r=c(t)?t._centerToleranceSquared:Ro._ellipsoidCenterToleranceSquared,s=sT(e,i,o,r,lSe);if(!c(s))return;let a=d.multiplyComponents(s,o,cSe);a=d.normalize(a,a);let l=d.subtract(e,s,uSe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=O.sign(d.dot(l,e))*d.magnitude(l);return c(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new Ro(u,f,h)};Ro.toCartesian=function(e,t,n){return T.defined("cartographic",e),d.fromRadians(e.longitude,e.latitude,e.height,t,n)};Ro.clone=function(e,t){if(c(e))return c(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Ro(e.longitude,e.latitude,e.height)};Ro.equals=function(e,t){return e===t||c(e)&&c(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Ro.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Ro.ZERO=Object.freeze(new Ro(0,0,0));Ro.prototype.clone=function(e){return Ro.clone(this,e)};Ro.prototype.equals=function(e){return Ro.equals(this,e)};Ro.prototype.equalsEpsilon=function(e,t){return Ro.equalsEpsilon(this,e,t)};Ro.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Ro;function AZ(e,t,n,i){t=t??0,n=n??0,i=i??0,T.typeOf.number.greaterThanOrEquals("x",t,0),T.typeOf.number.greaterThanOrEquals("y",n,0),T.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(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=O.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function mi(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,AZ(this,e,t,n)}Object.defineProperties(mi.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}}});mi.clone=function(e,t){if(!c(e))return;let n=e._radii;return c(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new mi(n.x,n.y,n.z)};mi.fromCartesian3=function(e,t){return c(t)||(t=new mi),c(e)&&AZ(t,e.x,e.y,e.z),t};mi.WGS84=Object.freeze(new mi(6378137,6378137,6356752314245179e-9));mi.UNIT_SPHERE=Object.freeze(new mi(1,1,1));mi.MOON=Object.freeze(new mi(O.LUNAR_RADIUS,O.LUNAR_RADIUS,O.LUNAR_RADIUS));mi._default=mi.WGS84;Object.defineProperties(mi,{default:{get:function(){return mi._default},set:function(e){T.typeOf.object("value",e),mi._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});mi.prototype.clone=function(e){return mi.clone(this,e)};mi.packedLength=d.packedLength;mi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._radii,t,n),t};mi.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t);return mi.fromCartesian3(i,n)};mi.prototype.geocentricSurfaceNormal=d.normalize;mi.prototype.geodeticSurfaceNormalCartographic=function(e,t){T.typeOf.object("cartographic",e);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 c(t)||(t=new d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};mi.prototype.geodeticSurfaceNormal=function(e,t){if(T.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new C("cartesian has a NaN component");if(!d.equalsEpsilon(e,d.ZERO,O.EPSILON14))return c(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var fSe=new d,dSe=new d;mi.prototype.cartographicToCartesian=function(e,t){let n=fSe,i=dSe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),c(t)||(t=new d),d.add(i,n,t)};mi.prototype.cartographicArrayToCartesianArray=function(e,t){T.defined("cartographics",e);let n=e.length;c(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 hSe=new d,mSe=new d,pSe=new d;mi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,mSe);if(!c(n))return;let i=this.geodeticSurfaceNormal(n,hSe),o=d.subtract(e,n,pSe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=O.sign(d.dot(o,e))*d.magnitude(o);return c(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};mi.prototype.cartesianArrayToCartographicArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(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};mi.prototype.scaleToGeodeticSurface=function(e,t){return sT(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};mi.prototype.scaleToGeocentricSurface=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new d);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 d.multiplyByScalar(e,s,t)};mi.prototype.transformPositionToScaledSpace=function(e,t){return c(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};mi.prototype.transformPositionFromScaledSpace=function(e,t){return c(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};mi.prototype.equals=function(e){return this===e||c(e)&&d.equals(this._radii,e._radii)};mi.prototype.toString=function(){return this._radii.toString()};mi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(T.typeOf.object("position",e),!O.equalsEpsilon(this._radii.x,this._radii.y,O.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");T.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=t??0;let i=this._squaredXOverSquaredZ;if(c(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var _Se=new d;mi.prototype.getLocalCurvature=function(e,t){T.typeOf.object("surfacePosition",e),c(t)||(t=new z);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,_Se),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return z.fromElements(1/i,1/r,t)};var gSe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],ySe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function TZ(e,t,n){T.typeOf.number("a",e),T.typeOf.number("b",t),T.typeOf.func("func",n);let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*gSe[s];r+=ySe[s]*(n(i+a)+n(i-a))}return r*=o,r}mi.prototype.surfaceArea=function(e){T.typeOf.object("rectangle",e);let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=O.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,l=r.z,u=s*a;return TZ(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*TZ(t,n,function(g){let m=Math.cos(g),y=Math.sin(g);return Math.sqrt(u*p*p+l*(a*m*m+s*y*y)*h*h)})})};var ie=mi;function wO(e){this._ellipsoid=e??ie.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(wO.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});wO.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};wO.prototype.unproject=function(e,t){if(!c(e))throw new C("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Oi=wO;var bSe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Wt=Object.freeze(bSe);function xSe(e,t,n){T.defined("array",e),T.defined("itemToFind",t),T.defined("comparator",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 Mo=xSe;function TSe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var D0=TSe;function ASe(e){if(e===null||isNaN(e))throw new C("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var Th=ASe;var CZ=[31,28,31,30,31,30,31,31,30,31,30,31];function CSe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,y(),b(),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 y(){T.typeOf.number.greaterThanOrEquals("Year",e,1),T.typeOf.number.lessThanOrEquals("Year",e,9999),T.typeOf.number.greaterThanOrEquals("Month",t,1),T.typeOf.number.lessThanOrEquals("Month",t,12),T.typeOf.number.greaterThanOrEquals("Day",n,1),T.typeOf.number.lessThanOrEquals("Day",n,31),T.typeOf.number.greaterThanOrEquals("Hour",i,0),T.typeOf.number.lessThanOrEquals("Hour",i,23),T.typeOf.number.greaterThanOrEquals("Minute",o,0),T.typeOf.number.lessThanOrEquals("Minute",o,59),T.typeOf.bool("IsLeapSecond",a),T.typeOf.number.greaterThanOrEquals("Second",r,0),T.typeOf.number.lessThanOrEquals("Second",r,a?60:59),T.typeOf.number.greaterThanOrEquals("Millisecond",s,0),T.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let x=t===2&&Th(e)?CZ[t-1]+1:CZ[t-1];if(n>x)throw new C("Month and Day represents invalid date")}}var op=CSe;function ESe(e,t){this.julianDate=e,this.offset=t}var Yi=ESe;var SSe={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},qn=Object.freeze(SSe);var wSe={UTC:0,TAI:1},Wn=Object.freeze(wSe);var SZ=new op,vO=[31,28,31,30,31,30,31,31,30,31,30,31],DO=29;function f5(e,t){return It.compare(e.julianDate,t.julianDate)}var aT=new Yi;function IO(e){aT.julianDate=e;let t=It.leapSeconds,n=Mo(t,aT,f5);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&It.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),It.addSeconds(e,i,e)}function EZ(e,t){aT.julianDate=e;let n=It.leapSeconds,i=Mo(n,aT,f5);if(i<0&&(i=~i),i===0)return It.addSeconds(e,-n[0].offset,t);if(i>=n.length)return It.addSeconds(e,-n[i-1].offset,t);let o=It.secondsDifference(n[i].julianDate,e);if(o===0)return It.addSeconds(e,-n[i].offset,t);if(!(o<=1))return It.addSeconds(e,-n[--i].offset,t)}function B_(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d5(e,t,n,i,o,r,s){let a=(t-14)/12|0,l=e+4800+a,u=(1461*l/4|0)+(367*(t-2-12*a)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var vSe=/^(\d{4})$/,DSe=/^(\d{4})-(\d{2})$/,PSe=/^(\d{4})-?(\d{3})$/,ISe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,OSe=/^(\d{4})-?(\d{2})-?(\d{2})$/,h5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,RSe=/^(\d{2})(\.\d+)?/.source+h5.source,MSe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+h5.source,LSe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+h5.source,sd="Invalid ISO 8601 date.";function It(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Wn.UTC;let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,B_(i,t,this),n===Wn.UTC&&IO(this)}It.fromGregorianDate=function(e,t){if(!(e instanceof op))throw new C("date must be a valid GregorianDate.");let n=d5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return c(t)?(B_(n[0],n[1],t),IO(t),t):new It(n[0],n[1],Wn.UTC)};It.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");let n=d5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return c(t)?(B_(n[0],n[1],t),IO(t),t):new It(n[0],n[1],Wn.UTC)};It.fromIso8601=function(e,t){if(typeof e!="string")throw new C(sd);e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,l=0,u=0,f=n[0],h=n[1],p,g;if(!c(f))throw new C(sd);let m;if(n=f.match(OSe),n!==null){if(m=f.split("-").length-1,m>0&&m!==2)throw new C(sd);i=+n[1],o=+n[2],r=+n[3]}else if(n=f.match(DSe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(vSe),n!==null)i=+n[1];else{let A;if(n=f.match(PSe),n!==null){if(i=+n[1],A=+n[2],g=Th(i),A<1||g&&A>366||!g&&A>365)throw new C(sd)}else if(n=f.match(ISe),n!==null){i=+n[1];let E=+n[2],S=+n[3]||0;if(m=f.split("-").length-1,m>0&&(!c(n[3])&&m!==1||c(n[3])&&m!==2))throw new C(sd);let v=new Date(Date.UTC(i,0,4));A=E*7+S-v.getUTCDay()-3}else throw new C(sd);p=new Date(Date.UTC(i,0,1)),p.setUTCDate(A),o=p.getUTCMonth()+1,r=p.getUTCDate()}if(g=Th(i),o<1||o>12||r<1||(o!==2||!g)&&r>vO[o-1]||g&&o===2&&r>DO)throw new C(sd);let y;if(c(h)){if(n=h.match(LSe),n!==null){if(m=h.split(":").length-1,m>0&&m!==2&&m!==3)throw new C(sd);s=+n[1],a=+n[2],l=+n[3],u=+(n[4]||0)*1e3,y=5}else if(n=h.match(MSe),n!==null){if(m=h.split(":").length-1,m>2)throw new C(sd);s=+n[1],a=+n[2],l=+(n[3]||0)*60,y=4}else if(n=h.match(RSe),n!==null)s=+n[1],a=+(n[2]||0)*60,y=3;else throw new C(sd);if(a>=60||l>=61||s>24||s===24&&(a>0||l>0||u>0))throw new C(sd);let A=n[y],E=+n[y+1],S=+(n[y+2]||0);switch(A){case"+":s=s-E,a=a-S;break;case"-":s=s+E,a=a+S;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let b=l===60;for(b&&l--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?DO:vO[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?DO:vO[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?DO:vO[o-1],r+=p;let x=d5(i,o,r,s,a,l,u);return c(t)?(B_(x[0],x[1],t),IO(t)):t=new It(x[0],x[1],Wn.UTC),b&&It.addSeconds(t,1,t),t};It.now=function(e){return It.fromDate(new Date,e)};var PO=new It(0,0,Wn.TAI);It.toGregorianDate=function(e,t){if(!c(e))throw new C("julianDate is required.");let n=!1,i=EZ(e,PO);c(i)||(It.addSeconds(e,-1,PO),i=EZ(PO,PO),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 l=4e3*(s+1)/1461001|0;s=s-(1461*l/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,p=100*(a-49)+l+s|0,g=r/qn.SECONDS_PER_HOUR|0,m=r-g*qn.SECONDS_PER_HOUR,y=m/qn.SECONDS_PER_MINUTE|0;m=m-y*qn.SECONDS_PER_MINUTE;let b=m|0,x=(m-b)/qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),c(t)?(t.year=p,t.month=h,t.day=f,t.hour=g,t.minute=y,t.second=b,t.millisecond=x,t.isLeapSecond=n,t):new op(p,h,f,g,y,b,x,n)};It.toDate=function(e){if(!c(e))throw new C("julianDate is required.");let t=It.toGregorianDate(e,SZ),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))};It.toIso8601=function(e,t){if(!c(e))throw new C("julianDate is required.");let n=It.toGregorianDate(e,SZ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,l=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&l===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!c(t)&&u!==0){let h=u*.01;return f=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")}:${l.toString().padStart(2,"0")}.${f}Z`}return!c(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")}:${l.toString().padStart(2,"0")}Z`:(f=(u*.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")}:${l.toString().padStart(2,"0")}.${f}Z`)};It.clone=function(e,t){if(c(e))return c(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new It(e.dayNumber,e.secondsOfDay,Wn.TAI)};It.compare=function(e,t){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};It.equals=function(e,t){return e===t||c(e)&&c(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};It.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(It.secondsDifference(e,t))<=n};It.totalDays=function(e){if(!c(e))throw new C("julianDate is required.");return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};It.secondsDifference=function(e,t){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};It.daysDifference=function(e,t){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};It.computeTaiMinusUtc=function(e){aT.julianDate=e;let t=It.leapSeconds,n=Mo(t,aT,f5);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};It.addSeconds=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("seconds is required.");if(!c(n))throw new C("result is required.");return B_(e.dayNumber,e.secondsOfDay+t,n)};It.addMinutes=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("minutes is required.");if(!c(n))throw new C("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return B_(e.dayNumber,i,n)};It.addHours=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("hours is required.");if(!c(n))throw new C("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return B_(e.dayNumber,i,n)};It.addDays=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("days is required.");if(!c(n))throw new C("result is required.");let i=e.dayNumber+t;return B_(i,e.secondsOfDay,n)};It.lessThan=function(e,t){return It.compare(e,t)<0};It.lessThanOrEquals=function(e,t){return It.compare(e,t)<=0};It.greaterThan=function(e,t){return It.compare(e,t)>0};It.greaterThanOrEquals=function(e,t){return It.compare(e,t)>=0};It.prototype.clone=function(e){return It.clone(this,e)};It.prototype.equals=function(e){return It.equals(this,e)};It.prototype.equalsEpsilon=function(e,t){return It.equalsEpsilon(this,e,t)};It.prototype.toString=function(){return It.toIso8601(this)};It.leapSeconds=[new Yi(new It(2441317,43210,Wn.TAI),10),new Yi(new It(2441499,43211,Wn.TAI),11),new Yi(new It(2441683,43212,Wn.TAI),12),new Yi(new It(2442048,43213,Wn.TAI),13),new Yi(new It(2442413,43214,Wn.TAI),14),new Yi(new It(2442778,43215,Wn.TAI),15),new Yi(new It(2443144,43216,Wn.TAI),16),new Yi(new It(2443509,43217,Wn.TAI),17),new Yi(new It(2443874,43218,Wn.TAI),18),new Yi(new It(2444239,43219,Wn.TAI),19),new Yi(new It(2444786,43220,Wn.TAI),20),new Yi(new It(2445151,43221,Wn.TAI),21),new Yi(new It(2445516,43222,Wn.TAI),22),new Yi(new It(2446247,43223,Wn.TAI),23),new Yi(new It(2447161,43224,Wn.TAI),24),new Yi(new It(2447892,43225,Wn.TAI),25),new Yi(new It(2448257,43226,Wn.TAI),26),new Yi(new It(2448804,43227,Wn.TAI),27),new Yi(new It(2449169,43228,Wn.TAI),28),new Yi(new It(2449534,43229,Wn.TAI),29),new Yi(new It(2450083,43230,Wn.TAI),30),new Yi(new It(2450630,43231,Wn.TAI),31),new Yi(new It(2451179,43232,Wn.TAI),32),new Yi(new It(2453736,43233,Wn.TAI),33),new Yi(new It(2454832,43234,Wn.TAI),34),new Yi(new It(2456109,43235,Wn.TAI),35),new Yi(new It(2457204,43236,Wn.TAI),36),new Yi(new It(2457754,43237,Wn.TAI),37)];var Q=It;var jZ=jr(ql(),1);function NSe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var LO=NSe;function RZ(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=RZ(o,t)),n[i]=o}return n}var We=RZ;function MZ(e,t,n){n=n??!1;let i={},o=c(e),r=c(t),s,a,l;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(l=t[s],typeof l=="object"?i[s]=MZ(a,l,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(l=t[s],i[s]=l);return i}var xt=MZ;function FSe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Yl=FSe;var LZ=jr(ql(),1);function m5(e,t){let n;return typeof document<"u"&&(n=document),m5._implementation(e,t,n)}m5._implementation=function(e,t,n){if(!c(e))throw new C("relative uri is required.");if(!c(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new LZ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var rp=m5;var NZ=jr(ql(),1);function BSe(e,t){if(!c(e))throw new C("uri is required.");let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new NZ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var NO=BSe;var FZ=jr(ql(),1);function kSe(e){if(!c(e))throw new C("uri is required.");let t=new FZ.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 uT=kSe;var BZ={};function USe(e,t,n){c(t)||(t=e.width),c(n)||(n=e.height);let i=BZ[t];c(i)||(i={},BZ[t]=i);let o=i[n];if(!c(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 Ah=USe;var VSe=/^blob:/i;function zSe(e){return T.typeOf.string("uri",e),VSe.test(e)}var fT=zSe;var Ch;function HSe(e){c(Ch)||(Ch=document.createElement("a")),Ch.href=window.location.href;let t=Ch.host,n=Ch.protocol;return Ch.href=e,Ch.href=Ch.href,n!==Ch.protocol||t!==Ch.host}var P0=HSe;var GSe=/^data:/i;function jSe(e){return T.typeOf.string("uri",e),GSe.test(e)}var k_=jSe;function WSe(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 dT=WSe;function qSe(e){if(!c(e))throw new C("obj is required.");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 hT=qSe;function YSe(e){if(!c(e))throw new C("queryString is required.");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];c(a)?a=decodeURIComponent(a):a="";let l=t[s];typeof l=="string"?t[s]=[l,a]:Array.isArray(l)?l.push(a):t[s]=a}return t}var Ku=YSe;var XSe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Zn=Object.freeze(XSe);var KSe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},gs=Object.freeze(KSe);function FO(e){e=e??W.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??gs.OTHER,this.serverKey=e.serverKey,this.state=Zn.UNISSUED,this.deferred=void 0,this.cancelled=!1}FO.prototype.cancel=function(){this.cancelled=!0};FO.prototype.clone=function(e){return c(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=Zn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new FO(this)};var ir=FO;function $Se(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 BO=$Se;function kZ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=BO(this.responseHeaders))}kZ.prototype.toString=function(){let e="Request has failed.";return c(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var sp=kZ;var UO=jr(ql(),1);function YS(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(YS.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});YS.prototype.addEventListener=function(e,t){T.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};YS.prototype.removeEventListener=function(e,t){T.typeOf.func("listener",e);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 ZSe(e,t){return t-e}YS.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];c(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(ZSe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var pe=YS;function I0(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(I0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);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 p5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}I0.prototype.reserve=function(e){e=e??this._length,this._array.length=e};I0.prototype.heapify=function(e){e=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?(p5(i,o,e),e=o):r=!1}};I0.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};I0.prototype.insert=function(e){T.defined("element",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)p5(t,o,s),o=s;else break}let r;return c(i)&&this._length>i&&(r=t[i],this._length=i),r};I0.prototype.pop=function(e){if(e=e??0,this._length===0)return;T.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return p5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var kO=I0;function QSe(e,t){return e.priority-t.priority}var Zi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},mT=20,qa=new kO({comparator:QSe});qa.maximumLength=mT;qa.reserve(mT);var Eh=[],ap={},JSe=typeof document<"u"?new UO.default(document.location.href):new UO.default,VO=new pe;function Ho(){}Ho.maximumRequests=50;Ho.maximumRequestsPerServer=18;Ho.requestsByServer={};Ho.throttleRequests=!0;Ho.debugShowStatistics=!1;Ho.requestCompletedEvent=VO;Object.defineProperties(Ho,{statistics:{get:function(){return Zi}},priorityHeapLength:{get:function(){return mT},set:function(e){if(e<mT)for(;qa.length>e;){let t=qa.pop();O0(t)}mT=e,qa.maximumLength=e,qa.reserve(e)}}});function UZ(e){c(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ho.serverHasOpenSlots=function(e,t){t=t??1;let n=Ho.requestsByServer[e]??Ho.maximumRequestsPerServer;return ap[e]+t<=n};Ho.heapHasOpenSlots=function(e){return qa.length+e<=mT};function VZ(e){return e.state===Zn.UNISSUED&&(e.state=Zn.ISSUED,e.deferred=Yl()),e.deferred.promise}function ewe(e){return function(t){if(e.state===Zn.CANCELLED)return;let n=e.deferred;--Zi.numberOfActiveRequests,--ap[e.serverKey],VO.raiseEvent(),e.state=Zn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function twe(e){return function(t){e.state!==Zn.CANCELLED&&(++Zi.numberOfFailedRequests,--Zi.numberOfActiveRequests,--ap[e.serverKey],VO.raiseEvent(t),e.state=Zn.FAILED,e.deferred.reject(t))}}function zZ(e){let t=VZ(e);return e.state=Zn.ACTIVE,Eh.push(e),++Zi.numberOfActiveRequests,++Zi.numberOfActiveRequestsEver,++ap[e.serverKey],e.requestFunction().then(ewe(e)).catch(twe(e)),t}function O0(e){let t=e.state===Zn.ACTIVE;if(e.state=Zn.CANCELLED,++Zi.numberOfCancelledRequests,c(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Zi.numberOfActiveRequests,--ap[e.serverKey],++Zi.numberOfCancelledActiveRequests),c(e.cancelFunction)&&e.cancelFunction()}Ho.update=function(){let e,t,n=0,i=Eh.length;for(e=0;e<i;++e){if(t=Eh[e],t.cancelled&&O0(t),t.state!==Zn.ACTIVE){++n;continue}n>0&&(Eh[e-n]=t)}Eh.length-=n;let o=qa.internalArray,r=qa.length;for(e=0;e<r;++e)UZ(o[e]);qa.resort();let s=Math.max(Ho.maximumRequests-Eh.length,0),a=0;for(;a<s&&qa.length>0;){if(t=qa.pop(),t.cancelled){O0(t);continue}if(t.throttleByServer&&!Ho.serverHasOpenSlots(t.serverKey)){O0(t);continue}zZ(t),++a}nwe()};Ho.getServerKey=function(e){T.typeOf.string("url",e);let t=new UO.default(e);t.scheme()===""&&(t=t.absoluteTo(JSe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=ap[n];return c(i)||(ap[n]=0),n};Ho.request=function(e){if(T.typeOf.object("request",e),T.typeOf.string("request.url",e.url),T.typeOf.func("request.requestFunction",e.requestFunction),k_(e.url)||fT(e.url))return VO.raiseEvent(),e.state=Zn.RECEIVED,e.requestFunction();if(++Zi.numberOfAttemptedRequests,c(e.serverKey)||(e.serverKey=Ho.getServerKey(e.url)),Ho.throttleRequests&&e.throttleByServer&&!Ho.serverHasOpenSlots(e.serverKey))return;if(!Ho.throttleRequests||!e.throttle)return zZ(e);if(Eh.length>=Ho.maximumRequests)return;UZ(e);let t=qa.insert(e);if(c(t)){if(t===e)return;O0(t)}return VZ(e)};function nwe(){Ho.debugShowStatistics&&(Zi.numberOfActiveRequests===0&&Zi.lastNumberOfActiveRequests>0&&(Zi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Zi.numberOfAttemptedRequests}`),Zi.numberOfAttemptedRequests=0),Zi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Zi.numberOfCancelledRequests}`),Zi.numberOfCancelledRequests=0),Zi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Zi.numberOfCancelledActiveRequests}`),Zi.numberOfCancelledActiveRequests=0),Zi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Zi.numberOfFailedRequests}`),Zi.numberOfFailedRequests=0)),Zi.lastNumberOfActiveRequests=Zi.numberOfActiveRequests)}Ho.clearForSpecs=function(){for(;qa.length>0;){let t=qa.pop();O0(t)}let e=Eh.length;for(let t=0;t<e;++t)O0(Eh[t]);Eh.length=0,ap={},Zi.numberOfAttemptedRequests=0,Zi.numberOfActiveRequests=0,Zi.numberOfCancelledRequests=0,Zi.numberOfCancelledActiveRequests=0,Zi.numberOfFailedRequests=0,Zi.numberOfActiveRequestsEver=0,Zi.lastNumberOfActiveRequests=0};Ho.numberOfActiveRequestsByServer=function(e){return ap[e]};Ho.requestHeap=qa;var Tc=Ho;var HZ=jr(ql(),1);var XS={},pT={};XS.add=function(e,t){if(!c(e))throw new C("host is required.");if(!c(t)||t<=0)throw new C("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(pT[n])||(pT[n]=!0)};XS.remove=function(e,t){if(!c(e))throw new C("host is required.");if(!c(t)||t<=0)throw new C("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(pT[n])&&delete pT[n]};function iwe(e){let t=new HZ.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}}XS.contains=function(e){if(!c(e))throw new C("url is required.");let t=iwe(e);return!!(c(t)&&c(pT[t]))};XS.clear=function(){pT={}};var KS=XS;var WZ=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function vt(e){e=e??W.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),T.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Sh(e.templateValues,{}),this._queryParameters=Sh(e.queryParameters,{}),this.headers=Sh(e.headers,{}),this.request=e.request??new ir,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Sh(e,t){return c(e)?We(e):t}vt.createIfNeeded=function(e){return e instanceof vt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new vt({url:e})};var _T;vt.supportsImageBitmapOptions=function(){return c(_T)?_T:typeof createImageBitmap!="function"?(_T=Promise.resolve(!1),_T):(_T=vt.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=Ah(t[0]),i=Ah(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),_T)};Object.defineProperties(vt,{isBlobSupported:{get:function(){return WZ}}});Object.defineProperties(vt.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 uT(this._url)}},isDataUri:{get:function(){return k_(this._url)}},isBlobUri:{get:function(){return fT(this._url)}},isCrossOriginUrl:{get:function(){return P0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};vt.prototype.parseUrl=function(e,t,n,i){let o=new jZ.default(e),r=owe(o.query());this._queryParameters=t?HO(r,this.queryParameters,n):r,o.search(""),o.fragment(""),c(i)&&o.scheme()===""&&(o=o.absoluteTo(rp(i))),this._url=o.toString()};function owe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ku(e)}function HO(e,t,n){if(!n)return xt(e,t);let i=We(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];c(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${rwe(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 c(s)?encodeURIComponent(s):o})),t&&c(this.proxy)&&(n=this.proxy.getURL(n)),n};function rwe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!c(e[t[0]])?`?${t[0]}`:`?${hT(e)}`}vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=HO(this._queryParameters,e,!1):this._queryParameters=HO(e,this._queryParameters,!1)};vt.prototype.appendQueryParameters=function(e){this._queryParameters=HO(e,this._queryParameters,!0)};vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};vt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,c(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return c(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),c(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),c(e.headers)&&(t.headers=xt(e.headers,t.headers)),c(e.proxy)&&(t.proxy=e.proxy),c(e.request)&&(t.request=e.request),c(e.retryCallback)&&(t.retryCallback=e.retryCallback),c(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};vt.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})};vt.prototype.clone=function(e){return c(e)?(e._url=this._url,e._queryParameters=We(this._queryParameters),e._templateValues=We(this._templateValues),e.headers=We(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new vt({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:c(this.credits)?this.credits.slice():void 0})};vt.prototype.getBaseUri=function(e){return NO(this.getUrlComponent(e),e)};vt.prototype.appendForwardSlash=function(){this._url=LO(this._url)};vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};vt.fetchArrayBuffer=function(e){return new vt(e).fetchArrayBuffer()};vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};vt.fetchBlob=function(e){return new vt(e).fetchBlob()};vt.prototype.fetchImage=function(e){e=e??W.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(g5(this.request),!WZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return _5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!c(r))return;let s,a,l,u;return vt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!c(f))return;if(u=f,a)return vt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return l=new vt({url:h}),_5({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(c(f))return f.blob=u,a||window.URL.revokeObjectURL(l.url),f}).catch(function(f){return c(l)&&window.URL.revokeObjectURL(l.url),f.blob=u,Promise.reject(f)})};function _5(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 l=Yl();return vt._Implementations.createImage(r,a,l,n,i,o),l.promise};let s=Tc.request(r);if(c(s))return s.catch(function(a){return r.state!==Zn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(l){return l?(r.state=Zn.UNISSUED,r.deferred=void 0,_5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}vt.fetchImage=function(e){return new vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};vt.fetchText=function(e){return new vt(e).fetchText()};vt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(c(e))return e.then(function(t){if(c(t))return JSON.parse(t)})};vt.fetchJson=function(e){return new vt(e).fetchJson()};vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};vt.fetchXML=function(e){return new vt(e).fetchXML()};vt.prototype.fetchJsonp=function(e){e=e??"callback",g5(this.request);let t;do t=`loadJsonp${O.nextRandomNumber().toString().substring(2,8)}`;while(c(window[t]));return qZ(this,e,t)};function qZ(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=Yl();return window[n]=function(l){a.resolve(l);try{delete window[n]}catch{window[n]=void 0}},vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Tc.request(o);if(c(s))return s.catch(function(a){return o.state!==Zn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(l){return l?(o.state=Zn.UNISSUED,o.deferred=void 0,qZ(e,t,n)):Promise.reject(a)})})}vt.fetchJsonp=function(e){return new vt(e).fetchJsonp(e.callbackParameterName)};vt.prototype._makeRequest=function(e){let t=this;g5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,l=e.method,u=e.data,f=Yl(),h=vt._Implementations.loadWithXhr(i,r,l,u,s,f,a);return c(h)&&c(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=Tc.request(n);if(c(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Zn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Zn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function g5(e){if(e.state===Zn.ISSUED||e.state===Zn.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=Zn.UNISSUED,e.deferred=void 0}var swe=/^data:(.*?)(;base64)?,(.*)$/;function zO(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function GZ(e,t){let n=zO(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 awe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return zO(i,o);case"arraybuffer":return GZ(i,o);case"blob":return r=GZ(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(zO(i,o),n);case"json":return JSON.parse(zO(i,o));default:throw new C(`Unhandled responseType: ${t}`)}}vt.prototype.fetch=function(e){return e=Sh(e,{}),e.method="GET",this._makeRequest(e)};vt.fetch=function(e){return new vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.delete=function(e){return e=Sh(e,{}),e.method="DELETE",this._makeRequest(e)};vt.delete=function(e){return new vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};vt.prototype.head=function(e){return e=Sh(e,{}),e.method="HEAD",this._makeRequest(e)};vt.head=function(e){return new vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.options=function(e){return e=Sh(e,{}),e.method="OPTIONS",this._makeRequest(e)};vt.options=function(e){return new vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.post=function(e,t){return T.defined("data",e),t=Sh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};vt.post=function(e){return new vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.put=function(e,t){return T.defined("data",e),t=Sh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};vt.put=function(e){return new vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.patch=function(e,t){return T.defined("data",e),t=Sh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};vt.patch=function(e){return new vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt._Implementations={};vt._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&&(KS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};vt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;vt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){vt._Implementations.loadImageElement(s,t,n);return}let l="blob",u="GET",f=Yl(),h=vt._Implementations.loadWithXhr(s,l,u,void 0,void 0,f,void 0,void 0,void 0);return c(h)&&c(h.abort)&&(e.cancelFunction=function(){h.abort()}),f.promise.then(function(p){if(!c(p)){n.reject(new ae(`Successfully retrieved ${s} but it contained no content.`));return}return vt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};vt.createImageBitmapFromBlob=function(e,t){return T.defined("options",t),T.typeOf.bool("options.flipY",t.flipY),T.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),T.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function cwe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let l={};a.headers.forEach((u,f)=>{l[f]=u}),r.reject(new sp(a.status,a,l));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 sp)})}var lwe=typeof XMLHttpRequest>"u";vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=swe.exec(e);if(a!==null){r.resolve(awe(a,t));return}if(lwe){cwe(e,t,n,i,o,r,s);return}let l=new XMLHttpRequest;if(KS.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),c(s)&&c(l.overrideMimeType)&&l.overrideMimeType(s),c(o))for(let f in o)o.hasOwnProperty(f)&&l.setRequestHeader(f,o[f]);c(t)&&(l.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){r.reject(new sp(l.status,l.response,l.getAllResponseHeaders()));return}let f=l.response,h=l.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=l.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let b=y.split(": "),x=b.shift();m[x]=b.join(": ")}),r.resolve(m);return}if(l.status===204)r.resolve(void 0);else if(c(f)&&(!c(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&c(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(h===""||h==="text")&&c(l.responseText)?r.resolve(l.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},l.onerror=function(f){r.reject(new sp)},l.send(i),l};vt._Implementations.loadAndExecuteScript=function(e,t,n){return dT(e,t).catch(function(i){n.reject(i)})};vt._DefaultImplementations={};vt._DefaultImplementations.createImage=vt._Implementations.createImage;vt._DefaultImplementations.loadWithXhr=vt._Implementations.loadWithXhr;vt._DefaultImplementations.loadAndExecuteScript=vt._Implementations.loadAndExecuteScript;vt.DEFAULT=Object.freeze(new vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var we=vt;function ZS(e){e=e??W.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=e.addNewLeapSeconds??!0,c(e.data)?YZ(this,e.data):YZ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}ZS.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.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 ZS({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};ZS.NONE=Object.freeze({compute:function(e,t){return c(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new D0(0,0,0,0,0),t}});ZS.prototype.compute=function(e,t){if(!c(this._samples))return;if(c(t)||(t=new D0(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(c(i)){let a=n[i],l=n[i+1],u=Q.lessThanOrEquals(a,e),f=!c(l),h=f||Q.greaterThanOrEquals(l,e);if(u&&h)return o=i,!f&&l.equals(e)&&++o,r=o+1,KZ(this,n,this._samples,e,o,r,t),t}let s=Mo(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,KZ(this,n,this._samples,e,o,r,t),t};function uwe(e,t){return Q.compare(e.julianDate,t)}function YZ(e,t){if(!c(t.columnNames))throw new ae("Error in loaded EOP data: The columnNames property is required.");if(!c(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"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||l<0)throw new ae("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],b=u[g+l],x=y+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new Q(x,b,Wn.TAI);if(f.push(A),p){if(b!==h&&c(h)){let E=Q.leapSeconds,S=Mo(E,A,uwe);if(S<0){let v=new Yi(A,b);E.splice(~S,0,v)}}h=b}}}function XZ(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 $S(e,t,n){return t+e*(n-t)}function KZ(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 l=t[o],u=t[r];if(l.equals(u)||i.equals(l))return XZ(e,n,o,a,s),s;if(i.equals(u))return XZ(e,n,r,a,s),s;let f=Q.secondsDifference(i,l)/Q.secondsDifference(u,l),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let b=n[h+e._taiMinusUtcSecondsColumn],x=n[p+e._taiMinusUtcSecondsColumn];b!==x&&(u.equals(i)?g=m:m-=x-b)}return s.xPoleWander=$S(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=$S(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=$S(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=$S(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=$S(f,g,m),s}var GO=ZS;function Ya(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Ya.fromQuaternion=function(e,t){if(!c(e))throw new C("quaternion is required");c(t)||(t=new Ya);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=-O.asinClamped(n),t};Ya.fromDegrees=function(e,t,n,i){if(!c(e))throw new C("heading is required");if(!c(t))throw new C("pitch is required");if(!c(n))throw new C("roll is required");return c(i)||(i=new Ya),i.heading=e*O.RADIANS_PER_DEGREE,i.pitch=t*O.RADIANS_PER_DEGREE,i.roll=n*O.RADIANS_PER_DEGREE,i};Ya.clone=function(e,t){if(c(e))return c(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Ya(e.heading,e.pitch,e.roll)};Ya.equals=function(e,t){return e===t||c(e)&&c(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Ya.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.heading,t.heading,n,i)&&O.equalsEpsilon(e.pitch,t.pitch,n,i)&&O.equalsEpsilon(e.roll,t.roll,n,i)};Ya.prototype.clone=function(e){return Ya.clone(this,e)};Ya.prototype.equals=function(e){return Ya.equals(this,e)};Ya.prototype.equalsEpsilon=function(e,t,n){return Ya.equalsEpsilon(this,e,t,n)};Ya.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Xa=Ya;var $Z=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function fwe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=$Z.exec(i);if(o!==null)return o[1]}}var jO;function ZZ(e){return typeof document>"u"?e:(c(jO)||(jO=document.createElement("a")),jO.href=e,jO.href)}var R0;function QZ(){if(c(R0))return R0;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:c(import.meta?.url)?e=rp(".",import.meta.url):typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(cO.toUrl)?e=rp("..",M0("Core/buildModuleUrl.js")):e=fwe(),!c(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return R0=new we({url:ZZ(e)}),R0.appendForwardSlash(),R0}function dwe(e){return ZZ(cO.toUrl(`../${e}`))}function JZ(e){return QZ().getDerivedResource({url:e}).url}var WO;function M0(e){return c(WO)||(typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(cO.toUrl)?WO=dwe:WO=JZ),WO(e)}M0._cesiumScriptRegex=$Z;M0._buildModuleUrlFromBaseUrl=JZ;M0._clearBaseResource=function(){R0=void 0};M0.setBaseUrl=function(e){R0=we.DEFAULT.getDerivedResource({url:e})};M0.getCesiumBaseUrl=QZ;var tn=M0;function hwe(e,t,n){this.x=e,this.y=t,this.s=n}var gT=hwe;function x5(e){e=e??W.EMPTY_OBJECT,this._xysFileUrlTemplate=we.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,Wn.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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 mwe=new Q(0,0,Wn.TAI);function y5(e,t,n){let i=mwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}x5.prototype.preload=function(e,t,n,i){let o=y5(this,e,t),r=y5(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 l=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let h=l;h<=u;++h)f.push(b5(this,h));return Promise.all(f)};x5.prototype.computeXysRadians=function(e,t,n){let i=y5(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 l=!1,u=this._samples;if(c(u[s*3])||(b5(this,s/this._samplesPerXysFile|0),l=!0),c(u[a*3])||(b5(this,a/this._samplesPerXysFile|0),l=!0),l)return;c(n)?(n.x=0,n.y=0,n.s=0):n=new gT(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,b;for(y=0;y<=r;++y)h[y]=f-m[y];for(y=0;y<=r;++y){for(g[y]=1,b=0;b<=r;++b)b!==y&&(g[y]*=h[b]);g[y]*=p[y];let x=(s+y)*3;n.x+=g[y]*u[x++],n.y+=g[y]*u[x++],n.s+=g[y]*u[x]}return n};function b5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;c(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new we({url:tn(`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,l=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[l+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var qO=x5;function nt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var QS=new d;nt.fromAxisAngle=function(e,t,n){T.typeOf.object("axis",e),T.typeOf.number("angle",t);let i=t/2,o=Math.sin(i);QS=d.normalize(e,QS);let r=QS.x*o,s=QS.y*o,a=QS.z*o,l=Math.cos(i);return c(n)?(n.x=r,n.y=s,n.z=a,n.w=l,n):new nt(r,s,a,l)};var pwe=[1,2,0],_we=new Array(3);nt.fromRotationMatrix=function(e,t){T.typeOf.object("matrix",e);let n,i,o,r,s,a=e[J.COLUMN0ROW0],l=e[J.COLUMN1ROW1],u=e[J.COLUMN2ROW2],f=a+l+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[J.COLUMN1ROW2]-e[J.COLUMN2ROW1])*n,o=(e[J.COLUMN2ROW0]-e[J.COLUMN0ROW2])*n,r=(e[J.COLUMN0ROW1]-e[J.COLUMN1ROW0])*n;else{let h=pwe,p=0;l>a&&(p=1),u>a&&u>l&&(p=2);let g=h[p],m=h[g];n=Math.sqrt(e[J.getElementIndex(p,p)]-e[J.getElementIndex(g,g)]-e[J.getElementIndex(m,m)]+1);let y=_we;y[p]=.5*n,n=.5/n,s=(e[J.getElementIndex(m,g)]-e[J.getElementIndex(g,m)])*n,y[g]=(e[J.getElementIndex(g,p)]+e[J.getElementIndex(p,g)])*n,y[m]=(e[J.getElementIndex(m,p)]+e[J.getElementIndex(p,m)])*n,i=-y[0],o=-y[1],r=-y[2]}return c(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var eQ=new nt,tQ=new nt,T5=new nt,nQ=new nt;nt.fromHeadingPitchRoll=function(e,t){return T.typeOf.object("headingPitchRoll",e),nQ=nt.fromAxisAngle(d.UNIT_X,e.roll,eQ),T5=nt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=nt.multiply(T5,nQ,T5),tQ=nt.fromAxisAngle(d.UNIT_Z,-e.heading,eQ),nt.multiply(tQ,t,t)};var YO=new d,A5=new d,ad=new nt,iQ=new nt,XO=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,XO),nt.conjugate(XO,XO);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,ad),nt.multiply(ad,XO,ad),ad.w<0&&nt.negate(ad,ad),nt.computeAxis(ad,YO);let a=nt.computeAngle(ad);c(i)||(i=[]),i[s]=YO.x*a,i[s+1]=YO.y*a,i[s+2]=YO.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){c(o)||(o=new nt),d.fromArray(e,0,A5);let r=d.magnitude(A5);return nt.unpack(t,i*4,iQ),r===0?nt.clone(nt.IDENTITY,ad):nt.fromAxisAngle(A5,r,ad),nt.multiply(ad,iQ,o)};nt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return T.typeOf.object("quaternion",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return T.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){T.typeOf.object("result",t);let n=1/nt.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};nt.inverse=function(e,t){T.typeOf.object("result",t);let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};nt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};nt.negate=function(e,t){return T.typeOf.object("quaternion",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,l=t.y,u=t.z,f=t.w,h=s*a+i*f+o*u-r*l,p=s*l-i*u+o*f+r*a,g=s*u+i*l-o*a+r*f,m=s*f-i*a-o*l-r*u;return n.x=h,n.y=p,n.z=g,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return T.typeOf.object("quaternion",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return T.typeOf.object("quaternion",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){T.typeOf.object("quaternion",e),T.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<O.EPSILON6||Math.abs(n+1)<O.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};nt.computeAngle=function(e){return T.typeOf.object("quaternion",e),Math.abs(e.w-1)<O.EPSILON6?0:2*Math.acos(e.w)};var C5=new nt;nt.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),C5=nt.multiplyByScalar(t,n,C5),i=nt.multiplyByScalar(e,1-n,i),nt.add(C5,i,i)};var oQ=new nt,E5=new nt,S5=new nt;nt.slerp=function(e,t,n,i){T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i);let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=oQ=nt.negate(t,oQ)),1-o<O.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return E5=nt.multiplyByScalar(e,Math.sin((1-n)*s),E5),S5=nt.multiplyByScalar(r,Math.sin(n*s),S5),i=nt.add(E5,S5,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){T.typeOf.object("quaternion",e),T.typeOf.object("result",t);let n=O.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};nt.exp=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=d.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 gwe=new d,ywe=new d,JS=new nt,yT=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("q2",n),T.typeOf.object("result",i);let o=nt.conjugate(t,JS);nt.multiply(o,n,yT);let r=nt.log(yT,gwe);nt.multiply(o,e,yT);let s=nt.log(yT,ywe);return d.add(r,s,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),nt.exp(r,JS),nt.multiply(t,JS,i)};nt.squad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.slerp(e,t,o,JS),a=nt.slerp(n,i,o,yT);return nt.slerp(s,a,2*o*(1-o),r)};var bwe=new nt,rQ=1.9011074535173003,KO=zt.supportsTypedArrays()?new Float32Array(8):[],$O=zt.supportsTypedArrays()?new Float32Array(8):[],cp=zt.supportsTypedArrays()?new Float32Array(8):[],lp=zt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;KO[e]=1/(t*n),$O[e]=t/n}KO[7]=rQ/(8*17);$O[7]=rQ*8/17;nt.fastSlerp=function(e,t,n,i){T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i);let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,l=n*n,u=a*a;for(let g=7;g>=0;--g)cp[g]=(KO[g]*l-$O[g])*s,lp[g]=(KO[g]*u-$O[g])*s;let f=r*n*(1+cp[0]*(1+cp[1]*(1+cp[2]*(1+cp[3]*(1+cp[4]*(1+cp[5]*(1+cp[6]*(1+cp[7])))))))),h=a*(1+lp[0]*(1+lp[1]*(1+lp[2]*(1+lp[3]*(1+lp[4]*(1+lp[5]*(1+lp[6]*(1+lp[7])))))))),p=nt.multiplyByScalar(e,h,bwe);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.fastSlerp(e,t,o,JS),a=nt.fastSlerp(n,i,o,yT);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,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){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=nt;var ci={},w5={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"}},bT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},v5={},ll={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},U_=new d,V_=new d,z_=new d;ci.localFrameToFixedFrameGenerator=function(e,t){if(!w5.hasOwnProperty(e)||!w5[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=w5[e][t],i,o=e+t;return c(v5[o])?i=v5[o]:(i=function(r,s,a){if(!c(r))throw new C("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new C("origin has a NaN component");if(c(a)||(a=new F),d.equalsEpsilon(r,d.ZERO,O.EPSILON14))d.unpack(bT[e],0,U_),d.unpack(bT[t],0,V_),d.unpack(bT[n],0,z_);else if(O.equalsEpsilon(r.x,0,O.EPSILON14)&&O.equalsEpsilon(r.y,0,O.EPSILON14)){let l=O.sign(r.z);d.unpack(bT[e],0,U_),e!=="east"&&e!=="west"&&d.multiplyByScalar(U_,l,U_),d.unpack(bT[t],0,V_),t!=="east"&&t!=="west"&&d.multiplyByScalar(V_,l,V_),d.unpack(bT[n],0,z_),n!=="east"&&n!=="west"&&d.multiplyByScalar(z_,l,z_)}else{s=s??ie.default,s.geodeticSurfaceNormal(r,ll.up);let l=ll.up,u=ll.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,ll.east),d.cross(l,u,ll.north),d.multiplyByScalar(ll.up,-1,ll.down),d.multiplyByScalar(ll.east,-1,ll.west),d.multiplyByScalar(ll.north,-1,ll.south),U_=ll[e],V_=ll[t],z_=ll[n]}return a[0]=U_.x,a[1]=U_.y,a[2]=U_.z,a[3]=0,a[4]=V_.x,a[5]=V_.y,a[6]=V_.z,a[7]=0,a[8]=z_.x,a[9]=z_.y,a[10]=z_.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},v5[o]=i),i};ci.eastNorthUpToFixedFrame=ci.localFrameToFixedFrameGenerator("east","north");ci.northEastDownToFixedFrame=ci.localFrameToFixedFrameGenerator("north","east");ci.northUpEastToFixedFrame=ci.localFrameToFixedFrameGenerator("north","up");ci.northWestUpToFixedFrame=ci.localFrameToFixedFrameGenerator("north","west");var xwe=new Le,Twe=new d(1,1,1),Awe=new F;ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t),i=i??ci.eastNorthUpToFixedFrame;let r=Le.fromHeadingPitchRoll(t,xwe),s=F.fromTranslationQuaternionRotationScale(d.ZERO,r,Twe,Awe);return o=i(e,n,o),F.multiply(o,s,o)};var Cwe=new F,Ewe=new J;ci.headingPitchRollQuaternion=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t);let r=ci.headingPitchRollToFixedFrame(e,t,n,i,Cwe),s=F.getMatrix3(r,Ewe);return Le.fromRotationMatrix(s,o)};var Swe=new d(1,1,1),wwe=new d,sQ=new F,vwe=new F,Dwe=new J,Pwe=new Le;ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){T.defined("transform",e),t=t??ie.default,n=n??ci.eastNorthUpToFixedFrame,c(i)||(i=new Xa);let o=F.getTranslation(e,wwe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,sQ),sQ),s=F.setScale(e,Swe,vwe);s=F.setTranslation(s,d.ZERO,s),r=F.multiply(r,s,r);let a=Le.fromRotationMatrix(F.getMatrix3(r,Dwe),Pwe);return a=Le.normalize(a,a),Xa.fromQuaternion(a,i)};var Iwe=6*3600+41*60+50.54841,Owe=8640184812866e-6,Rwe=.093104,Mwe=-62e-7,Lwe=11772758384668e-32,Nwe=72921158553e-15,Fwe=O.TWO_PI/86400,ZO=new Q;ci.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ci.computeIcrfToFixedMatrix(e,t);return c(n)||(n=ci.computeTemeToPseudoFixedMatrix(e,t)),n};ci.computeTemeToPseudoFixedMatrix=function(e,t){if(!c(e))throw new C("date is required.");ZO=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),ZO);let n=ZO.dayNumber,i=ZO.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(Iwe+o*(Owe+o*(Rwe+o*Mwe)))*Fwe%O.TWO_PI,l=Nwe+Lwe*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+l*u,h=Math.cos(f),p=Math.sin(f);return c(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 J(h,p,0,-p,h,0,0,0,1)};ci.iau2006XysData=new qO;ci.earthOrientationParameters=GO.NONE;var I5=32.184,Bwe=2451545;ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+I5,i=e.stop.dayNumber,o=e.stop.secondsOfDay+I5;return ci.iau2006XysData.preload(t,n,i,o)};ci.computeIcrfToFixedMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=ci.computeFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var kwe=32.184,Uwe=2451545,QO=new Xa,Vwe=new J,zwe=new Q;ci.computeMoonFixedToIcrfMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=Q.addSeconds(e,kwe,zwe),i=Q.totalDays(n)-Uwe,o=O.toRadians(12.112)-O.toRadians(.052992)*i,r=O.toRadians(24.224)-O.toRadians(.105984)*i,s=O.toRadians(227.645)+O.toRadians(13.012)*i,a=O.toRadians(261.105)+O.toRadians(13.340716)*i,l=O.toRadians(358)+O.toRadians(.9856)*i;return QO.pitch=O.toRadians(180)-O.toRadians(3.878)*Math.sin(o)-O.toRadians(.12)*Math.sin(r)+O.toRadians(.07)*Math.sin(s)-O.toRadians(.017)*Math.sin(a),QO.roll=O.toRadians(66.53-90)+O.toRadians(1.543)*Math.cos(o)+O.toRadians(.24)*Math.cos(r)-O.toRadians(.028)*Math.cos(s)+O.toRadians(.007)*Math.cos(a),QO.heading=O.toRadians(244.375-90)+O.toRadians(13.17635831)*i+O.toRadians(3.558)*Math.sin(o)+O.toRadians(.121)*Math.sin(r)-O.toRadians(.064)*Math.sin(s)+O.toRadians(.016)*Math.sin(a)+O.toRadians(.025)*Math.sin(l),J.fromHeadingPitchRoll(QO,Vwe)};ci.computeIcrfToMoonFixedMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=ci.computeMoonFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var Hwe=new gT(0,0,0),Gwe=new D0(0,0,0,0,0,0),D5=new J,P5=new J;ci.computeFixedToIcrfMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=ci.earthOrientationParameters.compute(e,Gwe);if(!c(n))return;let i=e.dayNumber,o=e.secondsOfDay+I5,r=ci.iau2006XysData.computeXysRadians(i,o,Hwe);if(!c(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-s*s-a*a)),u=D5;u[0]=1-l*s*s,u[3]=-l*s*a,u[6]=s,u[1]=-l*s*a,u[4]=1-l*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-l*(s*s+a*a);let f=J.fromRotationZ(-r.s,P5),h=J.multiply(u,f,D5),p=e.dayNumber,g=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/qn.SECONDS_PER_DAY,b=.779057273264+y+.00273781191135448*(m+y);b=b%1*O.TWO_PI;let x=J.fromRotationZ(b,P5),A=J.multiply(h,x,D5),E=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),P=Math.sin(n.yPoleWander),M=i-Bwe+o/qn.SECONDS_PER_DAY;M/=36525;let R=-47e-6*M*O.RADIANS_PER_DEGREE/3600,L=Math.cos(R),B=Math.sin(R),_=P5;return _[0]=E*L,_[1]=E*B,_[2]=v,_[3]=-S*B+P*v*L,_[4]=S*L+P*v*B,_[5]=-P*E,_[6]=-P*B-S*v*L,_[7]=P*L-S*v*B,_[8]=S*E,J.multiply(A,_,t)};var jwe=new se;ci.pointToWindowCoordinates=function(e,t,n,i){return i=ci.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ci.pointToGLWindowCoordinates=function(e,t,n,i){if(!c(e))throw new C("modelViewProjectionMatrix is required.");if(!c(t))throw new C("viewportTransformation is required.");if(!c(n))throw new C("point is required.");c(i)||(i=new z);let o=jwe;return F.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),z.fromCartesian4(o,i)};var Wwe=new d,qwe=new d,Ywe=new d;ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!c(e))throw new C("position is required.");if(!c(t))throw new C("velocity is required.");let o=(n??ie.default).geodeticSurfaceNormal(e,Wwe),r=d.cross(t,o,qwe);d.equalsEpsilon(r,d.ZERO,O.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,Ywe);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),c(i)||(i=new J),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 aQ=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),cQ=new he,O5=new d,Xwe=new d,Kwe=new J,R5=new F,lQ=new F;ci.basisTo2D=function(e,t,n){if(!c(e))throw new C("projection is required.");if(!c(t))throw new C("matrix is required.");if(!c(n))throw new C("result is required.");let i=F.getTranslation(t,Xwe),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,O5);else{let f=o.cartesianToCartographic(i,cQ);r=e.project(f,O5),d.fromElements(r.z,r.x,r.y,r)}let s=ci.eastNorthUpToFixedFrame(i,o,R5),a=F.inverseTransformation(s,lQ),l=F.getMatrix3(t,Kwe),u=F.multiplyByMatrix3(a,l,n);return F.multiply(aQ,u,n),F.setTranslation(n,r,n),n};ci.ellipsoidTo2DModelMatrix=function(e,t,n){if(!c(e))throw new C("projection is required.");if(!c(t))throw new C("center is required.");if(!c(n))throw new C("result is required.");let i=e.ellipsoid,o=ci.eastNorthUpToFixedFrame(t,i,R5),r=F.inverseTransformation(o,lQ),s=i.cartesianToCartographic(t,cQ),a=e.project(s,O5);d.fromElements(a.z,a.x,a.y,a);let l=F.fromTranslation(a,R5);return F.multiply(aQ,r,n),F.multiply(l,n,n),n};var Ot=ci;function vn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(vn.prototype,{width:{get:function(){return vn.computeWidth(this)}},height:{get:function(){return vn.computeHeight(this)}}});vn.packedLength=4;vn.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};vn.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};vn.computeWidth=function(e){T.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=O.TWO_PI),t-n};vn.computeHeight=function(e){return T.typeOf.object("rectangle",e),e.north-e.south};vn.fromDegrees=function(e,t,n,i,o){return e=O.toRadians(e??0),t=O.toRadians(t??0),n=O.toRadians(n??0),i=O.toRadians(i??0),c(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new vn(e,t,n,i)};vn.fromRadians=function(e,t,n,i,o){return c(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new vn(e,t,n,i)};vn.fromCartographicArray=function(e,t){T.defined("cartographics",e);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 l=0,u=e.length;l<u;l++){let f=e[l];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+O.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>O.PI&&(i=i-O.TWO_PI),n>O.PI&&(n=n-O.TWO_PI)),c(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new vn(n,s,i,a)};vn.fromCartesianArray=function(e,t,n){T.defined("cartesians",e),t=t??ie.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),l=Math.max(l,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+O.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>O.PI&&(o=o-O.TWO_PI),i>O.PI&&(i=i-O.TWO_PI)),c(n)?(n.west=i,n.south=a,n.east=o,n.north=l,n):new vn(i,a,o,l)};var $we=new d,Zwe=new d,Qwe=new d,Jwe=new d,eve=new d,M5=new Array(5);for(let e=0;e<M5.length;++e)M5[e]=new d;vn.fromBoundingSphere=function(e,t,n){T.typeOf.object("boundingSphere",e);let i=e.center,o=e.radius;if(c(t)||(t=ie.default),c(n)||(n=new vn),d.equals(i,d.ZERO))return vn.clone(vn.MAX_VALUE,n),n;let r=Ot.eastNorthUpToFixedFrame(i,t,$we),s=F.multiplyByPointAsVector(r,d.UNIT_X,Zwe);d.normalize(s,s);let a=F.multiplyByPointAsVector(r,d.UNIT_Y,Qwe);d.normalize(a,a),d.multiplyByScalar(a,o,a),d.multiplyByScalar(s,o,s);let l=d.negate(a,eve),u=d.negate(s,Jwe),f=M5,h=f[0];return d.add(i,a,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,l,h),h=f[3],d.add(i,s,h),f[4]=i,vn.fromCartesianArray(f,t,n)};vn.clone=function(e,t){if(c(e))return c(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new vn(e.west,e.south,e.east,e.north)};vn.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};vn.prototype.clone=function(e){return vn.clone(this,e)};vn.prototype.equals=function(e){return vn.equals(this,e)};vn.equals=function(e,t){return e===t||c(e)&&c(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};vn.prototype.equalsEpsilon=function(e,t){return vn.equalsEpsilon(this,e,t)};vn._validate=function(e){T.typeOf.object("rectangle",e);let t=e.north;T.typeOf.number.greaterThanOrEquals("north",t,-O.PI_OVER_TWO),T.typeOf.number.lessThanOrEquals("north",t,O.PI_OVER_TWO);let n=e.south;T.typeOf.number.greaterThanOrEquals("south",n,-O.PI_OVER_TWO),T.typeOf.number.lessThanOrEquals("south",n,O.PI_OVER_TWO);let i=e.west;T.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),T.typeOf.number.lessThanOrEquals("west",i,Math.PI);let o=e.east;T.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),T.typeOf.number.lessThanOrEquals("east",o,Math.PI)};vn.southwest=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};vn.northwest=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};vn.northeast=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};vn.southeast=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};vn.center=function(e,t){T.typeOf.object("rectangle",e);let n=e.east,i=e.west;n<i&&(n+=O.TWO_PI);let o=O.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return c(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};vn.intersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=O.TWO_PI:r<s&&i>0&&(r+=O.TWO_PI),i<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);let a=O.negativePiToPi(Math.max(o,s)),l=O.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&l<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return c(n)?(n.west=a,n.south=u,n.east=l,n.north=f,n):new vn(a,u,l,f)};vn.simpleIntersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);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 c(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new vn(i,o,r,s)};vn.union=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t),c(n)||(n=new vn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=O.TWO_PI:r<s&&i>0&&(r+=O.TWO_PI),i<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);let a=O.negativePiToPi(Math.min(o,s)),l=O.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n};vn.expand=function(e,t,n){return T.typeOf.object("rectangle",e),T.typeOf.object("cartographic",t),c(n)||(n=new vn),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};vn.contains=function(e,t){T.typeOf.object("rectangle",e),T.typeOf.object("cartographic",t);let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=O.TWO_PI,n<0&&(n+=O.TWO_PI)),(n>o||O.equalsEpsilon(n,o,O.EPSILON14))&&(n<r||O.equalsEpsilon(n,r,O.EPSILON14))&&i>=e.south&&i<=e.north};var tve=new he;vn.subsample=function(e,t,n,i){T.typeOf.object("rectangle",e),t=t??ie.default,n=n??0,c(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,l=e.west,u=tve;u.height=n,u.longitude=l,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*O.PI_OVER_TWO,vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};vn.subsection=function(e,t,n,i,o,r){if(T.typeOf.object("rectangle",e),T.typeOf.number.greaterThanOrEquals("westLerp",t,0),T.typeOf.number.lessThanOrEquals("westLerp",t,1),T.typeOf.number.greaterThanOrEquals("southLerp",n,0),T.typeOf.number.lessThanOrEquals("southLerp",n,1),T.typeOf.number.greaterThanOrEquals("eastLerp",i,0),T.typeOf.number.lessThanOrEquals("eastLerp",i,1),T.typeOf.number.greaterThanOrEquals("northLerp",o,0),T.typeOf.number.lessThanOrEquals("northLerp",o,1),T.typeOf.number.lessThanOrEquals("westLerp",t,i),T.typeOf.number.lessThanOrEquals("southLerp",n,o),c(r)||(r=new vn),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=O.TWO_PI+e.east-e.west;r.west=O.negativePiToPi(e.west+t*a),r.east=O.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};vn.MAX_VALUE=Object.freeze(new vn(-Math.PI,-O.PI_OVER_TWO,Math.PI,O.PI_OVER_TWO));var ce=vn;function Or(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}Or.packedLength=4;Or.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Or.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Or),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Or.fromPoints=function(e,t){if(c(t)||(t=new Or),!c(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 l=e[a],u=l.x,f=l.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var uQ=new Oi,nve=new he,ive=new he;Or.fromRectangle=function(e,t,n){if(c(n)||(n=new Or),!c(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;uQ._ellipsoid=ie.default,t=t??uQ;let i=t.project(ce.southwest(e,nve)),o=t.project(ce.northeast(e,ive));return z.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Or.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Or(e.x,e.y,e.width,e.height)};Or.union=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),c(n)||(n=new Or);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};Or.expand=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("point",t),n=Or.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};Or.intersect=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",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?Wt.OUTSIDE:Wt.INTERSECTING};Or.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Or.prototype.clone=function(e){return Or.clone(this,e)};Or.prototype.intersect=function(e){return Or.intersect(this,e)};Or.prototype.equals=function(e){return Or.equals(this,e)};var Ke=Or;var Aa={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};Aa.isLines=function(e){return e===Aa.LINES||e===Aa.LINE_LOOP||e===Aa.LINE_STRIP};Aa.isTriangles=function(e){return e===Aa.TRIANGLES||e===Aa.TRIANGLE_STRIP||e===Aa.TRIANGLE_FAN};Aa.validate=function(e){return e===Aa.POINTS||e===Aa.LINES||e===Aa.LINE_LOOP||e===Aa.LINE_STRIP||e===Aa.TRIANGLES||e===Aa.TRIANGLE_STRIP||e===Aa.TRIANGLE_FAN};var Me=Object.freeze(Aa);var xT=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};uo.packedLength=16;uo.fromArray=uo.unpack;uo.IDENTITY=new uo(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);uo.ZERO=new uo(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);uo.COLUMN0ROW0=0;uo.COLUMN0ROW1=1;uo.COLUMN0ROW2=2;uo.COLUMN0ROW3=3;uo.COLUMN1ROW0=4;uo.COLUMN1ROW1=5;uo.COLUMN1ROW2=6;uo.COLUMN1ROW3=7;uo.COLUMN2ROW0=8;uo.COLUMN2ROW1=9;uo.COLUMN2ROW2=10;uo.COLUMN2ROW3=11;uo.COLUMN3ROW0=12;uo.COLUMN3ROW1=13;uo.COLUMN3ROW2=14;uo.COLUMN3ROW3=15;var pE=new h,gE=new h,MI=new h,Uke=new h,zke=new h,lq=new h,Gae=new h,Vke=new h,jke=new h,Hke=new $,Gke=new $,Wke=new se,qke=new se(0,0,0,1),Yke=new uo,M=uo;var Wae={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};Object.freeze(Wae);var te=Wae;var Xke=new h;function Ot(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ga={};Ga[te.FLOAT]="float";Ga[te.FLOAT_VEC2]="vec2";Ga[te.FLOAT_VEC3]="vec3";Ga[te.FLOAT_VEC4]="vec4";Ga[te.INT]="int";Ga[te.INT_VEC2]="ivec2";Ga[te.INT_VEC3]="ivec3";Ga[te.INT_VEC4]="ivec4";Ga[te.BOOL]="bool";Ga[te.BOOL_VEC2]="bvec2";Ga[te.BOOL_VEC3]="bvec3";Ga[te.BOOL_VEC4]="bvec4";Ga[te.FLOAT_MAT2]="mat2";Ga[te.FLOAT_MAT3]="mat3";Ga[te.FLOAT_MAT4]="mat4";Ga[te.SAMPLER_2D]="sampler2D";Ga[te.SAMPLER_CUBE]="samplerCube";Ot.prototype.getDeclaration=function(e){let t=`uniform ${Ga[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var Kke={czm_viewport:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,Xke)}}),czm_frameNumber:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Ot({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Ot({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Ot({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},x_=Kke;function $ke(){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 Kn=$ke;function Jke(){return!0}function Zke(e,t){t=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=Jke}var ue=Zke;var ra={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ra.getSizeInBytes=function(e){switch(e){case ra.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ra.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ra.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ra.fromSizeInBytes=function(e){switch(e){case 2:return ra.UNSIGNED_SHORT;case 4:return ra.UNSIGNED_INT;case 1:return ra.UNSIGNED_BYTE}};ra.validate=function(e){return l(e)&&(e===ra.UNSIGNED_BYTE||e===ra.UNSIGNED_SHORT||e===ra.UNSIGNED_INT)};ra.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ra.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ra.fromTypedArray=function(e){if(e instanceof Uint8Array)return ra.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ra.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ra.UNSIGNED_INT};Object.freeze(ra);var je=ra;var hb={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};hb.validate=function(e){return e===hb.STREAM_DRAW||e===hb.STATIC_DRAW||e===hb.DYNAMIC_DRAW||e===hb.DYNAMIC_READ};Object.freeze(hb);var Me=hb;function Lc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Lc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Lc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createVertexBuffer=function(e){return new Lc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Lc({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Lc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Lc.prototype._getBuffer=function(){return this._buffer};Lc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Lc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Lc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Lc.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Lc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var tt=Lc;var T_,os={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},ru={};Object.defineProperties(ru,{element:{get:function(){if(ru.supportsFullscreen())return document[os.fullscreenElement]}},changeEventName:{get:function(){if(ru.supportsFullscreen())return os.fullscreenchange}},errorEventName:{get:function(){if(ru.supportsFullscreen())return os.fullscreenerror}},enabled:{get:function(){if(ru.supportsFullscreen())return document[os.fullscreenEnabled]}},fullscreen:{get:function(){if(ru.supportsFullscreen())return ru.element!==null}}});ru.supportsFullscreen=function(){if(l(T_))return T_;T_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return os.requestFullscreen="requestFullscreen",os.exitFullscreen="exitFullscreen",os.fullscreenEnabled="fullscreenEnabled",os.fullscreenElement="fullscreenElement",os.fullscreenchange="fullscreenchange",os.fullscreenerror="fullscreenerror",T_=!0,T_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(os.requestFullscreen=n,T_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(os.requestFullscreen=n,T_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?os.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(os.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?os.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(os.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?os.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(os.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),os.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),os.fullscreenerror=n)}return T_};ru.requestFullscreen=function(e,t){ru.supportsFullscreen()&&e[os.requestFullscreen]({vrDisplay:t})};ru.exitFullscreen=function(){ru.supportsFullscreen()&&document[os.exitFullscreen]()};ru._names=os;var ss=ru;var Xf;typeof navigator<"u"?Xf=navigator:Xf={};function NI(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var aN,qae;function mq(){if(!l(aN)&&(aN=!1,!hN())){let e=/ Chrome\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(aN=!0,qae=NI(e[1]))}return aN}function Qke(){return mq()&&qae}var cN,Yae;function Xae(){if(!l(cN)&&(cN=!1,!mq()&&!hN()&&/ Safari\/[\.0-9]+/.test(Xf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(cN=!0,Yae=NI(e[1]))}return cN}function e3e(){return Xae()&&Yae}var lN,hq;function Kae(){if(!l(lN)){lN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Xf.userAgent);e!==null&&(lN=!0,hq=NI(e[1]),hq.isNightly=!!e[2])}return lN}function t3e(){return Kae()&&hq}var uN,$ae;function hN(){if(!l(uN)){uN=!1;let e=/ Edg\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(uN=!0,$ae=NI(e[1]))}return uN}function n3e(){return hN()&&$ae}var fN,pq;function mN(){if(!l(fN)){fN=!1;let e=/Firefox\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(fN=!0,pq=NI(e[1]))}return fN}var uq;function i3e(){return l(uq)||(uq=/Windows/i.test(Xf.appVersion)),uq}var fq;function r3e(){return l(fq)||(fq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),fq}function o3e(){return mN()&&pq}var dq;function s3e(){return l(dq)||(dq=!mN()&&typeof PointerEvent<"u"&&(!l(Xf.pointerEnabled)||Xf.pointerEnabled)),dq}var Jae,dN;function Zae(){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&&(Jae=t)}return dN}function a3e(){return Zae()?Jae:void 0}function bl(){return bl._result}bl._promise=void 0;bl._result=void 0;bl.initialize=function(){return l(bl._promise)||(bl._promise=new Promise(e=>{let t=new Image;t.onload=function(){bl._result=t.width>0&&t.height>0,e(bl._result)},t.onerror=function(){bl._result=!1,e(bl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),bl._promise};Object.defineProperties(bl,{initialized:{get:function(){return l(bl._result)}}});var _E=[];typeof ArrayBuffer<"u"&&(_E.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&_E.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&_E.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&_E.push(BigInt64Array),typeof BigUint64Array<"u"&&_E.push(BigUint64Array));var Kf={isChrome:mq,chromeVersion:Qke,isSafari:Xae,safariVersion:e3e,isWebkit:Kae,webkitVersion:t3e,isEdge:hN,edgeVersion:n3e,isFirefox:mN,firefoxVersion:o3e,isWindows:i3e,isIPadOrIOS:r3e,hardwareConcurrency:Xf.hardwareConcurrency??3,supportsPointerEvents:s3e,supportsImageRenderingPixelated:Zae,supportsWebP:bl,imageRenderingValue:a3e,typedArrayTypes:_E};Kf.supportsBasis=function(e){return Kf.supportsWebAssembly()&&e.context.supportsBasis};Kf.supportsFullscreen=function(){return ss.supportsFullscreen()};Kf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Kf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Kf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Kf.supportsBigInt=function(){return typeof BigInt<"u"};Kf.supportsWebWorkers=function(){return typeof Worker<"u"};Kf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Kf.supportsWebgl2=function(e){return e.context.webgl2};Kf.supportsEsmWebWorkers=function(){return!mN()||parseInt(pq)>=114};var dn=Kf;function gq(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}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return yq[0]=t,e.fromBytes(D0[0],D0[1],D0[2],D0[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let s=i,a=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;s=gq(f,u,t+1/3),a=gq(f,u,t),c=gq(f,u,t-1/3)}return l(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=r,o):new e(s,a,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+P.nextRandomNumber()*(c-a)}let r=t.green;if(!l(r)){let a=t.minimumGreen??0,c=t.maximumGreen??1;r=a+P.nextRandomNumber()*(c-a)}let o=t.blue;if(!l(o)){let a=t.minimumBlue??0,c=t.maximumBlue??1;o=a+P.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+P.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=s,n):new e(i,r,o,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=c3e.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=l3e.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=u3e.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=f3e.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return D0[0]=t,D0[1]=n,D0[2]=i,D0[3]=r,yq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=P.lerp(t.red,n.red,i),r.green=P.lerp(t.green,n.green,i),r.blue=P.lerp(t.blue,n.blue,i),r.alpha=P.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},_q,yq,D0;dn.supportsTypedArrays()&&(_q=new ArrayBuffer(4),yq=new Uint32Array(_q),D0=new Uint8Array(_q));var c3e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,l3e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,u3e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,f3e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var z=_e;function pN(e){e=e??H.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}pN.ALL=Object.freeze(new pN({color:new z(0,0,0,0),depth:1,stencil:0}));pN.prototype.execute=function(e,t){e.clear(this,t)};var fi=pN;var Qae={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(Qae);var Ie=Qae;function ece(e){e=e??H.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=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}ece.prototype.execute=function(e){e.execute(this)};var $f=ece;var as=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y);return r.x=o,r.y=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,gN),e.magnitude(gN)}static distanceSquared(t,n){return e.subtract(t,n,gN),e.magnitudeSquared(gN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,tce),r=e.multiplyByScalar(t,1-i,r),e.add(tce,r,r)}static angleBetween(t,n){return e.normalize(t,nce),e.normalize(n,ice),P.acosClamped(e.dot(nce,ice))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,d3e);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};as.fromCartesian3=as.clone;as.fromCartesian4=as.clone;as.packedLength=2;as.fromArray=as.unpack;var gN=new as,tce=new as,nce=new as,ice=new as,d3e=new as;as.ZERO=Object.freeze(new as(0,0));as.ONE=Object.freeze(new as(1,1));as.UNIT_X=Object.freeze(new as(1,0));as.UNIT_Y=Object.freeze(new as(0,1));var U=as;var h3e=new h,m3e=new h;function p3e(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,h3e);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=m3e;E.x=A.x*b*2,E.y=A.y*x*2,E.z=A.z*T*2;let v=(1-y)*h.magnitude(e)/(.5*h.magnitude(E)),S=0,I,R,O,L,_,C,w,D,N,F,V;do{v-=S,O=1/(1+v*b),L=1/(1+v*x),_=1/(1+v*T),C=O*O,w=L*L,D=_*_,N=C*O,F=w*L,V=D*_,I=d*C+p*w+g*D-1,R=d*N*b+p*F*x+g*V*T;let B=-2*R;S=I/B}while(Math.abs(I)>P.EPSILON12);return l(r)?(r.x=o*O,r.y=s*L,r.z=a*_,r):new h(o*O,s*L,a*_)}var yE=p3e;var xl=class xl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new xl(t,n,i)}static fromDegrees(t,n,i,r){return t=P.toRadians(t),n=P.toRadians(n),xl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:xl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:xl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:xl._ellipsoidCenterToleranceSquared,a=yE(t,r,o,s,_3e);if(!l(a))return;let c=h.multiplyComponents(a,o,g3e);c=h.normalize(c,c);let u=h.subtract(t,a,y3e),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=P.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new xl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new xl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return xl.clone(this,t)}equals(t){return xl.equals(this,t)}equalsEpsilon(t,n){return xl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(xl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(xl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(xl,"_ellipsoidCenterToleranceSquared",P.EPSILON1);var LI=xl;LI.ZERO=Object.freeze(new LI(0,0,0));var g3e=new h,_3e=new h,y3e=new h,he=LI;function rce(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(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=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Tl=class e{constructor(t,n,i){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,rce(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&rce(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,he._ellipsoidOneOverRadii=t.oneOverRadii,he._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),s=o*Math.cos(i),a=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,P.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=A3e,r=b3e;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,T3e);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,x3e),o=h.subtract(t,i,E3e),s=Math.atan2(r.y,r.x),a=Math.asin(r.z),c=P.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=s,n.latitude=a,n.height=c,n):new he(s,a,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return yE(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*s.x+r*r*s.y+o*o*s.z);return h.multiplyByScalar(t,a,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new U);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,C3e),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,s=r*o**2;return U.fromElements(1/r,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=P.TWO_PI;let s=this._radiiSquared,a=s.x,c=s.y,u=s.z,f=a*c;return oce(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*oce(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+a*A*A)*p*p)})})}};Tl.WGS84=Object.freeze(new Tl(6378137,6378137,6356752314245179e-9));Tl.UNIT_SPHERE=Object.freeze(new Tl(1,1,1));Tl.MOON=Object.freeze(new Tl(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Tl.MARS=Object.freeze(new Tl(3396190,3396190,3376200));Tl._default=Tl.WGS84;Tl.packedLength=h.packedLength;Tl.prototype.geocentricSurfaceNormal=h.normalize;var A3e=new h,b3e=new h,x3e=new h,T3e=new h,E3e=new h,C3e=new h,v3e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],S3e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function oce(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*v3e[s];o+=S3e[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Tl;var Aq=class{constructor(t){this._ellipsoid=t??ee.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}},ji=Aq;var sce={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(sce);var $t=sce;function w3e(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var Pr=w3e;function I3e(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var mb=I3e;function P3e(e){return e%4===0&&e%100!==0||e%400===0}var Jf=P3e;var ace=[31,28,31,30,31,30,31,31,30,31,30,31];function D3e(e,t,n,i,r,o,s,a){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a;function y(){qr.typeOf.number.greaterThanOrEquals("Year",e,1),qr.typeOf.number.lessThanOrEquals("Year",e,9999),qr.typeOf.number.greaterThanOrEquals("Month",t,1),qr.typeOf.number.lessThanOrEquals("Month",t,12),qr.typeOf.number.greaterThanOrEquals("Day",n,1),qr.typeOf.number.lessThanOrEquals("Day",n,31),qr.typeOf.number.greaterThanOrEquals("Hour",i,0),qr.typeOf.number.lessThanOrEquals("Hour",i,23),qr.typeOf.number.greaterThanOrEquals("Minute",r,0),qr.typeOf.number.lessThanOrEquals("Minute",r,59),qr.typeOf.bool("IsLeapSecond",a),qr.typeOf.number.greaterThanOrEquals("Second",o,0),qr.typeOf.number.lessThanOrEquals("Second",o,a?60:59),qr.typeOf.number.greaterThanOrEquals("Millisecond",s,0),qr.typeOf.number.lessThan("Millisecond",s,1e3)}function A(){let b=t===2&&Jf(e)?ace[t-1]+1:ace[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Fm=D3e;function R3e(e,t){this.julianDate=e,this.offset=t}var yr=R3e;var cce={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};Object.freeze(cce);var Un=cce;var lce={UTC:0,TAI:1};Object.freeze(lce);var ai=lce;var uce=new Fm,bq=[31,28,31,30,31,30,31,31,30,31,30,31],xq=29;function Eq(e,t){return yi.compare(e.julianDate,t.julianDate)}var AE=new yr;function _N(e){AE.julianDate=e;let t=yi.leapSeconds,n=Pr(t,AE,Eq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&yi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),yi.addSeconds(e,i,e)}function fce(e,t){AE.julianDate=e;let n=yi.leapSeconds,i=Pr(n,AE,Eq);if(i<0&&(i=~i),i===0)return yi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return yi.addSeconds(e,-n[i-1].offset,t);let r=yi.secondsDifference(n[i].julianDate,e);if(r===0)return yi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return yi.addSeconds(e,-n[i-1].offset,t)}function E_(e,t,n){let i=t/Un.SECONDS_PER_DAY|0;return e+=i,t-=Un.SECONDS_PER_DAY*i,t<0&&(e--,t+=Un.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Tq(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(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 f=o+(i*Un.SECONDS_PER_HOUR+r*Un.SECONDS_PER_MINUTE+s*Un.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var O3e=/^(\d{4})$/,M3e=/^(\d{4})-(\d{2})$/,N3e=/^(\d{4})-?(\d{3})$/,L3e=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,F3e=/^(\d{4})-?(\d{2})-?(\d{2})$/,Cq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,B3e=/^(\d{2})(\.\d+)?/.source+Cq.source,k3e=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Cq.source,U3e=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Cq.source;var yi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ai.UTC;let r=t|0;n=n+(t-r)*Un.SECONDS_PER_DAY,E_(r,n,this),i===ai.UTC&&_N(this)}static fromGregorianDate(t,n){let i=Tq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(E_(i[0],i[1],n),_N(n),n):new e(i[0],i[1],ai.UTC)}static fromDate(t,n){let i=Tq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(E_(i[0],i[1],n),_N(n),n):new e(i[0],i[1],ai.UTC)}static fromIso8601(t,n){t=t.replace(",",".");let i=t.split("T"),r,o=1,s=1,a=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(F3e),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(M3e),i!==null)r=+i[1],o=+i[2];else if(i=d.match(O3e),i!==null)r=+i[1];else{let x;if(i=d.match(N3e),i!==null)r=+i[1],x=+i[2],m=Jf(r);else if(i=d.match(L3e),i!==null){r=+i[1];let T=+i[2],E=+i[3]||0,v=new Date(Date.UTC(r,0,4));x=T*7+E-v.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(x),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=Jf(r);let y;if(l(p)){i=p.match(U3e),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(k3e),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(B3e),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let x=i[y],T=+i[y+1],E=+(i[y+2]||0);switch(x){case"+":a=a-T,c=c-E;break;case"-":a=a+T,c=c+E;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}let A=u===60;for(A&&u--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(g=m&&o===2?xq:bq[o-1];s>g;)s-=g,o++,o>12&&(o-=12,r++),g=m&&o===2?xq:bq[o-1];for(;c<0;)c+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)o--,o<1&&(o+=12,r--),g=m&&o===2?xq:bq[o-1],s+=g;let b=Tq(r,o,s,a,c,u,f);return l(n)?(E_(b[0],b[1],n),_N(n)):n=new e(b[0],b[1],ai.UTC),A&&e.addSeconds(n,1,n),n}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=fce(t,yN);l(r)||(e.addSeconds(t,-1,yN),r=fce(yN,yN),i=!0);let o=r.dayNumber,s=r.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let u=4e3*(a+1)/1461001|0;a=a-(1461*u/4|0)+31|0;let f=80*a/2447|0,d=a-(2447*f/80|0)|0;a=f/11|0;let p=f+2-12*a|0,g=100*(c-49)+u+a|0,m=s/Un.SECONDS_PER_HOUR|0,y=s-m*Un.SECONDS_PER_HOUR,A=y/Un.SECONDS_PER_MINUTE|0;y=y-A*Un.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/Un.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Fm(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,uce),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,uce),r=i.year,o=i.month,s=i.day,a=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&s===1&&a===0&&c===0&&u===0&&f===0&&(r=9999,o=12,s=31,a=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ai.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/Un.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*Un.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/Un.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){AE.julianDate=t;let n=e.leapSeconds,i=Pr(n,AE,Eq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return E_(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_MINUTE;return E_(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_HOUR;return E_(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return E_(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},yN=new yi(0,0,ai.TAI);yi.leapSeconds=[new yr(new yi(2441317,43210,ai.TAI),10),new yr(new yi(2441499,43211,ai.TAI),11),new yr(new yi(2441683,43212,ai.TAI),12),new yr(new yi(2442048,43213,ai.TAI),13),new yr(new yi(2442413,43214,ai.TAI),14),new yr(new yi(2442778,43215,ai.TAI),15),new yr(new yi(2443144,43216,ai.TAI),16),new yr(new yi(2443509,43217,ai.TAI),17),new yr(new yi(2443874,43218,ai.TAI),18),new yr(new yi(2444239,43219,ai.TAI),19),new yr(new yi(2444786,43220,ai.TAI),20),new yr(new yi(2445151,43221,ai.TAI),21),new yr(new yi(2445516,43222,ai.TAI),22),new yr(new yi(2446247,43223,ai.TAI),23),new yr(new yi(2447161,43224,ai.TAI),24),new yr(new yi(2447892,43225,ai.TAI),25),new yr(new yi(2448257,43226,ai.TAI),26),new yr(new yi(2448804,43227,ai.TAI),27),new yr(new yi(2449169,43228,ai.TAI),28),new yr(new yi(2449534,43229,ai.TAI),29),new yr(new yi(2450083,43230,ai.TAI),30),new yr(new yi(2450630,43231,ai.TAI),31),new yr(new yi(2451179,43232,ai.TAI),32),new yr(new yi(2453736,43233,ai.TAI),33),new yr(new yi(2454832,43234,ai.TAI),34),new yr(new yi(2456109,43235,ai.TAI),35),new yr(new yi(2457204,43236,ai.TAI),36),new yr(new yi(2457754,43237,ai.TAI),37)];var K=yi;var Oce=js(Qu(),1);function z3e(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var TN=z3e;function yce(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=yce(r,t)),n[i]=r}return n}var Ze=yce;function Ace(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Ace(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Mt=Ace;function V3e(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var ef=V3e;var bce=js(Qu(),1);function vq(e,t){let n;return typeof document<"u"&&(n=document),vq._implementation(e,t,n)}vq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new bce.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var fh=vq;var xce=js(Qu(),1);function j3e(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new xce.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var EN=j3e;var Tce=js(Qu(),1);function H3e(e){let t=new Tce.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 C_=H3e;var Ece={};function G3e(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Ece[t];l(i)||(i={},Ece[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var Bm=G3e;var W3e=/^blob:/i;function q3e(e){return W3e.test(e)}var TE=q3e;var km;function Y3e(e){l(km)||(km=document.createElement("a")),km.href=window.location.href;let t=km.host,n=km.protocol;return km.href=e,km.href=km.href,n!==km.protocol||t!==km.host}var pb=Y3e;var X3e=/^data:/i;function K3e(e){return X3e.test(e)}var Um=K3e;function $3e(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var EE=$3e;function J3e(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var CE=J3e;function Z3e(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[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 Zf=Z3e;var Cce={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Cce);var wi=Cce;var vce={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(vce);var oa=vce;function CN(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??oa.OTHER,this.serverKey=e.serverKey,this.state=wi.UNISSUED,this.deferred=void 0,this.cancelled=!1}CN.prototype.cancel=function(){this.cancelled=!0};CN.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=wi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new CN(this)};var Oo=CN;function Q3e(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var vN=Q3e;function Sce(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=vN(this.responseHeaders))}Sce.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var R0=Sce;var wN=js(Qu(),1);function FI(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(FI.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});FI.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return wq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function wq(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}FI.prototype.removeEventListener=function(e,t){let n=Sq(this,this._listeners,e,t),i=Sq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function Sq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!wq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}FI.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)wq(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)Sq(this,this._listeners,e,n);this._toRemove.clear()};var be=FI;function gb(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(gb.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 Iq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}gb.prototype.reserve=function(e){e=e??this._length,this._array.length=e};gb.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(Iq(i,r,e),e=r):o=!1}};gb.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};gb.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)Iq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};gb.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Iq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var SN=gb;function eUe(e,t){return e.priority-t.priority}var Tr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},vE=20,Fc=new SN({comparator:eUe});Fc.maximumLength=vE;Fc.reserve(vE);var zm=[],O0={},tUe=typeof document<"u"?new wN.default(document.location.href):new wN.default,IN=new be;function xo(){}xo.maximumRequests=50;xo.maximumRequestsPerServer=18;xo.requestsByServer={};xo.throttleRequests=!0;xo.debugShowStatistics=!1;xo.requestCompletedEvent=IN;Object.defineProperties(xo,{statistics:{get:function(){return Tr}},priorityHeapLength:{get:function(){return vE},set:function(e){if(e<vE)for(;Fc.length>e;){let t=Fc.pop();_b(t)}vE=e,Fc.maximumLength=e,Fc.reserve(e)}}});function wce(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}xo.serverHasOpenSlots=function(e,t){t=t??1;let n=xo.requestsByServer[e]??xo.maximumRequestsPerServer;return O0[e]+t<=n};xo.heapHasOpenSlots=function(e){return Fc.length+e<=vE};function Ice(e){return e.state===wi.UNISSUED&&(e.state=wi.ISSUED,e.deferred=ef()),e.deferred.promise}function nUe(e){return function(t){if(e.state===wi.CANCELLED)return;let n=e.deferred;--Tr.numberOfActiveRequests,--O0[e.serverKey],IN.raiseEvent(),e.state=wi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function iUe(e){return function(t){e.state!==wi.CANCELLED&&(++Tr.numberOfFailedRequests,--Tr.numberOfActiveRequests,--O0[e.serverKey],IN.raiseEvent(t),e.state=wi.FAILED,e.deferred.reject(t))}}function Pce(e){let t=Ice(e);return e.state=wi.ACTIVE,zm.push(e),++Tr.numberOfActiveRequests,++Tr.numberOfActiveRequestsEver,++O0[e.serverKey],e.requestFunction().then(nUe(e)).catch(iUe(e)),t}function _b(e){let t=e.state===wi.ACTIVE;if(e.state=wi.CANCELLED,++Tr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Tr.numberOfActiveRequests,--O0[e.serverKey],++Tr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}xo.update=function(){let e,t,n=0,i=zm.length;for(e=0;e<i;++e){if(t=zm[e],t.cancelled&&_b(t),t.state!==wi.ACTIVE){++n;continue}n>0&&(zm[e-n]=t)}zm.length-=n;let r=Fc.internalArray,o=Fc.length;for(e=0;e<o;++e)wce(r[e]);Fc.resort();let s=Math.max(xo.maximumRequests-zm.length,0),a=0;for(;a<s&&Fc.length>0;){if(t=Fc.pop(),t.cancelled){_b(t);continue}if(t.throttleByServer&&!xo.serverHasOpenSlots(t.serverKey)){_b(t);continue}Pce(t),++a}rUe()};xo.getServerKey=function(e){let t=new wN.default(e);t.scheme()===""&&(t=t.absoluteTo(tUe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=O0[n];return l(i)||(O0[n]=0),n};xo.request=function(e){if(Um(e.url)||TE(e.url))return IN.raiseEvent(),e.state=wi.RECEIVED,e.requestFunction();if(++Tr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=xo.getServerKey(e.url)),xo.throttleRequests&&e.throttleByServer&&!xo.serverHasOpenSlots(e.serverKey))return;if(!xo.throttleRequests||!e.throttle)return Pce(e);if(zm.length>=xo.maximumRequests)return;wce(e);let t=Fc.insert(e);if(l(t)){if(t===e)return;_b(t)}return Ice(e)};function rUe(){xo.debugShowStatistics&&(Tr.numberOfActiveRequests===0&&Tr.lastNumberOfActiveRequests>0&&(Tr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Tr.numberOfAttemptedRequests}`),Tr.numberOfAttemptedRequests=0),Tr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Tr.numberOfCancelledRequests}`),Tr.numberOfCancelledRequests=0),Tr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Tr.numberOfCancelledActiveRequests}`),Tr.numberOfCancelledActiveRequests=0),Tr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Tr.numberOfFailedRequests}`),Tr.numberOfFailedRequests=0)),Tr.lastNumberOfActiveRequests=Tr.numberOfActiveRequests)}xo.clearForSpecs=function(){for(;Fc.length>0;){let t=Fc.pop();_b(t)}let e=zm.length;for(let t=0;t<e;++t)_b(zm[t]);zm.length=0,O0={},Tr.numberOfAttemptedRequests=0,Tr.numberOfActiveRequests=0,Tr.numberOfCancelledRequests=0,Tr.numberOfCancelledActiveRequests=0,Tr.numberOfFailedRequests=0,Tr.numberOfActiveRequestsEver=0,Tr.lastNumberOfActiveRequests=0};xo.numberOfActiveRequestsByServer=function(e){return O0[e]};xo.requestHeap=Fc;var El=xo;var Dce=js(Qu(),1);var BI={},SE={};BI.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(SE[n])||(SE[n]=!0)};BI.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(SE[n])&&delete SE[n]};function oUe(e){let t=new Dce.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}}BI.contains=function(e){let t=oUe(e);return!!(l(t)&&l(SE[t]))};BI.clear=function(){SE={}};var kI=BI;var Mce=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function kt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Vm(e.templateValues,{}),this._queryParameters=Vm(e.queryParameters,{}),this.headers=Vm(e.headers,{}),this.request=e.request??new Oo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Vm(e,t){return l(e)?Ze(e):t}kt.createIfNeeded=function(e){return e instanceof kt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new kt({url:e})};var wE;kt.supportsImageBitmapOptions=function(){return l(wE)?wE:typeof createImageBitmap!="function"?(wE=Promise.resolve(!1),wE):(wE=kt.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=Bm(t[0]),i=Bm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),wE)};Object.defineProperties(kt,{isBlobSupported:{get:function(){return Mce}}});Object.defineProperties(kt.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 C_(this._url)}},isDataUri:{get:function(){return Um(this._url)}},isBlobUri:{get:function(){return TE(this._url)}},isCrossOriginUrl:{get:function(){return pb(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});kt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};kt.prototype.parseUrl=function(e,t,n,i){let r=new Oce.default(e),o=sUe(r.query());this._queryParameters=t?DN(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(fh(i))),this._url=r.toString()};function sUe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Zf(e)}function DN(e,t,n){if(!n)return Mt(e,t);let i=Ze(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}kt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${aUe(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(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function aUe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${CE(e)}`}kt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=DN(this._queryParameters,e,!1):this._queryParameters=DN(e,this._queryParameters,!1)};kt.prototype.appendQueryParameters=function(e){this._queryParameters=DN(e,this._queryParameters,!0)};kt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Mt(this._templateValues,e):this._templateValues=Mt(e,this._templateValues)};kt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Mt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Mt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Mt(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};kt.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})};kt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ze(this._queryParameters),e._templateValues=Ze(this._templateValues),e.headers=Ze(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new kt({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})};kt.prototype.getBaseUri=function(e){return EN(this.getUrlComponent(e),e)};kt.prototype.appendForwardSlash=function(){this._url=TN(this._url)};kt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};kt.fetchArrayBuffer=function(e){return new kt(e).fetchArrayBuffer()};kt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};kt.fetchBlob=function(e){return new kt(e).fetchBlob()};kt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(Pq(this.request),!Mce||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return kt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return kt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new kt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};kt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=ef();return kt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=El.request(o);if(l(s))return s.catch(function(a){return o.state!==wi.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=wi.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})};kt.fetchImage=function(e){return new kt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};kt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};kt.fetchText=function(e){return new kt(e).fetchText()};kt.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)})};kt.fetchJson=function(e){return new kt(e).fetchJson()};kt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};kt.fetchXML=function(e){return new kt(e).fetchXML()};kt.prototype.fetchJsonp=function(e){e=e??"callback",Pq(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Nce(this,e,t)};function Nce(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=ef();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},kt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=El.request(r);if(l(s))return s.catch(function(a){return r.state!==wi.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=wi.UNISSUED,r.deferred=void 0,Nce(e,t,n)):Promise.reject(a)})})}kt.fetchJsonp=function(e){return new kt(e).fetchJsonp(e.callbackParameterName)};kt.prototype._makeRequest=function(e){let t=this;Pq(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=Mt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=ef(),d=kt._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=El.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==wi.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=wi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function Pq(e){if(e.state===wi.ISSUED||e.state===wi.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=wi.UNISSUED,e.deferred=void 0}var cUe=/^data:(.*?)(;base64)?,(.*)$/;function PN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Rce(e,t){let n=PN(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function lUe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return PN(i,r);case"arraybuffer":return Rce(i,r);case"blob":return o=Rce(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(PN(i,r),n);case"json":return JSON.parse(PN(i,r));default:}}kt.prototype.fetch=function(e){return e=Vm(e,{}),e.method="GET",this._makeRequest(e)};kt.fetch=function(e){return new kt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.delete=function(e){return e=Vm(e,{}),e.method="DELETE",this._makeRequest(e)};kt.delete=function(e){return new kt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};kt.prototype.head=function(e){return e=Vm(e,{}),e.method="HEAD",this._makeRequest(e)};kt.head=function(e){return new kt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.options=function(e){return e=Vm(e,{}),e.method="OPTIONS",this._makeRequest(e)};kt.options=function(e){return new kt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.post=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};kt.post=function(e){return new kt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.put=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};kt.put=function(e){return new kt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.patch=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};kt.patch=function(e){return new kt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt._Implementations={};kt._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(r){n.reject(r)},t&&(kI.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};kt._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;kt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){kt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=ef(),p=kt._Implementations.loadWithXhr(a,u,f,void 0,s,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${a} but it contained no content.`));return}return kt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};kt.createImageBitmapFromBlob=function(e,t){return qr.defined("options",t),qr.typeOf.bool("options.flipY",t.flipY),qr.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),qr.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function uUe(e,t,n,i,r,o,s){fetch(e,{method:n,headers:r}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),o.reject(new R0(a.status,a,c));return}switch(t){case"text":o.resolve(a.text());break;case"json":o.resolve(a.json());break;default:o.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new R0)})}var fUe=typeof XMLHttpRequest>"u";kt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=cUe.exec(e);if(a!==null){o.resolve(lUe(a,t));return}if(fUe){uUe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(kI.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new R0(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new R0)},c.send(i),c};kt._Implementations.loadAndExecuteScript=function(e,t,n){return EE(e,t).catch(function(i){n.reject(i)})};kt._DefaultImplementations={};kt._DefaultImplementations.createImage=kt._Implementations.createImage;kt._DefaultImplementations.loadWithXhr=kt._Implementations.loadWithXhr;kt._DefaultImplementations.loadAndExecuteScript=kt._Implementations.loadAndExecuteScript;kt.DEFAULT=Object.freeze(new kt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=kt;function zI(e){e=e??H.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=e.addNewLeapSeconds??!0,l(e.data)?Lce(this,e.data):Lce(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}zI.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new zI({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};zI.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 mb(0,0,0,0,0),t}});zI.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new mb(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,r,o;if(l(i)){let a=n[i],c=n[i+1],u=K.lessThanOrEquals(a,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,Bce(this,n,this._samples,e,r,o,t),t}let s=Pr(n,e,K.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,Bce(this,n,this._samples,e,r,o,t),t};function dUe(e,t){return K.compare(e.julianDate,t)}function Lce(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+Un.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,ai.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,E=Pr(T,x,dUe);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function Fce(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function UI(e,t,n){return t+e*(n-t)}function Bce(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return Fce(e,n,r,a,s),s;if(i.equals(u))return Fce(e,n,o,a,s),s;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return s.xPoleWander=UI(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=UI(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=UI(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=UI(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=UI(f,g,m),s}var RN=zI;function Bc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Bc.fromQuaternion=function(e,t){l(t)||(t=new Bc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=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,o),t.roll=Math.atan2(r,i),t.pitch=-P.asinClamped(n),t};Bc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Bc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Bc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Bc(e.heading,e.pitch,e.roll)};Bc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Bc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Bc.prototype.clone=function(e){return Bc.clone(this,e)};Bc.prototype.equals=function(e){return Bc.equals(this,e)};Bc.prototype.equalsEpsilon=function(e,t,n){return Bc.equalsEpsilon(this,e,t,n)};Bc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var kc=Bc;var kce=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function hUe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=kce.exec(i);if(r!==null)return r[1]}}var ON;function Uce(e){return typeof document>"u"?e:(l(ON)||(ON=document.createElement("a")),ON.href=e,ON.href)}var yb;function zce(){if(l(yb))return yb;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=fh(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(eN.toUrl)?e=fh("..",Ab("Core/buildModuleUrl.js")):e=hUe(),yb=new De({url:Uce(e)}),yb.appendForwardSlash(),yb}function mUe(e){return Uce(eN.toUrl(`../${e}`))}function Vce(e){return zce().getDerivedResource({url:e}).url}var MN;function Ab(e){return l(MN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(eN.toUrl)?MN=mUe:MN=Vce),MN(e)}Ab._cesiumScriptRegex=kce;Ab._buildModuleUrlFromBaseUrl=Vce;Ab._clearBaseResource=function(){yb=void 0};Ab.setBaseUrl=function(e){yb=De.DEFAULT.getDerivedResource({url:e})};Ab.getCesiumBaseUrl=zce;var Zt=Ab;function pUe(e,t,n){this.x=e,this.y=t,this.s=n}var IE=pUe;function NN(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,ai.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var gUe=new K(0,0,ai.TAI);function Dq(e,t,n){let i=gUe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}NN.prototype.preload=function(e,t,n,i){let r=Dq(this,e,t),o=Dq(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(Rq(this,d));return Promise.all(f)};NN.prototype.computeXysRadians=function(e,t,n){let i=Dq(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(Rq(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(Rq(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new IE(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(s+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};NN.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function _Ue(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function Rq(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=_Ue(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var LN=NN;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var VI=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);VI=h.normalize(e,VI);let o=VI.x*r,s=VI.y*r,a=VI.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new dt(o,s,a,c)};var yUe=[1,2,0],AUe=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=yUe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=AUe;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new dt(i,r,o,s)};var jce=new dt,Hce=new dt,Oq=new dt,Gce=new dt;dt.fromHeadingPitchRoll=function(e,t){return Gce=dt.fromAxisAngle(h.UNIT_X,e.roll,jce),Oq=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(Oq,Gce,Oq),Hce=dt.fromAxisAngle(h.UNIT_Z,-e.heading,jce),dt.multiply(Hce,t,t)};var FN=new h,Mq=new h,dh=new dt,Wce=new dt,BN=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,BN),dt.conjugate(BN,BN);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,dh),dt.multiply(dh,BN,dh),dh.w<0&&dt.negate(dh,dh),dt.computeAxis(dh,FN);let a=dt.computeAngle(dh);l(i)||(i=[]),i[s]=FN.x*a,i[s+1]=FN.y*a,i[s+2]=FN.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,Mq);let o=h.magnitude(Mq);return dt.unpack(t,i*4,Wce),o===0?dt.clone(dt.IDENTITY,dh):dt.fromAxisAngle(Mq,o,dh),dt.multiply(dh,Wce,r)};dt.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 dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.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};dt.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};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};dt.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};dt.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};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.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};dt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var Nq=new dt;dt.lerp=function(e,t,n,i){return Nq=dt.multiplyByScalar(t,n,Nq),i=dt.multiplyByScalar(e,1-n,i),dt.add(Nq,i,i)};var qce=new dt,Lq=new dt,Fq=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=qce=dt.negate(t,qce)),1-r<P.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return Lq=dt.multiplyByScalar(e,Math.sin((1-n)*s),Lq),Fq=dt.multiplyByScalar(o,Math.sin(n*s),Fq),i=dt.add(Lq,Fq,i),dt.multiplyByScalar(i,1/Math.sin(s),i)};dt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=h.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 bUe=new h,xUe=new h,jI=new dt,PE=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,jI);dt.multiply(r,n,PE);let o=dt.log(PE,bUe);dt.multiply(r,e,PE);let s=dt.log(PE,xUe);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,jI),dt.multiply(t,jI,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,jI),a=dt.slerp(n,i,r,PE);return dt.slerp(s,a,2*r*(1-r),o)};var TUe=new dt,Yce=1.9011074535173003,kN=dn.supportsTypedArrays()?new Float32Array(8):[],UN=dn.supportsTypedArrays()?new Float32Array(8):[],M0=dn.supportsTypedArrays()?new Float32Array(8):[],N0=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;kN[e]=1/(t*n),UN[e]=t/n}kN[7]=Yce/136;UN[7]=Yce*8/17;dt.fastSlerp=function(e,t,n,i){let r=dt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)M0[g]=(kN[g]*c-UN[g])*s,N0[g]=(kN[g]*u-UN[g])*s;let f=o*n*(1+M0[0]*(1+M0[1]*(1+M0[2]*(1+M0[3]*(1+M0[4]*(1+M0[5]*(1+M0[6]*(1+M0[7])))))))),d=a*(1+N0[0]*(1+N0[1]*(1+N0[2]*(1+N0[3]*(1+N0[4]*(1+N0[5]*(1+N0[6]*(1+N0[7])))))))),p=dt.multiplyByScalar(e,d,TUe);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,r,o){let s=dt.fastSlerp(e,t,r,jI),a=dt.fastSlerp(n,i,r,PE);return dt.fastSlerp(s,a,2*r*(1-r),o)};dt.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};dt.equalsEpsilon=function(e,t,n){return n=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};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=dt;var Ai={},Bq={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"}},DE={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kq={},ou={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},v_=new h,S_=new h,w_=new h;Ai.localFrameToFixedFrameGenerator=function(e,t){if(!Bq.hasOwnProperty(e)||!Bq[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=Bq[e][t],i,r=e+t;return l(kq[r])?i=kq[r]:(i=function(o,s,a){if(l(a)||(a=new M),h.equalsEpsilon(o,h.ZERO,P.EPSILON14))h.unpack(DE[e],0,v_),h.unpack(DE[t],0,S_),h.unpack(DE[n],0,w_);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);h.unpack(DE[e],0,v_),e!=="east"&&e!=="west"&&h.multiplyByScalar(v_,c,v_),h.unpack(DE[t],0,S_),t!=="east"&&t!=="west"&&h.multiplyByScalar(S_,c,S_),h.unpack(DE[n],0,w_),n!=="east"&&n!=="west"&&h.multiplyByScalar(w_,c,w_)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,ou.up);let c=ou.up,u=ou.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,ou.east),h.cross(c,u,ou.north),h.multiplyByScalar(ou.up,-1,ou.down),h.multiplyByScalar(ou.east,-1,ou.west),h.multiplyByScalar(ou.north,-1,ou.south),v_=ou[e],S_=ou[t],w_=ou[n]}return a[0]=v_.x,a[1]=v_.y,a[2]=v_.z,a[3]=0,a[4]=S_.x,a[5]=S_.y,a[6]=S_.z,a[7]=0,a[8]=w_.x,a[9]=w_.y,a[10]=w_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},kq[r]=i),i};Ai.eastNorthUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("east","north");Ai.northEastDownToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","east");Ai.northUpEastToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","up");Ai.northWestUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","west");var EUe=new Le,CUe=new h(1,1,1),vUe=new M;Ai.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ai.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,EUe),s=M.fromTranslationQuaternionRotationScale(h.ZERO,o,CUe,vUe);return r=i(e,n,r),M.multiply(r,s,r)};var SUe=new M,wUe=new $;Ai.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ai.headingPitchRollToFixedFrame(e,t,n,i,SUe),s=M.getMatrix3(o,wUe);return Le.fromRotationMatrix(s,r)};var IUe=new h(1,1,1),PUe=new h,Xce=new M,DUe=new M,RUe=new $,OUe=new Le;Ai.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??Ai.eastNorthUpToFixedFrame,l(i)||(i=new kc);let r=M.getTranslation(e,PUe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=M.inverseTransformation(n(r,t,Xce),Xce),s=M.setScale(e,IUe,DUe);s=M.setTranslation(s,h.ZERO,s),o=M.multiply(o,s,o);let a=Le.fromRotationMatrix(M.getMatrix3(o,RUe),OUe);return a=Le.normalize(a,a),kc.fromQuaternion(a,i)};var MUe=6*3600+2460+50.54841,NUe=8640184812866e-6,LUe=.093104,FUe=-62e-7,BUe=11772758384668e-32,kUe=72921158553e-15,UUe=P.TWO_PI/86400,zN=new K;Ai.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ai.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ai.computeTemeToPseudoFixedMatrix(e,t)),n};Ai.computeTemeToPseudoFixedMatrix=function(e,t){zN=K.addSeconds(e,-K.computeTaiMinusUtc(e),zN);let n=zN.dayNumber,i=zN.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Un.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Un.DAYS_PER_JULIAN_CENTURY;let a=(MUe+r*(NUe+r*(LUe+r*FUe)))*UUe%P.TWO_PI,c=kUe+BUe*(n-24515455e-1),u=(i+Un.SECONDS_PER_DAY*.5)%Un.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};Ai.iau2006XysData=new LN;Ai.earthOrientationParameters=RN.NONE;var Vq=32.184,zUe=2451545;Ai.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Vq,i=e.stop.dayNumber,r=e.stop.secondsOfDay+Vq;return Ai.iau2006XysData.preload(t,n,i,r)};Ai.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ai.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var VUe=32.184,jUe=2451545,VN=new kc,HUe=new $,GUe=new K;Ai.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,VUe,GUe),i=K.totalDays(n)-jUe,r=P.toRadians(12.112)-P.toRadians(.052992)*i,o=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return VN.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(r)-P.toRadians(.12)*Math.sin(o)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),VN.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(r)+P.toRadians(.24)*Math.cos(o)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),VN.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(r)+P.toRadians(.121)*Math.sin(o)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(VN,HUe,t)};Ai.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ai.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var WUe=new IE(0,0,0),qUe=new mb(0,0,0,0,0,0),Uq=new $,zq=new $;Ai.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ai.earthOrientationParameters.compute(e,qUe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+Vq,o=Ai.iau2006XysData.computeXysRadians(i,r,WUe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=Uq;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,zq),d=$.multiply(u,f,Uq),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/Un.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*P.TWO_PI;let b=$.fromRotationZ(A,zq),x=$.multiply(d,b,Uq),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-zUe+r/Un.SECONDS_PER_DAY;I/=36525;let R=-47e-6*I*P.RADIANS_PER_DEGREE/3600,O=Math.cos(R),L=Math.sin(R),_=zq;return _[0]=T*O,_[1]=T*L,_[2]=v,_[3]=-E*L+S*v*O,_[4]=E*O+S*v*L,_[5]=-S*T,_[6]=-S*L-E*v*O,_[7]=S*O-E*v*L,_[8]=E*T,$.multiply(x,_,t)};var YUe=new se;Ai.pointToWindowCoordinates=function(e,t,n,i){return i=Ai.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ai.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=YUe;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),M.multiplyByVector(t,r,r),U.fromCartesian4(r,i)};var XUe=new h,KUe=new h,$Ue=new h;Ai.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,XUe),o=h.cross(t,r,KUe);h.equalsEpsilon(o,h.ZERO,P.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,$Ue);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ai.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Kce=new he,jq=new h,JUe=new h,ZUe=new $,Hq=new M,$ce=new M;Ai.basisTo2D=function(e,t,n){let i=M.getTranslation(t,JUe),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,jq);else{let f=r.cartesianToCartographic(i,Kce);o=e.project(f,jq),h.fromElements(o.z,o.x,o.y,o)}let s=Ai.eastNorthUpToFixedFrame(i,r,Hq),a=M.inverseTransformation(s,$ce),c=M.getMatrix3(t,ZUe),u=M.multiplyByMatrix3(a,c,n);return M.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,o,n),n};Ai.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ai.eastNorthUpToFixedFrame(t,i,Hq),o=M.inverseTransformation(r,$ce),s=i.cartesianToCartographic(t,Kce),a=e.project(s,jq);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,Hq);return M.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,o,n),M.multiply(c,n,n),n};var At=Ai;var RE=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=P.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=P.toRadians(t??0),n=P.toRadians(n??0),i=P.toRadians(i??0),r=P.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>P.PI&&(r=r-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new e(i,a,r,c)}static fromCartesianArray(t,n,i){n=n??ee.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+P.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-r>a-s&&(r=s,o=a,o>P.PI&&(o=o-P.TWO_PI),r>P.PI&&(r=r-P.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=ee.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=At.eastNorthUpToFixedFrame(r,n,QUe),a=M.multiplyByPointAsVector(s,h.UNIT_X,eze);h.normalize(a,a);let c=M.multiplyByPointAsVector(s,h.UNIT_Y,tze);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,ize),f=h.negate(a,nze),d=Gq,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,a,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new he(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new he(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new he(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new he(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=P.TWO_PI);let o=P.negativePiToPi((r+i)*.5),s=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new he(o,s)}static intersection(t,n,i){let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=P.TWO_PI:s<a&&r>0&&(s+=P.TWO_PI),r<o&&a<0?a+=P.TWO_PI:s<a&&o<0&&(o+=P.TWO_PI);let c=P.negativePiToPi(Math.max(o,a)),u=P.negativePiToPi(Math.min(r,s));if(c===P.PI&&u<P.PI&&(c=-P.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||r>=s))return l(i)?(i.west=r,i.south=o,i.east=s,i.north=a,i):new e(r,o,s,a)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=P.TWO_PI:s<a&&r>0&&(s+=P.TWO_PI),r<o&&a<0?a+=P.TWO_PI:s<a&&o<0&&(o+=P.TWO_PI);let c=P.negativePiToPi(Math.min(o,a)),u=P.negativePiToPi(Math.max(r,s));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,s=t.east;return s<o&&(s+=P.TWO_PI,i<0&&(i+=P.TWO_PI)),(i>o||P.equalsEpsilon(i,o,P.EPSILON14))&&(i<s||P.equalsEpsilon(i,s,P.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??ee.default,i=i??0,l(r)||(r=[]);let o=0,s=t.north,a=t.south,c=t.east,u=t.west,f=rze;f.height=i,f.longitude=u,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,s<0?f.latitude=s:a>0?f.latitude=a:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*P.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+r*c}else{let c=P.TWO_PI+t.east-t.west;s.west=P.negativePiToPi(t.west+n*c),s.east=P.negativePiToPi(t.west+r*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+o*a,n===1&&(s.west=t.east),r===1&&(s.east=t.east),i===1&&(s.south=t.north),o===1&&(s.north=t.north),s}};RE.packedLength=4;var QUe=new M,eze=new h,tze=new h,nze=new h,ize=new h,Gq=new Array(5);for(let e=0;e<Gq.length;++e)Gq[e]=new h;var rze=new he;RE.MAX_VALUE=Object.freeze(new RE(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ie=RE;function cs(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}cs.packedLength=4;cs.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};cs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new cs),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};cs.fromPoints=function(e,t){if(l(t)||(t=new cs),!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,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var Jce=new ji,oze=new he,sze=new he;cs.fromRectangle=function(e,t,n){if(l(n)||(n=new cs),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;Jce._ellipsoid=ee.default,t=t??Jce;let i=t.project(ie.southwest(e,oze)),r=t.project(ie.northeast(e,sze));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};cs.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 cs(e.x,e.y,e.width,e.height)};cs.union=function(e,t,n){l(n)||(n=new cs);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=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=r,n.width=o-i,n.height=s-r,n};cs.expand=function(e,t,n){n=cs.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};cs.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};cs.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};cs.prototype.clone=function(e){return cs.clone(this,e)};cs.prototype.intersect=function(e){return cs.intersect(this,e)};cs.prototype.equals=function(e){return cs.equals(this,e)};var et=cs;var Wa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};Wa.isLines=function(e){return e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP};Wa.isTriangles=function(e){return e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Wa.validate=function(e){return e===Wa.POINTS||e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP||e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Object.freeze(Wa);var Oe=Wa;var OE=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; void main() @@ -85,57 +85,61 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var mr={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 ew(e){e=e??W.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Me.TRIANGLES,this._vertexArray=e.vertexArray,this._count=e.count,this._offset=e.offset??0,this._instanceCount=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=e.cull??!0,this.occlude=e.occlude??!0,this.executeInClosestFrustum=e.executeInClosestFrustum??!1,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.castShadows=e.castShadows??!1,this.receiveShadows=e.receiveShadows??!1,this.pickOnly=e.pickOnly??!1,this.depthForTranslucentClassification=e.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ka(e,t){return(e._flags&t)===t}function H_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(ew.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 Ka(this,mr.CULL)},set:function(e){Ka(this,mr.CULL)!==e&&(H_(this,mr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ka(this,mr.OCCLUDE)},set:function(e){Ka(this,mr.OCCLUDE)!==e&&(H_(this,mr.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 Ka(this,mr.CAST_SHADOWS)},set:function(e){Ka(this,mr.CAST_SHADOWS)!==e&&(H_(this,mr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ka(this,mr.RECEIVE_SHADOWS)},set:function(e){Ka(this,mr.RECEIVE_SHADOWS)!==e&&(H_(this,mr.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 Ka(this,mr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ka(this,mr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(H_(this,mr.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 Ka(this,mr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ka(this,mr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(H_(this,mr.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 Ka(this,mr.PICK_ONLY)},set:function(e){Ka(this,mr.PICK_ONLY)!==e&&(H_(this,mr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ka(this,mr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ka(this,mr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(H_(this,mr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});ew.shallowClone=function(e,t){if(c(e))return c(t)||(t=new ew),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};ew.prototype.execute=function(e,t){e.draw(this,t)};var Je=ew;var li={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};li.toWebGLConstant=function(e,t){switch(e){case li.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case li.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case li.UNSIGNED_INT:return ne.UNSIGNED_INT;case li.FLOAT:return ne.FLOAT;case li.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case li.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case li.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case li.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case li.UNSIGNED_SHORT_5_6_5:return li.UNSIGNED_SHORT_5_6_5}};li.isPacked=function(e){return e===li.UNSIGNED_INT_24_8||e===li.UNSIGNED_SHORT_4_4_4_4||e===li.UNSIGNED_SHORT_5_5_5_1||e===li.UNSIGNED_SHORT_5_6_5};li.sizeInBytes=function(e){switch(e){case li.UNSIGNED_BYTE:return 1;case li.UNSIGNED_SHORT:case li.UNSIGNED_SHORT_4_4_4_4:case li.UNSIGNED_SHORT_5_5_5_1:case li.UNSIGNED_SHORT_5_6_5:case li.HALF_FLOAT:return 2;case li.UNSIGNED_INT:case li.FLOAT:case li.UNSIGNED_INT_24_8:return 4}};li.validate=function(e){return e===li.UNSIGNED_BYTE||e===li.UNSIGNED_SHORT||e===li.UNSIGNED_INT||e===li.FLOAT||e===li.HALF_FLOAT||e===li.UNSIGNED_INT_24_8||e===li.UNSIGNED_SHORT_4_4_4_4||e===li.UNSIGNED_SHORT_5_5_5_1||e===li.UNSIGNED_SHORT_5_6_5};li.getTypedArrayConstructor=function(e){let t=li.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===li.FLOAT?Float32Array:Uint32Array};var Ue=Object.freeze(li);var rt={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.RED||e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=rt.componentsLength(e)*n*i;return new o(r)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let l=0;l<o;++l){let u=l*i*s,f=(o-l-1)*i*s;for(let h=0;h<a;++h)r[f+h]=e[u+h]}return r};rt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===rt.DEPTH_STENCIL)return ne.DEPTH24_STENCIL8;if(e===rt.DEPTH_COMPONENT){if(t===Ue.UNSIGNED_SHORT)return ne.DEPTH_COMPONENT16;if(t===Ue.UNSIGNED_INT)return ne.DEPTH_COMPONENT24}if(t===Ue.FLOAT)switch(e){case rt.RGBA:return ne.RGBA32F;case rt.RGB:return ne.RGB32F;case rt.RG:return ne.RG32F;case rt.RED:return ne.R32F}if(t===Ue.HALF_FLOAT)switch(e){case rt.RGBA:return ne.RGBA16F;case rt.RGB:return ne.RGB16F;case rt.RG:return ne.RG16F;case rt.RED:return ne.R16F}return e};var ke=Object.freeze(rt);var pr={_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(pr,{maximumCombinedTextureImageUnits:{get:function(){return pr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return pr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return pr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return pr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return pr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return pr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return pr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return pr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return pr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return pr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return pr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return pr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return pr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return pr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return pr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return pr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return pr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return pr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return pr._maximumColorAttachments}},maximumSamples:{get:function(){return pr._maximumSamples}},highpFloatSupported:{get:function(){return pr._highpFloatSupported}},highpIntSupported:{get:function(){return pr._highpIntSupported}}});var ut=pr;function L5(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function JO(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function cd(e){e=e??W.EMPTY_OBJECT;let t=e.context;T.defined("options.context",t);let n=t._gl,i=ut.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=e.destroyAttachments??!0,c(e.colorTextures)&&c(e.colorRenderbuffers))throw new C("Cannot have both color texture and color renderbuffer attachments.");if(c(e.depthTexture)&&c(e.depthRenderbuffer))throw new C("Cannot have both a depth texture and depth renderbuffer attachment.");if(c(e.depthStencilTexture)&&c(e.depthStencilRenderbuffer))throw new C("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");let o=c(e.depthTexture)||c(e.depthRenderbuffer),r=c(e.depthStencilTexture)||c(e.depthStencilRenderbuffer);if(o&&r)throw new C("Cannot have both a depth and depth-stencil attachment.");if(c(e.stencilRenderbuffer)&&r)throw new C("Cannot have both a stencil and depth-stencil attachment.");if(o&&c(e.stencilRenderbuffer))throw new C("Cannot have both a depth and stencil attachment.");if(this._bind(),c(e.colorTextures)){let s=e.colorTextures,a=this._colorTextures.length=this._activeColorAttachments.length=s.length;if(a>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let u=s[l];if(!ke.isColorFormat(u.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(u.pixelDatatype===Ue.FLOAT&&!t.colorBufferFloat)throw new C("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(u.pixelDatatype===Ue.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new C("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");let f=this._gl.COLOR_ATTACHMENT0+l;L5(this,f,u),this._activeColorAttachments[l]=f,this._colorTextures[l]=u}}if(c(e.colorRenderbuffers)){let s=e.colorRenderbuffers,a=this._colorRenderbuffers.length=this._activeColorAttachments.length=s.length;if(a>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let u=s[l],f=this._gl.COLOR_ATTACHMENT0+l;JO(this,f,u),this._activeColorAttachments[l]=f,this._colorRenderbuffers[l]=u}}if(c(e.depthTexture)){let s=e.depthTexture;if(s.pixelFormat!==ke.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");L5(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s}if(c(e.depthRenderbuffer)){let s=e.depthRenderbuffer;JO(this,this._gl.DEPTH_ATTACHMENT,s),this._depthRenderbuffer=s}if(c(e.stencilRenderbuffer)){let s=e.stencilRenderbuffer;JO(this,this._gl.STENCIL_ATTACHMENT,s),this._stencilRenderbuffer=s}if(c(e.depthStencilTexture)){let s=e.depthStencilTexture;if(s.pixelFormat!==ke.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");L5(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s}if(c(e.depthStencilRenderbuffer)){let s=e.depthStencilRenderbuffer;JO(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilRenderbuffer=s}this._unBind()}Object.defineProperties(cd.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)}}});cd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};cd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};cd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};cd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};cd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};cd.prototype.getColorTexture=function(e){if(!c(e)||e<0||e>=this._colorTextures.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]};cd.prototype.getColorRenderbuffer=function(e){if(!c(e)||e<0||e>=this._colorRenderbuffers.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];c(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];c(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),de(this)};var Wr=cd;var e1={CLOCKWISE:ne.CW,COUNTER_CLOCKWISE:ne.CCW};e1.validate=function(e){return e===e1.CLOCKWISE||e===e1.COUNTER_CLOCKWISE};var ts=Object.freeze(e1);function fQ(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]=fQ(e[t]));return Object.freeze(e)}var t1=fQ;function dQ(e){return e===ne.FUNC_ADD||e===ne.FUNC_SUBTRACT||e===ne.FUNC_REVERSE_SUBTRACT||e===ne.MIN||e===ne.MAX}function n1(e){return e===ne.ZERO||e===ne.ONE||e===ne.SRC_COLOR||e===ne.ONE_MINUS_SRC_COLOR||e===ne.DST_COLOR||e===ne.ONE_MINUS_DST_COLOR||e===ne.SRC_ALPHA||e===ne.ONE_MINUS_SRC_ALPHA||e===ne.DST_ALPHA||e===ne.ONE_MINUS_DST_ALPHA||e===ne.CONSTANT_COLOR||e===ne.ONE_MINUS_CONSTANT_COLOR||e===ne.CONSTANT_ALPHA||e===ne.ONE_MINUS_CONSTANT_ALPHA||e===ne.SRC_ALPHA_SATURATE}function ove(e){return e===ne.FRONT||e===ne.BACK||e===ne.FRONT_AND_BACK}function rve(e){return e===ne.NEVER||e===ne.LESS||e===ne.EQUAL||e===ne.LEQUAL||e===ne.GREATER||e===ne.NOTEQUAL||e===ne.GEQUAL||e===ne.ALWAYS}function hQ(e){return e===ne.NEVER||e===ne.LESS||e===ne.EQUAL||e===ne.LEQUAL||e===ne.GREATER||e===ne.NOTEQUAL||e===ne.GEQUAL||e===ne.ALWAYS}function TT(e){return e===ne.ZERO||e===ne.KEEP||e===ne.REPLACE||e===ne.INCR||e===ne.DECR||e===ne.INVERT||e===ne.INCR_WRAP||e===ne.DECR_WRAP}function vh(e){let t=e??W.EMPTY_OBJECT,n=t.cull??W.EMPTY_OBJECT,i=t.polygonOffset??W.EMPTY_OBJECT,o=t.scissorTest??W.EMPTY_OBJECT,r=o.rectangle??W.EMPTY_OBJECT,s=t.depthRange??W.EMPTY_OBJECT,a=t.depthTest??W.EMPTY_OBJECT,l=t.colorMask??W.EMPTY_OBJECT,u=t.blending??W.EMPTY_OBJECT,f=u.color??W.EMPTY_OBJECT,h=t.stencilTest??W.EMPTY_OBJECT,p=h.frontOperation??W.EMPTY_OBJECT,g=h.backOperation??W.EMPTY_OBJECT,m=t.sampleCoverage??W.EMPTY_OBJECT,y=t.viewport;if(this.frontFace=t.frontFace??ts.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ne.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:Ke.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??ne.LESS},this.colorMask={red:l.red??!0,green:l.green??!0,blue:l.blue??!0,alpha:l.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new G(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ne.FUNC_ADD,equationAlpha:u.equationAlpha??ne.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ne.ONE,functionSourceAlpha:u.functionSourceAlpha??ne.ONE,functionDestinationRgb:u.functionDestinationRgb??ne.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ne.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ne.ALWAYS,backFunction:h.backFunction??ne.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ne.KEEP,zFail:p.zFail??ne.KEEP,zPass:p.zPass??ne.KEEP},backOperation:{fail:g.fail??ne.KEEP,zFail:g.zFail??ne.KEEP,zPass:g.zPass??ne.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=c(y)?new Ke(y.x,y.y,y.width,y.height):void 0,this.lineWidth<ut.minimumAliasedLineWidth||this.lineWidth>ut.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!ts.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!ove(this.cull.face))throw new C("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new C("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new C("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new C("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new C("renderState.depthRange.far must be less than or equal to one.");if(!rve(this.depthTest.func))throw new C("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new C("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!dQ(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!dQ(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!n1(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!n1(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!n1(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!n1(this.blending.functionDestinationAlpha))throw new C("Invalid renderState.blending.functionDestinationAlpha.");if(!hQ(this.stencilTest.frontFunction))throw new C("Invalid renderState.stencilTest.frontFunction.");if(!hQ(this.stencilTest.backFunction))throw new C("Invalid renderState.stencilTest.backFunction.");if(!TT(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!TT(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!TT(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!TT(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!TT(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!TT(this.stencilTest.backOperation.zPass))throw new C("Invalid renderState.stencilTest.backOperation.zPass.");if(c(this.viewport)){if(this.viewport.width<0)throw new C("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new C("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>ut.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${ut.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>ut.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${ut.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}var sve=0,wh={};vh.fromCache=function(e){let t=JSON.stringify(e),n=wh[t];if(c(n))return++n.referenceCount,n.state;let i=new vh(e),o=JSON.stringify(i);return n=wh[o],c(n)||(i.id=sve++,i=t1(i),n={referenceCount:0,state:i},wh[o]=n),++n.referenceCount,wh[t]={referenceCount:1,state:n.state},n.state};vh.removeFromCache=function(e){let t=new vh(e),n=JSON.stringify(t),i=wh[n],o=JSON.stringify(e),r=wh[o];c(r)&&(--r.referenceCount,r.referenceCount===0&&(delete wh[o],c(i)&&--i.referenceCount)),c(i)&&i.referenceCount===0&&delete wh[n]};vh.getCache=function(){return wh};vh.clearCache=function(){wh={}};function L0(e,t,n){n?e.enable(t):e.disable(t)}function mQ(e,t){e.frontFace(t.frontFace)}function pQ(e,t){let n=t.cull,i=n.enabled;L0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function _Q(e,t){e.lineWidth(t.lineWidth)}function gQ(e,t){let n=t.polygonOffset,i=n.enabled;L0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function yQ(e,t,n){let i=t.scissorTest,o=c(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(L0(e,e.SCISSOR_TEST,o),o){let r=c(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function bQ(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function xQ(e,t){let n=t.depthTest,i=n.enabled;L0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function TQ(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function AQ(e,t){e.depthMask(t.depthMask)}function CQ(e,t){e.stencilMask(t.stencilMask)}function ave(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function EQ(e,t,n){let i=t.blending,o=c(n.blendingEnabled)?n.blendingEnabled:i.enabled;L0(e,e.BLEND,o),o&&(ave(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function SQ(e,t){let n=t.stencilTest,i=n.enabled;if(L0(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 l=n.frontOperation,u=l.fail,f=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function wQ(e,t){let n=t.sampleCoverage,i=n.enabled;L0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var cve=new Ke;function vQ(e,t,n){let i=t.viewport??n.viewport;c(i)||(i=cve,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)}vh.apply=function(e,t,n){mQ(e,t),pQ(e,t),_Q(e,t),gQ(e,t),bQ(e,t),xQ(e,t),TQ(e,t),AQ(e,t),CQ(e,t),SQ(e,t),wQ(e,t),yQ(e,t,n),EQ(e,t,n),vQ(e,t,n)};function lve(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(mQ),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(pQ),e.lineWidth!==t.lineWidth&&n.push(_Q),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(gQ),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(bQ),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(xQ),(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(TQ),e.depthMask!==t.depthMask&&n.push(AQ),e.stencilMask!==t.stencilMask&&n.push(CQ),(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(SQ),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(wQ),n}vh.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];c(f)||(f=lve(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let s=c(i.scissorTest)?i.scissorTest:t.scissorTest,a=c(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&yQ(e,n,o);let l=c(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=c(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(l!==u||u&&t.blending!==n.blending)&&EQ(e,n,o),(t!==n||i!==o||i.context!==o.context)&&vQ(e,n,o)};vh.getState=function(e){if(!c(e))throw new C("renderState is required.");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:G.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:c(e.viewport)?Ke.clone(e.viewport):void 0}};var ze=vh;function Kt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}Kt.packedLength=4;Kt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Kt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Kt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Kt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Kt.pack(e[o],t,o*4);return t};Kt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Kt.unpack(e,i,t[o])}return t};Kt.clone=function(e,t){if(c(e))return c(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Kt(e[0],e[2],e[1],e[3])};Kt.fromArray=Kt.unpack;Kt.fromColumnMajorArray=function(e,t){return T.defined("values",e),Kt.clone(e,t)};Kt.fromRowMajorArray=function(e,t){return T.defined("values",e),c(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Kt(e[0],e[1],e[2],e[3])};Kt.fromScale=function(e,t){return T.typeOf.object("scale",e),c(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Kt(e.x,0,0,e.y)};Kt.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Kt(e,0,0,e)};Kt.fromRotation=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Kt(n,-i,i,n)};Kt.toArray=function(e,t){return T.typeOf.object("matrix",e),c(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]]};Kt.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,1),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};Kt.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("result",n);let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Kt.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=Kt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Kt.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("result",n);let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Kt.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=Kt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var uve=new z;Kt.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=Kt.getScale(e,uve),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 fve=new z;Kt.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=Kt.getScale(e,fve),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 DQ=new z;Kt.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=z.magnitude(z.fromElements(e[0],e[1],DQ)),t.y=z.magnitude(z.fromElements(e[2],e[3],DQ)),t};var PQ=new z;Kt.getMaximumScale=function(e){return Kt.getScale(e,PQ),z.maximumComponent(PQ)};var dve=new z;Kt.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=Kt.getScale(e,dve);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 hve=new z;Kt.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=Kt.getScale(e,hve);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};Kt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",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};Kt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};Kt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),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};Kt.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",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};Kt.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Kt.multiplyByScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n),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};Kt.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Kt.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Kt.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",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};Kt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};Kt.equals=function(e,t){return e===t||c(e)&&c(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Kt.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]};Kt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};Kt.IDENTITY=Object.freeze(new Kt(1,0,0,1));Kt.ZERO=Object.freeze(new Kt(0,0,0,0));Kt.COLUMN0ROW0=0;Kt.COLUMN0ROW1=1;Kt.COLUMN1ROW0=2;Kt.COLUMN1ROW1=3;Object.defineProperties(Kt.prototype,{length:{get:function(){return Kt.packedLength}}});Kt.prototype.clone=function(e){return Kt.clone(this,e)};Kt.prototype.equals=function(e){return Kt.equals(this,e)};Kt.prototype.equalsEpsilon=function(e,t){return Kt.equalsEpsilon(this,e,t)};Kt.prototype.toString=function(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`};var Ri=Kt;function mve(e,t,n,i){switch(t.type){case e.FLOAT:return new IQ(e,t,n,i);case e.FLOAT_VEC2:return new OQ(e,t,n,i);case e.FLOAT_VEC3:return new RQ(e,t,n,i);case e.FLOAT_VEC4:return new MQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new N5(e,t,n,i);case e.INT:case e.BOOL:return new LQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new NQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new FQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new BQ(e,t,n,i);case e.FLOAT_MAT2:return new kQ(e,t,n,i);case e.FLOAT_MAT3:return new UQ(e,t,n,i);case e.FLOAT_MAT4:return new VQ(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function IQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}IQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function OQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}OQ.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function RQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}RQ.prototype.set=function(){let e=this.value;if(c(e.red))G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(c(e.x))d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new C(`Invalid vec3 value for uniform "${this.name}".`)};function MQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}MQ.prototype.set=function(){let e=this.value;if(c(e.red))G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(c(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));else throw new C(`Invalid vec4 value for uniform "${this.name}".`)};function N5(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}N5.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};N5.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function LQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}LQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function NQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}NQ.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function FQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}FQ.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function BQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}BQ.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 pve=new Float32Array(4);function kQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ri,this._gl=e,this._location=i}kQ.prototype.set=function(){if(!Ri.equalsArray(this.value,this._value,0)){Ri.clone(this.value,this._value);let e=Ri.toArray(this.value,pve);this._gl.uniformMatrix2fv(this._location,!1,e)}};var _ve=new Float32Array(9);function UQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new J,this._gl=e,this._location=i}UQ.prototype.set=function(){if(!J.equalsArray(this.value,this._value,0)){J.clone(this.value,this._value);let e=J.toArray(this.value,_ve);this._gl.uniformMatrix3fv(this._location,!1,e)}};var gve=new Float32Array(16);function VQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}VQ.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,gve);this._gl.uniformMatrix4fv(this._location,!1,e)}};var i1=mve;function yve(e,t,n,i){switch(t.type){case e.FLOAT:return new zQ(e,t,n,i);case e.FLOAT_VEC2:return new HQ(e,t,n,i);case e.FLOAT_VEC3:return new GQ(e,t,n,i);case e.FLOAT_VEC4:return new jQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new F5(e,t,n,i);case e.INT:case e.BOOL:return new WQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new qQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new YQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new XQ(e,t,n,i);case e.FLOAT_MAT2:return new KQ(e,t,n,i);case e.FLOAT_MAT3:return new $Q(e,t,n,i);case e.FLOAT_MAT4:return new ZQ(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function zQ(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]}zQ.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 HQ(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]}HQ.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];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function GQ(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]}GQ.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];if(c(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);else if(c(s.x))d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0);else throw new C("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function jQ(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]}jQ.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];if(c(s.red))G.equalsArray(s,n,o)||(G.pack(s,n,o),i=!0);else if(c(s.x))se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0);else throw new C("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function F5(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}F5.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)}};F5.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 WQ(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]}WQ.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 qQ(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]}qQ.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];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function YQ(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]}YQ.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+=3}i&&this._gl.uniform3iv(this._location,n)};function XQ(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]}XQ.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 KQ(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]}KQ.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];Ri.equalsArray(s,n,o)||(Ri.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function $Q(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]}$Q.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];J.equalsArray(s,n,o)||(J.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function ZQ(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]}ZQ.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];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var o1=yve;var bve=0;function up(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=xve(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=bve++}up.fromCache=function(e){return e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)};up.replaceCache=function(e){return e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(up.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return r1(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return r1(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return r1(this),this._uniformsByName}}});function QQ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(c(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 xve(e,t){let n={};if(!ut.highpFloatSupported||!ut.highpIntSupported){let i,o,r,s,a=QQ(e),l=QQ(t),u=a.length,f=l.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===l[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 Dh="[Cesium WebGL] ";function Tve(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(c(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let l;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(l=e.getShaderInfoLog(o),c(l)&&l.length>0&&console.log(`${Dh}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(r),c(l)&&l.length>0&&console.log(`${Dh}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(s),c(l)&&l.length>0&&console.log(`${Dh}Shader program link log: ${l}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(l=e.getProgramInfoLog(s),console.error(`${Dh}Shader program link log: ${l}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${Dh}Vertex shader compile log: ${l}`),console.error(`${Dh} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${l}`):(l=e.getShaderInfoLog(r),console.error(`${Dh}Fragment shader compile log: ${l}`),console.error(`${Dh} Fragment shader source: -${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(u);function h(p,g){if(!c(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Dh}${g} shader translation failed.`);return}console.error(`${Dh}Translated ${g} shaderSource: -${m}`)}}function Ave(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 Cve(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),l="[0]",u=a.name.indexOf(l,a.name.length-l.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=i1(e,a,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!c(f))continue;h=f._locations,h.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&h.push(g);f=o1(e,a,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Eve(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];c(a)&&(r.name=a,s=a);let l=N_[s];c(l)?n.push({uniform:r,automaticUniform:l}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function Sve(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 r1(e){c(e._program)||JQ(e)}function JQ(e){let t=e._program,n=e._gl,i=Tve(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=Cve(n,i),s=Eve(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Ave(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Sve(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,l,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=l.replace(g," != ");try{JQ(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}up.prototype._bind=function(){r1(this),this._gl.useProgram(this._program)};up.prototype._setUniforms=function(e,t,n){let i,o;if(c(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let l=a[o];if(!c(e[l.name]))throw new C(`Unknown uniform: ${l.name}`);l.value=e[l.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,l=this._program;if(a.validateProgram(l),!a.getProgramParameter(l,a.VALIDATE_STATUS))throw new C(`Program validation failed. Program info log: ${a.getProgramInfoLog(l)}`)}};up.prototype.isDestroyed=function(){return!1};up.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};up.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),de(this)};var en=up;function s1(e){this._context=e}var tw,wve=new Je({primitiveType:Me.TRIANGLES}),vve=new ti({color:new G(0,0,0,0)});function Dve(e,t){return new Wr({context:e,colorTextures:[t],destroyAttachments:!1})}function Pve(e,t){return en.fromCache({context:e,vertexShaderSource:xT,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Ive(e,t){return(!c(tw)||tw.viewport.width!==e||tw.viewport.height!==t)&&(tw=ze.fromCache({viewport:new Ke(0,0,e,t)})),tw}s1.prototype.execute=function(e){if(T.defined("computeCommand",e),c(e.preExecute)&&e.preExecute(e),!c(e.fragmentShaderSource)&&!c(e.shaderProgram))throw new C("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");T.defined("computeCommand.outputTexture",e.outputTexture);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=c(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=c(e.shaderProgram)?e.shaderProgram:Pve(o,e.fragmentShaderSource),a=Dve(o,t),l=Ive(n,i),u=e.uniformMap,f=vve;f.framebuffer=a,f.renderState=l,f.execute(o);let h=wve;h.vertexArray=r,h.renderState=l,h.shaderProgram=s,h.uniformMap=u,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),c(e.vertexArray)&&r.destroy()),c(e.postExecute)&&e.postExecute(t)};s1.prototype.isDestroyed=function(){return!1};s1.prototype.destroy=function(){return de(this)};var a1=s1;var En={BYTE:ne.BYTE,UNSIGNED_BYTE:ne.UNSIGNED_BYTE,SHORT:ne.SHORT,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,INT:ne.INT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,DOUBLE:ne.DOUBLE};En.getSizeInBytes=function(e){if(!c(e))throw new C("value is required.");switch(e){case En.BYTE:return Int8Array.BYTES_PER_ELEMENT;case En.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case En.SHORT:return Int16Array.BYTES_PER_ELEMENT;case En.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case En.INT:return Int32Array.BYTES_PER_ELEMENT;case En.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case En.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case En.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}};En.fromTypedArray=function(e){if(e instanceof Int8Array)return En.BYTE;if(e instanceof Uint8Array)return En.UNSIGNED_BYTE;if(e instanceof Int16Array)return En.SHORT;if(e instanceof Uint16Array)return En.UNSIGNED_SHORT;if(e instanceof Int32Array)return En.INT;if(e instanceof Uint32Array)return En.UNSIGNED_INT;if(e instanceof Float32Array)return En.FLOAT;if(e instanceof Float64Array)return En.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};En.validate=function(e){return c(e)&&(e===En.BYTE||e===En.UNSIGNED_BYTE||e===En.SHORT||e===En.UNSIGNED_SHORT||e===En.INT||e===En.UNSIGNED_INT||e===En.FLOAT||e===En.DOUBLE)};En.createTypedArray=function(e,t){if(!c(e))throw new C("componentDatatype is required.");if(!c(t))throw new C("valuesOrLength is required.");switch(e){case En.BYTE:return new Int8Array(t);case En.UNSIGNED_BYTE:return new Uint8Array(t);case En.SHORT:return new Int16Array(t);case En.UNSIGNED_SHORT:return new Uint16Array(t);case En.INT:return new Int32Array(t);case En.UNSIGNED_INT:return new Uint32Array(t);case En.FLOAT:return new Float32Array(t);case En.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}};En.createArrayBufferView=function(e,t,n,i){if(!c(e))throw new C("componentDatatype is required.");if(!c(t))throw new C("buffer is required.");switch(n=n??0,i=i??(t.byteLength-n)/En.getSizeInBytes(e),e){case En.BYTE:return new Int8Array(t,n,i);case En.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case En.SHORT:return new Int16Array(t,n,i);case En.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case En.INT:return new Int32Array(t,n,i);case En.UNSIGNED_INT:return new Uint32Array(t,n,i);case En.FLOAT:return new Float32Array(t,n,i);case En.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}};En.fromName=function(e){switch(e){case"BYTE":return En.BYTE;case"UNSIGNED_BYTE":return En.UNSIGNED_BYTE;case"SHORT":return En.SHORT;case"UNSIGNED_SHORT":return En.UNSIGNED_SHORT;case"INT":return En.INT;case"UNSIGNED_INT":return En.UNSIGNED_INT;case"FLOAT":return En.FLOAT;case"DOUBLE":return En.DOUBLE;default:throw new C("name is not a valid value.")}};var $=Object.freeze(En);var Ove={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},ld=Object.freeze(Ove);function B5(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Me.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??ld.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}B5.computeNumberOfVertices=function(e){T.typeOf.object("geometry",e);let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&c(e.attributes[n])&&c(e.attributes[n].values)){let i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new C("All attribute lists must have the same number of attributes.");t=o}return t};var Rve=new he,Mve=new d,eJ=new F,Lve=[new he,new he,new he],Nve=[new z,new z,new z],Fve=[new z,new z,new z],Bve=new d,kve=new Le,Uve=new F,Vve=new Ri;B5._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,Rve),s=he.toCartesian(r,n,Mve),a=Ot.eastNorthUpToFixedFrame(s,n,eJ),l=F.inverse(a,eJ),u=Nve,f=Lve;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=Bve;for(o=0;o<3;o++)he.toCartesian(f[o],n,h),h=F.multiplyByPointAsVector(l,h,h),u[o].x=h.x,u[o].y=h.y;let p=Le.fromAxisAngle(d.UNIT_Z,-t,kve),g=J.fromQuaternion(p,Uve),m=e.length,y=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=F.multiplyByPointAsVector(l,e[o],h),h=J.multiplyByVector(g,h,h),y=Math.min(y,h.x),b=Math.min(b,h.y),x=Math.max(x,h.x),A=Math.max(A,h.y);let E=Ri.fromRotation(t,Vve),S=Fve;S[0].x=y,S[0].y=b,S[1].x=y,S[1].y=A,S[2].x=x,S[2].y=b;let v=u[0],P=u[2].x-v.x,M=u[1].y-v.y;for(o=0;o<3;o++){let w=S[o];Ri.multiplyByVector(E,w,w),w.x=(w.x-v.x)/P,w.y=(w.y-v.y)/M}let R=S[0],L=S[1],B=S[2],_=new Array(6);return z.pack(R,_),z.pack(L,_,2),z.pack(B,_,4),_};var ct=B5;function zve(e){if(e=e??W.EMPTY_OBJECT,!c(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.values))throw new C("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var ve=zve;function AT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(AT.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}}});AT.clone=function(e){if(c(e))return new AT(e._format,e._datatype,e._width,e._height,e._buffer)};AT.prototype.clone=function(){return AT.clone(this)};var c1=AT;var tJ=jr(ql(),1);function nJ(){if(!c(Js._canTransferArrayBuffer)){let e=V5("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Js._canTransferArrayBuffer=!1,Js._canTransferArrayBuffer}Js._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=c(r)&&r[0]===t;i(s),e.terminate(),Js._canTransferArrayBuffer=s}})}return Js._canTransferArrayBuffer}var U5=new pe;function k5(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 V5(e){let t=new tJ.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(P0(e))s=e;else if(!n){let a=tn(`${Js._workerModulePrefix}/${i}.js`);P0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=k5(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${k5(CESIUM_WORKERS)}"); +`;var Ho={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},Wq=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Oe.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Uc(this,Ho.CULL)}set cull(t){Uc(this,Ho.CULL)!==t&&(I_(this,Ho.CULL,t),this.dirty=!0)}get occlude(){return Uc(this,Ho.OCCLUDE)}set occlude(t){Uc(this,Ho.OCCLUDE)!==t&&(I_(this,Ho.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Uc(this,Ho.CAST_SHADOWS)}set castShadows(t){Uc(this,Ho.CAST_SHADOWS)!==t&&(I_(this,Ho.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Uc(this,Ho.RECEIVE_SHADOWS)}set receiveShadows(t){Uc(this,Ho.RECEIVE_SHADOWS)!==t&&(I_(this,Ho.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Uc(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Uc(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(I_(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Uc(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Uc(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(I_(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Uc(this,Ho.PICK_ONLY)}set pickOnly(t){Uc(this,Ho.PICK_ONLY)!==t&&(I_(this,Ho.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Uc(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Uc(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(I_(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Uc(e,t){return(e._flags&t)===t}function I_(e,t,n){n?e._flags|=t:e._flags&=~t}var at=Wq;var Di={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Di.toWebGLConstant=function(e,t){switch(e){case Di.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Di.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Di.UNSIGNED_INT:return te.UNSIGNED_INT;case Di.FLOAT:return te.FLOAT;case Di.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Di.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Di.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Di.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Di.UNSIGNED_SHORT_5_6_5:return Di.UNSIGNED_SHORT_5_6_5}};Di.isPacked=function(e){return e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.sizeInBytes=function(e){switch(e){case Di.UNSIGNED_BYTE:return 1;case Di.UNSIGNED_SHORT:case Di.UNSIGNED_SHORT_4_4_4_4:case Di.UNSIGNED_SHORT_5_5_5_1:case Di.UNSIGNED_SHORT_5_6_5:case Di.HALF_FLOAT:return 2;case Di.UNSIGNED_INT:case Di.FLOAT:case Di.UNSIGNED_INT_24_8:return 4}};Di.validate=function(e){return e===Di.UNSIGNED_BYTE||e===Di.UNSIGNED_SHORT||e===Di.UNSIGNED_INT||e===Di.FLOAT||e===Di.HALF_FLOAT||e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.getTypedArrayConstructor=function(e){let t=Di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Di.FLOAT?Float32Array:Uint32Array};Object.freeze(Di);var ze=Di;var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,RED_INTEGER:te.RED_INTEGER,RG_INTEGER:te.RG_INTEGER,RGB_INTEGER:te.RGB_INTEGER,RGBA_INTEGER:te.RGBA_INTEGER,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:case ot.RGB_INTEGER:return 3;case ot.RGBA:case ot.RGBA_INTEGER:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:case ot.RG_INTEGER:return 2;case ot.ALPHA:case ot.RED:case ot.RED_INTEGER:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.RED_INTEGER||e===ot.RG_INTEGER||e===ot.RGB_INTEGER||e===ot.RGBA_INTEGER||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let r=ot.componentsLength(e);return ze.isPacked(t)&&(r=1),r*ze.sizeInBytes(t)*n*i};ot.texture3DSizeInBytes=function(e,t,n,i,r){let o=ot.componentsLength(e);return ze.isPacked(t)&&(o=1),o*ze.sizeInBytes(t)*n*i*r};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let r=ze.getTypedArrayConstructor(t),o=ot.componentsLength(e)*n*i;return new r(o)};ot.flipY=function(e,t,n,i,r){if(r===1)return e;let o=ot.createTypedArray(t,n,i,r),s=ot.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===ze.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===ze.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===ze.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===ze.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}if(t===ze.UNSIGNED_BYTE)switch(e){case ot.RGBA:return te.RGBA8;case ot.RGB:return te.RGB8;case ot.RG:return te.RG8;case ot.RED:return te.R8}if(t===ze.INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32I;case ot.RGB_INTEGER:return te.RGB32I;case ot.RG_INTEGER:return te.RG32I;case ot.RED_INTEGER:return te.R32I}if(t===ze.UNSIGNED_INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32UI;case ot.RGB_INTEGER:return te.RGB32UI;case ot.RG_INTEGER:return te.RG32UI;case ot.RED_INTEGER:return te.R32UI}return e};Object.freeze(ot);var $e=ot;var Mo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize: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(Mo,{maximumCombinedTextureImageUnits:{get:function(){return Mo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Mo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Mo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Mo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Mo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Mo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Mo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Mo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Mo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Mo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Mo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Mo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Mo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Mo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Mo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Mo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Mo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Mo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Mo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Mo._maximumColorAttachments}},maximumSamples:{get:function(){return Mo._maximumSamples}},highpFloatSupported:{get:function(){return Mo._highpFloatSupported}},highpIntSupported:{get:function(){return Mo._highpIntSupported}}});var Ut=Mo;function qq(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function jN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function hh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.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=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;qq(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;jN(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;qq(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;jN(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;jN(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;qq(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;jN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(hh.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)}}});hh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};hh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};hh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};hh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};hh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};hh.prototype.getColorTexture=function(e){return this._colorTextures[e]};hh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};hh.prototype.isDestroyed=function(){return!1};hh.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),ue(this)};var vs=hh;var HI={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};HI.validate=function(e){return e===HI.CLOCKWISE||e===HI.COUNTER_CLOCKWISE};Object.freeze(HI);var sa=HI;function Zce(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]=Zce(e[t]));return Object.freeze(e)}var Qce=Zce;function Hm(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,s=t.depthRange??H.EMPTY_OBJECT,a=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??sa.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??te.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:et.clone(o)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??te.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??te.FUNC_ADD,equationAlpha:u.equationAlpha??te.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??te.ONE,functionSourceAlpha:u.functionSourceAlpha??te.ONE,functionDestinationRgb:u.functionDestinationRgb??te.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??te.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??te.ALWAYS,backFunction:d.backFunction??te.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??te.KEEP,zFail:p.zFail??te.KEEP,zPass:p.zPass??te.KEEP},backOperation:{fail:g.fail??te.KEEP,zFail:g.zFail??te.KEEP,zPass:g.zPass??te.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new et(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var aze=0,jm={};Hm.fromCache=function(e){let t=JSON.stringify(e),n=jm[t];if(l(n))return++n.referenceCount,n.state;let i=new Hm(e),r=JSON.stringify(i);return n=jm[r],l(n)||(i.id=aze++,n={referenceCount:0,state:i},jm[r]=n),++n.referenceCount,jm[t]={referenceCount:1,state:n.state},n.state};Hm.removeFromCache=function(e){let t=new Hm(e),n=JSON.stringify(t),i=jm[n],r=JSON.stringify(e),o=jm[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete jm[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete jm[n]};Hm.getCache=function(){return jm};Hm.clearCache=function(){jm={}};function bb(e,t,n){n?e.enable(t):e.disable(t)}function ele(e,t){e.frontFace(t.frontFace)}function tle(e,t){let n=t.cull,i=n.enabled;bb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function nle(e,t){e.lineWidth(t.lineWidth)}function ile(e,t){let n=t.polygonOffset,i=n.enabled;bb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function rle(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(bb(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function ole(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function sle(e,t){let n=t.depthTest,i=n.enabled;bb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function ale(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function cle(e,t){e.depthMask(t.depthMask)}function lle(e,t){e.stencilMask(t.stencilMask)}function cze(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function ule(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;bb(e,e.BLEND,r),r&&(cze(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function fle(e,t){let n=t.stencilTest,i=n.enabled;if(bb(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function dle(e,t){let n=t.sampleCoverage,i=n.enabled;bb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var lze=new et;function hle(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=lze,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)}Hm.apply=function(e,t,n){ele(e,t),tle(e,t),nle(e,t),ile(e,t),ole(e,t),sle(e,t),ale(e,t),cle(e,t),lle(e,t),fle(e,t),dle(e,t),rle(e,t,n),ule(e,t,n),hle(e,t,n)};function uze(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(ele),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(tle),e.lineWidth!==t.lineWidth&&n.push(nle),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(ile),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(ole),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(sle),(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(ale),e.depthMask!==t.depthMask&&n.push(cle),e.stencilMask!==t.stencilMask&&n.push(lle),(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(fle),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(dle),n}Hm.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=uze(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&rle(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&ule(e,n,r),(t!==n||i!==r||i.context!==r.context)&&hle(e,n,r)};Hm.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:et.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:z.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)?et.clone(e.viewport):void 0}};var Ge=Hm;var fze=Object.freeze([NaN,NaN,NaN,NaN]),su=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,fze,new.target);return o[0]=t??0,o[1]=i??0,o[2]=n??0,o[3]=r??0,o}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],s=t[r+1];return i.x=o,i.y=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,dze),o=n.x/r.x,s=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,hze),o=n/r.x,s=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static getScale(t,n){return n.x=U.magnitude(U.fromElements(t[0],t[1],mle)),n.y=U.magnitude(U.fromElements(t[2],t[3],mle)),n}static getMaximumScale(t){return e.getScale(t,ple),U.maximumComponent(ple)}static setRotation(t,n,i){let r=e.getScale(t,mze);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,pze);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}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],s=t[1]*n[0]+t[3]*n[1],a=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=s,i[2]=o,i[3]=a,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],s=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`}};su.packedLength=4;su.fromArray=su.unpack;su.IDENTITY=new su(1,0,0,1);su.ZERO=new su(0,0,0,0);su.COLUMN0ROW0=0;su.COLUMN0ROW1=1;su.COLUMN1ROW0=2;su.COLUMN1ROW1=3;var dze=new U,hze=new U,mle=new U,ple=new U,mze=new U,pze=new U,$i=su;function gze(e,t,n,i){switch(t.type){case e.FLOAT:return new Yq(e,t,n,i);case e.FLOAT_VEC2:return new Xq(e,t,n,i);case e.FLOAT_VEC3:return new Kq(e,t,n,i);case e.FLOAT_VEC4:return new $q(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new HN(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new HN(e,t,n,i);case e.INT:case e.BOOL:return new Jq(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Zq(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Qq(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new eY(e,t,n,i);case e.FLOAT_MAT2:return new tY(e,t,n,i);case e.FLOAT_MAT3:return new nY(e,t,n,i);case e.FLOAT_MAT4:return new iY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var Yq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},Xq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},Kq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},$q=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},HN=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},Jq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},Zq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},Qq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},eY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=r}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},_ze=new Float32Array(4),tY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $i,this._gl=t,this._location=r}set(){if(!$i.equalsArray(this.value,this._value,0)){$i.clone(this.value,this._value);let t=$i.toArray(this.value,_ze);this._gl.uniformMatrix2fv(this._location,!1,t)}}},yze=new Float32Array(9),nY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,yze);this._gl.uniformMatrix3fv(this._location,!1,t)}}},Aze=new Float32Array(16),iY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new M,this._gl=t,this._location=r}set(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let t=M.toArray(this.value,Aze);this._gl.uniformMatrix4fv(this._location,!1,t)}}},GN=gze;function bze(e,t,n,i){switch(t.type){case e.FLOAT:return new rY(e,t,n,i);case e.FLOAT_VEC2:return new oY(e,t,n,i);case e.FLOAT_VEC3:return new sY(e,t,n,i);case e.FLOAT_VEC4:return new aY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new cY(e,t,n,i);case e.INT:case e.BOOL:return new lY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new uY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new fY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new dY(e,t,n,i);case e.FLOAT_MAT2:return new hY(e,t,n,i);case e.FLOAT_MAT3:return new mY(e,t,n,i);case e.FLOAT_MAT4:return new pY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var rY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},oY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},sY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?(a.red!==i[o]||a.green!==i[o+1]||a.blue!==i[o+2])&&(i[o]=a.red,i[o+1]=a.green,i[o+2]=a.blue,r=!0):l(a.x)&&(h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},aY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?z.equalsArray(a,i,o)||(z.pack(a,i,o),r=!0):l(a.x)&&(se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},cY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let s=i[o];t.activeTexture(n+o),t.bindTexture(s._target,s._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},lY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},uY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},fY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},dY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},hY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$i.equalsArray(a,i,o)||($i.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},mY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$.equalsArray(a,i,o)||($.pack(a,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},pY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];M.equalsArray(a,i,o)||(M.pack(a,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},WN=bze;var xze=0;function L0(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=Tze(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=xze++}L0.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};L0.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(L0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return qN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return qN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return qN(this),this._uniformsByName}}});function gle(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function Tze(e,t){let n={};if(!Ut.highpFloatSupported||!Ut.highpIntSupported){let i,r,o,s,a=gle(e),c=gle(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Gm="[Cesium WebGL] ";function Eze(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);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(r),l(c)&&c.length>0&&console.log(`${Gm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Gm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Gm}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Gm}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Gm}Vertex shader compile log: ${c}`),console.error(`${Gm} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Gm}Fragment shader compile log: ${c}`),console.error(`${Gm} Fragment shader source: +${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new oe(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Gm}${g} shader translation failed.`);return}console.error(`${Gm}Translated ${g} shaderSource: +${m}`)}}function Cze(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function vze(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=GN(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=WN(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function Sze(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=x_[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function wze(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function qN(e){l(e._program)||_le(e)}function _le(e){let t=e._program,n=e._gl,i=Eze(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=vze(n,i),s=Sze(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=Cze(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=wze(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{_le(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}L0.prototype._bind=function(){qN(this),this._gl.useProgram(this._program)};L0.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};L0.prototype.isDestroyed=function(){return!1};L0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};L0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=L0;function YN(e){this._context=e}var GI,Ize=new at({primitiveType:Oe.TRIANGLES}),Pze=new fi({color:new z(0,0,0,0)});function Dze(e,t){return new vs({context:e,colorTextures:[t],destroyAttachments:!1})}function Rze(e,t){return Qt.fromCache({context:e,vertexShaderSource:OE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Oze(e,t){return(!l(GI)||GI.viewport.width!==e||GI.viewport.height!==t)&&(GI=Ge.fromCache({viewport:new et(0,0,e,t)})),GI}YN.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:Rze(r,e.fragmentShaderSource),a=Dze(r,t),c=Oze(n,i),u=e.uniformMap,f=Pze;f.framebuffer=a,f.renderState=c,f.execute(r);let d=Ize;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};YN.prototype.isDestroyed=function(){return!1};YN.prototype.destroy=function(){return ue(this)};var XN=YN;var yn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};yn.getSizeInBytes=function(e){switch(e){case yn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case yn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case yn.INT:return Int32Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case yn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case yn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};yn.fromTypedArray=function(e){if(e instanceof Int8Array)return yn.BYTE;if(e instanceof Uint8Array)return yn.UNSIGNED_BYTE;if(e instanceof Int16Array)return yn.SHORT;if(e instanceof Uint16Array)return yn.UNSIGNED_SHORT;if(e instanceof Int32Array)return yn.INT;if(e instanceof Uint32Array)return yn.UNSIGNED_INT;if(e instanceof Float32Array)return yn.FLOAT;if(e instanceof Float64Array)return yn.DOUBLE};yn.validate=function(e){return l(e)&&(e===yn.BYTE||e===yn.UNSIGNED_BYTE||e===yn.SHORT||e===yn.UNSIGNED_SHORT||e===yn.INT||e===yn.UNSIGNED_INT||e===yn.FLOAT||e===yn.DOUBLE)};yn.createTypedArray=function(e,t){switch(e){case yn.BYTE:return new Int8Array(t);case yn.UNSIGNED_BYTE:return new Uint8Array(t);case yn.SHORT:return new Int16Array(t);case yn.UNSIGNED_SHORT:return new Uint16Array(t);case yn.INT:return new Int32Array(t);case yn.UNSIGNED_INT:return new Uint32Array(t);case yn.FLOAT:return new Float32Array(t);case yn.DOUBLE:return new Float64Array(t)}};yn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/yn.getSizeInBytes(e),e){case yn.BYTE:return new Int8Array(t,n,i);case yn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case yn.SHORT:return new Int16Array(t,n,i);case yn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case yn.INT:return new Int32Array(t,n,i);case yn.UNSIGNED_INT:return new Uint32Array(t,n,i);case yn.FLOAT:return new Float32Array(t,n,i);case yn.DOUBLE:return new Float64Array(t,n,i)}};yn.fromName=function(e){switch(e){case"BYTE":return yn.BYTE;case"UNSIGNED_BYTE":return yn.UNSIGNED_BYTE;case"SHORT":return yn.SHORT;case"UNSIGNED_SHORT":return yn.UNSIGNED_SHORT;case"INT":return yn.INT;case"UNSIGNED_INT":return yn.UNSIGNED_INT;case"FLOAT":return yn.FLOAT;case"DOUBLE":return yn.DOUBLE}};yn.dequantize=function(e,t){switch(t){case yn.BYTE:return Math.max(e/127,-1);case yn.UNSIGNED_BYTE:return e/255;case yn.SHORT:return Math.max(e/32767,-1);case yn.UNSIGNED_SHORT:return e/65535;case yn.INT:return Math.max(e/2147483647,-1);case yn.UNSIGNED_INT:return e/4294967295}};Object.freeze(yn);var Y=yn;var yle={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(yle);var mh=yle;function gY(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Oe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??mh.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}gY.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 Mze=new he,Nze=new h,Ale=new M,Lze=[new he,new he,new he],Fze=[new U,new U,new U],Bze=[new U,new U,new U],kze=new h,Uze=new Le,zze=new M,Vze=new $i;gY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,Mze),s=he.toCartesian(o,n,Nze),a=At.eastNorthUpToFixedFrame(s,n,Ale),c=M.inverse(a,Ale),u=Fze,f=Lze;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=kze;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=M.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,Uze),g=$.fromQuaternion(p,zze),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=M.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=$i.fromRotation(t,Vze),E=Bze;E[0].x=y,E[0].y=A,E[1].x=y,E[1].y=x,E[2].x=b,E[2].y=A;let v=u[0],S=u[2].x-v.x,I=u[1].y-v.y;for(r=0;r<3;r++){let C=E[r];$i.multiplyByVector(T,C,C),C.x=(C.x-v.x)/S,C.y=(C.y-v.y)/I}let R=E[0],O=E[1],L=E[2],_=new Array(6);return U.pack(R,_),U.pack(O,_,2),U.pack(L,_,4),_};var wt=gY;function jze(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ne=jze;function ME(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(ME.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}}});ME.clone=function(e){if(l(e))return new ME(e._format,e._datatype,e._width,e._height,e._buffer)};ME.prototype.clone=function(){return ME.clone(this)};var KN=ME;var ble=js(Qu(),1);function xle(){if(!l(qa._canTransferArrayBuffer)){let e=AY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return qa._canTransferArrayBuffer=!1,qa._canTransferArrayBuffer}qa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),qa._canTransferArrayBuffer=s}})}return qa._canTransferArrayBuffer}var yY=new be;function _Y(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function AY(e){let t=new ble.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(pb(e))s=e;else if(!n){let a=Zt(`${qa._workerModulePrefix}/${i}.js`);pb(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=_Y(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${_Y(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return r=k5(a),new Worker(r,o)}if(r=e,n||(r=tn(`${Js._workerModulePrefix+i}.js`)),!zt.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 Hve(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!zt.supportsWebAssembly()){if(!c(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=tn(t.fallbackModulePath),n}n.wasmBinaryFile=tn(t.wasmBinaryFile);let i=await we.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Js(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var Gve=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(c(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 C(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),U5.raiseEvent(s),i(s)}else U5.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},jve=[];async function Wve(e,t,n){let i=await Promise.resolve(nJ());c(n)?i||(n.length=0):n=jve;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",Gve(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:tn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function qve(e,t,n){++e._activeTasks;try{let i=await Wve(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Js.prototype.scheduleTask=function(e,t){if(c(this._worker)||(this._worker=V5(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return qve(this,e,t)};Js.prototype.initWebAssemblyModule=async function(e){if(c(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=V5(this._workerPath),i=await Hve(this,e),o=await Promise.resolve(nJ()),r,s=i.wasmBinary;c(s)&&o&&(r=[s]);let a=new Promise((l,u)=>{n.onmessage=function({data:f}){c(f)?l(f.result):u(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Js.prototype.isDestroyed=function(){return!1};Js.prototype.destroy=function(){return c(this._worker)&&this._worker.terminate(),de(this)};Js.taskCompletedEvent=U5;Js._defaultWorkerModulePrefix="Workers/";Js._workerModulePrefix=Js._defaultWorkerModulePrefix;Js._canTransferArrayBuffer=void 0;var bi=Js;function fp(){}fp._transcodeTaskProcessor=new bi("transcodeKTX2",Number.POSITIVE_INFINITY);fp._readyPromise=void 0;function Yve(){let e=fp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return fp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});fp._readyPromise=e}fp.transcode=function(e,t){return T.defined("supportedTargetFormats",t),c(fp._readyPromise)||Yve(),fp._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 l=s[o[a]];s[o[a]]=new c1(l.internalFormat,l.datatype,l.width,l.height,l.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 l1=fp;var iJ;oJ.setKTX2SupportedFormats=function(e,t,n,i,o,r){iJ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function oJ(e){T.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=we.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return l1.transcode(n,iJ)})}var Xl=oJ;function Xve(e,t){this.start=e??0,this.stop=t??0}var $a=Xve;function dn(e,t){this.center=d.clone(e??d.ZERO),this.radius=t??0}var G5=new d,j5=new d,W5=new d,q5=new d,Y5=new d,X5=new d,K5=new d,ea=new d,$5=new d,Z5=new d,Q5=new d,J5=new d,Kve=4/3*O.PI;dn.fromPoints=function(e,t){if(c(t)||(t=new dn),!c(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],K5),i=d.clone(n,G5),o=d.clone(n,j5),r=d.clone(n,W5),s=d.clone(n,q5),a=d.clone(n,Y5),l=d.clone(n,X5),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let R=n.x,L=n.y,B=n.z;R<i.x&&d.clone(n,i),R>s.x&&d.clone(n,s),L<o.y&&d.clone(n,o),L>a.y&&d.clone(n,a),B<r.z&&d.clone(n,r),B>l.z&&d.clone(n,l)}let h=d.magnitudeSquared(d.subtract(s,i,ea)),p=d.magnitudeSquared(d.subtract(a,o,ea)),g=d.magnitudeSquared(d.subtract(l,r,ea)),m=i,y=s,b=h;p>b&&(b=p,m=o,y=a),g>b&&(b=g,m=r,y=l);let x=$5;x.x=(m.x+y.x)*.5,x.y=(m.y+y.y)*.5,x.z=(m.z+y.z)*.5;let A=d.magnitudeSquared(d.subtract(y,x,ea)),E=Math.sqrt(A),S=Z5;S.x=i.x,S.y=o.y,S.z=r.z;let v=Q5;v.x=s.x,v.y=a.y,v.z=l.z;let P=d.midpoint(S,v,J5),M=0;for(f=0;f<u;f++){d.clone(e[f],n);let R=d.magnitude(d.subtract(n,P,ea));R>M&&(M=R);let L=d.magnitudeSquared(d.subtract(n,x,ea));if(L>A){let B=Math.sqrt(L);E=(E+B)*.5,A=E*E;let _=B-E;x.x=(E*x.x+_*n.x)/B,x.y=(E*x.y+_*n.y)/B,x.z=(E*x.z+_*n.z)/B}}return E<M?(d.clone(x,t.center),t.radius=E):(d.clone(P,t.center),t.radius=M),t};var rJ=new Oi,$ve=new d,Zve=new d,z5=new he,H5=new he;dn.fromRectangle2D=function(e,t,n){return dn.fromRectangleWithHeights2D(e,t,0,0,n)};dn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(c(o)||(o=new dn),!c(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;rJ._ellipsoid=ie.default,t=t??rJ,ce.southwest(e,z5),z5.height=n,ce.northeast(e,H5),H5.height=i;let r=t.project(z5,$ve),s=t.project(H5,Zve),a=s.x-r.x,l=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+l*l+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+l*.5,f.z=r.z+u*.5,o};var Qve=[];dn.fromRectangle3D=function(e,t,n,i){if(t=t??ie.default,n=n??0,c(i)||(i=new dn),!c(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,Qve);return dn.fromPoints(o,i)};dn.fromVertices=function(e,t,n,i){if(c(i)||(i=new dn),!c(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=t??d.ZERO,n=n??3,T.typeOf.number.greaterThanOrEquals("stride",n,3);let o=K5;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,G5),s=d.clone(o,j5),a=d.clone(o,W5),l=d.clone(o,q5),u=d.clone(o,Y5),f=d.clone(o,X5),h=e.length,p;for(p=0;p<h;p+=n){let B=e[p]+t.x,_=e[p+1]+t.y,w=e[p+2]+t.z;o.x=B,o.y=_,o.z=w,B<r.x&&d.clone(o,r),B>l.x&&d.clone(o,l),_<s.y&&d.clone(o,s),_>u.y&&d.clone(o,u),w<a.z&&d.clone(o,a),w>f.z&&d.clone(o,f)}let g=d.magnitudeSquared(d.subtract(l,r,ea)),m=d.magnitudeSquared(d.subtract(u,s,ea)),y=d.magnitudeSquared(d.subtract(f,a,ea)),b=r,x=l,A=g;m>A&&(A=m,b=s,x=u),y>A&&(A=y,b=a,x=f);let E=$5;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let S=d.magnitudeSquared(d.subtract(x,E,ea)),v=Math.sqrt(S),P=Z5;P.x=r.x,P.y=s.y,P.z=a.z;let M=Q5;M.x=l.x,M.y=u.y,M.z=f.z;let R=d.midpoint(P,M,J5),L=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 B=d.magnitude(d.subtract(o,R,ea));B>L&&(L=B);let _=d.magnitudeSquared(d.subtract(o,E,ea));if(_>S){let w=Math.sqrt(_);v=(v+w)*.5,S=v*v;let D=w-v;E.x=(v*E.x+D*o.x)/w,E.y=(v*E.y+D*o.y)/w,E.z=(v*E.z+D*o.z)/w}}return v<L?(d.clone(E,i.center),i.radius=v):(d.clone(R,i.center),i.radius=L),i};dn.fromEncodedCartesianVertices=function(e,t,n){if(c(n)||(n=new dn),!c(e)||!c(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=K5;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,G5),r=d.clone(i,j5),s=d.clone(i,W5),a=d.clone(i,q5),l=d.clone(i,Y5),u=d.clone(i,X5),f=e.length,h;for(h=0;h<f;h+=3){let L=e[h]+t[h],B=e[h+1]+t[h+1],_=e[h+2]+t[h+2];i.x=L,i.y=B,i.z=_,L<o.x&&d.clone(i,o),L>a.x&&d.clone(i,a),B<r.y&&d.clone(i,r),B>l.y&&d.clone(i,l),_<s.z&&d.clone(i,s),_>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(a,o,ea)),g=d.magnitudeSquared(d.subtract(l,r,ea)),m=d.magnitudeSquared(d.subtract(u,s,ea)),y=o,b=a,x=p;g>x&&(x=g,y=r,b=l),m>x&&(x=m,y=s,b=u);let A=$5;A.x=(y.x+b.x)*.5,A.y=(y.y+b.y)*.5,A.z=(y.z+b.z)*.5;let E=d.magnitudeSquared(d.subtract(b,A,ea)),S=Math.sqrt(E),v=Z5;v.x=o.x,v.y=r.y,v.z=s.z;let P=Q5;P.x=a.x,P.y=l.y,P.z=u.z;let M=d.midpoint(v,P,J5),R=0;for(h=0;h<f;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 L=d.magnitude(d.subtract(i,M,ea));L>R&&(R=L);let B=d.magnitudeSquared(d.subtract(i,A,ea));if(B>E){let _=Math.sqrt(B);S=(S+_)*.5,E=S*S;let w=_-S;A.x=(S*A.x+w*i.x)/_,A.y=(S*A.y+w*i.y)/_,A.z=(S*A.z+w*i.z)/_}}return S<R?(d.clone(A,n.center),n.radius=S):(d.clone(M,n.center),n.radius=R),n};dn.fromCornerPoints=function(e,t,n){T.typeOf.object("corner",e),T.typeOf.object("oppositeCorner",t),c(n)||(n=new dn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};dn.fromEllipsoid=function(e,t){return T.typeOf.object("ellipsoid",e),c(t)||(t=new dn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var Jve=new d;dn.fromBoundingSpheres=function(e,t){if(c(t)||(t=new dn),!c(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return dn.clone(e[0],t);if(n===2)return dn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=dn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,d.distance(r,a.center,Jve)+a.radius)}return t.radius=s,t};var eDe=new d,tDe=new d,nDe=new d;dn.fromOrientedBoundingBox=function(e,t){T.defined("orientedBoundingBox",e),c(t)||(t=new dn);let n=e.halfAxes,i=J.getColumn(n,0,eDe),o=J.getColumn(n,1,tDe),r=J.getColumn(n,2,nDe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var iDe=new d,oDe=new d;dn.fromTransformation=function(e,t){T.typeOf.object("transformation",e),c(t)||(t=new dn);let n=F.getTranslation(e,iDe),i=F.getScale(e,oDe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};dn.clone=function(e,t){if(c(e))return c(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new dn(e.center,e.radius)};dn.packedLength=4;dn.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};dn.unpack=function(e,t,n){T.defined("array",e),t=t??0,c(n)||(n=new dn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var rDe=new d,sDe=new d;dn.union=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),c(n)||(n=new dn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=d.subtract(r,i,rDe),l=d.magnitude(a);if(o>=l+s)return e.clone(n),n;if(s>=l+o)return t.clone(n),n;let u=(o+l+s)*.5,f=d.multiplyByScalar(a,(-o+u)/l,sDe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var aDe=new d;dn.expand=function(e,t,n){T.typeOf.object("sphere",e),T.typeOf.object("point",t),n=dn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,aDe));return i>n.radius&&(n.radius=i),n};dn.intersectPlane=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("plane",t);let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Wt.OUTSIDE:r<i?Wt.INTERSECTING:Wt.INSIDE};dn.transform=function(e,t,n){return T.typeOf.object("sphere",e),T.typeOf.object("transform",t),c(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var cDe=new d;dn.distanceSquaredTo=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("cartesian",t);let n=d.subtract(e.center,t,cDe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};dn.transformWithoutScale=function(e,t,n){return T.typeOf.object("sphere",e),T.typeOf.object("transform",t),c(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var lDe=new d;dn.computePlaneDistances=function(e,t,n,i){T.typeOf.object("sphere",e),T.typeOf.object("position",t),T.typeOf.object("direction",n),c(i)||(i=new $a);let o=d.subtract(e.center,t,lDe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var sJ=new d,uDe=new d,fDe=new d,dDe=new d,hDe=new d,mDe=new he,cJ=new Array(8);for(let e=0;e<8;++e)cJ[e]=new d;var aJ=new Oi;dn.projectTo2D=function(e,t,n){T.typeOf.object("sphere",e),aJ._ellipsoid=ie.default,t=t??aJ;let i=t.ellipsoid,o=e.center,r=e.radius,s;d.equals(o,d.ZERO)?s=d.clone(d.UNIT_X,sJ):s=i.geodeticSurfaceNormal(o,sJ);let a=d.cross(d.UNIT_Z,s,uDe);d.normalize(a,a);let l=d.cross(s,a,fDe);d.normalize(l,l),d.multiplyByScalar(s,r,s),d.multiplyByScalar(l,r,l),d.multiplyByScalar(a,r,a);let u=d.negate(l,hDe),f=d.negate(a,dDe),h=cJ,p=h[0];d.add(s,l,p),d.add(p,a,p),p=h[1],d.add(s,l,p),d.add(p,f,p),p=h[2],d.add(s,u,p),d.add(p,f,p),p=h[3],d.add(s,u,p),d.add(p,a,p),d.negate(s,s),p=h[4],d.add(s,l,p),d.add(p,a,p),p=h[5],d.add(s,l,p),d.add(p,f,p),p=h[6],d.add(s,u,p),d.add(p,f,p),p=h[7],d.add(s,u,p),d.add(p,a,p);let g=h.length;for(let x=0;x<g;++x){let A=h[x];d.add(o,A,A);let E=i.cartesianToCartographic(A,mDe);t.project(E,A)}n=dn.fromPoints(h,n),o=n.center;let m=o.x,y=o.y,b=o.z;return o.x=b,o.y=m,o.z=y,n};dn.isOccluded=function(e,t){return T.typeOf.object("sphere",e),T.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};dn.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};dn.prototype.intersectPlane=function(e){return dn.intersectPlane(this,e)};dn.prototype.distanceSquaredTo=function(e){return dn.distanceSquaredTo(this,e)};dn.prototype.computePlaneDistances=function(e,t,n){return dn.computePlaneDistances(this,e,t,n)};dn.prototype.isOccluded=function(e){return dn.isOccluded(this,e)};dn.prototype.equals=function(e){return dn.equals(this,e)};dn.prototype.clone=function(e){return dn.clone(this,e)};dn.prototype.volume=function(){let e=this.radius;return Kve*e*e*e};var le=dn;function pDe(e){e=e??W.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 hn=pDe;var _De={NONE:0,TOP:1,ALL:2},Zt=Object.freeze(_De);function ns(e){e=e??W.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ns.POSITION_ONLY=Object.freeze(new ns({position:!0}));ns.POSITION_AND_NORMAL=Object.freeze(new ns({position:!0,normal:!0}));ns.POSITION_NORMAL_AND_ST=Object.freeze(new ns({position:!0,normal:!0,st:!0}));ns.POSITION_AND_ST=Object.freeze(new ns({position:!0,st:!0}));ns.POSITION_AND_COLOR=Object.freeze(new ns({position:!0,color:!0}));ns.ALL=Object.freeze(new ns({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ns.DEFAULT=ns.POSITION_NORMAL_AND_ST;ns.packedLength=6;ns.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=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};ns.unpack=function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,c(n)||(n=new ns),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};ns.clone=function(e,t){if(c(e))return c(t)||(t=new ns),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 Ie=ns;var gDe=new d;function Kl(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let i=e.vertexFormat??Ie.DEFAULT;this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Kl.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new Kl({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Kl.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundingBox",e),new Kl({minimum:e.minimum,maximum:e.maximum})};Kl.packedLength=2*d.packedLength+Ie.packedLength+1;Kl.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),Ie.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+Ie.packedLength]=e._offsetAttribute??-1,t};var uJ=new d,fJ=new d,dJ=new Ie,lJ={minimum:uJ,maximum:fJ,vertexFormat:dJ,offsetAttribute:void 0};Kl.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,uJ),o=d.unpack(e,t+d.packedLength,fJ),r=Ie.unpack(e,t+2*d.packedLength,dJ),s=e[t+2*d.packedLength+Ie.packedLength];return c(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(lJ.offsetAttribute=s===-1?void 0:s,new Kl(lJ))};Kl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new hn,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 ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}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 ve({componentDatatype:$.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=d.subtract(n,t,gDe),l=d.magnitude(a)*.5;if(c(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===Zt.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new ct({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,l),offsetAttribute:e._offsetAttribute})};var e6;Kl.getUnitBox=function(){return c(e6)||(e6=Kl.createGeometry(Kl.fromDimensions({dimensions:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),e6};var Za=Kl;var Qi={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Qi.getMathType=function(e){switch(e){case Qi.SCALAR:return Number;case Qi.VEC2:return z;case Qi.VEC3:return d;case Qi.VEC4:return se;case Qi.MAT2:return Ri;case Qi.MAT3:return J;case Qi.MAT4:return F;default:throw new C("attributeType is not a valid value.")}};Qi.getNumberOfComponents=function(e){switch(e){case Qi.SCALAR:return 1;case Qi.VEC2:return 2;case Qi.VEC3:return 3;case Qi.VEC4:case Qi.MAT2:return 4;case Qi.MAT3:return 9;case Qi.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}};Qi.getAttributeLocationCount=function(e){switch(e){case Qi.SCALAR:case Qi.VEC2:case Qi.VEC3:case Qi.VEC4:return 1;case Qi.MAT2:return 2;case Qi.MAT3:return 3;case Qi.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}};Qi.getGlslType=function(e){switch(T.typeOf.string("attributeType",e),e){case Qi.SCALAR:return"float";case Qi.VEC2:return"vec2";case Qi.VEC3:return"vec3";case Qi.VEC4:return"vec4";case Qi.MAT2:return"mat2";case Qi.MAT3:return"mat3";case Qi.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};var nn=Object.freeze(Qi);var hJ=1/256,mJ=256,mo={};mo.octEncodeInRange=function(e,t,n){T.defined("vector",e),T.defined("result",n);let i=d.magnitudeSquared(e);if(Math.abs(i-1)>O.EPSILON6)throw new C("vector must be normalized.");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 o=n.x,r=n.y;n.x=(1-Math.abs(r))*O.signNotZero(o),n.y=(1-Math.abs(o))*O.signNotZero(r)}return n.x=O.toSNorm(n.x,t),n.y=O.toSNorm(n.y,t),n};mo.octEncode=function(e,t){return mo.octEncodeInRange(e,255,t)};var nw=new z,pJ=new Uint8Array(1);function u1(e){return pJ[0]=e,pJ[0]}mo.octEncodeToCartesian4=function(e,t){return mo.octEncodeInRange(e,65535,nw),t.x=u1(nw.x*hJ),t.y=u1(nw.x),t.z=u1(nw.y*hJ),t.w=u1(nw.y),t};mo.octDecodeInRange=function(e,t,n,i){if(T.defined("result",i),e<0||e>n||t<0||t>n)throw new C(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=O.fromSNorm(e,n),i.y=O.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))*O.signNotZero(o),i.y=(1-Math.abs(o))*O.signNotZero(i.y)}return d.normalize(i,i)};mo.octDecode=function(e,t,n){return mo.octDecodeInRange(e,t,255,n)};mo.octDecodeFromCartesian4=function(e,t){T.typeOf.object("encoded",e),T.typeOf.object("result",t);let n=e.x,i=e.y,o=e.z,r=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||r<0||r>255)throw new C("x, y, z, and w must be unsigned normalized integers between 0 and 255");let s=n*mJ+i,a=o*mJ+r;return mo.octDecodeInRange(s,a,65535,t)};mo.octPackFloat=function(e){return T.defined("encoded",e),256*e.x+e.y};var n6=new z;mo.octEncodeFloat=function(e){return mo.octEncode(e,n6),mo.octPackFloat(n6)};mo.octDecodeFloat=function(e,t){T.defined("value",e);let n=e/256,i=Math.floor(n),o=(n-i)*256;return mo.octDecode(i,o,t)};mo.octPack=function(e,t,n,i){T.defined("v1",e),T.defined("v2",t),T.defined("v3",n),T.defined("result",i);let o=mo.octEncodeFloat(e),r=mo.octEncodeFloat(t),s=mo.octEncode(n,n6);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};mo.octUnpack=function(e,t,n,i){T.defined("packed",e),T.defined("v1",t),T.defined("v2",n),T.defined("v3",i);let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),l=(o-a)*65536;mo.octDecodeFloat(s,t),mo.octDecodeFloat(l,n),mo.octDecode(r,a,i)};mo.compressTextureCoordinates=function(e){T.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};mo.decompressTextureCoordinates=function(e,t){T.defined("compressed",e),T.defined("result",t);let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function t6(e){return e>>1^-(e&1)}mo.zigZagDeltaDecode=function(e,t,n){T.defined("uBuffer",e),T.defined("vBuffer",t),T.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),c(n)&&T.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=t6(e[a]),r+=t6(t[a]),e[a]=o,t[a]=r,c(n)&&(s+=t6(n[a]),n[a]=s)};mo.dequantize=function(e,t,n,i){T.defined("typedArray",e),T.defined("componentDatatype",t),T.defined("type",n),T.defined("count",i);let o=nn.getNumberOfComponents(n),r;switch(t){case $.BYTE:r=127;break;case $.UNSIGNED_BYTE:r=255;break;case $.SHORT:r=32767;break;case $.UNSIGNED_SHORT:r=65535;break;case $.INT:r=2147483647;break;case $.UNSIGNED_INT:r=4294967295;break;default:throw new C(`Cannot dequantize component datatype: ${t}`)}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let l=0;l<o;l++){let u=a*o+l;s[u]=Math.max(e[u]/r,-1)}return s};mo.decodeRGB565=function(e,t){T.defined("typedArray",e);let n=e.length*3;c(t)&&T.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let i=e.length;c(t)||(t=new Float32Array(i*3));let o=31,r=63,s=1/31,a=1/63;for(let l=0;l<i;l++){let u=e[l],f=u>>11,h=u>>5&r,p=u&o,g=3*l;t[g]=f*s,t[g+1]=h*a,t[g+2]=p*s}return t};var Ln=mo;var _J=new d,gJ=new d,yJ=new d;function yDe(e,t,n,i,o){T.defined("point",e),T.defined("p0",t),T.defined("p1",n),T.defined("p2",i),c(o)||(o=new d);let r,s,a,l,u,f,h,p;if(c(t.z)){if(d.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,_J),s=d.subtract(i,t,gJ),a=d.subtract(e,t,yJ),l=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),p=d.dot(s,a)}else{if(z.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(z.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(z.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=z.subtract(n,t,_J),s=z.subtract(i,t,gJ),a=z.subtract(e,t,yJ),l=z.dot(r,r),u=z.dot(r,s),f=z.dot(r,a),h=z.dot(s,s),p=z.dot(s,a)}o.y=h*f-u*p,o.z=l*p-u*f;let g=l*h-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var CT=yDe;function Ph(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}Ph.encode=function(e,t){T.typeOf.number("value",e),c(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 dp={high:0,low:0};Ph.fromCartesian=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new Ph);let n=t.high,i=t.low;return Ph.encode(e.x,dp),n.x=dp.high,i.x=dp.low,Ph.encode(e.y,dp),n.y=dp.high,i.y=dp.low,Ph.encode(e.z,dp),n.z=dp.high,i.z=dp.low,t};var i6=new Ph;Ph.writeElements=function(e,t,n){T.defined("cartesianArray",t),T.typeOf.number("index",n),T.typeOf.number.greaterThanOrEquals("index",n,0),Ph.fromCartesian(e,i6);let i=i6.high,o=i6.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 Hn=Ph;var o6={};o6.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");return t*t-4*e*n};function bJ(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}o6.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let l=Math.abs(n),u=Math.abs(e);if(l<u&&l/u<O.EPSILON14)return[0,0];if(l>u&&u/l<O.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=bJ(o,-r,O.EPSILON14);if(s<0)return[];let a=-.5*bJ(t,O.sign(t)*Math.sqrt(s),O.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var ul=o6;var s6={};s6.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");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 r6(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,l=o*s,u=r*a,f=r*r,h=s*s,p=o*s-f,g=o*a-r*s,m=r*a-h,y=4*p*m-g*g,b,x;if(y<0){let q,X,te;f*u>=l*h?(q=o,X=p,te=-2*r*p+o*g):(q=a,X=m,te=-a*g+2*s*m);let Z=-(te<0?-1:1)*Math.abs(q)*Math.sqrt(-y);x=-te+Z;let ee=x/2,me=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),xe=x===Z?-me:-X/me;return b=X<=0?me+xe:-te/(me*me+xe*xe+X),f*u>=l*h?[(b-r)/o]:[-a/(b+s)]}let A=p,E=-2*r*p+o*g,S=m,v=-a*g+2*s*m,P=Math.sqrt(y),M=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*P,-E)/3);b=2*Math.sqrt(-A);let L=Math.cos(R);x=b*L;let B=b*(-L/2-M*Math.sin(R)),_=x+B>2*r?x-r:B-r,w=o,D=_/w;R=Math.abs(Math.atan2(a*P,-v)/3),b=2*Math.sqrt(-S),L=Math.cos(R),x=b*L,B=b*(-L/2-M*Math.sin(R));let I=-a,N=x+B<2*s?x+s:B+s,k=I/N,H=w*N,V=-_*N-w*I,j=_*I,U=(s*V-r*j)/(-r*V+s*H);return D<=U?D<=k?U<=k?[D,U,k]:[D,k,U]:[k,D,U]:D<=k?[U,D,k]:U<=k?[U,k,D]:[k,U,D]}s6.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o,r;if(e===0)return ul.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=ul.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return r6(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):r6(e,t,0,i);if(i===0)return o=ul.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 r6(e,t,n,i)};var ET=s6;var a6={};a6.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");let r=e*e,s=r*e,a=t*t,l=a*t,u=n*n,f=u*n,h=i*i,p=h*i,g=o*o,m=g*o;return a*u*h-4*l*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*s*m+o*(18*l*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function ud(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,l=ET.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(l.length>0){let u=-e/4,f=l[l.length-1];if(Math.abs(f)<O.EPSILON14){let h=ul.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],g=h[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-y,u+y,u+b]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-s/h)/2,g=(r+f+s/h)/2,m=ul.computeRealRoots(1,h,p),y=ul.computeRealRoots(1,-h,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function iw(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,l=n*e+r-4*i,u=s*i-n*t*e+o,f=ET.computeRealRoots(1,a,l,u);if(f.length>0){let h=f[0],p=t-h,g=p*p,m=e/2,y=p/2,b=g-4*i,x=g+4*Math.abs(i),A=s-4*h,E=s+4*Math.abs(h),S,v;if(h<0||b*E<A*x){let w=Math.sqrt(A);S=w/2,v=w===0?0:(e*y-n)/w}else{let w=Math.sqrt(b);S=w===0?0:(e*y-n)/w,v=w/2}let P,M;m===0&&S===0?(P=0,M=0):O.sign(m)===O.sign(S)?(P=m+S,M=h/P):(M=m-S,P=h/M);let R,L;y===0&&v===0?(R=0,L=0):O.sign(y)===O.sign(v)?(R=y+v,L=i/R):(L=y-v,R=i/L);let B=ul.computeRealRoots(1,P,R),_=ul.computeRealRoots(1,M,L);if(B.length!==0)return _.length!==0?B[1]<=_[0]?[B[0],B[1],_[0],_[1]]:_[1]<=B[0]?[_[0],_[1],B[0],B[1]]:B[0]>=_[0]&&B[1]<=_[1]?[_[0],B[0],B[1],_[1]]:_[0]>=B[0]&&_[1]<=B[1]?[B[0],_[0],_[1],B[1]]:B[0]>_[0]&&B[0]<_[1]?[_[0],B[0],_[1],B[1]]:[B[0],_[0],B[1],_[1]]:B;if(_.length!==0)return _}return[]}a6.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");if(Math.abs(e)<O.EPSILON15)return ET.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,l=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=l<0?u+1:u,u){case 0:return ud(r,s,a,l);case 1:return iw(r,s,a,l);case 2:return iw(r,s,a,l);case 3:return ud(r,s,a,l);case 4:return ud(r,s,a,l);case 5:return iw(r,s,a,l);case 6:return ud(r,s,a,l);case 7:return ud(r,s,a,l);case 8:return iw(r,s,a,l);case 9:return ud(r,s,a,l);case 10:return ud(r,s,a,l);case 11:return iw(r,s,a,l);case 12:return ud(r,s,a,l);case 13:return ud(r,s,a,l);case 14:return ud(r,s,a,l);case 15:return ud(r,s,a,l);default:return}};var f1=a6;function d1(e,t){t=d.clone(t??d.ZERO),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(e??d.ZERO),this.direction=t}d1.clone=function(e,t){if(c(e))return c(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new d1(e.origin,e.direction)};d1.getPoint=function(e,t,n){return T.typeOf.object("ray",e),T.typeOf.number("t",t),c(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var _n=d1;var Lo={};Lo.rayPlane=function(e,t,n){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("plane is required.");c(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,s=d.dot(r,o);if(Math.abs(s)<O.EPSILON15)return;let a=(-t.distance-d.dot(r,i))/s;if(!(a<0))return n=d.multiplyByScalar(o,a,n),d.add(i,n,n)};var bDe=new d,xDe=new d,vJ=new d,xJ=new d,TJ=new d;Lo.rayTriangleParametric=function(e,t,n,i,o){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("p0 is required.");if(!c(n))throw new C("p1 is required.");if(!c(i))throw new C("p2 is required.");o=o??!1;let r=e.origin,s=e.direction,a=d.subtract(n,t,bDe),l=d.subtract(i,t,xDe),u=d.cross(s,l,vJ),f=d.dot(a,u),h,p,g,m,y;if(o){if(f<O.EPSILON6||(h=d.subtract(r,t,xJ),g=d.dot(h,u),g<0||g>f)||(p=d.cross(h,a,TJ),m=d.dot(s,p),m<0||g+m>f))return;y=d.dot(l,p)/f}else{if(Math.abs(f)<O.EPSILON6)return;let b=1/f;if(h=d.subtract(r,t,xJ),g=d.dot(h,u)*b,g<0||g>1||(p=d.cross(h,a,TJ),m=d.dot(s,p)*b,m<0||g+m>1))return;y=d.dot(l,p)*b}return y};Lo.rayTriangle=function(e,t,n,i,o,r){let s=Lo.rayTriangleParametric(e,t,n,i,o);if(!(!c(s)||s<0))return c(r)||(r=new d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var TDe=new _n;Lo.lineSegmentTriangle=function(e,t,n,i,o,r,s){if(!c(e))throw new C("v0 is required.");if(!c(t))throw new C("v1 is required.");if(!c(n))throw new C("p0 is required.");if(!c(i))throw new C("p1 is required.");if(!c(o))throw new C("p2 is required.");let a=TDe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let l=Lo.rayTriangleParametric(a,n,i,o,r);if(!(!c(l)||l<0||l>d.distance(e,t)))return c(s)||(s=new d),d.multiplyByScalar(a.direction,l,s),d.add(a.origin,s,s)};function ADe(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),l=(-t+a)*s,u=(-t-a)*s;return l<u?(i.root0=l,i.root1=u):(i.root0=u,i.root1=l),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var CDe={root0:0,root1:0};function DJ(e,t,n){c(n)||(n=new $a);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=d.subtract(i,r,vJ),l=d.dot(o,o),u=2*d.dot(o,a),f=d.magnitudeSquared(a)-s,h=ADe(l,u,f,CDe);if(c(h))return n.start=h.root0,n.stop=h.root1,n}Lo.raySphere=function(e,t,n){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("sphere is required.");if(n=DJ(e,t,n),!(!c(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var EDe=new _n;Lo.lineSegmentSphere=function(e,t,n,i){if(!c(e))throw new C("p0 is required.");if(!c(t))throw new C("p1 is required.");if(!c(n))throw new C("sphere is required.");let o=EDe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),s=d.magnitude(r);if(d.normalize(r,r),i=DJ(o,n,i),!(!c(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var SDe=new d,wDe=new d;Lo.rayEllipsoid=function(e,t){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("ellipsoid is required.");let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,SDe),o=d.multiplyComponents(n,e.direction,wDe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,l,u,f,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,l=d.magnitudeSquared(o),u=l*a,p<u)return;if(p>u){f=s*s-u,h=-s+Math.sqrt(f);let m=h/l,y=a/h;return m<y?new $a(m,y):{start:y,stop:m}}let g=Math.sqrt(a/l);return new $a(g,g)}else if(r<1)return a=r-1,l=d.magnitudeSquared(o),u=l*a,f=s*s-u,h=-s+Math.sqrt(f),new $a(0,h/l);if(s<0)return l=d.magnitudeSquared(o),new $a(0,-s/l)};function N0(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Lo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[J.COLUMN1ROW1]-e[J.COLUMN2ROW2])*s,l=o*(i*N0(e[J.COLUMN1ROW0],e[J.COLUMN0ROW1],O.EPSILON15)+t.y),u=e[J.COLUMN0ROW0]*r+e[J.COLUMN2ROW2]*s+i*t.x+n,f=s*N0(e[J.COLUMN2ROW1],e[J.COLUMN1ROW2],O.EPSILON15),h=o*(i*N0(e[J.COLUMN2ROW0],e[J.COLUMN0ROW2])+t.z),p,g=[];if(h===0&&f===0){if(p=ul.computeRealRoots(a,l,u),p.length===0)return g;let R=p[0],L=Math.sqrt(Math.max(1-R*R,0));if(g.push(new d(i,o*R,o*-L)),g.push(new d(i,o*R,o*L)),p.length===2){let B=p[1],_=Math.sqrt(Math.max(1-B*B,0));g.push(new d(i,o*B,o*-_)),g.push(new d(i,o*B,o*_))}return g}let m=h*h,y=f*f,b=a*a,x=h*f,A=b+y,E=2*(l*a+x),S=2*u*a+l*l-y+m,v=2*(u*l-x),P=u*u-m;if(A===0&&E===0&&S===0&&v===0)return g;p=f1.computeRealRoots(A,E,S,v,P);let M=p.length;if(M===0)return g;for(let R=0;R<M;++R){let L=p[R],B=L*L,_=Math.max(1-B,0),w=Math.sqrt(_),D;O.sign(a)===O.sign(u)?D=N0(a*B+u,l*L,O.EPSILON12):O.sign(u)===O.sign(l*L)?D=N0(a*B,l*L+u,O.EPSILON12):D=N0(a*B+l*L,u,O.EPSILON12);let I=N0(f*L,h,O.EPSILON15),N=D*I;N<0?g.push(new d(i,o*L,o*w)):N>0?g.push(new d(i,o*L,o*-w)):w!==0?(g.push(new d(i,o*L,o*-w)),g.push(new d(i,o*L,o*w)),++R):g.push(new d(i,o*L,o*w))}return g};var c6=new d,AJ=new d,CJ=new d,h1=new d,vDe=new d,DDe=new J,PDe=new J,IDe=new J,ODe=new J,RDe=new J,EJ=new J,SJ=new J,wJ=new d,MDe=new d,LDe=new he;Lo.grazingAltitudeLocation=function(e,t){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("ellipsoid is required.");let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let P=t.geodeticSurfaceNormal(n,c6);if(d.dot(i,P)>=0)return n}let o=c(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,c6),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,h1),l=d.normalize(d.cross(a,s,AJ),AJ),u=d.normalize(d.cross(s,l,CJ),CJ),f=DDe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=l.x,f[4]=l.y,f[5]=l.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=J.transpose(f,PDe),p=J.fromScale(t.radii,IDe),g=J.fromScale(t.oneOverRadii,ODe),m=RDe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=J.multiply(J.multiply(h,g,EJ),m,EJ),b=J.multiply(J.multiply(y,p,SJ),f,SJ),x=J.multiplyByVector(y,n,vDe),A=Lo.quadraticVectorExpression(b,d.negate(x,c6),0,0,1),E,S,v=A.length;if(v>0){let P=d.clone(d.ZERO,MDe),M=Number.NEGATIVE_INFINITY;for(let L=0;L<v;++L){E=J.multiplyByVector(p,J.multiplyByVector(f,A[L],wJ),wJ);let B=d.normalize(d.subtract(E,n,h1),h1),_=d.dot(B,i);_>M&&(M=_,P=d.clone(E,P))}let R=t.cartesianToCartographic(P,LDe);return M=O.clamp(M,0,1),S=d.magnitude(d.subtract(P,n,h1))*Math.sqrt(1-M*M),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new d)}};var NDe=new d;Lo.lineSegmentPlane=function(e,t,n,i){if(!c(e))throw new C("endPoint0 is required.");if(!c(t))throw new C("endPoint1 is required.");if(!c(n))throw new C("plane is required.");c(i)||(i=new d);let o=d.subtract(t,e,NDe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)<O.EPSILON6)return;let a=d.dot(r,e),l=-(n.distance+a)/s;if(!(l<0||l>1))return d.multiplyByScalar(o,l,i),d.add(e,i,i),i};Lo.trianglePlaneIntersection=function(e,t,n,i){if(!c(e)||!c(t)||!c(n)||!c(i))throw new C("p0, p1, p2, and plane are required.");let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,l=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=l?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return Lo.lineSegmentPlane(e,t,i,f),Lo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Lo.lineSegmentPlane(t,n,i,f),Lo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Lo.lineSegmentPlane(n,e,i,f),Lo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!l)return Lo.lineSegmentPlane(e,n,i,f),Lo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Lo.lineSegmentPlane(n,t,i,f),Lo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Lo.lineSegmentPlane(t,e,i,f),Lo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var Qn=Lo;function Os(e,t){if(T.typeOf.object("normal",e),!O.equalsEpsilon(d.magnitude(e),1,O.EPSILON6))throw new C("normal must be normalized.");T.typeOf.number("distance",t),this.normal=d.clone(e),this.distance=t}Os.fromPointNormal=function(e,t,n){if(T.typeOf.object("point",e),T.typeOf.object("normal",t),!O.equalsEpsilon(d.magnitude(t),1,O.EPSILON6))throw new C("normal must be normalized.");let i=-d.dot(t,e);return c(n)?(d.clone(t,n.normal),n.distance=i,n):new Os(t,i)};var FDe=new d;Os.fromCartesian4=function(e,t){T.typeOf.object("coefficients",e);let n=d.fromCartesian4(e,FDe),i=e.w;if(!O.equalsEpsilon(d.magnitude(n),1,O.EPSILON6))throw new C("normal must be normalized.");return c(t)?(d.clone(n,t.normal),t.distance=i,t):new Os(n,i)};Os.getPointDistance=function(e,t){return T.typeOf.object("plane",e),T.typeOf.object("point",t),d.dot(e.normal,t)+e.distance};var BDe=new d;Os.projectPointOntoPlane=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("point",t),c(n)||(n=new d);let i=Os.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,BDe);return d.subtract(t,o,n)};var kDe=new F,UDe=new se,VDe=new d;Os.transform=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("transform",t);let i=e.normal,o=e.distance,r=F.inverseTranspose(t,kDe),s=se.fromElements(i.x,i.y,i.z,o,UDe);s=F.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,VDe);return s=se.divideByScalar(s,d.magnitude(a),s),Os.fromCartesian4(s,n)};Os.clone=function(e,t){return T.typeOf.object("plane",e),c(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new Os(e.normal,e.distance)};Os.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.distance===t.distance&&d.equals(e.normal,t.normal)};Os.ORIGIN_XY_PLANE=Object.freeze(new Os(d.UNIT_Z,0));Os.ORIGIN_YZ_PLANE=Object.freeze(new Os(d.UNIT_X,0));Os.ORIGIN_ZX_PLANE=Object.freeze(new Os(d.UNIT_Y,0));var sn=Os;var l6={};l6.calculateACMR=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24;if(!c(t))throw new C("indices is required.");let o=t.length;if(o<3||o%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");if(!c(n)){n=0;let a=0,l=t[a];for(;a<o;)l>n&&(n=l),++a,l=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)};l6.tipsify=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(_,w,D,I){for(;w.length>=1;){let N=w[w.length-1];if(w.splice(w.length-1,1),_[N].numLiveTriangles>0)return N}for(;o<I;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(_,w,D,I,N,k,H){let V=-1,j,U=-1,q=0;for(;q<D.length;){let X=D[q];I[X].numLiveTriangles&&(j=0,N-I[X].timeStamp+2*I[X].numLiveTriangles<=w&&(j=N-I[X].timeStamp),(j>U||U===-1)&&(U=j,V=X)),++q}return V===-1?r(I,k,_,H):V}if(!c(t))throw new C("indices is required.");let a=t.length;if(a<3||a%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");let l=0,u=0,f=t[u],h=a;if(c(n))l=n+1;else{for(;u<h;)f>l&&(l=f),++u,f=t[u];if(l===-1)return 0;++l}let p=[],g;for(g=0;g<l;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,b=i+1;o=1;let x=[],A=[],E,S,v=0,P=[],M=a/3,R=[];for(g=0;g<M;g++)R[g]=!1;let L,B;for(;y!==-1;){x=[],S=p[y],B=S.vertexTriangles.length;for(let _=0;_<B;++_)if(m=S.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let w=0;w<3;++w)L=t[u],x.push(L),A.push(L),P[v]=L,++v,E=p[L],--E.numLiveTriangles,b-E.timeStamp>i&&(E.timeStamp=b,++b),++u}y=s(t,i,x,p,b,A,l)}return P};var m1=l6;var Ac={};function T1(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function zDe(e){let t=e.length,n=t/3*6,i=Fe.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)T1(i,o,e[r],e[r+1],e[r+2]);return i}function HDe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Fe.createTypedArray(t,n);T1(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)T1(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function GDe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)T1(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Ac.toWireframe=function(e){if(!c(e))throw new C("geometry is required.");let t=e.indices;if(c(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=zDe(t);break;case Me.TRIANGLE_STRIP:e.indices=HDe(t);break;case Me.TRIANGLE_FAN:e.indices=GDe(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=Me.LINES}return e};Ac.createLineSegmentsForVectors=function(e,t,n){if(t=t??"normal",!c(e))throw new C("geometry is required.");if(!c(e.attributes.position))throw new C("geometry.attributes.position is required.");if(!c(e.attributes[t]))throw new C(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=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 f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let l,u=e.boundingSphere;return c(u)&&(l=new le(u.center,u.radius+n)),new ct({attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:l})};Ac.createAttributeLocations=function(e){if(!c(e))throw new C("geometry is required.");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];c(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!c(i[a])&&(i[a]=o++);return i};Ac.reorderForPreVertexCache=function(e){if(!c(e))throw new C("geometry is required.");let t=ct.computeNumberOfVertices(e),n=e.indices;if(c(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Fe.createTypedArray(t,r),a=0,l=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[l]=f:(f=o[a],i[f]=u,s[l]=u,++u),++a,++l;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&c(h[p])&&c(h[p].values)){let g=h[p],m=g.values,y=0,b=g.componentsPerAttribute,x=$.createTypedArray(g.componentDatatype,u*b);for(;y<t;){let A=i[y];if(A!==-1)for(let E=0;E<b;E++)x[b*A+E]=m[b*y+E];++y}g.values=x}}return e};Ac.reorderForPostVertexCache=function(e,t){if(!c(e))throw new C("geometry is required.");let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&c(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=m1.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function PJ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function jDe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(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){if(!c(e))throw new C("geometry is required.");if(c(e.indices)&&e.primitiveType!==Me.TRIANGLES&&e.primitiveType!==Me.LINES&&e.primitiveType!==Me.POINTS)throw new C("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let t=[],n=ct.computeNumberOfVertices(e);if(c(e.indices)&&n>=O.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=PJ(e.attributes),a=e.indices,l=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<l;f+=u){for(let h=0;h<u;++h){let p=a[f+h],g=i[p];c(g)||(g=r++,i[p]=g,jDe(s,e.attributes,p)),o.push(g)}r+u>=O.SIXTY_FOUR_KILOBYTES&&(t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=PJ(e.attributes))}o.length!==0&&t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var IJ=new d,WDe=new he;Ac.projectTo2D=function(e,t,n,i,o){if(!c(e))throw new C("geometry is required.");if(!c(t))throw new C("attributeName is required.");if(!c(n))throw new C("attributeName3D is required.");if(!c(i))throw new C("attributeName2D is required.");if(!c(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t];o=c(o)?o:new Oi;let s=o.ellipsoid,a=r.values,l=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let h=d.fromArray(a,f,IJ),p=s.cartesianToCartographic(h,WDe);if(!c(p))throw new C(`Could not project point (${h.x}, ${h.y}, ${h.z}) to 2D.`);let g=o.project(p,IJ);l[u++]=g.x,l[u++]=g.y,l[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};var u6={high:0,low:0};Ac.encodeAttribute=function(e,t,n,i){if(!c(e))throw new C("geometry is required.");if(!c(t))throw new C("attributeName is required.");if(!c(n))throw new C("attributeHighName is required.");if(!c(i))throw new C("attributeLowName is required.");if(!c(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),l=new Float32Array(s);for(let f=0;f<s;++f)Hn.encode(r[f],u6),a[f]=u6.high,l[f]=u6.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};var dd=new d;function f6(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),F.multiplyByPoint(e,dd,dd),d.pack(dd,n,o)}}function d6(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),J.multiplyByVector(e,dd,dd),dd=d.normalize(dd,dd),d.pack(dd,n,o)}}var p1=new F,_1=new J;Ac.transformToWorldCoordinates=function(e){if(!c(e))throw new C("instance is required.");let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;f6(t,n.position),f6(t,n.prevPosition),f6(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(F.inverse(t,p1),F.transpose(p1,p1),F.getMatrix3(p1,_1),d6(_1,n.normal),d6(_1,n.tangent),d6(_1,n.bitangent));let i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function qDe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&c(o[r])&&c(o[r].values)){let s=o[r],a=s.values.length,l=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!c(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){l=!1;break}a+=f.values.length}l&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:$.createTypedArray(s.componentDatatype,a)}))}return i}var YDe=new d;function h6(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,l=c(e[0][t].indices),u=e[0][t].primitiveType;for(o=1;o<n;++o){if(!F.equals(e[o].modelMatrix,a))throw new C("All instances must have the same modelMatrix.");if(c(e[o][t].indices)!==l)throw new C("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==u)throw new C("All instance geometries must have the same primitiveType.")}let f=qDe(e,t),h,p,g;for(i in f)if(f.hasOwnProperty(i))for(h=f[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 m;if(l){let A=0;for(o=0;o<n;++o)A+=e[o][t].indices.length;let E=ct.computeNumberOfVertices(new ct({attributes:f,primitiveType:Me.POINTS})),S=Fe.createTypedArray(E,A),v=0,P=0;for(o=0;o<n;++o){let M=e[o][t].indices,R=M.length;for(s=0;s<R;++s)S[v++]=P+M[s];P+=ct.computeNumberOfVertices(e[o][t])}m=S}let y=new d,b=0,x;for(o=0;o<n;++o){if(x=e[o][t].boundingSphere,!c(x)){y=void 0;break}d.add(x.center,y,y)}if(c(y))for(d.divideByScalar(y,n,y),o=0;o<n;++o){x=e[o][t].boundingSphere;let A=d.magnitude(d.subtract(x.center,y,YDe))+x.radius;A>b&&(b=A)}return new ct({attributes:f,indices:m,primitiveType:u,boundingSphere:c(y)?new le(y,b):void 0})}Ac.combineInstances=function(e){if(!c(e)||e.length<1)throw new C("instances is required and must have length greater than zero.");let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];c(s.geometry)?t.push(s):c(s.westHemisphereGeometry)&&c(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(h6(t,"geometry")),n.length>0&&(o.push(h6(n,"westHemisphereGeometry")),o.push(h6(n,"eastHemisphereGeometry"))),o};var $u=new d,ow=new d,ST=new d,wT=new d;Ac.computeNormal=function(e){if(!c(e))throw new C("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new C("geometry.attributes.position.values is required.");if(!c(e.indices))throw new C("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");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),l=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],y=t[u+1],b=t[u+2],x=m*3,A=y*3,E=b*3;ow.x=i[x],ow.y=i[x+1],ow.z=i[x+2],ST.x=i[A],ST.y=i[A+1],ST.z=i[A+2],wT.x=i[E],wT.y=i[E+1],wT.z=i[E+2],s[m].count++,s[y].count++,s[b].count++,d.subtract(ST,ow,ST),d.subtract(wT,ow,wT),a[f]=d.cross(ST,wT,new d),f++}let h=0;for(u=0;u<o;u++)s[u].indexOffset+=h,h+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;l[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,l[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,l[m]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],d.clone(d.ZERO,$u),p.count>0){for(f=0;f<p.count;f++)d.add($u,a[l[p.indexOffset+f]],$u);d.equalsEpsilon(d.ZERO,$u,O.EPSILON10)&&d.clone(a[l[p.indexOffset]],$u)}d.equalsEpsilon(d.ZERO,$u,O.EPSILON10)&&($u.z=1),d.normalize($u,$u),g[m]=$u.x,g[m+1]=$u.y,g[m+2]=$u.z}return e.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g}),e};var XDe=new d,OJ=new d,KDe=new d;Ac.computeTangentAndBitangent=function(e){if(!c(e))throw new C("geometry is required.");let t=e.attributes,n=e.indices;if(!c(t.position)||!c(t.position.values))throw new C("geometry.attributes.position.values is required.");if(!c(t.normal)||!c(t.normal.values))throw new C("geometry.attributes.normal.values is required.");if(!c(t.st)||!c(t.st.values))throw new C("geometry.attributes.st.values is required.");if(!c(n))throw new C("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let 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,l=new Array(s*3),u;for(u=0;u<l.length;u++)l[u]=0;let f,h,p;for(u=0;u<a;u+=3){let y=n[u],b=n[u+1],x=n[u+2];f=y*3,h=b*3,p=x*3;let A=y*2,E=b*2,S=x*2,v=i[f],P=i[f+1],M=i[f+2],R=r[A],L=r[A+1],B=r[E+1]-L,_=r[S+1]-L,w=1/((r[E]-R)*_-(r[S]-R)*B),D=(_*(i[h]-v)-B*(i[p]-v))*w,I=(_*(i[h+1]-P)-B*(i[p+1]-P))*w,N=(_*(i[h+2]-M)-B*(i[p+2]-M))*w;l[f]+=D,l[f+1]+=I,l[f+2]+=N,l[h]+=D,l[h+1]+=I,l[h+2]+=N,l[p]+=D,l[p+1]+=I,l[p+2]+=N}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,h=f+1,p=f+2;let y=d.fromArray(o,f,XDe),b=d.fromArray(l,f,KDe),x=d.dot(y,b);d.multiplyByScalar(y,x,OJ),d.normalize(d.subtract(b,OJ,b),b),g[f]=b.x,g[h]=b.y,g[p]=b.z,d.normalize(d.cross(y,b,b),b),m[f]=b.x,m[h]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m}),e};var rw=new z,fd=new d,RJ=new d,MJ=new d,g1=new z;Ac.compressVertices=function(e){if(!c(e))throw new C("geometry is required.");let t=e.attributes.extrudeDirection,n,i;if(c(t)){let P=t.values;i=P.length/3;let M=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(d.fromArray(P,n*3,fd),d.equals(fd,d.ZERO)){R+=2;continue}g1=Ln.octEncodeInRange(fd,65535,g1),M[R++]=g1.x,M[R++]=g1.y}return e.attributes.compressedAttributes=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:M}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=c(o),a=c(r);if(!s&&!a)return e;let l=e.attributes.tangent,u=e.attributes.bitangent,f=c(l),h=c(u),p,g,m,y;s&&(p=o.values),a&&(g=r.values),f&&(m=l.values),h&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let A=i,E=a&&s?2:1;E+=f||h?1:0,A*=E;let S=new Float32Array(A),v=0;for(n=0;n<i;++n){a&&(z.fromArray(g,n*2,rw),S[v++]=Ln.compressTextureCoordinates(rw));let P=n*3;s&&c(m)&&c(y)?(d.fromArray(p,P,fd),d.fromArray(m,P,RJ),d.fromArray(y,P,MJ),Ln.octPack(fd,RJ,MJ,rw),S[v++]=rw.x,S[v++]=rw.y):(s&&(d.fromArray(p,P,fd),S[v++]=Ln.octEncodeFloat(fd)),f&&(d.fromArray(m,P,fd),S[v++]=Ln.octEncodeFloat(fd)),h&&(d.fromArray(y,P,fd),S[v++]=Ln.octEncodeFloat(fd)))}return e.attributes.compressedAttributes=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:E,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function $De(e){if(c(e.indices))return e;let t=ct.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");if(t%3!==0)throw new C("The number of vertices must be a multiple of three.");let n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function ZDe(e){let t=ct.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");let n=Fe.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=Me.TRIANGLES,e}function QDe(e){let t=ct.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");let n=Fe.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=Me.TRIANGLES,e}function JDe(e){if(c(e.indices))return e;let t=ct.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");if(t%2!==0)throw new C("The number of vertices must be a multiple of 2.");let n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function ePe(e){let t=ct.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");let n=Fe.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=Me.LINES,e}function tPe(e){let t=ct.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");let n=Fe.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=Me.LINES,e}function nPe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return ZDe(e);case Me.TRIANGLE_STRIP:return QDe(e);case Me.TRIANGLES:return $De(e);case Me.LINE_STRIP:return ePe(e);case Me.LINE_LOOP:return tPe(e);case Me.LINES:return JDe(e)}return e}function G_(e,t){Math.abs(e.y)<O.EPSILON6&&(t?e.y=-O.EPSILON6:e.y=O.EPSILON6)}function iPe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){G_(e,e.y<0),G_(t,t.y<0),G_(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=O.sign(e.y):s=O.sign(n.y):o>r?s=O.sign(t.y):s=O.sign(n.y);let a=s<0;G_(e,a),G_(t,a),G_(n,a)}var LJ=new d;function Zu(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,LJ),e.y/(e.y-t.y),LJ),n),d.clone(n,i),G_(n,!0),G_(i,!1)}var F0=new d,B0=new d,k0=new d,U0=new d,m6={positions:new Array(7),indices:new Array(3*3)};function oPe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;iPe(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=m6.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Zu(e,t,F0,k0),Zu(e,n,B0,U0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Zu(t,n,F0,k0),Zu(t,e,B0,U0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Zu(n,e,F0,k0),Zu(n,t,B0,U0),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||(Zu(n,e,F0,k0),Zu(n,t,B0,U0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Zu(t,n,F0,k0),Zu(t,e,B0,U0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Zu(e,t,F0,k0),Zu(e,n,B0,U0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let l=m6.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(s===1||s===2)&&(l[3]=F0,l[4]=B0,l[5]=k0,l[6]=U0,l.length=7),m6}function NJ(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){let r=n[o];r.values=$.createTypedArray(r.componentDatatype,r.values)}let i=ct.computeNumberOfVertices(e);return e.indices=Fe.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function DT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ct({attributes:n,indices:[],primitiveType:e.primitiveType})}function y6(e,t,n){let i=c(e.geometry.boundingSphere);t=NJ(t,i),n=NJ(n,i),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function b6(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,l,u,f,h,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,o);e.multiplyByScalar(g,l.x,g),e.multiplyByScalar(m,l.y,m),e.multiplyByScalar(y,l.z,y);let b=e.add(g,m,g);e.add(b,y,b),p&&e.normalize(b,b),e.pack(b,f,h*t)}}var rPe=b6(se,4),x1=b6(d,3),zJ=b6(z,2),sPe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,l=o[t]*i.y,u=o[n]*i.z;r[s]=a+l+u>O.EPSILON6?1:0},sw=new d,p6=new d,_6=new d,aPe=new d;function y1(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){if(!c(r)&&!c(s)&&!c(a)&&!c(l)&&!c(u)&&g===0)return;let b=d.fromArray(o,e*3,sw),x=d.fromArray(o,t*3,p6),A=d.fromArray(o,n*3,_6),E=CT(i,b,x,A,aPe);if(c(E)){if(c(r)&&x1(e,t,n,E,r,h.normal.values,y,!0),c(u)){let S=d.fromArray(u,e*3,sw),v=d.fromArray(u,t*3,p6),P=d.fromArray(u,n*3,_6);d.multiplyByScalar(S,E.x,S),d.multiplyByScalar(v,E.y,v),d.multiplyByScalar(P,E.z,P);let M;!d.equals(S,d.ZERO)||!d.equals(v,d.ZERO)||!d.equals(P,d.ZERO)?(M=d.add(S,v,S),d.add(M,P,M),d.normalize(M,M)):(M=sw,M.x=0,M.y=0,M.z=0),d.pack(M,h.extrudeDirection.values,y*3)}if(c(f)&&sPe(e,t,n,E,f,h.applyOffset.values,y),c(s)&&x1(e,t,n,E,s,h.tangent.values,y,!0),c(a)&&x1(e,t,n,E,a,h.bitangent.values,y,!0),c(l)&&zJ(e,t,n,E,l,h.st.values,y),g>0)for(let S=0;S<g;S++){let v=p[S];cPe(e,t,n,E,y,m[v],h[v])}}}function cPe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,l=r.values,u=s.values;switch(a){case 4:rPe(e,t,n,i,l,u,o,!1);break;case 3:x1(e,t,n,i,l,u,o,!1);break;case 2:zJ(e,t,n,i,l,u,o,!1);break;default:u[o]=l[e]*i.x+l[t]*i.y+l[n]*i.z}}function Ih(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],l=n[a];return l===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(l),l)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var lPe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function FJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.normal)?n.normal.values:void 0,r=c(n.bitangent)?n.bitangent.values:void 0,s=c(n.tangent)?n.tangent.values:void 0,a=c(n.st)?n.st.values:void 0,l=c(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=c(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let M in n)n.hasOwnProperty(M)&&!lPe[M]&&c(n[M])&&h.push(M);let p=h.length,g=DT(t),m=DT(t),y,b,x,A,E,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,E=0;E<S.length;++E)S[E]=-1,v[E]=-1;let P=f.length;for(E=0;E<P;E+=3){let M=f[E],R=f[E+1],L=f[E+2],B=d.fromArray(i,M*3),_=d.fromArray(i,R*3),w=d.fromArray(i,L*3),D=oPe(B,_,w);if(c(D)&&D.positions.length>3){let I=D.positions,N=D.indices,k=N.length;for(let H=0;H<k;++H){let V=N[H],j=I[V];j.y<0?(y=m.attributes,b=m.indices,x=S):(y=g.attributes,b=g.indices,x=v),A=Ih(y,b,x,f,V<3?E+V:-1,j),y1(M,R,L,j,i,o,s,r,a,l,u,y,h,p,n,A)}}else c(D)&&(B=D.positions[0],_=D.positions[1],w=D.positions[2]),B.y<0?(y=m.attributes,b=m.indices,x=S):(y=g.attributes,b=g.indices,x=v),A=Ih(y,b,x,f,E,B),y1(M,R,L,B,i,o,s,r,a,l,u,y,h,p,n,A),A=Ih(y,b,x,f,E+1,_),y1(M,R,L,_,i,o,s,r,a,l,u,y,h,p,n,A),A=Ih(y,b,x,f,E+2,w),y1(M,R,L,w,i,o,s,r,a,l,u,y,h,p,n,A)}y6(e,m,g)}var HJ=sn.fromPointNormal(d.ZERO,d.UNIT_Y),uPe=new d,fPe=new d;function vT(e,t,n,i,o,r,s){if(!c(s))return;let a=d.fromArray(i,e*3,sw);d.equalsEpsilon(a,n,O.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function BJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=DT(t),a=DT(t),l,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,l=0;l<f.length;++l)f[l]=-1,h[l]=-1;for(l=0;l<u;l+=2){let p=r[l],g=r[l+1],m=d.fromArray(i,p*3,sw),y=d.fromArray(i,g*3,p6),b;Math.abs(m.y)<O.EPSILON6&&(m.y<0?m.y=-O.EPSILON6:m.y=O.EPSILON6),Math.abs(y.y)<O.EPSILON6&&(y.y<0?y.y=-O.EPSILON6:y.y=O.EPSILON6);let x=s.attributes,A=s.indices,E=h,S=a.attributes,v=a.indices,P=f,M=Qn.lineSegmentPlane(m,y,HJ,_6);if(c(M)){let R=d.multiplyByScalar(d.UNIT_Y,5*O.EPSILON9,uPe);m.y<0&&(d.negate(R,R),x=a.attributes,A=a.indices,E=f,S=s.attributes,v=s.indices,P=h);let L=d.add(M,R,fPe);b=Ih(x,A,E,r,l,m),vT(p,g,m,i,b,x,o),b=Ih(x,A,E,r,-1,L),vT(p,g,L,i,b,x,o),d.negate(R,R),d.add(M,R,L),b=Ih(S,v,P,r,-1,L),vT(p,g,L,i,b,S,o),b=Ih(S,v,P,r,l+1,y),vT(p,g,y,i,b,S,o)}else{let R,L,B;m.y<0?(R=a.attributes,L=a.indices,B=f):(R=s.attributes,L=s.indices,B=h),b=Ih(R,L,B,r,l,m),vT(p,g,m,i,b,R,o),b=Ih(R,L,B,r,l+1,y),vT(p,g,y,i,b,R,o)}}y6(e,a,s)}var kJ=new z,dPe=new z,GJ=new d,jJ=new d,g6=new d,hPe=new d,mPe=new d,pPe=new d,UJ=new se;function VJ(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=d.unpack(n,s,GJ);if(a.x>0)continue;let l=d.unpack(i,s,jJ);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):d.pack(a,i,s));let u=d.unpack(o,s,g6);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):d.pack(a,o,s))}}var _Pe=5*O.EPSILON9,b1=O.EPSILON6;function gPe(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=c(n.st)?n.st.values:void 0,l=c(n.color)?n.color.values:void 0,u=DT(t),f=DT(t),h,p,g,m=!1,y=i.length/3;for(h=0;h<y;h+=4){let b=h,x=h+2,A=d.fromArray(i,b*3,GJ),E=d.fromArray(i,x*3,jJ);if(Math.abs(A.y)<b1)for(A.y=b1*(E.y<0?-1:1),i[h*3+1]=A.y,i[(h+1)*3+1]=A.y,p=b*3;p<b*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(E.y)<b1)for(E.y=b1*(A.y<0?-1:1),i[(h+2)*3+1]=E.y,i[(h+3)*3+1]=E.y,p=b*3;p<b*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 S=u.attributes,v=u.indices,P=f.attributes,M=f.indices,R=Qn.lineSegmentPlane(A,E,HJ,hPe);if(c(R)){m=!0;let L=d.multiplyByScalar(d.UNIT_Y,_Pe,mPe);A.y<0&&(d.negate(L,L),S=f.attributes,v=f.indices,P=u.attributes,M=u.indices);let B=d.add(R,L,pPe);S.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.position.values.push(B.x,B.y,B.z),S.position.values.push(B.x,B.y,B.z),S.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),S.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.nextPosition.values.push(B.x,B.y,B.z),S.nextPosition.values.push(B.x,B.y,B.z),S.nextPosition.values.push(B.x,B.y,B.z),S.nextPosition.values.push(B.x,B.y,B.z),d.negate(L,L),d.add(R,L,B),P.position.values.push(B.x,B.y,B.z),P.position.values.push(B.x,B.y,B.z),P.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),P.prevPosition.values.push(B.x,B.y,B.z),P.prevPosition.values.push(B.x,B.y,B.z),P.prevPosition.values.push(B.x,B.y,B.z),P.prevPosition.values.push(B.x,B.y,B.z),P.nextPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),P.nextPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),P.nextPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]);let _=z.fromArray(s,b*2,kJ),w=Math.abs(_.y);S.expandAndWidth.values.push(-1,w,1,w),S.expandAndWidth.values.push(-1,-w,1,-w),P.expandAndWidth.values.push(-1,w,1,w),P.expandAndWidth.values.push(-1,-w,1,-w);let D=d.magnitudeSquared(d.subtract(R,A,g6));if(D/=d.magnitudeSquared(d.subtract(E,A,g6)),c(l)){let I=se.fromArray(l,b*4,UJ),N=se.fromArray(l,x*4,UJ),k=O.lerp(I.x,N.x,D),H=O.lerp(I.y,N.y,D),V=O.lerp(I.z,N.z,D),j=O.lerp(I.w,N.w,D);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(l[p]);for(S.color.values.push(k,H,V,j),S.color.values.push(k,H,V,j),P.color.values.push(k,H,V,j),P.color.values.push(k,H,V,j),p=x*4;p<x*4+2*4;++p)P.color.values.push(l[p])}if(c(a)){let I=z.fromArray(a,b*2,kJ),N=z.fromArray(a,(h+3)*2,dPe),k=O.lerp(I.x,N.x,D);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(k,I.y),S.st.values.push(k,N.y),P.st.values.push(k,I.y),P.st.values.push(k,N.y),p=x*2;p<x*2+2*2;++p)P.st.values.push(a[p])}g=S.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=P.position.values.length/3-4,M.push(g,g+2,g+1),M.push(g+1,g+2,g+3)}else{let L,B;for(A.y<0?(L=f.attributes,B=f.indices):(L=u.attributes,B=u.indices),L.position.values.push(A.x,A.y,A.z),L.position.values.push(A.x,A.y,A.z),L.position.values.push(E.x,E.y,E.z),L.position.values.push(E.x,E.y,E.z),p=h*3;p<h*3+4*3;++p)L.prevPosition.values.push(o[p]),L.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)L.expandAndWidth.values.push(s[p]),c(a)&&L.st.values.push(a[p]);if(c(l))for(p=h*4;p<h*4+4*4;++p)L.color.values.push(l[p]);g=L.position.values.length/3-4,B.push(g,g+2,g+1),B.push(g+1,g+2,g+3)}}m&&(VJ(f),VJ(u)),y6(e,f,u)}Ac.splitLongitude=function(e){if(!c(e))throw new C("instance is required.");let t=e.geometry,n=t.boundingSphere;if(c(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING))return e;if(t.geometryType!==ld.NONE)switch(t.geometryType){case ld.POLYLINES:gPe(e);break;case ld.TRIANGLES:FJ(e);break;case ld.LINES:BJ(e);break}else nPe(t),t.primitiveType===Me.TRIANGLES?FJ(e):t.primitiveType===Me.LINES&&BJ(e);return e};var Nn=Ac;function aw(e,t,n,i,o,r,s,a,l,u,f){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=l,this._flipY=u,this._initialized=f}Object.defineProperties(aw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});aw.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new C("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new C("yOffset + options.source.height must be less than or equal to height.");let{width:r,height:s}=i,a=this._context._gl,l=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,b=this._flipY,x=4;c(f)&&(x=ke.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,x),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){let E;t===0&&n===0&&r===h&&s===h?(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,h,h)),E=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),E=i),A=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),E=ke.createTypedArray(p,m,h,h)),a.texImage2D(u,0,g,h,h,0,p,Ue.toWebGLConstant(m,this._context),E),this._initialized=!0}A||(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ue.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ue.toWebGLConstant(m,this._context),i))),a.bindTexture(l,null)};aw.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+r>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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};aw.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){if(e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),e+n>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+i>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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 A1=aw;var C1={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===C1.DONT_CARE||e===C1.FASTEST||e===C1.NICEST}},hd=Object.freeze(C1);var E1={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};E1.validate=function(e){return e===E1.NEAREST||e===E1.LINEAR};var ui=Object.freeze(E1);var j_={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};j_.validate=function(e){return e===j_.NEAREST||e===j_.LINEAR||e===j_.NEAREST_MIPMAP_NEAREST||e===j_.LINEAR_MIPMAP_NEAREST||e===j_.NEAREST_MIPMAP_LINEAR||e===j_.LINEAR_MIPMAP_LINEAR};var Yt=Object.freeze(j_);var S1={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===S1.CLAMP_TO_EDGE||e===S1.REPEAT||e===S1.MIRRORED_REPEAT}},gn=Object.freeze(S1);function cw(e){e=e??W.EMPTY_OBJECT;let{wrapS:t=gn.CLAMP_TO_EDGE,wrapT:n=gn.CLAMP_TO_EDGE,minificationFilter:i=Yt.LINEAR,magnificationFilter:o=ui.LINEAR,maximumAnisotropy:r=1}=e;if(!gn.validate(t))throw new C("Invalid sampler.wrapS.");if(!gn.validate(n))throw new C("Invalid sampler.wrapT.");if(!Yt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!ui.validate(o))throw new C("Invalid sampler.magnificationFilter.");T.typeOf.number.greaterThanOrEquals("maximumAnisotropy",r,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(cw.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}}});cw.equals=function(e,t){return e===t||c(e)&&c(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};cw.NEAREST=Object.freeze(new cw({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST}));var Qt=cw;function yPe(e,t,n,i){let o=c(t.vertexBuffer),r=c(t.value),s=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!r)throw new C("attribute must have a vertexBuffer or a value.");if(o&&r)throw new C("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(s!==1&&s!==2&&s!==3&&s!==4)throw r?new C("attribute.value.length must be in the range [1, 4]."):new C("attribute.componentsPerAttribute must be in the range [1, 4].");if(c(t.componentDatatype)&&!$.validate(t.componentDatatype))throw new C("attribute must have a valid componentDatatype or not specify it.");if(c(t.strideInBytes)&&t.strideInBytes>255)throw new C("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new C("instanced arrays is not supported");if(c(t.instanceDivisor)&&t.instanceDivisor<0)throw new C("attribute must have an instanceDivisor greater than or equal to zero");if(c(t.instanceDivisor)&&r)throw new C("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new C("attribute zero cannot have an instanceDivisor greater than 0");let a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??$.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(l){let u=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(l){}}e.push(a)}function qJ(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}c(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function hp(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),T.defined("options.attributes",e.attributes);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,l=!1,u=!1,f=i.length;for(r=0;r<f;++r)yPe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let g=s[r];if(c(g.vertexBuffer)&&g.instanceDivisor===0){let m=g.strideInBytes||g.componentsPerAttribute*$.getSizeInBytes(g.componentDatatype);a=g.vertexBuffer.sizeInBytes/m;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(l=!0),c(s[r].value)&&(u=!0);let h={};for(r=0;r<f;++r){let g=s[r].index;if(h[g])throw new C(`Index ${g} is used by more than one attribute.`);h[g]=!0}let p;t.vertexArrayObject&&(p=t.glCreateVertexArray(),t.glBindVertexArray(p),qJ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=l,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=p,this._attributes=s,this._indexBuffer=o}function WJ(e){return e.values.length/e.componentsPerAttribute}function bPe(e){return $.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function xPe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)&&(o.push(n),e[n].componentDatatype===$.DOUBLE&&(e[n].componentDatatype=$.FLOAT,e[n].values=$.createTypedArray($.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=WJ(e[o[0]]),t=1;t<s;++t){let u=WJ(e[o[t]]);if(u!==r)throw new ae(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return $.getSizeInBytes(e[f].componentDatatype)-$.getSizeInBytes(e[u].componentDatatype)});let a=0,l={};for(t=0;t<s;++t)n=o[t],i=e[n],l[n]=a,a+=bPe(i);if(a>0){let u=$.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let m=$.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:$.createTypedArray(e[n].componentDatatype,p),index:l[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let y=i.values,b=g[n],x=b.pointer,A=i.componentsPerAttribute;for(let E=0;E<A;++E)x[b.index+E]=y[t*A+E];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:l,vertexSizeInBytes:a}}}hp.fromGeometry=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let t=e.context,n=e.geometry??W.EMPTY_OBJECT,i=e.bufferUsage??Be.DYNAMIC_DRAW,o=e.attributeLocations??W.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,l,u,f=c(s)?s:[],h=n.attributes;if(r){let m=xPe(h);if(c(m)){u=bt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&c(h[a])&&(l=h[a],c(l.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:y[a],strideInBytes:b}):f.push({index:o[a],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&c(h[a])){l=h[a];let m=l.componentDatatype;m===$.DOUBLE&&(m=$.FLOAT),u=void 0,c(l.values)&&(u=bt.createVertexBuffer({context:t,typedArray:$.createTypedArray(m,l.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:l.value,componentDatatype:m,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize})}let p,g=n.indices;return c(g)&&(ct.computeNumberOfVertices(n)>=O.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=bt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Fe.UNSIGNED_INT}):p=bt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Fe.UNSIGNED_SHORT})),new hp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(hp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});hp.prototype.getAttribute=function(e){return T.defined("index",e),this._attributes[e]};function TPe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=ut.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let l=o[s];if(l.enabled){let u=l.instanceDivisor,f=l.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function APe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&c(r.value)&&r.vertexAttrib(t)}}hp.prototype._bind=function(){c(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&TPe(this),this._hasConstantAttributes&&APe(this,this._gl)):qJ(this._gl,this._attributes,this._indexBuffer)};hp.prototype._unBind=function(){if(c(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)}};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;c(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return c(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),c(this._vao)&&this._context.glDeleteVertexArray(this._vao),de(this)};var ni=hp;function bo(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Qt}=e,l=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,{width:u,height:f}=e;if(c(n)){if(!Object.values(bo.FaceName).every(E=>c(n[E])))throw new C(`options.source requires faces ${Object.values(bo.FaceName).join(", ")}.`);({width:u,height:f}=n.positiveX);for(let E of bo.faceNames()){let S=n[E];if(Number(S.width)!==u||Number(S.height)!==f)throw new C("Each face in options.source must have the same width and height.")}}let h=u;if(!c(u)||!c(f))throw new C("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(u!==f)throw new C("Width must equal height.");if(h<=0)throw new C("Width and height must be greater than zero.");if(h>ut.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${ut.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ke.validate(i))throw new C("Invalid options.pixelFormat.");if(ke.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Ue.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let p=ke.textureSizeInBytes(i,o,h,h)*6,g=ke.toInternalFormat(i,o,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=l,this._flipY=r;let x=c(n);function A(E){return new A1(t,b,y,E,g,i,o,h,l,r,x)}this._positiveX=A(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=A(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=A(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=A(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,YJ(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let E of bo.faceNames())x6(this[E],n?.[E],0);m.bindTexture(y,null)}bo.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,i??0),r._unBind(),r.destroy()};bo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*CPe(){yield bo.FaceName.POSITIVEX,yield bo.FaceName.NEGATIVEX,yield bo.FaceName.POSITIVEY,yield bo.FaceName.NEGATIVEY,yield bo.FaceName.POSITIVEZ,yield bo.FaceName.NEGATIVEZ}bo.faceNames=function(){return CPe()};function x6(e,t,n){n=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,l=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!c(t)){h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;c(p)&&(g=ke.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),c(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),l&&(p=ke.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,l),h.texImage2D(i,n,a,r,Ue.toWebGLConstant(s,f),t))}bo.loadFace=x6;Object.defineProperties(bo.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){YJ(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}}});bo.getDirection=function(e,t){switch(e){case bo.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case bo.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case bo.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case bo.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case bo.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case bo.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function YJ(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ue.FLOAT&&!r.textureFloatLinear||s===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=ui.NEAREST);let a=r._gl,l=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,e._texture),a.texParameteri(l,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(l,a.TEXTURE_MAG_FILTER,i),a.texParameteri(l,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(l,a.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&a.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(l,null)}bo.prototype.loadMipmaps=function(e,t){if(T.defined("source",e),!Array.isArray(e))throw new C("source must be an array");let n=Math.log2(this._size);if(e.length!==n)throw new C("all mip levels must be defined");t=t??!1;let i=this._context._gl,o=this._texture,r=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(r,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let s=0;s<e.length;s++){let a=e[s],l=s+1;for(let u of bo.faceNames())x6(this[u],a[u],l)}i.bindTexture(r,null),this._hasMipmap=!0};bo.prototype.generateMipmap=function(e){if(e=e??hd.DONT_CARE,this._size>1&&!O.isPowerOfTwo(this._size))throw new C("width and height must be a power of two to call generateMipmap().");if(!hd.validate(e))throw new C("hint is invalid.");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)};bo.createVertexArray=function(e){let t=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return ni.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Be.STATIC_DRAW})};bo.prototype.isDestroyed=function(){return!1};bo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=de(this._positiveX),this._negativeX=de(this._negativeX),this._positiveY=de(this._positiveY),this._negativeY=de(this._negativeY),this._positiveZ=de(this._positiveZ),this._negativeZ=de(this._negativeZ),de(this)};var Go=bo;function EPe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Cc=EPe;var w1=`const float czm_degreesPerRadian = 57.29577951308232; -`;var v1=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var D1=`const float czm_epsilon1 = 0.1; -`;var P1=`const float czm_epsilon2 = 0.01; -`;var I1=`const float czm_epsilon3 = 0.001; -`;var O1=`const float czm_epsilon4 = 0.0001; -`;var R1=`const float czm_epsilon5 = 0.00001; -`;var M1=`const float czm_epsilon6 = 0.000001; -`;var L1=`const float czm_epsilon7 = 0.0000001; -`;var N1=`const float czm_infinity = 5906376272000.0; -`;var F1=`const float czm_oneOverPi = 0.3183098861837907; -`;var B1=`const float czm_oneOverTwoPi = 0.15915494309189535; -`;var k1=`const float czm_passCesium3DTile = 4.0; -`;var U1=`const float czm_passCesium3DTileClassification = 5.0; -`;var V1=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; -`;var z1=`const float czm_passClassification = 7.0; -`;var H1=`const float czm_passCompute = 1.0; -`;var G1=`const float czm_passEnvironment = 0.0; -`;var j1=`const float czm_passGlobe = 2.0; -`;var W1=`const float czm_passOpaque = 7.0; -`;var q1=`const float czm_passOverlay = 10.0; -`;var Y1=`const float czm_passTerrainClassification = 3.0; -`;var X1=`const float czm_passTranslucent = 8.0; -`;var K1=`const float czm_passVoxels = 9.0; -`;var $1=`const float czm_pi = 3.141592653589793; -`;var Z1=`const float czm_piOverFour = 0.7853981633974483; -`;var Q1=`const float czm_piOverSix = 0.5235987755982988; -`;var J1=`const float czm_piOverThree = 1.0471975511965976; -`;var eR=`const float czm_piOverTwo = 1.5707963267948966; -`;var tR=`const float czm_radiansPerDegree = 0.017453292519943295; -`;var nR=`const float czm_sceneMode2D = 2.0; -`;var iR=`const float czm_sceneMode3D = 3.0; -`;var oR=`const float czm_sceneModeColumbusView = 1.0; -`;var rR=`const float czm_sceneModeMorphing = 0.0; -`;var sR=`const float czm_solarRadius = 695500000.0; -`;var aR=`const float czm_threePiOver2 = 4.71238898038469; -`;var cR=`const float czm_twoPi = 6.283185307179586; -`;var lR=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var uR=`struct czm_depthRangeStruct + `;return o=_Y(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${qa._workerModulePrefix+i}.js`)),!dn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function Hze(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!dn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function qa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var Gze=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let s=o.error;s.name==="RuntimeError"?(s=new oe(o.error.message),s.stack=o.error.stack):s.name==="DeveloperError"?(s=new pe(o.error.message),s.stack=o.error.stack):s.name==="Error"&&(s=new Error(o.error.message),s.stack=o.error.stack),yY.raiseEvent(s),i(s)}else yY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},Wze=[];async function qze(e,t,n){let i=await Promise.resolve(xle());l(n)?i||(n.length=0):n=Wze;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",Gze(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function Yze(e,t,n){++e._activeTasks;try{let i=await qze(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}qa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=AY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Yze(this,e,t)};qa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=AY(this._workerPath),i=await Hze(this,e),r=await Promise.resolve(xle()),o,s=i.wasmBinary;l(s)&&r&&(o=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};qa.prototype.isDestroyed=function(){return!1};qa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};qa.taskCompletedEvent=yY;qa._defaultWorkerModulePrefix="Workers/";qa._workerModulePrefix=qa._defaultWorkerModulePrefix;qa._canTransferArrayBuffer=void 0;var $n=qa;function F0(){}F0._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);F0._readyPromise=void 0;function Xze(){let e=F0._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return F0._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});F0._readyPromise=e}F0.transcode=function(e,t){return l(F0._readyPromise)||Xze(),F0._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let s=n[o];for(let a=0;a<r.length;a++){let c=s[r[a]];s[r[a]]=new KN(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var $N=F0;var Tle;Ele.setKTX2SupportedFormats=function(e,t,n,i,r,o){Tle={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Ele(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return $N.transcode(n,Tle)})}var tf=Ele;function Kze(e,t){this.start=e??0,this.stop=t??0}var Gs=Kze;var JN=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],SY),r=h.clone(i,bY),o=h.clone(i,xY),s=h.clone(i,TY),a=h.clone(i,EY),c=h.clone(i,CY),u=h.clone(i,vY),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,L=i.y,_=i.z;O<r.x&&h.clone(i,r),O>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,Ya)),g=h.magnitudeSquared(h.subtract(c,o,Ya)),m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=wY;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,Ya)),E=Math.sqrt(T),v=IY;v.x=r.x,v.y=o.y,v.z=s.z;let S=PY;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,DY),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,Ya));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,Ya));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;x.x=(E*x.x+C*i.x)/_,x.y=(E*x.y+C*i.y)/_,x.z=(E*x.z+C*i.z)/_}}return E<R?(h.clone(x,n.center),n.radius=E):(h.clone(I,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Cle._ellipsoid=ee.default,n=n??Cle,ie.southwest(t,RY),RY.height=i,ie.northeast(t,OY),OY.height=r;let s=n.project(RY,Jze),a=n.project(OY,Zze),c=a.x-s.x,u=a.y-s.y,f=a.z-s.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=s.x+c*.5,d.y=s.y+u*.5,d.z=s.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??ee.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,Qze);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=SY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,bY),a=h.clone(o,xY),c=h.clone(o,TY),u=h.clone(o,EY),f=h.clone(o,CY),d=h.clone(o,vY),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,w=t[g+2]+n.z;o.x=_,o.y=C,o.z=w,_<s.x&&h.clone(o,s),_>u.x&&h.clone(o,u),C<a.y&&h.clone(o,a),C>f.y&&h.clone(o,f),w<c.z&&h.clone(o,c),w>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=h.magnitudeSquared(h.subtract(f,a,Ya)),A=h.magnitudeSquared(h.subtract(d,c,Ya)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=wY;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let v=h.magnitudeSquared(h.subtract(x,E,Ya)),S=Math.sqrt(v),I=IY;I.x=s.x,I.y=a.y,I.z=c.z;let R=PY;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,DY),L=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,O,Ya));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,Ya));if(C>v){let w=Math.sqrt(C);S=(S+w)*.5,v=S*S;let D=w-S;E.x=(S*E.x+D*o.x)/w,E.y=(S*E.y+D*o.y)/w,E.z=(S*E.z+D*o.z)/w}}return S<L?(h.clone(E,r.center),r.radius=S):(h.clone(O,r.center),r.radius=L),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=SY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,bY),s=h.clone(r,xY),a=h.clone(r,TY),c=h.clone(r,EY),u=h.clone(r,CY),f=h.clone(r,vY),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];r.x=L,r.y=_,r.z=C,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),C<a.z&&h.clone(r,a),C>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,Ya)),m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=h.magnitudeSquared(h.subtract(f,a,Ya)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=wY;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let E=h.magnitudeSquared(h.subtract(b,T,Ya)),v=Math.sqrt(E),S=IY;S.x=o.x,S.y=s.y,S.z=a.z;let I=PY;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,DY),O=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(r,R,Ya));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,Ya));if(_>E){let C=Math.sqrt(_);v=(v+C)*.5,E=v*v;let w=C-v;T.x=(v*T.x+w*r.x)/C,T.y=(v*T.y+w*r.y)/C,T.z=(v*T.z+w*r.z)/C}}return v<O?(h.clone(T,i.center),i.radius=v):(h.clone(R,i.center),i.radius=O),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let s=n.center,a=n.radius;for(o=0;o<i;o++){let c=t[o];a=Math.max(a,h.distance(s,c.center)+c.radius)}return n.radius=a,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,eVe),o=$.getColumn(i,1,tVe),s=$.getColumn(i,2,nVe);return h.add(r,o,r),h.add(r,s,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=M.getTranslation(t,iVe),r=M.getScale(t,rVe),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,s=n.center,a=n.radius,c=h.subtract(s,r,oVe),u=h.magnitude(c);if(o>=u+a)return t.clone(i),i;if(a>=u+o)return n.clone(i),i;let f=(o+u+a)*.5,d=h.multiplyByScalar(c,(-o+f)/u,sVe);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,aVe));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,s=h.dot(o,i)+n.distance;return s<-r?$t.OUTSIDE:s<r?$t.INTERSECTING:$t.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=M.multiplyByPoint(n,t.center,i.center),i.radius=M.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,cVe),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=M.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Gs);let o=h.subtract(t.center,n,lVe),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){Sle._ellipsoid=ee.default,n=n??Sle;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,vle):a=r.geodeticSurfaceNormal(o,vle);let c=h.cross(h.UNIT_Z,a,uVe);h.normalize(c,c);let u=h.cross(a,c,fVe);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,hVe),d=h.negate(c,dVe),p=wle,g=p[0];h.add(a,u,g),h.add(g,c,g),g=p[1],h.add(a,u,g),h.add(g,d,g),g=p[2],h.add(a,f,g),h.add(g,d,g),g=p[3],h.add(a,f,g),h.add(g,c,g),h.negate(a,a),g=p[4],h.add(a,u,g),h.add(g,c,g),g=p[5],h.add(a,u,g),h.add(g,d,g),g=p[6],h.add(a,f,g),h.add(g,d,g),g=p[7],h.add(a,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let E=r.cartesianToCartographic(T,mVe);n.project(E,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return $ze*t*t*t}};JN.packedLength=4;var bY=new h,xY=new h,TY=new h,EY=new h,CY=new h,vY=new h,SY=new h,Ya=new h,wY=new h,IY=new h,PY=new h,DY=new h,$ze=4/3*P.PI,Cle=new ji,Jze=new h,Zze=new h,RY=new he,OY=new he,Qze=[],eVe=new h,tVe=new h,nVe=new h,iVe=new h,rVe=new h,oVe=new h,sVe=new h,aVe=new h,cVe=new h,lVe=new h,vle=new h,uVe=new h,fVe=new h,dVe=new h,hVe=new h,mVe=new he,wle=new Array(8);for(let e=0;e<8;++e)wle[e]=new h;var Sle=new ji,le=JN;function pVe(e){e=e??H.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 En=pVe;var Ile={NONE:0,TOP:1,ALL:2};Object.freeze(Ile);var pn=Ile;function Ws(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}Ws.POSITION_ONLY=Object.freeze(new Ws({position:!0}));Ws.POSITION_AND_NORMAL=Object.freeze(new Ws({position:!0,normal:!0}));Ws.POSITION_NORMAL_AND_ST=Object.freeze(new Ws({position:!0,normal:!0,st:!0}));Ws.POSITION_AND_ST=Object.freeze(new Ws({position:!0,st:!0}));Ws.POSITION_AND_COLOR=Object.freeze(new Ws({position:!0,color:!0}));Ws.ALL=Object.freeze(new Ws({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Ws.DEFAULT=Ws.POSITION_NORMAL_AND_ST;Ws.packedLength=6;Ws.pack=function(e,t,n){return n=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};Ws.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ws),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};Ws.clone=function(e,t){if(l(e))return l(t)||(t=new Ws),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 Be=Ws;var gVe=new h;function nf(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}nf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new nf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};nf.fromAxisAlignedBoundingBox=function(e){return new nf({minimum:e.minimum,maximum:e.maximum})};nf.packedLength=2*h.packedLength+Be.packedLength+1;nf.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var Dle=new h,Rle=new h,Ole=new Be,Ple={minimum:Dle,maximum:Rle,vertexFormat:Ole,offsetAttribute:void 0};nf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Dle),r=h.unpack(e,t+h.packedLength,Rle),o=Be.unpack(e,t+2*h.packedLength,Ole),s=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Ple.offsetAttribute=s===-1?void 0:s,new nf(Ple))};nf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new En,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),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,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else s=new Float64Array(24),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,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,gVe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===pn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new wt({attributes:r,indices:o,primitiveType:Oe.TRIANGLES,boundingSphere:new le(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var MY;nf.getUnitBox=function(){return l(MY)||(MY=nf.createGeometry(nf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),MY};var zc=nf;var Ar={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ar.getMathType=function(e){switch(e){case Ar.SCALAR:return Number;case Ar.VEC2:return U;case Ar.VEC3:return h;case Ar.VEC4:return se;case Ar.MAT2:return $i;case Ar.MAT3:return $;case Ar.MAT4:return M}};Ar.getNumberOfComponents=function(e){switch(e){case Ar.SCALAR:return 1;case Ar.VEC2:return 2;case Ar.VEC3:return 3;case Ar.VEC4:case Ar.MAT2:return 4;case Ar.MAT3:return 9;case Ar.MAT4:return 16}};Ar.getAttributeLocationCount=function(e){switch(e){case Ar.SCALAR:case Ar.VEC2:case Ar.VEC3:case Ar.VEC4:return 1;case Ar.MAT2:return 2;case Ar.MAT3:return 3;case Ar.MAT4:return 4}};Ar.getGlslType=function(e){switch(e){case Ar.SCALAR:return"float";case Ar.VEC2:return"vec2";case Ar.VEC3:return"vec3";case Ar.VEC4:return"vec4";case Ar.MAT2:return"mat2";case Ar.MAT3:return"mat3";case Ar.MAT4:return"mat4"}};Object.freeze(Ar);var Vt=Ar;var Mle=1/256,_Ve=65536,LY=256,Dr={};Dr.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,r=n.y;n.x=(1-Math.abs(r))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(r)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};Dr.octEncode=function(e,t){return Dr.octEncodeInRange(e,255,t)};var WI=new U,Nle=new Uint8Array(1);function ZN(e){return Nle[0]=e,Nle[0]}Dr.octEncodeToCartesian4=function(e,t){return Dr.octEncodeInRange(e,65535,WI),t.x=ZN(WI.x*Mle),t.y=ZN(WI.x),t.z=ZN(WI.y*Mle),t.w=ZN(WI.y),t};Dr.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(r),i.y=(1-Math.abs(r))*P.signNotZero(i.y)}return h.normalize(i,i)};Dr.octDecode=function(e,t,n){return Dr.octDecodeInRange(e,t,255,n)};Dr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*LY+i,a=r*LY+o;return Dr.octDecodeInRange(s,a,65535,t)};Dr.octPackFloat=function(e){return 256*e.x+e.y};var FY=new U;Dr.octEncodeFloat=function(e){return Dr.octEncode(e,FY),Dr.octPackFloat(FY)};Dr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Dr.octDecode(i,r,t)};Dr.octPack=function(e,t,n,i){let r=Dr.octEncodeFloat(e),o=Dr.octEncodeFloat(t),s=Dr.octEncode(n,FY);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Dr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Dr.octDecodeFloat(s,t),Dr.octDecodeFloat(c,n),Dr.octDecode(o,a,i)};Dr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Dr.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 NY(e){return e>>1^-(e&1)}Dr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=NY(e[a]),o+=NY(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=NY(n[a]),n[a]=s)};Dr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Dr.encodeRGB8=function(e){return Math.round(P.clamp(e.red*255,0,255))*_Ve+Math.round(P.clamp(e.green*255,0,255))*LY+Math.round(P.clamp(e.blue*255,0,255))};Dr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};Dr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var cn=Dr;var Lle=new h,Fle=new h,Ble=new h;function yVe(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,Lle),s=h.subtract(i,t,Fle),a=h.subtract(e,t,Ble),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(U.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,r);if(U.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,r);if(U.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,r);o=U.subtract(n,t,Lle),s=U.subtract(i,t,Fle),a=U.subtract(e,t,Ble),c=U.dot(o,o),u=U.dot(o,s),f=U.dot(o,a),d=U.dot(s,s),p=U.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var NE=yVe;function Wm(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Wm.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 B0={high:0,low:0};Wm.fromCartesian=function(e,t){l(t)||(t=new Wm);let n=t.high,i=t.low;return Wm.encode(e.x,B0),n.x=B0.high,i.x=B0.low,Wm.encode(e.y,B0),n.y=B0.high,i.y=B0.low,Wm.encode(e.z,B0),n.z=B0.high,i.z=B0.low,t};var BY=new Wm;Wm.writeElements=function(e,t,n){Wm.fromCartesian(e,BY);let i=BY.high,r=BY.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=Wm;var kY={};kY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function kle(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}kY.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),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=kle(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*kle(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var au=kY;var zY={};zY.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function UY(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,y=4*p*m-g*g,A,b;if(y<0){let G,q,Q;f*u>=c*d?(G=r,q=p,Q=-2*o*p+r*g):(G=a,q=m,Q=-a*g+2*s*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ae=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ae:-q/ae;return A=q<=0?ae+Ae:-Q/(ae*ae+Ae*Ae+q),f*u>=c*d?[(A-o)/r]:[-a/(A+s)]}let x=p,T=-2*o*p+r*g,E=m,v=-a*g+2*s*m,S=Math.sqrt(y),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*S,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let L=A*(-O/2-I*Math.sin(R)),_=b+L>2*o?b-o:L-o,C=r,w=_/C;R=Math.abs(Math.atan2(a*S,-v)/3),A=2*Math.sqrt(-E),O=Math.cos(R),b=A*O,L=A*(-O/2-I*Math.sin(R));let D=-a,N=b+L<2*s?b+s:L+s,F=D/N,V=C*N,B=-_*N-C*D,j=_*D,k=(s*B-o*j)/(-o*B+s*V);return w<=k?w<=F?k<=F?[w,k,F]:[w,F,k]:[F,w,k]:w<=F?[k,w,F]:k<=F?[k,F,w]:[F,k,w]}zY.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return au.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=au.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return UY(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):UY(e,t,0,i);if(i===0)return r=au.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return UY(e,t,n,i)};var LE=zY;var VY={};VY.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function ph(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=LE.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=au.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=au.computeRealRoots(1,d,p),y=au.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function qI(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=LE.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=s-4*d,T=s+4*Math.abs(d),E,v;if(d<0||A*T<x*b){let C=Math.sqrt(x);E=C/2,v=C===0?0:(e*y-n)/C}else{let C=Math.sqrt(A);E=C===0?0:(e*y-n)/C,v=C/2}let S,I;m===0&&E===0?(S=0,I=0):P.sign(m)===P.sign(E)?(S=m+E,I=d/S):(I=m-E,S=d/I);let R,O;y===0&&v===0?(R=0,O=0):P.sign(y)===P.sign(v)?(R=y+v,O=i/R):(O=y-v,R=i/O);let L=au.computeRealRoots(1,S,R),_=au.computeRealRoots(1,I,O);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}VY.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return LE.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return ph(o,s,a,c);case 1:return qI(o,s,a,c);case 2:return qI(o,s,a,c);case 3:return ph(o,s,a,c);case 4:return ph(o,s,a,c);case 5:return qI(o,s,a,c);case 6:return ph(o,s,a,c);case 7:return ph(o,s,a,c);case 8:return qI(o,s,a,c);case 9:return ph(o,s,a,c);case 10:return ph(o,s,a,c);case 11:return qI(o,s,a,c);case 12:return ph(o,s,a,c);case 13:return ph(o,s,a,c);case 14:return ph(o,s,a,c);case 15:return ph(o,s,a,c);default:return}};var QN=VY;var jY=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},gn=jY;var Jr={};Jr.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var AVe=new h,bVe=new h,qle=new h,Ule=new h,zle=new h;Jr.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,AVe),c=h.subtract(i,t,bVe),u=h.cross(s,c,qle),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<P.EPSILON6||(d=h.subtract(o,t,Ule),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,zle),m=h.dot(s,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,Ule),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,zle),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};Jr.rayTriangle=function(e,t,n,i,r,o){let s=Jr.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var xVe=new gn;Jr.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=xVe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Jr.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function TVe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var EVe={root0:0,root1:0};function Yle(e,t,n){l(n)||(n=new Gs);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,qle),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=TVe(c,u,f,EVe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Jr.raySphere=function(e,t,n){if(n=Yle(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var CVe=new gn;Jr.lineSegmentSphere=function(e,t,n,i){let r=CVe;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=Yle(r,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 vVe=new h,SVe=new h;Jr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,vVe),r=h.multiplyComponents(n,e.direction,SVe),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Gs(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Gs(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Gs(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Gs(0,-s/c)};var wVe=new Gs,IVe=new Gs,PVe=new Gs;Jr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Gs);let i=HY(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,wVe),r=HY(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,IVe),o=HY(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,PVe);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function HY(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function xb(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Jr.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*xb(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*xb(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),d=r*(i*xb(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=au.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,y=f*f,A=a*a,b=d*f,x=A+y,T=2*(c*a+b),E=2*u*a+c*c-y+m,v=2*(u*c-b),S=u*u-m;if(x===0&&T===0&&E===0&&v===0)return g;p=QN.computeRealRoots(x,T,E,v,S);let I=p.length;if(I===0)return g;for(let R=0;R<I;++R){let O=p[R],L=O*O,_=Math.max(1-L,0),C=Math.sqrt(_),w;P.sign(a)===P.sign(u)?w=xb(a*L+u,c*O,P.EPSILON12):P.sign(u)===P.sign(c*O)?w=xb(a*L,c*O+u,P.EPSILON12):w=xb(a*L+c*O,u,P.EPSILON12);let D=xb(f*O,d,P.EPSILON15),N=w*D;N<0?g.push(new h(i,r*O,r*C)):N>0?g.push(new h(i,r*O,r*-C)):C!==0?(g.push(new h(i,r*O,r*-C)),g.push(new h(i,r*O,r*C)),++R):g.push(new h(i,r*O,r*C))}return g};var GY=new h,Vle=new h,jle=new h,eL=new h,DVe=new h,RVe=new $,OVe=new $,MVe=new $,NVe=new $,LVe=new $,Hle=new $,Gle=new $,Wle=new h,FVe=new h,BVe=new he;Jr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,GY);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,GY),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,eL),c=h.normalize(h.cross(a,s,Vle),Vle),u=h.normalize(h.cross(s,c,jle),jle),f=RVe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,OVe),p=$.fromScale(t.radii,MVe),g=$.fromScale(t.oneOverRadii,NVe),m=LVe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=$.multiply($.multiply(d,g,Hle),m,Hle),A=$.multiply($.multiply(y,p,Gle),f,Gle),b=$.multiplyByVector(y,n,DVe),x=Jr.quadraticVectorExpression(A,h.negate(b,GY),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,FVe),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],Wle),Wle);let L=h.normalize(h.subtract(T,n,eL),eL),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,BVe);return I=P.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,eL))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var kVe=new h;Jr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,kVe),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<P.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};Jr.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Jr.lineSegmentPlane(e,t,i,f),Jr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Jr.lineSegmentPlane(t,n,i,f),Jr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Jr.lineSegmentPlane(n,e,i,f),Jr.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Jr.lineSegmentPlane(e,n,i,f),Jr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Jr.lineSegmentPlane(n,t,i,f),Jr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Jr.lineSegmentPlane(t,e,i,f),Jr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var bi=Jr;function va(e,t){this.normal=h.clone(e),this.distance=t}va.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new va(t,i)};var UVe=new h;va.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,UVe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new va(n,i)};va.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var zVe=new h;va.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=va.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,zVe);return h.subtract(t,r,n)};var VVe=new M,jVe=new se,HVe=new h;va.transform=function(e,t,n){let i=e.normal,r=e.distance,o=M.inverseTranspose(t,VVe),s=se.fromElements(i.x,i.y,i.z,r,jVe);s=M.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,HVe);return s=se.divideByScalar(s,h.magnitude(a),s),va.fromCartesian4(s,n)};va.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new va(e.normal,e.distance)};va.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};va.ORIGIN_XY_PLANE=Object.freeze(new va(h.UNIT_Z,0));va.ORIGIN_YZ_PLANE=Object.freeze(new va(h.UNIT_X,0));va.ORIGIN_ZX_PLANE=Object.freeze(new va(h.UNIT_Y,0));var sn=va;var WY={};WY.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};WY.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,C,w,D){for(;C.length>=1;){let N=C[C.length-1];if(C.splice(C.length-1,1),_[N].numLiveTriangles>0)return N}for(;r<D;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,C,w,D,N,F,V){let B=-1,j,k=-1,G=0;for(;G<w.length;){let q=w[G];D[q].numLiveTriangles&&(j=0,N-D[q].timeStamp+2*D[q].numLiveTriangles<=C&&(j=N-D[q].timeStamp),(j>k||k===-1)&&(k=j,B=q)),++G}return B===-1?o(D,F,_,V):B}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,E,v=0,S=[],I=a/3,R=[];for(g=0;g<I;g++)R[g]=!1;let O,L;for(;y!==-1;){b=[],E=p[y],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let C=0;C<3;++C)O=t[u],b.push(O),x.push(O),S[v]=O,++v,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=s(t,i,b,p,A,x,c)}return S};var tL=WY;var Cl={};function cL(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function GVe(e){let t=e.length,n=t/3*6,i=je.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)cL(i,r,e[o],e[o+1],e[o+2]);return i}function WVe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);cL(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)cL(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function qVe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=je.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)cL(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Cl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=GVe(t);break;case Oe.TRIANGLE_STRIP:e.indices=WVe(t);break;case Oe.TRIANGLE_FAN:e.indices=qVe(t);break}e.primitiveType=Oe.LINES}return e};Cl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new le(u.center,u.radius+n)),new wt({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};Cl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};Cl.reorderForPreVertexCache=function(e){let t=wt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=je.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};Cl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Oe.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=tL.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function Xle(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 Ne({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function YVe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}Cl.fitToUnsignedShortIndices=function(e){let t=[],n=wt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=Xle(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Oe.TRIANGLES?u=3:e.primitiveType===Oe.LINES?u=2:e.primitiveType===Oe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,YVe(s,e.attributes,p)),r.push(g)}o+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new wt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=Xle(e.attributes))}r.length!==0&&t.push(new wt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Kle=new h,XVe=new he;Cl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new ji;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,Kle),p=s.cartesianToCartographic(d,XVe),g=r.project(p,Kle);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var qY={high:0,low:0};Cl.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Sn.encode(o[f],qY),a[f]=qY.high,c[f]=qY.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var _h=new h;function YY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,_h),M.multiplyByPoint(e,_h,_h),h.pack(_h,n,r)}}function XY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,_h),$.multiplyByVector(e,_h,_h),_h=h.normalize(_h,_h),h.pack(_h,n,r)}}var nL=new M,iL=new $;Cl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;YY(t,n.position),YY(t,n.prevPosition),YY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,nL),M.transpose(nL,nL),M.getMatrix3(nL,iL),XY(iL,n.normal),XY(iL,n.tangent),XY(iL,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function KVe(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ne({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Y.createTypedArray(s.componentDatatype,a)}))}return i}var $Ve=new h;function KY(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=KVe(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=wt.computeNumberOfVertices(new wt({attributes:f,primitiveType:Oe.POINTS})),E=je.createTypedArray(T,x),v=0,S=0;for(r=0;r<n;++r){let I=e[r][t].indices,R=I.length;for(s=0;s<R;++s)E[v++]=S+I[s];S+=wt.computeNumberOfVertices(e[r][t])}m=E}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,$Ve))+b.radius;x>A&&(A=x)}return new wt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new le(y,A):void 0})}Cl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(KY(t,"geometry")),n.length>0&&(r.push(KY(n,"westHemisphereGeometry")),r.push(KY(n,"eastHemisphereGeometry"))),r};var Qf=new h,YI=new h,FE=new h,BE=new h;Cl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;YI.x=i[b],YI.y=i[b+1],YI.z=i[b+2],FE.x=i[x],FE.y=i[x+1],FE.z=i[x+2],BE.x=i[T],BE.y=i[T+1],BE.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(FE,YI,FE),h.subtract(BE,YI,BE),a[f]=h.cross(FE,BE,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Qf),p.count>0){for(f=0;f<p.count;f++)h.add(Qf,a[c[p.indexOffset+f]],Qf);h.equalsEpsilon(h.ZERO,Qf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],Qf)}h.equalsEpsilon(h.ZERO,Qf,P.EPSILON10)&&(Qf.z=1),h.normalize(Qf,Qf),g[m]=Qf.x,g[m+1]=Qf.y,g[m+2]=Qf.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var JVe=new h,$le=new h,ZVe=new h;Cl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,E=b*2,v=i[f],S=i[f+1],I=i[f+2],R=o[x],O=o[x+1],L=o[T+1]-O,_=o[E+1]-O,C=1/((o[T]-R)*_-(o[E]-R)*L),w=(_*(i[d]-v)-L*(i[p]-v))*C,D=(_*(i[d+1]-S)-L*(i[p+1]-S))*C,N=(_*(i[d+2]-I)-L*(i[p+2]-I))*C;c[f]+=w,c[f+1]+=D,c[f+2]+=N,c[d]+=w,c[d+1]+=D,c[d+2]+=N,c[p]+=w,c[p+1]+=D,c[p+2]+=N}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,JVe),A=h.fromArray(c,f,ZVe),b=h.dot(y,A);h.multiplyByScalar(y,b,$le),h.normalize(h.subtract(A,$le,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var XI=new U,gh=new h,Jle=new h,Zle=new h,rL=new U;Cl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let S=t.values;i=S.length/3;let I=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(S,n*3,gh),h.equals(gh,h.ZERO)){R+=2;continue}rL=cn.octEncodeInRange(gh,65535,rL),I[R++]=rL.x,I[R++]=rL.y}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let x=i,T=a&&s?2:1;T+=f||d?1:0,x*=T;let E=new Float32Array(x),v=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,XI),E[v++]=cn.compressTextureCoordinates(XI));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,gh),h.fromArray(m,S,Jle),h.fromArray(y,S,Zle),cn.octPack(gh,Jle,Zle,XI),E[v++]=XI.x,E[v++]=XI.y):(s&&(h.fromArray(p,S,gh),E[v++]=cn.octEncodeFloat(gh)),f&&(h.fromArray(m,S,gh),E[v++]=cn.octEncodeFloat(gh)),d&&(h.fromArray(y,S,gh),E[v++]=cn.octEncodeFloat(gh)))}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function QVe(e){if(l(e.indices))return e;let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function e4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function t4e(e){let t=wt.computeNumberOfVertices(e),n=je.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 r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function n4e(e){if(l(e.indices))return e;let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function i4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Oe.LINES,e}function r4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Oe.LINES,e}function o4e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return e4e(e);case Oe.TRIANGLE_STRIP:return t4e(e);case Oe.TRIANGLES:return QVe(e);case Oe.LINE_STRIP:return i4e(e);case Oe.LINE_LOOP:return r4e(e);case Oe.LINES:return n4e(e)}return e}function P_(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function s4e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){P_(e,e.y<0),P_(t,t.y<0),P_(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=P.sign(e.y):s=P.sign(n.y):r>o?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;P_(e,a),P_(t,a),P_(n,a)}var Qle=new h;function ed(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Qle),e.y/(e.y-t.y),Qle),n),h.clone(n,i),P_(n,!0),P_(i,!1)}var Tb=new h,Eb=new h,Cb=new h,vb=new h,$Y={positions:new Array(7),indices:new Array(9)};function a4e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;s4e(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=$Y.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(ed(e,t,Tb,Cb),ed(e,n,Eb,vb),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(ed(t,n,Tb,Cb),ed(t,e,Eb,vb),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(ed(n,e,Tb,Cb),ed(n,t,Eb,vb),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?r?o||(ed(n,e,Tb,Cb),ed(n,t,Eb,vb),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(ed(t,n,Tb,Cb),ed(t,e,Eb,vb),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(ed(e,t,Tb,Cb),ed(e,n,Eb,vb),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=$Y.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Tb,c[4]=Eb,c[5]=Cb,c[6]=vb,c.length=7),$Y}function eue(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=wt.computeNumberOfVertices(e);return e.indices=je.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function UE(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ne({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new wt({attributes:n,indices:[],primitiveType:e.primitiveType})}function eX(e,t,n){let i=l(e.geometry.boundingSphere);t=eue(t,i),n=eue(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 tX(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var c4e=tX(se,4),aL=tX(h,3),sue=tX(U,2),l4e=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>P.EPSILON6?1:0},KI=new h,JY=new h,ZY=new h,u4e=new h;function oL(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,KI),b=h.fromArray(r,t*3,JY),x=h.fromArray(r,n*3,ZY),T=NE(i,A,b,x,u4e);if(l(T)){if(l(o)&&aL(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,KI),v=h.fromArray(u,t*3,JY),S=h.fromArray(u,n*3,ZY);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(v,T.y,v),h.multiplyByScalar(S,T.z,S);let I;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(S,h.ZERO)?(I=h.add(E,v,E),h.add(I,S,I),h.normalize(I,I)):(I=KI,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&l4e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&aL(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&aL(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&sue(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];f4e(e,t,n,T,y,m[v],d[v])}}}function f4e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:c4e(e,t,n,i,c,u,r,!1);break;case 3:aL(e,t,n,i,c,u,r,!1);break;case 2:sue(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function qm(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var d4e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function tue(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=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,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!d4e[I]&&l(n[I])&&d.push(I);let p=d.length,g=UE(t),m=UE(t),y,A,b,x,T,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,v[T]=-1;let S=f.length;for(T=0;T<S;T+=3){let I=f[T],R=f[T+1],O=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,R*3),C=h.fromArray(i,O*3),w=a4e(L,_,C);if(l(w)&&w.positions.length>3){let D=w.positions,N=w.indices,F=N.length;for(let V=0;V<F;++V){let B=N[V],j=D[B];j.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=qm(y,A,b,f,B<3?T+B:-1,j),oL(I,R,O,j,i,r,s,o,a,c,u,y,d,p,n,x)}}else l(w)&&(L=w.positions[0],_=w.positions[1],C=w.positions[2]),L.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=qm(y,A,b,f,T,L),oL(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+1,_),oL(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+2,C),oL(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}eX(e,m,g)}var aue=sn.fromPointNormal(h.ZERO,h.UNIT_Y),h4e=new h,m4e=new h;function kE(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,KI);h.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function nue(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=UE(t),a=UE(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,KI),y=h.fromArray(i,g*3,JY),A;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(y.y)<P.EPSILON6&&(y.y<0?y.y=-P.EPSILON6:y.y=P.EPSILON6);let b=s.attributes,x=s.indices,T=d,E=a.attributes,v=a.indices,S=f,I=bi.lineSegmentPlane(m,y,aue,ZY);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,h4e);m.y<0&&(h.negate(R,R),b=a.attributes,x=a.indices,T=f,E=s.attributes,v=s.indices,S=d);let O=h.add(I,R,m4e);A=qm(b,x,T,o,c,m),kE(p,g,m,i,A,b,r),A=qm(b,x,T,o,-1,O),kE(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=qm(E,v,S,o,-1,O),kE(p,g,O,i,A,E,r),A=qm(E,v,S,o,c+1,y),kE(p,g,y,i,A,E,r)}else{let R,O,L;m.y<0?(R=a.attributes,O=a.indices,L=f):(R=s.attributes,O=s.indices,L=d),A=qm(R,O,L,o,c,m),kE(p,g,m,i,A,R,r),A=qm(R,O,L,o,c+1,y),kE(p,g,y,i,A,R,r)}}eX(e,a,s)}var iue=new U,p4e=new U,cue=new h,lue=new h,QY=new h,g4e=new h,_4e=new h,y4e=new h,rue=new se;function oue(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,cue);if(a.x>0)continue;let c=h.unpack(i,s,lue);(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]):h.pack(a,i,s));let u=h.unpack(r,s,QY);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var A4e=5*P.EPSILON9,sL=P.EPSILON6;function b4e(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=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,u=UE(t),f=UE(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,cue),T=h.fromArray(i,b*3,lue);if(Math.abs(x.y)<sL)for(x.y=sL*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<sL)for(T.y=sL*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,S=f.attributes,I=f.indices,R=bi.lineSegmentPlane(x,T,aue,g4e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,A4e,_4e);x.y<0&&(h.negate(O,O),E=f.attributes,v=f.indices,S=u.attributes,I=u.indices);let L=h.add(R,O,y4e);E.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),E.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),E.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(R,O,L),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=U.fromArray(s,A*2,iue),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),S.expandAndWidth.values.push(-1,C,1,C),S.expandAndWidth.values.push(-1,-C,1,-C);let w=h.magnitudeSquared(h.subtract(R,x,QY));if(w/=h.magnitudeSquared(h.subtract(T,x,QY)),l(c)){let D=se.fromArray(c,A*4,rue),N=se.fromArray(c,b*4,rue),F=P.lerp(D.x,N.x,w),V=P.lerp(D.y,N.y,w),B=P.lerp(D.z,N.z,w),j=P.lerp(D.w,N.w,w);for(p=A*4;p<A*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(F,V,B,j),E.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),p=b*4;p<b*4+8;++p)S.color.values.push(c[p])}if(l(a)){let D=U.fromArray(a,A*2,iue),N=U.fromArray(a,(d+3)*2,p4e),F=P.lerp(D.x,N.x,w);for(p=A*2;p<A*2+4;++p)E.st.values.push(a[p]);for(E.st.values.push(F,D.y),E.st.values.push(F,N.y),S.st.values.push(F,D.y),S.st.values.push(F,N.y),p=b*2;p<b*2+4;++p)S.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=S.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let O,L;for(x.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(oue(f),oue(u)),eX(e,f,u)}Cl.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)!==$t.INTERSECTING))return e;if(t.geometryType!==mh.NONE)switch(t.geometryType){case mh.POLYLINES:b4e(e);break;case mh.TRIANGLES:tue(e);break;case mh.LINES:nue(e);break}else o4e(t),t.primitiveType===Oe.TRIANGLES?tue(e):t.primitiveType===Oe.LINES&&nue(e);return e};var Wn=Cl;function $I(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties($I.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});$I.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=$e.alignmentInBytes(p,m,o)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=$e.flipY(f,p,m,d,d)),T=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),T=$e.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,ze.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=$e.flipY(f,p,m,o,s)),a.texSubImage2D(u,0,t,n,o,s,p,ze.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),a.texSubImage2D(u,0,t,n,p,ze.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};$I.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??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,r,o),s.bindTexture(a,null),this._initialized=!0};$I.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(s,null),this._initialized=!0};var lL=$I;var JI={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===JI.DONT_CARE||e===JI.FASTEST||e===JI.NICEST}};Object.freeze(JI);var yh=JI;var ZI={NEAREST:te.NEAREST,LINEAR:te.LINEAR};ZI.validate=function(e){return e===ZI.NEAREST||e===ZI.LINEAR};Object.freeze(ZI);var Jn=ZI;var k0={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};k0.validate=function(e){return e===k0.NEAREST||e===k0.LINEAR||e===k0.NEAREST_MIPMAP_NEAREST||e===k0.LINEAR_MIPMAP_NEAREST||e===k0.NEAREST_MIPMAP_LINEAR||e===k0.LINEAR_MIPMAP_LINEAR};Object.freeze(k0);var Wt=k0;var QI={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===QI.CLAMP_TO_EDGE||e===QI.REPEAT||e===QI.MIRRORED_REPEAT}};Object.freeze(QI);var hn=QI;function eP(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=hn.CLAMP_TO_EDGE,wrapS:n=hn.CLAMP_TO_EDGE,wrapT:i=hn.CLAMP_TO_EDGE,minificationFilter:r=Wt.LINEAR,magnificationFilter:o=Jn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(eP.prototype,{wrapR:{get:function(){return this._wrapR}},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}}});eP.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};eP.NEAREST=Object.freeze(new eP({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST}));var Ht=eP;function x4e(e,t){if(!e)throw new pe(t)}var uue=x4e;function T4e(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=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 due(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Ah(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)T4e(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),due(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function fue(e){return e.values.length/e.componentsPerAttribute}function E4e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function C4e(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=fue(e[r[0]]),t=1;t<s;++t){let u=fue(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=E4e(i);if(a>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Ah.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Me.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=C4e(d);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:A}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[a],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(wt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Ah({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Ah.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ah.prototype.getAttribute=function(e){return this._attributes[e]};function v4e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ut.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function S4e(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Ah.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,s=r.componentsPerAttribute,a=t.constructor,c=n*s*a.BYTES_PER_ELEMENT,u=new a(t.buffer,t.byteOffset+c,i*s);o.copyFromArrayView(u,c)};Ah.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,s=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(s,o)};Ah.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&v4e(this),this._hasConstantAttributes&&S4e(this,this._gl)):due(this._gl,this._attributes,this._indexBuffer)};Ah.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)}};Ah.prototype.isDestroyed=function(){return!1};Ah.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),ue(this)};var Vn=Ah;function To(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,c=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=$e.textureSizeInBytes(i,r,d,d)*6,g=$e.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new lL(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,hue(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of To.faceNames())nX(this[T],n?.[T],0);m.bindTexture(y,null)}To.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new vs({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};To.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*w4e(){yield To.FaceName.POSITIVEX,yield To.FaceName.NEGATIVEX,yield To.FaceName.POSITIVEY,yield To.FaceName.NEGATIVEY,yield To.FaceName.POSITIVEZ,yield To.FaceName.NEGATIVEZ}To.faceNames=function(){return w4e()};function nX(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=$e.alignmentInBytes(o,s,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=$e.flipY(p,o,s,r,r)),d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,o,ze.toWebGLConstant(s,f),t))}To.loadFace=nX;Object.defineProperties(To.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){hue(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}}});To.getDirection=function(e,t){switch(e){case To.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case To.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case To.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case To.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case To.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case To.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function hue(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelDatatype;(s===ze.FLOAT&&!o.textureFloatLinear||s===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST);let a=o._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,a.LINEAR),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)}To.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let s=e[o],a=o+1;for(let c of To.faceNames())nX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};To.prototype.generateMipmap=function(e){e=e??yh.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)};To.createVertexArray=function(e){let t=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Wn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var ls=To;function I4e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var gc=I4e;var iX=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},uL=iX;var fL=`const float czm_degreesPerRadian = 57.29577951308232; +`;var dL=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); +`;var hL=`const float czm_epsilon1 = 0.1; +`;var mL=`const float czm_epsilon2 = 0.01; +`;var pL=`const float czm_epsilon3 = 0.001; +`;var gL=`const float czm_epsilon4 = 0.0001; +`;var _L=`const float czm_epsilon5 = 0.00001; +`;var yL=`const float czm_epsilon6 = 0.000001; +`;var AL=`const float czm_epsilon7 = 0.0000001; +`;var bL=`const float czm_infinity = 5906376272000.0; +`;var xL=`const float czm_oneOverPi = 0.3183098861837907; +`;var TL=`const float czm_oneOverTwoPi = 0.15915494309189535; +`;var EL=`const float czm_passCesium3DTile = 6.0; +`;var CL=`const float czm_passCesium3DTileClassification = 7.0; +`;var vL=`const float czm_passCesium3DTileClassificationIgnoreShow = 8.0; +`;var SL=`const float czm_passCesium3DTileEdges = 4.0; +`;var wL=`const float czm_passCesium3DTileEdgesDirect = 12.0; +`;var IL=`const float czm_passCesium3DTilePlanarFillId = 5.0; +`;var PL=`const float czm_passClassification = 8.0; +`;var DL=`const float czm_passCompute = 1.0; +`;var RL=`const float czm_passEnvironment = 0.0; +`;var OL=`const float czm_passGaussianSplats = 12.0; +`;var ML=`const float czm_passGlobe = 2.0; +`;var NL=`const float czm_passOpaque = 9.0; +`;var LL=`const float czm_passOverlay = 13.0; +`;var FL=`const float czm_passTerrainClassification = 3.0; +`;var BL=`const float czm_passTranslucent = 10.0; +`;var kL=`const float czm_passVoxels = 11.0; +`;var UL=`const float czm_pi = 3.141592653589793; +`;var zL=`const float czm_piOverFour = 0.7853981633974483; +`;var VL=`const float czm_piOverSix = 0.5235987755982988; +`;var jL=`const float czm_piOverThree = 1.0471975511965976; +`;var HL=`const float czm_piOverTwo = 1.5707963267948966; +`;var GL=`const float czm_radiansPerDegree = 0.017453292519943295; +`;var WL=`const float czm_sceneMode2D = 2.0; +`;var qL=`const float czm_sceneMode3D = 3.0; +`;var YL=`const float czm_sceneModeColumbusView = 1.0; +`;var XL=`const float czm_sceneModeMorphing = 0.0; +`;var KL=`const float czm_solarRadius = 695500000.0; +`;var $L=`const float czm_threePiOver2 = 4.71238898038469; +`;var JL=`const float czm_twoPi = 6.283185307179586; +`;var ZL=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var QL=`struct czm_depthRangeStruct { float near; float far; }; -`;var fR=`struct czm_material +`;var eF=`struct czm_material { vec3 diffuse; float specular; @@ -144,7 +148,7 @@ vec3 normal; vec3 emission; float alpha; }; -`;var dR=`struct czm_materialInput +`;var tF=`struct czm_materialInput { float s; vec2 st; @@ -157,7 +161,7 @@ float slope; float aspect; float waterMask; }; -`;var hR=`struct czm_modelMaterial { +`;var nF=`struct czm_modelMaterial { vec4 baseColor; vec3 diffuse; float alpha; @@ -180,23 +184,23 @@ float clearcoatRoughness; vec3 clearcoatNormal; #endif }; -`;var mR=`struct czm_modelVertexOutput { +`;var iF=`struct czm_modelVertexOutput { vec3 positionMC; float pointSize; }; -`;var pR=`struct czm_ray +`;var rF=`struct czm_ray { vec3 origin; vec3 direction; }; -`;var _R=`struct czm_raySegment +`;var oF=`struct czm_raySegment { float start; float stop; }; const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); -`;var gR=`struct czm_shadowParameters +`;var sF=`struct czm_shadowParameters { #ifdef USE_CUBE_MAP_SHADOW vec3 texCoords; @@ -210,7 +214,7 @@ vec2 texelStepSize; float normalShadingSmooth; float darkness; }; -`;var yR=`vec3 czm_acesTonemapping(vec3 color) { +`;var aF=`vec3 czm_acesTonemapping(vec3 color) { float g = 0.985; float a = 0.065; float b = 0.0001; @@ -220,12 +224,12 @@ color = (color * (color + a) - b) / (color * (g * color + c) + d); color = clamp(color, 0.0, 1.0); return color; } -`;var bR=`float czm_alphaWeight(float a) +`;var cF=`float czm_alphaWeight(float a) { float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; 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 xR=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var lF=`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); @@ -239,7 +243,7 @@ vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var TR=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { +`;var uF=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) { vec3 hsb = czm_RGBToHSB(rgb); hsb.x += hsbShift.x; hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); @@ -251,20 +255,20 @@ hsb.z = hsb.z + hsbShift.z; hsb.z = clamp(hsb.z, 0.0, 1.0); return czm_HSBToRGB(hsb); } -`;var AR=`vec2 czm_approximateSphericalCoordinates(vec3 normal) { +`;var fF=`vec2 czm_approximateSphericalCoordinates(vec3 normal) { 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 CR=`float czm_approximateTanh(float x) { +`;var dF=`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 ER=`bool czm_backFacing() +`;var hF=`bool czm_backFacing() { return gl_FrontFacing == false; } -`;var SR=`float czm_branchFreeTernary(bool comparison, float a, float b) { +`;var mF=`float czm_branchFreeTernary(bool comparison, float a, float b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } @@ -280,19 +284,19 @@ vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } -`;var wR=`vec4 czm_cascadeColor(vec4 weights) +`;var pF=`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 vR=`uniform vec4 shadowMap_cascadeDistances; +`;var gF=`uniform vec4 shadowMap_cascadeDistances; float czm_cascadeDistance(vec4 weights) { return dot(shadowMap_cascadeDistances, weights); } -`;var DR=`uniform mat4 shadowMap_cascadeMatrices[4]; +`;var _F=`uniform mat4 shadowMap_cascadeMatrices[4]; mat4 czm_cascadeMatrix(vec4 weights) { return shadowMap_cascadeMatrices[0] * weights.x + @@ -300,50 +304,19 @@ shadowMap_cascadeMatrices[1] * weights.y + shadowMap_cascadeMatrices[2] * weights.z + shadowMap_cascadeMatrices[3] * weights.w; } -`;var PR=`uniform vec4 shadowMap_cascadeSplits[2]; +`;var yF=`uniform vec4 shadowMap_cascadeSplits[2]; vec4 czm_cascadeWeights(float depthEye) { vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } -`;var IR=`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) { -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 OR=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var AF=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -vec3 p = mix(position2D.xyz, position3D.xyz, time); +vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; return vec4(p, 1.0); } -`;var RR=`vec4 czm_computeAtmosphereColor( +`;var bF=`vec4 czm_computeAtmosphereColor( vec3 positionWC, vec3 lightDirection, vec3 rayleighColor, @@ -382,7 +355,7 @@ vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity; return vec4(color, opacity); } -`;var MR=`void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var xF=`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); @@ -397,8 +370,8 @@ mieColor, opacity ); } -`;var LR=`vec4 czm_computePosition(); -`;var NR=`void czm_computeScattering( +`;var TF=`vec4 czm_computePosition(); +`;var EF=`void czm_computeScattering( czm_ray primaryRay, float primaryRayLength, vec3 lightDirection, @@ -467,7 +440,11 @@ rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; mieColor = czm_atmosphereMieCoefficient * mieAccumulation; opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } -`;var FR=`vec2 cordic(float angle) +`;var CF=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) +{ +return vec2(textureTransform * vec3(texCoord, 1.0)); +} +`;var vF=`vec2 cordic(float angle) { vec2 vector = vec2(6.0725293500888267e-1, 0.0); float sense = (angle < 0.0) ? -1.0 : 1.0; @@ -631,7 +608,18 @@ else return cordic(angle); } } -`;var BR=`vec2 czm_decompressTextureCoordinates(float encoded) +`;var SF=`vec4 czm_decodeRGB8(float encoded) { +const float SHIFT_RIGHT16 = 1.0 / 65536.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT8 = 256.0; +vec4 color = vec4(255.0); +color.r = floor(encoded * SHIFT_RIGHT16); +color.g = floor((encoded - color.r * SHIFT_LEFT16) * SHIFT_RIGHT8); +color.b = floor(encoded - color.r * SHIFT_LEFT16 - color.g * SHIFT_LEFT8); +return color / 255.0; +} +`;var wF=`vec2 czm_decompressTextureCoordinates(float encoded) { float temp = encoded / 4096.0; float xZeroTo4095 = floor(temp); @@ -639,7 +627,7 @@ float stx = xZeroTo4095 / 4095.0; float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; return vec2(stx, sty); } -`;var kR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +`;var IF=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) out float v_WindowZ; #endif vec4 czm_depthClamp(vec4 coords) @@ -654,7 +642,7 @@ coords.z = min(coords.z, coords.w); #endif return coords; } -`;var UR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) +`;var PF=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); vec3 tangentEC = normalize(czm_normal3D * tangentMC); @@ -664,16 +652,16 @@ tangentEC.x, tangentEC.y, tangentEC.z, bitangentEC.x, bitangentEC.y, bitangentEC.z, normalEC.x, normalEC.y, normalEC.z); } -`;var VR=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var DF=`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 zR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) +`;var RF=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } -`;var HR=`bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { +`;var OF=`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) { @@ -685,7 +673,7 @@ return all(lessThanEqual(abs(left - right), vec2(epsilon))); bool czm_equalsEpsilon(float left, float right, float epsilon) { return (abs(left - right) <= epsilon); } -`;var GR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +`;var MF=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { vec4 p = positionEC; vec4 zEyeOffset = normalize(p) * eyeOffset.z; @@ -693,14 +681,39 @@ p.xy += eyeOffset.xy + zEyeOffset.xy; p.z += zEyeOffset.z; return p; } -`;var jR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +`;var NF=`vec3 czm_eyeToCartographicDelta(vec3 positionEC) +{ +vec3 cameraToVertex = czm_eyeToEnu * positionEC; +float cosLatitude = cos(czm_eyeCartographic.y); +float sinLatitude = sin(czm_eyeCartographic.y); +float primeVerticalRadius = 1.0 / czm_eyeEllipsoidCurvature.x; +vec2 cameraEquatorialPos = vec2((primeVerticalRadius + czm_eyeCartographic.z) * cosLatitude, 0.0); +vec2 vertexEquatorialPos = cameraEquatorialPos + vec2(-cameraToVertex.y * sinLatitude + cameraToVertex.z * cosLatitude, cameraToVertex.x); +float deltaLongitude = atan(vertexEquatorialPos.y, vertexEquatorialPos.x); +float sinHalfLongitude = sin(deltaLongitude * 0.5); +float dx = length(vertexEquatorialPos) * 2.0 * sinHalfLongitude * sinHalfLongitude; +vec3 meridionalOffset = vec3( +0.0, +cameraToVertex.y - dx * sinLatitude, +cameraToVertex.z + dx * cosLatitude +); +float meridionalRadius = 1.0 / czm_eyeEllipsoidCurvature.y; +vec2 cameraMeridionalPos = vec2(meridionalRadius + czm_eyeCartographic.z, 0.0); +vec2 vertMeridionalPos = cameraMeridionalPos + vec2(meridionalOffset.z, meridionalOffset.y); +float deltaLatitude = atan(vertMeridionalPos.y, vertMeridionalPos.x); +float sinHalfLatitude = sin(deltaLatitude * 0.5); +float dz = length(vertMeridionalPos) * 2.0 * sinHalfLatitude * sinHalfLatitude; +float deltaHeight = meridionalOffset.z + dz; +return vec3(deltaLongitude, deltaLatitude, deltaHeight); +} +`;var LF=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { vec4 q = czm_projection * positionEC; q.xyz /= q.w; q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; return q; } -`;var WR=`float czm_fastApproximateAtan(float x) { +`;var FF=`float czm_fastApproximateAtan(float x) { return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } float czm_fastApproximateAtan(float x, float y) { @@ -714,7 +727,7 @@ t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); t = czm_branchFreeTernary(y < 0.0, -t, t); return t; } -`;var qR=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +`;var BF=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) { float scalar = distanceToCamera * czm_fogDensity; float fog = 1.0 - exp(-(scalar * scalar)); @@ -726,7 +739,7 @@ float scalar = distanceToCamera * czm_fogDensity; float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); return mix(color, fogColor, fog); } -`;var YR=`vec3 czm_gammaCorrect(vec3 color) { +`;var kF=`vec3 czm_gammaCorrect(vec3 color) { #ifdef HDR color = pow(color, vec3(czm_gamma)); #endif @@ -738,11 +751,11 @@ color.rgb = pow(color.rgb, vec3(czm_gamma)); #endif return color; } -`;var XR=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) +`;var UF=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -`;var KR=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) +`;var zF=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) { czm_material material; material.diffuse = vec3(0.0); @@ -753,7 +766,7 @@ material.emission = vec3(0.0); material.alpha = 1.0; return material; } -`;var $R=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { +`;var VF=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { const float NONE = 0.0; const float SCENE_LIGHT = 1.0; const float SUNLIGHT = 2.0; @@ -763,17 +776,17 @@ czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) + czm_sunDirectionWC * float(lightEnum == SUNLIGHT); return normalize(lightDirection); } -`;var ZR=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var jF=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { return max(dot(lightDirectionEC, normalEC), 0.0); } -`;var QR=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var HF=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); float specular = max(dot(toReflectedLight, toEyeEC), 0.0); return pow(specular, max(shininess, czm_epsilon2)); } -`;var JR=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var GF=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) { float cosAngle = cos(angleInRadians); float sinAngle = sin(angleInRadians); @@ -799,13 +812,13 @@ vec4 noise = (texture(normalMap, uv0)) + (texture(normalMap, uv3)); return ((noise / 4.0) - 0.5) * 2.0; } -`;var eM=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +`;var WF=`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 tM=`vec3 hueToRGB(float hue) +`;var qF=`vec3 hueToRGB(float hue) { float r = abs(hue * 6.0 - 3.0) - 1.0; float g = 2.0 - abs(hue * 6.0 - 2.0); @@ -818,7 +831,7 @@ 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 nM=`vec3 czm_hue(vec3 rgb, float adjustment) +`;var YF=`vec3 czm_hue(vec3 rgb, float adjustment) { const mat3 toYIQ = mat3(0.299, 0.587, 0.114, 0.595716, -0.274453, -0.321263, @@ -832,24 +845,24 @@ 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 iM=`vec3 czm_inverseGamma(vec3 color) { +`;var XF=`vec3 czm_inverseGamma(vec3 color) { return pow(color, vec3(1.0 / czm_gamma)); } -`;var oM=`bool czm_isEmpty(czm_raySegment interval) +`;var KF=`bool czm_isEmpty(czm_raySegment interval) { return (interval.stop < 0.0); } -`;var rM=`bool czm_isFull(czm_raySegment interval) +`;var $F=`bool czm_isFull(czm_raySegment interval) { return (interval.start == 0.0 && interval.stop == czm_infinity); } -`;var sM=`float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) +`;var JF=`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 aM=`vec3 czm_linearToSrgb(vec3 linearIn) +`;var ZF=`vec3 czm_linearToSrgb(vec3 linearIn) { return pow(linearIn, vec3(1.0/2.2)); } @@ -858,15 +871,15 @@ vec4 czm_linearToSrgb(vec4 linearIn) vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); return vec4(srgbOut, linearIn.a); } -`;var cM=`float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { +`;var QF=`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 lM=`float czm_luminance(vec3 rgb) +`;var eB=`float czm_luminance(vec3 rgb) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); } -`;var uM=`float czm_maximumComponent(vec2 v) +`;var tB=`float czm_maximumComponent(vec2 v) { return max(v.x, v.y); } @@ -878,7 +891,7 @@ float czm_maximumComponent(vec4 v) { return max(max(max(v.x, v.y), v.z), v.w); } -`;var fM=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) +`;var nB=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) { float width = czm_viewport.z; float height = czm_viewport.w; @@ -910,14 +923,15 @@ float czm_metersPerPixel(vec4 positionEC) { return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var dM=`vec4 czm_modelToWindowCoordinates(vec4 position) +`;var iB=`vec4 czm_modelToWindowCoordinates(vec4 position) { -vec4 q = czm_modelViewProjection * position; +vec4 positionEC = czm_modelView * position; +vec4 q = czm_projection * positionEC; q.xyz /= q.w; q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; return q; } -`;var hM=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) +`;var rB=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 target = left * right; @@ -926,7 +940,7 @@ float rightLuminance = dot(right, W); float targetLuminance = dot(target, W); return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } -`;var mM=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) +`;var oB=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { float valueAtMin = nearFarScalar.y; float valueAtMax = nearFarScalar.w; @@ -936,7 +950,7 @@ float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); t = pow(clamp(t, 0.0, 1.0), 0.2); return mix(valueAtMin, valueAtMax, t); } -`;var pM=`vec3 czm_octDecode(vec2 encoded, float range) +`;var sB=`vec3 czm_octDecode(vec2 encoded, float range) { if (encoded.x == 0.0 && encoded.y == 0.0) { return vec3(0.0, 0.0, 0.0); @@ -972,14 +986,14 @@ vector1 = czm_octDecode(encodedFloat1); vector2 = czm_octDecode(encodedFloat2); vector3 = czm_octDecode(vec2(x, y)); } -`;var _M=`vec4 czm_packDepth(float depth) +`;var aB=`vec4 czm_packDepth(float depth) { 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 gM=`vec3 lambertianDiffuse(vec3 diffuseColor) +`;var cB=`vec3 lambertianDiffuse(vec3 diffuseColor) { return diffuseColor / czm_pi; } @@ -1065,7 +1079,7 @@ vec3 diffuseColor = material.diffuse; vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); return (diffuseContribution + specularContribution) * NdotL; } -`;var yM=`vec3 czm_pbrNeutralTonemapping(vec3 color) { +`;var lB=`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)); @@ -1079,7 +1093,7 @@ 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 bM=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +`;var uB=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { return czm_getLambertDiffuse(lightDirectionEC, material.normal); } @@ -1111,17 +1125,17 @@ color += material.diffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var xM=`float czm_planeDistance(vec4 plane, vec3 point) { +`;var fB=`float czm_planeDistance(vec4 plane, vec3 point) { return (dot(plane.xyz, point) + plane.w); } float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { return (dot(planeNormal, point) + planeDistance); } -`;var TM=`vec3 czm_pointAlongRay(czm_ray ray, float time) +`;var dB=`vec3 czm_pointAlongRay(czm_ray ray, float time) { return ray.origin + (time * ray.direction); } -`;var AM=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) +`;var hB=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; @@ -1193,7 +1207,7 @@ return czm_emptyRaySegment; } } } -`;var CM=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +`;var mB=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) { vec3 o = ray.origin; vec3 d = ray.direction; @@ -1211,11 +1225,11 @@ float t1 = (-b + sqrtDet) / (2.0 * a); czm_raySegment result = czm_raySegment(t0, t1); return result; } -`;var EM=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +`;var pB=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -`;var SM=`float czm_readNonPerspective(float value, float oneOverW) { +`;var gB=`float czm_readNonPerspective(float value, float oneOverW) { return value * oneOverW; } vec2 czm_readNonPerspective(vec2 value, float oneOverW) { @@ -1227,7 +1241,7 @@ return value * oneOverW; vec4 czm_readNonPerspective(vec4 value, float oneOverW) { return value * oneOverW; } -`;var wM=`float czm_reverseLogDepth(float logZ) +`;var _B=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH float near = czm_currentFrustum.x; @@ -1238,7 +1252,7 @@ return far * (1.0 - near / (depthFromNear + near)) / (far - near); #endif return logZ; } -`;var vM=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +`;var yB=`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)); @@ -1246,7 +1260,7 @@ 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 DM=`vec3 RGBtoHCV(vec3 rgb) +`;var AB=`vec3 RGBtoHCV(vec3 rgb) { 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); @@ -1261,7 +1275,7 @@ 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 PM=`vec3 czm_RGBToXYZ(vec3 rgb) +`;var bB=`vec3 czm_RGBToXYZ(vec3 rgb) { const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, 0.3576, 0.7152, 0.1192, @@ -1273,7 +1287,7 @@ float temp = dot(vec3(1.0), xyz); Yxy.gb = xyz.rg / temp; return Yxy; } -`;var IM=`float czm_round(float value) { +`;var xB=`float czm_round(float value) { return floor(value + 0.5); } vec2 czm_round(vec2 value) { @@ -1285,13 +1299,13 @@ return floor(value + 0.5); vec4 czm_round(vec4 value) { return floor(value + 0.5); } -`;var OM=`vec3 czm_saturation(vec3 rgb, float adjustment) +`;var TB=`vec3 czm_saturation(vec3 rgb, float adjustment) { const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 intensity = vec3(dot(rgb, W)); return mix(intensity, rgb, adjustment); } -`;var RM=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) +`;var EB=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { return czm_unpackDepth(czm_textureCube(shadowMap, d)); } @@ -1311,7 +1325,7 @@ float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var MM=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +`;var CB=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { #ifdef USE_NORMAL_SHADING #ifdef USE_NORMAL_SHADING_SMOOTH @@ -1371,7 +1385,7 @@ float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } #endif -`;var LM=`float czm_signNotZero(float value) +`;var vB=`float czm_signNotZero(float value) { return value >= 0.0 ? 1.0 : -1.0; } @@ -1387,7 +1401,7 @@ vec4 czm_signNotZero(vec4 value) { return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -`;var NM=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +`;var SB=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) { vec3 L00 = coefficients[0]; vec3 L1_1 = coefficients[1]; @@ -1413,7 +1427,7 @@ L00 + L22 * (x * x - y * y); return max(L, vec3(0.0)); } -`;var FM=`vec3 czm_srgbToLinear(vec3 srgbIn) +`;var wB=`vec3 czm_srgbToLinear(vec3 srgbIn) { return pow(srgbIn, vec3(2.2)); } @@ -1422,7 +1436,7 @@ vec4 czm_srgbToLinear(vec4 srgbIn) vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); } -`;var BM=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +`;var IB=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) { vec3 normal = normalize(normalEC); vec3 tangent = normalize(tangentEC); @@ -1431,7 +1445,7 @@ return mat3(tangent.x , tangent.y , tangent.z, bitangent.x, bitangent.y, bitangent.z, normal.x , normal.y , normal.z); } -`;var kM=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { +`;var PB=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { #if __VERSION__ == 300 return texture(sampler, p); #else @@ -1445,12 +1459,12 @@ return textureLod(sampler, p, lod); return textureCubeLodEXT(sampler, p, lod); #endif } -`;var UM=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { +`;var DB=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { vec4 transformedPlane = transform * plane; float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } -`;var VM=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +`;var RB=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { vec3 highDifference = high - czm_encodedCameraPositionMCHigh; if (length(highDifference) == 0.0) { @@ -1459,7 +1473,7 @@ highDifference = vec3(0); vec3 lowDifference = low - czm_encodedCameraPositionMCLow; return vec4(highDifference + lowDifference, 1.0); } -`;var zM=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +`;var OB=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); if (czm_sceneMode == czm_sceneMode3D) { @@ -1474,7 +1488,7 @@ color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var HM=`mat2 czm_transpose(mat2 matrix) +`;var MB=`mat2 czm_transpose(mat2 matrix) { return mat2( matrix[0][0], matrix[1][0], @@ -1495,24 +1509,11 @@ 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 GM=`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; -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 jM=`float czm_unpackDepth(vec4 packedDepth) +`;var NB=`float czm_unpackDepth(vec4 packedDepth) { return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } -`;var WM=`float czm_unpackFloat(vec4 packedFloat) +`;var LB=`float czm_unpackFloat(vec4 packedFloat) { packedFloat = floor(packedFloat * 255.0 + 0.5); float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; @@ -1525,7 +1526,32 @@ float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + float result = sign * exp2(exponent - 23.0) * mantissa; return result; } -`;var qM=`int czm_unpackUint(float packedValue) { +`;var FB=`uint czm_unpackTexture(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return uint(rounded); +} +uint czm_unpackTexture(vec2 packedValue) { +vec2 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +return byte0 | (byte1 << 8); +} +uint czm_unpackTexture(vec3 packedValue) { +vec3 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +uint byte2 = uint(rounded.z); +return byte0 | (byte1 << 8) | (byte2 << 16); +} +uint czm_unpackTexture(vec4 packedValue) { +vec4 rounded = czm_round(packedValue * 255.0); +uint byte0 = uint(rounded.x); +uint byte1 = uint(rounded.y); +uint byte2 = uint(rounded.z); +uint byte3 = uint(rounded.w); +return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24); +} +`;var BB=`int czm_unpackUint(float packedValue) { float rounded = czm_round(packedValue * 255.0); return int(rounded); } @@ -1541,7 +1567,7 @@ 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 YM=`float czm_valueTransform(float offset, float scale, float value) { +`;var kB=`float czm_valueTransform(float offset, float scale, float value) { return scale * value + offset; } vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { @@ -1562,7 +1588,7 @@ return matrixCompMult(scale, value) + offset; mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { return matrixCompMult(scale, value) + offset; } -`;var XM=`#ifdef LOG_DEPTH +`;var UB=`#ifdef LOG_DEPTH out float v_depthFromNearPlusOne; #ifdef SHADOW_MAP out vec3 v_logPositionEC; @@ -1592,7 +1618,7 @@ v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; czm_updatePositionDepth(clipCoords); #endif } -`;var KM=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var zB=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { float x = 2.0 * screenCoordinate.x - 1.0; float y = 2.0 * screenCoordinate.y - 1.0; @@ -1634,7 +1660,6 @@ 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; -return eyeCoordinate; #else vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); @@ -1646,7 +1671,7 @@ vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } -`;var $M=`#if !defined(LOG_DEPTH) +`;var VB=`#if !defined(LOG_DEPTH) in float v_WindowZ; #endif void czm_writeDepthClamp() @@ -1655,7 +1680,7 @@ void czm_writeDepthClamp() gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif } -`;var ZM=`#ifdef LOG_DEPTH +`;var jB=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET uniform vec2 u_polygonOffset; @@ -1690,7 +1715,7 @@ void czm_writeLogDepth() { czm_writeLogDepth(v_depthFromNearPlusOne); #endif } -`;var QM=`float czm_writeNonPerspective(float value, float w) { +`;var HB=`float czm_writeNonPerspective(float value, float w) { return value * w; } vec2 czm_writeNonPerspective(vec2 value, float w) { @@ -1702,7 +1727,7 @@ return value * w; vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } -`;var JM=`vec3 czm_XYZToRGB(vec3 Yxy) +`;var GB=`vec3 czm_XYZToRGB(vec3 Yxy) { const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, -1.5371, 1.8760, -0.2040, @@ -1713,7 +1738,7 @@ xyz.g = Yxy.r; xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; return XYZ2RGB * xyz; } -`;var PT={czm_degreesPerRadian:w1,czm_depthRange:v1,czm_epsilon1:D1,czm_epsilon2:P1,czm_epsilon3:I1,czm_epsilon4:O1,czm_epsilon5:R1,czm_epsilon6:M1,czm_epsilon7:L1,czm_infinity:N1,czm_oneOverPi:F1,czm_oneOverTwoPi:B1,czm_passCesium3DTile:k1,czm_passCesium3DTileClassification:U1,czm_passCesium3DTileClassificationIgnoreShow:V1,czm_passClassification:z1,czm_passCompute:H1,czm_passEnvironment:G1,czm_passGlobe:j1,czm_passOpaque:W1,czm_passOverlay:q1,czm_passTerrainClassification:Y1,czm_passTranslucent:X1,czm_passVoxels:K1,czm_pi:$1,czm_piOverFour:Z1,czm_piOverSix:Q1,czm_piOverThree:J1,czm_piOverTwo:eR,czm_radiansPerDegree:tR,czm_sceneMode2D:nR,czm_sceneMode3D:iR,czm_sceneModeColumbusView:oR,czm_sceneModeMorphing:rR,czm_solarRadius:sR,czm_threePiOver2:aR,czm_twoPi:cR,czm_webMercatorMaxLatitude:lR,czm_depthRangeStruct:uR,czm_material:fR,czm_materialInput:dR,czm_modelMaterial:hR,czm_modelVertexOutput:mR,czm_ray:pR,czm_raySegment:_R,czm_shadowParameters:gR,czm_acesTonemapping:yR,czm_alphaWeight:bR,czm_antialias:xR,czm_applyHSBShift:TR,czm_approximateSphericalCoordinates:AR,czm_approximateTanh:CR,czm_backFacing:ER,czm_branchFreeTernary:SR,czm_cascadeColor:wR,czm_cascadeDistance:vR,czm_cascadeMatrix:DR,czm_cascadeWeights:PR,czm_clipPolygons:IR,czm_columbusViewMorph:OR,czm_computeAtmosphereColor:RR,czm_computeGroundAtmosphereScattering:MR,czm_computePosition:LR,czm_computeScattering:NR,czm_cosineAndSine:FR,czm_decompressTextureCoordinates:BR,czm_depthClamp:kR,czm_eastNorthUpToEyeCoordinates:UR,czm_ellipsoidContainsPoint:VR,czm_ellipsoidTextureCoordinates:zR,czm_equalsEpsilon:HR,czm_eyeOffset:GR,czm_eyeToWindowCoordinates:jR,czm_fastApproximateAtan:WR,czm_fog:qR,czm_gammaCorrect:YR,czm_geodeticSurfaceNormal:XR,czm_getDefaultMaterial:KR,czm_getDynamicAtmosphereLightDirection:$R,czm_getLambertDiffuse:ZR,czm_getSpecular:QR,czm_getWaterNoise:JR,czm_HSBToRGB:eM,czm_HSLToRGB:tM,czm_hue:nM,czm_inverseGamma:iM,czm_isEmpty:oM,czm_isFull:rM,czm_latitudeToWebMercatorFraction:sM,czm_linearToSrgb:aM,czm_lineDistance:cM,czm_luminance:lM,czm_maximumComponent:uM,czm_metersPerPixel:fM,czm_modelToWindowCoordinates:dM,czm_multiplyWithColorBalance:hM,czm_nearFarScalar:mM,czm_octDecode:pM,czm_packDepth:_M,czm_pbrLighting:gM,czm_pbrNeutralTonemapping:yM,czm_phong:bM,czm_planeDistance:xM,czm_pointAlongRay:TM,czm_rayEllipsoidIntersectionInterval:AM,czm_raySphereIntersectionInterval:CM,czm_readDepth:EM,czm_readNonPerspective:SM,czm_reverseLogDepth:wM,czm_RGBToHSB:vM,czm_RGBToHSL:DM,czm_RGBToXYZ:PM,czm_round:IM,czm_saturation:OM,czm_shadowDepthCompare:RM,czm_shadowVisibility:MM,czm_signNotZero:LM,czm_sphericalHarmonics:NM,czm_srgbToLinear:FM,czm_tangentToEyeSpaceMatrix:BM,czm_textureCube:kM,czm_transformPlane:UM,czm_translateRelativeToEye:VM,czm_translucentPhong:zM,czm_transpose:HM,czm_unpackClippingExtents:GM,czm_unpackDepth:jM,czm_unpackFloat:WM,czm_unpackUint:qM,czm_valueTransform:YM,czm_vertexLogDepth:XM,czm_windowToEyeCoordinates:KM,czm_writeDepthClamp:$M,czm_writeLogDepth:ZM,czm_writeNonPerspective:QM,czm_XYZToRGB:JM};function SPe(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,` +`;var zE={czm_degreesPerRadian:fL,czm_depthRange:dL,czm_epsilon1:hL,czm_epsilon2:mL,czm_epsilon3:pL,czm_epsilon4:gL,czm_epsilon5:_L,czm_epsilon6:yL,czm_epsilon7:AL,czm_infinity:bL,czm_oneOverPi:xL,czm_oneOverTwoPi:TL,czm_passCesium3DTile:EL,czm_passCesium3DTileClassification:CL,czm_passCesium3DTileClassificationIgnoreShow:vL,czm_passCesium3DTileEdges:SL,czm_passCesium3DTileEdgesDirect:wL,czm_passCesium3DTilePlanarFillId:IL,czm_passClassification:PL,czm_passCompute:DL,czm_passEnvironment:RL,czm_passGaussianSplats:OL,czm_passGlobe:ML,czm_passOpaque:NL,czm_passOverlay:LL,czm_passTerrainClassification:FL,czm_passTranslucent:BL,czm_passVoxels:kL,czm_pi:UL,czm_piOverFour:zL,czm_piOverSix:VL,czm_piOverThree:jL,czm_piOverTwo:HL,czm_radiansPerDegree:GL,czm_sceneMode2D:WL,czm_sceneMode3D:qL,czm_sceneModeColumbusView:YL,czm_sceneModeMorphing:XL,czm_solarRadius:KL,czm_threePiOver2:$L,czm_twoPi:JL,czm_webMercatorMaxLatitude:ZL,czm_depthRangeStruct:QL,czm_material:eF,czm_materialInput:tF,czm_modelMaterial:nF,czm_modelVertexOutput:iF,czm_ray:rF,czm_raySegment:oF,czm_shadowParameters:sF,czm_acesTonemapping:aF,czm_alphaWeight:cF,czm_antialias:lF,czm_applyHSBShift:uF,czm_approximateSphericalCoordinates:fF,czm_approximateTanh:dF,czm_backFacing:hF,czm_branchFreeTernary:mF,czm_cascadeColor:pF,czm_cascadeDistance:gF,czm_cascadeMatrix:_F,czm_cascadeWeights:yF,czm_columbusViewMorph:AF,czm_computeAtmosphereColor:bF,czm_computeGroundAtmosphereScattering:xF,czm_computePosition:TF,czm_computeScattering:EF,czm_computeTextureTransform:CF,czm_cosineAndSine:vF,czm_decodeRGB8:SF,czm_decompressTextureCoordinates:wF,czm_depthClamp:IF,czm_eastNorthUpToEyeCoordinates:PF,czm_ellipsoidContainsPoint:DF,czm_ellipsoidTextureCoordinates:RF,czm_equalsEpsilon:OF,czm_eyeOffset:MF,czm_eyeToCartographicDelta:NF,czm_eyeToWindowCoordinates:LF,czm_fastApproximateAtan:FF,czm_fog:BF,czm_gammaCorrect:kF,czm_geodeticSurfaceNormal:UF,czm_getDefaultMaterial:zF,czm_getDynamicAtmosphereLightDirection:VF,czm_getLambertDiffuse:jF,czm_getSpecular:HF,czm_getWaterNoise:GF,czm_HSBToRGB:WF,czm_HSLToRGB:qF,czm_hue:YF,czm_inverseGamma:XF,czm_isEmpty:KF,czm_isFull:$F,czm_latitudeToWebMercatorFraction:JF,czm_linearToSrgb:ZF,czm_lineDistance:QF,czm_luminance:eB,czm_maximumComponent:tB,czm_metersPerPixel:nB,czm_modelToWindowCoordinates:iB,czm_multiplyWithColorBalance:rB,czm_nearFarScalar:oB,czm_octDecode:sB,czm_packDepth:aB,czm_pbrLighting:cB,czm_pbrNeutralTonemapping:lB,czm_phong:uB,czm_planeDistance:fB,czm_pointAlongRay:dB,czm_rayEllipsoidIntersectionInterval:hB,czm_raySphereIntersectionInterval:mB,czm_readDepth:pB,czm_readNonPerspective:gB,czm_reverseLogDepth:_B,czm_RGBToHSB:yB,czm_RGBToHSL:AB,czm_RGBToXYZ:bB,czm_round:xB,czm_saturation:TB,czm_shadowDepthCompare:EB,czm_shadowVisibility:CB,czm_signNotZero:vB,czm_sphericalHarmonics:SB,czm_srgbToLinear:wB,czm_tangentToEyeSpaceMatrix:IB,czm_textureCube:PB,czm_transformPlane:DB,czm_translateRelativeToEye:RB,czm_translucentPhong:OB,czm_transpose:MB,czm_unpackDepth:NB,czm_unpackFloat:LB,czm_unpackTexture:FB,czm_unpackUint:BB,czm_valueTransform:kB,czm_vertexLogDepth:UB,czm_windowToEyeCoordinates:zB,czm_writeDepthClamp:VB,czm_writeLogDepth:jB,czm_writeNonPerspective:HB,czm_XYZToRGB:GB};function P4e(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 @@ -1723,15 +1748,14 @@ ${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 eL=SPe;function XJ(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 KJ(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return c(i)||(t=XJ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function $J(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);c(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Rs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=KJ(i,Rs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),$J(o,t)}}))}function wPe(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]);if(i.length!==0){let o=`A circular dependency was found in the following built-in functions/structs/constants: -`;for(let r=0;r<i.length;++r)o=`${o+i[r].name} -`;throw new C(o)}}function vPe(e){let t=[],n=KJ("main",e,t);$J(n,t),wPe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource} -`;return i.replace(n.glslSource,"")}function ZJ(e,t,n){let i,o,r="",s=e.sources;if(c(s))for(i=0,o=s.length;i<o;++i)r+=` +${n}`,n}var WB=P4e;function mue(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` +`;return i})}function pue(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=mue(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function gue(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,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&Sa._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=pue(i,Sa._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),gue(r,t)}}))}function D4e(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function R4e(e){let t=[],n=pue("main",e,t);gue(n,t),D4e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +`;return i.replace(n.glslSource,"")}function _ue(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` #line 0 -${s[i]}`;r=XJ(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,b){if(c(a)&&a!==b)throw new C(`inconsistent versions found: ${a} and ${b}`);return a=b,` -`});let l=[];r=r.replace(/#extension.*\n/gm,function(y){return l.push(y),` -`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;c(u)&&(r=Rs.createPickFragmentShaderSource(r,u));let f="",h=l.length;for(i=0;i<h;i++)f+=l[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH +${r[g]}`;i=mue(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return o=m,` +`});let s=[];i=i.replace(/#extension.*\n/gm,function(g){return s.push(g),` +`}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let a=e.pickColorQualifier;l(a)&&(i=Sa.createPickFragmentShaderSource(i,a));let c="",u=s.length;for(let g=0;g<u;g++)c+=s[g];t&&(c+=` +#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; precision highp int; #else @@ -1739,26 +1763,27 @@ ${s[i]}`;r=XJ(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,b){if(c(a)& precision mediump int; #define highp mediump #endif +`),n.webgl2&&(c+=`precision highp sampler3D; -`);let p=e.defines;if(c(p))for(i=0,o=p.length;i<o;++i){let y=p[i];y.length!==0&&(f+=`#define ${y} -`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear +`);let f=e.defines;if(l(f))for(let g=0,m=f.length;g<m;++g){let y=f[g];y.length!==0&&(c+=`#define ${y} +`)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear -`),n.floatingPointTexture&&(f+=`#define OES_texture_float +`),n.floatingPointTexture&&(c+=`#define OES_texture_float -`);let g="";e.includeBuiltIns&&(g=vPe(r)),f+=` +`);let d="";e.includeBuiltIns&&(d=R4e(i)),c+=` #line 0 -`;let m=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor; +`;let p=d+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor; -`),f+=g,f+=r,n.webgl2?f=`#version 300 es -${f}`:f=eL(f,t),f}function Rs(e){e=e??W.EMPTY_OBJECT;let t=e.pickColorQualifier;if(c(t)&&t!=="uniform"&&t!=="in")throw new C("options.pickColorQualifier must be 'uniform' or 'in'.");this.defines=c(e.defines)?e.defines.slice(0):[],this.sources=c(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}Rs.prototype.clone=function(){return new Rs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Rs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Rs.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}`};Rs.prototype.createCombinedVertexShader=function(e){return ZJ(this,!1,e)};Rs.prototype.createCombinedFragmentShader=function(e){return ZJ(this,!0,e)};Rs._czmBuiltinsAndUniforms={};for(let e in PT)PT.hasOwnProperty(e)&&(Rs._czmBuiltinsAndUniforms[e]=PT[e]);for(let e in N_)if(N_.hasOwnProperty(e)){let t=N_[e];typeof t.getDeclaration=="function"&&(Rs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Rs.createPickVertexShaderSource=function(e){return`${Rs.replaceMain(e,"czm_old_main")} +`),c+=d,c+=i,n.webgl2?c=`#version 300 es +${c}`:c=WB(c,t),c}function Sa(e){e=e??H.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=e.includeBuiltIns??!0}Sa.prototype.clone=function(){return new Sa({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Sa.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Sa.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,r=this.sources.join(` +`);return`${t}:${n}:${i}:${r}`};Sa.prototype.createCombinedVertexShader=function(e){return _ue(this,!1,e)};Sa.prototype.createCombinedFragmentShader=function(e){return _ue(this,!0,e)};Sa._czmBuiltinsAndUniforms={};for(let e in zE)zE.hasOwnProperty(e)&&(Sa._czmBuiltinsAndUniforms[e]=zE[e]);for(let e in x_)if(x_.hasOwnProperty(e)){let t=x_[e];typeof t.getDeclaration=="function"&&(Sa._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Sa.createPickVertexShaderSource=function(e){return`${Sa.replaceMain(e,"czm_old_main")} in vec4 pickColor; out vec4 czm_pickColor; void main() { czm_old_main(); czm_pickColor = pickColor; -}`};Rs.createPickFragmentShaderSource=function(e,t){let n=Rs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +}`};Sa.createPickFragmentShaderSource=function(e,t){let n=Sa.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; void main() { czm_old_main(); @@ -1767,9 +1792,1274 @@ void main() } out_FragColor = czm_pickColor; }`;return`${n} -${i}`};function DPe(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 QJ(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 JJ(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(QJ(e,o))return o}}var PPe=["v_normalEC","v_normal"];Rs.findNormalVarying=function(e){return QJ(e,"#ifdef HAS_NORMALS")?DPe(e,"HAS_NORMALS")?"v_normalEC":void 0:JJ(e,PPe)};var IPe=["v_positionEC"];Rs.findPositionVarying=function(e){return JJ(e,IPe)};var He=Rs;function md(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(md.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});md.prototype.replaceShaderProgram=function(e){return c(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function OPe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}md.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new He({sources:[t]})),typeof n=="string"&&(n=new He({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=c(i)?OPe(i):"",a=`${o}:${r}:${s}`,l;if(c(this._shaders[a]))l=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new en({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});l={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=l,this._shaders[a]=l,++this._numberOfShaders}return++l.count,l.shaderProgram};md.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(c(r)){T6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};md.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(c(o))return o.shaderProgram};md.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 He({sources:[r]})),typeof s=="string"&&(s=new He({sources:[s]}));let l=this._context,u=r.createCombinedVertexShader(l),f=s.createCombinedFragmentShader(l),h=new en({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,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 T6(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];T6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}md.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];T6(this,n),--this._numberOfShaders}this._shadersToRelease={}};md.prototype.releaseShaderProgram=function(e){if(c(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};md.prototype.isDestroyed=function(){return!1};md.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return de(this)};var tL=md;function pd(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Qt}=e,{width:l,height:u}=e;c(n)&&(c(l)||(l=n.videoWidth??n.naturalWidth??n.width),c(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,h=ke.toInternalFormat(i,o,t),p=ke.isCompressedFormat(h);if(!c(l)||!c(u))throw new C("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(T.typeOf.number.greaterThan("width",l,0),l>ut.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(T.typeOf.number.greaterThan("height",u,0),u>ut.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(!ke.validate(i))throw new C("Invalid options.pixelFormat.");if(!p&&!Ue.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===ke.DEPTH_COMPONENT&&o!==Ue.UNSIGNED_SHORT&&o!==Ue.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ke.DEPTH_STENCIL&&o!==Ue.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ke.isDepthFormat(i)){if(c(n))throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(p){if(!c(n)||!c(n.arrayBufferView))throw new C("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ke.isDXTFormat(h)&&!t.s3tc)throw new C("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ke.isPVRTCFormat(h)&&!t.pvrtc)throw new C("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ke.isASTCFormat(h)&&!t.astc)throw new C("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ke.isETC2Format(h)&&!t.etc)throw new C("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ke.isETC1Format(h)&&!t.etc1)throw new C("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ke.isBC7Format(h)&&!t.bc7)throw new C("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ke.compressedTextureSizeInBytes(h,l,u)!==n.arrayBufferView.byteLength)throw new C("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let g=t._gl,m=p?ke.compressedTextureSizeInBytes(i,l,u):ke.textureSizeInBytes(i,o,l,u);this._id=e.id??jn(),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=l,this._height=u,this._dimensions=new z(l,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,iee(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),c(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),c(n.arrayBufferView)?ke.isCompressedFormat(h)?RPe(this,n):eee(this,n):c(n.framebuffer)?LPe(this,n):tee(this,n),this._initialized=!0):nee(this),g.bindTexture(this._textureTarget,null)}function RPe(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),c(t.mipLevels)){let l=s,u=a;for(let f=0;f<t.mipLevels.length;++f)l=nL(l),u=nL(u),i.compressedTexImage2D(o,f+1,r,l,u,0,t.mipLevels[f])}}function eee(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:l,pixelDatatype:u,flipY:f}=e,h=ke.alignmentInBytes(l,u,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(f&&(p=ke.flipY(p,l,u,s,a)),i.texImage2D(o,0,r,s,a,0,l,Ue.toWebGLConstant(u,n),p),c(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=nL(g),m=nL(m),i.texImage2D(o,y+1,r,g,m,0,l,Ue.toWebGLConstant(u,n),t.mipLevels[y])}}function MPe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:l,pixelDatatype:u}=e,f=ke.alignmentInBytes(l,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=ke.flipY(t,l,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,l,Ue.toWebGLConstant(u,s),t)}function LPe(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 tee(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,Ue.toWebGLConstant(e.pixelDatatype,n),t)}function NPe(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,Ue.toWebGLConstant(e.pixelDatatype,o),t)}function nL(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function nee(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ue.toWebGLConstant(e._pixelDatatype,t),null)}pd.create=function(e){return new pd(e)};pd.fromFramebuffer=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let t=e.context,n=t._gl,{pixelFormat:i=ke.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:l}=e;if(!ke.validate(i))throw new C("Invalid pixelFormat.");if(ke.isDepthFormat(i)||ke.isCompressedFormat(i))throw new C("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(T.defined("options.context",t),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),o+s>n.drawingBufferWidth)throw new C("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>n.drawingBufferHeight)throw new C("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new pd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:c(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(pd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){iee(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 iee(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=ui.NEAREST),r.webgl2&&ke.isDepthFormat(s)&&(n=Yt.NEAREST,i=ui.NEAREST);let l=r._gl,u=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,e._texture),l.texParameteri(u,l.TEXTURE_MIN_FILTER,n),l.texParameteri(u,l.TEXTURE_MAG_FILTER,i),l.texParameteri(u,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(u,l.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&l.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(u,null)}pd.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),ke.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),T.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),T.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:l,height:u}=i;c(i.videoWidth)&&c(i.videoHeight)?(l=i.videoWidth,u=i.videoHeight):c(i.naturalWidth)&&c(i.naturalHeight)&&(l=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&l===this._width&&u===this._height?(c(i.arrayBufferView)?eee(this,i):tee(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),nee(this)),this._initialized=!0),f||(c(i.arrayBufferView)?MPe(this,i.arrayBufferView,t,n,l,u):NPe(this,i,t,n)),s.bindTexture(a,null)};pd.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height,ke.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Ue.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ke.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),T.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),T.typeOf.number.lessThanOrEquals("yOffset + height",t+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};pd.prototype.generateMipmap=function(e){if(e=e??hd.DONT_CARE,ke.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new C("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!O.isPowerOfTwo(this._width))throw new C("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!O.isPowerOfTwo(this._height))throw new C("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!hd.validate(e))throw new C("hint is invalid.");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)};pd.prototype.isDestroyed=function(){return!1};pd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),de(this)};var Rt=pd;function V0(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(V0.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});V0.prototype.getTexture=function(e){let t=this._textures[e];if(c(t))return delete this._texturesToRelease[e],++t.count,t.texture};V0.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};V0.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={}};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return de(this)};var iL=V0;function Qu(e){this.planes=e??[]}var lw=[new d,new d,new d];d.clone(d.UNIT_X,lw[0]);d.clone(d.UNIT_Y,lw[1]);d.clone(d.UNIT_Z,lw[2]);var W_=new d,FPe=new d,oee=new sn(new d(1,0,0),0);Qu.fromBoundingSphere=function(e,t){if(!c(e))throw new C("boundingSphere is required.");c(t)||(t=new Qu);let n=lw.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 l=lw[a],u=i[s],f=i[s+1];c(u)||(u=i[s]=new se),c(f)||(f=i[s+1]=new se),d.multiplyByScalar(l,-r,W_),d.add(o,W_,W_),u.x=l.x,u.y=l.y,u.z=l.z,u.w=-d.dot(l,W_),d.multiplyByScalar(l,r,W_),d.add(o,W_,W_),f.x=-l.x,f.y=-l.y,f.z=-l.z,f.w=-d.dot(d.negate(l,FPe),W_),s+=2}return t};Qu.prototype.computeVisibility=function(e){if(!c(e))throw new C("boundingVolume is required.");let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(sn.fromCartesian4(t[i],oee));if(r===Wt.OUTSIDE)return Wt.OUTSIDE;r===Wt.INTERSECTING&&(n=!0)}return n?Wt.INTERSECTING:Wt.INSIDE};Qu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!c(e))throw new C("boundingVolume is required.");if(!c(t))throw new C("parentPlaneMask is required.");if(t===Qu.MASK_OUTSIDE||t===Qu.MASK_INSIDE)return t;let n=Qu.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))continue;let a=e.intersectPlane(sn.fromCartesian4(i[o],oee));if(a===Wt.OUTSIDE)return Qu.MASK_OUTSIDE;a===Wt.INTERSECTING&&(n|=s)}return n};Qu.MASK_OUTSIDE=4294967295;Qu.MASK_INSIDE=0;Qu.MASK_INDETERMINATE=2147483647;var ys=Qu;function Oh(e){e=e??W.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ys,this._orthographicMatrix=new F}function ree(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new C("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new C("right must be greater than left.");if(e.bottom>e.top)throw new C("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new C("near must be greater than zero and less than 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=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(Oh.prototype,{projectionMatrix:{get:function(){return ree(this),this._orthographicMatrix}}});var BPe=new d,kPe=new d,UPe=new d,A6=new d;Oh.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new C("position is required.");if(!c(t))throw new C("direction is required.");if(!c(n))throw new C("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,BPe);d.normalize(f,f);let h=kPe;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=UPe;d.multiplyByScalar(f,a,p),d.add(h,p,p);let g=i[0];return c(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-d.dot(f,p),d.multiplyByScalar(f,s,p),d.add(h,p,p),g=i[1],c(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-d.dot(d.negate(f,A6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),g=i[2],c(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),g=i[3],c(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-d.dot(d.negate(n,A6),p),g=i[4],c(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),g=i[5],c(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-d.dot(d.negate(t,A6),p),this._cullingVolume};Oh.prototype.getPixelDimensions=function(e,t,n,i,o){if(ree(this),!c(e)||!c(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!c(n))throw new C("distance is required.");if(!c(i))throw new C("pixelRatio is required.");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!c(o))throw new C("A result object is required.");let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,l=i*s/t;return o.x=a,o.y=l,o};Oh.prototype.clone=function(e){return c(e)||(e=new Oh),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};Oh.prototype.equals=function(e){return c(e)&&e instanceof Oh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Oh.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof Oh&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var jo=Oh;function fl(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new jo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}fl.packedLength=4;fl.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};fl.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new fl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function q_(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new C("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new C("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new C("near must be greater than zero and less than 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(fl.prototype,{projectionMatrix:{get:function(){return q_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return q_(this),this._offCenterFrustum}}});fl.prototype.computeCullingVolume=function(e,t,n){return q_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};fl.prototype.getPixelDimensions=function(e,t,n,i,o){return q_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};fl.prototype.clone=function(e){return c(e)||(e=new fl),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};fl.prototype.equals=function(e){return!c(e)||!(e instanceof fl)?!1:(q_(this),q_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};fl.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof fl)?!1:(q_(this),q_(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var on=fl;var C6={};function VPe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var zPe=32.184,HPe=2451545;function See(e,t){t=Q.addSeconds(e,zPe,t);let n=Q.totalDays(t)-HPe;return t=Q.addSeconds(t,VPe(n),t),t}var oL=new Q(2451545,0,Wn.TAI),GPe=1e3,Ju=O.RADIANS_PER_DEGREE,$l=O.RADIANS_PER_ARCSECOND,Ca=14959787e4,see=new J;function wee(e,t,n,i,o,r,s){if(n<0&&(n=-n,o+=O.PI),n<0||n>O.PI)throw new C("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let a=e*(1-t),l=i-o,u=o,f=WPe(r-i,t);if(jPe(t,0)==="Hyperbolic"&&Math.abs(O.negativePiToPi(f))>=Math.acos(-1/t))throw new C("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");KPe(l,n,u,see);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g;if(y<=O.Epsilon10)throw new C("elements cannot be converted to cartesian");let b=p/y;return c(s)?(s.x=b*g,s.y=b*m,s.z=0):s=new d(b*g,b*m,0),J.multiplyByVector(see,s,s)}function jPe(e,t){if(e<0)throw new C("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function WPe(e,t){if(t<0||t>=1)throw new C("eccentricity out of range.");let n=YPe(e,t);return XPe(n,t)}var aee=50,qPe=O.EPSILON8;function YPe(e,t){if(t<0||t>=1)throw new C("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.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<aee&&Math.abs(o-i)>qPe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}if(r>=aee)throw new C("Kepler equation did not converge");return o=i+n*O.TWO_PI,o}function XPe(e,t){if(t<0||t>=1)throw new C("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=O.zeroToTwoPi(r),e<0&&(r-=O.TWO_PI),r+=n*O.TWO_PI,r}function KPe(e,t,n,i){if(t<0||t>O.PI)throw new C("inclination out of range");let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),l=Math.cos(n),u=Math.sin(n);return c(i)?(i[0]=l*o-u*r*s,i[1]=u*o+l*r*s,i[2]=r*a,i[3]=-l*r-u*o*s,i[4]=-u*r+l*o*s,i[5]=o*a,i[6]=u*a,i[7]=-l*a,i[8]=s):i=new J(l*o-u*r*s,-l*r-u*o*s,u*a,u*o+l*r*s,-u*r+l*o*s,-l*a,r*a,o*a,s),i}var $Pe=1.0000010178*Ca,ZPe=100.46645683*Ju,QPe=129597742283429e-5*$l,cee=16002,lee=21863,uee=32004,fee=10931,dee=14529,hee=16368,mee=15318,pee=32794,JPe=64*1e-7*Ca,eIe=-152*1e-7*Ca,tIe=62*1e-7*Ca,nIe=-8*1e-7*Ca,iIe=32*1e-7*Ca,oIe=-41*1e-7*Ca,rIe=19*1e-7*Ca,sIe=-11*1e-7*Ca,aIe=-150*1e-7*Ca,cIe=-46*1e-7*Ca,lIe=68*1e-7*Ca,uIe=54*1e-7*Ca,fIe=14*1e-7*Ca,dIe=24*1e-7*Ca,hIe=-28*1e-7*Ca,mIe=22*1e-7*Ca,_ee=10,gee=16002,yee=21863,bee=10931,xee=1473,Tee=32004,Aee=4387,Cee=73,pIe=-325*1e-7,_Ie=-322*1e-7,gIe=-79*1e-7,yIe=232*1e-7,bIe=-52*1e-7,xIe=97*1e-7,TIe=55*1e-7,AIe=-41*1e-7,CIe=-105*1e-7,EIe=-137*1e-7,SIe=258*1e-7,wIe=35*1e-7,vIe=-116*1e-7,DIe=-88*1e-7,PIe=-112*1e-7,IIe=-80*1e-7,IT=new Q(0,0,Wn.TAI);function OIe(e,t){See(e,IT);let i=(IT.dayNumber-oL.dayNumber+(IT.secondsOfDay-oL.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=$Pe+JPe*Math.cos(cee*o)+aIe*Math.sin(cee*o)+eIe*Math.cos(lee*o)+cIe*Math.sin(lee*o)+tIe*Math.cos(uee*o)+lIe*Math.sin(uee*o)+nIe*Math.cos(fee*o)+uIe*Math.sin(fee*o)+iIe*Math.cos(dee*o)+fIe*Math.sin(dee*o)+oIe*Math.cos(hee*o)+dIe*Math.sin(hee*o)+rIe*Math.cos(mee*o)+hIe*Math.sin(mee*o)+sIe*Math.cos(pee*o)+mIe*Math.sin(pee*o),s=ZPe+QPe*i+pIe*Math.cos(_ee*o)+CIe*Math.sin(_ee*o)+_Ie*Math.cos(gee*o)+EIe*Math.sin(gee*o)+gIe*Math.cos(yee*o)+SIe*Math.sin(yee*o)+yIe*Math.cos(bee*o)+wIe*Math.sin(bee*o)+bIe*Math.cos(xee*o)+vIe*Math.sin(xee*o)+xIe*Math.cos(Tee*o)+DIe*Math.sin(Tee*o)+TIe*Math.cos(Aee*o)+PIe*Math.sin(Aee*o)+AIe*Math.cos(Cee*o)+IIe*Math.sin(Cee*o),a=.0167086342-.0004203654*i,l=102.93734808*Ju+11612.3529*$l*i,u=469.97289*$l*i,f=174.87317577*Ju-8679.27034*$l*i;return wee(r,a,u,l,f,s,t)}function vee(e,t){See(e,IT);let i=(IT.dayNumber-oL.dayNumber+(IT.secondsOfDay-oL.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,l=.055545526-16e-9*i,u=5.15668983*Ju,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Ju,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Ju,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Ju,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,x=297.85019547*Ju+$l*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),A=93.27209062*Ju+$l*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),E=134.96340251*Ju+$l*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Ju+$l*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Ju-$l*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),P=2*x,M=4*x,R=6*x,L=2*E,B=3*E,_=4*E,w=2*A;a+=3400.4*Math.cos(P)-635.6*Math.cos(P-E)-235.6*Math.cos(E)+218.1*Math.cos(P-S)+181*Math.cos(P+E),l+=.014216*Math.cos(P-E)+.008551*Math.cos(P-L)-.001383*Math.cos(E)+.001356*Math.cos(P+E)-.001147*Math.cos(M-B)-914e-6*Math.cos(M-L)+869e-6*Math.cos(P-S-E)-627e-6*Math.cos(P)-394e-6*Math.cos(M-_)+282e-6*Math.cos(P-S-L)-279e-6*Math.cos(x-E)-236e-6*Math.cos(L)+231e-6*Math.cos(M)+229e-6*Math.cos(R-_)-201e-6*Math.cos(L-w),f+=486.26*Math.cos(P-w)-40.13*Math.cos(P)+37.51*Math.cos(w)+25.73*Math.cos(L-w)+19.97*Math.cos(P-S-w),p+=-55609*Math.sin(P-E)-34711*Math.sin(P-L)-9792*Math.sin(E)+9385*Math.sin(M-B)+7505*Math.sin(M-L)+5318*Math.sin(P+E)+3484*Math.sin(M-_)-3417*Math.sin(P-S-E)-2530*Math.sin(R-_)-2376*Math.sin(P)-2075*Math.sin(P-B)-1883*Math.sin(L)-1736*Math.sin(R-5*E)+1626*Math.sin(S)-1370*Math.sin(R-B),m+=-5392*Math.sin(P-w)-540*Math.sin(S)-441*Math.sin(P)+423*Math.sin(w)-288*Math.sin(L-w),b+=-3332.9*Math.sin(P)+1197.4*Math.sin(P-E)-662.5*Math.sin(S)+396.3*Math.sin(E)-218*Math.sin(P-S);let D=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(P-w+v)*i+.614*Math.cos(P-w-v)*i-.0297*Math.cos(D)*o-.0335*Math.cos(v)*o+.0012*Math.cos(P-w+D)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(D)*r;let N=2.116*Math.sin(v)*i-.111*Math.sin(P-w-v)*i-.0015*Math.sin(v)*o;p+=N,b+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(P-w+v)*i+1.12*Math.sin(P-v)*i-1.06*Math.sin(w-v)*i+.66*Math.sin(D)*o+.371*Math.sin(v)*o-.035*Math.sin(P-w+D)*o-.015*Math.sin(P-w+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(D)*r,a*=GPe;let k=u+f*$l,H=h+p*$l,V=y+b*$l,j=g+m*$l;return wee(a,l,k,H,j,V,t)}var Eee=.012300034,RIe=Eee/(Eee+1)*-1;function MIe(e,t){return t=vee(e,t),d.multiplyByScalar(t,RIe,t)}var Dee=new J(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),uw=new d;C6.computeSunPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),c(t)||(t=new d),uw=OIe(e,uw),t=d.negate(uw,t),MIe(e,uw),d.subtract(t,uw,t),J.multiplyByVector(Dee,t,t),t};C6.computeMoonPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),t=vee(e,t),J.multiplyByVector(Dee,t,t),t};var z0=C6;var rL={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};rL.getMorphTime=function(e){return e===rL.SCENE3D?1:e===rL.MORPHING?void 0:0};var oe=Object.freeze(rL);function LIe(e){e=e??W.EMPTY_OBJECT,this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??2}var Y_=LIe;function OT(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new z,this._currentFrustum=new z,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=J.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new J,this._viewRotation=new J,this._inverseViewRotation=new J,this._viewRotation3D=new J,this._inverseViewRotation3D=new J,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new J,this._normal3DDirty=!0,this._normal3D=new J,this._inverseNormalDirty=!0,this._inverseNormal=new J,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new J,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Hn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new z,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new z,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new G,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 d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,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(OT.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 Iee(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Iee(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.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,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),J.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return S6(this),this._view3D}},viewRotation:{get:function(){return S6(this),this._viewRotation}},viewRotation3D:{get:function(){return S6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Mee(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Mee(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return WIe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return qIe(this),this._modelView}},modelView3D:{get:function(){return YIe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return JIe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return XIe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return KIe(this),this._inverseModelView3D}},viewProjection:{get:function(){return $Ie(this),this._viewProjection}},inverseViewProjection:{get:function(){return ZIe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return QIe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return eOe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return tOe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return nOe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return iOe(this),this._normal}},normal3D:{get:function(){return oOe(this),this._normal3D}},inverseNormal:{get:function(){return rOe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return sOe(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 Ree(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Ree(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 this._ellipsoid??ie.default}}});function NIe(e,t){F.clone(t,e._view),F.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 FIe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function BIe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function kIe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Pee=new d,UIe=new F;function VIe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(c(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,Pee)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Pee)),e._encodedCameraPositionMCDirty=!0,!c(i))return;e._eyeEllipsoidNormalEC=J.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ot.eastNorthUpToFixedFrame(i,n,UIe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),O.equalsEpsilon(n._radii.x,n._radii.y,O.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var E6=new J,zIe=new he;function HIe(e,t){Ot.computeIcrfToCentralBodyFixedMatrix(t.time,E6);let n=z0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);J.multiplyByVector(E6,n,n),d.normalize(n,e._sunDirectionWC),n=J.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=z0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),J.multiplyByVector(E6,n,n),J.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,zIe);i.project(r,e._sunPositionColumbusView)}OT.prototype.updateCamera=function(e){NIe(this,e.viewMatrix),FIe(this,e.inverseViewMatrix),VIe(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 on};OT.prototype.updateFrustum=function(e){BIe(this,e.projectionMatrix),c(e.infiniteProjectionMatrix)&&kIe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=O.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;c(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};OT.prototype.updatePass=function(e){this._pass=e};var GIe=[],jIe=new Y_;OT.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),HIe(this,e);let n=e.light??jIe;n instanceof Y_?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=J.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=c(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??GIe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let l=e.atmosphere;c(l)&&(this._atmosphereHsbShift=d.fromElements(l.hueShift,l.saturationShift,l.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=l.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(l.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=l.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(l.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=l.mieScaleHeight,this._atmosphereMieAnisotropy=l.mieAnisotropy,this._atmosphereDynamicLighting=l.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ot.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;c(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,G.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Iee(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function WIe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function qIe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function YIe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function XIe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function KIe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function $Ie(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function ZIe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function QIe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function JIe(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 eOe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function tOe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function nOe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function iOe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),J.transpose(t,t)}}function oOe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),J.transpose(t,t)}}function rOe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),J.transpose(t,t)}}function sOe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),J.transpose(t,t)}}var Oee=new d;function Ree(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Oee),Hn.fromCartesian(Oee,e._encodedCameraPositionMC))}var aOe=new d,cOe=new d,lOe=new d,uOe=new d,fOe=new he,dOe=new d,hOe=new F;function mOe(e,t,n,i,o,r,s,a){let l=aOe;l.x=e.y,l.y=e.z,l.z=e.x;let u=cOe;u.x=n.y,u.y=n.z,u.z=n.x;let f=lOe;f.x=i.y,f.y=i.z,f.z=i.x;let h=uOe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(l.z=o*.5);let p=s.unproject(l,fOe);p.longitude=O.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=O.clamp(p.latitude,-O.PI_OVER_TWO,O.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,dOe),y=Ot.eastNorthUpToFixedFrame(m,g,hOe);return F.multiplyByPointAsVector(y,u,u),F.multiplyByPointAsVector(y,f,f),F.multiplyByPointAsVector(y,h,h),c(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,m),a[13]=-d.dot(f,m),a[14]=d.dot(h,m),a[15]=1,a}function S6(e){e._view3DDirty&&(e._mode===oe.SCENE3D?F.clone(e._view,e._view3D):mOe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Mee(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var sL=OT;function ef(e,t){T.defined("canvas",e);let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let s=c(n)?n(e,o):pOe(e,o,i),l=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=l,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new tL(this),this._textureCache=new iL;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),ut._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ut._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),ut._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),ut._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),ut._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),ut._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),ut._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),ut._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),ut._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ut._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),ut._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);ut._minimumAliasedLineWidth=f[0],ut._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);ut._minimumAliasedPointSize=h[0],ut._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);ut._maximumViewportWidth=p[0],ut._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);ut._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);ut._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!_r(u,["OES_standard_derivatives"]),this._blendMinmax=!!_r(u,["EXT_blend_minmax"]),this._elementIndexUint=!!_r(u,["OES_element_index_uint"]),this._depthTexture=!!_r(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!_r(u,["EXT_frag_depth"]),this._debugShaders=_r(u,["WEBGL_debug_shaders"]),this._textureFloat=!!_r(u,["OES_texture_float"]),this._textureHalfFloat=!!_r(u,["OES_texture_half_float"]),this._textureFloatLinear=!!_r(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!_r(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!_r(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!_r(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!_r(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!_r(u,["EXT_color_buffer_half_float"]),this._s3tc=!!_r(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!_r(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!_r(u,["WEBGL_compressed_texture_astc"]),this._etc=!!_r(u,["WEBG_compressed_texture_etc"]),this._etc1=!!_r(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!_r(u,["EXT_texture_compression_bptc"]),Xl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?_r(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,ut._maximumTextureFilterAnisotropy=c(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,A,E,S,v,P,M,R,L;if(l){let D=this;b=function(){return D._gl.createVertexArray()},x=function(I){D._gl.bindVertexArray(I)},A=function(I){D._gl.deleteVertexArray(I)},E=function(I,N,k,H,V){u.drawElementsInstanced(I,N,k,H,V)},S=function(I,N,k,H){u.drawArraysInstanced(I,N,k,H)},v=function(I,N){u.vertexAttribDivisor(I,N)},P=function(I){u.drawBuffers(I)}}else M=_r(u,["OES_vertex_array_object"]),c(M)&&(b=function(){return M.createVertexArrayOES()},x=function(D){M.bindVertexArrayOES(D)},A=function(D){M.deleteVertexArrayOES(D)}),R=_r(u,["ANGLE_instanced_arrays"]),c(R)&&(E=function(D,I,N,k,H){R.drawElementsInstancedANGLE(D,I,N,k,H)},S=function(D,I,N,k){R.drawArraysInstancedANGLE(D,I,N,k)},v=function(D,I){R.vertexAttribDivisorANGLE(D,I)}),L=_r(u,["WEBGL_draw_buffers"]),c(L)&&(P=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=A,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=P,this._vertexArrayObject=!!M,this._instancedArrays=!!R,this._drawBuffers=!!L,ut._maximumDrawBuffers=this.drawBuffers?u.getParameter(ne.MAX_DRAW_BUFFERS):1,ut._maximumColorAttachments=this.drawBuffers?u.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new G(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let B=new sL,_=new Cc(this),w=ze.fromCache();this._defaultPassState=_,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=B,this._currentRenderState=w,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D<ut._maximumVertexAttributes;D++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},ze.apply(u,w,_)}function pOe(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(!c(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function _Oe(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 gOe(e,t,n,i){let o=`${_Oe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function yOe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(gOe(e,t,n,i))}function bOe(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 xOe(e,t){if(!c(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,bOe(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 TOe={};Object.defineProperties(ef.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=xOe(this._originalGLContext,e?yOe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Rt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,0])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Rt({context:this,pixelFormat:ke.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 Rt({context:this,pixelFormat:ke.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 Go({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 TOe}}});function AOe(e){if(e.validateFramebuffer){let t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let i;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";break}throw new C(i)}}}function Lee(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var w6;typeof WebGLRenderingContext<"u"&&(w6=[ne.BACK]);function v6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=w6;if(c(t))t._bind(),AOe(e),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var COe=new ti;ef.prototype.clear=function(e,t){e=e??COe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;c(o)&&(G.equals(this._clearColor,o)||(G.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),c(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),c(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;Lee(this,a,t,!0);let l=e.framebuffer??t.framebuffer;v6(this,l),n.clear(i)};function EOe(e,t,n,i,o){if(c(t)&&o.depthTest&&o.depthTest.enabled&&!t.hasDepthAttachment)throw new C("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");v6(e,t),Lee(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function SOe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,l=t.instanceCount;if(!Me.validate(o))throw new C("drawCommand.primitiveType is required and must be valid.");if(T.defined("drawCommand.vertexArray",r),T.typeOf.number.greaterThanOrEquals("drawCommand.offset",s,0),c(a)&&T.typeOf.number.greaterThanOrEquals("drawCommand.count",a,0),T.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new C("Instanced arrays extension is not supported");e._us.model=t._modelMatrix??F.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;c(u)?(s=s*u.bytesPerIndex,c(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,l===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,l)):(c(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,l===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,l)),r._unBind()}ef.prototype.draw=function(e,t,n,i){T.defined("drawCommand",e),T.defined("drawCommand.shaderProgram",e._shaderProgram),t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,EOe(this,o,t,n,r),SOe(this,e,n,i)};ef.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=w6;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)};ef.prototype.readPixels=function(e){let t=this._gl;e=e??W.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??t.drawingBufferWidth,r=e.height??t.drawingBufferHeight,s=e.framebuffer;T.typeOf.number.greaterThan("readState.width",o,0),T.typeOf.number.greaterThan("readState.height",r,0);let a=Ue.UNSIGNED_BYTE;c(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let l=ke.createTypedArray(ke.RGBA,a,o,r);return v6(this,s),t.readPixels(n,i,o,r,ke.RGBA,Ue.toWebGLConstant(a,this),l),l};var Nee={position:0,textureCoordinates:1};ef.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!c(e)){let t=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:Nee,bufferUsage:Be.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};ef.prototype.createViewportQuadCommand=function(e,t){return t=t??W.EMPTY_OBJECT,new Je({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:en.fromCache({context:this,vertexShaderSource:xT,fragmentShaderSource:e,attributeLocations:Nee}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};ef.prototype.getObjectByPickColor=function(e){return T.defined("pickColor",e),this._pickObjects[e.toRgba()]};function D6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(D6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});D6.prototype.destroy=function(){delete this._pickObjects[this.key]};ef.prototype.createPickId=function(e){T.defined("object",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 D6(this._pickObjects,t,G.fromRgba(t))};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];c(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(),de(this)};var aL=ef;function RT(e){e=e??W.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:l}=e;if(T.defined("options.context",t),T.defined("options.width",n),T.defined("options.height",i),this._width=n,this._height=i,c(o)!==c(r))throw new C("Both color renderbuffer and texture attachments must be provided.");if(c(s)!==c(a))throw new C("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Wr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:l}),this._colorFramebuffer=new Wr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:l})}RT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};RT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};RT.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),c(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)};RT.prototype.isDestroyed=function(){return!1};RT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),de(this)};var cL=RT;var dl={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===dl.RGBA4||e===dl.RGBA8||e===dl.RGBA16F||e===dl.RGBA32F||e===dl.RGB5_A1||e===dl.RGB565||e===dl.DEPTH_COMPONENT16||e===dl.STENCIL_INDEX8||e===dl.DEPTH_STENCIL||e===dl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?dl.RGBA32F:e===ne.HALF_FLOAT_OES?dl.RGBA16F:dl.RGBA8}},Ec=Object.freeze(dl);function fw(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let n=e.context._gl,i=ut.maximumRenderbufferSize,o=e.format??Ec.RGBA4,r=c(e.width)?e.width:n.drawingBufferWidth,s=c(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;if(!Ec.validate(o))throw new C("Invalid format.");if(T.typeOf.number.greaterThan("width",r,0),r>i)throw new C(`Width must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);if(T.typeOf.number.greaterThan("height",s,0),s>i)throw new C(`Height must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);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(fw.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});fw.prototype._getRenderbuffer=function(){return this._renderbuffer};fw.prototype.isDestroyed=function(){return!1};fw.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),de(this)};var tf=fw;function bs(e){if(e=e??W.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,!this._color&&!this._depth&&!this._depthStencil)throw new C("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new C("Cannot have both a depth and depth-stencil attachment.");this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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(bs.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}}});bs.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=c(i)&&this._pixelDatatype!==i||c(o)&&this._pixelFormat!==o,l=n===1?c(this._framebuffer):c(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!l||this._color&&!c(this._colorTextures[0])};bs.prototype.update=function(e,t,n,i,o,r){if(!c(t)||!c(n))throw new C("width and height must be defined.");if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ke.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 Rt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Qt.NEAREST}),this._numSamples>1){let a=Ec.getColorFormat(o);this._colorRenderbuffers[s]=new tf({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new tf({context:e,width:t,height:n,format:Ec.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new tf({context:e,width:t,height:n,format:Ec.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Qt.NEAREST}):this._depthRenderbuffer=new tf({context:e,width:t,height:n,format:Ec.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new cL({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})}};bs.prototype.getColorTexture=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");return this._colorTextures[e]};bs.prototype.setColorTexture=function(e,t){if(t=t??0,this._createColorAttachments)throw new C("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};bs.prototype.getColorRenderbuffer=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]};bs.prototype.setColorRenderbuffer=function(e,t){if(t=t??0,this._createColorAttachments)throw new C("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};bs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};bs.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};bs.prototype.getDepthTexture=function(){return this._depthTexture};bs.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};bs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};bs.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};bs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};bs.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthStencilTexture is called.");this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};bs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};bs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};bs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};bs.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&&c(i)&&!i.isDestroyed()&&i.destroy(),c(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&c(o)&&!o.isDestroyed()&&o.destroy(),c(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()),c(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),c(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()),c(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),c(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var pi=bs;function wOe(e,t,n){if(T.defined("context",e),T.defined("urls",t),Object.values(Go.FaceName).some(r=>!c(t[r])))throw new C("urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[we.createIfNeeded(t.positiveX).fetchImage(i),we.createIfNeeded(t.negativeX).fetchImage(i),we.createIfNeeded(t.positiveY).fetchImage(i),we.createIfNeeded(t.negativeY).fetchImage(i),we.createIfNeeded(t.positiveZ).fetchImage(i),we.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Go({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var lL=wOe;var H0={VERTEX:0,FRAGMENT:1,BOTH:2};H0.includesVertexShader=function(e){return T.typeOf.number("destination",e),e===H0.VERTEX||e===H0.BOTH};H0.includesFragmentShader=function(e){return T.typeOf.number("destination",e),e===H0.FRAGMENT||e===H0.BOTH};var ge=Object.freeze(H0);function P6(e){this.name=e,this.fields=[]}P6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};P6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var uL=P6;function I6(e){this.signature=e,this.body=[]}I6.prototype.addLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new C(`Expected lines to be a string or an array of strings, actual value was ${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}`)};I6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var fL=I6;function Sc(){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(Sc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sc.prototype.addDefine=function(e,t,n){T.typeOf.string("identifier",e),n=n??ge.BOTH;let i=e;c(t)&&(i+=` ${t.toString()}`),ge.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sc.prototype.addStruct=function(e,t,n){T.typeOf.string("structId",e),T.typeOf.string("structName",t),T.typeOf.number("destination",n),this._structs[e]=new uL(t),ge.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sc.prototype.addStructField=function(e,t,n){T.typeOf.string("structId",e),T.typeOf.string("type",t),T.typeOf.string("identifier",n),this._structs[e].addField(t,n)};Sc.prototype.addFunction=function(e,t,n){T.typeOf.string("functionName",e),T.typeOf.string("signature",t),T.typeOf.number("destination",n),this._functions[e]=new fL(t),ge.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sc.prototype.addFunctionLines=function(e,t){if(T.typeOf.string("functionName",e),typeof t!="string"&&!Array.isArray(t))throw new C(`Expected lines to be a string or an array of strings, actual value was ${t}`);this._functions[e].addLines(t)};Sc.prototype.addUniform=function(e,t,n){T.typeOf.string("type",e),T.typeOf.string("identifier",t),n=n??ge.BOTH;let i=`uniform ${e} ${t};`;ge.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sc.prototype.setPositionAttribute=function(e,t){if(T.typeOf.string("type",e),T.typeOf.string("identifier",t),c(this._positionAttributeLine))throw new C("setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()");return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sc.prototype.addAttribute=function(e,t){T.typeOf.string("type",e),T.typeOf.string("identifier",t);let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=DOe(e),i};Sc.prototype.addVarying=function(e,t,n){T.typeOf.string("type",e),T.typeOf.string("identifier",t),n=c(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Sc.prototype.addVertexLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new C(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Sc.prototype.addFragmentLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new C(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Sc.prototype.buildShaderProgram=function(e){T.typeOf.object("context",e);let t=c(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=vOe(this),i=POe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` -`),r=new He({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new He({defines:this._fragmentShaderParts.defineLines,sources:[s]});return en.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Sc.prototype.clone=function(){return We(this,!0)};function vOe(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 DOe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function POe(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 MT=Sc;function dw({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 O6({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new dw({x:n,y:n,width:e-2*n,height:t-2*n})}O6.prototype.pack=function(e,{width:t,height:n}){T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.greaterThanOrEquals("image.width",t,1),T.typeOf.number.greaterThanOrEquals("image.height",n,1);let i=this._findNode(this._root,{width:t,height:n});if(c(i))return i.index=e,i};O6.prototype._findNode=function(e,{width:t,height:n}){if(c(e)){if(!c(e.childNode1)&&!c(e.childNode2)){if(c(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 dw({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new dw({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new dw({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new dw({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 hw=O6;var Fee=16;function hl(e){e=e??W.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new z(Fee,Fee);T.typeOf.number.greaterThanOrEquals("options.borderWidthInPixels",t,0),T.typeOf.number.greaterThan("options.initialSize.x",n.x,0),T.typeOf.number.greaterThan("options.initialSize.y",n.y,0),this._pixelFormat=e.pixelFormat??ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(hl.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 c(this._texture)?this._texture.sizeInBytes:0}}});hl.prototype.computeTextureCoordinates=function(e,t){T.typeOf.number.greaterThanOrEquals("index",e,0);let n=this._texture,i=this._rectangles[e];if(c(t)||(t=new Ke),!c(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,l=i.x,u=i.y,f=this._subRegions.get(e);if(c(f)){let h=this._rectangles[f];l+=h.x,u+=h.y}return t.x=l/o,t.y=u/r,t.width=s/o,t.height=a/r,t};hl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Rt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,l=s._textureTarget,u=this._texture,f=new Wr({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(l,s._texture),f._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;g<h.length;++g){let m=i[g],y=h[g];if(!c(m)||!c(y)||c(p.get(g)))continue;let{x:b,y:x,width:A,height:E}=m;a.copyTexSubImage2D(l,0,b,x,y.x,y.y,A,E)}return a.bindTexture(l,null),s._initialized=!0,f._unBind(),f.destroy(),s};hl.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,l=this._subRegions,u=i.map((A,E)=>new Bee({index:E,image:A})).filter((A,E)=>c(A.image)&&!c(l.get(E))),f=0,h=0,p=0;for(let A=t;A<o.length;++A){let{width:E,height:S}=o[A].image;f=Math.max(f,E),h=Math.max(h,S),p+=E*S,u.push(o[A])}s=Math.max(f,s),a=Math.max(h,a),e.webgl2||(s=O.nextPowerOfTwo(s),a=O.nextPowerOfTwo(a));let g=p,m=1;for(;g/s/a>=1;)m*=2,s>a?a*=m:s*=m;u.sort(({image:A},{image:E})=>E.height*E.width-A.height*A.width);let y=new Array(this._nextIndex);for(let A of this._subRegions.keys())c(l.get(A))&&(y[A]=i[A]);let b,x=!1;for(;!x;){b=new hw({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:E,image:S}=u[A];if(!c(S))continue;let v=b.pack(E,S);if(!c(v)){s>a?a*=2:s*=2;break}y[E]=v.rectangle}x=A===u.length}this._texturePacker=b,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=jn()};hl.prototype.getImageIndex=function(e){return T.typeOf.string("id",e),this._indexById.get(e)};hl.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}),c(n)&&n(e)}catch(s){if(c(i)){i(s);return}}};function Bee({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}hl.prototype._addImage=function(e,t){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.defined("image",t),new Promise((n,i)=>{this._imagesToAddQueue.push(new Bee({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};hl.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(!c(a)){try{this._resize(e,n)}catch(l){i=l,c(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(c(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];c(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};hl.prototype.update=function(e){if(!c(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Rt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new hw({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function IOe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof we)&&(e=we.createIfNeeded(e).fetchImage()),e}hl.prototype.addImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t);let n=this._indexPromiseById.get(e);if(c(n))return n;let i=this._nextIndex++;return this._indexById.set(e,i),n=(async()=>(t=await IOe(t,e),T.defined("image",t),this.isDestroyed()||!c(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};hl.prototype.addImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t);let n=this._indexById.get(e);if(!c(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(l=>l===-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 T.typeOf.number.lessThanOrEquals("subRegion.x",t.x,s.width),T.typeOf.number.lessThanOrEquals("subRegion.x + subRegion.width",t.x+t.width,s.width),T.typeOf.number.lessThanOrEquals("subRegion.y",t.y,s.height),T.typeOf.number.lessThanOrEquals("subRegion.y + subRegion.height",t.y+t.height,s.height),o})};hl.prototype.isDestroyed=function(){return!1};hl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{c(e)&&e(-1)}),de(this)};var LT=hl;function Ms(e,t,n,i){if(T.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");let o=Ms._verifyAttributes(t);n=n??0;let r=[],s={},a,l,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}l=p.usage,a=s[l],c(a)||(a=s[l]=[]),a.push(p)}function f(h,p){return $.getSizeInBytes(p.componentDatatype)-$.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(l in s)if(s.hasOwnProperty(l)){a=s[l],a.sort(f);let h=Ms._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ms._createArrayViews(a,h)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ms._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??$.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Be.STATIC_DRAW};if(t.push(r),r.componentsPerAttribute!==1&&r.componentsPerAttribute!==2&&r.componentsPerAttribute!==3&&r.componentsPerAttribute!==4)throw new C("attribute.componentsPerAttribute must be in the range [1, 4].");let s=r.componentDatatype;if(!$.validate(s))throw new C("Attribute must have a valid componentDatatype or not specify it.");if(!Be.validate(r.usage))throw new C("Attribute must have a valid usage or not specify it.")}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;if(n[r])throw new C(`Index ${r} is used by more than one attribute.`);n[r]=!0}return t};Ms._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*$.getSizeInBytes(a.componentDatatype)}let i=n>0?$.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ms._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/$.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*$.getSizeInBytes(a)}return n};Ms.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];Ms._resize(o,this._size),Ms._appendWriters(this.writers,o)}R6(this)};Ms._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(c(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let l=0;l<a;++l)r[l]=s[l]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=$.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var OOe=[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 l=i*n;t[l]=o,t[l+1]=r,t[l+2]=s,t[l+3]=a,e.needsCommit=!0}}];Ms._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]=OOe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ms.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=ROe(this,i)||t;if(t||!c(this.va)){R6(this);let s=this.va=[],a=O.SIXTY_FOUR_KILOBYTES-4,l=c(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<l;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*a);Ms._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),s.push({va:new ni({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==l-1?a:this._size%a)})}}};function ROe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=bt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ms._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})}};Ms.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new C("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new C("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)MOe(n[i],e,t)};function MOe(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)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function R6(e){let t=e.va;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ms.prototype.isDestroyed=function(){return!1};Ms.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 R6(this),de(this)};var X_=Ms;function K_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new pe,this.setValue(e)}Object.defineProperties(K_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});K_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};K_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=c(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))}};K_.prototype.equals=function(e){return this===e||e instanceof K_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};K_.prototype.valueOf=function(){return this._value};K_.prototype.toString=function(){return String(this._value)};var Xn=K_;function LOe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];c(a)&&(a(),this[n]=void 0),r!==void 0&&(!c(r)||!c(r.getValue))&&c(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),c(r)&&c(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function NOe(e){return new Xn(e)}function FOe(e,t,n){return LOe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??NOe)}var fe=FOe;function mw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),image:fe("image"),scale:fe("scale"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),color:fe("color"),rotation:fe("rotation"),alignedAxis:fe("alignedAxis"),sizeInMeters:fe("sizeInMeters"),width:fe("width"),height:fe("height"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),imageSubRegion:fe("imageSubRegion"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});mw.prototype.clone=function(e){return c(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 mw(this)};mw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var wc=mw;function G0(){this._array=[],this._hash={}}Object.defineProperties(G0.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});G0.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return c(this._hash[e])};G0.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};G0.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return this._hash[e]};G0.prototype.remove=function(e){if(c(e)&&typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");let t=this._hash[e],n=c(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};G0.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Et=G0;function Zl(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Zl.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}}});Zl.packedLength=2;Zl.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n++]=e.near,t[n]=e.far,t};Zl.unpack=function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,c(n)||(n=new Zl),n.near=e[t++],n.far=e[t],n};Zl.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.far===t.far};Zl.clone=function(e,t){if(c(e))return c(t)||(t=new Zl),t.near=e.near,t.far=e.far,t};Zl.prototype.clone=function(e){return Zl.clone(this,e)};Zl.prototype.equals=function(e){return Zl.equals(this,e)};var Lt=Zl;function nf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}nf.clone=function(e,t){if(c(e))return c(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new nf(e.near,e.nearValue,e.far,e.farValue)};nf.packedLength=4;nf.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};nf.unpack=function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,c(n)||(n=new nf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};nf.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};nf.prototype.clone=function(e){return nf.clone(this,e)};nf.prototype.equals=function(e){return nf.equals(this,e)};var Bt=nf;var j0={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,CLIP_TO_GROUND:7},qe=Object.freeze(j0);function of(e){return e===j0.CLAMP_TO_GROUND||e===j0.CLAMP_TO_3D_TILE||e===j0.CLAMP_TO_TERRAIN}function NT(e){return e===j0.RELATIVE_TO_GROUND||e===j0.RELATIVE_TO_3D_TILE||e===j0.RELATIVE_TO_TERRAIN}var BOe={CENTER:0,LEFT:1,RIGHT:-1},xi=Object.freeze(BOe);var kOe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Fn=Object.freeze(kOe);var UOe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),lt=UOe;function _d(){C.throwInstantiationError()}Object.defineProperties(_d.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}});_d.prototype.getValue=C.throwInstantiationError;_d.prototype.equals=C.throwInstantiationError;_d.equals=function(e,t){return e===t||c(e)&&e.equals(t)};_d.arrayEquals=function(e,t){if(e===t)return!0;if(!c(e)||!c(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!_d.equals(e[i],t[i]))return!1;return!0};_d.isConstant=function(e){return!c(e)||e.isConstant};_d.getValueOrUndefined=function(e,t,n){return c(e)?e.getValue(t,n):void 0};_d.getValueOrDefault=function(e,t,n,i){return c(e)?e.getValue(t,i)??n:n};_d.getValueOrClonedDefault=function(e,t,n,i){let o;return c(e)&&(o=e.getValue(t,i)),c(o)||(o=n.clone(o)),o};var Y=_d;var VOe={LEFT:-1,NONE:0,RIGHT:1},qr=Object.freeze(VOe);var zOe=G.WHITE,HOe=d.ZERO,GOe=qe.NONE,jOe=z.ZERO,WOe=1,qOe=0,YOe=d.ZERO,XOe=xi.CENTER,KOe=Fn.CENTER,$Oe=!1,ZOe=qr.NONE,QOe=new d,JOe=new G,e1e=new d,t1e=new z,n1e=new Bt,i1e=new Bt,o1e=new Bt,r1e=new Ke,s1e=new Lt;function kee(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function $_(e,t){if(!c(e))throw new C("entityCluster is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener($_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}$_.prototype.update=function(e){if(!c(e))throw new C("time is required.");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,l,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;if(f&&(h=Y.getValueOrUndefined(s._position,e,QOe),l=Y.getValueOrUndefined(a._image,e),f=c(h)&&c(l)),!f){M6(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0),c(u)||(u=n.getBillboard(s),u.id=s,r.billboard=u,r.textureValue=void 0),u.show=f,r.textureValue!==l&&(u.image=l,r.textureValue=l),u.position=h,u.color=Y.getValueOrDefault(a._color,e,zOe,JOe),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,HOe,e1e),u.heightReference=Y.getValueOrDefault(a._heightReference,e,GOe),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,jOe,t1e),u.scale=Y.getValueOrDefault(a._scale,e,WOe),u.rotation=Y.getValueOrDefault(a._rotation,e,qOe),u.alignedAxis=Y.getValueOrDefault(a._alignedAxis,e,YOe),u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,XOe),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,KOe),u.width=Y.getValueOrUndefined(a._width,e),u.height=Y.getValueOrUndefined(a._height,e),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,n1e),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,i1e),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,o1e),u.sizeInMeters=Y.getValueOrDefault(a._sizeInMeters,e,$Oe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,s1e),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,ZOe);let p=Y.getValueOrUndefined(a._imageSubRegion,e,r1e);c(p)&&u.setImageSubRegion(u.image,p)}return!0};$_.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.billboard))return lt.FAILED;let i=n.billboard;if(i.heightReference===qe.NONE)t.center=d.clone(i.position,t.center);else{if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};$_.prototype.isDestroyed=function(){return!1};$_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return de(this)};$_.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],c(r._billboard)&&c(r._position)&&s.set(r.id,new kee(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._billboard)&&c(r._position)?s.contains(r.id)||s.set(r.id,new kee(r)):(M6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],M6(s.get(r.id),r,a),s.remove(r.id)};function M6(e,t,n){c(e)&&(e.billboard=void 0,n.removeBillboard(t))}var dL=$_;var a1e=new d;function Rh(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Rh.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new Rh({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};Rh.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundindBox",e),new Rh({minimum:e.minimum,maximum:e.maximum})};Rh.packedLength=2*d.packedLength+1;Rh.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=e._offsetAttribute??-1,t};var Vee=new d,zee=new d,Uee={minimum:Vee,maximum:zee,offsetAttribute:void 0};Rh.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Vee),o=d.unpack(e,t+d.packedLength,zee),r=e[t+d.packedLength*2];return c(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Uee.offsetAttribute=r===-1?void 0:r,new Rh(Uee))};Rh.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new hn,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 ve({componentDatatype:$.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=d.subtract(n,t,a1e),a=d.magnitude(s)*.5;if(c(e._offsetAttribute)){let l=r.length,u=e._offsetAttribute===Zt.NONE?0:1,f=new Uint8Array(l/3).fill(u);i.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ct({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var Mh=Rh;function FT(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([G.floatToByte(e),G.floatToByte(t),G.floatToByte(n),G.floatToByte(i)])}Object.defineProperties(FT.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});FT.fromColor=function(e){if(!c(e))throw new C("color is required.");return new FT(e.red,e.green,e.blue,e.alpha)};FT.toValue=function(e,t){if(!c(e))throw new C("color is required.");return c(t)?e.toBytes(t):new Uint8Array(e.toBytes())};FT.equals=function(e,t){return e===t||c(e)&&c(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 jt=FT;function pw(e,t){if(e=e??0,t=t??Number.MAX_VALUE,t<=e)throw new C("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(pw.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});pw.fromDistanceDisplayCondition=function(e){if(!c(e))throw new C("distanceDisplayCondition is required.");if(e.far<=e.near)throw new C("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new pw(e.near,e.far)};pw.toValue=function(e,t){if(!c(e))throw new C("distanceDisplayCondition is required.");return c(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=pw;function c1e(e){if(e=e??W.EMPTY_OBJECT,!c(e.geometry))throw new C("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var St=c1e;function Wo(e){e=e??W.EMPTY_OBJECT,this.start=c(e.start)?Q.clone(e.start):new Q,this.stop=c(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Wo.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var BT={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Wo.fromIso8601=function(e,t){T.typeOf.object("options",e),T.typeOf.string("options.iso8601",e.iso8601);let n=e.iso8601.split("/");if(n.length!==2)throw new C("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return c(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(BT.start=i,BT.stop=o,BT.isStartIncluded=r,BT.isStopIncluded=s,BT.data=a,new Wo(BT))};Wo.toIso8601=function(e,t){return T.typeOf.object("timeInterval",e),`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};Wo.clone=function(e,t){if(c(e))return c(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Wo(e)};Wo.equals=function(e,t,n){return e===t||c(e)&&c(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||c(n)&&n(e.data,t.data)))};Wo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||c(e)&&c(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||c(i)&&i(e.data,t.data)))};Wo.intersect=function(e,t,n,i){if(T.typeOf.object("left",e),!c(t))return Wo.clone(Wo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,l=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),u=!l&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!l&&!u)return Wo.clone(Wo.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Q.lessThan(r,a);return c(n)||(n=new Wo),n.start=l?s:o,n.isStartIncluded=f&&p||!Q.equals(s,o)&&(l&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?h:h&&g||!Q.equals(a,r)&&g,n.data=c(i)?i(e.data,t.data):e.data,n};Wo.contains=function(e,t){if(T.typeOf.object("timeInterval",e),T.typeOf.object("julianDate",t),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};Wo.prototype.clone=function(e){return Wo.clone(this,e)};Wo.prototype.equals=function(e,t){return Wo.equals(this,e,t)};Wo.prototype.equalsEpsilon=function(e,t,n){return Wo.equalsEpsilon(this,e,t,n)};Wo.prototype.toString=function(){return Wo.toIso8601(this)};Wo.EMPTY=Object.freeze(new Wo({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var Sn=Wo;var Hee=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),Gee=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),l1e=Object.freeze(new Sn({start:Hee,stop:Gee})),u1e={MINIMUM_VALUE:Hee,MAXIMUM_VALUE:Gee,MAXIMUM_INTERVAL:l1e},Ge=u1e;function _w(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(_w.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});_w.fromCartesian3=function(e){return T.defined("offset",e),new _w(e.x,e.y,e.z)};_w.toValue=function(e,t){return T.defined("offset",e),c(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Ji=_w;function hL(e){e=e??!0,this.value=hL.toValue(e)}Object.defineProperties(hL.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});hL.toValue=function(e,t){if(!c(e))throw new C("show is required.");return c(t)?(t[0]=e,t):new Uint8Array([e])};var xn=hL;var mL=`in vec3 v_positionEC; +${i}`};function O4e(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function yue(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Aue(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(yue(e,r))return r}}var M4e=["v_normalEC","v_normal"];Sa.findNormalVarying=function(e){return yue(e,"#ifdef HAS_NORMALS")?O4e(e,"HAS_NORMALS")?"v_normalEC":void 0:Aue(e,M4e)};var N4e=["v_positionEC"];Sa.findPositionVarying=function(e){return Aue(e,N4e)};var Xe=Sa;function bh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(bh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});bh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function L4e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}bh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Xe({sources:[t]})),typeof n=="string"&&(n=new Xe({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?L4e(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,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};bh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){rX(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};bh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};bh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Xe({sources:[o]})),typeof s=="string"&&(s=new Xe({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function rX(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];rX(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}bh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];rX(this,n),--this._numberOfShaders}this._shadersToRelease={}};bh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};bh.prototype.isDestroyed=function(){return!1};bh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var qB=bh;function td(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,d=$e.toInternalFormat(i,r,t),p=$e.isCompressedFormat(d),g=t._gl,m=p?$e.compressedTextureSizeInBytes(i,c,u):$e.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,Eue(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)?$e.isCompressedFormat(d)?F4e(this,n):bue(this,n):l(n.framebuffer)?k4e(this,n):xue(this,n),this._initialized=!0):Tue(this),g.bindTexture(this._textureTarget,null)}function F4e(e,t){let i=e._context._gl,r=e._textureTarget,o=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(r,0,o,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=YB(c),u=YB(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function bue(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=$e.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=$e.flipY(p,c,u,s,a)),i.texImage2D(r,0,o,s,a,0,c,ze.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=YB(g),m=YB(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function B4e(e,t,n,i,r,o){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=$e.alignmentInBytes(c,u,r);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=$e.flipY(t,c,u,r,o)),a.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ze.toWebGLConstant(u,s),t)}function k4e(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 xue(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,ze.toWebGLConstant(e.pixelDatatype,n),t)}function U4e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,r),t)}function YB(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Tue(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}td.create=function(e){return new td(e)};td.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=$e.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new td({context:t,width:o,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:s}})};Object.defineProperties(td.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Eue(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 Eue(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),o.webgl2&&$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}td.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?bue(this,i):xue(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Tue(this)),this._initialized=!0),f||(l(i.arrayBufferView)?B4e(this,i.arrayBufferView,t,n,c,u):U4e(this,i,t,n)),s.bindTexture(a,null)};td.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??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,r,o),s.bindTexture(a,null),this._initialized=!0};td.prototype.generateMipmap=function(e){e=e??yh.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)};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};td.defaultColor=z.WHITE;var Dt=td;function Sb(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Sb.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Sb.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Sb.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};Sb.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={}};Sb.prototype.isDestroyed=function(){return!1};Sb.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var XB=Sb;function nd(e){this.planes=e??[]}var tP=[new h,new h,new h];h.clone(h.UNIT_X,tP[0]);h.clone(h.UNIT_Y,tP[1]);h.clone(h.UNIT_Z,tP[2]);var D_=new h,z4e=new h,Cue=new sn(new h(1,0,0),0);function vue(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}nd.fromBoundingSphere=function(e,t){l(t)||(t=new nd);let n=tP.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=tP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,D_),h.add(r,D_,D_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,D_),h.multiplyByScalar(c,o,D_),h.add(r,D_,D_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,z4e),D_),s+=2}return t};nd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(vue(t[i],Cue));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};nd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===nd.MASK_OUTSIDE||t===nd.MASK_INSIDE)return t;let n=nd.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(vue(i[r],Cue));if(a===$t.OUTSIDE)return nd.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};nd.MASK_OUTSIDE=4294967295;nd.MASK_INSIDE=0;nd.MASK_INDETERMINATE=2147483647;var aa=nd;function Ym(e){e=e??H.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new aa,this._orthographicMatrix=new M}function Sue(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=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Ym.prototype,{projectionMatrix:{get:function(){return Sue(this),this._orthographicMatrix}}});var V4e=new h,j4e=new h,H4e=new h,oX=new h;Ym.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,V4e);h.normalize(f,f);let d=j4e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=H4e;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,oX),p),h.multiplyByScalar(n,o,p),h.add(d,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=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,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=-h.dot(h.negate(n,oX),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=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.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=-h.dot(h.negate(t,oX),p),this._cullingVolume};Ym.prototype.getPixelDimensions=function(e,t,n,i,r){Sue(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Ym.prototype.clone=function(e){return l(e)||(e=new Ym),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};Ym.prototype.equals=function(e){return l(e)&&e instanceof Ym&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ym.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ym&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Ss=Ym;function cu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Ss,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}cu.packedLength=4;cu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};cu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new cu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function R_(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(cu.prototype,{projectionMatrix:{get:function(){return R_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return R_(this),this._offCenterFrustum}}});cu.prototype.computeCullingVolume=function(e,t,n){return R_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};cu.prototype.getPixelDimensions=function(e,t,n,i,r){return R_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};cu.prototype.clone=function(e){return l(e)||(e=new cu),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};cu.prototype.equals=function(e){return!l(e)||!(e instanceof cu)?!1:(R_(this),R_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};cu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof cu)?!1:(R_(this),R_(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var _n=cu;var sX={};function G4e(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var W4e=32.184,q4e=2451545;function Wue(e,t){t=K.addSeconds(e,W4e,t);let n=K.totalDays(t)-q4e;return t=K.addSeconds(t,G4e(n),t),t}var KB=new K(2451545,0,ai.TAI),Y4e=1e3,id=P.RADIANS_PER_DEGREE,rf=P.RADIANS_PER_ARCSECOND,_c=14959787e4,wue=new $;function que(e,t,n,i,r,o,s){n<0&&(n=-n,r+=P.PI);let a=e*(1-t),c=i-r,u=r,f=K4e(o-i,t),d=X4e(t,0);e8e(c,n,u,wue);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(s)?(s.x=A*g,s.y=A*m,s.z=0):s=new h(A*g,A*m,0),$.multiplyByVector(wue,s,s)}function X4e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function K4e(e,t){let n=Z4e(e,t);return Q4e(n,t)}var $4e=50,J4e=P.EPSILON8;function Z4e(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<$4e&&Math.abs(r-i)>J4e;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*P.TWO_PI,r}function Q4e(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=P.zeroToTwoPi(o),e<0&&(o-=P.TWO_PI),o+=n*P.TWO_PI,o}function e8e(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var t8e=1.0000010178*_c,n8e=100.46645683*id,i8e=129597742283429e-5*rf,Iue=16002,Pue=21863,Due=32004,Rue=10931,Oue=14529,Mue=16368,Nue=15318,Lue=32794,r8e=64*1e-7*_c,o8e=-152*1e-7*_c,s8e=62*1e-7*_c,a8e=-8*1e-7*_c,c8e=32*1e-7*_c,l8e=-41*1e-7*_c,u8e=19*1e-7*_c,f8e=-11*1e-7*_c,d8e=-150*1e-7*_c,h8e=-46*1e-7*_c,m8e=68*1e-7*_c,p8e=54*1e-7*_c,g8e=14*1e-7*_c,_8e=24*1e-7*_c,y8e=-28*1e-7*_c,A8e=22*1e-7*_c,Fue=10,Bue=16002,kue=21863,Uue=10931,zue=1473,Vue=32004,jue=4387,Hue=73,b8e=-325*1e-7,x8e=-322*1e-7,T8e=-79*1e-7,E8e=232*1e-7,C8e=-52*1e-7,v8e=97*1e-7,S8e=55*1e-7,w8e=-41*1e-7,I8e=-105*1e-7,P8e=-137*1e-7,D8e=258*1e-7,R8e=35*1e-7,O8e=-116*1e-7,M8e=-88*1e-7,N8e=-112*1e-7,L8e=-80*1e-7,VE=new K(0,0,ai.TAI);function F8e(e,t){Wue(e,VE);let i=(VE.dayNumber-KB.dayNumber+(VE.secondsOfDay-KB.secondsOfDay)/Un.SECONDS_PER_DAY)/(Un.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=t8e+r8e*Math.cos(Iue*r)+d8e*Math.sin(Iue*r)+o8e*Math.cos(Pue*r)+h8e*Math.sin(Pue*r)+s8e*Math.cos(Due*r)+m8e*Math.sin(Due*r)+a8e*Math.cos(Rue*r)+p8e*Math.sin(Rue*r)+c8e*Math.cos(Oue*r)+g8e*Math.sin(Oue*r)+l8e*Math.cos(Mue*r)+_8e*Math.sin(Mue*r)+u8e*Math.cos(Nue*r)+y8e*Math.sin(Nue*r)+f8e*Math.cos(Lue*r)+A8e*Math.sin(Lue*r),s=n8e+i8e*i+b8e*Math.cos(Fue*r)+I8e*Math.sin(Fue*r)+x8e*Math.cos(Bue*r)+P8e*Math.sin(Bue*r)+T8e*Math.cos(kue*r)+D8e*Math.sin(kue*r)+E8e*Math.cos(Uue*r)+R8e*Math.sin(Uue*r)+C8e*Math.cos(zue*r)+O8e*Math.sin(zue*r)+v8e*Math.cos(Vue*r)+M8e*Math.sin(Vue*r)+S8e*Math.cos(jue*r)+N8e*Math.sin(jue*r)+w8e*Math.cos(Hue*r)+L8e*Math.sin(Hue*r),a=.0167086342-.0004203654*i,c=102.93734808*id+11612.3529*rf*i,u=469.97289*rf*i,f=174.87317577*id-8679.27034*rf*i;return que(o,a,u,c,f,s,t)}function Yue(e,t){Wue(e,VE);let i=(VE.dayNumber-KB.dayNumber+(VE.secondsOfDay-KB.secondsOfDay)/Un.SECONDS_PER_DAY)/Un.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*id,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*id,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*id,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*id,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*id+rf*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*id+rf*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*id+rf*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*id+rf*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*id-rf*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),S=2*b,I=4*b,R=6*b,O=2*T,L=3*T,_=4*T,C=2*x;a+=3400.4*Math.cos(S)-635.6*Math.cos(S-T)-235.6*Math.cos(T)+218.1*Math.cos(S-E)+181*Math.cos(S+T),c+=.014216*Math.cos(S-T)+.008551*Math.cos(S-O)-.001383*Math.cos(T)+.001356*Math.cos(S+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-O)+869e-6*Math.cos(S-E-T)-627e-6*Math.cos(S)-394e-6*Math.cos(I-_)+282e-6*Math.cos(S-E-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-C),f+=486.26*Math.cos(S-C)-40.13*Math.cos(S)+37.51*Math.cos(C)+25.73*Math.cos(O-C)+19.97*Math.cos(S-E-C),p+=-55609*Math.sin(S-T)-34711*Math.sin(S-O)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-O)+5318*Math.sin(S+T)+3484*Math.sin(I-_)-3417*Math.sin(S-E-T)-2530*Math.sin(R-_)-2376*Math.sin(S)-2075*Math.sin(S-L)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(E)-1370*Math.sin(R-L),m+=-5392*Math.sin(S-C)-540*Math.sin(E)-441*Math.sin(S)+423*Math.sin(C)-288*Math.sin(O-C),A+=-3332.9*Math.sin(S)+1197.4*Math.sin(S-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(S-E);let w=2*v,D=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(S-C+v)*i+.614*Math.cos(S-C-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(S-C+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(D)*o+4e-5*Math.cos(w)*o;let N=2.116*Math.sin(v)*i-.111*Math.sin(S-C-v)*i-.0015*Math.sin(v)*r;p+=N,A+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(S-C+v)*i+1.12*Math.sin(S-v)*i-1.06*Math.sin(C-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(S-C+w)*r-.015*Math.sin(S-C+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(D)*o-9e-4*Math.sin(w)*o,a*=Y4e;let F=u+f*rf,V=d+p*rf,B=y+A*rf,j=g+m*rf;return que(a,c,F,V,j,B,t)}var Gue=.012300034,B8e=Gue/(Gue+1)*-1;function k8e(e,t){return t=Yue(e,t),h.multiplyByScalar(t,B8e,t)}var Xue=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),nP=new h;sX.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),nP=F8e(e,nP),t=h.negate(nP,t),k8e(e,nP),h.subtract(t,nP,t),$.multiplyByVector(Xue,t,t),t};sX.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=Yue(e,t),$.multiplyByVector(Xue,t,t),t};var wb=sX;var iP={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};iP.getMorphTime=function(e){return e===iP.SCENE3D?1:e===iP.MORPHING?void 0:0};Object.freeze(iP);var re=iP;function U8e(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var O_=U8e;function jE(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,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 Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new U,this._eyeToEnu=new $,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,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 h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,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(jE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.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 Jue(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Jue(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.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,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return cX(this),this._view3D}},viewRotation:{get:function(){return cX(this),this._viewRotation}},viewRotation3D:{get:function(){return cX(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return efe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return efe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return $8e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return J8e(this),this._modelView}},modelView3D:{get:function(){return Z8e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return rje(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return Q8e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return eje(this),this._inverseModelView3D}},viewProjection:{get:function(){return tje(this),this._viewProjection}},inverseViewProjection:{get:function(){return nje(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return ije(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return oje(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return sje(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return aje(this),this._modelViewInfiniteProjection}},normal:{get:function(){return cje(this),this._normal}},normal3D:{get:function(){return lje(this),this._normal3D}},inverseNormal:{get:function(){return uje(this),this._inverseNormal}},inverseNormal3D:{get:function(){return fje(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}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},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 Que(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Que(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 this._ellipsoid??ee.default}}});function z8e(e,t){M.clone(t,e._view),M.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 V8e(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function j8e(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function H8e(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Kue=new h,G8e=new M,$ue=new $;function W8e(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeCartographic=h.fromElements(r.longitude,r.latitude,r.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,Kue)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Kue)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,G8e);e._enuToModel=M.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu);let s=M.getRotation(o,$ue),a=$.multiply(e._viewRotation,s,$ue);e._eyeToEnu=$.transpose(a,e._eyeToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var aX=new $,q8e=new he;function Y8e(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,aX);let n=wb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(aX,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=wb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(aX,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,q8e);i.project(o,e._sunPositionColumbusView)}jE.prototype.updateCamera=function(e){z8e(this,e.viewMatrix),V8e(this,e.inverseViewMatrix),W8e(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof _n};jE.prototype.updateFrustum=function(e){j8e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&H8e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.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};jE.prototype.updatePass=function(e){this._pass=e};var X8e=[],K8e=new O_;jE.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===re.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),Y8e(this,e);let n=e.light??K8e;n instanceof O_?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??X8e,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=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.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=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Jue(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function $8e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function J8e(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function Z8e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function Q8e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function eje(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function tje(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function nje(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function ije(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function rje(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 oje(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function sje(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function aje(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function cje(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function lje(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function uje(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function fje(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Zue=new h;function Que(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Zue),Sn.fromCartesian(Zue,e._encodedCameraPositionMC))}var dje=new h,hje=new h,mje=new h,pje=new h,gje=new he,_je=new h,yje=new M;function Aje(e,t,n,i,r,o,s,a){let c=dje;c.x=e.y,c.y=e.z,c.z=e.x;let u=hje;u.x=n.y,u.y=n.z,u.z=n.x;let f=mje;f.x=i.y,f.y=i.z,f.z=i.x;let d=pje;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,gje);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,_je),y=At.eastNorthUpToFixedFrame(m,g,yje);return M.multiplyByPointAsVector(y,u,u),M.multiplyByPointAsVector(y,f,f),M.multiplyByPointAsVector(y,d,d),l(a)||(a=new M),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function cX(e){e._view3DDirty&&(e._mode===re.SCENE3D?M.clone(e._view,e._view3D):Aje(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function efe(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var $B=jE;function lu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0,transparentDefaultTexture:s=!1}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):bje(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new qB(this),this._textureCache=new XB,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),Ut._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ut._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),Ut._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),Ut._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),Ut._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),Ut._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),Ut._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),Ut._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),Ut._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),Ut._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ut._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),Ut._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);Ut._minimumAliasedLineWidth=d[0],Ut._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);Ut._minimumAliasedPointSize=p[0],Ut._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);Ut._maximumViewportWidth=g[0],Ut._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);Ut._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);Ut._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!Go(f,["OES_standard_derivatives"]),this._blendMinmax=!!Go(f,["EXT_blend_minmax"]),this._elementIndexUint=!!Go(f,["OES_element_index_uint"]),this._depthTexture=!!Go(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Go(f,["EXT_frag_depth"]),this._debugShaders=Go(f,["WEBGL_debug_shaders"]),this._textureFloat=!!Go(f,["OES_texture_float"]),this._textureHalfFloat=!!Go(f,["OES_texture_half_float"]),this._textureFloatLinear=!!Go(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Go(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Go(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Go(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Go(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Go(f,["EXT_color_buffer_half_float"]),this._s3tc=!!Go(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Go(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Go(f,["WEBGL_compressed_texture_astc"]),this._etc=!!Go(f,["WEBG_compressed_texture_etc"]),this._etc1=!!Go(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Go(f,["EXT_texture_compression_bptc"]),tf.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?Go(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,Ut._maximumTextureFilterAnisotropy=l(A)?f.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,E,v,S,I,R,O,L;if(u){let D=this;b=function(){return D._gl.createVertexArray()},x=function(N){D._gl.bindVertexArray(N)},T=function(N){D._gl.deleteVertexArray(N)},E=function(N,F,V,B,j){f.drawElementsInstanced(N,F,V,B,j)},v=function(N,F,V,B){f.drawArraysInstanced(N,F,V,B)},S=function(N,F){f.vertexAttribDivisor(N,F)},I=function(N){f.drawBuffers(N)}}else R=Go(f,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(D){R.bindVertexArrayOES(D)},T=function(D){R.deleteVertexArrayOES(D)}),O=Go(f,["ANGLE_instanced_arrays"]),l(O)&&(E=function(D,N,F,V,B){O.drawElementsInstancedANGLE(D,N,F,V,B)},v=function(D,N,F,V){O.drawArraysInstancedANGLE(D,N,F,V)},S=function(D,N){O.vertexAttribDivisorANGLE(D,N)}),L=Go(f,["WEBGL_draw_buffers"]),l(L)&&(I=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=v,this.glVertexAttribDivisor=S,this.glDrawBuffers=I,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,Ut._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,Ut._maximumColorAttachments=this.drawBuffers?f.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let _=new $B,C=new gc(this),w=Ge.fromCache();this._defaultPassState=C,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=_,this._currentRenderState=w,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D<Ut._maximumVertexAttributes;D++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o,transparentDefaultTexture:s},this.cache={},Ge.apply(f,w,C)}function bje(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function xje(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 Tje(e,t,n,i){let r=`${xje(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function Eje(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(Tje(e,t,n,i))}function Cje(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 vje(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,Cje(e,r,t))}return i}function Go(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var Sje={};Object.defineProperties(lu.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=vje(this._originalGLContext,e?Eje:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Dt.defaultColor;this._defaultTexture=new Dt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Dt({context:this,pixelFormat:$e.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 Dt({context:this,pixelFormat:$e.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 ls({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 Sje}}});function tfe(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ge.partialApply(e._gl,r,t,o,n,i)}var lX;typeof WebGLRenderingContext<"u"&&(lX=[te.BACK]);function JB(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=lX;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var wje=new fi;lu.prototype.clear=function(e,t){e=e??wje,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;tfe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;JB(this,c),n.clear(i)};function Ije(e,t,n,i,r){JB(e,t),tfe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Pje(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,o.numberOfVertices):a=o.numberOfVertices,c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}lu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,Ije(this,r,t,n,o),Pje(this,e,n,i)};lu.prototype.beginFrame=function(){};lu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=lX;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)};lu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:$e.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return JB(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};lu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=$e.createTypedArray(c,a,r,o);return JB(this,s),t.readPixels(n,i,r,o,$e.RGBA,ze.toWebGLConstant(a,this),u),u};var nfe={position:0,textureCoordinates:1};lu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new wt({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Oe.TRIANGLES});e=Vn.fromGeometry({context:this,geometry:t,attributeLocations:nfe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};lu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:OE,fragmentShaderSource:e,attributeLocations:nfe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};lu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};lu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new uL(this._pickObjects,t,z.fromRgba(t))};lu.prototype.isDestroyed=function(){return!1};lu.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(),ue(this)};var HE=lu;function GE(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))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 vs({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new vs({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}GE.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};GE.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};GE.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)};GE.prototype.isDestroyed=function(){return!1};GE.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var ZB=GE;var vl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===vl.RGBA4||e===vl.RGBA8||e===vl.RGBA16F||e===vl.RGBA32F||e===vl.RGB5_A1||e===vl.RGB565||e===vl.DEPTH_COMPONENT16||e===vl.STENCIL_INDEX8||e===vl.DEPTH_STENCIL||e===vl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?vl.RGBA32F:e===te.HALF_FLOAT_OES?vl.RGBA16F:vl.RGBA8}};Object.freeze(vl);var uu=vl;function rP(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumRenderbufferSize,r=e.format??uu.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(rP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});rP.prototype._getRenderbuffer=function(){return this._renderbuffer};rP.prototype.isDestroyed=function(){return!1};rP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var rd=rP;function ca(e){e=e??H.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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(ca.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}}});ca.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};ca.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ze.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??$e.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Dt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:Ht.NEAREST}),this._numSamples>1){let a=uu.getColorFormat(r);this._colorRenderbuffers[s]=new rd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new rd({context:e,width:t,height:n,format:uu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new rd({context:e,width:t,height:n,format:uu.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:$e.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:Ht.NEAREST}):this._depthRenderbuffer=new rd({context:e,width:t,height:n,format:uu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new ZB({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 vs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ca.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};ca.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ca.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};ca.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ca.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ca.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ca.prototype.getDepthTexture=function(){return this._depthTexture};ca.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ca.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ca.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ca.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ca.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ca.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ca.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ca.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ca.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 r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.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 ci=ca;function Dje(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new ls({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var QB=Dje;var M_={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};M_.includesVertexShader=function(e){return(e&M_.VERTEX)!==0};M_.includesFragmentShader=function(e){return(e&M_.FRAGMENT)!==0};M_.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};M_.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(M_);var de=M_;function uX(e){this.name=e,this.fields=[]}uX.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};uX.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var e2=uX;function fX(e){this.signature=e,this.body=[]}fX.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}`)};fX.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var t2=fX;function Rje(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Zn=Rje;function Sl(){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(Sl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sl.prototype.addDefine=function(e,t,n){n=n??de.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),de.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sl.prototype.addStruct=function(e,t,n){this._structs[e]=new e2(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Sl.prototype.addFunction=function(e,t,n){this._functions[e]=new t2(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Sl.prototype.addUniform=function(e,t,n){n=n??de.BOTH;let i=`uniform ${e} ${t};`;de.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sl.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+=Mje(e),i};Sl.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}`)};Sl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Sl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Sl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=Oje(this),i=Nje(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +`),o=new Xe({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` +`),a=new Xe({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Sl.prototype.clone=function(){return Ze(this,!0)};function Oje(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}function Mje(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Nje(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}var N_=Sl;function n2(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new HE(this._canvas,Ze(e?.contextOptions)),this._canvases=[]}n2.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return s;default:return Reflect.get(c,u,f)}}})};n2.prototype.destroy=function(){this._context.destroy(),ue(this)};n2.prototype.isDestroyed=function(){return!1};var i2=n2;function Ib(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Ib.create=function(e){return new Ib(e)};Ib.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){return this._gl.deleteSync(this._sync),ue(this)};Ib.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,s){return()=>{n.getStatus()===te.SIGNALED?r():s<=0?o(new oe("Wait for signal timeout")):e(i(r,o,s-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var r2=Ib;function L_(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,p=$e.toInternalFormat(i,r,t),g=$e.isCompressedFormat(p),m=t._gl,y=$e.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,ofe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");ife(this,n),this._initialized=!0}else rfe(this);m.bindTexture(this._textureTarget,null)}function ife(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=$e.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,s,a,c),i.texSubImage3D(r,0,0,0,0,s,a,c,u,ze.toWebGLConstant(f,n),g),m>1){let y=s,A=a,b=c;for(let x=0;x<t.mipLevels.length;++x)y=dX(y),A=dX(A),b=dX(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}L_.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(ife(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),rfe(this)),this._initialized=!0),d||Lje(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function Lje(e,t,n,i,r,o,s,a){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=$e.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,s,a,f,ze.toWebGLConstant(d,c),t)}function dX(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function rfe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}L_.create=function(e){return new L_(e)};Object.defineProperties(L_.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){ofe(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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function ofe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}L_.prototype.generateMipmap=function(e){e=e??yh.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)};L_.prototype.isDestroyed=function(){return!1};L_.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var o2=L_;function oP({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function hX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new oP({x:n,y:n,width:e-2*n,height:t-2*n})}hX.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};hX.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,r=i.width,o=i.height,s=r-t,a=o-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new oP({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new oP({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new oP({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new oP({x:i.x,y:i.y+n+c,width:r,height:u})),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 sP=hX;var sfe=16;function wl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(sfe,sfe);this._pixelFormat=e.pixelFormat??$e.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(wl.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}}});wl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=s/r,t.height=a/o,t};wl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,s=new Dt({context:e,height:n,width:t,pixelFormat:r,sampler:o}),a=e._gl,c=s._textureTarget,u=this._texture,f=new vs({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;a.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};wl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,s=o.width,a=o.height,c=this._subRegions,u=i.map((A,b)=>new afe({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(s=P.nextPowerOfTwo(Math.max(f,s)),a=P.nextPowerOfTwo(Math.max(d,a));p>=s*a;)s>a?a*=2:s*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new sP({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){s>a?a*=2:s*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,s,a,g),o.destroy(),this._rectangles=g,this._guid=Kn()};wl.prototype.getImageIndex=function(e){return this._indexById.get(e)};wl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function afe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}wl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new afe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};wl.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 r=t[n],{image:o,index:s}=r,a=this._texturePacker.pack(s,o);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};wl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new sP({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function Fje(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}wl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let a=await Fje(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(o,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};wl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(a=>a===-1?-1:r):r};wl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let s=this._rectangles[o];return i}))};wl.prototype.isDestroyed=function(){return!1};wl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var WE=wl;function wa(e,t,n,i){let r=wa._verifyAttributes(t);n=n??0;let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=wa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:wa._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}wa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Me.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};wa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Y.getSizeInBytes(a.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};wa._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Y.getSizeInBytes(a)}return n};wa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];wa._resize(r,this._size),wa._appendWriters(this.writers,r)}mX(this)};wa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=Y.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var Bje=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];wa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=Bje[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};wa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=kje(this,i)||t;if(t||!l(this.va)){mX(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);wa._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new Vn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function kje(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}wa._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[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})}};wa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)Uje(n[i],e,t)};function Uje(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}wa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function mX(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}wa.prototype.isDestroyed=function(){return!1};wa.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 mX(this),ue(this)};var F_=wa;var pX=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new ji(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=P.toDegrees(t.west),r=P.toDegrees(t.south),o=P.toDegrees(t.east),s=P.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new ie(i,r,o,s)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,s=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=o.width/s,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/a,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=r.height/s,u=t.longitude;r.east<r.west&&(u+=P.TWO_PI);let f=(u-r.west)/a|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=s&&(d=s-1),l(i)?(i.x=f,i.y=d,i):new U(f,d)}},ir=pX;var cfe=new h,lfe=new h,ufe=new he,gX=new h,zje=new h,ffe=new le,Vje=new ir,aP=[new he,new he,new he,new he],cP=new U,ws={};ws.initialize=function(){let e=ws._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){ws._terrainHeights=t}),ws._initPromise=e),e};ws.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=dfe(e),i=ws._defaultMinTerrainHeight,r=ws._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=ws._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,ufe),cfe),t.cartographicToCartesian(ie.southwest(e,ufe),lfe),h.midpoint(lfe,cfe,gX);let a=t.scaleToGeodeticSurface(gX,zje);if(l(a)){let c=h.distance(gX,a);i=Math.min(i,-c)}else i=ws._defaultMinTerrainHeight}return i=Math.max(ws._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};ws.getBoundingSphere=function(e,t){t=t??ee.default;let n=dfe(e),i=ws._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=ws._terrainHeights[o];l(s)&&(i=s[1])}let r=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,ffe),le.union(r,ffe,r)};function dfe(e){he.fromRadians(e.east,e.north,0,aP[0]),he.fromRadians(e.west,e.north,0,aP[1]),he.fromRadians(e.east,e.south,0,aP[2]),he.fromRadians(e.west,e.south,0,aP[3]);let t=0,n=0,i=0,r=0,o=ws._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=aP[c];if(Vje.positionToTileXY(u,s,cP),c===0)i=cP.x,r=cP.y;else if(i!==cP.x||r!==cP.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}ws._terrainHeightsMaxLevel=6;ws._defaultMaxTerrainHeight=9e3;ws._defaultMinTerrainHeight=-1e5;ws._terrainHeights=void 0;ws._initPromise=void 0;Object.defineProperties(ws,{initialized:{get:function(){return l(ws._terrainHeights)}}});var Ni=ws;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function hfe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function jje(e){if(Array.isArray(e))return e}function Hje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function Gje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wje(e,t){return jje(e)||Hje(e,t)||qje(e,t)||Gje()}function qje(e,t){if(e){if(typeof e=="string")return hfe(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hfe(e,t):void 0}}var Ife=Object.entries,mfe=Object.setPrototypeOf,Yje=Object.isFrozen,Xje=Object.getPrototypeOf,Kje=Object.getOwnPropertyDescriptor,Ia=Object.freeze,Xa=Object.seal,qE=Object.create,Pfe=typeof Reflect<"u"&&Reflect,EX=Pfe.apply,CX=Pfe.construct;Ia||(Ia=function(t){return t});Xa||(Xa=function(t){return t});EX||(EX=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});CX||(CX=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var Db=la(Array.prototype.forEach),$je=la(Array.prototype.lastIndexOf),pfe=la(Array.prototype.pop),lP=la(Array.prototype.push),Jje=la(Array.prototype.splice),YE=Array.isArray,dP=la(String.prototype.toLowerCase),_X=la(String.prototype.toString),gfe=la(String.prototype.match),uP=la(String.prototype.replace),_fe=la(String.prototype.indexOf),Zje=la(String.prototype.trim),Qje=la(Number.prototype.toString),e6e=la(Boolean.prototype.toString),yfe=typeof BigInt>"u"?null:la(BigInt.prototype.toString),Afe=typeof Symbol>"u"?null:la(Symbol.prototype.toString),fu=la(Object.prototype.hasOwnProperty),fP=la(Object.prototype.toString),Vc=la(RegExp.prototype.test),Pb=t6e(TypeError);function la(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return EX(e,t,i)}}function t6e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return CX(e,n)}}function Er(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dP;if(mfe&&mfe(e,null),!YE(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(Yje(t)||(t[i]=o),r=o)}e[r]=!0}return e}function n6e(e){for(let t=0;t<e.length;t++)fu(e,t)||(e[t]=null);return e}function sf(e){let t=qE(null);for(let i of Ife(e)){var n=Wje(i,2);let r=n[0],o=n[1];fu(e,r)&&(YE(o)?t[r]=n6e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=sf(o):t[r]=o)}return t}function i6e(e){switch(typeof e){case"string":return e;case"number":return Qje(e);case"boolean":return e6e(e);case"bigint":return yfe?yfe(e):"0";case"symbol":return Afe?Afe(e):"Symbol()";case"undefined":return fP(e);case"function":case"object":{if(e===null)return fP(e);let t=e,n=xh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:fP(i)}return fP(e)}default:return fP(e)}}function xh(e,t){for(;e!==null;){let i=Kje(e,t);if(i){if(i.get)return la(i.get);if(typeof i.value=="function")return la(i.value)}e=Xje(e)}function n(){return null}return n}function r6e(e){try{return Vc(e,""),!0}catch{return!1}}var bfe=Ia(["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","search","section","select","shadow","slot","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"]),yX=Ia(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),AX=Ia(["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"]),o6e=Ia(["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"]),bX=Ia(["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"]),s6e=Ia(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xfe=Ia(["#text"]),Tfe=Ia(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),xX=Ia(["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","dominant-baseline","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","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),Efe=Ia(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),s2=Ia(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a6e=Xa(/{{[\w\W]*|^[\w\W]*}}/g),c6e=Xa(/<%[\w\W]*|^[\w\W]*%>/g),l6e=Xa(/\${[\w\W]*/g),u6e=Xa(/^data-[\-\w.\u00B7-\uFFFF]+$/),f6e=Xa(/^aria-[\-\w]+$/),Cfe=Xa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),d6e=Xa(/^(?:\w+script|data):/i),h6e=Xa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),m6e=Xa(/^html$/i),p6e=Xa(/^[a-z][.\w]*(-[.\w]+)+$/i),vfe=Xa(/<[/\w!]/g),Sfe=Xa(/<[/\w]/g),g6e=Xa(/<\/no(script|embed|frames)/i),_6e=Xa(/\/>/i),of={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Dfe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],y6e=Ia(Er({},Dfe)),A6e=(function(){let e={};return Db(Dfe,t=>{e[t]=Xa(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ia(e)})(),b6e=function(){return typeof window>"u"?null:window},x6e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},wfe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},B_=function(t,n,i,r){return fu(t,n)&&YE(t[n])?Er(r.base?sf(r.base):{},t[n],r.transform):i},TX=function(t,n,i){let r=fu(t,n)?t[n]:void 0;return r&&typeof r=="object"?sf(r):i()};function Rfe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b6e(),t=Et=>Rfe(Et);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==of.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=a.prototype,g=xh(p,"cloneNode"),m=xh(p,"remove"),y=xh(p,"nextSibling"),A=xh(p,"childNodes"),b=xh(p,"parentNode"),x=xh(p,"shadowRoot"),T=xh(p,"attributes"),E=s&&s.prototype?xh(s.prototype,"nodeType"):null,v=s&&s.prototype?xh(s.prototype,"nodeName"):null,S=s&&s.prototype?xh(s.prototype,"ownerDocument"):null,I=function(ye){return E?E(ye):ye.nodeType},R=function(ye){return v?v(ye):ye.nodeName};if(typeof o=="function"){let Et=n.createElement("template");Et.content&&Et.content.ownerDocument&&(n=Et.content.ownerDocument)}let O,L="",_,C=!1,w=0,D=function(){if(w>0)throw Pb('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},N=function(ye){D(),w++;try{return O.createHTML(ye)}finally{w--}},F=function(ye){D(),w++;try{return O.createScriptURL(ye)}finally{w--}},V=function(){return C||(_=x6e(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=wfe();t.isSupported=typeof Ife=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=a6e,Z=c6e,ae=l6e,Ae=u6e,fe=f6e,xe=d6e,ge=h6e,we=p6e,ve=Cfe,Re=null,Qe=Er({},[...bfe,...yX,...AX,...bX,...xfe]),He=null,Ye=Er({},[...Tfe,...xX,...Efe,...s2]),Ke=Object.seal(qE(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}})),Pe=null,qe=null,st=Object.seal(qE(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),vt=!0,jt=!0,lt=!1,mt=!0,ft=!1,Yt=!0,rt=!1,ht=!1,Li=null,Yn=null,gi=!1,zi=!1,Si=!1,ui=!1,_i=!0,zn=!1,tn="user-content-",Hn=!0,Ki=!1,wr={},so=null,Ts=Er({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),zs=null,$r=Er({},["audio","video","img","source","image","track"]),hi=null,ao=Er({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nr="http://www.w3.org/1998/Math/MathML",jo="http://www.w3.org/2000/svg",Fn="http://www.w3.org/1999/xhtml",Vi=Fn,Fi=!1,Ir=null,Mc=Er({},[nr,jo,Fn],_X),qf=Ia(["mi","mo","mn","ms","mtext"]),Rm=Er({},qf),ch=Ia(["annotation-xml"]),na=Er({},ch),Om=Er({},["title","style","font","a","script"]),Es=null,Ha=["application/xhtml+xml","text/html"],cb="text/html",ii=null,Wr=null,_l=n.createElement("form"),w0=function(ye){return ye instanceof RegExp||ye instanceof Function},Ca=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Wr&&Wr===ye)return;(!ye||typeof ye!="object")&&(ye={}),ye=sf(ye),Es=Ha.indexOf(ye.PARSER_MEDIA_TYPE)===-1?cb:ye.PARSER_MEDIA_TYPE,ii=Es==="application/xhtml+xml"?_X:dP,Re=B_(ye,"ALLOWED_TAGS",Qe,{transform:ii}),He=B_(ye,"ALLOWED_ATTR",Ye,{transform:ii}),Ir=B_(ye,"ALLOWED_NAMESPACES",Mc,{transform:_X}),hi=B_(ye,"ADD_URI_SAFE_ATTR",ao,{transform:ii,base:ao}),zs=B_(ye,"ADD_DATA_URI_TAGS",$r,{transform:ii,base:$r}),so=B_(ye,"FORBID_CONTENTS",Ts,{transform:ii}),Pe=B_(ye,"FORBID_TAGS",sf({}),{transform:ii}),qe=B_(ye,"FORBID_ATTR",sf({}),{transform:ii}),wr=fu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?sf(ye.USE_PROFILES):ye.USE_PROFILES:!1,vt=ye.ALLOW_ARIA_ATTR!==!1,jt=ye.ALLOW_DATA_ATTR!==!1,lt=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=ye.SAFE_FOR_TEMPLATES||!1,Yt=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,zi=ye.RETURN_DOM||!1,Si=ye.RETURN_DOM_FRAGMENT||!1,ui=ye.RETURN_TRUSTED_TYPE||!1,gi=ye.FORCE_BODY||!1,_i=ye.SANITIZE_DOM!==!1,zn=ye.SANITIZE_NAMED_PROPS||!1,Hn=ye.KEEP_CONTENT!==!1,Ki=ye.IN_PLACE||!1,ve=r6e(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:Cfe,Vi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Fn,Rm=TX(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>Er({},qf)),na=TX(ye,"HTML_INTEGRATION_POINTS",()=>Er({},ch));let Fe=TX(ye,"CUSTOM_ELEMENT_HANDLING",()=>qE(null));if(Ke=qE(null),fu(Fe,"tagNameCheck")&&w0(Fe.tagNameCheck)&&(Ke.tagNameCheck=Fe.tagNameCheck),fu(Fe,"attributeNameCheck")&&w0(Fe.attributeNameCheck)&&(Ke.attributeNameCheck=Fe.attributeNameCheck),fu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),Xa(Ke),ft&&(jt=!1),Si&&(zi=!0),wr&&(Re=Er({},xfe),He=qE(null),wr.html===!0&&(Er(Re,bfe),Er(He,Tfe)),wr.svg===!0&&(Er(Re,yX),Er(He,xX),Er(He,s2)),wr.svgFilters===!0&&(Er(Re,AX),Er(He,xX),Er(He,s2)),wr.mathMl===!0&&(Er(Re,bX),Er(He,Efe),Er(He,s2))),st.tagCheck=null,st.attributeCheck=null,fu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:YE(ye.ADD_TAGS)&&(Re===Qe&&(Re=sf(Re)),Er(Re,ye.ADD_TAGS,ii))),fu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:YE(ye.ADD_ATTR)&&(He===Ye&&(He=sf(He)),Er(He,ye.ADD_ATTR,ii))),fu(ye,"ADD_FORBID_CONTENTS")&&YE(ye.ADD_FORBID_CONTENTS)&&(so===Ts&&(so=sf(so)),Er(so,ye.ADD_FORBID_CONTENTS,ii)),Hn&&(Re["#text"]=!0),rt&&Er(Re,["html","head","body"]),Re.table&&(Er(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let gt=O;O=ye.TRUSTED_TYPES_POLICY;try{L=N("")}catch(on){throw O=gt,on}}else ye.TRUSTED_TYPES_POLICY===null?(O=void 0,L=""):(O===void 0&&(O=V()),O&&typeof L=="string"&&(L=N("")));Ia&&Ia(ye),Wr=ye},Mm=Er({},[...yX,...AX,...o6e]),A_=Er({},[...bX,...s6e]),$W=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="svg":Fe.namespaceURI===nr?ye==="svg"&&(gt==="annotation-xml"||Rm[gt]):!!Mm[ye]},JW=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="math":Fe.namespaceURI===jo?ye==="math"&&na[gt]:!!A_[ye]},ZW=function(ye,Fe,gt){return Fe.namespaceURI===jo&&!na[gt]||Fe.namespaceURI===nr&&!Rm[gt]?!1:!A_[ye]&&(Om[ye]||!Mm[ye])},QW=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:Vi,tagName:"template"});let gt=dP(ye.tagName),on=dP(Fe.tagName);return Ir[ye.namespaceURI]?ye.namespaceURI===jo?$W(gt,Fe,on):ye.namespaceURI===nr?JW(gt,Fe,on):ye.namespaceURI===Fn?ZW(gt,Fe,on):!!(Es==="application/xhtml+xml"&&Ir[ye.namespaceURI]):!1},Nm=function(ye){lP(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw Pb("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},uE=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},lb=function(ye){ub(ye);let Fe=A(ye);if(Fe){let on=[];Db(Fe,wn=>{lP(on,wn)}),Db(on,wn=>{try{m(wn)}catch{}})}let gt=T(ye);if(gt)for(let on=gt.length-1;on>=0;--on){let wn=gt[on],ri=wn&&wn.name;typeof ri=="string"&&uE(ye,wn,ri)}},lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}lP(t.removed,{attribute:gt||null,from:Fe});try{gt?Fe.removeAttributeNode(gt):Fe.removeAttribute(ye)}catch{try{Fe.removeAttribute(ye)}catch{}}if(ye==="is")if(zi||Si)try{Nm(Fe)}catch{}else try{Fe.setAttribute(ye,"")}catch{}},eq=function(ye){let Fe=T(ye);if(Fe)for(let gt=Fe.length-1;gt>=0;--gt){let on=Fe[gt],wn=on&&on.name;typeof wn!="string"||He[ii(wn)]||uE(ye,on,wn)}},ub=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===of.element&&eq(gt);let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},fE=function(ye,Fe){return Yt?ye==="patchsrc"?!0:ye==="for"&&Fe!=="label"&&Fe!=="output":!1},Lm=function(ye){if(!Yt)return;let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop(),on=I(gt);if(on===of.processingInstruction||on===of.comment&&Vc(Sfe,gt.data)){try{m(gt)}catch{}continue}if(on===of.element){let ri=gt,bo=ii(R(gt));try{ri.hasAttribute&&ri.hasAttribute("patchsrc")&&ri.removeAttribute("patchsrc"),ri.hasAttribute&&ri.hasAttribute("for")&&fE("for",bo)&&ri.removeAttribute("for")}catch{}}let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},fb=function(ye){let Fe=null,gt=null;if(gi)ye="<remove></remove>"+ye;else{let ri=gfe(ye,/^[\r\n\t ]+/);gt=ri&&ri[0]}Es==="application/xhtml+xml"&&Vi===Fn&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");let on=O?N(ye):ye;if(Vi===Fn)try{Fe=new f().parseFromString(on,Es)}catch{}if(!Fe||!Fe.documentElement){Fe=j.createDocument(Vi,"template",null);try{Fe.documentElement.innerHTML=Fi?L:on}catch{}}let wn=Fe.body||Fe.documentElement;return ye&>&&wn.insertBefore(n.createTextNode(gt),wn.childNodes[0]||null),Vi===Fn?q.call(Fe,rt?"html":"body")[0]:rt?Fe.documentElement:wn},RI=function(ye){let Fe=S?S(ye):ye.ownerDocument;return k.call(Fe||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},dE=function(ye){return ye=uP(ye,J," "),ye=uP(ye,Z," "),ye=uP(ye,ae," "),ye},b_=function(ye){var Fe;ye.normalize();let gt=S?S(ye):ye.ownerDocument,on=k.call(gt||ye,ye,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),wn=on.nextNode();for(;wn;)wn.data=dE(wn.data),wn=on.nextNode();let ri=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");ri&&Db(ri,bo=>{ne(bo.content)&&b_(bo.content)})},ce=function(ye){let Fe=v?v(ye):null;return typeof Fe!="string"||ii(Fe)!=="form"?!1:typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||ye.attributes!==T(ye)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function"||ye.nodeType!==E(ye)||ye.childNodes!==A(ye)},ne=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return E(ye)===of.documentFragment}catch{return!1}},Te=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return typeof E(ye)=="number"}catch{return!1}};function Ce(Et,ye,Fe){Et.length!==0&&Db(Et,gt=>{gt.call(t,ye,Fe,Wr)})}let Je=function(ye,Fe){return!!(Yt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&Vc(vfe,ye.textContent)&&Vc(vfe,ye.innerHTML)||Yt&&ye.namespaceURI===Fn&&y6e[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&Vc(A6e[Fe],ye.textContent))||ye.nodeType===of.processingInstruction||Yt&&ye.nodeType===of.comment&&Vc(Sfe,ye.data))},Tt=function(ye,Fe){if(ye instanceof RegExp)return Vc(ye,Fe);if(ye instanceof Function){for(var gt=arguments.length,on=new Array(gt>2?gt-2:0),wn=2;wn<gt;wn++)on[wn-2]=arguments[wn];return!!ye(Fe,...on)}return!1},pt=function(ye,Fe,gt){if(!Pe[Fe]&&co(Fe)&&Tt(Ke.tagNameCheck,Fe))return!1;if(Hn&&!so[Fe]){let on=b(ye),wn=A(ye);if(wn&&on){let ri=wn.length;for(let bo=ri-1;bo>=0;--bo){let rs=ye===gt?g(wn[bo],!0):wn[bo];on.insertBefore(rs,y(ye))}}}return Nm(ye),!0},St=function(ye,Fe,gt,on){return ye.length===0?Fe:Fe===gt||Fe===on?sf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Ki&&ub(ye),!0)},Gn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(ye))return Nm(ye),!0;let gt=ii(R(ye));if(Re=St(W.uponSanitizeElement,Re,Qe,Li),Ce(W.uponSanitizeElement,ye,{tagName:gt,allowedTags:Re}),bn(ye,Fe))return!0;if(Je(ye,gt))return Nm(ye),!0;if(Pe[gt]||!(st.tagCheck instanceof Function&&st.tagCheck(gt))&&!Re[gt]){let wn=pt(ye,gt,Fe);return wn===!1&&Ce(W.afterSanitizeElements,ye,null),wn}if(I(ye)===of.element&&!QW(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&Vc(g6e,ye.innerHTML))return Nm(ye),!0;if(ft&&ye.nodeType===of.text){let wn=dE(ye.textContent);ye.textContent!==wn&&(lP(t.removed,{element:ye.cloneNode()}),ye.textContent=wn)}return Ce(W.afterSanitizeElements,ye,null),!1},mn=function(ye,Fe,gt){if(qe[Fe]||fE(Fe,ye)||_i&&(Fe==="id"||Fe==="name")&&(gt in n||gt in _l))return!1;let on=He[Fe]||st.attributeCheck instanceof Function&&st.attributeCheck(Fe,ye);return jt&&Vc(Ae,Fe)||vt&&Vc(fe,Fe)?!0:on?hi[Fe]||Vc(ve,uP(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&_fe(gt,"data:")===0&&zs[ye]||lt&&!Vc(xe,uP(gt,ge,""))?!0:!gt:co(ye)&&Tt(Ke.tagNameCheck,ye)&&Tt(Ke.attributeNameCheck,Fe,ye)||Fe==="is"&&Ke.allowCustomizedBuiltInElements&&Tt(Ke.tagNameCheck,gt)},Ao=Er({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),co=function(ye){return!Ao[dP(ye)]&&Vc(we,ye)},Vs=function(ye,Fe,gt,on){if(O&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!gt)switch(d.getAttributeType(ye,Fe)){case"TrustedHTML":return N(on);case"TrustedScriptURL":return F(on)}return on},pc=function(ye,Fe,gt,on){try{gt?ye.setAttributeNS(gt,Fe,on):ye.setAttribute(Fe,on),ce(ye)?Nm(ye):pfe(t.removed)}catch{lh(Fe,ye)}},yl=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(ye))return;He=St(W.uponSanitizeAttribute,He,Ye,Yn);let gt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0},on=Fe.length,wn=ii(ye.nodeName);for(;on--;){let ri=Fe[on],bo=ri.name,rs=ri.namespaceURI,nu=ri.value,iu=ii(bo),tq=nu,Al=bo==="value"?tq:Zje(tq);if(gt.attrName=iu,gt.attrValue=Al,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Al=gt.attrValue,zn&&(iu==="id"||iu==="name")&&_fe(Al,tn)!==0&&(lh(bo,ye,ri),Al=tn+Al),Yt&&Vc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Al)){lh(bo,ye,ri);continue}if(iu==="attributename"&&gfe(Al,"href")){lh(bo,ye,ri);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){lh(bo,ye,ri);continue}if(!mt&&Vc(_6e,Al)){lh(bo,ye,ri);continue}if(ft&&(Al=dE(Al)),!mn(wn,iu,Al)){lh(bo,ye,ri);continue}Al=Vs(wn,iu,rs,Al),Al!==tq&&pc(ye,bo,rs,Al)}}Ce(W.afterSanitizeAttributes,ye,null)},tu=function(ye){let Fe=null,gt=RI(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),Gn(Fe,ye),yl(Fe),ne(Fe.content)&&tu(Fe.content),I(Fe)===of.element){let on=x(Fe);ne(on)&&(I0(on),tu(on))}Ce(W.afterSanitizeShadowDOM,ye,null)},I0=function(ye){let Fe=[{node:ye,shadow:null}];for(;Fe.length>0;){let gt=Fe.pop();if(gt.shadow){tu(gt.shadow);continue}let on=gt.node,ri=I(on)===of.element,bo=A(on);if(bo)for(let rs=bo.length-1;rs>=0;--rs)Fe.push({node:bo[rs],shadow:null});if(ri){let rs=v?v(on):null;if(typeof rs=="string"&&ii(rs)==="template"){let nu=on.content;ne(nu)&&Fe.push({node:nu,shadow:null})}}if(ri){let rs=x(on);ne(rs)&&Fe.push({node:null,shadow:rs},{node:rs,shadow:null})}}};return t.sanitize=function(Et){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,gt=null,on=null,wn=null;if(Fi=!Et,Fi&&(Et="<!-->"),typeof Et!="string"&&!Te(Et)&&(Et=i6e(Et),typeof Et!="string"))throw Pb("dirty is not a string, aborting");if(!t.isSupported)return Et;ht?(Re=Li,He=Yn):Ca(ye),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(Re=sf(Re)),W.uponSanitizeAttribute.length>0&&(He=sf(He)),t.removed=[];let ri=Ki&&typeof Et!="string"&&Te(Et);if(ri){Lm(Et);let nu=R(Et);if(typeof nu=="string"){let iu=ii(nu);if(!Re[iu]||Pe[iu])throw lb(Et),Pb("root node is forbidden and cannot be sanitized in-place")}if(ce(Et))throw lb(Et),Pb("root node is clobbered and cannot be sanitized in-place");try{I0(Et)}catch(iu){throw lb(Et),iu}}else if(Te(Et))Fe=fb("<!---->"),gt=Fe.ownerDocument.importNode(Et,!0),gt.nodeType===of.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),I0(gt);else{if(!zi&&!ft&&!rt&&Et.indexOf("<")===-1)return O&&ui?N(Et):Et;if(Fe=fb(Et),!Fe)return zi?null:ui?L:""}Fe&&gi&&Nm(Fe.firstChild);let bo=ri?Et:Fe;try{let nu=RI(bo);for(;on=nu.nextNode();)Gn(on,bo),yl(on),ne(on.content)&&tu(on.content)}catch(nu){throw ri&&(lb(Et),Db(t.removed,iu=>{iu.element&&ub(iu.element)})),nu}if(ri)return Db(t.removed,nu=>{nu.element&&ub(nu.element)}),ft&&b_(Et),Et;if(zi){if(ft&&b_(Fe),Si)for(wn=G.call(Fe.ownerDocument);Fe.firstChild;)wn.appendChild(Fe.firstChild);else wn=Fe;return(He.shadowroot||He.shadowrootmode)&&(wn=Q.call(i,wn,!0)),wn}let rs=rt?Fe.outerHTML:Fe.innerHTML;return rt&&Re["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&Vc(m6e,Fe.ownerDocument.doctype.name)&&(rs="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> +`+rs),ft&&(rs=dE(rs)),O&&ui?N(rs):rs},t.setConfig=function(){let Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ca(Et),ht=!0,Li=Re,Yn=He},t.clearConfig=function(){Wr=null,ht=!1,Li=null,Yn=null,O=_,L=""},t.isValidAttribute=function(Et,ye,Fe){Wr||Ca({});let gt=ii(Et),on=ii(ye);return mn(gt,on,Fe)},t.addHook=function(Et,ye){typeof ye=="function"&&fu(W,Et)&&lP(W[Et],ye)},t.removeHook=function(Et,ye){if(fu(W,Et)){if(ye!==void 0){let Fe=$je(W[Et],ye);return Fe===-1?void 0:Jje(W[Et],Fe,1)[0]}return pfe(W[Et])}},t.removeHooks=function(Et){fu(W,Et)&&(W[Et]=[])},t.removeAllHooks=function(){W=wfe()},t}var Ofe=Rfe();var T6e=0,vX={},SX=class e{constructor(t,n){let i,r=t;l(vX[r])?i=vX[r]:(i=T6e++,vX[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=Ofe.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},It=SX;var Mfe={NONE:0,LERC:1};Object.freeze(Mfe);var Th=Mfe;function Ka(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Ka.fromCorners=function(e,t,n){return l(n)||(n=new Ka),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Ka.fromPoints=function(e,t){if(l(t)||(t=new Ka),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(y,r),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};Ka.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Ka(e.minimum,e.maximum,e.center)};Ka.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var a2=new h;Ka.intersectPlane=function(e,t){a2=h.subtract(e.maximum,e.minimum,a2);let n=h.multiplyByScalar(a2,.5,a2),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};Ka.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};Ka.prototype.clone=function(e){return Ka.clone(this,e)};Ka.prototype.intersectPlane=function(e){return Ka.intersectPlane(this,e)};Ka.prototype.intersectAxisAlignedBoundingBox=function(e){return Ka.intersectAxisAlignedBoundingBox(this,e)};Ka.prototype.equals=function(e){return Ka.equals(this,e)};var od=Ka;function Xm(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Xm.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=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Nfe=new h;Xm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Nfe);return IX(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Xm.prototype.isScaledSpacePointVisible=function(e){return IX(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var E6e=new h;Xm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=E6e,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),IX(e,r,i)};Xm.prototype.computeHorizonCullingPoint=function(e,t,n){return Bfe(this._ellipsoid,e,t,n)};var Lfe=ee.clone(ee.UNIT_SPHERE);Xm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Ffe(this._ellipsoid,n,Lfe);return Bfe(r,e,t,i)};Xm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return kfe(this._ellipsoid,e,t,n,i,r)};Xm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=Ffe(this._ellipsoid,r,Lfe);return kfe(s,e,t,n,i,o)};var C6e=[];Xm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,C6e),r=le.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var v6e=new h;function Ffe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,v6e);e=ee.fromCartesian3(i,n)}return e}function Bfe(e,t,n,i){l(i)||(i=new h);let r=Vfe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=Ufe(e,c,r);if(u<0)return;o=Math.max(o,u)}return zfe(r,o,i)}var c2=new h;function kfe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=Vfe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){c2.x=n[c]+r.x,c2.y=n[c+1]+r.y,c2.z=n[c+2]+r.z;let f=Ufe(e,c2,s);if(f<0)return;a=Math.max(a,f)}return zfe(s,a,o)}function IX(e,t,n){let i=t,r=n,o=h.subtract(e,i,Nfe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var S6e=new h,w6e=new h;function Ufe(e,t,n){let i=e.transformPositionToScaledSpace(t,S6e),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,w6e);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function zfe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var wX=new h;function Vfe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,wX),h.normalize(wX,wX))}var Km=Xm;var PX=new se;function $m(e,t){t=t??ee.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(M.getColumn(n,0,PX)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,PX));let i=h.fromCartesian4(M.getColumn(n,2,PX));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties($m.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 I6e=new od;$m.fromPoints=function(e,t){let n=od.fromPoints(e,I6e);return new $m(n.center,t)};var jfe=new gn,l2=new h;$m.prototype.projectPointOntoPlane=function(e,t){let n=jfe;n.origin=e,h.normalize(e,n.direction);let i=bi.rayPlane(n,this._plane,l2);if(l(i)||(h.negate(n.direction,n.direction),i=bi.rayPlane(n,this._plane,l2)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new U(o,s)}};$m.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};$m.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=jfe;n.origin=e,h.clone(this._plane.normal,n.direction);let i=bi.rayPlane(n,this._plane,l2);l(i)||(h.negate(n.direction,n.direction),i=bi.rayPlane(n,this._plane,l2));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};$m.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 P6e=new h;$m.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=P6e;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};$m.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 qs=$m;function rr(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}rr.packedLength=h.packedLength+$.packedLength;rr.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};rr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new rr),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var D6e=new h,R6e=new h,O6e=new h,M6e=new h,N6e=new h,L6e=new h,F6e=new $,B6e={unitary:new $,diagonal:new $};rr.fromPoints=function(e,t){if(l(t)||(t=new rr),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],D6e);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,R6e),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=F6e;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,B6e),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,M6e),b=$.getColumn(y,1,N6e),x=$.getColumn(y,2,L6e),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),E=Math.max(h.dot(b,p),E),v=Math.max(h.dot(x,p),v),S=Math.min(h.dot(A,p),S),I=Math.min(h.dot(b,p),I),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(S+T),A),b=h.multiplyByScalar(b,.5*(I+E),b),x=h.multiplyByScalar(x,.5*(R+v),x);let O=h.add(A,b,t.center);h.add(O,x,O);let L=O6e;return L.x=T-S,L.y=E-I,L.z=v-R,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Xfe=new h,k6e=new h;function Hfe(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new rr);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Xfe;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=k6e;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var Gfe=new he,U6e=new h,z6e=new he,V6e=new he,j6e=new he,H6e=new he,G6e=new he,W6e=new h,Wfe=new h,q6e=new h,qfe=new h,Y6e=new h,X6e=new U,K6e=new U,$6e=new U,J6e=new U,Z6e=new U,Q6e=new h,eHe=new h,tHe=new h,nHe=new h,iHe=new U,rHe=new h,oHe=new h,sHe=new h,aHe=new sn(h.UNIT_X,0);rr.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??ee.default;let o,s,a,c,u,f,d;if(e.width<=P.PI){let I=ie.center(e,Gfe),R=i.cartographicToCartesian(I,U6e),O=new qs(R,i);d=O.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,C=he.fromRadians(L,e.north,n,z6e),w=he.fromRadians(e.west,e.north,n,V6e),D=he.fromRadians(e.west,_,n,j6e),N=he.fromRadians(e.west,e.south,n,H6e),F=he.fromRadians(L,e.south,n,G6e),V=i.cartographicToCartesian(C,W6e),B=i.cartographicToCartesian(w,Wfe),j=i.cartographicToCartesian(D,q6e),k=i.cartographicToCartesian(N,qfe),G=i.cartographicToCartesian(F,Y6e),q=O.projectPointToNearestOnPlane(V,X6e),Q=O.projectPointToNearestOnPlane(B,K6e),W=O.projectPointToNearestOnPlane(j,$6e),J=O.projectPointToNearestOnPlane(k,J6e),Z=O.projectPointToNearestOnPlane(G,Z6e);return o=Math.min(Q.x,W.x,J.x),s=-o,c=Math.max(Q.y,q.y),a=Math.min(J.y,Z.y),w.height=N.height=t,B=i.cartographicToCartesian(w,Wfe),k=i.cartographicToCartesian(N,qfe),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,Hfe(O.origin,O.xAxis,O.yAxis,O.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,Gfe).longitude,A=h.fromRadians(y,m,n,i,Q6e);A.z=0;let x=Math.abs(A.x)<P.EPSILON10&&Math.abs(A.y)<P.EPSILON10?h.UNIT_X:h.normalize(A,eHe),T=h.UNIT_Z,E=h.cross(x,T,tHe);d=sn.fromPointNormal(A,x,aHe);let v=h.fromRadians(y+P.PI_OVER_TWO,m,n,i,nHe);s=h.dot(sn.projectPointOntoPlane(d,v,iHe),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,rHe).z,a=h.fromRadians(0,e.south,p?t:n,i,oHe).z;let S=h.fromRadians(e.east,m,n,i,sHe);return u=sn.getPointDistance(d,S),f=0,Hfe(A,E,T,x,o,s,a,c,u,f,r)};rr.fromTransformation=function(e,t){return l(t)||(t=new rr),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};rr.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new rr(e.center,e.halfAxes)};rr.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?$t.OUTSIDE:u>=c?$t.INSIDE:$t.INTERSECTING};var Kfe=new h,$fe=new h,Jfe=new h,cHe=new h,Yfe=new h,lHe=new h;rr.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Xfe),i=e.halfAxes,r=$.getColumn(i,0,Kfe),o=$.getColumn(i,1,$fe),s=$.getColumn(i,2,Jfe),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let E=r;m=o,y=s,d?p||(E=s,y=r):(E=o,m=r),A=h.cross(m,y,Yfe),E===r?r=A:E===o?o=A:E===s&&(s=A)}else if(g===2){m=r,d?m=o:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,P.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,cHe),h.normalize(y,y),A=h.cross(m,y,Yfe),h.normalize(A,A),m===r?(o=y,s=A):m===o?(s=y,r=A):m===s&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let b=lHe;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,s);let x=0,T;return b.x<-a?(T=b.x+a,x+=T*T):b.x>a&&(T=b.x-a,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var uHe=new h,fHe=new h;rr.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Gs);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Kfe),u=$.getColumn(a,1,$fe),f=$.getColumn(a,2,Jfe),d=h.add(c,u,uHe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,fHe),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var dHe=new h,hHe=new h,mHe=new h;rr.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,dHe),o=$.getColumn(i,1,hHe),s=$.getColumn(i,2,mHe);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var pHe=new $;rr.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,pHe);return M.fromRotationTranslation(i,n,t)};var gHe=new le;rr.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,gHe);return!t.isBoundingSphereVisible(n)};rr.prototype.intersectPlane=function(e){return rr.intersectPlane(this,e)};rr.prototype.distanceSquaredTo=function(e){return rr.distanceSquaredTo(this,e)};rr.prototype.computePlaneDistances=function(e,t,n){return rr.computePlaneDistances(this,e,t,n)};rr.prototype.computeCorners=function(e){return rr.computeCorners(this,e)};rr.prototype.computeTransformation=function(e){return rr.computeTransformation(this,e)};rr.prototype.isOccluded=function(e){return rr.isOccluded(this,e)};rr.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};rr.prototype.clone=function(e){return rr.clone(this,e)};rr.prototype.equals=function(e){return rr.equals(this,e)};var en=rr;var u2={};u2.getHeight=function(e,t,n){return(e-n)*t+n};var _He=new he;u2.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,_He);if(!l(o))return h.clone(e,r);let s=u2.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var br=u2;var Zfe={NONE:0,BITS12:1};Object.freeze(Zfe);var $a=Zfe;var hP=new h,yHe=new h,sd=new U,AHe=new M,bHe=new M,xHe=Math.pow(2,12);function yc(e,t,n,i,r,o,s,a,c,u){let f=$a.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,yHe),A=i-n;Math.max(h.maximumComponent(y),A)<xHe-1?f=$a.BITS12:f=$a.NONE;let x=M.fromScale(y,AHe);x=M.setTranslation(x,g,x);let T=M.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,hP),bHe);T=M.multiplyByTranslation(T,h.negate(g,hP),T),p=M.clone(r,new M);let E=M.getTranslation(r,hP);E=h.subtract(E,e,hP),p=M.setTranslation(p,E,p),p=M.multiply(p,x,p),d=M.inverseTransformation(r,new M),d=M.multiply(T,d,d),r=M.multiply(r,x,new M)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}yc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===$a.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,hP),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((r-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,sd);let p=cn.compressTextureCoordinates(sd);U.fromElements(n.z,d,sd);let g=cn.compressTextureCoordinates(sd);U.fromElements(c,u,sd);let m=cn.compressTextureCoordinates(sd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,sd);let y=cn.compressTextureCoordinates(sd);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=cn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var THe=new h,Qfe=new h;yc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,THe),c=n.geodeticSurfaceNormal(a,Qfe),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};yc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};yc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===$a.BITS12){let i=cn.decompressTextureCoordinates(e[t],sd);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],sd);return n.z=r.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};yc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Qfe),a=this.decodeHeight(e,t),c=br.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};yc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};yc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+1],sd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};yc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+3],sd).x:e[t+6]};yc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return U.fromElements(r,o,n)};yc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};yc.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};yc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===$a.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var f2={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},d2={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};yc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===$a.NONE){s(f2.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(f2.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(f2.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(d2.compressed0,a?4:3),c&&s(d2.compressed1,1),this.hasGeodeticSurfaceNormals&&s(d2.geodeticSurfaceNormal,3)}return o};yc.prototype.getAttributeLocations=function(){return this.quantization===$a.NONE?f2:d2};yc.clone=function(e,t){if(l(e))return l(t)||(t=new yc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.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 Eo=yc;var mP=class e{constructor(t){this._ellipsoid=t??ee.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}};mP.MaximumLatitude=mP.mercatorAngleToGeodeticLatitude(Math.PI);var xi=mP;var Jm={};Jm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var DX=new h,EHe=new M,CHe=new h,vHe=new h;Jm.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??ee.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,E,v;l(b)?(x=b.west,T=b.south,E=b.east,v=b.north):g?(x=a(A.west),T=a(A.south),E=a(A.east),v=a(A.north)):(x=A.west*y,T=s-2*r(o(-A.south*y)),E=A.east*y,v=s-2*r(o(-A.north*y)));let S=e.relativeToCenter,I=l(S);S=I?S:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=O!==1,w=e.structure??Jm.DEFAULT_STRUCTURE,D=w.heightScale??Jm.DEFAULT_STRUCTURE.heightScale,N=w.heightOffset??Jm.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??Jm.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??Jm.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??Jm.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??Jm.DEFAULT_STRUCTURE.isBigEndian,k=ie.computeWidth(A),G=ie.computeHeight(A),q=k/(u-1),Q=G/(f-1);g||(k*=y,G*=y);let W=m.radiiSquared,J=W.x,Z=W.y,ae=W.z,Ae=65536,fe=-65536,xe=At.eastNorthUpToFixedFrame(S,m),ge=M.inverseTransformation(xe,EHe),we,ve;R&&(we=xi.geodeticLatitudeToMercatorAngle(T),ve=1/(xi.geodeticLatitudeToMercatorAngle(v)-we));let Re=CHe;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=vHe;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let He=Number.POSITIVE_INFINITY,Ye=u*f,Ke=d>0?u*2+f*2:0,Pe=Ye+Ke,qe=new Array(Pe),st=new Array(Pe),vt=new Array(Pe),jt=R?new Array(Pe):[],lt=C?new Array(Pe):[],mt=0,ft=f,Yt=0,rt=u;p&&(--mt,++ft,--Yt,++rt);let ht=1e-5;for(let zn=mt;zn<ft;++zn){let tn=zn;tn<0&&(tn=0),tn>=f&&(tn=f-1);let Hn=A.north-Q*tn;g?Hn=a(Hn):Hn=s-2*r(o(-Hn*y));let Ki=(Hn-T)/(v-T);Ki=P.clamp(Ki,0,1);let wr=zn===mt,so=zn===ft-1;d>0&&(wr?Hn+=ht*G:so&&(Hn-=ht*G));let Ts=t(Hn),zs=n(Hn),$r=ae*zs,hi;R&&(hi=(xi.geodeticLatitudeToMercatorAngle(Hn)-we)*ve);for(let ao=Yt;ao<rt;++ao){let nr=ao;nr<0&&(nr=0),nr>=u&&(nr=u-1);let jo=tn*(u*V)+nr*V,Fn;if(F===1)Fn=c[jo];else{Fn=0;let Wr;if(j)for(Wr=0;Wr<F;++Wr)Fn=Fn*B+c[jo+Wr];else for(Wr=F-1;Wr>=0;--Wr)Fn=Fn*B+c[jo+Wr]}Fn=Fn*D+N,fe=Math.max(fe,Fn),Ae=Math.min(Ae,Fn);let Vi=A.west+q*nr;g?Vi=a(Vi):Vi=Vi*y;let Fi=(Vi-x)/(E-x);Fi=P.clamp(Fi,0,1);let Ir=tn*u+nr;if(d>0){let Wr=ao===Yt,_l=ao===rt-1,w0=wr||so||Wr||_l;if((wr||so)&&(Wr||_l))continue;w0&&(Fn-=d,Wr?(Ir=Ye+(f-tn-1),Vi-=ht*k):so?Ir=Ye+f+(u-nr-1):_l?(Ir=Ye+f+u+tn,Vi+=ht*k):wr&&(Ir=Ye+f+u+f+nr))}let Mc=Ts*t(Vi),qf=Ts*n(Vi),Rm=J*Mc,ch=Z*qf,Om=1/i(Rm*Mc+ch*qf+$r*zs),Es=Rm*Om,Ha=ch*Om,cb=$r*Om,ii=new h;ii.x=Es+Mc*Fn,ii.y=Ha+qf*Fn,ii.z=cb+zs*Fn,M.multiplyByPoint(ge,ii,DX),h.minimumByComponent(DX,Re,Re),h.maximumByComponent(DX,Qe,Qe),He=Math.min(He,Fn),qe[Ir]=ii,vt[Ir]=new U(Fi,Ki),st[Ir]=Fn,R&&(jt[Ir]=hi),C&&(lt[Ir]=m.geodeticSurfaceNormal(ii))}}let Li=le.fromPoints(qe),Yn;l(b)&&(Yn=en.fromRectangle(b,Ae,fe,m));let gi;I&&(gi=new Km(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let zi=new od(Re,Qe,S),Si=new Eo(S,zi,He,fe,xe,!1,R,C,O,L),ui=new Float32Array(Pe*Si.stride),_i=0;for(let zn=0;zn<Pe;++zn)_i=Si.encode(ui,_i,qe[zn],vt[zn],st[zn],void 0,jt[zn],lt[zn]);return{vertices:ui,maximumHeight:fe,minimumHeight:Ae,encoding:Si,boundingSphere3D:Li,orientedBoundingBox:Yn,occludeePointInScaledSpace:gi}};var pP=Jm;function k_(){pe.throwInstantiationError()}Object.defineProperties(k_.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});k_.prototype.interpolateHeight=pe.throwInstantiationError;k_.prototype.isChildAvailable=pe.throwInstantiationError;k_.prototype.createMesh=pe.throwInstantiationError;k_.prototype.upsample=pe.throwInstantiationError;k_.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;k_.maximumAsynchronousTasks=5;var af=k_;var SHe=3,OX=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new MX}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&PHe(this,n);let s=this._inverseTransform,a=IHe;a.origin=M.multiplyByPoint(s,t.origin,a.origin),a.direction=M.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return tde(this._rootNode,a,c),NHe(this,c,t,i,r,o)}},wHe=new $n("incrementallyBuildTerrainPicker"),MX=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=ede(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=ede(n.x,n.y,n.level),this.children[t]=n}},IHe=new gn,h2=[new h,new h,new h];function PHe(e,t){M.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var DHe=new h,RHe=new h;function ede(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,DHe),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,RHe);return od.fromCorners(r,o)}function OHe(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var MHe=new Gs;function tde(e,t,n){let i=bi.rayAxisAlignedBoundingBox(t,e.aabb,MHe);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Gs(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)tde(e.children[o],t,n)}function NHe(e,t,n,i,r,o){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=LHe(e,n,u.node,i,r,o);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function LHe(e,t,n,i,r,o){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=SHe)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=RX(a,r,o,t,u,c[3*A],h2[0]),x=RX(a,r,o,t,u,c[3*A+1],h2[1]),T=RX(a,r,o,t,u,c[3*A+2],h2[2]),E=bi.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&OHe(g,m,h2,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);BHe(e._inverseTransform,n,m,g)}return s}var FHe=new he;function RX(e,t,n,i,r,o,s){let a=e.getExaggeratedPosition(r,o,s);if(t===re.SCENE3D)return a;let u=n.ellipsoid.cartesianToCartographic(a,FHe);a=n.project(u,s),a=h.fromElements(a.z,a.x,a.y,s);let f=P.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-a.y)/f);return a.y+=d*f,a}async function BHe(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);M.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let s={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},a=[o.buffer,r.buffer,n.buffer,i.buffer],c=wHe.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var m2=OX;function gP(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new M,this._lastPickSceneMode=void 0,this._terrainPicker=new m2(t,n,p)}gP.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?kHe(this,this._transform):WHe(this,t,this._transform))};function kHe(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=br.getHeight(e.minimumHeight,n,i),o=br.getHeight(e.maximumHeight,n,i),s=en.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return en.computeTransformation(s,t),M.getScale(t,NX).z<=P.EPSILON16&&(NX.z=1,M.setScale(t,NX,t)),t}var UHe=new h,zHe=new h,VHe=new he,jHe=new he,HHe=new h,GHe=new h,NX=new h;function WHe(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=br.getHeight(e.minimumHeight,i,r),s=br.getHeight(e.maximumHeight,i,r),a=t.project(he.fromRadians(e.rectangle.west,e.rectangle.south,0,VHe),UHe),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,jHe),zHe),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,HHe),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,GHe);return M.fromTranslation(d,n),M.setScale(n,f,n),M.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}gP.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};gP.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};gP.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var Ac=gP;function Is(){pe.throwInstantiationError()}Object.defineProperties(Is.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 nde=[];Is.getRegularGridIndices=function(e,t){let n=nde[e];l(n)||(nde[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),sde(e,t,i,0)),i};var ide=[];Is.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=ide[e];l(n)||(ide[e]=n=[]);let i=n[t];if(!l(i)){let r=Is.getRegularGridIndices(e,t),o=ode(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var rde=[];Is.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=rde[e];l(n)||(rde[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=ode(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);sde(e,t,y,0),Is.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};Is.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Is.getSkirtIndexCount=function(e){return(e-4)*2*3};Is.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Is.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=p2(e,a,o,s),a+=e.length,s=p2(t,a,o,s),a+=t.length,s=p2(n,a,o,s),a+=n.length,p2(i,a,o,s)};Is.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Is.addSkirtIndices(e,t,n,i,r,o,s);let a=Is.getSkirtVertexCount(e,t,n,i),c=Is.getSkirtIndexCount(a),u=s+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,E=T+1,v=E+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=v,o[u+9]=d,o[u+10]=E,o[u+11]=y};function ode(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function sde(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function p2(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Is.heightmapTerrainQuality=.25;Is.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Is.heightmapTerrainQuality/(t*n)};Is.prototype.requestTileGeometry=pe.throwInstantiationError;Is.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Is.prototype.getTileDataAvailable=pe.throwInstantiationError;Is.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Yr=Is;function U0(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Th.NONE;let t=pP.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Th.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(U0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var ade="createVerticesFromHeightmap",qHe=new $n(ade),YHe=new $n(ade,af.maximumAsynchronousTasks);U0.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?YHe:qHe).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ji,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=Yr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Yr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new Ac(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,le.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),Eo.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};U0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ie.center(u)),d=this._structure,g=Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=pP.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ji,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Yr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Yr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new Ac(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};U0.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===Th.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=cde(A,b,f,d,e,i,r,t,n)}else y=XHe(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};U0.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,s),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,S=Math.pow(E,T-1);for(let I=0;I<u;++I){let R=P.lerp(A.north,A.south,I/(u-1));for(let O=0;O<c;++O){let L=P.lerp(A.west,A.east,O/(c-1)),_=cde(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,KHe(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new U0({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};U0.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};U0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function XHe(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let A=f-p,b=d-m;m=a-1-m,y=a-1-y;let x=g2(e,t,n,i,r,m*s+p),T=g2(e,t,n,i,r,m*s+g),E=g2(e,t,n,i,r,y*s+p),v=g2(e,t,n,i,r,y*s+g);return lde(A,b,x,T,E,v)}function cde(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-d,A=f-g;g=s-1-g,m=s-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,E=(t.decodeHeight(e,m*o+p)-n)/i;return lde(y,A,b,x,T,E)}function lde(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function g2(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function KHe(e,t,n,i,r,o,s,a){s*=r;let c;if(o)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 jc=U0;function $E(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Rb=new ie;function $He(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}$E.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)$He(e,g,p,s)||s.push(new XE(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,Rb);let a=Rb.west,c=Rb.north;o.tileXYToRectangle(i,r,e,Rb);let u=Rb.east,f=Rb.south,d=new tGe(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];LX(g.extent,d)&&nGe(this._maximumLevel,g,d)}};$E.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(KE(i.extent,e)){t=i;break}}return l(t)?_P(void 0,t,e):-1};var JHe=[],ZHe=[],QHe=new ie,eGe=new ie;$E.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=JHe;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,QHe)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,eGe))):t.push(e);let n=ZHe;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)yP(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 ude=new he;$E.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Rb);return ie.center(i,ude),this.computeMaximumLevelAtPosition(ude)>=e};$E.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function XE(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(XE.prototype,{nw:{get:function(){return this._nw||(this._nw=new XE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new XE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new XE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new XE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function tGe(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function LX(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function nGe(e,t,n){for(;t.level<e;)if(_2(t.nw.extent,n))t=t.nw;else if(_2(t.ne.extent,n))t=t.ne;else if(_2(t.sw.extent,n))t=t.sw;else if(_2(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=Pr(t.rectangles,n.level,iGe);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function iGe(e,t){return e.level-t}function _2(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function KE(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function _P(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&KE(t._nw.extent,n),s=t._ne&&KE(t._ne.extent,n),a=t._sw&&KE(t._sw.extent,n),c=t._se&&KE(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,_P(t,t._nw,n))),s&&(i=Math.max(i,_P(t,t._ne,n))),a&&(i=Math.max(i,_P(t,t._sw,n))),c&&(i=Math.max(i,_P(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];KE(a,n)&&(i=a.level)}t=t.parent}return i}function yP(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||LX(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=rGe(e[s.level],s)}yP(e,t._nw,n),yP(e,t._ne,n),yP(e,t._sw,n),yP(e,t._se,n)}function rGe(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];LX(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var Zm=$E;function oGe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` +${r}`),t}var z0=oGe;function y2(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=s}y2.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new y2(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${z0(i)}`),c};y2.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zr=y2;var FX=new he,BX=new he,fde=new h,dde=new h,kX=class{constructor(t){ut(this,"_rectangleSouthwestInMeters");ut(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new xi(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-r,-r),this._rectangleNortheastInMeters=new U(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,fde),this._projection.unproject(fde,FX),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,dde),this._projection.unproject(dde,BX),this._rectangle=new ie(FX.longitude,FX.latitude,BX.longitude,BX.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*a,u=this._rectangleSouthwestInMeters.x+(t+1)*a,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),s=this._projection,a=s.unproject(new h(o.west,o.south)),c=s.unproject(new h(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=s&&(A=s-1),l(i)?(i.x=y,i.y=A,i):new U(y,A)}},No=kX;var sGe=15;function hde(e){this.ellipsoid=e.ellipsoid??ee.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}hde.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 aGe(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new ir(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(o.xmin,o.ymin),s.rectangleNortheastInMeters=new U(o.xmax,o.ymax),e.tilingScheme=new No(s)}else throw new oe("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new oe("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Th.LERC:Th.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Zm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Zm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Yr.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 cGe(e,t,n){try{let i=await t.fetchJson();aGe(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function U_(){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(U_.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}}});U_.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new hde(t);await cGe(r,i);let o=new U_(t);return r.build(o),o._resource=n,o};U_.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(UX(this,n+1,e*2,t*2))){let d=mde(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new jc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):sGe,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===wi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=wi.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function UX(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}U_.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};U_.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=UX(this,n,e,t);if(l(i))return i;mde(this,n,e,t)};U_.prototype.loadTileDataAvailability=function(e,t,n){};function lGe(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function uGe(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=lGe(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function mde(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=uGe(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return UX(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var pde=U_;var gde={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(gde);var ln=gde;var _de=P.EPSILON10;function fGe(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,_de)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],_de)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Lr=fGe;var yde={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(yde);var Il=yde;var zX=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},zt=zX;var Ade="https://dev.virtualearth.net/REST/v1/Locations";function VX(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:Ade,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(VX.prototype,{url:{get:function(){return Ade}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});VX.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(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(a,s,u,c)}})})};var bde=VX;var dGe=new h;function Qm(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Qm.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Qm({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Qm.fromAxisAlignedBoundingBox=function(e){return new Qm({minimum:e.minimum,maximum:e.maximum})};Qm.packedLength=2*h.packedLength+1;Qm.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Tde=new h,Ede=new h,xde={minimum:Tde,maximum:Ede,offsetAttribute:void 0};Qm.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Tde),r=h.unpack(e,t+h.packedLength,Ede),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(xde.offsetAttribute=o===-1?void 0:o,new Qm(xde))};Qm.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new En,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,dGe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===pn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new wt({attributes:i,indices:r,primitiveType:Oe.LINES,boundingSphere:new le(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var ep=Qm;function jX(){}Object.defineProperties(jX.prototype,{credit:{get:function(){}}});jX.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],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.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(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var Cde=jX;function JE(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}JE.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};JE.prototype.evaluate=pe.throwInstantiationError;JE.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=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 r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};JE.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};JE.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var Rr=JE;function ZE(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Rr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ZE.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ZE.prototype.findTimeInterval=Rr.prototype.findTimeInterval;ZE.prototype.wrapTime=Rr.prototype.wrapTime;ZE.prototype.clampTime=Rr.prototype.clampTime;ZE.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var Ob=ZE;var vde={};vde.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var AP=vde;var Sde=[],wde=[],Ide=[],Pde=[];function hGe(e,t,n){let i=Sde,r=Ide,o=wde,s=Pde;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),AP.solve(i,o,r,s)}function mGe(e){let t=Sde,n=Ide,i=wde,r=Pde;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),AP.solve(t,i,n,r)}function du(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Rr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(du.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}}});du.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new du({times:t,points:n,inTangents:o,outTangents:r})};du.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new Ob({points:n,times:t});let i=mGe(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new du({times:t,points:n,inTangents:o,outTangents:r})};du.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Rr.getPointType(n[0]);if(n.length<3)return new Ob({points:n,times:t});let s=hGe(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new du({times:t,points:n,inTangents:c,outTangents:a})};du.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);du.prototype.findTimeInterval=Rr.prototype.findTimeInterval;var pGe=new se,QE=new h;du.prototype.wrapTime=Rr.prototype.wrapTime;du.prototype.clampTime=Rr.prototype.clampTime;du.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=pGe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(du.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,QE),d.add(t,QE,t),d.multiplyByScalar(o[s],f.z,QE),d.add(t,QE,t),d.multiplyByScalar(r[s],f.w,QE),d.add(t,QE,t))};var Mb=du;var gGe=new se,Dde=new h,eC=new h;function _Ge(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=gGe;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,Dde),h.multiplyByScalar(d,.5,d),p=M.multiplyByVector(Mb.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],Dde),h.multiplyByScalar(f,.5,f),p=M.multiplyByVector(Mb.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=M.multiplyByVector(z_.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,eC),h.add(r,eC,r),h.multiplyByScalar(f,p.z,eC),h.add(r,eC,r),h.multiplyByScalar(d,p.w,eC),h.add(r,eC,r)}}var yGe=new h,AGe=new h;function z_(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=yGe,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=AGe,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=_Ge(this),this._lastTimeIndex=0}Object.defineProperties(z_.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}}});z_.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);z_.prototype.findTimeInterval=Rr.prototype.findTimeInterval;z_.prototype.wrapTime=Rr.prototype.wrapTime;z_.prototype.clampTime=Rr.prototype.clampTime;z_.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Rde=z_;var Zln=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo: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;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb: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:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,x),A&&A(x,x,m.length,y);var S=g(T,x,m.length,y);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(y);new Uint8Array(I.buffer).set(E.subarray(T,T+y*4)),v.set(E.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=I[m[R]];return[I,S]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),T),g(x,T,y,A),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(E.subarray(x,x+y*4)),b(x-b(0)),v}function u(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(m),S=E(A*b),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),S);var R=g(v,m,S,A,b,x,T),O=new Uint8Array(R);return O.set(I.subarray(v,v+R)),E(v-E(0)),O}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(y*A),S=E(y*x),I=new Uint8Array(n.exports.memory.buffer);I.set(s(m),S),g(v,y,A,b,S,T);var R=new Uint8Array(y*A);return R.set(I.subarray(v,v+y*A)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var V_=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalav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CXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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 r=WebAssembly.validate(n)?a(t):a(e),o,s=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function a(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var E=b.charCodeAt(T);x[T]=E>96?E-97:E>64?E-39:E+4}for(var v=0,T=0;T<b.length;++T)x[v++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(b,x,T,E,v,S,I){var R=b.exports.sbrk,O=E+3&-4,L=R(O*v),_=R(S.length),C=new Uint8Array(b.exports.memory.buffer);C.set(S,_);var w=x(L,E,v,_,S.length);if(w==0&&I&&I(L,O,v),T.set(C.subarray(L,L+E*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var E=T.data;x.pending-=E.count,x.requests[E.id][E.action](E.value),delete x.requests[E.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),E=URL.createObjectURL(T),v=d.length;v<b;++v)d[v]=g(E);for(var v=b;v<d.length;++v)d[v].object.postMessage({});d.length=b,URL.revokeObjectURL(E)}function y(b,x,T,E,v){for(var S=d[0],I=1;I<d.length;++I)d[I].pending<S.pending&&(S=d[I]);return new Promise(function(R,O){var L=new Uint8Array(T),_=++p;S.pending+=b,S.requests[_]={resolve:R,reject:O},S.object.postMessage({id:_,count:b,size:x,source:L,mode:E,filter:v},[L.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var E=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],E,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,E,v){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,E,o.exports[u[v]])},decodeIndexBuffer:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,E)},decodeIndexSequence:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,E)},decodeGltfBuffer:function(b,x,T,E,v,S){c(o,o.exports[f[v]],b,x,T,E,o.exports[u[S]])},decodeGltfBufferAsync:function(b,x,T,E,v){return d.length>0?y(b,x,T,f[E],u[v]):s.then(function(){var S=new Uint8Array(b*x);return c(o,o.exports[f[E]],S,b,x,T,o.exports[u[v]]),S})}}})();var tun=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecby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ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJbbjZaIaOa8Fcdtfydbc8S2fgeIdyg81:va81Jbbbb9BEaeIdwa8NaKcx2fgHIdwg81NaeIdzaHIdbg80NaeIdaMgBaBMMa81NaeIdlaHIdlgBNaeIdCa81NaeId3Mg81a81MMaBNaeIdba80NaeIdxaBNaeIdKMg81a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kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aec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CaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgA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xdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),E=0;E<x.length;++E){var v=x.charCodeAt(E);T[E]=v>96?v-97:v>64?v-39:v+4}for(var S=0,E=0;E<x.length;++E)T[S++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,S)}function o(x){if(!x)throw new Error("Assertion failed")}function s(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function a(x,T,E,v){var S=n.exports.sbrk,I=S(E*4),R=S(E*v*4),O=new Uint8Array(n.exports.memory.buffer);O.set(s(T),R),x(I,R,E,v*4),O=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(O.subarray(I,I+E*4)),S(I-S(0)),L}function c(x,T,E){var v=n.exports.sbrk,S=v(T.length*4),I=v(E*4),R=new Uint8Array(n.exports.memory.buffer),O=s(T);R.set(O,S);var L=x(I,S,T.length,E);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(R.subarray(I,I+E*4)),v(S-v(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(x){for(var T=0,E=0;E<x.length;++E){var v=x[E];T=T<v?v:T}return T}function f(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),D=_(S*I),N=_(E*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(v),D),F.set(s(T),N);var V=x(w,N,E,D,S,I,R,O,L,C);F=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(V);s(B).set(F.subarray(w,w+V*4));var j=new Float32Array(1);return s(j).set(F.subarray(C,C+4)),_(C-_(0)),[B,j[0]]}function d(x,T,E,v,S,I,R,O,L,_,C,w,D){var N=n.exports.sbrk,F=N(4),V=N(E*4),B=N(S*I),j=N(S*O),k=N(L.length*4),G=N(E*4),q=_?N(S):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(s(v),B),Q.set(s(R),j),Q.set(s(L),k),Q.set(s(T),G),_&&Q.set(s(_),q);var W=x(V,G,E,B,S,I,j,O,k,L.length,q,C,w,D,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(W);s(J).set(Q.subarray(V,V+W*4));var Z=new Float32Array(1);return s(Z).set(Q.subarray(F,F+4)),N(F-N(0)),[J,Z[0]]}function p(x,T,E,v,S,I,R,O,L,_,C,w,D){var N=n.exports.sbrk,F=N(4),V=N(S*I),B=N(S*O),j=N(L.length*4),k=N(E*4),G=_?N(S):0,q=new Uint8Array(n.exports.memory.buffer);q.set(s(v),V),q.set(s(R),B),q.set(s(L),j),q.set(s(T),k),_&&q.set(s(_),G);var Q=x(k,E,V,S,I,B,O,j,L.length,G,C,w,D,F);q=new Uint8Array(n.exports.memory.buffer),s(T).set(q.subarray(k,k+Q*4)),s(v).set(q.subarray(V,V+S*I)),s(R).set(q.subarray(B,B+S*O));var W=new Float32Array(1);return s(W).set(q.subarray(F,F+4)),N(F-N(0)),[Q,W[0]]}function g(x,T,E,v){var S=n.exports.sbrk,I=S(E*v),R=new Uint8Array(n.exports.memory.buffer);R.set(s(T),I);var O=x(I,E,v);return S(I-S(0)),O}function m(x,T,E,v,S,I,R,O){var L=n.exports.sbrk,_=L(O*4),C=L(E*v),w=S?L(E*I):0,D=new Uint8Array(n.exports.memory.buffer);D.set(s(T),C),S&&D.set(s(S),w);var N=x(_,C,E,v,w,I,R,O);D=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(N);return s(F).set(D.subarray(_,_+N*4)),L(_-L(0)),F}function y(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),D=_(S*I),N=_(E*4),F=R?_(S):0,V=new Uint8Array(n.exports.memory.buffer);V.set(s(v),D),V.set(s(T),N),R&&V.set(s(R),F);var B=x(w,N,E,D,S,I,F,O,L,C);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(V.subarray(w,w+B*4));var k=new Float32Array(1);return s(k).set(V.subarray(C,C+4)),_(C-_(0)),[j,k[0]]}function A(x,T,E,v,S,I,R){var O=n.exports.sbrk,L=O(E*4),_=O(S*I),C=O(E*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(v),_),w.set(s(T),C);var D=x(L,C,E,_,S,I,R);w=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(D);return s(N).set(w.subarray(L,L+D*4)),O(L-O(0)),N}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var v=0;v<T.length;++v)x[v]=T[v];return E},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),a(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0&&v<=x.length),o(v%3==0),o(S>=0);for(var R=0,O=0;O<(I?I.length:0);++O)o(I[O]in b),R|=b[I[O]];var L=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,L,x.length,T,T.length/E,E*4,v,S,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var D=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),N=d(n.exports.meshopt_simplifyWithAttributes,D,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);return N[0]=x instanceof Uint32Array?N[0]:new x.constructor(N[0]),N},simplifyWithUpdate:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var D=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),N=p(n.exports.meshopt_simplifyWithUpdate,D,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);if(x!==D)for(var C=0;C<N[0];++C)x[C]=D[C];return N},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,E,v,S,I){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(E>=0&&E<=x.length/T),v?(o(v instanceof Float32Array),o(v.length%S==0),o(S>=3),o(x.length/T==v.length/S),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,v,S*4,I||0,E)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v==null||v instanceof Uint8Array),o(v==null||v.length==T.length/E),o(S>=0&&S<=x.length),o(S%3==0),o(I>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/E,E*4,v,S,I);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},simplifyPrune:function(x,T,E,v){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0);var S=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),I=A(n.exports.meshopt_simplifyPrune,S,x.length,T,T.length/E,E*4,v);return I=x instanceof Uint32Array?I:new x.constructor(I),I}}})();var iun=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6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inawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var a=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],E=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+E*3)}}function f(y,A,b,x,T,E,v,S,I,R){var O=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(A.length,E,v),_=O(L*c),C=O(A.length*4),w=O(A.length),D=O(A.byteLength),N=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(s(A),D),F.set(s(b),N);var V=y(_,C,w,D,A.length,N,x,T,E,v,S,I,R);F=new Uint8Array(n.exports.memory.buffer);for(var B=F.subarray(_,_+V*c),j=new Uint32Array(B.buffer,B.byteOffset,B.byteLength/4).slice(),k=0;k<V;++k){var G=j[k*4+0],q=j[k*4+1],x=j[k*4+2],Q=j[k*4+3];n.exports.meshopt_optimizeMeshlet(C+G*4,w+q,Q,x)}var W=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,C,W).slice(),triangles:new Uint8Array(F.buffer,w,J).slice(),meshletCount:V};return O(_-O(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,a/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,E=[],v=T(A.byteLength),S=T(y.vertices.byteLength),I=T(y.triangles.byteLength),R=T(a),O=new Uint8Array(n.exports.memory.buffer);O.set(s(A),v),O.set(s(y.vertices),S),O.set(s(y.triangles),I);for(var L=0;L<y.meshletCount;++L){var _=y.meshlets[L*4+0],C=y.meshlets[L*4+1],w=y.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(R,S+_*4,I+C,w,v,b,x),E.push(d(R))}return T(v-T(0)),E}function g(y,A,b,x){var T=n.exports.sbrk,E=T(a),v=T(y.byteLength),S=T(A.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),v),I.set(s(A),S),n.exports.meshopt_computeClusterBounds(E,v,y.length,S,b,x);var R=d(E);return T(E-T(0)),R}function m(y,A,b,x,T){var E=n.exports.sbrk,v=E(a),S=E(y.byteLength),I=x?E(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),x&&R.set(s(x),I),n.exports.meshopt_computeSphereBounds(v,S,A,b,I,x?T:0);var O=d(v);return E(v-E(0)),O}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),E=E||0;var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,v,A,A.length/b,b*4,x,T,T,E,0)},buildMeshletsFlex:function(y,A,b,x,T,E,v,S){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0,S=S||0;var I=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,I,A,A.length/b,b*4,x,T,E,v,S)},buildMeshletsSpatial:function(y,A,b,x,T,E,v){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0;var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,S,A,A.length/b,b*4,x,T,E,v)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var oun=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdl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bdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOxekaxazc:e:G:cjbfydbcdtfhAaxazcj:G:cjbfydbcdtfhrawhOkaHasIdbggaoamaOcdtfydbgQaC2cdtfgOIdbg8KasIdwg8FaOIdwg8JNaga8KNasIdlg8EaOIdlggNMMghN:tgaJbbbbJbbjZa8Fa8JahN:tg8Fa8FNaaaaNa8EagahN:tghahNMMga:r:vaaJbbbb9BEJ;As6nJbbjZaiarydbaX2cdtfgOIdwaiaQaX2cdtfgrIdwg5:tgaa8Jaaa8JNaOIdbarIdbgy:tg8Pa8KNagaOIdlarIdlgI:tg8RNMMgaN:tg8EaiaAydbaX2cdtfgOIdwa5:tg5a8Ja5a8JNaOIdbay:tg8Sa8KNagaOIdlaI:tgINMMg5N:tg8JNa8Pa8KaaN:tgya8Sa8Ka5N:tg8KNa8RagaaN:tgaaIaga5N:tggNMMJbbbbJbbjZa8Ea8ENayayNaaaaNMMa8Ja8JNa8Ka8KNagagNMMNg8K:rg8J:va8KJbbbb9BENgg:lg8Ka8KJbbjZ9EEg8Ka8KJ7;A9s89NJ:L9t9s::MNJ;ob;jZMJbbjZa8K:t:rNg8K:ta8KagJbbbb9DENg8Ka8Ja8KNaEEg8KNaHIdbMUdbaHaha8KNaHIdlMUdlaHa8Fa8KNaHIdwMUdwawcefhwazclfgzcx9hmbkkaYcxfhYa3cxfh3a8Vcifh8Va8Wcefg8WaP9hmbkcbhrinarhzdnaravarcdtfgsydbgHSmbinasavaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkaKarc8W2fgHc3fJbbjZJbbj:;a8AazfRbbceGEg8KUdbaHc8Sfa8KUdbaHa8KUdxarcefgraP9hmbkkaqcdGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",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(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function s(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function a(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,E=T(f*16),v=u?T(u.byteLength):0,S=T(d.byteLength),I=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(s(u),v),O.set(s(d),S),O.set(s(m),I),O.set(s(A),R),n.exports.meshopt_generateTangents(E,v,f,S,p,g*4,I,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var L=new Float32Array(O.buffer,E,f*4).slice();return T(E-T(0)),L}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,E=u?u.length:T,v=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return a(v,E,f,T,d,p,g,m,y,b)}}})();var tp={X:0,Y:1,Z:2};tp.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));tp.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));tp.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));tp.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));tp.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));tp.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));tp.fromName=function(e){return tp[e]};Object.freeze(tp);var Hi=tp;var HX={},bGe={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},xGe=new he,TGe=new h,EGe=new M,CGe=new M,vGe=new M,SGe=new h,wGe=new h,IGe=new h,PGe=new h,DGe=new he,RGe=new U,bP=new h,OGe=new U,MGe=new h,NGe=new h,A2=function(e,t){return e-t};HX.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,d=le.clone(e.boundingSphere,new le),p=en.clone(e.orientedBoundingBox,new en),g=h.clone(e.horizonOcclusionPoint,new h),m=ee.clone(e.ellipsoid,new ee),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?V_.ready:Promise.resolve(void 0));let x=y.west,T=y.south,E=y.north,v=y.width,S=y.height,I=ie.center(y,xGe);I.height=.5*(s+a);let R=he.toCartesian(I,m,TGe),O=At.eastNorthUpToFixedFrame(R,m,EGe),L=M.inverseTransformation(O,CGe),_=M.unpack(o.nodes[0].matrix,0,vGe);_=M.multiply(Hi.Y_UP_TO_Z_UP,_,_);let C=h5e(o,i,bGe),w=Yr.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),D=C.positions,N=C.normals,F=C.indices,V=D.length/3,B=V+w,j=F.length,k=Yr.getSkirtIndexCountWithFilledCorners(w),G=B<=65535?Uint16Array:Uint32Array,q=new G(j+k);q.set(F);let Q=new G(C.edgeIndicesWest),W=new G(C.edgeIndicesSouth),J=new G(C.edgeIndicesEast),Z=new G(C.edgeIndicesNorth),ae=new G(Q).sort(),Ae=new G(W).sort(),fe=new G(J).sort(),xe=new G(Z).sort(),ge=xi.geodeticLatitudeToMercatorAngle(T),ve=1/(xi.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,SGe),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,wGe),He=new Eo(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),Ye=He.stride,Ke=new Float32Array(B*Ye),Pe=0;for(let st=0;st<V;st++){let vt=h.unpack(D,st*3,IGe),jt=M.multiplyByPoint(_,vt,PGe),lt=he.fromCartesian(jt,m,DGe),{longitude:mt,latitude:ft,height:Yt}=lt,rt=(mt-x)/v,ht=(ft-T)/S;rt=P.clamp(rt,0,1),ht=P.clamp(ht,0,1),Pr(ae,st,A2)>=0?rt=0:Pr(fe,st,A2)>=0&&(rt=1),Pr(Ae,st,A2)>=0?ht=0:Pr(xe,st,A2)>=0&&(ht=1);let Li=U.fromElements(rt,ht,RGe),Yn;if(i){let ui=h.unpack(N,st*3,bP);ui=M.multiplyByPointAsVector(_,ui,bP),ui=h.normalize(ui,bP),Yn=cn.octEncode(ui,OGe)}let gi;r&&(gi=(xi.geodeticLatitudeToMercatorAngle(ft)-ge)*ve);let zi;f&&(zi=m.geodeticSurfaceNormal(jt,MGe)),Pe=He.encode(Ke,Pe,jt,Li,Yt,Yn,gi,zi);let Si=M.multiplyByPoint(L,jt,NGe);Re=h.minimumByComponent(Si,Re,Re),Qe=h.maximumByComponent(Si,Qe,Qe)}let qe=new Ac(h.clone(He.center,new h),Ke,q,j,V,s,a,y,le.clone(d,new le),h.clone(g,new h),Ye,en.clone(p,new en),He,Q,W,J,Z);return kde(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var LGe=new U,FGe=new U,BGe=new Array(6),kGe=new U,UGe=new U,zGe=new U,VGe=new h,jGe=new h,HGe=new h,GGe=new he,WGe=new h,qGe=new he,YGe=new he,Ode=new h,XGe=new h,KGe=new h,$Ge=new h,JGe=new h,ZGe=new h,QGe=new h,e5e=new h,t5e=new M,n5e=new M,Mde=new U,i5e=new U,r5e=new h,o5e=new le,s5e=new en,a5e=new od,Nde=new h,Lde=new U,c5e=new U,Fde=new h,l5e=new h;function u5e(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);V_.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,a);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function f5e(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);V_.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,a);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*P.signNotZero(A),g=(1-Math.abs(A))*P.signNotZero(b)}let y=bP;y.x=p,y.y=g,y.z=m,y=h.normalize(y,bP),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function d5e(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),u=new o(r);return V_.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function b2(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,s=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(o),d=a.byteStride;return V_.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function h5e(e,t,n){return n.positions=u5e(e),n.normals=t?f5e(e):void 0,n.indices=d5e(e),n.edgeIndicesWest=b2(e,"left"),n.edgeIndicesSouth=b2(e,"bottom"),n.edgeIndicesEast=b2(e,"right"),n.edgeIndicesNorth=b2(e,"top"),n}HX.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Eo.clone(e.parentEncoding,new Eo),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=ee.clone(e.ellipsoid),T=[],E=[],v=[],S=[],I=[],R=[],O=[],L=[];S5e(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,GGe);_.height=.5*(i+r);let C=he.toCartesian(_,x,WGe),w=T.length,D=new Eo(C,void 0,void 0,void 0,void 0,d,p,A,g,m),N=D.stride,F=Yr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Yr.getSkirtIndexCountWithFilledCorners(F),k=B+j,G=V<=65535?Uint16Array:Uint32Array,q=new G(k);q.set(S);let Q=new G(I),W=new G(R),J=new G(O),Z=new G(L),ae=new Float32Array(V*N),Ae=0,fe=At.eastNorthUpToFixedFrame(C,x,t5e),xe=M.inverseTransformation(fe,n5e),ge=b.west,we=b.east,ve=b.south,Re=b.north,Qe=xi.geodeticLatitudeToMercatorAngle(ve),Ye=1/(xi.geodeticLatitudeToMercatorAngle(Re)-Qe),Ke=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,QGe),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,e5e);for(let Yt=0;Yt<w;Yt++){let rt=T[Yt],ht=a[rt*3+0],Li=a[rt*3+1],Yn=a[rt*3+2],gi=i5e;gi.x=E[Yt*2+0],gi.y=E[Yt*2+1];let zi=gi.x,Si=gi.y,ui=v[Yt*2+0],_i=v[Yt*2+1],zn=1-ui-_i,tn=f.decodeHeight(u,ht),Hn=f.decodeHeight(u,Li),Ki=f.decodeHeight(u,Yn),wr=tn*ui+Hn*_i+Ki*zn;Ke=Math.min(wr,Ke),Pe=Math.max(wr,Pe);let so=P.lerp(ge,we,zi),Ts=P.lerp(ve,Re,Si),zs=he.fromRadians(so,Ts,wr,YGe),$r=he.toCartesian(zs,x,XGe),hi=M.multiplyByPoint(xe,$r,$Ge);qe=h.minimumByComponent(hi,qe,qe),st=h.maximumByComponent(hi,st,st);let ao;if(d){let Fn=f.decodeNormal(u,ht,VGe),Vi=f.decodeNormal(u,Li,jGe),Fi=f.decodeNormal(u,Yn,HGe),Ir=h.fromElements(Fn.x*ui+Vi.x*_i+Fi.x*zn,Fn.y*ui+Vi.y*_i+Fi.y*zn,Fn.z*ui+Vi.z*_i+Fi.z*zn,Nde);Ir=h.normalize(Ir,Nde),ao=cn.octEncode(Ir,c5e)}let nr;p&&(nr=(xi.geodeticLatitudeToMercatorAngle(Ts)-Qe)*Ye);let jo;A&&(jo=x.geodeticSurfaceNormal($r,l5e)),Ae=D.encode(ae,Ae,$r,gi,wr,ao,nr,jo)}let vt=en.fromRectangle(b,Ke,Pe,x,s5e),jt=le.fromVertices(ae,D.center,N,o5e),mt=new Km(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(D.center,ae,N,D.center,Ke,r5e),ft=new Ac(h.clone(D.center,new h),ae,q,B,w,Ke,Pe,b,le.clone(jt),h.clone(mt),N,en.clone(vt),D,Q,W,J,Z);return kde(ft,b,x,qe,st,fe,xe,o),ft};function kde(e,t,n,i,r,o,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,E=T-b,v=e.indices,S=e.indexCountWithoutSkirts,I=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;Yr.addSkirtIndicesWithFilledCorners(I,R,O,L,b,v,S);let _=0,C=_+I.length,w=C+R.length,D=w+O.length,N=[I,R,O,L],F=[_,C,w,D],V=[-1,0,1,0],B=[0,-1,0,1],j=h.clone(i,JGe),k=h.clone(r,ZGe),G=e.maximumHeight,q=e.minimumHeight-a;for(let J=0;J<E;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ae=N[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ae,Mde),fe=1e-4,xe=Ae.x+V[Z]*fe,ge=Ae.y+B[Z]*fe,we=P.lerp(t.west,t.east,xe),ve=P.clamp(P.lerp(t.south,t.north,ge),-P.PI_OVER_TWO,+P.PI_OVER_TWO),Qe=c.decodeHeight(f,ae)-a,He=he.fromRadians(we,ve,Qe,qGe),Ye=he.toCartesian(He,n,Ode),Ke;d&&(Ke=c.getOctEncodedNormal(f,ae,Lde));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Ye,Fde)),x=c.encode(f,x,Ye,Ae,Qe,Ke,Pe,qe);let st=M.multiplyByPoint(s,Ye,KGe);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=od.fromCorners(j,k,a5e),W=new Eo(c.center,Q,q,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==W.quantization){let J=W,Z=J.stride,ae=new Float32Array(T*Z),Ae=0;for(let fe=0;fe<T;fe++)Ae=J.encode(ae,Ae,c.decodePosition(f,fe,Ode),c.decodeTextureCoordinates(f,fe,Mde),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,Lde):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,Fde):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var GX=0,m5e=1,WX=2,qX=3,p5e=4,g5e=new h,_5e=[new h,new h,new h,new h,new h,new h],y5e=[new U,new U,new U,new U,new U,new U],A5e=[new h,new h,new h,new h,new h,new h],b5e=[new U,new U,new U,new U,new U,new U];function Bde(e,t,n,i){switch(n){case GX:return P.sign(i.x-e.x);case WX:return P.sign(t.x-i.x);case qX:return P.sign(i.y-e.y);default:return P.sign(t.y-i.y)}}function x5e(e,t,n,i,r,o){let s,a,c;switch(n){case GX:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case WX:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case qX:s=(e.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,o)}var T5e={length:0,coordinates:[new U,new U,new U,new U,new U,new U],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function E5e(e,t,n,i,r,o,s,a){let c,u=y5e,f=_5e,d=3,p=b5e;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=A5e;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%p5e,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],E=f[x],v=Bde(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=Bde(n,i,y,I);if(v*O===-1){let L=x5e(n,i,y,T,I,g5e),{x:_,y:C,z:w}=L,D=1-w,N=E.x*D+R.x*w,F=E.y*D+R.y*w,V=E.z*D+R.z*w;U.fromElements(_,C,p[d]),h.fromElements(N,F,V,g[d]),d++}O>=0&&(U.clone(I,p[d]),h.clone(R,g[d]),d++),T=I,E=R,v=O}if(d===0)break}a.length=d;for(let m=0;m<d;m++)U.clone(p[m],a.coordinates[m]),h.clone(g[m],a.barycentricCoordinates[m]);return a}function C5e(e,t,n,i,r,o,s,a){return E5e(e?t?qX:GX:t?WX:m5e,2,n,i,r,o,s,a)}var v5e=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function S5e(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,E=LGe;E.x=A,E.y=x;let v=FGe;v.x=b,v.y=T;let S=0;for(let I=0;I<n;I+=3){let R=i[I+0],O=i[I+1],L=i[I+2],_=s.decodeTextureCoordinates(o,R,kGe),C=s.decodeTextureCoordinates(o,O,UGe),w=s.decodeTextureCoordinates(o,L,zGe),D=C5e(e,t,E,v,_,C,w,T5e),N=D.length;if(N<3)continue;let F=BGe;for(let k=0;k<N;k++){let G=D.barycentricCoordinates[k],q=G.x,Q=G.y,W=G.z,J=Math.ceil(q)|Math.ceil(Q)<<1|Math.ceil(W)<<2,Z=v5e[J],ae,Ae=!1;if(Z.length===1){let fe=Z[0],ge=i[I+fe];ae=y[ge],ae===void 0&&(Ae=!0,ae=S++,y[ge]=ae)}else if(Z.length===2){let fe=Z[0],xe=Z[1],ge=i[I+fe],we=i[I+xe],ve=D.barycentricCoordinates[(k+N-1)%N],Re=Math.ceil(ve.x)|Math.ceil(ve.y)<<1|Math.ceil(ve.z)<<2,Qe=J===Re,He=Math.min(ge,we),Ye=Math.max(ge,we),Ke=r+2*(He*r+Ye),Pe=Ke+0,qe=Ke+1,st=y[Pe],vt=y[qe],jt=!Qe==(st===void 0||vt===void 0);if(ae=jt?st:vt,ae===void 0){Ae=!0,ae=S++;let lt=jt?Pe:qe;y[lt]=ae}}else Ae=!0,ae=S++;if(F[k]=ae,Ae){let fe=I/3;p.push(fe);let xe=D.coordinates[k],ge=(xe.x-A)/(b-A),we=(xe.y-x)/(T-x);m.push(ge,we),g.push(q,Q),ge===0?c.push(ae):ge===1&&f.push(ae),we===0?u.push(ae):we===1&&d.push(ae)}}let V=F[0],B=F[1],j=F[2];a.push(V,B,j);for(let k=3;k<N;k++)B=j,j=F[k],a.push(V,B,j)}c.sort(function(I,R){return m[I*2+1]-m[R*2+1]}),u.sort(function(I,R){return m[R*2+0]-m[I*2+0]}),f.sort(function(I,R){return m[R*2+1]-m[I*2+1]}),d.sort(function(I,R){return m[I*2+0]-m[R*2+0]})}var xP=HX;var x2={};x2.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};x2.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,y=e-s,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};x2.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var np=x2;function j0(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=le.clone(e.boundingSphere,new le),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(j0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});j0.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:zde(i,e,t,n)};j0.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var Ude="createVerticesFromCesium3DTilesTerrain",w5e=new $n(Ude),I5e=new $n(Ude,af.maximumAsynchronousTasks);j0.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?I5e:w5e,i=e.tilingScheme,r=i.ellipsoid,o=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(o,s,a,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=Eo.clone(g.encoding,new Eo),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),E=new x(g.westIndicesBuffer),v=new x(g.eastIndicesBuffer),S=new x(g.southIndicesBuffer),I=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=le.clone(d._boundingSphere,new le),w=h.clone(d._horizonOcclusionPoint,new h),D=en.clone(d._orientedBoundingBox,new en),N=new Ac(_,y,T,R,b,O,L,c,C,w,m.stride,D,m,E,S,v,I);return d._mesh=N,Promise.resolve(N)})};j0.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,s=t.tileXYToRectangle(i,r,o,new ie),a=xP.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(u){return c._mesh=u,Promise.resolve(u)})};j0.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:T2(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};j0.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:T2(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};j0.prototype.wasCreatedByUpsampling=function(){return!1};function V0(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}V0.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};V0.prototype.upsample=function(e,t,n,i,r,o,s){return T2(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};V0.prototype._upsampleSync=function(e,t,n,i,r,o,s){return T2(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};V0.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return zde(i,e,t,n)};V0.prototype.wasCreatedByUpsampling=function(){return!0};V0.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(V0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var P5e=new $n("upsampleVerticesFromCesium3DTilesTerrain",af.maximumAsynchronousTasks);function T2(e,t,n,i,r,o,s,a,c,u,f){if(f-a>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=s*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=xP.upsampleMesh(b),E=new V0({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=P5e.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Eo.clone(T.encoding,new Eo),v=E.stride,S=new Float32Array(T.verticesBuffer),I=S.length/v,R=T.vertexCountWithoutSkirts,O=I<=65535?Uint16Array:Uint32Array,L=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),C=new O(T.eastIndicesBuffer),w=new O(T.southIndicesBuffer),D=new O(T.northIndicesBuffer),N=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,B=h.clone(E.center,new h),j=le.clone(T.boundingSphere,new le),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new Ac(B,S,L,N,R,F,V,y,j,k,v,G,E,_,w,C,D),Q=new V0({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var D5e=new U,R5e=new U,O5e=new U,M5e=new h;function zde(e,t,n,i){let r=P.clamp((n-t.west)/t.width,0,1),o=P.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=a.decodeTextureCoordinates(s,f,D5e),m=a.decodeTextureCoordinates(s,d,R5e),y=a.decodeTextureCoordinates(s,p,O5e),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let E=np.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,M5e);if(E.x>=0&&E.y>=0&&E.z>=0){let v=a.decodeHeight(s,f),S=a.decodeHeight(s,d),I=a.decodeHeight(s,p);return E.x*v+E.y*S+E.z*I}}}return 0}var E2=j0;function Eh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Eh.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}}});Eh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Eh({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Eh.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};Eh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Vde(this,t)};Eh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Vde(this,i),t};Eh.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],jde(this,0)),this._array[e-1]=void 0,t};Eh.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=YX(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&jde(this,n)}return this._array[e-1]=void 0,t};Eh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Eh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[YX(this,1,2)?1:2]};function C2(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function TP(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function YX(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Vde(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=TP(e,t,i);for(r!==n&&(C2(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(TP(e,t,o)!==r)break;C2(e,t,o),t=o}}function jde(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){TP(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;TP(e,f,o)===i&&(o=f)}}if(TP(e,o,t)===i&&(C2(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);YX(e,o,a)===i&&C2(e,o,a)}t=o}}var j_=Eh;function H_(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),H_.decode(e)}H_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};H_.decodeWithFromCharCode=function(e){let t="",n=N5e(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function EP(e,t,n){return t<=e&&e<=n}function N5e(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(EP(u,0,127)){s.push(u);continue}if(EP(u,194,223)){i=1,t=u&31;continue}if(EP(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(EP(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!EP(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?H_.decode=H_.decodeWithTextDecoder:H_.decode=H_.decodeWithFromCharCode;var cf=H_;function L5e(e,t,n){return JSON.parse(cf(e,t,n))}var Lo=L5e;function F5e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var or=F5e;function XX(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=B5e(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function B5e(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(XX.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});XX.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 CP=XX;function H0(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(H0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});H0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};H0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};H0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};H0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};H0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};H0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};H0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var vP=H0;var SP={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};SP.getBranchingFactor=function(e){switch(e){case SP.OCTREE:return 8;case SP.QUADTREE:return 4}};Object.freeze(SP);var Ys=SP;function Ja(){}Object.defineProperties(Ja.prototype,{class:{get:function(){pe.throwInstantiationError()}}});Ja.prototype.hasProperty=function(e){pe.throwInstantiationError()};Ja.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};Ja.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};Ja.prototype.getProperty=function(e){pe.throwInstantiationError()};Ja.prototype.setProperty=function(e,t){pe.throwInstantiationError()};Ja.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};Ja.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};Ja.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};Ja.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};Ja.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};Ja.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&l(r.slice)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Ze(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};Ja.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};Ja.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return Ja.getProperty(r.id,t,n)};Ja.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?Ja.setProperty(o.id,t,n,i):!1};var Xn=Ja;function G0(e){e=e??H.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(G0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});G0.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};G0.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};G0.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};G0.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};G0.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};G0.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};G0.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var v2=G0;var Hde={};function wP(e,t){l(Hde[e])||(Hde[e]=!0,console.warn(t??e))}wP.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.";wP.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";wP.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";wP.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=wP;var un={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Hc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};un.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Hc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Hc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Hc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Hc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Hc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Hc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Hc.INTEGER,downcastFunction:e=>un.clampToLimits(e,un.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Hc.UNSIGNED_INTEGER,downcastFunction:e=>un.clampToLimits(e,un.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Hc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Hc.FLOAT,downcastFunction:e=>Math.fround(e)}};un.getMinimum=function(e){return un.typeInfo[e].minimumValue};un.getMaximum=function(e){return un.typeInfo[e].maximumValue};un.isIntegerType=function(e){return un.typeInfo[e].category!==Hc.FLOAT};un.isUnsignedIntegerType=function(e){return un.typeInfo[e].category===Hc.UNSIGNED_INTEGER};un.isVectorCompatible=function(e){return un.typeInfo[e].vectorCompatible};un.category=function(e){return un.typeInfo[e].category};un.gpuComponentType=function(e){switch(e){case un.INT64:return"INT32";case un.UINT64:return"UINT32";case un.FLOAT64:return"FLOAT32";default:return e}};un.normalize=function(e,t){return Math.max(Number(e)/Number(un.getMaximum(t)),-1)};un.unnormalize=function(e,t){let n=un.getMaximum(t),i=un.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===un.INT64||t===un.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};un.applyValueTransform=function(e,t,n){return n*e+t};un.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};un.getSizeInBytes=function(e){return un.typeInfo[e].size};un.clampToLimits=function(e,t){let n=un.getMinimum(t),i=un.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};un.downcastFunction=function(e){let n=un.typeInfo[e].downcastFunction;return l(n)?n:i=>i};un.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return un.INT8;case Y.UNSIGNED_BYTE:return un.UINT8;case Y.SHORT:return un.INT16;case Y.UNSIGNED_SHORT:return un.UINT16;case Y.INT:return un.INT32;case Y.UNSIGNED_INT:return un.UINT32;case Y.FLOAT:return un.FLOAT32;case Y.DOUBLE:return un.FLOAT64}};un.toComponentDatatype=function(e){switch(e){case un.INT8:return Y.BYTE;case un.UINT8:return Y.UNSIGNED_BYTE;case un.INT16:return Y.SHORT;case un.UINT16:return Y.UNSIGNED_SHORT;case un.INT32:return Y.INT;case un.UINT32:return Y.UNSIGNED_INT;case un.FLOAT32:return Y.FLOAT;case un.FLOAT64:return Y.DOUBLE}};un.getDataViewAccessors=function(e,t){return{[un.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[un.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[un.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[un.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[un.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[un.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[un.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[un.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[un.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[un.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(un);var Lt=un;var Qr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Qr.isVectorType=function(e){switch(e){case Qr.VEC2:case Qr.VEC3:case Qr.VEC4:return!0;default:return!1}};Qr.isMatrixType=function(e){switch(e){case Qr.MAT2:case Qr.MAT3:case Qr.MAT4:return!0;default:return!1}};Qr.getComponentCount=function(e){switch(e){case Qr.SCALAR:case Qr.STRING:case Qr.ENUM:case Qr.BOOLEAN:return 1;case Qr.VEC2:return 2;case Qr.VEC3:return 3;case Qr.VEC4:return 4;case Qr.MAT2:return 4;case Qr.MAT3:return 9;case Qr.MAT4:return 16}};Qr.getMathType=function(e){switch(e){case Qr.VEC2:return U;case Qr.VEC3:return h;case Qr.VEC4:return se;case Qr.MAT2:return $i;case Qr.MAT3:return $;case Qr.MAT4:return M;default:return}};Object.freeze(Qr);var bt=Qr;function Wo(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Lt.isIntegerType(i);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=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Ze(e.min,!0),this._max=Ze(e.max,!0),this._normalized=o;let s=Ze(e.offset,!0),a=Ze(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ze(e.noData,!0),this._default=Ze(e.default,!0),this._required=e.required??!0,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}Wo.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=k5e(n),r=U5e(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new Wo({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Wo.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 k5e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Lt[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 U5e(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Lt[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Lt[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}Wo.prototype.normalize=function(e){return this._normalized?KX(e,this._valueType,Lt.normalize):e};Wo.prototype.unnormalize=function(e){return this._normalized?KX(e,this._valueType,Lt.unnormalize):e};Wo.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Wo.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};Wo.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Wo.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};Wo.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=bt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};Wo.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Yde(e,t))return e};function IP(e){return Array.isArray(e)&&!(e instanceof $i)&&!(e instanceof $)&&!(e instanceof M)}function Yde(e,t){if(!IP(e))return e===t;if(!IP(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Yde(e[n],t[n]))return!1;return!0}Wo.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Wo.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Wo.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?z5e(this,e):Xde(this,e)};function z5e(e,t){if(!IP(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 r=Xde(e,t[i]);if(l(r))return r}}function Xde(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?V5e(t,n,i):bt.isMatrixType(n)?j5e(t,n,i):n===bt.STRING?H5e(t):n===bt.BOOLEAN?G5e(t):n===bt.ENUM?W5e(t,r):q5e(t,i,o)}function V5e(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function j5e(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof $i))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function H5e(e){if(typeof e!="string")return S2(e,bt.STRING)}function G5e(e){if(typeof e!="boolean")return S2(e,bt.BOOLEAN)}function W5e(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 q5e(e,t,n){let i=typeof e;switch(t){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return i!=="number"?S2(e,t):isFinite(e)?Wde(e,t,n):qde(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?S2(e,t):i==="number"&&!isFinite(e)?qde(e,t):Wde(e,t,n)}}function S2(e,t){return`value ${e} does not match type ${t}`}function Gde(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Wde(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Gde(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return Gde(e,t,n)}function qde(e,t){return`value ${e} of type ${t} must be finite`}function KX(e,t,n){if(!IP(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=KX(e[i],t,n);return e}Wo.valueTransformInPlace=function(e,t,n,i){if(!IP(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=Wo.valueTransformInPlace(e[r],t[r],n[r],i);return e};Wo.prototype.cpuBytesPerElement=function(){return Kde(this,this.valueType)};Wo.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return Kde(this,e)};function Kde(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}Wo.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var $X=[void 0,"float","vec2","vec3","vec4"],$de=[void 0,"int","ivec2","ivec3","ivec4"],Y5e=[void 0,"uint","uvec2","uvec3","uvec4"],X5e={[Hc.FLOAT]:"uintBitsToFloat",[Hc.INTEGER]:"int",[Hc.UNSIGNED_INTEGER]:""};Wo.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?$X[e]:$de[e]};Wo.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Lt.isIntegerType(e)||this.normalized?$X[t]:Lt.isUnsignedIntegerType(e)?Y5e[t]:$de[t]};Wo.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Lt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=bt.getComponentCount(a)*(this.isArray?this.arrayLength:1),u=Math.floor(s/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${$X[s]} ${f} = ${e};`;i.push(y);let A=X5e[Lt.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),E=s>1?`.${T}`:"",v=`${d} = czm_unpackTexture(${f}${E});`,S="";b&&(S=`[${x}]`);let I="",R="";if(this.normalized){let L=Lt.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};Wo.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var W0=Wo;function PP(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===bt.STRING,d=o===bt.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new JX(r[C],_,t+1),p+=g.typedArray.byteLength}let m=bt.getComponentCount(o),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new JX(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Lt.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,E=new JX(r[T],c,x);p+=E.typedArray.byteLength;let v=n.offset,S=n.scale,I=i.hasValueTransform||l(v)||l(S);v=v??i.offset,S=S??i.scale,v=Jde(v),S=Jde(S);let R,O,L=this;f?R=function(_){return J5e(_,L._values,L._stringOffsets)}:d?(R=function(_){return Z5e(_,L._values)},O=function(_,C){Q5e(_,L._values,C)}):l(u)?(R=function(_){let C=L._values.get(_);return u.namesByValue[C]},O=function(_,C){let w=u.valuesByName[C];L._values.set(_,w)}):(R=function(_){return L._values.get(_)},O=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=S,this._hasValueTransform=I,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(PP.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}},classProperty:{get:function(){return this._classProperty}}});PP.prototype.get=function(e){let t=K5e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=a9e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};PP.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=c9e(this,t),t=n.unnormalize(t),$5e(this,e,t)};PP.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Jde(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Zn(t,i):t.push(i)}return t}function K5e(e,t){Qde(e)&&ehe(e);let n=e._classProperty,i=n.isArray,r=n.type,o=bt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ze(s,!0):s}return!i&&o===1?e._getValue(t):Zde(e,n,t)}function Zde(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=bt.getComponentCount(t.type);i*=s,r*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function $5e(e,t,n){o9e(e,t,n)&&ehe(e);let i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Ze(n,!0)),e._unpackedValues[t]=n;return}if(!r&&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 f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function J5e(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return cf(t.typedArray,i,r)}function Z5e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function Q5e(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function e9e(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function t9e(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function n9e(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function i9e(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function r9e(e){switch(e){case Lt.INT8:return Y.BYTE;case Lt.UINT8:return Y.UNSIGNED_BYTE;case Lt.INT16:return Y.SHORT;case Lt.UINT16:return Y.UNSIGNED_SHORT;case Lt.INT32:return Y.INT;case Lt.UINT32:return Y.UNSIGNED_INT;case Lt.FLOAT32:return Y.FLOAT;case Lt.FLOAT64:return Y.DOUBLE}}function Qde(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Lt.INT64&&!dn.supportsBigInt64Array()||i===Lt.UINT64&&!dn.supportsBigUint64Array()}function o9e(e,t,n){if(Qde(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function ehe(e){e._unpackedValues=s9e(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function s9e(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(!r&&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]=Zde(e,i,a);return n}function a9e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:W0.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function c9e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:W0.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function JX(e,t,n){let i=this,r,o,s;if(t===Lt.INT64)dn.supportsBigInt()?dn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return t9e(a,i)}):(yt("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."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return e9e(a,i)});else if(t===Lt.UINT64)dn.supportsBigInt()?dn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return i9e(a,i)}):(yt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return n9e(a,i)});else{let a=r9e(t);r=Y.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var w2=PP;function Ch(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new w2({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Ch.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});Ch.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Ch.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Ch.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Ch.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=l9e(this._class,t),i};Ch.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Ch.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)};Ch.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Ch.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Ch.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function l9e(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Ze(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var vh=Ch;var ZX=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` +${n.message}`);let i=new oe(t);return l(n)&&(i.stack=`Original stack: +${n.stack} +Handler stack: +${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),ue(this)}},sr=ZX;var the={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(the);var Ct=the;var I2=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=u9e(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function u9e(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await I2._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Ct.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Ct.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var tC=I2;function f9e(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var Nb=f9e;var QX=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=Nb(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=d9e(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function d9e(e){try{let t=h9e(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 r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);V_.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Ct.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load buffer view",t)}}function h9e(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})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var DP=QX;var Lb=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};Lb._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Lb._decoderTaskProcessor=void 0;Lb._taskProcessorReady=!1;Lb._error=void 0;var G_=Lb;var Rn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function m9e(e){switch(e){case Rn.POSITION:return"positionMC";case Rn.NORMAL:return"normalMC";case Rn.TANGENT:return"tangentMC";case Rn.TEXCOORD:return"texCoord";case Rn.COLOR:return"color";case Rn.JOINTS:return"joints";case Rn.WEIGHTS:return"weights";case Rn.FEATURE_ID:return"featureId";case Rn.SCALE:return"scale";case Rn.ROTATION:return"rotation";case Rn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Rn.hasSetIndex=function(e){switch(e){case Rn.POSITION:case Rn.NORMAL:case Rn.TANGENT:case Rn.CUMULATIVE_DISTANCE:return!1;case Rn.TEXCOORD:case Rn.COLOR:case Rn.JOINTS:case Rn.WEIGHTS:case Rn.FEATURE_ID:case Rn.SCALE:case Rn.ROTATION:return!0}};Rn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Rn.POSITION;case"NORMAL":return Rn.NORMAL;case"TANGENT":return Rn.TANGENT;case"TEXCOORD":return Rn.TEXCOORD;case"COLOR":return Rn.COLOR;case"JOINTS":return Rn.JOINTS;case"WEIGHTS":return Rn.WEIGHTS;case"_FEATURE_ID":return Rn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Rn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Rn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Rn.CUMULATIVE_DISTANCE}};Rn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Rn.POSITION;case"RGBA":case"RGB":case"RGB565":return Rn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Rn.NORMAL;case"BATCH_ID":return Rn.FEATURE_ID}};Rn.getGlslType=function(e){switch(e){case Rn.POSITION:case Rn.NORMAL:case Rn.TANGENT:return"vec3";case Rn.TEXCOORD:return"vec2";case Rn.COLOR:return"vec4";case Rn.JOINTS:return"ivec4";case Rn.WEIGHTS:return"vec4";case Rn.FEATURE_ID:return"int";case Rn.SCALE:return"vec3";case Rn.ROTATION:return"vec4";case Rn.CUMULATIVE_DISTANCE:return"float";case Rn.OPACITY:return"float"}};Rn.getVariableName=function(e,t){let n=m9e(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Rn);var ct=Rn;var eK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Ct.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=p9e(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._dracoError)&&nhe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,s=n.bufferView,a=o[s],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=_9e(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=G_.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=g9e(this,d)}unload(){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}};async function p9e(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=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;nhe(e,n)}}function nhe(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load Draco",t)}async function g9e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Ct.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var Fb={};Fb[ct.POSITION]="POSITION";Fb[ct.NORMAL]="NORMAL";Fb[ct.COLOR]="COLOR";Fb[ct.TEXCOORD]="TEX_COORD";function _9e(e){for(let t in Fb)if(Fb.hasOwnProperty(t)&&e.startsWith(t))return Fb[t]}var RP=eK;function y9e(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).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 W_=y9e;var OP=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=A9e(this),this._promise):(this._promise=b9e(this),this._promise)}unload(){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}};function ihe(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 A9e(e){e._state=Ct.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,r=await T9e(i);if(e.isDestroyed())return;let o=ihe(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(n){return e.isDestroyed()?void 0:rhe(e,n,"Failed to load embedded image")}}async function b9e(e){e._state=Ct.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await C9e(i);if(e.isDestroyed())return;let o=ihe(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(r){return e.isDestroyed()?void 0:rhe(e,r,`Failed to load image: ${n}`)}}function rhe(e,t,n){return e.unload(),e._state=Ct.FAILED,Promise.reject(e.getError(n,t))}function x9e(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 oe("Image format is not recognized")}async function T9e(e){let t=x9e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return tf(n)}return OP._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var E9e=/(^data:image\/ktx2)|(\.ktx2$)/i;function C9e(e){let t=e.getUrlComponent(!1,!0);return E9e.test(t)?tf(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}OP._loadImageFromTypedArray=W_;var MP=OP;function v9e(e,t){yt(e,t)}var Xr=v9e;var ohe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(ohe);var Gc=ohe;var tK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=a,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=w9e(this),this._promise):(this._promise=I9e(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){iK(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=S9e;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Gc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=she(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=Ct.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.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}},nK=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=she(this.typedArray,this.indexDatatype,this.context)}};function she(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var S9e=new nK;async function w9e(e){e._state=Ct.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=Ct.LOADED,e)}catch(n){if(e.isDestroyed())return;iK(e,n)}}async function I9e(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=Ct.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=P9e(e,a),e._state=Ct.PROCESSING,e}catch(s){if(e.isDestroyed())return;iK(e,s)}}function P9e(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=je.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Xr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===je.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===je.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===je.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function iK(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load index buffer",t)}var NP=tK;function D9e(e,t){return t=t??0,cf(e,t,Math.min(4,e.length))}var ip=D9e;function R9e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Pa=R9e;function O9e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var qo=O9e;function nn(){}nn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};nn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};nn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?nn.objectLegacy(i,n):nn.object(i,n)};nn.accessor=function(e,t){return nn.topLevel(e,"accessors",t)};nn.accessorWithSemantic=function(e,t,n){let i={};return nn.mesh(e,function(r){return nn.meshPrimitive(r,function(o){let s=nn.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:nn.meshPrimitiveTarget(o,function(a){return nn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};nn.accessorContainingVertexAttributeData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(r){let o=nn.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:nn.meshPrimitiveTarget(r,function(s){return nn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};nn.accessorContainingIndexData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};nn.animation=function(e,t){return nn.topLevel(e,"animations",t)};nn.animationChannel=function(e,t){let n=e.channels;return nn.object(n,t)};nn.animationSampler=function(e,t){let n=e.samplers;return nn.object(n,t)};nn.buffer=function(e,t){return nn.topLevel(e,"buffers",t)};nn.bufferView=function(e,t){return nn.topLevel(e,"bufferViews",t)};nn.camera=function(e,t){return nn.topLevel(e,"cameras",t)};nn.image=function(e,t){return nn.topLevel(e,"images",t)};nn.material=function(e,t){return nn.topLevel(e,"materials",t)};nn.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 r=t(n[i],i);if(l(r))return r}};nn.mesh=function(e,t){return nn.topLevel(e,"meshes",t)};nn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};nn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};nn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};nn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};nn.node=function(e,t){return nn.topLevel(e,"nodes",t)};nn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=nn.nodeInTree(e,u,n),l(c)))return c}}}};nn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return nn.nodeInTree(e,i,n)};nn.program=function(e,t){return qo(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.programs,t):nn.topLevel(e,"programs",t)};nn.sampler=function(e,t){return nn.topLevel(e,"samplers",t)};nn.scene=function(e,t){return nn.topLevel(e,"scenes",t)};nn.shader=function(e,t){return qo(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.shaders,t):nn.topLevel(e,"shaders",t)};nn.skin=function(e,t){return nn.topLevel(e,"skins",t)};nn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};nn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};nn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};nn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};nn.technique=function(e,t){return qo(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.techniques,t):nn.topLevel(e,"techniques",t)};nn.texture=function(e,t){return nn.topLevel(e,"textures",t)};var Ue=nn;function M9e(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 ad=M9e;function N9e(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 Y.getSizeInBytes(t.componentType)*ad(t.type)}var lf=N9e;function L9e(e){Ue.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Ue.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){if(i.mode=i.mode??te.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=Pa(e.materials,r)}})}),Ue.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=lf(e,i),o.target=te.ARRAY_BUFFER}}),Ue.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Ue.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let o=i.KHR_techniques_webgl;l(o)&&Ue.materialValue(n,function(c){l(c.index)&&Bb(c)}),Bb(n.emissiveTexture),Bb(n.normalTexture),Bb(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,Bb(s.baseColorTexture),Bb(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,Bb(a.specularGlossinessTexture))}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=F9e(e);return Ue.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Ue.sampler(e,function(n){n.wrapS=n.wrapS??te.REPEAT,n.wrapT=n.wrapT??te.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function F9e(e){let t={};return Ue.animation(e,function(n){Ue.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function Bb(e){l(e)&&(e.texCoord=e.texCoord??0)}var P2=L9e;function B9e(e){return Ue.shader(e,function(t){D2(t)}),Ue.buffer(e,function(t){D2(t)}),Ue.image(e,function(t){D2(t)}),D2(e),e}function D2(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var kb=B9e;function k9e(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 R2=k9e;function U9e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),R2(e,t),n.length===0&&delete e.extensionsUsed}}var nC=U9e;var z9e=4;function V9e(e){if(ip(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=ahe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?j9e(e,n):H9e(e,n)}function ahe(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*z9e,!0);return r}function j9e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=cf(e,o,i),c=JSON.parse(a);kb(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return nC(c,"KHR_binary_glTF"),c}function H9e(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=ahe(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=cf(u);r=JSON.parse(f),kb(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var iC=V9e;function G9e(e){return Ue.shader(e,function(t){O2(t)}),Ue.buffer(e,function(t){O2(t)}),Ue.image(e,function(t){O2(t)}),O2(e),e}function O2(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var M2=G9e;function W9e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Pa(n,t,!0)}var Sh=W9e;function q9e(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case Y.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var q_=q9e;function Y9e(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=ad(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=lf(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=q_(y);for(let E=0;E<p;E++){T(b,m,o,A,x);for(let v=0;v<o;v++){let S=x[v];s[v]=Math.min(s[v],S),a[v]=Math.max(a[v],S)}m+=g}return{min:s,max:a}}var rC=Y9e;var X9e=[te.FUNC_ADD,te.FUNC_ADD],K9e=[te.ONE,te.ZERO,te.ONE,te.ZERO];function che(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var $9e=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function J9e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if($9e.indexOf(e[n])===-1)return t;return e}function Z9e(e){let t={},n={},i=e.techniques;return l(i)&&(Ue.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(che(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??X9e,blendFactors:J9e(c.blendFuncSeparate,K9e)})}che(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Sh(e,"KHR_blend")),Ue.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Ue.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var N2=Z9e;function Q9e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Pa(n,t,!0),Sh(e,t)}var L2=Q9e;function e7e(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ue.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Ue.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Ue.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=Pa(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Pa(o.shaders,m,!0),u.program=Pa(o.programs,p),r[a.program]=u.program}i[c]=Pa(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Sh(e,"KHR_techniques_webgl"),L2(e,"KHR_techniques_webgl"))}return Ue.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Ue.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var F2=e7e;function t7e(e,t){qr.typeOf.object("material",e),qr.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,s=t(o.index,o);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,s=t(o.index,o);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:u,specularColorTexture:f}=s;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let u=a.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=Ue.materialValue(e,function(o){if(l(o.index)){let s=t(o.index,o);if(l(s))return s}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,s=t(o.index,o);if(l(s))return s}if(l(e.normalTexture)){let o=e.normalTexture,s=t(o.index,o);if(l(s))return s}if(l(e.occlusionTexture)){let o=e.occlusionTexture,s=t(o.index,o);if(l(s))return s}}var LP=t7e;var lhe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function n7e(e,t){return t=t??lhe,lhe.forEach(function(n){t.indexOf(n)>-1&&r7e(e,n)}),e}var i7e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function r7e(e,t){let n=i7e[t],i=e[n];if(l(i)){let r=0,o=op[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(rp[t](e,a-r),r++)}}function rp(){}rp.accessor=function(e,t){e.accessors.splice(t,1),Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){Ue.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),Ue.meshPrimitiveTarget(r,function(a){Ue.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Ue.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ue.animation(e,function(i){Ue.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};rp.buffer=function(e,t){e.buffers.splice(t,1),Ue.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let s=r.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};rp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ue.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ue.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ue.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),qo(e,"KHR_draco_mesh_compression")&&Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),qo(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(qo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};rp.image=function(e,t){e.images.splice(t,1),Ue.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};rp.mesh=function(e,t){e.meshes.splice(t,1),Ue.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};rp.node=function(e,t){e.nodes.splice(t,1),Ue.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Ue.animation(e,function(i){Ue.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Ue.technique(e,function(i){Ue.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Ue.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Ue.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};rp.material=function(e,t){e.materials.splice(t,1),Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};rp.sampler=function(e,t){e.samplers.splice(t,1),Ue.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};rp.texture=function(e,t){if(e.textures.splice(t,1),Ue.material(e,function(i){LP(i,function(r,o){o.index>t&&--o.index})}),qo(e,"EXT_feature_metadata")){Ue.mesh(e,function(o){Ue.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(qo(e,"EXT_mesh_features")&&Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),qo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function op(){}op.accessor=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){Ue.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Ue.meshPrimitiveTarget(i,function(o){Ue.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Ue.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),qo(e,"EXT_mesh_gpu_instancing")&&Ue.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 r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),qo(e,"CESIUM_primitive_outline")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};op.buffer=function(e){let t={};return Ue.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};op.bufferView=function(e){let t={};if(Ue.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ue.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ue.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),qo(e,"KHR_draco_mesh_compression")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),qo(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].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(qo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};op.image=function(e){let t={};return Ue.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};op.mesh=function(e){let t={};return Ue.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 uhe(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(r){return!uhe(e,r,n)}).length===0}op.node=function(e){let t={};return Ue.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ue.skinJoint(n,function(i){t[i]=!0})}),Ue.animation(e,function(n){Ue.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ue.technique(e,function(n){Ue.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ue.node(e,function(n,i){uhe(e,i,t)||(t[i]=!0)}),t};op.material=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};op.texture=function(e){let t={};if(Ue.material(e,function(n){LP(n,function(i){t[i]=!0})}),qo(e,"EXT_feature_metadata")){Ue.mesh(e,function(r){Ue.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(qo(e,"EXT_mesh_features")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),qo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};op.sampler=function(e){let t={};return Ue.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var B2=n7e;function o7e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:Pa(e.buffers,n),byteOffset:0,byteLength:t.length};return Pa(e.bufferViews,r)}var k2=o7e;function s7e(e,t){let n=lf(e,t),i=Y.getSizeInBytes(t.componentType),r=ad(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=q_(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var U2=s7e;function a7e(e){let t;return Ue.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?z2(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&z2(e,i,Y.UNSIGNED_SHORT)}),Ue.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?z2(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&z2(e,i,Y.UNSIGNED_SHORT)}),e}function z2(e,t,n){let i=Y.createTypedArray(n,U2(e,t)),r=new Uint8Array(i.buffer);t.bufferView=k2(e,r),t.componentType=n,t.byteOffset=0}var V2=a7e;function c7e(e,t){return nC(e,t),t==="CESIUM_RTC"&&l7e(e),rK(e,t)}function l7e(e){Ue.technique(e,function(t){Ue.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function rK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)rK(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 r in e)Object.prototype.hasOwnProperty.call(e,r)&&rK(e[r],t);return i}}var oC=c7e;var j2={.8:p7e,"1.0":F7e,"2.0":void 0};function u7e(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(j2,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(j2,i)||(i="1.0"));let r=j2[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=j2[i];return t.keepLegacyExtensions||(U7e(e,t),z7e(e)),e}function hhe(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function f7e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.primitive??te.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function d7e(e){let t=e.nodes,n=new h,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function h7e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],E=r[x.buffer].extras._pipeline.source,v=E.byteOffset+x.byteOffset+b.byteOffset,S=b.componentType,I=b.count,R=ad(b.type),O=b.count*R,L=Y.createArrayBufferView(S,E.buffer,v,O);for(let _=0;_<I;_++){let C=_*R;h.unpack(L,C,s);let w=L[C+3];Le.fromAxisAngle(s,w,a),Le.pack(a,L,C)}}}}}}function m7e(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function p7e(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,hhe(e),f7e(e),d7e(e),h7e(e),m7e(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Sh(e,"KHR_materials_common")}}function g7e(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function fhe(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function _7e(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=fhe(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Ue.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ue.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ue.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}}),Ue.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ue.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ue.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]})})}),Ue.mesh(e,function(s){Ue.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ue.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ue.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,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Pa(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}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 f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ue.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Ue.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]]}}),Ue.animation(e,function(s){let a={};s.samplers=fhe(s.samplers,a),Ue.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ue.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ue.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ue.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ue.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Ue.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}}),Ue.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function y7e(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){delete n.name})})}function A7e(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]}Ue.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function b7e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var x7e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function T7e(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(x7e[r])&&e.extensionsRequired.push(r)}}}function E7e(e){Ue.buffer(e,function(t){delete t.type})}function C7e(e){Ue.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function v7e(e){Ue.mesh(e,function(t){Ue.meshPrimitive(t,function(n){Ue.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Ue.technique(e,function(t){Ue.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var S7e={POSITION:!0,NORMAL:!0,TANGENT:!0},w7e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function I7e(e){let t={};Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){Ue.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=w7e[a];l(f)?(u=f+c,t[o]=u):l(S7e[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Ue.technique(e,function(n){Ue.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function P7e(e){Ue.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function sK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:lf(e,t)}function D7e(e){Ue.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ue.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=sK(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function R7e(e){let t,n,i,r=e.bufferViews,o={};Ue.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Ue.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=sK(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?sK(e,c[t+1]):void 0;if(g!==b){let x=Ze(i,!0);o[a]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=Pa(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}B2(e,["accessor","bufferView","buffer"])}function O7e(e){Ue.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=rC(e,n);n.min=i.min,n.max=i.max}})}function mhe(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)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function phe(e,t){Ue.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Ue.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),mhe(n)&&phe(e,i))}}),delete e.nodes[t]}function M7e(e){return Ue.node(e,function(t,n){mhe(t)&&phe(e,n)}),e}function N7e(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=rC(e,i);i.min=r.min,i.max=r.max}})})}function L7e(e){Ue.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=rC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function F7e(e){e.asset=e.asset??{},e.asset.version="2.0",hhe(e),g7e(e),M7e(e),_7e(e),y7e(e),b7e(e),T7e(e),D7e(e),R7e(e),O7e(e),N7e(e),L7e(e),E7e(e),C7e(e),v7e(e),I7e(e),V2(e),P7e(e),N2(e),F2(e),A7e(e)}var B7e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],k7e=["u_diffuse","u_diffuse_mat"];function aK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function cK(e){return l(e.index)}function lK(e){return Array.isArray(e)&&e.length===4}function ghe(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 U7e(e,t){t=t??{};let n=t.baseColorTextureNames??B7e,i=t.baseColorFactorNames??k7e;Ue.material(e,function(r){Ue.materialValue(r,function(o,s){n.indexOf(s)!==-1&&cK(o)?(aK(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&lK(o)&&(aK(r),r.pbrMetallicRoughness.baseColorFactor=ghe(o))})}),oC(e,"KHR_techniques_webgl"),oC(e,"KHR_blend")}function oK(e,t){l(t)&&(lK(t)?e.pbrMetallicRoughness.baseColorFactor=ghe(t):cK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function dhe(e,t){l(t)&&(lK(t)?e.emissiveFactor=t.slice(0,3):cK(t)&&(e.emissiveTexture=t))}function z7e(e){Ue.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;aK(t),n.technique==="CONSTANT"?(Sh(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},oK(t,s),oK(t,r)):(oK(t,o),dhe(t,r),dhe(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(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),oC(e,"KHR_materials_common")}var H2=u7e;var _he={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(_he);var Gi=_he;function Wc(){}Wc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${n.message}`);let r=new oe(i);return l(n)&&(r.stack=`Original stack: +${n.stack} +Handler stack: +${r.stack}`),r};Wc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};Wc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Wc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Wc.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}};Wc.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};Wc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ct.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=Vt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var V7e=new h,j7e=new h;Wc.getPositionMinMax=function(e,t,n){let i=Wc.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,j7e),r=h.add(r,n,V7e)),{min:o,max:r}};Wc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===Hi.Y?n=M.clone(Hi.Y_UP_TO_Z_UP,n):e===Hi.X&&(n=M.clone(Hi.X_UP_TO_Z_UP,n)),t===Hi.Z&&(n=M.multiplyTransformation(n,Hi.Z_UP_TO_X_UP,n)),n};var H7e=new $;Wc.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Gi.BACK;let n=M.getMatrix3(e,H7e);return $.determinant(n)<0?Gi.FRONT:Gi.BACK};Wc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Wc.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!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_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!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_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};Wc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Wc.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=Wc;var uK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,s=t.gltfJson,a=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=s,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,l(this._gltfJson)?(this._promise=yhe(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Ahe(this,this._typedArray),this._promise):(this._promise=G7e(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function G7e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;fK(e,n)}return Ahe(e,t)}function fK(e,t){e.unload(),e._state=Ct.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function W7e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!qo(t,"KHR_techniques_webgl")&&!qo(t,"KHR_materials_common"))return Promise.resolve();let n=[];Ue.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),H2(t)}function q7e(e){let t=[];return Ue.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Um(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function Y7e(e,t){let n=[];return Ue.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function yhe(e,t){try{kb(t),await q7e(t),await W7e(e,t),P2(t),await Y7e(e,t),M2(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=Ct.READY,e}catch(n){if(e.isDestroyed())return;fK(e,n)}}async function Ahe(e,t){let n;try{ip(t)==="glTF"?n=iC(t):n=Lo(t)}catch(i){if(e.isDestroyed())return;fK(e,i)}return yhe(e,n)}var FP=uK;var bhe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(bhe);var q0=bhe;var Cr={},dK=class{constructor(){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}},hK=class{constructor(){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}},mK=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},pK=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},gK=class{constructor(){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}},_K=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},yK=class{constructor(){this.attributes=[]}},AK=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},bK=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},xK=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},TK=class{constructor(){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,this.meshVector=void 0}},EK=class{constructor(){this.nodes=[]}},X7e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},CK=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},vK=class{constructor(){this.node=void 0,this.path=void 0}},SK=class{constructor(){this.sampler=void 0,this.target=void 0}},wK=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},IK=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},PK=class{constructor(){this.name=void 0,this.stages=[]}},G2=class{constructor(){this.credits=[]}},DK=class{constructor(){this.asset=new G2,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=M.clone(M.IDENTITY),this.extensions={}}},RK=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},Y_=class Y_{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Y_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Y_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Y_.DEFAULT_ROUGHNESS_FACTOR}};ut(Y_,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(Y_,"DEFAULT_METALLIC_FACTOR",1),ut(Y_,"DEFAULT_ROUGHNESS_FACTOR",1);var W2=Y_,X_=class X_{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(X_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(X_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=X_.DEFAULT_GLOSSINESS_FACTOR}};ut(X_,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(X_,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(X_,"DEFAULT_GLOSSINESS_FACTOR",1);var OK=X_,sC=class sC{constructor(){this.specularFactor=sC.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(sC.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(sC,"DEFAULT_SPECULAR_FACTOR",1),ut(sC,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var MK=sC,aC=class aC{constructor(){this.anisotropyStrength=aC.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=aC.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(aC,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(aC,"DEFAULT_ANISOTROPY_ROTATION",0);var NK=aC,cC=class cC{constructor(){this.clearcoatFactor=cC.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=cC.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(cC,"DEFAULT_CLEARCOAT_FACTOR",0),ut(cC,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var LK=cC,FK=class{constructor(){ut(this,"width");ut(this,"pattern")}},q2=class q2{constructor(t={}){let{wireframeFill:n=q2.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(q2,"DEFAULT_WIREFRAME_FILL",0);var BK=q2,Y2=class Y2{constructor(){this.metallicRoughness=new W2,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=h.clone(Y2.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=q0.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(Y2,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var kK=Y2,UK=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},zK=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Cr.Quantization=dK;Cr.Attribute=hK;Cr.Indices=mK;Cr.FeatureIdAttribute=pK;Cr.FeatureIdTexture=_K;Cr.FeatureIdImplicitRange=gK;Cr.MorphTarget=yK;Cr.Primitive=AK;Cr.Instances=bK;Cr.Skin=xK;Cr.Node=TK;Cr.Scene=EK;Cr.AnimatedPropertyType=Object.freeze(X7e);Cr.AnimationSampler=CK;Cr.AnimationTarget=vK;Cr.AnimationChannel=SK;Cr.Animation=wK;Cr.ArticulationStage=IK;Cr.Articulation=PK;Cr.Asset=G2;Cr.Components=DK;Cr.TextureReader=RK;Cr.MetallicRoughness=W2;Cr.SpecularGlossiness=OK;Cr.Specular=MK;Cr.Anisotropy=NK;Cr.Clearcoat=LK;Cr.PlanarFill=BK;Cr.LineStyle=FK;Cr.Material=kK;Cr.Vector=zK;Cr.Polygon=UK;var Cn=Cr;var X2={};X2.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};X2.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=hn.REPEAT,o=hn.REPEAT,s=Wt.LINEAR,a=Jn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==Wt.LINEAR&&s!==Wt.NEAREST&&(s===Wt.NEAREST_MIPMAP_NEAREST||s===Wt.NEAREST_MIPMAP_LINEAR?s=Wt.NEAREST:s=Wt.LINEAR),hn.validate(r)||(r=hn.REPEAT),hn.validate(o)||(o=hn.REPEAT),Wt.validate(s)||(s=Wt.LINEAR),Jn.validate(a)||(a=Jn.LINEAR),new Ht({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var K7e=new U(1,1);X2.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,s=t.extensions?.KHR_texture_transform;if(l(s)){r=s.texCoord??r;let u=l(s.offset)?U.unpack(s.offset):U.ZERO,f=s.rotation??0,d=l(s.scale)?U.unpack(s.scale):K7e;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let a=new Cn.TextureReader;a.index=t.index,a.texture=i,a.texCoord=r,a.scale=t.scale,a.transform=o,a.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(a.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?U.unpack(c.offset):U.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),a};var uf=X2;function $7e(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Ub=$7e;var VK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,s=t.baseResource,a=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=uf.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:a});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=s,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=Z7e(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Ct.PROCESSING;let n;if(this._asynchronous){let i=J7e;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Gc.TEXTURE))return!1;n=i.texture}else n=xhe(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=Ct.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){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}},jK=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,s){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=s}execute(){this.texture=xhe(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function xhe(e,t,n,i,r,o){let s=i.internalFormat,a=!1;$e.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=uf.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===hn.REPEAT||f===hn.MIRRORED_REPEAT||d===hn.REPEAT||d===hn.MIRRORED_REPEAT,y=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),A=m&&y,b;return l(s)?(!o.webgl2&&$e.isCompressedFormat(s)&&y&&m&&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."),b=Dt.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=Ub(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var J7e=new jK;async function Z7e(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=Ct.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load texture",n)}}var BP=VK;var HK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,s=t.bufferViewId,a=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=s,this._primitive=a,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=tWe(this),this._promise):Q7e(this._draco,this._attributeSemantic)?(this._promise=oWe(this),this._promise):(this._promise=aWe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){K2(this,r)}sWe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){K2(this,r)}rWe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=cWe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Gc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=The(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=Ct.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function Q7e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function eWe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Cn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Vt.VEC2,a.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function tWe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch{if(e.isDestroyed())return}}function nWe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function iWe(e){let t=nWe(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function rWe(e){e._state=Ct.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=P.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=P.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=P.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=P.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=iWe(e._attributeSemantic),o=n.shDegree,s=0,a=[0,9,24];switch(o){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*s+a[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function oWe(e){e._state=Ct.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=Ct.LOADED,e)}catch{if(e.isDestroyed())return;K2(e)}}function sWe(e){e._state=Ct.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=eWe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function aWe(e){e._state=Ct.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=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;K2(e,n)}}function K2(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load vertex buffer",t)}var GK=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=The(this.typedArray,this.context)}};function The(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var cWe=new GK,kP=HK;async function lWe(e={}){var t,n,i,r,o=e,s=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:ce}=await Promise.resolve().then(()=>mWe);var u=ce(import.meta.url)}var f="./this.program",d=import.meta.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(s||a)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(ce){for(var ne=0,Te=ce.length,Ce=new Uint8Array(Te),Je;ne<Te;++ne)Je=ce.charCodeAt(ne),Ce[ne]=~Je>>8&Je;return Ce}var A,b,x,T,E,v,S,I,R,O,L,_,C=!1;function w(){var ce=fb.buffer;x=new Int8Array(ce),E=new Int16Array(ce),o.HEAPU8=T=new Uint8Array(ce),v=new Uint16Array(ce),S=new Int32Array(ce),I=new Uint32Array(ce),o.HEAPF32=R=new Float32Array(ce),O=new Float64Array(ce),L=new BigInt64Array(ce),_=new BigUint64Array(ce)}function D(ce){var ne;throw(ne=o.onAbort)==null||ne.call(o,ce),ce="Aborted("+ce+")",g(ce),m=!0,ce=new WebAssembly.RuntimeError(ce+". Build with -sASSERTIONS for more info."),b?.(ce),ce}var N;async function F(ce){return ce}async function V(ce){var ne=N;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),D(Ce)}}async function B(ce){return V(ce)}var j=ce=>{for(;0<ce.length;)ce.shift()(o)},k=[],G=[],q=()=>{var ce=o.preRun.shift();G.push(ce)},Q={},W=ce=>{for(;ce.length;){var ne=ce.pop();ce.pop()(ne)}};function J(ce){return this.O(I[ce>>2])}var Z={},ae={},Ae={},fe=class extends Error{constructor(ce){super(ce),this.name="InternalError"}},xe=(ce,ne,Te)=>{function Ce(St){if(St=Te(St),St.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],St[bn])}ce.forEach(St=>Ae[St]=ne);var Je=Array(ne.length),Tt=[],pt=0;for(let[St,bn]of ne.entries())ae.hasOwnProperty(bn)?Je[St]=ae[bn]:(Tt.push(bn),Z.hasOwnProperty(bn)||(Z[bn]=[]),Z[bn].push(()=>{Je[St]=ae[bn],++pt,pt===Tt.length&&Ce(Je)}));Tt.length===0&&Ce(Je)},ge=ce=>{for(var ne="";;){var Te=T[ce++];if(!Te)return ne;ne+=String.fromCharCode(Te)}},we=class extends Error{constructor(ce){super(ce),this.name="BindingError"}},ve=ce=>{throw new we(ce)};function Re(ce,ne,Te={}){var Ce=ne.name;if(!ce)throw new we(`type "${Ce}" must have a positive integer typeid pointer`);if(ae.hasOwnProperty(ce)){if(Te.Aa)return;throw new we(`Cannot register type '${Ce}' twice`)}ae[ce]=ne,delete Ae[ce],Z.hasOwnProperty(ce)&&(ne=Z[ce],delete Z[ce],ne.forEach(Je=>Je()))}function Qe(ce,ne,Te={}){return Re(ce,ne,Te)}var He=(ce,ne,Te)=>{switch(ne){case 1:return Te?Ce=>x[Ce]:Ce=>T[Ce];case 2:return Te?Ce=>E[Ce>>1]:Ce=>v[Ce>>1];case 4:return Te?Ce=>S[Ce>>2]:Ce=>I[Ce>>2];case 8:return Te?Ce=>L[Ce>>3]:Ce=>_[Ce>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Ye=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},Ke=!1,Pe=()=>{},qe=ce=>globalThis.FinalizationRegistry?(Ke=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),qe=ne=>{var Te=ne.M;return Te.V&&Ke.register(ne,{M:Te},ne),ne},Pe=ne=>{Ke.unregister(ne)},qe(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),jt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Je){if(!ce[ne].U.hasOwnProperty(Je.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Je.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Je.length].apply(this,Je)},ce[ne].U=[],ce[ne].U[Ce.$]=Ce}},mt=(ce,ne,Te)=>{if(o.hasOwnProperty(ce)){if(Te===void 0||o[ce].U!==void 0&&o[ce].U[Te]!==void 0)throw new we(`Cannot register public name '${ce}' twice`);if(lt(o,ce,ce),o[ce].U.hasOwnProperty(Te))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${Te})!`);o[ce].U[Te]=ne}else o[ce]=ne,o[ce].$=Te},ft=ce=>{ce=ce.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ce.charCodeAt(0);return 48<=ne&&57>=ne?`_${ce}`:ce};function Yt(ce,ne,Te,Ce,Je,Tt,pt,St){this.name=ce,this.constructor=ne,this.ba=Te,this.Z=Ce,this.W=Je,this.va=Tt,this.fa=pt,this.ta=St,this.Ca=[]}var rt=(ce,ne,Te)=>{for(;ne!==Te;){if(!ne.fa)throw new we(`Expected null or instance of ${Te.name}, got an instance of ${ne.name}`);ce=ne.fa(ce),ne=ne.W}return ce},ht=ce=>{if(ce===null)return"null";var ne=typeof ce;return ne==="object"||ne==="array"||ne==="function"?ce.toString():""+ce};function Li(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function Yn(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var Te=this.ka();return ce!==null&&ce.push(this.Z,Te),Te}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(Te=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)Te=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:Te=ne.M.V;break;case 2:if(ne.M.Y===this)Te=ne.M.V;else{var Ce=ne.clone();Te=this.Da(Te,Vi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function gi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var zi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=zi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),Si={},ui=(ce,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;ce.W;)ne=ce.fa(ne),ce=ce.W;return Si[ne]},_i=(ce,ne)=>{if(!ne.R||!ne.P)throw new fe("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new fe("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},qe(Object.create(ce,{M:{value:ne,writable:!0}}))};function zn(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn,mn){this.name=ce,this.N=ne,this.ia=Te,this.ga=Ce,this.ha=Je,this.Ba=Tt,this.Ha=pt,this.pa=St,this.ka=bn,this.Da=Gn,this.Z=mn,Je||ne.W!==void 0?this.S=Yn:(this.S=Ce?Li:gi,this.T=null)}var tn=(ce,ne,Te)=>{if(!o.hasOwnProperty(ce))throw new fe("Replacing nonexistent public symbol");o[ce].U!==void 0&&Te!==void 0?o[ce].U[Te]=ne:(o[ce]=ne,o[ce].$=Te)},Hn=(ce,ne)=>{ce=ge(ce);var Te=RI.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Ki extends Error{}var wr=ce=>{ce=ub(ce);var ne=ge(ce);return Lm(ce),ne},so=(ce,ne)=>{function Te(Tt){Je[Tt]||ae[Tt]||(Ae[Tt]?Ae[Tt].forEach(Te):(Ce.push(Tt),Je[Tt]=!0))}var Ce=[],Je={};throw ne.forEach(Te),new Ki(`${ce}: `+Ce.map(wr).join([", "]))},Ts=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function zs(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function $r(ce,ne,Te,Ce,Je,Tt){var pt=ne.length;if(2>pt)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var St=ne[1]!==null&&Te!==null,bn=zs(ne);Te=!ne[0].oa;var Gn=ne[0],mn=ne[1];for(Ce=[ce,ve,Ce,Je,W,Gn.O.bind(Gn),mn?.S.bind(mn)],Je=2;Je<pt;++Je)Gn=ne[Je],Ce.push(Gn.S.bind(Gn));if(!bn)for(Je=St?1:2;Je<ne.length;++Je)ne[Je].T!==null&&Ce.push(ne[Je].T);for(bn=zs(ne),Je=ne.length-2,mn=[],Gn=["fn"],St&&Gn.push("thisWired"),pt=0;pt<Je;++pt)mn.push(`arg${pt}`),Gn.push(`arg${pt}Wired`);mn=mn.join(","),Gn=Gn.join(","),mn=`return function (${mn}) { +`,bn&&(mn+=`var destructors = []; +`);var Ao=bn?"destructors":"null",co="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(St&&(mn+=`var thisWired = toClassParamWire(${Ao}, this); +`),pt=0;pt<Je;++pt){var Vs=`toArg${pt}Wire`;mn+=`var arg${pt}Wired = ${Vs}(${Ao}, arg${pt}); +`,co.push(Vs)}if(mn+=(Te||Tt?"var rv = ":"")+`invoker(${Gn}); +`,bn)mn+=`runDestructors(destructors); +`;else for(pt=St?1:2;pt<ne.length;++pt)Tt=pt===1?"thisWired":"arg"+(pt-2)+"Wired",ne[pt].T!==null&&(mn+=`${Tt}_dtor(${Tt}); +`,co.push(`${Tt}_dtor`));return Te&&(mn+=`var ret = fromRetWire(rv); +return ret; +`),ne=new Function(co,mn+`} +`)(...Ce),vt(ce,ne)}var hi=ce=>{ce=ce.trim();let ne=ce.indexOf("(");return ne===-1?ce:ce.slice(0,ne)},ao=[],nr=[0,1,,1,null,1,!0,1,!1,1],jo=ce=>{9<ce&&--nr[ce+1]===0&&(nr[ce]=void 0,ao.push(ce))},Fn=ce=>{if(!ce)throw new we(`Cannot use deleted val. handle = ${ce}`);return nr[ce]},Vi=ce=>{switch(ce){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ao.pop()||nr.length;return nr[ne]=ce,nr[ne+1]=1,ne}},Fi={name:"emscripten::val",O:ce=>{var ne=Fn(ce);return jo(ce),ne},S:(ce,ne)=>Vi(ne),X:J,T:null},Ir=(ce,ne,Te)=>{switch(ne){case 1:return Te?function(Ce){return this.O(x[Ce])}:function(Ce){return this.O(T[Ce])};case 2:return Te?function(Ce){return this.O(E[Ce>>1])}:function(Ce){return this.O(v[Ce>>1])};case 4:return Te?function(Ce){return this.O(S[Ce>>2])}:function(Ce){return this.O(I[Ce>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Mc=(ce,ne)=>{var Te=ae[ce];if(Te===void 0)throw ce=`${ne} has unknown type ${wr(ce)}`,new we(ce);return Te},qf=(ce,ne)=>{switch(ne){case 4:return function(Te){return this.O(R[Te>>2])};case 8:return function(Te){return this.O(O[Te>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ce}`)}},Rm=(ce,ne,Te)=>{let Ce=(Je,Tt)=>{let pt=0;return{next(){if(pt>=Je)return{done:!0};let St=pt;return pt++,{value:Tt(St),done:!1}},[Symbol.iterator](){return this}}};ce[Symbol.iterator]||(ce[Symbol.iterator]=function(){let Je=this[ne]();return Ce(Je,Tt=>this[Te](Tt))})},ch=Object.assign({optional:!0},Fi),na=(ce,ne,Te)=>{var Ce=T;if(!(0<Te))return 0;var Je=ne;Te=ne+Te-1;for(var Tt=0;Tt<ce.length;++Tt){var pt=ce.codePointAt(Tt);if(127>=pt){if(ne>=Te)break;Ce[ne++]=pt}else if(2047>=pt){if(ne+1>=Te)break;Ce[ne++]=192|pt>>6,Ce[ne++]=128|pt&63}else if(65535>=pt){if(ne+2>=Te)break;Ce[ne++]=224|pt>>12,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63}else{if(ne+3>=Te)break;Ce[ne++]=240|pt>>18,Ce[ne++]=128|pt>>12&63,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63,Tt++}}return Ce[ne]=0,ne-Je},Om=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te){var Ce=ce.charCodeAt(Te);127>=Ce?ne++:2047>=Ce?ne+=2:55296<=Ce&&57343>=Ce?(ne+=4,++Te):ne+=3}return ne},Es=new TextDecoder,Ha=(ce,ne,Te,Ce)=>{if(Te=ne+Te,Ce)return Te;for(;ce[ne]&&!(ne>=Te);)++ne;return ne},cb=new TextDecoder("utf-16le"),ii=(ce,ne,Te)=>(ce>>=1,cb.decode(v.subarray(ce,Ha(v,ce,ne/2,Te)))),Wr=(ce,ne,Te)=>{if(Te??(Te=2147483647),2>Te)return 0;Te-=2;var Ce=ne;Te=Te<2*ce.length?Te/2:ce.length;for(var Je=0;Je<Te;++Je)E[ne>>1]=ce.charCodeAt(Je),ne+=2;return E[ne>>1]=0,ne-Ce},_l=ce=>2*ce.length,w0=(ce,ne,Te)=>{var Ce="";ce>>=2;for(var Je=0;!(Je>=ne/4);Je++){var Tt=I[ce+Je];if(!Tt&&!Te)break;Ce+=String.fromCodePoint(Tt)}return Ce},Ca=(ce,ne,Te)=>{if(Te??(Te=2147483647),4>Te)return 0;var Ce=ne;Te=Ce+Te-4;for(var Je=0;Je<ce.length;++Je){var Tt=ce.codePointAt(Je);if(65535<Tt&&Je++,S[ne>>2]=Tt,ne+=4,ne+4>Te)break}return S[ne>>2]=0,ne-Ce},Mm=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te)65535<ce.codePointAt(Te)&&Te++,ne+=4;return ne},A_=[],$W=ce=>{var ne=A_.length;return A_.push(ce),ne},JW=(ce,ne)=>{for(var Te=Array(ce),Ce=0;Ce<ce;++Ce)Te[Ce]=Mc(I[ne+4*Ce>>2],`parameter ${Ce}`);return Te},ZW=(ce,ne,Te)=>{var Ce=[];return ce=ce(Ce,Te),Ce.length&&(I[ne>>2]=Vi(Ce)),ce},QW={},Nm=ce=>{var ne=QW[ce];return ne===void 0?ge(ce):ne},uE={},lb=()=>{var ce;if(!lh){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ce=globalThis.navigator)==null?void 0:ce.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},Te;for(Te in uE)uE[Te]===void 0?delete ne[Te]:ne[Te]=uE[Te];var Ce=[];for(Te in ne)Ce.push(`${Te}=${ne[Te]}`);lh=Ce}return lh},lh,eq=[null,[],[]];if((()=>{let ce=st.prototype;Object.assign(ce,{isAliasOf:function(Te){if(!(this instanceof st&&Te instanceof st))return!1;var Ce=this.M.R.N,Je=this.M.P;Te.M=Te.M;var Tt=Te.M.R.N;for(Te=Te.M.P;Ce.W;)Je=Ce.fa(Je),Ce=Ce.W;for(;Tt.W;)Te=Tt.fa(Te),Tt=Tt.W;return Ce===Tt&&Je===Te},clone:function(){if(this.M.P||Ye(this),this.M.ea)return this.M.count.value+=1,this;var Te=qe,Ce=Object,Je=Ce.create,Tt=Object.getPrototypeOf(this),pt=this.M;return Te=Te(Je.call(Ce,Tt,{M:{value:{count:pt.count,da:pt.da,ea:pt.ea,P:pt.P,R:pt.R,V:pt.V,Y:pt.Y}}})),Te.M.count.value+=1,Te.M.da=!1,Te},delete(){if(this.M.P||Ye(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var Te=this.M;--Te.count.value,Te.count.value===0&&(Te.V?Te.Y.Z(Te.V):Te.R.N.Z(Te.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||Ye(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(ce[ne]=ce.delete)})(),Object.assign(zn.prototype,{wa(ce){return this.pa&&(ce=this.pa(ce)),ce},ma(ce){var ne;(ne=this.Z)==null||ne.call(this,ce)},X:J,O:function(ce){function ne(){return this.ha?_i(this.N.ba,{R:this.Ba,P:Te,Y:this,V:ce}):_i(this.N.ba,{R:this,P:ce})}var Te=this.wa(ce);if(!Te)return this.ma(ce),null;var Ce=ui(this.N,Te);if(Ce!==void 0)return Ce.M.count.value===0?(Ce.M.P=Te,Ce.M.V=ce,Ce.clone()):(Ce=Ce.clone(),this.ma(ce),Ce);if(Ce=this.N.va(Te),Ce=jt[Ce],!Ce)return ne.call(this);Ce=this.ga?Ce.sa:Ce.pointerType;var Je=zi(Te,this.N,Ce.N);return Je===null?ne.call(this):this.ha?_i(Ce.N.ba,{R:Ce,P:Je,Y:this,V:ce}):_i(Ce.N.ba,{R:Ce,P:Je})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var ub,fE,Lm,fb,RI,dE={y:()=>D(""),r:ce=>{var ne=Q[ce];delete Q[ce];var Te=ne.ka,Ce=ne.Z,Je=ne.na,Tt=Je.map(pt=>pt.za).concat(Je.map(pt=>pt.Fa));xe([ce],Tt,pt=>{var St={},bn,Gn;for([bn,Gn]of Je.entries()){let mn=pt[bn],Ao=Gn.xa,co=Gn.ya,Vs=pt[bn+Je.length],pc=Gn.Ea,yl=Gn.Ga;St[Gn.ua]={read:tu=>mn.O(Ao(co,tu)),write:(tu,I0)=>{var Et=[];pc(yl,tu,Vs.S(Et,I0)),W(Et)},optional:mn.optional}}return[{name:ne.name,O:mn=>{var Ao={},co;for(co in St)Ao[co]=St[co].read(mn);return Ce(mn),Ao},S:(mn,Ao)=>{for(var co in St)if(!(co in Ao||St[co].optional))throw new TypeError(`Missing field: "${co}"`);var Vs=Te();for(co in St)St[co].write(Vs,Ao[co]);return mn!==null&&mn.push(Ce,Vs),Vs},X:J,T:Ce}]})},o:(ce,ne,Te,Ce,Je)=>{ne=ge(ne),Ce=Ce===0n;let Tt=pt=>pt;if(Ce){let pt=8*Te;Tt=St=>BigInt.asUintN(pt,St),Je=Tt(Je)}Qe(ce,{name:ne,O:Tt,S:(pt,St)=>(typeof St=="number"&&(St=BigInt(St)),St),X:He(ne,Te,!Ce),T:null})},C:(ce,ne,Te,Ce)=>{ne=ge(ne),Qe(ce,{name:ne,O:function(Je){return!!Je},S:function(Je,Tt){return Tt?Te:Ce},X:function(Je){return this.O(T[Je])},T:null})},k:(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn,mn,Ao,co)=>{mn=ge(mn),Tt=Hn(Je,Tt),St&&(St=Hn(pt,St)),Gn&&(Gn=Hn(bn,Gn)),co=Hn(Ao,co);var Vs=ft(mn);mt(Vs,function(){so(`Cannot construct ${mn} due to unbound types`,[Ce])}),xe([ce,ne,Te],Ce?[Ce]:[],pc=>{if(pc=pc[0],Ce)var yl=pc.N,tu=yl.ba;else tu=st.prototype;pc=vt(mn,function(...Fe){if(Object.getPrototypeOf(this)!==I0)throw new we(`Use 'new' to construct ${mn}`);if(Et.aa===void 0)throw new we(`${mn} has no accessible constructor`);var gt=Et.aa[Fe.length];if(gt===void 0)throw new we(`Tried to invoke ctor of ${mn} with invalid number of parameters (${Fe.length}) - expected (${Object.keys(Et.aa).toString()}) parameters instead!`);return gt.apply(this,Fe)});var I0=Object.create(tu,{constructor:{value:pc}});pc.prototype=I0;var Et=new Yt(mn,pc,I0,co,yl,Tt,St,Gn);if(Et.W){var ye;(ye=Et.W).la??(ye.la=[]),Et.W.la.push(Et)}return yl=new zn(mn,Et,!0,!1,!1),ye=new zn(mn+"*",Et,!1,!1,!1),tu=new zn(mn+" const*",Et,!1,!0,!1),jt[ce]={pointerType:ye,sa:tu},tn(Vs,pc),[yl,ye,tu]})},g:(ce,ne,Te,Ce,Je,Tt)=>{var pt=Ts(ne,Te);Je=Hn(Ce,Je),xe([],[ce],St=>{St=St[0];var bn=`constructor ${St.name}`;if(St.N.aa===void 0&&(St.N.aa=[]),St.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${St.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return St.N.aa[ne-1]=()=>{so(`Cannot construct ${St.name} due to unbound types`,pt)},xe([],pt,Gn=>(Gn.splice(1,0,null),St.N.aa[ne-1]=$r(bn,Gn,null,Je,Tt),[])),[]})},b:(ce,ne,Te,Ce,Je,Tt,pt,St,bn)=>{var Gn=Ts(Te,Ce);ne=ge(ne),ne=hi(ne),Tt=Hn(Je,Tt),xe([],[ce],mn=>{function Ao(){so(`Cannot call ${co} due to unbound types`,Gn)}mn=mn[0];var co=`${mn.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),St&&mn.N.Ca.push(ne);var Vs=mn.N.ba,pc=Vs[ne];return pc===void 0||pc.U===void 0&&pc.className!==mn.name&&pc.$===Te-2?(Ao.$=Te-2,Ao.className=mn.name,Vs[ne]=Ao):(lt(Vs,ne,co),Vs[ne].U[Te-2]=Ao),xe([],Gn,yl=>(yl=$r(co,yl,mn,Tt,pt,bn),Vs[ne].U===void 0?(yl.$=Te-2,Vs[ne]=yl):Vs[ne].U[Te-2]=yl,[])),[]})},A:ce=>Qe(ce,Fi),s:(ce,ne,Te,Ce,Je)=>{switch(ne=ge(ne),Je=Je===0?"object":Je===1?"number":"string",Je){case"object":let pt=function(){};pt.values={},Qe(ce,{name:ne,constructor:pt,valueType:Je,O:function(St){return this.constructor.values[St]},S:(St,bn)=>bn.value,X:Ir(ne,Te,Ce),T:null}),mt(ne,pt);break;case"number":var Tt={};Qe(ce,{name:ne,ja:Tt,valueType:Je,O:St=>St,S:(St,bn)=>bn,X:Ir(ne,Te,Ce),T:null}),mt(ne,Tt),delete o[ne].$;break;case"string":Tt={},Qe(ce,{name:ne,ra:{},qa:{},ja:Tt,valueType:Je,O:function(St){return this.qa[St]},S:function(St,bn){return this.ra[bn]},X:Ir(ne,Te,Ce),T:null}),mt(ne,Tt),delete o[ne].$}},d:(ce,ne,Te)=>{var Ce=Mc(ce,"enum");switch(ne=ge(ne),Ce.valueType){case"object":ce=Ce.constructor,Ce=Object.create(Ce.constructor.prototype,{value:{value:Te},constructor:{value:vt(`${Ce.name}_${ne}`,function(){})}}),ce.values[Te]=Ce,ce[ne]=Ce;break;case"number":Ce.ja[ne]=Te;break;case"string":Ce.ra[ne]=Te,Ce.qa[Te]=ne,Ce.ja[ne]=ne}},n:(ce,ne,Te)=>{ne=ge(ne),Qe(ce,{name:ne,O:Ce=>Ce,S:(Ce,Je)=>Je,X:qf(ne,Te),T:null})},m:(ce,ne,Te,Ce,Je,Tt,pt)=>{var St=Ts(ne,Te);ce=ge(ce),ce=hi(ce),Je=Hn(Ce,Je),mt(ce,function(){so(`Cannot call ${ce} due to unbound types`,St)},ne-1),xe([],St,bn=>(bn=[bn[0],null].concat(bn.slice(1)),tn(ce,$r(ce,bn,null,Je,Tt,pt),ne-1),[]))},c:(ce,ne,Te,Ce,Je)=>{ne=ge(ne);let Tt=St=>St;if(Ce===0){var pt=32-8*Te;Tt=St=>St<<pt>>>pt,Je=Tt(Je)}Qe(ce,{name:ne,O:Tt,S:(St,bn)=>bn,X:He(ne,Te,Ce!==0),T:null})},j:(ce,ne,Te,Ce)=>{Te=ge(Te),Ce=ge(Ce),xe([],[ce,ne],Je=>(Rm(Je[0].N.ba,Te,Ce),[]))},a:(ce,ne,Te)=>{function Ce(Tt){return new Je(x.buffer,I[Tt+4>>2],I[Tt>>2])}var Je=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Te=ge(Te),Qe(ce,{name:Te,O:Ce,X:Ce},{Aa:!0})},h:ce=>{Qe(ce,ch)},B:(ce,ne)=>{ne=ge(ne),Qe(ce,{name:ne,O(Te){var Ce=(Ce=Te+4)?Es.decode(T.subarray(Ce,Ha(T,Ce,I[Te>>2],!0))):"";return Lm(Te),Ce},S(Te,Ce){Ce instanceof ArrayBuffer&&(Ce=new Uint8Array(Ce));var Je=typeof Ce=="string";if(!(Je||ArrayBuffer.isView(Ce)&&Ce.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var Tt=Je?Om(Ce):Ce.length,pt=fE(4+Tt+1),St=pt+4;return I[pt>>2]=Tt,Je?na(Ce,St,Tt+1):T.set(Ce,St),Te!==null&&Te.push(Lm,pt),pt},X:J,T(Te){Lm(Te)}})},f:(ce,ne,Te)=>{if(Te=ge(Te),ne===2)var Ce=ii,Je=Wr,Tt=_l;else Ce=w0,Je=Ca,Tt=Mm;Qe(ce,{name:Te,O:pt=>{var St=Ce(pt+4,I[pt>>2]*ne,!0);return Lm(pt),St},S:(pt,St)=>{if(typeof St!="string")throw new we(`Cannot pass non-string to C++ string type ${Te}`);var bn=Tt(St),Gn=fE(4+bn+ne);return I[Gn>>2]=bn/ne,Je(St,Gn+4,bn+ne),pt!==null&&pt.push(Lm,Gn),Gn},X:J,T(pt){Lm(pt)}})},i:(ce,ne,Te,Ce,Je,Tt)=>{Q[ce]={name:ge(ne),ka:Hn(Te,Ce),Z:Hn(Je,Tt),na:[]}},e:(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn)=>{Q[ce].na.push({ua:ge(ne),za:Te,xa:Hn(Ce,Je),ya:Tt,Fa:pt,Ea:Hn(St,bn),Ga:Gn})},D:(ce,ne)=>{ne=ge(ne),Qe(ce,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(ce,ne,Te)=>{var[Ce,...Je]=JW(ce,ne);ne=Ce.S.bind(Ce);var Tt=Je.map(bn=>bn.X.bind(bn));ce--;var pt={toValue:Fn};switch(ce=Tt.map((bn,Gn)=>{var mn=`argFromPtr${Gn}`;return pt[mn]=bn,`${mn}(args${Gn?"+"+8*Gn:""})`}),Te){case 0:var St="toValue(handle)";break;case 2:St="new (toValue(handle))";break;case 3:St="";break;case 1:pt.getStringOrSymbol=Nm,St="toValue(handle)[getStringOrSymbol(methodName)]"}return St+=`(${ce})`,Ce.oa||(pt.toReturnWire=ne,pt.emval_returnValue=ZW,St=`return emval_returnValue(toReturnWire, destructorsRef, ${St})`),St=`return function (handle, methodName, destructorsRef, args) { +${St} +}`,Te=new Function(Object.keys(pt),St)(...Object.values(pt)),St=`methodCaller<(${Je.map(bn=>bn.name)}) => ${Ce.name}>`,$W(vt(St,Te))},F:jo,p:(ce,ne,Te,Ce,Je)=>A_[ce](ne,Te,Ce,Je),E:ce=>{var ne=Fn(ce);W(ne),jo(ce)},t:(ce,ne,Te,Ce)=>{var Je=new Date().getFullYear(),Tt=new Date(Je,0,1).getTimezoneOffset();Je=new Date(Je,6,1).getTimezoneOffset(),I[ce>>2]=60*Math.max(Tt,Je),S[ne>>2]=+(Tt!=Je),ne=pt=>{var St=Math.abs(pt);return`UTC${0<=pt?"-":"+"}${String(Math.floor(St/60)).padStart(2,"0")}${String(St%60).padStart(2,"0")}`},ce=ne(Tt),ne=ne(Je),Je<Tt?(na(ce,Te,17),na(ne,Ce,17)):(na(ce,Ce,17),na(ne,Te,17))},z:ce=>{var ne=T.length;if(ce>>>=0,2147483648<ce)return!1;for(var Te=1;4>=Te;Te*=2){var Ce=ne*(1+.2/Te);Ce=Math.min(Ce,ce+100663296);e:{Ce=(Math.min(2147483648,65536*Math.ceil(Math.max(ce,Ce)/65536))-fb.buffer.byteLength+65535)/65536|0;try{fb.grow(Ce),w();var Je=1;break e}catch{}Je=void 0}if(Je)return!0}return!1},u:(ce,ne)=>{var Te=0,Ce=0,Je;for(Je of lb()){var Tt=ne+Te;I[ce+Ce>>2]=Tt,Te+=na(Je,Tt,1/0)+1,Ce+=4}return 0},v:(ce,ne)=>{var Te=lb();I[ce>>2]=Te.length,ce=0;for(var Ce of Te)ce+=Om(Ce)+1;return I[ne>>2]=ce,0},w:()=>52,x:function(){return 70},l:(ce,ne,Te,Ce)=>{for(var Je=0,Tt=0;Tt<Te;Tt++){var pt=I[ne>>2],St=I[ne+4>>2];ne+=8;for(var bn=0;bn<St;bn++){var Gn=ce,mn=T[pt+bn],Ao=eq[Gn];mn===0||mn===10?(Gn=Gn===1?p:g,mn=Ha(Ao,0),mn=Es.decode(Ao.buffer?Ao.subarray(0,mn):new Uint8Array(Ao.slice(0,mn))),Gn(mn),Ao.length=0):Ao.push(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! +  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83"\fB \x88! B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq" A\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"\rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\v !\f\v  \rB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\vB\0!\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  \r\x84B\0!P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\v\f\v \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\v\f\v  \r\x84P@B\0!\f\v  \x84P@B\0!\f\v \rB\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xD0\0j  \f  \f \fP"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )X"\fB \x88! )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A@k  +  + +P"\b\x1ByB\xC0\0B\0 \b\x1B|\xA7"\bAk6  \bkAj! )H! + )@!\v \x07 j jA\xFF\xFF\0k!@ +B\x86"B \x88B\x80\x80\x80\x80\b\x84" B \x88"~" B\x86"B \x88" + B\x80\x80\x84"\r~|" T\xAD  B1\x88 \x84B\xFF\xFF\xFF\xFF\x83" \fB\xFF\xFF\xFF\xFF\x83"\f~|" T\xAD|  \r~|   B\x80\x80\xFE\xFF\x83" \f~"  +~|" T\xAD    B\xFF\xFF\xFF\xFF\x83"~|"V\xAD||"V\xAD|  \r~"  \f~|" T\xADB \x86 B \x88\x84|   B \x86|"V\xAD|  \r ~"\r + \f~|"\f  ~|"  ~|"B \x88  V\xAD \f \rT\xAD  \fT\xAD||B \x86\x84|" T\xAD|    ~"\f  +~|"B \x88  \fT\xADB \x86\x84|" + T\xAD + B \x86|" +T\xAD||" + T\xAD| +  B \x86"  ~|" T\xAD|" T\xAD|" +T\xAD|"B\x80\x80\x80\x80\x80\x80\xC0\0\x83PE@ Aj!\f\v B?\x88 B\x86 B?\x88\x84! B\x86 B?\x88\x84! B\x86! B\x86\x84!\v A\xFF\xFFN@ \vB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\vB\0!\f\v~ A\0L@A k"\x07A\xFF\0M@ A0j   A\xFF\0j"6 A j   6 Aj   \x07g    \x07g )0 )8\x84B\0R\xAD ) )\x84\x84! )( )\x84! )\0! )\b\f\vB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84\v \v\x84!\v P B\0Y B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FQ\x1BE@ \v B|"P\xAD|!\v\f\v  B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84PE@ !\f\v \v  B\x83|" T\xAD|!\v\v \0 7\0 \0 \v7\b A\xE0\0j$\0\v\0 \0!\vr\x7F#\0Ak"$\0  \x006 \0(\0A\x7FG@  Aj6\f  A\fj6\b A\bj!@ \0(\0AF\r\0\v \0(\0E@ \0A6\0 \xF2 \0A\x7F6\0\v\v \0( Aj$\0Ak\v\xB2\x7F#\0Ak"$\0 \0 \0(Aj6  \x006\f@A\xF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\vA\x90\xD8(\0 F@A\x90\xD8 6\0A\x84\xD8A\x84\xD8(\0 \x07j"\x006\0  \0Ar6 \0 j \x006\0\f\v ("\0AqAF@ \0Axq! (\f!@ \0A\xFFM@ (\b" F@A\xFC\xD7A\xFC\xD7(\0A~ \0Avwq6\0\f\v  6\f  6\b\f\v (!@  G@ (\b"\0 6\f  \x006\b\f\v@ ("\0\x7F Aj ("\0E\r Aj\v!@ ! \0"Aj! \0("\0\r\0 Aj! ("\0\r\0\v A\x006\0\f\vA\0!\v E\r\0@ ("\0At"(\xAC\xDA F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ \0wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("\0@  \x006 \0 6\v ("\0E\r\0  \x006 \0 6\v \x07 j!\x07  j"(!\0\v  \0A~q6  \x07Ar6  \x07j \x076\0 \x07A\xFFM@ \x07A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A \x07Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA! \x07A\xFF\xFF\xFF\x07M@ \x07A& \x07A\bvg"\0kvAq \0AtrA>s!\v  6 B\x007 AtA\xAC\xDAj!\0@@A\x80\xD8(\0"A t"qE@A\x80\xD8  r6\0 \0 6\0\f\v \x07A AvkA\0 AG\x1Bt! \0(\0!@ "\0(Axq \x07F\r Av! At! \0 Aqj"("\r\0\v  6\v  \x006  6\f  6\b\f\v \0(\b" 6\f \0 6\b A\x006  \x006\f  6\b\v \bA\bj!\0\f\v@ \bE\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \x07A~ wq"\x076\0\f\v@  \b(F@ \b \x006\f\v \b \x006\v \0E\r\v \0 \b6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 A\xFFM@ A\xF8qA\xA4\xD8j!\0\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\f\vA!\0 A\xFF\xFF\xFF\x07M@ A& A\bvg"\0kvAq \0AtrA>s!\0\v  \x006 B\x007 \0AtA\xAC\xDAj!@@ \x07A \0t"qE@A\x80\xD8  \x07r6\0  6\0  6\f\v A \0AvkA\0 \0AG\x1Bt!\0 (\0!@ "(Axq F\r \0Av! \0At!\0  Aqj"\x07("\r\0\v \x07 6  6\v  6\f  6\b\f\v (\b"\0 6\f  6\b A\x006  6\f  \x006\b\v A\bj!\0\f\v@ E\r\0@ ("At"(\xAC\xDA F@ A\xAC\xDAj \x006\0 \0\rA\x80\xD8 \vA~ wq6\0\f\v@  (F@ \x006\f\v \x006\v \0E\r\v \0 6 ("@ \0 6  \x006\v ("E\r\0 \0 6  \x006\v@ AM@   j"\0Ar6 \0 j"\0 \0(Ar6\f\v  Ar6  j" Ar6  j 6\0 \b@ \bAxqA\xA4\xD8j!\0A\x90\xD8(\0!\x7FA \bAvt"\x07 qE@A\xFC\xD7  \x07r6\0 \0\f\v \0(\b\v! \0 6\b  6\f  \x006\f  6\b\vA\x90\xD8 6\0A\x84\xD8 6\0\v A\bj!\0\v +Aj$\0 \0\v\0\x9C\0\v;\x7F#\0Ak"$\0  \x006\f (\f"\0(\0"@ \0 6 \0(\b !\v Aj$\0\vu~ \0  ~  ~| B \x88" B \x88"~| B\xFF\xFF\xFF\xFF\x83" B\xFF\xFF\xFF\xFF\x83"~"B \x88  ~|"B \x88|  ~ B\xFF\xFF\xFF\xFF\x83|"B \x88|7\b \0 B\xFF\xFF\xFF\xFF\x83 B \x86\x847\0\v\xC1\x7F \0-\0\0A qE@@ \0("\x7F  \0\xC9\r \0(\v \0("k I@ \0   \0($\0\f\v@@ E \0(PA\0Hr\r\0 !@  j"Ak-\0\0A +G@ Ak"\r\f\v\v \0   \0($\0 I\r  k! \0(!\f\v !\v   Y \0 \0( j6\v\v\v\x7FA9" \0(\x006\0 \v\xC0\x7F@  kAH\r\0 \0( \0,\0\v" A\0H\x1BE\r\0  \x8F \0(\0 \0 \0,\0\v"A\0H"\x1B" \0(  \x1Bj! Ak!\0@@@ -\0\0"Ak! \0 M\r\0 A\xFFqA\xFD\0M@ (\0 G\r\v Aj!   kAJj!\f\v\v A\xFFqA\xFD\0K\r \0(\0Ak I\r\v A6\0\v\vP~@ A\xC0\0q@  A@j\xAD\x86!B\0!\f\v E\r\0  \xAD"\x86 A\xC0\0 k\xAD\x88\x84!  \x86!\v \0 7\0 \0 7\b\vi\x7F#\0A\x80k"$\0 A\x80\xC0q  LrE@    k"A\x80 A\x80I"\x1B\xC6 E@@ \0 A\x803 A\x80k"A\xFFK\r\0\v\v \0  3\v A\x80j$\0\v\0A\0\v<\x7FA \0 \0AM\x1B!@@ /"\0\r\0A\xB4\xEC(\0"E\r\0 \r\0\f\v\v \0E@0\0\v \0\v \0 \0(\0C\v +\0 \0(\0A\xC0\v\xCD \x7F~#\0A\xF0\0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83! @@ P" B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}B\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FT +P\x1BE@ B\0R B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0}"\vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FV \vB\x80\x80\x80\x80\x80\x80\xC0\x80\x80\x7FQ\x1B\r\v  +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84! !\f\v P B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\v  +B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0   \x85  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x85\x84P"\x1B!B\0  \x1B!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P\r  +\x84P@  \x84B\0R\r  \x83!  \x83!\f\v  \x84PE\r\0 ! !\f\v    T +V +Q\x1B"\b\x1B! +   \b\x1B"\fB\xFF\xFF\xFF\xFF\xFF\xFF?\x83!   \b\x1B"\vB0\x88\xA7A\xFF\xFFq!\x07 \fB0\x88\xA7A\xFF\xFFq"E@ A\xE0\0j + + P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6 )h! )\`! +A k!\v   \b\x1B! \vB\xFF\xFF\xFF\xFF\xFF\xFF?\x83! \x07~  A\xD0\0j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B|\xA7"\x07Ak6A \x07k!\x07 )P! )X\vB\x86 B=\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84! B\x86 +B=\x88\x84  \x85!~ B\x86"  \x07F\r\0  \x07k"\x07A\xFF\0K@B\0!B\f\v A@k  A\x80 \x07k6 A0j   \x07g )8! )0 )@ )H\x84B\0R\xAD\x84\v! B\x80\x80\x80\x80\x80\x80\x80\x84!\v +B\x86! +@ B\0S@B\0!B\0! +\x85  \v\x85\x84P\r + }! \v } +V\xAD}"B\xFF\xFF\xFF\xFF\xFF\xFF\xFFV\r A j     P"\x07\x1ByB\xC0\0B\0 \x07\x1B\x84\xA7A\fk"\x076  \x07k! )(! ) !\f\v +|" T\xAD  \v||"B\x80\x80\x80\x80\x80\x80\x80\b\x83P\r\0 B\x83 B?\x86 B\x88\x84\x84! Aj! B\x88!\v \fB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83! A\xFF\xFFN@ B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!B\0!\f\vA\0!\x07@ A\0J@ !\x07\f\v Aj   A\xFF\0j6   A kg )\0 ) )\x84B\0R\xAD\x84! )\b!\v B=\x86 B\x88\x84! B\x88B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \x07\xADB0\x86\x84 \x84!@@ \xA7A\x07q"AG@    AK\xAD|"V\xAD|!\f\v    B\x83|"V\xAD|!\f\v E\r\v\v \0 7\0 \0 7\b A\xF0\0j$\0\v +\0 \0A\x9C\xE0^\v +\0 \0A\xA4\xE0^\v\x84\x7F~#\0Ak"$\0 \0~ E@B\0\f\v   Au"s k"\xADB\0 g"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85A\x9E\x80 k\xADB0\x86|B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FB\0 A\0H\x1B\x84! )\0\v7\0 \0 7\b Aj$\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v -\0\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v -\0\0\v1\x7F \0(\f" \0(F@ \0 \0(\0((\0\0\v (\0 \0 Aj6\f\v'\x7F \0(\f" \0(F@ \0 \0(\0($\0\0\v (\0\v\xAA\f\b\x7F\x7FA\0 E\r\0 \0A\x7Fs! AO@@ AqE\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Ak"\0E Aj"AqErE@ -\0 sA\xFFqAt(\xE03 A\bvs! Aj! Ak!\f\v \0! !\f\v \0! !\f\v \0! !\v An"\bAll! +@ \bAk" E@A\0!\f\v !\0A\0!@ \0( \x07s"\x07AvA\xFC\x07q(\xE0S \x07AvA\xFC\x07q(\xE0K \x07AvA\xFC\x07q(\xE0C \x07A\xFFqAt(\xE0;sss!\x07 \0(\f s"AvA\xFC\x07q(\xE0S AvA\xFC\x07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xE03s! A\bj! A\bk"A\x07K\r\0\v\v@ E\r\0 -\0\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs! AF\r\0 -\0 sA\xFFqAt(\xE03 A\bvs!\v A\x7Fs\v\v\x97\x7F#\0A@j"$\0 \0 \0(\0"A\bk(\0"j!@ Ak(\0"( (F@A\0  \x1B!\0\f\v \0 N@ B\x007 A\x006  6\f  \x006\b  6 B\x007 B\x007$ B\x007, A\x006< B\x81\x80\x80\x80\x80\x80\x80\x8074  Aj  AA\0 (\0(\v\0 (\r\v B\x007 A\x006 A\x98\xC46\f  \x006\b  6 B\x007 B\x007$ B\x007, B\x007\x003 A\x006< A:\0;  Aj AA\0 (\0( +\0A\0!\0@@ ((\0\v (A\0 ($AF\x1BA\0 ( AF\x1BA\0 (,AF\x1B!\0\f\v (AG@ (,\r ( AG\r ($AG\r\v (!\0\v A@k$\0 \0\v\0 \0A\x006\b \0B\x007\0\vc\0 (A\xB0q"A F@ \v@ AG\r\0@@ \0-\0\0"A+k\0\0\v \0Aj\v A0G  \0kAHr\r\0 \0-\0A rA\xF8\0G\r\0 \0Aj!\0\v \0\v1\x7FA\xCC\xCF(\0! \0@A\xCC\xCFA\xD4\xCE \0 \0A\x7FF\x1B6\0\vA\x7F  A\xD4\xCEF\x1B\v\0 \0(\0"\0@ \0H\v\vA\x7F \0 7p \0 \0(, \0("k\xAC7x \0 P  \0(\b"\0 k\xACYr\x7F \0  \xA7j\v6h\vs\x7F \0A\x90\xFC\x006\0 \0(@ \0((!@ @A\0 \0 Ak"At" \0($j(\0 \0( j(\0\x07\0\f\v\v \0Aj\xF3 \0( ! \0($! \0(0! \0(<!\v \0\v\xEC\x7F \0E@A\xC8\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\xFF\xFF! B<\x86\f\v P@B\0!B\0\f\v  B\0 y\xA7"\x07A1j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85!A\x8C\xF8\0 \x07k\xAD! )\0\v7\0 \0 B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83 B0\x86\x84 \x847\b Aj$\0\v\0 \0A\x80\x80\x80\x80O@A\xBFA\0\xDC\0\v \0At9\v\x85\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ =! \b(# A\x006\0A\0!@@  \x07F r\r@ \bA\fj \bA\bj(\r\0@ (\0A\0 (\0(4\0A%F@ Aj \x07F\rA\0!\x7F@ (A\0 (\0(4\0"A\xC5\0F\r\0A! + A\xFFqA0F\r\0 \f\v A\bj \x07F\rA\b! + ! (\bA\0 (\0(4\0\v! \b \0 \b(\f \b(\b      \0(\0($\f\x006\f  +jAj!\f\v A (\0 (\0(\f\0@@ \x07 Aj"G@ A (\0 (\0(\f\0\r\v\v@ \bA\fj \bA\bj(\r A \b(\fC (\0(\f\0E\r \b(\fB\f\0\v\0\v \b(\fC (\0(\0 (\0 (\0(\0F@ \b(\fB Aj!\f\v A6\0\v (\0!\f\v\v A6\0\v \bA\fj \bA\bj(@  (\0Ar6\0\v \b(\f \bAj$\0\v\xB1\x7F#\0Ak"\b$\0 \b 6\b \b 6\f \bAj" $ >! \b(# A\x006\0A\0!@@  \x07F r\r@ \bA\fj \bA\bj)\r\0@ ,\0\0A\0 (\0($\0A%F@ Aj \x07F\rA\0!\x7F@ ,\0A\0 (\0($\0"A\xC5\0F\r\0A! + A\xFFqA0F\r\0 \f\v Aj \x07F\rA! + ! ,\0A\0 (\0($\0\v! \b \0 \b(\f \b(\b      \0(\0($\f\x006\f  +jAj!\f\v@ ,\0\0"A\0H\r\0 (\b" Atj-\0\0AqE\r\0@@ \x07 Aj"F@ \x07!\f\v ,\0\0"A\0H\r\0  Atj-\0\0Aq\r\v\v@ \bA\fj \bA\bj)\r \b(\fA"A\x80q\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\0 \0 \0,\0\vA\0H\x1B! A\xF2\xFF\xFF\xFFM@A\v  j" At"\b  \bK\x1B"A\x07rAj A\vI\x1B!\b\v \b9! @  \xFC +\0\0\v @  j \x07 \xFC +\0\0\v   j" +k"\x07E  +FrE@  j j  j j \x07\xFC +\0\0\v A +G@ !\v \0 6\0 \0 \bA\x80\x80\x80\x80xr6\b \0  j \x07j"\x006 \0 jA\0:\0\0\vi\0\v,\x7F \0 A\xC0\x84=n"At/\xC0\xBB;\0\0 \0Aj  A\xC0\x84=lk\xAB\v\0A\v;\0 \0 6 \0 \x7F 9A\0\v"6\0 \0  j"6\b \0  j6\f \0 6 \0\v\b\0A\xFF\xFF\xFF\xFF\x07\v\0A\xFF\0\v?\x7F@ \0 F\r\0@ \0 Ak"O\r \0(\0! \0 (\x006\0  6\0 \0Aj!\0\f\0\v\0\v\v\xCB \x7F#\0Ak" $\0 =! + Aj n" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@ + \0   +(\0(0\0    \0kAtj"6\0\f\v  6\0@@ \0"\x07-\0\0"\bA+k\0\0\v + \b\xC0 +(\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 \0Aj!\x07\v@  \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0 +A0 +(\0(,\0!\b  (\0"\vAj6\0 \v \b6\0 + \x07,\0 +(\0(,\0!\b  (\0"\vAj6\0 \v \b6\0 \x07Aj!\x07\v \x07 c  (\0(\0\0!A\0!\vA\0!\b \x07!\x7F  M\x7F  \x07 \0kAtj (\0\x8F (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0  (\0"\vAj6\0 \v 6\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v + ,\0\0 +(\0(,\0!\f  (\0"\rAj6\0 \r \f6\0 Aj! \vAj!\v\f\v\v!\v     \0kAtj  F\x1B6\0 Aj  Aj$\0\v\xD0\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07A\0!\x7F Ar  T\r Ar  +T\r Ar  \bT\r  \x07T\x7F Aj Aj!  \x07\x80!\f\v\v\v"  kJ@ \0A=6\f\v \xAC!\x07  j"!@ Ak"   \x07\x80" \x07~}\xA7-\0\x80\b:\0\0  \x07Z !\r\0\v \0A\x006 \0 6\0\v \0 6\0\v\xC1 \x7F#\0Ak" $\0 >! + Aj p" (\0(\0@ (\b ,\0"\x07 \x07A\0H\x1BE@ + \0   +(\0( \0    \0kj"6\0\f\v  6\0@@ \0"\x07-\0\0"\bA+k\0\0\v + \b\xC0 +(\0(\0!\x07  (\0"\bAj6\0 \b \x07:\0\0 \0Aj!\x07\v@  \x07kAH\r\0 \x07-\0\0A0G\r\0 \x07-\0A rA\xF8\0G\r\0 +A0 +(\0(\0!\b  (\0"\vAj6\0 \v \b:\0\0 + \x07,\0 +(\0(\0!\b  (\0"\vAj6\0 \v \b:\0\0 \x07Aj!\x07\v \x07 c  (\0(\0\0!A\0!\vA\0!\b \x07!\x7F  M\x7F  \x07 \0kj (\0c (\0@ ("\f Aj"\r ,\0A\0H"\x1B \bj-\0\0E\r\0 \v \f \r \x1B \bj,\0\0G\r\0  (\0"\vAj6\0 \v :\0\0A\0!\v \b \b (\b ,\0"\f \fA\0H\x1BAkIj!\b\v + ,\0\0 +(\0(\0!\f  (\0"\rAj6\0 \r \f:\0\0 Aj! \vAj!\v\f\v\v!\v     \0kj  F\x1B6\0 Aj  Aj$\0\v\x9A\x7F@@@@@@ AkAw\b\0\v \0\x7F  k"A L@A= A ArgkA\xD1 lA\fv"  At(\x90\xBBIkAjH\r\v  \xAD!A\0\v6\f\v \0A Argk"  kJ\x7FA=  j"!\x7F AI\x7F@ Ak" Aq-\0\x91:\0\0 Av"\r\0\vA\0 Ak" AtA<q(\x90\xBD6\0\0 Av!\f\v\v\v6\f\v \0A" ArgkAn"  kJ\x7FA=  j"!\x7F A\xC1\0I\x7F@ Ak" A\x07q-\0\xFA\x1B:\0\0 Av"\r\0\vA\0 Ak" At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\x7F6P  A\x9Fj6,  A\x94j6T \0A\0:\0\0   \xCB A\xA0j$\0\vJ\x7F@ \0-\0\0"E  -\0\0"Gr\r\0@ -\0! \0-\0"E\r Aj! \0Aj!\0  F\r\0\v\v  k\v\0\0\v\x8D\b\v\x7F \0E@ /\v A@O@A\xF8\xD7A06\0A\0\v\x7FA A\vjAxq A\vI\x1B! \0A\bk"(" Axq!\b@ AqE@ A\x80I\r Aj \bM@ ! \b kA\xDC\xDB(\0AtM\r\vA\0\f\v  \bj!\x07@  \bM@ \b k"AI\r   AqrAr6  j" Ar6 \x07 \x07(Ar6  \xC9\f\vA\x94\xD8(\0 \x07F@A\x88\xD8(\0 \bj"\b M\r   AqrAr6  j" \b k"Ar6A\x88\xD8 6\0A\x94\xD8 6\0\f\vA\x90\xD8(\0 \x07F@A\x84\xD8(\0 \bj" I\r@  k"AO@   AqrAr6  j"\b Ar6  j" 6\0  (A~q6\f\v  Aq rAr6  j" (Ar6A\0!\bA\0!\vA\x90\xD8 \b6\0A\x84\xD8 6\0\f\v \x07("Aq\r Axq \bj"\v I\r \v k!\f \x07(\f!@ A\xFFM@ \x07(\b" F@A\xFC\xD7A\xFC\xD7(\0A~ Avwq6\0\f\v  6\f  6\b\f\v \x07(! +@  \x07G@ \x07(\b" 6\f  6\b\f\v@ \x07("\x7F \x07Aj \x07("E\r \x07Aj\v!\b@ \b! "Aj!\b ("\r\0 Aj!\b ("\r\0\v A\x006\0\f\vA\0!\v +E\r\0@ \x07("At"(\xAC\xDA \x07F@ A\xAC\xDAj 6\0 \rA\x80\xD8A\x80\xD8(\0A~ wq6\0\f\v@ \x07 +(F@ + 6\f\v + 6\v E\r\v  +6 \x07("@  6  6\v \x07("E\r\0  6  6\v \fAM@  Aq \vrAr6  \vj" (Ar6\f\v   AqrAr6  j" \fAr6  \vj" (Ar6  \f\xC9\v !\v \v"@ A\bj\v /"E@A\0\v  \0A|Ax \0Ak(\0"Aq\x1B Axqj"   K\x1BY \0! \v\0 \0E@A\0\vA\xF8\xD7 \x006\0A\x7F\v}\x7F#\0Ak"$\0 A +:\0@@ \0("\x7F  \0\xC9\r \0(\v \0("F\r\0 \0(PA +F\r\0 \0 Aj6 A +:\0\0\f\v \0 AjA \0($\0AG\r\0 -\0\v Aj$\0\v\0\v\0A\v\xF4\x7F#\0A@j"\x07B\x007 \x07B\x007( \x07B\x0070 \x07B\x0078@@\x7F@\x7F @ Aq!@ AO@ A|q!@ \x07A j"\f  \bAtj"/\0Atj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 /At \fj" /\0Aj;\0 \bAj!\b Aj" G\r\0\v E\r\v@ \x07A j  \bAtj/\0Atj" /\0Aj;\0 \bAj!\b +Aj" + G\r\0\v\v (\0"\b \x07/>"\rE\rA!\v\f\v (\0\v!\bA\0!\r \x07/<@A!\v\f\v \x07/:@A\r!\v\f\v \x07/8@A\f!\v\f\v \x07/6@A\v!\v\f\v \x07/4@A +!\v\f\v \x07/2@A !\v\f\v \x07/0@A\b!\v\f\v \x07/.@A\x07!\v\f\v \x07/,@A!\v\f\v \x07/*@A!\v\f\v \x07/(@A!\v\f\v \x07/&@A!\v\f\v \x07/$@A!\v\f\v \x07/"@A!\fA!\vA!\bA\0\f\v  (\0"\0Aj6\0 \0A\xC06\0  (\0"\0Aj6\0 \0A\xC06\0A!\f\f\v \b \v \b \vI\x1B!A!\b@@ \x07A j \bAtj/\0\r \bAj"\b \vG\r\0\v \v!\b\v  \b  \bK\x1B!\fA\v! A\x7F! + \x07/""AK\rA AtkA\xFE\xFFq \x07/$"k"A\0H\r At \x07/&"k"A\0H\r At \x07/("k"A\0H\r At \x07/*"k"A\0H\r At \x07/,"k"A\0H\r At \x07/."k"A\0H\r At \x07/0"k"A\0H\r At \x07/2"k"A\0H\r At \x07/4"k"A\0H\r At \x07/6"\x1Bk"A\0H\r At \x07/8"k"A\0H\r At \x07/:"k"A\0H\r At \x07/<"k"A\0H\r At" \rI  \rGA\0 \0E r\x1Br\rA\0! + \x07A\0; \x07 ; \x07  j"; \x07  j";\b \x07  j"; + \x07  j";\f \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  j"; \x07  \x1Bj"; \x07  j"; \x07  j"; \x07  j;@ E\r\0 AG@ Aq A~q!A\0! @  +Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj +;\0\v  +Ar"Atj/\0"@ \x07 Atj" /\0"Aj;\0  Atj ;\0\v +Aj! + Aj" G\r\0\vE\r\v  +Atj/\0"E\r\0 \x07 Atj" /\0"Aj;\0  Atj +;\0\vA!A\0! "!A\0!@@@ \0\0\vA! + \fA K\rA\x81!A\xD0\xED\0!A\x90\xED\0!A!\f\v \0AF!A\0!A\xD0\xEE\0!A\x90\xEE\0! \0AG@\f\vA! + \fA K\r\vA \ft"Ak! (\0!A\0! \f! A\0!A\0!\rA\x7F!@A t!@@\x7FA\0   Atj/\0" AjK\r\0 I@A\0! A\xE0\0\f\v  kAt"\0j/\0! \0 j-\0\0\v!\0A\x7F \b k"t!\x1B  \r vAtj! ! +@  + \x1Bj" +Atj" ;  :\0  \0:\0\0 +\r\0\vA \bAkt! @ "\0Av! \0 \rq\r\0\v \x07A j \bAtj" /\0Ak" ;\0 \0Ak \rq \0jA\0 \0\x1B!\r Aj! A\xFF\xFFqE@ \b \vF\r   Atj/\0Atj/\0!\b\v \b \fM\r\0 \r q"\0 F\r\0\vA \b  \f \x1B"k" t! \b \vI@ \v k! \b! +@@  \x07A j +Atj/\0k"A\0L\r At! Aj" j" + \vI\r\0\v ! \vA t!\vA! +   j"A\xD4Kq  A\xD0Kqr\r (\0" \0Atj" + \f:\0 + :\0\0 +  Atj" kAv; \0!\f\v\v \r@  \rAtj"\0A\0; \0 :\0 \0A\xC0\0:\0\0\v  (\0 Atj6\0\v  \f6\0A\0! +\v +\v\x9C\x7F ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\v (\0!@@@ ("A +M@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFF\x07O\r A\x07r"Aj9! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v Aj"@ \0  \xFC +\0\0\v\f\vi\0\v\v\xCC\x7F@A\xF6\xFF\xFF\xFF\x07 k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF\x07! A\xF2\xFF\xFF\xFFM@A\v  j" At"  K\x1B"A\x07rAj A\vI\x1B!\v \0 \x1B! 9! @   \xFC +\0\0\v@  F\r\0  k"\x07E\r\0  j  j \x07\xFC +\0\0\v A +G@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\vi\0\v \0 6\v\0 \0 \0(\0A\fk(\0j"\0 jK \0\vK\x7F \0("A\bu!\x07 \0(\0"\0   Aq\x7F (\0 \x07j(\0 \x07\v j A Aq\x1B  \0(\0(\v\0\v\x9A\0 \0A:\x005@  \0(G\r\0 \0A:\x004@ \0("E@ \0A6$ \0 6 \0 6 AG\r \0(0AF\r\f\v  F@ \0("AF@ \0 6 !\v \0(0AG\r AF\r\f\v \0 \0($Aj6$\v \0A:\x006\v\vv\x7F \0($"E@ \0 6 \0 6 \0A6$ \0 \0(86\v@@ \0( \0(8G\r\0 \0( G\r\0 \0(AG\r \0 6\v \0A:\x006 \0A6 \0 Aj6$\v\v\x8D\x7F ( \0(\0" \0("kj!  k"@   \xFC +\0\0\v  6 \0 \0(\0"6 \0 (6\0  6 \0(! \0 (\b6  6\b \0(\b! \0 (\f6\b  6\f  (6\0\v\x85\x7F@@@ \0,\0\v"A\0N@A +! A +F\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xA4 !\v \0 Aj6 \0(\0!\0\v \0 j"\0A\0:\0 \0 :\0\0\v,\x7F \0 A\x90\xCE\0n"At/\xC0\xBB;\0\0 \0Aj  A\x90\xCE\0lk\xAC\v4\x7F \0 A\xE4\0n"At/\xC0\xBB;\0\0 \0  A\xE4\0lkAt/\xC0\xBB;\0 \0Aj\v\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!\x07 !\v\f\v  \vV\r\v \x07 \xA7AqrE@A\xF8\xD7A\xC4\x006\0 B}!\f\v  \vZ\r\0A\xF8\xD7A\xC4\x006\0\f\v \v \x07\xAC"\x85 }!\v \bAj$\0 \v\x9A\b\x7F@ \0"Aq@@ -\0\0"E A=Fr\r Aj"Aq\r\0\v\v@@A\x80\x82\x84\b (\0"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r\0@A\x80\x82\x84\b A\xBD\xFA\xF4\xE9s"k rA\x80\x81\x82\x84xqA\x80\x81\x82\x84xG\r (! Aj"! A\x80\x82\x84\b krA\x80\x81\x82\x84xqA\x80\x81\x82\x84xF\r\0\v\f\v !\v@ "-\0\0"E\r Aj! A=G\r\0\v\v \0 F@A\0\v@ \0  \0k"j-\0\0\r\0A\xEC\xDB(\0"E\r\0 (\0"E\r\0@@\x7F \0!A\0 "E\r\0 \0-\0\0"\x7F@@  -\0\0"\x07G \x07Er\r Ak"E\r Aj! -\0! Aj! \r\0\vA\0!\v A\0\v -\0\0k\vE@ (\0 j"-\0\0A=F\r\v (! Aj! \r\f\v\v Aj!\b\v \b\v \0 \0\x81!\v\0 \0A\fjK \0!\v\0\v\0 \0A\xA8\xF5\x006\0 \0Aj\xF3 \0\v\xFD~\x7F#\0A k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!~ B0\x88B\xFF\xFF\x83"\xA7"A\x81\xF8\0kA\xFDM@ B\x86 \0B<\x88\x84! A\x80\xF8\0k\xAD!@ \0B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x83"\0B\x81\x80\x80\x80\x80\x80\x80\x80\bZ@ B|!\f\v \0B\x80\x80\x80\x80\x80\x80\x80\x80\bR\r\0 B\x83 |!\vB\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x07V"\x1B!\0 \xAD |\f\v \0 \x84P B\xFF\xFFRrE@ B\x86 \0B<\x88\x84B\x80\x80\x80\x80\x80\x80\x80\x84!\0B\xFF\f\v A\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\r (\0 j(\0\f\v A\bu E\r\0  \0(\0(68A\0!A\0\v! \0(\0"\0   j A Aq\x1B \0(\0(\b\0\v\r\0 \0( (F\v\xF6\x7F#\0Ak"$\0  6\fA\x94\xC4(\0" \0 \xCB \0y \0jAk-\0\0A +G@@@ (L"\0A\0N@ \0E\rA\x84\xCF(\0 \0A\xFF\xFF\xFF\xFFqG\r\v@ (PA +F\r\0 ("\0 (F\r\0  \0Aj6 \0A +:\0\0\f\v \x9F\f\v  (L"\0A\xFF\xFF\xFF\xFF \0\x1B6L@@ (PA +F\r\0 ("\0 (F\r\0  \0Aj6 \0A +:\0\0\f\v \x9F\v (L A\x006L\v\v\x9C\0\v\x88\x7F@@@ \0,\0\v"A\0N@A! AF\r \0 AjA\xFF\0q:\0\v\f\v \0(" \0(\bA\xFF\xFF\xFF\xFF\x07qAk"G\r\v \0 A  \xFF !\v \0 Aj6 \0(\0!\0\v \0 Atj"\0A\x006 \0 6\0\v\x9B\x7FA\xF6\xFF\xFF\xFF k O@A\xF7\xFF\xFF\xFF! \0(\0 \0 \0,\0\vA\0H\x1B! + A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj! \v U!@ E\r\0 At"\bE\r\0  + \b\xFC +\0\0\v@ E\r\0 At"\bE\r\0  Atj \x07 \b\xFC +\0\0\v   j"\bk!\x07@  \bF\r\0 \x07At"E\r\0  At"\bj Atj \b +j Atj \xFC +\0\0\v AG@ +!\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b \0  j \x07j"\x006  \0AtjA\x006\0\v0\0\v\x8A\x7F A\xF7\xFF\xFF\xFFI@@ AM@ \0 :\0\v\f\v Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v ! \0!@ @  6\0 Ak! Aj!\f\v\v \0 AtjA\x006\0\v0\0\v\xA0\x7F \0(\b"A\xFF\xFF\xFF\xFF\x07qAkA + \0,\0\v"A\0H"\x1B" O@ \0(\0 \0 \x1B!@ \x7F @   \xF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:\0\0A\x88\xE0A\xEC\xDE6\0\vA\x90\xE0A\x88\xE0(\0"\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\vA\x94\xE0A:\0\0\vA\x90\xE0(\0"\x006\0 \0A\xEC\xDEG@ \0 \0(Aj6\v\v\xB1\x7F \0A\xC8\x876\0 \0A\bj!@ \0(\f \0(\b"kAu K@@  Atj(\0"E\r\0  ("Ak6 \r\0  (\0(\b\0\v Aj!\f\v\v \0A\x90j #\0Ak"$\0  6\f (\f"(\0"@  6 (\b A\fj \xE2\v Aj$\0 \0\v \0 \0A\x98\x906\0 \0(\b*G@ \0(\b\xA6\v \0\v\0A\x7F\v\x9D\x07 \x7F  \x006\0AA\0 \x07\x1B! A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! AtAk"@  \r(\0 \r \x1BAj \xFC +\0\0\v   j6\0\v A\xB0q"AG@  A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v  (\x006\0\f\v  (\x006\0 A (\0(,\0!\x07  (\0"Aj6\0  \x076\0\f\v \r( \r,\0\v"\x07 \x07A\0H"\x07\x1BE\r \r(\0 \r \x07\x1B(\0!\x07  (\0"Aj6\0  \x076\0\f\v E\r \f( \f,\0\v"\x07 \x07A\0H"\x1B"E\r (\0!\x07 At"@ \x07 \f(\0 \f \x1B \xFC +\0\0\v  \x07 j6\0\f\v (\0  j"!\x07@@  \x07M\r\0 A\xC0\0 \x07(\0 (\0(\f\0E\r\0 \x07Aj!\x07\f\v\v A\0J@ (\0! !@ E  \x07OrE@ Ak! \x07Ak"\x07(\0!  Aj"6\0  6\0 !\f\v\v \x7F A0 (\0(,\0A\0\v! (\0!@ A\0LE@  Aj"6\0  6\0 Ak! !\f\v\v  (\0"Aj6\0  6\0\v@  \x07F@ A0 (\0(,\0!\x07  (\0"Aj6\0  \x076\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@  \x07F\r@  G@ !\f\v  (\0"Aj6\0  +6\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0  \v \x1B j,\0\0!\v \x07Ak"\x07(\0!  (\0"Aj6\0  6\0 Aj!\f\0\v\0\v (\0\x8F\v Aj!\f\v\v\v\x8A\x7F#\0Ak" +$\0@ \0@ \xFE!\f\v \xFD!\v@ @ +Aj"\0  (\0(,\0  +(6\0\0 \0  (\0( \0\f\v +Aj"\0  (\0((\0  +(6\0\0 \0  (\0(\0\v \b \0| \0    (\0(\f\0\x006\0   (\0(\0\x006\0 +Aj"\0  (\0(\0  \0X \0  \0  (\0(\0 \x07 \0| \0   (\0($\0\x006\0 +Aj$\0\v\x7FA\f9"\0A\x006\b \0B\x007\0 \0\v\xF7 \x7F  \x006\0 A\x80q!@ AF@ \r( \r,\0\v" A\0H"\x1B"AK@ (\0! Ak"@  \r(\0 \r \x1BAj \xFC +\0\0\v   j6\0\v A\xB0q"AG@  A F\x7F (\0 \0\v6\0\v@@@@@@ \b j-\0\0\0\v  (\x006\0\f\v  (\x006\0 A (\0(\0!  (\0"Aj6\0  :\0\0\f\v \r( \r,\0\v" A\0H"\x1BE\r \r(\0 \r \x1B-\0\0!  (\0"Aj6\0  :\0\0\f\v E\r \f( \f,\0\v" A\0H"\x1B"E\r (\0! @  \f(\0 \f \x1B \xFC +\0\0\v   j6\0\f\v (\b! (\0  \x07j"!@@  M\r\0 ,\0\0"A\0H\r\0  Atj-\0\0A\xC0\0qE\r\0 Aj!\f\v\v "A\0J@@ E  OrE@ Ak! Ak"-\0\0!  (\0"Aj6\0  :\0\0\f\v\v \x7F A0 (\0(\0A\0\v!@  (\0"Aj6\0 A\0LE@  :\0\0 Ak!\f\v\v  :\0\0\v@  F@ A0 (\0(\0!  (\0"Aj6\0  :\0\0\f\v \v( \v,\0\v" A\0H"\x1B\x7F \v(\0 \v \x1B,\0\0A\x7F\v!A\0!A\0!@  F\r@  G@ !\f\v  (\0"Aj6\0  +:\0\0A\0! Aj" \v( \v,\0\v" A\0H\x1BO@ !\f\vA\x7F! \v(\0" \v A\0H"\x1B j-\0\0A\xFF\0F\r\0  \v \x1B j,\0\0!\v Ak"-\0\0!  (\0"Aj6\0  :\0\0 Aj!\f\0\v\0\v (\0c\v Aj!\f\v\v\v\x8A\x7F#\0Ak" +$\0@ \0@ \x83!\f\v \x82!\v@ @ +Aj"\0  (\0(,\0  +(6\0\0 \0  (\0( \0\f\v +Aj"\0  (\0((\0  +(6\0\0 \0  (\0(\0\v \b \0X \0    (\0(\f\0\0:\0\0   (\0(\0\0:\0\0 +Aj"\0  (\0(\0  \0X \0  \0  (\0(\0 \x07 \0X \0   (\0($\0\x006\0 +Aj$\0\v +\0 \0A\xA4\xDE^\v +\0 \0A\xAC\xDE^\v\xD7\x7F@A\xF6\xFF\xFF\xFF k O@ \0,\0\vA\0H! \0(\0A\xF7\xFF\xFF\xFF! A\xF2\xFF\xFF\xFFM@  j" At"  K\x1BArAj!\v \0 \x1B! U!@ E\r\0 At"\x07E\r\0   \x07\xFC +\0\0\v@  F\r\0  kAt"\x07E\r\0 At" j  j \x07\xFC +\0\0\v AG@ !\v \0 6\0 \0 A\x80\x80\x80\x80xr6\b\f\v0\0\v \0 6\v\xD8\x7F#\0A\x90k"\v$\0 \v +6\x88 \v 6\x8C@ \0 \vA\x8Cj(@  (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j!\f \vA(j \vAj#\0Ak" +$\0@ @ +Aj" \xFE" (\0(,\0\f\v +Aj" \xFD" (\0(,\0\v \v +(6\0\\   (\0( \0 |     (\0(\0 |   \v  (\0(\f\0\x006X \v  (\0(\0\x006T   (\0(\0 X     (\0(\0 \f |   \v  (\0($\0\x006 +Aj$\0 \b(\x006\0 A\x80q!A\0!A\0! +@ +!@@\x7F@@@@ AF\r\0 \0 \vA\x8Cj(\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\f\v AF\r + \x07A \0: \x07(\0(\f\0\r\x07  (\0Ar6\0A\0!\0\f\v AG\r\x07\f \v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0: \v(( \vA(j" \v,\x003"A\0H\x1B(\0G\r\0 \0Q A\0:\0\0   \v(, \v,\x003" A\0H\x1BAK\x1B! +\f +\v \v( \v,\0#" + +A\0H\x1B@ \0: \v( \vAj \v,\0#" +A\0H\x1B(\0F\r \v-\x003!\v \v( + +A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r  (\0Ar6\0A\0!\0\f\v E\r \v  A\0G:\0\0\f\b\v   AIrrE@A\0! + AF \v-\0_A\0GqE\r \v \v(8" \vA8j \v,\0C" +A\0H\x1B!@ E\r\0 \fAk-\0\0AK\r\0@@   \vA8j +\xC0A\0H"\f\x1B \v(< +A\xFFq \f\x1BAtjF\r\0 \x07A (\0 \x07(\0(\f\0 \v(8! \v-\0C! +E\r\0 Aj!\f\v\v   \vA8j +\xC0A\0H\x1B"\fkAu"\r \v(\f \v,\0" A\0H"\x1B"M\x7F At \v(\b \vA\bj \x1Bj" + \rAtk!#\0Ak"\r$\0  \f + kA|qhE \rAj$\0\r \v-\0C! + \v(8 \v \vA8j +\xC0A\0H\x1B!\v@@  \v(8 \vA8j \v,\0C"A\0H" +\x1B \v(<  +\x1BAtjF\r\0 \0 \vA\x8Cj(\r\0 \0: (\0G\r\0 \0Q Aj!\f\v\v E\r\x07 ! +  \v(8 \vA8j \v,\0C"A\0H"\x1B \v(<  \x1BAtjF\r\b  (\0Ar6\0A\0!\0\f\v@@ \0 \vA\x8Cj(\r\0\x7F \x07A\xC0\0 \0:" + \x07(\0(\f\0@ (\0" \v(\x88F@ \b \vA\x88jk (\0!\v Aj6\0  +6\0 Aj\f\v \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@@ E@ \0 6\0\f\v \0(\0! @   \xFC +\0\0\v \0 6\0 E\r\0  \0(\0 \0(\0!\v \0A\xE4\x006   \x07 kj6\0  \0(\0 \bj6\0\v0\0\v\xEE\x7F#\0A\x90k"\v$\0 \v +6\x88 \v 6\x8C@ \0 \vA\x8Cj)@  (\0Ar6\0A\0!\0\f\v \vA\xE3\x006l \v \vA\xF0\0j"6h \v 6d \v \vA\x80j6\` \vA\x006P \vB\x007H \vA\x006@ \vB\x0078 \vA\x0060 \vB\x007( \vA\x006 \vB\x007 \vA\x006 \vB\x007\b \vA\xC8\0j \vA8j! \vA(j \vAj#\0Ak" +$\0@ @ +Aj" \x83" (\0(,\0\f\v +Aj" \x82" (\0(,\0\v \v +(6\0\\   (\0( \0 X     (\0(\0 X   \v  (\0(\f\0\0:\0[ \v  (\0(\0\0:\0Z   (\0(\0 X     (\0(\0  X   \v  (\0($\0\x006 +Aj$\0 \b(\x006\0 A\x80q!A\0!A\0! +@@ +!@@@@@@@\x7F@@@ AF\r\0 \0 \vA\x8Cj)\r\0A\0!@@@@@@ \vA\xDC\0j j"\f-\0\0\0\v AF\r\r \0;"A\0N@ \x07(\b Atj-\0\0Aq\r\x07\v  (\0Ar6\0A\0!\0\f\v AG\r\f\f\v@ \v(, \v,\x003" A\0H\x1BE\r\0 \0;A\xFFq \v(( \vA(j" \v,\x003"A\0H\x1B-\0\0G\r\0 \0S A\0:\0\0   \v(, \v,\x003" A\0H\x1BAK\x1B! +\f\v \v( \v,\0#" + +A\0H\x1B@ \0;A\xFFq \v( \vAj \v,\0#" +A\0H\x1B-\0\0F\r \v-\x003!\v \v( + +A\0H\x1B!@ \v(, A\xFFq \xC0A\0H\x1B"@ E\r  (\0Ar6\0A\0!\0\f\v E\r\f\v  A\0G:\0\0\f\v\v   AIrrE@A\0! + AF \v-\0_A\0GqE\r\r\v \v(8" \vA8j \v,\0C"\rA\0H"\x1B! E\r\b \fAk-\0\0AK\r\b  \v(< \r \x1Bj! \x07(\b!\f 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b"kAL\r\0 -\0\0A0G\r\0 -\0A rA\xF8\0G\r\0 A0 (\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 ,\0 (\0(,\0!\x07  (\0"\bAj6\0 \b \x076\0 Aj"\b!@  M\r ,\0\0*!\xB8E\r Aj!\f\0\v\0\v@  M\r ,\0\0*!\xB7E\r Aj!\f\0\v\0\v@ +(\b +,\0"\x07 \x07A\0H\x1BE@ \b  (\0 (\0(0\0  (\0  \bkAtj6\0\f\v \b c \f \f(\0(\0\0! \b!\x07@  \x07M@  \b \0kAtj (\0\x8F@ +(" +Aj" +,\0A\0H"\x1B \rj,\0\0A\0L\r\0 \v   \x1B \rj,\0\0G\r\0  (\0"\vAj6\0 \v 6\0A\0!\v \r \r +(\b +,\0" A\0H\x1BAkIj!\r\v \x07,\0\0 (\0(,\0!  (\0"Aj6\0  6\0 \x07Aj!\x07 \vAj!\v\f\v\v\v@@@  M\r Aj!\x07 ,\0\0"A.G@  (\0(,\0!  (\0"\bAj6\0 \b 6\0 \x07!\f\v\v \f \f(\0(\f\0\0!  (\0"\bAj"\v6\0 \b 6\0\f\v (\0!\v !\x07\v \x07  \v (\0(0\0  (\0  \x07kAtj"6\0     \0kAtj  F\x1B6\0 +Aj  +Aj$\0\v\xC4\x7F#\0A\x90k"$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! A\x83j!@ E A\x80qEr\r\0 \b@ A0:\0\x83 A\x84j!\f\v \x07A\bG\r\0 A0:\0\x83 A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0\x84 A\x85j!\v A\xF8\0j  A\x90j  \x94 (x!@ A\x88\x80qA\x88\x80G\r\0@  F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v A\x83j"  G! Aj"\x07 $    Aj" A\fj A\bj \x07\x90 (# \0  (\f (\b  \\ A\x90j$\0\vC\x7F#\0Ak"$\0  6\fA\xB0 A\xF0\xC7A\xCB,A A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j-\0\0K\r\0 )pB\0Y@  (Ak6\v B\0JA\xF8\xD7A6\0\f\v A +G\r\0 \0A0k"A M@A\0!\0@ \0A +l j"\0A\x99\xB3\xE6\xCCI\x7F (" (hG@  Aj6 -\0\0\f\v %\vA0k"A Mq\r\0\v \0\xAD!\v A K\r B +~! \xAD!@@\x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A0k"A M  |"B\x9A\xB3\xE6\xCC\x99\xB3\xE6\xCCTqE@ A M\r\f\v B +~" \xAD"B\x7F\x85X\r\v\vA +!\f\v@@  Akq@  \0A\xF1\x81j-\0\0"K\r\f\v  \0A\xF1\x81j-\0\0"M\r AlAvA\x07q,\0\xF1\x83!@   t"r! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\x80\x80\x80\xC0\0Iq\r\0\v \xAD! \rB\x7F \xAD"\x88" T\r@ \xADB\xFF\x83  \x86\x84! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r  X\r\0\v\f\v@   lj! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M"E A\xC7\xE3\xF18Iq\r\0\v \xAD! \r \xAD!@  ~" \xADB\xFF\x83"B\x7F\x85V\r  |! \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\v"\0A\xF1\x81j-\0\0"M\r \b B\0 B\02 \b)\bP\r\0\v\v\v  \0A\xF1\x81j-\0\0M\r\0@ \x7F ("\0 (hG@  \0Aj6 \0-\0\0\f\v %\vA\xF1\x81j-\0\0K\r\0\vA\xF8\xD7A\xC4\x006\0A\0!B\x7F!\v )pB\0Y@  (Ak6\v ArE B\x7FQq@A\xF8\xD7A\xC4\x006\0B~!\f\v  \xAC"\x85 }!\v \bAj$\0 )xB\0 ( (,k\xAC}Q\r \x07E \fA\xF0\0GrE@ \x07 >\0\f\v \x07  \xAA\f\v \x07  \xA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\x83"\x07B\x80\x80\x80\bT \x07B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \0 \x07B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\vA\0  A\xFF\xFF\xFFK"\x1B!A\x81\x81\x7FA\x80\x81\x7F \x1B j!\f\v \0 \x07\x84P \bB\xFF\xFFRrE@ \x07B\x88\xA7A\x80\x80\x80r!A\xFF!\f\v A\xFE\x80K@A\xFF!\f\vA\x80\xFF\0A\x81\xFF\0 \bP"\x1B" k"A\xF0\0J@A\0!A\0!\f\v \x07 \x07B\x80\x80\x80\x80\x80\x80\xC0\0\x84 \x1B!\x07A\0!  G@ Aj \0 \x07A\x80 k6 ) )\x84B\0R!\v  \0 \x07 g )\b"\0B\x88\xA7!@ )\0 \xAD\x84"\x07P \0B\xFF\xFF\xFF\x83"\0B\x80\x80\x80\bT \0B\x80\x80\x80\bQ\x1BE@ Aj!\f\v \x07 \0B\x80\x80\x80\b\x85\x84B\0R\r\0 Aq j!\v A\x80\x80\x80s  A\xFF\xFF\xFFK"\x1B!\v A j$\0 B \x88\xA7A\x80\x80\x80\x80xq Atr r\xBE\v\x89\x7F~@@\x7F@@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A+k\0\0\v A-F E\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A:k"AuKr\r \0)pB\0S\r \0 \0(Ak6\f\v A:k! !A\0\v! AvI\r\0@ A0kA +O\r\0A\0!@  A +lj\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v!A0k! A\xCC\x99\xB3\xE6\0H A0k"A Mq\r\0\v \xAC! A +O\r\0@ \xAD B +~|!\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\v"A0k"A M B0}"B\xAE\x8F\x85\xD7\xC7\xC2\xEB\xA3Sq\r\0\v A +O\r\0@\x7F \0(" \0(hG@ \0 Aj6 -\0\0\f\v \0%\vA0kA +I\r\0\v\v \0)pB\0Y@ \0 \0(Ak6\vB\0 }  \x1B!\f\vB\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F! \0)pB\0S\r\0 \0 \0(Ak6B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\v \v\x842\x7F\x07~|#\0A0k"\r$\0@@ AK\r\0 At"(\xDC\x81! (\xD0\x81!@\x7F (" (hG@  Aj6 -\0\0\f\v %\v"_\r\0\vA!\b@@ A+k\0\0\vA\x7FA A-F\x1B!\b (" (hG@  Aj6 -\0\0!\f\v %!\v@@ A_qA\xC9\0F@@ A\x07F\r\x7F (" (hG@  Aj6 -\0\0\f\v %\v! ,\0\xAF\b Aj! A rF\r\0\v\v AG@ A\bF"\f\r E AIr\r \f\r\v )p"B\0Y@  (Ak6\v E AIr\r\0 B\0S!@ E@  (Ak6\v Ak"AK\r\0\v\vB\0!#\0Ak"$\0 \b\xB2C\0\0\x80\x7F\x94\xBC"A\xFF\xFF\xFFq!\b\x7F Av"A\xFFq"@ A\xFFG@ \b\xADB\x86! A\xFFqA\x80\xFF\0j\f\v \b\xADB\x86!A\xFF\xFF\f\vA\0 \bE\r\0  \b\xADB\0 \bg"A\xD1\0j6 )\bB\x80\x80\x80\x80\x80\x80\xC0\0\x85! )\0!A\x89\xFF\0 k\v! \r 7\0 \r \xADB0\x86 Av\xADB?\x86\x84 \x847\b Aj$\0 \r)\b! \r)\0!\f\v@@@@@@ \r\0A\0! A_qA\xCE\0G\r\0@ AF\r\x7F (" (hG@  Aj6 -\0\0\f\v %\v! ,\0\xFC\r Aj! A rF\r\0\v\v \0\v@\x7F (" (hG@  Aj6 -\0\0\f\v %\vA(F@A!\f\vB\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0! )pB\0S\r  (Ak6\f\v@\x7F (" (hG@  Aj6 -\0\0\f\v %\v"A0kA +I A\xC1\0kAIr A\xDF\0FrE A\xE1\0kAOqE@ Aj!\f\v\vB\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0! A)F\r )p"B\0Y@  (Ak6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FF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A\x80j )\x90 )\x98B\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )\x80! )\x88\f\v A\xE2k\xAC W@ A\0N@@ A\xA0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF\xBF\x7F<  B\x80\x80\x80\x80\x80\x80\x80\xFF?\xB2! A\x90j   )\xA0  A\0N"\x1B )\xA8  \x1B<  At"r! B}! )\x98! )\x90! A\0N\r\0\v\v~ A k\xAD|"\xA7"A\0 A\0J\x1B   \xADS\x1B"A\xF1\0O@ A\x80j \b? )\x88! )\x80!B\0\f\v A\xE0jA\x90 k\xC8T A\xD0j \b? )\xD0! A\xF0j )\xE0 )\xE8 )\xD8"\xB1 )\xF8! )\xF0\v! A\xC0j AqE  B\0B\0dA\0G A Iqq"rr A\xB0j   )\xC0 )\xC8+ A\x90j )\xB0 )\xB8  < A\xA0j  B\0  \x1BB\0  \x1B+ A\x80j )\xA0 )\xA8 )\x90 )\x98< A\xF0j )\x80 )\x88  \xBC )\xF0" )\xF8"B\0B\0dE@A\xF8\xD7A\xC4\x006\0\v A\xE0j   \xA7\xB0 )\xE0! )\xE8\f\vA\xF8\xD7A\xC4\x006\0 A\xD0j \b? A\xC0j )\xD0 )\xD8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xB0j )\xC0 )\xC8B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )\xB0! )\xB8\v! \r 7 \r 7 A\xB0j$\0 \r)! \r)!\f\v )pB\0S\r\0  (Ak6\v !\x07 ! \b!\f !\bA\0!#\0A\x90\xC6\0k"$\0A\0 k" k!@\x7F@@ A0G@ A.G\r \x07(" \x07(hF\r \x07 Aj6 -\0\0\f\v \x07(" \x07(hG@ \x07 Aj6 -\0\0! \x07%!\vA!\f\v\v \x07%\v"A0F@@ B}!\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A0F\r\0\vA!\vA!\v\v A\x006\x90~@@@@ A.F" A0k"A Mr@@@ Aq@ \vE@ !A!\v\f\v E!\f\v B|! A\xFCL@  \xA7 A0F\x1B! A\x90j Atj" +\x7F  (\0A +ljA0k \v6\0A!A\0 +Aj" A F"\x1B! +  j! \f\v A0F\r\0  (\x80FAr6\x80FA\xDC\x8F!\v\x7F \x07(" \x07(hG@ \x07 Aj6 -\0\0\f\v \x07%\v"A.F" A0k"A +Ir\r\0\v\v   \v\x1B! E A_qA\xC5\0GrE@@ \x07 \b\xAC"B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7FR\r\0 \bE\rB\0! \x07)pB\0S\r\0 \x07 \x07(Ak6\v  |!\f\v E! A\0H\r\v \x07)pB\0S\r\0 \x07 \x07(Ak6\v E\rA\xF8\xD7A6\0\v \x07B\0JB\0!B\0\f\v (\x90"E@ D\0\0\0\0\0\0\0\0 \f\xB7\xA6T )\b! )\0\f\v  R B Ur AMA\0  v\x1BrE@ A0j \f? A j r Aj )0 )8 ) )(+ )! )\f\v Av\xAD S@A\xF8\xD7A\xC4\x006\0 A\xE0\0j \f? A\xD0\0j )\` )hB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ A@k )P )XB\x7FB\xFF\xFF\xFF\xFF\xFF\xFF\xBF\xFF\xFF\0+ )H! )@\f\v A\xE2k\xAC U@A\xF8\xD7A\xC4\x006\0 A\x90j \f? A\x80j )\x90 )\x98B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ A\xF0\0j )\x80 )\x88B\0B\x80\x80\x80\x80\x80\x80\xC0\0+ )x! )p\f\v +@ +A\bL@ A\x90j Atj"(\0!@ A +l! +Aj" +A G\r\0\v  6\0\v Aj! \v@ A N BUr \xA7" + Hr\r\0 B Q@ A\xC0j \f? A\xB0j (\x90r A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v B\bW@ A\x90j \f? A\x80j (\x90r A\xF0j )\x90 )\x98 )\x80 )\x88+ A\xE0jA\b +kAt(\xB0\x81? A\xD0j )\xF0 )\xF8 )\xE0 )\xE8\xAF )\xD8! )\xD0\f\v  +A}ljA\x1Bj"ALA\0 (\x90" v\x1B\r\0 A\xE0j \f? A\xD0j r A\xC0j )\xE0 )\xE8 )\xD0 )\xD8+ A\xB0j +AtA\x88\x81j(\0? A\xA0j )\xC0 )\xC8 )\xB0 )\xB8+ )\xA8! )\xA0\f\v@ "Ak! A\x90j Atj"Ak(\0E\r\0\vA\0!@ +A o"E@A\0!\f\v A j  B\0S\x1B!@ E@A\0!A\0!\f\vA\x80\x94\xEB\xDCA\0 kAtA\xD0\x81j(\0"\vm!\x07A\0!A\0!A\0!@ A\x90j Atj"\b  \b(\0" \vn"\bj"6\0 AjA\xFFq  E  Fq"\x1B! +A k + \x1B! + \x07 \b \vlkl! Aj" G\r\0\v E\r\0  6\0 Aj!\v + kA j! +\v@ A\x90j Atj! +A$H!\x07@@ \x07E@ +A$G\r (\0A\xD1\xE9\xF9O\r\v A\xFFj! A\0!@ !\b \xAD A\x90j A\xFFq"\vAtj"5\0B\x86|"B\x81\x94\xEB\xDCT\x7FA\0  B\x80\x94\xEB\xDC\x80"B\x80\x94\xEB\xDC~}! \xA7\v!  >\0 \b \b \b \v B\0R\x1B \v \bAkA\xFFq"G\x1B  \vF\x1B! \vAk!  \vG\r\0\v Ak! \b! E\r\0\v AkA\xFFq" F@ A\x90j"\b A\xFEjA\xFFqAtj" (\0 At \bj(\0r6\0 !\v +A j! + A\x90j Atj 6\0\f\v\v@@ AjA\xFFq!\b A\x90j AkA\xFFqAtj!@A A +A-J\x1B!@@ !A\0!@@@  jA\xFFq" F\r\0 A\x90j Atj(\0" At(\xA0\x81"I\r\0  I\r Aj"AG\r\v\v +A$G\r\0B\0!A\0!B\0!@   jA\xFFq"F@ AjA\xFFq"At jA\x006\x8C\v A\x80j A\x90j Atj(\0r A\xF0j  B\0B\x80\x80\x80\x80\xE5\x9A\xB7\x8E\xC0\0+ A\xE0j )\xF0 )\xF8 )\x80 )\x88< )\xE8! )\xE0! Aj"AG\r\0\v A\xD0j \f? A\xC0j   )\xD0 )\xD8+B\0! )\xC8! )\xC0! A\xF1\0j" k" A\0 A\0J\x1B  H"\b\x1B"\x07A\xF0\0M\r\f\v  j! !  F\r\0\vA\x80\x94\xEB\xDC v!\vA\x7F tA\x7Fs!A\0! !@ A\x90j"\x07 Atj"  (\0" vj"6\0 AjA\xFFq  E  Fq"\x1B! +A k + \x1B! + q \vl! AjA\xFFq" G\r\0\v E\r  \bG@ At \x07j 6\0 \b!\f\v  (\0Ar6\0\f\v\v\v A\x90jA\xE1 \x07k\xC8T A\xB0j )\x90 )\x98 \xB1 )\xB8! )\xB0! A\x80jA\xF1\0 \x07k\xC8T A\xA0j   )\x80 )\x88\xAE A\xF0j   )\xA0" )\xA8"\xBC A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\v@ AjA\xFFq" F\r\0@ A\x90j Atj(\0"A\xFF\xC9\xB5\xEEM@ E AjA\xFFq Fq\r A\xF0j \f\xB7D\0\0\0\0\0\0\xD0?\xA2T A\xE0j   )\xF0 )\xF8< )\xE8! )\xE0!\f\v A\x80\xCA\xB5\xEEG@ A\xD0j \f\xB7D\0\0\0\0\0\0\xE8?\xA2T A\xC0j   )\xD0 )\xD8< )\xC8! )\xC0!\f\v \f\xB7!\x1B  AjA\xFFqF@ A\x90j \x1BD\0\0\0\0\0\0\xE0?\xA2T A\x80j   )\x90 )\x98< )\x88! )\x80!\f\v A\xB0j \x1BD\0\0\0\0\0\0\xE8?\xA2T A\xA0j   )\xB0 )\xB8< )\xA8! )\xA0!\v \x07A\xEF\0K\r\0 A\xD0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?\xAE )\xD0 )\xD8B\0B\0d\r\0 A\xC0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xFF?< )\xC8! )\xC0!\v A\xB0j    < A\xA0j )\xB0 )\xB8  \xBC )\xA8! )\xA0!@ Ak A\xFF\xFF\xFF\xFF\x07qN\r\0  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x837\x98  7\x90 A\x80j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF?+ )\x90 )\x98B\x80\x80\x80\x80\x80\x80\x80\xB8\xC0\0\xB2! )\x88  A\0N"\x1B! )\x80  \x1B! \b \x07 G A\0Hrq  B\0B\0dA\0GqE   j"A\xEE\0jNq\r\0A\xF8\xD7A\xC4\x006\0\v A\xF0j   \xB0 )\xF8! )\xF0\v! \r 7( \r 7 A\x90\xC6\0j$\0 \r)(! \r) !\f\vB\0!\f\vB\0!\v \0 7\0 \0 7\b \rA0j$\0\v\xC0\x7F~#\0A\x80k"$\0@@@  B\0B\0dE\r\0\x7F B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +\x7F B0\x88\xA7A\xFF\xFFq"\x07A\xFF\xFFG@A \x07\rAA  +\x84P\x1B\f\v  +\x84P\v\vE\r\0 B0\x88\xA7"\bA\xFF\xFFq"A\xFF\xFFG\r\v Aj    +  )" )"  \xAF )\b! )\0!\f\v  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" +  B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83" dA\0L@  +  d@ !\f\v A\xF0\0j  B\0B\0+ )x! )p!\f\v B0\x88\xA7A\xFF\xFFq!\x07 ~  A\xE0\0j  +B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )h" +B0\x88\xA7A\xF8\0k! )\`\v! \x07E@ A\xD0\0j  B\0B\x80\x80\x80\x80\x80\x80\xC0\xBB\xC0\0+ )X" B0\x88\xA7A\xF8\0k!\x07 )P!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84!\v +B\xFF\xFF\xFF\xFF\xFF\xFF?\x83B\x80\x80\x80\x80\x80\x80\xC0\0\x84! +  \x07J@@~ + \v}  V\xAD}" B\0Y@  }"\x84P@ A j  B\0B\0+ )(! ) !\f\v B\x86 B?\x88\x84\f\v +B\x86 B?\x88\x84\v! + B\x86! Ak" \x07J\r\0\v \x07!\v@ + \v}  V\xAD}" B\0S@ +! \f\v  }"\x84B\0R\r\0 A0j  B\0B\0+ )8! )0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@@ B?\x88 Ak! B\x86! B\x86\x84" B\x80\x80\x80\x80\x80\x80\xC0\0T\r\0\v\v \bA\x80\x80q!\x07 A\0L@ A@k  B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 A\xF8\0j \x07r\xADB0\x86\x84B\0B\x80\x80\x80\x80\x80\x80\xC0\xC3?+ )H! )@!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83  \x07r\xADB0\x86\x84!\v \0 7\0 \0 7\b A\x80j$\0\v\x87\x7F~#\0A\xD0k"$\0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83!\v B\xFF\xFF\xFF\xFF\xFF\xFF?\x83! +  \x85B\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7F\x83!\f B0\x88\xA7A\xFF\xFFq!\x07@@ B0\x88\xA7A\xFF\xFFq"\bA\xFF\xFFkA\x82\x80~O@ \x07A\xFF\xFFkA\x81\x80~K\r\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f\f\v P B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1BE@ B\x80\x80\x80\x80\x80\x80 \x84!\f !\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0!\f\f\v \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x85\x84P@B\0!\f\v  \x84P@B\x80\x80\x80\x80\x80\x80\xE0\xFF\xFF\0 \f  \x84P\x1B!\fB\0!\f\v  \x84P@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v B\xFF\xFF\xFF\xFF\xFF\xFF?X@ A\xC0j  +  + +P"\x1ByB\xC0\0B\0 \x1B|\xA7"Ak6A k! )\xC8! + )\xC0!\v B\xFF\xFF\xFF\xFF\xFF\xFF?V\r\0 A\xB0j  \v  \v \vP" \x1ByB\xC0\0B\0 \x1B|\xA7" Ak6  jAk! )\xB8!\v )\xB0!\v A\xA0j \vB\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86 B1\x88\x84"B\0B\x80\x80\x80\x80\xB0\xE6\xBC\x82\xF5\0 }"B\02 A\x90jB\0 )\xA8}B\0 B\02 A\x80j )\x98B\x86 )\x90B?\x88\x84"B\0 B\02 A\xF0j B\0B\0 )\x88}B\02 A\xE0j )\xF8B\x86 )\xF0B?\x88\x84"B\0 B\02 A\xD0j B\0B\0 )\xE8}B\02 A\xC0j )\xD8B\x86 )\xD0B?\x88\x84"B\0 B\02 A\xB0j B\0B\0 )\xC8}B\02 A\xA0j B\0 )\xB8B\x86 )\xB0B?\x88\x84B}"B\02 A\x90j B\x86B\0 B\02 A\xF0\0j B\0B\0 )\xA8 )\xA0" )\x98|" T\xAD| BV\xAD|}B\02 A\x80jB }B\0 B\02  \b \x07kj"\bA\xFF\xFF\0j!~ )p"B\x86"\r )\x88"B\x86 )\x80B?\x88\x84|"B\xE7\xEC\0}"B \x88" +B\x80\x80\x80\x80\x80\x80\xC0\0\x84"B\x86"B \x88"~" B\x86"B \x88"\v  V\xAD \r V\xAD )xB\x86 B?\x88\x84 B?\x88|||B}"B \x88"~|"\r T\xAD \r \r B\xFF\xFF\xFF\xFF\x83" B?\x88" +B\x86\x84B\xFF\xFF\xFF\xFF\x83" +~|"\rV\xAD|  ~|  ~" + ~|" T\xADB \x86 B \x88\x84| \r B \x86|" \rT\xAD|   B\xFF\xFF\xFF\xFF\x83" +~"\r  \v~|" \rT\xAD    B\xFE\xFF\xFF\xFF\x83"\r~|"V\xAD||"V\xAD|   ~" \r ~|"  +~|" + \v ~|"B \x88 + V\xAD  T\xAD  +V\xAD||B \x86\x84|" T\xAD|     \r~" + \v ~|"B \x88  +T\xADB \x86\x84|" + T\xAD + + B \x86|" +V\xAD||"V\xAD|   + B \x86" \r ~| T\xADB\x7F\x85"V  +Rq\xAD|"V\xAD|"B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0X@  \x84! A\xD0\0j  B\x80\x80\x80\x80\x80\x80\xC0\0T"\x07\xAD"\v\x86" +  \v\x86 B\x88 \x07A?s\xAD\x88\x84"  2 \bA\xFE\xFF\0j  \x07\x1BAk! B1\x86 )X} )P"B\0R\xAD}!\vB\0 }\f\v A\xE0\0j B?\x86 B\x88\x84" + B\x88"  2 B0\x86 )h} )\`"B\0R\xAD}!\v !B\0 }\v! A\xFF\xFFN@ \fB\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x84!\fB\0!\f\v~ A\0J@ \vB\x86 B?\x88\x84! B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 \xADB0\x86\x84!\v B\x86\f\v A\x8F\x7FL@B\0!\f\v A@k + A kg A0j   A\xF0\0j6 A j   )@" + )H"\v2 )8 )(B\x86 ) "B?\x88\x84} )0" B\x86"T\xAD}!  }\v! Aj  BB\02   BB\02 \v +  +B\x83" |"T   T\xAD|" V  Q\x1B\xAD|" +T\xAD|"   B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )V  )"V  Q\x1Bq\xAD|"V\xAD|"  B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0T  )\0V  )\b"V  Q\x1Bq\xAD|" T\xAD| \f\x84!\f\v \0 7\0 \0 \f7\b A\xD0j$\0\v\xBF\x7F#\0A\xD0\0k"$\0@ A\x80\x80N@ A j  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+ )(! ) ! A\xFF\xFFI@ A\xFF\xFF\0k!\f\v Aj  B\0B\x80\x80\x80\x80\x80\x80\x80\xFF\xFF\0+A\xFD\xFF  A\xFD\xFFO\x1BA\xFE\xFFk! )! )!\f\v A\x81\x80\x7FJ\r\0 A@k  B\0B\x80\x80\x80\x80\x80\x80\x809+ )H! )@! A\xF4\x80~K@ A\x8D\xFF\0j!\f\v A0j  B\0B\x80\x80\x80\x80\x80\x80\x809+A\xE8\x81}  A\xE8\x81}M\x1BA\x9A\xFEj! )8! )0!\v   B\0 A\xFF\xFF\0j\xADB0\x86+ \0 )\b7\b \0 )\x007\0 A\xD0\0j$\0\v<\0 \0 7\0 \0 B\xFF\xFF\xFF\xFF\xFF\xFF?\x83 B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0\x83B0\x88\xA7 B0\x88\xA7A\x80\x80qr\xADB0\x86\x847\b\v\xC0\x7F~A\x7F!@ \0B\0R B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Q\x1B\r\0 B\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0\x83"B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0V B\x80\x80\x80\x80\x80\x80\xC0\xFF\xFF\0Rq\r\0 \0  \x84\x84P@A\0\v  \x83B\0Y@  R  Sq\r \0  \x85\x84B\0R\v \0B\0R  U  Q\x1B\r\0 \0  \x85\x84B\0R!\v \v8\0 \0A\xD0k \0 \0A\x93\xF1\xFF\xFF\x07J\x1B"\0Aq@A\0\v \0A\xECj"\0A\xE4\0o@A\v \0A\x90oE\v\x85\x7F~#\0A\x80k"\b$\0 @\x7F@@\x7F@@@ -\0\0"A%G@ \r +\f\x07\vA\0!A! @ -\0"\x07A-k\0\v \x07A\xDF\0F\r \x07\r\v \0 +j :\0\0 +Aj\f\v \x07! -\0!\x07A! \vA\0!@\x7F  j \x07"A+Fj" ,\0\0A0kA M@ \bA\fjA +B\xFF\xFF\xFF\xFF\xBE\xA7! \b(\f\f\v \b 6\fA\0! \v"\x07-\0\0"A\xC3\0k"\vAKA \vtA\x99\x80\x80qEr\r\0 "\r\0 \x07 G!\v A\xCF\0F A\xC5\0Fr\x7F \x07-\0! \x07Aj \x07\v! \bAj!\x07 ! A\0!#\0A\xD0\0k"\v$\0A\x8A !\rA0!A\xA8\x80\b!\f@ \b\x7F@@@@@@@\x7F@@@@@@@@@~@@@@@@@@@@@@@@@@@@@@@@@@@@ \xC0"A%kV!---------------------------'-\x07\b +---\r---- ------\0&-\b-\v--\f--%-\x1B-\v ("AM\r"\f*\v ("AK\r) A\x87\x80\bj\f"\v ("A\vK\r( A\x8E\x80\bj\f!\v ("A\vK\r' A\x9A\x80\bj\f \v 4B\xEC|B\xE4\0\x7F!\f#\vA\xDF\0!\v 4\f!\f!\vA\xD2!\r\f\v 4"B\xEC|!@ ("AL@  B\xEB| \xBDAF\x1B!\f\v A\xE9I\r\0 B\xED|  \xBDAF\x1B!\v A\xE7\0F\r\f \v 4\b!\f\vA! (\b"E@B\f!\f \v \xAC"B\f}  A\fJ\x1B!\f\v (Aj\xAC!A!\f\v (Aj\xAC!\f\x1B\v 4!\f\v \bA6|A\xD4!\f\vA\xA7\x80\bA\xA6\x80\b (\bA\vJ\x1B\f\vA\xF7!\r\f\vA\0!\fA\0!#\0Ak"$\0 4!~ ("\rA\fO@ \r \rA\fm"A\flk"A\fj  A\0H\x1B!\r  Auj\xAC |!\v A\fj! B}B\x88X@ \xA7"\fA\xC4\0kAu!@ \x7F \fAqE@ Ak! E\rA\f\v E\rA\0\v6\0\v \fA\x80\xE7\x84l A\x80\xA3ljA\x80\xD6\xAF\xE3\x07j\xAC\f\v B\xE4\0}" B\x90\x7F"B\x90~}"B?\x87\xA7 \xA7j!@@@ \xA7"A\x90j  B\0S\x1B"\x7F\x7F A\xC8N@ A\xACO@A!\f A\xACk\f\vA!\f A\xC8k\f\v A\xE4\0k  A\xE3\0J"\f\x1B\v"\rA\0A\v! \r\f\v Av! AqE! E\r\v  6\0\v B\x80\xE7\x84~  \fAl A\xE1\0ljj k\xACB\x80\xA3~|B\x80\xAA\xBA\xC3|\v! \rAtA\x80\xFE\0j(\0"A\x80\xA3j  (\f\x1B  \rAJ\x1B! (\f! 4\b! 4! 4\0 Aj$\0  \xAC| Ak\xACB\x80\xA3~| B\x90~| B<~|| 4$}\f\b\v 4\0!\f\v \bA6|A\xD6!\f\vA\xE4!\r\f\v ("A\x07 \x1B\xAC\f\v ( (kA\x07jA\x07n\xAD!\f\v ( (AjA\x07pkA\x07jA\x07n\xAD!\f\v \xBD\xAD!\f\v 4\v!A!\f\vA\xA9\x80\b!\f\f +\vA\xAA\x80\b!\f\f \v 4B\xEC|B\xE4\0\x81" B?\x87"\x85 }!\f +\v 4"B\xEC|! B\xA4?S\r + \v 70 \b \x07A\x9B \vA0je6| \x07!\f\v ( A\0H@ \bA\x006|A\xD7!\f\v \v ($"A\x90m"A\xE4\0l  A\x90lk\xC1A<m\xC1j6@ \b \x07A\xA1 \vA@ke6| \x07!\f\r\v ( A\0H@ \bA\x006|A\xD7!\f\r\v ((A\xB4\xDC(\0E@A\xAC\xDCA\xB0\xDCA\xC0\xDCA\xE0\xDCA\xB8\xDCA\xE0\xDC6\0A\xB4\xDCA\xC0\xDC6\0\v\f\v\v \bA6|A\xEA!\f\v\v B\xE4\0\x81!\f\v A\x80\x80\br\v \xB5\f\x07\vA\xAB\x80\b!\f\v \f \xB5!\r\v \b \x07A\xE4\0 \r  \xB4"6| \x07A\0 \x1B!\f\vA!\f\vA!\v@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q6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("@  6  6\v ("E\r\0  6  6\v \0 Ar6 \0 j 6\0 \0 \bG\r\0A\x84\xD8 6\0\v A\xFFM@ A\xF8qA\xA4\xD8j!\x7FA\xFC\xD7(\0"A Avt"qE@A\xFC\xD7  r6\0 \f\v (\b\v!  \x006\b  \x006\f \0 6\f \0 6\b\vA! A\xFF\xFF\xFF\x07M@ A& A\bvg"kvAq AtrA>s!\v \0 6 \0B\x007 AtA\xAC\xDAj!@@A\x80\xD8(\0"A t"\x07qE@A\x80\xD8  \x07r6\0  \x006\0 \0 6\f\v A AvkA\0 AG\x1Bt! (\0!@ "(Axq F\r Av! At!  Aqj"\x07("\r\0\v \x07 \x006 \0 6\v \0 \x006\f \0 \x006\b\v (\b" \x006\f  \x006\b \0A\x006 \0 6\f \0 6\b\v\v\0 \0E@A\0\v \0 \xC5\v\0 \0  A4A5\xD0\v-\0 \0A\xCC\0j1 \0A@k1 \0A4j1 \0A(j1 \0Aj1 \0Aj1\v\xBC\0@@@@@@@@@@@ A k\0\b +\b  + + +\b \x07\v  (\0"Aj6\0 \0 (\x006\0\v  (\0"Aj6\0 \0 2\x007\0\v  (\0"Aj6\0 \0 3\x007\0\v  (\0"Aj6\0 \0 0\0\x007\0\v  (\0"Aj6\0 \0 1\0\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 +\x009\0\v \0  \0\v\v  (\0"Aj6\0 \0 4\x007\0\v  (\0"Aj6\0 \0 5\x007\0\v  (\0A\x07jAxq"A\bj6\0 \0 )\x007\0\vo\x7F \0(\0",\0\0A0k"A K@A\0\v@A\x7F! A\xCC\x99\xB3\xE6\0M@A\x7F  A +l"j  A\xFF\xFF\xFF\xFF\x07sK\x1B!\v \0 Aj"6\0 ,\0 ! !A0k"A +I\r\0\v \v\xF5\x7F~#\0A@j"\b$\0 \b 6< \bA)j! \bA'j! \bA(j!@@@@@A\0!\x07@ !\r \x07 A\xFF\xFF\xFF\xFF\x07sJ\r \x07 j!@@@@ "\x07-\0\0"\v@@@@ \vA\xFFq"E@ \x07!\f\v A%G\r \x07!\v@ \v-\0A%G@ \v!\f\v \x07Aj!\x07 \v-\0 \vAj"!\vA%F\r\0\v\v \x07 \rk"\x07 A\xFF\xFF\xFF\xFF\x07s"J\r \0@ \0 \r \x073\v \x07\r\x07 \b 6< Aj!\x07A\x7F!@ ,\0A0k" +A K\r\0 -\0A$G\r\0 Aj!\x07A! +!\v \b \x076<A\0!\f@ \x07,\0\0"\vA k"AK@ \x07! +\f\v \x07! +A t"A\x89\xD1qE\r\0@ \b \x07Aj" +6<  \fr!\f \x07,\0"\vA k"A O\r +!\x07A t"A\x89\xD1q\r\0\v\v@ \vA*F@\x7F@ +,\0A0k"A K\r\0 +-\0A$G\r\0\x7F \0E@  AtjA +6\0A\0\f\v  Atj(\0\v! +Aj!A\f\v \r +Aj! \0E@ \b 6<A\0!A\0!\f\v  (\0"\x07Aj6\0 \x07(\0!A\0\v! \b 6< A\0N\rA\0 k! \fA\x80\xC0\0r!\f\f\v \bA<j\xCE"A\0H\r + \b(<!\vA\0!\x07A\x7F! \x7FA\0 -\0\0A.G\r\0 -\0A*F@\x7F@ ,\0A0k" +A K\r\0 -\0A$G\r\0 Aj!\x7F \0E@  +AtjA +6\0A\0\f\v  +Atj(\0\v\f\v \r Aj!A\0 \0E\r\0  (\0" +Aj6\0 +(\0\v! \b 6< A\0N\f\v \b Aj6< \bA<j\xCE! \b(<!A\v!@ \x07!A! + ",\0\0"\x07A\xFB\0kAFI\r\v Aj! A:l \x07jA\xFF\xF0\0j-\0\0"\x07AkA\xFFqA\bI\r\0\v \b 6<@ \x07A\x1BG@ \x07E\r\f A\0N@ \0E@  Atj \x076\0\f\f\v \b  Atj)\x0070\f\v \0E\r\b \bA0j \x07  \xCD\f\v A\0N\r\vA\0!\x07 \0E\r\b\v \0-\0\0A q\r\v \fA\xFF\xFF{q"\v \f \fA\x80\xC0\0q\x1B!\fA\0!A\x93 ! ! +@@\x7F@@@@@@\x7F@@@@@@@ -\0\0"\x07\xC0"ASq  \x07AqAF\x1B  \x1B"\x07A\xD8\0k!  +\0\v@ \x07A\xC1\0k\x07\v\0\v \x07A\xD3\0F\r\v\f\v \b)0!A\x93 \f\vA\0!\x07@@@@@@@ \b\0\v \b(0 6\0\f\x1B\v \b(0 6\0\f\v \b(0 \xAC7\0\f\v \b(0 ;\0\f\v \b(0 :\0\0\f\v \b(0 6\0\f\v \b(0 \xAC7\0\f\vA\b A\bM\x1B! \fA\br!\fA\xF8\0!\x07\v ! \x07A q!\r \b)0""\x1BPE@@ Ak" \x1B\xA7Aq-\0\x90u \rr:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE Pr\r \x07AvA\x93 j!A!\f\v ! \b)0""\x1BPE@@ Ak" \x1B\xA7A\x07qA0r:\0\0 \x1BB\x88"\x1BB\0R\r\0\v\v !\r \fA\bqE\r  k"  H\x1B! \f\v \b)0"B\0S@ \bB\0 }"70A!A\x93 \f\v \fA\x80q@A!A\x94 \f\vA\x95 A\x93 \fAq"\x1B\v!  x!\r\v  A\0Hq\r \fA\xFF\xFF{q \f \x1B!\f B\0R rE@ !\rA\0! \f\v P  \rkj"  H\x1B! \f\r\v \b-\x000!\x07\f\v\v \b(0"A\xC4 \x1B"\rA\0A\xFF\xFF\xFF\xFF\x07 A\xFF\xFF\xFF\xFF\x07O\x1B"\x07\xCA" \rk \x07 \x1B" \rj! + A\0N@ \v!\f ! \f\f\v \v!\f ! +-\0\0\r\f\v\v \b)0"\x1BPE\rA\0!\x07\f \v @ \b(0\f\vA\0!\x07 \0A A\0 \f7\f\v \bA\x006\f \b \x1B>\b \b \bA\bj"\x0760A\x7F! \x07\v!\vA\0!\x07@@ \v(\0"\rE\r\0 \bAj \r\xCA"\rA\0H\r \r \x07kK\r\0 \vAj!\v \x07 \rj"\x07 I\r\v\vA=! + \x07A\0H\r\f \0A  \x07 \f7 \x07E@A\0!\x07\f\vA\0! + \b(0!\v@ \v(\0"\rE\r \bAj" \r\xCA"\r +j" + \x07K\r \0 \r3 \vAj!\v \x07 +K\r\0\v\v \0A  \x07 \fA\x80\xC0\0s7  \x07 \x07 H\x1B!\x07\f\b\v  A\0Hq\r A=! + \0 \b+0  \f \x07 \0"\x07A\0N\r\x07\f +\v \x07-\0!\v \x07Aj!\x07\f\0\v\0\v \0\r E\rA!\x07@  \x07Atj(\0"\0@  \x07Atj \0  \xCDA! \x07Aj"\x07A +G\r\f\v\v\v \x07A +O@A!\f +\v@  \x07Atj(\0\rA! \x07Aj"\x07A +G\r\0\v\f \vA! +\f\v \b \x07:\0'A! !\r \v!\f\v + \rk"\v \vJ\x1B" A\xFF\xFF\xFF\xFF\x07sJ\rA=! +   j" H\x1B"\x07 K\r \0A \x07 \f7 \0  3 \0A0 \x07 \fA\x80\x80s7 \0A0  \vA\07 \0 \r \v3 \0A \x07 \fA\x80\xC0\0s7 \b(<!\f\v\v\vA\0!\f\vA=! +\vA\xF8\xD7 +6\0\vA\x7F!\v \bA@k$\0 \v\xC2\x7F#\0A\xD0k"$\0  6\xCC A\xA0j"A\0A(\xFC\v\0  (\xCC6\xC8@A\0  A\xC8j A\xD0\0j   \xCFA\0H@A\x7F!\f\v \0(LA\0H \0 \0(\0"\bA_q6\0\x7F@@ \0(0E@ \0A\xD0\x0060 \0A\x006 \0B\x007 \0(,! \0 6,\f\v \0(\r\vA\x7F \0\xC9\r\v \0  A\xC8j A\xD0\0j A\xA0j  \xCF\v! @ \0A\0A\0 \0($\0 \0A\x0060 \0 6, \0A\x006 \0(! \0B\x007 A\x7F \x1B!\v \0 \0(\0"\0 \bA qr6\0A\x7F  \0A q\x1B!\r\0\v A\xD0j$\0 \v\x7F\x7F~ \0\xBD"B4\x88\xA7A\xFFq"A\xFFG| E@  \0D\0\0\0\0\0\0\0\0a\x7FA\0 \0D\0\0\0\0\0\0\xF0C\xA2 \xD1!\0 (\0A@j\v6\0 \0\v  A\xFE\x07k6\0 B\xFF\xFF\xFF\xFF\x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  G@ @   \xFC +\0\0\v \0(!\v   j"k"E  FrE@   \xFC +\0\0\v \0  j6\f\v  k"E  FrE@   \xFC +\0\0\v \0  j6\f\v \0(\0"@ \0 6 \0(\b ! \0A\x006\b \0B\x007\0\v \0 \0 \x86\xA8 \0(!  k"E  FrE@   \xFC +\0\0\v \0  j6\v\v\v\0  \0(\0j!\0A\f9 \0b\v\0  \0(\0j :\0\0\v\r\0  \0(\0j-\0\0\v\x1B\0 \0 (\b M@    \xA7\v\v8\0 \0 (\b M@    \xA7\v \0(\b"\0      \0(\0(\v\0\v\x92\x7F \0 (\b M@    \xA7\v -\x005 \0(\f! A\0:\x005 -\x004 A\0:\x004 \0Aj"     \xA6 -\x004" +r!\b -\x005"\vr!\x07@ AI\r\0 Atj! \0Aj!@ -\x006\r@ +Aq@ (AF\r \0-\0\bAq\r\f\v \vAqE\r\0 \0-\0\bAqE\r\v A\0;4      \xA6 -\x005"\v \x07rAq!\x07 -\x004" + \brAq!\b A\bj" I\r\0\v\v  \x07Aq:\x005  \bAq:\x004\v\xA4\0@ \0 (\b M@  (G\r (AF\r  6\v \0 (\0 ME\r\0@ ( G@  (G\r\v AG\r A6 \v  6  6  ((Aj6(@ ($AG\r\0 (AG\r\0 A:\x006\v A6,\v\v\x88\0@ \0 (\b M@  (G\r (AF\r  6\v \0 (\0 M@@ ( G@  (G\r\v AG\r A6 \v  6 @ (,AF\r\0 A\0;4 \0(\b"\0   A  \0(\0(\v\0 -\x005AF@ A6, -\x004E\r\f\v A6,\v  6  ((Aj6( ($AG\r (AG\r A:\x006\v \0(\b"\0     \0(\0( +\0\v\v\xC1\x7F@ \0 (\b M@  (G\r (AF\r  6\v@ \0 (\0 M@@ ( G@  (G\r\v AG\r A6 \v  6 (,AF\r \0Aj" \0(\fAtj!\x07A\0!@@@ \x7F@  \x07O\r\0 A\0;4    A \xA6 -\x006\r\0 -\x005AG\r -\x004AF@ (AF\rA!A! \0-\0\bAqE\r\f\vA! \0-\0\bAq\rA\f\vAA \x1B\v6, \r\f\v A6,\f\v A\bj!\f\0\v\0\v \0(\f! \0Aj"    \x88 AI\r  Atj! \0Aj!@ \0(\b"\0AqE@ ($AG\r\v@ -\x006\r     \x88 A\bj" I\r\0\v\f\v \0AqE@@ -\x006\r ($AF\r     \x88 A\bj" I\r\0\f\v\0\v@ -\x006\r ($AF@ (AF\r\v     \x88 A\bj" I\r\0\v\f\v  6  ((Aj6( ($AG\r\0 (AG\r\0 A:\x006\v\v\xCB\x7F#\0A@j"$\0@@@ (A\xA2\xC7F@ A\x006\0\f\v@ \0  \0-\0\bAq\x7FA E\r A\xF8\xC4E"E\r -\0\bAqA\0G\vM!\v @A! (\0"\0E\r  \0(\x006\0\f\v A\xA8\xC5E"E\rA\0! (\0"@  (\0"6\0\v (\b"\x07 \0(\b"A\x7FsqA\x07q \x07A\x7Fs qA\xE0\0qr\r \0(\f"\x07(" (\f"\0(G\r\vA!\f\v A\xA0\xC7F@ \0A\xD8\xC5EE!\f\vA\0! \x07A\xA8\xC5E"@ AqE\r\x7F !A\0!@@A\0 \0E\r \0A\xA8\xC5E"\0E\r \0(\b (\b"A\x7Fsq\rA (\f"( \0(\f"\0(F\r AqE\r A\xA8\xC5E"\r\0\v A\x8C\xC6E"E\r\0  \0\xD9!\v \v!\f\v \x07A\x8C\xC6E"@ AqE\r  \0\xD9!\f\v \x07A\xC8\xC4E"E\r\0 \0A\xC8\xC4E"\0E\r\0 A\bjA\0A8\xFC\v\0  A\0G:\0; A\x7F6  6\f  \x006 A64 \0 Aj A \0(\0(\b\0 ("\0AF@  (A\0 \x1B6\0\v \0AF!\v A@k$\0 \vr\x7F \0( (\b(F@   \xA8\v \0(\f! \0Aj"   \xDA@ AI\r\0  Atj! \0Aj!\0@ \0   \xDA -\x006\r \0A\bj"\0 I\r\0\v\v\v\0 \0@ \0\xC7\v \0!\v5\0 \0( (\b(F@   \xA8\v \0(\b"\0    \0(\0(\b\0\v\0 \0( (\b(F@   \xA8\v\v\xC4\x7F#\0A\x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0Ak"$\0 !\b@@  \bF@ !\b\f\v \b-\0\0E\r\0 \bAj!\b\f\v\v \x07 6\0  6\0@@\x7F@  F  Fr\r\0  )\x007\b \0(\b! #\0Ak"$\0  H6\f \b k!A\0! +#\0A\x90\bk"\f$\0 \f (\0" 6\f  \fAj \x1B!@@@ E  kAuA\x80 \x1B"\rErE@@ A\x83K Av"\v \rOrE@ !\v\f\v  \fA\fj \v \r \v \rI\x1B \xA4! \f(\f!\v A\x7FF@A\0!\rA\x7F! +\f\v \r A\0  \fAjG\x1B"k!\r  Atj! j \vkA\0 \v\x1B! + j! + \vE\r \v! \r\r\0\f\v\0\v !\v\v \vE\r\v \rE Er\r\0 +! @@@  \v  \x98" +AjAM@@@ +Aj\0\v \fA\x006\f\f\v A\x006\0\f\v \f \f(\f +j"\v6\f Aj! \rAk"\r\r\v ! +\f\v Aj!  +k! ! + \r\0\v\v @  \f(\f6\0\v \fA\x90\bj$\0 A\fjI Aj$\0@@@@ +A\x7FF@@@ \x07 6\0  (\0F\r\0A!@@@   \b k A\bj \0(\b\xEE"Aj\b\0\v  6\0\f\v !\v  j! \x07(\0Aj!\f\v\v  6\0\f\v \x07 \x07(\0 +Atj"6\0  F\r (\0!  \bF\r  A  \0(\b\xEEE\r\vA\f\v \x07 \x07(\0Aj"6\0  (\0Aj"6\0 !\b@  \bF\r \b-\0\0E\r \bAj!\b\f\0\v\0\v  6\0A\f\v (\0!\v  G\v Aj$\0\v !\b\f\0\v\0\v\x9F\v\x7F#\0Ak"$\0 !\b@@  \bF@ !\b\f\v \b(\0E\r\0 \bAj!\b\f\v\v \x07 6\0  6\0@@@@  F  Fr\x7F   )\x007\bA! \0(\b! #\0Ak"$\0  H6\f !  k! +A\0!\f#\0Ak"$\0@ (\0"\vE \b kAu"Er\r\0 +A\0 \x1B! +@ A\fj +AI\x1B \v(\0\xC5"\rA\x7FF@A\x7F!\f\f\v \x7F +AM@ + \rI\r A\fj \rY\v + \rk! + \rjA\0\v! \v(\0E@A\0!\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Aj!\f\v\v \v\0  A\xDF\0q A\xFB\0kAfI\x1B\v\x86\x7F@ \0( \0(\0"kAu" I@#\0A k"$\0@  k" \0(\b \0("kAuM@ \0(" Atj!@  F@ \0 6  *\x008\0 Aj!\f\v\v\f\v A\fj \0  \0(\0kAu j\x86 \0( \0(\0kAu \0\xB8"(\b" Atj!@  G@  *\x008\0 Aj!\f\v\v  6\b \0 \x96 \xB5\v A j$\0\f\v  I@ \0  Atj6\v\v\v7\0@@  F\r\0 (\0"\0A\xFF\0K\r\0 \0At(\x90\x88 qE\r\0 Aj!\f\v\v \v7\0@@  F\r\0 (\0"\0A\xFF\0M@ \0At(\x90\x88 q\r\v Aj!\f\v\v \vF\x7F@  FE@A\0!\0  (\0"A\xFF\0M\x7F At(\x90\x88A\0\v6\0 Aj! Aj!\f\v\v \v"\0A\0!\0 A\xFF\0M\x7F At(\x90\x88 qA\0GA\0\v\v\0 \0 \0(\0(\0\v \0 \0\xF5!\v\x95\x7F \0\x7F \0(" \0(\bI@  *\x008\0 Aj\f\v#\0A k"$\0 A\fj \0 \0( \0(\0kAuAj\x86 \0( \0(\0kAu \0\xB8"(\b" *\x008\0  Aj6\b \0 \x96 \0( \xB5 A j$\0\v6\v\xA1\0@ ,\0\vA\0N@ \0 (\b6\b \0 )\x007\0\f\v (\0!@@@ ("AM@ \0 :\0\v\f\v A\xF7\xFF\xFF\xFFO\r Ar"AjU! \0 A\xFF\xFF\xFF\xFF\x07k6\b \0 6\0 \0 6 !\0\v AtAj"@ \0  \xFC +\0\0\v\f\v0\0\v\v\v \0 \0 \xA3\v\x9F\x07\x7F#\0A\xF0k"$\0 A\xECj"\0 $ \0=! + ( ,\0\v"\0 \0A\0H"\0\x1B@ (\0  \0\x1B(\0 +A- +(\0(,\0F!\x07\v A\x006\xD8 B\x007\xD0 A\x006\xC8 B\x007\xC0 A\x006\xB8 B\x007\xB0  \x07 A\xECj A\xE8j A\xE4j A\xE0j A\xD0j A\xC0j A\xB0j A\xACj\xF9@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (\xAC" J@ \0 kAtj (\xB4 ,\0\xBB"\0 \0A\0H\x1Bj (\xC4 ,\0\xCB"\0 \0A\0H\x1BjAj\f\v (\xB4 ,\0\xBB"\0 \0A\0H\x1Bj (\xC4 ,\0\xCB"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0At/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0  \b\xC0A\0H"\x1B"\f \f \v \b \x1BAtj + \x07 A\xE8j (\xE4 (\xE0 A\xD0j" A\xC0j"\x07 A\xB0j"\b \xF8  \0 (\f (\b  \\ ! \b  \x07    (\xEC# A\xF0j$\0\v0\0\v\xE4\b\x7F#\0A\xA0\bk"\0$\0 \0 7 \0 7 \0 \0A\xB0\x07j"\x076\xAC\x07 \0A\x90j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xAC\x07j \x07A\xE3 \0P"\x07A\x7FF\r \0(\xAC\x07!\r \x07At/"\v! \vE\r\v \0A\x8Cj"\b $ \b=" \0(\xAC\x07"\b \x07 \bj (\0(0\0 \x07A\0J@ \0(\xAC\x07-\0\0A-F! +\v \0A\x006\xF8 \0B\x007\xF0 \0A\x006\xE8 \0B\x007\xE0 \0A\x006\xD8 \0B\x007\xD0  + \0A\x8Cj \0A\x88j \0A\x84j \0A\x80j \0A\xF0j \0A\xE0j \0A\xD0j \0A\xCCj\xF9@\x7F \0(\xCC"\b \x07H@ \b \x07 \bkAtj \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\f\v \b \0(\xD4 \0,\0\xDB" A\0H\x1Bj \0(\xE4 \0,\0\xEB" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v At/"\f! \fE\r\v  \0A,j \0A(j ( \x07Atj  + \0A\x88j \0(\x84 \0(\x80 \0A\xF0j" + \0A\xE0j"\x07 \0A\xD0j" \b\xF8   \0(, \0((  \\ \f!   \x07  +  \0(\x8C# \v! \r! \0A\xA0\bj$\0\v0\0\v\x99\x07\x7F#\0A\xB0k"$\0 A\xACj"\0 $ \0>! + ( ,\0\v"\0 \0A\0H"\0\x1B@ (\0  \0\x1B-\0\0 +A- +(\0(\0A\xFFqF!\x07\v A\x006\xA0 B\x007\x98 A\x006\x90 B\x007\x88 A\x006\x80 B\x007x  \x07 A\xACj A\xA8j A\xA7j A\xA6j A\x98j A\x88j A\xF8\0j A\xF4\0j\xFC@\x7F\x7F ("\v ,\0\v"\b \bA\0H\x1B"\0 (t" J@ \0 kAtj (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\f\v (| ,\0\x83"\0 \0A\0H\x1Bj (\x8C ,\0\x93"\0 \0A\0H\x1BjAj\v"\0A\xE5\0I@A\0! Aj\f\v \0/"E\r -\0\v!\b (!\v \v"\0 A\fj A\bj ( (\0  \b\xC0A\0H"\x1B"\f \f \v \b \x1Bj + \x07 A\xA8j ,\0\xA7 ,\0\xA6 A\x98j" A\x88j"\x07 A\xF8\0j"\b \xFB  \0 (\f (\b  Z ! \b  \x07    (\xAC# A\xB0j$\0\v0\0\v\xDB\b\x7F#\0A\xB0k"\0$\0 \0 7 \0 7 \0 \0A\xC0j"\x076\xBC \0A\xD0j! @ \x07A\xE3 \0Aje"\x07A\xE4\0O@*!\x07 \0 7\0 \0 7\b \0A\xBCj \x07A\xE3 \0P"\x07A\x7FF\r \0(\xBC!\r \x07/"\v! \vE\r\v \0A\xCCj"\b $ \b>" \0(\xBC"\b \x07 \bj (\0( \0 \x07A\0J@ \0(\xBC-\0\0A-F! +\v \0A\x006\xC0 \0B\x007\xB8 \0A\x006\xB0 \0B\x007\xA8 \0A\x006\xA0 \0B\x007\x98  + \0A\xCCj \0A\xC8j \0A\xC7j \0A\xC6j \0A\xB8j \0A\xA8j \0A\x98j \0A\x94j\xFC@\x7F \0(\x94"\b \x07H@ \b \x07 \bkAtj \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\f\v \b \0(\x9C \0,\0\xA3" A\0H\x1Bj \0(\xAC \0,\0\xB3" A\0H\x1BjAj\v"A\xE5\0I@ \0A0j!\f\v /"\f! \fE\r\v  \0A,j \0A(j ( \x07 j  + \0A\xC8j \0,\0\xC7 \0,\0\xC6 \0A\xB8j" + \0A\xA8j"\x07 \0A\x98j" \b\xFB   \0(, \0((  Z \f!   \x07  +  \0(\xCC# \v! \r! \0A\xB0j$\0\v0\0\v\xC0\x7F#\0A\xC0k"\0$\0 \0 6\xB8 \0 6\xBC \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07=! \0A\0:\0 \0A\xBCj   \x07 (  \0Aj  \0Aj \0Aj \0A\xB0j\x80@@ ,\0\vA\0H@ (\0A\x006\0 A\x006\f\v A\0:\0\v A\x006\0\v \0-\0AF@  A- (\0(,\0\xDD\v A0 (\0(,\0! \0("Ak! \0(!@@  O\r\0 (\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H" +\x1B"\vO  \v ( +\x1BAtjAjIqE@ \x07  A\0H" \x1B"  k"Au" +j!\x07 + \bA\xFF\xFF\xFF\xFF\x07qAkA \x1B"\b kK@  \b \x07 \bk  \xFF\v At (\0  ,\0\vA\0H\x1Bj! @   \xFC +\0\0\v  jA\x006\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xA2 ( \x07 ,\0"A\0H" +\x1B!@ (\b  +\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b At" @ \b Atj  \xFC +\0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v \b AtjA\x006\0\f\v   j k  A\0  \xDE\v \x07 \v Aj$\0\v \0A\xBCj \0A\xB8j(@  (\0Ar6\0\v \0(\xBC \0(# \0(! \0A\x006 @  \0(\0\v \0A\xC0j$\0\v\xDD\x7F#\0A\xF0k"\x07$\0 \x07 6\xE8 \x07 6\xEC \x07A\xE3\x006\xCC \x07 \x07A\xD0j6\xC8 \x07A\xC0j" $ =!\0 \x07A\0:\0\xBF@ \x07A\xECj    (  \x07A\xBFj \0 \x07A\xC8j \x07A\xC4j \x07A\xE0j\x80E\r\0 \x07A\xEE\x1B(\0\x006\0\xB7 \x07A\xE7\x1B)\0\x007\xB0 \0 \x07A\xB0j \x07A\xBAj \x07A\x80j \0(\0(0\0 \x07Aj!\0@ \x07(\xC4" \x07(\xC8"k"A\x89N@ AvAj/"\0!\b \0E\r\v \0! \x07-\0\xBFAF@ \0A-:\0\0 \0Aj!\v \x07A\xA8j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xB0j \x07A\x80j"  \xB1 kAuj-\0\0:\0\0 Aj! Aj! \x07(\xC4!\f\v\v0\0\v0\0\v \x07A\xECj \x07A\xE8j(@  (\0Ar6\0\v \x07(\xEC \x07(\xC0# \x07(\xC8!\0 \x07A\x006\xC8 \0@ \0 \x07(\xCC\0\v \x07A\xF0j$\0\v\xAE\x7F#\0A\x90k"\0$\0 \0 6\x88 \0 6\x8C \0A\xE3\x006 \0 \0A j6 \0Aj"\x07 $ \x07>! \0A\0:\0 \0A\x8Cj   \x07 (  \0Aj  \0Aj \0Aj \0A\x84j\x85@@ ,\0\vA\0H@ (\0A\0:\0\0 A\x006\f\v A\0:\0\v A\0:\0\0\v \0-\0AF@  A- (\0(\0\xAA\v A0 (\0(\0 \0("Ak! \0(!A\xFFq!@@  O\r\0 -\0\0 G\r\0 Aj!\f\v\v#\0Ak"$\0@  F\r\0 ,\0\v! (\b!\b (!\x07  (\0  ,\0\v" A\0H" +\x1B"\vO  \v ( +\x1BjAjIqE@ \x07  A\0H" \x1B"  k"j!\x07  \bA\xFF\xFF\xFF\xFF\x07qAkA + \x1B"\b kK@  \b \x07 \bk  \xA4\v (\0  ,\0\vA\0H\x1B j! @   \xFC +\0\0\v  jA\0:\0\0 ,\0\vA\0H@  \x076\f\v  \x07A\xFF\0q:\0\v\f\v Aj"\x07  \xCE ( \x07 ,\0"A\0H" +\x1B!@ (\b  +\x1B" (\bA\xFF\xFF\xFF\xFF\x07qAkA + ,\0\v"\bA\0H"\x1B" ( \b \x1B"kM@ E\r (\0  \bA\0H\x1B!\b @  \bj  \xFC +\0\0\v  j!@ ,\0\vA\0H@  6\f\v  A\xFF\0q:\0\v\v  \bjA\0:\0\0\f\v   j k  A\0  \x89\v \x07 \v Aj$\0\v \0A\x8Cj \0A\x88j)@  (\0Ar6\0\v \0(\x8C \0(# \0(! \0A\x006 @  \0(\0\v \0A\x90j$\0\v\xD1\x7F#\0A\x90k"\x07$\0 \x07 6\x88 \x07 6\x8C \x07A\xE3\x006\x9C \x07 \x07A\xA0j6\x98 \x07A\x90j" $ >!\0 \x07A\0:\0\x8F@ \x07A\x8Cj    (  \x07A\x8Fj \0 \x07A\x98j \x07A\x94j \x07A\x84j\x85E\r\0 \x07A\xEE\x1B(\0\x006\0\x87 \x07A\xE7\x1B)\0\x007\x80 \0 \x07A\x80j \x07A\x8Aj \x07A\xF6\0j \0(\0( \0 \x07Aj!\0@ \x07(\x94" \x07(\x98"k"A\xE3\0N@ Aj/"\0!\b \0E\r\v \0! \x07-\0\x8FAF@ \0A-:\0\0 \0Aj!\v \x07A\x80j!@  M@@ A\0:\0\0 \x07 6\0 \0 \x07\xA7AG\r\0 \b!\f\v  \x07A\xF6\0j  \xB4 \x07k \x07j-\0 +:\0\0 Aj! Aj! \x07(\x94!\f\v\v0\0\v0\0\v \x07A\x8Cj \x07A\x88j)@  (\0Ar6\0\v \x07(\x8C \x07(\x90# \x07(\x98!\0 \x07A\x006\x98 \0@ \0 \x07(\x9C\0\v \x07A\x90j$\0\v\0A\xFC \v\xC7\x7F#\0A\xA0k"\b$\0 \b \bA\xA0j"6\f#\0A\x90k"\x07$\0 \x07 \x07A\x84j6 \0A\bj \x07A j" \x07Aj   \x88 \x07B\x007 \x07 6\f \b(\f \bAj"kAu! \0(\b!\0#\0Ak"$\0  \0H6\f  \x07A\fj  \x07Aj\xA4!\0 A\fjI Aj$\0 \0A\x7FF@0\0\v \b  \0Atj6\f \x07A\x90j$\0 \b(\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj (\0\xBE Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 $\0\v\xB8\0#\0A\x80k"$\0  A\xF4\0j6\f \0A\bj Aj" A\fj   \x88 (\f!\0#\0Ak"$\0#\0Ak"$\0#\0Ak"$\0  6\f@ \0 G@ A\fj ,\0\0\xC0 Aj!\f\v\v  6\b  (\f6\f Aj$\0  )\b7\b Aj$\0 (\f Aj$\0 A\x80j$\0\v\xB8\r\x7F#\0A0k"\x07$\0 \x07 6, A\x006\0 \x07 $ \x07=!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07 +\0\b \v\f\r\v\v \0 Aj \x07A,j   \b\x8B\f\v \0 Aj \x07A,j   \b\x8A\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07A\xA8\x86)\x007 \x07A\xA0\x86)\x007 \x07A\x98\x86)\x007\b \x07A\x90\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A\xC8\x86)\x007 \x07A\xC0\x86)\x007 \x07A\xB8\x86)\x007\b \x07A\xB0\x86)\x007\0 \x07 \0      \x07 \x07A jV6,\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j   \bAN!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A,j!\0#\0Ak"$\0  6\f@@ \0 A\fj(\r\0 \bA \0: \b(\0(\f\0E\r\0 \0Q\f\v\v \0 A\fj(@  (\0Ar6\0\v Aj$\0\f\r\v \x07A,j!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x95" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xD0\x86A,\xFC +\0\0 \x07 \0      \x07 \x07A,jV6,\f\v\v \x07A\x90\x87(\x006 \x07A\x88\x87)\x007\b \x07A\x80\x87)\x007\0 \x07 \0      \x07 \x07AjV6,\f +\v \x07A,j   \bAN!\0@ (\0"Aq \0A<JrE@  \x006\0\f\v  Ar6\0\v\f \v \x07A\xB8\x87)\x007 \x07A\xB0\x87)\x007 \x07A\xA8\x87)\x007\b \x07A\xA0\x87)\x007\0 \x07 \0      \x07 \x07A jV6,\f\b\v \x07A,j   \bAN!\0@ (\0"Aq \0AJrE@  \x006\f\v  Ar6\0\v\f\x07\v \0      \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(,     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BAtjV6,\f\v Aj \x07A,j   \b\x89\f\v \x07A,j   \bAN!\0 -\0\0AqE@  \0A\xECk6\v\f\v A%F\r\v  (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A,j" \0A\fj"(\r\0A \b :A\0 \b(\0(4\0A%G\r\0 Q (E\rA\v (\0r6\0\v \0Aj$\0\v \x07(,\v \x07A0j$\0\v \0  \0\0\0\vK\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# Aj A\fj   \x89 (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# \0 Aj A\fj   \x8A (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ =! (\b# \0 Aj A\fj   \x8B (\f Aj$\0\vF\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BAtjV\vX\x7F#\0A k"$\0 A\xB8\x87)\x007 A\xB0\x87)\x007 A\xA8\x87)\x007\b A\xA0\x87)\x007\0 \0       A j"V $\0\v\xDB\f\x7F#\0Ak"\x07$\0 \x07 6\f A\x006\0 \x07 $ \x07>!\b \x07(\0#\x7F@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xC1\0k9\0\x07 +\0\b \v\f\r\v\v \0 Aj \x07A\fj   \b\x8E\f\v \0 Aj \x07A\fj   \b\x8D\f\v \0A\bj \0(\b(\f\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkAKrE@  \x006\f\f\v  Ar6\0\v\f\v \x07B\xA5\xDA\xBD\xA9\xC2\xEC\xCB\x92\xF9\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07B\xA5\xB2\xB5\xA9\xD2\xAD\xCB\x92\xE4\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0AkA\vKrE@  \x006\b\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A\xEDJrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0Ak"\0A\vKrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj   \bAO!\0@ (\0"Aq \0A;JrE@  \x006\f\v  Ar6\0\v\f\v \x07A\fj!\0#\0Ak"$\0  6\f@@ \0 A\fj)\r\0 \0;"A\0H\r\0 \b(\b Atj-\0\0AqE\r\0 \0S\f\v\v \0 A\fj)@  (\0Ar6\0\v Aj$\0\f\r\v \x07A\fj!@ \0A\bj \0(\b(\b\0\0"\0( \0,\0\v" A\0H\x1BA\0 \0( \0,\0" A\0H\x1BkF@  (\0Ar6\0\f\v   \0 \0Aj \b A\0\x97" \0G (\b"A\fGrE@ A\x006\b\f\v  \0kA\fG A\vJrE@  A\fj6\b\v\v\f\f\v \x07A\xF8\x85(\0\x006\0\x07 \x07A\xF1\x85)\0\x007\0 \x07 \0      \x07 \x07A\vjW6\f\f\v\v \x07A\x80\x86-\0\0:\0 \x07A\xFC\x85(\0\x006\0 \x07 \0      \x07 \x07AjW6\f\f +\v \x07A\fj   \bAO!\0@ (\0"Aq \0A<JrE@  \x006\0\f\v  Ar6\0\v\f \v \x07B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\0 \x07 \0      \x07 \x07A\bjW6\f\f\b\v \x07A\fj   \bAO!\0@ (\0"Aq \0AJrE@  \x006\f\v  Ar6\0\v\f\x07\v \0      \0(\0(\0\f\x07\v \0A\bj \0(\b(\0\0! \x07 \0 \x07(\f     (\0  ,\0\v"\0A\0H"\x1B"  ( \0 \x1BjW6\f\f\v Aj \x07A\fj   \b\x8C\f\v \x07A\fj   \bAO!\0 -\0\0AqE@  \0A\xECk6\v\f\v A%F\r\v  (\0Ar6\0\f\v#\0Ak"\0$\0 \0 6\f@ \x7FA \x07A\fj" \0A\fj")\r\0A \b ;A\0 \b(\0($\0A%G\r\0 S )E\rA\v (\0r6\0\v \0Aj$\0\v \x07(\f\v \x07Aj$\0\v\x9B\x7F#\0A\xE0\0k"$\0 A\fj"   (\0 \0\b\0A\xD4\09"\0 -\0\b:\0\b \0 )\x007\0 \0A\fj A\fjb \0Aj Ajb \0A$j A$jb \0A0j A0jb \0A<j A<jb \0A\xC8\0j A\xC8\0jb \xC7 A\xE0\0j$\0 \0\vK\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# Aj A\fj   \x8C (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8D (\f Aj$\0\vM\x7F#\0Ak"$\0  6\f A\bj" $ >! (\b# \0 Aj A\fj   \x8E (\f Aj$\0\vC\0 \0      \0A\bj \0(\b(\0\0"\0(\0 \0 \0,\0\v"A\0H"\x1B"  \0(  \x1BjW\v;\x7F#\0Ak"$\0 B\xA5\x90\xE9\xA9\xD2\xC9\xCE\x92\xD3\x007\b \0      A\bj Aj"W $\0\v+\x7F  ("A\xB5\xFB~qA\x88r6    \x91  6\v\xB7\x07\x7F\x7F#\0A\x90k"\0$\0 \0B%7\x88 \0A\x88j"\x07ArA\x82 (\x91!\b \0 \0A\xE0j" 6\xDC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xE0j  \0A\x88j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xDCj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xDCj  \0A\x88j \0P\v"A\x7FF\r \0(\xDC\f\vA\0\v \0(\xDC"\x07  \x07j" + G!\v@ \0A\xE0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v +  \0A\xEC\0j \0A\xE8\0j \f\x90 \0(d#   \0(l \0(h  \\! \b!! \0A\x90j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xF0k"\0$\0 \0B%7\xE8 \0A\xE8j"ArA\xD7 (\x91!\x07 \0 \0A\xC0j"\b6\xBC*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\xC0j  \0A\xE8j" \0A0j]"AL\r*! \0 9 \0A\xBCj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\xBCj  \0A\xE8j \0P\v"A\x7FF\r \0(\xBC\f\vA\0\v \0(\xBC"  j" G! +@ \0A\xC0j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $  +  \0A\xCC\0j \0A\xC8\0j \v\x90 \0(D#   \0(L \0(H  \\! \x07!! \0A\xF0j$\0 \f\v0\0\v\v\xC7\x7F#\0A\xF0k"\0$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0\xD0 Ar!\f\v \x07A\bG\r\0 \0A0:\0\xD0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0\xD1 \0A\xD0jAr!\v \0A\xC8j  \0A\xE8j  \x92 \0(\xC8!\x07@ A\x88\x80qA\x88\x80G\r\0@  \x07F\r  -\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 Aj!\f\0\v\0\v \0A\xD0j" \x07 G! \0Aj"\b $   \x07 \0Aj" \0A\fj \0A\bj \b\x90 \0(#   \0(\f \0(\b  \\ \0A\xF0j$\0\v\r\0    \x91\v\xA8\x7F~#\0A\xF0k"$\0 A\xD0j!\0~ ("A\xCA\0q"\x07A\bF"\b B\0YrE@  \x07A\xC0\0F\r A-:\0\xD0 \0Ar!\0B\0 }\f\v \v! + \b \x07A\xC0\0F" r A\x80qE B\0SrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA + \b\x1B \x1B!\b@ A\x80qE Pr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xC8j \0 A\xE8j + \b\x92@ A\x88\x80qA\x88\x80F@@ \0 (\xC8"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (\xC8!\v A\xD0j"\0  G!\x07 Aj"\b $ \0 \x07  Aj"\0 A\fj A\bj \b\x90 (#  \0 (\f (\b  \\ A\xF0j$\0\v\xA5\x7F#\0A\x90k"$\0 A\x83j!\0\x7F ("A\xCA\0q"\x07A\bF"\b A\0NrE@  \x07A\xC0\0F\r A-:\0\x83 A\x84j!\0A\0 k\f\v \v! \b \x07A\xC0\0F" +r A\x80qE A\0HrrE@ \0A+:\0\0 \0Aj!\0\vA\bAA + \b\x1B +\x1B!\b@ E A\x80qEr\r\0 \x07A\xC0\0F@ \0A0:\0\0 \0Aj!\0\f\v \x07A\bG\r\0 \0A0:\0\0 \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0 \0Aj!\0\v A\xF8\0j \0 A\x90j \b\x94@ A\x88\x80qA\x88\x80F@@ \0 (x"F\r \0 \0-\0\0"A k  A\xE1\0kA\xFFqAI\x1B:\0\0 \0Aj!\0\f\0\v\0\v (x!\v A\x83j"\0  G! Aj"\x07 $ \0   Aj"\0 A\fj A\bj \x07\x90 (#  \0 (\f (\b  \\ A\x90j$\0\v\xDE\x7F#\0Ak"$\0  6\f@ -\0AqE@ \0     \0(\0( \0!\f\v  $ n!\0 (\0#  \0 \0(\0AA \x1Bj(\0\0 (\0"  ,\0\v"A\0H\x1B!@   \xC0A\0H"\0\x1B ( A\xFFq \0\x1BAtj F@ (\f!   A\fj (\0\xBE Aj! (\0! -\0\v!\f\v\v\v Aj$\0 \v+\x7F  ("A\xB5\xFB~qA\x88r6    \x94  6\v\xB7\x07\x7F\x7F#\0A\xE0k"\0$\0 \0B%7\xD8 \0A\xD8j"\x07ArA\x82 (\x91!\b \0 \0A\xB0j" 6\xAC*!@\x7F@\x7F@ \b@ (\b!\b \0 70 \0 7( \0 \b6  \x07 \0A j]"AJ\r\f\v \0 7P \0 7X \0A\xB0j  \0A\xD8j"\x07 \0A\xD0\0j]"AL\r*! \0 7@ \0 7H \0A\xACj  \x07 \0A@kP\f\v*! (\b!\x07 \0 7 \0 7\b \0 \x076\0 \0A\xACj  \0A\xD8j \0P\v"A\x7FF\r \0(\xAC\f\vA\0\v \0(\xAC"\x07  \x07j" + G!\v@ \0A\xB0j \x07F@ \0A\xF0\0j!A\0!\b\f\v At/"\b! \bE\r\v \0A\xE4\0j"\f $ \x07 \v +  \0A\xEC\0j \0A\xE8\0j \f\x93 \0(d#   \0(l \0(h  Z! \b!! \0A\xE0j$\0 \f\v0\0\v\v\x9A\x07\x7F\x7F#\0A\xC0k"\0$\0 \0B%7\xB8 \0A\xB8j"ArA\xD7 (\x91!\x07 \0 \0A\x90j"\b6\x8C*!@\x7F@\x7F@ \x07@ (\b!\x07 \0 9 \0 \x076 \b   \0Aj]"AJ\r\f\v \0 90 \0A\x90j  \0A\xB8j" \0A0j]"AL\r*! \0 9 \0A\x8Cj   \0A jP\f\v*! (\b! \0 9\b \0 6\0 \0A\x8Cj  \0A\xB8j \0P\v"A\x7FF\r \0(\x8C\f\vA\0\v \0(\x8C"  j" G! +@ \0A\x90j F@ \0A\xD0\0j!A\0!\x07\f\v At/"\x07! \x07E\r\v \0A\xC4\0j"\v $  +  \0A\xCC\0j \0A\xC8\0j \v\x93 \0(D#   \0(L \0(H  Z! \x07!! \0A\xC0j$\0 \f\v0\0\v\v\xC3\x7F#\0A\xF0\0k"\0$\0A\bAA + ("A\xCA\0q"\x07A\bF\x1B \x07A\xC0\0F"\b\x1B! \0A\xD0\0j!@ A\x80qE Pr\r\0 \b@ \0A0:\0P Ar!\f\v \x07A\bG\r\0 \0A0:\0P \0A\xD8\0A\xF8\0 A\x80\x80q\x1B:\0Q \0A\xD0\0jAr!\v \0A\xC8\0j  \0A\xE8\0j  \x92 \0(H!\x07@ A\x88\x80qA\x88\x80G\r\0@  \x07F\r  -\0\0"A k  A\xE1\0k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xFF\xFF\xFF\xFF\x07qAk \0,\0\xC3A\0N\x1B" \0 \0(\xB8  \0,\0\xC3A\0H\x1B" j6\xB4\v \0(\xCCC   \0A\xB4j \0A\bj \0(\xC4 \0A\xC4j \0Aj \0A\fj m\r\0 \0(\xCCB\f\v\v@ \0(\xC8 \0,\0\xCF" A\0H\x1BE\r\0 \0(\f" \0AjkA\x9FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \xA16\0 \0A\xC4j \0Aj \0(\f 5 \0A\xCCj \0A\xC8j(@  (\0Ar6\0\v \0(\xCC \0A\xB8j  \0A\xC4j  \0A\xD0j$\0\v\x99\x8B.\x7F}|#\0Ak"$\0  6\f A\x006\b B\x007\0    j"  k\xC2#\0A\xE0\0k"%$\0 %A\bj! (\0"! ( k!#\0A\xC0k"$\0 A\x006\xA0 B\x007\x98 A\x006\xB0 B\x007\xA8 A\xB4j"A\x006\b B\x007\0 A\x80\xC0\0\xB6 A\x80\xC0\0\x96 A\fjA\0A0\xFC\v\0  6\b  6@\x7F Aj!\v\x7FAzA\x94-\0\0A1G\r\0A~ \vE\r \vA\x006 \v( "E@ \vA\x006( \vA/6 A/!\v \v($E@ \vA06$\vA| \v((AA\xD07 \0"E\r \v 6 A\x0068  \v6\0 A\xB4\xFE\x006A~!@ \vE\r\0 \v( E\r\0 \v($"E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0@@ (8"@ ((AG\r\v A6( A6\f\f\v \v((  \0 A\x0068 \v( A6( A6\fE\r\v \v($E\r\0 \v("E\r\0 (\0 \vG\r\0 (A\xB4\xFE\0kAK\r\0A\0! A\x0064 B\x007, A\x006 \vA\x006\b \vB\x007 (\f"@ \v Aq60\v B\x007< A\x006$ A\x80\x806 B\x80\x80\x80\x80p7 B\xB4\xFE\x007 B\x81\x80\x80\x80p7\xC47  A\xB4 +j"6p  6T  6P\vA\0 E\r\0 \v((  \v($\0 \vA\x006 \v\vE@ A\x006\xAC@@  (\0"6  ( k6A\0!\v#\0Ak"$\0A~!\x1B@ Aj"\rE\r\0 \r( E\r\0 \r($E\r\0 \r("\x07E\r\0 \x07(\0 \rG\r\0 \x07("A\xB4\xFE\0kAK\r\0 \r(\f"E\r\0 \r(\0"E@ \r(\r\v A\xBF\xFE\0F@ \x07A\xC0\xFE\x006A\xC0\xFE\0!\v \x07A\xDC\0j!- \x07A\xF2\0j!. \x07A\xF4j!" \x07A\xD8\0j!& \x07A\xF0\0j!# \x07A\xB4 +j! \x07A\xF4\0j! \x07(@! \x07(<! \r("'! \r("!@@@@@@A}!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ A\xB4\xFE\0k\x07 +\r9:;<%&(\0*@BCD\v \x07(L! \f(\v \x07(L! \f%\v \x07(l! \f!\v \x07(\f!\f9\v AO\r E\r< A\bj! Aj! Ak! -\0\0 t j! AM\r ! ! !\f\v A O\r E\r; Aj! Ak! -\0\0 t j! AM\r\r ! !\f\v AO\r E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07M\r ! ! !\f\v \x07(\f" +E\r@ AO\r\0 E\r: A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! ! !\f\v E@ !A\0! ! \v!\f<\v Ar! Ak! -\0 t j! Aj!\v +AqE A\x9F\x96GrE@ \x07((E@ \x07A6(\vA\0! \x07A\0A\0A\0D"6 A\x9F\x96;\f  A\fjAD! \x07A\xB5\xFE\x006 \x07 6A\0! \x07(!\f7\v \x07($"@ A\x7F60\v A\btA\x80\xFEq A\bvjApE +AqqE@ \rA\xD96 \x07A\xD1\xFE\x006 \x07(!\f7\v AqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f7\v Av"Aq" A\bj! + A\x07M \x07(("\x7F  \x07 +6( +\v +OqE@ Ak! \rA\xF46 \x07A\xD1\xFE\x006 ! \x07(!\f7\vA\0! \x07A\x006 \x07A\x80 t6 \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBD\xFE\0A\xBF\xFE\0 A\x80\xC0\0q\x1B6A\0! \x07(!\f6\v E@ !A\0! ! \v!\f:\v Ar! Ak! -\0 t j! Aj!\v \x07 6 A\xFFqA\bG@ \rA\xBA6 \x07A\xD1\xFE\x006 \x07(!\f5\v A\x80\xC0q@ \rA\x90 +6 \x07A\xD1\xFE\x006 \x07(!\f5\v \x07($"@  A\bvAq6\0\v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 A\b:\0\f  A\bv:\0\r \x07 \x07( A\fjAD6\v \x07A\xB6\xFE\x006A\0!A\0!\f\v AK\r\v E\r5 Aj! Ak! -\0\0 t j! AK@ ! !\f\v A\bj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f7\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f6\v Ak! -\0 t j! Aj!\v \x07($"@  6\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0  6\f \x07 \x07( A\fjAD6\v \x07A\xB7\xFE\x006A\0!A\0!\f\v AK\r\v E\r2 Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v A\bj! E@ !\f3\v Ak! -\0 t j! Aj!\v \x07($"@  A\bv6\f  A\xFFq6\b\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0  ;\f \x07 \x07( A\fjAD6\v \x07A\xB8\xFE\x006A\0!A\0!A\0! \x07("A\x80\bq\r\f'\v \x07("A\x80\bqE@ !\f'\v ! AK\r\v E@A\0! ! \v!\f1\v Aj! Ak! + -\0\0 t j! A\x07K@ ! +!\f\v A\bj! +E@ !\f0\v Ak! -\0 t j! Aj!\v \x07 6D \x07($"@  6\vA\0!@ A\x80qE\r\0 \x07-\0\fAqE\r\0  ;\f \x07 \x07( A\fjAD6\vA\0!\f%\v A\bj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! AK@ ! !\f\v Aj! E@ !A\0! ! \v!\f/\v Aj! Ak! -\0 t j! A\x07K@ ! !\f\v Aj! E@ !\f.\v Ak! -\0 t j! Aj!\v \x07 AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr"6 \r 60 \x07A\xBE\xFE\x006A\0!A\0!\v \x07(E@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<A!\x1B\f/\v \x07A\0A\0A\0\x82"6 \r 60 \x07A\xBF\xFE\x006\v\x7F@ \x07(\bE@  AK\r \r\f-\v \x07A\xCE\xFE\x006  A\x07qv! Axq! \x07(!\f)\v Ak! -\0\0 t j! Aj! A\br\v \x07 Aq6\bA\xC1\xFE\0!@@@@@ AvAqAk\0\v \x07A\x90\xDC\x006P \x07B\x89\x80\x80\x80\xD0\x007X \x07A\x90\xEC\x006T \x07A\xC7\xFE\x006\f\vA\xC4\xFE\0!\f\v \rA\x976A\xD1\xFE\0!\v \x07 6\vAk! Av! \x07(!\f'\v  A\x07qv!\x7F Axq"\b AK\r\0 E@A\0! \b! \v!\f,\v \bA\bj! Aj! Ak! -\0\0 \bt j! AK@ ! ! \f\v E@ !A\0! ! \v!\f,\v \bAj! + Aj! Ak! -\0 t j! AK@ ! ! +\f\v E@ !A\0! +! \v!\f,\v \bAj! Aj! Ak! -\0 +t j! A\x07K@ ! ! \f\v E@ !A\0! ! \v!\f,\v Ak! -\0 t j! Aj!A \v! A\xFF\xFFq" A\x7FsAvG@ \rA\xC2\v6 \x07A\xD1\xFE\x006 \x07(!\f'\v \x07A\xC2\xFE\x006 \x07 6DA\0!A\0!\v \x07A\xC3\xFE\x006\v \x07(D"@    I\x1B"   I\x1B"E@ \v!\f*\v @   \xFC +\0\0\v \x07 \x07(D k6D  j!  k!  j!  k! \x07(!\f%\v \x07A\xBF\xFE\x006 \x07(!\f$\v E@ !A\0! ! \v!\f(\v Ar! Ak! -\0 t j! Aj!\v \x07 Aq"A\x81j6d \x07 AvAq"Aj6h \x07 A +vAqAj" +6\` Ak! Av! AI AMqE@ \rA\x9E\v6 \x07A\xD1\xFE\x006 \x07(!\f#\v \x07A\xC5\xFE\x006A\0! \x07A\x006l\f\v \x07(l" \x07(\`" +I\r\f\v E\r\r  \x07(D:\0\0 \x07A\xC8\xFE\x006 Ak! Aj! \x07(!\f \v \x07(\f"E@A\0!\f\v@ AK@ ! \f\v E\r# A\bj! Aj! Ak! + -\0\0 t j! AK@ +! !\f\v +E@ !A\0! ! \v!\f%\v Aj! + Aj! Ak!\b -\0 t j! AK@ \b! +!\f\v \bE@ !A\0! +! \v!\f%\v Aj! Aj! Ak!\b -\0 +t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f%\v A r! Aj! Ak! -\0 t j!\v \r  k" + \r(j6 \x07 \x07( +j6 Aq"E  Fr\x7F   +k! \x07(! \x07\x7F \x07(@   +D\f\v   +\x82\v"6 \r 60 \x07(\f"Aq\vE\r \x07(  AxA\xFF\x81\xFC\x07q A\xFF\x81\xFC\x07qA\bxr \x07(\x1BF\r \rA\x876 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \x07A\xC0\xFE\x006\f\v !A\0!A\0! !\v \x07A\xCF\xFE\x006\f\x1B\v@ AM@ E\r Ak! -\0\0 t j! A\br! Aj!\v \x07 Aj"6l  At/\xE0[Atj A\x07q;\0 Ak! Av! " +G\r\0\v +!\v AM@A\0! "Aq"\vAG@@  At/\xE0[AtjA\0;\0 Aj! \v Aj" sAG\r\0\v\v AM@@  At"A\xE0\xDB\0j/\0AtjA\0;\0  A\xE2\xDB\0j/\0AtjA\0;\0  A\xE4\xDB\0j/\0AtjA\0;\0  A\xE6\xDB\0j/\0AtjA\0;\0 Aj"AG\r\0\v\v \x07A6l\v \x07A\x076X \x07 6P \x07 6pA\0! A\0 A # & "\xA2"\v@ \rA\xF7 6 \x07A\xD1\xFE\x006 \x07(!\f\x1B\v \x07A\xC6\xFE\x006 \x07A\x006lA\0!\v\v \x07(d" \x07(hj" K@A\x7F \x07(XtA\x7Fs! \x07(P!@ !\f ! !@@@@@@   q"Atj-\0"\b M@ ! +\f\v@ E\r -\0\0 \ft!\b Aj! Ak! \fA\bj" +!\f +   \bj" q"Atj-\0"\bI\r\0\v\v  Atj/"AM@ \x07 Aj"6l  Atj ;\0 + \bk!  \bv! ! \f\v\x7F\x7F@@@ Ak\0\v \bAj" +K@@ E\r Ak! -\0\0 +t j! Aj! +A\bj" + I\r\0\v\v + \bk!  \bv! + E@ \rA\xCD +6 \x07A\xD1\xFE\x006 ! ! +! \x07(!\f%\v Ak! +Av! +AqAj!\b . Atj/\0\f\v \bAj" +K@@ E\r Ak! -\0\0 +t j! Aj! +A\bj" + I\r\0\v\v + \bkAk!  \bv"Av! A\x07qAj\f\v \bA\x07j" +K@@ E\r Ak! -\0\0 +t j! Aj! +A\bj" + I\r\0\v\v + \bkA\x07k!  \bv"A\x07v! A\xFF\0qA\vj\v!\bA\0\v!\f \b j K\rA\0! + \bAq"E\r \b!@  Atj \f;\0 Aj! Ak! +Aj" + G\r\0\v\f\v  j!  Atj!\f"\v \b!\f\v \rA\xCD +6 \x07A\xD1\xFE\x006 ! ! \x07(!\f\v \bAO@@  Atj" \f;\0  \f;  \f;  \f; Aj! Ak"\r\0\v\v \x07 6l\v ! ! I\r\0\v\v \x07/\xF4E@ \rA\xB46 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A 6X \x07 6P \x07 6pA   # & "\xA2"\v@ \rA\xDB 6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A6\\ \x07 \x07(p6TA  \x07(dAtj \x07(h # - "\xA2"\v@ \rA\xA9 +6 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC7\xFE\x006A\0!\v\v \x07A\xC8\xFE\x006\v AI A\x82IrE@ \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6< \r("(4"\bA\x07q!( \b j!/ \b (,"0j!1 \r(\f" \r("j"$A\x81k!)   kj! \r(\0" \r(jAk!*A\x7F (\\tA\x7Fs!A\x7F (XtA\x7Fs! (T!+ (P!, (@! (<!\f (8! + (0!@ AM\x7F -\0\0 t \fj -\0 A\bjtj!\f Aj! Ar \v , \f qAtj"-\0"k! \f v!\f@@@@@ \x7F \r\x7F@@ -\0\0"E@  -\0:\0\0 Aj!\f\b\v Aq@ /!\x7F Aq"E@ ! \f\f\v\x7F  M@ ! \f\v A\bj! -\0\0 t \fj!\f Aj\v!  k! \fA\x7F tA\x7Fsq j! \f v\v! AM@ -\0\0 t j -\0 A\bjtj! Ar! Aj!\v  +  qAtj"-\0" k!  v!\f -\0\0"Aq\r@ A\xC0\0qE@  + /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f -\0\0"AqE\r\f\v\v ! A\x93\f\v A\xC0\0qE@  , /Atj \fA\x7F tA\x7FsqAtj"-\0"k! \f v!\f\f\v\vA\xBF\xFE\0 A q\rA\xF7\f\v /!\x7F Aq" M@ ! \f\v -\0\0 t \fj!\f Aj  A\bj"M\r\0 -\0 t \fj!\f Aj! Aj\v! \fA\x7F tA\x7Fsq!  k! \f v!\f  j"!  k"M\r ! k" M\r (\xC47E\rA\xA6\v6A\xD1\xFE\0\v6\f\v@@ \bE@ + 0 kj!  O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v  $j jk jAxK\r@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\f\v  \bK@ + 1 kj!  \bk" O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v / $j jk jAxM@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v \b  k"O@ +!\f\vA\0! \b! +! (@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" (G\r\0\v\v \bA\bO@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  !k!  \bk!\f\v + \b kj!  O@ !\f\vA\0! ! "A\x07q"@@  -\0\0:\0\0 Ak! Aj! Aj! Aj" G\r\0\v\v  $j jk jAxK\r\0@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  !k!  k!\v@ AI\r\0A\0! Ak"AnAjAq"@@  -\0\0:\0\0  -\0:\0  -\0:\0 Ak! Aj! Aj! Aj" G\r\0\v\v A I\r\0@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07  -\0\b:\0\b  -\0 :\0  -\0 +:\0 +  -\0\v:\0\v A\fj! A\fj! A\fk"AK\r\0\v\v E@ !\f\v  -\0\0:\0\0 AF\r Aj!\f\v  !k!@ " "-\0\0:\0\0  -\0:\0  -\0:\0 Aj! Aj! Ak"AK\r\0\v E\r  -\0\0:\0 AG@ Aj!\f\v  -\0:\0 Aj!\f\v  -\0:\0 Aj!\v *O\r\0  )I\r\v\v \r 6\f \r Avk"6\0 \r ) kA\x81j6 \r * kAj6  A\x07q"6@  \fA\x7F tA\x7Fsq6< \x07(@! \x07(<! \r(! \r(\0! \r(! \r(\f! \x07(A\xBF\xFE\0G\r \x07A\x7F6\xC87 \x07(!\f\v \x07A\x006\xC87 ! ! !@ \x07(P" A\x7F \x07(XtA\x7Fs"qAtj"\b-\0"\f M@ ! +\f\v@ E\r\r -\0\0 t!\b Aj! Ak! A\bj" +! +   \bj" qAtj"\b-\0"\fI\r\0\v\v \f! \b/!@ \b-\0\0"\bAkA\xFFqAK@A\0! ! !\f\v ! !@ +"   Atj" A\x7F  \bjtA\x7Fs"q vAtj"-\0"\fjO@ +!\b\f\v@ E\r\r -\0\0 t!\f Aj! Ak! A\bj"\b!    \fj" q vAtj"-\0"\fj \bK\r\0\v\v \b k! +  v! -\0\0!\b /!\v \x07 A\xFF\xFFq6D \x07  \fj6\xC87 + \fk!  \fv! \bA\xFFq"E@ \x07A\xCD\xFE\x006 \x07(!\f\v A q@ \x07A\xBF\xFE\x006 \x07A\x7F6\xC87 \x07(!\f\v A\xC0\0q@ \rA\xF76 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xC9\xFE\x006 \x07 Aq" 6L\v ! + !\b@ E@ \x07(D!\f\v ! !  I@@ E\r\v Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(D A\x7F tA\x7Fsqj"6D  k!  v!\v \x07A\xCA\xFE\x006 \x07 6\xCC7\v ! ! !@ \x07(T" A\x7F \x07(\\tA\x7Fs"qAtj"\b-\0"\f M@ ! +\f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj" +! +   \bj" qAtj"\b-\0"\fI\r\0\v\v \b/! \x07\x7F \b-\0\0" AO@ ! ! \f!\b \x07(\xC87\f\v ! !@ +" \f  Atj" A\x7F \fjtA\x7Fs"q \fvAtj"-\0"\bjO@ ! \f\v@ E\r\b -\0\0 t!\b Aj! Ak! A\bj" ! \f   \bj" q \fvAtj"-\0"\bj K\r\0\v\v \fk! +  \fv! -\0\0! /! \x07(\xC87 \fj\v \bj6\xC87 + \bk!  \bv! A\xC0\0q@ \rA\x936 \x07A\xD1\xFE\x006 \x07(!\f\v \x07A\xCB\xFE\x006 \x07 Aq" 6L \x07 A\xFF\xFFq6H\v ! + !\b @ ! !  I@@ E\r Ak! -\0\0 t j! Aj"! A\bj" I\r\0\v\v \x07 \x07(\xC87 j6\xC87 \x07 \x07(H A\x7F tA\x7Fsqj6H  v!  k!\v \x07A\xCC\xFE\x006\v \r\vA\0! \v!\f\v\x7F \x07(H"  k"K@@  k" \x07(0M\r\0 \x07(\xC47E\r\0 \rA\xA66 \x07A\xD1\xFE\x006 \x07(!\f\v\x7F \x07(4" I@ \x07(8 \x07(,  k"kj\f\v \x07(8  kj\v!  \x07(D"  I\x1B\f\v  k! \x07(D" \v! \x07    I\x1B" +k6D +Ak!\fA\0! +A\x07q"\bE\r +!@  -\0\0:\0\0 Ak! Aj! Aj! Aj" \bG\r\0\v\f\x07\v \b +j!  \bAtj!\f\v  j! + Atj!\f\v  j!  Atj!\f\v \b +j!  \bAtj!\f\v  j! + Atj!\f\v  j!  Atj!\f\v +!\v \fA\x07O@@  -\0\0:\0\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0:\0  -\0\x07:\0\x07 A\bj! A\bj! A\bk"\r\0\v\v  +k! \x07(D\r\0 \x07A\xC8\xFE\x006 \x07(!\f \v \x07(!\f\b\vA\0! ! +! \v!\f\v\v \x07($"@ A\x006\v !\v \x07A\xB9\xFE\x006\v@ \x07(" A\x80\bqE\r\0 \x07(D"   K\x1B"\f@@ \x07($"\bE\r\0 \b(" +E\r\0 \b(" \b( k"M\r\0  k \f  \fj K\x1B"@  +j  \xFC +\0\0\v \x07(! \v@ A\x80qE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  \fD6\v \x07 \x07(D \fk"6D  \fk!  \fj!\v E\r\0 \v!\f \v \x07A\xBA\xFE\x006 \x07A\x006D\v@ \x07-\0A\bq@A\0! E\r\b@  j-\0\0!\b@ \x07($" +E\r\0 +("E\r\0 \x07(D" +( O\r\0 \x07 Aj6D  j \b:\0\0\v \bA\0  Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  D6\v  j!  k! \bE\r \v!\f \v \x07($"E\r\0 A\x006\v \x07A\xBB\xFE\x006 \x07A\x006D\v@ \x07-\0Aq@A\0! E\r\x07@  j-\0\0!\b@ \x07($" +E\r\0 +($"E\r\0 \x07(D" +((O\r\0 \x07 Aj6D  j \b:\0\0\v \bA\0  Aj"K\x1B\r\0\v@ \x07-\0AqE\r\0 \x07-\0\fAqE\r\0 \x07 \x07(  D6\v  j!  k! \bE\r \v!\f\b\v \x07($"E\r\0 A\x006$\v \x07A\xBC\xFE\x006\v \x07(" +A\x80q@@ AK@ !\f\v E\r A\bj! Aj! Ak! -\0\0 t j! A\x07K@ ! !\f\v E@ !A\0! ! \v!\f\b\v Ar! Aj! Ak! -\0 t j!\v@ \x07-\0\fAqE\r\0  \x07/F\r\0 \rA\xCB6 \x07A\xD1\xFE\x006 ! \x07(!\f\vA\0!A\0! !\v \x07($"@ A60  +A vAq6,\v \x07A\0A\0A\0D"6 \r 60 \x07A\xBF\xFE\x006 \x07(!\f\v E\r \x07(E\r@ AK@ !\f\v E\r A\bj! Aj! Ak! + -\0\0 t j! AK@ +! !\f\v +E@ !A\0! ! \v!\f\v Aj! + Aj! Ak!\b -\0 t j! AK@ \b! +!\f\v \bE@ !A\0! +! \v!\f\v Aj! Aj! Ak!\b -\0 +t j! A\x07K@ \b! !\f\v \bE@ !A\0! ! \v!\f\v A r! Aj! Ak! -\0 t j!\v@ AqE\r\0  \x07( F\r\0 \rA\xF06 \x07A\xD1\xFE\x006 ! \x07(!\f\v\v !A\0!A\0!\v \x07A\xD0\xFE\x006\vA!\f\vA\0! \v!\v \r 6 \r 6\f \r 6 \r 6\0 \x07 6@ \x07 6<@@ \x07(,E@  F\r \x07(A\xD0\xFE\0K\r\v\x7F  k! @@ \r(" +(8"\vE@A! + \r((A +((tA \r( \0"\v68 \vE\r\v +(,"E@ +B\x0070 +A +((t"6,\v  M@ @ \v  k \xFC +\0\0\v +A\x0064\f\v  +(4"k"  I\x1B"@  \vj  k \xFC +\0\0\v  I@ k"@ +(8  k \xFC +\0\0\v + 64\f\vA\0! + +(4 j"A\0  +(,"G\x1B64  +(0"M\r\0 +  j60\v \f\v + +(,60A\0\v\r \r(! \r(!\v \r \r(\b ' kj6\b \r  k" \r(j6 \x07 \x07( j6 \x07-\0\fAqE  FrE@ \r(\f k! \x07(! \x07\x7F \x07(@   D\f\v   \x82\v"6 \r 60\v \r \x07(@A\xC0\0A\0 \x07(\b\x1BjA\x80A\0 \x07("A\xBF\xFE\0F\x1BjA\x80A\x80A\0 A\xC2\xFE\0F\x1B A\xC7\xFE\0F\x1Bj6, A{ \x1B   F\x1B   'F\x1B!\x1B\f\v \x07A\xD2\xFE\x006\vA|!\x1B\v Aj$\0 \x1BAK\r A\xA8j! + (\xAC!\b (\0! ( (k!#\0A k"$\0@  k" A\0L\r\0 +(\b +("\vk N@ \v \bk" H@   j"k"E  FrE@ \v  \xFC +\0\0\v +  \vj6 A\0L\r + \b \v \b j\xD1  \bj!@  \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v + \b \v \b j"\xD1@  \bF\r \b -\0\0:\0\0 Aj! \bAj!\b\f\0\v\0\v A\fj + +(\0k \vj\x83 \b +(\0k +\x8C"\v(\b"j!@  G@  -\0\0:\0\0 Aj! Aj!\f\v\v \v 6\b \v( +( \bk"@ \v(\b \b \xFC +\0\0\v \v \v(\b +( \bkj6\b + \b6 \v( +(\0" \bkj! \b k"@   \xFC +\0\0\v \v 6 + +(\0"6 + \v(6\0 \v 6 +(! + \v(\b6 \v 6\b +(\b! + \v(\f6\b \v 6\f \v \v(6\0 \v\x87\v A j$\0 \x1BAG\r\0\v \r\xCB 1 A\x98j" (\xA8" (\xAC k\xE0 +1 \rA\x006\\ \rA\xF8\xF9\x006@ \rA\xD0\xF9\x006\0 \rA\xE4\xF9\x006\b \rA\x88\xFA\0(\0"6\0 \r A\fk(\0jA\x8C\xFA\0(\x006\0 \rA\x006 \r \r(\0A\fk(\0j"A\x006  \rA\fj""6 A\x006\f B\x82\xA0\x80\x80\xE0\x007  E6 A jA\0A(\xFC\v\0 Aj\xF4 A\0:\0P B\x80\x80\x80\x80p7H \rA\x90\xFA\0(\0"6\b A\fk(\0 \rA\bjjA\x94\xFA\0(\x006\0 \rA\x84\xFA\0(\0"6\0 \r A\fk(\0jA\x98\xFA\0(\x006\0 \rA\x9C\xFA\0(\x006\b \r"A\xD0\xF9\x006\0 A\xE4\xF9\x006\b A\xF8\xF9\x006@ A\xA8\xF5\x006\0 Aj\xF4 B\x007 B\x007 B\x007\b B\x007 A\xE8\xF5\x006\0 B\x007( A60  A j"\vG@@ ,\0\v! \v,\0\vA\0H@ (\0  A\0H"\x1B!@ (  \x1B" \v(\bA\xFF\xFF\xFF\xFF\x07q"I@ \v 6 \v(\0! @   \xFC +\0\0\v  jA\0:\0\0\f\v \v Ak  kAj \v("A\0   \x89\v\f\v A\0H@ (\0!@ ("A +M@ \v :\0\v @ \v  \xFC +\0\0\v  \vjA\0:\0\0\f\v \vA + A +k \v-\0\vA\xFF\0q"A\0   \x89\v\f\v \v (\b6\b \v )\x007\0\v\v A\x006, ( A j" ,\0+"A\0H"\x1B! + ($  \x1B! (0"A\bq@  +6\f  +6\b  +j"6  6,\v@ AqE\r\0  +j6, A + ((A\xFF\xFF\xFF\xFF\x07qAk A\0N\x1B"  +6  +6  + ($ ,\0+" A\0H\x1Bj6 -\x000AqE\r\0@ A\0H@  +A\xFF\xFF\xFF\xFF\x07j" +6 A\xFF\xFF\xFF\xFF\x07k! \f\v\v E\r\0  +j6\v#\0A\xC0k"\b$\0 \bB\x007\xB8 \bB\xCE\x8E\xCD\x8257\xB0  \bA\xB0jAf@@  (\0A\fk(\0j-\0AqE@ \b(\xB0A\xCE\x8E\xCD\x82F\r\vA\xD5\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB4AkA|M@A\xD9 \bA\xB4j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b(\xB8"A\x81\xAD\xE2O@A\xDB \bA\xB8j\xC7 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \b-\0\xBC"AO@ \b 6\0A\x97 \ba\`A\xB0\xF1\0(\0L B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v \xCD! \b(\xB4! \bA:\0e \bA\xE8\0j" +A\0A\xC8\0\xFC\v\0 \b 6X \b \b-\0\xBC6\\ \b \b-\0\xBD6\` \b \b-\0\xBEAq:\0d + Al"AA AF\x1Blz \bA\xF4\0j"\v z \b AK":\0e \bA\x80j"AA \x1B lz \bA\x8Cj" z \bA\x98j" z \bA\xA4j"  lz  \b(h \bA\xCC\0j +u" ( (\0kf 1  \b(\x8C \bA@k u"( (\0kf 1  \b(\x98 \bA4j u"( (\0kf 1  \b(t \bA(j \vu"( (\0kf 1  \b(\x80 \bAj u"( (\0kf 1  \b(\xA4 \bAj u"( (\0kf 1@  (\0A\fk(\0j-\0Aq@A\xB6\f\xBF B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\f\v  \bA\xD8\0j")7  )\x007\0 Aj Ajt Aj Ajt A(j A(jt A4j A4jt A@k A@kt A\xCC\0j A\xCC\0jt\v \bA\xD8\0j\xCC\v \bA\xC0j$\0 \x81\f\v Aj\xCB\v 1 A\xA8j1 B\x007\0 B\x007\0 A:\0\r AjA\0A\xC8\0\xFC\v\0\v A\x98j  A\xC0j$\0#\0A\x90k"\b$\0 (\0! (\xCD!@@@ ( (k"\v Al" +AA \v (\0"Al"F\x1BlG@ \bA\xA568 \bA\xF8\x0064 \bA\x9F60A\xED\v \bA0ja\`A\xB0\xF1\0(\0L\f\v + ( (kG@ \bA\xF9\x006< \bA<jA\xF5\xD0\f\v (, ((kAA -\0\r"Aq\x1B lG@ \bA\xCD6( \bA\xFA\x006$ \bA\x9F6 A\xED\v \bA ja\`A\xB0\xF1\0(\0L\f\v (8 (4kG@ \bA\x9E6 \bA\xFB\x006 \bA\x9F6A\xED\v \bAja\`A\xB0\xF1\0(\0L\f\v + (D (@kG@ \bA\xFC\x006< \bA<jA\xCB\xD0\f\v (P (Lk"  +lF\r \bA\x9F6\b \bA\xFD\x006 \bA\x9F6\0A\xED\v \ba\`A\xB0\xF1\0(\0L\v \0A\0:\0\b \0B\x007\0 \0A\fjA\0A\xC8\0\xFC\v\0\f\v \0A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2 A\x80q\x1B"28\0 2 2\x94 3\x92!3 A +v!\v Ak!\f\v\v!@ AG@  At"j"  j*\0 *\0\x948\0 Aj!\f\v\v\f\v \0($ (( \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7L \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7D \bB\x80\x80\x80\xFC\x83\x80\x80\xC0?7< \vA\xD8A<\xFC +\0\0#\0Ak"$\0 \fAlj"-\0! -\0!  -\0\0\xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*H\x948  \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*L\x948\b  \xB3C\x81\x80\0<\x94C\0\0\x80\xBF\x92 \b*P\x94"28\f \fAtj" 28\b  )7\0 C\0\0\x80? *\f *\f\x94 * *\x94 *\b *\b\x94\x92\x92\x93"2C\0\0\0\0 2C\0\0\0\0^\x1B\x918\f Aj$\0\v \fAj!\f\f\v\v!\f@ \fG@  \fAtj}C\0\0\0\0  \fj-\0\0\xB3C\0\0\x7FC\x95"2C\0\0\x80? 2\x93\x95"3\xBC"A\x80\x80\x80\xFCF\r\0@ A\x80\x80\x80\xFC\x07kA\xFF\xFF\xFF\x87xM@ At"E@#\0Ak"C\0\0\x80\xBF8\f *\fC\0\0\0\0\x95\f\v A\x80\x80\x80\xFC\x07F\r A\x80\x80\x80xI A\0NqE@ 3 3\x93"2 2\x95\f\v 3C\0\0\0K\x94\xBCA\x80\x80\x80\xDC\0k!\vA\x98\xF1\0+\0  A\x80\x80\xCC\xF9k"A\x80\x80\x80|qk\xBE\xBB AvA\xF0q"+\x90o\xA2D\0\0\0\0\0\0\xF0\xBF\xA0"7 7\xA2"8\xA2A\xA0\xF1\0+\0 7\xA2A\xA8\xF1\0+\0\xA0\xA0 8\xA2 Au\xB7A\x90\xF1\0+\0\xA2 +\x98o\xA0 7\xA0\xA0\xB6!3\v 3\v8\0 \fAj!\f\f\v\v \0(<! (@!A\0!\f@ + \fF@ (P (L"k! \0(H!A\0!@  F@ (\f!A\0!#\0A\xE0\0k"\v$\0#\0Ak"$\0A!\x7FA!A A\0L\r\0 AkAs"A\x7FsAq! AqE! AqE\v!  :\0  :\0  :\0\r -\0! -\0! -\0\r! \vA\x80\x80\x80\xFC6@ \vA\x80\x80\x80\xFC68 \vC\0\0\x80?C\0\0\x80\xBF \x1B"68\\ \vC\0\0\x80?C\0\0\x80\xBF \x1B"58X \v 68T \v 58P \vC\0\0\x80?C\0\0\x80\xBF \x1B"48L \v 48D \v 68, \v 58( \v 48$ \v 58 \v 48 \v 68\f \v 6 5\x94"38< \v 4 5\x94"284 \v 6 4\x94"480 \v 48 \v 38 \v 28 \v 4 5\x948H Aj$\0 \0( \0(\f"kAu!@  M@ \0(( \0($"kAu!A\0!@  M@@ \0(L \0(H"kAuAn" \0(\0n! \vA$j!\0A\0!A\0!@A\0!\f  M\r@  \fM@  j!\f  Atj" \0 \fAtj*\0"2 *\0\x948\0  2 *\x948  2 *\b\x948\b Aj! \fAj!\f\f\v\0\v\0\v\0\v  Atj" \v* *\0\x948\0  \v* *\x948  \v* *\b\x948\b Aj!\f\v\v \vA\xE0\0j$\0  Atj" \v*\f *\0\x948\0  \v* *\x948  \v* *\b\x948\b Aj!\f\v\v  Atj  j-\0\0\xB3C\0\0\0\xC3\x92C\0\0\0<\x948\0 Aj!\f\v\v  \fAtj  \fj-\0\0\xB3C\0\0\x7FC\x95C\0\0\0\xBF\x92C\x9A\x99>\x958\0 \fAj!\f\f\v\v  \fAtj  \fj-\0\0\xB3C\0\0\x80=\x94C\0\0 \xC1\x928\0 \fAj!\f\f\v\v\v \bA\x90j$\0 \xCC %A\xE0\0j$\0 1 Aj$\0\v\x81\x7F#\0A k"$\0  6@ -\0AqE@ A\x7F6\0 \0      \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v  $ =! (\0#  $ n!\0 (\0#  \0 \0(\0(\0 A\fr \0 \0(\0(\0  Aj   Aj"  A\x95 F:\0\0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FJ\r\0 \0 Aj6\f  \0(\b6\0\v   \0(\xB4  \xA16\0 \0A\xC8j \0Aj \0(\f 5 \0A\xDCj \0A\xD8j)@  (\0Ar6\0\v \0(\xDC \0A\xB8j  \0A\xC8j  \0A\xE0j$\0\v\x81\x7F#\0A k"$\0  6@ -\0AqE@ A\x7F6\0 \0      \0(\0(\0!@@@ (\0\0\v A\0:\0\0\f\v A:\0\0\f\v A:\0\0 A6\0\f\v  $ >! (\0#  $ p!\0 (\0#  \0 \0(\0(\0 A\fr \0 \0(\0(\0  Aj   Aj"  A\x97 F:\0\0 (!@ A\fk " G\r\0\v\v A j$\0 \v@\x7FA\0!\0\x7F  F\x7F \0 (\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0  \xA2\vT\x7F@@  G@A\x7F!\0  F\r (\0" (\0"H\r  J@A Aj! Aj!\f\v\0\v\v  G!\0\v \0\v@\x7FA\0!\0\x7F  F\x7F \0 ,\0\0 \0Atj"\0A\x80\x80\x80\x80\x7Fq"Av r \0s!\0 Aj!\f\v\v\v\v\0 \0  \xCE\v^\x7F   kj!@@  G@A\x7F!\0  F\r ,\0\0" ,\0\0"\x07H\r  \x07J@A Aj! Aj!\f\v\0\v\v  G!\0\v \0\vT\x7F  \0(T" A\0 A\x80j"\xCA" k  \x1B"   K\x1B"Y \0  j"6T \0 6\b \0  j6 \v\xA8\x7F \0(T"(\0! (" \0( \0("\x07k"  I\x1B"@  \x07 Y  (\0 j"6\0  ( k"6\v    K\x1B"@   Y  (\0 j"6\0  ( k6\v A\0:\0\0 \0 \0(,"6 \0 6 \v\b\0 \0K!\v\0 \0 \0(\0A\fk(\0j\xC0\v\0 \0 \0(\0A\fk(\0j\x81\v +\0 \0A\bk\xC0\v +\0 \0A\bk\x81\v\0 \0  )\bA\0  (\0(\0\v \0 \0\xB0!\v\x95\x7F~ (," ("I@  6, !\vB\x7F! +@ Aq"\x07E AF \x07AFqr\r\0 @  ( A j ,\0+A\0H\x1Bk\xAC! \v@@@ \0\v A\bq@ (\f (\bk\xAC!\b\f\v  (k\xAC!\b\f\v !\b\v  \b|"B\0S  Ur\r\0 A\bq!@ P\r\0 @ (\fE\r\v AqE\r\0 E\r\v @  6  (\b \xA7j6\f\v Aq@  ( \xA7j6\v ! +\v \0 +7\b \0B\x007\0\v\x99\b\x7F A\x7FF@A\0\v \0(\b! \0(\f! \0\x7F \0(" \0(G@ \0(,\f\v \0-\x000AqE@A\x7F\v \0(,!\x07 \0(! \0A j"A\0\xAA A + \0((A\xFF\xFF\xFF\xFF\x07qAk \0,\0+A\0N\x1B" \0 \0(  \0,\0+"\bA\0H" \x1B"6 \0  \0($ \b \x1Bj6 \0   kj"6  \x07 kj\v" Aj"  I\x1B"6, \0-\x000A\bq@ \0 6 \0 \0( \0A j \0,\0+A\0H\x1B"6\b \0   kj6\f\v \0 \xC0\xC3\v\x8E\x7F \0(," \0("I@ \0 6, !\v\x7FA\x7F \0(\f" \0(\bM\r\0 A\x7FF@ \0 6 \0 Ak6\fA\0\v \0-\x000AqE@A\x7F Ak-\0\0 A\xFFqG\r\v \0 6 \0 Ak"\x006\f \0 :\0\0 \v\v_\x7F \0(," \0("I@ \0 6, !\vA\x7F!@ \0-\x000A\bqE\r\0  \0("K\x7F \0 6  \v \0(\f"\0M\r\0 \0-\0\0!\v \v\0 \0 \0(\0A\fk(\0j\xC1\v +\0 \0A\bk\xC1\v \0 \0A\f\xA5\v\0 \0AjK \0A\bk\v\f\0 \0A\fjK \0\v\0 \0 \0(\0A\fk(\0j\xC1\v \0 \0A\xA5\v\f\0 \0AjK \0\v\0 \0 \0(\0A\fk(\0j\xC5\v \0 \0A\b\xA5\v\f\0 \0A\bjK \0\v\x96\x7F@@  L\r\0 \0(" \0("O@ \0 -\0\0 \0(\0(4\0A\x7FF\r Aj! Aj!\f \0  k"  k"  J\x1B"\x7F @   \xFC +\0\0\v \0( \v j6  j!  j!\f\v\0\v\v \v3\x7FA\x7F! \0 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}>\0 Ak" \bO\r\0\v B\x80\x94\xEB\xDCT\r\0 \bAk"\b >\0\v@ \b \x07"I@ Ak"\x07(\0E\r\v\v \v \v(, k" 6, !\x07 A\0J\r\0\v\v A\0H@ +AjA nAj! A\xE6\0F!@A A\0 k" A O\x1B!\r@  \bM@A\0A \b(\0\x1B!\x07\f\vA\x80\x94\xEB\xDC \rv!A\x7F \rtA\x7Fs!A\0! \b!\x07@ \x07 \x07(\0" \rv j6\0  q l! \x07Aj"\x07 I\r\0\vA\0A \b(\0\x1B!\x07 E\r\0  6\0 Aj!\v \v \v(, \rj" 6,  \x07 \bj"\b \x1B" Atj   kAu J\x1B! A\0H\r\0\v\vA\0! @  \bM\r\0  \bkAuA l! A +!\x07 \b(\0"A +I\r\0@ Aj!  \x07A +l"\x07O\r\0\v\v + A\0 A\xE6\0G\x1Bk A\xE7\0F +A\0Gqk"  kAuA lA kH@ \vA0jA\x84\`A\xA4b \fA\0H\x1Bj A\x80\xC8\0j"\fA m"Atj!\rA +!\x07 \f A lk"A\x07L@@ \x07A +l!\x07 Aj"A\bG\r\0\v\v@ \r(\0"\f \f \x07n" \x07lk"E \rAj" Fq\r\0@ AqE@D\0\0\0\0\0\0@C! \x07A\x80\x94\xEB\xDCG \b \rOr\r \rAk-\0\0AqE\r\vD\0\0\0\0\0@C!\vD\0\0\0\0\0\0\xE0?D\0\0\0\0\0\0\xF0?D\0\0\0\0\0\0\xF8?  F\x1BD\0\0\0\0\0\0\xF8?  \x07Av"F\x1B  K\x1B!@ \r\0 -\0\0A-G\r\0 \x9A! \x9A!\v \r \f k"6\0  \xA0 a\r\0 \r  \x07j"6\0 A\x80\x94\xEB\xDCO@@ \rA\x006\0 \b \rAk"\rK@ \bAk"\bA\x006\0\v \r \r(\0Aj"6\0 A\xFF\x93\xEB\xDCK\r\0\v\v  \bkAuA l! A +!\x07 \b(\0"A +I\r\0@ Aj!  \x07A +l"\x07O\r\0\v\v \rAj"   I\x1B!\v@ "\f \bM"\x07E@ Ak"(\0E\r\v\v@ A\xE7\0G@ A\bq!\f\v A\x7FsA\x7F +A +\x1B" J A{Jq"\x1B j! +A\x7FA~ \x1B j! A\bq"\r\0Aw!@ \x07\r\0 \fAk(\0"E\r\0A +!A\0! A +p\r\0@ "\x07Aj!  A +l"pE\r\0\v \x07A\x7Fs!\v \f kAuA l! A_qA\xC6\0F@A\0! +  jA k"A\0 A\0J\x1B"  +J\x1B! +\f\vA\0! +  j jA k"A\0 A\0J\x1B"  +J\x1B! +\vA\x7F!\r +A\xFD\xFF\xFF\xFF\x07A\xFE\xFF\xFF\xFF\x07 + r"\x1BJ\r + A\0GjAj!@ A_q"\x07A\xC6\0F@ A\xFF\xFF\xFF\xFF\x07sJ\r A\0 A\0J\x1B!\f\v  Au"s k\xAD x"kAL@@ Ak"A0:\0\0  kAH\r\0\v\v Ak" :\0\0 AkA-A+ A\0H\x1B:\0\0  k" A\xFF\xFF\xFF\xFF\x07sJ\r\v  j" A\xFF\xFF\xFF\xFF\x07sJ\r \0A   j" 7 \0  3 \0A0  A\x80\x80s7@@@ \x07A\xC6\0F@ \vAjA r!  \b \b K\x1B"!\b@ \b5\0 x!@  \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v  G\r\0 Ak"A0:\0\0\v \0   k3 \bAj"\b M\r\0\v @ \0A\x9AA3\v +A\0L \b \fOr\r@ \b5\0 x" \vAjK@@ Ak"A0:\0\0  \vAjK\r\0\v\v \0 A + +A N\x1B3 +A k! \bAj"\b \fO\r +A J ! +\r\0\v\f\v@ +A\0H\r\0 \f \bAj \b \fI\x1B! \vAjA r!\f \b!\x07@ \f \x075\0 \fx"F@ Ak"A0:\0\0\v@ \x07 \bG@  \vAjM\r@ Ak"A0:\0\0  \vAjK\r\0\v\f\v \0 A3 Aj! + rE\r\0 \0A\x9AA3\v \0  \f k" +  +H\x1B3 + k! + \x07Aj"\x07 O\r +A\0N\r\0\v\v \0A0 +AjAA\07 \0   k3\f\v +!\v \0A0 A jA A\07\v \0A  A\x80\xC0\0s7   J\x1B!\r\f\v  AtAuA qj! @ A\vK\r\0A\f k!D\0\0\0\0\0\x000@!@ D\0\0\0\0\0\x000@\xA2! Ak"\r\0\v -\0\0A-F@  \x9A \xA1\xA0\x9A!\f\v  \xA0 \xA1!\v  \v(,"\x07 \x07Au"s k\xAD x"F@ Ak"A0:\0\0 \v(,!\x07\v Ar! + A q!\f Ak" Aj:\0\0 AkA-A+ \x07A\0H\x1B:\0\0 A\bqE A\0Lq!\b \vAj!\x07@ \x07" \xFC"A\x90\xF5\0j-\0\0 \fr:\0\0  \xB7\xA1D\0\0\0\0\0\x000@\xA2"D\0\0\0\0\0\0\0\0a \bq \x07Aj"\x07 \vAjkAGrE@ A.:\0 Aj!\x07\v D\0\0\0\0\0\0\0\0b\r\0\vA\x7F!\r A\xFD\xFF\xFF\xFF\x07 +  k"\bj"kJ\r\0 \0A   Aj \x07 \vAj"k"\x07 \x07Ak H\x1B \x07 \x1B"j" 7 \0 +3 \0A0   A\x80\x80s7 \0  \x073 \0A0  \x07kA\0A\07 \0  \b3 \0A   A\x80\xC0\0s7    J\x1B!\r\v \vA\xB0j$\0 \r\v\0B\0\v\xD6\x07\x7F#\0A k"$\0  \0("6 \0(!  6  6   k"6  j! Aj!A!\x07\x7F@@@ \0(< A A\fj\v\x9E@ !\f\v@  (\f"F\r A\0H@ !\f\v A\bA\0  ("\bK" \x1Bj"  \bA\0 \x1Bk"\b (\0j6\0 A\fA \x1Bj" (\0 \bk6\0  k! \0(< " \x07 k"\x07 A\fj\v\x9EE\r\0\v\v A\x7FG\r\v \0 \0(,"6 \0 6 \0  \0(0j6 \f\v \0A\x006 \0B\x007 \0 \0(\0A r6\0A\0 \x07AF\r\0  (k\v A j$\0\v\x89\x7F#\0Ak"\0$\0@ \0A\fj \0A\bj\r\0A\xEC\xDB \0(\fAtAj/"6\0 E\r\0 \0(\b/"@A\xEC\xDB(\0" \0(\fAtjA\x006\0  E\r\vA\xEC\xDBA\x006\0\v \0Aj$\0A\x84\xCEA\x006\0A\x80\xCEA6\0\x95A\x84\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\x80\xCE6\0A\xA4\xCEA.6\0A\xA8\xCEA\x006\0\xCCA\xA8\xCEA\xA0\xCE(\x006\0A\xA0\xCEA\xA4\xCE6\0A\xCC\xCFA\xD4\xCE6\0A\xA4\xCFA\x80\x806\0A\xA0\xCFA\xC0\xEC6\0A\x84\xCFA*6\0A\xA8\xCFA\xB0\xCB(\x006\0\v\v\xBF\xBE(\0A\x80\b\v\x940123456789abcdefghijklmnopqrstuvwxyz\0load_spz\0infinity\0February\0January\0July\0Thursday\0Tuesday\0Wednesday\0Saturday\0Sunday\0Monday\0Friday\0May\0%m/%d/%y\0-+ 0X0x\0-0X+0X 0X-0x+0x 0x\0Nov\0Thu\0August\0unsigned short\0unsigned int\0invalid literal/lengths set\0invalid code lengths set\0unknown header flags set\0invalid distances set\0get\0Oct\0float\0invalid bit length repeat\0Sat\0numPoints\0colors\0UnpackOptions\0positions\0rotations\0too many length or distance symbols\0invalid stored block lengths\0scales\0alphas\0[SPZ: ERROR] Check failed: %s:%d: %s\0vf32_ptr\0Apr\0vector\0money_get error\0[SPZ ERROR] deserializePackedGaussians: read error\0October\0November\0September\0December\0unsigned char\0Mar\0/emsdk/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp\0Sep\0%I:%M:%S %p\0Sun\0Jun\0Mon\0nan\0Jan\0coordinateSystem\0CoordinateSystem\0Jul\0bool\0April\0invalid code -- missing end-of-block\0incorrect header check\0incorrect length check\0incorrect data check\0push_back\0invalid distance too far back\0Fri\0sh\0header crc mismatch\0March\0Aug\0unsigned long long\0unsigned long\0std::wstring\0basic_string\0std::string\0std::u16string\0std::u32string\0inf\x000123456789abcdef\0%.0Lf\0%Lf\0resize\0invalid window size\0true\0Tue\0false\0invalid block type\0June\0double\0shDegree\0bad_array_new_length was thrown in -fno-exceptions mode\0invalid literal/length code\0invalid distance code\0RawGaussianCloud\0unknown compression method\0[SPZ ERROR] deserializePackedGaussians: header not found\0%0*lld\0%*lld\0+%lld\0%+.4ld\0void\0locale not supported\0antialiased\0Wed\0%Y-%m-%d\0[SPZ ERROR] deserializePackedGaussians: Too many points: %d\0[SPZ ERROR] deserializePackedGaussians: Unsupported SH degree: %d\0[SPZ ERROR] deserializePackedGaussians: version not supported: %d\0Dec\0./spz/src/cc/load-spz.cc\0Feb\0%a %b %d %H:%M:%S %Y\0POSIX\0VectorUInt8T\0%H:%M:%S\0NAN\0PM\0AM\0%H:%M\0LC_ALL\0ASCII\0LANG\0RUF\0LUF\0INF\0RDF\0LDF\0UNSPECIFIED\0C\0RUB\0LUB\0RDB\0LDB\0catching a class without an object?\0emscripten::memory_view<short>\0emscripten::memory_view<unsigned short>\0emscripten::memory_view<int>\0emscripten::memory_view<unsigned int>\0emscripten::memory_view<float>\0emscripten::memory_view<uint8_t>\0emscripten::memory_view<int8_t>\0emscripten::memory_view<uint16_t>\0emscripten::memory_view<int16_t>\0emscripten::memory_view<uint64_t>\0emscripten::memory_view<int64_t>\0emscripten::memory_view<uint32_t>\0emscripten::memory_view<int32_t>\0emscripten::memory_view<char>\0emscripten::memory_view<unsigned char>\0emscripten::memory_view<signed char>\0emscripten::memory_view<long>\0emscripten::memory_view<unsigned long>\0emscripten::memory_view<double>\x000123456789\0C.UTF-8\x0001234567\0VectorFloat32\x0001\x001.3.1\0.\0-\0(packed.alphas.size()) == (numPoints)\0(null)\0(packed.colors.size()) == (numPoints * 3)\0(packed.scales.size()) == (numPoints * 3)\0(packed.sh.size()) == (numPoints * shDim * 3)\0(packed.rotations.size()) == (numPoints * (packed.usesQuaternionSmallestThree ? 4 : 3))\0(packed.positions.size()) == (numPoints * 3 * (usesFloat16 ? 2 : 3))\0%\0length_error was thrown in -fno-exceptions mode with message "%s"\0[SPZ: ERROR] Unsupported SH degree: %d +\0 \0\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0\0\x80?\0A\xA0 \v\xB60\0\0\xF0c\0\0\xF0c\0\0P\0\0\xA4d\0\x008\0\0N3spz13GaussianCloudE\0\0\0\xA4d\0\0X\0\0N3spz13UnpackOptionsE\0ppiip\0\xF0c\0\0|\0\0\xA4d\0\0\x84\0\0NSt3__26vectorIfNS_9allocatorIfEEEE\0ipp\0(e\0\0\xD4\0\0\0\0\0\0\0\0\0\xEC\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIfEE\0\0\0\0\xCCd\0\0\xF8\0\0(\0\0NSt3__227__optional_move_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\x004\0\0d\0\0NSt3__227__optional_copy_assign_baseIfLb1EEE\0\0\0\0\xCCd\0\0p\0\0\x98\0\0NSt3__220__optional_move_baseIfLb1EEE\0\0\0\xCCd\0\0\xA4\0\0\xCC\0\0NSt3__220__optional_copy_baseIfLb1EEE\0\0\0\xCCd\0\0\xD8\0\0\0\0NSt3__223__optional_storage_baseIfLb0EEE\0\0\0\0\xA4d\0\0\f\0\0NSt3__224__optional_destruct_baseIfLb1EEE\0\0\0\xA4d\0\0@\0\0NSt3__218__sfinae_ctor_baseILb1ELb1EEE\0\0\xA4d\0\0p\0\0NSt3__220__sfinae_assign_baseILb1ELb1EEE\0\0\0\0\x84e\0\0\xAC\0\0\0\0\0\0|\0\0PNSt3__26vectorIfNS_9allocatorIfEEEE\0\0\0\0\x84e\0\0\xE4\0\0\0\0\0|\0\0PKNSt3__26vectorIfNS_9allocatorIfEEEE\0pp\0v\0vp\0\0\0\x9C\0\0pp\0\0\x98c\0\0|\0\x008d\0\0vppf\0\0\0\0\x98c\0\0|\0\0\xFCc\0\x008d\0\0vppif\0\0\0\xFCc\0\0|\0\0ipp\0\\\0\x008d\0\0\xA4d\0\0d\0\0N10emscripten3valE\0\0\xAC\0\0|\0\0\xFCc\0\0pppi\0\0\0\0\0\0\0\0\xA8c\0\0|\0\0\xFCc\0\x008d\0\0ippif\0\0\0(e\0\0\xD0\0\0\0\0\0\0\0\0\0\xE8\0\0\0\0\0\x008\0\0\0\0\0\0h\0\0\0\0\0\0NSt3__28optionalIhEE\0\0\0\0\xCCd\0\0\xF4\0\0$\0\0NSt3__227__optional_move_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\x000\0\0\`\0\0NSt3__227__optional_copy_assign_baseIhLb1EEE\0\0\0\0\xCCd\0\0l\0\0\x94\0\0NSt3__220__optional_move_baseIhLb1EEE\0\0\0\xCCd\0\0\xA0\0\0\xC8\0\0NSt3__220__optional_copy_baseIhLb1EEE\0\0\0\xCCd\0\0\xD4\0\0\0\0\0NSt3__223__optional_storage_baseIhLb0EEE\0\0\0\0\xA4d\0\0\b\0\0NSt3__224__optional_destruct_baseIhLb1EEE\0\0\0\xA4d\0\0<\0\0NSt3__26vectorIhNS_9allocatorIhEEEE\0\x84e\0\0p\0\0\0\0\0\x004\0\0PNSt3__26vectorIhNS_9allocatorIhEEEE\0\0\0\0\x84e\0\0\xA8\0\0\0\0\x004\0\0PKNSt3__26vectorIhNS_9allocatorIhEEEE\0pp\0vp\0\`\0\0pp\0\0\x98c\0\x004\0\0\xC0c\0\0vppi\0\0\0\0\x98c\0\x004\0\0\xFCc\0\0\xC0c\0\0vppii\0\0\0\xFCc\0\x004\0\0ipp\0\\\0\0\xC0c\0\0\xA8\0\x004\0\0\xFCc\0\0pppi\0\0\0\0\xA8c\0\x004\0\0\xFCc\0\0\xC0c\0\0ippii\0p\0vp\0ipp\0vppi\0ipp\0vppi\0ppp\0vppp\0\0\0Xd\0\0p\0\0N3spz16CoordinateSystemE\0p\0vp\0ipp\0vppi\0\0\0\0\0\0\0\0\0\b\0\0\0\0\0\0\xA4d\0\0\xB0\0\0NSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\xA4d\0\0\xF8\0\0NSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE\0\0\xA4d\0\0@\0\0NSt3__212basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEE\0\0\0\xA4d\0\0\x8C\0\0NSt3__212basic_stringIDiNS_11char_traitsIDiEENS_9allocatorIDiEEEE\0\0\0\xA4d\0\0\xD8\0\0N10emscripten11memory_viewIcEE\0\0\xA4d\0\0\0\0\0N10emscripten11memory_viewIaEE\0\0\xA4d\0\0(\0\0N10emscripten11memory_viewIhEE\0\0\xA4d\0\0P\0\0N10emscripten11memory_viewIsEE\0\0\xA4d\0\0x\0\0N10emscripten11memory_viewItEE\0\0\xA4d\0\0\xA0\0\0N10emscripten11memory_viewIiEE\0\0\xA4d\0\0\xC8\0\0N10emscripten11memory_viewIjEE\0\0\xA4d\0\0\xF0\0\0N10emscripten11memory_viewIlEE\0\0\xA4d\0\0\0\0N10emscripten11memory_viewImEE\0\0\xA4d\0\0@\0\0N10emscripten11memory_viewIxEE\0\0\xA4d\0\0h\0\0N10emscripten11memory_viewIyEE\0\0\xA4d\0\0\x90\0\0N10emscripten11memory_viewIfEE\0\0\xA4d\0\0\xB8\0\0N10emscripten11memory_viewIdEE\0A\xE43\v\xA1(\x960\x07w,a\xEE\xBAQ \x99\xC4m\x07\x8F\xF4jp5\xA5c\xE9\xA3\x95d\x9E2\x88\xDB\xA4\xB8\xDCy\xE9\xD5\xE0\x88\xD9\xD2\x97+L\xB6 \xBD|\xB1~\x07-\xB8\xE7\x91\xBF\x90d\xB7\xF2 \xB0jHq\xB9\xF3\xDEA\xBE\x84}\xD4\xDA\xEB\xE4\xDDmQ\xB5\xD4\xF4\xC7\x85\xD3\x83V\x98l\xC0\xA8kdz\xF9b\xFD\xEC\xC9e\x8AO\\\xD9lcc=\xFA\xF5\r\b\x8D\xC8 n;^iL\xE4A\`\xD5rqg\xA2\xD1\xE4<G\xD4K\xFD\x85\r\xD2k\xB5 +\xA5\xFA\xA8\xB55l\x98\xB2B\xD6\xC9\xBB\xDB@\xF9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B\0\0\0C\0\0\0\0\0\0\0t<\0\0D\0\0\0E\0\0\x008\0\0\x009\0\0\0F\0\0\0G\0\0\0<\0\0\0=\0\0\0>\0\0\0H\0\0\0@\0\0\0I\0\0\0B\0\0\0J\0\0\0\xCCd\0\0,;\0\0>\0\0NSt3__29basic_iosIcNS_11char_traitsIcEEEE\0\0\0\xA4d\0\0\`;\0\0NSt3__215basic_streambufIcNS_11char_traitsIcEEEE\0\0\0\0(e\0\0\xAC;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_istreamIcNS_11char_traitsIcEEEE\0\0(e\0\0\xF4;\0\0\0\0\0\0\0\0\0 ;\0\0\xF4\xFF\xFFNSt3__213basic_ostreamIcNS_11char_traitsIcEEEE\0\0(e\0\0D<\0\0\0\0\0\0\0\0\x94;\0\0\0\0\0\xDC;\0\0\b\0\0NSt3__214basic_iostreamIcNS_11char_traitsIcEEEE\0\xCCd\0\0\x80<\0\0X;\0\0NSt3__215basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0@\0\0\0\0\0\0\0\xB4=\0\0K\0\0\0L\0\0\x008\0\0\0\xF8\xFF\xFF\xFF\xB4=\0\0M\0\0\0N\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\xB4=\0\0O\0\0\0P\0\0\0\xD0<\0\x004=\0\0p=\0\0\x84=\0\0\x98=\0\0\xAC=\0\0\\=\0\0H=\0\0\xF8<\0\0\xE4<\0\0@\0\0\0\0\0\0\0$<\0\0Q\0\0\0R\0\0\x008\0\0\0\xF8\xFF\xFF\xFF$<\0\0S\0\0\0T\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF$<\0\0U\0\0\0V\0\0\0@\0\0\0\0\0\0\0\x94;\0\0W\0\0\0X\0\0\0\xC0\xFF\xFF\xFF\xC0\xFF\xFF\xFF\x94;\0\0Y\0\0\0Z\0\0\x008\0\0\0\0\0\0\0\xDC;\0\0[\0\0\0\\\0\0\0\xC8\xFF\xFF\xFF\xC8\xFF\xFF\xFF\xDC;\0\0]\0\0\0^\0\0\0\xCCd\0\0\xC0=\0\0$<\0\0NSt3__218basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE\0\0\0\0\0\0\0\0>\0\0_\0\0\0\`\0\0\0\xA4d\0\0 >\0\0NSt3__28ios_baseE\0A\xC0\xFC\0\v#\xDE\x95\0\0\0\0\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF@>\0\0\0\0\0C.UTF-8\0A\x90\xFD\0\vT>\0A\xB0\xFD\0\vGLC_CTYPE\0\0\0\0LC_NUMERIC\0\0LC_TIME\0\0\0\0\0LC_COLLATE\0\0LC_MONETARY\0LC_MESSAGES\0A\x84\xFE\0\v-\x80\xDE(\0\x80\xC8M\0\0\xA7v\0\x004\x9E\0\x80\xC7\0\x80\x9F\xEE\0\0~\x80\\@\x80\xE9g\0\xC8\x90\0U\xB8.\0A\xC0\xFE\0\v\xD2Sun\0Mon\0Tue\0Wed\0Thu\0Fri\0Sat\0Sunday\0Monday\0Tuesday\0Wednesday\0Thursday\0Friday\0Saturday\0Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec\0January\0February\0March\0April\0May\0June\0July\0August\0September\0October\0November\0December\0AM\0PM\0%a %b %e %T %Y\0%m/%d/%y\0%H:%M:%S\0%I:%M:%S %p\0\0\0%m/%d/%y\x000123456789\0%a %b %e %T %Y\0%H:%M:%S\0\0\0\0\0^[yY]\0^[nN]\0yes\0no\0A\xA0\x81\v\xE1\xD1t\x9E\0W\x9D\xBD*\x80pR\xFF\xFF>' +\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\0\x005\0\0\0q\0\0\0k\xFF\xFF\xFF\xCE\xFB\xFF\xFF\x92\xBF\xFF\xFF\0\0\0\0\0\0\0\0\xFF\xFF\xFF\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cNS_11char_traitsIcEEEEEE\0(e\0\0\x9CP\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIcEE\0\0\0\xA4d\0\0\xBCP\0\0NSt3__214__num_put_baseE\0\0\0\0\0\0\0\0\fQ\0\0\x98\0\0\0\xFA\0\0\0v\0\0\0\xFB\0\0\0\xFC\0\0\0\xFD\0\0\0\xFE\0\0\0\xFF\0\0\0\0\0\0\0\0\0\0(e\0\0,Q\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0pQ\0\0\0\0\0\0NSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0(e\0\0\x88Q\0\0\0\0\0\0\0\0\0\xB4P\0\0\0\0\0\0NSt3__29__num_putIwEE\0\0\0\0\0\0\0\xF4Q\0\0\0\0\0\0v\0\0\0\0\0\0\0\x07\0\0\b\0\0 \0\0 +\0\0\v\0\0\xF8\xFF\xFF\xFF\xF4Q\0\0\f\0\0\r\0\0\0\0\0\0\0\0\0\0\0\0(e\0\0R\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0\x80R\0\0\0\b\0\0NSt3__28time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0lR\0\0NSt3__29time_baseE\0\0\xA4d\0\0\x88R\0\0NSt3__220__time_get_c_storageIcEE\0\0\0\0\0\0\0\0S\0\0\0\0\0\0v\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1B\0\0\xF8\xFF\xFF\xFF\0S\0\0\0\0\0\0\0\0\0\0 \0\0!\0\0"\0\0(e\0\0(S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0dR\0\0\0\0\0pS\0\0\0\b\0\0NSt3__28time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\xA4d\0\0xS\0\0NSt3__220__time_get_c_storageIwEE\0\0\0\0\0\0\0\xB4S\0\0#\0\0$\0\0v\0\0\0%\0\0(e\0\0\xD4S\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\0\xA4d\0\0$T\0\0NSt3__210__time_putE\0\0\0\0\0\0\0\0TT\0\0&\0\0'\0\0v\0\0\0(\0\0(e\0\0tT\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0T\0\0\0\b\0\0NSt3__28time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\0\0\0\0\0\xF4T\0\0\x98\0\0\0)\0\0v\0\0\0*\0\0+\0\0,\0\0-\0\0.\0\0/\0\x000\0\x001\0\x002\0\0(e\0\0U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb0EEE\0\xA4d\0\x008U\0\0NSt3__210money_baseE\0\0\0\0\0\0\0\0\x88U\0\0\x98\0\0\x003\0\0v\0\0\x004\0\x005\0\x006\0\x007\0\x008\0\x009\0\0:\0\0;\0\0<\0\0(e\0\0\xA8U\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIcLb1EEE\0\0\0\0\0\xFCU\0\0\x98\0\0\0=\0\0v\0\0\0>\0\0?\0\0@\0\0A\0\0B\0\0C\0\0D\0\0E\0\0F\0\0(e\0\0V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb0EEE\0\0\0\0\0pV\0\0\x98\0\0\0G\0\0v\0\0\0H\0\0I\0\0J\0\0K\0\0L\0\0M\0\0N\0\0O\0\0P\0\0(e\0\0\x90V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000U\0\0\0\0\0NSt3__210moneypunctIwLb1EEE\0\0\0\0\0\xC8V\0\0\x98\0\0\0Q\0\0v\0\0\0R\0\0S\0\0(e\0\0\xE8V\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\x000W\0\0\0\0\0\0NSt3__29money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\x008W\0\0NSt3__211__money_getIcEE\0\0\0\0\0\0\0\0pW\0\0\x98\0\0\0T\0\0v\0\0\0U\0\0V\0\0(e\0\0\x90W\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xD8W\0\0\0\0\0\0NSt3__29money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\0\xE0W\0\0NSt3__211__money_getIwEE\0\0\0\0\0\0\0\0X\0\0\x98\0\0\0W\0\0v\0\0\0X\0\0Y\0\0(e\0\x008X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\x80X\0\0\0\0\0\0NSt3__29money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE\0\0\0\xA4d\0\0\x88X\0\0NSt3__211__money_putIcEE\0\0\0\0\0\0\0\0\xC0X\0\0\x98\0\0\0Z\0\0v\0\0\0[\0\0\\\0\0(e\0\0\xE0X\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0(Y\0\0\0\0\0\0NSt3__29money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE\0\0\0\xA4d\0\x000Y\0\0NSt3__211__money_putIwEE\0\0\0\0\0\0\0\0lY\0\0\x98\0\0\0]\0\0v\0\0\0^\0\0_\0\0\`\0\0(e\0\0\x8CY\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xA4Y\0\0\0\0\0NSt3__28messagesIcEE\0\0\0\0\xA4d\0\0\xACY\0\0NSt3__213messages_baseE\0\0\0\0\0\xE4Y\0\0\x98\0\0\0a\0\0v\0\0\0b\0\0c\0\0d\0\0(e\0\0Z\0\0\0\0\0\0\0\0\0\x9CI\0\0\0\0\0\xA4Y\0\0\0\0\0NSt3__28messagesIwEE\0\0\0\0S\0\0\0u\0\0\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0O\0\0\0c\0\0\0t\0\0\0o\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0e\0\0\0m\0\0\0b\0\0\0e\0\0\0r\0\0\0\0\0\0\0J\0\0\0a\0\0\0n\0\0\0\0\0\0\0F\0\0\0e\0\0\0b\0\0\0\0\0\0\0M\0\0\0a\0\0\0r\0\0\0\0\0\0\0A\0\0\0p\0\0\0r\0\0\0\0\0\0\0J\0\0\0u\0\0\0n\0\0\0\0\0\0\0J\0\0\0u\0\0\0l\0\0\0\0\0\0\0A\0\0\0u\0\0\0g\0\0\0\0\0\0\0S\0\0\0e\0\0\0p\0\0\0\0\0\0\0O\0\0\0c\0\0\0t\0\0\0\0\0\0\0N\0\0\0o\0\0\0v\0\0\0\0\0\0\0D\0\0\0e\0\0\0c\0\0\0\0\0\0\0A\0\0\0M\0\0\0\0\0\0\0P\0\0\0M\0A\x94\xBB\v\x98 +\0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0 +\0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0\0g\0\0h\0\0i\0\0j\0\0k\0\0\xCCd\0\0pc\0\0b\0\0N10__cxxabiv123__fundamental_type_infoE\0Pc\0\0\xA0c\0\0v\0Dn\0\0\0\0Pc\0\0\xB0c\0\0b\0\0\0Pc\0\0\xBCc\0\0c\0\0\0Pc\0\0\xC8c\0\0h\0\0\0Pc\0\0\xD4c\0\0a\0\0\0Pc\0\0\xE0c\0\0s\0\0\0Pc\0\0\xECc\0\0t\0\0\0Pc\0\0\xF8c\0\0i\0\0\0Pc\0\0d\0\0j\0\0\0Pc\0\0d\0\0l\0\0\0Pc\0\0d\0\0m\0\0\0Pc\0\0(d\0\0x\0\0\0Pc\0\x004d\0\0y\0\0\0Pc\0\0@d\0\0f\0\0\0Pc\0\0Ld\0\0d\0\0\0\0\0\0\0ld\0\0g\0\0l\0\0i\0\0j\0\0m\0\0\xCCd\0\0xd\0\0b\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0\0\0\0\0Hb\0\0g\0\0n\0\0i\0\0j\0\0o\0\0p\0\0q\0\0r\0\0\0\0\0\0\xECd\0\0g\0\0s\0\0i\0\0j\0\0o\0\0t\0\0u\0\0v\0\0\xCCd\0\0\xF8d\0\0Hb\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0He\0\0g\0\0w\0\0i\0\0j\0\0o\0\0x\0\0y\0\0z\0\0\xCCd\0\0Te\0\0Hb\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0\xA8b\0\0g\0\0{\0\0i\0\0j\0\0|\0\0\xA4d\0\0\xA0e\0\0St9type_info\0A\xB1\xCB\v\b \0\0\0\0\0\0\0A\xC4\xCB\v1\0A\xDC\xCB\v2\0\0\x003\0\0\0\xF8g\0\0\0\0A\xF4\xCB\v\0A\x84\xCC\v\xFF\xFF\xFF\xFF +\0A\xC8\xCC\v!\xB8e\0\0@v\0%m/%d/%y\0\0\0\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v +2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ce((await B(ne)).instance))})(),(function(){function ce(){var ne;if(o.calledRun=!0,!m){if(C=!0,b_.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var Te=o.postRun.shift();k.push(Te)}j(k)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)q();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),ce()},1)):ce()})(),C?r=o:r=new Promise((ce,ne)=>{A=ce,b=ne}),r}var lC=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,s=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let a=0;a<r;a++)s[a]=n(s[a]);return s},uWe=e=>1/(1+Math.exp(-e)),fWe=e=>t=>t*e+.5,dWe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:lC(e,t.positions),scales:lC(e,t.scales,Math.exp),rotations:lC(e,t.rotations),alphas:lC(e,t.alphas,uWe),colors:lC(e,t.colors,fWe(i)),sh:lC(e,t.sh)}},hWe=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},Ehe=async(e,t)=>{var n;let i=await lWe(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(o,r.length,{coordinateSystem:s}),c=dWe(i,a,t);return hWe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var mWe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pWe=[0,9,24,45],gWe=14,_We=1.6*1024*1024*1024;function yWe(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(o=Math.max(o,parseInt(a[1],10)))}return{numPoints:r.count,shDegree:o}}function AWe(e,t){let n=gWe+(pWe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var WK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Ct.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=bWe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._spzError)&&qK(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=yWe(this._gltf,this._primitive);if(l(n)){let r=AWe(n.numPoints,n.shDegree);if(r>_We){let o=Math.round(r/1048576);return qK(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=Ehe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=xWe(this,i)}unload(){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}};async function bWe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;qK(e,n)}}function qK(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load SPZ",t)}async function xWe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Ct.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var $2=WK;function UP(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}UP.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=W0.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new UP({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(UP.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}}});UP.BATCH_TABLE_CLASS_NAME="_batchTable";var sp=UP;function J2(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}J2.fromJson=function(e){return new J2({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(J2.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 Z2=J2;function Q2(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=e.valueType??Lt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}Q2.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return Z2.fromJson(r)});return new Q2({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Q2.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 ek=Q2;function tk(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=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=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}tk.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=ek.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]=sp.fromJson({id:i,class:e.classes[i],enums:t}));return new tk({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(tk.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 hu=tk;var YK=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?hu.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=TWe(this),this._promise)}unload(){this._schema=void 0}};async function TWe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=hu.fromJson(n),e._state=Ct.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Ct.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var zb=YK;var cd={};function uC(e){return fh(e.url)}function zP(e){let{byteOffset:t,byteLength:n}=e,i=Nb(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function EWe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function Che(e,t){return`${uC(e)}-buffer-id-${t}`}function fC(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return uC(r)}return Che(n,t)}function XK(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=fC(a,s,n,i),u=zP(o);return`${c}-range-${u}`}function vhe(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=fC(a,s,n,i),u=zP(o);return`${c}-range-${u}`}function She(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return uC(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=fC(u,c,n,i),d=zP(a);return`${f}-range-${d}`}function CWe(e,t){let n=uf.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}cd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${uC(n)}`};cd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${uC(t)}`};cd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Che(t,n)}`};cd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${uC(t)}`};cd.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s],c=Nb(o);l(c)&&(s=c.buffer);let u=fC(a,s,i,r),f=zP(o);return`buffer-view:${u}-range-${f}`};cd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${XK(t,n,i,r)}`};cd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${vhe(t,n,i,r)}`};cd.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${vhe(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${XK(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=fC(y,m,n,i),b=zP(g);return`vertex-buffer:${A}-range-${b}${p}`};cd.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${XK(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=fC(m,g,i,r),A=EWe(f,p);return`index-buffer:${y}-accessor-${A}${u}`};cd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${She(t,n,i,r)}`};cd.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}=e,a=n.index,c=uf.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=She(t,c,i,r),f=CWe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var mu=cd;function VP(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}VP.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};VP.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,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};VP.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};VP.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 nk=VP;function Mn(){}Mn.cacheEntries={};Mn.statistics=new nk;function vWe(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 vWe(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=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=mu.getSchemaCacheKey({schema:t,resource:n}),r=Mn.get(i);return l(r)?r:(r=new zb({schema:t,resource:n,cacheKey:i}),Mn.add(r))};Mn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=mu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Mn.get(r);return l(o)?o:(o=new tC({typedArray:i,cacheKey:r}),Mn.add(o))};Mn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=mu.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return l(i)?i:(i=new tC({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=mu.getGltfCacheKey({gltfResource:t}),s=Mn.get(o);return l(s)?s:(s=new FP({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=mu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Mn.get(o);return l(s)?s:(s=new DP({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Mn.add(s))};Mn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,s=mu.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Mn.get(s);return l(a)?a:(a=new RP({resourceCache:Mn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:s}),Mn.add(a))};Mn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,s=mu.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Mn.get(s);return l(a)?a:(a=new $2({resourceCache:Mn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:s}),Mn.add(a))};Mn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=mu.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Mn.get(y);return l(A)?A:(A=new kP({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Mn.add(A))};Mn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=mu.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:u,loadTypedArray:f}),p=Mn.get(d);return l(p)?p:(p=new NP({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Mn.add(p))};Mn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=mu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Mn.get(o);return l(s)?s:(s=new MP({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Mn.add(s))};Mn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a=!0}=e,c=mu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Mn.get(c);return l(u)?u:(u=new BP({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[kP,NP,RP,BP,MP,DP,tC,zb,FP],t,n=Mn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var Bi=Mn;function Za(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(Za.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}}});Za.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Za.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Za.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Za.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Za.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Za.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Za.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Za.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Ys.OCTREE&&(t=3),e>>t};Za.fromSubtreeJson=async function(e,t,n,i,r){let o=new Za(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=SWe(n);let a=s.json;o._subtreeJson=a;let c;if(or(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let x=a.tileMetadata;c=a.propertyTables[x]}let u=[];if(l(a.contentMetadata)){let x=a.contentMetadata.length;for(let T=0;T<x;T++){let E=a.contentMetadata[T];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new v2({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],or(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=wWe(a.buffers),y=IWe(a.bufferViews,m);PWe(a,y),l(c)&&whe(c,y);for(let x=0;x<u.length;x++){let T=u[x];whe(T,y)}let A=await DWe(o,m,s.binary),b=OWe(y,A);return MWe(o,a,i,b),l(c)&&(NWe(o,i,b),FWe(o)),LWe(o,i,b),BWe(o),o._ready=!0,o};function SWe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Lo(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function wWe(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 IWe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function PWe(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 r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function whe(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=o.values??o.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=o.stringOffsets??o.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function DWe(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=RWe(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function RWe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Bi.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function OWe(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function MWe(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=or(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=KK(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=KK(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=KK(t.childSubtreeAvailability,i,a)}function KK(e,t,n,i){if(l(e.constant))return new CP({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new CP({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function NWe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new vh({class:a,count:r,properties:i.properties,bufferViews:n})}function LWe(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new vh({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function Ihe(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function FWe(e){let t=Ihe(e._tileAvailability);e._tileJumpBuffer=t}function BWe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=Ihe(r);t.push(o)}}Za.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Za.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function kWe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function UWe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}Za.prototype.getTileMetadataView=function(e){let t=kWe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new vP({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Za.prototype.getContentMetadataView=function(e,t){let n=UWe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new vP({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};Za.prototype.isDestroyed=function(){return!1};Za.prototype.destroy=function(){return l(this._bufferLoader)&&Bi.unload(this._bufferLoader),ue(this)};var K_=Za;var jP={};function Phe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function $K(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Dhe(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 JK(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}jP.encode2D=function(e,t){return(Phe(e)|Phe(t)<<1)>>>0};jP.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Dhe(e),t[1]=Dhe(e>>1),t};jP.encode3D=function(e,t,n){return $K(e)|$K(t)<<1|$K(n)<<2};jP.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=JK(e),t[1]=JK(e>>1),t[2]=JK(e>>2),t};var Vb=jP;function fo(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===Ys.OCTREE&&(this.z=e.z)}Object.defineProperties(fo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Ys.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Ys.OCTREE?Vb.encode3D(this.x,this.y,this.z):Vb.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Ys.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});fo.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===Ys.OCTREE){let r=(this.z<<e.level)+e.z;return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};fo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===Ys.OCTREE){let o=Math.floor(this.z/t);return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};fo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Ys.OCTREE){let o=e.z%n;return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};fo.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===Ys.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new fo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};fo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};fo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};fo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===Ys.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};fo.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===Ys.OCTREE?this.z===e.z:!0)};fo.prototype.isImplicitTilesetRoot=function(){return this.level===0};fo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};fo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};fo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Ys.OCTREE&&(e.z=this.z),e};var Rhe=[0,0,0];fo.fromMortonIndex=function(e,t,n,i){let r;return e===Ys.OCTREE?(r=Vb.decode3D(i,Rhe),new fo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Vb.decode2D(i,Rhe),new fo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};fo.fromTileIndex=function(e,t,n){let i,r,o;return e===Ys.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(P.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),fo.fromMortonIndex(e,t,i,o)};var Y0=fo;var QK=js(Qu(),1);var ZK,Ohe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",ik={};ik.defaultAccessToken=Ohe;ik.defaultServer=new De({url:"https://api.cesium.com/"});ik.getDefaultTokenCredit=function(e){if(e===Ohe){if(!l(ZK)){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>`;ZK=new It(t,!0)}return ZK}};var ff=ik;function qc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:zWe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new QK.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(qc.prototype=Object.create(De.prototype),qc.prototype.constructor=qc);qc.fromAssetId=function(e,t){let n=qc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new qc(i,n)})};Object.defineProperties(qc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=qc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});qc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=ff.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};qc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(qc.prototype),De.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};qc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};qc.prototype._makeRequest=function(e){return this._isExternal||new QK.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=e$(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};qc._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??ff.defaultServer,i=t.accessToken??ff.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=e$(r.headers),n.getDerivedResource(r)};function e$(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}qc._addClientHeaders=e$;function zWe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Yo=qc;function VWe(e,t,n){let i=or(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!or(r,"3DTILES_bounding_volume_S2")&&!or(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=jWe(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Ze(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=HWe(t),this.subdivisionScheme=Ys[i.subdivisionScheme],this.branchingFactor=Ys.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function jWe(e){if(or(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 HWe(e){let t=Ze(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 X0=VWe;var Mhe={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"};Object.freeze(Mhe);var wh=Mhe;function ap(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??ee.WGS84,this._tilingScheme=new ir({ellipsoid:this._ellipsoid}),this._subtreeCache=new jb({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}ap.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new ap(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=hu.fromJson(c);return r._tileset0=new X0(n,s,u),r._tileset1=new X0(n,a,u),r};ap.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return ap.fromUrl(n,t)};var GWe=new Array(3);ap.prototype.requestTileGeometry=async function(e,t,n,i){let r=Lhe(n,e),o=r===0?this._tileset0:this._tileset1,s=Fhe(o,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,a),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(r,a),u===void 0){let v=new Uint8Array(E);u=await K_.fromSubtreeJson(d._resource,void 0,v,o,a),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>iC(new Uint8Array(x))),b=GWe;b[0]=p,b[1]=A,b[2]=f?A.then(x=>WWe(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],E=x[1],v=x[2],S=T.getTileMetadataView(s),I=S.getPropertyBySemantic(wh.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(wh.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(wh.TILE_BOUNDING_SPHERE),L=le.unpack(O,0,new le),_=S.getPropertyBySemantic(wh.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),D=d._ellipsoid,N=en.fromRectangle(w,I,R,D,new en),F=d.getLevelMaximumGeometricError(n)*5,V=rk(o,T,s,0,0),B=rk(o,T,s,1,0),j=rk(o,T,s,0,1),k=rk(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new E2({gltf:E,minimumHeight:I,maximumHeight:R,boundingSphere:L,orientedBoundingBox:N,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:v});return Promise.resolve(q)}catch(x){console.log(`Could not load subtree: ${r} ${a.level} ${a.x} ${a.y}: ${x}`),console.log(`Could not load tile: ${r} ${s.level} ${s.x} ${s.y}: ${x}`);return}};ap.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=Lhe(n,e),o=r===0?this._tileset0:this._tileset1,s=Fhe(o,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(r,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let u=a.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function Lhe(e,t){let n=1<<e;return t/n|0}function Fhe(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new Y0({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function WWe(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new zb({schema:n.schema});await i.load();let r=i.schema,o,s;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],s=o.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===o.id);if(!l(a))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=a.properties[s.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Bi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await W_({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function rk(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=t$(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function t$(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new Y0({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}ap.prototype.loadTileDataAvailability=function(e,t,n){};ap.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(ap.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function qWe(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function jb(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new j_({comparator:jb.comparator}),this._provider=e.provider}jb.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};jb.prototype.addSubtree=function(e,t){let n=new qWe(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};jb.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===s)return c.subtree}};jb.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,s=o.subtreeLevels,a=t$(o,0,0,0),c=this.find(r,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-P.PI,m=+P.PI,y=P.lerp(g,m,r/2),A=P.lerp(g,m,(r+1)/2),b=-P.PI*.5,x=+P.PI*.5,T=0,E=0,v=!0;for(;v;){let I=1/(1<<p),R=(A-y)*I,O=y+f*R,L=(x-b)*I,_=b+d*L;T=(t-O)/R,E=(n-_)/L;let C=Nhe(o,u,T,E,s);if(c.childSubtreeIsAvailableAtCoordinates(C)){let w=this.find(r,C);if(w!==void 0)c=w,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else v=!1}let S;for(let I=0;I<s;I++){let R=Nhe(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function Nhe(e,t,n,i,r){let o=1<<r,s=P.clamp(n*o|0,0,o-1),a=P.clamp(i*o|0,0,o-1),c=t$(e,r,s,a);return t.getDescendantCoordinates(c)}jb.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Bhe=ap;function $_(e){e=e??H.EMPTY_OBJECT,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 r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=sk(e.westIndices,r,t),this._southIndices=sk(e.southIndices,o,t),this._eastIndices=sk(e.eastIndices,r,t),this._northIndices=sk(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties($_.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 ok=[];function sk(e,t,n){ok.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)ok[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(ok.sort(t),je.createTypedArray(n,ok)):e}var khe="createVerticesFromQuantizedTerrainMesh",YWe=new $n(khe),XWe=new $n(khe,af.maximumAsynchronousTasks);$_.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?XWe:YWe).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=je.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,S=p._orientedBoundingBox,I=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=Eo.clone(g.encoding);return p._mesh=new Ac(x,b,A,g.indexCountWithoutSkirts,m,T,E,u,v,I,R,S,O,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 KWe=new $n("upsampleQuantizedTerrainMesh",af.maximumAsynchronousTasks);$_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=KWe.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:u,childRectangle:d,ellipsoid:f});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 m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),v=je.createTypedArray(E.length/3,T.indices),S;return l(T.encodedNormals)&&(S=new Uint8Array(T.encodedNormals)),new $_({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:le.clone(T.boundingSphere),orientedBoundingBox:en.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var n$=32767,Uhe=new h;$_.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=n$;let r=P.clamp((n-e.south)/e.height,0,1);return r*=n$,l(this._mesh)?QWe(this,i,r):eqe(this,i,r)};function zhe(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var $We=new U,JWe=new U,ZWe=new U;function QWe(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,$We),g=o.decodeTextureCoordinates(r,f,JWe),m=o.decodeTextureCoordinates(r,d,ZWe);if(zhe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=np.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,Uhe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function eqe(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(zhe(t,n,p,y,g,A,m,b)){let x=np.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,Uhe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return P.lerp(e._minimumHeight,e._maximumHeight,T/n$)}}}}$_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};$_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var dC=$_;function tqe(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 jhe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ee.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=[]}jhe.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 Hhe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!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}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new No({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;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&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new Zm(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],E=b-T.endY-1,v=b-T.startY-1;e.overallAvailability[y].push([T.startX,E,T.endX,v]),g.addAvailableTileRange(y,T.startX,E,T.endX,v)}}}else l(d)&&(f=new Zm(e.tilingScheme,u),g=new Zm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new tqe({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await o$(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function nqe(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return o$(e,n);throw new oe(i)}async function iqe(e,t,n){await Hhe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new Zm(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function o$(e,t){try{let n=await e.layerJsonResource.fetchJson();return iqe(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Hhe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):nqe(e,n,t)}}function Ih(e){e=e??H.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new It(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 i$={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Vhe(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 rqe(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new jc({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function oqe(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let T=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new le(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let S=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let I=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,I),L=R.subarray(I,2*I),_=R.subarray(I*2,3*I);cn.zigZagDeltaDecode(O,L,_),a%y!==0&&(a+=y-a%y);let C=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=je.createTypedArrayFromArrayBuffer(I,t,a,C*m);a+=C*A;let D=0,N=w.length;for(let fe=0;fe<N;++fe){let xe=w[fe];w[fe]=D-xe,xe===0&&++D}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=je.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=je.createTypedArrayFromArrayBuffer(I,t,a,B);a+=B*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=je.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*y;let q=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=je.createTypedArrayFromArrayBuffer(I,t,a,q);a+=q*y;let W,J;for(;a<b.byteLength;){let fe=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,fe===i$.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===i$.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===i$.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let ve=Lo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(ve))for(let Re=0;Re<ve.length;++Re){let Qe=n+Re+1,He=ve[Re],Ye=e._tilingScheme.getNumberOfYTilesAtLevel(Qe);for(let Ke=0;Ke<He.length;++Ke){let Pe=He[Ke],qe=Ye-Pe.endY-1,st=Ye-Pe.startY-1;e.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st),o.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=xe}let Z=e.getLevelMaximumGeometricError(n)*5,ae=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=en.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new dC({center:x,minimumHeight:T,maximumHeight:E,boundingSphere:v,orientedBoundingBox:Ae,horizonOcclusionPoint:S,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}Ih.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=s$(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):Ghe(this,e,t,n,o,i)};function Ghe(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let s=r.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&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Vhe(void 0)):u=Vhe(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?rqe(e,m,i,t,n):oqe(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(Ih.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}}});Ih.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Ih.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return Ih.fromUrl(n,t)};Ih.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new jhe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await o$(i);let r=new Ih(t);return i.build(r),r};Ih.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,r=i.length;for(let o=0;o<r;++o)if(s$(this,e,t,n,i[o],o===0).result)return;return!1};Ih.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,r=i.length;for(let o=0;o<r;++o){let s=s$(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function r$(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function s$(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=r$(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});d=Ghe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=r$(r,f.x,f.y,f.level)}return{result:!1}}Ih._getAvailabilityTile=r$;var hC=Ih;var c$={},ak=new h,Whe=new h,qhe=new Le,Yhe=new $;function mC(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),ak),h.multiplyByScalar(n,Math.sin(f),Whe),h.add(ak,Whe,ak);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(ak,m,qhe),$.fromQuaternion(qhe,Yhe),$.multiplyByVector(Yhe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var Xhe=new h,Khe=new h,a$=new h,sqe=new h;c$.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,Xhe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,Khe),y=i.geodeticSurfaceNormal(g,sqe),A=h.multiplyByScalar(y,r,a$);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var aqe=new h,cqe=new h,lqe=new h;c$.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,aqe),g=h.cross(h.UNIT_Z,s,cqe);g=h.normalize(g,g);let m=h.cross(p,g,lqe),y=1+Math.ceil(P.PI_OVER_TWO/a),A=P.PI_OVER_TWO/(y-1),b=P.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,E=0,v=Xhe,S=Khe,I=y*4*3,R=I-1,O=0,L=n?new Array(I):void 0,_,C,w,D,N;for(b=P.PI_OVER_TWO,v=mC(b,o,m,g,c,f,u,d,p,v),t&&(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),b=P.PI_OVER_TWO-A,_=1;_<y+1;++_){if(v=mC(b,o,m,g,c,f,u,d,p,v),S=mC(Math.PI-b,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*_+2,C=1;C<w-1;++C)D=C/(w-1),N=h.lerp(v,S,D,a$),T[E++]=N.x,T[E++]=N.y,T[E++]=N.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z),b=P.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=P.PI_OVER_TWO-(_-1)*A,v=mC(-b,o,m,g,c,f,u,d,p,v),S=mC(b+Math.PI,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*(_-1)+2,C=1;C<w-1;++C)D=C/(w-1),N=h.lerp(v,S,D,a$),T[E++]=N.x,T[E++]=N.y,T[E++]=N.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z)}b=P.PI_OVER_TWO,v=mC(-b,o,m,g,c,f,u,d,p,v);let F={};return t&&(T[E++]=v.x,T[E++]=v.y,T[E]=v.z,F.positions=T,F.numPts=y),n&&(L[R--]=v.z,L[R--]=v.y,L[R]=v.x,F.outerPositions=L),F};var df=c$;function uqe(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Bt=uqe;var pC=new h,l$=new h,u$=new h,$he=new h,ua=new U,Jhe=new $,fqe=new $,f$=new Le,Zhe=new h,Qhe=new h,eme=new h,uk=new he,tme=new h,nme=new U,ime=new U;function rme(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=Zhe,x=Qhe,T=eme,E=new ji(a),v=E.project(a.cartesianToCartographic(r,uk),tme),S=a.scaleToGeodeticSurface(r,pC);a.geodeticSurfaceNormal(S,S);let I=Jhe,R=fqe;if(c!==0){let N=Le.fromAxisAngle(S,c,f$);I=$.fromQuaternion(N,I),N=Le.fromAxisAngle(S,-c,f$),R=$.fromQuaternion(N,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,nme),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,ime),_=e.length,C=n?_:0,w=C/3*2;for(let N=0;N<_;N+=3){let F=N+1,V=N+2,B=h.fromArray(e,N,pC);if(i.st){let j=$.multiplyByVector(I,B,l$),k=E.project(a.cartesianToCartographic(j,uk),u$);h.subtract(k,v,k),ua.x=(k.x+o)/(2*o),ua.y=(k.y+s)/(2*s),O.x=Math.min(ua.x,O.x),O.y=Math.min(ua.y,O.y),L.x=Math.max(ua.x,L.x),L.y=Math.max(ua.y,L.y),n&&(d[A+w]=ua.x,d[A+1+w]=ua.y),d[A++]=ua.x,d[A++]=ua.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(B,b),f&&(y[N+C]=-b.x,y[F+C]=-b.y,y[V+C]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[N]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[N+C]=-b.x,p[F+C]=-b.y,p[V+C]=-b.z)),i.tangent&&(g[N]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[N+C]=-x.x,g[F+C]=-x.y,g[V+C]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[N]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[N+C]=T.x,m[F+C]=T.y,m[V+C]=T.z))))}if(i.st){_=d.length;for(let N=0;N<_;N+=2)d[N]=(d[N]-O.x)/(L.x-O.x),d[N+1]=(d[N+1]-O.y)/(L.y-O.y)}let D=new En;if(i.position){let N=df.raisePositionsToHeight(e,t,n);D.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(D.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(D.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(D.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(D.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(D.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===pn.TOP)N=N.fill(1,0,u/2);else{let F=t.offsetAttribute===pn.NONE?0:1;N=N.fill(F)}D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return D}function ome(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var Hb=new h;function dqe(e){let t=e.center;Hb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Hb),e.height,Hb),Hb=h.add(t,Hb,Hb);let n=new le(Hb,e.semiMajorAxis),i=df.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=rme(r,e,!1),a=ome(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function hqe(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=Zhe,E=Qhe,v=eme,S=new ji(s),I=S.project(s.cartesianToCartographic(i,uk),tme),R=s.scaleToGeodeticSurface(i,pC);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,f$),L=$.fromQuaternion(O,Jhe),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,nme),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,ime),w=e.length,D=w/3*2;for(let F=0;F<w;F+=3){let V=F+1,B=F+2,j=h.fromArray(e,F,pC),k;if(n.st){let q=$.multiplyByVector(L,j,l$),Q=S.project(s.cartesianToCartographic(q,uk),u$);h.subtract(Q,I,Q),ua.x=(Q.x+r)/(2*r),ua.y=(Q.y+o)/(2*o),_.x=Math.min(ua.x,_.x),_.y=Math.min(ua.y,_.y),C.x=Math.max(ua.x,C.x),C.y=Math.max(ua.y,C.y),p[x+D]=ua.x,p[x+1+D]=ua.y,p[x++]=ua.x,p[x++]=ua.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,l$),T=s.geodeticSurfaceNormal(j,T),A&&(b[F+w]=-T.x,b[V+w]=-T.y,b[B+w]=-T.z);let G=h.multiplyByScalar(T,a,$he);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),k=h.add(k,G,k),n.position&&(d[F+w]=k.x,d[V+w]=k.y,d[B+w]=k.z,d[F]=j.x,d[V]=j.y,d[B]=j.z),n.normal||n.tangent||n.bitangent){v=h.clone(T,v);let q=h.fromArray(e,(F+3)%w,$he);h.subtract(q,j,q);let Q=h.subtract(k,j,u$);T=h.normalize(h.cross(Q,q,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[B]=T.z,g[F+w]=T.x,g[V+w]=T.y,g[B+w]=T.z),n.tangent&&(E=h.normalize(h.cross(v,T,E),E),m[F]=E.x,m[V]=E.y,m[B]=E.z,m[F+w]=E.x,m[F+1+w]=E.y,m[F+2+w]=E.z),n.bitangent&&(y[F]=v.x,y[V]=v.y,y[B]=v.z,y[F+w]=v.x,y[V+w]=v.y,y[B+w]=v.z)}}if(n.st){w=p.length;for(let F=0;F<w;F+=2)p[F]=(p[F]-_.x)/(C.x-_.x),p[F+1]=(p[F+1]-_.y)/(C.y-_.y)}let N=new En;if(n.position&&(N.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(N.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(N.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(N.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===pn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===pn.NONE?0:1;F=F.fill(V)}N.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return N}function mqe(e){let t=e.length/3,n=je.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var ck=new le,lk=new le;function pqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,pC),e.height,pC);ck.center=h.add(t,r,ck.center),ck.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),lk.center=h.add(t,r,lk.center),lk.radius=i;let o=df.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=le.union(ck,lk),f=rme(s,e,!0),d=ome(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=je.createTypedArray(g*2/3,d),y=new wt({attributes:f,indices:m,primitiveType:Oe.TRIANGLES}),A=hqe(c,e);d=mqe(c);let b=je.createTypedArray(c.length*2/3,d),x=new wt({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Wn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function sme(e,t,n,i,r,o,s){let c=df.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function lp(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.vertexFormat??Be.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Be.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}lp.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;lp.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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]=e._offsetAttribute??-1,t};var ame=new h,cme=new ee,lme=new Be,cp={center:ame,ellipsoid:cme,vertexFormat:lme,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};lp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,ame);t+=h.packedLength;let r=ee.unpack(e,t,cme);t+=ee.packedLength;let o=Be.unpack(e,t,lme);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(cp.height=f,cp.extrudedHeight=p,cp.granularity=d,cp.stRotation=u,cp.rotation=c,cp.semiMajorAxis=s,cp.semiMinorAxis=a,cp.shadowVolume=g,cp.offsetAttribute=m===-1?void 0:m,new lp(cp))};lp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ee.default,r=e.semiMajorAxis,o=e.semiMinorAxis,s=e.granularity??P.RADIANS_PER_DEGREE,a=e.rotation??0;return sme(n,r,o,a,s,i,t)};lp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={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},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=pqe(r);else if(o=dqe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===pn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new wt({attributes:o.attributes,indices:o.indices,primitiveType:Oe.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};lp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new lp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function gqe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=df.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return wt._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(lp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=sme(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=gqe(this)),this._textureCoordinateRotationPoints}}});var pu=lp;function K0(e){e=e??H.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 pu(n),this._workerName="createCircleGeometry"}K0.packedLength=pu.packedLength;K0.pack=function(e,t,n){return pu.pack(e._ellipseGeometry,t,n)};var ume=new pu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),bc={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};K0.unpack=function(e,t,n){let i=pu.unpack(e,t,ume);return bc.center=h.clone(i._center,bc.center),bc.ellipsoid=ee.clone(i._ellipsoid,bc.ellipsoid),bc.ellipsoid=ee.clone(i._ellipsoid,ume._ellipsoid),bc.height=i._height,bc.extrudedHeight=i._extrudedHeight,bc.granularity=i._granularity,bc.vertexFormat=Be.clone(i._vertexFormat,bc.vertexFormat),bc.stRotation=i._stRotation,bc.shadowVolume=i._shadowVolume,l(n)?(bc.semiMajorAxis=i._semiMajorAxis,bc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new pu(bc),n):(bc.radius=i._semiMajorAxis,new K0(bc))};K0.createGeometry=function(e){return pu.createGeometry(e._ellipseGeometry)};K0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new K0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(K0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var fme=K0;var dme=new h,Gb=new h;function _qe(e){let t=e.center;Gb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Gb),e.height,Gb),Gb=h.add(t,Gb,Gb);let n=new le(Gb,e.semiMajorAxis),i=df.computeEllipsePositions(e,!1,!0).outerPositions,r=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:df.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=je.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var fk=new le,dk=new le;function yqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,dme),e.height,dme);fk.center=h.add(t,r,fk.center),fk.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),dk.center=h.add(t,r,dk.center),dk.radius=i;let o=df.computeEllipsePositions(e,!1,!0).outerPositions,s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:df.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=le.union(fk,dk),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===pn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===pn.NONE?0:1;m=m.fill(y)}s.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=P.clamp(u,0,c/2);let f=je.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function gC(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}gC.packedLength=h.packedLength+ee.packedLength+8;gC.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.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]=e._offsetAttribute??-1,t};var hme=new h,mme=new ee,$0={center:hme,ellipsoid:mme,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=t??0;let i=h.unpack(e,t,hme);t+=h.packedLength;let r=ee.unpack(e,t,mme);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):($0.height=c,$0.extrudedHeight=f,$0.granularity=u,$0.rotation=a,$0.semiMajorAxis=o,$0.semiMinorAxis=s,$0.numberOfVerticalLines=d,$0.offsetAttribute=p===-1?void 0:p,new gC($0))};gC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=yqe(r);else if(o=_qe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===pn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new wt({attributes:o.attributes,indices:o.indices,primitiveType:Oe.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var ld=gC;function _C(e){e=e??H.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 ld(n),this._workerName="createCircleOutlineGeometry"}_C.packedLength=ld.packedLength;_C.pack=function(e,t,n){return ld.pack(e._ellipseGeometry,t,n)};var Aqe=new ld({center:new h,semiMajorAxis:1,semiMinorAxis:1}),hf={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};_C.unpack=function(e,t,n){let i=ld.unpack(e,t,Aqe);return hf.center=h.clone(i._center,hf.center),hf.ellipsoid=ee.clone(i._ellipsoid,hf.ellipsoid),hf.height=i._height,hf.extrudedHeight=i._extrudedHeight,hf.granularity=i._granularity,hf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(hf.semiMajorAxis=i._semiMajorAxis,hf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ld(hf),n):(hf.radius=i._semiMajorAxis,new _C(hf))};_C.createGeometry=function(e){return ld.createGeometry(e._ellipseGeometry)};var pme=_C;var gme={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(gme);var Ps=gme;var _me={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(_me);var jr=_me;var d$;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?d$=function(){return performance.now()}:d$=function(){return Date.now()};var xn=d$;function h$(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??Ps.UNBOUNDED,this.canAnimate=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=xn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??jr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(h$.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===jr.SYSTEM_CLOCK&&(this._clockStep=jr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===jr.SYSTEM_CLOCK&&(this._clockStep=jr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===jr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===jr.SYSTEM_CLOCK&&(this._clockStep=jr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});h$.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===jr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===jr.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=K.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===Ps.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,s)&&(t=K.clone(s,t),this.onStop.raiseEvent(this));else if(r===Ps.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,s);)t=K.addSeconds(o,K.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var up=h$;function yC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(yC.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});yC.fromColor=function(e){return new yC(e.red,e.green,e.blue,e.alpha)};yC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};yC.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 Jt=yC;function AC(e){this._value=e,this._valueType=Rr.getPointType(e)}Object.defineProperties(AC.prototype,{value:{get:function(){return this._value}}});AC.prototype.findTimeInterval=function(e){};AC.prototype.wrapTime=function(e){return 0};AC.prototype.clampTime=function(e){return 0};AC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var hk=AC;var HP={},bqe=new h,yme=new h,Ame=new h,bme=new h,xme=new en;HP.validOutline=function(e){let n=en.fromPoints(e,xme).halfAxes,i=$.getColumn(n,0,yme),r=$.getColumn(n,1,Ame),o=$.getColumn(n,2,bme),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};HP.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,xme),o=r.halfAxes,s=$.getColumn(o,0,yme),a=$.getColumn(o,1,Ame),c=$.getColumn(o,2,bme),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function Tme(e,t,n,i,r){let o=h.subtract(e,t,bqe),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}HP.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Tme(i[o],e,t,n);return r}};HP.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Tme(i,e,t,n,r)}};var J_=HP;function p$(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/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)*m+1001*c/8388608*y)}function xqe(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),S=Math.sin(10*i),I=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*E+(8011*p/2621440+8011*g/1048576)*S+293393*g/251658240*R}function bC(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function Tqe(e,t,n,i,r){let o=bC(e._ellipticity,n),s=bC(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function Eqe(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(r)*P.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=p$(e._ellipticity,t,r);u=(p$(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var Cqe=new h,m$=new h;function Eme(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,m$),Cqe),o=h.normalize(i.cartographicToCartesian(n,m$),m$),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/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=Tqe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=Eqe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Cme(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=p$(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=xqe(p,r,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=bC(r,e.latitude),m=bC(r,c);u=Math.tan(t)*(m-g),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function J0(e,t,n){let i=n??ee.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)&&Eme(this,e,t,i)}Object.defineProperties(J0.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}}});J0.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??ee.default,s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=Cme(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new J0(e,d,o):(r.setEndPoints(e,d),r)};J0.prototype.setEndPoints=function(e,t){Eme(this,e,t,this._ellipsoid)};J0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};J0.prototype.interpolateUsingSurfaceDistance=function(e,t){return Cme(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};J0.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(P.PI_OVER_TWO-r)<=P.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-r),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,o.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};J0.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let o=bC(n,r.latitude),s=bC(n,e),a=Math.tan(i)*(s-o),c=P.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Yc=J0;function vqe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Xc=vqe;function y$(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=Sme(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=Dqe(e,t,o,n)),e.length>80*n){a=e[0],c=e[1];let f=a,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return WP(o,s,n,a,c,u,0),s}function Sme(e,t,n,i,r){let o;if(r===Vqe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=vme(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=vme(s/i|0,e[s],e[s+1],o);return o&&xC(o,o.next)&&(YP(o),o=o.next),o}function Wb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(xC(n,n.next)||us(n.prev,n,n.next)===0)){if(YP(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function WP(e,t,n,i,r,o,s){if(!e)return;!s&&o&&Lqe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?wqe(e,i,r,o):Sqe(e)){t.push(c.i,e.i,u.i),YP(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=Iqe(Wb(e),t),WP(e,t,n,i,r,o,2)):s===2&&Pqe(e,t,n,i,r,o):WP(Wb(e),t,n,i,r,o,1);break}}}function Sqe(e){let t=e.prev,n=e,i=e.next;if(us(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(r,o,s),d=Math.min(a,c,u),p=Math.max(r,o,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&GP(r,a,o,c,s,u,m.x,m.y)&&us(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function wqe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(us(r,o,s)>=0)return!1;let a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),A=Math.max(f,d,p),b=g$(g,m,t,n,i),x=g$(y,A,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=b&&E&&E.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&GP(a,f,c,d,u,p,T.x,T.y)&&us(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&GP(a,f,c,d,u,p,E.x,E.y)&&us(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&GP(a,f,c,d,u,p,T.x,T.y)&&us(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&GP(a,f,c,d,u,p,E.x,E.y)&&us(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function Iqe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!xC(i,r)&&Ime(i,n,n.next,r)&&qP(i,r)&&qP(r,i)&&(t.push(i.i,n.i,r.i),YP(n),YP(n.next),n=e=r),n=n.next}while(n!==e);return Wb(n)}function Pqe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&kqe(s,a)){let c=Pme(s,a);s=Wb(s,s.next),c=Wb(c,c.next),WP(s,t,n,i,r,o,0),WP(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function Dqe(e,t,n,i){let r=[];for(let o=0,s=t.length;o<s;o++){let a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=Sme(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(Bqe(u))}r.sort(Rqe);for(let o=0;o<r.length;o++)n=Oqe(r[o],n);return n}function Rqe(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),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function Oqe(e,t){let n=Mqe(e,t);if(!n)return t;let i=Pme(n,e);return Wb(i,i.next),Wb(n,n.next)}function Mqe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(xC(e,n))return n;do{if(xC(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&wme(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);qP(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&Nqe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function Nqe(e,t){return us(e.prev,e,t.prev)<0&&us(t.next,e,e.next)<0}function Lqe(e,t,n,i){let r=e;do r.z===0&&(r.z=g$(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,Fqe(r)}function Fqe(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(t>1);return e}function g$(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|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 Bqe(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 wme(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function GP(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&wme(e,t,n,i,r,o,s,a)}function kqe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Uqe(e,t)&&(qP(e,t)&&qP(t,e)&&zqe(e,t)&&(us(e.prev,e,t.prev)||us(e,t.prev,t))||xC(e,t)&&us(e.prev,e,e.next)>0&&us(t.prev,t,t.next)>0)}function us(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function xC(e,t){return e.x===t.x&&e.y===t.y}function Ime(e,t,n,i){let r=pk(us(e,t,n)),o=pk(us(e,t,i)),s=pk(us(n,i,e)),a=pk(us(n,i,t));return!!(r!==o&&s!==a||r===0&&mk(e,n,t)||o===0&&mk(e,i,t)||s===0&&mk(n,e,i)||a===0&&mk(n,t,i))}function mk(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 pk(e){return e>0?1:e<0?-1:0}function Uqe(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&&Ime(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function qP(e,t){return us(e.prev,e,e.next)<0?us(e,t,e.next)>=0&&us(e,e.prev,t)>=0:us(e,t,e.prev)<0||us(e,e.next,t)<0}function zqe(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Pme(e,t){let n=_$(e.i,e.x,e.y),i=_$(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function vme(e,t,n,i){let r=_$(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function YP(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 _$(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Vqe(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}var jqe=new h,Hqe=new h,Z_={};Z_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};Z_.computeWindingOrder2D=function(e){return Z_.computeArea2D(e)>0?sa.COUNTER_CLOCKWISE:sa.CLOCKWISE};Z_.triangulate=function(e,t){let n=U.packArray(e);return y$(n,t,2)};var Mme=new h,Nme=new h,Lme=new h,Dme=new h,Rme=new h,Ome=new h,Z0=new h,Fme=new U,Bme=new U,kme=new U,TC=new U;Z_.computeSubdivision=function(e,t,n,i,r){r=r??P.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},y=e.maximumRadius,A=P.chordLength(r,y),b=A*A;for(;s.length>0;){let T=s.pop(),E=s.pop(),v=s.pop(),S=h.fromArray(u,v*3,Mme),I=h.fromArray(u,E*3,Nme),R=h.fromArray(u,T*3,Lme),O,L,_;o&&(O=U.fromArray(f,v*2,Fme),L=U.fromArray(f,E*2,Bme),_=U.fromArray(f,T*2,kme));let C=h.multiplyByScalar(h.normalize(S,Dme),y,Dme),w=h.multiplyByScalar(h.normalize(I,Rme),y,Rme),D=h.multiplyByScalar(h.normalize(R,Ome),y,Ome),N=h.magnitudeSquared(h.subtract(C,w,Z0)),F=h.magnitudeSquared(h.subtract(w,D,Z0)),V=h.magnitudeSquared(h.subtract(D,C,Z0)),B=Math.max(N,F,V),j,k,G;B>b?N===B?(j=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[j],l(a)||(k=h.add(S,I,Z0),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(O,L,TC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(v,a,T),s.push(a,E,T)):F===B?(j=`${Math.min(E,T)} ${Math.max(E,T)}`,a=m[j],l(a)||(k=h.add(I,R,Z0),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(L,_,TC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(E,a,v),s.push(a,T,v)):V===B&&(j=`${Math.min(T,v)} ${Math.max(T,v)}`,a=m[j],l(a)||(k=h.add(R,S,Z0),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(_,O,TC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(T,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(T))}let x={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(x.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new wt(x)};var Gqe=new he,Wqe=new he,qqe=new he,A$=new he;Z_.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??P.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,A=P.chordLength(r,y),b=new Yc(void 0,void 0,e),x=new Yc(void 0,void 0,e),T=new Yc(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),S=s.pop(),I=s.pop(),R=h.fromArray(u,I*3,Mme),O=h.fromArray(u,S*3,Nme),L=h.fromArray(u,v*3,Lme),_,C,w;o&&(_=U.fromArray(f,I*2,Fme),C=U.fromArray(f,S*2,Bme),w=U.fromArray(f,v*2,kme));let D=e.cartesianToCartographic(R,Gqe),N=e.cartesianToCartographic(O,Wqe),F=e.cartesianToCartographic(L,qqe);b.setEndPoints(D,N);let V=b.surfaceDistance;x.setEndPoints(N,F);let B=x.surfaceDistance;T.setEndPoints(F,D);let j=T.surfaceDistance,k=Math.max(V,B,j),G,q,Q,W,J;k>A?V===k?(G=`${Math.min(I,S)} ${Math.max(I,S)}`,a=m[G],l(a)||(q=b.interpolateUsingFraction(.5,A$),Q=(D.height+N.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Z0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,TC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(I,a,v),s.push(a,S,v)):B===k?(G=`${Math.min(S,v)} ${Math.max(S,v)}`,a=m[G],l(a)||(q=x.interpolateUsingFraction(.5,A$),Q=(N.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Z0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,TC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(S,a,I),s.push(a,v,I)):j===k&&(G=`${Math.min(v,I)} ${Math.max(v,I)}`,a=m[G],l(a)||(q=T.interpolateUsingFraction(.5,A$),Q=(F.height+D.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Z0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,TC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(v,a,S),s.push(a,I,S)):(g.push(I),g.push(S),g.push(v))}let E={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(E.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new wt(E)};Z_.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=jqe,o=Hqe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var di=Z_;function Q_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(Q_.prototype,{length:{get:function(){return this._length}}});Q_.prototype.enqueue=function(e){this._array.push(e),this._length++};Q_.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};Q_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};Q_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};Q_.prototype.clear=function(){this._array.length=this._offset=this._length=0};Q_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var qb=Q_;var Co={};Co.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Co.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};Co.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=Co.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var Yb=new U;function Vme(e,t,n,i){return U.subtract(t,e,Yb),U.multiplyByScalar(Yb,n/i,Yb),U.add(e,Yb,Yb),[Yb.x,Yb.y]}var ey=new h;function Yqe(e,t,n,i){return h.subtract(t,e,ey),h.multiplyByScalar(ey,n/i,ey),h.add(e,ey,ey),[ey.x,ey.y,ey.z]}Co.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(P.log2(r)));return Math.pow(2,o)};var _k=new he,yk=new he,Xqe=new he,Kqe=new h,gk=new Yc;Co.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,_k),o=e.cartesianToCartographic(n,yk),a=new Yc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};Co.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=Co.subdivideLineCount(n,i,r),a=U.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Vme(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Co.subdivideLine=function(e,t,n,i){let r=Co.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=Yqe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Co.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,_k),c=n.cartesianToCartographic(r,yk);gk.setEndPoints(a,c);let u=gk.surfaceDistance/o,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=U.distance(e,t),g=p/d,m=s;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=Vme(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};Co.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,_k),s=e.cartesianToCartographic(n,yk),a=new Yc(o,s,e);if(l(r)||(r=[]),a.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,Xqe),A=e.cartographicToCartesian(y,Kqe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var $qe=new h,Jqe=new h,Zqe=new h,Qqe=new h;Co.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=$qe,s=Jqe,a=Zqe,c=Qqe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};Co.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new qb;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Lr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Lr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};var eYe=new he;function tYe(e,t,n){let i=n.cartesianToCartographic(e,_k),r=n.cartesianToCartographic(t,yk);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;gk.setEndPoints(i,r);let o=gk.findIntersectionWithLatitude(0,eYe);if(!l(o))return;let s=Math.min(i.longitude,r.longitude),a=Math.max(i.longitude,r.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(o.longitude<s||o.longitude>a))return n.cartographicToCartesian(o)}function nYe(e,t,n,i){if(i===ln.RHUMB)return tYe(e,t,n);let r=bi.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var iYe=new he;function rYe(e,t,n){let i=[],r,o,s,a,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],s=P.sign(r.z),a=P.sign(o.z);let f=d=>t.cartesianToCartographic(d,iYe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=nYe(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function jme(e,t,n,i,r,o,s){let a=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&A>0||o===c&&!s&&A<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(s?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&a.length<n.length);e.splice(t,r,a);for(let d of f)t=jme(e,t+1,n,i,0,d,!s);return t}Co.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],s=o.slice();if(o.length<3){i[r]=s,++r;continue}let a=rYe(s,t,n);if(s.length===o.length||a.length<=1){i[r]=s,++r;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;r=jme(i,r,s,a,1,0,c)}return i};Co.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new qb;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Lr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=di.computeWindingOrder2D(y);if(b===sa.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let S=[d];if(S=o(S,S),S.length>1){for(let I of S)c.enqueue(new Xc(I,p));continue}}let x=d.slice(),T=l(p)?p.length:0,E=[],v;for(g=0;g<T;g++){let S=p[g],I=S.positions;if(i)for(m=I.length,v=0;v<m;++v)r.scaleToGeodeticSurface(I[v],I[v]);if(t||(I=Lr(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=di.computeWindingOrder2D(R),b===sa.CLOCKWISE&&(R.reverse(),I=I.slice().reverse()),E.push(I),A.push(x.length),x=x.concat(I),y=y.concat(R);let O=0;for(l(S.holes)&&(O=S.holes.length),v=0;v<O;v++)c.enqueue(S.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:x,positions2D:y,holes:A})}return{hierarchy:s,polygons:a}};var oYe=new U,sYe=new h,aYe=new Le,cYe=new $;Co.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,aYe),s=$.fromQuaternion(o,cYe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],sYe);$.multiplyByVector(s,g,g);let m=t(g,oYe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};Co.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=di.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Oe.TRIANGLES};u&&(m.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let y=new wt(m);return o.normal?Wn.computeNormal(y):y}if(s===ln.GEODESIC)return di.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return di.computeRhumbLineSubdivision(e,c,a,f,i)};var Ume=[],zme=[],lYe=new h,uYe=new h;Co.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(a=y*3*2,s=new Array(a*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[A]=s[A+a]=u.x,++A,s[A]=s[A+a]=u.y,++A,s[A]=s[A+a]=u.z,++A,s[A]=s[A+a]=f.x,++A,s[A]=s[A+a]=f.y,++A,s[A]=s[A+a]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=P.chordLength(i,n.maximumRadius),O=0;if(o===ln.GEODESIC)for(c=0;c<y;c++)O+=Co.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=Co.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(a=(O+y)*3,s=new Array(a*2),x&&(m=(O+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,_;x&&(d=T[c],p=T[(c+1)%y]),o===ln.GEODESIC?(L=Co.subdivideLine(u,f,R,zme),x&&(_=Co.subdivideTexcoordLine(d,p,u,f,R,Ume))):o===ln.RHUMB&&(L=Co.subdivideRhumbLine(n,u,f,R,zme),x&&(_=Co.subdivideTexcoordRhumbLine(d,p,n,u,f,R,Ume)));let C=L.length;for(let w=0;w<C;++w,++A)s[A]=L[w],s[A+a]=L[w];if(s[A]=f.x,s[A+a]=f.x,++A,s[A]=f.y,s[A+a]=f.y,++A,s[A]=f.z,s[A+a]=f.z,++A,x){let w=_.length;for(let D=0;D<w;++D,++b)g[b]=_[D],g[b+m]=_[D];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=s.length;let E=je.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,c=0;c<y;c++){let R=c,O=R+1,L=R+y,_=L+1;u=h.fromArray(s,R*3,lYe),f=h.fromArray(s,O*3,uYe),!h.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(E[v++]=R,E[v++]=L,E[v++]=O,E[v++]=O,E[v++]=L,E[v++]=_)}let S={attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Oe.TRIANGLES};return x&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new wt(S)};var Qn=Co;var fYe=new h,dYe=new et,hYe=new U,mYe=new U,pYe=new h,gYe=new h,_Ye=new h,XP=new h,yYe=new h,AYe=new h,Hme=new Le,bYe=new $,xYe=new $,TYe=new h;function EYe(e,t,n,i,r,o,s,a,c){let u=e.positions,f=di.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=je.createTypedArray(u.length,f.length);d.set(f);let p=bYe;if(i!==0){let _=Le.fromAxisAngle(s,i,Hme);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,Hme);let C=$.fromQuaternion(_,xYe);a=h.normalize($.multiplyByVector(C,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=mYe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,S=0,I=0,R=0,O=0;for(let _=0;_<m;_++){let C=u[_];if(A[v++]=C.x,A[v++]=C.y,A[v++]=C.z,t.st)if(l(r)&&r.positions.length===m)E[O++]=r.positions[_].x,E[O++]=r.positions[_].y;else{let w=$.multiplyByVector(p,C,fYe),D=o(w,hYe);U.subtract(D,g,D);let N=P.clamp(D.x/n.width,0,1),F=P.clamp(D.y/n.height,0,1);E[O++]=N,E[O++]=F}t.normal&&(b[S++]=s.x,b[S++]=s.y,b[S++]=s.z),t.tangent&&(x[R++]=a.x,x[R++]=a.y,x[R++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new En;return t.position&&(L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(L.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(L.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new wt({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function Xb(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Qn.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?Qn.computeHierarchyPackedLength(n,U):1)+2}Xb.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Xb(t)};Xb.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Qn.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var CYe=ee.clone(ee.UNIT_SPHERE),vYe=new Be,SYe={polygonHierarchy:{}};Xb.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,CYe);t+=ee.packedLength;let o=Be.unpack(e,t,vYe);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:Qn.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new Xb(SYe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};Xb.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Lr(s,h.equalsEpsilon,!0),s.length<3)return;let a=pYe,c=gYe,u=_Ye,f=yYe,d=AYe;if(!J_.computeProjectTo2DArguments(s,XP,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(XP,h.ZERO,P.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(XP,TYe);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=J_.createProjectPointsTo2DFunction(XP,f,d),m=J_.createProjectPointTo2DFunction(XP,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=Qn.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?Qn.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=le.fromPoints(s),v=Qn.computeBoundingRectangle(a,m,s,i,dYe),S=[];for(let O=0;O<b.length;O++){let L=new Bt({geometry:EYe(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Wn.combineInstances(S)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=je.createTypedArray(I.attributes.position.values.length/3,I.indices);let R=I.attributes;return t.position||delete R.position,new wt({attributes:R,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:E})};var Ak=Xb;function wYe(e){let t=e.length,n=new Float64Array(t*3),i=je.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new wt({attributes:s,indices:i,primitiveType:Oe.LINES})}function Kb(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Qn.computeHierarchyPackedLength(t,h)+1}Kb.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new Kb(t)};Kb.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var IYe={polygonHierarchy:{}};Kb.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new Kb(IYe)),n._polygonHierarchy=i,n.packedLength=r,n};Kb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Lr(n,h.equalsEpsilon,!0),n.length<3||!J_.validOutline(n))return;let r=Qn.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:wYe(r[c])});o.push(u)}let s=Wn.combineInstances(o)[0],a=le.fromPoints(t.positions);return new wt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Ph=Kb;var Gme={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(Gme);var ar=Gme;function PYe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,E=1-y+15*A/8-35*b/8,v=1-3*y+35*A/4,S=1-5*y,I=T*f-E*Math.sin(2*f)*y/2-v*Math.sin(4*f)*A/16-S*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=E,R.a2=v,R.a3=S,R.distanceRatio=I}function DYe(e,t){return e*t*(4+e*(4-3*t))/16}function Wme(e,t,n,i,r,o,s){let a=DYe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function RYe(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,E,v,S,I,R,O,L,_;do{v=Math.cos(T),S=Math.sin(T);let k=A-x*v;O=Math.sqrt(g*g*S*S+k*k),R=b+y*v,I=Math.atan2(O,R);let G;O===0?(G=0,L=1):(G=y*S/O,L=1-G*G),E=T,_=R-2*b/L,isFinite(_)||(_=0),T=c+Wme(a,G,L,I,O,R,_)}while(Math.abs(T-E)>P.EPSILON12);let C=L*(t*t-n*n)/(n*n),w=1+C*(4096+C*(C*(320-175*C)-768))/16384,D=C*(256+C*(C*(74-47*C)-128))/1024,N=_*_,F=D*O*(_+D*(R*(2*N-1)-D*_*(4*O*O-3)*(4*N-3)/6)/4),V=n*w*(I-F),B=Math.atan2(g*S,A-x*v),j=Math.atan2(d*S,A*v-x);e._distance=V,e._startHeading=B,e._endHeading=j,e._uSquared=C}var OYe=new h,b$=new h;function qme(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,b$),OYe),o=h.normalize(i.cartographicToCartesian(n,b$),b$);RYe(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,PYe(e)}function KP(e,t,n){let i=n??ee.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)&&qme(this,e,t,i)}Object.defineProperties(KP.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}}});KP.prototype.setEndPoints=function(e,t){qme(this,e,t,this._ellipsoid)};KP.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};KP.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*s/16)+(m/2-A+71*y/32-85*g/16)*a+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let E=Math.cos(2*n.sigma+b),v=Math.sin(b),S=Math.cos(b),I=n.cosineU*S,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,I-R*n.cosineHeading)-Wme(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,v,S,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new he(this._start.longitude+L,T,0)};var ty=KP;var Pl={};Pl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Pl.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 MYe=new he;Pl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,MYe).height}return i};var NYe=new M,LYe=new h,Yme=new h,FYe=new sn(h.UNIT_X,0),Xme=new h,BYe=new sn(h.UNIT_X,0),kYe=new h,UYe=new h,T$=[];function $me(e,t,n){let i=T$;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var xk=new he,bk=new he,ny=new h,E$=new h,zYe=new h,x$=new ty,$P=new Yc;function VYe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,E$),u=i.scaleToGeodeticSurface(t,zYe),f=Pl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,xk),p=i.cartesianToCartographic(u,bk),g=$me(f,r,o);x$.setEndPoints(d,p);let m=x$.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,ny);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=x$.interpolateUsingSurfaceDistance(b*m,bk);x.height=g[b],A=i.cartographicToCartesian(x,ny),h.pack(A,s,y),y+=3}return y}function jYe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,xk),u=i.cartesianToCartographic(t,bk),f=Pl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=$me(f,r,o);$P.ellipsoid.equals(i)||($P=new Yc(void 0,void 0,i)),$P.setEndPoints(c,u);let p=$P.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,ny);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=$P.interpolateUsingSurfaceDistance(y*p,bk);A.height=d[y],m=i.cartographicToCartesian(A,ny),h.pack(m,s,g),g+=3}return g}Pl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let r=M.inverseTransformation(t,NYe),o=M.multiplyByPoint(r,h.ZERO,LYe),s=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_Y,Yme),Yme),a=sn.fromPointNormal(o,s,FYe),c=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_X,Xme),Xme),u=sn.fromPointNormal(o,c,BYe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,d)<0||sn.getPointDistance(u,m)<0){let y=bi.lineSegmentPlane(d,m,a,kYe);if(l(y)){let A=h.multiplyByScalar(s,5e-9,UYe);sn.getPointDistance(a,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};Pl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],E$);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,ny);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??P.RADIANS_PER_DEGREE;s=P.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Pl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=VYe(y,A,s,i,b,x,f,d)}T$.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,xk);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,ny);return h.pack(m,f,u-3),f};var Kme=new he,HYe=new he;Pl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],E$);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,ny);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let s=e.granularity??P.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],Kme),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],HYe),a+=Pl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,Kme);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,E=o?r[c+1]:r;g=jYe(b,x,s,i,T,E,p,g)}T$.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,xk);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,ny);return h.pack(A,p,d-3),p};Pl.generateCartesianArc=function(e){let t=Pl.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};Pl.generateCartesianRhumbArc=function(e){let t=Pl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var cr=Pl;var Qa=[new h,new h],GYe=new h,WYe=new h,qYe=new h,YYe=new h,XYe=new h,KYe=new h,$Ye=new h,JYe=new h,ZYe=new h,EC=new h,Tk=new h,JP={},C$=new he;function QYe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];C$=t.cartesianToCartographic(r,C$),n[i]=C$.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function v$(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var Ek=new h,Ck=new h;function eXe(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,Ek),Ek),s=r.projectPointOntoPlane(h.add(n,t,Ck),Ck),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var tXe=new h(-1,0,0),$b=new M,nXe=new M,S$=new $,iXe=$.IDENTITY.clone(),rXe=new h,oXe=new se,Jme=new h;function Q0(e,t,n,i,r,o,s,a){let c=rXe,u=oXe;$b=At.eastNorthUpToFixedFrame(e,r,$b),c=M.multiplyByPointAsVector($b,tXe,c),c=h.normalize(c,c);let f=eXe(c,t,e,r);S$=$.fromRotationZ(f,S$),Jme.z=o,$b=M.multiplyTransformation($b,M.fromRotationTranslation(S$,Jme,nXe),$b);let d=iXe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=M.multiplyByPoint($b,u,u),i.push(u.x,u.y,u.z);return i}var sXe=new h;function w$(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,sXe);i=Q0(c,t,n,i,r,o[a/3],s,1)}return i}function aXe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r]=a.y-s,i}function Zme(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var Qme=new Le,epe=new h,tpe=new $;function npe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,EC),h.subtract(n,e,Tk)),d=i===ar.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,EC),f/(d+1),Qme),tpe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),Qme),tpe);let g,m;if(t=h.clone(t,epe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,EC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,Tk),s=Q0(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,EC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,Tk),s=Q0(m,g,a,s,o,c,1,1),n=h.clone(n,epe),g=h.subtract(n,e,EC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,Tk),s=Q0(m,g,a,s,o,c,1,1);return s}JP.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];U.equals(o,s)||n.push(s)}return n};JP.angleIsGreaterThanPi=function(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,Ek),Ek),s=r.projectPointOntoPlane(h.add(n,t,Ck),Ck);return s.x*o.y-s.y*o.x>=0};var cXe=new h,lXe=new h;JP.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=QYe(e,o),a=i._granularity,c=i._cornerType,u=r?aXe(t,n):Zme(t,n),f=r?Zme(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=GYe,b=WYe,x=qYe,T=YYe,E=XYe,v=KYe,S=$Ye,I=JYe,R=ZYe,O=e[0],L=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(L,O,A),A=h.normalize(A,A),I=h.cross(T,A,I),I=h.normalize(I,I);let _=s[0],C=s[1];r&&(y=Q0(O,I,f,y,o,_+d,1,1)),R=h.clone(O,R),O=L,b=h.negate(A,b);let w,D;for(let V=1;V<g-1;V++){let B=r?2:1;if(L=e[V+1],O.equals(L)){yt("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(L,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),cXe);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),lXe);if(h.subtract(b,k,k),h.normalize(k,k),!P.equalsEpsilon(Math.abs(h.dot(j,k)),1,P.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let q=1/Math.max(.25,h.magnitude(h.cross(x,b,EC))),Q=JP.angleIsGreaterThanPi(A,b,O,o);Q?(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,p,v),v),Qa[0]=h.clone(R,Qa[0]),Qa[1]=h.clone(v,Qa[1]),w=v$(Qa,_+d,C+d,a),D=cr.generateArc({positions:Qa,granularity:a,ellipsoid:o}),m=w$(D,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,p,S),S),c===ar.ROUNDED||c===ar.BEVELED?npe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=Q0(O,x,u,m,o,C+d,q,B)),R=h.clone(S,R)):(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,-p,v),v),Qa[0]=h.clone(R,Qa[0]),Qa[1]=h.clone(v,Qa[1]),w=v$(Qa,_+d,C+d,a),D=cr.generateArc({positions:Qa,granularity:a,ellipsoid:o}),m=w$(D,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,-p,S),S),c===ar.ROUNDED||c===ar.BEVELED?npe(E,v,S,c,Q,o,m,u,C+d,r):m=Q0(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=Q0(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}Qa[0]=h.clone(R,Qa[0]),Qa[1]=h.clone(O,Qa[1]),w=v$(Qa,_+d,C+d,a),D=cr.generateArc({positions:Qa,granularity:a,ellipsoid:o}),m=w$(D,I,u,m,o,w,1),r&&(y=Q0(O,I,f,y,o,C+d,1,1)),g=m.length;let N=r?g+y.length:g,F=new Float64Array(N);return F.set(m),r&&F.set(y,g),F};var fp=JP;var P$={},CC=new h,ape=new h,uXe=new h,ipe=new h,Dl=[new h,new h],cpe=new h,lpe=new h,upe=new h,fXe=new h,dXe=new h,hXe=new h,mXe=new h,pXe=new h,gXe=new h,_Xe=new h,rpe=new Le,ope=new $;function vk(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,CC),h.subtract(n,e,ape)),s=i===ar.BEVELED?1:Math.ceil(o/P.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 u;r?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,CC),o/s,rpe),ope):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,rpe),ope);let f=0;t=h.clone(t,CC);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function yXe(e){let t=cpe,n=lpe,i=upe,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=vk(t,n,i,ar.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=vk(t,n,i,ar.ROUNDED,!1);return[o,c]}function spe(e,t,n,i){let r=CC;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function I$(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,CC),a=h.negate(s,ape),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,uXe),p=h.add(d,a,ipe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,ipe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}P$.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var AXe=new h,bXe=new h;P$.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=cpe,c=lpe,u=upe,f=fXe,d=dXe,p=hXe,g=mXe,m=pXe,y=gXe,A=_Xe,b=[],x=s?[]:void 0,T=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let S,I=[],R,O=n.length;for(R=1;R<O-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),AXe);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),bXe);if(h.subtract(u,C,C),h.normalize(C,C),!P.equalsEpsilon(Math.abs(h.dot(_,C)),1,P.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let D=r/Math.max(.25,h.magnitude(h.cross(d,u,CC))),N=fp.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,D,d),N?(m=h.add(E,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),Dl[0]=h.clone(g,Dl[0]),Dl[1]=h.clone(A,Dl[1]),S=cr.generateArc({positions:Dl,granularity:t,ellipsoid:i}),b=I$(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===ar.ROUNDED||o===ar.BEVELED?I.push({leftPositions:vk(m,p,y,o,N)}):I.push({leftPositions:spe(E,h.negate(d,d),y,N)})):(y=h.add(E,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),Dl[0]=h.clone(g,Dl[0]),Dl[1]=h.clone(A,Dl[1]),S=cr.generateArc({positions:Dl,granularity:t,ellipsoid:i}),b=I$(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===ar.ROUNDED||o===ar.BEVELED?I.push({rightPositions:vk(y,p,m,o,N)}):I.push({rightPositions:spe(E,d,m,N)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),Dl[0]=h.clone(g,Dl[0]),Dl[1]=h.clone(E,Dl[1]),S=cr.generateArc({positions:Dl,granularity:t,ellipsoid:i}),b=I$(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===ar.ROUNDED&&(L=yXe(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var pr=P$;var hpe=new h,mpe=new h,Sk=new h,wk=new h,xXe=new h,ppe=new h,iy=new h,vC=new h;function gpe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Dh(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,iy),iy);o.normal&&pr.addAttribute(s,t,i,r),o.tangent&&pr.addAttribute(a,u,i,r),o.bitangent&&pr.addAttribute(c,n,i,r)}function _pe(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new En,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,v={normals:x,tangents:T,bitangents:E},S=0,I=A-1,R,O,L,_,C=hpe,w=mpe,D,N,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){N=Sk,D=wk;let J=o[0];for(C=h.fromArray(a,0,C),w=h.fromArray(s,0,w),d=0;d<F;d++)N=h.fromArray(J,(F-1-d)*3,N),D=h.fromArray(J,(F+d)*3,D),pr.addAttribute(b,D,S),pr.addAttribute(b,N,void 0,I),Dh(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}let j=0,k=0,G=i[j++],q=i[j++];b.set(G,S),b.set(q,I-q.length+1),w=h.fromArray(s,k,w);let Q,W;for(g=q.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,iy),iy),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,vC),vC),C=h.normalize(h.add(Q,W,C),C),Dh(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,iy),iy),W=n.geodeticSurfaceNormal(h.fromArray(q,g,vC),vC),C=h.normalize(h.add(Q,W,C),C),k+=3,d=0;d<r.length;d++){let J,Z=r[d],ae=Z.leftPositions,Ae=Z.rightPositions,fe,xe,ge=ppe,we=Sk,ve=wk;if(C=h.fromArray(a,k,C),l(ae)){for(Dh(v,C,w,void 0,I,t),I-=3,fe=_,xe=L,J=0;J<ae.length/3;J++)ge=h.fromArray(ae,J*3,ge),V[B++]=fe,V[B++]=xe-J-1,V[B++]=xe-J,pr.addAttribute(b,ge,void 0,I),we=h.fromArray(b,(xe-J-1)*3,we),ve=h.fromArray(b,fe*3,ve),w=h.normalize(h.subtract(we,ve,w),w),Dh(v,C,w,void 0,I,t),I-=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,xe*3,we),ge,we),ve=h.subtract(h.fromArray(b,(xe-J)*3,ve),ge,ve),w=h.normalize(h.add(we,ve,w),w),Dh(v,C,w,S,void 0,t),S+=3}else{for(Dh(v,C,w,S,void 0,t),S+=3,fe=L,xe=_,J=0;J<Ae.length/3;J++)ge=h.fromArray(Ae,J*3,ge),V[B++]=fe,V[B++]=xe+J,V[B++]=xe+J+1,pr.addAttribute(b,ge,S),we=h.fromArray(b,fe*3,we),ve=h.fromArray(b,(xe+J)*3,ve),w=h.normalize(h.subtract(we,ve,w),w),Dh(v,C,w,S,void 0,t),S+=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,(xe+J)*3,we),ge,we),ve=h.subtract(h.fromArray(b,xe*3,ve),ge,ve),w=h.normalize(h.negate(h.add(ve,we,w),w),w),Dh(v,C,w,void 0,I,t),I-=3}for(G=i[j++],q=i[j++],G.splice(0,3),q.splice(q.length-3,3),b.set(G,S),b.set(q,I-q.length+1),g=q.length-3,k+=3,w=h.fromArray(s,k,w),J=0;J<q.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,iy),iy),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,vC),vC),C=h.normalize(h.add(Q,W,C),C),Dh(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;S-=3,I+=3}if(C=h.fromArray(a,a.length-3,C),Dh(v,C,w,S,I,t),m){S+=3,I-=3,N=Sk,D=wk;let J=o[1];for(d=0;d<F;d++)N=h.fromArray(J,(y-d-1)*3,N),D=h.fromArray(J,d*3,D),pr.addAttribute(b,N,void 0,I),pr.addAttribute(b,D,S),Dh(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}if(c.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ae,Ae=0;if(m){u/=3,f/=3;let fe=Math.PI/(y+1);ae=1/(u-y+1),Z=1/(f-y+1);let xe,ge=y/2;for(d=ge+1;d<y+1;d++)xe=P.PI_OVER_TWO+fe*d,J[Ae++]=Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ge;d--)xe=P.PI_OVER_TWO-d*fe,J[Ae++]=1-Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=ge;d>0;d--)xe=P.PI_OVER_TWO-fe*d,J[Ae++]=1-ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=u-y;d>0;d--)J[Ae++]=d*ae,J[Ae++]=1;for(d=1;d<ge+1;d++)xe=P.PI_OVER_TWO+fe*d,J[Ae++]=ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe))}else{for(u/=3,f/=3,ae=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ae,J[Ae++]=1}c.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.normals})),t.tangent&&(c.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.tangents})),t.bitangent&&(c.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.bitangents})),{attributes:c,indices:V}}function TXe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=hpe,m=mpe,y=Sk,A=wk,b=xXe,x=ppe,T=c;for(u=0;u<s;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(pr.addAttribute(f,A,E),pr.addAttribute(f,A,E+3),pr.addAttribute(f,A,T),pr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(pr.addAttribute(p,x,E),pr.addAttribute(p,x,E+3),pr.addAttribute(p,x,T),pr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),pr.addAttribute(d,b,E),pr.addAttribute(d,b,E+3),pr.addAttribute(d,b,T),pr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function D$(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 r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function EXe(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=pr.computePositions(e),o=_pe(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=di.scaleToGeodeticHeight(f,s,i),m=D$(f,0,m),g=di.scaleToGeodeticHeight(g,a,i),m=D$(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=TXe(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=D$(O,d*4,L),c.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(A*6);if(e.offsetAttribute===pn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===pn.NONE?0:1;O=O.fill(L)}c.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let b=u.length,x=A+A,T=je.createTypedArray(p.length/3,b*2+x*3);T.set(u);let E=b;for(y=0;y<b;y+=3){let O=u[y],L=u[y+1],_=u[y+2];T[E++]=_+A,T[E++]=L+A,T[E++]=O+A}let v,S,I,R;for(y=0;y<x;y+=2)v=y+x,S=v+x,I=v+1,R=S+1,T[E++]=v,T[E++]=S,T[E++]=I,T[E++]=I,T[E++]=S,T[E++]=R;return{attributes:c,indices:T}}var fpe=new h,ZP=new h,fd=new he;function dpe(e,t,n,i,r,o){let s=h.subtract(t,e,fpe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,ZP),c=h.cross(s,a,fpe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,ZP),n.cartesianToCartographic(ZP,fd);let g=fd.latitude,m=fd.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,ZP),n.cartesianToCartographic(ZP,fd),g=fd.latitude,m=fd.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var ud=new h,QP=new h,gu=new he,_u=new he;function ype(e,t,n,i,r){e=gpe(e,t);let o=Lr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;gu.latitude=Number.POSITIVE_INFINITY,gu.longitude=Number.POSITIVE_INFINITY,_u.latitude=Number.NEGATIVE_INFINITY,_u.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===ar.ROUNDED){let p=o[0];h.subtract(p,o[1],ud),h.normalize(ud,ud),h.multiplyByScalar(ud,a,ud),h.add(p,ud,QP),t.cartesianToCartographic(QP,fd),c=fd.latitude,u=fd.longitude,gu.latitude=Math.min(gu.latitude,c),gu.longitude=Math.min(gu.longitude,u),_u.latitude=Math.max(_u.latitude,c),_u.longitude=Math.max(_u.longitude,u)}for(let p=0;p<s-1;++p)dpe(o[p],o[p+1],t,a,gu,_u);let f=o[s-1];h.subtract(f,o[s-2],ud),h.normalize(ud,ud),h.multiplyByScalar(ud,a,ud),h.add(f,ud,QP),dpe(f,QP,t,a,gu,_u),i===ar.ROUNDED&&(t.cartesianToCartographic(QP,fd),c=fd.latitude,u=fd.longitude,gu.latitude=Math.min(gu.latitude,c),gu.longitude=Math.min(gu.longitude,u),_u.latitude=Math.max(_u.latitude,c),_u.longitude=Math.max(_u.longitude,u));let d=l(r)?r:new ie;return d.north=_u.latitude,d.south=gu.latitude,d.east=_u.longitude,d.west=gu.longitude,d}function tg(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??ar.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Be.packedLength+7}tg.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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]=e._offsetAttribute??-1,t};var Ape=ee.clone(ee.UNIT_SPHERE),bpe=new Be,eg={positions:void 0,ellipsoid:Ape,vertexFormat:bpe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};tg.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=ee.unpack(e,t,Ape);t+=ee.packedLength;let s=Be.unpack(e,t,bpe);t+=Be.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(eg.positions=r,eg.width=a,eg.height=c,eg.extrudedHeight=u,eg.cornerType=f,eg.granularity=d,eg.shadowVolume=p,eg.offsetAttribute=g===-1?void 0:g,new tg(eg))};tg.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??ar.ROUNDED;return ype(n,r,i,o,t)};tg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=gpe(t,i);let r=Lr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=EXe(u,c);else{let g=pr.computePositions(u);if(f=_pe(g,c,i),f.attributes.position.values=di.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===pn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=le.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new wt({attributes:d,indices:f.indices,primitiveType:Oe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};tg.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new tg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(tg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=ype(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var SC=tg;var xpe=new h,Tpe=new h,CXe=new h;function vXe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Epe(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new En,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let N=r[f].leftPositions;l(N)?(p=N.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,E,v,S,I,R,O=m/2,L=je.createTypedArray(y/3,d+4),_=0;if(L[_++]=b/3,L[_++]=(x-2)/3,g){n.push(b/3),R=xpe,I=Tpe;let N=o[0];for(f=0;f<O;f++)R=h.fromArray(N,(O-1-f)*3,R),I=h.fromArray(N,(O+f)*3,I),pr.addAttribute(A,I,b),pr.addAttribute(A,R,void 0,x),E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3}let C=0,w=i[C++],D=i[C++];for(A.set(w,b),A.set(D,x-D.length+1),p=D.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;for(f=0;f<r.length;f++){let N;a=r[f];let F=a.leftPositions,V=a.rightPositions,B,j=CXe;if(l(F)){for(x-=3,B=v,n.push(S),N=0;N<F.length/3;N++)j=h.fromArray(F,N*3,j),L[_++]=B-N-1,L[_++]=B-N,pr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===ar.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,B=S,n.push(v),N=0;N<V.length/3;N++)j=h.fromArray(V,N*3,j),L[_++]=B+N,L[_++]=B+N+1,pr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===ar.BEVELED&&n.push(b/3-1),x-=3}for(w=i[C++],D=i[C++],w.splice(0,3),D.splice(D.length-3,3),A.set(w,b),A.set(D,x-D.length+1),N=0;N<D.length;N+=3)S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=xpe,I=Tpe;let N=o[1];for(f=0;f<O;f++)R=h.fromArray(N,(m-f-1)*3,R),I=h.fromArray(N,f*3,I),pr.addAttribute(A,R,void 0,x),pr.addAttribute(A,I,b),S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return L[_++]=b/3,L[_]=(x-2)/3,s.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:L,wallIndices:n}}function SXe(e){let t=e.ellipsoid,n=pr.computePositions(e),i=Epe(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=di.scaleToGeodeticHeight(u,o,t),d=di.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===pn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===pn.NONE?0:1;T=T.fill(E)}a.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=je.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];y[A++]=T+f,y[A++]=E+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:a,indices:y}}function eD(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??ar.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}eD.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var Cpe=ee.clone(ee.UNIT_SPHERE),ry={positions:void 0,ellipsoid:Cpe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};eD.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=ee.unpack(e,t,Cpe);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(ry.positions=r,ry.width=s,ry.height=a,ry.extrudedHeight=c,ry.cornerType=u,ry.granularity=f,ry.offsetAttribute=d===-1?void 0:d,new eD(ry))};eD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=vXe(t,i);let r=Lr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=SXe(c);else{let p=pr.computePositions(c);if(u=Epe(p,c.cornerType),u.attributes.position.values=di.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===pn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=le.fromVertices(f.position.values,void 0,3);return new wt({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var Ik=eD;function wXe(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var Pk=wXe;function IXe(e){return e=e??H.EMPTY_OBJECT,hC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Dk=IXe;function PXe(e){return e=e??H.EMPTY_OBJECT,hC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var wC=PXe;function IC(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ir({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n}Object.defineProperties(IC.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}}});IC.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new jc({buffer:c,width:o,height:s})})};IC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};IC.prototype.getTileDataAvailable=function(e,t,n){};IC.prototype.loadTileDataAvailability=function(e,t,n){};var vpe=IC;var Spe={};Spe.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*P.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,E=A*t,v=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=o)}return u};var PC=Spe;var R$=new U,DXe=new h,RXe=new h,OXe=new h,MXe=new h;function ng(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}ng.packedLength=Be.packedLength+5;ng.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var wpe=new Be,DC={vertexFormat:wpe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};ng.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,wpe);t+=Be.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(DC.length=r,DC.topRadius=o,DC.bottomRadius=s,DC.slices=a,DC.offsetAttribute=c===-1?void 0:c,new ng(DC))};ng.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=PC.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let I=r.tangent||r.bitangent,R=0,O=0,L=0,_=Math.atan2(i-n,t),C=DXe;C.z=Math.sin(_);let w=Math.cos(_),D=OXe,N=RXe;for(m=0;m<o;m++){let F=m/o*P.TWO_PI,V=w*Math.cos(F),B=w*Math.sin(F);y&&(C.x=V,C.y=B,I&&(D=h.normalize(h.cross(h.UNIT_Z,C,D),D)),r.normal&&(d[R++]=C.x,d[R++]=C.y,d[R++]=C.z,d[R++]=C.x,d[R++]=C.y,d[R++]=C.z),r.tangent&&(p[O++]=D.x,p[O++]=D.y,p[O++]=D.z,p[O++]=D.x,p[O++]=D.y,p[O++]=D.z),r.bitangent&&(N=h.normalize(h.cross(C,D,N),N),g[L++]=N.x,g[L++]=N.y,g[L++]=N.z,g[L++]=N.x,g[L++]=N.y,g[L++]=N.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let A=12*o-12,b=je.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=s-2,b[x++]=0,b[x++]=1,b[x++]=s-2,b[x++]=1,b[x++]=s-1,m=1;m<o-1;m++)b[x++]=s+m+1,b[x++]=s+m,b[x++]=s;for(m=1;m<o-1;m++)b[x++]=a,b[x++]=a+m,b[x++]=a+m+1;let E=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,MXe);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new En;r.position&&(v.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),R$.x=t*.5,R$.y=Math.max(i,n);let S=new le(h.ZERO,U.magnitude(R$));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===pn.NONE?0:1,R=new Uint8Array(t/3).fill(I);v.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new wt({attributes:v,indices:b,primitiveType:Oe.TRIANGLES,boundingSphere:S,offsetAttribute:e._offsetAttribute})};var O$;ng.getUnitCylinder=function(){return l(O$)||(O$=ng.createGeometry(new ng({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),O$};var Rk=ng;var M$=new U;function RC(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}RC.packedLength=6;RC.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Jb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};RC.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Jb.length=i,Jb.topRadius=r,Jb.bottomRadius=o,Jb.slices=s,Jb.numberOfVerticalLines=a,Jb.offsetAttribute=c===-1?void 0:c,new RC(Jb))};RC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=PC.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=je.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new En;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),M$.x=t*.5,M$.y=Math.max(i,n);let m=new le(h.ZERO,U.magnitude(M$));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===pn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new wt({attributes:g,indices:f,primitiveType:Oe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var Ok=RC;var NXe=1953029805,LXe=2917034100;function N$(e,t){if(N$.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===NXe||r===LXe)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}N$.passThroughDataForTesting=!1;var Mk=N$;var L$=32767,FXe=new he,BXe=new h;function kXe(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);cn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=P.lerp(t.west,t.east,d/L$),y=P.lerp(t.south,t.north,p/L$),A=P.lerp(n,i,g/L$),b=he.fromRadians(m,y,A,FXe),x=r.cartographicToCartesian(b,BXe);h.pack(x,u,f*3)}return u}var Nk=kXe;function Ipe(e){this.proxy=e}Ipe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Ppe=Ipe;function mf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(mf.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}}});mf.packedLength=2;mf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};mf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new mf),n.near=e[t++],n.far=e[t],n};mf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};mf.clone=function(e,t){if(l(e))return l(t)||(t=new mf),t.near=e.near,t.far=e.far,t};mf.prototype.clone=function(e){return mf.clone(this,e)};mf.prototype.equals=function(e){return mf.equals(this,e)};var Gt=mf;function tD(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(tD.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});tD.fromDistanceDisplayCondition=function(e){return new tD(e.near,e.far)};tD.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ei=tD;function nD(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(nD.prototype,{length:{get:function(){return this._length}}});function UXe(e,t,n){this.item=e,this.previous=t,this.next=n}nD.prototype.add=function(e){let t=new UXe(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 Dpe(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}nD.prototype.remove=function(e){l(e)&&(Dpe(this,e),--this._length)};nD.prototype.splice=function(e,t){if(e===t)return;Dpe(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 Lk=nD;var Ji=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-Ji.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?Ji.Bounce.In(e*2)*.5:Ji.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}}}}),iD=function(){return performance.now()},zXe=(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 r=0,o=n;r<o.length;r++){var s=o[r];(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,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=iD()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),OC={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=OC.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=OC.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=OC.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=OC.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,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},Rpe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),F$=new zXe,Ope=(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=Ji.Linear.None,this._interpolationFunction=OC.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Rpe.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=F$,F$.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=iD()),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 r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}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,r,o){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(a,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var A=a;for(var b in A)n[s][b]=A[b];r[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[s]=d=x}this._setupProperties(A,n[s],d,r[s],o)}else(typeof n[s]>"u"||o)&&(n[s]=a),c||(n[s]*=1),f?r[s]=i[s].slice().reverse():r[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=iD()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=iD()),!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=Ji.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=OC.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,r;if(t===void 0&&(t=iD()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;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+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),A=s-y*a,b=Math.min(A/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];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,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},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 BCn=Rpe.nextId,dp=F$,kCn=dp.getAll.bind(dp),UCn=dp.removeAll.bind(dp),zCn=dp.add.bind(dp),VCn=dp.remove.bind(dp),jCn=dp.update.bind(dp);var VXe={LINEAR_NONE:Ji.Linear.None,QUADRATIC_IN:Ji.Quadratic.In,QUADRATIC_OUT:Ji.Quadratic.Out,QUADRATIC_IN_OUT:Ji.Quadratic.InOut,CUBIC_IN:Ji.Cubic.In,CUBIC_OUT:Ji.Cubic.Out,CUBIC_IN_OUT:Ji.Cubic.InOut,QUARTIC_IN:Ji.Quartic.In,QUARTIC_OUT:Ji.Quartic.Out,QUARTIC_IN_OUT:Ji.Quartic.InOut,QUINTIC_IN:Ji.Quintic.In,QUINTIC_OUT:Ji.Quintic.Out,QUINTIC_IN_OUT:Ji.Quintic.InOut,SINUSOIDAL_IN:Ji.Sinusoidal.In,SINUSOIDAL_OUT:Ji.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ji.Sinusoidal.InOut,EXPONENTIAL_IN:Ji.Exponential.In,EXPONENTIAL_OUT:Ji.Exponential.Out,EXPONENTIAL_IN_OUT:Ji.Exponential.InOut,CIRCULAR_IN:Ji.Circular.In,CIRCULAR_OUT:Ji.Circular.Out,CIRCULAR_IN_OUT:Ji.Circular.InOut,ELASTIC_IN:Ji.Elastic.In,ELASTIC_OUT:Ji.Elastic.Out,ELASTIC_IN_OUT:Ji.Elastic.InOut,BACK_IN:Ji.Back.In,BACK_OUT:Ji.Back.Out,BACK_IN_OUT:Ji.Back.InOut,BOUNCE_IN:Ji.Bounce.In,BOUNCE_OUT:Ji.Bounce.Out,BOUNCE_IN_OUT:Ji.Bounce.InOut},Ds=Object.freeze(VXe);var jXe=new h,HXe=new h,GXe=new h,WXe=new h,qXe=new h,YXe=new h(1,1,1),Mpe=Math.cos,Npe=Math.sin;function ig(e){e=e??H.EMPTY_OBJECT;let t=e.radii??YXe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??P.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}ig.packedLength=2*h.packedLength+Be.packedLength+7;ig.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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._offsetAttribute??-1,t};var Lpe=new h,Fpe=new h,Bpe=new Be,oy={radii:Lpe,innerRadii:Fpe,vertexFormat:Bpe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};ig.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Lpe);t+=h.packedLength;let r=h.unpack(e,t,Fpe);t+=h.packedLength;let o=Be.unpack(e,t,Bpe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(oy.minimumClock=s,oy.maximumClock=a,oy.minimumCone=c,oy.maximumCone=u,oy.stackPartitions=f,oy.slicePartitions=d,oy.offsetAttribute=p===-1?void 0:p,new ig(oy))};ig.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,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-o)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,S=!1;T&&(x=2,o>0&&(E=!0,b+=c-1),s<Math.PI&&(v=!0,b+=c-1),(r-i)%P.TWO_PI?(S=!0,b+=(u-1)*2+1):b+=1);let I=A*y*x,R=new Float64Array(I*3),O=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*x,C=6*(_+b+1-(c+u)*x),w=je.createTypedArray(_,C),D=a.normal?new Float32Array(I*3):void 0,N=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,V=a.st?new Float32Array(I*2):void 0,B=new Array(y),j=new Array(y);for(f=0;f<y;f++)B[f]=Npe(g[f]),j[f]=Mpe(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=Mpe(m[d]),k[d]=Npe(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*B[f]*G[d],R[p++]=t.y*B[f]*k[d],R[p++]=t.z*j[f];let q=I/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*B[f]*G[d],R[p++]=n.y*B[f]*k[d],R[p++]=n.z*j[f],O[q]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(L[q]=!0),q++;p=0;let Q,W;for(f=1;f<y-2;f++)for(Q=f*A,W=(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=Q+d;if(T){let He=y*A;for(f=1;f<y-2;f++)for(Q=He+f*A,W=He+(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=Q+d,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=W+d+1}let J,Z;if(T){if(E)for(Z=y*A,f=1;f<A-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)w[p++]=J+f+1,w[p++]=J+f,w[p++]=Z+f,w[p++]=J+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(S){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,w[p++]=Z,w[p++]=J+A,w[p++]=J,w[p++]=Z,w[p++]=Z+A,w[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,w[p++]=J+A,w[p++]=Z,w[p++]=J,w[p++]=J+A,w[p++]=Z+A,w[p++]=Z}let ae=new En;a.position&&(ae.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,fe=0,xe=0,ge=0,we=I/2,ve,Re=ee.fromCartesian3(t),Qe=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){ve=O[f]?Qe:Re;let He=h.fromArray(R,f*3,jXe),Ye=ve.geodeticSurfaceNormal(He,HXe);if(L[f]&&h.negate(Ye,Ye),a.st){let Ke=U.negate(Ye,qXe);V[Ae++]=Math.atan2(Ke.y,Ke.x)/P.TWO_PI+.5,V[Ae++]=Math.asin(Ye.z)/Math.PI+.5}if(a.normal&&(D[fe++]=Ye.x,D[fe++]=Ye.y,D[fe++]=Ye.z),a.tangent||a.bitangent){let Ke=GXe,Pe=0,qe;if(O[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+A*2?qe=h.UNIT_X:qe=h.UNIT_Z,h.cross(qe,Ye,Ke),h.normalize(Ke,Ke),a.tangent&&(N[xe++]=Ke.x,N[xe++]=Ke.y,N[xe++]=Ke.z),a.bitangent){let st=h.cross(Ye,Ke,WXe);h.normalize(st,st),F[ge++]=st.x,F[ge++]=st.y,F[ge++]=st.z}}}a.st&&(ae.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(ae.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:D})),a.tangent&&(ae.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(ae.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let He=R.length,Ye=e._offsetAttribute===pn.NONE?0:1,Ke=new Uint8Array(He/3).fill(Ye);ae.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}return new wt({attributes:ae,indices:w,primitiveType:Oe.TRIANGLES,boundingSphere:le.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var B$;ig.getUnitEllipsoid=function(){return l(B$)||(B$=ig.createGeometry(new ig({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),B$};var ec=ig;var XXe=new h(1,1,1),Fk=Math.cos,Bk=Math.sin;function MC(e){e=e??H.EMPTY_OBJECT;let t=e.radii??XXe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??P.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}MC.packedLength=2*h.packedLength+8;MC.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.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]=e._offsetAttribute??-1,t};var kpe=new h,Upe=new h,rg={radii:kpe,innerRadii:Upe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};MC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,kpe);t+=h.packedLength;let r=h.unpack(e,t,Upe);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(rg.minimumClock=o,rg.maximumClock=s,rg.minimumCone=a,rg.maximumCone=c,rg.stackPartitions=u,rg.slicePartitions=f,rg.subdivisions=d,rg.offsetAttribute=p===-1?void 0:p,new MC(rg))};MC.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,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-o)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let A=a*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=je.createTypedArray(A,x),E,v,S,I,R=0,O=new Array(f),L=new Array(f);for(E=0;E<f;E++)I=o+E*(s-o)/(f-1),O[E]=Bk(I),L[E]=Fk(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=Bk(S),C[E]=Fk(S);for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(O.length=a,L.length=a,E=0;E<a;E++)I=o+E*(s-o)/(a-1),O[E]=Bk(I),L[E]=Fk(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=Bk(S),C[E]=Fk(S);for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(R=0,E=0;E<f*p;E++){let N=E*a;for(v=0;v<a-1;v++)T[R++]=N+v,T[R++]=N+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g){let N=f*a*p,F=N+a*u;if(m)for(E=0;E<u;E++)T[R++]=N+E,T[R++]=F+E;if(y)for(N+=a*u-u,F+=a*u-u,E=0;E<u;E++)T[R++]=N+E,T[R++]=F+E}let D=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let N=b.length,F=e._offsetAttribute===pn.NONE?0:1,V=new Uint8Array(N/3).fill(F);D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new wt({attributes:D,indices:T,primitiveType:Oe.LINES,boundingSphere:le.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var dd=MC;function NC(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ir({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(NC.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(){}}});NC.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new jc({buffer:new Uint8Array(256),width:16,height:16}))};NC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};NC.prototype.getTileDataAvailable=function(e,t,n){};NC.prototype.loadTileDataAvailability=function(e,t,n){};var og=NC;function k$(){this._removalFunctions=[]}k$.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};k$.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Xo=k$;var zpe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(zpe);var yu=zpe;function hp(e){e=e??H.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new aa,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function U$(e){let{top:t,bottom:n,right:i,left:r,near:o,far:s}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(hp.prototype,{projectionMatrix:{get:function(){return U$(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return U$(this),this._infinitePerspective}}});var KXe=new h,$Xe=new h,JXe=new h,ZXe=new h;hp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,KXe),d=$Xe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=JXe;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=ZXe;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};hp.prototype.getPixelDimensions=function(e,t,n,i,r){U$(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};hp.prototype.clone=function(e){return l(e)||(e=new hp),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};hp.prototype.equals=function(e){return l(e)&&e instanceof hp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};hp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof hp&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Au=hp;function bu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Au,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}bu.packedLength=6;bu.pack=function(e,t,n){return n=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};bu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new bu),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 Rh(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(bu.prototype,{projectionMatrix:{get:function(){return Rh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Rh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Rh(this),this._fovy}},sseDenominator:{get:function(){return Rh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Rh(this),this._offCenterFrustum}}});bu.prototype.computeCullingVolume=function(e,t,n){return Rh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};bu.prototype.getPixelDimensions=function(e,t,n,i,r){return Rh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};bu.prototype.clone=function(e){return l(e)||(e=new bu),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};bu.prototype.equals=function(e){return!l(e)||!(e instanceof bu)?!1:(Rh(this),Rh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};bu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof bu)?!1:(Rh(this),Rh(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Zi=bu;var kk=0,QXe=1;function Zb(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof Zi?(s=kk,a=Zi.packedLength):t instanceof _n&&(s=QXe,a=_n.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength+Be.packedLength}Zb.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===kk?(Zi.pack(r,t,n),n+=Zi.packedLength):(_n.pack(r,t,n),n+=_n.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var eKe=new Zi,tKe=new _n,nKe=new Le,iKe=new h,rKe=new Be;Zb.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===kk?(r=Zi.unpack(e,t,eKe),t+=Zi.packedLength):(r=_n.unpack(e,t,tKe),t+=_n.packedLength);let o=h.unpack(e,t,iKe);t+=h.packedLength;let s=Le.unpack(e,t,nKe);t+=Le.packedLength;let a=Be.unpack(e,t,rKe);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new Zb({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Be.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function LC(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.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;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var oKe=new $,sKe=new M,z$=new M,Vpe=new h,jpe=new h,Hpe=new h,aKe=new h,cKe=new h,lKe=new h,sy=new Array(3),rD=new Array(4);rD[0]=new se(-1,-1,1,1);rD[1]=new se(1,-1,1,1);rD[2]=new se(1,1,1,1);rD[3]=new se(-1,1,1,1);var Gpe=new Array(4);for(let e=0;e<4;++e)Gpe[e]=new se;Zb._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,oKe),u=o??Vpe,f=s??jpe,d=a??Hpe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=M.computeView(e,d,f,u,sKe),g,m,y=i.projectionMatrix;if(n===kk){let A=M.multiply(y,p,z$);m=M.inverse(A,z$)}else g=M.inverseTransformation(p,z$);l(m)?(sy[0]=i.near,sy[1]=i.far):(sy[0]=0,sy[1]=i.near,sy[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(rD[b],Gpe[b]);if(l(m)){x=M.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let E=h.dot(d,x);h.multiplyByScalar(x,sy[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=sy[A],v=sy[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(E-v)-E-v)*.5,x.w=1,M.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};Zb.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(72);Zb._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new En({position:new Ne({componentDatatype:Y.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(12*a):void 0,m=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,A=Vpe,b=jpe,x=Hpe,T=h.negate(A,aKe),E=h.negate(b,cKe),v=h.negate(x,lKe);u=0,o&&(LC(u,p,g,m,y,v,A,b),u+=12),LC(u,p,g,m,y,x,T,b),u+=12,LC(u,p,g,m,y,T,v,b),u+=12,LC(u,p,g,m,y,E,v,T),u+=12,LC(u,p,g,m,y,A,x,b),u+=12,LC(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new wt({attributes:f,indices:d,primitiveType:Oe.TRIANGLES,boundingSphere:le.fromVertices(c)})};var FC=Zb;var V$=0,uKe=1;function oD(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Zi?(o=V$,s=Zi.packedLength):t instanceof _n&&(o=uKe,s=_n.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength}oD.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===V$?(Zi.pack(r,t,n),n+=Zi.packedLength):(_n.pack(r,t,n),n+=_n.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var fKe=new Zi,dKe=new _n,hKe=new Le,mKe=new h;oD.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===V$?(r=Zi.unpack(e,t,fKe),t+=Zi.packedLength):(r=_n.unpack(e,t,dKe),t+=_n.packedLength);let o=h.unpack(e,t,mKe);t+=h.packedLength;let s=Le.unpack(e,t,hKe);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new oD({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};oD.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);FC._computeNearFarPlanes(i,r,t,n,s);let a=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new wt({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:le.fromVertices(s)})};var Uk=oD;function zk(){pe.throwInstantiationError()}Object.defineProperties(zk.prototype,{credit:{get:pe.throwInstantiationError}});zk.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};zk.prototype.geocode=pe.throwInstantiationError;var sD=zk;var Wpe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(Wpe);var Qb=Wpe;function qpe(){pe.throwInstantiationError()}qpe.createGeometry=function(e){pe.throwInstantiationError()};var Ype=qpe;function pKe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Rl=pKe;var Xpe=js(Qu(),1);function gKe(e){let t=new Xpe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var ay=gKe;function _Ke(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var Vk=_Ke;var EKe=js(j$(),1);function yKe(e,t){return(e&t)!==0}var Ol=yKe;var AKe=[1,2,4,8],Kpe=15,bKe=16,xKe=64,TKe=128;function mp(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}mp.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 mp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};mp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};mp.prototype.hasSubtree=function(){return Ol(this._bits,bKe)};mp.prototype.hasImagery=function(){return Ol(this._bits,xKe)};mp.prototype.hasTerrain=function(){return Ol(this._bits,TKe)};mp.prototype.hasChildren=function(){return Ol(this._bits,Kpe)};mp.prototype.hasChild=function(e){return Ol(this._bits,AKe[e])};mp.prototype.getChildBitmask=function(){return this._bits&Kpe};var jk=mp;function CKe(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var vKe=CKe(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBB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xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 +\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function pf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(pf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});pf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new pf;i._resource=n;try{await SKe(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${Jpe(i,"",1).url}: ${r}`;throw new oe(o)}return i};pf.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Ol(t,o)?Ol(e,o)&&(s|=1):(s|=2,Ol(e,o)||(s|=1)),i+=s}return i};pf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Ol(s,2)?Ol(s,1)||(t|=o):(n|=o,Ol(s,1)&&(t|=o))}return{x:t,y:n,level:i}};pf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var $pe=new $n("decodeGoogleEarthEnterprisePacket");pf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=Jpe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return $pe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let b=jk.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};pf.prototype.populateSubtree=function(e,t,n,i){let r=pf.tileXYToQuadKey(e,t,n);return W$(this,r,i)};function W$(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),W$(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),W$(e,t,s)}).finally(function(){delete a[r]})}pf.prototype.getTileInformation=function(e,t,n){let i=pf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};pf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Jpe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var H$,G$;function SKe(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(G$)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;G$=EE(n).then(function(){H$=window.cesiumGoogleEarthDbRootParser(EKe),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return G$.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=H$.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return $pe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=H$.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=vKe})}var cy=pf;function ex(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(ex.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var e0e="createVerticesFromGoogleEarthEnterpriseBuffer",wKe=new $n(e0e),IKe=new $n(e0e,af.maximumAsynchronousTasks),Zpe=new ie,Hk=new ie;ex.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,Zpe),t.tileXYToRectangle(n,i,r,Hk);let u=c.cartographicToCartesian(ie.center(Hk)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?IKe:wKe).scheduleTask({buffer:this._buffer,nativeRectangle:Zpe,rectangle:Hk,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new Ac(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,Hk,le.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),Eo.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};ex.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),r=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?MKe(this,i,r):FKe(this,i,r,e)};var PKe=new $n("upsampleQuantizedTerrainMesh",af.maximumAsynchronousTasks);ex.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=PKe.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:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=je.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new dC({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:le.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};ex.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};ex.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var DKe=new U,RKe=new U,OKe=new U,t0e=new h;function MKe(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,DKe),g=o.decodeTextureCoordinates(r,f,RKe),m=o.decodeTextureCoordinates(r,d,OKe),y=np.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,t0e);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var NKe=Uint16Array.BYTES_PER_ELEMENT,Qpe=Uint32Array.BYTES_PER_ELEMENT,q$=Int32Array.BYTES_PER_ELEMENT,LKe=Float32Array.BYTES_PER_ELEMENT,Y$=Float64Array.BYTES_PER_ELEMENT;function FKe(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=Qpe;u+=Qpe,u+=2*Y$;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=Y$;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=Y$;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=q$;let y=c.getInt32(u,!0)*3;u+=q$,u+=q$;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=s+c.getUint8(u++)*p,b[T]=a+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=LKe;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=NKe;for(T=0;T<y;T+=3){let v=E[T],S=E[T+1],I=E[T+2],R=A[v],O=A[S],L=A[I],_=b[v],C=b[S],w=b[I],D=np.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,t0e);if(D.x>=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15)return D.x*x[v]+D.y*x[S]+D.z*x[I]}}var cD=ex;var hd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},Gk=new K;function Wk(){this._terrainCache={},this._lastTidy=K.now()}Wk.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};Wk.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};Wk.prototype.tidy=function(){if(K.now(Gk),K.secondsDifference(Gk,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(Gk,o.timestamp)>10&&delete e[r]}K.clone(Gk,this._lastTidy)}};function ly(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new Wk,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(ly.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(){}}});ly.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new ly(t);return n._metadata=e,n};var BKe=new $n("decodeGoogleEarthEnterprisePacket");function n0e(e,t,n){let i=t.getChildBitmask();if(t.terrainState===hd.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}ly.prototype.requestTileGeometry=function(e,t,n,i){let r=cy.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=hd.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new cD({buffer:u,childTileMask:n0e(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===hd.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new jc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case hd.SELF:p=a.terrainVersion;break;case hd.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case hd.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=kKe(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?BKe.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=hd.SELF,o.add(d,T[0]);let v=E.terrainProvider,S=T.length-1;for(let I=0;I<S;++I){let R=d+I.toString(),O=s.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[I+1]),O.terrainState=hd.PARENT,O.terrainProvider===0&&(O.terrainProvider=v))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=s.providers[a.terrainProvider];return new cD({buffer:b,childTileMask:n0e(r,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===wi.CANCELLED?(i.state=A.state,Promise.reject(b)):(a.terrainState=hd.NONE,Promise.reject(b))})};ly.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ly.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=cy.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===hd.NONE)return!1;if((!l(s)||s===hd.UNKNOWN)&&(o.terrainState=hd.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};ly.prototype.loadTileDataAvailability=function(e,t,n){};function kKe(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 i0e=ly;var UKe="https://maps.googleapis.com/maps/api/geocode/json",r0e='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function X$(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:UKe,queryParameters:{key:t}}),this._credit=new It(r0e,!0)}Object.defineProperties(X$.prototype,{credit:{get:function(){return this._credit}}});X$.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 oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,s=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,s.lng,s.lat),attribution:{html:r0e,collapsible:!1}}})};var o0e=X$;var BC={};BC.defaultApiKey=void 0;BC.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});BC.defaultStreetViewStaticApiKey=void 0;BC.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});BC.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Da=BC;var nJ=[ji,xi],zKe=nJ.length,v0e=Math.cos(P.toRadians(30)),s0e=Math.cos(P.toRadians(150)),S0e=0,w0e=1e3;function fy(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(fy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});fy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<zKe;i++)if(t instanceof nJ[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var VKe=new h,a0e=new h,c0e=new h;function tJ(e,t,n,i,r){let o=Ml(i,e,0,VKe),s=Ml(i,e,n,a0e),a=Ml(i,t,0,c0e),c=sg(s,o,a0e),u=sg(a,o,c0e);return h.cross(u,c,r),h.normalize(r,r)}var jKe=new he,HKe=new h,GKe=new h,WKe=new h;function K$(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new ty(e,t,s):o===ln.RHUMB&&(d=new Yc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=tJ(e,t,i,s,WKe),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=a.length;for(let T=0;T<b;T++){let E=d.interpolateUsingSurfaceDistance(A,jKe),v=Ml(s,E,n,HKe),S=Ml(s,E,i,GKe);h.pack(g,a,x),h.pack(v,c,x),h.pack(S,u,x),f.push(E.latitude),f.push(E.longitude),x+=3,A+=y}}var $$=new he;function Ml(e,t,n,i){return he.clone(t,$$),$$.height=n,he.toCartesian($$,e,i)}fy.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};fy.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new fy({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function sg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function l0e(e,t,n,i){return i=sg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var qKe=new h,YKe=new h,XKe=new h,I0e=new h,KKe=0,$Ke=-1;function J$(e,t,n,i,r){let o=sg(n,t,I0e),s=l0e(e,t,o,qKe),a=l0e(i,t,o,YKe);if(P.equalsEpsilon(h.dot(s,a),$Ke,P.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,XKe);return h.dot(a,c)<KKe&&(r=h.negate(r,r)),r}var Kk=sn.fromPointNormal(h.ZERO,h.UNIT_Y),JKe=new h,ZKe=new h,QKe=new h,e$e=new h,t$e=new h,qk=new h,Yk=new he,u0e=new he,f0e=new he;fy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new nJ[e._projectionIndex](i),a=S0e,c=w0e,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Yc(void 0,void 0,i),x,T,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=bi.lineSegmentPlane(g,m,Kk,qk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,Yk).longitude,y=i.cartesianToCartographic(g,Yk),A=i.cartesianToCartographic(m,u0e),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,f0e),x=i.cartographicToCartesian(T,qk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&v.push(h.clone(x)))),v.push(m);n&&(g=d[p-1],m=d[0],x=bi.lineSegmentPlane(g,m,Kk,qk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,Yk).longitude,y=i.cartesianToCartographic(g,Yk),A=i.cartesianToCartographic(m,u0e),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,f0e),x=i.cartographicToCartesian(T,qk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&v.push(h.clone(x)))));let S=v.length,I=new Array(S);for(f=0;f<S;f++){let q=he.fromCartesian(v[f],i);q.height=0,I[f]=q}if(I=Lr(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=JKe,w=ZKe,D=QKe,N=e$e,F=t$e,V=I[0],B=I[1],j=I[S-1];for(C=Ml(i,j,a,C),N=Ml(i,B,a,N),w=Ml(i,V,a,w),D=Ml(i,V,c,D),n?F=J$(C,w,D,N,F):F=tJ(V,B,c,i,F),h.pack(F,O,0),h.pack(w,L,0),h.pack(D,_,0),R.push(V.latitude),R.push(V.longitude),K$(V,B,a,c,r,o,i,O,L,_,R),f=1;f<S-1;++f){C=h.clone(w,C),w=h.clone(N,w);let q=I[f];Ml(i,q,c,D),Ml(i,I[f+1],a,N),J$(C,w,D,N,F),u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(D,_,u),R.push(q.latitude),R.push(q.longitude),K$(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=Ml(i,k,a,w),D=Ml(i,k,c,D),n){let q=I[0];C=Ml(i,G,a,C),N=Ml(i,q,a,N),F=J$(C,w,D,N,F)}else F=tJ(G,k,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(D,_,u),R.push(k.latitude),R.push(k.longitude),n){for(K$(k,V,a,c,r,o,i,O,L,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return w$e(n,s,L,_,O,R,t)};var n$e=new h,i$e=new $,r$e=new Le;function d0e(e,t,n,i){let r=sg(n,t,n$e),o=h.dot(r,e);if(o>v0e||o<s0e){let s=sg(i,n,I0e),a=o<s0e?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,r$e),u=$.fromQuaternion(c,i$e);return $.multiplyByVector(u,e,e),!0}return!1}var h0e=new he,o$e=new h,m0e=new h;function lD(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,o$e),s=h.add(o,n,m0e),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,h0e);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,m0e),u=c.cartesianToCartographic(s,h0e)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var s$e=new h,p0e=new h;function g0e(e,t,n,i,r,o){let s=h.subtract(t,e,s$e);h.normalize(s,s);let a=n-S0e,c=h.multiplyByScalar(s,a,p0e);h.add(e,c,r);let u=i-w0e;c=h.multiplyByScalar(s,u,p0e),h.add(t,c,o)}var a$e=new h;function Xk(e,t){let n=sn.getPointDistance(Kk,e),i=sn.getPointDistance(Kk,t),r=a$e;P.equalsEpsilon(n,0,P.EPSILON2)?(r=sg(t,e,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=sg(e,t,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(t,r,t))}function c$e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let r=P.sign(t.longitude);return e.longitude=r*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let r=P.sign(e.longitude);return t.longitude=r*(i-P.EPSILON11),2}return 0}var P0e=new he,D0e=new he,_0e=new h,Z$=new h,y0e=new h,A0e=new h,l$e=new h,b0e=new h,u$e=[P0e,D0e],f$e=new ie,d$e=new h,h$e=new h,m$e=new h,p$e=new h,g$e=new h,_$e=new h,Q$=new h,eJ=new h,y$e=new h,A$e=new h,b$e=new h,x0e=new h,x$e=new h,T$e=new h,E$e=new Sn,C$e=new Sn,T0e=new h,v$e=new h,E0e=new h,S$e=[new le,new le],R0e=[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],C0e=R0e.length;function w$e(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),v,S,I,R;s&&(v=new Float32Array(p),S=new Float32Array(p),I=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,L=0,_=P0e;_.height=0;let C=D0e;C.height=0;let w=_0e,D=Z$;if(s)for(c=0,a=1;a<O;a++)_.latitude=o[c],_.longitude=o[c+1],C.latitude=o[c+2],C.longitude=o[c+3],w=t.project(_,w),D=t.project(C,D),L+=h.distance(w,D),c+=2;let N=i.length/3;D=h.unpack(i,0,D);let F=0;for(c=3,a=1;a<N;a++)w=h.clone(D,w),D=h.unpack(i,c,D),F+=h.distance(w,D),c+=3;let V;c=3;let B=0,j=0,k=0,G=0,q=!1,Q=h.unpack(n,0,A0e),W=h.unpack(i,0,Z$),J=h.unpack(r,0,b0e);if(e){let ve=h.unpack(n,n.length-6,y0e);d0e(J,ve,Q,W)&&(J=h.negate(J,J))}let Z=0,ae=0,Ae=0;for(a=0;a<f;a++){let ve=h.clone(Q,y0e),Re=h.clone(W,_0e),Qe=h.clone(J,l$e);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,A0e),W=h.unpack(i,c,Z$),J=h.unpack(r,c,b0e),q=d0e(J,ve,Q,W),_.latitude=o[B],_.longitude=o[B+1],C.latitude=o[B+2],C.longitude=o[B+3];let He,Ye,Ke,Pe;if(s){let hi=c$e(_,C);He=t.project(_,g$e),Ye=t.project(C,_$e);let ao=sg(Ye,He,T0e);ao.y=Math.abs(ao.y),Ke=Q$,Pe=eJ,hi===0||h.dot(ao,h.UNIT_Y)>v0e?(Ke=lD(t,_,Qe,He,Q$),Pe=lD(t,C,J,Ye,eJ)):hi===1?(Pe=lD(t,C,J,Ye,eJ),Ke.x=0,Ke.y=P.sign(_.longitude-Math.abs(C.longitude)),Ke.z=0):(Ke=lD(t,_,Qe,He,Q$),Pe.x=0,Pe.y=P.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(ve,E$e),vt=h.subtract(Q,ve,y$e),jt=h.normalize(vt,x0e),lt=h.subtract(Re,ve,A$e);lt=h.normalize(lt,lt);let mt=h.cross(jt,lt,x0e);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,x$e);ft=h.normalize(ft,ft);let Yt=h.subtract(W,Q,b$e);Yt=h.normalize(Yt,Yt);let rt=h.cross(J,Yt,T$e);rt=h.normalize(rt,rt);let ht=qe/F,Li=Z/F,Yn=0,gi,zi,Si,ui=0,_i=0;if(s){Yn=h.distance(He,Ye),gi=Sn.fromCartesian(He,C$e),zi=h.subtract(Ye,He,T0e),Si=h.normalize(zi,v$e);let hi=Si.x;Si.x=Si.y,Si.y=-hi,ui=Yn/L,_i=ae/L}for(V=0;V<8;V++){let hi=G+V*4,ao=j+V*2,nr=hi+3,jo=V<4?1:-1,Fn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,hi),A[nr]=vt.x,h.pack(st.low,b,hi),b[nr]=vt.y,h.pack(ft,x,hi),x[nr]=vt.z,h.pack(rt,T,hi),T[nr]=ht*jo,h.pack(mt,E,hi);let Vi=Li*Fn;Vi===0&&Fn<0&&(Vi=9),E[nr]=Vi,s&&(v[hi]=gi.high.x,v[hi+1]=gi.high.y,v[hi+2]=gi.low.x,v[hi+3]=gi.low.y,I[hi]=-Ke.y,I[hi+1]=Ke.x,I[hi+2]=Pe.y,I[hi+3]=-Pe.x,S[hi]=zi.x,S[hi+1]=zi.y,S[hi+2]=Si.x,S[hi+3]=Si.y,R[ao]=ui*jo,Vi=_i*Fn,Vi===0&&Fn<0&&(Vi=9),R[ao+1]=Vi)}let zn=m$e,tn=p$e,Hn=d$e,Ki=h$e,wr=ie.fromCartographicArray(u$e,f$e),so=Ni.getMinimumMaximumHeights(wr,u),Ts=so.minimumTerrainHeight,zs=so.maximumTerrainHeight;Ae+=Math.abs(Ts),Ae+=Math.abs(zs),g0e(ve,Re,Ts,zs,zn,Hn),g0e(Q,W,Ts,zs,tn,Ki);let $r=h.multiplyByScalar(mt,P.EPSILON5,E0e);h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),Xk(zn,tn),Xk(Hn,Ki),h.pack(zn,y,k),h.pack(tn,y,k+3),h.pack(Ki,y,k+6),h.pack(Hn,y,k+9),$r=h.multiplyByScalar(mt,-2*P.EPSILON5,E0e),h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),Xk(zn,tn),Xk(Hn,Ki),h.pack(zn,y,k+12),h.pack(tn,y,k+15),h.pack(Ki,y,k+18),h.pack(Hn,y,k+21),B+=2,c+=3,j+=16,k+=24,G+=32,Z+=qe,ae+=Yn}c=0;let fe=0;for(a=0;a<f;a++){for(V=0;V<C0e;V++)m[c+V]=R0e[V]+fe;fe+=8,c+=C0e}let xe=S$e;le.fromVertices(n,h.ZERO,3,xe[0]),le.fromVertices(i,h.ZERO,3,xe[1]);let ge=le.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:uy(A),startLoAndForwardOffsetY:uy(b),startNormalAndForwardOffsetZ:uy(x),endNormalAndTextureCoordinateNormalizationX:uy(T),rightNormalAndTextureCoordinateNormalizationY:uy(E)};return s&&(we.startHiLo2D=uy(v),we.offsetAndRight2D=uy(S),we.startEndNormals2D=uy(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new wt({attributes:we,indices:m,boundingSphere:ge})}function uy(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}fy._projectNormal=lD;var kC=fy;function iJ(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}iJ.clone=function(e,t){if(l(e))return l(t)||(t=new iJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Oh=iJ;var I$e=P.factorial;function rJ(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=rJ(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var P$e=[],oJ=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u,f,d,p=n.length,g=new Array(r);for(s=0;s<r;s++){o[s]=0;let b=new Array(p);for(g[s]=b,a=0;a<p;a++)b[a]=[]}let m=p,y=new Array(m);for(s=0;s<m;s++)y[s]=s;let A=p-1;for(u=0;u<r;u++){for(a=0;a<m;a++)d=y[a]*r+u,g[u][0].push(i[d]);for(s=1;s<m;s++){let b=!1;for(a=0;a<m-s;a++){let x=n[y[a]],T=n[y[a+s]],E;T-x<=0?(d=y[a]*r+r*s+u,E=i[d],g[u][s].push(E/I$e(s))):(E=g[u][s-1][a+1]-g[u][s-1][a],g[u][s].push(E/(T-x))),b=b||E!==0}b||(A=s-1)}}for(c=0,f=0;c<=f;c++)for(s=c;s<=A;s++){let b=rJ(t,y,n,c,s,[]);for(u=0;u<r;u++){let x=g[u][s][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,s,a){let c=r*(s+1);l(a)||(a=new Array(c));for(let x=0;x<c;x++)a[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=P$e,m=D$e(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,s);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=rJ(t,f,n,x,d,y),E=Math.floor(d*(1-d)/2)+p*d;for(let v=0;v<r;v++){let S=Math.floor(v*A),I=g[S+E];a[v+x*r]+=I*T}}return a}};function D$e(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(s=0;s<u-g;s++){let b=n[t[s]],x=n[t[s+g]],T,E;if(x-b<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],E=T/P.factorial(g),e[p+y+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],E=T/(x-b),e[p+y+m]=E,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var $k=oJ;var sJ={};sJ.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),O0e(i,r,o,s);return c};sJ.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),O0e(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function O0e(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var uD=sJ;function R$e(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Jk=R$e;var q0e={},O$e=32.184,M$e=2451545,M0e=-.0529921,N0e=-.1059842,L0e=13.0120009,F0e=13.3407154,B0e=.9856003,k0e=26.4057084,U0e=13.064993,z0e=.3287146,V0e=1.7484877,j0e=-.1589763,H0e=.0036096,G0e=.1643573,W0e=12.9590088,aJ=new K;q0e.ComputeMoon=function(e,t){l(e)||(e=K.now()),aJ=K.addSeconds(e,O$e,aJ);let n=K.totalDays(aJ)-M$e,i=n/Un.DAYS_PER_JULIAN_CENTURY,r=(125.045+M0e*n)*P.RADIANS_PER_DEGREE,o=(250.089+N0e*n)*P.RADIANS_PER_DEGREE,s=(260.008+L0e*n)*P.RADIANS_PER_DEGREE,a=(176.625+F0e*n)*P.RADIANS_PER_DEGREE,c=(357.529+B0e*n)*P.RADIANS_PER_DEGREE,u=(311.589+k0e*n)*P.RADIANS_PER_DEGREE,f=(134.963+U0e*n)*P.RADIANS_PER_DEGREE,d=(276.617+z0e*n)*P.RADIANS_PER_DEGREE,p=(34.226+V0e*n)*P.RADIANS_PER_DEGREE,g=(15.134+j0e*n)*P.RADIANS_PER_DEGREE,m=(119.743+H0e*n)*P.RADIANS_PER_DEGREE,y=(239.961+G0e*n)*P.RADIANS_PER_DEGREE,A=(25.053+W0e*n)*P.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(s),E=Math.sin(a),v=Math.sin(c),S=Math.sin(u),I=Math.sin(f),R=Math.sin(d),O=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(y),w=Math.sin(A),D=Math.cos(r),N=Math.cos(o),F=Math.cos(s),V=Math.cos(a),B=Math.cos(c),j=Math.cos(u),k=Math.cos(f),G=Math.cos(d),q=Math.cos(p),Q=Math.cos(g),W=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ae=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*E+.0072*S-.0052*L+.0043*w)*P.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*D+.0239*N-.0278*F+.0068*V-.0029*j+9e-4*k+8e-4*Q-9e-4*Z)*P.RADIANS_PER_DEGREE,fe=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*E+.0252*v-.0066*S-.0047*I-.0046*R+.0028*O+.0052*L+.004*_+.0019*C-.0044*w)*P.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*D*M0e+.1208*N*N0e-.0642*F*L0e+.0158*V*F0e+.0252*B*B0e-.0066*j*k0e-.0047*k*U0e-.0046*G*z0e+.0028*q*V0e+.0052*Q*j0e+.004*W*H0e+.0019*J*G0e-.0044*Z*W0e)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new Jk),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var Zk=q0e;function Y0e(e){(!l(e)||typeof e!="function")&&(e=Zk.ComputeMoon),this._computeFunction=e}var N$e=new h,L$e=new h,F$e=new h;function B$e(e,t,n){let i=N$e;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=F$e;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,L$e);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var k$e=new $,U$e=new Le;Y0e.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=B$e(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,U$e),s=$.fromQuaternion(Le.conjugate(o,o),k$e);return $.multiply(s,i,i)};var Qk=Y0e;var cJ=class{constructor(){ut(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,s,a){pe.throwInstantiationError()}},X0e=cJ;var K0e={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(K0e);var pp=K0e;var $0e={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze($0e);var dy=$0e;function lJ(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(lJ.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});lJ.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Qb.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ie.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var e3=lJ;function z$e(e){if(!Object.values(dy).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var J0e=Object.freeze({[dy.GOOGLE]:"google",[dy.BING]:"bing",[dy.DEFAULT]:void 0});function V$e(e){return J0e[e]}function j$e(e){return Object.entries(J0e).find(t=>t[1]===e)[0]}function uJ(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??dy.DEFAULT,n=e.accessToken??ff.defaultAccessToken,i=De.createIfNeeded(e.server??ff.defaultServer);i.appendForwardSlash();let r=ff.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new e3(o),this.geocodeProviderType=t}Object.defineProperties(uJ.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return j$e(this._pelias.url.queryParameters.geocoder)},set:function(e){z$e(e);let t={...this._pelias.url.queryParameters,geocoder:V$e(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});uJ.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var UC=uJ;var Z0e={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(Z0e);var Q0e=Z0e;var ege={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(ege);var tge=ege;var nge={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(nge);var t3=nge;var ige={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(ige);var rge=ige;function oge(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function sge(e){let t=he.fromCartesian(e);return{longitude:P.toDegrees(t.longitude),latitude:P.toDegrees(t.latitude),height:t.height}}function H$e(e){let t=[],n=new se;for(let i=0;i<4;i++)M.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function G$e(e,t,n){return M.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var W$e=new M,q$e=new M,n3=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??H.EMPTY_OBJECT;let i=n.accessToken??ff.defaultAccessToken,r=De.createIfNeeded(n.server??ff.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:Yo._addClientHeaders()};l(i)&&(o.queryParameters={access_token:i});let s=r.getDerivedResource(o),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new oe(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=M.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,r){r=r??new M;let o=G$e(n,i,W$e);return M.multiply(t.viewMatrix,this.ecefTransform,r),M.multiply(t.frustum.projectionMatrix,r,r),M.multiply(o,r,r)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,q$e),i={testPoint:sge(t.testPoint),closePoint:sge(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??t3.NEAREST,worldToView:H$e(n)},r;try{r=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(r))return;let o={heat:r.heat,geometryType:r.geomType,parentGeometryType:r.parentGeomType,normal:r.normal,curve:r.curve};return o.snapPoint=oge(r.snapPoint),o.hitPoint=oge(r.hitPoint),o}};n3.DEFAULT_SNAP_APERTURE=12;var age=n3;function vo(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(vo.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var zC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};vo.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=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(zC.start=i,zC.stop=r,zC.isStartIncluded=o,zC.isStopIncluded=s,zC.data=a,new vo(zC))};vo.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};vo.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 vo(e)};vo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};vo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};vo.intersect=function(e,t,n,i){if(!l(t))return vo.clone(vo.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=K.greaterThanOrEquals(s,r)&&K.greaterThanOrEquals(o,s),u=!c&&K.lessThanOrEquals(s,r)&&K.lessThanOrEquals(r,a);if(!c&&!u)return vo.clone(vo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,a);return l(n)||(n=new vo),n.start=c?s:r,n.isStartIncluded=f&&p||!K.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!K.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};vo.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};vo.prototype.clone=function(e){return vo.clone(this,e)};vo.prototype.equals=function(e,t){return vo.equals(this,e,t)};vo.prototype.equalsEpsilon=function(e,t,n){return vo.equalsEpsilon(this,e,t,n)};vo.prototype.toString=function(){return vo.toIso8601(this)};vo.EMPTY=Object.freeze(new vo({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var vn=vo;var cge=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),lge=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),Y$e=Object.freeze(new vn({start:cge,stop:lge})),X$e={MINIMUM_VALUE:cge,MAXIMUM_VALUE:lge,MAXIMUM_INTERVAL:Y$e},nt=X$e;var Xs={};Xs.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Xs.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Xs.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Xs.defaultAccessToken=void 0;Xs.defaultShareKey=void 0;Xs._getAuthorizationHeader=function(){return l(Xs.defaultShareKey)?`Basic ${Xs.defaultShareKey}`:`Bearer ${Xs.defaultAccessToken}`};Xs.apiEndpoint=new De({url:"https://api.bentley.com"});Xs.getExports=async function(e,t){let n=new De({url:`${Xs.apiEndpoint}mesh-export`,headers:{Authorization:Xs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Xs.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};Xs.getRealityDataMetadata=async function(e,t){let n=new De({url:`${Xs.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Xs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};Xs.getRealityDataURL=async function(e,t,n){let i=new De({url:`${Xs.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Xs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,s=new URL(o);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let s=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var fa=Xs;var uge={SHIFT:0,CTRL:1,ALT:2};Object.freeze(uge);var eo=uge;var fJ=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c=n.length;for(s=0;s<r;s++)o[s]=0;for(s=0;s<c;s++){let u=1;for(a=0;a<c;a++)if(a!==s){let f=n[s]-n[a];u*=(t-n[a])/f}for(a=0;a<r;a++)o[a]+=u*i[s*r+a]}return o}},i3=fJ;var dJ=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u=n[0],f=n[1];for(s=0;s<r;s++)a=i[s],c=i[s+r],o[s]=((c-a)*t+f*a-u*c)/(f-u);return o}},tx=dJ;function gp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(gp.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}}});gp.prototype.get=function(e){return this._array[e]};gp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};gp.prototype.peek=function(){return this._array[this._length-1]};gp.prototype.push=function(e){let t=this.length++;this._array[t]=e};gp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};gp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};gp.prototype.resize=function(e){this.length=e};gp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var xu=gp;var hJ=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},fge=hJ;var mJ=[],pJ=[];function K$e(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=mJ,u=pJ,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function gJ(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);gJ(e,t,n,i,o),gJ(e,t,n,o+1,r),K$e(e,t,n,i,o,r)}function $$e(e,t,n){let i=e.length,r=Math.ceil(i*.5);mJ.length=r,pJ.length=r,gJ(e,t,n,0,i-1),mJ.length=0,pJ.length=0}var ag=$$e;function VC(e){e=e??H.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(VC.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});VC.prototype.findTimeInterval=Rr.prototype.findTimeInterval;VC.prototype.wrapTime=Rr.prototype.wrapTime;VC.prototype.clampTime=Rr.prototype.clampTime;VC.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var dge=VC;function md(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}md.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 md(e.near,e.nearValue,e.far,e.farValue)};md.packedLength=4;md.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};md.unpack=function(e,t,n){return t=t??0,l(n)||(n=new md),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};md.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};md.prototype.clone=function(e){return md.clone(this,e)};md.prototype.equals=function(e){return md.equals(this,e)};var qt=md;var hge={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(hge);var Ko=hge;function Kc(e,t){this._occluderPosition=h.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 r3=new h;Object.defineProperties(Kc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,r3),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,r3);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,r3),r3)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});Kc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Kc(e,t)};var pge=new h;Kc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,pge),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var J$e=new h;Kc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,J$e),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,pge),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var Z$e=new h;Kc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Ko.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Z$e),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?Ko.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?Ko.FULL:Ko.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Ko.PARTIAL:Ko.FULL))}}return Ko.NONE};var o3=new h;Kc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,o3),o3),c=-h.dot(a,r),u=Kc._anyRotationVector(r,a,c),f=Kc._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=Kc._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,o3),o3)};var Q$e=[];Kc.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,Q$e),i=le.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return Kc.computeOccludeePoint(new le(r,t.minimumRadius),i.center,n)};var eJe=new h;Kc._anyRotationVector=function(e,t,n){let i=h.abs(t,eJe),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var tJe=new h;Kc._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,tJe);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>P.EPSILON13)return h.normalize(s,new h)}return r};var _J=new h,nJe=new h,s3=new h,mge=new h;Kc._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,_J),s=h.clone(e.center,nJe),a=e.radius,c=h.subtract(s,o,s3),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,mge),mge),x=Math.sqrt(d-A*A),T=this._rotationVector(s,t,n,o,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,_J);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,_J);T=h.normalize(h.subtract(h.add(b,v,s3),s,s3),s3);let S=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,v,T),s,T),T);let I=h.dot(t,T);return S<I?S:I};var a3=Kc;function fD(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(fD.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});fD.fromCartesian3=function(e){return new fD(e.x,e.y,e.z)};fD.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 vr=fD;function yJ(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(yJ.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});yJ.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Mt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:s,lat:a}=i.geometry;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var gge=yJ;var iJe={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},_ge=iJe;var rJe={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},yge=rJe;function oJe(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),s=Math.max(r+o,1);return{width:n.width,height:s,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var nx;function sJe(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,s=t.backgroundColor??z.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(nx)||(l(f.imageSmoothingEnabled)?nx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?nx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?nx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(nx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[nx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=oJe(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+a+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[nx]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??z.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+a,x)}if(r){let T=t.fillColor??z.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+a,x)}return u}var jC=sJe;function hD(){this._cache={}}hD.prototype.fromColor=function(e,t){return c3(void 0,void 0,e,t,this._cache)};hD.prototype.fromUrl=function(e,t,n){return c3(e,void 0,t,n,this._cache)};hD.prototype.fromMakiIconId=function(e,t,n){return c3(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};hD.prototype.fromText=function(e,t,n){return c3(void 0,e,t,n,this._cache)};var aJe=new z;function cJe(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,aJe).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 Age(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var dD=new Array(4);function c3(e,t,n,i,r){dD[0]=e,dD[1]=t,dD[2]=n,dD[3]=i;let o=JSON.stringify(dD),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(cJe(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return Age(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=jC(t,{font:`bold ${i}px sans-serif`});Age(c,u,i)}return r[o]=a,a}var hy=hD;function HC(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}HC.packedLength=Be.packedLength;HC.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var bge=new Be,lJe={vertexFormat:bge};HC.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,bge);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new HC(lJe)};var l3=new h(-.5,-.5,0),u3=new h(.5,.5,0);HC.createGeometry=function(e){let t=e._vertexFormat,n=new En,i,r;if(t.position){if(r=new Float64Array(12),r[0]=l3.x,r[1]=l3.y,r[2]=0,r[3]=u3.x,r[4]=l3.y,r[5]=0,r[6]=u3.x,r[7]=u3.y,r[8]=0,r[9]=l3.x,r[10]=u3.y,r[11]=0,n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new wt({attributes:n,indices:i,primitiveType:Oe.TRIANGLES,boundingSphere:new le(h.ZERO,Math.sqrt(2))})};var f3=HC;function GC(){this._workerName="createPlaneOutlineGeometry"}GC.packedLength=0;GC.pack=function(e,t){return t};GC.unpack=function(e,t,n){return l(n)?n:new GC};var my=new h(-.5,-.5,0),d3=new h(.5,.5,0);GC.createGeometry=function(){let e=new En,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=my.x,n[1]=my.y,n[2]=my.z,n[3]=d3.x,n[4]=my.y,n[5]=my.z,n[6]=d3.x,n[7]=d3.y,n[8]=my.z,n[9]=my.x,n[10]=d3.y,n[11]=my.z,e.position=new Ne({componentDatatype:Y.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 wt({attributes:e,indices:t,primitiveType:Oe.LINES,boundingSphere:new le(h.ZERO,Math.sqrt(2))})};var h3=GC;var uJe=new h;function fJe(e,t,n,i){let r=NE(e,t,n,i,uJe);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var xge=fJe;function fs(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=fs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(fs.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=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var WC=new he,dJe=new h;fs.prototype.getLatitude=function(e){l(e)||(e=ee.default),WC.latitude=this.conformalLatitude,WC.longitude=this.longitude,WC.height=0;let t=this.ellipsoid.cartographicToCartesian(WC,dJe);return e.cartesianToCartographic(t,WC),WC.latitude};var hJe=new gn,mJe=new h,pJe=new h;fs.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=fs.NORTH_POLE_TANGENT_PLANE,r=fs.SOUTH_POLE;n<0&&(i=fs.SOUTH_POLE_TANGENT_PLANE,r=fs.NORTH_POLE);let o=hJe;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,mJe),h.normalize(o.direction,o.direction);let s=bi.rayPlane(o,i.plane,pJe),a=h.subtract(s,r,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new fs(new U(c,u),i)};fs.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]=fs.fromCartesian(e[i],t[i]);return t};fs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new fs(e.position,e.tangentPlane)};fs.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));fs.NORTH_POLE=Object.freeze(new h(0,0,.5));fs.SOUTH_POLE=Object.freeze(new h(0,0,-.5));fs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new qs(fs.NORTH_POLE,fs.HALF_UNIT_SPHERE));fs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new qs(fs.SOUTH_POLE,fs.HALF_UNIT_SPHERE));var Nl=fs;var gJe=new he,Tge=new he;function _Je(e,t,n,i){let o=i.cartesianToCartographic(e,gJe).height,s=i.cartesianToCartographic(t,Tge);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Tge);a.height=o-100,i.cartographicToCartesian(a,n)}var Ege=new et,yJe=new h,AJe=new h,bJe=new h,xJe=new h,TJe=new h,EJe=new h,m3=new h,_p=new h,qC=new h,CJe=new U,vJe=new U,SJe=new h,Cge=new Le,wJe=new $,IJe=new $;function AJ(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=CJe;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,x;t.normal&&(y&&c&&!a?x=n.attributes.normal.values:x=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,S=0,I=0,R=AJe,O=bJe,L=xJe,_=!0,C=wJe,w=IJe;if(m!==0){let F=Le.fromAxisAngle(d,m,Cge);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,Cge),w=$.fromQuaternion(F,w)}else C=$.clone($.IDENTITY,C),w=$.clone($.IDENTITY,w);let D=0,N=0;c&&u&&(D=s/2,N=s/3,s/=2);for(let F=0;F<s;F+=3){let V=h.fromArray(r,F,SJe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,yJe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],vJe)[0];U.subtract(j,A,j);let k=P.clamp(j.x/f.width,0,1),G=P.clamp(j.y/f.height,0,1);u&&(b[S+N]=k,b[S+1+N]=G),c&&(b[S]=k,b[S+1]=G),S+=2}if(t.normal||t.tangent||t.bitangent||i){let B=I+1,j=I+2;if(a){if(F+3<s){let k=h.fromArray(r,F+3,TJe);if(_){let G=h.fromArray(r,F+s,EJe);y&&_Je(V,k,G,g),h.subtract(k,V,k),h.subtract(G,V,G),R=h.normalize(h.cross(G,k,R),R),_=!1}h.equalsEpsilon(k,V,P.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(V,L),t.tangent&&(O=h.normalize(h.cross(L,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(m3=h.fromArray(x,I,m3),_p=h.cross(h.UNIT_Z,m3,_p),_p=h.normalize($.multiplyByVector(w,_p,_p),_p),t.bitangent&&(qC=h.normalize(h.cross(m3,_p,qC),qC))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(w,O,O),O),t.bitangent&&(L=h.normalize(h.cross(R,O,L),L)));t.normal&&(e.wall?(x[I+D]=R.x,x[B+D]=R.y,x[j+D]=R.z):u&&(x[I+D]=-R.x,x[B+D]=-R.y,x[j+D]=-R.z),(c&&!y||a)&&(x[I]=R.x,x[B]=R.y,x[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(V,R)),v[I+D]=-R.x,v[B+D]=-R.y,v[j+D]=-R.z),t.tangent&&(e.wall?(T[I+D]=O.x,T[B+D]=O.y,T[j+D]=O.z):u&&(T[I+D]=-O.x,T[B+D]=-O.y,T[j+D]=-O.z),c&&(y?(T[I]=_p.x,T[B]=_p.y,T[j]=_p.z):(T[I]=O.x,T[B]=O.y,T[j]=O.z))),t.bitangent&&(u&&(E[I+D]=L.x,E[B+D]=L.y,E[j+D]=L.z),c&&(y?(E[I]=qC.x,E[B]=qC.y,E[j]=qC.z):(E[I]=L.x,E[B]=L.y,E[j]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===pn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===pn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var vge=[];function PJe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=Qn.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,E=x.indices,v,S;if(s&&a){let I=T.concat(T);v=I.length/3,S=je.createTypedArray(v,E.length*2),S.set(E);let R=E.length,O=v/2;for(d=0;d<R;d+=3){let L=S[d]+O,_=S[d+1]+O,C=S[d+2]+O;S[d+R]=C,S[d+1+R]=_,S[d+2+R]=L}if(x.attributes.position.values=I,o&&c.normal){let L=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(I.length),x.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=x.attributes.st.values;x.attributes.st.values=new Float32Array(v*2),x.attributes.st.values=L.concat(L)}x.indices=S}else if(a){for(v=T.length/3,S=je.createTypedArray(v,E.length),d=0;d<E.length;d+=3)S[d]=E[d+2],S[d+1]=E[d+1],S[d+2]=E[d];x.indices=S}f.topAndBottom=new Bt({geometry:x})}let p=r.outerRing,g=qs.fromPoints(p,e),m=g.projectPointsOntoPlane(p,vge),y=di.computeWindingOrder2D(m);y===sa.CLOCKWISE&&(p=p.slice().reverse());let A=Qn.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Bt({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,vge),y=di.computeWindingOrder2D(m),y===sa.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=Qn.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Bt({geometry:A}))}return f}function gd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??ee.default,r=e.granularity??P.RADIANS_PER_DEGREE,o=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=ee.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Qn.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?Qn.computeHierarchyPackedLength(s,U):1)+12}gd.fromPositions=function(e){e=e??H.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 gd(t)};gd.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=Qn.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var DJe=ee.clone(ee.UNIT_SPHERE),RJe=new Be,OJe={polygonHierarchy:{}};gd.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,DJe);t+=ee.packedLength;let o=Be.unpack(e,t,RJe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:Qn.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new gd(OJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var MJe=new U,NJe=new U,LJe=new Nl;function Sge(e,t,n,i,r,o){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,a),r.eastOverIdl=Math.max(r.eastOverIdl,a),o.west=Math.min(o.west,s),o.east=Math.max(o.east,s);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==ln.RHUMB){let p=U.subtract(t.position,e.position,MJe),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let m=U.add(t.position,U.multiplyByScalar(p,-g,p),NJe),y=Nl.clone(t,LJe);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=U.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var wge=new Nl,FJe=new Nl,pd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};gd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),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,pd.northAngle=0,pd.southAngle=0,pd.westOverIdl=Number.POSITIVE_INFINITY,pd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=Nl.fromCartesian(e[0],FJe);for(let s=1;s<r;s++){let a=Nl.fromCartesian(e[s],wge);Sge(a,o,t,n,pd,i),o=Nl.clone(a,o)}return Sge(Nl.fromCartesian(e[0],wge),o,t,n,pd,i),i.east-i.west>pd.eastOverIdl-pd.westOverIdl&&(i.west=pd.westOverIdl,i.east=pd.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(pd.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(pd.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var BJe=new Nl;function kJe(e,t,n){return e.height>=P.PI||e.width>=P.PI?Nl.fromCartesian(t[0],BJe).tangentPlane:qs.fromPoints(t,n)}var Ige=new he;function UJe(e,t,n){return(i,r)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Ige);r[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return r.length=i.length,r}return Nl.fromCartesianArray(i,r)}return qs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function zJe(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(r,o)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(r,Ige);return l(o)||(o=new U),o.x=s.longitude/P.PI,o.y=s.latitude/P.PI_OVER_TWO,o}return Nl.fromCartesian(r,o)};let i=qs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function VJe(e,t,n,i){return(r,o)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?Qn.splitPolygonsOnEquator(r,t,n,o):r}function jJe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return et.fromRectangle(t,void 0,Ege);let r=e,o=qs.fromPoints(r,n);return Qn.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,Ege)}gd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=Qn.polygonsFromHierarchy(o,d,UJe(g,p,n),!s,n,VJe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(D){return D},x=d?Qn.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=jJe(T,g,n,r),v=[],S=e._height,I=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(S,I,0,P.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:kJe(g,T,n).plane.normal,projectTo2d:zJe(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<A.length;L++){let D=PJe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=D.topAndBottom,O.geometry=Qn.scaleToGeodeticHeightExtruded(N.geometry,S,I,n,s)):a?(N=D.topAndBottom,N.geometry.attributes.position.values=di.scaleToGeodeticHeight(N.geometry.attributes.position.values,S,n,!s),O.geometry=N.geometry):c&&(N=D.topAndBottom,N.geometry.attributes.position.values=di.scaleToGeodeticHeight(N.geometry.attributes.position.values,I,n,!0),O.geometry=N.geometry),(a||c)&&(O.wall=!1,N.geometry=AJ(O),v.push(N));let F=D.walls;O.wall=!0;for(let V=0;V<F.length;V++){let B=F[V];O.geometry=Qn.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=AJ(O),v.push(B)}}else for(L=0;L<A.length;L++){let D=new Bt({geometry:Qn.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(D.geometry.attributes.position.values=di.scaleToGeodeticHeight(D.geometry.attributes.position.values,S,n,!s),O.geometry=D.geometry,D.geometry=AJ(O),l(e._offsetAttribute)){let N=D.geometry.attributes.position.values.length,F=e._offsetAttribute===pn.NONE?0:1,V=new Uint8Array(N/3).fill(F);D.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}v.push(D)}let _=Wn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=le.fromVertices(C.position.values);return t.position||delete C.position,new wt({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};gd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new gd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function HJe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return wt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(gd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=gd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=HJe(this)),this._textureCoordinateRotationPoints}}});var cg=gd;var Pge=[],p3=[];function GJe(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,Pge);di.computeWindingOrder2D(s)===sa.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)m+=Qn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=Qn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===ln.GEODESIC?y=Qn.subdivideLine(t[u],t[(u+1)%f],n,p3):r===ln.RHUMB&&(y=Qn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,p3));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=je.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Bt({geometry:new wt({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function WJe(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,Pge);di.computeWindingOrder2D(s)===sa.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)A+=Qn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=Qn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===ln.GEODESIC?b=Qn.subdivideLine(t[u],t[(u+1)%f],n,p3):r===ln.RHUMB&&(b=Qn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,p3));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=je.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Bt({geometry:new wt({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function ix(e){let t=e.polygonHierarchy,n=e.ellipsoid??ee.default,i=e.granularity??P.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Qn.computeHierarchyPackedLength(t,h)+ee.packedLength+8}ix.pack=function(e,t,n){return n=n??0,n=Qn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var qJe=ee.clone(ee.UNIT_SPHERE),YJe={polygonHierarchy:{}};ix.unpack=function(e,t,n){t=t??0;let i=Qn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,qJe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new ix(YJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};ix.fromPositions=function(e){e=e??H.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 ix(t)};ix.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=Qn.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=WJe(t,s[m],u,r,o),a.geometry=Qn.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===pn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===pn.NONE?0:1,x=x.fill(g)),a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}else for(m=0;m<s.length;m++){if(a=GJe(t,s[m],u,r,o),a.geometry.attributes.position.values=di.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===pn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}let y=Wn.combineInstances(c)[0],A=le.fromVertices(y.attributes.position.values);return new wt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var g3=ix;var Nge=[];function XJe(e,t,n,i,r){let o=Nge;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let y=(d-a)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*y,c+s*A,u+s*b,f+s*x);return o}function mD(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+Be.packedLength+4}mD.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Lge=ee.clone(ee.UNIT_SPHERE),Fge=new Be,rx={positions:void 0,colors:void 0,ellipsoid:Lge,vertexFormat:Fge,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};mD.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Lge);t+=ee.packedLength;let c=Be.unpack(e,t,Fge);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(rx.positions=o,rx.colors=s,rx.width=u,rx.colorsPerVertex=f,rx.arcType=d,rx.granularity=p,new mD(rx))};var Dge=new h,Rge=new h,Oge=new h,Mge=new h;mD.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Lr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let N=0,F=d[0];i=i.filter(function(V,B){let j;return r?j=B===F||B===0&&F===1:j=B+1===F,j?(N++,F=d[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===ln.GEODESIC||o===ln.RHUMB){let N,F;o===ln.GEODESIC?(N=P.chordLength(s,a.maximumRadius),F=cr.numberOfPoints):(N=s,F=cr.numberOfPointsRhumbLine);let V=cr.extractHeights(p,a);if(l(i)){let B=1;for(c=0;c<g-1;++c)B+=F(p[c],p[c+1],N);let j=new Array(B),k=0;for(c=0;c<g-1;++c){let G=p[c],q=p[c+1],Q=i[c],W=F(G,q,N);if(r&&c<B){let J=i[c+1],Z=XJe(G,q,Q,J,W),ae=Z.length;for(u=0;u<ae;++u)j[k++]=Z[u]}else for(u=0;u<W;++u)j[k++]=z.clone(Q)}j[k]=z.clone(i[i.length-1]),i=j,Nge.length=0}o===ln.GEODESIC?p=cr.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:V}):p=cr.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,S=0,I=0,R=0,O;for(u=0;u<g;++u){u===0?(O=Dge,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,Oge),h.clone(p[u],Rge),u===g-1?(O=Dge,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,Mge);let N,F;l(E)&&(u!==0&&!r?N=i[u-1]:N=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,B=u===g-1?2:4;for(f=V;f<B;++f){h.pack(Rge,y,v),h.pack(Oge,A,v),h.pack(Mge,b,v),v+=3;let j=f-2<0?-1:1;if(x[S++]=2*(f%2)-1,x[S++]=j*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(x[S-2],0)),l(E)){let k=f<2?N:F;E[R++]=z.floatToByte(k.red),E[R++]=z.floatToByte(k.green),E[R++]=z.floatToByte(k.blue),E[R++]=z.floatToByte(k.alpha)}}}let L=new En;L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.nextPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=je.createTypedArray(m,g*6-6),C=0,w=0,D=g-1;for(u=0;u<D;++u)_[w++]=C,_[w++]=C+2,_[w++]=C+1,_[w++]=C+1,_[w++]=C+2,_[w++]=C+3,C+=4;return new wt({attributes:L,indices:_,primitiveType:Oe.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:mh.POLYLINES})};var py=mD;function KJe(e,t,n,i){let r=new En;i.position&&(r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=di.triangulate(t),u=(a-1)*o*6+c.length*2,f=je.createTypedArray(s,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),S=1/(a-1),I=1/n.height,R=n.height/2,O,L,_=0;for(d=0;d<a;d++){for(O=d*S,L=I*(t[0].y+R),v[_++]=O,v[_++]=L,p=1;p<o;p++)L=I*(t[p].y+R),v[_++]=O,v[_++]=L,v[_++]=O,v[_++]=L;L=I*(t[0].y+R),v[_++]=O,v[_++]=L}for(p=0;p<o;p++)O=0,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;for(p=0;p<o;p++)O=(a-1)*S,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,S=c[d+1]+T,I=c[d+2]+T;f[x++]=v,f[x++]=S,f[x++]=I,f[x++]=I+o,f[x++]=S+o,f[x++]=v+o}let E=new wt({attributes:r,indices:f,boundingSphere:le.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Wn.computeNormal(E)),i.tangent||i.bitangent){try{E=Wn.computeTangentAndBitangent(E)}catch{yt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function gD(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??ar.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Be.packedLength+2}gD.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Bge=ee.clone(ee.UNIT_SPHERE),kge=new Be,pD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Bge,vertexFormat:kge,cornerType:void 0,granularity:void 0};gD.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Bge);t+=ee.packedLength;let c=Be.unpack(e,t,kge);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(pD.polylinePositions=o,pD.shapePositions=s,pD.cornerType=u,pD.granularity=f,new gD(pD))};var $Je=new et;gD.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=fp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;di.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,$Je),o=fp.computePositions(n,i,r,e,!0);return KJe(o,i,r,e._vertexFormat)};var _3=gD;function JJe(e,t){let n=new En;n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=je.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new wt({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:le.fromVertices(e),primitiveType:Oe.LINES})}function yD(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??ar.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}yD.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Uge=ee.clone(ee.UNIT_SPHERE),_D={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Uge,height:void 0,cornerType:void 0,granularity:void 0};yD.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Uge);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(_D.polylinePositions=o,_D.shapePositions=s,_D.cornerType=c,_D.granularity=u,new yD(_D))};var ZJe=new et;yD.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=fp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;di.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,ZJe),o=fp.computePositions(n,i,r,e,!1);return JJe(o,i)};var y3=yD;function zge(){pe.throwInstantiationError()}zge.prototype.getURL=pe.throwInstantiationError;var Vge=zge;function QJe(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function YC(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=QJe(this),this._lastTimeIndex=0}Object.defineProperties(YC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});YC.prototype.findTimeInterval=Rr.prototype.findTimeInterval;YC.prototype.wrapTime=Rr.prototype.wrapTime;YC.prototype.clampTime=Rr.prototype.clampTime;YC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var A3=YC;function b3(e,t,n=0,i=e.length-1,r=eZe){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));b3(e,t,g,m,r)}let o=e[t],s=n,a=i;for(AD(e,n,t),r(e[i],o)>0&&AD(e,n,i);s<a;){for(AD(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?AD(e,n,a):(a++,AD(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function AD(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function eZe(e,t){return e<t?-1:e>t?1:0}var TD=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!T3(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?r(a):a;T3(t,c)&&(n.leaf?i.push(a):xJ(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!T3(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],s=n.leaf?this.toBBox(o):o;if(T3(t,s)){if(n.leaf||xJ(t,s))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=KC([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],s=[],a,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],a=s.pop(),u=!0),i.leaf){let f=tZe(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&xJ(i,r)?(o.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,s=this._maxEntries,a;if(o<=s)return a=KC(t.slice(n,i+1)),XC(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=KC([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));jge(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);jge(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);a.children.push(this._build(t,p,g,r-1))}}return XC(a,this.toBBox),a}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=bJ(u),d=rZe(t,u)-f;d<s?(s=d,o=f<o?f:o,a=u):d===s&&f<o&&(o=f,a=u)}n=a||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],s=this._chooseSubtree(r,this.data,n,o);for(s.children.push(t),xD(s,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let s=this._chooseSplitIndex(i,o,r),a=KC(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,XC(i,this.toBBox),XC(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=KC([t,n]),this.data.height=t.height+1,this.data.leaf=!1,XC(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=bD(t,0,a,this.toBBox),u=bD(t,a,i,this.toBBox),f=oZe(c,u),d=bJ(c)+bJ(u);f<o?(o=f,r=a,s=d<s?d:s):f===o&&d<s&&(s=d,r=a)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:nZe,o=t.leaf?this.compareMinY:iZe,s=this._allDistMargin(t,n,i,r),a=this._allDistMargin(t,n,i,o);s<a&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,s=bD(t,0,n,o),a=bD(t,i-n,i,o),c=x3(s)+x3(a);for(let u=n;u<i-n;u++){let f=t.children[u];xD(s,t.leaf?o(f):f),c+=x3(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];xD(a,t.leaf?o(f):f),c+=x3(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)xD(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():XC(t[n],this.toBBox)}};function tZe(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function XC(e,t){bD(e,0,e.children.length,t,e)}function bD(e,t,n,i,r){r||(r=KC(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let s=e.children[o];xD(r,e.leaf?i(s):s)}return r}function xD(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function nZe(e,t){return e.minX-t.minX}function iZe(e,t){return e.minY-t.minY}function bJ(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function x3(e){return e.maxX-e.minX+(e.maxY-e.minY)}function rZe(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function oZe(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function xJ(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function T3(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function KC(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jge(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;b3(e,s,t,n,r),o.push(t,s,s,n)}}function E3(){this._tree=new TD}function ox(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}ox.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};E3.prototype.insert=function(e,t){let n=ox.fromRectangleAndId(e,t,new ox);this._tree.insert(n)};function sZe(e,t){return e.id===t.id}var aZe=new ox;E3.prototype.remove=function(e,t){let n=ox.fromRectangleAndId(e,t,aZe);this._tree.remove(n,sZe)};var cZe=new ox;E3.prototype.collides=function(e){let t=ox.fromRectangleAndId("",e,cZe);return this._tree.collides(t)};var $C=E3;var Hge=Math.cos,Gge=Math.sin,lZe=Math.sqrt,TJ={};TJ.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Hge(f),p=Gge(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Hge(m),A=d*Gge(m),b=a.x*y,x=a.y*A,T=lZe(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+r*e.stGranXSin,m=E.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var uZe=new $i,_d=new h,fZe=new he,C3=new h,ED=new ji;function Wge(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;ED._ellipsoid=ee.default,_d=ED.project(e,_d),_d=h.subtract(_d,C3,_d);let g=$i.fromRotation(t,uZe);_d=$i.multiplyByVector(g,_d,_d),_d=h.add(_d,C3,_d),e=ED.unproject(_d,e),o-=1,s-=1;let m=e.latitude,y=m+o*p,A=m-c*s,b=m-c*s+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),E=e.longitude,v=E+o*u,S=E+s*d,I=E+s*d+o*u,R=Math.max(E,v,S,I),O=Math.min(E,v,S,I);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}TJ.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),E=ie.center(e,fZe);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=P.TWO_PI),ED._ellipsoid=ee.default,C3=ED.project(E,C3));let v=x,S=b,I=0,R=0,O=ie.clone(e,r),L={granYCos:v,granYSin:I,granXCos:S,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Wge(T,n,b,x,E,y,A);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,s),C=Wge(_,n,b,x,E,y,A);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var Ra=TJ;var EJ=new h,Xge=new h,Kge=new h,$ge=new h,Jge=new ie,dZe=new U,hZe=new le,mZe=new le;function Zge(e,t){let n=new wt({attributes:new En,primitiveType:Oe.TRIANGLES});return n.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function pZe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=$ge,f=Kge,d=Xge;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,EJ),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return Zge(t,{positions:e,normals:o,tangents:s,bitangents:a})}var CJ=new h,Qge=new h;function gZe(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=$ge,p=Kge,g=Xge;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,EJ),A=h.fromArray(e,(m+6)%i,CJ);if(f){let b=h.fromArray(e,(m+3)%i,Qge);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return Zge(t,{positions:e,normals:r,tangents:o,bitangents:s})}function e_e(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=EJ,b=dZe,x=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let w=0;w<o;++w)Ra.computePosition(t,i,n.st,C,w,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y));if(s&&(Ra.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,E=b.x,v=b.y)),a&&(Ra.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y))),n.st&&(x<0||T<0||E>1||v>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-x)/(E-x),g[C+1]=(g[C+1]-T)/(v-T);let S=pZe(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let R=je.createTypedArray(d,I),O=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<o-1;++C){let w=O,D=w+o,N=D+1,F=w+1;R[L++]=w,R[L++]=D,R[L++]=F,R[L++]=F,R[L++]=D,R[L++]=N,++O}++O}if(s||a){let C=d-1,w=d-1;s&&a&&(C=d-2);let D,N;if(O=0,s)for(_=0;_<o-1;_++)D=O,N=D+1,R[L++]=C,R[L++]=D,R[L++]=N,++O;if(a)for(O=(f-1)*o,_=0;_<o-1;_++)D=O,N=D+1,R[L++]=D,R[L++]=w,R[L++]=N,++O}return S.indices=R,n.st&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),S}function JC(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function ZC(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 vJ=new Be;function _Ze(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Be.clone(r,vJ);Pe.normal=!0,e._vertexFormat=Pe}let d=e_e(e,t);n&&(e._vertexFormat=r);let p=di.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=di.scaleToGeodeticHeight(d.attributes.position.values,o,a);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,E=r.st?new Float32Array(m/3*2):void 0,v,S;if(r.normal){for(S=d.attributes.normal.values,b.set(S),f=0;f<g;f++)S[f]=-S[f];b.set(S,g),d.attributes.normal.values=b}if(n){S=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)S[f]=-S[f];Pe.set(S,g),d.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let I,R=l(i);if(R){let Pe=g/3*2,qe=new Uint8Array(Pe);i===pn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===pn.NONE?0:1,qe=qe.fill(I)),d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}if(r.tangent){let Pe=d.attributes.tangent.values;for(x.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];x.set(Pe,g),d.attributes.tangent.values=x}if(r.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let O=d.indices,L=O.length,_=g/3,C=je.createTypedArray(m/3,L*2);for(C.set(O),f=0;f<L;f+=3)C[f+L]=O[f+2]+_,C[f+1+L]=O[f+1]+_,C[f+2+L]=O[f]+_;d.indices=C;let w=t.northCap,D=t.southCap,N=c,F=2,V=0,B=4,j=4;w&&(F-=1,N-=1,V+=1,B-=2,j-=1),D&&(F-=1,N-=1,V+=1,B-=2,j-=1),V+=F*u+2*N-B;let k=(V+j)*2,G=new Float64Array(k*3),q=n?new Float32Array(k*3):void 0,Q=R?new Uint8Array(k):void 0,W=r.st?new Float32Array(k*2):void 0,J=i===pn.TOP;R&&!J&&(I=i===pn.ALL?1:0,Q=Q.fill(I));let Z=0,ae=0,Ae=0,fe=0,xe=u*N,ge;for(f=0;f<xe;f+=u)ge=f*3,G=JC(G,Z,ge,p,A),Z+=6,r.st&&(W=ZC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(D){let Pe=w?xe+1:xe;for(ge=Pe*3,f=0;f<2;f++)G=JC(G,Z,ge,p,A),Z+=6,r.st&&(W=ZC(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=xe-u;f<xe;f++)ge=f*3,G=JC(G,Z,ge,p,A),Z+=6,r.st&&(W=ZC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);for(f=xe-1;f>0;f-=u)ge=f*3,G=JC(G,Z,ge,p,A),Z+=6,r.st&&(W=ZC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(w){let Pe=xe;for(ge=Pe*3,f=0;f<2;f++)G=JC(G,Z,ge,p,A),Z+=6,r.st&&(W=ZC(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=u-1;f>=0;f--)ge=f*3,G=JC(G,Z,ge,p,A),Z+=6,r.st&&(W=ZC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);let we=gZe(G,r,a);r.st&&(we.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:W})),n&&(we.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),R&&(we.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let ve=je.createTypedArray(k,V*6),Re,Qe,He,Ye;g=G.length/3;let Ke=0;for(f=0;f<g-1;f+=2){Re=f,Ye=(Re+2)%g;let Pe=h.fromArray(G,Re*3,CJ),qe=h.fromArray(G,Ye*3,Qge);h.equalsEpsilon(Pe,qe,P.EPSILON10)||(Qe=(Re+1)%g,He=(Qe+2)%g,ve[Ke++]=Re,ve[Ke++]=Qe,ve[Ke++]=Ye,ve[Ke++]=Ye,ve[Ke++]=Qe,ve[Ke++]=He)}return we.indices=ve,we=Wn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var yZe=[new h,new h,new h,new h],t_e=new he,AZe=new he;function SJ(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Ra.computeOptions(e,t,n,0,Jge,t_e),s=o.height,a=o.width,c=yZe;return Ra.computePosition(o,i,!1,0,0,c[0]),Ra.computePosition(o,i,!1,0,a-1,c[1]),Ra.computePosition(o,i,!1,s-1,0,c[2]),Ra.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function yp(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}yp.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;yp.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.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]=e._offsetAttribute??-1,t};var n_e=new ie,i_e=ee.clone(ee.UNIT_SPHERE),gy={rectangle:n_e,ellipsoid:i_e,vertexFormat:vJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};yp.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,n_e);t+=ie.packedLength;let r=ee.unpack(e,t,i_e);t+=ee.packedLength;let o=Be.unpack(e,t,vJ);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(gy.granularity=s,gy.height=a,gy.rotation=c,gy.stRotation=u,gy.extrudedHeight=f,gy.shadowVolume=d,gy.offsetAttribute=p===-1?void 0:p,new yp(gy))};yp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??P.RADIANS_PER_DEGREE,r=e.ellipsoid??ee.default,o=e.rotation??0;return SJ(n,i,o,r,t)};var bZe=new $,qge=new Le,xZe=new he;yp.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=Ra.computeOptions(t,e._granularity,i,r,Jge,t_e,AZe),a=bZe;if(r!==0||i!==0){let g=ie.center(t,xZe),m=n.geodeticSurfaceNormalCartographic(g,CJ);Le.fromAxisAngle(m,-r,qge),$.fromQuaternion(qge,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=_Ze(e,s);let g=le.fromRectangle3D(t,n,c,mZe),m=le.fromRectangle3D(t,n,u,hZe);p=le.union(g,m)}else{if(d=e_e(e,s),d.attributes.position.values=di.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===pn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=le.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new wt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};yp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new yp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var Yge=new ie,TZe=[new U,new U,new U],EZe=new $i,CZe=new he;function vZe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,Yge),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=SJ(t,n,r,i,Yge),s=TZe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=$i.fromRotation(e._stRotation,EZe),u=ie.center(a,CZe);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,$i.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return U.pack(f,g),U.pack(d,g,2),U.pack(p,g,4),g}Object.defineProperties(yp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=SJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=vZe(this)),this._textureCoordinateRotationPoints}}});var QC=yp;var SZe=new le,wZe=new le,IZe=new h,PZe=new ie;function r_e(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,y=IZe;if(o)Ra.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)Ra.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)Ra.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)Ra.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)Ra.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=je.createTypedArray(d.length/3,A),x=0;for(let E=0;E<d.length/3-1;E++)b[x++]=E,b[x++]=E+1;b[x++]=d.length/3-1,b[x]=0;let T=new wt({attributes:new En,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function DZe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=r_e(e,t),s=t.height,a=t.width,c=di.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=di.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=je.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=s-1;else{let T=a-1;A[b++]=T,A[b++]=T+u,x=a+s-2}if(A[b++]=x,A[b++]=x+u,!g){let T=a+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function tv(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??P.RADIANS_PER_DEGREE,i=e.ellipsoid??ee.default,r=e.rotation??0,o=e.height??0,s=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}tv.packedLength=ie.packedLength+ee.packedLength+5;tv.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var o_e=new ie,s_e=ee.clone(ee.UNIT_SPHERE),ev={rectangle:o_e,ellipsoid:s_e,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};tv.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,o_e);t+=ie.packedLength;let r=ee.unpack(e,t,s_e);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(ev.granularity=o,ev.height=s,ev.rotation=a,ev.extrudedHeight=c,ev.offsetAttribute=u===-1?void 0:u,new tv(ev))};var RZe=new he;tv.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ra.computeOptions(t,e._granularity,e._rotation,0,PZe,RZe),r,o;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(r=DZe(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===pn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===pn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=le.fromRectangle3D(t,n,s,wZe),d=le.fromRectangle3D(t,n,a,SZe);o=le.union(f,d)}else{if(r=r_e(e,i),r.attributes.position.values=di.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===pn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=le.fromRectangle3D(t,n,s)}return new wt({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var nv=tv;var a_e={FIXED:0,INERTIAL:1};Object.freeze(a_e);var Wi=a_e;var sx=30,OZe=1<<sx,MZe=1<<sx+1>>>0,wJ=2*sx+1,_y=4,u_e=[],f_e=[],NZe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],yy=1,iv=2,v3=[yy,0,0,yy|iv];function Rs(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Rs.getLevel(e)}Rs.fromToken=function(e){return new Rs(Rs.getIdFromToken(e))};Rs.isValidId=function(e){return!(e<=0||e>>BigInt(wJ)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Rs.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Rs.isValidId(Rs.getIdFromToken(e)):!1};Rs.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Rs.getTokenFromId=function(e){let t=Math.floor(GZe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Rs.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return sx-(t>>1)};Rs.prototype.getChild=function(e){let t=m_e(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Rs(n)};Rs.prototype.getParent=function(){let e=m_e(this._cellId)<<BigInt(2);return new Rs(this._cellId&~e+BigInt(1)|e)};Rs.prototype.getParentAtLevel=function(e){let t=jZe(e);return new Rs(this._cellId&-t|t)};Rs.prototype.getCenter=function(e){e=e??ee.WGS84;let t=LZe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Rs.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=FZe(this._cellId,this._level,e);n=h.normalize(n,n);let i=he.fromCartesian(n,ee.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Rs.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(wJ-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Rs(a)};function LZe(e,t){let n=BZe(e,t);return kZe(n[0],n[1],n[2])}function FZe(e,t,n){let i=d_e(e,t),r=UZe([i[1],i[2]],t),o=n>>1&1;return h_e(i[0],r[0][o^n&1],r[1][o])}function BZe(e,t){let n=d_e(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function d_e(e){u_e.length===0&&VZe();let t=Number(e>>BigInt(wJ)),n=t&yy,i=(1<<_y)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?sx-7*_y:_y))-1;n+=Number(e>>BigInt(s*2*_y+1)&BigInt(c))<<2,n=f_e[n];let u=s*_y;r+=n>>_y+2<<u,o+=(n>>2&i)<<u,n&=yy|iv}return[t,r,o]}function kZe(e,t,n){let i=c_e(t),r=c_e(n),o=S3(i),s=S3(r);return h_e(e,o,s)}function h_e(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function S3(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function c_e(e){return 1/MZe*e}function UZe(e,t){let n=[[],[]],i=zZe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=S3(l_e(o)),n[r][1]=S3(l_e(s))}return n}function zZe(e){return 1<<sx-e>>>0}function l_e(e){return 1/OZe*e}function Ay(e,t,n,i,r,o){if(e===_y){let s=(t<<_y)+n;u_e[(s<<2)+i]=(r<<2)+o,f_e[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=NZe[o];Ay(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^v3[0]),Ay(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^v3[1]),Ay(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^v3[2]),Ay(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^v3[3])}}function VZe(){Ay(0,0,0,0,0,0),Ay(0,0,0,yy,0,yy),Ay(0,0,0,iv,0,iv),Ay(0,0,0,yy|iv,0,yy|iv)}function m_e(e){return e&~e+BigInt(1)}function jZe(e){return BigInt(1)<<BigInt(2*(sx-e))}var HZe=[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 GZe(e){return HZe[(-e&e)%BigInt(67)]}var by=Rs;async function WZe(e,t,n,i){return l(i)||(i=!1),XZe(e,t,n,i)}function qZe(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(g_e(i)):o=r.then(g_e(i)).catch(KZe(i)),e.shift(),t.push(o),!0}function YZe(e){return new Promise(function(t){setTimeout(t,e)})}function IJ(e,t,n){return e.length?qZe(e,t,n)?IJ(e,t,n):YZe(100).then(()=>IJ(e,t,n)):Promise.resolve()}function XZe(e,t,n,i){let r=e.tilingScheme,o,s=[],a={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[o])}let c=[];return IJ(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function p_e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function g_e(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!p_e(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];p_e(s,i,n)}}):Promise.resolve()}}function KZe(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var w3=WZe;var PJ=new U;async function __e(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,PJ);let p=e.loadTileDataAvailability(PJ.x,PJ.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return w3(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&a.push(u)}return a.length>0&&await __e(e,a,n),t}var rv=__e;var y_e={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};Object.freeze(y_e);var fn=y_e;function xy(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function LJ(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function ax(e){let t=[];if(e.shiftKey&&t.push(eo.SHIFT),e.ctrlKey&&t.push(eo.CTRL),e.altKey&&t.push(eo.ALT),t.length)return t}var ds={LEFT:0,MIDDLE:1,RIGHT:2};function gf(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function $Ze(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(gf(e,"pointerdown",t,nQe),gf(e,"pointerup",t,I_e),gf(e,"pointermove",t,iQe),gf(e,"pointercancel",t,I_e)):(gf(e,"mousedown",t,P_e),gf(e,"mouseup",n,D_e),gf(e,"mousemove",n,R_e),gf(e,"touchstart",t,eQe),gf(e,"touchend",n,E_e),gf(e,"touchmove",n,tQe),gf(e,"touchcancel",n,E_e)),gf(e,"dblclick",t,ZZe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",gf(e,i,t,QZe)}function JZe(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var A_e={position:new U};function FJ(e){e._lastSeenTouchEvent=xn()}function BJ(e){return xn()-e._lastSeenTouchEvent>Mh.mouseEmulationIgnoreMilliseconds}function NJ(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function P_e(e,t){if(!BJ(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ds.LEFT)i=fn.LEFT_DOWN;else if(n===ds.MIDDLE)i=fn.MIDDLE_DOWN;else if(n===ds.RIGHT)i=fn.RIGHT_DOWN;else return;let r=xy(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=ax(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,A_e.position),s(A_e),t.preventDefault())}var b_e={position:new U},x_e={position:new U};function DJ(e,t,n,i){let r=ax(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=xy(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,b_e.position),o(b_e)),l(s)){let c=e._primaryStartPosition;NJ(c,a,e._clickPixelTolerance)&&(U.clone(a,x_e.position),s(x_e))}}}function D_e(e,t){if(!BJ(e))return;let n=t.button;n!==ds.LEFT&&n!==ds.MIDDLE&&n!==ds.RIGHT||(e._buttonDown[ds.LEFT]&&(DJ(e,fn.LEFT_UP,fn.LEFT_CLICK,t),e._buttonDown[ds.LEFT]=!1),e._buttonDown[ds.MIDDLE]&&(DJ(e,fn.MIDDLE_UP,fn.MIDDLE_CLICK,t),e._buttonDown[ds.MIDDLE]=!1),e._buttonDown[ds.RIGHT]&&(DJ(e,fn.RIGHT_UP,fn.RIGHT_CLICK,t),e._buttonDown[ds.RIGHT]=!1))}var RJ={startPosition:new U,endPosition:new U};function R_e(e,t){if(!BJ(e))return;let n=ax(t),i=xy(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(fn.MOUSE_MOVE,n);l(o)&&(U.clone(r,RJ.startPosition),U.clone(i,RJ.endPosition),o(RJ)),U.clone(i,r),(e._buttonDown[ds.LEFT]||e._buttonDown[ds.MIDDLE]||e._buttonDown[ds.RIGHT])&&t.preventDefault()}var T_e={position:new U};function ZZe(e,t){let n=t.button,i;if(n===ds.LEFT)i=fn.LEFT_DOUBLE_CLICK;else return;let r=ax(t),o=e.getInputAction(i,r);l(o)&&(xy(e,t,T_e.position),o(T_e))}function QZe(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===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=ax(t),r=e.getInputAction(fn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function eQe(e,t){FJ(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,xy(e,o,new U));I3(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,U.clone(a.get(s)))}function E_e(e,t){FJ(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);I3(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var C_e={position:new U},OJ={position1:new U,position2:new U},v_e={position:new U},S_e={position:new U},w_e={position:new U};function I3(e,t){let n=ax(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[ds.LEFT]){if(e._buttonDown[ds.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(fn.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,v_e.position),o(v_e)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(fn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];NJ(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,S_e.position),s(S_e))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(fn.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[ds.LEFT]=!0,o=e.getInputAction(fn.LEFT_DOWN,n),l(o)&&(U.clone(c,C_e.position),o(C_e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(fn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];NJ(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,w_e.position),s(w_e))}},Mh.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(fn.PINCH_START,n),l(o)&&(U.clone(i.values[0],OJ.position1),U.clone(i.values[1],OJ.position2),o(OJ),t.preventDefault()))}function tQe(e,t){FJ(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&xy(e,o,u)}O_e(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,U.clone(a.get(s),c.get(s))}var MJ={startPosition:new U,endPosition:new U},CD={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function O_e(e,t){let n=ax(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[ds.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(fn.MOUSE_MOVE,n),l(s)&&(U.clone(c,MJ.startPosition),U.clone(a,MJ.endPosition),s(MJ)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(fn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(y,m);U.fromElements(0,A,CD.distance.startPosition),U.fromElements(0,g,CD.distance.endPosition),U.fromElements(E,x,CD.angleAndHeight.startPosition),U.fromElements(T,b,CD.angleAndHeight.endPosition),s(CD)}}function nQe(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,xy(e,t,new U)),I3(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else P_e(e,t)}function I_e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),I3(e,t),e._previousPositions.remove(i)}else D_e(e,t)}function iQe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;xy(e,t,r),O_e(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else R_e(e,t)}function Mh(e){this._inputEvents={},this._buttonDown={[ds.LEFT]:!1,[ds.MIDDLE]:!1,[ds.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Mh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new zt,this._previousPositions=new zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,$Ze(this)}Mh.prototype.setInputAction=function(e,t,n){let i=LJ(t,n);this._inputEvents[i]=e};Mh.prototype.getInputAction=function(e,t){let n=LJ(e,t);return this._inputEvents[n]};Mh.prototype.removeInputAction=function(e,t){let n=LJ(e,t);delete this._inputEvents[n]};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){return JZe(this),ue(this)};Mh.mouseEmulationIgnoreMilliseconds=800;Mh.touchHoldDelayMilliseconds=1500;var da=Mh;function P3(e){e=e??!0,this.value=P3.toValue(e)}Object.defineProperties(P3.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});P3.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Pn=P3;function rQe(e,t,n,i,r,o,s){let a=cr.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let b=(g-u)/a,x=(m-f)/a,T=(y-d)/a,E=(A-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*b),o[v++]=z.floatToByte(f+c*x),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*E);return v}function vD(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ee.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+3}vD.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};vD.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new vD({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var D3=new Array(2),R3=new Array(2),oQe={positions:D3,height:R3,ellipsoid:void 0,minDistance:void 0,granularity:void 0};vD.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=P.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===ln.GEODESIC||r===ln.RHUMB){let E,v,S;r===ln.GEODESIC?(E=P.chordLength(o,s.maximumRadius),v=cr.numberOfPoints,S=cr.generateArc):(E=o,v=cr.numberOfPointsRhumbLine,S=cr.generateRhumbArc);let I=cr.extractHeights(t,s),R=oQe;if(r===ln.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=v(t[u],t[u+1],E)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=D3,R.height=R3;let L=0;for(u=0;u<f-1;++u){D3[0]=t[u],D3[1]=t[u+1],R3[0]=I[u],R3[1]=I[u+1];let _=S(R);if(l(n)){let C=_.length/3;m=n[u];for(let w=0;w<C;++w)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=I,d=new Float64Array(S(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],w=n[u+1];y=rQe(L,_,C,w,a,g,y)}let O=n[f-1];g[y++]=z.floatToByte(O.red),g[y++]=z.floatToByte(O.green),g[y++]=z.floatToByte(O.blue),g[y]=z.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let S=t[u];if(c&&u>0&&(h.pack(S,d,E),E+=3,m=n[u-1],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(S,d,E),E+=3,l(n)&&(m=n[u],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha))}}let A=new En;A.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=je.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new wt({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:le.fromPoints(t)})};var M_e=vD;var O3=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};O3.DEFAULT_SNAP_APERTURE=void 0;var N_e=O3;function ov(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new ec(i),this._workerName="createSphereGeometry"}ov.packedLength=ec.packedLength;ov.pack=function(e,t,n){return ec.pack(e._ellipsoidGeometry,t,n)};var sQe=new ec,Ty={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};ov.unpack=function(e,t,n){let i=ec.unpack(e,t,sQe);return Ty.vertexFormat=Be.clone(i._vertexFormat,Ty.vertexFormat),Ty.stackPartitions=i._stackPartitions,Ty.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Ty.radii),n._ellipsoidGeometry=new ec(Ty),n):(Ty.radius=i._radii.x,new ov(Ty))};ov.createGeometry=function(e){return ec.createGeometry(e._ellipsoidGeometry)};var M3=ov;function sv(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new dd(i),this._workerName="createSphereOutlineGeometry"}sv.packedLength=dd.packedLength;sv.pack=function(e,t,n){return dd.pack(e._ellipsoidGeometry,t,n)};var aQe=new dd,cx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};sv.unpack=function(e,t,n){let i=dd.unpack(e,t,aQe);return cx.stackPartitions=i._stackPartitions,cx.slicePartitions=i._slicePartitions,cx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,cx.radii),n._ellipsoidGeometry=new dd(cx),n):(cx.radius=i._radii.x,new sv(cx))};sv.createGeometry=function(e){return dd.createGeometry(e._ellipsoidGeometry)};var Ey=sv;function $c(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}$c.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new $c),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};$c.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new $c(e.clock,e.cone,e.magnitude)};$c.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new $c(e.clock,e.cone,1)};$c.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};$c.equalsEpsilon=function(e,t,n){return n=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};$c.prototype.equals=function(e){return $c.equals(this,e)};$c.prototype.clone=function(e){return $c.clone(this,e)};$c.prototype.equalsEpsilon=function(e,t){return $c.equalsEpsilon(this,e,t)};$c.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var N3=$c;function cQe(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var av=cQe;function cv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Rr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cv.prototype.findTimeInterval=Rr.prototype.findTimeInterval;cv.prototype.wrapTime=Rr.prototype.wrapTime;cv.prototype.clampTime=Rr.prototype.clampTime;cv.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var L3=cv;function lQe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var F3=lQe;var uQe={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=uQe;var kJ=class{constructor(t){ut(this,"ellipsoid");ut(this,"rectangle");ut(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},L_e=kJ;function VJ(e,t){return K.compare(e.start,t.start)}function hs(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(hs.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}}});hs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof hs))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!vn.equals(n[o],i[o],t))return!1;return!0};hs.prototype.get=function(e){return this._intervals[e]};hs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};hs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};hs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};hs.prototype.contains=function(e){return this.indexOf(e)>=0};var UJ=new vn;hs.prototype.indexOf=function(e){let t=this._intervals;UJ.start=e,UJ.stop=e;let n=Pr(t,UJ,VJ);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&&vn.contains(t[n-1],e)?n-1:~n)};hs.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};hs.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Pr(n,e,VJ);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 r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new vn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new vn({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):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new vn({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 vn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new vn({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new vn({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)};hs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Pr(t,e,VJ);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.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 vn({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 vn({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 vn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.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 vn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new vn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new vn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};hs.prototype.intersect=function(e,t,n){let i=new hs,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=vn.intersect(c,u,new vn,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};hs.fromJulianDateArray=function(e,t){l(t)||(t=new hs);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new vn({start:nt.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new vn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new vn({start:n[i-1],stop:nt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var Jc=new Fm,SD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function zJ(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,Jc);let i=Jc.millisecond+t.millisecond,r=Jc.second+t.second,o=Jc.minute+t.minute,s=Jc.hour+t.hour,a=Jc.day+t.day,c=Jc.month+t.month,u=Jc.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),SD[2]=Jf(u)?29:28;a>SD[c]||c>=13;)a>SD[c]&&(a-=SD[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),SD[2]=Jf(u)?29:28;return Jc.millisecond=i,Jc.second=r,Jc.minute=o,Jc.hour=s,Jc.day=a,Jc.month=c,Jc.year=u,K.fromGregorianDate(Jc,n)}var fQe=new K,dQe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function F_e(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(dQe);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"),K.toGregorianDate(K.fromIso8601(e,fQe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var wD=new Fm;hs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!F_e(n[2],wD))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=zJ(s,wD),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return hs.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};hs.fromIso8601DateArray=function(e,t){return hs.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};hs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],s,a,c=i.length;for(let u=0;u<c;++u)(F_e(i[u],wD)||u===0)&&(r&&l(a)?s=zJ(a,wD):s=zJ(n,wD),o.push(s),a=s);return hs.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Os=hs;var B_e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(B_e);var Cy=B_e;var hQe=new h(1,1,1),mQe=h.ZERO,pQe=Le.IDENTITY;function k_e(e,t,n){this.translation=h.clone(e??mQe),this.rotation=Le.clone(t??pQe),this.scale=h.clone(n??hQe)}k_e.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var lx=k_e;var Nh=class Nh{constructor(){ut(this,"_collection",null);ut(this,"_index",-1);ut(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(Nh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Nh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Nh.Layout.SHOW_U8)===1}set show(t){this._setUint8(Nh.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(Nh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Nh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Nh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Nh.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};ut(Nh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var jJ=Nh,ms=jJ;var U_e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(U_e);var ki=U_e;var vy={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,CLIP_TO_GROUND:7};Object.freeze(vy);var We=vy;function ps(e){return e===vy.CLAMP_TO_GROUND||e===vy.CLAMP_TO_3D_TILE||e===vy.CLAMP_TO_TERRAIN}function Sy(e){return e===vy.RELATIVE_TO_GROUND||e===vy.RELATIVE_TO_3D_TILE||e===vy.RELATIVE_TO_TERRAIN}var ID=class ID{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??ki.TRANSLUCENT,this._modelMatrix=M.clone(t.modelMatrix??M.IDENTITY),this._boundingVolume=le.clone(t.boundingVolume??new le,new le),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._customPickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??ID.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??ID.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._customPickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,s=new i,a=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,s),this.get(d,a)));for(let f=0;f<o;f++)n[c[f]]=f;let u=this._cloneEmpty();for(let f=0;f<o;f++){let d=this.get(c[f],s),p=u.add({},a);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n,i){if(l(i))return this._cloneFiltered(t,n,i);let r=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),s=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*r.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=t._customPickObjects,c=n._customPickObjects;c.length=0;let u=new s;for(let f=0,d=n.primitiveCount;f<d;f++)c[f]=a[f],n.get(f,u)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneFiltered(t,n,i){let r=t._getPrimitiveClass(),o=new r,s=new r,a=t._customPickObjects,c=n._customPickObjects;c.length=0;for(let u=0,f=t._primitiveCount;u<f;u++){if(t.get(u,o),!i(o,u))continue;let d=n._primitiveCount;r.clone(o,n.add({},s)),l(a[u])&&(c[d]=a[u])}return n}static fromCollection(t,n=H.EMPTY_OBJECT,i){let r=t._cloneEmpty(n);return t._getCollectionClass().clone(t,r,i),r}_cloneEmptyBaseArgs(t){return{primitiveCountMax:this.primitiveCountMax,vertexCountMax:this.vertexCountMax,positionDatatype:this.positionDatatype,positionNormalized:this.positionNormalized,modelMatrix:this._modelMatrix,show:this.show,debugShowBoundingVolume:this.debugShowBoundingVolume,blendOption:this._blendOption,allowPicking:this._allowPicking,boundingVolume:this._boundingVolumeAutoUpdate?void 0:this._boundingVolume,...t}}_cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=cn.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),le.fromVertices(t,h.ZERO,3,this._boundingVolume),le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let s=n.length,a=this._primitiveCount;s<a;s++){this.get(s,o);let c=this._customPickObjects[s]||{collection:this,index:s,get primitive(){return i.get(s,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._customPickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&yt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!ps(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};ut(ID,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var B3=ID;B3.DEFAULT_CAPACITY=1024;var ha=B3;var{ERR_CAPACITY:iLn,ERR_RESIZE:rLn,ERR_OUT_OF_RANGE:oLn}=ha.Error,yd=class yd extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(yd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(yd.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i.vertexCount+s-o;i._positionCount=a,this._setUint32(yd.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(yd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(yd.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let s=o.byteOffset+i*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r)}for(let s=0;s<r;s++)n[s]=o[i+s];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,s=n.length,a=i.holeCount+s-o;i._holeCount=a,this._setUint32(yd.Layout.HOLE_COUNT_U32,s);let c=i._holeIndexView;for(let u=0;u<s;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],s=this.getHoleVertexCount(n);return this._getPositionsRange(o,s,i)}_getPositionsRange(n,i,r){let o=this._collection,s=this._collection._positionView,a=this.vertexOffset+n;if(!l(r)){let c=s.byteOffset+a*3*s.BYTES_PER_ELEMENT,u=s.constructor;return new u(s.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=s[(a+c)*3],r[c*3+1]=s[(a+c)*3+1],r[c*3+2]=s[(a+c)*3+2];return r}get triangleOffset(){return this._getUint32(yd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(yd.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,s=n.length/3,a=i.triangleCount+s-o;i._triangleCount+=s-o,this._setUint32(yd.Layout.TRIANGLE_COUNT_U32,s);let c=i._triangleIndexView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};ut(yd,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ms.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ms.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ms.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ms.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ms.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+24});var HJ=yd,Fo=HJ;var PD=class{constructor(t=H.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};ut(PD,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(PD,"DEFAULT_MATERIAL");var Tu=PD;var k3=class k3 extends Tu{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(k3,"DEFAULT_MATERIAL",Object.freeze(new k3));var GJ=k3,Ad=GJ;var{ERR_RESIZE:ALn,ERR_CAPACITY:bLn}=ha.Error,lv=class lv extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(lv.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(lv.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i._positionCount+s-o;i._positionCount=a,this._setUint32(lv.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};ut(lv,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ms.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+8});var WJ=lv,Oa=WJ;var DD=class DD extends Tu{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setFloat32(this.Layout.WIDTH_F32+i,t.width,!0)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getFloat32(this.Layout.WIDTH_F32+n,!0),i}toJSON(){return{...super.toJSON(),width:this.width}}};ut(DD,"Layout",{...Tu.Layout,WIDTH_F32:Tu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Tu.Layout.__BYTE_LENGTH+4}),ut(DD,"DEFAULT_MATERIAL",Object.freeze(new DD));var qJ=DD,bd=qJ;var z_e=16,gQe=.35,V_e=new Oa,_Qe=new bd,j_e=new Fo,yQe=new Ad,AQe=new h,bQe=new h,xQe=new he,TQe=new U,EQe=new U,RD=new z,XJ=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=K_e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4),d=t.widthUnits==="meters";for(let p=0;p<r;p++){let g=t.get(p,V_e),m=g.getMaterial(_Qe);c[p]=d?-m.width:m.width,u[p*4]=z.floatToByte(m.color.red),u[p*4+1]=z.floatToByte(m.color.green),u[p*4+2]=z.floatToByte(m.color.blue),u[p*4+3]=z.floatToByte(m.color.alpha),H_e(f,p,g._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,widthInMeters:d,colors:u,pickColors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,V_e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(P.EPSILON3,G_e(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,TQe),y=U.fromArray(a,(d+g+1)*2,EQe);CQe(m,y,i,o),vQe(m,y,p)&&(r.polylineSegments.push([m.x,m.y,y.x,y.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),s>0&&(r.hasPixelWidths||(r.hasPixelWidths=!n.widthInMeters),r.hasMeterWidths||(r.hasMeterWidths=n.widthInMeters)),r.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/z_e))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=gQe/r,c=U3(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,G_e(c[i[A]],t)),T=Math.max(0,Math.min(b[0],b[2])-x),E=Math.min(1,Math.max(b[0],b[2])+x),v=Math.max(0,Math.min(b[1],b[3])-x),S=Math.min(1,Math.max(b[1],b[3])+x),I=wy(Math.floor(T*r),r),R=wy(Math.floor(E*r),r),O=wy(Math.floor(v*r),r),L=wy(Math.floor(S*r),r);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++)o[_*r+C].push(A),s++}let[u,f]=z3(s),d=u*f,p=new Float32Array(d*4).fill(-1),g=new Float32Array(d).fill(-1),m=new Uint32Array(o.length+2);m[0]=r,m[1]=r;let y=0;for(let A=0;A<o.length;A++){let b=o[A];for(let x=0;x<b.length;x++){let T=b[x],E=n[T];p[y*4]=E[0],p[y*4+1]=E[1],p[y*4+2]=E[2],p[y*4+3]=E[3];let v=i[T];g[y]=v,y++}m[A+2]=y}t.polylineSegmentTexels=p,t.polylineSegmentTextureWidth=u,t.polylineSegmentTextureHeight=f,t.polylineSegmentPrimitiveIndicesTexels=g,t.polylineGridCellIndices=m}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=K_e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let p=t.get(d,j_e),g=p.getMaterial(yQe);u[d*4]=z.floatToByte(g.color.red),u[d*4+1]=z.floatToByte(g.color.green),u[d*4+2]=z.floatToByte(g.color.blue),u[d*4+3]=z.floatToByte(g.color.alpha),H_e(f,d,p._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,colors:u,pickColors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,j_e);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=SQe(a,f+m,A,i,o),x=Y_e(b,A,-P.EPSILON3,1+P.EPSILON3,-P.EPSILON3,1+P.EPSILON3,q_e);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),r.primitiveCount+=s}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/z_e))),s=new Array(o*o);for(let y=0;y<s.length;y++)s[y]=[];let a=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,E=1/0,v=-1/0,S=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),v=Math.max(v,A[_*2]),E=Math.min(E,A[_*2+1]),S=Math.max(S,A[_*2+1]);let I=wy(Math.floor(T*o),o),R=wy(Math.floor(v*o),o),O=wy(Math.floor(E*o),o),L=wy(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=Y_e(A,x,C/o-P.EPSILON5,(C+1)/o+P.EPSILON5,_/o-P.EPSILON5,(_+1)/o+P.EPSILON5,q_e),D=w.vertexCount;if(D<3)continue;let N=w.positions,F=s[_*o+C];for(let V=0;V<D;V++){let B=(V+1)%D,j=N[V*2],k=N[V*2+1],G=N[B*2],q=N[B*2+1];k!==q&&(F.push(j,k,G,q,b),a++)}}}let[c,u]=z3(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(s.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<s.length;y++){let A=s[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=z3(n.primitiveCount),o=new Float32Array(i*r);o.set(U3(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:Ht.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(U3(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:Ht.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(U3(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:Ht.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=X_e(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:Ht.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=X_e(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.pickColorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function H_e(e,t,n){z.fromRgba(n,RD),e[t*4]=z.floatToByte(RD.red),e[t*4+1]=z.floatToByte(RD.green),e[t*4+2]=z.floatToByte(RD.blue),e[t*4+3]=z.floatToByte(RD.alpha)}function G_e(e,t){if(e>=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function CQe(e,t,n,i){let r=e.x,o=t.x;o=r+P.negativePiToPi(o-r);let s=n.west+i*.5,a=s+P.negativePiToPi(r-s)-r;r+=a,o+=a;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function vQe(e,t,n){let i=-n,r=1+n,o=0,s=1,a=e.x,c=e.y,u=t.x,f=t.y,d=u-a,p=f-c,g=[-d,d,-p,p],m=[a-i,r-a,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):s=Math.min(s,A),o>s)return!1}return e.x=a+o*d,e.y=c+o*p,t.x=a+s*d,t.y=c+s*p,!0}function wy(e,t){return Math.max(0,Math.min(t-1,e))}var YJ=new Float64Array(512),W_e=new Float64Array(512),q_e={positions:new Float64Array(512),vertexCount:0};function SQe(e,t,n,i,r){YJ.length<n*2&&(YJ=new Float64Array(n*4));let o=YJ,s=i.north-i.south,a=e[t*2];o[0]=a,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=a+P.negativePiToPi(e[(t+d)*2]-a);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],a=p}let c=i.west+r*.5,u=o[0],f=c+P.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/s;return o}function Y_e(e,t,n,i,r,o,s){let a=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?W_e:s.positions;y.length<g&&(y=new Float64Array(g*2),m?W_e=y:s.positions=y);let A=0,b=a[(c-1)*2],x=a[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let E=0;E<c;E++){let v=a[E*2],S=a[E*2+1],I=d*((f===0?v:S)-p)>=0;if(I!==T){let R=f===0?(p-b)/(v-b):(p-x)/(S-x);y[A*2]=f===0?p:b+R*(v-b),y[A*2+1]=f===0?x+R*(S-x):p,A++}I&&(y[A*2]=v,y[A*2+1]=S,A++),b=v,x=S,T=I}if(A===0)return s.vertexCount=0,s;a=y,c=A}return s.vertexCount=c,s}function z3(e){let t=P.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=P.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function X_e(e,t){let[n,i]=z3(t.length),r=new Float32Array(n*i);return r.set(t),new Dt({context:e,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:Ht.NEAREST,flipY:!1})}function K_e(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let s=h.fromArray(i,o*3,AQe),a=M.multiplyByPoint(r,s,bQe),c=t.cartesianToCartographic(a,xQe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function U3(e){let t=0;for(let o of e)t+=o.byteLength;let n=e[0].constructor,i=new n(t/n.BYTES_PER_ELEMENT),r=0;for(let o of e)i.set(o,r),r+=o.length;return i}var Ms=XJ;var $_e={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze($_e);var Zc=$_e;var J_e={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE};Object.freeze(J_e);var to=J_e;var Z_e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Zc.ADD,equationAlpha:Zc.ADD,functionSourceRgb:to.SOURCE_ALPHA,functionSourceAlpha:to.ONE,functionDestinationRgb:to.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:to.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Zc.ADD,equationAlpha:Zc.ADD,functionSourceRgb:to.ONE,functionSourceAlpha:to.ONE,functionDestinationRgb:to.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:to.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Zc.ADD,equationAlpha:Zc.ADD,functionSourceRgb:to.SOURCE_ALPHA,functionSourceAlpha:to.ONE,functionDestinationRgb:to.ONE,functionDestinationAlpha:to.ONE})};Object.freeze(Z_e);var rn=Z_e;var V3=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +#else +in vec3 position; +#endif +in vec4 pickColor; +in vec3 showColorAlpha; +out vec4 v_pickColor; +out vec4 v_color; +void main() +{ +float show = showColorAlpha.x; +vec4 color = czm_decodeRGB8(showColorAlpha.y); +float alpha = showColorAlpha.z; +#ifdef USE_FLOAT64 +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +#endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha * show; +gl_Position *= show; +} +`;var j3=`in vec4 v_pickColor; +in vec4 v_color; +void main() +{ +if (v_color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var KJ={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},Q_e={position:0,pickColor:1,showColorAlpha:2},ma=new Fo,$J=new Ad,OD=new z,eye=new h,JJ=new Sn;function wQe(e,t,n){let i=t.context;n=n||{destroy:PQe};let r=e._positionDatatype===Y.DOUBLE,o=r?KJ:Q_e;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=je.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,ma),!ma._dirty)continue;let x=ma.triangleOffset,T=ma.vertexOffset,E=ma.getTriangles();for(let R=0,O=ma.triangleCount;R<O;R++)g[x*3]=T+E[R*3],g[x*3+1]=T+E[R*3+1],g[x*3+2]=T+E[R*3+2],x++;let v=ma.show,S=r?ma.getPositions():null;ma.getMaterial($J);let I=cn.encodeRGB8($J.color);z.fromRgba(ma._pickId,OD);for(let R=0,O=ma.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,eye),Sn.fromCartesian(eye,JJ),h.pack(JJ.high,d,T*3),h.pack(JJ.low,p,T*3)),m[T*4]=z.floatToByte(OD.red),m[T*4+1]=z.floatToByte(OD.green),m[T*4+2]=z.floatToByte(OD.blue),m[T*4+3]=z.floatToByte(OD.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=$J.color.alpha,T++;ma._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=IQe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:KJ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:KJ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:Q_e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?rn.DISABLED:rn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[V3],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[j3]}),attributeLocations:o}));let s=e.triangleCount*3;l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===ki.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function IQe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ma);let i=ma.vertexOffset,r=ma.triangleOffset*3;e.get(t+n-1,ma);let o=ma.vertexOffset+ma.vertexCount-i,s=(ma.triangleOffset+ma.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function PQe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var H3=wQe;var{ERR_CAPACITY:PFn}=ha.Error,ZJ=class e extends ha{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??ha.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??ha.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Fo}_getMaterialClass(){return Ad}_allocateHoleIndexBuffer(){this._holeIndexView=je.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=je.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Fo){super.add(t,n);let i=this._positionCount;n._setUint32(Fo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Fo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Fo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Fo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Fo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Fo.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=H3(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},tc=ZJ;var G3=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +in vec3 prevPositionHigh; +in vec3 prevPositionLow; +in vec3 nextPositionHigh; +in vec3 nextPositionLow; +#else +in vec3 position; +in vec3 prevPosition; +in vec3 nextPosition; +#endif +in vec4 pickColor; +in vec4 showColorWidthAndTexCoord; +in float alpha; +out vec4 v_pickColor; +out vec4 v_color; +out vec2 v_st; +out float v_width; +out float v_polylineAngle; +void main() +{ +float show = showColorWidthAndTexCoord.x; +vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y); +float signedWidth = showColorWidthAndTexCoord.z; +float texCoord = showColorWidthAndTexCoord.w; +bool usePrevious = texCoord == 1.0; +float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0; +float polylineAngle; +#ifdef USE_FLOAT64 +vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow); +vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow); +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +vec4 prevPositionEC = czm_modelView * vec4(prevPosition, 1.0); +vec4 nextPositionEC = czm_modelView * vec4(nextPosition, 1.0); +#endif +float width = abs(signedWidth); +if (signedWidth < 0.0) +{ +width /= max(czm_metersPerPixel(positionEC), czm_epsilon7); +} +#ifdef USE_FLOAT64 +vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); +#else +vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); +#endif +gl_Position = czm_viewportOrthographic * positionWC * show; +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha / 255.0 * show; +v_st.s = texCoord; +v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); +v_width = width; +v_polylineAngle = polylineAngle; +} +`;var W3=`in vec4 v_pickColor; +in vec4 v_color; +void main() +{ +if (v_color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var Eu=`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); +float endPoint0Distance = czm_currentFrustum.x + p0.z; +float denominator = -direction.z; +if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) +{ +culledByNearPlane = true; +} +else if (endPoint0Distance > 0.0) +{ +float t = endPoint0Distance / denominator; +if (t < 0.0 || t > magnitude) +{ +culledByNearPlane = true; +} +else +{ +p0 = p0 + t * direction; +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) +{ +#ifdef POLYLINE_DASH +vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); +vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); +vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); +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; +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 (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; +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); +vec2 u = -thisSegmentForwardWC; +vec2 v = leftWC; +float sinAngle = abs(u.x * v.y - u.y * v.x); +expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); +} +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 ux={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},q3={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},Qc=new Oa,MD=new bd,ND=new z,tye=new h,nye=new h,iye=new h,QJ=new Sn,eZ=new Sn,tZ=new Sn;function DQe(e,t,n){let i=t.context;n=n||{destroy:MQe};let r=e._positionDatatype===Y.DOUBLE,o=r?ux:q3;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=je.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=e.widthUnits==="meters",d=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:g,alpha:m,position:y,prevPosition:A,nextPosition:b,positionHigh:x,positionLow:T,prevPositionHigh:E,prevPositionLow:v,nextPositionHigh:S,nextPositionLow:I}=n.attributeArrays;for(let R=c,O=c+u;R<O;R++){if(e.get(R,Qc),!Qc._dirty)continue;Qc.getMaterial(MD);let L=cn.encodeRGB8(MD.color),_=MD.color.alpha,C=f?-MD.width:MD.width;z.fromRgba(Qc._pickId,ND);let w=Qc.show,D=Qc.vertexOffset*2,N=(Qc.vertexOffset-R)*6,F=e._positionView,V=Qc.vertexOffset*3;for(let B=0,j=Qc.vertexCount;B<j;B++){let k=B===0,G=B===j-1,q=F[V+B*3],Q=F[V+B*3+1],W=F[V+B*3+2],J,Z,ae,Ae,fe,xe;k?(Ae=F[V+3],fe=F[V+3+1],xe=F[V+3+2],J=2*q-Ae,Z=2*Q-fe,ae=2*W-xe):G?(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=2*q-J,fe=2*Q-Z,xe=2*W-ae):(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=F[V+(B+1)*3],fe=F[V+(B+1)*3+1],xe=F[V+(B+1)*3+2]),G||(d[N]=D,d[N+1]=D+1,d[N+2]=D+2,d[N+3]=D+2,d[N+4]=D+1,d[N+5]=D+3,N+=6),r&&(h.fromElements(q,Q,W,tye),h.fromElements(J,Z,ae,nye),h.fromElements(Ae,fe,xe,iye),Sn.fromCartesian(tye,QJ),Sn.fromCartesian(nye,eZ),Sn.fromCartesian(iye,tZ));for(let ge=0;ge<2;ge++)r?(h.pack(QJ.high,x,D*3),h.pack(QJ.low,T,D*3),h.pack(eZ.high,E,D*3),h.pack(eZ.low,v,D*3),h.pack(tZ.high,S,D*3),h.pack(tZ.low,I,D*3)):(y[D*3]=q,y[D*3+1]=Q,y[D*3+2]=W,A[D*3]=J,A[D*3+1]=Z,A[D*3+2]=ae,b[D*3]=Ae,b[D*3+1]=fe,b[D*3+2]=xe),p[D*4]=z.floatToByte(ND.red),p[D*4+1]=z.floatToByte(ND.green),p[D*4+2]=z.floatToByte(ND.blue),p[D*4+3]=z.floatToByte(ND.alpha),g[D*4]=w?1:0,g[D*4+1]=L,g[D*4+2]=C,g[D*4+3]=B/(j-1),m[D]=_*255,D++}Qc._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=OQe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:ux.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:ux.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:ux.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:ux.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:ux.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:ux.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:q3.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:q3.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:q3.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:tt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?rn.DISABLED:rn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[Eu,G3],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[W3]}),attributeLocations:o}));let s=RQe(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===ki.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function RQe(e){return(e.vertexCount-e.primitiveCount)*6}function OQe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,Qc);let i=Qc.vertexOffset*2,o=(Qc.vertexOffset-t)*6;e.get(t+n-1,Qc);let s=(Qc.vertexOffset+Qc.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function MQe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var Y3=DQe;var nZ=class e extends ha{constructor(t=H.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return Oa}_getMaterialClass(){return bd}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Oa){super.add(t,n);let i=this._positionCount;return n._setUint32(Oa.Layout.POSITION_OFFSET_U32,i),n._setUint32(Oa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=Y3(this,t,this._renderContext))}},Ll=nZ;var sye=new ie,rye=new ie,iZ=new ie,X3=new Map;X3.set(Ll,{packCollectionData:Ms.packPolylineCollectionData,packTilePrimitives:Ms.packPolylineSegments});X3.set(tc,{packCollectionData:Ms.packPolygonCollectionData,packTilePrimitives:Ms.packPolygonRings});var rZ=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return X3.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r,o){let s=this._tilingScheme.tileXYToRectangle(t,n,i,sye);return this.requestDataForRectangle(s,r,o)}requestDataForRectangle(t,n,i){let r=this._tilingScheme,o=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:ie.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:NQe(t,r.ellipsoid)};for(let[u,f]of o){if(!oye(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,rye);if(!!!ie.intersection(t,d,iZ))continue;let g=X3.get(u.constructor),m=this._getCollectionDataCached(u,g.packCollectionData);s.collectionVersions.set(u,m.version),g.packTilePrimitives(u,m,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Ms.packPolylineGrid(s),Ms.packPolylineTextures(n,s)),c&&(Ms.packPolygonGrid(s),Ms.packPolygonTextures(n,s)),Ms.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ms.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return LQe(t,n,i,a,c)?(this.releaseTileData(o),this.requestTileData(t,n,i,r,s)):o}updateDataForRectangle(t,n,i,r){return this._isStale(i,t,r)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,r)):i}_isStale(t,n,i){if(!ie.equals(t.rectangle,n))return!0;let r=t.collectionVersions,o=this._heightReferenceByCollection,s=0;for(let[a,c]of o){if(!oye(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,rye),f=!!ie.intersection(n,u,iZ),d=r.get(a);if(!f){if(l(d))return!0;continue}if(!l(d)||(s++,a._dirtyCount>0||d!==a._version))return!0}return s!==r.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(ie.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function oye(e,t){return e===We.CLAMP_TO_GROUND||e===t}function NQe(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new U(e.width*n*Math.cos(i),e.height*n)}function LQe(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,sye);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],iZ))return!0;return!1}var Iy=rZ;function fx(e){e=e??H.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=e.epoch??nt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(fx.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(fx.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=FQe(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});fx.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};fx.prototype.isDestroyed=function(){return!1};fx.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};fx.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 r=e.currentTime,o=this.epoch??nt.MINIMUM_VALUE,s=K.secondsDifference(r,o),a=t.duration,c,u=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 f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function FQe(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var aye=fx;function BQe(e,t){this.rectangle=e,this.maxLevel=t}function cye(e){this.ellipsoid=e.ellipsoid??ee.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}cye.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 kQe(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new ir({ellipsoid:e.ellipsoid});else throw new oe(`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=Yr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new BQe(new ie(a,c,u,f),d))}}function UQe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function zQe(e,t,n){try{let i=await t.fetchXML();kQe(e,i)}catch(i){UQe(t,i,n)}}function Py(e){e=e??H.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 It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Py.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(){}}});Py.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new cye(t),i=De.createIfNeeded(e);await zQe(n,i);let r=new Py(t);return n.build(r),r._resource=i,r};Py.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-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 jc({buffer:Bm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:VQe(a,e,t,n),structure:a._terrainDataStructure})})};Py.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var lye=new ie;function VQe(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,s,lye);l(d)&&(K3(r,f,t*2,n*2,i+1)&&(a|=4),K3(r,f,t*2+1,n*2,i+1)&&(a|=8),K3(r,f,t*2,n*2+1,i+1)&&(a|=1),K3(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function K3(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,lye))}Py.prototype.getTileDataAvailable=function(e,t,n){};Py.prototype.loadTileDataAvailability=function(e,t,n){};var uye=Py;var fye={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};Object.freeze(fye);var dye=fye;var hye={};function jQe(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var HQe=new he,GQe=new he;function WQe(e,t,n,i){t=Lr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,HQe);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,GQe);s&&(x.height=n[A]),m=m&&x.height===0,jQe(d,x)?d.height<x.height&&(c[y-1]=x.height):(a[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],he.clone(x,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var qQe=new Array(2),YQe=new Array(2),XQe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};hye.computePositions=function(e,t,n,i,r,o){let s=WQe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(r,e.maximumRadius),p=XQe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=cr.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=qQe,A=YQe;p.positions=y,p.height=A;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=cr.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(cr.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(cr.generateArc(p)),p.height=i,f=new Float64Array(cr.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var uv=hye;var oZ=new h,$3=new h,KQe=new h,mye=new h,$Qe=new h,JQe=new h,ZQe=new h;function dx(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Be.packedLength+1}dx.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var pye=ee.clone(ee.UNIT_SPHERE),gye=new Be,LD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:pye,vertexFormat:gye,granularity:void 0};dx.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,pye);t+=ee.packedLength;let u=Be.unpack(e,t,gye);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(LD.positions=o,LD.minimumHeights=s,LD.maximumHeights=a,LD.granularity=f,new dx(LD))};dx.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new dx(c)};dx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=uv.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,E=0,v=0,S=0,I=ZQe,R=JQe,O=$Qe,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,oZ),k=h.fromArray(c,B,$3);if(r.position&&(g[x++]=k.x,g[x++]=k.y,g[x++]=k.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[S++]=C,b[S++]=0,b[S++]=C,b[S++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,mye),q=h.subtract(j,s.geodeticSurfaceNormal(j,$3),$3);if(_+1<d&&(G=h.fromArray(u,B+3,mye)),L){let Q=h.subtract(G,j,KQe),W=h.subtract(q,j,oZ);I=h.normalize(h.cross(W,Q,I),I),L=!1}h.equalsEpsilon(j,G,P.EPSILON10)?L=!0:(C+=w,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(I,R,O),O))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),r.bitangent&&(A[E++]=O.x,A[E++]=O.y,A[E++]=O.z,A[E++]=O.x,A[E++]=O.y,A[E++]=O.z)}}let D=new En;r.position&&(D.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(D.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(D.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(D.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(D.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let N=p/3;p-=6*(f+1);let F=je.createTypedArray(N,p),V=0;for(_=0;_<N-2;_+=2){let B=_,j=_+2,k=h.fromArray(g,B*3,oZ),G=h.fromArray(g,j*3,$3);if(h.equalsEpsilon(k,G,P.EPSILON10))continue;let q=_+1,Q=_+3;F[V++]=q,F[V++]=B,F[V++]=Q,F[V++]=Q,F[V++]=B,F[V++]=j}return new wt({attributes:D,indices:F,primitiveType:Oe.TRIANGLES,boundingSphere:le.fromVertices(g)})};var J3=dx;var _ye=new h,yye=new h;function hx(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??P.RADIANS_PER_DEGREE,o=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=ee.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}hx.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var Aye=ee.clone(ee.UNIT_SPHERE),FD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Aye,granularity:void 0};hx.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,Aye);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(FD.positions=o,FD.minimumHeights=s,FD.maximumHeights=a,FD.granularity=u,new hx(FD))};hx.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new hx(c)};hx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=uv.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,_ye),E=h.fromArray(a,x,yye);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=je.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,E=h.fromArray(d,x*3,_ye),v=h.fromArray(d,T*3,yye);if(h.equalsEpsilon(E,v,P.EPSILON10))continue;let S=g+1,I=g+3;A[b++]=S,A[b++]=x,A[b++]=S,A[b++]=I,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new wt({attributes:m,indices:A,primitiveType:Oe.LINES,boundingSphere:le.fromVertices(d)})};var Z3=hx;function QQe(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var bye=QQe;var sZ={};function eet(e){let t=je.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function tet(e,t){let n=t.length,i=je.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function net(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function iet(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function ret(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function oet(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}sZ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?tet(t,n):eet(t);if(e===Oe.TRIANGLE_STRIP)return i?iet(t,n):net(t);if(e===Oe.TRIANGLE_FAN)return i?oet(t,n):ret(t)};sZ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var BD=sZ;function set(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var Q3=set;function Dy(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(Dy.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Dy.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Dy.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Dy.prototype.equals=function(e){return this===e||e instanceof Dy&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Dy.prototype.valueOf=function(){return this._value};Dy.prototype.toString=function(){return String(this._value)};var Ti=Dy;function aet(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function cet(e){return new Ti(e)}function uet(e,t,n){return aet(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??cet)}var me=uet;function kD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(kD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});kD.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 kD(this)};kD.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Fl=kD;var xye={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(xye);var qi=xye;var Tye={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Tye);var qn=Tye;var fet=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=fet;function Lh(){pe.throwInstantiationError()}Object.defineProperties(Lh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Lh.prototype.getValue=pe.throwInstantiationError;Lh.prototype.equals=pe.throwInstantiationError;Lh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Lh.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(!Lh.equals(e[i],t[i]))return!1;return!0};Lh.isConstant=function(e){return!l(e)||e.isConstant};Lh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Lh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Lh.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=Lh;var det=500;function het(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>det&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==re.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ee.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){r()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){r()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Ap=het;var met=new he;function pet(e,t,n,i,r){let o=i.cartesianToCartographic(e,met);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):ps(n)?o.height=t:Sy(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var Ry=pet;var Eye={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(Eye);var $o=Eye;var get=z.WHITE,_et=h.ZERO,yet=We.NONE,Aet=U.ZERO,bet=1,xet=0,Tet=h.ZERO,Eet=qi.CENTER,Cet=qn.CENTER,vet=!1,wet=$o.NONE,Iet=new h,Pet=new z,Det=new h,Ret=new U,Oet=new qt,Met=new qt,Net=new qt,Let=new et,Fet=new Gt;function Cye(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Oy(e,t){t.collectionChanged.addEventListener(Oy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}Oy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,Iet),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){aZ(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(a._color,e,get,Pet),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,_et,Det),u.heightReference=X.getValueOrDefault(a._heightReference,e,yet),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,Aet,Ret),u.scale=X.getValueOrDefault(a._scale,e,bet),u.rotation=X.getValueOrDefault(a._rotation,e,xet),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,Tet),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,Eet),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,Cet),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,Oet),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Met),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Net),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,vet),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Fet),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,wet),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,Let);l(p)&&u.setImageSubRegion(u.image,p)}return!0};Oy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Pt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Ap(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=Ry(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};Oy.prototype.isDestroyed=function(){return!1};Oy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Oy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};Oy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new Cye(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Cye(o)):(aZ(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],aZ(s.get(o.id),o,a),s.remove(o.id)};function aZ(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var eU=Oy;var tU=`in vec3 v_positionEC; in vec3 v_normalEC; in vec3 v_tangentEC; in vec3 v_bitangentEC; @@ -1794,7 +3084,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var pL=`in vec3 position3DHigh; +`;var nU=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec3 tangent; @@ -1816,7 +3106,7 @@ v_bitangentEC = czm_normal * bitangent; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var _L=`in vec3 v_positionEC; +`;var iU=`in vec3 v_positionEC; in vec3 v_normalEC; void main() { @@ -1835,7 +3125,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var gL=`in vec3 position3DHigh; +`;var rU=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in float batchId; @@ -1848,7 +3138,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_normalEC = czm_normal * normal; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var yL=`in vec3 v_positionEC; +`;var oU=`in vec3 v_positionEC; in vec3 v_normalEC; in vec2 v_st; void main() @@ -1869,7 +3159,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var bL=`in vec3 position3DHigh; +`;var sU=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec2 st; @@ -1885,8 +3175,8 @@ v_normalEC = czm_normal * normal; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var f1e={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},Qa=Object.freeze(f1e);var d1e={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},vo=Object.freeze(d1e);var h1e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Qa.ADD,equationAlpha:Qa.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:Qa.ADD,equationAlpha:Qa.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:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE,functionDestinationAlpha:vo.ONE})},un=Object.freeze(h1e);var m1e={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},Ti=Object.freeze(m1e);function kT(e){e=e??W.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(kT.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}}});kT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),c(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};kT.prototype.isTranslucent=function(){return c(this.material)&&this.material.isTranslucent()||!c(this.material)&&this.translucent};kT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=We(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};kT.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}),c(n)&&(i=xt(n,i,!0)),i};var no=kT;var xL=`uniform sampler2D image; +`;function fv(e){e=e??H.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(fv.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}}});fv.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(` +`)};fv.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};fv.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ze(this.renderState,!1);return e?(t.depthMask=!1,t.blending=rn.ALPHA_BLEND):t.depthMask=!0,t};fv.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=rn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Gi.BACK}),l(n)&&(i=Mt(n,i,!0)),i};var Or=fv;var aU=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -1896,7 +3186,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var TL=`uniform sampler2D image; +`;var cU=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -1917,7 +3207,7 @@ material.normal = normalEC; material.diffuse = vec3(0.01); return material; } -`;var AL=`uniform vec4 lightColor; +`;var lU=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -1937,7 +3227,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var CL=`uniform vec4 lightColor; +`;var uU=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -1950,7 +3240,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var EL=`uniform sampler2D heights; +`;var fU=`uniform sampler2D heights; uniform sampler2D colors; float getHeight(int idx, float invTexSize) { @@ -2004,7 +3294,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var SL=`uniform vec4 color; +`;var dU=`uniform vec4 color; uniform float spacing; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2024,7 +3314,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var wL=`uniform sampler2D image; +`;var hU=`uniform sampler2D image; uniform float minimumHeight; uniform float maximumHeight; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2037,7 +3327,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var vL=`uniform vec4 fadeInColor; +`;var mU=`uniform vec4 fadeInColor; uniform vec4 fadeOutColor; uniform float maximumDistance; uniform bool repeat; @@ -2068,7 +3358,7 @@ material.emission = color.rgb; material.alpha = color.a; return material; } -`;var DL=`uniform vec4 color; +`;var pU=`uniform vec4 color; uniform float cellAlpha; uniform vec2 lineCount; uniform vec2 lineThickness; @@ -2110,7 +3400,7 @@ material.emission = halfColor.rgb; material.alpha = halfColor.a; return material; } -`;var PL=`uniform sampler2D image; +`;var gU=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2125,7 +3415,7 @@ vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; material.normal = normalEC; return material; } -`;var IL=`uniform vec4 color; +`;var _U=`uniform vec4 color; float getPointOnLine(vec2 p0, vec2 p1, float x) { float slope = (p0.y - p1.y) / (p0.x - p1.x); @@ -2176,7 +3466,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var OL=`uniform vec4 color; +`;var yU=`uniform vec4 color; uniform vec4 gapColor; uniform float dashLength; uniform float dashPattern; @@ -2206,7 +3496,7 @@ material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } -`;var RL=`uniform vec4 color; +`;var AU=`uniform vec4 color; uniform float glowPower; uniform float taperPower; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2219,13 +3509,13 @@ 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.a = clamp(glow, 0.0, 1.0) * color.a; fragColor = czm_gammaCorrect(fragColor); material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } -`;var ML=`uniform vec4 color; +`;var bU=`uniform vec4 color; uniform vec4 outlineColor; uniform float outlineWidth; in float v_width; @@ -2246,7 +3536,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var LL=`uniform vec4 color; +`;var xU=`uniform vec4 color; uniform vec4 rimColor; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -2261,7 +3551,7 @@ material.emission = outRimColor.rgb * s; material.alpha = mix(outColor.a, outRimColor.a, s); return material; } -`;var NL=`uniform sampler2D image; +`;var TU=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -2271,7 +3561,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var FL=`uniform vec4 evenColor; +`;var EU=`uniform vec4 evenColor; uniform vec4 oddColor; uniform float offset; uniform float repeat; @@ -2289,7 +3579,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var BL=`uniform vec4 waterColor; +`;var CU=`uniform vec4 waterColor; uniform vec4 landColor; czm_material czm_getMaterial(czm_materialInput materialInput) { @@ -2300,7 +3590,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var kL=`uniform sampler2D specularMap; +`;var vU=`uniform sampler2D specularMap; uniform sampler2D normalMap; uniform vec4 baseWaterColor; uniform vec4 blendColor; @@ -2330,16 +3620,16 @@ material.specular = specularIntensity; material.shininess = 10.0; return material; } -`;function Ye(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=e.minificationFilter??Yt.LINEAR,this._magnificationFilter=e.magnificationFilter??ui.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,p1e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),c(Ye._uniformList[this.type])||(Ye._uniformList[this.type]=Object.keys(this._uniforms))}Ye._uniformList={};Ye.fromType=function(e,t){if(!c(Ye._materialCache.getMaterial(e)))throw new C(`material with type '${e}' does not exist.`);let n=new Ye({fabric:{type:e}});if(c(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Ye.prototype.isTranslucent=function(){if(c(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};Ye.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let l=i[t];n=l.id;let u=l.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let h=new Qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;c(u.internalFormat)?p=new Rt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new Rt({context:e,source:u,sampler:h});let g=this._textures[n];c(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let l=r[t];n=l.id;let u=l.images,f=new Go({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}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 l in a)a.hasOwnProperty(l)&&a[l].update(e)};Ye.prototype.isDestroyed=function(){return!1};Ye.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 de(this)};function p1e(e,t){e=e??W.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=We(e.fabric??W.EMPTY_OBJECT),t._template.uniforms=We(t._template.uniforms??W.EMPTY_OBJECT),t._template.materials=We(t._template.materials??W.EMPTY_OBJECT),t.type=c(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Ye._materialCache.getMaterial(t.type);if(c(i)){let r=We(i.fabric,!0);t._template=xt(t._template,r,!0),n=i.translucent}b1e(t),c(i)||Ye._materialCache.addMaterial(t.type,t),T1e(t),S1e(t),v1e(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,c(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function L6(e,t,n,i){if(c(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function jee(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){let o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new C(n)}function _1e(e,t){let n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}var g1e=["type","materials","uniforms","components","source"],y1e=["diffuse","specular","shininess","normal","emission","alpha"];function b1e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(c(o)&&c(t.source))throw new C("fabric: cannot have source and components in the same template.");L6(t,g1e,jee,!0),L6(o,y1e,jee,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);L6(n,r,_1e,!1)}function x1e(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 T1e(e){let t=e._template.components,n=e._template.source;if(c(n))e.shaderSource+=`${n} +`;function it(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=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??Jn.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,this._initializationPromises=[],this._initializationError=void 0,Bet(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(it._uniformList[this.type])||(it._uniformList[this.type]=Object.keys(this._uniforms))}it._uniformList={};it.fromType=function(e,t){let n=new it({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};it.fromTypeAsync=async function(e,t){let n=[],i=new it({fabric:{type:e,uniforms:t}});if(wye(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function wye(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];wye(r,t)}}it.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 r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};it.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new ls({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};it.prototype.isDestroyed=function(){return!1};it.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 ue(this)};function Bet(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Ze(e.fabric??H.EMPTY_OBJECT),t.fabric=Ze(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Ze(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Ze(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=it._materialCache.getMaterial(t.type);if(l(i)){let o=Ze(i.fabric,!0);t._template=Mt(t._template,o,!0),n=i.translucent}Vet(t),Het(t),Yet(t),Ket(t),l(i)||it._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function cZ(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function vye(e,t){}function ket(e,t){}var Uet=["type","materials","uniforms","components","source"],zet=["diffuse","specular","shininess","normal","emission","alpha"];function Vet(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;cZ(t,Uet,vye,!0),cZ(r,zet,vye,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);cZ(n,o,ket,!1)}function jet(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 Het(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); -`,c(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&&x1e(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]}; +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&jet(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; +`}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; +`:e.shaderSource+=`material.${r} = ${t[r]}; `}e.shaderSource+=`return material; } -`}}var Wee={mat2:Ri,mat3:J,mat4:F},A1e=/\.ktx2$/i;function C1e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!c(r)||r===Ye.DefaultImageId;t=r;let l=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&c(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!c(l)||l===i.defaultTexture){let p=new Qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Rt({context:i,source:r,sampler:p}),n._textures[e]=l;return}l.copyFrom({source:r})}else c(l)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Rt&&r!==l){n._texturePaths[e]=void 0;let p=n._textures[e];c(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&c(l)&&a&&(l!==n._defaultTexture&&l.destroy(),l=void 0),c(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=l._width,f.y=l._height)),a)return;let h=r instanceof we;if(!c(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:we.createIfNeeded(r),g;A1e.test(p.url)?g=Xl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){c(l)&&l!==n._defaultTexture&&l.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 E1e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Go){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(c(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Ye.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[we.createIfNeeded(i.positiveX).fetchImage(),we.createIfNeeded(i.negativeX).fetchImage(),we.createIfNeeded(i.positiveY).fetchImage(),we.createIfNeeded(i.negativeY).fetchImage(),we.createIfNeeded(i.positiveZ).fetchImage(),we.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function S1e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&qee(e,n)}function qee(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=w1e(o);if(!c(r))throw new C(`fabric: uniform '${t}' has invalid type.`);let s;if(r==="channels"){if(s=gw(e,t,o,!1),s===0&&n)throw new C(`strict: shader source does not use channels '${t}'.`)}else{if(r==="sampler2D"){let u=`${t}Dimensions`;D1e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},qee(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let l=`${t}_${e._count++}`;if(s=gw(e,t,l),s===1&&n)throw new C(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,r==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(C1e(t));else if(r==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(E1e(t));else if(r.indexOf("mat")!==-1){let u=new Wee[r];e._uniforms[l]=function(){return Wee[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function w1e(e){let t=e.type;if(!c(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Ye.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 v1e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Ye({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;gw(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`;if(gw(e,i,a)===0&&t)throw new C(`strict: shader source does not use material '${i}'.`)}}function gw(e,t,n,i){i=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(l,u,f){return u||f?l:(o+=1,n)}),o}function D1e(e,t,n){return gw(e,t,t,n)}Ye._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Ye.DefaultImageId="czm_defaultImage";Ye.DefaultCubeMapId="czm_defaultCubeMap";Ye.ColorType="Color";Ye._materialCache.addMaterial(Ye.ColorType,{fabric:{type:Ye.ColorType,uniforms:{color:new G(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.ImageType="Image";Ye._materialCache.addMaterial(Ye.ImageType,{fabric:{type:Ye.ImageType,uniforms:{image:Ye.DefaultImageId,repeat:new z(1,1),color:new G(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}});Ye.DiffuseMapType="DiffuseMap";Ye._materialCache.addMaterial(Ye.DiffuseMapType,{fabric:{type:Ye.DiffuseMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.AlphaMapType="AlphaMap";Ye._materialCache.addMaterial(Ye.AlphaMapType,{fabric:{type:Ye.AlphaMapType,uniforms:{image:Ye.DefaultImageId,channel:"a",repeat:new z(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Ye.SpecularMapType="SpecularMap";Ye._materialCache.addMaterial(Ye.SpecularMapType,{fabric:{type:Ye.SpecularMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",repeat:new z(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Ye.EmissionMapType="EmissionMap";Ye._materialCache.addMaterial(Ye.EmissionMapType,{fabric:{type:Ye.EmissionMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.BumpMapType="BumpMap";Ye._materialCache.addMaterial(Ye.BumpMapType,{fabric:{type:Ye.BumpMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",strength:.8,repeat:new z(1,1)},source:TL},translucent:!1});Ye.NormalMapType="NormalMap";Ye._materialCache.addMaterial(Ye.NormalMapType,{fabric:{type:Ye.NormalMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",strength:.8,repeat:new z(1,1)},source:PL},translucent:!1});Ye.GridType="Grid";Ye._materialCache.addMaterial(Ye.GridType,{fabric:{type:Ye.GridType,uniforms:{color:new G(0,1,0,1),cellAlpha:.1,lineCount:new z(8,8),lineThickness:new z(1,1),lineOffset:new z(0,0)},source:DL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Ye.StripeType="Stripe";Ye._materialCache.addMaterial(Ye.StripeType,{fabric:{type:Ye.StripeType,uniforms:{horizontal:!0,evenColor:new G(1,1,1,.5),oddColor:new G(0,0,1,.5),offset:0,repeat:5},source:FL},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Ye.CheckerboardType="Checkerboard";Ye._materialCache.addMaterial(Ye.CheckerboardType,{fabric:{type:Ye.CheckerboardType,uniforms:{lightColor:new G(1,1,1,.5),darkColor:new G(0,0,0,.5),repeat:new z(5,5)},source:AL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.DotType="Dot";Ye._materialCache.addMaterial(Ye.DotType,{fabric:{type:Ye.DotType,uniforms:{lightColor:new G(1,1,0,.75),darkColor:new G(0,1,1,.75),repeat:new z(5,5)},source:CL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.WaterType="Water";Ye._materialCache.addMaterial(Ye.WaterType,{fabric:{type:Ye.WaterType,uniforms:{baseWaterColor:new G(.2,.3,.6,1),blendColor:new G(0,1,.699,1),specularMap:Ye.DefaultImageId,normalMap:Ye.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:kL},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Ye.RimLightingType="RimLighting";Ye._materialCache.addMaterial(Ye.RimLightingType,{fabric:{type:Ye.RimLightingType,uniforms:{color:new G(1,0,0,.7),rimColor:new G(1,1,1,.4),width:.3},source:LL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Ye.FadeType="Fade";Ye._materialCache.addMaterial(Ye.FadeType,{fabric:{type:Ye.FadeType,uniforms:{fadeInColor:new G(1,0,0,1),fadeOutColor:new G(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new z(.5,.5)},source:vL},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Ye.PolylineArrowType="PolylineArrow";Ye._materialCache.addMaterial(Ye.PolylineArrowType,{fabric:{type:Ye.PolylineArrowType,uniforms:{color:new G(1,1,1,1)},source:IL},translucent:!0});Ye.PolylineDashType="PolylineDash";Ye._materialCache.addMaterial(Ye.PolylineDashType,{fabric:{type:Ye.PolylineDashType,uniforms:{color:new G(1,0,1,1),gapColor:new G(0,0,0,0),dashLength:16,dashPattern:255},source:OL},translucent:!0});Ye.PolylineGlowType="PolylineGlow";Ye._materialCache.addMaterial(Ye.PolylineGlowType,{fabric:{type:Ye.PolylineGlowType,uniforms:{color:new G(0,.5,1,1),glowPower:.25,taperPower:1},source:RL},translucent:!0});Ye.PolylineOutlineType="PolylineOutline";Ye._materialCache.addMaterial(Ye.PolylineOutlineType,{fabric:{type:Ye.PolylineOutlineType,uniforms:{color:new G(1,1,1,1),outlineColor:new G(1,0,0,1),outlineWidth:1},source:ML},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Ye.ElevationContourType="ElevationContour";Ye._materialCache.addMaterial(Ye.ElevationContourType,{fabric:{type:Ye.ElevationContourType,uniforms:{spacing:100,color:new G(1,0,0,1),width:1},source:SL},translucent:!1});Ye.ElevationRampType="ElevationRamp";Ye._materialCache.addMaterial(Ye.ElevationRampType,{fabric:{type:Ye.ElevationRampType,uniforms:{image:Ye.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:wL},translucent:!1});Ye.SlopeRampMaterialType="SlopeRamp";Ye._materialCache.addMaterial(Ye.SlopeRampMaterialType,{fabric:{type:Ye.SlopeRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:NL},translucent:!1});Ye.AspectRampMaterialType="AspectRamp";Ye._materialCache.addMaterial(Ye.AspectRampMaterialType,{fabric:{type:Ye.AspectRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:xL},translucent:!1});Ye.ElevationBandType="ElevationBand";Ye._materialCache.addMaterial(Ye.ElevationBandType,{fabric:{type:Ye.ElevationBandType,uniforms:{heights:Ye.DefaultImageId,colors:Ye.DefaultImageId},source:EL},translucent:!0});Ye.WaterMaskType="WaterMask";Ye._materialCache.addMaterial(Ye.WaterMaskType,{fabric:{type:Ye.WaterMaskType,source:BL,uniforms:{waterColor:new G(1,1,1,1),landColor:new G(0,0,0,0)}},translucent:!1});var Xi=Ye;function W0(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??W0.MaterialSupport.TEXTURED;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(W0.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}}});W0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;W0.prototype.isTranslucent=no.prototype.isTranslucent;W0.prototype.getRenderState=no.prototype.getRenderState;W0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:gL,fragmentShaderSource:_L}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:bL,fragmentShaderSource:yL}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:pL,fragmentShaderSource:mL})};var so=W0;var UL=`in vec3 v_positionEC; +`}}var Sye={mat2:$i,mat3:$,mat4:M},Get=/\.ktx2$/i;function Wet(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===it.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new Ht({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Dt&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!a){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}Iye(n,e)}}}function Iye(e,t){let i=e.uniforms[t];if(i===it.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let a;return Get.test(r.url)?a=tf(r.url):a=r.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function qet(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ls){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Pye(t,e)}}function Pye(e,t){let i=e.uniforms[t];if(i===it.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(o);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=r,s}function Yet(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Dye(e,n)}function Dye(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=Xet(r),s;if(o==="channels")s=UD(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;$et(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Dye(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=UD(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Wet(t)),e._initializationPromises.push(Iye(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(qet(t)),e._initializationPromises.push(Pye(e,t));else if(o.indexOf("mat")!==-1){let u=new Sye[o];e._uniforms[c]=function(){return Sye[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Xet(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 De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===it.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 r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function Ket(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new it({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Mt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;UD(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=UD(e,i,a)}}function UD(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function $et(e,t,n){return UD(e,t,t,n)}it._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};it.DefaultImageId="czm_defaultImage";it.DefaultCubeMapId="czm_defaultCubeMap";it.ColorType="Color";it._materialCache.addMaterial(it.ColorType,{fabric:{type:it.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.ImageType="Image";it._materialCache.addMaterial(it.ImageType,{fabric:{type:it.ImageType,uniforms:{image:it.DefaultImageId,repeat:new U(1,1),color:new z(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}});it.DiffuseMapType="DiffuseMap";it._materialCache.addMaterial(it.DiffuseMapType,{fabric:{type:it.DiffuseMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.AlphaMapType="AlphaMap";it._materialCache.addMaterial(it.AlphaMapType,{fabric:{type:it.AlphaMapType,uniforms:{image:it.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});it.SpecularMapType="SpecularMap";it._materialCache.addMaterial(it.SpecularMapType,{fabric:{type:it.SpecularMapType,uniforms:{image:it.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});it.EmissionMapType="EmissionMap";it._materialCache.addMaterial(it.EmissionMapType,{fabric:{type:it.EmissionMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.BumpMapType="BumpMap";it._materialCache.addMaterial(it.BumpMapType,{fabric:{type:it.BumpMapType,uniforms:{image:it.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:cU},translucent:!1});it.NormalMapType="NormalMap";it._materialCache.addMaterial(it.NormalMapType,{fabric:{type:it.NormalMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:gU},translucent:!1});it.GridType="Grid";it._materialCache.addMaterial(it.GridType,{fabric:{type:it.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:pU},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});it.StripeType="Stripe";it._materialCache.addMaterial(it.StripeType,{fabric:{type:it.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:EU},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});it.CheckerboardType="Checkerboard";it._materialCache.addMaterial(it.CheckerboardType,{fabric:{type:it.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:lU},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.DotType="Dot";it._materialCache.addMaterial(it.DotType,{fabric:{type:it.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:uU},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.WaterType="Water";it._materialCache.addMaterial(it.WaterType,{fabric:{type:it.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:it.DefaultImageId,normalMap:it.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:vU},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});it.RimLightingType="RimLighting";it._materialCache.addMaterial(it.RimLightingType,{fabric:{type:it.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:xU},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});it.FadeType="Fade";it._materialCache.addMaterial(it.FadeType,{fabric:{type:it.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:mU},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});it.PolylineArrowType="PolylineArrow";it._materialCache.addMaterial(it.PolylineArrowType,{fabric:{type:it.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:_U},translucent:!0});it.PolylineDashType="PolylineDash";it._materialCache.addMaterial(it.PolylineDashType,{fabric:{type:it.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:yU},translucent:!0});it.PolylineGlowType="PolylineGlow";it._materialCache.addMaterial(it.PolylineGlowType,{fabric:{type:it.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:AU},translucent:!0});it.PolylineOutlineType="PolylineOutline";it._materialCache.addMaterial(it.PolylineOutlineType,{fabric:{type:it.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:bU},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});it.ElevationContourType="ElevationContour";it._materialCache.addMaterial(it.ElevationContourType,{fabric:{type:it.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:dU},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:hU},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:TU},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:aU},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:fU},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:CU,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var lr=it;function mx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??mx.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:lr.fromType(lr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(mx.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}}});mx.prototype.getFragmentShaderSource=Or.prototype.getFragmentShaderSource;mx.prototype.isTranslucent=Or.prototype.isTranslucent;mx.prototype.getRenderState=Or.prototype.getRenderState;mx.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:rU,fragmentShaderSource:iU}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:sU,fragmentShaderSource:oU}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:nU,fragmentShaderSource:tU})};var Sr=mx;var SU=`in vec3 v_positionEC; in vec3 v_normalEC; in vec4 v_color; void main() @@ -2358,7 +3648,7 @@ material.diffuse = color.rgb; material.alpha = color.a; out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); } -`;var VL=`in vec3 position3DHigh; +`;var wU=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec4 color; @@ -2374,12 +3664,12 @@ v_normalEC = czm_normal * normal; v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var UT=`in vec4 v_color; +`;var dv=`in vec4 v_color; void main() { out_FragColor = czm_gammaCorrect(v_color); } -`;var zL=`in vec3 position3DHigh; +`;var IU=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; in float batchId; @@ -2390,7 +3680,7 @@ vec4 p = czm_computePosition(); v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function mp(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?zL:VL,r=i?UT:UL,s=i?mp.FLAT_VERTEX_FORMAT:mp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(mp.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}}});mp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;mp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;mp.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;mp.prototype.isTranslucent=no.prototype.isTranslucent;mp.prototype.getRenderState=no.prototype.getRenderState;var rn=mp;function VT(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(VT.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});VT.prototype.getType=function(e){return"Color"};var P1e=new Q;VT.prototype.getValue=function(e,t){return c(e)||(e=Q.now(P1e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};VT.prototype.equals=function(e){return this===e||e instanceof VT&&Y.equals(this._color,e._color)};var Ut=VT;function Z_(e){e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new Oi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Z_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Z_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Z_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Z_.prototype.rectangleToNativeRectangle=function(e,t){T.defined("rectangle",e);let n=O.toDegrees(e.west),i=O.toDegrees(e.south),o=O.toDegrees(e.east),r=O.toDegrees(e.north);return c(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};Z_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=O.toDegrees(o.west),o.south=O.toDegrees(o.south),o.east=O.toDegrees(o.east),o.north=O.toDegrees(o.north),o};Z_.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,l=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,h=o.north-t*f,p=o.north-(t+1)*f;return c(i)||(i=new ce(l,p,u,h)),i.west=l,i.south=p,i.east=u,i.north=h,i};Z_.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,l=e.longitude;i.east<i.west&&(l+=O.TWO_PI);let u=(l-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),c(n)?(n.x=u,n.y=f,n):new z(u,f)};var Ki=Z_;var Yee=new d,Xee=new d,Kee=new he,N6=new d,I1e=new d,$ee=new le,O1e=new Ki,yw=[new he,new he,new he,new he],bw=new z,gr={};gr.initialize=function(){let e=gr._initPromise;return c(e)||(e=we.fetchJson(tn("Assets/approximateTerrainHeights.json")).then(function(t){gr._terrainHeights=t}),gr._initPromise=e),e};gr.getMinimumMaximumHeights=function(e,t){if(T.defined("rectangle",e),!c(gr._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=Zee(e),i=gr._defaultMinTerrainHeight,o=gr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=gr._terrainHeights[r];c(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,Kee),Yee),t.cartographicToCartesian(ce.southwest(e,Kee),Xee),d.midpoint(Xee,Yee,N6);let a=t.scaleToGeodeticSurface(N6,I1e);if(c(a)){let l=d.distance(N6,a);i=Math.min(i,-l)}else i=gr._defaultMinTerrainHeight}return i=Math.max(gr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};gr.getBoundingSphere=function(e,t){if(T.defined("rectangle",e),!c(gr._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=Zee(e),i=gr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=gr._terrainHeights[r];c(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,$ee),le.union(o,$ee,o)};function Zee(e){he.fromRadians(e.east,e.north,0,yw[0]),he.fromRadians(e.west,e.north,0,yw[1]),he.fromRadians(e.east,e.south,0,yw[2]),he.fromRadians(e.west,e.south,0,yw[3]);let t=0,n=0,i=0,o=0,r=gr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let l=0;l<4;++l){let u=yw[l];if(O1e.positionToTileXY(u,s,bw),l===0)i=bw.x,o=bw.y;else if(i!==bw.x||o!==bw.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}}gr._terrainHeightsMaxLevel=6;gr._defaultMaxTerrainHeight=9e3;gr._defaultMinTerrainHeight=-1e5;gr._terrainHeights=void 0;gr._initPromise=void 0;Object.defineProperties(gr,{initialized:{get:function(){return c(gr._terrainHeights)}}});var fi=gr;function vc(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),c(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}vc.fromCorners=function(e,t,n){return T.defined("minimum",e),T.defined("maximum",t),c(n)||(n=new vc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};vc.fromPoints=function(e,t){if(c(t)||(t=new vc),!c(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.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,l=e.length;for(let h=1;h<l;h++){let p=e[h],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=d.midpoint(u,f,t.center),t};vc.clone=function(e,t){if(c(e))return c(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new vc(e.minimum,e.maximum,e.center)};vc.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var HL=new d;vc.intersectPlane=function(e,t){T.defined("box",e),T.defined("plane",t),HL=d.subtract(e.maximum,e.minimum,HL);let n=d.multiplyByScalar(HL,.5,HL),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?Wt.INSIDE:r+o<0?Wt.OUTSIDE:Wt.INTERSECTING};vc.prototype.clone=function(e){return vc.clone(this,e)};vc.prototype.intersectPlane=function(e){return vc.intersectPlane(this,e)};vc.prototype.equals=function(e){return vc.equals(this,e)};var q0=vc;var F6=new se;function Lh(e,t){if(T.defined("origin",e),t=t??ie.default,e=t.scaleToGeodeticSurface(e),!c(e))throw new C("origin must not be at the center of the ellipsoid.");let n=Ot.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(F.getColumn(n,0,F6)),this._yAxis=d.fromCartesian4(F.getColumn(n,1,F6));let i=d.fromCartesian4(F.getColumn(n,2,F6));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Lh.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 R1e=new q0;Lh.fromPoints=function(e,t){T.defined("cartesians",e);let n=q0.fromPoints(e,R1e);return new Lh(n.center,t)};var Qee=new _n,GL=new d;Lh.prototype.projectPointOntoPlane=function(e,t){T.defined("cartesian",e);let n=Qee;n.origin=e,d.normalize(e,n.direction);let i=Qn.rayPlane(n,this._plane,GL);if(c(i)||(d.negate(n.direction,n.direction),i=Qn.rayPlane(n,this._plane,GL)),c(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return c(t)?(t.x=r,t.y=s,t):new z(r,s)}};Lh.prototype.projectPointsOntoPlane=function(e,t){T.defined("cartesians",e),c(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);c(r)&&(t[n]=r,n++)}return t.length=n,t};Lh.prototype.projectPointToNearestOnPlane=function(e,t){T.defined("cartesian",e),c(t)||(t=new z);let n=Qee;n.origin=e,d.clone(this._plane.normal,n.direction);let i=Qn.rayPlane(n,this._plane,GL);c(i)||(d.negate(n.direction,n.direction),i=Qn.rayPlane(n,this._plane,GL));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return t.x=r,t.y=s,t};Lh.prototype.projectPointsToNearestOnPlane=function(e,t){T.defined("cartesians",e),c(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 M1e=new d;Lh.prototype.projectPointOntoEllipsoid=function(e,t){T.defined("cartesian",e),c(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=M1e;return d.multiplyByScalar(o,e.x,s),t=d.add(i,s,t),d.multiplyByScalar(r,e.y,s),d.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Lh.prototype.projectPointsOntoEllipsoid=function(e,t){T.defined("cartesians",e);let n=e.length;c(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 is=Lh;function Mi(e,t){this.center=d.clone(e??d.ZERO),this.halfAxes=J.clone(t??J.ZERO)}Mi.packedLength=d.packedLength+J.packedLength;Mi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e.center,t,n),J.pack(e.halfAxes,t,n+d.packedLength),t};Mi.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Mi),d.unpack(e,t,n.center),J.unpack(e,t+d.packedLength,n.halfAxes),n};var L1e=new d,N1e=new d,F1e=new d,B1e=new d,k1e=new d,U1e=new d,V1e=new J,z1e={unitary:new J,diagonal:new J};Mi.fromPoints=function(e,t){if(c(t)||(t=new Mi),!c(e)||e.length===0)return t.halfAxes=J.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],L1e);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let s=0,a=0,l=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,N1e),s+=p.x*p.x,a+=p.x*p.y,l+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,l*=r,u*=r,f*=r,h*=r;let g=V1e;g[0]=s,g[1]=a,g[2]=l,g[3]=a,g[4]=u,g[5]=f,g[6]=l,g[7]=f,g[8]=h;let m=J.computeEigenDecomposition(g,z1e),y=J.clone(m.unitary,t.halfAxes),b=J.getColumn(y,0,B1e),x=J.getColumn(y,1,k1e),A=J.getColumn(y,2,U1e),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,P=Number.MAX_VALUE,M=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],E=Math.max(d.dot(b,p),E),S=Math.max(d.dot(x,p),S),v=Math.max(d.dot(A,p),v),P=Math.min(d.dot(b,p),P),M=Math.min(d.dot(x,p),M),R=Math.min(d.dot(A,p),R);b=d.multiplyByScalar(b,.5*(P+E),b),x=d.multiplyByScalar(x,.5*(M+S),x),A=d.multiplyByScalar(A,.5*(R+v),A);let L=d.add(b,x,t.center);d.add(L,A,L);let B=F1e;return B.x=E-P,B.y=S-M,B.z=v-R,d.multiplyByScalar(B,.5,B),J.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var ote=new d,H1e=new d;function Jee(e,t,n,i,o,r,s,a,l,u,f){if(!c(o)||!c(r)||!c(s)||!c(a)||!c(l)||!c(u))throw new C("all extents (minimum/maximum X/Y/Z) are required.");c(f)||(f=new Mi);let h=f.halfAxes;J.setColumn(h,0,t,h),J.setColumn(h,1,n,h),J.setColumn(h,2,i,h);let p=ote;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(l+u)/2;let g=H1e;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-l)/2;let m=f.center;return p=J.multiplyByVector(h,p,p),d.add(e,p,m),J.multiplyByScale(h,g,h),f}var ete=new he,G1e=new d,j1e=new he,W1e=new he,q1e=new he,Y1e=new he,X1e=new he,K1e=new d,tte=new d,$1e=new d,nte=new d,Z1e=new d,Q1e=new z,J1e=new z,eRe=new z,tRe=new z,nRe=new z,iRe=new d,oRe=new d,rRe=new d,sRe=new d,aRe=new z,cRe=new d,lRe=new d,uRe=new d,fRe=new sn(d.UNIT_X,0);Mi.fromRectangle=function(e,t,n,i,o){if(!c(e))throw new C("rectangle is required");if(e.width<0||e.width>O.TWO_PI)throw new C("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>O.PI)throw new C("Rectangle height must be between 0 and pi");if(c(i)&&!O.equalsEpsilon(i.radii.x,i.radii.y,O.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=t??0,n=n??0,i=i??ie.default;let r,s,a,l,u,f,h;if(e.width<=O.PI){let M=ce.center(e,ete),R=i.cartographicToCartesian(M,G1e),L=new is(R,i);h=L.plane;let B=M.longitude,_=e.south<0&&e.north>0?0:M.latitude,w=he.fromRadians(B,e.north,n,j1e),D=he.fromRadians(e.west,e.north,n,W1e),I=he.fromRadians(e.west,_,n,q1e),N=he.fromRadians(e.west,e.south,n,Y1e),k=he.fromRadians(B,e.south,n,X1e),H=i.cartographicToCartesian(w,K1e),V=i.cartographicToCartesian(D,tte),j=i.cartographicToCartesian(I,$1e),U=i.cartographicToCartesian(N,nte),q=i.cartographicToCartesian(k,Z1e),X=L.projectPointToNearestOnPlane(H,Q1e),te=L.projectPointToNearestOnPlane(V,J1e),K=L.projectPointToNearestOnPlane(j,eRe),Z=L.projectPointToNearestOnPlane(U,tRe),ee=L.projectPointToNearestOnPlane(q,nRe);return r=Math.min(te.x,K.x,Z.x),s=-r,l=Math.max(te.y,X.y),a=Math.min(Z.y,ee.y),D.height=N.height=t,V=i.cartographicToCartesian(D,tte),U=i.cartographicToCartesian(N,nte),u=Math.min(sn.getPointDistance(h,V),sn.getPointDistance(h,U)),f=n,Jee(L.origin,L.xAxis,L.yAxis,L.zAxis,r,s,a,l,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ce.center(e,ete).longitude,b=d.fromRadians(y,m,n,i,iRe);b.z=0;let A=Math.abs(b.x)<O.EPSILON10&&Math.abs(b.y)<O.EPSILON10?d.UNIT_X:d.normalize(b,oRe),E=d.UNIT_Z,S=d.cross(A,E,rRe);h=sn.fromPointNormal(b,A,fRe);let v=d.fromRadians(y+O.PI_OVER_TWO,m,n,i,sRe);s=d.dot(sn.projectPointOntoPlane(h,v,aRe),S),r=-s,l=d.fromRadians(0,e.north,g?t:n,i,cRe).z,a=d.fromRadians(0,e.south,p?t:n,i,lRe).z;let P=d.fromRadians(e.east,m,n,i,uRe);return u=sn.getPointDistance(h,P),f=0,Jee(b,S,E,A,r,s,a,l,u,f,o)};Mi.fromTransformation=function(e,t){return T.typeOf.object("transformation",e),c(t)||(t=new Mi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=J.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Mi.clone=function(e,t){if(c(e))return c(t)?(d.clone(e.center,t.center),J.clone(e.halfAxes,t.halfAxes),t):new Mi(e.center,e.halfAxes)};Mi.intersectPlane=function(e,t){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("plane is required.");let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,l=Math.abs(r*o[J.COLUMN0ROW0]+s*o[J.COLUMN0ROW1]+a*o[J.COLUMN0ROW2])+Math.abs(r*o[J.COLUMN1ROW0]+s*o[J.COLUMN1ROW1]+a*o[J.COLUMN1ROW2])+Math.abs(r*o[J.COLUMN2ROW0]+s*o[J.COLUMN2ROW1]+a*o[J.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-l?Wt.OUTSIDE:u>=l?Wt.INSIDE:Wt.INTERSECTING};var rte=new d,ste=new d,ate=new d,dRe=new d,ite=new d,hRe=new d;Mi.distanceSquaredTo=function(e,t){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("cartesian is required.");let n=d.subtract(t,e.center,ote),i=e.halfAxes,o=J.getColumn(i,0,rte),r=J.getColumn(i,1,ste),s=J.getColumn(i,2,ate),a=d.magnitude(o),l=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,p=!0;a>0?d.divideByScalar(o,a,o):f=!1,l>0?d.divideByScalar(r,l,r):h=!1,u>0?d.divideByScalar(s,u,s):p=!1;let g=!f+!h+!p,m,y,b;if(g===1){let S=o;m=r,y=s,h?p||(S=s,y=o):(S=r,m=o),b=d.cross(m,y,ite),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(g===2){m=o,h?m=r:p&&(m=s);let S=d.UNIT_Y;S.equalsEpsilon(m,O.EPSILON3)&&(S=d.UNIT_X),y=d.cross(m,S,dRe),d.normalize(y,y),b=d.cross(m,y,ite),d.normalize(b,b),m===o?(r=y,s=b):m===r?(s=y,o=b):m===s&&(o=y,r=b)}else g===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let x=hRe;x.x=d.dot(n,o),x.y=d.dot(n,r),x.z=d.dot(n,s);let A=0,E;return x.x<-a?(E=x.x+a,A+=E*E):x.x>a&&(E=x.x-a,A+=E*E),x.y<-l?(E=x.y+l,A+=E*E):x.y>l&&(E=x.y-l,A+=E*E),x.z<-u?(E=x.z+u,A+=E*E):x.z>u&&(E=x.z-u,A+=E*E),A};var mRe=new d,pRe=new d;Mi.computePlaneDistances=function(e,t,n,i){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("position is required.");if(!c(n))throw new C("direction is required.");c(i)||(i=new $a);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,l=J.getColumn(a,0,rte),u=J.getColumn(a,1,ste),f=J.getColumn(a,2,ate),h=d.add(l,u,mRe);d.add(h,f,h),d.add(h,s,h);let p=d.subtract(h,t,pRe),g=d.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var _Re=new d,gRe=new d,yRe=new d;Mi.computeCorners=function(e,t){T.typeOf.object("box",e),c(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=J.getColumn(i,0,_Re),r=J.getColumn(i,1,gRe),s=J.getColumn(i,2,yRe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],s,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],s,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],s,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],s,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],s,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],s,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],s,t[7]),t};var bRe=new J;Mi.computeTransformation=function(e,t){T.typeOf.object("box",e),c(t)||(t=new F);let n=e.center,i=J.multiplyByUniformScale(e.halfAxes,2,bRe);return F.fromRotationTranslation(i,n,t)};var xRe=new le;Mi.isOccluded=function(e,t){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("occluder is required.");let n=le.fromOrientedBoundingBox(e,xRe);return!t.isBoundingSphereVisible(n)};Mi.prototype.intersectPlane=function(e){return Mi.intersectPlane(this,e)};Mi.prototype.distanceSquaredTo=function(e){return Mi.distanceSquaredTo(this,e)};Mi.prototype.computePlaneDistances=function(e,t,n){return Mi.computePlaneDistances(this,e,t,n)};Mi.prototype.computeCorners=function(e){return Mi.computeCorners(this,e)};Mi.prototype.computeTransformation=function(e){return Mi.computeTransformation(this,e)};Mi.prototype.isOccluded=function(e){return Mi.isOccluded(this,e)};Mi.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&J.equals(e.halfAxes,t.halfAxes)};Mi.prototype.clone=function(e){return Mi.clone(this,e)};Mi.prototype.equals=function(e){return Mi.equals(this,e)};var Pn=Mi;var jL={};jL.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new C("scale must be a finite number.");if(!Number.isFinite(n))throw new C("relativeHeight must be a finite number.");return(e-n)*t+n};var TRe=new he;jL.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,TRe);if(!c(r))return d.clone(e,o);let s=jL.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Rr=jL;var WL=`in vec3 position3DHigh; +`;function lg(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?IU:wU,o=i?dv:SU,s=i?lg.FLAT_VERTEX_FORMAT:lg.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(lg.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}}});lg.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;lg.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;lg.prototype.getFragmentShaderSource=Or.prototype.getFragmentShaderSource;lg.prototype.isTranslucent=Or.prototype.isTranslucent;lg.prototype.getRenderState=Or.prototype.getRenderState;var An=lg;function hv(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(hv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});hv.prototype.getType=function(e){return"Color"};var Jet=new K;hv.prototype.getValue=function(e,t){return l(e)||(e=K.now(Jet)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};hv.prototype.equals=function(e){return this===e||e instanceof hv&&X.equals(this._color,e._color)};var Kt=hv;var PU=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; #ifdef EXTRUDED_GEOMETRY @@ -2465,7 +3755,7 @@ v_color = czm_batchTable_color(batchId); #endif gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } -`;var Y0=`#ifdef VECTOR_TILE +`;var px=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif void main(void) @@ -2477,7 +3767,7 @@ out_FragColor = vec4(1.0); #endif czm_writeDepthClamp(); } -`;var cte={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};cte.NUMBER_OF_CLASSIFICATION_TYPES=3;var Un=Object.freeze(cte);var ARe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Dc=Object.freeze(ARe);function CRe(e,t){if(!c(e))throw new C("array is required.");if(!c(t)||t<1)throw new C("numberOfArrays must be greater than 0.");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 qL=CRe;function pp(e,t,n){if(!c(e))throw new C("context is required");if(!c(t))throw new C("attributes is required");if(!c(n))throw new C("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=ERe(t),o=e.floatingPointTexture,r=i===Ue.FLOAT&&!o,s=SRe(t,r),a=wRe(s,t,r),l=Math.floor(ut.maximumTextureSize/a),u=Math.min(n,l),f=a*u,h=Math.ceil(n/u),p=1/f,g=p*.5,m=1/h,y=m*.5;this._textureDimensions=new z(f,h),this._textureStep=new se(p,g,m,y),this._pixelDatatype=r?Ue.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*h;this._batchValues=i===Ue.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(pp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function ERe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==$.UNSIGNED_BYTE){t=!0;break}return t?Ue.FLOAT:Ue.UNSIGNED_BYTE}function ute(e,t){let n=e[t].componentsPerAttribute;return n===2?z:n===3?d:n===4?se:Number}function SRe(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!==$.UNSIGNED_BYTE&&t?i+=4:++i}return n}function wRe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==$.UNSIGNED_BYTE&&n?o+4:o+1}var xw=new se;function vRe(e,t,n){let i=se.unpack(e,t,xw),o=se.unpackFloat(i);i=se.unpack(e,t+4,xw);let r=se.unpackFloat(i);i=se.unpack(e,t+8,xw);let s=se.unpackFloat(i);i=se.unpack(e,t+12,xw);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function DRe(e,t,n){let i=se.packFloat(e.x,xw);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 lte=new se;pp.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?a=vRe(this._batchValues,s,lte):a=se.unpack(this._batchValues,s,lte);let l=ute(i,t);return c(l.fromCartesian4)?l.fromCartesian4(a,n):c(l.clone)?l.clone(a,n):a.x};var PRe=[void 0,void 0,new z,new d,new se],IRe=new se;pp.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");if(!c(n))throw new C("value is required.");let i=this._attributes,o=PRe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=ute(this._attributes,t);if(c(s.equals)?s.equals(r,n):r===n)return;let l=IRe;l.x=c(n.x)?n.x:n,l.y=c(n.y)?n.y:0,l.z=c(n.z)?n.z:0,l.w=c(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?DRe(l,this._batchValues,h):se.pack(l,this._batchValues,h),this._batchValuesDirty=!0};function ORe(e,t){let n=e._textureDimensions;e._texture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Qt.NEAREST,flipY:!1})}function RRe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}pp.prototype.update=function(e){c(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,c(this._texture)||ORe(this,e.context),RRe(this))};pp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function MRe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +`;var lZ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};lZ.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(lZ);var ti=lZ;var Rye={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(Rye);var xc=Rye;function ug(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=Zet(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=Qet(t,o),a=ett(s,t,o),c=Math.floor(Ut.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new U(f,d),this._textureStep=new se(p,g,m,y),this._pixelDatatype=o?ze.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let A=4*f*d;this._batchValues=i===ze.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(ug.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function Zet(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ze.FLOAT:ze.UNSIGNED_BYTE}function Mye(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function Qet(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function ett(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var zD=new se;function ttt(e,t,n){let i=se.unpack(e,t,zD),r=se.unpackFloat(i);i=se.unpack(e,t+4,zD);let o=se.unpackFloat(i);i=se.unpack(e,t+8,zD);let s=se.unpackFloat(i);i=se.unpack(e,t+12,zD);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function ntt(e,t,n){let i=se.packFloat(e.x,zD);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 Oye=new se;ug.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?a=ttt(this._batchValues,s,Oye):a=se.unpack(this._batchValues,s,Oye);let c=Mye(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var itt=[void 0,void 0,new U,new h,new se],rtt=new se;ug.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=itt[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=Mye(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=rtt;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 u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?ntt(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function ott(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Ht.NEAREST,flipY:!1})}function stt(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}ug.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||ott(this,e.context),stt(this))};ug.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Mt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function att(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; vec2 computeSt(float batchId) { float stepX = batchTextureStep.x; @@ -2498,41 +3788,41 @@ vec2 computeSt(float batchId) float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); } -`}function LRe(e){return e===1?"float":`vec${e}`}function NRe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function FRe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=LRe(o),a=NRe(o),l=e._offsets[t],u=`${s} ${r}(float batchId) +`}function ctt(e){return e===1?"float":`vec${e}`}function ltt(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function utt(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=ctt(r),a=ltt(r),c=e._offsets[t],u=`${s} ${o}(float batchId) { vec2 st = computeSt(batchId); - st.x += batchTextureStep.x * float(${l}); -`;return e._packFloats&&i.componentDatatype!==Ue.UNSIGNED_BYTE?u+=`vec4 textureValue; + st.x += batchTextureStep.x * float(${c}); +`;return e._packFloats&&i.componentDatatype!==ze.UNSIGNED_BYTE?u+=`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))); `:u+=` vec4 textureValue = texture(batchTexture, st); `,u+=` ${s} value = textureValue${a}; -`,e._pixelDatatype===Ue.UNSIGNED_BYTE&&i.componentDatatype===$.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; -`:e._pixelDatatype===Ue.FLOAT&&i.componentDatatype===$.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; +`,e._pixelDatatype===ze.UNSIGNED_BYTE&&i.componentDatatype===Y.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0; +`:e._pixelDatatype===ze.FLOAT&&i.componentDatatype===Y.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; `),u+=` return value; } -`,u}pp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${MRe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=FRe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r} +`,u}ug.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${att(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=utt(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} ${t} -${s}`}};pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),de(this)};var zT=pp;function ml(e){this._ellipsoid=e??ie.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(ml.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ml.mercatorAngleToGeodeticLatitude=function(e){return O.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};ml.geodeticLatitudeToMercatorAngle=function(e){e>ml.MaximumLatitude?e=ml.MaximumLatitude:e<-ml.MaximumLatitude&&(e=-ml.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};ml.MaximumLatitude=ml.mercatorAngleToGeodeticLatitude(Math.PI);ml.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=ml.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};ml.prototype.unproject=function(e,t){if(!c(e))throw new C("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=ml.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Li=ml;function BRe(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(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)c(e[r].geometry)&&Nn.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function B6(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function kRe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];c(i.geometry)?B6(i.geometry,n):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&(B6(i.westHemisphereGeometry,n),B6(i.eastHemisphereGeometry,n))}}function URe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,l,u,f,h=t.length;for(l=0;l<h;++l)if(c(t[l].geometry)){f=t[l].geometry.primitiveType;break}for(l=1;l<h;++l)if(c(t[l].geometry)&&t[l].geometry.primitiveType!==f)throw new C("All instance geometries must have the same primitiveType.");if(BRe(t,a,o),!o)for(l=0;l<h;++l)c(t[l].geometry)&&Nn.splitLongitude(t[l]);if(kRe(t),r)for(l=0;l<h;++l){let g=t[l];c(g.geometry)?(Nn.reorderForPostVertexCache(g.geometry),Nn.reorderForPreVertexCache(g.geometry)):c(g.westHemisphereGeometry)&&c(g.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(g.westHemisphereGeometry),Nn.reorderForPreVertexCache(g.westHemisphereGeometry),Nn.reorderForPostVertexCache(g.eastHemisphereGeometry),Nn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(h=p.length,l=0;l<h;++l){u=p[l];let g=u.attributes;if(o)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===$.DOUBLE&&Nn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===$.DOUBLE){let y=`${m}3D`,b=`${m}2D`;Nn.projectTo2D(u,m,y,b,n),c(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),Nn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Nn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Nn.compressVertices(u)}if(!i){let g=[];for(h=p.length,l=0;l<h;++l)u=p[l],g=g.concat(Nn.fitToUnsignedShortIndices(u));p=g}return p}function k6(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let l=e.length;for(let u=0;u<l;++u){let h=e[u][t];if(!c(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 VRe(e,t){let n=[];return k6(e,"geometry",t,n),k6(e,"westHemisphereGeometry",t,n),k6(e,"eastHemisphereGeometry",t,n),n}var _p={};_p.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=URe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=VRe(i,t))),c(i[0].attributes)&&c(i[0].attributes.offset)&&(s=new Array(o),a=!0));let l=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;c(p)&&(l[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;c(g)&&c(m)&&(c(g.boundingSphere)&&c(m.boundingSphere)&&(l[f]=le.union(g.boundingSphere,m.boundingSphere)),c(g.boundingSphereCV)&&c(m.boundingSphereCV)&&(u[f]=le.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:l,boundingSpheresCV:u}};function zRe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];c(o)&&c(o.values)&&t.push(o.values.buffer)}c(e.indices)&&t.push(e.indices.buffer)}function HRe(e,t){let n=e.length;for(let i=0;i<n;++i)zRe(e[i],t)}function GRe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!c(o))continue;let r=o.attributes;t+=7+2*le.packedLength+(c(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&c(r[s])){let a=r[s];t+=5+a.values.length}}return t}_p.packCreateGeometryResults=function(e,t){let n=new Float64Array(GRe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let l=e[a],u=c(l);if(n[s++]=u?1:0,!u)continue;n[s++]=l.primitiveType,n[s++]=l.geometryType,n[s++]=l.offsetAttribute??-1;let f=c(l.boundingSphere)?1:0;n[s++]=f,f&&le.pack(l.boundingSphere,n,s),s+=le.packedLength;let h=c(l.boundingSphereCV)?1:0;n[s++]=h,h&&le.pack(l.boundingSphereCV,n,s),s+=le.packedLength;let p=l.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&c(p[y])&&(g.push(y),c(o[y])||(o[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let b=g[y],x=p[b];n[s++]=o[b],n[s++]=x.componentDatatype,n[s++]=x.componentsPerAttribute,n[s++]=x.normalize?1:0,n[s++]=x.values.length,n.set(x.values,s),s+=x.values.length}let m=c(l.indices)?l.indices.length:0;n[s++]=m,m>0&&(n.set(l.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};_p.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 l=n[s++],u=n[s++],f=n[s++];f===-1&&(f=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 y,b,x,A=new hn,E=n[s++];for(i=0;i<E;i++){let v=t[n[s++]],P=n[s++];x=n[s++];let M=n[s++]!==0;y=n[s++],b=$.createTypedArray(P,y);for(let R=0;R<y;R++)b[R]=n[s++];A[v]=new ve({componentDatatype:P,componentsPerAttribute:x,normalize:M,values:b})}let S;if(y=n[s++],y>0){let v=b.length/x;for(S=Fe.createTypedArray(v,y),i=0;i<y;i++)S[i]=n[s++]}o[r++]=new ct({primitiveType:l,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:S,attributes:A,offsetAttribute:f})}return o};function jRe(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(F.pack(s.modelMatrix,i,o),o+=F.packedLength,c(s.attributes)&&c(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 WRe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,c(t[o])&&(s={offset:new Ji(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}_p.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:jRe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Oi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};_p.unpackCombineGeometryParameters=function(e){let t=WRe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let l=_p.unpackCreateGeometryResults(n[a]),u=l.length;for(let f=0;f<u;f++){let h=l[f],p=t[o];p.geometry=h,++o}}let r=ie.clone(e.ellipsoid),s=e.isGeographic?new Oi(r):new Li(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function fte(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];c(s)?(i[o++]=1,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function dte(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}_p.packCombineGeometryResults=function(e,t){c(e.geometries)&&HRe(e.geometries,t);let n=fte(e.boundingSpheres),i=fte(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}};_p.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:dte(e.boundingSpheres),boundingSpheresCV:dte(e.boundingSpheresCV)}};var HT=_p;var qRe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Mr=Object.freeze(qRe);var Ql={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Ql.NUMBER_OF_SHADOW_MODES=4;Ql.castShadows=function(e){return e===Ql.ENABLED||e===Ql.CAST_ONLY};Ql.receiveShadows=function(e){return e===Ql.ENABLED||e===Ql.RECEIVE_ONLY};Ql.fromCastReceive=function(e,t){return e&&t?Ql.ENABLED:e?Ql.CAST_ONLY:t?Ql.RECEIVE_ONLY:Ql.DISABLED};var Tn=Object.freeze(Ql);function yr(e){if(e=e??W.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=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,c(this.rtcCenter)&&(!c(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new C("Relative-to-center rendering only supports one geometry instance.");this.shadows=e.shadows??Tn.DISABLED,this._translucent=void 0,this._state=Mr.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(yr.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 YRe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&c(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let l=e[a].attributes[o];if(!c(l)||r.componentDatatype!==l.componentDatatype||r.componentsPerAttribute!==l.componentsPerAttribute||r.normalize!==l.normalize){s=!1;break}}s&&n.push(o)}return n}var XRe=new z,KRe=new d,Tte=new se;function Ate(e){let t=e.length;if(t===1)return e[0];if(t===2)return z.unpack(e,0,XRe);if(t===3)return d.unpack(e,0,KRe);if(t===4)return se.unpack(e,0,Tte)}function $Re(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=YRe(i),s=r.length,a=[],l={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=r[g],y=p[m],l[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:$.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:$.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,x=new zT(t,a,o);for(g=0;g<o;++g){let A=i[g];p=A.attributes;for(let M=0;M<s;++M){m=r[M],y=p[m];let R=Ate(y.value),L=l[m];x.setBatchedAttribute(g,L,R)}let E={primitive:A.pickPrimitive??e};c(A.id)&&(E.id=A.id);let S=t.createPickId(E);e._pickIds.push(S);let v=S.color,P=Tte;P.x=G.floatToByte(v.red),P.y=G.floatToByte(v.green),P.z=G.floatToByte(v.blue),P.w=G.floatToByte(v.alpha),x.setBatchedAttribute(g,b-1,P)}e._batchTable=x,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function ZRe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function QRe(e){let t=e.attributes,n=new hn;for(let o in t)t.hasOwnProperty(o)&&c(t[o])&&(n[o]=ZRe(t[o]));let i;if(c(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ct({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function JRe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var eMe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;yr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=eMe.exec(t))!==null;){let a=i[1],l=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;l!=="vec4 czm_computePosition()"&&(o+=`${l}; -`),c(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+=`${l} +${s}`}};ug.prototype.isDestroyed=function(){return!1};ug.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var mv=ug;function ftt(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!M.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Wn.transformToWorldCoordinates(e[o]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function uZ(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function dtt(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?uZ(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(uZ(i.westHemisphereGeometry,n),uZ(i.eastHemisphereGeometry,n))}}function htt(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(ftt(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Wn.splitLongitude(t[c]);if(dtt(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Wn.reorderForPostVertexCache(g.geometry),Wn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Wn.reorderForPostVertexCache(g.westHemisphereGeometry),Wn.reorderForPreVertexCache(g.westHemisphereGeometry),Wn.reorderForPostVertexCache(g.eastHemisphereGeometry),Wn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Wn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Wn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Wn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),Wn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Wn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Wn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Wn.fitToUnsignedShortIndices(u));p=g}return p}function fZ(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function mtt(e,t){let n=[];return fZ(e,"geometry",t,n),fZ(e,"westHemisphereGeometry",t,n),fZ(e,"eastHemisphereGeometry",t,n),n}var fg={};fg.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=htt(e),t.length>0&&(n=Wn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=mtt(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=le.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=le.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function ptt(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function gtt(e,t){let n=e.length;for(let i=0;i<n;++i)ptt(e[i],t)}function _tt(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*le.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}fg.packCreateGeometryResults=function(e,t){let n=new Float64Array(_tt(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&le.pack(c.boundingSphere,n,s),s+=le.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&le.pack(c.boundingSphereCV,n,s),s+=le.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[s++]=r[A],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};fg.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=le.unpack(n,s)),s+=le.packedLength,n[s++]===1&&(p=le.unpack(n,s)),s+=le.packedLength;let y,A,b,x=new En,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],S=n[s++];b=n[s++];let I=n[s++]!==0;y=n[s++],A=Y.createTypedArray(S,y);for(let R=0;R<y;R++)A[R]=n[s++];x[v]=new Ne({componentDatatype:S,componentsPerAttribute:b,normalize:I,values:A})}let E;if(y=n[s++],y>0){let v=A.length/b;for(E=je.createTypedArray(v,y),i=0;i<y;i++)E[i]=n[s++]}r[o++]=new wt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function ytt(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(M.pack(s.modelMatrix,i,r),r+=M.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function Att(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=M.unpack(t,r),s;r+=M.packedLength,l(t[r])&&(s={offset:new vr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}fg.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ytt(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof ji,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};fg.unpackCombineGeometryParameters=function(e){let t=Att(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=fg.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=ee.clone(e.ellipsoid),s=e.isGeographic?new ji(o):new xi(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Nye(e){let t=e.length,n=1+(le.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,le.pack(e[o],i,r)):i[r++]=0,r+=le.packedLength}return i}function Lye(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}fg.packCombineGeometryResults=function(e,t){l(e.geometries)&>t(e.geometries,t);let n=Nye(e.boundingSpheres),i=Nye(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}};fg.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Lye(e.boundingSpheres),boundingSpheresCV:Lye(e.boundingSpheresCV)}};var pv=fg;var Fye={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(Fye);var gs=Fye;var Cu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Cu.NUMBER_OF_SHADOW_MODES=4;Cu.castShadows=function(e){return e===Cu.ENABLED||e===Cu.CAST_ONLY};Cu.receiveShadows=function(e){return e===Cu.ENABLED||e===Cu.RECEIVE_ONLY};Cu.fromCastReceive=function(e,t){return e&&t?Cu.ENABLED:e?Cu.CAST_ONLY:t?Cu.RECEIVE_ONLY:Cu.DISABLED};Object.freeze(Cu);var Dn=Cu;function Jo(e){e=e??H.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=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Dn.DISABLED,this._translucent=void 0,this._state=gs.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(Jo.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 btt(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var xtt=new U,Ttt=new h,Wye=new se;function qye(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,xtt);if(t===3)return h.unpack(e,0,Ttt);if(t===4)return se.unpack(e,0,Wye)}function Ett(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=btt(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=o[g],y=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=a.length,b=new mv(t,a,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let I=0;I<s;++I){m=o[I],y=p[m];let R=qye(y.value),O=c[m];b.setBatchedAttribute(g,O,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let E=t.createPickId(T);e._pickIds.push(E);let v=E.color,S=Wye;S.x=z.floatToByte(v.red),S.y=z.floatToByte(v.green),S.z=z.floatToByte(v.blue),S.w=z.floatToByte(v.alpha),b.setBatchedAttribute(g,A-1,S)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function Ctt(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ne({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function vtt(e){let t=e.attributes,n=new En;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=Ctt(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new wt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function Stt(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var wtt=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Jo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=wtt.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${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,""),r+=`uniform mat4 u_modifiedModelView; +`,o+=`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+=`${l} +`,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; +`:(o+=`in vec3 ${a}2DHigh; in vec3 ${a}2DLow; -`,s+=`${l} +`,s+=`${c} { vec4 p; if (czm_morphTime == 1.0) @@ -2553,36 +3843,36 @@ in vec3 ${a}2DLow; return p; } -`)}return[o,r,t,s].join(` -`)};yr._appendShowToShader=function(e,t){return c(e._batchTableAttributeIndices.show)?`${He.replaceMain(t,"czm_non_show_main")} +`)}return[r,o,t,s].join(` +`)};Jo._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Xe.replaceMain(t,"czm_non_show_main")} void main() { czm_non_show_main(); gl_Position *= czm_batchTable_show(batchId); -}`:t};yr._updateColorAttribute=function(e,t,n){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;if(n&&!c(e._batchTableAttributeIndices.depthFailColor))throw new C("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");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 hte(e){return`${He.replaceMain(e,"czm_non_pick_main")} +}`:t};Jo._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 Bye(e){return`${Xe.replaceMain(e,"czm_non_pick_main")} out vec4 v_pickColor; void main() { czm_non_pick_main(); v_pickColor = czm_batchTable_pickColor(batchId); -}`}function mte(e){return`in vec4 v_pickColor; -${e}`}yr._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};yr._appendOffsetToShader=function(e,t){if(!c(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};yr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=He.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() +}`}function kye(e){return`in vec4 v_pickColor; +${e}`}Jo._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};Jo._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),r=`vec4 $1 = czm_computePosition(); +`;return r+=` if (czm_sceneMode == czm_sceneMode3D) +`,r+=` { +`,r+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+=` } +`,r+=` else +`,r+=` { +`,r+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+=` } +`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,r),i};Jo._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Xe.replaceMain(t,"czm_non_distanceDisplayCondition_main"),r=`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); +`;return n?r+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); +`:r+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); vec4 centerRTE; if (czm_morphTime == 1.0) @@ -2600,7 +3890,7 @@ ${e}`}yr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), czm_morphTime); } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; +`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; float distanceSq; if (czm_sceneMode == czm_sceneMode2D) { @@ -2616,26 +3906,26 @@ ${e}`}yr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} -${o}`};function pte(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",l="compressedAttributes",u=`in ${a} ${l};`,f="",h="";if(i){f+=`vec2 st; -`;let m=s>1?`${l}.x`:l;h+=` st = czm_decompressTextureCoordinates(${m}); -`}n&&o&&r?(f+=`vec3 normal; +${r}`};function Uye(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 r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +`;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); +`}n&&r&&o?(f+=`vec3 normal; vec3 tangent; vec3 bitangent; -`,h+=` czm_octDecode(${l}.${i?"yz":"xy"}, normal, tangent, bitangent); +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); `):(n&&(f+=`vec3 normal; -`,h+=` normal = czm_octDecode(${l}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(f+=`vec3 tangent; -`,h+=` tangent = czm_octDecode(${l}.${i&&n?"z":"y"}); -`),r&&(f+=`vec3 bitangent; -`,h+=` bitangent = czm_octDecode(${l}.${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=He.replaceMain(p,"czm_non_compressed_main");let g=`void main() +`,d+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),r&&(f+=`vec3 tangent; +`,d+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),o&&(f+=`vec3 bitangent; +`,d+=` 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=Xe.replaceMain(p,"czm_non_compressed_main");let g=`void main() { -${h} czm_non_compressed_main(); +${d} czm_non_compressed_main(); }`;return[u,f,p,g].join(` -`)}function tMe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`)}function Itt(e){let t=Xe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} -`,t}function nMe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`,t}function Ptt(e){let t=Xe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); @@ -2643,7 +3933,7 @@ ${h} czm_non_compressed_main(); czm_writeDepthClamp(); #endif } -`,t}function _te(e,t){let n=e.vertexAttributes;for(let i in n)if(n.hasOwnProperty(i)&&!c(t[i]))throw new C(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function iMe(e,t){return function(){return e[t]}}var U6=Math.max(zt.hardwareConcurrency-1,1),YL,oMe=new bi("combineGeometry");function rMe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Mr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,l=[],u=[];for(o=0;o<a;++o){if(i=n[o].geometry,s.push(n[o].id),c(i._workerName)&&c(i._workerPath)||!c(i._workerName)&&!c(i._workerPath))throw new C("Must define either _workerName or _workerPath for asynchronous geometry.");u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!c(YL))for(YL=new Array(U6),o=0;o<U6;o++)YL[o]=new bi("createGeometry");let f;for(u=qL(u,U6),o=0;o<u.length;o++){let h=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,c(i.constructor.pack)&&(f.offset=h,h+=i.constructor.packedLength??i.packedLength);let m;if(h>0){let y=new Float64Array(h);for(m=[y.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}l.push(YL[o].scheduleTask({subTasks:u[o]},m))}e._state=Mr.CREATING,Promise.all(l).then(function(h){e._createGeometryResults=h,e._state=Mr.CREATED}).catch(function(h){Aw(e,t,Mr.FAILED,h)})}else if(e._state===Mr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let l=t.scene3DOnly,u=t.mapProjection,f=oMe.scheduleTask(HT.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Mr.COMBINING,Promise.resolve(f).then(function(h){let p=HT.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Mr.COMBINED):Aw(e,t,Mr.FAILED,void 0)}).catch(function(h){Aw(e,t,Mr.FAILED,h)})}}function sMe(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,l=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;c(p.attributes)&&c(p.primitiveType)?g=QRe(p):g=p.constructor.createGeometry(p),o[l++]=JRe(s,g),r.push(s.id)}o.length=l;let u=t.scene3DOnly,f=t.mapProjection,h=HT.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=F.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Mr.COMBINED):Aw(e,t,Mr.FAILED,void 0)}function aMe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!c(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!c(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 y=a[i],b=e._batchTable.getBatchedAttribute(i,n,new d);y=r[i].clone(y),wte(y,b,o[i])}let l=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||le.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING?l.push(y):(u.push(y),f.push(y))}let h=l[0],p=f[0],g=u[0];for(i=1;i<l.length;i++)h=le.union(h,l[i]);for(i=1;i<f.length;i++)p=le.union(p,f[i]);for(i=1;i<u.length;i++)g=le.union(g,u[i]);let m=[];for(c(h)&&m.push(h),c(p)&&m.push(p),c(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=le.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}yr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var gte=new Hn,Cte=new he,Ete=new d,Ste=new le;function cMe(e,t){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,l=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!c(y))continue;let b=e.modelMatrix;c(b)&&(y=le.transform(y,b,Ste));let x=y.center,A=y.radius,E=Hn.fromCartesian(x,gte);if(h.setBatchedAttribute(m,o,E.high),h.setBatchedAttribute(m,r,E.low),!t.scene3DOnly){let S=f.cartesianToCartographic(x,Cte),v=u.project(S,Ete);E=Hn.fromCartesian(v,gte),h.setBatchedAttribute(m,s,E.high),h.setBatchedAttribute(m,a,E.low)}h.setBatchedAttribute(m,l,A)}e._batchTableBoundingSpheresUpdated=!0}var V6=new d,lMe=new d;function yte(e,t){if(!c(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,l=a.length;for(let u=0;u<l;++u){let f=a[u];if(!c(f))continue;let h=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){s.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;c(p)&&(f=le.transform(f,p,Ste));let g=f.center;g=r.scaleToGeodeticSurface(g,lMe);let m=r.cartesianToCartographic(g,Cte),y=o.project(m,Ete),b=d.add(h,g,V6);m=r.cartesianToCartographic(b,m);let x=o.project(m,V6),A=d.subtract(x,y,V6),E=A.x;A.x=A.z,A.z=A.y,A.y=E,s.setBatchedAttribute(u,i,A)}e._batchTableOffsetsUpdated=!0}function uMe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let l=0;l<a;++l){let u=i[l];if(s.push(ni.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Be.STATIC_DRAW,interleave:e._interleave})),c(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,g=f.z;f.x=g,f.y=h,f.z=p,e._boundingSphereCV.push(le.clone(u.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,Aw(e,t,Mr.COMPLETE,void 0)}function fMe(e,t,n,i){let o=n.getRenderState(),r;i?(r=We(o,!1),r.cull={enabled:!0,face:Ti.BACK},e._frontFaceRS=ze.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceRS=ze.fromCache(r)):(e._frontFaceRS=ze.fromCache(o),e._backFaceRS=e._frontFaceRS),r=We(o,!1),c(e._depthFailAppearance)&&(r.depthTest.enabled=!1),c(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=We(o,!1),r.depthTest.func=Dc.GREATER,i?(r.cull={enabled:!0,face:Ti.BACK},e._frontFaceDepthFailRS=ze.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceDepthFailRS=ze.fromCache(r)):(e._frontFaceDepthFailRS=ze.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function dMe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=yr._appendOffsetToShader(e,r),r=yr._appendShowToShader(e,r),r=yr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=hte(r),r=yr._updateColorAttribute(e,r,!1),r=pte(e,r),r=yr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=mte(s),e._sp=en.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),_te(e._sp,o),c(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=yr._appendShowToShader(e,r),r=yr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=hte(r),r=yr._updateColorAttribute(e,r,!0),r=pte(e,r),r=yr._modifyShaderPosition(e,r,t.scene3DOnly),r=tMe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=mte(s),s=nMe(s),e._spDepthFail=en.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),_te(e._spDepthFail,o))}var Tw=new F,bte=new d;function xte(e,t,n,i){let o=c(n)?n._uniforms:void 0,r={},s=t.uniforms;if(c(s)){for(let l in s)if(s.hasOwnProperty(l)){if(c(o)&&c(o[l]))throw new C(`Appearance and material have a uniform with the same name: ${l}`);r[l]=iMe(s,l)}}let a=xt(r,o);return a=e._batchTable.getUniformMapCallback()(a),c(e.rtcCenter)&&(a.u_modifiedModelView=function(){let l=i.context.uniformState.view;return F.multiply(l,e._modelMatrix,Tw),F.multiplyByPoint(Tw,e.rtcCenter,bte),F.setTranslation(Tw,bte,Tw),Tw}),a}function hMe(e,t,n,i,o,r,s,a){let l=xte(e,t,n,a),u;c(e._depthFailAppearance)&&(u=xte(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?De.TRANSLUCENT:De.OPAQUE,h=o?2:1;h*=c(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,g=0;for(let m=0;m<p;++m){let y;o&&(y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=l,y.pass=f,++m),y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=l,y.pass=f,c(e._depthFailAppearance)&&(o&&(++m,y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}yr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],c(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(c(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let l=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;l.radius=s.radius+f}};function mMe(e,t,n,i,o,r,s,a){if(t.mode!==oe.SCENE3D&&!F.equals(o,F.IDENTITY))throw new C("Primitive.modelMatrix is only supported in 3D mode.");yr._updateBoundingVolumes(e,t,o);let l;t.mode===oe.SCENE3D?l=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===oe.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=Tn.castShadows(e.shadows),g=Tn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=c(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let x=Math.floor(b/y),A=n[b];A.modelMatrix=o,A.boundingVolume=l[x],A.cull=r,A.debugShowBoundingVolume=s,A.castShadows=p,A.receiveShadows=g,h?A.pickId="v_pickColor":A.pickId=void 0,u.push(A)}}}yr.prototype.update=function(e){if(!c(this.geometryInstances)&&this._va.length===0||c(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!c(this.appearance)||e.mode!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(c(this._error))throw this._error;if(c(this.rtcCenter)&&!e.scene3DOnly)throw new C("RTC rendering is only available for 3D only scenes.");if(this._state===Mr.FAILED)return;let t=e.context;if(c(this._batchTable)||$Re(this,t),this._batchTable.attributes.length>0){if(ut.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!==Mr.COMPLETE&&this._state!==Mr.COMBINED&&(this.asynchronous?rMe(this,e):sMe(this,e)),this._state===Mr.COMBINED&&(cMe(this,e),yte(this,e),uMe(this,e)),!this.show||this._state!==Mr.COMPLETE)return;this._batchTableOffsetsUpdated||yte(this,e),this._recomputeBoundingSpheres&&aMe(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=c(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 l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),c(this._material)&&this._material.update(t);let u=n.closed&&l;o&&(this._createRenderStatesFunction??fMe)(this,t,n,u),r&&(this._createShaderProgramFunction??dMe)(this,e,n),(o||r)&&(this._createCommandsFunction??hMe)(this,n,i,l,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??mMe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var pMe=new le,_Me=new le;function wte(e,t,n){if(n===Zt.TOP){let i=le.clone(e,pMe),o=le.clone(e,_Me);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===Zt.ALL&&(e.center=d.add(e.center,t,e.center));return e}function gMe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=$.createTypedArray(o.componentDatatype,r);return c(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function yMe(e,t,n,i,o){return function(r){if(!c(r)||!c(r.length)||r.length<1||r.length>4)throw new C("value must be and array with length between 1 and 4.");let s=Ate(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var bMe=new d;function xMe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(c(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;c(r)&&wte(i,d.fromArray(r.get(),0,bMe),e._offsetInstanceExtend[n]),c(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function TMe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}yr.prototype.getGeometryInstanceAttributes=function(e){if(!c(e))throw new C("id is required");if(!c(this._batchTable))throw new C("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(c(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let l={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];l[u]={get:gMe(s,n,f),set:yMe(s,n,f,this,u)}}return xMe(this,l,n),TMe(this,l,n),Object.defineProperties(t,l),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};yr.prototype.isDestroyed=function(){return!1};yr.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,de(this)};function Aw(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Mr.COMPLETE||e._state===Mr.FAILED})}var In=yr;function AMe(e){if(e=e??W.EMPTY_OBJECT,!c(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.value))throw new C("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Pc=AMe;var Cw=`#ifdef TEXTURE_COORDINATES +`,t}function zye(e,t){let n=e.vertexAttributes}function Dtt(e,t){return function(){return e[t]}}var dZ=Math.max(dn.hardwareConcurrency-1,1),DU,Rtt=new $n("combineGeometry");function Ott(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===gs.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(DU))for(DU=new Array(dZ),r=0;r<dZ;r++)DU[r]=new $n("createGeometry");let f;for(u=F3(u,dZ),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(DU[r].scheduleTask({subTasks:u[r]},m))}e._state=gs.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=gs.CREATED}).catch(function(d){jD(e,t,gs.FAILED,d)})}else if(e._state===gs.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=Rtt.scheduleTask(pv.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,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=gs.COMBINING,Promise.resolve(f).then(function(d){let p=pv.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.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=gs.COMBINED):jD(e,t,gs.FAILED,void 0)}).catch(function(d){jD(e,t,gs.FAILED,d)})}}function Mtt(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=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=vtt(p):g=p.constructor.createGeometry(p),r[c++]=Stt(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=pv.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=M.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=gs.COMBINED):jD(e,t,gs.FAILED,void 0)}function Ntt(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.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 y=a[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),$ye(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||le.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=le.union(d,c[i]);for(i=1;i<f.length;i++)p=le.union(p,f[i]);for(i=1;i<u.length;i++)g=le.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=le.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Jo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Vye=new Sn,Yye=new he,Xye=new h,Kye=new le;function Ltt(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=le.transform(y,A,Kye));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,Vye);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,Yye),v=u.project(E,Xye);T=Sn.fromCartesian(v,Vye),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var hZ=new h,Ftt=new h;function jye(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=le.transform(f,p,Kye));let g=f.center;g=o.scaleToGeodeticSurface(g,Ftt);let m=o.cartesianToCartographic(g,Yye),y=r.project(m,Xye),A=h.add(d,g,hZ);m=o.cartesianToCartographic(A,m);let b=r.project(m,hZ),x=h.subtract(b,y,hZ),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function Btt(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(Vn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(le.clone(u.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,jD(e,t,gs.COMPLETE,void 0)}function ktt(e,t,n,i){let r=n.getRenderState(),o;i?(o=Ze(r,!1),o.cull={enabled:!0,face:Gi.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=Gi.FRONT,e._backFaceRS=Ge.fromCache(o)):(e._frontFaceRS=Ge.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Ze(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Ze(r,!1),o.depthTest.func=xc.GREATER,i?(o.cull={enabled:!0,face:Gi.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=Gi.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function Utt(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=Jo._appendOffsetToShader(e,o),o=Jo._appendShowToShader(e,o),o=Jo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=Bye(o),o=Jo._updateColorAttribute(e,o,!1),o=Uye(e,o),o=Jo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=kye(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),zye(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=Jo._appendShowToShader(e,o),o=Jo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=Bye(o),o=Jo._updateColorAttribute(e,o,!0),o=Uye(e,o),o=Jo._modifyShaderPosition(e,o,t.scene3DOnly),o=Itt(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=kye(s),s=Ptt(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),zye(e._spDepthFail,r))}var VD=new M,Hye=new h;function Gye(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=Dtt(s,c));let a=Mt(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,VD),M.multiplyByPoint(VD,e.rtcCenter,Hye),M.setTranslation(VD,Hye,VD),VD}),a}function ztt(e,t,n,i,r,o,s,a){let c=Gye(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Gye(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}Jo._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=le.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=le.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=le.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function Vtt(e,t,n,i,r,o,s,a){Jo._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Dn.castShadows(e.shadows),g=Dn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=s,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}Jo.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!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===gs.FAILED)return;let t=e.context;if(l(this._batchTable)||Ett(this,t),this._batchTable.attributes.length>0){if(Ut.maximumVertexTextureImageUnits===0)throw new oe("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!==gs.COMPLETE&&this._state!==gs.COMBINED&&(this.asynchronous?Ott(this,e):Mtt(this,e)),this._state===gs.COMBINED&&(Ltt(this,e),jye(this,e),Btt(this,e)),!this.show||this._state!==gs.COMPLETE)return;this._batchTableOffsetsUpdated||jye(this,e),this._recomputeBoundingSpheres&&Ntt(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??ktt)(this,t,n,u),o&&(this._createShaderProgramFunction??Utt)(this,e,n),(r||o)&&(this._createCommandsFunction??ztt)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??Vtt)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var jtt=new le,Htt=new le;function $ye(e,t,n){if(n===pn.TOP){let i=le.clone(e,jtt),r=le.clone(e,Htt);r.center=h.add(r.center,t,r.center),e=le.union(i,r,e)}else n===pn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function Gtt(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function Wtt(e,t,n,i,r){return function(o){let s=qye(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var qtt=new h;function Ytt(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&$ye(i,h.fromArray(o.get(),0,qtt),e._offsetInstanceExtend[n]),l(r)&&(i=le.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function Xtt(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Jo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:Gtt(s,n,f),set:Wtt(s,n,f,this,u)}}return Ytt(this,c,n),Xtt(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Jo.prototype.isDestroyed=function(){return!1};Jo.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,ue(this)};function jD(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===gs.COMPLETE||e._state===gs.FAILED,!0})}var Nn=Jo;var HD=`#ifdef TEXTURE_COORDINATES #ifdef SPHERICAL in vec4 v_sphericalExtents; #else // SPHERICAL @@ -2698,21 +3988,17 @@ uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_i uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; #endif // SPHERICAL #endif // TEXTURE_COORDINATES -#ifdef PICK -#ifdef CULL_FRAGMENTS -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; -czm_writeDepthClamp(); -} -#else // CULL_FRAGMENTS -out_FragColor.a = 1.0; -#endif // CULL_FRAGMENTS -#else // PICK #ifdef CULL_FRAGMENTS if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { discard; } #endif +#ifdef PICK +out_FragColor.a = 1.0; +#ifdef CULL_FRAGMENTS +czm_writeDepthClamp(); +#endif // CULL_FRAGMENTS +#else // PICK #ifdef NORMAL_EC vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); @@ -2758,14 +4044,14 @@ out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); #endif // PICK } -`;function rf(e,t,n){T.typeOf.bool("extentsCulling",e),T.typeOf.bool("planarExtents",t),T.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new z6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new z6;if(o.requiresTextureCoordinates=e,n instanceof rn)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}rf.prototype.createFragmentShader=function(e){T.typeOf.bool("columbusView2D",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 rn&&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 rn||(o=t.material.shaderSource),new He({defines:i,sources:[o,Cw]})};rf.prototype.createPickFragmentShader=function(e){T.typeOf.bool("columbusView2D",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 He({defines:n,sources:[Cw],pickColorQualifier:"in"})};rf.prototype.createVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),Lte(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};rf.prototype.createPickVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),Lte(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var vte=new d,Dte=new he,Pte={high:0,low:0};function Lte(e,t,n,i,o,r,s,a){let l=i.slice();if(a.eastMostYhighDefine===""){let u=Dte;u.longitude=O.PI,u.latitude=0,u.height=0;let f=s.project(u,vte),h=Hn.encode(f.x,Pte);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=Dte;p.longitude=-O.PI,p.latitude=0,p.height=0;let g=s.project(p,vte);h=Hn.encode(g.x,Pte),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&&(l.push(a.eastMostYhighDefine),l.push(a.eastMostYlowDefine),l.push(a.westMostYhighDefine),l.push(a.westMostYlowDefine)),c(r)&&r instanceof rn&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new He({defines:l,sources:[o]})}function z6(){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(z6.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 Ite(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)/z.distance(t,e)}var CMe=[new z,new z,new z,new z];function Nte(e,t){let n=CMe,i=z.unpack(t,0,n[0]),o=z.unpack(t,2,n[1]),r=z.unpack(t,4,n[2]);e.uMaxVmax=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Ite(i,o,r),a=1/Ite(i,r,o);e.uvMinAndExtents=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Fte=new he,Bte=new d,EMe=new d,SMe=new d,XL={high:0,low:0};function kte(e,t,n){let i=Fte;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Bte);i.latitude=e.north;let r=t.project(i,EMe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,SMe),a=[0,0,0,0],l=[0,0,0,0],u=Hn.encode(o.x,XL);a[0]=u.high,l[0]=u.low,u=Hn.encode(o.y,XL),a[1]=u.high,l[1]=u.low,u=Hn.encode(r.y,XL),a[2]=u.high,l[2]=u.low,u=Hn.encode(s.x,XL),a[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}var wMe=new F,vMe=new F,Ote=new d,DMe=new he,PMe=[new he,new he,new he,new he,new he,new he,new he,new he];function IMe(e,t,n,i,o,r){let s=ce.center(e,DMe);s.height=n;let a=he.toCartesian(s,t,Ote),l=Ot.eastNorthUpToFixedFrame(a,t,wMe),u=F.inverse(l,vMe),f=e.west,h=e.east,p=e.north,g=e.south,m=PMe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=g,m[3].longitude=h;let y=(f+h)*.5,b=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=h;let x=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let L=he.toCartesian(m[R],t,Ote);F.multiplyByPoint(u,L,L),L.z=0,x=Math.min(x,L.x),A=Math.max(A,L.x),E=Math.min(E,L.y),S=Math.max(S,L.y)}let v=i;v.x=x,v.y=E,v.z=0,F.multiplyByPoint(l,v,v);let P=o;P.x=A,P.y=E,P.z=0,F.multiplyByPoint(l,P,P),d.subtract(P,v,o);let M=r;M.x=x,M.y=S,M.z=0,F.multiplyByPoint(l,M,M),d.subtract(M,v,r)}var OMe=new d,RMe=new d,MMe=new Hn;rf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let r=Bte,s=OMe,a=RMe;IMe(e,n,o??0,r,s,a);let l={};Nte(l,t);let u=Hn.fromCartesian(r,MMe);return l.southWest_HIGH=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),l.southWest_LOW=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),l.eastward=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),l.northward=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),kte(e,i,l),l};var LMe=new d;function Rte(e,t,n,i){let o=Fte;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,LMe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=O.fastApproximateAtan2(s,r.z),l=O.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=l,i}var Mte=new z;rf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let o=Rte(e.south,e.west,n,Mte),r=o.x,s=o.y,a=Rte(e.north,e.east,n,Mte),l=a.x,u=a.y,f=0;s>u&&(f=O.PI-s,s=-O.PI,u+=f),r-=O.EPSILON5,s-=O.EPSILON5,l+=O.EPSILON5,u+=O.EPSILON5;let h=1/(u-s),p=1/(l-r),g={sphericalExtents:new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Nte(g,t),kte(e,i,g),g};rf.hasAttributesForTextureCoordinatePlanes=function(e){return c(e.southWest_HIGH)&&c(e.southWest_LOW)&&c(e.northward)&&c(e.eastward)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};rf.hasAttributesForSphericalExtents=function(e){return c(e.sphericalExtents)&&c(e.longitudeRotation)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};function NMe(e){return Math.max(e.width,e.height)>rf.MAX_WIDTH_FOR_PLANAR_EXTENTS}rf.shouldUseSphericalCoordinates=function(e){return T.typeOf.object("rectangle",e),NMe(e)};rf.MAX_WIDTH_FOR_PLANAR_EXTENTS=O.toRadians(1);var sf=rf;var FMe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Vn=Object.freeze(FMe);var BMe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},ft=Object.freeze(BMe);var KL={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};KL.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:KL.CESIUM_3D_TILE_MASK,mask:KL.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(KL);function X0(e){e=e??W.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(X0.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}}});X0.isSupported=function(e){return e.context.stencilBuffer};function GT(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},depthMask:!1}}function G6(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var kMe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function UMe(e,t,n,i){if(c(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(GT(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(GT(o,!0)),e._rsColorPass=ze.fromCache(G6(o,!1)),e._rsPickPass=ze.fromCache(kMe)}function VMe(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=He.replaceMain(s,"czm_non_compressed_main");let a=`void main() +`;function xd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new mZ;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new mZ;if(r.requiresTextureCoordinates=e,n instanceof An)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}xd.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 An&&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 r="";return t instanceof An||(r=t.material.shaderSource),new Xe({defines:i,sources:[r,HD]})};xd.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 Xe({defines:n,sources:[HD],pickColorQualifier:"in"})};xd.prototype.createVertexShader=function(e,t,n,i){return rAe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};xd.prototype.createPickVertexShader=function(e,t,n,i){return rAe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Jye=new h,Zye=new he,Qye={high:0,low:0};function rAe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Zye;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,Jye),d=Sn.encode(f.x,Qye);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=Zye;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,Jye);d=Sn.encode(g.x,Qye),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof An&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Xe({defines:c,sources:[r]})}function mZ(){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(mZ.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 eAe(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)/U.distance(t,e)}var Ktt=[new U,new U,new U,new U];function oAe(e,t){let n=Ktt,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/eAe(i,r,o),a=1/eAe(i,o,r);e.uvMinAndExtents=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var sAe=new he,aAe=new h,$tt=new h,Jtt=new h,RU={high:0,low:0};function cAe(e,t,n){let i=sAe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,aAe);i.latitude=e.north;let o=t.project(i,$tt);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Jtt),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,RU);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,RU),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,RU),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,RU),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var Ztt=new M,Qtt=new M,tAe=new h,ent=new he,tnt=[new he,new he,new he,new he,new he,new he,new he,new he];function nnt(e,t,n,i,r,o){let s=ie.center(e,ent);s.height=n;let a=he.toCartesian(s,t,tAe),c=At.eastNorthUpToFixedFrame(a,t,Ztt),u=M.inverse(c,Qtt),f=e.west,d=e.east,p=e.north,g=e.south,m=tnt;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let O=he.toCartesian(m[R],t,tAe);M.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),E=Math.max(E,O.y)}let v=i;v.x=b,v.y=T,v.z=0,M.multiplyByPoint(c,v,v);let S=r;S.x=x,S.y=T,S.z=0,M.multiplyByPoint(c,S,S),h.subtract(S,v,r);let I=o;I.x=b,I.y=E,I.z=0,M.multiplyByPoint(c,I,I),h.subtract(I,v,o)}var int=new h,rnt=new h,ont=new Sn;xd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=aAe,s=int,a=rnt;nnt(e,n,r??0,o,s,a);let c={};oAe(c,t);let u=Sn.fromCartesian(o,ont);return c.southWest_HIGH=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),cAe(e,i,c),c};var snt=new h;function nAe(e,t,n,i){let r=sAe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,snt),s=Math.sqrt(o.x*o.x+o.y*o.y),a=P.fastApproximateAtan2(s,o.z),c=P.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var iAe=new U;xd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=nAe(e.south,e.west,n,iAe),o=r.x,s=r.y,a=nAe(e.north,e.east,n,iAe),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),o-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Rl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return oAe(g,t),cAe(e,i,g),g};xd.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)};xd.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 ant(e){return Math.max(e.width,e.height)>xd.MAX_WIDTH_FOR_PLANAR_EXTENTS}xd.shouldUseSphericalCoordinates=function(e){return ant(e)};xd.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var Td=xd;var lAe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(lAe);var ni=lAe;var uAe={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP};Object.freeze(uAe);var Rt=uAe;var OU={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};OU.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ni.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ni.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:OU.CESIUM_3D_TILE_MASK,mask:OU.CESIUM_3D_TILE_MASK}};var Xt=Object.freeze(OU);function gx(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(gx.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}}});gx.isSupported=function(e){return e.context.stencilBuffer};function gv(e,t){let n=t?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:n,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:xc.LESS_OR_EQUAL},depthMask:!1}}function gZ(e){return{stencilTest:{enabled:e,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:rn.PRE_MULTIPLIED_ALPHA_BLEND}}var cnt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function lnt(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(gv(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(gv(r,!0)),e._rsColorPass=Ge.fromCache(gZ(r,!1)),e._rsPickPass=Ge.fromCache(cnt)}function unt(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; +`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Xe.replaceMain(s,"czm_non_compressed_main");let a=`void main() { -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function zMe(e,t){let n=t.context,i=e._primitive,o=WL;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=VMe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",l=new He({defines:[a],sources:[o]}),u=new He({sources:[Y0]}),f=e._primitive._attributeLocations,h=new sf(s,r,e.appearance);if(e._spStencil=en.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=He.createPickVertexShaderSource(o);m=In._appendShowToShader(i,m),m=In._updatePickColorAttribute(m);let y=h.createPickFragmentShader(!1),b=h.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=en.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f}),s){let x=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!c(x)){let A=h.createPickFragmentShader(!0),E=h.createPickVertexShader([a],m,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:E,fragmentShaderSource:A,attributeLocations:f})}e._spPick2D=x}}else e._spPick=en.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});o=In._appendShowToShader(i,o),l=new He({defines:[a],sources:[o]}),e._sp=en.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=en.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!c(m)){let y=h.createFragmentShader(!0),b=h.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function HMe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],c(r)||(r=t[o]=new Je({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=l,r.pass=De.TERRAIN_CLASSIFICATION,s=Je.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=De.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],c(r)||(r=t[o+1]=new Je({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=De.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(c(y)&&(l=xt(l,y._uniforms)),r.uniformMap=l,s=Je.shallowClone(r,r.derivedCommands.tileset),s.pass=De.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=Je.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=Je.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=Je.shallowClone(t[p],f[g]);m.shaderProgram=h,m.pass=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function GMe(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 l,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(l=0;l<o;l+=2){let m=i._va[h++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[l],c(u)||(u=t[l]=new Je({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=De.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Je.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=De.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[l+1],c(u)||(u=t[l+1]=new Je({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=De.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Je.shallowClone(u,u.derivedCommands.tileset),f.pass=De.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=Je.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=Je.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function jMe(e,t,n,i,o,r,s){HMe(e,r),GMe(e,s)}function Ute(e,t){return Math.floor(e%t/2)}function H6(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Vte(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function WMe(e,t,n,i,o,r,s,a){let l=e._primitive;In._updateBoundingVolumes(l,t,o);let u;t.mode===oe.SCENE3D?u=l._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===oe.SCENE2D&&c(l._boundingSphere2D)?u=l._boundingSphere2D:c(l._boundingSphereMorph)&&(u=l._boundingSphereMorph);let f=e.classificationType,h=f!==Un.CESIUM_3D_TILE,p=f!==Un.TERRAIN,g=t.passes,m,y,b;if(g.render){let x=n.length;for(m=0;m<x;++m)y=u[Ute(m,x)],h&&(b=n[m],H6(b,t,o,r,y,s)),p&&(b=n[m].derivedCommands.tileset,H6(b,t,o,r,y,s));if(t.invertClassification){let A=e._commandsIgnoreShow,E=A.length;for(m=0;m<E;++m)y=u[m],b=A[m],H6(b,t,o,r,y,s)}}if(g.pick){let x=i.length,A=l._pickOffsets;for(m=0;m<x;++m){let E=A[Ute(m,x)];y=u[E.index],h&&(b=i[m],Vte(b,t,o,r,y)),p&&(b=i[m].derivedCommands.tileset,Vte(b,t,o,r,y))}}}X0.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;let t=this.appearance;c(t)&&c(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!c(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,l,u=!1,f=!0,h,p=!1,g=!1;for(r>0&&(l=o[0].attributes,p=sf.hasAttributesForSphericalExtents(l),g=sf.hasAttributesForTextureCoordinatePlanes(l),h=l.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;if(c(y))u=!0;else if(u)throw new C("All GeometryInstances must have color attributes to use per-instance color.");f=f&&c(y)&&jt.equals(h,y)}if(!f&&!p&&!g)throw new C("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(u&&!c(t)&&(t=new rn({flat:!0}),this.appearance=t),!u&&t instanceof rn)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(c(t.material)&&!p&&!g)throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new St({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,c(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,b){n._createBoundingVolumeFunction(y,b)}),i._createRenderStatesFunction=function(y,b,x,A){UMe(n,b)},i._createShaderProgramFunction=function(y,b,x){zMe(n,b)},i._createCommandsFunction=function(y,b,x,A,E,S,v){jMe(n,void 0,void 0,!0,!1,S,v)},c(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,b,x,A,E,S,v,P){n._updateAndQueueCommandsFunction(y,b,x,A,E,S,v,P)}:i._updateAndQueueCommandsFunction=function(y,b,x,A,E,S,v,P){WMe(n,b,x,A,E,S,v,P)},this._primitive=new In(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(GT(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(GT(!1,!0)),this._rsColorPass=ze.fromCache(G6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(GT(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(GT(!0,!0)),this._rsColorPass=ze.fromCache(G6(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&c(t.material))throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof rn)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};X0.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};X0.prototype.isDestroyed=function(){return!1};X0.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,de(this)};var Ew=X0;var qMe={u_globeMinimumAltitude:function(){return 55e3}};function pl(e){e=e??W.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!c(t)&&c(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(c(a)&&c(a.color)){t=new rn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=fi._defaultMaxTerrainHeight,this._minTerrainHeight=fi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:qMe}}Object.defineProperties(pl.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}}});pl.isSupported=Ew.isSupported;function zte(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Hte(e){return function(t,n){return e._minHeight}}var YMe=new d,XMe=new d,KMe=new d,$Me=new he,ZMe=new ce;function $L(e,t){let n=e.mapProjection.ellipsoid;if(!c(t.attributes)||!c(t.attributes.position3DHigh))return c(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,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,YMe),g=d.unpack(o,h,XMe),m=d.add(p,g,KMe),y=n.cartesianToCartographic(m,$Me),b=y.latitude,x=y.longitude;s=Math.min(s,b),a=Math.min(a,x),l=Math.max(l,b),u=Math.max(u,x)}let f=ZMe;return f.north=l,f.south=s,f.east=u,f.west=a,f}function QMe(e,t,n){let i=fi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function JMe(e,t,n){let i=t.mapProjection.ellipsoid,o=$L(t,n),r=Pn.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);d.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function j6(e,t){return Math.floor(e%t/2)}function W6(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 Gte(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 eLe(e,t,n,i,o,r,s,a){let l;t.mode===oe.SCENE3D?l=e._boundingVolumes:l=e._boundingVolumes2D;let u=e.classificationType,f=u!==Un.CESIUM_3D_TILE,h=u!==Un.TERRAIN,p=t.passes,g=e._primitive,m,y,b;if(p.render){let x=n.length;for(m=0;m<x;++m)y=l[j6(m,x)],f&&(b=n[m],W6(e,b,t,o,r,y,s)),h&&(b=n[m].derivedCommands.tileset,W6(e,b,t,o,r,y,s));if(t.invertClassification){let A=g._commandsIgnoreShow,E=A.length;for(m=0;m<E;++m)y=l[m],b=A[m],W6(e,b,t,o,r,y,s)}}if(p.pick){let x=i.length,A;for(e._useFragmentCulling||(A=g._primitive._pickOffsets),m=0;m<x;++m){if(y=l[j6(m,x)],!e._useFragmentCulling){let E=A[j6(m,x)];y=l[E.index]}f&&(b=i[m],Gte(e,b,t,o,r,y)),h&&(b=i[m].derivedCommands.tileset,Gte(e,b,t,o,r,y))}}}pl.initializeTerrainHeights=function(){return fi.initialize()};pl.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!fi.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");pl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!c(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],l=a.length,u=new Array(l),f,h;for(f=0;f<l;++f){o=a[f],r=o.geometry;let y=$L(e,r);c(h)?c(y)&&ce.union(h,y,h):h=ce.clone(y);let b=o.id;if(c(b)&&c(y)){let x=fi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(x)}if(s=r.constructor,!c(s)||!c(s.createShadowVolume))throw new C("Not all of the geometry instances have GroundPrimitive support.")}QMe(this,h,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Rr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Rr.getHeight(this._maxTerrainHeight,p,g);let m=pl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,b=!0;for(f=0;f<l;++f)if(o=a[f],r=o.geometry,h=$L(e,r),sf.shouldUseSphericalCoordinates(h)){b=!1;break}for(f=0;f<l;++f){o=a[f],r=o.geometry,s=r.constructor;let x=$L(e,r),A=r.textureCoordinateRotationPoints;b?y=sf.getPlanarTextureCoordinateAttributes(x,A,i,e.mapProjection,this._maxHeight):y=sf.getSphericalExtentGeometryInstanceAttributes(x,A,i,e.mapProjection);let E=o.attributes;for(let S in E)E.hasOwnProperty(S)&&(y[S]=E[S]);u[f]=new St({geometry:s.createShadowVolume(r,Hte(this),zte(this)),attributes:y,id:o.id})}}else for(f=0;f<l;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new St({geometry:s.createShadowVolume(r,Hte(this),zte(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,b){JMe(t,y,b)},n._updateAndQueueCommandsFunction=function(y,b,x,A,E,S,v,P){eLe(t,b,x,A,E,S,v,P)},this._primitive=new Ew(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&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};pl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};pl.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};pl.prototype.isDestroyed=function(){return!1};pl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};pl._supportsMaterials=function(e){return e.depthTexture};pl.supportsMaterials=function(e){return T.typeOf.object("scene",e),pl._supportsMaterials(e.frameState.context)};var _l=pl;function jT(){C.throwInstantiationError()}Object.defineProperties(jT.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}});jT.prototype.getType=C.throwInstantiationError;jT.prototype.getValue=C.throwInstantiationError;jT.prototype.equals=C.throwInstantiationError;var tLe=new Q;jT.getValue=function(e,t,n){let i;return c(e)||(e=Q.now(tLe)),c(t)&&(i=t.getType(e),c(i))?((!c(n)||n.type!==i)&&(n=Xi.fromType(i)),t.getValue(e,n.uniforms),n):((!c(n)||n.type!==Xi.ColorType)&&(n=Xi.fromType(Xi.ColorType)),G.clone(G.WHITE,n.uniforms.color),n)};var or=jT;function K0(e,t,n){T.defined("geometryUpdater",e),T.defined("primitives",t),T.defined("orderedGroundPrimitives",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}K0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!Y.getValueOrDefault(t.show,n,!0)};K0.prototype._setOptions=C.throwInstantiationError;K0.prototype.update=function(e){T.defined("time",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),l=this._options;if(!c(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,h,p=t._getIsClosed(l);if(f)h=new rn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=or.getValue(e,u,this._material);this._material=g,h=new so({material:g,translucent:g.isTranslucent(),closed:p})}if(n)l.vertexFormat=rn.VERTEX_FORMAT,this._primitive=o.add(new _l({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Y.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&c(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=Y.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:u,appearance:new rn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};K0.prototype.getBoundingSphere=function(e){if(!c(e))throw new C("result is required.");let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return c(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(n)&&!n.ready||c(i)&&!i.ready?lt.PENDING:lt.FAILED};K0.prototype.isDestroyed=function(){return!1};K0.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),de(this)};var ii=K0;var jte={};function Sw(e,t){if(!c(e))throw new C("identifier is required.");c(jte[e])||(jte[e]=!0,console.warn(t??e))}Sw.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.";Sw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Sw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Sw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var dt=Sw;var nLe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Q_=Object.freeze(nLe);var iLe={NONE:0,GEODESIC:1,RHUMB:2},qt=Object.freeze(iLe);var Wte=O.EPSILON10;function oLe(e,t,n,i){if(T.defined("equalsEpsilon",t),!c(e))return;n=n??!1;let o=c(i),r=e.length;if(r<2)return e;let s,a=e[0],l,u,f=0,h=-1;for(s=1;s<r;++s)l=e[s],t(a,l,Wte)?(c(u)||(u=e.slice(0,s),f=s-1,h=0),o&&i.push(s)):(c(u)&&(u.push(l),f=s,o&&(h=i.length)),a=l);return n&&t(e[0],e[r-1],Wte)&&(o&&(c(u)?i.splice(h,0,f):i.push(r-1)),c(u)?u.length-=1:u=e.slice(0,-1)),c(u)?u:e}var xo=oLe;function rLe(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),l=1/Math.sqrt(1+a*a),u=l*a,f=Math.atan2(a,r),h=l*s,p=h*h,g=1-p,m=Math.sqrt(g),y=t/4,b=y*y,x=b*y,A=b*b,E=1+y-3*b/4+5*x/4-175*A/64,S=1-y+15*b/8-35*x/8,v=1-3*y+35*b/4,P=1-5*y,M=E*f-S*Math.sin(2*f)*y/2-v*Math.sin(4*f)*b/16-P*Math.sin(6*f)*x/48-Math.sin(8*f)*5*A/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=l,R.sineU=u,R.sigma=f,R.sineAlpha=h,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=b,R.u6Over64=x,R.u8Over256=A,R.a0=E,R.a1=S,R.a2=v,R.a3=P,R.distanceRatio=M}function sLe(e,t){return e*t*(4+e*(4-3*t))/16}function qte(e,t,n,i,o,r,s){let a=sLe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function aLe(e,t,n,i,o,r,s){let a=(t-n)/t,l=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),h=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=h*g,b=h*m,x=p*m,A=p*g,E=l,S=O.TWO_PI,v=Math.cos(E),P=Math.sin(E),M,R,L,B,_;do{v=Math.cos(E),P=Math.sin(E);let U=b-A*v;L=Math.sqrt(g*g*P*P+U*U),R=x+y*v,M=Math.atan2(L,R);let q;L===0?(q=0,B=1):(q=y*P/L,B=1-q*q),S=E,_=R-2*x/B,isFinite(_)||(_=0),E=l+qte(a,q,B,M,L,R,_)}while(Math.abs(E-S)>O.EPSILON12);let w=B*(t*t-n*n)/(n*n),D=1+w*(4096+w*(w*(320-175*w)-768))/16384,I=w*(256+w*(w*(74-47*w)-128))/1024,N=_*_,k=I*L*(_+I*(R*(2*N-1)-I*_*(4*L*L-3)*(4*N-3)/6)/4),H=n*D*(M-k),V=Math.atan2(g*P,b-A*v),j=Math.atan2(h*P,b*v-A);e._distance=H,e._startHeading=V,e._endHeading=j,e._uSquared=w}var cLe=new d,q6=new d;function Yte(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,q6),cLe),r=d.normalize(i.cartographicToCartesian(n,q6),q6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125),aLe(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,rLe(e)}function ww(e,t,n){let i=n??ie.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,c(e)&&c(t)&&Yte(this,e,t,i)}Object.defineProperties(ww.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return T.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return T.defined("distance",this._distance),this._endHeading}}});ww.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),Yte(this,e,t,this._ellipsoid)};ww.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};ww.prototype.interpolateUsingSurfaceDistance=function(e,t){T.defined("distance",this._distance);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),l=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,b=n.u4Over16,x=2*p*g*o/3+i*(1-m+7*b/4-15*y/4+579*g/64-(b-15*y/4+187*g/16)*o-(5*y/4-115*g/16)*r-29*g*s/16)+(m/2-b+71*y/32-85*g/16)*a+(5*b/16-5*y/4+383*g/96)*l-h*((y-11*g/2)*a+5*g*l/2)+(29*y/96-29*g/16)*u+539*g*f/1536,A=Math.asin(Math.sin(x)*n.cosineAlpha),E=Math.atan(n.a/n.b*Math.tan(A));x=x-n.sigma;let S=Math.cos(2*n.sigma+x),v=Math.sin(x),P=Math.cos(x),M=n.cosineU*P,R=n.sineU*v,B=Math.atan2(v*n.sineHeading,M-R*n.cosineHeading)-qte(n.f,n.sineAlpha,n.cosineSquaredAlpha,x,v,P,S);return c(t)?(t.longitude=this._start.longitude+B,t.latitude=E,t.height=0,t):new he(this._start.longitude+B,E,0)};var J_=ww;function X6(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,l=a*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*l/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*l/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*l/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*l/1048576)*p+(315*s/131072+2205*a/524288+43659*l/8388608)*g-(693*a/1310720+6237*l/5242880)*m+1001*l/8388608*y)}function lLe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,l=a*a,u=l*l,f=u*l,h=f*l,p=h*l,g=p*l,m=Math.sin(2*i),y=Math.cos(2*i),b=Math.sin(4*i),x=Math.cos(4*i),A=Math.sin(6*i),E=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),P=Math.sin(10*i),M=Math.cos(10*i),R=Math.sin(12*i);return i+i*l/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*y+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*x+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*E+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*M+(3*l/8+3*u/16+213*f/2048-3*o*f/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)*m+(21*u/256+21*f/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)*b+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*A+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*P+293393*g/251658240*R}function WT(e,t){if(e===0)return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function uLe(e,t,n,i,o){let r=WT(e._ellipticity,n),s=WT(e._ellipticity,o);return Math.atan2(O.negativePiToPi(i-t),s-r)}function fLe(e,t,n,i,o,r,s){let a=e._heading,l=r-i,u=0;if(O.equalsEpsilon(Math.abs(a),O.PI_OVER_TWO,O.EPSILON8))if(t===n)u=t*Math.cos(o)*O.negativePiToPi(l);else{let f=Math.sin(o);u=t*Math.cos(o)*O.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=X6(e._ellipticity,t,o);u=(X6(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var dLe=new d,Y6=new d;function Xte(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,Y6),dLe),r=d.normalize(i.cartographicToCartesian(n,Y6),Y6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125);let s=i.maximumRadius,a=i.minimumRadius,l=s*s,u=a*a;e._ellipticitySquared=(l-u)/l,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=uLe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=fLe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Kte(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,l,u;if(Math.abs(O.PI_OVER_TWO-Math.abs(t))>O.EPSILON8){let f=X6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(l=lLe(p,o,i),Math.abs(t)<O.EPSILON10)a=O.negativePiToPi(e.longitude);else{let g=WT(o,e.latitude),m=WT(o,l);u=Math.tan(t)*(m-g),a=O.negativePiToPi(e.longitude+u)}}else{l=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}u=n/f,t>0?a=O.negativePiToPi(e.longitude+u):a=O.negativePiToPi(e.longitude-u)}return c(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new he(a,l,0)}function gp(e,t,n){let i=n??ie.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,c(e)&&c(t)&&Xte(this,e,t,i)}Object.defineProperties(gp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return T.defined("distance",this._distance),this._heading}}});gp.fromStartHeadingDistance=function(e,t,n,i,o){T.defined("start",e),T.defined("heading",t),T.defined("distance",n),T.typeOf.number.greaterThan("distance",n,0);let r=i??ie.default,s=r.maximumRadius,a=r.minimumRadius,l=s*s,u=a*a,f=Math.sqrt((l-u)/l);t=O.negativePiToPi(t);let h=Kte(e,t,n,r.maximumRadius,f);return!c(o)||c(i)&&!i.equals(o.ellipsoid)?new gp(e,h,r):(o.setEndPoints(e,h),o)};gp.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),Xte(this,e,t,this._ellipsoid)};gp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};gp.prototype.interpolateUsingSurfaceDistance=function(e,t){if(T.typeOf.number("distance",e),!c(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");return Kte(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};gp.prototype.findIntersectionWithLongitude=function(e,t){if(T.typeOf.number("intersectionLongitude",e),!c(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=O.negativePiToPi(e),O.equalsEpsilon(Math.abs(e),Math.PI,O.EPSILON14)&&(e=O.sign(r.longitude)*Math.PI),c(t)||(t=new he),Math.abs(O.PI_OVER_TWO-o)<=O.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(O.equalsEpsilon(Math.abs(O.PI_OVER_TWO-o),O.PI_OVER_TWO,O.EPSILON8))return O.equalsEpsilon(e,r.longitude,O.EPSILON12)?void 0:(t.longitude=e,t.latitude=O.PI_OVER_TWO*O.sign(O.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),l=Math.tan(.5*(O.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),g=(1+p)/(1-p);f=2*Math.atan(l*Math.pow(g/u,n/2))-O.PI_OVER_TWO}while(!O.equalsEpsilon(f,h,O.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};gp.prototype.findIntersectionWithLatitude=function(e,t){if(T.typeOf.number("intersectionLatitude",e),!c(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=this._start;if(O.equalsEpsilon(Math.abs(i),O.PI_OVER_TWO,O.EPSILON8))return;let r=WT(n,o.latitude),s=WT(n,e),a=Math.tan(i)*(s-r),l=O.negativePiToPi(o.longitude+a);return c(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new he(l,e,0)};var Ja=gp;var nj=[Oi,Li],hLe=nj.length,pne=Math.cos(O.toRadians(30)),$te=Math.cos(O.toRadians(150)),_ne=0,gne=1e3;function tg(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t)||t.length<2)throw new C("At least two positions are required.");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new C("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??qt.GEODESIC,this._ellipsoid=ie.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(tg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ie.packedLength+1+1}}});tg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<hLe;i++)if(t instanceof nj[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var mLe=new d,Zte=new d,Qte=new d;function tj(e,t,n,i,o){let r=Ic(i,e,0,mLe),s=Ic(i,e,n,Zte),a=Ic(i,t,0,Qte),l=yp(s,r,Zte),u=yp(a,r,Qte);return d.cross(u,l,o),d.normalize(o,o)}var pLe=new he,_Le=new d,gLe=new d,yLe=new d;function K6(e,t,n,i,o,r,s,a,l,u,f){if(o===0)return;let h;r===qt.GEODESIC?h=new J_(e,t,s):r===qt.RHUMB&&(h=new Ja(e,t,s));let p=h.surfaceDistance;if(p<o)return;let g=tj(e,t,i,s,yLe),m=Math.ceil(p/o),y=p/m,b=y,x=m-1,A=a.length;for(let E=0;E<x;E++){let S=h.interpolateUsingSurfaceDistance(b,pLe),v=Ic(s,S,n,_Le),P=Ic(s,S,i,gLe);d.pack(g,a,A),d.pack(v,l,A),d.pack(P,u,A),f.push(S.latitude),f.push(S.longitude),A+=3,b+=y}}var $6=new he;function Ic(e,t,n,i){return he.clone(t,$6),$6.height=n,he.toCartesian($6,e,i)}tg.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t);let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];d.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ie.pack(e._ellipsoid,t,i),i+=ie.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};tg.unpack=function(e,t,n){T.defined("array",e);let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,l=e[i++],u=ie.unpack(e,i);i+=ie.packedLength;let f=e[i++],h=e[i++]===1;return c(n)||(n=new tg({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=l,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function yp(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function Jte(e,t,n,i){return i=yp(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var bLe=new d,xLe=new d,TLe=new d,yne=new d,ALe=0,CLe=-1;function Z6(e,t,n,i,o){let r=yp(n,t,yne),s=Jte(e,t,r,bLe),a=Jte(i,t,r,xLe);if(O.equalsEpsilon(d.dot(s,a),CLe,O.EPSILON5))return o=d.cross(r,s,o),o=d.normalize(o,o),o;o=d.add(a,s,o),o=d.normalize(o,o);let l=d.cross(r,o,TLe);return d.dot(a,l)<ALe&&(o=d.negate(o,o)),o}var eN=sn.fromPointNormal(d.ZERO,d.UNIT_Y),ELe=new d,SLe=new d,wLe=new d,vLe=new d,DLe=new d,ZL=new d,QL=new he,ene=new he,tne=new he;tg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new nj[e._projectionIndex](i),a=_ne,l=gne,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let g,m,y,b,x=new Ja(void 0,void 0,i),A,E,S,v=[h[0]];for(f=0;f<p-1;f++)g=h[f],m=h[f+1],A=Qn.lineSegmentPlane(g,m,eN,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&(e.arcType===qt.GEODESIC?v.push(d.clone(A)):e.arcType===qt.RHUMB&&(S=i.cartesianToCartographic(A,QL).longitude,y=i.cartesianToCartographic(g,QL),b=i.cartesianToCartographic(m,ene),x.setEndPoints(y,b),E=x.findIntersectionWithLongitude(S,tne),A=i.cartographicToCartesian(E,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&v.push(d.clone(A)))),v.push(m);n&&(g=h[p-1],m=h[0],A=Qn.lineSegmentPlane(g,m,eN,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&(e.arcType===qt.GEODESIC?v.push(d.clone(A)):e.arcType===qt.RHUMB&&(S=i.cartesianToCartographic(A,QL).longitude,y=i.cartesianToCartographic(g,QL),b=i.cartesianToCartographic(m,ene),x.setEndPoints(y,b),E=x.findIntersectionWithLongitude(S,tne),A=i.cartographicToCartesian(E,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&v.push(d.clone(A)))));let P=v.length,M=new Array(P);for(f=0;f<P;f++){let X=he.fromCartesian(v[f],i);X.height=0,M[f]=X}if(M=xo(M,he.equalsEpsilon),P=M.length,P<2)return;let R=[],L=[],B=[],_=[],w=ELe,D=SLe,I=wLe,N=vLe,k=DLe,H=M[0],V=M[1],j=M[P-1];for(w=Ic(i,j,a,w),N=Ic(i,V,a,N),D=Ic(i,H,a,D),I=Ic(i,H,l,I),n?k=Z6(w,D,I,N,k):k=tj(H,V,l,i,k),d.pack(k,L,0),d.pack(D,B,0),d.pack(I,_,0),R.push(H.latitude),R.push(H.longitude),K6(H,V,a,l,o,r,i,L,B,_,R),f=1;f<P-1;++f){w=d.clone(D,w),D=d.clone(N,D);let X=M[f];Ic(i,X,l,I),Ic(i,M[f+1],a,N),Z6(w,D,I,N,k),u=L.length,d.pack(k,L,u),d.pack(D,B,u),d.pack(I,_,u),R.push(X.latitude),R.push(X.longitude),K6(M[f],M[f+1],a,l,o,r,i,L,B,_,R)}let U=M[P-1],q=M[P-2];if(D=Ic(i,U,a,D),I=Ic(i,U,l,I),n){let X=M[0];w=Ic(i,q,a,w),N=Ic(i,X,a,N),k=Z6(w,D,I,N,k)}else k=tj(q,U,l,i,k);if(u=L.length,d.pack(k,L,u),d.pack(D,B,u),d.pack(I,_,u),R.push(U.latitude),R.push(U.longitude),n){for(K6(U,H,a,l,o,r,i,L,B,_,R),u=L.length,f=0;f<3;++f)L[u+f]=L[f],B[u+f]=B[f],_[u+f]=_[f];R.push(H.latitude),R.push(H.longitude)}return eNe(n,s,B,_,L,R,t)};var PLe=new d,ILe=new J,OLe=new Le;function nne(e,t,n,i){let o=yp(n,t,PLe),r=d.dot(o,e);if(r>pne||r<$te){let s=yp(i,n,yne),a=r<$te?O.PI_OVER_TWO:-O.PI_OVER_TWO,l=Le.fromAxisAngle(s,a,OLe),u=J.fromQuaternion(l,ILe);return J.multiplyByVector(u,e,e),!0}return!1}var ine=new he,RLe=new d,one=new d;function vw(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,RLe),s=d.add(r,n,one),a=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,ine);Math.abs(t.longitude-u.longitude)>O.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,one),u=l.cartesianToCartographic(s,ine)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var MLe=new d,rne=new d;function sne(e,t,n,i,o,r){let s=d.subtract(t,e,MLe);d.normalize(s,s);let a=n-_ne,l=d.multiplyByScalar(s,a,rne);d.add(e,l,o);let u=i-gne;l=d.multiplyByScalar(s,u,rne),d.add(t,l,r)}var LLe=new d;function JL(e,t){let n=sn.getPointDistance(eN,e),i=sn.getPointDistance(eN,t),o=LLe;O.equalsEpsilon(n,0,O.EPSILON2)?(o=yp(t,e,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(e,o,e)):O.equalsEpsilon(i,0,O.EPSILON2)&&(o=yp(e,t,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(t,o,t))}function NLe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(O.equalsEpsilon(n,O.PI,O.EPSILON11)){let o=O.sign(t.longitude);return e.longitude=o*(n-O.EPSILON11),1}else if(O.equalsEpsilon(i,O.PI,O.EPSILON11)){let o=O.sign(e.longitude);return t.longitude=o*(i-O.EPSILON11),2}return 0}var bne=new he,xne=new he,ane=new d,Q6=new d,cne=new d,lne=new d,FLe=new d,une=new d,BLe=[bne,xne],kLe=new ce,ULe=new d,VLe=new d,zLe=new d,HLe=new d,GLe=new d,jLe=new d,J6=new d,ej=new d,WLe=new d,qLe=new d,YLe=new d,fne=new d,XLe=new d,KLe=new d,$Le=new Hn,ZLe=new Hn,dne=new d,QLe=new d,hne=new d,JLe=[new le,new le],Tne=[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],mne=Tne.length;function eNe(e,t,n,i,o,r,s){let a,l,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,g=f*36,m=h>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(h*3),b=new Float32Array(p),x=new Float32Array(p),A=new Float32Array(p),E=new Float32Array(p),S=new Float32Array(p),v,P,M,R;s&&(v=new Float32Array(p),P=new Float32Array(p),M=new Float32Array(p),R=new Float32Array(h*2));let L=r.length/2,B=0,_=bne;_.height=0;let w=xne;w.height=0;let D=ane,I=Q6;if(s)for(l=0,a=1;a<L;a++)_.latitude=r[l],_.longitude=r[l+1],w.latitude=r[l+2],w.longitude=r[l+3],D=t.project(_,D),I=t.project(w,I),B+=d.distance(D,I),l+=2;let N=i.length/3;I=d.unpack(i,0,I);let k=0;for(l=3,a=1;a<N;a++)D=d.clone(I,D),I=d.unpack(i,l,I),k+=d.distance(D,I),l+=3;let H;l=3;let V=0,j=0,U=0,q=0,X=!1,te=d.unpack(n,0,lne),K=d.unpack(i,0,Q6),Z=d.unpack(o,0,une);if(e){let Ee=d.unpack(n,n.length-6,cne);nne(Z,Ee,te,K)&&(Z=d.negate(Z,Z))}let ee=0,me=0,xe=0;for(a=0;a<f;a++){let Ee=d.clone(te,cne),Ve=d.clone(K,ane),je=d.clone(Z,FLe);X&&(je=d.negate(je,je)),te=d.unpack(n,l,lne),K=d.unpack(i,l,Q6),Z=d.unpack(o,l,une),X=nne(Z,Ee,te,K),_.latitude=r[V],_.longitude=r[V+1],w.latitude=r[V+2],w.longitude=r[V+3];let it,Dt,Gt,$e;if(s){let hi=NLe(_,w);it=t.project(_,GLe),Dt=t.project(w,jLe);let $s=yp(Dt,it,dne);$s.y=Math.abs($s.y),Gt=J6,$e=ej,hi===0||d.dot($s,d.UNIT_Y)>pne?(Gt=vw(t,_,je,it,J6),$e=vw(t,w,Z,Dt,ej)):hi===1?($e=vw(t,w,Z,Dt,ej),Gt.x=0,Gt.y=O.sign(_.longitude-Math.abs(w.longitude)),Gt.z=0):(Gt=vw(t,_,je,it,J6),$e.x=0,$e.y=O.sign(_.longitude-w.longitude),$e.z=0)}let ln=d.distance(Ve,K),Vt=Hn.fromCartesian(Ee,$Le),Ct=d.subtract(te,Ee,WLe),gi=d.normalize(Ct,fne),an=d.subtract(Ve,Ee,qLe);an=d.normalize(an,an);let _e=d.cross(gi,an,fne);_e=d.normalize(_e,_e);let Ce=d.cross(an,je,XLe);Ce=d.normalize(Ce,Ce);let mn=d.subtract(K,te,YLe);mn=d.normalize(mn,mn);let mt=d.cross(Z,mn,KLe);mt=d.normalize(mt,mt);let to=ln/k,So=ee/k,Ks=0,vr,ps,Ne,ot=0,Xe=0;if(s){Ks=d.distance(it,Dt),vr=Hn.fromCartesian(it,ZLe),ps=d.subtract(Dt,it,dne),Ne=d.normalize(ps,QLe);let hi=Ne.x;Ne.x=Ne.y,Ne.y=-hi,ot=Ks/B,Xe=me/B}for(H=0;H<8;H++){let hi=q+H*4,$s=j+H*2,Hr=hi+3,ol=H<4?1:-1,ho=H===2||H===3||H===6||H===7?1:-1;d.pack(Vt.high,b,hi),b[Hr]=Ct.x,d.pack(Vt.low,x,hi),x[Hr]=Ct.y,d.pack(Ce,A,hi),A[Hr]=Ct.z,d.pack(mt,E,hi),E[Hr]=to*ol,d.pack(_e,S,hi);let Dr=So*ho;Dr===0&&ho<0&&(Dr=9),S[Hr]=Dr,s&&(v[hi]=vr.high.x,v[hi+1]=vr.high.y,v[hi+2]=vr.low.x,v[hi+3]=vr.low.y,M[hi]=-Gt.y,M[hi+1]=Gt.x,M[hi+2]=$e.y,M[hi+3]=-$e.x,P[hi]=ps.x,P[hi+1]=ps.y,P[hi+2]=Ne.x,P[hi+3]=Ne.y,R[$s]=ot*ol,Dr=Xe*ho,Dr===0&&ho<0&&(Dr=9),R[$s+1]=Dr)}let Ze=zLe,pt=HLe,Ht=ULe,bn=VLe,wo=ce.fromCartographicArray(BLe,kLe),yo=fi.getMinimumMaximumHeights(wo,u),ka=yo.minimumTerrainHeight,Ua=yo.maximumTerrainHeight;xe+=Math.abs(ka),xe+=Math.abs(Ua),sne(Ee,Ve,ka,Ua,Ze,Ht),sne(te,K,ka,Ua,pt,bn);let yi=d.multiplyByScalar(_e,O.EPSILON5,hne);d.add(Ze,yi,Ze),d.add(pt,yi,pt),d.add(Ht,yi,Ht),d.add(bn,yi,bn),JL(Ze,pt),JL(Ht,bn),d.pack(Ze,y,U),d.pack(pt,y,U+3),d.pack(bn,y,U+6),d.pack(Ht,y,U+9),yi=d.multiplyByScalar(_e,-2*O.EPSILON5,hne),d.add(Ze,yi,Ze),d.add(pt,yi,pt),d.add(Ht,yi,Ht),d.add(bn,yi,bn),JL(Ze,pt),JL(Ht,bn),d.pack(Ze,y,U+12),d.pack(pt,y,U+15),d.pack(bn,y,U+18),d.pack(Ht,y,U+21),V+=2,l+=3,j+=16,U+=24,q+=32,ee+=ln,me+=Ks}l=0;let ue=0;for(a=0;a<f;a++){for(H=0;H<mne;H++)m[l+H]=Tne[H]+ue;ue+=8,l+=mne}let ye=JLe;le.fromVertices(n,d.ZERO,3,ye[0]),le.fromVertices(i,d.ZERO,3,ye[1]);let Ae=le.fromBoundingSpheres(ye);Ae.radius+=xe/(f*2);let Pe={position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:eg(b),startLoAndForwardOffsetY:eg(x),startNormalAndForwardOffsetZ:eg(A),endNormalAndTextureCoordinateNormalizationX:eg(E),rightNormalAndTextureCoordinateNormalizationY:eg(S)};return s&&(Pe.startHiLo2D=eg(v),Pe.offsetAndRight2D=eg(P),Pe.startEndNormals2D=eg(M),Pe.texcoordNormalization2D=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new ct({attributes:Pe,indices:m,boundingSphere:Ae})}function eg(e){return new ve({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}tg._projectNormal=vw;var qT=tg;var tN=`in vec4 v_startPlaneNormalEcAndHalfWidth; +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function fnt(e,t){let n=t.context,i=e._primitive,r=PU;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Nn._appendDistanceDisplayConditionToShader(i,r),r=Nn._modifyShaderPosition(e,r,t.scene3DOnly),r=Nn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=unt(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Xe({defines:[a],sources:[r]}),u=new Xe({sources:[px]}),f=e._primitive._attributeLocations,d=new Td(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Xe.createPickVertexShaderSource(r);m=Nn._appendShowToShader(i,m),m=Nn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Nn._appendShowToShader(i,r),c=new Xe({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function dnt(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ie.TERRAIN_CLASSIFICATION,s=at.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ie.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Mt(c,y._uniforms)),o.uniformMap=c,s=at.shallowClone(o,o.derivedCommands.tileset),s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let A=at.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=at.shallowClone(s,s.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=at.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function hnt(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=at.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=at.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function mnt(e,t,n,i,r,o,s){dnt(e,o),hnt(e,s)}function fAe(e,t){return Math.floor(e%t/2)}function pZ(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function dAe(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function pnt(e,t,n,i,r,o,s,a){let c=e._primitive;Nn._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==ti.CESIUM_3D_TILE,p=f!==ti.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[fAe(m,b)],d&&(A=n[m],pZ(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,pZ(A,t,r,o,y,s));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],pZ(A,t,r,o,y,s)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[fAe(m,b)];y=u[T.index],d&&(A=i[m],dAe(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,dAe(A,t,r,o,y))}}}gx.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 r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=Td.hasAttributesForSphericalExtents(c),g=Td.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Jt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new An({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new Bt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){lnt(n,A)},i._createShaderProgramFunction=function(y,A,b){fnt(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){mnt(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n._updateAndQueueCommandsFunction(y,A,b,x,T,E,v,S)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){pnt(n,A,b,x,T,E,v,S)},this._primitive=new Nn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(gv(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(gv(!1,!0)),this._rsColorPass=Ge.fromCache(gZ(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(gv(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(gv(!0,!0)),this._rsColorPass=Ge.fromCache(gZ(!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))})};gx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};gx.prototype.isDestroyed=function(){return!1};gx.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,ue(this)};var GD=gx;var gnt={u_globeMinimumAltitude:function(){return 55e3}};function vu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let s=0;s<o;s++){let a=r[s].attributes;if(l(a)&&l(a.color)){t=new An({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Ni._defaultMaxTerrainHeight,this._minTerrainHeight=Ni._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:gnt}}Object.defineProperties(vu.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}}});vu.isSupported=GD.isSupported;function hAe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function mAe(e){return function(t,n){return e._minHeight}}var _nt=new h,ynt=new h,Ant=new h,bnt=new he,xnt=new ie;function MU(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,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,_nt),g=h.unpack(r,d,ynt),m=h.add(p,g,Ant),y=n.cartesianToCartographic(m,bnt),A=y.latitude,b=y.longitude;s=Math.min(s,A),a=Math.min(a,b),c=Math.max(c,A),u=Math.max(u,b)}let f=xnt;return f.north=c,f.south=s,f.east=u,f.west=a,f}function Tnt(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function Ent(e,t,n){let i=t.mapProjection.ellipsoid,r=MU(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=le.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function _Z(e,t){return Math.floor(e%t/2)}function yZ(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function pAe(e,t,n,i,r,o){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function Cnt(e,t,n,i,r,o,s,a){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==ti.CESIUM_3D_TILE,d=u!==ti.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[_Z(m,b)],f&&(A=n[m],yZ(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,yZ(e,A,t,r,o,y,s));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],yZ(e,A,t,r,o,y,s)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[_Z(m,b)],!e._useFragmentCulling){let T=x[_Z(m,b)];y=c[T.index]}f&&(A=i[m],pAe(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,pAe(e,A,t,r,o,y))}}}vu.initializeTerrainHeights=function(){return Ni.initialize()};vu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){vu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let y=MU(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Ni.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}s=o.constructor,!l(s)||l(s.createShadowVolume)}Tnt(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=br.getHeight(this._minTerrainHeight,p,g),this._maxHeight=br.getHeight(this._maxTerrainHeight,p,g);let m=vu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=MU(e,o),Td.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=MU(e,o),x=o.textureCoordinateRotationPoints;A?y=Td.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Td.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let E in T)T.hasOwnProperty(E)&&(y[E]=T[E]);u[f]=new Bt({geometry:s.createShadowVolume(o,mAe(this),hAe(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Bt({geometry:s.createShadowVolume(o,mAe(this),hAe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){Ent(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){Cnt(t,A,b,x,T,E,v,S)},this._primitive=new GD(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))})};vu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};vu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};vu.prototype.isDestroyed=function(){return!1};vu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};vu._supportsMaterials=function(e){return e.depthTexture};vu.supportsMaterials=function(e){return vu._supportsMaterials(e.frameState.context)};var Su=vu;function _v(){pe.throwInstantiationError()}Object.defineProperties(_v.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});_v.prototype.getType=pe.throwInstantiationError;_v.prototype.getValue=pe.throwInstantiationError;_v.prototype.equals=pe.throwInstantiationError;var vnt=new K;_v.getValue=function(e,t,n){let i;return l(e)||(e=K.now(vnt)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=lr.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==lr.ColorType)&&(n=lr.fromType(lr.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var So=_v;function _x(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}_x.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};_x.prototype._setOptions=pe.throwInstantiationError;_x.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,d,p=t._getIsClosed(c);if(f)d=new An({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=So.getValue(e,u,this._material);this._material=g,d=new Sr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=An.VERTEX_FORMAT,this._primitive=r.add(new Su({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Nn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Nn({geometryInstances:u,appearance:new An({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};_x.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(le.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(le.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};_x.prototype.isDestroyed=function(){return!1};_x.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),ue(this)};var Ri=_x;var NU=`in vec4 v_startPlaneNormalEcAndHalfWidth; in vec4 v_endPlaneNormalEcAndBatchId; in vec4 v_rightPlaneEC; in vec4 v_endEcAndStartEcX; @@ -2822,7 +4108,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); } -`;var nN=`in vec3 v_forwardDirectionEC; +`;var LU=`in vec3 v_forwardDirectionEC; in vec3 v_texcoordNormalizationAndHalfWidth; in float v_batchId; #ifdef PER_INSTANCE_COLOR @@ -2855,7 +4141,7 @@ czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #endif // PER_INSTANCE_COLOR } -`;var iN=`in vec3 position3DHigh; +`;var FU=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 startHiAndForwardOffsetX; in vec4 startLoAndForwardOffsetY; @@ -2975,7 +4261,7 @@ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && ap v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var oN=`in vec3 position3DHigh; +`;var BU=`in vec3 position3DHigh; in vec3 position3DLow; #ifndef COLUMBUS_VIEW_2D in vec4 startHiAndForwardOffsetX; @@ -3079,7 +4365,7 @@ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && ap v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var rN=`in vec3 position3DHigh; +`;var kU=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 prevPosition3DHigh; in vec3 prevPosition3DLow; @@ -3102,119 +4388,9 @@ vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, gl_Position = czm_viewportOrthographic * positionWC; v_color = color; } -`;var af=`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); -float endPoint0Distance = czm_currentFrustum.x + p0.z; -float denominator = -direction.z; -if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) -{ -culledByNearPlane = true; -} -else if (endPoint0Distance > 0.0) -{ -float t = endPoint0Distance / denominator; -if (t < 0.0 || t > magnitude) -{ -culledByNearPlane = true; -} -else -{ -p0 = p0 + t * direction; -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) -{ -#ifdef POLYLINE_DASH -vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); -vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); -vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); -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; -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 (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; -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); -vec2 u = -thisSegmentForwardWC; -vec2 v = leftWC; -float sinAngle = abs(u.x * v.y - u.y * v.x); -expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); -} -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 ij=`${af} -${rN}`,tNe=UT;zt.isInternetExplorer()||(ij=`#define CLIP_POLYLINE -${ij}`);function $0(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=$0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??ij,this._fragmentShaderSource=e.fragmentShaderSource??tNe,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties($0.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}}});$0.VERTEX_FORMAT=Ie.POSITION_ONLY;$0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;$0.prototype.isTranslucent=no.prototype.isTranslucent;$0.prototype.getRenderState=no.prototype.getRenderState;var os=$0;var sN=`in vec3 position3DHigh; +`;var Snt=`#define CLIP_POLYLINE +${Eu} +${kU}`,wnt=dv;function yx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=yx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??Snt,this._fragmentShaderSource=e.fragmentShaderSource??wnt,this._renderState=Or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(yx.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}}});yx.VERTEX_FORMAT=Be.POSITION_ONLY;yx.prototype.getFragmentShaderSource=Or.prototype.getFragmentShaderSource;yx.prototype.isTranslucent=Or.prototype.isTranslucent;yx.prototype.getRenderState=Or.prototype.getRenderState;var Ks=yx;var UU=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 prevPosition3DHigh; in vec3 prevPosition3DLow; @@ -3242,7 +4418,7 @@ v_st.s = st.s; v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); v_polylineAngle = angle; } -`;var YT=`#ifdef VECTOR_TILE +`;var yv=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_st; @@ -3261,11 +4437,10 @@ out_FragColor *= u_highlightColor; #endif czm_writeLogDepth(); } -`;var oj=`${af} -${sN}`,nNe=YT;zt.isInternetExplorer()||(oj=`#define CLIP_POLYLINE -${oj}`);function Z0(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Z0.VERTEX_FORMAT;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??oj,this._fragmentShaderSource=e.fragmentShaderSource??nNe,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Z0.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}}});Z0.VERTEX_FORMAT=Ie.POSITION_AND_ST;Z0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Z0.prototype.isTranslucent=no.prototype.isTranslucent;Z0.prototype.getRenderState=no.prototype.getRenderState;var Ea=Z0;function bp(e){e=e??W.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;c(t)||(t=new Ea),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=Ane(!1),this._renderState3DTiles=Ane(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(bp.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}}});bp.initializeTerrainHeights=function(){return fi.initialize()};function iNe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(oN);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(iN);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(tN),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";c(n.material)?(h=c(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new He({defines:u,sources:[s]}),m=new He({defines:p,sources:[h,l]});e._sp=en.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!c(y)){let x=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:x,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=y;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!c(b)){let x=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${fi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});l=o._batchTable.getVertexShaderCallback()(nN);let A=new He({defines:p,sources:[h,l]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:r})}e._spMorph=b}function Ane(e){return ze.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function oNe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof os?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h<a;h++){let p=s._va[h],g=o[h];c(g)||(g=o[h]=new Je({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=De.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=Je.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=De.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=Je.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let b=Je.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let x=Je.shallowClone(g,g.derivedCommands.colorMorph);x.renderState=e._renderStateMorph,x.shaderProgram=e._spMorph,x.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=x}}function Cne(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 rNe(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let l;t.mode===oe.SCENE3D?l=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?l=a._boundingSphereCV:t.mode===oe.SCENE2D&&c(a._boundingSphere2D)?l=a._boundingSphere2D:c(a._boundingSphereMorph)&&(l=a._boundingSphereMorph);let u=t.mode===oe.MORPHING,f=e.classificationType,h=f!==Un.CESIUM_3D_TILE,p=f!==Un.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let b=0;b<y;++b){let x=l[b];h&&(g=n[b],Cne(e,g,t,o,r,x,s)),p&&(g=n[b].derivedCommands.tileset,Cne(e,g,t,o,r,x,s))}}}bp.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!fi.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");bp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!c(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,!c(a)||!c(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let l=o[t];a={};let u=l.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);c(a.width)||(a.width=new Pc({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,qT.setProjectionAndEllipsoid(l.geometry,e.mapProjection),s[t]=new St({geometry:l.geometry,attributes:a,id:l.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,f){iNe(n,u,f)},i._createCommandsFunction=function(l,u,f,h,p,g,m){oNe(n,u,f,h,g,m)},i._updateAndQueueCommandsFunction=function(l,u,f,h,p,g,m,y){rNe(n,u,f,h,p,g,m)},this._primitive=new In(i)}if(this.appearance instanceof os&&!this._hasPerInstanceColors)throw new C("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&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};bp.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};bp.isSupported=function(e){return e.frameState.context.depthTexture};bp.prototype.isDestroyed=function(){return!1};bp.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,de(this)};var Nh=bp;var sNe=new z(1,1),aNe=!1,cNe=G.WHITE;function XT(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(XT.prototype,{isConstant:{get:function(){return Y.isConstant(this._image)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:fe("image"),repeat:fe("repeat"),color:fe("color"),transparent:fe("transparent")});XT.prototype.getType=function(e){return"Image"};var lNe=new Q;XT.prototype.getValue=function(e,t){return c(e)||(e=Q.now(lNe)),c(t)||(t={}),t.image=Y.getValueOrUndefined(this._image,e),t.repeat=Y.getValueOrClonedDefault(this._repeat,e,sNe,t.repeat),t.color=Y.getValueOrClonedDefault(this._color,e,cNe,t.color),Y.getValueOrDefault(this._transparent,e,aNe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};XT.prototype.equals=function(e){return this===e||e instanceof XT&&Y.equals(this._image,e._image)&&Y.equals(this._repeat,e._repeat)&&Y.equals(this._color,e._color)&&Y.equals(this._transparent,e._transparent)};var Q0=XT;function uNe(e){if(e instanceof G)return new Ut(e);if(typeof e=="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Q0;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function fNe(e,t){return fe(e,t,uNe)}var No=fNe;function Dw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Dw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),dimensions:fe("dimensions"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Dw.prototype.clone=function(e){return c(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 Dw(this)};Dw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var KT=Dw;var dNe={FIXED:0,INERTIAL:1},zi=Object.freeze(dNe);function $T(){C.throwInstantiationError()}Object.defineProperties($T.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}});$T.prototype.getValue=C.throwInstantiationError;$T.prototype.getValueInReferenceFrame=C.throwInstantiationError;$T.prototype.equals=C.throwInstantiationError;var Ene=new J;$T.convertToReferenceFrame=function(e,t,n,i,o){if(!c(t))return t;if(c(o)||(o=new d),n===i)return d.clone(t,o);let r=Ot.computeIcrfToCentralBodyFixedMatrix(e,Ene);if(n===zi.INERTIAL)return J.multiplyByVector(r,t,o);if(n===zi.FIXED)return J.multiplyByVector(J.transpose(r,Ene),t,o)};var Fh=$T;function J0(e,t){this._definitionChanged=new pe,this._value=d.clone(e),this._referenceFrame=t??zi.FIXED}Object.defineProperties(J0.prototype,{isConstant:{get:function(){return!c(this._value)||this._referenceFrame===zi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var hNe=new Q;J0.prototype.getValue=function(e,t){return c(e)||(e=Q.now(hNe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};J0.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),c(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};J0.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");return Fh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};J0.prototype.equals=function(e){return this===e||e instanceof J0&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var gl=J0;function Pw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Pw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});Pw.prototype.clone=function(e){return c(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 Pw(this)};Pw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var ZT=Pw;function mNe(e){return e}function pNe(e,t){return fe(e,t,mNe)}var yl=pNe;function Iw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Iw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),length:fe("length"),topRadius:fe("topRadius"),bottomRadius:fe("bottomRadius"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),slices:fe("slices"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Iw.prototype.clone=function(e){return c(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 Iw(this)};Iw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var QT=Iw;function Ow(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Ow.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),semiMajorAxis:fe("semiMajorAxis"),semiMinorAxis:fe("semiMinorAxis"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});Ow.prototype.clone=function(e){return c(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 Ow(this)};Ow.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var JT=Ow;function Rw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Rw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),radii:fe("radii"),innerRadii:fe("innerRadii"),minimumClock:fe("minimumClock"),maximumClock:fe("maximumClock"),minimumCone:fe("minimumCone"),maximumCone:fe("maximumCone"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),stackPartitions:fe("stackPartitions"),slicePartitions:fe("slicePartitions"),subdivisions:fe("subdivisions"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Rw.prototype.clone=function(e){return c(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 Rw(this)};Rw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var eA=Rw;function Mw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),text:fe("text"),font:fe("font"),style:fe("style"),scale:fe("scale"),showBackground:fe("showBackground"),backgroundColor:fe("backgroundColor"),backgroundPadding:fe("backgroundPadding"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),fillColor:fe("fillColor"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),scaleByDistance:fe("scaleByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance")});Mw.prototype.clone=function(e){return c(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 Mw(this)};Mw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Bh=Mw;var _Ne=new d(1,1,1),gNe=d.ZERO,yNe=Le.IDENTITY;function Sne(e,t,n){this.translation=d.clone(e??gNe),this.rotation=Le.clone(t??yNe),this.scale=d.clone(n??_Ne)}Sne.prototype.equals=function(e){return this===e||c(e)&&d.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var eb=Sne;var rj=new eb;function Lw(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(Lw.prototype,{isConstant:{get:function(){return Y.isConstant(this._translation)&&Y.isConstant(this._rotation)&&Y.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:fe("translation"),rotation:fe("rotation"),scale:fe("scale")});var bNe=new Q;Lw.prototype.getValue=function(e,t){return c(e)||(e=Q.now(bNe)),c(t)||(t=new eb),t.translation=Y.getValueOrClonedDefault(this._translation,e,rj.translation,t.translation),t.rotation=Y.getValueOrClonedDefault(this._rotation,e,rj.rotation,t.rotation),t.scale=Y.getValueOrClonedDefault(this._scale,e,rj.scale,t.scale),t};Lw.prototype.equals=function(e){return this===e||e instanceof Lw&&Y.equals(this._translation,e._translation)&&Y.equals(this._rotation,e._rotation)&&Y.equals(this._scale,e._scale)};var tA=Lw;function xp(e,t){this._propertyNames=[],this._definitionChanged=new pe,c(e)&&this.merge(e,t)}Object.defineProperties(xp.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(!Y.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});xp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function xNe(e){return new Xn(e)}xp.prototype.addProperty=function(e,t,n){let i=this._propertyNames;if(!c(e))throw new C("propertyName is required.");if(i.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,fe(e,!0,n??xNe)),c(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};xp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var TNe=new Q;xp.prototype.getValue=function(e,t){c(e)||(e=Q.now(TNe)),c(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=Y.getValueOrUndefined(this[r],e,t[r])}return t};xp.prototype.merge=function(e,t){if(!c(e))throw new C("source is required.");let n=this._propertyNames,i=c(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],l=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),l!==void 0&&(a!==void 0?c(a)&&c(a.merge)&&a.merge(l):c(l)&&c(l.merge)&&c(l.clone)?this[s]=l.clone():this[s]=l)}};function ANe(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||!Y.equals(e[s],t[s]))return!1}return!0}xp.prototype.equals=function(e){return this===e||e instanceof xp&&ANe(this,e)};var bl=xp;function wne(e){return new tA(e)}function CNe(e){return new bl(e,wne)}function ENe(e){return new bl(e)}function SNe(e){return new bl(e)}function Nw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Nw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),scale:fe("scale"),enableVerticalExaggeration:fe("enableVerticalExaggeration"),minimumPixelSize:fe("minimumPixelSize"),maximumScale:fe("maximumScale"),incrementallyLoadTextures:fe("incrementallyLoadTextures"),runAnimations:fe("runAnimations"),clampAnimations:fe("clampAnimations"),shadows:fe("shadows"),heightReference:fe("heightReference"),silhouetteColor:fe("silhouetteColor"),silhouetteSize:fe("silhouetteSize"),color:fe("color"),colorBlendMode:fe("colorBlendMode"),colorBlendAmount:fe("colorBlendAmount"),imageBasedLightingFactor:fe("imageBasedLightingFactor"),environmentMapOptions:fe("environmentMapOptions",void 0,SNe),lightColor:fe("lightColor"),distanceDisplayCondition:fe("distanceDisplayCondition"),nodeTransformations:fe("nodeTransformations",void 0,CNe),articulations:fe("articulations",void 0,ENe),clippingPlanes:fe("clippingPlanes"),customShader:fe("customShader")});Nw.prototype.clone=function(e){return c(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 Nw(this)};Nw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(c(t)){let i=this.nodeTransformations;c(i)?i.merge(t):this.nodeTransformations=new bl(t,wne)}let n=e.articulations;if(c(n)){let i=this.articulations;c(i)?i.merge(n):this.articulations=new bl(n)}};var ng=Nw;function Fw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Fw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),maximumScreenSpaceError:fe("maximumScreenSpaceError")});Fw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Fw(this)};Fw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var nA=Fw;function Bw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Bw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),leadTime:fe("leadTime"),trailTime:fe("trailTime"),width:fe("width"),resolution:fe("resolution"),material:No("material"),distanceDisplayCondition:fe("distanceDisplayCondition")});Bw.prototype.clone=function(e){return c(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 Bw(this)};Bw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var ig=Bw;function kw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(kw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),plane:fe("plane"),dimensions:fe("dimensions"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});kw.prototype.clone=function(e){return c(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 kw(this)};kw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var aN=kw;function Uw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Uw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),pixelSize:fe("pixelSize"),heightReference:fe("heightReference"),color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});Uw.prototype.clone=function(e){return c(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 Uw(this)};Uw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var iA=Uw;function wNe(e,t){this.positions=c(e)?e:[],this.holes=c(t)?t:[]}var ec=wNe;function vNe(e){return Array.isArray(e)&&(e=new ec(e)),new Xn(e)}function Vw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Vw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),hierarchy:fe("hierarchy",void 0,vNe),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),perPositionHeight:fe("perPositionHeight"),closeTop:fe("closeTop"),closeBottom:fe("closeBottom"),arcType:fe("arcType"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex"),textureCoordinates:fe("textureCoordinates")});Vw.prototype.clone=function(e){return c(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 Vw(this)};Vw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var kh=Vw;function zw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(zw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),granularity:fe("granularity"),material:No("material"),depthFailMaterial:No("depthFailMaterial"),arcType:fe("arcType"),clampToGround:fe("clampToGround"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});zw.prototype.clone=function(e){return c(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 zw(this)};zw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Oc=zw;function Hw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Hw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),shape:fe("shape"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Hw.prototype.clone=function(e){return c(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 Hw(this)};Hw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var oA=Hw;function Gw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(Gw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),coordinates:fe("coordinates"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});Gw.prototype.clone=function(e){return c(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 Gw(this)};Gw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Uh=Gw;function jw(e){this._definitionChanged=new pe,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(e??W.EMPTY_OBJECT)}Object.defineProperties(jw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),minimumHeights:fe("minimumHeights"),maximumHeights:fe("maximumHeights"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});jw.prototype.clone=function(e){return c(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 jw(this)};jw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var og=jw;var DNe=new he,sj=[];function PNe(e){return new gl(e)}function INe(e){return fe(e,void 0,PNe)}function Ls(e,t){return fe(e,void 0,function(n){return n instanceof t?n:new t(n)})}function cf(e){e=e??W.EMPTY_OBJECT;let t=e.id;c(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new pe,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Q_.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",...sj],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 aj(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)&&aj(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(cf.prototype,{availability:yl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:yl("name"),show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&aj(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:yl("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!c(this.entityCollection)||this.entityCollection.show)&&(!c(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(c(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,c(e)&&e._children.push(this);let i=this.isShowing;n!==i&&aj(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ls("billboard",wc),box:Ls("box",KT),corridor:Ls("corridor",ZT),cylinder:Ls("cylinder",QT),description:fe("description"),ellipse:Ls("ellipse",JT),ellipsoid:Ls("ellipsoid",eA),label:Ls("label",Bh),model:Ls("model",ng),tileset:Ls("tileset",nA),orientation:fe("orientation"),path:Ls("path",ig),plane:Ls("plane",aN),point:Ls("point",iA),polygon:Ls("polygon",kh),polyline:Ls("polyline",Oc),polylineVolume:Ls("polylineVolume",oA),properties:Ls("properties",bl),position:INe("position"),rectangle:Ls("rectangle",Uh),viewFrom:fe("viewFrom"),wall:Ls("wall",og)});cf.registerEntityType=function(e,t){Object.defineProperties(cf.prototype,{[e]:Ls(e,t)}),sj.includes(e)||sj.push(e)};cf.prototype.isAvailable=function(e){if(!c(e))throw new C("time is required.");let t=this._availability;return!c(t)||t.contains(e)};cf.prototype.addProperty=function(e){let t=this._propertyNames;if(!c(e))throw new C("propertyName is required.");if(t.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);if(e in this)throw new C(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,yl(e,!0))};cf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]};cf.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=c(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];!c(s)&&t.indexOf(r)===-1&&this.addProperty(r),c(a)&&(c(s)?c(s.merge)&&s.merge(a):c(a.merge)&&c(a.clone)?this[r]=a.clone():this[r]=a)}};var vne=new J,Dne=new d,Pne=new Le;cf.prototype.computeModelMatrix=function(e,t){T.typeOf.object("time",e);let n=Y.getValueOrUndefined(this._position,e,Dne);if(!c(n))return;let i=Y.getValueOrUndefined(this._orientation,e,Pne);return c(i)?t=F.fromRotationTranslation(J.fromQuaternion(i,vne),n,t):t=Ot.eastNorthUpToFixedFrame(n,void 0,t),t};cf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){T.typeOf.object("time",e);let r=Y.getValueOrDefault(t,e,qe.NONE),s=Y.getValueOrUndefined(this._position,e,Dne);if(r===qe.NONE||!c(s)||d.equalsEpsilon(s,d.ZERO,O.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,DNe);r===qe.CLIP_TO_GROUND?a.height<n&&(a.height=n):of(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let l=Y.getValueOrUndefined(this._orientation,e,Pne);return c(l)?o=F.fromRotationTranslation(J.fromQuaternion(l,vne),s,o):o=Ot.eastNorthUpToFixedFrame(s,void 0,o),o};cf.supportsMaterialsforEntitiesOnTerrain=function(e){return _l.supportsMaterials(e)};cf.supportsPolylinesOnTerrain=function(e){return Nh.isSupported(e)};var rr=cf;var ONe=new Ut(G.WHITE),RNe=new Xn(!0),MNe=new Xn(!0),LNe=new Xn(!1),NNe=new Xn(G.BLACK),FNe=new Xn(Tn.DISABLED),BNe=new Xn(new Lt),kNe=new Xn(Un.BOTH);function Rc(e){T.defined("options.entity",e.entity),T.defined("options.scene",e.scene),T.defined("options.geometryOptions",e.geometryOptions),T.defined("options.geometryPropertyName",e.geometryPropertyName),T.defined("options.observedPropertyNames",e.observedPropertyNames);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 pe,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=rr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Rc.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||!c(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!c(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.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}}});Rc.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Rc.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Rc.prototype.createFillGeometryInstance=C.throwInstantiationError;Rc.prototype.createOutlineGeometryInstance=C.throwInstantiationError;Rc.prototype.isDestroyed=function(){return!1};Rc.prototype.destroy=function(){de(this)};Rc.prototype._isHidden=function(e,t){let n=t.show;return c(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};Rc.prototype._isOnTerrain=function(e,t){return!1};Rc.prototype._getIsClosed=function(e){return!0};Rc.prototype._isDynamic=C.throwInstantiationError;Rc.prototype._setStaticOptions=C.throwInstantiationError;Rc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=c(r)&&r.isConstant?r.getValue(Ge.MINIMUM_VALUE):!0,a=o.outline,l=c(a);if(l&&a.isConstant&&(l=a.getValue(Ge.MINIMUM_VALUE)),!s&&!l){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??ONe,this._fillProperty=r??MNe,this._showProperty=u??RNe,this._showOutlineProperty=o.outline??LNe,this._outlineColorProperty=l?o.outlineColor??NNe:void 0,this._shadowsProperty=o.shadows??FNe,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??BNe,this._classificationTypeProperty=o.classificationType??kNe,this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(l&&f&&(dt(dt.geometryOutlines),l=!1),this._onTerrain=f,this._outlineEnabled=l,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=c(h)?h.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Rc.prototype.createDynamicUpdater=function(e,t){if(T.defined("primitives",e),T.defined("groundPrimitives",t),!this._dynamic)throw new C("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)};var oi=Rc;function rA(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(rA.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var UNe=new Q;rA.prototype.getValue=function(e,t){return c(e)||(e=Q.now(UNe)),this._callback(e,t)};rA.prototype.setCallback=function(e,t){if(!c(e))throw new C("callback is required.");if(!c(t))throw new C("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};rA.prototype.equals=function(e){return this===e||e instanceof rA&&this._callback===e._callback&&this._isConstant===e._isConstant};var Vh=rA;var Ine=new d;function sA(e,t,n,i){T.defined("scene",e),T.defined("positionProperty",t),this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new he,this._normal=new d,this._definitionChanged=new pe,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(c(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ge.MINIMUM_VALUE,Ine);if(!c(r)||d.equals(r,d.ZERO)||!c(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(sA.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});sA.prototype._updateClamping=function(){c(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);c(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 VNe=new Q;sA.prototype.getValue=function(e,t){c(e)||(e=Q.now(VNe));let n=Y.getValueOrDefault(this._heightReference,e,qe.NONE),i=Y.getValueOrDefault(this._extrudedHeightReference,e,qe.NONE);if(n===qe.NONE&&!NT(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant&&n!==qe.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Ine);if(!c(r)||d.equals(r,d.ZERO)||!c(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,O.EPSILON10)&&n!==qe.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===qe.CLIP_TO_GROUND){let l=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=l.height?d.multiplyByScalar(s,this._terrainHeight-l.height,t):d.clone(d.ZERO,t)}return d.multiplyByScalar(s,this._terrainHeight,t)};sA.prototype.isDestroyed=function(){return!1};sA.prototype.destroy=function(){return c(this._removeEventListener)&&this._removeEventListener(),c(this._removeModeListener)&&this._removeModeListener(),c(this._removeCallbackFunc)&&this._removeCallbackFunc(),de(this)};var aA=sA;function zNe(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(c(r)){let s=new Vh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new aA(this._scene,s,r)}}var rg=zNe;var One=d.ZERO,Rne=new d,HNe=new d,Mne=new G;function GNe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Jl(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new GNe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}c(Object.create)&&(Jl.prototype=Object.create(oi.prototype),Jl.prototype.constructor=Jl);Object.defineProperties(Jl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Jl.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Mne)),c(a)||(a=G.WHITE),s.color=jt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,One,Rne))),new St({id:t,geometry:Za.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Jl.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Mne),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,One,Rne))),new St({id:t,geometry:Mh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Jl.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Jl.prototype._isHidden=function(e,t){return!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};Jl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};Jl.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==qe.NONE?Zt.ALL:void 0};Jl.prototype._onEntityPropertyChanged=rg;Jl.DynamicGeometryUpdater=cA;function cA(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(cA.prototype=Object.create(ii.prototype),cA.prototype.constructor=cA);cA.prototype._isHidden=function(e,t,n){let i=Y.getValueOrUndefined(e.position,n,HNe),o=this._options.dimensions;return!c(i)||!c(o)||ii.prototype._isHidden.call(this,e,t,n)};cA.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,qe.NONE),o=this._options;o.dimensions=Y.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==qe.NONE?Zt.ALL:void 0};var cN=Jl;function tb(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??zi.FIXED,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(tb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var jNe=new Q;tb.prototype.getValue=function(e,t){return c(e)||(e=Q.now(jNe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};tb.prototype.setCallback=function(e,t){if(!c(e))throw new C("callback is required.");if(!c(t))throw new C("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};tb.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._callback(e,n);return Fh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};tb.prototype.equals=function(e){return this===e||e instanceof tb&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var lN=tb;/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */var{entries:Gne,setPrototypeOf:Lne,isFrozen:WNe,getPrototypeOf:qNe,getOwnPropertyDescriptor:YNe}=Object,{freeze:Lc,seal:lf,create:jne}=Object,{apply:hj,construct:mj}=typeof Reflect<"u"&&Reflect;Lc||(Lc=function(t){return t});lf||(lf=function(t){return t});hj||(hj=function(t,n,i){return t.apply(n,i)});mj||(mj=function(t,n){return new t(...n)});var uN=eu(Array.prototype.forEach),Nne=eu(Array.prototype.pop),Ww=eu(Array.prototype.push),dN=eu(String.prototype.toLowerCase),cj=eu(String.prototype.toString),Fne=eu(String.prototype.match),qw=eu(String.prototype.replace),XNe=eu(String.prototype.indexOf),KNe=eu(String.prototype.trim),gd=eu(Object.prototype.hasOwnProperty),Mc=eu(RegExp.prototype.test),Yw=$Ne(TypeError);function eu(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 hj(e,t,i)}}function $Ne(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return mj(e,n)}}function vi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dN;Lne&&Lne(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(WNe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function ZNe(e){for(let t=0;t<e.length;t++)gd(e,t)||(e[t]=null);return e}function nb(e){let t=jne(null);for(let[n,i]of Gne(e))gd(e,n)&&(Array.isArray(i)?t[n]=ZNe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=nb(i):t[n]=i);return t}function Xw(e,t){for(;e!==null;){let i=YNe(e,t);if(i){if(i.get)return eu(i.get);if(typeof i.value=="function")return eu(i.value)}e=qNe(e)}function n(){return null}return n}var Bne=Lc(["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"]),lj=Lc(["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"]),uj=Lc(["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"]),QNe=Lc(["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"]),fj=Lc(["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"]),JNe=Lc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kne=Lc(["#text"]),Une=Lc(["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"]),dj=Lc(["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"]),Vne=Lc(["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"]),fN=Lc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eFe=lf(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tFe=lf(/<%[\w\W]*|[\w\W]*%>/gm),nFe=lf(/\$\{[\w\W]*}/gm),iFe=lf(/^data-[\-\w.\u00B7-\uFFFF]+$/),oFe=lf(/^aria-[\-\w]+$/),Wne=lf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rFe=lf(/^(?:\w+script|data):/i),sFe=lf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qne=lf(/^html$/i),aFe=lf(/^[a-z][.\w]*(-[.\w]+)+$/i),zne=Object.freeze({__proto__:null,ARIA_ATTR:oFe,ATTR_WHITESPACE:sFe,CUSTOM_ELEMENT:aFe,DATA_ATTR:iFe,DOCTYPE_NAME:qne,ERB_EXPR:tFe,IS_ALLOWED_URI:Wne,IS_SCRIPT_OR_DATA:rFe,MUSTACHE_EXPR:eFe,TMPLIT_EXPR:nFe}),Kw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},cFe=function(){return typeof window>"u"?null:window},lFe=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}},Hne=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Yne(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cFe(),t=cn=>Yne(cn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==Kw.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,m=l.prototype,y=Xw(m,"cloneNode"),b=Xw(m,"remove"),x=Xw(m,"nextSibling"),A=Xw(m,"childNodes"),E=Xw(m,"parentNode");if(typeof s=="function"){let cn=n.createElement("template");cn.content&&cn.content.ownerDocument&&(n=cn.content.ownerDocument)}let S,v="",{implementation:P,createNodeIterator:M,createDocumentFragment:R,getElementsByTagName:L}=n,{importNode:B}=i,_=Hne();t.isSupported=typeof Gne=="function"&&typeof E=="function"&&P&&P.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:w,ERB_EXPR:D,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:j}=zne,{IS_ALLOWED_URI:U}=zne,q=null,X=vi({},[...Bne,...lj,...uj,...fj,...kne]),te=null,K=vi({},[...Une,...dj,...Vne,...fN]),Z=Object.seal(jne(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,me=null,xe=!0,ue=!0,ye=!1,Ae=!0,Pe=!1,Ee=!0,Ve=!1,je=!1,it=!1,Dt=!1,Gt=!1,$e=!1,ln=!0,Vt=!1,Ct="user-content-",gi=!0,an=!1,_e={},Ce=null,mn=vi({},["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"]),mt=null,to=vi({},["audio","video","img","source","image","track"]),So=null,Ks=vi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vr="http://www.w3.org/1998/Math/MathML",ps="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",ot=Ne,Xe=!1,Ze=null,pt=vi({},[vr,ps,Ne],cj),Ht=vi({},["mi","mo","mn","ms","mtext"]),bn=vi({},["annotation-xml"]),wo=vi({},["title","style","font","a","script"]),yo=null,ka=["application/xhtml+xml","text/html"],Ua="text/html",yi=null,hi=null,$s=n.createElement("form"),Hr=function(Se){return Se instanceof RegExp||Se instanceof Function},ol=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(hi&&hi===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=nb(Se),yo=ka.indexOf(Se.PARSER_MEDIA_TYPE)===-1?Ua:Se.PARSER_MEDIA_TYPE,yi=yo==="application/xhtml+xml"?cj:dN,q=gd(Se,"ALLOWED_TAGS")?vi({},Se.ALLOWED_TAGS,yi):X,te=gd(Se,"ALLOWED_ATTR")?vi({},Se.ALLOWED_ATTR,yi):K,Ze=gd(Se,"ALLOWED_NAMESPACES")?vi({},Se.ALLOWED_NAMESPACES,cj):pt,So=gd(Se,"ADD_URI_SAFE_ATTR")?vi(nb(Ks),Se.ADD_URI_SAFE_ATTR,yi):Ks,mt=gd(Se,"ADD_DATA_URI_TAGS")?vi(nb(to),Se.ADD_DATA_URI_TAGS,yi):to,Ce=gd(Se,"FORBID_CONTENTS")?vi({},Se.FORBID_CONTENTS,yi):mn,ee=gd(Se,"FORBID_TAGS")?vi({},Se.FORBID_TAGS,yi):{},me=gd(Se,"FORBID_ATTR")?vi({},Se.FORBID_ATTR,yi):{},_e=gd(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,xe=Se.ALLOW_ARIA_ATTR!==!1,ue=Se.ALLOW_DATA_ATTR!==!1,ye=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=Se.SAFE_FOR_TEMPLATES||!1,Ee=Se.SAFE_FOR_XML!==!1,Ve=Se.WHOLE_DOCUMENT||!1,Dt=Se.RETURN_DOM||!1,Gt=Se.RETURN_DOM_FRAGMENT||!1,$e=Se.RETURN_TRUSTED_TYPE||!1,it=Se.FORCE_BODY||!1,ln=Se.SANITIZE_DOM!==!1,Vt=Se.SANITIZE_NAMED_PROPS||!1,gi=Se.KEEP_CONTENT!==!1,an=Se.IN_PLACE||!1,U=Se.ALLOWED_URI_REGEXP||Wne,ot=Se.NAMESPACE||Ne,Ht=Se.MATHML_TEXT_INTEGRATION_POINTS||Ht,bn=Se.HTML_INTEGRATION_POINTS||bn,Z=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&Hr(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&Hr(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(ue=!1),Gt&&(Dt=!0),_e&&(q=vi({},kne),te=[],_e.html===!0&&(vi(q,Bne),vi(te,Une)),_e.svg===!0&&(vi(q,lj),vi(te,dj),vi(te,fN)),_e.svgFilters===!0&&(vi(q,uj),vi(te,dj),vi(te,fN)),_e.mathMl===!0&&(vi(q,fj),vi(te,Vne),vi(te,fN))),Se.ADD_TAGS&&(q===X&&(q=nb(q)),vi(q,Se.ADD_TAGS,yi)),Se.ADD_ATTR&&(te===K&&(te=nb(te)),vi(te,Se.ADD_ATTR,yi)),Se.ADD_URI_SAFE_ATTR&&vi(So,Se.ADD_URI_SAFE_ATTR,yi),Se.FORBID_CONTENTS&&(Ce===mn&&(Ce=nb(Ce)),vi(Ce,Se.FORBID_CONTENTS,yi)),gi&&(q["#text"]=!0),Ve&&vi(q,["html","head","body"]),q.table&&(vi(q,["tbody"]),delete ee.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw Yw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Yw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Se.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=lFe(g,o)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Lc&&Lc(Se),hi=Se}},ho=vi({},[...lj,...uj,...QNe]),Dr=vi({},[...fj,...JNe]),tp=function(Se){let Pt=E(Se);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:ot,tagName:"template"});let pn=dN(Se.tagName),hr=dN(Pt.tagName);return Ze[Se.namespaceURI]?Se.namespaceURI===ps?Pt.namespaceURI===Ne?pn==="svg":Pt.namespaceURI===vr?pn==="svg"&&(hr==="annotation-xml"||Ht[hr]):!!ho[pn]:Se.namespaceURI===vr?Pt.namespaceURI===Ne?pn==="math":Pt.namespaceURI===ps?pn==="math"&&bn[hr]:!!Dr[pn]:Se.namespaceURI===Ne?Pt.namespaceURI===ps&&!bn[hr]||Pt.namespaceURI===vr&&!Ht[hr]?!1:!Dr[pn]&&(wo[pn]||!ho[pn]):!!(yo==="application/xhtml+xml"&&Ze[Se.namespaceURI]):!1},Gr=function(Se){Ww(t.removed,{element:Se});try{E(Se).removeChild(Se)}catch{b(Se)}},zu=function(Se,Pt){try{Ww(t.removed,{attribute:Pt.getAttributeNode(Se),from:Pt})}catch{Ww(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Se),Se==="is")if(Dt||Gt)try{Gr(Pt)}catch{}else try{Pt.setAttribute(Se,"")}catch{}},Va=function(Se){let Pt=null,pn=null;if(it)Se="<remove></remove>"+Se;else{let Ta=Fne(Se,/^[\r\n\t ]+/);pn=Ta&&Ta[0]}yo==="application/xhtml+xml"&&ot===Ne&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");let hr=S?S.createHTML(Se):Se;if(ot===Ne)try{Pt=new p().parseFromString(hr,yo)}catch{}if(!Pt||!Pt.documentElement){Pt=P.createDocument(ot,"template",null);try{Pt.documentElement.innerHTML=Xe?v:hr}catch{}}let Ha=Pt.body||Pt.documentElement;return Se&&pn&&Ha.insertBefore(n.createTextNode(pn),Ha.childNodes[0]||null),ot===Ne?L.call(Pt,Ve?"html":"body")[0]:Ve?Pt.documentElement:Ha},S0=function(Se){return M.call(Se.ownerDocument||Se,Se,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Zs=function(Se){return Se instanceof h&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof f)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},rl=function(Se){return typeof a=="function"&&Se instanceof a};function za(cn,Se,Pt){uN(cn,pn=>{pn.call(t,Se,Pt,hi)})}let es=function(Se){let Pt=null;if(za(_.beforeSanitizeElements,Se,null),Zs(Se))return Gr(Se),!0;let pn=yi(Se.nodeName);if(za(_.uponSanitizeElement,Se,{tagName:pn,allowedTags:q}),Se.hasChildNodes()&&!rl(Se.firstElementChild)&&Mc(/<[/\w]/g,Se.innerHTML)&&Mc(/<[/\w]/g,Se.textContent)||Se.nodeType===Kw.progressingInstruction||Ee&&Se.nodeType===Kw.comment&&Mc(/<[/\w]/g,Se.data))return Gr(Se),!0;if(!q[pn]||ee[pn]){if(!ee[pn]&&Gu(pn)&&(Z.tagNameCheck instanceof RegExp&&Mc(Z.tagNameCheck,pn)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(pn)))return!1;if(gi&&!Ce[pn]){let hr=E(Se)||Se.parentNode,Ha=A(Se)||Se.childNodes;if(Ha&&hr){let Ta=Ha.length;for(let sl=Ta-1;sl>=0;--sl){let xh=y(Ha[sl],!0);xh.__removalCount=(Se.__removalCount||0)+1,hr.insertBefore(xh,x(Se))}}}return Gr(Se),!0}return Se instanceof l&&!tp(Se)||(pn==="noscript"||pn==="noembed"||pn==="noframes")&&Mc(/<\/no(script|embed|frames)/i,Se.innerHTML)?(Gr(Se),!0):(Pe&&Se.nodeType===Kw.text&&(Pt=Se.textContent,uN([w,D,I],hr=>{Pt=qw(Pt,hr," ")}),Se.textContent!==Pt&&(Ww(t.removed,{element:Se.cloneNode()}),Se.textContent=Pt)),za(_.afterSanitizeElements,Se,null),!1)},Hu=function(Se,Pt,pn){if(ln&&(Pt==="id"||Pt==="name")&&(pn in n||pn in $s))return!1;if(!(ue&&!me[Pt]&&Mc(N,Pt))){if(!(xe&&Mc(k,Pt))){if(!te[Pt]||me[Pt]){if(!(Gu(Se)&&(Z.tagNameCheck instanceof RegExp&&Mc(Z.tagNameCheck,Se)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(Se))&&(Z.attributeNameCheck instanceof RegExp&&Mc(Z.attributeNameCheck,Pt)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(Pt))||Pt==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Mc(Z.tagNameCheck,pn)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(pn))))return!1}else if(!So[Pt]){if(!Mc(U,qw(pn,V,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Se!=="script"&&XNe(pn,"data:")===0&&mt[Se])){if(!(ye&&!Mc(H,qw(pn,V,"")))){if(pn)return!1}}}}}}return!0},Gu=function(Se){return Se!=="annotation-xml"&&Fne(Se,j)},ju=function(Se){za(_.beforeSanitizeAttributes,Se,null);let{attributes:Pt}=Se;if(!Pt||Zs(Se))return;let pn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},hr=Pt.length;for(;hr--;){let Ha=Pt[hr],{name:Ta,namespaceURI:sl,value:xh}=Ha,GS=yi(Ta),xc=Ta==="value"?xh:KNe(xh);if(pn.attrName=GS,pn.attrValue=xc,pn.keepAttr=!0,pn.forceKeepAttr=void 0,za(_.uponSanitizeAttribute,Se,pn),xc=pn.attrValue,Vt&&(GS==="id"||GS==="name")&&(zu(Ta,Se),xc=Ct+xc),Ee&&Mc(/((--!?|])>)|<\/(style|title)/i,xc)){zu(Ta,Se);continue}if(pn.forceKeepAttr||(zu(Ta,Se),!pn.keepAttr))continue;if(!Ae&&Mc(/\/>/i,xc)){zu(Ta,Se);continue}Pe&&uN([w,D,I],J$=>{xc=qw(xc,J$," ")});let Q$=yi(Se.nodeName);if(Hu(Q$,GS,xc)){if(S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!sl)switch(g.getAttributeType(Q$,GS)){case"TrustedHTML":{xc=S.createHTML(xc);break}case"TrustedScriptURL":{xc=S.createScriptURL(xc);break}}try{sl?Se.setAttributeNS(sl,Ta,xc):Se.setAttribute(Ta,xc),Zs(Se)?Gr(Se):Nne(t.removed)}catch{}}}za(_.afterSanitizeAttributes,Se,null)},Oo=function cn(Se){let Pt=null,pn=S0(Se);for(za(_.beforeSanitizeShadowDOM,Se,null);Pt=pn.nextNode();)za(_.uponSanitizeShadowNode,Pt,null),es(Pt),ju(Pt),Pt.content instanceof r&&cn(Pt.content);za(_.afterSanitizeShadowDOM,Se,null)};return t.sanitize=function(cn){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,pn=null,hr=null,Ha=null;if(Xe=!cn,Xe&&(cn="<!-->"),typeof cn!="string"&&!rl(cn))if(typeof cn.toString=="function"){if(cn=cn.toString(),typeof cn!="string")throw Yw("dirty is not a string, aborting")}else throw Yw("toString is not a function");if(!t.isSupported)return cn;if(je||ol(Se),t.removed=[],typeof cn=="string"&&(an=!1),an){if(cn.nodeName){let xh=yi(cn.nodeName);if(!q[xh]||ee[xh])throw Yw("root node is forbidden and cannot be sanitized in-place")}}else if(cn instanceof a)Pt=Va("<!---->"),pn=Pt.ownerDocument.importNode(cn,!0),pn.nodeType===Kw.element&&pn.nodeName==="BODY"||pn.nodeName==="HTML"?Pt=pn:Pt.appendChild(pn);else{if(!Dt&&!Pe&&!Ve&&cn.indexOf("<")===-1)return S&&$e?S.createHTML(cn):cn;if(Pt=Va(cn),!Pt)return Dt?null:$e?v:""}Pt&&it&&Gr(Pt.firstChild);let Ta=S0(an?cn:Pt);for(;hr=Ta.nextNode();)es(hr),ju(hr),hr.content instanceof r&&Oo(hr.content);if(an)return cn;if(Dt){if(Gt)for(Ha=R.call(Pt.ownerDocument);Pt.firstChild;)Ha.appendChild(Pt.firstChild);else Ha=Pt;return(te.shadowroot||te.shadowrootmode)&&(Ha=B.call(i,Ha,!0)),Ha}let sl=Ve?Pt.outerHTML:Pt.innerHTML;return Ve&&q["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&Mc(qne,Pt.ownerDocument.doctype.name)&&(sl="<!DOCTYPE "+Pt.ownerDocument.doctype.name+`> -`+sl),Pe&&uN([w,D,I],xh=>{sl=qw(sl,xh," ")}),S&&$e?S.createHTML(sl):sl},t.setConfig=function(){let cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ol(cn),je=!0},t.clearConfig=function(){hi=null,je=!1},t.isValidAttribute=function(cn,Se,Pt){hi||ol({});let pn=yi(cn),hr=yi(Se);return Hu(pn,hr,Pt)},t.addHook=function(cn,Se){typeof Se=="function"&&Ww(_[cn],Se)},t.removeHook=function(cn){return Nne(_[cn])},t.removeHooks=function(cn){_[cn]=[]},t.removeAllHooks=function(){_=Hne()},t}var Xne=Yne();var uFe=0,pj={};function zh(e,t){T.typeOf.string("html",e);let n,i=e;c(pj[i])?n=pj[i]:(n=uFe++,pj[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(zh.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(!c(this._element)){let e=Xne.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}}});zh.equals=function(e,t){return e===t||c(e)&&c(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};zh.prototype.equals=function(e){return zh.equals(this,e)};zh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};zh.getIonCredit=function(e){let t=c(e.collapsible)&&!e.collapsible;return new zh(e.html,t)};zh.clone=function(e){if(c(e))return new zh(e.html,e.showOnScreen)};var At=zh;function fFe(e,t){if(!c(e)||!c(t))throw new C("identifier and message are required.");dt(e,t)}var Ns=fFe;function ib(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 pe}Object.defineProperties(ib.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}}});ib.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function _j(e){e._cubeMapBuffers=void 0}ib.prototype.update=function(e){let{context:t}=e;if(!ib.isSupported(t))return;if(c(this._texture)){_j(this);return}if(!c(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);c(f)&&(_j(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!c(n)&&!this._loading){let f=this;Xl(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!c(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;c(i)||(i=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT);let o=ke.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(Go.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<a;h++)n.push(f)}let l=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),u=new Go({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:l});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){return _j(this),this._texture=this._texture&&this._texture.destroy(),de(this)};var Hh=ib;function $w(e){e=e??W.EMPTY_OBJECT;let t=c(e.imageBasedLightingFactor)?z.clone(e.imageBasedLightingFactor):new z(1,1);T.typeOf.object("options.imageBasedLightingFactor",t),T.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.x",t.x,0),T.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.x",t.x,1),T.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.y",t.y,0),T.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.y",t.y,1),this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;if(c(n)&&(!Array.isArray(n)||n.length!==9))throw new C("options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");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=z.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties($w.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){T.typeOf.object("imageBasedLightingFactor",e),T.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),T.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),T.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),T.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=z.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if(c(e)&&(!Array.isArray(e)||e.length!==9))throw new C("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");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 c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function dFe(e,t){if(Hh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),c(e._specularEnvironmentMaps)){let n=new Hh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}$w.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;z.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=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||c(this._previousSphericalHarmonicCoefficients)!==c(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(dFe(this,t),this._specularEnvironmentCubeMapDirty=!1),c(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!c(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!c(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)};$w.prototype.isDestroyed=function(){return!1};$w.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),de(this)};var lA=$w;var yj=jr(ql(),1);var gj,Kne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",hN={};hN.defaultAccessToken=Kne;hN.defaultServer=new we({url:"https://api.cesium.com/"});hN.getDefaultTokenCredit=function(e){if(e===Kne){if(!c(gj)){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>`;gj=new At(t,!0)}return gj}};var Gh=hN;function Nc(e,t){T.defined("endpoint",e),T.defined("endpointResource",t);let n,i=e.externalType,o=c(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:hFe};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.");we.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new yj.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}c(Object.create)&&(Nc.prototype=Object.create(we.prototype),Nc.prototype.constructor=Nc);Nc.fromAssetId=function(e,t){let n=Nc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Nc(i,n)})};Object.defineProperties(Nc.prototype,{credits:{get:function(){return c(this._ionRoot)?this._ionRoot.credits:c(this._credits)?this._credits:(this._credits=Nc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Nc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(At.getIonCredit),i=Gh.getDefaultTokenCredit(t.queryParameters.access_token);return c(i)&&n.push(At.clone(i)),n};Nc.prototype.clone=function(e){let t=this._ionRoot??this;return c(e)||(e=new Nc(t._ionEndpoint,t._ionEndpointResource)),e=we.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Nc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},c(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return we.prototype.fetchImage.call(this,e)};Nc.prototype._makeRequest=function(e){return this._isExternal||new yj.default(this.url).authority()!==this._ionEndpointDomain?we.prototype._makeRequest.call(this,e):(c(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),we.prototype._makeRequest.call(this,e))};Nc._createEndpointResource=function(e,t){T.defined("assetId",e),t=t??W.EMPTY_OBJECT;let n=t.server??Gh.defaultServer,i=t.accessToken??Gh.defaultAccessToken;n=we.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return c(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function hFe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!c(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(c(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 uf=Nc;function jh(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(jh.prototype,{length:{get:function(){return this._length},set:function(e){T.typeOf.number.greaterThanOrEquals("length",e,0);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}}});jh.prototype.get=function(e){return T.typeOf.number.lessThan("index",e,this._array.length),this._array[e]};jh.prototype.set=function(e,t){T.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t};jh.prototype.peek=function(){return this._array[this._length-1]};jh.prototype.push=function(e){let t=this.length++;this._array[t]=e};jh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};jh.prototype.reserve=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)};jh.prototype.resize=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e};jh.prototype.trim=function(e){e=e??this._length,this._array.length=e};var xl=jh;var Tp={X:0,Y:1,Z:2};Tp.Y_UP_TO_Z_UP=F.fromRotationTranslation(J.fromArray([1,0,0,0,0,1,0,-1,0]));Tp.Z_UP_TO_Y_UP=F.fromRotationTranslation(J.fromArray([1,0,0,0,0,-1,0,1,0]));Tp.X_UP_TO_Z_UP=F.fromRotationTranslation(J.fromArray([0,0,1,0,1,0,-1,0,0]));Tp.Z_UP_TO_X_UP=F.fromRotationTranslation(J.fromArray([0,0,-1,0,1,0,1,0,0]));Tp.X_UP_TO_Y_UP=F.fromRotationTranslation(J.fromArray([0,1,0,-1,0,0,0,0,1]));Tp.Y_UP_TO_X_UP=F.fromRotationTranslation(J.fromArray([0,-1,0,1,0,0,0,0,1]));Tp.fromName=function(e){return T.typeOf.string("name",e),Tp[e]};var Fo=Object.freeze(Tp);function $ne(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties($ne.prototype,{metadata:{get:function(){return this._metadata}}});var uA=$ne;function sg(e,t,n){if(!c(e))throw new C("uint8Array is required.");if(t<0)throw new C("byteOffset cannot be negative.");if(n<0)throw new C("byteLength cannot be negative.");if(t+n>e.byteLength)throw new C("sub-region exceeds array bounds.");return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),sg.decode(e)}sg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};sg.decodeWithFromCharCode=function(e){let t="",n=mFe(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 Zw(e,t,n){return t<=e&&e<=n}function mFe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let l=0;l<a;++l){let u=e[l];if(i===0){if(Zw(u,0,127)){s.push(u);continue}if(Zw(u,194,223)){i=1,t=u&31;continue}if(Zw(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(Zw(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new ae("String decoding failed.")}if(!Zw(u,o,r)){t=i=n=0,o=128,r=191,--l;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?sg.decode=sg.decodeWithTextDecoder:sg.decode=sg.decodeWithFromCharCode;var tu=sg;function pFe(e,t){return t=t??0,tu(e,t,Math.min(4,e.length))}var Wh=pFe;function ff(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,c(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(ff.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 Qw=Uint32Array.BYTES_PER_ELEMENT;ff.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=Qw;let l=a.getUint32(o,!0);if(l!==1)throw new ae(`Only Composite Tile version 1 is supported. Version ${l} is not.`);o+=Qw,o+=Qw;let u=a.getUint32(o,!0);o+=Qw;let f=n.queryParameters.compositeIndex;c(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let y=Wh(s,o),b=a.getUint32(o+Qw*2,!0),x=r[y],A=`${f}${m}`,E=n.getDerivedResource({queryParameters:{compositeIndex:A}});if(c(x))h[m]=Promise.resolve(x(e,t,E,i,o));else throw new ae(`Unknown tile content type, ${y}, inside Composite tile`);o+=b}let p=await Promise.all(h);return new ff(e,t,n,p)};ff.prototype.hasProperty=function(e,t){return!1};ff.prototype.getFeature=function(e){};ff.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};ff.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};ff.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)};ff.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 l=r[a].pick(e,t,n);if(!c(l))continue;let u=d.distance(e.origin,l);u<o&&(i=l,o=u)}if(c(i))return n};ff.prototype.isDestroyed=function(){return!1};ff.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var mN=ff;function _Fe(e,t,n){return JSON.parse(tu(e,t,n))}var sr=_Fe;function tc(e){T.typeOf.number("options.featuresLength",e.featuresLength),T.typeOf.object("options.owner",e.owner),this._id=jn();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,ut.maximumTextureSize),r=Math.ceil(t/ut.maximumTextureSize),s=1/o,a=s*.5,l=1/r,u=l*.5;n=new z(o,r),i=new se(s,a,l,u)}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(tc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return c(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),c(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}}});tc.DEFAULT_COLOR_VALUE=G.WHITE;tc.DEFAULT_SHOW_VALUE=!0;function Zne(e){let t=e._textureDimensions;return t.x*t.y*4}function Qne(e){if(!c(e._batchValues)){let t=Zne(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Jne(e){if(!c(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function Jw(e,t){if(!c(e)||e<0||e>=t)throw new C(`batchId is required and between zero and featuresLength - 1 (${t}`-+").")}tc.prototype.setShow=function(e,t){if(Jw(e,this._featuresLength),T.typeOf.bool("show",t),t&&!c(this._showAlphaProperties))return;let n=Jne(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Qne(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};tc.prototype.setAllShow=function(e){T.typeOf.bool("show",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};tc.prototype.getShow=function(e){if(Jw(e,this._featuresLength),!c(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var gFe=new Array(4);tc.prototype.setColor=function(e,t){if(Jw(e,this._featuresLength),T.typeOf.object("color",t),G.equals(t,tc.DEFAULT_COLOR_VALUE)&&!c(this._batchValues))return;let n=t.toBytes(gFe),i=n[3],o=Qne(this),r=e*4,s=Jne(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 l=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!l?++this._translucentFeaturesLength:!f&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,c(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};tc.prototype.setAllColor=function(e){T.typeOf.object("color",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};tc.prototype.getColor=function(e,t){if(Jw(e,this._featuresLength),T.typeOf.object("result",t),!c(this._batchValues))return G.clone(tc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return G.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};tc.prototype.getPickColor=function(e){return Jw(e,this._featuresLength),this._pickIds[e]};function eie(e,t,n){let i=e._textureDimensions;return new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Qt.NEAREST})}function yFe(e,t){let n=e._featuresLength;if(!c(e._pickTexture)&&n>0){let i=e._pickIds,o=Zne(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l<n;++l){let u=t.createPickId(s.getFeature(l));i.push(u);let f=u.color,h=l*4;r[h]=G.floatToByte(f.red),r[h+1]=G.floatToByte(f.green),r[h+2]=G.floatToByte(f.blue),r[h+3]=G.floatToByte(f.alpha)}e._pickTexture=eie(e,t,r),c(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function bFe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}tc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&yFe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,c(this._batchTexture)||(this._batchTexture=eie(this,n,this._batchValues),c(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),bFe(this))};tc.prototype.isDestroyed=function(){return!1};tc.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 de(this)};var Tl=tc;var xFe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},TFe={SCALAR:void 0,VEC2:z,VEC3:d,VEC4:se,MAT2:Ri,MAT3:J,MAT4:F};function AFe(e){let t=e.componentType,n;typeof t=="string"?n=$.fromName(t):n=t;let i=xFe[e.type],o=TFe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return $.createArrayBufferView(n,r,s,i*a)}}}var df=AFe;function Ap(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,T.typeOf.object("options.extension",e.extension),CFe(this,e.extension,e.binaryBody),vFe(this)}Object.defineProperties(Ap.prototype,{byteLength:{get:function(){return this._byteLength}}});function CFe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,l=t.classIds,u=t.parentCounts,f=t.parentIds,h=s,p=0;c(l.byteOffset)&&(l.componentType=l.componentType??$.UNSIGNED_SHORT,l.type=nn.SCALAR,r=df(l),l=r.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,s),p+=l.byteLength);let g;if(c(u)){for(c(u.byteOffset)&&(u.componentType=u.componentType??$.UNSIGNED_SHORT,u.type=nn.SCALAR,r=df(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=u[i];p+=g.byteLength}c(f)&&c(f.byteOffset)&&(f.componentType=f.componentType??$.UNSIGNED_SHORT,f.type=nn.SCALAR,r=df(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let x=a[i].length,A=a[i].instances,E=EFe(x,A,n);p+=SFe(E),a[i].instances=xt(E,A)}let y=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=l[i],b[i]=y[o],++y[o];p+=b.byteLength,e._classes=a,e._classIds=l,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function EFe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new ae("componentType is required.");if(!c(l))throw new ae("type is required.");if(!c(n))throw new ae(`Property ${o} requires a batch table binary.`);let u=df(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function SFe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var wFe=[];function vFe(e){let t=wFe;t.length=0;let i=e._classIds.length;for(let o=0;o<i;++o)tie(e,o,t)}function tie(e,t,n){let i=e._parentCounts,o=e._parentIds,r=e._parentIndexes,a=e._classIds.length;if(!c(o))return;if(t>=a)throw new C(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new C("Circular dependency detected in the batch table hierarchy.");n.push(t);let l=c(i)?i[t]:1,u=c(i)?r[t]:t;for(let f=0;f<l;++f){let h=o[u+f];h!==t&&tie(e,h,n)}n.pop(t)}var DFe=[],PFe=[],IFe=0;function OFe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,l=DFe;l.length=Math.max(l.length,a);let u=++IFe,f=PFe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),l[t]===u)continue;l[t]=u;let h=n(e,t);if(c(h))return h;let p=o[t],g=s[t];for(let m=0;m<p;++m){let y=r[g+m];y!==t&&f.push(y)}}}function RFe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(c(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function ev(e,t,n){let i=e._parentCounts,o=e._parentIds;if(c(o)){if(c(i))return OFe(e,t,n)}else return n(e,t);return RFe(e,t,n)}Ap.prototype.hasProperty=function(e,t){let n=ev(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(c(s[t]))return!0});return c(n)};Ap.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(c(o[e]))return!0}return!1};Ap.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,ev(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};Ap.prototype.getProperty=function(e,t){return ev(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(c(a))return c(a.typedArray)?MFe(a,s):We(a[s],!0)})};function MFe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Ap.prototype.setProperty=function(e,t,n){let i=ev(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],l=o._classIndexes[r],u=a.instances[t];if(c(u)){if(r!==e)throw new C(`Inherited property "${t}" is read-only.`);return c(u.typedArray)?LFe(u,l,n):u[l]=We(n,!0),!0}});return c(i)};function LFe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Ap.prototype.isClass=function(e,t){let n=ev(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return c(n)};Ap.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var fA=Ap;var NFe={HIGHLIGHT:0,REPLACE:1,MIX:2},nu=Object.freeze(NFe);var bj=Tl.DEFAULT_COLOR_VALUE,xj=Tl.DEFAULT_SHOW_VALUE;function po(e,t,n,i,o){this.featuresLength=t;let r;c(n)&&(r=n.extensions),this._extensions=r??{};let s=FFe(n);this._properties=s,this._batchTableHierarchy=BFe(this,n,i);let a=iie(t,s,i);this._binaryPropertiesByteLength=kFe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Tl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}po._deprecationWarning=Ns;Object.defineProperties(po.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function FFe(e){let t={};if(!c(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=We(e[n],!0));return t}function BFe(e,t,n){if(!c(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(c(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),!!c(i))return new fA({extension:i,binaryBody:n})}function iie(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new ae("componentType is required.");if(!c(l))throw new ae("type is required.");if(!c(n))throw new ae(`Property ${o} requires a batch table binary.`);let u=df(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function kFe(e){if(!c(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 iie(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 UFe=new G;po.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(bj),this.setAllShow(xj);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=c(e.color)?e.color.evaluateColor(o,UFe)??bj:bj,s=c(e.show)?e.show.evaluate(o)??xj:xj;this.setColor(i,r),this.setShow(i,s)}};function VFe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function zFe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}function dA(e,t){if(!c(e)||e<0||e>=t)throw new C(`batchId is required and must be between zero and featuresLength - 1 (${t}`-+").")}po.prototype.isClass=function(e,t){dA(e,this.featuresLength),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};po.prototype.isExactClass=function(e,t){return T.typeOf.string("className",t),this.getExactClassName(e)===t};po.prototype.getExactClassName=function(e){dA(e,this.featuresLength);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};po.prototype.hasProperty=function(e,t){return dA(e,this.featuresLength),T.typeOf.string("name",t),c(this._properties[t])||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};po.prototype.hasPropertyBySemantic=function(){return!1};po.prototype.getPropertyIds=function(e,t){dA(e,this.featuresLength),t=c(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),c(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(dA(e,this.featuresLength),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(c(i))return VFe(i,e)}let n=this._properties[t];if(c(n))return We(n[e],!0);if(c(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(c(i))return i}};po.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(dA(e,i),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(c(r)){zFe(r,e,n);return}}if(c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];c(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=We(n,!0)};function HFe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +`;var Int=`#define CLIP_POLYLINE +${Eu} +${UU}`,Pnt=yv;function Ax(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ax.VERTEX_FORMAT;this.material=l(e.material)?e.material:lr.fromType(lr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??Int,this._fragmentShaderSource=e.fragmentShaderSource??Pnt,this._renderState=Or.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ax.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}}});Ax.VERTEX_FORMAT=Be.POSITION_AND_ST;Ax.prototype.getFragmentShaderSource=Or.prototype.getFragmentShaderSource;Ax.prototype.isTranslucent=Or.prototype.isTranslucent;Ax.prototype.getRenderState=Or.prototype.getRenderState;var Tc=Ax;function dg(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Tc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=gAe(!1),this._renderState3DTiles=gAe(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},depthTest:{enabled:!0},blending:rn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(dg.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}}});dg.initializeTerrainHeights=function(){return Ni.initialize()};function Dnt(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(BU);s=Nn._appendShowToShader(r,s),s=Nn._appendDistanceDisplayConditionToShader(r,s),s=Nn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(FU);a=Nn._appendShowToShader(r,a),a=Nn._appendDistanceDisplayConditionToShader(r,a),a=Nn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(NU),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Xe({defines:u,sources:[s]}),m=new Xe({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Xe({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Xe({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Ni._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(LU);let x=new Xe({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function gAe(e){return Ge.fromCache({cull:{enabled:!0},blending:rn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function Rnt(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Ks?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new at({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=at.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=at.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=at.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=at.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function _Ae(e,t,n,i,r,o,s){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Ont(e,t,n,i,r,o,s){let a=e._primitive;Nn._updateBoundingVolumes(a,t,r);let c;t.mode===re.SCENE3D?c=a._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===re.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==ti.CESIUM_3D_TILE,p=f!==ti.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],_Ae(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,_Ae(e,g,t,r,o,b,s))}}}dg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){dg.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Rl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,kC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Bt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){Dnt(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){Rnt(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){Ont(n,u,f,d,p,g,m)},this._primitive=new Nn(i)}if(this.appearance instanceof Ks&&!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))})};dg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};dg.isSupported=function(e){return e.frameState.context.depthTexture};dg.prototype.isDestroyed=function(){return!1};dg.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,ue(this)};var bp=dg;var Mnt=new U(1,1),Nnt=!1,Lnt=z.WHITE;function Av(e){e=e??H.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(Av.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});Av.prototype.getType=function(e){return"Image"};var Fnt=new K;Av.prototype.getValue=function(e,t){return l(e)||(e=K.now(Fnt)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,Mnt,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,Lnt,t.color),X.getValueOrDefault(this._transparent,e,Nnt)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};Av.prototype.equals=function(e){return this===e||e instanceof Av&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var bx=Av;function Bnt(e){if(e instanceof z)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new bx;return t.image=e,t}}function knt(e,t){return me(e,t,Bnt)}var ho=knt;function WD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(WD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});WD.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 WD(this)};WD.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var bv=WD;function xv(){pe.throwInstantiationError()}Object.defineProperties(xv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});xv.prototype.getValue=pe.throwInstantiationError;xv.prototype.getValueInReferenceFrame=pe.throwInstantiationError;xv.prototype.equals=pe.throwInstantiationError;var yAe=new $;xv.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=At.computeIcrfToCentralBodyFixedMatrix(e,yAe);if(n===Wi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Wi.FIXED)return $.multiplyByVector($.transpose(o,yAe),t,r)};var xp=xv;function xx(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Wi.FIXED}Object.defineProperties(xx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Wi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Unt=new K;xx.prototype.getValue=function(e,t){return l(e)||(e=K.now(Unt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};xx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};xx.prototype.getValueInReferenceFrame=function(e,t,n){return xp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};xx.prototype.equals=function(e){return this===e||e instanceof xx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var wu=xx;function qD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(qD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});qD.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 qD(this)};qD.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Tv=qD;function znt(e){return e}function Vnt(e,t){return me(e,t,znt)}var Iu=Vnt;function YD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(YD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});YD.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 YD(this)};YD.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Ev=YD;function XD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(XD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});XD.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 XD(this)};XD.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Cv=XD;function KD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(KD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});KD.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 KD(this)};KD.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var vv=KD;function $D(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(e??H.EMPTY_OBJECT)}Object.defineProperties($D.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});$D.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 $D(this)};$D.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Tp=$D;var AZ=new lx;function JD(e){e=e??H.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(JD.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var jnt=new K;JD.prototype.getValue=function(e,t){return l(e)||(e=K.now(jnt)),l(t)||(t=new lx),t.translation=X.getValueOrClonedDefault(this._translation,e,AZ.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,AZ.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,AZ.scale,t.scale),t};JD.prototype.equals=function(e){return this===e||e instanceof JD&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var Sv=JD;function hg(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(hg.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(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});hg.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function Hnt(e){return new Ti(e)}hg.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??Hnt)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};hg.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var Gnt=new K;hg.prototype.getValue=function(e,t){l(e)||(e=K.now(Gnt)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};hg.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],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 Wnt(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}hg.prototype.equals=function(e){return this===e||e instanceof hg&&Wnt(this,e)};var Pu=hg;function AAe(e){return new Sv(e)}function qnt(e){return new Pu(e,AAe)}function Ynt(e){return new Pu(e)}function Xnt(e){return new Pu(e)}function ZD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(ZD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,Xnt),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,qnt),articulations:me("articulations",void 0,Ynt),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});ZD.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 ZD(this)};ZD.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Pu(t,AAe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Pu(n)}};var My=ZD;function QD(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(e??H.EMPTY_OBJECT)}Object.defineProperties(QD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});QD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new QD(this)};QD.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var wv=QD;function e1(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._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(e1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:ho("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});e1.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.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new e1(this)};e1.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var Ny=e1;function t1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(t1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});t1.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 t1(this)};t1.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var zU=t1;function n1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(n1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});n1.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 n1(this)};n1.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Iv=n1;function Knt(e){return Array.isArray(e)&&(e=new Xc(e)),new Ti(e)}function i1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(i1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,Knt),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});i1.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 i1(this)};i1.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var Ep=i1;function r1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(r1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:ho("material"),depthFailMaterial:ho("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});r1.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 r1(this)};r1.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Bl=r1;function o1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(o1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});o1.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 o1(this)};o1.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Pv=o1;function s1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(s1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});s1.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 s1(this)};s1.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Cp=s1;function a1(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(e??H.EMPTY_OBJECT)}Object.defineProperties(a1.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:ho("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});a1.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 a1(this)};a1.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Ly=a1;var $nt=new he,bZ=[];function Jnt(e){return new wu(e)}function Znt(e){return me(e,void 0,Jnt)}function Ma(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Ed(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Cy.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",...bZ],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 xZ(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&xZ(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Ed.prototype,{availability:Iu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Iu("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&&xZ(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Iu("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 r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&xZ(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ma("billboard",Fl),box:Ma("box",bv),corridor:Ma("corridor",Tv),cylinder:Ma("cylinder",Ev),description:me("description"),ellipse:Ma("ellipse",Cv),ellipsoid:Ma("ellipsoid",vv),label:Ma("label",Tp),model:Ma("model",My),tileset:Ma("tileset",wv),orientation:me("orientation"),path:Ma("path",Ny),plane:Ma("plane",zU),point:Ma("point",Iv),polygon:Ma("polygon",Ep),polyline:Ma("polyline",Bl),polylineVolume:Ma("polylineVolume",Pv),properties:Ma("properties",Pu),position:Znt("position"),rectangle:Ma("rectangle",Cp),viewFrom:me("viewFrom"),wall:Ma("wall",Ly)});Ed.registerEntityType=function(e,t){Object.defineProperties(Ed.prototype,{[e]:Ma(e,t)}),bZ.includes(e)||bZ.push(e)};Ed.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Ed.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Iu(e,!0))};Ed.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Ed.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var bAe=new $,xAe=new h,TAe=new Le;Ed.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,xAe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,TAe);return l(i)?t=M.fromRotationTranslation($.fromQuaternion(i,bAe),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};Ed.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,xAe);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,$nt);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):ps(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,TAe);return l(c)?r=M.fromRotationTranslation($.fromQuaternion(c,bAe),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};Ed.supportsMaterialsforEntitiesOnTerrain=function(e){return Su.supportsMaterials(e)};Ed.supportsPolylinesOnTerrain=function(e){return bp.isSupported(e)};var no=Ed;var Qnt=new Kt(z.WHITE),eit=new Ti(!0),tit=new Ti(!0),nit=new Ti(!1),iit=new Ti(z.BLACK),rit=new Ti(Dn.DISABLED),oit=new Ti(new Gt),sit=new Ti(ti.BOTH);function kl(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=no.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(kl.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)&&X.isConstant(this._showProperty)&&X.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)&&X.isConstant(this._showProperty)&&X.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}}});kl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};kl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};kl.prototype.createFillGeometryInstance=pe.throwInstantiationError;kl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;kl.prototype.isDestroyed=function(){return!1};kl.prototype.destroy=function(){ue(this)};kl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(nt.MINIMUM_VALUE)};kl.prototype._isOnTerrain=function(e,t){return!1};kl.prototype._getIsClosed=function(e){return!0};kl.prototype._isDynamic=pe.throwInstantiationError;kl.prototype._setStaticOptions=pe.throwInstantiationError;kl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(nt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(nt.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??Qnt,this._fillProperty=o??tit,this._showProperty=u??eit,this._showOutlineProperty=r.outline??nit,this._outlineColorProperty=c?r.outlineColor??iit:void 0,this._shadowsProperty=r.shadows??rit,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??oit,this._classificationTypeProperty=r.classificationType??sit,this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(yt(yt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(nt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};kl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Oi=kl;function Dv(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Dv.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var ait=new K;Dv.prototype.getValue=function(e,t){return l(e)||(e=K.now(ait)),this._callback(e,t)};Dv.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Dv.prototype.equals=function(e){return this===e||e instanceof Dv&&this._callback===e._callback&&this._isConstant===e._isConstant};var vp=Dv;var EAe=new h;function Rv(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(nt.MINIMUM_VALUE,EAe);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(Rv.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Rv.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var cit=new K;Rv.prototype.getValue=function(e,t){l(e)||(e=K.now(cit));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!Sy(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,EAe);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,P.EPSILON10)&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);if(n===We.CLIP_TO_GROUND){let c=r.globe.ellipsoid.cartesianToCartographic(o,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};Rv.prototype.isDestroyed=function(){return!1};Rv.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var Ov=Rv;function lit(e,t,n,i){if(Oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new vp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ov(this._scene,s,o)}}var Fy=lit;var CAe=h.ZERO,vAe=new h,uit=new h,SAe=new z;function fit(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function _f(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new fit(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(_f.prototype=Object.create(Oi.prototype),_f.prototype.constructor=_f);Object.defineProperties(_f.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});_f.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ei.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,SAe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,CAe,vAe))),new Bt({id:t,geometry:zc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};_f.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,SAe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,CAe,vAe))),new Bt({id:t,geometry:ep.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};_f.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};_f.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Oi.prototype._isHidden.call(this,e,t)};_f.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};_f.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};_f.prototype._onEntityPropertyChanged=Fy;_f.DynamicGeometryUpdater=Mv;function Mv(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(Mv.prototype=Object.create(Ri.prototype),Mv.prototype.constructor=Mv);Mv.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,uit),r=this._options.dimensions;return!l(i)||!l(r)||Ri.prototype._isHidden.call(this,e,t,n)};Mv.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?pn.ALL:void 0};var VU=_f;function Tx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Wi.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Tx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var dit=new K;Tx.prototype.getValue=function(e,t){return l(e)||(e=K.now(dit)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Tx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Tx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return xp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Tx.prototype.equals=function(e){return this===e||e instanceof Tx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var jU=Tx;function Ex(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(Ex.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}}});Ex.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function TZ(e){e._cubeMapBuffers=void 0}Ex.prototype.update=function(e){let{context:t}=e;if(!Ex.isSupported(t))return;if(l(this._texture)){TZ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(TZ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;tf(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT);let r=$e.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(o!==a){let f={};Object.values(ls.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new Ht({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ls({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Ex.prototype.isDestroyed=function(){return!1};Ex.prototype.destroy=function(){return TZ(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var Sp=Ex;function c1(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(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._previousFrameContext=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(c1.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.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 hit(e,t){if(Sp.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Sp(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}c1.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.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=U.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&&(hit(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};c1.prototype.isDestroyed=function(){return!1};c1.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var Nv=c1;function wAe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(wAe.prototype,{metadata:{get:function(){return this._metadata}}});var Lv=wAe;var EZ=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,s){o=o??0;let a=new Uint8Array(r),c=new DataView(r);o+=l1;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=l1,o+=l1;let f=c.getUint32(o,!0);o+=l1;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=ip(a,o),b=c.getUint32(o+l1*2,!0),x=s[A],T=`${d}${y}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,E,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}},l1=Uint32Array.BYTES_PER_ELEMENT,HU=EZ;function el(e){this._id=Kn();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 r=Math.min(t,Ut.maximumTextureSize),o=Math.ceil(t/Ut.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new U(r,o),i=new se(s,a,c,u)}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(el.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}}});el.DEFAULT_COLOR_VALUE=z.WHITE;el.DEFAULT_SHOW_VALUE=!0;function IAe(e){let t=e._textureDimensions;return t.x*t.y*4}function PAe(e){if(!l(e._batchValues)){let t=IAe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function DAe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}el.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=DAe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=PAe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};el.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};el.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var mit=new Array(4);el.prototype.setColor=function(e,t){if(z.equals(t,el.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(mit),i=n[3],r=PAe(this),o=e*4,s=DAe(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};el.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};el.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(el.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};el.prototype.getPickColor=function(e){return this._pickIds[e]};function RAe(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Ht.NEAREST})}function pit(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=IAe(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=RAe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function git(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}el.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&pit(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=RAe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),git(this))};el.prototype.isDestroyed=function(){return!1};el.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 ue(this)};var Du=el;var _it={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},yit={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:$i,MAT3:$,MAT4:M};function Ait(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=_it[e.type],r=yit[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Fh=Ait;function mg(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,bit(this,e.extension,e.binaryBody)}Object.defineProperties(mg.prototype,{byteLength:{get:function(){return this._byteLength}}});function bit(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Fh(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Fh(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Fh(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,x=a[i].instances,T=wp.getBinaryProperties(b,x,n);p+=xit(T),a[i].instances=Mt(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=a,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function xit(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Tit=[],Eit=[],Cit=0;function vit(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=Tit;c.length=Math.max(c.length,a);let u=++Cit,f=Eit;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function Sit(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function u1(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return vit(e,t,n)}else return n(e,t);return Sit(e,t,n)}mg.prototype.hasProperty=function(e,t){let n=u1(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};mg.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};mg.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,u1(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};mg.prototype.getProperty=function(e,t){return u1(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?wit(a,s):Ze(a[s],!0)})};function wit(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}mg.prototype.setProperty=function(e,t,n){let i=u1(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?Iit(u,c,n):u[c]=Ze(n,!0),!0});return l(i)};function Iit(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}mg.prototype.isClass=function(e,t){let n=u1(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};mg.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Fv=mg;var OAe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(OAe);var yf=OAe;var CZ=Du.DEFAULT_COLOR_VALUE,vZ=Du.DEFAULT_SHOW_VALUE;function Hr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=Pit(n);this._properties=s,this._batchTableHierarchy=Dit(this,n,i);let a=NAe(t,s,i);this._binaryPropertiesByteLength=Rit(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Du({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Hr._deprecationWarning=Xr;Object.defineProperties(Hr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Pit(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ze(e[n],!0));return t}function Dit(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Hr._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"]=r,i=r),!!l(i))return new Fv({extension:i,binaryBody:n})}function NAe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Fh(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function Rit(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Hr.getBinaryProperties=function(e,t,n){return NAe(e,t,n)};Hr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Hr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Hr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Hr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Hr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Hr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Hr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Oit=new z;Hr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(CZ),this.setAllShow(vZ);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,Oit)??CZ:CZ,s=l(e.show)?e.show.evaluate(r)??vZ:vZ;this.setColor(i,o),this.setShow(i,s)}};function Mit(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Nit(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Hr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Hr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Hr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Hr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Hr.prototype.hasPropertyBySemantic=function(){return!1};Hr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Zn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Zn(t,i)}return t};Hr.prototype.getPropertyBySemantic=function(e,t){};Hr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return Mit(i,e)}let n=this._properties[t];if(l(n))return Ze(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Hr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){Nit(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Ze(n,!0)};function Lit(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; vec2 computeSt(float batchId) { float stepX = tile_textureStep.x; @@ -3284,7 +4459,7 @@ vec2 computeSt(float batchId) 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=oie(o,n,!1),s;return ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`}Hr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=LAe(r,n,!1),s;return Ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; `),s+=`uniform sampler2D tile_batchTexture; out vec4 tile_featureColor; out vec2 tile_featureSt; @@ -3317,8 +4492,8 @@ void main() { tile_color(vec4(1.0)); tile_featureSt = computeSt(${t}); -}`,`${r} -${HFe(i)}${s}`}};function nie(e,t){return e=He.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +}`,`${o} +${Lit(i)}${s}`}};function MAe(e,t){return e=Xe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; void tile_color(vec4 tile_featureColor) { tile_main(); @@ -3331,7 +4506,7 @@ void tile_color(vec4 tile_featureColor) { tile_main(); } -`}function GFe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let l=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+l+e.slice(r),i=o+l.length,o=e.indexOf(n,i)}return e}function oie(e,t,n){if(!c(t))return nie(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!c(o))return nie(e,n);let r=o[0],s=o[2];e=He.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color) +`}function Fit(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function LAe(e,t,n){if(!l(t))return MAe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return MAe(e,n);let o=r[0],s=r[2];e=Xe.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -3341,23 +4516,23 @@ vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; return vec4(diffuse.rgb, sourceDiffuse.a); } -`,l=` tile_featureColor = czm_gammaCorrect(tile_featureColor); +`,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); -`,u;if(s==="vec3"||s==="vec4"){let f=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),u=` vec4 source = ${f}; +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; tile_diffuse = tile_diffuse_final(source, tile_featureColor); tile_main(); -`}else s==="sampler2D"&&(e=GFe(e,t),u=` tile_diffuse = tile_featureColor; +`}else s==="sampler2D"&&(e=Fit(e,t),u=` tile_diffuse = tile_featureColor; tile_main(); `);return e=`uniform float tile_colorBlend; vec4 tile_diffuse = vec4(1.0); -${a}${r} +${a}${o} ${e} void tile_color(vec4 tile_featureColor) { -${u}`,n&&(e+=l),e+=`} -`,e}po.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=oie(i,t,!0),ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +${u}`,n&&(e+=c),e+=`} +`,e}Hr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=LAe(i,t,!0),Ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; in vec2 tile_featureSt; in vec4 tile_featureColor; void main() @@ -3392,115 +4567,30 @@ void main() `),i+=` tile_color(featureProperties); `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; `),i+=`} -`),i}};function jFe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===nu.HIGHLIGHT)return 0;if(n===nu.REPLACE)return 1;if(n===nu.MIX)return O.clamp(i,O.EPSILON4,1);throw new C(`Invalid color blend mode "${n}".`)}po.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return jFe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};po.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ag={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,l=WFe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===De.COMPUTE)continue;let h=f.derivedCommands.tileset;(!c(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=qFe(f),f.dirty=!1);let p=h.originalCommand;l!==ag.ALL_OPAQUE&&f.pass!==De.TRANSLUCENT&&(c(h.translucent)||(h.translucent=YFe(p))),l!==ag.ALL_TRANSLUCENT&&f.pass!==De.TRANSLUCENT&&(c(h.opaque)||(h.opaque=XFe(p)),a&&(r||(c(h.zback)||(h.zback=$Fe(e.context,p)),s._backfaceCommands.push(h.zback)),(!c(h.stencil)||o._selectionDepth!==QFe(h.stencil))&&(f.renderState.depthMask?h.stencil=ZFe(p,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,m=h.translucent;f.pass!==De.TRANSLUCENT?(l===ag.ALL_OPAQUE&&(n[u]=g),l===ag.ALL_TRANSLUCENT&&(n[u]=m),l===ag.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function WFe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?ag.ALL_OPAQUE:t===e.featuresLength?ag.ALL_TRANSLUCENT:ag.OPAQUE_AND_TRANSLUCENT}function qFe(e){let t=Je.shallowClone(e),n=t.pass===De.TRANSLUCENT;return t.uniformMap=c(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function YFe(e){let t=Je.shallowClone(e);return t.pass=De.TRANSLUCENT,t.renderState=JFe(e.renderState),t}function XFe(e){let t=Je.shallowClone(e);return t.renderState=e2e(e.renderState),t}function KFe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!c(n)){let i=t.fragmentShaderSource.clone();i.defines=c(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 $Fe(e,t){let n=Je.shallowClone(t),i=We(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=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK,n.renderState=ze.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=We(t.uniformMap);let o=new z(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=KFe(e,t.shaderProgram),n}function ZFe(e,t){let n=Je.shallowClone(e),i=We(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=kt.SKIP_LOD_MASK,i.stencilTest.reference=kt.CESIUM_3D_TILE_MASK|t<<kt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ft.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ft.REPLACE,i.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,n.renderState=ze.fromCache(i),n}function QFe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function JFe(e){let t=We(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function e2e(e){let t=We(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,ze.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(),de(this)};var cg=po;function t2e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Cp=t2e;var tv=`in vec3 position; +`),i}};function Bit(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===yf.HIGHLIGHT)return 0;if(n===yf.REPLACE)return 1;if(n===yf.MIX)return P.clamp(i,P.EPSILON4,1)}Hr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Mt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return Bit(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Hr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var By={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Hr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=kit(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=Uit(f),f.dirty=!1);let p=d.originalCommand;c!==By.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=zit(p))),c!==By.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=Vit(p)),a&&(o||(l(d.zback)||(d.zback=Hit(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Wit(d.stencil))&&(f.renderState.depthMask?d.stencil=Git(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===By.ALL_OPAQUE&&(n[u]=g),c===By.ALL_TRANSLUCENT&&(n[u]=m),c===By.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function kit(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?By.ALL_OPAQUE:t===e.featuresLength?By.ALL_TRANSLUCENT:By.OPAQUE_AND_TRANSLUCENT}function Uit(e){let t=at.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function zit(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=qit(e.renderState),t}function Vit(e){let t=at.shallowClone(e);return t.renderState=Yit(e.renderState),t}function jit(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 Hit(e,t){let n=at.shallowClone(t),i=Ze(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Gi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK,n.renderState=Ge.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ze(t.uniformMap);let r=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=jit(e,t.shaderProgram),n}function Git(e,t){let n=at.shallowClone(e),i=Ze(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Xt.SKIP_LOD_MASK,i.stencilTest.reference=Xt.CESIUM_3D_TILE_MASK|t<<Xt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ni.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ni.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Rt.REPLACE,i.stencilMask=Xt.CESIUM_3D_TILE_MASK|Xt.SKIP_LOD_MASK,n.renderState=Ge.fromCache(i),n}function Wit(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function qit(e){let t=Ze(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=rn.ALPHA_BLEND,t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function Yit(e){let t=Ze(e,!0);return t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Hr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var wp=Hr;function Xit(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var pg=Xit;var f1=`in vec3 position; in float a_batchId; uniform mat4 u_modifiedModelViewProjection; void main() { gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -`;function hf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(hf.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 c(this._color)||(this._color=new G),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(c(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)}}});hf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};hf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};hf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};hf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(c(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(c(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(c(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(c(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),c(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let l=c(e.group)?e.group.metadata:void 0;if(c(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}let u=e.tileset.metadata;if(c(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};hf.prototype.getPropertyInherited=function(e){return hf.getPropertyInherited(this._content,this._batchId,e)};hf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};hf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};hf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};hf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ta=hf;var Tj=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)})}},Aj=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)})}},Al=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,l,u;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)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(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 "+u),o.push(r,t)}for(l=o.length-1,t=o[l];l>1;)t={type:e.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=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)}}},n2e=new Tj;Object.assign(Al,{hooks:n2e,plugins:new Aj(Al),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"});Al.max_unop_len=Al.getMaxKeyLen(Al.unary_ops);Al.max_binop_len=Al.getMaxKeyLen(Al.binary_ops);var lg=e=>new Al(e).parse(),i2e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Al).filter(e=>!i2e.includes(e)&&lg[e]===void 0).forEach(e=>{lg[e]=Al[e]});lg.Jsep=Al;var o2e="ConditionalExpression",r2e={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:o2e,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 :")}})}};lg.plugins.register(r2e);var s2e={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},_t=Object.freeze(s2e);function yd(e,t){T.typeOf.string("expression",e),this._expression=e,e=b2e(e,t),e=T2e(x2e(e)),lg.addBinaryOp("=~",0),lg.addBinaryOp("!~",0);let n;try{n=lg(e)}catch(i){throw new ae(i)}this._runtimeAst=Ai(this,n)}Object.defineProperties(yd.prototype,{expression:{get:function(){return this._expression}}});var On={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new z],cartesian3Array:[new d],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 z),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};yd.prototype.evaluate=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return t instanceof G&&n instanceof se?G.fromCartesian4(n,t):n instanceof z||n instanceof d||n instanceof se?n.clone(t):n};yd.prototype.evaluateColor=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return G.fromCartesian4(n,t)};yd.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +`;var SZ=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},pa=SZ;var wZ=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][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)})}},IZ=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)})}},Ru=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,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);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,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=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 o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):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++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){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+=o}else t+=o}return r||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,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==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)}}},Kit=new wZ;Object.assign(Ru,{hooks:Kit,plugins:new IZ(Ru),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"});Ru.max_unop_len=Ru.getMaxKeyLen(Ru.unary_ops);Ru.max_binop_len=Ru.getMaxKeyLen(Ru.binary_ops);var ky=e=>new Ru(e).parse(),$it=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Ru).filter(e=>!$it.includes(e)&&ky[e]===void 0).forEach(e=>{ky[e]=Ru[e]});ky.Jsep=Ru;var Jit="ConditionalExpression",Zit={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,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:Jit,test:i,consequent:r,alternate:o},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 :")}})}};ky.plugins.register(Zit);var FAe={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};Object.freeze(FAe);var Nt=FAe;function Bh(e,t){this._expression=e,e=frt(e,t),e=hrt(drt(e)),ky.addBinaryOp("=~",0),ky.addBinaryOp("!~",0);let n;try{n=ky(e)}catch(i){throw new oe(i)}this._runtimeAst=Yi(this,n)}Object.defineProperties(Bh.prototype,{expression:{get:function(){return this._expression}}});var Bn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new h],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 U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Bh.prototype.evaluate=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof U||n instanceof h||n instanceof se?n.clone(t):n};Bh.prototype.evaluateColor=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Bh.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} { - return ${o}; + return ${r}; } -`,o};yd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};yd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var a2e=["!","-","+"],rie=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],nv=/\${(.*?)}/g,c2e=/\\/g,l2e="@#%",u2e=/@#%/g,gN=new G,yN={abs:Fs(Math.abs),sqrt:Fs(Math.sqrt),cos:Fs(Math.cos),sin:Fs(Math.sin),tan:Fs(Math.tan),acos:Fs(Math.acos),asin:Fs(Math.asin),atan:Fs(Math.atan),radians:Fs(O.toRadians),degrees:Fs(O.toDegrees),sign:Fs(O.sign),floor:Fs(Math.floor),ceil:Fs(Math.ceil),round:Fs(Math.round),exp:Fs(Math.exp),exp2:Fs(d2e),log:Fs(Math.log),log2:Fs(h2e),fract:Fs(f2e),length:m2e,normalize:p2e},bN={atan2:pN(Math.atan2,!1),pow:pN(Math.pow,!1),min:pN(Math.min,!0),max:pN(Math.max,!0),distance:_2e,dot:g2e,cross:y2e},Sj={clamp:sie(O.clamp,!0),mix:sie(O.lerp,!0)};function f2e(e){return e-Math.floor(e)}function d2e(e){return Math.pow(2,e)}function h2e(e){return O.log2(e)}function Fs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof z)return z.fromElements(e(n.x),e(n.y),On.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),On.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),On.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function pN(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof z)return z.fromElements(e(i.x,o),e(i.y,o),On.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),On.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x),e(i.y,o.y),On.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),On.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),On.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function sie(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 z&&o instanceof z)return z.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),On.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),On.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),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof z&&o instanceof z&&r instanceof z)return z.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),On.getCartesian2());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),e(i.z,o.z,r.z),On.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),On.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function m2e(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof z)return z.magnitude(t);if(t instanceof d)return d.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 p2e(e,t){if(typeof t=="number")return 1;if(t instanceof z)return z.normalize(t,On.getCartesian2());if(t instanceof d)return d.normalize(t,On.getCartesian3());if(t instanceof se)return se.normalize(t,On.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function _2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof z&&n instanceof z)return z.distance(t,n);if(t instanceof d&&n instanceof d)return d.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 g2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof z&&n instanceof z)return z.dot(t,n);if(t instanceof d&&n instanceof d)return d.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 y2e(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,On.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Tt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,O2e(this)}function b2e(e,t){if(!c(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;c(o)&&(e=e.replace(i,o))}return e}function x2e(e){return e.replace(c2e,l2e)}function Ej(e){return e.replace(u2e,"\\")}function T2e(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 A2e(e){let t=typeof e.value;if(e.value===null)return new Tt(_t.LITERAL_NULL,null);if(t==="boolean")return new Tt(_t.LITERAL_BOOLEAN,e.value);if(t==="number")return new Tt(_t.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Tt(_t.VARIABLE_IN_STRING,e.value):new Tt(_t.LITERAL_STRING,Ej(e.value))}function C2e(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let l=t.callee.object;if(o==="test"||o==="exec"){if(!c(l.callee)||l.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Tt(_t.LITERAL_BOOLEAN,!1):new Tt(_t.LITERAL_NULL,null):(s=Ai(e,l),a=Ai(e,n[0]),new Tt(_t.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ai(e,l),new Tt(_t.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Tt(_t.LITERAL_COLOR,o);if(r=Ai(e,n[0]),c(n[1])){let l=Ai(e,n[1]);return new Tt(_t.LITERAL_COLOR,o,[r,l])}return new Tt(_t.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[Ai(e,n[0]),Ai(e,n[1]),Ai(e,n[2])],new Tt(_t.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[Ai(e,n[0]),Ai(e,n[1]),Ai(e,n[2]),Ai(e,n[3])],new Tt(_t.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let l=0;l<i;++l)r[l]=Ai(e,n[l]);return new Tt(_t.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Tt(_t.LITERAL_BOOLEAN,!0):new Tt(_t.LITERAL_BOOLEAN,!1):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ae(`${o} requires exactly one argument.`);return r=Ai(e,n[0]),new Tt(_t.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Tt(_t.UNARY,o)}else if(c(yN[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=Ai(e,n[0]),new Tt(_t.UNARY,o,r)}else if(c(bN[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=Ai(e,n[0]),a=Ai(e,n[1]),new Tt(_t.BINARY,o,s,a)}else if(c(Sj[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=Ai(e,n[0]),a=Ai(e,n[1]);let l=Ai(e,n[2]);return new Tt(_t.TERNARY,o,s,a,l)}else{if(o==="Boolean")return i===0?new Tt(_t.LITERAL_BOOLEAN,!1):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="Number")return i===0?new Tt(_t.LITERAL_NUMBER,0):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="String")return i===0?new Tt(_t.LITERAL_STRING,""):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="regExp")return E2e(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function E2e(e,t){let n=t.arguments;if(n.length===0)return new Tt(_t.LITERAL_REGEX,new RegExp);let i=Ai(e,n[0]),o;if(n.length>1){let r=Ai(e,n[1]);if(Cj(i)&&Cj(r)){try{o=new RegExp(Ej(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Tt(_t.LITERAL_REGEX,o)}return new Tt(_t.REGEX,i,r)}if(Cj(i)){try{o=new RegExp(Ej(String(i._value)))}catch(r){throw new ae(r)}return new Tt(_t.LITERAL_REGEX,o)}return new Tt(_t.REGEX,i)}function S2e(e){if(P2e(e.name)){let t=I2e(e.name);return t.substr(0,8)==="tiles3d_"?new Tt(_t.BUILTIN_VARIABLE,t):new Tt(_t.VARIABLE,t)}else{if(e.name==="NaN")return new Tt(_t.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Tt(_t.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Tt(_t.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function w2e(e){let t=e.property.name;if(t==="PI")return new Tt(_t.LITERAL_NUMBER,Math.PI);if(t==="E")return new Tt(_t.LITERAL_NUMBER,Math.E)}function v2e(e){if(e.property.name==="POSITIVE_INFINITY")return new Tt(_t.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function D2e(e,t){if(t.object.name==="Math")return w2e(t);if(t.object.name==="Number")return v2e(t);let n,i=Ai(e,t.object);return t.computed?(n=Ai(e,t.property),new Tt(_t.MEMBER,"brackets",i,n)):(n=new Tt(_t.LITERAL_STRING,t.property.name),new Tt(_t.MEMBER,"dot",i,n))}function Cj(e){return e._type>=_t.LITERAL_NULL}function P2e(e){return e.substr(0,4)==="czm_"}function I2e(e){return e.substr(4)}function Ai(e,t){let n,i,o,r;if(t.type==="Literal")n=A2e(t);else if(t.type==="CallExpression")n=C2e(e,t);else if(t.type==="Identifier")n=S2e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ai(e,t.argument);if(a2e.indexOf(i)>-1)n=new Tt(_t.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ai(e,t.left),r=Ai(e,t.right),rie.indexOf(i)>-1)n=new Tt(_t.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ai(e,t.left),r=Ai(e,t.right),rie.indexOf(i)>-1&&(n=new Tt(_t.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ai(e,t.test);o=Ai(e,t.consequent),r=Ai(e,t.alternate),n=new Tt(_t.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=D2e(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ai(e,t.elements[a]);n=new Tt(_t.ARRAY,s)}else throw t.type==="Compound"?new ae("Provide exactly one expression."):new ae("Cannot parse expression.");return n}function O2e(e){e._type===_t.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===_t.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===_t.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:c(yN[e._value])&&(e.evaluate=M2e(e._value)):e._type===_t.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:c(bN[e._value])&&(e.evaluate=L2e(e._value)):e._type===_t.TERNARY?e.evaluate=N2e(e._value):e._type===_t.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===_t.ARRAY?e.evaluate=e._evaluateArray:e._type===_t.VARIABLE?e.evaluate=e._evaluateVariable:e._type===_t.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===_t.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===_t.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===_t.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===_t.REGEX?e.evaluate=e._evaluateRegExp:e._type===_t.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=R2e):e.evaluate=e._evaluateLiteral}function R2e(e){return c(e)?e.content.tileset.timeSinceLoad:0}function M2e(e){let t=yN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function L2e(e){let t=bN[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function N2e(e){let t=Sj[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 xN(e,t){if(c(e))return e.getPropertyInherited(t)}Tt.prototype._evaluateLiteral=function(){return this._value};Tt.prototype._evaluateLiteralColor=function(e){let t=gN,n=this._left;if(this._value==="color")c(n)?n.length>1?(G.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):G.fromCssColorString(n[0].evaluate(e),t):G.fromBytes(255,255,255,255,t);else if(this._value==="rgb")G.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;G.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,On.getCartesian4())};Tt.prototype._evaluateLiteralVector=function(e){let t=On.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let l=i[a].evaluate(e);if(typeof l=="number")t.push(l);else if(l instanceof z)t.push(l.x,l.y);else if(l instanceof d)t.push(l.x,l.y,l.z);else if(l instanceof se)t.push(l.x,l.y,l.z,l.w);else throw new ae(`${n} argument must be a vector or number. Argument is ${l}.`)}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 z.fromArray(t,0,On.getCartesian2());if(n==="vec3")return d.fromArray(t,0,On.getCartesian3());if(n==="vec4")return se.fromArray(t,0,On.getCartesian4())};Tt.prototype._evaluateLiteralString=function(){return this._value};Tt.prototype._evaluateVariableString=function(e){let t=this._value,n=nv.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=xN(e,o);c(r)||(r=""),t=t.replace(i,r),nv.lastIndex+=r.length-i.length,n=nv.exec(t)}return t};Tt.prototype._evaluateVariable=function(e){return xN(e,this._value)};function ob(e){return e._value==="feature"}Tt.prototype._evaluateMemberDot=function(e){if(ob(this._left))return xN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof d||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]};Tt.prototype._evaluateMemberBrackets=function(e){if(ob(this._left))return xN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof d||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]};Tt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Tt.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};Tt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof z)return z.negate(t,On.getCartesian2());if(t instanceof d)return d.negate(t,On.getCartesian3());if(t instanceof se)return se.negate(t,On.getCartesian4());if(typeof t=="number")return-t;throw new ae(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Tt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof z||t instanceof d||t instanceof se||typeof t=="number"))throw new ae(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Tt.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};Tt.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};Tt.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};Tt.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};Tt.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};Tt.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};Tt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.add(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,On.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}.`)};Tt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.subtract(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,On.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}.`)};Tt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.multiplyComponents(t,n,On.getCartesian2());if(n instanceof z&&typeof t=="number")return z.multiplyByScalar(n,t,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.multiplyByScalar(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,On.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,On.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,On.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,On.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,On.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}.`)};Tt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.divideComponents(t,n,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.divideByScalar(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,On.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,On.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,On.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}.`)};Tt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.fromElements(t.x%n.x,t.y%n.y,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,On.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,On.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}.`)};Tt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?t.equals(n):t===n};Tt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Tt.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)};Tt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Tt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Tt.prototype._evaluateIsExactClass=function(e){return c(e)?e.isExactClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateIsClass=function(e){return c(e)?e.isClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateGetExactClassName=function(e){if(c(e))return e.getExactClassName()};Tt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Tt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Tt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Tt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";c(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Tt.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)};Tt.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}.`)};Tt.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}.`)};Tt.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 c(i)?i[1]:null};Tt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof z||t instanceof d||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function aie(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==_t.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return G.fromHsl(i,o,r,s,gN)}function cie(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==_t.LITERAL_NUMBER)return;let i=gN;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 ug(e){return e%1===0?e.toFixed(1):e.toString()}function F2e(e){let t=ug(e.red),n=ug(e.green),i=ug(e.blue);return`vec3(${t}, ${n}, ${i})`}function _N(e){let t=ug(e.red),n=ug(e.green),i=ug(e.blue),o=ug(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function lie(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 uie(e,t){return c(t[e])?t[e]:yd.NULL_SENTINEL}yd.NULL_SENTINEL="czm_infinity";Tt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,l=this._value;c(this._left)&&(Array.isArray(this._left)?o=lie(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),c(this._right)&&(r=this._right.getShaderExpression(e,t,this)),c(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=lie(this._value,e,t,this));let u,f,h;switch(a){case _t.VARIABLE:return ob(this)?void 0:uie(l,e);case _t.UNARY:if(l==="Boolean")return`bool(${o})`;if(l==="Number")return`float(${o})`;if(l==="round")return`floor(${o} + 0.5)`;if(c(yN[l]))return`${l}(${o})`;if(l==="isNaN")return`(${o} != ${o})`;if(l==="isFinite")return`(abs(${o}) < czm_infinity)`;if(l==="String"||l==="isExactClass"||l==="isClass"||l==="getExactClassName")throw new ae(`Error generating style shader: "${l}" is not supported.`);return l+o;case _t.BINARY:return l==="%"?`mod(${o}, ${r})`:l==="==="?`(${o} == ${r})`:l==="!=="?`(${o} != ${r})`:l==="atan2"?`atan(${o}, ${r})`:c(bN[l])?`${l}(${o}, ${r})`:`(${o} ${l} ${r})`;case _t.TERNARY:if(c(Sj[l]))return`${l}(${o}, ${r}, ${s})`;break;case _t.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case _t.MEMBER:return ob(this._left)?uie(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 _t.FUNCTION_CALL:throw new ae(`Error generating style shader: "${l}" is not supported.`);case _t.ARRAY:if(l.length===4)return`vec4(${l[0]}, ${l[1]}, ${l[2]}, ${l[3]})`;if(l.length===3)return`vec3(${l[0]}, ${l[1]}, ${l[2]})`;if(l.length===2)return`vec2(${l[0]}, ${l[1]})`;throw new ae("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case _t.REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case _t.VARIABLE_IN_STRING:throw new ae("Error generating style shader: Converting a variable to a string is not supported.");case _t.LITERAL_NULL:return yd.NULL_SENTINEL;case _t.LITERAL_BOOLEAN:return l?"true":"false";case _t.LITERAL_NUMBER:return ug(l);case _t.LITERAL_STRING:if(c(n)&&n._type===_t.MEMBER&&(l==="r"||l==="g"||l==="b"||l==="a"||l==="x"||l==="y"||l==="z"||l==="w"||ob(n._left)))return l;if(i=G.fromCssColorString(l,gN),c(i))return F2e(i);throw new ae("Error generating style shader: String literals are not supported.");case _t.LITERAL_COLOR:if(u=o,l==="color"){if(c(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(l==="rgb")return i=cie(this),c(i)?_N(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(l==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=cie(this),c(i)?_N(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(l==="hsl")return i=aie(this),c(i)?_N(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(l==="hsla")return i=aie(this),c(i)?(i.alpha!==1&&(t.translucent=!0),_N(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case _t.LITERAL_VECTOR:if(!c(o))throw new C("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");f=o.length,h=`${l}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case _t.LITERAL_REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case _t.LITERAL_UNDEFINED:return yd.NULL_SENTINEL;case _t.BUILTIN_VARIABLE:if(l==="tiles3d_tileset_time")return l}};Tt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(c(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(c(this._right)&&this._right.getVariables(e,this),c(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 _t.VARIABLE:ob(this)||e.push(s);break;case _t.VARIABLE_IN_STRING:for(a=nv.exec(s);a!==null;)e.push(a[1]),a=nv.exec(s);break;case _t.LITERAL_STRING:c(t)&&t._type===_t.MEMBER&&ob(t._left)&&e.push(s);break}};var bd=yd;function Ep(e){e=e??W.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=e.center??d.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=G.clone(G.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=e.classificationType??Un.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(Ep.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var B2e={position:0,a_batchId:1};function k2e(e,t){if(c(e._va))return;let n=bt.createVertexBuffer({context:t,typedArray:e._positions,usage:Be.STATIC_DRAW}),i=bt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Be.STATIC_DRAW}),o=bt.createIndexBuffer({context:t,typedArray:e._indices,usage:Be.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:$.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:$.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:bt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Be.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function U2e(e,t){if(c(e._sp))return;let n=e._batchTable,i=e._attributeLocations??B2e,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(c(r)){e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=He.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +`,r};Bh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Bh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Qit=["!","-","+"],BAe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],d1=/\${(.*?)}/g,ert=/\\/g,trt="@#%",nrt=/@#%/g,qU=new z,YU={abs:Na(Math.abs),sqrt:Na(Math.sqrt),cos:Na(Math.cos),sin:Na(Math.sin),tan:Na(Math.tan),acos:Na(Math.acos),asin:Na(Math.asin),atan:Na(Math.atan),radians:Na(P.toRadians),degrees:Na(P.toDegrees),sign:Na(P.sign),floor:Na(Math.floor),ceil:Na(Math.ceil),round:Na(Math.round),exp:Na(Math.exp),exp2:Na(rrt),log:Na(Math.log),log2:Na(ort),fract:Na(irt),length:srt,normalize:art},XU={atan2:GU(Math.atan2,!1),pow:GU(Math.pow,!1),min:GU(Math.min,!0),max:GU(Math.max,!0),distance:crt,dot:lrt,cross:urt},RZ={clamp:kAe(P.clamp,!0),mix:kAe(P.lerp,!0)};function irt(e){return e-Math.floor(e)}function rrt(e){return Math.pow(2,e)}function ort(e){return P.log2(e)}function Na(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Bn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Bn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Bn.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function GU(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof U)return U.fromElements(e(i.x,r),e(i.y,r),Bn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Bn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Bn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x),e(i.y,r.y),Bn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Bn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Bn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function kAe(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Bn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Bn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Bn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof U&&r instanceof U&&o instanceof U)return U.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Bn.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Bn.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Bn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function srt(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function art(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Bn.getCartesian2());if(t instanceof h)return h.normalize(t,Bn.getCartesian3());if(t instanceof se)return se.normalize(t,Bn.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function crt(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function lrt(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function urt(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Bn.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Ft(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,Ert(this)}function frt(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function drt(e){return e.replace(ert,trt)}function DZ(e){return e.replace(nrt,"\\")}function hrt(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;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 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{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function mrt(e){let t=typeof e.value;if(e.value===null)return new Ft(Nt.LITERAL_NULL,null);if(t==="boolean")return new Ft(Nt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Ft(Nt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Ft(Nt.VARIABLE_IN_STRING,e.value):new Ft(Nt.LITERAL_STRING,DZ(e.value))}function prt(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Ft(Nt.LITERAL_BOOLEAN,!1):new Ft(Nt.LITERAL_NULL,null):(s=Yi(e,c),a=Yi(e,n[0]),new Ft(Nt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Yi(e,c),new Ft(Nt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Ft(Nt.LITERAL_COLOR,r);if(o=Yi(e,n[0]),l(n[1])){let c=Yi(e,n[1]);return new Ft(Nt.LITERAL_COLOR,r,[o,c])}return new Ft(Nt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Yi(e,n[0]),Yi(e,n[1]),Yi(e,n[2])],new Ft(Nt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Yi(e,n[0]),Yi(e,n[1]),Yi(e,n[2]),Yi(e,n[3])],new Ft(Nt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Yi(e,n[c]);return new Ft(Nt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Ft(Nt.LITERAL_BOOLEAN,!0):new Ft(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Ft(Nt.UNARY,r)}else if(l(YU[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o)}else if(l(XU[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Yi(e,n[0]),a=Yi(e,n[1]),new Ft(Nt.BINARY,r,s,a)}else if(l(RZ[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=Yi(e,n[0]),a=Yi(e,n[1]);let c=Yi(e,n[2]);return new Ft(Nt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Ft(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="Number")return i===0?new Ft(Nt.LITERAL_NUMBER,0):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="String")return i===0?new Ft(Nt.LITERAL_STRING,""):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="regExp")return grt(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function grt(e,t){let n=t.arguments;if(n.length===0)return new Ft(Nt.LITERAL_REGEX,new RegExp);let i=Yi(e,n[0]),r;if(n.length>1){let o=Yi(e,n[1]);if(PZ(i)&&PZ(o)){try{r=new RegExp(DZ(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Ft(Nt.LITERAL_REGEX,r)}return new Ft(Nt.REGEX,i,o)}if(PZ(i)){try{r=new RegExp(DZ(String(i._value)))}catch(o){throw new oe(o)}return new Ft(Nt.LITERAL_REGEX,r)}return new Ft(Nt.REGEX,i)}function _rt(e){if(xrt(e.name)){let t=Trt(e.name);return t.substr(0,8)==="tiles3d_"?new Ft(Nt.BUILTIN_VARIABLE,t):new Ft(Nt.VARIABLE,t)}else{if(e.name==="NaN")return new Ft(Nt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Ft(Nt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Ft(Nt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function yrt(e){let t=e.property.name;if(t==="PI")return new Ft(Nt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Ft(Nt.LITERAL_NUMBER,Math.E)}function Art(e){if(e.property.name==="POSITIVE_INFINITY")return new Ft(Nt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function brt(e,t){if(t.object.name==="Math")return yrt(t);if(t.object.name==="Number")return Art(t);let n,i=Yi(e,t.object);return t.computed?(n=Yi(e,t.property),new Ft(Nt.MEMBER,"brackets",i,n)):(n=new Ft(Nt.LITERAL_STRING,t.property.name),new Ft(Nt.MEMBER,"dot",i,n))}function PZ(e){return e._type>=Nt.LITERAL_NULL}function xrt(e){return e.substr(0,4)==="czm_"}function Trt(e){return e.substr(4)}function Yi(e,t){let n,i,r,o;if(t.type==="Literal")n=mrt(t);else if(t.type==="CallExpression")n=prt(e,t);else if(t.type==="Identifier")n=_rt(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Yi(e,t.argument);if(Qit.indexOf(i)>-1)n=new Ft(Nt.UNARY,i,s);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Yi(e,t.left),o=Yi(e,t.right),BAe.indexOf(i)>-1)n=new Ft(Nt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Yi(e,t.left),o=Yi(e,t.right),BAe.indexOf(i)>-1&&(n=new Ft(Nt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Yi(e,t.test);r=Yi(e,t.consequent),o=Yi(e,t.alternate),n=new Ft(Nt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=brt(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Yi(e,t.elements[a]);n=new Ft(Nt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function Ert(e){e._type===Nt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Nt.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===Nt.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(YU[e._value])&&(e.evaluate=vrt(e._value)):e._type===Nt.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(XU[e._value])&&(e.evaluate=Srt(e._value)):e._type===Nt.TERNARY?e.evaluate=wrt(e._value):e._type===Nt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Nt.ARRAY?e.evaluate=e._evaluateArray:e._type===Nt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Nt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Nt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Nt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Nt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Nt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Nt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Crt):e.evaluate=e._evaluateLiteral}function Crt(e){return l(e)?e.content.tileset.timeSinceLoad:0}function vrt(e){let t=YU[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Srt(e){let t=XU[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function wrt(e){let t=RZ[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function KU(e,t){if(l(e))return e.getPropertyInherited(t)}Ft.prototype._evaluateLiteral=function(){return this._value};Ft.prototype._evaluateLiteralColor=function(e){let t=qU,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.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;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Bn.getCartesian4())};Ft.prototype._evaluateLiteralVector=function(e){let t=Bn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof h)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 oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Bn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Bn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Bn.getCartesian4())};Ft.prototype._evaluateLiteralString=function(){return this._value};Ft.prototype._evaluateVariableString=function(e){let t=this._value,n=d1.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=KU(e,r);l(o)||(o=""),t=t.replace(i,o),d1.lastIndex+=o.length-i.length,n=d1.exec(t)}return t};Ft.prototype._evaluateVariable=function(e){return KU(e,this._value)};function Cx(e){return e._value==="feature"}Ft.prototype._evaluateMemberDot=function(e){if(Cx(this._left))return KU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||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]};Ft.prototype._evaluateMemberBrackets=function(e){if(Cx(this._left))return KU(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||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]};Ft.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Ft.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Ft.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Bn.getCartesian2());if(t instanceof h)return h.negate(t,Bn.getCartesian3());if(t instanceof se)return se.negate(t,Bn.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Ft.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof h||t instanceof se||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Ft.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Ft.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Ft.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Ft.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Ft.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Ft.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Ft.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Bn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Bn.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Bn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Bn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Bn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Bn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Bn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Bn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Bn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Bn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Bn.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,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Ft.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Ft.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Ft.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Ft.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Ft.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Ft.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Ft.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Ft.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Ft.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Ft.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Ft.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(r){throw new oe(r)}return i};Ft.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`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)};Ft.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 oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ft.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 oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`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};Ft.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof h||t instanceof se)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function UAe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Nt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,qU)}function zAe(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Nt.LITERAL_NUMBER)return;let i=qU;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 Uy(e){return e%1===0?e.toFixed(1):e.toString()}function Irt(e){let t=Uy(e.red),n=Uy(e.green),i=Uy(e.blue);return`vec3(${t}, ${n}, ${i})`}function WU(e){let t=Uy(e.red),n=Uy(e.green),i=Uy(e.blue),r=Uy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function VAe(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function jAe(e,t){return l(t[e])?t[e]:Bh.NULL_SENTINEL}Bh.NULL_SENTINEL="czm_infinity";Ft.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=VAe(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=VAe(this._value,e,t,this));let u,f,d;switch(a){case Nt.VARIABLE:return Cx(this)?void 0:jAe(c,e);case Nt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(YU[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Nt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(XU[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Nt.TERNARY:if(l(RZ[c]))return`${c}(${r}, ${o}, ${s})`;break;case Nt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Nt.MEMBER:return Cx(this._left)?jAe(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Nt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Nt.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 oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Nt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Nt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Nt.LITERAL_NULL:return Bh.NULL_SENTINEL;case Nt.LITERAL_BOOLEAN:return c?"true":"false";case Nt.LITERAL_NUMBER:return Uy(c);case Nt.LITERAL_STRING:if(l(n)&&n._type===Nt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Cx(n._left)))return c;if(i=z.fromCssColorString(c,qU),l(i))return Irt(i);throw new oe("Error generating style shader: String literals are not supported.");case Nt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=zAe(this),l(i)?WU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=zAe(this),l(i)?WU(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=UAe(this),l(i)?WU(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=UAe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),WU(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Nt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Nt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Nt.LITERAL_UNDEFINED:return Bh.NULL_SENTINEL;case Nt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Ft.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].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,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case Nt.VARIABLE:Cx(this)||e.push(s);break;case Nt.VARIABLE_IN_STRING:for(a=d1.exec(s);a!==null;)e.push(a[1]),a=d1.exec(s);break;case Nt.LITERAL_STRING:l(t)&&t._type===Nt.MEMBER&&Cx(t._left)&&e.push(s);break}};var kh=Bh;function gg(e){e=e??H.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=e.center??h.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=z.clone(z.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=e.classificationType??ti.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(gg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Prt={position:0,a_batchId:1};function Drt(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new Vn({context:t,attributes:o,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Rrt(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??Prt,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Xe.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() { czm_non_pick_main(); - out_FragColor = ${o}; + out_FragColor = ${r}; } -`,e._spPick=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(tv),l=n.getFragmentShaderCallback(!1,void 0,!0)(Y0);o=n.getPickId();let u=new He({sources:[a]}),f=new He({defines:["VECTOR_TILE"],sources:[l]});e._sp=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new He({sources:[tv]}),f=new He({defines:["VECTOR_TILE"],sources:[Y0]}),e._spStencil=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),l=He.replaceMain(l,"czm_non_pick_main"),l=`${l} +`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(f1),c=n.getFragmentShaderCallback(!1,void 0,!0)(px);r=n.getPickId();let u=new Xe({sources:[a]}),f=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Xe({sources:[f1]}),f=new Xe({defines:["VECTOR_TILE"],sources:[px]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Xe.replaceMain(c,"czm_non_pick_main"),c=`${c} void main() { czm_non_pick_main(); - out_FragColor = ${o}; + out_FragColor = ${r}; } -`;let h=new He({sources:[a]}),p=new He({defines:["VECTOR_TILE"],sources:[l]});e._spPick=en.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function fie(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:t,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},depthMask:!1}}var V2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},z2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function H2e(e){c(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(fie(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(fie(!0)),e._rsColorPass=ze.fromCache(V2e),e._rsPickPass=ze.fromCache(z2e))}var rb=new F,die=new d;function G2e(e,t){if(c(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,rb),F.multiplyByPoint(rb,e._center,die),F.setTranslation(rb,die,rb),F.multiply(o,rb,rb),rb},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function wj(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,l=r.length;for(let u=0;u<l;++u){let f=r[u],h=s[f],p=i[h],g=o[h],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[h]=n,n+=g}return n}function j2e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),l=[a],u=wj(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(G.equals(f.color,a.color))u=wj(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=wj(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,l.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=l}function vj(e,t,n,i,o,r,s){let a=e.bytesPerIndex,l=r.length;for(let u=0;u<l;++u){let f=r[u],h=s[f],p=i[h],g=o[h];t.copyFromBuffer(e,p*a,n*a,g*a),i[h]=n,n+=g}return n}function W2e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,l=e._vaSwap.indexBuffer,u=vj(a,l,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(G.equals(h.color,r.color))u=vj(a,l,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=vj(a,l,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function q2e(e,t){return t.color.toRgba()-e.color.toRgba()}function Y2e(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 l=n[s].color.toRgba();if(c(r[l])){o=!0;break}else r[l]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(q2e),t.webgl2?W2e(e,n):j2e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function X2e(e,t){let n=Y2e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(c(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,l=e._sp,u=e._modelMatrix??F.IDENTITY,f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,m=o[p].count,y=i[p*2];c(y)||(y=i[p*2]=new Je({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=l,y.uniformMap=f,y.boundingVolume=h,y.cull=!1,y.pass=De.TERRAIN_CLASSIFICATION;let b=Je.shallowClone(y,y.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=De.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=b;let x=i[p*2+1];c(x)||(x=i[p*2+1]=new Je({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsColorPass,x.shaderProgram=l,x.uniformMap=f,x.boundingVolume=h,x.cull=!1,x.pass=De.TERRAIN_CLASSIFICATION;let A=Je.shallowClone(x,x.derivedCommands.tileset);A.pass=De.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=A}e._commandsDirty=!0}function K2e(e,t){if(e.classificationType===Un.TERRAIN||!t.invertClassification||c(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 l=0;l<s;++l){let u=i[l]=Je.shallowClone(n[a],i[l]);u.shaderProgram=o,u.pass=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function $2e(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=e._modelMatrix??F.IDENTITY,a=e._uniformMap;for(let l=0;l<t;++l){let u=e._indexOffsets[l],f=e._indexCounts[l],h=c(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,p=n[l*2];c(p)||(p=n[l*2]=new Je({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=De.TERRAIN_CLASSIFICATION;let g=Je.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=De.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[l*2+1];c(m)||(m=n[l*2+1]=new Je({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=h,m.pass=De.TERRAIN_CLASSIFICATION;let y=Je.shallowClone(m,m.derivedCommands.tileset);y.pass=De.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}Ep.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 ta(e,r)}};Ep.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Z2e(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=G.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=G.clone(G.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Q2e=new G,J2e=G.WHITE,eBe=!0,tBe=/\$/;Ep.prototype.applyStyle=function(e,t){if(!c(e)){Z2e(this,t);return}let n=e.color,i=n instanceof bd&&!tBe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],l=t[a];l.color=c(e.color)?e.color.evaluateColor(l,Q2e):J2e,l.show=c(e.show)?e.show.evaluate(l):eBe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=G.clone(G.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Ep.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!c(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],l=this._batchedIndices,u=l.length,f;for(f=0;f<u;++f){let y=l[f].offset,b=l[f].count;if(s>=y&&s<y+b)break}l.push(new Cp({color:G.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],g=l[f].batchIds,m=g.length;for(let y=0;y<m;++y){let b=g[y];if(b===e)continue;let x=n[b];o[x]<s?h.push(b):p.push(b)}p.length!==0&&l.push(new Cp({color:G.clone(l[f].color),offset:s+a,count:l[f].offset+l[f].count-(s+a),batchIds:p})),h.length!==0?(l[f].count=s-l[f].offset,l[f].batchIds=h):l.splice(f,1),this._batchDirty=!0};function hie(e,t,n,i){let o=e.classificationType,r=o!==Un.CESIUM_3D_TILE,s=o!==Un.TERRAIN,a=t.commandList,l=n.length,u,f;for(f=0;f<l;++f)r&&(u=n[f],u.pass=De.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=De.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!c(i)))for(l=i.length,f=0;f<l;++f)a.push(i[f])}function nBe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=De.OPAQUE,n.push(r)}}function iBe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;c(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.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}Ep.prototype.update=function(e){let t=e.context;k2e(this,t),U2e(this,t),H2e(this),G2e(this,t);let n=e.passes;n.render&&(X2e(this,t),K2e(this,e),iBe(this),this._debugWireframe?nBe(e,this._commands):hie(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&($2e(this),hie(this,e,this._pickCommands))};Ep.prototype.isDestroyed=function(){return!1};Ep.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(),de(this)};var hA=Ep;function iu(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,c(this._center)||(c(this._boundingVolume)?this._center=d.clone(this._boundingVolume.center):this._center=d.clone(d.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=Un.BOTH}Object.defineProperties(iu.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});iu.packedBoxLength=F.packedLength+d.packedLength;iu.packedCylinderLength=F.packedLength+2;iu.packedEllipsoidLength=F.packedLength+d.packedLength;iu.packedSphereLength=d.packedLength+1;function oBe(e){let t=new Float64Array(F.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,F.pack(e._modelMatrix,t,n),t}function rBe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let l=0;l<o;++l)r[l]=le.unpack(t,n),n+=le.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let l=0;l<s;++l){let u=G.unpack(t,n);n+=G.packedLength;let f=t[n++],h=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[l]=new Cp({color:u,offset:f,count:h,batchIds:g})}return i}var sBe=new bi("createVectorTileGeometries",5),aBe=new G;function cBe(e){if(!c(e._primitive)&&!c(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,l=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!c(u)){let m=0;c(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),c(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),c(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),c(e._spheres)&&(a=e._sphere=a.slice(),l=e._sphereBatchIds=l.slice(),m+=l.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let b=0;b<m;++b){let x=y.getColor(b,aBe);u[b]=x.toRgba()}f=e._packedBuffer=oBe(e)}let h=[];c(t)&&h.push(t.buffer,n.buffer),c(i)&&h.push(i.buffer,o.buffer),c(r)&&h.push(r.buffer,s.buffer),c(a)&&h.push(a.buffer,l.buffer),h.push(u.buffer,f.buffer);let p={boxes:c(t)?t.buffer:void 0,boxBatchIds:c(t)?n.buffer:void 0,cylinders:c(i)?i.buffer:void 0,cylinderBatchIds:c(i)?o.buffer:void 0,ellipsoids:c(r)?r.buffer:void 0,ellipsoidBatchIds:c(r)?s.buffer:void 0,spheres:c(a)?a.buffer:void 0,sphereBatchIds:c(a)?l.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=sBe.scheduleTask(p,h);return c(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);rBe(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),lBe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function lBe(e){c(e._primitive)||(e._primitive=new hA({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: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)}iu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};iu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};iu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};iu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};iu.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=cBe(this)),c(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)};iu.prototype.isDestroyed=function(){return!1};iu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var fg=iu;function qh(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,dBe(this,i,o)}Object.defineProperties(qh.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return c(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return c(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 uBe(e){return function(t,n){c(e._geometries)&&e._geometries.updateCommands(t,n)}}function fBe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,l=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&c(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(l>0&&c(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,l)}if(u>0&&c(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&c(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=c(n)||c(i)||c(o)||c(r),p=a>0&&!c(n)||l>0&&!c(i)||u>0&&!c(o)||f>0&&!c(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)&&!c(r)){let m=0;if(!c(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!c(i)&&l>0)for(i=new Uint16Array(l),s=0;s<l;++s)i[s]=m++;if(!c(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!c(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var sb=Uint32Array.BYTES_PER_ELEMENT;function dBe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=sb;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=sb;let s=o.getUint32(n,!0);if(n+=sb,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=sb,a===0)throw new ae("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=sb;let u=o.getUint32(n,!0);n+=sb;let f=o.getUint32(n,!0);n+=sb;let h=sr(i,n,a);n+=a;let p=new Uint8Array(t,n,l);n+=l;let g,m;u>0&&(g=sr(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=h.BOXES_LENGTH??0,b=h.CYLINDERS_LENGTH??0,x=h.ELLIPSOIDS_LENGTH??0,A=h.SPHERES_LENGTH??0,E=y+b+x+A,S=new cg(e,E,g,m,uBe(e));if(e._batchTable=S,E===0)return;let v=e.tile.computedTransform,P;c(h.RTC_CENTER)&&(P=d.unpack(h.RTC_CENTER),F.multiplyByPoint(v,P,P));let M=fBe(h,p);if(y>0||b>0||x>0||A>0){let R,L,B,_;if(y>0){let w=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,w,fg.packedBoxLength*y)}if(b>0){let w=p.byteOffset+h.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,w,fg.packedCylinderLength*b)}if(x>0){let w=p.byteOffset+h.ELLIPSOIDS.byteOffset;B=new Float32Array(p.buffer,w,fg.packedEllipsoidLength*x)}if(A>0){let w=p.byteOffset+h.SPHERES.byteOffset;_=new Float32Array(p.buffer,w,fg.packedSphereLength*A)}return e._geometries=new fg({boxes:R,boxBatchIds:M.boxes,cylinders:L,cylinderBatchIds:M.cylinders,ellipsoids:B,ellipsoidBatchIds:M.ellipsoids,spheres:_,sphereBatchIds:M.spheres,center:P,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function mie(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}qh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};qh.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new C(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return mie(this),this._features[e]};qh.prototype.applyDebugSettings=function(e,t){c(this._geometries)&&this._geometries.applyDebugSettings(e,t)};qh.prototype.applyStyle=function(e){mie(this),c(this._geometries)&&this._geometries.applyStyle(e,this._features)};qh.prototype.update=function(e,t){c(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),c(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};qh.prototype.pick=function(e,t,n){};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};var TN=qh;var Dj={};Dj.encode2D=function(e,t,n){let i=Math.pow(2,e);if(T.typeOf.number("level",e),T.typeOf.number("x",t),T.typeOf.number("y",n),e<1)throw new C("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new C("Invalid coordinates for given level.");let o={x:t,y:n},r,s,a,l=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,l+=BigInt((3*r^s)*a*a),pie(i,o,r,s);return l};Dj.decode2D=function(e,t){if(T.typeOf.number("level",e),T.typeOf.bigint("index",t),e<1)throw new C("Hilbert level cannot be less than 1.");if(t<BigInt(0)||t>=BigInt(Math.pow(4,e)))throw new C("Hilbert index exceeds valid maximum for given level.");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)),pie(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function pie(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 iv=Dj;var pg=30,hBe=1<<pg,mBe=1<<pg+1>>>0,Pj=2*pg+1,dg=4,yie=[],bie=[],pBe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],hg=1,mA=2,AN=[hg,0,0,hg|mA];function ar(e){if(!zt.supportsBigInt())throw new ae("S2 required BigInt support");if(!c(e))throw new C("cell ID is required.");if(!ar.isValidId(e))throw new C("cell ID is invalid.");this._cellId=e,this._level=ar.getLevel(e)}ar.fromToken=function(e){if(T.typeOf.string("token",e),!ar.isValidToken(e))throw new C("token is invalid.");return new ar(ar.getIdFromToken(e))};ar.isValidId=function(e){return T.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(Pj)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ar.isValidToken=function(e){return T.typeOf.string("token",e),/^[0-9a-fA-F]{1,16}$/.test(e)?ar.isValidId(ar.getIdFromToken(e)):!1};ar.getIdFromToken=function(e){return T.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))};ar.getTokenFromId=function(e){T.typeOf.bigint("cellId",e);let t=Math.floor(SBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ar.getLevel=function(e){if(T.typeOf.bigint("cellId",e),!ar.isValidId(e))throw new C;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return pg-(t>>1)};ar.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>3)throw new C("child index must be in the range [0-3].");if(this._level===30)throw new C("cannot get child of leaf cell.");let t=Aie(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ar(n)};ar.prototype.getParent=function(){if(this._level===0)throw new C("cannot get parent of root cell.");let e=Aie(this._cellId)<<BigInt(2);return new ar(this._cellId&~e+BigInt(1)|e)};ar.prototype.getParentAtLevel=function(e){if(this._level===0||e<0||this._level<e)throw new C("cannot get parent at invalid level.");let t=CBe(e);return new ar(this._cellId&-t|t)};ar.prototype.getCenter=function(e){e=e??ie.WGS84;let t=_Be(this._cellId,this._level);t=d.normalize(t,t);let n=new he.fromCartesian(t,ie.UNIT_SPHERE);return he.toCartesian(n,e,new d)};ar.prototype.getVertex=function(e,t){if(T.typeOf.number("index",e),e<0||e>3)throw new C("vertex index must be in the range [0-3].");t=t??ie.WGS84;let n=gBe(this._cellId,this._level,e);n=d.normalize(n,n);let i=new he.fromCartesian(n,ie.UNIT_SPHERE);return he.toCartesian(i,t,new d)};ar.fromFacePositionLevel=function(e,t,n){if(T.typeOf.bigint("position",t),e<0||e>5)throw new C("Invalid S2 Face (must be within 0-5)");if(n<0||n>pg)throw new C("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new C("Invalid Hilbert position for level");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(Pj-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ar(a)};function _Be(e,t){let n=yBe(e,t);return bBe(n[0],n[1],n[2])}function gBe(e,t,n){let i=xie(e,t),o=xBe([i[1],i[2]],t),r=n>>1&1;return Tie(i[0],o[0][r^n&1],o[1][r])}function yBe(e,t){let n=xie(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),l=s?1:a?2:0,u=(o<<1)+l,f=(r<<1)+l;return[i,u,f]}function xie(e){yie.length===0&&ABe();let t=Number(e>>BigInt(Pj)),n=t&hg,i=(1<<dg)-1,o=0,r=0;for(let s=7;s>=0;s--){let l=(1<<2*(s===7?pg-7*dg:dg))-1;n+=Number(e>>BigInt(s*2*dg+1)&BigInt(l))<<2,n=bie[n];let u=s*dg;o+=n>>dg+2<<u,r+=(n>>2&i)<<u,n&=hg|mA}return[t,o,r]}function bBe(e,t,n){let i=_ie(t),o=_ie(n),r=CN(i),s=CN(o);return Tie(e,r,s)}function Tie(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function CN(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function _ie(e){return 1/mBe*e}function xBe(e,t){let n=[[],[]],i=TBe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=CN(gie(r)),n[o][1]=CN(gie(s))}return n}function TBe(e){return 1<<pg-e>>>0}function gie(e){return 1/hBe*e}function mg(e,t,n,i,o,r){if(e===dg){let s=(t<<dg)+n;yie[(s<<2)+i]=(o<<2)+r,bie[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=pBe[r];mg(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^AN[0]),mg(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^AN[1]),mg(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^AN[2]),mg(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^AN[3])}}function ABe(){mg(0,0,0,0,0,0),mg(0,0,0,hg,0,hg),mg(0,0,0,mA,0,mA),mg(0,0,0,hg|mA,0,hg|mA)}function Aie(e){return e&~e+BigInt(1)}function CBe(e){return BigInt(1)<<BigInt(2*(pg-e))}var EBe=[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 SBe(e){return EBe[(-e&e)%BigInt(67)]}var _g=ar;function wBe(e,t){return c(e)&&c(e.extensions)&&c(e.extensions[t])}var ri=wBe;function Ij(e){let t=e.lengthBits,n=e.availableCount;T.typeOf.number("options.lengthBits",t);let i=e.constant,o=e.bitstream;if(c(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=e.computeAvailableCountEnabled??!1;!c(n)&&s&&(n=vBe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function vBe(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(Ij.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Ij.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new C("Bit index out of bounds.");if(c(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var ov=Ij;function Sp(e){e=e??W.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;T.typeOf.object("options.metadataTable",t),T.typeOf.object("options.class",n),T.typeOf.number("options.entityId",i),T.typeOf.object("options.propertyTableJson",o),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Sp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Sp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Sp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Sp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Sp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Sp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Sp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Sp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var rv=Sp;var EN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};EN.getBranchingFactor=function(e){switch(e){case EN.OCTREE:return 8;case EN.QUADTREE:return 4;default:throw new C("subdivisionScheme is not a valid value.")}};var cr=Object.freeze(EN);function na(){}Object.defineProperties(na.prototype,{class:{get:function(){C.throwInstantiationError()}}});na.prototype.hasProperty=function(e){C.throwInstantiationError()};na.prototype.hasPropertyBySemantic=function(e){C.throwInstantiationError()};na.prototype.getPropertyIds=function(e){C.throwInstantiationError()};na.prototype.getProperty=function(e){C.throwInstantiationError()};na.prototype.setProperty=function(e,t){C.throwInstantiationError()};na.prototype.getPropertyBySemantic=function(e){C.throwInstantiationError()};na.prototype.setPropertyBySemantic=function(e,t){C.throwInstantiationError()};na.hasProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),c(t[e]))return!0;let i=n.properties;if(!c(i))return!1;let o=i[e];return!!(c(o)&&c(o.default))};na.hasPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return!1;let o=i[e];return c(o)};na.getPropertyIds=function(e,t,n){T.typeOf.object("properties",e),T.typeOf.object("classDefinition",t),n=c(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&c(e[o])&&n.push(o);let i=t.properties;if(c(i))for(let o in i)i.hasOwnProperty(o)&&!c(e[o])&&c(i[o].default)&&n.push(o);return n};na.getProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),!c(n.properties[e]))throw new C(`Class definition missing property ${e}`);let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!c(o)&&c(i.default))return o=We(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(c(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};na.setProperty=function(e,t,n,i){if(T.typeOf.string("propertyId",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i),!c(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return c(r)&&(o=r[e]),c(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};na.getPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return;let o=i[e];if(c(o))return na.getProperty(o.id,t,n)};na.setPropertyBySemantic=function(e,t,n,i){T.typeOf.string("semantic",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i);let o=i.propertiesBySemantic;if(!c(o))return!1;let r=i.propertiesBySemantic[e];return c(r)?na.setProperty(r.id,t,n,i):!1};var Bn=na;function wp(e){e=e??W.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class;T.typeOf.object("options.subtreeMetadata",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(wp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});wp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};wp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};wp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};wp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};wp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};wp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};wp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var SN=wp;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(T.typeOf.string("type",e),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 zt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Mt.UINT64:return zt.supportsBigInt()?BigInt(0):0;case Mt.FLOAT32:return-34028234663852886e22;case Mt.FLOAT64:return-Number.MAX_VALUE}};Mt.getMaximum=function(e){switch(T.typeOf.string("type",e),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 zt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Mt.UINT64:return zt.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(T.typeOf.string("type",e),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(T.typeOf.string("type",e),e){case Mt.UINT8:case Mt.UINT16:case Mt.UINT32:case Mt.UINT64:return!0;default:return!1}};Mt.isVectorCompatible=function(e){switch(T.typeOf.string("type",e),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){if(typeof e!="number"&&typeof e!="bigint")throw new C("value must be a number or a BigInt");if(!Mt.isIntegerType(t))throw new C("type must be an integer type");return Math.max(Number(e)/Number(Mt.getMaximum(t)),-1)};Mt.unnormalize=function(e,t){if(T.typeOf.number("value",e),!Mt.isIntegerType(t))throw new C("type must be an integer type");let n=Mt.getMaximum(t),i=Mt.isUnsignedIntegerType(t)?0:-n;return e=O.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Mt.INT64||t===Mt.UINT64)&&zt.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(T.typeOf.string("type",e),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(T.typeOf.number("componentDatatype",e),e){case $.BYTE:return Mt.INT8;case $.UNSIGNED_BYTE:return Mt.UINT8;case $.SHORT:return Mt.INT16;case $.UNSIGNED_SHORT:return Mt.UINT16;case $.INT:return Mt.INT32;case $.UNSIGNED_INT:return Mt.UINT32;case $.FLOAT:return Mt.FLOAT32;case $.DOUBLE:return Mt.FLOAT64}};Mt.toComponentDatatype=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:return $.BYTE;case Mt.UINT8:return $.UNSIGNED_BYTE;case Mt.INT16:return $.SHORT;case Mt.UINT16:return $.UNSIGNED_SHORT;case Mt.INT32:return $.INT;case Mt.UINT32:return $.UNSIGNED_INT;case Mt.FLOAT32:return $.FLOAT;case Mt.FLOAT64:return $.DOUBLE}};var Nt=Object.freeze(Mt);var Bo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Bo.isVectorType=function(e){switch(T.typeOf.string("type",e),e){case Bo.VEC2:case Bo.VEC3:case Bo.VEC4:return!0;default:return!1}};Bo.isMatrixType=function(e){switch(T.typeOf.string("type",e),e){case Bo.MAT2:case Bo.MAT3:case Bo.MAT4:return!0;default:return!1}};Bo.getComponentCount=function(e){switch(T.typeOf.string("type",e),e){case Bo.SCALAR:case Bo.STRING:case Bo.ENUM:case Bo.BOOLEAN:return 1;case Bo.VEC2:return 2;case Bo.VEC3:return 3;case Bo.VEC4:return 4;case Bo.MAT2:return 4;case Bo.MAT3:return 9;case Bo.MAT4:return 16;default:throw new C(`Invalid metadata type ${e}`)}};Bo.getMathType=function(e){switch(e){case Bo.VEC2:return z;case Bo.VEC3:return d;case Bo.VEC4:return se;case Bo.MAT2:return Ri;case Bo.MAT3:return J;case Bo.MAT4:return F;default:return}};var at=Object.freeze(Bo);function Sa(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.type;T.typeOf.string("options.id",t),T.typeOf.string("options.type",n);let i=e.componentType,o=e.enumType,r=c(i)&&Nt.isIntegerType(i)&&(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=c(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=We(e.min,!0),this._max=We(e.max,!0),this._normalized=r;let s=We(e.offset,!0),a=We(e.scale,!0),l=c(s)||c(a),u=!0;c(s)||(s=this.expandConstant(0,u)),c(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=l,this._noData=We(e.noData,!0),this._default=We(e.default,!0),this._required=e.required??!0,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}Sa.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.property;T.typeOf.string("options.id",t),T.typeOf.object("options.property",n),T.typeOf.string("options.property.type",n.type);let i=DBe(n),o=PBe(n,e.enums),r;return c(i)?i?r=c(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Sa({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(Sa.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 DBe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===at.SCALAR||at.isMatrixType(t)||at.isVectorType(t))return!1;if(c(Nt[t]))return!0;if(c(e.noData)||c(e.scale)||c(e.offset)||c(e.required)||c(e.count)||c(e.array)||c(e.optional))return!1}function PBe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!c(s)):e.array?(r=!0,s=e.count,a=!c(e.count)):(r=!1,s=void 0,a=!1);let l;if(c(e.enumType)&&(l=t[e.enumType]),n===at.ENUM)return{type:n,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===at.ENUM)return{type:i,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.SCALAR||at.isMatrixType(n)||at.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.BOOLEAN||n===at.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===at.BOOLEAN||i===at.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(i)&&c(Nt[i]))return{type:at.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(Nt[n]))return{type:at.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s};throw new C(`unknown metadata type {type: ${n}, componentType: ${i})`)}Sa.prototype.normalize=function(e){return this._normalized?Oj(e,this._valueType,Nt.normalize):e};Sa.prototype.unnormalize=function(e){return this._normalized?Oj(e,this._valueType,Nt.unnormalize):e};Sa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Sa.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};Sa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Sa.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};Sa.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=at.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)};Sa.prototype.handleNoData=function(e){let t=this._noData;if(!c(t))return e;if(!wie(e,t))return e};function wie(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(!wie(e[n],t[n]))return!1;return!0}Sa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Sa.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Sa.prototype.validate=function(e){if(!(!c(e)&&c(this._default)))return this._required&&!c(e)?"required property must have a value":this._isArray?IBe(this,e):vie(this,e)};function IBe(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=vie(e,t[i]);if(c(o))return o}}function vie(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return at.isVectorType(n)?OBe(t,n,i):at.isMatrixType(n)?RBe(t,n,i):n===at.STRING?MBe(t):n===at.BOOLEAN?LBe(t):n===at.ENUM?NBe(t,o):FBe(t,i,r)}function OBe(e,t,n){if(!Nt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===at.VEC2&&!(e instanceof z))return`vector value ${e} must be a Cartesian2`;if(t===at.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===at.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function RBe(e,t,n){if(!Nt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===at.MAT2&&!(e instanceof Ri))return`matrix value ${e} must be a Matrix2`;if(t===at.MAT3&&!(e instanceof J))return`matrix value ${e} must be a Matrix3`;if(t===at.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function MBe(e){if(typeof e!="string")return wN(e,at.STRING)}function LBe(e){if(typeof e!="boolean")return wN(e,at.BOOLEAN)}function NBe(e,t){let n=typeof e;if(c(t))return n!=="string"||!c(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function FBe(e,t,n){let i=typeof e;switch(t){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.FLOAT32:case Nt.FLOAT64:return i!=="number"?wN(e,t):isFinite(e)?Eie(e,t,n):Sie(e,t);case Nt.INT64:case Nt.UINT64:return i!=="number"&&i!=="bigint"?wN(e,t):i==="number"&&!isFinite(e)?Sie(e,t):Eie(e,t,n)}}function wN(e,t){return`value ${e} does not match type ${t}`}function Cie(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Eie(e,t,n){if(n){let i=Nt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Cie(e,t,n):void 0}if(e<Nt.getMinimum(t)||e>Nt.getMaximum(t))return Cie(e,t,n)}function Sie(e,t){return`value ${e} of type ${t} must be finite`}function Oj(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=Oj(e[i],t,n);return e}Sa.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]=Sa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var vp=Sa;function sv(e){e=e??W.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews;T.typeOf.number.greaterThan("options.count",t,0),T.typeOf.object("options.property",n),T.typeOf.object("options.classProperty",i),T.typeOf.object("options.bufferViews",o);let r=i.type,s=i.isArray,a=i.isVariableLengthArray,l=i.valueType,u=i.enumType,f=r===at.STRING,h=r===at.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Nt[_]??Nt.UINT32;let w=n.arrayOffsets??n.arrayOffsetBufferView;g=new Rj(o[w],_,t+1),p+=g.typedArray.byteLength}let m=at.getComponentCount(r),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let b=m*y,x;if(f){let _=n.stringOffsetType??n.offsetType;_=Nt[_]??Nt.UINT32;let w=n.stringOffsets??n.stringOffsetBufferView;x=new Rj(o[w],_,b+1),p+=x.typedArray.byteLength}(f||h)&&(l=Nt.UINT8);let A;f?A=x.get(b)-x.get(0):h?A=Math.ceil(b/8):A=b;let E=n.values??n.bufferView,S=new Rj(o[E],l,A);p+=S.typedArray.byteLength;let v=n.offset,P=n.scale,M=i.hasValueTransform||c(v)||c(P);v=v??i.offset,P=P??i.scale,v=Die(v),P=Die(P);let R,L,B=this;f?R=function(_){return UBe(_,B._values,B._stringOffsets)}:h?(R=function(_){return VBe(_,B._values)},L=function(_,w){zBe(_,B._values,w)}):c(u)?(R=function(_){let w=B._values.get(_);return u.namesByValue[w]},L=function(_,w){let D=u.valuesByName[w];B._values.set(_,D)}):(R=function(_){return B._values.get(_)},L=function(_,w){B._values.set(_,w)}),this._arrayOffsets=g,this._stringOffsets=x,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=P,this._hasValueTransform=M,this._getValue=R,this._setValue=L,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(sv.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}}});sv.prototype.get=function(e){Pie(this,e);let t=BBe(this,e);return t=this._classProperty.handleNoData(t),c(t)?(t=this._classProperty.normalize(t),t=KBe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};sv.prototype.set=function(e,t){let n=this._classProperty;T.defined("value",t),Pie(this,e);let i=n.validate(t);if(c(i))throw new C(i);t=n.packVectorAndMatrixTypes(t),t=$Be(this,t),t=n.unnormalize(t),kBe(this,e,t)};sv.prototype.getTypedArray=function(){if(c(this._values))return this._values.typedArray};function Die(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 Pie(e,t){let n=e._count;if(!c(t)||t<0||t>=n){let i=n-1;throw new C(`index is required and between zero and count - 1. Actual value: ${i}`)}}function BBe(e,t){Oie(e)&&Rie(e);let n=e._classProperty,i=n.isArray,o=n.type,r=at.getComponentCount(o);if(c(e._unpackedValues)){let s=e._unpackedValues[t];return i?We(s,!0):s}return!i&&r===1?e._getValue(t):Iie(e,n,t)}function Iie(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=at.getComponentCount(t.type);i*=s,o*=s}else{let a=(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 kBe(e,t,n){YBe(e,t,n)&&Rie(e);let i=e._classProperty,o=i.isArray,r=i.type,s=at.getComponentCount(r);if(c(e._unpackedValues)){i.isArray&&(n=We(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,l;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),l=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,l=f}for(let u=0;u<l;++u)e._setValue(a+u,n[u])}function UBe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return tu(t.typedArray,i,o)}function VBe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function zBe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function HBe(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=l*Math.pow(256,a)}return r&&(o=-o),o}function GBe(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=BigInt(l)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function jBe(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 WBe(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 qBe(e){switch(e){case Nt.INT8:return $.BYTE;case Nt.UINT8:return $.UNSIGNED_BYTE;case Nt.INT16:return $.SHORT;case Nt.UINT16:return $.UNSIGNED_SHORT;case Nt.INT32:return $.INT;case Nt.UINT32:return $.UNSIGNED_INT;case Nt.FLOAT32:return $.FLOAT;case Nt.FLOAT64:return $.DOUBLE}}function Oie(e){if(c(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===at.STRING||i===Nt.INT64&&!zt.supportsBigInt64Array()||i===Nt.UINT64&&!zt.supportsBigUint64Array()}function YBe(e,t,n){if(Oie(e))return!0;let i=e._arrayOffsets;if(c(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function Rie(e){e._unpackedValues=XBe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function XBe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=at.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]=Iie(e,i,a);return n}function KBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:vp.valueTransformInPlace(t,e._offset,e._scale,Nt.applyValueTransform)}function $Be(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:vp.valueTransformInPlace(t,e._offset,e._scale,Nt.unapplyValueTransform)}function Rj(e,t,n){let i=this,o,r,s;if(t===Nt.INT64)zt.supportsBigInt()?zt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return GBe(a,i)}):(dt("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 HBe(a,i)});else if(t===Nt.UINT64)zt.supportsBigInt()?zt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return WBe(a,i)}):(dt("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 jBe(a,i)});else{let a=qBe(t);o=$.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(l,u){i.typedArray[l]=u}}c(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 vN=sv;function xd(e){e=e??W.EMPTY_OBJECT;let t=e.count,n=e.class;T.typeOf.number.greaterThan("options.count",t,0),T.typeOf.object("options.class",n);let i=0,o={};if(c(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new vN({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(xd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});xd.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};xd.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};xd.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};xd.prototype.getProperty=function(e,t){T.typeOf.string("propertyId",t);let n=this._properties[t],i;return c(n)?i=n.get(e):i=ZBe(this._class,t),i};xd.prototype.setProperty=function(e,t,n){T.typeOf.string("propertyId",t);let i=this._properties[t];return c(i)?(i.set(e,n),!0):!1};xd.prototype.getPropertyBySemantic=function(e,t){T.typeOf.string("semantic",t);let n,i=this._class.propertiesBySemantic;if(c(i)&&(n=i[t]),c(n))return this.getProperty(e,n.id)};xd.prototype.setPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",t);let i,o=this._class.propertiesBySemantic;return c(o)&&(i=o[t]),c(i)?this.setProperty(e,i.id,n):!1};xd.prototype.getPropertyTypedArray=function(e){T.typeOf.string("propertyId",e);let t=this._properties[e];if(c(t))return t.getTypedArray()};xd.prototype.getPropertyTypedArrayBySemantic=function(e){T.typeOf.string("semantic",e);let t,n=this._class.propertiesBySemantic;if(c(n)&&(t=n[e]),c(t))return this.getPropertyTypedArray(t.id)};function ZBe(e,t){let n=e.properties;if(!c(n))return;let i=n[t];if(c(i)&&c(i.default)){let o=i.default;return i.isArray&&(o=We(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Td=xd;function gg(){}Object.defineProperties(gg.prototype,{cacheKey:{get:function(){C.throwInstantiationError()}}});gg.prototype.load=function(){C.throwInstantiationError()};gg.prototype.unload=function(){};gg.prototype.process=function(e){return!1};gg.prototype.getError=function(e,t){T.typeOf.string("errorMessage",e),c(t)&&c(t.message)&&(e+=` -${t.message}`);let n=new ae(e);return c(t)&&(n.stack=`Original stack: -${t.stack} -Handler stack: -${n.stack}`),n};gg.prototype.isDestroyed=function(){return!1};gg.prototype.destroy=function(){return this.unload(),de(this)};var $i=gg;var QBe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},gt=Object.freeze(QBe);function Dp(e){e=e??W.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new C("One of options.typedArray and options.resource must be defined.");this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Dp.prototype=Object.create($i.prototype),Dp.prototype.constructor=Dp);Object.defineProperties(Dp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Dp.prototype.load=async function(){return c(this._promise)?this._promise:c(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=JBe(this),this._promise)};async function JBe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await Dp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Dp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Dp.prototype.unload=function(){this._typedArray=void 0};var pA=Dp;var Sin=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 m=new Uint8Array(g.length),y=0;y<g.length;++y){var b=g.charCodeAt(y);m[y]=b>96?b-97:b>64?b-39:b+4}for(var x=0,y=0;y<g.length;++y)m[x++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,x)}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,m,y,b){var x=n.exports.sbrk,A=x(m.length*4),E=x(y*4),S=new Uint8Array(n.exports.memory.buffer),v=s(m);S.set(v,A),b&&b(A,A,m.length,y);var P=g(E,A,m.length,y);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(y);new Uint8Array(M.buffer).set(S.subarray(E,E+y*4)),v.set(S.subarray(A,A+m.length*4)),x(A-x(0));for(var R=0;R<m.length;++R)m[R]=M[m[R]];return[M,P]}function l(g,m,y,b){var x=n.exports.sbrk,A=x(y*4),E=x(y*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),E),g(A,E,y,b),S=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(S.subarray(A,A+y*4)),x(A-x(0)),v}function u(g,m,y,b,x){var A=n.exports.sbrk,E=A(m),S=A(b*x),v=new Uint8Array(n.exports.memory.buffer);v.set(s(y),S);var P=g(E,m,S,b,x),M=new Uint8Array(P);return M.set(v.subarray(E,E+P)),A(E-A(0)),M}function f(g){for(var m=0,y=0;y<g.length;++y){var b=g[y];m=m<b?b:m}return m}function h(g,m){if(r(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,b,x,A,E){var S=n.exports.sbrk,v=S(y*b),P=S(y*A),M=new Uint8Array(n.exports.memory.buffer);M.set(s(m),P),g(v,y,b,x,P,E);var R=new Uint8Array(y*b);return R.set(M.subarray(v,v+y*b)),S(v-S(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){var b=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,b)},reorderPoints:function(g,m){return r(g instanceof Float32Array),r(g.length%m==0),r(m>=3),l(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){r(y>0&&y<=256),r(y%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,b,g,m,y)},encodeIndexBuffer:function(g,m,y){r(y==2||y==4),r(m%3==0);var b=h(g,y),x=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,x,b,m,4)},encodeIndexSequence:function(g,m,y){r(y==2||y==4);var b=h(g,y),x=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,x,b,m,4)},encodeGltfBuffer:function(g,m,y,b){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(x[b]),x[b](g,m,y)},encodeFilterOct:function(g,m,y,b){return r(y==4||y==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,b,16)},encodeFilterQuat:function(g,m,y,b){return r(y==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,b,16)},encodeFilterExp:function(g,m,y,b,x){r(y>0&&y%4==0),r(b>=1&&b<=24);var A={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,m,y,b,y,x?A[x]:1)}}}();var Mie=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(x){r=x.instance,r.exports.__wasm_call_ctors()});function a(x){for(var A=new Uint8Array(x.length),E=0;E<x.length;++E){var S=x.charCodeAt(E);A[E]=S>96?S-97:S>64?S-39:S+4}for(var v=0,E=0;E<x.length;++E)A[v++]=A[E]<60?i[A[E]]:(A[E]-60)*64+A[++E];return A.buffer.slice(0,v)}function l(x,A,E,S,v,P,M){var R=x.exports.sbrk,L=S+3&-4,B=R(L*v),_=R(P.length),w=new Uint8Array(x.exports.memory.buffer);w.set(P,_);var D=A(B,S,v,_,P.length);if(D==0&&M&&M(B,L,v),E.set(w.subarray(B,B+S*v)),R(B-R(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function g(x){var A={object:new Worker(x),pending:0,requests:{}};return A.object.onmessage=function(E){var S=E.data;A.pending-=S.count,A.requests[S.id][S.action](S.value),delete A.requests[S.id]},A}function m(x){for(var A="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+l.toString()+b.toString(),E=new Blob([A],{type:"text/javascript"}),S=URL.createObjectURL(E),v=h.length;v<x;++v)h[v]=g(S);for(var v=x;v<h.length;++v)h[v].object.postMessage({});h.length=x,URL.revokeObjectURL(S)}function y(x,A,E,S,v){for(var P=h[0],M=1;M<h.length;++M)h[M].pending<P.pending&&(P=h[M]);return new Promise(function(R,L){var B=new Uint8Array(E),_=++p;P.pending+=x,P.requests[_]={resolve:R,reject:L},P.object.postMessage({id:_,count:x,size:A,source:B,mode:S,filter:v},[B.buffer])})}function b(x){var A=x.data;if(!A.id)return self.close();self.ready.then(function(E){try{var S=new Uint8Array(A.count*A.size);l(E,E.exports[A.mode],S,A.count,A.size,A.source,E.exports[A.filter]),self.postMessage({id:A.id,count:A.count,action:"resolve",value:S},[S.buffer])}catch(v){self.postMessage({id:A.id,count:A.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(x){m(x)},decodeVertexBuffer:function(x,A,E,S,v){l(r,r.exports.meshopt_decodeVertexBuffer,x,A,E,S,r.exports[u[v]])},decodeIndexBuffer:function(x,A,E,S){l(r,r.exports.meshopt_decodeIndexBuffer,x,A,E,S)},decodeIndexSequence:function(x,A,E,S){l(r,r.exports.meshopt_decodeIndexSequence,x,A,E,S)},decodeGltfBuffer:function(x,A,E,S,v,P){l(r,r.exports[f[v]],x,A,E,S,r.exports[u[P]])},decodeGltfBufferAsync:function(x,A,E,S,v){return h.length>0?y(x,A,E,f[S],u[v]):s.then(function(){var P=new Uint8Array(x*A);return l(r,r.exports[f[S]],P,x,A,E,r.exports[u[v]]),P})}}}();var Din=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;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfh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S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIdaMg8Sa8SMMaRNaeIdlaHIdlg8RNaeIdCaRNaeId3Mg8Sa8SMMa8RNaeIdba8PNaeId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baSaOcdtfaeBdbaHcxfhHaEaecefge9hmbkadak9RgOci9Uh9kdnalTmbcbhea8MhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh0a9hcbalz:ljjjbh9maOcO9Uh9na9kce4h9oasydwh9pcbh8KcbhwdninaDaSawcdtfydbcx2fg3Idwg8Sac9Emea8Ka9k9pmeJFFuuhIdna9oaE9pmbaDaSa9ocdtfydbcx2fIdwJbb;aZNhIkdna8SaI9ETmba8San9ETmba8Ka9n0mdkdna9maQa3ydlgicdtg9qfydbgAfg9rRbba9maQa3ydbgLcdtg9sfydbgHfg9tRbbVmbaXaLfRbbh9udna9eaHcdtfgeclfydbgOaeydbgeSmbaOae9RhKa9paecitfheaaaAcx2fg8Lcwfh5a8Lclfh9vaaaHcx2fg8Acwfh9wa8Aclfh9xcbhHceh8Fdnindna8MaeydbcdtfydbgOaASmba8MaeclfydbcdtfydbgYaASmbaOaYSmbaaaYcx2fgYIdbaaaOcx2fgOIdbg8V:tg8Sa9xIdbaOIdlgR:tg8WNa8AIdba8V:tg8UaYIdlaR:tgIN:tg8Pa8Sa9vIdbaR:tg8XNa8LIdba8V:tg80aIN:tgRNaIa9wIdbaOIdwg8R:tg8YNa8WaYIdwa8R:tg8VN:tg8WaIa5Idba8R:tg81Na8Xa8VN:tgINa8Va8UNa8Ya8SN:tg8Ra8Va80Na81a8SN:tg8SNMMa8Pa8PNa8Wa8WNa8Ra8RNMMaRaRNaIaINa8Sa8SNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaK6h8FaKaH9hmbkka8FceGTmba9ocefh9oxeka3cwfhHdndndndna9uc9:fPdebdkaLheina8MaecdtgefaiBdba8EaefydbgeaL9hmbxikkdnagahaha9sfydbaiSEa8Ea9sfydbgLcdtfydbgecu9hmba8Ea9qfydbheka8Ma9sfaiBdbaehika8MaLcdtfaiBdbka9tce86bba9rce86bbaHIdbg8Sanana8S9DEhna0cefh0cecda9uceSEa8Kfh8KkawcefgwaE9hmbkka0TmddnalTmbcbhK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gOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b<m.length;++b)y[A++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,A)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,y,b){var x=n.exports.sbrk,A=x(y.length*4),E=x(b*4),S=new Uint8Array(n.exports.memory.buffer),v=s(y);S.set(v,A);var P=m(E,A,y.length,b);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(b);new Uint8Array(M.buffer).set(S.subarray(E,E+b*4)),v.set(S.subarray(A,A+y.length*4)),x(A-x(0));for(var R=0;R<y.length;++R)y[R]=M[y[R]];return[M,P]}function l(m){for(var y=0,b=0;b<m.length;++b){var x=m[b];y=y<x?x:y}return y}function u(m,y,b,x,A,E,S,v,P){var M=n.exports.sbrk,R=M(4),L=M(b*4),B=M(A*E),_=M(b*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(x),B),w.set(s(y),_);var D=m(L,_,b,B,A,E,S,v,P,R);w=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(D);s(I).set(w.subarray(L,L+D*4));var N=new Float32Array(1);return s(N).set(w.subarray(R,R+4)),M(R-M(0)),[I,N[0]]}function f(m,y,b,x,A,E,S,v,P,M,R,L,B){var _=n.exports.sbrk,w=_(4),D=_(b*4),I=_(A*E),N=_(A*v),k=_(P.length*4),H=_(b*4),V=M?_(A):0,j=new Uint8Array(n.exports.memory.buffer);j.set(s(x),I),j.set(s(S),N),j.set(s(P),k),j.set(s(y),H),M&&j.set(s(M),V);var U=m(D,H,b,I,A,E,N,v,k,P.length,V,R,L,B,w);j=new Uint8Array(n.exports.memory.buffer);var q=new Uint32Array(U);s(q).set(j.subarray(D,D+U*4));var X=new Float32Array(1);return s(X).set(j.subarray(w,w+4)),_(w-_(0)),[q,X[0]]}function h(m,y,b,x){var A=n.exports.sbrk,E=A(b*x),S=new Uint8Array(n.exports.memory.buffer);S.set(s(y),E);var v=m(E,b,x);return A(E-A(0)),v}function p(m,y,b,x,A,E,S,v){var P=n.exports.sbrk,M=P(v*4),R=P(b*x),L=P(b*E),B=new Uint8Array(n.exports.memory.buffer);B.set(s(y),R),A&&B.set(s(A),L);var _=m(M,R,b,x,L,E,S,v);B=new Uint8Array(n.exports.memory.buffer);var w=new Uint32Array(_);return s(w).set(B.subarray(M,M+_*4)),P(M-P(0)),w}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var y=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,y,l(m)+1)},simplify:function(m,y,b,x,A,E){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x>=0&&x<=m.length),r(x%3==0),r(A>=0);for(var S=0,v=0;v<(E?E.length:0);++v)r(E[v]in g),r(this.useExperimentalFeatures||E[v]!="Prune"),S|=g[E[v]];var P=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),M=u(n.exports.meshopt_simplify,P,m.length,y,y.length/b,b*4,x,A,S);return M[0]=m instanceof Uint32Array?M[0]:new m.constructor(M[0]),M},simplifyWithAttributes:function(m,y,b,x,A,E,S,v,P,M){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x instanceof Float32Array),r(x.length%A==0),r(A>=0),r(S==null||S instanceof Uint8Array),r(S==null||S.length==y.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(P>=0),r(Array.isArray(E)),r(A>=E.length),r(E.length<=32);for(var R=0;R<E.length;++R)r(E[R]>=0);for(var L=0,R=0;R<(M?M.length:0);++R)r(M[R]in g),L|=g[M[R]];var B=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),_=f(n.exports.meshopt_simplifyWithAttributes,B,m.length,y,y.length/b,b*4,x,A*4,new Float32Array(E),S?new Uint8Array(S):null,v,P,L);return _[0]=m instanceof Uint32Array?_[0]:new m.constructor(_[0]),_},getScale:function(m,y){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),h(n.exports.meshopt_simplifyScale,m,m.length/y,y*4)},simplifyPoints:function(m,y,b,x,A,E){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),r(b>=0&&b<=m.length/y),x?(r(x instanceof Float32Array),r(x.length%A==0),r(A>=3),r(m.length/y==x.length/A),p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,x,A*4,E,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,void 0,0,0,b)}}}();var Iin=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8KaCIdwh8LaXIdwh8MaPcxfa3aY:tg3aaa8F:tgaNa5aY:tg5a8Ea8F:tg8EN:tgY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BdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz: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(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b<m.length;++b)y[A++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,A)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,l=16;function u(m,y){var b=m.meshlets[y*4+0],x=m.meshlets[y*4+1],A=m.meshlets[y*4+2],E=m.meshlets[y*4+3];return{vertices:m.vertices.subarray(b,b+A),triangles:m.triangles.subarray(x,x+E*3)}}function f(m,y,b,x,A,E,S){var v=n.exports.sbrk,P=n.exports.meshopt_buildMeshletsBound(m.length,A,E),M=v(P*l),R=v(P*A*4),L=v(P*E*3),B=v(m.byteLength),_=v(y.byteLength),w=new Uint8Array(n.exports.memory.buffer);w.set(s(m),B),w.set(s(y),_);var D=n.exports.meshopt_buildMeshlets(M,R,L,B,m.length,_,b,x,A,E,S);w=new Uint8Array(n.exports.memory.buffer);for(var I=w.subarray(M,M+D*l),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),k=0;k<D;++k){var H=N[k*4+0],V=N[k*4+1],b=N[k*4+2],j=N[k*4+3];n.exports.meshopt_optimizeMeshlet(R+H*4,L+V,j,b)}var U=N[(D-1)*4+0],q=N[(D-1)*4+1],X=N[(D-1)*4+2],te=N[(D-1)*4+3],K=U+X,Z=q+(te*3+3&-4),ee={meshlets:N,vertices:new Uint32Array(w.buffer,R,K).slice(),triangles:new Uint8Array(w.buffer,L,Z*3).slice(),meshletCount:D};return v(M-v(0)),ee}function h(m){var y=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function p(m,y,b,x){var A=n.exports.sbrk,E=[],S=A(y.byteLength),v=A(m.vertices.byteLength),P=A(m.triangles.byteLength),M=A(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),R.set(s(m.vertices),v),R.set(s(m.triangles),P);for(var L=0;L<m.meshletCount;++L){var B=m.meshlets[L*4+0],_=m.meshlets[L*4+0+1],w=m.meshlets[L*4+0+3];n.exports.meshopt_computeMeshletBounds(M,v+B*4,P+_,w,S,b,x),E.push(h(M))}return A(S-A(0)),E}function g(m,y,b,x){var A=n.exports.sbrk,E=A(a),S=A(m.byteLength),v=A(y.byteLength),P=new Uint8Array(n.exports.memory.buffer);P.set(s(m),S),P.set(s(y),v),n.exports.meshopt_computeClusterBounds(E,S,m.length,v,b,x);var M=h(E);return A(E-A(0)),M}return{ready:i,supported:!0,buildMeshlets:function(m,y,b,x,A,E){r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x<=255||x>0),r(A<=512),r(A%4==0),E=E||0;var S=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(S,y,y.length/b,b*4,x,A,E)},computeClusterBounds:function(m,y,b){r(m.length%3==0),r(m.length/3<=512),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return g(x,y,y.length/b,b*4)},computeMeshletBounds:function(m,y,b){return r(m.meshletCount!=0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),p(m,y,y.length/b,b*4)},extractMeshlet:function(m,y){return r(y>=0&&y<m.meshletCount),u(m,y)}}}();function ab(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.bufferViewId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.bufferViews[i],l=a.buffer,u=a.byteOffset,f=a.byteLength,h=!1,p,g,m,y;if(ri(a,"EXT_meshopt_compression")){let x=a.extensions.EXT_meshopt_compression;l=x.buffer,u=x.byteOffset??0,f=x.byteLength,h=!0,p=x.byteStride,g=x.count,m=x.mode,y=x.filter??"NONE"}let b=n.buffers[l];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=m,this._meshoptFilter=y,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=l,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(ab.prototype=Object.create($i.prototype),ab.prototype.constructor=ab);Object.defineProperties(ab.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function e3e(e){try{let t=t3e(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);Mie.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}ab.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=e3e(this),this._promise)};function t3e(e){let t=e._resourceCache,n=e._buffer;if(c(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}ab.prototype.unload=function(){c(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var av=ab;function Lr(){}Lr._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);Lr._decoderTaskProcessor=void 0;Lr._taskProcessorReady=!1;Lr._error=void 0;Lr._getDecoderTaskProcessor=function(){if(!c(Lr._decoderTaskProcessor)){let e=new bi("decodeDraco",Lr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Lr._taskProcessorReady=!0:Lr._error=new ae("Draco decoder could not be initialized.")}).catch(t=>{Lr._error=t}),Lr._decoderTaskProcessor=e}return Lr._decoderTaskProcessor};Lr.decodePointCloud=function(e){let t=Lr._getDecoderTaskProcessor();if(c(Lr._error))throw Lr._error;if(Lr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Lr.decodeBufferView=function(e){let t=Lr._getDecoderTaskProcessor();if(c(Lr._error))throw Lr._error;if(Lr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var yg=Lr;var Jn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function n3e(e){switch(e){case Jn.POSITION:return"positionMC";case Jn.NORMAL:return"normalMC";case Jn.TANGENT:return"tangentMC";case Jn.TEXCOORD:return"texCoord";case Jn.COLOR:return"color";case Jn.JOINTS:return"joints";case Jn.WEIGHTS:return"weights";case Jn.FEATURE_ID:return"featureId";default:throw new C("semantic is not a valid value.")}}Jn.hasSetIndex=function(e){switch(T.typeOf.string("semantic",e),e){case Jn.POSITION:case Jn.NORMAL:case Jn.TANGENT:return!1;case Jn.TEXCOORD:case Jn.COLOR:case Jn.JOINTS:case Jn.WEIGHTS:case Jn.FEATURE_ID:return!0;default:throw new C("semantic is not a valid value.")}};Jn.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Jn.POSITION;case"NORMAL":return Jn.NORMAL;case"TANGENT":return Jn.TANGENT;case"TEXCOORD":return Jn.TEXCOORD;case"COLOR":return Jn.COLOR;case"JOINTS":return Jn.JOINTS;case"WEIGHTS":return Jn.WEIGHTS;case"_FEATURE_ID":return Jn.FEATURE_ID}};Jn.fromPntsSemantic=function(e){switch(T.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return Jn.POSITION;case"RGBA":case"RGB":case"RGB565":return Jn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Jn.NORMAL;case"BATCH_ID":return Jn.FEATURE_ID;default:throw new C("pntsSemantic is not a valid value.")}};Jn.getGlslType=function(e){switch(T.typeOf.string("semantic",e),e){case Jn.POSITION:case Jn.NORMAL:case Jn.TANGENT:return"vec3";case Jn.TEXCOORD:return"vec2";case Jn.COLOR:return"vec4";case Jn.JOINTS:return"ivec4";case Jn.WEIGHTS:return"vec4";case Jn.FEATURE_ID:return"int";default:throw new C("semantic is not a valid value.")}};Jn.getVariableName=function(e,t){T.typeOf.string("semantic",e);let n=n3e(e);return c(t)&&(n+=`_${t}`),n};var ht=Object.freeze(Jn);function bg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.primitive",i),T.typeOf.object("options.draco",o),T.typeOf.object("options.gltfResource",r),T.typeOf.object("options.baseResource",s),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=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}c(Object.create)&&(bg.prototype=Object.create($i.prototype),bg.prototype.constructor=bg);Object.defineProperties(bg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function i3e(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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Lie(e,n)}}bg.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=i3e(this),this._promise)};function Lie(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function o3e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var cb={};cb[ht.POSITION]="POSITION";cb[ht.NORMAL]="NORMAL";cb[ht.COLOR]="COLOR";cb[ht.TEXCOORD]="TEX_COORD";function r3e(e){for(let t in cb)if(cb.hasOwnProperty(t)&&e.startsWith(t))return cb[t]}bg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(c(this._dracoError)&&Lie(this,this._dracoError),!c(this._bufferViewTypedArray))||c(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,l=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=r3e(h);c(p)&&i.accessors[n.attributes[h]].componentType===$.FLOAT&&(l.includes(p)||l.push(p))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:l},f=yg.decodeBufferView(u);if(!c(f))return!1;this._decodePromise=o3e(this,f)};bg.prototype.unload=function(){c(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 cv=bg;function s3e(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1;T.typeOf.object("uint8Array",t),T.typeOf.string("format",n);let s=new Blob([t],{type:n}),a;return we.supportsImageBitmapOptions().then(function(l){return l?Promise.resolve(we.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new we({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(l){return c(a)&&window.URL.revokeObjectURL(a),l}).catch(function(l){return c(a)&&window.URL.revokeObjectURL(a),Promise.reject(l)})}var _A=s3e;function Pp(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.imageId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.images[i],l=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=l,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Pp.prototype=Object.create($i.prototype),Pp.prototype.constructor=Pp);Object.defineProperties(Pp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Pp.prototype.load=function(){return c(this._promise)?this._promise:c(this._bufferViewId)?(this._promise=a3e(this),this._promise):(this._promise=c3e(this),this._promise)};function Nie(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 a3e(e){e._state=gt.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 u3e(i);if(e.isDestroyed())return;let r=Nie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:Fie(e,n,"Failed to load embedded image")}}async function c3e(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await d3e(i);if(e.isDestroyed())return;let r=Nie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:Fie(e,o,`Failed to load image: ${n}`)}}function Fie(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function l3e(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 u3e(e){let t=l3e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Xl(n)}return Pp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var f3e=/(^data:image\/ktx2)|(\.ktx2$)/i;function d3e(e){let t=e.getUrlComponent(!1,!0);return f3e.test(t)?Xl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Pp.prototype.unload=function(){c(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};Pp._loadImageFromTypedArray=_A;var lv=Pp;var h3e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},wa=Object.freeze(h3e);function xg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,l=e.cacheKey,u=e.asynchronous??!0,f=e.loadBuffer??!1,h=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.accessorId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),!f&&!h)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let 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=l,this._asynchronous=u,this._loadBuffer=f,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(xg.prototype=Object.create($i.prototype),xg.prototype.constructor=xg);Object.defineProperties(xg.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 m3e=new Lj;xg.prototype.load=async function(){return c(this._promise)?this._promise:c(this._draco)?(this._promise=p3e(this),this._promise):(this._promise=_3e(this),this._promise)};async function p3e(e){e._state=gt.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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;Mj(e,n)}}async function _3e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.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=g3e(e,a),e._state=gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;Mj(e,s)}}function g3e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Fe.getSizeInBytes(s),l=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,p=new Uint8Array(l,u,h);l=new Uint8Array(p).buffer,u=0,Ns("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Fe.UNSIGNED_BYTE?f=new Uint8Array(l,u,r):s===Fe.UNSIGNED_SHORT?f=new Uint16Array(l,u,r):s===Fe.UNSIGNED_INT&&(f=new Uint32Array(l,u,r)),f}function Mj(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}function Lj(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}Lj.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};Lj.prototype.execute=function(){this.buffer=Bie(this.typedArray,this.indexDatatype,this.context)};function Bie(e,t,n){let i=bt.createIndexBuffer({typedArray:e,context:n,usage:Be.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}xg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(c(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=$.fromTypedArray(t),this._indexDatatype=n)}catch(o){Mj(this,o)}if(!c(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=m3e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,wa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Bie(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};xg.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 uv=xg;function y3e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Bs=y3e;function b3e(e,t){return c(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var br=b3e;function Xt(){}Xt.objectLegacy=function(e,t){if(c(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}}};Xt.object=function(e,t){if(c(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(c(r))return r}}};Xt.topLevel=function(e,t,n){let i=e[t];return c(i)&&!Array.isArray(i)?Xt.objectLegacy(i,n):Xt.object(i,n)};Xt.accessor=function(e,t){return Xt.topLevel(e,"accessors",t)};Xt.accessorWithSemantic=function(e,t,n){let i={};return Xt.mesh(e,function(o){return Xt.meshPrimitive(o,function(r){let s=Xt.meshPrimitiveAttribute(r,function(a,l){if(l.indexOf(t)===0&&!c(i[a])){i[a]=!0;let u=n(a);if(c(u))return u}});return c(s)?s:Xt.meshPrimitiveTarget(r,function(a){return Xt.meshPrimitiveTargetAttribute(a,function(l,u){if(u.indexOf(t)===0&&!c(i[l])){i[l]=!0;let f=n(l);if(c(f))return f}})})})})};Xt.accessorContainingVertexAttributeData=function(e,t){let n={};return Xt.mesh(e,function(i){return Xt.meshPrimitive(i,function(o){let r=Xt.meshPrimitiveAttribute(o,function(s){if(!c(n[s])){n[s]=!0;let a=t(s);if(c(a))return a}});return c(r)?r:Xt.meshPrimitiveTarget(o,function(s){return Xt.meshPrimitiveTargetAttribute(s,function(a){if(!c(n[a])){n[a]=!0;let l=t(a);if(c(l))return l}})})})})};Xt.accessorContainingIndexData=function(e,t){let n={};return Xt.mesh(e,function(i){return Xt.meshPrimitive(i,function(o){let r=o.indices;if(c(r)&&!c(n[r])){n[r]=!0;let s=t(r);if(c(s))return s}})})};Xt.animation=function(e,t){return Xt.topLevel(e,"animations",t)};Xt.animationChannel=function(e,t){let n=e.channels;return Xt.object(n,t)};Xt.animationSampler=function(e,t){let n=e.samplers;return Xt.object(n,t)};Xt.buffer=function(e,t){return Xt.topLevel(e,"buffers",t)};Xt.bufferView=function(e,t){return Xt.topLevel(e,"bufferViews",t)};Xt.camera=function(e,t){return Xt.topLevel(e,"cameras",t)};Xt.image=function(e,t){return Xt.topLevel(e,"images",t)};Xt.material=function(e,t){return Xt.topLevel(e,"materials",t)};Xt.materialValue=function(e,t){let n=e.values;c(e.extensions)&&c(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(c(o))return o}};Xt.mesh=function(e,t){return Xt.topLevel(e,"meshes",t)};Xt.meshPrimitive=function(e,t){let n=e.primitives;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(c(s))return s}}};Xt.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(c(o))return o}};Xt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(c(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(c(r))return r}}};Xt.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(c(o))return o}};Xt.node=function(e,t){return Xt.topLevel(e,"nodes",t)};Xt.nodeInTree=function(e,t,n){let i=e.nodes;if(c(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(c(a)){let l=n(a,s);if(c(l))return l;let u=a.children;if(c(u)&&(l=Xt.nodeInTree(e,u,n),c(l)))return l}}}};Xt.nodeInScene=function(e,t,n){let i=t.nodes;if(c(i))return Xt.nodeInTree(e,i,n)};Xt.program=function(e,t){return br(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.programs,t):Xt.topLevel(e,"programs",t)};Xt.sampler=function(e,t){return Xt.topLevel(e,"samplers",t)};Xt.scene=function(e,t){return Xt.topLevel(e,"scenes",t)};Xt.shader=function(e,t){return br(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.shaders,t):Xt.topLevel(e,"shaders",t)};Xt.skin=function(e,t){return Xt.topLevel(e,"skins",t)};Xt.skinJoint=function(e,t){let n=e.joints;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(c(s))return s}}};Xt.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(c(o))return o}};Xt.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(c(o))return o}};Xt.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(c(o))return o}};Xt.technique=function(e,t){return br(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.techniques,t):Xt.topLevel(e,"techniques",t)};Xt.texture=function(e,t){return Xt.topLevel(e,"textures",t)};var Oe=Xt;function x3e(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 mf=x3e;function T3e(e,t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n];if(c(i.byteStride)&&i.byteStride>0)return i.byteStride}return $.getSizeInBytes(t.componentType)*mf(t.type)}var ou=T3e;function A3e(e){Oe.accessor(e,function(n){c(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Oe.bufferView(e,function(n){c(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=i.mode??ne.TRIANGLES,!c(i.material)){c(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Bs(e.materials,o)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,c(o)){let r=e.bufferViews[o];r.byteStride=ou(e,i),r.target=ne.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(c(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=n.extensions??W.EMPTY_OBJECT,o=i.KHR_materials_common;if(c(o)){let l=o.technique,u=c(o.values)?o.values:{};o.values=u,u.ambient=c(u.ambient)?u.ambient:[0,0,0,1],u.emission=c(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,l!=="CONSTANT"&&(u.diffuse=c(u.diffuse)?u.diffuse:[0,0,0,1],l!=="LAMBERT"&&(u.specular=c(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;c(r)&&Oe.materialValue(n,function(l){c(l.index)&&lb(l)}),lb(n.emissiveTexture),lb(n.normalTexture),lb(n.occlusionTexture);let s=n.pbrMetallicRoughness;c(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,lb(s.baseColorTexture),lb(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;c(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,lb(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=C3e(e);return Oe.node(e,function(n,i){c(t[i])||c(n.translation)||c(n.rotation)||c(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Oe.sampler(e,function(n){n.wrapS=n.wrapS??ne.REPEAT,n.wrapT=n.wrapT??ne.REPEAT}),c(e.scenes)&&!c(e.scene)&&(e.scene=0),e}function C3e(e){let t={};return Oe.animation(e,function(n){Oe.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 lb(e){c(e)&&(e.texCoord=e.texCoord??0)}var DN=A3e;function E3e(e){return Oe.shader(e,function(t){PN(t)}),Oe.buffer(e,function(t){PN(t)}),Oe.image(e,function(t){PN(t)}),PN(e),e}function PN(e){e.extras=c(e.extras)?e.extras:{},e.extras._pipeline=c(e.extras._pipeline)?e.extras._pipeline:{}}var ub=E3e;function S3e(e,t){let n=e.extensionsRequired;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var IN=S3e;function w3e(e,t){let n=e.extensionsUsed;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),IN(e,t),n.length===0&&delete e.extensionsUsed}}var gA=w3e;var v3e=4;function D3e(e){if(Wh(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=kie(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?P3e(e,n):I3e(e,n)}function kie(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*v3e,!0);return o}function P3e(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=tu(e,r,i),l=JSON.parse(a);ub(l);let u=e.subarray(s,n),f=l.buffers;if(c(f)&&Object.keys(f).length>0){let h=f.binary_glTF??f.KHR_binary_glTF;c(h)&&(h.extras._pipeline.source=u,delete h.uri)}return gA(l,"KHR_binary_glTF"),l}function I3e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=kie(e,i,2),a=s[0],l=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,l===1313821514){let f=tu(u);o=JSON.parse(f),ub(o)}else l===5130562&&(r=u)}if(c(o)&&c(r)){let s=o.buffers;if(c(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var ON=D3e;function O3e(e){return Oe.shader(e,function(t){RN(t)}),Oe.buffer(e,function(t){RN(t)}),Oe.image(e,function(t){RN(t)}),RN(e),e}function RN(e){c(e.extras)&&(c(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var MN=O3e;function R3e(e,t){let n=e.extensionsUsed;c(n)||(n=[],e.extensionsUsed=n),Bs(n,t,!0)}var Ad=R3e;function M3e(e){switch(e){case $.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case $.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case $.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case $.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 $.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case $.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 $.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case $.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Tg=M3e;function L3e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=mf(t.type);if(!c(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),l=n[o],u=l.buffer,h=i[u].extras._pipeline.source,p=t.count,g=ou(e,t),m=t.byteOffset+l.byteOffset+h.byteOffset,y=t.componentType,b=$.getSizeInBytes(y),x=new DataView(h.buffer),A=new Array(r),E=Tg(y);for(let S=0;S<p;S++){E(x,m,r,b,A);for(let v=0;v<r;v++){let P=A[v];s[v]=Math.min(s[v],P),a[v]=Math.max(a[v],P)}m+=g}return{min:s,max:a}}var yA=L3e;var N3e=[ne.FUNC_ADD,ne.FUNC_ADD],F3e=[ne.ONE,ne.ZERO,ne.ONE,ne.ZERO];function Uie(e,t){let n=e.enable;return c(n)?n.indexOf(t)>-1:!1}var B3e=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function k3e(e,t){if(!c(e))return t;for(let n=0;n<4;n++)if(B3e.indexOf(e[n])===-1)return t;return e}function U3e(e){let t={},n={},i=e.techniques;return c(i)&&(Oe.technique(e,function(o,r){let s=o.states;if(c(s)){let a=n[r]={};if(Uie(s,ne.BLEND)){a.alphaMode="BLEND";let l=s.functions;c(l)&&(c(l.blendEquationSeparate)||c(l.blendFuncSeparate))&&(t[r]={blendEquation:l.blendEquationSeparate??N3e,blendFactors:k3e(l.blendFuncSeparate,F3e)})}Uie(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(c(e.extensions)||(e.extensions={}),Ad(e,"KHR_blend")),Oe.material(e,function(o){if(c(o.technique)){let r=n[o.technique];Oe.objectLegacy(r,function(a,l){o[l]=a});let s=t[o.technique];c(s)&&(c(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var LN=U3e;function V3e(e,t){let n=e.extensionsRequired;c(n)||(n=[],e.extensionsRequired=n),Bs(n,t,!0),Ad(e,t)}var NN=V3e;function z3e(e){let t=e.techniques,n={},i={},o={};if(c(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,l){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(h,p){f=a.parameters[h],u.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(h,p){f=a.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},c(n[l])||(n[l]={}),n[l][h]=p}),c(o[a.program]))u.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=Bs(r.shaders,g,!0);let m=e.shaders[h.vertexShader];p.vertexShader=Bs(r.shaders,m,!0),u.program=Bs(r.programs,p),o[a.program]=u.program}i[l]=Bs(r.techniques,u)}),r.techniques.length>0&&(c(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Ad(e,"KHR_techniques_webgl"),NN(e,"KHR_techniques_webgl"))}return Oe.material(e,function(r){if(c(r.technique)){let s={technique:i[r.technique]};Oe.objectLegacy(r.values,function(a,l){c(s.values)||(s.values={});let u=n[r.technique][l];c(u)&&(s.values[u]=a)}),c(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 FN=z3e;function H3e(e,t){T.typeOf.object("material",e),T.defined("handler",t);let n=e.pbrMetallicRoughness;if(c(n)){if(c(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(c(s))return s}if(c(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(c(s))return s}}let{extensions:i}=e;if(c(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(c(r)){if(c(r.diffuseTexture)){let l=r.diffuseTexture,u=t(l.index,l);if(c(u))return u}if(c(r.specularGlossinessTexture)){let l=r.specularGlossinessTexture,u=t(l.index,l);if(c(u))return u}}let s=i.KHR_materials_specular;if(c(s)){let{specularTexture:l,specularColorTexture:u}=s;if(c(l)){let f=t(l.index,l);if(c(f))return f}if(c(u)){let f=t(u.index,u);if(c(f))return f}}let a=i.KHR_materials_common;if(c(a)&&c(a.values)){let{diffuse:l,ambient:u,emission:f,specular:h}=a.values;if(c(l)&&c(l.index)){let p=t(l.index,l);if(c(p))return p}if(c(u)&&c(u.index)){let p=t(u.index,u);if(c(p))return p}if(c(f)&&c(f.index)){let p=t(f.index,f);if(c(p))return p}if(c(h)&&c(h.index)){let p=t(h.index,h);if(c(p))return p}}}let o=Oe.materialValue(e,function(r){if(c(r.index)){let s=t(r.index,r);if(c(s))return s}});if(c(o))return o;if(c(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(c(s))return s}if(c(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(c(s))return s}if(c(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(c(s))return s}}var fv=H3e;var Vie=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function G3e(e,t){return t=t??Vie,Vie.forEach(function(n){t.indexOf(n)>-1&&W3e(e,n)}),e}var j3e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function W3e(e,t){let n=j3e[t],i=e[n];if(c(i)){let o=0,r=Xh[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Yh[t](e,a-o),o++)}}function Yh(){}Yh.accessor=function(e,t){e.accessors.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){Oe.meshPrimitiveAttribute(o,function(a,l){a>t&&o.attributes[l]--}),Oe.meshPrimitiveTarget(o,function(a){Oe.meshPrimitiveTargetAttribute(a,function(l,u){l>t&&a[u]--})});let r=o.indices;c(r)&&r>t&&o.indices--;let s=o.extensions;c(s)&&c(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Oe.skin(e,function(i){c(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(o){c(o.input)&&o.input>t&&o.input--,c(o.output)&&o.output>t&&o.output--})})};Yh.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){c(i.buffer)&&i.buffer>t&&i.buffer--,c(i.extensions)&&c(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Yh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),br(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.extensions)&&c(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),br(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(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.bufferView)&&u.bufferView>t&&u.bufferView--,c(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,c(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(br(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let u in l)if(l.hasOwnProperty(u)){let f=l[u];c(f.values)&&f.values>t&&f.values--,c(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,c(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Yh.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){c(i.source)&&i.source>t&&--i.source;let o=i.extensions;c(o)&&c(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:c(o)&&c(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Yh.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){c(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Yh.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){c(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(o){c(o.target)&&c(o.target.node)&&o.target.node>t&&o.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(o){c(o.node)&&o.node>t&&o.node--})}),Oe.node(e,function(i){c(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Yh.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.material)&&o.material>t&&o.material--})})};Yh.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){c(i.sampler)&&i.sampler>t&&--i.sampler})};Yh.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){fv(i,function(o,r){r.index>t&&--r.index})}),br(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(s){let a=s.extensions;if(c(a)&&c(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(c(u)){let f=u.length;for(let h=0;h<f;++h){let g=u[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(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let f=a[l].texture;f.index>t&&--f.index}}}}if(br(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){let r=o.extensions;if(c(r)&&c(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(c(a)){let l=a.length;for(let u=0;u<l;++u){let f=a[u];c(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),br(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let u in l)if(l.hasOwnProperty(u)){let f=l[u];f.index>t&&--f.index}}}}};function Xh(){}Xh.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Oe.meshPrimitiveTarget(i,function(r){Oe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;c(o)&&(t[o]=!0)})}),Oe.skin(e,function(n){c(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){c(i.input)&&(t[i.input]=!0),c(i.output)&&(t[i.output]=!0)})}),br(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){c(n.extensions)&&c(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})}),br(e,"CESIUM_primitive_outline")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;c(s)&&(t[s]=!0)}})}),t};Xh.buffer=function(e){let t={};return Oe.bufferView(e,function(n){c(n.buffer)&&(t[n.buffer]=!0),c(n.extensions)&&c(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Xh.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),br(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.extensions)&&c(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),br(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(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a];c(l.bufferView)&&(t[l.bufferView]=!0),c(l.arrayOffsetBufferView)&&(t[l.arrayOffsetBufferView]=!0),c(l.stringOffsetBufferView)&&(t[l.stringOffsetBufferView]=!0)}}}}if(br(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.values)&&(t[u.values]=!0),c(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),c(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Xh.image=function(e){let t={};return Oe.texture(e,function(n){c(n.source)&&(t[n.source]=!0),c(n.extensions)&&c(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:c(n.extensions)&&c(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Xh.mesh=function(e){let t={};return Oe.node(e,function(n){if(c(n.mesh&&c(e.meshes))){let i=e.meshes[n.mesh];c(i)&&c(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function zie(e,t,n){let i=e.nodes[t];return c(i.mesh)||c(i.camera)||c(i.skin)||c(i.weights)||c(i.extras)||c(i.extensions)&&Object.keys(i.extensions).length!==0||c(n[t])?!1:!c(i.children)||i.children.filter(function(o){return!zie(e,o,n)}).length===0}Xh.node=function(e){let t={};return Oe.skin(e,function(n){c(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){c(i.target)&&c(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){c(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){zie(e,i,t)||(t[i]=!0)}),t};Xh.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.material)&&(t[i.material]=!0)})}),t};Xh.texture=function(e){let t={};if(Oe.material(e,function(n){fv(n,function(i){t[i]=!0})}),br(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(r){let s=r.extensions;if(c(s)&&c(s.EXT_feature_metadata)){let l=s.EXT_feature_metadata.featureIdTextures;if(c(l)){let u=l.length;for(let f=0;f<u;++f){let p=l[f].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(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(br(e,"EXT_mesh_features")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(c(s)){let a=s.length;for(let l=0;l<a;++l){let u=s[l];c(u.texture)&&(t[u.texture.index]=!0)}}}})}),br(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];t[u.index]=!0}}}}return t};Xh.sampler=function(e){let t={};return Oe.texture(e,function(n){c(n.sampler)&&(t[n.sampler]=!0)}),t};var BN=G3e;function q3e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Bs(e.buffers,n),byteOffset:0,byteLength:t.length};return Bs(e.bufferViews,o)}var kN=q3e;function Y3e(e,t){let n=ou(e,t),i=$.getSizeInBytes(t.componentType),o=mf(t.type),r=t.count,s=new Array(o*r);if(!c(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],l=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+l.byteOffset,f=new DataView(l.buffer),h=new Array(o),p=Tg(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,h);for(let m=0;m<o;++m)s[g*o+m]=h[m];u+=n}return s}var UN=Y3e;function X3e(e){let t;return Oe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?VN(e,i,$.UNSIGNED_BYTE):t!==ne.UNSIGNED_BYTE&&t!==ne.UNSIGNED_SHORT&&VN(e,i,$.UNSIGNED_SHORT)}),Oe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?VN(e,i,$.UNSIGNED_BYTE):t===ne.SHORT&&VN(e,i,$.UNSIGNED_SHORT)}),e}function VN(e,t,n){let i=$.createTypedArray(n,UN(e,t)),o=new Uint8Array(i.buffer);t.bufferView=kN(e,o),t.componentType=n,t.byteOffset=0}var zN=X3e;function K3e(e,t){return gA(e,t),t==="CESIUM_RTC"&&$3e(e),Nj(e,t)}function $3e(e){Oe.technique(e,function(t){Oe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function Nj(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)Nj(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;c(n)&&(i=n[t],c(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&Nj(e[o],t);return i}}var bA=K3e;var HN={.8:nke,"1.0":Cke,"2.0":void 0};function Z3e(e,t){t=t??W.EMPTY_OBJECT;let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(HN,i)||(c(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(HN,i)||(i="1.0"));let o=HN[i];for(;c(o)&&i!==n;)o(e,t),i=e.asset.version,o=HN[i];return t.keepLegacyExtensions||(wke(e,t),vke(e)),e}function jie(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;c(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function Q3e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],l=a.primitive??ne.TRIANGLES;a.mode=a.mode??l,delete a.primitive}}}}function J3e(e){let t=e.nodes,n=new d,i=new Le;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(c(r.rotation)){let a=r.rotation;d.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;c(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function eke(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new d,a=new Le;for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)){let u=t[l],f=u.channels,h=u.parameters,p=u.samplers;if(c(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let b=h[p[y.sampler].output];if(c(r[b]))continue;r[b]=!0;let x=n[b],A=i[x.bufferView],S=o[A.buffer].extras._pipeline.source,v=S.byteOffset+A.byteOffset+x.byteOffset,P=x.componentType,M=x.count,R=mf(x.type),L=x.count*R,B=$.createArrayBufferView(P,S.buffer,v,L);for(let _=0;_<M;_++){let w=_*R;d.unpack(B,w,s);let D=B[w+3];Le.fromAxisAngle(s,D,a),Le.pack(a,B,w)}}}}}}function tke(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(c(o)){let r=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function nke(e){c(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(c(e.version)&&delete e.version,jie(e),Q3e(e),J3e(e),eke(e),tke(e),c(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),c(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Ad(e,"KHR_materials_common")}}function ike(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(c(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 Hie(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),c(o.name)||(o.name=i)}return n}function oke(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,c(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&c(n[s])){let a={},l=e[s];e[s]=Hie(l,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);c(e.scene)&&(e.scene=n.scenes[e.scene]),Oe.bufferView(e,function(s){c(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Oe.accessor(e,function(s){c(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Oe.shader(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.program(e,function(s){c(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),c(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Oe.technique(e,function(s){c(s.program)&&(s.program=n.programs[s.program]),Oe.techniqueParameter(s,function(a){c(a.node)&&(a.node=n.nodes[a.node]);let l=a.value;typeof l=="string"&&(a.value={index:n.textures[l]})})}),Oe.mesh(e,function(s){Oe.meshPrimitive(s,function(a){c(a.indices)&&(a.indices=n.accessors[a.indices]),Oe.meshPrimitiveAttribute(a,function(l,u){a.attributes[u]=n.accessors[l]}),c(a.material)&&(a.material=n.materials[a.material])})}),Oe.node(e,function(s){let a=s.children;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}if(c(s.meshes)){let l=s.meshes,u=l.length;if(u>0)for(s.mesh=n.meshes[l[0]],t=1;t<u;++t){let f={mesh:n.meshes[l[t]]},h=Bs(e.nodes,f);c(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(c(s.camera)&&(s.camera=n.cameras[s.camera]),c(s.skin)&&(s.skin=n.skins[s.skin]),c(s.skeletons)){let l=s.skeletons;if(l.length>0&&c(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[l[0]]}delete s.skeletons}c(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){c(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(c(a)){let l=[],u=a.length;for(t=0;t<u;++t)l[t]=o[a[t]];s.joints=l,delete s.jointNames}}),Oe.scene(e,function(s){let a=s.nodes;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}}),Oe.animation(e,function(s){let a={};s.samplers=Hie(s.samplers,a),Oe.animationSampler(s,function(l){l.input=n.accessors[l.input],l.output=n.accessors[l.output]}),Oe.animationChannel(s,function(l){l.sampler=a[l.sampler];let u=l.target;c(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Oe.material(e,function(s){c(s.technique)&&(s.technique=n.techniques[s.technique]),Oe.materialValue(s,function(l,u){typeof l=="string"&&(s.values[u]={index:n.textures[l]})});let a=s.extensions;if(c(a)){let l=a.KHR_materials_common;c(l)&&c(l.values)&&Oe.materialValue(l,function(u,f){typeof u=="string"&&(l.values[f]={index:n.textures[u]})})}}),Oe.image(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],s.mimeType=l.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.texture(e,function(s){c(s.sampler)&&(s.sampler=n.samplers[s.sampler]),c(s.source)&&(s.source=n.images[s.source])})}function rke(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){delete n.name})})}function ske(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]}Oe.node(e,function(t){c(t.children)&&t.children.length===0&&delete t.children})}function ake(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var cke={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function lke(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],c(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];c(cke[o])&&e.extensionsRequired.push(o)}}}function uke(e){Oe.buffer(e,function(t){delete t.type})}function fke(e){Oe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function dke(e){Oe.mesh(e,function(t){Oe.meshPrimitive(t,function(n){Oe.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})}),Oe.technique(e,function(t){Oe.techniqueParameter(t,function(n){let i=n.semantic;c(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var hke={POSITION:!0,NORMAL:!0,TANGENT:!0},mke={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function pke(e){let t={};Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,l="_0";s>=0&&(a=r.substring(0,s),l=r.substring(s));let u,f=mke[a];c(f)?(u=f+l,t[r]=u):c(hke[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];c(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let o=t[i.semantic];c(o)&&(i.semantic=o)})})}function _ke(e){Oe.camera(e,function(t){let n=t.perspective;if(c(n)){let i=n.aspectRatio;c(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;c(o)&&o===0&&(n.yfov=1)}})}function Bj(e,t){return c(t.byteStride)&&t.byteStride!==0?t.byteStride:ou(e,t)}function gke(e){Oe.buffer(e,function(t){c(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n],o=Bj(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function yke(e){let t,n,i,o=e.bufferViews,r={};Oe.accessorContainingVertexAttributeData(e,function(a){let l=e.accessors[a];c(l.bufferView)&&(r[l.bufferView]=!0)});let s={};Oe.accessor(e,function(a){c(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let l=s[a];l.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,h=l.length;for(t=0;t<h;++t){let p=l[t],g=Bj(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let b=t<h-1,x=b?Bj(e,l[t+1]):void 0;if(g!==x){let A=We(i,!0);r[a]&&(A.byteStride=g),A.byteOffset+=u,A.byteLength=m+y-u;let E=Bs(o,A);for(n=f;n<=t;++n)p=l[n],p.bufferView=E,p.byteOffset=p.byteOffset-u;u=b?l[t+1].byteOffset:void 0,f=t+1}}}BN(e,["accessor","bufferView","buffer"])}function bke(e){Oe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!c(n.min)||!c(n.max)){let i=yA(e,n);n.min=i.min,n.max=i.max}})}function Wie(e){return(!c(e.children)||e.children.length===0)&&(!c(e.meshes)||e.meshes.length===0)&&!c(e.camera)&&!c(e.skin)&&!c(e.skeletons)&&!c(e.jointName)&&(!c(e.translation)||d.fromArray(e.translation).equals(d.ZERO))&&(!c(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!c(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!c(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!c(e.extensions)&&!c(e.extras)}function qie(e,t){Oe.scene(e,function(n){let i=n.nodes;if(c(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Oe.node(e,function(n,i){if(c(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Wie(n)&&qie(e,i))}}),delete e.nodes[t]}function xke(e){return Oe.node(e,function(t,n){Wie(t)&&qie(e,n)}),e}function Tke(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!c(i.min)||!c(i.max)){let o=yA(e,i);i.min=o.min,i.max=o.max}})})}function Ake(e){Oe.accessor(e,function(t){if(c(t.min)||c(t.max)){let n=yA(e,t);c(t.min)&&(t.min=n.min),c(t.max)&&(t.max=n.max)}})}function Cke(e){e.asset=e.asset??{},e.asset.version="2.0",jie(e),ike(e),xke(e),oke(e),rke(e),ake(e),lke(e),gke(e),yke(e),bke(e),Tke(e),Ake(e),uke(e),fke(e),dke(e),pke(e),zN(e),_ke(e),LN(e),FN(e),ske(e)}var Eke=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Ske=["u_diffuse","u_diffuse_mat"];function kj(e){e.pbrMetallicRoughness=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function Uj(e){return c(e.index)}function Vj(e){return Array.isArray(e)&&e.length===4}function Yie(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 wke(e,t){t=t??W.EMPTY_OBJECT;let n=t.baseColorTextureNames??Eke,i=t.baseColorFactorNames??Ske;Oe.material(e,function(o){Oe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&Uj(r)?(kj(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&Vj(r)&&(kj(o),o.pbrMetallicRoughness.baseColorFactor=Yie(r))})}),bA(e,"KHR_techniques_webgl"),bA(e,"KHR_blend")}function Fj(e,t){c(t)&&(Vj(t)?e.pbrMetallicRoughness.baseColorFactor=Yie(t):Uj(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Gie(e,t){c(t)&&(Vj(t)?e.emissiveFactor=t.slice(0,3):Uj(t)&&(e.emissiveTexture=t))}function vke(e){Oe.material(e,function(t){let n=(t.extensions??W.EMPTY_OBJECT).KHR_materials_common;if(!c(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,l=n.doubleSided,u=n.transparent;kj(t),n.technique==="CONSTANT"?(Ad(e,"KHR_materials_unlit"),t.extensions=c(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},Fj(t,s),Fj(t,o)):(Fj(t,r),Gie(t,o),Gie(t,s)),c(l)&&(t.doubleSided=l),c(a)&&(c(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),c(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),bA(e,"KHR_materials_common")}var GN=Z3e;function nc(){}nc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;c(n)&&c(n.message)&&(i+=` -${n.message}`);let o=new ae(i);return c(n)&&(o.stack=`Original stack: -${n.stack} -Handler stack: -${o.stack}`),o};nc.getNodeTransform=function(e){return c(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(c(e.translation)?e.translation:d.ZERO,c(e.rotation)?e.rotation:Le.IDENTITY,c(e.scale)?e.scale:d.ONE)};nc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=c(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};nc.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}};nc.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}};nc.hasQuantizedAttributes=function(e){if(!c(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(c(n.quantization))return!0}return!1};nc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;c(t)?(i=ht.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=nn.getGlslType(s);r&&(a="vec4");let l=c(e.quantization),u;return l&&(u=r?"vec4":nn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:l,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var Dke=new d,Pke=new d;nc.getPositionMinMax=function(e,t,n){let i=nc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return c(n)&&c(t)&&(r=d.add(r,t,Pke),o=d.add(o,n,Dke)),{min:r,max:o}};nc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===Fo.Y?n=F.clone(Fo.Y_UP_TO_Z_UP,n):e===Fo.X&&(n=F.clone(Fo.X_UP_TO_Z_UP,n)),t===Fo.Z&&(n=F.multiplyTransformation(n,Fo.Z_UP_TO_X_UP,n)),n};var Ike=new J;nc.getCullFace=function(e,t){if(!Me.isTriangles(t))return Ti.BACK;let n=F.getMatrix3(e,Ike);return J.determinant(n)<0?Ti.FRONT:Ti.BACK};nc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};nc.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};nc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!nc.supportedExtensions[i])throw new ae(`Unsupported glTF Extension: ${i}`)}};var $t=nc;function Ag(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),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=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Ag.prototype=Object.create($i.prototype),Ag.prototype.constructor=Ag);Object.defineProperties(Ag.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Ag.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,c(this._gltfJson)?(this._promise=Xie(this,this._gltfJson),this._promise):c(this._typedArray)?(this._promise=Kie(this,this._typedArray),this._promise):(this._promise=Oke(this),this._promise))};async function Oke(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;zj(e,n)}return Kie(e,t)}function zj(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function Rke(e,t){if(c(t.asset)&&t.asset.version==="2.0"&&!br(t,"KHR_techniques_webgl")&&!br(t,"KHR_materials_common"))return Promise.resolve();let n=[];Oe.buffer(t,function(i){if(!c(i.extras._pipeline.source)&&c(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),GN(t)}function Mke(e){let t=[];return Oe.buffer(e,function(n){let i=n.uri;!c(n.extras._pipeline.source)&&c(i)&&k_(i)&&(delete n.uri,t.push(we.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function Lke(e,t){let n=[];return Oe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(c(r)&&!c(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 Xie(e,t){try{ub(t),await Mke(t),await Rke(e,t),DN(t),await Lke(e,t),MN(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 c(i)&&$t.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;zj(e,n)}}async function Kie(e,t){let n;try{Wh(t)==="glTF"?n=ON(t):n=sr(t)}catch(i){if(e.isDestroyed())return;zj(e,i)}return Xie(e,n)}Ag.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};Ag.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var dv=Ag;var Nke={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Ip=Object.freeze(Nke);var To={};function Fke(){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 Bke(){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 kke(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function Uke(){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 Vke(){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 zke(){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 Hke(){this.attributes=[]}function Gke(){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 jke(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function Wke(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function qke(){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 Yke(){this.nodes=[]}var Xke={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function Kke(){this.input=[],this.interpolation=void 0,this.output=[]}function $ke(){this.node=void 0,this.path=void 0}function Zke(){this.sampler=void 0,this.target=void 0}function Qke(){this.name=void 0,this.samplers=[],this.channels=[]}function Jke(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function eUe(){this.name=void 0,this.stages=[]}function $ie(){this.credits=[]}function tUe(){this.asset=new $ie,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=F.clone(F.IDENTITY),this.extensions={}}function nUe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=J.clone(J.IDENTITY),this.scale=1,this.channels=void 0}function Cg(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Cg.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Cg.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Cg.DEFAULT_ROUGHNESS_FACTOR}Cg.DEFAULT_BASE_COLOR_FACTOR=se.ONE;Cg.DEFAULT_METALLIC_FACTOR=1;Cg.DEFAULT_ROUGHNESS_FACTOR=1;function fb(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(fb.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(fb.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=fb.DEFAULT_GLOSSINESS_FACTOR}fb.DEFAULT_DIFFUSE_FACTOR=se.ONE;fb.DEFAULT_SPECULAR_FACTOR=d.ONE;fb.DEFAULT_GLOSSINESS_FACTOR=1;function hv(){this.specularFactor=hv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(hv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}hv.DEFAULT_SPECULAR_FACTOR=1;hv.DEFAULT_SPECULAR_COLOR_FACTOR=d.ONE;function mv(){this.anisotropyStrength=mv.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=mv.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}mv.DEFAULT_ANISOTROPY_STRENGTH=0;mv.DEFAULT_ANISOTROPY_ROTATION=0;function pv(){this.clearcoatFactor=pv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=pv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}pv.DEFAULT_CLEARCOAT_FACTOR=0;pv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function Hj(){this.metallicRoughness=new Cg,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=d.clone(Hj.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Ip.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}Hj.DEFAULT_EMISSIVE_FACTOR=d.ZERO;To.Quantization=Fke;To.Attribute=Bke;To.Indices=kke;To.FeatureIdAttribute=Uke;To.FeatureIdTexture=zke;To.FeatureIdImplicitRange=Vke;To.MorphTarget=Hke;To.Primitive=Gke;To.Instances=jke;To.Skin=Wke;To.Node=qke;To.Scene=Yke;To.AnimatedPropertyType=Object.freeze(Xke);To.AnimationSampler=Kke;To.AnimationTarget=$ke;To.AnimationChannel=Zke;To.Animation=Qke;To.ArticulationStage=Jke;To.Articulation=eUe;To.Asset=$ie;To.Components=tUe;To.TextureReader=nUe;To.MetallicRoughness=Cg;To.SpecularGlossiness=fb;To.Specular=hv;To.Anisotropy=mv;To.Clearcoat=pv;To.Material=Hj;var An=To;var jN={};jN.getImageIdFromTexture=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.textureId",n),T.typeOf.object("options.supportedImageFormats",i);let o=t.textures[n],r=o.extensions;if(c(r)){if(i.webp&&c(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&c(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};jN.createSampler=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n);let o=gn.REPEAT,r=gn.REPEAT,s=Yt.LINEAR,a=ui.LINEAR,l=n.index,f=t.textures[l].sampler;if(c(f)){let h=t.samplers[f];o=h.wrapS??o,r=h.wrapT??r,s=h.minFilter??s,a=h.magFilter??a}return i&&s!==Yt.LINEAR&&s!==Yt.NEAREST&&(s===Yt.NEAREST_MIPMAP_NEAREST||s===Yt.NEAREST_MIPMAP_LINEAR?s=Yt.NEAREST:s=Yt.LINEAR),new Qt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var iUe=new z(1,1);jN.createModelTextureReader=function(e){e=e??W.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e;T.typeOf.object("options.textureInfo",t);let o=t.texCoord??0,r,s=t.extensions?.KHR_texture_transform;if(c(s)){o=s.texCoord??o;let l=c(s.offset)?z.unpack(s.offset):z.ZERO,u=s.rotation??0,f=c(s.scale)?z.unpack(s.scale):iUe;u=-u,r=new J(Math.cos(u)*f.x,-Math.sin(u)*f.y,l.x,Math.sin(u)*f.x,Math.cos(u)*f.y,l.y,0,0,1)}let a=new An.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var ru=jN;function oUe(e){let t=document.createElement("canvas");return t.width=O.nextPowerOfTwo(e.width),t.height=O.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var db=oUe;function Eg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,l=e.asynchronous??!0;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.textureInfo",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),T.typeOf.object("options.supportedImageFormats",s);let u=i.index,f=ru.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=l,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Eg.prototype=Object.create($i.prototype),Eg.prototype.constructor=Eg);Object.defineProperties(Eg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var rUe=new Gj;async function sUe(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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}Eg.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=sUe(this),this._promise)};function Gj(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}Gj.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};Gj.prototype.execute=function(){this.texture=Zie(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Zie(e,t,n,i,o,r){let s=i.internalFormat,a=!1;ke.isCompressedFormat(s)&&!c(o)&&(a=!0);let l=ru.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=l.minificationFilter,f=l.wrapS,h=l.wrapT,p=u===Yt.NEAREST_MIPMAP_NEAREST||u===Yt.NEAREST_MIPMAP_LINEAR||u===Yt.LINEAR_MIPMAP_NEAREST||u===Yt.LINEAR_MIPMAP_LINEAR,g=!c(s)&&p,m=g||f===gn.REPEAT||f===gn.MIRRORED_REPEAT||h===gn.REPEAT||h===gn.MIRRORED_REPEAT,y=!O.isPowerOfTwo(i.width)||!O.isPowerOfTwo(i.height),b=m&&y,x;return c(s)?(!r.webgl2&&ke.isCompressedFormat(s)&&y&&m&&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."),x=Rt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:l})):(b&&(i=db(i)),x=Rt.create({id:n,context:r,source:i,sampler:l,flipY:!1,skipColorSpaceConversion:!0})),g&&x.generateMipmap(),x}Eg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||c(this._texture)||!c(this._image))return!1;this._state=gt.PROCESSING;let t;if(this._asynchronous){let n=rUe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,wa.TEXTURE))return;t=n.texture}else t=Zie(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Eg.prototype.unload=function(){c(this._texture)&&this._texture.destroy(),c(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 _v=Eg;function Sg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,l=e.attributeSemantic,u=e.accessorId,f=e.cacheKey,h=e.asynchronous??!0,p=e.loadBuffer??!1,g=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),!p&&!g)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let m=c(r),y=c(s),b=Qie(a,l),x=c(l),A=c(u);if(m===b)throw new C("One of options.bufferViewId and options.draco must be defined.");if(b&&!x)throw new C("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!A)throw new C("When options.draco is defined options.accessorId must also be defined.");if(b&&!y)throw new C("When options.draco is defined options.primitive must also be defined.");b&&(T.typeOf.object("options.primitive",s),T.typeOf.object("options.draco",a),T.typeOf.string("options.attributeSemantic",l),T.typeOf.number("options.accessorId",u)),this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._attributeSemantic=l,this._accessorId=u,this._cacheKey=f,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=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Sg.prototype=Object.create($i.prototype),Sg.prototype.constructor=Sg);Object.defineProperties(Sg.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 Qie(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Sg.prototype.load=async function(){return c(this._promise)?this._promise:Qie(this._draco,this._attributeSemantic)?(this._promise=cUe(this),this._promise):(this._promise=uUe(this),this._promise)};function aUe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new An.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=nn.VEC2,a.normalizationRange=r;else{let l=nn.getMathType(i);if(l===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=l.unpack(e.minValues),a.normalizationRange=l.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=l.unpack(u);let f=u.map(function(h){return h*s});a.quantizedVolumeStepSize=l.unpack(f)}}return a}async function cUe(e){e._state=gt.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=gt.LOADED,e)}catch{if(e.isDestroyed())return;jj(e)}}function lUe(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,l=o.array,u=o.data.quantization;c(u)&&(e._quantization=aUe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}async function uUe(e){e._state=gt.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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;jj(e,n)}}function jj(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}function Wj(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}Wj.prototype.set=function(e,t){this.typedArray=e,this.context=t};Wj.prototype.execute=function(){this.buffer=Jie(this.typedArray,this.context)};function Jie(e,t){let n=bt.createVertexBuffer({typedArray:e,context:t,usage:Be.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var fUe=new Wj;Sg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(c(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){jj(this,i)}lUe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=fUe;if(i.set(n,e.context),!e.jobScheduler.execute(i,wa.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Jie(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Sg.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 gv=Sg;function yv(e){e=e??W.EMPTY_OBJECT;let t=e.id;T.typeOf.string("options.id",t);let n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(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=We(e.extras,!0),this._extensions=We(e.extensions,!0)}yv.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.class;T.typeOf.string("options.id",t),T.typeOf.object("options.class",n);let i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=vp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new yv({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(yv.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}}});yv.BATCH_TABLE_CLASS_NAME="_batchTable";var Kh=yv;function WN(e){e=e??W.EMPTY_OBJECT;let t=e.value,n=e.name;T.typeOf.number("options.value",t),T.typeOf.string("options.name",n),this._value=t,this._name=n,this._description=e.description,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}WN.fromJson=function(e){return T.typeOf.object("value",e),new WN({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(WN.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 qN=WN;function YN(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.values;T.typeOf.string("options.id",t),T.defined("options.values",n);let i={},o={},r=n.length;for(let a=0;a<r;++a){let l=n[a];i[l.value]=l.name,o[l.name]=l.value}let s=e.valueType??Nt.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=We(e.extras,!0),this._extensions=We(e.extensions,!0)}YN.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.enum;T.typeOf.string("options.id",t),T.typeOf.object("options.enum",n);let i=n.values.map(function(o){return qN.fromJson(o)});return new YN({id:t,values:i,valueType:Nt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(YN.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 XN=YN;function KN(e){e=e??W.EMPTY_OBJECT;let t=e.classes??{},n=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=We(e.extras,!0),this._extensions=We(e.extensions,!0)}KN.fromJson=function(e){T.typeOf.object("schema",e);let t={};if(c(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=XN.fromJson({id:i,enum:e.enums[i]}));let n={};if(c(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Kh.fromJson({id:i,class:e.classes[i],enums:t}));return new KN({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(KN.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 pf=KN;function hb(e){e=e??W.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new C("One of options.schema and options.resource must be defined.");this._schema=c(t)?pf.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(hb.prototype=Object.create($i.prototype),hb.prototype.constructor=hb);Object.defineProperties(hb.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});hb.prototype.load=async function(){return c(this._promise)?this._promise:c(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=dUe(this),this._promise)};async function dUe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=pf.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}hb.prototype.unload=function(){this._schema=void 0};var bv=hb;var Cd={};function xA(e){return rp(e.url)}function $N(e){let{byteOffset:t,byteLength:n}=e;if(ri(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function hUe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function eoe(e,t){return`${xA(e)}-buffer-id-${t}`}function xv(e,t,n,i){if(c(e.uri)){let o=i.getDerivedResource({url:e.uri});return xA(o)}return eoe(n,t)}function qj(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],l=xv(a,s,n,i),u=$N(r);return`${l}-range-${u}`}function toe(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(c(s)){let p=i.getDerivedResource({url:s});return xA(p)}let a=e.bufferViews[r],l=a.buffer,u=e.buffers[l],f=xv(u,l,n,i),h=$N(a);return`${f}-range-${h}`}function mUe(e,t){let n=ru.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Cd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;if(c(t)===c(n))throw new C("One of options.schema and options.resource must be defined.");return c(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${xA(n)}`};Cd.getExternalBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{resource:t}=e;return T.typeOf.object("options.resource",t),`external-buffer:${xA(t)}`};Cd.getEmbeddedBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return T.typeOf.object("options.parentResource",t),T.typeOf.number("options.bufferId",n),`embedded-buffer:${eoe(t,n)}`};Cd.getGltfCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t}=e;return T.typeOf.object("options.gltfResource",t),`gltf:${xA(t)}`};Cd.getBufferViewCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.bufferViewId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ri(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let l=xv(a,s,i,o),u=$N(r);return`buffer-view:${l}-range-${u}`};Cd.getDracoCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return T.typeOf.object("options.gltf",t),T.typeOf.object("options.draco",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),`draco:${qj(t,n,i,o)}`};Cd.getVertexBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:l=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),T.typeOf.object("options.frameState",o);let h=c(r),p=pUe(s,a),g=c(a);if(h===p)throw new C("One of options.bufferViewId and options.draco must be defined.");if(p&&!g)throw new C("When options.draco is defined options.attributeSemantic must also be defined.");if(p&&(T.typeOf.object("options.draco",s),T.typeOf.string("options.attributeSemantic",a)),!u&&!f)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let m="";if(l&&(m+="-dequantize"),u&&(m+="-buffer",m+=`-context-${o.context.id}`),f&&(m+="-typed-array"),c(s))return`vertex-buffer:${qj(t,s,n,i)}-draco-${a}${m}`;let y=t.bufferViews[r],b=y.buffer,x=t.buffers[b],A=xv(x,b,n,i),E=$N(y);return`vertex-buffer:${A}-range-${E}${m}`};function pUe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Cd.getIndexBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:l=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.number("options.accessorId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.frameState",r),!a&&!l)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),l&&(u+="-typed-array"),c(s))return`index-buffer:${qj(t,s,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],g=p.buffer,m=t.buffers[g],y=xv(m,g,i,o),b=hUe(f,p);return`index-buffer:${y}-accessor-${b}${u}`};Cd.getImageCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return T.typeOf.object("options.gltf",t),T.typeOf.number("options.imageId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),`image:${toe(t,n,i,o)}`};Cd.getTextureCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s);let a=n.index,l=ru.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=toe(t,l,i,o),f=mUe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var su=Cd;function Tv(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}Tv.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};Tv.prototype.addGeometryLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;c(n)&&(o+=n.sizeInBytes),c(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};Tv.prototype.addTextureLoader=function(e){T.typeOf.object("loader",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};Tv.prototype.removeLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],c(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],c(i)&&(this.texturesByteLength-=i)};var ZN=Tv;function Mn(){}Mn.cacheEntries={};Mn.statistics=new ZN;function _Ue(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Mn.get=function(e){T.typeOf.string("cacheKey",e);let t=Mn.cacheEntries[e];if(c(t))return++t.referenceCount,t.resourceLoader};Mn.add=function(e){T.typeOf.object("resourceLoader",e);let t=e.cacheKey;if(T.typeOf.string("options.resourceLoader.cacheKey",t),c(Mn.cacheEntries[t]))throw new C(`Resource with this cacheKey is already in the cache: ${t}`);return Mn.cacheEntries[t]=new _Ue(e),e};Mn.unload=function(e){T.typeOf.object("resourceLoader",e);let t=e.cacheKey,n=Mn.cacheEntries[t];if(!c(n))throw new C(`Resource is not in the cache: ${t}`);--n.referenceCount,n.referenceCount===0&&(Mn.statistics.removeLoader(e),e.destroy(),delete Mn.cacheEntries[t])};Mn.getSchemaLoader=function(e){e=e??W.EMPTY_OBJECT;let{schema:t,resource:n}=e;if(c(t)===c(n))throw new C("One of options.schema and options.resource must be defined.");let i=su.getSchemaCacheKey({schema:t,resource:n}),o=Mn.get(i);return c(o)?o:(o=new bv({schema:t,resource:n,cacheKey:i}),Mn.add(o))};Mn.getEmbeddedBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e;T.typeOf.object("options.parentResource",t),T.typeOf.number("options.bufferId",n);let o=su.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Mn.get(o);return c(r)?r:(T.typeOf.object("options.typedArray",i),r=new pA({typedArray:i,cacheKey:o}),Mn.add(r))};Mn.getExternalBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{resource:t}=e;T.typeOf.object("options.resource",t);let n=su.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return c(i)?i:(i=new pA({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e;T.typeOf.object("options.gltfResource",t),T.typeOf.object("options.baseResource",n);let r=su.getGltfCacheKey({gltfResource:t}),s=Mn.get(r);return c(s)?s:(s=new dv({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.bufferViewId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=su.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return c(s)?s:(s=new av({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getDracoLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.primitive",n),T.typeOf.object("options.draco",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let s=su.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Mn.get(s);return c(a)?a:(a=new cv({resourceCache:Mn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Mn.add(a))};Mn.getVertexBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:u,asynchronous:f=!0,dequantize:h=!1,loadBuffer:p=!1,loadTypedArray:g=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),T.typeOf.object("options.frameState",o),!p&&!g)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let m=c(r),y=c(s),b=gUe(a,l),x=c(l),A=c(u);if(m===b)throw new C("One of options.bufferViewId and options.draco must be defined.");if(b&&!x)throw new C("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!A)throw new C("When options.draco is defined options.haAccessorId must also be defined.");if(b&&!y)throw new C("When options.draco is defined options.primitive must also be defined.");b&&(T.typeOf.object("options.draco",a),T.typeOf.string("options.attributeSemantic",l),T.typeOf.number("options.accessorId",u));let E=su.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:l,dequantize:h,loadBuffer:p,loadTypedArray:g}),S=Mn.get(E);return c(S)?S:(S=new gv({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:u,cacheKey:E,asynchronous:f,dequantize:h,loadBuffer:p,loadTypedArray:g}),Mn.add(S))};function gUe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Mn.getIndexBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:l=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.number("options.accessorId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.frameState",r),!u&&!f)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let h=su.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:u,loadTypedArray:f}),p=Mn.get(h);return c(p)?p:(p=new uv({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:l,loadBuffer:u,loadTypedArray:f}),Mn.add(p))};Mn.getImageLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.imageId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=su.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return c(s)?s:(s=new lv({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getTextureLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s);let l=su.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Mn.get(l);return c(u)?u:(u=new _v({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:l,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[gv,uv,cv,_v,lv,av,pA,bv,dv],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),l=e.indexOf(s.resourceLoader.constructor);return a-l});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,c(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var Di=Mn;function ia(e,t,n){T.typeOf.object("resource",e),T.typeOf.object("implicitTileset",t),T.typeOf.object("implicitCoordinates",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(ia.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}}});ia.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ia.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ia.prototype.contentIsAvailableAtIndex=function(e,t){if(t=t??0,t<0||t>=this._contentAvailabilityBitstreams.length)throw new C("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)};ia.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ia.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ia.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ia.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ia.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===cr.OCTREE&&(t=3),e>>t};ia.fromSubtreeJson=async function(e,t,n,i,o){if(T.typeOf.object("resource",e),c(t)===c(n))throw new C("One of json and subtreeView must be defined.");T.typeOf.object("implicitTileset",i),T.typeOf.object("implicitCoordinates",o);let r=new ia(e,i,o),s;c(t)?s={json:t,binary:void 0}:s=yUe(n);let a=s.json;r._subtreeJson=a;let l;if(ri(a,"3DTILES_metadata"))l=a.extensions["3DTILES_metadata"];else if(c(a.tileMetadata)){let A=a.tileMetadata;l=a.propertyTables[A]}let u=[];if(c(a.contentMetadata)){let A=a.contentMetadata.length;for(let E=0;E<A;E++){let S=a.contentMetadata[E];u.push(a.propertyTables[S])}}let f,h=i.metadataSchema,p=a.subtreeMetadata;if(c(p)){let A=p.class,E=h.classes[A];f=new SN({subtreeMetadata:p,class:E})}r._metadata=f,r._tilePropertyTableJson=l,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ri(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=bUe(a.buffers),y=xUe(a.bufferViews,m);TUe(a,y),c(l)&&noe(l,y);for(let A=0;A<u.length;A++){let E=u[A];noe(E,y)}let b=await AUe(r,m,s.binary),x=EUe(y,b);return SUe(r,a,i,x),c(l)&&(wUe(r,i,x),DUe(r)),vUe(r,i,x),PUe(r),r._ready=!0,r};function yUe(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=sr(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function bUe(e){e=c(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=c(n.uri),n.isActive=!1}return e}function xUe(e,t){e=c(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 TUe(e,t){let n,i=e.tileAvailability;c(i.bitstream)?n=t[i.bitstream]:c(i.bufferView)&&(n=t[i.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,c(o[s].bitstream)?n=t[o[s].bitstream]:c(o[s].bufferView)&&(n=t[o[s].bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;c(r.bitstream)?n=t[r.bitstream]:c(r.bufferView)&&(n=t[r.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function noe(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=r.values??r.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=r.stringOffsets??r.stringOffsetBufferView;c(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let l=r.arrayOffsets??r.arrayOffsetBufferView;c(l)&&(i=t[l],i.isActive=!0,i.bufferHeader.isActive=!0)}}function AUe(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=CUe(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];c(a)&&(r[s]=a)}return r})}async function CUe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Di.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function EUe(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,l=t[o.buffer].subarray(r,s);n[i]=l}return n}function SUe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),l=ri(t,"3DTILES_metadata"),u=c(e._tilePropertyTableJson),f=l||u;e._tileAvailability=Yj(t.tileAvailability,i,s,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=Yj(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=Yj(t.childSubtreeAvailability,i,a)}function Yj(e,t,n,i){if(c(e.constant))return new ov({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return c(e.bitstream)?o=t[e.bitstream]:c(e.bufferView)&&(o=t[e.bufferView]),new ov({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function wUe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Td({class:a,count:o,properties:i.properties,bufferViews:n})}function vUe(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 l=i[a],f=o[a].availableCount,h=l.class,p=r.classes[h],g=new Td({class:p,count:f,properties:l.properties,bufferViews:n});s.push(g)}}function ioe(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 DUe(e){let t=ioe(e._tileAvailability);e._tileJumpBuffer=t}function PUe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=ioe(o);t.push(r)}}ia.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};ia.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 IUe(e,t){if(!c(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function OUe(e,t,n){let i=e._contentMetadataTables;if(!c(i))return;let o=i[n];if(!c(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ia.prototype.getTileMetadataView=function(e){let t=IUe(this,e);if(!c(t))return;let n=this._tileMetadataTable;return new rv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ia.prototype.getContentMetadataView=function(e,t){let n=OUe(this,e,t);if(!c(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new rv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ia.prototype.isDestroyed=function(){return!1};ia.prototype.destroy=function(){return c(this._bufferLoader)&&Di.unload(this._bufferLoader),de(this)};var TA=ia;var RUe={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"},AA=Object.freeze(RUe);var Ed={};Ed.parseAllBoundingVolumeSemantics=function(e){return T.typeOf.object("tileMetadata",e),{tile:{boundingVolume:Ed.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Ed._parseMinimumHeight("TILE",e),maximumHeight:Ed._parseMaximumHeight("TILE",e)},content:{boundingVolume:Ed.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Ed._parseMinimumHeight("CONTENT",e),maximumHeight:Ed._parseMaximumHeight("CONTENT",e)}}};Ed.parseBoundingVolumeSemantic=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new C("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(c(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(c(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(c(a))return{sphere:a}};Ed._parseMinimumHeight=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new C("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Ed._parseMaximumHeight=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new C("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var CA=Ed;function Fc(e,t,n){T.defined("tile.implicitTileset",t.implicitTileset),T.defined("tile.implicitCoordinates",t.implicitCoordinates);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(Fc.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(){throw new C("Implicit3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Fc.fromSubtreeJson=async function(e,t,n,i,o,r){if(T.defined("tile.implicitTileset",t.implicitTileset),T.defined("tile.implicitCoordinates",t.implicitCoordinates),c(i)===c(o))throw new C("One of json and arrayBuffer must be defined.");r=r??0;let s;c(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,l=t.implicitCoordinates,u=await TA.fromSubtreeJson(n,i,s,a,l),f=new Fc(e,t,n);return f._implicitSubtree=u,MUe(f,u),f._ready=!0,f};function MUe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=NUe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=LUe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let l=s[a],u=l.tile,f=jUe(e,u,l.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function LUe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(c(s))for(let a=0;a<o;a++){let l=r*o+a;t.childSubtreeIsAvailableAtIndex(l)&&i.push({tile:s,childIndex:a})}}return i}function NUe(e,t,n,i){let s=ooe(e,t,n,i,0,!0),a=e._tileset.statistics,l=[s],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),g=f.branchingFactor*l.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),x=l[b],A=m%f.branchingFactor,E=ooe(e,t,x,A,y);x.children.push(E),a.numberOfTilesTotal++,u.push(E)}l=u,u=[]}return{rootTile:s,bottomRow:l}}function roe(e,t,n){let i=AA.TILE_GEOMETRIC_ERROR;return c(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function ooe(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let l,u,f;if(c(t.tilePropertyTableJson)){l=t.getTileMetadataView(a);let P=CA.parseAllBoundingVolumeSemantics(l);u=P.tile,f=P.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let P=0;P<p;P++)if(t.contentIsAvailableAtCoordinates(a,P)){g=!0;break}let m=kUe(s,a,i,r,n,u),y=[];for(let P=0;P<s.contentCount;P++){if(!t.contentIsAvailableAtIndex(o,P))continue;let L={uri:s.contentUriTemplates[P].getDerivedResource({templateValues:a.getTemplateValues()}).url},B=UUe(m,f);c(B)&&(L.boundingVolume=B),y.push(xt(L,s.contentHeaders[P]))}let b=roe(l,s,a),x={boundingVolume:m,geometricError:b,refine:s.refine,contents:y},A=!0,E=We(s.tileHeader,A);delete E.boundingVolume,delete E.transform,delete E.metadata;let S=xt(x,E,A),v=uoe(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=l,v.hasImplicitContentMetadata=g,v}function QN(e,t){return c(e)&&c(t)&&(c(t.minimumHeight)||c(t.maximumHeight))&&(ri(e,"3DTILES_bounding_volume_S2")||c(e.region))}function Kj(e,t){c(t)&&(ri(e,"3DTILES_bounding_volume_S2")?BUe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):c(e.region)&&FUe(e.region,t.minimumHeight,t.maximumHeight))}function FUe(e,t,n){c(t)&&(e[4]=t),c(n)&&(e[5]=n)}function BUe(e,t,n){c(t)&&(e.minimumHeight=t),c(n)&&(e.maximumHeight=n)}function kUe(e,t,n,i,o,r){let s;return!c(r)||!c(r.boundingVolume)||!QN(r.boundingVolume,r)&&QN(e.boundingVolume,r)?s=soe(e,t,n,i??!1,o):s=r.boundingVolume,Kj(s,r),s}function UUe(e,t){let n;return c(t)&&(n=t.boundingVolume),QN(n,t)?Kj(n,t):QN(e,t)&&(n=We(e,!0),Kj(n,t)),n}function soe(e,t,n,i,o){let r=e.boundingVolume;return ri(r,"3DTILES_bounding_volume_S2")?aoe(i,o,n,t.level,t.x,t.y,t.z):c(r.region)?{region:loe(r.region,t.level,t.x,t.y,t.z)}:{box:coe(r.box,t.level,t.x,t.y,t.z)}}function aoe(e,t,n,i,o,r,s){T.typeOf.bool("parentIsPlaceholderTile",e),T.typeOf.object("parentTile",t),T.typeOf.number("childIndex",n),T.typeOf.number("level",i),T.typeOf.number("x",o),T.typeOf.number("y",r),c(s)&&T.typeOf.number("z",s);let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:_g.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let l=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=l%2===0?iv.encode2D(i,o,r):iv.encode2D(i,r,o),f=_g.fromFacePositionLevel(l,BigInt(u),i),h,p;if(c(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:_g.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var VUe=new d,zUe=new d,Xj=new d,HUe=new J;function coe(e,t,n,i,o){if(T.typeOf.object("rootBox",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e;let r=d.unpack(e,0,zUe),s=J.unpack(e,3,HUe),a=Math.pow(2,-t),l=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,VUe);c(o)&&(f=-1+(2*o+1)*a,h.z=a);let p=d.fromElements(l,u,f,Xj);p=J.multiplyByVector(s,p,Xj),p=d.add(p,r,Xj);let g=J.clone(s);g=J.multiplyByScale(g,h,g);let m=new Array(12);return d.pack(p,m),J.pack(g,m,3),m}var GUe=new ce;function loe(e,t,n,i,o){if(T.typeOf.object("rootRegion",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e.slice();let r=ce.unpack(e,0,GUe),s=e[4],a=e[5],l=Math.pow(2,-t),u=l*r.width,f=O.negativePiToPi(r.west+n*u),h=O.negativePiToPi(f+u),p=l*r.height,g=O.negativePiToPi(r.south+i*p),m=O.negativePiToPi(g+p),y=s,b=a;if(c(o)){let x=l*(a-s);y+=o*x,b=y+x}return[f,g,h,m,y,b]}function jUe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=soe(i,o,n,!1,t),s=roe(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,l={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=uoe(e,i.baseResource,l,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function uoe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Fc.prototype.hasProperty=function(e,t){return!1};Fc.prototype.getFeature=function(e){};Fc.prototype.applyDebugSettings=function(e,t){};Fc.prototype.applyStyle=function(e){};Fc.prototype.update=function(e,t){};Fc.prototype.pick=function(e,t,n){};Fc.prototype.isDestroyed=function(){return!1};Fc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),de(this)};Fc._deriveBoundingBox=coe;Fc._deriveBoundingRegion=loe;Fc._deriveBoundingVolumeS2=aoe;var Av=Fc;var WUe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},au=Object.freeze(WUe);function EA(e,t){T.typeOf.object("normal",e),T.typeOf.number("distance",t),this._distance=t,this._normal=new foe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(EA.prototype,{distance:{get:function(){return this._distance},set:function(e){T.typeOf.number("value",e),c(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){T.typeOf.object("value",e),c(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});EA.fromPlane=function(e,t){return T.typeOf.object("plane",e),c(t)?(t.normal=e.normal,t.distance=e.distance):t=new EA(e.normal,e.distance),t};EA.clone=function(e,t){return c(t)?(t.normal=e.normal,t.distance=e.distance,t):new EA(e.normal,e.distance)};function foe(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(foe.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){T.typeOf.number("value",e),c(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){T.typeOf.number("value",e),c(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){T.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var SA=EA;function ic(e){e=e??W.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.edgeColor=G.clone(e.edgeColor??G.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?_oe:goe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(c(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function _oe(e){return e===Wt.OUTSIDE}function goe(e){return e===Wt.INSIDE}Object.defineProperties(ic.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?_oe:goe)}},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 doe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}ic.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){doe(n,i)},e.index=t,doe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};ic.prototype.get=function(e){return T.typeOf.number("index",e),this._planes[e]};function yoe(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}ic.prototype.contains=function(e){return yoe(this._planes,e)!==-1};ic.prototype.remove=function(e){let t=this._planes,n=yoe(t,e);if(n===-1)return!1;e instanceof SA&&(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 SA&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};ic.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof SA&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var qUe=new se,YUe=new se;function hoe(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=Ln.octEncodeToCartesian4(a.normal,YUe);i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=l.w;let u=se.packFloat(a.distance,qUe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function moe(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=a.normal;i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=a.distance,r+=4}}function boe(e,t){let n=ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var XUe=new z;ic.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=ic.useFloatTexture(n),o=i?this.length:this.length*2;if(c(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(!c(t)){let s=boe(o,XUe);s.y*=2,i?(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.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?(moe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(hoe(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),moe(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),hoe(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 KUe=new F,poe=new sn(d.UNIT_X,0);ic.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;c(t)&&(o=F.multiply(t,o,KUe));let r=Wt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Wt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,o,poe);let l=e.intersectPlane(poe);if(l===Wt.INTERSECTING)r=l;else if(this._testIntersection(l))return l}return r};ic.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new C("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[n]=e}};ic.useFloatTexture=function(e){return e.floatingPointTexture};ic.getTextureResolution=function(e,t,n){let i=e.texture;if(c(i))return n.x=i.width,n.y=i.height,n;let o=ic.useFloatTexture(t)?e.length:e.length*2,r=boe(o,n);return r.y*=2,r};ic.prototype.isDestroyed=function(){return!1};ic.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),de(this)};var xs=ic;function Qj(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Toe(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,l,u;if(i&&(r=eVe(e,t,r,n)),e.length>80*n){a=1/0,l=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<l&&(l=m),g>f&&(f=g),m>h&&(h=m)}u=Math.max(f-a,h-l),u=u!==0?32767/u:0}return Ev(r,s,n,a,l,u,0),s}function Toe(e,t,n,i,o){let r;if(o===fVe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=xoe(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=xoe(s/i|0,e[s],e[s+1],r);return r&&wA(r,r.next)&&(wv(r),r=r.next),r}function mb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(wA(n,n.next)||Nr(n.prev,n,n.next)===0)){if(wv(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Ev(e,t,n,i,o,r,s){if(!e)return;!s&&r&&rVe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(r?ZUe(e,i,o,r):$Ue(e)){t.push(l.i,e.i,u.i),wv(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=QUe(mb(e),t),Ev(e,t,n,i,o,r,2)):s===2&&JUe(e,t,n,i,o,r):Ev(mb(e),t,n,i,o,r,1);break}}}function $Ue(e){let t=e.prev,n=e,i=e.next;if(Nr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,l=n.y,u=i.y,f=Math.min(o,r,s),h=Math.min(a,l,u),p=Math.max(o,r,s),g=Math.max(a,l,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=g&&Cv(o,a,r,l,s,u,m.x,m.y)&&Nr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function ZUe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Nr(o,r,s)>=0)return!1;let a=o.x,l=r.x,u=s.x,f=o.y,h=r.y,p=s.y,g=Math.min(a,l,u),m=Math.min(f,h,p),y=Math.max(a,l,u),b=Math.max(f,h,p),x=$j(g,m,t,n,i),A=$j(y,b,t,n,i),E=e.prevZ,S=e.nextZ;for(;E&&E.z>=x&&S&&S.z<=A;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&Cv(a,f,l,h,u,p,E.x,E.y)&&Nr(E.prev,E,E.next)>=0||(E=E.prevZ,S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&Cv(a,f,l,h,u,p,S.x,S.y)&&Nr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;E&&E.z>=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&Cv(a,f,l,h,u,p,E.x,E.y)&&Nr(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;S&&S.z<=A;){if(S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&Cv(a,f,l,h,u,p,S.x,S.y)&&Nr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function QUe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!wA(i,o)&&Coe(i,n,n.next,o)&&Sv(i,o)&&Sv(o,i)&&(t.push(i.i,n.i,o.i),wv(n),wv(n.next),n=e=o),n=n.next}while(n!==e);return mb(n)}function JUe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&cVe(s,a)){let l=Eoe(s,a);s=mb(s,s.next),l=mb(l,l.next),Ev(s,t,n,i,o,r,0),Ev(l,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function eVe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,l=r<s-1?t[r+1]*i:e.length,u=Toe(e,a,l,i,!1);u===u.next&&(u.steiner=!0),o.push(aVe(u))}o.sort(tVe);for(let r=0;r<o.length;r++)n=nVe(o[r],n);return n}function tVe(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 nVe(e,t){let n=iVe(e,t);if(!n)return t;let i=Eoe(n,e);return mb(i,i.next),mb(n,n.next)}function iVe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(wA(e,n))return n;do{if(wA(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,l=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&Aoe(o<u?i:r,o,l,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);Sv(n,e)&&(h<f||h===f&&(n.x>s.x||n.x===s.x&&oVe(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function oVe(e,t){return Nr(e.prev,e,t.prev)<0&&Nr(t.next,e,e.next)<0}function rVe(e,t,n,i){let o=e;do o.z===0&&(o.z=$j(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,sVe(o)}function sVe(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 u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let l=n;for(;a>0||l>0&&s;)a!==0&&(l===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,l--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function $j(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 aVe(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 Aoe(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 Cv(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Aoe(e,t,n,i,o,r,s,a)}function cVe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!lVe(e,t)&&(Sv(e,t)&&Sv(t,e)&&uVe(e,t)&&(Nr(e.prev,e,t.prev)||Nr(e,t.prev,t))||wA(e,t)&&Nr(e.prev,e,e.next)>0&&Nr(t.prev,t,t.next)>0)}function Nr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function wA(e,t){return e.x===t.x&&e.y===t.y}function Coe(e,t,n,i){let o=eF(Nr(e,t,n)),r=eF(Nr(e,t,i)),s=eF(Nr(n,i,e)),a=eF(Nr(n,i,t));return!!(o!==r&&s!==a||o===0&&JN(e,n,t)||r===0&&JN(e,i,t)||s===0&&JN(n,e,i)||a===0&&JN(n,t,i))}function JN(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 eF(e){return e>0?1:e<0?-1:0}function lVe(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&&Coe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Sv(e,t){return Nr(e.prev,e,e.next)<0?Nr(e,t,e.next)>=0&&Nr(e,e.prev,t)>=0:Nr(e,t,e.prev)<0||Nr(e,e.next,t)<0}function uVe(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 Eoe(e,t){let n=Zj(e.i,e.x,e.y),i=Zj(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 xoe(e,t,n,i){let o=Zj(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 wv(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 Zj(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function fVe(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 dVe=new d,hVe=new d,wg={};wg.computeArea2D=function(e){T.defined("positions",e),T.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);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};wg.computeWindingOrder2D=function(e){return wg.computeArea2D(e)>0?ts.COUNTER_CLOCKWISE:ts.CLOCKWISE};wg.triangulate=function(e,t){T.defined("positions",e);let n=z.packArray(e);return Qj(n,t,2)};var Doe=new d,Poe=new d,Ioe=new d,Soe=new d,woe=new d,voe=new d,Op=new d,Ooe=new z,Roe=new z,Moe=new z,vA=new z;wg.computeSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a<l;a++){let E=t[a];if(u[h++]=E.x,u[h++]=E.y,u[h++]=E.z,r){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,b=O.chordLength(o,y),x=b*b;for(;s.length>0;){let E=s.pop(),S=s.pop(),v=s.pop(),P=d.fromArray(u,v*3,Doe),M=d.fromArray(u,S*3,Poe),R=d.fromArray(u,E*3,Ioe),L,B,_;r&&(L=z.fromArray(f,v*2,Ooe),B=z.fromArray(f,S*2,Roe),_=z.fromArray(f,E*2,Moe));let w=d.multiplyByScalar(d.normalize(P,Soe),y,Soe),D=d.multiplyByScalar(d.normalize(M,woe),y,woe),I=d.multiplyByScalar(d.normalize(R,voe),y,voe),N=d.magnitudeSquared(d.subtract(w,D,Op)),k=d.magnitudeSquared(d.subtract(D,I,Op)),H=d.magnitudeSquared(d.subtract(I,w,Op)),V=Math.max(N,k,H),j,U,q;V>x?N===V?(j=`${Math.min(v,S)} ${Math.max(v,S)}`,a=m[j],c(a)||(U=d.add(P,M,Op),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=z.add(L,B,vA),z.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(v,a,E),s.push(a,S,E)):k===V?(j=`${Math.min(S,E)} ${Math.max(S,E)}`,a=m[j],c(a)||(U=d.add(M,R,Op),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=z.add(B,_,vA),z.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,v),s.push(a,E,v)):H===V&&(j=`${Math.min(E,v)} ${Math.max(E,v)}`,a=m[j],c(a)||(U=d.add(R,P,Op),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=z.add(_,L,vA),z.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(E,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(E))}let A={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(A.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(A)};var mVe=new he,pVe=new he,_Ve=new he,Jj=new he;wg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a<l;a++){let v=t[a];if(u[h++]=v.x,u[h++]=v.y,u[h++]=v.z,r){let P=i[a];f[p++]=P.x,f[p++]=P.y}}let g=[],m={},y=e.maximumRadius,b=O.chordLength(o,y),x=new Ja(void 0,void 0,e),A=new Ja(void 0,void 0,e),E=new Ja(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),P=s.pop(),M=s.pop(),R=d.fromArray(u,M*3,Doe),L=d.fromArray(u,P*3,Poe),B=d.fromArray(u,v*3,Ioe),_,w,D;r&&(_=z.fromArray(f,M*2,Ooe),w=z.fromArray(f,P*2,Roe),D=z.fromArray(f,v*2,Moe));let I=e.cartesianToCartographic(R,mVe),N=e.cartesianToCartographic(L,pVe),k=e.cartesianToCartographic(B,_Ve);x.setEndPoints(I,N);let H=x.surfaceDistance;A.setEndPoints(N,k);let V=A.surfaceDistance;E.setEndPoints(k,I);let j=E.surfaceDistance,U=Math.max(H,V,j),q,X,te,K,Z;U>b?H===U?(q=`${Math.min(M,P)} ${Math.max(M,P)}`,a=m[q],c(a)||(X=x.interpolateUsingFraction(.5,Jj),te=(I.height+N.height)*.5,K=d.fromRadians(X.longitude,X.latitude,te,e,Op),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=z.add(_,w,vA),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(M,a,v),s.push(a,P,v)):V===U?(q=`${Math.min(P,v)} ${Math.max(P,v)}`,a=m[q],c(a)||(X=A.interpolateUsingFraction(.5,Jj),te=(N.height+k.height)*.5,K=d.fromRadians(X.longitude,X.latitude,te,e,Op),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=z.add(w,D,vA),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(P,a,M),s.push(a,v,M)):j===U&&(q=`${Math.min(v,M)} ${Math.max(v,M)}`,a=m[q],c(a)||(X=E.interpolateUsingFraction(.5,Jj),te=(k.height+I.height)*.5,K=d.fromRadians(X.longitude,X.latitude,te,e,Op),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=z.add(D,_,vA),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(v,a,P),s.push(a,M,P)):(g.push(M),g.push(P),g.push(v))}let S={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(S.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(S)};wg.scaleToGeodeticHeight=function(e,t,n,i){n=n??ie.default;let o=dVe,r=hVe;if(t=t??0,i=i??!0,c(e)){let s=e.length;for(let a=0;a<s;a+=3)d.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var si=wg;function vg(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(vg.prototype,{length:{get:function(){return this._length}}});vg.prototype.enqueue=function(e){this._array.push(e),this._length++};vg.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};vg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};vg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};vg.prototype.clear=function(){this._array.length=this._offset=this._length=0};vg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var pb=vg;var qo={};qo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!c(o))continue;n+=2;let r=o.positions,s=o.holes;if(c(r)&&r.length>0&&(n+=r.length*t.packedLength),c(s)){let a=s.length;for(let l=0;l<a;++l)i.push(s[l])}}return n};qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!c(r))continue;let s=r.positions,a=r.holes;if(t[n++]=c(s)?s.length:0,t[n++]=c(a)?a.length:0,c(s)){let l=s.length;for(let u=0;u<l;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(c(a)){let l=a.length;for(let u=0;u<l;++u)o.push(a[u])}}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 _b=new z;function Foe(e,t,n,i){return z.subtract(t,e,_b),z.multiplyByScalar(_b,n/i,_b),z.add(e,_b,_b),[_b.x,_b.y]}var Dg=new d;function gVe(e,t,n,i){return d.subtract(t,e,Dg),d.multiplyByScalar(Dg,n/i,Dg),d.add(e,Dg,Dg),[Dg.x,Dg.y,Dg.z]}qo.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(O.log2(o)));return Math.pow(2,r)};var nF=new he,iF=new he,yVe=new he,bVe=new d,tF=new Ja;qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,nF),r=e.cartesianToCartographic(n,iF),a=new Ja(o,r,e).surfaceDistance/i,l=Math.max(0,Math.ceil(O.log2(a)));return Math.pow(2,l)};qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=qo.subdivideLineCount(n,i,o),a=z.distance(e,t),l=a/s,u=r;u.length=s*2;let f=0;for(let h=0;h<s;h++){let p=Foe(e,t,h*l,a);u[f++]=p[0],u[f++]=p[1]}return u};qo.subdivideLine=function(e,t,n,i){let o=qo.subdivideLineCount(e,t,n),r=d.distance(e,t),s=r/o;c(i)||(i=[]);let a=i;a.length=o*3;let l=0;for(let u=0;u<o;u++){let f=gVe(e,t,u*s,r);a[l++]=f[0],a[l++]=f[1],a[l++]=f[2]}return a};qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,nF),l=n.cartesianToCartographic(o,iF);tF.setEndPoints(a,l);let u=tF.surfaceDistance/r,f=Math.max(0,Math.ceil(O.log2(u))),h=Math.pow(2,f),p=z.distance(e,t),g=p/h,m=s;m.length=h*2;let y=0;for(let b=0;b<h;b++){let x=Foe(e,t,b*g,p);m[y++]=x[0],m[y++]=x[1]}return m};qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,nF),s=e.cartesianToCartographic(n,iF),a=new Ja(r,s,e);if(c(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let l=a.surfaceDistance/i,u=Math.max(0,Math.ceil(O.log2(l))),f=Math.pow(2,u),h=a.surfaceDistance/f,p=o;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*h,yVe),b=e.cartographicToCartesian(y,bVe);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var xVe=new d,TVe=new d,AVe=new d,CVe=new d;qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??ie.default;let r=xVe,s=TVe,a=AVe,l=CVe;if(c(e)&&c(e.attributes)&&c(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,a),i.geodeticSurfaceNormal(a,r),l=i.scaleToGeodeticSurface(a,l),s=d.multiplyByScalar(r,n,s),s=d.add(l,s,s),u[h+f]=s.x,u[h+1+f]=s.y,u[h+2+f]=s.z,o&&(l=d.clone(a,l)),s=d.multiplyByScalar(r,t,s),s=d.add(l,s,s),u[h]=s.x,u[h+1]=s.y,u[h+2]=s.z}return e};qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new pb;o.enqueue(e);let r,s,a;for(;o.length!==0;){let l=o.dequeue(),u=l.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=xo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=l.holes?l.holes.length:0;for(r=0;r<f;r++){let h=l.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=xo(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(c(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(u)}return i};var EVe=new he;function SVe(e,t,n){let i=n.cartesianToCartographic(e,nF),o=n.cartesianToCartographic(t,iF);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;tF.setEndPoints(i,o);let r=tF.findIntersectionWithLatitude(0,EVe);if(!c(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>O.PI){let l=s;s=a,a=l}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function wVe(e,t,n,i){if(i===qt.RHUMB)return SVe(e,t,n);let o=Qn.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(c(o))return n.scaleToGeodeticSurface(o,o)}var vVe=new he;function DVe(e,t,n){let i=[],o,r,s,a,l,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=O.sign(o.z),a=O.sign(r.z);let f=h=>t.cartesianToCartographic(h,vVe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(l=wVe(o,r,t,n),++u,!c(l))continue;e.splice(u,0,l),i.push({position:u,type:s,visited:!1,next:a,theta:f(l)})}++u}return i}function Boe(e,t,n,i,o,r,s){let a=[],l=r,u=h=>p=>p.position===h,f=[];do{let h=n[l];a.push(h);let p=i.findIndex(u(l)),g=i[p];if(!c(g)){++l;continue}let{visited:m,type:y,next:b}=g;if(g.visited=!0,y===0){if(b===0){let S=i[p-(s?1:-1)];if(S?.position===l+1)S.visited=!0;else{++l;continue}}if(!m&&s&&b>0||r===l&&!s&&b<0){++l;continue}}if(!(s?y>=0:y<=0)){++l;continue}m||f.push(l);let A=p+(s?1:-1),E=i[A];if(!c(E)){++l;continue}l=E.position}while(l<n.length&&l>=0&&l!==r&&a.length<n.length);e.splice(t,o,a);for(let h of f)t=Boe(e,++t,n,i,0,h,!s);return t}qo.splitPolygonsOnEquator=function(e,t,n,i){c(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=DVe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let l=s[0].z>=0;o=Boe(i,o,s,a,1,0,l)}return i};qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],l=new pb;l.enqueue(e);let u=c(r);for(;l.length!==0;){let f=l.dequeue(),h=f.positions,p=f.holes,g,m;if(i)for(m=h.length,g=0;g<m;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=xo(h,d.equalsEpsilon,!0)),h.length<3)continue;let y=n(h);if(!c(y))continue;let b=[],x=si.computeWindingOrder2D(y);if(x===ts.CLOCKWISE&&(y.reverse(),h=h.slice().reverse()),u){u=!1;let P=[h];if(P=r(P,P),P.length>1){for(let M of P)l.enqueue(new ec(M,p));continue}}let A=h.slice(),E=c(p)?p.length:0,S=[],v;for(g=0;g<E;g++){let P=p[g],M=P.positions;if(i)for(m=M.length,v=0;v<m;++v)o.scaleToGeodeticSurface(M[v],M[v]);if(t||(M=xo(M,d.equalsEpsilon,!0)),M.length<3)continue;let R=n(M);if(!c(R))continue;x=si.computeWindingOrder2D(R),x===ts.CLOCKWISE&&(R.reverse(),M=M.slice().reverse()),S.push(M),b.push(A.length),A=A.concat(M),y=y.concat(R);let L=0;for(c(P.holes)&&(L=P.holes.length),v=0;v<L;v++)l.enqueue(P.holes[v])}s.push({outerRing:h,holes:S}),a.push({positions:A,positions2D:y,holes:b})}return{hierarchy:s,polygons:a}};var PVe=new z,IVe=new d,OVe=new Le,RVe=new J;qo.computeBoundingRectangle=function(e,t,n,i,o){let r=Le.fromAxisAngle(e,i,OVe),s=J.fromQuaternion(r,RVe),a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let g=d.clone(n[p],IVe);J.multiplyByVector(s,g,g);let m=t(g,PVe);c(m)&&(a=Math.min(a,m.x),l=Math.max(l,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=l-a,o.height=f-u,o};qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let l=t.positions,u=c(n),f=u?n.positions:void 0;if(o){let h=l.length,p=new Array(h*3),g=0;for(let b=0;b<h;b++){let x=l[b];p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}let m={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:z.packArray(f)}));let y=new ct(m);return r.normal?Nn.computeNormal(y):y}if(s===qt.GEODESIC)return si.computeSubdivision(e,l,a,f,i);if(s===qt.RHUMB)return si.computeRhumbLineSubdivision(e,l,a,f,i)};var Loe=[],Noe=[],MVe=new d,LVe=new d;qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,l,u,f,h,p,g,m,y=e.length,b=0,x=0,A=c(t),E=A?t.positions:void 0;if(o)for(a=y*3*2,s=new Array(a*2),A&&(m=y*2*2,g=new Array(m*2)),l=0;l<y;l++)u=e[l],f=e[(l+1)%y],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,A&&(h=E[l],p=E[(l+1)%y],g[x]=g[x+m]=h.x,++x,g[x]=g[x+m]=h.y,++x,g[x]=g[x+m]=p.x,++x,g[x]=g[x+m]=p.y,++x);else{let R=O.chordLength(i,n.maximumRadius),L=0;if(r===qt.GEODESIC)for(l=0;l<y;l++)L+=qo.subdivideLineCount(e[l],e[(l+1)%y],R);else if(r===qt.RHUMB)for(l=0;l<y;l++)L+=qo.subdivideRhumbLineCount(n,e[l],e[(l+1)%y],R);for(a=(L+y)*3,s=new Array(a*2),A&&(m=(L+y)*2,g=new Array(m*2)),l=0;l<y;l++){u=e[l],f=e[(l+1)%y];let B,_;A&&(h=E[l],p=E[(l+1)%y]),r===qt.GEODESIC?(B=qo.subdivideLine(u,f,R,Noe),A&&(_=qo.subdivideTexcoordLine(h,p,u,f,R,Loe))):r===qt.RHUMB&&(B=qo.subdivideRhumbLine(n,u,f,R,Noe),A&&(_=qo.subdivideTexcoordRhumbLine(h,p,n,u,f,R,Loe)));let w=B.length;for(let D=0;D<w;++D,++b)s[b]=B[D],s[b+a]=B[D];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,A){let D=_.length;for(let I=0;I<D;++I,++x)g[x]=_[I],g[x+m]=_[I];g[x]=p.x,g[x+m]=p.x,++x,g[x]=p.y,g[x+m]=p.y,++x}}}y=s.length;let S=Fe.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,l=0;l<y;l++){let R=l,L=R+1,B=R+y,_=B+1;u=d.fromArray(s,R*3,MVe),f=d.fromArray(s,L*3,LVe),!d.equalsEpsilon(u,f,O.EPSILON10,O.EPSILON10)&&(S[v++]=R,S[v++]=B,S[v++]=L,S[v++]=L,S[v++]=B,S[v++]=_)}let P={attributes:new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Me.TRIANGLES};return A&&(P.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:g})),new ct(P)};var zn=qo;function Fr(e,t){this.position=e,c(this.position)||(this.position=new z),this.tangentPlane=t,c(this.tangentPlane)||(this.tangentPlane=Fr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Fr.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=z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(O.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=O.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=O.TWO_PI),e}}});var DA=new he,NVe=new d;Fr.prototype.getLatitude=function(e){c(e)||(e=ie.default),DA.latitude=this.conformalLatitude,DA.longitude=this.longitude,DA.height=0;let t=this.ellipsoid.cartographicToCartesian(DA,NVe);return e.cartesianToCartographic(t,DA),DA.latitude};var FVe=new _n,BVe=new d,kVe=new d;Fr.fromCartesian=function(e,t){T.defined("cartesian",e);let n=O.signNotZero(e.z),i=Fr.NORTH_POLE_TANGENT_PLANE,o=Fr.SOUTH_POLE;n<0&&(i=Fr.SOUTH_POLE_TANGENT_PLANE,o=Fr.NORTH_POLE);let r=FVe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,BVe),d.normalize(r.direction,r.direction);let s=Qn.rayPlane(r,i.plane,kVe),a=d.subtract(s,o,s),l=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return c(t)?(t.position=new z(l,u),t.tangentPlane=i,t):new Fr(new z(l,u),i)};Fr.fromCartesianArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Fr.fromCartesian(e[i],t[i]);return t};Fr.clone=function(e,t){if(c(e))return c(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Fr(e.position,e.tangentPlane)};Fr.HALF_UNIT_SPHERE=Object.freeze(new ie(.5,.5,.5));Fr.NORTH_POLE=Object.freeze(new d(0,0,.5));Fr.SOUTH_POLE=Object.freeze(new d(0,0,-.5));Fr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new is(Fr.NORTH_POLE,Fr.HALF_UNIT_SPHERE));Fr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new is(Fr.SOUTH_POLE,Fr.HALF_UNIT_SPHERE));var Bc=Fr;var UVe=new he,koe=new he;function VVe(e,t,n,i){let r=i.cartesianToCartographic(e,UVe).height,s=i.cartesianToCartographic(t,koe);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,koe);a.height=r-100,i.cartographicToCartesian(a,n)}var Uoe=new Ke,zVe=new d,HVe=new d,GVe=new d,jVe=new d,WVe=new d,qVe=new d,oF=new d,$h=new d,PA=new d,YVe=new z,XVe=new z,KVe=new d,Voe=new Le,$Ve=new J,ZVe=new J;function e9(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=c(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,l=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,b=YVe;b.x=f.x,b.y=f.y;let x=t.st?new Float32Array(2*(s/3)):void 0,A;t.normal&&(y&&l&&!a?A=n.attributes.normal.values:A=new Float32Array(s));let E=t.tangent?new Float32Array(s):void 0,S=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,P=0,M=0,R=HVe,L=GVe,B=jVe,_=!0,w=$Ve,D=ZVe;if(m!==0){let k=Le.fromAxisAngle(h,m,Voe);w=J.fromQuaternion(k,w),k=Le.fromAxisAngle(h,-m,Voe),D=J.fromQuaternion(k,D)}else w=J.clone(J.IDENTITY,w),D=J.clone(J.IDENTITY,D);let I=0,N=0;l&&u&&(I=s/2,N=s/3,s/=2);for(let k=0;k<s;k+=3){let H=d.fromArray(o,k,KVe);if(t.st&&!c(r)){let V=J.multiplyByVector(w,H,zVe);V=g.scaleToGeodeticSurface(V,V);let j=p([V],XVe)[0];z.subtract(j,b,j);let U=O.clamp(j.x/f.width,0,1),q=O.clamp(j.y/f.height,0,1);u&&(x[P+N]=U,x[P+1+N]=q),l&&(x[P]=U,x[P+1]=q),P+=2}if(t.normal||t.tangent||t.bitangent||i){let V=M+1,j=M+2;if(a){if(k+3<s){let U=d.fromArray(o,k+3,WVe);if(_){let q=d.fromArray(o,k+s,qVe);y&&VVe(H,U,q,g),d.subtract(U,H,U),d.subtract(q,H,q),R=d.normalize(d.cross(q,U,R),R),_=!1}d.equalsEpsilon(U,H,O.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(B=g.geodeticSurfaceNormal(H,B),t.tangent&&(L=d.normalize(d.cross(B,R,L),L)))}else R=g.geodeticSurfaceNormal(H,R),(t.tangent||t.bitangent)&&(y&&(oF=d.fromArray(A,M,oF),$h=d.cross(d.UNIT_Z,oF,$h),$h=d.normalize(J.multiplyByVector(D,$h,$h),$h),t.bitangent&&(PA=d.normalize(d.cross(oF,$h,PA),PA))),L=d.cross(d.UNIT_Z,R,L),L=d.normalize(J.multiplyByVector(D,L,L),L),t.bitangent&&(B=d.normalize(d.cross(R,L,B),B)));t.normal&&(e.wall?(A[M+I]=R.x,A[V+I]=R.y,A[j+I]=R.z):u&&(A[M+I]=-R.x,A[V+I]=-R.y,A[j+I]=-R.z),(l&&!y||a)&&(A[M]=R.x,A[V]=R.y,A[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(H,R)),v[M+I]=-R.x,v[V+I]=-R.y,v[j+I]=-R.z),t.tangent&&(e.wall?(E[M+I]=L.x,E[V+I]=L.y,E[j+I]=L.z):u&&(E[M+I]=-L.x,E[V+I]=-L.y,E[j+I]=-L.z),l&&(y?(E[M]=$h.x,E[V]=$h.y,E[j]=$h.z):(E[M]=L.x,E[V]=L.y,E[j]=L.z))),t.bitangent&&(u&&(S[M+I]=B.x,S[V+I]=B.y,S[j+I]=B.z),l&&(y?(S[M]=PA.x,S[V]=PA.y,S[j]=PA.z):(S[M]=B.x,S[V]=B.y,S[j]=B.z))),M+=3}}t.st&&!c(r)&&(n.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:S})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&c(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===Zt.TOP)l&&u||a?h=h.fill(1,0,f/2):l&&(h=h.fill(1));else{let p=e.offsetAttribute===Zt.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var zoe=[];function QVe(e,t,n,i,o,r,s,a,l,u){let f={walls:[]},h;if(s||a){let A=zn.createGeometryFromPositions(e,t,n,i,r,l,u),E=A.attributes.position.values,S=A.indices,v,P;if(s&&a){let M=E.concat(E);v=M.length/3,P=Fe.createTypedArray(v,S.length*2),P.set(S);let R=S.length,L=v/2;for(h=0;h<R;h+=3){let B=P[h]+L,_=P[h+1]+L,w=P[h+2]+L;P[h+R]=w,P[h+1+R]=_,P[h+2+R]=B}if(A.attributes.position.values=M,r&&l.normal){let B=A.attributes.normal.values;A.attributes.normal.values=new Float32Array(M.length),A.attributes.normal.values.set(B)}if(l.st&&c(n)){let B=A.attributes.st.values;A.attributes.st.values=new Float32Array(v*2),A.attributes.st.values=B.concat(B)}A.indices=P}else if(a){for(v=E.length/3,P=Fe.createTypedArray(v,S.length),h=0;h<S.length;h+=3)P[h]=S[h+2],P[h+1]=S[h+1],P[h+2]=S[h];A.indices=P}f.topAndBottom=new St({geometry:A})}let p=o.outerRing,g=is.fromPoints(p,e),m=g.projectPointsOntoPlane(p,zoe),y=si.computeWindingOrder2D(m);y===ts.CLOCKWISE&&(p=p.slice().reverse());let b=zn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new St({geometry:b}));let x=o.holes;for(h=0;h<x.length;h++){let A=x[h];m=g.projectPointsOntoPlane(A,zoe),y=si.computeWindingOrder2D(m),y===ts.COUNTER_CLOCKWISE&&(A=A.slice().reverse()),b=zn.computeWallGeometry(A,n,e,i,r,u),f.walls.push(new St({geometry:b}))}return f}function gf(e){if(T.typeOf.object("options",e),T.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),c(e.perPositionHeight)&&e.perPositionHeight&&c(e.height))throw new C("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new C("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.vertexFormat??Ie.DEFAULT,i=e.ellipsoid??ie.default,o=e.granularity??O.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,l=a&&c(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!l){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=Ie.clone(n),this._ellipsoid=ie.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=l,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??qt.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=zn.computeHierarchyPackedLength(t,d)+ie.packedLength+Ie.packedLength+(s?zn.computeHierarchyPackedLength(s,z):1)+12}gf.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);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 gf(t)};gf.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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++]=e._offsetAttribute??-1,t[n++]=e._arcType,c(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var JVe=ie.clone(ie.UNIT_SPHERE),eze=new Ie,tze={polygonHierarchy:{}};gf.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,JVe);t+=ie.packedLength;let r=Ie.unpack(e,t,eze);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],b=e[t++],x=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,z);c(x)?(t=x.startingIndex,delete x.startingIndex):t++;let A=e[t++];return c(n)||(n=new gf(tze)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=l,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=b,n._textureCoordinates=x,n.packedLength=A,n};var nze=new z,ize=new z,oze=new Bc;function Hoe(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+O.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 l=e.getLatitude(n),u=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),i!==qt.RHUMB){let p=z.subtract(t.position,e.position,nze),g=z.dot(t.position,p)/z.dot(p,p);if(g>0&&g<1){let m=z.add(t.position,z.multiplyByScalar(p,-g,p),ize),y=Bc.clone(t,oze);y.position=m;let b=y.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(l)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=z.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var Goe=new Bc,rze=new Bc,_f={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};gf.computeRectangleFromPositions=function(e,t,n,i){if(T.defined("positions",e),c(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,_f.northAngle=0,_f.southAngle=0,_f.westOverIdl=Number.POSITIVE_INFINITY,_f.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Bc.fromCartesian(e[0],rze);for(let s=1;s<o;s++){let a=Bc.fromCartesian(e[s],Goe);Hoe(a,r,t,n,_f,i),r=Bc.clone(a,r)}return Hoe(Bc.fromCartesian(e[0],Goe),r,t,n,_f,i),i.east-i.west>_f.eastOverIdl-_f.westOverIdl&&(i.west=_f.westOverIdl,i.east=_f.eastOverIdl,i.east>O.PI&&(i.east=i.east-O.TWO_PI),i.west>O.PI&&(i.west=i.west-O.TWO_PI)),O.equalsEpsilon(Math.abs(_f.northAngle),O.TWO_PI,O.EPSILON10)&&(i.north=O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),O.equalsEpsilon(Math.abs(_f.southAngle),O.TWO_PI,O.EPSILON10)&&(i.south=-O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),i};var sze=new Bc;function aze(e,t,n){return e.height>=O.PI||e.width>=O.PI?Bc.fromCartesian(t[0],sze).tangentPlane:is.fromPoints(t,n)}var joe=new he;function cze(e,t,n){return(i,o)=>{if(e.height>=O.PI||e.width>=O.PI){if(e.south<0&&e.north>0){c(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],joe);o[s]=new z(a.longitude/O.PI,a.latitude/O.PI_OVER_TWO)}return o.length=i.length,o}return Bc.fromCartesianArray(i,o)}return is.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function lze(e,t,n){if(e.height>=O.PI||e.width>=O.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,joe);return c(r)||(r=new z),r.x=s.longitude/O.PI,r.y=s.latitude/O.PI_OVER_TWO,r}return Bc.fromCartesian(o,r)};let i=is.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function uze(e,t,n,i){return(o,r)=>!i&&(e.height>=O.PI_OVER_TWO||e.width>=2*O.PI_OVER_THREE)?zn.splitPolygonsOnEquator(o,t,n,r):o}function fze(e,t,n,i){if(t.height>=O.PI||t.width>=O.PI)return Ke.fromRectangle(t,void 0,Uoe);let o=e,r=is.fromPoints(o,n);return zn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Uoe)}gf.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,l=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=c(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=zn.polygonsFromHierarchy(r,h,cze(g,p,n),!s,n,uze(g,n,u,s)),y=m.hierarchy,b=m.polygons,x=function(I){return I},A=h?zn.polygonsFromHierarchy(f,!0,x,!1,n).polygons:void 0;if(y.length===0)return;let E=y[0].outerRing,S=fze(E,g,n,o),v=[],P=e._height,M=e._extrudedHeight,R=e._perPositionHeightExtrude||!O.equalsEpsilon(P,M,0,O.EPSILON2),L={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:aze(g,E,n).plane.normal,projectTo2d:lze(g,E,n),boundingRectangle:S,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},B;if(R)for(L.extrude=!0,L.top=a,L.bottom=l,L.shadowVolume=e._shadowVolume,L.offsetAttribute=e._offsetAttribute,B=0;B<b.length;B++){let I=QVe(n,b[B],h?A[B]:void 0,i,y[B],s,a,l,t,u),N;a&&l?(N=I.topAndBottom,L.geometry=zn.scaleToGeodeticHeightExtruded(N.geometry,P,M,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,P,n,!s),L.geometry=N.geometry):l&&(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,M,n,!0),L.geometry=N.geometry),(a||l)&&(L.wall=!1,N.geometry=e9(L),v.push(N));let k=I.walls;L.wall=!0;for(let H=0;H<k.length;H++){let V=k[H];L.geometry=zn.scaleToGeodeticHeightExtruded(V.geometry,P,M,n,s),V.geometry=e9(L),v.push(V)}}else for(B=0;B<b.length;B++){let I=new St({geometry:zn.createGeometryFromPositions(n,b[B],h?A[B]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=si.scaleToGeodeticHeight(I.geometry.attributes.position.values,P,n,!s),L.geometry=I.geometry,I.geometry=e9(L),c(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,k=e._offsetAttribute===Zt.NONE?0:1,H=new Uint8Array(N/3).fill(k);I.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}v.push(I)}let _=Nn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Fe.createTypedArray(_.attributes.position.values.length/3,_.indices);let w=_.attributes,D=le.fromVertices(w.position.values);return t.position||delete w.position,new ct({attributes:w,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:D,offsetAttribute:e._offsetAttribute})};gf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new gf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function dze(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 ct._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(gf.prototype,{rectangle:{get:function(){if(!c(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=gf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=dze(this)),this._textureCoordinateRotationPoints}}});var Pg=gf;function gb(e){T.typeOf.object("options",e),T.typeOf.object("options.positions",e.positions),T.typeOf.number.greaterThanOrEquals("options.positions.length",e.positions.length,3),this._ellipsoid=e.ellipsoid??ie.default,this._positions=[...e.positions]}Object.defineProperties(gb.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});gb.clone=function(e,t){return T.typeOf.object("polygon",e),c(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new gb({positions:e.positions,ellipsoid:e.ellipsoid})};gb.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};gb.prototype.computeRectangle=function(e){return Pg.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var hze=new ce,Woe=new d;gb.prototype.computeSphericalExtents=function(e){c(e)||(e=new ce);let t=this.computeRectangle(hze),n=he.toCartesian(ce.southwest(t),this.ellipsoid,Woe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=O.fastApproximateAtan2(i,n.z),r=O.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ce.northeast(t),this.ellipsoid,Woe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=O.fastApproximateAtan2(i,n.z),r=O.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var vv=gb;var rF=`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; -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); -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; -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; -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); -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; -} -} -vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5; -out_FragColor = min(out_FragColor, result); -} -lastPolygonIndex += positionsLength; -} -} -`;function Yr(e){e=e??W.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new pe,this.polygonRemoved=new pe,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(c(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(Yr.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}}});Yr.prototype.add=function(e){T.typeOf.object("polygon",e);let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Yr.prototype.get=function(e){return T.typeOf.number("index",e),this._polygons[e]};Yr.prototype.contains=function(e){return T.typeOf.object("polygon",e),this._polygons.some(t=>vv.equals(t,e))};Yr.prototype.remove=function(e){T.typeOf.object("polygon",e);let t=this._polygons,n=t.findIndex(i=>vv.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var mze=new ce;function pze(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a);f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let g=t[p];if(c(g)&&c(ce.simpleIntersection(g,f))&&!ce.equals(g,f)){let m=n[p];h.push(...m),m.reduce((y,b)=>ce.union(e[b].computeSphericalExtents(mze),y,y),a),t[p]=void 0,n[p]=void 0,l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a,f),f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(h)}let o=new Map;return n.filter(c).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(c),extentsIndexByPolygon:o}}Yr.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 _ze(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=pze(i),s=0;for(let[l,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(l);for(let h=0;h<f;++h){let p=u.positions[h],g=Math.hypot(p.x,p.y),m=O.fastApproximateAtan2(g,p.z),y=O.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=y}}let a=0;for(let l of o){let u=1/(l.east-l.west),f=1/(l.north-l.south);n[a++]=l.south,n[a++]=l.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var t9=new z;Yr.prototype.update=function(e){let t=e.context;if(!Yr.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;c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(c(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!c(i)){let s=Yr.getTextureResolution(i,this.pixelsNeededForPolygonPositions,t9);i=new Rt({context:t,width:s.x,height:s.y,pixelFormat:ke.RG,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(c(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!c(o)){let s=Yr.getTextureResolution(o,this.pixelsNeededForExtents,t9);o=new Rt({context:t,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(_ze(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}}),!c(r)){let s=Yr.getClippingDistanceTextureResolution(this,t9);r=new Rt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?ke.RED:ke.LUMINANCE,pixelDatatype:Ue.FLOAT,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=gze(this)};Yr.prototype.queueCommands=function(e){c(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function gze(e){let t=e._polygonsTexture,n=e._extentsTexture;return new cl({fragmentShaderSource:rF,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 qoe=new ce,yze=new ce;Yr.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Wt.OUTSIDE;this.inverse&&(o=Wt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),l=e.rectangle;if(!c(l)&&c(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();l=ce.fromCartesianArray(f,t,qoe)}c(l)||(l=ce.fromBoundingSphere(e.boundingSphere,t,qoe));let u=ce.simpleIntersection(l,a,yze);c(u)&&(o=Wt.INTERSECTING)}return o};Yr.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new C("ClippingPolygonCollection should only be assigned to one object");e._owner=t,t[n]=e}};Yr.isSupported=function(e){return e?.context.webgl2};Yr.getTextureResolution=function(e,t,n){if(c(e))return n.x=e.width,n.y=e.height,n;let i=ut.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Yr.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return c(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(ut.maximumTextureSize,4096),t.y=Math.min(ut.maximumTextureSize,4096),t)};Yr.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return c(n)?(t.x=n.width,t.y=n.height,t):Yr.getTextureResolution(n,e.pixelsNeededForExtents,t)};Yr.prototype.isDestroyed=function(){return!1};Yr.prototype.destroy=function(){return c(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(),de(this)};var Zh=Yr;var Dv={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};Dv.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?Dv.SUNLIGHT:Dv.SCENE_LIGHT:Dv.NONE};var Ig=Object.freeze(Dv);function Yoe(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(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=Ig.NONE}Yoe.requiresColorCorrect=function(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))};var IA=Yoe;var Qh=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +`;let d=new Xe({sources:[a]}),p=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function HAe(e){let t=e?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:t,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:xc.LESS_OR_EQUAL},depthMask:!1}}var Ort={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:rn.PRE_MULTIPLIED_ALPHA_BLEND},Mrt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Nrt(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(HAe(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(HAe(!0)),e._rsColorPass=Ge.fromCache(Ort),e._rsPickPass=Ge.fromCache(Mrt))}var vx=new M,GAe=new h;function Lrt(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return M.clone(i,vx),M.multiplyByPoint(vx,e._center,GAe),M.setTranslation(vx,GAe,vx),M.multiply(r,vx,vx),vx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function OZ(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function Frt(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=OZ(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=OZ(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=OZ(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function MZ(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function Brt(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=MZ(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=MZ(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=MZ(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function krt(e,t){return t.color.toRgba()-e.color.toRgba()}function Urt(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(krt),t.webgl2?Brt(e,n):Frt(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function zrt(e,t){let n=Urt(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??M.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new at({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Ie.TERRAIN_CLASSIFICATION;let A=at.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new at({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Ie.TERRAIN_CLASSIFICATION;let x=at.shallowClone(b,b.derivedCommands.tileset);x.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function Vrt(e,t){if(e.classificationType===ti.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=at.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function jrt(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=e._modelMatrix??M.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new at({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=at.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new at({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let y=at.shallowClone(m,m.derivedCommands.tileset);y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}gg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new pa(e,o)}};gg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Hrt(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Grt=new z,Wrt=z.WHITE,qrt=!0,Yrt=/\$/;gg.prototype.applyStyle=function(e,t){if(!l(e)){Hrt(this,t);return}let n=e.color,i=n instanceof kh&&!Yrt.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,Grt):Wrt,c.show=l(e.show)?e.show.evaluate(c):qrt}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};gg.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(s>=y&&s<y+A)break}c.push(new pg({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<s?d.push(A):p.push(A)}p.length!==0&&c.push(new pg({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function WAe(e,t,n,i){let r=e.classificationType,o=r!==ti.CESIUM_3D_TILE,s=r!==ti.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function Xrt(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ie.OPAQUE,n.push(o)}}function Krt(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ge.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Oe.LINES):(n=e._rsColorPass,i=Oe.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}gg.prototype.update=function(e){let t=e.context;Drt(this,t),Rrt(this,t),Nrt(this),Lrt(this,t);let n=e.passes;n.render&&(zrt(this,t),Vrt(this,e),Krt(this),this._debugWireframe?Xrt(e,this._commands):WAe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(jrt(this),WAe(this,e,this._pickCommands))};gg.prototype.isDestroyed=function(){return!1};gg.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(),ue(this)};var Bv=gg;function Af(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=h.clone(this._boundingVolume.center):this._center=h.clone(h.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=ti.BOTH}Object.defineProperties(Af.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}}});Af.packedBoxLength=M.packedLength+h.packedLength;Af.packedCylinderLength=M.packedLength+2;Af.packedEllipsoidLength=M.packedLength+h.packedLength;Af.packedSphereLength=h.packedLength+1;function $rt(e){let t=new Float64Array(M.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,M.pack(e._modelMatrix,t,n),t}function Jrt(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[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 u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new pg({color:u,offset:f,count:d,batchIds:g})}return i}var Zrt=new $n("createVectorTileGeometries",5),Qrt=new z;function eot(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,Qrt);u[A]=b.toRgba()}f=e._packedBuffer=$rt(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.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)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=Zrt.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Jrt(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),tot(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function tot(e){l(e._primitive)||(e._primitive=new Bv({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: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)}Af.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Af.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Af.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Af.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Af.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=eot(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)};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var zy=Af;var NZ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,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,rot(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return qAe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){qAe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function not(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function iot(e,t){let n,i,r,o,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var Sx=Uint32Array.BYTES_PER_ELEMENT;function rot(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Sx;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=Sx;let s=r.getUint32(n,!0);if(n+=Sx,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Sx,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Sx;let u=r.getUint32(n,!0);n+=Sx;let f=r.getUint32(n,!0);n+=Sx;let d=Lo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Lo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,E=new wp(e,T,g,m,not(e));if(e._batchTable=E,T===0)return;let v=e.tile.computedTransform,S;l(d.RTC_CENTER)&&(S=h.unpack(d.RTC_CENTER),M.multiplyByPoint(v,S,S));let I=iot(d,p);if(y>0||A>0||b>0||x>0){let R,O,L,_;if(y>0){let C=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,C,zy.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,zy.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,zy.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,zy.packedSphereLength*x)}return e._geometries=new zy({boxes:R,boxBatchIds:I.boxes,cylinders:O,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:S,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function qAe(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}}var $U=NZ;var Vy={};Vy.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:Vy.parseBoundingVolumeSemantic(e,t),minimumHeight:Vy._parseMinimumHeight(e,t),maximumHeight:Vy._parseMaximumHeight(e,t)}};Vy.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Vy._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Vy._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var wx=Vy;var kv=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=o.getTemplateValues(),a=r.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,s){s=s??0;let a;l(o)&&(a=new Uint8Array(o,s));let c=n.implicitTileset,u=n.implicitCoordinates,f=await K_.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,oot(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)}};function oot(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=aot(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=sot(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=got(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function sot(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function aot(e,t,n,i){let s=YAe(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=YAe(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function XAe(e,t,n){let i=wh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function YAe(e,t,n,i,r,o){let s=e._implicitTileset,a;o??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=wx.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let v=0;v<d;v++)if(t.contentIsAvailableAtCoordinates(a,v)){p=!0;break}let g=uot(s,a,i,o,n,u),m=[];for(let v=0;v<s.contentCount;v++){if(!t.contentIsAvailableAtIndex(r,v))continue;let R={uri:s.contentUriTemplates[v].getDerivedResource({templateValues:a.getTemplateValues()}).url},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(a,v);O=wx.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=fot(g,O);l(L)&&(R.boundingVolume=L),m.push(Mt(R,s.contentHeaders[v]))}let y=XAe(c,s,a),A={boundingVolume:g,geometricError:y,refine:s.refine,contents:m},b=!0,x=Ze(s.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Mt(A,x,b),E=QAe(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function JU(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(or(e,"3DTILES_bounding_volume_S2")||l(e.region))}function FZ(e,t){l(t)&&(or(e,"3DTILES_bounding_volume_S2")?lot(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&cot(e.region,t.minimumHeight,t.maximumHeight))}function cot(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function lot(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function uot(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!JU(o.boundingVolume,o)&&JU(e.boundingVolume,o)?s=KAe(e,t,n,i??!1,r):s=o.boundingVolume,FZ(s,o),s}function fot(e,t){let n;return l(t)&&(n=t.boundingVolume),JU(n,t)?FZ(n,t):JU(e,t)&&(n=Ze(e,!0),FZ(n,t)),n}function KAe(e,t,n,i,r){let o=e.boundingVolume;return or(o,"3DTILES_bounding_volume_S2")?$Ae(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:ZAe(o.region,t.level,t.x,t.y,t.z)}:{box:JAe(o.box,t.level,t.x,t.y,t.z)}}function $Ae(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:by.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?uD.encode2D(i,r,o):uD.encode2D(i,o,r),f=by.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:by.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var dot=new h,hot=new h,LZ=new h,mot=new $;function JAe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,hot),s=$.unpack(e,3,mot),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,dot);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,LZ);p=$.multiplyByVector(s,p,LZ),p=h.add(p,o,LZ);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var pot=new ie;function ZAe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,pot),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=P.negativePiToPi(o.west+n*u),d=P.negativePiToPi(f+u),p=c*o.height,g=P.negativePiToPi(o.south+i*p),m=P.negativePiToPi(g+p),y=s,A=a;if(l(r)){let b=c*(a-s);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function got(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=KAe(i,r,n,!1,t),s=XAe(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=QAe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function QAe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}kv._deriveBoundingBox=JAe;kv._deriveBoundingRegion=ZAe;kv._deriveBoundingVolumeS2=$Ae;var h1=kv;var ebe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(ebe);var bf=ebe;function Uv(e,t){this._distance=t,this._normal=new tbe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(Uv.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)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});Uv.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new Uv(e.normal,e.distance),t};Uv.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new Uv(e.normal,e.distance)};function tbe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(tbe.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 ga=Uv;function tl(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?sbe:abe,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 r=0;r<i;++r)this.add(n[r])}}function sbe(e){return e===$t.OUTSIDE}function abe(e){return e===$t.INSIDE}Object.defineProperties(tl.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?sbe:abe)}},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 nbe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}tl.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){nbe(n,i)},e.index=t,nbe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};tl.prototype.get=function(e){return this._planes[e]};function cbe(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}tl.prototype.contains=function(e){return cbe(this._planes,e)!==-1};tl.prototype.remove=function(e){let t=this._planes,n=cbe(t,e);if(n===-1)return!1;e instanceof ga&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ga&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};tl.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ga&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var _ot=new se,yot=new se;function ibe(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=cn.octEncodeToCartesian4(a.normal,yot);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,_ot);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function rbe(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function lbe(e,t){let n=Ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var Aot=new U;tl.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=tl.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=lbe(r,Aot);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(rbe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(ibe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s,a;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),rbe(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),ibe(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var bot=new M,obe=new sn(h.UNIT_X,0);tl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=M.multiply(t,r,bot));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,r,obe);let c=e.intersectPlane(obe);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};tl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};tl.useFloatTexture=function(e){return e.floatingPointTexture};tl.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=tl.useFloatTexture(t)?e.length:e.length*2,o=lbe(r,n);return o.y*=2,o};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var Ns=tl;function zv(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=ZU(e.positions),this._holes=l(e.holes)?e.holes.map(ZU):[],this._rectangle=cg.computeRectangleFromPositions(this._positions,this._ellipsoid),BZ(this._positions),ube(this._holes)}function ZU(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function BZ(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function ube(e){for(let t=0;t<e.length;t++)BZ(e[t]);return Object.freeze(e)}function xot(e,t){if(!l(e)&&!l(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++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}function Tot(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!xot(e[n],t[n]))return!1;return!0}Object.defineProperties(zv.prototype,{length:{get:function(){let e=this._positions.length,t=this._holes;for(let n=0;n<t.length;n++)e+=t[n].length;return e}},positions:{get:function(){return this._positions}},holes:{get:function(){return this._holes}},ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}}});zv.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=ZU(e.positions),t._holes=e.holes.map(ZU),t._rectangle=cg.computeRectangleFromPositions(t._positions,t._ellipsoid),BZ(t._positions),ube(t._holes),t):new zv({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};zv.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&Tot(e.holes,t.holes)};zv.prototype.computeRectangle=function(e){return Xr("ClippingPolygon.computeRectangle","ClippingPolygon.computeRectangle is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Use the ClippingPolygon.rectangle property instead."),ie.clone(this._rectangle,e)};var m1=zv;var zZ=new Fo,kZ="ClippingPolygonCollection.quality is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",UZ="ClippingPolygonCollection.debugShowDistanceTexture is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",Eot="ClippingPolygonCollection.isDestroyed is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.",Cot="ClippingPolygonCollection.destroy is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.";function nl(e){e=e??H.EMPTY_OBJECT,this._polygons=[];let t=e.polygons??[],n=0,i=0;for(let r=0;r<t.length;++r)n+=t[r].length,i+=t[r].holes.length;this._dirty=!1,this._bufferPolygonCollection=new tc({show:!1,allowPicking:!1,primitiveCountMax:2*t.length,vertexCountMax:2*n,holeCountMax:i>0?2*i:0,triangleCountMax:0});for(let r=0;r<t.length;++r){let o=this._bufferPolygonCollection.primitiveCount;this._bufferPolygonCollection.add(dbe(t[r]),zZ),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&Xr("ClippingPolygonCollection.debugShowDistanceTexture",UZ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&Xr("ClippingPolygonCollection.quality",kZ),this._quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,this.ellipsoid=e.ellipsoid??ee.default,this._owner=void 0,this._vectorCollectionData=Ms.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(nl.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return Xr("ClippingPolygonCollection.debugShowDistanceTexture",UZ),this._debugShowDistanceTexture},set:function(e){Xr("ClippingPolygonCollection.debugShowDistanceTexture",UZ),this._debugShowDistanceTexture=e}},quality:{get:function(){return Xr("ClippingPolygonCollection.quality",kZ),this._quality},set:function(e){Xr("ClippingPolygonCollection.quality",kZ),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function dbe(e){let t=e.positions,n=e.holes,i=new Float64Array(e.length*3),r=0;for(let s=0;s<t.length;s++)h.pack(t[s],i,r*3),r++;if(n.length===0)return{positions:i,holes:void 0};let o=new Uint32Array(n.length);for(let s=0;s<n.length;s++){let a=n[s];o[s]=r;for(let c=0;c<a.length;c++)h.pack(a[c],i,r*3),r++}return{positions:i,holes:o}}function vot(e,t,n){let i=e._bufferPolygonCollection,r=i.primitiveCount+1,o=i.vertexCount+t,s=i.holeCount+n;if(r<=i.primitiveCountMax&&o<=i.vertexCountMax&&s<=i.holeCountMax)return i;let a=e._polygons.length!==i.primitiveCount,c=tc.fromCollection(i,{primitiveCountMax:P.nextPowerOfTwo(r),vertexCountMax:P.nextPowerOfTwo(o),holeCountMax:P.nextPowerOfTwo(s)},a?u=>u.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let u=e._polygons;for(let f=0;f<u.length;++f)u[f].bufferIndex=f}return c}function hbe(e,t){e._bufferPolygonCollection.get(t.bufferIndex,zZ).show=!1,t.bufferIndex=-1}nl.prototype.add=function(e){let t=this._polygons.length,n=vot(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(dbe(e),zZ),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};nl.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};nl.prototype.contains=function(e){return this._polygons.some(t=>m1.equals(t.clippingPolygon,e))};nl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>m1.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return hbe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};nl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];hbe(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};nl.prototype.update=function(e){if(!nl.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Ms.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var fbe=new ie,Sot=new ie;nl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=$t.OUTSIDE;this.inverse&&(r=$t.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let s=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(s,t,fbe)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,fbe));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,Sot);if(l(c))return $t.INTERSECTING}return r};nl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};nl.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Ms.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Ms.packPolygonGrid(n),Ms.packPolygonTextures(t,n)),n};nl.releaseRectangleData=function(e){Ms.freeResources(e)};nl.isSupported=function(e){return e?.context.webgl2};nl.prototype.isDestroyed=function(){return Xr("ClippingPolygonCollection.isDestroyed",Eot),!1};nl.prototype.destroy=function(){return Xr("ClippingPolygonCollection.destroy",Cot),ue(this)};var il=nl;var Vv={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};Vv.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?Vv.SUNLIGHT:Vv.SCENE_LIGHT:Vv.NONE};Object.freeze(Vv);var jy=Vv;function mbe(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(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=jy.NONE}mbe.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var jv=mbe;var Ip=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; uniform float u_atmosphereMieScaleHeight; @@ -3596,7 +4686,7 @@ vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; return vec4(color, opacity); } -`;var sF=`uniform samplerCube u_radianceMap; +`;var QU=`uniform samplerCube u_radianceMap; in vec2 v_textureCoordinates; const float twoSqrtPi = 2.0 * sqrt(czm_pi); float computeShBasis(int index, vec3 s) { @@ -3671,7 +4761,7 @@ vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); out_FragColor += Ylm * color * solidAngle * sinTheta; } } -`;var aF=`precision highp float; +`;var ez=`precision highp float; in vec2 v_textureCoordinates; uniform vec3 u_faceDirection; uniform vec3 u_positionWC; @@ -3750,7 +4840,7 @@ color.rgb = pow(color.rgb, vec3(gamma)); color.rgb = czm_gammaCorrect(color.rgb); out_FragColor = color; } -`;var cF=`precision highp float; +`;var tz=`precision highp float; in vec3 v_textureCoordinates; uniform float u_roughness; uniform samplerCube u_radianceTexture; @@ -3810,7 +4900,7 @@ weight += NdotL; } out_FragColor = color / weight; } -`;var lF=`in vec3 position; +`;var nz=`in vec3 position; out vec3 v_textureCoordinates; uniform vec3 u_faceDirection; vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { @@ -3830,7 +4920,7 @@ v_textureCoordinates.y = -v_textureCoordinates.y; v_textureCoordinates.z = -v_textureCoordinates.z; gl_Position = vec4(position, 1.0); } -`;function Kn(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=e??W.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(ut.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=Kn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let n=Math.pow(2,t-1);this._textureDimensions=new z(n,n),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??60*60,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Kn.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Kn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.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}}});Kn._maximumComputeCommandCount=8;Kn._activeComputeCommandCount=0;Kn._nextFrameCommandQueue=[];Kn._queueCommand=(e,t)=>{if(Kn._activeComputeCommandCount>=Kn._maximumComputeCommandCount){Kn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Kn._activeComputeCommandCount++};Kn._updateCommandQueue=e=>{if(Kn._maximumComputeCommandCount=Math.log2(ut.maximumCubeMapSize),Kn._nextFrameCommandQueue.length>0&&Kn._activeComputeCommandCount<Kn._maximumComputeCommandCount){let t=Kn._nextFrameCommandQueue.shift();for(;c(t)&&Kn._activeComputeCommandCount<Kn._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Kn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Kn._activeComputeCommandCount++,t=Kn._nextFrameCommandQueue.shift()}c(t)&&Kn._nextFrameCommandQueue.push(t)}};Kn.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new C("DynamicEnvironmentMapManager should only be assigned to one object");e._owner=t,t[n]=e}};Kn.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)c(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)c(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;c(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var bze=new d,xze=new d;function Tze(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,xze),s=1.025,a=bze,l=c(r)?d.magnitude(r):o.maximumRadius;return a.x=l*s,a.y=l,a.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Xoe=new d,Aze=new F,Cze=new se,Eze=new G;function Sze(e,t){let n=t.context,i=e._textureDimensions;if(c(e._radianceCubeMap)||(e._radianceCubeMap=new Go({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;c(o)||(o=new He({sources:[Qh,aF]}),e._radianceMapFS=o),IA.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(r,a,Aze),u=Cze;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of Go.faceNames()){let p=e._radianceMapTextures[f];c(p)&&!p.isDestroyed()&&p.destroy(),p=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new cl({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>l,u_faceDirection:()=>Go.getDirection(h,Xoe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Eze)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Kn._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let b=new Wr({context:n,colorTextures:[e._radianceMapTextures[g]]});b._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),b._unBind(),b.destroy(),Kn._activeComputeCommandCount--,y.some(c)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Kn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function wze(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,l=0,u=(h,p,g,m,y)=>()=>{if(e.isDestroyed()||h.canceled){Kn._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,g,m,y),l++,Kn._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let x=e._specularMapTextures.length;l>=x&&(e._irradianceCommandDirty=!0,n.sampler=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let h=1;h<i;++h){for(let p of Go.faceNames()){c(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let g=e._specularMapTextures[f]=new Rt({context:a,width:r,height:s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),m=e._va;c(m)||(m=Go.createVertexArray(a,p),e._va=m);let y=e._convolveSP;c(y)||(y=en.fromCache({context:a,vertexShaderSource:lF,fragmentShaderSource:cF,attributeLocations:{positions:0}}),e._convolveSP=y);let b=new cl({shaderProgram:y,vertexArray:m,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Go.getDirection(p,Xoe)}});b.postExecute=u(b,f,g,p,h),e._convolutionComputeCommands[f]=b,Kn._queueCommand(b,t),++f}r/=2,s/=2}}var Koe=new z(3,3);function vze(e,t){let n=t.context,i=Koe,o=e._irradianceMapTexture;c(o)&&!o.isDestroyed()&&o.destroy(),o=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;c(r)||(r=new He({sources:[sF]}),e._irradianceMapFS=r);let s=new cl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Kn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Kn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Kn._queueCommand(s,t),e._irradianceTextureDirty=!0}function Dze(e,t){let n=t.context;if(!c(e._irradianceMapTexture))return;let i=new Wr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Koe,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]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Kn.prototype.update=function(e){let t=e.mode;if(!Kn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!c(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}Kn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=Tze(this,e)||i===Ig.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&&(Sze(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(wze(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(vze(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Dze(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Kn.prototype.isDestroyed=function(){return!1};Kn.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(),c(this._va)&&this._va.destroy(),c(this._convolveSP)&&this._convolveSP.destroy(),de(this)};Kn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Kn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(G.fromCssColorString("#717145"));Kn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var Og=Kn;var Pv={HIGHLIGHT:0,REPLACE:1,MIX:2};Pv.getColorBlend=function(e,t){if(e===Pv.HIGHLIGHT)return 0;if(e===Pv.REPLACE)return 1;if(e===Pv.MIX)return O.clamp(t,O.EPSILON4,1)};var kc=Object.freeze(Pv);var Pze={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},Uc=Object.freeze(Pze);var Ize={STEP:0,LINEAR:1,CUBICSPLINE:2},Jh=Object.freeze(Ize);var $oe={};function Iv(e){T.typeOf.number.greaterThan("options.count",e.count,0),T.typeOf.object("options.properties",e.properties),this._count=e.count,this._properties=We(e.properties,!0)}Iv.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,$oe)};Iv.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,$oe,e)};Iv.prototype.getProperty=function(e,t){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new C(`index must be in the range [0, ${this._count})`);let n=this._properties[t];if(c(n))return We(n[e],!0)};Iv.prototype.setProperty=function(e,t,n){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new C(`index must be in the range [0, ${this._count})`);let i=this._properties[t];c(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=We(n,!0)};var Rg=Iv;function oc(e){e=e??W.EMPTY_OBJECT,T.typeOf.number("options.count",e.count),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(oc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(c(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 c(this._metadataTable)&&(e+=this._metadataTable.byteLength),c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});oc.prototype.hasProperty=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("propertyId",t),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(t)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};oc.prototype.hasPropertyBySemantic=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("semantic",t),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};oc.prototype.propertyExists=function(e){return T.typeOf.string("propertyId",e),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(e)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};oc.prototype.propertyExistsBySemantic=function(e){return T.typeOf.string("semantic",e),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var n9=[];oc.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,c(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(n9)),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n9)),c(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(n9)),t};oc.prototype.getProperty=function(e,t){let n;if(c(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),c(n))||c(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),c(n))||c(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),c(n)))return n};oc.prototype.setProperty=function(e,t,n){c(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(c(this._jsonMetadataTable)||(this._jsonMetadataTable=new Rg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};oc.prototype.getPropertyBySemantic=function(e,t){if(c(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};oc.prototype.setPropertyBySemantic=function(e,t,n){return c(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};oc.prototype.getPropertyTypedArray=function(e){if(T.typeOf.string("propertyId",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};oc.prototype.getPropertyTypedArrayBySemantic=function(e){if(T.typeOf.string("semantic",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};function i9(e,t){if(!c(e)||e<0||e>=t)throw new C(`featureId is required and must be between zero and featuresLength - 1 (${t}`-+").")}oc.prototype.isClass=function(e,t){i9(e,this.count),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};oc.prototype.isExactClass=function(e,t){return i9(e,this.count),T.typeOf.string("className",t),this.getExactClassName(e)===t};oc.prototype.getExactClassName=function(e){i9(e,this.count);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};var Cl=oc;function Ov(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),T.typeOf.object("options.textures",i);let o=c(t.channels)?t.channels:[0],r=t,s=ru.createModelTextureReader({textureInfo:r,channels:Mze(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,l=t.scale,u=n.hasValueTransform||c(a)||c(l);a=a??n.offset,l=l??n.scale,a=n.unpackVectorAndMatrixTypes(a),l=n.unpackVectorAndMatrixTypes(l),this._offset=a,this._scale=l,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ov.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}}});Ov.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(dt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(dt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==at.SCALAR?(dt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Nt.UINT8?(dt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:at.isVectorType(t)||t===at.SCALAR?n!==Nt.UINT8?(dt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(dt(`Property texture property ${e.id} has an unsupported type`),!1)};var Oze=[void 0,"float","vec2","vec3","vec4"],Rze=[void 0,"int","ivec2","ivec3","ivec4"];Ov.prototype.getGlslType=function(){let e=this._classProperty,t=at.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?Oze[t]:Rze[t]};Ov.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function Mze(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var uF=Ov;function o9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures;T.typeOf.object("options.propertyTexture",t),T.typeOf.object("options.class",n),T.typeOf.object("options.textures",i);let o=t.extensions,r=t.extras,s={};if(c(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new uF({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(o9.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}}});o9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var Mg=o9;function Zoe(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),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||c(i)||c(o);i=i??n.offset,o=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(Zoe.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 fF=Zoe;function r9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class;T.typeOf.object("options.propertyAttribute",t),T.typeOf.object("options.class",n);let i={};if(c(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new fF({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(r9.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}}});r9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var OA=r9;function Rv(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=c(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(Rv.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(!c(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}}});Rv.prototype.getPropertyTable=function(e){return T.typeOf.number("propertyTableId",e),this._propertyTables[e]};Rv.prototype.getPropertyTexture=function(e){return T.typeOf.number("propertyTextureId",e),this._propertyTextures[e]};Rv.prototype.getPropertyAttribute=function(e){return T.typeOf.number("propertyAttributeId",e),this._propertyAttributes[e]};var oa=Rv;function Lze(e){e=e??W.EMPTY_OBJECT;let t=e.extension,n=e.schema;T.typeOf.object("options.extension",t),T.typeOf.object("options.schema",n);let i=[];if(c(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],l=n.classes[a.class],u=new Td({count:a.count,properties:a.properties,class:l,bufferViews:e.bufferViews});i.push(new Cl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(c(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new Mg({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(c(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new OA({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new oa({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var dF=Lze;function Nze(e){e=e??W.EMPTY_OBJECT;let t=e.extension,n=e.schema;T.typeOf.object("options.extension",t),T.typeOf.object("options.schema",n);let i,o=[],r;if(c(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTables[a],u=n.classes[l.class],f=new Td({count:l.count,properties:l.properties,class:u,bufferViews:e.bufferViews});o.push(new Cl({id:a,count:l.count,metadataTable:f,extras:l.extras,extensions:l.extensions}))}let s=[];if(c(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTextures[a];s.push(new Mg({id:a,propertyTexture:Fze(l),class:n.classes[l.class],textures:e.textures}))}return new oa({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Fze(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:Bze(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=xt(o.texture,r,!0)}return t}function Bze(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 hF=Nze;function Lg(e){e=e??W.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:l,asynchronous:u=!0}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),T.typeOf.object("options.supportedImageFormats",s),T.typeOf.object("options.frameState",a),!c(e.extension)&&!c(e.extensionLegacy))throw new C("One of options.extension or options.extensionLegacy must be specified");this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=l,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Lg.prototype=Object.create($i.prototype),Lg.prototype.constructor=Lg);Object.defineProperties(Lg.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function kze(e){try{let t=Gze(e),n=Xze(e),i=Kze(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}Lg.prototype.load=function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=kze(this),this._promise)};function Uze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function Vze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function zze(e){let t=e.propertyTables,n={};if(c(t))for(let i=0;i<t.length;i++){let o=t[i];Uze(o.properties,n)}return n}function Hze(e){let t=e.featureTables,n={};if(c(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;c(r)&&Vze(r,n)}}return n}async function Gze(e){let t;c(e._extension)?t=zze(e._extension):t=Hze(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Di.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 jze(e){let t={},n=e.propertyTextures;if(c(n))for(let i=0;i<n.length;i++){let r=n[i].properties;c(r)&&Wze(r,t)}return t}function Wze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function qze(e){let t={},n=e.featureTextures;if(c(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;c(r)&&Yze(r,t)}}return t}function Yze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function Xze(e){let t;c(e._extension)?t=jze(e._extension):t=qze(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,l=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Di.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),l.push(f.load())}return Promise.all(l)}async function Kze(e){let t=e._extension??e._extensionLegacy,n;if(c(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Di.getSchemaLoader({resource:i})}else n=Di.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Lg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let l=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[l]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let l=this._textureIds[a],u=t[a];u.isDestroyed()||(s[l]=u.texture)}return c(this._extension)?this._structuralMetadata=dF({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=hF({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Qoe(this),this._state=gt.READY,!0};function Qoe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function $ze(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Lg.prototype.unload=function(){Qoe(this),$ze(this),c(this._schemaLoader)&&Di.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var mF=Lg;var RA={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};RA.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return RA.TRANSLATION;case"ROTATION":return RA.ROTATION;case"SCALE":return RA.SCALE;case"_FEATURE_ID":return RA.FEATURE_ID}};var rs=Object.freeze(RA);var Zze=65534,Qze=255;function pF(e){e=e??W.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;T.typeOf.object("options.triangleIndices",t),T.typeOf.object("options.outlineIndices",n),T.typeOf.number("options.originalVertexCount",i),this._triangleIndices=t,this._originalVertexCount=i,this._edges=new tre(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],Jze(this)}Object.defineProperties(pF.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function Jze(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 l=t[a],u=t[a+1],f=t[a+2],h=!1,p=h||n.hasEdge(l,u),g=h||n.hasEdge(u,f),m=h||n.hasEdge(f,l),y=Joe(i,l,u,f,p,g,m);for(;c(y);){let b=s[y];if(!c(b)){b=r+o.length;let x=y;for(;x>=r;)x=o[x-r];o.push(x),s[y]=b}b>Zze&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>Qze&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===l?(l=b,t[a]=b):y===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),y=Joe(i,l,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Joe(e,t,n,i,o,r,s){let a=s?1:0,l=o?1:0,u=0,f=s9(e,t,a,l,u);if(f===0)return t;let h=0,p=o?1:0,g=r?1:0,m=s9(e,n,h,p,g);if(m===0)return n;let y=s?1:0,b=0,x=r?1:0,A=s9(e,i,y,b,x);if(A===0)return i;let E=f&m&A,S,v,P;if(E&1)S=0,v=1,P=2;else if(E&2)S=0,P=1,v=2;else if(E&4)v=0,S=1,P=2;else if(E&8)v=0,P=1,S=2;else if(E&16)P=0,S=1,v=2;else if(E&32)P=0,v=1,S=2;else{let B=a9(f),_=a9(m),w=a9(A);return B<_&&B<w?t:_<w?n:i}let M=t*3;e[M+S]=a,e[M+v]=l,e[M+P]=u;let R=n*3;e[R+S]=h,e[R+v]=p,e[R+P]=g;let L=i*3;e[L+S]=y,e[L+v]=b,e[L+P]=x}function s9(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],l=e[r+2];return c(s)?(s===n&&a===i&&l===o)<<0|(s===n&&a===o&&l===i)<<1|(s===i&&a===n&&l===o)<<2|(s===i&&a===o&&l===n)<<3|(s===o&&a===n&&l===i)<<4|(s===o&&a===i&&l===n)<<5:63}function a9(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}pF.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 l=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[l+f]}return s};pF.createTexture=function(e){let t=e.cache.modelOutliningCache;if(c(t)||(t=e.cache.modelOutliningCache={}),c(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,ut.maximumTextureSize),i=n,o=ere(i),r=[];for(;i>1;)i>>=1,r.push(ere(i));let s=new Rt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ke.LUMINANCE,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ui.LINEAR})});return t.outlineTexture=s,s};function ere(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 tre(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)}}tre.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 MA=pF;function nre(e){T.typeOf.object("attribute",e),this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function e4e(e){T.typeOf.object("indices",e),this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function _F(e){T.typeOf.object("primitive",e),this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}_F.prototype.postProcess=function(e){this.needsOutlines&&(t4e(this),i4e(this,e))};function t4e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new MA({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Fe.fromTypedArray(n.typedArray);let r=n4e(o.outlineCoordinates),s=new nre(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,l=e.attributePlans.length;for(let u=0;u<l;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function n4e(e){let t=new An.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=$.FLOAT,t.type=nn.VEC3,t.normalized=!1,t.count=e.length/3,t}function i4e(e,t){o4e(e.attributePlans,t),c(e.indicesPlan)&&r4e(e.indicesPlan,t)}function o4e(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=bt.createVertexBuffer({typedArray:s,context:t,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function r4e(e,t){let n=e.indices;if(e.loadBuffer){let i=bt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Be.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}_F.AttributeLoadPlan=nre;_F.IndicesLoadPlan=e4e;var LA=_F;function s4e(e){e=e??W.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var gF=s4e;function ire(e){T.typeOf.object("options.position",e.position),T.typeOf.object("options.adjustmentParams",e.adjustmentParams),this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(ire.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var yF=ire;function ore(e){T.typeOf.object("options.position",e.position),T.typeOf.object("options.adjustmentParams",e.adjustmentParams),T.typeOf.object("options.covarianceMatrix",e.covarianceMatrix),this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(ore.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var bF=ore;function rre(e){T.typeOf.object("options.groupFlags",e.groupFlags),T.typeOf.object("options.rotationThetas",e.rotationThetas),T.typeOf.object("options.params",e.params),this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(rre.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var xF=rre;var a4e={Direct:"Direct",Indirect:"Indirect"},Rp=Object.freeze(a4e);function sre(e){if(T.typeOf.string("options.storageType",e.storageType),this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect,this.storageType===Rp.Indirect){if(!c(this.anchorPointsIndirect))throw new ae("The anchorPointsIndirect are required for 'Indirect' storage");if(!c(this.intraTileCorrelationGroups))throw new ae("The intraTileCorrelationGroups are required for 'Indirect' storage");if(c(this.anchorPointsDirect))throw new ae("The anchorPointsDirect must be omitted for 'Indirect' storage");if(c(this.covarianceDirect))throw new ae("The covarianceDirect must be omitted for 'Indirect' storage")}else{if(!c(this.anchorPointsDirect))throw new ae("The anchorPointsDirect are required for 'Direct' storage");if(!c(this.covarianceDirect))throw new ae("The covarianceDirect is required for 'Direct' storage");if(c(this.anchorPointsIndirect))throw new ae("The anchorPointsIndirect must be omitted for 'Direct' storage");if(c(this.intraTileCorrelationGroups))throw new ae("The intraTileCorrelationGroups must be omitted for 'Direct' storage")}}Object.defineProperties(sre.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 Mv=sre;function are(e){T.typeOf.number.greaterThan("options.A",e.A,0),T.typeOf.number.lessThanOrEquals("options.A",e.A,1),T.typeOf.number.greaterThanOrEquals("options.alpha",e.alpha,0),T.typeOf.number.lessThan("options.alpha",e.alpha,1),T.typeOf.number.greaterThanOrEquals("options.beta",e.beta,0),T.typeOf.number.lessThanOrEquals("options.beta",e.beta,10),T.typeOf.number.greaterThan("options.T",e.T,0),this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(are.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 TF=are;function NA(){}function cre(e){return new J(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function c4e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new yF({position:t,adjustmentParams:n})}function l4e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=cre(e.covarianceMatrix);return new bF({position:t,adjustmentParams:n,covarianceMatrix:i})}function u4e(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let s=new TF({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new xF({groupFlags:t,rotationThetas:n,params:i})}NA.load=function(e){T.typeOf.object("gltfGpmLocalJson",e);let t=e.storageType;if(t===Rp.Direct)return NA.loadDirect(e);if(t===Rp.Indirect)return NA.loadIndirect(e);throw new ae(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};NA.loadDirect=function(e){T.typeOf.object("gltfGpmLocalJson",e),T.typeOf.object("gltfGpmLocalJson.anchorPointsDirect",e.anchorPointsDirect),T.typeOf.object("gltfGpmLocalJson.covarianceDirectUpperTriangle",e.covarianceDirectUpperTriangle);let t=[],n=e.anchorPointsDirect;for(let r of n){let s=c4e(r);t.push(s)}let i=cre(e.covarianceDirectUpperTriangle);return new Mv({storageType:Rp.Direct,anchorPointsDirect:t,covarianceDirect:i})};NA.loadIndirect=function(e){T.typeOf.object("gltfGpmLocalJson",e),T.typeOf.object("gltfGpmLocalJson.anchorPointsIndirect",e.anchorPointsIndirect),T.typeOf.object("gltfGpmLocalJson.intraTileCorrelationGroups",e.intraTileCorrelationGroups);let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=l4e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=u4e(s);o.push(a)}return new Mv({storageType:Rp.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var AF=NA;function lre(e){T.typeOf.object("options.traits",e.traits),T.typeOf.number.greaterThanOrEquals("options.index",e.index,0),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(lre.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 CF=lre;function ure(e){T.typeOf.string("options.source",e.source),this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(ure.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var EF=ure;function fre(e){this._ppeTextures=e}Object.defineProperties(fre.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var SF=fre;function xr(e){e=e??W.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,l=e.asynchronous??!0;T.typeOf.object("options.gltf",t),T.typeOf.object("options.extension",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s),this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=l,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(xr.prototype=Object.create($i.prototype),xr.prototype.constructor=xr);Object.defineProperties(xr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});xr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};xr.prototype.load=function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function f4e(e){let t={},n=e.ppeTextures;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}xr.prototype._loadTextures=function(){let e;c(this._extension)&&(e=f4e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let l in e)if(e.hasOwnProperty(l)){let u=Di.getTextureLoader({gltf:t,textureInfo:e[l],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(l),a.push(u.load())}return Promise.all(a)};xr.ppeTexturesMetadataSchemaCache=new Map;xr._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}}}};xr._obtainPpeTexturesMetadataSchema=function(e){let n=xr._collectPpeTexturePropertyIdentifiers(e).toString(),i=xr.ppeTexturesMetadataSchemaCache.get(n);if(c(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${xr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let l=s[a],u=`ppeTexture_${a}`,f=xr._createPpeTextureClassJson(l,a);r.classes[u]=f}return i=pf.fromJson(r),xr.ppeTexturesMetadataSchemaCache.set(n,i),i};xr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=xr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};xr._convertToStructuralMetadata=function(e,t){let n=[],i=xr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],l=`ppeTexture_${s}`,f=a.traits.source,h=i.classes[l],p={class:l,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new Mg({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new oa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};xr.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],s=this._extension;if(c(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let h=f.traits,p=new EF({min:h.min,max:h.max,source:h.source}),g=new CF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let a=new SF(r);this._meshPrimitiveGpmLocal=a;let l=xr._convertToStructuralMetadata(a,o);return this._structuralMetadata=l,this._state=gt.READY,!0};xr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Di.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};xr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var wF=xr;var{Attribute:d4e,Indices:h4e,FeatureIdAttribute:dre,FeatureIdTexture:hre,FeatureIdImplicitRange:mre,MorphTarget:m4e,Primitive:p4e,Instances:_4e,Skin:g4e,Node:y4e,AnimatedPropertyType:b4e,AnimationSampler:x4e,AnimationTarget:T4e,AnimationChannel:A4e,Animation:C4e,ArticulationStage:E4e,Articulation:S4e,Asset:w4e,Scene:v4e,Components:D4e,MetallicRoughness:P4e,SpecularGlossiness:I4e,Specular:O4e,Anisotropy:c9,Clearcoat:l9,Material:R4e}=An,Do={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Sd(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Fo.Y,forwardAxis:a=Fo.Z,loadAttributesAsTypedArray:l=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:m=!1}=e;T.typeOf.object("options.gltfResource",t);let{baseResource:y=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=y,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Do.NOT_LOADED,this._textureState=Do.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}c(Object.create)&&(Sd.prototype=Object.create($i.prototype),Sd.prototype.constructor=Sd);Object.defineProperties(Sd.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return c(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function M4e(e){e._state=Do.LOADING,e._textureState=Do.LOADING;try{let t=Di.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=Do.LOADED,e._textureState=Do.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Do.FAILED,e._textureState=Do.FAILED,vF(e,t)}}async function L4e(e,t){zt.supportsWebP.initialized||await zt.supportsWebP.initialize(),e._supportedImageFormats=new gF({webp:zt.supportsWebP(),basis:t.context.supportsBasis});let n=B8e(e,t);return e._state=Do.PROCESSING,e._textureState=Do.PROCESSING,c(e._gltfJsonLoader)&&e._releaseGltfJson&&(Di.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Sd.prototype.load=async function(){return c(this._promise)?this._promise:(this._promise=M4e(this),this._promise)};function vF(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function N4e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&c(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(c(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(c(r)){let s=r.process(t);s&&(c(e._components.structuralMetadata)&&dt("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=Do.POST_PROCESSING)}function F4e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&B4e(e,o)}}function B4e(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;c(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let l=r[a];c(l.buffer)&&n.push(l.buffer)}let s=i.indices;c(s)&&c(s.buffer)&&n.push(s.buffer)}Sd.prototype._process=function(e){return this._state===Do.READY?!0:(this._state===Do.PROCESSING&&N4e(this,e),this._resourcesLoaded&&this._state===Do.POST_PROCESSING&&(F4e(this,e.context),this._state=Do.PROCESSED),this._resourcesLoaded&&this._state===Do.PROCESSED?(Cre(this),this._typedArray=void 0,this._state=Do.READY,!0):!1)};Sd.prototype._processTextures=function(e){if(this._textureState===Do.READY)return!0;if(this._textureState!==Do.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&c(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Do.READY,this._texturesLoaded=!0,!0):!1};Sd.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===Do.LOADED&&!c(this._loadResourcesPromise)&&(this._loadResourcesPromise=L4e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),c(this._processError)){this._state=Do.FAILED;let o=this._processError;this._processError=void 0,vF(this,o)}let t=this._textureErrors.pop();if(c(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Do.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Do.FAILED,vF(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Do.FAILED,vF(this,o)}return this._incrementallyLoadTextures?n:n&&i};function k4e(e,t,n,i,o,r,s,a){let l=e.gltfJson,f=l.accessors[t].bufferView;return Di.getVertexBufferLoader({gltf:l,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:f,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function U4e(e,t,n,i,o,r,s){return Di.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 V4e(e,t){let n=Di.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function pre(e,t,n){let i=t.byteOffset,o=ou(e,t),r=t.count,s=mf(t.type),a=t.componentType,l=$.getSizeInBytes(a),u=l*s,f=r*s;if(o===u)return n=new Uint8Array(n),$.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=$.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=Tg(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){m(p,i,s,l,g);for(let b=0;b<s;++b)h[y*s+b]=g[b];i+=o}return h}function z4e(e,t){let n=e.type;if(n===nn.SCALAR)return t.fill(0);let i=nn.getMathType(n);return t.fill(i.clone(i.ZERO))}function H4e(e,t,n,i){let o=e.type,r=e.count;if(o===nn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===nn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Le.unpack(t,s*4);else{let s=nn.getMathType(o),a=nn.getNumberOfComponents(o);for(let l=0;l<r;l++)n[l]=s.unpack(t,l*a)}return n}async function G4e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=pre(r,n,t.typedArray);i=i??!1,H4e(n,s,o,i)}function DF(e,t,n){let i=new Array(t.count),o=t.bufferView;if(c(o)){let r=V4e(e,o),s=G4e(e,r,t,n,i);return e._loaderPromises.push(s),i}return z4e(t,i)}function cu(e,t){if(c(t))return e===Number?t[0]:e.unpack(t)}function j4e(e){return e===Number?0:new e}function W4e(e){switch(e){case $.BYTE:return 127;case $.UNSIGNED_BYTE:return 255;case $.SHORT:return 32767;case $.UNSIGNED_SHORT:return 65535;default:return 1}}var q4e={VEC2:new z(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function Y4e(e,t){let n=W4e(e.componentDatatype),i=q4e[e.type],o=e.min;c(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;c(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function X4e(e,t,n){let i=e.decodeMatrix,o=cu(n,e.decodedMin),r=cu(n,e.decodedMax);c(o)&&c(r)&&(t.min=o,t.max=r);let s=new An.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 z(i[6],i[7]),s.quantizedVolumeStepSize=new z(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new d(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new d(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 K4e(e,t,n,i,o){let r=e.accessors[t],s=nn.getMathType(r.type),a=r.normalized??!1,l=new d4e;l.name=n,l.semantic=i,l.setIndex=o,l.constant=j4e(s),l.componentDatatype=r.componentType,l.normalized=a,l.count=r.count,l.type=r.type,l.min=cu(s,r.min),l.max=cu(s,r.max),l.byteOffset=r.byteOffset,l.byteStride=ou(e,r),ri(r,"WEB3D_quantized_attributes")&&X4e(r.extensions.WEB3D_quantized_attributes,l,s);let u=l.semantic===ht.POSITION||l.semantic===ht.NORMAL||l.semantic===ht.TANGENT||l.semantic===ht.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&Y4e(l,s),l}function _re(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var $4e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function u9(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=$4e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function Z4e(e){let t=e===ht.POSITION,n=e===ht.FEATURE_ID,i=e===ht.TEXCOORD;return t||n||i}function Q4e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=c(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=$.createArrayBufferView(o,t.typedArray.buffer)}}function J4e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=pre(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function gre(e,t,n,i,o,r,s,a){let l=e.gltfJson,u=l.accessors[t],f=u.bufferView,h=n.gltfSemantic,p=n.renamedSemantic,g=n.modelSemantic,m=c(g)?_re(p):void 0,b=K4e(l,t,h,g,m);if(!c(o)&&!c(f))return b;let x=k4e(e,t,h,i,o,r,s,a),A=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[A]=()=>{c(o)&&c(o.attributes)&&c(o.attributes[h])?Q4e(b,x,r,s):J4e(l,u,b,x,r,s)},b}function yre(e,t,n,i,o,r,s,a){let l=n.modelSemantic,u=l===ht.POSITION,f=l===ht.FEATURE_ID,h=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=u&&e._enablePick&&!a.context.webgl2,g=e._loadForClassification&&f,m=e._loadAttributesAsTypedArray,y=!m,b=m||h||p||g,E=gre(e,t,n,i,o,s?!1:y,s?!0:b,a),S=new LA.AttributeLoadPlan(E);return S.loadBuffer=y,S.loadTypedArray=b,S}function e8e(e,t,n,i,o){let r=e.gltfJson.accessors,s=c(n.ROTATION),a=c(n.TRANSLATION)&&c(r[n.TRANSLATION].min)&&c(r[n.TRANSLATION].max),l=u9(e,rs,i),u=l.modelSemantic,f=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,h=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return gre(e,t,l,void 0,void 0,m,p||h&&(!a||y||g),o)}function t8e(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],l=a.bufferView;if(!c(i)&&!c(l))return;let u=new h4e;u.count=a.count;let f=e._loadAttributesAsTypedArray,h=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,m=!f,y=f||h||p,A=U4e(e,t,n,i,r?!1:m,r?!0:y,s),E=e._geometryLoaders.length;e._geometryLoaders.push(A);let S=A.load();e._loaderPromises.push(S),e._geometryCallbacks[E]=()=>{u.indexDatatype=A.indexDatatype,u.buffer=A.buffer,u.typedArray=A.typedArray};let v=new LA.IndicesLoadPlan(u);return v.loadBuffer=m,v.loadTypedArray=y,v}function Vc(e,t,n,i){let o=e.gltfJson,r=ru.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!c(r))return;let s=Di.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=ru.createModelTextureReader({textureInfo:t}),l=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Do.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[l]=()=>{a.texture=s.texture,c(i)&&(a.texture.sampler=i)},a}function n8e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,l=new I4e;return c(i)&&(l.diffuseTexture=Vc(e,i,n)),c(o)&&(l.specularGlossinessTexture=Vc(e,o,n)),l.diffuseFactor=cu(se,r),l.specularFactor=cu(d,s),l.glossinessFactor=a,l}function i8e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,l=new P4e;return c(i)&&(l.baseColorTexture=Vc(e,i,n)),c(o)&&(l.metallicRoughnessTexture=Vc(e,o,n)),l.baseColorFactor=cu(se,r),l.metallicFactor=s,l.roughnessFactor=a,l}function o8e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new O4e;return c(o)&&(a.specularTexture=Vc(e,o,n)),c(s)&&(a.specularColorTexture=Vc(e,s,n)),a.specularFactor=i,a.specularColorFactor=cu(d,r),a}function r8e(e,t,n){let{anisotropyStrength:i=c9.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=c9.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new c9;return c(r)&&(s.anisotropyTexture=Vc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function s8e(e,t,n){let{clearcoatFactor:i=l9.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=l9.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,l=new l9;return c(o)&&(l.clearcoatTexture=Vc(e,o,n)),c(s)&&(l.clearcoatRoughnessTexture=Vc(e,s,n)),c(a)&&(l.clearcoatNormalTexture=Vc(e,a,n)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function a8e(e,t,n){let i=new R4e,o=t.extensions??W.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=c(o.KHR_materials_unlit),c(r)?i.specularGlossiness=n8e(e,r,n):(c(u)&&(i.metallicRoughness=i8e(e,u,n)),c(s)&&!i.unlit&&(i.specular=o8e(e,s,n)),c(a)&&!i.unlit&&(i.anisotropy=r8e(e,a,n)),c(l)&&!i.unlit&&(i.clearcoat=s8e(e,l,n))),c(t.emissiveTexture)&&(i.emissiveTexture=Vc(e,t.emissiveTexture,n)),c(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Vc(e,t.normalTexture,n)),c(t.occlusionTexture)&&(i.occlusionTexture=Vc(e,t.occlusionTexture,n)),i.emissiveFactor=cu(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function bre(e,t){let n=new dre;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 xre(e,t,n,i){let o=new dre,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=_re(r.attribute),o.positionalLabel=i,o}function Tre(e,t){let n=new mre;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 Are(e,t,n,i){let o=new mre,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function c8e(e,t,n,i){let o=new hre;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=Vc(e,r,n,Qt.NEAREST);let a=(c(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function l8e(e,t,n,i,o,r){let s=new hre,a=t.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Vc(e,l,i,Qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function u8e(e,t,n,i,o){let r=new m4e,s=void 0,a=void 0,l=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let f=t[u],h=u9(e,ht,u),p=yre(e,f,h,s,a,l,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function f8e(e,t,n,i){let o=new p4e,r=new LA(o);e._primitiveLoadPlans.push(r);let s=t.material;c(s)&&(o.material=a8e(e,e.gltfJson.materials[s],i));let a=t.extensions??W.EMPTY_OBJECT,l=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&c(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=d8e(e,u,r));let f=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(c(g))for(let v in g){if(!g.hasOwnProperty(v))continue;let P=g[v],M=u9(e,ht,v),R=M.modelSemantic;if(f&&!Z4e(R))continue;R===ht.FEATURE_ID&&(p=!0);let L=yre(e,P,M,t,h,n,l,i);r.attributePlans.push(L),o.attributes.push(L.attribute)}let m=t.targets;if(c(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(u8e(e,m[v],l,r,i));let y=t.indices;if(c(y)){let v=t8e(e,y,t,h,p,l,i);c(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,x=a.EXT_mesh_features,A=a.EXT_feature_metadata,E=c(A);c(x)?h8e(e,o,x,i):E&&m8e(e,o,A,i),c(b)?p8e(o,b):E&&_8e(e,o,A);let S=t.mode;if(f&&S!==Me.TRIANGLES)throw new ae("Only triangle meshes can be used for classification.");return o.primitiveType=S,o}function d8e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return DF(e,i,!1)}function h8e(e,t,n,i){let o;c(n)&&c(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,l;c(s.texture)?l=c8e(e,s,i,a):c(s.attribute)?l=bre(s,a):l=Tre(s,a),t.featureIds.push(l)}}function m8e(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(c(s))for(let l=0;l<s.length;++l){let u=s[l],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m;c(u.featureIds.attribute)?m=xre(u,h,p,g):m=Are(u,h,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(c(a))for(let l=0;l<a.length;++l){let u=a[l],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m=l8e(e,u,h,i,p,g);t.featureIds.push(m)}}function p8e(e,t){if(!c(t))return;let{propertyTextures:n,propertyAttributes:i}=t;c(n)&&(e.propertyTextureIds=n),c(i)&&(e.propertyAttributeIds=i)}function _8e(e,t,n){c(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function g8e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new _4e,r=i.attributes;if(c(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(e8e(e,f,r,u,n))}let s=i.extensions??W.EMPTY_OBJECT,a=t.EXT_instance_features,l=s.EXT_feature_metadata;return c(a)?y8e(o,a):c(l)&&b8e(e.gltfJson,o,l,e._sortedPropertyTableIds),o}function y8e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;c(o.attribute)?s=bre(o,r):s=Tre(o,r),e.featureIds.push(s)}}function b8e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(c(r))for(let s=0;s<r.length;++s){let a=r[s],l=a.featureTable,u=i.indexOf(l),f=o[l].count,h=`instanceFeatureId_${s}`,p;c(a.featureIds.attribute)?p=xre(a,u,f,h):p=Are(a,u,f,h),t.featureIds.push(p)}}function x8e(e,t,n){let i=new y4e;i.name=t.name,i.matrix=cu(F,t.matrix),i.translation=cu(d,t.translation),i.rotation=cu(Le,t.rotation),i.scale=cu(d,t.scale);let o=t.extensions??W.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(c(r)){if(e._loadForClassification)throw new ae("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=g8e(e,o,n)}c(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(c(a)){let l=e.gltfJson.meshes[a],u=l.primitives;for(let p=0;p<u.length;++p)i.primitives.push(f8e(e,u[p],c(i.instances),n));let f=t.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=c(f)?f.slice():new Array(h.length).fill(0)}return i}function T8e(e,t){let n=e.gltfJson.nodes;if(!c(n))return[];let i=n.map(function(o,r){let s=x8e(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(c(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function A8e(e,t,n){let i=new g4e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(c(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=DF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function C8e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!c(n))return[];let i=n.map(function(r,s){let a=A8e(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;c(s)&&(t[r].skin=i[s])}return i}async function E8e(e,t,n,i){let o=new mF({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 S8e(e,t,n,i){let o=new wF({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 w8e(e,t){let n=new x4e,i=e.gltfJson.accessors,o=i[t.input];n.input=DF(e,o);let r=t.interpolation;n.interpolation=Jh[r]??Jh.LINEAR;let s=i[t.output];return n.output=DF(e,s,!0),n}function v8e(e,t){let n=new T4e,i=e.node;if(!c(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=b4e[o],n}function D8e(e,t,n){let i=new A4e,o=e.sampler;return i.sampler=t[o],i.target=v8e(e.target,n),i}function P8e(e,t,n){let i=new C4e;i.name=t.name;let o=t.samplers.map(function(s,a){let l=w8e(e,s);return l.index=a,l}),r=t.channels.map(function(s){return D8e(s,o,n)});return i.samplers=o,i.channels=r,i}function I8e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!c(n)?[]:n.map(function(o,r){let s=P8e(e,o,t);return s.index=r,s})}function O8e(e){let t=new E4e;t.name=e.name;let n=e.type.toUpperCase();return t.type=Uc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function R8e(e){let t=new S4e;return t.name=e.name,t.stages=e.stages.map(O8e),t}function M8e(e){let n=(e.extensions??W.EMPTY_OBJECT).AGI_articulations?.articulations;return c(n)?n.map(R8e):[]}function L8e(e){let t;return c(e.scenes)&&c(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=c(t)?t:[],t}function N8e(e,t){let n=new v4e,i=L8e(e);return n.nodes=i.map(function(o){return t[o]}),n}var F8e=new d;function B8e(e,t){let n=e.gltfJson,i=n.extensions??W.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(c(r)){let A=r.featureTables,E=r.featureTextures,S=c(A)?A:[],v=c(E)?E:[];e._sortedPropertyTableIds=Object.keys(S).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=T8e(e,t),l=C8e(e,a),u=I8e(e,a),f=M8e(n),h=N8e(n,a),p=new D4e,g=new w4e,m=n.asset.copyright;if(c(m)){let A=m.split(";").map(function(E){return new At(E.trim())});g.credits=A}if(p.asset=g,p.scene=h,p.nodes=a,p.skins=l,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,c(s)){let A=d.fromArray(s.center,0,F8e);p.transform=F.fromTranslation(A,p.transform)}if(e._components=p,c(o)||c(r)){let A=E8e(e,o,r,t);e._loaderPromises.push(A)}let y=i.NGA_gpm_local;if(c(y)){let A=AF.load(y);e._components.extensions.NGA_gpm_local=A}let b=n.meshes;if(c(b))for(let A of b){let E=A.primitives;if(c(E))for(let S of E){let v=S.extensions;if(c(v)){let P=v.NGA_gpm_local;if(c(P)){let M=S8e(e,n,P,t);e._loaderPromises.push(M)}}}}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function k8e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._textureLoaders.length=0}function Cre(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._bufferViewLoaders.length=0}function U8e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._geometryLoaders.length=0}function V8e(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 z8e(e){c(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function H8e(e){c(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Sd.prototype.isUnloaded=function(){return this._state===Do.UNLOADED};Sd.prototype.unload=function(){c(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Di.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,k8e(this),Cre(this),U8e(this),V8e(this),z8e(this),H8e(this),this._components=void 0,this._typedArray=void 0,this._state=Do.UNLOADED};var em=Sd;var PF=`uniform sampler2D u_pointCloud_colorGBuffer; +`;function Ei(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=e??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Ut.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),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(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ei.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new U(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Ei.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ei.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.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}}});Ei._maximumComputeCommandCount=8;Ei._activeComputeCommandCount=0;Ei._nextFrameCommandQueue=[];Ei._queueCommand=(e,t)=>{if(Ei._activeComputeCommandCount>=Ei._maximumComputeCommandCount){Ei._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ei._activeComputeCommandCount++};Ei._updateCommandQueue=e=>{if(Ei._maximumComputeCommandCount=Math.log2(Ut.maximumCubeMapSize),Ei._nextFrameCommandQueue.length>0&&Ei._activeComputeCommandCount<Ei._maximumComputeCommandCount){let t=Ei._nextFrameCommandQueue.shift();for(;l(t)&&Ei._activeComputeCommandCount<Ei._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ei._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ei._activeComputeCommandCount++,t=Ei._nextFrameCommandQueue.shift()}l(t)&&Ei._nextFrameCommandQueue.push(t)}};Ei.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ei.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 wot=new h,Iot=new h;function Pot(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,Iot),s=1.025,a=wot,c=l(o)?h.magnitude(o):r.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var pbe=new h,Dot=new M,Rot=new se,Oot=new z;function Mot(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ls({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Xe({sources:[Ip,ez]}),e._radianceMapFS=r),jv.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(o,a,Dot),u=Rot;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of ls.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new $f({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ls.getDirection(d,pbe),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Oot)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ei._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new vs({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ei._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ei._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function Not(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,s=r.y/2,a=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ht({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ei._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ei._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of ls.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:a,width:o,height:s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA}),y=e._va;l(y)||(y=ls.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:nz,fragmentShaderSource:tz,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new $f({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ls.getDirection(g,pbe)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ei._queueCommand(b,t),++d}o/=2,s/=2}u()}var gbe=new U(3,3);function Lot(e,t){let n=t.context,i=gbe,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Xe({sources:[QU]}),e._irradianceMapFS=o);let s=new $f({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Ei._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ei._activeComputeCommandCount--},e._irradianceComputeCommand=s,Ei._queueCommand(s,t),e._irradianceTextureDirty=!0}function Fot(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new vs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=gbe,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(o,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ei.prototype.update=function(e){let t=e.mode;if(!(Ei.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ei._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=Pot(this,e)||i===jy.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Mot(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Not(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(Lot(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Fot(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ei.prototype.isDestroyed=function(){return!1};Ei.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(),ue(this)};Ei.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ei.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Ei.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var Hy=Ei;var Hv={HIGHLIGHT:0,REPLACE:1,MIX:2};Hv.getColorBlend=function(e,t){if(e===Hv.HIGHLIGHT)return 0;if(e===Hv.REPLACE)return 1;if(e===Hv.MIX)return P.clamp(t,P.EPSILON4,1)};Object.freeze(Hv);var Ul=Hv;var _be={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(_be);var Uh=_be;var ybe={};function p1(e){this._count=e.count,this._properties=Ze(e.properties,!0)}p1.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,ybe)};p1.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,ybe,e)};p1.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ze(n[e],!0)};p1.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ze(n,!0)};var Gy=p1;function Ec(e){e=e??H.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,this._texture=e.texture}Object.defineProperties(Ec.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}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},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}},texture:{get:function(){return this._texture}}});Ec.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))};Ec.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Ec.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))};Ec.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var VZ=[];Ec.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(VZ);Zn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,VZ);Zn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(VZ);Zn(t,n)}return t};Ec.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};Ec.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 Gy({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Ec.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Ec.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Ec.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Ec.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Ec.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Ec.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Ec.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Ec.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Ou=Ec;function Abe(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=uf.createModelTextureReader({textureInfo:o,channels:Bot(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Abe.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}}});function Bot(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var iz=Abe;function jZ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new iz({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=o,this._extensions=r}Object.defineProperties(jZ.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}}});jZ.prototype.getProperty=function(e){return this._properties[e]};var Wy=jZ;function bbe(e){e=e??H.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,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(bbe.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 rz=bbe;function HZ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new rz({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(HZ.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}}});HZ.prototype.getProperty=function(e){return this._properties[e]};var Gv=HZ;function Wv(e){e=e??H.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(Wv.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}}});Wv.prototype.getPropertyTable=function(e){return this._propertyTables[e]};Wv.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};Wv.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};Wv.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return ue(this)};var nc=Wv;function kot(e){e=e??H.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],u=Uot(a,e.bufferViews,c,e.context),f=new vh({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Ou({id:s,name:a.name,count:a.count,metadataTable:f,extras:a.extras,extensions:a.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new Wy({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new Gv({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new nc({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var g1=4;function Uot(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=zot(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let a=s.length;if(a===0)return;if(o>Ut.maximumTextureSize||a>Ut.maximumTextureSize){yt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Ut.maximumTextureSize}.`);return}let c=jot(s,o),u=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST});return Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:a,arrayBufferView:c}})}function zot(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(g1))continue;let c=e[s],u=l(c)?t[c.values]:Vot(a,i),f=u.length,d=a.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:a})}return r}function Vot(e,t){let n=e.noData,i=bt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),s=Lt.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Lt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*s,n[d][p])}return new Uint8Array(a)}function jot(e,t){let n=e.length,i=new Uint8Array(n*t*g1),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let s=e[o],a=s.classProperty,c=o*t*g1,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){Got(s,r,c);continue}Hot(s,i,c)}return i}function Hot(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let s=0;s<o;s++){let a=s*r,c=n+s*g1;t.set(i.subarray(a,a+r),c)}}function Got(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Lt.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Lt.getDataViewAccessors(u,o),d=Lt.getDataViewAccessors(t,s),p=Lt.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*g1,A=f.get(m);d.set(y,p(A))}}var oz=kot;function Wot(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new vh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Ou({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new Wy({id:a,propertyTexture:qot(c),class:n.classes[c.class],textures:e.textures}))}return new nc({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function qot(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:Yot(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Mt(r.texture,o,!0)}return t}function Yot(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 sz=Wot;var GZ=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=Xot(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);s[u]=d}}let a={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(a[u]=f.texture)}return l(this._extension)?this._structuralMetadata=oz({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=sz({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),xbe(this),this._state=Ct.READY,!0}unload(){xbe(this),sst(this),l(this._schemaLoader)&&Bi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function Xot(e){try{let t=Qot(e),n=rst(e),i=ost(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Ct.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load structural metadata",t)}}function Kot(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function $ot(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function Jot(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];Kot(r.properties,n)}return n}function Zot(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&$ot(o,n)}}return n}async function Qot(e){let t;l(e._extension)?t=Jot(e._extension):t=Zot(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Bi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function est(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&tst(o,t)}return t}function tst(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function nst(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&ist(o,t)}}return t}function ist(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function rst(e){let t;l(e._extension)?t=est(e._extension):t=nst(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Bi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function ost(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Bi.getSchemaLoader({resource:i})}else n=Bi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function xbe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function sst(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var az=GZ;var Ix={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};Ix.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return Ix.TRANSLATION;case"ROTATION":return Ix.ROTATION;case"SCALE":return Ix.SCALE;case"_FEATURE_ID":return Ix.FEATURE_ID}};Object.freeze(Ix);var Bo=Ix;var ast=65534,cst=255;function cz(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Cbe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],lst(this)}Object.defineProperties(cz.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function lst(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=Tbe(i,c,u,f,p,g,m);for(;l(y);){let A=s[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),s[y]=A}A>ast&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>cst&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[a]=A):y===u?(u=A,t[a+1]=A):(f=A,t[a+2]=A),y=Tbe(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Tbe(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=WZ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=WZ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=WZ(e,i,y,A,b);if(x===0)return i;let T=f&m&x,E,v,S;if(T&1)E=0,v=1,S=2;else if(T&2)E=0,S=1,v=2;else if(T&4)v=0,E=1,S=2;else if(T&8)v=0,S=1,E=2;else if(T&16)S=0,E=1,v=2;else if(T&32)S=0,v=1,E=2;else{let L=qZ(f),_=qZ(m),C=qZ(x);return L<_&&L<C?t:_<C?n:i}let I=t*3;e[I+E]=a,e[I+v]=c,e[I+S]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+S]=g;let O=i*3;e[O+E]=y,e[O+v]=A,e[O+S]=b}function WZ(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function qZ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}cz.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};cz.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,Ut.maximumTextureSize),i=n,r=Ebe(i),o=[];for(;i>1;)i>>=1,o.push(Ebe(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:$e.LUMINANCE,sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Jn.LINEAR})});return t.outlineTexture=s,s};function Ebe(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 Cbe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}Cbe.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var qv=cz;function vbe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function ust(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function lz(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}lz.prototype.postProcess=function(e){this.needsOutlines&&(fst(this),mst(this,e)),this.needsGaussianSplats&&hst(this,e)};function fst(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new qv({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=dst(r.outlineCoordinates),s=new vbe(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function dst(e){let t=new Cn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function hst(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function mst(e,t){pst(e.attributePlans,t),l(e.indicesPlan)&&gst(e.indicesPlan,t)}function pst(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=tt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function gst(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.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)}lz.AttributeLoadPlan=vbe;lz.IndicesLoadPlan=ust;var Yv=lz;function _st(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var uz=_st;function Sbe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Sbe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var fz=Sbe;function wbe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(wbe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var dz=wbe;function Ibe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Ibe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var hz=Ibe;var Pbe={Direct:"Direct",Indirect:"Indirect"};Object.freeze(Pbe);var Px=Pbe;function Dbe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Dbe.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 _1=Dbe;function Rbe(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Rbe.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 mz=Rbe;function Xv(){}function Obe(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function yst(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new fz({position:t,adjustmentParams:n})}function Ast(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Obe(e.covarianceMatrix);return new dz({position:t,adjustmentParams:n,covarianceMatrix:i})}function bst(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new mz({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new hz({groupFlags:t,rotationThetas:n,params:i})}Xv.load=function(e){let t=e.storageType;if(t===Px.Direct)return Xv.loadDirect(e);if(t===Px.Indirect)return Xv.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};Xv.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=yst(o);t.push(s)}let i=Obe(e.covarianceDirectUpperTriangle);return new _1({storageType:Px.Direct,anchorPointsDirect:t,covarianceDirect:i})};Xv.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=Ast(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=bst(s);r.push(a)}return new _1({storageType:Px.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var pz=Xv;function Mbe(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(Mbe.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 gz=Mbe;function Nbe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Nbe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var _z=Nbe;function Lbe(e){this._ppeTextures=e}Object.defineProperties(Lbe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var yz=Lbe;function Zo(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Ct.UNLOADED,this._promise=void 0}l(Object.create)&&(Zo.prototype=Object.create(sr.prototype),Zo.prototype.constructor=Zo);Object.defineProperties(Zo.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Zo.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Ct.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Ct.FAILED,this.getError("Failed to load GPM data",e)}};Zo.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=this._loadResources(this),this._promise)};function xst(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}Zo.prototype._loadTextures=function(){let e;l(this._extension)&&(e=xst(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Bi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};Zo.ppeTexturesMetadataSchemaCache=new Map;Zo._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};Zo._obtainPpeTexturesMetadataSchema=function(e){let n=Zo._collectPpeTexturePropertyIdentifiers(e).toString(),i=Zo.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${Zo.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=Zo._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=hu.fromJson(o),Zo.ppeTexturesMetadataSchemaCache.set(n,i),i};Zo._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=Zo._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};Zo._convertToStructuralMetadata=function(e,t){let n=[],i=Zo._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let s=0;s<r.length;s++){let a=r[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new Wy({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new nc({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Zo.prototype.process=function(e){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new _z({min:d.min,max:d.max,source:d.source}),g=new gz({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new yz(o);this._meshPrimitiveGpmLocal=a;let c=Zo._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Ct.READY,!0};Zo.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Bi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Zo.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var Az=Zo;function Tst(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Zn(r,i);for(let o of n.primitiveGroups){let s=o.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:o.indices};switch(a.mode){case te.TRIANGLE_FAN:case te.TRIANGLE_STRIP:case te.LINE_STRIP:case te.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==a.mode)return i;r[c]=void 0}r[s]=a}return r.filter(l)}var bz=Tst;var{Attribute:Est,Indices:Cst,FeatureIdAttribute:Bbe,FeatureIdTexture:kbe,FeatureIdImplicitRange:Ube,MorphTarget:vst,Primitive:Sst,Instances:wst,Skin:Ist,Node:Pst,AnimatedPropertyType:Dst,AnimationSampler:Rst,AnimationTarget:Ost,AnimationChannel:Mst,Animation:Nst,ArticulationStage:Lst,Articulation:Fst,Asset:Bst,Scene:kst,Components:Ust,MetallicRoughness:zst,SpecularGlossiness:Vst,Specular:jst,Anisotropy:YZ,Clearcoat:XZ,PlanarFill:Hst,LineStyle:Gst,Material:Wst,Vector:qst,Polygon:Yst}=Cn,io={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},KZ=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=Hi.Y,forwardAxis:c=Hi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=io.NOT_LOADED,this._textureState=io.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}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=Xst(this),this._promise)}_process(t){return this._state===io.READY?!0:(this._state===io.PROCESSING&&$st(this,t),this._resourcesLoaded&&this._state===io.POST_PROCESSING&&(Jst(this,t.context),this._state=io.PROCESSED),this._resourcesLoaded&&this._state===io.PROCESSED?(Fbe(this),this._typedArray=void 0,this._state=io.READY,!0):!1)}_processTextures(t){if(this._textureState===io.READY)return!0;if(this._textureState!==io.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=io.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===io.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Kst(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=io.FAILED;let o=this._processError;this._processError=void 0,xz(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===io.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=io.FAILED,xz(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=io.FAILED,xz(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===io.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Bi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,lct(this),Fbe(this),uct(this),fct(this),dct(this),hct(this),this._components=void 0,this._typedArray=void 0,this._state=io.UNLOADED}};async function Xst(e){e._state=io.LOADING,e._textureState=io.LOADING;try{let t=Bi.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=io.LOADED,e._textureState=io.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=io.FAILED,e._textureState=io.FAILED,xz(e,t)}}async function Kst(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new uz({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=cct(e,t);return e._state=io.PROCESSING,e._textureState=io.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Bi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function xz(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function $st(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 r=e._structuralMetadataLoader;if(l(r)){let s=r.process(t);s&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&s}let o=e._meshPrimitiveGpmLoader;if(l(o)){let s=o.process(t);s&&(l(e._components.structuralMetadata)&&yt("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=o.structuralMetadata),n=n&&s}n&&(e._state=io.POST_PROCESSING)}function Jst(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&Zst(e,r)}}function Zst(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let a=0;a<o.length;a++){let c=o[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function Qst(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Bi.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function eat(e,t,n,i,r,o,s){return Bi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function zbe(e,t){let n=Bi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function $Z(e,t,n){let i=t.byteOffset,r=lf(e,t),o=t.count,s=ad(t.type),a=t.componentType,c=Y.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=q_(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,s,c,g);for(let A=0;A<s;++A)d[y*s+A]=g[A];i+=r}return d}function tat(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function nat(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===Vt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=Vt.getMathType(r),a=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function iat(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=$Z(o,n,t.typedArray);i=i??!1,nat(n,s,r,i)}function y1(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=zbe(e,r),s=iat(e,o,t,n,i);return e._loaderPromises.push(s),i}return tat(t,i)}function zh(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=zbe(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=$Z(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Mu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function rat(e){return e===Number?0:new e}function oat(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var sat={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function aat(e,t){let n=oat(e.componentDatatype),i=sat[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function cat(e,t,n){let i=e.decodeMatrix,r=Mu(n,e.decodedMin),o=Mu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new Cn.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 U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(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 lat(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new Est;c.name=n,c.semantic=i,c.setIndex=r,c.constant=rat(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Mu(s,o.min),c.max=Mu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=lf(e,o),or(o,"WEB3D_quantized_attributes")&&cat(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===ct.POSITION||c.semantic===ct.NORMAL||c.semantic===ct.TANGENT||c.semantic===ct.TEXCOORD||c.semantic===ct.FEATURE_ID||c.semantic===ct.SCALE||c.semantic===ct.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&aat(c,s),c}function Vbe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var uat={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function JZ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=uat;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function fat(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function dat(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function hat(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ct.POSITION){let r=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let m=s[g],y=s[g+1],A=s[g+2];a=Math.min(a,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(a,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function mat(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=$Z(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function jbe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?Vbe(g):void 0,b=lat(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=Qst(e,t,p,i,r,o,s,a,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?dat(b,x,s,a):l(o)?hat(b,x,s,a):mat(u,f,b,x,s,a)},b}function Hbe(e,t,n,i,r,o,s,a,c){let u=n.modelSemantic,f=u===ct.POSITION,d=u===ct.FEATURE_ID,p=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,E=jbe(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new Yv.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function pat(e,t,n,i,r){let o=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=JZ(e,Bo,i),u=c.modelSemantic,f=u===Bo.TRANSLATION||u===Bo.ROTATION||u===Bo.SCALE,d=u===Bo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return jbe(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function gat(e,t,n,i,r,o){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let d=new Cst;d.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,E=eat(e,t,n,u,r?!1:A,r?!0:b,o),v=e._geometryLoaders.length;e._geometryLoaders.push(E);let S=E.load();e._loaderPromises.push(S),e._geometryCallbacks[v]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let I=new Yv.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function _at(e,t,n){return new Ht({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function zl(e,t,n,i,r){let o=e.gltfJson,s=uf.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Bi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=uf.createModelTextureReader({textureInfo:t}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=io.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{let d=a.texture;c.texture=d,(l(i)||l(r))&&(d.sampler=_at(d.sampler,i,r))},c}function yat(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new Vst;return l(i)&&(c.diffuseTexture=zl(e,i,n)),l(r)&&(c.specularGlossinessTexture=zl(e,r,n)),c.diffuseFactor=Mu(se,o),c.specularFactor=Mu(h,s),c.glossinessFactor=a,c}function Aat(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new zst;return l(i)&&(c.baseColorTexture=zl(e,i,n)),l(r)&&(c.metallicRoughnessTexture=zl(e,r,n)),c.baseColorFactor=Mu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function bat(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new jst;return l(r)&&(a.specularTexture=zl(e,r,n)),l(s)&&(a.specularColorTexture=zl(e,s,n)),a.specularFactor=i,a.specularColorFactor=Mu(h,o),a}function xat(e,t,n){let{anisotropyStrength:i=YZ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=YZ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new YZ;return l(o)&&(s.anisotropyTexture=zl(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function Tat(e,t,n){let{clearcoatFactor:i=XZ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=XZ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new XZ;return l(r)&&(c.clearcoatTexture=zl(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=zl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=zl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function Eat(e){return new Hst(e)}function Cat(e){if(!l(e))return;let t=new Gst;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function vat(e,t,n){let i=new Wst,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,s=r.KHR_materials_specular,a=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=yat(e,o,n):(l(u)&&(i.metallicRoughness=Aat(e,u,n)),l(s)&&!i.unlit&&(i.specular=bat(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=xat(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=Tat(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=zl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=zl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=zl(e,t.occlusionTexture,n)),i.emissiveFactor=Mu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=Eat(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=Cat(r.BENTLEY_materials_line_style),i}function Gbe(e,t){let n=new Bbe;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 Wbe(e,t,n,i){let r=new Bbe,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=Vbe(o.attribute),r.positionalLabel=i,r}function qbe(e,t){let n=new Ube;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 Ybe(e,t,n,i){let r=new Ube,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let s=o.divisor??0;return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function Sat(e,t,n,i){let r=new kbe;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=zl(e,o,n,Wt.NEAREST,Jn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function wat(e,t,n,i,r,o){let s=new kbe,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=zl(e,c,i,Wt.NEAREST,Jn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function Iat(e,t,n,i,r){let o=new vst,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=JZ(e,ct,f),g=Hbe(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function Pat(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Xbe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=Mu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function Dat(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function Rat(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,s=o.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new oe("Edge visibility line string accessor not found!");let c=zh(e,a),u=Dat(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:Xbe(e,f)}}return i}function Oat(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=zh(e,r)}if(n.materialColor=Xbe(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=zh(e,r))}return l(t.lineStrings)&&(n.lineStrings=Rat(e,t.lineStrings,t.material)),n}function Mat(e,t,n,i){let r=new Sst,o=new Yv(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=vat(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=Lat(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=Fat(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=Nat(e,d,o)),r.edgeVisibility=Oat(e,a.EXT_mesh_primitive_edge_visibility);let p=Pat(a);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=a.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let O in A){if(!A.hasOwnProperty(O))continue;let L=A[O],_=JZ(e,ct,O),C=_.modelSemantic;if(g&&!fat(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=Hbe(e,L,_,t,m,p,n,f,i);o.attributePlans.push(w),r.attributes.push(w.attribute)}let b=t.targets;if(l(b)&&!g)for(let O=0;O<b.length;++O)r.morphTargets.push(Iat(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=gat(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=a.EXT_structural_metadata,E=a.EXT_mesh_features,v=a.EXT_feature_metadata,S=l(v),I=a.NGA_gpm_local;l(E)?Bat(e,r,E,i):S&&kat(e,r,v,i),l(T)?Uat(r,T):S&&zat(e,r,v),l(I)&&Vat(r,I);let R=t.mode;if(g&&R!==Oe.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function Nat(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return y1(e,i,!1)}function Lat(e,t,n){let i=new Yst,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=zh(e,r[t.indices]),i.loopIndicesOffsets=zh(e,r[n.indicesOffsets]),i.triangleIndices=zh(e,r[n.triangleIndices]),i.triangleIndicesOffsets=zh(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=zh(e,r[n.loopIndices]),i.loopIndicesOffsets=zh(e,r[n.loopIndicesOffsets]),i.triangleIndices=zh(e,r[t.indices]),i.triangleIndicesOffsets=zh(e,r[n.indicesOffsets])),i}function Fat(e,t){if(!l(t))return;let n=new qst;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return y1(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function Bat(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let s=r[o],a=`featureId_${o}`,c;l(s.texture)?c=Sat(e,s,i,a):l(s.attribute)?c=Gbe(s,a):c=qbe(s,a),t.featureIds.push(c)}}function kat(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=Wbe(u,d,p,g):m=Ybe(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=wat(e,u,d,i,p,g);t.featureIds.push(m)}}function Uat(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function zat(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Vat(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function jat(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new wst,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(pat(e,f,o,u,n))}let s=i.extensions??H.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?Hat(r,a):l(c)&&Gat(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function Hat(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=Gbe(r,o):s=qbe(r,o),e.featureIds.push(s)}}function Gat(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let s=0;s<o.length;++s){let a=o[s],c=a.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Wbe(a,u,f,d):p=Ybe(a,u,f,d),t.featureIds.push(p)}}function Wat(e,t,n){let i=new Pst;i.name=t.name,i.matrix=Mu(M,t.matrix),i.translation=Mu(h,t.translation),i.rotation=Mu(Le,t.rotation),i.scale=Mu(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,s=r.AGI_articulations,a=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=jat(e,r,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=bz(u);for(let g=0;g<f.length;++g)i.primitives.push(Mat(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function qat(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=Wat(e,r,t);return s.index=o,s});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let s=0;s<o.length;++s)i[r].children.push(i[o[s]])}return i}function Yat(e,t,n){let i=new Ist,r=t.joints;i.joints=r.map(s=>n[s]);let o=t.inverseBindMatrices;if(l(o)){let s=e.gltfJson.accessors[o];i.inverseBindMatrices=y1(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(M.IDENTITY);return i}function Xat(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=Yat(e,o,t);return a.index=s,a}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let s=r[o].skin;l(s)&&(t[o].skin=i[s])}return i}async function Kat(e,t,n,i){let r=new az({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function $at(e,t,n,i){let r=new Az({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function Jat(e,t){let n=new Rst,i=e.gltfJson.accessors,r=i[t.input];n.input=y1(e,r);let o=t.interpolation;n.interpolation=pp[o]??pp.LINEAR;let s=i[t.output];return n.output=y1(e,s,!0),n}function Zat(e,t){let n=new Ost,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=Dst[r],n}function Qat(e,t,n){let i=new Mst,r=e.sampler;return i.sampler=t[r],i.target=Zat(e.target,n),i}function ect(e,t,n){let i=new Nst;i.name=t.name;let r=t.samplers.map(function(s,a){let c=Jat(e,s);return c.index=a,c}),o=t.channels.map(function(s){return Qat(s,r,n)});return i.samplers=r,i.channels=o,i}function tct(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=ect(e,r,t);return s.index=o,s})}function nct(e){let t=new Lst;t.name=e.name;let n=e.type.toUpperCase();return t.type=Il[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function ict(e){let t=new Fst;return t.name=e.name,t.stages=e.stages.map(nct),t}function rct(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(ict):[]}function oct(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function sct(e,t){let n=new kst,i=oct(e);return n.nodes=i.map(function(r){return t[r]}),n}var act=new h;function cct(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,E=l(x)?x:[],v=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=qat(e,t),c=Xat(e,a),u=tct(e,a),f=rct(n),d=sct(n,a),p=new Ust,g=new Bst,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new It(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let x=h.fromArray(s.center,0,act);p.transform=M.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=Kat(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=pz.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let E of T){let v=E.extensions;if(l(v)){let S=v.NGA_gpm_local;if(l(S)){let I=$at(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Zn(b,e._loaderPromises),e._incrementallyLoadTextures||Zn(b,e._texturesPromises),Promise.all(b)}function lct(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._textureLoaders.length=0}function Fbe(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._bufferViewLoaders.length=0}function uct(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._geometryLoaders.length=0}function fct(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 dct(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function hct(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Cd=KZ;var Tz=`uniform sampler2D u_pointCloud_colorGBuffer; uniform sampler2D u_pointCloud_depthGBuffer; uniform vec2 u_distanceAndEdlStrength; in vec2 v_textureCoordinates; @@ -3873,8 +4963,8 @@ color.rgb *= shade; out_FragColor = vec4(color); gl_FragDepth = depthOrLogDepth; } -`;function FA(){this._framebuffer=new pi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(FA.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 G8e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var f9=new z;function j8e(e,t){let n=new He({defines:["LOG_DEPTH_WRITE"],sources:[PF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return f9.x=e._radius,f9.y=e._strength,f9}},o=ze.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:De.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ti({framebuffer:e.framebuffer,color:new G(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:De.CESIUM_3D_TILE,owner:e})}function W8e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),j8e(e,t)}function Ere(e){return e.drawBuffers&&e.fragmentDepth}FA.isSupported=Ere;function q8e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!c(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=He.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() +`;function Kv(){this._framebuffer=new ci({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(Kv.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 mct(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var ZZ=new U;function pct(e,t){let n=new Xe({defines:["LOG_DEPTH_WRITE"],sources:[Tz]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return ZZ.x=e._radius,ZZ.y=e._strength,ZZ}},r=Ge.fromCache({blending:rn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new fi({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function gct(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),pct(e,t)}function Kbe(e){return e.drawBuffers&&e.fragmentDepth}Kv.isSupported=Kbe;function _ct(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=Xe.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() { czm_point_cloud_post_process_main(); #ifdef LOG_DEPTH @@ -3883,7 +4973,7 @@ layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(functio #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}FA.prototype.update=function(e,t,n,i){if(!Ere(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,W8e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===De.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;c(p)&&(f=p.command,h=p.originalShaderProgram),(!c(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=Je.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=q8e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,c(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,l=this._drawCommand;l.boundingVolume=i,r.push(l),r.push(a)};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){return G8e(this),de(this)};var Ng=FA;function Sre(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}Sre.isSupported=function(e){return Ng.isSupported(e.context)};var Mp=Sre;var va={},Y8e=new se(0,0,0,1),rc=new se,X8e=new Ke,d9=new z,h9=new z;va.worldToWindowCoordinates=function(e,t,n){return va.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var wre=new se,vre=new d;function Lv(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,wre),wre),s=d.multiplyComponents(t,d.normalize(r,vre),vre);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var K8e=new he(Math.PI,O.PI_OVER_TWO),$8e=new d,Z8e=new d;va.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("position is required.");let o=e.frameState,r=va.computeActualEllipsoidPosition(o,t,Y8e);if(!c(r))return;let s=e.canvas,a=X8e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let l=e.camera,u=!1;if(o.mode===oe.SCENE2D){let f=e.mapProjection,h=K8e,p=f.project(h,$8e),g=d.clone(l.position,Z8e),m=l.frustum.clone(),y=F.computeViewportTransformation(a,0,1,new F),b=l.frustum.projectionMatrix,x=l.positionWC.y,A=d.fromElements(O.sign(x)*p.x-x,0,-l.positionWC.x),E=Ot.pointToGLWindowCoordinates(b,y,A);if(x===0||E.x<=0||E.x>=s.clientWidth)u=!0;else{if(E.x>s.clientWidth*.5){a.width=E.x,l.frustum.right=p.x-x,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,d9),a.x+=E.x,l.position.x=-l.position.x;let S=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-S,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,h9)}else{a.x+=E.x,a.width-=E.x,l.frustum.left=-p.x-x,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,d9),a.x=a.x-a.width,l.position.x=-l.position.x;let S=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-S,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,h9)}d.clone(g,l.position),l.frustum=m.clone(),i=z.clone(d9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=h9.x)}}if(o.mode!==oe.SCENE2D||u){if(rc=Lv(r,n,l,rc),rc.z<0&&!(l.frustum instanceof on)&&!(l.frustum instanceof jo))return;i=va.clipToGLWindowCoordinates(a,rc,i)}return i.y=s.clientHeight-i.y,i};va.worldToDrawingBufferCoordinates=function(e,t,n){if(n=va.worldToWindowCoordinates(e,t,n),!!c(n))return va.transformWindowToDrawingBuffer(e,n,n)};var Lp=new d,Q8e=new he;va.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,Q8e);if(!c(r))return;if(o.project(r,Lp),i===oe.COLUMBUS_VIEW)return d.fromElements(Lp.z,Lp.x,Lp.y,n);if(i===oe.SCENE2D)return d.fromElements(0,Lp.x,Lp.y,n);let s=e.morphTime;return d.fromElements(O.lerp(Lp.z,t.x,s),O.lerp(Lp.x,t.y,s),O.lerp(Lp.y,t.z,s),n)};var Dre=new d,Pre=new d,Ire=new F;va.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,Dre),F.computeViewportTransformation(e,0,1,Ire),F.multiplyByPoint(Ire,Dre,Pre),z.fromCartesian3(Pre,n)};va.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return z.fromElements(t.x*o,t.y*r,n)};var J8e=new se,Ore=new se;va.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,l=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=l*(1-a/(m+a))/(l-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,J8e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(c(p.fovy)){h=F.multiplyByVector(r.inverseViewProjection,f,Ore);let g=1/h.w;d.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;c(g)&&(p=g),h=Ore,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(a-l)-a-l)*.5,h.w=1,h=F.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var Hi=va;var BA={};BA._deprecationWarning=Ns;var Np=Uint32Array.BYTES_PER_ELEMENT;BA.parse=function(e,t){let n=t??0;T.defined("arrayBuffer",e),t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Np;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+=Np;let s=o.getUint32(t,!0);t+=Np;let a=o.getUint32(t,!0);t+=Np;let l=o.getUint32(t,!0);t+=Np;let u=o.getUint32(t,!0);t+=Np;let f=o.getUint32(t,!0);t+=Np;let h;u>=570425344?(t-=Np*2,h=a,u=l,f=0,a=0,l=0,BA._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.")):f>=570425344&&(t-=Np,h=u,u=a,f=l,a=0,l=0,BA._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:h??0}:(p=sr(i,t,a),t+=a);let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=sr(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(BA._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var IF=BA;function Nv(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Rre(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return c(a)||(a=$.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function eHe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return c(r)||(r=$.createTypedArray(n,i),o[t]=r),r}Nv.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(t=t??$.UNSIGNED_INT,n=n??1,Rre(this,e,t,n,1,i.byteOffset)):i};Nv.prototype.hasProperty=function(e){return c(this.json[e])};Nv.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(c(i.componentType)&&(t=$.fromName(i.componentType)),Rre(this,e,t,n,this.featuresLength,i.byteOffset)):eHe(this,e,t,i)};Nv.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!c(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 tm=Nv;function Fv(e){T.typeOf.number("options.count",e.count),T.typeOf.object("options.batchTable",e.batchTable);let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput;if(o&&!c(r))throw new C("customAttributeOutput is required when parsing batch table as property attributes");let s=tHe(n),a;c(s.jsonProperties)&&(a=new Rg({count:t,properties:s.jsonProperties}));let l;c(s.hierarchy)&&(l=new fA({extension:s.hierarchy,binaryBody:i}));let u=Kh.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,h,p,g;if(o){let b=iHe(t,u,f,i,r);g=b.transcodedSchema,p=[new OA({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=nHe(t,u,f,i);g=b.transcodedSchema;let x=b.featureTableJson;h=new Td({count:x.count,properties:x.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(c(h)||c(a)||c(l)){let b=new Cl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:l});m.push(b)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new oa(y)}function tHe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;c(t)?(Fv._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):c(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 l=e[a];Array.isArray(l)?(r=c(r)?r:{},r[a]=l):s[a]=l}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function nHe(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!c(i))throw new ae(`Property ${h} requires a batch table binary.`);let p=n[h],g=df(p);r[h]={bufferView:a},o[h]=Mre(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let l={classes:{}};l.classes[t]={properties:o};let u=pf.fromJson(l);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function iHe(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(!c(i)&&!c(p.typedArray))throw new ae(`Property ${h} requires a batch table binary.`);let g=$t.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=Mre(p);m.name=h,r[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let b=p.typedArray;c(b)||(b=df(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let x=new An.Attribute;x.name=y,x.count=e,x.type=p.type;let A=$.fromTypedArray(b);(A===$.INT||A===$.UNSIGNED_INT||A===$.DOUBLE)&&(Fv._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" 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.`),b=new Float32Array(b)),x.componentDatatype=$.fromTypedArray(b),x.typedArray=b,o.push(x),s[g]={attribute:y}}let l={classes:{}};l.classes[t]={properties:r};let u=pf.fromJson(l);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Mre(e){let t=oHe(e.componentType);return{type:e.type,componentType:t}}function oHe(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"}}Fv._deprecationWarning=Ns;Fv._oneTimeWarning=dt;var Fg=Fv;var yb={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},rHe=An.FeatureIdAttribute;function Bg(e){e=e??W.EMPTY_OBJECT;let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadAttributesFor2D??!1,p=e.enablePick??!1,g=e.loadIndicesForWireframe??!1,m=e.loadPrimitiveOutline??!0,y=e.loadForClassification??!1;T.typeOf.object("options.b3dmResource",t),T.typeOf.object("options.arrayBuffer",i),n=c(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=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=m,this._loadForClassification=y,this._state=yb.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=F.IDENTITY}c(Object.create)&&(Bg.prototype=Object.create($i.prototype),Bg.prototype.constructor=Bg);Object.defineProperties(Bg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Bg.prototype.load=function(){if(c(this._promise))return this._promise;let e=IF.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new tm(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(a)&&(this._transform=F.fromTranslation(d.fromArray(a))),this._batchTable={json:o,binary:r};let l=new em({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=l,this._state=yb.LOADING;let u=this;return this._promise=l.load().then(function(){if(!u.isDestroyed())return u._state=yb.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return sHe(u,f)}),this._promise};function sHe(e,t){return e.unload(),e._state=yb.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Bg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===yb.READY)return!0;if(this._state!==yb.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),aHe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=yb.READY,!0};function aHe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(c(n.json))o=Fg({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Cl({name:Kh.BATCH_TABLE_CLASS_NAME,count:i});o=new oa({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Lre(r[a]);t.structuralMetadata=o}function Lre(e){let t=e.children.length;for(let i=0;i<t;i++)Lre(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=$t.getAttributeBySemantic(o,ht.FEATURE_ID);if(c(r)){r.setIndex=0;let s=new rHe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Bg.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var OF=Bg;function kg(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.geoJson",e.geoJson),this._geoJson=e.geoJson,this._components=void 0}c(Object.create)&&(kg.prototype=Object.create($i.prototype),kg.prototype.constructor=kg);Object.defineProperties(kg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});kg.prototype.load=function(){return Promise.resolve(this)};kg.prototype.process=function(e){return T.typeOf.object("frameState",e),c(this._components)||(this._components=xHe(this._geoJson,e),this._geoJson=void 0),!0};function cHe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function lHe(){this.features=[]}function m9(e){let t=e[0],n=e[1],i=e[2]??0;return new d(t,n,i)}function p9(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=m9(e[o]);return[n]}function uHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=p9(e[i])[0];return n}function Nre(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=p9(e[i])[0];return n}function fHe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Nre(e[i]));return n}function dHe(e){return[m9(e)]}function hHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=m9(e[i]);return n}var mHe={LineString:p9,MultiLineString:uHe,MultiPolygon:fHe,Polygon:Nre,MultiPoint:hHe,Point:dHe},pHe={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function Fre(e,t){if(!c(e.geometry))return;let n=e.geometry.type,i=mHe[n],o=pHe[n],r=e.geometry.coordinates;if(!c(i)||!c(r))return;let s=new cHe;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function _He(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Fre(n[o],t)}var gHe={FeatureCollection:_He,Feature:Fre},RF=new d;function yHe(e,t,n){let i=0,o=0,r=e.length;for(let L=0;L<r;L++){let B=e[L];if(c(B.lines)){let _=B.lines.length;for(let w=0;w<_;w++){let D=B.lines[w];i+=D.length,o+=(D.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),l=Fe.createTypedArray(i,o),u=Fe.fromTypedArray(l),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let L=0;L<r;L++){let B=e[L];if(!c(B.lines))continue;let _=B.lines.length;for(let w=0;w<_;w++){let D=B.lines[w],I=D.length;for(let N=0;N<I;N++){let k=D[N],H=d.fromDegrees(k.x,k.y,k.z,ie.WGS84,RF),V=F.multiplyByPoint(t,H,RF);d.minimumByComponent(f,V,f),d.maximumByComponent(h,V,h),d.pack(V,s,p*3),a[p]=L,N<I-1&&(l[g*2]=p,l[g*2+1]=p+1,g++),p++}}}let m=bt.createVertexBuffer({typedArray:s,context:n.context,usage:Be.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=bt.createVertexBuffer({typedArray:a,context:n.context,usage:Be.STATIC_DRAW});y.vertexArrayDestroyable=!1;let b=bt.createIndexBuffer({typedArray:l,context:n.context,usage:Be.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let x=new An.Attribute;x.semantic=ht.POSITION,x.componentDatatype=$.FLOAT,x.type=nn.VEC3,x.count=i,x.min=f,x.max=h,x.buffer=m;let A=new An.Attribute;A.semantic=ht.FEATURE_ID,A.setIndex=0,A.componentDatatype=$.FLOAT,A.type=nn.SCALAR,A.count=i,A.buffer=y;let E=[x,A],S=new An.Material;S.unlit=!0;let v=new An.Indices;v.indexDatatype=u,v.count=l.length,v.buffer=b;let P=new An.FeatureIdAttribute;P.featureCount=r,P.propertyTableId=0,P.setIndex=0,P.positionalLabel="featureId_0";let M=[P],R=new An.Primitive;return R.attributes=E,R.indices=v,R.featureIds=M,R.primitiveType=Me.LINES,R.material=S,R}function bHe(e,t,n){let i=0,o=e.length;for(let E=0;E<o;E++){let S=e[E];c(S.points)&&(i+=S.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let E=0;E<o;E++){let S=e[E];if(!c(S.points))continue;let v=S.points.length;for(let P=0;P<v;P++){let M=S.points[P],R=d.fromDegrees(M.x,M.y,M.z,ie.WGS84,RF),L=F.multiplyByPoint(t,R,RF);d.minimumByComponent(a,L,a),d.maximumByComponent(l,L,l),d.pack(L,r,u*3),s[u]=E,u++}}let f=bt.createVertexBuffer({typedArray:r,context:n.context,usage:Be.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=bt.createVertexBuffer({typedArray:s,context:n.context,usage:Be.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new An.Attribute;p.semantic=ht.POSITION,p.componentDatatype=$.FLOAT,p.type=nn.VEC3,p.count=i,p.min=a,p.max=l,p.buffer=f;let g=new An.Attribute;g.semantic=ht.FEATURE_ID,g.setIndex=0,g.componentDatatype=$.FLOAT,g.type=nn.SCALAR,g.count=i,g.buffer=h;let m=[p,g],y=new An.Material;y.unlit=!0;let b=new An.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let x=[b],A=new An.Primitive;return A.attributes=m,A.featureIds=x,A.primitiveType=Me.POINTS,A.material=y,A}function xHe(e,t){let n=new lHe,i=gHe[e.type];c(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 L=0;L<r;L++){let _=o[L].properties??W.EMPTY_OBJECT;for(let w in _)_.hasOwnProperty(w)&&(c(s[w])||(s[w]=new Array(r)))}for(let L=0;L<r;L++){let B=o[L];for(let _ in s)if(s.hasOwnProperty(_)){let w=B.properties[_]??"";s[_][L]=w}}let a=new Rg({count:r,properties:s}),u=[new Cl({id:0,count:r,jsonMetadataTable:a})],f=pf.fromJson({}),h=new oa({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let L=0;L<r;L++){let B=o[L];if(c(B.lines)){m=!0;let _=B.lines.length;for(let w=0;w<_;w++){let D=B.lines[w],I=D.length;for(let N=0;N<I;N++)d.minimumByComponent(p,D[N],p),d.maximumByComponent(g,D[N],g)}}if(c(B.points)){y=!0;let _=B.points.length;for(let w=0;w<_;w++){let D=B.points[w];d.minimumByComponent(p,D,p),d.maximumByComponent(g,D,g)}}}let b=d.midpoint(p,g,new d),x=d.fromDegrees(b.x,b.y,b.z,ie.WGS84,new d),A=Ot.eastNorthUpToFixedFrame(x,ie.WGS84,new F),E=F.inverseTransformation(A,new F),S=[];m&&S.push(yHe(o,E,t)),y&&S.push(bHe(o,E,t));let v=new An.Node;v.index=0,v.primitives=S;let P=[v],M=new An.Scene;M.nodes=P;let R=new An.Components;return R.scene=M,R.nodes=P,R.transform=A,R.structuralMetadata=h,R}kg.prototype.unload=function(){this._components=void 0};var MF=kg;var LF={};LF._deprecationWarning=Ns;var Ug=Uint32Array.BYTES_PER_ELEMENT;LF.parse=function(e,t){T.defined("arrayBuffer",e);let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Ug;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+=Ug;let s=o.getUint32(t,!0);t+=Ug;let a=o.getUint32(t,!0);if(a===0)throw new ae("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Ug;let l=o.getUint32(t,!0);t+=Ug;let u=o.getUint32(t,!0);t+=Ug;let f=o.getUint32(t,!0);t+=Ug;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+=Ug;let p=sr(i,t,a);t+=a;let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=sr(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(LF._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var NF=LF;var Fp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},FF=An.Attribute,THe=An.FeatureIdAttribute,kre=An.Instances;function Bp(e){e=e??W.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,g=e.enablePick??!1;T.typeOf.object("options.i3dmResource",t),T.typeOf.object("options.arrayBuffer",n),i=c(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=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=Fp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}c(Object.create)&&(Bp.prototype=Object.create($i.prototype),Bp.prototype.constructor=Bp);Object.defineProperties(Bp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Bp.prototype.load=function(){if(c(this._promise))return this._promise;let e=NF.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new tm(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!c(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let l=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(l)&&(this._transform=F.fromTranslation(d.fromArray(l))),this._batchTable={json:i,binary:o};let u={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=tu(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new em(u);return this._gltfLoader=f,this._state=Fp.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Fp.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw AHe(this,h)}),this._promise};function AHe(e,t){return e.unload(),e._state=Fp.FAILED,e.getError("Failed to load i3dm",t)}Bp.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===Fp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Fp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),SHe(this,i,e),CHe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Fp.READY,!0};function CHe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(c(n.json))o=Fg({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Cl({name:Kh.BATCH_TABLE_CLASS_NAME,count:i});o=new oa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var BF=new d,_9=new Array(4),EHe=new F;function SHe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",$.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),l=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=vHe(o,r),h;l&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=d.unpackArray(f),y=new d,b=new d,x=new d,A=new d,E=new J,S=new Le,v=new Array(4),P=new d,M=new Array(3),R=new F;if(!c(s)||d.equals(d.unpack(s),d.ZERO)){let V=le.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],V.center,BF),f[3*i+0]=BF.x,f[3*i+1]=BF.y,f[3*i+2]=BF.z;let j=F.fromTranslation(V.center,EHe);t.transform=F.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<r;i++){y=d.clone(m[i]),c(s)&&d.add(y,d.unpack(s),y),l&&(DHe(o,a,i,S,y,x,b,A,E,R),Le.pack(S,v,0),h[4*i+0]=v[0],h[4*i+1]=v[1],h[4*i+2]=v[2],h[4*i+3]=v[3]),u&&(PHe(o,i,P),d.pack(P,M,0),p[3*i+0]=M[0],p[3*i+1]=M[1],p[3*i+2]=M[2]);let V=o.getProperty("BATCH_ID",$.UNSIGNED_SHORT,1,i);c(V)||(V=i),g[i]=V}let L=new kre;L.transformInWorldSpace=!0;let B=e._buffers,_=new FF;if(_.name="Instance Translation",_.semantic=rs.TRANSLATION,_.componentDatatype=$.FLOAT,_.type=nn.VEC3,_.count=r,_.typedArray=f,!l){let V=bt.createVertexBuffer({context:n.context,typedArray:f,usage:Be.STATIC_DRAW});V.vertexArrayDestroyable=!1,B.push(V),_.buffer=V}if(L.attributes.push(_),l){let V=new FF;V.name="Instance Rotation",V.semantic=rs.ROTATION,V.componentDatatype=$.FLOAT,V.type=nn.VEC4,V.count=r,V.typedArray=h,L.attributes.push(V)}if(u){let V=new FF;if(V.name="Instance Scale",V.semantic=rs.SCALE,V.componentDatatype=$.FLOAT,V.type=nn.VEC3,V.count=r,l)V.typedArray=p;else{let j=bt.createVertexBuffer({context:n.context,typedArray:p,usage:Be.STATIC_DRAW});j.vertexArrayDestroyable=!1,B.push(j),V.buffer=j}L.attributes.push(V)}let w=new FF;w.name="Instance Feature ID",w.setIndex=0,w.semantic=rs.FEATURE_ID,w.componentDatatype=$.FLOAT,w.type=nn.SCALAR,w.count=r;let D=bt.createVertexBuffer({context:n.context,typedArray:g,usage:Be.STATIC_DRAW});D.vertexArrayDestroyable=!1,B.push(D),w.buffer=D,L.attributes.push(w);let I=new THe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",L.featureIds.push(I);let N=t.nodes,k=N.length,H=!1;for(i=0;i<k;i++){let V=N[i];V.primitives.length>0&&(V.instances=H?wHe(L):L,H=!0)}}function wHe(e){let t=new kre;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=We(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function vHe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",$.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(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 l=3*s+a;r[l]=n[l]/65535*o[a]+i[a]}return r}else throw new ae("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Bre=new Array(4);function DHe(e,t,n,i,o,r,s,a,l,u){let f=e.getProperty("NORMAL_UP",$.FLOAT,3,n,_9),h=e.getProperty("NORMAL_RIGHT",$.FLOAT,3,n,Bre),p=!1;if(c(f)){if(!c(h))throw new ae("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",$.UNSIGNED_SHORT,2,n,_9),m=e.getProperty("NORMAL_RIGHT_OCT32P",$.UNSIGNED_SHORT,2,n,Bre);if(c(g)){if(!c(m))throw new ae("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Ln.octDecodeInRange(g[0],g[1],65535,r),Ln.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Ot.eastNorthUpToFixedFrame(o,ie.WGS84,u),F.getMatrix3(u,l)):J.clone(J.IDENTITY,l)}p&&(d.cross(s,r,a),d.normalize(a,a),J.setColumn(l,0,s,l),J.setColumn(l,1,r,l),J.setColumn(l,2,a,l)),Le.fromRotationMatrix(l,i)}function PHe(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",$.FLOAT,1,t);c(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",$.FLOAT,3,t,_9);c(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function IHe(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}Bp.prototype.isUnloaded=function(){return this._state===Fp.UNLOADED};Bp.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),IHe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Fp.UNLOADED};var kF=Bp;var OHe={STOPPED:0,ANIMATING:1},nm=Object.freeze(OHe);function kA(){this.times=void 0,this.points=void 0,C.throwInstantiationError()}kA.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Le)return Le;throw new C("point must be a Cartesian3, Quaternion, or number.")};kA.prototype.evaluate=C.throwInstantiationError;kA.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(T.typeOf.number("time",e),e<n[0]||e>n[i-1])throw new C("time is out of range.");if(t=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};kA.prototype.wrapTime=function(e){T.typeOf.number("time",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};kA.prototype.clampTime=function(e){T.typeOf.number("time",e);let t=this.times;return O.clamp(e,t[0],t[t.length-1])};var Ni=kA;function UA(e){this._value=e,this._valueType=Ni.getPointType(e)}Object.defineProperties(UA.prototype,{value:{get:function(){return this._value}}});UA.prototype.findTimeInterval=function(e){throw new C("findTimeInterval cannot be called on a ConstantSpline.")};UA.prototype.wrapTime=function(e){return T.typeOf.number("time",e),0};UA.prototype.clampTime=function(e){return T.typeOf.number("time",e),0};UA.prototype.evaluate=function(e,t){T.typeOf.number("time",e);let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var UF=UA;function VA(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new C("points and times are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(VA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});VA.prototype.findTimeInterval=Ni.prototype.findTimeInterval;VA.prototype.wrapTime=Ni.prototype.wrapTime;VA.prototype.clampTime=Ni.prototype.clampTime;VA.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]:(c(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var bb=VA;var Ure={};Ure.solve=function(e,t,n,i){if(!c(e)||!(e instanceof Array))throw new C("The array lower is required.");if(!c(t)||!(t instanceof Array))throw new C("The array diagonal is required.");if(!c(n)||!(n instanceof Array))throw new C("The array upper is required.");if(!c(i)||!(i instanceof Array))throw new C("The array right is required.");if(t.length!==i.length)throw new C("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new C("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new C("lower and upper must be one less than the length of diagonal.");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 d,s[a]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let l;for(a=1;a<o.length;++a)l=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*l,r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],l,r[a]);for(l=1/(t[a]-o[a-1]*e[a-1]),r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],l,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var Bv=Ure;var Vre=[],zre=[],Hre=[],Gre=[];function RHe(e,t,n){let i=Vre,o=Hre,r=zre,s=Gre;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let l=s[0];for(c(l)||(l=s[0]=new d),d.clone(t,l),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new d),d.subtract(e[a+1],e[a-1],l),d.multiplyByScalar(l,3,l);return i[a]=0,o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new d),d.subtract(e[a+1],e[a-1],l),d.multiplyByScalar(l,3,l),r[a+1]=1,l=s[a+1],c(l)||(l=s[a+1]=new d),d.clone(n,l),Bv.solve(i,r,o,s)}function MHe(e){let t=Vre,n=Hre,i=zre,o=Gre;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(c(s)||(s=o[0]=new d),d.subtract(e[1],e[0],s),d.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],c(s)||(s=o[r]=new d),d.subtract(e[r+1],e[r-1],s),d.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],c(s)||(s=o[r]=new d),d.subtract(e[r],e[r-1],s),d.multiplyByScalar(s,3,s),Bv.solve(t,i,n,o)}function El(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;if(!c(t)||!c(n)||!c(i)||!c(o))throw new C("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");if(i.length!==o.length||i.length!==t.length-1)throw new C("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._pointType!==Ni.getPointType(i[0])||this._pointType!==Ni.getPointType(o[0]))throw new C("inTangents and outTangents must be of the same type as points.");this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(El.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}}});El.createC1=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents;if(!c(n)||!c(t)||!c(i))throw new C("points, times and tangents are required.");if(n.length<2)throw new C("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==i.length)throw new C("times, points and tangents must have the same length.");let o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new El({times:t,points:n,inTangents:r,outTangents:o})};El.createNaturalCubic=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points;if(!c(n)||!c(t))throw new C("points and times are required.");if(n.length<2)throw new C("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new C("times.length must be equal to points.length.");if(n.length<3)return new bb({points:n,times:t});let i=MHe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new El({times:t,points:n,inTangents:r,outTangents:o})};El.createClampedCubic=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent;if(!c(n)||!c(t)||!c(i)||!c(o))throw new C("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new C("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new C("times.length must be equal to points.length.");let r=Ni.getPointType(n[0]);if(r!==Ni.getPointType(i)||r!==Ni.getPointType(o))throw new C("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new bb({points:n,times:t});let s=RHe(n,i,o),a=s.slice(0,s.length-1),l=s.slice(1,s.length);return new El({times:t,points:n,inTangents:l,outTangents:a})};El.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);El.prototype.findTimeInterval=Ni.prototype.findTimeInterval;var LHe=new se,zA=new d;El.prototype.wrapTime=Ni.prototype.wrapTime;El.prototype.clampTime=Ni.prototype.clampTime;El.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],l=(e-i[s])/a,u=LHe;u.z=l,u.y=l*l,u.x=u.y*l,u.w=1;let f=F.multiplyByVector(El.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let h=this._pointType;return h===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(c(t)||(t=new h),t=h.multiplyByScalar(n[s],f.x,t),h.multiplyByScalar(n[s+1],f.y,zA),h.add(t,zA,t),h.multiplyByScalar(r[s],f.z,zA),h.add(t,zA,t),h.multiplyByScalar(o[s],f.w,zA),h.add(t,zA,t))};var xb=El;function HA(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new C("points and times are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(HA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});HA.prototype.findTimeInterval=Ni.prototype.findTimeInterval;HA.prototype.wrapTime=Ni.prototype.wrapTime;HA.prototype.clampTime=Ni.prototype.clampTime;HA.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]:(c(t)||(t=new o),o.clone(n[i],t))};var VF=HA;function NHe(e){let t=e.points,n=e.times;return function(i,o){c(o)||(o=new Le);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],l=t[r+1];return Le.fastSlerp(a,l,s,o)}}function GA(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new C("points and times are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");this._times=n,this._points=t,this._evaluateFunction=NHe(this),this._lastTimeIndex=0}Object.defineProperties(GA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});GA.prototype.findTimeInterval=Ni.prototype.findTimeInterval;GA.prototype.wrapTime=Ni.prototype.wrapTime;GA.prototype.clampTime=Ni.prototype.clampTime;GA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var zF=GA;var jA=An.AnimatedPropertyType;function g9(e){e=e??W.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;T.typeOf.object("options.channel",t),T.typeOf.object("options.runtimeAnimation",n),T.typeOf.object("options.runtimeNode",i),this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,VHe(this)}Object.defineProperties(g9.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 FHe(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 xb({times:e,points:n,inTangents:i,outTangents:o})}function jre(e,t,n,i){if(e.length===1&&t.length===1)return new UF(t[0]);switch(n){case Jh.STEP:return new VF({times:e,points:t});case Jh.CUBICSPLINE:return FHe(e,t);case Jh.LINEAR:return i===jA.ROTATION?new zF({times:e,points:t}):new bb({times:e,points:t})}}function BHe(e,t,n,i,o){let r=[];if(i===jA.WEIGHTS){let a=t.length/o,l,u;for(l=0;l<o;l++){let f=new Array(a),h=l;if(n===Jh.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<a;u++)f[u]=t[h],h+=o;r.push(jre(e,f,n,i))}}else r.push(jre(e,t,n,i));return r}var kHe=new d,UHe=new Le;function VHe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,l=e._runtimeNode,u=c(l.morphWeights)?l.morphWeights.length:1,f=BHe(i,o,r,a,u);e._splines=f,e._path=a}g9.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===jA.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let l=t[a],u=i.clampAnimations?l.clampTime(e):l.wrapTime(e);r[a]=l.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===jA.TRANSLATION||n===jA.SCALE?o[n]=r.evaluate(s,kHe):n===jA.ROTATION&&(o[n]=r.evaluate(s,UHe))}}};var HF=g9;function y9(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Q.clone(n.startTime),this._delay=n.delay??0,this._stopTime=Q.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??au.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new pe,this.update=new pe,this.stop=new pe,this._state=nm.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,zHe(this)}Object.defineProperties(y9.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}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function zHe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let l=0;l<s;l++){let u=r[l],f=u.target;if(!c(f))continue;let h=f.node.index,p=i._runtimeNodes[h],g=new HF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}y9.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var GF=y9;function kp(e){this.animationAdded=new pe,this.animationRemoved=new pe,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(kp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function b9(e,t,n){let i=e._model,o=new GF(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}kp.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new C("Animations are not loaded. Wait for Model.ready to be true.");let n=t.sceneGraph.components.animations;if(!c(e.name)&&!c(e.index))throw new C("Either options.name or options.index must be defined.");if(c(e.multiplier)&&e.multiplier<=0)throw new C("options.multiplier must be greater than zero.");if(c(e.index)&&(e.index>=n.length||e.index<0))throw new C("options.index must be a valid animation index.");let i=e.index;if(c(i))return b9(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}if(!c(i))throw new C("options.name must be a valid animation name.");return b9(this,n[i],e)};kp.prototype.addAll=function(e){e=e??W.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new C("Animations are not loaded. Wait for Model.ready to be true.");if(c(e.multiplier)&&e.multiplier<=0)throw new C("options.multiplier must be greater than zero.");let n=t.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=b9(this,n[r],e);i.push(s)}return i};kp.prototype.remove=function(e){if(!c(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};kp.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])};kp.prototype.contains=function(e){return c(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};kp.prototype.get=function(e){if(!c(e))throw new C("index is required.");if(e>=this._runtimeAnimations.length||e<0)throw new C("index must be valid within the range of the collection");return this._runtimeAnimations[e]};var jF=[];function HHe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}kp.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];c(a._computedStartTime)||(a._computedStartTime=Q.addSeconds(a.startTime??o,a.delay,new Q)),c(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let l=a._computedStartTime,u=a._duration,f=a.stopTime,h=Q.lessThanOrEquals(l,o),p=c(f)&&Q.greaterThan(o,f),g=0;if(u!==0){let b=Q.secondsDifference(p?f:o,l);g=c(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===au.REPEAT||a.loop===au.MIRRORED_REPEAT,y=(h||m&&!c(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let b=a._state===nm.STOPPED;if(y!==b)continue}if(a._prevAnimationDelta=g,y||a._state===nm.ANIMATING){if(y&&a._state===nm.STOPPED&&(a._state=nm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===au.REPEAT)g=g-Math.floor(g);else if(a.loop===au.MIRRORED_REPEAT){let A=Math.floor(g),E=g-A;g=A%2===1?1-E:E}let b=a.startOffset;a.reverse&&(g=1-g,b=-b);let x=g*u*a.multiplier+b;x=O.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=nm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&jF.push(a))}}n=jF.length;for(let s=0;s<n;++s){let a=jF[s];t.splice(t.indexOf(a),1),e.afterRender.push(HHe(this,r,a))}return jF.length=0,i};var WF=kp;function Tb(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(Tb.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return c(this._color)||(this._color=new G),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}}});Tb.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};Tb.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};Tb.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};Tb.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};Tb.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var qF=Tb;var kv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};kv.getStyleCommandsNeeded=function(e,t){return t===0?kv.ALL_OPAQUE:t===e?kv.ALL_TRANSLUCENT:kv.OPAQUE_AND_TRANSLUCENT};var im=Object.freeze(kv);var Vg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Vg.is3DTiles=function(e){switch(T.typeOf.string("modelType",e),e){case Vg.TILE_GLTF:case Vg.TILE_B3DM:case Vg.TILE_I3DM:case Vg.TILE_PNTS:case Vg.TILE_GEOJSON:return!0;case Vg.GLTF:return!1;default:throw new C("modelType is not a valid value.")}};var Tr=Object.freeze(Vg);function Br(e){let t=e.model,n=e.propertyTable;T.typeOf.object("propertyTable",n),T.typeOf.object("model",t),this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=im.ALL_OPAQUE,GHe(this)}Object.defineProperties(Br.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return c(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function GHe(e){let t=e._model,n=Tr.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 ta(s,o)}else for(o=0;o<i;o++)r[o]=new qF({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Tl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Br.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=im.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Br.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Br.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Br.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Br.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Br.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Br.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Br.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Br.prototype.getFeature=function(e){return this._features[e]};Br.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Br.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Br.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Br.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Br.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Br.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Br.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Br.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Br.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var jHe=new G;Br.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(Tl.DEFAULT_COLOR_VALUE),this.setAllShow(Tl.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=c(e.color)?e.color.evaluateColor(n,jHe)??Tl.DEFAULT_COLOR_VALUE:Tl.DEFAULT_COLOR_VALUE,o=c(e.show)?e.show.evaluate(n)??Tl.DEFAULT_SHOW_VALUE:Tl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Br.prototype.isDestroyed=function(){return!1};Br.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var YF=Br;var Wre={name:"TilesetPipelineStage"};Wre.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ge.FRAGMENT);let r={u_polygonOffset:function(){return z.ZERO}};e.uniformMap=xt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK};var XF=Wre;var KF=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}Kv.prototype.update=function(e,t,n,i){if(!Kbe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,gct(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Oe.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=at.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=_ct(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};Kv.prototype.isDestroyed=function(){return!1};Kv.prototype.destroy=function(){return mct(this),ue(this)};var qy=Kv;function $be(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}$be.isSupported=function(e){return qy.isSupported(e.context)};var _g=$be;var Cc={},yct=new se(0,0,0,1),rl=new se,Act=new et,QZ=new U,eQ=new U;Cc.worldToWindowCoordinates=function(e,t,n){return Cc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Jbe=new se,Zbe=new h;function A1(e,t,n,i){let r=n.viewMatrix,o=M.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,Jbe),Jbe),s=h.multiplyComponents(t,h.normalize(o,Zbe),Zbe);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,M.multiplyByVector(n.frustum.projectionMatrix,o,i)}var bct=new he(Math.PI,P.PI_OVER_TWO),xct=new h,Tct=new h;Cc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Cc.computeActualEllipsoidPosition(r,t,yct);if(!l(o))return;let s=e.canvas,a=Act;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=bct,p=f.project(d,xct),g=h.clone(c.position,Tct),m=c.frustum.clone(),y=M.computeViewportTransformation(a,0,1,new M),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(P.sign(b)*p.x-b,0,-c.positionWC.x),T=At.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-b,rl=A1(o,n,c,rl),Cc.clipToGLWindowCoordinates(a,rl,QZ),a.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,rl=A1(o,n,c,rl),Cc.clipToGLWindowCoordinates(a,rl,eQ)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,rl=A1(o,n,c,rl),Cc.clipToGLWindowCoordinates(a,rl,QZ),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,rl=A1(o,n,c,rl),Cc.clipToGLWindowCoordinates(a,rl,eQ)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(QZ,i),(i.x<0||i.x>s.clientWidth)&&(i.x=eQ.x)}}if(r.mode!==re.SCENE2D||u){if(rl=A1(o,n,c,rl),rl.z<0&&!(c.frustum instanceof _n)&&!(c.frustum instanceof Ss))return;i=Cc.clipToGLWindowCoordinates(a,rl,i)}return i.y=s.clientHeight-i.y,i};Cc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Cc.worldToWindowCoordinates(e,t,n),!!l(n))return Cc.transformWindowToDrawingBuffer(e,n,n)};var yg=new h,Ect=new he;Cc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,Ect);if(!l(o))return;if(r.project(o,yg),i===re.COLUMBUS_VIEW)return h.fromElements(yg.z,yg.x,yg.y,n);if(i===re.SCENE2D)return h.fromElements(0,yg.x,yg.y,n);let s=e.morphTime;return h.fromElements(P.lerp(yg.z,t.x,s),P.lerp(yg.x,t.y,s),P.lerp(yg.y,t.z,s),n)};var Qbe=new h,exe=new h,txe=new M;Cc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Qbe),M.computeViewportTransformation(e,0,1,txe),M.multiplyByPoint(txe,Qbe,exe),U.fromCartesian3(exe,n)};Cc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*r,t.y*o,n)};var Cct=new se,nxe=new se;Cc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,Cct);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=M.multiplyByVector(o.inverseViewProjection,f,nxe);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=nxe,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=M.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var gr=Cc;var $v={};$v._deprecationWarning=Xr;var Ag=Uint32Array.BYTES_PER_ELEMENT;$v.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Ag;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Ag;let s=r.getUint32(t,!0);t+=Ag;let a=r.getUint32(t,!0);t+=Ag;let c=r.getUint32(t,!0);t+=Ag;let u=r.getUint32(t,!0);t+=Ag;let f=r.getUint32(t,!0);t+=Ag;let d;u>=570425344?(t-=Ag*2,d=a,u=c,f=0,a=0,c=0,$v._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.")):f>=570425344&&(t-=Ag,d=u,u=a,f=c,a=0,c=0,$v._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:d??0}:(p=Lo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Lo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):($v._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var Ez=$v;function b1(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function ixe(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function vct(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}b1.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,ixe(this,e,t,n,1,i.byteOffset)):i};b1.prototype.hasProperty=function(e){return l(this.json[e])};b1.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),ixe(this,e,t,n,this.featuresLength,i.byteOffset)):vct(this,e,t,i)};b1.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var Pp=b1;function x1(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=Sct(n),a;l(s.jsonProperties)&&(a=new Gy({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Fv({extension:s.hierarchy,binaryBody:i}));let u=sp.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=Ict(t,u,f,i,o);g=A.transcodedSchema,p=[new Gv({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=wct(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new vh({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let A=new Ou({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new nc(y)}function Sct(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(x1._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function wct(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Fh(p);o[d]={bufferView:a},r[d]=rxe(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=hu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function Ict(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=xt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=rxe(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Fh(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new Cn.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(x1._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" 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.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=hu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function rxe(e){let t=Pct(e.componentType);return{type:e.type,componentType:t}}function Pct(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"}}x1._deprecationWarning=Xr;x1._oneTimeWarning=yt;var Yy=x1;var Dx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},Dct=Cn.FeatureIdAttribute,tQ=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Hi.Y,f=t.forwardAxis??Hi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=Dx.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=M.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=Ez.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new Pp(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new Cd({typedArray:t.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=u,this._state=Dx.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=Dx.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return Rct(f,d)}),this._promise}process(t){if(this._state===Dx.READY)return!0;if(this._state!==Dx.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),Oct(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Dx.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Rct(e,t){return e.unload(),e._state=Dx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function Oct(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Yy({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Ou({name:sp.BATCH_TABLE_CLASS_NAME,count:i});r=new nc({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)oxe(o[a]);t.structuralMetadata=r}function oxe(e){let t=e.children.length;for(let i=0;i<t;i++)oxe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=xt.getAttributeBySemantic(r,ct.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new Dct;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var Cz=tQ;var nQ=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=Wct(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function Mct(){this.lines=void 0,this.points=void 0,this.properties=void 0}function Nct(){this.features=[]}function iQ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function rQ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=iQ(e[r]);return[n]}function Lct(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=rQ(e[i])[0];return n}function sxe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=rQ(e[i])[0];return n}function Fct(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=sxe(e[i]);Zn(n,r)}return n}function Bct(e){return[iQ(e)]}function kct(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=iQ(e[i]);return n}var Uct={LineString:rQ,MultiLineString:Lct,MultiPolygon:Fct,Polygon:sxe,MultiPoint:kct,Point:Bct},zct={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function axe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Uct[n],r=zct[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new Mct;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function Vct(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)axe(n[r],t)}var jct={FeatureCollection:Vct,Feature:axe},vz=new h;function Hct(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let L=e[O];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=je.createTypedArray(i,r),u=je.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let O=0;O<o;O++){let L=e[O];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],D=w.length;for(let N=0;N<D;N++){let F=w[N],V=h.fromDegrees(F.x,F.y,F.z,ee.WGS84,vz),B=M.multiplyByPoint(t,V,vz);h.minimumByComponent(f,B,f),h.maximumByComponent(d,B,d),h.pack(B,s,p*3),a[p]=O,N<D-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new Cn.Attribute;b.semantic=ct.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new Cn.Attribute;x.semantic=ct.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],E=new Cn.Material;E.unlit=!0;let v=new Cn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new Cn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new Cn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function Gct(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let E=e[T];if(!l(E.points))continue;let v=E.points.length;for(let S=0;S<v;S++){let I=E.points[S],R=h.fromDegrees(I.x,I.y,I.z,ee.WGS84,vz),O=M.multiplyByPoint(t,R,vz);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=tt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Cn.Attribute;p.semantic=ct.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Cn.Attribute;g.semantic=ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new Cn.Material;y.unlit=!0;let A=new Cn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new Cn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function Wct(e,t){let n=new Nct,i=jct[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let s={};for(let O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(s[C])||(s[C]=new Array(o)))}for(let O=0;O<o;O++){let L=r[O];for(let _ in s)if(s.hasOwnProperty(_)){let C=L.properties[_]??"";s[_][O]=C}}let a=new Gy({count:o,properties:s}),u=[new Ou({id:0,count:o,jsonMetadataTable:a})],f=hu.fromJson({}),d=new nc({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<o;O++){let L=r[O];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],D=w.length;for(let N=0;N<D;N++)h.minimumByComponent(p,w[N],p),h.maximumByComponent(g,w[N],g)}}if(l(L.points)){y=!0;let _=L.points.length;for(let C=0;C<_;C++){let w=L.points[C];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,ee.WGS84,new h),x=At.eastNorthUpToFixedFrame(b,ee.WGS84,new M),T=M.inverseTransformation(x,new M),E=[];m&&E.push(Hct(r,T,t)),y&&E.push(Gct(r,T,t));let v=new Cn.Node;v.index=0,v.primitives=E;let S=[v],I=new Cn.Scene;I.nodes=S;let R=new Cn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var Sz=nQ;var wz={};wz._deprecationWarning=Xr;var Xy=Uint32Array.BYTES_PER_ELEMENT;wz.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Xy;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=Xy;let s=r.getUint32(t,!0);t+=Xy;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Xy;let c=r.getUint32(t,!0);t+=Xy;let u=r.getUint32(t,!0);t+=Xy;let f=r.getUint32(t,!0);t+=Xy;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=Xy;let p=Lo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Lo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(wz._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var Iz=wz;var bg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Pz=Cn.Attribute,qct=Cn.FeatureIdAttribute,lxe=Cn.Instances,oQ=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Hi.Y,f=t.forwardAxis??Hi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=bg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=Iz.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new Pp(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=M.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={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(s===0){let p=cf(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new Cd(f);return this._gltfLoader=d,this._state=bg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=bg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw Yct(this,p)}),this._promise}process(t){if(this._state===bg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===bg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=M.multiplyTransformation(this._transform,r.transform,r.transform),$ct(this,r,t),Xct(this,r),this._components=r,this._arrayBuffer=void 0,this._state=bg.READY,!0}isUnloaded(){return this._state===bg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),tlt(this),this._components=void 0,this._arrayBuffer=void 0,this._state=bg.UNLOADED}};function Yct(e,t){return e.unload(),e._state=bg.FAILED,e.getError("Failed to load i3dm",t)}function Xct(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Yy({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Ou({name:sp.BATCH_TABLE_CLASS_NAME,count:i});r=new nc({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var Dz=new h,sQ=new Array(4),Kct=new M;function $ct(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=Zct(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,E=new Le,v=new Array(4),S=new h,I=new Array(3),R=new M;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let B=le.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,Dz),f[3*i+0]=Dz.x,f[3*i+1]=Dz.y,f[3*i+2]=Dz.z;let j=M.fromTranslation(B.center,Kct);t.transform=M.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(Qct(r,a,i,E,y,b,A,x,T,R),Le.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(elt(r,i,S),h.pack(S,I,0),p[3*i+0]=I[0],p[3*i+1]=I[1],p[3*i+2]=I[2]);let B=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(B)||(B=i),g[i]=B}let O=new lxe;O.transformInWorldSpace=!0;let L=e._buffers,_=new Pz;if(_.name="Instance Translation",_.semantic=Bo.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Me.STATIC_DRAW});B.vertexArrayDestroyable=!1,L.push(B),_.buffer=B}if(O.attributes.push(_),c){let B=new Pz;B.name="Instance Rotation",B.semantic=Bo.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new Pz;if(B.name="Instance Scale",B.semantic=Bo.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});j.vertexArrayDestroyable=!1,L.push(j),B.buffer=j}O.attributes.push(B)}let C=new Pz;C.name="Instance Feature ID",C.setIndex=0,C.semantic=Bo.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=tt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),C.buffer=w,O.attributes.push(C);let D=new qct;D.propertyTableId=0,D.setIndex=0,D.positionalLabel="instanceFeatureId_0",O.featureIds.push(D);let N=t.nodes,F=N.length,V=!1;for(i=0;i<F;i++){let B=N[i];B.primitives.length>0&&(B.instances=V?Jct(O):O,V=!0)}}function Jct(e){let t=new lxe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Ze(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function Zct(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=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;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var cxe=new Array(4);function Qct(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,sQ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,cxe),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,sQ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,cxe);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");cn.octDecodeInRange(g[0],g[1],65535,o),cn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(r,ee.WGS84,u),M.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function elt(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,sQ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function tlt(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var Rz=oQ;var uxe={STOPPED:0,ANIMATING:1};Object.freeze(uxe);var Dp=uxe;var Jv=Cn.AnimatedPropertyType;function aQ(e){e=e??H.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,slt(this)}Object.defineProperties(aQ.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 nlt(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new Mb({times:e,points:n,inTangents:i,outTangents:r})}function fxe(e,t,n,i){if(e.length===1&&t.length===1)return new hk(t[0]);switch(n){case pp.STEP:return new L3({times:e,points:t});case pp.CUBICSPLINE:return nlt(e,t);case pp.LINEAR:return i===Jv.ROTATION?new A3({times:e,points:t}):new Ob({times:e,points:t})}}function ilt(e,t,n,i,r){let o=[];if(i===Jv.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===pp.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(fxe(e,f,n,i))}}else o.push(fxe(e,t,n,i));return o}var rlt=new h,olt=new Le;function slt(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=ilt(i,r,o,a,u);e._splines=f,e._path=a}aQ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===Jv.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===Jv.TRANSLATION||n===Jv.SCALE?r[n]=o.evaluate(s,rlt):n===Jv.ROTATION&&(r[n]=o.evaluate(s,olt))}}};var Oz=aQ;function cQ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??bf.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Dp.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,alt(this)}Object.defineProperties(cQ.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}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function alt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new Oz({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}cQ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var Mz=cQ;function xg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(xg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function lQ(e,t,n){let i=e._model,r=new Mz(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}xg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return lQ(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return lQ(this,n[i],e)};xg.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=lQ(this,n[o],e);i.push(s)}return i};xg.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};xg.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])};xg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};xg.prototype.get=function(e){return this._runtimeAnimations[e]};var Nz=[];function clt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}xg.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=K.addSeconds(a.startTime??r,a.delay,new K)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,A):A/u}let m=a.loop===bf.REPEAT||a.loop===bf.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===Dp.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===Dp.ANIMATING){if(y&&a._state===Dp.STOPPED&&(a._state=Dp.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===bf.REPEAT)g=g-Math.floor(g);else if(a.loop===bf.MIRRORED_REPEAT){let x=Math.floor(g),T=g-x;g=x%2===1?1-T:T}let A=a.startOffset;a.reverse&&(g=1-g,A=-A);let b=g*u*a.multiplier+A;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Dp.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&Nz.push(a))}}n=Nz.length;for(let s=0;s<n;++s){let a=Nz[s];t.splice(t.indexOf(a),1),e.afterRender.push(clt(this,o,a))}return Nz.length=0,i};var Lz=xg;function Rx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(Rx.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 z),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}}});Rx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};Rx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};Rx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};Rx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};Rx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var Fz=Rx;var Zv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Zv.getStyleCommandsNeeded=function(e,t){return t===0?Zv.ALL_OPAQUE:t===e?Zv.ALL_TRANSLUCENT:Zv.OPAQUE_AND_TRANSLUCENT};Object.freeze(Zv);var Rp=Zv;var Tg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Tg.is3DTiles=function(e){switch(e){case Tg.TILE_GLTF:case Tg.TILE_B3DM:case Tg.TILE_I3DM:case Tg.TILE_PNTS:case Tg.TILE_GEOJSON:return!0;case Tg.GLTF:return!1}};Object.freeze(Tg);var Qo=Tg;function _s(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=Rp.ALL_OPAQUE,llt(this)}Object.defineProperties(_s.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 llt(e){let t=e._model,n=Qo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new pa(s,r)}else for(r=0;r<i;r++)o[r]=new Fz({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Du({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}_s.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Rp.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};_s.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};_s.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};_s.prototype.getShow=function(e){return this._batchTexture.getShow(e)};_s.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};_s.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};_s.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};_s.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};_s.prototype.getFeature=function(e){return this._features[e]};_s.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};_s.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};_s.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};_s.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};_s.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};_s.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};_s.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};_s.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};_s.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var ult=new z;_s.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Du.DEFAULT_COLOR_VALUE),this.setAllShow(Du.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,ult)??Du.DEFAULT_COLOR_VALUE:Du.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Du.DEFAULT_SHOW_VALUE:Du.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};_s.prototype.isDestroyed=function(){return!1};_s.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Bz=_s;var dxe={name:"TilesetPipelineStage"};dxe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,de.FRAGMENT);let o={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Mt(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK};var kz=dxe;var Uz=`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; @@ -3949,7 +5039,7 @@ applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); } else { } } -`;var $F=`void atmosphereStage(ProcessedAttributes attributes) { +`;var zz=`void atmosphereStage(ProcessedAttributes attributes) { vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); czm_computeGroundAtmosphereScattering( v_positionWC, @@ -3959,7 +5049,7 @@ v_atmosphereMieColor, v_atmosphereOpacity ); } -`;var qre={name:"AtmospherePipelineStage"};qre.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ge.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([$F]),i.addFragmentLines([KF]),i.addUniform("bool","u_isInFog",ge.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return O.fog(o,n.fog.density)>O.EPSILON3}};var ZF=qre;var QF=`#ifdef DIFFUSE_IBL +`;var hxe={name:"AtmospherePipelineStage"};hxe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,de.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([zz]),i.addFragmentLines([Uz]),i.addUniform("bool","u_isInFog",de.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(r,n.fog.density)>P.EPSILON3}};var Vz=hxe;var jz=`#ifdef DIFFUSE_IBL vec3 sampleDiffuseEnvironment(vec3 cubeDir) { #ifdef CUSTOM_SPHERICAL_HARMONICS @@ -4034,14 +5124,14 @@ vec3 specularContribution = vec3(0.0); return diffuseContribution + specularContribution; } #endif -`;var Yre={name:"ImageBasedLightingPipelineStage"},WHe=new z;Yre.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;c(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Hh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),c(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),c(a)&&c(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),c(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||c(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(QF);let l={model_iblFactor:function(){return z.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,WHe)},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}};c(s)&&(l.model_specularEnvironmentMaps=function(){return s},l.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=xt(l,e.uniformMap)};var JF=Yre;var qHe=O.EPSILON16;function T9(e){e=e??W.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;T.typeOf.object("options.stage",t),T.typeOf.object("options.runtimeArticulation",n),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(T9.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){T.typeOf.number("value",e),e=O.clamp(e,this.minimumValue,this.maximumValue),O.equalsEpsilon(this._currentValue,e,qHe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var YHe=new d,x9=new J;T9.prototype.applyStageToMatrix=function(e){T.typeOf.object("result",e);let t=this.type,n=this.currentValue,i=YHe,o;switch(t){case Uc.XROTATE:o=J.fromRotationX(O.toRadians(n),x9),e=F.multiplyByMatrix3(e,o,e);break;case Uc.YROTATE:o=J.fromRotationY(O.toRadians(n),x9),e=F.multiplyByMatrix3(e,o,e);break;case Uc.ZROTATE:o=J.fromRotationZ(O.toRadians(n),x9),e=F.multiplyByMatrix3(e,o,e);break;case Uc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case Uc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case Uc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case Uc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case Uc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case Uc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case Uc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var e2=T9;function t2(e){e=e??W.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;T.typeOf.object("options.articulation",t),T.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,XHe(this)}Object.defineProperties(t2.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 XHe(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],l=new e2({stage:a,runtimeArticulation:e});o.push(l);let u=a.name;r[u]=l}}t2.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];c(n)&&(n.currentValue=t)};var KHe=new F,$He=new F;t2.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,KHe),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=F.multiplyTransformation(s.originalTransform,e,$He);s.transform=a}};var n2=t2;var i2=`void modelColorStage(inout czm_modelMaterial material) +`;var mxe={name:"ImageBasedLightingPipelineStage"},flt=new U;mxe.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=r.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,de.FRAGMENT),o.addUniform("vec2","model_iblFactor",de.FRAGMENT),Sp.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",de.FRAGMENT),l(s)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),l(a)&&l(a[0])?(o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,de.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",de.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,de.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",de.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",de.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT)),o.addFragmentLines(jz);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,flt)},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 r.maximumMipmapLevel}),e.uniformMap=Mt(c,e.uniformMap)};var Hz=mxe;var dlt=P.EPSILON16;function fQ(e){e=e??H.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(fQ.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=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,dlt)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var hlt=new h,uQ=new $;fQ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=hlt,r;switch(t){case Il.XROTATE:r=$.fromRotationX(P.toRadians(n),uQ),e=M.multiplyByMatrix3(e,r,e);break;case Il.YROTATE:r=$.fromRotationY(P.toRadians(n),uQ),e=M.multiplyByMatrix3(e,r,e);break;case Il.ZROTATE:r=$.fromRotationZ(P.toRadians(n),uQ),e=M.multiplyByMatrix3(e,r,e);break;case Il.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Il.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Il.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case Il.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case Il.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case Il.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case Il.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var Gz=fQ;function Wz(e){e=e??H.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,mlt(this)}Object.defineProperties(Wz.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 mlt(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new Gz({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}Wz.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var plt=new M,glt=new M;Wz.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,plt),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=M.multiplyTransformation(s.originalTransform,e,glt);s.transform=a}};var qz=Wz;var Yz=`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 WA={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};WA.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ge.FRAGMENT),i.addFragmentLines(i2);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=De.TRANSLUCENT),i.addUniform("vec4",WA.COLOR_UNIFORM_NAME,ge.FRAGMENT),o[WA.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",WA.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),o[WA.COLOR_BLEND_UNIFORM_NAME]=function(){return kc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=xt(o,e.uniformMap)};var Ab=WA;var o2=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +`;var Qv={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};Qv.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(Yz);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ie.TRANSLUCENT),i.addUniform("vec4",Qv.COLOR_UNIFORM_NAME,de.FRAGMENT),r[Qv.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",Qv.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[Qv.COLOR_BLEND_UNIFORM_NAME]=function(){return Ul.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Mt(r,e.uniformMap)};var Ox=Qv;var Xz=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE vec4 getClippingPlane( highp sampler2D packedClippingPlanes, int clippingPlaneNumber, @@ -4120,35 +5210,253 @@ if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } -`;var Xre={name:"ModelClippingPlanesPipelineStage"},ZHe=new z;Xre.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),xs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=xs.getTextureResolution(i,o,ZHe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(o2);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let l=G.clone(i.edgeColor);return l.alpha=i.edgeWidth,l},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var r2=Xre;var s2=`void modelClippingPolygonsStage(ProcessedAttributes attributes) +`;var pxe={name:"ModelClippingPlanesPipelineStage"},_lt=new U,ylt=new M,Alt=new M;pxe.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,de.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,de.FRAGMENT),Ns.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Ns.getTextureResolution(i,r,_lt);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,de.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",de.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",de.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",de.FRAGMENT),o.addFragmentLines(Xz);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=M.transpose(r.uniformState.inverseView3D,ylt);return M.multiply(c,t._clippingPlanesMatrix,Alt)}};e.uniformMap=Mt(a,e.uniformMap)};var Kz=pxe;var $z=`void modelClippingPolygonsStage() { -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; +bool insideAny = vectorClip(v_clippingUv); +#ifdef CLIPPING_INVERSE +if (!insideAny) +{ +discard; +} +#else +if (insideAny) +{ +discard; +} +#endif +} +`;var Jz=`void modelClippingPolygonsStage() +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; +} +`;var Ky=`uniform highp sampler2D u_vectorColorTexture; +uniform highp sampler2D u_vectorPickColorTexture; +int vectorPickPrimitiveIndex = -1; +#ifdef HAS_VECTOR_POLYLINES +uniform highp sampler2D u_vectorSegmentTexture; +uniform highp sampler2D u_vectorWidthTexture; +uniform highp sampler2D u_vectorSegmentPrimitiveIndicesTexture; +uniform highp sampler2D u_vectorGridCellIndicesTexture; +#ifdef VECTOR_WIDTH_IN_METERS +uniform vec2 u_vectorMetersPerUv; +#endif +#endif +#ifdef HAS_VECTOR_POLYGONS +uniform highp sampler2D u_vectorPolygonEdgeTexture; +uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture; +uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture; +#endif +uniform highp sampler2D u_clippingEdgeTexture; +uniform highp sampler2D u_clippingEdgePrimitiveIndicesTexture; +uniform highp sampler2D u_clippingGridCellIndicesTexture; +vec2 vectorOffsetToLine(vec2 p, vec4 line) +{ +vec2 a = line.xy; +vec2 b = line.zw; +vec2 ab = b - a; +float abLengthSquared = dot(ab, ab); +if (abLengthSquared < 1.0e-8) +{ +return p - a; +} +float t = clamp(dot(p - a, ab) / abLengthSquared, 0.0, 1.0); +return p - (a + t * ab); +} +ivec2 vectorIndexToUv(int index, ivec2 size) +{ +int v = index / size.x; +int u = index - v * size.x; +return ivec2(u, v); +} +ivec2 vectorCellRange(vec2 uv, highp sampler2D gridCellIndicesTexture) +{ +ivec2 headerSize = textureSize(gridCellIndicesTexture, 0); +if (headerSize.x * headerSize.y < 3) +{ +return ivec2(0); +} +int gridWidth = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(0, headerSize), 0).r); +int gridHeight = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(1, headerSize), 0).r); +int cellX = clamp(int(uv.x * float(gridWidth)), 0, gridWidth - 1); +int cellY = clamp(int(uv.y * float(gridHeight)), 0, gridHeight - 1); +int cellIndex = cellX + cellY * gridWidth; +int indexEnd = int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 2, headerSize), 0).r); +int indexStart = cellIndex == 0 +? 0 +: int(texelFetch(gridCellIndicesTexture, vectorIndexToUv(cellIndex + 1, headerSize), 0).r); +return ivec2(indexStart, indexEnd); +} +#ifdef VECTOR_ANTIALIAS +const float vectorCoverageRadius = 0.5; +#else +const float vectorCoverageRadius = 0.0; +#endif +vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor) +{ +#ifdef HAS_VECTOR_POLYLINES +mat2 screenFromUv = inverse(mat2(dFdx(vectorUv), dFdy(vectorUv))); +#ifdef VECTOR_WIDTH_IN_METERS +mat2 metersFromUv = mat2(u_vectorMetersPerUv.x, 0.0, 0.0, u_vectorMetersPerUv.y); +float pixelsPerMeter = 1.0 / max( +length(metersFromUv * dFdx(vectorUv)), +length(metersFromUv * dFdy(vectorUv))); +#endif +ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0); +if (headerSize.x * headerSize.y < 3) +{ +return baseColor; +} +ivec2 range = vectorCellRange(vectorUv, u_vectorGridCellIndicesTexture); +ivec2 segmentTextureSize = textureSize(u_vectorSegmentTexture, 0); +ivec2 primitiveTextureSize = textureSize(u_vectorWidthTexture, 0); +float nearestEdgeDistance = 1.0e30; +int nearestPrimitiveIndex = -1; +for (int i = range.x; i < range.y; i++) +{ +ivec2 segmentUv = vectorIndexToUv(i, segmentTextureSize); +vec4 segment = texelFetch(u_vectorSegmentTexture, segmentUv, 0); +int primitiveIndex = int(texelFetch(u_vectorSegmentPrimitiveIndicesTexture, segmentUv, 0).r); +ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize); +float width = texelFetch(u_vectorWidthTexture, primitiveUv, 0).r; +float halfWidth = abs(width) * 0.5; +vec2 offsetToLine = vectorOffsetToLine(vectorUv, segment); +#if defined(VECTOR_WIDTH_MIXED_UNITS) +float edgeDistance = width < 0.0 +? (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter +: length(screenFromUv * offsetToLine) - halfWidth; +#elif defined(VECTOR_WIDTH_IN_METERS) +float edgeDistance = (length(metersFromUv * offsetToLine) - halfWidth) * pixelsPerMeter; +#else +float edgeDistance = length(screenFromUv * offsetToLine) - halfWidth; +#endif +if (edgeDistance < nearestEdgeDistance) +{ +nearestEdgeDistance = edgeDistance; +nearestPrimitiveIndex = primitiveIndex; +} +if (nearestEdgeDistance <= -vectorCoverageRadius) +{ +break; +} +} +if (nearestEdgeDistance > vectorCoverageRadius) +{ +return baseColor; +} +#ifdef VECTOR_ANTIALIAS +float coverage = 1.0 - smoothstep(-vectorCoverageRadius, vectorCoverageRadius, nearestEdgeDistance); +#else +float coverage = 1.0; +#endif +vectorPickPrimitiveIndex = nearestPrimitiveIndex; +ivec2 primitiveUv = vectorIndexToUv(nearestPrimitiveIndex, primitiveTextureSize); +vec4 vectorColor = texelFetch(u_vectorColorTexture, primitiveUv, 0); +vectorColor.a *= coverage; +return vectorColor * vec4(vectorColor.aaa, 1.0) + baseColor * (1.0 - vectorColor.a); +#else +return baseColor; +#endif +} +vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize) +{ +if (!inside || primitiveIndex < 0) +{ +return baseColor; +} +vectorPickPrimitiveIndex = primitiveIndex; +ivec2 primitiveUv = vectorIndexToUv(primitiveIndex, primitiveTextureSize); +vec4 fillColor = texelFetch(u_vectorColorTexture, primitiveUv, 0); +return fillColor * vec4(fillColor.aaa, 1.0) + baseColor * (1.0 - fillColor.a); +} +bool vectorEdgeCrossesRay(vec4 edge, vec2 p) +{ +if ((edge.y > p.y) == (edge.w > p.y)) +{ +return false; +} +float t = (p.y - edge.y) / (edge.w - edge.y); +float xIntersect = edge.x + t * (edge.z - edge.x); +return p.x < xIntersect; +} +vec4 vectorPolygonRender(vec2 vectorUv, vec4 baseColor) +{ +#ifdef HAS_VECTOR_POLYGONS +ivec2 range = vectorCellRange(vectorUv, u_vectorPolygonGridCellIndicesTexture); +ivec2 edgeTextureSize = textureSize(u_vectorPolygonEdgeTexture, 0); +ivec2 primitiveTextureSize = textureSize(u_vectorColorTexture, 0); +int currentPrimitive = -1; +bool inside = false; +for (int i = range.x; i < range.y; i++) +{ +ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); +vec4 edge = texelFetch(u_vectorPolygonEdgeTexture, edgeUv, 0); +int primitiveIndex = int(texelFetch(u_vectorPolygonEdgePrimitiveIndicesTexture, edgeUv, 0).r); +if (primitiveIndex != currentPrimitive) +{ +baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); +currentPrimitive = primitiveIndex; +inside = false; +} +if (vectorEdgeCrossesRay(edge, vectorUv)) +{ +inside = !inside; +} +} +baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); +return baseColor; +#else +return baseColor; +#endif +} +vec4 vectorPickColorOver(vec4 surfacePickColor) +{ +if (vectorPickPrimitiveIndex < 0) +{ +return surfacePickColor; +} +ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0); +return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0); +} +bool vectorClip(vec2 uv) +{ +uv = clamp(uv, vec2(0.0), vec2(1.0)); +ivec2 range = vectorCellRange(uv, u_clippingGridCellIndicesTexture); +ivec2 edgeTextureSize = textureSize(u_clippingEdgeTexture, 0); +int currentPrimitive = -1; +bool inside = false; +for (int i = range.x; i < range.y; i++) +{ +ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); +int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r); +if (primitiveIndex != currentPrimitive) +{ +if (inside) +{ +return true; +} +currentPrimitive = primitiveIndex; +inside = false; +} +vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0); +if (vectorEdgeCrossesRay(edge, uv)) +{ +inside = !inside; } -float threshold = 0.01; -if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) { -v_regionIndex = regionIndex; } +return inside; } +`;var _xe={name:"ModelClippingPolygonsPipelineStage"},blt=new U,xlt=new U,gxe=ie.MAX_VALUE;_xe.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,de.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,de.FRAGMENT),r.addVarying("vec2","v_clippingUv"),r.addUniform("vec2","u_clippingCameraUv",de.VERTEX),r.addUniform("vec2","u_clippingRectangleInverseSize",de.VERTEX),r.addVertexLines(Jz),r.addFragmentLines(Ky),r.addFragmentLines($z);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??gxe,a=s.width*.5,c=s.west+a,u=n.camera.positionCartographic,f=P.negativePiToPi(u.longitude-c)+a;return U.fromElements(f/s.width,(u.latitude-s.south)/s.height,blt)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??gxe;return U.fromElements(1/s.width,1/s.height,xlt)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=Mt(o,e.uniformMap)};var Zz=_xe;var Qz=`void modelVectorLookupStage(ProcessedAttributes attributes) +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; } -`;var a2=`void modelClippingPolygonsStage() +`;var eV=`void modelVectorLookupStage(inout vec4 color) { -vec2 clippingPosition = v_clippingPosition; -int regionIndex = v_regionIndex; -czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex); +color = vectorPolygonRender(v_vectorUv, color); +color = vectorPolylineRender(v_vectorUv, color); } -`;var Kre={name:"ModelClippingPolygonsPipelineStage"};Kre.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(s2),o.addFragmentLines(a2);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=xt(r,e.uniformMap)};var c2=Kre;function $re(e,t){T.typeOf.object("model",e),T.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties($re.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){c(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 l2=$re;var u2=`mat4 getInstancingTransform() +`;var Tlt={name:"ModelVectorLookupPipelineStage",process:vlt},Elt=new U,Clt=new U;function vlt(e,t,n){let i=e.shaderBuilder,r=t._vectorData,o=r.hasPolylines,s=r.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,de.BOTH),o&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,de.FRAGMENT),r.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,de.FRAGMENT),r.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",de.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",de.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",de.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(Qz),i.addFragmentLines(Ky),i.addFragmentLines(eV);let a=r.rectangle,c=function(){return n.context.defaultTexture},u={u_vectorCameraUv:function(){let f=t._vectorData?.rectangle??a,d=n.camera.positionCartographic,p=f.width*.5,g=f.west+p,m=P.negativePiToPi(d.longitude-g)+p;return U.fromElements(m/f.width,(d.latitude-f.south)/f.height,Elt)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,Clt)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};o&&(u.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},u.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},u.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},u.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},r.hasMeterWidths&&(u.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(u.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},u.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},u.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=Mt(u,e.uniformMap)}var tV=Tlt;function yxe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(yxe.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 nV=yxe;var iV=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES @@ -4206,7 +5514,7 @@ translation2D.x, translation2D.y, translation2D.z, 1.0 return instancingTransform2D; } #endif -`;var f2=`void instancingStage(inout ProcessedAttributes attributes) +`;var rV=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); @@ -4220,7 +5528,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var d2=`void legacyInstancingStage( +`;var oV=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) @@ -4236,7 +5544,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var h2=new F,QHe=new F,JHe=new F,Qre={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:ise,_transformsToTypedArray:C9};Qre.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(u2);let s=e.model,a=s.sceneGraph,l=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];mGe(e,n,i,h,u,f),gGe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,h2);return u?F.multiplyTransformation(n.context.uniformState.view3D,g,h2):(n.mode!==oe.SCENE3D&&(g=Ot.basisTo2D(n.mapProjection,g,h2)),F.multiplyTransformation(n.context.uniformState.view,g,h2))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,l.computedTransform,QHe)},r.addVertexLines(d2)):r.addVertexLines(f2),u){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,m=F.fromTranslation(l.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,m,JHe)}}e.uniformMap=xt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var Uv=new F,eGe=new d;function tGe(e,t,n,i,o){let r=F.multiplyTransformation(t,e,Uv);return r=F.multiplyTransformation(r,n,Uv),o=Ot.basisTo2D(i.mapProjection,r,o),o}function nGe(e,t,n,i,o){let r=F.fromTranslation(e,Uv),s=F.multiplyTransformation(t,r,Uv);s=F.multiplyTransformation(s,n,Uv);let a=F.getTranslation(s,eGe);return o=Hi.computeActualEllipsoidPosition(i,a,o),o}function Jre(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var ese=new F,tse=new F,iGe=new F,oGe=new d;function rGe(e,t,n,i){let o=ese,r=tse;Jre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u<l;u++){let f=e[u],h=tGe(f,o,r,n,iGe),p=F.getTranslation(h,oGe),g=d.subtract(p,a,p);i[u]=F.setTranslation(h,g,i[u])}return i}function sGe(e,t,n,i){let o=ese,r=tse;Jre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u<l;u++){let f=e[u],h=nGe(f,o,r,n,f);i[u]=d.subtract(h,a,i[u])}return i}var aGe=new d,cGe=new d;function nse(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,aGe),r=Hi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,cGe),a=Hi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=d.lerp(r,a,.5,new d)}function C9(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 lGe(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 uGe=new d,fGe=new Le,dGe=new d;function ise(e,t,n){let i=new Array(t),o=$t.getAttributeBySemantic(e,rs.TRANSLATION),r=$t.getAttributeBySemantic(e,rs.ROTATION),s=$t.getAttributeBySemantic(e,rs.SCALE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=c(o),f=c(r),h=c(s),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=Ln.dequantize(g,r.componentDatatype,r.type,t));let m;h?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let x=new d(p[b*3],p[b*3+1],p[b*3+2],uGe);d.maximumByComponent(a,x,a),d.minimumByComponent(l,x,l);let A=new Le(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,fGe),E=new d(m[b*3],m[b*3+1],m[b*3+2],dGe),S=F.fromTranslationQuaternionRotationScale(x,A,E,new F);i[b]=S}let y=n.runtimeNode;return y.instancingTranslationMin=l,y.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function hGe(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<t;l++){let u=new d(o[l*3],o[l*3+1],o[l*3+2]);i[l]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function E9(e,t){let n=bt.createVertexBuffer({context:t.context,typedArray:e,usage:Be.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function mGe(e,t,n,i,o,r){let s=$t.getAttributeBySemantic(n,rs.ROTATION);c(s)?pGe(e,n,i,t,o,r):_Ge(e,n,i,t,o)}function pGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,l=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!c(p)){h=ise(t,a,e);let b=C9(h);p=E9(b,i),l._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(Zre(e,p,n,f),!o)return;let g=We(i);g.mode=oe.COLUMBUS_VIEW,nse(e,g);let m=u.instancingTransformsBuffer2D;if(!c(m)){let b=rGe(h,e,g,h),x=C9(b);m=E9(x,i),l._modelResources.push(m),u.instancingTransformsBuffer2D=m}Zre(e,m,n,"Transform2D")}function _Ge(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,l=$t.getAttributeBySemantic(t,rs.TRANSLATION),u=$t.getAttributeBySemantic(t,rs.SCALE);if(c(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),A9(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!c(l))return;let f,h=l.typedArray;if(c(h)?f=hGe(l,l.count,e):c(a.instancingTranslationMin)||(a.instancingTranslationMin=l.min,a.instancingTranslationMax=l.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),A9(e,l.buffer,l.byteOffset,l.byteStride,n,"Translation"),!o&&!r)return;let g=We(i);g.mode=oe.COLUMBUS_VIEW,nse(e,g);let m=a.instancingTranslationBuffer2D;if(!c(m)){let A=sGe(f,e,g,f),E=lGe(A);r&&(a.transformsTypedArray=E),m=E9(E,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;A9(e,m,0,void 0,n,"Translation2D")}function Zre(e,t,n,i){let r=$.getSizeInBytes($.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],l=e.shaderBuilder;l.addAttribute("vec4",`a_instancing${i}Row0`),l.addAttribute("vec4",`a_instancing${i}Row1`),l.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function A9(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function gGe(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===rs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:nn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var m2=Qre;var S9={};S9.name="ModelMatrixUpdateStage";S9.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;ose(e,t,o,e.transformToRoot),e._transformDirty=!1}};function yGe(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=$t.getCullFace(e.modelMatrix,e.primitiveType)}function ose(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];yGe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),ose(a,t,n,i),a._transformDirty=!1}}var p2=S9;var rse={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:sse,_countGeneratedBuffers:ase};rse.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;sse(i,o),ase(i,r)};function sse(e,t){if(!c(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r.buffer)&&e.addBuffer(r.buffer,!1)}}function ase(e,t){c(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),c(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),c(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var _2=rse;function qA(e){e=e??W.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;T.typeOf.object("options.node",t),T.typeOf.object("options.transform",n),T.typeOf.object("options.transformToRoot",i),T.typeOf.object("options.sceneGraph",o),T.typeOf.object("options.children",r),this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,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,bGe(this)}Object.defineProperties(qA.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=F.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 c(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new C("The translation of a node cannot be set if it was defined using a matrix in the model.");let n=t.translation;d.equals(n,e)||(t.translation=d.clone(e,t.translation),w9(this,t))}},rotation:{get:function(){return c(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new C("The rotation of a node cannot be set if it was defined using a matrix in the model.");let n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),w9(this,t))}},scale:{get:function(){return c(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new C("The scale of a node cannot be set if it was defined using a matrix in the model.");let n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),w9(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;if(this._morphWeights.length!==t)throw new C("value must have the same length as the original weights array.");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 bGe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;c(o.matrix)||(e._transformParameters=new eb(o.translation,o.rotation,o.scale)),c(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(c(r)){let l=e.sceneGraph._runtimeArticulations[r];c(l)&&l.runtimeNodes.push(e)}}function w9(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}qA.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>=this.children.length)throw new C("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]};qA.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,c(e.instances)&&t.push(m2),t.push(_2),n.push(p2)};qA.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};qA.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!c(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){c(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var g2=qA;var cse={name:"AlphaPipelineStage"};cse.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===De.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;c(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ge.FRAGMENT),s.addUniform("float","u_alphaCutoff",ge.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var y2=cse;var lse={name:"BatchTexturePipelineStage"};lse.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 l=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return l.batchTexture??l.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return l.textureStep},l.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var b2=lse;var use={name:"ClassificationPipelineStage"};use.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;c(o.batchLengths)||xGe(t,o)};function xGe(e,t){let n=$t.getAttributeBySemantic(e,ht.POSITION);if(!c(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=c(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=$t.getAttributeBySemantic(e,ht.FEATURE_ID,0);if(!c(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let l=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=l[h],g=0;for(let y=1;y<s;y++){let b=r?i[y]:y,x=l[b];if(x!==p){let A=y-g,E=y;u.push(A),f.push(E),g=E,p=x}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var x2=use;var T2=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +`;var sV=new M,Slt=new M,wlt=new M,bxe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:vxe,_transformsToTypedArray:hQ};bxe.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(iV);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];jlt(e,n,i,d,u,f),Wlt(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",de.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",de.VERTEX),p.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,sV);return u?M.multiplyTransformation(n.context.uniformState.view3D,g,sV):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,sV)),M.multiplyTransformation(n.context.uniformState.view,g,sV))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,Slt)},o.addVertexLines(oV)):o.addVertexLines(rV),u){o.addDefine("USE_2D_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_modelView2D",de.VERTEX);let g=n.context,m=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,m,wlt)}}e.uniformMap=Mt(p,e.uniformMap),e.instanceCount=r,Zn(e.attributes,d)};var T1=new M,Ilt=new h;function Plt(e,t,n,i,r){let o=M.multiplyTransformation(t,e,T1);return o=M.multiplyTransformation(o,n,T1),r=At.basisTo2D(i.mapProjection,o,r),r}function Dlt(e,t,n,i,r){let o=M.fromTranslation(e,T1),s=M.multiplyTransformation(t,o,T1);s=M.multiplyTransformation(s,n,T1);let a=M.getTranslation(s,Ilt);return r=gr.computeActualEllipsoidPosition(i,a,r),r}function xxe(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(M.multiplyTransformation(i.modelMatrix,r.components.transform,t),M.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(r.computedModelMatrix,t),M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),M.clone(M.IDENTITY,n))}var Txe=new M,Exe=new M,Rlt=new M,Olt=new h;function Mlt(e,t,n,i){let r=Txe,o=Exe;xxe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Plt(f,r,o,n,Rlt),p=M.getTranslation(d,Olt),g=h.subtract(p,a,p);i[u]=M.setTranslation(d,g,i[u])}return i}function Nlt(e,t,n,i){let r=Txe,o=Exe;xxe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Dlt(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var Llt=new h,Flt=new h;function Cxe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=M.multiplyByPoint(i,n.instancingTranslationMin,Llt),o=gr.computeActualEllipsoidPosition(t,r,r),s=M.multiplyByPoint(i,n.instancingTranslationMax,Flt),a=gr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function hQ(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function Blt(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var klt=new h,Ult=new Le,zlt=new h;function vxe(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,Bo.TRANSLATION),o=xt.getAttributeBySemantic(e,Bo.ROTATION),s=xt.getAttributeBySemantic(e,Bo.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=cn.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],klt);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let x=new Le(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,Ult),T=new h(m[A*3],m[A*3+1],m[A*3+2],zlt),E=M.fromTranslationQuaternionRotationScale(b,x,T,new M);i[A]=E}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function Vlt(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function mQ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function jlt(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Bo.ROTATION);l(s)||o?Hlt(e,n,i,t,r,o):Glt(e,n,i,t,r)}function Hlt(e,t,n,i,r,o){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=vxe(t,a,e);let A=hQ(d);p=mQ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(Axe(e,p,n,f),!r)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Cxe(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=Mlt(d,e,g,d),b=hQ(A);m=mQ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Axe(e,m,n,"Transform2D")}function Glt(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,Bo.TRANSLATION),u=xt.getAttributeBySemantic(t,Bo.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),dQ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=Vlt(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),dQ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Cxe(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=Nlt(f,e,g,f),T=Blt(x);o&&(a.transformsTypedArray=T),m=mQ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;dQ(e,m,0,void 0,n,"Translation2D")}function Axe(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*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`),Zn(n,a)}function dQ(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function Wlt(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===Bo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Vt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var aV=bxe;var Sxe=[],pQ={};pQ.name="ModelMatrixUpdateStage";pQ.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let r=i?t._computedModelMatrix2D:t._computedModelMatrix;wxe(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function qlt(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function wxe(e,t,n,i,r){let o,s=Sxe[r];l(s)||(s=Sxe[r]=new M),i=M.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(o=0;o<a;o++){let u=e.runtimePrimitives[o];qlt(u.drawCommand,n,i)}let c=e.children.length;for(o=0;o<c;o++){let u=t._runtimeNodes[e.children[o]];if(u._transformToRoot=M.clone(i,u._transformToRoot),!u.show){u._transformDirty=!0;continue}wxe(u,t,n,i,r+1),u._transformDirty=!1}}var cV=pQ;var Ixe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Pxe,_countGeneratedBuffers:Dxe};Ixe.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;Pxe(i,r),Dxe(i,o)};function Pxe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function Dxe(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 lV=Ixe;function eS(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,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,Ylt(this)}Object.defineProperties(eS.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=M.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;h.equals(n,e)||(t.translation=h.clone(e,t.translation),gQ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),gQ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),gQ(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 Ylt(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new lx(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function gQ(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}eS.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};eS.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(aV),t.push(lV),n.push(cV)};eS.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};eS.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 r=0;r<i;r++){l(t[r])||(t[r]=new M);let o=M.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=M.inverseTransformation(o,t[r]);t[r]=M.multiplyTransformation(s,n[r],t[r])}};var uV=eS;var Rxe={name:"AlphaPipelineStage"};Rxe.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=rn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,de.FRAGMENT),s.addUniform("float","u_alphaCutoff",de.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var fV=Rxe;var Oxe={name:"BatchTexturePipelineStage"};Oxe.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Mt(r,e.uniformMap)};var dV=Oxe;var Mxe={name:"ClassificationPipelineStage"};Mxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||Xlt(t,r)};function Xlt(e,t){let n=xt.getAttributeBySemantic(e,ct.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=xt.getAttributeBySemantic(e,ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<s;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var hV=Mxe;var mV=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -4260,7 +5568,7 @@ positionMC *= show; filterByPassType(positionMC, feature.color); #endif } -`;var A2=`void filterByPassType(vec4 featureColor) +`;var pV=`void filterByPassType(vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -4297,7 +5605,7 @@ material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); #endif material.alpha *= featureColor.a; } -`;var fse={name:"CPUStylingPipelineStage"};fse.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(T2),o.addFragmentLines(A2),o.addDefine("USE_CPU_STYLING",void 0,ge.BOTH),c(i.color)||(o.addUniform("float",Ab.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),e.uniformMap[Ab.COLOR_BLEND_UNIFORM_NAME]=function(){return kc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ge.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===De.TRANSLUCENT}};var C2=fse;var dse={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};dse.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var zg=Object.freeze(dse);var E2=`void customShaderStage( +`;var Nxe={name:"CPUStylingPipelineStage"};Nxe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(mV),r.addFragmentLines(pV),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",Ox.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[Ox.COLOR_BLEND_UNIFORM_NAME]=function(){return Ul.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var gV=Nxe;var _Q={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};_Q.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(_Q);var $y=_Q;var _V=`void customShaderStage( inout czm_modelVertexOutput vsOutput, inout ProcessedAttributes attributes, FeatureIds featureIds, @@ -4314,7 +5622,7 @@ vsInput.metadataStatistics = metadataStatistics; vertexMain(vsInput, vsOutput); attributes.positionMC = vsOutput.positionMC; } -`;var S2=`void customShaderStage( +`;var yV=`void customShaderStage( inout czm_modelMaterial material, ProcessedAttributes attributes, FeatureIds featureIds, @@ -4330,36 +5638,195 @@ fsInput.metadataClass = metadataClass; fsInput.metadataStatistics = metadataStatistics; fragmentMain(fsInput, material); } -`;var w2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { +`;var AV=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); } -`;var v2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +`;var bV=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); setFeatureIdVaryings(); } -`;var Fi={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()"};Fi.process=function(e,t,n){let i=e.shaderBuilder;TGe(i);let o=e.runtimeNode.node.instances;c(o)&&AGe(e,o,n),CGe(e,t,n),i.addVertexLines(v2),i.addFragmentLines(w2)};function TGe(e){e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_VS,Fi.STRUCT_NAME_FEATURE_IDS,ge.VERTEX),e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_FS,Fi.STRUCT_NAME_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Fi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ge.VERTEX)}function AGe(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 An.FeatureIdAttribute?EGe(e,s,a):hse(e,s,a,o,1,n);let l=s.label;c(l)&&mse(e,a,l,ge.BOTH)}}function CGe(e,t,n){let i=t.featureIds,r=$t.getAttributeBySemantic(t,ht.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],l=a.positionalLabel,u=ge.BOTH;a instanceof An.FeatureIdAttribute?SGe(e,a,l):a instanceof An.FeatureIdImplicitRange?hse(e,a,l,r,void 0,n):(wGe(e,a,l,s,n),u=ge.FRAGMENT);let f=a.label;c(f)&&mse(e,l,f,u)}}function EGe(e,t,n){let i=e.shaderBuilder;i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,l=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[l]),i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function SGe(e,t,n){let i=e.shaderBuilder;i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Fi.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(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function hse(e,t,n,i,o,r){vGe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let l=`v_implicit_${n}`;s.addVarying("float",l),s.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${l} = ${a};`]),s.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${l}));`])}function wGe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let l=a.channels,u=e.shaderBuilder;u.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,ge.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,g=a.transform;if(c(g)&&!J.equals(g,J.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,ge.FRAGMENT),s[b]=function(){return g},p=`vec2(${b} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${l}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function mse(e,t,n,i){let o=e.shaderBuilder,r=ge.includesVertexShader(i);r&&o.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function vGe(e,t,n,i,o){let r=e.model,s,a;if(c(t.repeat)){let u=DGe(t,n);s=bt.createVertexBuffer({context:o.context,typedArray:u,usage:Be.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let l={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:$.FLOAT,strideInBytes:$.getSizeInBytes($.FLOAT),offsetInBytes:0};e.attributes.push(l)}function DGe(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 Cb=Fi;var D2=`void metadataStage( +`;var ur={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()"};ur.process=function(e,t,n){let i=e.shaderBuilder;Klt(i);let r=e.runtimeNode.node.instances;l(r)&&$lt(e,r,n),Jlt(e,t,n),i.addVertexLines(bV),i.addFragmentLines(AV)};function Klt(e){e.addStruct(ur.STRUCT_ID_FEATURE_IDS_VS,ur.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(ur.STRUCT_ID_FEATURE_IDS_FS,ur.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(ur.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,ur.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function $lt(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof Cn.FeatureIdAttribute?Zlt(e,s,a):Lxe(e,s,a,r,1,n);let c=s.label;l(c)&&Fxe(e,a,c,de.BOTH)}}function Jlt(e,t,n){let i=t.featureIds,o=xt.getAttributeBySemantic(t,ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=de.BOTH;a instanceof Cn.FeatureIdAttribute?Qlt(e,a,c):a instanceof Cn.FeatureIdImplicitRange?Lxe(e,a,c,o,void 0,n):(eut(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&Fxe(e,c,f,u)}}function Zlt(e,t,n){let i=e.shaderBuilder;i.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(ur.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Qlt(e,t,n){let i=e.shaderBuilder;i.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Lxe(e,t,n,i,r,o){tut(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(ur.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function eut(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return a.texture??r.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,de.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,de.FRAGMENT),s[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Fxe(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function tut(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=nut(t,n);s=tt.createVertexBuffer({context:r.context,typedArray:u,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s),o.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function nut(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var Mx=ur;var xV=`void metadataStage( +FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes ) { -initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); } -`;var P2=`void metadataStage( +`;var TV=`void metadataStage( +FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes ) { -initializeMetadata(metadata, metadataClass, metadataStatistics, attributes); +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); setMetadataVaryings(); } -`;var Ci={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"}]};Ci.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,l=PGe(r.propertyAttributes,t,a),u=OGe(r.propertyTextures,a),f=l.concat(u);MGe(i,f),FGe(i),i.addVertexLines(P2),i.addFragmentLines(D2);for(let h=0;h<l.length;h++){let p=l[h];BGe(e,p)}for(let h=0;h<u.length;h++){let p=u[h];UGe(e,p)}};function PGe(e,t,n){return c(e)?e.flatMap(i=>IGe(i,t,n)):[]}function IGe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=$t,s=e.class.id,a=n?.classes[s],l=Object.entries(e.properties),u=new Array(l.length);for(let f=0;f<l.length;f++){let[h,p]=l[f],g=i(t,p.attribute),{glslType:m,variableName:y}=o(g);u[f]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[h],shaderDestination:ge.BOTH}}return u}function OGe(e,t){return c(e)?e.flatMap(n=>RGe(n,t)):[]}function RGe(e,t){let{sanitizeGlslIdentifier:n}=$t,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,l])=>l.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[l,u]=r[a];s[a]={metadataVariable:n(l),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[l],shaderDestination:ge.FRAGMENT}}return s}function MGe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:l,glslType:u,propertyStatistics:f}=t[a];n.add(u),c(f)&&l!==at.ENUM&&i.add(u)}let o=Ci.METADATA_CLASS_FIELDS;for(let a of n){let l=`${a}MetadataClass`;s(l,a,o)}let r=Ci.METADATA_STATISTICS_FIELDS;for(let a of i){let l=`${a}MetadataStatistics`;s(l,a,r)}function s(a,l,u){e.addStruct(a,a,ge.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?NGe(l):l;e.addStructField(a,p,h)}}}var LGe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function NGe(e){let t=LGe[e];return c(t)?t:e}function FGe(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,ge.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,ge.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,ge.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ge.VERTEX)}function BGe(e,t){kGe(e,t),pse(e.shaderBuilder,t),_se(e.shaderBuilder,t)}function kGe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=yse({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ge.BOTH,property:o});n.addStructField(Ci.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function UGe(e,t){VGe(e,t),pse(e.shaderBuilder,t),_se(e.shaderBuilder,t)}function VGe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:l,index:u,texture:f,transform:h}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ge.FRAGMENT),i[p]=()=>f),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,m=g;if(c(h)&&!J.equals(h,J.IDENTITY)){let E=`${p}Transform`;n.addUniform("mat3",E,ge.FRAGMENT),i[E]=function(){return h},m=`vec2(${E} * vec3(${g}, 1.0))`}let y=`texture(${p}, ${m}).${l}`,b=s.unpackInShader(y),x=yse({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),A=`metadata.${o} = ${x};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[A])}function pse(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=gse(Ci.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function _se(e,t){let{propertyStatistics:n}=t;if(!c(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===at.ENUM)return;let s=Ci.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,l=gse(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,l),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,l))}function gse(e,t,n,i){function o(r){let s=t[r.specName];if(c(s))return`${n}.${r.shaderName} = ${i}(${s});`}return c(t)?e.map(o).filter(c):[]}function yse(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:l,shaderDestination:u}=e;s.addUniform(l,o,u),s.addUniform(l,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var wd=Ci;var zGe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Eb=Object.freeze(zGe);var ra={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:dt};ra.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:l}=s;c(a)&&(e.lightingOptions.lightingModel=a),l===Eb.TRANSLUCENT?r.pass=De.TRANSLUCENT:l===Eb.OPAQUE&&(r.pass=void 0);let u=KGe(s,t);if(!u.customShaderEnabled)return;if(JGe(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),c(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),c(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=zg.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[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=xt(e.uniformMap,s.uniformMap)};function HGe(e){let t={};for(let n=0;n<e.length;n++){let i=$t.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var GGe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},jGe={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 bse(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=GGe[t],i=jGe[t];if(c(n))return{attributeField:[n,e],value:i}}function WGe(e,t){if(!c(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=xse(t,n,!1),o=Tse(t,n,!1),r,s=[],a=[];for(let l in i){if(!i.hasOwnProperty(l))continue;let f=[i[l].glslType,l];s.push(f),r=`vsInput.attributes.${l} = attributes.${l};`,a.push(r)}for(let l=0;l<o.length;l++){let u=o[l],f=bse(u);if(!c(f))return ra._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function qGe(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 YGe(e,t){if(!c(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=xse(t,n,!0),o=Tse(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let h=[i[u].glslType,u];s.push(h),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],h=bse(f);if(!c(h))return ra._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${f} = ${h.value};`,a.push(r)}let l=qGe(e);return{enabled:!0,attributeFields:s.concat(l.attributeFields),initializationLines:l.initializationLines.concat(a)}}var XGe={positionWC:!0,positionEC:!0};function xse(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 Tse(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||XGe.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 KGe(e,t){let n=HGe(t.attributes),i=WGe(e,n),o=YGe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function $Ge(e,t){let n=ra.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ra.STRUCT_NAME_ATTRIBUTES,ge.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=ra.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ra.STRUCT_NAME_VERTEX_INPUT,ge.VERTEX),e.addStructField(n,ra.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Cb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,wd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,wd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,wd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ra.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ra.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ge.VERTEX),e.addFunctionLines(r,o)}function ZGe(e,t){let n=ra.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ra.STRUCT_NAME_ATTRIBUTES,ge.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=ra.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ra.STRUCT_NAME_FRAGMENT_INPUT,ge.FRAGMENT),e.addStructField(n,ra.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Cb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,wd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,wd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,wd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ra.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ra.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ge.FRAGMENT),e.addFunctionLines(r,o)}var QGe=[];function JGe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=QGe;i.enabled&&($Ge(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,E2),e.addVertexLines(r)),o.enabled&&(ZGe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,S2),e.addFragmentLines(r))}var I2=ra;var Vv={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};Vv.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=c(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ge.VERTEX),i.addFunction(Vv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Vv.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ge.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let l=s[a],u=l.quantization;if(!c(u))continue;let f=l.semantic===ht.POSITION,h=l.semantic===ht.TEXCOORD;if(r&&!f&&!h)continue;let p=$t.getAttributeInfo(l);t5e(i,p),e5e(e,p)}};function e5e(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,ge.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,l=t.glslType;n.addUniform(l,s,ge.VERTEX),n.addUniform(l,a,ge.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Ase(u,0),f=Ase(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Ase(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function t5e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=n5e(n,i):o=i5e(n),e.addFunctionLines(Vv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function n5e(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 i5e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var O2=Vv;var R2=`void geometryStage(out ProcessedAttributes attributes) +`;var Ii={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(FeatureIds featureIds, 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"}]};Ii.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=xut(r,t),f=iut(o.propertyAttributes,t,a),d=out(o.propertyTextures,a),p=cut(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);fut(i,g),mut(i),i.addVertexLines(TV),i.addFragmentLines(xV);for(let m=0;m<f.length;m++){let y=f[m];put(e,y)}for(let m=0;m<d.length;m++){let y=d[m];_ut(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Aut(e,y,c)}};function iut(e,t,n){return l(e)?e.flatMap(i=>rut(i,t,n)):[]}function rut(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:de.BOTH}}return u}function out(e,t){return l(e)?e.flatMap(n=>sut(n,t)):[]}function sut(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:de.FRAGMENT}}return s}var aut=4;function cut(e,t,n,i,r){if(!l(e))return[];let o=uut(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>lut(s,o,i,r))}function lut(e,t,n,i){let{sanitizeGlslIdentifier:r}=xt,o=e.class,s=n?.classes[o.id],a=t.get(String(e.id))??{},c=a.shaderDestination??de.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(aut))continue;let y=u[g],A=de.intersection(Cut(g,i),c);if(A===de.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:s?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return d}function uut(e,t){let n=new Map;function i(a,c){let u=a?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:a.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let a=0;a<r.length;a++){let c=r[a],u=l(c?.textureReader);i(c,u?de.FRAGMENT:de.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,de.BOTH)}return n}function fut(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let r=Ii.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Ii.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,de.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?hut(c):c;e.addStructField(a,p,d)}}}var dut={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function hut(e){let t=dut[e];return l(t)?t:e}function mut(e){e.addStruct(Ii.STRUCT_ID_METADATA_VS,Ii.STRUCT_NAME_METADATA,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_FS,Ii.STRUCT_NAME_METADATA,de.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_VS,Ii.STRUCT_NAME_METADATA_CLASS,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_FS,Ii.STRUCT_NAME_METADATA_CLASS,de.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_VS,Ii.STRUCT_NAME_METADATA_STATISTICS,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_FS,Ii.STRUCT_NAME_METADATA_STATISTICS,de.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.VERTEX),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_SET_METADATA_VARYINGS,Ii.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,de.VERTEX)}function put(e,t){gut(e,t),yQ(e.shaderBuilder,t),AQ(e.shaderBuilder,t)}function gut(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=bQ({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:de.BOTH,property:r});n.addStructField(Ii.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Ii.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function _ut(e,t,n){yut(e,t,n),yQ(e.shaderBuilder,t),AQ(e.shaderBuilder,t)}function yut(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=a.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,de.FRAGMENT),r[g]=()=>d),i.addStructField(Ii.STRUCT_ID_METADATA_FS,s,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let S=`${g}Transform`;i.addUniform("mat3",S,de.FRAGMENT),r[S]=function(){return p},A=`vec2(${S} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=a.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let E=bQ({valueExpression:T,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:de.FRAGMENT,property:a}),v=`metadata.${o} = ${E};`;m.push(v),i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function yQ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=Bxe(Ii.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,s),de.includesVertexShader(o)&&(e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function AQ(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===bt.ENUM)return;let s=Ii.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Bxe(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,c),de.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Aut(e,t,n){but(e,t,n),yQ(e.shaderBuilder,t),AQ(e.shaderBuilder,t)}function but(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){yt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,de.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;de.includesVertexShader(g)&&i.addStructField(Ii.STRUCT_ID_METADATA_VS,s,o),de.includesFragmentShader(g)&&i.addStructField(Ii.STRUCT_ID_METADATA_FS,s,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=bQ({valueExpression:x,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:g,property:a??b}),E=`metadata.${o} = ${T};`;p.push(E),de.includesVertexShader(g)&&i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,p),de.includesFragmentShader(g)&&i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function Bxe(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function bQ(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function xut(e,t){let n=new Set,i=new Set;return Tut(e,n,i),Eut(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Tut(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&n.add(s);let o=i.usedVariablesVertex?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&t.add(s)}function Eut(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Oe.POINTS))return;let s=r.color?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let a=r.show?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function Cut(e,t){let n=t.usedInFragment.has(e)?de.FRAGMENT:de.NONE,i=t.usedInVertex.has(e)?de.VERTEX:de.NONE;return de.union(n,i)}var Vh=Ii;var kxe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(kxe);var Nx=kxe;var La={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:yt};La.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:s}=r,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Nx.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===Nx.OPAQUE&&(o.pass=void 0);let u=Out(s,t,e);if(!u.customShaderEnabled)return;if(Fut(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,de.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,de.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,de.FRAGMENT);let p=$y.getDefineName(s.mode);i.addDefine(p,void 0,de.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Mt(e.uniformMap,s.uniformMap)};function vut(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var Sut={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},wut={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 Uxe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Sut[t],i=wut[t];if(l(n))return{attributeField:[n,e],value:i}}function Iut(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!jxe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=zxe(t,r,!1),s=Vxe(t,r,!1),a,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),a=`vsInput.attributes.${f} = attributes.${f};`,u.push(a)}for(let f=0;f<s.length;f++){let d=s[f],p=Uxe(d);if(!l(p))return La._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${d} = ${p.value};`,u.push(a)}return{enabled:!0,attributeFields:c,initializationLines:u}}function Put(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 Dut(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!jxe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=zxe(t,r,!0),s=Vxe(t,r,!0),a,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),a=`fsInput.attributes.${d} = attributes.${d};`,u.push(a)}for(let d=0;d<s.length;d++){let p=s[d],g=Uxe(p);if(!l(g))return La._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),a=`fsInput.attributes.${p} = ${g.value};`,u.push(a)}let f=Put(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var Rut={positionWC:!0,positionEC:!0};function zxe(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],s=r;n&&r==="normalMC"?s="normalEC":n&&r==="tangentMC"&&(s="tangentEC",o.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=o)}return i}function Vxe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||Rut.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function Out(e,t,n){let i=vut(t.attributes),r=But(t,n.model.structuralMetadata),o=Iut(e,i,r),s=Dut(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function Mut(e,t){let n=La.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,La.STRUCT_NAME_ATTRIBUTES,de.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=La.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,La.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,La.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Mx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Vh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Vh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Vh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=La.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,La.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function Nut(e,t){let n=La.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,La.STRUCT_NAME_ATTRIBUTES,de.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=La.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,La.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,La.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Mx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Vh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Vh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Vh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=La.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,La.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var Lut=[];function Fut(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=Lut;i.enabled&&(Mut(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,_V),e.addVertexLines(o)),r.enabled&&(Nut(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,yV),e.addFragmentLines(o))}function But(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(a=>a.propertyTableId):[],o=new Set;function s(a,c){for(let u of a){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(r,t.propertyTables),o}function jxe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return La._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var EV=La;var E1={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};E1.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,de.VERTEX),i.addFunction(E1.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,E1.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,de.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===ct.POSITION,d=c.semantic===ct.TEXCOORD;if(o&&!f&&!d)continue;let p=xt.getAttributeInfo(c);Uut(i,p),kut(e,p)}};function kut(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,de.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,de.VERTEX),n.addUniform(c,a,de.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=Hxe(u,0),f=Hxe(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Hxe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function Uut(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=zut(n,i):r=Vut(n),e.addFunctionLines(E1.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function zut(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function Vut(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var CV=E1;var vV=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { +if (u_isEdgePass) { +return; +} +vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw; +vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord); +vec4 edgeId = texture(czm_edgeIdTexture, screenCoord); +float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord)); +float n = czm_currentFrustum.x; +float f = czm_currentFrustum.y; +vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord); +float geomDepthLinear = -geomEC.z; +float z_ndc_edge = edgeDepthWin * 2.0 - 1.0; +float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n)); +float d = abs(edgeDepthLinear - geomDepthLinear); +float pixelStepLinear = fwidth(geomDepthLinear); +float rel = geomDepthLinear * 0.0005; +float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel)); +if (d < eps && edgeId.r > 0.0) { +#ifdef HAS_EDGE_FEATURE_ID +float edgeFeatureId = edgeId.g; +float currentFeatureId = float(featureIds.featureId_0); +#endif +float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); +bool isBackground = geomDepthLinear > globeDepth; +bool drawEdge = isBackground; +#ifdef HAS_EDGE_FEATURE_ID +bool hasEdgeFeature = edgeFeatureId > 0.0; +bool hasCurrentFeature = currentFeatureId > 0.0; +bool featuresMatch = edgeFeatureId == currentFeatureId; +drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch; +#else +drawEdge = true; +#endif +if (drawEdge) { +color = edgeColor; +} +} +} +`;var Gxe={name:"EdgeDetectionPipelineStage"};Gxe.process=function(e){e.shaderBuilder.addFragmentLines([vV])};var SV=Gxe;var wV=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +layout(location = 1) out vec4 out_id; +layout(location = 2) out vec4 out_edgeDepth; +#endif +void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds) +{ +#ifdef HAS_EDGE_VISIBILITY +if (!u_isEdgePass) { +return; +} +float edgeTypeInt = v_edgeType * 255.0; +if (edgeTypeInt < 0.5) { +discard; +} +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +if (v_shouldDiscard > 0.5) { +discard; +} +} +vec4 finalColor = color; +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +if (v_edgeColor.a >= 0.0) { +finalColor = v_edgeColor; +} +#endif +#ifdef HAS_LINE_PATTERN +const float maskLength = 16.0; +float dashPosition = fract(v_lineCoord / maskLength); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(u_linePattern / pow(2.0, maskIndex)); +if (mod(maskTest, 2.0) < 1.0) { +discard; +} +#endif +color = finalColor; +#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +out_id = vec4(0.0); +out_id.r = edgeTypeInt; +#ifdef HAS_EDGE_FEATURE_ID +out_id.g = float(featureIds.featureId_0); +#else +out_id.g = 0.0; +#endif +out_edgeDepth = czm_packDepth(gl_FragCoord.z); +#endif +#endif +} +`;var IV=`#ifdef HAS_EDGE_VISIBILITY +void edgeVisibilityStageVS() { +if (!u_isEdgePass) { +return; +} +v_edgeType = a_edgeType; +v_faceNormalAView = czm_normal * a_faceNormalA; +v_faceNormalBView = czm_normal * a_faceNormalB; +v_edgeOffset = a_edgeOffset; +v_shouldDiscard = 0.0; +float edgeTypeInt = a_edgeType * 255.0; +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +vec3 normalA = normalize(v_faceNormalAView); +vec3 normalB = normalize(v_faceNormalBView); +const float perpTol = 2.5e-4; +vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0); +vec3 toEye1 = normalize(-currentPosEC.xyz); +float dotA1 = dot(normalA, toEye1); +float dotB1 = dot(normalB, toEye1); +vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0); +vec3 toEye2 = normalize(-otherPosEC.xyz); +float dotA2 = dot(normalA, toEye2); +float dotB2 = dot(normalB, toEye2); +if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) { +v_shouldDiscard = 1.0; +} +} +#ifdef HAS_EDGE_FEATURE_ID +v_featureId_0 = a_edgeFeatureId; +#endif +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +v_edgeColor = a_edgeColor; +#endif +#ifdef HAS_LINE_PATTERN +#ifdef HAS_EDGE_CUMULATIVE_DISTANCE +v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld; +#else +vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0); +vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw; +vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0); +vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw; +vec2 windowDir = otherScreen - currentScreen; +const float textureCoordinateBase = 8192.0; +if (abs(windowDir.x) > abs(windowDir.y)) { +v_lineCoord = textureCoordinateBase + currentScreen.x; +} else { +v_lineCoord = textureCoordinateBase + currentScreen.y; +} +#endif +#endif +vec4 posClip = gl_Position; +if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) { +vec4 currentClip = posClip; +vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0); +vec2 currentNDC = currentClip.xy / currentClip.w; +vec2 otherNDC = otherClip.xy / otherClip.w; +vec2 edgeDirNDC = otherNDC - currentNDC; +if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) { +edgeDirNDC = -edgeDirNDC; +} +edgeDirNDC = normalize(edgeDirNDC); +vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x); +float lineWidthPixels = u_lineWidth; +vec2 viewportSize = czm_viewport.zw; +vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w; +vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset; +posClip.xy += offsetClip; +} +gl_Position = posClip; +} +#endif +`;var xQ=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,s=t.count,a=n;return i&&(a=cn.dequantize(n,t.componentDatatype,o,s)),l(r)?e.dequantize(a,s,o,r):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(s),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let v=Y.createTypedArray(s,o);return c.getBufferData(v,u),v}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(s,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),E=e.createComponentsReader(s);for(let v=0;v<i;++v){let S=u+v*b;E(x,S,r,T);for(let I=0;I<r;++I)A[v*r+I]=T[I]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let a=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let o=r.quantizedVolumeStepSize,s=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,s,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,s,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,s,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,s,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,o),cn.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,s*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let s=t[r+0],a=t[r+1],c=t[r+2];i[r+0]=a,i[r+1]=c,i[r+2]=s}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+r;o[s]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new U;for(let a=0;a<n;a++)U.unpack(t,a*2,s),U.multiplyComponents(s,i,s),U.add(s,r,s),U.pack(s,o,a*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,s),h.multiplyComponents(s,i,s),h.add(s,r,s),h.pack(s,o,a*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,r,s),se.pack(s,o,a*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,s,a){let c=o;for(let u=0;u<s;++u)a[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let s=0;s<o;s++)h.unpack(t,s*3,r),M.multiplyByPoint(n,r,r),h.pack(r,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,s=new Float32Array(i);if(l(o))for(let a=0;a<i;a++)s[a]=r+Math.floor(a/o);else s.fill(r);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,s=e.createIndexTypedArray(o,r);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Oe.TRIANGLES)return i;if(n===Oe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Oe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Oe.TRIANGLES}, TRIANGLE_STRIP (${Oe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Oe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case je.UNSIGNED_BYTE:return new Uint8Array(n);case je.UNSIGNED_SHORT:return new Uint16Array(n);case je.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${je.UNSIGNED_BYTE}, UNSIGNED_SHORT (${je.UNSIGNED_SHORT}, or UNSIGNED_INT (${je.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new M,modelMatrix:new M,computedModelMatrix:new M},c=s._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,s,t,a),g=p.computedModelMatrix;l(r)&&(g=At.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,s=M.clone(t.computedTransform,r.nodeComputedTransform),a=M.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(a=M.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=M.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let u=M.multiplyTransformation(a,s,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=s,r.modelMatrix=a,r}static computeInstanceTransforms(t,n,i,r){let o=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,u=a.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(a,c,o);for(let p=0;p<o.length;p++){let g=o[p];a.transformInWorldSpace?(M.multiplyTransformation(g,i,g),M.multiplyTransformation(r,g,g)):M.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=xt.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let s;if("setIndex"in o){let c=xt.getAttributeBySemantic(r,ct.FEATURE_ID,o.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in o&&(s=e.readImplicitRangeAsTypedArray(o,r)),!l(s))return;let a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=s[c];return a}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let s=o*12,a=new M(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6],t[s+7],t[s+8],t[s+9],t[s+10],t[s+11],0,0,0,1);i.push(a)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=xt.getAttributeBySemantic(t,Bo.TRANSLATION),o=xt.getAttributeBySemantic(t,Bo.ROTATION),s=xt.getAttributeBySemantic(t,Bo.SCALE),a=l(r),c=l(o),u=l(s);if(!a&&!c&&!u)return;let f,d,p;a&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let g=0;g<n;g++){let m=a?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=M.fromTranslationQuaternionRotationScale(m,y,A,new M);i.push(b)}}},Fa=xQ;var tS=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),Wxe={name:"EdgeVisibilityPipelineStage"};Wxe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,de.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,de.FRAGMENT),i.addFragmentLines(wV),i.addVertexLines(IV),i.addUniform("bool","u_isEdgePass",de.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",de.VERTEX);let s=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let a=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=Hut(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=Gut(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,de.BOTH));let x,T,E=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(x=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,de.VERTEX));let v=jut(p.edgeIndices,p.edgeData,t.edgeVisibility),S=Wut(p.edgeIndices,p.edgeData,e,n.context,s,c,u,a,b,f,d,m,t.edgeVisibility,v,x,T);if(!l(S))return;S.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,de.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let I=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:S.vertexArray,indexCount:S.indexCount,primitiveType:Oe.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:I}};function jut(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let s=o.length/3,a=new Float32Array(o.length),c=new h;for(let u=0;u<s;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[u*3]=c.x,a[u*3+1]=c.y,a[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==tS.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=a.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=a[g],r[y+1]=a[g+1],r[y+2]=a[g+2],r[y+3]=a[m],r[y+4]=a[m+1],r[y+5]=a[m+2]}return r}function Hut(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,s=l(o)&&o.length>0?o[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!a&&!c)return[];let u=a?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(a){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],E=u[x+1],v=u[x+2];for(let S=0;S<3;S++){let I,R;S===0?(I=T,R=E):S===1?(I=E,R=v):(I=v,R=T);let O=Math.floor(y/4),L=y%4*2;if(y++,O>=b.length)break;let C=b[O]>>L&3;if(C===tS.HIDDEN)continue;let w=Math.min(I,R),D=Math.max(I,R),N=`${w},${D}`;if(p.has(N))continue;p.add(N),f.push(I,R);let F=-1;C===tS.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===tS.REPEATED_HARD?tS.HARD:C,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,E;for(let v=0;v<b.length;v++){let S=b[v];if(l(x)&&S===x){E=void 0;continue}if(!l(E)){E=S;continue}let I=E,R=S;if(E=S,I===R||s>0&&(I<0||I>=s||R<0||R>=s))continue;let O=Math.min(I,R),L=Math.max(I,R),_=`${O},${L}`;p.has(_)||(p.add(_),f.push(I,R),d.push({edgeType:tS.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function Gut(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,ct.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Fa.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!o&&!s&&!a)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:s?d=f/255:a&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function Wut(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,E=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,ct.POSITION),v=l(E.typedArray)?E.typedArray:Fa.readAttributeAsTypedArray(E),S=new Float32Array(x*3),I=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),L=new Float32Array(x*3),_=new Float32Array(x),C=l(m),w=C?new Float32Array(x):void 0,D;C&&(D=l(m.typedArray)?m.typedArray:Fa.readAttributeAsTypedArray(m));let N=l(c),F=N?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,B=l(d)?d.count:0;function j(Ke){if(!N)return;let Pe=Ke*4;F[Pe]=0,F[Pe+1]=0,F[P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=D[qe];w[ht]=tn,w[ht+1]=tn,w[ht+2]=Hn,w[ht+3]=Hn}let Yn=Ke*6,gi=g[Yn],zi=g[Yn+1],Si=g[Yn+2],ui=g[Yn+3],_i=g[Yn+4],zn=g[Yn+5];for(let tn=0;tn<4;tn++)R[(ht+tn)*3]=gi,R[(ht+tn)*3+1]=zi,R[(ht+tn)*3+2]=Si,O[(ht+tn)*3]=ui,O[(ht+tn)*3+1]=_i,O[(ht+tn)*3+2]=zn}let q=tt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=tt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=tt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=tt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=tt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=N?tt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?tt.createVertexBuffer({context:i,typedArray:w,usage:Me.STATIC_DRAW}):void 0,ge=A*2*3,we=x>65534,ve=we?new Uint32Array(ge):new Uint16Array(ge);for(let Ke=0;Ke<A;Ke++){let Pe=Ke*4,qe=Ke*6;ve[qe]=Pe,ve[qe+1]=Pe+1,ve[qe+2]=Pe+2,ve[qe+3]=Pe,ve[qe+4]=Pe+2,ve[qe+5]=Pe+3}let Re=tt.createIndexBuffer({context:i,typedArray:ve,usage:Me.STATIC_DRAW,indexDatatype:we?je.UNSIGNED_INT:je.UNSIGNED_SHORT}),Qe=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:s,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];N&&Qe.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&Qe.push({index:y,vertexBuffer:fe,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let He=n.runtimePrimitive.primitive;if(l(He.featureIds)&&He.featureIds.length>0){let Ke=He.featureIds[0];if(l(Ke.setIndex)){let Pe=He.attributes.find(qe=>qe.semantic===ct.FEATURE_ID&&qe.setIndex===Ke.setIndex);if(l(Pe)){let qe=l(Pe.typedArray)?Pe.typedArray:Fa.readAttributeAsTypedArray(Pe),st=new Float32Array(x);for(let jt=0;jt<A;jt++){let lt=e[jt*2],mt=lt<qe.length?qe[lt]:0;for(let ft=0;ft<4;ft++)st[jt*4+ft]=mt}let vt=tt.createVertexBuffer({context:i,typedArray:st,usage:Me.STATIC_DRAW});Qe.push({index:a,vertexBuffer:vt,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new Vn({context:i,attributes:Qe,indexBuffer:Re}),indexCount:ge,hasEdgeFeatureIds:l(He.featureIds)&&He.featureIds.length>0}}var PV=Wxe;var DV=`void geometryStage(out ProcessedAttributes attributes) { attributes.positionMC = v_positionMC; attributes.positionEC = v_positionEC; @@ -4377,7 +5844,7 @@ attributes.bitangentEC = normalize(v_bitangentEC); #endif setDynamicVaryings(attributes); } -`;var M2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +`;var RV=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { vec4 computedPosition; vec3 positionMC = attributes.positionMC; @@ -4405,7 +5872,7 @@ v_bitangentEC = normalize(normal * attributes.bitangentMC); setDynamicVaryings(attributes); return computedPosition; } -`;var zv=`vec2 computeSt(float featureId) +`;var C1=`vec2 computeSt(float featureId) { float stepX = model_textureStep.x; float centerX = model_textureStep.y; @@ -4443,7 +5910,22 @@ feature.color = vec4(1.0); } #endif } -`;var Hv={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};Hv.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=o5e(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),r5e(i);let l=s.featureIds.nullFeatureId,u=e.uniformMap;c(l)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return l}),s.shaderDestination===ge.BOTH&&i.addVertexLines(zv),i.addFragmentLines(zv)};function Cse(e){return e instanceof An.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Ese(e){return e instanceof An.FeatureIdTexture?ge.FRAGMENT:ge.BOTH}function o5e(e,t,n){let i,o;return c(t.instances)&&(o=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Ese(o),featureIdDefine:Cse(o)}):(o=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Ese(o),featureIdDefine:Cse(o)})}function r5e(e){e.addStructField(Hv.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(Hv.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(Hv.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Sb=Hv;var ks={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)"};ks.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ge.VERTEX),i.addStruct(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ge.FRAGMENT),i.addStruct(Sb.STRUCT_ID_SELECTED_FEATURE,Sb.STRUCT_NAME_SELECTED_FEATURE,ge.BOTH),i.addFunction(ks.FUNCTION_ID_INITIALIZE_ATTRIBUTES,ks.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ge.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,ks.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.VERTEX),i.addFunction(ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,ks.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.FRAGMENT),o.type===Tr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ge.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=c(e.runtimeNode.node.instances),a=r&&!s,l=t.attributes.length;for(let u=0;u<l;u++){let f=t.attributes[u],h=nn.getAttributeLocationCount(f.type);if(!c(f.buffer)&&!c(f.constant))throw new C("Attributes must be provided as a Buffer or constant value");let p=f.semantic===ht.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,s5e(e,f,g,h,r,s)}p5e(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(M2),i.addFragmentLines(R2)};function s5e(e,t,n,i,o,r){let s=e.shaderBuilder,a=$t.getAttributeInfo(t),l=o&&!r;i>1?l5e(e,t,n,i):c5e(e,t,n,l),f5e(s,a,l),u5e(s,a),c(t.semantic)&&a5e(s,t),d5e(s,a,o),h5e(s,a,l),m5e(s,a)}function a5e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ht.NORMAL:e.addDefine("HAS_NORMALS");break;case ht.TANGENT:e.addDefine("HAS_TANGENTS");break;case ht.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ht.TEXCOORD:case ht.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function c5e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:l}=c(o)?o:t;r===ht.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===ht.POSITION,f=u?0:n,h=nn.getNumberOfComponents(a),p={index:f,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:$.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function l5e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=c(o)?o:t,u=nn.getNumberOfComponents(s)/i,f=$.getSizeInBytes(a),h=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*h,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(y)}}function u5e(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 f5e(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===ht.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function d5e(e,t,n){let i=ks.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=ks.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 h5e(e,t,n){let i=ks.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 m5e(e,t){let{semantic:n,setIndex:i}=t.attribute;if(c(n)&&!c(i))return;let o=ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function p5e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===ht.NORMAL?n=!0:r.semantic===ht.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var L2=ks;var N2=`#ifdef USE_IBL_LIGHTING +`;var v1={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};v1.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=qut(r,o,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),Yut(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===de.BOTH&&i.addVertexLines(C1),i.addFragmentLines(C1)};function qxe(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Yxe(e){return e instanceof Cn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function qut(e,t,n){let i,r;return l(t.instances)&&(r=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:Yxe(r),featureIdDefine:qxe(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:Yxe(r),featureIdDefine:qxe(r)})}function Yut(e){e.addStructField(v1.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(v1.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(v1.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Lx=v1;var Ba={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)"};Ba.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(Lx.STRUCT_ID_SELECTED_FEATURE,Lx.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Ba.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ba.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ba.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ba.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Ba.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ba.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Qo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,de.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,s=l(e.runtimeNode.node.instances),a=o&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Oe.POINTS&&n.context.webgl2?"flat":void 0;Xut(e,f,g,d,o,s,m)}ift(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(RV),i.addFragmentLines(DV)};function Xut(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Jut(e,t,n,i):$ut(e,t,n,u),Qut(a,c,u),Zut(a,c,s),l(t.semantic)&&Kut(a,t),eft(a,c,r),tft(a,c,u),nft(a,c)}function Kut(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ct.NORMAL:e.addDefine("HAS_NORMALS");break;case ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ct.TEXCOORD:case ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function $ut(e,t,n,i){let{quantization:r,semantic:o,setIndex:s}=t,{type:a,componentDatatype:c}=l(r)?r:t;o===ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=o===ct.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Jut(e,t,n,i){let{quantization:r,normalized:o}=t,{type:s,componentDatatype:a}=l(r)?r:t,u=Vt.getNumberOfComponents(s)/i,f=Y.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function Zut(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function Qut(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===ct.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function eft(e,t,n){let i=Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:s}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,s,o),e.addStructField(r,s,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function tft(e,t,n){let i=Ba.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function nft(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Ba.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Ba.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function ift(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ct.NORMAL?n=!0:o.semantic===ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ba.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var OV=Ba;var TQ,Xxe="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",nS={};nS.defaultAccessToken=Xxe;nS.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});nS.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});nS.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});nS.getDefaultTokenCredit=function(e){if(e===Xxe){if(!l(TQ)){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>';TQ=new It(t,!0)}return TQ}};var vd=nS;function EQ(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=Bm(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}EQ.prototype.isReady=function(){return this._isReady};EQ.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=Bm(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var MV=EQ;function CQ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}CQ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="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])};CQ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Op=CQ;function iS(){pe.throwInstantiationError()}Object.defineProperties(iS.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}});iS.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};iS.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};iS.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var rft=/\.ktx2$/i;iS.loadImage=function(e,t){let n=De.createIfNeeded(t);return rft.test(n.url)?tf(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Sd=iS;var Kxe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Kxe);var Mp=Kxe;function $xe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new ir({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}$xe.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 MV({missingImageUrl:Jxe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function oft(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 No({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new ir({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(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 xi,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.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 oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function sft(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function aft(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();oft(i,t)}catch(i){sft(e,i)}}function Np(e){e=e??H.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new ir({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}Np.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Mp.SATELLITE:{n=t.token??vd.defaultAccessToken,i=De.createIfNeeded(vd.defaultWorldImageryServer),i.appendForwardSlash();let o=vd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Mp.OCEANS:{n=t.token??vd.defaultAccessToken,i=De.createIfNeeded(vd.defaultWorldOceanServer),i.appendForwardSlash();let o=vd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Mp.HILLSHADE:{n=t.token??vd.defaultAccessToken,i=De.createIfNeeded(vd.defaultWorldHillshadeServer),i.appendForwardSlash();let o=vd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Np.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function Jxe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});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 ji?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}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=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Np(t);i._resource=n;let r=new $xe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await aft(n,r),r.build(i),i};Np.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Np.prototype.requestImage=function(e,t,n,i){return Sd.loadImage(this,Jxe(this,e,t,n,i))};Np.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof ji)s=P.toDegrees(i),a=P.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new Op;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=he.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new xi;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};Np._metadataCache={};var Jy=Np;var Zxe={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"};Object.freeze(Zxe);var S1=Zxe;function w1(e){}w1.prototype.isReady=function(){return!0};w1.prototype.shouldDiscardImage=function(e){return w1.EMPTY_IMAGE===e};var NV;Object.defineProperties(w1,{EMPTY_IMAGE:{get:function(){return l(NV)||(NV=new Image,NV.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),NV}}});var I1=w1;function Qxe(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}Qxe.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 r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ie(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function cft(e,t){if(e.resourceSets.length!==1)throw new oe("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(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function lft(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function uft(e,t,n){let i=e.url,r=_a._metadataCache[i];l(r)||(r=e.fetchJson(),_a._metadataCache[i]=r);try{let o=await r;return cft(o,t)}catch(o){lft(e,o,n)}}function _a(e){e=e??H.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=e.mapStyle??S1.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new I1),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${_a.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new No({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(_a.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)}}});_a.fromUrl=async function(e,t){t=t??H.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=t.mapStyle??S1.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let s=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),a=new _a(t);a._resource=r;let c=new Qxe(t);return await uft(s,c),c.build(a),a};var fft=new ie;_a.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,fft);return mft(this._attributionList,n,i)};_a.prototype.requestImage=function(e,t,n,i){let r=Sd.loadImage(this,dft(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?I1.EMPTY_IMAGE:Promise.reject(o)})};_a.prototype.pickFeatures=function(e,t,n,i,r){};_a.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};_a.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};_a._logoUrl=void 0;Object.defineProperties(_a,{logoUrl:{get:function(){return l(_a._logoUrl)||(_a._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),_a._logoUrl},set:function(e){_a._logoUrl=e}}});function dft(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:_a.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var hft=new ie;function mft(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,hft);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}_a._metadataCache={};var LV=_a;var eTe=/{[^}]+}/g,tTe={x:yft,y:bft,z:Eft,s:Cft,reverseX:Aft,reverseY:xft,reverseZ:Tft,westDegrees:vft,southDegrees:Sft,eastDegrees:wft,northDegrees:Ift,westProjected:Pft,southProjected:Dft,eastProjected:Rft,northProjected:Oft,width:Mft,height:Nft},pft=Mt(tTe,{i:Lft,j:Fft,reverseI:Bft,reverseJ:kft,longitudeDegrees:zft,latitudeDegrees:Vft,longitudeProjected:jft,latitudeProjected:Hft,format:Wft});function P1(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new No({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,s=Mt(tTe,o),a=Mt(pft,o);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=e.enablePickFeatures??!0}Object.defineProperties(P1.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}}});P1.prototype.getTileCredits=function(e,t,n){};P1.prototype.requestImage=function(e,t,n,i){return Sd.loadImage(this,gft(this,e,t,n,i))};P1.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=_ft(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var FV=!1,xf=new ie,BV=!1,D1=new ie;function gft(e,t,n,i,r){FV=!1,BV=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(eTe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var vQ=!1,oS=new U,SQ=!1;function _ft(e,t,n,i,r,o,s){FV=!1,BV=!1,vQ=!1,SQ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(eTe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function sS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function yft(e,t,n,i){return sS(e,"{x}",t)}function Aft(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return sS(e,"{reverseX}",r)}function bft(e,t,n,i){return sS(e,"{y}",n)}function xft(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return sS(e,"{reverseY}",r)}function Tft(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return sS(e,"{reverseZ}",o)}function Eft(e,t,n,i){return sS(e,"{z}",i)}function Cft(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function kV(e,t,n,i){FV||(e.tilingScheme.tileXYToRectangle(t,n,i,xf),xf.west=P.toDegrees(xf.west),xf.south=P.toDegrees(xf.south),xf.east=P.toDegrees(xf.east),xf.north=P.toDegrees(xf.north),FV=!0)}function vft(e,t,n,i){return kV(e,t,n,i),xf.west}function Sft(e,t,n,i){return kV(e,t,n,i),xf.south}function wft(e,t,n,i){return kV(e,t,n,i),xf.east}function Ift(e,t,n,i){return kV(e,t,n,i),xf.north}function UV(e,t,n,i){BV||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,D1),BV=!0)}function Pft(e,t,n,i){return UV(e,t,n,i),D1.west}function Dft(e,t,n,i){return UV(e,t,n,i),D1.south}function Rft(e,t,n,i){return UV(e,t,n,i),D1.east}function Oft(e,t,n,i){return UV(e,t,n,i),D1.north}function Mft(e,t,n,i){return e.tileWidth}function Nft(e,t,n,i){return e.tileHeight}function Lft(e,t,n,i,r,o,s){return zV(e,t,n,i,r,o),oS.x}function Fft(e,t,n,i,r,o,s){return zV(e,t,n,i,r,o),oS.y}function Bft(e,t,n,i,r,o,s){return zV(e,t,n,i,r,o),e.tileWidth-oS.x-1}function kft(e,t,n,i,r,o,s){return zV(e,t,n,i,r,o),e.tileHeight-oS.y-1}var Uft=new ie,rS=new h;function zV(e,t,n,i,r,o,s){if(vQ)return;wQ(e,t,n,i,r,o);let a=rS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Uft);oS.x=e.tileWidth*(a.x-c.west)/c.width|0,oS.y=e.tileHeight*(c.north-a.y)/c.height|0,vQ=!0}function zft(e,t,n,i,r,o,s){return P.toDegrees(r)}function Vft(e,t,n,i,r,o,s){return P.toDegrees(o)}function jft(e,t,n,i,r,o,s){return wQ(e,t,n,i,r,o),rS.x}function Hft(e,t,n,i,r,o,s){return wQ(e,t,n,i,r,o),rS.y}var Gft=new he;function wQ(e,t,n,i,r,o,s){if(!SQ){if(e.tilingScheme.projection instanceof ji)rS.x=P.toDegrees(r),rS.y=P.toDegrees(o);else{let a=Gft;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,rS)}SQ=!0}}function Wft(e,t,n,i,r,o,s){return s}var Ls=P1;function wd(e){Ls.call(this,e)}wd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return wd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof R0)return wd._metadataFailure(e,t);throw r}};wd.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await wd._requestMetadata(t,i,r);return new wd(o)};l(Object.create)&&(wd.prototype=Object.create(Ls.prototype),wd.prototype.constructor=wd);function nTe(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 iTe(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}wd._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let O=g.item(R).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&Zr.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new ir({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new No({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&Zr.reportError(void 0,r,r.errorEvent,m),new oe(m);let S=ie.clone(t.rectangle);if(!l(S)){let R,O,L,_;t.flipXY??!1?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof ji||w)R=he.fromDegrees(L.x,L.y),O=he.fromDegrees(_.x,_.y);else{let D=v.projection;R=D.unproject(L),O=D.unproject(_)}S=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return S=nTe(S,v),x=iTe(v,S,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:S,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};wd._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new No({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=nTe(a,s);let c=iTe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Fx=wd;function rTe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}rTe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function qft(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 r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new No({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Yft(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Xft(e,t,n){try{let i=await e.fetchText();qft(i,t)}catch(i){Yft(i,e,n)}}function Nu(e){e=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 It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Nu.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(Nu.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}}});Nu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new rTe(n);s.channel=t,await Xft(o,s);let a=new Nu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Nu.prototype.getTileCredits=function(e,t,n){};Nu.prototype.requestImage=function(e,t,n,i){let r=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 Sd.loadImage(this,r)};Nu.prototype.pickFeatures=function(e,t,n,i,r){};Nu._logoUrl=void 0;Object.defineProperties(Nu,{logoUrl:{get:function(){return l(Nu._logoUrl)||(Nu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Nu._logoUrl},set:function(e){Nu._logoUrl=e}}});var VV=Nu;var Kft=/\/$/,oTe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function aS(e){e=e??H.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=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();Kft.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=oTe,this._resource=i,this._imageryProvider=new Ls({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(aS.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}}});aS.prototype.getTileCredits=function(e,t,n){};aS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};aS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};aS._defaultCredit=oTe;var jV=aS;function Bx(e){e=e??H.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=e.rectangle??ie.MAX_VALUE,n=new ir({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 It(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(Bx.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 $ft(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Zr.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return IQ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function IQ(e,t,n){try{return await Sd.loadImage(null,e)}catch(i){return $ft(e,i,t,n)}}Bx.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await IQ(n);t=t??H.EMPTY_OBJECT;let r=new Bx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};Bx.prototype.getTileCredits=function(e,t,n){};Bx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await IQ(this._resource,this);return this._image=r,Zr.reportSuccess(this._errorEvent),r}return this._image};Bx.prototype.pickFeatures=function(e,t,n,i,r){};var HV=Bx;function Jft(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=Zft:e==="xml"?n=ndt:(e==="html"||e==="text")&&(n=sTe)),this.callback=n}function Zft(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Op;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var PQ="http://www.mapinfo.com/mxp",Qft="http://www.esri.com/wms",edt="http://www.opengis.net/wfs",tdt="http://www.opengis.net/gml";function ndt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===PQ)return idt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Qft)return rdt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===edt)return odt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?sdt(e):adt(e)}function idt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(PQ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(PQ,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Op;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function rdt(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(GV(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(GV(a,i))}}return n}function odt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(tdt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};DQ(o,s),t.push(GV(o,s))}return t}function sdt(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};DQ(s,a),t.push(GV(s,a))}}return t}function DQ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&DQ(r,t)&&(t[r.localName]=r.textContent)}return n}function GV(e,t){let n=new Op;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function adt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Op;return r.data=e,r.description=n.innerHTML,[r]}var cdt=/<body>\s*<\/body>/im,ldt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,udt=/<title>([\s\S]*)<\/title>/im;function sTe(e){if(cdt.test(e)||ldt.test(e))return;let t,n=udt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Op;return i.name=t,i.description=e,i.data=e,[i]}var Lp=Jft;function R1(e){e=e??H.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(R1.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)}}});R1.prototype.getFromCache=function(e,t,n,i){let r=aTe(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};R1.prototype.checkApproachingInterval=function(e,t,n,i){let r=aTe(e,t,n),o=this._tilesRequestedForInterval,s=cTe(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!lTe(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};R1.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=cTe(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=lTe(this,c,o),a||s.push(c)}}};function aTe(e,t,n){return`${e}-${t}-${n}`}function fdt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function cTe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=K.secondsDifference(c.stop,i),++a):(s=K.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function lTe(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=fdt(s),c=new Oo({throttle:!1,throttleByServer:!0,type:oa.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var cS=R1;var ddt=[3034,3035,3042,3043,3044],hdt=[4471,4559];function jh(e){if(e=e??H.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=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(jh.DefaultParameters,!0),n.setQueryParameters(jh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(uTe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(uTe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new cS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return fTe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof xi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!hdt.includes(a)||ddt.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof xi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ls({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new ir({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:e.getFeatureInfoFormats??jh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function fTe(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function mdt(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(jh.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}}});jh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};jh.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=fTe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};jh.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return mdt(this,e,t,n,i,r,s)};jh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});jh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});jh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Lp("json","application/json")),Object.freeze(new Lp("xml","text/xml")),Object.freeze(new Lp("text","text/html"))]);function uTe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var WV=jh;function Tf(e){e=e??H.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._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,s=e.format??"image/jpeg",a=o.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(o)?(t.setQueryParameters(Tf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Tf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Tf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(dTe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(Tf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(dTe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new cS({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return hTe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Ls({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new No({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:e.getFeatureInfoFormats??Tf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:gdt(this)})}function hTe(e,t,n,i,r,o){let s=e._tileProvider;return mTe(e,s._resource,o),s.requestImage(t,n,i,r)}function pdt(e,t,n,i,r,o,s){let a=e._tileProvider;return mTe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(Tf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Tf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Tf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=hTe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Tf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return pdt(this,e,t,n,i,r,s)};Tf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Tf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Tf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Lp("json","application/json")),Object.freeze(new Lp("xml","text/xml")),Object.freeze(new Lp("text","text/html"))]);function mTe(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Mt(o,i)),l(r)&&(o=Mt(o,r)),t.setQueryParameters(o)}}function gdt(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function dTe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var qV=Tf;var pTe=/\/$/;function Eg(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Yo?e.url:De.createIfNeeded(e.url??Da.mapTilesApiEndpoint),n=t.getUrlComponent();pTe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new It(r)));let o=new Ls({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(Eg.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}}});Eg.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=gTe(e),i=Yo._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),s=o.options.url;return delete o.options.url,o.options={...o.options,...r},RQ(s,o,i)};Eg.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Da.mapTilesApiEndpoint,e.key=e.key??Da.defaultApiKey;let t=e.overlayLayerType,n=await ydt(e);return new Eg({...n,...e,credit:e.credit??Da.getDefaultCredit()})};Eg.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};Eg.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};Eg.prototype.pickFeatures=function(e,t,n,i,r){};Eg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(_dt(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r];if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function _dt(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function gTe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function ydt(e){let{language:t,region:n,key:i,url:r}=e,o=gTe(e),s=r.url??r;pTe.test(s)||(s+="/");let a=await De.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(a)}var YV=Eg;var Adt=/\/$/;function lS(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Yo?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Adt.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new It(o)));let s=new Ls({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(lS.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}}});lS.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};lS.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};lS.prototype.pickFeatures=function(e,t,n,i,r){};lS.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(bdt(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r].join(",");if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function bdt(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var XV=lS;var xdt=async(e,t,n)=>Fx.fromUrl(new Yo(t,n)),Tdt=async(e,{options:t})=>Jy.fromUrl(e,t),Edt=async(e,{options:t})=>LV.fromUrl(e,t),Cdt=async(e,{options:t})=>{let n=t.channel;return delete t.channel,VV.fromUrl(e,n,t)},vdt=async(e,{options:t})=>new jV({url:e,...t}),Sdt=async(e,{options:t})=>HV.fromUrl(e,t),wdt=async(e,{options:t})=>Fx.fromUrl(e,t),Idt=async(e,{options:t})=>new Ls({url:e,...t}),Pdt=async(e,{options:t})=>new WV({url:e,...t}),Ddt=async(e,{options:t})=>new qV({url:e,...t}),RQ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Yo(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=r,new YV({...t.options,url:i})},Rdt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Yo(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=r,new XV({...t.options,url:i})},Odt={ARCGIS_MAPSERVER:Tdt,BING:Edt,GOOGLE_EARTH:Cdt,MAPBOX:vdt,SINGLE_TILE:Sdt,TMS:wdt,URL_TEMPLATE:Idt,WMS:Pdt,WMTS:Ddt,GOOGLE_2D_MAPS:RQ,AZURE_MAPS:Rdt,defaultFactoryCallback:xdt},O1=Object.freeze(Odt);function Fp(){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(Fp.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(){}}});Fp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Yo._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Fp._endpointCache[i];l(r)||(r=n.fetchJson(),Fp._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let s=o.externalType,a=O1.defaultFactoryCallback;o=Ze(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=O1[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new Fp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Yo.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Fp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Fp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Fp.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Fp._endpointCache={};var Lu=Fp;var _Te={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(_Te);var Zy=_Te;function Mdt(e){e=e??H.EMPTY_OBJECT;let t=e.style??Zy.AERIAL;return Lu.fromAssetId(t)}var Qy=Mdt;var KV=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = texture(u_texture, v_textureCoordinates); +} +`;var $V=`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 yTe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(yTe);var jn=yTe;function uS(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=jn.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(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}uS.createPlaceholder=function(e){let t=new uS(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};uS.prototype.addReference=function(){++this.referenceCount};uS.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(),ue(this),0):this.referenceCount};uS.prototype.processStateMachine=function(e,t,n){this.state===jn.UNLOADED&&!n&&(this.state=jn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===jn.RECEIVED&&(this.state=jn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===jn.READY&&t&&!this.texture;(this.state===jn.TEXTURE_LOADED||i)&&(this.state=jn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var M1=uS;function OQ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}OQ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};OQ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===jn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==jn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==jn.FAILED&&o.state!==jn.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===jn.FAILED||i.state===jn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var N1=OQ;function Ui(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Ui.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ui.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ui.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ui.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ui.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ui.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ui.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ui.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new N1(M1.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=t.colorToAlphaThreshold??Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ui.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}}});Ui.DEFAULT_BRIGHTNESS=1;Ui.DEFAULT_CONTRAST=1;Ui.DEFAULT_HUE=0;Ui.DEFAULT_SATURATION=1;Ui.DEFAULT_GAMMA=1;Ui.DEFAULT_SPLIT=$o.NONE;Ui.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Ui.DEFAULT_MAGNIFICATION_FILTER=Jn.LINEAR;Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ui.fromProviderAsync=function(e,t){let n=new Ui(void 0,t);return kdt(n,Promise.resolve(e)),n};Ui.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Ui.fromProviderAsync(Qy({style:e.style}),e)};Ui.prototype.isBaseLayer=function(){return this._isBaseLayer};Ui.prototype.isDestroyed=function(){return!1};Ui.prototype.destroy=function(){return ue(this)};var xTe=new ie,ATe=new ie,MQ=new ie,TTe=new ie;Ui.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Ui.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 r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof xi&&e.rectangle.north<xi.MaximumLatitude&&e.rectangle.south>-xi.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,xTe),a=ie.intersection(e.rectangle,s,ATe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=ATe,D.south>=w.north?a.north=a.south=w.north:D.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(D.south,w.south),a.north=Math.min(D.north,w.north)),D.west>=w.east?a.west=a.east=w.east:D.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(D.west,w.west),a.east=Math.min(D.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Fdt(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(a),d),y=g.positionToTileXY(ie.southeast(a),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let E=ie.clone(e.rectangle,TTe),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,MQ),I;o?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),A=E.width/512,b=E.height/512):I=g.tileXYToRectangle.bind(g);let R,O=0,L=1,_;!this.isBaseLayer()&&Math.abs(S.west-E.west)>=A&&(O=Math.min(1,(S.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(S.north-E.north)>=b&&(L=Math.max(0,(S.north-E.south)/E.height));let C=L;for(let w=m.x;w<=y.x;w++)if(R=O,v=I(w,m.y,d),S=ie.simpleIntersection(v,s,MQ),!!l(S)){O=Math.min(1,(S.east-E.west)/E.width),w===y.x&&(this.isBaseLayer()||Math.abs(S.east-E.east)<A)&&(O=1),L=C;for(let D=m.y;D<=y.y;D++){if(_=L,v=I(w,D,d),S=ie.simpleIntersection(v,s,MQ),!l(S))continue;L=Math.max(0,(S.south-E.south)/E.height),D===y.y&&(this.isBaseLayer()||Math.abs(S.south-E.south)<b)&&(L=0);let N=new se(R,L,O,_),F=this.getImageryFromCache(w,D,d);i.imagery.splice(n,0,new N1(F,N,o)),++n}}return!0};Ui.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,xTe),i=c.rectangleToNativeRectangle(i,TTe)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Ui.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=jn.RECEIVED,e.request=void 0,Zr.reportSuccess(n._requestImageError)}function r(s){if(e.request.state===wi.CANCELLED){e.state=jn.UNLOADED,e.request=void 0;return}e.state=jn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zr.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o()}function o(){let s=new Oo({throttle:!1,throttleByServer:!0,type:oa.IMAGERY});e.request=s,e.state=jn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=jn.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){r(c)})}o()};Ui.prototype._createTextureWebGL=function(e,t){let n=new Ht({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?$e.RGBA:$e.RGB,sampler:n})};Ui.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=jn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=jn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof xi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=jn.TEXTURE_LOADED};function bTe(e,t,n){return`${e}:${t}:${n}`}Ui.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===Jn.LINEAR&&!$e.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=Ut.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=bTe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(yh.NICEST),t.sampler=u}else{let o=bTe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ui.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ji)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new $f({persists:!0,owner:this,preExecute:function(c){Ldt(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=jn.READY,t.releaseReference()},canceled:function(){t.state=jn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=jn.READY};Ui.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};Ui.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ui.prototype.getImageryFromCache=function(e,t,n,i){let r=ETe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new M1(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Ui.prototype.removeImageryFromCache=function(e){let t=ETe(e.x,e.y,e.level);delete this._imageryCache[t]};function ETe(e,t,n){return JSON.stringify([e,t,n])}var JV={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},Ndt=dn.supportsTypedArrays()?new Float32Array(128):void 0;function Ldt(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=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 A=new Float32Array(256),b=0;for(let S=0;S<64;++S){let I=S/63;A[b++]=0,A[b++]=I,A[b++]=1,A[b++]=I}let x={position:0,webMercatorT:1},T=Yr.getRegularGridIndices(2,64),E=tt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new Vn({context:t,attributes:[{index:x.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Xe({sources:[$V]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:KV,attributeLocations:x}),r.sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;JV.textureDimensions.x=o,JV.textureDimensions.y=s,JV.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Dt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(o)&&P.isPowerOfTwo(s)&&d.generateMipmap(yh.NICEST);let p=i.south,g=i.north,m=Ndt,y=0;for(let A=0;A<64;++A){let b=A/63,x=P.lerp(p,g,b);a=Math.sin(x);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=E,m[y++]=E}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=JV,e.vertexArray=r.vertexArray}function Fdt(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof ji?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Bdt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function kdt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Bdt(e._errorEvent,i)}}var Fs=Ui;var NQ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},ZV=NQ;var LQ=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},L1=LQ;var Udt=new ie,CTe=new ie,zdt=new ie,Vdt=new ie,jdt=new ie,Hdt=new ie,FQ=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),s=ie.intersection(r.rectangle,n.rectangle,Udt),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=Vdt;a.rectangleToNativeRectangle(t,u);let f=jdt;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,zdt);if(!l(b))return;let x=Hdt;return a.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(ie.northwest(o),r),a=i.positionToTileXY(ie.southeast(o),r),c=new L1;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,CTe);return l(i)?i:e._clampRectangle(t,n,CTe)}static _computeImageryCoverages(t,n,i,r,o){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=o(a,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(a,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(a,u,i),g=new e(a,u,i,d,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new L1);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},F1=FQ;var BQ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new et;et.fromRectangle(i,r,o);let s=e.createProjectedPositions(t,r),a=e.computeTexCoords(s,o);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=Fa.readAttributeAsTypedArray(t),o=t.type,s=Vt.getNumberOfComponents(o),a=e.createIterableCartesian3FromTypedArray(r,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<r;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),r=Math.min(r,a.latitude),o=Math.max(o,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=r,n.east=o,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(M.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new U,r=1/n.width,o=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*r,u=(a.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ct.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new U(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},fS=BQ;var kQ=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},QV=kQ;var UQ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new M,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=t[r];this._deleteCoverages(o,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=tt.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!M.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=fS.createCartographicPositions(r,s,d),g=fS.computeCartographicBoundingRectangle(p),m=new QV(p,o,g,d);a.push(m)}return M.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getEllipsoid(o);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getProjection(o);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=fS.createTextureCoordinatesAttributeForMappedPositions(a,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let s=0;s<o;s++){let a=r.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return F1.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,s=1,a=n.width,c=o.width;n.height>n.width&&(a=n.height,c=o.height);let u=Math.log2(s*c/a);return F1._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let s=0;s<r;s++){let a=i[s],c=a.length;for(let u=0;u<c;u++){let d=a[u].imagery;d.state===jn.READY||d.state===jn.FAILED||d.state===jn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),ue(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new M);let r=t.sceneGraph;return M.clone(M.IDENTITY,i),M.multiply(i,t.modelMatrix,i),M.multiply(i,r.components.transform,i),M.multiply(i,r.axisCorrectionMatrix,i),M.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},dS=UQ;var zQ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},e4=zQ;var Gdt=!1,Wdt=new ie,qdt=new ie,VQ=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let s=r.imageryLayers,a=dS._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,o,u);if(f.length===0)return;f.length>10&&(yt("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<s.length;p++)d.push(s.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(o,r),e._defineUniforms(o,s),e._buildSampleAndBlendFunction(o,s),e._createMainImageryShader(o,i,s);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,de.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new ZV;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Fs.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Fs.DEFAULT_CONTRAST,n.hue|=r.hue!==Fs.DEFAULT_HUE,n.saturation|=r.saturation!==Fs.DEFAULT_SATURATION,n.gamma|=r.gamma!==Fs.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,de.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),Gdt&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",de.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let a=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],s=o.imageryLayer,a=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=a,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=s.alpha,i.imageryTextureBrightness[r]=s.brightness,i.imageryTextureContrast[r]=s.contrast,i.imageryTextureHue[r]=s.hue,i.imageryTextureSaturation[r]=s.saturation,i.imageryTextureOneOverGamma[r]=1/s.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[r]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=s.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let s=t.get(o);if(!s.show)continue;let a=i[o],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(s,p,u,a);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===jn.FAILED||o.state===jn.INVALID)return;let s=o.textureWebMercator;if(!l(s)&&(s=o.texture,!l(s))){o.state===jn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new e4(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,Wdt),s=r.rectangleToNativeRectangle(i,qdt);return e._computeTextureTranslationAndScaleFromNative(o,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,s=t.south-n.south,a=o*i,c=s*r,u=t.width*i,f=t.height*r;return new se(a,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let s=t[o],a=n.indexOf(s);i.push(a)}return i}},t4=VQ;var n4=`#ifdef USE_IBL_LIGHTING vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) @@ -4524,7 +6006,7 @@ color = czm_linearToSrgb(color); #endif material.diffuse = color; } -`;var _5e={UNLIT:0,PBR:1},Up=Object.freeze(_5e);var Sse={name:"LightingPipelineStage"};Sse.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(c(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ge.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ge.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Up.PBR?o.addDefine("LIGHTING_PBR",void 0,ge.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ge.FRAGMENT),o.addFragmentLines(N2)};var F2=Sse;var B2=`bool isDefaultStyleColor(vec3 color) +`;var vTe={UNLIT:0,PBR:1};Object.freeze(vTe);var Cg=vTe;var STe={name:"LightingPipelineStage"};STe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,de.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",de.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===Cg.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(n4)};var i4=STe;var r4=`bool isDefaultStyleColor(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -4534,16 +6016,12 @@ 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)); +texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); #endif return texCoord; } @@ -4581,7 +6059,16 @@ vec3 bitangent = normalize(cross(geometryNormal, tangent)); #endif #ifdef HAS_NORMAL_TEXTURE mat3 tbn = mat3(tangent, bitangent, geometryNormal); -vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb; +vec3 normalSample; +#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb; +#else +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb; +#endif +#else +normalSample = texture(u_normalTexture, normalTexCoords).rgb; +#endif normalSample = 2.0 * normalSample - 1.0; #ifdef HAS_NORMAL_TEXTURE_SCALE normalSample.xy *= u_normalTextureScale; @@ -4619,7 +6106,16 @@ 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; +vec3 normalSample; +#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb; +#else +normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb; +#endif +#else +normalSample = texture(u_normalTexture, normalTexCoords).rgb; +#endif normalSample = 2.0 * normalSample - 1.0; #ifdef HAS_NORMAL_TEXTURE_SCALE normalSample.xy *= u_normalTextureScale; @@ -4671,11 +6167,20 @@ 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; +baseColorTexCoords = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform); +#endif +vec4 baseColorWithAlpha; +#if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD) +#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform)); +#else +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); +#endif +#else +baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); +#endif +#ifdef HAS_BASE_COLOR_FACTOR +baseColorWithAlpha *= u_baseColorFactor; #endif return baseColorWithAlpha; } @@ -4685,7 +6190,7 @@ vec3 getEmissiveFromTexture() { vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM -emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); +emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); #endif vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); #ifdef HAS_EMISSIVE_FACTOR @@ -4700,7 +6205,7 @@ 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); +specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); #endif vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); vec3 specular = specularGlossiness.rgb; @@ -4726,7 +6231,7 @@ float glossiness = 1.0; #ifdef HAS_DIFFUSE_TEXTURE vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM -diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); +diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); #endif vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); #ifdef HAS_DIFFUSE_FACTOR @@ -4748,7 +6253,7 @@ 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); +metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); #endif vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; float metalness = clamp(metallicRoughness.b, 0.0, 1.0); @@ -4784,7 +6289,7 @@ 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); +specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); #endif float specularWeight = texture(u_specularTexture, specularTexCoords).a; #ifdef HAS_SPECULAR_FACTOR @@ -4800,7 +6305,7 @@ float specularWeight = 1.0; #ifdef HAS_SPECULAR_COLOR_TEXTURE vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM -specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); +specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); #endif vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); @@ -4829,7 +6334,7 @@ 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); +anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); #endif vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; direction = anisotropySample.rg * 2.0 - vec2(1.0); @@ -4850,7 +6355,7 @@ void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attri #ifdef HAS_CLEARCOAT_TEXTURE vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM -clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); +clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); #endif float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; #ifdef HAS_CLEARCOAT_FACTOR @@ -4866,7 +6371,7 @@ float clearcoatFactor = 0.0; #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM -clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); +clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); #endif float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR @@ -4898,11 +6403,16 @@ material.normalEC = normalInfo.normal; material.normalEC = computeNormal(attributes); #endif vec4 baseColorWithAlpha = vec4(1.0); -#ifdef HAS_BASE_COLOR_TEXTURE +#ifdef HAS_BACKGROUND_FILL +baseColorWithAlpha = czm_srgbToLinear(czm_backgroundColor); +#elif defined(HAS_BASE_COLOR_TEXTURE) baseColorWithAlpha = getBaseColorFromTexture(); #elif defined(HAS_BASE_COLOR_FACTOR) baseColorWithAlpha = u_baseColorFactor; #endif +#ifdef HAS_IMAGERY +baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha); +#endif // HAS_IMAGERY #ifdef HAS_POINT_CLOUD_COLOR_STYLE baseColorWithAlpha = v_pointCloudColor; #elif defined(HAS_COLOR_0) @@ -4921,7 +6431,7 @@ material.alpha = baseColorWithAlpha.a; #ifdef HAS_OCCLUSION_TEXTURE vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM -occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); +occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; #endif @@ -4945,7 +6455,87 @@ setClearcoat(material, attributes); #endif #endif } -`;var{Material:g5e,MetallicRoughness:v9,SpecularGlossiness:D9,Specular:wse,Clearcoat:vse}=An,Dse={name:"MaterialPipelineStage",_processTexture:Sl,_processTextureTransform:Pse};Dse.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=c(o.classificationType),l=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;b5e(i,r,s,u,f,h,l),c(i.specularGlossiness)?x5e(i.specularGlossiness,r,s,u,l):(c(i.specular)&&$t.supportedExtensions.KHR_materials_specular&&T5e(i.specular,r,s,u,l),c(i.anisotropy)&&$t.supportedExtensions.KHR_materials_anisotropy&&C5e(i.anisotropy,r,s,u,l),c(i.clearcoat)&&$t.supportedExtensions.KHR_materials_clearcoat&&E5e(i.clearcoat,r,s,u,l),S5e(i.metallicRoughness,r,s,u,l));let p=$t.getAttributeBySemantic(t,ht.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=Up.UNLIT:g.lightingModel=Up.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let y=e.alphaOptions;i.alphaMode===Ip.BLEND?y.pass=De.TRANSLUCENT:i.alphaMode===Ip.MASK&&(y.alphaCutoff=i.alphaCutoff),s.addFragmentLines(B2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ge.BOTH)};function Pse(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ge.FRAGMENT),t[s]=function(){return n.transform}}function y5e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ge.FRAGMENT),t[s]=function(){return n.scale}}function Sl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ge.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ge.FRAGMENT);let l=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,l,ge.FRAGMENT);let f=n.transform;c(f)&&!J.equals(f,J.IDENTITY)&&Pse(e,t,n,i,o);let{scale:h}=n;c(h)&&h!==1&&y5e(e,t,n,i,o)}function b5e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:l,normalTexture:u,occlusionTexture:f}=e;c(a)&&!d.equals(a,g5e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ge.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ge.FRAGMENT),c(l)&&!s&&Sl(n,t,l,"u_emissiveTexture","EMISSIVE",r)),c(u)&&!s&&Sl(n,t,u,"u_normalTexture","NORMAL",o),c(f)&&!s&&Sl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function x5e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:l,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ge.FRAGMENT),c(r)&&!o&&Sl(n,t,r,"u_diffuseTexture","DIFFUSE",i),c(s)&&!se.equals(s,D9.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ge.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ge.FRAGMENT)),c(a)&&!o&&Sl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),c(l)&&!d.equals(l,D9.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ge.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),c(u)&&u!==D9.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ge.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ge.FRAGMENT))}function T5e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:l}=e;n.addDefine("USE_SPECULAR",void 0,ge.FRAGMENT),c(r)&&!o&&Sl(n,t,r,"u_specularTexture","SPECULAR",i),c(s)&&s!==wse.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ge.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),c(a)&&!o&&Sl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),c(l)&&!d.equals(l,wse.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ge.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ge.FRAGMENT))}var A5e=new d;function C5e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ge.FRAGMENT),c(a)&&!o&&Sl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let l=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",ge.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(l,u,r,A5e)}}function E5e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:l,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,ge.FRAGMENT),c(r)&&r!==vse.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ge.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ge.FRAGMENT)),c(s)&&!o&&Sl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),c(a)&&r!==vse.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ge.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT)),c(l)&&!o&&Sl(n,t,l,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),c(u)&&!o&&Sl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function S5e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ge.FRAGMENT);let r=e.baseColorTexture;c(r)&&!o&&Sl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;c(s)&&!se.equals(s,v9.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ge.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ge.FRAGMENT));let a=e.metallicRoughnessTexture;c(a)&&!o&&Sl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=e.metallicFactor;c(l)&&l!==v9.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ge.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ge.FRAGMENT));let u=e.roughnessFactor;c(u)&&u!==v9.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ge.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT))}var k2=Dse;var zc={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"};zc.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(zc.METADATA_PICKING_VALUE_TYPE,"float",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_STRING,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ge.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ge.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${zc.METADATA_PICKING_VALUE_TYPE} value = ${zc.METADATA_PICKING_VALUE_TYPE}(${zc.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${zc.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${zc.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${zc.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${zc.METADATA_PICKING_VALUE_COMPONENT_W};`],ge.FRAGMENT)};var yf=zc;var U2=`void morphTargetsStage(inout ProcessedAttributes attributes) +`;var o4=`#ifdef HAS_CONSTANT_LOD +float modelScaleX = length(czm_model[0].xyz); +float modelScaleY = length(czm_model[1].xyz); +float modelScaleZ = length(czm_model[2].xyz); +float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0; +vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz; +v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale; +v_constantLodUvCustom.z = u_constantLodDistance / modelScale; +#endif +`;var s4=`#ifdef HAS_CONSTANT_LOD +vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) { +bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; +bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; +bool atClampBoundary = atMaxClamp || atMinClamp; +float effectiveDistance = atMaxClamp ? constantLodParams.y : +(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z); +float logDepth = log2(effectiveDistance); +logDepth = clamp(logDepth, -10.0, 20.0); +float f = fract(logDepth); +float p = floor(logDepth); +if (atClampBoundary) { +float clampedP = ceil(logDepth); +vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z; +return texture(textureSampler, tc); +} +vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z; +vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z; +return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); +} +vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) { +bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; +bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; +bool atClampBoundary = atMaxClamp || atMinClamp; +float effectiveDistance = atMaxClamp ? constantLodParams.y : +(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z); +float logDepth = log2(effectiveDistance); +logDepth = clamp(logDepth, -10.0, 20.0); +float f = fract(logDepth); +float p = floor(logDepth); +if (atClampBoundary) { +float clampedP = ceil(logDepth); +vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z; +tc = czm_computeTextureTransform(tc, textureTransform); +return texture(textureSampler, tc); +} +vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z; +vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z; +tc1 = czm_computeTextureTransform(tc1, textureTransform); +tc2 = czm_computeTextureTransform(tc2, textureTransform); +return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); +} +#endif +`;var{Material:Ydt,MetallicRoughness:jQ,SpecularGlossiness:HQ,Specular:wTe,Clearcoat:ITe}=Cn,PTe={name:"MaterialPipelineStage",_processTexture:Fu,_processTextureTransform:DTe};PTe.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:s}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let E=h.distance(T.positionWC,x.center);return Math.max(E,.1)}return 1});let a=l(r.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;Zdt(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Qdt(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&eht(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&nht(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&iht(i.clearcoat,o,s,u,c),rht(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Xdt(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=Cg.UNLIT:y.lightingModel=Cg.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===q0.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===q0.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,de.BOTH),s.addUniform("float","u_pointDiameter",de.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&$dt(i.lineStyle,t,n,o,s),s.addFragmentLines(r4),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function Xdt(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,de.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,de.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",a,de.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,de.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,de.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",de.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function Kdt(e,t,n,i,r,o){let s=n.constantLod;if(!l(s)||!l(o))return;let a=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(a,void 0,de.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,de.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",de.VERTEX),e.addUniform("float","u_constantLodDistance",de.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",de.VERTEX),e.addFragmentLines(s4);let u=o4.split(` +`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,de.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let u=M.clone(M.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=At.eastNorthUpToFixedFrame(p);M.inverse(g,u),f=!0}}return f?u:M.IDENTITY}}}function $dt(e,t,n,i,r){let{width:o,pattern:s}=e;l(o)&&(r.addUniform("float","u_lineWidth",de.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(s)&&(r.addDefine("HAS_LINE_PATTERN",void 0,de.BOTH),r.addUniform("float","u_linePattern",de.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=xt.getAttributeBySemantic(t,ct.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Oe.LINES||t.primitiveType===Oe.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,de.VERTEX),a.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,de.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",de.VERTEX),r.addUniform("float","u_pixelsPerWorld",de.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=xt.getAttributeInfo(a).variableName;r.addVertexLines(` +#ifdef HAS_LINE_CUMULATIVE_DISTANCE +void lineStyleStageVS(in ProcessedAttributes attributes) +{ + float cumDist = attributes.${u}; +#ifdef LINE_CUM_DIST_NORMALIZED + cumDist *= u_cumulativeDistanceMax; +#endif + const float textureCoordinateBase = 8192.0; + v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; +} +#endif +`)}else l(s)&&r.addVertexLines(` +#ifdef HAS_LINE_PATTERN +void lineStyleStageVS(in ProcessedAttributes attributes) +{ + vec4 posClip = gl_Position; + vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw; + + const float textureCoordinateBase = 8192.0; + if (czm_viewport.z > czm_viewport.w) { + v_lineCoord = textureCoordinateBase + screenPos.x; + } else { + v_lineCoord = textureCoordinateBase + screenPos.y; + } +} +#endif +`)}function DTe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,de.FRAGMENT),t[s]=function(){return n.transform}}function Jdt(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,de.FRAGMENT),t[s]=function(){return n.scale}}function Fu(e,t,n,i,r,o,s){e.addUniform("sampler2D",i,de.FRAGMENT),t[i]=function(){return n.texture??o};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,de.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,de.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&DTe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Jdt(e,t,n,i,r),Kdt(e,t,n,i,r,s)}function Zdt(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Ydt.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",de.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,de.FRAGMENT),l(u)&&!s&&Fu(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!s){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Fu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Fu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Qdt(e,t,n,i,r,o){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,de.FRAGMENT),l(s)&&!r&&Fu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,HQ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",de.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Fu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,HQ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",de.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(f)&&f!==HQ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",de.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,de.FRAGMENT))}function eht(e,t,n,i,r){let{specularTexture:o,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,de.FRAGMENT),l(o)&&!r&&Fu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==wTe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",de.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(a)&&!r&&Fu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,wTe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",de.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,de.FRAGMENT))}var tht=new h;function nht(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Fu(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",de.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,tht)}}function iht(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,de.FRAGMENT),l(o)&&o!==ITe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",de.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,de.FRAGMENT)),l(s)&&!r&&Fu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==ITe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",de.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Fu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Fu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function rht(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Fu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,jQ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",de.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,de.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Fu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==jQ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",de.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,de.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==jQ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",de.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,de.FRAGMENT))}var a4=PTe;var Vl={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"};Vl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Vl.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(Vl.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(Vl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(Vl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(Vl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(Vl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",de.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",de.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Vl.METADATA_PICKING_VALUE_TYPE} value = ${Vl.METADATA_PICKING_VALUE_TYPE}(${Vl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Vl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Vl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Vl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Vl.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Id=Vl;var c4=`void morphTargetsStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; attributes.positionMC = getMorphedPosition(positionMC); @@ -4958,7 +6548,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = getMorphedTangent(tangentMC); #endif } -`;var Da={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)"};Da.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ge.VERTEX),O5e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let l=t.morphTargets[a].attributes,u=l.length;for(let f=0;f<u;f++){let h=l[f],p=h.semantic;p!==ht.POSITION&&p!==ht.NORMAL&&p!==ht.TANGENT||(v5e(e,h,e.attributeIndex,a),e.attributeIndex++)}}R5e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ge.VERTEX),n.addVertexLines(U2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=xt(s,e.uniformMap)};var w5e={attributeString:void 0,functionId:void 0};function v5e(e,t,n,i){let o=e.shaderBuilder;D5e(e,t,n);let r=P5e(t,w5e);I5e(o,r,i)}function D5e(e,t,n){let i={index:n,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:nn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function P5e(e,t){switch(e.semantic){case ht.POSITION:t.attributeString="Position",t.functionId=Da.FUNCTION_ID_GET_MORPHED_POSITION;break;case ht.NORMAL:t.attributeString="Normal",t.functionId=Da.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ht.TANGENT:t.attributeString="Tangent",t.functionId=Da.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function I5e(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 O5e(e){e.addFunction(Da.FUNCTION_ID_GET_MORPHED_POSITION,Da.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ge.VERTEX),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Da.FUNCTION_ID_GET_MORPHED_NORMAL,Da.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ge.VERTEX),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Da.FUNCTION_ID_GET_MORPHED_TANGENT,Da.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ge.VERTEX),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function R5e(e){e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var V2=Da;var Ise={name:"PickingPipelineStage"};Ise.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)M5e(e,t,a,i);else if(c(a))L5e(e,i);else{let l=Ose(e),u=i.createPickId(l);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",ge.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Ose(e,t){let n=e.model;if(c(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Tr.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,c(t)&&(o.instanceId=t),o}function M5e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;c(i.featureTableId)?o=i.featureTableId:c(n)?(r=$t.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=$t.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let l=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ge.FRAGMENT);let f=l.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function L5e(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=Ose(e,h),g=t.createPickId(p);s.push(g),i[h]=g;let m=g.color;o[h*4+0]=G.floatToByte(m.red),o[h*4+1]=G.floatToByte(m.green),o[h*4+2]=G.floatToByte(m.blue),o[h*4+3]=G.floatToByte(m.alpha)}r._pickIds=i;let a=bt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,ge.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var z2=Ise;var N5e={ADD:0,REPLACE:1},Yo=Object.freeze(N5e);var H2=`float getPointSizeFromAttenuation(vec3 positionEC) { +`;var vc={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)"};vc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),uht(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ct.POSITION&&p!==ct.NORMAL&&p!==ct.TANGENT||(sht(e,d,e.attributeIndex,a),e.attributeIndex++)}}fht(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(c4);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Mt(s,e.uniformMap)};var oht={attributeString:void 0,functionId:void 0};function sht(e,t,n,i){let r=e.shaderBuilder;aht(e,t,n);let o=cht(t,oht);lht(r,o,i)}function aht(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function cht(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=vc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=vc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=vc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function lht(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function uht(e){e.addFunction(vc.FUNCTION_ID_GET_MORPHED_POSITION,vc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(vc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(vc.FUNCTION_ID_GET_MORPHED_NORMAL,vc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(vc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(vc.FUNCTION_ID_GET_MORPHED_TANGENT,vc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(vc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function fht(e){e.addFunctionLines(vc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(vc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(vc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var l4=vc;var RTe={name:"PickingPipelineStage"};function GQ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}RTe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)dht(e,t,a,i);else if(l(a))hht(e,i);else{let c=OTe(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",de.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=GQ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function OTe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Qo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function dht(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=xt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=xt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",de.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=GQ(e.pickId)}function hht(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=OTe(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,de.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=GQ(e.pickId)}var u4=RTe;var MTe={ADD:0,REPLACE:1};Object.freeze(MTe);var wo=MTe;var f4=`float getPointSizeFromAttenuation(vec3 positionEC) { float pointSize = model_pointCloudParameters.x; float geometricError = model_pointCloudParameters.y; float depthMultiplier = model_pointCloudParameters.z; @@ -4996,10 +6586,10 @@ return 1.0; #endif } #endif -`;var F5e=new se,Mse={name:"PointCloudStylingPipelineStage"};Mse.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=c(s)?s.propertyAttributes:void 0,l=c(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!c(a)&&l;if(c(r)&&!u){let y=V5e(a),b=z5e(r,y);H5e(i,b);let A=G5e(b).indexOf("normalMC")>=0,E=$t.getAttributeBySemantic(t,ht.NORMAL);if(A&&!E)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=De.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,g;Tr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===Yo.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(H2);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=F5e,b=1;p&&(b=g?5:h.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??b,y.x*=n.pixelRatio;let x=B5e(e,t,f,h);y.y=x*f.geometricErrorScale;let A=n.context,E=n.camera.frustum,S;return n.mode===oe.SCENE2D||E instanceof on?S=Number.POSITIVE_INFINITY:S=A.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=S,p&&(y.w=h.tileset.timeSinceLoad),y}};var Rse=new d;function B5e(e,t,n,i){if(c(i)){let f=i.tile.geometricError;if(f>0)return f}if(c(n.baseResolution))return n.baseResolution;let o=$t.getAttributeBySemantic(t,ht.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,Rse);a=F.multiplyByPointAsVector(s,a,Rse);let l=a.x*a.y*a.z;return O.cbrt(l/r)}var k5e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},U5e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function V5e(e){let t=We(U5e);if(!c(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 P9="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function z5e(e,t){let n=k5e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${P9})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${P9})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${P9})`,t,i),n.styleTranslucent=c(n.colorStyleFunction)&&i.translucent,n}function H5e(e,t){let n=t.colorStyleFunction;c(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ge.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;c(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ge.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;c(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ge.VERTEX),e.addVertexLines(o))}function I9(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 G5e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return c(t)&&I9(t,o),c(n)&&I9(n,o),c(i)&&I9(i,o),o}var G2=Mse;var j2=`void primitiveOutlineStage() { +`;var mht=new se,LTe={name:"PointCloudStylingPipelineStage"};LTe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let y=yht(a),A=Aht(o,y);bht(i,A);let x=xht(A).indexOf("normalMC")>=0,T=xt.getAttributeBySemantic(t,ct.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,de.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,de.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,de.VERTEX);let d,p,g;Qo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===wo.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(f4);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=mht,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=pht(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,E;return n.mode===re.SCENE2D||T instanceof _n?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var NTe=new h;function pht(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=xt.getAttributeBySemantic(t,ct.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,NTe);a=M.multiplyByPointAsVector(s,a,NTe);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var ght={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},_ht={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function yht(e){let t=Ze(_ht);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var WQ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Aht(e,t){let n=ght,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${WQ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${WQ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${WQ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function bht(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,de.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,de.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,de.VERTEX),e.addVertexLines(r))}function qQ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function xht(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&qQ(t,r),l(n)&&qQ(n,r),l(i)&&qQ(i,r),r}var d4=LTe;var h4=`void primitiveOutlineStage() { v_outlineCoordinates = a_outlineCoordinates; } -`;var W2=`void primitiveOutlineStage(inout czm_modelMaterial material) { +`;var m4=`void primitiveOutlineStage(inout czm_modelMaterial material) { if (!model_showOutline) { return; } @@ -5012,7 +6602,7 @@ 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 Lse={name:"PrimitiveOutlinePipelineStage"};Lse.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ge.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:nn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ge.FRAGMENT);let a=MA.createTexture(n.context);o.model_outlineTexture=function(){return a};let l=e.model;i.addUniform("vec4","model_outlineColor",ge.FRAGMENT),o.model_outlineColor=function(){return l.outlineColor},i.addUniform("bool","model_showOutline",ge.FRAGMENT),o.model_showOutline=function(){return l.showOutline},i.addVertexLines(j2),i.addFragmentLines(W2)};var q2=Lse;var Nse={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Fse,_count2DPositions:Bse,_countMorphTargetAttributes:kse,_countMaterialTextures:Use,_countFeatureIdTextures:Vse,_countBinaryMetadata:zse};Nse.process=function(e,t,n){let i=e.model,o=i.statistics;Fse(o,t),Bse(o,e.runtimePrimitive),kse(o,t),Use(o,t.material),Vse(o,t.featureIds),zse(o,i)};function Fse(e,t){let n=c(t.indices)?t.indices.count:$t.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=j5e(i,n));let o=t.attributes,r=o.length;for(let l=0;l<r;l++){let u=o[l];if(c(u.buffer)){let f=c(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;c(s)&&c(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(c(a)&&c(a.buffer)){let l=c(a.typedArray);e.addBuffer(a.buffer,l)}}function j5e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Bse(e,t){let n=t.positionBuffer2D;c(n)&&e.addBuffer(n,!0)}function kse(e,t){let n=t.morphTargets;if(!c(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 l=0;l<a;l++){let u=s[l];c(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Use(e,t){let n=W5e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r)&&c(r.texture)&&e.addTexture(r.texture)}}function W5e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return c(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Vse(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof An.FeatureIdTexture){let r=o.textureReader;c(r.texture)&&e.addTexture(r.texture)}}}function zse(e,t){let n=t.structuralMetadata;c(n)&&(q5e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!c(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function q5e(e,t){let n=t.propertyTextures;if(!c(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 u=s[a].textureReader;c(u.texture)&&e.addTexture(u.texture)}}}var Y2=Nse;var Y5e=new F,X5e=new F,Hse={name:"SceneMode2DPipelineStage"};Hse.process=function(e,t,n){let i=$t.getAttributeBySemantic(t,ht.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,l=F.multiplyTransformation(s,a,Y5e),u=Z5e(e,l,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(c(h))return;if(c(i.typedArray)){let y=e6e(i,l,u,n);f.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ge.VERTEX),o.addUniform("mat4","u_modelView2D",ge.VERTEX);let p=F.fromTranslation(u.center,new F),g=n.context,m={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,X5e)}};e.uniformMap=xt(m,e.uniformMap)};var K5e=new d,$5e=new d;function Z5e(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,K5e),o=Hi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,$5e),s=Hi.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,s,new le)}var Gse=new d;function Q5e(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=d.fromArray(e,s,Gse),l=d.multiplyComponents(a,r,a),u=d.add(l,o,l);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function J5e(e,t,n,i){let o;c(e.quantization)?o=Q5e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=c(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let l=r;l<s;l+=a){let u=d.fromArray(o,l,Gse);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),h=Hi.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[l]=p.x,o[l+1]=p.y,o[l+2]=p.z}return o}function e6e(e,t,n,i){let o=We(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=J5e(e,t,r,o),a=bt.createVertexBuffer({context:i.context,typedArray:s,usage:Be.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var X2=Hse;var K2=`void skinningStage(inout ProcessedAttributes attributes) +`;var FTe={name:"PrimitiveOutlinePipelineStage"};FTe.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,de.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",de.FRAGMENT);let a=qv.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",de.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",de.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(h4),i.addFragmentLines(m4)};var p4=FTe;var BTe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:kTe,_count2DPositions:UTe,_countMorphTargetAttributes:zTe,_countMaterialTextures:VTe,_countFeatureIdTextures:jTe,_countBinaryMetadata:HTe};BTe.process=function(e,t,n){let i=e.model,r=i.statistics;kTe(r,t),UTe(r,e.runtimePrimitive),zTe(r,t),VTe(r,t.material),jTe(r,t.featureIds),HTe(r,i)};function kTe(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Oe.POINTS?e.pointsLength+=n:Oe.isTriangles(i)&&(e.trianglesLength+=Tht(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}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 Tht(e,t){switch(e){case Oe.TRIANGLES:return t/3;case Oe.TRIANGLE_STRIP:case Oe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function UTe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function zTe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function VTe(e,t){let n=Eht(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function Eht(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 jTe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Cn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function HTe(e,t){let n=t.structuralMetadata;l(n)&&(Cht(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function Cht(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var g4=BTe;var vht=new M,Sht=new M,GTe={name:"SceneMode2DPipelineStage"};GTe.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,ct.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=M.multiplyTransformation(s,a,vht),u=Pht(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=Oht(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,de.VERTEX),r.addUniform("mat4","u_modelView2D",de.VERTEX);let p=M.fromTranslation(u.center,new M),g=n.context,m={u_modelView2D:function(){return M.multiplyTransformation(g.uniformState.view,p,Sht)}};e.uniformMap=Mt(m,e.uniformMap)};var wht=new h,Iht=new h;function Pht(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,wht),r=gr.computeActualEllipsoidPosition(n,i,i),o=M.multiplyByPoint(t,e.positionMax,Iht),s=gr.computeActualEllipsoidPosition(n,o,o);return le.fromCornerPoints(r,s,new le)}var WTe=new h;function Dht(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,WTe),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function Rht(e,t,n,i){let r;l(e.quantization)?r=Dht(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,WTe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),d=gr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function Oht(e,t,n,i){let r=Ze(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=Rht(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var _4=GTe;var y4=`void skinningStage(inout ProcessedAttributes attributes) { mat4 skinningMatrix = getSkinningMatrix(); mat3 skinningMatrixMat3 = mat3(skinningMatrix); @@ -5027,7 +6617,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = skinningMatrixMat3 * tangentMC; #endif } -`;var wb={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};wb.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ge.VERTEX),n6e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ge.VERTEX),n.addVertexLines(K2);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=xt(r,e.uniformMap)};function t6e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===ht.JOINTS||r.semantic===ht.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function n6e(e,t){e.addFunction(wb.FUNCTION_ID_GET_SKINNING_MATRIX,wb.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ge.VERTEX),e.addFunctionLines(wb.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=t6e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let l=r[o],u=`skinnedMatrix += a_weights_${i}.${l} * u_jointMatrices[int(a_joints_${i}.${l})];`;e.addFunctionLines(wb.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(wb.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var $2=wb;var Z2=`void verticalExaggerationStage( +`;var kx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};kx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),Nht(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(y4);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Mt(o,e.uniformMap)};function Mht(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ct.JOINTS||o.semantic===ct.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function Nht(e,t){e.addFunction(kx.FUNCTION_ID_GET_SKINNING_MATRIX,kx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(kx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=Mht(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(kx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(kx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var A4=kx;var b4=`void verticalExaggerationStage( inout ProcessedAttributes attributes ) { vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); @@ -5036,29 +6626,28 @@ float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCu float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; -vec3 vertexNormal = normalize(centerToVertex); +vec3 vertexEllipsoidNormalEC = normalize(centerToVertex); 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; -float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal); +float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexEllipsoidNormalEC); float smallAngleVersine = 0.5 * sinTheta * sinTheta; float versine = isSmallAngle ? smallAngleVersine : exactVersine; -float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine; +float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; float vertexHeight = czm_eyeHeight + dHeight; -vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz; -vertexNormalMC = normalize(vertexNormalMC); +vec3 exaggerationDirectionScaledMC = (czm_inverseModelView * vec4(vertexEllipsoidNormalEC, 0.0)).xyz; float stretch = u_verticalExaggerationAndRelativeHeight.x; float shift = u_verticalExaggerationAndRelativeHeight.y; float exaggeration = (vertexHeight - shift) * (stretch - 1.0); -attributes.positionMC += exaggeration * vertexNormalMC; +attributes.positionMC += exaggeration * exaggerationDirectionScaledMC; } -`;var jse={name:"VerticalExaggerationPipelineStage"},i6e=new z;jse.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(Z2),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ge.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ge.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return z.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,i6e)}};var Q2=jse;var O9={};function o6e(e){let t=Fe.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 r6e(e,t){let n=t.length,i=Fe.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],l=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=l,i[o++]=l,i[o++]=s}return i}function s6e(e){let t=e-2,n=2+t*4,i=Fe.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 a6e(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let l=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=l}return r}function c6e(e){let t=e-2,n=2+t*4,i=Fe.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 l6e(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let l=0;l<i;l++){let u=t[l+1],f=t[l+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}O9.createWireframeIndices=function(e,t,n){let i=c(n);if(e===Me.TRIANGLES)return i?r6e(t,n):o6e(t);if(e===Me.TRIANGLE_STRIP)return i?a6e(t,n):s6e(t);if(e===Me.TRIANGLE_FAN)return i?l6e(t,n):c6e(t)};O9.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var Gv=O9;var Wse={name:"WireframePipelineStage"};Wse.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ge.FRAGMENT);let o=e.model,r=u6e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,l=e.count;e.primitiveType=Me.LINES,e.count=Gv.getWireframeIndicesCount(a,l)};function u6e(e,t,n){let o=$t.getAttributeBySemantic(e,ht.POSITION).count,r=n.context.webgl2,s;if(c(t)){let f=t.buffer,h=t.count;c(f)&&r?(s=f.sizeInBytes===h?new Uint8Array(h):Fe.createTypedArray(o,h),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,l=Gv.createWireframeIndices(a,o,s),u=Fe.fromSizeInBytes(l.BYTES_PER_ELEMENT);return bt.createIndexBuffer({context:n.context,typedArray:l,usage:Be.STATIC_DRAW,indexDatatype:u})}var J2=Wse;function qse(e){e=e??W.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;T.typeOf.object("options.primitive",t),T.typeOf.object("options.node",n),T.typeOf.object("options.model",i),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=[]}qse.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,u=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=c(n.morphTargets)&&n.morphTargets.length>0,p=c(i.skin),g=c(r),y=!(g&&c(r.fragmentShaderText))||r.mode!==zg.REPLACE_MATERIAL,b=$t.hasQuantizedAttributes(n.attributes),x=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),A=o.pointCloudShading,E=c(A)&&A.attenuation,S=c(A)&&A.backFaceCulling,v=n.primitiveType===Me.POINTS&&(c(s)||E||S),P=o._enableShowOutline&&c(n.outlineCoordinates),M=f6e(o,i,n),R=c(o.classificationType);u&&t.push(X2),t.push(L2),x&&t.push(J2),R&&t.push(x2),h&&t.push(V2),p&&t.push($2),v&&t.push(G2),b&&t.push(O2),y&&t.push(k2),t.push(Cb),t.push(wd),t.push(yf),M.hasPropertyTable&&(t.push(Sb),t.push(b2),t.push(C2)),f&&t.push(Q2),g&&t.push(I2),t.push(F2),o.allowPicking&&t.push(z2),P&&t.push(q2),t.push(y2),t.push(Y2)};function f6e(e,t,n){let i;return c(t.instances)&&(i=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(i))?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:(i=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),c(i)?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var eB=qse;function R9(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.skin",e.skin),T.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],d6e(this)}Object.defineProperties(R9.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 d6e(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 l=0;l<o;l++){let u=i[l].index,f=r[u];s.push(f);let h=n[l],p=Yse(f,h,new F);a.push(p)}}function Yse(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}R9.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]=Yse(i,o,e[n])}};var tB=R9;function h6e(){this.pass=void 0,this.alphaCutoff=void 0}var nB=h6e;function m6e(e){T.typeOf.object("model",e),this.shaderBuilder=new MT,this.model=e,this.uniformMap={},this.alphaOptions=new nB,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var iB=m6e;var oB=`void silhouetteStage(inout vec4 color) { +`;var qTe={name:"VerticalExaggerationPipelineStage"},Lht=new U;qTe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(b4),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,de.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",de.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,Lht)}};var x4=qTe;var YTe={name:"WireframePipelineStage"};YTe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=Fht(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Oe.LINES,e.count=BD.getWireframeIndicesCount(a,c)};function Fht(e,t,n){let r=xt.getAttributeBySemantic(e,ct.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):je.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=BD.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var T4=YTe;function XTe(e){e=e??H.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=[]}XTe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==$y.REPLACE_MATERIAL,b=xt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Oe.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),T=r.pointCloudShading,E=l(T)&&T.attenuation,v=l(T)&&T.backFaceCulling,S=n.primitiveType===Oe.POINTS&&(l(s)||E||v),I=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=Bht(r,i,n),L=l(r.classificationType);u&&t.push(_4),t.push(OV),x&&t.push(T4),L&&t.push(hV),d&&t.push(l4),p&&t.push(A4),S&&t.push(d4),b&&t.push(CV),g&&(I?yt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(t4)),A&&t.push(a4),t.push(Mx),t.push(Vh),t.push(Id),O.hasPropertyTable&&(t.push(Lx),t.push(dV),t.push(gV)),f&&t.push(x4),m&&t.push(EV),t.push(i4),r.allowPicking&&t.push(u4),I&&t.push(p4),R&&(e.edgeVisibilityRequested=!0,t.push(PV),t.push(SV)),t.push(fV),t.push(g4)};function Bht(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var E4=XTe;function YQ(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],kht(this)}Object.defineProperties(YQ.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 kht(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=KTe(f,d,new M);a.push(p)}}function KTe(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}YQ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=KTe(i,r,e[n])}};var C4=YQ;function Uht(){this.pass=void 0,this.alphaCutoff=void 0}var hS=Uht;function zht(e){this.shaderBuilder=new N_,this.model=e,this.uniformMap={},this.alphaOptions=new hS,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:xc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var v4=zht;var S4=`void silhouetteStage(inout vec4 color) { if(model_silhouettePass) { color = czm_gammaCorrect(model_silhouetteColor); } } -`;var rB=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +`;var w4=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { #ifdef HAS_NORMALS if(model_silhouettePass) { vec3 normal = normalize(czm_normal3D * attributes.normalMC); @@ -5068,14 +6657,14 @@ positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixel } #endif } -`;var sB={name:"ModelSilhouettePipelineStage"};sB.silhouettesLength=0;sB.process=function(e,t,n){c(t._silhouetteId)||(t._silhouetteId=++sB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ge.BOTH),i.addVertexLines(rB),i.addFragmentLines(oB),i.addUniform("vec4","model_silhouetteColor",ge.FRAGMENT),i.addUniform("float","model_silhouetteSize",ge.VERTEX),i.addUniform("bool","model_silhouettePass",ge.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=xt(o,e.uniformMap),e.hasSilhouette=!0};var aB=sB;var cB=`void modelSplitterStage() +`;var I4={name:"ModelSilhouettePipelineStage"};I4.silhouettesLength=0;I4.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++I4.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(w4),i.addFragmentLines(S4),i.addUniform("vec4","model_silhouetteColor",de.FRAGMENT),i.addUniform("float","model_silhouetteSize",de.VERTEX),i.addUniform("bool","model_silhouettePass",de.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Mt(r,e.uniformMap),e.hasSilhouette=!0};var P4=I4;var D4=`void modelSplitterStage() { #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 lB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};lB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(cB);let o={};i.addUniform("float",lB.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[lB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var uB=lB;function p6e(e,t){T.typeOf.object("modelRenderResources",e),T.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=We(e.uniformMap),this.alphaOptions=We(e.alphaOptions),this.renderStateOptions=We(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 fB=p6e;function _6e(e){e=e??W.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Up.UNLIT}var dB=_6e;function g6e(e,t){T.typeOf.object("nodeRenderResources",e),T.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=We(e.uniformMap),this.alphaOptions=We(e.alphaOptions),this.renderStateOptions=We(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=c(n.indices)?n.indices.count:$t.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=$t.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new dB,this.pickId=void 0}var hB=g6e;function L9(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let 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!==Un.CESIUM_3D_TILE,this._classifies3DTiles=o!==Un.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],T6e(this)}function y6e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},depthMask:!1}}var b6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},x6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},$se=[];function T6e(e){let t=e._command,n=$se;if(e._useDebugWireframe){t.pass=De.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=jv(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let l=r[a];l.count*=2,l.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=De.TERRAIN_CLASSIFICATION,s=M9(t,r),a=Xse(t,r);n.length=0,n.push(s,a),e._commandListTerrain=jv(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Kse(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=De.CESIUM_3D_TILE_CLASSIFICATION,s=M9(t,r),a=Xse(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=jv(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Kse(e,n,e._commandList3DTilesPicking))}}function jv(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let l=0;l<s;l++){let u=o[l],f=r[l];for(let h=0;h<a;h++){let p=t[h],g=Je.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function M9(e,t){let n=Je.shallowClone(e);n.cull=!1,n.pass=t;let i=t===De.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=y6e(i);return n.renderState=ze.fromCache(o),n}function Xse(e,t){let n=Je.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(b6e),n}var A6e=[];function Kse(e,t,n){let i=ze.fromCache(x6e),o=t[0],r=t[1],s=Je.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=Je.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let l=A6e;return l.length=0,l.push(s,a),jv(e,l,n)}Object.defineProperties(L9.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=F.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}}});L9.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=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=M9(this._command,o),s=$se;s.length=0,s.push(r),this._commandListIgnoreShow=jv(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 mB=L9;function pB(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===De.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,l=n.hasSilhouette,u=!r&&!l,f=n.hasSkipLevelOfDetail&&!r,h=l;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new F,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=u,this._needsSkipLevelOfDetailCommands=f,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,C6e(this)}function Vp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Vp.clone=function(e){return new Vp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function C6e(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 Vp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Vp({command:I6e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Vp({command:F6e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Vp({command:B6e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Vp({command:O6e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Vp({command:R6e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(pB.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=F.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,S6e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,w6e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,v6e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,D6e(this))}}});function E6e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=O.sign(n[13])*2*O.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function S6e(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 w6e(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=We(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function v6e(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=We(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function D6e(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}}}pB.prototype.pushCommands=function(e,t){let n=Zse(this,e);n&&!this._has2DCommands&&(P6e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(E6e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&c(i)&&(i!==im.ALL_OPAQUE&&XA(t,this._translucentCommand,n),i===im.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||XA(o._backfaceCommands,this._skipLodBackfaceCommand,n),M6e(this,r,n),XA(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){XA(t,this._silhouetteModelCommand,n);return}return XA(t,this._originalCommand,n),t}};pB.prototype.pushSilhouetteCommands=function(e,t){let n=Zse(this,e);return XA(t,this._silhouetteColorCommand,n),t};function XA(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Zse(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*O.PI;return o<s&&r>s||o<-s&&r>-s}function YA(e,t){if(!c(t))return;let n=Vp.clone(t),i=Je.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 P6e(e){YA(e,e._originalCommand),YA(e,e._translucentCommand),YA(e,e._skipLodBackfaceCommand),YA(e,e._skipLodStencilCommand),YA(e,e._silhouetteModelCommand),YA(e,e._silhouetteColorCommand)}function I6e(e){let t=Je.shallowClone(e);t.pass=De.TRANSLUCENT;let n=We(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function O6e(e,t){let n=t._silhouetteId%255,i=Je.shallowClone(e),o=We(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function R6e(e,t){let n=t._silhouetteId%255,i=Je.shallowClone(e),o=We(e.renderState,!0);o.cull.enabled=!1,(e.pass===De.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=De.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=We(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function M6e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=L6e(o);if(r!==s){let a=N6e(r),l=We(o.renderState,!0);l.stencilTest.reference=a,o.renderState=ze.fromCache(l),n&&(i.derivedCommand2D.renderState=l)}}function L6e(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function N6e(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function F6e(e){let t=Je.shallowClone(e),n=We(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=We(t.uniformMap),o=new z(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function B6e(e){let t=Je.shallowClone(e),n=We(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ft.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ft.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var _B=pB;var gB=`precision highp float; +`;var R4={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};R4.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(D4);let r={};i.addUniform("float",R4.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[R4.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Mt(r,e.uniformMap)};var O4=R4;function Vht(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ze(e.uniformMap),this.alphaOptions=Ze(e.alphaOptions),this.renderStateOptions=Ze(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,this.primitiveRenderResources=[]}var M4=Vht;function jht(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Cg.UNLIT}var N4=jht;function Hht(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=Ze(e.uniformMap),this.alphaOptions=Ze(e.alphaOptions),this.renderStateOptions=Ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new N4,this.pickId=void 0,this.snapId=void 0}var L4=Hht;function KQ(e){e=e??H.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 r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==ti.CESIUM_3D_TILE,this._classifies3DTiles=r!==ti.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Yht(this)}function Ght(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:e,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:xc.LESS_OR_EQUAL},depthMask:!1}}var Wht={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:rn.PRE_MULTIPLIED_ALPHA_BLEND},qht={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},ZTe=[];function Yht(e){let t=e._command,n=ZTe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=B1(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ie.TERRAIN_CLASSIFICATION,s=XQ(t,o),a=$Te(t,o);n.length=0,n.push(s,a),e._commandListTerrain=B1(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=JTe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=XQ(t,o),a=$Te(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=B1(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=JTe(e,n,e._commandList3DTilesPicking))}}function B1(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=at.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function XQ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ni.ALWAYS:ni.EQUAL,r=Ght(i);return n.renderState=Ge.fromCache(r),n}function $Te(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Wht),n}var Xht=[];function JTe(e,t,n){let i=Ge.fromCache(qht),r=t[0],o=t[1],s=at.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=at.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=Xht;return c.length=0,c.push(s,a),B1(e,c,n)}Object.defineProperties(KQ.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=M.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}}});KQ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Zn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Zn(t,this._commandListTerrain),this._classifies3DTiles&&Zn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=XQ(this._command,r),s=ZTe;s.length=0,s.push(o),this._commandListIgnoreShow=B1(this,s,this._commandListIgnoreShow)}Zn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Zn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Zn(t,this._commandList3DTilesPicking)),t};var F4=KQ;function mS(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Ie.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new M,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=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,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._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Kht(this)}function Pd(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Pd.clone=function(e){return new Pd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Kht(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new Pd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Pd({command:nmt(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Pd({command:lmt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Pd({command:umt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Pd({command:imt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Pd({command:rmt(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,s=o.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new Pd({command:QTe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Pd({command:QTe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Pd({command:omt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand))}Object.defineProperties(mS.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=M.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,Jht(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Zht(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Qht(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,emt(this))}}});function $ht(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Jht(e){let t=e.shadows,n=Dn.castShadows(t),i=Dn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Zht(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Ze(o.renderState,!0);s.cull.enabled=t,o.renderState=Ge.fromCache(s)}}}function Qht(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Ze(o.renderState,!0);s.cull.face=t,o.renderState=Ge.fromCache(s)}}}function emt(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}mS.prototype.pushCommands=function(e,t){let n=B4(this,e);n&&!this._has2DCommands&&(tmt(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&($ht(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Rp.ALL_OPAQUE&&Bp(t,this._translucentCommand,n),i===Rp.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Bp(r._backfaceCommands,this._skipLodBackfaceCommand,n),smt(this,o,n),Bp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Bp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Uh.EDGES_ONLY&&this._needsEdgeCommands||Bp(t,this._originalCommand,n),t}};mS.prototype.pushSilhouetteCommands=function(e,t){let n=B4(this,e);return Bp(t,this._silhouetteColorCommand,n),t};mS.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=B4(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Bp(t,s,r),t}if(i.pick){if(n!==Uh.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Bp(t,s,r),t}if(n===Uh.SURFACES_ONLY)return t;let o=n===Uh.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),Bp(t,this._edgeCommand,r),t};mS.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=B4(this,e);return Bp(t,this._planarFillIdCommand,n),t};function Bp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function B4(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return r<s&&o>s||r<-s&&o>-s}function vg(e,t){if(!l(t))return;let n=Pd.clone(t),i=at.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 tmt(e){vg(e,e._originalCommand),vg(e,e._translucentCommand),vg(e,e._skipLodBackfaceCommand),vg(e,e._skipLodStencilCommand),vg(e,e._silhouetteModelCommand),vg(e,e._silhouetteColorCommand),vg(e,e._edgeCommand),vg(e,e._edgeSnapCommand),vg(e,e._planarFillIdCommand)}function nmt(e){let t=at.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=Ze(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=rn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function imt(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Ze(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ge.fromCache(r),i}function rmt(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Ze(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,r.depthMask=!1,r.blending=rn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ze(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ge.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function QTe(e,t,n){let i=t.edgeGeometry,r=at.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Ze(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function omt(e){let t=at.shallowClone(e);t.pass=Ie.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Ze(e.renderState,!0);n.blending.enabled=!1,t.renderState=Ge.fromCache(n);let i=Ze(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function smt(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=amt(r);if(o!==s){let a=cmt(o),c=Ze(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function amt(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function cmt(e){return Xt.CESIUM_3D_TILE_MASK|e<<Xt.SKIP_LOD_BIT_SHIFT}function lmt(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Gi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ze(t.uniformMap),r=new U(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ge.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function umt(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Xt.SKIP_LOD_MASK,i.reference=Xt.CESIUM_3D_TILE_MASK,i.frontFunction=ni.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ni.GREATER_OR_EQUAL,i.backOperation.zPass=Rt.REPLACE,n.stencilMask=Xt.CESIUM_3D_TILE_MASK|Xt.SKIP_LOD_MASK,t.renderState=Ge.fromCache(n),t}var k4=mS;var U4=`precision highp float; czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { czm_modelVertexOutput vsOutput; vsOutput.positionMC = positionMC; @@ -5086,6 +6675,9 @@ void main() { ProcessedAttributes attributes; initializeAttributes(attributes); +#ifdef HAS_IMAGERY +initializeImageryAttributes(); +#endif #ifdef USE_DEQUANTIZATION dequantizationStage(attributes); #endif @@ -5132,7 +6724,7 @@ v_pickColor = a_pickColor; Metadata metadata; MetadataClass metadataClass; MetadataStatistics metadataStatistics; -metadataStage(metadata, metadataClass, metadataStatistics, attributes); +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); #ifdef HAS_VERTICAL_EXAGGERATION verticalExaggerationStage(attributes); #endif @@ -5141,11 +6733,17 @@ czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); #endif vec4 positionClip = geometryStage(attributes, modelView, normal); +#ifdef ENABLE_CLIPPING_POLYGONS +modelClippingPolygonsStage(); +#endif +#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN) +lineStyleStageVS(attributes); +#endif #ifdef HAS_ATMOSPHERE atmosphereStage(attributes); #endif -#ifdef ENABLE_CLIPPING_POLYGONS -modelClippingPolygonsStage(attributes); +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(attributes); #endif #ifdef HAS_SILHOUETTE silhouetteStage(attributes, positionClip); @@ -5166,17 +6764,26 @@ v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); gl_PointSize = vsOutput.pointSize; #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); +#elif defined(HAS_POINT_DIAMETER) +gl_PointSize = u_pointDiameter; #else gl_PointSize = 1.0; #endif gl_PointSize *= show; #endif gl_Position = positionClip; +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStageVS(); +#endif #ifdef HAS_POINT_CLOUD_SHOW_STYLE v_pointCloudShow = show; #endif } -`;var yB=`precision highp float; +`;var z4=`precision highp float; +const float PLANAR_DEPTH_PULL = 0.9995; +const float BEHIND_DEPTH_PUSH = 1.0002; +const float FEATURE_ID_TOLERANCE = 0.5; +const float FEATURE_ID_OFFSET = 1.0; czm_modelMaterial defaultModelMaterial() { czm_modelMaterial material; @@ -5198,9 +6805,28 @@ discard; #endif return vec4(color, alpha); } +void lineStyleStage() +{ +#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY) +const float maskLength = 16.0; +float dashPosition = fract(v_lineCoord / maskLength); +float maskIndex = floor(dashPosition * maskLength); +float maskTest = floor(u_linePattern / pow(2.0, maskIndex)); +if (mod(maskTest, 2.0) < 1.0) { +discard; +} +#endif +} SelectedFeature selectedFeature; +bool isEdge = false; void main() { +#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER) +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +if (distanceToCenter > 0.5) { +discard; +} +#endif #ifdef HAS_POINT_CLOUD_SHOW_STYLE if (v_pointCloudShow == 0.0) { @@ -5215,10 +6841,20 @@ ProcessedAttributes attributes; geometryStage(attributes); FeatureIds featureIds; featureIdStage(featureIds, attributes); +#ifdef HAS_PLANAR_FILL_ID_PASS +if (u_isPlanarFillIdPass) { +float fid = float(featureIds.PLANAR_FILL_FEATURE_ID) + FEATURE_ID_OFFSET; +out_FragColor = vec4(fid, 0.0, 0.0, 1.0); +#ifdef LOG_DEPTH +czm_writeLogDepth(); +#endif +return; +} +#endif Metadata metadata; MetadataClass metadataClass; MetadataStatistics metadataStatistics; -metadataStage(metadata, metadataClass, metadataStatistics, attributes); +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); #ifndef METADATA_PICKING_ENABLED #ifdef HAS_SELECTED_FEATURE_ID selectedFeatureIdStage(selectedFeature, featureIds); @@ -5245,12 +6881,16 @@ vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); metadataPickingStage(metadata, metadataClass, metadataValues); vec4 color = metadataValues; #endif +lineStyleStage(); #ifdef HAS_CLIPPING_PLANES modelClippingPlanesStage(color); #endif #ifdef ENABLE_CLIPPING_POLYGONS modelClippingPolygonsStage(); #endif +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(color); +#endif #ifndef METADATA_PICKING_ENABLED #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) silhouetteStage(color); @@ -5258,41 +6898,52 @@ silhouetteStage(color); #ifdef HAS_ATMOSPHERE atmosphereStage(color, attributes); #endif +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStage(color, featureIds); +edgeDetectionStage(color, featureIds); +if (u_isEdgePass) { +isEdge = true; +} +#endif #endif out_FragColor = color; +#ifdef LOG_DEPTH +czm_writeLogDepth(); +#endif +#ifdef HAS_PLANAR_FILL_DEPTH +gl_FragDepth *= PLANAR_DEPTH_PULL; +#endif +#ifdef HAS_PLANAR_FILL_BEHIND +{ +vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw; +float storedEncoded = texture(czm_planarFillIdTexture, screenCoord).r; +float storedFeatureId = storedEncoded - FEATURE_ID_OFFSET; +float myFeatureId = float(featureIds.PLANAR_FILL_FEATURE_ID); +if (storedFeatureId >= 0.0 && abs(storedFeatureId - myFeatureId) < FEATURE_ID_TOLERANCE) { +gl_FragDepth *= BEHIND_DEPTH_PUSH; +} +} +#endif } -`;function Qse(){}Qse.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=k6e(e,n,t),o=U6e(e,i,t),r=e.model;return c(r.classificationType)?new mB({primitiveRenderResources:e,command:o}):new _B({primitiveRenderResources:e,command:o})};function k6e(e,t,n){t.addVertexLines(gB),t.addFragmentLines(yB);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function U6e(e,t,n){let i=V6e(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,l=n.mode===oe.SCENE3D,u,f;if(!l&&!n.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),f=e.runtimePrimitive.boundingSphere2D;else{let x=l?a._computedModelMatrix:a._computedModelMatrix2D;u=F.multiplyTransformation(x,e.runtimeNode.computedTransform,new F),f=le.transform(e.boundingSphere,u)}let h=We(ze.fromCache(e.renderStateOptions),!0);h.cull.face=$t.getCullFace(u,e.primitiveType),h=ze.fromCache(h);let p=c(r.classificationType),g=p?!1:Tn.castShadows(r.shadows),m=p?!1:Tn.receiveShadows(r.shadows),y=p?void 0:e.pickId;return new Je({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function V6e(e){let t=e.wireframeIndexBuffer;if(c(t))return t;let n=e.indices;if(c(n)){if(!c(n.buffer))throw new C("Indices must be provided as a Buffer");return n.buffer}}var bB=Qse;function lu(e){e=e??W.EMPTY_OBJECT;let t=e.modelComponents;T.typeOf.object("options.model",e.model),T.typeOf.object("options.modelComponents",t),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=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=$t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},z6e(this)}Object.defineProperties(lu.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 z6e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Jse(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let A=0;A<s;A++){let E=r[A],S=new n2({articulation:E,sceneGraph:e}),v=S.name;a[v]=S}let l=t.nodes,u=l.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=F.IDENTITY;for(let A=0;A<h;A++){let E=n.nodes[A],S=eae(e,E,p);e._rootNodes.push(S)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let A=0;A<y;A++){let E=g[A];m.push(new tB({skin:E,sceneGraph:e}))}let b=e._skinnedNodes,x=b.length;for(let A=0;A<x;A++){let E=b[A],S=e._runtimeNodes[E],P=l[E].skin.index;S._runtimeSkin=m[P],S.updateJointMatrices()}e.applyArticulations()}function Jse(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var H6e=new d;function G6e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,H6e);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=Ot.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ot.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function eae(e,t,n){let i=[],o=$t.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=F.multiplyTransformation(n,o,new F),g=eae(e,h,p);i.push(g)}let s=new g2({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new eB({primitive:t.primitives[f],node:t,model:e._model}));let l=t.index;e._runtimeNodes[l]=s,c(t.skin)&&e._skinnedNodes.push(l);let u=t.name;if(c(u)){let f=e._model,h=new l2(f,s);f._nodesByName[u]=h}return l}var j6e=new d,W6e=new d,q6e=new d,Y6e=new d;lu.prototype.buildDrawCommands=function(e){let t=this._model,n=new iB(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=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,j6e),l=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,W6e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!c(u))continue;u.configurePipeline();let f=u.pipelineStages,h=new fB(n,u);for(r=0;r<f.length;r++)f[r].process(h,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let g=u.runtimePrimitives[r];g.configurePipeline(e);let m=g.pipelineStages,y=new hB(h,g);for(s=0;s<m.length;s++)m[s].process(y,g.primitive,e);g.boundingSphere=le.clone(y.boundingSphere,new le);let b=F.multiplyByPoint(p,y.positionMin,q6e),x=F.multiplyByPoint(p,y.positionMax,Y6e);d.minimumByComponent(a,b,a),d.minimumByComponent(a,x,a),d.maximumByComponent(l,x,l),d.maximumByComponent(l,b,l);let A=bB.buildModelDrawCommand(y,e);g.drawCommand=A}}this._boundingSphere=le.fromCornerPoints(a,l,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};lu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;c(n.color)&&t.push(Ab),!c(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(JF),n.isClippingEnabled()&&t.push(r2),n.isClippingPolygonsEnabled()&&t.push(c2),n.hasSilhouette(e)&&t.push(aB),c(n.splitDirection)&&n.splitDirection!==qr.NONE&&t.push(uB),Tr.is3DTiles(n.type)&&t.push(XF),i&&t.push(ZF))};lu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!c(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)}}};lu.prototype.updateModelMatrix=function(e,t){Jse(this,e),t.mode!==oe.SCENE3D&&G6e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};lu.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 tae(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let l=0;l<r;l++){let u=t.getChild(l);tae(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let l=0;l<a;l++){let u=s[l];i(u,o)}}function xB(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],l=e._runtimeNodes[a];tae(e,l,t,n,i)}}var X6e={backFaceCulling:void 0};lu.prototype.updateBackFaceCulling=function(e){let t=X6e;t.backFaceCulling=e,xB(this,!1,K6e,t)};function K6e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var $6e={shadowMode:void 0};lu.prototype.updateShadows=function(e){let t=$6e;t.shadowMode=e,xB(this,!1,Z6e,t)};function Z6e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var Q6e={debugShowBoundingVolume:void 0};lu.prototype.updateShowBoundingVolume=function(e){let t=Q6e;t.debugShowBoundingVolume=e,xB(this,!1,J6e,t)};function J6e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var nae=[],eje={frameState:void 0,hasSilhouette:void 0};lu.prototype.pushDrawCommands=function(e){let t=nae;t.length=0;let n=eje;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,xB(this,!0,tje,n),e.commandList.push.apply(e.commandList,t)};function tje(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=nae,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}lu.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];c(r)&&r.setArticulationStage(o,t)};lu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var TB=lu;function Hg(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Et}Object.defineProperties(Hg.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}}});Hg.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()};Hg.prototype.addBuffer=function(e,t){if(T.typeOf.object("buffer",e),T.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Hg.prototype.addTexture=function(e){T.typeOf.object("texture",e),this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Hg.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Hg.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Hg.prototype.addBatchTexture=function(e){T.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var AB=Hg;var sae=jr(lO(),1);var iae={},vb=Uint32Array.BYTES_PER_ELEMENT;iae.parse=function(e,t){t=t??0,T.defined("arrayBuffer",e);let n=new Uint8Array(e),i=new DataView(e);t+=vb;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+=vb,t+=vb;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=vb;let s=i.getUint32(t,!0);t+=vb;let a=i.getUint32(t,!0);t+=vb;let l=i.getUint32(t,!0);t+=vb;let u=sr(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=sr(n,t,a),t+=a,l>0&&(p=new Uint8Array(e,t,l),t+=l));let g=new tm(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!c(m))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(y)&&(y=d.unpack(y));let b=nje(g,h);if(b.rtcCenter=y,b.pointsLength=m,!b.hasPositions){let x=ije(g);b.positions=x,b.hasPositions=b.hasPositions||c(x)}if(!b.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let x=rje(g);b.normals=x,b.hasNormals=b.hasNormals||c(x)}if(!b.hasColors){let x=oje(g);b.colors=x,b.hasColors=b.hasColors||c(x),b.hasConstantColor=c(b.constantColor),b.isTranslucent=c(x)&&x.isTranslucent}if(!b.hasBatchIds){let x=sje(g);b.batchIds=x,b.hasBatchIds=b.hasBatchIds||c(x)}if(b.hasBatchIds){let x=g.getGlobalProperty("BATCH_LENGTH");if(!c(x))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=x}return c(p)&&(p=new Uint8Array(p),b.batchTableJson=h,b.batchTableBinary=p),b};function nje(e,t){let n=e.json,i,o,r,s=c(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=c(t)&&c(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;c(a)&&(r=a.properties);let l,u,f,h,p;if(c(s)){o=s.properties;let m=s.byteOffset,y=s.byteLength;if(!c(o)||!c(m)||!c(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),l=c(o.POSITION),u=c(o.RGB)||c(o.RGBA),f=c(o.NORMAL),h=c(o.BATCH_ID),p=c(o.RGBA)}let g;return c(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:l,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function ije(e){let t=e.json,n;if(c(t.POSITION))return n=e.getPropertyArray("POSITION",$.FLOAT,3),{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!0,componentDatatype:$.FLOAT,type:nn.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:$.UNSIGNED_SHORT,quantizedType:nn.VEC3}}}function oje(e){let t=e.json,n;if(c(t.RGBA))return n=e.getPropertyArray("RGBA",$.UNSIGNED_BYTE,4),{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(c(t.RGB))return n=e.getPropertyArray("RGB",$.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(c(t.RGB565))return n=e.getPropertyArray("RGB565",$.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.FLOAT,type:nn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(c(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",$.UNSIGNED_BYTE,4),o=i[3],r=G.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:r,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:s}}}function rje(e){let t=e.json,n;if(c(t.NORMAL))return n=e.getPropertyArray("NORMAL",$.FLOAT,3),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",$.UNSIGNED_BYTE,2),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:nn.VEC2,quantizedComponentDatatype:$.UNSIGNED_BYTE,componentDatatype:$.FLOAT,type:nn.VEC3}}function sje(e){let t=e.json;if(c(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",$.UNSIGNED_SHORT,1);return{name:ht.FEATURE_ID,semantic:ht.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:$.fromTypedArray(n),type:nn.SCALAR}}}var KA=iae;var aje=An.Components,cje=An.Scene,lje=An.Node,uje=An.Primitive,fje=An.Attribute,oae=An.Quantization,dje=An.FeatureIdAttribute,hje=An.Material,mje=An.MetallicRoughness;function Gg(e){e=e??W.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;T.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=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=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}c(Object.create)&&(Gg.prototype=Object.create($i.prototype),Gg.prototype.constructor=Gg);Object.defineProperties(Gg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Gg.prototype.load=function(){if(c(this._promise))return this._promise;this._parsedContent=KA.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)};Gg.prototype.process=function(e){if(c(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(c(this._decodePromise))return!1;this._decodePromise=pje(this,e.context)}return!1};function pje(e,t){let i=e._parsedContent.draco,o;if(c(i)?o=yg.decodePointCloud(i,t):o=Promise.resolve(),!!c(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return c(r)&&_je(e,i,r),vje(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function _je(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(c(n.POSITION)){if(o={name:"POSITION",semantic:ht.POSITION,typedArray:n.POSITION.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1},c(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,l=a.range,u=d.fromElements(l,l,l),f=d.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT,o.quantizedType=nn.VEC3}i.positions=o}if(c(n.NORMAL)){if(o={name:"NORMAL",semantic:ht.NORMAL,typedArray:n.NORMAL.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},c(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=$.UNSIGNED_BYTE,o.quantizedType=nn.VEC2}i.normals=o}if(c(n.RGBA)?i.colors={name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isTranslucent:!0}:c(n.RGB)&&(i.colors={name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isTranslucent:!1}),c(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ht.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:$.fromTypedArray(a),type:nn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let l=n[a];c(r)||(r={}),i.hasDracoBatchTable=!0;let u=l.data;r[a]={byteOffset:u.byteOffset,type:gje(u.componentsPerAttribute),componentType:yje(u.componentDatatype),typedArray:l.array}}i.batchTableJson=r}function gje(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new C("componentsPerAttribute must be a number from 1-4")}}function yje(e){switch(e){case ne.BYTE:return"BYTE";case ne.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ne.SHORT:return"SHORT";case ne.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ne.INT:return"INT";case ne.UNSIGNED_INT:return"UNSIGNED_INT";case ne.DOUBLE:return"DOUBLE";case ne.FLOAT:return"FLOAT";default:throw new C("value is not a valid WebGL constant")}}function Wv(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new oae,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new oae;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=d.ZERO;let l=t.quantizedVolumeScale;o.quantizedVolumeDimensions=l,o.quantizedVolumeStepSize=d.divideByScalar(l,a,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new fje;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Ln.decodeRGB565(i)),c(t.constantColor)){let a=new Array(4);r.constant=G.pack(t.constantColor,a)}else{let a=bt.createVertexBuffer({typedArray:i,context:n,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===ht.POSITION&&s&&(r.typedArray=i),r}var rae,CB;function bje(e){if(!c(CB)){rae=new sae.default(0),CB=new Array(e);for(let t=0;t<e;++t)CB[t]=rae.random()}return CB}var xje=new d,Tje=new d,Aje=new d;function Cje(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=bje(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=d.fromElements(s,s,s,xje),u=d.fromElements(a,a,a,Tje),f,h,p;if(e.isQuantized)l=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,Aje),d.minimumByComponent(l,p,l),d.maximumByComponent(u,p,u);e.min=d.clone(l),e.max=d.clone(u)}var Eje={name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:G.DARKGRAY,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:!1};function Sje(e,t,n){let i=[],o,r=t.positions;return c(r)&&(Cje(r),o=Wv(e,r,n),o.count=t.pointsLength,i.push(o)),c(t.normals)&&(o=Wv(e,t.normals,n),i.push(o)),c(t.colors)?(o=Wv(e,t.colors,n),i.push(o)):(o=Wv(e,Eje,n),i.push(o)),c(t.batchIds)&&(o=Wv(e,t.batchIds,n),i.push(o)),i}function wje(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!c(e.batchIds);return c(o)||e.hasDracoBatchTable?Fg({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new oa({schema:{},propertyTables:[]})}function vje(e,t){let n=e._parsedContent,i=new mje;i.metallicFactor=0,i.roughnessFactor=.9;let o=new hje;o.metallicRoughness=i;let r=n.colors;c(r)&&r.isTranslucent&&(o.alphaMode=Ip.BLEND);let s=!c(n.normals);o.unlit=s;let a=new uje;if(a.attributes=Sje(e,n,t),a.primitiveType=Me.POINTS,a.material=o,c(n.batchIds)){let g=new dje;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let l=new lje;l.index=0,l.primitives=[a];let u=new cje;u.nodes=[l],u.upAxis=Fo.Z,u.forwardAxis=Fo.X;let f=new aje;f.scene=u,f.nodes=[l];let h=[];f.structuralMetadata=wje(n,h),h.length>0&&Dje(e,a,h,t),c(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;c(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Dje(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=bt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Be.STATIC_DRAW});l.vertexArrayDestroyable=!1,e._buffers.push(l),a.buffer=l,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Gg.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 EB=Gg;var Pje=new d,Ije=new d,Oje=new d,Rje=new F,Mje=new F,Lje=new F,Nje=new he,Fje=new le;function qv(e,t,n,i,o,r,s){if(T.typeOf.object("model",e),T.typeOf.object("ray",t),T.typeOf.object("frameState",n),!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,l=e.sceneGraph,u=l._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,g=F.clone(h.computedTransform,Rje),m=F.clone(l.computedModelMatrix,Mje),y=p.instances;c(y)&&y.transformInWorldSpace&&(m=F.multiplyTransformation(e.modelMatrix,l.components.transform,m),g=F.multiplyTransformation(l.axisCorrectionMatrix,h.computedTransform,g));let b=F.multiplyTransformation(m,g,Lje);n.mode!==oe.SCENE3D&&(b=Ot.basisTo2D(n.mapProjection,b,b));let x=[];if(c(y)){let E=y.attributes[0].count,S=y.attributes[0].componentDatatype,v=12,P=h.transformsTypedArray;if(!c(P)){let M=h.instancingTransformsBuffer;c(M)&&n.context.webgl2&&(P=$.createTypedArray(S,E*v),M.getBufferData(P))}if(c(P))for(let M=0;M<E;M++){let R=M*v,L=new F(P[R],P[R+1],P[R+2],P[R+3],P[R+4],P[R+5],P[R+6],P[R+7],P[R+8],P[R+9],P[R+10],P[R+11],0,0,0,1);y.transformInWorldSpace?(F.multiplyTransformation(L,g,L),F.multiplyTransformation(m,L,L)):F.multiplyTransformation(L,b,L),x.push(L)}}x.length===0&&x.push(b);let A=h.runtimePrimitives.length;for(let E=0;E<A;E++){let S=h.runtimePrimitives[E],v=S.primitive;if(c(S.boundingSphere)&&!c(y)){let X=le.transform(S.boundingSphere,b,Fje),te=Qn.raySphere(t,X);if(!c(te))continue}let P=$t.getAttributeBySemantic(v,ht.POSITION),M=P.byteOffset,R=P.byteStride,L=P.count;if(!c(v.indices))continue;let B=v.indices.typedArray;if(!c(B)){let X=v.indices.buffer,te=v.indices.count,K=v.indices.indexDatatype;c(X)&&n.context.webgl2&&(K===Fe.UNSIGNED_BYTE?B=new Uint8Array(te):K===Fe.UNSIGNED_SHORT?B=new Uint16Array(te):K===Fe.UNSIGNED_INT&&(B=new Uint32Array(te)),X.getBufferData(B))}let _=P.typedArray,w=P.componentDatatype,D=P.type,I=P.quantization;c(I)&&(w=P.quantization.componentDatatype,D=P.quantization.type);let N=nn.getNumberOfComponents(D),k=$.getSizeInBytes(w),H=!c(_)&&c(R)&&R!==N*k,V=N,j=0;H&&(V=R/k,j=M/k);let U=L*V;if(!c(_)){let X=P.buffer;c(X)&&n.context.webgl2&&(_=$.createTypedArray(w,U),X.getBufferData(_,H?0:M,0,U)),I&&P.normalized&&(_=Ln.dequantize(_,w,D,L))}if(!c(B)||!c(_))return;r=r??ie.default,i=i??1,o=o??0;let q=B.length;for(let X=0;X<q;X+=3){let te=B[X],K=B[X+1],Z=B[X+2];for(let ee of x){let me=N9(_,te,j,V,I,ee,i,o,r,Pje),xe=N9(_,K,j,V,I,ee,i,o,r,Ije),ue=N9(_,Z,j,V,I,ee,i,o,r,Oje),ye=Qn.rayTriangleParametric(t,me,xe,ue,e.backFaceCulling??!0);c(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=_n.getPoint(t,a,s),n.mode!==oe.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(s,Nje);h.cartographicToCartesian(p,s)}return s}}function N9(e,t,n,i,o,r,s,a,l,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],c(o))if(o.octEncoded){if(u=Ln.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=F.multiplyByPoint(r,u,u),s!==1&&Rr.getPosition(u,l,s,a,u),u}function io(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.loader",e.loader),T.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=e.type??Tr.GLTF,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=c(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=J.clone(J.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 WF(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=G.clone(e.color),this._colorBlendMode=e.colorBlendMode??kc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??G.RED;this._silhouetteColor=G.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??De.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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=e.heightReference??qe.NONE,this._heightDirty=this._heightReference!==qe.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;c(o)&&c(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Mp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;c(s)&&s.owner===void 0?xs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;c(a)&&a.owner===void 0?Zh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=c(e.imageBasedLighting)?e.imageBasedLighting:new lA,this._shouldDestroyImageBasedLighting=!c(e.imageBasedLighting),this._environmentMapManager=void 0;let l=new Og(e.environmentMapOptions);Og.setOwner(l,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Tn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Tr.GLTF&&dt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new At(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??qr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this._classificationType=e.classificationType,this._statistics=new AB,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function F9(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Bje(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 YF({model:e,propertyTable:s});n.push(a)}return n}function kje(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],c(a.instances)&&(s=$t.getFeatureIdsByLabel(a.instances.featureIds,i),c(s)&&c(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 l=a.primitives[r],u=$t.getFeatureIdsByLabel(l.featureIds,n);if(c(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function U9(e,t){if(!c(e)&&!c(t))return!1;if(c(e)!==c(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(io.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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){T.defined("pointCloudShading",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){if(c(e)&&e.far<=e.near)throw new C("far must be greater than near");this._distanceDisplayCondition=Lt.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){U9(e,this._color)&&this.resetDrawCommands(),this._color=G.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(!G.equals(e,this._silhouetteColor)){let t=U9(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=G.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(){if(!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");let e=c(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return lae(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===Tr.GLTF&&dt("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}`),T.typeOf.string("value",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}`),T.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(xs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Zh.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){c(e)!==c(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",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){T.typeOf.object("environmentMapManager",e),e!==this.environmentMapManager&&(Og.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}}});io.prototype.getNode=function(e){if(!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return T.typeOf.string("name",e),this._nodesByName[e]};io.prototype.setArticulationStage=function(e,t){if(T.typeOf.number("value",t),!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)};io.prototype.applyArticulations=function(){if(!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()};io.prototype.getExtension=function(e){if(T.typeOf.string("extensionName",e),!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return this._loader.components.extensions[e]};io.prototype.makeStyleDirty=function(){this._styleDirty=!0};io.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Uje=new F,Vje=new J,zje=new F;io.prototype.update=function(e){let t=!1;try{t=Hje(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")F9(this,n);else{let i=$t.getError("model",this._resource,n);F9(this,i)}}if(Gje(this,e),jje(this,e),Wje(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!c(n)){if(this._loader.isUnloaded())return;let r=$t.getError("model",this._resource,new ae("Failed to load model."));F9(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;c(i)&&i.propertyTableCount>0&&Bje(this,i);let o=new TB({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(qje(this),Yje(this),Xje(this,e),Kje(this),$je(this,e),Zje(this,e),Qje(this,e),Jje(this,e),e9e(this,e),t9e(this,e),n9e(this,e),this._defaultTexture=e.context.defaultTexture,i9e(this,e),o9e(this,e),r9e(this),s9e(this,e),u9e(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)),c9e(this),f9e(this,e),d9e(this),h9e(this,e)}};function Hje(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Gje(e,t){c(e._customShader)&&e._customShader.update(t)}function jje(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=!c(e._imageBasedLighting.sphericalHarmonicCoefficients)||!c(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function Wje(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function qje(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;c(n)&&n.propertyTableCount>0&&(e.featureTableId=kje(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Yje(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Xje(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&&cae(e)}function cae(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=im.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Kje(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 $je(e,t){e._silhouetteDirty&&(uae(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Zje(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Qje(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 Jje(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 e9e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function t9e(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function n9e(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 i9e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function o9e(e,t){if(!F.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==oe.SCENE3D&&e._projectTo2D)throw new C("Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix)}}var jg=new d,B9=new he;function r9e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;c(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!c(t)||e.heightReference===qe.NONE){if(e.heightReference!==qe.NONE)throw new C("Height reference is not supported without a scene.");e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ie.default,i=e.modelMatrix;jg.x=i[12],jg.y=i[13],jg.z=i[14];let o=n.cartesianToCartographic(jg);c(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,aae(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(c(r)){let s=aae(e,n,o);he.clone(o,B9),B9.height=r,s(B9)}e._heightDirty=!1,e._updateModelMatrix=!0}function s9e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;lae(e,n),a9e(e,n,t)}function lae(e,t){e._clampedScale=c(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.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 a9e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,jg),e._sceneMode!==oe.SCENE3D&&Hi.computeActualEllipsoidPosition(n,jg,jg);let s=e._boundingSphere.radius,a=m9e(jg,s,n),l=1/a;Math.min(l*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=c(e.maximumScale)?Math.min(e.maximumScale,i):i}function c9e(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 l9e=new J(1,0,0,0,0,1,0,-1,0);function u9e(e,t){let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=Vje,s=Uje;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=J.transpose(r,r),e._iblReferenceFrameMatrix=J.multiply(l9e,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=zje;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function f9e(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=c(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;c(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function d9e(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(c(e._credit)){let s=At.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=At.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=At.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function h9e(e,t){let n=_9e(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&&(g9e(e,t),e._sceneGraph.pushDrawCommands(t))}var k9=new le;function m9e(e,t,n){return k9.center=e,k9.radius=t,n.camera.getPixelSize(k9,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var SB=new d;function aae(e,t,n){return function(i){e.heightReference===qe.CLIP_TO_GROUND?n.height>=i.height&&(i.height=n.height):NT(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,SB);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=SB.x,o[13]=SB.y,o[14]=SB.z,e._heightDirty=!0}}var p9e=new d;function _9e(e,t){let n=e.distanceDisplayCondition;if(!c(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=F.getTranslation(e.modelMatrix,p9e);Hi.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function g9e(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}io.prototype.isTranslucent=function(){let e=this.color;return c(e)&&e.alpha>0&&e.alpha<1};io.prototype.isInvisible=function(){let e=this.color;return c(e)&&e.alpha===0};function uae(e){return e.context.stencilBuffer}io.prototype.hasSilhouette=function(e){return uae(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!c(this._classificationType)};io.prototype.hasSkipLevelOfDetail=function(e){if(!Tr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};io.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return c(e)&&e.enabled&&e.length!==0};io.prototype.pick=function(e,t,n,i,o){return qv(this,e,t,n,i,o)};io.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return c(e)&&e.enabled&&e.length!==0};io.prototype.isDestroyed=function(){return!1};io.prototype.destroy=function(){let e=this._loader;c(e)&&e.destroy();let t=this._featureTables;if(c(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),c(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;c(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;c(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,de(this)};io.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};io.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};io.fromGltfAsync=async function(e){if(e=e??W.EMPTY_OBJECT,!c(e.url)&&!c(e.gltf))throw new C("options.url is required.");let t=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:c(e.classificationType)},i=e.basePath??"",o=we.createIfNeeded(i);c(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=we.createIfNeeded(t);let r=new em(n),a=c(e.content)?Tr.TILE_GLTF:Tr.GLTF,l=n.gltfResource,u=Yv(r,a,e);u.resource=l,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),$t.getError("model",l,g)}let f=e.gltfCallback;c(f)&&(T.typeOf.func("options.gltfCallback",f),f(r.gltfJson));let h=new io(u),p=h._resource.credits;if(c(p)){let g=p.length;for(let m=0;m<g;m++)h._resourceCredits.push(At.clone(p[m]))}return h};io.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:c(e.classificationType)},n=new OF(t);try{await n.load();let i=Yv(n,Tr.TILE_B3DM,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new EB(t);try{await n.load();let i=Yv(n,Tr.TILE_PNTS,e);return new io(i)}catch(i){throw n.destroy(),i}};io.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 kF(t);try{await n.load();let i=Yv(n,Tr.TILE_I3DM,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new MF(t),i=Yv(n,Tr.TILE_GEOJSON,e);return new io(i)};var y9e=new G;io.prototype.applyColorAndShow=function(e){let t=G.clone(this._color,y9e),n=c(e)&&c(e.color),i=c(e)&&c(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):G.clone(G.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,U9(t,this._color)&&this.resetDrawCommands()};io.prototype.applyStyle=function(e){let t=this.type===Tr.TILE_PNTS,n=c(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=c(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=c(i)&&c(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),cae(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function Yv(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 om=io;function kr(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(kr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return c(t)&&c(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(c(t)&&c(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}}});kr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};kr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};kr.prototype.getExtension=function(e){return this._model.getExtension(e)};kr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;if(!c(n))throw new C("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let i=t.featureTables[n];if(!c(i))throw new C("No feature table found for the selected feature ID set");let o=i.featuresLength;if(!c(e)||e<0||e>=o)throw new C(`featureId is required and must be between 0 and featuresLength - 1 (${o-1}).`);return i.getFeature(e)};kr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return c(i)?n.featureTables[i].hasProperty(e,t):!1};kr.prototype.applyDebugSettings=function(e,t){t=e?t:G.WHITE,this.featuresLength===0?this._model.color=t:c(this.batchTable)&&this.batchTable.setAllColor(t)};kr.prototype.applyStyle=function(e){this._model.style=e};kr.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,c(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),c(o)&&c(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;c(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),c(s)&&c(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:au.REPEAT}),this._ready=!0)};kr.prototype.isDestroyed=function(){return!1};kr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),de(this)};kr.fromGltf=async function(e,t,n,i){let o=new kr(e,t,n),s=Xv(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let l=await om.fromGltfAsync(s);return o._model=l,o};kr.fromB3dm=async function(e,t,n,i,o){let r=new kr(e,t,n),a=Xv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=l;let u=await om.fromB3dm(a);return r._model=u,r};kr.fromI3dm=async function(e,t,n,i,o){let r=new kr(e,t,n),a=Xv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await om.fromI3dm(a);return r._model=l,r};kr.fromPnts=async function(e,t,n,i,o){let r=new kr(e,t,n),a=Xv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await om.fromPnts(a);return r._model=l,r};kr.fromGeoJson=async function(e,t,n,i){let o=new kr(e,t,n),s=Xv(e,t,o,{geoJson:i,resource:n}),a=await om.fromGeoJson(s);return o._model=a,o};kr.prototype.pick=function(e,t,n){if(!c(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ie.WGS84,n)};function Xv(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:De.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 xt(i,o)}var bf=kr;function xf(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(xf.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}}});xf.fromJson=function(e,t,n,i){let o=new xf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};xf.prototype.hasProperty=function(e,t){return!1};xf.prototype.getFeature=function(e){};xf.prototype.applyDebugSettings=function(e,t){};xf.prototype.applyStyle=function(e){};xf.prototype.update=function(e,t){};xf.prototype.pick=function(e,t,n){};xf.prototype.isDestroyed=function(){return!1};xf.prototype.destroy=function(){return de(this)};var wB=xf;var vB=`uniform sampler2D u_atlas; +`;function eEe(){}eEe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=fmt(e,n,t),r=dmt(e,i,t),o=e.model;return l(o.classificationType)?new F4({primitiveRenderResources:e,command:r}):new k4({primitiveRenderResources:e,command:r})};function fmt(e,t,n){t.addVertexLines(U4),t.addFragmentLines(z4);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function dmt(e,t,n){let i=hmt(e),r=new Vn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=e.alphaOptions.pass,a=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=M.multiplyTransformation(x,e.runtimeNode.computedTransform,new M),f=le.transform(e.boundingSphere,u)}let d=Ze(Ge.fromCache(e.renderStateOptions),!0);d.cull.face=xt.getCullFace(u,e.primitiveType),d=Ge.fromCache(d);let p=l(o.classificationType),g=p?!1:Dn.castShadows(o.shadows),m=p?!1:Dn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new at({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:s,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function hmt(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var V4=eEe;function ol(e){e=e??H.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._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},mmt(this)}Object.defineProperties(ol.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 mmt(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;tEe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let x=0;x<s;x++){let T=o[x],E=new qz({articulation:T,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=M.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],E=nEe(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new C4({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],E=e._runtimeNodes[T],S=c[T].skin.index;E._runtimeSkin=m[S],E.updateJointMatrices()}e.applyArticulations()}function tEe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var pmt=new h;function gmt(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,pmt);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=At.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function nEe(e,t,n){let i=[],r=xt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=M.multiplyTransformation(n,r,new M),g=nEe(e,d,p);i.push(g)}let s=new uV({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new E4({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new nV(f,s);f._nodesByName[u]=d}return c}var _mt=new h,ymt=new h,Amt=new h,bmt=new h;ol.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};ol.prototype.buildRenderResources=function(e){let t=this._model,n=new v4(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let s=o.pipelineStages,a=new M4(n,o);n.nodeRenderResources[r]=a;for(let c=0;c<s.length;c++)s[c].process(a,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new L4(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};ol.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,_mt),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,ymt);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let s=e.nodeRenderResources[r],a=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=le.clone(f.boundingSphere,new le);let d=M.multiplyByPoint(a,f.positionMin,Amt),p=M.multiplyByPoint(a,f.positionMax,bmt);h.minimumByComponent(n,d,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,d,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=le.fromCornerPoints(n,i,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};ol.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=V4.buildModelDrawCommand(a,t);s.drawCommand=c}}};ol.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(Ox),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(Hz),n.isClippingEnabled()&&t.push(Kz);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(Zz),n.hasDrapedVectors()&&t.push(tV),n.hasSilhouette(e)&&t.push(P4),l(n.splitDirection)&&n.splitDirection!==$o.NONE&&t.push(O4),Qo.is3DTiles(n.type)&&t.push(kz),i&&t.push(Vz)};ol.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};ol.prototype.updateModelMatrix=function(e,t){tEe(this,e),t.mode!==re.SCENE3D&&gmt(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};ol.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 iEe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);iEe(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function j4(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];iEe(e,c,t,n,i)}}var xmt={backFaceCulling:void 0};ol.prototype.updateBackFaceCulling=function(e){let t=xmt;t.backFaceCulling=e,j4(this,!1,Tmt,t)};function Tmt(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Emt={shadowMode:void 0};ol.prototype.updateShadows=function(e){let t=Emt;t.shadowMode=e,j4(this,!1,Cmt,t)};function Cmt(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var vmt={debugShowBoundingVolume:void 0};ol.prototype.updateShowBoundingVolume=function(e){let t=vmt;t.debugShowBoundingVolume=e,j4(this,!1,Smt,t)};function Smt(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var rEe=[],oEe=[],sEe=[],wmt={frameState:void 0,hasSilhouette:void 0};ol.prototype.pushDrawCommands=function(e){let t=rEe;t.length=0;let n=oEe;n.length=0;let i=sEe;i.length=0;let r=wmt;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,j4(this,!0,Imt,r),Zn(e.commandList,t),Zn(e.commandList,n),Zn(e.commandList,i)};function Imt(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=rEe,s=oEe,a=sEe,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}ol.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};ol.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var H4=ol;function eA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new zt}Object.defineProperties(eA.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}}});eA.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()};eA.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};eA.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};eA.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};eA.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};eA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var G4=eA;var uEe=js(tN(),1);var aEe={},Ux=Uint32Array.BYTES_PER_ELEMENT;aEe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=Ux;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=Ux,t+=Ux;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=Ux;let s=i.getUint32(t,!0);t+=Ux;let a=i.getUint32(t,!0);t+=Ux;let c=i.getUint32(t,!0);t+=Ux;let u=Lo(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Lo(n,t,a),Object.keys(d).length===0&&(d=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new Pp(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=Dmt(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=Rmt(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=Mmt(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=Omt(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=Nmt(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),Pmt(A),A};function Pmt(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let a=t[o].byteOffset;l(a)&&(i.includes(o)||r.push(o))}for(let o of r)yt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function Dmt(e,t){let n=e.json,i,r,o,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)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Mt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function Rmt(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function Omt(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:s}}}function Mmt(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function Nmt(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ct.FEATURE_ID,semantic:ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var pS=aEe;var Lmt=Cn.Components,Fmt=Cn.Scene,Bmt=Cn.Node,kmt=Cn.Primitive,Umt=Cn.Attribute,cEe=Cn.Quantization,zmt=Cn.FeatureIdAttribute,Vmt=Cn.Material,jmt=Cn.MetallicRoughness,$Q=class extends sr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Ct.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=pS.parse(this._arrayBuffer,this._byteOffset),this._state=Ct.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Ct.READY)return!0;if(this._state===Ct.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Hmt(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Hmt(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=G_.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Gmt(e,i,o),tpt(e,t),e._state=Ct.READY,e}).catch(function(o){e.unload(),e._state=Ct.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function Gmt(e,t,n){e._state=Ct.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Y.fromTypedArray(a),type:Vt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:Wmt(u.componentsPerAttribute),componentType:qmt(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Wmt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function qmt(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function k1(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new cEe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new cEe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new Umt;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=cn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=tt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===ct.POSITION&&s&&(o.typedArray=i),o}var lEe,W4;function Ymt(e){if(!l(W4)){lEe=new uEe.default(0),W4=new Array(e);for(let t=0;t<e;++t)W4[t]=lEe.random()}return W4}var Xmt=new h,Kmt=new h,$mt=new h;function Jmt(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Ymt(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Xmt),u=h.fromElements(a,a,a,Kmt),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,$mt),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Zmt={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Qmt(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Jmt(o),r=k1(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=k1(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=k1(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=k1(e,Zmt,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=k1(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function ept(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,s=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?Yy({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new nc({schema:{},propertyTables:[]})}function tpt(e,t){let n=e._parsedContent,i=new jmt;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Vmt;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=q0.BLEND);let s=!l(n.normals);r.unlit=s;let a=new kmt;if(a.attributes=Qmt(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new zmt;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Bmt;c.index=0,c.primitives=[a];let u=new Fmt;u.nodes=[c],u.upAxis=Hi.Z,u.forwardAxis=Hi.X;let f=new Lmt;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=ept(n,d),d.length>0&&npt(e,a,d,t),l(n.rtcCenter)&&(f.transform=M.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=M.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function npt(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=tt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}var q4=$Q;var Y4=new h,fEe=new h,dEe=new h,U1=new h,ipt=new h,rpt=new h,opt=new he,spt=new le;function X4(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}var apt=32,JQ=new Map,ZQ=[];function cpt(e,t,n,i,r,o){let s=e.origin.x,a=e.origin.y,c=e.origin.z,u=e.direction.x,f=e.direction.y,d=e.direction.z,p=P.EPSILON6;for(let g=0;g<i;g+=3){let m=n[g]*3,y=n[g+1]*3,A=n[g+2]*3,b=t[m],x=t[m+1],T=t[m+2],E=t[y]-b,v=t[y+1]-x,S=t[y+2]-T,I=t[A]-b,R=t[A+1]-x,O=t[A+2]-T,L=f*O-d*R,_=d*I-u*O,C=u*R-f*I,w=E*L+v*_+S*C,D=s-b,N=a-x,F=c-T,V;if(r){if(w<p)continue;let B=D*L+N*_+F*C;if(B<0||B>w)continue;let j=N*S-F*v,k=F*E-D*S,G=D*v-N*E,q=u*j+f*k+d*G;if(q<0||B+q>w)continue;V=(I*j+R*k+O*G)/w}else{if(Math.abs(w)<p)continue;let B=1/w,j=(D*L+N*_+F*C)*B;if(j<0||j>1)continue;let k=N*S-F*v,G=F*E-D*S,q=D*v-N*E,Q=(u*k+f*G+d*q)*B;if(Q<0||j+Q>1)continue;V=(I*k+R*G+O*q)*B}V>=0&&V<o&&(o=V)}return o}function z1(e,t,n,i,r,o,s){if(!e._ready||n.mode===re.MORPHING)return;let a=Number.MAX_VALUE;o=o??ee.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(Fa.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=le.transform(u.boundingSphere,p,spt),E=bi.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=JQ.get(f);l(A)||(A={},l(y)&&(A.vertices=Fa.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=Fa.readIndicesAsTypedArray(f.indices)),JQ.set(f,A),ZQ.push(f),ZQ.length>apt&&JQ.delete(ZQ.shift())),l(y)&&(m=Vt.getNumberOfComponents(y.type),g=A.vertices);let b=A.indices;if(!l(b)||!l(g))return;let x=b.length;if(d.length===1&&i===1){let T=d[0].transform;if(!l(A.world)||!M.equals(A.worldTransform,T)){let I=g.length/m,R=new Float64Array(I*3);for(let O=0;O<I;O++)X4(g,O,m,Y4),M.multiplyByPoint(T,Y4,U1),R[O*3]=U1.x,R[O*3+1]=U1.y,R[O*3+2]=U1.z;A.world=R,A.worldTransform=M.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=cpt(t,E,b,x,v,a);S<a&&(a=S);return}for(let T=0;T<x;T+=3){let E=b[T],v=b[T+1],S=b[T+2];X4(g,E,m,Y4),X4(g,v,m,fEe),X4(g,S,m,dEe);for(let I of d){let R=M.multiplyByPoint(I.transform,Y4,U1),O=M.multiplyByPoint(I.transform,fEe,ipt),L=M.multiplyByPoint(I.transform,dEe,rpt);i!==1&&(br.getPosition(R,o,i,r,R),br.getPosition(O,o,i,r,O),br.getPosition(L,o,i,r,L));let _=bi.rayTriangleParametric(t,R,O,L,e.backFaceCulling??!0);l(_)&&_<a&&_>=0&&(a=_)}}}),a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==re.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(s,opt);f.cartographicToCartesian(d,s)}return s}}var QQ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},K4=QQ;var eee=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let s=n[o],a=s.runtimeNode,c=s.runtimePrimitive,u=new dS(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let s=i[o];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];r.push({runtimeNode:s,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),s=i[r];if(o.show!==s.show||o.alpha!==s.alpha||o.brightness!==s.brightness||o.contrast!==s.contrast||o.hue!==s.hue||o.saturation!==s.saturation||o.gamma!==s.gamma||o.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new K4(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},$4=eee;function xr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Qo.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=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._clippingPlanesMatrix=M.clone(M.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 Lz(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??Ul.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new _g(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Ns.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?il.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,mEe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new $4(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Nv,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Hy(e.environmentMapOptions);Hy.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Dn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Uh.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Qo.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new It(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??$o.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new G4,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=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 tee(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function lpt(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new Bz({model:e,propertyTable:s});n.push(a)}return n}function upt(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function ree(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(xr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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=Gt.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){ree(e,this._color)&&this.resetDrawCommands(),this._color=z.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(!z.equals(e,this._silhouetteColor)){let t=ree(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.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}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return gEe(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===Qo.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},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&&(Ns.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(il.setOwner(e,this,"_clippingPolygons"),mEe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(il.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.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&&(Hy.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}}});xr.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ee.default,ie.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};xr.prototype.getNode=function(e){return this._nodesByName[e]};xr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};xr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};xr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};xr.prototype.makeStyleDirty=function(){this._styleDirty=!0};xr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var fpt=new M,dpt=new $,hpt=new M;xr.prototype.update=function(e){let t=!1;try{t=mpt(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")tee(this,i);else{let r=xt.getError("model",this._resource,i);tee(this,r)}}if(ppt(this,e),gpt(this,e),_pt(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=xt.getError("model",this._resource,new oe("Failed to load model."));tee(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&lpt(this,r);let o=new H4({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(ypt(this),Apt(this),bpt(this,e),xpt(this),Tpt(this,e),Ept(this,e),Cpt(this,e),vpt(this,e),Ipt(this,e),Ppt(this,e),Dpt(this,e),Rpt(this,e),this._defaultTexture=e.context.defaultTexture,Opt(this,e),Mpt(this,e),Bpt(this),kpt(this,e),jpt(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)),zpt(this),Hpt(this,e),Gpt(this),qpt(this,e)}};function mpt(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function ppt(e,t){l(e._customShader)&&e._customShader.update(t)}function gpt(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 _pt(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function ypt(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=upt(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Apt(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function bpt(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&hEe(e)}function hEe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Rp.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function xpt(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 Tpt(e,t){e._silhouetteDirty&&(_Ee(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Ept(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Cpt(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 mEe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function vpt(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),r=0;i&&(n.owner===e&&n.update(t),r=n.clippingPolygonsState),r!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=r);let o=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(il.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;o!==s&&e.resetDrawCommands()}var Spt=new ie;function pEe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function wpt(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function Ipt(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===re.SCENE3D){let o=e._content?.tile?.contentBoundingVolume.rectangle??ie.fromBoundingSphere(e.boundingSphere,n.ellipsoid,Spt);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(o,t.context,e._vectorData,We.CLAMP_TO_3D_TILE):n.requestDataForRectangle(o,t.context,We.CLAMP_TO_3D_TILE)}else pEe(e);let r=wpt(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function Ppt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Dpt(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Rpt(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 Opt(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Mpt(e,t){M.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix))}var tA=new h,nee=new he,Npt=new he,Lpt=200,Fpt=30;function Bpt(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)){e._updateModelMatrix=!0;return}l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===We.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ee.default,i=e.modelMatrix;tA.x=i[12],tA.y=i[13],tA.z=i[14];let r=n.cartesianToCartographic(tA,Npt);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M));let o=Zpt(e,n,r);e._removeUpdateHeightCallback=t.updateHeight(r,p=>{e._lastSurfaceHeight=p.height,o(p)},e.heightReference);let s=t.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Fpt,u=a&&c&&l(e._lastSurfaceHeight)&&r.height>e._lastSurfaceHeight+Lpt,f=a&&c&&e._lastSurfaceQueryMissed,d;u||f?d=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,d=t.getHeight(r,e.heightReference),e._lastSurfaceQueryMissed=!l(d),l(d)?e._lastSurfaceHeight=d:d=e._lastSurfaceHeight),l(d)?(he.clone(r,nee),nee.height=d,o(nee)):M.clone(i,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function kpt(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;gEe(e,n),Upt(e,n,t)}function gEe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.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 Upt(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);M.getTranslation(t,tA),e._sceneMode!==re.SCENE3D&&gr.computeActualEllipsoidPosition(n,tA,tA);let s=e._boundingSphere.radius,a=Ypt(tA,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function zpt(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var Vpt=new $(1,0,0,0,0,1,0,-1,0);function jpt(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=dpt,s=fpt;if(s=M.multiply(r.uniformState.view3D,i,s),o=M.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(Vpt,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=M.multiply(i,e._clippingPlanes.modelMatrix,hpt);e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function Hpt(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),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)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Gpt(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=It.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=It.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++){let a=It.clone(r[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Wpt(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function qpt(e,t){let n=e0t(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!Wpt(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(t0t(e,t),e._sceneGraph.pushDrawCommands(t))}var iee=new le;function Ypt(e,t,n){return iee.center=e,iee.radius=t,n.camera.getPixelSize(iee,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var J4=new h,Xpt=new h,Z4=new h,Kpt=new h,$pt=new M;function Jpt(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let r=i._positionMin,o=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,Kpt),a=M.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,$pt),c=e._computedScale,u=e.modelMatrix,f=0;for(let d=0;d<8;d++){let p=h.fromElements(d&1?o.x:r.x,d&2?o.y:r.y,d&4?o.z:r.z,Xpt);h.multiplyByScalar(p,c,p),M.multiplyByPoint(a,p,Z4),M.multiplyByPointAsVector(u,Z4,Z4);let g=h.dot(Z4,s);g<f&&(f=g)}return-f}function Zpt(e,t,n){return function(i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Jpt(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else Sy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,J4);let r=e._clampedModelMatrix;M.clone(e.modelMatrix,r),r[12]=J4.x,r[13]=J4.y,r[14]=J4.z,e._heightDirty=!0}}var Qpt=new h;function e0t(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=M.getTranslation(e.modelMatrix,Qpt);gr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function t0t(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}xr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};xr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function _Ee(e){return e.context.stencilBuffer}xr.prototype.hasSilhouette=function(e){return _Ee(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};xr.prototype.hasSkipLevelOfDetail=function(e){if(!Qo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};xr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};xr.prototype.pick=function(e,t,n,i,r){return z1(this,e,t,n,i,r)};xr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};xr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};xr.prototype.isDestroyed=function(){return!1};xr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let o=0;o<r;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),pEe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&il.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,ue(this)};xr.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};xr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};xr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=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=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new Cd(n),a=l(e.content)?Qo.TILE_GLTF:Qo.GLTF,c=n.gltfResource,u=V1(o,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new xr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(It.clone(p[m]))}return d};xr.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 Cz(t);try{await n.load();let i=V1(n,Qo.TILE_B3DM,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new q4(t);try{await n.load();let i=V1(n,Qo.TILE_PNTS,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.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 Rz(t);try{await n.load();let i=V1(n,Qo.TILE_I3DM,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new Sz(t),i=V1(n,Qo.TILE_GEOJSON,e);return new xr(i)};var n0t=new z;xr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,n0t),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,ree(t,this._color)&&this.resetDrawCommands()};xr.prototype.applyStyle=function(e){let t=this.type===Qo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),hEe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function V1(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,edgeDisplayMode:n.edgeDisplayMode,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 Dd=xr;var oee=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let s=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=s),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&r.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&r._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),r.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:bf.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=j1(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await Dd.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=j1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Dd.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=j1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Dd.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=j1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Dd.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=j1(t,n,o,{geoJson:r,resource:i}),c=await Dd.fromGeoJson(a);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,ee.WGS84,i)}};function j1(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,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 Mt(i,r)}var Rd=oee;var see=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},Q4=see;var e8=`uniform sampler2D u_atlas; +uniform float u_coarseDepthTestDistance; +uniform float u_threePointDepthTestDistance; #ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_textureCoordinates; in vec4 v_pickColor; in vec4 v_color; -in float v_splitDirection; +flat in vec2 v_splitDirectionAndEllipsoidDepthEC; #ifdef SDF in vec4 v_outlineColor; in float v_outlineWidth; #endif -#ifdef FRAGMENT_DEPTH_CHECK -in vec4 v_textureCoordinateBounds; -in vec4 v_originTextureCoordinateAndTranslate; in vec4 v_compressed; -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)); -vec2 translation = v_originTextureCoordinateAndTranslate.zw; -if (applyTranslate) +float getGlobeDepthAtCoords(vec2 st) { -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) { @@ -5301,7 +6952,6 @@ return 0.0; vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); return eyeCoordinate.z / eyeCoordinate.w; } -#endif #ifdef SDF float getDistance(vec2 position) { @@ -5325,10 +6975,67 @@ return vec4(v_color.rgb, v_color.a * alpha); } } #endif +bool getDepthTestEnabled() { +float temp = v_compressed.y; +temp = temp * SHIFT_RIGHT1; +float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; +return temp2 != 0.0; +} +float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) { +float depthDifferential = eyeDepth - distanceToEllipsoid; +float depthRatio = abs(depthDifferential / distanceToEllipsoid); +if (depthRatio < epsilon) { +return 0.0; +} +return depthDifferential; +} +void doDepthTest(float eyeDepth, float globeDepth) { +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (eyeDepth > -u_threePointDepthTestDistance) { +if (eyeDepth == 0.0) { +discard; +} +return; +} +#endif +bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; +if (useGlobeDepth && globeDepth == 0.0) { +return; +} +if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { +discard; +} +} +#ifdef LOG_DEPTH +void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) { +float depthArg = v_depthFromNearPlusOne; +if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) { +float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0; +float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7); +float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge); +depthArg = min(depthArg, globeOnTop); +} +czm_writeLogDepth(depthArg); +} +#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; +if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { +discard; +} +if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) { +discard; +} +if (getDepthTestEnabled()) { +vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw; +float eyeDepth = v_compressed.x; +float globeDepth = getGlobeDepthAtCoords(fragSt); +float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y; +doDepthTest(eyeDepth, globeDepth); +#ifdef LOG_DEPTH +writeDepth(eyeDepth, globeDepth, distanceToEllipsoid); +#endif +} vec4 color = texture(u_atlas, v_textureCoordinates); #ifdef SDF float outlineWidth = v_outlineWidth; @@ -5374,48 +7081,9 @@ discard; 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); -if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) -{ -float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) -{ -float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); -if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) -{ -discard; -} -} -} -} -#endif } -`;var DB=`#ifdef INSTANCED +`;var t8=`uniform float u_threePointDepthTestDistance; in vec2 direction; -#endif in vec4 positionHighAndScale; in vec4 positionLowAndRotation; in vec4 compressedAttribute0; @@ -5427,22 +7095,17 @@ in vec4 pixelOffsetScaleByDistance; in vec4 compressedAttribute3; in vec2 sdf; in float splitDirection; -#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) +#ifdef VS_THREE_POINT_DEPTH_CHECK in vec4 textureCoordinateBoundsOrLabelTranslate; #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; -out mat2 v_rotationMatrix; -#endif out vec4 v_pickColor; out vec4 v_color; -out float v_splitDirection; +flat out vec2 v_splitDirectionAndEllipsoidDepthEC; #ifdef SDF out vec4 v_outlineColor; out float v_outlineWidth; @@ -5493,7 +7156,7 @@ positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMete positionEC.xy += (translate + pixelOffset) * mpp; return positionEC; } -#ifdef VERTEX_DEPTH_CHECK +#ifdef VS_THREE_POINT_DEPTH_CHECK float getGlobeDepth(vec4 positionEC) { vec4 posWC = czm_eyeToWindowCoordinates(positionEC); @@ -5526,44 +7189,25 @@ 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.x *= SHIFT_RIGHT2; translate.y += (temp - floor(temp)) * SHIFT_LEFT8; translate.y -= UPPER_BOUND; +translate.y *= SHIFT_RIGHT2; 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) -{ -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; @@ -5572,7 +7216,7 @@ 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) +#ifdef VS_THREE_POINT_DEPTH_CHECK temp = compressedAttribute3.w; temp = temp * SHIFT_RIGHT12; vec2 dimensions; @@ -5587,32 +7231,17 @@ bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; 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); +vec4 color = czm_decodeRGB8(compressedAttribute2.x); +vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y); 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; +pickColor.a /= 255.0; color.a = floor(temp); -color /= 255.0; +color.a /= 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) @@ -5657,22 +7286,45 @@ positionEC.xyz = vec3(0.0); #endif mat2 rotationMatrix; float mpp; +float enableDepthCheck = 1.0; #ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = compressedAttribute3.z; +float disableDepthTestDistanceSq = compressedAttribute3.z; +if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; +} +if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) +{ +enableDepthCheck = 0.0; +} #endif -#ifdef VERTEX_DEPTH_CHECK -if (lengthSq < disableDepthTestDistance) { +v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity; +vec3 ellipsoidCenter = czm_view[3].xyz; +vec3 rayDirection = normalize(positionEC.xyz); +czm_ray ray = czm_ray(vec3(0.0), rayDirection); +vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii; +czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); +if (!czm_isEmpty(intersection)) +{ +v_splitDirectionAndEllipsoidDepthEC.y = intersection.start; +} +v_compressed.y = enableDepthCheck; +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) { 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); +vec2 depthOrigin; +depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); +depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0); +depthOrigin.y = origin.y; +vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), 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); +vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), depthOrigin, vec2(0.0), 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); +vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth3 = getGlobeDepth(pEC3); if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) { @@ -5682,6 +7334,7 @@ positionEC.xyz = vec3(0.0); } } #endif +v_compressed.x = positionEC.z; positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); gl_Position = czm_projection * positionEC; v_textureCoordinates = textureCoordinates; @@ -5689,15 +7342,11 @@ v_textureCoordinates = textureCoordinates; czm_vertexLogDepth(); #endif #ifdef DISABLE_DEPTH_DISTANCE -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) +if (disableDepthTestDistanceSq != 0.0) { 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))) +if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) { gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH @@ -5706,50 +7355,16 @@ v_depthFromNearPlusOne = 1.0; } } #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; +vec4 outlineColor = czm_decodeRGB8(sdf.x); 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; +outlineColor.a /= 255.0; v_outlineWidth = outlineWidth / 255.0; v_outlineColor = outlineColor; v_outlineColor.a *= translucency; @@ -5757,21 +7372,21 @@ v_outlineColor.a *= translucency; v_pickColor = pickColor; v_color = color; v_color.a *= translucency; -v_splitDirection = splitDirection; +v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; } -`;var b9e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ss=b9e;function zp(e){T.defined("billboardCollection",e),this._billboardCollection=e,this._id=void 0,this._loadState=ss.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(zp.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ss.LOADED}},hasImage:{get:function(){return this._loadState!==ss.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});zp.prototype.unload=async function(){this._loadState!==ss.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ss.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};zp.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(c(o)&&t.loadState===ss.LOADING||t.loadState===ss.LOADED){zp.clone(o,this);return}c(o)||(o=new zp(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=ss.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(l){if(o._loadState=ss.ERROR,o._loadError=l,this._id!==e)return;this._loadState=ss.ERROR,this._loadError=l;return}if(!c(r)||r===-1){if(o._loadState=ss.FAILED,o._index=-1,this._id!==e)return;this._loadState=ss.FAILED,this._index=-1;return}o._index=r,o._loadState=ss.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=ss.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};zp.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=ss.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=ss.ERROR,this._loadError=o;return}if(!c(n)||n===-1){this._loadState=ss.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=ss.LOADED,this.dirty=!0};zp.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};zp.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 Wg=zp;function di(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Lt.clone(r)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=z.clone(e.pixelOffset??z.ZERO),this._translate=new z(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??qe.NONE,this._verticalOrigin=e.verticalOrigin??Fn.CENTER,this._horizontalOrigin=e.horizontalOrigin??xi.CENTER,this._scale=e.scale??1,this._color=G.clone(e.color??G.WHITE),this._rotation=e.rotation??0,this._alignedAxis=d.clone(e.alignedAxis??d.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Wg(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;c(s)&&(c(a)||(typeof s=="string"?a=s:c(s.src)?a=s.src:a=jn()),this._imageTexture.loadImage(a,s)),c(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=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??qr.NONE}var fae=di.SHOW_INDEX=0,IB=di.POSITION_INDEX=1,_ae=di.PIXEL_OFFSET_INDEX=2,x9e=di.EYE_OFFSET_INDEX=3,T9e=di.HORIZONTAL_ORIGIN_INDEX=4,A9e=di.VERTICAL_ORIGIN_INDEX=5,C9e=di.SCALE_INDEX=6,dae=di.IMAGE_INDEX_INDEX=7,hae=di.COLOR_INDEX=8,E9e=di.ROTATION_INDEX=9,S9e=di.ALIGNED_AXIS_INDEX=10,w9e=di.SCALE_BY_DISTANCE_INDEX=11,v9e=di.TRANSLUCENCY_BY_DISTANCE_INDEX=12,D9e=di.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,P9e=di.DISTANCE_DISPLAY_CONDITION=14,I9e=di.DISABLE_DEPTH_DISTANCE=15;di.TEXTURE_COORDINATE_BOUNDS=16;var mae=di.SDF_INDEX=17,O9e=di.SPLIT_DIRECTION_INDEX=18;di.NUMBER_OF_PROPERTIES=19;function Xo(e,t){let n=e._billboardCollection;c(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(di.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,Xo(this,fae))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),Xo(this,IB))}},heightReference:{get:function(){return this._heightReference},set:function(e){T.typeOf.number("value",e);let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Xo(this,IB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){T.typeOf.object("value",e);let t=this._pixelOffset;z.equals(t,e)||(z.clone(e,t),Xo(this,_ae))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Xo(this,w9e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Xo(this,v9e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),Xo(this,D9e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){T.typeOf.object("value",e);let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),Xo(this,x9e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){T.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Xo(this,T9e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){T.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,Xo(this,A9e))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.number("value",e),this._scale!==e&&(this._scale=e,Xo(this,C9e))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),Xo(this,hae))}},rotation:{get:function(){return this._rotation},set:function(e){T.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,Xo(this,E9e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){T.typeOf.object("value",e);let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),Xo(this,S9e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){c(e)&&T.typeOf.number("width",e),this._width!==e&&(this._width=e,Xo(this,dae))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){c(e)&&T.typeOf.number("height",e),this._height!==e&&(this._height=e,Xo(this,dae))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,Xo(this,hae))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Lt.equals(e,this._distanceDisplayCondition)){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),Xo(this,P9e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(c(e)&&(T.typeOf.number("value",e),e<0))throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Xo(this,I9e))}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,c(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!c(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof we?t=e._url:c(e.src)?t=e.src:t=jn(),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=d.clone(e,this._actualClampedPosition),Xo(this,IB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Xo(this,fae))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Xo(this,mae))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Xo(this,mae))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Xo(this,O9e))}}});di.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};di.prototype._updateClamping=function(){di._updateClamping(this._billboardCollection,this)};var Kv=new he;di._updateClamping=function(e,t){if(!c(e)||!c(e._scene)){if(t._heightReference!==qe.NONE)throw new C("Height reference is not supported without a scene.");return}let n=e._scene,i=n.ellipsoid??ie.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===qe.NONE||r)&&c(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qe.NONE||!c(t._position))return;c(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!c(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);if(NT(t._heightReference))t._mode===oe.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height;else if(t._heightReference===qe.CLIP_TO_GROUND)if(t._mode===oe.SCENE3D){let h=i.cartesianToCartographic(u,Kv);s.height>=h.height&&(h.height=s.height),i.cartographicToCartesian(h,u)}else s.height>=u.x&&(u.x=s.height);t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,Kv);let l=n.getHeight(s,t._heightReference);c(l)&&(Kv.height=l),a(Kv)};di.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};di.prototype.setImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t),this._imageTexture.loadImage(e,t)};di.prototype.setImageTexture=function(e){T.defined("billboardTexture",e),Wg.clone(e,this._imageTexture)};di.prototype.setImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t),this._imageTexture.addImageSubRegion(e,t)};di.prototype._setTranslate=function(e){if(!c(e))throw new C("value is required.");let t=this._translate;z.equals(t,e)||(z.clone(e,t),Xo(this,_ae))};di.prototype._getActualPosition=function(){return c(this._clampedPosition)?this._clampedPosition:this._actualPosition};di.prototype._setActualPosition=function(e){c(this._clampedPosition)||d.clone(e,this._actualPosition),Xo(this,IB)};var pae=new se;di._computeActualPosition=function(e,t,n,i){return c(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(F.multiplyByPoint(i,t,pae),Hi.computeActualEllipsoidPosition(n,pae))};var gae=new d;di._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,gae),a=Hi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(c(a))return z.add(a,i,a),a};var PB=new z(0,0);di.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;if(c(t)||(t=new z),!c(n))throw new C("Billboard must be in a collection. Was it removed?");if(!c(e))throw new C("scene is required.");z.clone(this._pixelOffset,PB),z.add(PB,this._translate,PB);let i=n.modelMatrix,o=this._position;if(c(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,l=s.unproject(o,Kv);o=a.cartographicToCartesian(l,gae),i=F.IDENTITY}return di._computeScreenSpacePosition(i,o,this._eyeOffset,PB,e,t)};di.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===xi.RIGHT?s-=i:e.horizontalOrigin===xi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?a-=o:e.verticalOrigin===Fn.CENTER&&(a-=o*.5),c(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};di.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.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&&G.equals(this._color,e._color)&&z.equals(this._pixelOffset,e._pixelOffset)&&z.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};di.prototype._destroy=function(){c(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),c(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var ao=di;var R9e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Po=Object.freeze(R9e);var M9e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},sa=Object.freeze(M9e);var L9e=ao.SHOW_INDEX,$v=ao.POSITION_INDEX,yae=ao.PIXEL_OFFSET_INDEX,bae=ao.EYE_OFFSET_INDEX,N9e=ao.HORIZONTAL_ORIGIN_INDEX,F9e=ao.VERTICAL_ORIGIN_INDEX,B9e=ao.SCALE_INDEX,Db=ao.IMAGE_INDEX_INDEX,xae=ao.COLOR_INDEX,k9e=ao.ROTATION_INDEX,U9e=ao.ALIGNED_AXIS_INDEX,Tae=ao.SCALE_BY_DISTANCE_INDEX,Aae=ao.TRANSLUCENCY_BY_DISTANCE_INDEX,Cae=ao.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Eae=ao.DISTANCE_DISPLAY_CONDITION,V9e=ao.DISABLE_DEPTH_DISTANCE,z9e=ao.TEXTURE_COORDINATE_BOUNDS,Sae=ao.SDF_INDEX,wae=ao.SPLIT_DIRECTION_INDEX,q9=ao.NUMBER_OF_PROPERTIES,oo,H9e={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},G9e={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 Af(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;c(t)||(t=new LT),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(q9),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=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Po.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW],this._highlightColor=G.clone(G.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;c(n)&&c(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)c(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Af.prototype,{length:{get:function(){return Y9(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){T.defined("textureAtlas",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 vae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Af.prototype.add=function(e){let t=new ao(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Af.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Af.prototype.removeAll=function(){vae(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Y9(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];c(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Af.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Af.prototype.contains=function(e){return c(e)&&e._billboardCollection===this};Af.prototype.get=function(e){return T.typeOf.number("index",e),Y9(this),this._billboards[e]};var V9;function j9e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(c(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=bt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function W9e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return c(t)||(t=bt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function q9e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return c(t)||(t=bt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Af.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<q9;++i){let o=n[i]===0?Be.STATIC_DRAW:Be.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Y9e(e,t,n,i,o,r){let s=[{index:oo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$v]},{index:oo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$v]},{index:oo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[yae]},{index:oo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Aae]},{index:oo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[xae]},{index:oo.eyeOffset,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[bae]},{index:oo.scaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Tae]},{index:oo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Cae]},{index:oo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Eae]},{index:oo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[z9e]},{index:oo.splitDirection,componentsPerAttribute:1,componentDatatype:$.FLOAT,usage:n[wae]}];i&&s.push({index:oo.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:q9e(e)}),c(o)&&s.push({index:oo.a_batchId,componentsPerAttribute:1,componentDatatype:$.FLOAT,bufferUsage:Be.STATIC_DRAW}),r&&s.push({index:oo.sdf,componentsPerAttribute:2,componentDatatype:$.FLOAT,usage:n[Sae]});let a=i?t:4*t;return new X_(e,s,a,i)}var z9=new Hn;function Dae(e,t,n,i){let o,r=n[oo.positionHighAndScale],s=n[oo.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(a,z9);let l=i.scale,u=i.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let f=z9.high,h=z9.low;e._instanced?(o=i._index,r(o,f.x,f.y,f.z,l),s(o,h.x,h.y,h.z,u)):(o=i._index*4,r(o+0,f.x,f.y,f.z,l),r(o+1,f.x,f.y,f.z,l),r(o+2,f.x,f.y,f.z,l),r(o+3,f.x,f.y,f.z,l),s(o+0,h.x,h.y,h.z,u),s(o+1,h.x,h.y,h.z,u),s(o+2,h.x,h.y,h.z,u),s(o+3,h.x,h.y,h.z,u))}var wl=new z,Tf=32768,$A=65536,H9=4096,rm=256,X9e=128,K9e=32,$9e=8,Pae=4,Z9e=1/256,Iae=0,Oae=2,Rae=3,Mae=1,X9=new Ke;function Lae(e,t,n,i){let o,r=n[oo.compressedAttribute0],s=i.pixelOffset,a=s.x,l=s.y,u=i._translate,f=u.x,h=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+f),Math.abs(-l+h));let p=i.horizontalOrigin,g=i._verticalOrigin,m=i.show&&i.clusterShow;i.color.alpha===0&&(m=!1),g===Fn.BASELINE&&(g=Fn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===xi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===Fn.CENTER;let y=0,b=0,x=0,A=0;if(i.ready){let N=i.computeTextureCoordinates(X9);y=N.x,b=N.y,x=N.width,A=N.height}let E=y+x,S=b+A,v=Math.floor(O.clamp(a,-Tf,Tf)+Tf)*X9e;v+=(p+1)*K9e,v+=(g+1)*$9e,v+=(m?1:0)*Pae;let P=Math.floor(O.clamp(l,-Tf,Tf)+Tf)*rm,M=Math.floor(O.clamp(f,-Tf,Tf)+Tf)*rm,R=(O.clamp(h,-Tf,Tf)+Tf)*Z9e,L=Math.floor(R),B=Math.floor((R-L)*rm);P+=L,M+=B,wl.x=y,wl.y=b;let _=Ln.compressTextureCoordinates(wl);wl.x=E;let w=Ln.compressTextureCoordinates(wl);wl.y=S;let D=Ln.compressTextureCoordinates(wl);wl.x=y;let I=Ln.compressTextureCoordinates(wl);e._instanced?(o=i._index,r(o,v,P,M,_)):(o=i._index*4,r(o+0,v+Iae,P,M,_),r(o+1,v+Oae,P,M,w),r(o+2,v+Rae,P,M,D),r(o+3,v+Mae,P,M,I))}function Nae(e,t,n,i){let o,r=n[oo.compressedAttribute1],s=i.alignedAxis;d.equals(s,d.ZERO)||(e._shaderAlignedAxis=!0);let a=0,l=1,u=1,f=1,h=i.translucencyByDistance;c(h)&&(a=h.near,l=h.nearValue,u=h.far,f=h.farValue,(l!==1||f!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let g=O.clamp(p,0,$A),m=0;Math.abs(d.magnitudeSquared(s)-1)<O.EPSILON6&&(m=Ln.octEncodeFloat(s)),l=O.clamp(l,0,1),l=l===1?255:l*255|0,g=g*rm+l,f=O.clamp(f,0,1),f=f===1?255:f*255|0,m=m*rm+f,e._instanced?(o=i._index,r(o,g,m,a,u)):(o=i._index*4,r(o+0,g,m,a,u),r(o+1,g,m,a,u),r(o+2,g,m,a,u),r(o+3,g,m,a,u))}function j9(e,t,n,i){let o,r=n[oo.compressedAttribute2],s=i.color,a=c(e._batchTable)?G.WHITE:i.getPickId(t.context).color,l=i.sizeInMeters?1:0,u=Math.abs(d.magnitudeSquared(i.alignedAxis)-1)<O.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let f=i.height??0;e._maxSize=Math.max(e._maxSize,f);let h=i._labelHorizontalOrigin??-2;h+=2;let p=f*Pae+h,g=G.floatToByte(s.red),m=G.floatToByte(s.green),y=G.floatToByte(s.blue),b=g*$A+m*rm+y;g=G.floatToByte(a.red),m=G.floatToByte(a.green),y=G.floatToByte(a.blue);let x=g*$A+m*rm+y,A=G.floatToByte(s.alpha)*$A+G.floatToByte(a.alpha)*rm;A+=l*2+u,e._instanced?(o=i._index,r(o,b,x,A,p)):(o=i._index*4,r(o+0,b,x,A,p),r(o+1,b,x,A,p),r(o+2,b,x,A,p),r(o+3,b,x,A,p))}function W9(e,t,n,i){let o,r=n[oo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==qe.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(wl.x=0,wl.y=0,i.ready){let u=i.computeTextureCoordinates(X9);wl.x=u.width,wl.y=u.height}let l=Ln.compressTextureCoordinates(wl);o=i._index,r(o,s.x,s.y,a,l)}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 Fae(e,t,n,i){let o,r=n[oo.scaleByDistance],s=0,a=1,l=1,u=1,f=i.scaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,u)):(o=i._index*4,r(o+0,s,a,l,u),r(o+1,s,a,l,u),r(o+2,s,a,l,u),r(o+3,s,a,l,u))}function Bae(e,t,n,i){let o,r=n[oo.pixelOffsetScaleByDistance],s=0,a=1,l=1,u=1,f=i.pixelOffsetScaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,u)):(o=i._index*4,r(o+0,s,a,l,u),r(o+1,s,a,l,u),r(o+2,s,a,l,u),r(o+3,s,a,l,u))}function kae(e,t,n,i){let o,r=n[oo.compressedAttribute3],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance,f=of(i.heightReference)&&t.context.depthTexture;c(u)||(u=f?5e3:0),u*=u,(f||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let h,p;c(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(O.clamp(p,0,H9)),m=Math.floor(O.clamp(h,0,H9)),y=g*H9+m;e._instanced?(o=i._index,r(o,s,a,u,y)):(o=i._index*4,r(o+0,s,a,u,y),r(o+1,s,a,u,y),r(o+2,s,a,u,y),r(o+3,s,a,u,y))}function Uae(e,t,n,i){if(of(i.heightReference)){let p=e._scene,g=t.context,m=t.globeTranslucencyState.translucent,y=c(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!m&&y}let o,r=n[oo.textureCoordinateBoundsOrLabelTranslate];if(ut.maximumVertexTextureImageUnits>0){let p=0,g=0;c(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,l=0,u=0;if(i.ready){let p=i.computeTextureCoordinates(X9);s=p.x,a=p.y,l=p.width,u=p.height}let f=s+l,h=a+u;e._instanced?(o=i._index,r(o,s,a,f,h)):(o=i._index*4,r(o+0,s,a,f,h),r(o+1,s,a,f,h),r(o+2,s,a,f,h),r(o+3,s,a,f,h))}function Q9e(e,t,n,i){if(!c(e._batchTable))return;let o=n[oo.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 Vae(e,t,n,i){if(!e._sdf)return;let o,r=n[oo.sdf],s=i.outlineColor,a=i.outlineWidth,l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue),h=l*$A+u*rm+f,p=a/sa.RADIUS,g=G.floatToByte(s.alpha)*$A+G.floatToByte(p)*rm;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+Iae,g),r(o+1,h+Oae,g),r(o+2,h+Rae,g),r(o+3,h+Mae,g))}function zae(e,t,n,i){let o=n[oo.splitDirection],r=0,s=i.splitDirection;c(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 J9e(e,t,n,i){Dae(e,t,n,i),Lae(e,t,n,i),Nae(e,t,n,i),j9(e,t,n,i),W9(e,t,n,i),Fae(e,t,n,i),Bae(e,t,n,i),kae(e,t,n,i),Uae(e,t,n,i),Q9e(e,t,n,i),Vae(e,t,n,i),zae(e,t,n,i)}function G9(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 l=0;l<n;++l){let u=t[l],f=u.position,h=ao._computeActualPosition(u,f,i,o);c(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function eWe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&G9(e,i,i.length,t,r,!0)):n===oe.MORPHING?G9(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&G9(e,o,e._billboardsToUpdateIndex,t,r,!1)}function tWe(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 nWe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +`;var i0t=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),$s=i0t;function Hh(e){this._billboardCollection=e,this._id=void 0,this._loadState=$s.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Hh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===$s.LOADED}},hasImage:{get:function(){return this._loadState!==$s.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Hh.prototype.unload=async function(){this._loadState!==$s.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=$s.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Hh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,s=o.get(e);if(l(s)&&t.loadState===$s.LOADING||t.loadState===$s.LOADED){Hh.clone(s,this);return}l(s)||(s=new Hh(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=$s.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?a=f:a=await f}catch(f){if(s._loadState=$s.ERROR,s._loadError=f,this._id!==e)return;this._loadState=$s.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=$s.FAILED,s._index=-1,this._id!==e)return;this._loadState=$s.FAILED,this._index=-1;return}s._index=a,s._loadState=$s.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=$s.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Hh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Hh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=$s.LOADING,i=await n}catch(r){this._loadState=$s.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=$s.LOADED,this.setImageSubRegion(i,t))};Hh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=$s.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Hh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Hh.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 nA=Hh;function Mi(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Gt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??qn.CENTER,this._horizontalOrigin=e.horizontalOrigin??qi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new nA(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??$o.NONE,this._positionFromParent=!1}var yEe=Mi.SHOW_INDEX=0,i8=Mi.POSITION_INDEX=1,CEe=Mi.PIXEL_OFFSET_INDEX=2,r0t=Mi.EYE_OFFSET_INDEX=3,o0t=Mi.HORIZONTAL_ORIGIN_INDEX=4,s0t=Mi.VERTICAL_ORIGIN_INDEX=5,a0t=Mi.SCALE_INDEX=6,AEe=Mi.IMAGE_INDEX_INDEX=7,bEe=Mi.COLOR_INDEX=8,c0t=Mi.ROTATION_INDEX=9,l0t=Mi.ALIGNED_AXIS_INDEX=10,u0t=Mi.SCALE_BY_DISTANCE_INDEX=11,f0t=Mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,d0t=Mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,h0t=Mi.DISTANCE_DISPLAY_CONDITION=14,m0t=Mi.DISABLE_DEPTH_DISTANCE=15;Mi.TEXTURE_COORDINATE_BOUNDS=16;var xEe=Mi.SDF_INDEX=17,p0t=Mi.SPLIT_DIRECTION_INDEX=18;Mi.NUMBER_OF_PROPERTIES=19;function Io(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Mi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Io(this,yEe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Io(this,i8))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Io(this,i8))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Io(this,CEe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Io(this,u0t))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Io(this,f0t))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),Io(this,d0t))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Io(this,r0t))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Io(this,o0t))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Io(this,s0t))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Io(this,a0t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Io(this,bEe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Io(this,c0t))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Io(this,l0t))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Io(this,AEe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Io(this,AEe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Io(this,bEe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Io(this,h0t))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Io(this,m0t))}},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}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},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=h.clone(e,this._actualClampedPosition),Io(this,i8)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Io(this,yEe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Io(this,xEe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Io(this,xEe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Io(this,p0t))}}});Mi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Mi.prototype._updateClamping=function(){Mi._updateClamping(this._billboardCollection,this)};var r8=new he,g0t=200,_0t=30;Mi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ee.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===We.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===We.NONE||t._positionFromParent||!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(m){let y=i.cartographicToCartesian(m,t._clampedPosition);Sy(t._heightReference)?t._mode===re.SCENE3D?(m.height+=s.height,i.cartographicToCartesian(m,y)):y.x+=s.height:t._heightReference===We.CLIP_TO_GROUND&&s.height>m.height&&(t._mode===re.SCENE3D?(m.height=s.height,i.cartographicToCartesian(m,y)):y.x=s.height),t._clampedPosition=y}t._removeCallbackFunc=n.updateHeight(s,m=>{t._lastSurfaceHeight=m.height,t._clampedToSurface=!0,a(m)},t._heightReference),he.clone(s,r8);let c=n.frameState.frameNumber,u=t._heightReference===We.CLIP_TO_GROUND,f=c-t._lastSurfaceQueryFrame<_0t,d=u&&f&&l(t._lastSurfaceHeight)&&s.height>t._lastSurfaceHeight+g0t,p=u&&f&&t._lastSurfaceQueryMissed,g;d||p?g=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=c,g=n.getHeight(s,t._heightReference),t._lastSurfaceQueryMissed=!l(g),l(g)?t._lastSurfaceHeight=g:g=t._lastSurfaceHeight),t._clampedToSurface=l(g),l(g)&&(r8.height=g),a(r8)};Mi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Mi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Mi.prototype.setImageTexture=function(e){nA.clone(e,this._imageTexture)};var TEe=512;Mi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&y0t(n)&&(this._imageWidth=Math.min(this._width,TEe),this._imageHeight=Math.min(this._height,TEe))};function y0t(e){return l(e)?Um(e)?e.startsWith("data:image/svg+xml"):C_(e)==="svg":!1}Mi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Mi.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),Io(this,CEe))};Mi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Mi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Io(this,i8)};var EEe=new se;Mi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(M.multiplyByPoint(i,t,EEe),gr.computeActualEllipsoidPosition(n,EEe))};var vEe=new h;Mi._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=M.multiplyByPoint(e,t,vEe),a=gr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var n8=new U(0,0);Mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,n8),U.add(n8,this._translate,n8);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,r8);r=a.cartographicToCartesian(c,vEe),i=M.IDENTITY}return Mi._computeScreenSpacePosition(i,r,this._eyeOffset,n8,e,t)};Mi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===qi.RIGHT?s-=i:e.horizontalOrigin===qi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?a-=r:e.verticalOrigin===qn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Mi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.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&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Mi.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 Fr=Mi;var A0t={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},ic=Object.freeze(A0t);var b0t=Fr.SHOW_INDEX,H1=Fr.POSITION_INDEX,wEe=Fr.PIXEL_OFFSET_INDEX,IEe=Fr.EYE_OFFSET_INDEX,x0t=Fr.HORIZONTAL_ORIGIN_INDEX,T0t=Fr.VERTICAL_ORIGIN_INDEX,E0t=Fr.SCALE_INDEX,zx=Fr.IMAGE_INDEX_INDEX,PEe=Fr.COLOR_INDEX,C0t=Fr.ROTATION_INDEX,v0t=Fr.ALIGNED_AXIS_INDEX,DEe=Fr.SCALE_BY_DISTANCE_INDEX,REe=Fr.TRANSLUCENCY_BY_DISTANCE_INDEX,OEe=Fr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,MEe=Fr.DISTANCE_DISPLAY_CONDITION,S0t=Fr.DISABLE_DEPTH_DISTANCE,w0t=Fr.TEXTURE_COORDINATE_BOUNDS,NEe=Fr.SDF_INDEX,LEe=Fr.SPLIT_DIRECTION_INDEX,dee=Fr.NUMBER_OF_PROPERTIES,Br={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 Md(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new WE),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(dee),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=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??ki.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.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=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ee.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ee.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(Md.prototype,{length:{get:function(){return hee(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}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function FEe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Md.prototype.add=function(e){let t=new Fr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Md.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Md.prototype.removeAll=function(){FEe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function hee(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}Md.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Md.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Md.prototype.get=function(e){return hee(this),this._billboards[e]};function SEe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function I0t(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.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}Md.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<dee;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function P0t(e,t,n,i,r){let o=[{index:Br.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[H1]},{index:Br.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[H1]},{index:Br.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[wEe]},{index:Br.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[REe]},{index:Br.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[PEe]},{index:Br.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[IEe]},{index:Br.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[DEe]},{index:Br.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[OEe]},{index:Br.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[MEe]},{index:Br.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[w0t]},{index:Br.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[LEe]},{index:Br.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:I0t(e)}];return l(i)&&o.push({index:Br.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:Br.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[NEe]}),new F_(e,o,t,!0)}var aee=new Sn;function BEe(e,t,n,i){let r=n[Br.positionHighAndScale],o=n[Br.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(le.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,aee);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=aee.high,f=aee.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var iA=new U,Od=32768,mee=65536,cee=4096,Vx=256,D0t=128,R0t=32,O0t=8,o8=4,M0t=1/256,kEe=new et;function UEe(e,t,n,i){let r=n[Br.compressedAttribute0],o=i.pixelOffset,s=o.x,a=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+u),Math.abs(-a+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===qn.BASELINE&&(p=qn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===qi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===qn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(kEe);m=I.x,y=I.y}let A=Math.floor(P.clamp(s,-Od,Od)+Od)*D0t;A+=(d+1)*R0t,A+=(p+1)*O0t,A+=(g?1:0)*o8;let b=Math.floor(P.clamp(a,-Od,Od)+Od)*Vx,x=Math.floor(P.clamp(u*o8,-Od,Od)+Od)*Vx,T=(P.clamp(f*o8,-Od,Od)+Od)*M0t,E=Math.floor(T),v=Math.floor((T-E)*Vx);b+=E,x+=v,iA.x=m,iA.y=y;let S=cn.compressTextureCoordinates(iA);r(i._index,A,b,x,S)}function zEe(e,t,n,i){let r=n[Br.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=P.clamp(d,0,mee),g=0;Math.abs(h.magnitudeSquared(o)-1)<P.EPSILON6&&(g=cn.octEncodeFloat(o)),a=P.clamp(a,0,1),a=a===1?255:a*255|0,p=p*Vx+a,u=P.clamp(u,0,1),u=u===1?255:u*255|0,g=g*Vx+u,r(i._index,p,g,s,c)}function uee(e,t,n,i){let r=n[Br.compressedAttribute2],o=i.color,s=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=cn.encodeRGB8(o),m=cn.encodeRGB8(s),y=z.floatToByte(o.alpha)*mee+z.floatToByte(s.alpha)*Vx+(a*2+f),A=d*o8+p;r(i._index,g,m,y,A)}function fee(e,t,n,i){let r=n[Br.eyeOffset],o=i.eyeOffset,s=o.z;if(i._heightReference!==We.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(s)),iA.x=0,iA.y=0,i.ready){let c=i.computeTextureCoordinates(kEe);iA.x=c.width,iA.y=c.height}let a=cn.compressTextureCoordinates(iA);r(i._index,o.x,o.y,s,a)}function VEe(e,t,n,i){let r=n[Br.scaleByDistance],o=0,s=1,a=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,s,a,c)}function jEe(e,t,n,i){let r=n[Br.pixelOffsetScaleByDistance],o=0,s=1,a=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,s,a,c)}function HEe(e,t,n,i){let r=n[Br.compressedAttribute3],o=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(o=a.near,s=a.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=ps(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(P.clamp(d,0,cee)),g=Math.floor(P.clamp(f,0,cee)),m=p*cee+g;r(i._index,o,s,c,m)}function GEe(e,t,n,i){if(ps(i.heightReference)){let a=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[Br.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function N0t(e,t,n,i){if(!l(e._batchTable))return;let r=n[Br.a_batchId],o=i._batchIndex;r(i._index,o)}function WEe(e,t,n,i){if(!e._sdf)return;let r=n[Br.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/ic.RADIUS,u=z.floatToByte(o.alpha)*mee+z.floatToByte(c)*Vx;r(i._index,a,u)}function qEe(e,t,n,i){let r=n[Br.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function L0t(e,t,n,i){BEe(e,t,n,i),UEe(e,t,n,i),zEe(e,t,n,i),uee(e,t,n,i),fee(e,t,n,i),VEe(e,t,n,i),jEe(e,t,n,i),HEe(e,t,n,i),GEe(e,t,n,i),N0t(e,t,n,i),WEe(e,t,n,i),qEe(e,t,n,i)}function lee(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Fr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):le.expand(s,d,s))}o&&le.fromPoints(a,s)}function F0t(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!M.equals(o,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&lee(e,i,i.length,t,o,!0)):n===re.MORPHING?lee(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&lee(e,r,e._billboardsToUpdateIndex,t,o,!1)}function B0t(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function k0t(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=De.OVERLAY,i}var iWe=[];Af.prototype.update=function(e){if(Y9(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,oo=this._instanced?G9e:H9e,V9=this._instanced?W9e:j9e;let n=this._billboards,i=n.length,o=!0;for(let R=0;R<i;++R){let L=n[R];c(L.loadError)&&(console.error(`Error loading image for billboard: ${L.loadError}`),L.image=void 0),L.textureDirty&&this._updateBillboard(L,Db),L.show&&(o=o&&L.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!c(r.texture))return;eWe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,l=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<q9;++R)l[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=Y9e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R<i;++R){let L=this._billboards[R];L._dirty=!1,L.textureDirty=!1,J9e(this,e,h,L)}this._vaf.commit(V9(t))}this._billboardsToUpdateIndex=0}else if(a>0){let R=iWe;R.length=0,(l[$v]||l[k9e]||l[B9e])&&R.push(Dae),(l[Db]||l[yae]||l[N9e]||l[F9e]||l[L9e])&&(R.push(Lae),this._instanced&&R.push(W9)),(l[Db]||l[U9e]||l[Aae])&&(R.push(Nae),R.push(j9)),(l[Db]||l[xae])&&R.push(j9),(l[Db]||l[bae])&&R.push(W9),l[Tae]&&R.push(Fae),l[Cae]&&R.push(Bae),(l[Eae]||l[V9e]||l[Db]||l[$v])&&R.push(kae),(l[Db]||l[$v])&&R.push(Uae),l[Sae]&&R.push(Vae),l[wae]&&R.push(zae);let L=R.length;if(h=this._vaf.writers,a/i>.1){for(let B=0;B<a;++B){let _=s[B];_._dirty=!1,_.textureDirty=!1;for(let w=0;w<L;++w)R[w](this,e,h,_)}this._vaf.commit(V9(t))}else{for(let B=0;B<a;++B){let _=s[B];_._dirty=!1,_.textureDirty=!1;for(let w=0;w<L;++w)R[w](this,e,h,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=F.IDENTITY;e.mode===oe.SCENE3D?(y=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),tWe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Po.OPAQUE||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===Po.TRANSLUCENT;this._blendOption===Po.TRANSLUCENT||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:R?ne.LEQUAL:ne.LESS},depthMask:R,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,A,E,S,v,P=ut.maximumVertexTextureImageUnits>0;if(b||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){x=DB,A=vB,v=[],c(this._batchTable)&&(v.push("VECTOR_TILE"),x=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(x),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),E=new He({defines:v,sources:[x]}),this._instanced&&E.defines.push("INSTANCED"),this._shaderRotation&&E.defines.push("ROTATION"),this._shaderAlignedAxis&&E.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&E.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&E.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&E.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&E.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&E.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(P?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-sa.CUTOFF;this._sdf&&E.defines.push("SDF");let L=c(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Po.OPAQUE_AND_TRANSLUCENT&&(S=new He({defines:["OPAQUE",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo}),S=new He({defines:["TRANSLUCENT",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=en.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo})),this._blendOption===Po.OPAQUE&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo})),this._blendOption===Po.TRANSLUCENT&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=en.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo})),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 M=e.commandList;if(p.render||p.pick){let R=this._colorCommands,L=this._blendOption===Po.OPAQUE,B=this._blendOption===Po.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,w=_.length,D=this._uniforms,I;c(this._batchTable)?(D=this._batchTable.getUniformMapCallback()(D),I=this._batchTable.getPickId()):I="v_pickColor",R.length=w;let N=B?w*2:w;for(let k=0;k<N;++k){let H=R[k];c(H)||(H=R[k]=new Je);let V=L||B&&k%2===0;H.pass=V||!B?De.OPAQUE:De.TRANSLUCENT,H.owner=this;let j=B?Math.floor(k/2):k;H.boundingVolume=m,H.modelMatrix=y,H.count=_[j].indicesCount,H.shaderProgram=V?this._sp:this._spTranslucent,H.uniformMap=D,H.vertexArray=_[j].va,H.renderState=V?this._rsOpaque:this._rsTranslucent,H.debugShowBoundingVolume=this.debugShowBoundingVolume,H.pickId=I,this._instanced&&(H.count=6,H.instanceCount=i),M.push(H)}this.debugShowTextureAtlas&&(c(this.debugCommand)||(this.debugCommand=nWe(this,e.context)),M.push(this.debugCommand))}this._allBillboardsReady=o};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return c(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(),vae(this._billboards),de(this)};var Cf=Af;function oWe(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 ZA=oWe;function aa(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),QA(this)}var rWe=new he;Object.defineProperties(aa.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=G.clone(e,this._color),QA(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,QA(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=G.clone(e,this._pointOutlineColor),QA(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,QA(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){c(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=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,rWe);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=G.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&&QA(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}}});aa.defaultColor=G.WHITE;aa.defaultPointOutlineColor=G.BLACK;aa.defaultPointOutlineWidth=0;aa.defaultPointSize=8;function QA(e){let t=e._billboard;if(c(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(c(e._billboardImage))return;let n=e._color??aa.defaultColor,i=e._pointOutlineColor??aa.defaultPointOutlineColor,o=e._pointOutlineWidth??aa.defaultPointOutlineWidth,r=e._pointSize??aa.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,l=e._billboardOutlineWidth,u=e._billboardSize;if(G.equals(n,s)&&G.equals(i,a)&&o===l&&r===u)return;e._billboardColor=G.clone(n,e._billboardColor),e._billboardOutlineColor=G.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,ZA(f,h,p,o,r))}aa.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};aa.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};aa.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};aa.prototype.getPropertyInherited=function(e){return ta.getPropertyInherited(this._content,this._batchId,e)};aa.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};aa.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};aa.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};aa.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var qg=aa;function sWe(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",""),l=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,p=h/2;l.width=f,l.height=h;let g=l.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,l.width+1,l.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,h).data,y=m.length,b=f*4,x,A,E,S;for(x=0;x<y;++x)if(m[x]!==255){E=x/b|0;break}for(x=y-1;x>=0;--x)if(m[x]!==255){S=x/b|0;break}let v=-1;for(x=0;x<f&&v===-1;++x)for(A=0;A<h;++A){let P=x*4+A*b;if(m[P]!==255||m[P+1]!==255||m[P+2]!==255||m[P+3]!==255){v=x;break}}return{width:r.width,height:S-E,ascent:p-E,descent:S-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Pb;function aWe(e,t){if(!c(e))throw new C("text is required.");if(e==="")return;t=t??W.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??G.TRANSPARENT,a=t.padding??0,l=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});c(Pb)||(c(f.imageSmoothingEnabled)?Pb="imageSmoothingEnabled":c(f.mozImageSmoothingEnabled)?Pb="mozImageSmoothingEnabled":c(f.webkitImageSmoothingEnabled)?Pb="webkitImageSmoothingEnabled":c(f.msImageSmoothingEnabled)&&(Pb="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Pb]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=sWe(f,e,n,i,o);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=-h.minx,g=Math.ceil(h.width)+p+l,m=h.height+l,y=m-h.ascent+a,b=m-y+l;if(u.width=g,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Pb]=!1,s!==G.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let x=t.strokeColor??G.BLACK;f.strokeStyle=x.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let x=t.fillColor??G.WHITE;f.fillStyle=x.toCssColorString(),f.fillText(e,p+a,b)}return u}var JA=aWe;var Jae=jr(Wae(),1);var lWe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Ko=Object.freeze(lWe);var qae={},Yae=0,uWe=256,fWe=new G(.165,.165,.165,.8),dWe=new z(7,5),as=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Ib(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Qv(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Jv(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Kae(e){let t=qae[e._font];if(!c(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(Jv(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Jv(n,"font-family"),size:Jv(n,"font-size").replace("px",""),style:Jv(n,"font-style"),weight:Jv(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Yae<uWe&&(qae[e._font]=t,Yae++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function vd(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Lt.clone(r)}this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=G.clone(e.fillColor??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=G.clone(e.backgroundColor??fWe),this._backgroundPadding=z.clone(e.backgroundPadding??dWe),this._style=e.style??Ko.FILL,this._verticalOrigin=e.verticalOrigin??Fn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??xi.LEFT,this._pixelOffset=z.clone(e.pixelOffset??z.ZERO),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._position=d.clone(e.position??d.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??qe.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=e.text??"",this._relativeSize=1,Kae(this),this._updateClamping()}Object.defineProperties(vd.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");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;c(r)&&(r.show=e)}let n=this._backgroundBillboard;c(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new C("value is required.");let t=this._position;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].billboard;c(s)&&(s.position=e)}let i=this._backgroundBillboard;c(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!c(e))throw new C("value is required.");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;c(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;c(n)&&(n.heightReference=e),Qv(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!c(e))throw new C("value is required.");if(this._text!==e){this._text=e;let t=vd.filterUnsupportedCharacters(e);this._renderedText=vd.enableRightToLeftDetection?yWe(t):t,Ib(this)}}},font:{get:function(){return this._font},set:function(e){if(!c(e))throw new C("value is required.");this._font!==e&&(this._font=e,Ib(this),Kae(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._fillColor;G.equals(t,e)||(G.clone(e,t),Ib(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Ib(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Ib(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!c(e))throw new C("value is required.");this._showBackground!==e&&(this._showBackground=e,Ib(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._backgroundColor;if(!G.equals(t,e)){G.clone(e,t);let n=this._backgroundBillboard;c(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!c(e))throw new C("value is required.");let t=this._backgroundPadding;z.equals(t,e)||(z.clone(e,t),Qv(this))}},style:{get:function(){return this._style},set:function(e){if(!c(e))throw new C("value is required.");this._style!==e&&(this._style=e,Ib(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!c(e))throw new C("value is required.");let t=this._pixelOffset;if(!z.equals(t,e)){z.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._translucencyByDistance;if(!Bt.equals(t,e)){this._translucencyByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;if(!Bt.equals(t,e)){this._pixelOffsetScaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._scaleByDistance;if(!Bt.equals(t,e)){this._scaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!c(e))throw new C("value is required.");let t=this._eyeOffset;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];c(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!c(e))throw new C("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Qv(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!c(e))throw new C("value is required.");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];c(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;c(n)&&(n.verticalOrigin=e),Qv(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!c(e))throw new C("value is required.");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];c(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;c(n)&&(n.scale=e*this._relativeSize),Qv(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far must be greater than near");if(!Lt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;c(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(c(e)&&e<0)throw new C("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;c(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!c(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;c(n)&&(n.clusterShow=e)}}}});vd.prototype._updateClamping=function(){ao._updateClamping(this._labelCollection,this)};vd.prototype.computeScreenSpacePosition=function(e,t){if(!c(e))throw new C("scene is required.");c(t)||(t=new z);let i=this._labelCollection.modelMatrix,o=c(this._actualClampedPosition)?this._actualClampedPosition:this._position;return ao._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};vd.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,l=e._backgroundBillboard;if(c(l))i=t.x+l._translate.x,o=t.y-l._translate.y,r=l.width*a,s=l.height*a,e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?o-=s:e.verticalOrigin===Fn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let g=0;g<p;++g){let m=h[g],y=m.billboard;if(!c(y))continue;let b=t.x+y._translate.x,x=t.y-y._translate.y,A=m.dimensions.width*a,E=m.dimensions.height*a;e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?x-=E:e.verticalOrigin===Fn.CENTER&&(x-=E*.5),e._verticalOrigin===Fn.TOP?x+=sa.PADDING*a:(e._verticalOrigin===Fn.BOTTOM||e._verticalOrigin===Fn.BASELINE)&&(x-=sa.PADDING*a),i=Math.min(i,b),o=Math.min(o,x),u=Math.max(u,b+A),f=Math.max(f,x+E)}r=u-i,s=f-o}return c(n)||(n=new Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};vd.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};vd.prototype.equals=function(e){return this===e||c(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&&d.equals(this._position,e._position)&&G.equals(this._fillColor,e._fillColor)&&G.equals(this._outlineColor,e._outlineColor)&&G.equals(this._backgroundColor,e._backgroundColor)&&z.equals(this._backgroundPadding,e._backgroundPadding)&&z.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};vd.prototype.isDestroyed=function(){return!1};vd.enableRightToLeftDetection=!1;function hWe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=as.LTR,a="",l=e.length;for(let u=0;u<l;++u){let f=e.charAt(u);t.test(f)?a=as.RTL:n.test(f)?a=as.LTR:i.test(f)?a=as.BRACKETS:a=as.WEAK,u===0&&(s=a),s===a&&a!==as.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function mWe(e){return e.split("").reverse().join("")}function eD(e,t,n){return e.slice(0,t)+n+e.slice(t)}function pWe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var _We="\u05D0-\u05EA",gWe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Xae=new RegExp(`[${_We}${gWe}]`);function yWe(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Xae.test(o.charAt(0)),s=hWe(o,Xae),a=0,l="";for(let u=0;u<s.length;++u){let f=s[u],h=f.Type===as.BRACKETS?pWe(f.Word):mWe(f.Word);r?f.Type===as.RTL?(l=h+l,a=0):f.Type===as.LTR?(l=eD(l,a,f.Word),a+=f.Word.length):(f.Type===as.WEAK||f.Type===as.BRACKETS)&&(f.Type===as.WEAK&&s[u-1].Type===as.BRACKETS?l=h+l:s[u-1].Type===as.RTL?(l=h+l,a=0):s.length>u+1?s[u+1].Type===as.RTL?(l=h+l,a=0):(l=eD(l,a,f.Word),a+=f.Word.length):l=eD(l,0,h)):f.Type===as.RTL?l=eD(l,a,h):f.Type===as.LTR?(l+=f.Word,a=l.length):(f.Type===as.WEAK||f.Type===as.BRACKETS)&&(u>0&&s[u-1].Type===as.RTL?s.length>u+1?s[u+1].Type===as.RTL?l=eD(l,a,h):(l+=f.Word,a=l.length):l+=f.Word:(l+=f.Word,a=l.length))}n+=l,i<t.length-1&&(n+=` -`)}return n}var Ob=vd;var ece=jr($ae(),1);function xWe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var TWe=1.2,Zae="ID_WHITE_PIXEL",K9=new z(4,4),AWe=new Ke(1,1,1,1);function CWe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=K9.x,o.height=K9.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Zae,o),n.addImageSubRegion(Zae,AWe)}let i=e.add({collection:t});return i.setImageTexture(n),i}var Hp={};function EWe(e,t,n,i,o,r){return Hp.font=t,Hp.fillColor=n,Hp.strokeColor=i,Hp.strokeWidth=o,Hp.padding=sa.PADDING,Hp.fill=r===Ko.FILL||r===Ko.FILL_AND_OUTLINE,Hp.stroke=r===Ko.OUTLINE||r===Ko.FILL_AND_OUTLINE,Hp.backgroundColor=G.BLACK,JA(e,Hp)}function $9(e,t){let n=t.billboard;c(n)&&(n.show=!1,c(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var SWe=new ece.default,wWe=/\s/;function vWe(e,t){let n=t._renderedText,i=SWe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/sa.FONT_SIZE,o<s)for(let g=o;g<s;++g)$9(e,r[g]);r.length=o;let a=t.show&&t._showBackground&&n.split(` -`).join("").length>0,l=t._backgroundBillboard,u=e._backgroundBillboardCollection;a?(c(l)||(l=CWe(u,e),t._backgroundBillboard=l),l.color=t._backgroundColor,l.show=t._show,l.position=t._position,l.eyeOffset=t._eyeOffset,l.pixelOffset=t._pixelOffset,l.horizontalOrigin=xi.LEFT,l.verticalOrigin=t._verticalOrigin,l.heightReference=t._heightReference,l.scale=t.totalScale,l.pickPrimitive=t,l.id=t._id,l.translucencyByDistance=t._translucencyByDistance,l.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,l.scaleByDistance=t._scaleByDistance,l.distanceDisplayCondition=t._distanceDisplayCondition,l.disableDepthTestDistance=t._disableDepthTestDistance,l.clusterShow=t.clusterShow):c(l)&&(u.remove(l),t._backgroundBillboard=l=void 0);let f=e._glyphBillboardCollection,h=f.billboardTextureCache,p=e._textDimensionsCache;for(let g=0;g<o;++g){let m=i[g],y=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+y]),x=p[b],A=h.get(b);if(!c(A)||!c(x)){A=new Wg(f),h.set(b,A);let P=`${t._fontStyle} ${t._fontWeight} ${sa.FONT_SIZE}px ${t._fontFamily}`,M=EWe(m,P,G.WHITE,G.WHITE,0,Ko.FILL);if(x=M.dimensions,p[b]=x,M.width>0&&M.height>0&&!wWe.test(m)){let R=(0,Jae.default)(M,{cutoff:sa.CUTOFF,radius:sa.RADIUS}),L=M.getContext("2d"),B=M.width,_=M.height,w=L.getImageData(0,0,B,_);for(let D=0;D<B;D++)for(let I=0;I<_;I++){let N=I*B+D,k=R[N]*255,H=N*4;w.data[H+0]=k,w.data[H+1]=k,w.data[H+2]=k,w.data[H+3]=k}L.putImageData(w,0,0),A.loadImage(b,M)}}let E=r[g];if(c(E)||(E=new xWe,E.dimensions=x,E.billboardTexture=A,r[g]=E),E.billboardTexture.id!==b&&(E.billboardTexture=A,E.dimensions=x),!A.hasImage){$9(e,E);continue}let S=E.billboard,v=e._spareBillboards;c(S)||(v.length>0?S=v.pop():(S=f.add({collection:e}),S._labelDimensions=new z,S._labelTranslate=new z),E.billboard=S),S.setImageTexture(A),S.show=t._show,S.position=t._position,S.eyeOffset=t._eyeOffset,S.pixelOffset=t._pixelOffset,S.horizontalOrigin=xi.LEFT,S.verticalOrigin=t._verticalOrigin,S.heightReference=t._heightReference,S.scale=t.totalScale,S.pickPrimitive=t,S.id=t._id,S.translucencyByDistance=t._translucencyByDistance,S.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,S.scaleByDistance=t._scaleByDistance,S.distanceDisplayCondition=t._distanceDisplayCondition,S.disableDepthTestDistance=t._disableDepthTestDistance,S._batchIndex=t._batchIndex,S.outlineColor=t.outlineColor,t.style===Ko.FILL_AND_OUTLINE?(S.color=t._fillColor,S.outlineWidth=t.outlineWidth):t.style===Ko.FILL?(S.color=t._fillColor,S.outlineWidth=0):t.style===Ko.OUTLINE&&(S.color=G.TRANSPARENT,S.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Qae(e,t,n){return t===xi.CENTER?-e/2:t===xi.RIGHT?-(e+n.x):n.x}var lr=new z,DWe=new z;function PWe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,l=1,u=t.length,f=e._backgroundBillboard,h=z.clone(c(f)?e._backgroundPadding:z.ZERO,DWe);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let L=0;L<u;++L){if(n.charAt(L)===` -`){r.push(i),++l,i=0;continue}let _=t[L].dimensions;c(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,L<u-1&&(i+=t[L+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,b=0,x=r[b],A=Qae(x,m,h),E=(c(e._lineHeight)?e._lineHeight:TWe*e._fontSize)/e._relativeSize,S=E*(l-1),v=o,P=p+S;c(f)&&(v+=h.x*2,P+=h.y*2,f._labelHorizontalOrigin=m),lr.x=A*g,lr.y=0;let M=!0,R=0;for(let L=0;L<u;++L){if(n.charAt(L)===` -`){++b,R+=E,x=r[b],A=Qae(x,m,h),lr.x=A*g,M=!0;continue}let B=t[L],_=B.dimensions;if(c(_)&&(y===Fn.TOP?(lr.y=_.height-a-h.y,lr.y+=sa.PADDING):y===Fn.CENTER?lr.y=(S+_.height-a)/2:y===Fn.BASELINE?(lr.y=S,lr.y-=sa.PADDING):(lr.y=S+s+h.y,lr.y-=sa.PADDING),lr.y=(lr.y-_.descent-R)*g,M&&(lr.x-=sa.PADDING*g,M=!1),c(B.billboard)&&(B.billboard._setTranslate(lr),B.billboard._labelDimensions.x=v,B.billboard._labelDimensions.y=P,B.billboard._labelHorizontalOrigin=m),L<u-1)){let w=t[L+1];lr.x+=(_.width-_.minx+w.dimensions.minx)*g}}if(c(f)&&n.split(` -`).join("").length>0&&(m===xi.CENTER?A=-o/2-h.x:m===xi.RIGHT?A=-(o+h.x*2):A=0,lr.x=A*g,y===Fn.TOP?lr.y=p-a-s:y===Fn.CENTER?lr.y=(p-a)/2-s:y===Fn.BASELINE?lr.y=-h.y-s:lr.y=0,lr.y=lr.y*g,f.width=v,f.height=P,f._setTranslate(lr),f._labelTranslate=z.clone(lr,f._labelTranslate)),of(e.heightReference))for(let L=0;L<u;++L){let _=t[L].billboard;c(_)&&(_._labelTranslate=z.clone(lr,_._labelTranslate))}}function tce(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)$9(e,n[i]);c(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,c(t._removeCallbackFunc)&&t._removeCallbackFunc(),de(t)}function sm(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Cf({scene:this._scene,textureAtlas:new LT({initialSize:K9})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Wg(t),this._glyphBillboardCollection=new Cf({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=G.clone(G.WHITE),this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Po.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(sm.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 c(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});sm.prototype.add=function(e){let t=new Ob(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};sm.prototype.remove=function(e){if(c(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),tce(this,e),!0}return!1};sm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)tce(this,e[t]);e.length=0};sm.prototype.contains=function(e){return c(e)&&e._labelCollection===this};sm.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._labels[e]};sm.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&&(vWe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(PWe(s),s._repositionAllGlyphs=!1);let l=s._glyphs.length-a;this._totalGlyphCount+=l}let o=n.length>0?Po.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)};sm.prototype.isDestroyed=function(){return!1};sm.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),de(this)};var Gp=sm;var RB=`in vec3 position3DHigh; +`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var U0t=[];Md.prototype.update=function(e){if(hee(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Ut.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let I=0;I<i;++I){let R=n[I];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,zx),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;F0t(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let I=0;I<dee;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=P0t(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let I=0;I<i;++I){let R=this._billboards[I];R._dirty=!1,R.textureDirty=!1,L0t(this,e,d,R)}this._vaf.commit(SEe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=U0t;I.length=0,(c[H1]||c[C0t]||c[E0t])&&I.push(BEe),(c[zx]||c[wEe]||c[x0t]||c[T0t]||c[b0t])&&(I.push(UEe),I.push(fee)),(c[zx]||c[v0t]||c[REe])&&(I.push(zEe),I.push(uee)),(c[zx]||c[PEe])&&I.push(uee),(c[zx]||c[IEe])&&I.push(fee),c[DEe]&&I.push(VEe),c[OEe]&&I.push(jEe),(c[MEe]||c[S0t]||c[zx]||c[H1])&&I.push(HEe),(c[zx]||c[H1])&&I.push(GEe),c[NEe]&&I.push(WEe),c[LEe]&&I.push(qEe);let R=I.length;if(d=this._vaf.writers,a/i>.1){for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L)}this._vaf.commit(SEe(t))}else{for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L);this._vaf.subCommit(L._index,1)}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 m,y=M.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),B0t(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===ki.OPAQUE||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===ki.TRANSLUCENT;this._blendOption===ki.TRANSLUCENT||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:rn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,E,v;if(A||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){b=t8,x=e8,v=["INSTANCED"],l(this._batchTable)&&(v.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Xe({defines:v,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let I=1-ic.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===ki.OPAQUE_AND_TRANSLUCENT&&(E=new Xe({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br}),E=new Xe({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._blendOption===ki.OPAQUE&&(E=new Xe({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._blendOption===ki.TRANSLUCENT&&(E=new Xe({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),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 S=e.commandList;if(p.render||p.pick){let I=this._colorCommands,R=this._blendOption===ki.OPAQUE,O=this._blendOption===ki.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,w;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),w=this._batchTable.getPickId()):w="v_pickColor",I.length=_;let D=O?_*2:_;for(let N=0;N<D;++N){let F=I[N];l(F)||(F=I[N]=new at);let V=R||O&&N%2===0;F.pass=V||!O?Ie.OPAQUE:Ie.TRANSLUCENT,F.owner=this;let B=O?Math.floor(N/2):N;F.boundingVolume=m,F.modelMatrix=y,F.count=L[B].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=C,F.vertexArray=L[B].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=w,F.count=6,F.instanceCount=i,S.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=k0t(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};Md.prototype.isDestroyed=function(){return!1};Md.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(),FEe(this._billboards),ue(this)};var Nd=Md;function z0t(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.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,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var gS=z0t;var V0t=new he,Gh=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,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),_S(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),_S(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,_S(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),_S(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,_S(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,V0t);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&_S(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return pa.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};ut(Gh,"defaultColor",z.WHITE),ut(Gh,"defaultPointOutlineColor",z.BLACK),ut(Gh,"defaultPointOutlineWidth",0),ut(Gh,"defaultPointSize",8);function _S(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=e._color??Gh.defaultColor,i=e._pointOutlineColor??Gh.defaultPointOutlineColor,r=e._pointOutlineWidth??Gh.defaultPointOutlineWidth,o=e._pointSize??Gh.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,gS(f,d,p,r,o))}var rA=Gh;var oCe=js($Ee(),1);var JEe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(JEe);var Po=JEe;var ZEe={},QEe=0,H0t=256,G0t=new z(.165,.165,.165,.8),W0t=new U(7,5),Js=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function jx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function W1(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function q1(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function tCe(e){let t=ZEe[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(q1(n,"line-height"));isNaN(i)&&(i=void 0),t={family:q1(n,"font-family"),size:q1(n,"font-size").replace("px",""),style:q1(n,"font-style"),weight:q1(n,"font-weight"),lineHeight:i},document.body.removeChild(n),QEe<H0t&&(ZEe[e._font]=t,QEe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Wh(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Gt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??G0t),this._backgroundPadding=U.clone(e.backgroundPadding??W0t),this._style=e.style??Po.FILL,this._verticalOrigin=e.verticalOrigin??qn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??qi.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??We.NONE,this._distanceDisplayCondition=o,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._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,tCe(this),this._updateClamping()}Object.defineProperties(Wh.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,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.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(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].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,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),W1(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Wh.filterUnsupportedCharacters(e);this._renderedText=Wh.enableRightToLeftDetection?J0t(t):t,jx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,jx(this),tCe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),jx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),jx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,jx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,jx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.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;U.equals(t,e)||(U.clone(e,t),W1(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,jx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!qt.equals(t,e)){this._translucencyByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!qt.equals(t,e)){this._pixelOffsetScaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!qt.equals(t,e)){this._scaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];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,W1(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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),W1(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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),W1(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Gt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.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,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Wh.prototype._updateClamping=function(){Fr._updateClamping(this._labelCollection,this)};Wh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Fr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Wh.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?r-=s:e.verticalOrigin===qn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?b-=T:e.verticalOrigin===qn.CENTER&&(b-=T*.5),e._verticalOrigin===qn.TOP?b+=ic.PADDING*a:(e._verticalOrigin===qn.BOTTOM||e._verticalOrigin===qn.BASELINE)&&(b-=ic.PADDING*a),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,s=f-r}return l(n)||(n=new et),n.x=i,n.y=r,n.width=o,n.height=s,n};Wh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Wh.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&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Wh.prototype.isDestroyed=function(){return!1};Wh.enableRightToLeftDetection=!1;function q0t(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=Js.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=Js.RTL:n.test(f)?a=Js.LTR:i.test(f)?a=Js.BRACKETS:a=Js.WEAK,u===0&&(s=a),s===a&&a!==Js.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function Y0t(e){return e.split("").reverse().join("")}function Y1(e,t,n){return e.slice(0,t)+n+e.slice(t)}function X0t(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var K0t="\u05D0-\u05EA",$0t="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",eCe=new RegExp(`[${K0t}${$0t}]`);function J0t(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=eCe.test(r.charAt(0)),s=q0t(r,eCe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===Js.BRACKETS?X0t(f.Word):Y0t(f.Word);o?f.Type===Js.RTL?(c=d+c,a=0):f.Type===Js.LTR?(c=Y1(c,a,f.Word),a+=f.Word.length):(f.Type===Js.WEAK||f.Type===Js.BRACKETS)&&(f.Type===Js.WEAK&&s[u-1].Type===Js.BRACKETS?c=d+c:s[u-1].Type===Js.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===Js.RTL?(c=d+c,a=0):(c=Y1(c,a,f.Word),a+=f.Word.length):c=Y1(c,0,d)):f.Type===Js.RTL?c=Y1(c,a,d):f.Type===Js.LTR?(c+=f.Word,a=c.length):(f.Type===Js.WEAK||f.Type===Js.BRACKETS)&&(u>0&&s[u-1].Type===Js.RTL?s.length>u+1?s[u+1].Type===Js.RTL?c=Y1(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var Hx=Wh;var sCe=js(nCe(),1);function Q0t(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var egt=1.2,iCe="ID_WHITE_PIXEL",pee=new U(4,4),tgt=new et(1,1,1,1);function ngt(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=pee.x,r.height=pee.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(iCe,r),n.addImageSubRegion(iCe,tgt)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var Sg={};function igt(e,t,n,i,r,o){return Sg.font=t,Sg.fillColor=n,Sg.strokeColor=i,Sg.strokeWidth=r,Sg.padding=ic.PADDING,Sg.fill=o===Po.FILL||o===Po.FILL_AND_OUTLINE,Sg.stroke=o===Po.OUTLINE||o===Po.FILL_AND_OUTLINE,Sg.backgroundColor=z.BLACK,jC(e,Sg)}function gee(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var rgt=new sCe.default,ogt=/\s/;function sgt(e,t){let n=t._renderedText,i=rgt.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/ic.FONT_SIZE,r<s)for(let p=r;p<s;++p)gee(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=ngt(c,e),t._backgroundBillboard=a),agt(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new nA(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${ic.FONT_SIZE}px ${t._fontFamily}`,S=igt(g,v,z.WHITE,z.WHITE,0,Po.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!ogt.test(g)){let I=(0,oCe.default)(S,{cutoff:ic.CUTOFF,radius:ic.RADIUS}),R=S.getContext("2d"),O=S.width,L=S.height,_=R.getImageData(0,0,O,L);for(let C=0;C<O;C++)for(let w=0;w<L;w++){let D=w*O+C,N=I[D]*255,F=D*4;_.data[F+0]=N,_.data[F+1]=N,_.data[F+2]=N,_.data[F+3]=N}R.putImageData(_,0,0),b.loadImage(y,S)}}let x=o[p];if(l(x)||(x=new Q0t,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){gee(e,x);continue}let T=x.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new U,T._labelTranslate=new U,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=qi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===Po.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Po.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Po.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function agt(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` +`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=qi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function rCe(e,t,n){return t===qi.CENTER?-e/2:t===qi.RIGHT?-(e+n.x):n.x}var Uo=new U,cgt=new U;function lgt(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=U.clone(l(f)?e._backgroundPadding:U.ZERO,cgt);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=rCe(b,m,d),T=(l(e._lineHeight)?e._lineHeight:egt*e._fontSize)/e._relativeSize,E=T*(c-1),v=r,S=p+E;l(f)&&(v+=d.x*2,S+=d.y*2,f._labelHorizontalOrigin=m),Uo.x=x*g,Uo.y=0;let I=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){++A,R+=T,b=o[A],x=rCe(b,m,d),Uo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===qn.TOP?(Uo.y=_.height-a-d.y,Uo.y+=ic.PADDING):y===qn.CENTER?Uo.y=(E+_.height-a)/2:y===qn.BASELINE?(Uo.y=E,Uo.y-=ic.PADDING):(Uo.y=E+s+d.y,Uo.y-=ic.PADDING),Uo.y=(Uo.y-_.descent-R)*g,I&&(Uo.x-=ic.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(Uo),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,ps(e.heightReference)&&(L.billboard._labelTranslate=U.clone(Uo,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];Uo.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` +`).join("").length>0&&(m===qi.CENTER?x=-r/2-d.x:m===qi.RIGHT?x=-(r+d.x*2):x=0,Uo.x=x*g,y===qn.TOP?Uo.y=p-a-s:y===qn.CENTER?Uo.y=(p-a)/2-s:y===qn.BASELINE?Uo.y=-d.y-s:Uo.y=0,Uo.y=Uo.y*g,f.width=v,f.height=S,f._setTranslate(Uo),f._labelTranslate=U.clone(Uo,f._labelTranslate))}function aCe(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)gee(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function kp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Nd({scene:this._scene,textureAtlas:new WE({initialSize:pee}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new nA(t),this._glyphBillboardCollection=new Nd({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??ki.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(kp.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}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});kp.prototype.add=function(e){let t=new Hx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};kp.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),aCe(this,e),!0}return!1};kp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)aCe(this,e[t]);e.length=0};kp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};kp.prototype.get=function(e){return this._labels[e]};kp.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 o=0;o<i;++o){let s=this._labelsToUpdate[o];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(sgt(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(lgt(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?ki.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};kp.prototype.isDestroyed=function(){return!1};kp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var wg=kp;var a8=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 position2DHigh; in vec3 position2DLow; @@ -5862,8 +7477,8 @@ v_width = width; v_pickColor = pickColor; v_polylineAngle = polylineAngle; } -`;var Hc={};Hc.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};Hc.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 IWe=new he;Hc.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,IWe).height}return i};var OWe=new F,RWe=new d,nce=new d,MWe=new sn(d.UNIT_X,0),ice=new d,LWe=new sn(d.UNIT_X,0),NWe=new d,FWe=new d,Q9=[];function rce(e,t,n){let i=Q9;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 LB=new he,MB=new he,Yg=new d,J9=new d,BWe=new d,Z9=new J_,tD=new Ja;function kWe(e,t,n,i,o,r,s,a){let l=i.scaleToGeodeticSurface(e,J9),u=i.scaleToGeodeticSurface(t,BWe),f=Hc.numberOfPoints(e,t,n),h=i.cartesianToCartographic(l,LB),p=i.cartesianToCartographic(u,MB),g=rce(f,o,r);Z9.setEndPoints(h,p);let m=Z9.surfaceDistance/f,y=a;h.height=o;let b=i.cartographicToCartesian(h,Yg);d.pack(b,s,y),y+=3;for(let x=1;x<f;x++){let A=Z9.interpolateUsingSurfaceDistance(x*m,MB);A.height=g[x],b=i.cartographicToCartesian(A,Yg),d.pack(b,s,y),y+=3}return y}function UWe(e,t,n,i,o,r,s,a){let l=i.cartesianToCartographic(e,LB),u=i.cartesianToCartographic(t,MB),f=Hc.numberOfPointsRhumbLine(l,u,n);l.height=0,u.height=0;let h=rce(f,o,r);tD.ellipsoid.equals(i)||(tD=new Ja(void 0,void 0,i)),tD.setEndPoints(l,u);let p=tD.surfaceDistance/f,g=a;l.height=o;let m=i.cartographicToCartesian(l,Yg);d.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let b=tD.interpolateUsingSurfaceDistance(y*p,MB);b.height=h[y],m=i.cartographicToCartesian(b,Yg),d.pack(m,s,g),g+=3}return g}Hc.wrapLongitude=function(e,t){let n=[],i=[];if(c(e)&&e.length>0){t=t??F.IDENTITY;let o=F.inverseTransformation(t,OWe),r=F.multiplyByPoint(o,d.ZERO,RWe),s=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_Y,nce),nce),a=sn.fromPointNormal(r,s,MWe),l=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_X,ice),ice),u=sn.fromPointNormal(r,l,LWe),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,h)<0||sn.getPointDistance(u,m)<0){let y=Qn.lineSegmentPlane(h,m,a,NWe);if(c(y)){let b=d.multiplyByScalar(s,5e-9,FWe);sn.getPointDistance(a,h)<0&&d.negate(b,b),n.push(d.add(y,b,new d)),i.push(f+1),d.negate(b,b),n.push(d.add(y,b,new d)),f=1}}n.push(d.clone(e[g])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};Hc.generateArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],J9);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(y,Yg);d.multiplyByScalar(b,o,b),d.add(y,b,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!c(s)){let y=e.granularity??O.RADIANS_PER_DEGREE;s=O.chordLength(y,i.maximumRadius)}let a=0,l;for(l=0;l<n-1;l++)a+=Hc.numberOfPoints(t[l],t[l+1],s);let u=(a+1)*3,f=new Array(u),h=0;for(l=0;l<n-1;l++){let y=t[l],b=t[l+1],x=r?o[l]:o,A=r?o[l+1]:o;h=kWe(y,b,s,i,x,A,f,h)}Q9.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,LB);g.height=r?o[n-1]:o;let m=i.cartographicToCartesian(g,Yg);return d.pack(m,f,u-3),f};var oce=new he,VWe=new he;Hc.generateRhumbArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],J9);if(o=r?o[0]:o,o!==0){let A=i.geodeticSurfaceNormal(x,Yg);d.multiplyByScalar(A,o,A),d.add(x,A,x)}return[x.x,x.y,x.z]}let s=e.granularity??O.RADIANS_PER_DEGREE,a=0,l,u=i.cartesianToCartographic(t[0],oce),f;for(l=0;l<n-1;l++)f=i.cartesianToCartographic(t[l+1],VWe),a+=Hc.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,oce);let h=(a+1)*3,p=new Array(h),g=0;for(l=0;l<n-1;l++){let x=t[l],A=t[l+1],E=r?o[l]:o,S=r?o[l+1]:o;g=UWe(x,A,s,i,E,S,p,g)}Q9.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,LB);y.height=r?o[n-1]:o;let b=i.cartographicToCartesian(y,Yg);return d.pack(b,p,h-3),p};Hc.generateCartesianArc=function(e){let t=Hc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};Hc.generateCartesianRhumbArc=function(e){let t=Hc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Bi=Hc;function uu(e,t){e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,c(this._material)||(this._material=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)}));let n=e.positions;c(n)||(n=[]),this._positions=n,this._actualPositions=xo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;c(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Bi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(ace),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 sce=uu.POSITION_INDEX=0,zWe=uu.SHOW_INDEX=1,HWe=uu.WIDTH_INDEX=2,GWe=uu.MATERIAL_INDEX=3,nD=uu.POSITION_SIZE_INDEX=4,jWe=uu.DISTANCE_DISPLAY_CONDITION=5,ace=uu.NUMBER_OF_PROPERTIES=6;function jp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;c(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(uu.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");e!==this._show&&(this._show=e,jp(this,zWe))}},positions:{get:function(){return this._positions},set:function(e){if(!c(e))throw new C("value is required.");let t=xo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&jp(this,nD),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),jp(this,sce),this.update()}},material:{get:function(){return this._material},set:function(e){if(!c(e))throw new C("material is required.");this._material!==e&&(this._material=e,jp(this,GWe))}},width:{get:function(){return this._width},set:function(e){if(!c(e))throw new C("value is required.");let t=this._width;e!==t&&(this._width=e,jp(this,HWe))}},loop:{get:function(){return this._loop},set:function(e){if(!c(e))throw new C("value is required.");if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,jp(this,nD)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!c(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");Lt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),jp(this,jWe))}}});uu.prototype.update=function(){let e=F.IDENTITY;c(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[sce]>0||this._propertiesChanged[nD]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Bi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)jp(this,nD);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){jp(this,nD);break}}};uu.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};uu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<ace-1;++t)e[t]=0};uu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Dd=uu;var WWe=Dd.SHOW_INDEX,qWe=Dd.WIDTH_INDEX,tW=Dd.POSITION_INDEX,YWe=Dd.MATERIAL_INDEX,cce=Dd.POSITION_SIZE_INDEX,XWe=Dd.DISTANCE_DISPLAY_CONDITION,pce=Dd.NUMBER_OF_PROPERTIES,vl={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 Pd(e){e=e??W.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=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(pce),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Be.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=G.clone(G.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Pd.prototype,{length:{get:function(){return nW(this),this._polylines.length}}});Pd.prototype.add=function(e){let t=new Dd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Pd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,c(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Pd.prototype.removeAll=function(){iW(this),xce(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Pd.prototype.contains=function(e){return c(e)&&e._polylineCollection===this};Pd.prototype.get=function(e){if(!c(e))throw new C("index is required.");return nW(this),this._polylines[e]};function KWe(e,t){c(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:$.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:$.FLOAT,componentsPerAttribute:2}];e._batchTable=new zT(t,n,e._polylines.length)}var _ce=new Hn,gce=new se,yce=new z;Pd.prototype.update=function(e){if(nW(this),this._polylines.length===0||!this.show)return;tqe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(ut.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.");KWe(this,t),this._createBatchTable=!1}if(this._createVertexArray||ZWe(this))fce(this,t,n);else if(this._polylinesUpdated){let l=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let u=l.length;for(let f=0;f<u;++f)i=l[f],i.update()}if(o[cce]||o[YWe])fce(this,t,n);else{let u=l.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=l[h],o=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[tW]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((o[WWe]||o[qWe])&&this._batchTable.setBatchedAttribute(i._index,0,new z(i._width,i._show)),this._batchTable.attributes.length>2){if(o[tW]||o[cce]){let m=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Hn.fromCartesian(m.center,_ce),b=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,gce);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[XWe]){let m=yce;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;c(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}l.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let l=0;l<pce;++l)o[l]=0;let r=F.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!c(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!c(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let l=this._colorCommands;$We(this,e,l,r)}};var iD=new le,lce=new le;function $We(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,l=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],b=y.buckets,x=b.length;for(let A=0;A<x;++A){let E=b[A],S=E.offset,v=E.bucket.shaderProgram,P=E.bucket.polylines,M=P.length,R,L,B=0,_,w;for(let D=0;D<M;++D){let I=P[D],N=JWe(I._material);if(N!==R){if(c(R)&&B>0){let j=L.isTranslucent();a>=s?(_=new Je({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(iD,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=B,_.offset=S,S+=B,B=0,l=!0,r.push(_)}L=I._material,L.update(o),R=N}let k=I._locatorBuckets,H=k.length;for(let j=0;j<H;++j){let U=k[j];U.locator===E&&(B+=U.count)}let V;t.mode===oe.SCENE3D?V=I._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===oe.SCENE2D?c(I._boundingVolume2D)&&(V=le.clone(I._boundingVolume2D,lce),V.center.x=0):c(I._boundingVolumeWC)&&c(I._boundingVolume2D)&&(V=le.union(I._boundingVolumeWC,I._boundingVolume2D,lce)),l?(l=!1,le.clone(V,iD)):le.union(V,iD,iD)}c(R)&&B>0&&(a>=s?(_=new Je({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(iD,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=B,_.offset=S,l=!0,r.push(_)),R=void 0}}n.length=a}Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){return bce(this),iW(this),xce(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function ZWe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[tW]?(i.bufferUsage!==Be.STREAM_DRAW&&(t=!0,i.bufferUsage=Be.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Be.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Be.STATIC_DRAW):i.frameCount--),t}var uce=[0,0,0];function fce(e,t,n){e._createVertexArray=!1,iW(e),bce(e),eqe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],l=0,u=[[]],f=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),b=new Float32Array(f*4),x,A=0,E=0,S=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(y,b,A,E,S,r,t,n),m===oe.MORPHING&&(c(x)||(x=new Float32Array(6*f*3)),g.writeForMorph(x,A));let w=g.lengthOfPositions;A+=6*w*3,E+=w*4,S+=w*4,l=g.updateIndices(i,a,u,l)}let v=e._positionBufferUsage.bufferUsage,P=Be.STATIC_DRAW;e._positionBuffer=bt.createVertexBuffer({context:t,typedArray:y,usage:v});let M;c(x)&&(M=bt.createVertexBuffer({context:t,typedArray:x,usage:v})),e._texCoordExpandAndBatchIndexBuffer=bt.createVertexBuffer({context:t,typedArray:b,usage:P});let R=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,B=0,_=i.length;for(let w=0;w<_;++w)if(o=i[w],o.length>0){let D=new Uint16Array(o),I=bt.createIndexBuffer({context:t,typedArray:D,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});B+=a[w];let N=6*(w*(R*O.SIXTY_FOUR_KILOBYTES)-B*R),k=R+N,H=R+k,V=R+H,j=R+V,U=R+j,q=w*(L*O.SIXTY_FOUR_KILOBYTES)-B*L,X=[{index:vl.position3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:vl.position3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:vl.position2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:vl.position2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:vl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:vl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:vl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:vl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:vl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:vl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:vl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:vl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:vl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:$.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],te,K,Z,ee;m===oe.SCENE3D?(K=e._positionBuffer,te="vertexBuffer",Z=uce,ee="value"):m===oe.SCENE2D||m===oe.COLUMBUS_VIEW?(K=uce,te="value",Z=e._positionBuffer,ee="vertexBuffer"):(K=M,te="vertexBuffer",Z=e._positionBuffer,ee="vertexBuffer"),X[0][te]=K,X[1][te]=K,X[2][ee]=Z,X[3][ee]=Z,X[4][te]=K,X[5][te]=K,X[6][ee]=Z,X[7][ee]=Z,X[8][te]=K,X[9][te]=K,X[10][ee]=Z,X[11][ee]=Z;let me=new ni({context:t,attributes:X,indexBuffer:I});e._vertexArrays.push({va:me,buckets:u[w]})}}}function QWe(e,t){return t instanceof Rt?t.id:t}var NB=[];function JWe(e){let t=Xi._uniformList[e.type],n=t.length;NB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];NB[i]=r,NB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(NB,QWe)}`}function eqe(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 l=a.material,u=i[l.type];c(u)||(u=i[l.type]=new am(l,t,n)),u.addPolyline(a)}}}function tqe(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function nW(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 iW(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;c(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function bce(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Pd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function xce(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function eW(e,t,n){this.count=e,this.offset=t,this.bucket=n}function am(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}am.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};am.prototype.updateShader=function(e,t,n){if(c(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"),zt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new He({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,YT]}),r=t.getVertexShaderCallback()(RB),s=new He({defines:i,sources:[af,r]});this.shaderProgram=en.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:vl})};function Tce(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===Wt.INTERSECTING}am.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!Tce(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 Ts=new d,Ef=new d,Sf=new d,FB=new d,nqe=new se,iqe=new z;am.prototype.write=function(e,t,n,i,o,r,s,a){let l=this.mode,u=a.ellipsoid.maximumRadius*O.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let g=f[p],m=g.width,y=g.show&&m>0,b=g._index,x=this.getSegments(g,a),A=x.positions,E=x.lengths,S=A.length,v=g.getPickId(s).color,P=0,M=0,R;for(let H=0;H<S;++H){H===0?g._loop?R=A[S-2]:(R=FB,d.subtract(A[0],A[1],R),d.add(A[0],R,R)):R=A[H-1],d.clone(R,Ef),d.clone(A[H],Ts),H===S-1?g._loop?R=A[1]:(R=FB,d.subtract(A[S-1],A[S-2],R),d.add(A[S-1],R,R)):R=A[H+1],d.clone(R,Sf);let V=E[P];H===M+V&&(M+=V,++P);let j=H-M===0,U=H===M+E[P]-1;l===oe.SCENE2D&&(Ef.z=0,Ts.z=0,Sf.z=0),(l===oe.SCENE2D||l===oe.MORPHING)&&(j||U)&&u-Math.abs(Ts.x)<1&&((Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef),(Ts.x<0&&Sf.x>0||Ts.x>0&&Sf.x<0)&&d.clone(Ts,Sf));let q=j?2:0,X=U?2:4;for(let te=q;te<X;++te){Hn.writeElements(Ts,e,n),Hn.writeElements(Ef,e,n+6),Hn.writeElements(Sf,e,n+12);let K=te-2<0?-1:1;t[o]=H/(S-1),t[o+1]=2*(te%2)-1,t[o+2]=K,t[o+3]=b,n+=6*3,o+=4}}let L=nqe;L.x=G.floatToByte(v.red),L.y=G.floatToByte(v.green),L.z=G.floatToByte(v.blue),L.w=G.floatToByte(v.alpha);let B=iqe;B.x=m,B.y=y?1:0;let _=l===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,w=Hn.fromCartesian(_.center,_ce),D=w.high,I=se.fromElements(w.low.x,w.low.y,w.low.z,_.radius,gce),N=yce;N.x=0,N.y=Number.MAX_VALUE;let k=g.distanceDisplayCondition;c(k)&&(N.x=k.near,N.y=k.far),r.setBatchedAttribute(b,0,B),r.setBatchedAttribute(b,1,L),r.attributes.length>2&&(r.setBatchedAttribute(b,2,D),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var oqe=new d,rqe=new d,sqe=new d,dce=new d;am.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,l=s._segments.lengths,u=a.length,f=0,h=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=dce,d.subtract(a[0],a[1],g),d.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,rqe);let m=F.multiplyByPoint(n,a[p],oqe),y;p===u-1?s._loop?y=a[1]:(y=dce,d.subtract(a[u-1],a[u-2],y),d.add(a[u-1],y,y)):y=a[p+1],y=F.multiplyByPoint(n,y,sqe);let b=l[f];p===h+b&&(h+=b,++f);let x=p-h===0,A=p===h+l[f]-1,E=x?2:0,S=A?2:4;for(let v=E;v<S;++v)Hn.writeElements(m,e,t),Hn.writeElements(g,e,t+6),Hn.writeElements(y,e,t+12),t+=6*3}}};var aqe=new Array(1);am.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new eW(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],l=0;a.length>0&&(l=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=aqe;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let b=0;b<m;++b){let x=g[b]-1;for(let A=0;A<x;++A)l+4>O.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),l=0,r.count=s,s=0,i=0,r=new eW(0,0,this),n[++o]=[r]),a.push(l,l+2,l+1),a.push(l+1,l+2,l+3),y+=6,s+=6,i+=6,l+=4}p._locatorBuckets.push({locator:r,count:y}),l+4>O.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),l=0,r.count=s,i=0,s=0,r=new eW(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};am.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 eC={positions:void 0,lengths:void 0},hce=new Array(1),cqe=new d,lqe=new he;am.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return hce[0]=n.length,eC.positions=n,eC.lengths=hce,eC;Tce(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,l=cqe;for(let u=0;u<s;++u)a=n[u],l=F.multiplyByPoint(r,a,l),o.push(t.project(i.cartesianToCartographic(l,lqe)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return eC.positions=o,eC.lengths=e._segments.lengths,eC};var mce;am.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*O.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=mce,l=6*s*3;!c(a)||a.length<l?a=mce=new Float32Array(l):a.length>l&&(a=new Float32Array(a.buffer,0,l));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?y=f[s-2]:(y=FB,d.subtract(f[0],f[1],y),d.add(f[0],y,y)):y=f[b-1],d.clone(y,Ef),d.clone(f[b],Ts),b===s-1?t._loop?y=f[1]:(y=FB,d.subtract(f[s-1],f[s-2],y),d.add(f[s-1],y,y)):y=f[b+1],d.clone(y,Sf);let x=h[g];b===m+x&&(m+=x,++g);let A=b-m===0,E=b===m+h[g]-1;o===oe.SCENE2D&&(Ef.z=0,Ts.z=0,Sf.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(A||E)&&r-Math.abs(Ts.x)<1&&((Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef),(Ts.x<0&&Sf.x>0||Ts.x>0&&Sf.x<0)&&d.clone(Ts,Sf));let S=A?2:0,v=E?2:4;for(let P=S;P<v;++P)Hn.writeElements(Ts,a,p),Hn.writeElements(Ef,a,p+6),Hn.writeElements(Sf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var cm=Pd;function Xg(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 Cf({batchTable:e.batchTable}),this._labelCollection=new Gp({batchTable:e.batchTable}),this._polylineCollection=new cm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Xg.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 uqe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+ie.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ce.pack(n,s,a),a+=ce.packedLength,ie.pack(t,s,a),s}var fqe=new bi("createVectorTilePoints",5),dqe=new d;function hqe(e,t){let n=e._positions,i=e._packedBuffer;c(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=uqe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=fqe.scheduleTask(r,o);if(c(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let l=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let m=h[g],y=d.unpack(n,g*3,dqe),b=l.add();b.position=y,b._batchIndex=m;let x=u.add();x.text=" ",x.position=y,x._batchIndex=m;let A=f.add();A.positions=[d.clone(y),d.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Xg.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 l=r[a],u=n.get(a),f=i.get(a),h=o.get(a);t[l]=new qg(e,l,u,f,h)}};Xg.prototype.applyDebugSettings=function(e,t){e?(G.clone(t,this._billboardCollection._highlightColor),G.clone(t,this._labelCollection._highlightColor),G.clone(t,this._polylineCollection._highlightColor)):(G.clone(G.WHITE,this._billboardCollection._highlightColor),G.clone(G.WHITE,this._labelCollection._highlightColor),G.clone(G.WHITE,this._polylineCollection._highlightColor))};function mqe(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=qg.defaultPointSize,s.color=qg.defaultColor,s.pointOutlineColor=qg.defaultPointOutlineColor,s.pointOutlineWidth=qg.defaultPointOutlineWidth,s.labelColor=G.WHITE,s.labelOutlineColor=G.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Ko.FILL,s.labelText=void 0,s.backgroundColor=new G(.165,.165,.165,.8),s.backgroundPadding=new z(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=G.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=xi.CENTER,s.verticalOrigin=Fn.CENTER,s.labelHorizontalOrigin=xi.RIGHT,s.labelVerticalOrigin=Fn.BASELINE}}var pqe=new G,_qe=new G,gqe=new G,yqe=new G,bqe=new G,xqe=new G,oD=new Bt,rD=new Bt,oW=new Lt;Xg.prototype.applyStyle=function(e,t){if(!c(e)){mqe(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(c(e.show)&&(s.show=e.show.evaluate(s)),c(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),c(e.color)&&(s.color=e.color.evaluateColor(s,pqe)),c(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,_qe)),c(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),c(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,gqe)),c(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,yqe)),c(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),c(e.font)&&(s.font=e.font.evaluate(s)),c(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),c(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,c(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,bqe)),c(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),c(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),c(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);c(a)?(oD.near=a.x,oD.nearValue=a.y,oD.far=a.z,oD.farValue=a.w,s.scaleByDistance=oD):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(c(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);c(a)?(rD.near=a.x,rD.nearValue=a.y,rD.far=a.z,rD.farValue=a.w,s.translucencyByDistance=rD):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(c(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);c(a)?(oW.near=a.x,oW.far=a.y,s.distanceDisplayCondition=oW):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;c(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),c(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),c(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,xqe)),c(e.image)?s.image=e.image.evaluate(s):s.image=void 0,c(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),c(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),c(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),c(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),c(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Xg.prototype.update=function(e){if(!this._ready&&(c(this._promise)||(this._promise=hqe(this,e.mapProjection.ellipsoid)),c(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Xg.prototype.isDestroyed=function(){return!1};Xg.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(),de(this)};var BB=Xg;function Wp(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=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??d.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=Un.BOTH}Object.defineProperties(Wp.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Tqe(e){let t=new Float64Array(3+d.packedLength+ie.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,ce.pack(e._rectangle,t,n),t}function Aqe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Pn.unpack(t,n),n+=Pn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let l=G.unpack(t,n);n+=G.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let g=0;g<h;++g)p[g]=t[n++];s[a]=new Cp({color:l,offset:u,count:f,batchIds:p})}}var Cqe=new bi("createVectorTilePolygons",5),Eqe=new G;function Sqe(e){if(c(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(!c(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,m=s.length;for(let y=0;y<m;++y){let b=g.getColor(y,Eqe);s[y]=b.toRgba()}a=e._packedBuffer=Tqe(e)}let l=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;c(f)&&c(h)&&(f=f.slice(),h=h.slice(),l.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=Cqe.scheduleTask(u,l);if(c(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 m=new Float64Array(g.packedBuffer),y=m[0];Aqe(e,m),e._indices=Fe.getSizeInBytes(y)===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),wqe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function wqe(e){c(e._primitive)||(e._primitive=new hA({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)}Wp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Wp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Wp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Wp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Wp.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=Sqe(this)),c(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)};Wp.prototype.isDestroyed=function(){return!1};Wp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var kB=Wp;var UB=`in vec4 currentPosition; +`;function Ef(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=lr.fromType(lr.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Lr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=cr.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(lCe),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 cCe=Ef.POSITION_INDEX=0,ugt=Ef.SHOW_INDEX=1,fgt=Ef.WIDTH_INDEX=2,dgt=Ef.MATERIAL_INDEX=3,X1=Ef.POSITION_SIZE_INDEX=4,hgt=Ef.DISTANCE_DISPLAY_CONDITION=5,lCe=Ef.NUMBER_OF_PROPERTIES=6;function Ig(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ef.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Ig(this,ugt))}},positions:{get:function(){return this._positions},set:function(e){let t=Lr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Ig(this,X1),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),Ig(this,cCe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Ig(this,dgt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Ig(this,fgt))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Ig(this,X1)}}},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){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Ig(this,hgt))}}});Ef.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[cCe]>0||this._propertiesChanged[X1]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=cr.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)Ig(this,X1);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){Ig(this,X1);break}}};Ef.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ef.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<lCe-1;++t)e[t]=0};Ef.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var qh=Ef;var mgt=qh.SHOW_INDEX,pgt=qh.WIDTH_INDEX,yee=qh.POSITION_INDEX,ggt=qh.MATERIAL_INDEX,uCe=qh.POSITION_SIZE_INDEX,_gt=qh.DISTANCE_DISPLAY_CONDITION,_Ce=qh.NUMBER_OF_PROPERTIES,Bu={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 Yh(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=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(_Ce),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=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Yh.prototype,{length:{get:function(){return Aee(this),this._polylines.length}}});Yh.prototype.add=function(e){let t=new qh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Yh.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};Yh.prototype.removeAll=function(){bee(this),TCe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Yh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Yh.prototype.get=function(e){return Aee(this),this._polylines[e]};function ygt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new mv(t,n,e._polylines.length)}var yCe=new Sn,ACe=new se,bCe=new U;Yh.prototype.update=function(e){if(Aee(this),this._polylines.length===0||!this.show)return;Cgt(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Ut.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");ygt(this,t),this._createBatchTable=!1}if(this._createVertexArray||bgt(this))hCe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[uCe]||r[ggt])hCe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[yee]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[mgt]||r[pgt])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[yee]||r[uCe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,yCe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,ACe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[_gt]){let m=bCe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<_Ce;++c)r[c]=0;let o=M.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ge.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ge.fromCache({blending:rn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;Agt(this,e,c,o)}};var K1=new le,fCe=new le;function Agt(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],E=T.offset,v=T.bucket.shaderProgram,S=T.bucket.polylines,I=S.length,R,O,L=0,_,C;for(let w=0;w<I;++w){let D=S[w],N=Tgt(D._material);if(N!==R){if(l(R)&&L>0){let j=O.isTranslucent();a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Mt(p(O._uniforms),e._uniformMap),_.boundingVolume=le.clone(K1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,o.push(_)}O=D._material,O.update(r),R=N}let F=D._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let k=F[j];k.locator===T&&(L+=k.count)}let B;t.mode===re.SCENE3D?B=D._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?B=D._boundingVolume2D:t.mode===re.SCENE2D?l(D._boundingVolume2D)&&(B=le.clone(D._boundingVolume2D,fCe),B.center.x=0):l(D._boundingVolumeWC)&&l(D._boundingVolume2D)&&(B=le.union(D._boundingVolumeWC,D._boundingVolume2D,fCe)),c?(c=!1,le.clone(B,K1)):le.union(B,K1,K1)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Mt(p(O._uniforms),e._uniformMap),_.boundingVolume=le.clone(K1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,o.push(_)),R=void 0}}n.length=a}Yh.prototype.isDestroyed=function(){return!1};Yh.prototype.destroy=function(){return xCe(this),bee(this),TCe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function bgt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[yee]?(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 dCe=[0,0,0];function hCe(e,t,n){e._createVertexArray=!1,bee(e),xCe(e),Egt(e);let i=[[]],r,o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,E,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let C=g.lengthOfPositions;x+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,S=Me.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=tt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:A,usage:S});let R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(r=i[C],r.length>0){let w=new Uint16Array(r),D=tt.createIndexBuffer({context:t,typedArray:w,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});L+=a[C];let N=6*(C*(R*P.SIXTY_FOUR_KILOBYTES)-L*R),F=R+N,V=R+F,B=R+V,j=R+B,k=R+j,G=C*(O*P.SIXTY_FOUR_KILOBYTES)-L*O,q=[{index:Bu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Bu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Bu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Bu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Bu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Bu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Bu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Bu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Bu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Bu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Bu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Bu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Bu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=dCe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=dCe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(W=I,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),q[0][Q]=W,q[1][Q]=W,q[2][Z]=J,q[3][Z]=J,q[4][Q]=W,q[5][Q]=W,q[6][Z]=J,q[7][Z]=J,q[8][Q]=W,q[9][Q]=W,q[10][Z]=J,q[11][Z]=J;let ae=new Vn({context:t,attributes:q,indexBuffer:D});e._vertexArrays.push({va:ae,buckets:u[C]})}}}function xgt(e,t){return t instanceof Dt?t.id:t}var c8=[];function Tgt(e){let t=lr._uniformList[e.type],n=t.length;c8.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];c8[i]=o,c8[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(c8,xgt)}`}function Egt(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Up(c,t,n)),u.addPolyline(a)}}}function Cgt(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function Aee(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function bee(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function xCe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Yh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function TCe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function _ee(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Up(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Up.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Up.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"),i.push("CLIP_POLYLINE");let r=new Xe({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,yv]}),o=t.getVertexShaderCallback()(a8),s=new Xe({defines:i,sources:[Eu,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Bu})};function ECe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}Up.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!ECe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var ya=new h,Ld=new h,Fd=new h,l8=new h,vgt=new se,Sgt=new U;Up.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,a),x=b.positions,T=b.lengths,E=x.length,v=g.getPickId(s).color,S=0,I=0,R;for(let V=0;V<E;++V){V===0?g._loop?R=x[E-2]:(R=l8,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Ld),h.clone(x[V],ya),V===E-1?g._loop?R=x[1]:(R=l8,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,Fd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(Ld.z=0,ya.z=0,Fd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(ya.x)<1&&((ya.x<0&&Ld.x>0||ya.x>0&&Ld.x<0)&&h.clone(ya,Ld),(ya.x<0&&Fd.x>0||ya.x>0&&Fd.x<0)&&h.clone(ya,Fd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(ya,e,n),Sn.writeElements(Ld,e,n+6),Sn.writeElements(Fd,e,n+12);let W=Q-2<0?-1:1;t[r]=V/(E-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=A,n+=18,r+=4}}let O=vgt;O.x=z.floatToByte(v.red),O.y=z.floatToByte(v.green),O.z=z.floatToByte(v.blue),O.w=z.floatToByte(v.alpha);let L=Sgt;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,yCe),w=C.high,D=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,ACe),N=bCe;N.x=0,N.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(N.x=F.near,N.y=F.far),o.setBatchedAttribute(A,0,L),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,w),o.setBatchedAttribute(A,3,D),o.setBatchedAttribute(A,4,N))}};var wgt=new h,Igt=new h,Pgt=new h,mCe=new h;Up.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=mCe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=M.multiplyByPoint(n,g,Igt);let m=M.multiplyByPoint(n,a[p],wgt),y;p===u-1?s._loop?y=a[1]:(y=mCe,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=M.multiplyByPoint(n,y,Pgt);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,E=x?2:4;for(let v=T;v<E;++v)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var Dgt=new Array(1);Up.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new _ee(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=Dgt;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new _ee(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new _ee(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};Up.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var yS={positions:void 0,lengths:void 0},pCe=new Array(1),Rgt=new h,Ogt=new he;Up.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return pCe[0]=n.length,yS.positions=n,yS.lengths=pCe,yS;ECe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Rgt;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,Ogt)));if(r.length>0){e._boundingVolume2D=le.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return yS.positions=r,yS.lengths=e._segments.lengths,yS};var gCe;Up.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=gCe,c=6*s*3;!l(a)||a.length<c?a=gCe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let A=0;A<s;++A){A===0?t._loop?y=f[s-2]:(y=l8,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Ld),h.clone(f[A],ya),A===s-1?t._loop?y=f[1]:(y=l8,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,Fd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Ld.z=0,ya.z=0,Fd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(ya.x)<1&&((ya.x<0&&Ld.x>0||ya.x>0&&Ld.x<0)&&h.clone(ya,Ld),(ya.x<0&&Fd.x>0||ya.x>0&&Fd.x<0)&&h.clone(ya,Fd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(ya,a,p),Sn.writeElements(Ld,a,p+6),Sn.writeElements(Fd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var zp=Yh;function oA(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._heightReference=e.heightReference,this._billboardCollection=new Nd({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new wg({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new zp,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(oA.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 Mgt(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+ee.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ie.pack(n,s,a),a+=ie.packedLength,ee.pack(t,s,a),s}var Ngt=new $n("createVectorTilePoints",5),Lgt=new h;function Fgt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Mgt(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=Ngt.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??We.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,Lgt),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}oA.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new rA(e,c,u,f,d)}};oA.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function Bgt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=rA.defaultPointSize,s.color=rA.defaultColor,s.pointOutlineColor=rA.defaultPointOutlineColor,s.pointOutlineWidth=rA.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Po.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(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=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=qi.CENTER,s.verticalOrigin=qn.CENTER,s.labelHorizontalOrigin=qi.RIGHT,s.labelVerticalOrigin=qn.BASELINE}}var kgt=new z,Ugt=new z,zgt=new z,Vgt=new z,jgt=new z,Hgt=new z,$1=new qt,J1=new qt,xee=new Gt;oA.prototype.applyStyle=function(e,t){if(!l(e)){Bgt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];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,kgt)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Ugt)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,zgt)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Vgt)),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,jgt)),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)?($1.near=a.x,$1.nearValue=a.y,$1.far=a.z,$1.farValue=a.w,s.scaleByDistance=$1):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(J1.near=a.x,J1.nearValue=a.y,J1.far=a.z,J1.farValue=a.w,s.translucencyByDistance=J1):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(xee.near=a.x,xee.far=a.y,s.distanceDisplayCondition=xee):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,Hgt)),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))}};oA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Fgt(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)};oA.prototype.isDestroyed=function(){return!1};oA.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(),ue(this)};var u8=oA;function Pg(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=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.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=ti.BOTH}Object.defineProperties(Pg.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 Ggt(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,ie.pack(e._rectangle,t,n),t}function Wgt(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=en.unpack(t,n),n+=en.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new pg({color:c,offset:u,count:f,batchIds:p})}}var qgt=new $n("createVectorTilePolygons",5),Ygt=new z;function Xgt(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=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(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let A=g.getColor(y,Ygt);s[y]=A.toRgba()}a=e._packedBuffer=Ggt(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=qgt.scheduleTask(u,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 m=new Float64Array(g.packedBuffer),y=m[0];Wgt(e,m),e._indices=je.getSizeInBytes(y)===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),Kgt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function Kgt(e){l(e._primitive)||(e._primitive=new Bv({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)}Pg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Pg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Pg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Pg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Pg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Xgt(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)};Pg.prototype.isDestroyed=function(){return!1};Pg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var f8=Pg;var d8=`in vec4 currentPosition; in vec4 previousPosition; in vec4 nextPosition; in vec2 expandAndWidth; @@ -5881,12 +7496,12 @@ float angle; vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; } -`;function Id(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Id.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function vqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var Dqe=new bi("createVectorTilePolylines",5),tC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Pqe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=vqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Dqe.scheduleTask(l,a);if(c(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Iqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Iqe(e,t){if(!c(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,l=i.byteLength+n.byteLength+o.byteLength;l+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=l;let u=bt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),f=bt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),h=bt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),p=bt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),g=bt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),m=bt.createIndexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),y=[{index:tC.previousPosition,vertexBuffer:u,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:tC.currentPosition,vertexBuffer:f,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:tC.nextPosition,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:tC.expandAndWidth,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:2},{index:tC.a_batchId,vertexBuffer:g,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:y,indexBuffer:m}),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 sD=new F,Ace=new d;function Oqe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,sD),F.multiplyByPoint(sD,e._center,Ace),F.setTranslation(sD,Ace,sD),sD},u_highlightColor:function(){return e._highlightColor}})}function Rqe(e){if(c(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Mqe=`uniform vec4 u_highlightColor; +`;function Xh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.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=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Xh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function $gt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var Jgt=new $n("createVectorTilePolylines",5),AS={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Zgt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=$gt(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Jgt.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Qgt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Qgt(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:AS.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:AS.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:AS.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:AS.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:AS.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:y,indexBuffer:m}),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 Z1=new M,CCe=new h;function e_t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,Z1),M.multiplyByPoint(Z1,e._center,CCe),M.setTranslation(Z1,CCe,Z1),Z1},u_highlightColor:function(){return e._highlightColor}})}function t_t(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:rn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var n_t=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } -`;function Lqe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(UB),o=n.getFragmentShaderCallback(!1,void 0,!1)(Mqe),r=new He({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[af,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:tC})}function Nqe(e,t){if(!c(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Je({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:De.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Id.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!c(n)||!c(i))return;let r,s,a=n.length,l=0,u=0;for(r=0;r<a;++r)n[r]===t&&(l+=o[r+1]-o[r]);if(l===0)return;let f=new Float64Array(l*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;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Id.prototype.getPositions=function(e){return Id.getPolylinePositions(this,e)};Id.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 ta(e,r)}};Id.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Fqe(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=G.WHITE}}var Bqe=new G,kqe=G.WHITE,Uqe=!0;Id.prototype.applyStyle=function(e,t){if(!c(e)){Fqe(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=c(e.color)?e.color.evaluateColor(s,Bqe):kqe,s.show=c(e.show)?e.show.evaluate(s):Uqe}};Id.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=Pqe(this,t)),c(this._error)){let i=this._error;throw this._error=void 0,i}return}Oqe(this,t),Lqe(this,t),Rqe(this);let n=e.passes;(n.render||n.pick)&&Nqe(this,e)};Id.prototype.isDestroyed=function(){return!1};Id.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var nC=Id;var VB=`in vec3 startEllipsoidNormal; +`;function i_t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(d8),r=n.getFragmentShaderCallback(!1,void 0,!1)(n_t),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Eu,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:AS})}function r_t(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Xh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Xh.prototype.getPositions=function(e){return Xh.getPolylinePositions(this,e)};Xh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new pa(e,o)}};Xh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function o_t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var s_t=new z,a_t=z.WHITE,c_t=!0;Xh.prototype.applyStyle=function(e,t){if(!l(e)){o_t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,s_t):a_t,s.show=l(e.show)?e.show.evaluate(s):c_t}};Xh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Zgt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}e_t(this,t),i_t(this,t),t_t(this);let n=e.passes;(n.render||n.pick)&&r_t(this,e)};Xh.prototype.isDestroyed=function(){return!1};Xh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var bS=Xh;var h8=`in vec3 startEllipsoidNormal; in vec3 endEllipsoidNormal; in vec4 startPositionAndHeight; in vec4 endPositionAndHeight; @@ -5932,7 +7547,7 @@ vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); v_halfWidth = endFaceNormalAndHalfWidth.w; } -`;var zB=`in vec4 v_startPlaneEC; +`;var m8=`in vec4 v_startPlaneEC; in vec4 v_endPlaneEC; in vec4 v_rightPlaneEC; in float v_halfWidth; @@ -5967,19 +7582,245 @@ discard; out_FragColor = u_highlightColor; czm_writeDepthClamp(); } -`;function qp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.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 z(fi._defaultMinTerrainHeight,fi._defaultMaxTerrainHeight),this._boundingVolume=Pn.fromRectangle(e.rectangle,fi._defaultMinTerrainHeight,fi._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=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(qp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Vqe(e,t,n){let i=fi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,l=e._rectangle;Pn.fromRectangle(l,o,r,n,a)}function zqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var Hqe=new bi("createVectorTileClampedPolylines"),Kg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Gqe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=zqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Hqe.scheduleTask(l,a);if(c(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),jqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function jqe(e,t){if(!c(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=l.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=bt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),p=bt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),g=bt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),m=bt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),y=bt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),b=bt.createVertexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW}),x=bt.createVertexBuffer({context:t,typedArray:l,usage:Be.STATIC_DRAW}),A=bt.createIndexBuffer({context:t,typedArray:u,usage:Be.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),E=[{index:Kg.startEllipsoidNormal,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Kg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Kg.startPositionAndHeight,vertexBuffer:g,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.endPositionAndHeight,vertexBuffer:m,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.a_batchId,vertexBuffer:x,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:E,indexBuffer:A}),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 aD=new F,Cce=new d;function Wqe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,aD),F.multiplyByPoint(aD,e._center,Cce),F.setTranslation(aD,Cce,aD),aD},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Ece(e){return ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function qqe(e){c(e._rs)||(e._rs=Ece(!1),e._rs3DTiles=Ece(!0))}function Yqe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(VB),o=n.getFragmentShaderCallback(!1,void 0,!0)(zB),r=new He({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[af,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Kg})}function Xqe(e,t){let n=e._command;if(!c(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Je({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:De.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=Je.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=De.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Un.TERRAIN||i===Un.BOTH)&&t.commandList.push(n),(i===Un.CESIUM_3D_TILE||i===Un.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}qp.prototype.getPositions=function(e){return nC.getPolylinePositions(this,e)};qp.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 ta(e,r)}};qp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Kqe(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=G.WHITE}}var $qe=new G,Zqe=G.WHITE,Qqe=!0;qp.prototype.applyStyle=function(e,t){if(!c(e)){Kqe(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=c(e.color)?e.color.evaluateColor(s,$qe):Zqe,s.show=c(e.show)?e.show.evaluate(s):Qqe}};function Jqe(e){return fi.initialize().then(function(){Vqe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}qp.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=Jqe(this).then(Gqe(this,t))),c(this._error)){let i=this._error;throw this._error=void 0,i}return}Wqe(this,t),Yqe(this,t),qqe(this);let n=e.passes;(n.render||n.pick)&&Xqe(this,e)};qp.prototype.isDestroyed=function(){return!1};qp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var HB=qp;var rW=32767,e7e=new he,t7e=new d;function n7e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),l=e.subarray(2*r,3*r);Ln.zigZagDeltaDecode(s,a,l);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=s[f],p=a[f],g=l[f],m=O.lerp(t.west,t.east,h/rW),y=O.lerp(t.south,t.north,p/rW),b=O.lerp(n,i,g/rW),x=he.fromRadians(m,y,b,e7e),A=o.cartographicToCartesian(x,t7e);d.pack(A,u,f*3)}return u}var GB=n7e;function Rd(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,a7e(this,i,o)}Object.defineProperties(Rd.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return c(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.trianglesLength),c(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.geometryByteLength),c(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return c(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return c(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 i7e(e){return function(t,n){c(e._polygons)&&e._polygons.updateCommands(t,n)}}function o7e(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,l=e.POINTS_LENGTH??0;if(s>0&&c(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&c(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(l>0&&c(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,l)}let u=c(n)||c(i)||c(o),f=s>0&&!c(n)||a>0&&!c(i)||l>0&&!c(o);if(u&&f)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)){let p=0;if(!c(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!c(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!c(o)&&l>0)for(o=new Uint16Array(l),r=0;r<l;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Od=Uint32Array.BYTES_PER_ELEMENT;function r7e(e){return new nC(e)}function s7e(e){return new HB(e)}function a7e(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Od;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Od;let s=o.getUint32(n,!0);if(n+=Od,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Od,a===0)throw new ae("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=Od;let u=o.getUint32(n,!0);n+=Od;let f=o.getUint32(n,!0);n+=Od;let h=o.getUint32(n,!0);n+=Od;let p=o.getUint32(n,!0);n+=Od;let g=o.getUint32(n,!0);n+=Od;let m=o.getUint32(n,!0);n+=Od;let y=sr(i,n,a);n+=a;let b=new Uint8Array(t,n,l);n+=l;let x,A;u>0&&(x=sr(i,n,u),n+=u,f>0&&(A=new Uint8Array(t,n,f),A=new Uint8Array(A),n+=f));let E=y.POLYGONS_LENGTH??0,S=y.POLYLINES_LENGTH??0,v=y.POINTS_LENGTH??0,P=E+S+v,M=new cg(e,P,x,A,i7e(e));if(e._batchTable=M,P===0)return;let R=new tm(y,b),L=R.getGlobalProperty("REGION");if(!c(L))throw new ae("Feature table global property: REGION must be defined");let B=ce.unpack(L),_=L[4],w=L[5],D=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(I)?(I=d.unpack(I),F.multiplyByPoint(D,I,I)):(I=ce.center(B),I.height=O.lerp(_,w,.5),I=ie.WGS84.cartographicToCartesian(I));let N=o7e(y,b);if(n+=(4-n%4)%4,E>0){R.featuresLength=E;let k=R.getPropertyArray("POLYGON_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let H=R.getPropertyArray("POLYGON_INDEX_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_INDEX_COUNT",$.UNSIGNED_INT,1);if(!c(H))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=k.reduce(function(K,Z){return K+Z*2},0),j=H.reduce(function(K,Z){return K+Z},0),U=new Uint32Array(t,n,j);n+=h;let q=new Uint16Array(t,n,V);n+=p;let X,te;c(y.POLYGON_MINIMUM_HEIGHTS)&&c(y.POLYGON_MAXIMUM_HEIGHTS)&&(X=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",$.FLOAT,1),te=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",$.FLOAT,1)),e._polygons=new kB({positions:q,counts:k,indexCounts:H,indices:U,minimumHeight:_,maximumHeight:w,polygonMinimumHeights:X,polygonMaximumHeights:te,center:I,rectangle:B,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,batchIds:N.polygons,modelMatrix:D})}if(S>0){R.featuresLength=S;let k=R.getPropertyArray("POLYLINE_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYLINE_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let H=R.getPropertyArray("POLYLINE_WIDTHS",$.UNSIGNED_SHORT,1);if(!c(H)){H=new Uint16Array(S);for(let te=0;te<S;++te)H[te]=2}let V=k.reduce(function(te,K){return te+K*3},0),j=new Uint16Array(t,n,V);n+=g;let U=e._tileset,q=U.examineVectorLinesFunction;if(c(q)){let te=GB(new Uint16Array(j),B,_,w,ie.WGS84);c7e(te,k,N.polylines,M,e.url,q)}let X=r7e;c(U.classificationType)&&(X=s7e),e._polylines=X({positions:j,widths:H,counts:k,batchIds:N.polylines,minimumHeight:_,maximumHeight:w,center:I,rectangle:B,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(v>0){let k=new Uint16Array(t,n,v*3);n+=m,e._points=new BB({positions:k,batchIds:N.points,minimumHeight:_,maximumHeight:w,rectangle:B,batchTable:M})}}function sW(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._polygons)&&e._polygons.createFeatures(e,n),c(e._polylines)&&e._polylines.createFeatures(e,n),c(e._points)&&e._points.createFeatures(e,n),e._features=n}}Rd.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Rd.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new C(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return c(this._features)||sW(this),this._features[e]};Rd.prototype.applyDebugSettings=function(e,t){c(this._polygons)&&this._polygons.applyDebugSettings(e,t),c(this._polylines)&&this._polylines.applyDebugSettings(e,t),c(this._points)&&this._points.applyDebugSettings(e,t)};Rd.prototype.applyStyle=function(e){c(this._features)||sW(this),c(this._polygons)&&this._polygons.applyStyle(e,this._features),c(this._polylines)&&this._polylines.applyStyle(e,this._features),c(this._points)&&this._points.applyStyle(e,this._features)};Rd.prototype.update=function(e,t){let n=!0;c(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),c(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),c(this._points)&&(this._points.update(t),n=n&&this._points.ready),c(this._batchTable)&&n&&(c(this._features)||sW(this),this._batchTable.update(e,t),this._ready=!0)};Rd.prototype.pick=function(e,t,n){};Rd.prototype.getPolylinePositions=function(e){let t=this._polylines;if(c(t))return t.getPositions(e)};Rd.prototype.isDestroyed=function(){return!1};Rd.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(),de(this)};function c7e(e,t,n,i,o,r){let s=t.length,a=0;for(let l=0;l<s;l++){let u=t[l]*3,f=e.slice(a,a+u);a+=u,r(f,n[l],o,i)}}var jB=Rd;var Sce={b3dm:function(e,t,n,i,o){return bf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return bf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return bf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return mN.fromTileType(e,t,n,i,o,Sce)},externalTileset:function(e,t,n,i){return wB.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new TN(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new jB(e,t,n,i,o)},subt:function(e,t,n,i,o){return Av.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return Av.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),l=new Uint8Array(i,o,a);return bf.fromGltf(e,t,n,l)},gltf:function(e,t,n,i){return bf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return bf.fromGeoJson(e,t,n,i)}},iC=Sce;var l7e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},$o=Object.freeze(l7e);var Md={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"};Md.isBinaryFormat=function(e){switch(e){case Md.BATCHED_3D_MODEL:case Md.INSTANCED_3D_MODEL:case Md.COMPOSITE:case Md.POINT_CLOUD:case Md.VECTOR:case Md.GEOMETRY:case Md.IMPLICIT_SUBTREE:case Md.VOXEL_BINARY:case Md.GLTF_BINARY:return!0;default:return!1}};var Us=Object.freeze(Md);var u7e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Ld=Object.freeze(u7e);var Vs={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},Yp=new Array(Vs.NUMBER_OF_PASSES);Yp[Vs.RENDER]=Object.freeze({pass:Vs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Yp[Vs.PICK]=Object.freeze({pass:Vs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Yp[Vs.SHADOW]=Object.freeze({pass:Vs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Yp[Vs.PRELOAD]=Object.freeze({pass:Vs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.PRELOAD_FLIGHT]=Object.freeze({pass:Vs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Vs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Vs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.MOST_DETAILED_PICK]=Object.freeze({pass:Vs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Vs.getPassOptions=function(e){return Yp[e]};var Uo=Object.freeze(Vs);function lm(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(lm.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){throw new C("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new C("Empty3DTileContent cannot have group metadata")}}});lm.prototype.hasProperty=function(e,t){return!1};lm.prototype.getFeature=function(e){};lm.prototype.applyDebugSettings=function(e,t){};lm.prototype.applyStyle=function(e){};lm.prototype.update=function(e,t){};lm.prototype.pick=function(e,t,n){};lm.prototype.isDestroyed=function(){return!1};lm.prototype.destroy=function(){return de(this)};var cD=lm;function Xp(e){e=e??W.EMPTY_OBJECT;let t=e.content,n=e.class;T.typeOf.object("options.content",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Xp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Xp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Xp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Xp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Xp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Xp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Xp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Xp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var WB=Xp;function aW(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){aW._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=e.schema.classes??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new WB({content:n,class:o})}}aW._oneTimeWarning=dt;var oC=aW;function f7e(e,t){let n=e.metadataExtension;if(!c(n))return;let i=n.groups,o=ri(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 rC=f7e;function Kp(e){e=e??W.EMPTY_OBJECT;let t=e.tile,n=e.class;T.typeOf.object("options.tile",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Kp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Kp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Kp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Kp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Kp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Kp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Kp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var qB=Kp;function cW(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){cW._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=e.schema.classes??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new qB({tile:n,class:o})}}cW._oneTimeWarning=dt;var YB=cW;function d7e(e){let t=new Uint8Array(e),n=Wh(t);if(n==="glTF"&&(n="glb"),Us.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=h7e(t);if(c(i.root))return{contentType:Us.EXTERNAL_TILESET,jsonPayload:i};if(c(i.asset))return{contentType:Us.GLTF,jsonPayload:i};if(c(i.tileAvailability))return{contentType:Us.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(c(i.type))return{contentType:Us.GEOJSON,jsonPayload:i};if(c(i.voxelTable))return{contentType:Us.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function h7e(e){let t;try{t=sr(e)}catch{throw new ae("Invalid tile content.")}return t}var $g=d7e;function wf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=c(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}),l=Tc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=l}}Object.defineProperties(wf.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(){throw new C("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new C("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function lW(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function wce(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)}wf.prototype.requestInnerContents=function(){if(!m7e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;lW(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=p7e(this,n,t,this._tile._contentState);return _7e(this)};function m7e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];c(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 p7e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],l=new ir({throttle:!0,throttleByServer:!0,type:gs.TILES3D,priorityFunction:s,serverKey:a});o.request=l,e._requests[t]=l;let u=o.fetchArrayBuffer();if(c(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){wce(e,i);return}return lW(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){wce(e,i);return}lW(e,-1),vce(e,t,f)}})}async function _7e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>g7e(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(c),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function g7e(e,t,n){if(c(t))try{let i=$g(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Us.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Us.GEOMETRY||i.contentType===Us.VECTOR;let a,l=iC[i.contentType];c(i.binaryPayload)?a=await Promise.resolve(l(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(l(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=oC(o,u));let f=rC(o,u);return c(f)&&(a.group=new uA({metadata:f})),a}catch(i){vce(e,n,i)}}function vce(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=c(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}`))}wf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];c(t)&&t.cancel()}};wf.prototype.hasProperty=function(e,t){return!1};wf.prototype.getFeature=function(e){};wf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};wf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};wf.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)};wf.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 l=r[a].pick(e,t,n);if(!c(l))continue;let u=d.distance(e.origin,l);u<o&&(i=l,o=u)}if(c(i))return n};wf.prototype.isDestroyed=function(){return!1};wf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var XB=wf;var Dce=Math.cos,Pce=Math.sin,y7e=Math.sqrt,uW={};uW.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,l=e.nwCorner,u=e.boundingRectangle,f=l.latitude-e.granYCos*i+o*e.granXSin,h=Dce(f),p=Pce(f),g=a.z*p,m=l.longitude+i*e.granYSin+o*e.granXCos,y=h*Dce(m),b=h*Pce(m),x=a.x*y,A=a.y*b,E=y7e(x*y+A*b+g*p);if(r.x=x/E,r.y=A/E,r.z=g/E,n){let S=e.stNwCorner;c(S)?(f=S.latitude-e.stGranYCos*i+o*e.stGranXSin,m=S.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var b7e=new Ri,vf=new d,x7e=new he,KB=new d,lD=new Oi;function Ice(e,t,n,i,o,r,s){let a=Math.cos(t),l=i*a,u=n*a,f=Math.sin(t),h=i*f,p=n*f;lD._ellipsoid=ie.default,vf=lD.project(e,vf),vf=d.subtract(vf,KB,vf);let g=Ri.fromRotation(t,b7e);vf=Ri.multiplyByVector(g,vf,vf),vf=d.add(vf,KB,vf),e=lD.unproject(vf,e),r-=1,s-=1;let m=e.latitude,y=m+r*p,b=m-l*s,x=m-l*s+r*p,A=Math.max(m,y,b,x),E=Math.min(m,y,b,x),S=e.longitude,v=S+r*u,P=S+s*h,M=S+s*h+r*u,R=Math.max(S,v,P,M),L=Math.min(S,v,P,M);return{north:A,south:E,east:R,west:L,granYCos:l,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}uW.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,l=e.west,u=e.north,f=e.south,h=!1,p=!1;u===O.PI_OVER_TWO&&(h=!0),f===-O.PI_OVER_TWO&&(p=!0);let g,m=u-f;l>a?g=O.TWO_PI-l+a:g=a-l;let y=Math.ceil(g/t)+1,b=Math.ceil(m/t)+1,x=g/(y-1),A=m/(b-1),E=ce.northwest(e,r),S=ce.center(e,x7e);(n!==0||i!==0)&&(S.longitude<E.longitude&&(S.longitude+=O.TWO_PI),lD._ellipsoid=ie.default,KB=lD.project(S,KB));let v=A,P=x,M=0,R=0,L=ce.clone(e,o),B={granYCos:v,granYSin:M,granXCos:P,granXSin:R,nwCorner:E,boundingRectangle:L,width:y,height:b,northCap:h,southCap:p};if(n!==0){let _=Ice(E,n,x,A,S,y,b);if(u=_.north,f=_.south,a=_.east,l=_.west,u<-O.PI_OVER_TWO||u>O.PI_OVER_TWO||f<-O.PI_OVER_TWO||f>O.PI_OVER_TWO)throw new C("Rotated rectangle is invalid. It crosses over either the north or south pole.");B.granYCos=_.granYCos,B.granYSin=_.granYSin,B.granXCos=_.granXCos,B.granXSin=_.granXSin,L.north=u,L.south=f,L.east=a,L.west=l}if(i!==0){n=n-i;let _=ce.northwest(L,s),w=Ice(_,n,x,A,S,y,b);B.stGranYCos=w.granYCos,B.stGranXCos=w.granXCos,B.stGranYSin=w.granYSin,B.stGranXSin=w.granXSin,B.stNwCorner=_,B.stWest=w.west,B.stSouth=w.south}return B};var zs=uW;var T7e=new le,A7e=new le,C7e=new d,E7e=new ce;function Oce(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,l=2,u=0,f=4;r&&(l-=1,a-=1,u+=1,f-=2),s&&(l-=1,a-=1,u+=1,f-=2),u+=l*o+2*a-f;let h=new Float64Array(u*3),p=0,g=0,m,y=C7e;if(r)zs.computePosition(t,n,!1,g,0,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;else for(m=0;m<o;m++)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=o-1,g=1;g<i;g++)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;if(g=i-1,!s)for(m=o-2;m>=0;m--)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=0,g=i-2;g>0;g--)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;let b=h.length/3*2,x=Fe.createTypedArray(h.length/3,b),A=0;for(let S=0;S<h.length/3-1;S++)x[A++]=S,x[A++]=S+1;x[A++]=h.length/3-1,x[A++]=0;let E=new ct({attributes:new hn,primitiveType:Me.LINES});return E.attributes.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),E.indices=x,E}function S7e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Oce(e,t),s=t.height,a=t.width,l=si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=l.length,f=new Float64Array(u*2);f.set(l);let h=si.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,b=Fe.createTypedArray(f.length/3,y);u=f.length/6;let x=0;for(let E=0;E<u-1;E++)b[x++]=E,b[x++]=E+1,b[x++]=E+u,b[x++]=E+u+1;b[x++]=u-1,b[x++]=0,b[x++]=u+u-1,b[x++]=u,b[x++]=0,b[x++]=u;let A;if(p)A=s-1;else{let E=a-1;b[x++]=E,b[x++]=E+u,A=a+s-2}if(b[x++]=A,b[x++]=A+u,!g){let E=a+A-1;b[x++]=E,b[x]=E+u}return r.indices=b,r}function aC(e){e=e??W.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??O.RADIANS_PER_DEGREE,i=e.ellipsoid??ie.default,o=e.rotation??0;if(!c(t))throw new C("rectangle is required.");if(ce._validate(t),t.north<t.south)throw new C("options.rectangle.north must be greater than options.rectangle.south");let r=e.height??0,s=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"}aC.packedLength=ce.packedLength+ie.packedLength+5;aC.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Rce=new ce,Mce=ie.clone(ie.UNIT_SPHERE),sC={rectangle:Rce,ellipsoid:Mce,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};aC.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=ce.unpack(e,t,Rce);t+=ce.packedLength;let o=ie.unpack(e,t,Mce);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t];return c(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=l,n._offsetAttribute=u===-1?void 0:u,n):(sC.granularity=r,sC.height=s,sC.rotation=a,sC.extrudedHeight=l,sC.offsetAttribute=u===-1?void 0:u,new aC(sC))};var w7e=new he;aC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=zs.computeOptions(t,e._granularity,e._rotation,0,E7e,w7e),o,r;if(O.equalsEpsilon(t.north,t.south,O.EPSILON10)||O.equalsEpsilon(t.east,t.west,O.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,l=!O.equalsEpsilon(s,a,0,O.EPSILON2),u;if(l){if(o=S7e(e,i),c(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===Zt.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===Zt.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=le.fromRectangle3D(t,n,s,A7e),h=le.fromRectangle3D(t,n,a,T7e);r=le.union(f,h)}else{if(o=Oce(e,i),o.attributes.position.values=si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),c(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===Zt.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,s)}return new ct({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var cC=aC;function uC(e){T.typeOf.object("options",e),T.typeOf.object("options.rectangle",e.rectangle),this.rectangle=ce.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=e.ellipsoid??ie.WGS84;O7e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(uC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});uC.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Pn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var Lce=new d,$B=new d,Nce=new d,v7e=new d,D7e=new d,P7e=new d,I7e=new d,Df=new he,Fce=new sn(d.UNIT_X,0),lC=new _n;function O7e(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),Df.longitude=t.west,Df.latitude=(t.south+t.north)*.5,Df.height=0;let i=n.cartographicToCartesian(Df,P7e),o=d.cross(i,d.UNIT_Z,v7e);d.normalize(o,e.westNormal),Df.longitude=t.east;let r=n.cartographicToCartesian(Df,I7e),s=d.cross(d.UNIT_Z,r,Lce);d.normalize(s,e.eastNormal);let a=d.subtract(i,r,Lce);d.magnitude(a)===0&&(a=d.clone(o,a));let l=d.normalize(a,D7e),u=t.south,f;if(u>0){Df.longitude=(t.west+t.east)*.5,Df.latitude=u;let y=n.cartographicToCartesian(Df,lC.origin);d.clone(l,lC.direction);let b=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Fce);Qn.rayPlane(lC,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,$B)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),$B);let h=d.cross(f,a,Nce);d.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Df.longitude=(t.west+t.east)*.5,Df.latitude=p;let y=n.cartographicToCartesian(Df,lC.origin);d.negate(l,lC.direction);let b=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Fce);Qn.rayPlane(lC,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,$B)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),$B);let m=d.cross(a,g,Nce);d.normalize(m,e.northNormal)}var R7e=new d,M7e=new d,L7e=new d(0,-1,0),N7e=new d(0,0,-1),Bce=new d;function F7e(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),R7e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),M7e),f.z=f.y,f.y=f.x,f.x=0,h=L7e,g=d.UNIT_Y,p=N7e,m=d.UNIT_Z);let y=d.subtract(i,u,Bce),b=d.dot(y,h),x=d.dot(y,p),A=d.subtract(i,f,Bce),E=d.dot(A,g),S=d.dot(A,m);b>0?r+=b*b:E>0&&(r+=E*E),x>0?r+=x*x:S>0&&(r+=S*S)}let s,a,l;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,l=e.maximumHeight):(s=i.x,a=0,l=0),s>l){let u=s-l;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}uC.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=F7e(this,e);if(e.mode===oe.SCENE3D&&c(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};uC.prototype.intersectPlane=function(e){return T.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};uC.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new F.clone(F.IDENTITY),n=new cC({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new St({geometry:n,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}});return new In({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var Pf=uC;var uD={},B7e=new d,kce=new d,Uce=new d,Vce=new d,zce=new Pn;uD.validOutline=function(e){T.defined("positions",e);let n=Pn.fromPoints(e,zce).halfAxes,i=J.getColumn(n,0,kce),o=J.getColumn(n,1,Uce),r=J.getColumn(n,2,Vce),s=d.magnitude(i),a=d.magnitude(o),l=d.magnitude(r);return!(s===0&&(a===0||l===0)||a===0&&l===0)};uD.computeProjectTo2DArguments=function(e,t,n,i){T.defined("positions",e),T.defined("centerResult",t),T.defined("planeAxis1Result",n),T.defined("planeAxis2Result",i);let o=Pn.fromPoints(e,zce),r=o.halfAxes,s=J.getColumn(r,0,kce),a=J.getColumn(r,1,Uce),l=J.getColumn(r,2,Vce),u=d.magnitude(s),f=d.magnitude(a),h=d.magnitude(l),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let g,m;return(p===f||p===h)&&(g=s),p===u?g=a:p===h&&(m=a),(p===u||p===f)&&(m=l),d.normalize(g,n),d.normalize(m,i),d.clone(o.center,t),!0};function Hce(e,t,n,i,o){let r=d.subtract(e,t,B7e),s=d.dot(n,r),a=d.dot(i,r);return z.fromElements(s,a,o)}uD.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Hce(i[r],e,t,n);return o}};uD.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Hce(i,e,t,n,o)}};var Zg=uD;function k7e(e){let t=e.length,n=new Float64Array(t*3),i=Fe.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let l=e[a];n[o++]=l.x,n[o++]=l.y,n[o++]=l.z,i[r++]=a,i[r++]=(a+1)%t}let s=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:n})});return new ct({attributes:s,indices:i,primitiveType:Me.LINES})}function Rb(e){e=e??W.EMPTY_OBJECT;let t=e.polygonHierarchy;T.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,d)+1}Rb.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions}};return new Rb(t)};Rb.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var U7e={polygonHierarchy:{}};Rb.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return c(n)||(n=new Rb(U7e)),n._polygonHierarchy=i,n.packedLength=o,n};Rb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,d.equalsEpsilon,!0),n.length<3||!Zg.validOutline(n))return;let o=zn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let l=0;l<o.length;l++){let u=new St({geometry:k7e(o[l])});r.push(u)}let s=Nn.combineInstances(r)[0],a=le.fromPoints(t.positions);return new ct({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Nd=Rb;var ZB=new he;function fD(e){T.typeOf.object("options",e),T.typeOf.string("options.token",e.token);let t=_g.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ie.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=X7e(t,n,i,o);this._boundingPlanes=r;let s=Q7e(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=yW(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=d.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=yW(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=yW(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 l=t.getCenter();ZB=o.cartesianToCartographic(l,ZB),ZB.height=(i+n)/2,this.center=o.cartographicToCartesian(ZB,l),this._boundingSphere=le.fromPoints(s)}var V7e=new d,z7e=new he,H7e=new d,G7e=new he,j7e=new d,W7e=new d,q7e=new d,Y7e=new d;function X7e(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,V7e),a=i.cartesianToCartographic(r,z7e);a.height=n;let l=i.cartographicToCartesian(a,H7e),u=sn.fromPointNormal(l,s);o[0]=u;let f=0,h,p=[],g,m;for(h=0;h<4;h++){g=e.getVertex(h),p[h]=g,m=i.cartesianToCartographic(g,G7e),m.height=t;let b=sn.getPointDistance(u,i.cartographicToCartesian(m,j7e));b<f&&(f=b)}let y=sn.clone(u);for(y.normal=d.negate(y.normal,y.normal),y.distance=y.distance*-1+f,o[1]=y,h=0;h<4;h++){g=p[h];let b=p[(h+1)%4],x=i.geodeticSurfaceNormal(g,W7e),A=d.subtract(b,g,Y7e),E=d.cross(A,x,q7e);E=d.normalize(E,E),o[2+h]=sn.fromPointNormal(g,E)}return o}var Mb=new d,Lb=new d,Nb=new d,fW=new d,dW=new d,hW=new d,K7e=new d,$7e=new d,Z7e=new d,mW=new d,pW=new d,_W=new d,Qg=new d,um=new J;function Gce(e,t,n){Mb=e.normal,Lb=t.normal,Nb=n.normal,fW=d.multiplyByScalar(e.normal,-e.distance,fW),dW=d.multiplyByScalar(t.normal,-t.distance,dW),hW=d.multiplyByScalar(n.normal,-n.distance,hW),mW=d.multiplyByScalar(d.cross(Lb,Nb,K7e),d.dot(fW,Mb),mW),pW=d.multiplyByScalar(d.cross(Nb,Mb,$7e),d.dot(dW,Lb),pW),_W=d.multiplyByScalar(d.cross(Mb,Lb,Z7e),d.dot(hW,Nb),_W),um[0]=Mb.x,um[1]=Lb.x,um[2]=Nb.x,um[3]=Mb.y,um[4]=Lb.y,um[5]=Nb.y,um[6]=Mb.z,um[7]=Lb.z,um[8]=Nb.z;let i=J.determinant(um);return Qg=d.add(mW,pW,Qg),Qg=d.add(Qg,_W,Qg),new d(Qg.x/i,Qg.y/i,Qg.z/i)}function Q7e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Gce(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Gce(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var gW=new d,fC=new d;function yW(e,t){let n=[];for(let i=0;i<4;i++)gW=d.subtract(t[(i+1)%4],t[i],gW),fC=d.cross(e.normal,gW,fC),fC=d.normalize(fC,fC),n[i]=d.clone(fC);return n}Object.defineProperties(fD.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var bW=new d;fD.prototype.distanceToCamera=function(e){T.defined("frameState",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,l;if(n.length===1)return l=this._boundingPlanes[n[0]],a=xW(sn.projectPointOntoPlane(l,t,bW),i[0],l,o),d.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=jce(t,p[0],p[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)l=this._boundingPlanes[n[r]],a=xW(sn.projectPointOntoPlane(l,t,bW),i[r],l,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return a=xW(sn.projectPointOntoPlane(this._boundingPlanes[1],t,bW),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var J7e=new d,eYe=new d;function jce(e,t,n){let i=d.subtract(n,t,J7e),o=d.subtract(e,t,eYe),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var tYe=new sn(d.UNIT_X,0);function xW(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let l=0;l<t.length;l++){let u=sn.fromPointNormal(t[l],i[l],tYe);sn.getPointDistance(u,e)<0||(a=jce(e,t[l],t[(l+1)%4]),r=d.distance(e,a),r<o&&(o=r,s=a))}return c(s)?s:e}fD.prototype.intersectPlane=function(e){T.defined("plane",e);let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Wt.INSIDE:n===this._vertices.length?Wt.OUTSIDE:Wt.INTERSECTING};fD.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new F.clone(F.IDENTITY),n=new Nd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Nd.createGeometry(n),o=new St({geometry:i,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}}),r=new Nd({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Nd.createGeometry(r),a=new St({geometry:s,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}}),l=[];for(let u=0;u<4;u++){let f=new Nd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Nd.createGeometry(f);l[u]=new St({geometry:h,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}})}return new In({geometryInstances:[l[0],l[1],l[2],l[3],a,o],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var QB=fD;var nYe=new d(1,1,1),JB=Math.cos,e3=Math.sin;function dC(e){e=e??W.EMPTY_OBJECT;let t=e.radii??nYe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??O.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??O.PI,a=Math.round(e.stackPartitions??10),l=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);if(a<1)throw new C("options.stackPartitions cannot be less than 1");if(l<0)throw new C("options.slicePartitions cannot be less than 0");if(u<0)throw new C("options.subdivisions must be greater than or equal to zero.");if(c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}dC.packedLength=2*d.packedLength+8;dC.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.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]=e._offsetAttribute??-1,t};var Wce=new d,qce=new d,$p={radii:Wce,innerRadii:qce,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};dC.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=d.unpack(e,t,Wce);t+=d.packedLength;let o=d.unpack(e,t,qce);t+=d.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=l,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):($p.minimumClock=r,$p.maximumClock=s,$p.minimumCone=a,$p.maximumCone=l,$p.stackPartitions=u,$p.slicePartitions=f,$p.subdivisions=h,$p.offsetAttribute=p===-1?void 0:p,new dC($p))};dC.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,l=ie.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/O.TWO_PI),f=Math.round(f*Math.abs(s-r)/O.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,r>0&&(m=!0,h+=u),s<Math.PI&&(y=!0,h+=u));let b=a*p*(f+u),x=new Float64Array(b*3),A=2*(b+h-(u+f)*p),E=Fe.createTypedArray(b,A),S,v,P,M,R=0,L=new Array(f),B=new Array(f);for(S=0;S<f;S++)M=r+S*(s-r)/(f-1),L[S]=e3(M),B[S]=JB(M);let _=new Array(a),w=new Array(a);for(S=0;S<a;S++)P=i+S*(o-i)/(a-1),_[S]=e3(P),w[S]=JB(P);for(S=0;S<f;S++)for(v=0;v<a;v++)x[R++]=t.x*L[S]*w[v],x[R++]=t.y*L[S]*_[v],x[R++]=t.z*B[S];if(g)for(S=0;S<f;S++)for(v=0;v<a;v++)x[R++]=n.x*L[S]*w[v],x[R++]=n.y*L[S]*_[v],x[R++]=n.z*B[S];for(L.length=a,B.length=a,S=0;S<a;S++)M=r+S*(s-r)/(a-1),L[S]=e3(M),B[S]=JB(M);for(_.length=u,w.length=u,S=0;S<u;S++)P=i+S*(o-i)/(u-1),_[S]=e3(P),w[S]=JB(P);for(S=0;S<a;S++)for(v=0;v<u;v++)x[R++]=t.x*L[S]*w[v],x[R++]=t.y*L[S]*_[v],x[R++]=t.z*B[S];if(g)for(S=0;S<a;S++)for(v=0;v<u;v++)x[R++]=n.x*L[S]*w[v],x[R++]=n.y*L[S]*_[v],x[R++]=n.z*B[S];for(R=0,S=0;S<f*p;S++){let N=S*a;for(v=0;v<a-1;v++)E[R++]=N+v,E[R++]=N+v+1}let D=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)E[R++]=D+S+v*u,E[R++]=D+S+(v+1)*u;if(g)for(D=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)E[R++]=D+S+v*u,E[R++]=D+S+(v+1)*u;if(g){let N=f*a*p,k=N+a*u;if(m)for(S=0;S<u;S++)E[R++]=N+S,E[R++]=k+S;if(y)for(N+=a*u-u,k+=a*u-u,S=0;S<u;S++)E[R++]=N+S,E[R++]=k+S}let I=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:x})});if(c(e._offsetAttribute)){let N=x.length,k=e._offsetAttribute===Zt.NONE?0:1,H=new Uint8Array(N/3).fill(k);I.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}return new ct({attributes:I,indices:E,primitiveType:Me.LINES,boundingSphere:le.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})};var If=dC;function hC(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new If(i),this._workerName="createSphereOutlineGeometry"}hC.packedLength=If.packedLength;hC.pack=function(e,t,n){return T.typeOf.object("value",e),If.pack(e._ellipsoidGeometry,t,n)};var iYe=new If,Fb={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};hC.unpack=function(e,t,n){let i=If.unpack(e,t,iYe);return Fb.stackPartitions=i._stackPartitions,Fb.slicePartitions=i._slicePartitions,Fb.subdivisions=i._subdivisions,c(n)?(d.clone(i._radii,Fb.radii),n._ellipsoidGeometry=new If(Fb),n):(Fb.radius=i._radii.x,new hC(Fb))};hC.createGeometry=function(e){return If.createGeometry(e._ellipsoidGeometry)};var Jg=hC;function mC(e,t){t===0&&(t=O.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(mC.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}}});mC.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};mC.prototype.intersectPlane=function(e){return T.defined("plane",e),le.intersectPlane(this._boundingSphere,e)};mC.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};mC.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new Jg({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:jt.fromColor(e)}});return new In({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var ey=mC;var oYe=new d,rYe=new d,sYe=new d,aYe=new d;function Bb(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,O.EPSILON7/i,n)}function TW(e,t){let n=d.normalize(e,aYe),i=d.equalsEpsilon(n,d.UNIT_X,O.EPSILON6)?d.UNIT_Y:d.UNIT_X;return Bb(e,i,t)}function Yce(e){let t=J.getColumn(e,0,oYe),n=J.getColumn(e,1,rYe),i=J.getColumn(e,2,sYe),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),s=d.equals(i,d.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=O.EPSILON7,e[4]=O.EPSILON7,e[8]=O.EPSILON7,e):(o&&!r&&!s?t=Bb(n,i,t):!o&&r&&!s?n=Bb(t,i,n):!o&&!r&&s?i=Bb(n,t,i):o?r?s||(t=TW(i,t),n=Bb(i,t,n)):(t=TW(n,t),i=Bb(n,t,i)):(n=TW(t,n),i=Bb(n,t,i)),J.setColumn(e,0,t,e),J.setColumn(e,1,n,e),J.setColumn(e,2,i,e),e)}function pC(e,t){t=Yce(t),this._orientedBoundingBox=new Pn(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(pC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});pC.prototype.distanceToCamera=function(e){return T.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};pC.prototype.intersectPlane=function(e){return T.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};pC.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=Yce(t),J.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};pC.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new Mh({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:jt.fromColor(e)}});return new In({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var fu=pC;function Zo(e,t,n,i){this._tileset=e,this._header=n;let o=c(n.contents),r=o&&n.contents.length>1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=c(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=c(i)?i.computedTransform:e.modelMatrix,l=F.multiply(a,this.transform,new F),u=c(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=l,this.metadata=YB(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,l),this._boundingVolume2D=void 0;let f;c(s)&&c(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,l)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;c(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,l)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,c(this._geometricError)||(this._geometricError=c(i)?i._geometricError:e._geometricError,Zo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;c(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Yo.REPLACE:Yo.ADD):c(i)?p=i.refine:p=Yo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,b,x;if(t=we.createIfNeeded(t),r)y=$o.UNLOADED,b=t.clone();else if(c(s)){let v=s.uri;c(s.url)&&(Zo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Zo._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 cD(e,this),m=!0,y=$o.READY):(y=$o.UNLOADED,b=t.getDerivedResource({url:v}),x=Tc.getServerKey(b.getUrlComponent()))}else g=new cD(e,this),m=!0,y=$o.READY;this._content=g,this._contentResource=b,this._contentState=y,this._expiredContent=void 0,this._serverKey=x,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let A=n.expire,E,S;c(A)&&(E=A.duration,c(A.date)&&(S=Q.fromIso8601(A.date))),this.expireDuration=E,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=Ld.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=G.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}Zo._deprecationWarning=Ns;Object.defineProperties(Zo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 c(this._color)||(this._color=new G),G.clone(this._color)},set:function(e){this._color=G.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||c(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===$o.READY}},contentUnloaded:{get:function(){return this._contentState===$o.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===$o.EXPIRED}},contentFailed:{get:function(){return this._contentState===$o.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ty=new d;function cYe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,ty),l=d.add(s.positionWC,a,ty),u=d.subtract(l,r,ty);if(d.magnitude(u)>o){let S=d.normalize(u,ty),v=d.multiplyByScalar(S,o,ty),P=d.add(r,v,ty),M=d.subtract(P,s.positionWC,ty),R=d.normalize(M,ty);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Yo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Uo.PRELOAD_FLIGHT||n._pass===Uo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let b=m-y,x=O.clamp((e._foveatedFactor-y)/b,0,1),A=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,x),E=e._screenSpaceError===0&&c(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-A<=E}var Qce=new Q;Zo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=c(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:l}=e,u=a.frustum,f=l.drawingBufferWidth,h=l.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof on){let g=u.offCenterFrustum;c(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=s/m}else{let g=Math.max(this._distanceToCamera,O.EPSILON7),m=u.sseDenominator;if(p=s*h/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,x=O.fog(g,y)*b;p-=x}}return p/=e.pixelRatio,p};function lYe(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=c(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function uYe(e,t){let n=t.parent,o=c(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Zo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=c(t)?t.computedTransform:n.modelMatrix,o=c(t)?t._visibilityPlaneMask:ys.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!==ys.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=uYe(n,this),this._priorityProgressiveResolution=lYe(n,this),this.priorityDeferred=cYe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zo.prototype.updateExpiration=function(){if(c(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(Qce);Q.lessThan(this.expireDate,e)&&(this._contentState=$o.EXPIRED,this._expiredContent=this._content)}};function fYe(e){if(!c(e.expireDuration))return;let t=Q.now(Qce);Q.addSeconds(t,e.expireDuration,t),c(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function dYe(e){return function(){return e._priority}}Zo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?hYe(this):pYe(this)};function hYe(e){let t=e._content,n=e._tileset;if(!c(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new XB(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(c(i))return e._contentState=$o.LOADING,i.then(o=>{if(!e.isDestroyed()&&c(o))return e._contentState=$o.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=$o.FAILED,o})}async function mYe(e,t,n,i,o){let r=e._contentState;e._contentState=$o.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=$o.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await _Ye(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=$o.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=$o.FAILED,a}}function pYe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new ir({throttle:!0,throttleByServer:!0,type:gs.TILES3D,priorityFunction:dYe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!c(r)){++o.statistics.numberOfAttemptedRequests;return}return mYe(e,o,i,n,r)}async function _Ye(e,t){let n=$g(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Us.GEOMETRY||n.contentType===Us.VECTOR,(n.contentType===Us.IMPLICIT_SUBTREE||n.contentType===Us.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Us.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=iC[n.contentType];if(e.isDestroyed())return;c(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 l=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=l.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=oC(i,s));let a=rC(i,s);return c(a)&&(o.group=new uA({metadata:a})),o}Zo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=$o.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 Jce=new le;function CW(e,t){if(t.mode!==oe.SCENE3D&&!c(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Jce);e._boundingVolume2D=new ey(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function gYe(e,t){if(t.mode!==oe.SCENE3D&&!c(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Jce);e._contentBoundingVolume2D=new ey(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=CW(this,e),o=this._tileset,r=o.clippingPlanes;if(c(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Wt.INSIDE,a===Wt.OUTSIDE)return ys.MASK_OUTSIDE}let s=o.clippingPolygons;if(c(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Wt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zo.prototype.contentVisibility=function(e){if(!c(this._contentBoundingVolume))return Wt.INSIDE;if(this._visibilityPlaneMask===ys.MASK_INSIDE)return Wt.INSIDE;let t=e.cullingVolume,n=gYe(this,e),i=this._tileset,o=i.clippingPlanes;if(c(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Wt.INSIDE,s===Wt.OUTSIDE)return Wt.OUTSIDE}let r=i.clippingPolygons;if(c(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Wt.OUTSIDE,s===Wt.INSIDE)return Wt.OUTSIDE}return t.computeVisibility(n)};Zo.prototype.distanceToTile=function(e){return CW(this,e).distanceToCamera(e)};var yYe=new d;Zo.prototype.distanceToTileCenter=function(e){let n=CW(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,yYe);return d.dot(e.camera.directionWC,i)};Zo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!c(t)||t.distanceToCamera(e)===0};var ele=new J,tle=new d,bYe=new J,EW=new d,nle=new ce,ile=new Pn,AW=new F;function xYe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],EW),o=J.fromArray(e,3,bYe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,ele);return o=J.multiply(r,o,o),c(n)?(n.update(i,o),n):new fu(i,o)}function Xce(e,t,n,i){let o=ce.unpack(e,0,nle),r=e[4],s=e[5],a=Pn.fromRectangle(o,r,s,ie.WGS84,ile),l=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,AW),AW),l=F.multiplyByPoint(t,l,l);let f=F.getMatrix3(t,ele);return u=J.multiply(f,u,u),c(i)&&i instanceof fu?(i.update(l,u),i):new fu(l,u)}function TYe(e,t,n,i){if(!F.equalsEpsilon(t,n,O.EPSILON8))return i instanceof fu?Xce(e,t,n,i):Xce(e,t,n,void 0);let o=ce.unpack(e,0,nle);return i instanceof Pf?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ie.WGS84),i):new Pf({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function AYe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],EW),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,tle),s=d.maximumComponent(r);return o*=s,c(n)?(n.update(i,o),n):new ey(i,o)}Zo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(c(i)&&(o=CA.parseBoundingVolumeSemantic("TILE",i)),c(o)&&(e=o),!c(e))throw new ae("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new QB(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(c(r)){let l=xYe(r,t,n);return this._verticalExaggeration!==1&&Kce(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l}if(c(s)){let l=TYe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(l instanceof fu?Kce(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(l.minimumHeight=Rr.getHeight(l.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.maximumHeight=Rr.getHeight(l.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.computeBoundingVolumes(ie.WGS84))),l}if(c(a)){let l=AYe(a,t,n);if(this._verticalExaggeration!==1){let u=Rr.getPosition(l.center,ie.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,EW),f=l.radius*this._verticalExaggeration;l.update(u,f)}return l}throw new ae("boundingVolume must contain a sphere, region, or box")};var CYe=d.unpackArray(new Array(8*3).fill(0));function Kce(e,t,n){let i=e.boundingVolume.computeCorners(CYe).map(r=>Rr.getPosition(r,ie.WGS84,t,n,r)),o=Pn.fromPoints(i,ile);e.update(o.center,o.halfAxes)}Zo.prototype.updateTransform=function(e,t){e=e??F.IDENTITY;let n=F.multiplyTransformation(e,this.transform,AW),i=!F.equals(n,this.computedTransform),o=c(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.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),c(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),c(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()};Zo.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,tle),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!c(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function EYe(e,t,n,i){if(!i.isRender)return;let o=c(e._contentHeader)&&c(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let l;e._finalResolution?e.hasRenderableContent?l=G.WHITE:l=G.DARKGRAY:l=G.YELLOW,c(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(l)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=jt.toValue(l,u.color)}else!r&&c(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(c(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(G.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&c(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&c(e._viewerRequestVolume)?(c(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(G.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&c(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||c(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=G.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function SYe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&c(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(c(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=$o.FAILED,o}}function wYe(e,t){let n=t.clippingPlanes,i=0;c(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function vYe(e,t){let n=t.clippingPolygons,i=0;c(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}Zo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;wYe(this,e),vYe(this,e),EYe(this,e,t,n),SYe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],l=a.pass===De.TRANSLUCENT;a.depthForTranslucentClassification=l}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var $ce=[];Zo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(fYe(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=$o.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=$ce;try{this._content.update(e,t)}catch(i){throw this._contentState=$o.FAILED,i}$ce.length=0,t.commandList=n};function Zce(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function t3(e,t,n){return Math.max(O.normalize(e,t,n)-O.EPSILON7,0)}Zo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,l=s+a,u=o,f=l+u,h=r,p=Math.pow(10,f),g=f+h,m=r,y=Math.pow(10,g),b=g+m,x=Math.pow(10,b),A=t3(this._depth,n.depth,i.depth);A=t?1-A:A;let S=!e.isSkippingLevelOfDetail&&this.refine===Yo.REPLACE?t3(this._priorityHolder._distanceToCamera,n.distance,i.distance):t3(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Zce(S,a,s),P=this._priorityProgressiveResolution?0:p,M=t3(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Zce(M,u,l),L=this.priorityDeferred?y:0,B=e._pass===Uo.PRELOAD_FLIGHT?0:x;this._priority=A+v+P+R+L+B};Zo.prototype.isDestroyed=function(){return!1};Zo.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(),de(this)};var Fd=Zo;function Zp(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class;T.typeOf.object("options.group",n),T.typeOf.object("options.class",i);let o=c(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Zp.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}}});Zp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Zp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Zp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Zp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Zp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Zp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Zp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var dD=Zp;function Qp(e){e=e??W.EMPTY_OBJECT;let t=e.tileset,n=e.class;T.typeOf.object("options.tileset",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Qp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Qp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Qp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Qp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var n3=Qp;function ole(e){e=e??W.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema;T.typeOf.object("options.metadataJson",t),T.typeOf.object("options.schema",n);let i=t.metadata??t.tileset,o;c(i)&&(o=new n3({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let l=a.length;for(let u=0;u<l;u++){let f=a[u];s.push(new dD({group:f,class:n.classes[f.class]}))}}else if(c(a)){r=Object.keys(a).sort();let l=r.length;for(let u=0;u<l;u++){let f=r[u];if(a.hasOwnProperty(f)){let h=a[f];s.push(new dD({id:f,group:a[f],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(ole.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 _C=ole;var rle={},DYe=new d;rle.checkChildrenWithinParent=function(e){T.typeOf.object("tile",e);let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof fu||i instanceof Pf){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Ld.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof fu||a instanceof Pf)){e._optimChildrenWithinParent=Ld.SKIP_OPTIMIZATION;break}let l=a._orientedBoundingBox,u=d.subtract(l.center,o.center,DYe),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(l.halfAxes[0]*u.x)+Math.abs(l.halfAxes[1]*u.y)+Math.abs(l.halfAxes[2]*u.z)+Math.abs(l.halfAxes[3]*u.x)+Math.abs(l.halfAxes[4]*u.y)+Math.abs(l.halfAxes[5]*u.z)+Math.abs(l.halfAxes[6]*u.x)+Math.abs(l.halfAxes[7]*u.y)+Math.abs(l.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=Ld.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Ld.USE_OPTIMIZATION};var i3=rle;function hD(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(hD.prototype,{length:{get:function(){return this._length}}});function PYe(e,t,n){this.item=e,this.previous=t,this.next=n}hD.prototype.add=function(e){let t=new PYe(e,this.tail,void 0);return c(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function sle(e,t){c(t.previous)&&c(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):c(t.previous)?(t.previous.next=void 0,e.tail=t.previous):c(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}hD.prototype.remove=function(e){c(e)&&(sle(this,e),--this._length)};hD.prototype.splice=function(e,t){if(e===t)return;sle(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 o3=hD;function kb(){this._list=new o3,this._sentinel=this._list.add(),this._trimTiles=!1}kb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};kb.prototype.touch=function(e){let t=e.cacheNode;c(t)&&this._list.splice(this._sentinel,t)};kb.prototype.add=function(e){c(e.cacheNode)||(e.cacheNode=this._list.add(e))};kb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;c(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};kb.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)}};kb.prototype.trim=function(){this._trimTiles=!0};var r3=kb;function s3(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 wW(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}s3.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=wW(e,n),this._referenceMaximum[n]=wW(t,n)};function IYe(e,t){let n=e.tilePropertyName;if(c(n)){let i=wW(t[n],n);return c(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var SW=[new G(.1,.1,.1,1),new G(.153,.278,.878,1),new G(.827,.231,.49,1),new G(.827,.188,.22,1),new G(1,.592,.259,1),new G(1,.843,0,1)];s3.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!c(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=IYe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+O.EPSILON7,l=O.clamp(i-o,0,s)/s,u=SW.length-1,f=l*u,h=Math.floor(f),p=Math.ceil(f),g=f-h,m=SW[h],y=SW[p],b=G.clone(G.WHITE);b.red=O.lerp(m.red,y.red,g),b.green=O.lerp(m.green,y.green,g),b.blue=O.lerp(m.blue,y.blue,g),e._debugColor=b};s3.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(c(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=c(t)&&c(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var a3=s3;function gC(){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}gC.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};gC.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};gC.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof bf))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};gC.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof bf))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};gC.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 fm=gC;function mD(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(mD.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});mD.prototype.makeDirty=function(){this._styleDirty=!0};mD.prototype.resetDirty=function(){this._styleDirty=!1};mD.prototype.applyStyle=function(e){if(!c(e.root)||c(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 l=a.content;a.lastStyleTime=n,l.applyStyle(this._style),i.numberOfFeaturesStyled+=l.featuresLength,++i.numberOfTilesStyled}}};var c3=mD;function OYe(e,t,n){let i=ri(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;T.typeOf.object("implicitTiling",i),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!c(o.box)&&!c(o.region)&&!ri(o,"3DTILES_bounding_volume_S2")&&!ri(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 we({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=RYe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(We(a,!0));let l=new we({url:a.uri});this.contentUriTemplates.push(l)}this.contentCount=this.contentHeaders.length,this.tileHeader=MYe(t),this.subdivisionScheme=cr[i.subdivisionScheme],this.branchingFactor=cr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,c(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function RYe(e){if(ri(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return c(t.contents)?t.contents:t.content}return c(e.contents)?e.contents:c(e.content)?[e.content]:[]}function MYe(e){let t=We(e,!0);return c(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 yC=OYe;var pD={};function ale(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function vW(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function cle(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 DW(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}pD.encode2D=function(e,t){if(T.typeOf.number("x",e),T.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new C("inputs must be 16-bit unsigned integers");return(ale(e)|ale(t)<<1)>>>0};pD.decode2D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new C("input must be a 32-bit unsigned integer");return c(t)||(t=new Array(2)),t[0]=cle(e),t[1]=cle(e>>1),t};pD.encode3D=function(e,t,n){if(T.typeOf.number("x",e),T.typeOf.number("y",t),T.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new C("inputs must be 10-bit unsigned integers");return vW(e)|vW(t)<<1|vW(n)<<2};pD.decode3D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new C("input must be a 30-bit unsigned integer");return c(t)||(t=new Array(3)),t[0]=DW(e),t[1]=DW(e>>1),t[2]=DW(e>>2),t};var Ub=pD;function Vo(e){if(T.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),T.typeOf.number("options.subtreeLevels",e.subtreeLevels),T.typeOf.number("options.level",e.level),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),e.subdivisionScheme===cr.OCTREE&&T.typeOf.number("options.z",e.z),e.level<0)throw new C("level must be non-negative");if(e.x<0)throw new C("x must be non-negative");if(e.y<0)throw new C("y must be non-negative");if(e.subdivisionScheme===cr.OCTREE&&e.z<0)throw new C("z must be non-negative");let t=1<<e.level;if(e.x>=t)throw new C("x is out of range");if(e.y>=t)throw new C("y is out of range");if(e.subdivisionScheme===cr.OCTREE&&e.z>=t)throw new C("z is out of range");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===cr.OCTREE&&(this.z=e.z)}Object.defineProperties(Vo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===cr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===cr.OCTREE?Ub.encode3D(this.x,this.y,this.z):Ub.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===cr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});function PW(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new C("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new C("coordinates must have same subtreeLevels")}Vo.prototype.getDescendantCoordinates=function(e){T.typeOf.object("offsetCoordinates",e),PW(this,e);let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===cr.OCTREE){let o=(this.z<<e.level)+e.z;return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Vo.prototype.getAncestorCoordinates=function(e){if(T.typeOf.number("offsetLevels",e),e<0)throw new C("offsetLevels must be non-negative");if(e>this.level)throw new C("ancestor cannot be above the tileset root");let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===cr.OCTREE){let r=Math.floor(this.z/t);return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Vo.prototype.getOffsetCoordinates=function(e){if(T.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new C("this is not an ancestor of descendant");PW(this,e);let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===cr.OCTREE){let r=e.z%n;return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Vo.prototype.getChildCoordinates=function(e){T.typeOf.number("childIndex",e);let t=cr.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new C(`childIndex must be at least 0 and less than ${t}`);let n=this.level+1,i=2*this.x+e%2,o=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===cr.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Vo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Vo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Vo.prototype.isAncestor=function(e){T.typeOf.object("descendantCoordinates",e),PW(this,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===cr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Vo.prototype.isEqual=function(e){return T.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===cr.OCTREE?this.z===e.z:!0)};Vo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Vo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Vo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Vo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===cr.OCTREE&&(e.z=this.z),e};var lle=[0,0,0];Vo.fromMortonIndex=function(e,t,n,i){let o;return e===cr.OCTREE?(o=Ub.decode3D(i,lle),new Vo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Ub.decode2D(i,lle),new Vo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Vo.fromTileIndex=function(e,t,n){let i,o,r;return e===cr.OCTREE?(i=Math.floor(O.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(O.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Vo.fromMortonIndex(e,t,i,r)};var bC=Vo;function Jp(){}Jp.selectTiles=function(e,t){C.throwInstantiationError()};Jp.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Jp.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Jp.selectTile=function(e,t){if(e.contentVisibility(t)===Wt.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)};Jp.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Jp.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Jp.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!LYe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function LYe(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}Jp.updateTile=function(e,t){ule(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,BYe(e),e._shouldSelect=!1,e._finalResolution=!0};function ule(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];ule(r,t),e._visible=r._visible;return}if(NYe(e,t)){e._visible=!1;return}let i=e.refine===Yo.REPLACE,o=e._optimChildrenWithinParent===Ld.USE_OPTIMIZATION;if(i&&o&&n&&!FYe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function NYe(e,t){let{parent:n,tileset:i}=e;return!c(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Yo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function FYe(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 BYe(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 ca=Jp;function fle(){}var _D={stack:new xl,stackMaximumLength:0};fle.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}=ca,s=_D.stack;for(s.push(i);s.length>0;){_D.stackMaximumLength=Math.max(_D.stackMaximumLength,s.length);let a=s.pop(),l=a.refine===Yo.ADD,u=a.refine===Yo.REPLACE,f=kYe(a);f&&UYe(a,s,t),(l||u&&!f)&&(VYe(e,a),o(a,t),zYe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return _D.stack.trim(_D.stackMaximumLength),n};function kYe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function UYe(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 VYe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function zYe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Wt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var l3=fle;function dle(){}var gD={stack:new xl,stackMaximumLength:0},yD={stack:new xl,stackMaximumLength:0};dle.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(ca.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;GYe(n,t),gD.stack.trim(gD.stackMaximumLength),yD.stack.trim(yD.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function IW(e,t){e.contentAvailable&&ca.selectTile(e,t)}function HYe(e,t,n){let i=e.refine===Yo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:l}=ca;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(ca.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let y=r[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),h=!0):(u||o.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),l(y,n)),u){let b;y._inRequestVolume?y.hasRenderableContent?b=y.contentAvailable:b=jYe(y,n):b=!1,f=f&&b}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=y}return f}function GYe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=ca,a=gD.stack;for(a.push(e);a.length>0;){gD.stackMaximumLength=Math.max(gD.stackMaximumLength,a.length);let l=a.pop(),u=l.parent,f=!c(u)||u._refines;l._refines=i(l)?HYe(l,a,t)&&f:!1;let h=!l._refines&&f;l.hasRenderableContent?l.refine===Yo.ADD?(IW(l,t),o(l,t)):l.refine===Yo.REPLACE&&(o(l,t),h&&IW(l,t)):(n._emptyTiles.push(l),o(l,t),h&&IW(l,t)),r(l,t),s(l,t)}}function jYe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=ca,s=!0,a=yD.stack;for(a.push(e);a.length>0;){yD.stackMaximumLength=Math.max(yD.stackMaximumLength,a.length);let l=a.pop(),u=l.children,f=u.length,h=!l.hasRenderableContent&&n(l);if(!h&&!l.contentAvailable&&(s=!1),i(l,t),l.isVisible||(o(l,t),r(l,t)),h)for(let p=0;p<f;++p){let g=u[p];a.push(g)}}return e.hasEmptyContent||s}var u3=dle;function hle(){}var bD={stack:new xl,stackMaximumLength:0},xD={stack:new xl,stackMaximumLength:0},e_={stack:new xl,stackMaximumLength:0,ancestorStack:new xl,ancestorStackMaximumLength:0},WYe=2;hle.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(ca.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;ZYe(n,t),QYe(n,t),bD.stack.trim(bD.stackMaximumLength),xD.stack.trim(xD.stackMaximumLength),e_.stack.trim(e_.stackMaximumLength),e_.ancestorStack.trim(e_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function qYe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=ca,r=xD.stack;for(r.push(e);r.length>0;){xD.stackMaximumLength=Math.max(xD.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;l<a.length;++l){let u=a[l];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<WYe&&r.push(u))}}}function f3(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;c(n)?n._shouldSelect=!0:qYe(e,t)}function YYe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!c(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function XYe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||c(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function KYe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=ca;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(ca.sortChildrenByDistanceToCamera);let l=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),l=!0):i.loadSiblings&&(s(f,n),a(f,n))}return l}function $Ye(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:c(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function ZYe(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}=ca,l=bD.stack;for(l.push(e);l.length>0;){bD.stackMaximumLength=Math.max(bD.stackMaximumLength,l.length);let u=l.pop();YYe(u,t);let f=u.parent,h=!c(f)||f._refines;u._refines=o(u)?KYe(u,l,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===Yo.ADD?(f3(u,t),r(u,t)):u.refine===Yo.REPLACE&&($Ye(u,i)?(r(u,t),p&&f3(u,t)):p?(f3(u,t),r(u,t)):XYe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&f3(u,t)),s(u,t),a(u,t)}}function QYe(e,t){let{selectTile:n,canTraverse:i}=ca,{stack:o,ancestorStack:r}=e_,s;for(o.push(e);o.length>0||r.length>0;){if(e_.stackMaximumLength=Math.max(e_.stackMaximumLength,o.length),e_.ancestorStackMaximumLength=Math.max(e_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!c(a))continue;let l=i(a);if(a._shouldSelect)if(a.refine===Yo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!l){n(a,t);continue}r.push(a),a._stackLength=o.length}if(l){let u=a.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var d3=hle;function Qo(e){e=e??W.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 r3,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new xl,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024,T.typeOf.number.greaterThanOrEquals("cacheBytes",this._cacheBytes,0);let t=e.maximumCacheOverflowBytes??512*1024*1024;T.typeOf.number.greaterThanOrEquals("maximumCacheOverflowBytes",t,0),this._maximumCacheOverflowBytes=t,this._styleEngine=new c3,this._styleApplied=!1,this._modelMatrix=c(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new fm,this._statisticsLast=new fm,this._statisticsPerPass=new Array(Uo.NUMBER_OF_PASSES);for(let o=0;o<Uo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new fm;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 a3(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=O.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=e.ellipsoid??ie.WGS84,this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??O.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Tn.ENABLED,this.show=e.show??!0,this.colorBlendMode=nu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Mp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Ng,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe,this.tileLoad=new pe,this.tileUnload=new pe,this.tileFailed=new pe,this.tileVisible=new pe,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,c(e.clippingPlanes)&&xs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,c(e.clippingPolygons)&&Zh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),c(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new lA,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Og(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this.splitDirection=e.splitDirection??qr.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&dt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(Qo.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){xs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zh.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 Ns("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){T.typeOf.bool("value",e),this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!c(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){T.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){T.defined("pointCloudShading",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=F.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 c(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.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){T.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),T.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){T.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),T.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",this._imageBasedLighting),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,Tle(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),T.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),T.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}});Qo.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await uf.fromAssetId(e);return Qo.fromUrl(n,t)};Qo.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await Qo.loadJson(n),r=await JYe(n,o),s=new Qo(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,Tle(s);let l=c(o.asset.gltfUpAxis)?Fo.fromName(o.asset.gltfUpAxis):Fo.Y,u=t.modelUpAxis??l,f=t.modelForwardAxis??Fo.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return c(g)&&g.height>fi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ot.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};Qo.loadJson=function(e){return we.createIfNeeded(e).fetchJson()};Qo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};Qo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!c(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");c(t.extensionsRequired)&&Qo.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;c(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=mle(this,e,t.root,n);c(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let l=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===Yo.ADD;let u=l._header.children;if(c(u))for(let f=0;f<u.length;++f){let h=u[f],p=mle(this,e,h,l);l.children.push(p),p._depth=l._depth+1,a.push(p)}this._cullWithChildrenBounds&&i3.checkChildrenWithinParent(l)}return s};function mle(e,t,n,i){if(!(c(n.implicitTiling)||ri(n,"3DTILES_implicit_tiling")))return new Fd(e,t,n,i);let r=e.schema,s=new yC(t,n,r),a=new bC({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),l=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=We(n,!0);f.contents=[{uri:l}],delete f.content,delete f.extensions;let h=new Fd(e,t,f,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function JYe(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(c(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Di.getSchemaLoader({resource:e});else if(c(n.schema))i=Di.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new _C({schema:i.schema,metadataJson:n});return Di.unload(i),o}var ple=new d,eXe=new he,tXe=new F,nXe=new d,iXe=new d,oXe=new d,rXe=new d;function sXe(e,t){let n,i,o,r,s,a=t.camera,l=e._root,u=l.contentBoundingVolume;if(u instanceof Pf)n=d.normalize(a.positionWC,ple),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let y=F.inverseTransformation(l.computedTransform,tXe),b=t.mapProjection.ellipsoid,x=u.boundingVolume,A=F.multiplyByPoint(y,x.center,nXe);if(d.magnitude(A)>b.minimumRadius){let E=he.fromCartesian(A,b,eXe);n=d.normalize(a.positionWC,ple),i=a.directionWC,o=a.positionCartographic.height,r=0,s=E.height*2}else{let E=F.multiplyByPoint(y,a.positionWC,iXe);if(n=d.UNIT_Z,i=F.multiplyByPointAsVector(y,a.directionWC,oXe),i=d.normalize(i,i),o=E.z,u instanceof fu){let S=J.getColumn(x.halfAxes,2,rXe),v=d.magnitude(S);r=A.z-v,s=A.z+v}else if(u instanceof ey){let S=x.radius;r=A.z-S,s=A.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,p=s,g=O.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function aXe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();c(o)&&(o.then(r=>{!c(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{yle(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?TXe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function gle(e,t){return e._priority-t._priority}Qo.prototype.postPassesUpdate=function(e){c(this._root)&&(cXe(this,e),CXe(this,e),this._cache.unloadTiles(this,xle),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};Qo.prototype.prePassesUpdate=function(e){if(!c(this._root))return;pXe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,c(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;c(n)&&n.enabled&&n.update(e),c(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&sXe(this,e),e.newFrame&&this._cache.reset()};function cXe(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!==$o.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function lXe(e){let t=e._requestedTiles;t.sort(gle);for(let n=0;n<t.length;++n)aXe(e,t[n])}function yle(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=c(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 uXe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==$o.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var fXe=new he,dXe=new he,hXe=new d;function mXe(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,fXe),l=he.fromCartesian(o.center,s,dXe);c(l)&&(a.height=l.height);let u=he.toCartesian(a,s,hXe);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{c(r.callback)&&r.callback(),r.invoked=!1}))}}function pXe(e,t){uXe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let l=0;l<n.length;++l){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[l];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,yle(f,e,u)}}e.totalMemoryUsageInBytes<i?gXe(e):a&&n.length>0&&_Xe(e)}function _Xe(e){dt("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset. - The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError). - Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(gle)}function gXe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var h3=new d,yXe={maximumFractionDigits:3};function _le(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,yXe):Math.round(t).toLocaleString()}function OW(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,h3);if(c(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(c(n)){let r=d.normalize(i,h3);r=d.multiplyByScalar(r,.75*n,h3),o=d.add(r,i,h3)}return o}function RW(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: ${_le(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${_le(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +`;function Dg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.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 U(Ni._defaultMinTerrainHeight,Ni._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Ni._defaultMinTerrainHeight,Ni._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=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Dg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function l_t(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,r,o,n,a)}function u_t(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var f_t=new $n("createVectorTileClampedPolylines"),sA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function d_t(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=u_t(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=f_t.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),h_t(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function h_t(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=tt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=tt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:sA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:sA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:sA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:sA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:sA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:sA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:sA.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:T,indexBuffer:x}),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 Q1=new M,vCe=new h;function m_t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,Q1),M.multiplyByPoint(Q1,e._center,vCe),M.setTranslation(Q1,vCe,Q1),Q1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function SCe(e){return Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},blending:rn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function p_t(e){l(e._rs)||(e._rs=SCe(!1),e._rs3DTiles=SCe(!0))}function g_t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(h8),r=n.getFragmentShaderCallback(!1,void 0,!0)(m8),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Eu,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:sA})}function __t(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=at.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===ti.TERRAIN||i===ti.BOTH)&&t.commandList.push(n),(i===ti.CESIUM_3D_TILE||i===ti.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Dg.prototype.getPositions=function(e){return bS.getPolylinePositions(this,e)};Dg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new pa(e,o)}};Dg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function y_t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var A_t=new z,b_t=z.WHITE,x_t=!0;Dg.prototype.applyStyle=function(e,t){if(!l(e)){y_t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,A_t):b_t,s.show=l(e.show)?e.show.evaluate(s):x_t}};function T_t(e){return Ni.initialize().then(function(){l_t(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Dg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=T_t(this).then(d_t(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}m_t(this,t),g_t(this,t),p_t(this);let n=e.passes;(n.render||n.pick)&&__t(this,e)};Dg.prototype.isDestroyed=function(){return!1};Dg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var p8=Dg;var Eee=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,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,w_t(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||Tee(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||Tee(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||Tee(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){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(),ue(this)}};function E_t(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function C_t(e,t){let n,i,r,o,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=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;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Kh=Uint32Array.BYTES_PER_ELEMENT;function v_t(e){return new bS(e)}function S_t(e){return new p8(e)}function w_t(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Kh;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Kh;let s=r.getUint32(n,!0);if(n+=Kh,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Kh,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Kh;let u=r.getUint32(n,!0);n+=Kh;let f=r.getUint32(n,!0);n+=Kh;let d=r.getUint32(n,!0);n+=Kh;let p=r.getUint32(n,!0);n+=Kh;let g=r.getUint32(n,!0);n+=Kh,n+=Kh;let m=Lo(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Lo(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,E=m.POINTS_LENGTH??0,v=x+T+E,S=new wp(e,v,A,b,E_t(e));if(e._batchTable=S,v===0)return;let I=new Pp(m,y),R=I.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),L=R[4],_=R[5],C=e._tile.computedTransform,w=I.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(w)?(w=h.unpack(w),M.multiplyByPoint(C,w,w)):(w=ie.center(O),w.height=P.lerp(L,_,.5),w=ee.WGS84.cartographicToCartesian(w));let D=C_t(m,y);if(n+=(4-n%4)%4,x>0){I.featuresLength=x;let F=I.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=I.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=F.reduce(function(W,J){return W+J*2},0),j=V.reduce(function(W,J){return W+J},0),k=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,B);n+=p;let q,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(q=I.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=I.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new f8({positions:G,counts:F,indexCounts:V,indices:k,minimumHeight:L,maximumHeight:_,polygonMinimumHeights:q,polygonMaximumHeights:Q,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,batchIds:D.polygons,modelMatrix:C})}let N=e._tileset;if(T>0){I.featuresLength=T;let F=I.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=I.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let q=0;q<T;++q)V[q]=2}let B=F.reduce(function(q,Q){return q+Q*3},0),j=new Uint16Array(t,n,B);n+=g;let k=N.examineVectorLinesFunction;if(l(k)){let q=Nk(new Uint16Array(j),O,L,_,ee.WGS84);I_t(q,F,D.polylines,S,e.url,k)}let G=v_t;l(N.classificationType)&&(G=S_t),e._polylines=G({positions:j,widths:V,counts:F,batchIds:D.polylines,minimumHeight:L,maximumHeight:_,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,classificationType:N.classificationType,keepDecodedPositions:N.vectorKeepDecodedPositions})}if(E>0){let F=new Uint16Array(t,n,E*3);e._points=new u8({positions:F,batchIds:D.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:N.heightReference,scene:N.scene})}}function Tee(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}}function I_t(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var g8=Eee;var{ERR_CAPACITY:yAi}=ha.Error,P_t=new h,_8=class _8 extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(P_t)),i}get vertexOffset(){return this._getUint32(_8.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};ut(_8,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+4});var Cee=_8,sl=Cee;var y8=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; +#else +in vec3 position; +#endif +in vec4 pickColor; +in vec4 showPixelSizeColorAlpha; +in vec3 outlineWidthColorAlpha; +out vec4 v_pickColor; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerRadiusFrac; +void main() +{ +float show = showPixelSizeColorAlpha.x; +float pixelSize = showPixelSizeColorAlpha.y; +vec4 color = czm_decodeRGB8(showPixelSizeColorAlpha.z); +float alpha = showPixelSizeColorAlpha.w; +float outlineWidth = outlineWidthColorAlpha.x; +vec4 outlineColor = czm_decodeRGB8(outlineWidthColorAlpha.y); +float outlineAlpha = outlineWidthColorAlpha.z; +float innerRadius = 0.5 * pixelSize * czm_pixelRatio; +float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio; +#ifdef USE_FLOAT64 +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +#else +vec4 positionEC = czm_modelView * vec4(position, 1.0); +#endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +v_pickColor = pickColor / 255.0; +v_color = color; +v_color.a *= alpha * show; +v_outlineColor = outlineColor; +v_outlineColor.a *= outlineAlpha * show; +v_innerRadiusFrac = innerRadius / outerRadius; +gl_PointSize = 2.0 * outerRadius * show; +gl_Position *= show; +} +`;var A8=`in vec4 v_pickColor; +in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerRadiusFrac; +void main() +{ +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +float delta = fwidth(distanceToCenter); +float outerLimit = 0.5; +float innerLimit = 0.5 * v_innerRadiusFrac; +float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter); +float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter); +vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha); +color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha); +if (color.a < 0.005) +{ +discard; +} +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); +} +`;var eR=class eR extends Tu{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};ut(eR,"Layout",{...Tu.Layout,SIZE_U8:Tu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Tu.Layout.__BYTE_LENGTH+4}),ut(eR,"DEFAULT_MATERIAL",Object.freeze(new eR));var vee=eR,Vp=vee;var See={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},wCe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Gx=new sl,$h=new Vp,tR=new z,ICe=new h,wee=new Sn;function D_t(e,t,n){let i=t.context;n=n||{destroy:R_t};let r=e._positionDatatype===Y.DOUBLE,o=r?See:wCe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,u=a.positionLow,f=a.pickColor,d=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,Gx),Gx._dirty&&(r&&(Gx.getPosition(ICe),Sn.fromCartesian(ICe,wee),h.pack(wee.high,c,y*3),h.pack(wee.low,u,y*3)),Gx.getMaterial($h),z.fromRgba(Gx._pickId,tR),f[y*4]=z.floatToByte(tR.red),f[y*4+1]=z.floatToByte(tR.green),f[y*4+2]=z.floatToByte(tR.blue),f[y*4+3]=z.floatToByte(tR.alpha),d[y*4]=Gx.show?1:0,d[y*4+1]=$h.size,d[y*4+2]=cn.encodeRGB8($h.color),d[y*4+3]=$h.color.alpha,p[y*3]=$h.outlineWidth,p[y*3+1]=cn.encodeRGB8($h.outlineWidth>0?$h.outlineColor:$h.color),p[y*3+2]=$h.outlineWidth>0?$h.outlineColor.alpha:$h.color.alpha,Gx._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in o)if(Object.hasOwn(o,a)){let c=a;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new Vn({context:i,attributes:[...r?[{index:See.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:See.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:wCe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?rn.DISABLED:rn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[y8],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[A8]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===ki.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function R_t(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var b8=D_t;var Iee=class e extends ha{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return sl}_getMaterialClass(){return Vp}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new sl){return super.add(t,n),n._setUint32(sl.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=b8(this,t,this._renderContext))}},Cf=Iee;function xS(e,t){this._conditionsExpression=Ze(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,M_t(this,t)}Object.defineProperties(xS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function O_t(e,t){this.condition=e,this.expression=t}function M_t(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new O_t(new kh(a,t),new kh(c,t)))}e._runtimeConditions=n}xS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};xS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};xS.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) + { + return ${f}; + } +`}return o=`${i} ${e} +{ +${o} return ${i}(1.0); +} +`,o};xS.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 r=t[i];Zn(e,r.condition.getVariables()),Zn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var x8=xS;function aA(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._lineWidth=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,N_t(this,e)}function N_t(e,t){t=Ze(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,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new kh(r[o],i))}e._meta=n,e._ready=!0}function mo(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new kh(String(t));if(typeof t=="string")return new kh(t,n);if(l(t.conditions))return new x8(t,n)}else return;return t}function po(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ze(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(aA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=mo(this,e),this._style.show=po(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=mo(this,e),this._style.color=po(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=mo(this,e),this._style.pointSize=po(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=mo(this,e),this._style.pointOutlineColor=po(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=mo(this,e),this._style.pointOutlineWidth=po(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=mo(this,e),this._style.labelColor=po(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=mo(this,e),this._style.labelOutlineColor=po(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=mo(this,e),this._style.labelOutlineWidth=po(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=mo(this,e),this._style.font=po(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=mo(this,e),this._style.labelStyle=po(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=mo(this,e),this._style.labelText=po(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=mo(this,e),this._style.backgroundColor=po(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=mo(this,e),this._style.backgroundPadding=po(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=mo(this,e),this._style.backgroundEnabled=po(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=mo(this,e),this._style.scaleByDistance=po(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=mo(this,e),this._style.translucencyByDistance=po(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=mo(this,e),this._style.distanceDisplayCondition=po(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=mo(this,e),this._style.heightOffset=po(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=mo(this,e),this._style.anchorLineEnabled=po(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=mo(this,e),this._style.anchorLineColor=po(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=mo(this,e),this._style.image=po(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=mo(this,e),this._style.disableDepthTestDistance=po(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=mo(this,e),this._style.horizontalOrigin=po(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=mo(this,e),this._style.verticalOrigin=po(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=mo(this,e),this._style.labelHorizontalOrigin=po(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=mo(this,e),this._style.labelVerticalOrigin=po(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=mo(this,e),this._style.lineWidth=po(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});aA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new aA(n)})};aA.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)};aA.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)};aA.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)};aA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Zn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Zn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Zn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var cA=aA;var PCe=new sl,DCe=new Oa,RCe=new Fo,L_t=new Vp,F_t=new bd,B_t=new Ad,Pee=class{constructor(t,n,i=0){ut(this,"_color",new z);ut(this,"_outlineColor",new z);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return z.clone(t.color,this._color);return z.clone(z.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())z.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())z.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())z.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())z.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return pa.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(Cf,PCe),yield*this._iteratePrimitivesWith(Ll,DCe),yield*this._iteratePrimitivesWith(tc,RCe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],s=this._primitivesByCollection.get(r);if(s&&o instanceof t)for(let a of s)o.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(Cf,PCe,L_t)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(Ll,DCe,F_t)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(tc,RCe,B_t)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},TS=Pee;var OCe=new h,k_t=new sl,U_t=new Oa,NCe=new Fo;function z_t(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)LCe(e,n[r],M.IDENTITY,i);return i}function T8(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function V_t(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?Fa.readIndicesAsTypedArray(e.indices):void 0;if(r===Oe.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(r===Oe.LINE_STRIP){let c=n?n.count:MCe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(r===Oe.TRIANGLES||r===Oe.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=MCe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function MCe(e){let t=T8(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function j_t(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?Fa.readAttributeAsRawCompactTypedArray(o):Fa.readAttributeAsTypedArray(o)),a=t.indices?Fa.readIndicesAsTypedArray(t.indices):void 0,c=H_t(e,t,r);n instanceof Cf?G_t(n,i,s,a,c):n instanceof Ll?W_t(n,i,s,a,c):n instanceof tc&&(l(t.vector)?q_t(n,i,s,a,c,t.vector):Y_t(n,i,s,c,t.polygon))}function H_t(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof Cn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??Fa.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new TS(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function G_t(e,t,n,i,r){let o=n.length/3;for(let s=0,a=i?i.length:o;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,OCe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:OCe,pickObject:u,featureId:u?.featureId},k_t)}}function W_t(e,t,n,i,r){let o=T8(i),s=0,a=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?a=u-s:u+1===i.length&&(a=u+1-s),a===0)continue;let d=s+a,p=i.subarray(s,d),g=FCe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},U_t),s=u+1,a=0,c++}}function q_t(e,t,n,i,r,o){let s=o.polygonAttributeOffsets,a=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=s.length;for(let p=0;p<d;p++){let g=s[p],m=p+1<d?s[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let v=c[p];A=u.slice(p,p+v);for(let S=0;S<v;S++)A[S]-=g}let b=a[p],x=p+1<d?a[p+1]:i.length,T=i.slice(b,x);for(let v=0;v<T.length;v++)T[v]-=g;let E=r(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:E,featureId:E?.featureId},NCe)}}function Y_t(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=T8(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=FCe(n,p,3,s),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===a&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let E=0;E<A.length;E++)A[E]=s[A[E]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},NCe)}}function LCe(e,t,n,i){let r=xt.getNodeTransform(t),o=M.multiplyTransformation(n,r,new M),s=t.primitives;for(let c=0;c<s.length;c++){let u=s[c],f=u.primitiveType,d,p=V_t(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new Cf({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new Ll({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new tc({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(M.clone(o)),i.collectionFeatureTableIds.set(d,b),j_t(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)LCe(e,a[c],o,i)}function FCe(e,t,n,i){let r=T8(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let s=e.constructor,a=new s(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)a[c*n+d]=e[f*n+d];c++}}return a}var E8=z_t;var C8=new sl,v8=new Oa,S8=new Fo,nR=new Vp,Dee=new bd,BCe=new Ad,kCe=new M,Ree=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=M.clone(M.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof Cf).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof tc?t+n.triangleCount:n instanceof Ll?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new cA({color:i}))}applyStyle(t){let n=o=>o instanceof Cf,i=o=>o instanceof Ll,r=o=>o instanceof tc;for(let o of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,C8);let u=this.getFeature(C8.featureId,s);l(t.show)&&(C8.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,nR.color),l(t.pointSize)&&(nR.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(nR.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,nR.outlineColor),C8.setMaterial(nR)}}for(let o of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,v8);let u=this.getFeature(v8.featureId,s);l(t.show)&&(v8.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Dee.color),l(t.lineWidth)&&(Dee.width=t.lineWidth.evaluate(u)),v8.setMaterial(Dee)}}for(let o of this._collections.filter(r)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,S8);let u=this.getFeature(S8.featureId,s);l(t.show)&&(S8.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,BCe.color),S8.setMaterial(BCe)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(K_t(this),this._ready=!0)}M.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,kCe);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];M.multiplyTransformation(kCe,this._collectionLocalMatrices[s],a.modelMatrix),!ps(i._heightReference)||!Iy.isSupported(a)?a.update(n):o&&r.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,ue(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=X_t(t,n,o,r),a=await Dd.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function X_t(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function K_t(e){let t=e._model.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M);M.multiplyTransformation(t.transform,n,e._modelMatrix);let i=E8(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Wx=Ree;function rc(){}rc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);rc._sorterTaskProcessor=void 0;rc._taskProcessorReady=!1;rc._error=void 0;rc._getSorterTaskProcessor=function(){if(!l(rc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",rc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?rc._taskProcessorReady=!0:rc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{rc._error=t}),rc._sorterTaskProcessor=e}return rc._sorterTaskProcessor};rc.radixSortIndexes=function(e){let t=rc._getSorterTaskProcessor();if(l(rc._error))throw rc._error;if(rc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var ES=rc;function oc(){}oc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);oc._textureTaskProcessor=void 0;oc._taskProcessorReady=!1;oc._error=void 0;oc._getTextureTaskProcessor=function(){if(!l(oc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",oc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?oc._taskProcessorReady=!0:oc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{oc._error=t}),oc._textureTaskProcessor=e}return oc._textureTaskProcessor};oc.generateFromAttributes=function(e){let t=oc._getTextureTaskProcessor();if(l(oc._error))throw oc._error;if(!oc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var w8=oc;function $_t(e){let t=new N_;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:xc.LESS_OR_EQUAL}})),this.alphaOptions=new hS,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var I8=$_t;var P8=`#if defined(HAS_SPHERICAL_HARMONICS) +const uint coefficientCount[3] = uint[3](3u,8u,15u); +const float SH_C1 = 0.48860251; +const float SH_C2[5] = float[5]( +1.092548430, +-1.09254843, +0.315391565, +-1.09254843, +0.546274215 +); +const float SH_C3[7] = float[7]( +-0.59004358, +2.890611442, +-0.45704579, +0.373176332, +-0.45704579, +1.445305721, +-0.59004358 +); +uvec2 loadSHCoeff(uint splatID, int index) { +ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0); +uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u]; +uint splatsPerRow = uint(shTexSize.x) / dims; +uint shIndex = (splatID%splatsPerRow) * dims + uint(index); +ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow); +return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg; +} +vec3 halfToVec3(uvec2 packed) { +return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x); +} +vec3 loadAndExpandSHCoeff(uint splatID, int index) { +uvec2 coeff = loadSHCoeff(splatID, index); +return halfToVec3(coeff); +} +vec3 evaluateSH(uint splatID, vec3 viewDir) { +vec3 result = vec3(0.0); +int coeffIndex = 0; +float x = viewDir.x, y = viewDir.y, z = viewDir.z; +if (u_sphericalHarmonicsDegree >= 1.) { +vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3; +if (u_sphericalHarmonicsDegree >= 2.) { +float xx = x * x; +float yy = y * y; +float zz = z * z; +float xy = x * y; +float yz = y * z; +float xz = x * z; +vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += SH_C2[0] * xy * sh4 + +SH_C2[1] * yz * sh5 + +SH_C2[2] * (2.0f * zz - xx - yy) * sh6 + +SH_C2[3] * xz * sh7 + +SH_C2[4] * (xx - yy) * sh8; +if (u_sphericalHarmonicsDegree >= 3.) { +vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++); +vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++); +result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 + +SH_C3[1] * xy * z * sh10 + +SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 + +SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 + +SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 + +SH_C3[5] * z * (xx - yy) * sh14 + +SH_C3[6] * x * (xx - 3.0f * yy) * sh15; +} +} +} +return result; +} +#endif +vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) { +vec4 t = vec4(viewPos, 1.0); +vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w); +vec2 J1 = focal / t.z; +vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z); +mat3 J = mat3( +J1.x, 0.0, J2.x, +0.0, J1.y, J2.y, +0.0, 0.0, 0.0 +); +mat3 R = mat3(czm_modelView); +mat3 Vrk_view = R * Vrk * transpose(R); +mat3 cov = transpose(J) * Vrk_view * J; +float diagonal1 = cov[0][0] + .3; +float offDiagonal = cov[0][1]; +float diagonal2 = cov[1][1] + .3; +float mid = 0.5 * (diagonal1 + diagonal2); +float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal)); +float lambda1 = mid + radius; +float lambda2 = max(mid - radius, 0.1); +vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1)); +return vec4( +min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector, +min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x) +); +} +highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0); +void main() { +uint texIdx = uint(a_splatIndex); +uint rowMask = uint(u_splatRowMask); +uint rowShift = uint(u_splatRowShift); +ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift)); +vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) ); +vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0); +vec4 clipPosition = czm_projection * splatViewPos; +float clip = 1.2 * clipPosition.w; +if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip || +clipPosition.y < -clip || clipPosition.y > clip) { +gl_Position = vec4(0.0, 0.0, 2.0, 1.0); +return; +} +ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift)); +uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0)); +gl_Position = clipPosition; +vec2 u1 = unpackHalf2x16(covariance.x) ; +vec2 u2 = unpackHalf2x16(covariance.y); +vec2 u3 = unpackHalf2x16(covariance.z); +mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y); +vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk); +if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) { +gl_Position = discardVec; +return; +} +vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.; +gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0); +gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w)); +v_vertPos = corner ; +v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0; +#if defined(HAS_SPHERICAL_HARMONICS) +vec4 splatWC = czm_inverseView * splatViewPos; +vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz)); +v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb; +#endif +v_splitDirection = u_splitDirection; +} +`;var D8=`void main() { +if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; +if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +float A = -dot(v_vertPos, v_vertPos); +if (A < -4.) { +discard; +} +float B = exp(A * 4.) * v_splatColor.a ; +out_FragColor = vec4(v_splatColor.rgb * B , B); +} +`;var qx=new M,GCe=new M,iR=new M,Ci=new $,rR=new Le,J_t=new h,Z_t=new Le,Q_t=new h,eyt=1e-12,R8=1e-5,Oee=1e-7,ka={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Bs={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},tyt=2,nyt=30,iyt=3,ryt=.008726646259971648,oyt=1;function syt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<iyt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=oyt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=ryt:!1}function UCe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function ayt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function zCe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function Mee(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function VCe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function cyt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function lyt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function uyt(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=lyt(e._snapshot,t);for(let a=0;a<r.length;a++){let c=r[a];if(c.length>=i&&c.buffer!==o)return c}let s=Y.createTypedArray(n,i);return r.push(s),s}function fyt(e,t){return e.length===t?e:e.subarray(0,t)}function dyt(e,t,n){if(!l(t.indexes)||t.state!==Bs.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&VCe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&VCe(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=ka.IDLE,e._dirty=!1}async function hyt(e,t,n,i){try{let r=await i,o=Ut.maximumTextureSize,s=o,a=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(a>o){let g=n.numSplats;a=o;let m=s/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=s*a*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:s,height:a,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Bs.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=HCe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=HCe(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=Ut.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),E=0;for(let v=0;E<n.shData.length;v+=m*2)T.set(n.shData.subarray(E,E+b),v),E+=b;n.sphericalHarmonicsTexture=pyt(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Bs.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Bs.BUILDING}}async function myt(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,s=o,a=r?.length;if(o!==s||a!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Bs.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,dyt(e,c,t),e._pendingSnapshot=void 0,jl.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY),e._sorterState=ka.ERROR,e._sorterError=r}}async function jCe(e,t,n){try{let i=await n,r=zCe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=ka.IDLE);return}e._indexes=i,e._sorterState=ka.SORTED}catch(i){if(!zCe(e,t))return;e._sorterState=ka.ERROR,e._sorterError=i}}function pyt(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:$e.RG_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function HCe(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:$e.RGBA_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function jl(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new M,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=$o.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new M,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(Hi.Y,Hi.X,new M),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=ka.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(jl.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Bs.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});jl.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};jl.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,Mee(this._pendingSnapshot),Mee(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),ue(this)};jl.prototype.isDestroyed=function(){return this._isDestroyed};jl.prototype.onTileLoad=function(e){this._dirty=!0};jl.prototype.onTileVisible=function(e){};jl.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=M.multiplyTransformation(t,i._axisCorrectionMatrix,qx);M.multiplyTransformation(o,e.content.worldTransform,o);let s=M.inverse(r,GCe),a=M.multiplyTransformation(s,o,qx),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&M.equalsEpsilon(a,c,eyt))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),g=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),m=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);Ci[0]=a[0]/p,Ci[1]=a[1]/p,Ci[2]=a[2]/p,Ci[3]=a[4]/g,Ci[4]=a[5]/g,Ci[5]=a[6]/g,Ci[6]=a[8]/m,Ci[7]=a[9]/m,Ci[8]=a[10]/m;let y=Ci[0]*Ci[3]+Ci[1]*Ci[4]+Ci[2]*Ci[5],A=Ci[0]*Ci[6]+Ci[1]*Ci[7]+Ci[2]*Ci[8],b=Ci[3]*Ci[6]+Ci[4]*Ci[7]+Ci[5]*Ci[8],x=Math.abs(p-1)<=Oee&&Math.abs(g-1)<=Oee&&Math.abs(m-1)<=Oee,T=Math.abs(y)<=R8&&Math.abs(A)<=R8&&Math.abs(b)<=R8,E=Ci[0]*(Ci[4]*Ci[8]-Ci[5]*Ci[7])-Ci[3]*(Ci[1]*Ci[8]-Ci[2]*Ci[7])+Ci[6]*(Ci[1]*Ci[5]-Ci[2]*Ci[4]),v=x&&T&&Math.abs(E-1)<=R8;Le.fromRotationMatrix(Ci,rR),Le.normalize(rR,rR);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=J_t,L=Z_t,_=Q_t;for(let C=0;C<S.length/3;++C)O.x=S[C*3],O.y=S[C*3+1],O.z=S[C*3+2],L.x=I[C*4],L.y=I[C*4+1],L.z=I[C*4+2],L.w=I[C*4+3],_.x=R[C*3],_.y=R[C*3+1],_.z=R[C*3+2],v?(M.multiplyByPoint(a,O,O),Le.multiply(rR,L,L),Le.normalize(L,L)):(M.fromTranslationQuaternionRotationScale(O,L,_,iR),M.multiplyTransformation(a,iR,iR),M.getTranslation(iR,O),M.getScale(iR,_),Le.multiply(rR,L,L),Le.normalize(L,L)),u[C*3]=O.x,u[C*3+1]=O.y,u[C*3+2]=O.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=M.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};jl.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Bs.BUILDING)return;n.state=Bs.TEXTURE_PENDING;let i=w8.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Bs.BUILDING;return}hyt(e,t,n,i)};jl.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new I8(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=rn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",de.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",de.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",de.VERTEX),r.addUniform("float","u_splatScale",de.VERTEX),r.addUniform("vec3","u_cameraPositionWC",de.VERTEX),r.addUniform("mat3","u_inverseModelRotation",de.VERTEX);let s=i.uniformMap;r.addUniform("int","u_splatRowMask",de.VERTEX),r.addUniform("int","u_splatRowShift",de.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",de.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",de.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Oe.TRIANGLE_STRIP,r.addVertexLines(P8),r.addFragmentLines(D8);let u=r.buildShaderProgram(t.context),f=Ze(Ge.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,Oe.TRIANGLE_STRIP),f=Ge.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new Cn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new wt({attributes:{screenQuadPosition:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Oe.TRIANGLE_STRIP});e._vertexArray=Vn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Me.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=M.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new at({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Oe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};jl.prototype.update=function(e){let t=this._tileset;if(cyt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===ka.IDLE){let r=t._selectedTiles.length!==0&&ayt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=tyt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=o||s||this._snapshotRebuildStallFrames>=nyt;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&M.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=ka.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&Mee(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=M.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,GCe);M.multiplyTransformation(v,E.content.worldTransform??M.IDENTITY,v),M.getRotation(M.inverse(v,v),this._shInverseRotation)}for(let E of u)jl.transformTile(E);let f=u.reduce((E,v)=>E+v.content.pointsLength,0),d=(E,v,S,I)=>{let R,O=0,L=0;for(let _ of u){let C=S(_.content),w=l(I)?I:Vt.getNumberOfComponents(C.type),D=l(C.typedArray)?C.typedArray:C;L+=D.length,l(R)||(R=uyt(this,E,v,f*w))}if(!l(R))return Y.createTypedArray(v,0);for(let _ of u){let C=_.content,w=S(C),D=l(w.typedArray)?w.typedArray:w;R.set(D,O),O+=D.length}return fyt(R,L)},p=()=>{let E=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let v=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<v)&&(this._scratchAggregateShBuffer=new Uint32Array(v));let S=this._scratchAggregateShBuffer,I=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(S.set(O,I),I+=O.length)}return I<S.length?S.subarray(0,I):S},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),y=d("rotations",Y.FLOAT,E=>E.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,E=>xt.getAttributeBySemantic(E.gltfPrimitive,ct.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Bs.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Bs.BUILDING){jl.generateSplatTexture(this,e,u);return}if(u.state===Bs.TEXTURE_PENDING||u.state===Bs.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,qx),u.state===Bs.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=ES.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(qx),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Bs.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Bs.SORTING;let g=this._pendingSort;myt(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Bs.SORTING&&(u.state=Bs.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,qx),!l(this._sorterPromise)){if(!syt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=ES.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(qx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){UCe(this,e);let g=this._activeSort;this._sorterState=ka.SORTING,jCe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=ka.WAITING;return}this._sorterState=ka.SORTING;return}else if(this._sorterState===ka.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:s};let a=ES.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(qx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){UCe(this,e);let c=this._activeSort;this._sorterState=ka.SORTING,jCe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=ka.WAITING;return}this._sorterState=ka.SORTING;return}else{if(this._sorterState===ka.SORTING)return;if(this._sorterState===ka.SORTED)jl.buildGSplatDrawCommand(this,e),this._sorterState=ka.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===ka.ERROR)throw this._sorterError}this._dirty=!1}};var O8=jl;var Lee=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new O8({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Xr("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions + +Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,s=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:Hi.Y,forwardAxis:Hi.Z};l(r.asset)?(a.gltfJson=r,a.baseResource=s,a.gltfResource=s):r instanceof Uint8Array?(a.typedArray=r,a.baseResource=s,a.gltfResource=s):a.gltfResource=De.createIfNeeded(r);let c=new Cd(a);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,ct.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,ct.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,ct.SCALE).typedArray.slice();let{l:r,n:o}=_yt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=xyt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),ue(this)}};function gyt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function _yt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var WCe=new ArrayBuffer(4),yyt=new Float32Array(WCe),Ayt=new Uint32Array(WCe);function Nee(e){yyt[0]=e;let t=Ayt[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let s=i-127+15;s>=31?o=n<<15|31744:s<=0?o=n<<15:o=n<<15|s<<10|r>>>13}return o}function byt(e){let t=gyt(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function xyt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=byt(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=a[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=Nee(o[u].typedArray[y])|Nee(o[u].typedArray[y+1])<<16,r[m+1]=Nee(o[u].typedArray[y+2])}}return r}var Yx=Lee;var qCe={b3dm:function(e,t,n,i,r){return Rd.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Rd.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Rd.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return HU.fromTileType(e,t,n,i,r,qCe)},externalTileset:function(e,t,n,i){return Q4.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new $U(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new g8(e,t,n,i,r)},subt:function(e,t,n,i,r){return h1.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return h1.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return Yx.tilesetRequiresGaussianSplattingExt(e)?Yx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Wx.fromGltf(e,t,n,c):Rd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Yx.tilesetRequiresGaussianSplattingExt(e)?Yx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Wx.fromGltf(e,t,n,i):Rd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Rd.fromGeoJson(e,t,n,i)}},CS=qCe;var YCe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(YCe);var Mr=YCe;var Bd={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"};Bd.isBinaryFormat=function(e){switch(e){case Bd.BATCHED_3D_MODEL:case Bd.INSTANCED_3D_MODEL:case Bd.COMPOSITE:case Bd.POINT_CLOUD:case Bd.VECTOR:case Bd.GEOMETRY:case Bd.IMPLICIT_SUBTREE:case Bd.VOXEL_BINARY:case Bd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Bd);var Ua=Bd;var XCe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(XCe);var Jh=XCe;var Aa={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},Rg=new Array(Aa.NUMBER_OF_PASSES);Rg[Aa.RENDER]=Object.freeze({pass:Aa.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Rg[Aa.PICK]=Object.freeze({pass:Aa.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Rg[Aa.SHADOW]=Object.freeze({pass:Aa.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Rg[Aa.PRELOAD]=Object.freeze({pass:Aa.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Rg[Aa.PRELOAD_FLIGHT]=Object.freeze({pass:Aa.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Rg[Aa.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Aa.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Rg[Aa.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Aa.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Rg[Aa.MOST_DETAILED_PICK]=Object.freeze({pass:Aa.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Aa.getPassOptions=function(e){return Rg[e]};Object.freeze(Aa);var go=Aa;var Fee=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},Og=Fee;function Mg(e){e=e??H.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(Mg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Mg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Mg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Mg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Mg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Mg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Mg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Mg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var M8=Mg;function Bee(e,t){let n=or(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Bee._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=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new M8({content:n,class:r})}}Bee._oneTimeWarning=yt;var vS=Bee;function Tyt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=or(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var SS=Tyt;function Ng(e){e=e??H.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(Ng.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ng.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Ng.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Ng.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Ng.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Ng.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Ng.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Ng.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var N8=Ng;function kee(e,t){let n=or(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){kee._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=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new N8({tile:n,class:r})}}kee._oneTimeWarning=yt;var L8=kee;function Eyt(e){let t=new Uint8Array(e),n=ip(t);if(n==="glTF"&&(n="glb"),Ua.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Cyt(t);if(l(i.root))return{contentType:Ua.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ua.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ua.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ua.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ua.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Cyt(e){let t;try{t=Lo(e)}catch{throw new oe("Invalid tile content.")}return t}var lA=Eyt;var Uee=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:o[a].uri}),u=El.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!vyt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;zee(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Syt(this,i,n,this._tile._contentState);return wyt(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}};function zee(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function KCe(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)}function vyt(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)&&!El.serverHasOpenSlots(n,t[n]))return!1;return El.heapHasOpenSlots(e.length)}function Syt(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new Oo({throttle:!0,throttleByServer:!0,type:oa.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){KCe(e,i);return}return zee(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){KCe(e,i);return}zee(e,-1),$Ce(e,t,f)}})}async function wyt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>Iyt(e,o,s)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function Iyt(e,t,n){if(l(t))try{let i=lA(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===Ua.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ua.GEOMETRY||i.contentType===Ua.VECTOR;let a,c=CS[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=vS(r,u));let f=SS(r,u);return l(f)&&(a.group=new Lv({metadata:f})),a}catch(i){$Ce(e,n,i)}}function $Ce(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var F8=Uee;function IS(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ee.WGS84;Myt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(IS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});IS.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var JCe=new h,B8=new h,ZCe=new h,Pyt=new h,Dyt=new h,Ryt=new h,Oyt=new h,kd=new he,QCe=new sn(h.UNIT_X,0),wS=new gn;function Myt(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),kd.longitude=t.west,kd.latitude=(t.south+t.north)*.5,kd.height=0;let i=n.cartographicToCartesian(kd,Ryt),r=h.cross(i,h.UNIT_Z,Pyt);h.normalize(r,e.westNormal),kd.longitude=t.east;let o=n.cartographicToCartesian(kd,Oyt),s=h.cross(h.UNIT_Z,o,JCe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,JCe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,Dyt),u=t.south,f;if(u>0){kd.longitude=(t.west+t.east)*.5,kd.latitude=u;let y=n.cartographicToCartesian(kd,wS.origin);h.clone(c,wS.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,QCe);bi.rayPlane(wS,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,B8)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),B8);let d=h.cross(f,a,ZCe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){kd.longitude=(t.west+t.east)*.5,kd.latitude=p;let y=n.cartographicToCartesian(kd,wS.origin);h.negate(c,wS.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,QCe);bi.rayPlane(wS,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,B8)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),B8);let m=h.cross(a,g,ZCe);h.normalize(m,e.northNormal)}var Nyt=new h,Lyt=new h,Fyt=new h(0,-1,0),Byt=new h(0,0,-1),eve=new h;function kyt(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),Nyt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),Lyt),f.z=f.y,f.y=f.x,f.x=0,d=Fyt,g=h.UNIT_Y,p=Byt,m=h.UNIT_Z);let y=h.subtract(i,u,eve),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,eve),T=h.dot(x,g),E=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:E>0&&(o+=E*E)}let s,a,c;if(t.mode===re.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}IS.prototype.distanceToCamera=function(e){let t=kyt(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};IS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};IS.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new nv({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Bt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Ud=IS;var k8=new he;function oR(e){let t=by.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??ee.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=Yyt(t,n,i,r);this._boundingPlanes=o;let s=Jyt(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Xee(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=Xee(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Xee(o[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();k8=r.cartesianToCartographic(c,k8),k8.height=(i+n)/2,this.center=r.cartographicToCartesian(k8,c),this._boundingSphere=le.fromPoints(s)}var Uyt=new h,zyt=new he,Vyt=new h,jyt=new he,Hyt=new h,Gyt=new h,Wyt=new h,qyt=new h;function Yyt(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,Uyt),a=i.cartesianToCartographic(o,zyt);a.height=n;let c=i.cartographicToCartesian(a,Vyt),u=sn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,jyt),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,Hyt));A<f&&(f=A)}let y=sn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,Gyt),x=h.subtract(A,g,qyt),T=h.cross(x,b,Wyt);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var Xx=new h,Kx=new h,$x=new h,Vee=new h,jee=new h,Hee=new h,Xyt=new h,Kyt=new h,$yt=new h,Gee=new h,Wee=new h,qee=new h,uA=new h,jp=new $;function tve(e,t,n){Xx=e.normal,Kx=t.normal,$x=n.normal,Vee=h.multiplyByScalar(e.normal,-e.distance,Vee),jee=h.multiplyByScalar(t.normal,-t.distance,jee),Hee=h.multiplyByScalar(n.normal,-n.distance,Hee),Gee=h.multiplyByScalar(h.cross(Kx,$x,Xyt),h.dot(Vee,Xx),Gee),Wee=h.multiplyByScalar(h.cross($x,Xx,Kyt),h.dot(jee,Kx),Wee),qee=h.multiplyByScalar(h.cross(Xx,Kx,$yt),h.dot(Hee,$x),qee),jp[0]=Xx.x,jp[1]=Kx.x,jp[2]=$x.x,jp[3]=Xx.y,jp[4]=Kx.y,jp[5]=$x.y,jp[6]=Xx.z,jp[7]=Kx.z,jp[8]=$x.z;let i=$.determinant(jp);return uA=h.add(Gee,Wee,uA),uA=h.add(uA,qee,uA),new h(uA.x/i,uA.y/i,uA.z/i)}function Jyt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=tve(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=tve(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var Yee=new h,PS=new h;function Xee(e,t){let n=[];for(let i=0;i<4;i++)Yee=h.subtract(t[(i+1)%4],t[i],Yee),PS=h.cross(e.normal,Yee,PS),PS=h.normalize(PS,PS),n[i]=h.clone(PS);return n}Object.defineProperties(oR.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var Kee=new h;oR.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=$ee(sn.projectPointOntoPlane(c,t,Kee),i[0],c,r),h.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=nve(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=$ee(sn.projectPointOntoPlane(c,t,Kee),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=$ee(sn.projectPointOntoPlane(this._boundingPlanes[1],t,Kee),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var Zyt=new h,Qyt=new h;function nve(e,t,n){let i=h.subtract(n,t,Zyt),r=h.subtract(e,t,Qyt),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var eAt=new sn(h.UNIT_X,0);function $ee(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],eAt);sn.getPointDistance(u,e)<0||(a=nve(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}oR.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};oR.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Ph({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Ph.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new Ph({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Ph.createGeometry(o),a=new Bt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Ph({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Ph.createGeometry(f);c[u]=new Bt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new Nn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var U8=oR;function DS(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(DS.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}}});DS.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};DS.prototype.intersectPlane=function(e){return le.intersectPlane(this._boundingSphere,e)};DS.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};DS.prototype.createDebugVolume=function(e){let t=new Ey({radius:this.radius}),n=M.fromTranslation(this.center,M.clone(M.IDENTITY)),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var fA=DS;var tAt=new h,nAt=new h,iAt=new h,rAt=new h;function Jx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function Jee(e,t){let n=h.normalize(e,rAt),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Jx(e,i,t)}function ive(e){let t=$.getColumn(e,0,tAt),n=$.getColumn(e,1,nAt),i=$.getColumn(e,2,iAt),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(r&&!o&&!s?t=Jx(n,i,t):!r&&o&&!s?n=Jx(t,i,n):!r&&!o&&s?i=Jx(n,t,i):r?o?s||(t=Jee(i,t),n=Jx(i,t,n)):(t=Jee(n,t),i=Jx(n,t,i)):(n=Jee(t,n),i=Jx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function RS(e,t){t=ive(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(RS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});RS.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};RS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};RS.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=ive(t),$.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};RS.prototype.createDebugVolume=function(e){let t=new ep({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var vf=RS;function ro(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||or(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),u=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(u,this.transform,new M),this.computedTransform=c,this.metadata=L8(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,ro._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")&&ro._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?wo.REPLACE:wo.ADD):l(i)?p=i.refine:p=wo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Mr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(ro._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(ro._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 Og(e,this),m=!0,y=Mr.READY):(y=Mr.UNLOADED,A=t.getDerivedResource({url:v}),b=El.getServerKey(A.getUrlComponent()))}else g=new Og(e,this),m=!0,y=Mr.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,E;l(x)&&(T=x.duration,l(x.date)&&(E=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=Jh.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!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=z.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 K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}ro._deprecationWarning=Xr;Object.defineProperties(ro.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 z),z.clone(this._color)},set:function(e){this._color=z.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===Mr.READY}},contentUnloaded:{get:function(){return this._contentState===Mr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Mr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Mr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var dA=new h;function oAt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,dA),c=h.add(s.positionWC,a,dA),u=h.subtract(c,o,dA);if(h.magnitude(u)>r){let E=h.normalize(u,dA),v=h.multiplyByScalar(E,r,dA),S=h.add(o,v,dA),I=h.subtract(S,s.positionWC,dA),R=h.normalize(I,dA);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===wo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===go.PRELOAD_FLIGHT||n._pass===go.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=P.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var lve=new K;ro.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof _n){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=P.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function sAt(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,s=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function aAt(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}ro.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:aa.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,r),this._visible=this._visibilityPlaneMask!==aa.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=aAt(n,this),this._priorityProgressiveResolution=sAt(n,this),this.priorityDeferred=oAt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ro.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(lve);K.lessThan(this.expireDate,e)&&(this._contentState=Mr.EXPIRED,this._expiredContent=this._content)}};function cAt(e){if(!l(e.expireDuration))return;let t=K.now(lve);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function lAt(e){return function(){return e._priority}}ro.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?uAt(this):dAt(this)};function uAt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=or(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new F8(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Mr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Mr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Mr.FAILED,r})}async function fAt(e,t,n,i,r){let o=e._contentState;e._contentState=Mr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===wi.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(uve(e,a))return i&&(e.expireDate=void 0),e._content=new Og(t,e),rve(e),e._contentState=Mr.PROCESSING,e._content;throw e._contentState=Mr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===wi.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await hAt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof Og&&rve(e),e._contentState=Mr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Mr.FAILED,a}}function dAt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Oo({throttle:!0,throttleByServer:!0,type:oa.TILES3D,priorityFunction:lAt(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return fAt(e,r,i,n,o)}function uve(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function rve(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}ro._isEmptyTile=uve;async function hAt(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=lA(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===Ua.GEOMETRY||r.contentType===Ua.VECTOR,(r.contentType===Ua.IMPLICIT_SUBTREE||r.contentType===Ua.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===Ua.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=CS[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(s(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(s(n,e,e._contentResource,r.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=vS(n,a));let c=SS(n,a);return l(c)&&(o.group=new Lv({metadata:c})),o}ro.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ro.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};ro.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,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 fve=new le;function Qee(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,fve);e._boundingVolume2D=new fA(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function mAt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,fve);e._contentBoundingVolume2D=new fA(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ro.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Qee(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==$t.INSIDE,a===$t.OUTSIDE)return aa.MASK_OUTSIDE}let s=r.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==$t.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};ro.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===aa.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=mAt(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return $t.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==$t.OUTSIDE,s===$t.INSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};ro.prototype.distanceToTile=function(e){return Qee(this,e).distanceToCamera(e)};var pAt=new h;ro.prototype.distanceToTileCenter=function(e){let n=Qee(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,pAt);return h.dot(e.camera.directionWC,i)};ro.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var dve=new $,hve=new h,gAt=new $,ete=new h,mve=new ie,pve=new en,Zee=new M;function _At(e,t,n){let i=h.fromElements(e[0],e[1],e[2],ete),r=$.fromArray(e,3,gAt);i=M.multiplyByPoint(t,i,i);let o=M.getMatrix3(t,dve);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new vf(i,r)}function ove(e,t,n,i){let r=ie.unpack(e,0,mve),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,pve),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,Zee),Zee),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,dve);return u=$.multiply(f,u,u),l(i)&&i instanceof vf?(i.update(c,u),i):new vf(c,u)}function yAt(e,t,n,i){if(!M.equalsEpsilon(t,n,P.EPSILON8))return i instanceof vf?ove(e,t,n,i):ove(e,t,n,void 0);let r=ie.unpack(e,0,mve);return i instanceof Ud?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Ud({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function AAt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],ete),r=e[3];i=M.multiplyByPoint(t,i,i);let o=M.getScale(t,hve),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new fA(i,r)}ro.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=wx.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(or(e,"3DTILES_bounding_volume_S2"))return new U8(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=_At(o,t,n);return this._verticalExaggeration!==1&&sve(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=yAt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof vf?sve(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=br.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=br.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=AAt(a,t,n);if(this._verticalExaggeration!==1){let u=br.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,ete),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var bAt=h.unpackArray(new Array(24).fill(0));function sve(e,t,n){let i=e.boundingVolume.computeCorners(bAt).map(o=>br.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,pve);e.update(r.center,r.halfAxes)}ro.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,Zee),i=!M.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&M.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.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(o.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()};ro.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,hve),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function xAt(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.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(z.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=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function TAt(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(r){throw e._contentState=Mr.FAILED,r}}function EAt(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 CAt(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)}ro.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;EAt(this,e),CAt(this,e),xAt(this,e,t,n),TAt(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ie.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var ave=[];ro.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(cAt(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Mr.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=ave;try{this._content.update(e,t)}catch(i){throw this._contentState=Mr.FAILED,i}ave.length=0,t.commandList=n};function cve(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function z8(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}ro.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=z8(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===wo.REPLACE?z8(this._priorityHolder._distanceToCamera,n.distance,i.distance):z8(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=cve(E,a,s),S=this._priorityProgressiveResolution?0:p,I=z8(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=cve(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===go.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};ro.prototype.isDestroyed=function(){return!1};ro.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(),ue(this)};var Zh=ro;function Lg(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Lg.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}}});Lg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Lg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Lg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Lg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Lg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Lg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Lg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var sR=Lg;function Fg(e){e=e??H.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(Fg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Fg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Fg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Fg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Fg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Fg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Fg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Fg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var V8=Fg;function gve(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new V8({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new sR({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new sR({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(gve.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 OS=gve;var _ve={},vAt=new h;_ve.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof vf||i instanceof Ud){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=Jh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof vf||a instanceof Ud)){e._optimChildrenWithinParent=Jh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,vAt),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=Jh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Jh.USE_OPTIMIZATION};var j8=_ve;function hA(){this._list=new Lk,this._sentinel=this._list.add(),this._trimTiles=!1}hA.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};hA.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};hA.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};hA.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};hA.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};hA.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=o.item;o=o.next,this.unloadTile(e,s,t)}};hA.prototype.trim=function(){this._trimTiles=!0};var H8=hA;function G8(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 nte(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}G8.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=nte(e,n),this._referenceMaximum[n]=nte(t,n)};function SAt(e,t){let n=e.tilePropertyName;if(l(n)){let i=nte(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 tte=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];G8.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=SAt(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+P.EPSILON7,c=P.clamp(i-r,0,s)/s,u=tte.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=tte[d],y=tte[p],A=z.clone(z.WHITE);A.red=P.lerp(m.red,y.red,g),A.green=P.lerp(m.green,y.green,g),A.blue=P.lerp(m.blue,y.blue,g),e._debugColor=A};G8.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 W8=G8;function MS(){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}MS.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};MS.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])}};MS.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Rd))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};MS.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Rd))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};MS.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.batchTableByteLength=e.batchTableByteLength};var Hp=MS;function aR(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(aR.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});aR.prototype.makeDirty=function(){this._styleDirty=!0};aR.prototype.resetDirty=function(){this._styleDirty=!1};aR.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,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var q8=aR;function yve(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.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,snap:!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,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}yve.maximumFrameNumber=15e6;var Zx=yve;function Bg(){}Bg.selectTiles=function(e,t){pe.throwInstantiationError()};Bg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Bg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Bg.selectTile=function(e,t){if(e.contentVisibility(t)===$t.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)};Bg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Bg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Bg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!wAt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function wAt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}Bg.updateTile=function(e,t){Ave(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,DAt(e),e._shouldSelect=!1,e._finalResolution=!0};function Ave(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];Ave(o,t),e._visible=o._visible;return}if(IAt(e,t)){e._visible=!1;return}let i=e.refine===wo.REPLACE,r=e._optimChildrenWithinParent===Jh.USE_OPTIMIZATION;if(i&&r&&n&&!PAt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function IAt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==wo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function PAt(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function DAt(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 sc=Bg;function bve(){}var cR={stack:new xu,stackMaximumLength:0};bve.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:r,visitTile:o}=sc,s=cR.stack;for(s.push(i);s.length>0;){cR.stackMaximumLength=Math.max(cR.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===wo.ADD,u=a.refine===wo.REPLACE,f=RAt(a);f&&OAt(a,s,t),(c||u&&!f)&&(MAt(e,a),r(a,t),NAt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return cR.stack.trim(cR.stackMaximumLength),n};function RAt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function OAt(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function MAt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function NAt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var Y8=bve;function xve(){}var lR={stack:new xu,stackMaximumLength:0},uR={stack:new xu,stackMaximumLength:0};xve.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(sc.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;FAt(n,t),lR.stack.trim(lR.stackMaximumLength),uR.stack.trim(uR.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function ite(e,t){e.contentAvailable&&sc.selectTile(e,t)}function LAt(e,t,n){let i=e.refine===wo.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=sc;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(sc.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=BAt(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function FAt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=sc,a=lR.stack;for(a.push(e);a.length>0;){lR.stackMaximumLength=Math.max(lR.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?LAt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===wo.ADD?(ite(c,t),r(c,t)):c.refine===wo.REPLACE&&(r(c,t),d&&ite(c,t)):(n._emptyTiles.push(c),r(c,t),d&&ite(c,t)),o(c,t),s(c,t)}}function BAt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=sc,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=uR.stack;for(c.push(e);c.length>0;){uR.stackMaximumLength=Math.max(uR.stackMaximumLength,c.length);let u=c.pop(),f=u.children,d=f.length,p=!u.hasRenderableContent&&n(u);if((s?u.hasRenderableContent:!p)&&!u.contentAvailable&&(a=!1),i(u,t),u.isVisible||(r(u,t),o(u,t)),p)for(let m=0;m<d;++m){let y=f[m];c.push(y)}}return e.hasEmptyContent||a}var X8=xve;function Tve(){}var fR={stack:new xu,stackMaximumLength:0},dR={stack:new xu,stackMaximumLength:0},kg={stack:new xu,stackMaximumLength:0,ancestorStack:new xu,ancestorStackMaximumLength:0},kAt=2;Tve.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(sc.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;GAt(n,t),WAt(n,t),fR.stack.trim(fR.stackMaximumLength),dR.stack.trim(dR.stackMaximumLength),kg.stack.trim(kg.stackMaximumLength),kg.ancestorStack.trim(kg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function UAt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=sc,o=dR.stack;for(o.push(e);o.length>0;){dR.stackMaximumLength=Math.max(dR.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<kAt&&o.push(u))}}}function K8(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:UAt(e,t)}function zAt(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 VAt(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 jAt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=sc;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(sc.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function HAt(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 GAt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=sc,c=fR.stack;for(c.push(e);c.length>0;){fR.stackMaximumLength=Math.max(fR.stackMaximumLength,c.length);let u=c.pop();zAt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?jAt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===wo.ADD?(K8(u,t),o(u,t)):u.refine===wo.REPLACE&&(HAt(u,i)?(o(u,t),p&&K8(u,t)):p?(K8(u,t),o(u,t)):VAt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&K8(u,t)),s(u,t),a(u,t)}}function WAt(e,t){let{selectTile:n,canTraverse:i}=sc,{stack:r,ancestorStack:o}=kg,s;for(r.push(e);r.length>0||o.length>0;){if(kg.stackMaximumLength=Math.max(kg.stackMaximumLength,r.length),kg.ancestorStackMaximumLength=Math.max(kg.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===wo.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var $8=Tve;function ba(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(ba.prototype,{length:{get:function(){return this._layers.length}}});ba.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()})};ba.prototype.addImageryProvider=function(e,t){let n=new Fs(e);return this.add(n,t),n};ba.prototype.remove=function(e,t){t=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};ba.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};ba.prototype.contains=function(e){return this.indexOf(e)!==-1};ba.prototype.indexOf=function(e){return this._layers.indexOf(e)};ba.prototype.get=function(e){return this._layers[e]};function J8(e,t){return e.indexOf(t)}function Eve(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}ba.prototype.raise=function(e){let t=J8(this._layers,e);Eve(this,t,t+1)};ba.prototype.lower=function(e){let t=J8(this._layers,e);Eve(this,t,t-1)};ba.prototype.raiseToTop=function(e){let t=J8(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))};ba.prototype.lowerToBottom=function(e){let t=J8(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 Cve=new ie;function vve(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=Cve,p=1/1024;d.west=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}ba.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(vve(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var qAt=new ie,YAt=new ie,rte=new U,ote=new U,XAt=new he,KAt=new he;function $At(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,qAt),s=1/1024,a=YAt;a.west=P.lerp(o.west,o.east,t.minX-s),a.east=P.lerp(o.west,o.east,t.maxX+s),a.south=P.lerp(o.south,o.north,t.minY-s),a.north=P.lerp(o.south,o.north,t.maxY+s),l(i)||(i=new ie);let c=r.projection;if(c instanceof ji)return i.west=P.toRadians(a.west),i.south=P.toRadians(a.south),i.east=P.toRadians(a.east),i.north=P.toRadians(a.north),i;rte.x=a.west,rte.y=a.south,ote.x=a.east,ote.y=a.north;let u=c.unproject(rte,XAt),f=c.unproject(ote,KAt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function JAt(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let s=r[o],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let u=a[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==jn.READY||!ie.contains(p.rectangle,t))continue;let A=s.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=$At(A,d.textureCoordinateRectangle,g,Cve);ie.contains(b,t)&&n(p)}}}}ba.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),s.push(c.imageryLayer))}if(l(t.globe)&&vve(t,r,!0,function(c){a(c)}),l(i)&&JAt(i,r,function(c){a(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=s[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};ba.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ba.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ba.prototype.isDestroyed=function(){return!1};ba.prototype.destroy=function(){return this.removeAll(!0),ue(this)};ba.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,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(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var NS=ba;function oo(e){e=e??H.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 H8,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new xu,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new q8,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Hp,this._statisticsLast=new Hp,this._statisticsPerPass=new Array(go.NUMBER_OF_PASSES);for(let r=0;r<go.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Hp;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 W8(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=P.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ee.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new NS(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??P.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Dn.ENABLED,this.show=e.show??!0,this.colorBlendMode=yf.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new _g(e.pointCloudShading),this._pointCloudEyeDomeLighting=new qy,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=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Ns.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(il.setOwner(e.clippingPolygons,this,"_clippingPolygons"),Dve(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Nv,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Hy(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??$o.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&yt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Uh.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(oo.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){Ns.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){il.setOwner(e,this,"_clippingPolygons"),Dve(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Xr("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}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=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=M.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&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},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,Lve(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}}});oo.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return oo.fromUrl(n,t)};oo.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await oo.loadJson(n),o=await ZAt(n,r),s=new oo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras,Lve(s);let c=l(r.asset.gltfUpAxis)?Hi.fromName(r.asset.gltfUpAxis):Hi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Hi.X;s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,r);let p=s._root.createBoundingVolume(r.root.boundingVolume,M.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Ni._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};oo.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};oo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};oo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&oo.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=Sve(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();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===wo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=Sve(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&j8.checkChildrenWithinParent(c)}return s};function Sve(e,t,n,i){if(!(l(n.implicitTiling)||or(n,"3DTILES_implicit_tiling")))return new Zh(e,t,n,i);let o=e.schema,s=new X0(t,n,o),a=new Y0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ze(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Zh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function ZAt(e,t){let n=or(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Bi.getSchemaLoader({resource:e});else if(l(n.schema))i=Bi.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new OS({schema:i.schema,metadataJson:n});return Bi.unload(i),r}var wve=new h,QAt=new he,ebt=new M,tbt=new h,nbt=new h,ibt=new h,rbt=new h;function obt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Ud)n=h.normalize(a.positionWC,wve),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=M.inverseTransformation(c.computedTransform,ebt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=M.multiplyByPoint(y,b.center,tbt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,QAt);n=h.normalize(a.positionWC,wve),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=M.multiplyByPoint(y,a.positionWC,nbt);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(y,a.directionWC,ibt),i=h.normalize(i,i),r=T.z,u instanceof vf){let E=$.getColumn(b.halfAxes,2,rbt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof fA){let E=b.radius;o=x.z-E,s=x.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=P.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function sbt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{Rve(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?Mve(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Pve(e,t){return e._priority-t._priority}oo.prototype.postPassesUpdate=function(e){l(this._root)&&(abt(this,e),vbt(this,e),this._cache.unloadTiles(this,Nve),Ebt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function Dve(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}oo.prototype.prePassesUpdate=function(e){if(!l(this._root))return;mbt(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),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&obt(this,e),e.newFrame&&this._cache.reset()};function abt(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Mr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function cbt(e){let t=e._requestedTiles;t.sort(Pve);for(let n=0;n<t.length;++n)sbt(e,t[n])}function Rve(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function lbt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Mr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var ubt=new he,fbt=new he,dbt=new h;function hbt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,r=t.boundingSphere,o=i.length;for(let s=0;s<o;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,u=he.clone(a.positionCartographic,ubt),f=he.fromCartesian(r.center,c,fbt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,dbt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function mbt(e,t){lbt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,s=i+r,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,Rve(f,e,u)}}e.totalMemoryUsageInBytes<i?gbt(e):a&&n.length>0&&pbt(e)}function pbt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Pve)}function gbt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Z8=new h,_bt={maximumFractionDigits:3};function Ive(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,_bt):Math.round(t).toLocaleString()}function ste(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,Z8);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,Z8);o=h.multiplyByScalar(o,.75*n,Z8),r=h.add(o,i,Z8)}return r}function ate(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` +Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` +Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` +Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` +Triangles: ${e.content.trianglesLength}`,r++),i+=` +Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` +Texture Memory: ${Ive(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${Ive(e.content.geometryByteLength)}`,r+=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 bXe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(c(e.debugPickedTile)){let s=c(e.debugPickPosition)?e.debugPickPosition:OW(e.debugPickedTile),a=RW(e.debugPickedTile,e,s);a.pixelOffset=new z(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];RW(a,e,OW(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&RW(a,e,OW(a))}}e._tileDebugLabels.update(t)}function xXe(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&&(c(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:De.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:l,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),mXe(e,y,t),y.update(e,t,n),l.incrementSelectionCounts(y.content),++l.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let b=g-1;b>=0;--b)i[h+y+b]=i[h+b];for(let b=0;b<y;++b)i[h+b]=m[b]}g=i.length-r,l.numberOfCommands=g,f&&(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?(c(e._tileDebugLabels)||(e._tileDebugLabels=new Gp),bXe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ble=[];function TXe(e,t){let n=t,i=ble;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&&(AXe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function xle(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function AXe(e,t){e._cache.unloadTile(e,t,xle),t.destroy()}Qo.prototype.trimLoadedTiles=function(){this._cache.trim()};function CXe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;fm.clone(n,i);let l=o!==s||r!==a;l&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,l&&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 EXe(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 SXe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&c(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function wXe(e,t,n,i){if(t.mode===oe.MORPHING||!c(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,EXe(e),SXe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&lXe(e),xXe(e,t,i),fm.clone(o,n),i.isRender){let s=e._credits;if(c(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let l=s[a];t.creditDisplay.addCreditToNextFrame(l)}}return r}function Tle(e){let t=e._credits;c(t)||(t=[]),t.length=0,c(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(At.clone(i))});let n=e.asset.extras;if(c(n)&&c(n.cesium)&&c(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new At(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}Qo.prototype.getTraversal=function(e){let{pass:t}=e;return t===Uo.MOST_DETAILED_PRELOAD||t===Uo.MOST_DETAILED_PICK?l3:this.isSkippingLevelOfDetail?d3:u3};Qo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};Qo.prototype.updateForPass=function(e,t){T.typeOf.object("frameState",e),T.typeOf.object("tilesetPassState",t);let n=t.pass;if(n===Uo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Uo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Uo.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=Uo.getPassOptions(n),a=s.ignoreCommands,l=t.commandList??i,u=l.length;if(e.commandList=l,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;c(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;c(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=wXe(this,e,h,s)),a&&(l.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};Qo.prototype.hasExtension=function(e){return c(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};Qo.prototype.isDestroyed=function(){return!1};Qo.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(),c(this._root)){let e=ble;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,de(this)};Qo.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};Qo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!Qo.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var vXe=new _n,DXe=new d,PXe=new he;Qo.prototype.getHeight=function(e,t){T.typeOf.object("cartographic",e),T.typeOf.object("scene",t);let n=t.ellipsoid;c(n)||(n=ie.WGS84);let i=vXe,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,DXe);if(c(r))return n.cartesianToCartographic(r,PXe)?.height};Qo.prototype.updateHeight=function(e,t,n){n=n??ie.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 IXe=new $a,OXe=new d;Qo.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let l=0;l<o;++l){let u=i[l],f=Qn.raySphere(e,u.contentBoundingVolume.boundingSphere,IXe);!c(f)||!c(u.content)||r.push(u)}let s=r.length;r.sort((l,u)=>{let f=le.distanceSquaredTo(l.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let l=0;l<s;++l){let f=r[l].content.pick(e,t,OXe);if(c(f))return a=d.clone(f,n),a}};var As=Qo;var RXe=new F;function ny(e,t){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(ny.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}ny.prototype.update=function(e){if(!c(e))throw new C("time is required.");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,l,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;f&&(h=s.computeModelMatrix(e,RXe),l=we.createIfNeeded(Y.getValueOrUndefined(a._uri,e)));let p=c(u)?u.tilesetPrimitive:void 0;if(!f){c(p)&&(p.show=!1);continue}(!c(u)||l.url!==u.url)&&(c(p)&&i.removeAndDestroy(p),delete n[s.id],MXe(l,n,s,i)),c(p)&&(p.show=!0,c(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=Y.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};ny.prototype.isDestroyed=function(){return!1};ny.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ny.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)MW(this,e[i],t,n);return de(this)};ny.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._tilesetHash[e.id];if(!c(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return c(i)?i.show?(le.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};ny.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._tileset)?s.set(r.id,r):(MW(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],MW(this,r,a,l),s.remove(r.id)};function MW(e,t,n,i){let o=n[t.id];c(o)&&(c(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function MXe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await As.fromUrl(e);if(o.id=n,i.add(o),!c(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var m3=ny;var LXe=G.WHITE,NXe=G.BLACK,FXe=new z(2,2);function xC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(xC.prototype,{isConstant:{get:function(){return Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:fe("evenColor"),oddColor:fe("oddColor"),repeat:fe("repeat")});xC.prototype.getType=function(e){return"Checkerboard"};var BXe=new Q;xC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(BXe)),c(t)||(t={}),t.lightColor=Y.getValueOrClonedDefault(this._evenColor,e,LXe,t.lightColor),t.darkColor=Y.getValueOrClonedDefault(this._oddColor,e,NXe,t.darkColor),t.repeat=Y.getValueOrDefault(this._repeat,e,FXe),t};xC.prototype.equals=function(e){return this===e||e instanceof xC&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._repeat,e._repeat)};var TD=xC;var Ale={id:void 0};function AD(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 sc(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new pe,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}sc.prototype.suspendEvents=function(){this._suspendCount++};sc.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,AD(this)};Object.defineProperties(sc.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(!c(e))throw new C("value is required.");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}}});sc.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(c(s)){let a=s.start,l=s.stop;Q.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),Q.greaterThan(l,t)&&!l.equals(Ge.MAXIMUM_VALUE)&&(t=l)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new Sn({start:e,stop:t})};sc.prototype.add=function(e){if(!c(e))throw new C("entity is required.");e instanceof rr||(e=new rr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new C(`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(sc.prototype._onEntityDefinitionChanged,this),AD(this),e};sc.prototype.remove=function(e){return c(e)?this.removeById(e.id):!1};sc.prototype.contains=function(e){if(!c(e))throw new C("entity is required");return this._entities.get(e.id)===e};sc.prototype.removeById=function(e){if(!c(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(sc.prototype._onEntityDefinitionChanged,this),AD(this),!0):!1};sc.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,l=i.get(a);c(l)||(s.definitionChanged.removeEventListener(sc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),AD(this)};sc.prototype.getById=function(e){if(!c(e))throw new C("id is required.");return this._entities.get(e)};sc.prototype.getOrCreateEntity=function(e){if(!c(e))throw new C("id is required.");let t=this._entities.get(e);return c(t)||(Ale.id=e,t=new rr(Ale),this.add(t)),t};sc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),AD(this)};var la=sc;var p3={id:void 0},TC=new Array(2);function LW(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 Cle(e,t,n,i){TC[0]=n,TC[1]=i.id,t[JSON.stringify(TC)]=i.definitionChanged.addEventListener(Ur.prototype._onDefinitionChanged,e)}function Ele(e,t,n,i){TC[0]=n,TC[1]=i.id;let o=JSON.stringify(TC);t[o](),t[o]=void 0}function iy(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,l,u,f=e._composite,h=new la(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Ur.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--)s=a[l],Ele(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Ur.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--){s=a[l],Cle(e,p,g,s);let y=h.getById(s.id);c(y)||(y=f.getById(s.id),c(y)?LW(y):(p3.id=s.id,y=new rr(p3)),h.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Ur(e,t){this._owner=t,this._composite=new la(this),this._suspendCount=0,this._collections=c(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},iy(this),this._shouldRecomposite=!1}Object.defineProperties(Ur.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}}});Ur.prototype.addCollection=function(e,t){let n=c(t);if(!c(e))throw new C("collection is required.");if(n){if(t<0)throw new C("index must be greater than or equal to zero.");if(t>this._collections.length)throw new C("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),iy(this)};Ur.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),iy(this),!0):!1};Ur.prototype.removeAllCollections=function(){this._collections.length=0,iy(this)};Ur.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Ur.prototype.contains=function(e){return this._composite.contains(e)};Ur.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Ur.prototype.getCollection=function(e){if(!c(e))throw new C("index is required.","index");return this._collections[e]};Ur.prototype.getCollectionsLength=function(){return this._collections.length};function _3(e,t){if(!c(t))throw new C("collection is required.");let n=e.indexOf(t);if(n===-1)throw new C("collection is not in this composite.");return n}function Sle(e,t,n){let i=e._collections;if(t=O.clamp(t,0,i.length-1),n=O.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,iy(e)}Ur.prototype.raiseCollection=function(e){let t=_3(this._collections,e);Sle(this,t,t+1)};Ur.prototype.lowerCollection=function(e){let t=_3(this._collections,e);Sle(this,t,t-1)};Ur.prototype.raiseCollectionToTop=function(e){let t=_3(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),iy(this))};Ur.prototype.lowerCollectionToBottom=function(e){let t=_3(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),iy(this))};Ur.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Ur.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(iy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Ur.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Ur.prototype.getById=function(e){return this._composite.getById(e)};Ur.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,l,u,f=n.length,h=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Ele(this,h,p,m);let y=m.id;for(a=o-1;a>=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),LW(u)),u.merge(l));c(u)||r.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];Cle(this,h,p,m);let y=m.id;for(a=o-1;a>=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),c(u)?LW(u):(p3.id=y,u=new rr(p3),r.add(u))),u.merge(l));u=void 0}r.resumeEvents()};Ur.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,l=r.getById(a),u=l[t],f=!c(u),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(c(g)){let m=g[t];if(c(m)){if(h)if(h=!1,c(m.merge)&&c(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&l.propertyNames.indexOf(t)===-1&&l.addProperty(t),l[t]=u};var wle=Ur;function NW(){this._removalFunctions=[]}NW.prototype.add=function(e,t,n){if(!c(e))throw new C("event is required");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)}};NW.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Ar=NW;function kW(e,t){return Q.compare(e.start,t.start)}function Vr(e){if(this._intervals=[],this._changedEvent=new pe,c(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Vr.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}}});Vr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Vr))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(!Sn.equals(n[r],i[r],t))return!1;return!0};Vr.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._intervals[e]};Vr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Vr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Vr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Vr.prototype.contains=function(e){return this.indexOf(e)>=0};var FW=new Sn;Vr.prototype.indexOf=function(e){if(!c(e))throw new C("date is required");let t=this._intervals;FW.start=e,FW.stop=e;let n=Mo(t,FW,kW);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&&Sn.contains(t[n-1],e)?n-1:~n)};Vr.prototype.findInterval=function(e){e=e??W.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 l=r[s];if((!c(t)||l.start.equals(t))&&(!c(n)||l.stop.equals(n))&&(!c(i)||l.isStartIncluded===i)&&(!c(o)||l.isStopIncluded===o))return r[s]}};Vr.prototype.addInterval=function(e,t){if(!c(e))throw new C("interval is required");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=Mo(n,e,kW);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))&&((c(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new Sn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Sn({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 Sn({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 Sn({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(c(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Sn({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 Sn({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)};Vr.prototype.removeInterval=function(e){if(!c(e))throw new C("interval is required");if(e.isEmpty)return!1;let t=this._intervals,n=Mo(t,e,kW);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 Sn({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 Sn({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 Sn({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 Sn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Sn({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 Sn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Vr.prototype.intersect=function(e,t,n){if(!c(e))throw new C("other is required.");let i=new Vr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let l=s[o],u=a[r];if(Q.lessThan(l.stop,u.start))++o;else if(Q.lessThan(u.stop,l.start))++r;else{if(c(n)||c(t)&&t(l.data,u.data)||!c(t)&&u.data===l.data){let f=Sn.intersect(l,u,new Sn,n);f.isEmpty||i.addInterval(f,t)}Q.lessThan(l.stop,u.stop)||l.stop.equals(u.stop)&&!l.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Vr.fromJulianDateArray=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.julianDates))throw new C("options.iso8601Array is required.");c(t)||(t=new Vr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,l=e.trailingInterval??!1,u,f=0;a&&(++f,u=new Sn({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],g=n[h+1];u=new Sn({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?s:!1}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return l&&(u=new Sn({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u)),t};var ac=new op,CD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function BW(e,t,n){c(n)||(n=new Q),Q.toGregorianDate(e,ac);let i=ac.millisecond+t.millisecond,o=ac.second+t.second,r=ac.minute+t.minute,s=ac.hour+t.hour,a=ac.day+t.day,l=ac.month+t.month,u=ac.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),CD[2]=Th(u)?29:28;a>CD[l]||l>=13;)a>CD[l]&&(a-=CD[l],++l),l>=13&&(--l,u+=Math.floor(l/12),l=l%12,++l),CD[2]=Th(u)?29:28;return ac.millisecond=i,ac.second=o,ac.minute=r,ac.hour=s,ac.day=a,ac.month=l,ac.year=u,Q.fromGregorianDate(ac,n)}var kXe=new Q,UXe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function vle(e,t){if(!c(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(UXe);if(!c(n))return!1;if(c(n[1])&&(t.year=Number(n[1].replace(",","."))),c(n[2])&&(t.month=Number(n[2].replace(",","."))),c(n[3])&&(t.day=Number(n[3].replace(",","."))*7),c(n[4])&&(t.day+=Number(n[4].replace(",","."))),c(n[5])&&(t.hour=Number(n[5].replace(",","."))),c(n[6])&&(t.minute=Number(n[6].replace(",","."))),c(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,kXe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var ED=new op;Vr.fromIso8601=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.iso8601))throw new C("options.iso8601 is required.");let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!vle(n[2],ED))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=BW(s,ED),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Vr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Vr.fromIso8601DateArray=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.iso8601Dates))throw new C("options.iso8601Dates is required.");return Vr.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)};Vr.fromIso8601DurationArray=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.epoch))throw new C("options.epoch is required.");if(!c(e.iso8601Durations))throw new C("options.iso8601Durations is required.");let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,l=i.length;for(let u=0;u<l;++u)(vle(i[u],ED)||u===0)&&(o&&c(a)?s=BW(a,ED):s=BW(n,ED),r.push(s),a=s);return Vr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Xr=Vr;function VXe(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 l=i.get(a);c(l.data)&&r.indexOf(l.data)===-1&&t.add(l.data.definitionChanged,o)}}function Vb(){this._eventHelper=new Ar,this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(Vb.prototype._intervalsChanged,this)}Object.defineProperties(Vb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var zXe=new Q;Vb.prototype.getValue=function(e,t){c(e)||(e=Q.now(zXe));let n=this._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};Vb.prototype.equals=function(e){return this===e||e instanceof Vb&&this._intervals.equals(e._intervals,Y.equals)};Vb.prototype._intervalsChanged=function(){VXe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Gc=Vb;function oy(){this._definitionChanged=new pe,this._composite=new Gc,this._composite.definitionChanged.addEventListener(oy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(oy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});oy.prototype.getType=function(e){if(!c(e))throw new C("time is required");let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(t))return t.getType(e)};var HXe=new Q;oy.prototype.getValue=function(e,t){c(e)||(e=Q.now(HXe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};oy.prototype.equals=function(e){return this===e||e instanceof oy&&this._composite.equals(e._composite,Y.equals)};oy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var SD=oy;function ry(e){this._referenceFrame=e??zi.FIXED,this._definitionChanged=new pe,this._composite=new Gc,this._composite.definitionChanged.addEventListener(ry.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ry.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 GXe=new Q;ry.prototype.getValue=function(e,t){return c(e)||(e=Q.now(GXe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};ry.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(i))return i.getValueInReferenceFrame(e,t,n)};ry.prototype.equals=function(e){return this===e||e instanceof ry&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Y.equals)};ry.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Pa=ry;var jXe={ROUNDED:0,MITERED:1,BEVELED:2},ki=Object.freeze(jXe);var ua=[new d,new d],WXe=new d,qXe=new d,YXe=new d,XXe=new d,KXe=new d,$Xe=new d,ZXe=new d,QXe=new d,JXe=new d,AC=new d,g3=new d,wD={},UW=new he;function eKe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];UW=t.cartesianToCartographic(o,UW),n[i]=UW.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function VW(e,t,n,i){let o=e[0],r=e[1],s=d.angleBetween(o,r),a=Math.ceil(s/i),l=new Array(a),u;if(t===n){for(u=0;u<a;u++)l[u]=t;return l.push(n),l}let h=(n-t)/a;for(u=1;u<a;u++){let p=t+u*h;l[u]=p}return l[0]=t,l.push(n),l}var y3=new d,b3=new d;function tKe(e,t,n,i){let o=new is(n,i),r=o.projectPointOntoPlane(d.add(n,e,y3),y3),s=o.projectPointOntoPlane(d.add(n,t,b3),b3),a=z.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var nKe=new d(-1,0,0),zb=new F,iKe=new F,zW=new J,oKe=J.IDENTITY.clone(),rKe=new d,sKe=new se,Dle=new d;function t_(e,t,n,i,o,r,s,a){let l=rKe,u=sKe;zb=Ot.eastNorthUpToFixedFrame(e,o,zb),l=F.multiplyByPointAsVector(zb,nKe,l),l=d.normalize(l,l);let f=tKe(l,t,e,o);zW=J.fromRotationZ(f,zW),Dle.z=r,zb=F.multiplyTransformation(zb,F.fromRotationTranslation(zW,Dle,iKe),zb);let h=oKe;h[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=d.fromArray(n,g,u),u=J.multiplyByVector(h,u,u),u=F.multiplyByPoint(zb,u,u),i.push(u.x,u.y,u.z);return i}var aKe=new d;function HW(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let l=d.fromArray(e,a,aKe);i=t_(l,t,n,i,o,r[a/3],s,1)}return i}function cKe(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 l=1;l<n;l++){a=e[l];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Ple(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 Ile=new Le,Ole=new d,Rle=new J;function Mle(e,t,n,i,o,r,s,a,l,u){let f=d.angleBetween(d.subtract(t,e,AC),d.subtract(n,e,g3)),h=i===ki.BEVELED?0:Math.ceil(f/O.toRadians(5)),p;o?p=J.fromQuaternion(Le.fromAxisAngle(d.negate(e,AC),f/(h+1),Ile),Rle):p=J.fromQuaternion(Le.fromAxisAngle(e,f/(h+1),Ile),Rle);let g,m;if(t=d.clone(t,Ole),h>0){let y=u?2:1;for(let b=0;b<h;b++)t=J.multiplyByVector(p,t,t),g=d.subtract(t,e,AC),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(t,g3),s=t_(m,g,a,s,r,l,1,y)}else g=d.subtract(t,e,AC),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(t,g3),s=t_(m,g,a,s,r,l,1,1),n=d.clone(n,Ole),g=d.subtract(n,e,AC),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(n,g3),s=t_(m,g,a,s,r,l,1,1);return s}wD.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];z.equals(r,s)||n.push(s)}return n};wD.angleIsGreaterThanPi=function(e,t,n,i){let o=new is(n,i),r=o.projectPointOntoPlane(d.add(n,e,y3),y3),s=o.projectPointOntoPlane(d.add(n,t,b3),b3);return s.x*r.y-s.y*r.x>=0};var lKe=new d,uKe=new d;wD.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=eKe(e,r),a=i._granularity,l=i._cornerType,u=o?cKe(t,n):Ple(t,n),f=o?Ple(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,m=[],y=o?[]:void 0,b=WXe,x=qXe,A=YXe,E=XXe,S=KXe,v=$Xe,P=ZXe,M=QXe,R=JXe,L=e[0],B=e[1];E=r.geodeticSurfaceNormal(L,E),b=d.subtract(B,L,b),b=d.normalize(b,b),M=d.cross(E,b,M),M=d.normalize(M,M);let _=s[0],w=s[1];o&&(y=t_(L,M,f,y,r,_+h,1,1)),R=d.clone(L,R),L=B,x=d.negate(b,x);let D,I;for(let H=1;H<g-1;H++){let V=o?2:1;if(B=e[H+1],L.equals(B)){dt("Positions are too close and are considered equivalent with rounding error.");continue}b=d.subtract(B,L,b),b=d.normalize(b,b),E=r.geodeticSurfaceNormal(L,E);let j=d.multiplyByScalar(E,d.dot(b,E),lKe);d.subtract(b,j,j),d.normalize(j,j);let U=d.multiplyByScalar(E,d.dot(x,E),uKe);if(d.subtract(x,U,U),d.normalize(U,U),!O.equalsEpsilon(Math.abs(d.dot(j,U)),1,O.EPSILON7)){A=d.add(b,x,A),A=d.normalize(A,A),A=d.cross(A,E,A),A=d.cross(E,A,A),A=d.normalize(A,A);let X=1/Math.max(.25,d.magnitude(d.cross(A,x,AC))),te=wD.angleIsGreaterThanPi(b,x,L,r);te?(S=d.add(L,d.multiplyByScalar(A,X*p,A),S),v=d.add(S,d.multiplyByScalar(M,p,v),v),ua[0]=d.clone(R,ua[0]),ua[1]=d.clone(v,ua[1]),D=VW(ua,_+h,w+h,a),I=Bi.generateArc({positions:ua,granularity:a,ellipsoid:r}),m=HW(I,M,u,m,r,D,1),M=d.cross(E,b,M),M=d.normalize(M,M),P=d.add(S,d.multiplyByScalar(M,p,P),P),l===ki.ROUNDED||l===ki.BEVELED?Mle(S,v,P,l,te,r,m,u,w+h,o):(A=d.negate(A,A),m=t_(L,A,u,m,r,w+h,X,V)),R=d.clone(P,R)):(S=d.add(L,d.multiplyByScalar(A,X*p,A),S),v=d.add(S,d.multiplyByScalar(M,-p,v),v),ua[0]=d.clone(R,ua[0]),ua[1]=d.clone(v,ua[1]),D=VW(ua,_+h,w+h,a),I=Bi.generateArc({positions:ua,granularity:a,ellipsoid:r}),m=HW(I,M,u,m,r,D,1),M=d.cross(E,b,M),M=d.normalize(M,M),P=d.add(S,d.multiplyByScalar(M,-p,P),P),l===ki.ROUNDED||l===ki.BEVELED?Mle(S,v,P,l,te,r,m,u,w+h,o):m=t_(L,A,u,m,r,w+h,X,V),R=d.clone(P,R)),x=d.negate(b,x)}else m=t_(R,M,u,m,r,_+h,1,1),R=L;_=w,w=s[H+1],L=B}ua[0]=d.clone(R,ua[0]),ua[1]=d.clone(L,ua[1]),D=VW(ua,_+h,w+h,a),I=Bi.generateArc({positions:ua,granularity:a,ellipsoid:r}),m=HW(I,M,u,m,r,D,1),o&&(y=t_(L,M,f,y,r,w+h,1,1)),g=m.length;let N=o?g+y.length:g,k=new Float64Array(N);return k.set(m),o&&k.set(y,g),k};var dm=wD;var jW={},CC=new d,kle=new d,fKe=new d,Lle=new d,jc=[new d,new d],Ule=new d,Vle=new d,zle=new d,dKe=new d,hKe=new d,mKe=new d,pKe=new d,_Ke=new d,gKe=new d,yKe=new d,Nle=new Le,Fle=new J;function x3(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,CC),d.subtract(n,e,kle)),s=i===ki.BEVELED?1:Math.ceil(r/O.toRadians(5))+1,a=s*3,l=new Array(a);l[a-3]=n.x,l[a-2]=n.y,l[a-1]=n.z;let u;o?u=J.fromQuaternion(Le.fromAxisAngle(d.negate(e,CC),r/s,Nle),Fle):u=J.fromQuaternion(Le.fromAxisAngle(e,r/s,Nle),Fle);let f=0;t=d.clone(t,CC);for(let h=0;h<s;h++)t=J.multiplyByVector(u,t,t),l[f++]=t.x,l[f++]=t.y,l[f++]=t.z;return l}function bKe(e){let t=Ule,n=Vle,i=zle,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=x3(t,n,i,ki.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=d.fromArray(a,a.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let l=x3(t,n,i,ki.ROUNDED,!1);return[r,l]}function Ble(e,t,n,i){let o=CC;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function GW(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=d.multiplyByScalar(t,n,CC),a=d.negate(s,kle),l=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,fKe),p=d.add(h,a,Lle);o[l++]=p.x,o[l++]=p.y,o[l++]=p.z;let g=d.add(h,s,Lle);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}jW.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;c(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),c(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var xKe=new d,TKe=new d;jW.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Ule,l=Vle,u=zle,f=dKe,h=hKe,p=mKe,g=pKe,m=_Ke,y=gKe,b=yKe,x=[],A=s?[]:void 0,E=s?[]:void 0,S=n[0],v=n[1];l=d.normalize(d.subtract(v,S,l),l),a=i.geodeticSurfaceNormal(S,a),f=d.normalize(d.cross(a,l,f),f),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),g=d.clone(S,g),S=v,u=d.negate(l,u);let P,M=[],R,L=n.length;for(R=1;R<L-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],l=d.normalize(d.subtract(v,S,l),l);let _=d.multiplyByScalar(a,d.dot(l,a),xKe);d.subtract(l,_,_),d.normalize(_,_);let w=d.multiplyByScalar(a,d.dot(u,a),TKe);if(d.subtract(u,w,w),d.normalize(w,w),!O.equalsEpsilon(Math.abs(d.dot(_,w)),1,O.EPSILON7)){h=d.normalize(d.add(l,u,h),h),h=d.cross(h,a,h),h=d.cross(a,h,h),h=d.normalize(h,h);let I=o/Math.max(.25,d.magnitude(d.cross(h,u,CC))),N=dm.angleIsGreaterThanPi(l,u,S,i);h=d.multiplyByScalar(h,I,h),N?(m=d.add(S,h,m),b=d.add(m,d.multiplyByScalar(f,o,b),b),y=d.add(m,d.multiplyByScalar(f,o*2,y),y),jc[0]=d.clone(g,jc[0]),jc[1]=d.clone(b,jc[1]),P=Bi.generateArc({positions:jc,granularity:t,ellipsoid:i}),x=GW(P,f,o,x),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=d.clone(y,p),f=d.normalize(d.cross(a,l,f),f),y=d.add(m,d.multiplyByScalar(f,o*2,y),y),g=d.add(m,d.multiplyByScalar(f,o,g),g),r===ki.ROUNDED||r===ki.BEVELED?M.push({leftPositions:x3(m,p,y,r,N)}):M.push({leftPositions:Ble(S,d.negate(h,h),y,N)})):(y=d.add(S,h,y),b=d.add(y,d.negate(d.multiplyByScalar(f,o,b),b),b),m=d.add(y,d.negate(d.multiplyByScalar(f,o*2,m),m),m),jc[0]=d.clone(g,jc[0]),jc[1]=d.clone(b,jc[1]),P=Bi.generateArc({positions:jc,granularity:t,ellipsoid:i}),x=GW(P,f,o,x),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=d.clone(m,p),f=d.normalize(d.cross(a,l,f),f),m=d.add(y,d.negate(d.multiplyByScalar(f,o*2,m),m),m),g=d.add(y,d.negate(d.multiplyByScalar(f,o,g),g),g),r===ki.ROUNDED||r===ki.BEVELED?M.push({rightPositions:x3(y,p,m,r,N)}):M.push({rightPositions:Ble(S,h,m,N)})),u=d.negate(l,u)}S=v}a=i.geodeticSurfaceNormal(S,a),jc[0]=d.clone(g,jc[0]),jc[1]=d.clone(S,jc[1]),P=Bi.generateArc({positions:jc,granularity:t,ellipsoid:i}),x=GW(P,f,o,x),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z));let B;return r===ki.ROUNDED&&(B=bKe(x)),{positions:x,corners:M,lefts:A,normals:E,endPositions:B}};var Gi=jW;var jle=new d,Wle=new d,T3=new d,A3=new d,AKe=new d,qle=new d,sy=new d,EC=new d;function Yle(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Bd(e,t,n,i,o,r){let s=e.normals,a=e.tangents,l=e.bitangents,u=d.normalize(d.cross(n,t,sy),sy);r.normal&&Gi.addAttribute(s,t,i,o),r.tangent&&Gi.addAttribute(a,u,i,o),r.bitangent&&Gi.addAttribute(l,n,i,o)}function Xle(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,l=new hn,u,f=0,h=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let ee=o[p].leftPositions;c(ee)?(m=ee.length,f+=m,g+=m):(m=o[p].rightPositions.length,h+=m,g+=m)}let y=c(r),b;y&&(b=r[0].length-3,f+=b,h+=b,b/=3,g+=b*6);let x=f+h,A=new Float64Array(x),E=t.normal?new Float32Array(x):void 0,S=t.tangent?new Float32Array(x):void 0,v=t.bitangent?new Float32Array(x):void 0,P={normals:E,tangents:S,bitangents:v},M=0,R=x-1,L,B,_,w,D=jle,I=Wle,N,k,H=b/2,V=Fe.createTypedArray(x/3,g),j=0;if(y){k=T3,N=A3;let ee=r[0];for(D=d.fromArray(a,0,D),I=d.fromArray(s,0,I),p=0;p<H;p++)k=d.fromArray(ee,(H-1-p)*3,k),N=d.fromArray(ee,(H+p)*3,N),Gi.addAttribute(A,N,M),Gi.addAttribute(A,k,void 0,R),Bd(P,D,I,M,R,t),B=M/3,w=B+1,L=(R-2)/3,_=L-1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3}let U=0,q=0,X=i[U++],te=i[U++];A.set(X,M),A.set(te,R-te.length+1),I=d.fromArray(s,q,I);let K,Z;for(m=te.length-3,p=0;p<m;p+=3)K=n.geodeticSurfaceNormal(d.fromArray(X,p,sy),sy),Z=n.geodeticSurfaceNormal(d.fromArray(te,m-p,EC),EC),D=d.normalize(d.add(K,Z,D),D),Bd(P,D,I,M,R,t),B=M/3,w=B+1,L=(R-2)/3,_=L-1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3;for(K=n.geodeticSurfaceNormal(d.fromArray(X,m,sy),sy),Z=n.geodeticSurfaceNormal(d.fromArray(te,m,EC),EC),D=d.normalize(d.add(K,Z,D),D),q+=3,p=0;p<o.length;p++){let ee;u=o[p];let me=u.leftPositions,xe=u.rightPositions,ue,ye,Ae=qle,Pe=T3,Ee=A3;if(D=d.fromArray(a,q,D),c(me)){for(Bd(P,D,I,void 0,R,t),R-=3,ue=w,ye=_,ee=0;ee<me.length/3;ee++)Ae=d.fromArray(me,ee*3,Ae),V[j++]=ue,V[j++]=ye-ee-1,V[j++]=ye-ee,Gi.addAttribute(A,Ae,void 0,R),Pe=d.fromArray(A,(ye-ee-1)*3,Pe),Ee=d.fromArray(A,ue*3,Ee),I=d.normalize(d.subtract(Pe,Ee,I),I),Bd(P,D,I,void 0,R,t),R-=3;Ae=d.fromArray(A,ue*3,Ae),Pe=d.subtract(d.fromArray(A,ye*3,Pe),Ae,Pe),Ee=d.subtract(d.fromArray(A,(ye-ee)*3,Ee),Ae,Ee),I=d.normalize(d.add(Pe,Ee,I),I),Bd(P,D,I,M,void 0,t),M+=3}else{for(Bd(P,D,I,M,void 0,t),M+=3,ue=_,ye=w,ee=0;ee<xe.length/3;ee++)Ae=d.fromArray(xe,ee*3,Ae),V[j++]=ue,V[j++]=ye+ee,V[j++]=ye+ee+1,Gi.addAttribute(A,Ae,M),Pe=d.fromArray(A,ue*3,Pe),Ee=d.fromArray(A,(ye+ee)*3,Ee),I=d.normalize(d.subtract(Pe,Ee,I),I),Bd(P,D,I,M,void 0,t),M+=3;Ae=d.fromArray(A,ue*3,Ae),Pe=d.subtract(d.fromArray(A,(ye+ee)*3,Pe),Ae,Pe),Ee=d.subtract(d.fromArray(A,ye*3,Ee),Ae,Ee),I=d.normalize(d.negate(d.add(Ee,Pe,I),I),I),Bd(P,D,I,void 0,R,t),R-=3}for(X=i[U++],te=i[U++],X.splice(0,3),te.splice(te.length-3,3),A.set(X,M),A.set(te,R-te.length+1),m=te.length-3,q+=3,I=d.fromArray(s,q,I),ee=0;ee<te.length;ee+=3)K=n.geodeticSurfaceNormal(d.fromArray(X,ee,sy),sy),Z=n.geodeticSurfaceNormal(d.fromArray(te,m-ee,EC),EC),D=d.normalize(d.add(K,Z,D),D),Bd(P,D,I,M,R,t),w=M/3,B=w-1,_=(R-2)/3,L=_+1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3;M-=3,R+=3}if(D=d.fromArray(a,a.length-3,D),Bd(P,D,I,M,R,t),y){M+=3,R-=3,k=T3,N=A3;let ee=r[1];for(p=0;p<H;p++)k=d.fromArray(ee,(b-p-1)*3,k),N=d.fromArray(ee,p*3,N),Gi.addAttribute(A,k,void 0,R),Gi.addAttribute(A,N,M),Bd(P,D,I,M,R,t),w=M/3,B=w-1,_=(R-2)/3,L=_+1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3}if(l.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:A}),t.st){let ee=new Float32Array(x/3*2),me,xe,ue=0;if(y){f/=3,h/=3;let ye=Math.PI/(b+1);xe=1/(f-b+1),me=1/(h-b+1);let Ae,Pe=b/2;for(p=Pe+1;p<b+1;p++)Ae=O.PI_OVER_TWO+ye*p,ee[ue++]=me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=1;p<h-b+1;p++)ee[ue++]=p*me,ee[ue++]=0;for(p=b;p>Pe;p--)Ae=O.PI_OVER_TWO-p*ye,ee[ue++]=1-me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=Pe;p>0;p--)Ae=O.PI_OVER_TWO-ye*p,ee[ue++]=1-xe*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=f-b;p>0;p--)ee[ue++]=p*xe,ee[ue++]=1;for(p=1;p<Pe+1;p++)Ae=O.PI_OVER_TWO+ye*p,ee[ue++]=xe*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae))}else{for(f/=3,h/=3,xe=1/(f-1),me=1/(h-1),p=0;p<h;p++)ee[ue++]=p*me,ee[ue++]=0;for(p=f;p>0;p--)ee[ue++]=(p-1)*xe,ee[ue++]=1}l.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(l.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.normals})),t.tangent&&(l.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.tangents})),t.bitangent&&(l.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.bitangents})),{attributes:l,indices:V}}function CKe(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,l=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=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=jle,m=Wle,y=T3,b=A3,x=AKe,A=qle,E=l;for(u=0;u<s;u+=3){let S=E+l;g=d.fromArray(n,u,g),m=d.fromArray(n,u+s,m),y=d.fromArray(n,(u+3)%s,y),m=d.subtract(m,g,m),y=d.subtract(y,g,y),b=d.normalize(d.cross(m,y,b),b),t.normal&&(Gi.addAttribute(f,b,S),Gi.addAttribute(f,b,S+3),Gi.addAttribute(f,b,E),Gi.addAttribute(f,b,E+3)),(t.tangent||t.bitangent)&&(A=d.fromArray(i,u,A),t.bitangent&&(Gi.addAttribute(p,A,S),Gi.addAttribute(p,A,S+3),Gi.addAttribute(p,A,E),Gi.addAttribute(p,A,E+3)),t.tangent&&(x=d.normalize(d.cross(A,b,x),x),Gi.addAttribute(h,x,S),Gi.addAttribute(h,x,S+3),Gi.addAttribute(h,x,E),Gi.addAttribute(h,x,E+3))),E+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}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 S=e.tangent.values;h.set(S),h.set(S,s),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(a*6);h.set(f),h.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];h[p++]=m,h[p++]=y,h[p++]=m,h[p++]=y}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function WW(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 EKe(e,t){let n=new Ie({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=Gi.computePositions(e),r=Xle(o,n,i),s=e.height,a=e.extrudedHeight,l=r.attributes,u=r.indices,f=l.position.values,h=f.length,p=new Float64Array(h*6),g=new Float64Array(h);g.set(f);let m=new Float64Array(h*4);f=si.scaleToGeodeticHeight(f,s,i),m=WW(f,0,m),g=si.scaleToGeodeticHeight(g,a,i),m=WW(g,h*2,m),p.set(f),p.set(g,h),p.set(m,h*2),l.position.values=p,l=CKe(l,t);let y,b=h/3;if(e.shadowVolume){let L=l.normal.values;h=L.length;let B=new Float32Array(h*6);for(y=0;y<h;y++)L[y]=-L[y];B.set(L,h),B=WW(L,h*4,B),l.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:B}),t.normal||(l.normal=void 0)}if(c(e.offsetAttribute)){let L=new Uint8Array(b*6);if(e.offsetAttribute===Zt.TOP)L=L.fill(1,0,b).fill(1,b*2,b*4);else{let B=e.offsetAttribute===Zt.NONE?0:1;L=L.fill(B)}l.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let x=u.length,A=b+b,E=Fe.createTypedArray(p.length/3,x*2+A*3);E.set(u);let S=x;for(y=0;y<x;y+=3){let L=u[y],B=u[y+1],_=u[y+2];E[S++]=_+b,E[S++]=B+b,E[S++]=L+b}let v,P,M,R;for(y=0;y<A;y+=2)v=y+A,P=v+A,M=v+1,R=P+1,E[S++]=v,E[S++]=P,E[S++]=M,E[S++]=M,E[S++]=P,E[S++]=R;return{attributes:l,indices:E}}var Hle=new d,vD=new d,Rf=new he;function Gle(e,t,n,i,o,r){let s=d.subtract(t,e,Hle);d.normalize(s,s);let a=n.geodeticSurfaceNormal(e,vD),l=d.cross(s,a,Hle);d.multiplyByScalar(l,i,l);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,l,vD),n.cartesianToCartographic(vD,Rf);let g=Rf.latitude,m=Rf.longitude;u=Math.min(u,g),f=Math.min(f,m),h=Math.max(h,g),p=Math.max(p,m),d.subtract(e,l,vD),n.cartesianToCartographic(vD,Rf),g=Rf.latitude,m=Rf.longitude,u=Math.min(u,g),f=Math.min(f,m),h=Math.max(h,g),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var Of=new d,DD=new d,Dl=new he,Pl=new he;function Kle(e,t,n,i,o){e=Yle(e,t);let r=xo(e,d.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ce;let a=n*.5;Dl.latitude=Number.POSITIVE_INFINITY,Dl.longitude=Number.POSITIVE_INFINITY,Pl.latitude=Number.NEGATIVE_INFINITY,Pl.longitude=Number.NEGATIVE_INFINITY;let l,u;if(i===ki.ROUNDED){let p=r[0];d.subtract(p,r[1],Of),d.normalize(Of,Of),d.multiplyByScalar(Of,a,Of),d.add(p,Of,DD),t.cartesianToCartographic(DD,Rf),l=Rf.latitude,u=Rf.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,u),Pl.latitude=Math.max(Pl.latitude,l),Pl.longitude=Math.max(Pl.longitude,u)}for(let p=0;p<s-1;++p)Gle(r[p],r[p+1],t,a,Dl,Pl);let f=r[s-1];d.subtract(f,r[s-2],Of),d.normalize(Of,Of),d.multiplyByScalar(Of,a,Of),d.add(f,Of,DD),Gle(f,DD,t,a,Dl,Pl),i===ki.ROUNDED&&(t.cartesianToCartographic(DD,Rf),l=Rf.latitude,u=Rf.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,u),Pl.latitude=Math.max(Pl.latitude,l),Pl.longitude=Math.max(Pl.longitude,u));let h=c(o)?o:new ce;return h.north=Pl.latitude,h.south=Dl.latitude,h.east=Pl.longitude,h.west=Dl.longitude,h}function i_(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.width;T.defined("options.positions",t),T.defined("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ki.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+ie.packedLength+Ie.packedLength+7}i_.pack=function(e,t,n){T.defined("value",e),T.defined("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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]=e._offsetAttribute??-1,t};var $le=ie.clone(ie.UNIT_SPHERE),Zle=new Ie,n_={positions:void 0,ellipsoid:$le,vertexFormat:Zle,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};i_.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=ie.unpack(e,t,$le);t+=ie.packedLength;let s=Ie.unpack(e,t,Zle);t+=Ie.packedLength;let a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,g=e[t];return c(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=l,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(n_.positions=o,n_.width=a,n_.height=l,n_.extrudedHeight=u,n_.cornerType=f,n_.granularity=h,n_.shadowVolume=p,n_.offsetAttribute=g===-1?void 0:g,new i_(n_))};i_.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.positions,i=e.width;T.defined("options.positions",n),T.defined("options.width",i);let o=e.ellipsoid??ie.default,r=e.cornerType??ki.ROUNDED;return Kle(n,o,i,r,t)};i_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Yle(t,i);let o=xo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!O.equalsEpsilon(r,s,0,O.EPSILON2),l=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=EKe(u,l);else{let g=Gi.computePositions(u);if(f=Xle(g,l,i),f.attributes.position.values=si.scaleToGeodeticHeight(f.attributes.position.values,r,i),c(e._offsetAttribute)){let m=e._offsetAttribute===Zt.NONE?0:1,y=f.attributes.position.values.length,b=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let h=f.attributes,p=le.fromVertices(h.position.values,void 0,3);return l.position||(f.attributes.position.values=void 0),new ct({attributes:h,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};i_.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new i_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(i_.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=Kle(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var SC=i_;var Qle=new d,Jle=new d,SKe=new d;function wKe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function eue(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new hn,a,l=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,l+=p,h+=p/3*4,u+=i[f+1].length-3;for(l+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;c(N)?(p=N.length,l+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let g=c(r),m;g&&(m=r[0].length-3,l+=m,u+=m,m/=3,h+=m*4);let y=l+u,b=new Float64Array(y),x=0,A=y-1,E,S,v,P,M,R,L=m/2,B=Fe.createTypedArray(y/3,h+4),_=0;if(B[_++]=x/3,B[_++]=(A-2)/3,g){n.push(x/3),R=Qle,M=Jle;let N=r[0];for(f=0;f<L;f++)R=d.fromArray(N,(L-1-f)*3,R),M=d.fromArray(N,(L+f)*3,M),Gi.addAttribute(b,M,x),Gi.addAttribute(b,R,void 0,A),S=x/3,P=S+1,E=(A-2)/3,v=E-1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3}let w=0,D=i[w++],I=i[w++];for(b.set(D,x),b.set(I,A-I.length+1),p=I.length-3,n.push(x/3,(A-2)/3),f=0;f<p;f+=3)S=x/3,P=S+1,E=(A-2)/3,v=E-1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3;for(f=0;f<o.length;f++){let N;a=o[f];let k=a.leftPositions,H=a.rightPositions,V,j=SKe;if(c(k)){for(A-=3,V=v,n.push(P),N=0;N<k.length/3;N++)j=d.fromArray(k,N*3,j),B[_++]=V-N-1,B[_++]=V-N,Gi.addAttribute(b,j,void 0,A),A-=3;n.push(V-Math.floor(k.length/6)),t===ki.BEVELED&&n.push((A-2)/3+1),x+=3}else{for(x+=3,V=P,n.push(v),N=0;N<H.length/3;N++)j=d.fromArray(H,N*3,j),B[_++]=V+N,B[_++]=V+N+1,Gi.addAttribute(b,j,x),x+=3;n.push(V+Math.floor(H.length/6)),t===ki.BEVELED&&n.push(x/3-1),A-=3}for(D=i[w++],I=i[w++],D.splice(0,3),I.splice(I.length-3,3),b.set(D,x),b.set(I,A-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)P=x/3,S=P-1,v=(A-2)/3,E=v+1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3;x-=3,A+=3,n.push(x/3,(A-2)/3)}if(g){x+=3,A-=3,R=Qle,M=Jle;let N=r[1];for(f=0;f<L;f++)R=d.fromArray(N,(m-f-1)*3,R),M=d.fromArray(N,f*3,M),Gi.addAttribute(b,R,void 0,A),Gi.addAttribute(b,M,x),P=x/3,S=P-1,v=(A-2)/3,E=v+1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3;n.push(x/3)}else n.push(x/3,(A-2)/3);return B[_++]=x/3,B[_++]=(A-2)/3,s.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:B,wallIndices:n}}function vKe(e){let t=e.ellipsoid,n=Gi.computePositions(e),i=eue(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,l=i.indices,u=a.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=si.scaleToGeodeticHeight(u,r,t),h=si.scaleToGeodeticHeight(h,s,t),p.set(u),p.set(h,f),a.position.values=p,f/=3,c(e.offsetAttribute)){let E=new Uint8Array(f*2);if(e.offsetAttribute===Zt.TOP)E=E.fill(1,0,f);else{let S=e.offsetAttribute===Zt.NONE?0:1;E=E.fill(S)}a.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}let g,m=l.length,y=Fe.createTypedArray(p.length/3,(m+o.length)*2);y.set(l);let b=m;for(g=0;g<m;g+=2){let E=l[g],S=l[g+1];y[b++]=E+f,y[b++]=S+f}let x,A;for(g=0;g<o.length;g++)x=o[g],A=x+f,y[b++]=x,y[b++]=A;return{attributes:a,indices:y}}function PD(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.width;T.typeOf.object("options.positions",t),T.typeOf.number("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ki.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+ie.packedLength+6}PD.pack=function(e,t,n){T.typeOf.object("value",e),T.typeOf.object("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var tue=ie.clone(ie.UNIT_SPHERE),ay={positions:void 0,ellipsoid:tue,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};PD.unpack=function(e,t,n){T.typeOf.object("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=ie.unpack(e,t,tue);t+=ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t];return c(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=l,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(ay.positions=o,ay.width=s,ay.height=a,ay.extrudedHeight=l,ay.cornerType=u,ay.granularity=f,ay.offsetAttribute=h===-1?void 0:h,new PD(ay))};PD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=wKe(t,i);let o=xo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!O.equalsEpsilon(r,s,0,O.EPSILON2),l={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)l.height=r,l.extrudedHeight=s,l.offsetAttribute=e._offsetAttribute,u=vKe(l);else{let p=Gi.computePositions(l);if(u=eue(p,l.cornerType),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,r,i),c(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===Zt.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,h=le.fromVertices(f.position.values,void 0,3);return new ct({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var C3=PD;var DKe=new Xn(0);function Wc(e){oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}c(Object.create)&&(Wc.prototype=Object.create(oi.prototype),Wc.prototype.constructor=Wc);Object.defineProperties(Wc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Wc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!c(t.height)&&!c(t.extrudedHeight)&&_l.isSupported(this._scene)};Wc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||c(n)&&n!==t};Wc.prototype._computeCenter=C.throwInstantiationError;Wc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(o.zIndex)&&(c(o.height)||c(o.extrudedHeight))&&dt(dt.geometryZIndex),this._zIndex=o.zIndex??DKe,c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(c(r)||c(s)){let a=new Vh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new aA(this._scene,a,r,s)}};Wc.prototype.destroy=function(){c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),oi.prototype.destroy.call(this)};Wc.getGeometryHeight=function(e,t){if(T.defined("heightReference",t),!c(e)){t!==qe.NONE&&dt(dt.geometryHeightReference);return}return of(t)?0:e};Wc.getGeometryExtrudedHeight=function(e,t){if(T.defined("extrudedHeightReference",t),!c(e)){t!==qe.NONE&&dt(dt.geometryExtrudedHeightReference);return}return of(t)?Wc.CLAMP_TO_GROUND:e};Wc.CLAMP_TO_GROUND="clamp";Wc.computeGeometryOffsetAttribute=function(e,t,n,i){(!c(e)||!c(t))&&(t=qe.NONE),(!c(n)||!c(i))&&(i=qe.NONE);let o=0;if(t!==qe.NONE&&o++,i===qe.RELATIVE_TO_GROUND&&o++,o===2)return Zt.ALL;if(o===1)return Zt.TOP};var Gn=Wc;var nue=new G,iue=d.ZERO,oue=new d,rue=new ce;function PKe(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 kd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new PKe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}c(Object.create)&&(kd.prototype=Object.create(Gn.prototype),kd.prototype.constructor=kd);kd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,nue)),c(o)||(o=G.WHITE),i.color=jt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,iue,oue))),new St({id:t,geometry:new SC(this._options),attributes:i})};kd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,nue),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return c(this._options.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,iue,oue))),new St({id:t,geometry:new C3(this._options),attributes:o})};kd.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!c(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};kd.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.width)||oi.prototype._isHidden.call(this,e,t)};kd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.width)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};kd.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=Y.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=fi.getMinimumMaximumHeights(SC.computeRectangle(s,rue)).minimumTerrainHeight),s.extrudedHeight=o};kd.DynamicGeometryUpdater=wC;function wC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(wC.prototype=Object.create(ii.prototype),wC.prototype.constructor=wC);wC.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.positions)||!c(i.width)||ii.prototype._isHidden.call(this,e,t,n)};wC.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);c(s)&&!c(o)&&(o=0),i.positions=Y.getValueOrUndefined(t.positions,n),i.width=Y.getValueOrUndefined(t.width,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(SC.computeRectangle(i,rue)).minimumTerrainHeight),i.extrudedHeight=s};var E3=kd;function S3(){C.throwInstantiationError()}Object.defineProperties(S3.prototype,{name:{get:C.throwInstantiationError},clock:{get:C.throwInstantiationError},entities:{get:C.throwInstantiationError},isLoading:{get:C.throwInstantiationError},changedEvent:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},loadingEvent:{get:C.throwInstantiationError},show:{get:C.throwInstantiationError},clustering:{get:C.throwInstantiationError}});S3.prototype.update=function(e){C.throwInstantiationError()};S3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Kr=S3;function hm(e,t){T.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,c(t)&&(this.cameraPosition=t)}Object.defineProperties(hm.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=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var sue=new d;hm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,sue);return YW(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};hm.prototype.isScaledSpacePointVisible=function(e){return YW(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var IKe=new d;hm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return c(t)&&t<0&&n.minimumRadius>-t?(o=IKe,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),YW(e,o,i)};hm.prototype.computeHorizonCullingPoint=function(e,t,n){return lue(this._ellipsoid,e,t,n)};var aue=ie.clone(ie.UNIT_SPHERE);hm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=cue(this._ellipsoid,n,aue);return lue(o,e,t,i)};hm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return uue(this._ellipsoid,e,t,n,i,o)};hm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=cue(this._ellipsoid,o,aue);return uue(s,e,t,n,i,r)};var OKe=[];hm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){T.typeOf.object("rectangle",e);let i=ce.subsample(e,t,0,OKe),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var RKe=new d;function cue(e,t,n){if(c(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,RKe);e=ie.fromCartesian3(i,n)}return e}function lue(e,t,n,i){T.typeOf.object("directionToPoint",t),T.defined("positions",n),c(i)||(i=new d);let o=hue(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let l=n[s],u=fue(e,l,o);if(u<0)return;r=Math.max(r,u)}return due(o,r,i)}var w3=new d;function uue(e,t,n,i,o,r){T.typeOf.object("directionToPoint",t),T.defined("vertices",n),T.typeOf.number("stride",i),c(r)||(r=new d),i=i??3,o=o??d.ZERO;let s=hue(e,t),a=0;for(let l=0,u=n.length;l<u;l+=i){w3.x=n[l]+o.x,w3.y=n[l+1]+o.y,w3.z=n[l+2]+o.z;let f=fue(e,w3,s);if(f<0)return;a=Math.max(a,f)}return due(s,a,r)}function YW(e,t,n){let i=t,o=n,r=d.subtract(e,i,sue),s=-d.dot(r,i);return!(o<0?s>0:s>o&&s*s/d.magnitudeSquared(r)>o)}var MKe=new d,LKe=new d;function fue(e,t,n){let i=e.transformPositionToScaledSpace(t,MKe),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,LKe);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),l=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-l*f)}function due(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var qW=new d;function hue(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,qW),d.normalize(qW,qW))}var cy=hm;function Cr(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=Lt.clone(o)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=G.clone(e.color??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??qr.NONE}var mue=Cr.SHOW_INDEX=0,gue=Cr.POSITION_INDEX=1,NKe=Cr.COLOR_INDEX=2,FKe=Cr.OUTLINE_COLOR_INDEX=3,BKe=Cr.OUTLINE_WIDTH_INDEX=4,kKe=Cr.PIXEL_SIZE_INDEX=5,UKe=Cr.SCALE_BY_DISTANCE_INDEX=6,VKe=Cr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,zKe=Cr.DISTANCE_DISPLAY_CONDITION_INDEX=8,HKe=Cr.DISABLE_DEPTH_DISTANCE_INDEX=9,GKe=Cr.SPLIT_DIRECTION_INDEX=10;Cr.NUMBER_OF_PROPERTIES=11;function du(e,t){let n=e._pointPrimitiveCollection;c(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Cr.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");this._show!==e&&(this._show=e,du(this,mue))}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new C("value is required.");let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),du(this,gue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),du(this,UKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),du(this,VKe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!c(e))throw new C("value is required.");this._pixelSize!==e&&(this._pixelSize=e,du(this,kKe))}},color:{get:function(){return this._color},set:function(e){if(!c(e))throw new C("value is required.");let t=this._color;G.equals(t,e)||(G.clone(e,t),du(this,NKe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),du(this,FKe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,du(this,BKe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far must be greater than near");Lt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),du(this,zKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!c(e)||e<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,du(this,HKe)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(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,du(this,mue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,du(this,GKe))}}});Cr.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Cr.prototype._getActualPosition=function(){return this._actualPosition};Cr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),du(this,gue)};var pue=new se;Cr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(F.multiplyByPoint(n,e,pue),Hi.computeActualEllipsoidPosition(t,pue))};var _ue=new se;Cr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,_ue),_ue);return Hi.worldToWindowCoordinates(n,o,i)};Cr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;if(c(t)||(t=new z),!c(n))throw new C("PointPrimitive must be in a collection.");if(!c(e))throw new C("scene is required.");let i=n.modelMatrix,o=Cr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(c(o))return o.y=e.canvas.clientHeight-o.y,o};Cr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,l=i;return c(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=l,n};Cr.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.equals(this._position,e._position)&&G.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&G.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Cr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Hs=Cr;var Hb=`in vec4 v_color; +- ${s[a]}`;r+=s.length}else i+=` +Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function ybt(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:ste(e.debugPickedTile),a=ate(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];ate(a,e,ste(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&ate(a,e,ste(a))}}e._tileDebugLabels.update(t)}function Abt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new fi({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ge.fromCache({stencilMask:Xt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),hbt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new wg),ybt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Ove=[],bbt=[];function Mve(e,t){let n=t,i=Ove;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(Cbt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Nve(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Q8(e,t){let n=e-t;return n<0?n+Zx.maximumFrameNumber:n}var xbt=64;function Tbt(e,t,n){let i=bbt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Mr.LOADING||o===Mr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Mr.UNLOADED&&o!==Mr.FAILED||l(r.cacheNode)||Math.min(Q8(t,r._visitedFrame),Q8(t,r._touchedFrame),Q8(t,r._selectedFrame),Q8(t,r._requestedFrame))<n)return i.length=0,!0;let c=r.children;for(let u=0;u<c.length;++u)i.push(c[u])}return!1}function Ebt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<xbt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,u=n[c];if(u.isDestroyed()||!u.hasTilesetContent||u.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!Tbt(u,i,r)&&(Mve(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function Cbt(e,t){e._cache.unloadTile(e,t,Nve),t.destroy()}oo.prototype.trimLoadedTiles=function(){this._cache.trim()};function vbt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Hp.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!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 Sbt(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 wbt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function Ibt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,Sbt(e),wbt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&cbt(e),Abt(e,t,i),Hp.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return o}function Lve(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(It.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new It(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}oo.prototype.getTraversal=function(e){let{pass:t}=e;return t===go.MOST_DETAILED_PRELOAD||t===go.MOST_DETAILED_PICK?Y8:this.isSkippingLevelOfDetail?$8:X8};oo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};oo.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===go.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===go.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===go.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=go.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,s.isRender){let d=this._environmentMapManager;l(this._root)&&(d.position=this.boundingSphere.center),d.update(e)}let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=Ibt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};oo.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};oo.prototype.isDestroyed=function(){return!1};oo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=Ove;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,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,ue(this)};oo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};oo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!oo.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Pbt=new gn,Dbt=new h,Rbt=new h,Obt=new he;oo.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=Pbt,r=n.cartographicToCartesian(e,Dbt),o=n.geodeticSurfaceNormal(r,i.direction);i.origin=h.add(r,h.multiplyByScalar(o,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(o,i.direction);let s=this.pick(i,t.frameState,Rbt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,Obt)?.height};oo.prototype.updateHeight=function(e,t,n){n=n??ee.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,s=o.length;for(let a=0;a<s;++a)if(o[a]===i){o.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var Mbt=new h;oo.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let r=this._selectedTiles,o=r.length,s=[],a=e.origin.x,c=e.origin.y,u=e.origin.z,f=e.direction.x,d=e.direction.y,p=e.direction.z,g=f*f+d*d+p*p;for(let b=0;b<o;++b){let x=r[b];if(l(i)&&x.geometricError>i||!l(x.content))continue;let T=x.contentBoundingVolume.boundingSphere,E=T.center,v=a-E.x,S=c-E.y,I=u-E.z,R=2*(f*v+d*S+p*I),O=v*v+S*S+I*I-T.radius*T.radius;R*R-4*g*O<0||s.push(x)}let m=s.length,y,A=Number.POSITIVE_INFINITY;for(let b=0;b<m;++b){let T=s[b].content.pick(e,t,Mbt);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};oo.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};oo.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var es=oo;var Nbt=new M;function mA(e,t){t.collectionChanged.addEventListener(mA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}mA.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,Nbt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],Lbt(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};mA.prototype.isDestroyed=function(){return!1};mA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(mA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)cte(this,e[i],t,n);return ue(this)};mA.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Pt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};mA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(cte(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],cte(this,o,a,c),s.remove(o.id)};function cte(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function Lbt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await es.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var ej=mA;var Fbt=z.WHITE,Bbt=z.BLACK,kbt=new U(2,2);function LS(e){e=e??H.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(LS.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});LS.prototype.getType=function(e){return"Checkerboard"};var Ubt=new K;LS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Ubt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,Fbt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,Bbt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,kbt),t};LS.prototype.equals=function(e){return this===e||e instanceof LS&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var hR=LS;var Fve={id:void 0};function mR(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 r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function al(e){this._owner=e,this._entities=new zt,this._addedEntities=new zt,this._removedEntities=new zt,this._changedEntities=new zt,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}al.prototype.suspendEvents=function(){this._suspendCount++};al.prototype.resumeEvents=function(){this._suspendCount--,mR(this)};Object.defineProperties(al.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,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});al.prototype.computeAvailability=function(){let e=nt.MAXIMUM_VALUE,t=nt.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;K.lessThan(a,e)&&!a.equals(nt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(nt.MAXIMUM_VALUE)&&(t=c)}}return nt.MAXIMUM_VALUE.equals(e)&&(e=nt.MINIMUM_VALUE),nt.MINIMUM_VALUE.equals(t)&&(t=nt.MAXIMUM_VALUE),new vn({start:e,stop:t})};al.prototype.add=function(e){e instanceof no||(e=new no(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(al.prototype._onEntityDefinitionChanged,this),mR(this),e};al.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};al.prototype.contains=function(e){return this._entities.get(e.id)===e};al.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(al.prototype._onEntityDefinitionChanged,this),mR(this),!0):!1};al.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(al.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),mR(this)};al.prototype.getById=function(e){return this._entities.get(e)};al.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Fve.id=e,t=new no(Fve),this.add(t)),t};al.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),mR(this)};var ac=al;var tj={id:void 0},FS=new Array(2);function lte(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 Bve(e,t,n,i){FS[0]=n,FS[1]=i.id,t[JSON.stringify(FS)]=i.definitionChanged.addEventListener(ys.prototype._onDefinitionChanged,e)}function kve(e,t,n,i){FS[0]=n,FS[1]=i.id;let r=JSON.stringify(FS);t[r](),t[r]=void 0}function pA(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new ac(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(ys.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],kve(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(ys.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Bve(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?lte(y):(tj.id=s.id,y=new no(tj)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function ys(e,t){this._owner=t,this._composite=new ac(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},pA(this),this._shouldRecomposite=!1}Object.defineProperties(ys.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}}});ys.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),pA(this)};ys.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),pA(this),!0):!1};ys.prototype.removeAllCollections=function(){this._collections.length=0,pA(this)};ys.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ys.prototype.contains=function(e){return this._composite.contains(e)};ys.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ys.prototype.getCollection=function(e){return this._collections[e]};ys.prototype.getCollectionsLength=function(){return this._collections.length};function nj(e,t){return e.indexOf(t)}function Uve(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,pA(e)}ys.prototype.raiseCollection=function(e){let t=nj(this._collections,e);Uve(this,t,t+1)};ys.prototype.lowerCollection=function(e){let t=nj(this._collections,e);Uve(this,t,t-1)};ys.prototype.raiseCollectionToTop=function(e){let t=nj(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),pA(this))};ys.prototype.lowerCollectionToBottom=function(e){let t=nj(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),pA(this))};ys.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ys.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(pA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ys.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ys.prototype.getById=function(e){return this._composite.getById(e)};ys.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];kve(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),lte(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];Bve(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?lte(u):(tj.id=y,u=new no(tj),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};ys.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var zve=ys;function zbt(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function Qx(){this._eventHelper=new Xo,this._definitionChanged=new be,this._intervals=new Os,this._intervals.changedEvent.addEventListener(Qx.prototype._intervalsChanged,this)}Object.defineProperties(Qx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Vbt=new K;Qx.prototype.getValue=function(e,t){l(e)||(e=K.now(Vbt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Qx.prototype.equals=function(e){return this===e||e instanceof Qx&&this._intervals.equals(e._intervals,X.equals)};Qx.prototype._intervalsChanged=function(){zbt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Hl=Qx;function gA(){this._definitionChanged=new be,this._composite=new Hl,this._composite.definitionChanged.addEventListener(gA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(gA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});gA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var jbt=new K;gA.prototype.getValue=function(e,t){l(e)||(e=K.now(jbt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};gA.prototype.equals=function(e){return this===e||e instanceof gA&&this._composite.equals(e._composite,X.equals)};gA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var pR=gA;function _A(e){this._referenceFrame=e??Wi.FIXED,this._definitionChanged=new be,this._composite=new Hl,this._composite.definitionChanged.addEventListener(_A.prototype._raiseDefinitionChanged,this)}Object.defineProperties(_A.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 Hbt=new K;_A.prototype.getValue=function(e,t){return l(e)||(e=K.now(Hbt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};_A.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};_A.prototype.equals=function(e){return this===e||e instanceof _A&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};_A.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Sc=_A;var Gbt=new Ti(0);function Gl(e){Oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Gl.prototype=Object.create(Oi.prototype),Gl.prototype.constructor=Gl);Object.defineProperties(Gl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Su.isSupported(this._scene)};Gl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Gl.prototype._computeCenter=pe.throwInstantiationError;Gl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&yt(yt.geometryZIndex),this._zIndex=r.zIndex??Gbt,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new vp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ov(this._scene,a,o,s)}};Gl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Oi.prototype.destroy.call(this)};Gl.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryHeightReference);return}return ps(t)?0:e};Gl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryExtrudedHeightReference);return}return ps(t)?Gl.CLAMP_TO_GROUND:e};Gl.CLAMP_TO_GROUND="clamp";Gl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return pn.ALL;if(r===1)return pn.TOP};var oi=Gl;var Vve=new z,jve=h.ZERO,Hve=new h,Gve=new ie;function Wbt(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 Qh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Wbt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Qh.prototype=Object.create(oi.prototype),Qh.prototype.constructor=Qh);Qh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,Vve)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,jve,Hve))),new Bt({id:t,geometry:new SC(this._options),attributes:i})};Qh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Vve),r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,jve,Hve))),new Bt({id:t,geometry:new Ik(this._options),attributes:r})};Qh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Qh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Oi.prototype._isHidden.call(this,e,t)};Qh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Qh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,nt.MINIMUM_VALUE),s.offsetAttribute=oi.computeGeometryOffsetAttribute(n,i,r,o),s.height=oi.getGeometryHeight(n,i),r=oi.getGeometryExtrudedHeight(r,o),r===oi.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(SC.computeRectangle(s,Gve)).minimumTerrainHeight),s.extrudedHeight=r};Qh.DynamicGeometryUpdater=BS;function BS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(BS.prototype=Object.create(Ri.prototype),BS.prototype.constructor=BS);BS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ri.prototype._isHidden.call(this,e,t,n)};BS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(SC.computeRectangle(i,Gve)).minimumTerrainHeight),i.extrudedHeight=s};var ij=Qh;function rj(){pe.throwInstantiationError()}Object.defineProperties(rj.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}});rj.prototype.update=function(e){pe.throwInstantiationError()};rj.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var ks=rj;function ts(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=Gt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??$o.NONE}var Wve=ts.SHOW_INDEX=0,Xve=ts.POSITION_INDEX=1,qbt=ts.COLOR_INDEX=2,Ybt=ts.OUTLINE_COLOR_INDEX=3,Xbt=ts.OUTLINE_WIDTH_INDEX=4,Kbt=ts.PIXEL_SIZE_INDEX=5,$bt=ts.SCALE_BY_DISTANCE_INDEX=6,Jbt=ts.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Zbt=ts.DISTANCE_DISPLAY_CONDITION_INDEX=8,Qbt=ts.DISABLE_DEPTH_DISTANCE_INDEX=9,ext=ts.SPLIT_DIRECTION_INDEX=10;ts.NUMBER_OF_PROPERTIES=11;function Sf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ts.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Sf(this,Wve))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Sf(this,Xve))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Sf(this,$bt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Sf(this,Jbt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Sf(this,Kbt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Sf(this,qbt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Sf(this,Ybt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Sf(this,Xbt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Sf(this,Zbt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Sf(this,Qbt))}},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,Sf(this,Wve))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Sf(this,ext))}}});ts.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};ts.prototype._getActualPosition=function(){return this._actualPosition};ts.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Sf(this,Xve)};var qve=new se;ts._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(M.multiplyByPoint(n,e,qve),gr.computeActualEllipsoidPosition(t,qve))};var Yve=new se;ts._computeScreenSpacePosition=function(e,t,n,i){let r=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Yve),Yve);return gr.worldToWindowCoordinates(n,r,i)};ts.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=ts._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};ts.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new et),n.x=o,n.y=s,n.width=a,n.height=c,n};ts.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};ts.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var za=ts;var eT=`in vec4 v_color; in vec4 v_outlineColor; in float v_innerPercent; in float v_pixelDistance; @@ -6016,7 +7857,7 @@ discard; out_FragColor = czm_gammaCorrect(color); czm_writeLogDepth(); } -`;var v3=`uniform float u_maxTotalPointSize; +`;var oj=`uniform float u_maxTotalPointSize; in vec4 positionHighAndSize; in vec4 positionLowAndOutline; in vec4 compressedAttribute0; @@ -6049,32 +7890,13 @@ 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; -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); -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); -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); -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 color = czm_decodeRGB8(compressedAttribute0.x); +vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y); +vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z); +vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w); +color.a = alphaPacked.x; +outlineColor.a = alphaPacked.y; +pickColor.a = alphaPacked.z; 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) @@ -6147,2482 +7969,1435 @@ gl_Position *= show; v_pickColor = pickColor; v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var jKe=Hs.SHOW_INDEX,$W=Hs.POSITION_INDEX,yue=Hs.COLOR_INDEX,WKe=Hs.OUTLINE_COLOR_INDEX,qKe=Hs.OUTLINE_WIDTH_INDEX,YKe=Hs.PIXEL_SIZE_INDEX,bue=Hs.SCALE_BY_DISTANCE_INDEX,xue=Hs.TRANSLUCENCY_BY_DISTANCE_INDEX,Tue=Hs.DISTANCE_DISPLAY_CONDITION_INDEX,XKe=Hs.DISABLE_DEPTH_DISTANCE_INDEX,KKe=Hs.SPLIT_DIRECTION_INDEX,ZW=Hs.NUMBER_OF_PROPERTIES,cc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Mf(e){e=e??W.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(ZW),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=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Po.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Mf.prototype,{length:{get:function(){return QW(this),this._pointPrimitives.length}}});function Aue(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Mf.prototype.add=function(e){let t=new Hs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Mf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Mf.prototype.removeAll=function(){Aue(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function QW(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}}Mf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Mf.prototype.contains=function(e){return c(e)&&e._pointPrimitiveCollection===this};Mf.prototype.get=function(e){if(!c(e))throw new C("index is required.");return QW(this),this._pointPrimitives[e]};Mf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<ZW;++i){let o=n[i]===0?Be.STATIC_DRAW:Be.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function $Ke(e,t,n){return new X_(e,[{index:cc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$W]},{index:cc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$W]},{index:cc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[yue]},{index:cc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[xue]},{index:cc.scaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[bue]},{index:cc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Tue]}],t)}var XW=new Hn;function Cue(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),Hn.fromCartesian(r,XW);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let l=n[cc.positionHighAndSize],u=XW.high;l(o,u.x,u.y,u.z,s);let f=n[cc.positionLowAndOutline],h=XW.low;f(o,h.x,h.y,h.z,a)}var D3=65536,ID=256;function Eue(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,l=G.floatToByte(r.red),u=G.floatToByte(r.green),f=G.floatToByte(r.blue),h=l*D3+u*ID+f;l=G.floatToByte(a.red),u=G.floatToByte(a.green),f=G.floatToByte(a.blue);let p=l*D3+u*ID+f;l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue);let g=l*D3+u*ID+f,m=G.floatToByte(r.alpha)*D3+G.floatToByte(a.alpha)*ID+G.floatToByte(s.alpha),y=n[cc.compressedAttribute0];y(o,h,p,g,m)}function Sue(e,t,n,i){let o=i._index,r=0,s=1,a=1,l=1,u=i.translucencyByDistance;c(u)&&(r=u.near,s=u.nearValue,a=u.far,l=u.farValue,(s!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=O.clamp(s,0,1),s=s===1?255:s*255|0;let h=(f?1:0)*ID+s;l=O.clamp(l,0,1),l=l===1?255:l*255|0;let p=l,g=n[cc.compressedAttribute1];g(o,h,p,r,a)}function wue(e,t,n,i){let o=i._index,r=n[cc.scaleByDistance],s=0,a=1,l=1,u=1,f=i.scaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,l,u)}function vue(e,t,n,i){let o=i._index,r=n[cc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;c(h)&&(f=h),r(o,s,a,u,f)}function ZKe(e,t,n,i){Cue(e,t,n,i),Eue(e,t,n,i),Sue(e,t,n,i),wue(e,t,n,i),vue(e,t,n,i)}function KW(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 l=0;l<n;++l){let u=t[l],f=u.position,h=Hs._computeActualPosition(f,i,o);c(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function QKe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&KW(e,i,i.length,t,r,!0)):n===oe.MORPHING?KW(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&KW(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function JKe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var e$e=[];Mf.prototype.update=function(e){if(QW(this),!this.show)return;this._maxTotalPointSize=ut.maximumAliasedPointSize,QKe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,l=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<ZW;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=$Ke(l,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let P=this._pointPrimitives[v];P._dirty=!1,ZKe(this,l,a,P)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=e$e;v.length=0,(r[$W]||r[qKe]||r[YKe])&&v.push(Cue),(r[yue]||r[WKe])&&v.push(Eue),(r[jKe]||r[xue])&&v.push(Sue),r[bue]&&v.push(wue),(r[Tue]||r[XKe]||r[KKe])&&v.push(vue);let P=v.length;if(a=this._vaf.writers,o/n>.1){for(let M=0;M<o;++M){let R=i[M];R._dirty=!1;for(let L=0;L<P;++L)v[L](this,l,a,R)}this._vaf.commit()}else{for(let M=0;M<o;++M){let R=i[M];R._dirty=!1;for(let L=0;L<P;++L)v[L](this,l,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=F.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),JKe(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Po.OPAQUE||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Po.TRANSLUCENT||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new He({sources:[v3]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Po.OPAQUE_AND_TRANSLUCENT&&(y=new He({defines:["OPAQUE"],sources:[Hb]}),this._sp=en.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc}),y=new He({defines:["TRANSLUCENT"],sources:[Hb]}),this._spTranslucent=en.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc})),this._blendOption===Po.OPAQUE&&(y=new He({sources:[Hb]}),this._sp=en.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc})),this._blendOption===Po.TRANSLUCENT&&(y=new He({sources:[Hb]}),this._spTranslucent=en.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,x,A,E,S=e.commandList;if(u.render||f){let v=this._colorCommands,P=this._blendOption===Po.OPAQUE,M=this._blendOption===Po.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,x=b.length,v.length=x;let R=M?x*2:x;for(E=0;E<R;++E){let L=P||M&&E%2===0;A=v[E],c(A)||(A=v[E]=new Je),A.primitiveType=Me.POINTS,A.pass=L||!M?De.OPAQUE:De.TRANSLUCENT,A.owner=this;let B=M?Math.floor(E/2):E;A.boundingVolume=h,A.modelMatrix=p,A.shaderProgram=L?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=b[B].va,A.renderState=L?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",S.push(A)}}};Mf.prototype.isDestroyed=function(){return!1};Mf.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(),Aue(this._pointPrimitives),de(this)};var OD=Mf;var Due=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],JW=1,RD=8,LD=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!==JW)throw new Error(`Got v${o} data when expected v${JW}.`);let r=Due[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=Due.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(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,RD,t),this.coords=new this.ArrayType(this.data,RD+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(RD+s+a+l),this.ids=new this.IndexArrayType(this.data,RD,t),this.coords=new this.ArrayType(this.data,RD+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(JW<<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 tq(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,l=[0,r.length-1,0],u=[];for(;l.length;){let f=l.pop()||0,h=l.pop()||0,p=l.pop()||0;if(h-p<=a){for(let b=p;b<=h;b++){let x=s[2*b],A=s[2*b+1];x>=t&&x<=i&&A>=n&&A<=o&&u.push(r[b])}continue}let g=p+h>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=o&&u.push(r[g]),(f===0?t<=m:n<=y)&&(l.push(p),l.push(g-1),l.push(1-f)),(f===0?i>=m:o>=y)&&(l.push(g+1),l.push(h),l.push(1-f))}return u}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],l=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let b=p;b<=h;b++)Pue(r[2*b],r[2*b+1],t,n)<=u&&l.push(o[b]);continue}let g=p+h>>1,m=r[2*g],y=r[2*g+1];Pue(m,y,t,n)<=u&&l.push(o[g]),(f===0?t-i<=m:n-i<=y)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=m:n+i>=y)&&(a.push(g+1),a.push(h),a.push(1-f))}return l}};function tq(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Iue(e,t,s,i,o,r),tq(e,t,n,i,s-1,1-r),tq(e,t,n,s+1,o,1-r)}function Iue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(o,Math.floor(n+(u-f)*p/u+g));Iue(e,t,n,m,y,r)}let s=t[2*n+r],a=i,l=o;for(MD(e,t,i,n),t[2*o+r]>s&&MD(e,t,i,o);a<l;){for(MD(e,t,a,l),a++,l--;t[2*a+r]<s;)a++;for(;t[2*l+r]>s;)l--}t[2*i+r]===s?MD(e,t,i,l):(l++,MD(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function MD(e,t,n,i){eq(e,n,i),eq(t,2*n,2*i),eq(t,2*n+1,2*i+1)}function eq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Pue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Ud(e){e=e??W.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 pe,this.show=e.show??!0}function Oue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var t$e=new Ke;function Rue(e,t,n,i,o){if(c(e._labelCollection)&&i._clusterLabels?o=Ob.getScreenSpaceBoundingBox(e,t,o):c(e._billboardCollection)&&i._clusterBillboards?o=ao.getScreenSpaceBoundingBox(e,t,o):c(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Hs.getScreenSpaceBoundingBox(e,t,o)),Oue(o,n),i._clusterLabels&&!c(e._labelCollection)&&c(e.id)&&Lue(i,e.id.id)&&c(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Ob.getScreenSpaceBoundingBox(s,t,t$e);Oue(a,n),o=Ke.union(o,a,o)}return o}function n$e(e,t){if(e.clusterShow=!0,!c(e._labelCollection)&&c(e.id)&&Lue(t,e.id.id)&&c(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Mue(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 Lue(e,t){return c(e)&&c(e._collectionIndicesByEntity[t])&&c(e._collectionIndicesByEntity[t].labelIndex)}function nq(e,t,n,i,o){if(!c(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 l=o._clusterLabels&&c(a._labelCollection),u=o._clusterBillboards&&c(a.id._billboard),f=o._clusterPoints&&c(a.id._point);if(l&&(f||u))continue;let h=a.computeScreenSpacePosition(n);c(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var i$e=new Ke,o$e=new Ke,r$e=new Ke;function s$e(e){return function(t){if(c(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!c(i)&&!c(o)&&!c(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,l=e._clusterPointCollection;c(s)?s.removeAll():s=e._clusterLabelCollection=new Gp({scene:n}),c(a)?a.removeAll():a=e._clusterBillboardCollection=new Cf({scene:n}),c(l)?l.removeAll():l=e._clusterPointCollection=new OD;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,b=n.camera.positionWC,x=new cy(y,b),A=[];e._clusterLabels&&nq(i,A,n,x,e),e._clusterBillboards&&nq(o,A,n,x,e),e._clusterPoints&&nq(r,A,n,x,e);let E,S,v,P,M,R,L,B,_,w,D,I;if(A.length>0){let N=new LD(A.length,64,Uint32Array);for(let k=0;k<A.length;++k)N.add(A[k].coord.x,A[k].coord.y);if(N.finish(),m<g)for(v=h.length,E=0;E<v;++E){let k=h[E];if(!x.isPointVisible(k.position))continue;let H=ao._computeScreenSpacePosition(F.IDENTITY,k.position,d.ZERO,z.ZERO,n);if(!c(H))continue;let V=1-m/g,j=k.width=k.width*V,U=k.height=k.height*V;j=Math.max(j,k.minimumWidth),U=Math.max(U,k.minimumHeight);let q=H.x-j*.5,X=H.y-U*.5,te=H.x+j,K=H.y+U;for(M=N.range(q,X,te,K),R=M.length,w=0,_=[],S=0;S<R;++S)L=M[S],B=A[L],B.clustered||(++w,D=B.collection,I=B.index,_.push(D.get(I).id));if(w>=f)for(Mue(k.position,w,_,e),p.push(k),S=0;S<R;++S)A[M[S]].clustered=!0}for(v=A.length,E=0;E<v;++E){let k=A[E];if(k.clustered)continue;k.clustered=!0,D=k.collection,I=k.index;let H=D.get(I);P=Rue(H,k.coord,u,e,i$e);let V=Ke.clone(P,o$e);M=N.range(P.x,P.y,P.x+P.width,P.y+P.height),R=M.length;let j=d.clone(H.position);for(w=1,_=[H.id],S=0;S<R;++S)if(L=M[S],B=A[L],!B.clustered){let U=B.collection.get(B.index),q=Rue(U,B.coord,u,e,r$e);d.add(U.position,j,j),Ke.union(V,q,V),++w,_.push(U.id)}if(w>=f){let U=d.multiplyByScalar(j,1/w,j);for(Mue(U,w,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:P.width,minimumHeight:P.height}),S=0;S<R;++S)A[M[S]].clustered=!0}else n$e(H,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Ud.prototype._initialize=function(e){this._scene=e;let t=s$e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Ud.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&&(!c(this._billboardCollection)||this._billboardCollection.ready)&&(!c(this._labelCollection)||this._labelCollection.ready)}}});function oq(e,t,n,i){return function(o){let r=this[e];c(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(c(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),c(r)&&c(s[i]))return r.get(s[i]);c(r)||(r=this[e]=new t({scene:this._scene}));let a,l,u=this[n];u.length>0?(a=u.shift(),l=r.get(a)):(l=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),l}}function rq(e,t){let n=e._collectionIndicesByEntity[t];!c(n.billboardIndex)&&!c(n.labelIndex)&&!c(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Ud.prototype.getLabel=oq("_labelCollection",Gp,"_unusedLabelIndices","labelIndex");Ud.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._labelCollection)||!c(t)||!c(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,rq(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};Ud.prototype.getBillboard=oq("_billboardCollection",Cf,"_unusedBillboardIndices","billboardIndex");Ud.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._billboardCollection)||!c(t)||!c(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,rq(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};Ud.prototype.getPoint=oq("_pointCollection",OD,"_unusedPointIndices","pointIndex");Ud.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._pointCollection)||!c(t)||!c(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,rq(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function iq(e){if(!c(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function a$e(e){e.enabled||(c(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),c(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),c(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,iq(e._labelCollection),iq(e._billboardCollection),iq(e._pointCollection))}Ud.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;c(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;c(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,a$e(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=c(n)&&!n.ready||c(i)&&!i.ready),c(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),c(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),c(this._clusterPointCollection)&&this._clusterPointCollection.update(e),c(n)&&n.update(e),c(i)&&i.update(e),c(this._pointCollection)&&this._pointCollection.update(e)};Ud.prototype.destroy=function(){c(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 Lf=Ud;function sq(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new la(this),this._entityCluster=new Lf}Object.defineProperties(sq.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){Kr.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){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}}});sq.prototype.update=function(e){return!0};var P3=sq;var Nue={};Nue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,l=o?2*a:a,u=new Float64Array(l*3),f,h=0,p=0,g=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*O.TWO_PI,b=Math.cos(y),x=Math.sin(y),A=b*n,E=x*n,S=b*t,v=x*t;u[p+g]=A,u[p+g+1]=E,u[p+g+2]=s,u[p+m]=S,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[h++]=A,u[h++]=E,u[h++]=s,u[h++]=S,u[h++]=v,u[h++]=r)}return u};var vC=Nue;var aq=new z,c$e=new d,l$e=new d,u$e=new d,f$e=new d;function o_(e){e=e??W.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Ie.DEFAULT,r=e.slices??128;if(!c(t))throw new C("options.length must be defined.");if(!c(n))throw new C("options.topRadius must be defined.");if(!c(i))throw new C("options.bottomRadius must be defined.");if(r<3)throw new C("options.slices must be greater than or equal to 3.");if(c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}o_.packedLength=Ie.packedLength+5;o_.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Fue=new Ie,DC={vertexFormat:Fue,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};o_.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=Ie.unpack(e,t,Fue);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=l===-1?void 0:l,n):(DC.length=o,DC.topRadius=r,DC.bottomRadius=s,DC.slices=a,DC.offsetAttribute=l===-1?void 0:l,new o_(DC))};o_.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,l=s+s,u=vC.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(l*2):void 0,h=o.normal?new Float32Array(l*3):void 0,p=o.tangent?new Float32Array(l*3):void 0,g=o.bitangent?new Float32Array(l*3):void 0,m,y=o.normal||o.tangent||o.bitangent;if(y){let M=o.tangent||o.bitangent,R=0,L=0,B=0,_=Math.atan2(i-n,t),w=c$e;w.z=Math.sin(_);let D=Math.cos(_),I=u$e,N=l$e;for(m=0;m<r;m++){let k=m/r*O.TWO_PI,H=D*Math.cos(k),V=D*Math.sin(k);y&&(w.x=H,w.y=V,M&&(I=d.normalize(d.cross(d.UNIT_Z,w,I),I)),o.normal&&(h[R++]=w.x,h[R++]=w.y,h[R++]=w.z,h[R++]=w.x,h[R++]=w.y,h[R++]=w.z),o.tangent&&(p[L++]=I.x,p[L++]=I.y,p[L++]=I.z,p[L++]=I.x,p[L++]=I.y,p[L++]=I.z),o.bitangent&&(N=d.normalize(d.cross(w,I,N),N),g[B++]=N.x,g[B++]=N.y,g[B++]=N.z,g[B++]=N.x,g[B++]=N.y,g[B++]=N.z))}for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=-1),o.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),o.bitangent&&(g[B++]=0,g[B++]=-1,g[B++]=0);for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=1),o.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),o.bitangent&&(g[B++]=0,g[B++]=1,g[B++]=0)}let b=12*r-12,x=Fe.createTypedArray(l,b),A=0,E=0;for(m=0;m<r-1;m++)x[A++]=E,x[A++]=E+2,x[A++]=E+3,x[A++]=E,x[A++]=E+3,x[A++]=E+1,E+=2;for(x[A++]=s-2,x[A++]=0,x[A++]=1,x[A++]=s-2,x[A++]=1,x[A++]=s-1,m=1;m<r-1;m++)x[A++]=s+m+1,x[A++]=s+m,x[A++]=s;for(m=1;m<r-1;m++)x[A++]=a,x[A++]=a+m,x[A++]=a+m+1;let S=0;if(o.st){let M=Math.max(n,i);for(m=0;m<l;m++){let R=d.fromArray(u,m*3,f$e);f[S++]=(R.x+M)/(2*M),f[S++]=(R.y+M)/(2*M)}}let v=new hn;o.position&&(v.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(v.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(v.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),aq.x=t*.5,aq.y=Math.max(i,n);let P=new le(d.ZERO,z.magnitude(aq));if(c(e._offsetAttribute)){t=u.length;let M=e._offsetAttribute===Zt.NONE?0:1,R=new Uint8Array(t/3).fill(M);v.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new ct({attributes:v,indices:x,primitiveType:Me.TRIANGLES,boundingSphere:P,offsetAttribute:e._offsetAttribute})};var cq;o_.getUnitCylinder=function(){return c(cq)||(cq=o_.createGeometry(new o_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),cq};var I3=o_;var lq=new z;function PC(e){e=e??W.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);if(T.typeOf.number("options.positions",t),T.typeOf.number("options.topRadius",n),T.typeOf.number("options.bottomRadius",i),T.typeOf.number.greaterThanOrEquals("options.slices",o,3),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}PC.packedLength=6;PC.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Gb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};PC.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=l===-1?void 0:l,n):(Gb.length=i,Gb.topRadius=o,Gb.bottomRadius=r,Gb.slices=s,Gb.numberOfVerticalLines=a,Gb.offsetAttribute=l===-1?void 0:l,new PC(Gb))};PC.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=vC.computePositions(t,n,i,o,!1),l=o*2,u;if(r>0){let y=Math.min(r,o);u=Math.round(o/y),l+=y}let f=Fe.createTypedArray(s,l*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let g=new hn;g.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:a}),lq.x=t*.5,lq.y=Math.max(i,n);let m=new le(d.ZERO,z.magnitude(lq));if(c(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===Zt.NONE?0:1,b=new Uint8Array(t/3).fill(y);g.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new ct({attributes:g,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var O3=PC;var Bue=d.ZERO,kue=new d,d$e=new d,Uue=new G;function h$e(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 hu(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new h$e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}c(Object.create)&&(hu.prototype=Object.create(oi.prototype),hu.prototype.constructor=hu);Object.defineProperties(hu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});hu.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Uue)),c(a)||(a=G.WHITE),s.color=jt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Bue,kue))),new St({id:t,geometry:new I3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};hu.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Uue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Bue,kue))),new St({id:t,geometry:new O3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};hu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};hu.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.length)||!c(t.topRadius)||!c(t.bottomRadius)||oi.prototype._isHidden.call(this,e,t)};hu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!Y.isConstant(t.slices)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)};hu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=Y.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?Zt.ALL:void 0};hu.prototype._onEntityPropertyChanged=rg;hu.DynamicGeometryUpdater=IC;function IC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(IC.prototype=Object.create(ii.prototype),IC.prototype.constructor=IC);IC.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,d$e);return!c(o)||!c(i.length)||!c(i.topRadius)||!c(i.bottomRadius)||ii.prototype._isHidden.call(this,e,t,n)};IC.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,qe.NONE),o=this._options;o.length=Y.getValueOrUndefined(t.length,n),o.topRadius=Y.getValueOrUndefined(t.topRadius,n),o.bottomRadius=Y.getValueOrUndefined(t.bottomRadius,n),o.slices=Y.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==qe.NONE?Zt.ALL:void 0};var R3=hu;var m$e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},$r=Object.freeze(m$e);var p$e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},_o=Object.freeze(p$e);var _$e={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3},Il=Object.freeze(_$e);var Vue=jr(ql(),1);function g$e(e){if(!c(e))throw new C("uri is required.");let t=new Vue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var ly=g$e;var y$e=O.factorial;function uq(e,t,n,i,o,r){let s=0,a,l,u;if(i>0){for(l=0;l<o;l++){for(a=!1,u=0;u<r.length&&!a;u++)l===r[u]&&(a=!0);a||(r.push(l),s+=uq(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,l=0;l<o;l++){for(a=!1,u=0;u<r.length&&!a;u++)l===r[u]&&(a=!0);a||(s*=e-n[t[l]])}return s}var M3={type:"Hermite"};M3.getRequiredDataPoints=function(e,t){if(t=t??0,!c(e))throw new C("degree is required.");if(e<0)throw new C("degree must be 0 or greater.");if(t<0)throw new C("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)};M3.interpolateOrderZero=function(e,t,n,i,o){c(o)||(o=new Array(i));let r,s,a,l,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(h);for(p[r]=b,s=0;s<h;s++)b[s]=[]}let g=h,m=new Array(g);for(r=0;r<g;r++)m[r]=r;let y=h-1;for(l=0;l<i;l++){for(s=0;s<g;s++)f=m[s]*i+l,p[l][0].push(n[f]);for(r=1;r<g;r++){let b=!1;for(s=0;s<g-r;s++){let x=t[m[s]],A=t[m[s+r]],E;A-x<=0?(f=m[s]*i+i*r+l,E=n[f],p[l][r].push(E/y$e(r))):(E=p[l][r-1][s+1]-p[l][r-1][s],p[l][r].push(E/(A-x))),b=b||E!==0}b||(y=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=y;r++){let b=uq(e,m,t,a,r,[]);for(l=0;l<i;l++){let x=p[l][r][0];o[l+a*i]+=x*b}}return o};var b$e=[];M3.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);c(s)||(s=new Array(a));for(let x=0;x<a;x++)s[x]=0;let l=t.length,u=new Array(l*(o+1)),f;for(f=0;f<l;f++)for(let x=0;x<o+1;x++)u[f*(o+1)+x]=f;let h=u.length,p=b$e,g=x$e(p,u,t,n,i,o),m=[],y=h*(h+1)/2,b=Math.min(g,r);for(let x=0;x<=b;x++)for(f=x;f<=g;f++){m.length=0;let A=uq(e,u,t,x,f,m),E=Math.floor(f*(1-f)/2)+h*f;for(let S=0;S<i;S++){let v=Math.floor(S*y),P=p[v+E];s[S+x*i]+=P*A}}return s};function x$e(e,t,n,i,o,r){let s,a,l=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let x=n[t[s]],A=n[t[s+g]],E,S;if(A-x<=0)a=t[s]*o*(r+1)+o*g+h,E=i[a],S=E/O.factorial(g),e[p+y+m]=S,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);E=e[p+v+s+1]-e[p+v+s],S=E/(A-x),e[p+y+m]=S,m++}b=b||E!==0}b&&(l=Math.max(l,g))}}return l}var L3=M3;var fq={type:"Lagrange"};fq.getRequiredDataPoints=function(e){return Math.max(e+1,2)};fq.interpolateOrderZero=function(e,t,n,i,o){c(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 l=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];l*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=l*n[r*i+s]}return o};var N3=fq;var dq={type:"Linear"};dq.getRequiredDataPoints=function(e){return 2};dq.interpolateOrderZero=function(e,t,n,i,o){if(t.length!==2)throw new C("The xTable provided to the linear interpolator must have exactly two elements.");if(i<=0)throw new C("There must be at least 1 dependent variable for each independent variable.");c(o)||(o=new Array(i));let r,s,a,l=t[0],u=t[1];if(l===u)throw new C("Divide by zero error: xTable[0] and xTable[1] are equal");for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-l*a)/(u-l);return o};var jb=dq;function lc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}lc.fromCartesian3=function(e,t){T.typeOf.object("cartesian3",e);let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return c(t)||(t=new lc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};lc.clone=function(e,t){if(c(e))return c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new lc(e.clock,e.cone,e.magnitude)};lc.normalize=function(e,t){return T.typeOf.object("spherical",e),c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new lc(e.clock,e.cone,1)};lc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};lc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};lc.prototype.equals=function(e){return lc.equals(this,e)};lc.prototype.clone=function(e){return lc.clone(this,e)};lc.prototype.equalsEpsilon=function(e,t){return lc.equalsEpsilon(this,e,t)};lc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var F3=lc;var WD=jr(ql(),1);var hq;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?hq=function(){return performance.now()}:hq=function(){return Date.now()};var Ei=hq;function mq(e){e=e??W.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;if(c(t)?t=Q.clone(t):c(n)?t=Q.clone(n):c(i)?t=Q.addDays(i,-1,new Q):t=Q.now(),c(n)?n=Q.clone(n):n=Q.clone(t),c(i)?i=Q.clone(i):i=Q.addDays(n,1,new Q),Q.greaterThan(n,i))throw new C("startTime must come before stopTime.");this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??$r.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new pe,this.onStop=new pe,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ei(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??_o.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(mq.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===_o.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===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});mq.prototype.tick=function(){let e=Ei(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===_o.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===_o.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===$r.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===$r.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 mm=mq;function Wb(){this._definitionChanged=new pe,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(Wb.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:yl("startTime"),stopTime:yl("stopTime"),currentTime:yl("currentTime"),clockRange:yl("clockRange"),clockStep:yl("clockStep"),multiplier:yl("multiplier")});Wb.prototype.clone=function(e){return c(e)||(e=new Wb),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};Wb.prototype.equals=function(e){return this===e||c(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};Wb.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};Wb.prototype.getValue=function(e){return c(e)||(e=new mm),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var pm=Wb;var T$e=G.WHITE,A$e=.1,C$e=new z(8,8),E$e=new z(0,0),S$e=new z(1,1);function OC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(OC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._cellAlpha)&&Y.isConstant(this._lineCount)&&Y.isConstant(this._lineThickness)&&Y.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),cellAlpha:fe("cellAlpha"),lineCount:fe("lineCount"),lineThickness:fe("lineThickness"),lineOffset:fe("lineOffset")});OC.prototype.getType=function(e){return"Grid"};var w$e=new Q;OC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(w$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,T$e,t.color),t.cellAlpha=Y.getValueOrDefault(this._cellAlpha,e,A$e),t.lineCount=Y.getValueOrClonedDefault(this._lineCount,e,C$e,t.lineCount),t.lineThickness=Y.getValueOrClonedDefault(this._lineThickness,e,S$e,t.lineThickness),t.lineOffset=Y.getValueOrClonedDefault(this._lineOffset,e,E$e,t.lineOffset),t};OC.prototype.equals=function(e){return this===e||e instanceof OC&&Y.equals(this._color,e._color)&&Y.equals(this._cellAlpha,e._cellAlpha)&&Y.equals(this._lineCount,e._lineCount)&&Y.equals(this._lineThickness,e._lineThickness)&&Y.equals(this._lineOffset,e._lineOffset)};var ND=OC;function RC(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(RC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});RC.prototype.getType=function(e){return"PolylineArrow"};var v$e=new Q;RC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(v$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};RC.prototype.equals=function(e){return this===e||e instanceof RC&&Y.equals(this._color,e._color)};var FD=RC;var D$e=G.WHITE,P$e=G.TRANSPARENT,I$e=16,O$e=255;function MC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(MC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._gapColor)&&Y.isConstant(this._dashLength)&&Y.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),gapColor:fe("gapColor"),dashLength:fe("dashLength"),dashPattern:fe("dashPattern")});MC.prototype.getType=function(e){return"PolylineDash"};var R$e=new Q;MC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(R$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,D$e,t.color),t.gapColor=Y.getValueOrClonedDefault(this._gapColor,e,P$e,t.gapColor),t.dashLength=Y.getValueOrDefault(this._dashLength,e,I$e,t.dashLength),t.dashPattern=Y.getValueOrDefault(this._dashPattern,e,O$e,t.dashPattern),t};MC.prototype.equals=function(e){return this===e||e instanceof MC&&Y.equals(this._color,e._color)&&Y.equals(this._gapColor,e._gapColor)&&Y.equals(this._dashLength,e._dashLength)&&Y.equals(this._dashPattern,e._dashPattern)};var BD=MC;var M$e=G.WHITE,L$e=.25,N$e=1;function LC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(LC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),glowPower:fe("glowPower"),taperPower:fe("taperPower")});LC.prototype.getType=function(e){return"PolylineGlow"};var F$e=new Q;LC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(F$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,M$e,t.color),t.glowPower=Y.getValueOrDefault(this._glowPower,e,L$e,t.glowPower),t.taperPower=Y.getValueOrDefault(this._taperPower,e,N$e,t.taperPower),t};LC.prototype.equals=function(e){return this===e||e instanceof LC&&Y.equals(this._color,e._color)&&Y.equals(this._glowPower,e._glowPower)&&Y.equals(this._taperPower,e._taperPower)};var kD=LC;var B$e=G.WHITE,k$e=G.BLACK,U$e=1;function NC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(NC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._outlineColor)&&Y.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth")});NC.prototype.getType=function(e){return"PolylineOutline"};var V$e=new Q;NC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(V$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,B$e,t.color),t.outlineColor=Y.getValueOrClonedDefault(this._outlineColor,e,k$e,t.outlineColor),t.outlineWidth=Y.getValueOrDefault(this._outlineWidth,e,U$e),t};NC.prototype.equals=function(e){return this===e||e instanceof NC&&Y.equals(this._color,e._color)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._outlineWidth,e._outlineWidth)};var qb=NC;function r_(e,t){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new Ar,this._referenceFrame=t??zi.FIXED,this.setValue(e)}Object.defineProperties(r_.prototype,{isConstant:{get:function(){let e=this._value;if(!c(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var z$e=new Q;r_.prototype.getValue=function(e,t){return c(e)||(e=Q.now(z$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};r_.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._value;if(!c(i))return;let o=i.length;c(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let l=i[r].getValueInReferenceFrame(e,t,n[r]);c(l)&&(n[s]=l,s++),r++}return n.length=s,n};r_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,r_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};r_.prototype.equals=function(e){return this===e||e instanceof r_&&this._referenceFrame===e._referenceFrame&&Y.arrayEquals(this._value,e._value)};r_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var uy=r_;function fy(e){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new Ar,this.setValue(e)}Object.defineProperties(fy.prototype,{isConstant:{get:function(){let e=this._value;if(!c(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var H$e=new Q;fy.prototype.getValue=function(e,t){c(e)||(e=Q.now(H$e));let n=this._value;if(!c(n))return;let i=n.length;c(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);c(a)&&(t[r]=a,r++),o++}return t.length=r,t};fy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,fy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};fy.prototype.equals=function(e){return this===e||e instanceof fy&&Y.arrayEquals(this._value,e._value)};fy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var UD=fy;function Yb(e){let t=e._targetProperty;if(!c(t)){let n=e._targetEntity;if(!c(n)){if(n=e._targetCollection.getById(e._targetId),!c(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(mu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&c(t);++o)t=t[i[o]];e._targetProperty=t}return t}function mu(e,t,n){if(!c(e))throw new C("targetCollection is required.");if(!c(t)||t==="")throw new C("targetId is required.");if(!c(n)||n.length===0)throw new C("targetPropertyNames is required.");for(let i=0;i<n.length;i++){let o=n[i];if(!c(o)||o==="")throw new C("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new pe,e.collectionChanged.addEventListener(mu.prototype._onCollectionChanged,this)}Object.defineProperties(mu.prototype,{isConstant:{get:function(){return Y.isConstant(Yb(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Yb(this);return c(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 Yb(this)}}});mu.fromString=function(e,t){if(!c(e))throw new C("targetCollection is required.");if(!c(t))throw new C("referenceString is required.");let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let l=t.charAt(a);r?(s+=l,r=!1):l==="\\"?r=!0:o&&l==="#"?(n=s,o=!1,s=""):!o&&l==="."?(i.push(s),s=""):s+=l}return i.push(s),new mu(e,n,i)};var G$e=new Q;mu.prototype.getValue=function(e,t){let n=Yb(this);return c(e)||(e=Q.now(G$e)),c(n)?n.getValue(e,t):void 0};mu.prototype.getValueInReferenceFrame=function(e,t,n){let i=Yb(this);return c(i)?i.getValueInReferenceFrame(e,t,n):void 0};mu.prototype.getType=function(e){let t=Yb(this);return c(t)?t.getType(e):void 0};mu.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};mu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){c(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};mu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;c(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(mu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):c(i)||(i=Yb(this),c(i)&&this._definitionChanged.raiseEvent(this))};var dy=mu;var j$e={packedLength:1,pack:function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n]=e,t},unpack:function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){if(!c(e))throw new C("packedArray is required");c(i)||(i=[]),t=t??0,n=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-O.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){if(!c(e))throw new C("array is required");if(!c(t))throw new C("sourceArray is required");return o=e[0],o<0?o+O.TWO_PI:o}},Vd=j$e;var zue={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function Hue(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 Gue(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var pq=[],_q=[];function B3(e,t,n,i,o){let r=0,s,a,l,u,f,h;for(;r<i.length;){f=Gue(i[r],e),l=Mo(t,f,Q.compare);let p=0,g=0;if(l<0){for(l=~l,u=l*o,a=void 0,h=t[l];r<i.length&&(f=Gue(i[r],e),!(c(a)&&Q.compare(a,f)>=0||c(h)&&Q.compare(f,h)>=0));){for(pq[p++]=f,r=r+1,s=0;s<o;s++)_q[g++]=i[r],r=r+1;a=f}p>0&&(_q.length=g,Hue(n,u,_q),pq.length=p,Hue(t,l,pq))}else{for(s=0;s<o;s++)r++,n[l*o+s]=i[r];r++}}}function Nf(e,t){T.defined("type",e);let n=e;n===Number&&(n=zue);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(c(t)){let a=t.length;s=new Array(a);for(let l=0;l<a;l++){let u=t[l];u===Number&&(u=zue);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,s[l]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=jb,this._lastInterpolationAlgorithm=jb,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 pe,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=Il.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Il.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Nf.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 W$e=new Q;Nf.prototype.getValue=function(e,t){c(e)||(e=Q.now(W$e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Mo(n,e,Q.compare);var l=!1;if(a<0){if(a=~a,a===0){let P=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Il.NONE||o!==0&&Q.secondsDifference(P,e)>o)return;if(this._backwardExtrapolationType===Il.HOLD)return r.unpack(s,0,t);l=this._backwardExtrapolationType===Il.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let P=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Il.NONE||o!==0&&Q.secondsDifference(e,P)>o)return;if(this._forwardExtrapolationType===Il.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);l=this._forwardExtrapolationType===Il.LINEAR_EXTRAPOLATE}let h=this._xTable,p=this._yTable;var u,f;l?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let P=Math.min(u.getRequiredDataPoints(f,m),i);P!==this._numberOfPoints&&(this._numberOfPoints=P,h.length=P,p.length=P*g)}let y=this._numberOfPoints-1;if(y<1)return;let b=0,x=i-1;if(x-b+1>=y+1){let P=a-(y/2|0)-1;P<b&&(P=b);let M=P+y;M>x&&(M=x,P=M-y,P<b&&(P=b)),b=P,x=M}let E=x-b+1;for(let P=0;P<E;++P)h[P]=Q.secondsDifference(n[b+P],n[x]);if(c(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,b,x,p);else{let P=0,M=this._packedLength,R=b*M,L=(x+1)*M;for(;R<L;)p[P]=s[R],R++,P++}let S=Q.secondsDifference(e,n[x]),v;if(m===0||!c(u.interpolate))v=u.interpolateOrderZero(S,h,p,g,this._interpolationResult);else{let P=Math.floor(g/(m+1));v=u.interpolate(S,h,p,P,m,m,this._interpolationResult)}return c(r.unpackInterpolationResult)?r.unpackInterpolationResult(v,s,b,x,t):r.unpack(v,0,t)}return r.unpack(s,a*this._packedLength,t)};Nf.prototype.setInterpolationOptions=function(e){if(!c(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;c(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),c(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Nf.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);T.defined("time",e),T.defined("value",t),o&&T.defined("derivatives",n);let r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let l=0;l<a;l++)i[l].pack(n[l],s,s.length)}B3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);if(T.defined("times",e),T.defined("values",t),e.length!==t.length)throw new C("times and values must be the same length.");if(o&&(!c(n)||n.length!==e.length))throw new C("times and derivativeValues must be the same length.");let r=this._innerType,s=e.length,a=[];for(let l=0;l<s;l++)if(a.push(e[l]),r.pack(t[l],a,a.length),o){let u=n[l],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],a,a.length)}B3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.getSample=function(e){T.typeOf.number("index",e);let t=this._times,n=t.length;if(c(n))return e<0&&(e+=n),t[e]};Nf.prototype.addSamplesPackedArray=function(e,t){T.defined("packedSamples",e),B3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.removeSample=function(e){T.defined("time",e);let t=Mo(this._times,e,Q.compare);return t<0?!1:(jue(this,t,1),!0)};function jue(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)}Nf.prototype.removeSamples=function(e){T.defined("timeInterval",e);let t=this._times,n=Mo(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Mo(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,jue(this,n,i-n)};Nf.prototype.equals=function(e){if(this===e)return!0;if(!c(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=c(t),i=e._derivativeTypes,o=c(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,l=e._times;if(s=a.length,s!==l.length)return!1;for(r=0;r<s;r++)if(!Q.equals(a[r],l[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};Nf._mergeNewSamples=B3;var Ff=Nf;function Bf(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new Ff(d,n),this._definitionChanged=new pe,this._referenceFrame=e??zi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Bf.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 q$e=new Q;Bf.prototype.getValue=function(e,t){return c(e)||(e=Q.now(q$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Bf.prototype.getValueInReferenceFrame=function(e,t,n){if(T.defined("time",e),T.defined("referenceFrame",t),n=this._property.getValue(e,n),c(n))return Fh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Bf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Bf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;if(i>0&&(!c(n)||n.length!==i))throw new C("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)};Bf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Bf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Bf.prototype.removeSample=function(e){return this._property.removeSample(e)};Bf.prototype.removeSamples=function(e){this._property.removeSamples(e)};Bf.prototype.equals=function(e){return this===e||e instanceof Bf&&Y.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ia=Bf;var Y$e={HORIZONTAL:0,VERTICAL:1},_m=Object.freeze(Y$e);var X$e=_m.HORIZONTAL,K$e=G.WHITE,$$e=G.BLACK,Z$e=0,Q$e=1;function FC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,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(FC.prototype,{isConstant:{get:function(){return Y.isConstant(this._orientation)&&Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._offset)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:fe("orientation"),evenColor:fe("evenColor"),oddColor:fe("oddColor"),offset:fe("offset"),repeat:fe("repeat")});FC.prototype.getType=function(e){return"Stripe"};var J$e=new Q;FC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(J$e)),c(t)||(t={}),t.horizontal=Y.getValueOrDefault(this._orientation,e,X$e)===_m.HORIZONTAL,t.evenColor=Y.getValueOrClonedDefault(this._evenColor,e,K$e,t.evenColor),t.oddColor=Y.getValueOrClonedDefault(this._oddColor,e,$$e,t.oddColor),t.offset=Y.getValueOrDefault(this._offset,e,Z$e),t.repeat=Y.getValueOrDefault(this._repeat,e,Q$e),t};FC.prototype.equals=function(e){return this===e||e instanceof FC&&Y.equals(this._orientation,e._orientation)&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._offset,e._offset)&&Y.equals(this._repeat,e._repeat)};var VD=FC;function hy(e){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(hy.prototype._intervalsChanged,this),this._referenceFrame=e??zi.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 eZe=new Q;hy.prototype.getValue=function(e,t){return c(e)||(e=Q.now(eZe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};hy.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._intervals.findDataForIntervalContainingDate(e);if(c(i))return Fh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};hy.prototype.equals=function(e){return this===e||e instanceof hy&&this._intervals.equals(e._intervals,Y.equals)&&this._referenceFrame===e._referenceFrame};hy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var my=hy;function Xb(){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(Xb.prototype._intervalsChanged,this)}Object.defineProperties(Xb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var tZe=new Q;Xb.prototype.getValue=function(e,t){c(e)||(e=Q.now(tZe));let n=this._intervals.findDataForIntervalContainingDate(e);return c(n)&&typeof n.clone=="function"?n.clone(t):n};Xb.prototype.equals=function(e){return this===e||e instanceof Xb&&this._intervals.equals(e._intervals,Y.equals)};Xb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var py=Xb;function BC(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new pe,this._normalize=t??!0,this.position=e}Object.defineProperties(BC.prototype,{isConstant:{get:function(){return Y.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(c(t)&&this._subscription(),this._position=e,c(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 nZe=new d,Wue=new d,que=new Q,iZe=new Q,gq=1/60;BC.prototype.getValue=function(e,t){return this._getValue(e,t)};BC.prototype._getValue=function(e,t,n){c(e)||(e=Q.now(iZe)),c(t)||(t=new d);let i=this._position;if(Y.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,nZe),r=i.getValue(Q.addSeconds(e,gq,que),Wue);if(!c(o)||!c(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-gq,que),Wue),!c(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);c(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,gq,t)};BC.prototype.equals=function(e){return this===e||e instanceof BC&&Y.equals(this._position,e._position)};var _y=BC;function zD(e,t){this._velocityVectorProperty=new _y(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new pe,this.ellipsoid=t??ie.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(zD.prototype,{isConstant:{get:function(){return Y.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 Yue=new d,oZe=new d,Xue=new J,rZe=new Q;zD.prototype.getValue=function(e,t){c(e)||(e=Q.now(rZe));let n=this._velocityVectorProperty._getValue(e,oZe,Yue);if(c(n))return Ot.rotationMatrixFromPositionVelocity(Yue,n,this._ellipsoid,Xue),Le.fromRotationMatrix(Xue,t)};zD.prototype.equals=function(e){return this===e||e instanceof zD&&Y.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var k3=zD;var s_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};s_.validate=function(e){return e===s_.COMPLETE||e===s_.BELOW_ELLIPSOID_HORIZON||e===s_.ABOVE_ELLIPSOID_HORIZON};s_.toString=function(e){switch(e){case s_.COMPLETE:return"COMPLETE";case s_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case s_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new C("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var HD=s_;function gy(){}gy.packedLength=d.packedLength;gy.unpack=d.unpack;gy.pack=d.pack;var yq;function GD(e,t){return t[0]==="#"&&(t=yq+t),dy.fromString(e,t)}function Kue(e,t,n){if(c(n.reference))return GD(t,n.reference);if(c(n.velocityReference)){let i=GD(t,n.velocityReference);switch(e){case d:case gy:return new _y(i,e===gy);case Le:return new k3(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function sZe(e,t){return new Vh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Ui=new d,qc=new F3,uc=new he,Kb=new Sn,U3=new Le;function aZe(e){let t=e.rgbaf;if(c(t))return t;let n=e.rgba;if(!c(n))return;let i=n.length;if(i===G.packedLength)return[G.byteToFloat(n[0]),G.byteToFloat(n[1]),G.byteToFloat(n[2]),G.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=G.byteToFloat(n[o+1]),t[o+2]=G.byteToFloat(n[o+2]),t[o+3]=G.byteToFloat(n[o+3]),t[o+4]=G.byteToFloat(n[o+4]);return t}function $ue(e,t){let n=e.uri??e;return c(t)?t.getDerivedResource({url:n}):we.createIfNeeded(n)}function cZe(e){let t=e.wsen;if(c(t))return t;let n=e.wsenDegrees;if(!c(n))return;let i=n.length;if(i===ce.packedLength)return[O.toRadians(n[0]),O.toRadians(n[1]),O.toRadians(n[2]),O.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=O.toRadians(n[o+1]),t[o+2]=O.toRadians(n[o+2]),t[o+3]=O.toRadians(n[o+3]),t[o+4]=O.toRadians(n[o+4]);return t}function lZe(e){let t=e.length;if(qc.magnitude=1,t===2)return qc.clock=e[0],qc.cone=e[1],d.fromSpherical(qc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],qc.clock=e[i+1],qc.cone=e[i+2],d.fromSpherical(qc,Ui),n[o+1]=Ui.x,n[o+2]=Ui.y,n[o+3]=Ui.z;return n}function uZe(e){let t=e.length;if(t===3)return qc.clock=e[0],qc.cone=e[1],qc.magnitude=e[2],d.fromSpherical(qc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],qc.clock=e[i+1],qc.cone=e[i+2],qc.magnitude=e[i+3],d.fromSpherical(qc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function fZe(e){let t=e.length;if(t===3)return uc.longitude=e[0],uc.latitude=e[1],uc.height=e[2],ie.default.cartographicToCartesian(uc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],uc.longitude=e[i+1],uc.latitude=e[i+2],uc.height=e[i+3],ie.default.cartographicToCartesian(uc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function dZe(e){let t=e.length;if(t===3)return uc.longitude=O.toRadians(e[0]),uc.latitude=O.toRadians(e[1]),uc.height=e[2],ie.default.cartographicToCartesian(uc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],uc.longitude=O.toRadians(e[i+1]),uc.latitude=O.toRadians(e[i+2]),uc.height=e[i+3],ie.default.cartographicToCartesian(uc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function bq(e){let t=e.cartesian;if(c(t))return t;let n=e.cartesianVelocity;if(c(n))return n;let i=e.unitCartesian;if(c(i))return i;let o=e.unitSpherical;if(c(o))return lZe(o);let r=e.spherical;if(c(r))return uZe(r);let s=e.cartographicRadians;if(c(s))return fZe(s);let a=e.cartographicDegrees;if(c(a))return dZe(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Zue(e,t){d.unpack(e,t,Ui),d.normalize(Ui,Ui),d.pack(Ui,e,t)}function hZe(e){let t=bq(e);if(t.length===3)return Zue(t,0),t;for(let n=1;n<t.length;n+=4)Zue(t,n);return t}function Que(e,t){Le.unpack(e,t,U3),Le.normalize(U3,U3),Le.pack(U3,e,t)}function mZe(e){let t=e.unitQuaternion;if(c(t)){if(t.length===4)return Que(t,0),t;for(let n=1;n<t.length;n+=5)Que(t,n)}return t}function Jue(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")?z:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?gy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?G:e.hasOwnProperty("arcType")?qt:e.hasOwnProperty("classificationType")?Un:e.hasOwnProperty("colorBlendMode")?kc:e.hasOwnProperty("cornerType")?ki:e.hasOwnProperty("heightReference")?qe:e.hasOwnProperty("horizontalOrigin")?xi:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?Ko:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Bt:e.hasOwnProperty("distanceDisplayCondition")?Lt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("shadowMode")?Tn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?_m:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?WD.default:e.hasOwnProperty("verticalOrigin")?Fn:Object}function pZe(e,t,n){switch(e){case qt:return qt[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Ke:return t.boundingRectangle;case z:return t.cartesian2;case d:return bq(t);case gy:return hZe(t);case G:return aZe(t);case Un:return Un[t.classificationType??t];case kc:return kc[t.colorBlendMode??t];case ki:return ki[t.cornerType??t];case qe:return qe[t.heightReference??t];case xi:return xi[t.horizontalOrigin??t];case Image:return $ue(t,n);case Q:return Q.fromIso8601(t.date??t);case Ko:return Ko[t.labelStyle??t];case Number:return t.number??t;case Bt:return t.nearFarScalar;case Lt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Le:return mZe(t);case Vd:return t.number??t;case HD:return HD[t.portionToDisplay??t];case Tn:return Tn[t.shadowMode??t.shadows??t];case String:return t.string??t;case _m:return _m[t.stripeOrientation??t];case ce:return cZe(t);case WD.default:return $ue(t,n);case Fn:return Fn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var _Ze={HERMITE:L3,LAGRANGE:N3,LINEAR:jb};function V3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(c(n)||c(i))&&t.setInterpolationOptions({interpolationAlgorithm:_Ze[n],interpolationDegree:i});let o=e.forwardExtrapolationType;c(o)&&(t.forwardExtrapolationType=Il[o]);let r=e.forwardExtrapolationDuration;c(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;c(s)&&(t.backwardExtrapolationType=Il[s]);let a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}var efe={iso8601:void 0};function ur(e){if(c(e))return efe.iso8601=e,Sn.fromIso8601(efe)}function xq(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function tfe(e){let t=new Gc;return t.intervals.addInterval(xq(e)),t}function nfe(e){let t=new Pa(e.referenceFrame);return t.intervals.addInterval(xq(e)),t}function z3(e,t,n,i,o,r,s){let a=ur(i.interval);c(o)&&(c(a)?a=Sn.intersect(a,o,Kb):a=o);let l,u,f,h=!c(i.reference)&&!c(i.velocityReference),p=c(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return hfe(t[n],a)}let g=!1;if(h){if(u=pZe(e,i,r),!c(u))return;l=e.packedLength??1,f=u.length??1,g=!c(i.array)&&typeof u!="string"&&f>l&&e!==Object}let m=typeof e.unpack=="function"&&e!==Vd;if(!g&&!p){h?t[n]=new Xn(m?e.unpack(u,0):u):t[n]=Kue(e,s,i);return}let y=t[n],b,x=i.epoch;if(c(x)&&(b=Q.fromIso8601(x)),g&&!p){y instanceof Ff||(t[n]=y=new Ff(e)),y.addSamplesPackedArray(u,b),V3(i,y);return}let A;if(!g&&p){a=a.clone(),h?a.data=m?e.unpack(u,0):u:a.data=Kue(e,s,i),c(y)||(t[n]=y=h?new py:new Gc),h&&y instanceof py?y.intervals.addInterval(a):y instanceof Gc?(h&&(a.data=new Xn(a.data)),y.intervals.addInterval(a)):(t[n]=y=tfe(y),h&&(a.data=new Xn(a.data)),y.intervals.addInterval(a));return}c(y)||(t[n]=y=new Gc),y instanceof Gc||(t[n]=y=tfe(y));let E=y.intervals;A=E.findInterval(a),(!c(A)||!(A.data instanceof Ff))&&(A=a.clone(),A.data=new Ff(e),E.addInterval(A)),A.data.addSamplesPackedArray(u,b),V3(i,A.data)}function hfe(e,t){if(e instanceof Ff){e.removeSamples(t);return}else if(e instanceof py){e.intervals.removeInterval(t);return}else if(e instanceof Gc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,Kb);o.isEmpty||hfe(o.data,t)}n.removeInterval(t);return}}function be(e,t,n,i,o,r,s){if(c(i))if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)z3(e,t,n,i[a],o,r,s);else z3(e,t,n,i,o,r,s)}function ife(e,t,n,i,o,r){let s=ur(n.interval);c(i)&&(c(s)?s=Sn.intersect(s,i,Kb):s=i);let a=c(n.cartesianVelocity)?1:0,l=d.packedLength*(a+1),u,f,h=!c(n.reference),p=c(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return mfe(e[t],s)}let g,m=!1;if(h&&(c(n.referenceFrame)&&(g=zi[n.referenceFrame]),g=g??zi.FIXED,u=bq(n),f=u.length??1,m=f>l),!m&&!p){h?e[t]=new gl(d.unpack(u),g):e[t]=GD(r,n.reference);return}let y=e[t],b,x=n.epoch;if(c(x)&&(b=Q.fromIso8601(x)),m&&!p){(!(y instanceof Ia)||c(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ia(g,a)),y.addSamplesPackedArray(u,b),V3(n,y);return}let A;if(!m&&p){s=s.clone(),h?s.data=d.unpack(u):s.data=GD(r,n.reference),c(y)||(h?y=new my(g):y=new Pa(g),e[t]=y),h&&y instanceof my&&c(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof Pa?(h&&(s.data=new gl(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=nfe(y),h&&(s.data=new gl(s.data,g)),y.intervals.addInterval(s));return}c(y)?y instanceof Pa||(e[t]=y=nfe(y)):e[t]=y=new Pa(g);let E=y.intervals;A=E.findInterval(s),(!c(A)||!(A.data instanceof Ia)||c(g)&&A.data.referenceFrame!==g)&&(A=s.clone(),A.data=new Ia(g,a),E.addInterval(A)),A.data.addSamplesPackedArray(u,b),V3(n,A.data)}function mfe(e,t){if(e instanceof Ia){e.removeSamples(t);return}else if(e instanceof my){e.intervals.removeInterval(t);return}else if(e instanceof Pa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,Kb);o.isEmpty||mfe(o.data,t)}n.removeInterval(t);return}}function pfe(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)ife(e,t,n[s],i,o,r);else ife(e,t,n,i,o,r)}function ofe(e,t,n,i){c(n.references)?H3(e,t,n.references,n.interval,i,UD,Gc):(c(n.cartesian2)?n.array=z.unpackArray(n.cartesian2):c(n.cartesian)&&(n.array=z.unpackArray(n.cartesian)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i))}function rfe(e,t,n,i,o,r){let s=ur(n.interval);c(i)&&(c(s)?s=Sn.intersect(s,i,Kb):s=i);let a=e[t],l,u;if(c(s)){a instanceof SD||(a=new SD,e[t]=a);let h=a.intervals;u=h.findInterval({start:s.start,stop:s.stop}),c(u)?l=u.data:(u=s.clone(),h.addInterval(u))}else l=a;let f;c(n.solidColor)?(l instanceof Ut||(l=new Ut),f=n.solidColor,be(G,l,"color",f.color,void 0,void 0,r)):c(n.grid)?(l instanceof ND||(l=new ND),f=n.grid,be(G,l,"color",f.color,void 0,o,r),be(Number,l,"cellAlpha",f.cellAlpha,void 0,o,r),be(z,l,"lineCount",f.lineCount,void 0,o,r),be(z,l,"lineThickness",f.lineThickness,void 0,o,r),be(z,l,"lineOffset",f.lineOffset,void 0,o,r)):c(n.image)?(l instanceof Q0||(l=new Q0),f=n.image,be(Image,l,"image",f.image,void 0,o,r),be(z,l,"repeat",f.repeat,void 0,o,r),be(G,l,"color",f.color,void 0,o,r),be(Boolean,l,"transparent",f.transparent,void 0,o,r)):c(n.stripe)?(l instanceof VD||(l=new VD),f=n.stripe,be(_m,l,"orientation",f.orientation,void 0,o,r),be(G,l,"evenColor",f.evenColor,void 0,o,r),be(G,l,"oddColor",f.oddColor,void 0,o,r),be(Number,l,"offset",f.offset,void 0,o,r),be(Number,l,"repeat",f.repeat,void 0,o,r)):c(n.polylineOutline)?(l instanceof qb||(l=new qb),f=n.polylineOutline,be(G,l,"color",f.color,void 0,o,r),be(G,l,"outlineColor",f.outlineColor,void 0,o,r),be(Number,l,"outlineWidth",f.outlineWidth,void 0,o,r)):c(n.polylineGlow)?(l instanceof kD||(l=new kD),f=n.polylineGlow,be(G,l,"color",f.color,void 0,o,r),be(Number,l,"glowPower",f.glowPower,void 0,o,r),be(Number,l,"taperPower",f.taperPower,void 0,o,r)):c(n.polylineArrow)?(l instanceof FD||(l=new FD),f=n.polylineArrow,be(G,l,"color",f.color,void 0,void 0,r)):c(n.polylineDash)?(l instanceof BD||(l=new BD),f=n.polylineDash,be(G,l,"color",f.color,void 0,void 0,r),be(G,l,"gapColor",f.gapColor,void 0,void 0,r),be(Number,l,"dashLength",f.dashLength,void 0,o,r),be(Number,l,"dashPattern",f.dashPattern,void 0,o,r)):c(n.checkerboard)&&(l instanceof TD||(l=new TD),f=n.checkerboard,be(G,l,"evenColor",f.evenColor,void 0,o,r),be(G,l,"oddColor",f.oddColor,void 0,o,r),be(z,l,"repeat",f.repeat,void 0,o,r)),c(u)?u.data=l:e[t]=l}function pu(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)rfe(e,t,n[s],i,o,r);else rfe(e,t,n,i,o,r)}function gZe(e,t,n,i){let o=t.name;c(o)&&(e.name=t.name)}function yZe(e,t,n,i){let o=t.description;c(o)&&be(String,e,"description",o,void 0,i,n)}function bZe(e,t,n,i){let o=t.position;c(o)&&pfe(e,"position",o,void 0,i,n)}function xZe(e,t,n,i){let o=t.viewFrom;c(o)&&be(d,e,"viewFrom",o,void 0,i,n)}function TZe(e,t,n,i){let o=t.orientation;c(o)&&be(Le,e,"orientation",o,void 0,i,n)}function AZe(e,t,n,i){let o=t.properties;if(c(o)){c(e.properties)||(e.properties=new bl);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,l=s.length;a<l;++a)z3(Jue(s[a]),e.properties,r,s[a],void 0,i,n);else z3(Jue(s),e.properties,r,s,void 0,i,n)}}}function H3(e,t,n,i,o,r,s){let a=n.map(function(l){return GD(o,l)});if(c(i)){i=ur(i);let l=e[t];if(!(l instanceof s)){let u=new s;u.intervals.addInterval(xq(l)),e[t]=l=u}i.data=new r(a),l.intervals.addInterval(i)}else e[t]=new r(a)}function sfe(e,t,n,i){let o=n.references;c(o)?H3(e,t,o,n.interval,i,UD,Gc):be(Array,e,t,n,void 0,void 0,i)}function afe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)sfe(e,t,n[o],i);else sfe(e,t,n,i)}function cfe(e,t,n,i){let o=n.references;c(o)?H3(e,t,o,n.interval,i,uy,Pa):(c(n.cartesian)?n.array=d.unpackArray(n.cartesian):c(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,ie.default):c(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,ie.default)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i))}function qD(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)cfe(e,t,n[o],i);else cfe(e,t,n,i)}function CZe(e){return d.unpackArray(e)}function EZe(e){return d.fromRadiansArrayHeights(e,ie.default)}function SZe(e){return d.fromDegreesArrayHeights(e,ie.default)}function lfe(e,t,n,i){let o=n.references;if(c(o)){let r=o.map(function(s){let a={};return H3(a,"positions",s,n.interval,i,uy,Pa),a.positions});e[t]=new uy(r)}else c(n.cartesian)?n.array=n.cartesian.map(CZe):c(n.cartographicRadians)?n.array=n.cartographicRadians.map(EZe):c(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(SZe)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i)}function wZe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)lfe(e,t,n[o],i);else lfe(e,t,n,i)}function vZe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)ofe(e,t,n[o],i);else ofe(e,t,n,i)}function DZe(e,t,n,i){let o=t.availability;if(!c(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)c(r)||(r=new Xr),r.addInterval(ur(o[s]));else r=new Xr,r.addInterval(ur(o));e.availability=r}function PZe(e,t,n,i,o){c(t)&&be(gy,e,"alignedAxis",t,n,i,o)}function IZe(e,t,n,i){let o=t.billboard;if(!c(o))return;let r=ur(o.interval),s=e.billboard;c(s)||(e.billboard=s=new wc),be(Boolean,s,"show",o.show,r,i,n),be(Image,s,"image",o.image,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(z,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"color",o.color,r,i,n),be(Vd,s,"rotation",o.rotation,r,i,n),PZe(s,o.alignedAxis,r,i,n),be(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"height",o.height,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function OZe(e,t,n,i){let o=t.box;if(!c(o))return;let r=ur(o.interval),s=e.box;c(s)||(e.box=s=new KT),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"dimensions",o.dimensions,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function RZe(e,t,n,i){let o=t.corridor;if(!c(o))return;let r=ur(o.interval),s=e.corridor;c(s)||(e.corridor=s=new ZT),be(Boolean,s,"show",o.show,r,i,n),qD(s,"positions",o.positions,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(ki,s,"cornerType",o.cornerType,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function MZe(e,t,n,i){let o=t.cylinder;if(!c(o))return;let r=ur(o.interval),s=e.cylinder;c(s)||(e.cylinder=s=new QT),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"length",o.length,r,i,n),be(Number,s,"topRadius",o.topRadius,r,i,n),be(Number,s,"bottomRadius",o.bottomRadius,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(Number,s,"slices",o.slices,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function LZe(e,t){let n=e.version;if(c(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(!c(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;c(e.name)&&(i.name=e.name);let o=e.clock;if(c(o)){let r=i.clock;c(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function NZe(e,t,n,i){let o=t.ellipse;if(!c(o))return;let r=ur(o.interval),s=e.ellipse;c(s)||(e.ellipse=s=new JT),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),be(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Vd,s,"rotation",o.rotation,r,i,n),be(Vd,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function FZe(e,t,n,i){let o=t.ellipsoid;if(!c(o))return;let r=ur(o.interval),s=e.ellipsoid;c(s)||(e.ellipsoid=s=new eA),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"radii",o.radii,r,i,n),be(d,s,"innerRadii",o.innerRadii,r,i,n),be(Number,s,"minimumClock",o.minimumClock,r,i,n),be(Number,s,"maximumClock",o.maximumClock,r,i,n),be(Number,s,"minimumCone",o.minimumCone,r,i,n),be(Number,s,"maximumCone",o.maximumCone,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"stackPartitions",o.stackPartitions,r,i,n),be(Number,s,"slicePartitions",o.slicePartitions,r,i,n),be(Number,s,"subdivisions",o.subdivisions,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function BZe(e,t,n,i){let o=t.label;if(!c(o))return;let r=ur(o.interval),s=e.label;c(s)||(e.label=s=new Bh),be(Boolean,s,"show",o.show,r,i,n),be(String,s,"text",o.text,r,i,n),be(String,s,"font",o.font,r,i,n),be(Ko,s,"style",o.style,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Boolean,s,"showBackground",o.showBackground,r,i,n),be(G,s,"backgroundColor",o.backgroundColor,r,i,n),be(z,s,"backgroundPadding",o.backgroundPadding,r,i,n),be(z,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"fillColor",o.fillColor,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function kZe(e,t,n,i){let o=t.model;if(!c(o))return;let r=ur(o.interval),s=e.model;c(s)||(e.model=s=new ng),be(Boolean,s,"show",o.show,r,i,n),be(WD.default,s,"uri",o.gltf,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),be(Number,s,"maximumScale",o.maximumScale,r,i,n),be(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),be(Boolean,s,"runAnimations",o.runAnimations,r,i,n),be(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"silhouetteColor",o.silhouetteColor,r,i,n),be(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),be(G,s,"color",o.color,r,i,n),be(kc,s,"colorBlendMode",o.colorBlendMode,r,i,n),be(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,l,u=o.nodeTransformations;if(c(u))if(Array.isArray(u))for(a=0,l=u.length;a<l;++a)ufe(s,u[a],r,i,n);else ufe(s,u,r,i,n);let f=o.articulations;if(c(f))if(Array.isArray(f))for(a=0,l=f.length;a<l;++a)ffe(s,f[a],r,i,n);else ffe(s,f,r,i,n)}function ufe(e,t,n,i,o){let r=ur(t.interval);c(n)&&(c(r)?r=Sn.intersect(r,n,Kb):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let l=0,u=a.length;l<u;++l){let f=a[l];if(f==="interval")continue;let h=t[f];if(!c(h))continue;c(s)||(e.nodeTransformations=s=new bl),s.hasProperty(f)||s.addProperty(f);let p=s[f];c(p)||(s[f]=p=new tA),be(d,p,"translation",h.translation,r,i,o),be(Le,p,"rotation",h.rotation,r,i,o),be(d,p,"scale",h.scale,r,i,o)}}function ffe(e,t,n,i,o){let r=ur(t.interval);c(n)&&(c(r)?r=Sn.intersect(r,n,Kb):r=n);let s=e.articulations,a=Object.keys(t);for(let l=0,u=a.length;l<u;++l){let f=a[l];if(f==="interval")continue;let h=t[f];c(h)&&(c(s)||(e.articulations=s=new bl),s.hasProperty(f)||s.addProperty(f),be(Number,s,f,h,r,i,o))}}function UZe(e,t,n,i){let o=t.path;if(!c(o))return;let r=ur(o.interval),s=e.path;c(s)||(e.path=s=new ig),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"leadTime",o.leadTime,r,i,n),be(Number,s,"trailTime",o.trailTime,r,i,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"resolution",o.resolution,r,i,n),pu(s,"material",o.material,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function VZe(e,t,n,i){let o=t.point;if(!c(o))return;let r=ur(o.interval),s=e.point;c(s)||(e.point=s=new iA),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"pixelSize",o.pixelSize,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"color",o.color,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function jD(e){this.polygon=e,this._definitionChanged=new pe}Object.defineProperties(jD.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!c(e)||e.isConstant)&&(!c(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});jD.prototype.getValue=function(e,t){let n;c(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return c(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),c(i)&&(i=i.map(function(o){return new ec(o)}))),c(t)?(t.positions=n,t.holes=i,t):new ec(n,i)};jD.prototype.equals=function(e){return this===e||e instanceof jD&&Y.equals(this.polygon._positions,e.polygon._positions)&&Y.equals(this.polygon._holes,e.polygon._holes)};function zZe(e,t,n,i){let o=t.polygon;if(!c(o))return;let r=ur(o.interval),s=e.polygon;c(s)||(e.polygon=s=new kh),be(Boolean,s,"show",o.show,r,i,n),qD(s,"_positions",o.positions,n),wZe(s,"_holes",o.holes,n),(c(s._positions)||c(s._holes))&&(s.hierarchy=new jD(s)),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Vd,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),be(Boolean,s,"closeTop",o.closeTop,r,i,n),be(Boolean,s,"closeBottom",o.closeBottom,r,i,n),be(qt,s,"arcType",o.arcType,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function HZe(e){return e?qt.GEODESIC:qt.NONE}function GZe(e,t,n,i){let o=t.polyline;if(!c(o))return;let r=ur(o.interval),s=e.polyline;if(c(s)||(e.polyline=s=new Oc),be(Boolean,s,"show",o.show,r,i,n),qD(s,"positions",o.positions,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),pu(s,"material",o.material,r,i,n),pu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),be(qt,s,"arcType",o.arcType,r,i,n),be(Boolean,s,"clampToGround",o.clampToGround,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n),c(o.followSurface)&&!c(o.arcType)){let a={};be(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=sZe(a.followSurface,HZe)}}function jZe(e,t,n,i){let o=t.polylineVolume;if(!c(o))return;let r=ur(o.interval),s=e.polylineVolume;c(s)||(e.polylineVolume=s=new oA),qD(s,"positions",o.positions,n),vZe(s,"shape",o.shape,n),be(Boolean,s,"show",o.show,r,i,n),be(ki,s,"cornerType",o.cornerType,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function WZe(e,t,n,i){let o=t.rectangle;if(!c(o))return;let r=ur(o.interval),s=e.rectangle;c(s)||(e.rectangle=s=new Uh),be(Boolean,s,"show",o.show,r,i,n),be(ce,s,"coordinates",o.coordinates,r,i,n),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Vd,s,"rotation",o.rotation,r,i,n),be(Vd,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function qZe(e,t,n,i){let o=t.tileset;if(!c(o))return;let r=ur(o.interval),s=e.tileset;c(s)||(e.tileset=s=new nA),be(Boolean,s,"show",o.show,r,i,n),be(WD.default,s,"uri",o.uri,r,i,n),be(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function YZe(e,t,n,i){let o=t.wall;if(!c(o))return;let r=ur(o.interval),s=e.wall;c(s)||(e.wall=s=new og),be(Boolean,s,"show",o.show,r,i,n),qD(s,"positions",o.positions,n),afe(s,"minimumHeights",o.minimumHeights,n),afe(s,"maximumHeights",o.maximumHeights,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function dfe(e,t,n,i,o){let r=e.id;if(c(r)||(r=jn()),yq=r,!c(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")LZe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;c(a)&&(s.parent=t.getOrCreateEntity(a));for(let l=n.length-1;l>-1;l--)n[l](s,e,t,i)}yq=void 0}function XZe(e){let t,n=e._documentPacket.clock;if(!c(n)){if(!c(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),l=Math.round(a/120);return t=new pm,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=$r.LOOP_STOP,t.multiplier=l,t.currentTime=Q.clone(r),t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}c(e._clock)?t=e._clock.clone():(t=new pm,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=$r.LOOP_STOP,t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=ur(n.interval);return c(i)&&(t.startTime=i.start,t.stopTime=i.stop),c(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),c(n.range)&&(t.clockRange=$r[n.range]??$r.LOOP_STOP),c(n.step)&&(t.clockStep=_o[n.step]??_o.SYSTEM_CLOCK_MULTIPLIER),c(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function _fe(e,t,n,i){if(!c(t))throw new C("czml is required.");n=n??W.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new At(s)),e._credit=s,typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;f<u;f++)a.push(l[f])}}return r=we.createIfNeeded(r),Kr.setLoading(e,!0),Promise.resolve(o).then(function(a){return KZe(e,a,r,i)}).catch(function(a){return Kr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function KZe(e,t,n,i){Kr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new gfe,o.removeAll()),cs._processCzml(t,o,n,void 0,e);let r=XZe(e),s=e._documentPacket;return c(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!c(e._name)&&c(n)&&(e._name=ly(n.getUrlComponent()),r=!0),Kr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function gfe(){this.name=void 0,this.clock=void 0}function cs(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._clock=void 0,this._documentPacket=new gfe,this._version=void 0,this._entityCollection=new la(this),this._entityCluster=new Lf,this._credit=void 0,this._resourceCredits=[]}cs.load=function(e,t){return new cs().load(e,t)};Object.defineProperties(cs.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){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});cs.updaters=[IZe,OZe,RZe,MZe,NZe,FZe,BZe,kZe,gZe,yZe,UZe,VZe,zZe,GZe,jZe,AZe,WZe,bZe,qZe,xZe,YZe,TZe,DZe];cs.registerUpdater=function(e){cs.updaters.includes(e)||cs.updaters.push(e)};cs.unregisterUpdater=function(e){if(cs.updaters.includes(e)){let t=cs.updaters.indexOf(e);cs.updaters.splice(t,1)}};cs.prototype.process=function(e,t){return _fe(this,e,t,!1)};cs.prototype.load=function(e,t){return _fe(this,e,t,!0)};cs.prototype.update=function(e){return!0};cs.processPacketData=be;cs.processPositionPacketData=pfe;cs.processMaterialPacketData=pu;cs._processCzml=function(e,t,n,i,o){if(i=i??cs.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)dfe(e[r],t,i,n,o);else dfe(e,t,i,n,o)};var G3=cs;function Yc(){this._dataSources=[],this._dataSourceAdded=new pe,this._dataSourceRemoved=new pe,this._dataSourceMoved=new pe}Object.defineProperties(Yc.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}}});Yc.prototype.add=function(e){if(!c(e))throw new C("dataSource is required.");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})};Yc.prototype.remove=function(e,t){t=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};Yc.prototype.removeAll=function(e){e=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=[]};Yc.prototype.contains=function(e){return this.indexOf(e)!==-1};Yc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Yc.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._dataSources[e]};Yc.prototype.getByName=function(e){if(!c(e))throw new C("name is required.");return this._dataSources.filter(function(t){return t.name===e})};function j3(e,t){if(!c(t))throw new C("dataSource is required.");let n=e.indexOf(t);if(n===-1)throw new C("dataSource is not in this collection.");return n}function yfe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=O.clamp(t,0,o),n=O.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Yc.prototype.raise=function(e){let t=j3(this._dataSources,e);yfe(this,t,t+1)};Yc.prototype.lower=function(e){let t=j3(this._dataSources,e);yfe(this,t,t-1)};Yc.prototype.raiseToTop=function(e){let t=j3(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))};Yc.prototype.lowerToBottom=function(e){let t=j3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this.removeAll(!0),de(this)};var W3=Yc;function fa(e){e=e??W.EMPTY_OBJECT,this._primitives=[],this._guid=jn(),this._primitiveAdded=new pe,this._primitiveRemoved=new pe,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(fa.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});fa.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new C("primitive is required.");if(n){if(t<0)throw new C("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new C("index must be less than or equal to the number of primitives.")}let 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};fa.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};fa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};fa.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=[]};fa.prototype.contains=function(e){return!!(c(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function q3(e,t){if(!e.contains(t))throw new C("primitive is not in this collection.");return e._primitives.indexOf(t)}fa.prototype.raise=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};fa.prototype.raiseToTop=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};fa.prototype.lower=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};fa.prototype.lowerToBottom=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};fa.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._primitives[e]};fa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};fa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.prePassesUpdate)&&i.prePassesUpdate(e)}};fa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];c(o.updateForPass)&&o.updateForPass(e,t)}};fa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.postPassesUpdate)&&i.postPassesUpdate(e)}};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return this.removeAll(),de(this)};var Ol=fa;function gm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(gm.prototype,{length:{get:function(){return this._length}}});gm.prototype.add=function(e,t){T.defined("primitive",e),c(t)&&T.typeOf.number("zIndex",t),t=t??0;let n=this._collections[t];if(!c(n)){n=new Ol({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};gm.prototype.set=function(e,t){return T.defined("primitive",e),T.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};gm.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};gm.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};gm.prototype.contains=function(e){if(!c(e))return!1;let t=this._collections[e._zIndex];return c(t)&&t.contains(e)};gm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this.removeAll(),de(this)};var Y3=gm;function kC(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Et}kC.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};kC.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);c(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};kC.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};kC.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};kC.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),c(e)&&c(e.getBoundingSphere)?e.getBoundingSphere(t):lt.FAILED};var UC=kC;var Aq={},X3=new d,bfe=new d,xfe=new Le,Tfe=new J;function VC(e,t,n,i,o,r,s,a,l,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),X3),d.multiplyByScalar(n,Math.sin(f),bfe),d.add(X3,bfe,X3);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*h+o*p)/a;return Le.fromAxisAngle(X3,m,xfe),J.fromQuaternion(xfe,Tfe),J.multiplyByVector(Tfe,l,u),d.normalize(u,u),d.multiplyByScalar(u,a,u),u}var Afe=new d,Cfe=new d,Tq=new d,$Ze=new d;Aq.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),l=e.length,u=n?l:0;for(let f=0;f<l;f+=3){let h=f+1,p=f+2,g=d.fromArray(e,f,Afe);i.scaleToGeodeticSurface(g,g);let m=d.clone(g,Cfe),y=i.geodeticSurfaceNormal(g,$Ze),b=d.multiplyByScalar(y,o,Tq);d.add(g,b,g),n&&(d.multiplyByScalar(y,r,b),d.add(m,b,m),a[f+u]=m.x,a[h+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[h]=g.y,a[p]=g.z}return a};var ZZe=new d,QZe=new d,JZe=new d;Aq.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,l=i*i,u=o*o,f=o*i,h=d.magnitude(s),p=d.normalize(s,ZZe),g=d.cross(d.UNIT_Z,s,QZe);g=d.normalize(g,g);let m=d.cross(p,g,JZe),y=1+Math.ceil(O.PI_OVER_TWO/a),b=O.PI_OVER_TWO/(y-1),x=O.PI_OVER_TWO-y*b;x<0&&(y-=Math.ceil(Math.abs(x)/b));let A=2*(y*(y+2)),E=t?new Array(A*3):void 0,S=0,v=Afe,P=Cfe,M=y*4*3,R=M-1,L=0,B=n?new Array(M):void 0,_,w,D,I,N;for(x=O.PI_OVER_TWO,v=VC(x,r,m,g,l,f,u,h,p,v),t&&(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z),n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x),x=O.PI_OVER_TWO-b,_=1;_<y+1;++_){if(v=VC(x,r,m,g,l,f,u,h,p,v),P=VC(Math.PI-x,r,m,g,l,f,u,h,p,P),t){for(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z,D=2*_+2,w=1;w<D-1;++w)I=w/(D-1),N=d.lerp(v,P,I,Tq),E[S++]=N.x,E[S++]=N.y,E[S++]=N.z;E[S++]=P.x,E[S++]=P.y,E[S++]=P.z}n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x,B[L++]=P.x,B[L++]=P.y,B[L++]=P.z),x=O.PI_OVER_TWO-(_+1)*b}for(_=y;_>1;--_){if(x=O.PI_OVER_TWO-(_-1)*b,v=VC(-x,r,m,g,l,f,u,h,p,v),P=VC(x+Math.PI,r,m,g,l,f,u,h,p,P),t){for(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z,D=2*(_-1)+2,w=1;w<D-1;++w)I=w/(D-1),N=d.lerp(v,P,I,Tq),E[S++]=N.x,E[S++]=N.y,E[S++]=N.z;E[S++]=P.x,E[S++]=P.y,E[S++]=P.z}n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x,B[L++]=P.x,B[L++]=P.y,B[L++]=P.z)}x=O.PI_OVER_TWO,v=VC(-x,r,m,g,l,f,u,h,p,v);let k={};return t&&(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z,k.positions=E,k.numPts=y),n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x,k.outerPositions=B),k};var _u=Aq;var zC=new d,Cq=new d,Eq=new d,Efe=new d,Cs=new z,Sfe=new J,eQe=new J,Sq=new Le,wfe=new d,vfe=new d,Dfe=new d,Z3=new he,Pfe=new d,Ife=new z,Ofe=new z;function Rfe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,l=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,b=0,x=wfe,A=vfe,E=Dfe,S=new Oi(a),v=S.project(a.cartesianToCartographic(o,Z3),Pfe),P=a.scaleToGeodeticSurface(o,zC);a.geodeticSurfaceNormal(P,P);let M=Sfe,R=eQe;if(l!==0){let N=Le.fromAxisAngle(P,l,Sq);M=J.fromQuaternion(N,M),N=Le.fromAxisAngle(P,-l,Sq),R=J.fromQuaternion(N,R)}else M=J.clone(J.IDENTITY,M),R=J.clone(J.IDENTITY,R);let L=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ife),B=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Ofe),_=e.length,w=n?_:0,D=w/3*2;for(let N=0;N<_;N+=3){let k=N+1,H=N+2,V=d.fromArray(e,N,zC);if(i.st){let j=J.multiplyByVector(M,V,Cq),U=S.project(a.cartesianToCartographic(j,Z3),Eq);d.subtract(U,v,U),Cs.x=(U.x+r)/(2*r),Cs.y=(U.y+s)/(2*s),L.x=Math.min(Cs.x,L.x),L.y=Math.min(Cs.y,L.y),B.x=Math.max(Cs.x,B.x),B.y=Math.max(Cs.y,B.y),n&&(h[b+D]=Cs.x,h[b+1+D]=Cs.y),h[b++]=Cs.x,h[b++]=Cs.y}(i.normal||i.tangent||i.bitangent||f)&&(x=a.geodeticSurfaceNormal(V,x),f&&(y[N+w]=-x.x,y[k+w]=-x.y,y[H+w]=-x.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(A=d.normalize(d.cross(d.UNIT_Z,x,A),A),J.multiplyByVector(R,A,A)),i.normal&&(p[N]=x.x,p[k]=x.y,p[H]=x.z,n&&(p[N+w]=-x.x,p[k+w]=-x.y,p[H+w]=-x.z)),i.tangent&&(g[N]=A.x,g[k]=A.y,g[H]=A.z,n&&(g[N+w]=-A.x,g[k+w]=-A.y,g[H+w]=-A.z)),i.bitangent&&(E=d.normalize(d.cross(x,A,E),E),m[N]=E.x,m[k]=E.y,m[H]=E.z,n&&(m[N+w]=E.x,m[k+w]=E.y,m[H+w]=E.z))))}if(i.st){_=h.length;for(let N=0;N<_;N+=2)h[N]=(h[N]-L.x)/(B.x-L.x),h[N+1]=(h[N+1]-L.y)/(B.y-L.y)}let I=new hn;if(i.position){let N=_u.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(I.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),n&&c(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===Zt.TOP)N=N.fill(1,0,u/2);else{let k=t.offsetAttribute===Zt.NONE?0:1;N=N.fill(k)}I.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function Mfe(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 $b=new d;function tQe(e){let t=e.center;$b=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,$b),e.height,$b),$b=d.add(t,$b,$b);let n=new le($b,e.semiMajorAxis),i=_u.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Rfe(o,e,!1),a=Mfe(r);return a=Fe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function nQe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,l=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,x=b?new Float32Array(f*3):void 0,A=0,E=wfe,S=vfe,v=Dfe,P=new Oi(s),M=P.project(s.cartesianToCartographic(i,Z3),Pfe),R=s.scaleToGeodeticSurface(i,zC);s.geodeticSurfaceNormal(R,R);let L=Le.fromAxisAngle(R,u,Sq),B=J.fromQuaternion(L,Sfe),_=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ife),w=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Ofe),D=e.length,I=D/3*2;for(let k=0;k<D;k+=3){let H=k+1,V=k+2,j=d.fromArray(e,k,zC),U;if(n.st){let X=J.multiplyByVector(B,j,Cq),te=P.project(s.cartesianToCartographic(X,Z3),Eq);d.subtract(te,M,te),Cs.x=(te.x+o)/(2*o),Cs.y=(te.y+r)/(2*r),_.x=Math.min(Cs.x,_.x),_.y=Math.min(Cs.y,_.y),w.x=Math.max(Cs.x,w.x),w.y=Math.max(Cs.y,w.y),p[A+I]=Cs.x,p[A+1+I]=Cs.y,p[A++]=Cs.x,p[A++]=Cs.y}j=s.scaleToGeodeticSurface(j,j),U=d.clone(j,Cq),E=s.geodeticSurfaceNormal(j,E),b&&(x[k+D]=-E.x,x[H+D]=-E.y,x[V+D]=-E.z);let q=d.multiplyByScalar(E,a,Efe);if(j=d.add(j,q,j),q=d.multiplyByScalar(E,l,q),U=d.add(U,q,U),n.position&&(h[k+D]=U.x,h[H+D]=U.y,h[V+D]=U.z,h[k]=j.x,h[H]=j.y,h[V]=j.z),n.normal||n.tangent||n.bitangent){v=d.clone(E,v);let X=d.fromArray(e,(k+3)%D,Efe);d.subtract(X,j,X);let te=d.subtract(U,j,Eq);E=d.normalize(d.cross(te,X,E),E),n.normal&&(g[k]=E.x,g[H]=E.y,g[V]=E.z,g[k+D]=E.x,g[H+D]=E.y,g[V+D]=E.z),n.tangent&&(S=d.normalize(d.cross(v,E,S),S),m[k]=S.x,m[H]=S.y,m[V]=S.z,m[k+D]=S.x,m[k+1+D]=S.y,m[k+2+D]=S.z),n.bitangent&&(y[k]=v.x,y[H]=v.y,y[V]=v.z,y[k+D]=v.x,y[H+D]=v.y,y[V+D]=v.z)}}if(n.st){D=p.length;for(let k=0;k<D;k+=2)p[k]=(p[k]-_.x)/(w.x-_.x),p[k+1]=(p[k+1]-_.y)/(w.y-_.y)}let N=new hn;if(n.position&&(N.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(N.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(N.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),b&&(N.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:x})),c(t.offsetAttribute)){let k=new Uint8Array(f);if(t.offsetAttribute===Zt.TOP)k=k.fill(1,0,f/2);else{let H=t.offsetAttribute===Zt.NONE?0:1;k=k.fill(H)}N.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return N}function iQe(e){let t=e.length/3,n=Fe.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,l=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=l}return n}var K3=new le,$3=new le;function oQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,zC),e.height,zC);K3.center=d.add(t,o,K3.center),K3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),$3.center=d.add(t,o,$3.center),$3.radius=i;let r=_u.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,l=r.outerPositions,u=le.union(K3,$3),f=Rfe(s,e,!0),h=Mfe(a),p=h.length;h.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)h[S+p]=h[S+2]+g,h[S+1+p]=h[S+1]+g,h[S+2+p]=h[S]+g;let m=Fe.createTypedArray(g*2/3,h),y=new ct({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=nQe(l,e);h=iQe(l);let x=Fe.createTypedArray(l.length*2/3,h),A=new ct({attributes:b,indices:x,primitiveType:Me.TRIANGLES}),E=Nn.combineInstances([new St({geometry:y}),new St({geometry:A})]);return{boundingSphere:u,attributes:E[0].attributes,indices:E[0].indices}}function Lfe(e,t,n,i,o,r,s){let l=_u.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=l.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(l,p*3);let h=ce.fromCartesianArray(f,r,s);return h.width>O.PI&&(h.north=h.north>0?O.PI_OVER_TWO-O.EPSILON7:h.north,h.south=h.south<0?O.EPSILON7-O.PI_OVER_TWO:h.south,h.east=O.PI,h.west=-O.PI),h}function bm(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.vertexFormat??Ie.DEFAULT;if(T.defined("options.center",t),T.typeOf.number("options.semiMajorAxis",i),T.typeOf.number("options.semiMinorAxis",o),i<o)throw new C("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new C("granularity must be greater than zero.");let a=e.height??0,l=e.extrudedHeight??a;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(l,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(l,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}bm.packedLength=d.packedLength+ie.packedLength+Ie.packedLength+9;bm.pack=function(e,t,n){return T.defined("value",e),T.defined("array",t),n=n??0,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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]=e._offsetAttribute??-1,t};var Nfe=new d,Ffe=new ie,Bfe=new Ie,ym={center:Nfe,ellipsoid:Ffe,vertexFormat:Bfe,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};bm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Nfe);t+=d.packedLength;let o=ie.unpack(e,t,Ffe);t+=ie.packedLength;let r=Ie.unpack(e,t,Bfe);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return c(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=l,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(ym.height=f,ym.extrudedHeight=p,ym.granularity=h,ym.stRotation=u,ym.rotation=l,ym.semiMajorAxis=s,ym.semiMinorAxis=a,ym.shadowVolume=g,ym.offsetAttribute=m===-1?void 0:m,new bm(ym))};bm.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ie.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??O.RADIANS_PER_DEGREE,a=e.rotation??0;if(T.defined("options.center",n),T.typeOf.number("options.semiMajorAxis",o),T.typeOf.number("options.semiMinorAxis",r),o<r)throw new C("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(s<=0)throw new C("granularity must be greater than zero.");return Lfe(n,o,r,a,s,i,t)};bm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!O.equalsEpsilon(t,n,0,O.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=oQe(o);else if(r=tQe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===Zt.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};bm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new bm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function rQe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=_u.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 l=0;l<o;++l)r[l]=d.fromArray(i,l*3);let s=e._ellipsoid,a=e.rectangle;return ct._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(bm.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=Lfe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=rQe(this)),this._textureCoordinateRotationPoints}}});var Rl=bm;var kfe=new d,Zb=new d;function sQe(e){let t=e.center;Zb=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Zb),e.height,Zb),Zb=d.add(t,Zb,Zb);let n=new le(Zb,e.semiMajorAxis),i=_u.computeEllipsePositions(e,!1,!0).outerPositions,o=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:_u.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Fe.createTypedArray(r,r*2),a=0;for(let l=0;l<r;++l)s[a++]=l,s[a++]=(l+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var Q3=new le,J3=new le;function aQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,kfe),e.height,kfe);Q3.center=d.add(t,o,Q3.center),Q3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),J3.center=d.add(t,o,J3.center),J3.radius=i;let r=_u.computeEllipsePositions(e,!1,!0).outerPositions,s=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:_u.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=le.union(Q3,J3),l=r.length/3;if(c(e.offsetAttribute)){let m=new Uint8Array(l);if(e.offsetAttribute===Zt.TOP)m=m.fill(1,0,l/2);else{let y=e.offsetAttribute===Zt.NONE?0:1;m=m.fill(y)}s.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=O.clamp(u,0,l/2);let f=Fe.createTypedArray(l,l*2+u*2);l/=2;let h=0,p;for(p=0;p<l;++p)f[h++]=p,f[h++]=(p+1)%l,f[h++]=p+l,f[h++]=(p+1)%l+l;let g;if(u>0){let m=Math.min(u,l);g=Math.round(l/m);let y=Math.min(g*u,l);for(p=0;p<y;p+=g)f[h++]=p,f[h++]=p+l}return{boundingSphere:a,attributes:s,indices:f}}function HC(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE;if(!c(t))throw new C("center is required.");if(!c(i))throw new C("semiMajorAxis is required.");if(!c(o))throw new C("semiMinorAxis is required.");if(i<o)throw new C("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new C("granularity must be greater than zero.");let s=e.height??0,a=e.extrudedHeight??s;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}HC.packedLength=d.packedLength+ie.packedLength+8;HC.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.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]=e._offsetAttribute??-1,t};var Ufe=new d,Vfe=new ie,a_={center:Ufe,ellipsoid:Vfe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};HC.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=d.unpack(e,t,Ufe);t+=d.packedLength;let o=ie.unpack(e,t,Vfe);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=l,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(a_.height=l,a_.extrudedHeight=f,a_.granularity=u,a_.rotation=a,a_.semiMajorAxis=r,a_.semiMinorAxis=s,a_.numberOfVerticalLines=h,a_.offsetAttribute=p===-1?void 0:p,new HC(a_))};HC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!O.equalsEpsilon(t,n,0,O.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=aQe(o);else if(r=sQe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===Zt.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var kf=HC;var zfe=new G,Hfe=d.ZERO,Gfe=new d,jfe=new ce;function cQe(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 zd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new cQe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}c(Object.create)&&(zd.prototype=Object.create(Gn.prototype),zd.prototype.constructor=zd);zd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,zfe)),c(o)||(o=G.WHITE),i.color=jt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Hfe,Gfe))),new St({id:t,geometry:new Rl(this._options),attributes:i})};zd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,zfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Hfe,Gfe))),new St({id:t,geometry:new kf(this._options),attributes:r})};zd.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};zd.prototype._isHidden=function(e,t){let n=e.position;return!c(n)||!c(t.semiMajorAxis)||!c(t.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t)};zd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Y.isConstant(t.rotation)||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};zd.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=Y.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=Y.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=fi.getMinimumMaximumHeights(Rl.computeRectangle(s,jfe)).minimumTerrainHeight),s.extrudedHeight=o};zd.DynamicGeometryUpdater=GC;function GC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(GC.prototype=Object.create(ii.prototype),GC.prototype.constructor=GC);GC.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.center)||!c(i.semiMajorAxis)||!c(i.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t,n)};GC.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);c(s)&&!c(o)&&(o=0),i.center=Y.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=Y.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=Y.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(Rl.computeRectangle(i,jfe)).minimumTerrainHeight),i.extrudedHeight=s};var ek=zd;var lQe=new d,uQe=new d,fQe=new d,dQe=new d,hQe=new d,mQe=new d(1,1,1),Wfe=Math.cos,qfe=Math.sin;function c_(e){e=e??W.EMPTY_OBJECT;let t=e.radii??mQe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??O.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??O.PI,a=Math.round(e.stackPartitions??64),l=Math.round(e.slicePartitions??64),u=e.vertexFormat??Ie.DEFAULT;if(l<3)throw new C("options.slicePartitions cannot be less than three.");if(a<3)throw new C("options.stackPartitions cannot be less than three.");this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}c_.packedLength=2*d.packedLength+Ie.packedLength+7;c_.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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._offsetAttribute??-1,t};var Yfe=new d,Xfe=new d,Kfe=new Ie,yy={radii:Yfe,innerRadii:Xfe,vertexFormat:Kfe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};c_.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=d.unpack(e,t,Yfe);t+=d.packedLength;let o=d.unpack(e,t,Xfe);t+=d.packedLength;let r=Ie.unpack(e,t,Kfe);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=l,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(yy.minimumClock=s,yy.maximumClock=a,yy.minimumCone=l,yy.maximumCone=u,yy.stackPartitions=f,yy.slicePartitions=h,yy.offsetAttribute=p===-1?void 0:p,new c_(yy))};c_.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,l=e._slicePartitions+1,u=e._stackPartitions+1;l=Math.round(l*Math.abs(o-i)/O.TWO_PI),u=Math.round(u*Math.abs(s-r)/O.PI),l<2&&(l=2),u<2&&(u=2);let f,h,p=0,g=[r],m=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),h=0;h<l;h++)m.push(i+h*(o-i)/(l-1));m.push(o);let y=g.length,b=m.length,x=0,A=1,E=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,P=!1;E&&(A=2,r>0&&(S=!0,x+=l-1),s<Math.PI&&(v=!0,x+=l-1),(o-i)%O.TWO_PI?(P=!0,x+=(u-1)*2+1):x+=1);let M=b*y*A,R=new Float64Array(M*3),L=new Array(M).fill(!1),B=new Array(M).fill(!1),_=l*u*A,w=6*(_+x+1-(l+u)*A),D=Fe.createTypedArray(_,w),I=a.normal?new Float32Array(M*3):void 0,N=a.tangent?new Float32Array(M*3):void 0,k=a.bitangent?new Float32Array(M*3):void 0,H=a.st?new Float32Array(M*2):void 0,V=new Array(y),j=new Array(y);for(f=0;f<y;f++)V[f]=qfe(g[f]),j[f]=Wfe(g[f]);let U=new Array(b),q=new Array(b);for(h=0;h<b;h++)q[h]=Wfe(m[h]),U[h]=qfe(m[h]);for(f=0;f<y;f++)for(h=0;h<b;h++)R[p++]=t.x*V[f]*q[h],R[p++]=t.y*V[f]*U[h],R[p++]=t.z*j[f];let X=M/2;if(E)for(f=0;f<y;f++)for(h=0;h<b;h++)R[p++]=n.x*V[f]*q[h],R[p++]=n.y*V[f]*U[h],R[p++]=n.z*j[f],L[X]=!0,f>0&&f!==y-1&&h!==0&&h!==b-1&&(B[X]=!0),X++;p=0;let te,K;for(f=1;f<y-2;f++)for(te=f*b,K=(f+1)*b,h=1;h<b-2;h++)D[p++]=K+h,D[p++]=K+h+1,D[p++]=te+h+1,D[p++]=K+h,D[p++]=te+h+1,D[p++]=te+h;if(E){let it=y*b;for(f=1;f<y-2;f++)for(te=it+f*b,K=it+(f+1)*b,h=1;h<b-2;h++)D[p++]=K+h,D[p++]=te+h,D[p++]=te+h+1,D[p++]=K+h,D[p++]=te+h+1,D[p++]=K+h+1}let Z,ee;if(E){if(S)for(ee=y*b,f=1;f<b-2;f++)D[p++]=f,D[p++]=f+1,D[p++]=ee+f+1,D[p++]=f,D[p++]=ee+f+1,D[p++]=ee+f;if(v)for(Z=y*b-b,ee=y*b*A-b,f=1;f<b-2;f++)D[p++]=Z+f+1,D[p++]=Z+f,D[p++]=ee+f,D[p++]=Z+f+1,D[p++]=ee+f,D[p++]=ee+f+1}if(P){for(f=1;f<y-2;f++)ee=b*y+b*f,Z=b*f,D[p++]=ee,D[p++]=Z+b,D[p++]=Z,D[p++]=ee,D[p++]=ee+b,D[p++]=Z+b;for(f=1;f<y-2;f++)ee=b*y+b*(f+1)-1,Z=b*(f+1)-1,D[p++]=Z+b,D[p++]=ee,D[p++]=Z,D[p++]=Z+b,D[p++]=ee+b,D[p++]=ee}let me=new hn;a.position&&(me.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:R}));let xe=0,ue=0,ye=0,Ae=0,Pe=M/2,Ee,Ve=ie.fromCartesian3(t),je=ie.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<M;f++){Ee=L[f]?je:Ve;let it=d.fromArray(R,f*3,lQe),Dt=Ee.geodeticSurfaceNormal(it,uQe);if(B[f]&&d.negate(Dt,Dt),a.st){let Gt=z.negate(Dt,hQe);H[xe++]=Math.atan2(Gt.y,Gt.x)/O.TWO_PI+.5,H[xe++]=Math.asin(Dt.z)/Math.PI+.5}if(a.normal&&(I[ue++]=Dt.x,I[ue++]=Dt.y,I[ue++]=Dt.z),a.tangent||a.bitangent){let Gt=fQe,$e=0,ln;if(L[f]&&($e=Pe),!S&&f>=$e&&f<$e+b*2?ln=d.UNIT_X:ln=d.UNIT_Z,d.cross(ln,Dt,Gt),d.normalize(Gt,Gt),a.tangent&&(N[ye++]=Gt.x,N[ye++]=Gt.y,N[ye++]=Gt.z),a.bitangent){let Vt=d.cross(Dt,Gt,dQe);d.normalize(Vt,Vt),k[Ae++]=Vt.x,k[Ae++]=Vt.y,k[Ae++]=Vt.z}}}a.st&&(me.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:H})),a.normal&&(me.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(me.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(me.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:k}))}if(c(e._offsetAttribute)){let it=R.length,Dt=e._offsetAttribute===Zt.NONE?0:1,Gt=new Uint8Array(it/3).fill(Dt);me.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:Gt})}return new ct({attributes:me,indices:D,primitiveType:Me.TRIANGLES,boundingSphere:le.fromEllipsoid(Ve),offsetAttribute:e._offsetAttribute})};var wq;c_.getUnitEllipsoid=function(){return c(wq)||(wq=c_.createGeometry(new c_({radii:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),wq};var da=c_;var pQe=new Ut(G.WHITE),vq=d.ZERO,Dq=new d,_Qe=new d,gQe=new d,Pq=new G,yQe=new d(1,1,1);function bQe(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 gu(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new bQe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}c(Object.create)&&(gu.prototype=Object.create(oi.prototype),gu.prototype.constructor=gu);Object.defineProperties(gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});gu.prototype.createFillGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r,s=new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),l=kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:l,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let f;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,Pq)),c(f)||(f=G.WHITE),r=jt.fromColor(f),u.color=r}return c(this._options.offsetAttribute)&&(u.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,vq,Dq))),new St({id:i,geometry:new da(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};gu.prototype.createOutlineGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Pq),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return c(this._options.offsetAttribute)&&(a.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,vq,Dq))),new St({id:i,geometry:new If(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};gu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};gu.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.radii)||oi.prototype._isHidden.call(this,e,t)};gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.radii.isConstant||!Y.isConstant(t.innerRadii)||!Y.isConstant(t.stackPartitions)||!Y.isConstant(t.slicePartitions)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.minimumClock)||!Y.isConstant(t.maximumClock)||!Y.isConstant(t.minimumCone)||!Y.isConstant(t.maximumCone)||!Y.isConstant(t.subdivisions)};gu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=Y.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=Y.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=Y.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=Y.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=Y.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=Y.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=Y.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=Y.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?Zt.ALL:void 0};gu.prototype._onEntityPropertyChanged=rg;gu.DynamicGeometryUpdater=YD;function YD(e,t,n){ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,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 d,this._material={}}c(Object.create)&&(YD.prototype=Object.create(ii.prototype),YD.prototype.constructor=YD);YD.prototype.update=function(e){T.defined("time",e);let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Y.getValueOrDefault(n.show,e,!0)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=Y.getValueOrUndefined(n.radii,e,_Qe),o=c(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!c(o)||!c(i)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=Y.getValueOrDefault(n.fill,e,!0),s=Y.getValueOrDefault(n.outline,e,!1),a=Y.getValueOrClonedDefault(n.outlineColor,e,G.BLACK,Pq),l=or.getValue(e,n.material??pQe,this._material),u=Y.getValueOrUndefined(n.innerRadii,e,gQe),f=Y.getValueOrUndefined(n.minimumClock,e),h=Y.getValueOrUndefined(n.maximumClock,e),p=Y.getValueOrUndefined(n.minimumCone,e),g=Y.getValueOrUndefined(n.maximumCone,e),m=Y.getValueOrUndefined(n.stackPartitions,e),y=Y.getValueOrUndefined(n.slicePartitions,e),b=Y.getValueOrUndefined(n.subdivisions,e),x=Y.getValueOrDefault(n.outlineWidth,e,1),A=Y.getValueOrDefault(n.heightReference,e,qe.NONE),E=A!==qe.NONE?Zt.ALL:void 0,S=this._scene.mode,v=S===oe.SCENE3D&&A===qe.NONE,P=this._options,M=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),B=Y.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,vq,Dq);if(!v||this._lastSceneMode!==S||!c(this._primitive)||P.stackPartitions!==m||P.slicePartitions!==y||c(u)&&!d.equals(P.innerRadii!==u)||P.minimumClock!==f||P.maximumClock!==h||P.minimumCone!==p||P.maximumCone!==g||P.subdivisions!==b||this._lastOutlineWidth!==x||P.offsetAttribute!==E){let w=this._primitives;w.removeAndDestroy(this._primitive),w.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=x,P.stackPartitions=m,P.slicePartitions=y,P.subdivisions=b,P.offsetAttribute=E,P.radii=d.clone(v?yQe:i,P.radii),c(u)?v?P.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,P.innerRadii):P.innerRadii=d.clone(u,P.innerRadii):P.innerRadii=void 0,P.minimumClock=f,P.maximumClock=h,P.minimumCone=p,P.maximumCone=g;let D=new so({material:l,translucent:l.isTranslucent(),closed:!0});P.vertexFormat=D.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=w.add(new In({geometryInstances:I,appearance:D,asynchronous:!1,shadows:M}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=w.add(new In({geometryInstances:N,appearance:new rn({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(x)}}),asynchronous:!1,shadows:M})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=G.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=L,this._lastOffset=d.clone(B,this._lastOffset)}else if(this._primitive.ready){let w=this._primitive,D=this._outlinePrimitive;w.show=!0,D.show=!0,w.appearance.material=l;let I=this._attributes;c(I)||(I=w.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=xn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;c(N)||(N=D.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=xn.toValue(s,N.show),this._lastOutlineShow=s),G.equals(a,this._lastOutlineColor)||(N.color=jt.toValue(a,N.color),G.clone(a,this._lastOutlineColor)),Lt.equals(L,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=kn.toValue(L,I.distanceDisplayCondition),N.distanceDisplayCondition=kn.toValue(L,N.distanceDisplayCondition),Lt.clone(L,this._lastDistanceDisplayCondition)),d.equals(B,this._lastOffset)||(I.offset=Ji.toValue(B,I.offset),N.offset=Ji.toValue(B,I.offset),d.clone(B,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var tk=gu;function jC(e){e=e??W.EMPTY_OBJECT;let t=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}jC.packedLength=Ie.packedLength;jC.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,Ie.pack(e._vertexFormat,t,n),t};var $fe=new Ie,xQe={vertexFormat:$fe};jC.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=Ie.unpack(e,t,$fe);return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new jC(xQe)};var nk=new d(-.5,-.5,0),ik=new d(.5,.5,0);jC.createGeometry=function(e){let t=e._vertexFormat,n=new hn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=nk.x,o[1]=nk.y,o[2]=0,o[3]=ik.x,o[4]=nk.y,o[5]=0,o[6]=ik.x,o[7]=ik.y,o[8]=0,o[9]=nk.x,o[10]=ik.y,o[11]=0,n.position=new ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ve({componentDatatype:$.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 ct({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var ok=jC;function WC(){this._workerName="createPlaneOutlineGeometry"}WC.packedLength=0;WC.pack=function(e,t){return T.defined("value",e),T.defined("array",t),t};WC.unpack=function(e,t,n){return T.defined("array",e),c(n)?n:new WC};var by=new d(-.5,-.5,0),rk=new d(.5,.5,0);WC.createGeometry=function(){let e=new hn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=by.x,n[1]=by.y,n[2]=by.z,n[3]=rk.x,n[4]=by.y,n[5]=by.z,n[6]=rk.x,n[7]=rk.y,n[8]=by.z,n[9]=by.x,n[10]=rk.y,n[11]=by.z,e.position=new ve({componentDatatype:$.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 ct({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var sk=WC;var TQe=new d,Zfe=new G;function AQe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Uf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new AQe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}c(Object.create)&&(Uf.prototype=Object.create(oi.prototype),Uf.prototype.constructor=Uf);Uf.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let g;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Zfe)),c(g)||(g=G.WHITE),o=jt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let l=t.plane,u=this._options,f=t.computeModelMatrix(e),h=Y.getValueOrDefault(l.plane,e,u.plane),p=Y.getValueOrUndefined(l.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=Iq(h,p,f,f),new St({id:t,geometry:new ok(this._options),modelMatrix:f,attributes:i})};Uf.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Zfe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),l=Y.getValueOrDefault(r.plane,e,s.plane),u=Y.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=l,s.dimensions=u,a=Iq(l,u,a,a),new St({id:t,geometry:new sk,modelMatrix:a,attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Uf.prototype._isHidden=function(e,t){return!c(t.plane)||!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};Uf.prototype._getIsClosed=function(e){return!1};Uf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};Uf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};Uf.DynamicGeometryUpdater=qC;function qC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(qC.prototype=Object.create(ii.prototype),qC.prototype.constructor=qC);qC.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,TQe);return!c(o)||!c(i.plane)||!c(i.dimensions)||ii.prototype._isHidden.call(this,e,t,n)};qC.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=Y.getValueOrDefault(t.plane,n,i.plane),i.dimensions=Y.getValueOrUndefined(t.dimensions,n,i.dimensions)};var CQe=new d,EQe=new d,SQe=new d,wQe=new d,vQe=new J,DQe=new J,PQe=new F;function Iq(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,SQe),a=d.clone(d.UNIT_Z,EQe);O.equalsEpsilon(Math.abs(d.dot(a,o)),1,O.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let l=d.cross(a,o,CQe);a=d.cross(o,l,a),d.normalize(l,l),d.normalize(a,a);let u=vQe;J.setColumn(u,0,l,u),J.setColumn(u,1,a,u),J.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,wQe),h=J.multiplyByScale(u,f,DQe),p=F.fromRotationTranslation(h,s,PQe);return F.multiplyTransformation(n,p,i)}Uf.createPrimitiveMatrix=Iq;var ak=Uf;var IQe=new d,OQe=new Ke,RQe=new z,MQe=new z,LQe=new d,NQe=new d,FQe=new d,XD=new d,BQe=new d,kQe=new d,Qfe=new Le,UQe=new J,VQe=new J,zQe=new d;function HQe(e,t,n,i,o,r,s,a,l){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Fe.createTypedArray(u.length,f.length);h.set(f);let p=UQe;if(i!==0){let _=Le.fromAxisAngle(s,i,Qfe);if(p=J.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,Qfe);let w=J.fromQuaternion(_,VQe);a=d.normalize(J.multiplyByVector(w,a,a),a),t.bitangent&&(l=d.normalize(d.cross(s,a,l),l))}}else p=J.clone(J.IDENTITY,p);let g=MQe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,b=new Float64Array(y),x=t.normal?new Float32Array(y):void 0,A=t.tangent?new Float32Array(y):void 0,E=t.bitangent?new Float32Array(y):void 0,S=t.st?new Float32Array(m*2):void 0,v=0,P=0,M=0,R=0,L=0;for(let _=0;_<m;_++){let w=u[_];if(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z,t.st)if(c(o)&&o.positions.length===m)S[L++]=o.positions[_].x,S[L++]=o.positions[_].y;else{let D=J.multiplyByVector(p,w,IQe),I=r(D,RQe);z.subtract(I,g,I);let N=O.clamp(I.x/n.width,0,1),k=O.clamp(I.y/n.height,0,1);S[L++]=N,S[L++]=k}t.normal&&(x[P++]=s.x,x[P++]=s.y,x[P++]=s.z),t.tangent&&(A[R++]=a.x,A[R++]=a.y,A[R++]=a.z),t.bitangent&&(E[M++]=l.x,E[M++]=l.y,E[M++]=l.z)}let B=new hn;return t.position&&(B.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(B.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(B.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(B.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),t.st&&(B.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:S})),new ct({attributes:B,indices:h,primitiveType:Me.TRIANGLES})}function Qb(e){e=e??W.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates;T.defined("options.polygonHierarchy",t);let i=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=zn.computeHierarchyPackedLength(t,d)+Ie.packedLength+ie.packedLength+(c(n)?zn.computeHierarchyPackedLength(n,z):1)+2}Qb.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Qb(t)};Qb.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,c(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var GQe=ie.clone(ie.UNIT_SPHERE),jQe=new Ie,WQe={polygonHierarchy:{}};Qb.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,GQe);t+=ie.packedLength;let r=Ie.unpack(e,t,jQe);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,z);c(a)?(t=a.startingIndex,delete a.startingIndex):t++;let l=e[t++];return c(n)||(n=new Qb(WQe)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=l,n};Qb.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=c(o),s=n.positions;if(s=xo(s,d.equalsEpsilon,!0),s.length<3)return;let a=LQe,l=NQe,u=FQe,f=BQe,h=kQe;if(!Zg.computeProjectTo2DArguments(s,XD,f,h))return;if(a=d.cross(f,h,a),a=d.normalize(a,a),!d.equalsEpsilon(XD,d.ZERO,O.EPSILON6)){let L=e._ellipsoid.geodeticSurfaceNormal(XD,zQe);d.dot(a,L)<0&&(a=d.negate(a,a),f=d.negate(f,f))}let g=Zg.createProjectPointsTo2DFunction(XD,f,h),m=Zg.createProjectPointTo2DFunction(XD,f,h);t.tangent&&(l=d.clone(f,l)),t.bitangent&&(u=d.clone(h,u));let y=zn.polygonsFromHierarchy(n,r,g,!1),b=y.hierarchy,x=y.polygons,A=function(L){return L},E=r?zn.polygonsFromHierarchy(o,!0,A,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=le.fromPoints(s),v=zn.computeBoundingRectangle(a,m,s,i,OQe),P=[];for(let L=0;L<x.length;L++){let B=new St({geometry:HQe(x[L],t,v,i,r?E[L]:void 0,m,a,l,u)});P.push(B)}let M=Nn.combineInstances(P)[0];M.attributes.position.values=new Float64Array(M.attributes.position.values),M.indices=Fe.createTypedArray(M.attributes.position.values.length/3,M.indices);let R=M.attributes;return t.position||delete R.position,new ct({attributes:R,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:S})};var ck=Qb;var Jfe=[],lk=[];function qQe(e,t,n,i,o){let s=is.fromPoints(t,e).projectPointsOntoPlane(t,Jfe);si.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,u,f=t.length,h=0;if(i)for(l=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];l[h++]=m.x,l[h++]=m.y,l[h++]=m.z,l[h++]=y.x,l[h++]=y.y,l[h++]=y.z}else{let m=0;if(o===qt.GEODESIC)for(u=0;u<f;u++)m+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===qt.RHUMB)for(u=0;u<f;u++)m+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(l=new Float64Array(m*3),u=0;u<f;u++){let y;o===qt.GEODESIC?y=zn.subdivideLine(t[u],t[(u+1)%f],n,lk):o===qt.RHUMB&&(y=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,lk));let b=y.length;for(let x=0;x<b;++x)l[h++]=y[x]}}f=l.length/3;let p=f*2,g=Fe.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)g[h++]=u,g[h++]=u+1;return g[h++]=f-1,g[h++]=0,new St({geometry:new ct({attributes:new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})}),indices:g,primitiveType:Me.LINES})})}function YQe(e,t,n,i,o){let s=is.fromPoints(t,e).projectPointsOntoPlane(t,Jfe);si.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,u,f=t.length,h=new Array(f),p=0;if(i)for(l=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let b=t[u],x=t[(u+1)%f];l[p++]=b.x,l[p++]=b.y,l[p++]=b.z,l[p++]=x.x,l[p++]=x.y,l[p++]=x.z}else{let b=0;if(o===qt.GEODESIC)for(u=0;u<f;u++)b+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===qt.RHUMB)for(u=0;u<f;u++)b+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(l=new Float64Array(b*3*2),u=0;u<f;++u){h[u]=p/3;let x;o===qt.GEODESIC?x=zn.subdivideLine(t[u],t[(u+1)%f],n,lk):o===qt.RHUMB&&(x=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,lk));let A=x.length;for(let E=0;E<A;++E)l[p++]=x[E]}}f=l.length/(3*2);let g=h.length,m=(f*2+g)*2,y=Fe.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=h[u];y[p++]=b,y[p++]=b+f}return new St({geometry:new ct({attributes:new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})}),indices:y,primitiveType:Me.LINES})})}function Jb(e){if(T.typeOf.object("options",e),T.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&c(e.height))throw new C("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new C("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.ellipsoid??ie.default,i=e.granularity??O.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&c(e.extrudedHeight),s=e.arcType??qt.GEODESIC,a=e.height??0,l=e.extrudedHeight??a;if(!r){let u=Math.max(a,l);l=Math.min(a,l),a=u}this._ellipsoid=ie.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=l,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,d)+ie.packedLength+8}Jb.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var XQe=ie.clone(ie.UNIT_SPHERE),KQe={polygonHierarchy:{}};Jb.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,XQe);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return c(n)||(n=new Jb(KQe)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=l,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};Jb.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);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 Jb(t)};Jb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=zn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,l=[],u=O.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!O.equalsEpsilon(f,h,0,O.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=YQe(t,s[m],u,o,r),a.geometry=zn.scaleToGeodeticHeightExtruded(a.geometry,f,h,t,o),c(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length/3,A=new Uint8Array(x);e._offsetAttribute===Zt.TOP?A=A.fill(1,0,x/2):(g=e._offsetAttribute===Zt.NONE?0:1,A=A.fill(g)),a.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}l.push(a)}else for(m=0;m<s.length;m++){if(a=qQe(t,s[m],u,o,r),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),c(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length;g=e._offsetAttribute===Zt.NONE?0:1;let A=new Uint8Array(x/3).fill(g);a.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}l.push(a)}let y=Nn.combineInstances(l)[0],b=le.fromVertices(y.attributes.position.values);return new ct({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var uk=Jb;var ede="Entity polygons cannot have both height and perPositionHeight. height will be ignored",tde="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",nde=new G,ide=d.ZERO,ode=new d,rde=new ce,$Qe=[],ZQe=new z;function QQe(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 yu(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new QQe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}c(Object.create)&&(yu.prototype=Object.create(Gn.prototype),yu.prototype.constructor=yu);yu.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,nde)),c(s)||(s=G.WHITE),o.color=jt.fromColor(s)}c(i.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,ide,ode)));let r;return i.perPositionHeight&&!c(i.extrudedHeight)?r=new ck(i):r=new Pg(i),new St({id:t,geometry:r,attributes:o})};yu.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,nde),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};c(i.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,ide,ode)));let a;return i.perPositionHeight&&!c(i.extrudedHeight)?a=new Nd(i):a=new uk(i),new St({id:t,geometry:a,attributes:s})};yu.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!c(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=is.fromPoints(i,o),s=r.projectPointsOntoPlane(i,$Qe),a=s.length,l=0,u=a-1,f=new z;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,b=z.add(g,m,ZQe);b=z.multiplyByScalar(b,y,b),f=z.add(f,b,f),l+=y}let h=1/(l*3);return f=z.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};yu.prototype._isHidden=function(e,t){return!c(t.hierarchy)||oi.prototype._isHidden.call(this,e,t)};yu.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=c(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!o};yu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.textureCoordinates)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.perPositionHeight)||!Y.isConstant(t.closeTop)||!Y.isConstant(t.closeBottom)||!Y.isConstant(t.zIndex)||!Y.isConstant(t.arcType)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};yu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ge.MINIMUM_VALUE),r=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),l=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE),u=Y.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);r=Gn.getGeometryHeight(r,s);let f;if(u?(c(r)&&(r=void 0,dt(ede)),s!==qe.NONE&&u&&(r=void 0,dt(tde))):(c(a)&&!c(r)&&(r=0),f=Gn.computeGeometryOffsetAttribute(r,s,a,l)),i.polygonHierarchy=o,i.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=Y.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=Y.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=Y.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,qt.GEODESIC),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,l),a===Gn.CLAMP_TO_GROUND){let h=Pg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,rde);a=fi.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};yu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=c(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};yu.DynamicGeometryUpdater=YC;function YC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(YC.prototype=Object.create(ii.prototype),YC.prototype.constructor=YC);YC.prototype._isHidden=function(e,t,n){return!c(this._options.polygonHierarchy)||ii.prototype._isHidden.call(this,e,t,n)};YC.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=Y.getValueOrUndefined(t.hierarchy,n);let o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,n),l=Y.getValueOrUndefined(t.perPositionHeight,n);o=Gn.getGeometryHeight(o,s);let u;if(l?(c(o)&&(o=void 0,dt(ede)),r!==qe.NONE&&l&&(o=void 0,dt(tde))):(c(a)&&!c(o)&&(o=0),u=Gn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=Y.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=Y.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=Y.getValueOrDefault(t.arcType,n,qt.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND){let f=Pg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,rde);a=fi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var fk=yu;function JQe(e,t,n,i){let o=new hn;i.position&&(o.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),l=si.triangulate(t),u=(a-1)*r*6+l.length*2,f=Fe.createTypedArray(s,u),h,p,g,m,y,b,x=r*2,A=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)g=p*2+h*r*2,b=g+x,m=g+1,y=m+x,f[A++]=m,f[A++]=g,f[A++]=y,f[A++]=y,f[A++]=g,f[A++]=b;g=r*2-2+h*r*2,m=g+1,y=m+x,b=g+x,f[A++]=m,f[A++]=g,f[A++]=y,f[A++]=y,f[A++]=g,f[A++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),P=1/(a-1),M=1/n.height,R=n.height/2,L,B,_=0;for(h=0;h<a;h++){for(L=h*P,B=M*(t[0].y+R),v[_++]=L,v[_++]=B,p=1;p<r;p++)B=M*(t[p].y+R),v[_++]=L,v[_++]=B,v[_++]=L,v[_++]=B;B=M*(t[0].y+R),v[_++]=L,v[_++]=B}for(p=0;p<r;p++)L=0,B=M*(t[p].y+R),v[_++]=L,v[_++]=B;for(p=0;p<r;p++)L=(a-1)*P,B=M*(t[p].y+R),v[_++]=L,v[_++]=B;o.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let E=s-r*2;for(h=0;h<l.length;h+=3){let v=l[h]+E,P=l[h+1]+E,M=l[h+2]+E;f[A++]=v,f[A++]=P,f[A++]=M,f[A++]=M+r,f[A++]=P+r,f[A++]=v+r}let S=new ct({attributes:o,indices:f,boundingSphere:le.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(S=Nn.computeNormal(S)),i.tangent||i.bitangent){try{S=Nn.computeTangentAndBitangent(S)}catch{dt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function $D(e){e=e??W.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new C("options.polylinePositions is required.");if(!c(n))throw new C("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??ki.ROUNDED,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ie.packedLength+Ie.packedLength+2}$D.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var sde=ie.clone(ie.UNIT_SPHERE),ade=new Ie,KD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:sde,vertexFormat:ade,cornerType:void 0,granularity:void 0};$D.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ie.unpack(e,t,sde);t+=ie.packedLength;let l=Ie.unpack(e,t,ade);t+=Ie.packedLength;let u=e[t++],f=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(l,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(KD.polylinePositions=r,KD.shapePositions=s,KD.cornerType=u,KD.granularity=f,new $D(KD))};var eJe=new Ke;$D.createGeometry=function(e){let t=e._positions,n=xo(t,d.equalsEpsilon),i=e._shape;if(i=dm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,eJe),r=dm.computePositions(n,i,o,e,!0);return JQe(r,i,o,e._vertexFormat)};var dk=$D;function tJe(e,t){let n=new hn;n.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Fe.createTypedArray(o,2*i*(s+1)),l,u,f=0;l=0;let h=l*i;for(u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,l=s-1,h=l*i,u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,l=0;l<s-1;l++){let g=i*l,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new ct({attributes:n,indices:Fe.createTypedArray(o,a),boundingSphere:le.fromVertices(e),primitiveType:Me.LINES})}function QD(e){e=e??W.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new C("options.polylinePositions is required.");if(!c(n))throw new C("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??ki.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ie.packedLength+2}QD.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var cde=ie.clone(ie.UNIT_SPHERE),ZD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:cde,height:void 0,cornerType:void 0,granularity:void 0};QD.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ie.unpack(e,t,cde);t+=ie.packedLength;let l=e[t++],u=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._cornerType=l,n._granularity=u,n):(ZD.polylinePositions=r,ZD.shapePositions=s,ZD.cornerType=l,ZD.granularity=u,new QD(ZD))};var nJe=new Ke;QD.createGeometry=function(e){let t=e._positions,n=xo(t,d.equalsEpsilon),i=e._shape;if(i=dm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,nJe),r=dm.computePositions(n,i,o,e,!1);return tJe(r,i)};var hk=QD;var lde=new G;function iJe(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 xm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new iJe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}c(Object.create)&&(xm.prototype=Object.create(oi.prototype),xm.prototype.constructor=xm);xm.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,lde)),c(l)||(l=G.WHITE),o=jt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new dk(this._options),attributes:i})};xm.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,lde),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new hk(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};xm.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.shape)||oi.prototype._isHidden.call(this,e,t)};xm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!Y.isConstant(t.granularity)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)};xm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,o.shape),o.granularity=c(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,o.cornerType=c(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};xm.DynamicGeometryUpdater=XC;function XC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(XC.prototype=Object.create(ii.prototype),XC.prototype.constructor=XC);XC.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.polylinePositions)||!c(i.shapePositions)||ii.prototype._isHidden.call(this,e,t,n)};XC.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=Y.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=Y.getValueOrUndefined(t.shape,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n)};var mk=xm;var Oq=new d,dde=new d,hde=new d,mde=new d,pde=new ce,oJe=new z,rJe=new le,sJe=new le;function _de(e,t){let n=new ct({attributes:new hn,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function aJe(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,l=0,u=mde,f=hde,h=dde;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=d.fromArray(e,p,Oq),m=l+1,y=l+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),J.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[l]=h.x,r[m]=h.y,r[y]=h.z),t.tangent&&(s[l]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[l]=u.x,a[m]=u.y,a[y]=u.z),l+=3}return _de(t,{positions:e,normals:r,tangents:s,bitangents:a})}var Rq=new d,gde=new d;function cJe(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,l=0,u=0,f=!0,h=mde,p=hde,g=dde;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=d.fromArray(e,m,Oq),b=d.fromArray(e,(m+6)%i,Rq);if(f){let x=d.fromArray(e,(m+3)%i,gde);d.subtract(b,y,b),d.subtract(x,y,x),g=d.normalize(d.cross(x,b,g),g),f=!1}d.equalsEpsilon(b,y,O.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(y,h),t.tangent&&(p=d.normalize(d.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[l++]=p.x,r[l++]=p.y,r[l++]=p.z,r[l++]=p.x,r[l++]=p.y,r[l++]=p.z),t.bitangent&&(s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z)}return _de(t,{positions:e,normals:o,tangents:r,bitangents:s})}function yde(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,l=0,u=o,f=o,h=0;s&&(l=1,f-=1,h+=1),a&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,m=0,y=0,b=Oq,x=oJe,A=Number.MAX_VALUE,E=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let w=l;w<u;++w)for(let D=0;D<r;++D)zs.computePosition(t,i,n.st,w,D,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[y++]=x.x,g[y++]=x.y,A=Math.min(A,x.x),E=Math.min(E,x.y),S=Math.max(S,x.x),v=Math.max(v,x.y));if(s&&(zs.computePosition(t,i,n.st,0,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[y++]=x.x,g[y++]=x.y,A=x.x,E=x.y,S=x.x,v=x.y)),a&&(zs.computePosition(t,i,n.st,o-1,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(g[y++]=x.x,g[y]=x.y,A=Math.min(A,x.x),E=Math.min(E,x.y),S=Math.max(S,x.x),v=Math.max(v,x.y))),n.st&&(A<0||E<0||S>1||v>1))for(let w=0;w<g.length;w+=2)g[w]=(g[w]-A)/(S-A),g[w+1]=(g[w+1]-E)/(v-E);let P=aJe(p,n,i,t.tangentRotationMatrix),M=6*(r-1)*(f-1);s&&(M+=3*(r-1)),a&&(M+=3*(r-1));let R=Fe.createTypedArray(h,M),L=0,B=0,_;for(_=0;_<f-1;++_){for(let w=0;w<r-1;++w){let D=L,I=D+r,N=I+1,k=D+1;R[B++]=D,R[B++]=I,R[B++]=k,R[B++]=k,R[B++]=I,R[B++]=N,++L}++L}if(s||a){let w=h-1,D=h-1;s&&a&&(w=h-2);let I,N;if(L=0,s)for(_=0;_<r-1;_++)I=L,N=I+1,R[B++]=w,R[B++]=I,R[B++]=N,++L;if(a)for(L=(f-1)*r,_=0;_<r-1;_++)I=L,N=I+1,R[B++]=I,R[B++]=D,R[B++]=N,++L}return P.indices=R,n.st&&(P.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:g})),P}function KC(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 $C(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 Mq=new Ie;function lJe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,l=t.height,u=t.width,f;if(n){let $e=Ie.clone(o,Mq);$e.normal=!0,e._vertexFormat=$e}let h=yde(e,t);n&&(e._vertexFormat=o);let p=si.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let b=si.scaleToGeodeticHeight(h.attributes.position.values,r,a);y.set(b,g),h.attributes.position.values=y;let x=o.normal?new Float32Array(m):void 0,A=o.tangent?new Float32Array(m):void 0,E=o.bitangent?new Float32Array(m):void 0,S=o.st?new Float32Array(m/3*2):void 0,v,P;if(o.normal){for(P=h.attributes.normal.values,x.set(P),f=0;f<g;f++)P[f]=-P[f];x.set(P,g),h.attributes.normal.values=x}if(n){P=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let $e=new Float32Array(m);for(f=0;f<g;f++)P[f]=-P[f];$e.set(P,g),h.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:$e})}let M,R=c(i);if(R){let $e=g/3*2,ln=new Uint8Array($e);i===Zt.TOP?ln=ln.fill(1,0,$e/2):(M=i===Zt.NONE?0:1,ln=ln.fill(M)),h.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:ln})}if(o.tangent){let $e=h.attributes.tangent.values;for(A.set($e),f=0;f<g;f++)$e[f]=-$e[f];A.set($e,g),h.attributes.tangent.values=A}if(o.bitangent){let $e=h.attributes.bitangent.values;E.set($e),E.set($e,g),h.attributes.bitangent.values=E}o.st&&(v=h.attributes.st.values,S.set(v),S.set(v,g/3*2),h.attributes.st.values=S);let L=h.indices,B=L.length,_=g/3,w=Fe.createTypedArray(m/3,B*2);for(w.set(L),f=0;f<B;f+=3)w[f+B]=L[f+2]+_,w[f+1+B]=L[f+1]+_,w[f+2+B]=L[f]+_;h.indices=w;let D=t.northCap,I=t.southCap,N=l,k=2,H=0,V=4,j=4;D&&(k-=1,N-=1,H+=1,V-=2,j-=1),I&&(k-=1,N-=1,H+=1,V-=2,j-=1),H+=k*u+2*N-V;let U=(H+j)*2,q=new Float64Array(U*3),X=n?new Float32Array(U*3):void 0,te=R?new Uint8Array(U):void 0,K=o.st?new Float32Array(U*2):void 0,Z=i===Zt.TOP;R&&!Z&&(M=i===Zt.ALL?1:0,te=te.fill(M));let ee=0,me=0,xe=0,ue=0,ye=u*N,Ae;for(f=0;f<ye;f+=u)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(I){let $e=D?ye+1:ye;for(Ae=$e*3,f=0;f<2;f++)q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,$e*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=ye-u;f<ye;f++)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);for(f=ye-1;f>0;f-=u)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(D){let $e=ye;for(Ae=$e*3,f=0;f<2;f++)q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,$e*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=u-1;f>=0;f--)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);let Pe=cJe(q,o,a);o.st&&(Pe.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:K})),n&&(Pe.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:X})),R&&(Pe.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ee=Fe.createTypedArray(U,H*6),Ve,je,it,Dt;g=q.length/3;let Gt=0;for(f=0;f<g-1;f+=2){Ve=f,Dt=(Ve+2)%g;let $e=d.fromArray(q,Ve*3,Rq),ln=d.fromArray(q,Dt*3,gde);d.equalsEpsilon($e,ln,O.EPSILON10)||(je=(Ve+1)%g,it=(je+2)%g,Ee[Gt++]=Ve,Ee[Gt++]=je,Ee[Gt++]=Dt,Ee[Gt++]=Dt,Ee[Gt++]=je,Ee[Gt++]=it)}return Pe.indices=Ee,Pe=Nn.combineInstances([new St({geometry:h}),new St({geometry:Pe})]),Pe[0]}var uJe=[new d,new d,new d,new d],bde=new he,fJe=new he;function Lq(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=zs.computeOptions(e,t,n,0,pde,bde),s=r.height,a=r.width,l=uJe;return zs.computePosition(r,i,!1,0,0,l[0]),zs.computePosition(r,i,!1,0,a-1,l[1]),zs.computePosition(r,i,!1,s-1,0,l[2]),zs.computePosition(r,i,!1,s-1,a-1,l[3]),ce.fromCartesianArray(l,i,o)}function Tm(e){e=e??W.EMPTY_OBJECT;let t=e.rectangle;if(T.typeOf.object("rectangle",t),ce._validate(t),t.north<t.south)throw new C("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ce.clone(t),this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Tm.packedLength=ce.packedLength+ie.packedLength+Ie.packedLength+7;Tm.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.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]=e._offsetAttribute??-1,t};var xde=new ce,Tde=ie.clone(ie.UNIT_SPHERE),xy={rectangle:xde,ellipsoid:Tde,vertexFormat:Mq,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Tm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=ce.unpack(e,t,xde);t+=ce.packedLength;let o=ie.unpack(e,t,Tde);t+=ie.packedLength;let r=Ie.unpack(e,t,Mq);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return c(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=l,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(xy.granularity=s,xy.height=a,xy.rotation=l,xy.stRotation=u,xy.extrudedHeight=f,xy.shadowVolume=h,xy.offsetAttribute=p===-1?void 0:p,new Tm(xy))};Tm.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.rectangle;if(T.typeOf.object("rectangle",n),ce._validate(n),n.north<n.south)throw new C("options.rectangle.north must be greater than or equal to options.rectangle.south");let i=e.granularity??O.RADIANS_PER_DEGREE,o=e.ellipsoid??ie.default,r=e.rotation??0;return Lq(n,i,r,o,t)};var dJe=new J,ude=new Le,hJe=new he;Tm.createGeometry=function(e){if(O.equalsEpsilon(e._rectangle.north,e._rectangle.south,O.EPSILON10)||O.equalsEpsilon(e._rectangle.east,e._rectangle.west,O.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=zs.computeOptions(t,e._granularity,i,o,pde,bde,fJe),a=dJe;if(o!==0||i!==0){let g=ce.center(t,hJe),m=n.geodeticSurfaceNormalCartographic(g,Rq);Le.fromAxisAngle(m,-o,ude),J.fromQuaternion(ude,a)}else J.clone(J.IDENTITY,a);let l=e._surfaceHeight,u=e._extrudedHeight,f=!O.equalsEpsilon(l,u,0,O.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,f){h=lJe(e,s);let g=le.fromRectangle3D(t,n,l,sJe),m=le.fromRectangle3D(t,n,u,rJe);p=le.union(g,m)}else{if(h=yde(e,s),h.attributes.position.values=si.scaleToGeodeticHeight(h.attributes.position.values,l,n,!1),c(e._offsetAttribute)){let g=h.attributes.position.values.length,m=e._offsetAttribute===Zt.NONE?0:1,y=new Uint8Array(g/3).fill(m);h.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=le.fromRectangle3D(t,n,l)}return r.position||delete h.attributes.position,new ct({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Tm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Tm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var fde=new ce,mJe=[new z,new z,new z],pJe=new Ri,_Je=new he;function gJe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,fde),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=Lq(t,n,o,i,fde),s=mJe;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,l=Ri.fromRotation(e._stRotation,pJe),u=ce.center(a,_Je);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,Ri.multiplyByVector(l,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],h=s[1],p=s[2],g=new Array(6);return z.pack(f,g),z.pack(h,g,2),z.pack(p,g,4),g}Object.defineProperties(Tm.prototype,{rectangle:{get:function(){return c(this._rotatedRectangle)||(this._rotatedRectangle=Lq(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=gJe(this)),this._textureCoordinateRotationPoints}}});var ZC=Tm;var Ade=new G,Cde=d.ZERO,Ede=new d,Sde=new ce,yJe=new ce,bJe=new he;function xJe(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 Hd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new xJe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}c(Object.create)&&(Hd.prototype=Object.create(Gn.prototype),Hd.prototype.constructor=Hd);Hd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Ade)),c(o)||(o=G.WHITE),i.color=jt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Cde,Ede))),new St({id:t,geometry:new ZC(this._options),attributes:i})};Hd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Ade),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Cde,Ede))),new St({id:t,geometry:new cC(this._options),attributes:r})};Hd.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.rectangle.coordinates,e,yJe);if(!c(n))return;let i=ce.center(n,bJe);return he.toCartesian(i,ie.default,t)};Hd.prototype._isHidden=function(e,t){return!c(t.coordinates)||oi.prototype._isHidden.call(this,e,t)};Hd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.rotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Hd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),o=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),r=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);c(r)&&!c(i)&&(i=0);let a=this._options;a.vertexFormat=n?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=Y.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=Y.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Gn.getGeometryHeight(i,o),r=Gn.getGeometryExtrudedHeight(r,s),r===Gn.CLAMP_TO_GROUND&&(r=fi.getMinimumMaximumHeights(ZC.computeRectangle(a,Sde)).minimumTerrainHeight),a.extrudedHeight=r};Hd.DynamicGeometryUpdater=QC;function QC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(QC.prototype=Object.create(ii.prototype),QC.prototype.constructor=QC);QC.prototype._isHidden=function(e,t,n){return!c(this._options.rectangle)||ii.prototype._isHidden.call(this,e,t,n)};QC.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);c(s)&&!c(o)&&(o=0),i.rectangle=Y.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(ZC.computeRectangle(i,Sde)).minimumTerrainHeight),i.extrudedHeight=s};var pk=Hd;var wde={};function TJe(e,t){return O.equalsEpsilon(e.latitude,t.latitude,O.EPSILON10)&&O.equalsEpsilon(e.longitude,t.longitude,O.EPSILON10)}var AJe=new he,CJe=new he;function EJe(e,t,n,i){t=xo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=c(i),s=c(n),a=new Array(o),l=new Array(o),u=new Array(o),f=t[0];a[0]=f;let h=e.cartesianToCartographic(f,AJe);s&&(h.height=n[0]),l[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=l[0],g=u[0],m=p===g,y=1;for(let b=1;b<o;++b){let x=t[b],A=e.cartesianToCartographic(x,CJe);s&&(A.height=n[b]),m=m&&A.height===0,TJe(h,A)?h.height<A.height&&(l[y-1]=A.height):(a[y]=x,l[y]=A.height,r?u[y]=i[b]:u[y]=0,m=m&&l[y]===u[y],he.clone(A,h),++y)}if(!(m||y<2))return a.length=y,l.length=y,u.length=y,{positions:a,topHeights:l,bottomHeights:u}}var SJe=new Array(2),wJe=new Array(2),vJe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};wde.computePositions=function(e,t,n,i,o,r){let s=EJe(e,t,n,i);if(!c(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,l=a-2,u,f,h=O.chordLength(o,e.maximumRadius),p=vJe;if(p.minDistance=h,p.ellipsoid=e,r){let g=0,m;for(m=0;m<a-1;m++)g+=Bi.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=SJe,b=wJe;p.positions=y,p.height=b;let x=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let A=Bi.generateArc(p);u.set(A,x),b[0]=i[m],b[1]=i[m+1],f.set(Bi.generateArc(p),x),x+=A.length}}else p.positions=t,p.height=n,u=new Float64Array(Bi.generateArc(p)),p.height=i,f=new Float64Array(Bi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:l}};var JC=wde;var Nq=new d,_k=new d,DJe=new d,vde=new d,PJe=new d,IJe=new d,OJe=new d;function ex(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new C("options.positions is required.");if(c(n)&&n.length!==t.length)throw new C("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new C("options.positions and options.minimumHeights must have the same length.");let o=e.vertexFormat??Ie.DEFAULT,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ie.clone(s),this._workerName="createWallGeometry";let a=1+t.length*d.packedLength+2;c(i)&&(a+=i.length),c(n)&&(a+=n.length),this.packedLength=a+ie.packedLength+Ie.packedLength+1}ex.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var Dde=ie.clone(ie.UNIT_SPHERE),Pde=new Ie,JD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Dde,vertexFormat:Pde,granularity:void 0};ex.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.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 l=ie.unpack(e,t,Dde);t+=ie.packedLength;let u=Ie.unpack(e,t,Pde);t+=Ie.packedLength;let f=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(l,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(JD.positions=r,JD.minimumHeights=s,JD.maximumHeights=a,JD.granularity=f,new ex(JD))};ex.fromConstantHeights=function(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new ex(l)};ex.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=JC.computePositions(s,t,i,n,r,!0);if(!c(a))return;let l=a.bottomPositions,u=a.topPositions,f=a.numCorners,h=u.length,p=h*2,g=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,x=o.st?new Float32Array(p/3*2):void 0,A=0,E=0,S=0,v=0,P=0,M=OJe,R=IJe,L=PJe,B=!0;h/=3;let _,w=0,D=1/(h-f-1);for(_=0;_<h;++_){let V=_*3,j=d.fromArray(u,V,Nq),U=d.fromArray(l,V,_k);if(o.position&&(g[A++]=U.x,g[A++]=U.y,g[A++]=U.z,g[A++]=j.x,g[A++]=j.y,g[A++]=j.z),o.st&&(x[P++]=w,x[P++]=0,x[P++]=w,x[P++]=1),o.normal||o.tangent||o.bitangent){let q=d.clone(d.ZERO,vde),X=d.subtract(j,s.geodeticSurfaceNormal(j,_k),_k);if(_+1<h&&(q=d.fromArray(u,V+3,vde)),B){let te=d.subtract(q,j,DJe),K=d.subtract(X,j,Nq);M=d.normalize(d.cross(K,te,M),M),B=!1}d.equalsEpsilon(j,q,O.EPSILON10)?B=!0:(w+=D,o.tangent&&(R=d.normalize(d.subtract(q,j,R),R)),o.bitangent&&(L=d.normalize(d.cross(M,R,L),L))),o.normal&&(m[E++]=M.x,m[E++]=M.y,m[E++]=M.z,m[E++]=M.x,m[E++]=M.y,m[E++]=M.z),o.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),o.bitangent&&(b[S++]=L.x,b[S++]=L.y,b[S++]=L.z,b[S++]=L.x,b[S++]=L.y,b[S++]=L.z)}}let I=new hn;o.position&&(I.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(I.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:x}));let N=p/3;p-=6*(f+1);let k=Fe.createTypedArray(N,p),H=0;for(_=0;_<N-2;_+=2){let V=_,j=_+2,U=d.fromArray(g,V*3,Nq),q=d.fromArray(g,j*3,_k);if(d.equalsEpsilon(U,q,O.EPSILON10))continue;let X=_+1,te=_+3;k[H++]=X,k[H++]=V,k[H++]=te,k[H++]=te,k[H++]=V,k[H++]=j}return new ct({attributes:I,indices:k,primitiveType:Me.TRIANGLES,boundingSphere:new le.fromVertices(g)})};var gk=ex;var Ide=new d,Ode=new d;function tx(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new C("options.positions is required.");if(c(n)&&n.length!==t.length)throw new C("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new C("options.positions and options.minimumHeights must have the same length.");let o=e.granularity??O.RADIANS_PER_DEGREE,r=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ie.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*d.packedLength+2;c(i)&&(s+=i.length),c(n)&&(s+=n.length),this.packedLength=s+ie.packedLength+1}tx.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n]=e._granularity,t};var Rde=ie.clone(ie.UNIT_SPHERE),eP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Rde,granularity:void 0};tx.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.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 l=ie.unpack(e,t,Rde);t+=ie.packedLength;let u=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(l,n._ellipsoid),n._granularity=u,n):(eP.positions=r,eP.minimumHeights=s,eP.maximumHeights=a,eP.granularity=u,new tx(eP))};tx.fromConstantHeights=function(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new tx(l)};tx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=JC.computePositions(r,t,i,n,o,!1);if(!c(s))return;let a=s.bottomPositions,l=s.topPositions,u=l.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let A=g*3,E=d.fromArray(l,A,Ide),S=d.fromArray(a,A,Ode);h[p++]=S.x,h[p++]=S.y,h[p++]=S.z,h[p++]=E.x,h[p++]=E.y,h[p++]=E.z}let m=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h})}),y=f/3;f=2*y-4+y;let b=Fe.createTypedArray(y,f),x=0;for(g=0;g<y-2;g+=2){let A=g,E=g+2,S=d.fromArray(h,A*3,Ide),v=d.fromArray(h,E*3,Ode);if(d.equalsEpsilon(S,v,O.EPSILON10))continue;let P=g+1,M=g+3;b[x++]=P,b[x++]=A,b[x++]=P,b[x++]=M,b[x++]=A,b[x++]=E}return b[x++]=y-2,b[x++]=y-1,new ct({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new le.fromVertices(h)})};var yk=tx;var Mde=new G;function RJe(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 Gd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new RJe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}c(Object.create)&&(Gd.prototype=Object.create(oi.prototype),Gd.prototype.constructor=Gd);Gd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,Mde)),c(l)||(l=G.WHITE),o=jt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new gk(this._options),attributes:i})};Gd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Mde),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new yk(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Gd.prototype._isHidden=function(e,t){return!c(t.positions)||oi.prototype._isHidden.call(this,e,t)};Gd.prototype._getIsClosed=function(e){return!1};Gd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.minimumHeights)||!Y.isConstant(t.maximumHeights)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.granularity)};Gd.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=c(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=c(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=c(o)?o.getValue(Ge.MINIMUM_VALUE):void 0};Gd.DynamicGeometryUpdater=eE;function eE(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(eE.prototype=Object.create(ii.prototype),eE.prototype.constructor=eE);eE.prototype._isHidden=function(e,t,n){return!c(this._options.positions)||ii.prototype._isHidden.call(this,e,t,n)};eE.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=Y.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=Y.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=Y.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=Y.getValueOrUndefined(t.granularity,n)};var bk=Gd;var nx=[cN,R3,E3,ek,tk,ak,fk,mk,pk,bk];function ix(e,t){this.entity=e,this.scene=t;let n=new Array(nx.length),i=new pe,o=new Ar;for(let r=0;r<n.length;r++){let s=new nx[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(ix.prototype._onEntityPropertyChanged,this)}ix.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)};ix.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};ix.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),de(this)};ix.registerUpdater=function(e){nx.includes(e)||nx.push(e)};ix.unregisterUpdater=function(e){if(nx.includes(e)){let t=nx.indexOf(e);nx.splice(t,1)}};var tE=ix;var Lde=new G,MJe=new Lt,LJe=new Lt,NJe=d.ZERO,FJe=new d;function jd(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 Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.invalidated=!1;let a;c(o)&&(a=o.definitionChanged.addEventListener(jd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}jd.prototype.onMaterialChanged=function(){this.invalidated=!0};jd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:c(t)?t.equals(n):!1};jd.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||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.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)}))}};jd.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};jd.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){c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let l;c(this.depthFailAppearanceType)&&(c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=or.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),l=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:l,shadows:this.shadows}),o.add(i),t=!1}else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=or.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||l){let b=u.fillMaterialProperty.color,x=Y.getValueOrDefault(b,e,G.WHITE,Lde);G.equals(h._lastColor,x)||(h._lastColor=G.clone(x,h._lastColor),h.color=jt.toValue(x,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(c(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Ut&&(!u.depthFailMaterialProperty.isConstant||l)){let b=u.depthFailMaterialProperty.color,x=Y.getValueOrDefault(b,e,G.WHITE,Lde);G.equals(h._lastDepthFailColor,x)||(h._lastDepthFailColor=G.clone(x,h._lastDepthFailColor),h.depthFailColor=jt.toValue(x,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,LJe,MJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!Y.isConstant(y)){let b=Y.getValueOrDefault(y,e,NJe,FJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Ji.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};jd.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};jd.prototype.contains=function(e){return this.updaters.contains(e.id)};jd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};jd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),c(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function nE(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}nE.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 l=n[a];if(l.isMaterial(t)){l.add(t,o);return}}let s=new jd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Nde(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}nE.prototype.remove=function(e){Nde(this._solidItems,e)||Nde(this._translucentItems,e)};function Fde(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,l=a.length;if(l>0)for(r=0;r<l;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function xk(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,l=a.length;for(let u=0;u<l;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}nE.prototype.update=function(e){let t=xk(this,this._solidItems,e,!0);t=xk(this,this._translucentItems,e,t)&&t;let n=Fde(this,this._solidItems,e),i=Fde(this,this._translucentItems,e);return(n||i)&&(t=xk(this,this._solidItems,e,t)&&t,t=xk(this,this._translucentItems,e,t)&&t),t};function Bde(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 lt.FAILED}nE.prototype.getBoundingSphere=function(e,t){let n=Bde(this._solidItems,e,t);return n===lt.FAILED?Bde(this._translucentItems,e,t):n};function kde(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}nE.prototype.removeAllPrimitives=function(){kde(this._solidItems),kde(this._translucentItems)};var Wd=nE;var BJe=new Lt,kJe=new Lt,UJe=d.ZERO,VJe=new d;function qd(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 Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(qd.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et}qd.prototype.onMaterialChanged=function(){this.invalidated=!0};qd.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=c(t)&&t.equals(n);return r=(!c(i)&&!c(o)||c(i)&&i.equals(o))&&r,r};qd.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||!Y.isConstant(t.distanceDisplayConditionProperty)||!Y.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};qd.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var zJe=new G;qd.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){c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=or.getValue(e,this.materialProperty,this.material);let a;c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=or.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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=or.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=or.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 l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);if(c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),c(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!l.depthFailMaterialProperty.isConstant){let b=l.depthFailMaterialProperty.color,x=Y.getValueOrDefault(b,e,G.WHITE,zJe);G.equals(h._lastDepthFailColor,x)||(h._lastDepthFailColor=G.clone(x,h._lastDepthFailColor),h.depthFailColor=jt.toValue(x,h.depthFailColor))}let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,kJe,BJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=l.terrainOffsetProperty;if(!Y.isConstant(y)){let b=Y.getValueOrDefault(y,e,UJe,VJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Ji.toValue(b,h.offset))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};qd.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=xn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};qd.prototype.contains=function(e){return this.updaters.contains(e.id)};qd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};qd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function iE(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}iE.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 qd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};iE.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}}};iE.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};iE.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 lt.FAILED};iE.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 Yd=iE;var Vde=jr(Ude(),1);function Tk(){this._tree=new Vde.default}function ox(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}ox.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};Tk.prototype.insert=function(e,t){T.typeOf.string("id",e),T.typeOf.object("rectangle",t);let n=ox.fromRectangleAndId(e,t,new ox);this._tree.insert(n)};function HJe(e,t){return e.id===t.id}var GJe=new ox;Tk.prototype.remove=function(e,t){T.typeOf.string("id",e),T.typeOf.object("rectangle",t);let n=ox.fromRectangleAndId(e,t,GJe);this._tree.remove(n,HJe)};var jJe=new ox;Tk.prototype.collides=function(e){T.typeOf.object("rectangle",e);let t=ox.fromRectangleAndId("",e,jJe);return this._tree.collides(t)};var oE=Tk;var WJe=new G,qJe=new Lt,YJe=new Lt;function l_(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 Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new oE}l_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};l_.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||!Y.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)}))}};l_.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 c(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};l_.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new _l({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||l){let y=u.fillMaterialProperty.color,b=Y.getValueOrDefault(y,e,G.WHITE,WJe);G.equals(h._lastColor,b)||(h._lastColor=G.clone(b,h._lastColor),h.color=jt.toValue(b,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let y=Y.getValueOrDefault(m,e,YJe,qJe);Lt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};l_.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};l_.prototype.contains=function(e){return this.updaters.contains(e.id)};l_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getBoundingSphere(e.entity);return c(i)?(i.clone(t),lt.DONE):lt.FAILED};l_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function rE(e,t){this._batches=[],this._primitives=e,this._classificationType=t}rE.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=Y.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let l=i[a];if(l.zIndex===o&&!l.overlapping(n.geometry.rectangle)){r=l;break}}return c(r)||(r=new l_(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};rE.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};rE.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,l=a.length;for(let u=0;u<l;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.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};rE.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 lt.FAILED};rE.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var tP=rE;var XJe=new Lt,KJe=new Lt;function Vf(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Vf.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new oE}Vf.prototype.onMaterialChanged=function(){this.invalidated=!0};Vf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Vf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Vf.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||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Vf.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 c(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Vf.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=or.getValue(e,this.materialProperty,this.material),n=new _l({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=or.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 l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let y=Y.getValueOrDefault(m,e,KJe,XJe);Lt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Vf.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=xn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Vf.prototype.contains=function(e){return this.updaters.contains(e.id)};Vf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Vf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function sE(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}sE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=sf.shouldUseSphericalCoordinates(o.geometry.rectangle),s=Y.getValueOrDefault(t.zIndex,0);for(let l=0;l<i;++l){let u=n[l];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new Vf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};sE.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}}};sE.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};sE.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 lt.FAILED};sE.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 Ak=sE;var $Je=new G,ZJe=new Lt,QJe=new Lt,JJe=d.ZERO,eet=new d;function u_(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 Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.itemsToRemove=[],this.subscriptions=new Et,this.showsUpdated=new Et}u_.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||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.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)}))}};u_.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};u_.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new rn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||l){let b=u.outlineColorProperty,x=Y.getValueOrDefault(b,e,G.WHITE,$Je);G.equals(h._lastColor,x)||(h._lastColor=G.clone(x,h._lastColor),h.color=jt.toValue(x,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,QJe,ZJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!Y.isConstant(y)){let b=Y.getValueOrDefault(y,e,JJe,eet);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Ji.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};u_.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};u_.prototype.contains=function(e){return this.updaters.contains(e.id)};u_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};u_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function aE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Et,this._translucentBatches=new Et}aE.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),c(r)||(r=new u_(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),c(r)||(r=new u_(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};aE.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};aE.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,l=a.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<l;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};aE.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 lt.FAILED};aE.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 nP=aE;var tet=[];function Ml(e,t,n,i){T.defined("scene",e),T.defined("entityCollection",t),n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;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=rr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new nP(n,e,s,!1),this._outlineBatches[o+s]=new nP(n,e,s,!0),this._closedColorBatches[s]=new Wd(n,rn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Wd(n,rn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Yd(n,so,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Yd(n,so,void 0,!0,s,!1),this._openColorBatches[s]=new Wd(n,rn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Wd(n,rn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Yd(n,so,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Yd(n,so,void 0,!1,s,!1);let a=Un.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new Ak(i,s,so)),l[s]=new tP(i,s);else for(s=0;s<a;++s)l[s]=new tP(i,s);this._groundColorBatches=l,this._groundMaterialBatches=u,this._dynamicBatch=new UC(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Et,this._updaterSets=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Ml.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,tet)}Ml.registerUpdater=function(e){tE.registerUpdater(e)};Ml.unregisterUpdater=function(e){tE.unregisterUpdater(e)};Ml.prototype.update=function(e){T.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,u,f,h=this;for(a=s.length-1;a>-1;a--)l=s[a],u=l.id,f=this._updaterSets.get(u),f.entity===l?f.forEach(function(y){h._removeUpdater(y),h._insertUpdaterIntoBatch(e,y)}):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new tE(l,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){h._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Ml._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var net=[],iet=new le;Ml.prototype.getBoundingSphere=function(e,t){T.defined("entity",e),T.defined("result",t);let n=net,i=iet,o=0,r=lt.DONE,s=this._batches,a=s.length,l=e.id,u=this._updaterSets.get(l).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?lt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),lt.DONE)};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ml.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(),de(this)};Ml.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Ml.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&&(c(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 Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Ml._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Ml.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var Ck=Ml;var oet=1,ret="30px sans-serif",set=Ko.FILL,aet=G.WHITE,cet=G.BLACK,uet=1,fet=!1,det=new G(.165,.165,.165,.8),het=new z(7,5),met=z.ZERO,pet=d.ZERO,_et=qe.NONE,get=xi.CENTER,yet=Fn.CENTER,bet=new d,xet=new G,Tet=new G,Aet=new G,Cet=new z,Eet=new d,wet=new z,vet=new Bt,Det=new Bt,Pet=new Bt,Iet=new Lt;function zde(e){this.entity=e,this.label=void 0,this.index=void 0}function Ty(e,t){if(!c(e))throw new C("entityCluster is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(Ty.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Ty.prototype.update=function(e){if(!c(e))throw new C("time is required.");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,l,u=r.label,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;if(f&&(h=Y.getValueOrUndefined(s._position,e,bet),l=Y.getValueOrUndefined(a._text,e),f=c(h)&&c(l)),!f){kq(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=Y.getValueOrDefault(a._heightReference,e,_et);c(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=d.equals(u.position,h)&&u.heightReference===g),u.show=!0,u.position=h,u.text=l,u.scale=Y.getValueOrDefault(a._scale,e,oet),u.font=Y.getValueOrDefault(a._font,e,ret),u.style=Y.getValueOrDefault(a._style,e,set),u.fillColor=Y.getValueOrDefault(a._fillColor,e,aet,xet),u.outlineColor=Y.getValueOrDefault(a._outlineColor,e,cet,Tet),u.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,uet),u.showBackground=Y.getValueOrDefault(a._showBackground,e,fet),u.backgroundColor=Y.getValueOrDefault(a._backgroundColor,e,det,Aet),u.backgroundPadding=Y.getValueOrDefault(a._backgroundPadding,e,het,Cet),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,met,wet),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,pet,Eet),u.heightReference=g,u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,get),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,yet),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,vet),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Det),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,Pet),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Iet),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};Ty.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.label))return lt.FAILED;let i=n.label;return t.center=d.clone(i._clampedPosition??i.position,t.center),t.radius=0,lt.DONE};Ty.prototype.isDestroyed=function(){return!1};Ty.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ty.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return de(this)};Ty.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],c(r._label)&&c(r._position)&&s.set(r.id,new zde(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._label)&&c(r._position)?s.contains(r.id)||s.set(r.id,new zde(r)):(kq(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],kq(s.get(r.id),r,a),s.remove(r.id)};function kq(e,t,n){c(e)&&(e.label=void 0,n.removeLabel(t))}var Ek=Ty;var Oet=1,Ret=!0,Met=0,Let=!0,Net=!0,Fet=Tn.ENABLED,Bet=qe.NONE,ket=G.RED,Uet=0,Vet=G.WHITE,zet=kc.HIGHLIGHT,Het=.5,Get=new z(1,1),Hde={maximumPositionEpsilon:Number.POSITIVE_INFINITY},jet=new F,Wet=new F,Gde=new G,jde=new Array(4),qet=new d;function Ay(e,t){T.typeOf.object("scene",e),T.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(Ay.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function Yet(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await om.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!c(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(l=>{c(s[t.id])&&(console.log(l),l.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!c(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}Ay.prototype.update=function(e){if(!c(e))throw new C("time is required.");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,l,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;if(f&&(h=s.computeModelMatrix(e,jet),l=we.createIfNeeded(Y.getValueOrUndefined(a._uri,e)),f=c(h)&&c(l)),!f){c(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!c(u)||l.url!==u.url){c(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:l.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Hde}},n[s.id]=u;let m=Y.getValueOrDefault(a._incrementallyLoadTextures,e,Let),y=Y.getValueOrDefault(a._environmentMapOptions,e,Hde,u.environmentMapOptionsScratch);Yet(this,s,l,m,y)}let p=u.modelPrimitive;if(!c(p))continue;p.show=!0,p.scale=Y.getValueOrDefault(a._scale,e,Oet),p.enableVerticalExaggeration=Y.getValueOrDefault(a._enableVerticalExaggeration,e,Ret),p.minimumPixelSize=Y.getValueOrDefault(a._minimumPixelSize,e,Met),p.maximumScale=Y.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(h,p.modelMatrix),p.shadows=Y.getValueOrDefault(a._shadows,e,Fet),p.heightReference=Y.getValueOrDefault(a._heightReference,e,Bet),p.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=Y.getValueOrDefault(a._silhouetteColor,e,ket,Gde),p.silhouetteSize=Y.getValueOrDefault(a._silhouetteSize,e,Uet),p.color=Y.getValueOrDefault(a._color,e,Vet,Gde),p.colorBlendMode=Y.getValueOrDefault(a._colorBlendMode,e,zet),p.colorBlendAmount=Y.getValueOrDefault(a._colorBlendAmount,e,Het),p.clippingPlanes=Y.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=Y.getValueOrDefault(a._clampAnimations,e,Net),p.imageBasedLighting.imageBasedLightingFactor=Y.getValueOrDefault(a._imageBasedLightingFactor,e,Get);let g=Y.getValueOrUndefined(a._lightColor,e);if(c(g)&&(G.pack(g,jde,0),g=d.unpack(jde,0,qet)),p.lightColor=g,p.customShader=Y.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=Y.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:au.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=Y.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(c(y)){let A=Object.keys(y);for(let E=0,S=A.length;E<S;++E){let v=A[E],P=y[v];if(!c(P))continue;let M=p.getNode(v);if(!c(M))continue;let R=F.fromTranslationRotationScale(P,Wet);M.matrix=F.multiply(M.originalMatrix,R,R)}}let b=!1,x=Y.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(c(x)){let A=Object.keys(x);for(let E=0,S=A.length;E<S;++E){let v=A[E],P=x[v];c(P)&&(b=!0,p.setArticulationStage(v,P))}}b&&p.applyArticulations()}}return!0};Ay.prototype.isDestroyed=function(){return!1};Ay.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ay.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Uq(this,e[i],t,n);return de(this)};var Sk=new d,Xet=new he;Ay.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._modelHash[e.id];if(!c(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!c(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene,r=o.ellipsoid??ie.default;if(i.heightReference!==qe.NONE){let a=i.modelMatrix;Sk.x=a[12],Sk.y=a[13],Sk.z=a[14];let l=r.cartesianToCartographic(Sk,Xet),u=o.getHeight(l,i.heightReference);return c(u)&&(of(i.heightReference)?l.height=u:l.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(l),lt.DONE}return le.clone(i.boundingSphere,t),lt.DONE};Ay.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._model)&&c(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._model)&&c(r._position)?(Ket(r,a),s.set(r.id,r)):(Uq(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Uq(this,r,a,l),s.remove(r.id)};function Uq(e,t,n,i){let o=n[t.id];c(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Ket(e,t){let n=t[e.id];c(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var wk=Ay;function Cy(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Cy.prototype,{isConstant:{get:function(){return Y.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return c(this._value)?this._value.referenceFrame:zi.FIXED}}});var $et=new Q;Cy.prototype.getValue=function(e,t){return c(e)||(e=Q.now($et)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Cy.prototype.setValue=function(e){this._value!==e&&(this._value=e,c(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),c(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Cy.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");if(c(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),c(n)?ie.default.scaleToGeodeticSurface(n,n):void 0};Cy.prototype.equals=function(e){return this===e||e instanceof Cy&&this._value===e._value};Cy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var f_=Cy;var Zet=60,Qet=1,qde=new Sn,Vq=new Sn,zq=new Sn;function Wde(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Jet(e,t,n,i,o,r,s,a,l){let u=a,f;f=e.getValueInReferenceFrame(t,r,l[u]),c(f)&&(l[u++]=f);let h=!c(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),p=0,g=i.length,m=i[p],y=n,b=!1,x,A,E;for(;p<g;){if(!h&&Q.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,l[u]),c(f)&&(l[u++]=f),h=!0),Q.greaterThan(m,t)&&Q.lessThan(m,y)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,l[u]),c(f)&&(l[u++]=f)),p<g-1){if(s>0&&!b){let S=i[p+1],v=Q.secondsDifference(S,m);b=v>s,b&&(x=Math.ceil(v/s),A=0,E=v/Math.max(x,2),x=Math.max(x-1,1))}if(b&&A<x){m=Q.addSeconds(m,E,new Q),A++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,l[u]),c(f)&&(l[u++]=f),u}function ett(e,t,n,i,o,r,s,a){let l,u=0,f=s,h=t,p=!c(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(h,n);)!p&&Q.greaterThanOrEquals(h,i)&&(p=!0,l=e.getValueInReferenceFrame(i,o,a[f]),c(l)&&(a[f]=l,f++)),l=e.getValueInReferenceFrame(h,o,a[f]),c(l)&&(a[f]=l,f++),u++,h=Q.addSeconds(t,r*u,new Q);return l=e.getValueInReferenceFrame(n,o,a[f]),c(l)&&(a[f]=l,f++),f}function ttt(e,t,n,i,o,r,s,a){let l,u=0,f=s,h=t,p=Math.max(r,60),g=!c(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(h,n);)!g&&Q.greaterThanOrEquals(h,i)&&(g=!0,l=e.getValueInReferenceFrame(i,o,a[f]),c(l)&&(a[f]=l,f++)),l=e.getValueInReferenceFrame(h,o,a[f]),c(l)&&(a[f]=l,f++),u++,h=Q.addSeconds(t,p*u,new Q);return l=e.getValueInReferenceFrame(n,o,a[f]),c(l)&&(a[f]=l,f++),f}function ntt(e,t,n,i,o,r,s,a){zq.start=t,zq.stop=n;let l=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!Sn.intersect(h,zq,qde).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[l]);c(g)&&(a[l]=g,l++)}}return l}function itt(e,t,n,i,o,r,s,a){let l=e.getValueInReferenceFrame(t,o,a[s]);return c(l)&&(a[s++]=l),s}function ott(e,t,n,i,o,r,s,a){Vq.start=t,Vq.stop=n;let l=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!Sn.intersect(h,Vq,qde).isEmpty){let p=h.start,g=h.stop,m=t;Q.greaterThan(p,m)&&(m=p);let y=n;Q.lessThan(g,y)&&(y=g),l=Yde(h.data,m,y,i,o,r,l,a)}}return l}function Yde(e,t,n,i,o,r,s,a){for(;e instanceof dy;)e=e.resolvedProperty;if(e instanceof Ia){let l=e._property._times;s=Jet(e,t,n,l,i,o,r,s,a)}else e instanceof lN?s=ett(e,t,n,i,o,r,s,a):e instanceof Pa?s=ott(e,t,n,i,o,r,s,a):e instanceof my?s=ntt(e,t,n,i,o,r,s,a):e instanceof gl||e instanceof f_&&Y.isConstant(e)?s=itt(e,t,n,i,o,r,s,a):s=ttt(e,t,n,i,o,r,s,a);return s}function Xde(e,t,n,i,o,r,s){c(s)||(s=[]);let a=Yde(e,t,n,i,o,r,0,s);return s.length=a,s}var rtt=new J;function iP(e,t){this._unusedIndexes=[],this._polylineCollection=new cm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}iP.prototype.update=function(e){if(this._referenceFrame===zi.INERTIAL){let t=Ot.computeIcrfToCentralBodyFixedMatrix(e,rtt);F.fromRotationTranslation(t,d.ZERO,this._polylineCollection.modelMatrix)}};iP.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,l=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!c(a)||a.getValue(e));if(u){let h=Y.getValueOrUndefined(i._leadTime,e),p=Y.getValueOrUndefined(i._trailTime,e),g=n._availability,m=c(g),y=c(h),b=c(p);if(u=m||y&&b,u){if(b&&(r=Q.addSeconds(e,-p,new Q)),y&&(s=Q.addSeconds(e,h,new Q)),m){let x=g.start,A=g.stop;(!b||Q.greaterThan(x,r))&&(r=x),(!y||Q.lessThan(A,s))&&(s=A)}u=Q.lessThan(r,s)}}if(!u){c(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0);return}if(!c(l)){let h=this._unusedIndexes;if(h.length>0){let g=h.pop();l=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}let f=Y.getValueOrDefault(i._resolution,e,Zet);l.show=!0,l.positions=Xde(o,r,s,e,this._referenceFrame,f,l.positions.slice()),l.material=or.getValue(e,i._material,l.material),l.width=Y.getValueOrDefault(i._width,e,Qet),l.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,l.distanceDisplayCondition)};iP.prototype.removeObject=function(e){let t=e.polyline;c(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};iP.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),de(this)};function Ey(e,t){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(Ey.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Ey.prototype.update=function(e){if(!c(e))throw new C("time is required.");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&&c(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,l=r.updater,u=zi.FIXED;this._scene.mode===oe.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(l===f&&c(f)){f.updateObject(e,r);continue}c(l)&&l.removeObject(r),c(f)||(f=new iP(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,c(f)&&f.updateObject(e,r)}return!0};Ey.prototype.isDestroyed=function(){return!1};Ey.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ey.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return de(this)};Ey.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],c(r._path)&&c(r._position)&&a.set(r.id,new Wde(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._path)&&c(r._position)?a.contains(r.id)||a.set(r.id,new Wde(r)):(s=a.get(r.id),c(s)&&(c(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),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};Ey._subSample=Xde;var vk=Ey;var Kde=G.WHITE,$de=G.BLACK,Zde=0,Qde=1,Jde=0,ehe=qr.NONE,the=new G,stt=new d,nhe=new G,ihe=new Bt,ohe=new Bt,rhe=new Lt;function she(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 Sy(e,t){if(!c(e))throw new C("entityCluster is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(Sy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Sy.prototype.update=function(e){if(!c(e))throw new C("time is required.");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,l=r.pointPrimitive,u=r.billboard,f=Y.getValueOrDefault(a._heightReference,e,qe.NONE),h=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),p;if(h&&(p=Y.getValueOrUndefined(s._position,e,stt),h=c(p)),!h){oP(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==qe.NONE&&!c(u)?(c(l)&&(oP(r,s,n),l=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===qe.NONE&&!c(l)&&(c(u)&&(oP(r,s,n),u=void 0),l=n.getPoint(s),l.id=s,r.pointPrimitive=l),c(l))l.show=!0,l.position=p,l.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,ihe),l.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,ohe),l.color=Y.getValueOrDefault(a._color,e,Kde,the),l.outlineColor=Y.getValueOrDefault(a._outlineColor,e,$de,nhe),l.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,Zde),l.pixelSize=Y.getValueOrDefault(a._pixelSize,e,Qde),l.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,rhe),l.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Jde),l.splitDirection=Y.getValueOrDefault(a._splitDirection,e,ehe);else if(c(u)){u.show=!0,u.position=p,u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,ihe),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,ohe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,rhe),u.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Jde),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,ehe),u.heightReference=f;let y=Y.getValueOrDefault(a._color,e,Kde,the),b=Y.getValueOrDefault(a._outlineColor,e,$de,nhe),x=Math.round(Y.getValueOrDefault(a._outlineWidth,e,Zde)),A=Math.max(1,Math.round(Y.getValueOrDefault(a._pixelSize,e,Qde)));if(x>0?(u.scale=1,g=g||x!==r.outlineWidth||A!==r.pixelSize||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)):(u.scale=A/50,A=50,g=g||x!==r.outlineWidth||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)),g){r.color=G.clone(y,r.color),r.outlineColor=G.clone(b,r.outlineColor),r.pixelSize=A,r.outlineWidth=x;let E=y.alpha,S=y.toCssColorString(),v=b.toCssColorString(),P=JSON.stringify([S,A,v,x]);u.setImage(P,ZA(E,S,v,x,A))}m&&u._updateClamping()}}return!0};Sy.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._items.get(e.id);if(!c(n)||!(c(n.pointPrimitive)||c(n.billboard)))return lt.FAILED;if(c(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};Sy.prototype.isDestroyed=function(){return!1};Sy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Sy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return de(this)};Sy.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],c(r._point)&&c(r._position)&&s.set(r.id,new she(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._point)&&c(r._position)?s.contains(r.id)||s.set(r.id,new she(r)):(oP(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],oP(s.get(r.id),r,a),s.remove(r.id)};function oP(e,t,n){if(c(e)){let i=e.pointPrimitive;if(c(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;c(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Dk=Sy;var fhe=[];function att(e,t,n,i,o){let r=fhe;r.length=o;let s,a=n.red,l=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,g=i.blue,m=i.alpha;if(G.equals(n,i)){for(s=0;s<o;s++)r[s]=G.clone(n);return r}let y=(h-a)/o,b=(p-l)/o,x=(g-u)/o,A=(m-f)/o;for(s=0;s<o;s++)r[s]=new G(a+s*y,l+s*b,u+s*x,f+s*A);return r}function rP(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new C("At least two positions are required.");if(typeof i!="number")throw new C("width must be a number");if(c(n)&&(o&&n.length<t.length||!o&&n.length<t.length-1))throw new C("colors has an invalid length.");this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=c(n)?1+n.length*G.packedLength:1,this.packedLength=r+ie.packedLength+Ie.packedLength+4}rP.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var dhe=ie.clone(ie.UNIT_SPHERE),hhe=new Ie,rx={positions:void 0,colors:void 0,ellipsoid:dhe,vertexFormat:hhe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};rP.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t,dhe);t+=ie.packedLength;let l=Ie.unpack(e,t,hhe);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(l,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(rx.positions=r,rx.colors=s,rx.width=u,rx.colorsPerVertex=f,rx.arcType=h,rx.granularity=p,new rP(rx))};var ahe=new d,che=new d,lhe=new d,uhe=new d;rP.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,l,u,f,h=[],p=xo(e._positions,d.equalsEpsilon,!1,h);if(c(i)&&h.length>0){let N=0,k=h[0];i=i.filter(function(H,V){let j=!1;return o?j=V===k||V===0&&k===1:j=V+1===k,j?(N++,k=h[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===qt.GEODESIC||r===qt.RHUMB){let N,k;r===qt.GEODESIC?(N=O.chordLength(s,a.maximumRadius),k=Bi.numberOfPoints):(N=s,k=Bi.numberOfPointsRhumbLine);let H=Bi.extractHeights(p,a);if(c(i)){let V=1;for(l=0;l<g-1;++l)V+=k(p[l],p[l+1],N);let j=new Array(V),U=0;for(l=0;l<g-1;++l){let q=p[l],X=p[l+1],te=i[l],K=k(q,X,N);if(o&&l<V){let Z=i[l+1],ee=att(q,X,te,Z,K),me=ee.length;for(u=0;u<me;++u)j[U++]=ee[u]}else for(u=0;u<K;++u)j[U++]=G.clone(te)}j[U]=G.clone(i[i.length-1]),i=j,fhe.length=0}r===qt.GEODESIC?p=Bi.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:H}):p=Bi.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:H})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float64Array(m*3),A=new Float32Array(m*2),E=n.st?new Float32Array(m*2):void 0,S=c(i)?new Uint8Array(m*4):void 0,v=0,P=0,M=0,R=0,L;for(u=0;u<g;++u){u===0?(L=ahe,d.subtract(p[0],p[1],L),d.add(p[0],L,L)):L=p[u-1],d.clone(L,lhe),d.clone(p[u],che),u===g-1?(L=ahe,d.subtract(p[g-1],p[g-2],L),d.add(p[g-1],L,L)):L=p[u+1],d.clone(L,uhe);let N,k;c(S)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==g-1&&(k=i[u]));let H=u===0?2:0,V=u===g-1?2:4;for(f=H;f<V;++f){d.pack(che,y,v),d.pack(lhe,b,v),d.pack(uhe,x,v),v+=3;let j=f-2<0?-1:1;if(A[P++]=2*(f%2)-1,A[P++]=j*t,n.st&&(E[M++]=u/(g-1),E[M++]=Math.max(A[P-2],0)),c(S)){let U=f<2?N:k;S[R++]=G.floatToByte(U.red),S[R++]=G.floatToByte(U.green),S[R++]=G.floatToByte(U.blue),S[R++]=G.floatToByte(U.alpha)}}}let B=new hn;B.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:y}),B.prevPosition=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b}),B.nextPosition=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:x}),B.expandAndWidth=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:A}),n.st&&(B.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:E})),c(S)&&(B.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Fe.createTypedArray(m,g*6-6),w=0,D=0,I=g-1;for(u=0;u<I;++u)_[D++]=w,_[D++]=w+2,_[D++]=w+1,_[D++]=w+1,_[D++]=w+2,_[D++]=w+3,w+=4;return new ct({attributes:B,indices:_,primitiveType:Me.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:ld.POLYLINES})};var wy=rP;var ctt=new Xn(0),Pk={},mhe=new G,ltt=new Ut(G.WHITE),utt=new Xn(!0),ftt=new Xn(Tn.DISABLED),dtt=new Xn(new Lt),htt=new Xn(Un.BOTH);function mtt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function ptt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Xd(e,t){if(!c(e))throw new C("entity is required");if(!c(t))throw new C("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Xd.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new pe,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 mtt,this._groundGeometryOptions=new ptt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=rr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Xd.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||!c(this._entity.availability)&&Y.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}}});Xd.prototype.isOutlineVisible=function(e){return!1};Xd.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Xd.prototype.createFillGeometryInstance=function(e){if(!c(e))throw new C("time is required.");if(!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,mhe)),c(a)||(a=G.WHITE),s.color=jt.fromColor(a)),this.clampToGround?new St({id:t,geometry:new qT(this._groundGeometryOptions),attributes:s}):(c(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(c(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,mhe)),c(a)||(a=G.WHITE),s.depthFailColor=jt.fromColor(a)),new St({id:t,geometry:new wy(this._geometryOptions),attributes:s}))};Xd.prototype.createOutlineGeometryInstance=function(e){throw new C("This instance does not represent an outlined geometry.")};Xd.prototype.isDestroyed=function(){return!1};Xd.prototype.destroy=function(){this._entitySubscription(),de(this)};Xd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!c(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(c(s)&&s.isConstant&&!s.getValue(Ge.MINIMUM_VALUE)||!c(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,l=o.material??ltt,u=l instanceof Ut;this._materialProperty=l,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??utt,this._shadowsProperty=o.shadows??ftt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??dtt,this._classificationTypeProperty=o.classificationType??htt,this._fillEnabled=!0,this._zIndex=a??ctt;let f=o.width,h=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!Y.isConstant(f)||!Y.isConstant(h)||!Y.isConstant(g)||!Y.isConstant(p)||!Y.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=r.getValue(Ge.MINIMUM_VALUE,m.positions);if(!c(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!c(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?b=os.VERTEX_FORMAT:b=Ea.VERTEX_FORMAT,m.vertexFormat=b,m.positions=y,m.width=c(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,m.arcType=c(h)?h.getValue(Ge.MINIMUM_VALUE):void 0,m.granularity=c(g)?g.getValue(Ge.MINIMUM_VALUE):void 0;let x=this._groundGeometryOptions;x.positions=y,x.width=m.width,x.arcType=m.arcType,x.granularity=m.granularity,this._clampToGround=c(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&c(a)&&dt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Xd.prototype.createDynamicUpdater=function(e,t){if(T.defined("primitives",e),T.defined("groundPrimitives",t),!this._dynamic)throw new C("This instance does not represent dynamic geometry.");return new sP(e,t,this)};var cE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function sP(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 phe(e){if(c(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Pk[n];!c(i)||i.isDestroyed()?(i=new cm,Pk[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}sP.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=Y.getValueOrUndefined(o,e,this._positions);t._clampToGround=Y.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=Y.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=Y.getValueOrDefault(i._arcType,e,qt.GEODESIC),t._groundGeometryOptions.granularity=Y.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(c(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)||!c(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Ut)p=new os;else{let g=or.getValue(e,h,this._material);p=new Ea({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Nh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Y.getValueOrUndefined(t.zIndex,e)),c(this._line)&&(this._line.show=!1);return}let a=phe(this);if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!c(r)||r.length<2){a.show=!1;return}let l=qt.GEODESIC;l=Y.getValueOrDefault(i._arcType,e,l);let u=t._scene.globe,f=t._scene.ellipsoid;l!==qt.NONE&&c(u)&&(cE.ellipsoid=f,cE.positions=r,cE.granularity=Y.getValueOrUndefined(i._granularity,e),cE.height=Bi.extractHeights(r,f),l===qt.GEODESIC?r=Bi.generateCartesianArc(cE):r=Bi.generateCartesianRhumbArc(cE)),a.show=!0,a.positions=r.slice(),a.material=or.getValue(e,t.fillMaterialProperty,a.material),a.width=Y.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};sP.prototype.getBoundingSphere=function(e){if(T.defined("result",e),this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(c(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(c(n)&&c(n.boundingSphere))return le.clone(n.boundingSphere,e),lt.DONE}return c(t)&&!t.ready?lt.PENDING:lt.DONE}else{let t=phe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};sP.prototype.isDestroyed=function(){return!1};sP.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Pk[t];c(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Pk[t])),c(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),de(this)};var Ik=Xd;var _tt=new G,gtt=new Lt,ytt=new Lt;function Kd(e,t,n,i,o){let r;n instanceof Ut?r=os:r=Ea,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Kd.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=o}Kd.prototype.onMaterialChanged=function(){this.invalidated=!0};Kd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Kd.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||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Kd.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 c(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Kd.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Nh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ea&&(this.material=or.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ea&&(this.material=or.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 l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);if(c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!l.fillMaterialProperty.isConstant){let y=l.fillMaterialProperty.color,b=Y.getValueOrDefault(y,e,G.WHITE,_tt);G.equals(h._lastColor,b)||(h._lastColor=G.clone(b,h._lastColor),h.color=jt.toValue(b,h.color))}let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let y=Y.getValueOrDefault(m,e,ytt,gtt);Lt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Kd.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=xn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Kd.prototype.contains=function(e){return this.updaters.contains(e.id)};Kd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Kd.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function lE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}lE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Y.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let l=n[a];if(l.isMaterial(t)&&l.zIndex===r){l.add(e,t,o);return}}let s=new Kd(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};lE.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}}};lE.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};lE.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 lt.FAILED};lE.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 Ok=lE;var btt=[];function _he(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function ghe(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;c(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;c(i)&&(r=i+o*Tn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Am(e,t,n,i){T.defined("scene",e),T.defined("entityCollection",t),i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;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 Wd(n,os,void 0,!1,o),this._materialBatches[o]=new Yd(n,Ea,void 0,!1,o),this._colorBatches[o+r]=new Wd(n,os,os,!1,o),this._materialBatches[o+r]=new Yd(n,Ea,os,!1,o),this._colorBatches[o+r*2]=new Wd(n,os,Ea,!1,o),this._materialBatches[o+r*2]=new Yd(n,Ea,Ea,!1,o);this._dynamicBatch=new UC(n,i);let s=Un.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new Ok(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Et,this._updaters=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Am.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,btt)}Am.prototype.update=function(e){T.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,u,f;for(a=s.length-1;a>-1;a--)l=s[a],u=l.id,f=this._updaters.get(u),f.entity===l?(_he(this,f),ghe(this,e,f)):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaters.get(u),_he(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new Ik(l,this._scene),this._updaters.set(u,f),ghe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Am._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 xtt=[],Ttt=new le;Am.prototype.getBoundingSphere=function(e,t){T.defined("entity",e),T.defined("result",t);let n=xtt,i=Ttt,o=0,r=lt.DONE,s=this._batches,a=s.length,l=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(l,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?lt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),lt.DONE)};Am.prototype.isDestroyed=function(){return!1};Am.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Am.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(),de(this)};Am._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Am.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var Rk=Am;function Ll(e){T.typeOf.object("options",e),T.typeOf.object("options.scene",e.scene),T.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),_l.initializeTerrainHeights(),Nh.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=e.visualizersCallback??Ll.defaultVisualizersCallback;let i=!1,o=new Ol,r=new Ol;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new P3;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,l;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),l(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),l=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=l,this._ready=!1}var uE=[];Ll.registerVisualizer=function(e){uE.includes(e)||uE.push(e)};Ll.unregisterVisualizer=function(e){if(uE.includes(e)){let t=uE.indexOf(e);uE.splice(t,1)}};Ll.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new dL(t,i),new Ck(e,i,n._primitives,n._groundPrimitives),new Ek(t,i),new wk(e,i),new m3(e,i),new Dk(t,i),new vk(e,i),new Rk(e,i,n._primitives,n._groundPrimitives),...uE.map(o=>new o(e,i))]};Object.defineProperties(Ll.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}}});Ll.prototype.isDestroyed=function(){return!1};Ll.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),c(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),de(this)};Ll.prototype.update=function(e){if(T.defined("time",e),!fi.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 l=s.get(n);for(c(l.update)&&(t=l.update(e)&&t),o=l._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};Ll.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;c(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)e.creditDisplay.addCreditToNextFrame(s[l])}}};var Att=[],Ctt=new le;Ll.prototype.getBoundingSphere=function(e,t,n){if(T.defined("entity",e),T.typeOf.bool("allowPartial",t),T.defined("result",n),!this._ready)return lt.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(!c(r))return lt.FAILED;let s=Att,a=Ctt,l=0,u=lt.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(c(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===lt.PENDING)return lt.PENDING;u===lt.DONE&&(s[l]=le.clone(a,s[l]),l++)}}return l===0?lt.FAILED:(s.length=l,le.fromBoundingSpheres(s,n),lt.DONE)};Ll.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Ol),s=o.add(new Y3);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Ll.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,l=a.length;for(let u=0;u<l;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Ll.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 Mk=Ll;function Hq(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}Hq.clone=function(e,t){if(c(e))return c(t)||(t=new Hq),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var $d=Hq;var yhe=new J,bhe=new J,xhe=new J,Ett=new F,Lk=new d,The=new d,Gq=new d,jq=new d,Ahe=new d,Che=new d,Stt=new Le,wtt=new d,vtt=new J,fE=new Q,Dtt=1.25;function Ptt(e,t,n,i,o,r,s,a,l,u){let f=e.scene.mode,h=o.getValue(l,e._lastCartesian);if(c(h)){let p=!1,g=!1,m,y,b;if(f===oe.SCENE3D){Q.addSeconds(l,.001,fE);let M=o.getValue(fE,Lk);if(c(M)||(Q.addSeconds(l,-.001,fE),M=o.getValue(fE,Lk),g=!0),c(M)){let R=Ot.computeFixedToIcrfMatrix(l,yhe),L=Ot.computeFixedToIcrfMatrix(fE,bhe),B;!c(R)||!c(L)?(B=Ot.computeTemeToPseudoFixedMatrix(l,xhe),R=J.transpose(B,yhe),L=Ot.computeTemeToPseudoFixedMatrix(fE,bhe),J.transpose(L,L)):B=J.transpose(R,xhe);let _=J.multiplyByVector(R,h,Ahe),w=J.multiplyByVector(L,M,Che);d.subtract(_,w,jq);let D=d.magnitude(jq)*1e3,I=O.GRAVITATIONALPARAMETER,N=-I/(D*D-2*I/d.magnitude(_));N<0||N>Dtt*u.maximumRadius?(m=The,d.normalize(h,m),d.negate(m,m),b=d.clone(d.UNIT_Z,Gq),y=d.cross(b,m,Lk),d.magnitude(y)>O.EPSILON7&&(d.normalize(m,m),d.normalize(y,y),b=d.cross(m,y,Gq),d.normalize(b,b),p=!0)):d.equalsEpsilon(h,M,O.EPSILON7)||(b=The,d.normalize(_,b),d.normalize(w,w),y=d.cross(b,w,Gq),g&&(y=d.multiplyByScalar(y,-1,y)),d.equalsEpsilon(y,d.ZERO,O.EPSILON7)||(m=d.cross(y,b,Lk),J.multiplyByVector(B,m,m),J.multiplyByVector(B,y,y),J.multiplyByVector(B,b,b),d.normalize(m,m),d.normalize(y,y),d.normalize(b,b),p=!0))}}c(e.boundingSphere)&&(h=e.boundingSphere.center);let x,A,E;i&&(x=d.clone(t.position,jq),A=d.clone(t.direction,Ahe),E=d.clone(t.up,Che));let S=Ett,v;c(s)&&(v=s.getValue(l,Stt));let P=r.getValue(l,wtt);if(a===Q_.INERTIAL&&c(v))F.fromTranslationQuaternionRotationScale(h,v,d.ONE,S);else if(a===Q_.VELOCITY&&c(P)){let M=Ot.rotationMatrixFromPositionVelocity(h,P,u,vtt);F.fromRotationTranslation(M,h,S)}else a===Q_.ENU||!p?Ot.eastNorthUpToFixedFrame(h,u,S):(S[0]=m.x,S[1]=m.y,S[2]=m.z,S[3]=0,S[4]=y.x,S[5]=y.y,S[6]=y.z,S[7]=0,S[8]=b.x,S[9]=b.y,S[10]=b.z,S[11]=0,S[12]=h.x,S[13]=h.y,S[14]=h.z,S[15]=0);t._setTransform(S),i&&(d.clone(x,t.position),d.clone(A,t.direction),d.clone(E,t.up),d.cross(A,E,t.right))}if(n){let p=f===oe.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function aP(e,t,n){T.defined("entity",e),T.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=n??ie.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new _y(e.position,!0),this._offset3D=new d}Object.defineProperties(aP,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});aP.defaultOffset3D=new d(-14e3,3500,3500);var Nk=new $d,Itt=new d;aP.prototype.update=function(e,t){T.defined("time",e);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(!c(a))return;let l=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=f||h,m=!0;if(f){let y=r.viewFrom,b=c(y);if(!b&&c(t)){Nk.pitch=-O.PI_OVER_FOUR,Nk.range=0;let x=a.getValue(e,Itt);if(c(x)){let A=2-1/Math.max(1,d.magnitude(x)/i.maximumRadius);Nk.pitch*=A}p.viewBoundingSphere(t,Nk),this.boundingSphere=t,g=!1,m=!1}else(!b||!c(y.getValue(e,this._offset3D)))&&d.clone(aP._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Ptt(this,p,g,m,a,l,u,s,e,i)};var Fk=aP;function Gk(e){return jk(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function jk(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?jk(n):n),[])}var Ehe=[0,1,2,3].concat(...Gk([[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 fr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,h,p,g,m,y,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)h=o.heap[f],g=r[r[h*2+1]*2+1]+1,g>u&&(g=u,b++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,m=0,h>=l&&(m=a[h-l]),y=r[h*2],o.opt_len+=y*(g+m),s&&(o.static_len+=y*(s[h*2+1]+m)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--f],!(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=[],l=0,u,f,h;for(u=1;u<=15;u++)a[u]=l=l+s[u-1]<<1;for(f=0;f<=r;f++)h=o[f*2+1],h!==0&&(o[f*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,l,u,f=-1,h;for(o.heap_len=0,o.heap_max=573,l=0;l<a;l++)r[l*2]!==0?(o.heap[++o.heap_len]=f=l,o.depth[l]=0):r[l*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=f<2?++f:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=f,l=Math.floor(o.heap_len/2);l>=1;l--)o.pqdownheap(r,l);h=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=u,r[h*2]=r[l*2]+r[u*2],o.depth[h]=Math.max(o.depth[l],o.depth[u])+1,r[l*2+1]=r[u*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)}}fr._length_code=[0,1,2,3,4,5,6,7].concat(...Gk([[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]]));fr.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];fr.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];fr.d_code=function(e){return e<256?Ehe[e]:Ehe[256+(e>>>7)]};fr.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];fr.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];fr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];fr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Oa(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 Ott=[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],Rtt=Gk([[144,8],[112,9],[24,7],[8,8]]);Oa.static_ltree=jk(Ott.map((e,t)=>[e,Rtt[t]]));var Mtt=[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],Ltt=Gk([[30,5]]);Oa.static_dtree=jk(Mtt.map((e,t)=>[e,Ltt[t]]));Oa.static_l_desc=new Oa(Oa.static_ltree,fr.extra_lbits,257,286,15);Oa.static_d_desc=new Oa(Oa.static_dtree,fr.extra_dbits,0,30,15);Oa.static_bl_desc=new Oa(null,fr.extra_blbits,0,19,7);var Ntt=9,Ftt=8;function Cm(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 whe=0,zk=1,sx=2,Zd=[new Cm(0,0,0,0,whe),new Cm(4,4,8,4,zk),new Cm(4,5,16,8,zk),new Cm(4,6,32,32,zk),new Cm(4,4,16,16,sx),new Cm(8,16,32,32,sx),new Cm(8,16,128,128,sx),new Cm(8,32,128,256,sx),new Cm(32,128,258,1024,sx),new Cm(32,258,258,4096,sx)],Bk=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],zf=0,kk=1,cP=2,Uk=3,Btt=32,Wq=42,Vk=113,lP=666,qq=8,ktt=0,Yq=1,Utt=2,Er=3,Hk=258,bu=Hk+Er+1;function She(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Vtt(){let e=this,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y,b,x,A,E,S,v,P,M,R,L,B,_,w,D,I,N,k,H,V=new fr,j=new fr,U=new fr;e.depth=[];let q,X,te,K,Z,ee;e.bl_count=[],e.heap=[],N=[],k=[],H=[];function me(){u=2*r,h[g-1]=0;for(let Ne=0;Ne<g-1;Ne++)h[Ne]=0;B=Zd[_].max_lazy,D=Zd[_].good_length,I=Zd[_].nice_length,L=Zd[_].max_chain,v=0,x=0,M=0,A=R=Er-1,S=0,p=0}function xe(){let Ne;for(Ne=0;Ne<286;Ne++)N[Ne*2]=0;for(Ne=0;Ne<30;Ne++)k[Ne*2]=0;for(Ne=0;Ne<19;Ne++)H[Ne*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,X=te=0}function ue(){V.dyn_tree=N,V.stat_desc=Oa.static_l_desc,j.dyn_tree=k,j.stat_desc=Oa.static_d_desc,U.dyn_tree=H,U.stat_desc=Oa.static_bl_desc,Z=0,ee=0,K=8,xe()}e.pqdownheap=function(Ne,ot){let Xe=e.heap,Ze=Xe[ot],pt=ot<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&She(Ne,Xe[pt+1],Xe[pt],e.depth)&&pt++,!She(Ne,Ze,Xe[pt],e.depth));)Xe[ot]=Xe[pt],ot=pt,pt<<=1;Xe[ot]=Ze};function ye(Ne,ot){let Xe=-1,Ze,pt=Ne[0*2+1],Ht=0,bn=7,wo=4;pt===0&&(bn=138,wo=3),Ne[(ot+1)*2+1]=65535;for(let yo=0;yo<=ot;yo++)Ze=pt,pt=Ne[(yo+1)*2+1],!(++Ht<bn&&Ze==pt)&&(Ht<wo?H[Ze*2]+=Ht:Ze!==0?(Ze!=Xe&&H[Ze*2]++,H[16*2]++):Ht<=10?H[17*2]++:H[18*2]++,Ht=0,Xe=Ze,pt===0?(bn=138,wo=3):Ze==pt?(bn=6,wo=3):(bn=7,wo=4))}function Ae(){let Ne;for(ye(N,V.max_code),ye(k,j.max_code),U.build_tree(e),Ne=18;Ne>=3&&H[fr.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Pe(Ne){e.pending_buf[e.pending++]=Ne}function Ee(Ne){Pe(Ne&255),Pe(Ne>>>8&255)}function Ve(Ne){Pe(Ne>>8&255),Pe(Ne&255&255)}function je(Ne,ot){let Xe,Ze=ot;ee>16-Ze?(Xe=Ne,Z|=Xe<<ee&65535,Ee(Z),Z=Xe>>>16-ee,ee+=Ze-16):(Z|=Ne<<ee&65535,ee+=Ze)}function it(Ne,ot){let Xe=Ne*2;je(ot[Xe]&65535,ot[Xe+1]&65535)}function Dt(Ne,ot){let Xe,Ze=-1,pt,Ht=Ne[0*2+1],bn=0,wo=7,yo=4;for(Ht===0&&(wo=138,yo=3),Xe=0;Xe<=ot;Xe++)if(pt=Ht,Ht=Ne[(Xe+1)*2+1],!(++bn<wo&&pt==Ht)){if(bn<yo)do it(pt,H);while(--bn!==0);else pt!==0?(pt!=Ze&&(it(pt,H),bn--),it(16,H),je(bn-3,2)):bn<=10?(it(17,H),je(bn-3,3)):(it(18,H),je(bn-11,7));bn=0,Ze=pt,Ht===0?(wo=138,yo=3):pt==Ht?(wo=6,yo=3):(wo=7,yo=4)}}function Gt(Ne,ot,Xe){let Ze;for(je(Ne-257,5),je(ot-1,5),je(Xe-4,4),Ze=0;Ze<Xe;Ze++)je(H[fr.bl_order[Ze]*2+1],3);Dt(N,Ne-1),Dt(k,ot-1)}function $e(){ee==16?(Ee(Z),Z=0,ee=0):ee>=8&&(Pe(Z&255),Z>>>=8,ee-=8)}function ln(){je(Yq<<1,3),it(256,Oa.static_ltree),$e(),1+K+10-ee<9&&(je(Yq<<1,3),it(256,Oa.static_ltree),$e()),K=7}function Vt(Ne,ot){let Xe,Ze,pt;if(e.dist_buf[X]=Ne,e.lc_buf[X]=ot&255,X++,Ne===0?N[ot*2]++:(te++,Ne--,N[(fr._length_code[ot]+256+1)*2]++,k[fr.d_code(Ne)*2]++),!(X&8191)&&_>2){for(Xe=X*8,Ze=v-x,pt=0;pt<30;pt++)Xe+=k[pt*2]*(5+fr.extra_dbits[pt]);if(Xe>>>=3,te<Math.floor(X/2)&&Xe<Math.floor(Ze/2))return!0}return X==q-1}function Ct(Ne,ot){let Xe,Ze,pt=0,Ht,bn;if(X!==0)do Xe=e.dist_buf[pt],Ze=e.lc_buf[pt],pt++,Xe===0?it(Ze,Ne):(Ht=fr._length_code[Ze],it(Ht+256+1,Ne),bn=fr.extra_lbits[Ht],bn!==0&&(Ze-=fr.base_length[Ht],je(Ze,bn)),Xe--,Ht=fr.d_code(Xe),it(Ht,ot),bn=fr.extra_dbits[Ht],bn!==0&&(Xe-=fr.base_dist[Ht],je(Xe,bn)));while(pt<X);it(256,Ne),K=Ne[256*2+1]}function gi(){ee>8?Ee(Z):ee>0&&Pe(Z&255),Z=0,ee=0}function an(Ne,ot,Xe){gi(),K=8,Xe&&(Ee(ot),Ee(~ot)),e.pending_buf.set(l.subarray(Ne,Ne+ot),e.pending),e.pending+=ot}function _e(Ne,ot,Xe){je((ktt<<1)+(Xe?1:0),3),an(Ne,ot,!0)}function Ce(Ne,ot,Xe){let Ze,pt,Ht=0;_>0?(V.build_tree(e),j.build_tree(e),Ht=Ae(),Ze=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Ze&&(Ze=pt)):Ze=pt=ot+5,ot+4<=Ze&&Ne!=-1?_e(Ne,ot,Xe):pt==Ze?(je((Yq<<1)+(Xe?1:0),3),Ct(Oa.static_ltree,Oa.static_dtree)):(je((Utt<<1)+(Xe?1:0),3),Gt(V.max_code+1,j.max_code+1,Ht+1),Ct(N,k)),xe(),Xe&&gi()}function mn(Ne){Ce(x>=0?x:-1,v-x,Ne),x=v,t.flush_pending()}function mt(){let Ne,ot,Xe,Ze;do{if(Ze=u-M-v,Ze===0&&v===0&&M===0)Ze=r;else if(Ze==-1)Ze--;else if(v>=r+r-bu){l.set(l.subarray(r,r+r),0),P-=r,v-=r,x-=r,Ne=g,Xe=Ne;do ot=h[--Xe]&65535,h[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ne=r,Xe=Ne;do ot=f[--Xe]&65535,f[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ze+=r}if(t.avail_in===0)return;Ne=t.read_buf(l,v+M,Ze),M+=Ne,M>=Er&&(p=l[v]&255,p=(p<<b^l[v+1]&255)&y)}while(M<bu&&t.avail_in!==0)}function to(Ne){let ot=65535,Xe;for(ot>i-5&&(ot=i-5);;){if(M<=1){if(mt(),M===0&&Ne==0)return zf;if(M===0)break}if(v+=M,M=0,Xe=x+ot,(v===0||v>=Xe)&&(M=v-Xe,v=Xe,mn(!1),t.avail_out===0)||v-x>=r-bu&&(mn(!1),t.avail_out===0))return zf}return mn(Ne==4),t.avail_out===0?Ne==4?cP:zf:Ne==4?Uk:kk}function So(Ne){let ot=L,Xe=v,Ze,pt,Ht=R,bn=v>r-bu?v-(r-bu):0,wo=I,yo=a,ka=v+Hk,Ua=l[Xe+Ht-1],yi=l[Xe+Ht];R>=D&&(ot>>=2),wo>M&&(wo=M);do if(Ze=Ne,!(l[Ze+Ht]!=yi||l[Ze+Ht-1]!=Ua||l[Ze]!=l[Xe]||l[++Ze]!=l[Xe+1])){Xe+=2,Ze++;do;while(l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&Xe<ka);if(pt=Hk-(ka-Xe),Xe=ka-Hk,pt>Ht){if(P=Ne,Ht=pt,pt>=wo)break;Ua=l[Xe+Ht-1],yi=l[Xe+Ht]}}while((Ne=f[Ne&yo]&65535)>bn&&--ot!==0);return Ht<=M?Ht:M}function Ks(Ne){let ot=0,Xe;for(;;){if(M<bu){if(mt(),M<bu&&Ne==0)return zf;if(M===0)break}if(M>=Er&&(p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),ot!==0&&(v-ot&65535)<=r-bu&&w!=2&&(A=So(ot)),A>=Er)if(Xe=Vt(v-P,A-Er),M-=A,A<=B&&M>=Er){A--;do v++,p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v;while(--A!==0);v++}else v+=A,A=0,p=l[v]&255,p=(p<<b^l[v+1]&255)&y;else Xe=Vt(0,l[v]&255),M--,v++;if(Xe&&(mn(!1),t.avail_out===0))return zf}return mn(Ne==4),t.avail_out===0?Ne==4?cP:zf:Ne==4?Uk:kk}function vr(Ne){let ot=0,Xe,Ze;for(;;){if(M<bu){if(mt(),M<bu&&Ne==0)return zf;if(M===0)break}if(M>=Er&&(p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),R=A,E=P,A=Er-1,ot!==0&&R<B&&(v-ot&65535)<=r-bu&&(w!=2&&(A=So(ot)),A<=5&&(w==1||A==Er&&v-P>4096)&&(A=Er-1)),R>=Er&&A<=R){Ze=v+M-Er,Xe=Vt(v-1-E,R-Er),M-=R-1,R-=2;do++v<=Ze&&(p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v);while(--R!==0);if(S=0,A=Er-1,v++,Xe&&(mn(!1),t.avail_out===0))return zf}else if(S!==0){if(Xe=Vt(0,l[v-1]&255),Xe&&mn(!1),v++,M--,t.avail_out===0)return zf}else S=1,v++,M--}return S!==0&&(Xe=Vt(0,l[v-1]&255),S=0),mn(Ne==4),t.avail_out===0?Ne==4?cP:zf:Ne==4?Uk:kk}function ps(Ne){return Ne.total_in=Ne.total_out=0,Ne.msg=null,e.pending=0,e.pending_out=0,n=Vk,o=0,ue(),me(),0}e.deflateInit=function(Ne,ot,Xe,Ze,pt,Ht){return Ze||(Ze=qq),pt||(pt=Ftt),Ht||(Ht=0),Ne.msg=null,ot==-1&&(ot=6),pt<1||pt>Ntt||Ze!=qq||Xe<9||Xe>15||ot<0||ot>9||Ht<0||Ht>2?-2:(Ne.dstate=e,s=Xe,r=1<<s,a=r-1,m=pt+7,g=1<<m,y=g-1,b=Math.floor((m+Er-1)/Er),l=new Uint8Array(r*2),f=[],h=[],q=1<<pt+6,e.pending_buf=new Uint8Array(q*4),i=q*4,e.dist_buf=new Uint16Array(q),e.lc_buf=new Uint8Array(q),_=ot,w=Ht,ps(Ne))},e.deflateEnd=function(){return n!=Wq&&n!=Vk&&n!=lP?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,f=null,l=null,e.dstate=null,n==Vk?-3:0)},e.deflateParams=function(Ne,ot,Xe){let Ze=0;return ot==-1&&(ot=6),ot<0||ot>9||Xe<0||Xe>2?-2:(Zd[_].func!=Zd[ot].func&&Ne.total_in!==0&&(Ze=Ne.deflate(1)),_!=ot&&(_=ot,B=Zd[_].max_lazy,D=Zd[_].good_length,I=Zd[_].nice_length,L=Zd[_].max_chain),w=Xe,Ze)},e.deflateSetDictionary=function(Ne,ot,Xe){let Ze=Xe,pt,Ht=0;if(!ot||n!=Wq)return-2;if(Ze<Er)return 0;for(Ze>r-bu&&(Ze=r-bu,Ht=Xe-Ze),l.set(ot.subarray(Ht,Ht+Ze),0),v=Ze,x=Ze,p=l[0]&255,p=(p<<b^l[1]&255)&y,pt=0;pt<=Ze-Er;pt++)p=(p<<b^l[pt+(Er-1)]&255)&y,f[pt&a]=h[p],h[p]=pt;return 0},e.deflate=function(Ne,ot){let Xe,Ze,pt,Ht,bn;if(ot>4||ot<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==lP&&ot!=4)return Ne.msg=Bk[4],-2;if(Ne.avail_out===0)return Ne.msg=Bk[7],-5;if(t=Ne,Ht=o,o=ot,n==Wq&&(Ze=qq+(s-8<<4)<<8,pt=(_-1&255)>>1,pt>3&&(pt=3),Ze|=pt<<6,v!==0&&(Ze|=Btt),Ze+=31-Ze%31,n=Vk,Ve(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=Ht&&ot!=4)return t.msg=Bk[7],-5;if(n==lP&&t.avail_in!==0)return Ne.msg=Bk[7],-5;if(t.avail_in!==0||M!==0||ot!=0&&n!=lP){switch(bn=-1,Zd[_].func){case whe:bn=to(ot);break;case zk:bn=Ks(ot);break;case sx:bn=vr(ot);break;default:}if((bn==cP||bn==Uk)&&(n=lP),bn==zf||bn==cP)return t.avail_out===0&&(o=-1),0;if(bn==kk){if(ot==1)ln();else if(_e(0,0,!1),ot==3)for(Xe=0;Xe<g;Xe++)h[Xe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function vhe(){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}vhe.prototype={deflateInit(e,t){let n=this;return n.dstate=new Vtt,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 Dhe(e){let t=this,n=new vhe,i=ztt(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,l){let u,f,h=0,p=0,g=0,m=[];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,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=h&&(l(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(y){f.set(y,p),p+=y.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,l,u=0,f=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)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(f),h.forEach(function(p){l.set(p,u),u+=p.length}),l}}function ztt(e){return e+5*(Math.floor(e/16383)+1)}var xu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Xhe=1440,Htt=0,Gtt=4,jtt=9,Wtt=5,qtt=[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],Ytt=[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],Xtt=[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],Ktt=[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],$tt=[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],Ztt=[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],vy=15;function Zq(){let e=this,t,n,i,o,r,s;function a(u,f,h,p,g,m,y,b,x,A,E){let S,v,P,M,R,L,B,_,w,D,I,N,k,H,V;D=0,R=h;do i[u[f+D]]++,D++,R--;while(R!==0);if(i[0]==h)return y[0]=-1,b[0]=0,0;for(_=b[0],L=1;L<=vy&&i[L]===0;L++);for(B=L,_<L&&(_=L),R=vy;R!==0&&i[R]===0;R--);for(P=R,_>R&&(_=R),b[0]=_,H=1<<L;L<R;L++,H<<=1)if((H-=i[L])<0)return-3;if((H-=i[R])<0)return-3;for(i[R]+=H,s[1]=L=0,D=1,k=2;--R!==0;)s[k]=L+=i[D],k++,D++;R=0,D=0;do(L=u[f+D])!==0&&(E[s[L]++]=R),D++;while(++R<h);for(h=s[P],s[0]=R=0,D=0,M=-1,N=-_,r[0]=0,I=0,V=0;B<=P;B++)for(S=i[B];S--!==0;){for(;B>N+_;){if(M++,N+=_,V=P-N,V=V>_?_:V,(v=1<<(L=B-N))>S+1&&(v-=S+1,k=B,L<V))for(;++L<V&&!((v<<=1)<=i[++k]);)v-=i[k];if(V=1<<L,A[0]+V>Xhe)return-3;r[M]=I=A[0],A[0]+=V,M!==0?(s[M]=R,o[0]=L,o[1]=_,L=R>>>N-_,o[2]=I-r[M-1]-L,x.set(o,(r[M-1]+L)*3)):y[0]=I}for(o[1]=B-N,D>=h?o[0]=192:E[D]<p?(o[0]=E[D]<256?0:96,o[2]=E[D++]):(o[0]=m[E[D]-p]+16+64,o[2]=g[E[D++]-p]),v=1<<B-N,L=R>>>N;L<V;L+=v)x.set(o,(I+L)*3);for(L=1<<B-1;R&L;L>>>=1)R^=L;for(R^=L,w=(1<<N)-1;(R&w)!=s[M];)M--,N-=_,w=(1<<N)-1}return H!==0&&P!=1?-5:0}function l(u){let f;for(t||(t=[],n=[],i=new Int32Array(vy+1),o=[],r=new Int32Array(vy),s=new Int32Array(vy+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<vy+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,vy),0),s.set(i.subarray(0,vy+1),0)}e.inflate_trees_bits=function(u,f,h,p,g){let m;return l(19),t[0]=0,m=a(u,0,19,19,null,null,h,f,p,t,n),m==-3?g.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,h,p,g,m,y,b,x){let A;return l(288),t[0]=0,A=a(h,0,u,257,Xtt,Ktt,m,p,b,t,n),A!=0||p[0]===0?(A==-3?x.msg="oversubscribed literal/length tree":A!=-4&&(x.msg="incomplete literal/length tree",A=-3),A):(l(288),A=a(h,u,f,0,$tt,Ztt,y,g,b,t,n),A!=0||g[0]===0&&u>257?(A==-3?x.msg="oversubscribed distance tree":A==-5?(x.msg="incomplete distance tree",A=-3):A!=-4&&(x.msg="empty distance tree with lengths",A=-3),A):0)}}Zq.inflate_trees_fixed=function(e,t,n,i){return e[0]=jtt,t[0]=Wtt,n[0]=qtt,i[0]=Ytt,0};var Wk=0,Phe=1,Ihe=2,Ohe=3,Rhe=4,Mhe=5,Lhe=6,Xq=7,Nhe=8,qk=9;function Qtt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,l=0,u=0,f=0,h,p=0,g,m=0;function y(b,x,A,E,S,v,P,M){let R,L,B,_,w,D,I,N,k,H,V,j,U,q,X,te;I=M.next_in_index,N=M.avail_in,w=P.bitb,D=P.bitk,k=P.write,H=k<P.read?P.read-k-1:P.end-k,V=xu[b],j=xu[x];do{for(;D<20;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;if(R=w&V,L=A,B=E,te=(B+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],H--;continue}do{if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15,U=L[te+2]+(w&xu[_]),w>>=_,D-=_;D<15;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;R=w&j,L=S,B=v,te=(B+R)*3,_=L[te];do if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15;D<_;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;if(q=L[te+2]+(w&xu[_]),w>>=_,D-=_,H-=U,k>=q)X=k-q,k-X>0&&2>k-X?(P.win[k++]=P.win[X++],P.win[k++]=P.win[X++],U-=2):(P.win.set(P.win.subarray(X,X+2),k),k+=2,X+=2,U-=2);else{X=k-q;do X+=P.end;while(X<0);if(_=P.end-X,U>_){if(U-=_,k-X>0&&_>k-X)do P.win[k++]=P.win[X++];while(--_!==0);else P.win.set(P.win.subarray(X,X+_),k),k+=_,X+=_,_=0;X=0}}if(k-X>0&&U>k-X)do P.win[k++]=P.win[X++];while(--U!==0);else P.win.set(P.win.subarray(X,X+U),k),k+=U,X+=U,U=0;break}else if(!(_&64))R+=L[te+2],R+=w&xu[_],te=(B+R)*3,_=L[te];else return M.msg="invalid distance code",U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3;while(!0);break}if(_&64)return _&32?(U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,1):(M.msg="invalid literal/length code",U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3);if(R+=L[te+2],R+=w&xu[_],te=(B+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],H--;break}}while(!0)}while(H>=258&&N>=10);return U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,0}e.init=function(b,x,A,E,S,v){t=Wk,u=b,f=x,h=A,p=E,g=S,m=v,i=null},e.proc=function(b,x,A){let E,S,v,P=0,M=0,R=0,L,B,_,w;for(R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,B=b.write,_=B<b.read?b.read-B-1:b.end-B;;)switch(t){case Wk:if(_>=258&&L>=10&&(b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,A=y(u,f,h,p,g,m,b,x),R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,B=b.write,_=B<b.read?b.read-B-1:b.end-B,A!=0)){t=A==1?Xq:qk;break}r=u,i=h,o=p,t=Phe;case Phe:for(E=r;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}if(S=(o+(P&xu[E]))*3,P>>>=i[S+1],M-=i[S+1],v=i[S],v===0){s=i[S+2],t=Lhe;break}if(v&16){a=v&15,n=i[S+2],t=Ihe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=Xq;break}return t=qk,x.msg="invalid literal/length code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);case Ihe:for(E=a;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}n+=P&xu[E],P>>=E,M-=E,r=f,i=g,o=m,t=Ohe;case Ohe:for(E=r;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}if(S=(o+(P&xu[E]))*3,P>>=i[S+1],M-=i[S+1],v=i[S],v&16){a=v&15,l=i[S+2],t=Rhe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=qk,x.msg="invalid distance code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);case Rhe:for(E=a;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}l+=P&xu[E],P>>=E,M-=E,t=Mhe;case Mhe:for(w=B-l;w<0;)w+=b.end;for(;n!==0;){if(_===0&&(B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0&&(b.write=B,A=b.inflate_flush(x,A),B=b.write,_=B<b.read?b.read-B-1:b.end-B,B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0)))return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);b.win[B++]=b.win[w++],_--,w==b.end&&(w=0),n--}t=Wk;break;case Lhe:if(_===0&&(B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0&&(b.write=B,A=b.inflate_flush(x,A),B=b.write,_=B<b.read?b.read-B-1:b.end-B,B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0)))return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);A=0,b.win[B++]=s,_--,t=Wk;break;case Xq:if(M>7&&(M-=8,L++,R--),b.write=B,A=b.inflate_flush(x,A),B=b.write,_=B<b.read?b.read-B-1:b.end-B,b.read!=b.write)return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);t=Nhe;case Nhe:return A=1,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);case qk:return A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);default:return A=-2,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A)}},e.free=function(){}}var Fhe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],dE=0,Kq=1,Bhe=2,khe=3,Uhe=4,Vhe=5,Yk=6,Xk=7,zhe=8,ax=9;function Jtt(e,t){let n=this,i=dE,o=0,r=0,s=0,a,l=[0],u=[0],f=new Qtt,h=0,p=new Int32Array(Xhe*3),g=0,m=new Zq;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(y,b){b&&(b[0]=g),i==Yk&&f.free(y),i=dE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(y,b){let x,A,E;return A=y.next_out_index,E=n.read,x=(E<=n.write?n.write:n.end)-E,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(E,E+x),A),A+=x,E+=x,E==n.end&&(E=0,n.write==n.end&&(n.write=0),x=n.write-E,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(E,E+x),A),A+=x,E+=x),y.next_out_index=A,n.read=E,b},n.proc=function(y,b){let x,A,E,S,v,P,M,R;for(S=y.next_in_index,v=y.avail_in,A=n.bitb,E=n.bitk,P=n.write,M=P<n.read?n.read-P-1:n.end-P;;){let L,B,_,w,D,I,N,k;switch(i){case dE:for(;E<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}switch(x=A&7,h=x&1,x>>>1){case 0:A>>>=3,E-=3,x=E&7,A>>>=x,E-=x,i=Kq;break;case 1:L=[],B=[],_=[[]],w=[[]],Zq.inflate_trees_fixed(L,B,_,w),f.init(L[0],B[0],_[0],0,w[0],0),A>>>=3,E-=3,i=Yk;break;case 2:A>>>=3,E-=3,i=khe;break;case 3:return A>>>=3,E-=3,i=ax,y.msg="invalid block type",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}break;case Kq:for(;E<32;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if((~A>>>16&65535)!=(A&65535))return i=ax,y.msg="invalid stored block lengths",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);o=A&65535,A=E=0,i=o!==0?Bhe:h!==0?Xk:dE;break;case Bhe:if(v===0||M===0&&(P==n.end&&n.read!==0&&(P=0,M=P<n.read?n.read-P-1:n.end-P),M===0&&(n.write=P,b=n.inflate_flush(y,b),P=n.write,M=P<n.read?n.read-P-1:n.end-P,P==n.end&&n.read!==0&&(P=0,M=P<n.read?n.read-P-1:n.end-P),M===0)))return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(b=0,x=o,x>v&&(x=v),x>M&&(x=M),n.win.set(y.read_buf(S,x),P),S+=x,v-=x,P+=x,M-=x,(o-=x)!==0)break;i=h!==0?Xk:dE;break;case khe:for(;E<14;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if(r=x=A&16383,(x&31)>29||(x>>5&31)>29)return i=ax,y.msg="too many length or distance symbols",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(x=258+(x&31)+(x>>5&31),!a||a.length<x)a=[];else for(R=0;R<x;R++)a[R]=0;A>>>=14,E-=14,s=0,i=Uhe;case Uhe:for(;s<4+(r>>>10);){for(;E<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}a[Fhe[s++]]=A&7,A>>>=3,E-=3}for(;s<19;)a[Fhe[s++]]=0;if(l[0]=7,x=m.inflate_trees_bits(a,l,u,p,y),x!=0)return b=x,b==-3&&(a=null,i=ax),n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);s=0,i=Vhe;case Vhe:for(;x=r,!(s>=258+(x&31)+(x>>5&31));){let H,V;for(x=l[0];E<x;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if(x=p[(u[0]+(A&xu[x]))*3+1],V=p[(u[0]+(A&xu[x]))*3+2],V<16)A>>>=x,E-=x,a[s++]=V;else{for(R=V==18?7:V-14,H=V==18?11:3;E<x+R;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if(A>>>=x,E-=x,H+=A&xu[R],A>>>=R,E-=R,R=s,x=r,R+H>258+(x&31)+(x>>5&31)||V==16&&R<1)return a=null,i=ax,y.msg="invalid bit length repeat",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--H!==0);s=R}}if(u[0]=-1,D=[],I=[],N=[],k=[],D[0]=9,I[0]=6,x=r,x=m.inflate_trees_dynamic(257+(x&31),1+(x>>5&31),a,D,I,N,k,p,y),x!=0)return x==-3&&(a=null,i=ax),b=x,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);f.init(D[0],I[0],p,N[0],p,k[0]),i=Yk;case Yk:if(n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,(b=f.proc(n,y,b))!=1)return n.inflate_flush(y,b);if(b=0,f.free(y),S=y.next_in_index,v=y.avail_in,A=n.bitb,E=n.bitk,P=n.write,M=P<n.read?n.read-P-1:n.end-P,h===0){i=dE;break}i=Xk;case Xk:if(n.write=P,b=n.inflate_flush(y,b),P=n.write,M=P<n.read?n.read-P-1:n.end-P,n.read!=n.write)return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);i=zhe;case zhe:return b=1,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);case ax:return b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);default:return b=-2,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}}},n.free=function(y){n.reset(y,null),n.win=null,p=null},n.set_dictionary=function(y,b,x){n.win.set(y.subarray(b,b+x),0),n.read=n.write=x},n.sync_point=function(){return i==Kq?1:0}}var ent=32,tnt=8,nnt=0,Hhe=1,Ghe=2,jhe=3,Whe=4,qhe=5,$q=6,uP=7,Yhe=12,Dy=13,int=[0,0,255,255];function ont(){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=uP,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 Jtt(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==Gtt?-5:0,o=-5;;)switch(s.mode){case nnt: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)!=tnt){s.mode=Dy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Dy,n.msg="invalid win size",s.marker=5;break}s.mode=Hhe;case Hhe: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=Dy,n.msg="incorrect header check",s.marker=5;break}if(!(r&ent)){s.mode=uP;break}s.mode=Ghe;case Ghe: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=jhe;case jhe: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=Whe;case Whe: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=qhe;case qhe: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=$q,2);case $q:return s.mode=Dy,n.msg="need dictionary",s.marker=0,-2;case uP:if(o=s.blocks.proc(n,o),o==-3){s.mode=Dy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Yhe;case Yhe:return n.avail_in=0,1;case Dy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=$q)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=uP,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let l=n.istate;if(l.mode!=Dy&&(l.mode=Dy,l.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=l.marker;i!==0&&r<4;)n.read_byte(o)==int[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,l.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,l.mode=uP,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Khe(){}Khe.prototype={inflateInit(e){let t=this;return t.istate=new ont,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 $he(e){let t=this,n=new Khe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Htt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,l){let u=[],f,h,p=0,g=0,m=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),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=p&&(l(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(h=new Uint8Array(m),u.forEach(function(y){h.set(y,g),g+=y.length})):h=u[0]?new Uint8Array(u[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var hE="/",Qq=new Date(2107,11,31),Jq=new Date(1980,0,1),Si=void 0,Tu="undefined",d_="function";var fP=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 rnt=64,Zhe=2;try{typeof navigator!=Tu&&navigator.hardwareConcurrency&&(Zhe=navigator.hardwareConcurrency)}catch{}var snt={chunkSize:512*1024,maxWorkers:Zhe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Si,CompressionStreamNative:typeof CompressionStream!=Tu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Tu&&DecompressionStream},Iy=Object.assign({},snt);function dP(){return Iy}function Kk(e){return Math.max(e.chunkSize,rnt)}function mE(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:u,DecompressionStream:f,workerScripts:h}=e;if(Py("baseURL",t),Py("chunkSize",n),Py("maxWorkers",i),Py("terminateWorkerTimeout",o),Py("useCompressionStream",r),Py("useWebWorkers",s),a&&(Iy.CompressionStream=new fP(a)),l&&(Iy.DecompressionStream=new fP(l)),Py("CompressionStream",u),Py("DecompressionStream",f),h!==Si){let{deflate:p,inflate:g}=h;if((p||g)&&(Iy.workerScripts||(Iy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Iy.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");Iy.workerScripts.inflate=g}}}function Py(e,t){t!==Si&&(Iy[e]=t)}var Qhe=[];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;Qhe[e]=t}var h_=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^Qhe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var hP=class extends TransformStream{constructor(){let t,n=new h_;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}};function pE(e){if(typeof TextEncoder==Tu){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 Xc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Xc.getPartial(n);return i===32?e.concat(t):Xc._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+Xc.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]=Xc.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=Xc.getPartial(o);return i.push(Xc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},mP={bytes:{fromBits(e){let n=Xc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(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(Xc.partial(8*(n&3),i)),t}}},Jhe={};Jhe.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=mP.utf8String.toBits(e));let n=t._buffer=Xc.concat(t._buffer,e),i=t._length,o=t._length=i+Xc.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=Xc.concat(t,[Xc.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 u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],l=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+l+i[u]+t._key[Math.floor(u/20)]|0;l=a,a=s,s=t._S(30,r),r=o,o=f}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]+l|0}};var e7={};e7.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,l=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 u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^l<<24,l=l<<1^(l>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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,l,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[l=o[a=o[f]]];let p=u*16843009^l*65537^a*257^f*16843008,g=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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],l=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,b,x,A;for(let E=0;E<i;E++)b=s[h>>>24]^a[p>>16&255]^l[g>>8&255]^u[m&255]^n[y],x=s[p>>>24]^a[g>>16&255]^l[m>>8&255]^u[h&255]^n[y+1],A=s[g>>>24]^a[m>>16&255]^l[h>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[h>>16&255]^l[p>>8&255]^u[g&255]^n[y+3],y+=4,h=b,p=x,g=A;for(let E=0;E<4;E++)o[t?3&-E:E]=f[h>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],b=h,h=p,p=g,g=m,m=b;return o}};var eme={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}},t7={};t7.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=Xc.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 Xc.clamp(t,o)}};var Oy={importKey(e){return new Oy.hmacSha1(mP.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,l,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,g=Xc;for(t=mP.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),l=0;l<s.length;l++)r[l]^=s[l];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};Oy.hmacSha1=class{constructor(e){let t=this,n=t._hash=Jhe.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 ant=typeof crypto!=Tu&&typeof crypto.getRandomValues==d_,Ry="Invalid password",cx="Invalid signature",m_="zipjs-abort-check-password";function $k(e){return ant?crypto.getRandomValues(e):eme.getRandomValues(e)}var _E=16,cnt="raw",ime={name:"PBKDF2"},lnt={name:"HMAC"},unt="SHA-1",fnt=Object.assign({hash:lnt},ime),n7=Object.assign({iterations:1e3,hash:{name:unt}},ime),dnt=["deriveBits"],_P=[8,12,16],pP=[16,24,32],My=10,hnt=[0,0,0,0],Jk=typeof crypto!=Tu,bP=Jk&&crypto.subtle,ome=Jk&&typeof bP!=Tu,Em=mP.bytes,mnt=e7.aes,pnt=t7.ctrGladman,_nt=Oy.hmacSha1,tme=Jk&&ome&&typeof bP.importKey==d_,nme=Jk&&ome&&typeof bP.deriveBits==d_,Zk=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:ame(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let l=this,{password:u,strength:f,resolveReady:h,ready:p}=l;u?(await gnt(l,f,u,Hf(s,0,_P[f]+2)),s=Hf(s,_P[f]+2),r?a.error(new Error(m_)):h()):await p;let g=new Uint8Array(s.length-My-(s.length-My)%_E);a.enqueue(rme(l,s,g,0,My,!0))},async flush(s){let{signed:a,ctr:l,hmac:u,pending:f,ready:h}=this;if(u&&l){await h;let p=Hf(f,0,f.length-My),g=Hf(f,f.length-My),m=new Uint8Array;if(p.length){let y=yP(Em,p);u.update(y);let b=l.update(y);m=gP(Em,b)}if(a){let y=Hf(gP(Em,u.digest()),0,My);for(let b=0;b<My;b++)if(y[b]!=g[b])throw new Error(cx)}s.enqueue(m)}}})}},Qk=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:ame(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:l,strength:u,resolveReady:f,ready:h}=a,p=new Uint8Array;l?(p=await ynt(a,u,l),f()):await h;let g=new Uint8Array(p.length+r.length-r.length%_E);g.set(p,0),s.enqueue(rme(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:l,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(l.length){let h=s.update(yP(Em,l));a.update(h),f=gP(Em,h)}o.signature=gP(Em,a.digest()).slice(0,My),r.enqueue(i7(f,o.signature))}}}),o=this}};function rme(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:l}=e,u=t.length-o;l.length&&(t=i7(l,t),n=Tnt(n,u-u%_E));let f;for(f=0;f<=u-_E;f+=_E){let h=yP(Em,Hf(t,f,f+_E));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(gP(Em,p),f+i)}return e.pending=Hf(t,f),n}async function gnt(e,t,n,i){let o=await sme(e,t,n,Hf(i,0,_P[t])),r=Hf(i,_P[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Ry)}async function ynt(e,t,n){let i=$k(new Uint8Array(_P[t])),o=await sme(e,t,n,i);return i7(i,o)}async function sme(e,t,n,i){e.password=null;let o=await bnt(cnt,n,fnt,!1,dnt),r=await xnt(Object.assign({salt:i},n7),o,8*(pP[t]*2+2)),s=new Uint8Array(r),a=yP(Em,Hf(s,0,pP[t])),l=yP(Em,Hf(s,pP[t],pP[t]*2)),u=Hf(s,pP[t]*2);return Object.assign(e,{keys:{key:a,authentication:l,passwordVerification:u},ctr:new pnt(new mnt(a),Array.from(hnt)),hmac:new _nt(l)}),u}async function bnt(e,t,n,i,o){if(tme)try{return await bP.importKey(e,t,n,i,o)}catch{return tme=!1,Oy.importKey(t)}else return Oy.importKey(t)}async function xnt(e,t,n){if(nme)try{return await bP.deriveBits(e,t,n)}catch{return nme=!1,Oy.pbkdf2(t,e.salt,n7.iterations,n)}else return Oy.pbkdf2(t,e.salt,n7.iterations,n)}function ame(e,t){return t===Si?pE(e):t}function i7(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 Tnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Hf(e,t,n){return e.subarray(t,n)}function gP(e,t){return e.fromBits(t)}function yP(e,t){return e.toBits(t)}var gE=12,eU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),fme(this,t)},transform(o,r){let s=this;if(s.password){let a=cme(s,o.subarray(0,gE));if(s.password=null,a[gE-1]!=s.passwordVerification)throw new Error(Ry);o=o.subarray(gE)}i?r.error(new Error(m_)):r.enqueue(cme(s,o))}})}},tU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),fme(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let l=$k(new Uint8Array(gE));l[gE-1]=r.passwordVerification,s=new Uint8Array(i.length+l.length),s.set(lme(r,l),0),a=gE}else s=new Uint8Array(i.length),a=0;s.set(lme(r,i),a),o.enqueue(s)}})}};function cme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=dme(e)^t[i],o7(e,n[i]);return n}function lme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=dme(e)^t[i],o7(e,t[i]);return n}function fme(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new h_(n[0]),crcKey2:new h_(n[2])});for(let i=0;i<t.length;i++)o7(e,t.charCodeAt(i))}function o7(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=ume(Math.imul(ume(i+hme(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function dme(e){let t=e.keys[2]|2;return hme(Math.imul(t,t^1)>>>8)}function hme(e){return e&255}function ume(e){return e&4294967295}var mme="deflate-raw",nU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:u,level:f}=t,h=this,p,g,m=pme(super.readable);(!s||l)&&u&&(p=new hP,m=Sm(m,p)),r&&(m=gme(m,a,{level:f,chunkSize:n},o,i)),s&&(l?m=Sm(m,new tU(t)):(g=new Qk(t),m=Sm(m,g))),_me(h,m,()=>{let y;s&&!l&&(y=g.signature),(!s||l)&&u&&(y=new DataView(p.value.buffer).getUint32(0)),h.signature=y})}},iU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:u,useCompressionStream:f}=t,h,p,g=pme(super.readable);s&&(r?g=Sm(g,new eU(t)):(p=new Zk(t),g=Sm(g,p))),u&&(g=gme(g,f,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new hP,g=Sm(g,h)),_me(this,g,()=>{if((!s||r)&&a){let m=new DataView(h.value.buffer);if(l!=m.getUint32(0,!1))throw new Error(cx)}})}};function pme(e){return Sm(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function _me(e,t,n){t=Sm(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function gme(e,t,n,i,o){try{let r=t&&i?i:o;e=Sm(e,new r(mme,n))}catch{if(t)try{e=Sm(e,new o(mme,n))}catch{return e}else return e}return e}function Sm(e,t){return e.pipeThrough(t)}var yme="message",bme="start",xme="pull",r7="data",Tme="ack",s7="close",sU="deflate",aU="inflate";var oU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(sU)?r=nU:o.startsWith(aU)&&(r=iU);let s=0,a=0,l=new r(t,n),u=super.readable,f=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}=l;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(l).pipeThrough(h)}})}},rU=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 Eme=typeof Worker!=Tu;var yE=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new rU(r.chunkSize)).pipeThrough(new c7(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:l,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?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,f(t)}}),(a&&Eme?Ant:Sme)(t,r)}},c7=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await a7(n,o)},async transform(a,l){s+=a.length,i&&await a7(i,s,o),l.enqueue(a)},async flush(){t.size=s,r&&await a7(r,s)}})}};async function a7(e,...t){try{await e(...t)}catch{}}function Sme(e,t){return{run:()=>Cnt(e,t)}}function Ant(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=wnt(e.scripts[0],n,e)}catch{return Eme=!1,Sme(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Ent(e,{chunkSize:i})}})}return e.interface}async function Cnt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new oU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{i()}}async function Ent(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:l,closed:u}=Snt(e.writable),f=cU({type:bme,scripts:a.slice(1),options:s,config:t,readable:r,writable:l},e);f||Object.assign(e,{reader:r.getReader(),writer:l.getWriter()});let h=await o;return f||await l.getWriter().close(),await u,h}function Snt(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 Ame=!0,Cme=!0;function wnt(e,t,n){let i={type:"module"},o,r;typeof e==d_&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Ame)try{r=new Worker(o)}catch{Ame=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(yme,s=>vnt(s,n)),r}function cU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,l=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,l.push(e.value)),o&&Cme?(s&&l.push(s),a&&l.push(a)):e.readable=e.writable=null,l.length)try{return t.postMessage(e,l),!0}catch{Cme=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function vnt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:l,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(s){let{message:g,stack:m,code:y,name:b}=s,x=new Error(g);Object.assign(x,{stack:m,code:y,name:b}),p(x)}else{if(n==xme){let{value:g,done:m}=await a.read();cU({type:r7,value:g,done:m,messageId:o},t)}n==r7&&(await l.ready,await l.write(new Uint8Array(i)),cU({type:Tme,messageId:o},t)),n==s7&&p(null,r)}}catch(g){cU({type:s7,messageId:o},t),p(g)}function p(g,m){g?f(g):u(m),l&&l.releaseLock(),h()}}var lx=[],l7=[];var wme=0;async function lU(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:l,signed:u,encrypted:f}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Si;let g=!l&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Si&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Si&&i.useCompressionStream,(await m()).run();async function m(){let b=lx.find(x=>!x.busy);if(b)return vme(b),new yE(b,e,t,y);if(lx.length<p){let x={indexWorker:wme};return wme++,lx.push(x),new yE(x,e,t,y)}else return new Promise(x=>l7.push({resolve:x,stream:e,workerOptions:t}))}function y(b){if(l7.length){let[{resolve:x,stream:A,workerOptions:E}]=l7.splice(0,1);x(new yE(b,A,E,y))}else b.worker?(vme(b),Dnt(b,t)):lx=lx.filter(x=>x!=b)}}function Dnt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{lx=lx.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function vme(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Pnt="Writer iterator completed too soon",Int="text/plain";var Ont="Content-Type";var Rnt=64*1024,d7="writable",bE=class{constructor(){this.size=0}init(){this.initialized=!0}},uU=class extends bE{get readable(){let t=this,{chunkSize:n=Rnt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:l}=this;o.enqueue(await Ra(t,r+l,Math.min(n,s-l),a)),l+n>s?o.close():this.chunkOffset+=n}});return i}},u7=class extends bE{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,d7,{get(){return n}})}writeUint8Array(){}};var fU=class extends u7{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)}},p_=class extends uU{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)}},xP=class extends bE{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([Ont,t]),Object.defineProperty(n,d7,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},dU=class extends p_{constructor(t){super(new Blob([t],{type:Int}))}},hU=class extends xP{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 f7=class extends uU{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 l=t;for(;l>=r[a].size;)l-=r[a].size,a++;let u=r[a],f=u.size;if(l+n<=f)s=await Ra(u,l,n);else{let h=f-l;s=new Uint8Array(n),s.set(await Ra(u,l,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},mU=class extends bE{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(f){let{availableSize:h}=i;if(s)f.length>=h?(await l(f.slice(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(h))):await l(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Pnt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await vm(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,d7,{get(){return a}});async function l(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){r.size=o.size,await s.close()}}};async function vm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function pU(e){return Array.isArray(e)&&(e=new f7(e)),e instanceof ReadableStream&&(e={readable:e}),e}function _U(e){e.writable===Si&&typeof e.next==d_&&(e=new mU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Si&&(t.size=0),e instanceof mU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ra(e,t,n,i){return e.readUint8Array(t,n,i)}var Dme="\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(""),Mnt=Dme.length==256;function Pme(e){if(Mnt){let t="";for(let n=0;n<e.length;n++)t+=Dme[e[n]];return t}else return new TextDecoder().decode(e)}function TP(e,t){return t&&t.trim().toLowerCase()=="cp437"?Pme(e):new TextDecoder(t).decode(e)}var h7="filename",m7="rawFilename",p7="comment",_7="rawComment",g7="uncompressedSize",y7="compressedSize",b7="offset",gU="diskNumberStart",xE="lastModDate",yU="rawLastModDate",AP="lastAccessDate",Ime="rawLastAccessDate",CP="creationDate",Ome="rawCreationDate",x7="internalFileAttribute",T7="externalFileAttribute",A7="msDosCompatible",bU="zip64",C7="encrypted",E7="version",S7="versionMadeBy",w7="zipCrypto",Lnt=[h7,m7,y7,g7,xE,yU,p7,_7,AP,CP,b7,gU,gU,x7,T7,A7,bU,C7,E7,S7,w7,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Ly=class{constructor(t){Lnt.forEach(n=>this[n]=t[n])}};var v7="File format is not recognized",knt="End of central directory not found",Unt="End of Zip64 central directory locator not found",Vnt="Central directory header not found",znt="Local file header not found",Hnt="Zip64 extra field not found",Gnt="File contains encrypted entry",jnt="Encryption method not supported",Rme="Compression method not supported",Mme="Split zip file",Lme="utf-8",Nme="cp437",Wnt=[[g7,4294967295],[y7,4294967295],[b7,4294967295],[gU,65535]],qnt={[65535]:{getValue:ls,bytes:4},[4294967295]:{getValue:xU,bytes:8}},vU=class{constructor(t,n={}){Object.assign(this,{reader:pU(t),options:n,config:dP()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await vm(i),(i.size===Si||!i.readUint8Array)&&(i=new p_(await new Response(i.readable).blob()),await vm(i)),i.size<22)throw new Error(v7);i.chunkSize=Kk(o);let r=await Znt(i,101010256,i.size,22,65535*16);if(!r){let B=await Ra(i,0,4),_=ma(B);throw ls(_)==134695760?new Error(Mme):new Error(knt)}let s=ma(r),a=ls(s,12),l=ls(s,16),u=r.offset,f=ha(s,20),h=u+22+f,p=ha(s,4),g=i.lastDiskNumber||0,m=ha(s,6),y=ha(s,8),b=0,x=0;if(l==4294967295||a==4294967295||y==65535||m==65535){let B=await Ra(i,r.offset-20,20),_=ma(B);if(ls(_,0)==117853008){l=xU(_,8);let w=await Ra(i,l,56,-1),D=ma(w),I=r.offset-20-56;if(ls(D,0)!=101075792&&l!=I){let N=l;l=I,b=l-N,w=await Ra(i,l,56,-1),D=ma(w)}if(ls(D,0)!=101075792)throw new Error(Unt);p==65535&&(p=ls(D,16)),m==65535&&(m=ls(D,20)),y==65535&&(y=xU(D,32)),a==4294967295&&(a=xU(D,40)),l-=a}}if(l>=i.size&&(b=i.size-l-a-22,l=i.size-a-22),g!=p)throw new Error(Mme);if(l<0)throw new Error(v7);let A=0,E=await Ra(i,l,a,m),S=ma(E);if(a){let B=r.offset-a;if(ls(S,A)!=33639248&&l!=B){let _=l;l=B,b+=l-_,E=await Ra(i,l,a,m),S=ma(E)}}let v=r.offset-l-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,E=await Ra(i,l,a,m),S=ma(E)),l<0||l>=i.size)throw new Error(v7);let P=Kc(n,t,"filenameEncoding"),M=Kc(n,t,"commentEncoding");for(let B=0;B<y;B++){let _=new P7(i,o,n.options);if(ls(S,A)!=33639248)throw new Error(Vnt);Bme(_,S,A+6);let w=!!_.bitFlag.languageEncodingFlag,D=A+46,I=D+_.filenameLength,N=I+_.extraFieldLength,k=ha(S,A+4),H=(k&0)==0,V=E.subarray(D,I),j=ha(S,A+32),U=N+j,q=E.subarray(N,U),X=w,te=w,K=H&&(TE(S,A+38)&16)==16,Z=ls(S,A+42)+b;Object.assign(_,{versionMadeBy:k,msDosCompatible:H,compressedSize:0,uncompressedSize:0,commentLength:j,directory:K,offset:Z,diskNumberStart:ha(S,A+34),internalFileAttribute:ha(S,A+36),externalFileAttribute:ls(S,A+38),rawFilename:V,filenameUTF8:X,commentUTF8:te,rawExtraField:E.subarray(I,N)});let ee=Kc(n,t,"decodeText")||TP,me=X?Lme:P||Nme,xe=te?Lme:M||Nme,ue=ee(V,me);ue===Si&&(ue=TP(V,me));let ye=ee(q,xe);ye===Si&&(ye=TP(q,xe)),Object.assign(_,{rawComment:q,filename:ue,comment:ye,directory:K||ue.endsWith(hE)}),x=Math.max(Z,x),kme(_,_,S,A+6),_.zipCrypto=_.encrypted&&!_.extraFieldAES;let Ae=new Ly(_);Ae.getData=(Ee,Ve)=>_.getData(Ee,Ae,Ve),A=U;let{onprogress:Pe}=t;if(Pe)try{await Pe(B+1,y,new Ly(_))}catch{}yield Ae}let R=Kc(n,t,"extractPrependedData"),L=Kc(n,t,"extractAppendedData");return R&&(n.prependedData=x>0?await Ra(i,0,x):new Uint8Array),n.comment=f?await Ra(i,u+22,f):new Uint8Array,L&&(n.appendedData=h<i.size?await Ra(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 P7=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:l,compressionMethod:u,config:f,bitFlag:h,signature:p,rawLastModDate:g,uncompressedSize:m,compressedSize:y}=o,b=n.localDirectory={},x=await Ra(r,s,30,a),A=ma(x),E=Kc(o,i,"password"),S=Kc(o,i,"rawPassword"),v=Kc(o,i,"passThrough");if(E=E&&E.length&&E,S=S&&S.length&&S,l&&l.originalCompressionMethod!=99)throw new Error(Rme);if(u!=0&&u!=8&&!v)throw new Error(Rme);if(ls(A,0)!=67324752)throw new Error(znt);Bme(b,A,4),b.rawExtraField=b.extraFieldLength?await Ra(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,kme(o,b,A,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let P=o.encrypted&&b.encrypted&&!v,M=P&&!l;if(v||(n.zipCrypto=M),P){if(!M&&l.strength===Si)throw new Error(jnt);if(!E&&!S)throw new Error(Gnt)}let R=s+30+b.filenameLength+b.extraFieldLength,L=y,B=r.readable;Object.assign(B,{diskNumberStart:a,offset:R,size:L});let _=Kc(o,i,"signal"),w=Kc(o,i,"checkPasswordOnly");w&&(t=new WritableStream),t=_U(t),await vm(t,v?y:m);let{writable:D}=t,{onstart:I,onprogress:N,onend:k}=i,H={options:{codecType:aU,password:E,rawPassword:S,zipCrypto:M,encryptionStrength:l&&l.strength,signed:Kc(o,i,"checkSignature")&&!v,passwordVerification:M&&(h.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:Kc(o,i,"useWebWorkers"),useCompressionStream:Kc(o,i,"useCompressionStream"),transferStreams:Kc(o,i,"transferStreams"),checkPasswordOnly:w},config:f,streamOptions:{signal:_,size:L,onstart:I,onprogress:N,onend:k}},V=0;try{({outputSize:V}=await lU({readable:B,writable:D},H))}catch(j){if(!w||j.message!=m_)throw j}finally{let j=Kc(o,i,"preventClose");D.size+=V,!j&&!D.locked&&await D.getWriter().close()}return w?Si:t.getData?t.getData():D}};function Bme(e,t,n){let i=e.rawBitFlag=ha(t,n+2),o=(i&1)==1,r=ls(t,n+6);Object.assign(e,{encrypted:o,version:ha(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Qnt(r),filenameLength:ha(t,n+22),extraFieldLength:ha(t,n+24)})}function kme(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=ma(new Uint8Array(r)),l=0;try{for(;l<r.length;){let x=ha(a,l),A=ha(a,l+2);s.set(x,{type:x,data:r.slice(l+4,l+4+A)}),l+=4+A}}catch{}let u=ha(n,i+4);Object.assign(t,{signature:ls(n,i+10),uncompressedSize:ls(n,i+18),compressedSize:ls(n,i+14)});let f=s.get(1);f&&(Ynt(f,t),t.extraFieldZip64=f);let h=s.get(28789);h&&(Fme(h,h7,m7,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(Fme(p,p7,_7,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(Xnt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=s.get(10);m&&(Knt(m,t),t.extraFieldNTFS=m);let y=s.get(21589);y&&($nt(y,t,o),t.extraFieldExtendedTimestamp=y);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Ynt(e,t){t.zip64=!0;let n=ma(e.data),i=Wnt.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 l=qnt[a];t[s]=e[s]=l.getValue(n,r),r+=l.bytes}else if(e[s])throw new Error(Hnt)}}function Fme(e,t,n,i,o){let r=ma(e.data),s=new h_;s.append(o[n]);let a=ma(new Uint8Array(4));a.setUint32(0,s.get(),!0);let l=ls(r,1);Object.assign(e,{version:TE(r,0),[t]:TP(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==ls(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Xnt(e,t,n){let i=ma(e.data),o=TE(i,4);Object.assign(e,{vendorVersion:TE(i,0),vendorId:TE(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ha(i,5)}),t.compressionMethod=e.compressionMethod}function Knt(e,t){let n=ma(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ha(n,i),s=ha(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=ma(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});let u=D7(s),f=D7(a),h=D7(l),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function $nt(e,t,n){let i=ma(e.data),o=TE(i,0),r=[],s=[];n?((o&1)==1&&(r.push(xE),s.push(yU)),(o&2)==2&&(r.push(AP),s.push(Ime)),(o&4)==4&&(r.push(CP),s.push(Ome))):e.data.length>=5&&(r.push(xE),s.push(yU));let a=1;r.forEach((l,u)=>{if(e.data.length>=a+4){let f=ls(i,a);t[l]=e[l]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function Znt(e,t,n,i,o){let r=new Uint8Array(4),s=ma(r);Jnt(s,0,t);let a=i+o;return await l(i)||await l(Math.min(a,n));async function l(u){let f=n-u,h=await Ra(e,f,u);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:f+p,buffer:h.slice(p,p+i).buffer}}}function Kc(e,t,n){return t[n]===Si?e.options[n]:t[n]}function Qnt(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 D7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function TE(e,t){return e.getUint8(t)}function ha(e,t){return e.getUint16(t,!0)}function ls(e,t){return e.getUint32(t,!0)}function xU(e,t){return Number(e.getBigUint64(t,!0))}function Jnt(e,t,n){e.setUint32(t,n,!0)}function ma(e){return new DataView(e.buffer)}var iit="File already exists",oit="Zip file comment exceeds 64KB",rit="File entry comment exceeds 64KB",sit="File entry name exceeds 64KB",zme="Version exceeds 65535",ait="The strength must equal 1, 2, or 3",cit="Extra field type exceeds 65535",lit="Extra field data exceeds 64KB",G7="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",uit="Undefined uncompressed size",Hme=new Uint8Array([7,0,2,0,65,69,3,0,0]),z7=0,Gme=[],IU=class{constructor(t,n={}){t=_U(t);let i=t.availableSize!==Si&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Si&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:dP(),files:new Map,filenames:new Set,offset:n.offset===Si?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;z7<s.maxWorkers?z7++:await new Promise(l=>Gme.push(l));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(iit);return o.filenames.add(t),a=fit(o,t,n,i),r.add(a),await a}catch(l){throw o.filenames.delete(t),l}finally{r.delete(a);let l=Gme.shift();l?l():z7--}}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 xit(this,t,n),co(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function fit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(hE)?t+=hE:i.directory=t.endsWith(hE);let o=co(e,i,"encodeText",pE),r=o(t);if(r===Si&&(r=pE(t)),Wi(r)>65535)throw new Error(sit);let s=i.comment||"",a=o(s);if(a===Si&&(a=pE(s)),Wi(a)>65535)throw new Error(rit);let l=co(e,i,E7,20);if(l>65535)throw new Error(zme);let u=co(e,i,S7,20);if(u>65535)throw new Error(zme);let f=co(e,i,xE,new Date),h=co(e,i,AP),p=co(e,i,CP),g=co(e,i,A7,!0),m=co(e,i,x7,0),y=co(e,i,T7,0),b=co(e,i,"passThrough"),x,A;b||(x=co(e,i,"password"),A=co(e,i,"rawPassword"));let E=co(e,i,"encryptionStrength",3),S=co(e,i,w7),v=co(e,i,"extendedTimestamp",!0),P=co(e,i,"keepOrder",!0),M=co(e,i,"level"),R=co(e,i,"useWebWorkers"),L=co(e,i,"bufferedWrite"),B=co(e,i,"dataDescriptorSignature",!1),_=co(e,i,"signal"),w=co(e,i,"useUnicodeFileNames",!0),D=co(e,i,"useCompressionStream"),I=co(e,i,"compressionMethod"),N=co(e,i,"dataDescriptor",!0),k=co(e,i,bU);if(!S&&(x!==Si||A!==Si)&&!(E>=1&&E<=3))throw new Error(ait);let H=new Uint8Array,{extraField:V}=i;if(V){let Dt=0,Gt=0;V.forEach($e=>Dt+=4+Wi($e)),H=new Uint8Array(Dt),V.forEach(($e,ln)=>{if(ln>65535)throw new Error(cit);if(Wi($e)>65535)throw new Error(lit);Es(H,new Uint16Array([ln]),Gt),Es(H,new Uint16Array([Wi($e)]),Gt+2),Es(H,$e,Gt+4),Gt+=4+Wi($e)})}let j=0,U=0,q=0;if(b&&({uncompressedSize:q}=i,q===Si))throw new Error(uit);let X=k===!0;n&&(n=pU(n),await vm(n),b?j=jme(q):n.size===Si?(N=!0,(k||k===Si)&&(k=!0,q=j=4294967296)):(q=n.size,j=jme(q)));let{diskOffset:te,diskNumber:K,maxSize:Z}=e.writer,ee=X||q>4294967295,me=X||j>4294967295,xe=X||e.offset+e.pendingEntriesSize-te>4294967295,ye=co(e,i,"supportZip64SplitFile",!0)&&X||K+Math.ceil(e.pendingEntriesSize/Z)>65535;if(xe||ee||me||ye){if(k===!1||!P)throw new Error(G7);k=!0}k=k||!1;let Ae=co(e,i,C7),{signature:Pe}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:l,versionMadeBy:u,lastModDate:f,lastAccessDate:h,creationDate:p,rawExtraField:H,zip64:k,zip64UncompressedSize:ee,zip64CompressedSize:me,zip64Offset:xe,zip64DiskNumberStart:ye,password:x,rawPassword:A,level:!D&&e.config.CompressionStream===Si&&e.config.CompressionStreamNative===Si?0:M,useWebWorkers:R,encryptionStrength:E,extendedTimestamp:v,zipCrypto:S,bufferedWrite:L,keepOrder:P,useUnicodeFileNames:w,dataDescriptor:N,dataDescriptorSignature:B,signal:_,msDosCompatible:g,internalFileAttribute:m,externalFileAttribute:y,useCompressionStream:D,passThrough:b,encrypted:!!(x&&Wi(x)||A&&Wi(A))||b&&Ae,signature:Pe,compressionMethod:I});let Ee=mit(i),Ve=_it(i),je=Wi(Ee.localHeaderArray,Ve.dataDescriptorArray);U=je+j,e.options.usdz&&(U+=U+64),e.pendingEntriesSize+=U;let it;try{it=await dit(e,t,n,{headerInfo:Ee,dataDescriptorInfo:Ve,metadataSize:je},i)}finally{e.pendingEntriesSize-=U}return Object.assign(it,{name:t,comment:s,extraField:V}),new Ly(it)}async function dit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:l,signal:u}=o,{headerInfo:f}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},m,y,b,x,A,E,S;r.set(t,g);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!l)&&!h?(E=new TransformStream,S=new Response(E.readable).blob(),E.writable.size=0,m=!0,e.bufferedWrites++,await vm(s)):(E=s,await P()),await vm(E);let{writable:L}=s,{diskOffset:B}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let w=new Uint8Array(4),D=Ma(w);ji(D,0,134695760),await Dm(L,w),e.offset+=4}h&&pit(i,e.offset-B),m||(await R,await M(L));let{diskNumber:_}=s;if(A=!0,g.diskNumberStart=_,g=await hit(n,E,g,i,e.config,o),A=!1,r.set(t,g),g.filename=t,m){await E.writable.getWriter().close();let w=await S;await R,await P(),x=!0,l||(w=await yit(g,w,L,o)),await M(L),g.diskNumberStart=s.diskNumber,B=s.diskOffset,await w.stream().pipeTo(L,{preventClose:!0,preventAbort:!0,signal:u}),L.size+=w.size,x=!1}if(g.offset=e.offset-B,g.zip64)bit(g,o);else if(g.offset>4294967295)throw new Error(G7);return e.offset+=g.size,g}catch(R){if(m&&x||!m&&A){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=E.writable.size:e.offset=E.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),y&&y()}function v(){g.lock=new Promise(R=>b=R)}async function P(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(L=>y=()=>{e.writerLocked=!1,L()}),await R}async function M(R){Wi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Dm(R,new Uint8Array))}}async function hit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:l,metadataSize:u}=o,{localHeaderArray:f,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:b,compressionMethod:x,rawExtraFieldExtendedTimestamp:A,extraFieldExtendedTimestampFlag:E,rawExtraFieldNTFS:S,rawExtraFieldAES:v}=a,{dataDescriptorArray:P}=l,{rawFilename:M,lastAccessDate:R,creationDate:L,password:B,rawPassword:_,level:w,zip64:D,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:H,zipCrypto:V,dataDescriptor:j,directory:U,versionMadeBy:q,rawComment:X,rawExtraField:te,useWebWorkers:K,onstart:Z,onprogress:ee,onend:me,signal:xe,encryptionStrength:ue,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,useCompressionStream:Ve,passThrough:je}=s,it={lock:i,versionMadeBy:q,zip64:D,directory:!!U,filenameUTF8:!0,rawFilename:M,commentUTF8:!0,rawComment:X,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:S,rawExtraFieldAES:v,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,diskNumberStart:n},{signature:Dt,uncompressedSize:Gt}=s,$e=0;je||(Gt=0);let{writable:ln}=t;if(e){e.chunkSize=Kk(r),await Dm(ln,f);let Ct=e.readable,gi=Ct.size=e.size,an={options:{codecType:sU,level:w,rawPassword:_,password:B,encryptionStrength:ue,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!je,compressed:y&&!je,encrypted:m&&!je,useWebWorkers:K,useCompressionStream:Ve,transferStreams:!1},config:r,streamOptions:{signal:xe,size:gi,onstart:Z,onprogress:ee,onend:me}},_e=await lU({readable:Ct,writable:ln},an);$e=_e.outputSize,je||(Gt=_e.inputSize,Dt=_e.signature),ln.size+=Gt}else await Dm(ln,f);let Vt;if(D){let Ct=4;I&&(Ct+=8),N&&(Ct+=8),k&&(Ct+=8),H&&(Ct+=4),Vt=new Uint8Array(Ct)}else Vt=new Uint8Array;return git({signature:Dt,rawExtraFieldZip64:Vt,compressedSize:$e,uncompressedSize:Gt,headerInfo:a,dataDescriptorInfo:l},s),j&&await Dm(ln,P),Object.assign(it,{uncompressedSize:Gt,compressedSize:$e,lastModDate:p,rawLastModDate:g,creationDate:L,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+$e,compressionMethod:x,version:b,headerArray:h,signature:Dt,rawExtraFieldZip64:Vt,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:H}),it}function mit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:l,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:m}=e,{version:y,compressionMethod:b}=e,x=!f&&(r>0||r===Si&&b!==0),A;if(m&&!a){A=new Uint8Array(Wi(Hme)+2);let k=Ma(A);eo(k,0,39169),Es(A,Hme,2),OU(k,8,p)}else A=new Uint8Array;let E,S,v;if(g){S=new Uint8Array(9+(i?4:0)+(o?4:0));let k=Ma(S);eo(k,0,21589),eo(k,2,Wi(S)-4),v=1+(i?2:0)+(o?4:0),OU(k,4,v);let H=5;ji(k,H,Math.floor(n.getTime()/1e3)),H+=4,i&&(ji(k,H,Math.floor(i.getTime()/1e3)),H+=4),o&&ji(k,H,Math.floor(o.getTime()/1e3));try{E=new Uint8Array(36);let V=Ma(E),j=H7(n);eo(V,0,10),eo(V,2,32),eo(V,8,1),eo(V,10,24),Nl(V,12,j),Nl(V,20,H7(i)||j),Nl(V,28,H7(o)||j)}catch{E=new Uint8Array}}else E=S=new Uint8Array;let P=0;l&&(P=P|2048),u&&(P=P|8),b===Si&&(b=x?8:0),b==8&&(r>=1&&r<3&&(P=P|6),r>=3&&r<5&&(P=P|1),r===9&&(P=P|2)),s&&(y=y>45?y:45),m&&(P=P|1,a||(y=y>51?y:51,A[9]=b,b=99));let M=new Uint8Array(26),R=Ma(M);eo(R,0,y),eo(R,2,P),eo(R,4,b);let L=new Uint32Array(1),B=Ma(L),_;n<Jq?_=Jq:n>Qq?_=Qq:_=n,eo(B,0,(_.getHours()<<6|_.getMinutes())<<5|_.getSeconds()/2),eo(B,2,(_.getFullYear()-1980<<4|_.getMonth()+1)<<5|_.getDate());let w=L[0];ji(R,6,w),eo(R,22,Wi(t));let D=Wi(A,S,E,h);eo(R,24,D);let I=new Uint8Array(30+Wi(t)+D),N=Ma(I);return ji(N,0,67324752),Es(I,M,4),Es(I,t,30),Es(I,A,30+Wi(t)),Es(I,S,30+Wi(t,A)),Es(I,E,30+Wi(t,A,S)),Es(I,h,30+Wi(t,A,S,E)),{localHeaderArray:I,headerArray:M,headerView:R,lastModDate:n,rawLastModDate:w,encrypted:m,compressed:x,version:y,compressionMethod:b,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:E,rawExtraFieldAES:A,extraFieldLength:D}}function pit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ma(i),s=64-(t+Wi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),l=Ma(a);eo(l,0,6534),eo(l,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Wi(u)+s),Es(i,u),Es(i,a,Wi(u)),r=Ma(i),eo(r,28,o+s),e.metadataSize+=s}function _it(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=Ma(o),i&&(s=4,ji(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function git(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:l,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:m,zipCrypto:y,dataDescriptor:b}=t;if((!u||y)&&n!==Si&&(ji(l,10,n),b&&ji(f,h,n)),p){let x=Ma(i);eo(x,0,1),eo(x,2,Wi(i)-4);let A=4;g&&(ji(l,18,4294967295),Nl(x,A,BigInt(r)),A+=8),m&&(ji(l,14,4294967295),Nl(x,A,BigInt(o))),b&&(Nl(f,h+4,BigInt(o)),Nl(f,h+12,BigInt(r)))}else ji(l,14,o),ji(l,18,r),b&&(ji(f,h+4,o),ji(f,h+8,r))}async function yit(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)&&ji(r,14,e.signature),e.zip64?(ji(r,18,4294967295),ji(r,22,4294967295)):(ji(r,18,e.compressedSize),ji(r,22,e.uncompressedSize)),await Dm(n,new Uint8Array(o)),t.slice(o.byteLength)}function bit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:l}=t,u=Ma(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Nl(u,f,BigInt(i)),f+=8),l&&ji(u,f,o)}async function xit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,l=0,u=0,f=e.offset-r,h=i.size;for(let[,v]of i){let{rawFilename:P,rawExtraFieldZip64:M,rawExtraFieldAES:R,rawComment:L,rawExtraFieldNTFS:B,rawExtraField:_,extendedTimestamp:w,extraFieldExtendedTimestampFlag:D,lastModDate:I}=v,N;if(w){N=new Uint8Array(9);let k=Ma(N);eo(k,0,21589),eo(k,2,5),OU(k,4,D),ji(k,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=N,u+=46+Wi(P,L,M,R,B,N,_)}let p=new Uint8Array(u),g=Ma(p);await vm(o);let m=0;for(let[v,P]of Array.from(i.values()).entries()){let{offset:M,rawFilename:R,rawExtraFieldZip64:L,rawExtraFieldAES:B,rawExtraFieldCDExtendedTimestamp:_,rawExtraFieldNTFS:w,rawExtraField:D,rawComment:I,versionMadeBy:N,headerArray:k,directory:H,zip64:V,zip64UncompressedSize:j,zip64CompressedSize:U,zip64DiskNumberStart:q,zip64Offset:X,msDosCompatible:te,internalFileAttribute:K,externalFileAttribute:Z,diskNumberStart:ee,uncompressedSize:me,compressedSize:xe}=P,ue=Wi(L,B,_,w,D);ji(g,l,33639248),eo(g,l+4,N);let ye=Ma(k);j||ji(ye,18,me),U||ji(ye,14,xe),Es(p,k,l+6),eo(g,l+30,ue),eo(g,l+32,Wi(I)),eo(g,l+34,V&&q?65535:ee),eo(g,l+36,K),Z?ji(g,l+38,Z):H&&te&&OU(g,l+38,16),ji(g,l+42,V&&X?4294967295:M),Es(p,R,l+46),Es(p,L,l+46+Wi(R)),Es(p,B,l+46+Wi(R,L)),Es(p,_,l+46+Wi(R,L,B)),Es(p,w,l+46+Wi(R,L,B,_)),Es(p,D,l+46+Wi(R,L,B,_,w)),Es(p,I,l+46+Wi(R)+ue);let Ae=46+Wi(R,I)+ue;if(l-m>o.availableSize&&(o.availableSize=0,await Dm(s,p.slice(m,l)),m=l),l+=Ae,n.onprogress)try{await n.onprogress(v+1,i.size,new Ly(P))}catch{}}await Dm(s,m?p.slice(m):p);let y=o.diskNumber,{availableSize:b}=o;b<22&&y++;let x=co(e,n,bU);if(f>4294967295||u>4294967295||h>65535||y>65535){if(x===!1)throw new Error(G7);x=!0}let A=new Uint8Array(x?98:22),E=Ma(A);l=0,x&&(ji(E,0,101075792),Nl(E,4,BigInt(44)),eo(E,12,45),eo(E,14,45),ji(E,16,y),ji(E,20,a),Nl(E,24,BigInt(h)),Nl(E,32,BigInt(h)),Nl(E,40,BigInt(u)),Nl(E,48,BigInt(f)),ji(E,56,117853008),Nl(E,64,BigInt(f)+BigInt(u)),ji(E,72,y+1),co(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),h=65535,f=4294967295,u=4294967295,l+=76),ji(E,l,101010256),eo(E,l+4,y),eo(E,l+6,a),eo(E,l+8,h),eo(E,l+10,h),ji(E,l+12,u),ji(E,l+16,f);let S=Wi(t);if(S)if(S<=65535)eo(E,l+20,S);else throw new Error(oit);await Dm(s,A),S&&await Dm(s,t)}async function Dm(e,t){let n=e.getWriter();try{await n.ready,e.size+=Wi(t),await n.write(t)}finally{n.releaseLock()}}function H7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function co(e,t,n,i){let o=t[n]===Si?e.options[n]:t[n];return o===Si?i:o}function jme(e){return e+5*(Math.floor(e/16383)+1)}function OU(e,t,n){e.setUint8(t,n)}function eo(e,t,n){e.setUint16(t,n,!0)}function ji(e,t,n){e.setUint32(t,n,!0)}function Nl(e,t,n){e.setBigUint64(t,n,!0)}function Es(e,t,n){e.set(t,n)}function Ma(e){return new DataView(e.buffer)}function Wi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}mE({Deflate:Dhe,Inflate:$he});var j7=32,Tit="http://www.opengis.net/kml/2.2",Jd="http://www.google.com/kml/ext/2.2",Ait="http://www.w3.org/2000/xmlns/";function RU(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Cit=/^data:image\/([^,;]+)/;RU.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof we){if(e=we.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Cit);n=`texture_${++this._count}`,c(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 Eit(e,t){return function(n){e._files[t]=n}}RU.prototype.model=function(e,t){let n=this._modelCallback;if(!c(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(Eit(this,r))}return o};Object.defineProperties(RU.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function MU(e){this._time=e}MU.prototype.get=function(e,t,n){let i;return c(e)&&(i=c(e.getValue)?e.getValue(this._time,n):e),i??t};MU.prototype.getColor=function(e,t){let n=this.get(e,t);if(c(n))return fx(n)};MU.prototype.getMaterialType=function(e){if(c(e))return e.getType(this._time)};function W7(){this._ids={},this._styles={},this._count=0}W7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(c(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};W7.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 Xme(){this._ids={}}Xme.prototype.get=function(e){if(!c(e))return this.get(jn());let t=this._ids;return c(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function q7(e){e=e??W.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1;if(!c(t))throw new C("entities is required.");let i=q7._createState(e),o=t.values.filter(function(u){return!c(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Ait,"xmlns:gx",Jd);let a=r.createElement("Document");s.appendChild(a),$me(i,a,o),i.styleCache.save(a);let l=i.externalFileHandler;return l.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Sit(f,l.files):{kml:f,externalFiles:l.files}})}function Sit(e,t){let n=tn("ThirdParty/Workers/z-worker-pako.js");mE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new xP,o=new IU(i);return o.add("doc.kml",new dU(e)).then(function(){let r=Object.keys(t);return Kme(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function Kme(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new p_(n[o])).then(function(){return Kme(e,t,n,i+1)})}q7._createState=function(e){let t=e.entities,n=new W7,i=t.computeAvailability(),o=c(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new Sn:Q.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new RU(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Tit,"kml"),ellipsoid:e.ellipsoid??ie.default,idManager:new Xme,styleCache:n,externalFileHandler:a,time:o,valueGetter:new MU(o),sampleDuration:s,defaultAvailability:new Xr([r])}};function $me(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,l,u,f;for(let h=0;h<a;++h){let p=n[h];l=[],u=[],f=[],wit(e,p,u,f),vit(e,p.polyline,u,f),Yme(e,p.rectangle,u,f,l),Yme(e,p.polygon,u,f,l),Oit(e,p,p.model,u,f);let g,m=p.availability;c(m)&&(g=i.createElement("TimeSpan"),Q.equals(m.start,Ge.MINIMUM_VALUE)||g.appendChild(fn(i,"begin",Q.toIso8601(m.start))),Q.equals(m.stop,Ge.MAXIMUM_VALUE)||g.appendChild(fn(i,"end",Q.toIso8601(m.stop))));for(let x=0;x<l.length;++x){let A=l[x];A.setAttribute("id",s.get(p.id)),A.appendChild(fn(i,"name",p.name)),A.appendChild(fn(i,"visibility",p.show)),A.appendChild(fn(i,"description",p.description)),c(g)&&A.appendChild(g),t.appendChild(A)}let y=u.length;if(y>0){let x=i.createElement("Placemark");x.setAttribute("id",s.get(p.id));let A=p.name,E=p.label;if(c(E)){let v=i.createElement("LabelStyle"),P=r.get(E.text);A=c(P)&&P.length>0?P:A;let M=r.getColor(E.fillColor);c(M)&&(v.appendChild(fn(i,"color",M)),v.appendChild(fn(i,"colorMode","normal")));let R=r.get(E.scale);c(R)&&v.appendChild(fn(i,"scale",R)),f.push(v)}x.appendChild(fn(i,"name",A)),x.appendChild(fn(i,"visibility",p.show)),x.appendChild(fn(i,"description",p.description)),c(g)&&x.appendChild(g),t.appendChild(x);let S=f.length;if(S>0){let v=i.createElement("Style");for(let P=0;P<S;++P)v.appendChild(f[P]);x.appendChild(fn(i,"styleUrl",o.get(v)))}if(u.length===1)x.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let P=0;P<y;++P)v.appendChild(u[P]);x.appendChild(v)}}let b=p._children;if(b.length>0){let x=i.createElement("Folder");x.setAttribute("id",s.get(p.id)),x.appendChild(fn(i,"name",p.name)),x.appendChild(fn(i,"visibility",p.show)),x.appendChild(fn(i,"description",p.description)),t.appendChild(x),$me(e,x,b)}}}var Fl=new d,$c=new he,Qd=new Q;function wit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!c(a)&&!c(t.path))return;let l=t.position;if(!l.isConstant){Zme(e,t,a,n,i);return}s.get(l,void 0,Fl);let u=fn(o,"coordinates",ux(Fl,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(dx(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=a instanceof wc?Jme(e,a):Qme(e,a);i.push(p)}function Zme(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,l,u=t.position,f=!0;u instanceof Pa?(l=u.intervals,f=!1):l=t.availability??e.defaultAvailability;let h=n instanceof ng,p,g,m,y=[];for(p=0;p<l.length;++p){let x=l.get(p),A=f?u:x.data,E=r.createElement("altitudeMode");A instanceof f_?(A=A._value,E.appendChild(dx(e,qe.CLAMP_TO_GROUND))):c(n)?E.appendChild(dx(e,n.heightReference)):E.appendChild(dx(e,qe.NONE));let S=[],v=[];if(A.isConstant){a.get(A,void 0,Fl);let M=fn(r,"coordinates",ux(Fl,s));S.push(Q.toIso8601(x.start)),v.push(M),S.push(Q.toIso8601(x.stop)),v.push(M)}else if(A instanceof Ia)for(m=A._property._times,g=0;g<m.length;++g)S.push(Q.toIso8601(m[g])),A.getValueInReferenceFrame(m[g],zi.FIXED,Fl),v.push(ux(Fl,s));else if(A instanceof Ff){m=A._times;let M=A._values;for(g=0;g<m.length;++g)S.push(Q.toIso8601(m[g])),d.fromArray(M,g*3,Fl),v.push(ux(Fl,s))}else{let M=e.sampleDuration;x.start.clone(Qd),x.isStartIncluded||Q.addSeconds(Qd,M,Qd);let R=x.stop;for(;Q.lessThan(Qd,R);)A.getValue(Qd,Fl),S.push(Q.toIso8601(Qd)),v.push(ux(Fl,s)),Q.addSeconds(Qd,M,Qd);x.isStopIncluded&&Q.equals(Qd,R)&&(A.getValue(Qd,Fl),S.push(Q.toIso8601(Qd)),v.push(ux(Fl,s)))}let P=r.createElementNS(Jd,"Track");P.appendChild(E);for(let M=0;M<S.length;++M){let R=fn(r,"when",S[M]),L=fn(r,"coord",v[M],Jd);P.appendChild(R),P.appendChild(L)}h&&P.appendChild(epe(e,n)),y.push(P)}if(y.length===1)i.push(y[0]);else if(y.length>1){let x=r.createElementNS(Jd,"MultiTrack");for(p=0;p<y.length;++p)x.appendChild(y[p]);i.push(x)}if(c(n)&&!h){let x=n instanceof wc?Jme(e,n):Qme(e,n);o.push(x)}let b=t.path;if(c(b)){let x=a.get(b.width),A=b.material;if(c(A)||c(x)){let E=r.createElement("LineStyle");c(x)&&E.appendChild(fn(r,"width",x)),Y7(e,A,E),o.push(E)}}}function Qme(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);c(r)&&(o.appendChild(fn(n,"color",r)),o.appendChild(fn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return c(s)&&o.appendChild(fn(n,"scale",s/j7)),o}function Jme(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(c(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(fn(n,"href",s));let g=i.get(t.imageSubRegion);c(g)&&(p.appendChild(fn(n,"x",g.x,Jd)),p.appendChild(fn(n,"y",g.y,Jd)),p.appendChild(fn(n,"w",g.width,Jd)),p.appendChild(fn(n,"h",g.height,Jd))),r.appendChild(p)}let a=i.getColor(t.color);c(a)&&(r.appendChild(fn(n,"color",a)),r.appendChild(fn(n,"colorMode","normal")));let l=i.get(t.scale);c(l)&&r.appendChild(fn(n,"scale",l));let u=i.get(t.pixelOffset);if(c(u)){l=l??1,z.divideByScalar(u,l,u);let p=i.get(t.width,j7),g=i.get(t.height,j7),m=i.get(t.horizontalOrigin,xi.CENTER);m===xi.CENTER?u.x-=p*.5:m===xi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Fn.CENTER);y===Fn.TOP?u.y+=g:y===Fn.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return c(f)&&d.equals(d.UNIT_Z,h)&&(f=O.toDegrees(-f),f===0&&(f=360),r.appendChild(fn(n,"heading",f))),r}function vit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!c(t))return;let a=o.createElement("LineString"),l=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(fn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),l.appendChild(f),a.appendChild(l);let h=t.positions,p=s.get(h),g=fn(o,"coordinates",ux(p,r));a.appendChild(g);let m=s.get(t.zIndex);u&&c(m)&&a.appendChild(fn(o,"drawOrder",m,Jd)),n.push(a);let y=o.createElement("LineStyle"),b=s.get(t.width);c(b)&&y.appendChild(fn(o,"width",b)),Y7(e,t.material,y),i.push(y)}function Dit(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),l=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,$c),l.push(`${O.toDegrees($c.longitude)},${O.toDegrees($c.latitude)},${r}`);let f=fn(i,"coordinates",l.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function qme(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],r,$c),s.push(`${O.toDegrees($c.longitude)},${O.toDegrees($c.latitude)},${i?$c.height:n}`);let l=fn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(l),u}function Pit(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=[],l=t.hierarchy,u=o.get(l),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(qme(e,f,r,s)),a.push(h);let p=u.holes;if(c(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(qme(e,p[m].positions,r,s)),a.push(y)}}return a}function Yme(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!c(t))return;let a=t instanceof Uh;if(a&&s.getMaterialType(t.material)==="Image"){Iit(e,t,o);return}let l=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&l.appendChild(fn(r,"extrude",!0));let f=a?Dit(e,t,u):Pit(e,t,u),h=f.length;for(let b=0;b<h;++b)l.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(dx(e,t.heightReference)),l.appendChild(p),n.push(l);let g=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(fn(r,"fill",m)),Y7(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(fn(r,"outline",y));let b=r.createElement("LineStyle"),x=s.get(t.outlineWidth,1);b.appendChild(fn(r,"width",x));let A=s.getColor(t.outlineColor,G.BLACK);b.appendChild(fn(r,"color",A)),b.appendChild(fn(r,"colorMode","normal")),i.push(b)}i.push(g)}function Iit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(dx(e,t.heightReference)),s.appendChild(a);let l=o.get(t.height);c(l)&&s.appendChild(fn(i,"altitude",l));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(fn(i,"north",O.toDegrees(u.north))),f.appendChild(fn(i,"south",O.toDegrees(u.south))),f.appendChild(fn(i,"east",O.toDegrees(u.east))),f.appendChild(fn(i,"west",O.toDegrees(u.west))),s.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),g=i.createElement("Icon");g.appendChild(fn(i,"href",p)),s.appendChild(g);let m=h.color;c(m)&&s.appendChild(fn(i,"color",fx(h.color))),n.push(s)}function epe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(c(s)){let u=n.createElement("scale");u.appendChild(fn(n,"x",s)),u.appendChild(fn(n,"y",s)),u.appendChild(fn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),l=o.model(t,e.time);return a.appendChild(fn(n,"href",l)),r.appendChild(a),r}function Oit(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!c(n))return;let l=t.position;if(!l.isConstant){Zme(e,t,n,i,o);return}let u=epe(e,n),f=r.createElement("altitudeMode");f.appendChild(dx(e,n.heightReference)),u.appendChild(f),a.get(l,void 0,Fl),he.fromCartesian(Fl,s,$c);let h=r.createElement("Location");h.appendChild(fn(r,"longitude",O.toDegrees($c.longitude))),h.appendChild(fn(r,"latitude",O.toDegrees($c.latitude))),h.appendChild(fn(r,"altitude",$c.height)),u.appendChild(h),i.push(u)}function Y7(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!c(t))return;let r=o.get(t);if(!c(r))return;let s,a=o.getMaterialType(t),l,u;switch(a){case"Image":s=fx(G.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=fx(r.color);break;case"PolylineOutline":s=fx(r.color),l=fx(r.outlineColor),u=r.outlineWidth,n.appendChild(fn(i,"outerColor",l,Jd)),n.appendChild(fn(i,"outerWidth",u,Jd));break;case"Stripe":s=fx(r.oddColor);break}c(s)&&(n.appendChild(fn(i,"color",s)),n.appendChild(fn(i,"colorMode","normal")))}function dx(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,qe.NONE),r;switch(o){case qe.NONE:r=n.createTextNode("absolute");break;case qe.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case qe.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function ux(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,$c),i.push(`${O.toDegrees($c.longitude)},${O.toDegrees($c.latitude)},${$c.height}`);return i.join(" ")}function fn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=c(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 fx(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 tpe=q7;function vP(){this._cache={}}vP.prototype.fromColor=function(e,t){if(!c(e))throw new C("color is required");if(!c(t))throw new C("size is required");return LU(void 0,void 0,e,t,this._cache)};vP.prototype.fromUrl=function(e,t,n){if(!c(e))throw new C("url is required");if(!c(t))throw new C("color is required");if(!c(n))throw new C("size is required");return LU(e,void 0,t,n,this._cache)};vP.prototype.fromMakiIconId=function(e,t,n){if(!c(e))throw new C("id is required");if(!c(t))throw new C("color is required");if(!c(n))throw new C("size is required");return LU(tn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};vP.prototype.fromText=function(e,t,n){if(!c(e))throw new C("text is required");if(!c(t))throw new C("color is required");if(!c(n))throw new C("size is required");return LU(void 0,e,t,n,this._cache)};var Rit=new G;function Mit(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Rit).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 npe(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=G.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=G.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var wP=new Array(4);function LU(e,t,n,i,o){wP[0]=e,wP[1]=t,wP[2]=n,wP[3]=i;let r=JSON.stringify(wP),s=o[r];if(c(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let l=a.getContext("2d");if(Mit(l,n,i),c(e)){let f=we.createIfNeeded(e).fetchImage().then(function(h){return npe(l,h,i),o[r]=a,a});return o[r]=f,f}else if(c(t)){let u=JA(t,{font:`bold ${i}px sans-serif`});npe(l,u,i)}return o[r]=a,a}var Ny=vP;function X7(e){return e}function NU(e){if(e==null)return X7;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var u=2,f=a.length,h=new Array(f);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;u<f;)h[u]=a[u],++u;return h}}function ipe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function K7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ope(e,n)})}:ope(e,t)}function ope(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=$7(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 $7(e,t){var n=NU(e.transform),i=e.arcs;function o(f,h){h.length&&h.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)h.push(n(p[g],g));f<0&&ipe(h,m)}function r(f){return n(f)}function s(f){for(var h=[],p=0,g=f.length;p<g;++p)o(f[p],h);return h.length<2&&h.push(h[0]),h}function a(f){for(var h=s(f);h.length<4;)h.push(h[0]);return h}function l(f){return f.map(a)}function u(f){var h=f.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=l(f.arcs);break;case"MultiPolygon":p=f.arcs.map(l);break;default:return null}return{type:h,coordinates:p}}return u(t)}function FU(e){return d.fromDegrees(e[0],e[1],e[2])}var Z7={"urn:ogc:def:crs:OGC:1.3:CRS84":FU,"EPSG:4326":FU,"urn:ogc:def:crs:EPSG::4326":FU},rpe={},spe={},Q7=48,J7,eY=G.ROYALBLUE,tY=G.YELLOW,nY=2,iY=G.fromBytes(255,255,0,100),oY=!1,kit={small:24,medium:48,large:64},Uit=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function ape(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Uit.indexOf(i)!==-1)continue;let o=e[i];c(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${ape(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 Vit(e,t,n){let i;return function(o,r){return c(i)||(i=e(t,n)),i}}function zit(e,t){return new Vh(Vit(ape,e,t),!0)}function BU(e,t,n){let i=e.id;if(!c(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;c(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(c(r)){o.properties=r;let s,a=r.title;if(c(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}c(s)&&(o.name=r[s])}let l=r.description;l!==null&&(o.description=c(l)?new Xn(l):n(r,s))}return o}function rY(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var cpe={Feature:upe,FeatureCollection:Hit,GeometryCollection:fpe,LineString:_pe,MultiLineString:gpe,MultiPoint:mpe,MultiPolygon:xpe,Point:hpe,Polygon:bpe,Topology:Tpe},lpe={GeometryCollection:fpe,LineString:_pe,MultiLineString:gpe,MultiPoint:mpe,MultiPolygon:xpe,Point:hpe,Polygon:bpe,Topology:Tpe};function upe(e,t,n,i,o){if(t.geometry===null){BU(t,e._entityCollection,o.describe);return}if(!c(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=lpe[r];if(!c(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Hit(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)upe(e,r[s],void 0,i,o)}function fpe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let l=r[s],u=l.type,f=lpe[u];if(!c(f))throw new ae(`Unknown geometry type: ${u}`);f(e,t,l,i,o)}}function dpe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,l=t.properties;if(c(l)){let g=l["marker-color"];c(g)&&(s=G.fromCssColorString(g)),a=kit[l["marker-size"]]??a;let m=l["marker-symbol"];c(m)&&(r=m)}let u;c(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new wc;f.verticalOrigin=new Xn(Fn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=qe.CLAMP_TO_GROUND);let h=BU(t,e._entityCollection,o.describe);h.billboard=f,h.position=new gl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Xn(g)}).catch(function(){f.image=new Xn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function hpe(e,t,n,i,o){dpe(e,t,i,n.coordinates,o)}function mpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)dpe(e,t,i,r[s],o)}function ppe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(c(a)){let f=a["stroke-width"];c(f)&&(s=new Xn(f));let h,p=a.stroke;c(p)&&(h=G.fromCssColorString(p));let g=a["stroke-opacity"];c(g)&&g!==1&&(c(h)||(h=r.color.getValue().clone()),h.alpha=g),c(h)&&(r=new Ut(h))}let l=BU(t,e._entityCollection,o.describe),u=new Oc;l.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Xn(rY(i,n)),u.arcType=qt.RHUMB}function _pe(e,t,n,i,o){ppe(e,t,i,n.coordinates,o)}function gpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ppe(e,t,i,r[s],o)}function ype(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,l=t.properties;if(c(l)){let g=l["stroke-width"];c(g)&&(a=new Xn(g));let m,y=l.stroke;c(y)&&(m=G.fromCssColorString(y));let b=l["stroke-opacity"];c(b)&&b!==1&&(c(m)||(m=r.getValue().clone()),m.alpha=b),c(m)&&(r=new Xn(m));let x,A=l.fill,E=s.color.getValue();c(A)&&(x=G.fromCssColorString(A),x.alpha=E.alpha),b=l["fill-opacity"],c(b)&&b!==E.alpha&&(c(x)||(x=E.clone()),x.alpha=b),c(x)&&(s=new Ut(x))}let u=new kh;u.outline=new Xn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=qt.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new ec(rY(i[g],n)));let h=i[0];u.hierarchy=new Xn(new ec(rY(h,n),f)),h[0].length>2?u.perPositionHeight=new Xn(!0):o.clampToGround||(u.height=0);let p=BU(t,e._entityCollection,o.describe);p.polygon=u}function bpe(e,t,n,i,o){ype(e,t,i,n.coordinates,o)}function xpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ype(e,t,i,r[s],o)}function Tpe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=K7(n,n.objects[r]),a=cpe[s.type];a(e,s,s,i,o)}}function Fy(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new la(this),this._promises=[],this._pinBuilder=new Ny,this._entityCluster=new Lf,this._credit=void 0,this._resourceCredits=[]}Fy.load=function(e,t){return new Fy().load(e,t)};Object.defineProperties(Fy,{markerSize:{get:function(){return Q7},set:function(e){Q7=e}},markerSymbol:{get:function(){return J7},set:function(e){J7=e}},markerColor:{get:function(){return eY},set:function(e){eY=e}},stroke:{get:function(){return tY},set:function(e){tY=e}},strokeWidth:{get:function(){return nY},set:function(e){nY=e}},fill:{get:function(){return iY},set:function(e){iY=e}},clampToGround:{get:function(){return oY},set:function(e){oY=e}},crsNames:{get:function(){return Z7}},crsLinkHrefs:{get:function(){return rpe}},crsLinkTypes:{get:function(){return spe}}});Object.defineProperties(Fy.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){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});Fy.prototype.load=function(e,t){return Ape(this,e,t,!0)};Fy.prototype.process=function(e,t){return Ape(this,e,t,!1)};function Ape(e,t,n,i){if(!c(t))throw new C("data is required.");Kr.setLoading(e,!0),n=n??W.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new At(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;f<u;f++)a.push(l[f])}}return n={describe:n.describe??zit,markerSize:n.markerSize??Q7,markerSymbol:n.markerSymbol??J7,markerColor:n.markerColor??eY,strokeWidthProperty:new Xn(n.strokeWidth??nY),strokeMaterialProperty:new Ut(n.stroke??tY),fillMaterialProperty:new Ut(n.fill??iY),clampToGround:n.clampToGround??oY},Promise.resolve(r).then(function(a){return Git(e,a,n,s,i)}).catch(function(a){throw Kr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Fy.prototype.update=function(e){return!0};function Git(e,t,n,i,o){let r;c(i)&&(r=ly(i)),c(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=cpe[t.type];if(!c(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,l=a!==null?FU:null;if(c(a)){if(!c(a.properties))throw new ae("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(l=Z7[u.name],!c(l))throw new ae(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=rpe[u.href];if(c(f)||(f=spe[u.type]),!c(f))throw new ae(`Unable to resolve crs link: ${JSON.stringify(u)}`);l=f(u)}else if(a.type==="EPSG"){if(l=Z7[`EPSG:${u.code}`],!c(l))throw new ae(`Unknown crs EPSG code: ${u.code}`)}else throw new ae(`Unknown crs type: ${a.type}`)}return Promise.resolve(l).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Kr.setLoading(e,!1),e})})}var hx=Fy;function jit(e){if(typeof e=="string"){let t=document.getElementById(e);if(t===null)throw new C(`Element with id "${e}" does not exist in the document.`);e=t}return e}var Rn=jit;var Cpe="4.1.0";function Wit(e){return e===void 0}function Au(e){return typeof e=="boolean"}function Epe(e,t){for(var n in t)t.hasOwnProperty(n)&&Wit(e[n])&&(e[n]=t[n]);return e}function Spe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function zo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function By(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Pm(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var ky=/[A-Za-z]/,Gs=/[\d]/;var Cu=/\s/,kU=/['"]/,wpe=/[\x00-\x1F\x7F]/,vpe=/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,qit=/\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,Yit=/\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,Xit=vpe+qit+Yit,Dpe=/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,pai=new RegExp("[".concat(vpe+Dpe,"]")),sY=Xit+Dpe,eh=new RegExp("[".concat(sY,"]"));var UU=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(Cu):[],o=t.split(Cu),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(Cu):[],o=t.split(Cu),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}();function Ppe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(A){var E={},S=A,v=S.match(/^([a-z]+):\/\//i);return v&&(E.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(E.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(E.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(E.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(E.fragment=v[1]),E},s=function(A){var E="";return A.scheme&&A.host&&(E+=A.scheme+"://"),A.host&&(E+=A.host),A.path&&(E+="/"+A.path),A.query&&(E+="?"+A.query),A.fragment&&(E+="#"+A.fragment),E},a=function(A,E){var S=E/2,v=Math.ceil(S),P=-1*Math.floor(S),M="";return P<0&&(M=A.substr(P)),A.substr(0,v)+n+M};if(e.length<=t)return e;var l=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=l)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,l+i):a(h,l).substr(0,l+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=l){if((h+p).length==t)return(h+p).substr(0,t);var g=l-h.length;return(h+a(p,g)).substr(0,l+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=l){if((h+m).length==t)return(h+m).substr(0,t);var y=l-h.length;return(h+a(m,y)).substr(0,l+i)}else h+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((h+b).length<l)return(b+h).substr(0,t)}if(h.length<=t)return h;var x="";return l>0&&(x=h.substr(-1*Math.floor(l/2))),(h.substr(0,Math.ceil(l/2))+n+x).substr(0,l+i)}function Ipe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",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)}function Ope(e,t,n){return Spe(e,t,n)}var Rpe=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 UU({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"?Ppe(t,i):o==="middle"?Ipe(t,i):Ope(t,i)},e}();var aY=function(e,t){return aY=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])},aY(e,t)};function Im(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");aY(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var js=function(){return js=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},js.apply(this,arguments)};var Om=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 Kit="(?: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)",Mpe=new RegExp("^"+Kit+"$");var $it=/[\/?#]/,Zit=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Lpe=/[?!:,.;^]/,cY=/https?:\/\//i,Npe=new RegExp("^"+cY.source,"i"),Fpe=new RegExp(Lpe.source+"$"),Qit=/^(javascript|vbscript):/i,Jit=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,eot=/^(?:\/\/)?([^/#?:]+)/;function AE(e){return ky.test(e)}function lY(e){return ky.test(e)||Gs.test(e)||e==="+"||e==="-"||e==="."}function __(e){return eh.test(e)}function VU(e){return e==="_"||__(e)}function uY(e){return eh.test(e)||Zit.test(e)||Lpe.test(e)}function zU(e){return $it.test(e)}function fY(e){return Mpe.test(e.toLowerCase())}function Bpe(e){if(Qit.test(e))return!1;var t=e.match(Jit);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!ky.test(i))}function kpe(e){var t=e.match(eot);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!fY(o)}var tot=/^(?:(?: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]?)$/,not=/[:/?#]/;function Upe(e){var t=e.split(not,1)[0];return tot.test(t)}var iot=/^(https?:\/\/)?(www\.)?/i,oot=/^\/\//,Vpe=function(e){Im(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=aot(n)),this.stripPrefix.scheme&&(n=rot(n)),this.stripPrefix.www&&(n=sot(n)),this.stripTrailingSlash&&(n=cot(n)),this.decodePercentEncoding&&(n=lot(n)),n},t}(Om);function rot(e){return e.replace(Npe,"")}function sot(e){return e.replace(iot,"$1")}function aot(e){return e.replace(oot,"")}function cot(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function lot(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var zpe=/^mailto:/i,uot=new RegExp("[".concat(sY,"!#$%&'*+/=?^_`{|}~-]"));function Hpe(e){return eh.test(e)}function HU(e){return uot.test(e)}function Gpe(e){var t=e.split(".").pop()||"";return fY(t)}var jpe=function(e){Im(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}(Om);function dY(e){return e==="_"||eh.test(e)}function Wpe(e){return e.length<=140}var qpe=["twitter","facebook","instagram","tiktok","youtube"];var Ype=function(e){Im(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 Pm(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}(Om);var fot={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 hY(e){return dot.test(e)}function Xpe(e,t){var n=fot[t];return n.test(e)}var Kpe=["twitter","instagram","soundcloud","tiktok","youtube"];var $pe=function(e){Im(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 Pm(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}(Om);var hot=/[-. ]/,mot=/[-. ()]/,pot=/[,;]/,_ot=/(?:(?:(?:(\+)?\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]+#?)*/,got=/(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})/,yot=new RegExp("^".concat(_ot.source,"|").concat(got.source,"$"));function mY(e){return hot.test(e)}function GU(e){return pot.test(e)}function Zpe(e){var t=e.charAt(0)==="+"||mot.test(e);return t&&yot.test(e)}var Qpe=function(e){Im(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}(Om);function t_e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,l=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)x(p);else{for(var g=f.length-1;g>=0;g--){var m=f[g];switch(m.state){case 11:M(m,p);break;case 12:R(m,p);break;case 0:A(m,p);break;case 1:E(m,p);break;case 2:S(m,p);break;case 3:v(m,p);break;case 4:P(m,p);break;case 5:L(m,p);break;case 6:B(m,p);break;case 7:_(m,p);break;case 13:w(m,p);break;case 14:D(m,p);break;case 8:I(m,p);break;case 9:N(m,p);break;case 10:k(m,p);break;case 15:H(m,p);break;case 16:V(m,p);break;case 17:j(m,p);break;case 18:U(m,p);break;case 19:q(m,p);break;case 20:X(m,p);break;case 21:te(m,p);break;case 22:K(m,p);break;case 23:Z(m,p);break;case 24:ee(m,p);break;case 25:me(m,p);break;case 26:xe(m,p);break;case 27:ue(m,p);break;case 28:ye(m,p);break;case 29:Ae(m,p);break;case 30:Pe(m,p);break;case 31:Ee(m,p);break;case 32:je(m,p);break;case 33:it(m,p);break;case 34:Dt(m,p);break;case 35:Gt(m,p);break;case 36:$e(m,p);break;case 37:Ve(m,p);break;case 38:ln(m,p);break;case 39:Vt(m,p);break;case 40:Ct(m,p);break;case 41:gi(m,p);break;default:Pm(m.state)}}if(h>0&&AE(p)){var y=e.charAt(h-1);!AE(y)&&!f.some(Sot)&&f.push(jU(h,0))}}}for(var b=f.length-1;b>=0;b--)f.forEach(function(_e){return an(_e)});return l;function x(_e){if(_e==="#")f.push(Cot(h,28));else if(_e==="@")f.push(Eot(h,30));else if(_e==="/")f.push(pY(h,11));else if(_e==="+")f.push(_Y(h,37));else if(_e==="(")f.push(_Y(h,32));else{if(Gs.test(_e)&&(f.push(_Y(h,38)),f.push(Tot(h,13))),Hpe(_e)){var Ce=_e.toLowerCase()==="m"?15:22;f.push(Aot(h,Ce))}AE(_e)&&f.push(jU(h,0)),eh.test(_e)&&f.push(pY(h,5))}}function A(_e,Ce){Ce===":"?_e.state=2:Ce==="-"?_e.state=1:lY(Ce)||zo(f,_e)}function E(_e,Ce){Ce==="-"||(Ce==="/"?(zo(f,_e),f.push(pY(h,11))):lY(Ce)?_e.state=0:zo(f,_e))}function S(_e,Ce){Ce==="/"?_e.state=3:Ce==="."?zo(f,_e):__(Ce)?(_e.state=5,AE(Ce)&&f.push(jU(h,0))):zo(f,_e)}function v(_e,Ce){Ce==="/"?_e.state=4:uY(Ce)?(_e.state=10,_e.acceptStateReached=!0):an(_e)}function P(_e,Ce){Ce==="/"?_e.state=10:__(Ce)?(_e.state=5,_e.acceptStateReached=!0):zo(f,_e)}function M(_e,Ce){Ce==="/"?_e.state=12:zo(f,_e)}function R(_e,Ce){__(Ce)?_e.state=5:zo(f,_e)}function L(_e,Ce){Ce==="."?_e.state=7:Ce==="-"?_e.state=6:Ce===":"?_e.state=8:zU(Ce)?_e.state=10:VU(Ce)||an(_e)}function B(_e,Ce){Ce==="-"||(Ce==="."?an(_e):__(Ce)?_e.state=5:an(_e))}function _(_e,Ce){Ce==="."?an(_e):__(Ce)?(_e.state=5,_e.acceptStateReached=!0):an(_e)}function w(_e,Ce){Ce==="."?_e.state=14:Ce===":"?_e.state=8:Gs.test(Ce)||(zU(Ce)?_e.state=10:eh.test(Ce)?zo(f,_e):an(_e))}function D(_e,Ce){Gs.test(Ce)?(_e.octetsEncountered++,_e.octetsEncountered===4&&(_e.acceptStateReached=!0),_e.state=13):an(_e)}function I(_e,Ce){Gs.test(Ce)?_e.state=9:an(_e)}function N(_e,Ce){Gs.test(Ce)||(zU(Ce)?_e.state=10:an(_e))}function k(_e,Ce){uY(Ce)||an(_e)}function H(_e,Ce){Ce.toLowerCase()==="a"?_e.state=16:K(_e,Ce)}function V(_e,Ce){Ce.toLowerCase()==="i"?_e.state=17:K(_e,Ce)}function j(_e,Ce){Ce.toLowerCase()==="l"?_e.state=18:K(_e,Ce)}function U(_e,Ce){Ce.toLowerCase()==="t"?_e.state=19:K(_e,Ce)}function q(_e,Ce){Ce.toLowerCase()==="o"?_e.state=20:K(_e,Ce)}function X(_e,Ce){Ce.toLowerCase()===":"?_e.state=21:K(_e,Ce)}function te(_e,Ce){HU(Ce)?_e.state=22:zo(f,_e)}function K(_e,Ce){Ce==="."?_e.state=23:Ce==="@"?_e.state=24:HU(Ce)?_e.state=22:zo(f,_e)}function Z(_e,Ce){Ce==="."?zo(f,_e):Ce==="@"?zo(f,_e):HU(Ce)?_e.state=22:zo(f,_e)}function ee(_e,Ce){__(Ce)?_e.state=25:zo(f,_e)}function me(_e,Ce){Ce==="."?_e.state=27:Ce==="-"?_e.state=26:VU(Ce)||an(_e)}function xe(_e,Ce){Ce==="-"||Ce==="."?an(_e):VU(Ce)?_e.state=25:an(_e)}function ue(_e,Ce){Ce==="."||Ce==="-"?an(_e):__(Ce)?(_e.state=25,_e.acceptStateReached=!0):an(_e)}function ye(_e,Ce){dY(Ce)?(_e.state=29,_e.acceptStateReached=!0):zo(f,_e)}function Ae(_e,Ce){dY(Ce)||an(_e)}function Pe(_e,Ce){hY(Ce)?(_e.state=31,_e.acceptStateReached=!0):zo(f,_e)}function Ee(_e,Ce){hY(Ce)||(eh.test(Ce)?zo(f,_e):an(_e))}function Ve(_e,Ce){Gs.test(Ce)?_e.state=38:(zo(f,_e),x(Ce))}function je(_e,Ce){Gs.test(Ce)?_e.state=33:zo(f,_e),x(Ce)}function it(_e,Ce){Gs.test(Ce)?_e.state=34:zo(f,_e)}function Dt(_e,Ce){Gs.test(Ce)?_e.state=35:zo(f,_e)}function Gt(_e,Ce){Ce===")"?_e.state=36:zo(f,_e)}function $e(_e,Ce){Gs.test(Ce)?_e.state=38:mY(Ce)?_e.state=39:zo(f,_e)}function ln(_e,Ce){_e.acceptStateReached=!0,GU(Ce)?_e.state=40:Ce==="#"?_e.state=41:Gs.test(Ce)||(Ce==="("?_e.state=32:mY(Ce)?_e.state=39:(an(_e),AE(Ce)&&f.push(jU(h,0))))}function Vt(_e,Ce){Gs.test(Ce)?_e.state=38:Ce==="("?_e.state=32:(an(_e),x(Ce))}function Ct(_e,Ce){GU(Ce)||(Ce==="#"?_e.state=41:Gs.test(Ce)?_e.state=38:an(_e))}function gi(_e,Ce){GU(Ce)?_e.state=40:Gs.test(Ce)?zo(f,_e):an(_e)}function an(_e){if(zo(f,_e),!!_e.acceptStateReached){var Ce=_e.startIdx,mn=e.slice(_e.startIdx,h);if(mn=xot(mn),_e.type==="url"){var mt=e.charAt(_e.startIdx-1);if(mt==="@")return;var to=_e.matchType;if(to==="scheme"){var So=cY.exec(mn);if(So&&(Ce=Ce+So.index,mn=mn.slice(So.index)),!Bpe(mn))return}else if(to==="tld"){if(!kpe(mn))return}else if(to==="ipV4"){if(!Upe(mn))return}else Pm(to);l.push(new Vpe({tagBuilder:n,matchedText:mn,offset:Ce,urlMatchType:to,url:mn,protocolRelativeMatch:mn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(_e.type==="email")Gpe(mn)&&l.push(new jpe({tagBuilder:n,matchedText:mn,offset:Ce,email:mn.replace(zpe,"")}));else if(_e.type==="hashtag")Wpe(mn)&&l.push(new Ype({tagBuilder:n,matchedText:mn,offset:Ce,serviceName:s,hashtag:mn.slice(1)}));else if(_e.type==="mention")Xpe(mn,a)&&l.push(new $pe({tagBuilder:n,matchedText:mn,offset:Ce,serviceName:a,mention:mn.slice(1)}));else if(_e.type==="phone"){if(mn=mn.replace(/ +$/g,""),Zpe(mn)){var Ks=mn.replace(/[^0-9,;#]/g,"");l.push(new Qpe({tagBuilder:n,matchedText:mn,offset:Ce,number:Ks,plusSign:mn.charAt(0)==="+"}))}}else Pm(_e)}}}var bot=/[\(\{\[]/,Jpe=/[\)\}\]]/,e_e={")":"(","}":"{","]":"["};function xot(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);bot.test(i)?t[i]++:Jpe.test(i)&&t[e_e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Jpe.test(r)){var s=e_e[r];if(t[s]<0)t[s]++,o--;else break}else if(Fpe.test(r))o--;else break;return e.slice(0,o+1)}function jU(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function pY(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Tot(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Aot(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Cot(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Eot(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function _Y(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Sot(e){return e.type==="url"&&e.matchType==="scheme"}function n_e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Rm,l=0,u=e.length,f=0,h=0,p=a;l<u;){var g=e.charAt(l);switch(f){case 0:m(g);break;case 1:y(g);break;case 2:x(g);break;case 3:b(g);break;case 4:A(g);break;case 5:E(g);break;case 6:S(g);break;case 7:v(g);break;case 8:P(g);break;case 9:M(g);break;case 10:R(g);break;case 11:L(g);break;case 12:B(g);break;case 13:_(g);break;case 14:w(g);break;case 15:D(g);break;case 16:I(g);break;case 17:N(g);break;case 18:k(g);break;case 19:H(g);break;case 20:V(g);break;default:Pm(f)}l++}h<l&&X();function m(Z){Z==="<"&&U()}function y(Z){Z==="!"?f=13:Z==="/"?(f=2,p=new Rm(js(js({},p),{isClosing:!0}))):Z==="<"?U():ky.test(Z)?(f=3,p=new Rm(js(js({},p),{isOpening:!0}))):(f=0,p=a)}function b(Z){Cu.test(Z)?(p=new Rm(js(js({},p),{name:te()})),f=4):Z==="<"?U():Z==="/"?(p=new Rm(js(js({},p),{name:te()})),f=12):Z===">"?(p=new Rm(js(js({},p),{name:te()})),q()):!ky.test(Z)&&!Gs.test(Z)&&Z!==":"&&j()}function x(Z){Z===">"?j():ky.test(Z)?f=3:j()}function A(Z){Cu.test(Z)||(Z==="/"?f=12:Z===">"?q():Z==="<"?U():Z==="="||kU.test(Z)||wpe.test(Z)?j():f=5)}function E(Z){Cu.test(Z)?f=6:Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():kU.test(Z)&&j()}function S(Z){Cu.test(Z)||(Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():kU.test(Z)?j():f=5)}function v(Z){Cu.test(Z)||(Z==='"'?f=8:Z==="'"?f=9:/[>=`]/.test(Z)?j():Z==="<"?U():f=10)}function P(Z){Z==='"'&&(f=11)}function M(Z){Z==="'"&&(f=11)}function R(Z){Cu.test(Z)?f=4:Z===">"?q():Z==="<"&&U()}function L(Z){Cu.test(Z)?f=4:Z==="/"?f=12:Z===">"?q():Z==="<"?U():(f=4,K())}function B(Z){Z===">"?(p=new Rm(js(js({},p),{isClosing:!0})),q()):f=4}function _(Z){e.substr(l,2)==="--"?(l+=2,p=new Rm(js(js({},p),{type:"comment"})),f=14):e.substr(l,7).toUpperCase()==="DOCTYPE"?(l+=7,p=new Rm(js(js({},p),{type:"doctype"})),f=20):j()}function w(Z){Z==="-"?f=15:Z===">"?j():f=16}function D(Z){Z==="-"?f=18:Z===">"?j():f=16}function I(Z){Z==="-"&&(f=17)}function N(Z){Z==="-"?f=18:f=16}function k(Z){Z===">"?q():Z==="!"?f=19:Z==="-"||(f=16)}function H(Z){Z==="-"?f=17:Z===">"?q():f=16}function V(Z){Z===">"?q():Z==="<"&&U()}function j(){f=0,p=a}function U(){f=1,p=new Rm({idx:l})}function q(){var Z=e.slice(h,p.idx);Z&&o(Z,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)),j(),h=l+1}function X(){var Z=e.slice(h,l);o(Z,h),h=l+1}function te(){var Z=p.idx+(p.isClosing?2:1);return e.slice(Z,l).toLowerCase()}function K(){l--}}var Rm=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 wot=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=vot(t.urls),this.email=Au(t.email)?t.email:this.email,this.phone=Au(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Au(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Dot(t.stripPrefix),this.stripTrailingSlash=Au(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Au(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Kpe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&qpe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Pot(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 n_e(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var l=/( | |<|<|>|>|"|"|')/gi,u=s.split(l),f=a;u.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,f);r.push.apply(r,g)}f+=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(l,u){return l.getOffset()-u.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||By(t,function(n){return n.getType()==="hashtag"}),this.email||By(t,function(n){return n.getType()==="email"}),this.phone||By(t,function(n){return n.getType()==="phone"}),this.mention||By(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||By(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||By(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||By(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=t_e(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,"<").replace(/>/g,">"));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 UU)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Rpe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Cpe,e}(),i_e=wot;function vot(e){return e==null&&(e=!0),Au(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Au(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Au(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Au(e.ipV4Matches)?e.ipV4Matches:!0}}function Dot(e){return e==null&&(e=!0),Au(e)?{scheme:e,www:e}:{scheme:Au(e.scheme)?e.scheme:!0,www:Au(e.www)?e.www:!0}}function Pot(e){return typeof e=="number"?{length:e,location:"end"}:Epe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var WU=i_e;var d_e;typeof DOMParser<"u"&&(d_e=new DOMParser);var Iot=new WU({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),qU=32,o_e=2414016,r_e=1,s_e=16093e3,a_e=.1,Oot=[null,void 0,"http://www.topografix.com/GPX/1/1"],Ao={gpx:Oot};function Rot(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 gY(e,t){let n=IP(e,"id");return n=c(n)?n:jn(),t.getOrCreateEntity(n)}function yY(e){let t=c_e(e,"lon"),n=c_e(e,"lat"),i=DP(e,"ele",Ao.gpx);return d.fromDegrees(t,n,i)}function c_e(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function IP(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Uy(e,t,n){if(!c(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 bY(e,t,n){if(!c(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 DP(e,t,n){let i=Uy(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Bl(e,t,n){let i=Uy(e,t,n);if(c(i))return i.textContent.trim()}function h_e(e){let t=new wc;return t.width=qU,t.height=qU,t.scaleByDistance=new Bt(o_e,r_e,s_e,a_e),t.pixelOffsetScaleByDistance=new Bt(o_e,r_e,s_e,a_e),t.verticalOrigin=new Xn(Fn.BOTTOM),t.image=e,t}function Mot(){let e=new Bh;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Ko.FILL_AND_OUTLINE,e}function m_e(e){let t=new Oc;return t.width=4,t.material=new qb,t.material.color=c(e)?e:G.RED,t.material.outlineWidth=2,t.material.outlineColor=G.BLACK,t}var l_e={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"}},PP;typeof document<"u"&&(PP=document.createElement("div"));function xY(e,t){let n,i="",o=Object.keys(l_e),r=o.length;for(n=0;n<r;n++){let f=o[n],h=l_e[f];h.value=Bl(e,h.tag,Ao.gpx)??"",c(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!c(i)||i==="")return;i=Iot.link(i),PP.innerHTML=i;let s=PP.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=G.WHITE,l=G.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${l.toCssColorString()};`,u+='">',u+=`${PP.innerHTML}</div>`,PP.innerHTML="",u}function p_e(e,t,n,i){let o=yY(t),r=gY(t,n);r.position=o;let s=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,qU);r.billboard=h_e(s);let a=Bl(t,"name",Ao.gpx);r.name=a,r.label=Mot(),r.label.text=a,r.description=xY(t,r),i.clampToGround&&(r.billboard.heightReference=qe.CLAMP_TO_GROUND,r.label.heightReference=qe.CLAMP_TO_GROUND)}function Lot(e,t,n,i){let o=gY(t,n);o.description=xY(t,o);let r=bY(t,"rtept",Ao.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)p_e(e,r[a],n,i),s[a]=yY(r[a]);o.polyline=m_e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Not(e,t,n,i){let o=gY(t,n);o.description=xY(t,o);let r=bY(t,"trkseg",Ao.gpx),s=[],a=[],l,u=!0,f=new Ia;for(let h=0;h<r.length;h++)l=Fot(r[h]),s=s.concat(l.positions),l.times.length>0?(a=a.concat(l.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,qU);o.billboard=h_e(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=qe.CLAMP_TO_GROUND),o.availability=new Xr,o.availability.addInterval(new Sn({start:a[0],stop:a[a.length-1]}))}o.polyline=m_e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Fot(e){let t={positions:[],times:[]},n=bY(e,"trkpt",Ao.gpx),i;for(let o=0;o<n.length;o++){let r=yY(n[o]);t.positions.push(r),i=Bl(n[o],"time",Ao.gpx),c(i)&&t.times.push(Q.fromIso8601(i))}return t}function Bot(e){let t=Uy(e,"metadata",Ao.gpx);if(c(t)){let n={name:Bl(t,"name",Ao.gpx),desc:Bl(t,"desc",Ao.gpx),author:kot(t),copyright:Vot(t),link:__e(t),time:Bl(t,"time",Ao.gpx),keywords:Bl(t,"keywords",Ao.gpx),bounds:zot(t)};if(c(n.name)||c(n.desc)||c(n.author)||c(n.copyright)||c(n.link)||c(n.time)||c(n.keywords)||c(n.bounds))return n}}function kot(e){let t=Uy(e,"author",Ao.gpx);if(c(t)){let n={name:Bl(t,"name",Ao.gpx),email:Uot(t),link:__e(t)};if(c(n.name)||c(n.email)||c(n.link))return n}}function Uot(e){let t=Uy(e,"email",Ao.gpx);if(c(t)){let n=Bl(t,"id",Ao.gpx),i=Bl(t,"domain",Ao.gpx);return`${n}@${i}`}}function __e(e){let t=Uy(e,"link",Ao.gpx);if(c(t)){let n={href:IP(t,"href"),text:Bl(t,"text",Ao.gpx),mimeType:Bl(t,"type",Ao.gpx)};if(c(n.href)||c(n.text)||c(n.mimeType))return n}}function Vot(e){let t=Uy(e,"copyright",Ao.gpx);if(c(t)){let n={author:IP(t,"author"),year:Bl(t,"year",Ao.gpx),license:Bl(t,"license",Ao.gpx)};if(c(n.author)||c(n.year)||c(n.license))return n}}function zot(e){let t=Uy(e,"bounds",Ao.gpx);if(c(t)){let n={minLat:DP(t,"minlat",Ao.gpx),maxLat:DP(t,"maxlat",Ao.gpx),minLon:DP(t,"minlon",Ao.gpx),maxLon:DP(t,"maxlon",Ao.gpx)};if(c(n.minLat)||c(n.maxLat)||c(n.minLon)||c(n.maxLon))return n}}var u_e={wpt:p_e,rte:Lot,trk:Not};function Hot(e,t,n,i){let o=Object.keys(u_e),r=o.length;for(let s=0;s<r;s++){let a=o[s],l=u_e[a],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===a&&Ao.gpx.indexOf(p.namespaceURI)!==-1&&l(e,p,n,i)}}}function f_e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=IP(o,"version"),s=IP(o,"creator"),a,l=Bot(o);c(l)&&(a=l.name),o.localName==="gpx"?Hot(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,g=Q.equals(h,Ge.MINIMUM_VALUE),m=Q.equals(p,Ge.MAXIMUM_VALUE);if(!g||!m){let b;g&&(b=new Date,b.setHours(0,0,0,0),h=Q.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Q.fromDate(b)),u=new pm,u.startTime=h,u.stopTime=p,u.currentTime=Q.clone(h),u.clockRange=$r.LOOP_STOP,u.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,h)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),Got(e._metadata,l)&&(e._metadata=l,y=!0),e._version!==r&&(e._version=r,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Kr.setLoading(e,!1),e}function Got(e,t){return!c(e)&&!c(t)?!1:c(e)&&c(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 jot(e,t,n,i){i=i??W.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)r.push(s[l])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Rot(r).then(function(s){let a,l;try{a=d_e.parseFromString(s,"application/xml")}catch(u){l=u.toString()}if(c(l)||a.body||a.documentElement.tagName==="parsererror"){let u=c(l)?l:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new ae(u)}return f_e(e,a,i)}):f_e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function CE(){this._changed=new pe,this._error=new pe,this._loading=new pe,this._clock=void 0,this._entityCollection=new la(this),this._entityCluster=new Lf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Ny}CE.load=function(e,t){return new CE().load(e,t)};Object.defineProperties(CE.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){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}}});CE.prototype.update=function(e){return!0};CE.prototype.load=function(e,t){if(!c(e))throw new C("data is required.");t=t??W.EMPTY_OBJECT,Kr.setLoading(this,!0);let n=this._name,i=this;return jot(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=Q.equals(s,Ge.MINIMUM_VALUE),u=Q.equals(a,Ge.MAXIMUM_VALUE);if(!l||!u){let h;l&&(h=new Date,h.setHours(0,0,0,0),s=Q.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Q.fromDate(h)),o=new pm,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=$r.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Kr.setLoading(i,!1),i}).catch(function(o){return Kr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var YU=CE;function Wot(e,t){this.position=e,this.headingPitchRoll=t}var XU=Wot;var RP=jr(ql(),1);function qot(e,t){this.position=e,this.headingPitchRange=t}var KU=qot;function $U(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new pe,this.tourEnd=new pe,this.entryStart=new pe,this.entryEnd=new pe,this._activeEntries=[]}$U.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};$U.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;y_e.call(this,e,t,function(i){n.playlistIndex=0,i||g_e(n._activeEntries),n.tourEnd.raiseEvent(i)})};$U.prototype.stop=function(){g_e(this._activeEntries)};function g_e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function y_e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Yot.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 c(n)&&n(!1)}function Yot(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++,y_e.call(this,e,t,n)}}var ZU=$U;var Pi=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-Pi.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?Pi.Bounce.In(e*2)*.5:Pi.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}}}}),OP=function(){return performance.now()},Xot=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=OP()),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}(),EE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=EE.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=EE.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=EE.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=EE.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,l=o*a;return(2*t-2*n+r+s)*l+(-3*t+3*n-2*r-s)*a+r*o+t}}},b_e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),TY=new Xot,x_e=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=Pi.Linear.None,this._interpolationFunction=EE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=b_e.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=TY,TY.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=OP()),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],l=Array.isArray(a),u=l?"array":typeof a,f=!l&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,m=h.length;g<m;g+=1){var y=this._handleRelativeValue(a,h[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||l)&&a&&!f){n[s]=l?[]:{};var b=a;for(var x in b)n[s][x]=b[x];o[s]=l?[]:{};var h=i[s];if(!this._isDynamic){var A={};for(var x in h)A[x]=h[x];i[s]=h=A}this._setupProperties(b,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),l||(n[s]*=1),f?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=OP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=OP()),!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=Pi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=EE.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=OP()),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),l=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>l)return 1;var y=Math.trunc(s/a),b=s-y*a,x=Math.min(b/i._duration,1);return x===0&&s===i._duration?1:x},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),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,m=this._chainedTweens.length;g<m;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],l=Array.isArray(t[r]),u=Array.isArray(a),f=!l&&u;f?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 Mli=b_e.nextId,Mm=TY,Lli=Mm.getAll.bind(Mm),Nli=Mm.removeAll.bind(Mm),Fli=Mm.add.bind(Mm),Bli=Mm.remove.bind(Mm),kli=Mm.update.bind(Mm);var Kot={LINEAR_NONE:Pi.Linear.None,QUADRATIC_IN:Pi.Quadratic.In,QUADRATIC_OUT:Pi.Quadratic.Out,QUADRATIC_IN_OUT:Pi.Quadratic.InOut,CUBIC_IN:Pi.Cubic.In,CUBIC_OUT:Pi.Cubic.Out,CUBIC_IN_OUT:Pi.Cubic.InOut,QUARTIC_IN:Pi.Quartic.In,QUARTIC_OUT:Pi.Quartic.Out,QUARTIC_IN_OUT:Pi.Quartic.InOut,QUINTIC_IN:Pi.Quintic.In,QUINTIC_OUT:Pi.Quintic.Out,QUINTIC_IN_OUT:Pi.Quintic.InOut,SINUSOIDAL_IN:Pi.Sinusoidal.In,SINUSOIDAL_OUT:Pi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Pi.Sinusoidal.InOut,EXPONENTIAL_IN:Pi.Exponential.In,EXPONENTIAL_OUT:Pi.Exponential.Out,EXPONENTIAL_IN_OUT:Pi.Exponential.InOut,CIRCULAR_IN:Pi.Circular.In,CIRCULAR_OUT:Pi.Circular.Out,CIRCULAR_IN_OUT:Pi.Circular.InOut,ELASTIC_IN:Pi.Elastic.In,ELASTIC_OUT:Pi.Elastic.Out,ELASTIC_IN_OUT:Pi.Elastic.InOut,BACK_IN:Pi.Back.In,BACK_OUT:Pi.Back.Out,BACK_IN_OUT:Pi.Back.InOut,BOUNCE_IN:Pi.Bounce.In,BOUNCE_OUT:Pi.Bounce.Out,BOUNCE_IN_OUT:Pi.Bounce.InOut},Qr=Object.freeze(Kot);function QU(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}QU.prototype.play=function(e,t,n){if(this.activeCamera=t,c(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(c(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)}};QU.prototype.stop=function(){c(this.activeCamera)&&this.activeCamera.cancelFlight(),c(this.activeCallback)&&this.activeCallback(!0)};QU.prototype.getCameraOptions=function(e){let t={duration:this.duration};return c(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Qr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),c(e)&&(t=xt(t,e)),t};var JU=QU;function AY(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}AY.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};AY.prototype.stop=function(){clearTimeout(this.timeout),c(this.activeCallback)&&this.activeCallback(!0)};var eV=AY;var I_e={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=uT(t),I_e[t]}},PY;typeof DOMParser<"u"&&(PY=new DOMParser);var $ot=new WU({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Vy=32,T_e=2414016,A_e=1,C_e=16093e3,E_e=.1,S_e=[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"],w_e=["http://www.google.com/kml/ext/2.2"],Zot=["http://www.w3.org/2005/Atom"],Re={kml:S_e,gx:w_e,atom:Zot,kmlgx:S_e.concat(w_e)},IY={Document:V_e,Folder:_rt,Placemark:grt,NetworkLink:wrt,GroundOverlay:Crt,PhotoOverlay:G_e,ScreenOverlay:Art,Tour:brt};function Lm(e){this._dataSource=e,this._deferred=Yl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Lm.prototype,{dataSource:{get:function(){return this._dataSource}}});Lm.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Lm.prototype.addPromise=function(e){this._promises.push(e)};Lm.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Lm.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=wu._getTimestamp()),this._process(e)};Lm.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=wu._getTimestamp(),e._process(!0)},0)};Lm.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]};Lm.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Lm.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;c(i);){let o=IY[i.localName];if(c(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||wu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Qot(e){let t=e.slice(0,Math.min(4,e.size)),n=Yl(),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 Jot(e){let t=Yl(),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 O_e(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&&(c(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return c(n)&&(e=n+i),e}function R_e(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 ert(e,t){return Promise.resolve(e.getData(new hU)).then(function(n){n=O_e(n),n=R_e(n),t.kml=PY.parseFromString(n,"application/xml")})}function CY(e,t){let n=I_e.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new fU(n))).then(function(i){t[e.filename]=i})}function Eu(e,t,n,i){let o=i.keys,r=new RP.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let l=s[a],u=l.getAttribute(n);if(c(u)){let h=new RP.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let g=o[p];l.setAttribute(n,i[g]),t==="a"&&l.getAttribute("download")===null&&l.setAttribute("download",g)}}}}function Su(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),l=OY(a,i);c(l)&&s.setAttribute(n,l.url)}}function M_e(e,t,n){let i=Ss(e,"id");i=c(i)&&i.length!==0?i:jn(),c(n)&&(i=n+i);let o=t.getById(i);return c(o)&&(i=jn(),c(n)&&(i=n+i)),o=t.add(new rr({id:i})),c(o.kml)||(o.addProperty("kml"),o.kml=new Irt),o}function MP(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function oV(e,t){if(!c(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!c(n))return d.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,d.fromDegrees(i,o,r,t)}function tV(e,t){if(!c(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!c(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=oV(n[s],t);return o}function zy(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ss(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ii(e,t,n){if(!c(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 v_e(e,t,n){if(!c(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 th(e,t,n){if(!c(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 $n(e,t,n){let i=Ii(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Dn(e,t,n){let i=Ii(e,t,n);if(c(i))return i.textContent.trim()}function nh(e,t,n){let i=Ii(e,t,n);if(c(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function OY(e,t,n){if(!c(e))return;let i;if(c(n)){e=e.replace(/\\/g,"/");let o=n[e];if(c(o))i=new we({url:o});else{let r=new RP.default(t.getUrlComponent()),s=new RP.default(e);o=n[s.absoluteTo(r)],c(o)&&(i=new we({url:o}))}}return c(i)||(i=t.getDerivedResource({url:e})),i}var kl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function vY(e,t){if(!c(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?(kl.maximumRed=r,kl.red=void 0):(kl.maximumRed=void 0,kl.red=0),o>0?(kl.maximumGreen=o,kl.green=void 0):(kl.maximumGreen=void 0,kl.green=0),i>0?(kl.maximumBlue=i,kl.blue=void 0):(kl.maximumBlue=void 0,kl.blue=0),kl.alpha=n,G.fromRandom(kl)):new G(r,o,i,n)}function mx(e,t,n){let i=Dn(e,t,n);if(c(i))return vY(i,Dn(e,"colorMode",n)==="random")}function trt(e){let t=Ii(e,"TimeStamp",Re.kmlgx),n=Dn(t,"when",Re.kmlgx);if(!c(t)||!c(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Xr;return o.addInterval(new Sn({start:i,stop:Ge.MAXIMUM_VALUE})),o}function nrt(e){let t=Ii(e,"TimeSpan",Re.kmlgx);if(!c(t))return;let n,i=Ii(t,"begin",Re.kmlgx),o=c(i)?Q.fromIso8601(i.textContent):void 0,r=Ii(t,"end",Re.kmlgx),s=c(r)?Q.fromIso8601(r.textContent):void 0;if(c(o)&&c(s)){if(Q.lessThan(s,o)){let a=o;o=s,s=a}n=new Xr,n.addInterval(new Sn({start:o,stop:s}))}else c(o)?(n=new Xr,n.addInterval(new Sn({start:o,stop:Ge.MAXIMUM_VALUE}))):c(s)&&(n=new Xr,n.addInterval(new Sn({start:Ge.MINIMUM_VALUE,stop:s})));return n}function L_e(){let e=new wc;return e.width=Vy,e.height=Vy,e.scaleByDistance=new Bt(T_e,A_e,C_e,E_e),e.pixelOffsetScaleByDistance=new Bt(T_e,A_e,C_e,E_e),e}function RY(){let e=new kh;return e.outline=!0,e.outlineColor=G.WHITE,e}function N_e(){let e=new Bh;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Ko.FILL_AND_OUTLINE,e}function MY(e,t,n,i,o){let r=Dn(e,"href",Re.kml);if(!c(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),l=$n(e,"x",Re.gx)??0,u=$n(e,"y",Re.gx)??0;l=Math.min(l/32,7),u=7-Math.min(u/32,7);let f=8*u+l;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=OY(r,n,i);if(o){let a=Dn(e,"refreshMode",Re.kml),l=Dn(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?dt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(l==="onStop"||l==="onRegion")&&dt(`kml-refreshMode-${l}`,`KML - Unsupported Icon viewRefreshMode: ${l}`);let u=Dn(e,"viewBoundScale",Re.kml)??1,f=l==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=Dn(e,"viewFormat",Re.kml)??f,p=Dn(e,"httpQuery",Re.kml);c(h)&&s.setQueryParameters(Ku(iV(h))),c(p)&&s.setQueryParameters(Ku(iV(p)));let g=t._ellipsoid;return NY(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function irt(e,t,n,i,o){let r=$n(t,"scale",Re.kml),s=$n(t,"heading",Re.kml),a=mx(t,"color",Re.kml),l=Ii(t,"Icon",Re.kml),u=MY(l,e,i,o,!1);c(l)&&!c(u)&&(u=!1);let f=$n(l,"x",Re.gx),h=$n(l,"y",Re.gx),p=$n(l,"w",Re.gx),g=$n(l,"h",Re.gx),m=Ii(t,"hotSpot",Re.kml),y=zy(m,"x"),b=zy(m,"y"),x=Ss(m,"xunits"),A=Ss(m,"yunits"),E=n.billboard;c(E)||(E=L_e(),n.billboard=E),E.image=u,E.scale=r,E.color=a,(c(f)||c(h)||c(p)||c(g))&&(E.imageSubRegion=new Ke(f,h,p,g)),c(s)&&s!==0&&(E.rotation=O.toRadians(-s),E.alignedAxis=d.UNIT_Z),r=r??1;let S,v;c(y)&&(x==="pixels"?S=-y*r:x==="insetPixels"?S=(y-Vy)*r:x==="fraction"&&(S=-y*Vy*r),S+=Vy*.5*r),c(b)&&(A==="pixels"?v=b*r:A==="insetPixels"?v=(-b+Vy)*r:A==="fraction"&&(v=b*Vy*r),v-=Vy*.5*r),(c(S)||c(v))&&(E.pixelOffset=new z(S,v))}function nV(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")irt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let l=n.label;c(l)||(l=N_e(),n.label=l),l.scale=$n(a,"scale",Re.kml)??l.scale,l.fillColor=mx(a,"color",Re.kml)??l.fillColor,l.text=n.name}else if(a.localName==="LineStyle"){let l=n.polyline;c(l)||(l=new Oc,n.polyline=l),l.width=$n(a,"width",Re.kml),l.material=mx(a,"color",Re.kml),c(mx(a,"outerColor",Re.gx))&&dt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c($n(a,"outerWidth",Re.gx))&&dt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c($n(a,"physicalWidth",Re.gx))&&dt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(nh(a,"labelVisibility",Re.gx))&&dt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let l=n.polygon;c(l)||(l=RY(),n.polygon=l),l.material=mx(a,"color",Re.kml)??l.material,l.fill=nh(a,"fill",Re.kml)??l.fill,l.outline=nh(a,"outline",Re.kml)??l.outline}else if(a.localName==="BalloonStyle"){let l=vY(Dn(a,"bgColor",Re.kml))??G.WHITE,u=vY(Dn(a,"textColor",Re.kml))??G.BLACK,f=Dn(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:l,textColor:u,text:f}}else if(a.localName==="ListStyle"){let l=Dn(a,"listItemType",Re.kml);(l==="radioFolder"||l==="checkOffOnly")&&dt(`kml-listStyle-${l}`,`KML - Unsupported ListStyle with listItemType: ${l}`)}}}function ort(e,t,n,i,o){let r=new rr,s,a=-1,l=t.childNodes,u=l.length;for(let h=0;h<u;h++){let p=l[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=l[a];if(h.localName==="Style")nV(e,h,r,i,o);else{let p=th(h,"Pair",Re.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Dn(m,"key",Re.kml);if(y==="normal"){let b=Dn(m,"styleUrl",Re.kml);if(c(b))s=n.getById(b),c(s)||(s=n.getById(`#${b}`)),c(s)&&r.merge(s);else{let x=Ii(m,"Style",Re.kml);nV(e,x,r,i,o)}}else dt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Dn(t,"styleUrl",Re.kml);if(c(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(h),c(s)||(s=n.getById(`#${h}`)),c(s)&&r.merge(s)}return r}function rrt(e,t,n){return t.fetchXML().then(function(i){return F_e(e,i,n,t,!0)})}function F_e(e,t,n,i,o,r){let s,a,l,u,f=v_e(t,"Style",Re.kml);if(c(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Ss(u,"id"),c(a)&&(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),c(n.getById(a))||(l=new rr({id:a}),n.add(l),nV(e,u,l,i,r)))}let h=v_e(t,"StyleMap",Re.kml);if(c(h)){let y=h.length;for(s=0;s<y;s++){let b=h[s];if(a=Ss(b,"id"),c(a)){let x=th(b,"Pair",Re.kml);for(let A=0;A<x.length;A++){let E=x[A],S=Dn(E,"key",Re.kml);if(S==="normal"){if(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),!c(n.getById(a))){l=n.getOrCreateEntity(a);let v=Dn(E,"styleUrl",Re.kml);if(c(v)){v[0]!=="#"&&(v=`#${v}`),o&&c(i)&&(v=i.getUrlComponent()+v);let P=n.getById(v);c(P)&&l.merge(P)}else u=Ii(E,"Style",Re.kml),nV(e,u,l,i,r)}}else dt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let b=y.split("#");if(b.length===2){let x=b[0],A=i.getDerivedResource({url:x});p.push(rrt(e,A,n))}}}return p}function LY(e,t,n){let i=new dy(e,t.id,["position"]),o=new f_(t.position);t.polyline=c(n.polyline)?n.polyline.clone():new Oc,t.polyline.positions=new uy([i,o])}function B_e(e,t){return!c(e)&&!c(t)||e==="clampToGround"?qe.CLAMP_TO_GROUND:e==="relativeToGround"?qe.RELATIVE_TO_GROUND:e==="absolute"?qe.NONE:t==="clampToSeaFloor"?(dt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(dt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),qe.RELATIVE_TO_GROUND):(c(e)?dt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):dt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),qe.CLAMP_TO_GROUND)}function srt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new f_(e))}function art(e,t,n,i){if(!c(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function rV(e,t,n,i){let o=t.label;c(o)||(o=c(n.label)?n.label.clone():N_e(),t.label=o),o.text=t.name;let r=t.billboard;c(r)||(r=c(n.billboard)?n.billboard.clone():L_e(),t.billboard=r),c(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(G.YELLOW,64);let s=1;c(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new z(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function k_e(e,t){let n=e.path;c(n)||(n=new ig,n.leadTime=0,e.path=n);let i=t.polyline;c(i)&&(n.material=i.material,n.width=i.width)}function crt(e,t,n,i,o){let r=Dn(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),l=nh(n,"extrude",Re.kml),u=e._ellipsoid,f=oV(r,u);return i.position=f,rV(e,i,o,B_e(s,a)),l&&MP(s,a)&&LY(t,i,o),!0}function D_e(e,t,n,i,o){let r=Ii(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),l=nh(n,"extrude",Re.kml),u=nh(n,"tessellate",Re.kml),f=MP(s,a),h=$n(n,"drawOrder",Re.gx),p=e._ellipsoid,g=tV(r,p),m=o.polyline;if(f&&l){let y=new og;i.wall=y,y.positions=g;let b=o.polygon;c(b)&&(y.fill=b.fill,y.material=b.material),y.outline=!0,c(m)?(y.outlineColor=c(m.material)?m.material.color:G.WHITE,y.outlineWidth=m.width):c(b)&&(y.outlineColor=c(b.material)?b.material.color:G.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Oc;y.clampToGround=!0,i.polyline=y,y.positions=g,c(m)?(y.material=c(m.material)?m.material.color.getValue(Ge.MINIMUM_VALUE):G.WHITE,y.width=m.width??1):(y.material=G.WHITE,y.width=1),y.zIndex=h}else c(h)&&dt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&dt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=c(m)?m.clone():new Oc,i.polyline=m,m.positions=art(g,s,a,p),(!u||f)&&(m.arcType=qt.NONE);return!0}function lrt(e,t,n,i,o){let r=Ii(n,"outerBoundaryIs",Re.kml),s=Ii(r,"LinearRing",Re.kml),a=Ii(s,"coordinates",Re.kml),l=e._ellipsoid,u=tV(a,l),f=nh(n,"extrude",Re.kml),h=Dn(n,"altitudeMode",Re.kml),p=Dn(n,"altitudeMode",Re.gx),g=MP(h,p),m=c(o.polygon)?o.polygon.clone():RY(),y=o.polyline;if(c(y)&&(m.outlineColor=c(y.material)?y.material.color:G.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),c(u)){let b=new ec(u),x=th(n,"innerBoundaryIs",Re.kml);for(let A=0;A<x.length;A++){s=th(x[A],"LinearRing",Re.kml);for(let E=0;E<s.length;E++)a=Ii(s[E],"coordinates",Re.kml),u=tV(a,l),c(u)&&b.holes.push(new ec(u))}m.hierarchy=b}return!0}function urt(e,t,n,i,o){let r=Dn(n,"altitudeMode",Re.kml),s=Dn(n,"altitudeMode",Re.gx),a=th(n,"coord",Re.gx),l=th(n,"angles",Re.gx),u=th(n,"when",Re.kml),f=nh(n,"extrude",Re.kml),h=MP(r,s),p=e._ellipsoid;l.length>0&&dt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let x=0;x<g;x++){let A=oV(a[x].textContent,p);m.push(A),y.push(Q.fromIso8601(u[x].textContent))}let b=new Ia;return b.addSamples(y,m),i.position=b,rV(e,i,o,B_e(r,s)),k_e(i,o),i.availability=new Xr,u.length>0&&i.availability.addInterval(new Sn({start:y[0],stop:y[y.length-1]})),h&&f&&LY(t,i,o),!0}function P_e(e,t,n,i,o,r,s,a,l){let u=e[0],f=e[e.length-1],h=new Ia;h.addSamples(e,t),n.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:srt(h,s,a)})),i.addInterval(new Sn({start:u,stop:f,isStartIncluded:l,isStopIncluded:l})),o.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:r}))}function frt(e,t,n,i,o){let r=nh(n,"interpolate",Re.gx),s=th(n,"Track",Re.gx),a,l,u,f=!1,h=new py,p=new Xr,g=new Pa,m=e._ellipsoid;for(let y=0,b=s.length;y<b;y++){let x=s[y],A=th(x,"when",Re.kml),E=th(x,"coord",Re.gx),S=Dn(x,"altitudeMode",Re.kml),v=Dn(x,"altitudeMode",Re.gx),P=MP(S,v),M=nh(x,"extrude",Re.kml),R=Math.min(E.length,A.length),L=[];a=[];for(let B=0;B<R;B++){let _=oV(E[B].textContent,m);L.push(_),a.push(Q.fromIso8601(A[B].textContent))}r&&(c(l)&&P_e([l,a[0]],[u,L[0]],g,p,h,!1,"absolute",void 0,!1),l=a[R-1],u=L[L.length-1]),P_e(a,L,g,p,h,P&&M,S,v,!0),f=f||P&&M}return i.availability=p,i.position=g,rV(e,i,o),k_e(i,o),f&&(LY(t,i,o),i.polyline.show=h),!0}var U_e={Point:crt,LineString:D_e,LinearRing:D_e,Polygon:lrt,Track:urt,MultiTrack:frt,MultiGeometry:drt,Model:hrt};function drt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let l=0,u=s.length;l<u;l++){let f=s.item(l),h=U_e[f.localName];if(c(h)){let p=M_e(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(a=!0)}}return a}function hrt(e,t,n,i,o){return dt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function mrt(e,t){let n=Ii(e,"ExtendedData",Re.kml);if(!c(n))return;c(Ii(n,"SchemaData",Re.kml))&&dt("kml-schemaData","KML - SchemaData is unsupported"),c(Ss(n,"xmlns:prefix"))&&dt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=th(n,"Data",Re.kml);if(c(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],l=Ss(a,"name");c(l)&&(i[l]={displayName:Dn(a,"displayName",Re.kml),value:Dn(a,"value",Re.kml)})}}t.kml.extendedData=i}var lo;typeof document<"u"&&(lo=document.createElement("div"));function prt(e,t,n,i,o){let r,s,a,l=t.kml,u=l.extendedData,f=Dn(e,"description",Re.kml),h=t.balloonStyle??n.balloonStyle,p=G.WHITE,g=G.BLACK,m=f;c(h)&&(p=h.bgColor??G.WHITE,g=h.textColor??G.BLACK,m=h.text??f);let y;if(c(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",l.address??""),m=m.replace("$[Snippet]",l.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),c(u)){let A=m.match(/\$\[.+?\]/g);if(A!==null)for(r=0;r<A.length;r++){let E=A[r],S=E.substr(2,E.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),y=u[S],c(y)&&(y=v?y.displayName:y.value),c(y)&&(m=m.replace(E,y??""))}}}else if(c(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!c(m))return;m=$ot.link(m),lo.innerHTML=m;let b=lo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(Eu(lo,"a","href",i),Eu(lo,"link","href",i),Eu(lo,"area","href",i),Eu(lo,"img","src",i),Eu(lo,"iframe","src",i),Eu(lo,"video","src",i),Eu(lo,"audio","src",i),Eu(lo,"source","src",i),Eu(lo,"track","src",i),Eu(lo,"input","src",i),Eu(lo,"embed","src",i),Eu(lo,"script","src",i),Eu(lo,"video","poster",i)),Su(lo,"a","href",o),Su(lo,"link","href",o),Su(lo,"area","href",o),Su(lo,"img","src",o),Su(lo,"iframe","src",o),Su(lo,"video","src",o),Su(lo,"audio","src",o),Su(lo,"source","src",o),Su(lo,"track","src",o),Su(lo,"input","src",o),Su(lo,"embed","src",o),Su(lo,"script","src",o),Su(lo,"video","poster",o);let x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+=`background-color:${p.toCssColorString()};`,x+=`color:${g.toCssColorString()};`,x+='">',x+=`${lo.innerHTML}</div>`,lo.innerHTML="",t.description=x}function sV(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=M_e(t,i,n.context),l=a.kml,u=ort(e,t,n.styleCollection,r,s),f=Dn(t,"name",Re.kml);a.name=f,a.parent=o;let h=nrt(t);c(h)||(h=trt(t)),a.availability=h,BY(a);function p(E){return E?E.show&&p(E.parent):!0}let g=nh(t,"visibility",Re.kml);a.show=p(o)&&(g??!0);let m=Ii(t,"author",Re.atom),y=l.author;y.name=Dn(m,"name",Re.atom),y.uri=Dn(m,"uri",Re.atom),y.email=Dn(m,"email",Re.atom);let b=Ii(t,"link",Re.atom),x=l.link;x.href=Ss(b,"href"),x.hreflang=Ss(b,"hreflang"),x.rel=Ss(b,"rel"),x.type=Ss(b,"type"),x.title=Ss(b,"title"),x.length=Ss(b,"length"),l.address=Dn(t,"address",Re.kml),l.phoneNumber=Dn(t,"phoneNumber",Re.kml),l.snippet=Dn(t,"Snippet",Re.kml),mrt(t,a),prt(t,a,u,s,r);let A=e._ellipsoid;return H_e(t,a,A),z_e(t,a,A),c(Ii(t,"Region",Re.kml))&&dt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function V_e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function _rt(e,t,n,i){let o=sV(e,t,n),r=We(n);r.parentEntity=o.entity,V_e(e,t,r,i)}function grt(e,t,n,i){let o=sV(e,t,n),r=o.entity,s=o.styleEntity,a=!1,l=t.childNodes;for(let u=0,f=l.length;u<f&&!a;u++){let h=l.item(u),p=U_e[h.localName];c(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),rV(e,r,s))}var yrt={FlyTo:Trt,Wait:xrt,SoundCue:EY,AnimatedUpdate:EY,TourControl:EY};function brt(e,t,n,i){let o=Dn(t,"name",Re.kml),r=Ss(t,"id"),s=new ZU(o,r),a=Ii(t,"Playlist",Re.gx);if(a){let l=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=yrt[h.localName];p?p(s,h,l):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function EY(e,t){dt(`KML Tour unsupported node ${t.localName}`)}function xrt(e,t){let n=$n(t,"duration",Re.gx);e.addPlaylistEntry(new eV(n))}function Trt(e,t,n){let i=$n(t,"duration",Re.gx),o=Dn(t,"flyToMode",Re.gx),r={kml:{}};H_e(t,r,n),z_e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new JU(i,o,s);e.addPlaylistEntry(a)}function z_e(e,t,n){let i=Ii(e,"Camera",Re.kml);if(c(i)){let o=$n(i,"longitude",Re.kml)??0,r=$n(i,"latitude",Re.kml)??0,s=$n(i,"altitude",Re.kml)??0,a=$n(i,"heading",Re.kml)??0,l=$n(i,"tilt",Re.kml)??0,u=$n(i,"roll",Re.kml)??0,f=d.fromDegrees(o,r,s,n),h=Xa.fromDegrees(a,l-90,u);t.kml.camera=new XU(f,h)}}function H_e(e,t,n){let i=Ii(e,"LookAt",Re.kml);if(c(i)){let o=$n(i,"longitude",Re.kml)??0,r=$n(i,"latitude",Re.kml)??0,s=$n(i,"altitude",Re.kml)??0,a=$n(i,"heading",Re.kml),l=$n(i,"tilt",Re.kml),u=$n(i,"range",Re.kml)??0;l=O.toRadians(l??0),a=O.toRadians(a??0);let f=new $d(a,l-O.PI_OVER_TWO,u),h=d.fromDegrees(o,r,s,n);t.kml.lookAt=new KU(h,f)}}function Art(e,t,n,i){let o=n.screenOverlayContainer;if(!c(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ii(t,"Icon",Re.kml),l=MY(a,e,r,s,!1);if(!c(l))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=l.url,u.onload=function(){let f=["position: absolute"],h=Ii(t,"screenXY",Re.kml),p=Ii(t,"overlayXY",Re.kml),g=Ii(t,"size",Re.kml),m,y,b,x,A,E;c(g)&&(m=zy(g,"x"),y=zy(g,"y"),b=Ss(g,"xunits"),x=Ss(g,"yunits"),c(m)&&m!==-1&&m!==0&&(b==="fraction"?A=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(A=`width: ${m}px`),f.push(A)),c(y)&&y!==-1&&y!==0&&(x==="fraction"?E=`height: ${Math.floor(y*100)}%`:x==="pixels"&&(E=`height: ${y}px`),f.push(E))),u.style=f.join(";");let S=0,v=u.height;c(p)&&(m=zy(p,"x"),y=zy(p,"y"),b=Ss(p,"xunits"),x=Ss(p,"yunits"),c(m)&&(b==="fraction"?S=m*u.width:(b==="pixels"||b==="insetPixels")&&(S=m)),c(y)&&(x==="fraction"?v=y*u.height:(x==="pixels"||x==="insetPixels")&&(v=y))),c(h)&&(m=zy(h,"x"),y=zy(h,"y"),b=Ss(h,"xunits"),x=Ss(h,"yunits"),c(m)&&(b==="fraction"?A=`left: calc(${Math.floor(m*100)}% - ${S}px)`:b==="pixels"?A=`left: ${m-S}px`:b==="insetPixels"&&(A=`right: ${m-S}px`),f.push(A)),c(y)&&(x==="fraction"?E=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:x==="pixels"?E=`bottom: ${y-v}px`:x==="insetPixels"&&(E=`top: ${y-v}px`),f.push(E))),u.style=f.join(";")},o.appendChild(u)}function Crt(e,t,n,i){let r=sV(e,t,n).entity,s,a=!1,l=e._ellipsoid,u=tV(Ii(t,"LatLonQuad",Re.gx),l),f=$n(t,"drawOrder",Re.kml);if(c(u))s=RY(),s.hierarchy=new ec(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new Uh,s.zIndex=f,r.rectangle=s;let m=Ii(t,"LatLonBox",Re.kml);if(c(m)){let y=$n(m,"west",Re.kml),b=$n(m,"south",Re.kml),x=$n(m,"east",Re.kml),A=$n(m,"north",Re.kml);c(y)&&(y=O.negativePiToPi(O.toRadians(y))),c(b)&&(b=O.clampToLatitudeRange(O.toRadians(b))),c(x)&&(x=O.negativePiToPi(O.toRadians(x))),c(A)&&(A=O.clampToLatitudeRange(O.toRadians(A))),s.coordinates=new ce(y,b,x,A);let E=$n(m,"rotation",Re.kml);if(c(E)){let S=O.toRadians(E);s.rotation=S,s.stRotation=S}}}let h=Ii(t,"Icon",Re.kml),p=MY(h,e,n.sourceResource,n.uriResolver,!0);if(c(p)){a&&dt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=$n(h,"x",Re.gx),y=$n(h,"y",Re.gx),b=$n(h,"w",Re.gx),x=$n(h,"h",Re.gx);(c(m)||c(y)||c(b)||c(x))&&dt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=mx(t,"color",Re.kml),s.material.transparent=!0}else s.material=mx(t,"color",Re.kml);let g=Dn(t,"altitudeMode",Re.kml);c(g)?g==="absolute"?(s.height=$n(t,"altitude",Re.kml),s.zIndex=void 0):g!=="clampToGround"&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Dn(t,"altitudeMode",Re.gx),g==="relativeToSeaFloor"?(dt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=$n(t,"altitude",Re.kml),s.zIndex=void 0):g==="clampToSeaFloor"?dt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(g)&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function G_e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),dt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Hy={INTERVAL:0,EXPIRE:1,STOP:2};function iV(e){if(!c(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Ert=new ce,SE=new he,SY=new z,Srt=new d;function NY(e,t,n,i,o,r){function s(u){return u<-O.PI_OVER_TWO?-O.PI_OVER_TWO:u>O.PI_OVER_TWO?O.PI_OVER_TWO:u}function a(u){return u>O.PI?u-O.TWO_PI:u<-O.PI?u+O.TWO_PI:u}let l=hT(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??Ert,c(n)&&(SY.x=n.clientWidth*.5,SY.y=n.clientHeight*.5,u=t.pickEllipsoid(SY,r,Srt)),c(u)?f=r.cartesianToCartographic(u,SE):(f=ce.center(o,SE),u=r.cartographicToCartesian(f)),c(i)&&!O.equalsEpsilon(i,1,O.EPSILON9)){let x=o.width*i*.5,A=o.height*i*.5;o=new ce(a(f.longitude-x),s(f.latitude-A),a(f.longitude+x),s(f.latitude+A))}l=l.replace("[bboxWest]",O.toDegrees(o.west).toString()),l=l.replace("[bboxSouth]",O.toDegrees(o.south).toString()),l=l.replace("[bboxEast]",O.toDegrees(o.east).toString()),l=l.replace("[bboxNorth]",O.toDegrees(o.north).toString());let h=O.toDegrees(f.longitude).toString(),p=O.toDegrees(f.latitude).toString();l=l.replace("[lookatLon]",h),l=l.replace("[lookatLat]",p),l=l.replace("[lookatTilt]",O.toDegrees(t.pitch).toString()),l=l.replace("[lookatHeading]",O.toDegrees(t.heading).toString()),l=l.replace("[lookatRange]",d.distance(t.positionWC,u)),l=l.replace("[lookatTerrainLon]",h),l=l.replace("[lookatTerrainLat]",p),l=l.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,SE),l=l.replace("[cameraLon]",O.toDegrees(SE.longitude).toString()),l=l.replace("[cameraLat]",O.toDegrees(SE.latitude).toString()),l=l.replace("[cameraAlt]",O.toDegrees(SE.height).toString());let g=t.frustum,m=g.aspectRatio,y="",b="";if(c(m)){let x=O.toDegrees(g.fov);m>1?(y=x,b=x/m):(b=x,y=x*m)}l=l.replace("[horizFov]",y.toString()),l=l.replace("[vertFov]",b.toString())}else l=l.replace("[bboxWest]","-180"),l=l.replace("[bboxSouth]","-90"),l=l.replace("[bboxEast]","180"),l=l.replace("[bboxNorth]","90"),l=l.replace("[lookatLon]",""),l=l.replace("[lookatLat]",""),l=l.replace("[lookatRange]",""),l=l.replace("[lookatTilt]",""),l=l.replace("[lookatHeading]",""),l=l.replace("[lookatTerrainLon]",""),l=l.replace("[lookatTerrainLat]",""),l=l.replace("[lookatTerrainAlt]",""),l=l.replace("[cameraLon]",""),l=l.replace("[cameraLat]",""),l=l.replace("[cameraAlt]",""),l=l.replace("[horizFov]",""),l=l.replace("[vertFov]","");c(n)?(l=l.replace("[horizPixels]",n.clientWidth),l=l.replace("[vertPixels]",n.clientHeight)):(l=l.replace("[horizPixels]",""),l=l.replace("[vertPixels]","")),l=l.replace("[terrainEnabled]","1"),l=l.replace("[clientVersion]","1"),l=l.replace("[kmlVersion]","2.2"),l=l.replace("[clientName]","Cesium"),l=l.replace("[language]","English"),e.setQueryParameters(Ku(l))}function wrt(e,t,n,i){let r=sV(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,l=Ii(t,"Link",Re.kml);if(c(l)||(l=Ii(t,"Url",Re.kml)),c(l)){let u=Dn(l,"href",Re.kml),f,h;if(c(u)){let p=u;if(u=OY(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Dn(l,"viewRefreshMode",Re.kml),f==="onRegion"){dt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=Dn(l,"viewBoundScale",Re.kml)??1;let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",x=Dn(l,"viewFormat",Re.kml)??b,A=Dn(l,"httpQuery",Re.kml);c(x)&&u.setQueryParameters(Ku(iV(x))),c(A)&&u.setQueryParameters(Ku(iV(A)));let E=e._ellipsoid;NY(u,e.camera,e.canvas,h,e._lastCameraView.bbox,E)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new la,y=FY(e,m,u,g).then(function(b){let x=e._entityCollection,A=m.values;x.suspendEvents();for(let v=0;v<A.length;v++){let P=A[v];c(P.parent)||(P.parent=r,BY(P)),x.add(P)}x.resumeEvents();let E=Dn(l,"refreshMode",Re.kml),S=$n(l,"refreshInterval",Re.kml)??0;if(E==="onInterval"&&S>0||E==="onExpire"||f==="onStop"){let v=Ii(b,"NetworkLinkControl",Re.kml),P=c(v),M=Q.now(),R={id:jn(),href:u,cookie:{},lastUpdated:M,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:M},L=0;if(P&&(R.cookie=Ku(Dn(v,"cookie",Re.kml)??""),L=$n(v,"minRefreshPeriod",Re.kml)??0),E==="onInterval")P&&(S=Math.max(L,S)),R.refreshMode=Hy.INTERVAL,R.time=S;else if(E==="onExpire"){let B;if(P&&(B=Dn(v,"expires",Re.kml)),c(B))try{let _=Q.fromIso8601(B),w=Q.secondsDifference(_,M);w>0&&w<L&&Q.addSeconds(M,L,_),R.refreshMode=Hy.EXPIRE,R.time=_}catch{dt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else dt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else c(e.camera)?(R.refreshMode=Hy.STOP,R.time=$n(l,"viewRefreshTime",Re.kml)??0):dt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");c(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){dt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(y)}}}function vrt(e,t,n,i){let o=IY[t.localName];return c(o)?o(e,t,n,i):G_e(e,t,n,i)}function DY(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,l=a.localName==="Document"?a:Ii(a,"Document",Re.kml),u=Dn(l,"name",Re.kml);c(u)||(u=ly(i.getUrlComponent())),c(e._name)||(e._name=u);let f=new wu._DeferredLoading(e),h=new la(e);return Promise.all(F_e(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let b=m[y];if(c(IY[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),vrt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Drt(e,t,n,i,o){let r=tn("ThirdParty/Workers/z-worker-pako.js");mE({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new vU(new p_(n));return Promise.resolve(s.getEntries()).then(function(a){let l=[],u={},f;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!c(f)||!/\//i.test(p.filename))?(c(f)&&l.push(CY(f,u)),f=p):l.push(CY(p,u)))}return c(f)&&l.push(ert(f,u)),Promise.all(l).then(function(){if(s.close(),!c(u.kml))throw new ae("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),DY(e,t,u.kml,i,u,o)})})}function FY(e,t,n,i){i=i??W.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,l=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),l=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(c(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=o??we.DEFAULT.clone();return o=we.createIfNeeded(o),c(a)&&(a=Rn(a)),Promise.resolve(l).then(function(u){return u instanceof Blob?Qot(u).then(function(f){return f?Drt(e,t,u,o,a):Jot(u).then(function(h){h=O_e(h),h=R_e(h);let p,g;try{p=PY.parseFromString(h,"application/xml")}catch(m){g=m.toString()}if(c(g)||p.body||p.documentElement.tagName==="parsererror"){let m=c(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new ae(m)}return DY(e,t,p,o,r,a,s)})}):DY(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function wu(e){e=e??W.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new pe,this._error=new pe,this._loading=new pe,this._refresh=new pe,this._unsupportedNode=new pe,this._clock=void 0,this._entityCollection=new la(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Ny,this._networkLinks=new Et,this._entityCluster=new Lf,this.canvas=n,this.camera=t,this._lastCameraView={position:c(t)?d.clone(t.positionWC):void 0,direction:c(t)?d.clone(t.directionWC):void 0,up:c(t)?d.clone(t.upWC):void 0,bbox:c(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=e.ellipsoid??ie.default;let i=e.credit;typeof i=="string"&&(i=new At(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}wu.load=function(e,t){return t=t??W.EMPTY_OBJECT,new wu(t).load(e,t)};Object.defineProperties(wu.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){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});wu.prototype.load=function(e,t){if(!c(e))throw new C("data is required.");t=t??W.EMPTY_OBJECT,Kr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return FY(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=Q.equals(s,Ge.MINIMUM_VALUE),u=Q.equals(a,Ge.MAXIMUM_VALUE);if(!l||!u){let h;l&&(h=new Date,h.setHours(0,0,0,0),s=Q.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Q.fromDate(h)),o=new pm,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=$r.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Kr.setLoading(i,!1),i}).catch(function(o){return Kr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};wu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function BY(e){let t=e.parent;if(c(t)){let n=t.availability;if(c(n)){let i=e.availability;c(i)?i.intersect(n):e.availability=n}}}function Prt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ii(r,"NetworkLinkControl",Re.kml),l=c(a),u=0;if(l){if(c(Ii(a,"Update",Re.kml))){dt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ku(Dn(a,"cookie",Re.kml)??""),u=$n(a,"minRefreshPeriod",Re.kml)??0}let f=Q.now(),h=t.refreshMode;if(h===Hy.INTERVAL)c(a)&&(t.time=Math.max(u,t.time));else if(h===Hy.EXPIRE){let M;if(c(a)&&(M=Dn(a,"expires",Re.kml)),c(M))try{let R=Q.fromIso8601(M),L=Q.secondsDifference(R,f);L>0&&L<u&&Q.addSeconds(f,u,R),t.time=R}catch{dt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else dt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(M){g.remove(M);let R=M._children,L=R.length;for(let B=0;B<L;++B)y(R[B])}g.suspendEvents();let b=g.values.slice(),x;for(x=0;x<b.length;++x){let M=b[x];M.parent===p&&(M.parent=void 0,y(M))}for(g.resumeEvents(),g.suspendEvents(),x=0;x<m.length;x++){let M=m[x];c(M.parent)||(M.parent=p,BY(M)),g.add(M)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let A=g.computeAvailability(),E=A.start,S=A.stop,v=Q.equals(E,Ge.MINIMUM_VALUE),P=Q.equals(S,Ge.MAXIMUM_VALUE);if(!v||!P){let M=e._clock;(M.startTime!==E||M.stopTime!==S)&&(M.startTime=E,M.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var wY=new Et;wu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Q.now(),i=this;wY.removeAll();function o(f){let h=f._children,p=h.length;for(let g=0;g<p;++g){let m=h[g];wY.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;c(a)&&!(a.positionWC.equalsEpsilon(s.position,O.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,O.EPSILON7)&&a.upWC.equalsEpsilon(s.up,O.EPSILON7))&&(s.position=d.clone(a.positionWC),s.direction=d.clone(a.directionWC),s.up=d.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let l=new Et,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!wY.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===Hy.INTERVAL?Q.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===Hy.EXPIRE?Q.greaterThan(n,f.time)&&(p=!0):f.refreshMode===Hy.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Q.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let g=new la,m=f.href.clone();m.setQueryParameters(f.cookie);let y=i._ellipsoid??ie.default;NY(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,y),FY(i,g,m,{context:h.id}).then(Prt(i,f,g,l,m)).catch(function(b){let x=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(x),i._error.raiseEvent(i,x)}),u=!0}}l.set(f.id,f)}}),u&&(this._networkLinks=l,this._changed.raiseEvent(this)),!0};function Irt(){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}wu._DeferredLoading=Lm;wu._getTimestamp=Ei;var wE=wu;function LP(){C.throwInstantiationError()}LP.prototype.update=C.throwInstantiationError;LP.prototype.getBoundingSphere=C.throwInstantiationError;LP.prototype.isDestroyed=C.throwInstantiationError;LP.prototype.destroy=C.throwInstantiationError;var j_e=LP;var NP=`#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; +`;var txt=za.SHOW_INDEX,dte=za.POSITION_INDEX,Kve=za.COLOR_INDEX,nxt=za.OUTLINE_COLOR_INDEX,ixt=za.OUTLINE_WIDTH_INDEX,rxt=za.PIXEL_SIZE_INDEX,$ve=za.SCALE_BY_DISTANCE_INDEX,Jve=za.TRANSLUCENCY_BY_DISTANCE_INDEX,Zve=za.DISTANCE_DISPLAY_CONDITION_INDEX,oxt=za.DISABLE_DEPTH_DISTANCE_INDEX,sxt=za.SPLIT_DIRECTION_INDEX,hte=za.NUMBER_OF_PROPERTIES,cl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function zd(e){e=e??H.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(hte),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=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??ki.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.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(zd.prototype,{length:{get:function(){return mte(this),this._pointPrimitives.length}}});function Qve(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}zd.prototype.add=function(e){let t=new za(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};zd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};zd.prototype.removeAll=function(){Qve(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function mte(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}zd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};zd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};zd.prototype.get=function(e){return mte(this),this._pointPrimitives[e]};zd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<hte;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function axt(e,t,n){return new F_(e,[{index:cl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dte]},{index:cl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dte]},{index:cl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Kve]},{index:cl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Jve]},{index:cl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[$ve]},{index:cl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Zve]}],t)}var ute=new Sn,sj=new z;function eSe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(le.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,ute);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[cl.positionHighAndSize],u=ute.high;c(r,u.x,u.y,u.z,s);let f=n[cl.positionLowAndOutline],d=ute.low;f(r,d.x,d.y,d.z,a)}var cxt=256;function tSe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;sj.red=o.alpha,sj.green=s.alpha,sj.blue=a.alpha;let c=n[cl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(sj))}function nSe(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*cxt+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[cl.compressedAttribute1];g(r,d,p,o,a)}function iSe(e,t,n,i){let r=i._index,o=n[cl.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function rSe(e,t,n,i){let r=i._index,o=n[cl.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 u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,s,a,u,f)}function lxt(e,t,n,i){eSe(e,t,n,i),tSe(e,t,n,i),nSe(e,t,n,i),iSe(e,t,n,i),rSe(e,t,n,i)}function fte(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=za._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):le.expand(s,d,s))}o&&le.fromPoints(a,s)}function uxt(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!M.equals(o,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&fte(e,i,i.length,t,o,!0)):n===re.MORPHING?fte(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&fte(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function fxt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var dxt=[];zd.prototype.update=function(e){if(mte(this),!this.show)return;this._maxTotalPointSize=Ut.maximumAliasedPointSize,uxt(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<hte;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=axt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,lxt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=dxt;v.length=0,(o[dte]||o[ixt]||o[rxt])&&v.push(eSe),(o[Kve]||o[nxt])&&v.push(tSe),(o[txt]||o[Jve])&&v.push(nSe),o[$ve]&&v.push(iSe),(o[Zve]||o[oxt]||o[sxt])&&v.push(rSe);let S=v.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R)}this._vaf.commit()}else{for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>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 d,p=M.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=le.clone(this._baseVolumeWC,this._boundingVolume)):d=le.clone(this._baseVolume2D,this._boundingVolume),fxt(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===ki.OPAQUE||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ki.TRANSLUCENT||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:rn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Xe({sources:[oj]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===ki.OPAQUE_AND_TRANSLUCENT&&(y=new Xe({defines:["OPAQUE"],sources:[eT]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cl}),y=new Xe({defines:["TRANSLUCENT"],sources:[eT]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cl})),this._blendOption===ki.OPAQUE&&(y=new Xe({sources:[eT]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cl})),this._blendOption===ki.TRANSLUCENT&&(y=new Xe({sources:[eT]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,E=e.commandList;if(u.render||f){let v=this._colorCommands,S=this._blendOption===ki.OPAQUE,I=this._blendOption===ki.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,v.length=b;let R=I?b*2:b;for(T=0;T<R;++T){let O=S||I&&T%2===0;x=v[T],l(x)||(x=v[T]=new at),x.primitiveType=Oe.POINTS,x.pass=O||!I?Ie.OPAQUE:Ie.TRANSLUCENT,x.owner=this;let L=I?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[L].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",E.push(x)}}};zd.prototype.isDestroyed=function(){return!1};zd.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(),Qve(this._pointPrimitives),ue(this)};var gR=zd;var oSe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],pte=1,_R=8,ns=new Uint32Array(96),AR=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");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 r=i>>4;if(r!==pte)throw new Error(`Got v${r} data when expected v${pte}.`);let o=oSe[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected 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 s=oSe.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,_R,t),this.coords=new i(o,_R+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(_R+a+c+u);this.ids=new this.IndexArrayType(f,_R,t),this.coords=new i(f,_R+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(pte<<4)+s]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,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 _te(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;ns[0]=0,ns[1]=o.length-1,ns[2]=0;let c=3,u=[];for(;c>0;){let f=ns[--c],d=ns[--c],p=ns[--c];if(d-p<=a){for(let A=p;A<=d;A++){let b=s[2*A],x=s[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(ns[c++]=p,ns[c++]=g-1,ns[c++]=1-f),(f===0?i>=m:r>=y)&&(ns[c++]=g+1,ns[c++]=d,ns[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;ns[0]=0,ns[1]=o.length-1,ns[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=ns[--c],p=ns[--c],g=ns[--c];if(p-g<=a){for(let b=g;b<=p;b++)sSe(s[2*b],s[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=s[2*m],A=s[2*m+1];sSe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(ns[c++]=g,ns[c++]=m-1,ns[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(ns[c++]=m+1,ns[c++]=p,ns[c++]=1-d)}return u}};function _te(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;aSe(e,t,s,i,r,o),_te(e,t,n,i,s-1,1-o),_te(e,t,n,s+1,r,1-o)}function aSe(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));aSe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(yR(e,t,i,n),t[2*r+o]>s&&yR(e,t,i,r);a<c;){for(yR(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?yR(e,t,i,c):(c++,yR(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function yR(e,t,n,i){gte(e,n,i),gte(t,2*n,2*i),gte(t,2*n+1,2*i+1)}function gte(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function sSe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function em(e){e=e??H.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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=e.show??!0}function cSe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var hxt=new et;function lSe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=Hx.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Fr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=za.getScreenSpaceBoundingBox(e,t,r)),cSe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&fSe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=Hx.getScreenSpaceBoundingBox(s,t,hxt);cSe(a,n),r=et.union(r,a,r)}return r}function mxt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&fSe(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 uSe(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function fSe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function yte(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var pxt=new et,gxt=new et,_xt=new et;function yxt(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!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 wg({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Nd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new gR;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new Km(y,A),x=[];e._clusterLabels&&yte(i,x,n,b,e),e._clusterBillboards&&yte(r,x,n,b,e),e._clusterPoints&&yte(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,D;if(x.length>0){let N=new AR(x.length,64,Float64Array);for(let F=0;F<x.length;++F)N.add(x[F].coord.x,x[F].coord.y);if(N.finish(),m<g)for(v=d.length,T=0;T<v;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Fr._computeScreenSpacePosition(M.IDENTITY,F.position,h.ZERO,U.ZERO,n);if(!l(V))continue;let B=1-m/g,j=F.width=F.width*B,k=F.height=F.height*B;j=Math.max(j,F.minimumWidth),k=Math.max(k,F.minimumHeight);let G=V.x-j*.5,q=V.y-k*.5,Q=V.x+j,W=V.y+k;for(I=N.range(G,q,Q,W),R=I.length,C=0,_=[],E=0;E<R;++E)O=I[E],L=x[O],L.clustered||(++C,w=L.collection,D=L.index,_.push(w.get(D).id));if(C>=f)for(uSe(F.position,C,_,e),p.push(F),E=0;E<R;++E)x[I[E]].clustered=!0}for(v=x.length,T=0;T<v;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,w=F.collection,D=F.index;let V=w.get(D);S=lSe(V,F.coord,u,e,pxt);let B=et.clone(S,gxt);I=N.range(S.x,S.y,S.x+S.width,S.y+S.height),R=I.length;let j=h.clone(V.position);for(C=1,_=[V.id],E=0;E<R;++E)if(O=I[E],L=x[O],!L.clustered){let k=L.collection.get(L.index),G=lSe(k,L.coord,u,e,_xt);h.add(k.position,j,j),et.union(B,G,B),++C,_.push(k.id)}if(C>=f){let k=h.multiplyByScalar(j,1/C,j);for(uSe(k,C,_,e),p.push({position:k,width:B.width,height:B.height,minimumWidth:S.width,minimumHeight:S.height}),E=0;E<R;++E)x[I[E]].clustered=!0}else mxt(V,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=m}}em.prototype._initialize=function(e){this._scene=e;let t=yxt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(em.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 bte(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function xte(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}em.prototype.getLabel=bte("_labelCollection",wg,"_unusedLabelIndices","labelIndex");em.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,xte(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};em.prototype.getBillboard=bte("_billboardCollection",Nd,"_unusedBillboardIndices","billboardIndex");em.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,xte(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};em.prototype.getPoint=bte("_pointCollection",gR,"_unusedPointIndices","pointIndex");em.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,xte(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Ate(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Axt(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,Ate(e._labelCollection),Ate(e._billboardCollection),Ate(e._pointCollection))}em.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,Axt(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)};em.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 Vd=em;function Tte(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 ac(this),this._entityCluster=new Vd}Object.defineProperties(Tte.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){ks.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}}});Tte.prototype.update=function(e){return!0};var aj=Tte;var dSe=h.ZERO,hSe=new h,bxt=new h,mSe=new z;function xxt(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 wf(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new xxt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(wf.prototype=Object.create(Oi.prototype),wf.prototype.constructor=wf);Object.defineProperties(wf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});wf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ei.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,mSe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,dSe,hSe))),new Bt({id:t,geometry:new Rk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};wf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,mSe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,dSe,hSe))),new Bt({id:t,geometry:new Ok(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};wf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};wf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Oi.prototype._isHidden.call(this,e,t)};wf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};wf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(nt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(nt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(nt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,nt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};wf.prototype._onEntityPropertyChanged=Fy;wf.DynamicGeometryUpdater=kS;function kS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(kS.prototype=Object.create(Ri.prototype),kS.prototype.constructor=kS);kS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,bxt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ri.prototype._isHidden.call(this,e,t,n)};kS.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?pn.ALL:void 0};var cj=wf;var DR=js(Qu(),1);function tT(){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(tT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Iu("startTime"),stopTime:Iu("stopTime"),currentTime:Iu("currentTime"),clockRange:Iu("clockRange"),clockStep:Iu("clockStep"),multiplier:Iu("multiplier")});tT.prototype.clone=function(e){return l(e)||(e=new tT),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};tT.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};tT.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};tT.prototype.getValue=function(e){return l(e)||(e=new up),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Gp=tT;var Txt=z.WHITE,Ext=.1,Cxt=new U(8,8),vxt=new U(0,0),Sxt=new U(1,1);function US(e){e=e??H.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(US.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});US.prototype.getType=function(e){return"Grid"};var wxt=new K;US.prototype.getValue=function(e,t){return l(e)||(e=K.now(wxt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Txt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,Ext),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,Cxt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,Sxt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,vxt,t.lineOffset),t};US.prototype.equals=function(e){return this===e||e instanceof US&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var bR=US;var pSe={WHOLE:0,PORTIONS:1};Object.freeze(pSe);var Ug=pSe;function zS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(zS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});zS.prototype.getType=function(e){return"PolylineArrow"};var Ixt=new K;zS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Ixt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};zS.prototype.equals=function(e){return this===e||e instanceof zS&&X.equals(this._color,e._color)};var xR=zS;var Pxt=z.WHITE,Dxt=z.TRANSPARENT,Rxt=16,Oxt=255;function VS(e){e=e??H.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(VS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});VS.prototype.getType=function(e){return"PolylineDash"};var Mxt=new K;VS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Mxt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Pxt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,Dxt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,Rxt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,Oxt,t.dashPattern),t};VS.prototype.equals=function(e){return this===e||e instanceof VS&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var TR=VS;var Nxt=z.WHITE,Lxt=.25,Fxt=1;function jS(e){e=e??H.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(jS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});jS.prototype.getType=function(e){return"PolylineGlow"};var Bxt=new K;jS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Bxt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Nxt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,Lxt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,Fxt,t.taperPower),t};jS.prototype.equals=function(e){return this===e||e instanceof jS&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var ER=jS;var kxt=z.WHITE,Uxt=z.BLACK,zxt=1;function HS(e){e=e??H.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(HS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});HS.prototype.getType=function(e){return"PolylineOutline"};var Vxt=new K;HS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Vxt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,kxt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,Uxt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,zxt),t};HS.prototype.equals=function(e){return this===e||e instanceof HS&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var nT=HS;function zg(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Xo,this._referenceFrame=t??Wi.FIXED,this.setValue(e)}Object.defineProperties(zg.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var jxt=new K;zg.prototype.getValue=function(e,t){return l(e)||(e=K.now(jxt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};zg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};zg.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 r=e[i];l(r)&&t.add(r.definitionChanged,zg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};zg.prototype.equals=function(e){return this===e||e instanceof zg&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};zg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var yA=zg;function AA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Xo,this.setValue(e)}Object.defineProperties(AA.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(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Hxt=new K;AA.prototype.getValue=function(e,t){l(e)||(e=K.now(Hxt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};AA.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 r=e[i];l(r)&&t.add(r.definitionChanged,AA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};AA.prototype.equals=function(e){return this===e||e instanceof AA&&X.arrayEquals(this._value,e._value)};AA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var CR=AA;function iT(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(If.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function If(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(If.prototype._onCollectionChanged,this)}Object.defineProperties(If.prototype,{isConstant:{get:function(){return X.isConstant(iT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=iT(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 iT(this)}}});If.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new If(e,n,i)};var Gxt=new K;If.prototype.getValue=function(e,t){let n=iT(this);return l(e)||(e=K.now(Gxt)),l(n)?n.getValue(e,t):void 0};If.prototype.getValueInReferenceFrame=function(e,t,n){let i=iT(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};If.prototype.getType=function(e){let t=iT(this);return l(t)?t.getType(e):void 0};If.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 r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};If.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};If.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(If.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=iT(this),l(i)&&this._definitionChanged.raiseEvent(this))};var bA=If;var Wxt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-P.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+P.TWO_PI:r}},tm=Wxt;var gSe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function _Se(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function ySe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var Ete=[],Cte=[];function lj(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=ySe(i[o],e),c=Pr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=ySe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(Ete[p++]=f,o=o+1,s=0;s<r;s++)Cte[g++]=i[o],o=o+1;a=f}p>0&&(Cte.length=g,_Se(n,u,Cte),Ete.length=p,_Se(t,c,Ete))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function jd(e,t){let n=e;n===Number&&(n=gSe);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=gSe);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=tx,this._lastInterpolationAlgorithm=tx,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=yu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=yu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(jd.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 qxt=new K;jd.prototype.getValue=function(e,t){l(e)||(e=K.now(qxt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Pr(n,e,K.compare);var c=!1;if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===yu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===yu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===yu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===yu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===yu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===yu.LINEAR_EXTRAPOLATE}let d=this._xTable,p=this._yTable;var u,f;c?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(u.getRequiredDataPoints(f,m),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,d.length=S,p.length=S*g)}let y=this._numberOfPoints-1;if(y<1)return;let A=0,b=i-1;if(b-A+1>=y+1){let S=a-(y/2|0)-1;S<A&&(S=A);let I=S+y;I>b&&(I=b,S=I-y,S<A&&(S=A)),A=S,b=I}let T=b-A+1;for(let S=0;S<T;++S)d[S]=K.secondsDifference(n[A+S],n[b]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,A,b,p);else{let S=0,I=this._packedLength,R=A*I,O=(b+1)*I;for(;R<O;)p[S]=s[R],R++,S++}let E=K.secondsDifference(e,n[b]),v;if(m===0||!l(u.interpolate))v=u.interpolateOrderZero(E,d,p,g,this._interpolationResult);else{let S=Math.floor(g/(m+1));v=u.interpolate(E,d,p,S,m,m,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(v,s,A,b,t):o.unpack(v,0,t)}return o.unpack(s,a*this._packedLength,t)};jd.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))};jd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}lj(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};jd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}lj(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};jd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};jd.prototype.addSamplesPackedArray=function(e,t){lj(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};jd.prototype.removeSample=function(e){let t=Pr(this._times,e,K.compare);return t<0?!1:(ASe(this,t,1),!0)};function ASe(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)}jd.prototype.removeSamples=function(e){let t=this._times,n=Pr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Pr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,ASe(this,n,i-n)};jd.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,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!K.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};jd._mergeNewSamples=lj;var Hd=jd;function Gd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Hd(h,n),this._definitionChanged=new be,this._referenceFrame=e??Wi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Gd.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 Yxt=new K;Gd.prototype.getValue=function(e,t){return l(e)||(e=K.now(Yxt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Gd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return xp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Gd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Gd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Gd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Gd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Gd.prototype.removeSample=function(e){return this._property.removeSample(e)};Gd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Gd.prototype.equals=function(e){return this===e||e instanceof Gd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var wc=Gd;var bSe={HORIZONTAL:0,VERTICAL:1};Object.freeze(bSe);var Wp=bSe;var Xxt=Wp.HORIZONTAL,Kxt=z.WHITE,$xt=z.BLACK,Jxt=0,Zxt=1;function GS(e){e=e??H.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(GS.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});GS.prototype.getType=function(e){return"Stripe"};var Qxt=new K;GS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Qxt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,Xxt)===Wp.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,Kxt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,$xt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,Jxt),t.repeat=X.getValueOrDefault(this._repeat,e,Zxt),t};GS.prototype.equals=function(e){return this===e||e instanceof GS&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var vR=GS;function xA(e){this._definitionChanged=new be,this._intervals=new Os,this._intervals.changedEvent.addEventListener(xA.prototype._intervalsChanged,this),this._referenceFrame=e??Wi.FIXED}Object.defineProperties(xA.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 K;xA.prototype.getValue=function(e,t){return l(e)||(e=K.now(eTt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};xA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return xp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};xA.prototype.equals=function(e){return this===e||e instanceof xA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};xA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var TA=xA;function rT(){this._definitionChanged=new be,this._intervals=new Os,this._intervals.changedEvent.addEventListener(rT.prototype._intervalsChanged,this)}Object.defineProperties(rT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var tTt=new K;rT.prototype.getValue=function(e,t){l(e)||(e=K.now(tTt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};rT.prototype.equals=function(e){return this===e||e instanceof rT&&this._intervals.equals(e._intervals,X.equals)};rT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var EA=rT;function WS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(WS.prototype,{isConstant:{get:function(){return X.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 h,xSe=new h,TSe=new K,iTt=new K,vte=1/60;WS.prototype.getValue=function(e,t){return this._getValue(e,t)};WS.prototype._getValue=function(e,t,n){l(e)||(e=K.now(iTt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,nTt),o=i.getValue(K.addSeconds(e,vte,TSe),xSe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-vte,TSe),xSe),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,vte,t)};WS.prototype.equals=function(e){return this===e||e instanceof WS&&X.equals(this._position,e._position)};var CA=WS;function SR(e,t){this._velocityVectorProperty=new CA(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ee.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(SR.prototype,{isConstant:{get:function(){return X.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 ESe=new h,rTt=new h,CSe=new $,oTt=new K;SR.prototype.getValue=function(e,t){l(e)||(e=K.now(oTt));let n=this._velocityVectorProperty._getValue(e,rTt,ESe);if(l(n))return At.rotationMatrixFromPositionVelocity(ESe,n,this._ellipsoid,CSe),Le.fromRotationMatrix(CSe,t)};SR.prototype.equals=function(e){return this===e||e instanceof SR&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var uj=SR;var Vg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Vg.validate=function(e){return e===Vg.COMPLETE||e===Vg.BELOW_ELLIPSOID_HORIZON||e===Vg.ABOVE_ELLIPSOID_HORIZON};Vg.toString=function(e){switch(e){case Vg.COMPLETE:return"COMPLETE";case Vg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Vg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var wR=Vg;function vA(){}vA.packedLength=h.packedLength;vA.unpack=h.unpack;vA.pack=h.pack;var Ste;function IR(e,t){return t[0]==="#"&&(t=Ste+t),bA.fromString(e,t)}function vSe(e,t,n){if(l(n.reference))return IR(t,n.reference);if(l(n.velocityReference)){let i=IR(t,n.velocityReference);switch(e){case h:case vA:return new CA(i,e===vA);case Le:return new uj(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function sTt(e,t){return new vp(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var fr=new h,Wl=new N3,ll=new he,oT=new vn,fj=new Le;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===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function SSe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.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===ie.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=P.toRadians(n[r+1]),t[r+2]=P.toRadians(n[r+2]),t[r+3]=P.toRadians(n[r+3]),t[r+4]=P.toRadians(n[r+4]);return t}function lTt(e){let t=e.length;if(Wl.magnitude=1,t===2)return Wl.clock=e[0],Wl.cone=e[1],h.fromSpherical(Wl,fr),[fr.x,fr.y,fr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Wl.clock=e[i+1],Wl.cone=e[i+2],h.fromSpherical(Wl,fr),n[r+1]=fr.x,n[r+2]=fr.y,n[r+3]=fr.z;return n}function uTt(e){let t=e.length;if(t===3)return Wl.clock=e[0],Wl.cone=e[1],Wl.magnitude=e[2],h.fromSpherical(Wl,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Wl.clock=e[i+1],Wl.cone=e[i+2],Wl.magnitude=e[i+3],h.fromSpherical(Wl,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function fTt(e){let t=e.length;if(t===3)return ll.longitude=e[0],ll.latitude=e[1],ll.height=e[2],ee.default.cartographicToCartesian(ll,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ll.longitude=e[i+1],ll.latitude=e[i+2],ll.height=e[i+3],ee.default.cartographicToCartesian(ll,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function dTt(e){let t=e.length;if(t===3)return ll.longitude=P.toRadians(e[0]),ll.latitude=P.toRadians(e[1]),ll.height=e[2],ee.default.cartographicToCartesian(ll,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ll.longitude=P.toRadians(e[i+1]),ll.latitude=P.toRadians(e[i+2]),ll.height=e[i+3],ee.default.cartographicToCartesian(ll,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function wte(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 r=e.unitSpherical;if(l(r))return lTt(r);let o=e.spherical;if(l(o))return uTt(o);let s=e.cartographicRadians;if(l(s))return fTt(s);let a=e.cartographicDegrees;if(l(a))return dTt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function wSe(e,t){h.unpack(e,t,fr),h.normalize(fr,fr),h.pack(fr,e,t)}function hTt(e){let t=wte(e);if(t.length===3)return wSe(t,0),t;for(let n=1;n<t.length;n+=4)wSe(t,n);return t}function ISe(e,t){Le.unpack(e,t,fj),Le.normalize(fj,fj),Le.pack(fj,e,t)}function mTt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return ISe(t,0),t;for(let n=1;n<t.length;n+=5)ISe(t,n)}return t}function PSe(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")?et:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?vA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?ti:e.hasOwnProperty("colorBlendMode")?Ul:e.hasOwnProperty("cornerType")?ar:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?qi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?Po:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?Gt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?Ug:e.hasOwnProperty("shadowMode")?Dn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Wp:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?DR.default:e.hasOwnProperty("verticalOrigin")?qn:Object}function pTt(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case U:return t.cartesian2;case h:return wte(t);case vA:return hTt(t);case z:return aTt(t);case ti:return ti[t.classificationType??t];case Ul:return Ul[t.colorBlendMode??t];case ar:return ar[t.cornerType??t];case We:return We[t.heightReference??t];case qi:return qi[t.horizontalOrigin??t];case Image:return SSe(t,n);case K:return K.fromIso8601(t.date??t);case Po:return Po[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case Gt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Ug:return Ug[t.pathMode??t];case Le:return mTt(t);case tm:return t.number??t;case wR:return wR[t.portionToDisplay??t];case Dn:return Dn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Wp:return Wp[t.stripeOrientation??t];case ie:return cTt(t);case DR.default:return SSe(t,n);case qn:return qn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var gTt={HERMITE:$k,LAGRANGE:i3,LINEAR:tx};function dj(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:gTt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=yu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=yu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var DSe={iso8601:void 0};function zo(e){if(l(e))return DSe.iso8601=e,vn.fromIso8601(DSe)}function Ite(e){let t=nt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function RSe(e){let t=new Hl;return t.intervals.addInterval(Ite(e)),t}function OSe(e){let t=new Sc(e.referenceFrame);return t.intervals.addInterval(Ite(e)),t}function hj(e,t,n,i,r,o,s){let a=zo(i.interval);l(r)&&(l(a)?a=vn.intersect(a,r,oT):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(nt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return HSe(t[n],a)}let g=!1;if(d){if(u=pTt(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==tm;if(!g&&!p){d?t[n]=new Ti(m?e.unpack(u,0):u):t[n]=vSe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Hd||(t[n]=y=new Hd(e)),y.addSamplesPackedArray(u,A),dj(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=vSe(e,s,i),l(y)||(t[n]=y=d?new EA:new Hl),d&&y instanceof EA?y.intervals.addInterval(a):y instanceof Hl?(d&&(a.data=new Ti(a.data)),y.intervals.addInterval(a)):(t[n]=y=RSe(y),d&&(a.data=new Ti(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Hl),y instanceof Hl||(t[n]=y=RSe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof Hd))&&(x=a.clone(),x.data=new Hd(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),dj(i,x.data)}function HSe(e,t){if(e instanceof Hd){e.removeSamples(t);return}else if(e instanceof EA){e.intervals.removeInterval(t);return}else if(e instanceof Hl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=vn.intersect(n.get(i),t,oT);r.isEmpty||HSe(r.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)hj(e,t,n,i[a],r,o,s);else hj(e,t,n,i,r,o,s)}function MSe(e,t,n,i,r,o){let s=zo(n.interval);l(i)&&(l(s)?s=vn.intersect(s,i,oT):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(nt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return GSe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Wi[n.referenceFrame]),g=g??Wi.FIXED,u=wte(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new wu(h.unpack(u),g):e[t]=IR(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof wc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new wc(g,a)),y.addSamplesPackedArray(u,A),dj(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=IR(o,n.reference),l(y)||(d?y=new TA(g):y=new Sc(g),e[t]=y),d&&y instanceof TA&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof Sc?(d&&(s.data=new wu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=OSe(y),d&&(s.data=new wu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof Sc||(e[t]=y=OSe(y)):e[t]=y=new Sc(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof wc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new wc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),dj(n,x.data)}function GSe(e,t){if(e instanceof wc){e.removeSamples(t);return}else if(e instanceof TA){e.intervals.removeInterval(t);return}else if(e instanceof Sc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=vn.intersect(n.get(i),t,oT);r.isEmpty||GSe(r.data,t)}n.removeInterval(t);return}}function WSe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)MSe(e,t,n[s],i,r,o);else MSe(e,t,n,i,r,o)}function NSe(e,t,n,i){l(n.references)?mj(e,t,n.references,n.interval,i,CR,Hl):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function LSe(e,t,n,i,r,o){let s=zo(n.interval);l(i)&&(l(s)?s=vn.intersect(s,i,oT):s=i);let a=e[t],c,u;if(l(s)){a instanceof pR||(a=new pR,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof bR||(c=new bR),f=n.grid,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Ee(U,c,"lineCount",f.lineCount,void 0,r,o),Ee(U,c,"lineThickness",f.lineThickness,void 0,r,o),Ee(U,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof bx||(c=new bx),f=n.image,Ee(Image,c,"image",f.image,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o),Ee(z,c,"color",f.color,void 0,r,o),Ee(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof vR||(c=new vR),f=n.stripe,Ee(Wp,c,"orientation",f.orientation,void 0,r,o),Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(Number,c,"offset",f.offset,void 0,r,o),Ee(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof nT||(c=new nT),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,r,o),Ee(z,c,"outlineColor",f.outlineColor,void 0,r,o),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof ER||(c=new ER),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"glowPower",f.glowPower,void 0,r,o),Ee(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof xR||(c=new xR),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof TR||(c=new TR),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,o),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,o),Ee(Number,c,"dashLength",f.dashLength,void 0,r,o),Ee(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof hR||(c=new hR),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function Pf(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)LSe(e,t,n[s],i,r,o);else LSe(e,t,n,i,r,o)}function _Tt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function yTt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function ATt(e,t,n,i){let r=t.position;l(r)&&WSe(e,"position",r,void 0,i,n)}function bTt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function xTt(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function TTt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new Pu);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)hj(PSe(s[a]),e.properties,o,s[a],void 0,i,n);else hj(PSe(s),e.properties,o,s,void 0,i,n)}}}function mj(e,t,n,i,r,o,s){let a=n.map(function(c){return IR(r,c)});if(l(i)){i=zo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(Ite(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function FSe(e,t,n,i){let r=n.references;l(r)?mj(e,t,r,n.interval,i,CR,Hl):Ee(Array,e,t,n,void 0,void 0,i)}function BSe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)FSe(e,t,n[r],i);else FSe(e,t,n,i)}function kSe(e,t,n,i){let r=n.references;l(r)?mj(e,t,r,n.interval,i,yA,Sc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function RR(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)kSe(e,t,n[r],i);else kSe(e,t,n,i)}function ETt(e){return h.unpackArray(e)}function CTt(e){return h.fromRadiansArrayHeights(e,ee.default)}function vTt(e){return h.fromDegreesArrayHeights(e,ee.default)}function USe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return mj(a,"positions",s,n.interval,i,yA,Sc),a.positions});e[t]=new yA(o)}else l(n.cartesian)?n.array=n.cartesian.map(ETt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(CTt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(vTt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function STt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)USe(e,t,n[r],i);else USe(e,t,n,i)}function wTt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)NSe(e,t,n[r],i);else NSe(e,t,n,i)}function ITt(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Os),o.addInterval(zo(r[s]));else o=new Os,o.addInterval(zo(r));e.availability=o}function PTt(e,t,n,i,r){l(t)&&Ee(vA,e,"alignedAxis",t,n,i,r)}function DTt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=zo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Fl),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Image,s,"image",r.image,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(qi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(qn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(tm,s,"rotation",r.rotation,o,i,n),PTt(s,r.alignedAxis,o,i,n),Ee(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(et,s,"imageSubRegion",r.imageSubRegion,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function RTt(e,t,n,i){let r=t.box;if(!l(r))return;let o=zo(r.interval),s=e.box;l(s)||(e.box=s=new bv),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"dimensions",r.dimensions,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function OTt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=zo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new Tv),Ee(Boolean,s,"show",r.show,o,i,n),RR(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(ar,s,"cornerType",r.cornerType,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function MTt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=zo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Ev),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"length",r.length,o,i,n),Ee(Number,s,"topRadius",r.topRadius,o,i,n),Ee(Number,s,"bottomRadius",r.bottomRadius,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Number,s,"slices",r.slices,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function NTt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("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 r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function LTt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=zo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Cv),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),Ee(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(tm,s,"rotation",r.rotation,o,i,n),Ee(tm,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function FTt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=zo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new vv),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"radii",r.radii,o,i,n),Ee(h,s,"innerRadii",r.innerRadii,o,i,n),Ee(Number,s,"minimumClock",r.minimumClock,o,i,n),Ee(Number,s,"maximumClock",r.maximumClock,o,i,n),Ee(Number,s,"minimumCone",r.minimumCone,o,i,n),Ee(Number,s,"maximumCone",r.maximumCone,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"stackPartitions",r.stackPartitions,o,i,n),Ee(Number,s,"slicePartitions",r.slicePartitions,o,i,n),Ee(Number,s,"subdivisions",r.subdivisions,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function BTt(e,t,n,i){let r=t.label;if(!l(r))return;let o=zo(r.interval),s=e.label;l(s)||(e.label=s=new Tp),Ee(Boolean,s,"show",r.show,o,i,n),Ee(String,s,"text",r.text,o,i,n),Ee(String,s,"font",r.font,o,i,n),Ee(Po,s,"style",r.style,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Boolean,s,"showBackground",r.showBackground,o,i,n),Ee(z,s,"backgroundColor",r.backgroundColor,o,i,n),Ee(U,s,"backgroundPadding",r.backgroundPadding,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(qi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(qn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"fillColor",r.fillColor,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function kTt(e,t,n,i){let r=t.model;if(!l(r))return;let o=zo(r.interval),s=e.model;l(s)||(e.model=s=new My),Ee(Boolean,s,"show",r.show,o,i,n),Ee(DR.default,s,"uri",r.gltf,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),Ee(Number,s,"maximumScale",r.maximumScale,o,i,n),Ee(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Ee(Boolean,s,"runAnimations",r.runAnimations,o,i,n),Ee(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),Ee(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(Ul,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)zSe(s,u[a],o,i,n);else zSe(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)VSe(s,f[a],o,i,n);else VSe(s,f,o,i,n)}function zSe(e,t,n,i,r){let o=zo(t.interval);l(n)&&(l(o)?o=vn.intersect(o,n,oT):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new Pu),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new Sv),Ee(h,p,"translation",d.translation,o,i,r),Ee(Le,p,"rotation",d.rotation,o,i,r),Ee(h,p,"scale",d.scale,o,i,r)}}function VSe(e,t,n,i,r){let o=zo(t.interval);l(n)&&(l(o)?o=vn.intersect(o,n,oT):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new Pu),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function UTt(e,t,n,i){let r=t.path;if(!l(r))return;let o=zo(r.interval),s=e.path;l(s)||(e.path=s=new Ny),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"leadTime",r.leadTime,o,i,n),Ee(Number,s,"trailTime",r.trailTime,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"resolution",r.resolution,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(Ug,s,"materialMode",r.materialMode,o,i,n)}function zTt(e,t,n,i){let r=t.point;if(!l(r))return;let o=zo(r.interval),s=e.point;l(s)||(e.point=s=new Iv),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"pixelSize",r.pixelSize,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function PR(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(PR.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}}});PR.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(r){return new Xc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Xc(n,i)};PR.prototype.equals=function(e){return this===e||e instanceof PR&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function VTt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=zo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new Ep),Ee(Boolean,s,"show",r.show,o,i,n),RR(s,"_positions",r.positions,n),STt(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new PR(s)),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(tm,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),Ee(Boolean,s,"closeTop",r.closeTop,o,i,n),Ee(Boolean,s,"closeBottom",r.closeBottom,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function jTt(e){return e?ln.GEODESIC:ln.NONE}function HTt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=zo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Bl),Ee(Boolean,s,"show",r.show,o,i,n),RR(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Pf(s,"material",r.material,o,i,n),Pf(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};Ee(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=sTt(a.followSurface,jTt)}}function GTt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=zo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Pv),RR(s,"positions",r.positions,n),wTt(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ar,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function WTt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=zo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Cp),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ie,s,"coordinates",r.coordinates,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(tm,s,"rotation",r.rotation,o,i,n),Ee(tm,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ti,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function qTt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=zo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new wv),Ee(Boolean,s,"show",r.show,o,i,n),Ee(DR.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function YTt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=zo(r.interval),s=e.wall;l(s)||(e.wall=s=new Ly),Ee(Boolean,s,"show",r.show,o,i,n),RR(s,"positions",r.positions,n),BSe(s,"minimumHeights",r.minimumHeights,n),BSe(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Pf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function jSe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),Ste=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")NTt(e,r);else{let s=t.getOrCreateEntity(o),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)}Ste=void 0}function XTt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(nt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Gp,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=Ps.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Gp,t.startTime=nt.MINIMUM_VALUE.clone(),t.stopTime=nt.MAXIMUM_VALUE.clone(),t.currentTime=nt.MINIMUM_VALUE.clone(),t.clockRange=Ps.LOOP_STOP,t.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=zo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=Ps[n.range]??Ps.LOOP_STOP),l(n.step)&&(t.clockStep=jr[n.step]??jr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function qSe(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),ks.setLoading(e,!0),Promise.resolve(r).then(function(a){return KTt(e,a,o,i)}).catch(function(a){return ks.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function KTt(e,t,n,i){ks.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new YSe,r.removeAll()),Zs._processCzml(t,r,n,void 0,e);let o=XTt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=ay(n.getUrlComponent()),o=!0),ks.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function YSe(){this.name=void 0,this.clock=void 0}function Zs(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 YSe,this._version=void 0,this._entityCollection=new ac(this),this._entityCluster=new Vd,this._credit=void 0,this._resourceCredits=[]}Zs.load=function(e,t){return new Zs().load(e,t)};Object.defineProperties(Zs.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}}});Zs.updaters=[DTt,RTt,OTt,MTt,LTt,FTt,BTt,kTt,_Tt,yTt,UTt,zTt,VTt,HTt,GTt,TTt,WTt,ATt,qTt,bTt,YTt,xTt,ITt];Zs.registerUpdater=function(e){Zs.updaters.includes(e)||Zs.updaters.push(e)};Zs.unregisterUpdater=function(e){if(Zs.updaters.includes(e)){let t=Zs.updaters.indexOf(e);Zs.updaters.splice(t,1)}};Zs.prototype.process=function(e,t){return qSe(this,e,t,!1)};Zs.prototype.load=function(e,t){return qSe(this,e,t,!0)};Zs.prototype.update=function(e){return!0};Zs.processPacketData=Ee;Zs.processPositionPacketData=WSe;Zs.processMaterialPacketData=Pf;Zs._processCzml=function(e,t,n,i,r){if(i=i??Zs.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)jSe(e[o],t,i,n,r);else jSe(e,t,i,n,r)};var pj=Zs;function ql(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(ql.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}}});ql.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})};ql.prototype.remove=function(e,t){t=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};ql.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};ql.prototype.contains=function(e){return this.indexOf(e)!==-1};ql.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ql.prototype.get=function(e){return this._dataSources[e]};ql.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function gj(e,t){return e.indexOf(t)}function XSe(e,t,n){let i=e._dataSources,r=i.length-1;if(t=P.clamp(t,0,r),n=P.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}ql.prototype.raise=function(e){let t=gj(this._dataSources,e);XSe(this,t,t+1)};ql.prototype.lower=function(e){let t=gj(this._dataSources,e);XSe(this,t,t-1)};ql.prototype.raiseToTop=function(e){let t=gj(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))};ql.prototype.lowerToBottom=function(e){let t=gj(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ql.prototype.isDestroyed=function(){return!1};ql.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var _j=ql;function cc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(cc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});cc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};cc.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._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};cc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};cc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};cc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function yj(e,t){return e._primitives.indexOf(t)}cc.prototype.raise=function(e){if(l(e)){let t=yj(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};cc.prototype.raiseToTop=function(e){if(l(e)){let t=yj(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};cc.prototype.lower=function(e){if(l(e)){let t=yj(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};cc.prototype.lowerToBottom=function(e){if(l(e)){let t=yj(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};cc.prototype.get=function(e){return this._primitives[e]};cc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};cc.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)}};cc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};cc.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)}};cc.prototype.isDestroyed=function(){return!1};cc.prototype.destroy=function(){return this.removeAll(),ue(this)};var Yl=cc;function qp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(qp.prototype,{length:{get:function(){return this._length}}});qp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Yl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};qp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};qp.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};qp.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};qp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};qp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};qp.prototype.isDestroyed=function(){return!1};qp.prototype.destroy=function(){return this.removeAll(),ue(this)};var Aj=qp;function qS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new zt}qS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};qS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};qS.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};qS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};qS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var YS=qS;var KSe=new z,$Se=h.ZERO,JSe=new h,ZSe=new ie;function $Tt(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 nm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new $Tt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(nm.prototype=Object.create(oi.prototype),nm.prototype.constructor=nm);nm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,KSe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,$Se,JSe))),new Bt({id:t,geometry:new pu(this._options),attributes:i})};nm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,KSe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,$Se,JSe))),new Bt({id:t,geometry:new ld(this._options),attributes:o})};nm.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};nm.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Oi.prototype._isHidden.call(this,e,t)};nm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};nm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(nt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(nt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(nt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),s.offsetAttribute=oi.computeGeometryOffsetAttribute(n,i,r,o),s.height=oi.getGeometryHeight(n,i),r=oi.getGeometryExtrudedHeight(r,o),r===oi.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(pu.computeRectangle(s,ZSe)).minimumTerrainHeight),s.extrudedHeight=r};nm.DynamicGeometryUpdater=XS;function XS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(XS.prototype=Object.create(Ri.prototype),XS.prototype.constructor=XS);XS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ri.prototype._isHidden.call(this,e,t,n)};XS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(pu.computeRectangle(i,ZSe)).minimumTerrainHeight),i.extrudedHeight=s};var bj=nm;var JTt=new Kt(z.WHITE),Pte=h.ZERO,Dte=new h,ZTt=new h,QTt=new h,Rte=new z,eEt=new h(1,1,1);function tEt(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 Df(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new tEt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Df.prototype=Object.create(Oi.prototype),Df.prototype.constructor=Df);Object.defineProperties(Df.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Df.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ei.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,Rte)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Pte,Dte))),new Bt({id:i,geometry:new ec(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Df.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Rte),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:ei.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Pte,Dte))),new Bt({id:i,geometry:new dd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Df.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Df.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Oi.prototype._isHidden.call(this,e,t)};Df.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};Df.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(nt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,nt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,nt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,nt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,nt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,nt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,nt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};Df.prototype._onEntityPropertyChanged=Fy;Df.DynamicGeometryUpdater=OR;function OR(e,t,n){Ri.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,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 h,this._material={}}l(Object.create)&&(OR.prototype=Object.create(Ri.prototype),OR.prototype.constructor=OR);OR.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,ZTt),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,Rte),c=So.getValue(e,n.material??JTt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,QTt),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,We.NONE),T=x!==We.NONE?pn.ALL:void 0,E=this._scene.mode,v=E===re.SCENE3D&&x===We.NONE,S=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,Pte,Dte);if(!v||this._lastSceneMode!==E||!l(this._primitive)||S.stackPartitions!==m||S.slicePartitions!==y||l(u)&&!h.equals(S.innerRadii!==u)||S.minimumClock!==f||S.maximumClock!==d||S.minimumCone!==p||S.maximumCone!==g||S.subdivisions!==A||this._lastOutlineWidth!==b||S.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,S.stackPartitions=m,S.slicePartitions=y,S.subdivisions=A,S.offsetAttribute=T,S.radii=h.clone(v?eEt:i,S.radii),l(u)?v?S.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,S.innerRadii):S.innerRadii=h.clone(u,S.innerRadii):S.innerRadii=void 0,S.minimumClock=f,S.maximumClock=d,S.minimumCone=p,S.maximumCone=g;let w=new Sr({material:c,translucent:c.isTranslucent(),closed:!0});S.vertexFormat=w.vertexFormat;let D=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=C.add(new Nn({geometryInstances:D,appearance:w,asynchronous:!1,shadows:I}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new Nn({geometryInstances:N,appearance:new An({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,w=this._outlinePrimitive;C.show=!0,w.show=!0,C.appearance.material=c;let D=this._attributes;l(D)||(D=C.getGeometryInstanceAttributes(t),this._attributes=D),o!==this._lastShow&&(D.show=Pn.toValue(o,D.show),this._lastShow=o);let N=this._outlineAttributes;l(N)||(N=w.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=Pn.toValue(s,N.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(N.color=Jt.toValue(a,N.color),z.clone(a,this._lastOutlineColor)),Gt.equals(O,this._lastDistanceDisplayCondition)||(D.distanceDisplayCondition=ei.toValue(O,D.distanceDisplayCondition),N.distanceDisplayCondition=ei.toValue(O,N.distanceDisplayCondition),Gt.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(D.offset=vr.toValue(L,D.offset),N.offset=vr.toValue(L,D.offset),h.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=M.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var xj=Df;var nEt=new h,QSe=new z;function iEt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Wd(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new iEt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Wd.prototype=Object.create(Oi.prototype),Wd.prototype.constructor=Wd);Wd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ei.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,QSe)),l(g)||(g=z.WHITE),r=Jt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=Ote(d,p,f,f),new Bt({id:t,geometry:new f3(this._options),modelMatrix:f,attributes:i})};Wd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,QSe),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,s.plane),u=X.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=Ote(c,u,a,a),new Bt({id:t,geometry:new h3,modelMatrix:a,attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r)}})};Wd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Oi.prototype._isHidden.call(this,e,t)};Wd.prototype._getIsClosed=function(e){return!1};Wd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Wd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(nt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions)};Wd.DynamicGeometryUpdater=KS;function KS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(KS.prototype=Object.create(Ri.prototype),KS.prototype.constructor=KS);KS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,nEt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ri.prototype._isHidden.call(this,e,t,n)};KS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var rEt=new h,oEt=new h,sEt=new h,aEt=new h,cEt=new $,lEt=new $,uEt=new M;function Ote(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,sEt),a=h.clone(h.UNIT_Z,oEt);P.equalsEpsilon(Math.abs(h.dot(a,r)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,rEt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=cEt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,aEt),d=$.multiplyByScale(u,f,lEt),p=M.fromRotationTranslation(d,s,uEt);return M.multiplyTransformation(n,p,i)}Wd.createPrimitiveMatrix=Ote;var Tj=Wd;var ewe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",twe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",nwe=new z,iwe=h.ZERO,rwe=new h,owe=new ie,fEt=[],dEt=new U;function hEt(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 Rf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new hEt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Rf.prototype=Object.create(oi.prototype),Rf.prototype.constructor=Rf);Rf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,nwe)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iwe,rwe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new Ak(i):o=new cg(i),new Bt({id:t,geometry:o,attributes:r})};Rf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,nwe),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:ei.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iwe,rwe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Ph(i):a=new g3(i),new Bt({id:t,geometry:a,attributes:s})};Rf.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=qs.fromPoints(i,r),s=o.projectPointsOntoPlane(i,fEt),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,A=U.add(g,m,dEt);A=U.multiplyByScalar(A,y,A),f=U.add(f,A,f),c+=y}let d=1/(c*3);return f=U.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};Rf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Oi.prototype._isHidden.call(this,e,t)};Rf.prototype._isOnTerrain=function(e,t){let n=oi.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(nt.MINIMUM_VALUE):!0);return n&&!r};Rf.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Rf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(nt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,nt.MINIMUM_VALUE,!1);o=oi.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,yt(ewe)),s!==We.NONE&&u&&(o=void 0,yt(twe))):(l(a)&&!l(o)&&(o=0),f=oi.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,nt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,nt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,nt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,nt.MINIMUM_VALUE),a=oi.getGeometryExtrudedHeight(a,c),a===oi.CLAMP_TO_GROUND){let d=cg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,owe);a=Ni.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};Rf.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)};Rf.DynamicGeometryUpdater=$S;function $S(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&($S.prototype=Object.create(Ri.prototype),$S.prototype.constructor=$S);$S.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ri.prototype._isHidden.call(this,e,t,n)};$S.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=oi.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,yt(ewe)),o!==We.NONE&&c&&(r=void 0,yt(twe))):(l(a)&&!l(r)&&(r=0),u=oi.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=oi.getGeometryExtrudedHeight(a,s),a===oi.CLAMP_TO_GROUND){let f=cg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,owe);a=Ni.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var Ej=Rf;var swe=new z;function mEt(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 Yp(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new mEt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Yp.prototype=Object.create(Oi.prototype),Yp.prototype.constructor=Yp);Yp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ei.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,swe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Bt({id:t,geometry:new _3(this._options),attributes:i})};Yp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,swe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new y3(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r)}})};Yp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Oi.prototype._isHidden.call(this,e,t)};Yp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Yp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Kt;r.vertexFormat=o?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(nt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(nt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(nt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(nt.MINIMUM_VALUE):void 0};Yp.DynamicGeometryUpdater=JS;function JS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(JS.prototype=Object.create(Ri.prototype),JS.prototype.constructor=JS);JS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ri.prototype._isHidden.call(this,e,t,n)};JS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var Cj=Yp;var awe=new z,cwe=h.ZERO,lwe=new h,uwe=new ie,pEt=new ie,gEt=new he;function _Et(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 im(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new _Et(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(im.prototype=Object.create(oi.prototype),im.prototype.constructor=im);im.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ei.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,awe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cwe,lwe))),new Bt({id:t,geometry:new QC(this._options),attributes:i})};im.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,awe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cwe,lwe))),new Bt({id:t,geometry:new nv(this._options),attributes:o})};im.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,pEt);if(!l(n))return;let i=ie.center(n,gEt);return he.toCartesian(i,ee.default,t)};im.prototype._isHidden=function(e,t){return!l(t.coordinates)||Oi.prototype._isHidden.call(this,e,t)};im.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};im.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(nt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),a.offsetAttribute=oi.computeGeometryOffsetAttribute(i,r,o,s),a.height=oi.getGeometryHeight(i,r),o=oi.getGeometryExtrudedHeight(o,s),o===oi.CLAMP_TO_GROUND&&(o=Ni.getMinimumMaximumHeights(QC.computeRectangle(a,uwe)).minimumTerrainHeight),a.extrudedHeight=o};im.DynamicGeometryUpdater=ZS;function ZS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(ZS.prototype=Object.create(Ri.prototype),ZS.prototype.constructor=ZS);ZS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ri.prototype._isHidden.call(this,e,t,n)};ZS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(QC.computeRectangle(i,uwe)).minimumTerrainHeight),i.extrudedHeight=s};var vj=im;var fwe=new z;function yEt(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 rm(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new yEt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(rm.prototype=Object.create(Oi.prototype),rm.prototype.constructor=rm);rm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ei.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,fwe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Bt({id:t,geometry:new J3(this._options),attributes:i})};rm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,fwe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new Z3(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ei.fromDistanceDisplayCondition(r)}})};rm.prototype._isHidden=function(e,t){return!l(t.positions)||Oi.prototype._isHidden.call(this,e,t)};rm.prototype._getIsClosed=function(e){return!1};rm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};rm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=o?An.VERTEX_FORMAT:Sr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(nt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(nt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(nt.MINIMUM_VALUE):void 0};rm.DynamicGeometryUpdater=QS;function QS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(QS.prototype=Object.create(Ri.prototype),QS.prototype.constructor=QS);QS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ri.prototype._isHidden.call(this,e,t,n)};QS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var Sj=rm;var sT=[VU,cj,ij,bj,xj,Tj,Ej,Cj,vj,Sj];function aT(e,t){this.entity=e,this.scene=t;let n=new Array(sT.length),i=new be,r=new Xo;for(let o=0;o<n.length;o++){let s=new sT[o](e,t);r.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[o]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(aT.prototype._onEntityPropertyChanged,this)}aT.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};aT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};aT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};aT.registerUpdater=function(e){sT.includes(e)||sT.push(e)};aT.unregisterUpdater=function(e){if(sT.includes(e)){let t=sT.indexOf(e);sT.splice(t,1)}};var ew=aT;var dwe=new z,AEt=new Gt,bEt=new Gt,xEt=h.ZERO,TEt=new h;function om(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(om.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}om.prototype.onMaterialChanged=function(){this.invalidated=!0};om.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};om.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};om.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};om.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Nn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.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)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,dwe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,dwe);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,bEt,AEt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,xEt,TEt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=vr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};om.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};om.prototype.contains=function(e){return this.updaters.contains(e.id)};om.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};om.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 tw(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}tw.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new om(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function hwe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}tw.prototype.remove=function(e){hwe(this._solidItems,e)||hwe(this._translucentItems,e)};function mwe(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function wj(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}tw.prototype.update=function(e){let t=wj(this,this._solidItems,e,!0);t=wj(this,this._translucentItems,e,t)&&t;let n=mwe(this,this._solidItems,e),i=mwe(this,this._translucentItems,e);return(n||i)&&(t=wj(this,this._solidItems,e,t)&&t,t=wj(this,this._translucentItems,e,t)&&t),t};function pwe(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return Pt.FAILED}tw.prototype.getBoundingSphere=function(e,t){let n=pwe(this._solidItems,e,t);return n===Pt.FAILED?pwe(this._translucentItems,e,t):n};function gwe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}tw.prototype.removeAllPrimitives=function(){gwe(this._solidItems),gwe(this._translucentItems)};var sm=tw;var EEt=new Gt,CEt=new Gt,vEt=h.ZERO,SEt=new h;function am(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(am.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt}am.prototype.onMaterialChanged=function(){this.invalidated=!0};am.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};am.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||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};am.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 wEt=new z;am.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=So.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;a=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Nn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({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=So.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,wEt);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,CEt,EEt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,vEt,SEt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=vr.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};am.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};am.prototype.contains=function(e){return this.updaters.contains(e.id)};am.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};am.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 nw(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}nw.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new am(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};nw.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};nw.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};nw.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};nw.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 cm=nw;var IEt=new z,PEt=new Gt,DEt=new Gt;function jg(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 zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new $C}jg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};jg.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||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};jg.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};jg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Su({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.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)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,IEt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,DEt,PEt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};jg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};jg.prototype.contains=function(e){return this.updaters.contains(e.id)};jg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};jg.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 iw(e,t){this._batches=[],this._primitives=e,this._classificationType=t}iw.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new jg(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};iw.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};iw.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};iw.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};iw.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var MR=iw;var REt=new Gt,OEt=new Gt;function Xp(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new $C}Xp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Xp.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};Xp.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Xp.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};Xp.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=So.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Su({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new a({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=So.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,OEt,REt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Xp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Xp.prototype.contains=function(e){return this.updaters.contains(e.id)};Xp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Xp.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function rw(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}rw.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Td.shouldUseSphericalCoordinates(r.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new Xp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};rw.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};rw.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};rw.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};rw.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 Ij=rw;var MEt=new z,NEt=new Gt,LEt=new Gt,FEt=h.ZERO,BEt=new h;function Hg(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 zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.itemsToRemove=[],this.subscriptions=new zt,this.showsUpdated=new zt}Hg.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||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Hg.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};Hg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Nn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new An({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.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)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,z.WHITE,MEt);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,LEt,NEt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,FEt,BEt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=vr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Hg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Hg.prototype.contains=function(e){return this.updaters.contains(e.id)};Hg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Hg.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 ow(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new zt,this._translucentBatches=new zt}ow.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new Hg(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new Hg(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};ow.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 r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};ow.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};ow.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Pt.FAILED};ow.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,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var NR=ow;var kEt=[];function ku(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r=Dn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=no.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new NR(n,e,s,!1),this._outlineBatches[r+s]=new NR(n,e,s,!0),this._closedColorBatches[s]=new sm(n,An,void 0,!0,s,!0),this._closedColorBatches[r+s]=new sm(n,An,void 0,!0,s,!1),this._closedMaterialBatches[s]=new cm(n,Sr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new cm(n,Sr,void 0,!0,s,!1),this._openColorBatches[s]=new sm(n,An,void 0,!1,s,!0),this._openColorBatches[r+s]=new sm(n,An,void 0,!1,s,!1),this._openMaterialBatches[s]=new cm(n,Sr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new cm(n,Sr,void 0,!1,s,!1);let a=ti.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new Ij(i,s,Sr)),c[s]=new MR(i,s);else for(s=0;s<a;++s)c[s]=new MR(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new YS(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new zt,this._updaterSets=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(ku.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,kEt)}ku.registerUpdater=function(e){ew.registerUpdater(e)};ku.unregisterUpdater=function(e){ew.unregisterUpdater(e)};ku.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new ew(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(ku._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var UEt=[],zEt=new le;ku.prototype.getBoundingSphere=function(e,t){let n=UEt,i=zEt,r=0,o,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=le.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,le.fromBoundingSpheres(n,t),Pt.DONE)};ku.prototype.isDestroyed=function(){return!1};ku.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ku.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 r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),ue(this)};ku.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};ku.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=Dn.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 r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?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 Kt?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)};ku._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};ku.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var Pj=ku;var VEt=1,jEt="30px sans-serif",HEt=Po.FILL,GEt=z.WHITE,WEt=z.BLACK,qEt=1,YEt=!1,XEt=new z(.165,.165,.165,.8),KEt=new U(7,5),$Et=U.ZERO,JEt=h.ZERO,ZEt=We.NONE,QEt=qi.CENTER,eCt=qn.CENTER,tCt=new h,nCt=new z,iCt=new z,rCt=new z,oCt=new U,sCt=new h,aCt=new U,cCt=new qt,lCt=new qt,uCt=new qt,fCt=new Gt;function _we(e){this.entity=e,this.label=void 0,this.index=void 0}function SA(e,t){t.collectionChanged.addEventListener(SA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}SA.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,tCt),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){Mte(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,ZEt);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,VEt),u.font=X.getValueOrDefault(a._font,e,jEt),u.style=X.getValueOrDefault(a._style,e,HEt),u.fillColor=X.getValueOrDefault(a._fillColor,e,GEt,nCt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,WEt,iCt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,qEt),u.showBackground=X.getValueOrDefault(a._showBackground,e,YEt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,XEt,rCt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,KEt,oCt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,$Et,aCt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,JEt,sCt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,QEt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,eCt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,cCt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,lCt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,uCt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,fCt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};SA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Pt.FAILED;let i=n.label;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Ap(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=Ry(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};SA.prototype.isDestroyed=function(){return!1};SA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(SA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};SA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new _we(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new _we(o)):(Mte(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Mte(s.get(o.id),o,a),s.remove(o.id)};function Mte(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var Dj=SA;var dCt=1,hCt=!0,mCt=0,pCt=!0,gCt=!0,_Ct=Dn.ENABLED,yCt=We.NONE,ACt=z.RED,bCt=0,xCt=z.WHITE,TCt=Ul.HIGHLIGHT,ECt=.5,CCt=new U(1,1),ywe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},vCt=new M,SCt=new M,Awe=new z,bwe=new Array(4),wCt=new h;function wA(e,t){t.collectionChanged.addEventListener(wA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}async function ICt(e,t,n,i,r){let o=e._primitives,s=e._modelHash;try{let a=await Dd.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,o.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}}wA.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=s.computeModelMatrix(e,vCt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)),f=l(d)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...ywe}},n[s.id]=u;let m=X.getValueOrDefault(a._incrementallyLoadTextures,e,pCt),y=X.getValueOrDefault(a._environmentMapOptions,e,ywe,u.environmentMapOptionsScratch);ICt(this,s,c,m,y)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=X.getValueOrDefault(a._scale,e,dCt),p.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,hCt),p.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,mCt),p.maximumScale=X.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=M.clone(d,p.modelMatrix),p.shadows=X.getValueOrDefault(a._shadows,e,_Ct),p.heightReference=X.getValueOrDefault(a._heightReference,e,yCt),p.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,ACt,Awe),p.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,bCt),p.color=X.getValueOrDefault(a._color,e,xCt,Awe),p.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,TCt),p.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,ECt),p.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,gCt),p.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,CCt);let g=X.getValueOrUndefined(a._lightColor,e);if(l(g)&&(z.pack(g,bwe,0),g=h.unpack(bwe,0,wCt)),p.lightColor=g,p.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:bf.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(y)){let x=Object.keys(y);for(let T=0,E=x.length;T<E;++T){let v=x[T],S=y[v];if(!l(S))continue;let I=p.getNode(v);if(!l(I))continue;let R=M.fromTranslationRotationScale(S,SCt);I.matrix=M.multiply(I.originalMatrix,R,R)}}let A=!1,b=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(b)){let x=Object.keys(b);for(let T=0,E=x.length;T<E;++T){let v=x[T],S=b[v];l(S)&&(A=!0,p.setArticulationStage(v,S))}}A&&p.applyArticulations()}}return!0};wA.prototype.isDestroyed=function(){return!1};wA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(wA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Nte(this,e[i],t,n);return ue(this)};var LR=new h,PCt=new he;wA.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Pt.FAILED;if(n.loadFailed)return Pt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Pt.PENDING;if(!i.ready||!n.modelUpdated)return Pt.PENDING;let r=this._scene,o=r.ellipsoid??ee.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;LR.x=a[12],LR.y=a[13],LR.z=a[14];let c=o.cartesianToCartographic(LR,PCt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=Ap(r,n,LR,[i],()=>f[e.id]===n);if(d===void 0)return Pt.PENDING;d!==null&&(u=d)}return l(u)&&(i.heightReference===We.CLIP_TO_GROUND?c.height<u&&(c.height=u):ps(i.heightReference)?c.height=u:c.height+=u),le.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return le.clone(i.boundingSphere,t),Pt.DONE};wA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(DCt(o,a),s.set(o.id,o)):(Nte(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Nte(this,o,a,c),s.remove(o.id)};function Nte(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function DCt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Rj=wA;function IA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(IA.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Wi.FIXED}}});var RCt=new K;IA.prototype.getValue=function(e,t){return l(e)||(e=K.now(RCt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};IA.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))};IA.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};IA.prototype.equals=function(e){return this===e||e instanceof IA&&this._value===e._value};IA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Gg=IA;var xwe=new $,Twe=new $,Ewe=new $,OCt=new h,Cwe=new h,MCt=new h,NCt=new h,Oj=new Le,Mj=new M,Nj=new $;function BR(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,Oj)&&(Le.conjugate(Oj,Oj),$.fromQuaternion(Oj,Nj),$.multiplyByVector(Nj,r,r));else if(l(Bte(e,i.position,Mj)))M.inverse(Mj,Mj),M.getRotation(Mj,Nj),$.multiplyByVector(Nj,r,r);else return;return r}}function Bte(e,t,n){let i=t.getValue(e,OCt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,Cwe);if(l(o)&&!h.equalsEpsilon(i,o,P.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,xwe),a=At.computeFixedToIcrfMatrix(r,Twe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,Ewe),s=$.transpose(c,xwe),a=At.computeTemeToPseudoFixedMatrix(r,Twe),$.transpose(a,a)):c=$.transpose(s,Ewe);let u=MCt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,NCt);if(!h.equalsEpsilon(f,h.ZERO,P.EPSILON16)){let d=h.cross(f,u,Cwe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new M),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var vwe=60,Rwe=1,Owe=new vn,Lte=new vn,Fte=new vn;function Swe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var Lj=new h;function LCt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof no&&(u=o,f=u.position,o=Wi.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,Lj),g=BR(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,E=!1,v,S,I;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,Lj),l(g)&&l(m)&&(g=BR(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,Lj),l(g)&&l(m)&&(g=BR(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(s>0&&!E){let R=i[A+1],O=K.secondsDifference(R,x);E=O>s,E&&(v=Math.ceil(O/s),S=0,I=O/Math.max(v,2),v=Math.max(v-1,1))}if(E&&S<v){x=K.addSeconds(x,I,new K),S++;continue}}E=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,Lj),l(g)&&l(m)&&(g=BR(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function FCt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function BCt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function kCt(e,t,n,i,r,o,s,a){Fte.start=t,Fte.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!vn.intersect(d,Fte,Owe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function UCt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function zCt(e,t,n,i,r,o,s,a){Lte.start=t,Lte.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!vn.intersect(d,Lte,Owe).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=Mwe(d.data,m,y,i,r,o,c,a)}}return c}function Mwe(e,t,n,i,r,o,s,a){for(;e instanceof bA;)e=e.resolvedProperty;if(e instanceof wc){let c=e._property._times;s=LCt(e,t,n,c,i,r,o,s,a)}else e instanceof jU?s=FCt(e,t,n,i,r,o,s,a):e instanceof Sc?s=zCt(e,t,n,i,r,o,s,a):e instanceof TA?s=kCt(e,t,n,i,r,o,s,a):e instanceof wu||e instanceof Gg&&X.isConstant(e)?s=UCt(e,t,n,i,r,o,s,a):s=BCt(e,t,n,i,r,o,s,a);return s}function kte(e,t,n,i,r,o,s){l(s)||(s=[]);let a=Mwe(e,t,n,i,r,o,0,s);return s.length=a,s}var wwe=new $,Iwe=new Le,Pwe=new $,FR=new vn,Fj=new vn,cT=new vn;function VCt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function Dwe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Lr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=kte(t,g,m,n,c,a,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=s.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=So.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,Rwe),d++}return d}function kR(e,t){this._unusedIndexes=[],this._polylineCollection=new zp,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}kR.prototype.update=function(e){let t=this._referenceFrame;if(t===Wi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,wwe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,wwe)),M.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof no){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,Iwe))&&($.fromQuaternion(Iwe,Pwe),M.fromRotationTranslation(Pwe,n,this._polylineCollection.modelMatrix)):Bte(e,t.position,this._polylineCollection.modelMatrix)}};kR.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(s=K.addSeconds(e,m,new K)),b){let E=A.start,v=A.stop;(!T||K.greaterThan(E,o))&&(o=E),(!x||K.lessThan(v,s))&&(s=v)}u=K.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,vwe),d=kte(r,o,s,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=So.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===Ug.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:vwe,y=g.intervals,A=0;if(l(y)){FR.start=o,FR.stop=s,FR.isStartIncluded=!0,FR.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!vn.intersect(x,FR,Fj))continue;let T=Fj.start,E=Fj.stop;if(K.greaterThanOrEquals(T,E))continue;let v=VCt(x.data),S=[K.clone(T),K.clone(E)];for(let I=0;I<v.length;I++){let R=v[I],O=R.intervals;if(l(O))for(let L=0;L<O.length;L++){let _=O.get(L);vn.intersect(_,Fj,cT)&&(K.greaterThan(cT.start,T)&&K.lessThan(cT.start,E)&&S.push(K.clone(cT.start)),K.greaterThan(cT.stop,T)&&K.lessThan(cT.stop,E)&&S.push(K.clone(cT.stop)))}else if(!X.isConstant(R)){let L=K.clone(T);for(;K.lessThan(L,E);)S.push(K.clone(L)),L=K.addSeconds(L,m,new K)}}A=Dwe(S,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(s)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,s);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=Dwe(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,Rwe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};kR.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);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};kR.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Kp(e,t){t.collectionChanged.addEventListener(Kp.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}Kp.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,r=n.length;i<r;i++){let o=n[i],s=o.entity,a=s._position,c=s._path,u=o.updater,f=!1,d=Wi.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Wi.FIXED,p=d.toString()):m==="INERTIAL"?(d=Wi.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=a.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new kR(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};Kp.prototype.isDestroyed=function(){return!1};Kp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Kp.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Kp.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new Swe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new Swe(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};Kp._subSample=kte;Kp._computeVvlhTransform=Bte;Kp._transformToEntityFrame=BR;var Bj=Kp;var Nwe=z.WHITE,Lwe=z.BLACK,Fwe=0,Bwe=1,kwe=0,Uwe=$o.NONE,zwe=new z,jCt=new h,Vwe=new z,jwe=new qt,Hwe=new qt,Gwe=new Gt;function Wwe(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 PA(e,t){t.collectionChanged.addEventListener(PA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}PA.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,jCt),d=l(p)),!d){UR(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(UR(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(UR(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,jwe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Hwe),c.color=X.getValueOrDefault(a._color,e,Nwe,zwe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,Lwe,Vwe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,Fwe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,Bwe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Gwe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,kwe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,Uwe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,jwe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Hwe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Gwe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,kwe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,Uwe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,Nwe,zwe),A=X.getValueOrDefault(a._outlineColor,e,Lwe,Vwe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,Fwe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,Bwe)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)),g){o.color=z.clone(y,o.color),o.outlineColor=z.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,E=y.toCssColorString(),v=A.toCssColorString(),S=JSON.stringify([E,x,v,b]);u.setImage(S,gS(T,E,v,b,x))}m&&u._updateClamping()}}return!0};PA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Pt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Ap(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=Ry(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};PA.prototype.isDestroyed=function(){return!1};PA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(PA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};PA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new Wwe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Wwe(o)):(UR(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],UR(s.get(o.id),o,a),s.remove(o.id)};function UR(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var kj=PA;var HCt=new Ti(0),Uj={},qwe=new z,GCt=new Kt(z.WHITE),WCt=new Ti(!0),qCt=new Ti(Dn.DISABLED),YCt=new Ti(new Gt),XCt=new Ti(ti.BOTH);function KCt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function $Ct(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function lm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(lm.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 KCt,this._groundGeometryOptions=new $Ct,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=no.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(lm.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)&&X.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}}});lm.prototype.isOutlineVisible=function(e){return!1};lm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};lm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ei.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,qwe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new kC(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,qwe)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Bt({id:t,geometry:new py(this._geometryOptions),attributes:s}))};lm.prototype.createOutlineGeometryInstance=function(e){};lm.prototype.isDestroyed=function(){return!1};lm.prototype.destroy=function(){this._entitySubscription(),ue(this)};lm.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(nt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??GCt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??WCt,this._shadowsProperty=r.shadows??qCt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??YCt,this._classificationTypeProperty=r.classificationType??XCt,this._fillEnabled=!0,this._zIndex=a??HCt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(nt.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?A=Ks.VERTEX_FORMAT:A=Tc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(nt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(nt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(nt.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(nt.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&yt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};lm.prototype.createDynamicUpdater=function(e,t){return new zR(e,t,this)};var sw={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function zR(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 Ywe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Uj[n];!l(i)||i.isDestroyed()?(i=new zp,Uj[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}zR.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=X.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)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Kt)p=new Ks;else{let g=So.getValue(e,d,this._material);p=new Tc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new bp({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Ywe(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=ln.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(sw.ellipsoid=f,sw.positions=o,sw.granularity=X.getValueOrUndefined(i._granularity,e),sw.height=cr.extractHeights(o,f),c===ln.GEODESIC?o=cr.generateCartesianArc(sw):o=cr.generateCartesianRhumbArc(sw)),a.show=!0,a.positions=o.slice(),a.material=So.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};zR.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),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=Ywe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};zR.prototype.isDestroyed=function(){return!1};zR.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Uj[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Uj[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var zj=lm;var JCt=new z,ZCt=new Gt,QCt=new Gt;function um(e,t,n,i,r){let o;n instanceof Kt?o=Ks:o=Tc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(um.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt,this.zIndex=i,this._asynchronous=r}um.prototype.onMaterialChanged=function(){this.invalidated=!0};um.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};um.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||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};um.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};um.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new bp({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===Tc&&(this.material=So.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===Tc&&(this.material=So.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,JCt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,QCt,ZCt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ei.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};um.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};um.prototype.contains=function(e){return this.updaters.contains(e.id)};um.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};um.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 aw(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}aw.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new um(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};aw.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};aw.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};aw.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};aw.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 Vj=aw;var evt=[];function Xwe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function Kwe(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 r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Kt?1:2);let o;l(i)&&(o=i+r*Dn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function $p(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r,o=Dn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new sm(n,Ks,void 0,!1,r),this._materialBatches[r]=new cm(n,Tc,void 0,!1,r),this._colorBatches[r+o]=new sm(n,Ks,Ks,!1,r),this._materialBatches[r+o]=new cm(n,Tc,Ks,!1,r),this._colorBatches[r+o*2]=new sm(n,Ks,Tc,!1,r),this._materialBatches[r+o*2]=new cm(n,Tc,Tc,!1,r);this._dynamicBatch=new YS(n,i);let s=ti.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new Vj(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new zt,this._updaters=new zt,this._entityCollection=t,t.collectionChanged.addEventListener($p.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,evt)}$p.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Xwe(this,f),Kwe(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),Xwe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new zj(c,this._scene),this._updaters.set(u,f),Kwe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener($p._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var tvt=[],nvt=new le;$p.prototype.getBoundingSphere=function(e,t){let n=tvt,i=nvt,r=0,o,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=le.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,le.fromBoundingSpheres(n,t),Pt.DONE)};$p.prototype.isDestroyed=function(){return!1};$p.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($p.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(),ue(this)};$p._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};$p.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var jj=$p;function Uu(e){Su.initializeTerrainHeights(),bp.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Xo,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=e.visualizersCallback??Uu.defaultVisualizersCallback;let i=!1,r=new Yl,o=new Yl;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new aj;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var cw=[];Uu.registerVisualizer=function(e){cw.includes(e)||cw.push(e)};Uu.unregisterVisualizer=function(e){if(cw.includes(e)){let t=cw.indexOf(e);cw.splice(t,1)}};Uu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new eU(t,i),new Pj(e,i,n._primitives,n._groundPrimitives),new Dj(t,i),new Rj(e,i),new ej(e,i),new kj(t,i),new Bj(e,i),new jj(e,i,n._primitives,n._groundPrimitives),...cw.map(r=>new r(e,i))]};Object.defineProperties(Uu.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}}});Uu.prototype.isDestroyed=function(){return!1};Uu.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)),ue(this)};Uu.prototype.update=function(e){if(!Ni.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,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),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Uu.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var ivt=[],rvt=new le;Uu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Pt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return Pt.FAILED;let s=ivt,a=rvt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===Pt.PENDING)return Pt.PENDING;u===Pt.DONE&&(s[c]=le.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,le.fromBoundingSpheres(s,n),Pt.DONE)};Uu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Yl),s=r.add(new Aj);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Uu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};Uu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var Hj=Uu;var $we=new $,Jwe=new $,Zwe=new $,ovt=new M,Gj=new h,Qwe=new h,Ute=new h,zte=new h,eIe=new h,tIe=new h,svt=new Le,avt=new h,cvt=new $,lw=new K,lvt=1.25;function uvt(e,t,n,i,r,o,s,a,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,lw);let I=r.getValue(lw,Gj);if(l(I)||(K.addSeconds(c,-.001,lw),I=r.getValue(lw,Gj),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,$we),O=At.computeFixedToIcrfMatrix(lw,Jwe),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,Zwe),R=$.transpose(L,$we),O=At.computeTemeToPseudoFixedMatrix(lw,Jwe),$.transpose(O,O)):L=$.transpose(R,Zwe);let _=$.multiplyByVector(R,d,eIe),C=$.multiplyByVector(O,I,tIe);h.subtract(_,C,zte);let w=h.magnitude(zte)*1e3,D=P.GRAVITATIONALPARAMETER,N=-D/(w*w-2*D/h.magnitude(_));N<0||N>lvt*u.maximumRadius?(m=Qwe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,Ute),y=h.cross(A,m,Gj),h.magnitude(y)>P.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,Ute),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,P.EPSILON7)||(A=Qwe,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,Ute),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,P.EPSILON7)||(m=h.cross(y,A,Gj),$.multiplyByVector(L,m,m),$.multiplyByVector(L,y,y),$.multiplyByVector(L,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,zte),x=h.clone(t.direction,eIe),T=h.clone(t.up,tIe));let E=ovt,v;l(s)&&(v=s.getValue(c,svt));let S=o.getValue(c,avt);if(a===Cy.INERTIAL&&l(v))M.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===Cy.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,cvt);M.fromRotationTranslation(I,d,E)}else a===Cy.ENU||!p?At.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=y.x,E[5]=y.y,E[6]=y.z,E[7]=0,E[8]=A.x,E[9]=A.y,E[10]=A.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function VR(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ee.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new CA(e.position,!0),this._offset3D=new h}Object.defineProperties(VR,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});VR.defaultOffset3D=new h(-14e3,3500,3500);var Wj=new Oh,fvt=new h;VR.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,s=o.trackingReferenceFrame,a=o.position;if(!l(a))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){Wj.pitch=-P.PI_OVER_FOUR,Wj.range=0;let b=a.getValue(e,fvt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);Wj.pitch*=x}p.viewBoundingSphere(t,Wj),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(VR._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,uvt(this,p,g,m,a,c,u,s,e,i)};var qj=VR;Jp();lc();dT();E6();rO();var OPe={type:"module"},fne="error",Zvt="messageerror",MPe,une,NPe,dne=!0;try{dne=typeof structuredClone==Do&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}DPe(Qvt);function Qvt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Do&&(o=o());let s;try{s=w6(e.workerURI,n,e)}catch{return cne(e),lne(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await eSt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return cne(e),LPe(e),S6(e,t);if(a&&a.codecImportFailed){if(e.reader)return LPe(e),S6(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function eSt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(gT);throw m.workerStartupFailed=!0,m}let n,i,r=new Promise((g,m)=>{n=g,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:s}=e,{writable:a,closed:c,abortPipe:u}=tSt(e.writable),f;try{f=hne({type:CPe,options:s,config:t,readable:o,writable:a},e)}catch(g){u();try{await c}catch{}throw e.onTaskFinished(),g}f||Object.assign(e,{reader:o.getReader(),writer:a.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>nSt(e),d));try{let g=await r;return await p(),await c,g}catch(g){await p(),u();try{await c}catch{}throw g}async function p(){if(!f&&!a.locked)try{await a.getWriter().close()}catch{}}}function tSt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function LPe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function mne(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function w6(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(une===ke||MPe!==e){let u=typeof e==Do;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===ke&&(i=!1),i&&(c=OPe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return w6(e,t,n,i,!1);if(i)throw p;return w6(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=OPe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return w6(e,t,n,!1,r);throw p}}MPe=e,une=a,NPe=c}else s=new Worker(une,NPe);return s.addEventListener(EPe,u=>{n.workerAlive=!0,BPe(n),iSt(u,n)}),s.addEventListener(fne,u=>FPe(u,n)),s.addEventListener(Zvt,u=>FPe(u,n)),s}function nSt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(mne(e),e.worker=null,t){let i=new Error(gT);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function BPe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function FPe(e,t){e.preventDefault&&e.preventDefault(),BPe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;mne(t),n||(t.worker=null);let s=e.error||new Error(e.message||fne);n||(s=Object.assign(new Error(s.message||fne),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function hne(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=s6(o),c.push(e.value.buffer)),i&&dne&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{dne=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function iSt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(s){let{message:y,stack:A,code:b,name:x,outputSize:T,cause:E,codecImportFailed:v}=s,S=new Error(y);Object.assign(S,{stack:A,code:b,name:x,outputSize:T}),E&&(S.cause=Object.assign(new Error(E.message),{name:E.name})),v&&(S.codecImportFailed=!0),m(S)}else{if(n==vPe){let{value:y,done:A}=await a.read();g()||hne({type:rne,value:y,done:A,messageId:r},t)}n==rne&&(await c.ready,await c.write(new Uint8Array(i)),g()||hne({type:SPe,messageId:r},t)),n==wPe&&m(null,o)}}catch(y){g()||(mne(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}Lie();lc();Jp();mT();rO();R6();F6();Xte();dT();Aw();jne();HR();var Yie="File already exists",Xie="Zip file comment exceeds 64KB",BDe="Invalid zip file comment (must be a Uint8Array)",kDe="File entry comment exceeds 64KB",UDe="Invalid file entry comment (must be a string)",zDe="Invalid date (must be a valid Date instance)",VDe="File entry name exceeds 64KB",Kie="Version exceeds 65535",jDe="The strength must equal 1, 2, or 3",HDe="Encryption is not supported in USDZ files",GDe="Encryption is not supported when the 'passThrough' option is set",WDe="Invalid extra field (must be a Map)",qDe="Invalid extra field type (must be integer 0..65535)",YDe="Invalid extra field data (must be a Uint8Array)",dH="Extra field data exceeds 64KB",Twt="Compression method not supported",XDe=-2147483648,KDe=2147483647,wDe=BigInt(0),IDe=BigInt("0x7fffffffffffffff"),hH="Zip64 is not supported (set the 'zip64' option to 'true')",$De="Undefined uncompressed size",JDe="Undefined compression method";var ZDe="Undefined reader",QDe="Zip file not empty",e1e="Invalid uid (must be integer 0..2^32-1)",t1e="Invalid gid (must be integer 0..2^32-1)",n1e="Invalid UNIX mode (must be integer 0..65535)",i1e="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",r1e="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",o1e="Invalid msdosAttributesRaw (must be integer 0..255)",s1e="Invalid msdosAttributes (must be an object with boolean flags)",a1e="Invalid level (must be integer 0..9)",c1e="Signature data exceeds 64KB",PDe=new Uint8Array([7,0,2,0,65,69,3,0,0]),Ewt=4,Cwt=9,vwt=67,Swt=1,jie="infozip",Hie="unix",wwt=9,Fie=0,DDe=[],bO=class{constructor(t,n={}){t=new Dw(t);let{availableSize:i=lT,maxSize:r=lT}=t,o=i>0&&i!==lT&&r>0&&r!==lT;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[jR]===ke?t.size||t.writable.size||0:n[jR],initialOffset:n[jR]===ke?0:n[jR]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Bie(this,Iwt(this,t))}appendZip(t){return Bie(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:r,fileEntries:o}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(f=>s=f);i.add(a);let c=[],u;try{t=new Kg(t),await Ic(t),(t.size===ke||!t.readUint8Array)&&(t=new Vu(await e0(t.readable)),await Ic(t));let{ZipReader:f}=await Promise.resolve().then(()=>(Lie(),EDe)),d=new f(t),p=await d.getEntries();await d.close(),await Ic(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(Yie);r.add(A),c.push(A)}),n.writerLocked=!0;let{lockWriter:m}=n;n.lockWriter=new Promise(A=>u=()=>{n.writerLocked=!1,A()}),await m,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await Ywt(t)||(await o0(n.writer,u1e()),n.offset+=4));let y=await Xwt(n,t,p,g);p.forEach(A=>{let{version:b,rawLastModDate:x,rawFilename:T,bitFlag:E,encrypted:v,uncompressedSize:S,compressedSize:I,extraFieldZip64:R}=A,{compressionMethod:O,rawExtraField:L}=A,{level:_,languageEncodingFlag:C,dataDescriptor:w}=E;L=l1e(L||dr),A.extraFieldAES&&(O=99);let D=Qi(L),N=!!R&&R.uncompressedSize!==ke,F=!!R&&R.compressedSize!==ke,V=p1e(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=m1e({version:b,bitFlag:V,compressionMethod:O,uncompressedSize:S,compressedSize:I,rawLastModDate:x,rawFilename:T,zip64CompressedSize:F,zip64UncompressedSize:N,extraFieldLength:D}),{crc32:k}=A;k!==ke&&Pc(j,10,k);let{offset:G,diskNumberStart:q}=y.get(A);Object.assign(A,{zip64UncompressedSize:N,zip64CompressedSize:F,offset:G,diskNumberStart:q,zip64DiskNumberStart:!1,rawExtraFieldZip64:dr,rawExtraFieldAES:dr,rawExtraFieldExtendedTimestamp:dr,rawExtraFieldNTFS:dr,rawExtraFieldUnix:dr,rawExtraField:L,rawCentralExtraField:dr,extendedTimestamp:!1,headerArray:B,headerView:j}),o.set(A.filename,A)})}catch(f){throw c.forEach(d=>r.delete(d)),f}finally{s(),i.delete(a),u&&u()}}add(t="",n,i={}){let r=this,{pendingAddFileCalls:o}=r,s=Pwt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),Bie(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==uT&&(t=i.get(t)),t&&t.filename!==ke){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=dr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(BDe);if(Qi(t)>65535)throw new Error(Xie);for(;r.size;)await Promise.allSettled(Array.from(r));await Promise.allSettled(i.pendingErrors.map(u=>u.recorded));let a=i.pendingErrors.filter(u=>u.error&&!u.observed);if(a.length){let u=a.map(d=>d.error);a.forEach(d=>d.observed=!0);let[f]=u;try{f.entryErrors=u}catch{}throw f}return await jwt(i,t,n),!L6(o)&&Xi(i,n,e6)||await s.getWriter().close(),o.getData?o.getData():s}};var Gie=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Bie(e,t){let n=new Gie((r,o)=>Promise.prototype.then.call(t,r,o)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,ke,r=>i.error=r),e.pendingErrors.push(i),n}async function Iwt(e,t){if(e.filenames.size)throw new Error(QDe);await e.appendZipEntries(t)}async function Pwt(e,t,n,i){if(i=Object.assign({},i),Xi(e,i,yT)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Yie);e.filenames.add(t),Fie<qg().maxWorkers?Fie++:await new Promise(r=>DDe.push(r));try{return await Dwt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=DDe.shift();r?r():Fie--}}async function Dwt(e,t,n,i){let r=Rwt(e,t,i);({name:t}=r);let o=Owt(e,t,i),{comment:s}=o,a=i[V6];e.fileEntries.set(t,ke);let c=e.lastFileEntry,u={},f;o.resolvedOptions.keepOrder&&(u.lockFileEntry=new Promise(p=>f=p)),e.lastFileEntry=u;let d;try{let{resolvedOptions:p}=o;p.level!=0&&p.compressionMethod===ke&&!p.passThrough&&!await RPe(qg())&&(p.level=0);let g=await Mwt(e,n,o,i);({reader:n}=g);let m=xO(e.writer),y=Zg(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[z6],crc32:i.crc32===ke?i[z6]:i.crc32,offset:e.offset-m,diskNumberStart:y,[fw]:e.options[fw]});let A=Bwt(i),b=Uwt(i),x=Qi(A.localHeaderArray,b.dataDescriptorArray);d=await Lwt(e,t,n,{headerInfo:A,dataDescriptorInfo:b,metadataSize:x,fileEntry:u,previousFileEntry:c,releaseLockFileEntry:f},i)}catch(p){throw e.fileEntries.delete(t),p}finally{f&&f(c&&c.lockFileEntry)}return Object.assign(d,{name:t,comment:s,extraField:a,[B6]:d.internalFileAttributes,[k6]:d.externalFileAttributes}),new LA(d)}function Rwt(e,t,n){let i=Xi(e,n,Rne),r=Xi(e,n,Nne,i?20:768),o=Xi(e,n,Fne),s=Vw(e,n,"uid"),a=Vw(e,n,"gid"),c=Vw(e,n,kne),u=Xi(e,n,PIe),f=Xi(e,n,Une),d=Xi(e,n,zne),p=Xi(e,n,Vne);if(hw(s,4294967295,e1e),hw(a,4294967295,t1e),hw(c,65535,n1e),u!==ke&&u!==jie&&u!==Hie)throw new Error(i1e);if(u===Hie&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(r1e);u===ke&&(s!==ke||a!==ke)&&(u=jie);let g=Vw(e,n,Pne),m=Xi(e,n,Dne),y=s!==ke||a!==ke||c!==ke||u||o,A=g!==ke||m!==ke;if(y?(i=!1,r=r&255|768):A&&(i=!0,r=r&255),hw(g,255,o1e),m&&(typeof m!==nIe||Array.isArray(m)))throw new Error(s1e);if(r>65535)throw new Error(Kie);let b=h1e(e,n,Ine,k6),x=b!==ke;x||(b=0),!n[yT]&&t.endsWith("/")&&(n[yT]=!0);let T=Xi(e,n,yT);if(T?(t.endsWith("/")||(t+="/"),x||(b=16,i||(b|=16877<<16))):!i&&!x&&(o?b=493<<16:b=420<<16),!i){let S=c!==ke||!!(f||d||p),I=b>>16&65535;c=c===ke?I:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),(!x||S)&&(T?c=c&-61441|16384:c&61440||(c|=32768),b=(c&65535)<<16|b&65535)}({msdosAttributesRaw:g,msdosAttributes:m}=kwt(g,m)),A&&(b=b&4294967295|g&255);let E=b>>16&65535,v=c!==ke&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:!!i,externalFileAttributes:b,unixExternalUpper:E,uid:s,gid:a,unixMode:c,unixExtraFieldType:u,symlink:v,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function Owt(e,t,n){let i=Wie(e,n,IIe)||pw,r=i(t,t6);if(r===ke&&(r=pw(t)),Qi(r)>65535)throw new Error(VDe);let o=n[lO]||"";if(typeof o!=uT)throw new Error(UDe);let s=i(o,n6);if(s===ke&&(s=pw(o)),Qi(s)>65535)throw new Error(kDe);let a=Xi(e,n,Mne);if(a!==ke&&a>65535)throw new Error(Kie);let c=Vie(e,n,Rw,new Date),u=Xi(e,n,Ow),f=Vie(e,n,fO),d=Vie(e,n,dO),p=h1e(e,n,wne,B6,0),g=Xi(e,n,Kj),m=Xi(e,n,Yj),y=Xi(e,n,Xj);o6(m,y);let A=Vw(e,n,yIe,3),b=Xi(e,n,Lne),x=Xi(e,n,AIe,!0),T=Xi(e,n,bIe),E=Xi(e,n,xIe,!0),v=Xi(e,n,Jj),S=Xi(e,n,Qj),I=Xi(e,n,EIe),R=Wie(e,n,CIe),O=Xi(e,n,vIe,!0),L=r6(Xi(e,n,$j)),_=Xi(e,n,SIe,!0),C=Xi(e,n,Bne),w=g||C===ke?ke:p6(C);if(!g&&C!==ke&&C!==0&&C!==8&&!w)throw new Error(Twt);let D=Vw(e,n,TIe);if(hw(D,wwt,a1e),e.options[fw]){if(m!==ke||y!==ke)throw new Error(HDe);D===ke&&C===ke&&(D=0)}g&&(D=ke);let N=Xi(e,n,Zj),F=Xi(e,n,jte);I&&F===ke&&(F=!1),(F===ke||b&&!g)&&(F=!0),D!==ke&&D!=6&&(N=!1);let V=Xi(e,n,U6);if(!b&&(m!==ke||y!==ke)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(jDe);let B=kie(n[V6]),j=kie(n[DIe]),k=kie(n[RIe]);return{comment:o,resolvedOptions:{rawFilename:r,rawComment:s,version:a,lastModDate:c,rawLastModDate:u,lastAccessDate:f,creationDate:d,internalFileAttributes:p,passThrough:g,password:m,rawPassword:y,encryptionStrength:A,zipCrypto:b,extendedTimestamp:x,ntfsTimestamp:T,keepOrder:E,useWebWorkers:v,transferStreams:S,bufferedWrite:I,createTempStream:R,dataDescriptorSignature:O,signal:L,useUnicodeFileNames:_,compressionMethod:C,format:w?w.format:ke,codecURI:w?w.codecURI:ke,codecVersionNeeded:w?w.versionNeeded:ke,level:D,useCompressionStream:N,dataDescriptor:F,zip64:V,rawExtraField:B,rawLocalExtraField:j,rawCentralExtraField:k}}}function kie(e){if(!e)return dr;if(!(e instanceof Map))throw new Error(WDe);let t=0,n=0;e.forEach((o,s)=>{if(Wte(s,65535,qDe),!(o instanceof Uint8Array))throw new Error(YDe);if(Qi(o)>65535)throw new Error(dH);t+=4+Qi(o)});let i=new Uint8Array(t),r=li(i);return e.forEach((o,s)=>{r0(r,n,s),r0(r,n+2,Qi(o)),CO(i,o,n+4),n+=4+Qi(o)}),i}async function Mwt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Xi(e,i,yT))throw new Error(ZDe);let r;return t&&(t=new Kg(t),await Ic(t),{size:r}=t),Object.assign({reader:t},Nwt(e,!!t,r,n,i))}function Nwt(e,t,n,i,r){let{passThrough:o,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=i,{dataDescriptor:f,zip64:d,level:p,compressionMethod:g}=i,m=0,y=0;if(o&&t){if(y=r[uO],y===ke)throw new Error($De);if(g===ke)throw new Error(JDe)}let A=d===!0,b=Xi(e,r,One);if(t&&o&&!b&&Qi(a,c))throw new Error(GDe);let x=t&&(!!(a&&Qi(a)||c&&Qi(c))||o&&b);t||(p=0,g=0);let T=x?s?12:16+u*4:0;t&&(o?(r.uncompressedSize=y,m=n===ke?FDe(y)+T:n):n===ke?(f=!0,(d||d===ke)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(qie(g,p)?FDe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!qie(g,p);E&&!s&&Xi(e,r,jte)===ke&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(hH);d=!0}return d=d||!1,{maximumCompressedSize:m,resolvedOptions:{dataDescriptor:f,emptyEntry:E,zip64:d,zip64UncompressedSize:v,zip64CompressedSize:S,uncompressedSize:y,level:p,compressionMethod:g,encrypted:x}}}async function Lwt(e,t,n,i,r){let{fileEntries:o,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:u,signal:f}=r,{headerInfo:d,fileEntry:p,previousFileEntry:g,releaseLockFileEntry:m}=i,y=e.options[fw],A=p,b,x,T,E,v,S=0,I,R=a&&g?g.lockFileEntry:ke;o.set(t,A);try{r.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!u?(b=!0,e.bufferedWrites++,r.createTempStream?I=await r.createTempStream():I=new TransformStream(ke,ke,{highWaterMark:lT}),I.size=0,await Ic(s)):(I=s,await R,await O()),await Ic(I);let _=xO(s);e.addSplitZipSignature&&!b&&await MDe(e,s),y&&!b&&RDe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=Zg(s),D=TO(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await o0(I,C)),A=await Fwt(n,I,A,i,qg(),r),b||(E=!1),o.set(t,A),A.filename=t,b){if(await Promise.all([I.writable.getWriter().close(),R]),await O(),e.addSplitZipSignature&&await MDe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=Zg(s),A.offset=TO(e,s),y){let N=i.metadataSize;RDe(i,e.offset-xO(s)),A.size+=i.metadataSize-N}Vwt(A,d.localHeaderView,r),await o0(s,d.localHeaderArray),await f1e(I.readable,s,f,N=>S+=N),s.size+=I.size,T=!1}else A.diskNumberStart=w,A.offset=D;return e.offset+=A.size,A}catch(_){if(T||E){if(e.hasCorruptedEntries=!0,_)try{_.corruptedEntry=!0}catch{}e.offset+=s.size-v,b&&(e.offset+=S)}throw o.delete(t),_}finally{if(b&&e.bufferedWrites--,m&&m(R),x&&x(),b&&I&&I.dispose)try{await I.dispose()}catch{}}async function O(){e.writerLocked=!0;let{lockWriter:_}=e;e.lockWriter=new Promise(C=>x=()=>{e.writerLocked=!1,C()}),await _}async function L(){jw(s,Qi(d.localHeaderArray))&&await s.closeDisk()}}async function Fwt(e,t,{diskNumberStart:n,lockFileEntry:i},r,o,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:v,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R}=a,{dataDescriptorArray:O}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:w,rawPassword:D,level:N,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:B,zipCrypto:j,dataDescriptor:k,directory:G,executable:q,versionMadeBy:Q,rawComment:W,rawExtraField:J,rawCentralExtraField:Z,useWebWorkers:ae,transferStreams:Ae,onstart:fe,onprogress:xe,onend:ge,signal:we,encryptionStrength:ve,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Ye,uid:Ke,gid:Pe,unixMode:qe,symlink:st,setuid:vt,setgid:jt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Yt,useCompressionStream:rt,passThrough:ht,format:Li,codecURI:Yn}=s,gi={lockFileEntry:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:W,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R,rawExtraField:J,rawCentralExtraField:Z,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Ye,diskNumberStart:n,uid:Ke,gid:Pe,unixMode:qe,symlink:!!st,setuid:vt,setgid:jt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Yt},{crc32:zi,uncompressedSize:Si}=s,ui=0;ht||(Si=0);let{writable:_i}=t;if(e){let zn=dm(yne(e)),tn=e.size,Hn={options:{codecType:Cw,inputSize:tn,level:N,rawPassword:D,password:w,encryptionStrength:ve,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:ae,useCompressionStream:rt,transferStreams:Ae,format:Li,codecURI:Yn,compressionMethod:b},config:o,streamOptions:{signal:we,size:tn,onstart:fe,onprogress:xe,onend:ge}};try{let Ki=await D6({readable:zn,writable:_i},Hn);if(ui=Ki.outputSize,t.size+=ui,ht||(Si=Ki.inputSize,(!m||j)&&(zi=Ki.crc32)),!B&&ui>=4294967295||!V&&Si>=4294967295)throw new Error(hH)}catch(Ki){throw Ki.outputSize!==ke&&(t.size+=Ki.outputSize),Ki}}return zwt({crc32:zi,compressedSize:ui,uncompressedSize:Si,headerInfo:a,dataDescriptorInfo:c},s),k&&await o0(t,O),Object.assign(gi,{uncompressedSize:Si,compressedSize:ui,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+ui,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:zi,crc32:m&&!j&&!ht?ke:zi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),gi}function Bwt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:r,creationDate:o,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:u,dataDescriptor:f,directory:d,rawExtraField:p,rawLocalExtraField:g,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:A,passThrough:b,encrypted:x,zip64UncompressedSize:T,zip64CompressedSize:E,uncompressedSize:v,crc32:S}=e,{version:I,compressionMethod:R}=e,O=!d&&qie(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=Mf(20);if(ge.writeUint16(1),ge.writeUint16(16),L=ge.array,C&&(ge.writeUint64(v),_)){let we=x?c?12:16+m*4:0;ge.writeUint64(b?0:v+we)}}else L=dr;let D;if(x&&!c){let xe=Mf(Qi(PDe)+2);xe.writeUint16(39169),xe.writeBytes(PDe),D=xe.array,D[8]=m}else D=dr;let N,F,V;if(y){let xe=lH(n),ge=d1e(xe);if(ge){let ve=9+(r?4:0)+(o?4:0),Re=Mf(ve);V=1+(r?2:0)+(o?4:0),Re.writeUint16(21589),Re.writeUint16(ve-4),Re.writeUint8(V),Re.writeUint32(xe),r&&Re.writeUint32(NDe(lH(r))),o&&Re.writeUint32(NDe(lH(o))),F=Re.array}else F=dr;if(A===ke?!ge||!!(r||o):A)try{let ve=zie(n),Re=Mf(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(ve),Re.writeUint64(r?zie(r):ve),Re.writeUint64(o?zie(o):ve),N=Re.array}catch{N=dr}else N=dr}else N=F=dr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==jie&&(xe!==ke||ge!==ke)){let ve=ODe(xe===ke?0:xe),Re=ODe(ge===ke?0:ge),Qe=3+ve.length+Re.length,He=Mf(4+Qe);He.writeUint16(30837),He.writeUint16(Qe),He.writeUint8(1),He.writeUint8(ve.length),He.writeBytes(ve),He.writeUint8(Re.length),He.writeBytes(Re),B=He.array}else if(we==Hie&&(xe!==ke||ge!==ke)){let ve=Mf(8);ve.writeUint16(30805),ve.writeUint16(4),ve.writeUint16((xe===ke?0:xe)&65535),ve.writeUint16((ge===ke?0:ge)&65535),B=ve.array}else B=dr}catch{B=dr}R===ke&&(R=O?8:0),I===ke&&(I=R==0&&!d&&!x?10:20);let{codecVersionNeeded:j}=e;O&&j!==ke&&(I=I>j?I:j),a&&(I=I>45?I:45),x&&!c&&(I=I>51?I:51,b&&S!==ke&&(D[Ewt]=Swt),r0(li(D),Cwt,R),R=99);let k=w?Qi(L):0,G=k+Qi(D,F,N,B,p,g),q=e[fw]?vwt:0;if(G+q>65535)throw new Error(dH);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=m1e({version:I,bitFlag:p1e(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<uw?uw:Q>Vte?Vte:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=Mf(30+Qi(t)+G),Ae=ae.array,fe=li(Ae);return ae.writeUint32(67324752),ae.writeBytes(W),ae.writeBytes(t),w&&ae.writeBytes(L),ae.writeBytes(D),ae.writeBytes(F),ae.writeBytes(N),ae.writeBytes(B),ae.writeBytes(p),ae.writeBytes(g),f&&(E||Pc(fe,18,0),T||Pc(fe,22,0)),{localHeaderArray:Ae,localHeaderView:fe,headerArray:W,headerView:J,lastModDate:n,rawLastModDate:Z,encrypted:x,compressed:O,version:I,compressionMethod:R,extraFieldExtendedTimestampFlag:V,rawExtraFieldZip64:dr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:N,rawExtraFieldUnix:B,rawExtraFieldAES:D,extraFieldLength:G}}function RDe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+Qi(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=li(s);r0(a,0,6534),r0(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(Qi(c)+o),CO(i,c),CO(i,s,Qi(c));let u=li(i);r0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function ODe(e){let t=new Uint8Array(4);li(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function kwt(e,t){if(e!==ke)e=e&255;else if(t!==ke){let{readOnly:n,hidden:i,system:r,directory:o,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),r&&(a|=4),o&&(a|=16),s&&(a|=32),e=a&255}return t===ke&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function Uwt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=dr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=li(i),n&&(o=4,Pc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function zwt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:u,encrypted:f}=i,{dataDescriptorView:d,dataDescriptorOffset:p}=r;(!f||s||a)&&e!==ke&&(Pc(u,10,e),c&&Pc(d,p,e)),o?c&&(EO(d,p+4,BigInt(t)),EO(d,p+12,BigInt(n))):(Pc(u,14,t),Pc(u,18,n),c&&(Pc(d,p+4,t),Pc(d,p+8,n)))}function Vwt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:r,compressedSize:o,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},u,{dataDescriptor:f,passThrough:d}){if(f||((!t||d&&r!==ke)&&Pc(u,14,r),c||Pc(u,18,o),a||Pc(u,22,s)),n&&i){let p=30+Qi(e)+4;EO(u,p,BigInt(s)),EO(u,p+8,BigInt(o))}}async function jwt(e,t,n){let i=Hwt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await Gwt(e,i,n),a=await Wwt(e,s,n);await qwt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function Hwt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:u,extendedTimestamp:f,extraFieldExtendedTimestampFlag:d,lastModDate:p,zip64UncompressedSize:g,zip64CompressedSize:m,uncompressedSize:y,compressedSize:A}=n,b=n.offset>=4294967295,x=n.diskNumberStart>=65535,T;if(b||x||g||m){let I=4+(g?8:0)+(m?8:0)+(b?8:0)+(x?4:0),R=Mf(I);R.writeUint16(1),R.writeUint16(I-4),g&&R.writeUint64(y),m&&R.writeUint64(A),b&&R.writeUint64(n.offset),x&&R.writeUint32(n.diskNumberStart),T=R.array}else T=dr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=lH(p);if(f&&d1e(v)){let I=Mf(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=dr;n.rawExtraFieldExtendedTimestamp=E;let S=Qi(T,r,s,a,E,c,u);if(S>65535)throw new Error(dH);t+=46+Qi(i,o)+S}return t}async function Gwt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await Ic(r);let s=0,a=0,c=Zg(r),u=xO(r),f=0;for(let[d,p]of Array.from(i.values()).entries()){let{offset:g,rawFilename:m,rawExtraFieldZip64:y,rawExtraFieldAES:A,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:x,rawExtraFieldUnix:T,rawExtraField:E,rawCentralExtraField:v,rawComment:S,versionMadeBy:I,headerArray:R,headerView:O,zip64UncompressedSize:L,zip64CompressedSize:_,zip64DiskNumberStart:C,zip64Offset:w,internalFileAttributes:D,externalFileAttributes:N,diskNumberStart:F,uncompressedSize:V,compressedSize:B}=p,j=Qi(y,A,b,x,T,E,v),k=46+Qi(m,S)+j;jw(r,s+k-a)&&(await o0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=Zg(r),u=xO(r)),L||Pc(O,18,V),_||Pc(O,14,B),(w||C)&&p.version<45&&r0(O,0,45);let G=Mf(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(Qi(S)),G.writeUint16(C?65535:F),G.writeUint16(D),G.writeUint32(N),G.writeUint32(w?4294967295:g),G.writeBytes(m),G.writeBytes(y),G.writeBytes(A),G.writeBytes(b),G.writeBytes(x),G.writeBytes(T),G.writeBytes(E),G.writeBytes(v),G.writeBytes(S),CO(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new LA(p))}catch{}}return await o0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:Zg(r),entriesLength:f},directoryArray:o}}async function Wwt(e,t,n){let i=Wie(e,n,FIe);if(i){let r=await i(t),o=Qi(r);if(o>65535)throw new Error(c1e);let s=Mf(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return jw(a,Qi(s.array))&&await a.closeDisk(),await o0(a,s.array),6+o}return 0}async function qwt(e,t,n,i){let{writer:r}=e,{directoryStart:o,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,u=e.fileEntries.size,f=o.diskNumber,d=TO(e,o),p=Qi(t);if(p>65535)throw new Error(Xie);let g=Xi(e,n,U6),m=Zg(r);if(jw(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(hH);g=!0}let y=Mf(g?98:22);jw(r,Qi(y.array)+p)&&await r.closeDisk(),m=Zg(r);let A=m==s.diskNumber?s.entriesLength:0;g&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(m),y.writeUint32(f),y.writeUint64(A),y.writeUint64(u),y.writeUint64(c),y.writeUint64(d),y.writeUint32(117853008),y.writeUint32(m),y.writeUint64(BigInt(TO(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Xi(e,n,wIe,!0)&&(m=65535,f=65535),A=65535,u=65535,d=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(m),y.writeUint16(f),y.writeUint16(A),y.writeUint16(u),y.writeUint32(c),y.writeUint32(d),y.writeUint16(p),await o0(r,y.array),p&&await o0(r,t)}function Mf(e){let t=new Uint8Array(e),n=li(t),i=0;return{array:t,writeUint8:r=>{Jwt(n,i,r),i+=1},writeUint16:r=>{r0(n,i,r),i+=2},writeUint32:r=>{Pc(n,i,r),i+=4},writeUint64:r=>{EO(n,i,BigInt(r)),i+=8},writeBytes:r=>{CO(t,r,i),i+=Qi(r)},skip:r=>i+=r}}function Zg(e){let{diskNumber:t=0}=e;return t}function xO(e){let{diskOffset:t=0}=e;return t}function jw(e,t){let{availableSize:n=lT}=e;return t>n}function TO(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function Ywt(e){let t=await Ro(e,0,4);return $wt(li(t),0)==134695760}function l1e(e){let t=li(e),n=0;for(;n+4<=Qi(e);){let i=4+fH(t,n+2);if(fH(t,n)==1)return l1e(qd(e.subarray(0,n),e.subarray(Math.min(n+i,Qi(e)))));n+=i}return e}async function Xwt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>cH(t,c)-cH(t,u)),a=0;for(let c of s){let u=cH(t,c);await Uie(e,t,a,u-a),jw(r,await Kwt(t,u))&&await r.closeDisk(),o.set(c,{offset:TO(e,r),diskNumberStart:Zg(r)}),a=u}await Uie(e,t,a,i-a)}else{let s=e.offset;await Uie(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+cH(t,a),diskNumberStart:0}))}return o}async function Uie(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await f1e(yne(t,{offset:n,size:i}),r,ke,s=>o+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{r.size+=o,e.offset+=o}}}async function Kwt(e,t){let n=await Ro(e,t,30);if(Qi(n)<30)return 30;let i=li(n);return 30+fH(i,26)+fH(i,28)}function cH(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function u1e(){let e=new Uint8Array(4);return Pc(li(e),0,134695760),e}async function MDe(e,t){delete e.addSplitZipSignature,await o0(t,u1e()),e.offset+=4}async function o0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Qi(t),await i.write(t)}finally{i.releaseLock()}}async function f1e(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(Qi(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function zie(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<wDe?wDe:t>IDe?IDe:t}}function lH(e){return Math.floor(e.getTime()/1e3)}function d1e(e){return e>=XDe&&e<=KDe}function NDe(e){return Math.min(KDe,Math.max(XDe,e))}function Xi(e,t,n,i){let r=t[n]===ke?e.options[n]:t[n];return r===ke?i:r}function Vie(e,t,n,i){let r=Xi(e,t,n,i);if(r===null)return i;if(r!==ke&&(typeof r.getTime!=Do||Number.isNaN(r.getTime())))throw new Error(zDe);return r}function Wie(e,t,n){return dw(Xi(e,t,n))}function h1e(e,t,n,i,r){let o=LDe(t,n,i),s=o===ke?LDe(e.options,n,i):o;return s===ke?r:s}function LDe(e,t,n){return e[t]===ke?e[n]:e[t]}function Vw(e,t,n,i){return fT(Xi(e,t,n,i))}function FDe(e){return e+5*(Math.floor(e/16383)+1)}function qie(e,t){return e===ke?t===ke||t>0:e!==0}function fH(e,t){return e.getUint16(t,!0)}function $wt(e,t){return e.getUint32(t,!0)}function Jwt(e,t,n){e.setUint8(t,n)}function r0(e,t,n){e.setUint16(t,n,!0)}function Pc(e,t,n){e.setUint32(t,n,!0)}function EO(e,t,n){e.setBigUint64(t,n,!0)}function CO(e,t,n){e.set(t,n)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function m1e({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=Mf(26),p=d.array,g=li(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===ke){let m=new Uint32Array(1),y=li(m);r0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),r0(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),s=m[0]}return d.writeUint32(s),d.skip(4),c||r!==ke?d.writeUint32(c?4294967295:r):d.skip(4),u||i!==ke?d.writeUint32(u?4294967295:i):d.skip(4),d.writeUint16(Qi(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function p1e(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}F6();HR();Jp();mT();lc();Jp();mT();ine();var M4i=1024*1024;Aw();var F4i=1024*1024;var k4i=1024*1024;var U4i=512*1024;try{mw({baseURI:import.meta.url})}catch{}Jp();var Qwt=[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],eIt=[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],tIt=[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],nIt=[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],iIt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],SO=new Uint8Array(288);SO.fill(8,0,144),SO.fill(9,144,256),SO.fill(7,256,280),SO.fill(8,280,288);var rIt=new Uint8Array(30).fill(5);function vO(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;r<=15;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{l:t,symbols:i}}var Nf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function g1e(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",r=n.length,o=0;for(;o+2<r;o+=3){let a=n[o]<<16|n[o+1]<<8|n[o+2];i+=Nf[a>>18&63]+Nf[a>>12&63]+Nf[a>>6&63]+Nf[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=Nf[a>>18&63]+Nf[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=Nf[a>>18&63]+Nf[a>>12&63]+Nf[a>>6&63]+"="}return i})((function(n){let i=0,r=0,o=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(vO(SO),vO(rIt));else{if(A!=2)throw new Error("invalid deflate block type");p(...g())}}return s.subarray(0,a);function u(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function f(A){for(;o<A;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(a+A);for(let b=0;b<A;b++)s[a++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(x<256)y(a+1),s[a++]=x;else{let T=x-257,E=Qwt[T]+f(eIt[T]),v=m(b),S=tIt[v]+f(nIt[v]);y(a+E);let I=a-S;for(let R=0;R<E;R++)s[a++]=s[I+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let I=0;I<x;I++)T[iIt[I]]=f(3);let E=vO(T),v=new Uint8Array(A+b),S=0;for(;S<v.length;){let I=m(E);if(I<16)v[S++]=I;else if(I==16){let R=v[S-1],O=f(2)+3;for(;O--;)v[S++]=R}else S+=I==17?f(3)+3:f(7)+11}return[vO(v.subarray(0,A)),vO(v.subarray(A))]}function m(A){let{l:b,symbols:x}=A,T=0,E=0,v=0;for(let S=1;S<=15;S++){T|=f(1);let I=b[S];if(T-E<I)return x[v+(T-E)];v+=I,E=E+I<<1,T<<=1}throw new Error("invalid huffman code")}function y(A){if(s.length<A){let b=2*s.length;for(;b<A;)b*=2;let x=new Uint8Array(b);x.set(s.subarray(0,a)),s=x}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;o<i;o+=4){let s=Nf.indexOf(n[o])<<18|Nf.indexOf(n[o+1])<<12|(63&Nf.indexOf(n[o+2]))<<6|63&Nf.indexOf(n[o+3]);r.push(s>>16&255),n[o+2]!=="="&&r.push(s>>8&255),n[o+3]!=="="&&r.push(255&s)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718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UrBKVqpZqq0zlalbNqf3qBtVVR9R71AfVR9Wd6pfUf6HOqG31tPqH6s/U/6GMbtqa/psLf/vC3/7wNx/+DoS/Qm2o7/LOmVECA2DN1Zy6UZXqw8qr0+pJ9SdK6yeRpspqp2Od6o4u9IImfYte0Q9Ott+02bSFNg6qg+oGdYNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}lc();Jp();rO();R6();var gH="deflate",mH="deflate-raw",_1e="deflate64-raw",pH="gzip",bs,Hw,Qg,wO,y1e;function A1e(e){if(bs=e,{malloc:Hw,free:Qg,memory:wO}=bs,typeof Hw!="function"||typeof Qg!="function"||!wO)throw bs=Hw=Qg=wO=null,new Error("Invalid WASM module")}function b1e(e){y1e=e}function x1e(e,t,n={}){if(!bs){let a=new Error("WASM module not loaded");throw a.cause=y1e,a}let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let a;if(this.out=Hw(r),this.in=Hw(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=bs.deflate_process,this._last_consumed=bs.deflate_last_consumed,this._end=bs.deflate_end,this.streamHandle=bs.deflate_new(),t===pH?a=bs.deflate_init_gzip(this.streamHandle,i):t===mH?a=bs.deflate_init_raw(this.streamHandle,i):a=bs.deflate_init(this.streamHandle,i)):t===_1e?(this._process=bs.inflate9_process,this._last_consumed=bs.inflate9_last_consumed,this._end=bs.inflate9_end,this.streamHandle=bs.inflate9_new(),a=bs.inflate9_init_raw(this.streamHandle)):(this._process=bs.inflate_process,this._last_consumed=bs.inflate_last_consumed,this._end=bs.inflate_end,this.streamHandle=bs.inflate_new(),t===mH?a=bs.inflate_init_raw(this.streamHandle):t===pH?a=bs.inflate_init_gzip(this.streamHandle):a=bs.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let u=a,f=new Uint8Array(wO.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&Qg&&(Qg(this.in),this.in=0),this.in=Hw(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let E=b>>24&255,v=E&128?E-256:E;if(v<0)throw new Error("process error:"+v)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){s(this),c.error(u)}},flush(a){try{let c=new Uint8Array(wO.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),a.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&Qg&&Qg(a.in),a.in=0,a.out&&Qg&&Qg(a.out),a.out=0,c}}var vT=class{constructor(t=gH,n){return x1e(!0,t,n)}},ST=class{constructor(t=gH,n){return x1e(!1,t,n)}};vT.requiresModule=!0;ST.requiresModule=!0;vT.supportedFormats=[gH,mH,pH];ST.supportedFormats=[gH,mH,pH,_1e];var T1e=!1;async function E1e(e,{baseURI:t}){if(!T1e)try{await oIt(e,t),T1e=!0}catch(n){throw b1e(n),n}}async function oIt(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=sIt(e);else throw o}let r=await WebAssembly.instantiate(n);A1e(r.instance.exports)}function sIt(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var _H;PPe({initModule:e=>{if(!_H){let{wasmURI:t}=e;typeof t==Do&&(t=t()),_H=E1e(t,e).catch(n=>{throw _H=null,n})}return _H}});mw({CompressionStreamFallback:vT,DecompressionStreamFallback:ST});g1e(mw);var $ie=32,aIt="http://www.opengis.net/kml/2.2",pm="http://www.google.com/kml/ext/2.2",cIt="http://www.w3.org/2000/xmlns/";function yH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var lIt=/^data:image\/([^,;]+)/;yH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(lIt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function uIt(e,t){return function(n){e._files[t]=n}}yH.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(uIt(this,o))}return r};Object.defineProperties(yH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function AH(e){this._time=e}AH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};AH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return IT(n)};AH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Jie(){this._ids={},this._styles={},this._count=0}Jie.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};Jie.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 S1e(){this._ids={}}S1e.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Zie(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Zie._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(cIt,"xmlns:gx",pm);let a=o.createElement("Document");s.appendChild(a),I1e(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?fIt(f,c.files):{kml:f,externalFiles:c.files}})}async function fIt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");WR({workerURI:n,wasmURI:i});let r=new Pw("application/vnd.google-earth.kmz"),o=new bO(r);await o.add("doc.kml",new aO(e));let s=Object.keys(t);return await w1e(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function w1e(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new Vu(n[r])),w1e(e,t,n,i+1)}Zie._createState=function(e){let t=e.entities,n=new Jie,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===nt.MINIMUM_VALUE?o.stop===nt.MAXIMUM_VALUE?o=new vn:K.addSeconds(o.stop,-10*s,o.start):o.stop===nt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new yH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(aIt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new S1e,styleCache:n,externalFileHandler:a,time:r,valueGetter:new AH(r),sampleDuration:s,defaultAvailability:new Os([o])}};function I1e(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],dIt(e,p,u,f),hIt(e,p.polyline,u,f),v1e(e,p.rectangle,u,f,c),v1e(e,p.polygon,u,f,c),_It(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,nt.MINIMUM_VALUE)||g.appendChild(Tn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,nt.MAXIMUM_VALUE)||g.appendChild(Tn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",s.get(p.id)),x.appendChild(Tn(i,"name",p.name)),x.appendChild(Tn(i,"visibility",p.show)),x.appendChild(Tn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let x=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),S=o.get(T.text);x=l(S)&&S.length>0?S:x;let I=o.getColor(T.fillColor);l(I)&&(v.appendChild(Tn(i,"color",I)),v.appendChild(Tn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(Tn(i,"scale",R)),f.push(v)}b.appendChild(Tn(i,"name",x)),b.appendChild(Tn(i,"visibility",p.show)),b.appendChild(Tn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let E=f.length;if(E>0){let v=i.createElement("Style");for(let S=0;S<E;++S)v.appendChild(f[S]);b.appendChild(Tn(i,"styleUrl",r.get(v)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let S=0;S<y;++S)v.appendChild(u[S]);b.appendChild(v)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(Tn(i,"name",p.name)),b.appendChild(Tn(i,"visibility",p.show)),b.appendChild(Tn(i,"description",p.description)),t.appendChild(b),I1e(e,b,A)}}}var Hu=new h,Kl=new he,mm=new K;function dIt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){P1e(e,t,a,n,i);return}s.get(c,void 0,Hu);let u=Tn(r,"coordinates",wT(Hu,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(PT(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Fl?R1e(e,a):D1e(e,a);i.push(p)}function P1e(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Sc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof My,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof Gg?(x=x._value,T.appendChild(PT(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(PT(e,n.heightReference)):T.appendChild(PT(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,Hu);let I=Tn(o,"coordinates",wT(Hu,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof wc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Wi.FIXED,Hu),v.push(wT(Hu,s));else if(x instanceof Hd){m=x._times;let I=x._values;for(g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),h.fromArray(I,g*3,Hu),v.push(wT(Hu,s))}else{let I=e.sampleDuration;b.start.clone(mm),b.isStartIncluded||K.addSeconds(mm,I,mm);let R=b.stop;for(;K.lessThan(mm,R);)x.getValue(mm,Hu),E.push(K.toIso8601(mm)),v.push(wT(Hu,s)),K.addSeconds(mm,I,mm);b.isStopIncluded&&K.equals(mm,R)&&(x.getValue(mm,Hu),E.push(K.toIso8601(mm)),v.push(wT(Hu,s)))}let S=o.createElementNS(pm,"Track");S.appendChild(T);for(let I=0;I<E.length;++I){let R=Tn(o,"when",E[I]),O=Tn(o,"coord",v[I],pm);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(O1e(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(pm,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof Fl?R1e(e,n):D1e(e,n);r.push(b)}let A=t.path;if(l(A)){let b=a.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(Tn(o,"width",b)),Qie(e,x,T),r.push(T)}}}function D1e(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(Tn(n,"color",o)),r.appendChild(Tn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(Tn(n,"scale",s/$ie)),r}function R1e(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(Tn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(Tn(n,"x",g.x,pm)),p.appendChild(Tn(n,"y",g.y,pm)),p.appendChild(Tn(n,"w",g.width,pm)),p.appendChild(Tn(n,"h",g.height,pm))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(Tn(n,"color",a)),o.appendChild(Tn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(Tn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,U.divideByScalar(u,c,u);let p=i.get(t.width,$ie),g=i.get(t.height,$ie),m=i.get(t.horizontalOrigin,qi.CENTER);m===qi.CENTER?u.x-=p*.5:m===qi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,qn.CENTER);y===qn.TOP?u.y+=g:y===qn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),o.appendChild(Tn(n,"heading",f))),o}function hIt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(Tn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=Tn(r,"coordinates",wT(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(Tn(r,"drawOrder",m,pm)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(Tn(r,"width",A)),Qie(e,t.material,y),i.push(y)}function mIt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](a,Kl),c.push(`${P.toDegrees(Kl.longitude)},${P.toDegrees(Kl.latitude)},${o}`);let f=Tn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function C1e(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,Kl),s.push(`${P.toDegrees(Kl.longitude)},${P.toDegrees(Kl.latitude)},${i?Kl.height:n}`);let c=Tn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function pIt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(C1e(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(C1e(e,p[m].positions,o,s)),a.push(y)}}return a}function v1e(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Cp;if(a&&s.getMaterialType(t.material)==="Image"){gIt(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(Tn(o,"extrude",!0));let f=a?mIt(e,t,u):pIt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(PT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(Tn(o,"fill",m)),Qie(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(Tn(o,"outline",y));let A=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);A.appendChild(Tn(o,"width",b));let x=s.getColor(t.outlineColor,z.BLACK);A.appendChild(Tn(o,"color",x)),A.appendChild(Tn(o,"colorMode","normal")),i.push(A)}i.push(g)}function gIt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(PT(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(Tn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(Tn(i,"north",P.toDegrees(u.north))),f.appendChild(Tn(i,"south",P.toDegrees(u.south))),f.appendChild(Tn(i,"east",P.toDegrees(u.east))),f.appendChild(Tn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(Tn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(Tn(i,"color",IT(d.color))),n.push(s)}function O1e(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(Tn(n,"x",s)),u.appendChild(Tn(n,"y",s)),u.appendChild(Tn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(Tn(n,"href",c)),o.appendChild(a),o}function _It(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){P1e(e,t,n,i,r);return}let u=O1e(e,n),f=o.createElement("altitudeMode");f.appendChild(PT(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Hu),he.fromCartesian(Hu,s,Kl);let d=o.createElement("Location");d.appendChild(Tn(o,"longitude",P.toDegrees(Kl.longitude))),d.appendChild(Tn(o,"latitude",P.toDegrees(Kl.latitude))),d.appendChild(Tn(o,"altitude",Kl.height)),u.appendChild(d),i.push(u)}function Qie(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=IT(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=IT(o.color);break;case"PolylineOutline":s=IT(o.color),c=IT(o.outlineColor),u=o.outlineWidth,n.appendChild(Tn(i,"outerColor",c,pm)),n.appendChild(Tn(i,"outerWidth",u,pm));break;case"Stripe":s=IT(o.oddColor);break}l(s)&&(n.appendChild(Tn(i,"color",s)),n.appendChild(Tn(i,"colorMode","normal")))}function PT(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function wT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Kl),i.push(`${P.toDegrees(Kl.longitude)},${P.toDegrees(Kl.latitude)},${Kl.height}`);return i.join(" ")}function Tn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function IT(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 M1e=Zie;function ere(e){return e}function bH(e){if(e==null)return ere;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,d=new Array(f);for(d[0]=(t+=a[0])*i+o,d[1]=(n+=a[1])*r+s;u<f;)d[u]=a[u],++u;return d}}function N1e(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function tre(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return L1e(e,n)})}:L1e(e,t)}function L1e(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=nre(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function nre(e,t){var n=bH(e.transform),i=e.arcs;function r(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)d.push(n(p[g],g));f<0&&N1e(d,m)}function o(f){return n(f)}function s(f){for(var d=[],p=0,g=f.length;p<g;++p)r(f[p],d);return d.length<2&&d.push(d[0]),d}function a(f){for(var d=s(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(a)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=o(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(o);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function xH(e){return h.fromDegrees(e[0],e[1],e[2])}var ire={"urn:ogc:def:crs:OGC:1.3:CRS84":xH,"EPSG:4326":xH,"urn:ogc:def:crs:EPSG::4326":xH},F1e={},B1e={},rre=48,ore,sre=z.ROYALBLUE,are=z.YELLOW,cre=2,lre=z.fromBytes(255,255,0,100),ure=!1,TIt={small:24,medium:48,large:64},EIt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function k1e(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||EIt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${k1e(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function CIt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function vIt(e,t){return new vp(CIt(k1e,e,t),!0)}function TH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new Ti(c):n(o,s))}return r}function fre(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var U1e={Feature:V1e,FeatureCollection:SIt,GeometryCollection:j1e,LineString:Y1e,MultiLineString:X1e,MultiPoint:W1e,MultiPolygon:J1e,Point:G1e,Polygon:$1e,Topology:Z1e},z1e={GeometryCollection:j1e,LineString:Y1e,MultiLineString:X1e,MultiPoint:W1e,MultiPolygon:J1e,Point:G1e,Polygon:$1e,Topology:Z1e};function V1e(e,t,n,i,r){if(t.geometry===null){TH(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=z1e[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function SIt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)V1e(e,o[s],void 0,i,r)}function j1e(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=z1e[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function H1e(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=TIt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Fl;f.verticalOrigin=new Ti(qn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=TH(t,e._entityCollection,r.describe);d.billboard=f,d.position=new wu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Ti(g)}).catch(function(){f.image=new Ti(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function G1e(e,t,n,i,r){H1e(e,t,i,n.coordinates,r)}function W1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)H1e(e,t,i,o[s],r)}function q1e(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new Ti(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Kt(d))}let c=TH(t,e._entityCollection,r.describe),u=new Bl;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new Ti(fre(i,n)),u.arcType=ln.RHUMB}function Y1e(e,t,n,i,r){q1e(e,t,i,n.coordinates,r)}function X1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)q1e(e,t,i,o[s],r)}function K1e(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new Ti(g));let m,y=c.stroke;l(y)&&(m=z.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new Ti(m));let b,x=c.fill,T=s.color.getValue();l(x)&&(b=z.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(s=new Kt(b))}let u=new Ep;u.outline=new Ti(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=ln.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Xc(fre(i[g],n)));let d=i[0];u.hierarchy=new Ti(new Xc(fre(d,n),f)),d[0].length>2?u.perPositionHeight=new Ti(!0):r.clampToGround||(u.height=0);let p=TH(t,e._entityCollection,r.describe);p.polygon=u}function $1e(e,t,n,i,r){K1e(e,t,i,n.coordinates,r)}function J1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)K1e(e,t,i,o[s],r)}function Z1e(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=tre(n,n.objects[o]),a=U1e[s.type];a(e,s,s,i,r)}}function kA(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new ac(this),this._promises=[],this._pinBuilder=new hy,this._entityCluster=new Vd,this._credit=void 0,this._resourceCredits=[]}kA.load=function(e,t){return new kA().load(e,t)};Object.defineProperties(kA,{markerSize:{get:function(){return rre},set:function(e){rre=e}},markerSymbol:{get:function(){return ore},set:function(e){ore=e}},markerColor:{get:function(){return sre},set:function(e){sre=e}},stroke:{get:function(){return are},set:function(e){are=e}},strokeWidth:{get:function(){return cre},set:function(e){cre=e}},fill:{get:function(){return lre},set:function(e){lre=e}},clampToGround:{get:function(){return ure},set:function(e){ure=e}},crsNames:{get:function(){return ire}},crsLinkHrefs:{get:function(){return F1e}},crsLinkTypes:{get:function(){return B1e}}});Object.defineProperties(kA.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}}});kA.prototype.load=function(e,t){return Q1e(this,e,t,!0)};kA.prototype.process=function(e,t){return Q1e(this,e,t,!1)};function Q1e(e,t,n,i){ks.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??vIt,markerSize:n.markerSize??rre,markerSymbol:n.markerSymbol??ore,markerColor:n.markerColor??sre,strokeWidthProperty:new Ti(n.strokeWidth??cre),strokeMaterialProperty:new Kt(n.stroke??are),fillMaterialProperty:new Kt(n.fill??lre),clampToGround:n.clampToGround??ure},Promise.resolve(o).then(function(a){return wIt(e,a,n,s,i)}).catch(function(a){throw ks.setLoading(e,!1),e._error.raiseEvent(e,a),a})}kA.prototype.update=function(e){return!0};function wIt(e,t,n,i,r){let o;l(i)&&(o=ay(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=U1e[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?xH:null;if(l(a)){if(!l(a.properties))throw new oe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=ire[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=F1e[u.href];if(l(f)||(f=B1e[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=ire[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,ks.setLoading(e,!1),e})})}var DT=kA;function IIt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var kn=IIt;var dre=function(e,t){return dre=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},dre(e,t)};function s0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dre(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Qs=function(){return Qs=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Qs.apply(this,arguments)};function eRe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function tRe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var nRe="4.1.5";var iRe=Object.prototype.hasOwnProperty;function Lf(e){return typeof e=="boolean"}function rRe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function UA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function gm(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var EH=/\s+/,CH=(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},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(EH):[],r=t.split(EH),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(EH):[],r=t.split(EH),o;i.length&&(o=r.shift());){var s=i.indexOf(o);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(){var t=this.getAttrs(),n=[];for(var i in t)iRe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function sRe(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,s=PIt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=oRe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=oRe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=o)return s.host.length===t?(s.host.substr(0,t-r)+n).substr(0,o+i):hre(c,o,n).substr(0,o+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+hre(u,f,n)).substr(0,o+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+hre(d,p,n)).substr(0,o+i)}else c+=d}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function PIt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function oRe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function hre(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}function aRe(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}function cRe(e,t,n){return rRe(e,t,n)}var lRe=(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 CH({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.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],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);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.length)return t;var i=n.length,r=n.location;return r==="smart"?sRe(t,i):r==="middle"?aRe(t,i):cRe(t,i)},e})();var a0=(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})();function uRe(e){return e>=0&&e<=31||e==127}function e_(e){return e>=65&&e<=90||e>=97&&e<=122}function ea(e){return e>=48&&e<=57}function vH(e){return e==34||e==39}function zA(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function _m(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function fRe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function dRe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function SH(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function hRe(e){return e<91?e==40:e==91||e==123}function mre(e){return e<93?e==41:e==93||e==125}var mRe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|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|சிங்கப்பூர்|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|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|موريتانيا|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|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|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|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|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|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|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|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|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|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|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|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|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|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|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var pre=/https?:\/\//i,pRe=new RegExp("^"+pre.source,"i"),DIt=/^(javascript|vbscript):/i,RIt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,OIt=/^(?:\/\/)?([^/#?:]+)/,Gw=e_;function gre(e){return e_(e)||ea(e)||e===43||e===45||e===46}var t_=_m;function wH(e){return e===95||t_(e)}function _re(e){return _m(e)||dRe(e)||SH(e)}function IH(e){return e===47||e===63||e===35}function yre(e){return mRe.test(e.toLowerCase())}function gRe(e){if(DIt.test(e))return!1;var t=e.match(RIt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function _Re(e){var t=e.match(OIt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!yre(r)}var MIt=/^(?:(?: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]?)$/,NIt=/[:/?#]/;function yRe(e){var t=e.split(NIt,1)[0];return MIt.test(t)}var LIt=/^(https?:\/\/)?(?:www\.)?/i,FIt=/^\/\//,ARe=(function(e){s0(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=UIt(n)),this.stripPrefix.scheme&&(n=BIt(n)),this.stripPrefix.www&&(n=kIt(n)),this.stripTrailingSlash&&(n=zIt(n)),this.decodePercentEncoding&&(n=VIt(n)),n},t})(a0);function BIt(e){return e.replace(pRe,"")}function kIt(e){return e.includes("www.")?e.replace(LIt,"$1"):e}function UIt(e){return e.replace(FIt,"")}function zIt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function VIt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var bRe=/^mailto:/i,Are=_m;function PH(e){return Are(e)||fRe(e)}function xRe(e){var t=e.split(".").pop();return yre(t)}var TRe=(function(e){s0(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})(a0);function bre(e){return e===95||_m(e)}function ERe(e){return e.length<=140}var CRe=["twitter","facebook","instagram","tiktok","youtube"];var vRe=(function(e){s0(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:gm(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})(a0);var jIt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function xre(e){return e===45||e===46||e===95||e_(e)||ea(e)}function SRe(e,t){var n=jIt[t];return n.test(e)}var wRe=["twitter","instagram","soundcloud","tiktok","youtube"];var IRe=(function(e){s0(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:gm(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})(a0);var HIt=/[-. ()]/,GIt=/(?:(?:(?:(\+)?\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]+#?)*/,WIt=/(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})/,qIt=new RegExp("^".concat(GIt.source,"|").concat(WIt.source,"$"));function Tre(e){return e===45||e===46||e===32}function DH(e){return e===44||e===59}function PRe(e){var t=e.charAt(0)==="+"||HIt.test(e);return t&&qIt.test(e)}var DRe=(function(e){s0(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})(a0);var YIt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),ORe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),ORe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function MRe(e,t){for(var n=new YIt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)RH(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:QIt(n,s,r);break;case 12:ePt(n,s,r);break;case 0:XIt(n,s,r);break;case 1:KIt(n,s,r);break;case 2:$It(n,s,r);break;case 3:JIt(n,s,r);break;case 4:ZIt(n,s,i,r);break;case 5:tPt(n,s,r);break;case 6:nPt(n,s,i,r);break;case 7:iPt(n,s,i,r);break;case 13:rPt(n,s,r);break;case 14:oPt(n,s,r);break;case 8:sPt(n,s,r);break;case 9:aPt(n,s,r);break;case 10:cPt(n,s,r);break;case 15:lPt(n,s,i,r);break;case 16:uPt(n,s,i,r);break;case 17:fPt(n,s,i,r);break;case 18:dPt(n,s,i,r);break;case 19:hPt(n,s,i,r);break;case 20:mPt(n,s,r);break;case 21:pPt(n,s,r);break;case 22:RT(n,s,r);break;case 23:gPt(n,s,r);break;case 24:_Pt(n,s,r);break;case 25:yPt(n,s,r);break;case 26:APt(n,s,r);break;case 27:bPt(n,s,r);break;case 28:xPt(n,s,r);break;case 29:TPt(n,s,r);break;case 30:EPt(n,s,r);break;case 31:CPt(n,s,r);break;case 32:SPt(n,s,i,r);break;case 33:wPt(n,s,r);break;case 34:IPt(n,s,r);break;case 35:PPt(n,s,r);break;case 36:DPt(n,s,i,r);break;case 37:vPt(n,s,i,r);break;case 38:RPt(n,s,i,r);break;case 39:OPt(n,s,i,r);break;case 40:MPt(n,s,r);break;case 41:NPt(n,s,r);break;default:gm(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&Gw(r)){var a=n.text.charCodeAt(n.charIdx-1);Gw(a)||n.addMachine(OH(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return xs(n,u)});return n.matches}function RH(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(UPt(i,28));else if(n===64)e.addMachine(zPt(i,30));else if(n===47)e.addMachine(Cre(i,11));else if(n===43)e.addMachine(Ere(i,37));else if(n===40)e.addMachine(Ere(i,32));else{if(ea(n)&&(e.addMachine(Ere(i,38)),e.addMachine(BPt(i,13))),Are(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(kPt(i,r))}Gw(n)&&e.addMachine(OH(i,0)),_m(n)&&e.addMachine(Cre(i,5))}}function XIt(e,t,n){n===58?t.state=2:n===45?t.state=1:gre(n)||e.removeMachine(t)}function KIt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Cre(i,11))):gre(n)?t.state=0:e.removeMachine(t))}function $It(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):t_(n)?(t.state=5,Gw(n)&&e.addMachine(OH(i,0))):e.removeMachine(t)}function JIt(e,t,n){n===47?t.state=4:_re(n)?(t.state=10,t.acceptStateReached=!0):xs(e,t)}function ZIt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):t_(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function QIt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function ePt(e,t,n){t_(n)?t.state=5:e.removeMachine(t)}function tPt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:IH(n)?t.state=10:wH(n)||xs(e,t)}function nPt(e,t,n,i){i===45||(i===46?xs(e,t):t_(i)?t.state=5:xs(e,t))}function iPt(e,t,n,i){i===46?xs(e,t):t_(i)?(t.state=5,t.acceptStateReached=!0):xs(e,t)}function rPt(e,t,n){n===46?t.state=14:n===58?t.state=8:ea(n)||(IH(n)?t.state=10:_m(n)?e.removeMachine(t):xs(e,t))}function oPt(e,t,n){ea(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):xs(e,t)}function sPt(e,t,n){ea(n)?t.state=9:xs(e,t)}function aPt(e,t,n){ea(n)||(IH(n)?t.state=10:xs(e,t))}function cPt(e,t,n){_re(n)||xs(e,t)}function lPt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:RT(e,t,i)}function uPt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:RT(e,t,i)}function fPt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:RT(e,t,i)}function dPt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:RT(e,t,i)}function hPt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:RT(e,t,i)}function mPt(e,t,n){n===58?t.state=21:RT(e,t,n)}function pPt(e,t,n){PH(n)?t.state=22:e.removeMachine(t)}function RT(e,t,n){n===46?t.state=23:n===64?t.state=24:PH(n)?t.state=22:e.removeMachine(t)}function gPt(e,t,n){n===46||n===64?e.removeMachine(t):PH(n)?t.state=22:e.removeMachine(t)}function _Pt(e,t,n){t_(n)?t.state=25:e.removeMachine(t)}function yPt(e,t,n){n===46?t.state=27:n===45?t.state=26:wH(n)||xs(e,t)}function APt(e,t,n){n===45||n===46?xs(e,t):wH(n)?t.state=25:xs(e,t)}function bPt(e,t,n){n===46||n===45?xs(e,t):t_(n)?(t.state=25,t.acceptStateReached=!0):xs(e,t)}function xPt(e,t,n){bre(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function TPt(e,t,n){bre(n)||xs(e,t)}function EPt(e,t,n){xre(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function CPt(e,t,n){xre(n)||(_m(n)?e.removeMachine(t):xs(e,t))}function vPt(e,t,n,i){ea(i)?t.state=38:(e.removeMachine(t),RH(e,n,i))}function SPt(e,t,n,i){ea(i)?t.state=33:e.removeMachine(t),RH(e,n,i)}function wPt(e,t,n){ea(n)?t.state=34:e.removeMachine(t)}function IPt(e,t,n){ea(n)?t.state=35:e.removeMachine(t)}function PPt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function DPt(e,t,n,i){ea(i)?t.state=38:Tre(i)?t.state=39:e.removeMachine(t)}function RPt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,DH(i)?t.state=40:i===35?t.state=41:ea(i)||(i===40?t.state=32:Tre(i)?t.state=39:(xs(e,t),Gw(i)&&e.addMachine(OH(r,0))))}function OPt(e,t,n,i){ea(i)?t.state=38:i===40?t.state=32:(xs(e,t),RH(e,n,i))}function MPt(e,t,n){DH(n)||(n===35?t.state=41:ea(n)?t.state=38:xs(e,t))}function NPt(e,t,n){DH(n)?t.state=40:ea(n)?e.removeMachine(t):xs(e,t)}function xs(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=FPt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=pre.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!gRe(p))return;break}case 1:{if(!_Re(p))return;break}case 2:{if(!yRe(p))return;break}default:gm(t)}n.push(new ARe({tagBuilder:o,matchedText:p,offset:d,urlMatchType:LPt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{xRe(p)&&n.push(new TRe({tagBuilder:o,matchedText:p,offset:d,email:p.replace(bRe,"")}));break}case 2:{ERe(p)&&n.push(new vRe({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{SRe(p,f)&&n.push(new IRe({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),PRe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new DRe({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:gm(t)}}}function LPt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:gm(e)}}var RRe={")":"(","}":"{","]":"["};function FPt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);hRe(r)?t[i]++:mre(r)&&t[RRe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if(mre(r)){var s=RRe[i];if(t[s]<0)t[s]++,o--;else break}else if(SH(r))o--;else break}return e.slice(0,o+1)}function OH(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Cre(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function BPt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function kPt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function UPt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function zPt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Ere(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function ORe(e){return e.type===0&&e.matchType===0}var c0=(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})(),Sre=new c0,VPt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Sre,this.html=t,this.callbacks=n}return e})();function NRe(e,t){for(var n=new VPt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:jPt(n,r);break;case 1:HPt(n,r,o);break;case 2:WPt(n,r,o);break;case 3:GPt(n,r,o);break;case 4:qPt(n,r,o);break;case 5:YPt(n,r,o);break;case 6:XPt(n,r,o);break;case 7:KPt(n,r,o);break;case 8:$Pt(n,r);break;case 9:JPt(n,r);break;case 10:ZPt(n,r,o);break;case 11:QPt(n,r,o);break;case 12:eDt(n,r);break;case 13:tDt(n);break;case 14:nDt(n,r);break;case 15:iDt(n,r);break;case 16:rDt(n,r);break;case 17:oDt(n,r);break;case 18:sDt(n,r);break;case 19:aDt(n,r);break;case 20:cDt(n,r);break;default:gm(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&lDt(n)}function jPt(e,t){t==="<"&&l0(e)}function HPt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new c0(Qs(Qs({},e.currentTag),{isClosing:!0}))):t==="<"?l0(e):e_(n)?(e.state=3,e.currentTag=new c0(Qs(Qs({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Sre)}function GPt(e,t,n){zA(n)?(e.currentTag=new c0(Qs(Qs({},e.currentTag),{name:vre(e)})),e.state=4):t==="<"?l0(e):t==="/"?(e.currentTag=new c0(Qs(Qs({},e.currentTag),{name:vre(e)})),e.state=12):t===">"?(e.currentTag=new c0(Qs(Qs({},e.currentTag),{name:vre(e)})),u0(e)):!e_(n)&&!ea(n)&&t!==":"&&$d(e)}function WPt(e,t,n){t===">"?$d(e):e_(n)?e.state=3:$d(e)}function qPt(e,t,n){zA(n)||(t==="/"?e.state=12:t===">"?u0(e):t==="<"?l0(e):t==="="||vH(n)||uRe(n)?$d(e):e.state=5)}function YPt(e,t,n){zA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?u0(e):t==="<"?l0(e):vH(n)&&$d(e)}function XPt(e,t,n){zA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?u0(e):t==="<"?l0(e):vH(n)?$d(e):e.state=5)}function KPt(e,t,n){zA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?$d(e):t==="<"?l0(e):e.state=10)}function $Pt(e,t){t==='"'&&(e.state=11)}function JPt(e,t){t==="'"&&(e.state=11)}function ZPt(e,t,n){zA(n)?e.state=4:t===">"?u0(e):t==="<"&&l0(e)}function QPt(e,t,n){zA(n)?e.state=4:t==="/"?e.state=12:t===">"?u0(e):t==="<"?l0(e):(e.state=4,uDt(e))}function eDt(e,t){t===">"?(e.currentTag=new c0(Qs(Qs({},e.currentTag),{isClosing:!0})),u0(e)):$d(e)}function tDt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new c0(Qs(Qs({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new c0(Qs(Qs({},e.currentTag),{type:"doctype"})),e.state=20):$d(e)}function nDt(e,t){t==="-"?e.state=15:t===">"?$d(e):e.state=16}function iDt(e,t){t==="-"?e.state=18:t===">"?$d(e):e.state=16}function rDt(e,t){t==="-"&&(e.state=17)}function oDt(e,t){t==="-"?e.state=18:e.state=16}function sDt(e,t){t===">"?u0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function aDt(e,t){t==="-"?e.state=17:t===">"?u0(e):e.state=16}function cDt(e,t){t===">"?u0(e):t==="<"&&l0(e)}function $d(e){e.state=0,e.currentTag=Sre}function l0(e){e.state=1,e.currentTag=new c0({idx:e.charIdx})}function u0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),$d(e),e.currentDataIdx=e.charIdx+1}function lDt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function vre(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function uDt(e){e.charIdx--}var fDt=(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=dDt(t.urls),this.email=Lf(t.email)?t.email:this.email,this.phone=Lf(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Lf(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=hDt(t.stripPrefix),this.stripTrailingSlash=Lf(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Lf(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&wRe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&CRe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=mDt(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"],r=0,o=[];return NRe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,tRe([],eRe(g),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(pDt);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var s=t[n+1].getMatchedText().length>o?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||UA(t,function(n){return n.getType()==="hashtag"}),this.email||UA(t,function(n){return n.getType()==="email"}),this.phone||UA(t,function(n){return n.getType()==="phone"}),this.mention||UA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||UA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||UA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||UA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=MRe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),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 CH)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new lRe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=nRe,e})(),LRe=fDt;function dDt(e){return e==null&&(e=!0),Lf(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Lf(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Lf(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Lf(e.ipV4Matches)?e.ipV4Matches:!0}}function hDt(e){return e==null&&(e=!0),Lf(e)?{scheme:e,www:e}:{scheme:Lf(e.scheme)?e.scheme:!0,www:Lf(e.www)?e.www:!0}}function mDt(e){return typeof e=="number"?{length:e,location:"end"}:Qs({length:Number.POSITIVE_INFINITY,location:"end"},e)}function pDt(e,t){return e.getOffset()-t.getOffset()}var MH=LRe;var GRe;typeof DOMParser<"u"&&(GRe=new DOMParser);var gDt=new MH({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),NH=32,FRe=2414016,BRe=1,kRe=16093e3,URe=.1,_Dt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Kr={gpx:_Dt};function yDt(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 wre(e,t){let n=DO(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function Ire(e){let t=zRe(e,"lon"),n=zRe(e,"lat"),i=IO(e,"ele",Kr.gpx);return h.fromDegrees(t,n,i)}function zRe(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 DO(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function VA(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Pre(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function IO(e,t,n){let i=VA(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Gu(e,t,n){let i=VA(e,t,n);if(l(i))return i.textContent.trim()}function WRe(e){let t=new Fl;return t.width=NH,t.height=NH,t.scaleByDistance=new qt(FRe,BRe,kRe,URe),t.pixelOffsetScaleByDistance=new qt(FRe,BRe,kRe,URe),t.verticalOrigin=new Ti(qn.BOTTOM),t.image=e,t}function ADt(){let e=new Tp;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=qi.LEFT,e.font="16px sans-serif",e.style=Po.FILL_AND_OUTLINE,e}function qRe(e){let t=new Bl;return t.width=4,t.material=new nT,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var VRe={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"}},PO;typeof document<"u"&&(PO=document.createElement("div"));function Dre(e,t){let n,i="",r=Object.keys(VRe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=VRe[f];d.value=Gu(e,d.tag,Kr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=gDt.link(i),PO.innerHTML=i;let s=PO.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${PO.innerHTML}</div>`,PO.innerHTML="",u}function YRe(e,t,n,i){let r=Ire(t),o=wre(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,NH);o.billboard=WRe(s);let a=Gu(t,"name",Kr.gpx);o.name=a,o.label=ADt(),o.label.text=a,o.description=Dre(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function bDt(e,t,n,i){let r=wre(t,n);r.description=Dre(t,r);let o=Pre(t,"rtept",Kr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)YRe(e,o[a],n,i),s[a]=Ire(o[a]);r.polyline=qRe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function xDt(e,t,n,i){let r=wre(t,n);r.description=Dre(t,r);let o=Pre(t,"trkseg",Kr.gpx),s=[],a=[],c,u=!0,f=new wc;for(let d=0;d<o.length;d++)c=TDt(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,NH);r.billboard=WRe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Os,r.availability.addInterval(new vn({start:a[0],stop:a[a.length-1]}))}r.polyline=qRe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function TDt(e){let t={positions:[],times:[]},n=Pre(e,"trkpt",Kr.gpx),i;for(let r=0;r<n.length;r++){let o=Ire(n[r]);t.positions.push(o),i=Gu(n[r],"time",Kr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function EDt(e){let t=VA(e,"metadata",Kr.gpx);if(l(t)){let n={name:Gu(t,"name",Kr.gpx),desc:Gu(t,"desc",Kr.gpx),author:CDt(t),copyright:SDt(t),link:XRe(t),time:Gu(t,"time",Kr.gpx),keywords:Gu(t,"keywords",Kr.gpx),bounds:wDt(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 CDt(e){let t=VA(e,"author",Kr.gpx);if(l(t)){let n={name:Gu(t,"name",Kr.gpx),email:vDt(t),link:XRe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function vDt(e){let t=VA(e,"email",Kr.gpx);if(l(t)){let n=Gu(t,"id",Kr.gpx),i=Gu(t,"domain",Kr.gpx);return`${n}@${i}`}}function XRe(e){let t=VA(e,"link",Kr.gpx);if(l(t)){let n={href:DO(t,"href"),text:Gu(t,"text",Kr.gpx),mimeType:Gu(t,"type",Kr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function SDt(e){let t=VA(e,"copyright",Kr.gpx);if(l(t)){let n={author:DO(t,"author"),year:Gu(t,"year",Kr.gpx),license:Gu(t,"license",Kr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function wDt(e){let t=VA(e,"bounds",Kr.gpx);if(l(t)){let n={minLat:IO(t,"minlat",Kr.gpx),maxLat:IO(t,"maxlat",Kr.gpx),minLon:IO(t,"minlon",Kr.gpx),maxLon:IO(t,"maxlon",Kr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var jRe={wpt:YRe,rte:bDt,trk:xDt};function IDt(e,t,n,i){let r=Object.keys(jRe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=jRe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Kr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function HRe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=DO(r,"version"),s=DO(r,"creator"),a,c=EDt(r);l(c)&&(a=c.name),r.localName==="gpx"?IDt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,nt.MINIMUM_VALUE),m=K.equals(p,nt.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new Gp,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=Ps.LOOP_STOP,u.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),PDt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),ks.setLoading(e,!1),e}function PDt(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 DDt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?yDt(o).then(function(s){let a,c;try{a=GRe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new oe(u)}return HRe(e,a,i)}):HRe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function Ww(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new ac(this),this._entityCluster=new Vd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new hy}Ww.load=function(e,t){return new Ww().load(e,t)};Object.defineProperties(Ww.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}}});Ww.prototype.update=function(e){return!0};Ww.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,ks.setLoading(this,!0);let n=this._name,i=this;return DDt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,nt.MINIMUM_VALUE),u=K.equals(a,nt.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=K.fromDate(d)),r=new Gp,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=Ps.LOOP_STOP,r.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),ks.setLoading(i,!1),i}).catch(function(r){return ks.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var LH=Ww;function RDt(e,t){this.position=e,this.headingPitchRoll=t}var FH=RDt;var RO=js(Qu(),1);function ODt(e,t){this.position=e,this.headingPitchRange=t}var BH=ODt;function kH(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=[]}kH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};kH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;$Re.call(this,e,t,function(i){n.playlistIndex=0,i||KRe(n._activeEntries),n.tourEnd.raiseEvent(i)})};kH.prototype.stop=function(){KRe(this._activeEntries)};function KRe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function $Re(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=MDt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function MDt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,$Re.call(this,e,t,n)}}var UH=kH;function zH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}zH.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new le(this.view.position);t.flyToBoundingSphere(r,i)}};zH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};zH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ds.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=Mt(t,e)),t};var VH=zH;function Rre(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Rre.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Rre.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var jH=Rre;var sOe={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=C_(t),sOe[t]}},Vre;typeof DOMParser<"u"&&(Vre=new DOMParser);var NDt=new MH({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),jA=32,JRe=2414016,ZRe=1,QRe=16093e3,eOe=.1,tOe=[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"],nOe=["http://www.google.com/kml/ext/2.2"],LDt=["http://www.w3.org/2005/Atom"],Ve={kml:tOe,gx:nOe,atom:LDt,kmlgx:tOe.concat(nOe)},jre={Document:gOe,Folder:e1t,Placemark:t1t,NetworkLink:u1t,GroundOverlay:a1t,PhotoOverlay:AOe,ScreenOverlay:s1t,Tour:i1t},Fre=class{constructor(t){this._dataSource=t,this._deferred=ef(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=n_._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=n_._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=jre[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||n_._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function FDt(e){let t=e.slice(0,Math.min(4,e.size)),n=ef(),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 BDt(e){let t=ef(),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 aOe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function cOe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function kDt(e,t){let n=await e.getData(new cO);n=aOe(n),n=cOe(n),t.kml=Vre.parseFromString(n,"application/xml")}async function Ore(e,t){let n=sOe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new sO(n));t[e.filename]=i}function Ff(e,t,n,i){let r=i.keys,o=new RO.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new RO.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Bf(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=Hre(a,i);l(c)&&s.setAttribute(n,c.url)}}function lOe(e,t,n){let i=xa(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new no({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new zre),r}function OO(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function qH(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function HH(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=qH(n[s],t);return r}function HA(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 xa(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function er(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function iOe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ym(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function vi(e,t,n){let i=er(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ln(e,t,n){let i=er(e,t,n);if(l(i))return i.textContent.trim()}function Am(e,t,n){let i=er(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Hre(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new RO.default(t.getUrlComponent()),s=new RO.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Wu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Bre(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,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Wu.maximumRed=o,Wu.red=void 0):(Wu.maximumRed=void 0,Wu.red=0),r>0?(Wu.maximumGreen=r,Wu.green=void 0):(Wu.maximumGreen=void 0,Wu.green=0),i>0?(Wu.maximumBlue=i,Wu.blue=void 0):(Wu.maximumBlue=void 0,Wu.blue=0),Wu.alpha=n,z.fromRandom(Wu)):new z(o,r,i,n)}function OT(e,t,n){let i=Ln(e,t,n);if(l(i))return Bre(i,Ln(e,"colorMode",n)==="random")}function UDt(e){let t=er(e,"TimeStamp",Ve.kmlgx),n=Ln(t,"when",Ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new Os;return r.addInterval(new vn({start:i,stop:nt.MAXIMUM_VALUE})),r}function zDt(e){let t=er(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=er(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=er(t,"end",Ve.kmlgx),s=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(K.lessThan(s,r)){let a=r;r=s,s=a}n=new Os,n.addInterval(new vn({start:r,stop:s}))}else l(r)?(n=new Os,n.addInterval(new vn({start:r,stop:nt.MAXIMUM_VALUE}))):l(s)&&(n=new Os,n.addInterval(new vn({start:nt.MINIMUM_VALUE,stop:s})));return n}function uOe(){let e=new Fl;return e.width=jA,e.height=jA,e.scaleByDistance=new qt(JRe,ZRe,QRe,eOe),e.pixelOffsetScaleByDistance=new qt(JRe,ZRe,QRe,eOe),e}function Gre(){let e=new Ep;return e.outline=!0,e.outlineColor=z.WHITE,e}function fOe(){let e=new Tp;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=qi.LEFT,e.font="16px sans-serif",e.style=Po.FILL_AND_OUTLINE,e}function Wre(e,t,n,i,r){let o=Ln(e,"href",Ve.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=vi(e,"x",Ve.gx)??0,u=vi(e,"y",Ve.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=Hre(o,n,i);if(r){let a=Ln(e,"refreshMode",Ve.kml),c=Ln(e,"viewRefreshMode",Ve.kml);a==="onInterval"||a==="onExpire"?yt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&yt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Ln(e,"viewBoundScale",Ve.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Ln(e,"viewFormat",Ve.kml)??f,p=Ln(e,"httpQuery",Ve.kml);l(d)&&s.setQueryParameters(Zf(WH(d))),l(p)&&s.setQueryParameters(Zf(WH(p)));let g=t._ellipsoid;return Yre(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function VDt(e,t,n,i,r){let o=vi(t,"scale",Ve.kml),s=vi(t,"heading",Ve.kml),a=OT(t,"color",Ve.kml),c=er(t,"Icon",Ve.kml),u=Wre(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=vi(c,"x",Ve.gx),d=vi(c,"y",Ve.gx),p=vi(c,"w",Ve.gx),g=vi(c,"h",Ve.gx),m=er(t,"hotSpot",Ve.kml),y=HA(m,"x"),A=HA(m,"y"),b=xa(m,"xunits"),x=xa(m,"yunits"),T=n.billboard;l(T)||(T=uOe(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new et(f,d,p,g)),l(s)&&s!==0&&(T.rotation=P.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=o??1;let E,v;l(y)&&(b==="pixels"?E=-y*o:b==="insetPixels"?E=(y-jA)*o:b==="fraction"&&(E=-y*jA*o),E+=jA*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+jA)*o:x==="fraction"&&(v=A*jA*o),v-=jA*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function GH(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")VDt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=fOe(),n.label=c),c.scale=vi(a,"scale",Ve.kml)??c.scale,c.fillColor=OT(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Bl,n.polyline=c),c.width=vi(a,"width",Ve.kml),c.material=OT(a,"color",Ve.kml),l(OT(a,"outerColor",Ve.gx))&&yt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(vi(a,"outerWidth",Ve.gx))&&yt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(vi(a,"physicalWidth",Ve.gx))&&yt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Am(a,"labelVisibility",Ve.gx))&&yt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Gre(),n.polygon=c),c.material=OT(a,"color",Ve.kml)??c.material,c.fill=Am(a,"fill",Ve.kml)??c.fill,c.outline=Am(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Bre(Ln(a,"bgColor",Ve.kml))??z.WHITE,u=Bre(Ln(a,"textColor",Ve.kml))??z.BLACK,f=Ln(a,"text",Ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Ln(a,"listItemType",Ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&yt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function jDt(e,t,n,i,r){let o=new no,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")GH(e,d,o,i,r);else{let p=ym(d,"Pair",Ve.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Ln(m,"key",Ve.kml);if(y==="normal"){let A=Ln(m,"styleUrl",Ve.kml);if(l(A))s=n.getById(A),l(s)||(s=n.getById(`#${A}`)),l(s)&&o.merge(s);else{let b=er(m,"Style",Ve.kml);GH(e,b,o,i,r)}}else yt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Ln(t,"styleUrl",Ve.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function HDt(e,t,n){return t.fetchXML().then(function(i){return dOe(e,i,n,t,!0)})}function dOe(e,t,n,i,r,o){let s,a,c,u,f=iOe(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=xa(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new no({id:a}),n.add(c),GH(e,u,c,i,o)))}let d=iOe(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=xa(A,"id"),l(a)){let b=ym(A,"Pair",Ve.kml);for(let x=0;x<b.length;x++){let T=b[x],E=Ln(T,"key",Ve.kml);if(E==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Ln(T,"styleUrl",Ve.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let S=n.getById(v);l(S)&&c.merge(S)}else u=er(T,"Style",Ve.kml),GH(e,u,c,i,o)}}else yt(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(HDt(e,x,n))}}}return p}function qre(e,t,n){let i=new bA(e,t.id,["position"]),r=new Gg(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Bl,t.polyline.positions=new yA([i,r])}function hOe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(yt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(yt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(l(e)?yt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):yt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function GDt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Gg(e))}function WDt(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")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function YH(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():fOe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():uOe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64),l(o.scale)){let s=o.scale.getValue();s!==0?r.pixelOffset=new U(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function mOe(e,t){let n=e.path;l(n)||(n=new Ny,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function qDt(e,t,n,i,r){let o=Ln(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=Am(n,"extrude",Ve.kml),u=e._ellipsoid,f=qH(o,u);return i.position=f,YH(e,i,r,hOe(s,a)),c&&OO(s,a)&&qre(t,i,r),!0}function rOe(e,t,n,i,r){let o=er(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=Am(n,"extrude",Ve.kml),u=Am(n,"tessellate",Ve.kml),f=OO(s,a),d=vi(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=HH(o,p),m=r.polyline;if(f&&c){let y=new Ly;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:z.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Bl;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(nt.MINIMUM_VALUE):z.WHITE,y.width=m.width??1):(y.material=z.WHITE,y.width=1),y.zIndex=d}else l(d)&&yt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&yt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Bl,i.polyline=m,m.positions=WDt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function YDt(e,t,n,i,r){let o=er(n,"outerBoundaryIs",Ve.kml),s=er(o,"LinearRing",Ve.kml),a=er(s,"coordinates",Ve.kml),c=e._ellipsoid,u=HH(a,c),f=Am(n,"extrude",Ve.kml),d=Ln(n,"altitudeMode",Ve.kml),p=Ln(n,"altitudeMode",Ve.gx),g=OO(d,p),m=l(r.polygon)?r.polygon.clone():Gre(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:z.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Xc(u),b=ym(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=ym(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=er(s[T],"coordinates",Ve.kml),u=HH(a,c),l(u)&&A.holes.push(new Xc(u))}m.hierarchy=A}return!0}function XDt(e,t,n,i,r){let o=Ln(n,"altitudeMode",Ve.kml),s=Ln(n,"altitudeMode",Ve.gx),a=ym(n,"coord",Ve.gx),c=ym(n,"angles",Ve.gx),u=ym(n,"when",Ve.kml),f=Am(n,"extrude",Ve.kml),d=OO(o,s),p=e._ellipsoid;c.length>0&&yt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=qH(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new wc;return A.addSamples(y,m),i.position=A,YH(e,i,r,hOe(o,s)),mOe(i,r),i.availability=new Os,u.length>0&&i.availability.addInterval(new vn({start:y[0],stop:y[y.length-1]})),d&&f&&qre(t,i,r),!0}function oOe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new wc;d.addSamples(e,t),n.intervals.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:GDt(d,s,a)})),i.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function KDt(e,t,n,i,r){let o=Am(n,"interpolate",Ve.gx),s=ym(n,"Track",Ve.gx),a,c,u,f=!1,d=new EA,p=new Os,g=new Sc,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=ym(b,"when",Ve.kml),T=ym(b,"coord",Ve.gx),E=Ln(b,"altitudeMode",Ve.kml),v=Ln(b,"altitudeMode",Ve.gx),S=OO(E,v),I=Am(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=qH(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&oOe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),oOe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,YH(e,i,r),mOe(i,r),f&&(qre(t,i,r),i.polyline.show=d),!0}var pOe={Point:qDt,LineString:rOe,LinearRing:rOe,Polygon:YDt,Track:XDt,MultiTrack:KDt,MultiGeometry:$Dt,Model:JDt};function $Dt(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=pOe[f.localName];if(l(d)){let p=lOe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function JDt(e,t,n,i,r){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function ZDt(e,t){let n=er(e,"ExtendedData",Ve.kml);if(!l(n))return;l(er(n,"SchemaData",Ve.kml))&&yt("kml-schemaData","KML - SchemaData is unsupported"),l(xa(n,"xmlns:prefix"))&&yt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=ym(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=xa(a,"name");l(c)&&(i[c]={displayName:Ln(a,"displayName",Ve.kml),value:Ln(a,"value",Ve.kml)})}}t.kml.extendedData=i}var kr;typeof document<"u"&&(kr=document.createElement("div"));function QDt(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Ln(e,"description",Ve.kml),d=t.balloonStyle??n.balloonStyle,p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=d.bgColor??z.WHITE,g=d.textColor??z.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],E=T.substr(2,T.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),y=u[E],l(y)&&(y=v?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=NDt.link(m),kr.innerHTML=m;let A=kr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Ff(kr,"a","href",i),Ff(kr,"link","href",i),Ff(kr,"area","href",i),Ff(kr,"img","src",i),Ff(kr,"iframe","src",i),Ff(kr,"video","src",i),Ff(kr,"audio","src",i),Ff(kr,"source","src",i),Ff(kr,"track","src",i),Ff(kr,"input","src",i),Ff(kr,"embed","src",i),Ff(kr,"script","src",i),Ff(kr,"video","poster",i)),Bf(kr,"a","href",r),Bf(kr,"link","href",r),Bf(kr,"area","href",r),Bf(kr,"img","src",r),Bf(kr,"iframe","src",r),Bf(kr,"video","src",r),Bf(kr,"audio","src",r),Bf(kr,"source","src",r),Bf(kr,"track","src",r),Bf(kr,"input","src",r),Bf(kr,"embed","src",r),Bf(kr,"script","src",r),Bf(kr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${kr.innerHTML}</div>`,kr.innerHTML="",t.description=b}function XH(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=lOe(t,i,n.context),c=a.kml,u=jDt(e,t,n.styleCollection,o,s),f=Ln(t,"name",Ve.kml);a.name=f,a.parent=r;let d=zDt(t);l(d)||(d=UDt(t)),a.availability=d,Xre(a);function p(T){return T?T.show&&p(T.parent):!0}let g=Am(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=er(t,"author",Ve.atom),y=c.author;y.name=Ln(m,"name",Ve.atom),y.uri=Ln(m,"uri",Ve.atom),y.email=Ln(m,"email",Ve.atom);let A=er(t,"link",Ve.atom),b=c.link;b.href=xa(A,"href"),b.hreflang=xa(A,"hreflang"),b.rel=xa(A,"rel"),b.type=xa(A,"type"),b.title=xa(A,"title"),b.length=xa(A,"length"),c.address=Ln(t,"address",Ve.kml),c.phoneNumber=Ln(t,"phoneNumber",Ve.kml),c.snippet=Ln(t,"Snippet",Ve.kml),ZDt(t,a),QDt(t,a,u,s,o);let x=e._ellipsoid;return yOe(t,a,x),_Oe(t,a,x),l(er(t,"Region",Ve.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function gOe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function e1t(e,t,n,i){let r=XH(e,t,n),o=Ze(n);o.parentEntity=r.entity,gOe(e,t,o,i)}function t1t(e,t,n,i){let r=XH(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=pOe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),YH(e,o,s))}var n1t={FlyTo:o1t,Wait:r1t,SoundCue:Mre,AnimatedUpdate:Mre,TourControl:Mre};function i1t(e,t,n,i){let r=Ln(t,"name",Ve.kml),o=xa(t,"id"),s=new UH(r,o),a=er(t,"Playlist",Ve.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=n1t[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function Mre(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function r1t(e,t){let n=vi(t,"duration",Ve.gx);e.addPlaylistEntry(new jH(n))}function o1t(e,t,n){let i=vi(t,"duration",Ve.gx),r=Ln(t,"flyToMode",Ve.gx),o={kml:{}};yOe(t,o,n),_Oe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new VH(i,r,s);e.addPlaylistEntry(a)}function _Oe(e,t,n){let i=er(e,"Camera",Ve.kml);if(l(i)){let r=vi(i,"longitude",Ve.kml)??0,o=vi(i,"latitude",Ve.kml)??0,s=vi(i,"altitude",Ve.kml)??0,a=vi(i,"heading",Ve.kml)??0,c=vi(i,"tilt",Ve.kml)??0,u=vi(i,"roll",Ve.kml)??0,f=h.fromDegrees(r,o,s,n),d=kc.fromDegrees(a,c-90,u);t.kml.camera=new FH(f,d)}}function yOe(e,t,n){let i=er(e,"LookAt",Ve.kml);if(l(i)){let r=vi(i,"longitude",Ve.kml)??0,o=vi(i,"latitude",Ve.kml)??0,s=vi(i,"altitude",Ve.kml)??0,a=vi(i,"heading",Ve.kml),c=vi(i,"tilt",Ve.kml),u=vi(i,"range",Ve.kml)??0;c=P.toRadians(c??0),a=P.toRadians(a??0);let f=new Oh(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new BH(d,f)}}function s1t(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=er(t,"Icon",Ve.kml),c=Wre(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=er(t,"screenXY",Ve.kml),p=er(t,"overlayXY",Ve.kml),g=er(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=HA(g,"x"),y=HA(g,"y"),A=xa(g,"xunits"),b=xa(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=HA(p,"x"),y=HA(p,"y"),A=xa(p,"xunits"),b=xa(p,"yunits"),l(m)&&(A==="fraction"?E=m*u.width:(A==="pixels"||A==="insetPixels")&&(E=m)),l(y)&&(b==="fraction"?v=y*u.height:(b==="pixels"||b==="insetPixels")&&(v=y))),l(d)&&(m=HA(d,"x"),y=HA(d,"y"),A=xa(d,"xunits"),b=xa(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${E}px)`:A==="pixels"?x=`left: ${m-E}px`:A==="insetPixels"&&(x=`right: ${m-E}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:b==="pixels"?T=`bottom: ${y-v}px`:b==="insetPixels"&&(T=`top: ${y-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function a1t(e,t,n,i){let o=XH(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=HH(er(t,"LatLonQuad",Ve.gx),c),f=vi(t,"drawOrder",Ve.kml);if(l(u))s=Gre(),s.hierarchy=new Xc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new Cp,s.zIndex=f,o.rectangle=s;let m=er(t,"LatLonBox",Ve.kml);if(l(m)){let y=vi(m,"west",Ve.kml),A=vi(m,"south",Ve.kml),b=vi(m,"east",Ve.kml),x=vi(m,"north",Ve.kml);l(y)&&(y=P.negativePiToPi(P.toRadians(y))),l(A)&&(A=P.clampToLatitudeRange(P.toRadians(A))),l(b)&&(b=P.negativePiToPi(P.toRadians(b))),l(x)&&(x=P.clampToLatitudeRange(P.toRadians(x))),s.coordinates=new ie(y,A,b,x);let T=vi(m,"rotation",Ve.kml);if(l(T)){let E=P.toRadians(T);s.rotation=E,s.stRotation=E}}}let d=er(t,"Icon",Ve.kml),p=Wre(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&yt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=vi(d,"x",Ve.gx),y=vi(d,"y",Ve.gx),A=vi(d,"w",Ve.gx),b=vi(d,"h",Ve.gx);(l(m)||l(y)||l(A)||l(b))&&yt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=OT(t,"color",Ve.kml),s.material.transparent=!0}else s.material=OT(t,"color",Ve.kml);let g=Ln(t,"altitudeMode",Ve.kml);l(g)?g==="absolute"?(s.height=vi(t,"altitude",Ve.kml),s.zIndex=void 0):g!=="clampToGround"&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Ln(t,"altitudeMode",Ve.gx),g==="relativeToSeaFloor"?(yt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=vi(t,"altitude",Ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?yt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function AOe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),yt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var GA={INTERVAL:0,EXPIRE:1,STOP:2};function WH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var c1t=new ie,qw=new he,Nre=new U,l1t=new h;function Yre(e,t,n,i,r,o){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=CE(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??c1t,l(n)&&(Nre.x=n.clientWidth*.5,Nre.y=n.clientHeight*.5,u=t.pickEllipsoid(Nre,o,l1t)),l(u)?f=o.cartesianToCartographic(u,qw):(f=ie.center(r,qw),u=o.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(a(f.longitude-b),s(f.latitude-x),a(f.longitude+b),s(f.latitude+x))}c=c.replace("[bboxWest]",P.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(r.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,qw),c=c.replace("[cameraLon]",P.toDegrees(qw.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(qw.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(qw.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=P.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.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(Zf(c))}function u1t(e,t,n,i){let o=XH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=er(t,"Link",Ve.kml);if(l(c)||(c=er(t,"Url",Ve.kml)),l(c)){let u=Ln(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=Hre(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Ln(c,"viewRefreshMode",Ve.kml),f==="onRegion"){yt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Ln(c,"viewBoundScale",Ve.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Ln(c,"viewFormat",Ve.kml)??A,x=Ln(c,"httpQuery",Ve.kml);l(b)&&u.setQueryParameters(Zf(WH(b))),l(x)&&u.setQueryParameters(Zf(WH(x)));let T=e._ellipsoid;Yre(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new ac,y=Ure(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let v=0;v<x.length;v++){let S=x[v];l(S.parent)||(S.parent=o,Xre(S)),b.add(S)}b.resumeEvents();let T=Ln(c,"refreshMode",Ve.kml),E=vi(c,"refreshInterval",Ve.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let v=er(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Zf(Ln(v,"cookie",Ve.kml)??""),O=vi(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=GA.INTERVAL,R.time=E;else if(T==="onExpire"){let L;if(S&&(L=Ln(v,"expires",Ve.kml)),l(L))try{let _=K.fromIso8601(L),C=K.secondsDifference(_,I);C>0&&C<O&&K.addSeconds(I,O,_),R.refreshMode=GA.EXPIRE,R.time=_}catch{yt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=GA.STOP,R.time=vi(c,"viewRefreshTime",Ve.kml)??0):yt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){yt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function f1t(e,t,n,i){let r=jre[t.localName];return l(r)?r(e,t,n,i):AOe(e,t,n,i)}function kre(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:er(a,"Document",Ve.kml),u=Ln(c,"name",Ve.kml);l(u)||(u=ay(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new n_._DeferredLoading(e),d=new ac(e);return Promise.all(dOe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(jre[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),f1t(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function d1t(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");WR({workerURI:o,wasmURI:s});let a=new TT(new Vu(n)),c=await a.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(Ore(d,f)),d=g):u.push(Ore(g,f)))}if(l(d)&&u.push(kDt(d,f)),await Promise.all(u),a.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),kre(e,t,f.kml,i,f,r)}function Ure(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(a)&&(a=kn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?FDt(u).then(function(f){return f?d1t(e,t,u,r,a):BDt(u).then(function(d){d=aOe(d),d=cOe(d);let p,g;try{p=Vre.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return kre(e,t,p,r,o,a,s)})}):kre(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var n_=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.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 ac(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new hy,this._networkLinks=new zt,this._entityCluster=new Vd,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ee.default;let r=t.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,ks.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Ure(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,nt.MINIMUM_VALUE),f=K.equals(c,nt.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),a=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new Gp,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=Ps.LOOP_STOP,o.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,a)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),ks.setLoading(r,!1),r}).catch(function(o){return ks.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;Lre.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];Lre.set(y.id,y),o(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,P.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,P.EPSILON7)&&c.upWC.equalsEpsilon(a.up,P.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let u=new zt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!Lre.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===GA.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===GA.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===GA.STOP&&(s&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new ac,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;Yre(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Ure(r,m,y,{context:p.id}).then(h1t(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function Xre(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 h1t(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=er(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(er(a,"Update",Ve.kml))){yt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Zf(Ln(a,"cookie",Ve.kml)??""),u=vi(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===GA.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===GA.EXPIRE){let I;if(l(a)&&(I=Ln(a,"expires",Ve.kml)),l(I))try{let R=K.fromIso8601(I),O=K.secondsDifference(R,f);O>0&&O<u&&K.addSeconds(f,u,R),t.time=R}catch{yt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(I){g.remove(I);let R=I._children,O=R.length;for(let L=0;L<O;++L)y(R[L])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let I=A[b];I.parent===p&&(I.parent=void 0,y(I))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let I=m[b];l(I.parent)||(I.parent=p,Xre(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,E=x.stop,v=K.equals(T,nt.MINIMUM_VALUE),S=K.equals(E,nt.MAXIMUM_VALUE);if(!v||!S){let I=e._clock;(I.startTime!==T||I.stopTime!==E)&&(I.startTime=T,I.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Lre=new zt,zre=class{constructor(){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}};n_._DeferredLoading=Fre;n_._getTimestamp=xn;var Yw=n_;function MO(){pe.throwInstantiationError()}MO.prototype.update=pe.throwInstantiationError;MO.prototype.getBoundingSphere=pe.throwInstantiationError;MO.prototype.isDestroyed=pe.throwInstantiationError;MO.prototype.destroy=pe.throwInstantiationError;var bOe=MO;async function Kre(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;let a=n.availability;if(!l(a)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await Kre._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}Kre._sampleTerrainMostDetailed=rv;var Xw=Kre;var KH=`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 -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; +#ifdef APPLY_DAY_NIGHT_ALPHA +uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; +uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; #endif -return; -} -discard; -} -`;var aV=`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) +#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 +#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; +#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) { -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +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); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +#endif +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { -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; +return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +#endif +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() { -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 +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) { -return 0.5 / GGX; +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; +if (split < 0.0 && gl_FragCoord.x > splitPosition) { +alpha = 0.0; } -return 0.0; +else if (split > 0.0 && gl_FragCoord.x < splitPosition) { +alpha = 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++) +#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; +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() { -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 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) { -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; +direction = vec3(0.0, 0.0, -1.0); } +else +{ +direction = normalize(vec3(xy, -czm_currentFrustum.x)); } -return vec2(A, B) / float(NumSamples); +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() { -out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); -} -`;var cV=`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); +#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; } -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; -} -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); -} -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; -} -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; -} -vec2 phaseShift2D(vec2 p, vec2 freq) { -return (czm_pi / 2.0) * sin(freq.yx * p.yx); +#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)); +vec3 normalEC = czm_normal3D * normalMC; +#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 +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); } -vec2 phaseShift3D(vec3 p, vec2 freq) { -return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); +#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; } -const float T0 = 0.6; -const float k = 0.1; -const float C0 = 0.8; -const float FX0 = 0.6; -const float FY0 = 0.6; -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); +else if (czm_sceneMode == czm_sceneModeColumbusView) +{ +cameraDist = -czm_view[3].z; } -return k * sum.x * sum.y; +else +{ +cameraDist = length(czm_view[3]); } -const float a = 0.5; -const float t = 0.4; -const float s = 0.25; -float I(float Id, float Is, float It) { -return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; +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; } -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 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); } -float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); -float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); -float It = T(cloudPoint); -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; -float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); -float TR = pow(ndDot, 3.0) - W; -TR *= 1.3; -float minusDot = 0.5 - ndDot; -TR -= min(minusDot * W2, 0.0); -TR -= 0.8 * (minusDot + 0.25) * W3; -float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); -shading = clamp(shading + 0.2, 0.3, 1.0); -vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); -return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; +#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; } -void main() { -#ifdef DEBUG_BILLBOARDS -out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); #endif -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; +#ifdef ENABLE_CLIPPING_POLYGONS +bool insideAny = vectorClip(v_textureCoordinates.xy); +#ifdef CLIPPING_INVERSE +if (!insideAny) { +discard; } #else -#ifndef DEBUG_BILLBOARDS -vec4 cloud = drawCloud(rayOrigin, rayDir, -ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); -if(cloud.w < 0.01) { +if (insideAny) { discard; } -out_FragColor = cloud; #endif #endif -} -`;var lV=`#ifdef INSTANCED -in vec2 direction; +#ifdef HIGHLIGHT_FILL_TILE +finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); #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() { -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; +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; #else -vec2 dir = coordinates; +vec3 atmosphereLightDirection = czm_lightDirectionWC; #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 uV=`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)); -} -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 fV=`uniform vec3 u_noiseTextureDimensions; -in vec2 position; -out vec2 v_position; -void main() +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +if (!czm_backFacing()) { -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; +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; +#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); +#ifdef FOG +vec3 fogColor = groundAtmosphereColor.rgb; +#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 +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 } -`;var dV=`uniform sampler2D u_opaqueDepthTexture; -uniform sampler2D u_translucentDepthTexture; -in vec2 v_textureCoordinates; -void main() +#endif +#ifdef UNDERGROUND_COLOR +if (czm_backFacing()) { -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); +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); } -`;var hV=`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) +#ifdef HAS_VECTOR_LAYER +finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); +finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); +#endif +#ifdef TRANSLUCENT +if (inTranslucencyRectangle()) { -out_FragColor.a = 1.0; -} +vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; +finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); } -`;var mV=`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); -vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); -position = vec3(mix(minPlane, maxPlane, uv), 0.0); -direction = vec3(0.0, 0.0, -1.0); +#endif +out_FragColor = finalColor; } -else +#ifdef SHOW_REFLECTIVE_OCEAN +float waveFade(float edge0, float edge1, float x) { -position = vec3(0.0); -direction = normalize(positionEC.xyz); +float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +return pow(1.0 - y, 5.0); } -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)) +float linearFade(float edge0, float edge1, float x) { -out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); +return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); } -else +const float oceanFrequencyLowAltitude = 825000.0; +const float oceanAnimationSpeedLowAltitude = 0.004; +const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; +const float oceanSpecularIntensity = 0.5; +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) { -discard; +vec3 positionToEyeEC = -positionEyeCoordinates; +float positionToEyeECLength = length(positionToEyeEC); +vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); +float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); +#ifdef SHOW_OCEAN_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); +time = czm_frameNumber * oceanAnimationSpeedLowAltitude; +noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); +vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); +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); +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); +float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; +vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); +#ifdef SHOW_OCEAN_WAVES +float tsPerturbationRatio = normalTangentSpace.z; +vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); +#else +vec3 nonDiffuseHighlight = vec3(0.0); +#endif +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); } -czm_writeLogDepth(); +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var $H=`#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; +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 +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); } -`;var pV=`in vec4 position; -out vec4 positionEC; -void main() +float get2DMercatorYPositionFraction(vec2 textureCoordinates) { -positionEC = czm_modelView * position; -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); +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); } -`;var FP=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; -in vec3 v_positionEC; -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) +return positionFraction; +} +float get2DGeographicYPositionFraction(vec2 textureCoordinates) { -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; -vec3 normalEC = normalize(czm_normal * normalMC); -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 +return textureCoordinates.y; } -void main() +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) { -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; +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; } -if (t1 < 0.0 && t2 < 0.0) { -discard; +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, 0.0, textureCoordinates); } -float t = min(t1, t2); -if (t < 0.0) { -t = 0.0; +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, height, textureCoordinates); } -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)) +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) { -discard; +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); +vec4 morphPositionEC = czm_modelView * morphPosition; +return czm_projection * morphPositionEC; } -vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); -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 +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; #endif -} -`;var BP=`in vec3 position; -uniform vec3 u_radii; -out vec3 v_positionEC; void main() { -vec4 p = vec4(u_radii * position, 1.0); -v_positionEC = (czm_modelView * p).xyz; -gl_Position = czm_modelViewProjection * p; -gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); -czm_vertexLogDepth(); -} -`;/** - * @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 _V=`#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 +#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) || defined(APPLY_MATERIAL) +float webMercatorT = textureCoordinates.y; +float encodedNormal = compressed0.w; +#else +float webMercatorT = textureCoordinates.y; +float encodedNormal = 0.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 +#else +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 -#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 +vec3 position3DWC = position + u_center3D; +#ifdef GEODETIC_SURFACE_NORMALS +vec3 ellipsoidNormal = geodeticSurfaceNormal; +#else +vec3 ellipsoidNormal = normalize(position3DWC); #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 +#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) +float exaggeration = u_verticalExaggerationAndRelativeHeight.x; +float relativeHeight = u_verticalExaggerationAndRelativeHeight.y; +float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; +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 -#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 +gl_Position = getPosition(position, height, textureCoordinates); +v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; +v_positionMC = position3DWC; +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 -#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 +v_normalMC = normalMC; +v_normalEC = czm_normal3D * v_normalMC; #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 +#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 (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 +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; +#else +vec3 atmosphereLightDirection = czm_lightDirectionWC; #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 +vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); +computeAtmosphereScattering( +position3DWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); #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 +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); #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( -FxaaFloat2 pos, -FxaaTex tex, -FxaaFloat2 fxaaQualityRcpFrame, -FxaaFloat fxaaQualitySubpix, -FxaaFloat fxaaQualityEdgeThreshold, -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; -} +#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 } -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif -} -#endif +`;var NO=`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 +); } -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 gV=`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; -#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) +`;var m1t=new U;function p1t(e,t){let n=e.unionClippingRegions,i=e.length,r=Ns.useFloatTexture(t),o=Ns.getTextureResolution(e,t,m1t),s=o.x,a=o.y,c=r?y1t(s,a):A1t(s,a);return c+=` +`,c+=n?g1t(i):_1t(i),c}function g1t(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -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); + 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; + // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6 + break; + } + } + if (breakAndDiscard) { + discard; + } + return clipAmount; } -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +`}function _1t(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); + 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 y1t(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +{ + int pixY = clippingPlaneNumber / ${e}; + int pixX = clippingPlaneNumber - (pixY * ${e}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${o}; + vec4 plane = texture(packedClippingPlanes, vec2(u, v)); + return czm_transformPlane(plane, transform); } -#endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() +`}function A1t(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { -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; + int clippingPlaneStartIndex = clippingPlaneNumber * 2; + int pixY = clippingPlaneStartIndex / ${e}; + int pixX = clippingPlaneStartIndex - (pixY * ${e}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${r}; + float v = (float(pixY) + 0.5) * ${o}; + 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 + ${r}, v))); + return czm_transformPlane(plane, transform); } -#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) +`}var Kw=p1t;var $re=class{constructor(t,n,i,r,o,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=s}},Jre=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,E=t.perFragmentGroundAtmosphere,v=t.hasVertexNormals,S=t.useWebMercatorProjection,I=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,L=t.enableClippingPolygons,_=t.clippingPolygons,C=t.clippedByBoundaries,w=t.hasImageryLayerCutout,D=t.colorCorrect,N=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,B=t.hasExaggeration,j=t.showUndergroundColor,k=t.translucent,G=i.vectorData,q=G?.show,Q=q&&G.hasPolylines,W=q&&G.hasPolygons,J=q&&t.vectorAntialias,Z=Q&&G.hasMeterWidths,ae=Z&&G.hasPixelWidths,Ae=0,fe="",ge=i.renderedMesh.encoding;ge.quantization===$a.BITS12&&(Ae=1,fe="QUANTIZATION_BITS12");let ve=0,Re="";C&&(ve=1,Re="TILE_LIMIT_RECTANGLE");let Qe=0,He="";w&&(Qe=1,He="APPLY_IMAGERY_CUTOUT");let Ye=n.mode,Ke=((Ye|+o<<2|+s<<3|+a<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+E<<15|+v<<16|+S<<17|+I<<18|Ae<<19|+p<<20|+R<<21|+L<<22|ve<<23|Qe<<24|+D<<25|+N<<26|+F<<27|+V<<28|+B<<29|+j<<30|+k<<31)>>>0)+(d?4294967296:0)+(q?8589934592:0)+(Q?17179869184:0)+(W?34359738368:0)+(J?68719476736:0)+(Z?137438953472:0)+(ae?274877906944:0),Pe=0;l(O)&&O.length>0&&(Pe=R?O.clippingPlanesState:0);let qe=0;l(_)&&_.length>0&&(qe=L?_.clippingPolygonsState:0);let st=i.surfaceShader;if(l(st)&&st.numberOfDayTextures===r&&st.flags===Ke&&st.material===this.material&&st.clippingShaderState===Pe&&st.clippingPolygonShaderState===qe)return st.shaderProgram;let vt=this._shadersByTexturesFlags[r];if(l(vt)||(vt=this._shadersByTexturesFlags[r]=[]),st=vt[Ke],!l(st)||st.material!==this.material||st.clippingShaderState!==Pe||st.clippingPolygonShaderState!==qe){let jt=this.baseVertexShaderSource.clone(),lt=this.baseFragmentShaderSource.clone();Pe!==0&<.sources.unshift(Kw(O,n.context)),jt.defines.push(fe),lt.defines.push(`TEXTURE_UNITS ${r}`,Re,He),o&<.defines.push("APPLY_BRIGHTNESS"),s&<.defines.push("APPLY_CONTRAST"),a&<.defines.push("APPLY_HUE"),c&<.defines.push("APPLY_SATURATION"),u&<.defines.push("APPLY_GAMMA"),f&<.defines.push("APPLY_ALPHA"),d&<.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&<.defines.push("HAS_WATER_MASK"),m&&(lt.defines.push("SHOW_REFLECTIVE_OCEAN"),jt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&<.defines.push("SHOW_OCEAN_WAVES"),F&<.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(jt.defines.push("UNDERGROUND_COLOR"),lt.defines.push("UNDERGROUND_COLOR")),k&&(jt.defines.push("TRANSLUCENT"),lt.defines.push("TRANSLUCENT")),A&&(v?(jt.defines.push("ENABLE_VERTEX_LIGHTING"),lt.defines.push("ENABLE_VERTEX_LIGHTING")):(jt.defines.push("ENABLE_DAYNIGHT_SHADING"),lt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(jt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(jt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(jt.defines.push("GROUND_ATMOSPHERE"),lt.defines.push("GROUND_ATMOSPHERE"),E&&(jt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),lt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),jt.defines.push("INCLUDE_WEB_MERCATOR_Y"),lt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(jt.defines.push("FOG"),lt.defines.push("FOG")),p&<.defines.push("APPLY_SPLIT"),R&<.defines.push("ENABLE_CLIPPING_PLANES"),L&&(lt.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&<.defines.push("CLIPPING_INVERSE")),D&<.defines.push("COLOR_CORRECT"),N&<.defines.push("HIGHLIGHT_FILL_TILE"),V&&jt.defines.push("GEODETIC_SURFACE_NORMALS"),B&&jt.defines.push("EXAGGERATION"),q&&(lt.defines.push("HAS_VECTOR_LAYER"),Q&<.defines.push("HAS_VECTOR_POLYLINES"),W&<.defines.push("HAS_VECTOR_POLYGONS"),J&<.defines.push("VECTOR_ANTIALIAS"),Z&<.defines.push("VECTOR_WIDTH_IN_METERS"),ae&<.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(q||L)&<.sources.unshift(Ky);let mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) + { + vec4 color = initialColor; +`;w&&(mt+=` vec4 cutoutAndColorResult; + bool texelUnclipped; +`);for(let Yt=0;Yt<r;++Yt)w?mt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Yt}]; + texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; + cutoutAndColorResult = sampleAndBlend( +`:mt+=` color = sampleAndBlend( +`,mt+=` color, + u_dayTextures[${Yt}], + u_dayTextureUseWebMercatorT[${Yt}] ? textureCoordinates.xz : textureCoordinates.xy, + u_dayTextureTexCoordsRectangle[${Yt}], + u_dayTextureTranslationAndScale[${Yt}], + ${f?`u_dayTextureAlpha[${Yt}]`:"1.0"}, + ${d?`u_dayTextureNightAlpha[${Yt}]`:"1.0"}, + ${d?`u_dayTextureDayAlpha[${Yt}]`:"1.0"}, + ${o?`u_dayTextureBrightness[${Yt}]`:"0.0"}, + ${s?`u_dayTextureContrast[${Yt}]`:"0.0"}, + ${a?`u_dayTextureHue[${Yt}]`:"0.0"}, + ${c?`u_dayTextureSaturation[${Yt}]`:"0.0"}, + ${u?`u_dayTextureOneOverGamma[${Yt}]`:"0.0"}, + ${p?`u_dayTextureSplit[${Yt}]`:"0.0"}, + ${F?`u_colorsToAlpha[${Yt}]`:"vec4(0.0)"}, + nightBlend); +`,w&&(mt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); +`);mt+=` return color; + }`,lt.sources.push(mt),jt.sources.push(b1t(Ye)),jt.sources.push(x1t(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:jt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[Ke]=new $re(r,Ke,this.material,ft,Pe,qe)}return i.surfaceShader=st,st.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return ue(this)}};function b1t(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); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function x1t(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var JH=Jre;var xOe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(xOe);var uc=xOe;var TOe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(TOe);var Ur=TOe;var f0=class e{constructor(){ut(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Ur.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===Ur.RECEIVING||t===Ur.TRANSFORMING),r=this.imagery;for(let o=0,s=r.length;i&&o<s;++o){let a=r[o];i=!l(a.loadingImagery)||a.loadingImagery.state!==jn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,r,n,i);return h.clone(s,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Ms.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(il.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=Ur.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===uc.START&&(T1t(t,n,i,r),t.state=uc.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===uc.LOADING&&E1t(t,n,i,r,o,s,a),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===Ur.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=uc.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,s=t.upsampledFromParent,a=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===jn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else s=!1}let g=p.processStateMachine(t,i,r);c=c&&g,a=a||g||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===jn.FAILED||p.loadingImagery.state===jn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){EOe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){EOe(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,u=o.encoding,f=u.exaggeration!==s,d=u.exaggerationRelativeHeight!==a;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=s,u.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),o=n.encoding.getAttributes(r),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=tt.createIndexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new Vn({context:t,attributes:o,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,s=o.width,a=o.height,c=s/r.width,u=a/r.height;return i.x=c*(o.west-r.west)/s,i.y=u*(o.south-r.south)/a,i.z=c,i.w=u,i}};function EOe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Eo.clone(s);c.hasGeodeticSurfaceNormals=t,c=Eo.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(f0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=f0._createVertexArrayForMesh(i.context,r)):(f0._freeVertexArray(e.vertexArray),e.vertexArray=f0._createVertexArrayForMesh(i.context,r)),f0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function T1t(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(r=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=Ur.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function E1t(e,t,n,i,r,o,s){let a=e.data,c=e.parent;if(a.terrainState===Ur.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||f0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===Ur.FAILED&&C1t(a,e,t,n,e.x,e.y,e.level),a.terrainState===Ur.UNLOADED&&v1t(a,n,e.x,e.y,e.level),a.terrainState===Ur.RECEIVED&&w1t(a,t,n,e.x,e.y,e.level),a.terrainState===Ur.TRANSFORMED&&(I1t(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,o)),a.terrainState>=Ur.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)D1t(t.context,a);else{let f=a._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(a.waterMaskTexture=d.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,f,a.waterMaskTranslationAndScale))}}function C1t(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=uc.FAILED;return}let u=a.data.terrainData,f=a.x,d=a.y,p=a.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,s);l(g)&&(e.terrainState=Ur.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=Ur.RECEIVED)}).catch(function(){e.terrainState=Ur.FAILED}))}function v1t(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=Ur.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Ur.RECEIVED,e.request=void 0}function s(c){if(e.request.state===wi.CANCELLED){e.terrainData=void 0,e.terrainState=Ur.UNLOADED,e.request=void 0;return}e.terrainState=Ur.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=Zr.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=Ur.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=Ur.UNLOADED,e.request=void 0)}a()}var S1t={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function w1t(e,t,n,i,r,o){let s=n.tilingScheme,a=S1t;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=Ur.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Ur.TRANSFORMED}).catch(function(){e.terrainState=Ur.FAILED}))}function I1t(e,t,n,i,r,o,s){e.vertexArray=f0._createVertexArrayForMesh(t,e.mesh),e.terrainState=Ur.READY,e.fill=e.fill&&e.fill.destroy(s)}function P1t(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:$e.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function D1t(e,t){let n=t.terrainData.waterMask,i=P1t(e),r,o=n.length;if(n instanceof ImageBitmap)r=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Dt.create({context:e,pixelFormat:$e.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var bm=f0;var COe={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>=COe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},mi=COe;function Jw(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}Jw.prototype.update=function(e,t,n){this.changedThisFrame&&(ROe(e,t,this.tile,n),this.changedThisFrame=!1)};Jw.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};Jw.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):bm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var R1t=new qb;Jw.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=R1t;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);Ta(e,n,c,u,s,In.EAST,!1,a,i),Ta(e,n,c,f,s,In.NORTH,!1,a,i),Ta(e,n,c,d,s,In.WEST,!1,a,i),Ta(e,n,c,p,s,In.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);Ta(e,n,c,g,s,In.SOUTHEAST,!1,a,i),Ta(e,n,c,y,s,In.SOUTHWEST,!1,a,i),Ta(e,n,c,m,s,In.NORTHEAST,!1,a,i),Ta(e,n,c,A,s,In.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ta(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||mi.wasKicked(u._lastSelectionResult)||mi.originalResult(u._lastSelectionResult)===mi.CULLED);){if(s)return;let f=u.parent;if(o>=In.NORTHWEST&&f!==void 0)switch(o){case In.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case In.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case In.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case In.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===mi.RENDERED){if(l(u.data.vertexArray))return;O1t(e,t,n,u,o,r,a,c);return}if(mi.originalResult(i._lastSelectionResult)!==mi.CULLED)switch(o){case In.WEST:Ta(e,t,n,i.northwestChild,r,o,!0,a,c),Ta(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.EAST:Ta(e,t,n,i.southeastChild,r,o,!0,a,c),Ta(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTH:Ta(e,t,n,i.southwestChild,r,o,!0,a,c),Ta(e,t,n,i.southeastChild,r,o,!0,a,c);break;case In.NORTH:Ta(e,t,n,i.northeastChild,r,o,!0,a,c),Ta(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHWEST:Ta(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHEAST:Ta(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTHWEST:Ta(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.SOUTHEAST:Ta(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function O1t(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new Jw(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),M1t(e,t,n,i,r,a)}function M1t(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(ROe(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case In.WEST:u=s.westMeshes,f=s.westTiles;break;case In.SOUTH:u=s.southMeshes,f=s.southTiles;break;case In.EAST:u=s.eastMeshes,f=s.eastTiles;break;case In.NORTH:u=s.northMeshes,f=s.northTiles;break;case In.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case In.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case In.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case In.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case In.WEST:for(A=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(y.south,m.north,A));++p);break;case In.SOUTH:for(A=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(y.east,m.west,A));++p);break;case In.EAST:for(A=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(y.north,m.south,A));++p);break;case In.NORTH:for(A=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var MT=new he,N1t=new he,$w=new h,toe=new h,Zre=new U,Qre=new U,kf=new U;function rG(){this.height=0,this.encodedNormal=new U}function ZH(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return OOe(e,t,n,i,u,c),c}var L1t={minimumHeight:0,maximumHeight:0},F1t=new h,vOe=new rG,SOe=new rG,wOe=new rG,IOe=new rG,B1t=typeof Uint8Array<"u"?new Uint8Array(81):void 0,k1t={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function ROe(e,t,n,i){bm.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=eG(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,wOe),p=eG(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,vOe),g=eG(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,SOe),m=eG(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,IOe);d=ZH(o,f,0,1,d,p,m,g,wOe),p=ZH(o,f,0,0,p,d,g,m,vOe),g=ZH(o,f,1,1,g,p,m,d,SOe),m=ZH(o,f,1,1,m,g,d,p,IOe);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),E=Math.max(y,A,b,x),v=(T+E)*.5,S,I,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&E-T<=R){let w=new jc({width:9,height:9,buffer:B1t,structure:{heightOffset:E}}),D=k1t;D.tilingScheme=n.tilingScheme,D.x=n.x,D.y=n.y,D.level=n.level,D.exaggeration=a,D.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(D)}else{let w=u,D=ie.center(s,N1t);D.height=v;let N=f.cartographicToCartesian(D,F1t),F=new Eo(N,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,B;for(B=o.westMeshes,S=0,I=B.length;S<I;++S)V+=B[S].eastIndicesNorthToSouth.length;for(B=o.southMeshes,S=0,I=B.length;S<I;++S)V+=B[S].northIndicesWestToEast.length;for(B=o.eastMeshes,S=0,I=B.length;S<I;++S)V+=B[S].westIndicesSouthToNorth.length;for(B=o.northMeshes,S=0,I=B.length;S<I;++S)V+=B[S].southIndicesEastToWest.length;let j=L1t;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=QH(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=nG(o,f,F,G,q,o.westTiles,o.westMeshes,In.EAST,j);let W=q;q=QH(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=nG(o,f,F,G,q,o.southTiles,o.southMeshes,In.NORTH,j);let J=q;q=QH(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=nG(o,f,F,G,q,o.eastTiles,o.eastMeshes,In.WEST,j);let Z=q;q=QH(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=nG(o,f,F,G,q,o.northTiles,o.northMeshes,In.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=en.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=xi.geodeticLatitudeToMercatorAngle(s.south),fe=1/(xi.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(xi.geodeticLatitudeToMercatorAngle(D.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(MT,toe),we=cn.octEncode(ge,Zre),ve=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,kf),v,we,xe,ge),++q;let Re=q,Qe=Re<256?1:2,He=(Re-1)*3,Ye=He*Qe,Ke=(G.length-Re*k)*Float32Array.BYTES_PER_ELEMENT,Pe;if(Ke>=Ye){let mt=Re*k*Float32Array.BYTES_PER_ELEMENT;Pe=Re<256?new Uint8Array(G.buffer,mt,He):new Uint16Array(G.buffer,mt,He)}else Pe=Re<256?new Uint8Array(He):new Uint16Array(He);G=new Float32Array(G.buffer,0,Re*k);let qe=0;for(S=0;S<Re-2;++S)Pe[qe++]=ve,Pe[qe++]=S,Pe[qe++]=S+1;Pe[qe++]=ve,Pe[qe++]=S,Pe[qe]=0;let st=[];for(S=W;S>=Q;--S)st.push(S);let vt=[];for(S=J;S>=W;--S)vt.push(S);let jt=[];for(S=Z;S>=J;--S)jt.push(S);let lt=[];for(lt.push(0),S=ve-1;S>=Z;--S)lt.push(S);o.mesh=new Ac(F.center,G,Pe,He,Re,T,E,s,le.fromOrientedBoundingBox(ae),W1t(e,ae.center,s,T,E),F.stride,ae,F,st,vt,jt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=bm._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let C=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function QH(e,t,n,i,r,o,s,a,c,u,f){let d=MT;d.longitude=P.lerp(t.west,t.east,o),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,$w),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,toe));let m=Qre;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var iG=new ie;function LO(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,iG),r.west-=P.TWO_PI,r.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,iG),r.west+=P.TWO_PI,r.east+=P.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);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 U1t=new U;function eoe(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var z1t=new U,V1t=new h;function j1t(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=LO(t,n,f.decodeTextureCoordinates(d,r,kf),kf),g=LO(t,n,f.decodeTextureCoordinates(d,o,Qre),Qre),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;MT.longitude=P.lerp(b.west,b.east,s),MT.latitude=P.lerp(b.south,b.north,a),u.height=MT.height=P.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,U1t),E=f.getOctEncodedNormal(d,o,z1t),v=cn.octDecode(T.x,T.y,$w),S=cn.octDecode(E.x,E.y,V1t);x=h.lerp(v,S,m,$w),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(MT,$w),cn.octEncode(x,u.encodedNormal)}function OOe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(MT,$w);cn.octEncode(s,o.encodedNormal)}function eG(e,t,n,i,r,o,s,a,c,u,f){if(DOe(e,t,a,s,!1,n,i,f)||DOe(e,t,u,c,!0,n,i,f))return f;let p;if(noe(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],eoe(o,p,n,i,f),f;let g;if(n===0?i===0?g=tG(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=tG(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=tG(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=tG(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return OOe(e,t,n,i,g,f),f}function tG(e,t,n,i,r,o,s,a){let c=POe(e,t,!1,n,s,a),u=POe(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function nG(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=H1t(e,t,n,i,r,o[u],s[u],a,c);return r}function H1t(e,t,n,i,r,o,s,a,c){let u;a===In.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,iG),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===In.WEST&&o.x===0&&(u=ie.clone(o.rectangle,iG),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,kf),d=kf.x,p=kf.y);let g,m;switch(a){case In.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case In.NORTH:g=s.northIndicesWestToEast,m=!0;break;case In.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case In.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=s.encoding,x=s.vertices,T=n.stride,E,v;b.hasWebMercatorT&&(E=xi.geodeticLatitudeToMercatorAngle(f.south),v=1/(xi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,kf);LO(y,A,R,R);let O=R.x,L=R.y,_=m?O:L;if(_<0||_>1||Math.abs(O-d)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let C=Math.abs(O)<P.EPSILON5||Math.abs(O-1)<P.EPSILON5,w=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(C&&w)continue;let D=b.decodePosition(x,I,$w),N=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,Zre):(F=Zre,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=P.lerp(f.south,f.north,L);V=(xi.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(D,toe)),n.encode(i,r*T,D,R,N,F,V,B),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++r}return r}function POe(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!noe(d,f))continue;let p;switch(i){case In.WEST:p=f.westIndicesSouthToNorth;break;case In.SOUTH:p=f.southIndicesEastToWest;break;case In.EAST:p=f.eastIndicesNorthToSouth;break;case In.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function noe(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function DOe(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(noe(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,kf);let y=LO(g,e.tile,kf,kf);if(y.x===o&&y.y===s)return eoe(m,p,o,s,a),!0;if(d=Pr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,kf);let x=LO(g,e.tile,kf,kf);return f?u?x.x-o:x.y-s:u?o-x.x:s-x.y}),d<0){if(d=~d,d>0&&d<c.length)return j1t(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return eoe(m,c[d],o,s,a),!0}return!1}var G1t=[new h,new h,new h,new h];function W1t(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=G1t;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var FO=Jw;var ioe=class e{constructor(t){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=Dn.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=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.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(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.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,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=se.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){Ns.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(il.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(X1t)}));let n=this._vectorProvider;n.minimumTileScreenPixels=Y1t(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(o=>{let s=o.data;l(s.vectorData)?s.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,s.vectorData,We.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(o.x,o.y,o.level,t.context,We.CLAMP_TO_TERRAIN)}),n.makeClean(),Z1t(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)bm._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,s=n.length;o<s;++o){let a=n[o];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&r.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:xc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:xc.LESS_OR_EQUAL},blending:rn.ALPHA_BLEND});let c=Ze(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=Ge.fromCache(c),c=Ze(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=Ge.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&FO.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&K1t(this);let a=this._tilesToRenderByTextureCount;for(let c=0,u=a.length;c<u;++c){let f=a[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],m=g.data;$1t(this,g,m,t);let y=m.tileBoundingRegion;TRt(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i){let o=n[i];o.dirty=!0,o.derivedCommands.picking=void 0;let s=o.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),BOe(o,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===mi.CULLED_BUT_NEEDED,o=i.terrainState),bm.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Ko.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,bm.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=UOe(this,n);if(n.fog.enabled&&!o&&P.fog(r,n.fog.density)>=1)return Ko.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Ko.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=sG(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,kOe);if(!l(d))return Ko.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=Q1t,le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(s.renderedMesh)&&(u=le.union(a.boundingSphere,u,u))),!l(u))return Ko.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==$t.INSIDE,b===$t.OUTSIDE)return Ko.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(a);t.isClipped=b!==$t.OUTSIDE}let m,y=c.computeVisibility(u);if(y===$t.OUTSIDE?m=Ko.NONE:y===$t.INTERSECTING?m=Ko.PARTIAL:y===$t.INSIDE&&(m=Ko.FULL),m===Ko.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof _n;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:Ko.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=nRt;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===Ur.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===jn.FAILED||p.state===jn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=iRt;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:mi.NONE;if(p===mi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===Ur.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],A=y.loadingImagery,b=!l(A)||A.state===jn.FAILED||A.state===jn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===mi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(r.center,o,rRt),c=h.magnitude(a);return c<P.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){dRt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-s),d=Math.abs(u-a);f>d?(o.minimumHeight=s,o.maximumHeight=s):(o.minimumHeight=a,o.maximumHeight=a)}let c=o.distanceToCamera(n);return o.minimumHeight=s,o.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),ue(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,u=a.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(a,i,g)&&(a._loadedCallbacks[t._layerIndex]=hRt(p,t,i),a.state=uc.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=uc.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==mi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,s=0;for(let a=0,c=r.length;a<c;++a){let u=r[a],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=a),u.freeResources(),++s;else if(o!==-1)break}o!==-1&&r.splice(o,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},q1t=new ie;function Y1t(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,q1t).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function X1t(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}function K1t(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(il.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function $1t(e,t,n,i){let r=e._clippingPolygons;!l(r)||!r.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=r.requestRectangleData(t.rectangle,i.context))}function J1t(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function Z1t(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function BOe(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)}var Q1t=new le,kOe=new ie,eRt=new ie,tRt=new he;function sG(e,t){if(t.west<t.east)return t;let n=ie.clone(t,eRt);return ie.center(e,tRt).longitude>0?n.east=P.PI:n.west=-P.PI,n}function UOe(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||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var nRt=[],iRt=[],rRt=new h,MOe=new M,oG=new M,oRt=new se,sRt=new se,aRt=new se,cRt=new h,NOe=new h,lRt=new h,uRt=new h,fRt=[new h,new h,new h,new h];function LOe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=fRt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function dRt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new bm);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Ud({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=br.getHeight(o.minimumHeight,p,g),o.maximumHeight=br.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=en.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=le.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=LOe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=LOe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function hRt(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}var mRt=new M,pRt=new M;function FOe(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,r=M.multiplyByPoint(i,this.properties.rtc,NOe);return M.setTranslation(i,r,MOe),MOe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=M.multiplyByPoint(i,this.properties.rtc,NOe);return M.setTranslation(i,o,oG),M.multiply(r,oG,oG),oG},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,r=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,mRt):M.IDENTITY;return M.inverseTranspose(r,pRt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},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},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new U,scaleAndBias:new M,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new U,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Mt(n,t.materialUniformMap):n}function gRt(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=_Rt(e,r,i),n.wireframeVertexArray.mesh=i}}function _Rt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Wn.toWireframe(r);let o=r.indices,s=tt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new Vn({context:e,attributes:t._attributes,indexBuffer:s})}var zOe,VOe,aG;(function(){let e=new Bt({geometry:ep.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new Ey({radius:1})}),n=new M,i,r;function o(s){return new Nn({geometryInstances:s,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}zOe=function(s,a){return s===i||(aG(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},VOe=function(s,a){return s===i||(aG(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),r=o(t)),r},aG=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var yRt=new se(0,0,0,0),ARt={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,vectorAntialias:void 0},bRt=z.TRANSPARENT,xRt=new qt;function TRt(e,t,n){let i=t.data;if(J1t(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new FO(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let mt=o.credits;for(let ft=0,Yt=mt.length;ft<Yt;++ft)r.addCreditToNextFrame(mt[ft])}let s=Ut.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??bRt,A=e.undergroundColorAlphaByDistance??xRt,b=UOe(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,S=e.oceanNormalMap,I=v&&l(S),R=e.terrainProvider,O=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,C=Dn.castShadows(e.shadows)&&!d,w=Dn.receiveShadows(e.shadows)&&!d,D=e.hueShift,N=e.saturationShift,F=e.brightnessShift,V=!(P.equalsEpsilon(D,0,P.EPSILON7)&&P.equalsEpsilon(N,0,P.EPSILON7)&&P.equalsEpsilon(F,0,P.EPSILON7)),B=!1;if(_){let mt=h.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;B=mt>ft}E&&--s,I&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,k=j.center,G=j.encoding,q=i.tileBoundingRegion,Q=n.verticalExaggeration,W=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ae=oRt,Ae=0,fe=0,xe=0,ge=0,we=!1;if(n.mode!==re.SCENE3D){let mt=n.mapProjection,ft=mt.project(ie.southwest(t.rectangle),lRt),Yt=mt.project(ie.northeast(t.rectangle),uRt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Yt.x,ae.w=Yt.y,n.mode!==re.MORPHING&&(k=cRt,k.x=0,k.y=(ae.z+ae.x)*.5,k.z=(ae.w+ae.y)*.5,ae.x-=k.y,ae.y-=k.z,ae.z-=k.y,ae.w-=k.z),n.mode===re.SCENE2D&&G.quantization===$a.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,ht=(ae.z-ae.x)*rt,Li=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Li,ae.z+=ht,ae.w+=Li}mt instanceof xi&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=xi.geodeticLatitudeToMercatorAngle(Ae),ge=1/(xi.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let ve=ARt;ve.frameState=n,ve.surfaceTile=i,ve.hasWaterMask=E,ve.showReflectiveOcean=v,ve.showOceanWaves=I,ve.enableLighting=e.enableLighting,ve.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,ve.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,ve.showGroundAtmosphere=_,ve.atmosphereLightIntensity=e.atmosphereLightIntensity,ve.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ve.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ve.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ve.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ve.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ve.perFragmentGroundAtmosphere=B,ve.hasVertexNormals=O,ve.useWebMercatorProjection=we,ve.clippedByBoundaries=i.clippedByBoundaries,ve.hasGeodeticSurfaceNormals=Z,ve.hasExaggeration=J,ve.vectorAntialias=e.vectorProvider.antialias;let Re=i.imagery,Qe=0,He=Re.length,Ye=e.showSkirts&&!u&&!d,Ke=e.backFaceCulling&&!u&&!d,Pe=Ke?e._renderState:e._disableCullingRenderState,qe=Ke?e._blendRenderState:e._disableCullingBlendRenderState,st=Pe,vt=e._firstPassInitialColor,jt=n.context;if(l(e._debug.boundingSphereTile)||aG(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=FOe(n,e)}do{let mt=0,ft,Yt;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new at,ft.owner=t,ft.cull=!1,ft.boundingVolume=new le,ft.orientedBoundingBox=void 0,Yt=FOe(n,e),e._drawCommands.push(ft),e._uniformMaps.push(Yt)):(ft=e._drawCommands[e._usedDrawCommands],Yt=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Es=q.boundingVolume,Ha=q.boundingSphere;l(Es)?zOe(Es,z.RED).update(n):l(Ha)&&VOe(Ha,z.RED).update(n)}let rt=Yt.properties;se.clone(vt,rt.initialColor),rt.oceanNormalMap=S,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ht=u?g:p,Li=u?p:g;l(ht)&&(se.fromElements(ht.near,ht.nearValue,ht.far,ht.farValue,rt.frontFaceAlphaByDistance),se.fromElements(Li.near,Li.nearValue,Li.far,Li.farValue,rt.backFaceAlphaByDistance)),se.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),z.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let Yn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Yn&&z.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=W,rt.center3D=j.center,h.clone(k,rt.rtc),se.clone(ae,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=fe,rt.southMercatorYAndOneOverHeight.x=xe,rt.southMercatorYAndOneOverHeight.y=ge;let gi=sRt,zi=sG(t.rectangle,e.cartographicLimitRectangle),Si=aRt,ui=sG(t.rectangle,m);h.fromElements(D,N,F,rt.hsbShift);let _i=t.rectangle,zn=1/_i.width,tn=1/_i.height;gi.x=(zi.west-_i.west)*zn,gi.y=(zi.south-_i.south)*tn,gi.z=(zi.east-_i.west)*zn,gi.w=(zi.north-_i.south)*tn,se.clone(gi,rt.localizedCartographicLimitRectangle),Si.x=(ui.west-_i.west)*zn,Si.y=(ui.south-_i.south)*tn,Si.z=(ui.east-_i.west)*zn,Si.w=(ui.north-_i.south)*tn,se.clone(Si,rt.localizedTranslucencyRectangle);let Hn=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;V=V&&(Hn||_);let Ki=!1,wr=!1,so=!1,Ts=!1,zs=!1,$r=!1,hi=!1,ao=!1,nr=!1,jo=!1;for(;mt<s&&Qe<He;){let Es=Re[Qe],Ha=Es.readyImagery;if(++Qe,!l(Ha)||Ha.imageryLayer.alpha===0)continue;let cb=Es.useWebMercatorT?Ha.textureWebMercator:Ha.texture,ii=Ha.imageryLayer;l(Es.textureTranslationAndScale)||(Es.textureTranslationAndScale=ii._calculateTextureTranslationAndScale(t,Es)),rt.dayTextures[mt]=cb,rt.dayTextureTranslationAndScale[mt]=Es.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[mt]=Es.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[mt]=Es.useWebMercatorT,rt.dayTextureAlpha[mt]=ii.alpha,$r=$r||rt.dayTextureAlpha[mt]!==1,rt.dayTextureNightAlpha[mt]=ii.nightAlpha,hi=hi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ii.dayAlpha,hi=hi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ii.brightness,Ki=Ki||rt.dayTextureBrightness[mt]!==Fs.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ii.contrast,wr=wr||rt.dayTextureContrast[mt]!==Fs.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ii.hue,so=so||rt.dayTextureHue[mt]!==Fs.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ii.saturation,Ts=Ts||rt.dayTextureSaturation[mt]!==Fs.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ii.gamma,zs=zs||rt.dayTextureOneOverGamma[mt]!==1/Fs.DEFAULT_GAMMA,rt.dayTextureSplit[mt]=ii.splitDirection,ao=ao||rt.dayTextureSplit[mt]!==0;let Wr=rt.dayTextureCutoutRectangles[mt];if(l(Wr)||(Wr=rt.dayTextureCutoutRectangles[mt]=new se),se.clone(se.ZERO,Wr),l(ii.cutoutRectangle)){let Ca=sG(_i,ii.cutoutRectangle),Mm=ie.simpleIntersection(Ca,_i,kOe);nr=l(Mm)||nr,Wr.x=(Ca.west-_i.west)*zn,Wr.y=(Ca.south-_i.south)*tn,Wr.z=(Ca.east-_i.west)*zn,Wr.w=(Ca.north-_i.south)*tn}let _l=rt.colorsToAlpha[mt];l(_l)||(_l=rt.colorsToAlpha[mt]=new se);let w0=l(ii.colorToAlpha)&&ii.colorToAlphaThreshold>0;if(jo=jo||w0,w0){let Ca=ii.colorToAlpha;_l.x=Ca.red,_l.y=Ca.green,_l.z=Ca.blue,_l.w=ii.colorToAlphaThreshold}else _l.w=-1;if(l(Ha.credits)){let Ca=Ha.credits;for(let Mm=0,A_=Ca.length;Mm<A_;++Mm)r.addCreditToNextFrame(Ca[Mm])}++mt}rt.dayTextures.length=mt,rt.waterMask=a,se.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,M.clone(G.matrix,rt.scaleAndBias);let Fn=e._clippingPlanes,Vi=l(Fn)&&Fn.enabled&&t.isClipped;Vi&&(rt.clippingPlanesEdgeColor=z.clone(Fn.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Fn.edgeWidth);let Fi=i.vectorData;l(Fi)&&(rt.vectorSegmentTexture=Fi.polylineSegmentTexture,rt.vectorWidthTexture=Fi.widthTexture,rt.vectorColorTexture=Fi.colorTexture,rt.vectorPickColorTexture=Fi.pickColorTexture,rt.vectorSegmentPrimitiveIndicesTexture=Fi.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=Fi.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=Fi.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=Fi.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=Fi.polygonGridCellIndicesTexture,U.clone(Fi.metersPerUv,rt.vectorMetersPerUv));let Ir=i.clippingPolygonData;l(Ir)&&(rt.clippingEdgeTexture=Ir.polygonEdgeTexture,rt.clippingEdgePrimitiveIndicesTexture=Ir.polygonEdgePrimitiveIndicesTexture,rt.clippingGridCellIndicesTexture=Ir.polygonGridCellIndicesTexture);let Mc=e._clippingPolygons,qf=(Ir?.polygonRings.length??0)>0,Rm=l(Mc)&&Mc.enabled&&Mc.length>0&&t.isClipped&&qf;ve.numberOfDayTextures=mt,ve.applyBrightness=Ki,ve.applyContrast=wr,ve.applyHue=so,ve.applySaturation=Ts,ve.applyGamma=zs,ve.applyAlpha=$r,ve.applyDayNightAlpha=hi,ve.applySplit=ao,ve.enableFog=Hn,ve.enableClippingPlanes=Vi,ve.clippingPlanes=Fn,ve.enableClippingPolygons=Rm,ve.clippingPolygons=Mc,ve.hasImageryLayerCutout=nr,ve.colorCorrect=V,ve.highlightFillTile=Yn,ve.colorToAlpha=jo,ve.showUndergroundColor=b,ve.translucent=d;let ch=i.renderedMesh.indices.length;Ye||(ch=i.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(ve),ft.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ft.castShadows=C,ft.receiveShadows=w,ft.renderState=st,ft.primitiveType=Oe.TRIANGLES,ft.vertexArray=i.vertexArray||i.fill.vertexArray,ft.count=ch,ft.uniformMap=Yt,ft.pass=Ie.GLOBE,e._debug.wireframe&&(gRt(jt,t),l(i.wireframeVertexArray)&&(ft.vertexArray=i.wireframeVertexArray,ft.primitiveType=Oe.LINES,ft.count=ch*2));let na=ft.boundingVolume,Om=ft.orientedBoundingBox;n.mode!==re.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,na),h.fromElements(na.center.z,na.center.x,na.center.y,na.center),n.mode===re.MORPHING&&le.union(q.boundingSphere,na,na)):(ft.boundingVolume=le.clone(q.boundingSphere,na),ft.orientedBoundingBox=en.clone(q.boundingVolume,Om)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),BOe(ft,n),st=qe,vt=yRt}while(Qe<He)}var cG=ioe;function jOe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(jOe.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=qt.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=qt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var lG=jOe;var roe=class{constructor(t){this._ellipsoid=new Km(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},uG=roe;var ooe=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},ERt=1e3,soe=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.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=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=mi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new ooe(ERt),this.state=uc.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)r[o++]=new e({tilingScheme:t,x:a,y:s,level:0});return r}_getCacheKey(t,n){return vRt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];i.add(o),HOe(this,o.positionCartographic)._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];i.has(o)&&i.delete(o),HOe(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<uc.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=uc.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),fG(this._southwestChild),this._southwestChild=void 0,fG(this._southeastChild),this._southeastChild=void 0,fG(this._northwestChild),this._northwestChild=void 0,fG(this._northeastChild),this._northeastChild=void 0}},CRt=256;function vRt(e,t,n,i){let r=n.width/CRt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var SRt=new he;function HOe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,SRt),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function fG(e){l(e)&&e.freeResources()}var dG=soe;function hG(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}hG.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};hG.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(),GOe(this,t)),t=i}};function GOe(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}hG.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))&&GOe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var mG=hG;function Jd(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._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new mG,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new uG({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Jd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Jd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function wRt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,qOe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let s of o)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Jd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==uc.START&&e(t),t=t.replacementNext};Jd.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Jd.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length,s=!1;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Jd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function qOe(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}Jd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(wRt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),qOe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Jd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),RRt(this,e),VRt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function IRt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.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))}Jd.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(BRt(this,e),zRt(this,e),IRt(this,e))};Jd.prototype.isDestroyed=function(){return!1};Jd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var kO,WOe=new he;function PRt(e,t){let n=ie.center(e.rectangle,WOe),i=n.longitude-kO.longitude,r=n.latitude-kO.latitude;n=ie.center(t.rectangle,WOe);let o=n.longitude-kO.longitude,s=n.latitude-kO.latitude;return i*i+r*r-(o*o+s*s)}var DRt=new h,BO=[];function RRt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=dG.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(BO.length<g){BO=new Array(g);for(let m=0;m<g;++m)BO[m]===void 0&&(BO[m]=new UO)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;kO=t.camera.positionCartographic,o.sort(PRt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=M.getTranslation(u.transform,DRt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Dc(e,p,r,t,s,!1,BO[d]):(i_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function i_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function UO(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function YOe(){this.southwest=new UO,this.southeast=new UO,this.northwest=new UO,this.northeast=new UO}YOe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var coe=new Array(31);for(let e=0;e<coe.length;++e)coe[e]=new YOe;function ORt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=LRt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:mi.NONE,g=e.tileProvider;if(s||i){let m=mi.originalResult(p)===mi.RENDERED,y=mi.originalResult(p)===mi.CULLED||p===mi.NONE,A=n.state===uc.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&i_(e,e._tileLoadQueueMedium,n,t),pG(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===mi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=mi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&i_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){pG(e,n),i_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===mi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=mi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=mi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(MRt(e,a,c,u,f,t,i,r),y!==e._tilesToRender.length){let E=r.allAreRenderable,v=r.anyWereRenderedLastFrame,S=r.notYetRenderableCount,I=!1;if(!E&&!v){let R=e._tilesToRender;for(let L=y;L<R.length;++L){let _=R[L];for(;_!==void 0&&_._lastSelectionResult!==mi.KICKED&&_!==n;)_._lastSelectionResult=mi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,pG(e,n),n._lastSelectionResult=mi.RENDERED;let O=p===mi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,i_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&i_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=mi.RENDERED,pG(e,n),i_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===mi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function MRt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=coe[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Dc(e,t,u,o,f,s,p),Dc(e,n,u,o,f,s,g),Dc(e,i,u,o,f,s,m),Dc(e,r,u,o,f,s,y)):(Dc(e,i,u,o,f,s,m),Dc(e,t,u,o,f,s,p),Dc(e,r,u,o,f,s,y),Dc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Dc(e,n,u,o,f,s,g),Dc(e,t,u,o,f,s,p),Dc(e,r,u,o,f,s,y),Dc(e,i,u,o,f,s,m)):(Dc(e,r,u,o,f,s,y),Dc(e,i,u,o,f,s,m),Dc(e,n,u,o,f,s,g),Dc(e,t,u,o,f,s,p)),d.combine(a)}function NRt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Dc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==Ko.NONE)return ORt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,NRt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&i_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:mi.NONE;c!==mi.CULLED_BUT_NEEDED&&c!==mi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=mi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(i_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=mi.CULLED):t._lastSelectionResult=mi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function LRt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof _n||t.camera.frustum instanceof Ss)return FRt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=P.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function FRt(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function pG(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function BRt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=xn()+e._loadQueueTimeSlice,s=e._tileProvider,a=aoe(e,t,s,o,n,!1);a=aoe(e,t,s,o,i,a),aoe(e,t,s,o,r,a)}function kRt(e,t){return e._loadPriority-t._loadPriority}function aoe(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(kRt);for(let s=0,a=r.length;s<a&&(xn()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var Zw=new gn,gG=new he,WA=new h,URt=[];function zRt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=URt;n.length=0;let i=e._tileToUpdateHeights,r=xn(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:mi.NONE;(A===mi.RENDERED||A===mi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,E=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===re.SCENE3D){let v=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,Zw.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,Zw.origin);if(!l(S)){let I=0;l(d.data.tileBoundingRegion)&&(I=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(I,-11500),O=h.multiplyByScalar(v,Math.abs(R)+1,WA);h.subtract(A.positionOnEllipsoidSurface,O,Zw.origin)}}else he.clone(A.positionCartographic,gG),gG.height=-11500,c.project(gG,WA),h.fromElements(WA.z,WA.x,WA.y,WA),h.clone(WA,Zw.origin),h.clone(h.UNIT_X,Zw.direction);T=d.data.pick(Zw,a,c,!1,WA),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,gG);A.callback(v)}A.level=d.level}}if(xn()>=s){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function VRt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var _G=Jd;function xm(e){e=e??ee.default;let t=new og({ellipsoid:e}),n=new NS,i=new Iy({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new JH,this._material=void 0,this._surface=new _G({tileProvider:new cG({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new qt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new lG,uoe(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("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=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Dn.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(xm.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=ie.clone(ie.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,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&uoe(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,uoe(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=qt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function uoe(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Ip,NO];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(KH),e._surfaceShaderSet.baseVertexShaderSource=new Xe({sources:[Ip,NO,$H],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Xe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function jRt(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),r=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var HRt=[],GRt={start:0,stop:0};xm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=HRt;s.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=le.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))le.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=bi.raySphere(e,d,GRt);l(p)&&s.push(f)}s.sort(jRt(e.origin));let a,c=s.length;for(let u=0;u<c&&(a=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(a));++u);return a};var WRt=new he;xm.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,WRt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var qRt=new h,XOe=new h,YRt=new he,XRt=new gn;function loe(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}xm.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=loe(n._southwestChild,e)||loe(n._southeastChild,e)||loe(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,qRt),u=XRt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,XOe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,XOe);if(l(p))return a.cartesianToCartographic(p,YRt).height};xm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};xm.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.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===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,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))};xm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};xm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};xm.prototype.isDestroyed=function(){return!1};xm.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(),ue(this)};var yG=xm;var zO=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; +in vec3 v_positionEC; +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) { -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; +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; +vec3 normalEC = normalize(czm_normal * normalMC); +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 -color = pow(color, vec3(textureOneOverGamma)); +return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif -#ifdef APPLY_SPLIT -float splitPosition = czm_splitPosition; -if (split < 0.0 && gl_FragCoord.x > splitPosition) { -alpha = 0.0; -} -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; -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) +void main() { -direction = vec3(0.0, 0.0, -1.0); +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; } -else -{ -direction = normalize(vec3(xy, -czm_currentFrustum.x)); +if (t1 < 0.0 && t2 < 0.0) { +discard; } -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; +float t = min(t1, t2); +if (t < 0.0) { +t = 0.0; } -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) +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; } -#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)); -vec3 normalEC = czm_normal3D * normalMC; -#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); +vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); +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 nightBlend = 0.0; +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 -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) +} +`;var VO=`in vec3 position; +uniform vec3 u_radii; +out vec3 v_positionEC; +void main() { -cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; +vec4 p = vec4(u_radii * position, 1.0); +vec4 pEC = czm_modelView * p; +v_positionEC = pEC.xyz; +gl_Position = czm_projection * pEC; +gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); +czm_vertexLogDepth(); } -else if (czm_sceneMode == czm_sceneModeColumbusView) +`;var foe={position:0};function AG(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new le,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??lr.fromType(lr.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 at({owner:e._owner??this}),this._pickCommand=new at({owner: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 KRt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:foe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}AG.prototype.update=function(e){if(!this.show||e.mode!==re.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=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?rn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=KRt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),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,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Xe({sources:[VO]}),p=new Xe({sources:[this.material.shaderSource,zO]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:foe}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Mt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let y=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)||u)&&(d=new Xe({sources:[VO]}),p=new Xe({sources:[this.material.shaderSource,zO],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:foe}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Mt(Mt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(y)}};AG.prototype.isDestroyed=function(){return!1};AG.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(),ue(this)};var bG=AG;function jO(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ee.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new bG({radii:this.ellipsoid.radii,material:lr.fromType(lr.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Qk}Object.defineProperties(jO.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var xG=new $,$Rt=new $,JRt=new h,TG=[];jO.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(At.computeIcrfToFixedMatrix(n,xG))||At.computeTemeToPseudoFixedMatrix(n,xG);let i=this._axes.evaluate(n,$Rt);$.transpose(i,i),$.multiply(xG,i,i);let r=wb.computeMoonPositionInEarthInertialFrame(n,JRt);$.multiplyByVector(xG,r,r),M.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=TG,TG.length=0,t.update(e),e.commandList=o,TG.length===1?TG[0]:void 0};jO.prototype.isDestroyed=function(){return!1};jO.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var EG=jO;var CG=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; +float vdcRadicalInverse(int i) { -cameraDist = -czm_view[3].z; +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; } -else +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) { -cameraDist = length(czm_view[3]); +return vec2(float(i) / float(N), vdcRadicalInverse(i)); } -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; +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; } -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) +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) { -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); +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; } -#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) +return 0.0; +} +vec2 integrateBrdf(float roughness, float NdotV) { -finalColor = clippingPlanesEdgeColor; +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; } -#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()) +} +return vec2(A, B) / float(NumSamples); +} +void main() { -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; -#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); -#ifdef FOG -vec3 fogColor = groundAtmosphereColor.rgb; -#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 -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 +out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } -#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); +`;function HO(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(HO.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function ZRt(e,t,n){let i=t.createViewportQuadCommand(CG,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}HO.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST});this._colorTexture=n;let i=new vs({context:t,colorTextures:[n],destroyAttachments:!1});ZRt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};HO.prototype.isDestroyed=function(){return!1};HO.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var vG=HO;var ZOe={};function QRt(e,t,n){let i,r,o;if(e instanceof Zi){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof Au)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var eOt=new h,KOe=new h;function QOe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-o)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(r){return P.lerp(e,t,r)}}function hoe(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,eOt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),KOe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),KOe));o=Math.min(QRt(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return P.lerp(n,i,a)}}function GO(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var eMe=new h;function tOt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,eMe),f=c.pitch,d=GO(c.heading,i),p=GO(c.roll,o),g=hoe(c,n,u.z,n.z,s),m=QOe(f,r,g,a);function y(A){let b=A.time/t;c.setView({orientation:{heading:P.lerp(d,i,b),pitch:m(b),roll:P.lerp(p,o,b)}}),U.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function nOt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function iOt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var rOt=new he,oOt=new he;function sOt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,rOt),m=f.pitch,y=GO(f.heading,i),A=GO(f.roll,o),b=p.cartesianToCartographic(n,oOt);g.longitude=P.zeroToTwoPi(g.longitude),b.longitude=P.zeroToTwoPi(b.longitude);let x=!1;if(l(a)){let S=P.zeroToTwoPi(a),I=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=S>=I&&S<=R;if(l(c)){let L=Math.abs(g.longitude-b.longitude),_=P.TWO_PI-L;(O?L:_)<(O?_:L)*c&&!O&&(x=!0)}else O||(x=!0)}x?nOt(g,b):iOt(g,b);let T=hoe(f,n,g.height,b.height,s),E=QOe(m,r,T,u);function v(){let S=g.longitude,I=b.longitude,R=g.latitude,O=b.latitude;return function(_){let C=_.time/t,w=h.fromRadians(P.lerp(S,I,C),P.lerp(R,O,C),T(C),p);f.setView({destination:w,orientation:{heading:P.lerp(y,i,C),pitch:E(C),roll:P.lerp(A,o,C)}})}}return v()}function aOt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,eMe),u=GO(a.heading,i),f=a.frustum.right-a.frustum.left,d=hoe(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let y=d(m),A=a.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var $Oe=new he,cOt=new h;function doe(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function JOe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}ZOe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return doe();let r=t.convert??!0,o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(s.cartesianToCartographic(n,$Oe),n=o.project($Oe,cOt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-P.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=JOe(x,t.complete),E=JOe(x,t.cancel),v=p.frustum,S=e.mode===re.SCENE2D;if(S=S&&U.equalsEpsilon(p.position,n,P.EPSILON6),S=S&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),S=S||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,P.EPSILON10),S=S&&P.equalsEpsilon(P.negativePiToPi(y),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(A),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.roll),P.EPSILON10),S)return doe(T,E);let I=new Array(4);if(I[re.SCENE2D]=aOt,I[re.SCENE3D]=sOt,I[re.COLUMBUS_VIEW]=tOt,m<=0)return doe(function(){I[i](e,1,n,y,A,b,a,c,u,f)({time:1}),typeof T=="function"&&T()},E);let R=I[i](e,m,n,y,A,b,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===re.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=Ds.CUBIC_OUT:d=Ds.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var SG=ZOe;var tMe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(tMe);var qu=tMe;function an(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Zi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.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 M,this._invViewMatrix=new M,dMe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,CMe(this,an.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*an.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}an.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);an.TRANSFORM_2D_INVERSE=M.inverseTransformation(an.TRANSFORM_2D,new M);an.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);an.DEFAULT_VIEW_FACTOR=.5;an.DEFAULT_OFFSET=new Oh(0,-P.PI_OVER_FOUR,0);function dMe(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function lOt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xn()):e.timeSinceMoved=Math.max(xn()-e._lastMovedTimestamp,0)/1e3}}an.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};an.prototype._updateCameraChanged=function(){let e=this;if(lOt(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)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let s=Math.abs(e._changedRoll-o)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=o),(a>t||r>t)&&e._changed.raiseEvent(Math.max(a,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,E=p.y+m.bottom,v=p.y+m.top,S=g.y+y.bottom,I=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),L=Math.max(E,S),_=Math.min(v,I),C;if(R>=O||L>=v)C=1;else{let w=y;A<x&&b>T&&E<S&&v>I&&(w=m),C=1-(O-R)*(_-L)/((w.right-w.left)*(w.top-w.bottom))}C>t&&(e._changed.raiseEvent(C),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function uOt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var fOt=new he,dOt=new h,wG=new h,hOt=new se,mOt=new se,pOt=new se,gOt=new se,_Ot=new se;function yOt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,hOt),r=n.cartesianToCartographic(i,fOt),o=t.project(r,dOt),s=mOt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,_Ot),c=se.add(M.getColumn(e._transform,0,wG),i,wG);n.cartesianToCartographic(c,r),t.project(r,o);let u=pOt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=gOt;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=se.add(M.getColumn(e._transform,1,wG),i,wG);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<P.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),M.setColumn(e._actualTransform,0,u,e._actualTransform),M.setColumn(e._actualTransform,1,f,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var moe=new h;function dl(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(an.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?uOt(e):yOt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=M.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=moe;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,moe));if(Math.abs(1-m)>P.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,moe);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=M.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&dMe(e)}function hMe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function mMe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function pMe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var DG=new M,RG=new M;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return dl(this),this._invTransform}},viewMatrix:{get:function(){return dl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return dl(this),this._invViewMatrix}},positionCartographic:{get:function(){return dl(this),this._positionCartographic}},positionWC:{get:function(){return dl(this),this._positionWC}},directionWC:{get:function(){return dl(this),this._directionWC}},upWC:{get:function(){return dl(this),this._upWC}},rightWC:{get:function(){return dl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,DG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,RG);this._setTransform(n);let i=hMe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,DG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,RG);this._setTransform(n);let i=mMe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,DG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,RG);this._setTransform(n);let i=pMe(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}}});an.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&AMe(this,this.position)};var AOt=new h,bOt=new h,xOt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,AOt),n=h.clone(this.upWC,bOt),i=h.clone(this.directionWC,xOt);M.clone(e,this._transform),this._transformChanged=!0,dl(this);let r=this._actualInvTransform;M.multiplyByPoint(r,t,this.position),M.multiplyByPointAsVector(r,i,this.direction),M.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),dl(this)};var TOt=new U,EOt=new gn,COt=new h,vOt=new h;function gMe(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=TOt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,EOt);r=n.pickWorldCoordinates(a,t,!0,COt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,vOt));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}an.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof _n&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=gMe(this)))};var OG=new h,Aoe=new M,SOt=new M,boe=new Le,xoe=new $,_Me=new he;function wOt(e,t,n){let i=M.clone(e.transform,Aoe),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,SOt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,boe),s=$.fromQuaternion(o,xoe);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function IOt(e,t,n,i){let r=M.clone(e.transform,Aoe);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,_Me);t=a.project(c,OG)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,boe),s=$.fromQuaternion(o,xoe);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function POt(e,t,n,i){let r=M.clone(e.transform,Aoe);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,_Me);t=c.project(u,OG)}U.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===qu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,boe),s=$.fromQuaternion(o,xoe);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var DOt=new h,ROt=new h,OOt=new h;function yMe(e,t,n,i){let r=h.clone(n.direction,DOt),o=h.clone(n.up,ROt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,DG),u=M.inverseTransformation(c,RG);M.multiplyByPointAsVector(u,r,r),M.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,OOt);return i.heading=hMe(r,o),i.pitch=mMe(r),i.roll=pMe(r,o,s),i}var yoe={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},Qw=new kc;an.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,OG);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,OG),i=!1),l(t.direction)&&(t=yMe(this,r,t,yoe.orientation)),Qw.heading=t.heading??0,Qw.pitch=t.pitch??-P.PI_OVER_TWO,Qw.roll=t.roll??0,n===re.SCENE3D?wOt(this,r,Qw):n===re.SCENE2D?POt(this,r,Qw,i):IOt(this,r,Qw,i)};var MOt=new h;an.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:an.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(an.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*an.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,MOt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),dl(this),M.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),dl(this),M.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function AMe(e,t){let n=e._scene.mapMode2D===qu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var nMe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,nMe),h.add(n,nMe,n),this._mode===re.SCENE2D&&AMe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?MG(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?MG(this,-e):this.move(this.direction,-e)};an.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};an.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};an.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};an.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};an.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};an.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};an.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};an.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var NOt=new Le,LOt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,NOt),r=$.fromQuaternion(i,LOt),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};an.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};an.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var FOt=new Le,BOt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,FOt),r=$.fromQuaternion(i,BOt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};an.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,bMe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,bMe(this,-e)};var kOt=new h,UOt=new h,zOt=new h,iMe=new h;function bMe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,kOt),r=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,iMe),P.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,UOt),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,iMe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,zOt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}an.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,xMe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,xMe(this,e)};function xMe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function MG(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 r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===qu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===qu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function TMe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?MG(this,e):TMe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?MG(this,-e):TMe(this,-e)};an.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var VOt=new M;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,VOt);this.lookAtTransform(r,t)};var jOt=new h,HOt=new Le,GOt=new Le,WOt=new $;function EMe(e,t,n,i){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let r=Le.fromAxisAngle(h.UNIT_Y,-t,HOt),o=Le.fromAxisAngle(h.UNIT_Z,-e,GOt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,WOt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}an.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=EMe(t.heading,t.pitch,t.range,jOt):n=t,this._mode===re.SCENE2D){U.clone(U.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<P.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(M.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<P.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var qOt=new M,rMe=new h,YOt=new h,oMe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=M.clone(this._transform,qOt);this._setTransform(M.IDENTITY);let i=h.subtract(e,this.positionWC,rMe);h.magnitudeSquared(i)<P.EPSILON8&&(i=h.clone(this.directionWC,rMe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,YOt),o=h.cross(i,r,oMe);h.magnitudeSquared(o)<P.EPSILON8&&(o=h.clone(this.rightWC,oMe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var WO=new he,XOt=new he,KOt=new h,$Ot=new h,JOt=new h,ZOt=new h,QOt=new h,eMt=new h,tMt=new h,poe=new h,nMt={direction:new h,right:new h,up:new h},sMe;function fl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function CMe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:nMt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let O=WO;O.longitude=f,O.latitude=s,O.height=0;let L=XOt;L.longitude=f,L.latitude=a,L.height=0;let _=sMe;(!l(_)||_.ellipsoid!==r)&&(sMe=_=new ty(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,WO).latitude}let p=WO;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,tMt),m=WO;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,KOt);m.longitude=c;let A=r.cartographicToCartesian(m,JOt);m.longitude=f;let b=r.cartographicToCartesian(m,QOt);m.latitude=a;let x=r.cartographicToCartesian(m,eMt);m.longitude=u;let T=r.cartographicToCartesian(m,ZOt);m.longitude=c;let E=r.cartographicToCartesian(m,$Ot);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(E,g,E),h.subtract(b,g,b),h.subtract(x,g,x);let v=r.geodeticSurfaceNormal(g,o.direction);h.negate(v,v);let S=h.cross(v,h.UNIT_Z,o.right);h.normalize(S,S);let I=h.cross(S,v,o.up),R;if(e.frustum instanceof _n){let O=Math.max(h.distance(y,A),h.distance(T,E)),L=Math.max(h.distance(y,T),h.distance(A,E)),_,C,w=e.frustum._offCenterFrustum,D=w.right/w.top,N=L*D;O>N?(_=O,C=_/D):(C=L,_=N),R=Math.max(_,C)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(R=Math.max(fl(v,I,A,O),fl(v,I,T,O),fl(v,I,y,O),fl(v,I,E,O),fl(v,I,b,O),fl(v,I,x,O),fl(v,S,A,L),fl(v,S,T,L),fl(v,S,y,L),fl(v,S,E,L),fl(v,S,b,L),fl(v,S,x,L)),a<0&&s>0){let _=WO;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,poe);h.subtract(C,g,C),R=Math.max(R,fl(v,I,C,O),fl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,poe),h.subtract(C,g,C),R=Math.max(R,fl(v,I,C,O),fl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,poe),n)}var iMt=new he,rMt=new h,oMt=new h;function sMt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=iMt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,rMt);M.multiplyByPoint(r,a,a),M.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,oMt);if(M.multiplyByPoint(r,c,c),M.multiplyByPoint(o,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 u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var aMt=new he,cMt=new h,lMt=new h;function uMt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===qu.INFINITE_SCROLL?r+=P.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=aMt;o.longitude=r,o.latitude=t.north;let s=i.project(o,cMt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,lMt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}an.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return CMe(this,e,t);if(n===re.COLUMBUS_VIEW)return sMt(this,e,t);if(n===re.SCENE2D)return uMt(this,e,t)};var fMt=new gn;function dMt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,fMt),o=bi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return gn.getPoint(r,s,i)}var hMt=new gn;function mMt(e,t,n,i){let o=e.getPickRay(t,hMt).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var pMt=new gn;function gMt(e,t,n,i){let r=e.getPickRay(t,pMt),o=-r.origin.x/r.direction.x;gn.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}an.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ee.default,this._mode===re.SCENE3D)n=dMt(this,e,t,n);else if(this._mode===re.SCENE2D)n=mMt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=gMt(this,e,this._projection,n);else return;return n}};var _Mt=new h,yMt=new h,AMt=new h;function bMt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,_Mt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,yMt),m=h.multiplyByScalar(e.upWC,f*c*s,AMt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var IG=new h;function xMt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,IG),h.add(IG,f,f),h.multiplyByScalar(e.upWC,u,IG),h.add(IG,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===qu.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=P.mod(f.y+d,2*d)-d}return n}an.prototype.getPickRay=function(e,t){l(t)||(t=new gn);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)?bMt(this,e,t):xMt(this,e,t)};var TMt=new h,EMt=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,TMt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),EMt);return Math.max(0,h.magnitude(n)-e.radius)};var CMt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,CMt);return Math.max(r.x,r.y)};function vMt(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Ds.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var SMt=new h,aMe=new h,wMt=new h,IMt=new h;function PMt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,SMt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,aMe),aMe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,wMt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,IMt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(A||b)return vMt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return PMt(this,e)};var DMt=new h,Va={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};an.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};an.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=Va.destination,e.orientation.heading=Va.heading,e.orientation.pitch=Va.pitch,e.orientation.roll=Va.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};an.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,DMt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=yMe(this,t,r,yoe.orientation)),l(e.duration)&&e.duration<=0){let f=yoe;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Va.destination=t,Va.heading=r.heading,Va.pitch=r.pitch,Va.roll=r.roll,Va.duration=e.duration,Va.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Va.cancel=e.cancel,Va.endTransform=e.endTransform,Va.convert=i?!1:e.convert,Va.maximumHeight=e.maximumHeight,Va.pitchAdjustHeight=e.pitchAdjustHeight,Va.flyOverLongitude=e.flyOverLongitude,Va.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Va.easingFunction=e.easingFunction;let a=this._scene,c=SG.createTween(a,Va);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=an.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function RMt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function OMt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var MMt=100;function vMe(e,t,n){n=Oh.clone(l(n)?n:an.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=MMt:e.frustum instanceof _n||e._mode===re.SCENE2D?n.range=OMt(e,s):n.range=RMt(e,s),n.range=P.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=vMe(this,e,t),this.lookAt(e.center,t)};var NMt=new M,cMe=new h,LMt=new h,FMt=new h,BMt=new h,kMt=new se,UMt=new Le,zMt=new $;an.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=vMe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,cMe):r=EMe(i.heading,i.pitch,i.range,cMe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,NMt);M.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,LMt),h.normalize(c,c),u=M.multiplyByPointAsVector(a,h.UNIT_Z,FMt),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,UMt),p=$.fromQuaternion(d,zMt);h.fromCartesian4(M.getColumn(a,1,kMt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,BMt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,up:u},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 lMe=new h,uMe=new h,goe=new h,fMe=new h,qO=[new h,new h,new h,new h];function VMt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,lMe),o=h.magnitude(r),s=h.normalize(r,uMe),a,c;h.equalsEpsilon(s,h.UNIT_Z,P.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,goe),goe),c=h.normalize(h.cross(s,a,fMe),fMe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,lMe),d=u/o,p=h.multiplyByScalar(a,d,uMe),g=h.multiplyByScalar(c,d,goe),m=h.add(f,g,qO[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,qO[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,qO[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,qO[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),qO}var _oe=new U,jMt=new h,qA=[new he,new he,new he,new he];function PG(e,t,n,i,r,o){_oe.x=e,_oe.y=t;let s=i.pickEllipsoid(_oe,r,jMt);return l(s)?(qA[n]=r.cartesianToCartographic(s,qA[n]),1):(qA[n]=r.cartesianToCartographic(o[n],qA[n]),0)}an.prototype.computeViewRectangle=function(e,t){e=e??ee.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=VMt(this,e);if(c+=PG(0,0,0,this,e,u),c+=PG(0,a,1,this,e,u),c+=PG(s,a,2,this,e,u),c+=PG(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(qA,t);let f=0,d=qA[3].longitude;for(let p=0;p<4;++p){let g=qA[p].longitude,m=Math.abs(g-d);m>P.PI?f+=P.TWO_PI-m:f+=m,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,qA[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};an.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof Zi)return;let e=this._scene;this.frustum=new Zi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};an.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof _n)return;let e=gMe(this),t=this._scene;this.frustum=new _n,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};an.clone=function(e,t){return l(t)||(t=new an(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Nr=an;function HMt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Tm=HMt;var Toe=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},NG=Toe;var RMe=js(Qu(),1),SMe=576,GMt=100,YO="#ffffff",XO="#48b";function OMe(e,t){this.credit=e,this.count=t??1}function WMt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function qMt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var MMe="cesium-credit-delimiter";function wMe(e){let t=document.createElement("span");return t.textContent=e,t.className=MMe,t}function IMe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function PMe(e,t,n,i){let r=e.childNodes,o=-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(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(wMe(n));else{let f=r[u];f.className!==MMe&&e.replaceChild(wMe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(IMe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(IMe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function YMt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<SMe?(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>=SMe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function DMe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function XMt(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); } -#endif -#ifdef TRANSLUCENT -if (inTranslucencyRectangle()) -{ -vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; -finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); + +.cesium-credit-lightbox { + background-color: #303336; + color: ${YO}; + position: relative; + min-height: ${GMt}px; + margin: auto; } -#endif -out_FragColor = finalColor; +.cesium-credit-lightbox > ul > li a, +.cesium-credit-lightbox > ul > li a:visited, +.cesium-credit-wrapper a, +.cesium-credit-wrapper a:visited { + color: ${YO}; } -#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); +.cesium-credit-lightbox > ul > li a:hover { + color: ${XO}; } -float linearFade(float edge0, float edge1, float x) -{ -return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +.cesium-credit-lightbox.cesium-credit-lightbox-expanded { + border: 1px solid #444; + border-radius: 5px; + max-width: 470px; } -const float oceanFrequencyLowAltitude = 825000.0; -const float oceanAnimationSpeedLowAltitude = 0.004; -const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; -const float oceanSpecularIntensity = 0.5; -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); -vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); -float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); -#ifdef SHOW_OCEAN_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); -time = czm_frameNumber * oceanAnimationSpeedLowAltitude; -noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); -vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); -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); -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); -float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; -vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); -#ifdef SHOW_OCEAN_WAVES -float tsPerturbationRatio = normalTangentSpace.z; -vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); -#else -vec3 nonDiffuseHighlight = vec3(0.0); -#endif -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); +.cesium-credit-lightbox.cesium-credit-lightbox-mobile { + height: 100%; + width: 100%; } -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var yV=`#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; -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 -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); +.cesium-credit-lightbox-title { + padding: 20px 20px 0 20px; } -float get2DMercatorYPositionFraction(vec2 textureCoordinates) -{ -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); +.cesium-credit-lightbox-close { + font-size: 18pt; + cursor: pointer; + position: absolute; + top: 0; + right: 6px; + color: ${YO}; } -return positionFraction; +.cesium-credit-lightbox-close:hover { + color: ${XO}; } -float get2DGeographicYPositionFraction(vec2 textureCoordinates) -{ -return textureCoordinates.y; +.cesium-credit-lightbox > ul { + margin: 0; + padding: 12px 20px 12px 40px; + font-size: 13px; } -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; +.cesium-credit-lightbox > ul > li { + padding-bottom: 6px; } -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) -{ -return getPositionPlanarEarth(position, 0.0, textureCoordinates); +.cesium-credit-lightbox > ul > li * { + padding: 0; + margin: 0; } -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) -{ -return getPositionPlanarEarth(position, height, textureCoordinates); + +.cesium-credit-expand-link { + padding-left: 5px; + cursor: pointer; + text-decoration: underline; + color: ${YO}; } -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) -{ -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; +.cesium-credit-expand-link:hover { + color: ${XO}; } -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; -#endif + +.cesium-credit-expand-link:focus-visible, +.cesium-credit-lightbox-close:focus-visible { + outline: 2px solid ${XO}; + outline-offset: 2px; +} + +.cesium-credit-text { + color: ${YO}; +} + +.cesium-credit-delimiter { + padding: 0 5px; +} + +.cesium-credit-textContainer *, +.cesium-credit-logoContainer * { + display: inline; +} + +.cesium-credit-textContainer a:hover { + color: ${XO} +} + +.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { + padding-left: 5px; +} +`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Vo(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label","Data attribution"),r.appendChild(o);function s(y){o.contains(y.target)||i.hideLightbox()}r.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}r.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",o.appendChild(c);let u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.onkeydown=DMe(this.hideLightbox.bind(this)),u.innerHTML="×",u.className="cesium-credit-lightbox-close",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Close data attribution"),o.appendChild(u);let f=document.createElement("ul");o.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.onkeydown=DMe(this.showLightbox.bind(this)),g.textContent="Data attribution",g.setAttribute("role","button"),g.setAttribute("tabindex","0"),g.setAttribute("aria-haspopup","dialog"),g.setAttribute("aria-expanded","false"),e.appendChild(g),XMt(e);let m=It.clone(Vo.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=f,this._lightbox=r,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=g,this._closeButton=u,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new zt,lightboxCredits:new zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function NMe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new OMe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Vo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(LMe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,NMe(this,t,e)};Vo.prototype.addStaticCredit=function(e){let t=this._staticCredits;WMt(t,e)||t.push(e)};Vo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Vo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Vo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Vo.prototype.update=function(){this._expanded&&YMt(this)};Vo.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 r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o.isIon()&&It.equals(Vo.cesiumCredit,this._cesiumCredit)||NMe(this,s,o,Number.MAX_VALUE)}It.equals(Vo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(Vo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Vo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;PMe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",PMe(this._creditList,t,void 0,"li"),qMt(this)};Vo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Vo.prototype.isDestroyed=function(){return!1};Vo._cesiumCredit=void 0;Vo._cesiumCreditInitialized=!1;var LG;function LMe(){if(!l(LG)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new RMe.default(e).path()),LG=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Vo._cesiumCreditInitialized||(Vo._cesiumCredit=LG,Vo._cesiumCreditInitialized=!0),LG}Object.defineProperties(Vo,{cesiumCredit:{get:function(){return LMe(),Vo._cesiumCredit},set:function(e){Vo._cesiumCredit=e,Vo._cesiumCreditInitialized=!0}}});Vo.CreditDisplayElement=OMe;var FG=Vo;function BG(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var KMt=new h,$Mt=new $,JMt=new Le,ZMt=new Zi,QMt=new Au,eNt=new _n,tNt=new Ss,nNt=new z,iNt=[1,1e5];BG.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++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 o=this._camera,s=o.frustum,a;s instanceof Zi?a=ZMt:s instanceof Au?a=QMt:s instanceof _n?a=eNt:a=tNt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=iNt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,KMt);let m=$Mt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,JMt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Nn({geometryInstances:new Bt({geometry:new FC({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,nNt))},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Nn({geometryInstances:new Bt({geometry:new Uk({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};BG.prototype.isDestroyed=function(){return!1};BG.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 ue(this)};var r_=BG;var kG=`in vec4 positionEC; 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 -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; -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; -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; +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); +vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); +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); } -#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 +else +{ +discard; } -`;var kP=`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 -); +czm_writeLogDepth(); } -`;var bV=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; +`;var UG=`in vec4 position; +out vec4 positionEC; void main() { -out_FragColor = texture(u_texture, v_textureCoordinates); +positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); } -`;var xV=`in vec4 position; -in float webMercatorT; -uniform vec2 u_textureDimensions; -out vec2 v_textureCoordinates; -void main() +`;function $O(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=e??0}var KO=dn.supportsTypedArrays()?new Float32Array(12):[],FMe=new h,BMe=new h,Eoe=new h,kMe=new h,zG=new h;function rNt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof _n)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,FMe),g=h.normalize(p,BMe),m=h.normalize(h.cross(h.UNIT_Z,p,Eoe),Eoe),y=h.normalize(h.cross(g,m,kMe),kMe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,FMe);let x=b/A;o=h.multiplyByScalar(m,x,BMe),s=h.multiplyByScalar(y,x,Eoe)}let a=h.add(r,s,zG);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,KO,0);let c=h.subtract(r,s,zG);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,KO,3);let u=h.add(r,s,zG);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,KO,6);let f=h.subtract(r,s,zG);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,KO,9),KO}$O.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new at({renderState:this._rs,boundingVolume:new le(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Xe({sources:[UG]}),a=new Xe({sources:[kG]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=rNt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new wt({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Oe.TRIANGLES});this._va=Vn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};$O.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};$O.prototype.isDestroyed=function(){return!1};$O.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var VG=$O;function NT(){}var oNt=/\bgl_FragDepth\b/,sNt=/\bdiscard\b/;function aNt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let a=0;a<o.length;++a)if(oNt.test(o[a])||sNt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() { -v_textureCoordinates = vec2(position.x, webMercatorT); -gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); + out_FragColor = vec4(1.0); } -`;var UP=`float interpolateByDistance(vec4 nearFarScalar, float distance) +`;i=new Xe({sources:[a]})}else if(!r&&s){let a=`void main() { -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); + out_FragColor = vec4(1.0); + czm_writeLogDepth(); } -void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) +`;i=new Xe({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function cNt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=Ge.fromCache(r);return n[t.id]=o,o}NT.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=at.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=aNt(n,t.shaderProgram),i.depthOnlyCommand.renderState=cNt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var lNt=/\s+czm_writeLogDepth\(/,uNt=/\s+czm_vertexLogDepth\(/;function fNt(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 r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=o.sources;for(let f=0;f<c.length;++f)if(uNt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Xe.replaceMain(c[d],"czm_log_depth_main");c.push(` + +void main() { -float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; -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); -float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; -float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; -vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; -vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); -underTranslucentGlobe = 0.0; -#if defined(GLOBE_TRANSLUCENT) -czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); -if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { -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); -float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); -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); -underTranslucentGlobe = 1.0; -return; + czm_log_depth_main(); + czm_vertexLogDepth(); } -#endif -computeScattering( -primaryRay, -length(cameraToPositionWC), -lightDirection, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); -float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; -float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; -opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); -float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; -opacity *= pow(nightAlpha, 0.5); +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)lNt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Xe.replaceMain(c[f],"czm_log_depth_main");u=` +void main() +{ + czm_log_depth_main(); + czm_writeLogDepth(); } -`;var TV=`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) +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}NT.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=fNt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function dNt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { -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 -if (translucent == 0.0) { -color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); -} -out_FragColor = color; -} -`;var AV=`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) + czm_non_pick_main(); + if (${c}.a == 0.0) { + discard; + } + ${c} = ${n}; +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Xe.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Xe({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function Coe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=Ge.fromCache(r);return n[t.id]=o,o}NT.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=at.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=dNt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Coe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var hNt=`uint rgba8UnormToUint32(vec4 c) { -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; + uvec4 b = uvec4(c * 255.0 + 0.5); + return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -`;var CV=`uniform samplerCube u_cubeMap; -in vec3 v_texCoord; -void main() +`;function mNt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${hNt} +void main () { -vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); -out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); -} -`;var EV=`in vec3 position; -out vec3 v_texCoord; + czm_non_snap_main(); + if (${c}.a == 0.0) { + discard; + } + ${c} = ${n}; +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Xe.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Xe({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}NT.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=at.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=mNt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Coe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function eI(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function pNt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function UMe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function zMe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function gNt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=UMe(n,i,r)}return e.normalized||(n=zMe(n,e.componentType)),n}function _Nt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=UMe(r,o,s)}return e.normalized||(r=zMe(r,e.componentType)),r}function yNt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,s=`pickMetadata-${i}-${r}-${o}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=pNt(u);if(p===1)d[0]=gNt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=_Nt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Id.METADATA_PICKING_ENABLED),eI(g,Id.METADATA_PICKING_VALUE_TYPE,f),eI(g,Id.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),eI(g,Id.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),eI(g,Id.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),eI(g,Id.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),eI(g,Id.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Xe({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}NT.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=yNt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Coe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function ANt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}NT.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=ANt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var d0=NT;function jG(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 r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(r),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var bNt=new Le,VMe=new Le,xNt=new $;function TNt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,VMe),c=Le.fromAxisAngle(o,i,bNt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,VMe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,xNt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}jG.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;TNt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};jG.prototype.isDestroyed=function(){return!1};jG.prototype.destroy=function(){return this._removeListener(),ue(this)};var HG=jG;function voe(){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(voe.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var ENt=new h;voe.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!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,ENt),a=Math.abs(h.dot(n.directionWC,s));o*=1-a,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var GG=voe;var fc={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},LT=fc.DERIVED_COMMANDS_MAXIMUM_LENGTH,JMe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function FT(){this._frontFaceAlphaByDistance=new qt(0,1,0,1),this._backFaceAlphaByDistance=new qt(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=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(LT),this._derivedBlendCommandTypes=new Array(LT),this._derivedPickCommandTypes=new Array(LT),this._derivedCommandTypesToUpdate=new Array(LT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(FT.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}}});FT.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=jMe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=jMe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=HMe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=HMe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=wNt(this,e,t),this._sunVisibleThroughGlobe=CNt(this,e),this._environmentVisible=vNt(this,e),this._useDepthPlane=SNt(this,e),this._numberOfTextureUniforms=INt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),PNt(this,e)};function jMe(e,t,n,i){return e?l(n)?(qt.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 HMe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function CNt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function vNt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function SNt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function wNt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function INt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function PNt(e,t){e._derivedCommandsLength=Soe(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Soe(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Soe(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 r=0;for(n=0;n<LT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=GNt())}function Soe(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?fc.PICK_FRONT_FACE:u?fc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:fc.TRANSLUCENT_FRONT_FACE,d=i?fc.PICK_BACK_FACE:u?fc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:fc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=fc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=fc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=fc.DEPTH_ONLY_BACK_FACE),r[o++]=fc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=fc.DEPTH_ONLY_FRONT_FACE),r[o++]=fc.OPAQUE_BACK_FACE,r[o++]=f),o)}function Zd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function GMe(e,t){return e.indexOf(t)>-1}function DNt(e,t){Zd(e.defines,"TRANSLUCENT"),Zd(t.defines,"TRANSLUCENT")}function RNt(e,t){Zd(e.defines,"GROUND_ATMOSPHERE"),Zd(t.defines,"GROUND_ATMOSPHERE"),Zd(e.defines,"FOG"),Zd(t.defines,"FOG"),Zd(e.defines,"TRANSLUCENT"),Zd(t.defines,"TRANSLUCENT")}function woe(e,t){if(GMe(t.defines,"TILE_LIMIT_RECTANGLE")||GMe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function Ioe(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Xe.replaceMain(n[o],"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 ZMe(e,t){Ioe(e,t),Zd(e.defines,"GROUND_ATMOSPHERE"),Zd(t.defines,"GROUND_ATMOSPHERE"),Zd(e.defines,"FOG"),Zd(t.defines,"FOG")}function ONt(e,t){Ioe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function MNt(e,t){ZMe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function WMe(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 NNt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function LNt(e){e.cull.face=Gi.BACK,e.cull.enabled=!0}function FNt(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0}function BNt(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function kNt(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function UNt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function qMe(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=rn.ALPHA_BLEND}function YMe(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=rn.ALPHA_BLEND}function zNt(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function VNt(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function jNt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ge.getState(e);i(s),o=Ge.fromCache(s),r[e.id]=o}return o}function tI(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function HNt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Mt(t,r(e),!1):t}function Em(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function GNt(){return[new Em({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:DNt,getRenderStateFunction:LNt,getUniformMapFunction:void 0}),new Em({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:RNt,getRenderStateFunction:FNt,getUniformMapFunction:void 0}),new Em({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:woe,getRenderStateFunction:BNt,getUniformMapFunction:void 0}),new Em({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:woe,getRenderStateFunction:kNt,getUniformMapFunction:void 0}),new Em({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:woe,getRenderStateFunction:UNt,getUniformMapFunction:void 0}),new Em({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Ioe,getRenderStateFunction:qMe,getUniformMapFunction:tI}),new Em({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ZMe,getRenderStateFunction:YMe,getUniformMapFunction:tI}),new Em({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ONt,getRenderStateFunction:qMe,getUniformMapFunction:tI}),new Em({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:MNt,getRenderStateFunction:YMe,getUniformMapFunction:tI}),new Em({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:WMe,getRenderStateFunction:zNt,getUniformMapFunction:tI}),new Em({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:WMe,getRenderStateFunction:VNt,getUniformMapFunction:tI})]}var XMe=new Array(LT),KMe=new Array(LT);FT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)KMe[r]=this._derivedCommandPacks[n[r]],XMe[r]=JMe[n[r]];WNt(this,e,i,n,XMe,KMe,t)}};function WNt(e,t,n,i,r,o,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 u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],E=a[T],v,S,I;l(E)?(v=E.uniformMap,S=E.shaderProgram,I=E.renderState):(v=void 0,S=void 0,I=void 0),E=at.shallowClone(t,E),a[T]=E;let R=E.derivedCommands.uniformMapDirtyFrame??0,O=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,C=m||O<d,w=y||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=x,E.pass=b.pass,E.pickOnly=b.pickOnly,E.uniformMap=HNt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=NNt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=jNt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}FT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=JMe[r[a]];n.commandList.push(s[c])}};function QMe(e,t,n,i,r,o){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(a,i,r)}}function $Me(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var qNt=[fc.OPAQUE_FRONT_FACE,fc.OPAQUE_BACK_FACE],YNt=[fc.DEPTH_ONLY_FRONT_FACE,fc.DEPTH_ONLY_BACK_FACE,fc.DEPTH_ONLY_FRONT_AND_BACK_FACE];FT.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ie.GLOBE],a=e.indices[Ie.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),QMe(s,a,t,i,r,qNt))};FT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:s}=o,a=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&$Me(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,QMe(a,c,t,i,r,YNt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}$Me(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var WG=FT;var Uf=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; void main() { -vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); -gl_Position = czm_projection * vec4(p, 1.0); -v_texCoord = position.xyz; +out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;var SV=`uniform sampler2D u_texture; +`;function h0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new ci({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new ci({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 fi({color:new z(0,0,0,0),owner:this}),this._clearCommand=new fi({color:new z(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(h0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});h0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var XNt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:rn.ALPHA_BLEND},KNt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:rn.ALPHA_BLEND},$Nt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK,blending:rn.ALPHA_BLEND},JNt=`uniform sampler2D colorTexture; +uniform sampler2D depthTexture; +uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; void main() { -vec4 color = texture(u_texture, v_textureCoordinates); -out_FragColor = czm_gammaCorrect(color); + 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; } -`;var wV=`uniform float u_radiusTS; +`,ZNt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; -vec2 rotate(vec2 p, vec2 direction) +void main() { -return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); + vec4 color = texture(colorTexture, v_textureCoordinates); + if (color.a == 0.0) + { + discard; + } +#ifdef UNCLASSIFIED + out_FragColor = color * czm_invertClassificationColor; +#else + out_FragColor = color; +#endif } -vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) +`;h0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Dt({context:e,width:s,height:a,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new rd({context:e,width:s,height:a,format:uu.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ge.fromCache(XNt),this._rsClassified=Ge.fromCache(KNt),this._rsDefault=Ge.fromCache($Nt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?ZNt:JNt,f=new Xe({defines:["UNCLASSIFIED"],sources:[u]}),d=new Xe({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{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(Uf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};h0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};h0.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))};h0.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)};h0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};h0.prototype.isDestroyed=function(){return!1};h0.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()),ue(this)};var JO=h0;function qG(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(qG.prototype,{total:{get:function(){return this._total}}});function YA(e){let t=new Array(Gc.NUMBER_OF_JOB_TYPES);t[Gc.TEXTURE]=new qG(l(e)?e[Gc.TEXTURE]:10),t[Gc.PROGRAM]=new qG(l(e)?e[Gc.PROGRAM]:10),t[Gc.BUFFER]=new qG(l(e)?e[Gc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}YA.getTimestamp=xn;Object.defineProperties(YA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});YA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};YA.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};YA.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=YA.getTimestamp();e.execute();let a=YA.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var YG=YA;function XG(e){e=e??H.EMPTY_OBJECT;let t=kn(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 r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xn(),this._lastMsSampleTime=xn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(XG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});XG.prototype.update=function(e){let t=xn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};XG.prototype.destroy=function(){return ue(this)};var XA=XG;var dc={};dc.decodeRawMetadataValue=function(e,t,n){switch(e){case Lt.INT8:return t.getInt8(n);case Lt.UINT8:return t.getUint8(n);case Lt.INT16:return t.getInt16(n,!0);case Lt.UINT16:return t.getUint16(n,!0);case Lt.INT32:return t.getInt32(n,!0);case Lt.UINT32:return t.getUint32(n,!0);case Lt.INT64:return t.getBigInt64(n,!0);case Lt.UINT64:return t.getBigUint64(n,!0);case Lt.FLOAT32:return t.getFloat32(n,!0);case Lt.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};dc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=dc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};dc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Lt.getSizeInBytes(i),o=e.type,s=bt.getComponentCount(o),a=r*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*r,g=dc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return dc.decodeRawMetadataValueComponent(e,t,c)};dc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let s=0;s<r;s++){let a=dc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return dc.decodeRawMetadataValueElement(e,n,0)};dc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return U.unpack(n,0,new U);case bt.VEC3:return h.unpack(n,0,new h);case bt.VEC4:return se.unpack(n,0,new se);case bt.MAT2:return $i.unpack(n,0,new $i);case bt.MAT3:return $.unpack(n,0,new $);case bt.MAT4:return M.unpack(n,0,new M)}throw new oe(`Invalid metadata object type: ${e}`)};dc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return U.pack(t,Array(2));case bt.VEC3:return h.pack(t,Array(3));case bt.VEC4:return se.pack(t,Array(4));case bt.MAT2:return $i.pack(t,Array(4));case bt.MAT3:return $.pack(t,Array(9));case bt.MAT4:return M.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};dc.decodeMetadataValues=function(e,t,n){let i=dc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=dc.convertFromObjectType(e.type,t.offset),s=dc.convertFromObjectType(e.type,t.scale);i=W0.valueTransformInPlace(i,o,s,Lt.applyValueTransform)}if(e.isArray){let o=e.arrayLength,s=Array(o);for(let a=0;a<o;a++){let c=i[a],u=dc.convertToObjectType(e.type,c);s[a]=u}return s}return dc.convertToObjectType(e.type,i)};var KG=Object.freeze(dc);function BT(){this._framebuffer=new ci,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(BT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function QNt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function eLt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; + +in vec2 v_textureCoordinates; + +void main() { -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); + 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:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}BT.prototype.update=function(e,t){QNt(this,e,t),eLt(this,e,t)};var tLt=new se,nLt=new se(1,1/255,1/65025,1/16581375);BT.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}),r=se.unpack(i,0,tLt);return se.divideByScalar(r,255,r),se.dot(r,nLt)};BT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};BT.prototype.isDestroyed=function(){return!1};BT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var $G=BT;function KA(){this._framebufferManager=new ci({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(KA.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});KA.prototype.update=function(e,t,n,i,r){let o=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,s,1,a,$e.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};KA.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};KA.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};KA.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};KA.prototype.isDestroyed=function(){return!1};KA.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var JG=KA;function kT(){this._framebufferManager=new ci({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(kT.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});kT.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ze.FLOAT:ze.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,r,1,o,$e.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};kT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};kT.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};kT.prototype.isDestroyed=function(){return!1};kT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var ZG=kT;function iLt(e,t){this.near=e??0,this.far=t??0;let n=Ie.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var QG=iLt;var UT=`uniform highp sampler2D u_depthTexture; +in vec2 v_textureCoordinates; 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); -burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); -burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); -burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); -burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); -color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; -out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); +out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;var vV=`in vec2 direction; -uniform float u_size; -out vec2 v_textureCoordinates; +`;function m0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),this._outputFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new ci,this._tempCopyDepthFramebuffer=new ci,this._updateDepthFramebuffer=new ci({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 et,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(m0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer: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}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function eNe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let s=!et.equals(o,r.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!et.equals(o,e._rs.viewport)||a)&&(e._rs=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:rn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ni.NEVER,reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(UT,{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(Uf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(UT,{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(Uf,{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 fi({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}m0.prototype.update=function(e,t,n,i,r,o){let{width:s,height:a}=n,c=r?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),eNe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};m0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};m0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};m0.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 r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,s,a),eNe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};m0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};m0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.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()),ue(this)};var e5=m0;function zT(){this._framebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new ci,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(zT.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 rLt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function oLt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function sLt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!et.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(UT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new fi({color:new z(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}zT.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;oLt(this,n,r,o,e),sLt(this,n,r,o,i),this._useHdr=e};zT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};zT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};zT.prototype.isDestroyed=function(){return!1};zT.prototype.destroy=function(){return rLt(this),ue(this)};var t5=zT;var ZO=`#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() { -vec4 position; -if (czm_morphTime == 1.0) -{ -position = vec4(czm_sunPositionWC, 1.0); -} -else +if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) { -position = vec4(czm_sunPositionColumbusView.zxy, 1.0); +#ifdef MRT +out_FragData_0 = u_bgColor; +out_FragData_1 = vec4(u_bgColor.a); +#else +out_FragColor = u_bgColor; +#endif +return; } -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; +discard; } -`;var DV=`in vec2 v_textureCoordinates; +`;var n5=`uniform sampler2D u_opaque; +uniform sampler2D u_accumulation; +uniform sampler2D u_revealage; +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); +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 Ort(e){let t,n=e.name,i=e.message;c(n)&&c(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return c(o)&&(t+=` -${o}`),t}var g_=Ort;async function Rrt(e,t,n,i){return c(i)||(i=!1),T.typeOf.object("terrainProvider",e),T.typeOf.number("level",t),T.typeOf.bool("rejectOnTileFail",i),T.defined("positions",n),Nrt(e,t,n,i)}function Mrt(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(q_e(i)):r=o.then(q_e(i)).catch(Frt(i)),e.shift(),t.push(r),!0}function Lrt(e){return new Promise(function(t){setTimeout(t,e)})}function kY(e,t,n){return e.length?Mrt(e,t,n)?kY(e,t,n):Lrt(100).then(()=>kY(e,t,n)):Promise.resolve()}function Nrt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!c(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=h,s.push(h)}a[f].positions.push(n[r])}let l=[];return kY(s,l,i).then(function(){return Promise.all(l).then(function(){return n})})}function W_e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function q_e(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(!W_e(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];W_e(s,i,n)}}):Promise.resolve()}}function Frt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var PV=Rrt;var UY=new z;async function Y_e(e,t,n){if(c(n)||(n=!1),!c(e))throw new C("terrainProvider is required.");if(!c(t))throw new C("positions is required.");let i=[],o=[],r=e.availability;if(!c(r))throw new C("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");let s=[];for(let l=0;l<t.length;++l){let u=t[l],f=r.computeMaximumLevelAtPosition(u);if(o[l]=f,f===0){e.tilingScheme.positionToTileXY(u,1,UY);let p=e.loadTileDataAvailability(UY.x,UY.y,1);c(p)&&s.push(p)}let h=i[f];c(h)||(i[f]=h=[]),h.push(u)}await Promise.all(s),await Promise.all(i.map(function(l,u){if(c(l))return PV(e,u,l,n)}));let a=[];for(let l=0;l<t.length;++l){let u=t[l];r.computeMaximumLevelAtPosition(u)!==o[l]&&a.push(u)}return a.length>0&&await Y_e(e,a,n),t}var vE=Y_e;async function VY(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),!c(n))return r;let a=n.availability;if(!c(a)||t.mode===oe.SCENE2D)return r;let l=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await VY._sampleTerrainMostDetailed(n,l),f=!1,h=u.reduce(function(g,m){return c(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}VY._sampleTerrainMostDetailed=vE;var DE=VY;var Brt={NONE:0,LERC:1},ih=Object.freeze(Brt);var krt={NONE:0,BITS12:1},pa=Object.freeze(krt);var px=new d,Urt=new d,Gf=new z,IV=new F,Vrt=new F,zrt=Math.pow(2,12);function fc(e,t,n,i,o,r,s,a,l,u){let f=pa.NONE,h,p;if(c(t)&&c(n)&&c(i)&&c(o)){let g=t.minimum,m=t.maximum,y=d.subtract(m,g,Urt),b=i-n;Math.max(d.maximumComponent(y),b)<zrt-1?f=pa.BITS12:f=pa.NONE,h=F.inverseTransformation(o,new F);let A=d.negate(g,px);F.multiply(F.fromTranslation(A,IV),h,h);let E=px;E.x=1/y.x,E.y=1/y.y,E.z=1/y.z,F.multiply(F.fromScale(E,IV),h,h),p=F.clone(o),F.setTranslation(p,d.ZERO,p),o=F.clone(o,new F);let S=F.fromTranslation(g,IV),v=F.fromScale(y,Vrt),P=F.multiply(S,v,IV);F.multiply(o,P,o),F.multiply(p,P,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=l??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}fc.prototype.encode=function(e,t,n,i,o,r,s,a){let l=i.x,u=i.y;if(this.quantization===pa.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,px),n.x=O.clamp(n.x,0,1),n.y=O.clamp(n.y,0,1),n.z=O.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=O.clamp((o-this.minimumHeight)/f,0,1);z.fromElements(n.x,n.y,Gf);let p=Ln.compressTextureCoordinates(Gf);z.fromElements(n.z,h,Gf);let g=Ln.compressTextureCoordinates(Gf);z.fromElements(l,u,Gf);let m=Ln.compressTextureCoordinates(Gf);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){z.fromElements(s,0,Gf);let y=Ln.compressTextureCoordinates(Gf);e[t++]=y}}else d.subtract(n,this.center,px),e[t++]=px.x,e[t++]=px.y,e[t++]=px.z,e[t++]=o,e[t++]=l,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Ln.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Hrt=new d,X_e=new d;fc.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 f=0;f<i;f++){let h=s*i+f,p=s*r+f;t[p]=e[h]}let a=this.decodePosition(t,s,Hrt),l=n.geodeticSurfaceNormal(a,X_e),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=l.x,t[u+1]=l.y,t[u+2]=l.z}};fc.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,l=r*o+s;t[l]=e[a]}};fc.prototype.decodePosition=function(e,t,n){if(c(n)||(n=new d),t*=this.stride,this.quantization===pa.BITS12){let i=Ln.decompressTextureCoordinates(e[t],Gf);n.x=i.x,n.y=i.y;let o=Ln.decompressTextureCoordinates(e[t+1],Gf);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};fc.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,X_e),a=this.decodeHeight(e,t),l=Rr.getHeight(a,i,o)-a;n.x+=s.x*l,n.y+=s.y*l,n.z+=s.z*l}return n};fc.prototype.decodeTextureCoordinates=function(e,t,n){return c(n)||(n=new z),t*=this.stride,this.quantization===pa.BITS12?Ln.decompressTextureCoordinates(e[t+2],n):z.fromElements(e[t+4],e[t+5],n)};fc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===pa.BITS12?Ln.decompressTextureCoordinates(e[t+1],Gf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};fc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===pa.BITS12?Ln.decompressTextureCoordinates(e[t+3],Gf).x:e[t+6]};fc.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 z.fromElements(o,r,n)};fc.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};fc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case pa.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 OV={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},RV={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};fc.prototype.getAttributes=function(e){let t=$.FLOAT,n=$.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,l){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:l,offsetInBytes:o,strideInBytes:i}),o+=l*n}if(this.quantization===pa.NONE){s(OV.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(OV.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(OV.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,l=this.hasWebMercatorT&&this.hasVertexNormals;s(RV.compressed0,a?4:3),l&&s(RV.compressed1,1),this.hasGeodeticSurfaceNormals&&s(RV.geodeticSurfaceNormal,3)}return r};fc.prototype.getAttributeLocations=function(){return this.quantization===pa.NONE?OV:RV};fc.clone=function(e,t){if(c(e))return c(t)||(t=new fc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.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 Zc=fc;var Nm={};Nm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var zY=new d,Grt=new F,jrt=new d,Wrt=new d;Nm.computeVertices=function(e){if(!c(e)||!c(e.heightmap))throw new C("options.heightmap is required.");if(!c(e.width)||!c(e.height))throw new C("options.width and options.height are required.");if(!c(e.nativeRectangle))throw new C("options.nativeRectangle is required.");if(!c(e.skirtHeight))throw new C("options.skirtHeight is required.");let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=O.PI_OVER_TWO,a=O.toRadians,l=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,g=e.isGeographic??!0,m=e.ellipsoid??ie.default,y=1/m.maximumRadius,b=ce.clone(e.nativeRectangle),x=ce.clone(e.rectangle),A,E,S,v;c(x)?(A=x.west,E=x.south,S=x.east,v=x.north):g?(A=a(b.west),E=a(b.south),S=a(b.east),v=a(b.north)):(A=b.west*y,E=s-2*o(r(-b.south*y)),S=b.east*y,v=s-2*o(r(-b.north*y)));let P=e.relativeToCenter,M=c(P);P=M?P:d.ZERO;let R=e.includeWebMercatorT??!1,L=e.exaggeration??1,B=e.exaggerationRelativeHeight??0,w=L!==1,D=e.structure??Nm.DEFAULT_STRUCTURE,I=D.heightScale??Nm.DEFAULT_STRUCTURE.heightScale,N=D.heightOffset??Nm.DEFAULT_STRUCTURE.heightOffset,k=D.elementsPerHeight??Nm.DEFAULT_STRUCTURE.elementsPerHeight,H=D.stride??Nm.DEFAULT_STRUCTURE.stride,V=D.elementMultiplier??Nm.DEFAULT_STRUCTURE.elementMultiplier,j=D.isBigEndian??Nm.DEFAULT_STRUCTURE.isBigEndian,U=ce.computeWidth(b),q=ce.computeHeight(b),X=U/(u-1),te=q/(f-1);g||(U*=y,q*=y);let K=m.radiiSquared,Z=K.x,ee=K.y,me=K.z,xe=65536,ue=-65536,ye=Ot.eastNorthUpToFixedFrame(P,m),Ae=F.inverseTransformation(ye,Grt),Pe,Ee;R&&(Pe=Li.geodeticLatitudeToMercatorAngle(E),Ee=1/(Li.geodeticLatitudeToMercatorAngle(v)-Pe));let Ve=jrt;Ve.x=Number.POSITIVE_INFINITY,Ve.y=Number.POSITIVE_INFINITY,Ve.z=Number.POSITIVE_INFINITY;let je=Wrt;je.x=Number.NEGATIVE_INFINITY,je.y=Number.NEGATIVE_INFINITY,je.z=Number.NEGATIVE_INFINITY;let it=Number.POSITIVE_INFINITY,Dt=u*f,Gt=h>0?u*2+f*2:0,$e=Dt+Gt,ln=new Array($e),Vt=new Array($e),Ct=new Array($e),gi=R?new Array($e):[],an=w?new Array($e):[],_e=0,Ce=f,mn=0,mt=u;p&&(--_e,++Ce,--mn,++mt);let to=1e-5;for(let Ze=_e;Ze<Ce;++Ze){let pt=Ze;pt<0&&(pt=0),pt>=f&&(pt=f-1);let Ht=b.north-te*pt;g?Ht=a(Ht):Ht=s-2*o(r(-Ht*y));let bn=(Ht-E)/(v-E);bn=O.clamp(bn,0,1);let wo=Ze===_e,yo=Ze===Ce-1;h>0&&(wo?Ht+=to*q:yo&&(Ht-=to*q));let ka=t(Ht),Ua=n(Ht),yi=me*Ua,hi;R&&(hi=(Li.geodeticLatitudeToMercatorAngle(Ht)-Pe)*Ee);for(let $s=mn;$s<mt;++$s){let Hr=$s;Hr<0&&(Hr=0),Hr>=u&&(Hr=u-1);let ol=pt*(u*H)+Hr*H,ho;if(k===1)ho=l[ol];else{ho=0;let Oo;if(j)for(Oo=0;Oo<k;++Oo)ho=ho*V+l[ol+Oo];else for(Oo=k-1;Oo>=0;--Oo)ho=ho*V+l[ol+Oo]}ho=ho*I+N,ue=Math.max(ue,ho),xe=Math.min(xe,ho);let Dr=b.west+X*Hr;g?Dr=a(Dr):Dr=Dr*y;let tp=(Dr-A)/(S-A);tp=O.clamp(tp,0,1);let Gr=pt*u+Hr;if(h>0){let Oo=$s===mn,cn=$s===mt-1,Se=wo||yo||Oo||cn;if((wo||yo)&&(Oo||cn))continue;Se&&(ho-=h,Oo?(Gr=Dt+(f-pt-1),Dr-=to*U):yo?Gr=Dt+f+(u-Hr-1):cn?(Gr=Dt+f+u+pt,Dr+=to*U):wo&&(Gr=Dt+f+u+f+Hr))}let zu=ka*t(Dr),Va=ka*n(Dr),S0=Z*zu,Zs=ee*Va,za=1/i(S0*zu+Zs*Va+yi*Ua),es=S0*za,Hu=Zs*za,Gu=yi*za,ju=new d;ju.x=es+zu*ho,ju.y=Hu+Va*ho,ju.z=Gu+Ua*ho,F.multiplyByPoint(Ae,ju,zY),d.minimumByComponent(zY,Ve,Ve),d.maximumByComponent(zY,je,je),it=Math.min(it,ho),ln[Gr]=ju,Ct[Gr]=new z(tp,bn),Vt[Gr]=ho,R&&(gi[Gr]=hi),w&&(an[Gr]=m.geodeticSurfaceNormal(ju))}}let So=le.fromPoints(ln),Ks;c(x)&&(Ks=Pn.fromRectangle(x,xe,ue,m));let vr;M&&(vr=new cy(m).computeHorizonCullingPointPossiblyUnderEllipsoid(P,ln,xe));let ps=new q0(Ve,je,P),Ne=new Zc(P,ps,it,ue,ye,!1,R,w,L,B),ot=new Float32Array($e*Ne.stride),Xe=0;for(let Ze=0;Ze<$e;++Ze)Xe=Ne.encode(ot,Xe,ln[Ze],Ct[Ze],Vt[Ze],void 0,gi[Ze],an[Ze]);return{vertices:ot,maximumHeight:ue,minimumHeight:xe,encoding:Ne,boundingSphere3D:So,orientedBoundingBox:Ks,occludeePointInScaledSpace:vr}};var VP=Nm;function Gy(){C.throwInstantiationError()}Object.defineProperties(Gy.prototype,{credits:{get:C.throwInstantiationError},waterMask:{get:C.throwInstantiationError}});Gy.prototype.interpolateHeight=C.throwInstantiationError;Gy.prototype.isChildAvailable=C.throwInstantiationError;Gy.prototype.createMesh=C.throwInstantiationError;Gy.prototype.upsample=C.throwInstantiationError;Gy.prototype.wasCreatedByUpsampling=C.throwInstantiationError;Gy.maximumAsynchronousTasks=5;var Fm=Gy;function qrt(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=f,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=y}var oh=qrt;function Qc(){C.throwInstantiationError()}Object.defineProperties(Qc.prototype,{errorEvent:{get:C.throwInstantiationError},credit:{get:C.throwInstantiationError},tilingScheme:{get:C.throwInstantiationError},hasWaterMask:{get:C.throwInstantiationError},hasVertexNormals:{get:C.throwInstantiationError},availability:{get:C.throwInstantiationError}});var K_e=[];Qc.getRegularGridIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new C("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=K_e[e];c(n)||(K_e[e]=n=[]);let i=n[t];return c(i)||(e*t<O.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),J_e(e,t,i,0)),i};var $_e=[];Qc.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new C("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=$_e[e];c(n)||($_e[e]=n=[]);let i=n[t];if(!c(i)){let o=Qc.getRegularGridIndices(e,t),r=Q_e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,l=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:l,northIndicesWestToEast:u}}return i};var Z_e=[];Qc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new C("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Z_e[e];c(n)||(Z_e[e]=n=[]);let i=n[t];if(!c(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,l=o+s,u=r+a,f=Q_e(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=Fe.createTypedArray(l,u);J_e(e,t,y,0),Qc.addSkirtIndices(h,p,g,m,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};Qc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=MV(e,a,r,s),a+=e.length,s=MV(t,a,r,s),a+=t.length,s=MV(n,a,r,s),a+=n.length,MV(i,a,r,s)};function Q_e(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 J_e(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,l=a+e,u=l+1,f=a+1;n[i++]=a,n[i++]=l,n[i++]=f,n[i++]=f,n[i++]=l,n[i++]=u,++o}++o}}function MV(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}Qc.heightmapTerrainQuality=.25;Qc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Qc.heightmapTerrainQuality/(t*n)};Qc.prototype.requestTileGeometry=C.throwInstantiationError;Qc.prototype.getLevelMaximumGeometricError=C.throwInstantiationError;Qc.prototype.getTileDataAvailable=C.throwInstantiationError;Qc.prototype.loadTileDataAvailability=C.throwInstantiationError;var us=Qc;function y_(e){if(!c(e)||!c(e.buffer))throw new C("options.buffer is required.");if(!c(e.width))throw new C("options.width is required.");if(!c(e.height))throw new C("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??ih.NONE;let t=VP.DEFAULT_STRUCTURE,n=e.structure;c(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===ih.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(y_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var ege="createVerticesFromHeightmap",Yrt=new bi(ege),Xrt=new bi(ege,Fm.maximumAsynchronousTasks);y_.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=l.cartographicToCartesian(ce.center(f)),p=this._structure,m=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?Xrt:Yrt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Oi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!c(b))return;let x=this;return Promise.resolve(b).then(function(A){let E;x._skirtHeight>0?E=us.getRegularGridAndSkirtIndicesAndEdgeIndices(A.gridWidth,A.gridHeight):E=us.getRegularGridIndicesAndEdgeIndices(A.gridWidth,A.gridHeight);let S=A.gridWidth*A.gridHeight;return x._mesh=new oh(h,new Float32Array(A.vertices),E.indices,E.indexCountWithoutSkirts,S,A.minimumHeight,A.maximumHeight,le.clone(A.boundingSphere3D),d.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,Pn.clone(A.orientedBoundingBox),Zc.clone(A.encoding),E.westIndicesSouthToNorth,E.southIndicesEastToWest,E.eastIndicesNorthToSouth,E.northIndicesWestToEast),x._buffer=void 0,x._mesh})};y_.prototype._createMeshSync=function(e){T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),h=this._structure,g=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let m=VP.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Oi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=us.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=us.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new oh(f,m.vertices,y.indices,y.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};y_.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,l=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=c(this._mesh),g=this._encoding===ih.LERC;if(!p&&g)return;let y;if(p){let b=this._mesh.vertices,x=this._mesh.encoding;y=tge(b,x,f,h,e,i,o,t,n)}else y=Krt(this._buffer,a,l,s,u,e,i,o,t,n),y=y*h+f;return y};y_.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new C("tilingScheme is required.");if(!c(t))throw new C("thisX is required.");if(!c(n))throw new C("thisY is required.");if(!c(i))throw new C("thisLevel is required.");if(!c(o))throw new C("descendantX is required.");if(!c(r))throw new C("descendantY is required.");if(!c(s))throw new C("descendantLevel is required.");if(s-i>1)throw new C("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(l))return;let u=this._width,f=this._height,h=this._structure,p=h.stride,g=new this._bufferType(u*f*p),m=l.vertices,y=l.encoding,b=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(o,r,s),A=h.heightOffset,E=h.heightScale,S=h.elementsPerHeight,v=h.elementMultiplier,P=h.isBigEndian,M=Math.pow(v,S-1);for(let R=0;R<f;++R){let L=O.lerp(x.north,x.south,R/(f-1));for(let B=0;B<u;++B){let _=O.lerp(x.west,x.east,B/(u-1)),w=tge(m,y,A,E,b,u,f,_,L);w=w<h.lowestEncodedHeight?h.lowestEncodedHeight:w,w=w>h.highestEncodedHeight?h.highestEncodedHeight:w,$rt(g,S,v,M,p,P,R*u+B,w)}}return Promise.resolve(new y_({buffer:g,width:u,height:f,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};y_.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new C("thisX is required.");if(!c(t))throw new C("thisY is required.");if(!c(n))throw new C("childX is required.");if(!c(i))throw new C("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};y_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Krt(e,t,n,i,o,r,s,a,l,u){let f=(l-r.west)*(s-1)/(r.east-r.west),h=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=h|0,y=m+1;y>=a&&(y=a-1,m=a-2);let b=f-p,x=h-m;m=a-1-m,y=a-1-y;let A=LV(e,t,n,i,o,m*s+p),E=LV(e,t,n,i,o,m*s+g),S=LV(e,t,n,i,o,y*s+p),v=LV(e,t,n,i,o,y*s+g);return nge(b,x,A,E,S,v)}function tge(e,t,n,i,o,r,s,a,l){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(l-o.south)*(s-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-h,b=f-g;g=s-1-g,m=s-1-m;let x=(t.decodeHeight(e,g*r+h)-n)/i,A=(t.decodeHeight(e,g*r+p)-n)/i,E=(t.decodeHeight(e,m*r+h)-n)/i,S=(t.decodeHeight(e,m*r+p)-n)/i;return nge(y,b,x,A,E,S)}function nge(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function LV(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 $rt(e,t,n,i,o,r,s,a){s*=o;let l;if(r)for(l=0;l<t-1;++l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;else for(l=t-1;l>0;--l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;e[s+l]=a}var dc=y_;function PE(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe}Object.defineProperties(PE.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(){}}});PE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new dc({buffer:new Uint8Array(16*16),width:16,height:16}))};PE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};PE.prototype.getTileDataAvailable=function(e,t,n){};PE.prototype.loadTileDataAvailability=function(e,t,n){};var b_=PE;var Zrt=new z;function Qrt(e,t){T.typeOf.object("clippingPlaneCollection",e),T.typeOf.object("context",t);let n=e.unionClippingRegions,i=e.length,o=xs.useFloatTexture(t),r=xs.getTextureResolution(e,t,Zrt),s=r.x,a=r.y,l=o?tst(s,a):nst(s,a);return l+=` -`,l+=n?Jrt(i):est(i),l}function Jrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +} +`;function o_(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 ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new ci({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new ci({createColorAttachments:!1}),this._opaqueClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new fi({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new fi({color:new z(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 et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function tNe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Poe(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function nNe(e){tNe(e),Poe(e)}function aLt(e,t,n,i){tNe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,width:n,height:i,flipY:!1})}function cLt(e,t){Poe(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=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,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Poe(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(nNe(e),e._translucentMultipassSupport=!1,i=!1)}return i}o_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,aLt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!cLt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Xe({sources:[n5]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Xe({defines:["MRT"],sources:[ZO]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Xe({sources:[ZO]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!et.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ge.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 lLt={enabled:!0,color:new z(0,0,0,0),equationRgb:Zc.ADD,equationAlpha:Zc.ADD,functionSourceRgb:to.ONE,functionDestinationRgb:to.ONE,functionSourceAlpha:to.ZERO,functionDestinationAlpha:to.ONE_MINUS_SOURCE_ALPHA},uLt={enabled:!0,color:new z(0,0,0,0),equationRgb:Zc.ADD,equationAlpha:Zc.ADD,functionSourceRgb:to.ONE,functionDestinationRgb:to.ONE,functionSourceAlpha:to.ONE,functionDestinationAlpha:to.ONE},fLt={enabled:!0,color:new z(0,0,0,0),equationRgb:Zc.ADD,equationAlpha:Zc.ADD,functionSourceRgb:to.ZERO,functionDestinationRgb:to.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:to.ZERO,functionDestinationAlpha:to.ONE_MINUS_SOURCE_ALPHA};function Doe(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ge.getState(i);o.depthMask=!1,o.blending=t,r=Ge.fromCache(o),n[i.id]=r}return r}function dLt(e,t,n){return Doe(t,lLt,e._translucentRenderStateCache,n)}function hLt(e,t,n){return Doe(t,uLt,e._translucentRenderStateCache,n)}function mLt(e,t,n){return Doe(t,fLt,e._alphaRenderStateCache,n)}var pLt=` 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); +`,gLt=` 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; +`,_Lt=` float ai = czm_out_FragColor.a; + out_FragColor = vec4(ai); +`;function Roe(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Xe.replaceMain(f,"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,`#define CESIUM_REDIRECTED_COLOR_OUTPUT +vec4 czm_out_FragColor; +bool czm_discard = false; +`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; +${u}`}return a.sources.push(u),a.sources.push(`void main() { - 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 est(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) + czm_translucent_main(); + if (czm_discard) { discard; } - return clipAmount; -} -`}function tst(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 nst(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 jy=Qrt;function ist(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 HY(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function ost(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 rst(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 sst(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 ast(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}HY.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,l=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,m=e.showOceanWaves,y=e.enableLighting,b=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,A=e.showGroundAtmosphere,E=e.perFragmentGroundAtmosphere,S=e.hasVertexNormals,v=e.useWebMercatorProjection,P=e.enableFog,M=e.enableClippingPlanes,R=e.clippingPlanes,L=e.enableClippingPolygons,B=e.clippingPolygons,_=e.clippedByBoundaries,w=e.hasImageryLayerCutout,D=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,k=e.hasGeodeticSurfaceNormals,H=e.hasExaggeration,V=e.showUndergroundColor,j=e.translucent,U=0,q="",te=n.renderedMesh.encoding;te.quantization===pa.BITS12&&(U=1,q="QUANTIZATION_BITS12");let Z=0,ee="";_&&(Z=1,ee="TILE_LIMIT_RECTANGLE");let me=0,xe="";w&&(me=1,xe="APPLY_IMAGERY_CUTOUT");let ue=t.mode,ye=ue|o<<2|r<<3|s<<4|a<<5|l<<6|u<<7|p<<8|g<<9|m<<10|y<<11|b<<12|x<<13|A<<14|E<<15|S<<16|v<<17|P<<18|U<<19|h<<20|M<<21|L<<22|Z<<23|me<<24|D<<25|I<<26|N<<27|k<<28|H<<29|V<<30|j<<31|f<<32,Ae=0;c(R)&&R.length>0&&(Ae=M?R.clippingPlanesState:0);let Pe=0;c(B)&&B.length>0&&(Pe=L?B.clippingPolygonsState:0);let Ee=n.surfaceShader;if(c(Ee)&&Ee.numberOfDayTextures===i&&Ee.flags===ye&&Ee.material===this.material&&Ee.clippingShaderState===Ae&&Ee.clippingPolygonShaderState===Pe)return Ee.shaderProgram;let Ve=this._shadersByTexturesFlags[i];if(c(Ve)||(Ve=this._shadersByTexturesFlags[i]=[]),Ee=Ve[ye],!c(Ee)||Ee.material!==this.material||Ee.clippingShaderState!==Ae||Ee.clippingPolygonShaderState!==Pe){let je=this.baseVertexShaderSource.clone(),it=this.baseFragmentShaderSource.clone();Ae!==0&&it.sources.unshift(jy(R,t.context)),Pe!==0&&(it.sources.unshift(rst(t.context)),je.sources.unshift(sst(t.context))),je.defines.push(q),it.defines.push(`TEXTURE_UNITS ${i}`,ee,xe),o&&it.defines.push("APPLY_BRIGHTNESS"),r&&it.defines.push("APPLY_CONTRAST"),s&&it.defines.push("APPLY_HUE"),a&&it.defines.push("APPLY_SATURATION"),l&&it.defines.push("APPLY_GAMMA"),u&&it.defines.push("APPLY_ALPHA"),f&&it.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&it.defines.push("HAS_WATER_MASK"),g&&(it.defines.push("SHOW_REFLECTIVE_OCEAN"),je.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&it.defines.push("SHOW_OCEAN_WAVES"),N&&it.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(je.defines.push("UNDERGROUND_COLOR"),it.defines.push("UNDERGROUND_COLOR")),j&&(je.defines.push("TRANSLUCENT"),it.defines.push("TRANSLUCENT")),y&&(S?(je.defines.push("ENABLE_VERTEX_LIGHTING"),it.defines.push("ENABLE_VERTEX_LIGHTING")):(je.defines.push("ENABLE_DAYNIGHT_SHADING"),it.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(je.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(je.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),A&&(je.defines.push("GROUND_ATMOSPHERE"),it.defines.push("GROUND_ATMOSPHERE"),E&&(je.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),it.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),je.defines.push("INCLUDE_WEB_MERCATOR_Y"),it.defines.push("INCLUDE_WEB_MERCATOR_Y"),P&&(je.defines.push("FOG"),it.defines.push("FOG")),h&&it.defines.push("APPLY_SPLIT"),M&&it.defines.push("ENABLE_CLIPPING_PLANES"),L&&(it.defines.push("ENABLE_CLIPPING_POLYGONS"),je.defines.push("ENABLE_CLIPPING_POLYGONS"),B.inverse&&it.defines.push("CLIPPING_INVERSE"),it.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${B.extentsCount}`),je.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${B.extentsCount}`)),D&&it.defines.push("COLOR_CORRECT"),I&&it.defines.push("HIGHLIGHT_FILL_TILE"),k&&je.defines.push("GEODETIC_SURFACE_NORMALS"),H&&je.defines.push("EXAGGERATION");let Dt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) - { - vec4 color = initialColor; -`;w&&(Dt+=` vec4 cutoutAndColorResult; - bool texelUnclipped; -`);for(let $e=0;$e<i;++$e)w?Dt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${$e}]; - texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y; - cutoutAndColorResult = sampleAndBlend( -`:Dt+=` color = sampleAndBlend( -`,Dt+=` color, - u_dayTextures[${$e}], - u_dayTextureUseWebMercatorT[${$e}] ? textureCoordinates.xz : textureCoordinates.xy, - u_dayTextureTexCoordsRectangle[${$e}], - u_dayTextureTranslationAndScale[${$e}], - ${u?`u_dayTextureAlpha[${$e}]`:"1.0"}, - ${f?`u_dayTextureNightAlpha[${$e}]`:"1.0"}, -${f?`u_dayTextureDayAlpha[${$e}]`:"1.0"}, -${o?`u_dayTextureBrightness[${$e}]`:"0.0"}, - ${r?`u_dayTextureContrast[${$e}]`:"0.0"}, - ${s?`u_dayTextureHue[${$e}]`:"0.0"}, - ${a?`u_dayTextureSaturation[${$e}]`:"0.0"}, - ${l?`u_dayTextureOneOverGamma[${$e}]`:"0.0"}, - ${h?`u_dayTextureSplit[${$e}]`:"0.0"}, - ${N?`u_colorsToAlpha[${$e}]`:"vec4(0.0)"}, - nightBlend ); -`,w&&(Dt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); -`);Dt+=` return color; - }`,it.sources.push(Dt),je.sources.push(ost(ue)),je.sources.push(ast(v));let Gt=en.fromCache({context:t.context,vertexShaderSource:je,fragmentShaderSource:it,attributeLocations:te.getAttributeLocations()});Ee=Ve[ye]=new ist(i,ye,this.material,Gt,Ae,Pe)}return n.surfaceShader=Ee,Ee.shaderProgram};HY.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!c(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],c(t)&&t.shaderProgram.destroy())}return de(this)};var NV=HY;var cst={NONE:-1,PARTIAL:0,FULL:1},Sr=Object.freeze(cst);function FV(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}FV.reportError=function(e,t,n,i,o,r,s,a){let l=e;return c(e)?(l.provider=t,l.message=i,l.x=o,l.y=r,l.level=s,l.retry=!1,l.error=a,++l.timesRetried):l=new FV(t,i,o,r,s,0,a),c(n)&&n.numberOfListeners>0?n.raiseEvent(l):c(t)&&console.log(`An error occurred in "${t.constructor.name}": ${g_(i)}`),l};FV.reportSuccess=function(e){c(e)&&(e.timesRetried=-1)};var Io=FV;var lst={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(lst);var ust={START:0,LOADING:1,DONE:2,FAILED:3},_a=Object.freeze(ust);var fst={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},uo=Object.freeze(fst);function Jo(){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 d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=uo.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(Jo.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===uo.RECEIVING||e===uo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!c(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(c(this.vertexArray))return this.mesh;if(c(this.fill))return this.fill.mesh}}});var dst=new he;function GY(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(c(t)&&t!==oe.SCENE3D){let l=n.ellipsoid.cartesianToCartographic(s,dst);s=n.project(l,r),s=d.fromElements(s.z,s.x,s.y,r)}return s}var hst=new d,mst=new d,pst=new d;Jo.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!c(r))return;let s=r.vertices,a=r.indices,l=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let h=0;h<u;h+=3){let p=a[h],g=a[h+1],m=a[h+2],y=GY(l,t,n,s,p,hst),b=GY(l,t,n,s,g,mst),x=GY(l,t,n,s,m,pst),A=Qn.rayTriangleParametric(e,y,b,x,i);c(A)&&A<f&&A>=0&&(f=A)}return f!==Number.MAX_VALUE?_n.getPoint(e,f,o):void 0};Jo.prototype.freeResources=function(){c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=uo.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()};Jo.prototype.freeVertexArray=function(){Jo._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Jo._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Jo.initialize=function(e,t,n){let i=e.data;c(i)||(i=e.data=new Jo),e.state===_a.START&&(_st(e,t,n),e.state=_a.LOADING)};Jo.processStateMachine=function(e,t,n,i,o,r,s){Jo.initialize(e,n,i);let a=e.data;if(e.state===_a.LOADING&&gst(e,t,n,i,o,r),s)return;let l=e.renderable;e.renderable=c(a.vertexArray);let u=a.terrainState===uo.READY;e.upsampledFromParent=c(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){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=_a.DONE}l&&(e.renderable=!0)};Jo.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,l=o.imagery,u,f;for(u=0,f=l.length;u<f;++u){let h=l[u];if(!c(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===ai.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),l.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=l.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||c(h.readyImagery),r=r&&c(h.loadingImagery)&&(h.loadingImagery.state===ai.FAILED||h.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function ige(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,l=Zc.clone(s);l.hasGeodeticSurfaceNormals=t,l=Zc.clone(l);let u=l.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Jo._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Jo._createVertexArrayForMesh(i.context,o)):(Jo._freeVertexArray(e.vertexArray),e.vertexArray=Jo._createVertexArrayForMesh(i.context,o)),Jo._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Jo.prototype.addGeodeticSurfaceNormals=function(e,t){ige(this,!0,e,t)};Jo.prototype.removeGeodeticSurfaceNormals=function(e){ige(this,!1,void 0,e)};Jo.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,l=o.encoding,u=l.exaggeration!==r,f=l.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!l.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&l.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(l.exaggeration=r,l.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let g=0;g<p;g++){let m=h[g];m.level=-1}}}};function _st(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!c(i)&&c(e.parent)){let o=e.parent,r=o.data;c(r)&&c(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=uo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function gst(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===uo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Jo.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===uo.FAILED&&yst(s,e,t,n,e.x,e.y,e.level),s.terrainState===uo.UNLOADED&&bst(s,n,e.x,e.y,e.level),s.terrainState===uo.RECEIVED&&Tst(s,t,n,e.x,e.y,e.level),s.terrainState===uo.TRANSFORMED&&(Ast(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=uo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Est(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);c(u)&&c(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function yst(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=_a.FAILED;return}let l=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!c(l))return;let p=l.upsample(i.tilingScheme,u,f,h,o,r,s);c(p)&&(e.terrainState=uo.RECEIVING,Promise.resolve(p).then(function(g){c(g)&&(e.terrainData=g,e.terrainState=uo.RECEIVED)}).catch(function(){e.terrainState=uo.FAILED}))}function bst(e,t,n,i,o){function r(l){if(!c(l)){e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainData=l,e.terrainState=uo.RECEIVED,e.request=void 0}function s(l){if(e.request.state===Zn.CANCELLED){e.terrainData=void 0,e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainState=uo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${l}"`;t._requestError=Io.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let l=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN});e.request=l;let u=t.requestTileGeometry(n,i,o,l);c(u)?(e.terrainState=uo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=uo.UNLOADED,e.request=void 0)}a()}var xst={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Tst(e,t,n,i,o,r){let s=n.tilingScheme,a=xst;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);c(u)&&(e.terrainState=uo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=uo.TRANSFORMED}).catch(function(){e.terrainState=uo.FAILED}))}Jo._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=bt.createVertexBuffer({context:e,typedArray:n,usage:Be.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!c(s)||s.isDestroyed()){let a=t.indices;s=bt.createIndexBuffer({context:e,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:Fe.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})};Jo._freeVertexArray=function(e){if(c(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),c(t)&&!t.isDestroyed()&&c(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Ast(e,t,n,i,o,r,s){e.vertexArray=Jo._createVertexArrayForMesh(t,e.mesh),e.terrainState=uo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Cst(e){let t=e.cache.tile_waterMaskData;if(!c(t)){let n=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Est(e,t){let n=t.terrainData.waterMask,i=Cst(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.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)}Jo.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;c(t)&&(!c(t.data)||!c(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Jo.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,l=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=l*(o.south-i.south)/s,n.z=a,n.w=l,n};var rh=Jo;function Wy(e){if(e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Li(this._ellipsoid),c(e.rectangleSouthwestInMeters)&&c(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new z(-i,-i),this._rectangleNortheastInMeters=new z(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(Wy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Wy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Wy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Wy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return c(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)};Wy.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,l=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return c(i)?(i.west=a,i.south=h,i.east=l,i.north=f,i):new ce(a,h,l,f)};Wy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new z(o.west,o.south)),a=r.unproject(new z(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};Wy.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,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,m=p/a|0;m>=o&&(m=o-1);let y=g/u|0;return y>=r&&(y=r-1),c(n)?(n.x=m,n.y=y,n):new z(m,y)};var fs=Wy;var jY,oge="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",IE={};IE.defaultAccessToken=oge;IE.defaultWorldImageryServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});IE.defaultWorldHillshadeServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});IE.defaultWorldOceanServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});IE.getDefaultTokenCredit=function(e){if(e===oge){if(!c(jY)){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>';jY=new At(t,!0)}return jY}};var jf=IE;function WY(e){if(e=e??W.EMPTY_OBJECT,!c(e.missingImageUrl))throw new C("options.missingImageUrl is required.");if(!c(e.pixelsToCheck))throw new C("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=we.createIfNeeded(e.missingImageUrl),n=this;function i(r){c(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Ah(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,l=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f<h;++f){let p=u[f],g=p.x*4+p.y*l;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)}WY.prototype.isReady=function(){return this._isReady};WY.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new C("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,n=this._missingImagePixels;if(!c(n)||c(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Ah(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],l=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=l+u;if(i[f]!==n[f])return!1}}return!0};var BV=WY;function qY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}qY.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)}c(n)&&(this.name=e[n])};qY.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];c(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 Bm=qY;function OE(){C.throwInstantiationError()}Object.defineProperties(OE.prototype,{rectangle:{get:C.throwInstantiationError},tileWidth:{get:C.throwInstantiationError},tileHeight:{get:C.throwInstantiationError},maximumLevel:{get:C.throwInstantiationError},minimumLevel:{get:C.throwInstantiationError},tilingScheme:{get:C.throwInstantiationError},tileDiscardPolicy:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},credit:{get:C.throwInstantiationError},proxy:{get:C.throwInstantiationError},hasAlphaChannel:{get:C.throwInstantiationError}});OE.prototype.getTileCredits=function(e,t,n){C.throwInstantiationError()};OE.prototype.requestImage=function(e,t,n,i){C.throwInstantiationError()};OE.prototype.pickFeatures=function(e,t,n,i,o){C.throwInstantiationError()};var Sst=/\.ktx2$/i;OE.loadImage=function(e,t){T.defined("url",t);let n=we.createIfNeeded(t);return Sst.test(n.url)?Xl(n):c(e)&&c(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Ul=OE;var wst={SATELLITE:1,OCEANS:2,HILLSHADE:3},km=Object.freeze(wst);function rge(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new At(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}rge.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&&!c(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new BV({missingImageUrl:sge(e,0,0,this.maximumLevel).url,pixelsToCheck:[new z(0,0),new z(200,20),new z(20,200),new z(80,110),new z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function vst(e,t){let n=e.tileInfo;if(!c(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 fs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({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,c(e.fullExtent)){if(c(e.fullExtent.spatialReference)&&c(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Li,o=e.fullExtent,r=i.unproject(new d(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 d(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}c(e.copyrightText)&&e.copyrightText.length>0&&(c(t.credit)?t.tileCredits=[new At(e.copyrightText)]:t.credit=new At(e.copyrightText))}function Dst(e,t){let n=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Pst(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();vst(i,t)}catch(i){Dst(e,i)}}function Um(e){e=e??W.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=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 At(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new pe}Um.fromBasemapType=async function(e,t){T.defined("style",e),t=t??W.EMPTY_OBJECT;let n,i,o;switch(e){case km.SATELLITE:{n=t.token??jf.defaultAccessToken,i=we.createIfNeeded(jf.defaultWorldImageryServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);c(r)&&(o=At.clone(r))}break;case km.OCEANS:{n=t.token??jf.defaultAccessToken,i=we.createIfNeeded(jf.defaultWorldOceanServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);c(r)&&(o=At.clone(r))}break;case km.HILLSHADE:{n=t.token??jf.defaultAccessToken,i=we.createIfNeeded(jf.defaultWorldHillshadeServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);c(r)&&(o=At.clone(r))}break;default:throw new C(`Unsupported basemap type: ${e}`)}return Um.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function sge(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),l={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Oi?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:l})}return r}Object.defineProperties(Um.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}}});Um.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&n.setQueryParameters({token:t.token});let i=new Um(t);i._resource=n;let o=new rge(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Pst(n,o),o.build(i),i};Um.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Um.prototype.requestImage=function(e,t,n,i){return Ul.loadImage(this,sge(this,e,t,n,i))};Um.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,l;if(this._tilingScheme.projection instanceof Oi)s=O.toDegrees(i),a=O.toDegrees(o),l="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,l="3857"}let u="visible";c(this._layers)&&(u+=`:${this._layers}`);let f={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:l,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!c(m))return g;for(let y=0;y<m.length;++y){let b=m[y],x=new Bm;if(x.data=b,x.name=b.value,x.properties=b.attributes,x.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let A=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(A===4326||A===4283)x.position=he.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(A===102100||A===900913||A===3857){let E=new Li;x.position=E.unproject(new d(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(x)}return g})};Um._metadataCache={};var qy=Um;var Ist={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"},zP=Object.freeze(Ist);function HP(e){}HP.prototype.isReady=function(){return!0};HP.prototype.shouldDiscardImage=function(e){return HP.EMPTY_IMAGE===e};var kV;Object.defineProperties(HP,{EMPTY_IMAGE:{get:function(){return c(kV)||(kV=new Image,kV.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),kV}}});var GP=HP;function age(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}age.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 At)break;o.credit=new At(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let l=r[s],u=l.bbox;l.bbox=new ce(O.toRadians(u[1]),O.toRadians(u[0]),O.toRadians(u[3]),O.toRadians(u[2]))}}};function Ost(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;c(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>c(r.bbox)))),t.attributionList=i}function Rst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i+=`: ${t.message}`),Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function Mst(e,t,n){let i=e.url,o=ws._metadataCache[i];c(o)||(o=e.fetchJsonp("jsonp"),ws._metadataCache[i]=o);try{let r=await o;return Ost(r,t)}catch(r){Rst(e,r,n)}}function ws(e){e=e??W.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=e.mapStyle??zP.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GP),this._proxy=e.proxy,this._credit=new At(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${ws.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new fs({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 pe}Object.defineProperties(ws.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 c(this.mapLayer)}}});ws.fromUrl=async function(e,t){t=t??W.EMPTY_OBJECT,T.defined("url",e),T.defined("options.key",t.key);let n=t.tileProtocol;c(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??zP.AERIAL,o=we.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};c(t.mapLayer)&&(r.mapLayer=t.mapLayer),c(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new ws(t);a._resource=o;let l=new age(t);return await Mst(s,l),l.build(a),a};var Lst=new ce;ws.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Lst);return Bst(this._attributionList,n,i)};ws.prototype.requestImage=function(e,t,n,i){let o=Ul.loadImage(this,Nst(this,e,t,n,i));if(c(o))return o.catch(function(r){return c(r.blob)&&r.blob.size===0?GP.EMPTY_IMAGE:Promise.reject(r)})};ws.prototype.pickFeatures=function(e,t,n,i,o){};ws.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};ws.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&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};ws._logoUrl=void 0;Object.defineProperties(ws,{logoUrl:{get:function(){return c(ws._logoUrl)||(ws._logoUrl=tn("Assets/Images/bing_maps_credit.png")),ws._logoUrl},set:function(e){T.defined("value",e),ws._logoUrl=e}}});function Nst(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:ws.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Fst=new ce;function Bst(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,l=!1;for(let u=0,f=s.coverageAreas.length;!l&&u<f;++u){let h=a[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,Fst);c(p)&&(l=!0)}}l&&i.push(s.credit)}return i}ws._metadataCache={};var UV=ws;var cge=/{[^}]+}/g,lge={x:zst,y:Gst,z:qst,s:Yst,reverseX:Hst,reverseY:jst,reverseZ:Wst,westDegrees:Xst,southDegrees:Kst,eastDegrees:$st,northDegrees:Zst,westProjected:Qst,southProjected:Jst,eastProjected:eat,northProjected:tat,width:nat,height:iat},kst=xt(lge,{i:oat,j:rat,reverseI:sat,reverseJ:aat,longitudeDegrees:lat,latitudeDegrees:uat,longitudeProjected:fat,latitudeProjected:dat,format:mat});function jP(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,T.defined("options.url",e.url);let t=we.createIfNeeded(e.url),n=we.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():c(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new fs({ellipsoid:e.ellipsoid}),this._rectangle=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 At(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=xt(lge,r),a=xt(kst,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=e.enablePickFeatures??!0}Object.defineProperties(jP.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}}});jP.prototype.getTileCredits=function(e,t,n){};jP.prototype.requestImage=function(e,t,n,i){return Ul.loadImage(this,Ust(this,e,t,n,i))};jP.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!c(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function l(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=Vst(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(l):u.type==="xml"?f.fetchXML().then(u.callback).catch(l):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(l):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(l)}return l()};var VV=!1,vu=new ce,zV=!1,WP=new ce;function Ust(e,t,n,i,o){VV=!1,zV=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,l={},u=s.match(cge);return c(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);c(a[h])&&(l[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:l})}var YY=!1,ME=new z,XY=!1;function Vst(e,t,n,i,o,r,s){VV=!1,zV=!1,YY=!1,XY=!1;let a=e._pickFeaturesResource,l=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=l.match(cge);return c(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);c(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function LE(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 zst(e,t,n,i){return LE(e,"{x}",t)}function Hst(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return LE(e,"{reverseX}",o)}function Gst(e,t,n,i){return LE(e,"{y}",n)}function jst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return LE(e,"{reverseY}",o)}function Wst(e,t,n,i){let o=e.maximumLevel,r=c(o)&&i<o?o-i-1:i;return LE(e,"{reverseZ}",r)}function qst(e,t,n,i){return LE(e,"{z}",i)}function Yst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function HV(e,t,n,i){VV||(e.tilingScheme.tileXYToRectangle(t,n,i,vu),vu.west=O.toDegrees(vu.west),vu.south=O.toDegrees(vu.south),vu.east=O.toDegrees(vu.east),vu.north=O.toDegrees(vu.north),VV=!0)}function Xst(e,t,n,i){return HV(e,t,n,i),vu.west}function Kst(e,t,n,i){return HV(e,t,n,i),vu.south}function $st(e,t,n,i){return HV(e,t,n,i),vu.east}function Zst(e,t,n,i){return HV(e,t,n,i),vu.north}function GV(e,t,n,i){zV||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,WP),zV=!0)}function Qst(e,t,n,i){return GV(e,t,n,i),WP.west}function Jst(e,t,n,i){return GV(e,t,n,i),WP.south}function eat(e,t,n,i){return GV(e,t,n,i),WP.east}function tat(e,t,n,i){return GV(e,t,n,i),WP.north}function nat(e,t,n,i){return e.tileWidth}function iat(e,t,n,i){return e.tileHeight}function oat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),ME.x}function rat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),ME.y}function sat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),e.tileWidth-ME.x-1}function aat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),e.tileHeight-ME.y-1}var cat=new ce,RE=new d;function jV(e,t,n,i,o,r,s){if(YY)return;KY(e,t,n,i,o,r);let a=RE,l=e.tilingScheme.tileXYToNativeRectangle(t,n,i,cat);ME.x=e.tileWidth*(a.x-l.west)/l.width|0,ME.y=e.tileHeight*(l.north-a.y)/l.height|0,YY=!0}function lat(e,t,n,i,o,r,s){return O.toDegrees(o)}function uat(e,t,n,i,o,r,s){return O.toDegrees(r)}function fat(e,t,n,i,o,r,s){return KY(e,t,n,i,o,r),RE.x}function dat(e,t,n,i,o,r,s){return KY(e,t,n,i,o,r),RE.y}var hat=new he;function KY(e,t,n,i,o,r,s){if(!XY){if(e.tilingScheme.projection instanceof Oi)RE.x=O.toDegrees(o),RE.y=O.toDegrees(r);else{let a=hat;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,RE)}XY=!0}}function mat(e,t,n,i,o,r,s){return s}var hc=jP;function Wf(e){hc.call(this,e)}Wf._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Wf._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof sp)return Wf._metadataFailure(e,t);throw o}};Wf.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??W.EMPTY_OBJECT;let r=await Wf._requestMetadata(t,i,o);return new Wf(r)};c(Object.create)&&(Wf.prototype=Object.create(hc.prototype),Wf.prototype.constructor=Wf);function uge(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 fge(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}Wf._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,l=/boundingbox/i,u,f,h,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){h=g.item(R);let L=g.item(R).childNodes;for(let B=0;B<L.length;B++)s.test(L.item(B).nodeName)&&p.push(L.item(B))}else l.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!c(h)||!c(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,c(o)&&Io.reportError(void 0,o,o.errorEvent,m),new ae(m);let y=t.fileExtension??u.getAttribute("extension"),b=t.tileWidth??parseInt(u.getAttribute("width"),10),x=t.tileHeight??parseInt(u.getAttribute("height"),10),A=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),E=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),S=h.getAttribute("profile"),v=t.tilingScheme;if(!c(v))if(S==="geodetic"||S==="global-geodetic")v=new Ki({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new fs({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${S}.`,c(o)&&Io.reportError(void 0,o,o.errorEvent,m),new ae(m);let P=ce.clone(t.rectangle);if(!c(P)){let R,L,B,_;t.flipXY??!1?(B=new z(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new z(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(B=new z(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new z(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let D=S==="geodetic"||S==="mercator";if(v.projection instanceof Oi||D)R=he.fromDegrees(B.x,B.y),L=he.fromDegrees(_.x,_.y);else{let I=v.projection;R=I.unproject(B),L=I.unproject(_)}P=new ce(R.longitude,R.latitude,L.longitude,L.latitude)}return P=uge(P,v),A=fge(v,P,A),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:P,tileWidth:b,tileHeight:x,minimumLevel:A,maximumLevel:E,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Wf._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=c(e.tilingScheme)?e.tilingScheme:new fs({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=uge(a,s);let l=fge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:l,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var _x=Wf;function dge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}dge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function pat(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(!c(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!c(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,c(n.projection)&&n.projection==="flat")t.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!c(n.projection)||n.projection==="mercator")t.tilingScheme=new fs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function _at(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw c(e)&&c(e.message)&&(i+=`: ${e.message}`),Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function gat(e,t,n){try{let i=await e.fetchText();pat(i,t)}catch(i){_at(i,e,n)}}function Vl(e){e=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 At(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Vl.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 pe}Object.defineProperties(Vl.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}}});Vl.fromUrl=async function(e,t,n){T.defined("url",e),T.defined("channel",t),n=n??{};let i=n.path??"/default_map",o=we.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 dge(n);s.channel=t,await gat(r,s);let a=new Vl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Vl.prototype.getTileCredits=function(e,t,n){};Vl.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 Ul.loadImage(this,o)};Vl.prototype.pickFeatures=function(e,t,n,i,o){};Vl._logoUrl=void 0;Object.defineProperties(Vl,{logoUrl:{get:function(){return c(Vl._logoUrl)||(Vl._logoUrl=tn("Assets/Images/google_earth_credit.png")),Vl._logoUrl},set:function(e){T.defined("value",e),Vl._logoUrl=e}}});var WV=Vl;var yat=/\/$/,hge=new At('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function NE(e){e=e??W.EMPTY_OBJECT;let t=e.mapId;if(!c(t))throw new C("options.mapId is required.");let n=e.accessToken;if(!c(n))throw new C("options.accessToken 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;let i=we.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();yat.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;c(e.credit)?(s=e.credit,typeof s=="string"&&(s=new At(s))):s=hge,this._resource=i,this._imageryProvider=new hc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(NE.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}}});NE.prototype.getTileCredits=function(e,t,n){};NE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};NE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};NE._defaultCredit=hge;var qV=NE;function gx(e){e=e??W.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=e.rectangle??ce.MAX_VALUE,n=new Ki({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 pe;let i=e.credit;typeof i=="string"&&(i=new At(i)),this._credit=i,T.defined("options.url",e.url);let o=we.createIfNeeded(e.url);this._resource=o,T.typeOf.number("options.tileWidth",e.tileWidth),T.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(gx.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 bat(e,t,n,i){let o=`Failed to load image ${e.url}`;c(t)&&c(t.message)&&(o+=`: ${t.message}`);let r=Io.reportError(i,n,c(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return $Y(e,n,r);throw c(n)&&(n._hasError=!0),new ae(o)}async function $Y(e,t,n){try{return await Ul.loadImage(null,e)}catch(i){return bat(e,i,t,n)}}gx.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e),i=await $Y(n);t=t??W.EMPTY_OBJECT;let o=new gx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};gx.prototype.getTileCredits=function(e,t,n){};gx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!c(this._image)){let o=await $Y(this._resource,this);return this._image=o,Io.reportSuccess(this._errorEvent),o}return this._image};gx.prototype.pickFeatures=function(e,t,n,i,o){};var YV=gx;function xat(e,t,n){if(!c(e))throw new C("type is required.");if(this.type=e,!c(t))if(e==="json")t="application/json";else if(e==="xml")t="text/xml";else if(e==="html")t="text/html";else if(e==="text")t="text/plain";else throw new C('format is required when type is not "json", "xml", "html", or "text".');if(this.format=t,!c(n))if(e==="json")n=Tat;else if(e==="xml")n=Sat;else if(e==="html")n=mge;else if(e==="text")n=mge;else throw new C('callback is required when type is not "json", "xml", "html", or "text".');this.callback=n}function Tat(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Bm;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),c(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 ZY="http://www.mapinfo.com/mxp",Aat="http://www.esri.com/wms",Cat="http://www.opengis.net/wfs",Eat="http://www.opengis.net/gml";function Sat(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===ZY)return wat(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Aat)return vat(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Cat)return Dat(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Pat(e):Iat(e)}function wat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(ZY,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(ZY,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();s[h]=p}}let l=new Bm;l.data=r,l.properties=s,l.configureNameFromProperties(s),l.configureDescriptionFromProperties(s),t.push(l)}return t}function vat(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 l=0;l<a.length;++l){let u=a[l];i[u.name]=u.value}n.push(XV(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let l=a.childNodes;for(let u=0;u<l.length;++u){let f=l[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(XV(a,i))}}return n}function Dat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Eat,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};QY(r,s),t.push(XV(r,s))}return t}function Pat(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(!c(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={};QY(s,a),t.push(XV(s,a))}}return t}function QY(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()&&QY(o,t)&&(t[o.localName]=o.textContent)}return n}function XV(e,t){let n=new Bm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Iat(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Bm;return o.data=e,o.description=n.innerHTML,[o]}var Oat=/<body>\s*<\/body>/im,Rat=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Mat=/<title>([\s\S]*)<\/title>/im;function mge(e){if(Oat.test(e)||Rat.test(e))return;let t,n=Mat.exec(e);n&&n.length>1&&(t=n[1]);let i=new Bm;return i.name=t,i.description=e,i.data=e,[i]}var FE=xat;function qP(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.times",e.times),T.typeOf.func("options.requestImageFunction",e.requestImageFunction),T.typeOf.func("options.reloadFunction",e.reloadFunction),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(qP.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!c(e))throw new C("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!c(e))throw new C("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});qP.prototype.getFromCache=function(e,t,n,i){let o=pge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(c(s)&&c(s[o])){let a=s[o];r=a.promise.catch(function(l){throw i.state=a.request.state,l}),delete s[o]}return r};qP.prototype.checkApproachingInterval=function(e,t,n,i){let o=pge(e,t,n),r=this._tilesRequestedForInterval,s=_ge(this),a={key:o,priorityFunction:i.priorityFunction};(!c(s)||!gge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};qP.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=_ge(this);if(c(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let l=s.pop();a=gge(this,l,r),a||s.push(l)}}};function pge(e,t,n){return`${e}-${t}-${n}`}function Lat(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function _ge(e){let t=e._times;if(!c(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 l=t.get(a);return r>0?(s=Q.secondsDifference(l.stop,i),++a):(s=Q.secondsDifference(l.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function gge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];c(r)||(r=o[i]={});let s=t.key;if(c(r[s]))return!0;let a=Lat(s),l=new ir({throttle:!1,throttleByServer:!0,type:gs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,l,n);return c(u)?(r[s]={promise:u,request:l},!0):!1}var BE=qP;var Nat=[3034,3035,3042,3043,3044],Fat=[4471,4559];function sh(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new C("options.url is required.");if(!c(e.layers))throw new C("options.layers is required.");if(c(e.times)&&!c(e.clock))throw new C("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=e.getFeatureInfoUrl??e.url;let t=we.createIfNeeded(e.url),n=we.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(sh.DefaultParameters,!0),n.setQueryParameters(sh.GetFeatureInfoDefaultParameters,!0),c(e.parameters)&&t.setQueryParameters(yge(e.parameters)),c(e.getFeatureInfoParameters)&&n.setQueryParameters(yge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new BE({clock:e.clock,times:e.times,requestImageFunction:function(s,a,l,u,f){return bge(i,s,a,l,u,f)},reloadFunction:function(){c(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=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Li?"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&&!Fat.includes(a)||Nat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Li?"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 hc({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({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:e.getFeatureInfoFormats??sh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function bge(e,t,n,i,o,r){let s=c(r)?r.data:void 0,a=e._tileProvider;return c(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Bat(e,t,n,i,o,r,s){let a=c(s)?s.data:void 0,l=e._tileProvider;return c(a)&&l._pickFeaturesResource.setQueryParameters(a),l.pickFeatures(t,n,i,o,r)}Object.defineProperties(sh.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}}});sh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};sh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=bge(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};sh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=c(r)?r.currentInterval:void 0;return Bat(this,e,t,n,i,o,s)};sh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});sh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});sh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new FE("json","application/json")),Object.freeze(new FE("xml","text/xml")),Object.freeze(new FE("text","text/html"))]);function yge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var KV=sh;var kat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function YP(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new C("options.url is required.");if(!c(e.layer))throw new C("options.layer is required.");if(!c(e.style))throw new C("options.style is required.");if(!c(e.tileMatrixSetID))throw new C("options.tileMatrixSetID is required.");if(c(e.times)&&!c(e.clock))throw new C("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;let t=we.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!c(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(kat),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=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new fs({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new BE({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,m,y){return xge(s,h,p,g,m,y)},reloadFunction:function(){c(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(l.x-a.x)+1)*(Math.abs(l.y-a.y)+1);if(u>4)throw new C(`The imagery provider's rectangle and minimumLevel indicate that there are ${u} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new At(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():c(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function xge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=c(s)?s[i]:i.toString(),l=e._subdomains,u=e._dimensions,f=c(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),c(u)&&h.setTemplateValues(u),c(f)&&h.setTemplateValues(f);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,c(u)&&(g=xt(g,u)),c(f)&&(g=xt(g,f)),p={s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return Ul.loadImage(e,h)}Object.defineProperties(YP.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,c(this._reload)&&this._reload())}}});YP.prototype.getTileCredits=function(e,t,n){};YP.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=xge(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};YP.prototype.pickFeatures=function(e,t,n,i,o){};var $V=YP;var Uat={ARCGIS_MAPSERVER:qy.fromUrl,BING:async(e,t)=>UV.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,WV.fromUrl(e,n,t)},MAPBOX:(e,t)=>new qV({url:e,...t}),SINGLE_TILE:YV.fromUrl,TMS:_x.fromUrl,URL_TEMPLATE:(e,t)=>new hc({url:e,...t}),WMS:(e,t)=>new KV({url:e,...t}),WMTS:(e,t)=>new $V({url:e,...t})};function Vm(e){e=e??W.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 pe}Object.defineProperties(Vm.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(){}}});Vm.fromAssetId=async function(e,t){T.typeOf.number("assetId",e),t=t??W.EMPTY_OBJECT;let n=uf._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Vm._endpointCache[i];c(o)||(o=n.fetchJson(),Vm._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(!c(a))s=await _x.fromUrl(new uf(r,n));else{let u=Uat[a];if(!c(u))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},h=f.url;delete f.url,s=await u(h,f)}let l=new Vm(t);return s.errorEvent.addEventListener(function(u){u.provider=l,l._errorEvent.raiseEvent(u)}),l._tileCredits=uf.getCreditsFromEndpoint(r,n),l._imageryProvider=s,l};Vm.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return c(i)?this._tileCredits.concat(i):this._tileCredits};Vm.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Vm.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Vm._endpointCache={};var Yy=Vm;var Vat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},Xy=Object.freeze(Vat);function zat(e){e=e??W.EMPTY_OBJECT;let t=e.style??Xy.AERIAL;return Yy.fromAssetId(t)}var Ky=zat;function kE(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=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!c(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}kE.createPlaceholder=function(e){let t=new kE(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};kE.prototype.addReference=function(){++this.referenceCount};kE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),c(this.parent)&&this.parent.releaseReference(),c(this.image)&&c(this.image.destroy)&&this.image.destroy(),c(this.texture)&&this.texture.destroy(),c(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),de(this),0):this.referenceCount};kE.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var XP=kE;function JY(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}JY.prototype.freeResources=function(){c(this.readyImagery)&&this.readyImagery.releaseReference(),c(this.loadingImagery)&&this.loadingImagery.releaseReference()};JY.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return c(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(;c(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!c(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,c(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?c(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var KP=JY;function _i(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=t??W.EMPTY_OBJECT,e=e??W.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??_i.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??_i.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??_i.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??_i.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??_i.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??_i.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??_i.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??_i.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ce.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new KP(XP.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=t.colorToAlphaThreshold??_i.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(_i.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return c(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});_i.DEFAULT_BRIGHTNESS=1;_i.DEFAULT_CONTRAST=1;_i.DEFAULT_HUE=0;_i.DEFAULT_SATURATION=1;_i.DEFAULT_GAMMA=1;_i.DEFAULT_SPLIT=qr.NONE;_i.DEFAULT_MINIFICATION_FILTER=Yt.LINEAR;_i.DEFAULT_MAGNIFICATION_FILTER=ui.LINEAR;_i.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;_i.fromProviderAsync=function(e,t){T.typeOf.object("imageryProviderPromise",e);let n=new _i(void 0,t);return qat(n,Promise.resolve(e)),n};_i.fromWorldImagery=function(e){return e=e??W.EMPTY_OBJECT,_i.fromProviderAsync(Ky({style:e.style}),e)};_i.prototype.isBaseLayer=function(){return this._isBaseLayer};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){return de(this)};var Cge=new ce,Tge=new ce,eX=new ce,Ege=new ce;_i.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};_i.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!c(t)||c(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||c(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;c(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 Li&&e.rectangle.north<Li.MaximumLatitude&&e.rectangle.south>-Li.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,Cge),a=ce.intersection(e.rectangle,s,Tge);if(!c(a)){if(!this.isBaseLayer())return!1;let D=s,I=e.rectangle;a=Tge,I.south>=D.north?a.north=a.south=D.north:I.north<=D.south?a.north=a.south=D.south:(a.south=Math.max(I.south,D.south),a.north=Math.min(I.north,D.north)),I.west>=D.east?a.west=a.east=D.east:I.east<=D.west?a.west=a.east=D.west:(a.west=Math.max(I.west,D.west),a.east=Math.min(I.east,D.east))}let l=0;a.south>0?l=a.south:a.north<0&&(l=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=jat(this,f,l);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),c(o.minimumLevel)){let D=o.minimumLevel;h<D&&(h=D)}let g=o.tilingScheme,m=g.positionToTileXY(ce.northwest(a),h),y=g.positionToTileXY(ce.southeast(a),h),b=e.rectangle.width/512,x=e.rectangle.height/512,A=g.tileXYToRectangle(m.x,m.y,h);Math.abs(A.south-e.rectangle.north)<x&&m.y<y.y&&++m.y,Math.abs(A.east-e.rectangle.west)<b&&m.x<y.x&&++m.x;let E=g.tileXYToRectangle(y.x,y.y,h);Math.abs(E.north-e.rectangle.south)<x&&y.y>m.y&&--y.y,Math.abs(E.west-e.rectangle.east)<b&&y.x>m.x&&--y.x;let S=ce.clone(e.rectangle,Ege),v=g.tileXYToRectangle(m.x,m.y,h),P=ce.intersection(v,s,eX),M;r?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(P,P),g.rectangleToNativeRectangle(s,s),M=g.tileXYToNativeRectangle.bind(g),b=S.width/512,x=S.height/512):M=g.tileXYToRectangle.bind(g);let R,L=0,B=1,_;!this.isBaseLayer()&&Math.abs(P.west-S.west)>=b&&(L=Math.min(1,(P.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(P.north-S.north)>=x&&(B=Math.max(0,(P.north-S.south)/S.height));let w=B;for(let D=m.x;D<=y.x;D++)if(R=L,v=M(D,m.y,h),P=ce.simpleIntersection(v,s,eX),!!c(P)){L=Math.min(1,(P.east-S.west)/S.width),D===y.x&&(this.isBaseLayer()||Math.abs(P.east-S.east)<b)&&(L=1),B=w;for(let I=m.y;I<=y.y;I++){if(_=B,v=M(D,I,h),P=ce.simpleIntersection(v,s,eX),!c(P))continue;B=Math.max(0,(P.south-S.south)/S.height),I===y.y&&(this.isBaseLayer()||Math.abs(P.south-S.south)<x)&&(B=0);let N=new se(R,B,L,_),k=this.getImageryFromCache(D,I,h);i.imagery.splice(n,0,new KP(k,N,r)),++n}}return!0};_i.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let l=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=l.rectangleToNativeRectangle(n,Cge),i=l.rectangleToNativeRectangle(i,Ege)}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)};_i.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!c(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Io.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Zn.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Io.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new ir({throttle:!1,throttleByServer:!0,type:gs.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!c(a)){e.state=ai.UNLOADED,e.request=void 0;return}c(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(l){i(l)}).catch(function(l){o(l)})}r()};_i.prototype._createTextureWebGL=function(e,t){let n=new Qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return c(i.internalFormat)?new Rt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Rt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ke.RGBA:ke.RGB,sampler:n})};_i.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(c(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(c(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}if(this.minificationFilter!==Yt.NEAREST&&this.minificationFilter!==Yt.LINEAR)throw new C("ImageryLayer minification filter must be NEAREST or LINEAR");let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Li?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function Age(e,t,n){return`${e}:${t}:${n}`}_i.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Yt.LINEAR&&i===ui.LINEAR&&!ke.isCompressedFormat(t.pixelFormat)&&O.isPowerOfTwo(t.width)&&O.isPowerOfTwo(t.height)){n=Yt.LINEAR_MIPMAP_LINEAR;let r=ut.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Age(n,i,s),l=e.cache.imageryLayerMipmapSamplers;c(l)||(l={},e.cache.imageryLayerMipmapSamplers=l);let u=l[a];c(u)||(u=l[a]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(hd.NICEST),t.sampler=u}else{let r=Age(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;c(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];c(a)||(a=s[r]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};_i.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Oi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new cl({persists:!0,owner:this,preExecute:function(l){Gat(l,r,i,t.rectangle)},postExecute:function(l){t.texture=l,s._finalizeReprojectTexture(r,l),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};_i.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};_i.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){c(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};_i.prototype.getImageryFromCache=function(e,t,n,i){let o=Sge(e,t,n),r=this._imageryCache[o];return c(r)||(r=new XP(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};_i.prototype.removeImageryFromCache=function(e){let t=Sge(e.x,e.y,e.level);delete this._imageryCache[t]};function Sge(e,t,n){return JSON.stringify([e,t,n])}var ZV={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new z,texture:void 0},Hat=zt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Gat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!c(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){c(this.framebuffer)&&this.framebuffer.destroy(),c(this.vertexArray)&&this.vertexArray.destroy(),c(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),x=0;for(let P=0;P<64;++P){let M=P/63;b[x++]=0,b[x++]=M,b[x++]=1,b[x++]=M}let A={position:0,webMercatorT:1},E=us.getRegularGridIndices(2,64),S=bt.createIndexBuffer({context:t,typedArray:E,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:A.position,vertexBuffer:bt.createVertexBuffer({context:t,typedArray:b,usage:Be.STATIC_DRAW}),componentsPerAttribute:2},{index:A.webMercatorT,vertexBuffer:bt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Be.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new He({sources:[xV]});o.shaderProgram=en.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:bV,attributeLocations:A}),o.sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;ZV.textureDimensions.x=r,ZV.textureDimensions.y=s,ZV.texture=n;let a=Math.sin(i.south),l=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-l),h=new Rt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});O.isPowerOfTwo(r)&&O.isPowerOfTwo(s)&&h.generateMipmap(hd.NICEST);let p=i.south,g=i.north,m=Hat,y=0;for(let b=0;b<64;++b){let x=b/63,A=O.lerp(p,g,x);a=Math.sin(A);let S=(.5*Math.log((1+a)/(1-a))-l)*f;m[y++]=S,m[y++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=ZV,e.vertexArray=o.vertexArray}function jat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Oi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Wat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function qat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Wat(e._errorEvent,i)}}var mc=_i;var Yat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=Yat;var wge={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>=wge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=wge;function VE(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}VE.prototype.update=function(e,t,n){this.changedThisFrame&&(Mge(e,t,this.tile,n),this.changedThisFrame=!1)};VE.prototype.destroy=function(e){this._destroyVertexArray(e),c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};VE.prototype._destroyVertexArray=function(e){c(this.vertexArray)&&(c(e)?e.push(this.vertexArray):rh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Xat=new pb;VE.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Xat;a.clear();for(let u=0;u<t.length;++u){let f=t[u];c(f.data.vertexArray)&&a.enqueue(t[u])}let l=a.dequeue();for(;l!==void 0;){let u=l.findTileToWest(r),f=l.findTileToSouth(r),h=l.findTileToEast(r),p=l.findTileToNorth(r);vs(e,n,l,u,s,yn.EAST,!1,a,i),vs(e,n,l,f,s,yn.NORTH,!1,a,i),vs(e,n,l,h,s,yn.WEST,!1,a,i),vs(e,n,l,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),y=h.findTileToNorth(r),b=h.findTileToSouth(r);vs(e,n,l,g,s,yn.SOUTHEAST,!1,a,i),vs(e,n,l,y,s,yn.SOUTHWEST,!1,a,i),vs(e,n,l,m,s,yn.NORTHEAST,!1,a,i),vs(e,n,l,b,s,yn.NORTHWEST,!1,a,i),l=a.dequeue()}};function vs(e,t,n,i,o,r,s,a,l){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(c(u.data.vertexArray))return;Kat(e,t,n,u,r,o,a,l);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case yn.WEST:vs(e,t,n,i.northwestChild,o,r,!0,a,l),vs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.EAST:vs(e,t,n,i.southeastChild,o,r,!0,a,l),vs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTH:vs(e,t,n,i.southwestChild,o,r,!0,a,l),vs(e,t,n,i.southeastChild,o,r,!0,a,l);break;case yn.NORTH:vs(e,t,n,i.northeastChild,o,r,!0,a,l),vs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHWEST:vs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHEAST:vs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTHWEST:vs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.SOUTHEAST:vs(e,t,n,i.southeastChild,o,r,!0,a,l);break;default:throw new C("Invalid edge")}}}function Kat(e,t,n,i,o,r,s,a){let l=i.data;if(l.fill===void 0)l.fill=new VE(i);else if(l.fill.visitedFrame===r)return;l.fill.enqueuedFrame!==r&&(l.fill.enqueuedFrame=r,l.fill.changedThisFrame=!1,s.enqueue(i)),$at(e,t,n,i,o,a)}function $at(e,t,n,i,o,r){let s=i.data.fill,a,l=n.data.fill;c(l)?(l.visitedFrame=t.frameNumber,l.changedThisFrame&&(Mge(e,t,n,r),l.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=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||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,p,g,m,y=n.rectangle,b,x=i.rectangle;switch(o){case yn.WEST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.north,m.south,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.south,m.north,b));++p);break;case yn.SOUTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.west,m.east,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.east,m.west,b));++p);break;case yn.EAST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.south,m.north,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.north,m.south,b));++p);break;case yn.NORTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.east,m.west,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.west,m.east,b));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,p-h,a),f.splice(h,p-h,n))}var yx=new he,Zat=new he,UE=new d,oX=new d,tX=new z,nX=new z,Du=new z;function oz(){this.height=0,this.encodedNormal=new z}function QV(e,t,n,i,o,r,s,a,l){if(c(o))return o;let u;if(c(r)&&c(s))u=(r.height+s.height)*.5;else if(c(r))u=r.height;else if(c(s))u=s.height;else if(c(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;c(h)&&(p=h.minimumHeight,g=h.maximumHeight),u=(p+g)*.5}return Lge(e,t,n,i,u,l),l}var Qat={minimumHeight:0,maximumHeight:0},Jat=new d,vge=new oz,Dge=new oz,Pge=new oz,Ige=new oz,ect=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,tct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Mge(e,t,n,i){rh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,l=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=ez(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Pge),p=ez(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,vge),g=ez(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,Dge),m=ez(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Ige);h=QV(r,f,0,1,h,p,m,g,Pge),p=QV(r,f,0,0,p,h,g,m,vge),g=QV(r,f,1,1,g,p,m,h,Dge),m=QV(r,f,1,1,m,g,h,p,Ige);let y=p.height,b=g.height,x=h.height,A=m.height,E=Math.min(y,b,x,A),S=Math.max(y,b,x,A),v=(E+S)*.5,P,M,R=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-R,B=Math.acos(L/f.maximumRadius)*4;if(B*=1.5,s.width>B&&S-E<=R){let D=new dc({width:9,height:9,buffer:ect,structure:{heightOffset:S}}),I=tct;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=l,r.mesh=D._createMeshSync(I)}else{let D=u,I=ce.center(s,Zat);I.height=v;let N=f.cartographicToCartesian(I,Jat),k=new Zc(N,void 0,void 0,void 0,void 0,!0,!0,D,a,l),H=5,V;for(V=r.westMeshes,P=0,M=V.length;P<M;++P)H+=V[P].eastIndicesNorthToSouth.length;for(V=r.southMeshes,P=0,M=V.length;P<M;++P)H+=V[P].northIndicesWestToEast.length;for(V=r.eastMeshes,P=0,M=V.length;P<M;++P)H+=V[P].westIndicesSouthToNorth.length;for(V=r.northMeshes,P=0,M=V.length;P<M;++P)H+=V[P].southIndicesEastToWest.length;let j=Qat;j.minimumHeight=E,j.maximumHeight=S;let U=k.stride,q=new Float32Array(H*U),X=0,te=X;X=JV(f,s,k,q,X,0,1,h.height,h.encodedNormal,1,j),X=nz(r,f,k,q,X,r.westTiles,r.westMeshes,yn.EAST,j);let K=X;X=JV(f,s,k,q,X,0,0,p.height,p.encodedNormal,0,j),X=nz(r,f,k,q,X,r.southTiles,r.southMeshes,yn.NORTH,j);let Z=X;X=JV(f,s,k,q,X,1,0,g.height,g.encodedNormal,0,j),X=nz(r,f,k,q,X,r.eastTiles,r.eastMeshes,yn.WEST,j);let ee=X;X=JV(f,s,k,q,X,1,1,m.height,m.encodedNormal,1,j),X=nz(r,f,k,q,X,r.northTiles,r.northMeshes,yn.SOUTH,j),E=j.minimumHeight,S=j.maximumHeight;let me=Pn.fromRectangle(s,E,S,n.tilingScheme.ellipsoid),xe=Li.geodeticLatitudeToMercatorAngle(s.south),ue=1/(Li.geodeticLatitudeToMercatorAngle(s.north)-xe),ye=(Li.geodeticLatitudeToMercatorAngle(I.latitude)-xe)*ue,Ae=f.geodeticSurfaceNormalCartographic(yx,oX),Pe=Ln.octEncode(Ae,tX),Ee=X;k.encode(q,X*U,me.center,z.fromElements(.5,.5,Du),v,Pe,ye,Ae),++X;let Ve=X,je=Ve<256?1:2,it=(Ve-1)*3,Dt=it*je,Gt=(q.length-Ve*U)*Float32Array.BYTES_PER_ELEMENT,$e;if(Gt>=Dt){let _e=Ve*U*Float32Array.BYTES_PER_ELEMENT;$e=Ve<256?new Uint8Array(q.buffer,_e,it):new Uint16Array(q.buffer,_e,it)}else $e=Ve<256?new Uint8Array(it):new Uint16Array(it);q=new Float32Array(q.buffer,0,Ve*U);let ln=0;for(P=0;P<Ve-2;++P)$e[ln++]=Ee,$e[ln++]=P,$e[ln++]=P+1;$e[ln++]=Ee,$e[ln++]=P,$e[ln++]=0;let Vt=[];for(P=K;P>=te;--P)Vt.push(P);let Ct=[];for(P=Z;P>=K;--P)Ct.push(P);let gi=[];for(P=ee;P>=Z;--P)gi.push(P);let an=[];for(an.push(0),P=Ee-1;P>=ee;--P)an.push(P);r.mesh=new oh(k.center,q,$e,it,Ve,E,S,le.fromOrientedBoundingBox(me),cct(e,me.center,s,E,S),k.stride,me,k,Vt,Ct,gi,an)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=rh._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let w=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let D=o._findAncestorTileWithTerrainData(n);c(D)&&c(D.data.waterMaskTexture)&&(r.waterMaskTexture=D.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,D,r.waterMaskTranslationAndScale))}c(w)&&(--w.referenceCount,w.referenceCount===0&&w.destroy())}function JV(e,t,n,i,o,r,s,a,l,u,f){let h=yx;h.longitude=O.lerp(t.west,t.east,r),h.latitude=O.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,UE),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,oX));let m=nX;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,l,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var iz=new ce;function $P(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,iz),o.west-=O.TWO_PI,o.east-=O.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,iz),o.west+=O.TWO_PI,o.east+=O.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,l=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-a)/(l-a),g=(n.y-f)/(h-f);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 nct=new z;function iX(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 ict=new z,oct=new d;function rct(e,t,n,i,o,r,s,a,l,u){let f=i.encoding,h=i.vertices,p=$P(t,n,f.decodeTextureCoordinates(h,o,Du),Du),g=$P(t,n,f.decodeTextureCoordinates(h,r,nX),nX),m;l?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(h,o),b=f.decodeHeight(h,r),x=n.rectangle;yx.longitude=O.lerp(x.west,x.east,s),yx.latitude=O.lerp(x.south,x.north,a),u.height=yx.height=O.lerp(y,b,m);let A;if(f.hasVertexNormals){let E=f.getOctEncodedNormal(h,o,nct),S=f.getOctEncodedNormal(h,r,ict),v=Ln.octDecode(E.x,E.y,UE),P=Ln.octDecode(S.x,S.y,oct);A=d.lerp(v,P,m,UE),d.normalize(A,A),Ln.octEncode(A,u.encodedNormal)}else A=e.geodeticSurfaceNormalCartographic(yx,UE),Ln.octEncode(A,u.encodedNormal)}function Lge(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(yx,UE);Ln.octEncode(s,r.encodedNormal)}function ez(e,t,n,i,o,r,s,a,l,u,f){if(Rge(e,t,a,s,!1,n,i,f)||Rge(e,t,u,l,!0,n,i,f))return f;let p;if(rX(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],iX(r,p,n,i,f),f;let g;if(n===0?i===0?g=tz(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=tz(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=tz(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=tz(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),c(g))return Lge(e,t,n,i,g,f),f}function tz(e,t,n,i,o,r,s,a){let l=Oge(e,t,!1,n,s,a),u=Oge(i,o,!0,r,s,a);return c(l)&&c(u)?(l+u)*.5:c(l)?l:u}function nz(e,t,n,i,o,r,s,a,l){for(let u=0;u<r.length;++u)o=sct(e,t,n,i,o,r[u],s[u],a,l);return o}function sct(e,t,n,i,o,r,s,a,l){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,iz),u.west-=O.TWO_PI,u.east-=O.TWO_PI):a===yn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,iz),u.west+=O.TWO_PI,u.east+=O.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Du),h=Du.x,p=Du.y);let g,m;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=r,b=e.tile,x=s.encoding,A=s.vertices,E=n.stride,S,v;x.hasWebMercatorT&&(S=Li.geodeticLatitudeToMercatorAngle(f.south),v=1/(Li.geodeticLatitudeToMercatorAngle(f.north)-S));for(let P=0;P<g.length;++P){let M=g[P],R=x.decodeTextureCoordinates(A,M,Du);$P(y,b,R,R);let L=R.x,B=R.y,_=m?L:B;if(_<0||_>1||Math.abs(L-h)<O.EPSILON5&&Math.abs(B-p)<O.EPSILON5)continue;let w=Math.abs(L)<O.EPSILON5||Math.abs(L-1)<O.EPSILON5,D=Math.abs(B)<O.EPSILON5||Math.abs(B-1)<O.EPSILON5;if(w&&D)continue;let I=x.decodePosition(A,M,UE),N=x.decodeHeight(A,M),k;x.hasVertexNormals?k=x.getOctEncodedNormal(A,M,tX):(k=tX,k.x=0,k.y=0);let H=B;if(x.hasWebMercatorT){let j=O.lerp(f.south,f.north,B);H=(Li.geodeticLatitudeToMercatorAngle(j)-S)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,oX)),n.encode(i,o*E,I,R,N,k,H,V),l.minimumHeight=Math.min(l.minimumHeight,N),l.maximumHeight=Math.max(l.maximumHeight,N),++o}return o}function Oge(e,t,n,i,o,r){let s,a,l;n?(s=0,a=e.length,l=1):(s=e.length-1,a=-1,l=-1);for(let u=s;u!==a;u+=l){let f=e[u],h=t[u];if(!rX(h,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(c(g))return f.encoding.decodeHeight(f.vertices,g)}}function rX(e,t){return c(t)&&(!c(e.data.fill)||!e.data.fill.changedThisFrame)}function Rge(e,t,n,i,o,r,s,a){let l,u,f,h,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(rX(g,m)&&(r===0?s===0?(l=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(l=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(l=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(l=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),l.length>0)){h=o?0:l.length-1,p=l[h],m.encoding.decodeTextureCoordinates(m.vertices,p,Du);let y=$P(g,e.tile,Du,Du);if(y.x===r&&y.y===s)return iX(m,p,r,s,a),!0;if(h=Mo(l,u?r:s,function(b,x){m.encoding.decodeTextureCoordinates(m.vertices,b,Du);let A=$P(g,e.tile,Du,Du);return f?u?A.x-r:A.y-s:u?r-A.x:s-A.y}),h<0){if(h=~h,h>0&&h<l.length)return rct(t,g,e.tile,m,l[h-1],l[h],r,s,u,a),!0}else return iX(m,l[h],r,s,a),!0}return!1}var act=[new d,new d,new d,new d];function cct(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=act;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}var ZP=VE;function er(e){if(!c(e))throw new C("options is required.");if(c(e.terrainProvider))if(c(e.imageryLayers)){if(!c(e.surfaceShaderSet))throw new C("options.surfaceShaderSet is required.")}else throw new C("options.imageryLayers is required.");else throw new C("options.terrainProvider is required.");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 pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(er.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(er.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(er.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(er.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,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 G(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(er.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!c(e))throw new C("value is required.");this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!c(e))throw new C("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if(c(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,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zh.setOwner(e,this,"_clippingPolygons")}}});function lct(e,t){let n=e.loadingImagery;c(n)||(n=e.readyImagery);let i=t.loadingImagery;return c(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}er.prototype.update=function(e){this._imageryLayers._update()};function uct(e,t){let n=t.creditDisplay,i=e._terrainProvider;c(i)&&c(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&&c(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}er.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(lct)})),uct(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)rh._freeVertexArray(t[i]);t.length=0};er.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];c(s)&&(s.length=0)}let n=this._clippingPlanes;c(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;c(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};er.prototype.endUpdate=function(e){if(!c(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Dc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=We(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(s),s=We(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&ZP.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 l=r[s];if(c(l))for(let u=0,f=l.length;u<f;++u){let h=l[u],p=h.data.tileBoundingRegion;Lct(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Uge(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)}er.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Uge(t[n],e)};er.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};er.prototype.getLevelMaximumGeometricError=function(e){return c(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};er.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;c(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),rh.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)!==Sr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,rh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var fct=new le,Vge=new ce,dct=new ce,hct=new he;function sz(e,t){if(t.west<t.east)return t;let n=ce.clone(t,dct);return ce.center(e,hct).longitude>0?n.east=O.PI:n.west=-O.PI,n}function zge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(c(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(c(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}er.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=zge(this,t);if(t.fog.enabled&&!o&&O.fog(i,t.fog.density)>=1)return Sr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Sr.PARTIAL;let a=t.cullingVolume,l=s.boundingVolume;c(l)||(l=s.boundingSphere),r.clippedByBoundaries=!1;let u=sz(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,Vge);if(!c(f))return Sr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(l=fct,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,l),d.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===oe.MORPHING&&c(r.renderedMesh)&&(l=le.union(s.boundingSphere,l,l))),!c(l))return Sr.PARTIAL;let h=this._clippingPlanes;if(c(h)&&h.enabled){let b=h.computeIntersectionWithBoundingVolume(l);if(e.isClipped=b!==Wt.INSIDE,b===Wt.OUTSIDE)return Sr.NONE}let p=this._clippingPolygons;if(c(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Wt.OUTSIDE}let g,m=a.computeVisibility(l);if(m===Wt.OUTSIDE?g=Sr.NONE:m===Wt.INTERSECTING?g=Sr.PARTIAL:m===Wt.INSIDE&&(g=Sr.FULL),g===Sr.NONE)return g;let y=t.mode===oe.SCENE3D&&t.camera.frustum instanceof on;if(t.mode===oe.SCENE3D&&!y&&c(n)&&!o){let b=r.occludeePointInScaledSpace;return!c(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?g:Sr.NONE}return g};er.prototype.canRefine=function(e){return c(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var mct=[],pct=[];er.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=mct;i.length=this._imageryLayers.length;let o=!1,r=!1,s;c(n)&&(o=n.terrainState===uo.READY,r=!0,s=n.imagery);let a,l;for(a=0,l=i.length;a<l;++a)i[a]=r;if(c(s))for(a=0,l=s.length;a<l;++a){let h=s[a],p=h.loadingImagery,g=!c(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=pct;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:Yn.NONE;if(p===Yn.RENDERED){let g=h.data;if(!c(g))continue;if(!o&&h.data.terrainState===uo.READY)return!1;let m=h.data.imagery;for(a=0,l=m.length;a<l;++a){let y=m[a],b=y.loadingImagery,x=!c(b)||b.state===ai.FAILED||b.state===ai.INVALID,A=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(x&&!i[A])return!1}}else p===Yn.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var _ct=new d;er.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=d.subtract(i.center,o,_ct),a=d.magnitude(s);return a<O.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var Nge=new F,rz=new F,gct=new se,yct=new se,bct=new se,xct=new d,Fge=new d,Tct=new d,Act=new d;er.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,l=i.length;a<l;++a){let u=i[a];c(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];c(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;c(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Cct=[new d,new d,new d,new d];function Bge(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Cct;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}er.prototype.computeDistanceToTile=function(e,t){Ect(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 l=t.camera.positionCartographic.height,u=Math.abs(l-r),f=Math.abs(l-s);u>f?(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 Ect(e,t,n){let i=e.data;i===void 0&&(i=e.data=new rh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Pf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,l=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,l=!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 m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(l=!1,r.minimumHeight=Rr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Rr.getHeight(r.maximumHeight,p,g)),l)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Pn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),c(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Bge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Bge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=l}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}er.prototype.isDestroyed=function(){return!1};er.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(),de(this)};function Sct(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,l=a.length,u;for(u=0;u<l;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=c(o)?o.readyImagery??o.loadingImagery:void 0,!c(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}er.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(c(s._loadedCallbacks[e._layerIndex]))return;let a,l=s.data.imagery,u=l.length,f=-1,h=0;for(a=0;a<u;++a){let g=l[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Sct(h,e,n),s.state=_a.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=_a.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};er.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 l=i[s],u=l.loadingImagery;if(c(u)||(u=l.readyImagery),u.imageryLayer===e)o===-1&&(o=s),l.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};er.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};er.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var wct=new F,vct=new F;function kge(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=F.multiplyByPoint(i,this.properties.rtc,Fge);return F.setTranslation(i,o,Nge),Nge},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,Fge);return F.setTranslation(i,r,rz),F.multiply(o,rz,rz),rz},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 c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=c(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,wct):F.IDENTITY;return F.inverseTranspose(o,vct)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return c(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return c(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 G(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new z(65e5,9e6),nightFadeDistance:new z(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new F,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new z,southMercatorYAndOneOverHeight:new z,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new z,scaleAndBias:new F,clippingPlanesEdgeColor:G.clone(G.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:G.clone(G.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return c(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function Dct(e,t,n){let i=n.data,o,r;if(c(i.vertexArray)?(o=i.mesh,r=i.vertexArray):c(i.fill)&&c(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!c(o)||!c(r))){if(c(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Pct(e,r,o),i.wireframeVertexArray.mesh=o}}function Pct(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=bt.createIndexBuffer({context:e,typedArray:r,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var Hge,Gge,az;(function(){let e=new St({geometry:Mh.fromDimensions({dimensions:new d(2,2,2)})}),t=new St({geometry:new Jg({radius:1})}),n=new F,i,o;function r(s){return new In({geometryInstances:s,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}Hge=function(s,a){return s===i||(az(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=jt.fromColor(a),o=r(e)),o},Gge=function(s,a){return s===i||(az(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=jt.fromColor(a),o=r(t)),o},az=function(){c(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Ict=new se(0,0,0,0),Oct={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},Rct=G.TRANSPARENT,Mct=new Bt;function Lct(e,t,n){let i=t.data;c(i.vertexArray)||(i.fill===void 0&&(i.fill=new ZP(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(c(r)&&c(r.credits)){let _e=r.credits;for(let Ce=0,mn=_e.length;Ce<mn;++Ce)o.addCreditToNextFrame(_e[Ce])}let s=ut.maximumTextureImageUnits,a=i.waterMaskTexture,l=i.waterMaskTranslationAndScale;!c(a)&&c(i.fill)&&(a=i.fill.waterMaskTexture,l=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??Rct,b=e.undergroundColorAlphaByDistance??Mct,x=zge(e,n)&&n.mode===oe.SCENE3D&&y.alpha>0&&(b.nearValue>0||b.farValue>0),A=e.lambertDiffuseMultiplier,E=e.vertexShadowDarkness,S=e.hasWaterMask&&c(a),v=S&&e.showWaterEffect,P=e.oceanNormalMap,M=v&&c(P),R=e.terrainProvider,L=c(R)&&e.terrainProvider.hasVertexNormals,B=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,w=Tn.castShadows(e.shadows)&&!h,D=Tn.receiveShadows(e.shadows)&&!h,I=e.hueShift,N=e.saturationShift,k=e.brightnessShift,H=!(O.equalsEpsilon(I,0,O.EPSILON7)&&O.equalsEpsilon(N,0,O.EPSILON7)&&O.equalsEpsilon(k,0,O.EPSILON7)),V=!1;if(_){let _e=d.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;V=_e>Ce}S&&--s,M&&--s,c(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,c(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,c(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,U=j.center,q=j.encoding,X=i.tileBoundingRegion,te=n.verticalExaggeration,K=n.verticalExaggerationRelativeHeight,Z=te!==1,ee=q.hasGeodeticSurfaceNormals,me=gct,xe=0,ue=0,ye=0,Ae=0,Pe=!1;if(n.mode!==oe.SCENE3D){let _e=n.mapProjection,Ce=_e.project(ce.southwest(t.rectangle),Tct),mn=_e.project(ce.northeast(t.rectangle),Act);if(me.x=Ce.x,me.y=Ce.y,me.z=mn.x,me.w=mn.y,n.mode!==oe.MORPHING&&(U=xct,U.x=0,U.y=(me.z+me.x)*.5,U.z=(me.w+me.y)*.5,me.x-=U.y,me.y-=U.z,me.z-=U.y,me.w-=U.z),n.mode===oe.SCENE2D&&q.quantization===pa.BITS12){let mt=1/(Math.pow(2,12)-1)*.5,to=(me.z-me.x)*mt,So=(me.w-me.y)*mt;me.x-=to,me.y-=So,me.z+=to,me.w+=So}_e instanceof Li&&(xe=t.rectangle.south,ue=t.rectangle.north,ye=Li.geodeticLatitudeToMercatorAngle(xe),Ae=1/(Li.geodeticLatitudeToMercatorAngle(ue)-ye),Pe=!0)}let Ee=Oct;Ee.frameState=n,Ee.surfaceTile=i,Ee.hasWaterMask=S,Ee.showReflectiveOcean=v,Ee.showOceanWaves=M,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=_,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=V,Ee.hasVertexNormals=L,Ee.useWebMercatorProjection=Pe,Ee.clippedByBoundaries=i.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=ee,Ee.hasExaggeration=Z;let Ve=i.imagery,je=0,it=Ve.length,Dt=e.showSkirts&&!u&&!h,Gt=e.backFaceCulling&&!u&&!h,$e=Gt?e._renderState:e._disableCullingRenderState,ln=Gt?e._blendRenderState:e._disableCullingBlendRenderState,Vt=$e,Ct=e._firstPassInitialColor,gi=n.context;if(c(e._debug.boundingSphereTile)||az(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let _e=e._drawCommands.length;for(let Ce=0;Ce<_e;++Ce)e._uniformMaps[Ce]=kge(n,e)}do{let _e=0,Ce,mn;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new Je,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new le,Ce.orientedBoundingBox=void 0,mn=kge(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(mn)):(Ce=e._drawCommands[e._usedDrawCommands],mn=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Zs=X.boundingVolume,rl=X.boundingSphere;c(Zs)?Hge(Zs,G.RED).update(n):c(rl)&&Gge(rl,G.RED).update(n)}let mt=mn.properties;se.clone(Ct,mt.initialColor),mt.oceanNormalMap=P,mt.lightingFadeDistance.x=e.lightingFadeOutDistance,mt.lightingFadeDistance.y=e.lightingFadeInDistance,mt.nightFadeDistance.x=e.nightFadeOutDistance,mt.nightFadeDistance.y=e.nightFadeInDistance,mt.atmosphereLightIntensity=e.atmosphereLightIntensity,mt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,mt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,mt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,mt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,mt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,mt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let to=u?g:p,So=u?p:g;c(to)&&(se.fromElements(to.near,to.nearValue,to.far,to.farValue,mt.frontFaceAlphaByDistance),se.fromElements(So.near,So.nearValue,So.far,So.farValue,mt.backFaceAlphaByDistance)),se.fromElements(b.near,b.nearValue,b.far,b.farValue,mt.undergroundColorAlphaByDistance),G.clone(y,mt.undergroundColor),mt.lambertDiffuseMultiplier=A,mt.vertexShadowDarkness=E;let Ks=!c(i.vertexArray)&&c(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ks&&G.clone(e.fillHighlightColor,mt.fillHighlightColor),mt.verticalExaggerationAndRelativeHeight.x=te,mt.verticalExaggerationAndRelativeHeight.y=K,mt.center3D=j.center,d.clone(U,mt.rtc),se.clone(me,mt.tileRectangle),mt.southAndNorthLatitude.x=xe,mt.southAndNorthLatitude.y=ue,mt.southMercatorYAndOneOverHeight.x=ye,mt.southMercatorYAndOneOverHeight.y=Ae;let vr=yct,ps=sz(t.rectangle,e.cartographicLimitRectangle),Ne=bct,ot=sz(t.rectangle,m);d.fromElements(I,N,k,mt.hsbShift);let Xe=t.rectangle,Ze=1/Xe.width,pt=1/Xe.height;vr.x=(ps.west-Xe.west)*Ze,vr.y=(ps.south-Xe.south)*pt,vr.z=(ps.east-Xe.west)*Ze,vr.w=(ps.north-Xe.south)*pt,se.clone(vr,mt.localizedCartographicLimitRectangle),Ne.x=(ot.west-Xe.west)*Ze,Ne.y=(ot.south-Xe.south)*pt,Ne.z=(ot.east-Xe.west)*Ze,Ne.w=(ot.north-Xe.south)*pt,se.clone(Ne,mt.localizedTranslucencyRectangle);let Ht=B&&O.fog(t._distance,n.fog.density)>O.EPSILON3;H=H&&(Ht||_);let bn=!1,wo=!1,yo=!1,ka=!1,Ua=!1,yi=!1,hi=!1,$s=!1,Hr=!1,ol=!1;for(;_e<s&&je<it;){let Zs=Ve[je],rl=Zs.readyImagery;if(++je,!c(rl)||rl.imageryLayer.alpha===0)continue;let za=Zs.useWebMercatorT?rl.textureWebMercator:rl.texture;if(!c(za))throw new C("readyImagery is not actually ready!");let es=rl.imageryLayer;c(Zs.textureTranslationAndScale)||(Zs.textureTranslationAndScale=es._calculateTextureTranslationAndScale(t,Zs)),mt.dayTextures[_e]=za,mt.dayTextureTranslationAndScale[_e]=Zs.textureTranslationAndScale,mt.dayTextureTexCoordsRectangle[_e]=Zs.textureCoordinateRectangle,mt.dayTextureUseWebMercatorT[_e]=Zs.useWebMercatorT,mt.dayTextureAlpha[_e]=es.alpha,yi=yi||mt.dayTextureAlpha[_e]!==1,mt.dayTextureNightAlpha[_e]=es.nightAlpha,hi=hi||mt.dayTextureNightAlpha[_e]!==1,mt.dayTextureDayAlpha[_e]=es.dayAlpha,hi=hi||mt.dayTextureDayAlpha[_e]!==1,mt.dayTextureBrightness[_e]=es.brightness,bn=bn||mt.dayTextureBrightness[_e]!==mc.DEFAULT_BRIGHTNESS,mt.dayTextureContrast[_e]=es.contrast,wo=wo||mt.dayTextureContrast[_e]!==mc.DEFAULT_CONTRAST,mt.dayTextureHue[_e]=es.hue,yo=yo||mt.dayTextureHue[_e]!==mc.DEFAULT_HUE,mt.dayTextureSaturation[_e]=es.saturation,ka=ka||mt.dayTextureSaturation[_e]!==mc.DEFAULT_SATURATION,mt.dayTextureOneOverGamma[_e]=1/es.gamma,Ua=Ua||mt.dayTextureOneOverGamma[_e]!==1/mc.DEFAULT_GAMMA,mt.dayTextureSplit[_e]=es.splitDirection,$s=$s||mt.dayTextureSplit[_e]!==0;let Hu=mt.dayTextureCutoutRectangles[_e];if(c(Hu)||(Hu=mt.dayTextureCutoutRectangles[_e]=new se),se.clone(se.ZERO,Hu),c(es.cutoutRectangle)){let Oo=sz(Xe,es.cutoutRectangle),cn=ce.simpleIntersection(Oo,Xe,Vge);Hr=c(cn)||Hr,Hu.x=(Oo.west-Xe.west)*Ze,Hu.y=(Oo.south-Xe.south)*pt,Hu.z=(Oo.east-Xe.west)*Ze,Hu.w=(Oo.north-Xe.south)*pt}let Gu=mt.colorsToAlpha[_e];c(Gu)||(Gu=mt.colorsToAlpha[_e]=new se);let ju=c(es.colorToAlpha)&&es.colorToAlphaThreshold>0;if(ol=ol||ju,ju){let Oo=es.colorToAlpha;Gu.x=Oo.red,Gu.y=Oo.green,Gu.z=Oo.blue,Gu.w=es.colorToAlphaThreshold}else Gu.w=-1;if(c(rl.credits)){let Oo=rl.credits;for(let cn=0,Se=Oo.length;cn<Se;++cn)o.addCreditToNextFrame(Oo[cn])}++_e}mt.dayTextures.length=_e,mt.waterMask=a,se.clone(l,mt.waterMaskTranslationAndScale),mt.minMaxHeight.x=q.minimumHeight,mt.minMaxHeight.y=q.maximumHeight,F.clone(q.matrix,mt.scaleAndBias);let ho=e._clippingPlanes,Dr=c(ho)&&ho.enabled&&t.isClipped;Dr&&(mt.clippingPlanesEdgeColor=G.clone(ho.edgeColor,mt.clippingPlanesEdgeColor),mt.clippingPlanesEdgeWidth=ho.edgeWidth);let tp=e._clippingPolygons,Gr=c(tp)&&tp.enabled&&t.isClipped;Ee.numberOfDayTextures=_e,Ee.applyBrightness=bn,Ee.applyContrast=wo,Ee.applyHue=yo,Ee.applySaturation=ka,Ee.applyGamma=Ua,Ee.applyAlpha=yi,Ee.applyDayNightAlpha=hi,Ee.applySplit=$s,Ee.enableFog=Ht,Ee.enableClippingPlanes=Dr,Ee.clippingPlanes=ho,Ee.enableClippingPolygons=Gr,Ee.clippingPolygons=tp,Ee.hasImageryLayerCutout=Hr,Ee.colorCorrect=H,Ee.highlightFillTile=Ks,Ee.colorToAlpha=ol,Ee.showUndergroundColor=x,Ee.translucent=h;let zu=i.renderedMesh.indices.length;Dt||(zu=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),Ce.castShadows=w,Ce.receiveShadows=D,Ce.renderState=Vt,Ce.primitiveType=Me.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=zu,Ce.uniformMap=mn,Ce.pass=De.GLOBE,e._debug.wireframe&&(Dct(gi,e,t),c(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Me.LINES,Ce.count=zu*2));let Va=Ce.boundingVolume,S0=Ce.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,X.minimumHeight,X.maximumHeight,Va),d.fromElements(Va.center.z,Va.center.x,Va.center.y,Va.center),n.mode===oe.MORPHING&&(Va=le.union(X.boundingSphere,Va,Va))):(Ce.boundingVolume=le.clone(X.boundingSphere,Va),Ce.orientedBoundingBox=Pn.clone(X.boundingVolume,S0)),Ce.dirty=!0,h&&f.updateDerivedCommands(Ce,n),Uge(Ce,n),Vt=ln,Ct=Ict}while(je<it)}var cz=er;function jge(){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(jge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){T.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new C("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new C("far distance must be greater than near distance.");this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){c(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var lz=jge;function Ds(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(Ds.prototype,{length:{get:function(){return this._layers.length}}});Ds.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new C("layer is required.");if(n){if(t<0)throw new C("index must be greater than or equal to zero.");if(t>this._layers.length)throw new C("index must be less than or equal to the number of layers.")}n?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()})};Ds.prototype.addImageryProvider=function(e,t){if(!c(e))throw new C("imageryProvider is required.");let n=new mc(e);return this.add(n,t),n};Ds.prototype.remove=function(e,t){t=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};Ds.prototype.removeAll=function(e){e=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=[]};Ds.prototype.contains=function(e){return this.indexOf(e)!==-1};Ds.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ds.prototype.get=function(e){if(!c(e))throw new C("index is required.","index");return this._layers[e]};function uz(e,t){if(!c(t))throw new C("layer is required.");let n=e.indexOf(t);if(n===-1)throw new C("layer is not in this collection.");return n}function Wge(e,t,n){let i=e._layers;if(t=O.clamp(t,0,i.length-1),n=O.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)}Ds.prototype.raise=function(e){let t=uz(this._layers,e);Wge(this,t,t+1)};Ds.prototype.lower=function(e){let t=uz(this._layers,e);Wge(this,t,t-1)};Ds.prototype.raiseToTop=function(e){let t=uz(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))};Ds.prototype.lowerToBottom=function(e){let t=uz(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 Nct=new ce;function qge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!c(r)&&a<o.length;++a){let l=o[a];ce.contains(l.rectangle,t)&&(r=l)}if(!c(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let l=s[a],u=l.readyImagery;if(!c(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!c(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=Nct,p=1/1024;h.west=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.x-p),h.east=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.z+p),h.south=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.y-p),h.north=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(u)}}Ds.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(qge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ds.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(qge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let l=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);c(l)&&(o.push(l),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let l=0;l<s.length;++l){let u=s[l],f=r[l];if(c(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,c(p.position)||(p.position=i),a.push(p)}}return a})};Ds.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ds.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ds.prototype.isDestroyed=function(){return!1};Ds.prototype.destroy=function(){return this.removeAll(!0),de(this)};Ds.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&&(c(i._show)&&(c(n)||(n=[]),n.push(i)),i._show=i.show);if(c(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var fz=Ds;function Yge(e){this._ellipsoid=new cy(e.ellipsoid,d.ZERO)}Object.defineProperties(Yge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var dz=Yge;var sX=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}clear(){this.cache.clear()}},Fct=1e3;function Ws(e){if(!c(e))throw new C("options is required.");if(c(e.x))if(c(e.y)){if(e.x<0||e.y<0)throw new C("options.x and options.y must be greater than or equal to zero.")}else throw new C("options.y is required.");else throw new C("options.x is required.");if(!c(e.level))throw new C("options.level is required and must be greater than or equal to zero.");if(!c(e.tilingScheme))throw new C("options.tilingScheme is required.");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=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new sX(Fct),this.state=_a.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Ws.createLevelZeroTiles=function(e){if(!c(e))throw new C("tilingScheme is required.");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 Ws({tilingScheme:e,x:s,y:r,level:0});return i};var Bct=256;function kct(e,t,n,i){let o=n.width/Bct*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}Ws.prototype._getCacheKey=function(e,t){return kct(e.longitude,e.latitude,this._rectangle,t)};Ws.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};Ws.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};Ws.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};Ws.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(c(t)&&c(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(c(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let l=a.customData;for(o=0;o<l.length;++o)r=l[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Ws.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 c(this._southwestChild)||(this._southwestChild=new Ws({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return c(this._southeastChild)||(this._southeastChild=new Ws({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 c(this._northwestChild)||(this._northwestChild=new Ws({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return c(this._northeastChild)||(this._northeastChild=new Ws({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<_a.DONE}},eligibleForUnloading:{get:function(){let e=!0;return c(this.data)&&(e=this.data.eligibleForUnloading,c(e)||(e=!0)),e}}});Ws.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]};Ws.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};Ws.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};Ws.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};Ws.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};Ws.prototype.freeResources=function(){this.clearPositionCache(),this.state=_a.START,this.renderable=!1,this.upsampledFromParent=!1,c(this.data)&&c(this.data.freeResources)&&this.data.freeResources(),hz(this._southwestChild),this._southwestChild=void 0,hz(this._southeastChild),this._southeastChild=void 0,hz(this._northwestChild),this._northwestChild=void 0,hz(this._northeastChild),this._northeastChild=void 0};function hz(e){c(e)&&e.freeResources()}var mz=Ws;function pz(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}pz.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};pz.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&c(this._lastBeforeStartOfFrame)&&this.count>e&&c(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Xge(this,t)),t=i}};function Xge(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}pz.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!c(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(c(e.replacementPrevious)||c(e.replacementNext))&&Xge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var _z=pz;function qf(e){if(!c(e)||!c(e.tileProvider))throw new C("options.tileProvider is required.");if(c(e.tileProvider.quadtree))throw new C("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");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 _z,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=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new dz({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(qf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});qf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Uct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,$ge(e);let n=e._levelZeroTiles;if(c(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 l=r[a];l.level=0,e._addHeightCallbacks.push(l)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}qf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;c(t);)t.state!==_a.START&&e(t),t=t.replacementNext};qf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};qf.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};qf.prototype.update=function(e){c(this._tileProvider.update)&&this._tileProvider.update(e)};function $ge(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}qf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Uct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),$ge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};qf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Gct(this,e),Jct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Vct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.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))}qf.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(Kct(this,e),Qct(this,e),Vct(this,e))};qf.prototype.isDestroyed=function(){return!1};qf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var JP,Kge=new he;function zct(e,t){let n=ce.center(e.rectangle,Kge),i=n.longitude-JP.longitude,o=n.latitude-JP.latitude;n=ce.center(t.rectangle,Kge);let r=n.longitude-JP.longitude,s=n.latitude-JP.latitude;return i*i+o*o-(r*r+s*s)}var Hct=new d,QP=[];function Gct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!c(e._levelZeroTiles)){let y=r.tilingScheme;if(c(y)){let b=r.tilingScheme;e._levelZeroTiles=mz.createLevelZeroTiles(b);let x=e._levelZeroTiles.length;if(QP.length<x)for(QP=new Array(x),o=0;o<x;++o)QP[o]===void 0&&(QP[o]=new eI)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,l=a.length>1?e._occluders:void 0;JP=t.camera.positionCartographic,a.sort(zct);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,h=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=F.getTranslation(g.transform,Hct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?La(e,s,r,t,l,!1,QP[o]):(x_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function x_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function eI(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Zge(){this.southwest=new eI,this.southeast=new eI,this.northwest=new eI,this.northeast=new eI}Zge.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 cX=new Array(31);for(let e=0;e<cX.length;++e)cX[e]=new Zge;function jct(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=Yct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,l=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Yn.NONE,g=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,y=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===_a.DONE,x=m||y||b;if(x||c(g.canRenderWithoutLosingDetail)&&(x=g.canRenderWithoutLosingDetail(n)),x){s&&x_(e,e._tileLoadQueueMedium,n,t),gz(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&x_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&l.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){gz(e,n),x_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let y=e._tilesToRender.length,b=e._tileLoadQueueLow.length,x=e._tileLoadQueueMedium.length,A=e._tileLoadQueueHigh.length,E=e._tileToUpdateHeights.length;if(Wct(e,a,l,u,f,t,i,o),y!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,P=o.notYetRenderableCount,M=!1;if(!S&&!v){let R=e._tilesToRender;for(let B=y;B<R.length;++B){let _=R[B];for(;_!==void 0&&_._lastSelectionResult!==Yn.KICKED&&_!==n;)_._lastSelectionResult=Yn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=E,gz(e,n),n._lastSelectionResult=Yn.RENDERED;let L=p===Yn.RENDERED;!L&&P>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=x,e._tileLoadQueueHigh.length=A,x_(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,M=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!M&&x_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,gz(e,n),x_(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Wct(e,t,n,i,o,r,s,a){let l=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=cX[t.level],p=h.southwest,g=h.southeast,m=h.northwest,y=h.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(La(e,t,u,r,f,s,p),La(e,n,u,r,f,s,g),La(e,i,u,r,f,s,m),La(e,o,u,r,f,s,y)):(La(e,i,u,r,f,s,m),La(e,t,u,r,f,s,p),La(e,o,u,r,f,s,y),La(e,n,u,r,f,s,g)):l.latitude<t.rectangle.north?(La(e,n,u,r,f,s,g),La(e,t,u,r,f,s,p),La(e,o,u,r,f,s,y),La(e,i,u,r,f,s,m)):(La(e,o,u,r,f,s,y),La(e,i,u,r,f,s,m),La(e,n,u,r,f,s,g),La(e,t,u,r,f,s,p)),h.combine(a)}function qct(e,t){let n=t.rectangle;return c(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||c(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function La(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Sr.NONE)return jct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,qct(e,t)){(!c(t.data)||!c(t.data.vertexArray))&&x_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;l!==Yn.CULLED_BUT_NEEDED&&l!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(x_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Yct(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof on||t.camera.frustum instanceof jo)return Xct(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-=O.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Xct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;c(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,l=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,l),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=O.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function gz(e,t){e._tilesToRender.push(t)}function Kct(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=Ei()+e._loadQueueTimeSlice,s=e._tileProvider,a=aX(e,t,s,r,n,!1);a=aX(e,t,s,r,i,a),aX(e,t,s,r,o,a)}function $ct(e,t){return e._loadPriority-t._loadPriority}function aX(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort($ct);for(let s=0,a=o.length;s<a&&(Ei()<i||!r);++s){let l=o[s];e._tileReplacementQueue.markTileRendered(l),n.loadTile(t,l),r=!0}return r}var zE=new _n,yz=new he,$y=new d,Zct=[];function Qct(e,t){if(!c(e.tileProvider.tilingScheme))return;let n=Zct;n.length=0;let i=e._tileToUpdateHeights,o=Ei(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,l=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!c(h.data)||!c(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Yn.NONE;(y===Yn.RENDERED||y===Yn.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let y=p[f],b=h.data.terrainData,x=c(b)&&b.wasCreatedByUpsampling();if(h.level>y.level&&!x){let A,E=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(c(E))A=E;else{if(c(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=d.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),a===oe.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,zE.direction),v=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,zE.origin);if(!c(v)){let P=0;c(h.data.tileBoundingRegion)&&(P=h.data.tileBoundingRegion.minimumHeight);let M=Math.min(P,-11500),R=d.multiplyByScalar(S,Math.abs(M)+1,$y);d.subtract(y.positionOnEllipsoidSurface,R,zE.origin)}}else he.clone(y.positionCartographic,yz),yz.height=-11500,l.project(yz,$y),d.fromElements($y.z,$y.x,$y.y,$y),d.clone($y,zE.origin),d.clone(d.UNIT_X,zE.direction);A=h.data.pick(zE,a,l,!1,$y),c(A)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,A)}if(c(A)){if(c(y.callback)){let S=u.cartesianToCartographic(A,yz);y.callback(S)}y.level=h.level}}if(Ei()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Jct(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 bz=qf;function ah(e){e=e??ie.default;let t=new b_({ellipsoid:e}),n=new fz;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new NV,this._material=void 0,this._surface=new bz({tileProvider:new cz({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=G.clone(G.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new lz,uX(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new we({url:tn("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=ie.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=O.PI*e.minimumRadius,this.nightFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*O.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(ah.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 c(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){c(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),c(this._material)&&uX(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,uX(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=G.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new C("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function uX(e){let t=[],n=c(e._material)&&(c(e._material.shaderSource.match(/slope/))||c(e._material.shaderSource.match("normalEC"))),i=[Qh,kP];c(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(gV),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[Qh,kP,yV],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function elt(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var tlt=[],nlt={start:0,stop:0};ah.prototype.pickWorldCoordinates=function(e,t,n,i){if(!c(e))throw new C("ray is required");if(!c(t))throw new C("scene is required");n=n??!0;let o=t.mode,r=t.mapProjection,s=tlt;s.length=0;let a=this._surface._tilesToRender,l=a.length,u,f;for(f=0;f<l;++f){u=a[f];let p=u.data;if(!c(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),d.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(c(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=Qn.raySphere(e,g,nlt);c(m)&&s.push(p)}s.sort(elt(e.origin));let h;for(l=s.length,f=0;f<l&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!c(h));++f);return h};var ilt=new he;ah.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),c(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,ilt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var olt=new d,Qge=new d,rlt=new he,slt=new _n;function lX(e,t){return c(e)&&ce.contains(e.rectangle,t)?e:void 0}ah.prototype.getHeight=function(e){if(!c(e))throw new C("cartographic is required");let t=this._surface._levelZeroTiles;if(!c(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(;c(n);)n=lX(n._southwestChild,e)||lX(n._southeastChild,e)||lX(n._northwestChild,e)||n._northeastChild,c(n)&&c(n.data)&&c(n.data.renderedMesh)&&(r=n);if(n=r,!c(n)||!c(n.data)||!c(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,l=d.fromRadians(e.longitude,e.latitude,0,a,olt),u=slt,f=a.geodeticSurfaceNormal(l,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(l,11500,u.origin);if(!c(h)){let g;c(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=d.multiplyByScalar(f,Math.abs(m)+1,Qge);d.subtract(l,y,u.origin)}let p=n.data.pick(u,void 0,s,!1,Qge);if(c(p))return a.cartesianToCartographic(p,rlt).height};ah.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};ah.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=c(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,l=a.url;if(c(l)){let u=this;a.fetchImage().then(function(f){l===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Rt({context:e.context,source:f}))})}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))};ah.prototype.render=function(e){this.show&&(c(this._material)&&this._material.update(e.context),this._surface.render(e))};ah.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};ah.prototype.isDestroyed=function(){return!1};ah.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(),de(this)};var xz=ah;function alt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Tz=alt;var dye={},clt=32.184,llt=2451545,Jge=-.0529921,eye=-.1059842,tye=13.0120009,nye=13.3407154,iye=.9856003,oye=26.4057084,rye=13.064993,sye=.3287146,aye=1.7484877,cye=-.1589763,lye=.0036096,uye=.1643573,fye=12.9590088,fX=new Q;dye.ComputeMoon=function(e,t){c(e)||(e=Q.now()),fX=Q.addSeconds(e,clt,fX);let n=Q.totalDays(fX)-llt,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Jge*n)*O.RADIANS_PER_DEGREE,r=(250.089+eye*n)*O.RADIANS_PER_DEGREE,s=(260.008+tye*n)*O.RADIANS_PER_DEGREE,a=(176.625+nye*n)*O.RADIANS_PER_DEGREE,l=(357.529+iye*n)*O.RADIANS_PER_DEGREE,u=(311.589+oye*n)*O.RADIANS_PER_DEGREE,f=(134.963+rye*n)*O.RADIANS_PER_DEGREE,h=(276.617+sye*n)*O.RADIANS_PER_DEGREE,p=(34.226+aye*n)*O.RADIANS_PER_DEGREE,g=(15.134+cye*n)*O.RADIANS_PER_DEGREE,m=(119.743+lye*n)*O.RADIANS_PER_DEGREE,y=(239.961+uye*n)*O.RADIANS_PER_DEGREE,b=(25.053+fye*n)*O.RADIANS_PER_DEGREE,x=Math.sin(o),A=Math.sin(r),E=Math.sin(s),S=Math.sin(a),v=Math.sin(l),P=Math.sin(u),M=Math.sin(f),R=Math.sin(h),L=Math.sin(p),B=Math.sin(g),_=Math.sin(m),w=Math.sin(y),D=Math.sin(b),I=Math.cos(o),N=Math.cos(r),k=Math.cos(s),H=Math.cos(a),V=Math.cos(l),j=Math.cos(u),U=Math.cos(f),q=Math.cos(h),X=Math.cos(p),te=Math.cos(g),K=Math.cos(m),Z=Math.cos(y),ee=Math.cos(b),me=(269.9949+.0031*i-3.8787*x-.1204*A+.07*E-.0172*S+.0072*P-.0052*B+.0043*D)*O.RADIANS_PER_DEGREE,xe=(66.5392+.013*i+1.5419*I+.0239*N-.0278*k+.0068*H-.0029*j+9e-4*U+8e-4*te-9e-4*ee)*O.RADIANS_PER_DEGREE,ue=(38.3213+13.17635815*n-14e-13*n*n+3.561*x+.1208*A-.0642*E+.0158*S+.0252*v-.0066*P-.0047*M-.0046*R+.0028*L+.0052*B+.004*_+.0019*w-.0044*D)*O.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*Jge+.1208*N*eye-.0642*k*tye+.0158*H*nye+.0252*V*iye-.0066*j*oye-.0047*U*rye-.0046*q*sye+.0028*X*aye+.0052*te*cye+.004*K*lye+.0019*Z*uye-.0044*ee*fye)/86400*O.RADIANS_PER_DEGREE;return c(t)||(t=new Tz),t.rightAscension=me,t.declination=xe,t.rotation=ue,t.rotationRate=ye,t};var Az=dye;function hye(e){(!c(e)||typeof e!="function")&&(e=Az.ComputeMoon),this._computeFunction=e}var ult=new d,flt=new d,dlt=new d;function hlt(e,t,n){let i=ult;i.x=Math.cos(e+O.PI_OVER_TWO),i.y=Math.sin(e+O.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=dlt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,flt);return c(n)||(n=new J),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 mlt=new J,plt=new Le;hye.prototype.evaluate=function(e,t){c(e)||(e=Q.now());let n=this._computeFunction(e),i=hlt(n.rightAscension,n.declination,t),o=O.zeroToTwoPi(n.rotation),r=Le.fromAxisAngle(d.UNIT_Z,o,plt),s=J.fromQuaternion(Le.conjugate(r,r),mlt);return J.multiply(s,i,i)};var Cz=hye;var dX={position:0};function Ez(e){e=e??W.EMPTY_OBJECT,this.center=d.clone(e.center??d.ZERO),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new le,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=e.show??!0,this.material=e.material??Xi.fromType(Xi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=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 Je({owner:e._owner??this}),this._pickCommand=new Je({owner: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 _lt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(c(t))return t;let n=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:dX,bufferUsage:Be.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}Ez.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!c(this.center)||!c(this.radii))return;if(!c(this.material))throw new C("this.material must be defined.");let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!c(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),c(this._va)||(this._va=_lt(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.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 l=e.useLogDepth,u=this._useLogDepth!==l;this._useLogDepth=l;let f=this._colorCommand,h,p;(s||a||i||u)&&(h=new He({sources:[BP]}),p=new He({sources:[this.material.shaderSource,FP]}),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=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:dX}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=xt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!c(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||!c(this._pickSP)||u)&&(h=new He({sources:[BP]}),p=new He({sources:[this.material.shaderSource,FP],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=en.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:dX}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(y)}};Ez.prototype.isDestroyed=function(){return!1};Ez.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(),de(this)};var Sz=Ez;function tI(e){e=e??W.EMPTY_OBJECT;let t=e.textureUrl;c(t)||(t=tn("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ie.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Sz({radii:this.ellipsoid.radii,material:Xi.fromType(Xi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Cz}Object.defineProperties(tI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var wz=new J,glt=new J,ylt=new d,vz=[];tI.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;c(Ot.computeIcrfToFixedMatrix(n,wz))||Ot.computeTemeToPseudoFixedMatrix(n,wz);let i=this._axes.evaluate(n,glt);J.transpose(i,i),J.multiply(wz,i,i);let o=z0.computeMoonPositionInEarthInertialFrame(n,ylt);J.multiplyByVector(wz,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=vz,vz.length=0,t.update(e),e.commandList=r,vz.length===1?vz[0]:void 0};tI.prototype.isDestroyed=function(){return!1};tI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),de(this)};var Dz=tI;var hX=[],mX=[];function blt(e,t,n,i,o,r){let s=o-i+1,a=r-o,l=hX,u=mX,f,h;for(f=0;f<s;++f)l[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let g=l[f],m=u[h];f<s&&(h>=a||t(g,m,n)<=0)?(e[p]=g,++f):h<a&&(e[p]=m,++h)}}function pX(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);pX(e,t,n,i,r),pX(e,t,n,r+1,o),blt(e,t,n,i,r,o)}function xlt(e,t,n){if(!c(e))throw new C("array is required.");if(!c(t))throw new C("comparator is required.");let i=e.length,o=Math.ceil(i*.5);hX.length=o,mX.length=o,pX(e,t,n,0,i-1),hX.length=0,mX.length=0}var Zy=xlt;function pc(e,t){if(!c(e))throw new C("occluderBoundingSphere is required.");if(!c(t))throw new C("camera position is required.");this._occluderPosition=d.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 Pz=new d;Object.defineProperties(pc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!c(e))throw new C("cameraPosition is required.");e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,Pz),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,Pz);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,Pz),Pz)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});pc.fromBoundingSphere=function(e,t,n){if(!c(e))throw new C("occluderBoundingSphere is required.");if(!c(t))throw new C("camera position is required.");return c(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new pc(e,t)};var pye=new d;pc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,pye),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var Tlt=new d;pc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,Tlt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,pye),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.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 Alt=new d;pc.prototype.computeVisibility=function(e){if(!c(e))throw new C("occludeeBS is required.");let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Sr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,Alt),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let s=d.magnitudeSquared(i);return o*o+n*n<s?Sr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Sr.FULL:Sr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?Sr.PARTIAL:Sr.FULL))}}return Sr.NONE};var Iz=new d;pc.computeOccludeePoint=function(e,t,n){if(!c(e))throw new C("occluderBoundingSphere is required.");if(!c(n))throw new C("positions is required.");if(n.length===0)throw new C("positions must contain at least one element");let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length;if(d.equals(o,t))throw new C("occludeePosition must be different than occluderBoundingSphere.center");let a=d.normalize(d.subtract(i,o,Iz),Iz),l=-d.dot(a,o),u=pc._anyRotationVector(o,a,l),f=pc._horizonToPlaneNormalDotProduct(e,a,l,u,n[0]);if(!f)return;let h;for(let g=1;g<s;++g){if(h=pc._horizonToPlaneNormalDotProduct(e,a,l,u,n[g]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(a,p,Iz),Iz)};var Clt=[];pc.computeOccludeePointFromRectangle=function(e,t){if(!c(e))throw new C("rectangle is required.");t=t??ie.default;let n=ce.subsample(e,t,0,Clt),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return pc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var Elt=new d;pc._anyRotationVector=function(e,t,n){let i=d.abs(t,Elt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var Slt=new d;pc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,Slt);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>O.EPSILON13)return d.normalize(s,new d)}return o};var _X=new d,wlt=new d,Oz=new d,mye=new d;pc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,_X),s=d.clone(e.center,wlt),a=e.radius,l=d.subtract(s,r,Oz),u=d.magnitudeSquared(l),f=a*a;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),b=p*m*p;l=d.normalize(l,l);let x=d.add(r,d.multiplyByScalar(l,b,mye),mye),A=Math.sqrt(h-b*b),E=this._rotationVector(s,t,n,r,i),S=d.fromElements(E.x*E.x*l.x+(E.x*E.y-E.z)*l.y+(E.x*E.z+E.y)*l.z,(E.x*E.y+E.z)*l.x+E.y*E.y*l.y+(E.y*E.z-E.x)*l.z,(E.x*E.z-E.y)*l.x+(E.y*E.z+E.x)*l.y+E.z*E.z*l.z,_X);S=d.normalize(S,S);let v=d.multiplyByScalar(S,A,_X);E=d.normalize(d.subtract(d.add(x,v,Oz),s,Oz),Oz);let P=d.dot(t,E);E=d.normalize(d.subtract(d.subtract(x,v,E),s,E),E);let M=d.dot(t,E);return P<M?P:M};var Rz=pc;function zm(e){e=e??W.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ys,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function gX(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new C("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;if(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective)}}Object.defineProperties(zm.prototype,{projectionMatrix:{get:function(){return gX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return gX(this),this._infinitePerspective}}});var vlt=new d,Dlt=new d,Plt=new d,Ilt=new d;zm.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new C("position is required.");if(!c(t))throw new C("direction is required.");if(!c(n))throw new C("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,vlt),h=Dlt;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=Plt;d.multiplyByScalar(t,u,p),d.add(e,p,p);let g=Ilt;d.multiplyByScalar(f,a,g),d.add(h,g,g),d.subtract(g,e,g),d.normalize(g,g),d.cross(g,n,g),d.normalize(g,g);let m=i[0];return c(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(f,s,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(n,g,g),d.normalize(g,g),m=i[1],c(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,r,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(f,g,g),d.normalize(g,g),m=i[2],c(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,o,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(g,f,g),d.normalize(g,g),m=i[3],c(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),m=i[4],c(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,g),m=i[5],c(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,p),this._cullingVolume};zm.prototype.getPixelDimensions=function(e,t,n,i,o){if(gX(this),!c(e)||!c(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!c(n))throw new C("distance is required.");if(!c(i))throw new C("pixelRatio is required");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!c(o))throw new C("A result object is required.");let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let l=2*i*n*s/e;return o.x=l,o.y=a,o};zm.prototype.clone=function(e){return c(e)||(e=new zm),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};zm.prototype.equals=function(e){return c(e)&&e instanceof zm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};zm.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof zm&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var zl=zm;function Hl(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new zl,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}Hl.packedLength=6;Hl.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=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};Hl.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Hl),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 ch(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new C("fov, aspectRatio, near, or far parameters are not set.");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;if(T.typeOf.number.greaterThanOrEquals("fov",e.fov,0),T.typeOf.number.lessThan("fov",e.fov,Math.PI),T.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),T.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new C("near must be less than far.");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(Hl.prototype,{projectionMatrix:{get:function(){return ch(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ch(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ch(this),this._fovy}},sseDenominator:{get:function(){return ch(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ch(this),this._offCenterFrustum}}});Hl.prototype.computeCullingVolume=function(e,t,n){return ch(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Hl.prototype.getPixelDimensions=function(e,t,n,i,o){return ch(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Hl.prototype.clone=function(e){return c(e)||(e=new Hl),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};Hl.prototype.equals=function(e){return!c(e)||!(e instanceof Hl)?!1:(ch(this),ch(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Hl.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof Hl)?!1:(ch(this),ch(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var wi=Hl;function nI(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(nI.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Olt(e,t,n){let i=t.createViewportQuadCommand(aV,{framebuffer:n,renderState:ze.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}nI.prototype.update=function(e){if(!c(this._colorTexture)){let t=e.context,n=new Rt({context:t,width:256,height:256,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST});this._colorTexture=n;let i=new Wr({context:t,colorTextures:[n],destroyAttachments:!1});Olt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};nI.prototype.isDestroyed=function(){return!1};nI.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),de(this)};var Mz=nI;var bye={};function Rlt(e,t,n){let i,o,r;if(e instanceof wi){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 zl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Mlt=new d,_ye=new d;function xye(e,t,n,i){if(c(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,l=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return O.lerp(e,-O.PI_OVER_TWO,p)}let h=(f-r)/l;return O.lerp(-O.PI_OVER_TWO,t,1-h)}}return function(o){return O.lerp(e,t,o)}}function bX(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!c(r)){let a=e.position,l=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(a,l,Mlt),g=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),_ye)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),_ye));r=Math.min(Rlt(h,g,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return O.lerp(n,i,a)}}function iI(e,t){return O.equalsEpsilon(e,O.TWO_PI,O.EPSILON11)&&(e=0),t>e+Math.PI?e+=O.TWO_PI:t<e-Math.PI&&(e-=O.TWO_PI),e}var Tye=new d;function Llt(e,t,n,i,o,r,s,a){let l=e.camera,u=d.clone(l.position,Tye),f=l.pitch,h=iI(l.heading,i),p=iI(l.roll,r),g=bX(l,n,u.z,n.z,s),m=xye(f,o,g,a);function y(b){let x=b.time/t;l.setView({orientation:{heading:O.lerp(h,i,x),pitch:m(x),roll:O.lerp(p,r,x)}}),z.lerp(u,n,x,l.position),l.position.z=g(x)}return y}function Nlt(e,t){e.longitude<t.longitude?e.longitude+=O.TWO_PI:t.longitude+=O.TWO_PI}function Flt(e,t){let n=e.longitude-t.longitude;n<-O.PI?e.longitude+=O.TWO_PI:n>O.PI&&(t.longitude+=O.TWO_PI)}var Blt=new he,klt=new he;function Ult(e,t,n,i,o,r,s,a,l,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,Blt),m=f.pitch,y=iI(f.heading,i),b=iI(f.roll,r),x=p.cartesianToCartographic(n,klt);g.longitude=O.zeroToTwoPi(g.longitude),x.longitude=O.zeroToTwoPi(x.longitude);let A=!1;if(c(a)){let P=O.zeroToTwoPi(a),M=Math.min(g.longitude,x.longitude),R=Math.max(g.longitude,x.longitude),L=P>=M&&P<=R;if(c(l)){let B=Math.abs(g.longitude-x.longitude),_=O.TWO_PI-B;(L?B:_)<(L?_:B)*l&&!L&&(A=!0)}else L||(A=!0)}A?Nlt(g,x):Flt(g,x);let E=bX(f,n,g.height,x.height,s),S=xye(m,o,E,u);function v(){let P=g.longitude,M=x.longitude,R=g.latitude,L=x.latitude;return function(_){let w=_.time/t,D=d.fromRadians(O.lerp(P,M,w),O.lerp(R,L,w),E(w),p);f.setView({destination:D,orientation:{heading:O.lerp(y,i,w),pitch:S(w),roll:O.lerp(b,r,w)}})}}return v()}function Vlt(e,t,n,i,o,r,s){let a=e.camera,l=d.clone(a.position,Tye),u=iI(a.heading,i),f=a.frustum.right-a.frustum.left,h=bX(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:O.lerp(u,i,m)}}),z.lerp(l,n,m,a.position);let y=h(m),b=a.frustum,x=b.top/b.right,A=(y-(b.right-b.left))*.5;b.right+=A,b.left-=A,b.top=x*b.right,b.bottom=-b.top}return p}var gye=new he,zlt=new d;function yX(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function yye(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}bye.createTween=function(e,t){t=t??W.EMPTY_OBJECT;let n=t.destination;if(!c(e))throw new C("scene is required.");if(!c(n))throw new C("destination is required.");let i=e.mode;if(i===oe.MORPHING)return yX();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,gye),n=r.project(gye,zlt));let p=e.camera,g=t.endTransform;c(g)&&p._setTransform(g);let m=t.duration;c(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,b=t.pitch??-O.PI_OVER_TWO,x=t.roll??0,A=e.screenSpaceCameraController;A.enableInputs=!1;let E=yye(A,t.complete),S=yye(A,t.cancel),v=p.frustum,P=e.mode===oe.SCENE2D;if(P=P&&z.equalsEpsilon(p.position,n,O.EPSILON6),P=P&&O.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,O.EPSILON6),P=P||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,p.position,O.EPSILON10),P=P&&O.equalsEpsilon(O.negativePiToPi(y),O.negativePiToPi(p.heading),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(b),O.negativePiToPi(p.pitch),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(x),O.negativePiToPi(p.roll),O.EPSILON10),P)return yX(E,S);let M=new Array(4);if(M[oe.SCENE2D]=Vlt,M[oe.SCENE3D]=Ult,M[oe.COLUMBUS_VIEW]=Llt,m<=0)return yX(function(){M[i](e,1,n,y,b,x,a,l,u,f)({time:1}),typeof E=="function"&&E()},S);let R=M[i](e,m,n,y,b,x,a,l,u,f);if(!c(h)){let L=p.positionCartographic.height,B=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>B&&L>11500?h=Qr.CUBIC_OUT:h=Qr.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:E,cancel:S}};var Lz=bye;var Hlt={ROTATE:0,INFINITE_SCROLL:1},Pu=Object.freeze(Hlt);function Jt(e){if(!c(e))throw new C("scene is required.");this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.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 pe,this._moveEnd=new pe,this._changed=new pe,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 F,this._invViewMatrix=new F,Pye(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,O.PI_OVER_TWO)),this._max2Dfrustum=void 0,zye(this,Jt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*Jt.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}Jt.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Jt.TRANSFORM_2D_INVERSE=F.inverseTransformation(Jt.TRANSFORM_2D,new F);Jt.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);Jt.DEFAULT_VIEW_FACTOR=.5;Jt.DEFAULT_OFFSET=new $d(0,-O.PI_OVER_FOUR,0);function Pye(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Glt(e){if(!c(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ei()):e.timeSinceMoved=Math.max(Ei()-e._lastMovedTimestamp,0)/1e3}}Jt.prototype.canPreloadFlight=function(){return c(this._currentFlight)&&this._mode!==oe.SCENE2D};Jt.prototype._updateCameraChanged=function(){let e=this;if(Glt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;c(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%O.TWO_PI;i=i>O.PI?O.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;c(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%O.TWO_PI;s=s>O.PI?O.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(!c(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,b=p.x+m.left,x=p.x+m.right,A=g.x+y.left,E=g.x+y.right,S=p.y+m.bottom,v=p.y+m.top,P=g.y+y.bottom,M=g.y+y.top,R=Math.max(b,A),L=Math.min(x,E),B=Math.max(S,P),_=Math.min(v,M),w;if(R>=L||B>=v)w=1;else{let D=y;b<A&&x>E&&S<P&&v>M&&(D=m),w=1-(L-R)*(_-B)/((D.right-D.left)*(D.top-D.bottom))}w>t&&(e._changed.raiseEvent(w),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!c(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let l=O.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;c(e.frustum.fovy)?u=l/(e.frustum.fovy*.5):u=l;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function jlt(e){Ot.basisTo2D(e._projection,e._transform,e._actualTransform)}var Wlt=new he,qlt=new d,Nz=new d,Ylt=new se,Xlt=new se,Klt=new se,$lt=new se,Zlt=new se;function Qlt(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,Ylt),o=n.cartesianToCartographic(i,Wlt),r=t.project(o,qlt),s=Xlt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,Zlt),l=se.add(F.getColumn(e._transform,0,Nz),i,Nz);n.cartesianToCartographic(l,o),t.project(o,r);let u=Klt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=$lt;if(d.magnitudeSquared(u)>O.EPSILON10)d.cross(a,u,f);else{let h=se.add(F.getColumn(e._transform,1,Nz),i,Nz);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,s,f),f.x=0,d.magnitudeSquared(f)<O.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var xX=new d;function gc(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=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let l=e._up,u=!d.equals(l,e.up);u&&(d.normalize(e.up,e.up),l=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(Jt.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?jlt(e):Qlt(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=xX;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===oe.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||h){let m=d.dot(s,d.cross(l,f,xX));if(Math.abs(1-m)>O.EPSILON2){let y=1/d.magnitudeSquared(l),b=d.dot(l,s)*y,x=d.multiplyByScalar(s,b,xX);l=d.normalize(d.subtract(l,x,e._up),e._up),d.clone(l,e.up),f=d.cross(s,l,e._right),d.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(g,l,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=F.multiplyByPointAsVector(g,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||p)&&Pye(e)}function Iye(e,t){let n;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)?n=Math.atan2(t.y,t.x)-O.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-O.PI_OVER_TWO,O.TWO_PI-O.zeroToTwoPi(n)}function Oye(e){return O.PI_OVER_TWO-O.acosClamped(e.z)}function Rye(e,t,n){let i=0;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=O.zeroToTwoPi(i+O.TWO_PI)),i}var kz=new F,Uz=new F;Object.defineProperties(Jt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return gc(this),this._invTransform}},viewMatrix:{get:function(){return gc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return gc(this),this._invViewMatrix}},positionCartographic:{get:function(){return gc(this),this._positionCartographic}},positionWC:{get:function(){return gc(this),this._positionWC}},directionWC:{get:function(){return gc(this),this._directionWC}},upWC:{get:function(){return gc(this),this._upWC}},rightWC:{get:function(){return gc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,kz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,Uz);this._setTransform(n);let i=Iye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,kz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,Uz);this._setTransform(n);let i=Oye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,kz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,Uz);this._setTransform(n);let i=Rye(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}}});Jt.prototype.update=function(e){if(!c(e))throw new C("mode is required.");if(e===oe.SCENE2D&&!(this.frustum instanceof jo))throw new C("An OrthographicOffCenterFrustum is required in 2D.");if((e===oe.SCENE3D||e===oe.COLUMBUS_VIEW)&&!(this.frustum instanceof wi)&&!(this.frustum instanceof on))throw new C("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");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();if(!(n instanceof jo))throw new C("The camera frustum is expected to be orthographic for 2D camera control.");let 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&&Fye(this,this.position)};var Jlt=new d,eut=new d,tut=new d;Jt.prototype._setTransform=function(e){let t=d.clone(this.positionWC,Jlt),n=d.clone(this.upWC,eut),i=d.clone(this.directionWC,tut);F.clone(e,this._transform),this._transformChanged=!0,gc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),gc(this)};var nut=new z,iut=new _n,out=new d,rut=new d;function Mye(e){if(!F.equals(F.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=nut;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(c(n)){let a=e.getPickRay(i,iut);o=n.pickWorldCoordinates(a,t,!0,out)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,rut));let s;if(c(o)||c(r)){let a=c(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,l=c(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,l)}else s=Math.max(e.positionCartographic.height,0);return s}Jt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof on&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Mye(this)))};var Vz=new d,SX=new F,sut=new F,wX=new Le,vX=new J,Lye=new he;function aut(e,t,n){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new C("position has a NaN component");let i=F.clone(e.transform,SX),o=Ot.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,sut);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,wX),s=J.fromQuaternion(r,vX);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function cut(e,t,n,i){let o=F.clone(e.transform,SX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,l=a.ellipsoid.cartesianToCartographic(t,Lye);t=a.project(l,Vz)}d.clone(t,e.position)}n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,wX),s=J.fromQuaternion(r,vX);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function lut(e,t,n,i){let o=F.clone(e.transform,SX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,Lye);t=l.project(u,Vz)}z.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let l=a.top/a.right;a.right=s,a.left=r,a.top=a.right*l,a.bottom=-a.top}}if(e._scene.mapMode2D===Pu.ROTATE){n.heading=n.heading-O.PI_OVER_TWO,n.pitch=-O.PI_OVER_TWO,n.roll=0;let r=Le.fromHeadingPitchRoll(n,wX),s=J.fromQuaternion(r,vX);J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var uut=new d,fut=new d,dut=new d;function Nye(e,t,n,i){let o=d.clone(n.direction,uut),r=d.clone(n.up,fut);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(t,a,kz),u=F.inverseTransformation(l,Uz);F.multiplyByPointAsVector(u,o,o),F.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,dut);return i.heading=Iye(o,r),i.pitch=Oye(o),i.roll=Rye(o,r,s),i}var EX={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},HE=new Xa;Jt.prototype.setView=function(e){e=e??W.EMPTY_OBJECT;let t=e.orientation??W.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;c(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,Vz);if(c(o)&&c(o.west)){if(o=this.getRectangleCameraCoordinates(o,Vz),isNaN(o.x)||isNaN(o.y))throw new C("destination has a NaN component");i=!1}c(t.direction)&&(t=Nye(this,o,t,EX.orientation)),HE.heading=t.heading??0,HE.pitch=t.pitch??-O.PI_OVER_TWO,HE.roll=t.roll??0,n===oe.SCENE3D?aut(this,o,HE):n===oe.SCENE2D?lut(this,o,HE,i):cut(this,o,HE,i)};var hut=new d;Jt.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:Jt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(Jt.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*Jt.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,hut).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};Jt.prototype.worldToCameraCoordinates=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new se),gc(this),F.multiplyByVector(this._actualInvTransform,e,t)};Jt.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};Jt.prototype.worldToCameraCoordinatesVector=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};Jt.prototype.cameraToWorldCoordinates=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new se),gc(this),F.multiplyByVector(this._actualTransform,e,t)};Jt.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPoint(this._actualTransform,e,t)};Jt.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function Fye(e,t){let n=e._scene.mapMode2D===Pu.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 Aye=new d;Jt.prototype.move=function(e,t){if(!c(e))throw new C("direction is required.");let n=this.position;d.multiplyByScalar(e,t,Aye),d.add(n,Aye,n),this._mode===oe.SCENE2D&&Fye(this,n),this._adjustOrthographicFrustum(!0)};Jt.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?zz(this,e):this.move(this.direction,e)};Jt.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?zz(this,-e):this.move(this.direction,-e)};Jt.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};Jt.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};Jt.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};Jt.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};Jt.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};Jt.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};Jt.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};Jt.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var mut=new Le,put=new J;Jt.prototype.look=function(e,t){if(!c(e))throw new C("axis is required.");let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,mut),o=J.fromQuaternion(i,put),r=this.direction,s=this.up,a=this.right;J.multiplyByVector(o,r,r),J.multiplyByVector(o,s,s),J.multiplyByVector(o,a,a)};Jt.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};Jt.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var _ut=new Le,gut=new J;Jt.prototype.rotate=function(e,t){if(!c(e))throw new C("axis is required.");let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,_ut),o=J.fromQuaternion(i,gut);J.multiplyByVector(o,this.position,this.position),J.multiplyByVector(o,this.direction,this.direction),J.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Jt.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,Bye(this,e)};Jt.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,Bye(this,-e)};var yut=new d,but=new d,xut=new d,Cye=new d;function Bye(e,t){let n=e.position;if(c(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,O.EPSILON2)){let i=d.normalize(n,yut),o=d.equalsEpsilon(i,e.constrainedAxis,O.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,Cye),O.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,but),a=d.dot(i,s),l=O.acosClamped(a);t>0&&t>l&&(t=l-O.EPSILON4),a=d.dot(i,d.negate(s,Cye)),l=O.acosClamped(a),t<0&&-t>l&&(t=-l+O.EPSILON4);let u=d.cross(s,i,xut);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Jt.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,kye(this,-e)};Jt.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,kye(this,e)};function kye(e,t){c(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function zz(e,t){let n=e.frustum;if(!(n instanceof jo)||!c(n.left)||!c(n.right)||!c(n.bottom)||!c(n.top))throw new C("The camera frustum is expected to be orthographic for 2D camera control.");let 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===Pu.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===Pu.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 Uye(e,t){e.move(e.direction,t)}Jt.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?zz(this,e):Uye(this,e)};Jt.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?zz(this,-e):Uye(this,-e)};Jt.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return d.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 Tut=new F;Jt.prototype.lookAt=function(e,t){if(!c(e))throw new C("target is required");if(!c(t))throw new C("offset is required");if(this._mode===oe.MORPHING)throw new C("lookAt is not supported while morphing.");let i=this._scene.ellipsoid??ie.default,o=Ot.eastNorthUpToFixedFrame(e,i,Tut);this.lookAtTransform(o,t)};var Aut=new d,Cut=new Le,Eut=new Le,Sut=new J;function Vye(e,t,n){t=O.clamp(t,-O.PI_OVER_TWO,O.PI_OVER_TWO),e=O.zeroToTwoPi(e)-O.PI_OVER_TWO;let i=Le.fromAxisAngle(d.UNIT_Y,-t,Cut),o=Le.fromAxisAngle(d.UNIT_Z,-e,Eut),r=Le.multiply(o,i,o),s=J.fromQuaternion(r,Sut),a=d.clone(d.UNIT_X,Aut);return J.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}Jt.prototype.lookAtTransform=function(e,t){if(!c(e))throw new C("transform is required");if(this._mode===oe.MORPHING)throw new C("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!c(t))return;let n;if(c(t.heading)?n=Vye(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){z.clone(z.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<O.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(F.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<O.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var oI=new he,wut=new he,vut=new d,Dut=new d,Put=new d,Iut=new d,Out=new d,Rut=new d,Mut=new d,TX=new d,Lut={direction:new d,right:new d,up:new d},Eye;function _c(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function zye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Lut,{north:s,south:a,west:l}=t,{east:u}=t;l>u&&(u+=O.TWO_PI);let f=(l+u)*.5,h;if(a<-O.PI_OVER_TWO+O.RADIANS_PER_DEGREE&&s>O.PI_OVER_TWO-O.RADIANS_PER_DEGREE)h=0;else{let L=oI;L.longitude=f,L.latitude=s,L.height=0;let B=wut;B.longitude=f,B.latitude=a,B.height=0;let _=Eye;(!c(_)||_.ellipsoid!==o)&&(Eye=_=new J_(void 0,void 0,o)),_.setEndPoints(L,B),h=_.interpolateUsingFraction(.5,oI).latitude}let p=oI;p.longitude=f,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,Mut),m=oI;m.longitude=u,m.latitude=s;let y=o.cartographicToCartesian(m,vut);m.longitude=l;let b=o.cartographicToCartesian(m,Put);m.longitude=f;let x=o.cartographicToCartesian(m,Out);m.latitude=a;let A=o.cartographicToCartesian(m,Rut);m.longitude=u;let E=o.cartographicToCartesian(m,Iut);m.longitude=l;let S=o.cartographicToCartesian(m,Dut);d.subtract(b,g,b),d.subtract(E,g,E),d.subtract(y,g,y),d.subtract(S,g,S),d.subtract(x,g,x),d.subtract(A,g,A);let v=o.geodeticSurfaceNormal(g,r.direction);d.negate(v,v);let P=d.cross(v,d.UNIT_Z,r.right);d.normalize(P,P);let M=d.cross(P,v,r.up),R;if(e.frustum instanceof on){let L=Math.max(d.distance(y,b),d.distance(E,S)),B=Math.max(d.distance(y,E),d.distance(b,S)),_,w,D=e.frustum._offCenterFrustum,I=D.right/D.top,N=B*I;L>N?(_=L,w=_/I):(w=B,_=N),R=Math.max(_,w)}else{let L=Math.tan(e.frustum.fovy*.5),B=e.frustum.aspectRatio*L;if(R=Math.max(_c(v,M,b,L),_c(v,M,E,L),_c(v,M,y,L),_c(v,M,S,L),_c(v,M,x,L),_c(v,M,A,L),_c(v,P,b,B),_c(v,P,E,B),_c(v,P,y,B),_c(v,P,S,B),_c(v,P,x,B),_c(v,P,A,B)),a<0&&s>0){let _=oI;_.longitude=l,_.latitude=0,_.height=0;let w=o.cartographicToCartesian(_,TX);d.subtract(w,g,w),R=Math.max(R,_c(v,M,w,L),_c(v,P,w,B)),_.longitude=u,w=o.cartographicToCartesian(_,TX),d.subtract(w,g,w),R=Math.max(R,_c(v,M,w,L),_c(v,P,w,B))}}return d.add(g,d.multiplyByScalar(v,-R,TX),n)}var Nut=new he,Fut=new d,But=new d;function kut(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Nut;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Fut);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let l=i.project(s,But);if(F.multiplyByPoint(o,l,l),F.multiplyByPoint(r,l,l),n.x=(a.x-l.x)*.5+l.x,n.y=(a.y-l.y)*.5+l.y,c(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-l.x)/f,(a.y-l.y)/u)*.5}else{let u=a.x-l.x,f=a.y-l.y;n.z=Math.max(u,f)}return n}var Uut=new he,Vut=new d,zut=new d;function Hut(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Pu.INFINITE_SCROLL?o+=O.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=Uut;r.longitude=o,r.latitude=t.north;let s=i.project(r,Vut);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,zut),l=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,p=e.frustum.right/e.frustum.top,g=u*p;return l>g?(f=l,h=f/p):(h=u,f=g),u=Math.max(2*f,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=u,n=i.project(r,n),n}Jt.prototype.getRectangleCameraCoordinates=function(e,t){if(!c(e))throw new C("rectangle is required");let n=this._mode;if(c(t)||(t=new d),n===oe.SCENE3D)return zye(this,e,t);if(n===oe.COLUMBUS_VIEW)return kut(this,e,t);if(n===oe.SCENE2D)return Hut(this,e,t)};var Gut=new _n;function jut(e,t,n,i){n=n??ie.default;let o=e.getPickRay(t,Gut),r=Qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return _n.getPoint(o,s,i)}var Wut=new _n;function qut(e,t,n,i){let r=e.getPickRay(t,Wut).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Yut=new _n;function Xut(e,t,n,i){let o=e.getPickRay(t,Yut),r=-o.origin.x/o.direction.x;_n.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Jt.prototype.pickEllipsoid=function(e,t,n){if(!c(e))throw new C("windowPosition is required.");let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(c(n)||(n=new d),t=t??ie.default,this._mode===oe.SCENE3D)n=jut(this,e,t,n);else if(this._mode===oe.SCENE2D)n=qut(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=Xut(this,e,this._projection,n);else return;return n}};var Kut=new d,$ut=new d,Zut=new d;function Qut(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,l=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,l,Kut);d.add(h,p,p);let g=d.multiplyByScalar(e.rightWC,u*l*a,$ut),m=d.multiplyByScalar(e.upWC,f*l*s,Zut),y=d.add(p,g,n.direction);return d.add(y,m,y),d.subtract(y,h,y),d.normalize(y,y),n}var Fz=new d;function Jut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2/o*t.x-1;l*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,l,Fz),d.add(Fz,f,f),d.multiplyByScalar(e.upWC,u,Fz),d.add(Fz,f,f),d.clone(e.directionWC,n.direction),n}Jt.prototype.getPickRay=function(e,t){if(!c(e))throw new C("windowPosition is required.");c(t)||(t=new _n);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return c(i.aspectRatio)&&c(i.fov)&&c(i.near)?Qut(this,e,t):Jut(this,e,t)};var eft=new d,tft=new d;Jt.prototype.distanceToBoundingSphere=function(e){if(!c(e))throw new C("boundingSphere is required.");let t=d.subtract(this.positionWC,e.center,eft),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),tft);return Math.max(0,d.magnitude(n)-e.radius)};var nft=new z;Jt.prototype.getPixelSize=function(e,t,n){if(!c(e))throw new C("boundingSphere is required.");if(!c(t))throw new C("drawingBufferWidth is required.");if(!c(n))throw new C("drawingBufferHeight is required.");let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,nft);return Math.max(o.x,o.y)};function ift(e,t,n,i,o,r){let s=d.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(l){let u=d.lerp(t,s,l.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Qr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var oft=new d,Sye=new d,rft=new d,sft=new d;function aft(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,oft),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,Sye),Sye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,rft);let a=Math.tan(e.frustum.fovy*.5),l=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,sft)),f=l*u,h=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(h-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let b=s.y<-m||s.y>m,x=s.z<-y||s.z>y;if(b||x)return ift(e,n,s,m,y,t)}}Jt.prototype.createCorrectPositionTween=function(e){if(!c(e))throw new C("duration is required.");if(this._mode===oe.COLUMBUS_VIEW)return aft(this,e)};var cft=new d,qs={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};Jt.prototype.cancelFlight=function(){c(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Jt.prototype.completeFlight=function(){if(c(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=qs.destination,e.orientation.heading=qs.heading,e.orientation.pitch=qs.pitch,e.orientation.roll=qs.roll,this.setView(e),c(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Jt.prototype.flyTo=function(e){e=e??W.EMPTY_OBJECT;let t=e.destination;if(!c(t))throw new C("destination is required.");if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,cft));let o=e.orientation??W.EMPTY_OBJECT;if(c(o.direction)&&(o=Nye(this,t,o,EX.orientation)),c(e.duration)&&e.duration<=0){let f=EX;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;qs.destination=t,qs.heading=o.heading,qs.pitch=o.pitch,qs.roll=o.roll,qs.duration=e.duration,qs.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),c(e.complete)&&e.complete()},qs.cancel=e.cancel,qs.endTransform=e.endTransform,qs.convert=i?!1:e.convert,qs.maximumHeight=e.maximumHeight,qs.pitchAdjustHeight=e.pitchAdjustHeight,qs.flyOverLongitude=e.flyOverLongitude,qs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,qs.easingFunction=e.easingFunction;let a=this._scene,l=Lz.createTween(a,qs);if(l.duration===0){typeof l.complete=="function"&&l.complete();return}s=a.tweens.add(l),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(c(u)||(u=Jt.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function lft(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function uft(e,t){let n=e.frustum,i=n.offCenterFrustum;c(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 fft=100;function Hye(e,t,n){n=$d.clone(c(n)?n:Jt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!c(r)||r===0){let s=t.radius;s===0?n.range=fft:e.frustum instanceof on||e._mode===oe.SCENE2D?n.range=uft(e,s):n.range=lft(e,s),n.range=O.clamp(n.range,i,o)}return n}Jt.prototype.viewBoundingSphere=function(e,t){if(!c(e))throw new C("boundingSphere is required.");if(this._mode===oe.MORPHING)throw new C("viewBoundingSphere is not supported while morphing.");t=Hye(this,e,t),this.lookAt(e.center,t)};var dft=new F,hft=new d,mft=new d,pft=new d,_ft=new d,gft=new se,yft=new Le,bft=new J;Jt.prototype.flyToBoundingSphere=function(e,t){if(!c(e))throw new C("boundingSphere is required.");t=t??W.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=Hye(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,hft):o=Vye(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??ie.default,a=Ot.eastNorthUpToFixedFrame(e.center,s,dft);F.multiplyByPoint(a,o,o);let l,u;if(!n){if(l=d.subtract(e.center,o,mft),d.normalize(l,l),u=F.multiplyByPointAsVector(a,d.UNIT_Z,pft),1-Math.abs(d.dot(l,u))<O.EPSILON6){let h=Le.fromAxisAngle(l,i.heading,yft),p=J.fromQuaternion(h,bft);d.fromCartesian4(F.getColumn(a,1,gft),u),J.multiplyByVector(p,u,u)}let f=d.cross(l,u,_ft);d.cross(f,l,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:l,up:u},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 wye=new d,vye=new d,AX=new d,Dye=new d,rI=[new d,new d,new d,new d];function xft(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,wye),r=d.magnitude(o),s=d.normalize(o,vye),a,l;d.equalsEpsilon(s,d.UNIT_Z,O.EPSILON10)?(a=new d(0,1,0),l=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,AX),AX),l=d.normalize(d.cross(s,a,Dye),Dye));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,wye),h=u/r,p=d.multiplyByScalar(a,h,vye),g=d.multiplyByScalar(l,h,AX),m=d.add(f,g,rI[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let y=d.subtract(f,g,rI[1]);d.subtract(y,p,y),d.multiplyComponents(n,y,y);let b=d.subtract(f,g,rI[2]);d.add(b,p,b),d.multiplyComponents(n,b,b);let x=d.add(f,g,rI[3]);return d.add(x,p,x),d.multiplyComponents(n,x,x),rI}var CX=new z,Tft=new d,Qy=[new he,new he,new he,new he];function Bz(e,t,n,i,o,r){CX.x=e,CX.y=t;let s=i.pickEllipsoid(CX,o,Tft);return c(s)?(Qy[n]=o.cartesianToCartographic(s,Qy[n]),1):(Qy[n]=o.cartesianToCartographic(r[n],Qy[n]),0)}Jt.prototype.computeViewRectangle=function(e,t){e=e??ie.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Wt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,l=0,u=xft(this,e);if(l+=Bz(0,0,0,this,e,u),l+=Bz(0,a,1,this,e,u),l+=Bz(s,a,2,this,e,u),l+=Bz(s,0,3,this,e,u),l<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(Qy,t);let f=0,h=Qy[3].longitude;for(let p=0;p<4;++p){let g=Qy[p].longitude,m=Math.abs(g-h);m>O.PI?f+=O.TWO_PI-m:f+=m,h=g}return O.equalsEpsilon(Math.abs(f),O.TWO_PI,O.EPSILON9)&&(t.west=-O.PI,t.east=O.PI,Qy[0].latitude>=0?t.north=O.PI_OVER_TWO:t.south=-O.PI_OVER_TWO),t};Jt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof wi)return;let e=this._scene;this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.toRadians(60)};Jt.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof on)return;let e=Mye(this),t=this._scene;this.frustum=new on,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Jt.clone=function(e,t){return c(t)||(t=new Jt(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=Jt;function Aft(e){T.typeOf.object("options",e),T.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var lh=Aft;var Yye=jr(ql(),1),Gye=576,Cft=100,sI="#ffffff",Hz="#48b";function Xye(e,t){this.credit=e,this.count=t??1}function Eft(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(At.equals(o,t))return!0}return!1}function Sft(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;At.equals(n,t)||(c(t)&&e._cesiumCreditContainer.removeChild(t.element),c(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Kye="cesium-credit-delimiter";function jye(e){let t=document.createElement("span");return t.textContent=e,t.className=Kye,t}function Wye(e,t){if(c(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function qye(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(c(a)){if(r=s,c(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(jye(n));else{let f=o[u];f.className!==Kye&&e.replaceChild(jye(n),f)}}let l=a.element;if(o.length<=r)e.appendChild(Wye(l,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Wye(l,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function wft(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Gye?(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>=Gye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function vft(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: ${sI}; - position: relative; - min-height: ${Cft}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: ${sI}; -} -.cesium-credit-lightbox > ul > li a:hover { - color: ${Hz}; -} -.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: ${sI}; -} -.cesium-credit-lightbox-close:hover { - color: ${Hz}; -} -.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: ${sI}; -} -.cesium-credit-expand-link:hover { - color: ${Hz}; -} - -.cesium-credit-text { - color: ${sI}; -} - -.cesium-credit-delimiter { - padding: 0 5px; -} - -.cesium-credit-textContainer *, -.cesium-credit-logoContainer * { - display: inline; -} - -.cesium-credit-textContainer a:hover { - color: ${Hz} -} - -.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=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function dr(e,t,n){T.defined("container",e);let i=this;n=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(m){r.contains(m.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 l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",r.appendChild(l);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);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),vft(e);let g=At.clone(dr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,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 Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function $ye(e,t,n,i){i=i??1;let o=t.get(n.id);if(c(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 Xye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}dr.prototype.addCreditToNextFrame=function(e){if(T.defined("credit",e),e.isIon()){c(this._defaultCredit)||(this._defaultCredit=At.clone(Zye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,$ye(this,t,e)};dr.prototype.addStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits;Eft(t,e)||t.push(e)};dr.prototype.removeStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};dr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};dr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};dr.prototype.update=function(){this._expanded&&wft(this)};dr.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()&&At.equals(dr.cesiumCredit,this._cesiumCredit)||$ye(this,s,r,Number.MAX_VALUE)}At.equals(dr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=At.clone(dr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};dr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;qye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",qye(this._creditList,t,void 0,"li"),Sft(this)};dr.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),de(this)};dr.prototype.isDestroyed=function(){return!1};dr._cesiumCredit=void 0;dr._cesiumCreditInitialized=!1;var Gz;function Zye(){if(!c(Gz)){let e=tn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Yye.default(e).path()),Gz=new At(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return dr._cesiumCreditInitialized||(dr._cesiumCredit=Gz,dr._cesiumCreditInitialized=!0),Gz}Object.defineProperties(dr,{cesiumCredit:{get:function(){return Zye(),dr._cesiumCredit},set:function(e){dr._cesiumCredit=e,dr._cesiumCreditInitialized=!0}}});dr.CreditDisplayElement=Xye;var jz=dr;var Wz=0,Dft=1;function bx(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Ie.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof wi?(s=Wz,a=wi.packedLength):t instanceof on&&(s=Dft,a=on.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Le.packedLength+Ie.packedLength}bx.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Wz?(wi.pack(o,t,n),n+=wi.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var Pft=new wi,Ift=new on,Oft=new Le,Rft=new d,Mft=new Ie;bx.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===Wz?(o=wi.unpack(e,t,Pft),t+=wi.packedLength):(o=on.unpack(e,t,Ift),t+=on.packedLength);let r=d.unpack(e,t,Rft);t+=d.packedLength;let s=Le.unpack(e,t,Oft);t+=Le.packedLength;let a=Ie.unpack(e,t,Mft);t+=Ie.packedLength;let l=e[t]===1;if(!c(n))return new bx({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:l});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=l,n};function GE(e,t,n,i,o,r,s,a){let l=e/3*2;for(let u=0;u<4;++u)c(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),c(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),c(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[l]=0,o[l+1]=0,o[l+2]=1,o[l+3]=0,o[l+4]=1,o[l+5]=1,o[l+6]=0,o[l+7]=1}var Lft=new J,Nft=new F,DX=new F,Qye=new d,Jye=new d,e0e=new d,Fft=new d,Bft=new d,kft=new d,Jy=new Array(3),aI=new Array(4);aI[0]=new se(-1,-1,1,1);aI[1]=new se(1,-1,1,1);aI[2]=new se(1,1,1,1);aI[3]=new se(-1,1,1,1);var t0e=new Array(4);for(let e=0;e<4;++e)t0e[e]=new se;bx._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let l=J.fromQuaternion(t,Lft),u=r??Qye,f=s??Jye,h=a??e0e;u=J.getColumn(l,0,u),f=J.getColumn(l,1,f),h=J.getColumn(l,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=F.computeView(e,h,f,u,Nft),g,m,y=i.projectionMatrix;if(n===Wz){let b=F.multiply(y,p,DX);m=F.inverse(b,DX)}else g=F.inverseTransformation(p,DX);c(m)?(Jy[0]=i.near,Jy[1]=i.far):(Jy[0]=0,Jy[1]=i.near,Jy[2]=i.far);for(let b=0;b<2;++b)for(let x=0;x<4;++x){let A=se.clone(aI[x],t0e[x]);if(c(m)){A=F.multiplyByVector(m,A,A);let E=1/A.w;d.multiplyByScalar(A,E,A),d.subtract(A,e,A),d.normalize(A,A);let S=d.dot(h,A);d.multiplyByScalar(A,Jy[b]/S,A),d.add(A,e,A)}else{let E=i.offCenterFrustum;c(E)&&(i=E);let S=Jy[b],v=Jy[b+1];A.x=(A.x*(i.right-i.left)+i.left+i.right)*.5,A.y=(A.y*(i.top-i.bottom)+i.bottom+i.top)*.5,A.z=(A.z*(S-v)-S-v)*.5,A.w=1,F.multiplyByVector(g,A,A)}o[12*b+x*3]=A.x,o[12*b+x*3+1]=A.y,o[12*b+x*3+2]=A.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,l=new Float64Array(3*4*6);bx._computeNearFarPlanes(i,o,t,n,l);let u=3*4*2;l[u]=l[3*4],l[u+1]=l[3*4+1],l[u+2]=l[3*4+2],l[u+3]=l[0],l[u+4]=l[1],l[u+5]=l[2],l[u+6]=l[3*3],l[u+7]=l[3*3+1],l[u+8]=l[3*3+2],l[u+9]=l[3*7],l[u+10]=l[3*7+1],l[u+11]=l[3*7+2],u+=3*4,l[u]=l[3*5],l[u+1]=l[3*5+1],l[u+2]=l[3*5+2],l[u+3]=l[3],l[u+4]=l[4],l[u+5]=l[5],l[u+6]=l[0],l[u+7]=l[1],l[u+8]=l[2],l[u+9]=l[3*4],l[u+10]=l[3*4+1],l[u+11]=l[3*4+2],u+=3*4,l[u]=l[3],l[u+1]=l[4],l[u+2]=l[5],l[u+3]=l[3*5],l[u+4]=l[3*5+1],l[u+5]=l[3*5+2],l[u+6]=l[3*6],l[u+7]=l[3*6+1],l[u+8]=l[3*6+2],l[u+9]=l[3*2],l[u+10]=l[3*2+1],l[u+11]=l[3*2+2],u+=3*4,l[u]=l[3*2],l[u+1]=l[3*2+1],l[u+2]=l[3*2+2],l[u+3]=l[3*6],l[u+4]=l[3*6+1],l[u+5]=l[3*6+2],l[u+6]=l[3*7],l[u+7]=l[3*7+1],l[u+8]=l[3*7+2],l[u+9]=l[3*3],l[u+10]=l[3*3+1],l[u+11]=l[3*3+2],r||(l=l.subarray(3*4));let f=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})});if(c(s.normal)||c(s.tangent)||c(s.bitangent)||c(s.st)){let p=c(s.normal)?new Float32Array(12*a):void 0,g=c(s.tangent)?new Float32Array(3*4*a):void 0,m=c(s.bitangent)?new Float32Array(3*4*a):void 0,y=c(s.st)?new Float32Array(2*4*a):void 0,b=Qye,x=Jye,A=e0e,E=d.negate(b,Fft),S=d.negate(x,Bft),v=d.negate(A,kft);u=0,r&&(GE(u,p,g,m,y,v,b,x),u+=3*4),GE(u,p,g,m,y,A,E,x),u+=3*4,GE(u,p,g,m,y,E,v,x),u+=3*4,GE(u,p,g,m,y,S,v,E),u+=3*4,GE(u,p,g,m,y,b,A,x),u+=3*4,GE(u,p,g,m,y,x,A,E),c(p)&&(f.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),c(g)&&(f.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),c(m)&&(f.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),c(y)&&(f.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:y}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;h[g]=m,h[g+1]=m+1,h[g+2]=m+2,h[g+3]=m,h[g+4]=m+2,h[g+5]=m+3}return new ct({attributes:f,indices:h,primitiveType:Me.TRIANGLES,boundingSphere:le.fromVertices(l)})};var jE=bx;var PX=0,Uft=1;function cI(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof wi?(r=PX,s=wi.packedLength):t instanceof on&&(r=Uft,s=on.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Le.packedLength}cI.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===PX?(wi.pack(o,t,n),n+=wi.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var Vft=new wi,zft=new on,Hft=new Le,Gft=new d;cI.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===PX?(o=wi.unpack(e,t,Vft),t+=wi.packedLength):(o=on.unpack(e,t,zft),t+=on.packedLength);let r=d.unpack(e,t,Gft);t+=d.packedLength;let s=Le.unpack(e,t,Hft);t+=Le.packedLength;let a=e[t]===1;if(!c(n))return new cI({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};cI.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);jE._computeNearFarPlanes(i,o,t,n,s);let a=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),l,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)l=r?p*8:0,u=p*4,h[l]=u,h[l+1]=u+1,h[l+2]=u+1,h[l+3]=u+2,h[l+4]=u+2,h[l+5]=u+3,h[l+6]=u+3,h[l+7]=u;for(p=0;p<2;++p)l=(f+p)*8,u=p*4,h[l]=u,h[l+1]=u+4,h[l+2]=u+1,h[l+3]=u+5,h[l+4]=u+2,h[l+5]=u+6,h[l+6]=u+3,h[l+7]=u+7;return new ct({attributes:a,indices:h,primitiveType:Me.LINES,boundingSphere:le.fromVertices(s)})};var qz=cI;function Yz(e){if(e=e??W.EMPTY_OBJECT,!c(e.camera))throw new C("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??G.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var jft=new d,Wft=new J,qft=new Le,Yft=new wi,Xft=new zl,Kft=new on,$ft=new jo,Zft=new G,Qft=[1,1e5];Yz.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 wi?a=Yft:s instanceof zl?a=Xft:s instanceof on?a=Kft:a=$ft,a=s.clone(a);let l,u=this._frustumSplits;!c(u)||u.length<=1?(u=Qft,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,l=1):l=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=d.negate(g,jft);let m=Wft;J.setColumn(m,0,g,m),J.setColumn(m,1,p,m),J.setColumn(m,2,h,m);let y=Le.fromRotationMatrix(m,qft);for(t.length=n.length=l,i=0;i<l;++i)a.near=u[i],a.far=u[i+1],t[i]=new In({geometryInstances:new St({geometry:new jE({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:jt.fromColor(G.fromAlpha(this._color,.1,Zft))},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new St({geometry:new qz({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};Yz.prototype.isDestroyed=function(){return!1};Yz.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 de(this)};var T_=Yz;function uI(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=e??0}var lI=zt.supportsTypedArrays()?new Float32Array(12):[],n0e=new d,i0e=new d,IX=new d,o0e=new d,Xz=new d;function Jft(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof on)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,n0e),g=d.normalize(p,i0e),m=d.normalize(d.cross(d.UNIT_Z,p,IX),IX),y=d.normalize(d.cross(g,m,o0e),o0e),b=d.magnitude(p),x=Math.sqrt(b*b-1);o=d.multiplyByScalar(g,1/b,n0e);let A=x/b;r=d.multiplyByScalar(m,A,i0e),s=d.multiplyByScalar(y,A,IX)}let a=d.add(o,s,Xz);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,lI,0);let l=d.subtract(o,s,Xz);d.subtract(l,r,l),d.multiplyComponents(n,l,l),d.pack(l,lI,3);let u=d.add(o,s,Xz);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,lI,6);let f=d.subtract(o,s,Xz);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,lI,9),lI}uI.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 ie(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(c(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Je({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:De.OPAQUE,owner:this})),!c(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new He({sources:[pV]}),a=new He({sources:[mV]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Jft(i,e);if(c(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Be.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};uI.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};uI.prototype.isDestroyed=function(){return!1};uI.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Kz=uI;function qE(){}var edt=/\bgl_FragDepth\b/,tdt=/\bdiscard\b/;function ndt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(c(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(edt.test(r[a])||tdt.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 He({sources:[a]})}else if(!o&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`;i=new He({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function idt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(c(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}qE.createDepthOnlyDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=Je.shallowClone(t,i.depthOnlyCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=ndt(n,t.shaderProgram),i.depthOnlyCommand.renderState=idt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var odt=/\s+czm_writeLogDepth\(/,rdt=/\s+czm_vertexLogDepth\(/;function sdt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(c(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=c(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,l=r.sources;for(let f=0;f<l.length;++f)if(rdt.test(l[f])){a=!0;break}if(!a){for(let h=0;h<l.length;++h)l[h]=He.replaceMain(l[h],"czm_log_depth_main");l.push(` - -void main() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`)}l=s.sources,a=!1;for(let f=0;f<l.length;++f)odt.test(l[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<l.length;f++)l[f]=He.replaceMain(l[f],"czm_log_depth_main");u=` -void main() -{ - czm_log_depth_main(); - czm_writeLogDepth(); -} -`}return l.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}qE.createLogDepthCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Je.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=sdt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function adt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(c(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,l=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () +${i}} +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function yLt(e,t){return Roe(e,t,"translucentMRT",pLt)}function ALt(e,t){return Roe(e,t,"translucentMultipass",gLt)}function bLt(e,t){return Roe(e,t,"alphaMultipass",_Lt)}o_.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=at.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=yLt(t,e.shaderProgram),n.translucentCommand.renderState=dLt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),n.alphaCommand=at.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=ALt(t,e.shaderProgram),n.translucentCommand.renderState=hLt(this,t,e.renderState),n.alphaCommand.shaderProgram=bLt(t,e.shaderProgram),n.alphaCommand.renderState=mLt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function xLt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.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 m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function TLt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}o_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){TLt(this,e,t,n,i,r);return}xLt(this,e,t,n,i,r)};o_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};o_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.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};o_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};o_.prototype.isDestroyed=function(){return!1};o_.prototype.destroy=function(){return nNe(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()),ue(this)};var i5=o_;function QO(){this._framebuffer=new ci({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(QO.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ELt(e){e._framebuffer.destroy()}function CLt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new gc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}QO.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&CLt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};QO.prototype.isDestroyed=function(){return!1};QO.prototype.destroy=function(){return ELt(this),ue(this)};var r5=QO;function VT(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ci({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function iNe(e,t,n,i,r=1){let o=Math.max(n,i),s=o*o,a=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<s;++m){if(-a<=u&&u<=a&&-c<=f&&f<=c){let y=4*((c-f)*n+u+a),A=z.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}VT.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};VT.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,s=this._fb.framebuffer,a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:s}),f=r2.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=$e.createTypedArray(c,a,i,r);return u.getBufferData(d),iNe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};VT.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return iNe(r,o,n,i,t)};VT.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+o);return r.slice(a,a+4)};VT.prototype.isDestroyed=function(){return!1};VT.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var o5=VT;function s_(){this._numSamples=1,this._colorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,owner:this})}function vLt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(s_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});s_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};s_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};s_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};s_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};s_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};s_.prototype.isDestroyed=function(){return!1};s_.prototype.destroy=function(){return vLt(this),ue(this)};var nI=s_;function $A(){}var SLt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};$A.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return SLt[n]===!0})};$A.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};$A.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Xe.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Xe.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC; +void main() { - czm_non_pick_main(); - if (${l}.a == 0.0) { - discard; - } - ${l} = ${n}; -} `,f=r.length,h=new Array(f+1);for(let g=0;g<f;++g)h[g]=He.replaceMain(r[g],"czm_non_pick_main");h[f]=u;let p=new He({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function r0e(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(c(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}qE.createPickDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=Je.shallowClone(t,i.pickCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=adt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=r0e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function WE(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 s0e(e){return e.isArray?e.arrayLength:at.getComponentCount(e.type)}function cdt(e){let t=s0e(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function a0e(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function c0e(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function ldt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=a0e(n,i,o)}return e.normalized||(n=c0e(n,e.componentType)),n}function udt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=a0e(o,r,s)}return e.normalized||(o=c0e(o,e.componentType)),o}function fdt(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(c(a))return a;let l=n.metadataProperty,u=n.classProperty,f=cdt(u),h=["0.0","0.0","0.0","0.0"],p=s0e(u);if(p===1)h[0]=ldt(u,l);else{let b=["x","y","z","w"];for(let x=0;x<p;x++)h[x]=udt(u,l,b[x])}let g=t.fragmentShaderSource.defines.slice();g.push(yf.METADATA_PICKING_ENABLED),WE(g,yf.METADATA_PICKING_VALUE_TYPE,f),WE(g,yf.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new He({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}qE.createPickMetadataDerivedCommand=function(e,t,n,i){return c(i)||(i={}),i.pickMetadataCommand=Je.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=fdt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=r0e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function ddt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(c(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=c(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}qE.createHdrCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Je.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=ddt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var A_=qE;function $z(e){if(!c(e))throw new C("scene is required.");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(!c(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=O.toRadians(o),t._beta=O.toRadians(i.beta),t._gamma=O.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var hdt=new Le,l0e=new Le,mdt=new J;function pdt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Le.fromAxisAngle(o,n,l0e),l=Le.fromAxisAngle(r,i,hdt),u=Le.multiply(l,a,l),f=Le.fromAxisAngle(s,t,l0e);Le.multiply(f,u,u);let h=J.fromQuaternion(u,mdt);J.multiplyByVector(h,r,r),J.multiplyByVector(h,s,s),J.multiplyByVector(h,o,o)}$z.prototype.update=function(){if(!c(this._alpha))return;c(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;pdt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};$z.prototype.isDestroyed=function(){return!1};$z.prototype.destroy=function(){return this._removeListener(),de(this)};var Zz=$z;function OX(){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(OX.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){if(c(e)&&e<0)throw new C("value must be positive.");this._heightFalloff=e}}});var _dt=new d;OX.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!c(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,O.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,_dt),a=Math.abs(d.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 Qz=OX;function gdt(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 Jz=gdt;var ga={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},xx=ga.DERIVED_COMMANDS_MAXIMUM_LENGTH,b0e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function Tx(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(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(xx),this._derivedBlendCommandTypes=new Array(xx),this._derivedPickCommandTypes=new Array(xx),this._derivedCommandTypesToUpdate=new Array(xx),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(Tx.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}}});Tx.prototype.update=function(e){let t=e.globe;if(!c(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=u0e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=u0e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=f0e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=f0e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Tdt(this,e,t),this._sunVisibleThroughGlobe=ydt(this,e),this._environmentVisible=bdt(this,e),this._useDepthPlane=xdt(this,e),this._numberOfTextureUniforms=Adt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Cdt(this,e)};function u0e(e,t,n,i){return e?c(n)?(Bt.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 f0e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function ydt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function bdt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function xdt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Tdt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Adt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Cdt(e,t){e._derivedCommandsLength=RX(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=RX(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=RX(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<xx;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!c(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=kdt())}function RX(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let l=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ga.PICK_FRONT_FACE:u?ga.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ga.TRANSLUCENT_FRONT_FACE,h=i?ga.PICK_BACK_FACE:u?ga.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ga.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=ga.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=ga.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):l?(n||(o[r++]=ga.DEPTH_ONLY_BACK_FACE),o[r++]=ga.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=ga.DEPTH_ONLY_FRONT_FACE),o[r++]=ga.OPAQUE_BACK_FACE,o[r++]=f),r)}function Yf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function d0e(e,t){return e.indexOf(t)>-1}function Edt(e,t){Yf(e.defines,"TRANSLUCENT"),Yf(t.defines,"TRANSLUCENT")}function Sdt(e,t){Yf(e.defines,"GROUND_ATMOSPHERE"),Yf(t.defines,"GROUND_ATMOSPHERE"),Yf(e.defines,"FOG"),Yf(t.defines,"FOG"),Yf(e.defines,"TRANSLUCENT"),Yf(t.defines,"TRANSLUCENT")}function MX(e,t){if(d0e(t.defines,"TILE_LIMIT_RECTANGLE")||d0e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() + czm_shadow_cast_main(); + v_positionEC = (czm_inverseProjection * gl_Position).xyz; +}`)}return new Xe({defines:i,sources:r})};$A.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),s=e.sources.slice(0);o.push("SHADOW_MAP");let a=Xe.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let u=s.length;for(let d=0;d<u;++d)s[d]=Xe.replaceMain(s[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC; +`),f+=`uniform vec4 shadowMap_lightPositionEC; +`),i&&r?f+=`void main() { - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function LX(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=He.replaceMain(n[r],"czm_globe_translucency_main");n.push(` - -uniform sampler2D u_classificationTexture; -void main() + czm_shadow_cast_main(); +`:i?f+=`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) +`:f+=`void main() +{ + czm_shadow_cast_main(); + if (out_FragColor.a == 0.0) { - vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); - float depthEC = eyeCoordinate.z / eyeCoordinate.w; - if (v_positionEC.z < depthEC) - { - discard; - } + discard; } -#endif - czm_globe_translucency_main(); - vec4 classificationColor = texture(u_classificationTexture, st); - if (classificationColor.a > 0.0) +`,t?f+=` float distance = length(${a}); + if (distance >= shadowMap_lightPositionEC.w) { - // Reverse premultiplication process to get the correct composited result of the classification primitives - classificationColor.rgb /= classificationColor.a; + discard; } - out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); -} -`)}function x0e(e,t){LX(e,t),Yf(e.defines,"GROUND_ATMOSPHERE"),Yf(t.defines,"GROUND_ATMOSPHERE"),Yf(e.defines,"FOG"),Yf(t.defines,"FOG")}function wdt(e,t){LX(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function vdt(e,t){x0e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function h0e(e,t){let n=`uniform sampler2D u_classificationTexture; -void main() + distance /= shadowMap_lightPositionEC.w; // radius + out_FragColor = czm_packDepth(distance); +`:n?f+=` out_FragColor = vec4(1.0); +`:f+=` out_FragColor = czm_packDepth(gl_FragCoord.z); +`,f+=`} +`,s.push(f),new Xe({defines:o,sources:s})};$A.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};$A.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Xe({defines:i,sources:r})};$A.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Xe.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Xe.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let S=0;S<T;++S)x[S]=Xe.replaceMain(x[S],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube; +`:E+=`uniform sampler2D shadowMap_texture; +`;let v;return c?v=` return vec4(${a}, 1.0); +`:v=`#ifndef LOG_DEPTH + return czm_windowToEyeCoordinates(gl_FragCoord); +#else + return vec4(v_logPositionEC, 1.0); +#endif +`,E+=`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() { - vec2 st = gl_FragCoord.xy / czm_viewport.zw; - vec4 pickColor = texture(u_classificationTexture, st); - if (pickColor == vec4(0.0)) +${v}} +vec3 getNormalEC() +{ +${s?` return normalize(${o}); +`:` return vec3(1.0); +`}} +void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) +{ +${A.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; + float normalOffsetScale = 1.0 - nDotL; + vec3 offset = normalOffset * normalOffsetScale * normalEC; + positionEC.xyz += offset; +`:""}} +`,E+=`void main() +{ + czm_shadow_receive_main(); + vec4 positionEC = getPositionEC(); + vec3 normalEC = getNormalEC(); + float depth = -positionEC.z; +`,E+=` czm_shadowParameters shadowParameters; + shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; + shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; + shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; + shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; +`,i?E+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); +`:f||(E+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); +`),d?E+=` 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) { - discard; - } - out_FragColor = pickColor; -} -`;t.sources=[n]}function Ddt(e,t,n,i,o,r){if(!c(o))return t;if(!i&&c(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!c(s)){let a=t._attributeLocations,l=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();l.defines=c(l.defines)?l.defines.slice(0):[],u.defines=c(u.defines)?u.defines.slice(0):[],o(l,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:a})}return s}function Pdt(e){e.cull.face=Ti.BACK,e.cull.enabled=!0}function Idt(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0}function Odt(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Rdt(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Mdt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function m0e(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function p0e(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Ldt(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Ndt(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Fdt(e,t,n,i,o){if(!c(i))return e;if(!n&&c(t))return t;let r=o[e.id];if(!c(r)){let s=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function YE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Bdt(e,t,n,i,o){return c(o)?!i&&c(n)?n:xt(t,o(e),!1):t}function uh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function kdt(){return[new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:Edt,getRenderStateFunction:Pdt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:Sdt,getRenderStateFunction:Idt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:MX,getRenderStateFunction:Odt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:MX,getRenderStateFunction:Rdt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:MX,getRenderStateFunction:Mdt,getUniformMapFunction:void 0}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:LX,getRenderStateFunction:m0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:x0e,getRenderStateFunction:p0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wdt,getRenderStateFunction:m0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vdt,getRenderStateFunction:p0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:h0e,getRenderStateFunction:Ldt,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:h0e,getRenderStateFunction:Ndt,getUniformMapFunction:YE})]}var _0e=new Array(xx),g0e=new Array(xx);Tx.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)g0e[o]=this._derivedCommandPacks[n[o]],_0e[o]=b0e[n[o]];Udt(this,e,i,n,_0e,g0e,t)}};function Udt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!c(a)||l){t.dirty=!1,c(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let x=r[b],A=i[b],E=o[b],S=a[E],v,P,M;c(S)?(v=S.uniformMap,P=S.shaderProgram,M=S.renderState):(v=void 0,P=void 0,M=void 0),S=Je.shallowClone(t,S),a[E]=S;let R=S.derivedCommands.uniformMapDirtyFrame??0,L=S.derivedCommands.shaderProgramDirtyFrame??0,B=S.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,w=m||L<h,D=y||B<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),w&&(S.derivedCommands.shaderProgramDirtyFrame=u),D&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=A,S.pass=x.pass,S.pickOnly=x.pickOnly,S.uniformMap=Bdt(e,t.uniformMap,v,_,x.getUniformMapFunction),S.shaderProgram=Ddt(s.context,t.shaderProgram,P,w,x.getShaderProgramFunction,E),S.renderState=Fdt(t.renderState,M,D,x.getRenderStateFunction,x.renderStateCache)}}}Tx.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 l=b0e[o[a]];n.commandList.push(s[l])}};function T0e(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],l=a.derivedCommands.type;(!c(r)||r.indexOf(l)>-1)&&n(a,i,o)}}function y0e(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Vdt=[ga.OPAQUE_FRONT_FACE,ga.OPAQUE_BACK_FACE],zdt=[ga.DEPTH_ONLY_FRONT_FACE,ga.DEPTH_ONLY_BACK_FACE,ga.DEPTH_ONLY_FRONT_AND_BACK_FACE];Tx.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[De.GLOBE],a=e.indices[De.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),T0e(s,a,t,i,o,Vdt))};Tx.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[De.GLOBE],l=e.indices[De.GLOBE],u=e.commands[De.TERRAIN_CLASSIFICATION],f=e.indices[De.TERRAIN_CLASSIFICATION];if(l===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&y0e(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,T0e(a,l,t,i,o,zdt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}y0e(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=m};var e4=Tx;var Iu=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;function Hm(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new pi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new pi({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 G(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new G(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(Hm.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Hm.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Hdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Gdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},jdt={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Wdt=`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; -} -`,qdt=`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 -} -`;Hm.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,l=!c(i)||i.width!==s||i.height!==a;if((l||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._previousFramebuffer)||(this._depthStencilTexture=new Rt({context:e,width:s,height:a,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new tf({context:e,width:s,height:a,format:Ec.DEPTH24_STENCIL8,numSamples:t})))),!c(this._fbo.framebuffer)||l||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;c(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),c(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),c(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(c(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(Hdt),this._rsClassified=ze.fromCache(Gdt),this._rsDefault=ze.fromCache(jdt)),!c(this._unclassifiedCommand)||o||r){c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=c(this._previousFramebuffer)?qdt:Wdt,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),h=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:c(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:c(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),c(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),c(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Iu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Hm.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Hm.prototype.clear=function(e,t){c(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Hm.prototype.executeClassified=function(e,t){if(!c(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)};Hm.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),de(this)};var fI=Hm;function t4(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(t4.prototype,{total:{get:function(){return this._total}}});function e0(e){if(c(e)&&e.length!==wa.NUMBER_OF_JOB_TYPES)throw new C("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let t=new Array(wa.NUMBER_OF_JOB_TYPES);t[wa.TEXTURE]=new t4(c(e)?e[wa.TEXTURE]:10),t[wa.PROGRAM]=new t4(c(e)?e[wa.PROGRAM]:10),t[wa.BUFFER]=new t4(c(e)?e[wa.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}e0.getTimestamp=Ei;Object.defineProperties(e0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});e0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};e0.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};e0.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 l=n.length,u;for(u=0;u<l&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===l&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=e0.getTimestamp();e.execute();let a=e0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var n4=e0;function i4(e){e=e??W.EMPTY_OBJECT;let t=Rn(e.container);if(!c(t))throw new C("container is required");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=Ei(),this._lastMsSampleTime=Ei(),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(i4.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});i4.prototype.update=function(e){let t=Ei(),n=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}};i4.prototype.destroy=function(){return de(this)};var t0=i4;var ya={};ya.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};ya.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=ya.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};ya.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=at.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=ya.decodeRawMetadataValueComponent(e,t,p);f[h]=g}return f}let l=n*a;return ya.decodeRawMetadataValueComponent(e,t,l)};ya.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=ya.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return ya.decodeRawMetadataValueElement(e,n,0)};ya.convertToObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case at.VEC2:return z.unpack(n,0,new z);case at.VEC3:return d.unpack(n,0,new d);case at.VEC4:return se.unpack(n,0,new se);case at.MAT2:return Ri.unpack(n,0,new Ri);case at.MAT3:return J.unpack(n,0,new J);case at.MAT4:return F.unpack(n,0,new F)}throw new ae(`Invalid metadata object type: ${e}`)};ya.convertFromObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;switch(e){case at.VEC2:return z.pack(t,Array(2));case at.VEC3:return d.pack(t,Array(3));case at.VEC4:return se.pack(t,Array(4));case at.MAT2:return Ri.pack(t,Array(4));case at.MAT3:return J.pack(t,Array(9));case at.MAT4:return F.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};ya.decodeMetadataValues=function(e,t,n){let i=ya.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=ya.convertFromObjectType(e.type,t.offset),s=ya.convertFromObjectType(e.type,t.scale);i=vp.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let l=i[a],u=ya.convertToObjectType(e.type,l);s[a]=u}return s}return ya.convertToObjectType(e.type,i)};var o4=Object.freeze(ya);function Ax(){this._framebuffer=new pi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(Ax.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Ydt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Xdt(e,t,n){c(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:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}Ax.prototype.update=function(e,t){Ydt(this,e,t),Xdt(this,e,t)};var Kdt=new se,$dt=new se(1,1/255,1/65025,1/16581375);Ax.prototype.getDepth=function(e,t,n){if(!c(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,Kdt);return se.divideByScalar(o,255,o),se.dot(o,$dt)};Ax.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};Ax.prototype.isDestroyed=function(){return!1};Ax.prototype.destroy=function(){return this._framebuffer.destroy(),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=c(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),de(this)};var r4=Ax;function Zdt(e,t){this.near=e??0,this.far=t??0;let n=De.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 s4=Zdt;var Cx=`uniform highp sampler2D u_depthTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function Gm(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new pi,this._tempCopyDepthFramebuffer=new pi,this._updateDepthFramebuffer=new pi({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(Gm.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 A0e(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),(!c(e._rs)||!Ke.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Cx,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,c(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,c(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Cx,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,c(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,c(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new G(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Gm.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,l=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,l),this._copyDepthFramebuffer.update(e,s,a),A0e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};Gm.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Gm.prototype.executeCopyDepth=function(e,t){c(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Gm.prototype.executeUpdateDepth=function(e,t,n){let i=c(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){c(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!c(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!c(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),A0e(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Gm.prototype.executeCopyColor=function(e,t){c(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Gm.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;c(i)&&(G.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Gm.prototype.isDestroyed=function(){return!1};Gm.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),c(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),c(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),c(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),de(this)};var a4=Gm;function Ex(){this._framebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new pi,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(Ex.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 Qdt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Jdt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function eht(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),(!c(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Cx,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),c(e._clearCommand)||(e._clearCommand=new ti({color:new G(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}Ex.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Jdt(this,n,o,r,e),eht(this,n,o,r,i),this._useHdr=e};Ex.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};Ex.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};Ex.prototype.isDestroyed=function(){return!1};Ex.prototype.destroy=function(){return Qdt(this),de(this)};var c4=Ex;function C_(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 pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new pi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new pi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new G(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new G(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new G(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new G(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 C0e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function NX(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function E0e(e){C0e(e),NX(e)}function tht(e,t,n,i){C0e(e),e._accumulationTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function nht(e,t){NX(e);let n=ne.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)&&(NX(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,l=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!l||!u)&&(E0e(e),e._translucentMultipassSupport=!1,i=!1)}return i}C_.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,l=!c(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((l||u)&&(this._numSamples=o,tht(this,e,r,s)),(!c(this._translucentFBO.framebuffer)||l||u)&&!nht(this,e))return;this._useHDR=i;let f=this,h,p;c(this._compositeCommand)||(h=new He({sources:[hV]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),c(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new He({defines:["MRT"],sources:[NP]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new He({sources:[NP]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._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),m=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),m=!0),(!c(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),c(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var iht={enabled:!0,color:new G(0,0,0,0),equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA},oht={enabled:!0,color:new G(0,0,0,0),equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationAlpha:vo.ONE},rht={enabled:!0,color:new G(0,0,0,0),equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ZERO,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA};function FX(e,t,n,i){let o=n[i.id];if(!c(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function sht(e,t,n){return FX(t,iht,e._translucentRenderStateCache,n)}function aht(e,t,n){return FX(t,oht,e._translucentRenderStateCache,n)}function cht(e,t,n){return FX(t,rht,e._alphaRenderStateCache,n)}var lht=` 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); -`,uht=` 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; -`,fht=` float ai = czm_out_FragColor.a; - out_FragColor = vec4(ai); -`;function BX(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(c(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return He.replaceMain(f,"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 l=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<l.length;f++){let h=l[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]}; -${u}`}return a.sources.push(u),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 dht(e,t){return BX(e,t,"translucentMRT",lht)}function hht(e,t){return BX(e,t,"translucentMultipass",uht)}function mht(e,t){return BX(e,t,"alphaMultipass",fht)}C_.prototype.createDerivedCommands=function(e,t,n){if(c(n)||(n={}),this._translucentMRTSupport){let a,l;return c(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,l=n.translucentCommand.renderState),n.translucentCommand=Je.shallowClone(e,n.translucentCommand),!c(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=dht(t,e.shaderProgram),n.translucentCommand.renderState=sht(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=l),n}let i,o,r,s;return c(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Je.shallowClone(e,n.translucentCommand),n.alphaCommand=Je.shallowClone(e,n.alphaCommand),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=hht(t,e.shaderProgram),n.translucentCommand.renderState=aht(this,t,e.renderState),n.alphaCommand.shaderProgram=mht(t,e.shaderProgram),n.alphaCommand.renderState=cht(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 pht(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.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 m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=h}function _ht(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=h}C_.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){_ht(this,e,t,n,i,o);return}pht(this,e,t,n,i,o)};C_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};C_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,G.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};C_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};C_.prototype.isDestroyed=function(){return!1};C_.prototype.destroy=function(){return E0e(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),de(this)};var l4=C_;function dI(){this._framebuffer=new pi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(dI.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ght(e){e._framebuffer.destroy()}function yht(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Cc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}dI.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&yht(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};dI.prototype.isDestroyed=function(){return!1};dI.prototype.destroy=function(){return ght(this),de(this)};var u4=dI;function XE(e){let t=new Cc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new pi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}XE.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 hI=new G;XE.prototype.end=function(e){let t=e.width??1,n=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),l=Math.floor(n*.5),u=0,f=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-l<=f&&f<=l){let m=4*((l-f)*t+u+a);hI.red=G.byteToFloat(o[m]),hI.green=G.byteToFloat(o[m+1]),hI.blue=G.byteToFloat(o[m+2]),hI.alpha=G.byteToFloat(o[m+3]);let y=i.getObjectByPickColor(hI);if(c(y))return y}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=h;h=-p,p=m}u+=h,f+=p}};XE.prototype.readCenterPixel=function(e){let t=e.width??1,n=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)};XE.prototype.isDestroyed=function(){return!1};XE.prototype.destroy=function(){return this._fb.destroy(),de(this)};var f4=XE;function E_(){this._numSamples=1,this._colorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new G(0,0,0,0),this._clearCommand=new ti({color:new G(0,0,0,0),depth:1,owner:this})}function bht(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(E_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});E_.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};E_.prototype.clear=function(e,t,n){G.clone(n,this._clearCommand.color),G.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};E_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};E_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};E_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};E_.prototype.isDestroyed=function(){return!1};E_.prototype.destroy=function(){return bht(this),de(this)};var KE=E_;function Sx(){}Sx.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};Sx.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=He.findPositionVarying(e),s=c(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=He.replaceMain(o[u],"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 He({defines:i,sources:o})};Sx.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=He.findPositionVarying(e),a=c(s);a||(s="v_positionEC");let l=r.length;for(let f=0;f<l;++f)r[f]=He.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC; -`),u+=`uniform vec4 shadowMap_lightPositionEC; -`),i?u+=`void main() -{ -`:u+=`void main() -{ - czm_shadow_cast_main(); - if (out_FragColor.a == 0.0) - { - discard; - } -`,t?u+=` float distance = length(${s}); - if (distance >= shadowMap_lightPositionEC.w) - { - discard; - } - distance /= shadowMap_lightPositionEC.w; // radius - out_FragColor = czm_packDepth(distance); -`:n?u+=` out_FragColor = vec4(1.0); -`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); -`,u+=`} -`,r.push(u),new He({defines:o,sources:r})};Sx.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${l}${u}${f}${t}${n}${i}`};Sx.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 He({defines:i,sources:o})};Sx.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=He.findNormalVarying(e),s=!i&&c(r)||i&&o,a=He.findPositionVarying(e),l=c(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,b=h?t._pointBias:i?t._terrainBias:t._primitiveBias,x=e.defines.slice(0),A=e.sources.slice(0),E=A.length;for(let P=0;P<E;++P)A[P]=He.replaceMain(A[P],"czm_shadow_receive_main");h?x.push("USE_CUBE_MAP_SHADOW"):u&&x.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!h&&x.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?x.push("ENABLE_VERTEX_LIGHTING"):x.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(x.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&x.push("USE_NORMAL_SHADING_SMOOTH"));let S="";h?S+=`uniform samplerCube shadowMap_textureCube; -`:S+=`uniform sampler2D shadowMap_texture; -`;let v;return l?v=` return vec4(${a}, 1.0); -`:v=`#ifndef LOG_DEPTH - return czm_windowToEyeCoordinates(gl_FragCoord); -#else - return vec4(v_logPositionEC, 1.0); -#endif -`,S+=`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() -{ -${v}} -vec3 getNormalEC() -{ -${s?` return normalize(${r}); -`:` return vec3(1.0); -`}} -void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) -{ -${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; - float normalOffsetScale = 1.0 - nDotL; - vec3 offset = normalOffset * normalOffsetScale * normalEC; - positionEC.xyz += offset; -`:""}} -`,S+=`void main() -{ - czm_shadow_receive_main(); - vec4 positionEC = getPositionEC(); - vec3 normalEC = getNormalEC(); - float depth = -positionEC.z; -`,S+=` czm_shadowParameters shadowParameters; - shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; - shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; - shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; - shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; -`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); -`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); -`),h?S+=` 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; + 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?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); +`:p?E+=` 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; @@ -8637,7 +9412,7 @@ ${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanc shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w; +`:g?E+=` float maxDepth = shadowMap_cascadeSplits[1].w; // Stop early if the eye depth exceeds the last cascade if (depth > maxDepth) { @@ -8661,7 +9436,7 @@ ${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanc visibility = mix(visibility, 1.0, fade); ${m?` // Draw cascade colors for debugging out_FragColor *= czm_cascadeColor(weights); -`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); +`:""}`:E+=` 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 @@ -8673,9 +9448,9 @@ ${m?` // Draw cascade colors for debugging shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); -`,S+=` out_FragColor.rgb *= visibility; +`,E+=` out_FragColor.rgb *= visibility; } -`,A.push(S),new He({defines:x,sources:A})};var S_=Sx;function jm(e){e=e??W.EMPTY_OBJECT;let t=e.context;if(!c(t))throw new C("context is required.");if(!c(e.lightCamera))throw new C("lightCamera is required.");if(c(e.numberOfCascades)&&e.numberOfCascades!==1&&e.numberOfCascades!==4)throw new C("Only one or four cascades are supported.");this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(zt.isInternetExplorer()||zt.isEdge()||(zt.isChrome()||zt.isFirefox())&&zt.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 F,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new d4,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new jo:c(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new F,new F,new F,new F],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 xht(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,UX(this),this._clearCommand=new ti({depth:1,color:new G}),this._clearPassState=new Cc(t),this._size=e.size??2048,this.size=this._size}jm.MAXIMUM_DISTANCE=2e4;function xht(e){this.camera=new d4,this.passState=new Cc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function kX(e,t){return ze.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 UX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=kX(t,e._primitiveBias),e._terrainRenderState=kX(t,e._terrainBias),e._pointRenderState=kX(t,e._pointBias)}jm.prototype.debugCreateRenderStates=function(){UX(this)};Object.defineProperties(jm.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){wht(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 VX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;c(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Tht(e,t){let n=new tf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ec.DEPTH_COMPONENT16}),i=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.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 Aht(e,t){let n=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.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 Cht(e,t){let n=new tf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ec.DEPTH_COMPONENT16}),i=new Go({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.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 v0e(e,t){e._isPointLight?Cht(e,t):e._usesDepthTexture?Aht(e,t):Tht(e,t)}function Eht(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,UX(e),VX(e),v0e(e,t))}function Sht(e,t){(!c(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(VX(e),v0e(e,t),Eht(e,t),D0e(e,t))}function D0e(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function wht(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=ut.maximumCubeMapSize>=t?t:ut.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=ut.maximumTextureSize>=t?t:ut.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=ut.maximumTextureSize>=t*2?t:ut.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,l=a.x/o.x,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new F(f,0,0,l,0,h,0,u,0,0,1,0,0,0,0,1)}}var vht=new Ke;function Dht(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,x.push(E),new Xe({defines:b,sources:x})};var p0=$A;function g0(e){e=e??H.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(dn.isEdge()||(dn.isChrome()||dn.isFirefox())&&dn.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 M,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new s5,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Ss:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new wLt(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,Moe(this),this._clearCommand=new fi({depth:1,color:new z}),this._clearPassState=new gc(t),this._size=e.size??2048,this.size=this._size}g0.MAXIMUM_DISTANCE=2e4;function wLt(e){this.camera=new s5,this.passState=new gc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Ooe(e,t){return Ge.fromCache({cull:{enabled:!0,face:Gi.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 Moe(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Ooe(t,e._primitiveBias),e._terrainRenderState=Ooe(t,e._terrainBias),e._pointRenderState=Ooe(t,e._pointBias)}g0.prototype.debugCreateRenderStates=function(){Moe(this)};Object.defineProperties(g0.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){MLt(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 Noe(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ILt(e,t){let n=new rd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uu.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=new vs({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function PLt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),i=new vs({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function DLt(e,t){let n=new rd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:uu.DEPTH_COMPONENT16}),i=new ls({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new vs({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function sNe(e,t){e._isPointLight?DLt(e,t):e._usesDepthTexture?PLt(e,t):ILt(e,t)}function RLt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Moe(e),Noe(e),sNe(e,t))}function OLt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Noe(e),sNe(e,t),RLt(e,t),aNe(e,t))}function aNe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function MLt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ut.maximumCubeMapSize>=t?t:Ut.maximumCubeMapSize,r.x=t,r.y=t;let o=new et(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ut.maximumTextureSize>=t?t:Ut.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=Ut.maximumTextureSize>=t*2?t:Ut.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new M(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var NLt=new et;function LLt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -8736,7 +9511,17 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` 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=De.OVERLAY,i}function Pht(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=vht;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;c(a)||(a=Dht(e,n),e._debugShadowViewCommand=a),(!c(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Wm=new Array(8);Wm[0]=new se(-1,-1,-1,1);Wm[1]=new se(1,-1,-1,1);Wm[2]=new se(1,1,-1,1);Wm[3]=new se(-1,1,-1,1);Wm[4]=new se(-1,-1,1,1);Wm[5]=new se(1,-1,1,1);Wm[6]=new se(1,1,1,1);Wm[7]=new se(-1,1,1,1);var n0=new F,zX=new Array(8);for(let e=0;e<8;++e)zX[e]=new se;function Iht(e,t){let n=new St({geometry:new Mh({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:jt.fromColor(t)}}),i=new St({geometry:new Jg({radius:.5}),attributes:{color:jt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Oht=[G.RED,G.GREEN,G.BLUE,G.MAGENTA],Rht=new d;function Mht(e,t){Pht(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 T_({camera:e._sceneCamera,color:G.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new T_({camera:e._shadowMapCamera,color:G.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 T_({camera:e._passes[i].camera,color:Oht[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!c(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Le.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,Rht),a=F.fromTranslationQuaternionRotationScale(i,o,s,n0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Iht(a,G.YELLOW)}e._debugLightFrustum.update(t)}else(!c(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new T_({camera:e._shadowMapCamera,color:G.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function d4(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new F}d4.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var Lht=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);d4.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(Lht,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Nht=new Array(5),Fht=new wi,Bht=new Array(4),P0e=new d,I0e=new d;function kht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,l=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=Bht,g=Nht;for(g[0]=o,g[s]=r,a=0;a<s;++a){let B=(a+1)/s,_=o*Math.pow(u,B),w=o+l*B,D=O.lerp(w,_,f);g[a+1]=D,p[a]=D-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let B=g[0];for(a=0;a<s-1;++a)B+=p[a],g[a+1]=B}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,b=m.right,x=m.bottom,A=m.top,E=m.near,S=m.far,v=n.positionWC,P=n.directionWC,M=n.upWC,R=i.frustum.clone(Fht),L=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let B=F.multiply(R.projectionMatrix,i.viewMatrix,n0),_=F.inverse(B,n0),w=F.multiply(L,_,n0),D=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,P0e),I=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,I0e);for(let j=0;j<8;++j){let U=se.clone(Wm[j],zX[j]);F.multiplyByVector(w,U,U),d.divideByScalar(U,U.w,U),d.minimumByComponent(U,D,D),d.maximumByComponent(U,I,I)}D.x=Math.max(D.x,0),D.y=Math.max(D.y,0),D.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],k=N.camera;k.clone(n);let H=k.frustum;H.left=y+D.x*(b-y),H.right=y+I.x*(b-y),H.bottom=x+D.y*(A-x),H.top=x+I.y*(A-x),H.near=E+D.z*(S-E),H.far=E+I.z*(S-E),N.cullingVolume=k.frustum.computeCullingVolume(v,P,M);let V=e._cascadeMatrices[a];F.multiply(k.getViewProjection(),i.inverseViewMatrix,V),F.multiply(N.textureOffsets,V,V)}}var Uht=new F,Vht=new d,zht=new d,S0e=new d;function Hht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,n0),r=F.inverse(o,n0),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,O.EPSILON10)&&(a=i.upWC);let l=d.cross(s,a,Vht);a=d.cross(l,s,zht),d.normalize(a,a),d.normalize(l,l);let u=d.fromElements(0,0,0,S0e),f=F.computeView(u,s,a,l,Uht),h=F.multiply(f,r,n0),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,P0e),g=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,I0e);for(let S=0;S<8;++S){let v=se.clone(Wm[S],zX[S]);F.multiplyByVector(h,v,v),d.divideByScalar(v,v.w,v),d.minimumByComponent(v,p,p),d.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=S0e;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=F.fromTranslation(m,n0);f=F.multiply(y,f,f);let b=.5*(g.x-p.x),x=.5*(g.y-p.y),A=g.z-p.z,E=n.frustum;E.left=-b,E.right=b,E.bottom=-x,E.top=x,E.near=.01,E.far=A,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(l,n.rightWC)}var Ght=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],jht=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],Wht=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function qht(e,t){let n=new wi;n.fov=O.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=Ght[i],o.upWC=jht[i],o.rightWC=Wht[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Yht=new d,Xht=new d,O0e=new le,w0e=O0e.center;function Kht(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=O0e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Yht),s=d.negate(i.directionWC,Xht),a=d.dot(r,s);if(e.fadingEnabled){let l=O.clamp(a/.1,0,1);e._darkness=O.lerp(1,e.darkness,l)}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)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,w0e),w0e);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function $ht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,l;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),l=Math.min(t.shadowState.farPlane,e.maximumDistance),l=Math.max(l,a+1)):(a=n.frustum.near,l=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=l,e._distance=l-a,Kht(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}jm.prototype.update=function(e){if($ht(this,e),this._needsUpdate)if(Sht(this,e.context),this._isPointLight&&qht(this,e),this._cascadesEnabled&&(Hht(this,e),this._numberOfCascades>1&&kht(this,e)),this._isPointLight)this._shadowMapCullingVolume=ys.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;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Mht(this,e)};jm.prototype.updatePass=function(e,t){D0e(this,e,t)};var Zht=new z;function R0e(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=Zht;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 xt(t,o,!1)}function Qht(e,t,n,i,o,r){let s,a,l;if(c(r)&&(s=r.shaderProgram,a=r.renderState,l=r.uniformMap),r=Je.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!c(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===De.GLOBE,h=n.pass!==De.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=S_.getShadowCastShaderKeyword(p,f,g,h);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!c(s)){let b=u.vertexShaderSource,x=u.fragmentShaderSource,A=S_.createShadowCastVertexShader(b,p,f),E=S_.createShadowCastFragmentShader(x,p,g,h);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=We(a,!1),a.cull=We(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),l=R0e(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=l,r}jm.createReceiveDerivedCommand=function(e,t,n,i,o){c(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,l=s.fragmentShaderSource,u=t.pass===De.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;c(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=Je.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!c(h)||m||n||g){let y=S_.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,y),!c(h)){let b=S_.createShadowReceiveVertexShader(a,u,f),x=S_.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:s._attributeLocations})}p=R0e(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};jm.createCastDerivedCommand=function(e,t,n,i,o){if(c(o)||(o={}),t.castShadows){let r=o.castCommands;c(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let l=0;l<a;++l)r[l]=Qht(e[l],n,t,i,s,r[l]);o.castShaderProgramId=t.shaderProgram.id}return o};jm.prototype.isDestroyed=function(){return!1};jm.prototype.destroy=function(){VX(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 de(this)};var i0=jm;var $E=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function FLt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=NLt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=LLt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!et.equals(a.renderState.viewport,s))&&(a.renderState=Ge.fromCache({viewport:et.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var _0=new Array(8);_0[0]=new se(-1,-1,-1,1);_0[1]=new se(1,-1,-1,1);_0[2]=new se(1,1,-1,1);_0[3]=new se(-1,1,-1,1);_0[4]=new se(-1,-1,1,1);_0[5]=new se(1,-1,1,1);_0[6]=new se(1,1,1,1);_0[7]=new se(-1,1,1,1);var JA=new M,Loe=new Array(8);for(let e=0;e<8;++e)Loe[e]=new se;function BLt(e,t){let n=new Bt({geometry:new ep({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Bt({geometry:new Ey({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Nn({geometryInstances:[n,i],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var kLt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],ULt=new h;function zLt(e,t){FLt(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 r_({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new r_({camera:e._shadowMapCamera,color:z.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 r_({camera:e._passes[i].camera,color:kLt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,ULt),a=M.fromTranslationQuaternionRotationScale(i,r,s,JA);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=BLt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new r_({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function s5(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new M}s5.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var VLt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);s5.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(VLt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var jLt=new Array(5),HLt=new Zi,GLt=new Array(4),cNe=new h,lNe=new h;function WLt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=GLt,g=jLt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),C=r+c*L,w=P.lerp(C,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,E=m.far,v=n.positionWC,S=n.directionWC,I=n.upWC,R=i.frustum.clone(HLt),O=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let L=M.multiply(R.projectionMatrix,i.viewMatrix,JA),_=M.inverse(L,JA),C=M.multiply(O,_,JA),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,cNe),D=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,lNe);for(let j=0;j<8;++j){let k=se.clone(_0[j],Loe[j]);M.multiplyByVector(C,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,D,D)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,D.x=Math.min(D.x,1),D.y=Math.min(D.y,1),D.z=Math.min(D.z,1);let N=e._passes[a],F=N.camera;F.clone(n);let V=F.frustum;V.left=y+w.x*(A-y),V.right=y+D.x*(A-y),V.bottom=b+w.y*(x-b),V.top=b+D.y*(x-b),V.near=T+w.z*(E-T),V.far=T+D.z*(E-T),N.cullingVolume=F.frustum.computeCullingVolume(v,S,I);let B=e._cascadeMatrices[a];M.multiply(F.getViewProjection(),i.inverseViewMatrix,B),M.multiply(N.textureOffsets,B,B)}}var qLt=new M,YLt=new h,XLt=new h,rNe=new h;function KLt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,JA),o=M.inverse(r,JA),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,YLt);a=h.cross(c,s,XLt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,rNe),f=M.computeView(u,s,a,c,qLt),d=M.multiply(f,o,JA),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,cNe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,lNe);for(let E=0;E<8;++E){let v=se.clone(_0[E],Loe[E]);M.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=rNe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=M.fromTranslation(m,JA);f=M.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,M.clone(f,n.viewMatrix),M.inverse(f,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var $Lt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],JLt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],ZLt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function QLt(e,t){let n=new Zi;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=$Lt[i],r.upWC=JLt[i],r.rightWC=ZLt[i],M.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),M.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var eFt=new h,tFt=new h,uNe=new le,oNe=uNe.center;function nFt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=uNe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,eFt),s=h.negate(i.directionWC,tFt),a=h.dot(o,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.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)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),le.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,oNe),oNe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),le.clone(r,e._boundingSphere)}}function iFt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),M.multiplyByPoint(n.viewMatrix,o.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=Nr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,nFt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}g0.prototype.update=function(e){if(iFt(this,e),this._needsUpdate)if(OLt(this,e.context),this._isPointLight&&QLt(this,e),this._cascadesEnabled&&(KLt(this,e),this._numberOfCascades>1&&WLt(this,e)),this._isPointLight)this._shadowMapCullingVolume=aa.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&zLt(this,e)};g0.prototype.updatePass=function(e,t){aNe(this,e,t)};var rFt=new U;function fNe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={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 o=rFt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.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 Mt(t,r,!1)}function oFt(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=at.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&p0.hasClippingForShadowCast(y),b=p0.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=p0.createShadowCastVertexShader(m,p,f),E=p0.createShadowCastFragmentShader(y,p,g,d,A);s=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ze(a,!1),a.cull=Ze(a.cull,!1),a.cull.enabled=!1,a=Ge.fromCache(a)),c=fNe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}g0.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=at.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=p0.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=p0.createShadowReceiveVertexShader(a,u,f),b=p0.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=fNe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};g0.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=oFt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};g0.prototype.isDestroyed=function(){return!1};g0.prototype.destroy=function(){Noe(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 ue(this)};var ZA=g0;var a5=`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 iI=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -8762,7 +9547,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var Jht=!1;function o0(e){this._drawClassificationFBO=new pi({createDepthAttachments:!1}),this._accumulationFBO=new pi({createDepthAttachments:!1}),this._packFBO=new pi,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 G(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(o0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function M0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function L0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function emt(e,t,n,i){M0e(e),e._translucentDepthStencilTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST})}function tmt(e,t,n,i){L0e(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 nmt(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)&&(emt(e,t,o,r),tmt(e,t,o,r));let s,a;if(c(e._packDepthCommand)||(s=new He({sources:[dV]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!c(e._compositeCommand)){s=new He({sources:[$E]}),a={colorTexture:function(){return e._textureToComposite}},Jht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new He({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=Je.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}c(e._copyCommand)||(s=new He({sources:[$E]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),c(e._accumulateCommand)||(s=new He({sources:[$E]}),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 l=!Ke.equals(e._viewport,n.viewport),u=l!==e._useScissorTest;e._useScissorTest=l,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!c(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!c(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),c(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!c(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),c(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}o0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){nmt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};o0.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(De.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let l=i.commands[De.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[De.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(l[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};o0.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),imt(this,e,t)};function imt(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}o0.prototype.isSupported=function(){return this._supported};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){return M0e(this),L0e(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),de(this)};var h4=o0;function omt(){this.command=void 0,this.near=void 0,this.far=void 0}function m4(e,t,n){let i=e.context,o;i.depthTexture&&(o=new a4);let r;e._useOIT&&i.depthTexture&&(r=new l4(i));let s=new Cc(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 f4(i),this.pickDepthFramebuffer=new u4,this.sceneFramebuffer=new KE,this.globeDepth=o,this.globeTranslucencyFramebuffer=new c4,this.oit=r,this.translucentTileClassification=new h4(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var HX=new d,GX=new d;function rmt(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,HX)),d.maximumComponent(d.abs(t.position,GX))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,HX),d.multiplyByScalar(t.position,o,GX),d.equalsEpsilon(HX,GX,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}m4.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return rmt(t,n,O.EPSILON15)?(this._cameraStartFired&&Ei()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ei(),ro.clone(t,n),!0)};function smt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+O.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;l?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let g,m;l?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g));let y=h[p];c(y)?(y.near=g,y.far=m):y=h[p]=new s4(g,m)}}function amt(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 l=s[a];if(o>l.far)continue;if(r<l.near)break;let u=i.pass,f=l.indices[u]++;if(l.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:l}=i,u=a.commandsInFrustums;u[l]=c(u[l])?u[l]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var N0e=new ys,cmt=new $a;m4.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,l=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let L=0;L<f.length;++L)for(let B=0;B<De.NUMBER_OF_PASSES;++B)f[L].indices[B]=0;l.length=0,u.length=0;let h=this._commandExtents,p=h.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:b}=o,x=+Number.MAX_VALUE,A=-Number.MAX_VALUE,E=Number.MAX_VALUE,S=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,P=N0e.planes;for(let L=0;L<5;++L)P[L]=v.planes[L];v=N0e;for(let L=0;L<i.length;++L){let B=i[L],{pass:_,boundingVolume:w}=B;if(_===De.COMPUTE)l.push(B);else if(_===De.OVERLAY)u.push(B);else{let D,I;if(c(w)){if(!e.isVisible(v,B,S))continue;let k=w.computePlaneDistances(r,s,cmt);if(D=k.start,I=k.stop,m=Math.min(m,D),y=Math.max(y,I),b&&B.receiveShadows&&D<i0.MAXIMUM_DISTANCE&&!(_===De.GLOBE&&D<-100&&I>100)){let H=I-D;_!==De.GLOBE&&D<100&&(E=Math.min(E,H)),x=Math.min(x,D),A=Math.max(A,I)}}else B instanceof ti?(D=a.near,I=a.far):(D=a.near,I=a.far,m=Math.min(m,D),y=Math.max(y,I));let N=h[g];c(N)||(N=h[g]=new omt),N.command=B,N.near=D,N.far=I,g++}}b&&(x=Math.min(Math.max(x,a.near),a.far),A=Math.max(Math.min(A,a.far),x),o.nearPlane=x,o.farPlane=A,o.closestObjectSize=E),smt(this,e,m,y);for(let L=0;L<g;L++)amt(this,e,h[L]);if(g<p)for(let L=g;L<p;L++){let B=h[L];if(!c(B.command))break;B.command=void 0}let M=f.length,{frustumSplits:R}=t;R.length=M+1;for(let L=0;L<M;++L)R[L]=f[L].near,L===M-1&&(R[L+1]=f[L].far)};m4.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 ZE=m4;var B0e=.1,lmt=new lh({pass:Uo.MOST_DETAILED_PRELOAD}),umt=new lh({pass:Uo.MOST_DETAILED_PICK}),mI=new lh({pass:Uo.PICK});function Ys(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 on({width:B0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new ZE(e,n,t)}Ys.prototype.update=function(){this._pickPositionCacheDirty=!0};Ys.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return c(i)||(i=new r4,n[t]=i),i};var fmt=new jo,dmt=new d,p4=new d,hmt=new z,mmt=new F;function pmt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2*(t.x-o.x)/o.width-1;l*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(r.transform,mmt);r._setTransform(F.IDENTITY);let h=d.clone(r.position,dmt);d.multiplyByScalar(r.right,l,p4),d.add(p4,h,h),d.multiplyByScalar(r.up,u,p4),d.add(p4,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,hmt),g=fmt;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 _mt=new zl,gmt=new z;function ymt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,l=Math.tan(s.fovy*.5),u=s.aspectRatio*l,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=h*a*l,m=s.getPixelDimensions(o.width,o.height,1,1,gmt),y=m.x*n*.5,b=m.y*i*.5,x=_mt;return x.top=g+b,x.bottom=g-b,x.right=p+y,x.left=p-y,x.near=a,x.far=s.far,x.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function _4(e,t,n,i,o){let r=e.camera.frustum;return r instanceof on||r instanceof jo?pmt(e,t,n,i,o):ymt(e,t,n,i,o)}var g4=new Ke(0,0,3,3),y4=new z,pI=new G(0,0,0,0);function jX(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}Ys.prototype.pick=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Hi.transformWindowToDrawingBuffer(e,t,y4),h=jX(o.drawingBufferHeight,f,n,i,g4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=_4(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=mI,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,pI),e.resolveFramebuffers(u);let p=l.end(h);return o.endFrame(),p};Ys.prototype.pickVoxelCoordinate=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Hi.transformWindowToDrawingBuffer(e,t,y4),h=jX(o.drawingBufferHeight,f,n,i,g4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=_4(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=mI,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,pI),e.resolveFramebuffers(u);let p=l.readCenterPixel(h);return o.endFrame(),p};Ys.prototype.pickMetadata=function(e,t,n){T.typeOf.object("windowPosition",t),T.typeOf.object("pickedMetadataInfo",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 l=r.passState;l.viewport=Ke.clone(s,l.viewport);let u=Hi.transformWindowToDrawingBuffer(e,t,y4),f=jX(i.drawingBufferHeight,u,1,1,g4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=_4(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=mI,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),l=a.begin(f,s),e.updateAndExecuteCommands(l,pI);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(l),e._environmentState.useOIT=h;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,o4.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function bmt(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 l=n.passState;l.viewport=Ke.clone(s,l.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=_4(e,t,1,1,s),o.tilesetPassState=mI,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,l=a.update(i,t,s),e.updateAndExecuteCommands(l,pI),e.resolveFramebuffers(l),i.endFrame()}var xmt=new wi,Tmt=new zl,Amt=new on,Cmt=new jo;Ys.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(T.defined("windowPosition",t),!e.context.depthTexture)throw new C("Picking from the depth buffer is not supported. Check pickPositionSupported.");let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:l}=o;e.view=a;let u=Hi.transformWindowToDrawingBuffer(e,t,y4);e.pickTranslucentDepth?bmt(e,u):(e.updateFrameState(),l.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;c(s.frustum.fov)?f=s.frustum.clone(xmt):c(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(Tmt):c(s.frustum.width)?f=s.frustum.clone(Amt):f=s.frustum.clone(Cmt);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(c(y)&&y>0&&y<1){let b=h[g],x;return e.mode===oe.SCENE2D?(x=s.position.z,s.position.z=x-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,l.update(r),l.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,l.updateFrustum(f)),n=Hi.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===oe.SCENE2D&&(s.position.z=x,l.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var Emt=new he;Ys.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),c(n)&&e.mode!==oe.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Emt);o.cartographicToCartesian(r,n)}return n};function k0e(e,t){let n,i,o=[],r=[],s=[],a=[];c(e)||(e=Number.MAX_VALUE);let l=t();for(;c(l);){let u=l.object,f=l.position,h=l.exclude;if(c(f)&&!c(u)){o.push(l);break}if(!c(u)||!c(u.primitive)||!h&&(o.push(l),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&c(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),c(i)&&c(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),u instanceof ta&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),l=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}Ys.prototype.drillPick=function(e,t,n,i,o){let r=this;return k0e(n,function(){let l=r.pick(e,t,i,o);if(c(l))return{object:l,position:void 0,exclude:!1}}).map(function(l){return l.object})};var F0e=new d,Smt=new d;function wmt(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 U0e(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,F0e),s=d.cross(o,r,F0e),a=d.cross(o,s,Smt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??B0e,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function vmt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,l=U0e(e,o,r,a),u=lmt;u.camera=a,u.cullingVolume=l;let f=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ys.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)vmt(this,e,t[n])&&t.splice(n--,1)};function V0e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(c(o.isCesium3DTileset)?(!c(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Ol&&V0e(o,t,n))}}function b4(e,t,n,i,o,r){let s=[];if(V0e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new wmt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Dmt(e,t){return!c(e)||!c(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Pmt(e,t,n,i,o,r,s){let{context:a,frameState:l}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,U0e(e,n,o,f.camera);let h=Ke.clone(f.viewport,g4),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=umt:l.tilesetPassState=mI,u.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(p,pI),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:y}=f,b=y.length;for(let x=0;x<b;++x){let E=e.getPickDepth(t,x).getDepth(a,0,0);if(c(E)&&E>0&&E<1){let S=y[x],v=S.near*(x!==0?t.opaqueFrustumNearOffset:1),P=S.far,M=v+E*(P-v);g=_n.getPoint(n,M);break}}}if(t.view=t.defaultView,a.endFrame(),c(m)||c(g))return{object:m,position:g,exclude:!c(g)&&r||Dmt(m,i)}}function z0e(e,t,n,i,o,r,s,a){return k0e(i,function(){return Pmt(e,t,n,o,r,s,a)})}function QE(e,t,n,i,o,r,s){let a=z0e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function H0e(e,t,n,i,o,r,s,a){return z0e(e,t,n,i,o,r,s,a)}function x4(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)})})}Ys.prototype.pickFromRay=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");return QE(this,e,t,n,i,!1,!1)};Ys.prototype.drillPickFromRay=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");return H0e(this,e,t,n,i,o,!1,!1)};Ys.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");let o=this;return t=_n.clone(t),n=c(n)?n.slice():n,x4(e,b4(o,e,t,n,i,function(){return QE(o,e,t,n,i,!1,!0)}))};Ys.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");let r=this;return t=_n.clone(t),i=c(i)?i.slice():i,x4(e,b4(r,e,t,i,o,function(){return H0e(r,e,t,n,i,o,!1,!0)}))};var Imt=new d,Omt=new d,Rmt=new _n,G0e=new he;function WX(e,t){let n=e.ellipsoid,i=fi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Omt),r=he.toCartesian(t,n,Imt),s=Rmt;s.origin=r,s.direction=o;let a=new _n;return _n.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function j0e(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,G0e);return WX(e,i)}function W0e(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,G0e).height}function Mmt(e,t,n,i,o){let r=WX(t,n);return b4(e,t,r,i,o,function(){let s=QE(e,t,r,i,o,!0,!0);if(c(s))return W0e(t,s.position)})}function Lmt(e,t,n,i,o,r){let s=j0e(t,n);return b4(e,t,s,i,o,function(){let a=QE(e,t,s,i,o,!0,!0);if(c(a))return d.clone(a.position,r)})}Ys.prototype.sampleHeight=function(e,t,n,i){if(T.defined("position",t),e.mode!==oe.SCENE3D)throw new C("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new C("sampleHeight requires depth texture support. Check sampleHeightSupported.");let o=WX(e,t),r=QE(this,e,o,n,i,!0,!1);if(c(r))return W0e(e,r.position)};Ys.prototype.clampToHeight=function(e,t,n,i,o){if(T.defined("cartesian",t),e.mode!==oe.SCENE3D)throw new C("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new C("clampToHeight requires depth texture support. Check clampToHeightSupported.");let r=j0e(e,t),s=QE(this,e,r,n,i,!0,!1);if(c(s))return d.clone(s.position,o)};Ys.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(T.defined("positions",t),e.mode!==oe.SCENE3D)throw new C("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new C("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Mmt(this,e,t[s],n,i);return x4(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l].height=s[l];return t}))};Ys.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(T.defined("cartesians",t),e.mode!==oe.SCENE3D)throw new C("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new C("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Lmt(this,e,t[s],n,i,t[s]);return x4(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l]=s[l];return t}))};Ys.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var T4=Ys;var A4=`uniform sampler2D colorTexture; +`;var sFt=!1;function QA(e){this._drawClassificationFBO=new ci({createDepthAttachments:!1}),this._accumulationFBO=new ci({createDepthAttachments:!1}),this._packFBO=new ci,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 fi({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new fi({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,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(QA.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function dNe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function hNe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function aFt(e,t,n,i){dNe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST})}function cFt(e,t,n,i){hNe(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 lFt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(aFt(e,t,r,o),cFt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Xe({sources:[a5]}),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 Xe({sources:[iI]}),a={colorTexture:function(){return e._textureToComposite}},sFt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Xe({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=at.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Xe({sources:[iI]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Xe({sources:[iI]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,reference:Xt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:rn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}QA.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){lFt(this,s,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};QA.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ie.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};QA.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),uFt(this,e,t)};function uFt(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}QA.prototype.isSupported=function(){return this._supported};QA.prototype.isDestroyed=function(){return!1};QA.prototype.destroy=function(){return dNe(this),hNe(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()),ue(this)};var c5=QA;function fFt(){this.command=void 0,this.near=void 0,this.far=void 0}function l5(e,t,n){let i=e.context,r;i.depthTexture&&(r=new e5);let o;e._useOIT&&i.depthTexture&&(o=new i5(i));let s=new gc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Nr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new o5(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new r5,this.sceneFramebuffer=new nI,this.edgeFramebuffer=new JG,this.planarFillIdFramebuffer=new ZG,this.globeDepth=r,this.globeTranslucencyFramebuffer=new t5,this.oit=o,this.translucentTileClassification=new c5(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Foe=new h,Boe=new h;function dFt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Foe)),h.maximumComponent(h.abs(t.position,Boe))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,Foe),h.multiplyByScalar(t.position,r,Boe),h.equalsEpsilon(Foe,Boe,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}l5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return dFt(t,n,P.EPSILON15)?(this._cameraStartFired&&xn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xn(),Nr.clone(t,n),!0)};function hFt(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:s}=r,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new QG(g,m)}}function mFt(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var mNe=new aa,pFt=new Gs;l5.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,S=mNe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=mNe;for(let O=0;O<i.length;++O){let L=i[O],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let w,D;if(l(C)){if(!e.isVisible(v,L,E))continue;let F=C.computePlaneDistances(o,s,pFt);if(w=F.start,D=F.stop,m=Math.min(m,w),y=Math.max(y,D),A&&L.receiveShadows&&w<ZA.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&w<-100&&D>100)){let V=D-w;_!==Ie.GLOBE&&w<100&&(T=Math.min(T,V)),b=Math.min(b,w),x=Math.max(x,D)}}else L instanceof fi?(w=a.near,D=a.far):(w=a.near,D=a.far,m=Math.min(m,w),y=Math.max(y,D));let N=d[g];l(N)||(N=d[g]=new fFt),N.command=L,N.near=w,N.far=D,g++}}A&&(b=Math.min(Math.max(b,a.near),a.far),x=Math.max(Math.min(x,a.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),hFt(this,e,m,y);for(let O=0;O<g;O++)mFt(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}let I=f.length,{frustumSplits:R}=t;R.length=I+1;for(let O=0;O<I;++O)R[O]=f[O].near,O===I-1&&(R[O+1]=f[O].far)};l5.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.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 rI=l5;var gNe=.1,gFt=new Tm({pass:go.MOST_DETAILED_PRELOAD}),_Ft=new Tm({pass:go.MOST_DETAILED_PICK}),eM=new Tm({pass:go.PICK});function Ea(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Nr(e);n.frustum=new _n({width:gNe,aspectRatio:1,near:.1}),this._pickOffscreenView=new rI(e,n,t)}Ea.prototype.update=function(){this._pickPositionCacheDirty=!0};Ea.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new $G,n[t]=i),i};var yFt=new Ss,AFt=new h,u5=new h,bFt=new U,xFt=new M;function TFt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=M.clone(o.transform,xFt);o._setTransform(M.IDENTITY);let d=h.clone(o.position,AFt);h.multiplyByScalar(o.right,c,u5),h.add(u5,d,d),h.multiplyByScalar(o.up,u,u5),h.add(u5,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,bFt),g=yFt;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(d,o.directionWC,o.upWC)}var EFt=new Au,CFt=new U;function vFt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,CFt),y=m.x*n*.5,A=m.y*i*.5,b=EFt;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function f5(e,t,n,i,r){let o=e.camera.frustum;return o instanceof _n||o instanceof Ss?TFt(e,t,n,i,r):vFt(e,t,n,i,r)}var tM=new et(0,0,3,3),d5=new U,nM=new z(0,0,0,0);function koe(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function iM(e,t,n,i,r,o){let{context:s,frameState:a,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=s.drawingBufferWidth,u.height=s.drawingBufferHeight;let p=c.passState;p.viewport=et.clone(u,p.viewport);let g=gr.transformWindowToDrawingBuffer(e,t,d5);koe(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=f5(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=eM,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,nM),e.resolveFramebuffers(p)}function rM(e){let{context:t}=e;t.endFrame()}Ea.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=tM;iM(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,s,r):(f=c.end(u,r),f=Promise.resolve(f),yt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),rM(e),f};Ea.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=tM;iM(e,t,a,n,i);let c=s.end(a,r);return rM(e),c};Ea.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight;let u=s.passState;u.viewport=et.clone(a,u.viewport);let f=gr.transformWindowToDrawingBuffer(e,t,d5),d=koe(r.drawingBufferHeight,f,n,i,tM);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=f5(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=eM,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,nM),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Ea.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:s,pickFramebuffer:a}=o;e.view=o,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=o.passState;c.viewport=et.clone(s,c.viewport);let u=gr.transformWindowToDrawingBuffer(e,t,d5),f=koe(i.drawingBufferHeight,u,1,1,tM);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=f5(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=eM,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,nM);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,KG.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function SFt(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=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=et.clone(s,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=f5(e,t,1,1,s),r.tilesetPassState=eM,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,nM),e.resolveFramebuffers(c),i.endFrame()}var wFt=new Zi,IFt=new Au,PFt=new _n,DFt=new Ss;Ea.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 h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:s,defaultView:a}=e,{uniformState:c}=r;e.view=a;let u=gr.transformWindowToDrawingBuffer(e,t,d5);e.pickTranslucentDepth?SFt(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(wFt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(IFt):l(s.frustum.width)?f=s.frustum.clone(PFt):f=s.frustum.clone(DFt);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=s.position.z,s.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=gr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(s.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var RFt=new he;Ea.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,RFt);r.cartographicToCartesian(o,n)}return n};function OFt(e,t,n,i,r,o){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=f.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(d=!0,p.show=Pn.toValue(!1,p.show),r.push(p))}a instanceof pa&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function _Ne(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!OFt(s,t,n,i,r,o);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<r.length;++a){let c=r[a];c.show=Pn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}Ea.prototype.drillPick=function(e,t,n,i,r){return _Ne(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var pNe=new h,MFt=new h;function NFt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function yNe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,pNe),s=h.cross(r,o,pNe),a=h.cross(r,s,MFt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??gNe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function LFt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=yNe(e,r,o,a),u=gFt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ea.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)LFt(this,e,t[n])&&t.splice(n--,1)};function ANe(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof Yl&&ANe(r,t,n))}}function h5(e,t,n,i,r,o){let s=[];if(ANe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new NFt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function FFt(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 BFt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,yNe(e,n,r,f.camera);let d=et.clone(f.viewport,tM),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=_Ft:c.tilesetPassState=eM,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,nM),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(a,0,0);if(l(T)&&T>0&&T<1){let E=y[b],v=E.near*(b!==0?t.opaqueFrustumNearOffset:1),S=E.far,I=v+T*(S-v);g=gn.getPoint(n,I);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||FFt(m,i)}}function Uoe(e,t,n,i,r,o,s,a){return _Ne(function(){let u=BFt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function oI(e,t,n,i,r,o,s){let a=Uoe(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function m5(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Ea.prototype.pickFromRay=function(e,t,n,i){return oI(this,e,t,n,i,!1,!1)};Ea.prototype.drillPickFromRay=function(e,t,n,i,r){return Uoe(this,e,t,n,i,r,!1,!1)};Ea.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=gn.clone(t),n=l(n)?n.slice():n,m5(e,h5(r,e,t,n,i,function(){return oI(r,e,t,n,i,!1,!0)}))};Ea.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=gn.clone(t),i=l(i)?i.slice():i,m5(e,h5(o,e,t,i,r,function(){return Uoe(o,e,t,n,i,r,!1,!0)}))};var kFt=new h,UFt=new h,zFt=new gn,bNe=new he;function zoe(e,t){let n=e.ellipsoid,i=Ni._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,UFt),o=he.toCartesian(t,n,kFt),s=zFt;s.origin=o,s.direction=r;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function xNe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,bNe);return zoe(e,i)}function TNe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,bNe).height}function VFt(e,t,n,i,r){let o=zoe(t,n);return h5(e,t,o,i,r,function(){let s=oI(e,t,o,i,r,!0,!0);if(l(s))return TNe(t,s.position)})}function jFt(e,t,n,i,r,o){let s=xNe(t,n);return h5(e,t,s,i,r,function(){let a=oI(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}Ea.prototype.sampleHeight=function(e,t,n,i){let r=zoe(e,t),o=oI(this,e,r,n,i,!0,!1);if(l(o))return TNe(e,o.position)};Ea.prototype.clampToHeight=function(e,t,n,i,r){let o=xNe(e,t),s=oI(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};Ea.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=VFt(this,e,t[s],n,i);return m5(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Ea.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=jFt(this,e,t[s],n,i,t[s]);return m5(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ea.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var p5=Ea;var g5=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -8782,7 +9567,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var C4=`precision highp float; +`;var _5=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -8890,7 +9675,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var E4=`uniform sampler2D colorTexture; +`;var y5=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -8900,7 +9685,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var S4=`uniform sampler2D colorTexture; +`;var A5=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -8917,7 +9702,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var w4=`uniform sampler2D colorTexture; +`;var b5=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -8933,7 +9718,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var v4=`uniform sampler2D colorTexture; +`;var x5=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -8942,7 +9727,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var D4=`uniform sampler2D colorTexture; +`;var T5=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -8956,7 +9741,7 @@ 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 P4=`uniform sampler2D colorTexture; +`;var E5=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -8991,14 +9776,14 @@ vec4 posInCamera = toEye(v_textureCoordinates, depth); float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var I4=`uniform sampler2D depthTexture; +`;var C5=`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 O4=`uniform sampler2D depthTexture; +`;var v5=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -9048,7 +9833,7 @@ vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var R4=`uniform sampler2D colorTexture; +`;var S5=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -9077,7 +9862,7 @@ float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var M4=`uniform sampler2D colorTexture; +`;var w5=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -9097,7 +9882,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var L4=`in vec2 v_textureCoordinates; +`;var I5=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -9115,221 +9900,718 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var wx=`#define SAMPLES 8 -uniform float delta; -uniform float sigma; -uniform float direction; -uniform sampler2D colorTexture; -#ifdef USE_STEP_SIZE -uniform float stepSize; -#else -uniform vec2 step; -#endif -in vec2 v_textureCoordinates; -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; +`;var jT=`#define SAMPLES 8 +uniform float delta; +uniform float sigma; +uniform float direction; +uniform sampler2D colorTexture; +#ifdef USE_STEP_SIZE +uniform float stepSize; +#else +uniform vec2 step; +#endif +in vec2 v_textureCoordinates; +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 P5=`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; +#define DISTANCE_TO_SPACE 6500000.0 +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); +} +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)); +} +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; +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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) +{ +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); +vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; +vec3 direction = normalize(vec3(ghostVec, 0.0)); +vec4 result = vec4(0.0); +vec4 ghost = vec4(0.0); +for (int i = 0; i < 4; ++i) +{ +vec2 offset = fract(texcoord + ghostVec * float(i)); +ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); +} +result += ghost; +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; +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); +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 D5=`uniform sampler2D colorTexture; +uniform vec3 white; +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 +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 R5=`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 O5=`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 +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 M5=`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); +} +`;/** + * @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 N5=`#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( +FxaaFloat2 pos, +FxaaTex tex, +FxaaFloat2 fxaaQualityRcpFrame, +FxaaFloat fxaaQualitySubpix, +FxaaFloat fxaaQualityEdgeThreshold, +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 -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 N4=`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; -#define DISTANCE_TO_SPACE 6500000.0 -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); -} -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)); -} -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; -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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) -{ -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); -vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; -vec3 direction = normalize(vec3(ghostVec, 0.0)); -vec4 result = vec4(0.0); -vec4 ghost = vec4(0.0); -for (int i = 0; i < 4; ++i) -{ -vec2 offset = fract(texcoord + ghostVec * float(i)); -ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); -} -result += ghost; -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; -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); -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; +#endif } -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; +#endif } -result += texture(colorTexture, v_textureCoordinates); -out_FragColor = result; +#endif } -`;var F4=`uniform sampler2D colorTexture; -uniform vec3 white; -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 -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 B4=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -float rand(vec2 co) -{ -return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); +#endif } -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); +#endif } -`;var k4=`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 -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 U4=`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); +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); } -`;function vx(){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 pi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(vx.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(c(e))return e[e.length-1].getColorTexture(0)}}});function q0e(e){let t=e._framebuffers;if(!c(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 Nmt(e,t){q0e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let l=0;l<r;++l)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[l]=new pi,s[l].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 Y0e(e){let t=e._commands;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Fmt(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 Bmt(e,t){let n=`uniform sampler2D colorTexture; +`;function HT(){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 ci,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(HT.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 ENe(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 HFt(e,t){ENe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new ci,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function CNe(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 GFt(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 WFt(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); @@ -9366,7 +10648,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function kmt(e,t){Y0e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Bmt(r,i),{framebuffer:n[r].framebuffer,uniformMap:Fmt(e,r)});e._commands=o}vx.prototype.clear=function(e){let t=this._framebuffers;if(!c(t))return;let n=this._clearCommand;c(n)||(n=this._clearCommand=new ti({color:new G(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};vx.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Nmt(this,e),kmt(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};vx.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};vx.prototype.isDestroyed=function(){return!1};vx.prototype.destroy=function(){return q0e(this),Y0e(this),de(this)};var V4=vx;var Umt={NEAREST:0,LINEAR:1},Xf=Umt;function Dx(e){e=e??W.EMPTY_OBJECT;let{name:t=jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=Xf.NEAREST,pixelFormat:a=ke.RGBA,pixelDatatype:l=Ue.UNSIGNED_BYTE,clearColor:u=G.BLACK,scissorRectangle:f}=e;if(T.typeOf.string("options.fragmentShader",n),T.typeOf.number.greaterThan("options.textureScale",o,0),T.typeOf.number.lessThanOrEquals("options.textureScale",o,1),!ke.isColorFormat(a))throw new C("options.pixelFormat must be a color format.");this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=l,this._clearColor=u,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 Cc;h.scissorTest={enabled:!0,rectangle:c(f)?Ke.clone(f):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(Dx.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(c(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(c(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 Vmt=/uniform\s+sampler2D\s+depthTexture/g;Dx.prototype._isSupported=function(e){return!Vmt.test(this._fragmentShader)||e.depthTexture};function zmt(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];c(a)&&a!==r&&a instanceof Rt&&!c(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Rt&&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 Hmt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Gmt(e,t){return function(){let n=e[t]();if(c(n))return n.dimensions}}function jmt(e){if(c(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]=Hmt(e,r),n[r]=zmt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Rt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Gmt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(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 Wmt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function qFt(e,t){CNe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(WFt(o,i),{framebuffer:n[o].framebuffer,uniformMap:GFt(e,o)});e._commands=r}HT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new fi({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};HT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,HFt(this,e),qFt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};HT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};HT.prototype.isDestroyed=function(){return!1};HT.prototype.destroy=function(){return ENe(this),CNe(this),ue(this)};var L5=HT;var YFt={NEAREST:0,LINEAR:1},Qd=YFt;function a_(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=Qd.NEAREST,pixelFormat:a=$e.RGBA,pixelDatatype:c=ze.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,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 d=new gc;d.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=d,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(a_.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 XFt=/uniform\s+sampler2D\s+depthTexture/g;a_.prototype._isSupported=function(e){return!XFt.test(this._fragmentShader)||e.depthTexture};function KFt(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(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Dt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function $Ft(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function JFt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function ZFt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=$Ft(e,o),n[o]=KFt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=JFt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Mt(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 QFt(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; @@ -9390,30 +10672,30 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function qmt(e,t){if(c(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(c(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=Wmt(n,o)}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Ymt(e){let t=e._sampleMode,n,i;t===Xf.LINEAR?(n=Yt.LINEAR,i=ui.LINEAR):(n=Yt.NEAREST,i=ui.NEAREST);let o=e._sampler;(!c(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Xmt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Kmt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function $mt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let l=n[a];l=l&&l.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:l,source:u}=i[a];e._actualUniforms[l]=new Rt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!c(e._texturePromise)){e._ready=!0;return}if(o.length===0||c(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let l=o[a],u=r[l],f=e._textureCache.getStageByName(u);if(c(f))e._actualUniforms[l]=Kmt(e,u);else if(typeof u=="string"){let h=new we({url:u});s.push(h.fetchImage().then(Xmt(e,l)))}else e._texturesToCreate.push({name:l,source:u})}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 X0e(e){c(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(!c(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 Rt&&(c(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function Zmt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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 Qmt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!c(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];c(a.pickIds)?i+=a.pickIds.length:c(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.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(c(a.pickIds)){let l=a.pickIds,u=l.length;for(let f=0;f<u;++f){let h=l[f].color;r[o]=G.floatToByte(h.red),r[o+1]=G.floatToByte(h.green),r[o+2]=G.floatToByte(h.blue),r[o+3]=G.floatToByte(h.alpha),o+=4}}else if(c(a.pickId)){let l=a.pickId.color;r[o]=G.floatToByte(l.red),r[o+1]=G.floatToByte(l.green),r[o+2]=G.floatToByte(l.blue),r[o+3]=G.floatToByte(l.alpha),o+=4}}e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Qt.NEAREST})}Dx.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&X0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Zmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0,Qmt(this,e),jmt(this),$mt(this,e),qmt(this,e),Ymt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!c(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!c(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ze.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};Dx.prototype.execute=function(e,t,n,i){if(!c(this._command)||!c(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;c(o)&&(o.context=e),this._command.execute(e,o)};Dx.prototype.isDestroyed=function(){return!1};Dx.prototype.destroy=function(){return X0e(this),de(this)};var fo=Dx;function Px(e){e=e??W.EMPTY_OBJECT,T.defined("options.stages",e.stages),T.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;c(t)||(t=jn()),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(Px.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}}});Px.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};Px.prototype.get=function(e){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,this.length),this._stages[e]};function Jmt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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}Px.prototype.update=function(e,t){this._selectedDirty=Jmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(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)}};Px.prototype.isDestroyed=function(){return!1};Px.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var Ou=Px;var wr={};function qX(e){let o=`#define USE_STEP_SIZE -${wx}`,r=new fo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Xf.LINEAR}),s=new fo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Xf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(l){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=l}},sigma:{get:function(){return r.uniforms.sigma},set:function(l){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=l}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(l){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=l}}}),new Ou({name:e,stages:[r,s],uniforms:a})}wr.createBlurStage=function(){return qX("czm_blur")};wr.createDepthOfFieldStage=function(){let e=qX("czm_depth_of_field_blur"),t=new fo({name:"czm_depth_of_field_composite",fragmentShader:P4,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 Ou({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};wr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};wr.createEdgeDetectionStage=function(){let e=jn();return new fo({name:`czm_edge_detection_${e}`,fragmentShader:O4,uniforms:{length:.25,color:G.clone(G.BLACK)}})};wr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function ept(e){if(!c(e))return wr.createEdgeDetectionStage();let t=new Ou({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); +${e}`}function eBt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=QFt(n,r)}let i=new Xe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function tBt(e){let t=e._sampleMode,n,i;t===Qd.LINEAR?(n=Wt.LINEAR,i=Jn.LINEAR):(n=Wt.NEAREST,i=Jn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function nBt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function iBt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function rBt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,s=[];for(let a=0;a<r.length;++a){let c=r[a],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=iBt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(nBt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.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 vNe(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 r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Dt&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function oBt(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 r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function sBt(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 c=0;c<n.length;++c){let u=n[c];l(u.pickIds)?i+=u.pickIds.length:l(u.pickId)&&++i}let r=Ut.maximumTextureSize;if(i>r&&(a_._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${r}). Features beyond the limit will not have the post-process effect applied.`),i=r),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:Ht.NEAREST});return}let o=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&o<s;++c){let u=n[c];if(l(u.pickIds)){let f=u.pickIds,d=f.length;for(let p=0;p<d&&o<s;++p){let g=f[p].color;a[o]=z.floatToByte(g.red),a[o+1]=z.floatToByte(g.green),a[o+2]=z.floatToByte(g.blue),a[o+3]=z.floatToByte(g.alpha),o+=4}}else if(l(u.pickId)){let f=u.pickId.color;a[o]=z.floatToByte(f.red),a[o+1]=z.floatToByte(f.green),a[o+2]=z.floatToByte(f.blue),a[o+3]=z.floatToByte(f.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Ht.NEAREST})}a_.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&vNe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=oBt(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,sBt(this,e),ZFt(this),rBt(this,e),eBt(this,e),tBt(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),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ge.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=r};a_.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,Ht.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};a_.prototype.isDestroyed=function(){return!1};a_.prototype.destroy=function(){return vNe(this),ue(this)};a_._oneTimeWarning=yt;var zr=a_;function GT(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),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(GT.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}}});GT.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};GT.prototype.get=function(e){return this._stages[e]};function aBt(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 r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}GT.prototype.update=function(e,t){this._selectedDirty=aBt(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 r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};GT.prototype.isDestroyed=function(){return!1};GT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var zf=GT;var is={};function Voe(e){let r=`#define USE_STEP_SIZE +${jT}`,o=new zr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Qd.LINEAR}),s=new zr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Qd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new zf({name:e,stages:[o,s],uniforms:a})}is.createBlurStage=function(){return Voe("czm_blur")};is.createDepthOfFieldStage=function(){let e=Voe("czm_depth_of_field_blur"),t=new zr({name:"czm_depth_of_field_composite",fragmentShader:E5,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 zf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isDepthOfFieldSupported=function(e){return e.context.depthTexture};is.createEdgeDetectionStage=function(){let e=Kn();return new zr({name:`czm_edge_detection_${e}`,fragmentShader:v5,uniforms:{length:.25,color:z.clone(z.BLACK)}})};is.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function cBt(e){if(!l(e))return is.createEdgeDetectionStage();let t=new zf({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +`,r+=` 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; +`,n[`edgeTexture${a}`]=e[a].name;let o=`${i}in vec2 v_textureCoordinates; void main() { vec4 color = vec4(0.0); for (int i = 0; i < ${e.length}; i++) { -${o} } +${r} } out_FragColor = color; } -`,s=new fo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Ou({name:"czm_edge_detection_composite",stages:[t,s]})}wr.createSilhouetteStage=function(e){let t=ept(e),n=new fo({name:"czm_silhouette_color_edges",fragmentShader:U4,uniforms:{silhouetteTexture:t.name}});return new Ou({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};wr.isSilhouetteSupported=function(e){return e.context.depthTexture};wr.createBloomStage=function(){let e=new fo({name:"czm_bloom_contrast_bias",fragmentShader:D4,uniforms:{contrast:128,brightness:-.3}}),t=qX("czm_bloom_blur"),n=new Ou({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new fo({name:"czm_bloom_generate_composite",fragmentShader:w4,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 Ou({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};wr.createAmbientOcclusionStage=function(){let e=new fo({name:"czm_ambient_occlusion_generate",fragmentShader:C4,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new fo({name:"czm_ambient_occlusion_composite",fragmentShader:E4,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 Ou({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};wr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var tpt=`#define FXAA_QUALITY_PRESET 39 -${_V} -${L4}`;wr.createFXAAStage=function(){return new fo({name:"czm_FXAA",fragmentShader:tpt,sampleMode:Xf.LINEAR})};wr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=A4,new fo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=R4,new fo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=M4,new fo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=k4,new fo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=F4,new fo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:G.WHITE,autoExposure:void 0,exposure:1}})};wr.createAutoExposureStage=function(){return new V4};wr.createBlackAndWhiteStage=function(){return new fo({name:"czm_black_and_white",fragmentShader:S4,uniforms:{gradations:5}})};wr.createBrightnessStage=function(){return new fo({name:"czm_brightness",fragmentShader:v4,uniforms:{brightness:.5}})};wr.createNightVisionStage=function(){return new fo({name:"czm_night_vision",fragmentShader:B4})};wr.createDepthViewStage=function(){return new fo({name:"czm_depth_view",fragmentShader:I4})};wr.createLensFlareStage=function(){return new fo({name:"czm_lens_flare",fragmentShader:N4,uniforms:{dirtTexture:tn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:tn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ie.WGS84.maximumRadius}})};var Kf=wr;function w_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function gI(e){for(;c(e.length);)e=e.get(e.length-1);return e.name}function YX(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(c(o)){let a=e.getStageByName(o);r[gI(a)]=!0}let s=i.uniforms;if(c(s)){let a=Object.getOwnPropertyNames(s),l=a.length;for(let u=0;u<l;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);c(h)&&(r[gI(h)]=!0)}}}return i.name}function _I(e,t,n,i,o){if(c(i.enabled)&&!i.enabled||c(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!c(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,l=i.length;for(let h=0;h<l;++h){let p=i.get(h);c(p.length)?a=_I(e,t,n,p,o):a=YX(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<l;++u)f=gI(i.get(u)),c(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<l;++u){f=gI(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[gI(i.get(p))]=!0}return a}function npt(e,t){let n={};if(c(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=_I(e,t,n,i,void 0);a=_I(e,t,n,o,a),a=YX(e,t,n,r,a),a=_I(e,t,n,e,a),YX(e,t,n,s,a)}else _I(e,t,n,e,void 0);return n}function ipt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,l=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(h=p[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||l!==h.pixelDatatype||!G.equals(u,h.clearColor))continue;let m=h.stages,y=m.length,b=!1;for(let x=0;x<y;++x)if(n[m[x]]){b=!0;break}if(!b)break}return c(h)&&f<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:l,clearColor:u,stages:[t],buffer:new pi({pixelFormat:a,pixelDatatype:l}),clear:void 0},p.push(h),h)}function opt(e,t){let n=npt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=ipt(e,i,n[i]))}function XX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function rpt(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],l=a.textureScale,u=Math.ceil(n*l),f=Math.ceil(i*l),h=Math.min(u,f);a.forcePowerOfTwo&&(O.isPowerOfTwo(h)||(h=O.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}w_.prototype.updateDependencies=function(){this._updateDependencies=!0};w_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=c(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=c(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=c(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=c(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!c(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(XX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&opt(this,e);let l=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==l||this._height!==u;!n&&!f||(this._width=l,this._height=u,this._updateDependencies=!1,XX(this),rpt(this,e))};w_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};w_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};w_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};w_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(c(t))return t.buffer.framebuffer};w_.prototype.isDestroyed=function(){return!1};w_.prototype.destroy=function(){return XX(this),de(this)};var JE=w_;var eS={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};function K0e(e){return e===eS.REINHARD||e===eS.MODIFIED_REINHARD||e===eS.FILMIC||e===eS.ACES||e===eS.PBR_NEUTRAL}var r0=Object.freeze(eS);var KX=[];function Jc(){let e=Kf.createFXAAStage(),t=Kf.createAmbientOcclusionStage(),n=Kf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Kf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=r0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new JE(this),r={},s=KX;for(s.push(e,t,n,i);s.length>0;){let l=s.pop();r[l.name]=l,l._textureCache=o;let u=l.length;if(c(u))for(let f=0;f<u;++f)s.push(l.get(f))}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(Jc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let l=t[a];e=e||l.ready&&l.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 $X(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(c(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(!c(t))continue;if(c(t.selected))return!0;let n=t.length;if(c(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;if(!K0e(e))throw new C("tonemapper was set to an invalid value.");c(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case r0.REINHARD:n=Kf.createReinhardTonemappingStage(t);break;case r0.MODIFIED_REINHARD:n=Kf.createModifiedReinhardTonemappingStage(t);break;case r0.FILMIC:n=Kf.createFilmicTonemappingStage(t);break;case r0.PBR_NEUTRAL:n=Kf.createPbrNeutralTonemappingStage(t);break;default:n=Kf.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,c(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 $X(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}Jc.prototype.add=function(e){T.typeOf.object("stage",e);let t=this._stageNames,n=KX;for(n.push(e);n.length>0;){let o=n.pop();if(c(t[o.name]))throw new C(`${o.name} has already been added to the collection or does not have a unique name.`);t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(c(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};Jc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=KX;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(c(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};Jc.prototype.contains=function(e){return c(e)&&c(e._index)&&e._textureCache===this._textureCache};Jc.prototype.get=function(e){$X(this);let t=this._stages,n=t.length;return T.typeOf.number.greaterThanOrEquals("stages length",n,0),T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,n),t[e]};Jc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Jc.prototype.getStageByName=function(e){return this._stageNames[e]};Jc.prototype.update=function(e,t,n){$X(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 x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&(o[s++]=A)}o.length=s;let a=s!==i.length;if(!a){for(let x=0;x<s;++x)if(o[x]!==i[x]){a=!0;break}}let l=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=l.enabled&&l._isSupported(e),m=u.enabled&&u._isSupported(e),y=h.enabled&&h._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=b,this._textureCacheDirty=!1),c(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!c(this._randomTexture)&&g){let A=new Uint8Array(196608);for(let E=0;E<196608;E+=3)A[E]=Math.floor(Math.random()*255);this._randomTexture=new Rt({context:e,pixelFormat:ke.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:A,width:256,height:256},sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})})}this._textureCache.update(e),p.update(e,t),l.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let x=0;x<r.length;++x)r[x].update(e,t);s=0;for(let x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};Jc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function Ix(e){for(;c(e.length);)e=e.get(e.length-1);return e.outputTexture}Jc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(c(t))return Ix(t)};function qm(e,t,n,i,o){if(c(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){qm(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)qm(e.get(r),t,Ix(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)qm(e.get(r),t,n,i,o)}Jc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,l=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),p=l.enabled&&l._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!h&&!p&&!m&&r===0)return;let b=t;h&&a.ready&&(qm(a,e,b,n,i),b=Ix(a)),p&&l.ready&&(qm(l,e,b,n,i),b=Ix(l)),g&&u.ready&&qm(u,e,b,n,i),m&&f.ready&&(qm(f,e,b,n,i),b=Ix(f));let x=b;if(r>0){qm(o[0],e,b,n,i);for(let A=1;A<r;++A)qm(o[A],e,Ix(o[A-1]),n,i);x=Ix(o[r-1])}y&&s.ready&&qm(s,e,x,n,i)};Jc.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Jc.prototype.isDestroyed=function(){return!1};Jc.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(),de(this)};var z4=Jc;var spt={SHIFT:0,CTRL:1,ALT:2},ba=Object.freeze(spt);var apt={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},Cn=Object.freeze(apt);function s0(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 nK(e,t){let n=e;return c(t)&&(n+=`+${t}`),n}function Ox(e){if(e.shiftKey)return ba.SHIFT;if(e.ctrlKey)return ba.CTRL;if(e.altKey)return ba.ALT}var Ps={LEFT:0,MIDDLE:1,RIGHT:2};function Ru(e,t,n,i){function o(r){i(e,r)}zt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function cpt(e){let t=e._element,n=c(t.disableRootEvents)?t:document;zt.supportsPointerEvents()?(Ru(e,"pointerdown",t,mpt),Ru(e,"pointerup",t,rbe),Ru(e,"pointermove",t,ppt),Ru(e,"pointercancel",t,rbe)):(Ru(e,"mousedown",t,sbe),Ru(e,"mouseup",n,abe),Ru(e,"mousemove",n,cbe),Ru(e,"touchstart",t,dpt),Ru(e,"touchend",n,ebe),Ru(e,"touchmove",n,hpt),Ru(e,"touchcancel",n,ebe)),Ru(e,"dblclick",t,upt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ru(e,i,t,fpt)}function lpt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var $0e={position:new z};function iK(e){e._lastSeenTouchEvent=Ei()}function oK(e){return Ei()-e._lastSeenTouchEvent>fh.mouseEmulationIgnoreMilliseconds}function tK(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function sbe(e,t){if(!oK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Ps.LEFT)i=Cn.LEFT_DOWN;else if(n===Ps.MIDDLE)i=Cn.MIDDLE_DOWN;else if(n===Ps.RIGHT)i=Cn.RIGHT_DOWN;else return;let o=s0(e,t,e._primaryPosition);z.clone(o,e._primaryStartPosition),z.clone(o,e._primaryPreviousPosition);let r=Ox(t),s=e.getInputAction(i,r);c(s)&&(z.clone(o,$0e.position),s($0e),t.preventDefault())}var Z0e={position:new z},Q0e={position:new z};function ZX(e,t,n,i){let o=Ox(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(c(r)||c(s)){let a=s0(e,i,e._primaryPosition);if(c(r)&&(z.clone(a,Z0e.position),r(Z0e)),c(s)){let l=e._primaryStartPosition;tK(l,a,e._clickPixelTolerance)&&(z.clone(a,Q0e.position),s(Q0e))}}}function abe(e,t){if(!oK(e))return;let n=t.button;n!==Ps.LEFT&&n!==Ps.MIDDLE&&n!==Ps.RIGHT||(e._buttonDown[Ps.LEFT]&&(ZX(e,Cn.LEFT_UP,Cn.LEFT_CLICK,t),e._buttonDown[Ps.LEFT]=!1),e._buttonDown[Ps.MIDDLE]&&(ZX(e,Cn.MIDDLE_UP,Cn.MIDDLE_CLICK,t),e._buttonDown[Ps.MIDDLE]=!1),e._buttonDown[Ps.RIGHT]&&(ZX(e,Cn.RIGHT_UP,Cn.RIGHT_CLICK,t),e._buttonDown[Ps.RIGHT]=!1))}var QX={startPosition:new z,endPosition:new z};function cbe(e,t){if(!oK(e))return;let n=Ox(t),i=s0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Cn.MOUSE_MOVE,n);c(r)&&(z.clone(o,QX.startPosition),z.clone(i,QX.endPosition),r(QX)),z.clone(i,o),(e._buttonDown[Ps.LEFT]||e._buttonDown[Ps.MIDDLE]||e._buttonDown[Ps.RIGHT])&&t.preventDefault()}var J0e={position:new z};function upt(e,t){let n=t.button,i;if(n===Ps.LEFT)i=Cn.LEFT_DOUBLE_CLICK;else return;let o=Ox(t),r=e.getInputAction(i,o);c(r)&&(s0(e,t,J0e.position),r(J0e))}function fpt(e,t){let n;if(c(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(!c(n))return;let i=Ox(t),o=e.getInputAction(Cn.WHEEL,i);c(o)&&(o(n),t.preventDefault())}function dpt(e,t){iK(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,s0(e,r,new z));H4(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.set(s,z.clone(a.get(s)))}function ebe(e,t){iK(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);H4(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.remove(s)}var tbe={position:new z},JX={position1:new z,position2:new z},nbe={position:new z},ibe={position:new z},obe={position:new z};function H4(e,t){let n=Ox(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Ps.LEFT]){if(e._buttonDown[Ps.LEFT]=!1,c(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Cn.LEFT_UP,n),c(r)&&(z.clone(e._primaryPosition,nbe.position),r(nbe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Cn.LEFT_CLICK,n),c(s))){let l=e._primaryStartPosition,u=e._previousPositions.values[0];tK(l,u,e._clickPixelTolerance)&&(z.clone(e._primaryPosition,ibe.position),s(ibe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Cn.PINCH_END,n),c(r)&&r()),o===1&&!a){let l=i.values[0];z.clone(l,e._primaryPosition),z.clone(l,e._primaryStartPosition),z.clone(l,e._primaryPreviousPosition),e._buttonDown[Ps.LEFT]=!0,r=e.getInputAction(Cn.LEFT_DOWN,n),c(r)&&(z.clone(l,tbe.position),r(tbe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Cn.RIGHT_CLICK,n),c(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];tK(u,f,e._holdPixelTolerance)&&(z.clone(e._primaryPosition,obe.position),s(obe))}},fh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Cn.PINCH_START,n),c(r)&&(z.clone(i.values[0],JX.position1),z.clone(i.values[1],JX.position2),r(JX),t.preventDefault()))}function hpt(e,t){iK(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 u=a.get(s);c(u)&&s0(e,r,u)}lbe(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,z.clone(a.get(s),l.get(s))}var eK={startPosition:new z,endPosition:new z},yI={distance:{startPosition:new z,endPosition:new z},angleAndHeight:{startPosition:new z,endPosition:new z}};function lbe(e,t){let n=Ox(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Ps.LEFT]){let a=i.values[0];z.clone(a,e._primaryPosition);let l=e._primaryPreviousPosition;s=e.getInputAction(Cn.MOUSE_MOVE,n),c(s)&&(z.clone(l,eK.startPosition),z.clone(a,eK.endPosition),s(eK)),z.clone(a,l),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Cn.PINCH_MOVE,n),c(s))){let a=i.values[0],l=i.values[1],u=o.values[0],f=o.values[1],h=l.x-a.x,p=l.y-a.y,g=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,y=f.y-u.y,b=Math.sqrt(m*m+y*y)*.25,x=(l.y+a.y)*.125,A=(f.y+u.y)*.125,E=Math.atan2(p,h),S=Math.atan2(y,m);z.fromElements(0,b,yI.distance.startPosition),z.fromElements(0,g,yI.distance.endPosition),z.fromElements(S,A,yI.angleAndHeight.startPosition),z.fromElements(E,x,yI.angleAndHeight.endPosition),s(yI)}}function mpt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,s0(e,t,new z)),H4(e,t),e._previousPositions.set(i,z.clone(n.get(i)))}else sbe(e,t)}function rbe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),H4(e,t),e._previousPositions.remove(i)}else abe(e,t)}function ppt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!c(o))return;s0(e,t,o),lbe(e,t);let r=e._previousPositions;z.clone(n.get(i),r.get(i))}else cbe(e,t)}function fh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-fh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new z,this._primaryPosition=new z,this._primaryPreviousPosition=new z,this._positions=new Et,this._previousPositions=new Et,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,cpt(this)}fh.prototype.setInputAction=function(e,t,n){if(!c(e))throw new C("action is required.");if(!c(t))throw new C("type is required.");let i=nK(t,n);this._inputEvents[i]=e};fh.prototype.getInputAction=function(e,t){if(!c(e))throw new C("type is required.");let n=nK(e,t);return this._inputEvents[n]};fh.prototype.removeInputAction=function(e,t){if(!c(e))throw new C("type is required.");let n=nK(e,t);delete this._inputEvents[n]};fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){return lpt(this),de(this)};fh.mouseEmulationIgnoreMilliseconds=800;fh.touchHoldDelayMilliseconds=1500;var $f=fh;function Rx(e){T.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Rx.prototype.completeMorph=function(){c(this._completeMorph)&&this._completeMorph()};Rx.prototype.morphTo2D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof on,!(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(F.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?Xpt(this,e):t_t(this,e,t),e===0&&c(this._completeMorph)&&this._completeMorph())};var _pt=new d,gpt=new d,ypt=new d,bpt=new d,xpt=new d,Tpt=new d,Apt=new d,Cpt=new he,Ept=new F,Spt=new wi,wpt=new on,vpt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};Rx.prototype.morphToColumbusView=function(e,t){c(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(F.IDENTITY);let i=_pt,o=gpt,r=ypt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,Apt),h=Ot.eastNorthUpToFixedFrame(f,t,Ept);F.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Cpt),i),F.multiplyByPointAsVector(h,o,o),F.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=wpt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Spt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=O.toRadians(60));let a=vpt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let l=i_t(a);bI(this,l),this._previousMode===oe.SCENE2D?n_t(this,e,a,l):(a.position2D=F.multiplyByPoint(ro.TRANSFORM_2D,i,bpt),a.direction2D=F.multiplyByPointAsVector(ro.TRANSFORM_2D,o,xpt),a.up2D=F.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Tpt),n._mode=oe.MORPHING,xbe(this,e,a,l)),e===0&&c(this._completeMorph)&&this._completeMorph()};var aK={position:new d,direction:new d,up:new d,frustum:void 0},fbe=new wi;Rx.prototype.morphTo3D=function(e,t){c(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(F.IDENTITY),this._previousMode===oe.SCENE2D)kpt(this,e,t);else{let i;e>0?(i=aK,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=dbe(this,t);let o,r=n.camera;r.frustum instanceof on?o=r.frustum.clone():(o=fbe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=O.toRadians(60)),i.frustum=o;let s=Abe(i);bI(this,s),sK(this,e,i,s)}e===0&&c(this._completeMorph)&&this._completeMorph()}};Rx.prototype.isDestroyed=function(){return!1};Rx.prototype.destroy=function(){return G4(this),de(this)};function bI(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new $f(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function G4(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 Dpt=new he,Ppt=new d,Ipt=new F;function dbe(e,t){let n=e._scene,i=n.camera,o=aK,r=o.position,s=o.direction,a=o.up,l=n.mapProjection.unproject(i.position,Dpt);t.cartographicToCartesian(l,r);let u=t.scaleToGeodeticSurface(r,Ppt),f=Ot.eastNorthUpToFixedFrame(u,t,Ipt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),o}var Opt=new d,Rpt=new d,Mpt=new d,Lpt=new d,Npt=new d,Fpt=new d;function sK(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,Opt),a=d.clone(r.direction,Rpt),l=d.clone(r.up,Mpt),u=F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,Lpt),f=F.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,Npt),h=F.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,Fpt);function p(m){Zf(s,u,m.time,r.position),Zf(a,f,m.time,r.direction),Zf(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Tbe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Bpt=new on,hbe=new d,mbe=new d,pbe=new d,cK=new d,_be=new d,gbe=new d;function kpt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=aK,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=dbe(e,n));let s;e._morphToOrthographic?(s=Bpt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=fbe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=O.toRadians(60)),r.frustum=s;let a=Abe(r);bI(e,a);let l;e._morphToOrthographic?l=function(){sK(e,t,r,a)}:l=function(){bbe(e,t,r,function(){sK(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,cK),complete:function(){i._mode=oe.MORPHING,l()}})):l()}function Zf(e,t,n,i){return d.lerp(e,t,n,i)}function ybe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof on)return;let a=s.frustum.fov,l=O.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(l*.5)+1e7;function f(p){s.frustum.fov=O.lerp(a,l,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var Upt=new d,Vpt=new d,zpt=new d,rK=new d,Hpt=new d,Gpt=new d,jpt=new jo,Wpt=new _n,qpt=new d,Ypt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Xpt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,Upt),r=d.clone(i.direction,Vpt),s=d.clone(i.up,zpt),a=d.negate(d.UNIT_Z,Hpt),l=d.clone(d.UNIT_Y,Gpt),u=rK;if(t>0)d.clone(d.ZERO,rK),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,rK);let b=Wpt;F.multiplyByPoint(ro.TRANSFORM_2D,o,b.origin),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r,b.direction);let x=n.globe;if(c(x)){let A=x.pickWorldCoordinates(b,n,!0,qpt);c(A)&&(F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,A,u),u.z+=d.distance(o,u))}}let f=jpt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=Ypt;h.position=u,h.direction=a,h.up=l,h.frustum=f;let p=Cbe(h);bI(e,p);function g(b){Zf(o,u,b.time,i.position),Zf(r,a,b.time,i.direction),Zf(s,l,b.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,x){b.position.z=x}let y=n.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){ybe(e,t,h,m,p)}});e._currentTweens.push(y)}var ube=new he,Kpt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new jo},$pt={position:new d,direction:new d,up:new d,frustum:void 0},Zpt=new d,Qpt=new _n,Jpt=new F,e_t=new d;function t_t(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Kpt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,ube),i.mapProjection.project(ube,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=Qpt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,e_t),m=Ot.eastNorthUpToFixedFrame(g,n,Jpt);F.inverseTransformation(m,m),F.multiplyByPointAsVector(m,p,p),F.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let y=i.globe;if(c(y)){let b=y.pickWorldCoordinates(h,i,!0,Zpt);if(c(b)){let x=d.distance(r.position2D,b);b.x+=x,d.clone(b,r.position2D)}}}function s(h,p){h.position.x=p}F.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),F.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 l=$pt;F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,l.position),d.clone(r.direction,l.direction),d.clone(r.up,l.up),l.frustum=a;let u=Cbe(l);bI(e,u);function f(){ybe(e,t,r,s,u)}xbe(e,t,r,f)}function bbe(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,l=O.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(l*.5)+1e7,r.frustum.fov=l;function f(p){r.frustum.fov=O.lerp(l,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function n_t(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,cK),a=d.clone(n.direction,_be),l=d.clone(n.up,gbe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,hbe),h=d.clone(r.direction,mbe),p=d.clone(r.up,pbe);f.z=s.z;function g(y){Zf(f,s,y.time,r.position),Zf(h,a,y.time,r.direction),Zf(p,l,y.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():bbe(e,0,n,u)}function xbe(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,hbe),a=d.clone(r.direction,mbe),l=d.clone(r.up,pbe),u=d.clone(n.position2D,cK),f=d.clone(n.direction2D,_be),h=d.clone(n.up2D,gbe);function p(m){Zf(s,u,m.time,r.position),Zf(a,f,m.time,r.direction),Zf(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Tbe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function Tbe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Qr.QUARTIC_OUT};c(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function Abe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),G4(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function Cbe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),G4(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function i_t(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),G4(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var j4=Rx;var o_t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Vi=Object.freeze(o_t);function Xs(e,t){let n=`${e}`;return c(t)&&(n+=`+${t}`),n}function r_t(e,t){z.clone(e.distance.startPosition,t.distance.startPosition),z.clone(e.distance.endPosition,t.distance.endPosition),z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Ebe(e,t,n){let i=Xs(Vi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,l=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new z;let u=e._movement[i];c(u)||(u=e._movement[i]={}),u.distance={startPosition:new z,endPosition:new z},u.angleAndHeight={startPosition:new z,endPosition:new z},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,z.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,l[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(r_t(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(z.clone(f.distance.endPosition,u.distance.endPosition),z.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function Sbe(e,t){let n=Xs(Vi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];c(s)||(s=e._movement[n]={});let a=e._lastMovement[n];c(a)||(a=e._lastMovement[n]={startPosition:new z,endPosition:new z,valid:!1}),s.startPosition=new z,z.clone(z.ZERO,s.startPosition),s.endPosition=new z,e._eventHandler.setInputAction(function(l){let u=7.5*O.toRadians(l);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,z.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Cn.WHEEL,t)}function tS(e,t,n){let i=Xs(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new z;let a=e._lastMovement[i];c(a)||(a=e._lastMovement[i]={startPosition:new z,endPosition:new z,valid:!1});let l,u;n===Vi.LEFT_DRAG?(l=Cn.LEFT_DOWN,u=Cn.LEFT_UP):n===Vi.RIGHT_DRAG?(l=Cn.RIGHT_DOWN,u=Cn.RIGHT_UP):n===Vi.MIDDLE_DRAG&&(l=Cn.MIDDLE_DOWN,u=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,z.clone(f.position,r[i])},l,t),e._eventHandler.setInputAction(function(){lK(Xs(n,void 0),e);for(let f of Object.values(ba)){let h=Xs(n,f);lK(h,e)}},u,t)}function lK(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 wbe(e,t){z.clone(e.startPosition,t.startPosition),z.clone(e.endPosition,t.endPosition)}function s_t(e,t,n){let i=n._isDown,o=!1,r=Xs(e,t);for(let[l,u]of Object.entries(i))l.startsWith(e)&&u&&l!==r&&(o=!0,lK(l,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];c(a)||(a=n._lastMovement[r]={startPosition:new z,endPosition:new z,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function vbe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Vi)if(Vi.hasOwnProperty(s)){let a=Vi[s];if(c(a)){let l=Xs(a,t);n[l]=!0,c(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new z,endPosition:new z,valid:!1}),c(e._movement[l])||(e._movement[l]={startPosition:new z,endPosition:new z})}}e._eventHandler.setInputAction(function(s){for(let a in Vi)if(Vi.hasOwnProperty(a)){let l=Vi[a];if(c(l)){let u=Xs(l,t);s_t(l,t,e),r[u]&&(n[u]?(wbe(i[u],o[u]),o[u].valid=!0,wbe(s,i[u]),n[u]=!1):z.clone(s.endPosition,i[u].endPosition))}}z.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function Qf(e){if(!c(e))throw new C("canvas is required.");this._eventHandler=new $f(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new z,Sbe(this,void 0),Ebe(this,void 0,e),tS(this,void 0,Vi.LEFT_DRAG),tS(this,void 0,Vi.RIGHT_DRAG),tS(this,void 0,Vi.MIDDLE_DRAG),vbe(this,void 0);for(let t in ba)if(ba.hasOwnProperty(t)){let n=ba[t];c(n)&&(Sbe(this,n),Ebe(this,n,e),tS(this,n,Vi.LEFT_DRAG),tS(this,n,Vi.RIGHT_DRAG),tS(this,n,Vi.MIDDLE_DRAG),vbe(this,n))}}Object.defineProperties(Qf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Xs(Vi.WHEEL)]||!this._update[Xs(Vi.WHEEL,ba.SHIFT)]||!this._update[Xs(Vi.WHEEL,ba.CTRL)]||!this._update[Xs(Vi.WHEEL,ba.ALT)];return this._buttonsDown>0||e}}});Qf.prototype.isMoving=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return!this._update[n]};Qf.prototype.getMovement=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._movement[n]};Qf.prototype.getLastMovement=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t),i=this._lastMovement[n];if(i.valid)return i};Qf.prototype.isButtonDown=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._isDown[n]};Qf.prototype.getStartMousePosition=function(e,t){if(!c(e))throw new C("type is required.");if(e===Vi.WHEEL)return this._currentMousePosition;let n=Xs(e,t);return this._eventStartPosition[n]};Qf.prototype.getButtonPressTime=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._pressTime[n]};Qf.prototype.getButtonReleaseTime=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._releaseTime[n]};Qf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Qf.prototype.isDestroyed=function(){return!1};Qf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),de(this)};var W4=Qf;function q4(e,t,n,i,o,r,s,a,l,u){this._tweens=e,this._tweenjs=t,this._startObject=We(n),this._stopObject=We(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=l,this.cancel=u,this.needsStart=!0}Object.defineProperties(q4.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}}});q4.prototype.cancelTween=function(){this._tweens.remove(this)};function dh(){this._tweens=[]}Object.defineProperties(dh.prototype,{length:{get:function(){return this._tweens.length}}});dh.prototype.add=function(e){if(e=e??W.EMPTY_OBJECT,!c(e.startObject)||!c(e.stopObject))throw new C("options.startObject and options.stopObject are required.");if(!c(e.duration)||e.duration<0)throw new C("options.duration is required and must be positive.");if(e.duration===0)return c(e.complete)&&e.complete(),new q4(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/qn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Qr.LINEAR_NONE,r=e.startObject,s=new x_e(r);s.to(We(e.stopObject),t),s.delay(i),s.easing(o),c(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new q4(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};dh.prototype.addProperty=function(e){e=e??W.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;if(!c(t)||!c(e.property))throw new C("options.object and options.property are required.");if(!c(t[n]))throw new C("options.object must have the specified property.");if(!c(i)||!c(o))throw new C("options.startValue and options.stopValue are required.");function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};dh.prototype.addAlpha=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new C("options.material is required.");let n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&c(t.uniforms[o])&&c(t.uniforms[o].alpha)&&n.push(o);if(n.length===0)throw new C("material has no properties with alpha components.");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:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};dh.prototype.addOffsetIncrement=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new C("material is required.");if(!c(t.uniforms.offset))throw new C("material.uniforms must have an offset property.");let n=t.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})};dh.prototype.remove=function(e){if(!c(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),c(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};dh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),c(n.cancel)&&n.cancel()}e.length=0};dh.prototype.contains=function(e){return c(e)&&this._tweens.indexOf(e)!==-1};dh.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._tweens[e]};dh.prototype.update=function(e){let t=this._tweens,n=0;for(e=c(e)?e/qn.SECONDS_PER_MILLISECOND:Ei();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 nS=dh;function TI(e){if(!c(e))throw new C("scene is required.");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=Vi.LEFT_DRAG,this.zoomEventTypes=[Vi.RIGHT_DRAG,Vi.WHEEL,Vi.PINCH],this.rotateEventTypes=Vi.LEFT_DRAG,this.tiltEventTypes=[Vi.MIDDLE_DRAG,Vi.PINCH,{eventType:Vi.LEFT_DRAG,modifier:ba.CTRL},{eventType:Vi.RIGHT_DRAG,modifier:ba.CTRL}],this.lookEventTypes={eventType:Vi.LEFT_DRAG,modifier:ba.SHIFT};let t=e.ellipsoid??ie.default;this.minimumPickingTerrainHeight=ie.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ie.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ie.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ie.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 W4(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 nS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new z(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new z(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new z,this._strafeEndMousePosition=new z,this._zoomMouseStart=new z(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new z,this._panLastWorldPosition=new d,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,O.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 a_t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function c_t(e){return z.equalsEpsilon(e.startPosition,e.endPosition,O.EPSILON14)}var l_t=.4;function u_t(e,t,n,i,o,r,s){let a=r[s];c(a)||(a=r[s]={startPosition:new z,endPosition:new z,motion:new z,inertiaEnabled:!0});let l=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=l&&u&&(u.getTime()-l.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(l&&u&&f<l_t){let g=a_t(p,i),m=e.getLastMovement(t,n);if(!c(m)||c_t(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=z.clone(m.startPosition,a.startPosition),a.endPosition=z.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=z.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||z.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function f_t(e,t){if(c(t)){let n=e[t];c(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(c(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],c(n)&&(n.inertiaEnabled=!1)}}}var Dbe=[];function el(e,t,n,i,o,r){if(!c(n))return;let s=e._aggregator;Array.isArray(n)||(Dbe[0]=n,n=Dbe);let a=n.length;for(let l=0;l<a;++l){let u=n[l],f=c(u.eventType)?u.eventType:u,h=u.modifier,p=s.isMoving(f,h)&&s.getMovement(f,h),g=s.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,g,p),f_t(e,r)):o<1&&u_t(s,f,h,o,i,e,r))}}var Y4=new _n,d_t=new d,h_t=new z,m_t=new d,p_t=new z,__t=new d,g_t=new d,y_t=new d,b_t=new d,Vbe=new d,x_t=new d,T_t=new d,A_t=new d,C_t=new d,E_t=new d,S_t=new d,w_t=new d,v_t=new d,D_t=new d,P_t=new d,Mx=new d,Pbe=new d,Ibe=new d,uK={orientation:new Xa};function yK(e,t,n,i,o,r){let s=1;c(r)&&(s=O.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=O.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!c(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let y=e._scene,b=y.camera,x=y.mode,A=uK.orientation;A.heading=b.heading,A.pitch=b.pitch,A.roll=b.roll;let E=n.inertiaEnabled??z.equals(t,e._zoomMouseStart),S=e._zoomingOnVector,v=e._rotatingZoom,P;if(E||(e._zoomMouseStart=z.clone(t,e._zoomMouseStart),c(e._globe)&&x===oe.SCENE2D?(P=b.getPickRay(t,Y4).origin,P=d.fromElements(P.y,P.z,P.x)):c(e._globe)&&(P=v_(e,t,d_t)),c(P)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let M=x===oe.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!E||v){if(x===oe.SCENE2D){let R=e._zoomWorldPosition,L=b.position;if(!d.equals(R,L)&&b.positionCartographic.height<e._maxCoord.x*2){let B=b.position.x,_=d.subtract(R,L,m_t);d.normalize(_,_);let w=d.distance(R,L)*m/(b.getMagnitude()*.5);b.move(_,w*.5),(b.position.x<0&&B>0||b.position.x>0&&B<0)&&(P=b.getPickRay(t,Y4).origin,P=d.fromElements(P.y,P.z,P.x),e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition))}}else if(x===oe.SCENE3D){let R=d.normalize(b.position,Vbe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(d.dot(b.direction,R))<.6)M=!0;else{let L=y.canvas,B=p_t;B.x=L.clientWidth/2,B.y=L.clientHeight/2;let _=v_(e,B,__t);if(!c(_))M=!0;else if(b.positionCartographic.height<1e6)if(d.dot(b.direction,R)>=-.5)M=!0;else{let w=T_t;d.clone(b.position,w);let D=e._zoomWorldPosition,I=x_t;if(I=d.normalize(D,I),d.dot(I,R)<0)return;let N=P_t,k=E_t;d.clone(b.direction,k),d.add(w,d.multiplyByScalar(k,1e3,Mx),N);let H=S_t,V=w_t;d.subtract(D,w,H),d.normalize(H,V);let j=d.dot(R,V);if(j>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-j),q=d.magnitude(w),X=d.magnitude(D),te=q-m,K=d.magnitude(H),Z=Math.asin(O.clamp(K/X*Math.sin(U),-1,1)),ee=Math.asin(O.clamp(te/X*Math.sin(U),-1,1)),me=Z-ee+U,xe=A_t;d.normalize(w,xe);let ue=C_t;ue=d.cross(V,xe,ue),ue=d.normalize(ue,ue),d.normalize(d.cross(xe,ue,Mx),k),d.multiplyByScalar(d.normalize(N,Mx),d.magnitude(N)-m,N),d.normalize(w,w),d.multiplyByScalar(w,te,w);let ye=v_t;d.multiplyByScalar(d.add(d.multiplyByScalar(xe,Math.cos(me)-1,Pbe),d.multiplyByScalar(k,Math.sin(me),Ibe),Mx),te,ye),d.add(w,ye,w),d.normalize(N,xe),d.normalize(d.cross(xe,ue,Mx),k);let Ae=D_t;d.multiplyByScalar(d.add(d.multiplyByScalar(xe,Math.cos(me)-1,Pbe),d.multiplyByScalar(k,Math.sin(me),Ibe),Mx),d.magnitude(N),Ae),d.add(N,Ae,N),d.clone(w,b.position),d.normalize(d.subtract(N,w,Mx),b.direction),d.clone(b.direction,b.direction),d.cross(b.direction,b.up,b.right),d.cross(b.right,b.direction,b.up),b.setView(uK);return}else{let w=d.normalize(_,g_t),D=d.normalize(e._zoomWorldPosition,y_t),I=d.dot(D,w);if(I>0&&I<1){let N=O.acosClamped(I),k=d.cross(D,w,b_t),H=Math.abs(N)>O.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/H;b.rotate(k,N*V)}}}}e._rotatingZoom=!M}if(!E&&M||S){let R,L=Hi.worldToWindowCoordinates(y,e._zoomWorldPosition,h_t);x!==oe.COLUMBUS_VIEW&&z.equals(t,e._zoomMouseStart)&&c(L)?R=b.getPickRay(L,Y4):R=b.getPickRay(t,Y4);let B=R.direction;(x===oe.COLUMBUS_VIEW||x===oe.SCENE2D)&&d.fromElements(B.y,B.z,B.x,B),b.move(B,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(uK)}var I_t=new _n,O_t=new _n,R_t=new d;function M_t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,I_t).origin,s=o.getPickRay(n.endPosition,O_t).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,R_t),l=d.magnitude(a);l>0&&(d.normalize(a,a),o.move(a,l))}function Obe(e,t,n){c(n.distance)&&(n=n.distance);let o=e._scene.camera;yK(e,t,n,e.zoomFactor,o.getMagnitude())}var L_t=new z,N_t=new z;function Rbe(e,t,n){if(c(n.angleAndHeight)){F_t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,l=L_t;l.x=2/s*n.startPosition.x-1,l.y=2/a*(a-n.startPosition.y)-1,l=z.normalize(l,l);let u=N_t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=z.normalize(u,u);let f=O.acosClamped(l.x);l.y<0&&(f=O.TWO_PI-f);let h=O.acosClamped(u.x);u.y<0&&(h=O.TWO_PI-h);let p=h-f;o.twistRight(p)}function F_t(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 l=i*a*Math.PI*4;r.twistRight(l)}function B_t(e){let t=e._scene.mapMode2D===Pu.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(el(e,e.enableTranslate,e.translateEventTypes,M_t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),el(e,e.enableZoom,e.zoomEventTypes,Obe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&el(e,e.enableRotate,e.tiltEventTypes,Rbe,e.inertiaSpin,"_lastInertiaTiltMovement")):(el(e,e.enableZoom,e.zoomEventTypes,Obe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&el(e,e.enableRotate,e.translateEventTypes,Rbe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var zbe=new _n,k_t=new d,U_t=new d;function v_(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,k_t)),!c(o))return d.clone(s,n);let a=!e._cameraUnderground,l=r.getPickRay(t,zbe),u=o.pickWorldCoordinates(l,i,a,U_t),f=c(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=c(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var V_t=new he;function e8(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let l=t.cartesianToCartographic(i.position,V_t);c(l)&&(r=l.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var z_t=new d;function Hbe(e,t){let n=t.origin,i=t.direction,o=e8(e),r=d.normalize(n,z_t),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function Gbe(e,t,n,i){let o=d.distance(t.origin,n),r=e8(e),s=O.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),_n.getPoint(t,o,i)}function jbe(e,t,n,i){let o;return c(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=e8(e))):o=e8(e),_n.getPoint(t,o,i)}var H_t=new z;function Wbe(e,t){let n=t.endPosition,i=z.subtract(t.endPosition,t.startPosition,H_t),o=e._strafeEndMousePosition;z.add(o,i,o),t.endPosition=o,bK(e,t,e._strafeStartPosition),t.endPosition=n}var Mbe=new _n,G_t=new _n,fK=new d,j_t=new d,W_t=new d,q_t=new d,Y_t=new sn(d.UNIT_X,0),X_t=new z,K_t=new z;function $_t(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Lu(e,t,n);return}if(e._strafing){Wbe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=z.clone(n.startPosition,X_t),a=z.clone(n.endPosition,K_t),l=o.getPickRay(s,Mbe),u=d.clone(d.ZERO,q_t),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=v_(e,s,fK),c(h)&&(u.x=h.x)),r||u.x>o.position.z&&c(h)){let E=h;r&&(E=jbe(e,l,h,fK)),z.clone(t,e._strafeMousePosition),z.clone(t,e._strafeEndMousePosition),d.clone(E,e._strafeStartPosition),e._strafing=!0,bK(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,Y_t);l=o.getPickRay(s,Mbe);let g=Qn.rayPlane(l,p,fK),m=o.getPickRay(a,G_t),y=Qn.rayPlane(m,p,j_t);if(!c(g)||!c(y)){e._looking=!0,Lu(e,t,n),z.clone(t,e._translateMousePosition);return}let b=d.subtract(g,y,W_t),x=b.x;b.x=b.y,b.y=b.z,b.z=x;let A=d.magnitude(b);A>O.EPSILON6&&(d.normalize(b,b),o.move(b,A))}var qbe=new z,$4=new _n,Z4=new d,Z_t=new d,Ybe=new F,Q_t=new F,J_t=new d,egt=new sn(d.UNIT_X,0),dK=new d,pK=new he,Xbe=new F,tgt=new Le,ngt=new J,Q4=new d;function igt(e,t,n){if(c(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Lu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,ogt(e,t,n)):rgt(e,t,n)}function ogt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=qbe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,$4),l=d.UNIT_X,u=a.origin,f=a.direction,h,p=d.dot(l,f);if(Math.abs(p)>O.EPSILON6&&(h=-d.dot(l,u)/p),!c(h)||h<=0){e._looking=!0,Lu(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}let g=d.multiplyByScalar(f,h,Z4);d.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;d.fromElements(g.y,g.z,g.x,g);let b=m.unproject(g,pK);y.cartographicToCartesian(b,g);let x=Ot.eastNorthUpToFixedFrame(g,y,Ybe),A=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=F.clone(o.transform,Xbe);o._setTransform(x),Mu(e,t,n,d.UNIT_Z),o._setTransform(S),e._globe=A,e._ellipsoid=E;let v=E.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function rgt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,l=d.UNIT_X;if(z.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,Z4);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=v_(e,t,Z4)),!c(s)){a=o.getPickRay(t,$4);let _=a.origin,w=a.direction,D,I=d.dot(l,w);if(Math.abs(I)>O.EPSILON6&&(D=-d.dot(l,_)/I),!c(D)||D<=0){e._looking=!0,Lu(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(w,D,Z4),d.add(_,s,s)}r&&(c(a)||(a=o.getPickRay(t,$4)),Gbe(e,a,s,s)),z.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=qbe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,$4);let h=d.clone(d.ZERO,J_t);h.x=s.x;let p=sn.fromPointNormal(h,l,egt),g=Qn.rayPlane(a,p,Z_t),m=o._projection,y=m.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,pK);y.cartographicToCartesian(b,s);let x=Ot.eastNorthUpToFixedFrame(s,y,Ybe),A;c(g)?(d.fromElements(g.y,g.z,g.x,g),b=m.unproject(g,pK),y.cartographicToCartesian(b,g),A=Ot.eastNorthUpToFixedFrame(g,y,Q_t)):A=x;let E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=F.clone(o.transform,Xbe);o._setTransform(x);let M=d.cross(d.UNIT_Z,d.normalize(o.position,dK),dK),R=d.dot(o.right,M);if(Mu(e,t,n,v,!1,!0),o._setTransform(A),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let w=o.constrainedAxis;o.constrainedAxis=void 0,Mu(e,t,n,v,!0,!1),o.constrainedAxis=w}else Mu(e,t,n,v,!0,!1);if(c(o.constrainedAxis)){let _=d.cross(o.direction,o.constrainedAxis,Q4);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,o.right)<0&&d.negate(_,_),d.cross(_,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(P),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let B=d.clone(o.positionWC,dK);if(e.enableCollisionDetection&&AK(e,!0),!d.equals(o.positionWC,B)){o._setTransform(A),o.worldToCameraCoordinatesPoint(B,B);let _=d.magnitudeSquared(B);d.magnitudeSquared(o.position)>_&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(_),o.position));let w=d.angleBetween(B,o.position),D=d.cross(B,o.position,B);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,tgt),N=J.fromQuaternion(I,ngt);J.multiplyByVector(N,o.direction,o.direction),J.multiplyByVector(N,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(P)}}var Kbe=new z,$be=new _n,Zbe=new d;function sgt(e,t,n){c(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=Kbe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let l=o.getPickRay(a,$be),u=l.origin,f=l.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=v_(e,a,Zbe));let g;if(c(p)&&(g=d.distance(u,p)),s){let m=Hbe(e,l,h);c(g)?g=Math.min(g,m):g=m}if(!c(g)){let m=d.UNIT_X;g=-d.dot(m,u)/d.dot(m,f)}yK(e,t,n,e.zoomFactor,g)}function agt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))el(e,e.enableRotate,e.rotateEventTypes,Mu,e.inertiaSpin,"_lastInertiaSpinMovement"),el(e,e.enableZoom,e.zoomEventTypes,Jbe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),el(e,e.enableTilt,e.tiltEventTypes,igt,e.inertiaSpin,"_lastInertiaTiltMovement"),el(e,e.enableTranslate,e.translateEventTypes,$_t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),el(e,e.enableZoom,e.zoomEventTypes,sgt,e.inertiaZoom,"_lastInertiaZoomMovement"),el(e,e.enableLook,e.lookEventTypes,Lu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);c(o)&&(e._tween=i.add(o))}i.update()}}var cgt=new _n,lgt=new sn(d.UNIT_X,0),ugt=new d,fgt=new d;function bK(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,cgt),s=d.clone(o.direction,fgt);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,lgt),l=Qn.rayPlane(r,a,ugt);c(l)&&(s=d.subtract(n,l,s),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var Lbe=new d,Qbe=new he,_K=new d,gK=new ie,dgt=new d,hgt=new d,mgt=new d;function pgt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){Mu(e,t,n);return}let a,l,u=s.geodeticSurfaceNormal(o.position,dgt);if(z.equals(t,e._rotateMousePosition)){if(e._looking)Lu(e,t,n,u);else if(e._rotating)Mu(e,t,n);else if(e._strafing)Wbe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),l=_K,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,gK),mK(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,Qbe).height,h=e._globe;if(c(h)&&f<e._minimumPickingTerrainHeight){let p=v_(e,n.startPosition,mgt);if(c(p)){let g=!1,m=o.getPickRay(n.startPosition,zbe);if(r)g=!0,jbe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,hgt);Math.abs(d.dot(m.direction,y))<.05?g=!0:g=d.magnitude(o.position)<d.magnitude(p)}g?(z.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,bK(e,n,e._strafeStartPosition)):(a=d.magnitude(p),l=_K,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,gK),mK(e,t,n,s),d.clone(p,e._rotateStartPosition))}else e._looking=!0,Lu(e,t,n,u)}else c(o.pickEllipsoid(n.startPosition,e._ellipsoid,Lbe))?(mK(e,t,n,e._ellipsoid),d.clone(Lbe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Mu(e,t,n)):(e._looking=!0,Lu(e,t,n,u));z.clone(t,e._rotateMousePosition)}function Mu(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,l=s.canvas,u=a.constrainedAxis;c(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/l.clientWidth,g=(n.startPosition.y-n.endPosition.y)/l.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=h*p*Math.PI*2,y=h*g*Math.PI;if(c(i)&&c(e.maximumTiltAngle)){let b=e.maximumTiltAngle,x=d.dot(a.direction,i),A=Math.PI-Math.acos(x)+y;A>b&&(y-=A-b)}o||a.rotateRight(m),r||a.rotateUp(y),a.constrainedAxis=u}var hK=se.clone(se.UNIT_W),Nbe=se.clone(se.UNIT_W),X4=new d,iS=new d,K4=new d,Fbe=new d,_gt=new z,ggt=new z,ygt=new z,bgt=new z,xgt=new _n;function mK(e,t,n,i){let o=e._scene,r=o.camera,s=z.clone(n.startPosition,_gt),a=z.clone(n.endPosition,ggt),l=i.cartesianToCartographic(r.positionWC,Qbe).height,u,f;if(!n.inertiaEnabled&&l<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,hK),!c(e._globe)&&!z.equalsEpsilon(s,e._panLastMousePosition)&&(u=v_(e,s,hK)),!c(e._globe)&&c(u))){let h=d.subtract(u,r.positionWC,iS),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),iS),g=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,bgt),y=z.subtract(a,s,ygt),b=d.multiplyByScalar(r.rightWC,y.x*m.x,iS),x=d.normalize(r.positionWC,Vbe),A=r.getPickRay(a,xgt).direction,E=d.subtract(A,d.projectVector(A,r.rightWC,K4),K4),S=d.angleBetween(E,r.directionWC),v=1;c(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let P=Math.abs(d.dot(r.directionWC,x)),M=-y.y*m.y*2/Math.sqrt(v)*(1-P),R=d.multiplyByScalar(A,M,K4);P=Math.abs(d.dot(r.upWC,x));let L=d.multiplyByScalar(r.upWC,-y.y*(1-P)*m.y,Fbe);f=d.add(u,b,Nbe),f=d.add(f,R,f),f=d.add(f,L,f),d.clone(f,e._panLastWorldPosition),z.clone(a,e._panLastMousePosition)}if((!c(u)||!c(f))&&(u=r.pickEllipsoid(s,i,hK),f=r.pickEllipsoid(a,i,Nbe)),!c(u)||!c(f)){e._rotating=!0,Mu(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),c(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,X4);d.cross(p,h,p),d.normalize(p,p);let g=d.cross(h,p,iS),m=d.magnitude(u),y=d.dot(h,u),b=Math.acos(y/m),x=d.multiplyByScalar(h,y,K4);d.subtract(u,x,x),d.normalize(x,x);let A=d.magnitude(f),E=d.dot(h,f),S=Math.acos(E/A),v=d.multiplyByScalar(h,E,Fbe);d.subtract(f,v,v),d.normalize(v,v);let P=Math.acos(d.dot(x,p));d.dot(x,g)<0&&(P=O.TWO_PI-P);let M=Math.acos(d.dot(v,p));d.dot(v,g)<0&&(M=O.TWO_PI-M);let R=P-M,L;d.equalsEpsilon(h,r.position,O.EPSILON2)?L=r.right:L=d.cross(h,r.position,X4);let B=d.cross(h,L,X4),_=d.dot(B,d.subtract(u,h,iS)),w=d.dot(B,d.subtract(f,h,iS)),D;_>0&&w>0?D=S-b:_>0&&w<=0?d.dot(r.position,h)>0?D=-b-S:D=b+S:D=b-S,r.rotateRight(R),r.rotateUp(D)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,X4);if(h<1&&!d.equalsEpsilon(p,d.ZERO,O.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var Tgt=new d,Agt=new he,Bbe=0;function Jbe(e,t,n){c(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,l=e._cameraUnderground,u;l?u=t:(u=Kbe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,$be),h,p=o.cartesianToCartographic(s.position,Agt).height,g=Math.abs(Bbe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=v_(e,u,Zbe));let y;if(c(h)&&(y=d.distance(f.origin,h),Bbe=y),l){let x=Hbe(e,f,p);c(y)?y=Math.min(y,x):y=x}c(y)||(y=p);let b=d.normalize(s.position,Tgt);yK(e,t,n,e.zoomFactor,y,d.dot(b,s.direction))}var exe=new z,J4=new _n,xI=new d,Cgt=new d,txe=new F,Egt=new F,nxe=new F,Sgt=new Le,wgt=new J,xK=new he,TK=new d;function vgt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(c(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,TK);Lu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,xK);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Pgt(e,t,n)):Igt(e,t,n)}var Dgt=new he;function Pgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Dgt).height;if(a-s-1<O.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let l=o.canvas,u=exe;u.x=l.clientWidth/2,u.y=l.clientHeight/2;let f=r.getPickRay(u,J4),h,p=Qn.rayEllipsoid(f,i);if(c(p))h=_n.getPoint(f,p.start,xI);else if(a>e._minimumTrackBallHeight){let A=Qn.grazingAltitudeLocation(f,i);if(!c(A))return;let E=i.cartesianToCartographic(A,xK);E.height=0,h=i.cartographicToCartesian(E,xI)}else{e._looking=!0;let A=e._ellipsoid.geodeticSurfaceNormal(r.position,TK);Lu(e,t,n,A),z.clone(t,e._tiltCenterMousePosition);return}let g=Ot.eastNorthUpToFixedFrame(h,i,txe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(r.transform,nxe);r._setTransform(g),Mu(e,t,n,d.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=y;let x=y.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function Igt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,l,u;if(z.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,xI);else{if(a=v_(e,t,xI),!c(a)){if(l=r.getPickRay(t,J4),u=Qn.rayEllipsoid(l,i),!c(u)){if(i.cartesianToCartographic(r.position,xK).height<=e._minimumTrackBallHeight){e._looking=!0;let w=e._ellipsoid.geodeticSurfaceNormal(r.position,TK);Lu(e,t,n,w),z.clone(t,e._tiltCenterMousePosition)}return}a=_n.getPoint(l,u.start,xI)}s&&(c(l)||(l=r.getPickRay(t,J4)),Gbe(e,l,a,a)),z.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=exe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,l=r.getPickRay(h,J4);let p=d.magnitude(a),g=d.fromElements(p,p,p,_K),m=ie.fromCartesian3(g,gK);if(u=Qn.rayEllipsoid(l,m),!c(u))return;let y=d.magnitude(l.origin)>p?u.start:u.stop,b=_n.getPoint(l,y,Cgt),x=Ot.eastNorthUpToFixedFrame(a,i,txe),A=Ot.eastNorthUpToFixedFrame(b,m,Egt),E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=F.clone(r.transform,nxe);r._setTransform(A);let M=d.cross(b,r.positionWC,Q4);if(d.dot(r.rightWC,M)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let w=r.constrainedAxis;r.constrainedAxis=void 0,Mu(e,t,n,v,!0,!1),r.constrainedAxis=w}else Mu(e,t,n,v,!0,!1);if(r._setTransform(x),Mu(e,t,n,v,!1,!0),c(r.constrainedAxis)){let _=d.cross(r.direction,r.constrainedAxis,Q4);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,r.right)<0&&d.negate(_,_),d.cross(_,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(P),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let B=d.clone(r.positionWC,Q4);if(e.enableCollisionDetection&&AK(e,!0),!d.equals(r.positionWC,B)){r._setTransform(A),r.worldToCameraCoordinatesPoint(B,B);let _=d.magnitudeSquared(B);d.magnitudeSquared(r.position)>_&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(_),r.position));let w=d.angleBetween(B,r.position),D=d.cross(B,r.position,B);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,Sgt),N=J.fromQuaternion(I,wgt);J.multiplyByVector(N,r.direction,r.direction),J.multiplyByVector(N,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(P)}}var Ogt=new z,Rgt=new z,kbe=new _n,Ube=new _n,Mgt=new d,Lgt=new d;function Lu(e,t,n,i){let r=e._scene.camera,s=Ogt;s.x=n.startPosition.x,s.y=0;let a=Rgt;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,kbe),u=r.getPickRay(a,Ube),f=0,h,p;r.frustum instanceof on?(h=l.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=l.direction,p=u.direction);let g=d.dot(h,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(c(i)?r.look(i,-f):c(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,kbe),u=r.getPickRay(a,Ube),f=0,r.frustum instanceof on?(h=l.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=l.direction,p=u.direction),g=d.dot(h,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,c(i)){let y=r.direction,b=d.negate(i,Mgt),x=d.equalsEpsilon(y,i,O.EPSILON2),A=d.equalsEpsilon(y,b,O.EPSILON2);if(!x&&!A){g=d.dot(y,i);let E=O.acosClamped(g);f>0&&f>E&&(f=E-O.EPSILON4),g=d.dot(y,b),E=O.acosClamped(g),f<0&&-f>E&&(f=-E+O.EPSILON4);let S=d.cross(i,y,Lgt);r.look(S,f)}else(x&&f<0||A&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Ngt(e){el(e,e.enableRotate,e.rotateEventTypes,pgt,e.inertiaSpin,"_lastInertiaSpinMovement"),el(e,e.enableZoom,e.zoomEventTypes,Jbe,e.inertiaZoom,"_lastInertiaZoomMovement"),el(e,e.enableTilt,e.tiltEventTypes,vgt,e.inertiaSpin,"_lastInertiaTiltMovement"),el(e,e.enableLook,e.lookEventTypes,Lu)}var Fgt=new F,Bgt=new he;function AK(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=n.ellipsoid??ie.WGS84,s=n.mapProjection,a,l;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,Fgt),l=d.magnitude(o.position),o._setTransform(F.IDENTITY));let u=Bgt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(c(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}c(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(l,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}TI.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 kgt=new d,Ugt=new d;TI.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ie.default):(this._globe=void 0,this._ellipsoid=ie.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Rr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Rr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Rr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&c(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=d.clone(t.positionWC,kgt),l=d.clone(t.directionWC,Ugt);if(i===oe.SCENE2D?B_t(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,agt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,Ngt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(l,t.directionWC);AK(this,u)}this._aggregator.reset()};TI.prototype.isDestroyed=function(){return!1};TI.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),de(this)};var t8=TI;var n8=`uniform sampler2D colorTexture; +`,s=new zr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new zf({name:"czm_edge_detection_composite",stages:[t,s]})}is.createSilhouetteStage=function(e){let t=cBt(e),n=new zr({name:"czm_silhouette_color_edges",fragmentShader:M5,uniforms:{silhouetteTexture:t.name}});return new zf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};is.isSilhouetteSupported=function(e){return e.context.depthTexture};is.createBloomStage=function(){let e=new zr({name:"czm_bloom_contrast_bias",fragmentShader:T5,uniforms:{contrast:128,brightness:-.3}}),t=Voe("czm_bloom_blur"),n=new zf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new zr({name:"czm_bloom_generate_composite",fragmentShader:b5,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new zf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};is.createAmbientOcclusionStage=function(){let e=new zr({name:"czm_ambient_occlusion_generate",fragmentShader:_5,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new zr({name:"czm_ambient_occlusion_composite",fragmentShader:y5,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 zf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var lBt=`#define FXAA_QUALITY_PRESET 39 +${N5} +${I5}`;is.createFXAAStage=function(){return new zr({name:"czm_FXAA",fragmentShader:lBt,sampleMode:Qd.LINEAR})};is.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=g5,new zr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=S5,new zr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=w5,new zr({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=O5,new zr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=D5,new zr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};is.createAutoExposureStage=function(){return new L5};is.createBlackAndWhiteStage=function(){return new zr({name:"czm_black_and_white",fragmentShader:A5,uniforms:{gradations:5}})};is.createBrightnessStage=function(){return new zr({name:"czm_brightness",fragmentShader:x5,uniforms:{brightness:.5}})};is.createNightVisionStage=function(){return new zr({name:"czm_night_vision",fragmentShader:R5})};is.createDepthViewStage=function(){return new zr({name:"czm_depth_view",fragmentShader:C5})};is.createLensFlareStage=function(){return new zr({name:"czm_lens_flare",fragmentShader:P5,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var eh=is;function c_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function sM(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function joe(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[sM(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[sM(d)]=!0)}}}return i.name}function oM(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=oM(e,t,n,p,r):a=joe(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=sM(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=sM(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[sM(i.get(p))]=!0}return a}function uBt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=oM(e,t,n,i,void 0);a=oM(e,t,n,r,a),a=joe(e,t,n,o,a),a=oM(e,t,n,e,a),joe(e,t,n,s,a)}else oM(e,t,n,e,void 0);return n}function fBt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new ci({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function dBt(e,t){let n=uBt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=fBt(e,i,n[i]))}function Hoe(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function hBt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new fi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}c_.prototype.updateDependencies=function(){this._updateDependencies=!0};c_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=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||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(Hoe(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&dBt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,Hoe(this),hBt(this,e))};c_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};c_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};c_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};c_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};c_.prototype.isDestroyed=function(){return!1};c_.prototype.destroy=function(){return Hoe(this),ue(this)};var sI=c_;var SNe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(SNe);var eb=SNe;var Goe=[];function $l(){let e=eh.createFXAAStage(),t=eh.createAmbientOcclusionStage(),n=eh.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=eh.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=eb.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new sI(this),o={},s=Goe;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}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=o,this._textureCache=r}Object.defineProperties($l.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,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.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 Woe(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 r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.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 eb.REINHARD:n=eh.createReinhardTonemappingStage(t);break;case eb.MODIFIED_REINHARD:n=eh.createModifiedReinhardTonemappingStage(t);break;case eb.FILMIC:n=eh.createFilmicTonemappingStage(t);break;case eb.PBR_NEUTRAL:n=eh.createPbrNeutralTonemappingStage(t);break;default:n=eh.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 Woe(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}$l.prototype.add=function(e){let t=this._stageNames,n=Goe;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};$l.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Goe;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};$l.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};$l.prototype.get=function(e){return Woe(this),this._stages[e]};$l.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};$l.prototype.getStageByName=function(e){return this._stageNames[e]};$l.prototype.update=function(e,t,n){Woe(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[s++]=x)}r.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(r[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:$e.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&s++}a=s!==r.length,a&&this.update(e,t,n)};$l.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function WT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}$l.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return WT(t)};function y0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){y0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)y0(e.get(o),t,WT(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)y0(e.get(o),t,n,i,r)}$l.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&a.ready&&(y0(a,e,A,n,i),A=WT(a)),p&&c.ready&&(y0(c,e,A,n,i),A=WT(c)),g&&u.ready&&y0(u,e,A,n,i),m&&f.ready&&(y0(f,e,A,n,i),A=WT(f));let b=A;if(o>0){y0(r[0],e,A,n,i);for(let x=1;x<o;++x)y0(r[x],e,WT(r[x-1]),n,i);b=WT(r[o-1])}y&&s.ready&&y0(s,e,b,n,i)};$l.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Uf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};$l.prototype.isDestroyed=function(){return!1};$l.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(),ue(this)};var F5=$l;function qT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}qT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};qT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof _n,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?qBt(this,e):QBt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var mBt=new h,pBt=new h,gBt=new h,_Bt=new h,yBt=new h,ABt=new h,bBt=new h,xBt=new he,TBt=new M,EBt=new Zi,CBt=new _n,vBt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};qT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=mBt,r=pBt,o=gBt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,bBt),d=At.eastNorthUpToFixedFrame(f,t,TBt);M.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,xBt),i),M.multiplyByPointAsVector(d,r,r),M.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=CBt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=EBt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=vBt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=t2t(a);aM(this,c),this._previousMode===re.SCENE2D?e2t(this,e,a,c):(a.position2D=M.multiplyByPoint(Nr.TRANSFORM_2D,i,_Bt),a.direction2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,r,yBt),a.up2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,ABt),n._mode=re.MORPHING,BNe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Xoe={position:new h,direction:new h,up:new h,frustum:void 0},INe=new Zi;qT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===re.SCENE2D)FBt(this,e,t);else{let i;e>0?(i=Xoe,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=PNe(this,t);let r,o=n.camera;o.frustum instanceof _n?r=o.frustum.clone():(r=INe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=UNe(i);aM(this,s),Yoe(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};qT.prototype.isDestroyed=function(){return!1};qT.prototype.destroy=function(){return B5(this),ue(this)};function aM(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new da(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,fn.LEFT_DOWN),e._morphHandler.setInputAction(n,fn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,fn.RIGHT_DOWN),e._morphHandler.setInputAction(n,fn.WHEEL)}}function B5(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 SBt=new he,wBt=new h,IBt=new M;function PNe(e,t){let n=e._scene,i=n.camera,r=Xoe,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,SBt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,wBt),f=At.eastNorthUpToFixedFrame(u,t,IBt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),r}var PBt=new h,DBt=new h,RBt=new h,OBt=new h,MBt=new h,NBt=new h;function Yoe(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,PBt),a=h.clone(o.direction,DBt),c=h.clone(o.up,RBt),u=M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,n.position,OBt),f=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.direction,MBt),d=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.up,NBt);function p(m){th(s,u,m.time,o.position),th(a,f,m.time,o.direction),th(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Ds.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){kNe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var LBt=new _n,DNe=new h,RNe=new h,ONe=new h,Koe=new h,MNe=new h,NNe=new h;function FBt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Xoe,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=PNe(e,n));let s;e._morphToOrthographic?(s=LBt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=INe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=UNe(o);aM(e,a);let c;e._morphToOrthographic?c=function(){Yoe(e,t,o,a)}:c=function(){FNe(e,t,o,function(){Yoe(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Koe),complete:function(){i._mode=re.MORPHING,c()}})):c()}function th(e,t,n,i){return h.lerp(e,t,n,i)}function LNe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof _n)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Ds.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var BBt=new h,kBt=new h,UBt=new h,qoe=new h,zBt=new h,VBt=new h,jBt=new Ss,HBt=new gn,GBt=new h,WBt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function qBt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,BBt),o=h.clone(i.direction,kBt),s=h.clone(i.up,UBt),a=h.negate(h.UNIT_Z,zBt),c=h.clone(h.UNIT_Y,VBt),u=qoe;if(t>0)h.clone(h.ZERO,qoe),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,qoe);let A=HBt;M.multiplyByPoint(Nr.TRANSFORM_2D,r,A.origin),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,GBt);l(x)&&(M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=jBt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=WBt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=zNe(d);aM(e,p);function g(A){th(r,u,A.time,i.position),th(o,a,A.time,i.direction),th(s,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:Ds.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){LNe(e,t,d,m,p)}});e._currentTweens.push(y)}var wNe=new he,YBt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Ss},XBt={position:new h,direction:new h,up:new h,frustum:void 0},KBt=new h,$Bt=new gn,JBt=new M,ZBt=new h;function QBt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=YBt;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,wNe),i.mapProjection.project(wNe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=$Bt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,ZBt),m=At.eastNorthUpToFixedFrame(g,n,JBt);M.inverseTransformation(m,m),M.multiplyByPointAsVector(m,p,p),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,KBt);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function s(d,p){d.position.x=p}M.multiplyByPoint(Nr.TRANSFORM_2D,o.position,o.position2D),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o.direction,o.direction2D),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=XBt;M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=zNe(c);aM(e,u);function f(){LNe(e,t,o,s,u)}BNe(e,t,o,f)}function FNe(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=P.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Ds.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function e2t(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,Koe),a=h.clone(n.direction,MNe),c=h.clone(n.up,NNe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,DNe),d=h.clone(o.direction,RNe),p=h.clone(o.up,ONe);f.z=s.z;function g(y){th(f,s,y.time,o.position),th(d,a,y.time,o.direction),th(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:Ds.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():FNe(e,0,n,u)}function BNe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,DNe),a=h.clone(o.direction,RNe),c=h.clone(o.up,ONe),u=h.clone(n.position2D,Koe),f=h.clone(n.direction2D,MNe),d=h.clone(n.up2D,NNe);function p(m){th(s,u,m.time,o.position),th(a,f,m.time,o.direction),th(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Ds.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){kNe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function kNe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Ds.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function UNe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),B5(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function zNe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),B5(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function t2t(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),B5(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var k5=qT;var VNe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(VNe);var mr=VNe;var qNe=[eo.SHIFT,eo.CTRL,eo.ALT,[eo.SHIFT,eo.CTRL],[eo.SHIFT,eo.ALT],[eo.CTRL,eo.ALT],[eo.SHIFT,eo.CTRL,eo.ALT]];function ja(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function n2t(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function jNe(e,t,n){let i=ja(mr.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},fn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},fn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(n2t(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},fn.PINCH_MOVE,t)}function HNe(e,t){let n=ja(mr.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[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 U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},fn.WHEEL,t)}function aI(e,t,n){let i=ja(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime;r[i]=!1,o[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===mr.LEFT_DRAG?(c=fn.LEFT_DOWN,u=fn.LEFT_UP):n===mr.RIGHT_DRAG?(c=fn.RIGHT_DOWN,u=fn.RIGHT_UP):n===mr.MIDDLE_DRAG&&(c=fn.MIDDLE_DOWN,u=fn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,r[i]=!0,s[i]=new Date,U.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){$oe(ja(n,void 0),e);for(let f of qNe){let d=ja(n,f);$oe(d,e)}},u,t)}function $oe(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 GNe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function i2t(e,t,n){let i=n._isDown,r=!1,o=ja(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,$oe(c,n));if(!r)return;let s=n._pressTime,a=n._lastMovement[o];l(a)||(a=n._lastMovement[o]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[o]=!0,s[o]=new Date}function WNe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in mr)if(mr.hasOwnProperty(s)){let a=mr[s];if(l(a)){let c=ja(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in mr)if(mr.hasOwnProperty(a)){let c=mr[a];if(l(c)){let u=ja(c,t);i2t(c,t,e),o[u]&&(n[u]?(GNe(i[u],r[u]),r[u].valid=!0,GNe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},fn.MOUSE_MOVE,t)}function nh(e){this._eventHandler=new da(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,HNe(this,void 0),jNe(this,void 0,e),aI(this,void 0,mr.LEFT_DRAG),aI(this,void 0,mr.RIGHT_DRAG),aI(this,void 0,mr.MIDDLE_DRAG),WNe(this,void 0);for(let t of qNe)HNe(this,t),jNe(this,t,e),aI(this,t,mr.LEFT_DRAG),aI(this,t,mr.RIGHT_DRAG),aI(this,t,mr.MIDDLE_DRAG),WNe(this,t)}Object.defineProperties(nh.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ja(mr.WHEEL)]||!this._update[ja(mr.WHEEL,eo.SHIFT)]||!this._update[ja(mr.WHEEL,eo.CTRL)]||!this._update[ja(mr.WHEEL,eo.ALT)];return this._buttonsDown>0||e}}});nh.prototype.isMoving=function(e,t){let n=ja(e,t);return!this._update[n]};nh.prototype.getMovement=function(e,t){let n=ja(e,t);return this._movement[n]};nh.prototype.getLastMovement=function(e,t){let n=ja(e,t),i=this._lastMovement[n];if(i.valid)return i};nh.prototype.isButtonDown=function(e,t){let n=ja(e,t);return this._isDown[n]};nh.prototype.getStartMousePosition=function(e,t){if(e===mr.WHEEL)return this._currentMousePosition;let n=ja(e,t);return this._eventStartPosition[n]};nh.prototype.getButtonPressTime=function(e,t){let n=ja(e,t);return this._pressTime[n]};nh.prototype.getButtonReleaseTime=function(e,t){let n=ja(e,t);return this._releaseTime[n]};nh.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};nh.prototype.isDestroyed=function(){return!1};nh.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var U5=nh;function z5(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ze(n),this._stopObject=Ze(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(z5.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}}});z5.prototype.cancelTween=function(){this._tweens.remove(this)};function Cm(){this._tweens=[]}Object.defineProperties(Cm.prototype,{length:{get:function(){return this._tweens.length}}});Cm.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new z5(this);let t=e.duration/Un.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Un.SECONDS_PER_MILLISECOND,r=e.easingFunction??Ds.LINEAR_NONE,o=e.startObject,s=new Ope(o);s.to(Ze(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new z5(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Cm.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Cm.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Cm.prototype.addOffsetIncrement=function(e){e=e??H.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})};Cm.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};Cm.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};Cm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Cm.prototype.get=function(e){return this._tweens[e]};Cm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Un.SECONDS_PER_MILLISECOND:xn();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var cI=Cm;function lM(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=mr.LEFT_DRAG,this.zoomEventTypes=[mr.RIGHT_DRAG,mr.WHEEL,mr.PINCH],this.rotateEventTypes=mr.LEFT_DRAG,this.tiltEventTypes=[mr.MIDDLE_DRAG,mr.PINCH,{eventType:mr.LEFT_DRAG,modifier:eo.CTRL},{eventType:mr.RIGHT_DRAG,modifier:eo.CTRL}],this.lookEventTypes={eventType:mr.LEFT_DRAG,modifier:eo.SHIFT};let t=e.ellipsoid??ee.default;this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.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 U5(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 cI,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new h,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,P.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 r2t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function o2t(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var s2t=.4;function a2t(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<s2t){let g=r2t(p,i),m=e.getLastMovement(t,n);if(!l(m)||o2t(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,a)}}}function c2t(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var YNe=[];function Jl(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(YNe[0]=n,n=YNe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),c2t(e,o)):r<1&&a2t(s,f,d,r,i,e,o))}}var V5=new gn,l2t=new h,u2t=new U,f2t=new h,d2t=new U,h2t=new h,m2t=new h,p2t=new h,g2t=new h,oLe=new h,_2t=new h,y2t=new h,A2t=new h,b2t=new h,x2t=new h,T2t=new h,E2t=new h,C2t=new h,v2t=new h,S2t=new h,YT=new h,XNe=new h,KNe=new h,Joe={orientation:new kc};function ose(e,t,n,i,r,o){let s=1;l(o)&&(s=P.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=Joe.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,v=e._rotatingZoom,S;if(T||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(S=A.getPickRay(t,V5).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=l_(e,t,l2t)),l(S)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let I=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(v=!0),!T||v){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let L=A.position.x,_=h.subtract(R,O,f2t);h.normalize(_,_);let C=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,C*.5),(A.position.x<0&&L>0||A.position.x>0&&L<0)&&(S=A.getPickRay(t,V5).origin,S=h.fromElements(S.y,S.z,S.x),e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,oLe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)I=!0;else{let O=y.canvas,L=d2t;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=l_(e,L,h2t);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=y2t;h.clone(A.position,C);let w=e._zoomWorldPosition,D=_2t;if(D=h.normalize(w,D),h.dot(D,R)<0)return;let N=S2t,F=x2t;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,YT),N);let V=T2t,B=E2t;h.subtract(w,C,V),h.normalize(V,B);let j=h.dot(R,B);if(j>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-j),G=h.magnitude(C),q=h.magnitude(w),Q=G-m,W=h.magnitude(V),J=Math.asin(P.clamp(W/q*Math.sin(k),-1,1)),Z=Math.asin(P.clamp(Q/q*Math.sin(k),-1,1)),ae=J-Z+k,Ae=A2t;h.normalize(C,Ae);let fe=b2t;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,YT),F),h.multiplyByScalar(h.normalize(N,YT),h.magnitude(N)-m,N),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=C2t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,XNe),h.multiplyByScalar(F,Math.sin(ae),KNe),YT),Q,xe),h.add(C,xe,C),h.normalize(N,Ae),h.normalize(h.cross(Ae,fe,YT),F);let ge=v2t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,XNe),h.multiplyByScalar(F,Math.sin(ae),KNe),YT),h.magnitude(N),ge),h.add(N,ge,N),h.clone(C,A.position),h.normalize(h.subtract(N,C,YT),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(Joe);return}else{let C=h.normalize(_,m2t),w=h.normalize(e._zoomWorldPosition,p2t),D=h.dot(w,C);if(D>0&&D<1){let N=P.acosClamped(D),F=h.cross(w,C,g2t),V=Math.abs(N)>P.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,B=m/V;A.rotate(F,N*B)}}}}e._rotatingZoom=!I}if(!T&&I||E){let R,O=gr.worldToWindowCoordinates(y,e._zoomWorldPosition,u2t);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,V5):R=A.getPickRay(t,V5);let L=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),A.move(L,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(Joe)}var w2t=new gn,I2t=new gn,P2t=new h;function D2t(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,w2t).origin,s=r.getPickRay(n.endPosition,I2t).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,P2t),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function $Ne(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;ose(e,t,n,e.zoomFactor,r.getMagnitude())}var R2t=new U,O2t=new U;function JNe(e,t,n){if(l(n.angleAndHeight)){M2t(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=R2t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=O2t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;r.twistRight(p)}function M2t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function N2t(e){let t=e._scene.mapMode2D===qu.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(Jl(e,e.enableTranslate,e.translateEventTypes,D2t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,$Ne,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jl(e,e.enableRotate,e.tiltEventTypes,JNe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Jl(e,e.enableZoom,e.zoomEventTypes,$Ne,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jl(e,e.enableRotate,e.translateEventTypes,JNe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var sLe=new gn,L2t=new h,F2t=new h;function l_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,L2t)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,sLe),u=r.pickWorldCoordinates(c,i,a,F2t),f=l(s)?h.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var B2t=new he;function X5(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,B2t);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var k2t=new h;function aLe(e,t){let n=t.origin,i=t.direction,r=X5(e),o=h.normalize(n,k2t),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function cLe(e,t,n,i){let r=h.distance(t.origin,n),o=X5(e),s=P.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),gn.getPoint(t,r,i)}function lLe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=X5(e))):r=X5(e),gn.getPoint(t,r,i)}var U2t=new U;function uLe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,U2t),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,sse(e,t,e._strafeStartPosition),t.endPosition=n}var ZNe=new gn,z2t=new gn,Zoe=new h,V2t=new h,j2t=new h,H2t=new h,G2t=new sn(h.UNIT_X,0),W2t=new U,q2t=new U;function Y2t(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){jf(e,t,n);return}if(e._strafing){uLe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,W2t),a=U.clone(n.endPosition,q2t),c=r.getPickRay(s,ZNe),u=h.clone(h.ZERO,H2t),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=l_(e,s,Zoe),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=lLe(e,c,d,Zoe)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,sse(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,G2t);c=r.getPickRay(s,ZNe);let g=bi.rayPlane(c,p,Zoe),m=r.getPickRay(a,z2t),y=bi.rayPlane(m,p,V2t);if(!l(g)||!l(y)){e._looking=!0,jf(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,j2t),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>P.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var fLe=new U,G5=new gn,W5=new h,X2t=new h,dLe=new M,K2t=new M,$2t=new h,J2t=new sn(h.UNIT_X,0),Qoe=new h,nse=new he,hLe=new M,Z2t=new Le,Q2t=new $,q5=new h;function ekt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){jf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,tkt(e,t,n)):nkt(e,t,n)}function tkt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=fLe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,G5),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,jf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,W5);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,nse);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,dLe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=M.clone(r.transform,hLe);r._setTransform(b),Vf(e,t,n,h.UNIT_Z),r._setTransform(E),e._globe=x,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function nkt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,W5);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=l_(e,t,W5)),!l(s)){a=r.getPickRay(t,G5);let _=a.origin,C=a.direction,w,D=h.dot(c,C);if(Math.abs(D)>P.EPSILON6&&(w=-h.dot(c,_)/D),!l(w)||w<=0){e._looking=!0,jf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,W5),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,G5)),cLe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=fLe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,G5);let d=h.clone(h.ZERO,$2t);d.x=s.x;let p=sn.fromPointNormal(d,c,J2t),g=bi.rayPlane(a,p,X2t),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,nse);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,dLe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,nse),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,K2t)):x=b;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=M.clone(r.transform,hLe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,Qoe),Qoe),R=h.dot(r.right,I);if(Vf(e,t,n,v,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,Vf(e,t,n,v,!0,!1),r.constrainedAxis=C}else Vf(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,q5);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,Qoe);if(e.enableCollisionDetection&&lse(e,!0),!h.equals(r.positionWC,L)){r._setTransform(x),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),w=h.cross(L,r.position,L);h.normalize(w,w);let D=Le.fromAxisAngle(w,C,Z2t),N=$.fromQuaternion(D,Q2t);$.multiplyByVector(N,r.direction,r.direction),$.multiplyByVector(N,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(S)}}var mLe=new U,pLe=new gn,gLe=new h;function ikt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=mLe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,pLe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=l_(e,a,gLe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=aLe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}ose(e,t,n,e.zoomFactor,g)}function rkt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))Jl(e,e.enableRotate,e.rotateEventTypes,Vf,e.inertiaSpin,"_lastInertiaSpinMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,yLe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Jl(e,e.enableTilt,e.tiltEventTypes,ekt,e.inertiaSpin,"_lastInertiaTiltMovement"),Jl(e,e.enableTranslate,e.translateEventTypes,Y2t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,ikt,e.inertiaZoom,"_lastInertiaZoomMovement"),Jl(e,e.enableLook,e.lookEventTypes,jf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var okt=new gn,skt=new sn(h.UNIT_X,0),akt=new h,ckt=new h;function sse(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,okt),s=h.clone(r.direction,ckt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,skt),c=bi.rayPlane(o,a,akt);l(c)&&(s=h.subtract(n,c,s),i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var QNe=new h,_Le=new he,ise=new h,rse=new ee,lkt=new h,ukt=new h,fkt=new h;function dkt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(r.transform,M.IDENTITY)){Vf(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,lkt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)jf(e,t,n,u);else if(e._rotating)Vf(e,t,n);else if(e._strafing)uLe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=ise,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,rse),tse(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,_Le).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=l_(e,n.startPosition,fkt);if(l(p)){let g,m=r.getPickRay(n.startPosition,sLe);if(o)g=!0,lLe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,ukt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,sse(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=ise,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,rse),tse(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,jf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,QNe))?(tse(e,t,n,e._ellipsoid),h.clone(QNe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Vf(e,t,n)):(e._looking=!0,jf(e,t,n,u));U.clone(t,e._rotateMousePosition)}function Vf(e,t,n,i,r,o){r=r??!1,o=o??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=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 m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(a.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||a.rotateRight(m),o||a.rotateUp(y),a.constrainedAxis=u}var ese=se.clone(se.UNIT_W),eLe=se.clone(se.UNIT_W),j5=new h,lI=new h,H5=new h,tLe=new h,hkt=new U,mkt=new U,pkt=new U,gkt=new U,_kt=new gn;function tse(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,hkt),a=U.clone(n.endPosition,mkt),c=i.cartesianToCartographic(o.positionWC,_Le).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,ese),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=l_(e,s,ese)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,lI),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),lI),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,gkt),y=U.subtract(a,s,pkt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,lI),b=h.normalize(o.positionWC,oLe),x=o.getPickRay(a,_kt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,H5),H5),E=h.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let S=Math.abs(h.dot(o.directionWC,b)),I=-y.y*m.y*2/Math.sqrt(v)*(1-S),R=h.multiplyByScalar(x,I,H5);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,tLe);f=h.add(u,A,eLe),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,ese),f=o.pickEllipsoid(a,i,eLe)),!l(u)||!l(f)){e._rotating=!0,Vf(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,j5);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,lI),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,H5);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/x),v=h.multiplyByScalar(d,T,tLe);h.subtract(f,v,v),h.normalize(v,v);let S=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(S=P.TWO_PI-S);let I=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(I=P.TWO_PI-I);let R=S-I,O;h.equalsEpsilon(d,o.position,P.EPSILON2)?O=o.right:O=h.cross(d,o.position,j5);let L=h.cross(d,O,j5),_=h.dot(L,h.subtract(u,d,lI)),C=h.dot(L,h.subtract(f,d,lI)),w;_>0&&C>0?w=E-A:_>0&&C<=0?h.dot(o.position,d)>0?w=-A-E:w=A+E:w=A-E,o.rotateRight(R),o.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,j5);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var ykt=new h,Akt=new he,nLe=0;function yLe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=mLe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,pLe),d,p=r.cartesianToCartographic(s.position,Akt).height,g=Math.abs(nLe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=l_(e,u,gLe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(nLe=y),c){let b=aLe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,ykt);ose(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var ALe=new U,Y5=new gn,cM=new h,bkt=new h,bLe=new M,xkt=new M,xLe=new M,Tkt=new Le,Ekt=new $,ase=new he,cse=new h;function Ckt(e,t,n){let r=e._scene.camera;if(!M.equals(r.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,cse);jf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,ase);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Skt(e,t,n)):wkt(e,t,n)}var vkt=new he;function Skt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,vkt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=ALe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,Y5),d,p=bi.rayEllipsoid(f,i);if(l(p))d=gn.getPoint(f,p.start,cM);else if(a>e._minimumTrackBallHeight){let x=bi.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,ase);T.height=0,d=i.cartographicToCartesian(T,cM)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,cse);jf(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,bLe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=M.clone(o.transform,xLe);o._setTransform(g),Vf(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function wkt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,cM);else{if(a=l_(e,t,cM),!l(a)){if(c=o.getPickRay(t,Y5),u=bi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,ase).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,cse);jf(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,cM)}s&&(l(c)||(c=o.getPickRay(t,Y5)),cLe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=ALe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,Y5);let p=h.magnitude(a),g=h.fromElements(p,p,p,ise),m=ee.fromCartesian3(g,rse);if(u=bi.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=gn.getPoint(c,y,bkt),b=At.eastNorthUpToFixedFrame(a,i,bLe),x=At.eastNorthUpToFixedFrame(A,m,xkt),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=M.clone(o.transform,xLe);o._setTransform(x);let I=h.cross(A,o.positionWC,q5);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,Vf(e,t,n,v,!0,!1),o.constrainedAxis=C}else Vf(e,t,n,v,!0,!1);if(o._setTransform(b),Vf(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,q5);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,q5);if(e.enableCollisionDetection&&lse(e,!0),!h.equals(o.positionWC,L)){o._setTransform(x),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),w=h.cross(L,o.position,L);h.normalize(w,w);let D=Le.fromAxisAngle(w,C,Tkt),N=$.fromQuaternion(D,Ekt);$.multiplyByVector(N,o.direction,o.direction),$.multiplyByVector(N,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(S)}}var Ikt=new U,Pkt=new U,iLe=new gn,rLe=new gn,Dkt=new h,Rkt=new h;function jf(e,t,n,i){let o=e._scene.camera,s=Ikt;s.x=n.startPosition.x,s.y=0;let a=Pkt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,iLe),u=o.getPickRay(a,rLe),f=0,d,p;o.frustum instanceof _n?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,iLe),u=o.getPickRay(a,rLe),f=0,o.frustum instanceof _n?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,Dkt),b=h.equalsEpsilon(y,i,P.EPSILON2),x=h.equalsEpsilon(y,A,P.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=P.acosClamped(g);f>0&&f>T&&(f=T-P.EPSILON4),g=h.dot(y,A),T=P.acosClamped(g),f<0&&-f>T&&(f=-T+P.EPSILON4);let E=h.cross(i,y,Rkt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function Okt(e){Jl(e,e.enableRotate,e.rotateEventTypes,dkt,e.inertiaSpin,"_lastInertiaSpinMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,yLe,e.inertiaZoom,"_lastInertiaZoomMovement"),Jl(e,e.enableTilt,e.tiltEventTypes,Ckt,e.inertiaSpin,"_lastInertiaTiltMovement"),Jl(e,e.enableLook,e.lookEventTypes,jf)}var Mkt=new M,Nkt=new he;function lse(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??ee.WGS84,s=n.mapProjection,a,c;M.equals(r.transform,M.IDENTITY)||(a=M.clone(r.transform,Mkt),c=h.magnitude(r.position),r._setTransform(M.IDENTITY));let u=Nkt;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}lM.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Lkt=new h,Fkt=new h;lM.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ee.default):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=br.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=br.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=br.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,Lkt),c=h.clone(t.directionWC,Fkt);if(i===re.SCENE2D?N2t(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,rkt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,Okt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);lse(this,u)}this._aggregator.reset()};lM.prototype.isDestroyed=function(){return!1};lM.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var K5=lM;function uM(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ci({depthStencil:!0,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),this._passState=t}function Bkt(e,t,n,i){let r=Math.max(n,i),o=r*r,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-s<=c&&c<=s&&-a<=u&&u<=a){let m=4*((a-u)*n+c+s),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}uM.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};uM.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ze.FLOAT,framebuffer:this._fb.framebuffer});return Bkt(i,r,t,n)};uM.prototype.isDestroyed=function(){return!1};uM.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var $5=uM;var fM={},kkt=new et(0,0,3,3),Ukt=new U,zkt=new U,Vkt=new gn,jkt=new h,Hkt=3,Gkt=.1,TLe=9;function use(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function ELe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&use(s)<=Hkt&&(t=Math.min(t,s.depth));let n=t*(1+Gkt),i=e.filter(s=>!s.isEdge||s.depth<=n),r=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===r).reduce((s,a)=>use(a)<use(s)?a:s)}function CLe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let r of e){if(r.isEdge||r.object!==t)continue;let o=r.x*r.x+r.y*r.y;o<i&&(n=r,i=o)}return n}function fse(e,t,n){let i=Ukt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,Vkt);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let s=n.depth/o,a=h.multiplyByScalar(r.direction,s,jkt);return h.add(r.origin,a,new h)}fM.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:s}=e;if(!o.colorBufferFloat){yt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new $5(o));let a=s.snapFramebuffer,c=kkt;iM(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(rM(e),u.length===0)return;let f=ELe(u);if(!l(f))return;let d=fse(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=zkt;g.x=t.x+f.x,g.y=t.y+f.y,iM(e,g,c,TLe,TLe,{framebuffer:a,snap:!0});let m=a.end(c);rM(e);let y=CLe(m,f.object);p=l(y)?fse(e,g,y):void 0}return{object:f.object,isEdge:f.isEdge,position:d,surfacePosition:p,screenPosition:new U(t.x+f.x,t.y+f.y)}};fM._selectBestHit=ELe;fM._nearestSurfaceHit=CLe;fM._snapHitToWorld=fse;var J5=fM;var Z5=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -9426,7 +10708,7 @@ float x = length(gl_FragCoord.xy - center) / radius; float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var i8=`uniform sampler2D colorTexture; +`;var Q5=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -9447,46 +10729,51 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function D_(){this._sceneFramebuffer=new KE;let e=.125,t=new Array(6);t[0]=new fo({fragmentShader:Iu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Xf.LINEAR});let n=t[1]=new fo({fragmentShader:i8,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new z,t[2]=new fo({fragmentShader:wx,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 fo({fragmentShader:wx,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 fo({fragmentShader:Iu,sampleMode:Xf.LINEAR}),this._uCenter=new z,this._uRadius=void 0,t[5]=new fo({fragmentShader:n8,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Ou({stages:t});let o=new JE(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}D_.prototype.get=function(e){return this._stages.get(e)};D_.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 Vgt=new se,ixe=new z,zgt=new z,oxe=new F;function Hgt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,l=F.computeViewportTransformation(n,0,1,oxe),u=F.multiplyByPoint(r,o,Vgt),f=Ot.pointToGLWindowCoordinates(s,l,o,ixe);u.x+=O.SOLAR_RADIUS;let h=Ot.pointToGLWindowCoordinates(a,l,u,u),p=z.magnitude(z.subtract(h,f,h))*30*2,g=zgt;g.x=p,g.y=p,e._uCenter=z.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,b=e._stages,x=b.get(0),A=x.outputTexture.width,E=x.outputTexture.height,S=new Ke;S.width=A,S.height=E,l=F.computeViewportTransformation(S,0,1,oxe),f=Ot.pointToGLWindowCoordinates(s,l,o,ixe),g.x*=A/m,g.y*=E/y;let v=x.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let P=1;P<4;++P)Ke.clone(v,b.get(P).scissorRectangle)}D_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};D_.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),Hgt(this,t,n),o};D_.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)};D_.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};D_.prototype.isDestroyed=function(){return!1};D_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),de(this)};var o8=D_;function rxe(){this._cachedShowFrustumsShaders={}}function Ggt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function jgt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=He.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function u_(){this._sceneFramebuffer=new nI;let e=.125,t=new Array(6);t[0]=new zr({fragmentShader:Uf,textureScale:e,forcePowerOfTwo:!0,sampleMode:Qd.LINEAR});let n=t[1]=new zr({fragmentShader:Q5,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new zr({fragmentShader:jT,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 zr({fragmentShader:jT,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 zr({fragmentShader:Uf,sampleMode:Qd.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new zr({fragmentShader:Z5,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new zf({stages:t});let r=new sI(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}u_.prototype.get=function(e){return this._stages.get(e)};u_.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 Wkt=new se,vLe=new U,qkt=new U,SLe=new M;function Ykt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,SLe),u=M.multiplyByPoint(o,r,Wkt),f=At.pointToGLWindowCoordinates(s,c,r,vLe);u.x+=P.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=qkt;g.x=p,g.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,E=new et;E.width=x,E.height=T,c=M.computeViewportTransformation(E,0,1,SLe),f=At.pointToGLWindowCoordinates(s,c,r,vLe),g.x*=x/m,g.y*=T/y;let v=b.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let S=1;S<4;++S)et.clone(v,A.get(S).scissorRectangle)}u_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};u_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Ykt(this,t,n),r};u_.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 r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};u_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Uf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};u_.prototype.isDestroyed=function(){return!1};u_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var e9=u_;function wLe(){this._cachedShowFrustumsShaders={}}function Xkt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Kkt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Xe.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { czm_Debug_main(); -`;let l;if(s>0)for(l=0;l<s;++l)a+=` out_FragData_${r[l]}.rgb *= debugShowCommandsColor; -`,a+=` out_FragData_${r[l]}.rgb *= debugShowFrustumsColor; +`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${o[c]}.rgb *= debugShowCommandsColor; +`,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let u=Ggt(i);return en.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var AI=new G;function Wgt(e,t){let n;return c(t.uniformMap)?n=t.uniformMap:n={},c(n.debugShowCommandsColor)||c(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(c(t._debugColor)||(t._debugColor=G.fromRandom()),t._debugColor):G.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(AI.red=t.debugOverlappingFrustums&1?1:0,AI.green=t.debugOverlappingFrustums&2?1:0,AI.blue=t.debugOverlappingFrustums&4?1:0,AI.alpha=1,AI):G.WHITE}),n}var qgt=new Je;rxe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];c(o)||(o=jgt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=Je.shallowClone(t,qgt);r.shaderProgram=o,r.uniformMap=Wgt(e,t),r.execute(e.context,n)};var r8=rxe;function Lx(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Pn}Lx.fromKeyframeNode=function(e,t,n,i){T.typeOf.object("primitive",e),T.typeOf.number("tileIndex",t),T.typeOf.number("sampleIndex",n),T.typeOf.object("keyframeNode",i);let o=new Lx(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=Ygt(e,s,n),o._orientedBoundingBox=Kgt(e,r,n,o._orientedBoundingBox),o};function Ygt(e,t,n){if(!c(t)||!c(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let l=i[a],u=at.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[l]=f}return s}var sxe=new d,Xgt=new d;function Kgt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,l=Math.floor(a/o.x),u=a-l*o.x,f=d.fromElements(u,l,s,sxe),h=d.divideComponents(d.subtract(f,e._paddingBefore,sxe),e.dimensions,Xgt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(Lx.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()}}});Lx.prototype.hasProperty=function(e){return c(this._metadata[e])};Lx.prototype.getNames=function(){return Object.keys(this._metadata)};Lx.prototype.getProperty=function(e){return this._metadata[e]};var s8=Lx;var a8=`struct Ray { +`;a+="}",r.sources.push(a);let u=Xkt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var dM=new z;function $kt(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=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(dM.red=t.debugOverlappingFrustums&1?1:0,dM.green=t.debugOverlappingFrustums&2?1:0,dM.blue=t.debugOverlappingFrustums&4?1:0,dM.alpha=1,dM):z.WHITE}),n}var Jkt=new at;wLe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=Kkt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,Jkt);o.shaderProgram=r,o.uniformMap=$kt(e,t),o.execute(e.context,n)};var t9=wLe;function XT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}XT.fromKeyframeNode=function(e,t,n,i){let r=new XT(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=Zkt(e,s,n),r._orientedBoundingBox=e3t(e,o,n,r._orientedBoundingBox),r};function Zkt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=bt.getComponentCount(r[a]),f=o[a].slice(n*u,(n+1)*u);s[c]=f}return s}var ILe=new h,Qkt=new h;function e3t(e,t,n,i){let r=t.dimensions,o=r.x*r.y,s=Math.floor(n/o),a=n-s*o,c=Math.floor(a/r.x),u=a-c*r.x,f=h.fromElements(u,c,s,ILe),d=h.divideComponents(h.subtract(f,e._paddingBefore,ILe),e.dimensions,Qkt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(XT.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()}}});XT.prototype.hasProperty=function(e){return l(this._metadata[e])};XT.prototype.getNames=function(){return Object.keys(this._metadata)};XT.prototype.getProperty=function(e){return this._metadata[e]};var n9=XT;var PLe={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"};Object.freeze(PLe);var f_=PLe;function uI(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}uI.prototype.getTexture=function(e){return this._textures[e]};function t3t(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})}uI.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):t3t(this,e,t)};function n3t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?i9(r,o,n):i3t(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function i9(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?RLe(e,n):new Dt({context:n,source:t,sampler:r});return DLe(r)&&o.generateMipmap(),o}function i3t(e,t,n){let{typedArray:i,sampler:r}=e,o=DLe(r),s=r.wrapS===hn.REPEAT||r.wrapS===hn.MIRRORED_REPEAT||r.wrapT===hn.REPEAT||r.wrapT===hn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let d=Vk(i,a,c),p=Ub(d);return i9({sampler:r},p,n)}}else{let d=Ub(t);return i9(e,d,n)}else return i9(e,t,n);return o?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."),RLe(e,n)}function DLe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function RLe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}uI.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 r=n[i];n3t(this,r,t)}n.length=0};uI.prototype.isDestroyed=function(){return!1};uI.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 ue(this)};var r9=uI;function hM(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??$y.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Nx.INHERIT,this._textureManager=new r9,this._defaultTexture=void 0,this.uniformMap=r3t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},a3t(this),c3t(this)}function r3t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===f_.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=o3t(e,i)):n[i]=s3t(e,i)}return n}function o3t(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function s3t(e,t){return function(){return e.uniforms[t].value}}function KT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function a3t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,KT(o,t,r),r=e.usedVariablesVertex.featureIdSet,KT(o,n,r),r=e.usedVariablesVertex.metadataSet,KT(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,KT(s,t,r),r=e.usedVariablesFragment.featureIdSet,KT(s,n,r),r=e.usedVariablesFragment.metadataSet,KT(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;KT(s,a,c)}}function OLe(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 hl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${OLe(t)} is not available in the ${i} shader. Did you mean ${OLe(n)} instead?`;throw new pe(r)}}function c3t(e){let t=e.usedVariablesVertex.attributeSet;hl(t,"position","positionMC","vertex"),hl(t,"normal","normalMC","vertex"),hl(t,"tangent","tangentMC","vertex"),hl(t,"bitangent","bitangentMC","vertex"),hl(t,"positionWC","positionMC","vertex"),hl(t,"positionEC","positionMC","vertex"),hl(t,"normalEC","normalMC","vertex"),hl(t,"tangentEC","tangentMC","vertex"),hl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;hl(n,"position","positionEC","fragment"),hl(n,"normal","normalEC","fragment"),hl(n,"tangent","tangentEC","fragment"),hl(n,"bitangent","bitangentEC","fragment"),hl(n,"normalMC","normalEC","fragment"),hl(n,"tangentMC","tangentEC","fragment"),hl(n,"bitangentMC","bitangentEC","fragment")}hM.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===f_.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};hM.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};hM.prototype.isDestroyed=function(){return!1};hM.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var d_=hM;function l3t(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??$e.RGBA,this.pixelDatatype=e.pixelDatatype??ze.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?hn.REPEAT:hn.CLAMP_TO_EDGE;this.sampler=new Ht({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var o9=l3t;function u3t(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!f3t(r?.[s],o?.[s]))continue;let a=d3t(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function f3t(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function d3t(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return h3t(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return m3t(e,i,r)}function h3t(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new d_({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +{ + material.diffuse = fsInput.metadata.${e}.rgb; + material.alpha = fsInput.metadata.${e}.a; +}`})}function m3t(e,t,n){let r=Pk([new z(.267,.004,.329),new z(.282,.14,.457),new z(.254,.265,.53),new z(.207,.372,.553),new z(.164,.471,.558),new z(.128,.567,.551),new z(.135,.659,.518),new z(.194,.741,.443),new z(.282,.819,.369),new z(.396,.898,.301),new z(.538,.965,.236),new z(.741,.998,.149),new z(.993,1,.144)],128),o=new o9({typedArray:r,width:128,height:1});return new d_({uniforms:{u_colorMap:{type:f_.SAMPLER_2D,value:o},u_minimumValue:{type:f_.FLOAT,value:t[0]},u_maximumValue:{type:f_.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) + { + float value = fsInput.metadata.${e}; + vec3 voxelNormal = fsInput.attributes.normalEC; + float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); + float lighting = 0.5 + 0.5 * diffuse; + + if (value >= u_minimumValue && value <= u_maximumValue) { + float lerp = (value - u_minimumValue) / (u_maximumValue - u_minimumValue); + material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting; + material.alpha = 1.0; + } + }`})}var mM=u3t;function p3t(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,de.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=s9(r[_]),D=`PropertyStatistics_${C}`,N=`PropertyStatistics_${C}`;n.addStruct(D,N,de.FRAGMENT),n.addStructField(D,w,"min"),n.addStructField(D,w,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=`PropertyStatistics_${C}`,D=C;n.addStructField(f,w,D)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,de.FRAGMENT);for(let _=0;_<c;_++){let C=s9(r[_]);n.addStructField(g,C,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,de.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",E="Voxel",v="voxel";n.addStruct(T,E,de.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let S="FragmentInput";n.addStruct(S,"FragmentInput",de.FRAGMENT),n.addStructField(S,d,p),n.addStructField(S,m,y),n.addStructField(S,b,x),n.addStructField(S,E,v);let R="Properties",O="Properties",L="properties";n.addStruct(R,O,de.FRAGMENT);for(let _=0;_<c;_++){let C=s9(r[_]);n.addStructField(R,C,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=s9(r[C],o[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${w}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = propertiesA.${w} + propertiesB.${w};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${O} scaleProperties(${O} ${L}, float scale)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = mix(propertiesA.${w}, propertiesB.${w}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${O} ${L}, inout ${m} ${y})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${y}.${w} = ${L}.${w};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C],D=r[C],N=bt.getComponentCount(D);for(let F=0;F<N;F++){let V=_3t(D,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${MLe(B)};`,`${p}.${w}.max${V} = ${MLe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=r[C],D=o[C],N=g3t(w,D);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${N};`])}n.addFunctionLines(_,[`return ${L};`])}}function s9(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function g3t(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function MLe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function _3t(e,t){return e===bt.SCALAR?"":`[${t}]`}var a9=p3t;function vm(e){let{planes:t,modelMatrix:n=M.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=M.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?NLe:LLe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function NLe(e){return e===$t.OUTSIDE}function LLe(e){return e===$t.INSIDE}Object.defineProperties(vm.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?NLe:LLe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});vm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};vm.prototype.get=function(e){return this._planes[e]};function FLe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}vm.prototype.contains=function(e){return FLe(this._planes,e)!==-1};vm.prototype.remove=function(e){let t=this._planes,n=FLe(t,e);if(n===-1)return!1;e instanceof ga&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ga&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};vm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ga&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var y3t=new sn(h.fromElements(1,0,0),0);function A3t(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=x3t(i[o],t,y3t);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var dse=new se,b3t=new h;function x3t(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,dse),s=M.multiplyByVector(t,o,dse),a=h.fromCartesian4(s,b3t);return s=se.divideByScalar(s,h.magnitude(a),dse),sn.fromCartesian4(s,n)}function BLe(e,t){return t.x=Math.min(e,Ut.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var T3t=new U;vm.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=BLe(i,T3t);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;A3t(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};vm.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=BLe(r,n);return o.y*=2,o};vm.prototype.isDestroyed=function(){return!1};vm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var tb=vm;var c9=`struct Ray { vec3 pos; vec3 dir; -vec3 rawDir; }; -#if defined(JITTER) -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 c8=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +`;var l9=`#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 mat4 u_transformPositionViewToLocal; uniform mat3 u_transformDirectionViewToLocal; -uniform vec3 u_cameraPositionUv; +uniform vec3 u_cameraPositionLocal; +uniform vec3 u_cameraDirectionLocal; uniform float u_stepSize; #if defined(PICKING) uniform vec4 u_pickColor; @@ -9517,10 +10804,11 @@ 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) { -vec3 gradient = 2.0 * viewRay.rawDir * jacobianT; +vec3 gradient = viewRay.dir * jacobianT; vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient; RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay); -vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz); +vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz; +voxelNormal = normalize(czm_normal * voxelNormal); vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w); vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry); float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize; @@ -9549,57 +10837,65 @@ vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinat ivec3 sampleIndex = ivec3(floor(inputCoordinate)); return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z); } +Ray getViewRayLocal() { +vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord); +vec3 origin; +vec3 direction; +if (czm_orthographicIn3D == 1.0) { +eyeCoordinates.z = 0.0; +origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz; +direction = u_cameraDirectionLocal; +} else { +origin = u_cameraPositionLocal; +direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz); +} +return Ray(origin, direction); +} +Ray getViewRayEC() { +vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord); +vec3 viewPosEC = (czm_orthographicIn3D == 1.0) +? vec3(eyeCoordinates.xy, 0.0) +: vec3(0.0); +vec3 viewDirEC = normalize(eyeCoordinates.xyz); +return Ray(viewPosEC, viewDirEC); +} void main() { -vec4 fragCoord = gl_FragCoord; -vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; -vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); -vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); -vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); -vec3 viewPosUv = u_cameraPositionUv; -#if defined(SHAPE_ELLIPSOID) -vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv; -Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir); -#else -Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv); -#endif +Ray viewRayLocal = getViewRayLocal(); +Ray viewRayEC = getViewRayEC(); Intersections ix; -RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); +vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; +RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix); 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); +vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir; +TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC); +vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir; +mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal); 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); -currentT += noise * step.w; -positionUv += noise * step.w * viewDirUv; -#endif +traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas); +vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT); FragmentInput fragmentInput; #if defined(STATISTICS) -setStatistics(fragmentInput.metadata.statistics); +setStatistics(fragmentInput.metadataStatistics); #endif +czm_modelMaterial materialOutput; vec4 colorAccum = vec4(0.0); for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); 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.attributes.positionEC = positionEC; +fragmentInput.attributes.normalEC = normalize(step.xyz); +fragmentInput.voxel.viewDirUv = viewRayLocal.dir; fragmentInput.voxel.travelDistance = step.w; fragmentInput.voxel.stepCount = stepCount; fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex; fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]); -czm_modelMaterial materialOutput; +fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT; fragmentMain(fragmentInput, materialOutput); vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); color.rgb = max(color.rgb, vec3(0.0)); @@ -9610,10 +10906,9 @@ colorAccum.a = ALPHA_ACCUM_MAX; break; } if (step.w == 0.0) { -step.w == 0.00001; +step.w = 0.001; } currentT += step.w; -positionUv = viewPosUv + currentT * viewDirUv; if (currentT > endT) { #if (INTERSECTION_COUNT == 1) break; @@ -9624,13 +10919,15 @@ break; } else { currentT = shapeIntersection.entry.w; endT = shapeIntersection.exit.w; -positionUv = viewPosUv + currentT * viewDirUv; } #endif } -pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv); -traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas); -step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT); +positionEC = viewRayEC.pos + currentT * viewRayEC.dir; +tileAndUv = getTileAndUvCoordinate(positionEC); +positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir; +jacobianT = convertLocalToShapeSpaceDerivative(positionLocal); +traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas); +step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT); } colorAccum.a /= ALPHA_ACCUM_MAX; #if defined(PICKING) @@ -9649,7 +10946,7 @@ out_FragColor = vec4(megatextureId, sampleIndex); out_FragColor = colorAccum; #endif } -`;var l8=`in vec2 position; +`;var u9=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; void main() { vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; @@ -9658,7 +10955,7 @@ vec2 translation = 0.5 * (aabbMax + aabbMin); vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var u8=`#define NO_HIT (-czm_infinity) +`;var f9=`#define NO_HIT (-czm_infinity) #define INF_HIT (czm_infinity * 0.5) struct RayShapeIntersection { vec4 entry; @@ -9693,6 +10990,7 @@ return RayShapeIntersection(entry, exit); } struct Intersections { vec4 intersections[INTERSECTION_COUNT * 2]; +float distanceToDepthBuffer; #if (INTERSECTION_COUNT > 1) int index; int surroundCount; @@ -9738,1110 +11036,1649 @@ const int passCount = INTERSECTION_COUNT * 2; if (ix.index == passCount) { return shapeIntersection; } -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; +for (int i = 0; i < passCount; ++i) { +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 = intersectionType % 2 == 0; +ix.surroundCount += enter ? +1 : -1; +ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; +if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { +shapeIntersection.entry = surfaceIntersection; +} +bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; +bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; +if (exitPositive || enterNegativeFromPositive) { +shapeIntersection.exit = surfaceIntersection; +if (exitPositive) { +ix.index = passCount; +} +break; +} +} +return shapeIntersection; +} +#endif +`;var d9=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); +float entry; +float exit; +if (logDepthOrDepth != 0.0) { +vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); +eyeCoordinateDepth /= eyeCoordinateDepth.w; +entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir); +exit = +INF_HIT; +} else { +entry = NO_HIT; +exit = NO_HIT; +} +ix.distanceToDepthBuffer = entry; +#if defined(DEPTH_TEST) +setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); +#endif +} +`;var h9=`uniform sampler2D u_clippingPlanesTexture; +uniform mat4 u_clippingPlanesMatrix; +vec4 intersectPlane(in Ray ray, in vec4 plane) { +vec3 n = plane.xyz; +float w = plane.w; +float a = dot(ray.pos, n); +float b = dot(ray.dir, n); +float t = -(w + a) / b; +return vec4(n, t); +} +#ifdef CLIPPING_PLANES +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) +vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0); +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); +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); +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 +} +#endif +`;var pM=`vec4 transformNormalToEC(in vec4 intersection) { +return vec4(normalize(czm_normal * intersection.xyz), intersection.w); +} +RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { +return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit)); +} +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] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false)); +intersections[1] = transformNormalsToEC(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); +bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true); +farSide = transformNormalToEC(farSide); +if (hitPositiveSide) { +intersection = transformNormalToEC(intersection); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w); +intersections[1].entry = intersection; +intersections[1].exit = farSide; +} else { +vec4 miss = vec4(normalize(czm_normal * 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) +{ +vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); +vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); +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) { +return transformNormalsToEC(RayShapeIntersection(first, last)); +} else if (!exitFromInside && enterFromOutside) { +return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first)); +} else if (exitFromInside && !enterFromOutside) { +return transformNormalsToEC(RayShapeIntersection(last, farSide)); +} else { +return transformNormalsToEC(RayShapeIntersection(miss, miss)); +} +} +`;var m9=`uniform sampler2D u_renderBoundPlanesTexture; +RayShapeIntersection intersectBoundPlanes(in Ray ray) { +vec4 lastEntry = vec4(ray.dir, -INF_HIT); +vec4 firstExit = vec4(-ray.dir, +INF_HIT); +for (int i = 0; i < 6; i++) { +vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i); +vec4 intersection = intersectPlane(ray, boundPlane); +if (dot(ray.dir, boundPlane.xyz) < 0.0) { +lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry; +} else { +firstExit = intersection.w < firstExit.w ? intersection: firstExit; +} +} +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); +} +} +void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) +{ +RayShapeIntersection intersection = intersectBoundPlanes(rayEC); +setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +} +`;var p9=`uniform vec2 u_cylinderRenderRadiusMinMax; +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) +uniform vec2 u_cylinderRenderAngleMinMax; +#endif +uniform sampler2D u_renderBoundPlanesTexture; +RayShapeIntersection intersectBoundPlanes(in Ray ray) { +vec4 lastEntry = vec4(ray.dir, -INF_HIT); +vec4 firstExit = vec4(-ray.dir, +INF_HIT); +for (int i = 0; i < 2; i++) { +vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i); +vec4 intersection = intersectPlane(ray, boundPlane); +if (dot(ray.dir, boundPlane.xyz) < 0.0) { +lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry; +} else { +firstExit = intersection.w < firstExit.w ? intersection: firstExit; +} +} +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); +} +} +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; +vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0); +vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0); +vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1); +vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2); +return RayShapeIntersection(intersect1, intersect2); +} +RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius) +{ +RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true); +RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC); +return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection); +} +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) +{ +RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y); +setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); +if (outerIntersect.entry.w == NO_HIT) { +return; +} +#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) +RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); +setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); +setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); +setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); +setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +#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 g9=`#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 height, in bool convex) +{ +vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height); +vec3 position = ray.pos * radiiCorrection; +vec3 direction = ray.dir * radiiCorrection; +float a = dot(direction, direction); +float b = dot(direction, position); +float c = dot(position, position) - 1.0; +float determinant = b * b - a * c; +if (determinant < 0.0) { +vec4 miss = vec4(normalize(direction), NO_HIT); +return RayShapeIntersection(miss, miss); +} +determinant = sqrt(determinant); +float signB = b < 0.0 ? -1.0 : 1.0; +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 * (position + tmin * direction); +vec3 d2 = directionScale * (position + tmax * direction); +vec3 normal1 = normalize(czm_normal * d1); +vec3 normal2 = normalize(czm_normal * d2); +return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax)); } -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; -if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { -shapeIntersection.entry = surfaceIntersection; +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; +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) { +return (b == 0.0) +? vec2(NO_HIT) +: vec2(-0.5 * c / b, NO_HIT); } -bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; -bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; -if (exitPositive || enterNegativeFromPositive) { -shapeIntersection.exit = surfaceIntersection; -if (exitPositive) { -ix.index = passCount; +determinant = sqrt(determinant); +float signB = b < 0.0 ? -1.0 : 1.0; +float t1 = (-b - signB * determinant) / a; +float t2 = c / (a * t1); +float tmin = min(t1, t2); +float tmax = max(t1, t2); +return vec2(tmin, tmax); } -break; +vec3 getConeNormal(in vec3 p, in bool convex) { +vec2 radial = -abs(p.z) * normalize(p.xy); +float zSign = (p.z < 0.0) ? -1.0 : 1.0; +float z = length(p.xy) * zSign; +float flip = (convex) ? -1.0 : 1.0; +return normalize(vec3(radial, z) * flip); } +float getLatitudeConeShift(in float sinLatitude) { +float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; +float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2); +return primeVerticalRadius * u_eccentricitySquared * sinLatitude; } -return shapeIntersection; +void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { +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); +intersections[0].entry = -1.0 * farSide; +intersections[0].exit = farSide; +intersections[1].entry = miss; +intersections[1].exit = miss; +if (intersect.x == NO_HIT) { +return; } -#endif -`;var f8=`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) { -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)); +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) { +} else if (p0InShadowCone) { +intersections[0].exit = intersect1; +} else if (p1InShadowCone) { +intersections[0].entry = intersect0; } else { -setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); +intersections[0].exit = intersect0; +intersections[1].entry = intersect1; +intersections[1].exit = farSide; } } -`;var d8=`uniform sampler2D u_clippingPlanesTexture; -uniform mat4 u_clippingPlanesMatrix; -vec4 intersectPlane(in Ray ray, in vec4 plane) { -vec3 n = plane.xyz; -float w = plane.w; -float a = dot(ray.pos, n); -float b = dot(ray.dir, n); -float t = -(w + a) / b; -return vec4(n, t); +RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { +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); } -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) -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; +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 { -lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; -} +return RayShapeIntersection(intersect0, intersect1); } -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; } +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { +RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); +setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); +if (outerIntersect.entry.w == NO_HIT) { +return; } -if (lastTransmission.w < firstReflection.w) { -clippingVolume.entry = lastTransmission; -clippingVolume.exit = firstReflection; +RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); +if (innerIntersect.entry.w == NO_HIT) { +setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); } else { -clippingVolume.entry = vec4(-ray.dir, NO_HIT); -clippingVolume.exit = vec4(ray.dir, NO_HIT); +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); +setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); +setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); +setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); } -setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); +#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 +#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 +#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 CI=`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); +`;var fI=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { +intersectShape(ray, rayEC, ix); +RayShapeIntersection intersection = getFirstIntersection(ix); +if (intersection.entry.w == NO_HIT) { +return intersection; +} +#if defined(CLIPPING_PLANES) +intersectClippingPlanes(ray, ix); +#endif +intersectDepth(screenCoord, rayEC, ix); +#if (INTERSECTION_COUNT > 1) +initializeIntersections(ix); +for (int i = 0; i < INTERSECTION_COUNT; ++i) { +intersection = nextIntersection(ix); +if (intersection.exit.w > 0.0) { +intersection.entry.w = max(intersection.entry.w, 0.0); +break; } -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); } +#else +intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +return 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); +`;var _9=`uniform vec3 u_boxLocalToShapeUvScale; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +uniform mat3 u_boxEcToXyz; +mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) { +return mat3(1.0); } -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; +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +return shapeUv / u_boxLocalToShapeUvScale; +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 dPosition = u_boxEcToXyz * positionEC; +return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1)); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); +} +`;var y9=`uniform vec3 u_cylinderLocalToShapeUvScale; +uniform float u_cylinderShapeUvAngleRangeOrigin; +uniform mat3 u_cylinderEcToRadialTangentUp; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +uniform vec3 u_cameraShapePosition; +mat3 convertLocalToShapeSpaceDerivative(in vec3 position) { +vec3 radial = normalize(vec3(position.xy, 0.0)); +vec3 z = vec3(0.0, 0.0, 1.0); +vec3 east = normalize(vec3(-position.y, position.x, 0.0)); +return mat3(radial, east / length(position.xy), z); } -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; +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float radius = shapeUv.x / u_cylinderLocalToShapeUvScale.x; +float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvScale.y; +float height = shapeUv.z / u_cylinderLocalToShapeUvScale.z; +return vec3(radius, angle, height); } +vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) { +float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x); +vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle)); +float sinHalfAngle = sin(dAngle / 2.0); +float versine = 2.0 * sinHalfAngle * sinHalfAngle; +float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine; +return vec2(dRadial, dAngle); +} +vec3 convertEcToDeltaShape(in vec3 positionEC) { +vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC; +vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x); +return vec3(dPolar.xy, rtu.z); +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 deltaShape = convertEcToDeltaShape(positionEC); +float dx = u_cylinderLocalToShapeUvScale.x * deltaShape.x; +float dy = deltaShape.y / czm_twoPi; +#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) +float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi; +float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin); +float rawOutputUvAngle = cameraUvAngleShift + dy; +float rotation = floor(rawOutputUvAngle); +dy -= rotation; +#endif +dy *= u_cylinderLocalToShapeUvScale.y; +float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1; +tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate); +tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate); +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +if (tileCoordinate.y < 0) { +tileCoordinate.y += (maxTileCoordinate + 1); +} else if (tileCoordinate.y > maxTileCoordinate) { +tileCoordinate.y -= (maxTileCoordinate + 1); } -RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) -{ -vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false); -vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true); -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) { -return RayShapeIntersection(first, last); -} else if (!exitFromInside && enterFromOutside) { -return RayShapeIntersection(-1.0 * farSide, first); -} else if (exitFromInside && !enterFromOutside) { -return RayShapeIntersection(last, farSide); -} else { -return RayShapeIntersection(miss, miss); +#else +tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +#endif +vec3 tileUv = tileUvSum - vec3(tileCoordinateChange); +tileUv.x = clamp(tileUv.x, 0.0, 1.0); +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0); +#else +tileUv.y = clamp(tileUv.y, 0.0, 1.0); +#endif +tileUv.z = clamp(tileUv.z, 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } +`;var A9=`uniform vec3 u_cameraPositionCartographic; +uniform vec2 u_ellipsoidCurvatureAtLatitude; +uniform mat3 u_ellipsoidEcToEastNorthUp; +uniform vec3 u_ellipsoidRadii; +uniform vec2 u_evoluteScale; +uniform vec3 u_ellipsoidInverseRadiiSquared; +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +uniform float u_ellipsoidShapeUvLongitudeRangeOrigin; +#endif +uniform vec3 u_ellipsoidLocalToShapeUvScale; +uniform ivec4 u_cameraTileCoordinates; +uniform vec3 u_cameraTileUv; +vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { +vec2 p = abs(pos); +vec2 inverseRadii = 1.0 / radii; +vec2 tTrigs = vec2(0.7071067811865476); +vec2 v = radii * tTrigs; +vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; +const int iterations = 3; +for (int i = 0; i < iterations; ++i) { +vec2 q = normalize(p - evolute) * length(v - evolute); +tTrigs = (q + evolute) * inverseRadii; +tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); +v = radii * tTrigs; +evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; } -`;var h8=`uniform vec3 u_renderMinBounds; -uniform vec3 u_renderMaxBounds; -RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound) -{ -vec3 t0 = (minBound - ray.pos) / ray.dir; -vec3 t1 = (maxBound - ray.pos) / ray.dir; -vec3 entries = min(t0, t1); -vec3 exits = max(t0, t1); -vec3 directions = sign(ray.dir); -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 vec3(v * sign(pos), length(v - evolute)); } -return RayShapeIntersection(entry, exit); +mat3 convertLocalToShapeSpaceDerivative(in vec3 position) { +vec3 east = normalize(vec3(-position.y, position.x, 0.0)); +float distanceFromZAxis = length(position.xy); +vec2 posEllipse = vec2(distanceFromZAxis, position.z); +vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz); +vec2 surfacePoint = surfacePointAndRadius.xy; +vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz); +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)); +return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up); } -void intersectShape(in Ray ray, inout Intersections ix) -{ -RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds); -setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float longitude = shapeUv.x * czm_twoPi; +#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +longitude /= u_ellipsoidLocalToShapeUvScale.x; +#endif +float latitude = shapeUv.y * czm_pi; +#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) +latitude /= u_ellipsoidLocalToShapeUvScale.y; +#endif +float height = shapeUv.z / u_ellipsoidLocalToShapeUvScale.z; +return vec3(longitude, latitude, height); } -`;var m8=`uniform vec2 u_cylinderRenderRadiusMinMax; -uniform vec2 u_cylinderRenderHeightMinMax; -#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) -uniform vec2 u_cylinderRenderAngleMinMax; +vec3 convertEcToDeltaShape(in vec3 positionEC) { +vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC; +float cosLatitude = cos(u_cameraPositionCartographic.y); +float sinLatitude = sin(u_cameraPositionCartographic.y); +float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x; +vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0); +vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x); +float dLongitude = atan(positionXY.y, positionXY.x); +float sinHalfLongitude = sin(dLongitude / 2.0); +float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude; +enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude); +float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y; +vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0); +vec2 positionZX = cameraZX + vec2(enu.z, enu.y); +float dLatitude = atan(positionZX.y, positionZX.x); +float sinHalfLatitude = sin(dLatitude / 2.0); +float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude; +float dHeight = enu.z + dz; +return vec3(dLongitude, dLatitude, dHeight); +} +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 deltaShape = convertEcToDeltaShape(positionEC); +float dx = deltaShape.x / czm_twoPi; +#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi; +float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin); +float rawOutputUvLongitude = cameraUvLongitudeShift + dx; +float rotation = floor(rawOutputUvLongitude); +dx -= rotation; +dx *= u_ellipsoidLocalToShapeUvScale.x; +#endif +float dy = deltaShape.y / czm_pi; +#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)) +dy *= u_ellipsoidLocalToShapeUvScale.y; +#endif +float dz = u_ellipsoidLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); +} +TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) { +vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC); +vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate; +ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum)); +int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1; +tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate); +tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate); +#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +if (tileCoordinate.x < 0) { +tileCoordinate.x += (maxTileCoordinate + 1); +} else if (tileCoordinate.x > maxTileCoordinate) { +tileCoordinate.x -= (maxTileCoordinate + 1); +} +#else +tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate); +ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; +#endif +vec3 tileUv = tileUvSum - vec3(tileCoordinateChange); +#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)) +tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0); +#else +tileUv.x = clamp(tileUv.x, 0.0, 1.0); +#endif +tileUv.y = clamp(tileUv.y, 0.0, 1.0); +tileUv.z = clamp(tileUv.z, 0.0, 1.0); +return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); +} +`;var b9=`#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 -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; -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); +uniform ivec3 u_dimensions; +uniform ivec3 u_inputDimensions; +#if defined(PADDING) +uniform ivec3 u_paddingBefore; +#endif +struct OctreeNodeData { +int data; +int flag; +}; +struct TraversalData { +ivec4 octreeCoords; +int parentOctreeIndex; +}; +struct TileAndUvCoordinate { +ivec4 tileCoords; +vec3 tileUv; +}; +struct SampleData { +int megatextureIndex; +ivec4 tileCoords; +vec3 tileUv; +vec3 inputCoordinate; +#if (SAMPLE_COUNT > 1) +float weight; +#endif +}; +int normU8_toInt(in float value) { +return int(value * 255.0); } -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); +int normU8x2_toInt(in vec2 value) { +return int(value.x * 255.0) + 256 * int(value.y * 255.0); } -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); +float normU8x2_toFloat(in vec2 value) { +return float(normU8x2_toInt(value)) / 65535.0; } -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); +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; } -void intersectShape(Ray ray, inout Intersections ix) -{ -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; +OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { +int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; +int octreeCoordX = (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); } -#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) -RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false); -setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); -#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) -RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false); -setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); +int getOctreeParentIndex(in int octreeIndex) { +int octreeCoordX = (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; +} +vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) { +int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w; +float scalar = exp2(-1.0 * float(levelDifference)); +vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar; +return tileAndUv.tileUv * scalar + originShift; +} +vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) { +vec3 tileUv = getTileUv(tileAndUv, octreeCoords); +return clamp(tileUv, vec3(0.0), vec3(1.0)); +} +void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) { +vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords); +vec3 inputCoordinate = tileUv * vec3(u_dimensions); +#if defined(PADDING) +inputCoordinate += vec3(u_paddingBefore); +#endif +#if defined(Y_UP_METADATA_ORDER) +#if defined(SHAPE_BOX) +float inputY = inputCoordinate.y; +inputCoordinate.y = inputCoordinate.z; +inputCoordinate.z = float(u_inputDimensions.z) - inputY; +#elif defined(SHAPE_CYLINDER) +float angle = inputCoordinate.y; +float height = inputCoordinate.z; +#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)) +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 -#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 +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; +float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; +float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; +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; +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; +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); } -`;var p8=`#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); +OctreeNodeData traverseOctreeDownwards(in ivec4 tileCoordinate, inout TraversalData traversalData) { +OctreeNodeData childData; +for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { +int level = traversalData.octreeCoords.w + 1; +int levelDifference = tileCoordinate.w - level; +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +traversalData.octreeCoords = ivec4(coordinateAtLevel, level); +ivec3 childCoordinate = coordinateAtLevel & 1; +childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate); +if (childData.flag != OCTREE_FLAG_INTERNAL) { +break; } +traversalData.parentOctreeIndex = childData.data; } -RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex) -{ -vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight); -vec3 position = ray.pos * radiiCorrection; -vec3 direction = ray.dir * radiiCorrection; -float a = dot(direction, direction); -float b = dot(direction, position); -float c = dot(position, position) - 1.0; -float determinant = b * b - a * c; -if (determinant < 0.0) { -vec4 miss = vec4(normalize(direction), NO_HIT); -return RayShapeIntersection(miss, miss); +return childData; } -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -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)); +void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, 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(tileAndUv.tileCoords, traversalData); } -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; -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) { -return (b == 0.0) -? vec2(NO_HIT) -: vec2(-0.5 * c / b, NO_HIT); +#if (SAMPLE_COUNT == 1) +getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +#else +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); +#endif } -determinant = sqrt(determinant); -float signB = b < 0.0 ? -1.0 : 1.0; -float t1 = (-b - signB * determinant) / a; -float t2 = c / (a * t1); -float tmin = min(t1, t2); -float tmax = max(t1, t2); -return vec2(tmin, tmax); +bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { +int levelDifference = tileCoordinate.w - octreeCoords.w; +if (levelDifference < 0) { +return false; } -vec3 getConeNormal(in vec3 p, in bool convex) { -vec2 radial = -abs(p.z) * normalize(p.xy); -float zSign = (p.z < 0.0) ? -1.0 : 1.0; -float z = length(p.xy) * zSign; -float flip = (convex) ? -1.0 : 1.0; -return normalize(vec3(radial, z) * flip); +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +return coordinateAtLevel == octreeCoords.xyz; } -float getLatitudeConeShift(in float sinLatitude) { -float x2 = u_eccentricitySquared * sinLatitude * sinLatitude; -float primeVerticalRadius = inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; +void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { +ivec4 tileCoords = tileAndUv.tileCoords; +if (insideTile(tileCoords, traversalData.octreeCoords)) { +for (int i = 0; i < SAMPLE_COUNT; i++) { +addSampleCoordinates(tileAndUv, sampleDatas[i]); } -void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -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); -intersections[0].entry = -1.0 * farSide; -intersections[0].exit = farSide; -intersections[1].entry = miss; -intersections[1].exit = miss; -if (intersect.x == NO_HIT) { return; } -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) { -} 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; +for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { +traversalData.octreeCoords.xyz /= 2; +traversalData.octreeCoords.w -= 1; +if (insideTile(tileCoords, traversalData.octreeCoords)) { +break; } +traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); } -RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) { -ray.pos = ray.pos * u_ellipsoidRadiiUv; -ray.dir = ray.dir * u_ellipsoidRadiiUv; -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); +OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData); +#if (SAMPLE_COUNT == 1) +getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +#else +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); +#endif } -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); +`;var x9=`uniform ivec3 u_megatextureTileCounts; +vec3 index1DTo3DTexCoord(int index) +{ +int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y; +int iz = index / tilesPerZ; +int remainder = index - iz * tilesPerZ; +int iy = remainder / u_megatextureTileCounts.x; +int ix = remainder - iy * u_megatextureTileCounts.x; +return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts); } +Properties getPropertiesFromMegatexture(in SampleData sampleData) { +int tileIndex = sampleData.megatextureIndex; +vec3 voxelCoord = sampleData.inputCoordinate; +vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex); +vec3 tileDimensions = vec3(u_inputDimensions); +vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5)); +vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts); +return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv); } -void intersectShape(in Ray ray, inout Intersections ix) { -ray.pos = ray.pos * 2.0 - 1.0; -ray.dir *= 2.0; -RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true); -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); -if (outerIntersect.entry.w == NO_HIT) { +Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { +#if (SAMPLE_COUNT == 1) +return getPropertiesFromMegatexture(sampleDatas[0]); +#else +Properties properties = clearProperties(); +for (int i = 0; i < SAMPLE_COUNT; ++i) { +float weight = sampleDatas[i].weight; +if (weight > 0.0) { +Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); +tempProperties = scaleProperties(tempProperties, weight); +properties = sumProperties(properties, tempProperties); +} +} +return properties; +#endif +} +`;var kLe={Z_UP:0,Y_UP:1};Object.freeze(kLe);var h_=kLe;function E3t(e){let t=new N_;this.shaderBuilder=t;let n=e._customShader,i=Mt(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,de.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",de.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([u9]),e.provider.metadataOrder===h_.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,de.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,de.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,de.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,de.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",b9,c9,x9,f9,h9,d9]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,de.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,de.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,de.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,de.FRAGMENT),u==="BOX"?t.addFragmentLines([_9,m9,fI]):u==="CYLINDER"?t.addFragmentLines([y9,pM,p9,fI]):u==="ELLIPSOID"&&t.addFragmentLines([A9,pM,g9,fI]),t.addFragmentLines([l9]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,de.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,de.FRAGMENT),s===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,de.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,de.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,de.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,de.FRAGMENT)}var T9=E3t;var ULe=new U;function C3t(e,t){let n=new T9(e);a9(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(o>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=Ns.getTextureResolution(r,t,ULe),S=zLe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}if(a>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=tb.getTextureResolution(s,t,ULe),S=zLe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}let c=i.clone();c.addDefine("PICKING",void 0,de.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,de.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ge.fromCache({cull:{enabled:!0,face:Gi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:rn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new at({vertexArray:m,primitiveType:Oe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=at.shallowClone(A,new at);b.shaderProgram=d,b.pickOnly=!0;let x=at.shallowClone(A,new at);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function zLe(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let s=`${r}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; + int pixX = planeNumber - (pixY * ${t}); + // Sample from center of pixel + float u = (float(pixX) + 0.5) * ${o}; + float v = (float(pixY) + 0.5) * ${s}; + return texture(packedPlanes, vec2(u, v));`}var E9=C3t;function m_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(m_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});m_.fromMetadataArray=function(e){return new m_({metadata:e})};m_.fromGltf=async function(e){let t=new Cd({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new m_({loader:t})};m_.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:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=v3t(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function v3t(e,t,n){let{className:i,names:r,types:o,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Lt.toComponentDatatype(s[f]),m=bt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}m_.prototype.isDestroyed=function(){return!1};m_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var dI=m_;function ml(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=ml.DefaultMinBounds.clone(),this._maxBounds=ml.DefaultMaxBounds.clone(),this._renderMinBounds=ml.DefaultMinBounds.clone(),this._renderMaxBounds=ml.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=ml,n=[new ga(h.negate(h.UNIT_X,new h),e.x),new ga(h.negate(h.UNIT_Y,new h),e.y),new ga(h.negate(h.UNIT_Z,new h),e.z),new ga(h.UNIT_X,-t.x),new ga(h.UNIT_Y,-t.y),new ga(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new tb({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(ml.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var S3t=new h,w3t=new h,I3t=new $,P3t=new h,D3t=new h;ml.prototype.update=function(e,t,n,i,r){i=i??t.clone(P3t),r=r??n.clone(D3t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),s=h.clamp(n,i,r,this._renderMaxBounds),a=M.getScale(e,w3t);if(o.x>s.x||o.y>s.y||o.z>s.z||(o.x===s.x)+(o.y===s.y)+(o.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=pse(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(hse(p.x,g.x),hse(p.y,g.y),hse(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function hse(e,t){return P.equalsEpsilon(e,t,P.EPSILON7)?1:1/(t-e)}var R3t=new M;ml.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,R3t),i=M.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};ml.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var C9=new h,mse=new h;ml.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(o.x,s.x,a*t),P.lerp(o.y,s.y,a*n),P.lerp(o.z,s.z,a*i),C9),u=h.fromElements(P.lerp(o.x,s.x,a*(t+1)),P.lerp(o.y,s.y,a*(n+1)),P.lerp(o.z,s.z,a*(i+1)),mse);return pse(c,u,this._shapeTransform,r)};var VLe=new h;ml.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,VLe),s=h.multiplyByScalar(o,r,VLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,C9),r,C9),c=h.add(a,s,mse),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),C9),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),mse);return pse(d,p,this._shapeTransform,i)};ml.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));ml.DefaultMaxBounds=Object.freeze(new h(1,1,1));var jLe=new h;function pse(e,t,n,i){let r=ml.DefaultMinBounds,o=ml.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,jLe),c=h.midpoint(e,t,S3t);i.center=M.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),jLe);let u=M.getRotation(n,I3t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var hI=ml;function Hf(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=Hf.DefaultMinBounds.clone(),this._maxBounds=Hf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Hf,n=[new ga(h.negate(h.UNIT_Z,new h),e.z),new ga(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new tb({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,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_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Hf.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var O3t=new h,M3t=new h,N3t=new h,L3t=new h,F3t=new h,B3t=new M,k3t=new h,HLe=new U;Hf.prototype.update=function(e,t,n,i,r){i=i??t.clone(M3t),r=r??n.clone(N3t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=Hf,a=s.y-o.y,c=.5*a,u=P.EPSILON10,f=P.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=P.negativePiToPi(t.y),n.y=P.negativePiToPi(n.y),i.y=P.negativePiToPi(i.y),r.y=P.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,L3t),p=h.minimumByComponent(n,r,F3t),g=M.getScale(e,O3t);if(p.x===0||d.x>p.x||d.z>p.z||P.equalsEpsilon(g.x,0,void 0,u)||P.equalsEpsilon(g.y,0,void 0,u)||P.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=yse(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*a,b=p.y<d.y,x=p.y-d.y+b*a,T=x>=c-f&&x<a-f,E=x>f&&x<c-f,v=x<=f,S=T||E||v,I=this._shaderUniforms,R=this._shaderDefines;for(let q in R)R.hasOwnProperty(q)&&(R[q]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,A<a-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),I.cylinderRenderRadiusMinMax=U.fromElements(d.x,p.x,I.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let w=n.z-t.z,D=0,N=1;w!==0&&(D=1/w,N=-t.z*D),S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):E?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):v&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),I.cylinderRenderAngleMinMax=U.fromElements(d.y,p.y,I.cylinderRenderAngleMinMax));let F=(t.y-o.y)/a,V=(n.y-o.y)/a,B=1-A/a,j=(V+.5*B)%1;I.cylinderShapeUvAngleRangeOrigin=j;let k=0,G=1;if(A>f){k=a/A;let q=F-j;G=-k*(q-Math.floor(q))}return I.cylinderLocalToShapeUvScale=h.fromElements(_,k,D,I.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,G,N,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var U3t=new $,z3t=new $,V3t=new M;Hf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,B3t),i=M.multiplyByPoint(n,e.camera.positionWC,k3t);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,HLe),HLe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],U3t),s=e.context.uniformState.inverseView,a=M.multiplyTransformation(n,s,V3t),c=M.getMatrix3(a,z3t);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};Hf.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*o.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*o.y+a.y,r=r*o.z+a.z,h.fromElements(n,i,r,t)};var v9=new h,_se=new h;Hf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(o.x,s.x,t*a),P.lerp(o.y,s.y,n*a),P.lerp(o.z,s.z,i*a),v9),u=h.fromElements(P.lerp(o.x,s.x,(t+1)*a),P.lerp(o.y,s.y,(n+1)*a),P.lerp(o.z,s.z,(i+1)*a),_se);return yse(c,u,this._shapeTransform,r)};var GLe=new h;Hf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,GLe),s=h.multiplyByScalar(o,r,GLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,v9),r,v9),c=h.add(a,s,_se),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),v9),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),_se);return yse(d,p,this._shapeTransform,i)};Hf.DefaultMinBounds=Object.freeze(new h(0,-P.PI,-1));Hf.DefaultMaxBounds=Object.freeze(new h(1,+P.PI,1));var j3t=5,H3t=new Array(j3t),G3t=new h,W3t=new $,q3t=new M,Y3t=new M,X3t=new M,gse=new M,K3t=new h,$3t=new h,J3t=new h,qLe=new Array(8);for(let e=0;e<8;e++)qLe[e]=new h;function WLe(e,t,n){return Math.abs(se.dot(e,t))<n}function Z3t(e){let t=M.getColumn(e,0,K3t),n=M.getColumn(e,1,$3t),i=M.getColumn(e,2,J3t),r=P.EPSILON4;return WLe(t,n,r)&&WLe(n,i,r)}function Q3t(e,t){let n=qLe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var eUt=new h;function yse(e,t,n,i){let r=e.x,o=t.x,s=e.y,a=t.y<s?t.y+P.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=H3t,g=0;p[g++]=s,p[g++]=a,p[g++]=d,f>P.PI&&(p[g++]=d-P.PI_OVER_TWO,p[g++]=d+P.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,B=Math.cos(V),j=Math.sin(V),k=B*r,G=j*r,q=B*o,Q=j*o;m=Math.min(m,k,q),y=Math.min(y,G,Q),A=Math.max(A,k,q),b=Math.max(b,G,Q)}let x=A-m,T=b-y,E=u-c,v=(m+A)*.5,S=(y+b)*.5,I=(c+u)*.5,R=h.fromElements(v,S,I,G3t),O=$.fromRotationZ(d,W3t),L=h.fromElements(x,T,E,eUt),_=M.fromScale(L,X3t),C=M.fromRotation(O,Y3t),w=M.fromTranslation(R,q3t),D=M.multiplyTransformation(C,M.multiplyTransformation(w,_,gse),gse),N=M.multiplyTransformation(n,D,gse);return Z3t(N)?en.fromTransformation(N,i):Q3t(N,i)}var mI=Hf;function ih(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ie,this._minimumHeight=ih.DefaultMinBounds.z,this._maximumHeight=ih.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new U,ellipsoidCurvatureAtLatitude:new U,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new U,clipMinMaxHeight:new U},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_SHAPE_BOUNDS_LONGITUDE: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}Object.defineProperties(ih.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var tUt=new h,nUt=new h,iUt=new h,rUt=new h,oUt=new h,sUt=new h,aUt=new h,cUt=new h,YLe=new h,XLe=new h,lUt=new ie;ih.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=ih;i=i??o,r=r??s;let a=P.EPSILON10,c=P.EPSILON10,u=P.EPSILON10,f=P.EPSILON3,d=M.getScale(e,cUt),p=h.clone(o,tUt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,nUt),m=h.clamp(n,p,s,iUt),y=h.clamp(i,p,s,rUt),A=h.clamp(r,p,s,oUt),b=h.maximumByComponent(g,y,sUt),x=h.minimumByComponent(m,A,aUt),T=h.add(d,h.fromElements(m.z,m.z,m.z,YLe),YLe),E=h.add(d,h.fromElements(x.z,x.z,x.z,XLe),XLe);if(b.y>x.y||b.y===s.y||x.y===o.y||b.z>x.z||P.equalsEpsilon(E,h.ZERO,void 0,a))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let v=ie.fromRadians(b.x,b.y,x.x,x.y,lUt);this._orientedBoundingBox=Ase(v,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=M.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let S=s.x-o.x,I=.5*S,R=x.x<b.x,O=x.x-b.x+R*S,L=O<=c,_=O>=I-c&&O<S-c,C=O>c&&O<I-c,w=L||_||C,D=m.x<g.x,N=m.x-g.x+D*S,F=N>I+c&&N<S-c,V=N>=I-c&&N<=I+c,B=N<I-c,j=F||V||B,k=x.y<-f,G=x.y>=-f&&x.y<=+f,q=x.y>+f&&x.y<s.y-u,Q=k||G||q,W=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ae=W||J||Z,Ae=Q||ae,fe=m.y-g.y,xe=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<s.y-u,ve=xe||ge||we,Re=g.y>o.y+u&&g.y<-f,Qe=g.y>=-f&&g.y<=+f,He=g.y>+f,Ke=ve||(Re||Qe||He),Pe=this._shaderUniforms,qe=this._shaderDefines;for(let Yn in qe)qe.hasOwnProperty(Yn)&&(qe[Yn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:st,z:vt}=Pe.ellipsoidRadii,jt=vt/st;Pe.eccentricitySquared=1-jt*jt,Pe.evoluteScale=U.fromElements((st*st-vt*vt)/st,(vt*vt-st*st)/vt,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let lt=0;qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,Pe.clipMinMaxHeight=U.fromElements(b.z-m.z,x.z-m.z,Pe.clipMinMaxHeight);let mt=m.z-g.z,ft=mt===0?0:1/mt;w&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,_?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):C?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):L&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),Pe.ellipsoidRenderLongitudeMinMax=U.fromElements(b.x,x.x,Pe.ellipsoidRenderLongitudeMinMax));let Yt=0,rt=1;if(j){qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Yn=(g.x-o.x)/S,gi=(m.x-o.x)/S,zi=1-N/S,Si=(gi+.5*zi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=Si,N>c){Yt=S/N;let ui=Yn-Si;rt=-Yt*(ui-Math.floor(ui))}}Ae&&(ae&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,W?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):J?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):Z&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,k?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):G?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(b.y),Math.sin(x.y),Pe.ellipsoidRenderLatitudeSinMinMax));let ht=0,Li=1;return Ke&&(qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,fe>u&&(ht=(s.y-o.y)/fe,Li=(o.y-g.y)/fe)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(Yt,ht,ft,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,Li,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=lt,!0};var uUt=new he,fUt=new h,dUt=new M,KLe=new $;ih.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,uUt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,fUt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,dUt),a=M.getRotation(s,KLe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,KLe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var nFe=new ie;ih.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,s,c,a,u,nFe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return Ase(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var hUt=new U,mUt=new U,gM=new U,$Le=new U,JLe=new U,_M=new U;function pUt(e,t,n,i){let r=U.abs(e,hUt),o=U.fromElements(1/t.x,1/t.y,mUt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,gM),a=U.multiplyComponents(t,s,$Le),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,JLe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,_M)),d=U.normalize(U.subtract(r,c,_M),_M),p=U.multiplyByScalar(d,f,_M);s=U.multiplyComponents(U.add(p,c,gM),o,gM),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,gM),gM),a=U.multiplyComponents(t,s,$Le),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,JLe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,_M)),i)}var gUt=new U,ZLe=new U,_Ut=new h,QLe=new U;ih.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=U.fromElements(u,e.z,ZLe),d=pUt(f,U.fromElements(i.x,i.z,gUt),r,_Ut),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,QLe),QLe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,ZLe),A=m*U.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*a.y+c.y),A=1+A*a.z,h.fromElements(n,g,A,t)};var eFe=new h,tFe=new h,yUt=new h;ih.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,eFe),s=h.multiplyByScalar(o,r,eFe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,tFe),r,tFe),c=h.add(a,s,yUt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,nFe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return Ase(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Ase(e,t,n,i,r,o,s){return s=en.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}ih.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));ih.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var pI=ih;var Yu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Yu.getMinBounds=function(e){switch(e){case Yu.BOX:return hI.DefaultMinBounds;case Yu.ELLIPSOID:return pI.DefaultMinBounds;case Yu.CYLINDER:return mI.DefaultMinBounds}};Yu.getMaxBounds=function(e){switch(e){case Yu.BOX:return hI.DefaultMaxBounds;case Yu.ELLIPSOID:return pI.DefaultMaxBounds;case Yu.CYLINDER:return mI.DefaultMaxBounds}};Yu.getShapeConstructor=function(e){switch(e){case Yu.BOX:return hI;case Yu.ELLIPSOID:return pI;case Yu.CYLINDER:return mI}};Object.freeze(Yu);var Rc=Yu;var bse=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function yM(e,t){this.spatialNode=e,this.keyframe=t,this.state=bse.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}yM.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=bse.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};yM.priorityComparator=function(e,t){return e.priority-t.priority};yM.searchComparator=function(e,t){return e.keyframe-t.keyframe};yM.LoadState=bse;var Gr=yM;function A0(e,t,n,i,r=134217728,o){let s=AUt(i),a=bUt(n),c=n*Lt.getSizeInBytes(i),u=A0.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new o2({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new Ht({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new xUt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(A0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ht.NEAREST:this.texture.sampler=new Ht({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR}),this._nearestSampling=e)}}});function AUt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function bUt(e){switch(e){case 1:return $e.RED;case 2:return $e.RG;case 3:return $e.RGB;case 4:return $e.RGBA}}function xUt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}A0.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};A0.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--};A0.prototype.isFull=function(){return this.emptyList===void 0};A0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=Ut;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,s=Math.floor(n/o);if(s<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=a.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=iFe(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}iFe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=a[f];u[d]=c[f]*p}return u};function iFe(e){return e.reduce((t,n)=>t*n)}A0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,s=Math.floor(e/o),a=e-s*o,c=Math.floor(a/n.x),u=a-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(f)};A0.prototype.isDestroyed=function(){return!1};A0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var S9=A0;function rh(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var TUt=new h;rh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,TUt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};rh.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,s=i*2,a=r*2,c=s+1,u=o+1,f=a+1,d=t+1,p=[[d,o,s,a],[d,u,s,a],[d,o,c,a],[d,u,c,a],[d,o,s,f],[d,u,s,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new rh(g,m,y,A,this,e,this.dimensions))};rh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};rh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var rFe={keyframe:0};function AM(e,t){return rFe.keyframe=e,Pr(t,rFe,Gr.searchComparator)}rh.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=EUt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=oFe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=oFe(n-t.level,x);if(T<c&&(c=T,s=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function EUt(e,t){let n=AM(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function oFe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}rh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};rh.prototype.createKeyframeNode=function(e){let t=AM(e,this.keyframeNodes);if(t<0){t=~t;let n=new Gr(this,e);this.keyframeNodes.splice(t,0,n)}};rh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=AM(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 o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=AM(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};rh.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 o=0;o<t.length;o++){let s=t[o];e.megatextureIndex=s.add(n[o])}let i=this.renderableKeyframeNodes,r=AM(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};rh.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 w9=rh;function nb(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:s}=e,{types:a,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<a.length;b++){let x=a[b],T=bt.getComponentCount(x),E=c[b];this.megatextures[b]=new S9(t,s,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new w9(0,0,0,0,void 0,d,o),this._priorityQueue=new j_({maximumLength:f,comparator:Gr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,xse(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}nb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function xse(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,xse(e,t,r-1,i+1),xse(e,r+1,n,i+1)}nb.simultaneousRequestCountMaximum=50;nb.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Dt({context:o,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&sFe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();SUt(this,e),wUt(this,e);let m=xn();OUt(this,d,c);let y=xn(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;RUt(this,e,b,x,T)}};nb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};nb.prototype.isDestroyed=function(){return!1};nb.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(),ue(this)};function sFe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];sFe(e,i)}}function CUt(e,t){if(e._simultaneousRequestCount>=nb.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Gr.LoadState.PROCESSING:Gr.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Gr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Gr.LoadState.RECEIVING,u.then(s).catch(a))}function vUt(e){return e/(1+e)}function SUt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),aFe(e.rootNode,aa.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,r[o]=s,o++;e._highPriorityKeyframeNodeCount=o}function wUt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(IUt);let o=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=o[u];if(!(f.state===Gr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Gr.LoadState.UNLOADED&&CUt(e,f),f.state===Gr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!PUt(d.metadata,e)){f.content=void 0,f.state=Gr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Gr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function IUt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function PUt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:s}=i[r],{x:a,y:c,z:u}=o,f=a*c*u,d=e[r],p=f*s;if(d.length!==p)return!1}return!0}function aFe(e,t,n,i){let{camera:r,context:o,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===aa.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=P.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let I=0;I<A;I++)e.createKeyframeNode(I);let{screenSpaceError:T,keyframeNodes:E}=e,v=vUt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+DUt(b,R.keyframe,x,n),R.state!==Gr.LoadState.UNAVAILABLE&&R.state!==Gr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===Gr.LoadState.LOADED&&(S=!0)}if(T<m||!S){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let I=0;I<8;I++){let R=e.children[I];aFe(R,t,n,i)}}function DUt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-r/o,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function RUt(e,t,n,i,r){let o=e._keyframeCount,s=e.rootNode,a=Object.keys(Gr.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let S=0;S<a;S++){let I=new Array(o).fill(0);c[S]=I,u[S]=0}function d(S){let I=S.keyframeNodes;for(let R=0;R<I.length;R++){let O=I[R],L=O.keyframe,_=O.state;c[_][L]+=1,u[_]+=1,f++}if(l(S.children))for(let R=0;R<8;R++){let O=S.children[R];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Gr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Gr.LoadState.RECEIVING],g=u[Gr.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(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 A=`KEYFRAMES: ${c[Gr.LoadState.LOADED]}`,b=`UNLOADED: ${u[Gr.LoadState.UNLOADED]} | RECEIVING: ${u[Gr.LoadState.RECEIVING]} | PROCESSING: ${u[Gr.LoadState.PROCESSING]} | LOADED: ${u[Gr.LoadState.LOADED]} | FAILED: ${u[Gr.LoadState.FAILED]} | UNAVAILABLE: ${u[Gr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(r*100)/100,v=`LOAD: ${x} | OCT: ${T} | ALL: ${E}`;console.log(`${A} || ${b} || ${v}`)}var I9={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function OUt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(r),E.isRenderable(o)&&(x=!0)}if(x){u[b]=I9.INTERNAL<<16|m,u[y]=A,a++,A=m,b=A*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=a,y=m*9+0,d(E,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let T=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,S=E.spatialNode.parent,I=l(S)?S.renderableKeyframeNodePrevious:E,R=MUt(g,i,n),O=v,L=1,_=E.megatextureIndex,C=I.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[b]=I9.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?I9.LEAF:I9.PACKED_LEAF_FROM_PARENT;u[b]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),NUt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&LUt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function MUt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return P.clamp(s,0,1)}function NUt(e,t,n,i){let r=$e.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function LUt(e,t,n,i){let r=$e.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var P9=nb;function b0(e){e=e??H.EMPTY_OBJECT;let{provider:t=b0.DefaultProvider,modelMatrix:n=M.IDENTITY,customShader:i=mM(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Hp,this._calculateStatistics=o;let{shape:s,minBounds:a=Rc.getMinBounds(s),maxBounds:c=Rc.getMaxBounds(s),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=FUt(u,f,d,p),this._availableLevels=g,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(n),this._modelMatrixOld=M.clone(this._modelMatrix),this._customShader=i??b0.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new M,this._transformPositionWorldToLocal=new M,this._transformPlaneLocalToView=new M,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new zp,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Rc.getShapeConstructor(s);this._shape=new m,lFe(this),this._shapeVisible=uFe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new M,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}BUt(this,this._shape),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}function FUt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===h_.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function BUt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let s=`u_${o}`;n[s]=function(){return i[o]}}e._shapeDefinesOld=Ze(r,!0)}Object.defineProperties(b0.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=M.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}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.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=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ns.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=mM(this._provider);this._customShader=r??b0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var kUt=new se,UUt=new se,zUt=new M,VUt=new M,jUt=new h,HUt=new se;b0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){$Ut(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=lFe(this),o=KUt(this,e);if((r||o)&&(this._shapeVisible=uFe(this),szt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=azt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,r,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&pzt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),czt(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=U.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(E9(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=fzt(p,d,UUt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=M.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=M.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=M.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=qUt(this,n.cameraPositionLocal,HUt);n.cameraTileCoordinates=se.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,GUt(this),WUt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function GUt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function WUt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function qUt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,jUt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var YUt=new h,Tse=new h,XUt=new he;function KUt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function $Ut(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new P9(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,ozt(e._traversal,i)}function lFe(e){return bM(e,"_modelMatrix","_modelMatrixOld")+bM(e,"_minBounds","_minBoundsOld")+bM(e,"_maxBounds","_maxBoundsOld")+bM(e,"_minClippingBounds","_minClippingBoundsOld")+bM(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function bM(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var JUt=new h,ZUt=new h,QUt=new h,ezt=new h,tzt=new M,nzt=new M;function uFe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,JUt),r=h.clone(e._maxBounds,ZUt),o=h.clone(e._minClippingBounds,QUt),s=h.clone(e._maxClippingBounds,ezt),a=M.clone(e._modelMatrix,tzt);if(e.shape===Rc.ELLIPSOID)i.z=br.getHeight(e._minBounds.z,t,n),r.z=br.getHeight(e._maxBounds.z,t,n),o.z=br.getHeight(e._minClippingBounds.z,t,n),s.z=br.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,YUt);M.multiplyByScale(a,m,a),M.multiplyByTranslation(a,rzt(e),a)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,d=M.multiplyTransformation(f,a,nzt);M.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,s)?(e._transformPositionLocalToWorld=M.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=M.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=M.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var izt=new h;function rzt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:r=M.IDENTITY}=e._provider,o=M.getTranslation(i,Tse),s=M.multiplyByPoint(e._modelMatrix,o,Tse),a=M.multiplyByPoint(r,s,Tse),u=ee.WGS84.cartesianToCartographic(a,XUt),f=0;l(u)&&(f=u.height);let d=br.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,izt)}function ozt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function szt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Ze(t,!0)),n}function azt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),a=K.secondsDifference(n,i.start)/o;return r+a}function czt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}b0.prototype.isDestroyed=function(){return!1};b0.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(),ue(this)};var cFe=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)),lzt=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),uzt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function fzt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,zUt),r=M.multiply(t,i,VUt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=uzt,d=cFe.length;for(u=0;u<d;u++)M.multiplyByVector(r,cFe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=lzt[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=se.lerp(p,y,x,kUt),E=T.x/T.w,v=T.y/T.w;o=Math.min(o,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return o=P.clamp(o,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=se.fromElements(o,a,s,c,n),n}var Ese=3e7,dzt=new h(Ese,0,0),hzt=new h(0,Ese,0),mzt=new h(0,0,Ese);function pzt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:lr.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(h.ZERO,dzt,z.RED,a),r(h.ZERO,hzt,z.LIME,a),r(h.ZERO,mzt,z.BLUE,a),i.update(t)}b0.DefaultCustomShader=new d_({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +{ + vec3 voxelNormal = fsInput.attributes.normalEC; + float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); + float lighting = 0.5 + 0.5 * diffuse; + material.diffuse = vec3(lighting); + material.alpha = 1.0; +}`});function fFe(){this.shape=Rc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}fFe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new dI({metadata:[new Float32Array(1)]});return Promise.resolve(n)};b0.DefaultProvider=new fFe;var $T=b0;function gzt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let a=(o.properties||{})[i];if(l(a))return a}var D9=gzt;function _zt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var R9=_zt;function yzt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let a=r.properties[n];if(l(a))return a}}var O9=yzt;var N9=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function pi(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof i2;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Ze(e.contextOptions);this._context=new HE(t,u)}let o=this._context,s=l(n);s||(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=Kn(),this._jobScheduler=new YG,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Zx(o,new FG(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new XN(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new WG,this._primitives=new Yl({countReferences:r}),this._groundPrimitives=new Yl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=pi.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new cI,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new VG(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new fi({color:new z,stencil:0,owner:this}),this._depthClearCommand=new fi({depth:1,owner:this}),this._stencilClearCommand=new fi({stencil:0}),this._classificationStencilClearCommand=new fi({stencil:0,renderState:Ge.fromCache({stencilMask:Xt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new k5(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new NG,this._minimumDisableDepthTestDistance=0,this._debugInspector=new t9,this._msaaSamples=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=z.clone(z.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ji(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 jv,this.fog=new GG,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Nr.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Nr(this),this.shadowMap=new ZA({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new JO,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new F5,this._brdfLutGenerator=new vG,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new K5(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??qu.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=El.requestCompletedEvent.addEventListener(N9(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(N9(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Nr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Nr(this),this.preloadFlightCullingVolume=void 0,this._picking=new p5(this),this._defaultView=new rI(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 O_,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,_Fe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}pi.defaultLogDepthBuffer=!0;function Azt(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(N9(e))),n.push(t.terrainProviderChanged.addEventListener(N9(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(pi.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 Ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ut.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 Sp.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,Azt(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}},controllerHost:{get:function(){return this._controllerHost}},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}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},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===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.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 Nr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new HG(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,Ut.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}}});pi.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 bzt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function dFe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=d0.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=d0.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=d0.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=d0.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=d0.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=ZA.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}pi.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&bzt(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=ZA.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=d0.createLogDepthCommand(e,o,t.logDepth),dFe(this,t.logDepth.command,s)),(d||m)&&dFe(this,e,s)};var xzt=new Tm({pass:go.RENDER}),Cse=new Tm({pass:go.PRELOAD}),vse=new Tm({pass:go.PRELOAD_FLIGHT}),Tzt=new Tm({pass:go.REQUEST_RENDER_MODE_DEFER_CHECK}),hFe=new le,Sse;function Ezt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return hFe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Sse=a3.fromBoundingSphere(hFe,e.camera.positionWC,Sse),Sse}pi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function _Fe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}pi.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=Ezt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof _n||this.camera.frustum instanceof Ss),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=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),JO.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};pi.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===$t.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var M9=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);M9=M.inverseTransformation(M9,M9);function Czt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(r.mode!==re.SCENE3D){a=M.multiplyByPoint(M9,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=ec.createGeometry(new ec({radii:new h(f,f,f),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new Nn({geometryInstances:new Bt({geometry:Wn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new An({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=d0.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function Zl(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof fi){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Czt(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.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(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function mFe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.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(o,n)),l(s)?(e=s.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function yFe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var vzt=new h;function pFe(e,t){let n=h.subtract(e,t,vzt),i=Math.max(0,h.magnitude(n));return i*i}function Szt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return pFe(r.center,n)-pFe(i.center,n)}function wzt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function Izt(e,t,n,i,r){ag(i,yFe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function Pzt(e,t,n,i,r){ag(i,wzt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function Dzt(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],ag(i,yFe,e.camera.positionWC);for(let r=0;r<i.length;++r)Zl(i[r],e,t)}function Rzt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],ag(i,Szt,e.camera.positionWC);for(let r=0;r<i.length;++r)Zl(i[r],e,t)}var Ozt=new Zi,Mzt=new Au,Nzt=new _n,Lzt=new Ss;function Fzt(e){let{frustum:t}=e;return l(t.fov)?t.clone(Ozt):l(t.infiniteProjectionMatrix)?t.clone(Mzt):l(t.width)?t.clone(Nzt):t.clone(Lzt)}function Bzt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?Izt:Pzt}function kzt(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:s}=i.passes,a=o||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=Bzt(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,Zl,t,f,c)}function Uzt(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,Zl,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,Zl,t,n)}function zzt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Ie.CESIUM_3D_TILE_EDGES],o=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let s=0;s<o;++s)Zl(r[s],e,t);t.framebuffer=i}function Vzt(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Ie.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,s=o&&o.planarFillIdFramebuffer,a=n.commands[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let u=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new z(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)Zl(a[d],e,t);t.framebuffer=u}}function jzt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)Zl(i[o],e,t)}function Ise(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=Fzt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||Hzt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,E=e._globeTranslucencyState,v=e._depthClearCommand,S=e._stencilClearCommand,I=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function L(C,w){o.updatePass(w);let D=C.commands[w],N=C.indices[w];for(let F=0;F<N;++F)Zl(D[F],e,t);return N}function _(C,w){o.updatePass(w);let D=C.commands[w],N=C.indices[w];for(let F=0;F<N;++F)mFe(D[F],e,t)}for(let C=0;C<T;++C){let w=T-C-1,D=x[w];e.mode===re.SCENE2D?(n.position.z=O-D.near+1,s.far=Math.max(1,D.far-D.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&S.execute(i,t),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(D,Zl,A,e,t)):L(D,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(D,Zl,A,e,t)):L(D,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let N;if(zzt(e,t,D),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let B=e._view.edgeFramebuffer.idTexture;l(B)?e.context.uniformState.edgeIdTexture=B:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(Vzt(e,t,D),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)N=L(D,Ie.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L(D,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&I.execute(i,t),N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&S.execute(i,t),Dzt(e,t,D),L(D,Ie.OPAQUE),jzt(e,t,D),Rzt(e,t,D),w!==0&&e.mode!==re.SCENE2D&&(s.near=D.near,o.updateFrustum(s)),kzt(e,t,D),Uzt(e,t,D),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,w);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,o.updateFrustum(s),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(D,mFe,A,e,t)):_(D,Ie.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(D,Ie.CESIUM_3D_TILE),_(D,Ie.OPAQUE),_(D,Ie.TRANSLUCENT),t.framebuffer=F}}function Hzt(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&Zl(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Zl(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=r.globeDepth.framebuffer:i.usePostProcess?s=r.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let s=o.length-1;s>=0;s--){let a=o[s];l(a.shaderProgram)?Zl(o[s],e,t):o.splice(s,1)}}function AFe(e){e.context.uniformState.updatePass(Ie.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 Gzt(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function Wzt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,s=o.length,a=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function bFe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:s}=o;for(let a=0;a<r.length;++a){let c=r[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;Wzt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[a];Zl(A,e,d.passState)}}}}var qzt=new h;pi.prototype.updateAndExecuteCommands=function(e,t){sVt(this,e,t),this._environmentState.useWebVR?Yzt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===qu.ROTATE?ib(!0,this,e):nVt(this,e)};function Yzt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;TFe(e),n.createPotentiallyVisibleSet(e),AFe(e),o||bFe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Nr.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,qzt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,Ise(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,Ise(e,t),Nr.clone(a,i)}var Xzt=new he(Math.PI,P.PI_OVER_TWO),Kzt=new h,$zt=new h,Jzt=new M,Zzt=new M,Qzt=new h,eVt=new h,tVt=new et;function nVt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,tVt);t.viewport=s;let a=Xzt,c=Kzt;e.mapProjection.project(a,c);let f=h.clone(i.position,$zt),d=M.clone(i.transform,Zzt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,Jzt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(P.sign(y)*c.x-y,0,-i.positionWC.x,Qzt),b=At.pointToGLWindowCoordinates(m,g,A,eVt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)ib(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),ib(!0,e,t),s.x=b.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),r.update(n),ib(!1,e,t);else if(b.x>x+T*.5){s.width=b.x-x;let E=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),ib(!0,e,t),s.x=b.x,s.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),ib(!1,e,t)}else{s.x=b.x,s.width=x+T-b.x;let E=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),ib(!0,e,t),s.x=x,s.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),ib(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function ib(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),TFe(t),i.createPotentiallyVisibleSet(t),e&&(AFe(t),r||bFe(t)),Ise(t,n)}var gFe=new aa;function xFe(e,t,n){if(!e.show)return;let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);if(o instanceof Yl){xFe(o,t,n);continue}o.show&&Iy.isSupported(o)&&ps(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function iVt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;xFe(e._primitives,n,i)}pi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof _n||!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(jy.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;s.setDynamicLighting(b),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 A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=gFe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=gFe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new Sp(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),iVt(this,e)};function rVt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new r_({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 oVt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,s=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<o;++a)if(r[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<o;++a){let c=r[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 TFe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,rVt(e),oVt(e),e._globe&&e._globe.render(t)}function sVt(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,a=r.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new e9: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 f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let E=e._invertClassification.unclassifiedCommand,v=E.derivedCommands;v.oit=p.createDerivedCommands(E,i,v.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}pi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,r.executeCopyColor(t,e))};function aVt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function cVt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function EFe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Yl){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=EFe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}pi.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,r=this._heightQueryCache.get(i);if(r!==void 0)return r===null?void 0:r;let o=lVt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function lVt(e,t,n){let i=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,r=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE;if(!l(t))return;let o=Number.NEGATIVE_INFINITY;if(!i){let a=EFe(e.primitives,t,e);l(a)&&a>o&&(o=a)}let s=e._globe;if(!r&&l(s)&&s.show){let a=s.getHeight(t);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o}var wse=new he;pi.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,wse);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(wse.height=m,t(wse))},o=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function uVt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}pi.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=cVt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=uVt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function fVt(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 r=new XA({container:n});e._performanceDisplay=r,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 dVt(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 hVt(e){e.primitives.postPassesUpdate(e._frameState),El.update()}var mVt=new z;function pVt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=xzt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,mVt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,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 O_?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,Gzt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function JT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function gVt(e){return e._picking.updateMostDetailedRayPicks(e)}pi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=P.incrementWrap(t.frameNumber,Zx.maximumFrameNumber,1);_Fe(this,r,e),t.newFrame=!0}JT(this,dVt),this.primitives.show&&(JT(this,gVt),JT(this,_Vt),JT(this,yVt),i||JT(this,AVt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),JT(this,pVt)),fVt(this,i),JT(this,hVt),aVt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};pi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};pi.prototype.requestRender=function(){this._renderRequested=!0};pi.prototype.clampLineWidth=function(e){return Math.max(Ut.minimumAliasedLineWidth,Math.min(e,Ut.maximumAliasedLineWidth))};pi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};pi.prototype.snap=function(e,t){return J5.snap(this,e,t)};pi.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};pi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof $T))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*o[0]+o[1],a=r._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*o[2]+o[3];return n9.fromKeyframeNode(r,s,c,a)};pi.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let s=o.schema,a=D9(s,t,n,i);if(!l(a))return;let c=O9(o,n,i);if(!l(c))return;let u=new R9(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};pi.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};pi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};pi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};pi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function _Vt(e){let t=e._frameState;Cse.camera=t.camera,Cse.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Cse)}function yVt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;vse.camera=e.preloadFlightCamera,vse.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,vse)}function AVt(e){e.primitives.updateForPass(e._frameState,Tzt)}pi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};pi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};pi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};pi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};pi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};pi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};pi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};pi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};pi.prototype.cartesianToCanvasCoordinates=function(e,t){return gr.worldToWindowCoordinates(this,e,t)};pi.prototype.completeMorph=function(){this._transitioner.completeMorph()};pi.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};pi.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};pi.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function bVt(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()})}pi.prototype.setTerrain=function(e){return bVt(this,e),e};pi.prototype.isDestroyed=function(){return!1};pi.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),ue(this)};var L9=pi;var xM=`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; +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); +float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; +float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; +vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; +vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); +czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); +underTranslucentGlobe = 0.0; +#if defined(GLOBE_TRANSLUCENT) +czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); +if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { +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); +float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); +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); +underTranslucentGlobe = 1.0; return; } -RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false); -if (innerIntersect.entry.w == NO_HIT) { -setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); -} else { -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); -setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); -setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); -setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); +#endif +computeScattering( +primaryRay, +length(cameraToPositionWC), +lightDirection, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; +float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; +opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); +float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; +opacity *= pow(nightAlpha, 0.5); } -#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]); +`;var F9=`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 -#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); +vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); +#ifndef HDR +color.rgb = czm_pbrNeutralTonemapping(color.rgb); +color.rgb = czm_inverseGamma(color.rgb); #endif -#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]); +#ifdef COLOR_CORRECT +const bool ignoreBlackPixels = true; +color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels); #endif +if (translucent == 0.0) { +color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } -`;var oS=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { -intersectShape(ray, ix); -RayShapeIntersection intersection = getFirstIntersection(ix); -if (intersection.entry.w == NO_HIT) { -return intersection; +out_FragColor = color; } -#if defined(CLIPPING_PLANES) -intersectClippingPlanes(ray, ix); +`;var B9=`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 -#if defined(DEPTH_TEST) -intersectDepth(screenCoord, ray, ix); +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 -#if (INTERSECTION_COUNT > 1) -initializeIntersections(ix); -for (int i = 0; i < INTERSECTION_COUNT; ++i) { -intersection = nextIntersection(ix); -if (intersection.exit.w > 0.0) { -intersection.entry.w = max(intersection.entry.w, 0.0); -break; -} +v_outerPositionWC = positionWC.xyz; +vec4 positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; } -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; +`;function gI(e){e=e??ee.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new at({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(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 h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(gI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});gI.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Pse=new M;gI.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,Pse),r=M.multiplyTransformation(i,Hi.Y_UP_TO_Z_UP,Pse),o=M.multiply(this._scaleMatrix,r,Pse);M.clone(o,this._modelMatrix);let s=e.context,a=xVt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=ec.createGeometry(new ec({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:s,geometry:p,attributeLocations:Wn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},blending:rn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Xe({defines:p,sources:[Ip,xM,B9]}),m=new Xe({defines:p,sources:[Ip,xM,F9]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function xVt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}gI.prototype.isDestroyed=function(){return!1};gI.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var k9=gI;var U9=`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 _8=`#if defined(BOX_HAS_SHAPE_BOUNDS) -uniform vec3 u_boxUvToShapeUvScale; -uniform vec3 u_boxUvToShapeUvTranslate; -#endif -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -return PointJacobianT(positionUv, mat3(0.5)); +`;var z9=`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; } -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; -#else -return positionShape; -#endif +`;var V9=`uniform mat3 u_cubeMapPanoramaTransform; +in vec3 position; +out vec3 v_texCoord; +void main() +{ +vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +`;function TM(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new at({modelMatrix:M.clone(M.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t}Object.defineProperties(TM.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});TM.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:s}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?QB(o,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ls({context:o,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Wn.createAttributeLocations(c);a.vertexArray=Vn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Me.STATIC_DRAW}),a.renderState=Ge.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:rn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Xe({defines:[t?"HDR":""],sources:[U9]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?V9:z9,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};TM.prototype.isDestroyed=function(){return!1};TM.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(),ue(this)};var _I=TM;function ZT(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new _I({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(ZT.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});ZT.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};ZT.prototype.isDestroyed=function(){return!1};ZT.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function yI(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}ZT.createEarthSkyBox=function(){return new ZT({sources:{positiveX:yI("px"),negativeX:yI("mx"),positiveY:yI("py"),negativeY:yI("my"),positiveZ:yI("pz"),negativeZ:yI("mz")}})};var j9=ZT;var H9=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() +{ +vec4 color = texture(u_texture, v_textureCoordinates); +out_FragColor = czm_gammaCorrect(color); } -vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif +`;var G9=`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); } -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -#if defined(BOX_HAS_SHAPE_BOUNDS) -return shapeUv / u_boxUvToShapeUvScale; -#else -return shapeUv; -#endif +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); } -`;var g8=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) -uniform vec2 u_cylinderUvToShapeUvRadius; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) -uniform vec2 u_cylinderUvToShapeUvHeight; -#endif -#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) -uniform vec2 u_cylinderUvToShapeUvAngle; -#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) { -vec3 position = positionUv * 2.0 - 1.0; -float radius = length(position.xy); -vec3 radial = normalize(vec3(position.xy, 0.0)); -float height = positionUv.z; -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); +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); +burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); +burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); +burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); +burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); +burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); +burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); +color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; +out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); } -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) -angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); -#endif -#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); +`;var W9=`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); } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +else +{ +position = vec4(czm_sunPositionColumbusView.zxy, 1.0); } -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); +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; } -`;var y8=`uniform vec3 u_ellipsoidRadiiUv; -uniform vec2 u_evoluteScale; -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; -#endif -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -uniform vec2 u_ellipsoidUvToShapeUvLatitude; +`;function CM(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.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(CM.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var TVt=new U,EVt=new U,CVt=new se,EM=new se;CM.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(o,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?r.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new Dt({context:r,width:E,height:E,pixelFormat:$e.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let S=this,I={u_radiusTS:function(){return S._radiusTS}};this._commands.computeCommand=new $f({fragmentShaderSource:G9,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){S._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(8);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let S=tt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});a.vertexArray=new Vn({context:r,attributes:I,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:W9,fragmentShaderSource:H9,attributeLocations:E}),a.renderState=Ge.fromCache({blending:rn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?le.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&le.clone(d,a.boundingVolume);let p=gr.computeActualEllipsoidPosition(e,c,EM),g=h.magnitude(h.subtract(p,e.camera.position,EM)),m=r.uniformState.projection,y=CVt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=M.multiplyByVector(m,y,EM),b=gr.clipToGLWindowCoordinates(t.viewport,A,TVt);y.x=P.SOLAR_RADIUS;let x=M.multiplyByVector(m,y,EM),T=gr.clipToGLWindowCoordinates(t.viewport,x,EVt);return this._size=U.magnitude(U.subtract(T,b,EM)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};CM.prototype.isDestroyed=function(){return!1};CM.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(),ue(this)};var q9=CM;var SFe=js(tN(),1);function vVt(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 Y9=vVt;var SVt={modifyFragmentShader:function(t){return t=Xe.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 -uniform float u_ellipsoidInverseHeightDifferenceUv; -vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) { -vec2 p = abs(pos); -vec2 inverseRadii = 1.0 / radii; -vec2 tTrigs = vec2(0.7071067811865476); -vec2 v = radii * tTrigs; -vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; -const int iterations = 3; -for (int i = 0; i < iterations; ++i) { -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs; + czm_splitter_main(); +} +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},vM=SVt;var QT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function SM(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.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=QT.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=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=Dn.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=e.splitDirection??$o.NONE,this._splittingEnabled=!1,this._error=void 0,wVt(this,e)}Object.defineProperties(SM.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.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 wVt(e,t){let n=pS.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=wp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=QT.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 r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.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 IVt=new h,PVt=new h,DVt=new h,CFe,X9;function RVt(e){if(!l(X9)){CFe=new SFe.default(0),X9=new Array(e);for(let t=0;t<e;++t)X9[t]=CFe.random()}return X9}function OVt(e){let n=e.length/3,i=Math.min(n,20),r=RVt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,IVt),c=h.fromElements(s,s,s,PVt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,DVt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=le.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function vFe(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(yt("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 MVt=new se,NVt=new se,LVt=new z,wFe=0,K9=1,Nse=2,IFe=3,FVt=4,Dse=new M,BVt=new M;function kVt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,S,I,R=[],O={};if(e._styleableShaderAttributes=O,f){let B=FVt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=vFe(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=tt.createVertexBuffer({context:n,typedArray:G,usage:Me.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let Q={index:B,vertexBuffer:q,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:B,componentCount:S},++B}}let L=tt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=vFe(c.typedArray,"batchIds"),w=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D=[];if(d?I=Y.UNSIGNED_SHORT:p?I=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:I=Y.FLOAT,D.push({index:wFe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=le.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=OVt(o.typedArray)),T)if(b)D.push({index:K9,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;D.push({index:K9,vertexBuffer:_,componentsPerAttribute:B,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(S=2,I=Y.UNSIGNED_BYTE):m?(S=2,I=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(S=3,I=Y.FLOAT),D.push({index:Nse,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:IFe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(D=D.concat(R));let N=new Vn({context:n,attributes:D}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:rn.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(F.stencilTest=Xt.setCesium3DTileBit(),F.stencilMask=Xt.CESIUM_3D_TILE_MASK,V.stencilTest=Xt.setCesium3DTileBit(),V.stencilMask=Xt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ge.fromCache(F),e._translucentRenderState=Ge.fromCache(V),e._drawCommand=new at({boundingVolume:new le,cull:e._cull,modelMatrix:new M,primitiveType:Oe.POINTS,vertexArray:N,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function UVt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=MVt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof _n?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}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 z.TRANSPARENT;let c=z.clone(a.edgeColor,LVt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,c,Dse);let u=M.multiply(Dse,a.modelMatrix,Dse);return M.inverseTranspose(u,BVt)}};vM.addUniforms(e,s),(i||r||o)&&(s=Mt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=NVt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Rse(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Ose(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Mse(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var zVt={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 VVt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,S,I,R,O=g,L=Ze(zVt),_={},C=e._styleableShaderAttributes;for(r in C)C.hasOwnProperty(r)&&(o=C[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let fe={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)";S=n.getColorShaderFunction(`getColorFromStyle${xe}`,L,fe),I=n.getShowShaderFunction(`getShowFromStyle${xe}`,L,fe),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,L,fe),l(S)&&fe.translucent&&(O=!0)}e._styleTranslucent=O;let w=l(S),D=l(I),N=l(R),F=e.isClipped,V=[],B=[];w&&(Rse(S,V),Ose(S,B)),D&&(Rse(I,V),Ose(I,B)),N&&(Rse(R,V),Ose(R,B));let j=B.indexOf("COLOR")>=0,k=B.indexOf("NORMAL")>=0;if(k&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in C)if(C.hasOwnProperty(r)){o=C[r];let fe=V.indexOf(o.location)>=0,xe=Mse(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=Mse(T,K9);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=Mse(T,Nse);fe.enabled=q}let Q={a_position:wFe};G&&(Q.a_color=K9),q&&(Q.a_normal=Nse),A&&(Q.a_batchId=IFe);let W="",J=V.length;for(i=0;i<J;++i){let fe=V[i];o=_[fe];let xe=o.componentCount,ge=`czm_3dtiles_property_${fe}`,we;xe===1?we="float":we=`vec${xe}`,W+=`in ${we} ${ge}; +`,Q[ge]=o.location}UVt(e,t);let Z=`in vec3 a_position; +out vec4 v_color; +uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; +uniform vec4 u_constantColor; +uniform vec4 u_highlightColor; +`;Z+=`float u_pointSize; +float tiles3d_tileset_time; +`,v&&(Z+=`float u_geometricError; +float u_depthMultiplier; +`),Z+=W,G&&(g?Z+=`in vec4 a_color; +`:p?Z+=`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; +`:Z+=`in vec3 a_color; +`),q&&(f||d?Z+=`in vec2 a_normal; +`:Z+=`in vec3 a_normal; +`),A&&(Z+=`in float a_batchId; +`),(c||u||d)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; +`),w&&(Z+=S),D&&(Z+=I),N&&(Z+=R),Z+=`void main() +{ + u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; + tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; +`,v&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; + u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; +`),G?g?Z+=` vec4 color = a_color; +`:p?Z+=` 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); +`:Z+=` vec4 color = vec4(a_color, 1.0); +`:Z+=` vec4 color = u_constantColor; +`,c||u?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; +`:Z+=` vec3 position = a_position; +`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); +`,q?(f?Z+=` vec3 normal = czm_octDecode(a_normal); +`:d?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; +`:Z+=` vec3 normal = a_normal; +`,Z+=` vec3 normalEC = czm_normal * normal; +`):Z+=` vec3 normal = vec3(1.0); +`,w&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal); +`),D&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); +`),N?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; +`:v?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); + float depth = -positionEC.z; + gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); +`:Z+=` gl_PointSize = u_pointSize; +`,Z+=` color = color * u_highlightColor; +`,q&&x&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); + diffuseStrength = max(diffuseStrength, 0.4); + color.xyz *= diffuseStrength * czm_lightColor; +`),Z+=` v_color = color; + gl_Position = czm_modelViewProjection * vec4(position, 1.0); +`,q&&b&&(Z+=` float visible = step(-normalEC.z, 0.0); + gl_Position *= visible; + gl_PointSize *= visible; +`),D&&(Z+=` gl_Position.w *= float(show); + gl_PointSize *= float(show); +`),Z+=`} +`;let ae=`in vec4 v_color; +`;F&&(ae+=`uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; +`,ae+=` +`,ae+=Kw(E,s),ae+=` +`),ae+=`void main() +{ + out_FragColor = czm_gammaCorrect(v_color); +`,F&&(ae+=Y9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} +`,e.splitDirection!==$o.NONE&&(ae=vM.modifyFragmentShader(ae)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ae=e._fragmentShaderLoaded(ae));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:ae,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function jVt(e,t){if(e._decodingState===QT.READY)return!1;if(e._decodingState===QT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=G_.decodePointCloud(i,t);l(r)&&(e._decodingState=QT.DECODING,r.then(function(o){e._decodingState=QT.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=QT.FAILED,e._error=o}))}return!0}var HVt=new se,GVt=new h;SM.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(jVt(this,t))return;let i=!1,r=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(kVt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){M.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,u),l(this._rtcCenter)&&M.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=M.getColumn(u,3,HVt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let d=f.center;M.multiplyByPoint(u,d,d);let p=M.getScale(u,GVt);f.radius*=h.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 o=this.splitDirection!==$o.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&VVt(this,e,this._style),this._drawCommand.castShadows=Dn.castShadows(this.shadows),this._drawCommand.receiveShadows=Dn.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?Ie.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};SM.prototype.isDestroyed=function(){return!1};SM.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var $9=SM;function tE(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Dn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new _g(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 qy,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(tE.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ns.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function WVt(e){return`uniform vec4 czm_pickColor; +${e}`}function qVt(e){return function(t){return Mt(t,{czm_pickColor:function(){return e._pickId.color}})}}function YVt(){return"czm_pickColor"}tE.prototype.makeStyleDirty=function(){this._styleDirty=!0};tE.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var XVt=new K;function Fse(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function eE(e,t){return e._intervals.indexOf(t.start)}function KVt(e,t){let n=e._intervals,i=e._clock,r=Fse(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,XVt),a=n.indexOf(s),c=eE(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function $Vt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function JVt(e,t,n){let i=Fse(e),r=eE(e,t),o=eE(e,n);return i>=0?r>=o:r<=o}function DFe(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 ZVt(e,t,n){let i=eE(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:xn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new $9({arrayBuffer:u,cull:!0,fragmentShaderLoaded:WVt,uniformMapLoaded:qVt(e),pickIdLoaded:YVt})}).catch(DFe(e,c))}return o}function QVt(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 e4t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(RFe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;QVt(e,a)}}t.touchedFrameNumber=i.frameNumber}var t4t=new M;function n4t(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function i4t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var r4t=new _g;function RFe(e,t,n,i){let r=e.shading??r4t,o=t.pointCloud,s=t.transform??M.IDENTITY;o.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,t4t),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=n4t(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=i4t(e);try{o.update(i)}catch(a){DFe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Lse(e,t,n,i){let r=ZVt(e,t,i);e4t(e,r,n,i)}function o4t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function OFe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function s4t(e,t){let n=eE(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function PFe(e,t,n,i,r){return l(n)?n.ready?!0:(Lse(e,t,i,r),n.ready):!1}function a4t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=eE(e,n),d=eE(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],PFe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],PFe(e,s,a,i,r))return s;return t}function c4t(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var AI={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};tE.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&c4t(this,r,s),AI.timeSinceLoad=t,AI.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=$Vt(this);if(!l(g))return;let m=!1,y=Fse(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||JVt(this,g,p))&&(p=KVt(this,g)),d=a4t(this,d,g,AI,e);let b=s4t(this,d);l(b)||(Lse(this,d,AI,e),b=this._lastRenderedFrame),l(b)&&RFe(this,b,AI,e),l(p)&&Lse(this,p,AI,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&OFe(this,o4t(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};tE.prototype.isDestroyed=function(){return!1};tE.prototype.destroy=function(){return OFe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var wM=tE;function LFe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function l4t(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function FFe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function BFe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=FFe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function kFe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function Vr(e,t){e=kn(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=dn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=dn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?kn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?kn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,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 up,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),BFe(this);try{let p=t.ellipsoid??ee.default,g=new L9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly: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=h.UNIT_Z,FFe(this),kFe(this);let m=t.globe;l(m)||(m=new yG(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Dn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=j9.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new q9,ee.WGS84.equals(p)&&(g.moon=new EG));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new k9(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Fs.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new da(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new _j,E=!0);let v=new Hj({scene:g,dataSourceCollection:T}),S=new Xo;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=S,this._canAnimateUpdateCallback=this._updateCanAnimate,S.add(this._clock.onTick,Vr.prototype._onTick,this),S.add(g.morphStart,Vr.prototype._clearTrackedObject,this),S.add(T.dataSourceAdded,Vr.prototype._onDataSourceAdded,this),S.add(T.dataSourceRemoved,Vr.prototype._onDataSourceRemoved,this),S.add(g.postRender,Vr.prototype._postRender,this);let I=T.length;for(let R=0;R<I;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),S.add(T.dataSourceAdded,Vr.prototype._dataSourceAdded,this),S.add(T.dataSourceRemoved,Vr.prototype._dataSourceRemoved,this)}catch(p){throw f&&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(Vr.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&&l4t(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,Bse(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.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,LFe(this.clock,e))}}});Vr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.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 u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=z0(n);u||(typeof n=="string"&&(n=new Error(n)),t=z0({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +${t} +${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);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(r)},d.appendChild(p),i.appendChild(r)};Vr.prototype.isDestroyed=function(){return!1};Vr.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()),ue(this)};Vr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,BFe(this),kFe(this),this._scene.requestRender())};Vr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Vr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Vr.prototype._onEntityCollectionChanged,this)};Vr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Vr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Vr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var u4t=new le;Vr.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)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??u4t)===Pt.DONE&&i.update(t)}};Vr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};Vr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Vr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&LFe(this.clock,e)};Vr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Vr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Vr.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 r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Vr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Vr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Vr.prototype.zoomTo=function(e,t){return UFe(this,e,{offset:t},!1)};Vr.prototype.flyTo=function(e,t){return UFe(this,e,t,!0)};function UFe(e,t,n,i){Bse(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Fs){let s;l(o.imageryProvider)?s=Promise.resolve(o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return Xw(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof es||o instanceof wM||o instanceof $T||o instanceof ha){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function IM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Bse(e){let t=e._zoomPromise;l(t)&&(IM(e),e._completeZoom(!1))}Vr.prototype._postRender=function(){f4t(this),d4t(this)};var MFe=new le;function f4t(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function s(f){l(r.offset)||(r.offset=new Oh(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),IM(e)}if(t instanceof wM){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof es||t instanceof $T){s(t.boundingSphere);return}if(t instanceof ha){s(t.boundingVolume);return}if(t instanceof he){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),IM(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,MFe);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(le.clone(MFe))}if(c.length===0){Bse(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(c);e._zoomIsFlight?(IM(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(M.IDENTITY),IM(e),e._completeZoom(!0))}var NFe=new le;function d4t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,NFe);if(o===Pt.PENDING)return;let s=r.mode;(s===re.COLUMBUS_VIEW||s===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===re.COLUMBUS_VIEW||s===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==Pt.FAILED?NFe:void 0;e._entityView=new qj(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var J9=Vr;var Z9=`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 vec3(v * sign(pos), length(v - evolute)); +return mod(value, rangeLength); } -PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) { -vec3 position = positionUv * 2.0 - 1.0; -position = position * u_ellipsoidRadiiUv; -float longitude = atan(position.y, position.x); -vec3 east = normalize(vec3(-position.y, position.x, 0.0)); -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 wrapVec(vec3 value, float rangeLength) { +return vec3(wrap(value.x, rangeLength), +wrap(value.y, rangeLength), +wrap(value.z, rangeLength)); } -vec3 convertShapeToShapeUvSpace(in vec3 positionShape) { -float longitude = (positionShape.x + czm_pi) / czm_twoPi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) -longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); -#endif -#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 -float latitude = (positionShape.y + czm_piOverTwo) / czm_pi; -#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) -latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; -#endif -float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv; -return vec3(longitude, latitude, height); +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; } -PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) { -PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv); -pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point); -return pointJacobian; +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); } -vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { -float longitude = shapeUv.x * czm_twoPi; -#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) -longitude /= u_ellipsoidUvToShapeUvLongitude.x; -#endif -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); +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); } -`;var b8=`#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; -uniform ivec3 u_inputDimensions; -#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 -}; -int intMod(in int a, in int b) { -return a - (b * (a / b)); +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; } -int normU8_toInt(in float value) { -return int(value * 255.0); +float root = sqrt(discriminant); +float t = (-B - root) / A; +if(t < 0.0) { +t = (-B + root) / A; } -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); +point = origin + t * dir; +if(slice >= 0.0) { +point.z = (slice / 2.0) - 0.5; +if(length(point) > 0.5) { +return false; } -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; +normal = normalize(point); +point -= czm_epsilon2 * normal; +return true; } -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); +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; } -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; +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; } -vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -float dimAtLevel = exp2(float(octreeCoords.w)); -return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); +return intersected; } -vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { -vec3 tileUv = getTileUv(shapePosition, octreeCoords); -return clamp(tileUv, vec3(0.0), vec3(1.0)); +vec2 phaseShift2D(vec2 p, vec2 freq) { +return (czm_pi / 2.0) * sin(freq.yx * p.yx); } -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(Y_UP_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)) -if (sampleData.tileCoords.w == 0) { -float angleCount = float(u_inputDimensions.z); -angle = mod(angle + angleCount / 2.0, angleCount); +vec2 phaseShift3D(vec3 p, vec2 freq) { +return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); } -#endif -inputCoordinate.y = height; -inputCoordinate.z = angle; -#endif -#endif -sampleData.tileUv = tileUv; -sampleData.inputCoordinate = inputCoordinate; +const float T0 = 0.6; +const float k = 0.1; +const float C0 = 0.8; +const float FX0 = 0.6; +const float FY0 = 0.6; +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); } -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; +return k * sum.x * sum.y; } -#if (SAMPLE_COUNT > 1) -void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { -int leafIndex = data.data; -int leafNodeTexelCount = 2; -float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; -float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; -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; -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; -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); +const float a = 0.5; +const float t = 0.4; +const float s = 0.25; +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); +float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); +float It = T(cloudPoint); +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; +float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); +float TR = pow(ndDot, 3.0) - W; +TR *= 1.3; +float minusDot = 0.5 - ndDot; +TR -= min(minusDot * W2, 0.0); +TR -= 0.8 * (minusDot + 0.25) * W3; +float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); +shading = clamp(shading + 0.2, 0.3, 1.0); +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 -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) { -vec3 center = 0.5 * (start + end); -vec3 childCoord = step(center, shapePosition); -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) { -break; -} -start = mix(start, center, childCoord); -end = mix(center, end, childCoord); -traversalData.parentOctreeIndex = childData.data; +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; } -return childData; +#else +#ifndef DEBUG_BILLBOARDS +vec4 cloud = drawCloud(rayOrigin, rayDir, +ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); +if(cloud.w < 0.01) { +discard; } -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); +out_FragColor = cloud; +#endif +#endif } -#if (SAMPLE_COUNT == 1) -getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[0]); +`;var Q9=`#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() { +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 -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(shapePosition, sampleDatas[0]); -addSampleCoordinates(shapePosition, sampleDatas[1]); +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; } -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)); -return inside || octreeCoords.w == 0; +`;var e7=`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); } -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 mod(value, rangeLength); } -return; +vec3 wrapVec(vec3 value, float rangeLength) { +return vec3(wrap(value.x, rangeLength), +wrap(value.y, rangeLength), +wrap(value.z, rangeLength)); } -for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { -traversalData.octreeCoords.xyz /= 2; -traversalData.octreeCoords.w -= 1; -if (insideTile(shapePosition, traversalData.octreeCoords)) { -break; +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)); } -traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); +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; } -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 +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; } -`;var x8=`uniform ivec2 u_megatextureSliceDimensions; -uniform ivec2 u_megatextureTileDimensions; -uniform vec2 u_megatextureVoxelSizeUv; -uniform vec2 u_megatextureSliceSizeUv; -uniform vec2 u_megatextureTileSizeUv; -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; +return shortestDistance; } -Properties getPropertiesFromMegatexture(in SampleData sampleData) { -int tileIndex = sampleData.megatextureIndex; -vec3 voxelCoord = sampleData.inputCoordinate; -#if defined(NEAREST_SAMPLING) -voxelCoord = floor(voxelCoord) + vec3(0.5); -#endif -vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); -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); -vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; -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 +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; } -Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { -#if (SAMPLE_COUNT == 1) -return getPropertiesFromMegatexture(sampleDatas[0]); -#else -Properties properties = clearProperties(); -for (int i = 0; i < SAMPLE_COUNT; ++i) { -float weight = sampleDatas[i].weight; -if (weight > 0.0) { -Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); -tempProperties = scaleProperties(tempProperties, weight); -properties = sumProperties(properties, tempProperties); +noise += worleyNoise(p * scale, freq * scale) * persistence; +persistence *= 0.5; +freq *= 2.0; } +return noise; } -return properties; -#endif +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 $gt={Z_UP:0,Y_UP:1},hh=Object.freeze($gt);function Zgt(e){let t=new MT;this.shaderBuilder=t;let n=e._customShader,i=xt(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,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=c(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([l8]),e.provider.metadataOrder===hh.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,ge.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,ge.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,ge.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",b8,a8,u8,x8]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([d8])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([f8])),a==="BOX"?t.addFragmentLines([_8,h8,oS]):a==="CYLINDER"?t.addFragmentLines([g8,CI,m8,oS]):a==="ELLIPSOID"&&t.addFragmentLines([y8,CI,p8,oS]),t.addFragmentLines([c8]);let l=e._shape,u=l.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];c(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let f=l.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,ge.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,ge.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,ge.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var T8=Zgt;function Qgt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,l=o.length,u=c(s)&&c(a);n.addDefine("METADATA_COUNT",l,ge.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=o[R],_=`PropertyStatistics_${L}`,w=`PropertyStatistics_${L}`;n.addStruct(_,w,ge.FRAGMENT);let D=A8(B);n.addStructField(_,D,"min"),n.addStructField(_,D,"max")}let f="Statistics",h="Statistics",p="statistics";n.addStruct(f,h,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=`PropertyStatistics_${L}`,_=L;n.addStructField(f,B,_)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,ge.FRAGMENT),n.addStructField(g,h,p);for(let R=0;R<l;R++){let L=i[R],B=o[R],_=A8(B);n.addStructField(g,_,L)}for(let R=0;R<l;R++){let L=i[R],B=o[R],_=eyt(B),w=`VoxelProperty_${L}`,D=`VoxelProperty_${L}`;n.addStruct(w,D,ge.FRAGMENT),n.addStructField(w,_,"partialDerivativeLocal"),n.addStructField(w,_,"partialDerivativeWorld"),n.addStructField(w,_,"partialDerivativeView"),n.addStructField(w,_,"partialDerivativeValid")}let b="Voxel",x="Voxel",A="voxel";n.addStruct(b,x,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=`VoxelProperty_${L}`;n.addStructField(b,B,L)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let E="FragmentInput";n.addStruct(E,"FragmentInput",ge.FRAGMENT),n.addStructField(E,m,y),n.addStructField(E,x,A);let v="Properties",P="Properties",M="properties";n.addStruct(v,P,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=o[R],_=A8(B);n.addStructField(v,_,L)}{let R="clearProperties";n.addFunction(R,`${P} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L],_=o[L],w=r[L],D=A8(_,w);n.addFunctionLines(R,[`${M}.${B} = ${D}(0.0);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="sumProperties";n.addFunction(R,`${P} sumProperties(${P} propertiesA, ${P} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`${M}.${B} = propertiesA.${B} + propertiesB.${B};`])}n.addFunctionLines(R,[`return ${M};`])}{let R="scaleProperties";n.addFunction(R,`${P} scaleProperties(${P} ${M}, float scale)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} scaledProperties = ${M};`]);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`scaledProperties.${B} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${P} mixProperties(${P} propertiesA, ${P} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`${M}.${B} = mix(propertiesA.${B}, propertiesB.${B}, mixFactor);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${P} ${M}, inout ${m} ${y})`,ge.FRAGMENT);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`${y}.${B} = ${M}.${B};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let L=0;L<l;L++){let B=i[L],_=o[L],w=at.getComponentCount(_);for(let D=0;D<w;D++){let I=tyt(_,D),N=s[L][D],k=a[L][D];!c(N)||!c(k)||n.addFunctionLines(R,[`${p}.${B}.min${I} = ${axe(N)};`,`${p}.${B}.max${I} = ${axe(k)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${P} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L],_=o[L],w=r[L],D=Jgt(_,w);n.addFunctionLines(R,[`properties.${B} = texture(u_megatextureTextures[${L}], texcoord)${D};`])}n.addFunctionLines(R,[`return ${M};`])}}function A8(e){if(e===at.SCALAR)return"float";if(e===at.VEC2)return"vec2";if(e===at.VEC3)return"vec3";if(e===at.VEC4)return"vec4"}function Jgt(e){if(e===at.SCALAR)return".r";if(e===at.VEC2)return".ra";if(e===at.VEC3)return".rgb";if(e===at.VEC4)return""}function eyt(e){if(e===at.SCALAR)return"vec3";if(e===at.VEC2)return"mat2";if(e===at.VEC3)return"mat3";if(e===at.VEC4)return"mat4"}function axe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function tyt(e,t){return e===at.SCALAR?"":`[${t}]`}var C8=Qgt;function nyt(e,t){let n=new T8(e);C8(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let x="getClippingPlane",A=jy(o,t),E=0,S=A.indexOf(")")+1,v=A.indexOf("{",S)+1,P=A.indexOf("}",v),M=A.slice(E,S),R=A.slice(v,P);i.addFunction(x,M,ge.FRAGMENT),i.addFunctionLines(x,[R])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let l=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),h=ze.fromCache({cull:{enabled:!0,face:Ti.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,m=new Je({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:h,shaderProgram:l,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:De.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),y=Je.shallowClone(m,new Je);y.shaderProgram=u,y.pickOnly=!0;let b=Je.shallowClone(m,new Je);if(b.shaderProgram=f,b.pickOnly=!0,c(e._drawCommand)){let x=e._drawCommand;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPick)){let x=e._drawCommandPick;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPickVoxel)){let x=e._drawCommandPickVoxel;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=y,e._drawCommandPickVoxel=b}var E8=nyt;var iyt={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"},rS=Object.freeze(iyt);function oyt(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 S8=oyt;function sS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}sS.prototype.getTexture=function(e){return this._textures[e]};function ryt(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];c(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}sS.prototype.loadTexture2D=function(e,t){c(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):ryt(this,e,t)};function syt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?w8(o,r,n):ayt(o,r,n),a=e._textures[i];c(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function w8(e,t,n){let{typedArray:i,sampler:o}=e,r=c(i)?lxe(e,n):new Rt({context:n,source:t,sampler:o});return cxe(o)&&r.generateMipmap(),r}function ayt(e,t,n){let{typedArray:i,sampler:o}=e,r=cxe(o),s=o.wrapS===gn.REPEAT||o.wrapS===gn.MIRRORED_REPEAT||o.wrapT===gn.REPEAT||o.wrapT===gn.MIRRORED_REPEAT,{width:a,height:l}=c(i)?e:t,u=[a,l].every(O.isPowerOfTwo);if((r||s)&&!u)if(c(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let h=S8(i,a,l),p=db(h);return w8({sampler:o},p,n)}}else{let h=db(t);return w8(e,h,n)}else return w8(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."),lxe(e,n)}function cxe(e){return[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function lxe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Rt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}sS.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];syt(this,o,t)}n.length=0};sS.prototype.isDestroyed=function(){return!1};sS.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 de(this)};var v8=sS;function EI(e){e=e??W.EMPTY_OBJECT,this.mode=e.mode??zg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??W.EMPTY_OBJECT,this.varyings=e.varyings??W.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Eb.INHERIT,this._textureManager=new v8,this._defaultTexture=void 0,this.uniformMap=cyt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},fyt(this),dyt(this)}function cyt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i],r=o.type;if(r===rS.SAMPLER_CUBE)throw new C("CustomShader does not support samplerCube uniforms");r===rS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=lyt(e,i)):n[i]=uyt(e,i)}return n}function lyt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function uyt(e,t){return function(){return e.uniforms[t].value}}function Nx(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function fyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;c(r)&&(o=e.usedVariablesVertex.attributeSet,Nx(r,t,o),o=e.usedVariablesVertex.featureIdSet,Nx(r,n,o),o=e.usedVariablesVertex.metadataSet,Nx(r,i,o));let s=e.fragmentShaderText;if(c(s)){o=e.usedVariablesFragment.attributeSet,Nx(s,t,o),o=e.usedVariablesFragment.featureIdSet,Nx(s,n,o),o=e.usedVariablesFragment.metadataSet,Nx(s,i,o);let a=/material\.(\w+)/g,l=e.usedVariablesFragment.materialSet;Nx(s,a,l)}}function uxe(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 yc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${uxe(t)} is not available in the ${i} shader. Did you mean ${uxe(n)} instead?`;throw new C(o)}}function dyt(e){let t=e.usedVariablesVertex.attributeSet;yc(t,"position","positionMC","vertex"),yc(t,"normal","normalMC","vertex"),yc(t,"tangent","tangentMC","vertex"),yc(t,"bitangent","bitangentMC","vertex"),yc(t,"positionWC","positionMC","vertex"),yc(t,"positionEC","positionMC","vertex"),yc(t,"normalEC","normalMC","vertex"),yc(t,"tangentEC","tangentMC","vertex"),yc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;yc(n,"position","positionEC","fragment"),yc(n,"normal","normalEC","fragment"),yc(n,"tangent","tangentEC","fragment"),yc(n,"bitangent","bitangentEC","fragment"),yc(n,"normalMC","normalEC","fragment"),yc(n,"tangentMC","tangentEC","fragment"),yc(n,"bitangentMC","bitangentEC","fragment")}EI.prototype.setUniform=function(e,t){if(T.typeOf.string("uniformName",e),T.defined("value",t),!c(this.uniforms[e]))throw new C(`Uniform ${e} must be declared in the CustomShader constructor.`);let n=this.uniforms[e];n.type===rS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):c(t.clone)?n.value=t.clone(n.value):n.value=t};EI.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};EI.prototype.isDestroyed=function(){return!1};EI.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),de(this)};var aS=EI;function P_(e){if(T.typeOf.object("options",e),!c(e.loader)){if(!c(e.metadata))throw new C("One of loader and metadata must be defined.");if(!Array.isArray(e.metadata))throw new C("metadata must be an array of TypedArrays.")}let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(P_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});P_.fromMetadataArray=function(e){if(T.typeOf.object("metadata",e),!Array.isArray(e))throw new C("metadata must be an array of TypedArrays.");return new P_({metadata:e})};P_.fromGltf=async function(e){T.typeOf.object("resource",e);let t=new em({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new P_({loader:t})};P_.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!c(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=hyt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function hyt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:l}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=l[o[f]].attribute,p=e.find(b=>b.name===h);if(!c(p))continue;let g=Nt.toComponentDatatype(s[f]),m=at.getComponentCount(r[f]),y=p.count*m;u[f]=$.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}P_.prototype.isDestroyed=function(){return!1};P_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),de(this)};var cS=P_;function Ym(){this.orientedBoundingBox=new Pn,this.boundingSphere=new le,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=Ym.DefaultMinBounds.clone(),this._maxBounds=Ym.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new d,renderMaxBounds:new d,boxUvToShapeUvScale:new d,boxUvToShapeUvTranslate:new d},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var myt=new d,CK=new d,pyt=new J,_yt=new d,gyt=new d,yyt=new d,byt=new d,fxe=F.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new F);Ym.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(_yt),o=o??n.clone(gyt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,yyt),s=d.clamp(n,i,o,byt),a=F.getScale(e,CK);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=SK(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:l,shaderDefines:u}=this;for(let g in u)u.hasOwnProperty(g)&&(u[g]=void 0);let f=0;u.BOX_INTERSECTION_INDEX=f,f+=1,l.renderMinBounds=F.multiplyByPoint(fxe,r,l.renderMinBounds),l.renderMaxBounds=F.multiplyByPoint(fxe,s,l.renderMaxBounds),u.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,p=n;return l.boxUvToShapeUvScale=d.fromElements(2/(h.x===p.x?1:p.x-h.x),2/(h.y===p.y?1:p.y-h.y),2/(h.z===p.z?1:p.z-h.z),l.boxUvToShapeUvScale),l.boxUvToShapeUvTranslate=d.fromElements(-l.boxUvToShapeUvScale.x*(h.x*.5+.5),-l.boxUvToShapeUvScale.y*(h.y*.5+.5),-l.boxUvToShapeUvScale.z*(h.z*.5+.5),l.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=f,!0};var D8=new d,EK=new d;Ym.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,a*t),O.lerp(r.y,s.y,a*n),O.lerp(r.z,s.z,a*i),D8),u=d.fromElements(O.lerp(r.x,s.x,a*(t+1)),O.lerp(r.y,s.y,a*(n+1)),O.lerp(r.z,s.z,a*(i+1)),EK);return SK(l,u,this.shapeTransform,o)};var dxe=new d;Ym.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,dxe),s=d.multiplyByScalar(r,o,dxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,D8),o,D8),l=d.add(a,s,EK),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),D8),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),EK);return SK(h,p,this.shapeTransform,i)};Ym.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));Ym.DefaultMaxBounds=Object.freeze(new d(1,1,1));function SK(e,t,n,i){let o=Ym.DefaultMinBounds,r=Ym.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,CK),l=d.midpoint(e,t,myt);i.center=F.multiplyByPoint(n,l,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),CK);let u=F.getRotation(n,pyt);i.halfAxes=J.setScale(u,a,i.halfAxes)}return i}var lS=Ym;function I_(){this.orientedBoundingBox=new Pn,this.boundingSphere=new le,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=I_.DefaultMinBounds.clone(),this._maxBounds=I_.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new z,cylinderRenderAngleMinMax:new z,cylinderRenderHeightMinMax:new z,cylinderUvToShapeUvRadius:new z,cylinderUvToShapeUvAngle:new z,cylinderUvToShapeUvHeight:new z,cylinderShapeUvAngleMinMax:new z,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 pxe=new d,xyt=new d,Tyt=new d,Ayt=new d,Cyt=new d;I_.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(xyt),o=o??n.clone(Tyt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=I_,a=s.y-r.y,l=.5*a,u=O.EPSILON10,f=O.EPSILON3,h=O.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=O.negativePiToPi(t.y),n.y=O.negativePiToPi(n.y),i.y=O.negativePiToPi(i.y),o.y=O.negativePiToPi(o.y);let p=d.maximumByComponent(t,i,Ayt),g=d.minimumByComponent(n,o,Cyt),m=F.getScale(e,pxe);if(g.x===0||p.x>g.x||p.z>g.z||O.equalsEpsilon(m.x,0,void 0,u)||O.equalsEpsilon(m.y,0,void 0,u)||O.equalsEpsilon(m.z,0,void 0,u))return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=DK(p,g,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let y=t.x===r.x&&n.x===s.x,b=n.y<t.y,x=n.y-t.y+b*a,A=x>l+h&&x<a-h,E=x<l-h,S=x>=l-h&&x<=l+h,v=A||E||S,P=O.equalsEpsilon(t.y,r.y,void 0,f),M=O.equalsEpsilon(n.y,s.y,void 0,f),R=t.z===r.z&&n.z===s.z,L=p.x===r.x,B=g.y<p.y,_=g.y-p.y+B*a,w=_>=l-h&&_<a-h,D=_>h&&_<l-h,I=_<=h,N=w||D||I,{shaderUniforms:k,shaderDefines:H}=this;for(let j in H)H.hasOwnProperty(j)&&(H[j]=void 0);let V=0;if(H.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=V,V+=1,L||(H.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,H.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=V,V+=1),k.cylinderRenderRadiusMinMax=z.fromElements(p.x,g.x,k.cylinderRenderRadiusMinMax),p.x===g.x&&(H.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!y){H.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let j=n.x-t.x,U=0,q=1;j!==0&&(U=1/j,q=-t.x/j),k.cylinderUvToShapeUvRadius=z.fromElements(U,q,k.cylinderUvToShapeUvRadius)}if(!R){H.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let j=n.z-t.z,U=0,q=1;j!==0&&(U=2/j,q=-(t.z+1)/j),k.cylinderUvToShapeUvHeight=z.fromElements(U,q,k.cylinderUvToShapeUvHeight)}if(k.cylinderRenderHeightMinMax=z.fromElements(p.z,g.z,k.cylinderRenderHeightMinMax),b&&(H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),N&&(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,H.CYLINDER_INTERSECTION_INDEX_ANGLE=V,w?(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,V+=1):D?(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,V+=2):I&&(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,V+=2),k.cylinderRenderAngleMinMax=z.fromElements(p.y,g.y,k.cylinderRenderAngleMinMax)),v){H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,P&&(H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),M&&(H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let j=(t.y-r.y)/a,U=(n.y-r.y)/a,q=1-x/a;if(k.cylinderShapeUvAngleMinMax=z.fromElements(j,U,k.cylinderShapeUvAngleMinMax),k.cylinderShapeUvAngleRangeZeroMid=(U+.5*q)%1,x<=h)k.cylinderUvToShapeUvAngle=z.fromElements(0,1,k.cylinderUvToShapeUvAngle);else{let X=a/x,te=-(t.y-r.y)/x;k.cylinderUvToShapeUvAngle=z.fromElements(X,te,k.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=V,!0};var P8=new d,vK=new d;I_.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,t*a),O.lerp(r.y,s.y,n*a),O.lerp(r.z,s.z,i*a),P8),u=d.fromElements(O.lerp(r.x,s.x,(t+1)*a),O.lerp(r.y,s.y,(n+1)*a),O.lerp(r.z,s.z,(i+1)*a),vK);return DK(l,u,this.shapeTransform,o)};var hxe=new d;I_.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,hxe),s=d.multiplyByScalar(r,o,hxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,P8),o,P8),l=d.add(a,s,vK),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),P8),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),vK);return DK(h,p,this.shapeTransform,i)};I_.DefaultMinBounds=Object.freeze(new d(0,-O.PI,-1));I_.DefaultMaxBounds=Object.freeze(new d(1,+O.PI,1));var Eyt=5,Syt=new Array(Eyt),wyt=new d,vyt=new J,Dyt=new F,Pyt=new F,Iyt=new F,wK=new F,Oyt=new d,Ryt=new d,Myt=new d,_xe=new Array(8);for(let e=0;e<8;e++)_xe[e]=new d;function mxe(e,t,n){return Math.abs(se.dot(e,t))<n}function Lyt(e){let t=F.getColumn(e,0,Oyt),n=F.getColumn(e,1,Ryt),i=F.getColumn(e,2,Myt),o=O.EPSILON4;return mxe(t,n,o)&&mxe(n,i,o)}function Nyt(e,t){let n=_xe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return Pn.fromPoints(n,t)}function DK(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+O.TWO_PI:t.y,l=e.z,u=t.z,f=a-s,h=s+f*.5,p=Syt,g=0;p[g++]=s,p[g++]=a,p[g++]=h,f>O.PI&&(p[g++]=h-O.PI_OVER_TWO,p[g++]=h+O.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let k=0;k<g;++k){let H=p[k]-h,V=Math.cos(H),j=Math.sin(H),U=V*o,q=j*o,X=V*r,te=j*r;m=Math.min(m,U,X),y=Math.min(y,q,te),b=Math.max(b,U,X),x=Math.max(x,q,te)}let A=b-m,E=x-y,S=u-l,v=(m+b)*.5,P=(y+x)*.5,M=(l+u)*.5,R=d.fromElements(v,P,M,wyt),L=J.fromRotationZ(h,vyt),B=d.fromElements(A,E,S,pxe),_=F.fromScale(B,Iyt),w=F.fromRotation(L,Pyt),D=F.fromTranslation(R,Dyt),I=F.multiplyTransformation(w,F.multiplyTransformation(D,_,wK),wK),N=F.multiplyTransformation(n,I,wK);return Lyt(N)?Pn.fromTransformation(N,i):Nyt(N,i)}var uS=I_;function O_(){this.orientedBoundingBox=new Pn,this.boundingSphere=new le,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new ce,this._minimumHeight=O_.DefaultMinBounds.z,this._maximumHeight=O_.DefaultMaxBounds.z,this._ellipsoid=new ie,this._translation=new d,this._rotation=new J,this.shaderUniforms={ellipsoidRadiiUv:new d,eccentricitySquared:0,evoluteScale:new z,ellipsoidInverseRadiiSquaredUv:new d,ellipsoidRenderLongitudeMinMax:new z,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidUvToShapeUvLongitude:new z,ellipsoidUvToShapeUvLatitude:new z,ellipsoidRenderLatitudeSinMinMax:new z,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new z},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 Fyt=new d,Byt=new d,kyt=new d,Uyt=new d,Vyt=new d,zyt=new d,Hyt=new d,Gyt=new d,jyt=new J,gxe=new d,yxe=new d,Wyt=new ce;O_.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=O_;i=i??r,o=o??s,T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n);let a=O.EPSILON10,l=O.EPSILON3,u=O.EPSILON10,f=O.EPSILON10,h=O.EPSILON3,p=F.getScale(e,Gyt),g=d.clone(r,Fyt);g.z=-d.minimumComponent(p);let m=d.clamp(t,g,s,Byt),y=d.clamp(n,g,s,kyt),b=d.clamp(i,g,s,Uyt),x=d.clamp(o,g,s,Vyt),A=d.maximumByComponent(m,b,zyt),E=d.minimumByComponent(y,x,Hyt),S=d.add(p,d.fromElements(y.z,y.z,y.z,gxe),gxe),v=d.maximumComponent(S),P=d.add(p,d.fromElements(E.z,E.z,E.z,yxe),yxe);if(A.y>E.y||A.y===s.y||E.y===r.y||A.z>E.z||O.equalsEpsilon(P,d.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(m.x,m.y,y.x,y.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ie.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=y.z;let M=ce.fromRadians(A.x,A.y,E.x,E.y,Wyt);this.orientedBoundingBox=PK(M,A.z,E.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation(J.setScale(this._rotation,S,jyt),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,L=.5*R,B=E.x<A.x,_=E.x-A.x+B*R,w=_<=u,D=_>=L-u&&_<R-u,I=_>u&&_<L-u,N=w||D||I,k=y.x<m.x,H=y.x-m.x+k*R,V=H>L+u&&H<R-u,j=H>=L-u&&H<=L+u,U=H<L-u,q=V||j||U,X=E.y<-h,te=E.y>=-h&&E.y<=+h,K=E.y>+h&&E.y<s.y-f,Z=X||te||K,ee=A.y>r.y+f&&A.y<-h,me=A.y>=-h&&A.y<=+h,xe=A.y>+h,ue=ee||me||xe,ye=Z||ue,Ae=y.y-m.y,Pe=y.y<-h,Ee=y.y>=-h&&y.y<=+h,Ve=y.y>+h&&y.y<s.y-f,je=Pe||Ee||Ve,it=m.y>r.y+f&&m.y<-h,Dt=m.y>=-h&&m.y<=+h,Gt=m.y>+h,ln=je||(it||Dt||Gt),{shaderUniforms:Vt,shaderDefines:Ct}=this;for(let mt in Ct)Ct.hasOwnProperty(mt)&&(Ct[mt]=void 0);Vt.ellipsoidRadiiUv=d.divideByScalar(S,v,Vt.ellipsoidRadiiUv);let{x:gi,z:an}=Vt.ellipsoidRadiiUv,_e=an/gi;Vt.eccentricitySquared=1-_e*_e,Vt.evoluteScale=z.fromElements((gi*gi-an*an)/gi,(an*an-gi*gi)/an,Vt.evoluteScale),Vt.ellipsoidInverseRadiiSquaredUv=d.divideComponents(d.ONE,d.multiplyComponents(Vt.ellipsoidRadiiUv,Vt.ellipsoidRadiiUv,Vt.ellipsoidInverseRadiiSquaredUv),Vt.ellipsoidInverseRadiiSquaredUv);let Ce=0;Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ce,Ce+=1,Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ce,Ce+=1,Vt.clipMinMaxHeight=z.fromElements((A.z-y.z)/v,(E.z-y.z)/v,Vt.clipMinMaxHeight);let mn=(y.z-m.z)/v;if(Vt.ellipsoidInverseHeightDifferenceUv=1/mn,m.z===y.z&&(Vt.ellipsoidInverseHeightDifferenceUv=0),N&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ce,D?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ce+=1):I?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ce+=2):w&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ce+=2),Vt.ellipsoidRenderLongitudeMinMax=z.fromElements(A.x,E.x,Vt.ellipsoidRenderLongitudeMinMax)),q)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<m.x&&(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),H<=u)Vt.ellipsoidUvToShapeUvLongitude=z.fromElements(0,1,Vt.ellipsoidUvToShapeUvLongitude);else{let to=R/H,So=-(m.x-r.x)/H;Vt.ellipsoidUvToShapeUvLongitude=z.fromElements(to,So,Vt.ellipsoidUvToShapeUvLongitude)}if(N){let mt=O.equalsEpsilon(A.x,r.x,void 0,l),to=O.equalsEpsilon(E.x,s.x,void 0,l);mt&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),to&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let So=(m.x-r.x)/R,Ks=(y.x-r.x)/R,vr=(E.x-r.x)/R,ps=1-_/R,Ne=(vr+.5*ps)%1;Vt.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(So,Ks,Ne,Vt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(ue&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ce,ee?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ce+=1):me?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ce+=1):xe&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ce+=2)),Z&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ce,X?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ce+=2):te?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ce+=1):K&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ce+=1)),Vt.ellipsoidRenderLatitudeSinMinMax=z.fromElements(Math.sin(A.y),Math.sin(E.y),Vt.ellipsoidRenderLatitudeSinMinMax)),ln)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ae<f)Vt.ellipsoidUvToShapeUvLatitude=z.fromElements(0,1,Vt.ellipsoidUvToShapeUvLatitude);else{let to=(s.y-r.y)/Ae,So=(r.y-m.y)/Ae;Vt.ellipsoidUvToShapeUvLatitude=z.fromElements(to,So,Vt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ce,!0};var Txe=new ce;O_.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,l=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,l,a,u,Txe),g=O.lerp(this._minimumHeight,this._maximumHeight,f),m=O.lerp(this._minimumHeight,this._maximumHeight,h);return PK(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var bxe=new d,xxe=new d,qyt=new d;O_.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,bxe),s=d.multiplyByScalar(r,o,bxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,xxe),o,xxe),l=d.add(a,s,qyt),u=ce.subsection(this._rectangle,a.x,a.y,l.x,l.y,Txe),f=O.lerp(this._minimumHeight,this._maximumHeight,a.z),h=O.lerp(this._minimumHeight,this._maximumHeight,l.z);return PK(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function PK(e,t,n,i,o,r,s){return s=Pn.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=J.multiply(s.halfAxes,r,s.halfAxes),s}O_.DefaultMinBounds=Object.freeze(new d(-O.PI,-O.PI_OVER_TWO,-ie.WGS84.minimumRadius));O_.DefaultMaxBounds=Object.freeze(new d(O.PI,O.PI_OVER_TWO,10*ie.WGS84.maximumRadius));var fS=O_;var Nu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Nu.getMinBounds=function(e){switch(e){case Nu.BOX:return lS.DefaultMinBounds;case Nu.ELLIPSOID:return fS.DefaultMinBounds;case Nu.CYLINDER:return uS.DefaultMinBounds;default:throw new C(`Invalid shape type ${e}`)}};Nu.getMaxBounds=function(e){switch(e){case Nu.BOX:return lS.DefaultMaxBounds;case Nu.ELLIPSOID:return fS.DefaultMaxBounds;case Nu.CYLINDER:return uS.DefaultMaxBounds;default:throw new C(`Invalid shape type ${e}`)}};Nu.getShapeConstructor=function(e){switch(e){case Nu.BOX:return lS;case Nu.ELLIPSOID:return fS;case Nu.CYLINDER:return uS;default:throw new C(`Invalid shape type ${e}`)}};var Na=Object.freeze(Nu);function mh(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),c(e.maximumLength)&&T.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=c(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(mh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(c(e)){for(T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});mh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new mh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};mh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(c(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};mh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Axe(this,t)};mh.prototype.insert=function(e){let t,n=this._maximumLength;if(c(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++,Axe(this,i),t};mh.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],Cxe(this,0)),this._array[e-1]=void 0,t};mh.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=IK(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Cxe(this,n)}return this._array[e-1]=void 0,t};mh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};mh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[IK(this,1,2)?1:2]};function I8(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function SI(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function IK(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Axe(e,t){if(t===0)return;let n=Math.floor(O.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=SI(e,t,i);for(o!==n&&(I8(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(SI(e,t,r)!==o)break;I8(e,t,r),t=r}}function Cxe(e,t){let n=e._length,i=Math.floor(O.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){SI(e,s,r)===i&&(r=s);let a=2*o+1,l=Math.max(Math.min(n-a,4),0);for(let u=0;u<l;u++){let f=a+u;SI(e,f,r)===i&&(r=f)}}if(SI(e,r,t)===i&&(I8(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);IK(e,r,a)===i&&I8(e,r,a)}t=r}}var dS=mh;var OK=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function wI(e,t){this.spatialNode=e,this.keyframe=t,this.state=OK.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}wI.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=OK.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};wI.priorityComparator=function(e,t){return e.priority-t.priority};wI.searchComparator=function(e,t){return e.keyframe-t.keyframe};wI.LoadState=OK;var go=wI;function a0(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32),i===Nt.FLOAT32&&!e.floatingPointTexture)throw new ae("Floating point texture not supported");let s=Yyt(i),a=Xyt(n,e.webgl2),l=Nt.getSizeInBytes(i),u=Kyt(o,n,l),f=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/f),p=f*t.x,g=h*t.y,m=Math.floor(u/p),y=Math.floor(u/g);if(m===0||y===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=l*n*u**2,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=m*y,this.regionCountPerMegatexture=new z(m,y),this.voxelCountPerRegion=new z(p,g),this.sliceCountPerRegion=new z(f,h),this.voxelSizeUv=new z(1/u,1/u),this.sliceSizeUv=new z(t.x/u,t.y/u),this.regionSizeUv=new z(p/u,g/u),this.texture=new Rt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR})});let b=Nt.toComponentDatatype(i);this.tileVoxelDataTemp=$.createTypedArray(b,p*g*n),this.nodes=new Array(this.maximumTileCount);for(let x=0;x<this.maximumTileCount;x++)this.nodes[x]=new $yt(x);for(let x=0;x<this.maximumTileCount;x++){let A=this.nodes[x];A.previousNode=x>0?this.nodes[x-1]:void 0,A.nextNode=x<this.maximumTileCount-1?this.nodes[x+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Yyt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function Xyt(e,t){if(e===1)return t?ke.RED:ke.LUMINANCE;if(e===2)return t?ke.RG:ke.LUMINANCE_ALPHA;if(e===3)return ke.RGB;if(e===4)return ke.RGBA}function Kyt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(ut.maximumTextureSize,O.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function $yt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}a0.prototype.add=function(e){if(this.isFull())throw new C("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,c(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,c(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};a0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new C("Megatexture index out of bounds");let t=this.nodes[e];c(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),c(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,c(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};a0.prototype.isFull=function(){return this.emptyList===void 0};a0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32);let o=Nt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),l=s*t.x,u=a*t.y,f=O.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/l),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};a0.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:l}=this;for(let g=0;g<o.z;g++){let m=g%r.x*o.x,y=Math.floor(g/r.x)*o.y;for(let b=0;b<o.y;b++){let x=Zyt(o,b,g),A=(y+b)*s.x+m;for(let E=0;E<o.x;E++){let S=x+E,v=A+E;for(let P=0;P<a;P++)i[v*a+P]=n[S*a+P]}}}let u=e%l.x*s.x,f=Math.floor(e/l.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(p)};function Zyt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),de(this)};var vI=a0;function Jf(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=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Pn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var Qyt=new d;Jf.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=J.getScale(this.orientedBoundingBox.halfAxes,Qyt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};Jf.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,l=s+1,u=r+1,f=a+1,h=t+1,p=[[h,r,s,a],[h,u,s,a],[h,r,l,a],[h,u,l,a],[h,r,s,f],[h,u,s,f],[h,r,l,f],[h,u,l,f]];this.children=p.map(([g,m,y,b])=>new Jf(g,m,y,b,this,e,this.dimensions))};Jf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Jf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,O.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var Exe={keyframe:0};function DI(e,t){return Exe.keyframe=e,Mo(t,Exe,go.searchComparator)}Jf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;c(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=Jyt(i,h),g=h[p],m=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),y=h[m],b=i-g.keyframe,x=Sxe(n-t.level,b);x<a&&(a=x,r=g);let A=y.keyframe-o,E=Sxe(n-t.level,A);if(E<l&&(l=E,s=y),b===0&&A===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!c(r)||!c(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:O.clamp((e-u)/(f-u),0,1)};function Jyt(e,t){let n=DI(e,t);return n<0?O.clamp(~n-1,0,t.length-1):n}function Sxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Jf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Jf.prototype.createKeyframeNode=function(e){let t=DI(e,this.keyframeNodes);if(t<0){t=~t;let n=new go(this,e);this.keyframeNodes.splice(t,0,n)}};Jf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=DI(n,this.keyframeNodes);if(i<0)throw new C("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=DI(n,this.renderableKeyframeNodes);if(o<0)throw new C("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Jf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new C("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=DI(e.keyframe,i);if(o>=0)throw new C("Keyframe already renderable");o=~o,i.splice(o,0,e)};Jf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return c(t)&&c(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var O8=Jf;function c0(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:l,componentTypes:u,metadataOrder:f}=o,h=d.add(r,s,new d);if(d.add(h,a,h),f===hh.Y_UP){let E=h.y;h.y=h.z,h.z=E}!c(i)&&c(o.maximumTileCount)&&(i=d0t(o.maximumTileCount,h,l,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(l.length);for(let E=0;E<l.length;E++){let S=l[E],v=at.getComponentCount(S),P=u[E];this.megatextures[E]=new vI(t,h,v,P,i),this.textureMemoryByteLength+=this.megatextures[E].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let g=e._shape;this.rootNode=new O8(0,0,0,0,void 0,g,r),this._priorityQueue=new dS({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 m=this._binaryTreeKeyframeWeighting;m[0]=0,m[n-1]=0,RK(m,1,n-2,0);let y=9,b=2048,x=Math.floor(b/y),A=Math.ceil(p/x);this.internalNodeTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:b,height:A,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})}),this.internalNodeTilesPerRow=x,this.internalNodeTexelSizeUv=new z(1/b,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new z}c0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function RK(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,RK(e,t,o-1,i+1),RK(e,o+1,n,i+1)}c0.simultaneousRequestCountMaximum=50;c0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,l=o._levelBlendFactor,u=l>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!c(this.leafNodeTexture)){let E=Math.floor(512),S=Math.ceil(s/E);this.leafNodeTexture=new Rt({context:r,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:S,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})}),this.leafNodeTexelSizeUv=z.fromElements(1/1024,1/S,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=E}else!p&&c(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=O.clamp(t,0,a-1),n&&wxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ei();n0t(this,e),i0t(this,e);let m=Ei();c0t(this,h,l);let y=Ei(),b=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||b){let x=m-g,A=y-m,E=y-g;a0t(this,e,x,A,E)}};c0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};c0.prototype.isDestroyed=function(){return!1};c0.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(),de(this)};function wxe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),c(t.children))for(let n=0;n<8;n++){let i=t.children[n];wxe(e,i)}}function e0t(e,t){if(e._simultaneousRequestCount>=c0.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(c(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=c(f)?go.LoadState.PROCESSING:go.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let l={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(l);c(u)&&(e._simultaneousRequestCount++,t.state=go.LoadState.RECEIVING,u.then(s).catch(a))}function t0t(e){return e/(1+e)}function n0t(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),vxe(e.rootNode,ys.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 i0t(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(o0t);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,l=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===go.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===go.LoadState.UNLOADED&&e0t(e,f),f.state===go.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!r0t(h.metadata,e)){f.content=void 0,f.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+l,l++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=go.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function o0t(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function r0t(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:l,z:u}=r,f=a*l*u,h=e[o],p=f*s;if(h.length!==p)return!1}return!0}function vxe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:l,frustum:u}=o,h=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(l,h),t=e.visibility(i,t),t===ys.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,b=n._keyframeCount,x=O.clamp(Math.floor(n._keyframeLocation),0,b-2),A=x+1;if(b===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==b)for(let M=0;M<b;M++)e.createKeyframeNode(M);let{screenSpaceError:E,keyframeNodes:S}=e,v=t0t(E),P=!1;for(let M=0;M<S.length;M++){let R=S[M];R.priority=10*v+s0t(x,R.keyframe,A,n),R.state!==go.LoadState.UNAVAILABLE&&R.state!==go.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===go.LoadState.LOADED&&(P=!0)}if(E<m||!P){e.children=void 0;return}c(e.children)||e.constructChildNodes(g);for(let M=0;M<8;M++){let R=e.children[M];vxe(R,t,n,i)}}function s0t(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 O.lerp(a,s,.15+.85*s)}function a0t(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(go.LoadState).length,l=new Array(a),u=new Array(a),f=0;for(let P=0;P<a;P++){let M=new Array(r).fill(0);l[P]=M,u[P]=0}function h(P){let M=P.keyframeNodes;for(let R=0;R<M.length;R++){let L=M[R],B=L.keyframe,_=L.state;l[_][B]+=1,u[_]+=1,f++}if(c(P.children))for(let R=0;R<8;R++){let L=P.children[R];h(L)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=u[go.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[go.LoadState.RECEIVING],g=u[go.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(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 b=`KEYFRAMES: ${l[go.LoadState.LOADED]}`,x=`UNLOADED: ${u[go.LoadState.UNLOADED]} | RECEIVING: ${u[go.LoadState.RECEIVING]} | PROCESSING: ${u[go.LoadState.PROCESSING]} | LOADED: ${u[go.LoadState.LOADED]} | FAILED: ${u[go.LoadState.FAILED]} | UNAVAILABLE: ${u[go.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,A=Math.round(n*100)/100,E=Math.round(i*100)/100,S=Math.round(o*100)/100,v=`LOAD: ${A} | OCT: ${E} | ALL: ${S}`;console.log(`${b} || ${x} || ${v}`)}var R8={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function c0t(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,l=0,u=[],f=[];function h(g,m,y,b,x){let A=!1;if(c(g.children))for(let E=0;E<8;E++){let S=g.children[E];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(A=!0)}if(A){u[x]=R8.INTERNAL<<16|m,u[y]=b,a++,b=m,x=b*9+1;for(let E=0;E<8;E++){let S=g.children[E];m=a,y=m*9+0,h(S,m,y,b,x+E)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let E=l*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,P=S.spatialNode.parent,M=c(P)?P.renderableKeyframeNodePrevious:S,R=l0t(g,i,n),L=v,B=1,_=S.megatextureIndex,w=M.megatextureIndex;f[E+0]=R,f[E+1]=L,f[E+2]=B,f[E+3]=_,f[E+4]=w,u[x]=R8.LEAF<<16|l}else{let E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level===0?R8.LEAF:R8.PACKED_LEAF_FROM_PARENT;u[x]=v<<16|E.megatextureIndex}l++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),u0t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&f0t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function l0t(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 O.clamp(s,0,1)}function u0t(e,t,n,i){let o=ke.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)),l=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let m=0;m<o;m++)l[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:l,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function f0t(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),l=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*l*o);for(let p=0;p<s;p++){let g=e[p*r+0],m=e[p*r+1],y=e[p*r+2],b=e[p*r+3],x=e[p*r+4],A=O.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=A>>>0&255,u[p*8+1]=A>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=x>>>0&255,u[p*8+7]=x>>>8&255}let h={source:{arrayBufferView:u,width:a,height:l},xOffset:0,yOffset:0};i.copyFrom(h)}function d0t(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=i[s],u=at.getComponentCount(a);o+=vI.getApproximateTextureMemoryByteLength(e,t,u,l)}return o}var M8=c0;function Xm(e){e=e??W.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??Xm.DefaultProvider,this._traversal=void 0,this._statistics=new fm,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new d,this._inputDimensions=new d,this._paddingBefore=new d,this._paddingAfter=new d,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._exaggeratedMinBounds=new d,this._exaggeratedMinBoundsOld=new d,this._exaggeratedMaxBounds=new d,this._exaggeratedMaxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=e.customShader??Xm.DefaultCustomShader,this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new J,this._transformNormalLocalToWorld=new J,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new cm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new z,megatextureTextures:[],megatextureSliceDimensions:new z,megatextureTileDimensions:new z,megatextureVoxelSizeUv:new z,megatextureSliceSizeUv:new z,megatextureTileSizeUv:new z,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new J,transformNormalLocalToWorld:new J,cameraPositionUv:new d,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new G},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 pe,this.tileVisible=new pe,this.tileFailed=new pe,this.tileUnload=new pe,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe;let i=this._provider;h0t(this,i)}function h0t(e,t){let{shape:n,minBounds:i=Na.getMinBounds(n),maxBounds:o=Na.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),Pxe(e,t);let r=Na.getShapeConstructor(n);e._shape=new r,e._shapeVisible=Ixe(e,e._shape,t)}Object.defineProperties(Xm.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){T.typeOf.object("modelMatrix",e),this._modelMatrix=F.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){T.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){T.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){T.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){T.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){T.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){T.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=O.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){T.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){T.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){T.defined("minBounds",e),this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){T.defined("maxBounds",e),this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){T.defined("minClippingBounds",e),this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){T.defined("maxClippingBounds",e),this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.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];c(e)?this._customShader=e:this._customShader=Xm.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var m0t=new se,p0t=new se,_0t=new d,g0t=new d,y0t=new J,b0t=new J,x0t=new F,T0t=new F,A0t=new F,C0t=F.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new F),E0t=F.fromRotationTranslation(J.fromUniformScale(2,new J),new d(-1,-1,-1),new F);Xm.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){I0t(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}D0t(this,e);let i=Pxe(this,t),o=this._shape;if(i&&(this._shapeVisible=Ixe(this,o,t),R0t(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=M0t(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&&z0t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),L0t(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;c(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=z.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(E8(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=B0t(p,h,p0t);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=se.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,y,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let x=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=J.multiply(this._transformDirectionWorldToLocal,x,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=J.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let A=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,A,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let E=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;E.boundingVolume=o.boundingSphere,e.commandList.push(E)};var S0t=new d,MK=new d,w0t=new he,v0t=new d;function D0t(e,t){if(e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Na.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{let n=d.fromElements(1,1,t.verticalExaggeration,S0t);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,P0t(e,t),e._exaggeratedModelMatrix)}}function P0t(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,MK),r=F.multiplyByPoint(e._modelMatrix,o,MK),s=F.multiplyByPoint(i,r,MK),l=ie.WGS84.cartesianToCartographic(s,w0t),u=0;c(l)&&(u=l.height);let f=Rr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return d.fromElements(0,0,(f-u)/t.verticalExaggeration,v0t)}function I0t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=G.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=We(o,!0);let s=e._uniformMap;for(let l in r)if(r.hasOwnProperty(l)){let u=`u_${l}`;c(s[u])&&dt(`VoxelPrimitive: Uniform name "${u}" is already defined`),s[u]=function(){return r[l]}}if(e._dimensions=d.clone(t.dimensions,e._dimensions),i.dimensions=d.clone(e._dimensions,i.dimensions),e._paddingBefore=d.clone(t.paddingBefore??d.ZERO,e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(t.paddingAfter??d.ZERO,e._paddingAfter),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=d.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=d.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===hh.Y_UP){let l=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=l}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new M8(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,O0t(e._traversal,i)}function Pxe(e,t){let n=t.shapeTransform??F.IDENTITY,i=t.globalTransform??F.IDENTITY;return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),Fx(e,"_compoundModelMatrix","_compoundModelMatrixOld")+Fx(e,"_minBounds","_minBoundsOld")+Fx(e,"_maxBounds","_maxBoundsOld")+Fx(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+Fx(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+Fx(e,"_minClippingBounds","_minClippingBoundsOld")+Fx(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function Fx(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function Ixe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,x0t),s=F.getRotation(o,y0t),a=F.getScale(o,_0t),l=d.maximumComponent(a),u=d.divideByScalar(a,l,g0t),f=J.multiplyByScale(s,u,b0t);return e._transformPositionWorldToUv=F.multiplyTransformation(C0t,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,E0t,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=J.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function O0t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=z.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=z.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=z.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=z.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=z.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=z.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function R0t(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=We(n,!0)),i}function M0t(e,t){if(!c(e)||!c(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 L0t(e,t){let n=e.clippingPlanes;if(!c(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.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)}Xm.prototype.isDestroyed=function(){return!1};Xm.prototype.destroy=function(){let e=this._drawCommand;c(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return c(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(),de(this)};var Dxe=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)),N0t=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),F0t=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function B0t(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,T0t),o=F.multiply(t,i,A0t),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,l=-Number.MAX_VALUE,u,f=F0t,h=Dxe.length;for(u=0;u<h;u++)F.multiplyByVector(o,Dxe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,m),l=Math.max(l,m)}else for(let g=0;g<3;g++){let m=N0t[u*3+g],y=f[m];if(y.z>=-y.w){let b=p.z+p.w,x=y.z+y.w,A=b/(b-x),E=se.lerp(p,y,A,m0t),S=E.x/E.w,v=E.y/E.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),l=Math.max(l,v)}}}return r=O.clamp(r,-1,1),a=O.clamp(a,-1,1),s=O.clamp(s,-1,1),l=O.clamp(l,-1,1),n=se.fromElements(r,a,s,l,n),n}var LK=3e7,k0t=new d(LK,0,0),U0t=new d(0,LK,0),V0t=new d(0,0,LK);function z0t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(l,u,f,h){i.add({positions:[l,u],width:h,material:Xi.fromType("Color",{color:f})})}function r(l,u,f){let h=l.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function s(l){if(!n.isRenderable(l))return;let u=l.level,h=Math.max(1,5/Math.pow(2,u)),g=[G.RED,G.LIME,G.BLUE][u%3];if(r(l.orientedBoundingBox,g,h),c(l.children))for(let m=0;m<8;m++)s(l.children[m])}r(e._shape.orientedBoundingBox,G.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,k0t,G.RED,a),o(d.ZERO,U0t,G.LIME,a),o(d.ZERO,V0t,G.BLUE,a),i.update(t)}Xm.DefaultCustomShader=new aS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;var t7=`uniform vec3 u_noiseTextureDimensions; +in vec2 position; +out vec2 v_position; +void main() { - material.diffuse = vec3(1.0); - material.alpha = 1.0; -}`});function Oxe(){this.ready=!0,this.shape=Na.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[at.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}Oxe.prototype.requestData=function(e){if((c(e)?e.tileLevel??0:0)>=1)return;let n=new cS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};Xm.DefaultProvider=new Oxe;var Bx=Xm;function H0t(e,t,n,i){if(!c(e)||c(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!c(r))return;let a=(r.properties||{})[i];if(c(a))return a}var L8=H0t;function G0t(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var N8=G0t;function j0t(e,t,n){if(!c(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(c(a))return a}}var F8=j0t;var k8=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ei(e){e=e??W.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=We(e.contextOptions);if(!c(t))throw new C("options and options.canvas are required.");let r=c(n),s=new aL(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)),c(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new n4,this._frameState=new Jz(s,new jz(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new a1(s),this._ellipsoid=e.ellipsoid??ie.default,this._globe=void 0,this._globeTranslucencyState=new e4,this._primitives=new Ol,this._groundPrimitives=new Ol,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ei.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new nS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Kz(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new G,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:ze.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new j4(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new r8,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,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=G.clone(G.BLACK),this._mode=oe.SCENE3D,this._mapProjection=c(e.mapProjection)?e.mapProjection:new Oi(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 IA,this.fog=new Qz,this.fog.enabled=ie.WGS84.equals(this._ellipsoid),ie.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new i0({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=G.clone(G.WHITE),this._actualInvertClassificationColor=G.clone(this._invertClassificationColor),this._invertClassification=new fI,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new z4,this._brdfLutGenerator=new Mz,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new t8(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Pu.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Tc.requestCompletedEvent.addEventListener(k8(this)),this._removeTaskProcessorListenerCallback=bi.taskCompletedEvent.addEventListener(k8(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),l=new ro(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new T4(this),this._defaultView=new ZE(this,l,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 Y_,Fxe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}ei.defaultLogDepthBuffer=!0;function W0t(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];c(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(k8(e))),n.push(t.terrainProviderChanged.addEventListener(k8(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ei.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 ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ut.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 Hh.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,W0t(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(c(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(c(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),c(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(c(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){if(this.scene3DOnly&&e!==oe.SCENE3D)throw new C("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===oe.SCENE2D)this.morphTo2D(0);else if(e===oe.SCENE3D)this.morphTo3D(0);else if(e===oe.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new C("value must be a valid SceneMode enumeration.");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){if(this.camera.frustum instanceof on)throw new C("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Zz(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){if(!c(e)||e<0)throw new C("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");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,ut.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}}});ei.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 q0t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function Rxe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,l=t.derivedCommands;c(t.pickId)&&(l.picking=A_.createPickDerivedCommand(e,t,o,l.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,c(t.pickedMetadataInfo)&&(l.pickingMetadata=A_.createPickMetadataDerivedCommand(e,t,o,l.pickingMetadata))),t.pickOnly||(l.depth=A_.createDepthOnlyDerivedCommand(e,t,o,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=A_.createHdrCommand(t,o,l.hdr),t=l.hdr.command,l=t.derivedCommands),a&&t.receiveShadows&&(l.shadows=i0.createReceiveDerivedCommand(s,t,n,o,l.shadows)),t.pass===De.TRANSLUCENT&&c(r)&&r.isSupported()&&(a&&t.receiveShadows?(l.oit=c(l.oit)?l.oit:{},l.oit.shadows=r.createDerivedCommands(l.shadows.receiveCommand,o,l.oit.shadows)):l.oit=r.createDerivedCommands(t,o,l.oit))}ei.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!c(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 l=this._hdr,u=c(t.logDepth),f=c(t.hdr),h=c(t.originalCommand),p=o&&!u,g=l&&!f,m=(!o||!l)&&!h,y=n.pickingMetadata&&q0t(e,n);if(e.dirty=e.dirty||p||g||m||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=i0.createCastDerivedCommand(x,e,s,r,t.shadows)),(u||p)&&(t.logDepth=A_.createLogDepthCommand(e,r,t.logDepth),Rxe(this,t.logDepth.command,s)),(h||m)&&Rxe(this,e,s)};var Y0t=new lh({pass:Uo.RENDER}),NK=new lh({pass:Uo.PRELOAD}),FK=new lh({pass:Uo.PRELOAD_FLIGHT}),X0t=new lh({pass:Uo.REQUEST_RENDER_MODE_DEFER_CHECK}),Mxe=new le,BK;function K0t(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return Mxe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,BK=Rz.fromBoundingSphere(Mxe,e.camera.positionWC,BK),BK}ei.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function Fxe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}ei.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=K0t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof on||this.camera.frustum instanceof jo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;c(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,c(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=G.clone(this.invertClassificationColor,this._actualInvertClassificationColor),fI.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,c(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ei.prototype.isVisible=function(e,t,n){if(!c(t))return!1;let{boundingVolume:i}=t;return!c(i)||!t.cull?!0:e.computeVisibility(i)===Wt.OUTSIDE?!1:!c(n)||!t.occlude||!i.isOccluded(n)};var B8=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);B8=F.inverseTransformation(B8,B8);function $0t(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==oe.SCENE3D){a=F.multiplyByPoint(B8,a,a);let m=o.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let l,u,{radius:f}=s;c(f)?(l=da.createGeometry(new da({radii:new d(f,f,f),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=F.fromTranslation(a)):(l=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new In({geometryInstances:new St({geometry:Nn.toWireframe(l),modelMatrix:u,attributes:{color:new jt(1,0,0,1)}}),appearance:new rn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=A_.createLogDepthCommand(e,r).command);let g;c(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),c(g)&&(n.framebuffer=g),o.commandList=h}function Km(e,t,n,i){let o=t._frameState,r=t._context;if(c(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&c(e.boundingVolume)&&$0t(e,t,n,i),o.useLogDepth&&c(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&c(e.derivedCommands)&&c(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&c(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&c(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(c(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&&c(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function Lxe(e,t,n){let{derivedCommands:i}=e;if(!c(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&c(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:l}=e.derivedCommands;c(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),c(s)?(e=s.pickCommand,e.execute(r,n)):c(l)&&(e=l.depthOnlyCommand,e.execute(r,n))}function Bxe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Z0t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+O.EPSILON12}function Q0t(e,t,n,i,o){Zy(i,Bxe,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function J0t(e,t,n,i,o){Zy(i,Z0t,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ebt(e,t,n){e.context.uniformState.updatePass(De.VOXELS);let i=n.commands[De.VOXELS];i.length=n.indices[De.VOXELS],Zy(i,Bxe,e.camera.positionWC);for(let o=0;o<i.length;++o)Km(i[o],e,t)}var tbt=new wi,nbt=new zl,ibt=new on,obt=new jo;function rbt(e){let{frustum:t}=e;return c(t.fov)?t.clone(tbt):c(t.infiniteProjectionMatrix)?t.clone(nbt):c(t.width)?t.clone(ibt):t.clone(obt)}function sbt(e){if(e._environmentState.useOIT){if(!c(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?Q0t:J0t}function abt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,l;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=e._invertClassification);let u=sbt(e);o.uniformState.updatePass(De.TRANSLUCENT);let f=n.commands[De.TRANSLUCENT];f.length=n.indices[De.TRANSLUCENT],u(e,Km,t,f,l)}function cbt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[De.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[De.TRANSLUCENT];i.executeTranslucentCommands(e,Km,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,Km,t,n)}function UK(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=rbt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,l=a.pick||a.pickVoxel;l||lbt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:b,sceneFramebuffer:x,frustumCommandsList:A}=e._view,E=A.length,S=e._globeTranslucencyState,v=e._depthClearCommand,P=e._stencilClearCommand,M=e._classificationStencilClearCommand,R=e._depthPlane,L=n.position.z;function B(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)Km(I[k],e,t);return N}function _(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)Lxe(I[k],e,t)}for(let w=0;w<E;++w){let D=E-w-1,I=A[D];e.mode===oe.SCENE2D?(n.position.z=L-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&P.execute(i,t),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,Km,b,e,t)):B(I,De.GLOBE),p&&y.executeCopyDepth(i,t),f||(S.translucent?(r.updatePass(De.TERRAIN_CLASSIFICATION),S.executeGlobeClassificationCommands(I,Km,b,e,t)):B(I,De.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),h&&R.execute(i,t));let N;if(!g||l||f)N=B(I,De.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=B(I,De.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let H=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=B(I,De.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=B(I,De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=H,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&M.execute(i,t),N=B(I,De.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&P.execute(i,t),ebt(e,t,I),B(I,De.OPAQUE),D!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),abt(e,t,I),cbt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let H=e._picking.getPickDepth(e,D);H.update(i,y.depthStencilTexture),H.executeCopyDepth(i,t)}if(l||!m)continue;let k=t.framebuffer;t.framebuffer=x.getIdFramebuffer(),s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,Lxe,b,e,t)):_(I,De.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&h&&R.execute(i,t),_(I,De.CESIUM_3D_TILE),_(I,De.OPAQUE),_(I,De.TRANSLUCENT),t.framebuffer=k}}function lbt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(De.ENVIRONMENT),c(i.skyBoxCommand)&&Km(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Km(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 kxe(e){e.context.uniformState.updatePass(De.COMPUTE);let t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function ubt(e,t){e.context.uniformState.updatePass(De.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function fbt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[De.GLOBE,De.CESIUM_3D_TILE,De.OPAQUE,De.TRANSLUCENT];for(let l=0;l<t.length;++l){let u=t[l];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function Uxe(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 l=o[a];if(l.outOfView)continue;let{passes:u}=l;for(let f=0;f<u.length;++f)u[f].commandList.length=0;fbt(e,n,l);for(let f=0;f<u.length;++f){let h=l.passes[f],{camera:p,commandList:g}=h;s.updateCamera(p),l.updatePass(r,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let b=y.derivedCommands.shadows.castCommands[a];Km(b,e,h.passState)}}}}var dbt=new d;ei.prototype.updateAndExecuteCommands=function(e,t){Sbt(this,e,t),this._environmentState.useWebVR?hbt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===Pu.ROTATE?l0(!0,this,e):Abt(this,e)};function hbt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;Vxe(e),n.createPotentiallyVisibleSet(e),kxe(e),r||Uxe(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 l=i.frustum.near,u=l*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(a.right,f*.5,dbt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*l/u;d.add(a.position,h,i.position),i.frustum.xOffset=p,UK(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-p,UK(e,t),ro.clone(a,i)}var mbt=new he(Math.PI,O.PI_OVER_TWO),pbt=new d,_bt=new d,gbt=new F,ybt=new F,bbt=new d,xbt=new d,Tbt=new Ke;function Abt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Ke.clone(r,Tbt);t.viewport=s;let a=mbt,l=pbt;e.mapProjection.project(a,l);let f=d.clone(i.position,_bt),h=F.clone(i.transform,ybt),p=i.frustum.clone();i._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,gbt),m=i.frustum.projectionMatrix,y=i.positionWC.y,b=d.fromElements(O.sign(y)*l.x-y,0,-i.positionWC.x,bbt),x=Ot.pointToGLWindowCoordinates(m,g,b,xbt);x.x=Math.floor(x.x);let A=s.x,E=s.width;if(y===0||x.x<=A||x.x>=A+E)l0(!0,e,t);else if(Math.abs(A+E*.5-x.x)<1)s.width=x.x-s.x,i.position.x*=O.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!0,e,t),s.x=x.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),l0(!1,e,t);else if(x.x>A+E*.5){s.width=x.x-A;let S=i.frustum.right;i.frustum.right=l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!0,e,t),s.x=x.x,s.width=A+E-x.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=S-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!1,e,t)}else{s.x=x.x,s.width=A+E-x.x;let S=i.frustum.left;i.frustum.left=-l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!0,e,t),s.x=A,s.width=x.x-A,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=S-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function l0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),Vxe(t),i.createPotentiallyVisibleSet(t),e&&(kxe(t),o||Uxe(t)),UK(t,n)}var Nxe=new ys;ei.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,l=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof on||!l.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(c(s)){if(c(a))s.setDynamicLighting(Ig.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let x=r.dynamicLighting;s.setDynamicLighting(x),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),c(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=c(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=c(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=c(b)?b.drawCommand:void 0,n.sunComputeCommand=c(b)?b.computeCommand:void 0,n.moonCommand=c(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=c(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!l.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=Nxe.planes;for(let b=0;b<5;++b)g[b]=p.planes[b];p=Nxe,n.isSkyAtmosphereVisible=c(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;c(m)&&y?.url!==m?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new Hh(m)):!c(m)&&c(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Cbt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new T_({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),c(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Ebt(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 l=o[a];l.update(t),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function Vxe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Cbt(e),Ebt(e),e._globe&&e._globe.render(t)}function Sbt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,l=a.pick||a.pickVoxel;c(s.globeDepth)&&(s.globeDepth.picking=l);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new o8:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;G.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=c(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=!l&&c(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 m=e.postProcessStages,y=r.usePostProcess=!l&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),y=r.usePostProcess=m.ready,r.usePostProcessSelected=y&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),c(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!l&&c(t.framebuffer)&&e.invertClassification){let x;if(o.invertClassificationColor.alpha===1&&h&&(x=s.globeDepth.framebuffer),c(x)||i.depthTexture){if(e._invertClassification.previousFramebuffer=x,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let A=e._invertClassification.unclassifiedCommand,E=A.derivedCommands;E.oit=p.createDerivedCommands(A,i,E.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ei.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;c(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:l,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=l?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),b=p.getColorTexture(0),x=(f??h).getDepthStencilTexture();m.execute(t,y,x,b),m.copy(t,u)}!s&&!l&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function wbt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function vbt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function zxe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Ol){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=zxe(s,t,n);c(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(c(o)&&o>i)return o}return i}ei.prototype.getHeight=function(e,t){if(!c(e))return;let n=t===qe.CLAMP_TO_TERRAIN||t===qe.RELATIVE_TO_TERRAIN,i=t===qe.CLAMP_TO_3D_TILE||t===qe.RELATIVE_TO_3D_TILE;if(!c(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=zxe(this.primitives,e,this);c(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&c(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var kK=new he;ei.prototype.updateHeight=function(e,t,n){T.typeOf.func("callback",t);let i=this._ellipsoid,o=g=>{he.clone(e,kK);let m;c(g)&&(m=g.height),c(m)||(m=this.getHeight(e,n)),c(m)&&(kK.height=m,t(kK))},r=n===qe.CLAMP_TO_TERRAIN||n===qe.RELATIVE_TO_TERRAIN,s=n===qe.CLAMP_TO_3D_TILE||n===qe.RELATIVE_TO_3D_TILE,a;!s&&c(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let l={},u=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,o,i);l[g.id]=m};if(!r){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(c(l[g.id])&&l[g.id](),delete l[g.id])});return()=>{a=a&&a(),Object.values(l).forEach(g=>g()),l={},f(),h()}};function Dbt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!c(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 c(r)&&o.height<r}ei.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=vbt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Dbt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Pbt(e,t){if(e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new t0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Ibt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),c(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Obt(e){e.primitives.postPassesUpdate(e._frameState),Tc.update()}var Rbt=new G;function Mbt(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=Y0t;let r=e.backgroundColor??G.BLACK;e._hdr&&(r=G.clone(r,Rbt),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;c(s)&&s.enabled&&(!c(e.light)||e.light instanceof Y_?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.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 l=o.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=Ke.clone(a,l.viewport),c(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,r),e.resolveFramebuffers(l),l.framebuffer=void 0,ubt(e,l),c(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function kx(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Lbt(e){return e._picking.updateMostDetailedRayPicks(e)}ei.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,c(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&&c(this.maximumRenderTimeChange)&&c(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=O.incrementWrap(t.frameNumber,15e6,1);Fxe(this,o,e),t.newFrame=!0}kx(this,Ibt),this.primitives.show&&(kx(this,Lbt),kx(this,Nbt),kx(this,Fbt),i||kx(this,Bbt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),kx(this,Mbt)),Pbt(this,i),kx(this,Obt),wbt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ei.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ei.prototype.requestRender=function(){this._renderRequested=!0};ei.prototype.clampLineWidth=function(e){return Math.max(ut.minimumAliasedLineWidth,Math.min(e,ut.maximumAliasedLineWidth))};ei.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ei.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!c(i))return;let o=i.primitive;if(!(o instanceof Bx))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!c(a))return;let l=255*r[2]+r[3];return s8.fromKeyframeNode(o,s,l,a)};ei.prototype.pickMetadata=function(e,t,n,i){T.typeOf.object("windowPosition",e),T.typeOf.string("className",n),T.typeOf.string("propertyName",i);let o=this.pick(e);if(!c(o))return;let r=o.detail?.model?.structuralMetadata;if(!c(r))return;let s=r.schema,a=L8(s,t,n,i);if(!c(a))return;let l=F8(r,n,i);if(!c(l))return;let u=new N8(t,n,i,a,l);return this._picking.pickMetadata(this,e,u)};ei.prototype.pickMetadataSchema=function(e){T.typeOf.object("windowPosition",e);let t=this.pick(e);return c(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ei.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ei.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ei.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Nbt(e){let t=e._frameState;NK.camera=t.camera,NK.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,NK)}function Fbt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;FK.camera=e.preloadFlightCamera,FK.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,FK)}function Bbt(e){e.primitives.updateForPass(e._frameState,X0t)}ei.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ei.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ei.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ei.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ei.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ei.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ei.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ei.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ei.prototype.cartesianToCanvasCoordinates=function(e,t){return Hi.worldToWindowCoordinates(this,e,t)};ei.prototype.completeMorph=function(){this._transitioner.completeMorph()};ei.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};ei.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};ei.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function kbt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){c(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{c(e)&&c(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ei.prototype.setTerrain=function(e){return T.typeOf.object("terrain",e),kbt(this,e),e};ei.prototype.isDestroyed=function(){return!1};ei.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(),c(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,c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),de(this)};var U8=ei;function hS(e){e=e??ie.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new Je({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(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 d;let i=new d;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(hS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});hS.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var VK=new F;hS.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=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,VK),o=F.multiplyTransformation(i,Fo.Y_UP_TO_Z_UP,VK),r=F.multiply(this._scaleMatrix,o,VK);F.clone(r,this._modelMatrix);let s=e.context,a=Ubt(this),l=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||l||!c(t)||!t.show,f=this._command;if(!c(f.vertexArray)){let p=da.createGeometry(new da({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Be.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|l<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),l&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[Qh,UP,AV]}),m=new He({defines:p,sources:[Qh,UP,TV]});this._spSkyAtmosphere=en.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function Ubt(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))}hS.prototype.isDestroyed=function(){return!1};hS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),de(this)};var V8=hS;function pS(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new Je({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}pS.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;if(T.defined("this.sources",a),Object.values(Go.FaceName).some(u=>!c(a[u])))throw new C("this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let l=typeof a.positiveX;if(Object.values(Go.FaceName).some(u=>typeof a[u]!==l))throw new C("this.sources properties must all be the same type.");typeof a.positiveX=="string"?lL(r,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Go({context:r,source:a}))}let s=this._command;if(!c(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),l=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:l,bufferUsage:Be.STATIC_DRAW}),s.renderState=ze.fromCache({blending:un.ALPHA_BLEND})}if(!c(s.shaderProgram)||this._useHdr!==t){let a=new He({defines:[t?"HDR":""],sources:[CV]});s.shaderProgram=en.fromCache({context:r,vertexShaderSource:EV,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(c(this._cubeMap))return s};pS.prototype.isDestroyed=function(){return!1};pS.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(),de(this)};function mS(e){return tn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}pS.createEarthSkyBox=function(){return new pS({sources:{positiveX:mS("px"),negativeX:mS("mx"),positiveY:mS("py"),negativeY:mS("my"),positiveZ:mS("pz"),negativeZ:mS("mz")}})};var z8=pS;function II(){this.show=!0,this._drawCommand=new Je({primitiveType:Me.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(II.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Vbt=new z,zbt=new z,Hbt=new se,PI=new se;II.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(!c(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 S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new Rt({context:o,width:S,height:S,pixelFormat:ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let P=this,M={u_radiusTS:function(){return P._radiusTS}};this._commands.computeCommand=new cl({fragmentShaderSource:wV,outputTexture:this._texture,uniformMap:M,persists:!1,owner:this,postExecute:function(){P._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!c(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let P=bt.createVertexBuffer({context:o,typedArray:v,usage:Be.STATIC_DRAW}),M=[{index:S.direction,vertexBuffer:P,componentsPerAttribute:2,normalize:!0,componentDatatype:$.UNSIGNED_BYTE}],R=bt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:M,indexBuffer:R}),a.shaderProgram=en.fromCache({context:o,vertexShaderSource:vV,fragmentShaderSource:SV,attributeLocations:S}),a.renderState=ze.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let l=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(l,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=O.SOLAR_RADIUS+O.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=Hi.computeActualEllipsoidPosition(e,l,PI),g=d.magnitude(d.subtract(p,e.camera.position,PI)),m=o.uniformState.projection,y=Hbt;y.x=0,y.y=0,y.z=-g,y.w=1;let b=F.multiplyByVector(m,y,PI),x=Hi.clipToGLWindowCoordinates(t.viewport,b,Vbt);y.x=O.SOLAR_RADIUS;let A=F.multiplyByVector(m,y,PI),E=Hi.clipToGLWindowCoordinates(t.viewport,A,zbt);return this._size=z.magnitude(z.subtract(E,x,PI)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};II.prototype.isDestroyed=function(){return!1};II.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(),de(this)};var H8=II;var jxe=jr(lO(),1);function Gbt(e,t,n){return T.typeOf.string("samplerUniformName",e),T.typeOf.string("matrixUniformName",t),T.typeOf.string("styleUniformName",n),` 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 G8=Gbt;var jbt={modifyFragmentShader:function(t){return t=He.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}}},OI=jbt;var Ux={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function RI(e){T.typeOf.object("options",e),T.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=G.clone(G.DARKGRAY),this._highlightColor=G.clone(G.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=Ux.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=e.opaquePass??De.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.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=e.splitDirection??qr.NONE,this._splittingEnabled=!1,this._error=void 0,Wbt(this,e)}Object.defineProperties(RI.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return G.clone(this._highlightColor)},set:function(e){this._highlightColor=G.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function Wbt(e,t){let n=KA.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&&c(n.batchTableBinary)&&(n.styleableProperties=cg.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),c(n.draco)){let a=n.draco;e._decodingState=Ux.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;c(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;c(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;c(r)&&(c(r.constantColor)&&(e._constantColor=G.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;c(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 qbt=new d,Ybt=new d,Xbt=new d,Hxe,j8;function Kbt(e){if(!c(j8)){Hxe=new jxe.default(0),j8=new Array(e);for(let t=0;t<e;++t)j8[t]=Hxe.random()}return j8}function $bt(e){let n=e.length/3,i=Math.min(n,20),o=Kbt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,qbt),l=d.fromElements(s,s,s,Ybt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,Xbt);d.minimumByComponent(a,p,a),d.maximumByComponent(l,p,l)}let u=le.fromCornerPoints(a,l);return u.radius+=O.EPSILON2,u}function Gxe(e,t){let n=$.fromTypedArray(e);return n===$.INT||n===$.UNSIGNED_INT||n===$.DOUBLE?(dt("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 Zbt=new se,Qbt=new se,Jbt=new G,Wxe=0,W8=1,WK=2,qxe=3,ext=4,zK=new F,txt=new F;function nxt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,l=i.batchIds,u=i.styleableProperties,f=c(u),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,b=e._octEncodedRange,x=e._isRGB565,A=e._isTranslucent,E=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,P,M,R=[],L={};if(e._styleableShaderAttributes=L,f){let V=ext;for(let j in u)if(u.hasOwnProperty(j)){let U=u[j],q=Gxe(U.typedArray,j);P=U.componentCount,M=$.fromTypedArray(q);let X=bt.createVertexBuffer({context:n,typedArray:q,usage:Be.STATIC_DRAW});e._geometryByteLength+=X.sizeInBytes;let te={index:V,vertexBuffer:X,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(te),L[j]={location:V,componentCount:P},++V}}let B=bt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Be.STATIC_DRAW});e._geometryByteLength+=B.sizeInBytes;let _;E&&(_=bt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let w;S&&(w=bt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D;v&&(l.typedArray=Gxe(l.typedArray,"batchIds"),D=bt.createVertexBuffer({context:n,typedArray:l.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes);let I=[];if(h?M=$.UNSIGNED_SHORT:p?M=y<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT:M=$.FLOAT,I.push({index:Wxe,vertexBuffer:B,componentsPerAttribute:3,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=$bt(r.typedArray)),E)if(x)I.push({index:W8,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:$.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=A?4:3;I.push({index:W8,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(P=2,M=$.UNSIGNED_BYTE):m?(P=2,M=b<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT):(P=3,M=$.FLOAT),I.push({index:WK,vertexBuffer:w,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:qxe,vertexBuffer:D,componentsPerAttribute:1,componentDatatype:$.fromTypedArray(l.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let N=new ni({context:n,attributes:I}),k={depthTest:{enabled:!0}},H={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===De.CESIUM_3D_TILE&&(k.stencilTest=kt.setCesium3DTileBit(),k.stencilMask=kt.CESIUM_3D_TILE_MASK,H.stencilTest=kt.setCesium3DTileBit(),H.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(k),e._translucentRenderState=ze.fromCache(H),e._drawCommand=new Je({boundingVolume:new le,cull:e._cull,modelMatrix:new F,primitiveType:Me.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:A?e._translucentRenderState:e._opaqueRenderState,pass:A?De.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function ixt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Zbt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let l=t.camera.frustum,u;t.mode===oe.SCENE2D||l instanceof on?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}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(!c(a))return G.TRANSPARENT;let l=G.clone(a.edgeColor,Jbt);return l.alpha=a.edgeWidth,l},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!c(a))return F.IDENTITY;let l=e.clippingPlanesOriginMatrix??e._modelMatrix;F.multiply(n.uniformState.view3D,l,zK);let u=F.multiply(zK,a.modelMatrix,zK);return F.inverseTranspose(u,txt)}};OI.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=Qbt;if(c(e._quantizedVolumeScale)){let l=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(l,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),c(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function HK(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 GK(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 jK(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 oxt={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 rxt(e,t,n){let i,o,r,s=t.context,a=c(n),l=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,b=e._hasBatchIds,x=e._backFaceCulling,A=e._normalShading,E=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,P,M,R,L=g,B=We(oxt),_={},w=e._styleableShaderAttributes;for(o in w)w.hasOwnProperty(o)&&(r=w[o],B[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let ue={translucent:!1},ye="(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)";P=n.getColorShaderFunction(`getColorFromStyle${ye}`,B,ue),M=n.getShowShaderFunction(`getShowFromStyle${ye}`,B,ue),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,B,ue),c(P)&&ue.translucent&&(L=!0)}e._styleTranslucent=L;let D=c(P),I=c(M),N=c(R),k=e.isClipped,H=[],V=[];D&&(HK(P,H),GK(P,V)),I&&(HK(M,H),GK(M,V)),N&&(HK(R,H),GK(R,V));let j=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in w)if(w.hasOwnProperty(o)){r=w[o];let ue=H.indexOf(r.location)>=0,ye=jK(E,r.location);ye.enabled=ue}let q=m&&(!D||j);if(m){let ue=jK(E,W8);ue.enabled=q}let X=y&&(A||x||U);if(y){let ue=jK(E,WK);ue.enabled=X}let te={a_position:Wxe};q&&(te.a_color=W8),X&&(te.a_normal=WK),b&&(te.a_batchId=qxe);let K="",Z=H.length;for(i=0;i<Z;++i){let ue=H[i];r=_[ue];let ye=r.componentCount,Ae=`czm_3dtiles_property_${ue}`,Pe;ye===1?Pe="float":Pe=`vec${ye}`,K+=`in ${Pe} ${Ae}; -`,te[Ae]=r.location}ixt(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; -`,v&&(ee+=`float u_geometricError; -float u_depthMultiplier; -`),ee+=K,q&&(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; -`),X&&(f||h?ee+=`in vec2 a_normal; -`:ee+=`in vec3 a_normal; -`),b&&(ee+=`in float a_batchId; -`),(l||u||h)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; -`),D&&(ee+=P),I&&(ee+=M),N&&(ee+=R),ee+=`void main() -{ - u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; - tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; -`,v&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; - u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; -`),q?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; -`,l||u?ee+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; -`:ee+=` vec3 position = a_position; -`,ee+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); -`,X?(f?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); -`,D&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal); -`),I&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); -`),N?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; -`:v?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; -`,X&&A&&(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); -`,X&&x&&(ee+=` float visible = step(-normalEC.z, 0.0); - gl_Position *= visible; - gl_PointSize *= visible; -`),I&&(ee+=` gl_Position.w *= float(show); - gl_PointSize *= float(show); -`),ee+=`} -`;let me=`in vec4 v_color; -`;k&&(me+=`uniform highp sampler2D u_clippingPlanes; -uniform mat4 u_clippingPlanesMatrix; -uniform vec4 u_clippingPlanesEdgeStyle; -`,me+=` -`,me+=jy(S,s),me+=` -`),me+=`void main() -{ - out_FragColor = czm_gammaCorrect(v_color); -`,k&&(me+=G8("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`} -`,e.splitDirection!==qr.NONE&&(me=OI.modifyFragmentShader(me)),c(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),c(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let xe=e._drawCommand;c(xe.shaderProgram)&&xe.shaderProgram.destroy(),xe.shaderProgram=en.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:me,attributeLocations:te});try{xe.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 sxt(e,t){if(e._decodingState===Ux.READY)return!1;if(e._decodingState===Ux.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=yg.decodePointCloud(i,t);c(o)&&(e._decodingState=Ux.DECODING,o.then(function(r){e._decodingState=Ux.READY;let s=c(r.POSITION)?r.POSITION.array:void 0,a=c(r.RGB)?r.RGB.array:void 0,l=c(r.RGBA)?r.RGBA.array:void 0,u=c(r.NORMAL)?r.NORMAL.array:void 0,f=c(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=c(s)&&c(r.POSITION.data.quantization),p=c(u)&&c(r.NORMAL.data.quantization);if(h){let b=r.POSITION.data.quantization,x=b.range;e._quantizedVolumeScale=d.fromElements(x,x,x),e._quantizedVolumeOffset=d.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let x=r[b];c(g)||(g={}),g[b]={typedArray:x.array,componentCount:x.data.componentsPerAttribute}}c(s)&&(n.positions={typedArray:s});let y=l??a;c(y)&&(n.colors={typedArray:y}),c(u)&&(n.normals={typedArray:u}),c(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=Ux.FAILED,e._error=r}))}return!0}var axt=new se,cxt=new d;RI.prototype.update=function(e){let t=e.context;if(c(this._error)){let u=this._error;throw this._error=void 0,u}if(sxt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(nxt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),c(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),c(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=F.getColumn(u,3,axt);se.equals(p,se.UNIT_W)||Ot.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;F.multiplyByPoint(u,h,h);let p=F.getScale(u,cxt);f.radius*=d.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!==qr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&rxt(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?De.TRANSLUCENT:this._opaquePass;let a=e.commandList,l=e.passes;(l.render||l.pick)&&a.push(this._drawCommand)};RI.prototype.isDestroyed=function(){return!1};RI.prototype.destroy=function(){let e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),de(this)};var q8=RI;function zx(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.intervals",e.intervals),this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.shadows=e.shadows??Tn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Mp(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Ng,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(zx.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(c(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function lxt(e){return`uniform vec4 czm_pickColor; -${e}`}function uxt(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function fxt(){return"czm_pickColor"}zx.prototype.makeStyleDirty=function(){this._styleDirty=!0};zx.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var dxt=new Q;function YK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function Vx(e,t){return e._intervals.indexOf(t.start)}function hxt(e,t){let n=e._intervals,i=e._clock,o=YK(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,dxt),a=n.indexOf(s),l=Vx(e,t);return a===l&&(o>=0?++a:--a),n.get(a)}function mxt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function pxt(e,t,n){let i=YK(e),o=Vx(e,t),r=Vx(e,n);return i>=0?o>=r:o<=r}function Xxe(e,t){return function(n){let i=c(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 _xt(e,t,n){let i=Vx(e,t),o=e._frames,r=o[i];if(!c(r)){let s=t.data.transform,a=c(s)?F.fromArray(s):void 0,l=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ei(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:l},o[i]=r,we.fetchArrayBuffer({url:l}).then(function(u){r.pointCloud=new q8({arrayBuffer:u,cull:!0,fragmentShaderLoaded:lxt,uniformMapLoaded:uxt(e),pickIdLoaded:fxt})}).catch(Xxe(e,l))}return r}function gxt(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 yxt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(c(o)&&!t.ready){let r=i.commandList,s=r.length;if(Kxe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ei()-t.timestamp)/1e3;gxt(e,a)}}t.touchedFrameNumber=i.frameNumber}var bxt=new F;function xxt(e,t){let n=e.shading;return c(n)&&c(n.baseResolution)?n.baseResolution:c(t.boundingSphere)?O.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Txt(e){let t=e.shading;return c(t)&&c(t.maximumAttenuation)?t.maximumAttenuation:10}var Axt=new Mp;function Kxe(e,t,n,i){let o=e.shading??Axt,r=t.pointCloud,s=t.transform??F.IDENTITY;r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,bxt),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=xxt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Txt(e);try{r.update(i)}catch(a){Xxe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function qK(e,t,n,i){let o=_xt(e,t,i);yxt(e,o,n,i)}function Cxt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function $xe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(c(r)&&(!c(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),c(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function Ext(e,t){let n=Vx(e,t),i=e._frames[n];if(c(i)&&i.ready)return i}function Yxe(e,t,n,i,o){return c(n)?n.ready?!0:(qK(e,t,i,o),n.ready):!1}function Sxt(e,t,n,i,o){let r,s,a,l=e._intervals,u=e._frames,f=Vx(e,n),h=Vx(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=l.get(r),a=u[r],Yxe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=l.get(r),a=u[r],Yxe(e,s,a,i,o))return s;return t}function wxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];c(s)&&c(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var _S={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};zx.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;c(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),c(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=c(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)&&wxt(this,o,s),_S.timeSinceLoad=t,_S.isClipped=r;let a=this.shading,l=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,g=mxt(this);if(!c(g))return;let m=!1,y=YK(this),b=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!c(h)||b)&&(h=g),(!c(p)||m||pxt(this,g,p))&&(p=hxt(this,g)),h=Sxt(this,h,g,_S,e);let x=Ext(this,h);c(x)||(qK(this,h,_S,e),x=this._lastRenderedFrame),c(x)&&Kxe(this,x,_S,e),c(p)&&qK(this,p,_S,e);let A=this;c(x)&&!c(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),c(x)&&x!==this._lastRenderedFrame&&A.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return A.frameChanged.raiseEvent(A),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=x;let E=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;E>S&&$xe(this,Cxt(e));let P=u.length-f;c(a)&&a.attenuation&&a.eyeDomeLighting&&P>0&&l.update(e,f,a,this.boundingSphere)};zx.prototype.isDestroyed=function(){return!1};zx.prototype.destroy=function(){return $xe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var MI=zx;function Jxe(e,t){if(c(t)){let n=t.clock;c(n)&&n.getValue(e)}}function vxt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!c(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 eTe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,c(e._scene)&&(e._scene.pixelRatio=t),t}function tTe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=eTe(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 nTe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;c(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Co(e,t){if(!c(e))throw new C("container is required.");e=Rn(e),t=t??W.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=zt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=zt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(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 l=c(t.creditContainer)?Rn(t.creditContainer):n;l.appendChild(a);let u=c(t.creditViewport)?Rn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=l,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,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 pe,this._allowDataSourcesToSuspendAnimation=!0,this._clock=c(t.clock)?t.clock:new mm,c(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),tTe(this);try{let p=t.ellipsoid??ie.default,g=new U8({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly: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=d.UNIT_Z,eTe(this),nTe(this);let m=t.globe;c(m)||(m=new xz(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Tn.RECEIVE_ONLY);let y=t.skyBox;!c(y)&&ie.WGS84.equals(p)&&(y=z8.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new H8,ie.WGS84.equals(p)&&(g.moon=new Dz));let b=t.skyAtmosphere;!c(b)&&ie.WGS84.equals(p)&&(b=new V8(p),b.show=t.globe!==!1&&m.show),b!==!1&&(g.skyAtmosphere=b);let x=t.baseLayer;if(t.globe!==!1&&x!==!1&&(c(x)||(x=mc.fromWorldImagery()),g.imageryLayers.add(x)),c(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),c(t.terrain)&&t.globe!==!1){if(c(t.terrainProvider))throw new C("Specify either options.terrainProvider or options.terrain.");g.setTerrain(t.terrain)}this._screenSpaceEventHandler=new $f(i),c(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=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let A=this;this._onRenderError=function(R,L){A._useDefaultRenderLoop=!1,A._renderLoopRunning=!1,A._showRenderLoopErrors&&A.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,L)},g.renderError.addEventListener(this._onRenderError);let E=t.dataSources,S=!1;c(E)||(E=new W3,S=!0);let v=new Mk({scene:g,dataSourceCollection:E}),P=new Ar;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=E,this._destroyDataSourceCollection=S,this._dataSourceDisplay=v,this._eventHelper=P,this._canAnimateUpdateCallback=this._updateCanAnimate,P.add(this._clock.onTick,Co.prototype._onTick,this),P.add(g.morphStart,Co.prototype._clearTrackedObject,this),P.add(E.dataSourceAdded,Co.prototype._onDataSourceAdded,this),P.add(E.dataSourceRemoved,Co.prototype._onDataSourceRemoved,this),P.add(g.postRender,Co.prototype._postRender,this);let M=E.length;for(let R=0;R<M;R++)this._dataSourceAdded(E,E.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),P.add(E.dataSourceAdded,Co.prototype._dataSourceAdded,this),P.add(E.dataSourceRemoved,Co.prototype._dataSourceRemoved,this)}catch(p){throw f&&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(Co.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){if(e<=0)throw new C("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&vxt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new C("resolutionScale must be greater than 0.");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,XK(this);let t=this.scene,n=t.mode;!c(e)||!c(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(F.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,Jxe(this.clock,e))}}});Co.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 l(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}l(),c(window.addEventListener)&&window.addEventListener("resize",l,!1);let u=c(t),f=c(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=g_(n);u||(typeof n=="string"&&(n=new Error(n)),t=g_({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} -${t} -${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),y.appendChild(b),y.onclick=function(x){y.removeChild(b),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}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(){c(l)&&c(window.removeEventListener)&&window.removeEventListener("resize",l,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Co.prototype.isDestroyed=function(){return!1};Co.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(),c(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()),de(this)};Co.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,tTe(this),nTe(this),this._scene.requestRender())};Co.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Co.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Co.prototype._onEntityCollectionChanged,this)};Co.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Co.prototype._onEntityCollectionChanged,this),c(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Co.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var Dxt=new le;Co.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(c(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??Dxt)===lt.DONE&&i.update(t)}};Co.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)}};Co.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Co.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Jxe(this.clock,e)};Co.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Co.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Co.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}};Co.prototype.zoomTo=function(e,t){return iTe(this,e,{offset:t},!1)};Co.prototype.flyTo=function(e,t){return iTe(this,e,t,!0)};function iTe(e,t,n,i){if(!c(t))throw new C("zoomTarget is required.");XK(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 mc){let s;c(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let l=r.readyEvent.addEventListener(()=>{l(),a(r.getImageryRectangle())})}),s.then(function(a){return DE(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof As||r instanceof MI||r instanceof Bx){e._zoomTarget=r;return}if(r.isLoading&&c(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,c(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function LI(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function XK(e){let t=e._zoomPromise;c(t)&&(LI(e),e._completeZoom(!1))}Co.prototype._postRender=function(){Pxt(this),Ixt(this)};var Zxe=new le;function Pxt(e){let t=e._zoomTarget;if(!c(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){c(o.offset)||(o.offset=new $d(0,-.5,f.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(f,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),LI(e)}if(t instanceof MI){if(c(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof As||t instanceof Bx){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)),LI(e);return}let a=t,l=[];for(let f=0,h=a.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,Zxe);if(p===lt.PENDING)return;p!==lt.FAILED&&l.push(le.clone(Zxe))}if(l.length===0){XK(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(l);e._zoomIsFlight?(LI(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),LI(e),e._completeZoom(!0))}var Qxe=new le;function Ixt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=Y.getValueOrUndefined(t.position,n);if(!c(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Qxe);if(r===lt.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!==lt.FAILED?Qxe:void 0;e._entityView=new Fk(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var Y8=Co;function bS(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Hx=new ce;function Oxt(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}bS.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)Oxt(e,g,p,s)||s.push(new gS(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,Hx);let a=Hx.west,l=Hx.north;r.tileXYToRectangle(i,o,e,Hx);let u=Hx.east,f=Hx.south,h=new Fxt(e,a,f,u,l);for(let p=0;p<s.length;++p){let g=s[p];KK(g.extent,h)&&Bxt(this._maximumLevel,g,h)}};bS.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(yS(i.extent,e)){t=i;break}}return c(t)?NI(void 0,t,e):-1};var Rxt=[],Mxt=[],Lxt=new ce,Nxt=new ce;bS.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Rxt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,Lxt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,Nxt))):t.push(e);let n=Mxt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)FI(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(c(n[i])&&n[i].length===0)return i;return 0};var oTe=new he;bS.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Hx);return ce.center(i,oTe),this.computeMaximumLevelAtPosition(oTe)>=e};bS.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 gS(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(gS.prototype,{nw:{get:function(){return this._nw||(this._nw=new gS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new gS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new gS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new gS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Fxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function KK(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 Bxt(e,t,n){for(;t.level<e;)if(X8(t.nw.extent,n))t=t.nw;else if(X8(t.ne.extent,n))t=t.ne;else if(X8(t.sw.extent,n))t=t.sw;else if(X8(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=Mo(t.rectangles,n.level,kxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function kxt(e,t){return e.level-t}function X8(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function yS(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function NI(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&yS(t._nw.extent,n),s=t._ne&&yS(t._ne.extent,n),a=t._sw&&yS(t._sw.extent,n),l=t._se&&yS(t._se.extent,n);if(r+s+a+l>1){r&&(i=Math.max(i,NI(t,t._nw,n))),s&&(i=Math.max(i,NI(t,t._ne,n))),a&&(i=Math.max(i,NI(t,t._sw,n))),l&&(i=Math.max(i,NI(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:l?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];yS(a,n)&&(i=a.level)}t=t.parent}return i}function FI(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||KK(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]=Uxt(e[s.level],s)}FI(e,t._nw,n),FI(e,t._ne,n),FI(e,t._sw,n),FI(e,t._se,n)}function Uxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];KK(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 $m=bS;var Vxt=15;function rTe(e){this.ellipsoid=e.ellipsoid??ie.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}rTe.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 zxt(e,t){let n=t.copyrightText;c(n)&&(e.credit=new At(n));let i=t.spatialReference,o=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 Ki(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new z(r.xmin,r.ymin),s.rectangleNortheastInMeters=new z(r.xmax,r.ymax),e.tilingScheme=new fs(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!c(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?ih.LERC:ih.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new $m(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new $m(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=us.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."),c(t.minValues)&&c(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Hxt(e,t,n){try{let i=await t.fetchJson();zxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,o),i}}function u0(e){e=e??W.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 pe}Object.defineProperties(u0.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}}});u0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new rTe(t);await Hxt(o,i);let r=new u0(t);return o.build(r),r._resource=n,r};u0.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&&!c($K(this,n+1,e*2,t*2))){let h=sTe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let l=o.fetchArrayBuffer();if(!c(l)||!c(s))return;let u=this,f=this._tilesAvailable;return Promise.all([l,s]).then(function(h){return new dc({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):Vxt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(c(a)&&a.state===Zn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Zn.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function $K(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}u0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};u0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=$K(this,n,e,t);if(c(i))return i;sTe(this,n,e,t)};u0.prototype.loadTileDataAvailability=function(e,t,n){};function Gxt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],l={startX:e.x,startY:e.y,endX:0,endY:0},u=new z(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,g=h?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new z(u.x,e.y)),--u.x,--p,l.endX=u.x):u.x===o?(l.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){h=!0;break}h?(a.push(new z(e.x,u.y)),--u.y,l.endY=u.y):u.y===r?(l.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:l,value:s}}function jxt(e,t,n,i,o){let r=[];if(o.every(function(l){return l===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new z(0,0)];for(;a.length>0;){let l=a.pop(),u=Gxt(l,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function sTe(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}`,l=e._availableCache;if(c(l[a]))return l[a];let u=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return c(h)?(h=h.then(function(p){let g=jxt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let b=g[y];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return $K(e,t,n,i)}),l[a]={promise:h,request:u},h=h.finally(function(p){return delete l[a],p}),{promise:h,request:u}):{}}var aTe=u0;var cTe="https://dev.virtualearth.net/REST/v1/Locations";function ZK(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new C("options.key is required.");this._key=t;let n={key:t};c(e.culture)&&(n.culture=e.culture),this._resource=new we({url:cTe,queryParameters:n}),this._credit=new At('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(ZK.prototype,{url:{get:function(){return cTe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});ZK.prototype.geocode=async function(e){return T.typeOf.string("query",e),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],l=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,l)}})})};var lTe=ZK;function QK(){}Object.defineProperties(QK.prototype,{credit:{get:function(){}}});QK.prototype.geocode=function(e){T.typeOf.string("query",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:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var uTe=QK;var Wxt=new se,fTe=new d,xS=new d;function qxt(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,l){c(l)||(l=new d);let u=(a-i)*o;return d.lerp(r,s,u,l)}}return function(i,o){c(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Wxt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let l,u,f,h,p;return r===0?(l=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],l,fTe),d.multiplyByScalar(h,.5,h),p=F.multiplyByVector(xb.hermiteCoefficientMatrix,a,a)):r===t.length-2?(l=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],fTe),d.multiplyByScalar(f,.5,f),p=F.multiplyByVector(xb.hermiteCoefficientMatrix,a,a)):(l=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=F.multiplyByVector(f0.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(l,p.x,o),d.multiplyByScalar(u,p.y,xS),d.add(o,xS,o),d.multiplyByScalar(f,p.z,xS),d.add(o,xS,o),d.multiplyByScalar(h,p.w,xS),d.add(o,xS,o)}}var Yxt=new d,Xxt=new d;function f0(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(T.defined("points",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("points.length",t.length,2),T.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(c(i)||(i=Yxt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!c(o))){let r=t.length-1;o=Xxt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=qxt(this),this._lastTimeIndex=0}Object.defineProperties(f0.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}}});f0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);f0.prototype.findTimeInterval=Ni.prototype.findTimeInterval;f0.prototype.wrapTime=Ni.prototype.wrapTime;f0.prototype.clampTime=Ni.prototype.clampTime;f0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var dTe=f0;var K8={};K8.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){if(!c(e))throw new C("threshold is required.");if(!c(t))throw new C("keepAbove is required.");if(!c(n))throw new C("u0 is required.");if(!c(i))throw new C("u1 is required.");if(!c(o))throw new C("u2 is required.");c(r)?r.length=0:r=[];let s,a,l;t?(s=n<e,a=i<e,l=o<e):(s=n>e,a=i>e,l=o>e);let u=s+a+l,f,h,p,g,m,y;return u===1?s?(f=(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)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):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))):l&&(m=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(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(m)):!a&&i!==e?(y=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(f)):!l&&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)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};K8.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,l){if(!c(e))throw new C("x is required.");if(!c(t))throw new C("y is required.");if(!c(n))throw new C("x1 is required.");if(!c(i))throw new C("y1 is required.");if(!c(o))throw new C("x2 is required.");if(!c(r))throw new C("y2 is required.");if(!c(s))throw new C("x3 is required.");if(!c(a))throw new C("y3 is required.");let u=n-s,f=s-o,h=r-a,p=i-a,g=1/(h*u+f*p),m=t-a,y=e-s,b=(h*y+f*m)*g,x=(-p*y+u*m)*g,A=1-b-x;return c(l)?(l.x=b,l.y=x,l.z=A,l):new d(b,x,A)};K8.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,l){T.typeOf.number("x00",e),T.typeOf.number("y00",t),T.typeOf.number("x01",n),T.typeOf.number("y01",i),T.typeOf.number("x10",o),T.typeOf.number("y10",r),T.typeOf.number("x11",s),T.typeOf.number("y11",a);let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=u/h,g=f/h;if(p>=0&&p<=1&&g>=0&&g<=1)return c(l)||(l=new z),l.x=e+p*(n-e),l.y=t+p*(i-t),l};var d0=K8;function h0(e){if(!c(e)||!c(e.quantizedVertices))throw new C("options.quantizedVertices is required.");if(!c(e.indices))throw new C("options.indices is required.");if(!c(e.minimumHeight))throw new C("options.minimumHeight is required.");if(!c(e.maximumHeight))throw new C("options.maximumHeight is required.");if(!c(e.maximumHeight))throw new C("options.maximumHeight is required.");if(!c(e.boundingSphere))throw new C("options.boundingSphere is required.");if(!c(e.horizonOcclusionPoint))throw new C("options.horizonOcclusionPoint is required.");if(!c(e.westIndices))throw new C("options.westIndices is required.");if(!c(e.southIndices))throw new C("options.southIndices is required.");if(!c(e.eastIndices))throw new C("options.eastIndices is required.");if(!c(e.northIndices))throw new C("options.northIndices is required.");if(!c(e.westSkirtHeight))throw new C("options.westSkirtHeight is required.");if(!c(e.southSkirtHeight))throw new C("options.southSkirtHeight is required.");if(!c(e.eastSkirtHeight))throw new C("options.eastSkirtHeight is required.");if(!c(e.northSkirtHeight))throw new C("options.northSkirtHeight is required.");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=Z8(e.westIndices,o,t),this._southIndices=Z8(e.southIndices,r,t),this._eastIndices=Z8(e.eastIndices,o,t),this._northIndices=Z8(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(h0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return c(this._mesh)}}});var $8=[];function Z8(e,t,n){$8.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)$8[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?($8.sort(t),Fe.createTypedArray(n,$8)):e}var hTe="createVerticesFromQuantizedTerrainMesh",Kxt=new bi(hTe),$xt=new bi(hTe,Fm.maximumAsynchronousTasks);h0.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(a?$xt:Kxt).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:l,exaggeration:r,exaggerationRelativeHeight:s});if(!c(h))return;let p=this;return Promise.resolve(h).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Fe.createTypedArray(y,g.indices),x=new Float32Array(g.vertices),A=g.center,E=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,P=p._orientedBoundingBox,M=d.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,L=Zc.clone(g.encoding);return p._mesh=new oh(A,x,b,g.indexCountWithoutSkirts,m,E,S,v,M,R,P,L,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 Zxt=new bi("upsampleQuantizedTerrainMesh",Fm.maximumAsynchronousTasks);h0.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new C("tilingScheme is required.");if(!c(t))throw new C("thisX is required.");if(!c(n))throw new C("thisY is required.");if(!c(i))throw new C("thisLevel is required.");if(!c(o))throw new C("descendantX is required.");if(!c(r))throw new C("descendantY is required.");if(!c(s))throw new C("descendantLevel is required.");if(s-i>1)throw new C("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=Zxt.scheduleTask({vertices:l.vertices,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=Math.min(this._westSkirtHeight,this._eastSkirtHeight);m=Math.min(m,this._southSkirtHeight),m=Math.min(m,this._northSkirtHeight);let y=u?m*.5:this._westSkirtHeight,b=f?m*.5:this._southSkirtHeight,x=u?this._eastSkirtHeight:m*.5,A=f?this._northSkirtHeight:m*.5,E=this._credits;return Promise.resolve(g).then(function(S){let v=new Uint16Array(S.vertices),P=Fe.createTypedArray(v.length/3,S.indices),M;return c(S.encodedNormals)&&(M=new Uint8Array(S.encodedNormals)),new h0({quantizedVertices:v,indices:P,encodedNormals:M,minimumHeight:S.minimumHeight,maximumHeight:S.maximumHeight,boundingSphere:le.clone(S.boundingSphere),orientedBoundingBox:Pn.clone(S.orientedBoundingBox),horizonOcclusionPoint:d.clone(S.horizonOcclusionPoint),westIndices:S.westIndices,southIndices:S.southIndices,eastIndices:S.eastIndices,northIndices:S.northIndices,westSkirtHeight:y,southSkirtHeight:b,eastSkirtHeight:x,northSkirtHeight:A,childTileMask:0,credits:E,createdByUpsampling:!0})})};var JK=32767,mTe=new d;h0.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1);i*=JK;let o=O.clamp((n-e.south)/e.height,0,1);return o*=JK,c(this._mesh)?tTt(this,i,o):nTt(this,i,o)};function pTe(e,t,n,i,o,r,s,a){let l=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=l&&e<=u&&t>=f&&t<=h}var Qxt=new z,Jxt=new z,eTt=new z;function tTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,Qxt),g=r.decodeTextureCoordinates(o,f,Jxt),m=r.decodeTextureCoordinates(o,h,eTt);if(pTe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=d0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,mTe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}}function nTt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=i[u],g=i[f],m=i[h],y=o[u],b=o[f],x=o[h];if(pTe(t,n,p,y,g,b,m,x)){let A=d0.computeBarycentricCoordinates(t,n,p,y,g,b,m,x,mTe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let E=A.x*r[u]+A.y*r[f]+A.z*r[h];return O.lerp(e._minimumHeight,e._maximumHeight,E/JK)}}}}h0.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new C("thisX is required.");if(!c(t))throw new C("thisY is required.");if(!c(n))throw new C("childX is required.");if(!c(i))throw new C("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};h0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var TS=h0;function iTt(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 gTe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ie.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=[]}gTe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=c(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 yTe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,c(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 y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let l=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new fs({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let f;c(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:c(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),c(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),c(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(c(p)&&!c(h)){g=new $m(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let b=p[y],x=e.tilingScheme.getNumberOfYTilesAtLevel(y);c(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let A=0;A<b.length;++A){let E=b[A],S=x-E.endY-1,v=x-E.startY-1;e.overallAvailability[y].push([E.startX,S,E.endX,v]),g.addAvailableTileRange(y,E.startX,S,E.endX,v)}}}else c(h)&&(f=new $m(e.tilingScheme,u),g=new $m(e.tilingScheme,u),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,c(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new iTt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:l,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return c(m)?c(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await n$(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function oTt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(c(t)&&(i+=` -${t.message}`),e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,i),e.previousError.retry)return n$(e,n);throw new ae(i)}async function rTt(e,t,n){await yTe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new $m(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 l=s[a];o.addAvailableTileRange(r,l[0],l[1],l[2],l[3])}}}if(e.attribution.length>0){let o=new At(e.attribution);e.tileCredits.push(o)}return!0}async function n$(e,t){try{let n=await e.layerJsonResource.fetchJson();return rTt(e,n,t)}catch(n){return c(n)&&n.statusCode===404?(await yTe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):oTt(e,n,t)}}function ph(e){e=e??W.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new At(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 e$={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function _Te(e){return!c(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 sTt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new dc({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 aTt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,l=3,u=l+1,f=Float64Array.BYTES_PER_ELEMENT*l,h=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,b=y*m,x=new DataView(t),A=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let E=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new le(new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0)),x.getFloat64(a+f,!0));a+=h;let P=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let M=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,M*3);a+=M*g,M>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,b=y*m);let L=R.subarray(0,M),B=R.subarray(M,2*M),_=R.subarray(M*2,3*M);Ln.zigZagDeltaDecode(L,B,_),a%y!==0&&(a+=y-a%y);let w=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Fe.createTypedArrayFromArrayBuffer(M,t,a,w*m);a+=w*b;let I=0,N=D.length;for(let ue=0;ue<N;++ue){let ye=D[ue];D[ue]=I-ye,ye===0&&++I}let k=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Fe.createTypedArrayFromArrayBuffer(M,t,a,k);a+=k*y;let V=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=Fe.createTypedArrayFromArrayBuffer(M,t,a,V);a+=V*y;let U=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let q=Fe.createTypedArrayFromArrayBuffer(M,t,a,U);a+=U*y;let X=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Fe.createTypedArrayFromArrayBuffer(M,t,a,X);a+=X*y;let K,Z;for(;a<x.byteLength;){let ue=x.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=x.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ue===e$.OCT_VERTEX_NORMALS&&e._requestVertexNormals)K=new Uint8Array(t,a,M*2);else if(ue===e$.WATER_MASK&&e._requestWaterMask)Z=new Uint8Array(t,a,ye);else if(ue===e$.METADATA&&e._requestMetadata){let Ae=x.getUint32(a,!0);if(Ae>0){let Ee=sr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ae).available;if(c(Ee))for(let Ve=0;Ve<Ee.length;++Ve){let je=n+Ve+1,it=Ee[Ve],Dt=e._tilingScheme.getNumberOfYTilesAtLevel(je);for(let Gt=0;Gt<it.length;++Gt){let $e=it[Gt],ln=Dt-$e.endY-1,Vt=Dt-$e.startY-1;e.availability.addAvailableTileRange(je,$e.startX,ln,$e.endX,Vt),r.availability.addAvailableTileRange(je,$e.startX,ln,$e.endX,Vt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,o,n),xe=Pn.fromRectangle(me,E,S,e._tilingScheme.ellipsoid);return new TS({center:A,minimumHeight:E,maximumHeight:S,boundingSphere:v,orientedBoundingBox:xe,horizonOcclusionPoint:P,quantizedVertices:R,encodedNormals:K,indices:D,westIndices:H,southIndices:j,eastIndices:q,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:Z,credits:e._tileCredits})}ph.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,l=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!c(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=i$(this,e,t,n,f,u===0);h.result&&(a=!0,l=l.then(()=>h.promise))}return!c(r)&&a?l.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):bTe(this,e,t,n,r,i)};function bTe(e,t,n,i,o,r){if(!c(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 l=[];e._requestVertexNormals&&o.hasVertexNormals&&l.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&l.push("watermask"),e._requestMetadata&&o.hasMetadata&&l.push("metadata");let u,f,h=s[(t+a+i)%s.length],p=o.resource;c(p._ionEndpoint)&&!c(p._ionEndpoint.externalType)?(l.length!==0&&(f={extensions:l.join("-")}),u=_Te(void 0)):u=_Te(l);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(c(g))return g.then(function(m){return c(m)?c(e._heightmapStructure)?sTt(e,m,i,t,n):aTt(e,m,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(ph.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}}});ph.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ph.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await uf.fromAssetId(e);return ph.fromUrl(n,t)};ph.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=new gTe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await n$(i);let o=new ph(t);return i.build(o),o};ph.prototype.getTileDataAvailable=function(e,t,n){if(!c(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(i$(this,e,t,n,i[r],r===0).result)return;return!1};ph.prototype.loadTileDataAvailability=function(e,t,n){if(!c(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=i$(this,e,t,n,i[r],r===0);if(c(s.promise))return s.promise}};function t$(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,l=n/s|0;return{level:r,x:a,y:l}}function i$(e,t,n,i,o,r){if(!c(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},l=o.availabilityTilesLoaded,u=o.availability,f=t$(o,t,n,i);for(;c(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!l.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!c(h))){let p=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN});h=bTe(e,f.x,f.y,f.level,o,p),c(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=t$(o,f.x,f.y,f.level)}return{result:!1}}ph._getAvailabilityTile=t$;var AS=ph;function R_(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let 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 Rl(n),this._workerName="createCircleGeometry"}R_.packedLength=Rl.packedLength;R_.pack=function(e,t,n){return T.typeOf.object("value",e),Rl.pack(e._ellipseGeometry,t,n)};var xTe=new Rl({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Fa={center:new d,radius:void 0,ellipsoid:ie.clone(ie.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};R_.unpack=function(e,t,n){let i=Rl.unpack(e,t,xTe);return Fa.center=d.clone(i._center,Fa.center),Fa.ellipsoid=ie.clone(i._ellipsoid,Fa.ellipsoid),Fa.ellipsoid=ie.clone(i._ellipsoid,xTe._ellipsoid),Fa.height=i._height,Fa.extrudedHeight=i._extrudedHeight,Fa.granularity=i._granularity,Fa.vertexFormat=Ie.clone(i._vertexFormat,Fa.vertexFormat),Fa.stRotation=i._stRotation,Fa.shadowVolume=i._shadowVolume,c(n)?(Fa.semiMajorAxis=i._semiMajorAxis,Fa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Rl(Fa),n):(Fa.radius=i._semiMajorAxis,new R_(Fa))};R_.createGeometry=function(e){return Rl.createGeometry(e._ellipseGeometry)};R_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new R_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(R_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var TTe=R_;function CS(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let 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 kf(n),this._workerName="createCircleOutlineGeometry"}CS.packedLength=kf.packedLength;CS.pack=function(e,t,n){return T.typeOf.object("value",e),kf.pack(e._ellipseGeometry,t,n)};var cTt=new kf({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Fu={center:new d,radius:void 0,ellipsoid:ie.clone(ie.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};CS.unpack=function(e,t,n){let i=kf.unpack(e,t,cTt);return Fu.center=d.clone(i._center,Fu.center),Fu.ellipsoid=ie.clone(i._ellipsoid,Fu.ellipsoid),Fu.height=i._height,Fu.extrudedHeight=i._extrudedHeight,Fu.granularity=i._granularity,Fu.numberOfVerticalLines=i._numberOfVerticalLines,c(n)?(Fu.semiMajorAxis=i._semiMajorAxis,Fu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new kf(Fu),n):(Fu.radius=i._semiMajorAxis,new CS(Fu))};CS.createGeometry=function(e){return kf.createGeometry(e._ellipseGeometry)};var ATe=CS;function lTt(e){return e=e??W.EMPTY_OBJECT,AS.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Q8=lTt;function uTt(e){return e=e??W.EMPTY_OBJECT,AS.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ie.WGS84})}var ES=uTt;function SS(e){e=e??W.EMPTY_OBJECT,T.defined("options.callback",e.callback),T.defined("options.width",e.width),T.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe;let n=e.credit;typeof n=="string"&&(n=new At(n)),this._credit=n}Object.defineProperties(SS.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}}});SS.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!c(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let l=a;return Array.isArray(l)&&(l=new Float64Array(l)),new dc({buffer:l,width:r,height:s})})};SS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};SS.prototype.getTileDataAvailable=function(e,t,n){};SS.prototype.loadTileDataAvailability=function(e,t,n){};var CTe=SS;var fTt=1953029805,dTt=2917034100;function o$(e,t){if(o$.passThroughDataForTesting)return t;T.typeOf.object("key",e),T.typeOf.object("data",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===fTt||o===dTt)return t;let r=new DataView(e),s=0,a=t.byteLength,l=a-a%8,u=n,f,h=8;for(;s<l;)for(h=(h+8)%24,f=h;s<l&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}o$.passThroughDataForTesting=!1;var J8=o$;function ETe(e){this.proxy=e}ETe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var STe=ETe;function wTe(e,t){return Ns("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty(wTe,"EMPTY_OBJECT",{get:function(){return Ns("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),W.EMPTY_OBJECT}});var vTe=wTe;function eH(){C.throwInstantiationError()}Object.defineProperties(eH.prototype,{credit:{get:C.throwInstantiationError}});eH.getCreditsFromResult=function(e){if(c(e.attributions))return e.attributions.map(At.getIonCredit)};eH.prototype.geocode=C.throwInstantiationError;var BI=eH;var hTt={SEARCH:0,AUTOCOMPLETE:1},Gx=Object.freeze(hTt);function DTe(){C.throwInstantiationError()}DTe.createGeometry=function(e){C.throwInstantiationError()};var PTe=DTe;var bTt=jr(r$(),1);function mTt(e,t){return(e&t)!==0}var tl=mTt;var pTt=[1,2,4,8],ITe=15,_Tt=16,gTt=64,yTt=128;function Zm(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}Zm.clone=function(e,t){return c(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 Zm(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Zm.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Zm.prototype.hasSubtree=function(){return tl(this._bits,_Tt)};Zm.prototype.hasImagery=function(){return tl(this._bits,gTt)};Zm.prototype.hasTerrain=function(){return tl(this._bits,yTt)};Zm.prototype.hasChildren=function(){return tl(this._bits,ITe)};Zm.prototype.hasChild=function(e){return tl(this._bits,pTt[e])};Zm.prototype.getChildBitmask=function(){return this._bits&ITe};var tH=Zm;function xTt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var TTt=xTt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\x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1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Bu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=O.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Bu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Bu.fromUrl=async function(e){T.defined("resourceOrUrl",e);let t=e;typeof t!="string"&&!(t instanceof we)&&(T.typeOf.string("resourceOrUrl.url",e.url),t=e.url);let n=we.createIfNeeded(t);n.appendForwardSlash();let i=new Bu;i._resource=n;try{await ATt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${RTe(i,"",1).url}: ${o}`;throw new ae(r)}return i};Bu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;tl(t,r)?tl(e,r)&&(s|=1):(s|=2,tl(e,r)||(s|=1)),i+=s}return i};Bu.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];tl(s,2)?tl(s,1)||(t|=r):(n|=r,tl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Bu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(c(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),c(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var OTe=new bi("decodeGoogleEarthEnterprisePacket");Bu.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=RTe(this,e,t,n).fetchArrayBuffer();if(!c(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return OTe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let x=tH.clone(u[y]),A=y.length;if(A===h)x.setParent(f);else if(A>1){let E=r[y.substring(0,y.length-1)];x.setParent(E)}r[y]=x}else r[y]=null}})})};Bu.prototype.populateSubtree=function(e,t,n,i){let o=Bu.tileXYToQuadKey(e,t,n);return c$(this,o,i)};function c$(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(c(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,l=a[o];if(c(l))return l.then(function(){return s=new ir({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),c$(e,t,s)});if(!c(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(l=e.getQuadTreePacket(o,r.cnodeVersion,n),!!c(l))return a[o]=l,l.then(function(){return s=new ir({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),c$(e,t,s)}).finally(function(){delete a[o]})}Bu.prototype.getTileInformation=function(e,t,n){let i=Bu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Bu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function RTe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var s$,a$;function ATt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!c(a$)){let n=tn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;a$=dT(n).then(function(){s$=window.cesiumGoogleEarthDbRootParser(bTt),c(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return a$.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=s$.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 l=o.buffer.slice(r,s);return OTe.scheduleTask({buffer:l,type:"DbRoot",key:a},[l])}).then(function(n){let i=s$.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,c(i.endSnippet)&&c(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}c(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let l=r[a],u=l.copyrightString;c(u)&&(o[l.providerId]=new At(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=TTt})}var m0=Bu;function jx(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.buffer",e.buffer),T.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),T.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(jx.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var NTe="createVerticesFromGoogleEarthEnterpriseBuffer",CTt=new bi(NTe),ETt=new bi(NTe,Fm.maximumAsynchronousTasks),MTe=new ce,l$=new ce;jx.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,MTe),t.tileXYToRectangle(n,i,o,l$);let u=l.cartographicToCartesian(ce.center(l$)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?ETt:CTt).scheduleTask({buffer:this._buffer,nativeRectangle:MTe,rectangle:l$,relativeToCenter:u,ellipsoid:l,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!c(g))return;let m=this;return g.then(function(y){return m._mesh=new oh(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,le.clone(y.boundingSphere3D),d.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Pn.clone(y.orientedBoundingBox),Zc.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};jx.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1),o=O.clamp((n-e.south)/e.height,0,1);return c(this._mesh)?PTt(this,i,o):RTt(this,i,o,e)};var STt=new bi("upsampleQuantizedTerrainMesh",Fm.maximumAsynchronousTasks);jx.prototype.upsample=function(e,t,n,i,o,r,s){if(T.typeOf.object("tilingScheme",e),T.typeOf.number("thisX",t),T.typeOf.number("thisY",n),T.typeOf.number("thisLevel",i),T.typeOf.number("descendantX",o),T.typeOf.number("descendantY",r),T.typeOf.number("descendantLevel",s),s-i>1)throw new C("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=STt.scheduleTask({vertices:l.vertices,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=this;return g.then(function(y){let b=new Uint16Array(y.vertices),x=Fe.createTypedArray(b.length/3,y.indices),A=m._skirtHeight;return new TS({quantizedVertices:b,indices:x,minimumHeight:y.minimumHeight,maximumHeight:y.maximumHeight,boundingSphere:le.clone(y.boundingSphere),orientedBoundingBox:Pn.clone(y.orientedBoundingBox),horizonOcclusionPoint:d.clone(y.horizonOcclusionPoint),westIndices:y.westIndices,southIndices:y.southIndices,eastIndices:y.eastIndices,northIndices:y.northIndices,westSkirtHeight:A,southSkirtHeight:A,eastSkirtHeight:A,northSkirtHeight:A,childTileMask:0,createdByUpsampling:!0,credits:m._credits})})};jx.prototype.isChildAvailable=function(e,t,n,i){T.typeOf.number("thisX",e),T.typeOf.number("thisY",t),T.typeOf.number("childX",n),T.typeOf.number("childY",i);let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};jx.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var wTt=new z,vTt=new z,DTt=new z,FTe=new d;function PTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,wTt),g=r.decodeTextureCoordinates(o,f,vTt),m=r.decodeTextureCoordinates(o,h,DTt),y=d0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,FTe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}var ITt=Uint16Array.BYTES_PER_ELEMENT,LTe=Uint32Array.BYTES_PER_ELEMENT,u$=Int32Array.BYTES_PER_ELEMENT,OTt=Float32Array.BYTES_PER_ELEMENT,f$=Float64Array.BYTES_PER_ELEMENT;function RTt(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 l=new DataView(o),u=0;for(let v=0;v<r;++v)u+=l.getUint32(u,!0),u+=LTe;u+=LTe,u+=2*f$;let f=O.toRadians(l.getFloat64(u,!0)*180);u+=f$;let h=O.toRadians(l.getFloat64(u,!0)*180);u+=f$;let p=i.width/f/2,g=i.height/h/2,m=l.getInt32(u,!0);u+=u$;let y=l.getInt32(u,!0)*3;u+=u$,u+=u$;let b=new Array(m),x=new Array(m),A=new Array(m),E;for(E=0;E<m;++E)b[E]=s+l.getUint8(u++)*p,x[E]=a+l.getUint8(u++)*g,A[E]=l.getFloat32(u,!0)*6371010,u+=OTt;let S=new Array(y);for(E=0;E<y;++E)S[E]=l.getUint16(u,!0),u+=ITt;for(E=0;E<y;E+=3){let v=S[E],P=S[E+1],M=S[E+2],R=b[v],L=b[P],B=b[M],_=x[v],w=x[P],D=x[M],I=d0.computeBarycentricCoordinates(t,n,R,_,L,w,B,D,FTe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*A[v]+I.y*A[P]+I.z*A[M]}}var kI=jx;var ed={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},nH=new Q;function iH(){this._terrainCache={},this._lastTidy=Q.now()}iH.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};iH.prototype.get=function(e){let n=this._terrainCache[e];if(c(n))return delete this._terrainCache[e],n.buffer};iH.prototype.tidy=function(){if(Q.now(nH),Q.secondsDifference(nH,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(nH,r.timestamp)>10&&delete e[o]}Q.clone(nH,this._lastTidy)}};function p0(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new iH,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe}Object.defineProperties(p0.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(){}}});p0.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new p0(t);return n._metadata=e,n};var MTt=new bi("decodeGoogleEarthEnterprisePacket");function BTe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===ed.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());c(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}p0.prototype.requestTileGeometry=function(e,t,n,i){let o=m0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!c(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let l=a.terrainState;c(l)||(l=a.terrainState=ed.UNKNOWN);let u=r.get(o);if(c(u)){let x=s.providers[a.terrainProvider];return Promise.resolve(new kI({buffer:u,childTileMask:BTe(o,a,s),credits:c(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(l===ed.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new dc({buffer:new Uint8Array(16*16),width:16,height:16}));let f,h=o,p=-1;switch(l){case ed.SELF:p=a.terrainVersion;break;case ed.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case ed.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),c(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,b;if(c(g[h]))y=g[h],b=m[h];else{b=i;let x=LTt(this,h,p,b).fetchArrayBuffer();if(!c(x))return;y=x.then(function(A){return c(A)?MTt.scheduleTask({buffer:A,type:"Terrain",key:s.key},[A]).then(function(E){let S=s.getTileInformationFromQuadKey(h);S.terrainState=ed.SELF,r.add(h,E[0]);let v=S.terrainProvider,P=E.length-1;for(let M=0;M<P;++M){let R=h+M.toString(),L=s.getTileInformationFromQuadKey(R);c(L)&&(r.add(R,E[M+1]),L.terrainState=ed.PARENT,L.terrainProvider===0&&(L.terrainProvider=v))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=y,m[h]=b,y=y.finally(function(){delete g[h],delete m[h]})}return y.then(function(){let x=r.get(o);if(c(x)){let A=s.providers[a.terrainProvider];return new kI({buffer:x,childTileMask:BTe(o,a,s),credits:c(A)?[A]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(x){return b.state===Zn.CANCELLED?(i.state=b.state,Promise.reject(x)):(a.terrainState=ed.NONE,Promise.reject(x))})};p0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};p0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=m0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(c(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===ed.NONE)return!1;if((!c(s)||s===ed.UNKNOWN)&&(r.terrainState=ed.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!c(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};p0.prototype.loadTileDataAvailability=function(e,t,n){};function LTt(e,t,n,i){return n=c(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var kTe=p0;var NTt="https://maps.googleapis.com/maps/api/geocode/json",UTe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function d$(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new C("options.key is required.");this._resource=new we({url:NTt,queryParameters:{key:t}}),this._credit=new At(UTe,!0)}Object.defineProperties(d$.prototype,{credit:{get:function(){return this._credit}}});d$.prototype.geocode=async function(e){T.typeOf.string("query",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:UTe,collapsible:!1}}})};var VTe=d$;var oH={};oH.defaultApiKey=void 0;oH.mapTilesApiEndpoint=new we({url:"https://tile.googleapis.com/v1/"});oH.getDefaultCredit=function(){return new At('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var wS=oH;var UI={};UI.type=void 0;UI.getRequiredDataPoints=C.throwInstantiationError;UI.interpolateOrderZero=C.throwInstantiationError;UI.interpolate=C.throwInstantiationError;var zTe=UI;var FTt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},_0=Object.freeze(FTt);function h$(e){T.defined("url",e),this._url=we.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(h$.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});h$.prototype.geocode=async function(e,t){return T.typeOf.string("query",e),this._url.getDerivedResource({url:t===Gx.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(c(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],l=o.geometry.coordinates[1];r=d.fromDegrees(a,l)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var rH=h$;function HTe(e){if(!Object.values(_0).some(t=>t===e))throw new C(`Invalid geocodeProviderType: "${e}"`)}var GTe=Object.freeze({[_0.GOOGLE]:"google",[_0.BING]:"bing",[_0.DEFAULT]:void 0});function BTt(e){return GTe[e]}function kTt(e){return Object.entries(GTe).find(t=>t[1]===e)[0]}function m$(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.scene",e.scene);let t=e.geocodeProviderType??_0.DEFAULT;HTe(t);let n=e.accessToken??Gh.defaultAccessToken,i=we.createIfNeeded(e.server??Gh.defaultServer);i.appendForwardSlash();let o=Gh.getDefaultTokenCredit(n);c(o)&&e.scene.frameState.creditDisplay.addStaticCredit(At.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});c(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new rH(r),this.geocodeProviderType=t}Object.defineProperties(m$.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return kTt(this._pelias.url.queryParameters.geocoder)},set:function(e){HTe(e);let t={...this._pelias.url.queryParameters,geocoder:BTt(e)};c(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});m$.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var vS=m$;var Eo={};Eo.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Eo.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Eo.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Eo.defaultAccessToken=void 0;Eo.defaultShareKey=void 0;Eo._getAuthorizationHeader=function(){if(!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");return c(Eo.defaultShareKey)?`Basic ${Eo.defaultShareKey}`:`Bearer ${Eo.defaultAccessToken}`};Eo.apiEndpoint=new we({url:"https://api.bentley.com"});Eo.getExports=async function(e){if(T.typeOf.string("iModelId",e),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let t=new we({url:`${Eo.apiEndpoint}mesh-export`,headers:{Authorization:Eo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Eo.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);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden");if(n.statusCode===422)throw new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${n.statusCode}`)}};Eo.getRealityDataMetadata=async function(e,t){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let n=new we({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Eo._getAuthorizationHeader(),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);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};Eo.getRealityDataURL=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),T.typeOf.string("rootDocument",n),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=new we({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Eo._getAuthorizationHeader(),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);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var ds=Eo;function sH(){C.throwInstantiationError()}Object.defineProperties(sH.prototype,{ellipsoid:{get:C.throwInstantiationError}});sH.prototype.project=C.throwInstantiationError;sH.prototype.unproject=C.throwInstantiationError;var jTe=sH;function DS(e){e=e??W.EMPTY_OBJECT;let t=e.weights,n=e.times;if(T.defined("weights",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!==0)throw new C("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(DS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});DS.prototype.findTimeInterval=Ni.prototype.findTimeInterval;DS.prototype.wrapTime=Ni.prototype.wrapTime;DS.prototype.clampTime=Ni.prototype.clampTime;DS.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]);c(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 WTe=DS;function p$(e,t,n){T.defined("url",e),T.defined("apiKey",t),c(n)&&T.typeOf.object("params",n),e=we.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new At('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(p$.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});p$.prototype.geocode=async function(e){return T.typeOf.string("query",e),this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(c(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=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var qTe=p$;var UTt={packedLength:void 0,pack:C.throwInstantiationError,unpack:C.throwInstantiationError},YTe=UTt;var VTt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:C.throwInstantiationError,unpackInterpolationResult:C.throwInstantiationError},XTe=VTt;var zTt=new d;function HTt(e,t,n,i){let o=CT(e,t,n,i,zTt);return c(o)?o.x>0&&o.y>0&&o.z>0:!1}var KTe=HTt;function $Te(){C.throwInstantiationError()}$Te.prototype.getURL=C.throwInstantiationError;var ZTe=$Te;function GTt(e,t,n,i,o,r,s){let a=Bi.numberOfPoints(e,t,o),l,u=n.red,f=n.green,h=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,b=i.alpha;if(G.equals(n,i)){for(l=0;l<a;l++)r[s++]=G.floatToByte(u),r[s++]=G.floatToByte(f),r[s++]=G.floatToByte(h),r[s++]=G.floatToByte(p);return s}let x=(g-u)/a,A=(m-f)/a,E=(y-h)/a,S=(b-p)/a,v=s;for(l=0;l<a;l++)r[v++]=G.floatToByte(u+l*x),r[v++]=G.floatToByte(f+l*A),r[v++]=G.floatToByte(h+l*E),r[v++]=G.floatToByte(p+l*S);return v}function VI(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new C("At least two positions are required.");if(c(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new C("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ie.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=c(n)?1+n.length*G.packedLength:1,this.packedLength=o+ie.packedLength+3}VI.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};VI.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t);t+=ie.packedLength;let l=e[t++]===1,u=e[t++],f=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=l,n._arcType=u,n._granularity=f,n):new VI({positions:r,colors:s,ellipsoid:a,colorsPerVertex:l,arcType:u,granularity:f})};var aH=new Array(2),cH=new Array(2),jTt={positions:aH,height:cH,ellipsoid:void 0,minDistance:void 0,granularity:void 0};VI.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=O.chordLength(r,s.maximumRadius),l=c(n)&&!i,u,f=t.length,h,p,g,m,y=0;if(o===qt.GEODESIC||o===qt.RHUMB){let S,v,P;o===qt.GEODESIC?(S=O.chordLength(r,s.maximumRadius),v=Bi.numberOfPoints,P=Bi.generateArc):(S=r,v=Bi.numberOfPointsRhumbLine,P=Bi.generateRhumbArc);let M=Bi.extractHeights(t,s),R=jTt;if(o===qt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,l){let L=0;for(u=0;u<f-1;u++)L+=v(t[u],t[u+1],S)+1;h=new Float64Array(L*3),g=new Uint8Array(L*4),R.positions=aH,R.height=cH;let B=0;for(u=0;u<f-1;++u){aH[0]=t[u],aH[1]=t[u+1],cH[0]=M[u],cH[1]=M[u+1];let _=P(R);if(c(n)){let w=_.length/3;m=n[u];for(let D=0;D<w;++D)g[B++]=G.floatToByte(m.red),g[B++]=G.floatToByte(m.green),g[B++]=G.floatToByte(m.blue),g[B++]=G.floatToByte(m.alpha)}h.set(_,y),y+=_.length}}else if(R.positions=t,R.height=M,h=new Float64Array(P(R)),c(n)){for(g=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let B=t[u],_=t[u+1],w=n[u],D=n[u+1];y=GTt(B,_,w,D,a,g,y)}let L=n[f-1];g[y++]=G.floatToByte(L.red),g[y++]=G.floatToByte(L.green),g[y++]=G.floatToByte(L.blue),g[y++]=G.floatToByte(L.alpha)}}else{p=l?f*2-2:f,h=new Float64Array(p*3),g=c(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let P=t[u];if(l&&u>0&&(d.pack(P,h,S),S+=3,m=n[u-1],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha)),l&&u===f-1)break;d.pack(P,h,S),S+=3,c(n)&&(m=n[u],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha))}}let b=new hn;b.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),c(n)&&(b.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let x=(p-1)*2,A=Fe.createTypedArray(p,x),E=0;for(u=0;u<p-1;++u)A[E++]=u,A[E++]=u+1;return new ct({attributes:b,indices:A,primitiveType:Me.LINES,boundingSphere:le.fromPoints(t)})};var QTe=VI;function PS(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new da(i),this._workerName="createSphereGeometry"}PS.packedLength=da.packedLength;PS.pack=function(e,t,n){return T.typeOf.object("value",e),da.pack(e._ellipsoidGeometry,t,n)};var WTt=new da,g0={radius:void 0,radii:new d,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};PS.unpack=function(e,t,n){let i=da.unpack(e,t,WTt);return g0.vertexFormat=Ie.clone(i._vertexFormat,g0.vertexFormat),g0.stackPartitions=i._stackPartitions,g0.slicePartitions=i._slicePartitions,c(n)?(d.clone(i._radii,g0.radii),n._ellipsoidGeometry=new da(g0),n):(g0.radius=i._radii.x,new PS(g0))};PS.createGeometry=function(e){return da.createGeometry(e._ellipsoidGeometry)};var JTe=PS;function qTt(e){return T.defined("value",e),e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var IS=qTt;function y0(e){throw new C("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(y0.prototype,{ellipsoid:{get:C.throwInstantiationError},rectangle:{get:C.throwInstantiationError},projection:{get:C.throwInstantiationError}});y0.prototype.getNumberOfXTilesAtLevel=C.throwInstantiationError;y0.prototype.getNumberOfYTilesAtLevel=C.throwInstantiationError;y0.prototype.rectangleToNativeRectangle=C.throwInstantiationError;y0.prototype.tileXYToNativeRectangle=C.throwInstantiationError;y0.prototype.tileXYToRectangle=C.throwInstantiationError;y0.prototype.positionToTileXY=C.throwInstantiationError;var eAe=y0;function Wx(e){e=e??W.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=e.epoch??Ge.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Wx.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(c(t)&&(this._clockSubscription(),this._clockSubscription=void 0),c(e)&&(this._clockSubscription=e.onTick.addEventListener(Wx.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(c(t)&&t.removeEventListener("seeked",this._seekFunction,!1),c(e)&&(this._seeking=!1,this._seekFunction=YTt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Wx.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,de(this)};Wx.prototype.isDestroyed=function(){return!1};Wx.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};Wx.prototype._onTick=function(e){let t=this._element;if(!c(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=this.epoch??Ge.MINIMUM_VALUE,s=Q.secondsDifference(o,r),a=t.duration,l,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),l=s):s>a?l=a:s<0?l=0:l=s;let f=i?this.tolerance??1:.001;Math.abs(l-u)>f&&(this._seeking=!0,t.currentTime=l)};function YTt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var tAe=Wx;function XTt(e,t){this.rectangle=e,this.maxLevel=t}function nAe(e){this.ellipsoid=e.ellipsoid??ie.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}nAe.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 KTt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({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=us.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=O.toRadians(parseFloat(s.getAttribute("minx"))),l=O.toRadians(parseFloat(s.getAttribute("miny"))),u=O.toRadians(parseFloat(s.getAttribute("maxx"))),f=O.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new XTt(new ce(a,l,u,f),h))}}function $Tt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i=`${i}: ${t.message}`),Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function ZTt(e,t,n){try{let i=await t.fetchXML();KTt(e,i)}catch(i){$Tt(t,i,n)}}function b0(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,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 At(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(b0.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(){}}});b0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=new nAe(t),i=we.createIfNeeded(e);await ZTt(n,i);let o=new b0(t);return n.build(o),o._resource=i,o};b0.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(!c(s))return;let a=this;return Promise.resolve(s).then(function(l){return new dc({buffer:Ah(l),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:QTt(a,e,t,n),structure:a._terrainDataStructure})})};b0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var iAe=new ce;function QTt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let l=0;l<r.length&&a!==15;++l){let u=r[l];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,s,iAe);c(h)&&(lH(o,f,t*2,n*2,i+1)&&(a|=4),lH(o,f,t*2+1,n*2,i+1)&&(a|=8),lH(o,f,t*2,n*2+1,i+1)&&(a|=1),lH(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function lH(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return c(ce.intersection(r,t,iAe))}b0.prototype.getTileDataAvailable=function(e,t,n){};b0.prototype.loadTileDataAvailability=function(e,t,n){};var oAe=b0;var JTt={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},rAe=Object.freeze(JTt);function eAt(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var sAe=eAt;function tAt(e,t,n){if(typeof t!="function")throw new C("oldFunction is required to be a function.");if(typeof n!="function")throw new C("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}}var uH=tAt;var nAt=new d(1,1,1);function _$(e){e=e??nAt,T.defined("dimensions",e),T.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=d.clone(e)}Object.defineProperties(_$.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){T.defined("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),T.typeOf.number.greaterThanOrEquals("value.z",e.z,0),d.clone(e,this._dimensions)}}});var iAt=new d;_$.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,iAt),i=O.randomBetween(-n.x,n.x),o=O.randomBetween(-n.y,n.y),r=O.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var aAe=_$;function Qm(){this.featurePropertiesDirty=!1}Object.defineProperties(Qm.prototype,{featuresLength:{get:function(){C.throwInstantiationError()}},pointsLength:{get:function(){C.throwInstantiationError()}},trianglesLength:{get:function(){C.throwInstantiationError()}},geometryByteLength:{get:function(){C.throwInstantiationError()}},texturesByteLength:{get:function(){C.throwInstantiationError()}},batchTableByteLength:{get:function(){C.throwInstantiationError()}},innerContents:{get:function(){C.throwInstantiationError()}},ready:{get:function(){C.throwInstantiationError()}},tileset:{get:function(){C.throwInstantiationError()}},tile:{get:function(){C.throwInstantiationError()}},url:{get:function(){C.throwInstantiationError()}},batchTable:{get:function(){C.throwInstantiationError()}},metadata:{get:function(){C.throwInstantiationError()},set:function(e){C.throwInstantiationError()}},group:{get:function(){C.throwInstantiationError()},set:function(e){C.throwInstantiationError()}}});Qm.prototype.hasProperty=function(e,t){C.throwInstantiationError()};Qm.prototype.getFeature=function(e){C.throwInstantiationError()};Qm.prototype.applyDebugSettings=function(e,t){C.throwInstantiationError()};Qm.prototype.applyStyle=function(e){C.throwInstantiationError()};Qm.prototype.update=function(e,t){C.throwInstantiationError()};Qm.prototype.pick=function(e,t,n){C.throwInstantiationError()};Qm.prototype.isDestroyed=function(){C.throwInstantiationError()};Qm.prototype.destroy=function(){C.throwInstantiationError()};var cAe=Qm;function OS(e,t){this._conditionsExpression=We(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,rAt(this,t)}Object.defineProperties(OS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function oAt(e,t){this.condition=e,this.expression=t}function rAt(e,t){let n=[],i=e._conditions;if(!c(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),l=String(s[1]);n.push(new oAt(new bd(a,t),new bd(l,t)))}e._runtimeConditions=n}OS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!c(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)}};OS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!c(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)}};OS.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!c(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let l=o[a],u=l.condition.getShaderExpression(t,n),f=l.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u}) - { - return ${f}; - } -`}return r=`${i} ${e} +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 n7=`in vec2 v_textureCoordinates; +void main() { -${r} return ${i}(1.0); +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); } -`,r};OS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!c(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 fH=OS;function x0(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,sAt(this,e)}function sAt(e,t){t=We(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(c(t.meta)){let i=t.defines,o=t.meta??W.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new bd(o[r],i))}e._meta=n,e._ready=!0}function tr(e,t){let n=(e._style??W.EMPTY_OBJECT).defines;if(c(t)){if(typeof t=="boolean"||typeof t=="number")return new bd(String(t));if(typeof t=="string")return new bd(t,n);if(c(t.conditions))return new fH(t,n)}else return;return t}function nr(e){if(c(e)){if(c(e.expression))return e.expression;if(c(e.conditionsExpression))return We(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(x0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=tr(this,e),this._style.show=nr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=tr(this,e),this._style.color=nr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=tr(this,e),this._style.pointSize=nr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=tr(this,e),this._style.pointOutlineColor=nr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=tr(this,e),this._style.pointOutlineWidth=nr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=tr(this,e),this._style.labelColor=nr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=tr(this,e),this._style.labelOutlineColor=nr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=tr(this,e),this._style.labelOutlineWidth=nr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=tr(this,e),this._style.font=nr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=tr(this,e),this._style.labelStyle=nr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=tr(this,e),this._style.labelText=nr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=tr(this,e),this._style.backgroundColor=nr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=tr(this,e),this._style.backgroundPadding=nr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=tr(this,e),this._style.backgroundEnabled=nr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=tr(this,e),this._style.scaleByDistance=nr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=tr(this,e),this._style.translucencyByDistance=nr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=tr(this,e),this._style.distanceDisplayCondition=nr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=tr(this,e),this._style.heightOffset=nr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=tr(this,e),this._style.anchorLineEnabled=nr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=tr(this,e),this._style.anchorLineColor=nr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=tr(this,e),this._style.image=nr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=tr(this,e),this._style.disableDepthTestDistance=nr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=tr(this,e),this._style.horizontalOrigin=nr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=tr(this,e),this._style.verticalOrigin=nr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=tr(this,e),this._style.labelHorizontalOrigin=nr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=tr(this,e),this._style.labelVerticalOrigin=nr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});x0.fromUrl=function(e){if(!c(e))throw new C("url is required");return we.createIfNeeded(e).fetchJson(e).then(function(n){return new x0(n)})};x0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,c(this.color)&&c(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};x0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,c(this.show)&&c(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};x0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,c(this.pointSize)&&c(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};x0.prototype.getVariables=function(){let e=[];return c(this.color)&&c(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),c(this.show)&&c(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),c(this.pointSize)&&c(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=x0;function zI(e){e=e??W.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new dS({comparator:zI.comparator})}zI.prototype.addSubtree=function(e){let t=new aAt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates();if(this.find(i)===void 0)throw new C("parent node needs to exist")}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};zI.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}};zI.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 aAt(e,t){this.subtree=e,this.stamp=t}var dH=zI;function HI(e){e=e??W.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=d.ZERO.clone(),paddingAfter:l=d.ZERO.clone(),globalTransform:u=F.IDENTITY.clone(),shapeTransform:f=F.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;T.typeOf.string("className",t),T.typeOf.object("names",n),T.typeOf.object("types",i),T.typeOf.object("componentTypes",o),T.typeOf.string("shape",r),T.typeOf.object("dimensions",s),this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=l,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===Na.ELLIPSOID?hh.Z_UP:hh.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new dH}Object.defineProperties(HI.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}}});HI.fromUrl=async function(e){T.defined("url",e);let t=we.createIfNeeded(e),n=await t.fetchJson();lAt(n);let i=_At(n,t);await i.load();let{root:o}=n,r=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new _C({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],l=a.class,u=gAt(s,l);Object.assign(u,uAt(o)),c(o.transform)?u.globalTransform=F.unpack(o.transform):u.globalTransform=F.clone(F.IDENTITY),u.dimensions=d.unpack(a.dimensions),u.maximumTileCount=cAt(s),c(a.padding)&&(u.paddingBefore=d.unpack(a.padding.before),u.paddingAfter=d.unpack(a.padding.after));let f=new HI(u),h=new yC(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,Di.unload(i),f};function cAt(e){if(c(e.tileset))return e.tileset.getPropertyBySemantic(AA.TILESET_TILE_COUNT)}function lAt(e){let t=e.root;if(!c(t.content))throw new ae("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!c(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!c(e.schema)&&!c(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function uAt(e){let t=e.boundingVolume;if(c(t.box))return mAt(t.box);if(c(t.region))return fAt(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return pAt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function fAt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ie.WGS84.radii),l=new d(t,n,r),u=new d(i,o,s);return{shape:Na.ELLIPSOID,minBounds:l,maxBounds:u,shapeTransform:a}}var dAt=new d,hAt=new J;function mAt(e){let t=Pn.unpack(e),n=J.getScale(t.halfAxes,dAt),i=J.getRotation(t.halfAxes,hAt);return{shape:Na.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:F.fromRotationTranslation(i,t.center)}}function pAt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-O.PI,maxAngle:r=O.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e;T.typeOf.number("minRadius",t),T.typeOf.number("maxRadius",n),T.typeOf.number("height",i),T.typeOf.number("minAngle",o),T.typeOf.number("maxAngle",r),T.typeOf.object("translation",s),T.typeOf.object("rotation",a);let l=-.5*i+s[2],u=.5*i+s[2],f=F.fromTranslationQuaternionRotationScale(d.unpack(s),Le.unpack(a),d.ONE);return{shape:Na.CYLINDER,minBounds:d.fromElements(t,o,l),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function _At(e,t){let{schemaUri:n,schema:i}=e;return c(n)?Di.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Di.getSchemaLoader({schema:i})}function gAt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,m])=>{let{type:y,componentType:b}=m,x=o?.properties[g].min,A=o?.properties[g].max,E=at.getComponentCount(y),S=lAe(x,E),v=lAe(A,E);return{id:g,type:y,componentType:b,minValue:S,maxValue:v}}),a=s.map(g=>g.id),l=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=f.some(c);return{className:t,names:a,types:l,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?h:void 0}}function lAe(e,t){if(!c(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function yAt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(c(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),c(o))return o;let l=$g(a);return o=await TA.fromSubtreeJson(s,l.jsonPayload,l.binaryPayload,n,t),i.addSubtree(o),o}HI.prototype.requestData=async function(e){e=e??W.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 bC({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=a.isSubtreeRoot()&&a.level>0,u=l?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await yAt(this,u);if(!(l?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:m,baseResource:y}=s,b=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),x=y.getDerivedResource({url:b.url});return cS.fromGltf(x)};var uAe=HI;function g$(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(g$.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});g$.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var hH=g$;var y$={CUMULUS:0};y$.validate=function(e){return e===y$.CUMULUS};var MS=Object.freeze(y$);function _h(e,t){if(e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!c(e.scale)&&c(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new z(this._maximumSize.x,this._maximumSize.y);else{this._scale=z.clone(e.scale??new z(20,12));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=G.clone(e.color??G.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var bAt=_h.SHOW_INDEX=0,xAt=_h.POSITION_INDEX=1,TAt=_h.SCALE_INDEX=2,AAt=_h.MAXIMUM_SIZE_INDEX=3,CAt=_h.SLICE_INDEX=4,EAt=_h.BRIGHTNESS_INDEX=5,SAt=_h.COLOR_INDEX=6;_h.NUMBER_OF_PROPERTIES=7;function qx(e,t){let n=e._cloudCollection;c(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(_h.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,qx(this,bAt))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),qx(this,xAt))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.object("value",e);let t=this._scale;z.equals(t,e)||(z.clone(e,t),qx(this,TAt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){T.typeOf.object("value",e);let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),qx(this,AAt))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),qx(this,SAt))}},slice:{get:function(){return this._slice},set:function(e){T.typeOf.number("value",e),this._slice!==e&&(this._slice=e,qx(this,CAt))}},brightness:{get:function(){return this._brightness},set:function(e){T.typeOf.number("value",e),this._brightness!==e&&(this._brightness=e,qx(this,EAt))}}});_h.prototype._destroy=function(){this._cloudCollection=void 0};var td=_h;var ku,mH=new d,wAt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},vAt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},DAt=td.SHOW_INDEX,PAt=td.POSITION_INDEX,IAt=td.SCALE_INDEX,OAt=td.MAXIMUM_SIZE_INDEX,RAt=td.SLICE_INDEX,MAt=td.BRIGHTNESS_INDEX,LAt=td.NUMBER_OF_PROPERTIES,NAt=td.COLOR_INDEX;function gh(e){e=e??W.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(LAt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=d.clone(e.noiseOffset??d.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:fAe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function fAe(e){return function(){return mH.x=e._textureSliceWidth,mH.y=e._noiseTextureRows,mH.z=1/e._noiseTextureRows,mH}}Object.defineProperties(gh.prototype,{length:{get:function(){return x$(this),this._clouds.length}}});function dAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}gh.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=e.cloudType??MS.CUMULUS;if(!MS.validate(t))throw new C("invalid cloud type");let n;return t===MS.CUMULUS&&(n=new td(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};gh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};gh.prototype.removeAll=function(){dAe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function x$(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];c(s)&&(n._index=r++,t.push(s))}e._clouds=t}}gh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};gh.prototype.contains=function(e){return c(e)&&e._cloudCollection===this};gh.prototype.get=function(e){return T.typeOf.number("index",e),x$(this),this._clouds[e]};var FAt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),BAt=new Uint16Array([0,1,2,0,2,3]);function kAt(e){let t=bt.createVertexBuffer({context:e,typedArray:FAt,usage:Be.STATIC_DRAW}),n=bt.createIndexBuffer({context:e,typedArray:BAt,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:$.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var T$;function UAt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(c(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=bt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function VAt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return c(t)||(t=bt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function zAt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return c(t)||(t=bt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function HAt(e,t,n){let i=[{index:ku.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.packedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.packedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.color,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,usage:Be.STATIC_DRAW}];n&&i.push({index:ku.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:zAt(e)});let o=n?t:4*t;return new X_(e,i,o,n)}var b$=new Hn;function hAe(e,t,n,i){let o,r=n[ku.positionHighAndScaleX],s=n[ku.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,b$);let l=i.scale,u=b$.high,f=b$.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,l.x),s(o,f.x,f.y,f.z,l.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,l.x),r(o+1,u.x,u.y,u.z,l.x),r(o+2,u.x,u.y,u.z,l.x),r(o+3,u.x,u.y,u.z,l.x),s(o+0,f.x,f.y,f.z,l.y),s(o+1,f.x,f.y,f.z,l.y),s(o+2,f.x,f.y,f.z,l.y),s(o+3,f.x,f.y,f.z,l.y))}function mAe(e,t,n,i){let o,r=n[ku.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 pAe(e,t,n,i){let o,r=n[ku.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 _Ae(e,t,n,i){let o,r=n[ku.color],s=i.color,a=G.floatToByte(s.red),l=G.floatToByte(s.green),u=G.floatToByte(s.blue),f=G.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,l,u,f)):(o=i._index*4,r(o+0,a,l,u,f),r(o+1,a,l,u,f),r(o+2,a,l,u,f),r(o+3,a,l,u,f))}function GAt(e,t,n,i){hAe(e,t,n,i),mAe(e,t,n,i),pAe(e,t,n,i),_Ae(e,t,n,i)}function jAt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows;if(r/s<1||r%s!==0)throw new C("noiseTextureRows must evenly divide textureSliceWidth");let a=t.context;o._vaNoise=kAt(a),o._spNoise=en.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let l=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Rt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA,sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})});let f=new cl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:fAe(o),u_noiseDetail:function(){return l},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function WAt(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=HAt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let l=o[a];GAt(e,t,s,l)}n._vaf.commit(T$(i))}}var qAt=[];function YAt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,l=i._propertiesChanged,u=qAt;u.length=0,(l[PAt]||l[IAt])&&u.push(hAe),(l[DAt]||l[MAt])&&u.push(mAe),(l[OAt]||l[RAt])&&u.push(pAe),l[NAt]&&u.push(_Ae);let f=u.length,h=i._vaf.writers,p,g,m;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,h,g);i._vaf.commit(T$(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](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 XAt(e,t,n,i){let o=t.context,r=e,s=new He({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new He({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=en.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:ku}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function KAt(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,l=a.length;s.length=l;for(let u=0;u<l;u++){let f=s[u];c(f)||(f=s[u]=new Je),f.pass=De.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}gh.prototype.update=function(e){if(x$(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:c(this._noiseTexture),!this._ready&&!this._loading&&!t&&jAt(this,e,fV,uV),this._instanced=e.context.instancedArrays,ku=this._instanced?vAt:wAt,T$=this._instanced?VAt:UAt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?WAt(this,e):r>0&&YAt(this,e),r>i*1.5&&(o.length=i),!(!c(this._vaf)||!c(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&XAt(this,e,lV,cV),KAt(this,e))};gh.prototype.isDestroyed=function(){return!1};gh.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(),dAe(this._clouds),de(this)};var gAe=gh;var $At=O.toRadians(30);function A$(e){this._angle=e??$At}Object.defineProperties(A$.prototype,{angle:{get:function(){return this._angle},set:function(e){T.typeOf.number("value",e),this._angle=e}}});A$.prototype.emit=function(e){let t=Math.tan(this._angle),n=O.randomBetween(0,O.TWO_PI),i=O.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var yAe=A$;var ZAt=new G,QAt=new G,JAt=new G,eCt=new G,bAe=new se,GI=new Uint8Array(4);function xAe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return G.lerp(t.color,n.color,o,i)}function pH(e,t){return{height:e,color:G.clone(t)}}function TAe(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?G.equals(t.color,i[n-1].color):!1,a=r?G.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?G.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function tCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length;if(!Array.isArray(s)||a===0)throw new C("entries must be an array with size > 0.");let l=[];for(n=0;n<a;n++){let g=s[n];if(!c(g.height))throw new C("entry requires a height.");if(!c(g.color))throw new C("entry requires a color.");let m=O.clamp(g.height,Gl._minimumHeight,Gl._maximumHeight),y=G.clone(g.color,ZAt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,l.push(pH(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=l[n+0],m=l[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?l=l.reverse():u||Zy(l,function(g,m){return O.sign(g.height-m.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;l.length===1&&!h&&!p&&(h=!0,p=!0),h&&l.splice(0,0,pH(Gl._minimumHeight,l[0].color)),p&&l.splice(l.length,0,pH(Gl._maximumHeight,l[l.length-1].color)),l=TAe(l),i.push(l)}return i}function nCt(e){let t=tCt(e),n=[],i=[],o;function r(u,f){n.push(pH(u,f))}function s(u,f,h){let p=G.multiplyByScalar(h,1-f.alpha,eCt);p=G.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||h<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,x=h<g?i[h]:void 0,A=h>0?i[h-1]:void 0,E=h<g-1?i[h+1]:void 0;if(c(m)&&c(x)&&m.height===x.height){let S=c(E)&&x.height===E.height,v=!c(A),P=!c(E),M=c(b)&&m.height===b.height,R=!c(y),L=!c(b);S?M?(s(m.height,m.color,x.color),s(m.height,b.color,E.color)):R?(r(m.height,x.color),s(m.height,m.color,E.color)):L?(s(m.height,m.color,x.color),r(m.height,E.color)):(s(m.height,m.color,x.color),s(m.height,m.color,E.color)):v?M?(r(m.height,m.color),s(m.height,b.color,x.color)):L?(r(m.height,m.color),r(m.height,x.color)):(R||r(m.height,m.color),s(m.height,m.color,x.color)):P?M?(s(m.height,m.color,x.color),r(m.height,b.color)):R?(r(m.height,x.color),r(m.height,m.color)):L?s(m.height,m.color,x.color):(s(m.height,m.color,x.color),r(m.height,m.color)):M?(s(m.height,m.color,x.color),s(m.height,b.color,x.color)):R?(r(m.height,x.color),s(m.height,m.color,x.color)):L?(s(m.height,m.color,x.color),r(m.height,x.color)):s(m.height,m.color,x.color),f+=M?2:1,h+=S?2:1}else if(c(m)&&c(x)&&c(A)&&m.height<x.height){let S=xAe(m.height,A,x,JAt);c(y)?c(b)?s(m.height,m.color,S):(s(m.height,m.color,S),r(m.height,S)):(r(m.height,S),s(m.height,m.color,S)),f++}else if(c(x)&&c(m)&&c(y)&&x.height<m.height){let S=xAe(x.height,y,m,QAt);c(A)?c(E)?s(x.height,S,x.color):(s(x.height,S,x.color),r(x.height,S)):(r(x.height,S),s(x.height,S,x.color)),h++}else c(m)&&(!c(x)||m.height<x.height)?(c(x)&&!c(A)&&!c(b)?(r(m.height,m.color),r(m.height,Gl._emptyColor),r(x.height,Gl._emptyColor)):(!c(x)&&c(A)&&!c(y)&&(r(A.height,Gl._emptyColor),r(m.height,Gl._emptyColor)),r(m.height,m.color)),f++):c(x)&&(!c(m)||x.height<m.height)&&(r(x.height,x.color),h++)}}return TAe(n)}function Gl(e){let{scene:t,layers:n}=e??W.EMPTY_OBJECT;T.typeOf.object("options.scene",t),T.defined("options.layers",n),T.typeOf.number.greaterThan("options.layers.length",n.length,0);let{context:i}=t,o=nCt(n),r=o.length,s,a,l;if(!Gl._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,l=ke.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,bAe),se.pack(bAe,s,g*4)}else{a=Ue.FLOAT,l=i.webgl2?ke.RED:ke.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Rt.create({context:i,pixelFormat:l,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(GI),h[g*4+0]=GI[0],h[g*4+1]=GI[1],h[g*4+2]=GI[2],h[g*4+3]=GI[3];let p=Rt.create({context:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR})});return Xi.fromType("ElevationBand",{heights:f,colors:p})}Gl._useFloatTexture=function(e){return e.floatingPointTexture};Gl._maximumHeight=5906376425472;Gl._minimumHeight=-5906376425472;Gl._emptyColor=new G(0,0,0,0);var AAe=Gl;async function iCt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??W.EMPTY_OBJECT,T.typeOf.object("apiOptions",e),e.onlyUsingWithGoogleGeocoder||dt("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=e.key??wS.defaultApiKey;if(!c(n))return oCt(t);let i,o=wS.getDefaultCredit();c(o)&&(i=[o]);let r=new we({url:`${wS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return As.fromUrl(r,t)}var CAe={};async function oCt(e){let i=CAe[2275207];c(i)||(i=uf.fromAssetId(2275207),CAe[2275207]=i);let o=await i;return As.fromUrl(o,e)}var EAe=iCt;async function rCt(e){let t=await As.fromIonAssetId(96188,e);e=e??W.EMPTY_OBJECT;let n=e.style;if(!c(n)){let i=(e.defaultColor??G.WHITE).toCssColorString();n=new RS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var SAe=rCt;function sCt(e){e=e??W.EMPTY_OBJECT;let t=[],n=e.geometry;if(!c(n))throw new C("options.geometry is required.");(!c(n.attributes)||!c(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(e.modelMatrix??F.IDENTITY),r=e.length??1e4;if(c(i.normal)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new jt(1,0,0,1)},modelMatrix:o})),c(i.tangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new jt(0,1,0,1)},modelMatrix:o})),c(i.bitangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new jt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new rn({flat:!0,translucent:!1})})}var wAe=sCt;function jI(e){e=e??W.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;if(!c(t))throw new C("options.attributeName is required.");c(n)||(n=!1);let i=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;default:throw new C("options.glslDatatype must be float, vec2, vec3, or vec4.")}let s=`in vec3 position3DHigh; +`;var h4t=new h(1,1,1);function kse(e){e=e??h4t,this._dimensions=h.clone(e)}Object.defineProperties(kse.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var m4t=new h;kse.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,m4t),i=P.randomBetween(-n.x,n.x),r=P.randomBetween(-n.y,n.y),o=P.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var zFe=kse;var Use=0,VFe=new h,i7=new h,p4t=new No;function g4t(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=p4t.tileXYToRectangle(i,r,o),c=ie.center(a),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let B=(4-x%4)%4;B>0&&(b.push(new Uint8Array(B)),x+=B)}function E(B,j){T();let k=x;b.push(new Uint8Array(B.buffer,B.byteOffset,B.byteLength)),x+=B.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:k,byteLength:B.byteLength,target:j}),G}function v(B,j){let k=E(B,j.target),G=bt.getComponentCount(j.type),q={bufferView:k,byteOffset:0,componentType:j.componentType,count:B.length/G,type:j.type};l(j.min)&&(q.min=j.min),l(j.max)&&(q.max=j.max);let Q=A.length;return A.push(q),Q}function S(B){let j=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,W=Number.NEGATIVE_INFINITY;for(let J=0;J<B.length;J+=3){let Z=B[J],ae=B[J+1],Ae=B[J+2];Z<j&&(j=Z),ae<k&&(k=ae),Ae<G&&(G=Ae),Z>q&&(q=Z),ae>Q&&(Q=ae),Ae>W&&(W=Ae)}return{min:[j,k,G],max:[q,Q,W]}}function I(B,j,k){if(k.length===0)return;let G=new Uint32Array(k),q=v(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER});B._FEATURE_ID_0=q;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(B,j){j=j??4;let k=(j-x%j)%j;k>0&&(b.push(new Uint8Array(k)),x+=k);let G=x;b.push(B),x+=B.byteLength;let q=y.length;return y.push({buffer:0,byteOffset:G,byteLength:B.byteLength}),q}function O(){if(m.size===0)return;let B=new Map;for(let q of m.values())for(let[Q,W]of Object.entries(q)){if(!l(W))continue;let J=typeof W,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ae=B.get(Q);l(ae)?ae!==Z&&B.set(Q,"STRING"):B.set(Q,Z)}if(B.size===0)return;let j={};for(let[q,Q]of B)Q==="SCALAR"?j[q]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[q]={type:"BOOLEAN"}:j[q]={type:"STRING"};let k={},G=g.size;for(let[q,Q]of B)if(Q==="SCALAR"){let W=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[q];W[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(W.buffer,W.byteOffset,W.byteLength),8);k[q]={values:J}}else if(Q==="BOOLEAN"){let W=Math.ceil(G/8),J=new Uint8Array(W);for(let ae=0;ae<G;ae++)m.get(ae)?.[q]&&(J[ae>>3]|=1<<(ae&7));let Z=R(J);k[q]={values:Z}}else{let W=new TextEncoder,J=[],Z=new Uint32Array(G+1),ae=0;for(let we=0;we<G;we++){Z[we]=ae;let Re=m.get(we)?.[q],Qe;Re==null?Qe="":typeof Re=="string"?Qe=Re:Qe=String(Re);let He=W.encode(Qe);J.push(He),ae+=He.byteLength}Z[G]=ae;let Ae=new Uint8Array(ae),fe=0;for(let we of J)Ae.set(we,fe),fe+=we.byteLength;let xe=R(Ae),ge=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));k[q]={values:xe,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:k}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let B of e.layers){let j=B.extent,k=[],G=[],q=[],Q=[],W=[],J=0,Z=[],ae=[],Ae=[],fe=[],xe=[],ge=[],we=[],ve=0;for(let He of B.features){let Ye=l(s)?y4t(He,s,g)??d:_4t(He,g);if(Ye!==d&&!m.has(Ye)){let Ke=Object.assign({},He.properties);Ke._layer=B.name??"",m.set(Ye,Ke)}if(He.type==="Point"){let Ke=He.geometry;for(let Pe of Ke)zse(Pe,i,r,o,j,Use,u,k),G.push(Ye);continue}if(He.type==="LineString"){let Ke=He.geometry;for(let Pe of Ke){let qe=q.length/3;for(let st of Pe)zse(st,i,r,o,j,Use,u,q),Q.push(Ye);for(let st=0;st<Pe.length;st++)W.push(qe+st);W.push(p),J++}continue}if(He.type==="Polygon"){let Ke=He.geometry,Pe=A4t(Ke);for(let qe of Pe){let st=[qe.outerRing,...qe.holes],vt=[],jt=[],lt=[],mt=0;for(let ht=0;ht<st.length;ht++){let Li=st[ht];ht>0&<.push(mt);for(let Yn of Li)vt.push(new U(Yn.x,Yn.y)),zse(Yn,i,r,o,j,Use,u,jt),mt++}if(vt.length<3)continue;let ft=di.triangulate(vt,lt.length>0?lt:void 0);if(!l(ft)||ft.length===0){yt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let Yt=Z.length/3,rt=Ae.length;fe.push(Yt),xe.push(rt),ge.push(lt.length);for(let ht=0;ht<lt.length;ht++)we.push(Yt+lt[ht]);for(let ht=0;ht<jt.length;ht++)Z.push(jt[ht]);for(let ht=0;ht<jt.length/3;ht++)ae.push(Ye);for(let ht=0;ht<ft.length;ht++)Ae.push(ft[ht]+Yt);ve++}}}if(k.length===0&&q.length===0&&Z.length===0)continue;W.length>0&&W[W.length-1]===p&&W.pop();let Re=[];if(k.length>0){let He=new Float32Array(k),Ye=S(He),Pe={POSITION:v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Ye.min,max:Ye.max})},qe={CESIUM_mesh_vector:{vector:!0,count:He.length/3}};I(Pe,qe,G),Re.push({mode:Oe.POINTS,attributes:Pe,extensions:qe})}if(q.length>0&&W.length>1){let He=new Float32Array(q),Ye=new Uint32Array(W),Ke=S(He),Pe=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Ke.min,max:Ke.max}),qe=v(Ye,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),st={POSITION:Pe},vt={CESIUM_mesh_vector:{vector:!0,count:J}};I(st,vt,Q),Re.push({mode:Oe.LINE_STRIP,indices:qe,attributes:st,extensions:vt})}if(Z.length>0&&Ae.length>=3){let He=new Float32Array(Z),Ye=new Uint32Array(Ae),Ke=new Uint32Array(fe),Pe=new Uint32Array(xe),qe=we.length>0,st=qe?new Uint32Array(ge):void 0,vt=qe?new Uint32Array(we):void 0,jt=S(He),lt=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:jt.min,max:jt.max}),mt=v(Ye,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),ft=v(Ke,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),Yt=v(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),rt=l(st)?v(st,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,ht=l(vt)?v(vt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,Li={POSITION:lt},Yn={CESIUM_mesh_vector:{vector:!0,count:ve,polygonAttributeOffsets:ft,polygonIndicesOffsets:Yt}};qe&&(Yn.CESIUM_mesh_vector.polygonHoleCounts=rt,Yn.CESIUM_mesh_vector.polygonHoleOffsets=ht),I(Li,Yn,ae),Re.push({mode:Oe.TRIANGLES,indices:mt,attributes:Li,extensions:Yn})}if(Re.length===0)continue;let Qe=L.length;L.push({primitives:Re}),_.push({name:B.name,mesh:Qe,translation:C})}if(_.length===0)return;let w=O(),D=E4t(b,x),N=["CESIUM_mesh_vector"];g.size>0&&N.push("EXT_mesh_features"),l(w)&&N.push("EXT_structural_metadata");let F=_.map((B,j)=>j),V={asset:{version:"2.0"},extensionsUsed:N,scene:0,scenes:[{nodes:F}],nodes:_,meshes:L,accessors:A,bufferViews:y,buffers:[{byteLength:D.byteLength}],extensions:void 0};return l(w)&&(V.extensions={EXT_structural_metadata:w}),T4t(V,D)}function _4t(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function y4t(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,s=n.get(o);return l(s)||(s=n.size,n.set(o,s)),s}function A4t(e){let t=[];for(let n of e){let i=x4t(n);if(i.length<3)continue;b4t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function b4t(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function x4t(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function zse(e,t,n,i,r,o,s,a){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,VFe),h.subtract(VFe,s,i7),a.push(i7.x,i7.y,i7.z)}function T4t(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+a+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,a,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=a,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function E4t(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var r7=g4t;var Vse=class{constructor(){ut(this,"featuresLength");ut(this,"pointsLength");ut(this,"trianglesLength");ut(this,"geometryByteLength");ut(this,"texturesByteLength");ut(this,"batchTableByteLength");ut(this,"innerContents");ut(this,"ready");ut(this,"tileset");ut(this,"tile");ut(this,"url");ut(this,"batchTable");ut(this,"metadata");ut(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},jFe=Vse;function PM(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new j_({comparator:PM.comparator})}PM.prototype.addSubtree=function(e){let t=new C4t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};PM.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};PM.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 C4t(e,t){this.subtree=e,this.stamp=t}var o7=PM;function DM(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=M.IDENTITY.clone(),shapeTransform:f=M.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Rc.ELLIPSOID?h_.Z_UP:h_.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new o7}Object.defineProperties(DM.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}}});DM.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();S4t(n);let i=M4t(n,t);await i.load();let{root:r}=n,o=or(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new OS({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=N4t(s,c);Object.assign(u,w4t(r)),l(r.transform)?u.globalTransform=M.unpack(r.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=v4t(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new DM(u),d=new X0(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Bi.unload(i),f};function v4t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(wh.TILESET_TILE_COUNT)}function S4t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!or(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!or(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!or(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function w4t(e){let t=e.boundingVolume;if(l(t.box))return R4t(t.box);if(l(t.region))return I4t(t.region);if(or(t,"3DTILES_bounding_volume_cylinder"))return O4t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function I4t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=M.fromScale(ee.WGS84.radii),c=new h(t,n,o),u=new h(i,r,s);return{shape:Rc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var P4t=new h,D4t=new $;function R4t(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,P4t),i=$.getRotation(t.halfAxes,D4t);return{shape:Rc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function O4t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-P.PI,maxAngle:o=P.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=M.fromTranslationQuaternionRotationScale(h.unpack(s),Le.unpack(a),h.ONE);return{shape:Rc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function M4t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Bi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Bi.getSchemaLoader({schema:i})}function N4t(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,s=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=bt.getComponentCount(y),E=HFe(b,T),v=HFe(x,T);return{id:g,type:y,componentType:A,minValue:E,maxValue:v}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),d=s.map(g=>g.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function HFe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function L4t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=lA(a);return r=await K_.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}DM.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new Y0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await L4t(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=s,A=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return dI.fromGltf(b)};var GFe=DM;function jse(e){e=e??1,this._radius=e??1}Object.defineProperties(jse.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});jse.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var s7=jse;var a7={CUMULUS:0};a7.validate=function(e){return e===a7.CUMULUS};Object.freeze(a7);var RM=a7;function Sm(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var F4t=Sm.SHOW_INDEX=0,B4t=Sm.POSITION_INDEX=1,k4t=Sm.SCALE_INDEX=2,U4t=Sm.MAXIMUM_SIZE_INDEX=3,z4t=Sm.SLICE_INDEX=4,V4t=Sm.BRIGHTNESS_INDEX=5,j4t=Sm.COLOR_INDEX=6;Sm.NUMBER_OF_PROPERTIES=7;function nE(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Sm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,nE(this,F4t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),nE(this,B4t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),nE(this,k4t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),nE(this,U4t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),nE(this,j4t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,nE(this,z4t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,nE(this,V4t))}}});Sm.prototype._destroy=function(){this._cloudCollection=void 0};var oh=Sm;var Gf,c7=new h,H4t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},G4t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},W4t=oh.SHOW_INDEX,q4t=oh.POSITION_INDEX,Y4t=oh.SCALE_INDEX,X4t=oh.MAXIMUM_SIZE_INDEX,K4t=oh.SLICE_INDEX,$4t=oh.BRIGHTNESS_INDEX,J4t=oh.NUMBER_OF_PROPERTIES,Z4t=oh.COLOR_INDEX;function wm(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(J4t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:WFe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function WFe(e){return function(){return c7.x=e._textureSliceWidth,c7.y=e._noiseTextureRows,c7.z=1/e._noiseTextureRows,c7}}Object.defineProperties(wm.prototype,{length:{get:function(){return Gse(this),this._clouds.length}}});function qFe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}wm.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??RM.CUMULUS,n;return t===RM.CUMULUS&&(n=new oh(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};wm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};wm.prototype.removeAll=function(){qFe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Gse(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}wm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};wm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};wm.prototype.get=function(e){return Gse(this),this._clouds[e]};var Q4t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e8t=new Uint16Array([0,1,2,0,2,3]);function t8t(e){let t=tt.createVertexBuffer({context:e,typedArray:Q4t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:e8t,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new Vn({context:e,attributes:i,indexBuffer:n})}var Wse;function n8t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=tt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function i8t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function r8t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.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 o8t(e,t,n){let i=[{index:Gf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:Gf.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:r8t(e)});let r=n?t:4*t;return new F_(e,i,r,n)}var Hse=new Sn;function YFe(e,t,n,i){let r,o=n[Gf.positionHighAndScaleX],s=n[Gf.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,Hse);let c=i.scale,u=Hse.high,f=Hse.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function XFe(e,t,n,i){let r,o=n[Gf.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function KFe(e,t,n,i){let r,o=n[Gf.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function $Fe(e,t,n,i){let r,o=n[Gf.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function s8t(e,t,n,i){YFe(e,t,n,i),XFe(e,t,n,i),KFe(e,t,n,i),$Fe(e,t,n,i)}function a8t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=t8t(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Dt({context:a,width:o*o/s,height:o*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA,sampler:new Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})});let f=new $f({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:WFe(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function c8t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=o8t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];s8t(e,t,s,c)}n._vaf.commit(Wse(i))}}var l8t=[];function u8t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=l8t;u.length=0,(c[q4t]||c[Y4t])&&u.push(YFe),(c[W4t]||c[$4t])&&u.push(XFe),(c[X4t]||c[K4t])&&u.push(KFe),c[Z4t]&&u.push($Fe);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(Wse(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function f8t(e,t,n,i){let r=t.context,o=e,s=new Xe({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Xe({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Gf}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:rn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function d8t(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new at),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}wm.prototype.update=function(e){if(Gse(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&a8t(this,e,t7,e7),this._instanced=e.context.instancedArrays,Gf=this._instanced?G4t:H4t,Wse=this._instanced?i8t:n8t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?c8t(this,e):o>0&&u8t(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&f8t(this,e,Q9,Z9),d8t(this,e))};wm.prototype.isDestroyed=function(){return!1};wm.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(),qFe(this._clouds),ue(this)};var JFe=wm;var h8t=P.toRadians(30);function qse(e){this._angle=e??h8t}Object.defineProperties(qse.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});qse.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var ZFe=qse;var m8t=new z,p8t=new z,g8t=new z,_8t=new z,QFe=new se,OM=new Uint8Array(4);function eBe(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function l7(e,t){return{height:e,color:z.clone(t)}}function tBe(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function y8t(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=P.clamp(g.height,Xu._minimumHeight,Xu._maximumHeight),y=z.clone(g.color,m8t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(l7(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||ag(c,function(g,m){return P.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,l7(Xu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,l7(Xu._maximumHeight,c[c.length-1].color)),c=tBe(c),i.push(c)}return i}function A8t(e){let t=y8t(e),n=[],i,r;function o(u,f){n.push(l7(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,_8t);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let E=l(T)&&b.height===T.height,v=!l(x),S=!l(T),I=l(A)&&m.height===A.height,R=!l(y),O=!l(A);E?I?(s(m.height,m.color,b.color),s(m.height,A.color,T.color)):R?(o(m.height,b.color),s(m.height,m.color,T.color)):O?(s(m.height,m.color,b.color),o(m.height,T.color)):(s(m.height,m.color,b.color),s(m.height,m.color,T.color)):v?I?(o(m.height,m.color),s(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),s(m.height,m.color,b.color)):S?I?(s(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),o(m.height,m.color)):I?(s(m.height,m.color,b.color),s(m.height,A.color,b.color)):R?(o(m.height,b.color),s(m.height,m.color,b.color)):O?(s(m.height,m.color,b.color),o(m.height,b.color)):s(m.height,m.color,b.color),f+=I?2:1,d+=E?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let E=eBe(m.height,x,b,g8t);l(y)?l(A)?s(m.height,m.color,E):(s(m.height,m.color,E),o(m.height,E)):(o(m.height,E),s(m.height,m.color,E)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let E=eBe(b.height,y,m,p8t);l(x)?l(T)?s(b.height,E,b.color):(s(b.height,E,b.color),o(b.height,E)):(o(b.height,E),s(b.height,E,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,Xu._emptyColor),o(b.height,Xu._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,Xu._emptyColor),o(m.height,Xu._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return tBe(n)}function Xu(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=A8t(n),o=r.length,s,a,c;if(!Xu._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=$e.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)se.packFloat(r[g].height,QFe),se.pack(QFe,s,g*4)}else{a=ze.FLOAT,c=i.webgl2?$e.RED:$e.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(OM),d[g*4+0]=OM[0],d[g*4+1]=OM[1],d[g*4+2]=OM[2],d[g*4+3]=OM[3];let p=Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})});return lr.fromType("ElevationBand",{heights:f,colors:p})}Xu._useFloatTexture=function(e){return e.floatingPointTexture};Xu._maximumHeight=5906376425472;Xu._minimumHeight=-5906376425472;Xu._emptyColor=new z(0,0,0,0);var nBe=Xu;async function b8t(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??H.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||yt("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=e.key??Da.defaultApiKey;if(!l(n))return x8t(t);let i,r=Da.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Da.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return es.fromUrl(o,t)}var iBe={};async function x8t(e){let i=iBe[2275207];l(i)||(i=Yo.fromAssetId(2275207),iBe[2275207]=i);let r=await i;return es.fromUrl(r,e)}var rBe=b8t;async function T8t(e){let t=await es.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new cA({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var oBe=T8t;function E8t(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=M.clone(e.modelMatrix??M.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Nn({asynchronous:!1,geometryInstances:t,appearance:new An({flat:!0,translucent:!1})})}var sBe=E8t;function MM(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } +`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } +`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } +`;break;case"vec4":o=`vec4 getColor() { return ${r}; } +`;break}let s=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; ${n?"":`in ${i} ${t}; -`}out ${i} ${o}; +`}out ${i} ${r}; void main() { vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${o} = czm_batchTable_${t}(batchId); -`:`${o} = ${t}; +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; `}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${o}; -${r} +}`,a=`in ${i} ${r}; +${o} void main() { out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(jI.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}}});jI.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;jI.prototype.isTranslucent=no.prototype.isTranslucent;jI.prototype.getRenderState=no.prototype.getRenderState;var vAe=jI;function _H(e){e=e??W.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}_H.prototype.update=function(e){if(this.show){if(!c(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,c(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new St({geometry:new wy({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[G.RED,G.RED],arcType:qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new St({geometry:new wy({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[G.GREEN,G.GREEN],arcType:qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new St({geometry:new wy({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[G.BLUE,G.BLUE],arcType:qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new os,asynchronous:!1})}this._primitive.update(e)}};_H.prototype.isDestroyed=function(){return!1};_H.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var gH=_H;function aCt(e){if(T.typeOf.object("options",e),T.typeOf.object("options.direction",e.direction),d.equals(e.direction,d.ZERO))throw new C("options.direction cannot be zero-length");this.direction=d.clone(e.direction),this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??1}var DAe=aCt;var yH=`in vec3 v_positionMC; +}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Or.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(MM.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}}});MM.prototype.getFragmentShaderSource=Or.prototype.getFragmentShaderSource;MM.prototype.isTranslucent=Or.prototype.isTranslucent;MM.prototype.getRenderState=Or.prototype.getRenderState;var aBe=MM;function u7(e){e=e??H.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}u7.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.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 Bt({geometry:new py({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ks.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new py({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ks.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new py({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ks.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new Nn({geometryInstances:[t,n,i],appearance:new Ks,asynchronous:!1})}this._primitive.update(e)}};u7.prototype.isDestroyed=function(){return!1};u7.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var f7=u7;var C8t=new TextDecoder,d7={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},v8t={LAYERS:3},NM={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Yse={TAGS:2,TYPE:3,GEOMETRY:4},iE={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},S8t=["Unknown","Point","LineString","Polygon"];function w8t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=h7(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===v8t.LAYERS&&s===2){let a=p_(t,i,t.length);i=a.newPos;let c=Ku(i,a.value,t.length,"layer");n.push(I8t(t,i,c)),i=c}else i=m7(t,i,s,t.length)}return{layers:n}}function I8t(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=h7(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===NM.NAME&&p===2){let g=p_(e,i,n);i=g.newPos;let m=Ku(i,g.value,n,"layer name");r=Kse(e,i,g.value),i=m}else if(d===NM.FEATURES&&p===2){let g=p_(e,i,n);i=g.newPos;let m=Ku(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===NM.KEYS&&p===2){let g=p_(e,i,n);i=g.newPos;let m=Ku(i,g.value,n,"key");s.push(Kse(e,i,g.value)),i=m}else if(d===NM.VALUES&&p===2){let g=p_(e,i,n);i=g.newPos;let m=Ku(i,g.value,n,"value"),y=R8t(e,i,m);a.push(y),i=m}else if(d===NM.EXTENT&&p===0){let g=bI(e,i,n);o=g.value,i=g.newPos}else i=m7(e,i,p,n)}let u=c.map(({start:f,end:d})=>P8t(e,f,d,s,a));return{name:r,extent:o,features:u}}function P8t(e,t,n,i,r){let o=t,s=d7.UNKNOWN,a=[],c=[];for(;o<n;){let d=h7(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===Yse.TYPE&&g===0){let m=bI(e,o,n);s=m.value,o=m.newPos}else if(p===Yse.TAGS&&g===2){let m=p_(e,o,n);o=m.newPos;let y=Ku(o,m.value,n,"feature tags");for(;o<y;){let A=bI(e,o,y);a.push(A.value),o=A.newPos}}else if(p===Yse.GEOMETRY&&g===2){let m=p_(e,o,n);o=m.newPos;let y=Ku(o,m.value,n,"feature geometry");for(;o<y;){let A=bI(e,o,y);c.push(A.value),o=A.newPos}}else o=m7(e,o,g,n)}let u={};for(let d=0;d<a.length-1;d+=2){let p=i[a[d]],g=r[a[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=D8t(s,c);return{type:S8t[s]??"Unknown",geometry:f,properties:u}}function D8t(e,t){let n=0,i=0,r=0;if(e===d7.POINT){let o=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let u=0;u<c;u++)i+=x0(t[n++]),r+=x0(t[n++]),o.push({x:i,y:r})}return o}if(e===d7.LINESTRING){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===d7.POLYGON){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),o.push(s),s=null)}return s!==null&&o.push(s),o}return[]}function R8t(e,t,n){let i=t;for(;i<n;){let r=h7(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===iE.STRING&&s===2){let a=p_(e,i,n);i=a.newPos;let c=Ku(i,a.value,n,"string value");return Kse(e,i,c-i)}else{if(o===iE.FLOAT&&s===5)return Ku(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===iE.DOUBLE&&s===1)return Ku(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===iE.INT64&&s===0){let a=xI(e,i,n);return Xse(a.value)}else if(o===iE.UINT64&&s===0){let a=xI(e,i,n);return Xse(a.value)}else if(o===iE.SINT64&&s===0){let a=xI(e,i,n);return Xse(O8t(a.value))}else if(o===iE.BOOL&&s===0)return bI(e,i,n).value!==0}i=m7(e,i,s,n)}}function h7(e,t,n){let i=bI(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function bI(e,t,n){let i=xI(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function p_(e,t,n){let i=xI(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function xI(e,t,n,i){let r=0n,o=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,s++,(c&128)===0)break;if(s>=a)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function Kse(e,t,n){let i=Ku(t,n,e.length,"string");return C8t.decode(e.subarray(t,i))}function Ku(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function m7(e,t,n,i){if(n===0)return xI(e,t,i).newPos;if(n===1)return Ku(t,8,i,"fixed64 field");if(n===2){let r=p_(e,t,i);return Ku(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return Ku(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function x0(e){return e>>>1^-(e&1)}function O8t(e){return e>>1n^-(e&1n)}function Xse(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var p7=w8t;function M8t(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var cBe=M8t;var g7=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; void main() @@ -10865,7 +12702,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var bH=`in vec3 position3DHigh; +`;var _7=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -10880,7 +12717,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function Yx(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??bH,this._fragmentShaderSource=e.fragmentShaderSource??yH,this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(Yx.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 Yx.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});Yx.VERTEX_FORMAT=Ie.POSITION_AND_ST;Yx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Yx.prototype.isTranslucent=no.prototype.isTranslucent;Yx.prototype.getRenderState=no.prototype.getRenderState;var PAe=Yx;function jl(e){if(!c(e)||!c(e.scene))throw new C("options.scene is required.");this._scene=e.scene,this.samplingWindow=e.samplingWindow??jl.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??jl.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??jl.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??jl.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??jl.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new pe,this._nominalFrameRate=new pe,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){cCt(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(){lCt(t)}this._visibilityChangeRemoveListener=void 0,c(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}jl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};jl.fromScene=function(e){if(!c(e))throw new C("scene is required.");return(!c(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new jl({scene:e})),e._frameRateMonitor};Object.defineProperties(jl.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}}});jl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};jl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};jl.prototype.isDestroyed=function(){return!1};jl.prototype.destroy=function(){return this._preUpdateRemoveListener(),c(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),de(this)};function cCt(e,t){if(e._pauseCount>0)return;let n=Ei();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.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 lCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var xH=jl;var IAe=jr(r$(),1);function C$(){this._image=new Image}C$.prototype.isReady=function(){return!0};C$.prototype.shouldDiscardImage=function(e){return e===this._image};function Xx(e){e=e??W.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 Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new C$),this._errorEvent=new pe}Object.defineProperties(Xx.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}}});Xx.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new Xx(t);return n._metadata=e,n};Xx.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(c(o)){let r=i.providers[o.imageryProvider];if(c(r))return[r]}};Xx.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=m0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!c(a)){if(r.isValid(s)){let u=new ir({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let l=uCt(this,a,e,t,n,i).fetchArrayBuffer();if(c(l))return l.then(function(u){J8(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!c(p)||!p)&&(h=fCt(f)),!c(h)&&(!c(p)||p)){let g=dCt(f);h=g.imageType,f=g.imageData}return!c(h)||!c(f)?o:_A({uint8Array:f,format:h,flipY:!0})})};Xx.prototype.pickFeatures=function(e,t,n,i,o){};function uCt(e,t,n,i,o,r){let s=m0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=c(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function fCt(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 dCt(e){let t=IAe.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,c(a)||(a=i.copyrightIds=[]),(s&7)===2){let l=t.uint32()+t.pos;for(;t.pos<l;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(c(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 c(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var OAe=Xx;var hCt=new G(1,1,1,.4),mCt=new G(0,1,0,.05),pCt=new G(0,.5,0,.2);function Kx(e){e=e??W.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=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??hCt,this._glowColor=e.glowColor??mCt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??pCt,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(Kx.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}}});Kx.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()};Kx.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};Kx.prototype.getTileCredits=function(e,t,n){};Kx.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};Kx.prototype.pickFeatures=function(e,t,n,i,o){};var RAe=Kx;function yh(){}yh._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);yh._decodeTaskProcessor=new bi("decodeI3S",yh._maxDecodingConcurrency);yh._promise=void 0;async function _Ct(){if(await yh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return yh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}yh.decode=async function(e,t,n,i,o){return T.typeOf.string("url",e),T.defined("defaultGeometrySchema",t),T.defined("geometryData",n),c(yh._promise)||(yh._promise=_Ct()),yh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,l=0,u=0,f=0;c(s.obb)?(l=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):c(s.mbs)&&(l=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=J.fromRotationX(-O.PI_OVER_TWO),p=new J;J.multiply(h,a,p);let g=he.fromDegrees(l,u,f),m=ie.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:c(i)&&c(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ie.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var TH=yh;function E$(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,c(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(E$.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});E$.prototype.load=async function(){return this._data=await Jm.loadJson(this._resource),this._data};var AH=E$;function M_(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;c(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(M_.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(c(this._values)){if(c(this._values.attributeValues))return this._values.attributeValues;if(c(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function CH(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 gCt(e){return e==="String"?1:CH(e)}async function yCt(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)}M_.prototype.load=function(){return c(this._loadPromise)?this._loadPromise:(this._loadPromise=yCt(this).catch(function(e){console.error(e)}),this._loadPromise)};M_.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}};M_.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};M_.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(c(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],l="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(l+=f.value),t=f.offset}this._values[o].push(l)}}}};M_.prototype._getBodyOffset=function(e){let t=0;return c(this._storageInfo.attributeValues)?t=CH(this._storageInfo.attributeValues.valueType):c(this._storageInfo.objectIds)&&(t=CH(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};M_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=gCt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};M_.prototype._validateBody=function(e,t){if(!c(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(c(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=CH(s.valueType);t+=a*this._header.count}else{if(!c(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 l=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=l.value,n=l.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 EH=M_;function WI(e,t){let n=e._dataProvider,i=e._layer,o;c(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(WI.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});WI.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var bCt=new d,xCt=new d,TCt=new d,ACt=new d,CCt=new d;function S$(e,t,n,i){let o=d.subtract(i,n,bCt),r=d.cross(o,d.subtract(e,n,xCt),ACt),s=d.cross(o,d.subtract(t,n,TCt),CCt);return d.dot(r,s)>=0}var ECt=new d,SCt=new d,wCt=new d,vCt=new d,DCt=new d,PCt=new d,ICt=new d,OCt=new d,RCt=new d,MCt=new d;WI.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(c(this._customAttributes)&&c(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,J.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,l,u=this._customAttributes.positions,f=this._customAttributes.indices,h;c(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let g,m,y;c(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let b=d.fromElements(u[g*3],u[g*3+1],u[g*3+2],ECt),x=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],SCt),A=new d(u[y*3],u[y*3+1],u[y*3+2],wCt);if(!S$(i,b,x,A)||!S$(i,x,b,A)||!S$(i,A,b,x))continue;let E=d.subtract(x,b,vCt),S=d.subtract(A,b,DCt),v=d.cross(E,S,PCt);if(d.magnitude(v)===0)continue;let P=d.normalize(v,ICt),M=d.subtract(i,b,OCt),R=Math.abs(d.dot(M,P));if(R<o){o=R,r=p;let L=d.magnitudeSquared(d.subtract(i,b,M)),B=d.magnitudeSquared(d.subtract(i,x,RCt)),_=d.magnitudeSquared(d.subtract(i,A,MCt));L<B&&L<_?(a=g,l=b,s=L):B<_?(a=m,l=x,s=B):(a=y,l=A,s=_)}}if(c(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(l)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function MAe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(IS(e[i])):t.push(e[i]);return t}WI.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let l={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(c(this._parent._data.mesh)&&c(this._layer._data.materialDefinitions)){let E=this._parent._data.mesh.material.definition;if(E>=0&&E<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[E],l=f,c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorTexture)){u=!0,l.pbrMetallicRoughness.baseColorTexture.index=0;let S="0";if(c(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let P=this._layer._data.textureSetDefinitions[v];for(let M=0;M<P.formats.length;M++){let R=P.formats[M];if(R.format==="jpg"){S=R.name;break}}}c(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/${S}`}).url)}c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorFactor)&&(l.pbrMetallicRoughness.baseColorFactor=MAe(l.pbrMetallicRoughness.baseColorFactor)),c(l.emissiveFactor)&&(l.emissiveFactor=MAe(l.emissiveFactor))}}else c(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,l.pbrMetallicRoughness.baseColorTexture={index:0});c(l.alphaMode)&&(l.alphaMode=l.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],b=n.length;for(let A=0;A<b;A++){let E=n[A].primitives,S=E.length;for(let v=0;v<S;v++){let P=E[v];if(c(P.material)){for(;P.material>=y.length;){let R=We(l,!0);y.push(R)}let M=y[P.material];c(P.extra)&&P.extra.isTransparent?c(M.alphaMode)||(M.alphaMode="BLEND"):M.alphaMode==="BLEND"&&(M.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var qI=WI;function bc(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(bc.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}}});bc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Fd(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!c(this._nodeIndex)){let o=await Jm.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/":c(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),c(i)&&c(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function LAe(e,t){let n=new EH(e,t);return e._fields[t.name]=n,n.load()}bc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(c(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];c(o)?t.push(o.load()):t.push(LAe(this,i))}return Promise.all(t)};bc.prototype.loadField=function(e){T.defined("name",e);let t=this._fields[e];if(c(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return LAe(this,o)}return Promise.resolve()};bc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!c(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)};bc.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};bc.prototype._loadChildren=function(){let e=this;if(c(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(c(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new bc(e,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};bc.prototype._loadGeometryData=function(){let e=[];if(c(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new qI(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(c(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new qI(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};bc.prototype._loadFeatureData=function(){let e=[];if(c(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new AH(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};bc.prototype._clearGeometryData=function(){this._geometryData=[]};bc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!c(e)&&!c(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(c(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),c(this._dataProvider._geoidDataList)&&c(n))for(let x=0;x<this._dataProvider._geoidDataList.length;x++){let A=this._dataProvider._geoidDataList[x],E=A.projection.project(n);if(E.x>A.nativeExtent.west&&E.x<A.nativeExtent.east&&E.y>A.nativeExtent.south&&E.y<A.nativeExtent.north){n.height+=BCt(E.x,E.y,A);break}}let i={},o,r=0;c(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=ie.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ie.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(c(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let x=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/x}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let x=this._data.lodThreshold;s=r/x}else console.error("Invalid lodSelectionMetricType in Layer");else if(c(this._data.lodSelection))for(let x=0;x<this._data.lodSelection.length;x++)this._data.lodSelection[x].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[x].maxError);s===1/0&&(s=1e5);let a=s*16,l=new Xa(0,0,0),u=Ot.headingPitchRollQuaternion(o,l);c(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=J.fromQuaternion(u),h=J.inverse(f,new J),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=F.inverse(p,new F),m=F.clone(p);c(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let y=[];for(let x=0;x<this._children.length;x++)y.push(this._children[x]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:c(this._resource)?this._resource.url:void 0},geometricError:a}};bc.prototype._loadSymbology=async function(){!c(this._symbologyData)&&c(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};bc.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),c(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 TH.decode(o,r,s,this._featureData[0],this._symbologyData);if(!c(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 LCt(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 NCt(e,t,n){if(!c(n.values)||n.values.length===0)return!1;let i=c(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 NAe(e,t){let n=e._tile.content.batchTable;if(c(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await LCt(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(!NCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}bc.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(c(this._geometryData)&&this._geometryData.length>0&&c(t)&&t.ready){t.show=!1;let n=NAe(this,t);e.push(n)}return Promise.all(e)};Fd.prototype._hookedRequestContent=Fd.prototype.requestContent;Fd.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(!c(t)){e._isLoading=!1;return}return e._contentResource=new we({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return c(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&c(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{NAe(e._i3sNode,n)})),e._isLoading=!1,t})}};function FCt(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 SH(e,t,n,i){let o=e+t*n;return i[o]}function BCt(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 l=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=SH(s,a,n.width,n.buffer),h=SH(l,a,n.width,n.buffer),p=SH(s,u,n.width,n.buffer),g=SH(l,u,n.width,n.buffer),m=FCt(o,r,f,h,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Fd.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var YI=bc;function wH(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(wH.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function w$(e,t){let n=[];for(let i=0;i<e.length;i++){let o=G.byteToFloat(e[i]);i<3?n.push(IS(o)):n.push(o)}return n.length===3&&(c(t)?n.push(1-t/100):n.push(1)),n}function LS(e,t){let n={edges:void 0,material:void 0};if(c(e)&&c(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(c(r)?(n.edges={},c(r.color)&&(n.edges.color=w$(r.color,r.transparency))):c(s)&&(n.edges={},c(s.color)&&(n.edges.color=w$(s.color,s.transparency))),!t){let a=o.material;c(a)&&(n.material={colorMixMode:a.colorMixMode},c(a.color)&&(n.material.color=w$(a.color,a.transparency)))}break}}return n}function kCt(e,t){if(c(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(c(o))for(let r=0;r<o.length;r++){let s=LS(o[r].symbol,t),a=o[r].values;for(let l=0;l<a.length;l++){let u=a[l],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=s:(c(f[p])||(f[p]={}),f=f[p])}}}}return n}if(c(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=LS(o.symbol,t)}return n}}function UCt(e,t){if(c(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};c(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];c(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),c(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(LS(r.symbol,t)))}return i.symbols.push(void 0),i}}wH.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(c(e)&&c(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=c(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=LS(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=LS(i.defaultSymbol,n),this._valueFields.push(i.field1),c(i.field2)&&this._valueFields.push(i.field2),c(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=kCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=LS(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=UCt(i,n))}};function FAe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return c(s)&&++n<t.length?FAe(s,t,n,i):s}}function VCt(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 zCt(e,t,n){let i=t[n],o=VCt(e.ranges,i);return e.symbols[o]}wH.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(c(this._uniqueValueHash)?o=r=>FAe(this._uniqueValueHash,i,0,r):c(this._classBreaksHash)&&(o=r=>zCt(this._classBreaksHash,i[0],r)),c(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);c(a)&&(t[s]=a)}}}return t};var vH=wH;function Wl(e,t,n){this._dataProvider=e,this._parent=n,!c(t.href)&&c(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 we({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(Wl.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(c(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Wl.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 vH(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()};Wl.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],c(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(c(r.compressedAttributes)&&e){a=!0;let l=r.compressedAttributes.attributes;for(let u=0;u<l.length;u++)s.push(l[u])}else for(let l in r)l!=="offset"&&s.push(l);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)}};Wl.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(c(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(c(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Wl.prototype._loadRootNode=function(e){if(c(this._data.nodePages)){let t=0;c(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new YI(this,t,!0)}else this._rootNode=new YI(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Wl.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]})};Wl._fetchJson=function(e){return e.fetchJson()};Wl.prototype._loadNodePage=function(e){let t=this;if(!c(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Wl._fetchJson(n).then(function(o){return c(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Wl.prototype._computeExtent=function(){c(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):c(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]))};Wl.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;c(o)&&!c(e?.outlineColor)&&(e=c(e)?We(e):{},e.outlineColor=G.fromCartesian4(se.fromArray(o))),this._tileset=await As.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){c(r._i3sNode)&&r._i3sNode._loadChildren()})};Wl.prototype._updateVisibility=function(){c(this._tileset)&&(this._tileset.show=this._parent.show)};Wl.prototype.filterByAttributes=function(e){this._filters=c(e)?We(e,!0):[];let t=this._rootNode;return c(t)?t._filterFeatures():Promise.resolve()};var NS=Wl;function DH(e,t){this._dataProvider=e,this._resource=new we({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(DH.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});DH.prototype.load=async function(){return this._data=await Jm.loadJson(this._resource),this._data};DH.prototype._getValues=function(e){let t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return c(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var PH=DH;function XI(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(XI.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(T.defined("value",e),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}}});XI._fromData=async function(e,t,n,i){let o=new XI(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(c(r)){let s=[];for(let l=0;l<r.length;l++){let u=XI._fromData(e,t,r[l],o);s.push(u)}let a=await Promise.all(s);for(let l=0;l<a.length;l++){let u=a[l];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new we({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Jm.loadJson(o._resource),l=new NS(e,a,o);o._i3sLayers.push(l)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var IH=XI;var UAe=jr(BAe(),1);function hs(e){e=e??W.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??W.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(hs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(T.defined("value",e),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}}});hs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)c(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return de(this)};hs.prototype.isDestroyed=function(){return!1};hs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};hs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};hs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};hs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)c(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 kAe(e,t,n){if(t.layerType==="Building"){c(n.showFeatures)||(e._showFeatures=!0),c(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),c(n.applySymbology)||(e._applySymbology=!0),c(n.calculateNormals)||(e._calculateNormals=!0);let i=HCt(e,t.id);if(c(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=IH._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(c(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new PH(e,o);await r.load(),e._attributeStatistics.push(r)}if(c(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"){!c(n.calculateNormals)&&!c(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new NS(e,t,e);e._layers.push(i),c(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}hs.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await hs.loadJson(n),o=new hs(t);if(o._resource=n,o._data=i,c(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let l=kAe(o,i.layers[a],t);s.push(l)}await Promise.all(s)}else await kAe(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};hs._fetchJson=function(e){return e.fetchJson()};hs.loadJson=async function(e){let t=await hs._fetchJson(e);if(c(t.error)){if(console.error("Failed to fetch I3S ",e.url),c(t.error.message)&&console.error(t.error.message),c(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};hs.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};hs.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 GCt=new z;function jCt(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),l=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=l.x;h<=u.x;h++)for(let p=l.y;p<=u.y;p++){let g=z.fromElements(h,p,GCt),m=g.toString();if(!o.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=y,i.push(y)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(h){let p=[];for(let g=0;g<h.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=h[g],b="Geographic";n._projection instanceof Li&&(b="WebMercator");let x={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===ih.LERC){let A=UAe.default.decode(y._buffer);x.buffer=A.pixels[0]}else x.buffer=y._buffer;p.push(x)}return p})}async function WCt(e){let t=e._geoidTiledTerrainProvider;if(c(t))try{let n=await jCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}hs.prototype.loadGeoidData=async function(){return c(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=WCt(this),this._geoidDataPromise)};hs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];c(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};hs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};hs.prototype.getAttributeValues=function(e){T.defined("name",e);for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(c(n))return n}return[]};hs.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 Jm=hs;var KI={};KI.createTilesetFromIModelId=async function(e,t){let{exports:n}=await ds.getExports(e);if(n.length>0&&n.every(a=>a.status===ds.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===ds.ExportStatus.Complete);if(!c(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new we({url:r});return As.fromUrl(s,t)};KI.createTilesetForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await ds.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ds.RealityDataType.Cesium3DTiles,ds.RealityDataType.PNTS,ds.RealityDataType.RealityMesh3DTiles,ds.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await ds.getRealityDataURL(e,t,i);return As.fromUrl(r,{maximumScreenSpaceError:4})};KI.createDataSourceForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await ds.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ds.RealityDataType.KML,ds.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await ds.getRealityDataURL(e,t,i);return n===ds.RealityDataType.GeoJSON?hx.load(r):wE.load(r)};KI.loadGeospatialFeatures=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("collectionId",t),c(n)&&(T.typeOf.number("limit",n),T.typeOf.number.lessThanOrEquals("limit",n,1e4),T.typeOf.number.greaterThanOrEquals("limit",n,1)),!c(ds.defaultAccessToken)&&!c(ds.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=n??1e4,o=`${ds.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new we({url:o,headers:{Authorization:ds._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return hx.load(r)};var VAe=KI;function zAe(){}Object.defineProperties(zAe.prototype,{color:{get:C.throwInstantiationError},intensity:{get:C.throwInstantiationError}});var HAe=zAe;var qCt=/\/$/,GAe=new At('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function FS(e){e=e??W.EMPTY_OBJECT;let t=e.styleId;if(!c(t))throw new C("options.styleId is required.");let n=e.accessToken;if(!c(n))throw new C("options.accessToken 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;let i=we.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=c(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();qCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let l;c(e.credit)?(l=e.credit,typeof l=="string"&&(l=new At(l))):l=GAe,this._resource=i,this._imageryProvider=new hc({url:i,credit:l,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(FS.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}}});FS.prototype.getTileCredits=function(e,t,n){};FS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};FS.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};FS._defaultCredit=GAe;var jAe=FS;function v$(e){}v$.prototype.isReady=function(){return!0};v$.prototype.shouldDiscardImage=function(e){return!1};var WAe=v$;var YCt=new At("MapQuest, Open Street Map and contributors, CC-BY-SA");function RH(e){e=e??W.EMPTY_OBJECT;let t=we.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new fs({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,l=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(f>4)throw new C(`The rectangle and minimumLevel indicate that there are ${f} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let h=e.credit??YCt;typeof h=="string"&&(h=new At(h)),hc.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}c(Object.create)&&(RH.prototype=Object.create(hc.prototype),RH.prototype.constructor=RH);var T0=RH;var XCt=new z(1,1);function D$(e){e=e??W.EMPTY_OBJECT,this.mass=e.mass??1,this.position=d.clone(e.position??d.ZERO),this.velocity=d.clone(e.velocity??d.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=G.clone(e.startColor??G.WHITE),this.endColor=G.clone(e.endColor??G.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=z.clone(e.imageSize??XCt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(D$.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var qAe=new d;D$.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,qAe),d.add(this.position,qAe,this.position),c(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 $I=D$;function YAe(e){e=e??W.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(YAe.prototype,{complete:{get:function(){return this._complete}}});var XAe=YAe;function KAe(e){throw new C("This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}KAe.prototype.emit=function(e){C.throwInstantiationError()};var $Ae=KAe;var ZAe=new z(1,1);function ZI(e){e=e??W.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;c(t)||(t=new hH(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._emitterModelMatrix=F.clone(e.emitterModelMatrix??F.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=G.clone(e.color??e.startColor??G.WHITE),this._endColor=G.clone(e.color??e.endColor??G.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=z.clone(e.imageSize??e.minimumImageSize??ZAe),this._maximumImageSize=z.clone(e.imageSize??e.maximumImageSize??ZAe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(ZI.prototype,{emitter:{get:function(){return this._emitter},set:function(e){T.defined("value",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){T.defined("value",e),this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){T.defined("value",e),this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){T.defined("value",e),G.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){T.defined("value",e),G.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function KCt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(c(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),l=e._particles,u=e._particlePool,f=Math.max(a-l.length-u.length,0);for(let h=0;h<f;++h){let p=new $I;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function $Ct(e){let t=e._particlePool.pop();return c(t)||(t=new $I),t}function ZCt(e,t){e._particlePool.push(t)}function QCt(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 l=a;l<r;++l){let u=n[l];i.remove(u._billboard)}n.length=a}function JCt(e){c(e._billboard)&&(e._billboard.show=!1)}function QAe(e,t){let n=t._billboard;c(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=O.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=O.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=O.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=O.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new G(i,o,r,s),n.scale=O.lerp(t.startScale,t.endScale,t.normalizedAge)}function eEt(e,t){t.startColor=G.clone(e._startColor,t.startColor),t.endColor=G.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=O.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=O.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=O.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=O.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=O.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function tEt(e,t){if(e._isComplete)return 0;t=O.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),c(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;c(s)&&!s._complete&&a>s.time&&(i+=O.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var MH=new d;ZI.prototype.update=function(e){if(!this.show)return;c(this._billboardCollection)||(this._billboardCollection=new Cf),this._updateParticlePool&&(KCt(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)?QAe(this,s):(JCt(s),ZCt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let l=tEt(this,t);if(l>0&&c(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<l;r++)s=$Ct(this),this._emitter.emit(s),d.add(s.position,s.velocity,MH),F.multiplyByPoint(u,MH,MH),s.position=F.multiplyByPoint(u,s.position,s.position),d.subtract(MH,s.position,s.velocity),d.normalize(s.velocity,s.velocity),eEt(this,s),QAe(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=O.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&QCt(this)};ZI.prototype.isDestroyed=function(){return!1};ZI.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),de(this)};var JAe=ZI;function Uu(){C.throwInstantiationError()}Uu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Uu.prototype,{quadtree:{get:C.throwInstantiationError,set:C.throwInstantiationError},tilingScheme:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError}});Uu.prototype.update=C.throwInstantiationError;Uu.prototype.beginUpdate=C.throwInstantiationError;Uu.prototype.endUpdate=C.throwInstantiationError;Uu.prototype.getLevelMaximumGeometricError=C.throwInstantiationError;Uu.prototype.loadTile=C.throwInstantiationError;Uu.prototype.computeTileVisibility=C.throwInstantiationError;Uu.prototype.showTileThisFrame=C.throwInstantiationError;Uu.prototype.computeDistanceToTile=C.throwInstantiationError;Uu.prototype.isDestroyed=C.throwInstantiationError;Uu.prototype.destroy=C.throwInstantiationError;var eCe=Uu;function P$(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(P$.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});P$.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,O.PI),i=O.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=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var tCe=P$;function QI(){}QI.prototype.evaluate=function(e,t){C.throwInstantiationError()};QI.prototype.evaluateColor=function(e,t){C.throwInstantiationError()};QI.prototype.getShaderFunction=function(e,t,n,i){C.throwInstantiationError()};QI.prototype.getVariables=function(){C.throwInstantiationError()};var nCe=QI;function BS(e){T.typeOf.object("terrainProviderPromise",e),this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,iEt(this,e)}Object.defineProperties(BS.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}}});BS.fromWorldTerrain=function(e){return new BS(ES(e))};BS.fromWorldBathymetry=function(e){return new BS(Q8(e))};function nEt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function iEt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){nEt(e._errorEvent,i)}}var LH=BS;function kS(){}kS.prototype.boundingVolume=void 0;kS.prototype.boundingSphere=void 0;kS.prototype.distanceToCamera=function(e){C.throwInstantiationError()};kS.prototype.intersectPlane=function(e){C.throwInstantiationError()};kS.prototype.createDebugVolume=function(e){C.throwInstantiationError()};var iCe=kS;function JI(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??G.YELLOW,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=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(JI.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}}});JI.prototype.getTileCredits=function(e,t,n){};JI.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)};JI.prototype.pickFeatures=function(e,t,n,i,o){};var NH=JI;function I$(e){C.throwInstantiationError()}I$.prototype.isReady=C.throwInstantiationError;I$.prototype.shouldDiscardImage=C.throwInstantiationError;var oCe=I$;var oEt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},rCe=Object.freeze(oEt);function FH(e,t){this.show=!0,c(e)||(e=new Ke),this.rectangle=Ke.clone(e),c(t)||(t=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}FH.prototype.update=function(e){if(!this.show)return;if(!c(this.material))throw new C("this.material must be defined.");if(!c(this.rectangle))throw new C("this.rectangle must be defined.");let t=this._rs;if((!c(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!c(this._overlayCommand)){this._material=this.material,c(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new He({sources:[this._material.shaderSource,DV]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=De.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};FH.prototype.isDestroyed=function(){return!1};FH.prototype.destroy=function(){return c(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),de(this)};var sCe=FH;function O$(){C.throwInstantiationError()}Object.defineProperties(O$.prototype,{globalTransform:{get:C.throwInstantiationError},shapeTransform:{get:C.throwInstantiationError},shape:{get:C.throwInstantiationError},minBounds:{get:C.throwInstantiationError},maxBounds:{get:C.throwInstantiationError},dimensions:{get:C.throwInstantiationError},paddingBefore:{get:C.throwInstantiationError},paddingAfter:{get:C.throwInstantiationError},names:{get:C.throwInstantiationError},types:{get:C.throwInstantiationError},componentTypes:{get:C.throwInstantiationError},minimumValues:{get:C.throwInstantiationError},maximumValues:{get:C.throwInstantiationError},maximumTileCount:{get:C.throwInstantiationError},availableLevels:{get:C.throwInstantiationError},keyframeCount:{get:C.throwInstantiationError},timeIntervalCollection:{get:C.throwInstantiationError}});O$.prototype.requestData=function(e){C.throwInstantiationError()};var aCe=O$;function $x(){C.throwInstantiationError()}Object.defineProperties($x.prototype,{orientedBoundingBox:{get:C.throwInstantiationError},boundingSphere:{get:C.throwInstantiationError},boundTransform:{get:C.throwInstantiationError},shapeTransform:{get:C.throwInstantiationError},shaderUniforms:{get:C.throwInstantiationError},shaderDefines:{get:C.throwInstantiationError},shaderMaximumIntersectionsLength:{get:C.throwInstantiationError}});$x.prototype.update=C.throwInstantiationError;$x.prototype.computeOrientedBoundingBoxForTile=C.throwInstantiationError;$x.prototype.computeOrientedBoundingBoxForSample=C.throwInstantiationError;$x.DefaultMinBounds=C.throwInstantiationError;$x.DefaultMaxBounds=C.throwInstantiationError;var cCe=$x;var lCe=`uniform sampler2D u_depthTexture; +`;function rE(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:lr.fromType(lr.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??_7,this._fragmentShaderSource=e.fragmentShaderSource??g7,this._renderState=Or.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(rE.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 rE.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});rE.VERTEX_FORMAT=Be.POSITION_AND_ST;rE.prototype.getFragmentShaderSource=Or.prototype.getFragmentShaderSource;rE.prototype.isTranslucent=Or.prototype.isTranslucent;rE.prototype.getRenderState=Or.prototype.getRenderState;var lBe=rE;var N8t=1e5;function LM(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._radius=l(e.radius)?e.radius:N8t,this._image=e.image,this._transform=l(e.transform)?e.transform:M.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new M3({radius:this._radius,vertexFormat:Be.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),r=new lr({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Nn({geometryInstances:i,appearance:new Sr({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(LM.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});LM.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};LM.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};LM.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var uBe=LM;function $u(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??$u.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??$u.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??$u.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??$u.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??$u.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(r,o){L8t(t,o)}),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(){F8t(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}$u.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};$u.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new $u({scene:e})),e._frameRateMonitor};Object.defineProperties($u.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}}});$u.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};$u.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};$u.prototype.isDestroyed=function(){return!1};$u.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function L8t(e,t){if(e._pauseCount>0)return;let n=xn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Un.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Un.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Un.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 r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?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 F8t(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var y7=$u;var Jse=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=B8t(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??ee.default,o=new Float64Array(0);function s(g){return o.length<g&&(o=new Float64Array(g)),o}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??We.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new Cf({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new Ll({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new tc({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let u=new h,f=0,d=0,p=0;for(let g=0;g<n.features.length;g++){let m=n.features[g],y=m.featureId,A=this._properties[y];for(let b=0;b<m.points.length;b++){let x=f++;this._points.add({featureId:y,position:gBe(m.points[b],r,u),pickObject:i?$se(this,x,this._points,sl,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:fBe(m.polylines[b],r,s),pickObject:i?$se(this,x,this._polylines,Oa,A):void 0})}for(let b=0;b<m.polygons.length;b++){let x=m.polygons[b],T=p++;this._polygons.add({featureId:y,positions:fBe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?$se(this,T,this._polygons,Fo,A):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,r=this._polygons,o=t.frameNumber,s=this._heightReference,a=ps(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,o,s):i.update(t)),l(r)&&(l(a)?a.markForFrame(r,o,s):r.update(t))}destroy(){let t=ps(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),ue(this)}isDestroyed(){return!1}};function $se(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function B8t(e){let t=k8t(e),n=[],i=[],r=[],o=0,s=0,a=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(dBe(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(K8t(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)a+=m.polylines[A].length;o+=m.points.length,s+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function k8t(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(Y8t(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function dBe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":hBe(e.coordinates,t.points);return;case"MultiPoint":z8t(e.coordinates,t.points);return;case"LineString":mBe(e.coordinates,t.polylines);return;case"MultiLineString":V8t(e.coordinates,t.polylines);return;case"Polygon":pBe(e.coordinates,t.polygons);return;case"MultiPolygon":j8t(e.coordinates,t.polygons);return;case"GeometryCollection":U8t(e.geometries,t);return;default:return}}function U8t(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)dBe(e[n],t)}function hBe(e,t){let n=Zse(e);l(n)&&t.push(n)}function z8t(e,t){for(let n=0;n<e.length;n++)hBe(e[n],t)}function mBe(e,t){let n=H8t(e);l(n)&&n.length>=2&&t.push(n)}function V8t(e,t){for(let n=0;n<e.length;n++)mBe(e[n],t)}function pBe(e,t){let n=G8t(e);l(n)&&t.push(n)}function j8t(e,t){for(let n=0;n<e.length;n++)pBe(e[n],t)}function H8t(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Zse(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function G8t(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=W8t(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new U(f[0],f[1]))}}}if(r.length<3)return;let s=di.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function W8t(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Zse(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&q8t(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Zse(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function q8t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Y8t(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function gBe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var X8t=new h;function fBe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=gBe(e[o],t,X8t);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function K8t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var _Be=Jse;var yBe=js(j$(),1);function Qse(){this._image=new Image}Qse.prototype.isReady=function(){return!0};Qse.prototype.shouldDiscardImage=function(e){return e===this._image};function oE(e){e=e??H.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 ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Qse),this._errorEvent=new be}Object.defineProperties(oE.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}}});oE.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new oE(t);return n._metadata=e,n};oE.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};oE.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=cy.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new Oo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=$8t(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){Mk(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=J8t(f)),!l(d)&&(!l(p)||p)){let g=Z8t(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:W_({uint8Array:f,format:d,flipY:!0})})};oE.prototype.pickFeatures=function(e,t,n,i,r){};function $8t(e,t,n,i,r,o){let s=cy.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function J8t(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 Z8t(e){let t=yBe.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 r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var ABe=oE;var Q8t=600;function T0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Da.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Da.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??Q8t}Object.defineProperties(T0.prototype,{});T0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let s=Da.getDefaultCredit(),a=h.fromDegrees(P.toDegrees(t.longitude),P.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=At.localFrameToFixedFrameGenerator("north","down"),A=M.getMatrix3(y(a,ee.default),new $);return new _I({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};T0.prototype.getNearestPanoId=async function(e,t){let i=[P.toDegrees(e.latitude),P.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};T0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};T0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};T0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};T0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Da.defaultStreetViewStaticApiKey??Da.defaultApiKey,!l(e.key)&&!l(Da.defaultStreetViewStaticApiKey)&&!l(Da.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new T0({...e})};T0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var bBe=T0;var ejt=new z(1,1,1,.4),tjt=new z(0,1,0,.05),njt=new z(0,.5,0,.2);function sE(e){e=e??H.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 ir({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??ejt,this._glowColor=e.glowColor??tjt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??njt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(sE.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}}});sE.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};sE.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"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,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};sE.prototype.getTileCredits=function(e,t,n){};sE.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};sE.prototype.pickFeatures=function(e,t,n,i,r){};var xBe=sE;function Im(){}Im._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Im._decodeTaskProcessor=new $n("decodeI3S",Im._maxDecodingConcurrency);Im._promise=void 0;async function ijt(){if(await Im._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Im._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}Im.decode=async function(e,t,n,i,r){return l(Im._promise)||(Im._promise=ijt()),Im._promise.then(function(o){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=he.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var A7=Im;function eae(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(eae.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});eae.prototype.load=async function(){return this._data=await E0.loadJson(this._resource),this._data};var b7=eae;function g_(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(g_.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 x7(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 rjt(e){return e==="String"?1:x7(e)}async function ojt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}g_.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=ojt(this).catch(function(e){console.error(e)}),this._loadPromise)};g_.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 r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-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}};g_.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],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};g_.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let s=0;s<this._header.count;++s)if(o.valueType!=="String"){let a=this._parseValue(e,o.valueType,t);this._values[r].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};g_.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=x7(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=x7(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};g_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=rjt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};g_.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`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 r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,s=this._storageInfo[o];if(l(s))if(s.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let a=x7(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new oe(`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 oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var T7=g_;function FM(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(FM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});FM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var sjt=new h,ajt=new h,cjt=new h,ljt=new h,ujt=new h;function tae(e,t,n,i){let r=h.subtract(i,n,sjt),o=h.cross(r,h.subtract(e,n,ajt),ljt),s=h.cross(r,h.subtract(t,n,cjt),ujt);return h.dot(o,s)>=0}var fjt=new h,djt=new h,hjt=new h,mjt=new h,pjt=new h,gjt=new h,_jt=new h,yjt=new h,Ajt=new h,bjt=new h;FM.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(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 r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],fjt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],djt),x=new h(u[y*3],u[y*3+1],u[y*3+2],hjt);if(!tae(i,A,b,x)||!tae(i,b,A,x)||!tae(i,x,A,b))continue;let T=h.subtract(b,A,mjt),E=h.subtract(x,A,pjt),v=h.cross(T,E,gjt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,_jt),I=h.subtract(i,A,yjt),R=Math.abs(h.dot(I,S));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,I)),L=h.magnitudeSquared(h.subtract(i,b,Ajt)),_=h.magnitudeSquared(h.subtract(i,x,bjt));O<L&&O<_?(a=g,c=A,s=O):L<_?(a=m,c=b,s=L):(a=y,c=x,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function TBe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(av(e[i])):t.push(e[i]);return t}FM.prototype._generateGltf=function(e,t,n,i,r,o,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let S=this._layer._data.textureSetDefinitions[v];for(let I=0;I<S.formats.length;I++){let R=S.formats[I];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=TBe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=TBe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=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=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,E=T.length;for(let v=0;v<E;v++){let S=T[v];if(l(S.material)){for(;S.material>=y.length;){let R=Ze(c,!0);y.push(R)}let I=y[S.material];l(S.extra)&&S.extra.isTransparent?l(I.alphaMode)||(I.alphaMode="BLEND"):I.alphaMode==="BLEND"&&(I.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var BM=FM;function pl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,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(pl.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}}});pl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Zh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await E0.loadJson(this._resource);e._data=r,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 EBe(e,t){let n=new T7(e,t);return e._fields[t.name]=n,n.load()}pl.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],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(EBe(this,i))}return Promise.all(t)};pl.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 r=n[i];if(r.name===e)return EBe(this,r)}return Promise.resolve()};pl.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)};pl.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};pl.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],r=new pl(e,i.href??i,!1);e._children.push(r),t.push(r.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};pl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new BM(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 BM(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};pl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new b7(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};pl.prototype._clearGeometryData=function(){this._geometryData=[]};pl.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 b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=Cjt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=ee.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new kc(0,0,0),u=At.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new M(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=M.inverse(p,new M),m=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};pl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};pl.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 r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await A7.decode(r,o,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 xjt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function Tjt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===r){o=!0;break}return o}async function CBe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await xjt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let s=i[o];if(!Tjt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}pl.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=CBe(this,t);e.push(n)}return Promise.all(e)};Zh.prototype._hookedRequestContent=Zh.prototype.requestContent;Zh.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 De({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(()=>{CBe(e._i3sNode,n)})),e._isLoading=!1,t})}};function Ejt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function E7(e,t,n,i){let r=e+t*n;return i[r]}function Cjt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=E7(s,a,n.width,n.buffer),d=E7(c,a,n.width,n.buffer),p=E7(s,u,n.width,n.buffer),g=E7(c,u,n.width,n.buffer),m=Ejt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Zh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var kM=pl;function C7(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(C7.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function nae(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(av(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function TI(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 r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,s=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=nae(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=nae(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=nae(a.color,a.transparency)))}break}}return n}function vjt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let s=TI(r[o].symbol,t),a=r[o].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=TI(r.symbol,t)}return n}}function Sjt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let s=r.classMaxValue??r.classMinValue,a=o.classMaxValue??o.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(TI(o.symbol,t)))}return i.symbols.push(void 0),i}}C7.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=TI(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=TI(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=vjt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=TI(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=Sjt(i,n))}};function vBe(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],s=e[o];return l(s)&&++n<t.length?vBe(s,t,n,i):s}}function wjt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function Ijt(e,t,n){let i=t[n],r=wjt(e.ranges,i);return e.symbols[r]}C7.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>vBe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>Ijt(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let s=0;s<o.length;s++){let a=r(s);l(a)&&(t[s]=a)}}}return t};var v7=C7;function Ju(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(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),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(Ju.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}}});Ju.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new v7(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()};Ju.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 r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Ju.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Ju.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 kM(this,t,!0)}else this._rootNode=new kM(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Ju.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]})};Ju._fetchJson=function(e){return e.fetchJson()};Ju.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Ju._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Ju.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Ju.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),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Ze(e):{},e.outlineColor=z.fromCartesian4(se.fromArray(r))),this._tileset=await es.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};Ju.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Ju.prototype.filterByAttributes=function(e){this._filters=l(e)?Ze(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var EI=Ju;function S7(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(S7.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}}});S7.prototype.load=async function(){return this._data=await E0.loadJson(this._resource),this._data};S7.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 w7=S7;function UM(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(UM.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}}});UM._fromData=async function(e,t,n,i){let r=new UM(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let s=[];for(let c=0;c<o.length;c++){let u=UM._fromData(e,t,o[c],r);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),s=new De({url:o});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),r._resource=s;let a=await E0.loadJson(r._resource),c=new EI(e,a,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var I7=UM;var IBe=js(SBe(),1);function ta(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??H.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(ta.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}}});ta.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};ta.prototype.isDestroyed=function(){return!1};ta.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};ta.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};ta.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};ta.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 Pjt(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 wBe(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=Pjt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=I7._fromData(e,i,t.sublayers[s],e);r.push(a)}let o=await Promise.all(r);for(let s=0;s<o.length;s++){let a=o[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new w7(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new EI(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.`)}ta.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await ta.loadJson(n),r=new ta(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=wBe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await wBe(r,i,t);r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};ta._fetchJson=function(e){return e.fetchJson()};ta.loadJson=async function(e){let t=await ta._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 oe(t.error)}return t};ta.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 oe(`Failed to load binary: ${e.url}`);return t};ta.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={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 r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var Djt=new U;function Rjt(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=U.fromElements(d,p,Djt),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof xi&&(A="WebMercator");let b={projectionType:A,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===Th.LERC){let x=IBe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function Ojt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await Rjt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}ta.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Ojt(this),this._geoidDataPromise)};ta.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};ta.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};ta.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[]};ta.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 E0=ta;var zM={};zM.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await fa.getExports(e,t);if(i.length>0&&i.every(c=>c.status===fa.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===fa.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let s=o.toString(),a=new De({url:s});return es.fromUrl(a,n)};zM.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await fa.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![fa.RealityDataType.Cesium3DTiles,fa.RealityDataType.PNTS,fa.RealityDataType.RealityMesh3DTiles,fa.RealityDataType.Terrain3DTiles,fa.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await fa.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return es.fromUrl(s,a)};zM.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await fa.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![fa.RealityDataType.KML,fa.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await fa.getRealityDataURL(e,t,i);return n===fa.RealityDataType.GeoJSON?DT.load(o):Yw.load(o)};zM.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${fa.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:fa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return DT.load(o)};var PBe=zM;function DBe(){}Object.defineProperties(DBe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var RBe=DBe;var Mjt=/\/$/,OBe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function CI(e){e=e??H.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=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();Mjt.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 It(c))):c=OBe,this._resource=i,this._imageryProvider=new Ls({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(CI.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}}});CI.prototype.getTileCredits=function(e,t,n){};CI.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};CI.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};CI._defaultCredit=OBe;var MBe=CI;var Njt=0,Ljt=14,Fjt=-1e3,Bjt=1e4,kjt=2*Math.PI*ee.WGS84.maximumRadius,Ujt=256,zjt=new ie,Vjt=new ie,iae=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??Njt,this._maxZoom=n.maxZoom??Ljt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=jjt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await es.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,ue(this)}};function jjt(e,t){let n=new No,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=Gjt(n,i,t.minZoom),o={boundingVolume:{region:FBe(i)},geometricError:LBe(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=NBe(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function NBe(e,t,n,i,r,o,s){if(!Wjt(e,i,o,s,n,zjt,Vjt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:FBe(a)},geometricError:i<r?LBe(i):0,refine:"REPLACE",content:{uri:Hjt(t,i,o,s)}};if(i>=r)return c;let u=i+1,f=[];for(let d=s*2;d<=s*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=NBe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function Hjt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return fh(o)}function LBe(e){return kjt/((1<<e)*Ujt)}function FBe(e){return[e.west,e.south,e.east,e.north,Fjt,Bjt]}function Gjt(e,t,n){let i=(1<<n)-1,r=he.fromRadians(t.west,t.north),o=he.fromRadians(t.east,t.south),s=e.positionToTileXY(r,n),a=e.positionToTileXY(o,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:P.clamp(Math.min(s.x,a.x),0,i),maxX:P.clamp(Math.max(s.x,a.x),0,i),minY:P.clamp(Math.min(s.y,a.y),0,i),maxY:P.clamp(Math.max(s.y,a.y),0,i)}}function Wjt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var D7=iae;var R7=class extends D7{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Hi.Z,t._modelForwardAxis=Hi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=p7(o),a=BBe(r.getUrlComponent(!0)),c=r7(s,a,{featureIdProperty:t});if(!l(c)){if(!qjt(s))return new Og(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return Wx.fromGltf(n,i,r,c)}}}};function BBe(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(yt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function qjt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}R7._parseTileCoordinates=BBe;var kBe=R7;function rae(e){}rae.prototype.isReady=function(){return!0};rae.prototype.shouldDiscardImage=function(e){return!1};var UBe=rae;var Yjt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function O7(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new No({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(a),o),u=n.positionToTileXY(ie.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??Yjt;typeof d=="string"&&(d=new It(d)),Ls.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(O7.prototype=Object.create(Ls.prototype),O7.prototype.constructor=O7);var rb=O7;function zBe(){pe.throwInstantiationError()}Object.defineProperties(zBe.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var VBe=zBe;function M7(){pe.throwInstantiationError()}Object.defineProperties(M7.prototype,{});M7.fromUrl=function(e){pe.throwInstantiationError()};M7.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var jBe=M7;var Xjt=new U(1,1);function oae(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??Xjt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(oae.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var HBe=new h;oae.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,HBe),h.add(this.position,HBe,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 VM=oae;function GBe(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(GBe.prototype,{complete:{get:function(){return this._complete}}});var WBe=GBe;function qBe(e){}qBe.prototype.emit=function(e){pe.throwInstantiationError()};var YBe=qBe;var XBe=new U(1,1);function jM(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new s7(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??XBe),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??XBe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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(jM.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||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.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 Kjt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new VM;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function $jt(e){let t=e._particlePool.pop();return l(t)||(t=new VM),t}function Jjt(e,t){e._particlePool.push(t)}function Zjt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function Qjt(e){l(e._billboard)&&(e._billboard.show=!1)}function KBe(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=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function e6t(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function t6t(e,t){if(e._isComplete)return 0;t=P.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 r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var N7=new h;jM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Nd),this._updateParticlePool&&(Kjt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?KBe(this,s):(Qjt(s),Jjt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=t6t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=$jt(this),this._emitter.emit(s),h.add(s.position,s.velocity,N7),M.multiplyByPoint(u,N7,N7),s.position=M.multiplyByPoint(u,s.position,s.position),h.subtract(N7,s.position,s.velocity),h.normalize(s.velocity,s.velocity),e6t(this,s),KBe(this,s)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&Zjt(this)};jM.prototype.isDestroyed=function(){return!1};jM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var $Be=jM;var sae=class{constructor(){ut(this,"quadtree");ut(this,"tilingScheme");ut(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},JBe=sae;function aae(e){e=e??1,this._radius=e??1}Object.defineProperties(aae.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});aae.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var ZBe=aae;function HM(){}HM.prototype.evaluate=function(e,t){pe.throwInstantiationError()};HM.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};HM.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};HM.prototype.getVariables=function(){pe.throwInstantiationError()};var QBe=HM;function vI(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,i6t(this,e)}Object.defineProperties(vI.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}}});vI.fromWorldTerrain=function(e){return new vI(wC(e))};vI.fromWorldBathymetry=function(e){return new vI(Dk(e))};function n6t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function i6t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){n6t(e._errorEvent,i)}}var L7=vI;function SI(){}SI.prototype.boundingVolume=void 0;SI.prototype.boundingSphere=void 0;SI.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};SI.prototype.intersectPlane=function(e){pe.throwInstantiationError()};SI.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var e2e=SI;function GM(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ir({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=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(GM.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}}});GM.prototype.getTileCredits=function(e,t,n){};GM.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};GM.prototype.pickFeatures=function(e,t,n,i,r){};var F7=GM;function cae(e){pe.throwInstantiationError()}cae.prototype.isReady=pe.throwInstantiationError;cae.prototype.shouldDiscardImage=pe.throwInstantiationError;var t2e=cae;var n2e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(n2e);var i2e=n2e;function B7(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=lr.fromType(lr.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}B7.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ge.fromCache({blending:rn.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 r=new Xe({sources:[this._material.shaderSource,n7]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};B7.prototype.isDestroyed=function(){return!1};B7.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var r2e=B7;var lae=class{constructor(){ut(this,"globalTransform");ut(this,"shapeTransform");ut(this,"shape");ut(this,"minBounds");ut(this,"maxBounds");ut(this,"dimensions");ut(this,"paddingBefore");ut(this,"paddingAfter");ut(this,"names");ut(this,"types");ut(this,"componentTypes");ut(this,"minimumValues");ut(this,"maximumValues");ut(this,"maximumTileCount");ut(this,"availableLevels");ut(this,"keyframeCount");ut(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},o2e=lae;function __(){pe.throwInstantiationError()}Object.defineProperties(__.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}});__.prototype.update=pe.throwInstantiationError;__.prototype.updateViewTransforms=pe.throwInstantiationError;__.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;__.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;__.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;__.DefaultMinBounds=pe.throwInstantiationError;__.DefaultMaxBounds=pe.throwInstantiationError;var s2e=__;var a2e=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -10892,49 +12729,42 @@ 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); } -`;function rEt(e){e=e??W.EMPTY_OBJECT;let t=c(e.typedArray),n=c(e.url);if(t===n)throw new C("exactly one of options.typedArray, options.url must be defined");if(t&&(!c(e.width)||!c(e.height)))throw new C("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ke.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let i=e.url;typeof i=="string"&&(i=we.createIfNeeded(i)),this.resource=i;let r=e.repeat??!0?gn.REPEAT:gn.CLAMP_TO_EDGE;this.sampler=new Qt({wrapS:r,wrapT:r,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var uCe=rEt;var sEt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},fCe=Object.freeze(sEt);var aEt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},dCe=Object.freeze(aEt);function cEt(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: ${g_(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 hCe=cEt;globalThis.CESIUM_VERSION="1.129";var eO;typeof ko<"u"&&(eO=ko);(function(){/*! +`;var uae=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},c2e=uae;var l2e=new h,r6t=new sn(h.UNIT_X,0),o6t=new gn,s6t=new U(1,1,1);function C0(e,t,n,i=s6t){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,l2e);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,l2e),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,r6t),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,o6t);return bi.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var u2e={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(u2e);var hc=u2e;function a6t(e){if(e===hc.LEFT)return fn.LEFT_DOWN;if(e===hc.MIDDLE)return fn.MIDDLE_DOWN;if(e===hc.RIGHT)return fn.RIGHT_DOWN}function c6t(e){if(e===hc.LEFT)return fn.LEFT_UP;if(e===hc.MIDDLE)return fn.MIDDLE_UP;if(e===hc.RIGHT)return fn.RIGHT_UP}var fae=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=a6t(s.button),c=c6t(s.button);l(a)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},a,s.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,s.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(s.modifier)}for(let s of r)t.setInputAction((...a)=>{o.isDragging&&l(i.change)&&i.change(...a)},fn.MOUSE_MOVE,s);return o}},v0=fae;var dae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=C0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new da(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let E=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=E,this._panVelocity.y*=E,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(s)<=P.EPSILON3&&Math.abs(a)<=P.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);s=P.clamp(s,-T,T),this._panVelocity.x=s/n,s*=this.panSpeed*x.x,a=P.clamp(a,-T,T),this._panVelocity.y=a/n,a*=this.panSpeed*x.y,i.move(p,s),i.move(g,a),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},k7=dae;var hae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=C0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new da(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let S=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=S,this._panVelocity.y*=S,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:u}=a;if(n===0||c===0||u===0||Math.abs(i)<=P.EPSILON3&&Math.abs(r)<=P.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=s.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));P.lessThan(y,1,P.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,E=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),v=this.maximumMovementRatio*Math.max(c,u);i=P.clamp(i,-v,v),this._panVelocity.x=i/n,i*=this.panSpeed*E.x,r=P.clamp(r,-v,v),this._panVelocity.y=r/n,r*=this.panSpeed*E.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},U7=hae;var mae=class{constructor(){this._elevatorController=new k7,this._mapController=new U7,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=P.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},f2e=mae;var pae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT,modifier:eo.CTRL}),Object.freeze({button:hc.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.pickWorldPosition=C0,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=P.PI,this.minimumTiltVelocity=P.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=P.TWO_PI,this.minimumOrbitVelocity=P.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Le,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new M,this._orbitTargetEast=new h,this._orbitQuaternion=new Le,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new da(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,s=ee.default){let a=At.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=M.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=P.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Le.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),E=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let v=h.add(n,E,this._orbitOrigin);t.lookAtWorldPosition(v,s)}tilt(t,n,i,r,o,s=ee.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let a=h.angleBetween(t.direction,i);(a<P.PI_OVER_TWO&&r>0||a>P.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(a)));let c=a+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;P.smoothDamp(a,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-a,p=$.fromQuaternion(Le.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,s)}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=r/2,a.y=o/2);let c=this.pickWorldPosition(t,a,this._target),u=l(c);this._hasTarget=u,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(s,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=P.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*P.TWO_PI,this.orbit(a,s,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=P.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*P.PI,this.tilt(a,s,f,d,n,c)}}this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}},d2e=pae;var gae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.MIDDLE})]}static _getDefaultScrollInputs(){return[fn.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.zoomSensitivity=.2,this.pickWorldPosition=C0,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=P.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new da(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),fn.MOUSE_MOVE),this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:s}=r;if(i===0||o===0||s===0){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=P.EPSILON3&&a>=-P.EPSILON3&&this.zoomVelocity<=P.EPSILON3){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=P.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=s/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=P.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=a*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=P.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},h2e=gae;var m2e={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(m2e);var p2e=m2e;var g2e={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(g2e);var _2e=g2e;function l6t(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,r);o.result=s}catch(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${z0(s)} + with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}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 y2e=l6t;globalThis.CESIUM_VERSION="1.145.0";var WM;typeof ko<"u"&&(WM=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 l(_,w){return _===null||typeof _ in y?_===w:!1}function u(_,w){var D;return function(){D||(D=m.a.setTimeout(function(){D=e,_()},w))}}function f(_,w){var D;return function(){clearTimeout(D),D=m.a.setTimeout(_,w)}}function h(_,w){w&&w!=="change"?w==="beforeChange"?this.pc(_):this.gb(_,w):this.qc(_)}function p(_,w){w!==null&&w.s&&w.s()}function g(_,w){var D=this.qd,I=D[S];I.ra||(this.Qb&&this.mb[w]?(D.uc(w,_,this.mb[w]),this.mb[w]=null,--this.Qb):I.I[w]||D.uc(w,_,I.J?{da:_}:D.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,w){for(var D=_.split("."),I=m,N=0;N<D.length-1;N++)I=I[D[N]];I[D[D.length-1]]=w},m.L=function(_,w,D){_[w]=D},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(K,Z){for(var ee in K)N.call(K,ee)&&Z(ee,K[ee])}function w(K,Z){if(Z)for(var ee in Z)N.call(Z,ee)&&(K[ee]=Z[ee]);return K}function D(K,Z){return K.__proto__=Z,K}function I(K,Z,ee,me){var xe=K[Z].match(X)||[];m.a.D(ee.match(X),function(ue){m.a.Na(xe,ue,me)}),K[Z]=xe.join(" ")}var N=Object.prototype.hasOwnProperty,k={__proto__:[]}instanceof Array,H=typeof Symbol=="function",V={},j={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(K,Z){if(Z.length)for(var ee=0,me=Z.length;ee<me;ee++)j[Z[ee]]=K});var U={propertychange:!0},q=n&&function(){for(var K=3,Z=n.createElement("div"),ee=Z.getElementsByTagName("i");Z.innerHTML="<!--[if gt IE "+ ++K+"]><i></i><![endif]-->",ee[0];);return 4<K?K:e}(),X=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(K,Z,ee){for(var me=0,xe=K.length;me<xe;me++)Z.call(ee,K[me],me,K)},A:typeof Array.prototype.indexOf=="function"?function(K,Z){return Array.prototype.indexOf.call(K,Z)}:function(K,Z){for(var ee=0,me=K.length;ee<me;ee++)if(K[ee]===Z)return ee;return-1},Lb:function(K,Z,ee){for(var me=0,xe=K.length;me<xe;me++)if(Z.call(ee,K[me],me,K))return K[me];return e},Pa:function(K,Z){var ee=m.a.A(K,Z);0<ee?K.splice(ee,1):ee===0&&K.shift()},wc:function(K){var Z=[];return K&&m.a.D(K,function(ee){0>m.a.A(Z,ee)&&Z.push(ee)}),Z},Mb:function(K,Z,ee){var me=[];if(K)for(var xe=0,ue=K.length;xe<ue;xe++)me.push(Z.call(ee,K[xe],xe));return me},jb:function(K,Z,ee){var me=[];if(K)for(var xe=0,ue=K.length;xe<ue;xe++)Z.call(ee,K[xe],xe)&&me.push(K[xe]);return me},Nb:function(K,Z){if(Z instanceof Array)K.push.apply(K,Z);else for(var ee=0,me=Z.length;ee<me;ee++)K.push(Z[ee]);return K},Na:function(K,Z,ee){var me=m.a.A(m.a.bc(K),Z);0>me?ee&&K.push(Z):ee||K.splice(me,1)},Ba:k,extend:w,setPrototypeOf:D,Ab:k?D:w,P:_,Ga:function(K,Z,ee){if(!K)return K;var me={},xe;for(xe in K)N.call(K,xe)&&(me[xe]=Z.call(ee,K[xe],xe,K));return me},Tb:function(K){for(;K.firstChild;)m.removeNode(K.firstChild)},Yb:function(K){K=m.a.la(K);for(var Z=(K[0]&&K[0].ownerDocument||n).createElement("div"),ee=0,me=K.length;ee<me;ee++)Z.appendChild(m.oa(K[ee]));return Z},Ca:function(K,Z){for(var ee=0,me=K.length,xe=[];ee<me;ee++){var ue=K[ee].cloneNode(!0);xe.push(Z?m.oa(ue):ue)}return xe},va:function(K,Z){if(m.a.Tb(K),Z)for(var ee=0,me=Z.length;ee<me;ee++)K.appendChild(Z[ee])},Xc:function(K,Z){var ee=K.nodeType?[K]:K;if(0<ee.length){for(var me=ee[0],xe=me.parentNode,ue=0,ye=Z.length;ue<ye;ue++)xe.insertBefore(Z[ue],me);for(ue=0,ye=ee.length;ue<ye;ue++)m.removeNode(ee[ue])}},Ua:function(K,Z){if(K.length){for(Z=Z.nodeType===8&&Z.parentNode||Z;K.length&&K[0].parentNode!==Z;)K.splice(0,1);for(;1<K.length&&K[K.length-1].parentNode!==Z;)K.length--;if(1<K.length){var ee=K[0],me=K[K.length-1];for(K.length=0;ee!==me;)K.push(ee),ee=ee.nextSibling;K.push(me)}}return K},Zc:function(K,Z){7>q?K.setAttribute("selected",Z):K.selected=Z},Db:function(K){return K===null||K===e?"":K.trim?K.trim():K.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(K,Z){return K=K||"",Z.length>K.length?!1:K.substring(0,Z.length)===Z},vd:function(K,Z){if(K===Z)return!0;if(K.nodeType===11)return!1;if(Z.contains)return Z.contains(K.nodeType!==1?K.parentNode:K);if(Z.compareDocumentPosition)return(Z.compareDocumentPosition(K)&16)==16;for(;K&&K!=Z;)K=K.parentNode;return!!K},Sb:function(K){return m.a.vd(K,K.ownerDocument.documentElement)},kd:function(K){return!!m.a.Lb(K,m.a.Sb)},R:function(K){return K&&K.tagName&&K.tagName.toLowerCase()},Ac:function(K){return m.onError?function(){try{return K.apply(this,arguments)}catch(Z){throw m.onError&&m.onError(Z),Z}}:K},setTimeout:function(K,Z){return setTimeout(m.a.Ac(K),Z)},Gc:function(K){setTimeout(function(){throw m.onError&&m.onError(K),K},0)},B:function(K,Z,ee){var me=m.a.Ac(ee);if(ee=U[Z],m.options.useOnlyNativeEvents||ee||!o)if(ee||typeof K.addEventListener!="function")if(typeof K.attachEvent<"u"){var xe=function(ye){me.call(K,ye)},ue="on"+Z;K.attachEvent(ue,xe),m.a.K.za(K,function(){K.detachEvent(ue,xe)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else K.addEventListener(Z,me,!1);else te||(te=typeof o(K).on=="function"?"on":"bind"),o(K)[te](Z,me)},Fb:function(K,Z){if(!K||!K.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(m.a.R(K)==="input"&&K.type&&Z.toLowerCase()=="click"?(ee=K.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,m.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof K.dispatchEvent=="function")ee=n.createEvent(j[Z]||"HTMLEvents"),ee.initEvent(Z,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,K),K.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&K.click)K.click();else if(typeof K.fireEvent<"u")K.fireEvent("on"+Z);else throw Error("Browser doesn't support triggering events");else o(K).trigger(Z)},f:function(K){return m.O(K)?K():K},bc:function(K){return m.O(K)?K.v():K},Eb:function(K,Z,ee){var me;Z&&(typeof K.classList=="object"?(me=K.classList[ee?"add":"remove"],m.a.D(Z.match(X),function(xe){me.call(K.classList,xe)})):typeof K.className.baseVal=="string"?I(K.className,"baseVal",Z,ee):I(K,"className",Z,ee))},Bb:function(K,Z){var ee=m.a.f(Z);(ee===null||ee===e)&&(ee="");var me=m.h.firstChild(K);!me||me.nodeType!=3||m.h.nextSibling(me)?m.h.va(K,[K.ownerDocument.createTextNode(ee)]):me.data=ee,m.a.Ad(K)},Yc:function(K,Z){if(K.name=Z,7>=q)try{var ee=K.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});K.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(K){9<=q&&(K=K.nodeType==1?K:K.parentNode,K.style&&(K.style.zoom=K.style.zoom))},wd:function(K){if(q){var Z=K.style.width;K.style.width=0,K.style.width=Z}},Pd:function(K,Z){K=m.a.f(K),Z=m.a.f(Z);for(var ee=[],me=K;me<=Z;me++)ee.push(me);return ee},la:function(K){for(var Z=[],ee=0,me=K.length;ee<me;ee++)Z.push(K[ee]);return Z},Da:function(K){return H?Symbol(K):K},Zd:q===6,$d:q===7,W:q,Lc:function(K,Z){for(var ee=m.a.la(K.getElementsByTagName("input")).concat(m.a.la(K.getElementsByTagName("textarea"))),me=typeof Z=="string"?function(ye){return ye.name===Z}:function(ye){return Z.test(ye.name)},xe=[],ue=ee.length-1;0<=ue;ue--)me(ee[ue])&&xe.push(ee[ue]);return xe},Nd:function(K){return typeof K=="string"&&(K=m.a.Db(K))?r&&r.parse?r.parse(K):new Function("return "+K)():null},hc:function(K,Z,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(m.a.f(K),Z,ee)},Od:function(K,Z,ee){ee=ee||{};var me=ee.params||{},xe=ee.includeFields||this.Jc,ue=K;if(typeof K=="object"&&m.a.R(K)==="form")for(var ue=K.action,ye=xe.length-1;0<=ye;ye--)for(var Ae=m.a.Lc(K,xe[ye]),Pe=Ae.length-1;0<=Pe;Pe--)me[Ae[Pe].name]=Ae[Pe].value;Z=m.a.f(Z);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=ue,Ee.method="post";for(var Ve in Z)K=n.createElement("input"),K.type="hidden",K.name=Ve,K.value=m.a.hc(m.a.f(Z[Ve])),Ee.appendChild(K);_(me,function(je,it){var Dt=n.createElement("input");Dt.type="hidden",Dt.name=je,Dt.value=it,Ee.appendChild(Dt)}),n.body.appendChild(Ee),ee.submitter?ee.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var w=this;if(arguments.length===1)return function(){return w.apply(_,arguments)};var D=Array.prototype.slice.call(arguments,1);return function(){var I=D.slice(0);return I.push.apply(I,arguments),w.apply(_,I)}}),m.a.g=new function(){var _=0,w="__ko__"+new Date().getTime(),D={},I,N;return m.a.W?(I=function(k,H){var V=k[w];if(!V||V==="null"||!D[V]){if(!H)return e;V=k[w]="ko"+_++,D[V]={}}return D[V]},N=function(k){var H=k[w];return H?(delete D[H],k[w]=null,!0):!1}):(I=function(k,H){var V=k[w];return!V&&H&&(V=k[w]={}),V},N=function(k){return k[w]?(delete k[w],!0):!1}),{get:function(k,H){var V=I(k,!1);return V&&V[H]},set:function(k,H,V){(k=I(k,V!==e))&&(k[H]=V)},Ub:function(k,H,V){return k=I(k,!0),k[H]||(k[H]=V)},clear:N,Z:function(){return _+++w}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(H,V){var j=m.a.g.get(H,I);return j===e&&V&&(j=[],m.a.g.set(H,I,j)),j}function w(H){var V=_(H,!1);if(V)for(var V=V.slice(0),j=0;j<V.length;j++)V[j](H);m.a.g.clear(H),m.a.K.cleanExternalData(H),k[H.nodeType]&&D(H.childNodes,!0)}function D(H,V){for(var j=[],U,q=0;q<H.length;q++)if((!V||H[q].nodeType===8)&&(w(j[j.length]=U=H[q]),H[q]!==U))for(;q--&&m.a.A(j,H[q])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},k={1:!0,9:!0};return{za:function(H,V){if(typeof V!="function")throw Error("Callback must be a function");_(H,!0).push(V)},yb:function(H,V){var j=_(H,!1);j&&(m.a.Pa(j,V),j.length==0&&m.a.g.set(H,I,e))},oa:function(H){return m.u.G(function(){N[H.nodeType]&&(w(H),k[H.nodeType]&&D(H.getElementsByTagName("*")))}),H},removeNode:function(H){m.oa(H),H.parentNode&&H.parentNode.removeChild(H)},cleanExternalData:function(H){o&&typeof o.cleanData=="function"&&o.cleanData([H])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var _=[0,"",""],w=[1,"<table>","</table>"],D=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:w,tbody:w,tfoot:w,tr:[2,"<table><tbody>","</tbody></table>"],td:D,th:D,option:I,optgroup:I},k=8>=m.a.W;m.a.ua=function(H,V){var j;if(o){if(o.parseHTML)j=o.parseHTML(H,V)||[];else if((j=o.clean([H],V))&&j[0]){for(var U=j[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(j=V)||(j=n);var U=j.parentWindow||j.defaultView||t,q=m.a.Db(H).toLowerCase(),X=j.createElement("div"),te;for(te=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[q[1]]||_,q=te[0],te="ignored<div>"+te[1]+H+te[2]+"</div>",typeof U.innerShiv=="function"?X.appendChild(U.innerShiv(te)):(k&&j.body.appendChild(X),X.innerHTML=te,k&&X.parentNode.removeChild(X));q--;)X=X.lastChild;j=m.a.la(X.lastChild.childNodes)}return j},m.a.Md=function(H,V){var j=m.a.ua(H,V);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(H,V){if(m.a.Tb(H),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(H).html(V);else for(var j=m.a.ua(V,H.ownerDocument),U=0;U<j.length;U++)H.appendChild(j[U])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(D,I){if(D){if(D.nodeType==8){var N=m.aa.Uc(D.nodeValue);N!=null&&I.push({ud:D,Kd:N})}else if(D.nodeType==1)for(var N=0,k=D.childNodes,H=k.length;N<H;N++)_(k[N],I)}}var w={};return{Xb:function(D){if(typeof D!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return w[I]=D,"<!--[ko_memo:"+I+"]-->"},bd:function(D,I){var N=w[D];if(N===e)throw Error("Couldn't find any memo with ID "+D+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete w[D]}},cd:function(D,I){var N=[];_(D,N);for(var k=0,H=N.length;k<H;k++){var V=N[k].ud,j=[V];I&&m.a.Nb(j,I),m.aa.bd(N[k].Kd,j),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(D){return(D=D.match(/^\[ko_memo\:(.*?)\]$/))?D[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function _(){if(N){for(var V=N,j=0,U;H<N;)if(U=I[H++]){if(H>V){if(5e3<=++j){H=N,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}V=N}try{U()}catch(q){m.a.Gc(q)}}}}function w(){_(),H=N=I.length=0}var D,I=[],N=0,k=1,H=0;return t.MutationObserver?D=function(V){var j=n.createElement("div");return new MutationObserver(V).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}}(w):D=n&&"onreadystatechange"in n.createElement("script")?function(V){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,V()},n.documentElement.appendChild(j)}:function(V){setTimeout(V,0)},{scheduler:D,zb:function(V){return N||m.na.scheduler(w),I[N++]=V,k++},cancel:function(V){V=V-(k-N),V>=H&&V<N&&(I[V]=null)},resetForTesting:function(){var V=N-H;return H=N=I.length=0,V},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,w){_.throttleEvaluation=w;var D=null;return m.$({read:_,write:function(I){clearTimeout(D),D=m.a.setTimeout(function(){_(I)},w)}})},rateLimit:function(_,w){var D,I,N;typeof w=="number"?D=w:(D=w.timeout,I=w.method),_.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(k){return N(k,D,w)})},deferred:function(_,w){if(w!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(D){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(D);try{N=!0,_.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(_,w){_.equalityComparer=w=="always"?null:l}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,w,D){this.da=_,this.lc=w,this.mc=D,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,w,D){var I=this;D=D||"change";var N=new m.ic(I,w?_.bind(w):_,function(){m.a.Pa(I.U[D],N),I.hb&&I.hb(D)});return I.Qa&&I.Qa(D),I.U[D]||(I.U[D]=[]),I.U[D].push(N),N},notifySubscribers:function(_,w){if(w=w||"change",w==="change"&&this.Gb(),this.Wa(w)){var D=w==="change"&&this.ed||this.U[w].slice(0);try{m.u.xc();for(var I=0,N;N=D[I];++I)N.Ib||N.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var w=this,D=m.O(w),I,N,k,H,V;w.gb||(w.gb=w.notifySubscribers,w.notifySubscribers=h);var j=_(function(){w.Ja=!1,D&&H===w&&(H=w.nc?w.nc():w());var U=N||V&&w.sb(k,H);V=N=I=!1,U&&w.gb(k=H)});w.qc=function(U,q){q&&w.Ja||(V=!q),w.ed=w.U.change.slice(0),w.Ja=I=!0,H=U,j()},w.pc=function(U){I||(k=U,w.gb(U,"beforeChange"))},w.rc=function(){V=!0},w.gd=function(){w.sb(k,w.v(!0))&&(N=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var w=0;return m.a.P(this.U,function(D,I){D!=="dirty"&&(w+=I.length)}),w},sb:function(_,w){return!this.equalityComparer||!this.equalityComparer(_,w)},toString:function(){return"[object Object]"},extend:function(_){var w=this;return _&&m.a.P(_,function(D,I){var N=m.Ta[D];typeof N=="function"&&(w=N(w,I)||w)}),w}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(k){D.push(I),I=k}function w(){I=D.pop()}var D=[],I,N=0;return{xc:_,end:w,cc:function(k){if(I){if(!m.Qc(k))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,k,k.fd||(k.fd=++N))}},G:function(k,H,V){try{return _(),k.apply(H,V||[])}finally{w()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var x=m.a.Da("_latestValue");m.ta=function(_){function w(){return 0<arguments.length?(w.sb(w[x],arguments[0])&&(w.ya(),w[x]=arguments[0],w.xa()),this):(m.u.cc(w),w[x])}return w[x]=_,m.a.Ba||m.a.extend(w,m.T.fn),m.T.fn.qb(w),m.a.Ab(w,A),m.options.deferUpdates&&m.Ta.deferred(w,!0),w};var A={equalityComparer:l,v:function(){return this[x]},xa:function(){this.notifySubscribers(this[x],"spectate"),this.notifySubscribers(this[x])},ya:function(){this.notifySubscribers(this[x],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(A,m.T.fn);var E=m.ta.Ma="__ko_proto__";A[E]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[E])&&_!==A[E]&&_!==m.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[E]===A[E]||_[E]===m.o.fn[E]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",A),m.L(A,"peek",A.v),m.L(A,"valueHasMutated",A.xa),m.L(A,"valueWillMutate",A.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var w=this.v(),D=[],I=typeof _!="function"||m.O(_)?function(H){return H===_}:_,N=0;N<w.length;N++){var k=w[N];if(I(k)){if(D.length===0&&this.ya(),w[N]!==k)throw Error("Array modified during remove; cannot remove item");D.push(k),w.splice(N,1),N--}}return D.length&&this.xa(),D},removeAll:function(_){if(_===e){var w=this.v(),D=w.slice(0);return this.ya(),w.splice(0,w.length),this.xa(),D}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var w=this.v(),D=typeof _!="function"||m.O(_)?function(k){return k===_}:_;this.ya();for(var I=w.length-1;0<=I;I--){var N=w[I];D(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(w){return 0<=m.a.A(_,w)}):[]},indexOf:function(_){var w=this();return m.a.A(w,_)},replace:function(_,w){var D=this.indexOf(_);0<=D&&(this.ya(),this.v()[D]=w,this.xa())},sorted:function(_){var w=this().slice(0);return _?w.sort(_):w.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var w=this.v();this.ya(),this.zc(w,_,arguments);var D=w[_].apply(w,arguments);return this.xa(),D===w?this:D}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var w=this();return w[_].apply(w,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,w){function D(){function X(){if(V){var te=[].concat(_.v()||[]),K;_.Wa("arrayChange")&&((!N||1<V)&&(N=m.a.Pb(j,te,_.Ob)),K=N),j=te,N=null,V=0,K&&K.length&&_.notifySubscribers(K,"arrayChange")}}I?X():(I=!0,H=_.subscribe(function(){++V},null,"spectate"),j=[].concat(_.v()||[]),N=null,k=_.subscribe(X))}if(_.Ob={},w&&typeof w=="object"&&m.a.extend(_.Ob,w),_.Ob.sparse=!0,!_.zc){var I=!1,N=null,k,H,V=0,j,U=_.Qa,q=_.hb;_.Qa=function(X){U&&U.call(_,X),X==="arrayChange"&&D()},_.hb=function(X){q&&q.call(_,X),X!=="arrayChange"||_.Wa("arrayChange")||(k&&k.s(),H&&H.s(),H=k=null,I=!1,j=e)},_.zc=function(X,te,K){function Z(Ee,Ve,je){return ee[ee.length]={status:Ee,value:Ve,index:je}}if(I&&!V){var ee=[],me=X.length,xe=K.length,ue=0;switch(te){case"push":ue=me;case"unshift":for(te=0;te<xe;te++)Z("added",K[te],ue+te);break;case"pop":ue=me-1;case"shift":me&&Z("deleted",X[ue],ue);break;case"splice":te=Math.min(Math.max(0,0>K[0]?me+K[0]:K[0]),me);for(var me=xe===1?me:Math.min(te+(K[1]||0),me),xe=te+xe-2,ue=Math.max(me,xe),ye=[],Ae=[],Pe=2;te<ue;++te,++Pe)te<me&&Ae.push(Z("deleted",X[te],te)),te<xe&&ye.push(Z("added",K[Pe],te));m.a.Kc(Ae,ye);break;default:return}N=ee}}}};var S=m.a.Da("_state");m.o=m.$=function(_,w,D){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(k.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 k.ra||m.u.cc(I),(k.ka||k.J&&I.Xa())&&I.ha(),k.X}if(typeof _=="object"?D=_:(D=D||{},_&&(D.read=_)),typeof D.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=D.write,k={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:D.read,nb:w||D.owner,l:D.disposeWhenNodeIsRemoved||D.l||null,Sa:D.disposeWhen||D.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=k,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),D.pure?(k.wb=!0,k.J=!0,m.a.extend(I,P)):D.deferEvaluation&&m.a.extend(I,M),m.options.deferUpdates&&m.Ta.deferred(I,!0),k.l&&(k.jc=!0,k.l.nodeType||(k.l=null)),k.J||D.deferEvaluation||I.ha(),k.l&&I.ja()&&m.a.K.za(k.l,k.Rb=function(){I.s()}),I};var v={equalityComparer:l,qa:function(){return this[S].V},Va:function(){var _=[];return m.a.P(this[S].I,function(w,D){_[D.Ka]=D.da}),_},Vb:function(_){if(!this[S].V)return!1;var w=this.Va();return m.a.A(w,_)!==-1?!0:!!m.a.Lb(w,function(D){return D.Vb&&D.Vb(_)})},uc:function(_,w,D){if(this[S].wb&&w===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=D,D.Ka=this[S].V++,D.La=w.ob()},Xa:function(){var _,w,D=this[S].I;for(_ in D)if(Object.prototype.hasOwnProperty.call(D,_)&&(w=D[_],this.Ia&&w.da.Ja||w.da.Dd(w.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var w=_.subscribe(this.Jd,this,"dirty"),D=_.subscribe(this.Rd,this);return{da:_,s:function(){w.s(),D.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,w=_.throttleEvaluation;w&&0<=w?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){_.ha(!0)},w)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var w=this[S],D=w.Sa,I=!1;if(!w.rb&&!w.ra){if(w.l&&!m.a.Sb(w.l)||D&&D()){if(!w.jc){this.s();return}}else w.jc=!1;w.rb=!0;try{I=this.zd(_)}finally{w.rb=!1}return I}},zd:function(_){var w=this[S],I=!1,D=w.wb?e:!w.V,I={qd:this,mb:w.I,Qb:w.V};m.u.xc({pd:I,od:g,o:this,Ya:D}),w.I={},w.V=0;var N=this.yd(w,I);return w.V?I=this.sb(w.X,N):(this.s(),I=!0),I&&(w.J?this.Gb():this.notifySubscribers(w.X,"beforeChange"),w.X=N,this.notifySubscribers(w.X,"spectate"),!w.J&&_&&this.notifySubscribers(w.X),this.rc&&this.rc()),D&&this.notifySubscribers(w.X,"awake"),I},yd:function(_,w){try{var D=_.Wc;return _.nb?D.call(_.nb):D()}finally{m.u.end(),w.Qb&&!_.J&&m.a.P(w.mb,p),_.sa=_.ka=!1}},v:function(_){var w=this[S];return(w.ka&&(_||!w.V)||w.J&&this.Xa())&&this.ha(),w.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(w){this.pc(this[S].X),this[S].ka=!0,w&&(this[S].sa=!0),this.qc(this,!w)}},s:function(){var _=this[S];!_.J&&_.I&&m.a.P(_.I,function(w,D){D.s&&D.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},P={Qa:function(_){var w=this,D=w[S];if(!D.ra&&D.J&&_=="change"){if(D.J=!1,D.sa||w.Xa())D.I=null,D.V=0,w.ha()&&w.Gb();else{var I=[];m.a.P(D.I,function(N,k){I[k.Ka]=N}),m.a.D(I,function(N,k){var H=D.I[N],V=w.$c(H.da);V.Ka=k,V.La=H.La,D.I[N]=V}),w.Xa()&&w.ha()&&w.Gb()}D.ra||w.notifySubscribers(D.X,"awake")}},hb:function(_){var w=this[S];w.ra||_!="change"||this.Wa("change")||(m.a.P(w.I,function(D,I){I.s&&(w.I[D]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),w.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},M={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[S]&&_[S].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,w){return typeof _=="function"?m.o(_,w,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,w))},m.b("pureComputed",m.xb),function(){function _(I,N,k){if(k=k||new D,I=N(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var H=I instanceof Array?[]:{};return k.save(I,H),w(I,function(V){var j=N(I[V]);switch(typeof j){case"boolean":case"number":case"string":case"function":H[V]=j;break;case"object":case"undefined":var U=k.get(j);H[V]=U!==e?U:_(j,N,k)}}),H}function w(I,N){if(I instanceof Array){for(var k=0;k<I.length;k++)N(k);typeof I.toJSON=="function"&&N("toJSON")}else for(k in I)N(k)}function D(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(N){for(var k=0;m.O(N)&&10>k;k++)N=N();return N})},m.toJSON=function(I,N,k){return I=m.ad(I),m.a.hc(I,N,k)},D.prototype={constructor:D,save:function(I,N){var k=m.a.A(this.keys,I);0<=k?this.values[k]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,w,D){function I(N){var k=m.xb(_,D).extend({ma:"always"}),H=k.subscribe(function(V){V&&(H.s(),N(V))});return k.notifySubscribers(k.v()),H}return typeof Promise!="function"||w?I(w.bind(D)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,w,D){switch(m.a.R(_)){case"option":typeof w=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=w):(m.a.g.set(_,m.c.options.$b,w),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof w=="number"?w:"");break;case"select":(w===""||w===null)&&(w=e);for(var I=-1,N=0,k=_.options.length,H;N<k;++N)if(H=m.w.M(_.options[N]),H==w||H===""&&w===e){I=N;break}(D||0<=I||w===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(w===null||w===e)&&(w=""),_.value=w}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=` -,`;var j=[],U=V.match(I),q,X=[],te=0;if(1<U.length){for(var K=0,Z;Z=U[K];++K){var ee=Z.charCodeAt(0);if(ee===44){if(0>=te){j.push(q&&X.length?{key:q,value:X.join("")}:{unknown:q||X.join("")}),q=te=0,X=[];continue}}else if(ee===58){if(!te&&!q&&X.length===1){q=X.pop();continue}}else{if(ee===47&&1<Z.length&&(Z.charCodeAt(1)===47||Z.charCodeAt(1)===42))continue;ee===47&&K&&1<Z.length?(ee=U[K-1].match(N))&&!k[ee[0]]&&(V=V.substr(V.indexOf(Z)+1),U=V.match(I),K=-1,Z="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:q||X.length||ee!==34&&ee!==39||(Z=Z.slice(1,-1))}X.push(Z)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var w=["true","false","null","undefined"],D=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* -|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,k={in:1,return:1,typeof:1},H={};return{Ra:[],wa:H,ac:_,vb:function(V,j){function U(ee,me){var xe;if(!K){var ue=m.getBindingHandler(ee);if(ue&&ue.preprocess&&!(me=ue.preprocess(me,ee,U)))return;(ue=H[ee])&&(xe=me,0<=m.a.A(w,xe)?xe=!1:(ue=xe.match(D),xe=ue===null?!1:ue[1]?"Object("+ue[1]+")"+ue[2]:xe),ue=xe),ue&&X.push("'"+(typeof H[ee]=="string"?H[ee]:ee)+"':function(_z){"+xe+"=_z}")}te&&(me="function(){return "+me+" }"),q.push("'"+ee+"':"+me)}j=j||{};var q=[],X=[],te=j.valueAccessors,K=j.bindingParams,Z=typeof V=="string"?_(V):V;return m.a.D(Z,function(ee){U(ee.key||ee.unknown,ee.value)}),X.length&&U("_ko_property_writers","{"+X.join(",")+" }"),q.join(",")},Id:function(V,j){for(var U=0;U<V.length;U++)if(V[U].key==j)return!0;return!1},eb:function(V,j,U,q,X){V&&m.O(V)?!m.Za(V)||X&&V.v()===q||V(q):(V=j.get("_ko_property_writers"))&&V[U]&&V[U](q)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function _(U){return U.nodeType==8&&k.test(N?U.text:U.nodeValue)}function w(U){return U.nodeType==8&&H.test(N?U.text:U.nodeValue)}function D(U,q){for(var X=U,te=1,K=[];X=X.nextSibling;){if(w(X)&&(m.a.g.set(X,j,!0),te--,te===0))return K;K.push(X),_(X)&&te++}if(!q)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,q){var X=D(U,q);return X?0<X.length?X[X.length-1].nextSibling:U.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",k=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,H=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(U){return _(U)?D(U):U.childNodes},Ea:function(U){if(_(U)){U=m.h.childNodes(U);for(var q=0,X=U.length;q<X;q++)m.removeNode(U[q])}else m.a.Tb(U)},va:function(U,q){if(_(U)){m.h.Ea(U);for(var X=U.nextSibling,te=0,K=q.length;te<K;te++)X.parentNode.insertBefore(q[te],X)}else m.a.va(U,q)},Vc:function(U,q){var X;_(U)?(X=U.nextSibling,U=U.parentNode):X=U.firstChild,X?q!==X&&U.insertBefore(q,X):U.appendChild(q)},Wb:function(U,q,X){X?(X=X.nextSibling,_(U)&&(U=U.parentNode),X?q!==X&&U.insertBefore(q,X):U.appendChild(q)):m.h.Vc(U,q)},firstChild:function(U){if(_(U))return!U.nextSibling||w(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&w(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&w(U.nextSibling)){var q=U.nextSibling;if(w(q)&&!m.a.g.get(q,j))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(N?U.text:U.nodeValue).match(k))?U[1]:null},Sc:function(U){if(V[m.a.R(U)]){var q=U.firstChild;if(q)do if(q.nodeType===1){var X;X=q.firstChild;var te=null;if(X)do if(te)te.push(X);else if(_(X)){var K=I(X,!0);K?X=K:te=[X]}else w(X)&&(te=[X]);while(X=X.nextSibling);if(X=te)for(te=q.nextSibling,K=0;K<X.length;K++)te?U.insertBefore(X[K],te):U.appendChild(X[K])}while(q=q.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_):null;return m.j.tc(D,_,w,!1)},getBindingAccessors:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_,{valueAccessors:!0}):null;return m.j.tc(D,_,w,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,w,D,I){try{var N=this.nd,k=_+(I&&I.valueAccessors||""),H;if(!(H=N[k])){var V,j="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";V=new Function("$context","$element",j),H=N[k]=V}return H(w,D)}catch(U){throw U.message=`Unable to parse bindings. + */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||typeof jQuery>"u"||(r=jQuery),(function(s){s(t.ko={})})(function(s,a){function c(_,C){return _===null||typeof _ in y?_===C:!1}function u(_,C){var w;return function(){w||(w=m.a.setTimeout(function(){w=e,_()},C))}}function f(_,C){var w;return function(){clearTimeout(w),w=m.a.setTimeout(_,C)}}function d(_,C){C&&C!=="change"?C==="beforeChange"?this.pc(_):this.gb(_,C):this.qc(_)}function p(_,C){C!==null&&C.s&&C.s()}function g(_,C){var w=this.qd,D=w[E];D.ra||(this.Qb&&this.mb[C]?(w.uc(C,_,this.mb[C]),this.mb[C]=null,--this.Qb):D.I[C]||w.uc(C,_,D.J?{da:_}:w.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,C){for(var w=_.split("."),D=m,N=0;N<w.length-1;N++)D=D[w[N]];D[w[w.length-1]]=C},m.L=function(_,C,w){_[C]=w},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=(function(){function _(W,J){for(var Z in W)N.call(W,Z)&&J(Z,W[Z])}function C(W,J){if(J)for(var Z in J)N.call(J,Z)&&(W[Z]=J[Z]);return W}function w(W,J){return W.__proto__=J,W}function D(W,J,Z,ae){var Ae=W[J].match(q)||[];m.a.D(Z.match(q),function(fe){m.a.Na(Ae,fe,ae)}),W[J]=Ae.join(" ")}var N=Object.prototype.hasOwnProperty,F={__proto__:[]}instanceof Array,V=typeof Symbol=="function",B={},j={};B[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],B.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(B,function(W,J){if(J.length)for(var Z=0,ae=J.length;Z<ae;Z++)j[J[Z]]=W});var k={propertychange:!0},G=n&&(function(){for(var W=3,J=n.createElement("div"),Z=J.getElementsByTagName("i");J.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",Z[0];);return 4<W?W:e})(),q=/\S+/g,Q;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,J,Z){for(var ae=0,Ae=W.length;ae<Ae;ae++)J.call(Z,W[ae],ae,W)},A:typeof Array.prototype.indexOf=="function"?function(W,J){return Array.prototype.indexOf.call(W,J)}:function(W,J){for(var Z=0,ae=W.length;Z<ae;Z++)if(W[Z]===J)return Z;return-1},Lb:function(W,J,Z){for(var ae=0,Ae=W.length;ae<Ae;ae++)if(J.call(Z,W[ae],ae,W))return W[ae];return e},Pa:function(W,J){var Z=m.a.A(W,J);0<Z?W.splice(Z,1):Z===0&&W.shift()},wc:function(W){var J=[];return W&&m.a.D(W,function(Z){0>m.a.A(J,Z)&&J.push(Z)}),J},Mb:function(W,J,Z){var ae=[];if(W)for(var Ae=0,fe=W.length;Ae<fe;Ae++)ae.push(J.call(Z,W[Ae],Ae));return ae},jb:function(W,J,Z){var ae=[];if(W)for(var Ae=0,fe=W.length;Ae<fe;Ae++)J.call(Z,W[Ae],Ae)&&ae.push(W[Ae]);return ae},Nb:function(W,J){if(J instanceof Array)W.push.apply(W,J);else for(var Z=0,ae=J.length;Z<ae;Z++)W.push(J[Z]);return W},Na:function(W,J,Z){var ae=m.a.A(m.a.bc(W),J);0>ae?Z&&W.push(J):Z||W.splice(ae,1)},Ba:F,extend:C,setPrototypeOf:w,Ab:F?w:C,P:_,Ga:function(W,J,Z){if(!W)return W;var ae={},Ae;for(Ae in W)N.call(W,Ae)&&(ae[Ae]=J.call(Z,W[Ae],Ae,W));return ae},Tb:function(W){for(;W.firstChild;)m.removeNode(W.firstChild)},Yb:function(W){W=m.a.la(W);for(var J=(W[0]&&W[0].ownerDocument||n).createElement("div"),Z=0,ae=W.length;Z<ae;Z++)J.appendChild(m.oa(W[Z]));return J},Ca:function(W,J){for(var Z=0,ae=W.length,Ae=[];Z<ae;Z++){var fe=W[Z].cloneNode(!0);Ae.push(J?m.oa(fe):fe)}return Ae},va:function(W,J){if(m.a.Tb(W),J)for(var Z=0,ae=J.length;Z<ae;Z++)W.appendChild(J[Z])},Xc:function(W,J){var Z=W.nodeType?[W]:W;if(0<Z.length){for(var ae=Z[0],Ae=ae.parentNode,fe=0,xe=J.length;fe<xe;fe++)Ae.insertBefore(J[fe],ae);for(fe=0,xe=Z.length;fe<xe;fe++)m.removeNode(Z[fe])}},Ua:function(W,J){if(W.length){for(J=J.nodeType===8&&J.parentNode||J;W.length&&W[0].parentNode!==J;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==J;)W.length--;if(1<W.length){var Z=W[0],ae=W[W.length-1];for(W.length=0;Z!==ae;)W.push(Z),Z=Z.nextSibling;W.push(ae)}}return W},Zc:function(W,J){7>G?W.setAttribute("selected",J):W.selected=J},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,J){return W=W||"",J.length>W.length?!1:W.substring(0,J.length)===J},vd:function(W,J){if(W===J)return!0;if(W.nodeType===11)return!1;if(J.contains)return J.contains(W.nodeType!==1?W.parentNode:W);if(J.compareDocumentPosition)return(J.compareDocumentPosition(W)&16)==16;for(;W&&W!=J;)W=W.parentNode;return!!W},Sb:function(W){return m.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!m.a.Lb(W,m.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return m.onError?function(){try{return W.apply(this,arguments)}catch(J){throw m.onError&&m.onError(J),J}}:W},setTimeout:function(W,J){return setTimeout(m.a.Ac(W),J)},Gc:function(W){setTimeout(function(){throw m.onError&&m.onError(W),W},0)},B:function(W,J,Z){var ae=m.a.Ac(Z);if(Z=k[J],m.options.useOnlyNativeEvents||Z||!r)if(Z||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var Ae=function(xe){ae.call(W,xe)},fe="on"+J;W.attachEvent(fe,Ae),m.a.K.za(W,function(){W.detachEvent(fe,Ae)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(J,ae,!1);else Q||(Q=typeof r(W).on=="function"?"on":"bind"),r(W)[Q](J,ae)},Fb:function(W,J){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(m.a.R(W)==="input"&&W.type&&J.toLowerCase()=="click"?(Z=W.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,m.options.useOnlyNativeEvents||!r||Z)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")Z=n.createEvent(j[J]||"HTMLEvents"),Z.initEvent(J,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+J);else throw Error("Browser doesn't support triggering events");else r(W).trigger(J)},f:function(W){return m.O(W)?W():W},bc:function(W){return m.O(W)?W.v():W},Eb:function(W,J,Z){var ae;J&&(typeof W.classList=="object"?(ae=W.classList[Z?"add":"remove"],m.a.D(J.match(q),function(Ae){ae.call(W.classList,Ae)})):typeof W.className.baseVal=="string"?D(W.className,"baseVal",J,Z):D(W,"className",J,Z))},Bb:function(W,J){var Z=m.a.f(J);(Z===null||Z===e)&&(Z="");var ae=m.h.firstChild(W);!ae||ae.nodeType!=3||m.h.nextSibling(ae)?m.h.va(W,[W.ownerDocument.createTextNode(Z)]):ae.data=Z,m.a.Ad(W)},Yc:function(W,J){if(W.name=J,7>=G)try{var Z=W.name.replace(/[&<>'"]/g,function(ae){return"&#"+ae.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(W){9<=G&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(G){var J=W.style.width;W.style.width=0,W.style.width=J}},Pd:function(W,J){W=m.a.f(W),J=m.a.f(J);for(var Z=[],ae=W;ae<=J;ae++)Z.push(ae);return Z},la:function(W){for(var J=[],Z=0,ae=W.length;Z<ae;Z++)J.push(W[Z]);return J},Da:function(W){return V?Symbol(W):W},Zd:G===6,$d:G===7,W:G,Lc:function(W,J){for(var Z=m.a.la(W.getElementsByTagName("input")).concat(m.a.la(W.getElementsByTagName("textarea"))),ae=typeof J=="string"?function(xe){return xe.name===J}:function(xe){return J.test(xe.name)},Ae=[],fe=Z.length-1;0<=fe;fe--)ae(Z[fe])&&Ae.push(Z[fe]);return Ae},Nd:function(W){return typeof W=="string"&&(W=m.a.Db(W))?o&&o.parse?o.parse(W):new Function("return "+W)():null},hc:function(W,J,Z){if(!o||!o.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 o.stringify(m.a.f(W),J,Z)},Od:function(W,J,Z){Z=Z||{};var ae=Z.params||{},Ae=Z.includeFields||this.Jc,fe=W;if(typeof W=="object"&&m.a.R(W)==="form")for(var fe=W.action,xe=Ae.length-1;0<=xe;xe--)for(var ge=m.a.Lc(W,Ae[xe]),we=ge.length-1;0<=we;we--)ae[ge[we].name]=ge[we].value;J=m.a.f(J);var ve=n.createElement("form");ve.style.display="none",ve.action=fe,ve.method="post";for(var Re in J)W=n.createElement("input"),W.type="hidden",W.name=Re,W.value=m.a.hc(m.a.f(J[Re])),ve.appendChild(W);_(ae,function(Qe,He){var Ye=n.createElement("input");Ye.type="hidden",Ye.name=Qe,Ye.value=He,ve.appendChild(Ye)}),n.body.appendChild(ve),Z.submitter?Z.submitter(ve):ve.submit(),setTimeout(function(){ve.parentNode.removeChild(ve)},0)}}})(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var C=this;if(arguments.length===1)return function(){return C.apply(_,arguments)};var w=Array.prototype.slice.call(arguments,1);return function(){var D=w.slice(0);return D.push.apply(D,arguments),C.apply(_,D)}}),m.a.g=new function(){var _=0,C="__ko__"+new Date().getTime(),w={},D,N;return m.a.W?(D=function(F,V){var B=F[C];if(!B||B==="null"||!w[B]){if(!V)return e;B=F[C]="ko"+_++,w[B]={}}return w[B]},N=function(F){var V=F[C];return V?(delete w[V],F[C]=null,!0):!1}):(D=function(F,V){var B=F[C];return!B&&V&&(B=F[C]={}),B},N=function(F){return F[C]?(delete F[C],!0):!1}),{get:function(F,V){var B=D(F,!1);return B&&B[V]},set:function(F,V,B){(F=D(F,B!==e))&&(F[V]=B)},Ub:function(F,V,B){return F=D(F,!0),F[V]||(F[V]=B)},clear:N,Z:function(){return _+++C}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(V,B){var j=m.a.g.get(V,D);return j===e&&B&&(j=[],m.a.g.set(V,D,j)),j}function C(V){var B=_(V,!1);if(B)for(var B=B.slice(0),j=0;j<B.length;j++)B[j](V);m.a.g.clear(V),m.a.K.cleanExternalData(V),F[V.nodeType]&&w(V.childNodes,!0)}function w(V,B){for(var j=[],k,G=0;G<V.length;G++)if((!B||V[G].nodeType===8)&&(C(j[j.length]=k=V[G]),V[G]!==k))for(;G--&&m.a.A(j,V[G])==-1;);}var D=m.a.g.Z(),N={1:!0,8:!0,9:!0},F={1:!0,9:!0};return{za:function(V,B){if(typeof B!="function")throw Error("Callback must be a function");_(V,!0).push(B)},yb:function(V,B){var j=_(V,!1);j&&(m.a.Pa(j,B),j.length==0&&m.a.g.set(V,D,e))},oa:function(V){return m.u.G(function(){N[V.nodeType]&&(C(V),F[V.nodeType]&&w(V.getElementsByTagName("*")))}),V},removeNode:function(V){m.oa(V),V.parentNode&&V.parentNode.removeChild(V)},cleanExternalData:function(V){r&&typeof r.cleanData=="function"&&r.cleanData([V])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),(function(){var _=[0,"",""],C=[1,"<table>","</table>"],w=[3,"<table><tbody><tr>","</tr></tbody></table>"],D=[1,"<select multiple='multiple'>","</select>"],N={thead:C,tbody:C,tfoot:C,tr:[2,"<table><tbody>","</tbody></table>"],td:w,th:w,option:D,optgroup:D},F=8>=m.a.W;m.a.ua=function(V,B){var j;if(r){if(r.parseHTML)j=r.parseHTML(V,B)||[];else if((j=r.clean([V],B))&&j[0]){for(var k=j[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(j=B)||(j=n);var k=j.parentWindow||j.defaultView||t,G=m.a.Db(V).toLowerCase(),q=j.createElement("div"),Q;for(Q=(G=G.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[G[1]]||_,G=Q[0],Q="ignored<div>"+Q[1]+V+Q[2]+"</div>",typeof k.innerShiv=="function"?q.appendChild(k.innerShiv(Q)):(F&&j.body.appendChild(q),q.innerHTML=Q,F&&q.parentNode.removeChild(q));G--;)q=q.lastChild;j=m.a.la(q.lastChild.childNodes)}return j},m.a.Md=function(V,B){var j=m.a.ua(V,B);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(V,B){if(m.a.Tb(V),B=m.a.f(B),B!==null&&B!==e)if(typeof B!="string"&&(B=B.toString()),r)r(V).html(B);else for(var j=m.a.ua(B,V.ownerDocument),k=0;k<j.length;k++)V.appendChild(j[k])}})(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=(function(){function _(w,D){if(w){if(w.nodeType==8){var N=m.aa.Uc(w.nodeValue);N!=null&&D.push({ud:w,Kd:N})}else if(w.nodeType==1)for(var N=0,F=w.childNodes,V=F.length;N<V;N++)_(F[N],D)}}var C={};return{Xb:function(w){if(typeof w!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var D=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return C[D]=w,"<!--[ko_memo:"+D+"]-->"},bd:function(w,D){var N=C[w];if(N===e)throw Error("Couldn't find any memo with ID "+w+". Perhaps it's already been unmemoized.");try{return N.apply(null,D||[]),!0}finally{delete C[w]}},cd:function(w,D){var N=[];_(w,N);for(var F=0,V=N.length;F<V;F++){var B=N[F].ud,j=[B];D&&m.a.Nb(j,D),m.aa.bd(N[F].Kd,j),B.nodeValue="",B.parentNode&&B.parentNode.removeChild(B)}},Uc:function(w){return(w=w.match(/^\[ko_memo\:(.*?)\]$/))?w[1]:null}}})(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=(function(){function _(){if(N){for(var B=N,j=0,k;V<N;)if(k=D[V++]){if(V>B){if(5e3<=++j){V=N,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}B=N}try{k()}catch(G){m.a.Gc(G)}}}}function C(){_(),V=N=D.length=0}var w,D=[],N=0,F=1,V=0;return t.MutationObserver?w=(function(B){var j=n.createElement("div");return new MutationObserver(B).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}})(C):w=n&&"onreadystatechange"in n.createElement("script")?function(B){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,B()},n.documentElement.appendChild(j)}:function(B){setTimeout(B,0)},{scheduler:w,zb:function(B){return N||m.na.scheduler(C),D[N++]=B,F++},cancel:function(B){B=B-(F-N),B>=V&&B<N&&(D[B]=null)},resetForTesting:function(){var B=N-V;return V=N=D.length=0,B},Sd:_}})(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,C){_.throttleEvaluation=C;var w=null;return m.$({read:_,write:function(D){clearTimeout(w),w=m.a.setTimeout(function(){_(D)},C)}})},rateLimit:function(_,C){var w,D,N;typeof C=="number"?w=C:(w=C.timeout,D=C.method),_.Hb=!1,N=typeof D=="function"?D:D=="notifyWhenChangesStop"?f:u,_.ub(function(F){return N(F,w,C)})},deferred:function(_,C){if(C!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(w){var D,N=!1;return function(){if(!N){m.na.cancel(D),D=m.na.zb(w);try{N=!0,_.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(_,C){_.equalityComparer=C=="always"?null:c}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,C,w){this.da=_,this.lc=C,this.mc=w,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,A),A.qb(this)};var A={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,C,w){var D=this;w=w||"change";var N=new m.ic(D,C?_.bind(C):_,function(){m.a.Pa(D.U[w],N),D.hb&&D.hb(w)});return D.Qa&&D.Qa(w),D.U[w]||(D.U[w]=[]),D.U[w].push(N),N},notifySubscribers:function(_,C){if(C=C||"change",C==="change"&&this.Gb(),this.Wa(C)){var w=C==="change"&&this.ed||this.U[C].slice(0);try{m.u.xc();for(var D=0,N;N=w[D];++D)N.Ib||N.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var C=this,w=m.O(C),D,N,F,V,B;C.gb||(C.gb=C.notifySubscribers,C.notifySubscribers=d);var j=_(function(){C.Ja=!1,w&&V===C&&(V=C.nc?C.nc():C());var k=N||B&&C.sb(F,V);B=N=D=!1,k&&C.gb(F=V)});C.qc=function(k,G){G&&C.Ja||(B=!G),C.ed=C.U.change.slice(0),C.Ja=D=!0,V=k,j()},C.pc=function(k){D||(F=k,C.gb(k,"beforeChange"))},C.rc=function(){B=!0},C.gd=function(){C.sb(F,C.v(!0))&&(N=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var C=0;return m.a.P(this.U,function(w,D){w!=="dirty"&&(C+=D.length)}),C},sb:function(_,C){return!this.equalityComparer||!this.equalityComparer(_,C)},toString:function(){return"[object Object]"},extend:function(_){var C=this;return _&&m.a.P(_,function(w,D){var N=m.Ta[w];typeof N=="function"&&(C=N(C,D)||C)}),C}};m.L(A,"init",A.qb),m.L(A,"subscribe",A.subscribe),m.L(A,"extend",A.extend),m.L(A,"getSubscriptionsCount",A.Bd),m.a.Ba&&m.a.setPrototypeOf(A,Function.prototype),m.T.fn=A,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=(function(){function _(F){w.push(D),D=F}function C(){D=w.pop()}var w=[],D,N=0;return{xc:_,end:C,cc:function(F){if(D){if(!m.Qc(F))throw Error("Only subscribable things can act as dependencies");D.od.call(D.pd,F,F.fd||(F.fd=++N))}},G:function(F,V,B){try{return _(),F.apply(V,B||[])}finally{C()}},qa:function(){if(D)return D.o.qa()},Va:function(){if(D)return D.o.Va()},Ya:function(){if(D)return D.Ya},o:function(){if(D)return D.o}}})(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var b=m.a.Da("_latestValue");m.ta=function(_){function C(){return 0<arguments.length?(C.sb(C[b],arguments[0])&&(C.ya(),C[b]=arguments[0],C.xa()),this):(m.u.cc(C),C[b])}return C[b]=_,m.a.Ba||m.a.extend(C,m.T.fn),m.T.fn.qb(C),m.a.Ab(C,x),m.options.deferUpdates&&m.Ta.deferred(C,!0),C};var x={equalityComparer:c,v:function(){return this[b]},xa:function(){this.notifySubscribers(this[b],"spectate"),this.notifySubscribers(this[b])},ya:function(){this.notifySubscribers(this[b],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(x,m.T.fn);var T=m.ta.Ma="__ko_proto__";x[T]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[T])&&_!==x[T]&&_!==m.o.fn[T])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[T]===x[T]||_[T]===m.o.fn[T]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",x),m.L(x,"peek",x.v),m.L(x,"valueHasMutated",x.xa),m.L(x,"valueWillMutate",x.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var C=this.v(),w=[],D=typeof _!="function"||m.O(_)?function(V){return V===_}:_,N=0;N<C.length;N++){var F=C[N];if(D(F)){if(w.length===0&&this.ya(),C[N]!==F)throw Error("Array modified during remove; cannot remove item");w.push(F),C.splice(N,1),N--}}return w.length&&this.xa(),w},removeAll:function(_){if(_===e){var C=this.v(),w=C.slice(0);return this.ya(),C.splice(0,C.length),this.xa(),w}return _?this.remove(function(D){return 0<=m.a.A(_,D)}):[]},destroy:function(_){var C=this.v(),w=typeof _!="function"||m.O(_)?function(F){return F===_}:_;this.ya();for(var D=C.length-1;0<=D;D--){var N=C[D];w(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(C){return 0<=m.a.A(_,C)}):[]},indexOf:function(_){var C=this();return m.a.A(C,_)},replace:function(_,C){var w=this.indexOf(_);0<=w&&(this.ya(),this.v()[w]=C,this.xa())},sorted:function(_){var C=this().slice(0);return _?C.sort(_):C.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var C=this.v();this.ya(),this.zc(C,_,arguments);var w=C[_].apply(C,arguments);return this.xa(),w===C?this:w}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var C=this();return C[_].apply(C,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,C){function w(){function q(){if(B){var Q=[].concat(_.v()||[]),W;_.Wa("arrayChange")&&((!N||1<B)&&(N=m.a.Pb(j,Q,_.Ob)),W=N),j=Q,N=null,B=0,W&&W.length&&_.notifySubscribers(W,"arrayChange")}}D?q():(D=!0,V=_.subscribe(function(){++B},null,"spectate"),j=[].concat(_.v()||[]),N=null,F=_.subscribe(q))}if(_.Ob={},C&&typeof C=="object"&&m.a.extend(_.Ob,C),_.Ob.sparse=!0,!_.zc){var D=!1,N=null,F,V,B=0,j,k=_.Qa,G=_.hb;_.Qa=function(q){k&&k.call(_,q),q==="arrayChange"&&w()},_.hb=function(q){G&&G.call(_,q),q!=="arrayChange"||_.Wa("arrayChange")||(F&&F.s(),V&&V.s(),V=F=null,D=!1,j=e)},_.zc=function(q,Q,W){function J(ve,Re,Qe){return Z[Z.length]={status:ve,value:Re,index:Qe}}if(D&&!B){var Z=[],ae=q.length,Ae=W.length,fe=0;switch(Q){case"push":fe=ae;case"unshift":for(Q=0;Q<Ae;Q++)J("added",W[Q],fe+Q);break;case"pop":fe=ae-1;case"shift":ae&&J("deleted",q[fe],fe);break;case"splice":Q=Math.min(Math.max(0,0>W[0]?ae+W[0]:W[0]),ae);for(var ae=Ae===1?ae:Math.min(Q+(W[1]||0),ae),Ae=Q+Ae-2,fe=Math.max(ae,Ae),xe=[],ge=[],we=2;Q<fe;++Q,++we)Q<ae&&ge.push(J("deleted",q[Q],Q)),Q<Ae&&xe.push(J("added",W[we],Q));m.a.Kc(ge,xe);break;default:return}N=Z}}}};var E=m.a.Da("_state");m.o=m.$=function(_,C,w){function D(){if(0<arguments.length){if(typeof N=="function")N.apply(F.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 F.ra||m.u.cc(D),(F.ka||F.J&&D.Xa())&&D.ha(),F.X}if(typeof _=="object"?w=_:(w=w||{},_&&(w.read=_)),typeof w.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=w.write,F={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:w.read,nb:C||w.owner,l:w.disposeWhenNodeIsRemoved||w.l||null,Sa:w.disposeWhen||w.Sa,Rb:null,I:{},V:0,Ic:null};return D[E]=F,D.Nc=typeof N=="function",m.a.Ba||m.a.extend(D,m.T.fn),m.T.fn.qb(D),m.a.Ab(D,v),w.pure?(F.wb=!0,F.J=!0,m.a.extend(D,S)):w.deferEvaluation&&m.a.extend(D,I),m.options.deferUpdates&&m.Ta.deferred(D,!0),F.l&&(F.jc=!0,F.l.nodeType||(F.l=null)),F.J||w.deferEvaluation||D.ha(),F.l&&D.ja()&&m.a.K.za(F.l,F.Rb=function(){D.s()}),D};var v={equalityComparer:c,qa:function(){return this[E].V},Va:function(){var _=[];return m.a.P(this[E].I,function(C,w){_[w.Ka]=w.da}),_},Vb:function(_){if(!this[E].V)return!1;var C=this.Va();return m.a.A(C,_)!==-1?!0:!!m.a.Lb(C,function(w){return w.Vb&&w.Vb(_)})},uc:function(_,C,w){if(this[E].wb&&C===this)throw Error("A 'pure' computed must not be called recursively");this[E].I[_]=w,w.Ka=this[E].V++,w.La=C.ob()},Xa:function(){var _,C,w=this[E].I;for(_ in w)if(Object.prototype.hasOwnProperty.call(w,_)&&(C=w[_],this.Ia&&C.da.Ja||C.da.Dd(C.La)))return!0},Jd:function(){this.Ia&&!this[E].rb&&this.Ia(!1)},ja:function(){var _=this[E];return _.ka||0<_.V},Rd:function(){this.Ja?this[E].ka&&(this[E].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var C=_.subscribe(this.Jd,this,"dirty"),w=_.subscribe(this.Rd,this);return{da:_,s:function(){C.s(),w.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,C=_.throttleEvaluation;C&&0<=C?(clearTimeout(this[E].Ic),this[E].Ic=m.a.setTimeout(function(){_.ha(!0)},C)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var C=this[E],w=C.Sa,D=!1;if(!C.rb&&!C.ra){if(C.l&&!m.a.Sb(C.l)||w&&w()){if(!C.jc){this.s();return}}else C.jc=!1;C.rb=!0;try{D=this.zd(_)}finally{C.rb=!1}return D}},zd:function(_){var C=this[E],D=!1,w=C.wb?e:!C.V,D={qd:this,mb:C.I,Qb:C.V};m.u.xc({pd:D,od:g,o:this,Ya:w}),C.I={},C.V=0;var N=this.yd(C,D);return C.V?D=this.sb(C.X,N):(this.s(),D=!0),D&&(C.J?this.Gb():this.notifySubscribers(C.X,"beforeChange"),C.X=N,this.notifySubscribers(C.X,"spectate"),!C.J&&_&&this.notifySubscribers(C.X),this.rc&&this.rc()),w&&this.notifySubscribers(C.X,"awake"),D},yd:function(_,C){try{var w=_.Wc;return _.nb?w.call(_.nb):w()}finally{m.u.end(),C.Qb&&!_.J&&m.a.P(C.mb,p),_.sa=_.ka=!1}},v:function(_){var C=this[E];return(C.ka&&(_||!C.V)||C.J&&this.Xa())&&this.ha(),C.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[E].J||(this[E].sa?this.ha():this[E].ka=!1),this[E].X},this.Ia=function(C){this.pc(this[E].X),this[E].ka=!0,C&&(this[E].sa=!0),this.qc(this,!C)}},s:function(){var _=this[E];!_.J&&_.I&&m.a.P(_.I,function(C,w){w.s&&w.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},S={Qa:function(_){var C=this,w=C[E];if(!w.ra&&w.J&&_=="change"){if(w.J=!1,w.sa||C.Xa())w.I=null,w.V=0,C.ha()&&C.Gb();else{var D=[];m.a.P(w.I,function(N,F){D[F.Ka]=N}),m.a.D(D,function(N,F){var V=w.I[N],B=C.$c(V.da);B.Ka=F,B.La=V.La,w.I[N]=B}),C.Xa()&&C.ha()&&C.Gb()}w.ra||C.notifySubscribers(w.X,"awake")}},hb:function(_){var C=this[E];C.ra||_!="change"||this.Wa("change")||(m.a.P(C.I,function(w,D){D.s&&(C.I[w]={da:D.da,Ka:D.Ka,La:D.La},D.s())}),C.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[E];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},I={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[E]&&_[E].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,C){return typeof _=="function"?m.o(_,C,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,C))},m.b("pureComputed",m.xb),(function(){function _(D,N,F){if(F=F||new w,D=N(D),typeof D!="object"||D===null||D===e||D instanceof RegExp||D instanceof Date||D instanceof String||D instanceof Number||D instanceof Boolean)return D;var V=D instanceof Array?[]:{};return F.save(D,V),C(D,function(B){var j=N(D[B]);switch(typeof j){case"boolean":case"number":case"string":case"function":V[B]=j;break;case"object":case"undefined":var k=F.get(j);V[B]=k!==e?k:_(j,N,F)}}),V}function C(D,N){if(D instanceof Array){for(var F=0;F<D.length;F++)N(F);typeof D.toJSON=="function"&&N("toJSON")}else for(F in D)N(F)}function w(){this.keys=[],this.values=[]}m.ad=function(D){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(D,function(N){for(var F=0;m.O(N)&&10>F;F++)N=N();return N})},m.toJSON=function(D,N,F){return D=m.ad(D),m.a.hc(D,N,F)},w.prototype={constructor:w,save:function(D,N){var F=m.a.A(this.keys,D);0<=F?this.values[F]=N:(this.keys.push(D),this.values.push(N))},get:function(D){return D=m.a.A(this.keys,D),0<=D?this.values[D]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,C,w){function D(N){var F=m.xb(_,w).extend({ma:"always"}),V=F.subscribe(function(B){B&&(V.s(),N(B))});return F.notifySubscribers(F.v()),V}return typeof Promise!="function"||C?D(C.bind(w)):new Promise(D)},m.b("when",m.Wd),(function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,C,w){switch(m.a.R(_)){case"option":typeof C=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=C):(m.a.g.set(_,m.c.options.$b,C),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof C=="number"?C:"");break;case"select":(C===""||C===null)&&(C=e);for(var D=-1,N=0,F=_.options.length,V;N<F;++N)if(V=m.w.M(_.options[N]),V==C||V===""&&C===e){D=N;break}(w||0<=D||C===e&&1<_.size)&&(_.selectedIndex=D,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=D},0));break;default:(C===null||C===e)&&(C=""),_.value=C}}}})(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=(function(){function _(B){B=m.a.Db(B),B.charCodeAt(0)===123&&(B=B.slice(1,-1)),B+=` +,`;var j=[],k=B.match(D),G,q=[],Q=0;if(1<k.length){for(var W=0,J;J=k[W];++W){var Z=J.charCodeAt(0);if(Z===44){if(0>=Q){j.push(G&&q.length?{key:G,value:q.join("")}:{unknown:G||q.join("")}),G=Q=0,q=[];continue}}else if(Z===58){if(!Q&&!G&&q.length===1){G=q.pop();continue}}else{if(Z===47&&1<J.length&&(J.charCodeAt(1)===47||J.charCodeAt(1)===42))continue;Z===47&&W&&1<J.length?(Z=k[W-1].match(N))&&!F[Z[0]]&&(B=B.substr(B.indexOf(J)+1),k=B.match(D),W=-1,J="/"):Z===40||Z===123||Z===91?++Q:Z===41||Z===125||Z===93?--Q:G||q.length||Z!==34&&Z!==39||(J=J.slice(1,-1))}q.push(J)}if(0<Q)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var C=["true","false","null","undefined"],w=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,D=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* +|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(B,j){function k(Z,ae){var Ae;if(!W){var fe=m.getBindingHandler(Z);if(fe&&fe.preprocess&&!(ae=fe.preprocess(ae,Z,k)))return;(fe=V[Z])&&(Ae=ae,0<=m.a.A(C,Ae)?Ae=!1:(fe=Ae.match(w),Ae=fe===null?!1:fe[1]?"Object("+fe[1]+")"+fe[2]:Ae),fe=Ae),fe&&q.push("'"+(typeof V[Z]=="string"?V[Z]:Z)+"':function(_z){"+Ae+"=_z}")}Q&&(ae="function(){return "+ae+" }"),G.push("'"+Z+"':"+ae)}j=j||{};var G=[],q=[],Q=j.valueAccessors,W=j.bindingParams,J=typeof B=="string"?_(B):B;return m.a.D(J,function(Z){k(Z.key||Z.unknown,Z.value)}),q.length&&k("_ko_property_writers","{"+q.join(",")+" }"),G.join(",")},Id:function(B,j){for(var k=0;k<B.length;k++)if(B[k].key==j)return!0;return!1},eb:function(B,j,k,G,q){B&&m.O(B)?!m.Za(B)||q&&B.v()===G||B(G):(B=j.get("_ko_property_writers"))&&B[k]&&B[k](G)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function _(k){return k.nodeType==8&&F.test(N?k.text:k.nodeValue)}function C(k){return k.nodeType==8&&V.test(N?k.text:k.nodeValue)}function w(k,G){for(var q=k,Q=1,W=[];q=q.nextSibling;){if(C(q)&&(m.a.g.set(q,j,!0),Q--,Q===0))return W;W.push(q),_(q)&&Q++}if(!G)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function D(k,G){var q=w(k,G);return q?0<q.length?q[q.length-1].nextSibling:k.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",F=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,B={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=m.h.childNodes(k);for(var G=0,q=k.length;G<q;G++)m.removeNode(k[G])}else m.a.Tb(k)},va:function(k,G){if(_(k)){m.h.Ea(k);for(var q=k.nextSibling,Q=0,W=G.length;Q<W;Q++)q.parentNode.insertBefore(G[Q],q)}else m.a.va(k,G)},Vc:function(k,G){var q;_(k)?(q=k.nextSibling,k=k.parentNode):q=k.firstChild,q?G!==q&&k.insertBefore(G,q):k.appendChild(G)},Wb:function(k,G,q){q?(q=q.nextSibling,_(k)&&(k=k.parentNode),q?G!==q&&k.insertBefore(G,q):k.appendChild(G)):m.h.Vc(k,G)},firstChild:function(k){if(_(k))return!k.nextSibling||C(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&C(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=D(k)),k.nextSibling&&C(k.nextSibling)){var G=k.nextSibling;if(C(G)&&!m.a.g.get(G,j))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(N?k.text:k.nodeValue).match(F))?k[1]:null},Sc:function(k){if(B[m.a.R(k)]){var G=k.firstChild;if(G)do if(G.nodeType===1){var q;q=G.firstChild;var Q=null;if(q)do if(Q)Q.push(q);else if(_(q)){var W=D(q,!0);W?q=W:Q=[q]}else C(q)&&(Q=[q]);while(q=q.nextSibling);if(q=Q)for(Q=G.nextSibling,W=0;W<q.length;W++)Q?k.insertBefore(q[W],Q):k.appendChild(q[W])}while(G=G.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_):null;return m.j.tc(w,_,C,!1)},getBindingAccessors:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_,{valueAccessors:!0}):null;return m.j.tc(w,_,C,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,C,w,D){try{var N=this.nd,F=_+(D&&D.valueAccessors||""),V;if(!(V=N[F])){var B,j="with($context){with($data||{}){return{"+m.m.vb(_,D)+"}}}";B=new Function("$context","$element",j),V=N[F]=B}return V(C,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` -Message: `+U.message,U}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ue){var ye=(ue=m.a.g.get(ue,xe))&&ue.N;ye&&(ue.N=null,ye.Tc())}function w(ue,ye,Ae){this.node=ue,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(ue,_),Ae&&Ae.N&&(Ae.N.kb.push(ue),this.Kb=Ae)}function D(ue){return function(){return ue}}function I(ue){return ue()}function N(ue){return m.a.Ga(m.u.G(ue),function(ye,Ae){return function(){return ue()[Ae]}})}function k(ue,ye,Ae){return typeof ue=="function"?N(ue.bind(null,ye,Ae)):m.a.Ga(ue,D)}function H(ue,ye){return N(this.getBindings.bind(this,ue,ye))}function V(ue,ye){var Ae=m.h.firstChild(ye);if(Ae){var Pe,Ee=m.ga.instance,Ve=Ee.preprocessNode;if(Ve){for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),Ve.call(Ee,Pe);Ae=m.h.firstChild(ye)}for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),j(ue,Pe)}m.i.ma(ye,m.i.H)}function j(ue,ye){var Ae=ue,Pe=ye.nodeType===1;Pe&&m.h.Sc(ye),(Pe||m.ga.instance.nodeHasBindings(ye))&&(Ae=q(ye,null,ue).bindingContextForDescendants),Ae&&!ee[m.a.R(ye)]&&V(Ae,ye)}function U(ue){var ye=[],Ae={},Pe=[];return m.a.P(ue,function Ee(Ve){if(!Ae[Ve]){var je=m.getBindingHandler(Ve);je&&(je.after&&(Pe.push(Ve),m.a.D(je.after,function(it){if(ue[it]){if(m.a.A(Pe,it)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));Ee(it)}}),Pe.length--),ye.push({key:Ve,Mc:je})),Ae[Ve]=!0}}),ye}function q(ue,ye,Ae){var Pe=m.a.g.Ub(ue,xe,{}),Ee=Pe.hd;if(!ye){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}Ee||(Pe.context=Ae),Pe.Zb||(Pe.Zb={});var Ve;if(ye&&typeof ye!="function")Ve=ye;else{var je=m.ga.instance,it=je.getBindingAccessors||H,Dt=m.$(function(){return(Ve=ye?ye(Ae,ue):it.call(je,ue,Ae))&&(Ae[te]&&Ae[te](),Ae[Z]&&Ae[Z]()),Ve},null,{l:ue});Ve&&Dt.ja()||(Dt=null)}var Gt=Ae,$e;if(Ve){var ln=function(){return m.a.Ga(Dt?Dt():Ve,I)},Vt=Dt?function(Ct){return function(){return I(Dt()[Ct])}}:function(Ct){return Ve[Ct]};ln.get=function(Ct){return Ve[Ct]&&I(Vt(Ct))},ln.has=function(Ct){return Ct in Ve},m.i.H in Ve&&m.i.subscribe(ue,m.i.H,function(){var Ct=(0,Ve[m.i.H])();if(Ct){var gi=m.h.childNodes(ue);gi.length&&Ct(gi,m.Ec(gi[0]))}}),m.i.pa in Ve&&(Gt=m.i.Cb(ue,Ae),m.i.subscribe(ue,m.i.pa,function(){var Ct=(0,Ve[m.i.pa])();Ct&&m.h.firstChild(ue)&&Ct(ue)})),Pe=U(Ve),m.a.D(Pe,function(Ct){var gi=Ct.Mc.init,an=Ct.Mc.update,_e=Ct.key;if(ue.nodeType===8&&!m.h.ea[_e])throw Error("The binding '"+_e+"' cannot be used with virtual elements");try{typeof gi=="function"&&m.u.G(function(){var Ce=gi(ue,Vt(_e),ln,Gt.$data,Gt);if(Ce&&Ce.controlsDescendantBindings){if($e!==e)throw Error("Multiple bindings ("+$e+" and "+_e+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");$e=_e}}),typeof an=="function"&&m.$(function(){an(ue,Vt(_e),ln,Gt.$data,Gt)},null,{l:ue})}catch(Ce){throw Ce.message='Unable to process binding "'+_e+": "+Ve[_e]+`" -Message: `+Ce.message,Ce}})}return Pe=$e===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&Gt}}function X(ue,ye){return ue&&ue instanceof m.fa?ue:new m.fa(ue,e,e,ye)}var te=m.a.Da("_subscribable"),K=m.a.Da("_ancestorBindingInfo"),Z=m.a.Da("_dataDependency");m.c={};var ee={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ue){return m.c[ue]};var me={};m.fa=function(ue,ye,Ae,Pe,Ee){function Ve(){var Vt=Gt?Dt():Dt,Ct=m.a.f(Vt);return ye?(m.a.extend(je,ye),K in ye&&(je[K]=ye[K])):(je.$parents=[],je.$root=Ct,je.ko=m),je[te]=$e,it?Ct=je.$data:(je.$rawData=Vt,je.$data=Ct),Ae&&(je[Ae]=Ct),Pe&&Pe(je,ye,Ct),ye&&ye[te]&&!m.S.o().Vb(ye[te])&&ye[te](),ln&&(je[Z]=ln),je.$data}var je=this,it=ue===me,Dt=it?e:ue,Gt=typeof Dt=="function"&&!m.O(Dt),$e,ln=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?Ve():($e=m.xb(Ve),$e.v(),$e.ja()?$e.equalityComparer=null:je[te]=e)},m.fa.prototype.createChildContext=function(ue,ye,Ae,Pe){if(!Pe&&ye&&typeof ye=="object"&&(Pe=ye,ye=Pe.as,Ae=Pe.extend),ye&&Pe&&Pe.noChildContext){var Ee=typeof ue=="function"&&!m.O(ue);return new m.fa(me,this,null,function(Ve){Ae&&Ae(Ve),Ve[ye]=Ee?ue():ue},Pe)}return new m.fa(ue,this,ye,function(Ve,je){Ve.$parentContext=je,Ve.$parent=je.$data,Ve.$parents=(je.$parents||[]).slice(0),Ve.$parents.unshift(Ve.$parent),Ae&&Ae(Ve)},Pe)},m.fa.prototype.extend=function(ue,ye){return new m.fa(me,this,null,function(Ae){m.a.extend(Ae,typeof ue=="function"?ue(Ae):ue)},ye)};var xe=m.a.g.Z();w.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},w.prototype.sd=function(ue){m.a.Pa(this.kb,ue),!this.kb.length&&this.H&&this.Cc()},w.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ue,ye,Ae,Pe,Ee){var Ve=m.a.g.Ub(ue,xe,{});return Ve.Fa||(Ve.Fa=new m.T),Ee&&Ee.notifyImmediately&&Ve.Zb[ye]&&m.u.G(Ae,Pe,[ue]),Ve.Fa.subscribe(Ae,Pe,ye)},ma:function(ue,ye){var Ae=m.a.g.get(ue,xe);if(Ae&&(Ae.Zb[ye]=!0,Ae.Fa&&Ae.Fa.notifySubscribers(ue,ye),ye==m.i.H)){if(Ae.N)Ae.N.Cc();else if(Ae.N===e&&Ae.Fa&&Ae.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ue,ye){var Ae=m.a.g.Ub(ue,xe,{});return Ae.N||(Ae.N=new w(ue,Ae,ye[K])),ye[K]==Ae?ye:ye.extend(function(Pe){Pe[K]=Ae})}},m.Td=function(ue){return(ue=m.a.g.get(ue,xe))&&ue.context},m.ib=function(ue,ye,Ae){return ue.nodeType===1&&m.h.Sc(ue),q(ue,ye,X(Ae))},m.ld=function(ue,ye,Ae){return Ae=X(Ae),m.ib(ue,k(ye,Ae,ue),Ae)},m.Oa=function(ue,ye){ye.nodeType!==1&&ye.nodeType!==8||V(X(ue),ye)},m.vc=function(ue,ye,Ae){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(X(ue,Ae),ye)},m.Dc=function(ue){return!ue||ue.nodeType!==1&&ue.nodeType!==8?e:m.Td(ue)},m.Ec=function(ue){return(ue=m.Dc(ue))?ue.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(_){function w(H,V){var j=Object.prototype.hasOwnProperty.call(N,H)?N[H]:_,U;j?j.subscribe(V):(j=N[H]=new m.T,j.subscribe(V),D(H,function(q,X){var te=!(!X||!X.synchronous);k[H]={definition:q,Gd:te},delete N[H],U||te?j.notifySubscribers(q):m.na.zb(function(){j.notifySubscribers(q)})}),U=!0)}function D(H,V){I("getConfig",[H],function(j){j?I("loadComponent",[H,j],function(U){V(U,j)}):V(null,null)})}function I(H,V,j,U){U||(U=m.j.loaders.slice(0));var q=U.shift();if(q){var X=q[H];if(X){var te=!1;if(X.apply(q,V.concat(function(K){te?j(null):K!==null?j(K):I(H,V,j,U)}))!==_&&(te=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(H,V,j,U)}else j(null)}var N={},k={};m.j={get:function(H,V){var j=Object.prototype.hasOwnProperty.call(k,H)?k[H]:_;j?j.Gd?m.u.G(function(){V(j.definition)}):m.na.zb(function(){V(j.definition)}):w(H,V)},Bc:function(H){delete k[H]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(j,U,q,X){function te(){--Z===0&&X(K)}var K={},Z=2,ee=q.template;q=q.viewModel,ee?N(U,ee,function(me){m.j.oc("loadTemplate",[j,me],function(xe){K.template=xe,te()})}):te(),q?N(U,q,function(me){m.j.oc("loadViewModel",[j,me],function(xe){K[V]=xe,te()})}):te()}function w(j,U,q){if(typeof U=="function")q(function(te){return new U(te)});else if(typeof U[V]=="function")q(U[V]);else if("instance"in U){var X=U.instance;q(function(){return X})}else"viewModel"in U?w(j,U.viewModel,q):j("Unknown viewModel value: "+U)}function D(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(I(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function I(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,U,q){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(X){X&&typeof X=="object"&&X.Xd&&X.default&&(X=X.default),q(X)}):j("Uses require, but no AMD loader is present"):q(U)}function k(j){return function(U){throw Error("Component '"+j+"': "+U)}}var H={};m.j.register=function(j,U){if(!U)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");H[j]=U},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(H,j)},m.j.unregister=function(j){delete H[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,U){U(m.j.tb(j)?H[j]:null)},loadComponent:function(j,U,q){var X=k(j);N(X,U,function(te){_(j,X,te,q)})},loadTemplate:function(j,U,q){if(j=k(j),typeof U=="string")q(m.a.ua(U));else if(U instanceof Array)q(U);else if(I(U))q(m.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)q(D(U));else if(typeof U=="string"){var X=n.getElementById(U);X?q(D(X)):j("Cannot find element with ID "+U)}else j("Unknown element type: "+U);else j("Unknown template value: "+U)},loadViewModel:function(j,U,q){w(k(j),U,q)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=H}(),function(){function _(D,I){var N=D.getAttribute("params");if(N){var N=w.parseBindingsString(N,I,D,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(V){return m.o(V,null,{l:D})}),k=m.a.Ga(N,function(V){var j=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(j)&&function(U){V()(U)},l:D}):j});return Object.prototype.hasOwnProperty.call(k,"$raw")||(k.$raw=N),k}return{$raw:{}}}m.j.getComponentNameForNode=function(D){var I=m.a.R(D);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+D=="[object HTMLUnknownElement]"||8>=m.a.W&&D.tagName===I))return I},m.j.tc=function(D,I,N,k){if(I.nodeType===1){var H=m.j.getComponentNameForNode(I);if(H){if(D=D||{},D.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:H,params:_(I,N)};D.component=k?function(){return V}:V}}return D};var w=new m.ga;9>m.a.W&&(m.j.register=function(D){return function(I){return D.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(D){return function(){var I=D(),N=m.j.dd,k;for(k in N);return I}}(n.createDocumentFragment))}(),function(){function _(I,N,k){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(k,I)}function w(I,N,k){var H=I.createViewModel;return H?H.call(I,N,k):N}var D=0;m.c.component={init:function(I,N,k,H,V){function j(){var K=U&&U.dispose;typeof K=="function"&&K.call(U),X&&X.s(),q=U=X=null}var U,q,X,te=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,j),m.o(function(){var K=m.a.f(N()),Z,ee;if(typeof K=="string"?Z=K:(Z=m.a.f(K.name),ee=m.a.f(K.params)),!Z)throw Error("No component name specified");var me=m.i.Cb(I,V),xe=q=++D;m.j.get(Z,function(ue){if(q===xe){if(j(),!ue)throw Error("Unknown component '"+Z+"'");_(Z,ue,I);var ye=w(ue,ee,{element:I,templateNodes:te});ue=me.createChildContext(ye,{extend:function(Ae){Ae.$component=ye,Ae.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(X=m.i.subscribe(I,m.i.pa,ye.koDescendantsComplete,ye)),U=ye,m.Oa(ue,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};m.c.attr={update:function(_,w){var D=m.a.f(w())||{};m.a.P(D,function(I,N){N=m.a.f(N);var k=I.indexOf(":"),k="lookupNamespaceURI"in _&&0<k&&_.lookupNamespaceURI(I.substr(0,k)),H=N===!1||N===null||N===e;H?k?_.removeAttributeNS(k,I):_.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in L?(I=L[I],H?_.removeAttribute(I):_[I]=N):H||(k?_.setAttributeNS(k,I,N):_.setAttribute(I,N)),I==="name"&&m.a.Yc(_,H?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(_,w,D){function I(){var K=_.checked,Z=k();if(!m.S.Ya()&&(K||!V&&!m.S.qa())){var ee=m.u.G(w);if(U){var me=q?ee.v():ee,xe=te;te=Z,xe!==Z?K&&(m.a.Na(me,Z,!0),m.a.Na(me,xe,!1)):m.a.Na(me,Z,K),q&&m.Za(ee)&&ee(me)}else H&&(Z===e?Z=K:K||(Z=e)),m.m.eb(ee,D,"checked",Z,!0)}}function N(){var K=m.a.f(w()),Z=k();U?(_.checked=0<=m.a.A(K,Z),te=Z):_.checked=H&&Z===e?!!K:k()===K}var k=m.xb(function(){if(D.has("checkedValue"))return m.a.f(D.get("checkedValue"));if(X)return D.has("value")?m.a.f(D.get("value")):_.value}),H=_.type=="checkbox",V=_.type=="radio";if(H||V){var j=w(),U=H&&m.a.f(j)instanceof Array,q=!(U&&j.push&&j.splice),X=V||U,te=U?k():e;V&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,w){_.value=m.a.f(w())}}}(),m.c.class={update:function(_,w){var D=m.a.Db(m.a.f(w()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=D,m.a.Eb(_,D,!0)}},m.c.css={update:function(_,w){var D=m.a.f(w());D!==null&&typeof D=="object"?m.a.P(D,function(I,N){N=m.a.f(N),m.a.Eb(_,I,N)}):m.c.class.update(_,w)}},m.c.enable={update:function(_,w){var D=m.a.f(w());D&&_.disabled?_.removeAttribute("disabled"):D||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,w){m.c.enable.update(_,function(){return!m.a.f(w())})}},m.c.event={init:function(_,w,D,I,N){var k=w()||{};m.a.P(k,function(H){typeof H=="string"&&m.a.B(_,H,function(V){var j,U=w()[H];if(U){try{var q=m.a.la(arguments);I=N.$data,q.unshift(I),j=U.apply(I,q)}finally{j!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}D.get(H+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var w=_(),D=m.a.bc(w);return!D||typeof D.length=="number"?{foreach:w,templateEngine:m.ba.Ma}:(m.a.f(w),{foreach:D.data,as:D.as,noChildContext:D.noChildContext,includeDestroyed:D.includeDestroyed,afterAdd:D.afterAdd,beforeRemove:D.beforeRemove,afterRender:D.afterRender,beforeMove:D.beforeMove,afterMove:D.afterMove,templateEngine:m.ba.Ma})}},init:function(_,w){return m.c.template.init(_,m.c.foreach.Rc(w))},update:function(_,w,D,I,N){return m.c.template.update(_,m.c.foreach.Rc(w),D,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,w,D){function I(H){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var j;try{j=V.activeElement}catch{j=V.body}H=j===_}V=w(),m.m.eb(V,D,"hasfocus",H,!0),_.__ko_hasfocusLastValue=H,_.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),k=I.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",k),m.a.B(_,"focusout",k),_.__ko_hasfocusLastValue=!1},update:function(_,w){var D=!!m.a.f(w());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===D||(D?_.focus():_.blur(),!D&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,D?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.fc(_,w())}},function(){function _(w,D,I){m.c[w]={init:function(N,k,H,V,j){var U,q,X={},te,K,Z;if(D){V=H.get("as");var ee=H.get("noChildContext");Z=!(V&&ee),X={as:V,noChildContext:ee,exportDependencies:Z}}return K=(te=H.get("completeOn")=="render")||H.has(m.i.pa),m.o(function(){var me=m.a.f(k()),xe=!I!=!me,ue=!q,ye;(Z||xe!==U)&&(K&&(j=m.i.Cb(N,j)),xe&&((!D||Z)&&(X.dataDependency=m.S.o()),ye=D?j.createChildContext(typeof me=="function"?me:k,X):m.S.qa()?j.extend(null,X):j),ue&&m.S.qa()&&(q=m.a.Ca(m.h.childNodes(N),!0)),xe?(ue||m.h.va(N,m.a.Ca(q)),m.Oa(ye,N)):(m.h.Ea(N),te||m.i.ma(N,m.i.H)),U=xe)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[w]=!1,m.h.ea[w]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,w,D,I,N){return w=N.extend(w),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var B={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,w,D){function I(){return m.a.jb(_.options,function(ee){return ee.selected})}function N(ee,me,xe){var ue=typeof me;return ue=="function"?me(ee):ue=="string"?ee[me]:xe}function k(ee,me){if(K&&U)m.i.ma(_,m.i.H);else if(te.length){var xe=0<=m.a.A(te,m.w.M(me[0]));m.a.Zc(me[0],xe),K&&!xe&&m.u.G(m.a.Fb,null,[_,"change"])}}var H=_.multiple,V=_.length!=0&&H?_.scrollTop:null,j=m.a.f(w()),U=D.get("valueAllowUnset")&&D.has("value"),q=D.get("optionsIncludeDestroyed");w={};var X,te=[];U||(H?te=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&te.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),X=m.a.jb(j,function(ee){return q||ee===e||ee===null||!m.a.f(ee._destroy)}),D.has("optionsCaption")&&(j=m.a.f(D.get("optionsCaption")),j!==null&&j!==e&&X.unshift(B)));var K=!1;if(w.beforeRemove=function(ee){_.removeChild(ee)},j=k,D.has("optionsAfterRender")&&typeof D.get("optionsAfterRender")=="function"&&(j=function(ee,me){k(0,me),m.u.G(D.get("optionsAfterRender"),null,[me[0],ee!==B?ee:e])}),m.a.ec(_,X,function(ee,me,xe){return xe.length&&(te=!U&&xe[0].selected?[m.w.M(xe[0])]:[],K=!0),me=_.ownerDocument.createElement("option"),ee===B?(m.a.Bb(me,D.get("optionsCaption")),m.w.cb(me,e)):(xe=N(ee,D.get("optionsValue"),ee),m.w.cb(me,m.a.f(xe)),ee=N(ee,D.get("optionsText"),xe),m.a.Bb(me,ee)),[me]},w,j),!U){var Z;H?Z=te.length&&I().length<te.length:Z=te.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==te[0]:te.length||0<=_.selectedIndex,Z&&m.u.G(m.a.Fb,null,[_,"change"])}(U||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,w,D){function I(){var H=w(),V=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&V.push(m.w.M(j))}),m.m.eb(H,D,"selectedOptions",V)}function N(){var H=m.a.f(w()),V=_.scrollTop;H&&typeof H.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var U=0<=m.a.A(H,m.w.M(j));j.selected!=U&&m.a.Zc(j,U)}),_.scrollTop=V}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var k;m.i.subscribe(_,m.i.H,function(){k?I():(m.a.B(_,"change",I),k=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,w){var D=m.a.f(w()||{});m.a.P(D,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(_).css(I,N);else if(/^--/.test(I))_.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(H,V){return V.toUpperCase()});var k=_.style[I];_.style[I]=N,N===k||_.style[I]!=k||isNaN(N)||(_.style[I]=N+"px")}})}},m.c.submit={init:function(_,w,D,I,N){if(typeof w()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(k){var H,V=w();try{H=V.call(N.$data,_)}finally{H!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.Bb(_,w())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(X){if(X)return parseFloat(X[1])},w=t.navigator.userAgent,D,I,N,k,H;(D=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(H=_(w.match(/Edge\/([^ ]+)$/)))||_(w.match(/Chrome\/([^ ]+)/))||(I=_(w.match(/Version\/([^ ]+) Safari/)))||(N=_(w.match(/Firefox\/([^ ]+)/)))||(k=m.a.W||_(w.match(/MSIE ([^ ]+)/)))||(k=_(w.match(/rv:([^ )]+)/)))}if(8<=k&&10>k)var V=m.a.g.Z(),j=m.a.g.Z(),U=function(X){var te=this.activeElement;(te=te&&m.a.g.get(te,j))&&te(X)},q=function(X,te){var K=X.ownerDocument;m.a.g.get(K,V)||(m.a.g.set(K,V,!0),m.a.B(K,"selectionchange",U)),m.a.g.set(X,j,te)};m.c.textInput={init:function(X,te,K){function Z(Ve,je){m.a.B(X,Ve,je)}function ee(){var Ve=m.a.f(te());(Ve===null||Ve===e)&&(Ve=""),Ae!==e&&Ve===Ae?m.a.setTimeout(ee,4):X.value!==Ve&&(Ee=!0,X.value=Ve,Ee=!1,ue=X.value)}function me(){ye||(Ae=X.value,ye=m.a.setTimeout(xe,4))}function xe(){clearTimeout(ye),Ae=ye=e;var Ve=X.value;ue!==Ve&&(ue=Ve,m.m.eb(te(),K,"textInput",Ve))}var ue=X.value,ye,Ae,Pe=m.a.W==9?me:xe,Ee=!1;k&&Z("keypress",xe),11>k&&Z("propertychange",function(Ve){Ee||Ve.propertyName!=="value"||Pe(Ve)}),k==8&&(Z("keyup",xe),Z("keydown",xe)),q&&(q(X,Pe),Z("dragend",me)),(!k||9<=k)&&Z("input",Pe),5>I&&m.a.R(X)==="textarea"?(Z("keydown",me),Z("paste",me),Z("cut",me)):11>D?Z("keydown",me):4>N?(Z("DOMAutoComplete",xe),Z("dragdrop",xe),Z("drop",xe)):H&&X.type==="number"&&Z("keydown",me),Z("change",xe),Z("blur",xe),m.o(ee,null,{l:X})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(X,te,K){K("textInput",X)}}}(),m.c.uniqueName={init:function(_,w){if(w()){var D="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,D)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,w,D,I,N){var k;return D.has("as")&&(k={as:D.get("as"),noChildContext:D.get("noChildContext")}),w=N.createChildContext(w,k),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,w,D){var I=m.a.R(_),N=I=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var k=[],H=D.get("valueUpdate"),V=!1,j=null;H&&(typeof H=="string"?k=[H]:k=m.a.wc(H),m.a.Pa(k,"change"));var U=function(){j=null,V=!1;var te=w(),K=m.w.M(_);m.m.eb(te,D,"value",K)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(k,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){V=!0}),m.a.B(_,"focus",function(){V=!1}),m.a.B(_,"blur",function(){V&&U()})),m.a.D(k,function(te){var K=U;m.a.Ud(te,"after")&&(K=function(){j=m.w.M(_),m.a.setTimeout(U,0)},te=te.substring(5)),m.a.B(_,te,K)});var q;if(q=N&&_.type=="file"?function(){var te=m.a.f(w());te===null||te===e||te===""?_.value="":m.u.G(U)}:function(){var te=m.a.f(w()),K=m.w.M(_);j!==null&&te===j?m.a.setTimeout(q,0):(te!==K||K===e)&&(I==="select"?(K=D.get("valueAllowUnset"),m.w.cb(_,te,K),K||te===m.w.M(_)||m.u.G(U)):m.w.cb(_,te))},I==="select"){var X;m.i.subscribe(_,m.i.H,function(){X?D.get("valueAllowUnset")?q():U():(m.a.B(_,"change",U),X=m.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",U),m.o(q,null,{l:_})}else m.ib(_,{checkedValue:w})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,w){var D=m.a.f(w()),I=_.style.display!="none";D&&!I?_.style.display="":!D&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,w){m.c.visible.update(_,function(){return!m.a.f(w())})}},function(_){m.c[_]={init:function(w,D,I,N,k){return m.c.event.init.call(this,w,function(){var H={};return H[_]=D(),H},I,N,k)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,w){if(typeof _=="string"){w=w||n;var D=w.getElementById(_);if(!D)throw Error("Cannot find template with ID "+_);return new m.C.F(D)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,w,D,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,w,D,I)},m.ca.prototype.isTemplateRewritten=function(_,w){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,w).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,w,D){_=this.makeTemplateSource(_,D),w=w(_.text()),_.text(w),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(I,N,k,H){I=m.m.ac(I);for(var V=m.m.Ra,j=0;j<I.length;j++){var U=I[j].key;if(Object.prototype.hasOwnProperty.call(V,U)){var q=V[U];if(typeof q=="function"){if(U=q(I[j].value))throw Error(U)}else if(!q)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return k="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+k.toLowerCase()+"')",H.createJavaScriptEvaluatorBlock(k)+N}var w=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,D=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,k){N.isTemplateRewritten(I,k)||N.rewriteTemplate(I,function(H){return m.kc.Ld(H,N)},k)},Ld:function(I,N){return I.replace(w,function(k,H,V,j,U){return _(U,H,V,N)}).replace(D,function(k,H){return _(H,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(k,H){var V=k.nextSibling;V&&V.nodeName.toLowerCase()===N&&m.ib(V,I,H)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(D){if(this.F=D){var I=m.a.R(D);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&D.content&&D.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var D=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[D];var I=arguments[0];D==="innerHTML"?m.a.fc(this.F,I):this.F[D]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(D){if(arguments.length===1)return m.a.g.get(this.F,_+D);m.a.g.set(this.F,_+D,arguments[1])};var w=m.a.g.Z();m.C.F.prototype.nodes=function(){var D=this.F;if(arguments.length==0){var I=m.a.g.get(D,w)||{},N=I.lb||(this.ab===3?D.content:this.ab===4?D:e);if(!N||I.jd){var k=this.text();k&&k!==I.bb&&(N=m.a.Md(k,D.ownerDocument),m.a.g.set(D,w,{lb:N,bb:k,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(D,w,{lb:I})},m.C.ia=function(D){this.F=D},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var D=m.a.g.get(this.F,w)||{};return D.bb===e&&D.lb&&(D.bb=D.lb.innerHTML),D.bb}m.a.g.set(this.F,w,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(j,U,q){var X;for(U=m.h.nextSibling(U);j&&(X=j)!==U;)j=m.h.nextSibling(X),q(X,j)}function w(j,U){if(j.length){var q=j[0],X=j[j.length-1],te=q.parentNode,K=m.ga.instance,Z=K.preprocessNode;if(Z){if(_(q,X,function(ee,me){var xe=ee.previousSibling,ue=Z.call(K,ee);ue&&(ee===q&&(q=ue[0]||me),ee===X&&(X=ue[ue.length-1]||xe))}),j.length=0,!q)return;q===X?j.push(q):(j.push(q,X),m.a.Ua(j,te))}_(q,X,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.vc(U,ee)}),_(q,X,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.aa.cd(ee,[U])}),m.a.Ua(j,te)}}function D(j){return j.nodeType?j:0<j.length?j[0]:null}function I(j,U,q,X,te){te=te||{};var K=(j&&D(j)||q||{}).ownerDocument,Z=te.templateEngine||k;if(m.kc.xd(q,Z,K),q=Z.renderTemplate(q,X,te,K),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(K=!1,U){case"replaceChildren":m.h.va(j,q),K=!0;break;case"replaceNode":m.a.Xc(j,q),K=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return K&&(w(q,X),te.afterRender&&m.u.G(te.afterRender,null,[q,X[te.as||"$data"]]),U=="replaceChildren"&&m.i.ma(j,m.i.H)),q}function N(j,U,q){return m.O(j)?j():typeof j=="function"?j(U,q):j}var k;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");k=j},m.dc=function(j,U,q,X,te){if(q=q||{},(q.templateEngine||k)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",X){var K=D(X);return m.$(function(){var ee=U&&U instanceof m.fa?U:new m.fa(U,null,null,null,{exportDependencies:!0}),Z=N(j,ee.$data,ee),ee=I(X,te,Z,ee,q);te=="replaceNode"&&(X=ee,K=D(X))},null,{Sa:function(){return!K||!m.a.Sb(K)},l:K&&te=="replaceNode"?K.parentNode:K})}return m.aa.Xb(function(Z){m.dc(j,U,q,Z,"replaceNode")})},m.Qd=function(j,U,q,X,te){function K(Ae,Pe){m.u.G(m.a.ec,null,[X,Ae,ee,q,Z,Pe]),m.i.ma(X,m.i.H)}function Z(Ae,Pe){w(Pe,me),q.afterRender&&q.afterRender(Pe,Ae),me=null}function ee(Ae,Pe){me=te.createChildContext(Ae,{as:xe,noChildContext:q.noChildContext,extend:function(Ve){Ve.$index=Pe,xe&&(Ve[xe+"Index"]=Pe)}});var Ee=N(j,Ae,me);return I(X,"ignoreTargetNode",Ee,me,q)}var me,xe=q.as,ue=q.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!q.includeDestroyed;if(ue||q.beforeRemove||!m.Pc(U))return m.$(function(){var Ae=m.a.f(U)||[];typeof Ae.length>"u"&&(Ae=[Ae]),ue&&(Ae=m.a.jb(Ae,function(Pe){return Pe===e||Pe===null||!m.a.f(Pe._destroy)})),K(Ae)},null,{l:X});K(U.v());var ye=U.subscribe(function(Ae){K(U(),Ae)},null,"arrayChange");return ye.l(X),ye};var H=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(j,U){var q=m.a.f(U());if(typeof q=="string"||"name"in q)m.h.Ea(j);else if("nodes"in q){if(q=q.nodes||[],m.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var X=q[0]&&q[0].parentNode;X&&m.a.g.get(X,V)||(X=m.a.Yb(q),m.a.g.set(X,V,!0)),new m.C.ia(j).nodes(X)}else if(q=m.h.childNodes(j),0<q.length)X=m.a.Yb(q),new m.C.ia(j).nodes(X);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,U,q,X,te){var K=U();U=m.a.f(K),q=!0,X=null,typeof U=="string"?U={}:(K="name"in U?U.name:j,"if"in U&&(q=m.a.f(U.if)),q&&"ifnot"in U&&(q=!m.a.f(U.ifnot)),q&&!K&&(q=!1)),"foreach"in U?X=m.Qd(K,q&&U.foreach||[],U,j,te):q?(q=te,"data"in U&&(q=te.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),X=m.dc(K,q,U,j)):m.h.Ea(j),te=X,(U=m.a.g.get(j,H))&&typeof U.s=="function"&&U.s(),m.a.g.set(j,H,!te||te.ja&&!te.ja()?e:te)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,w,D){if(_.length&&w.length){var I,N,k,H,V;for(I=N=0;(!D||I<D)&&(H=_[N]);++N){for(k=0;V=w[k];++k)if(H.value===V.value){H.moved=V.index,V.moved=H.index,w.splice(k,1),I=k=0;break}I+=k}}},m.a.Pb=function(){function _(w,D,I,N,k){var H=Math.min,V=Math.max,j=[],U,q=w.length,X,te=D.length,K=te-q||1,Z=q+te+1,ee,me,xe;for(U=0;U<=q;U++)for(me=ee,j.push(ee=[]),xe=H(te,U+K),X=V(0,U-1);X<=xe;X++)ee[X]=X?U?w[U-1]===D[X-1]?me[X-1]:H(me[X]||Z,ee[X-1]||Z)+1:X+1:U+1;for(H=[],V=[],K=[],U=q,X=te;U||X;)te=j[U][X]-1,X&&te===j[U][X-1]?V.push(H[H.length]={status:I,value:D[--X],index:X}):U&&te===j[U-1][X]?K.push(H[H.length]={status:N,value:w[--U],index:U}):(--X,--U,k.sparse||H.push({status:"retained",value:D[X]}));return m.a.Kc(K,V,!k.dontLimitMoves&&10*q),H.reverse()}return function(w,D,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},w=w||[],D=D||[],w.length<D.length?_(w,D,"added","deleted",I):_(D,w,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(I,N,k,H,V){var j=[],U=m.$(function(){var q=N(k,V,m.a.Ua(j,I))||[];0<j.length&&(m.a.Xc(j,q),H&&m.u.G(H,null,[k,q,V])),j.length=0,m.a.Nb(j,q)},null,{l:I,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:U.ja()?U:e}}var w=m.a.g.Z(),D=m.a.g.Z();m.a.ec=function(I,N,k,H,V,j){function U(Ct){Ee={Aa:Ct,pb:m.ta(me++)},Z.push(Ee),K||Pe.push(Ee)}function q(Ct){Ee=te[Ct],me!==Ee.pb.v()&&Ae.push(Ee),Ee.pb(me++),m.a.Ua(Ee.Y,I),Z.push(Ee)}function X(Ct,gi){if(Ct)for(var an=0,_e=gi.length;an<_e;an++)m.a.D(gi[an].Y,function(Ce){Ct(Ce,an,gi[an].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),H=H||{};var te=m.a.g.get(I,w),K=!te,Z=[],ee=0,me=0,xe=[],ue=[],ye=[],Ae=[],Pe=[],Ee,Ve=0;if(K)m.a.D(N,U);else{if(!j||te&&te._countWaitingForRemove){var je=m.a.Mb(te,function(Ct){return Ct.Aa});j=m.a.Pb(je,N,{dontLimitMoves:H.dontLimitMoves,sparse:!0})}for(var je=0,it,Dt,Gt;it=j[je];je++)switch(Dt=it.moved,Gt=it.index,it.status){case"deleted":for(;ee<Gt;)q(ee++);Dt===e&&(Ee=te[ee],Ee.$&&(Ee.$.s(),Ee.$=e),m.a.Ua(Ee.Y,I).length&&(H.beforeRemove&&(Z.push(Ee),Ve++,Ee.Aa===D?Ee=null:ye.push(Ee)),Ee&&xe.push.apply(xe,Ee.Y))),ee++;break;case"added":for(;me<Gt;)q(ee++);Dt!==e?(ue.push(Z.length),q(Dt)):U(it.value)}for(;me<N.length;)q(ee++);Z._countWaitingForRemove=Ve}m.a.g.set(I,w,Z),X(H.beforeMove,Ae),m.a.D(xe,H.beforeRemove?m.oa:m.removeNode);var $e,ln,Vt;try{Vt=I.ownerDocument.activeElement}catch{}if(ue.length)for(;(je=ue.shift())!=e;){for(Ee=Z[je],$e=e;je;)if((ln=Z[--je].Y)&&ln.length){$e=ln[ln.length-1];break}for(N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e)}for(je=0;Ee=Z[je];je++){for(Ee.Y||m.a.extend(Ee,_(I,k,Ee.Aa,V,Ee.pb)),N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e);!Ee.Ed&&V&&(V(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,$e=Ee.Y[Ee.Y.length-1])}for(Vt&&I.ownerDocument.activeElement!=Vt&&Vt.focus(),X(H.beforeRemove,ye),je=0;je<ye.length;++je)ye[je].Aa=D;X(H.afterMove,Ae),X(H.afterAdd,Pe)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,w,D,I){return(w=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(w.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var w=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(D,I,N,k){if(k=k||n,N=N||{},2>w)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var H=D.data("precompiled");return H||(H=D.text()||"",H=o.template(null,"{{ko_with $item.koBindingContext}}"+H+"{{/ko_with}}"),D.data("precompiled",H)),D=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(H,D,I),I.appendTo(k.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(D){return"{{ko_code ((function() { return "+D+" })()) }}"},this.addTemplate=function(D,I){n.write("<script type='text/html' id='"+D+"'>"+I+"<\/script>")},0<w&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var lEt=ko;typeof window<"u"?(ko=window.ko,typeof eO<"u"?window.ko=eO:delete window.ko):(ko=global.ko,typeof eO<"u"?global.ko=eO:delete global.ko);var US=lEt;/** +Message: `+k.message,k}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function _(fe){var xe=(fe=m.a.g.get(fe,Ae))&&fe.N;xe&&(fe.N=null,xe.Tc())}function C(fe,xe,ge){this.node=fe,this.yc=xe,this.kb=[],this.H=!1,xe.N||m.a.K.za(fe,_),ge&&ge.N&&(ge.N.kb.push(fe),this.Kb=ge)}function w(fe){return function(){return fe}}function D(fe){return fe()}function N(fe){return m.a.Ga(m.u.G(fe),function(xe,ge){return function(){return fe()[ge]}})}function F(fe,xe,ge){return typeof fe=="function"?N(fe.bind(null,xe,ge)):m.a.Ga(fe,w)}function V(fe,xe){return N(this.getBindings.bind(this,fe,xe))}function B(fe,xe){var ge=m.h.firstChild(xe);if(ge){var we,ve=m.ga.instance,Re=ve.preprocessNode;if(Re){for(;we=ge;)ge=m.h.nextSibling(we),Re.call(ve,we);ge=m.h.firstChild(xe)}for(;we=ge;)ge=m.h.nextSibling(we),j(fe,we)}m.i.ma(xe,m.i.H)}function j(fe,xe){var ge=fe,we=xe.nodeType===1;we&&m.h.Sc(xe),(we||m.ga.instance.nodeHasBindings(xe))&&(ge=G(xe,null,fe).bindingContextForDescendants),ge&&!Z[m.a.R(xe)]&&B(ge,xe)}function k(fe){var xe=[],ge={},we=[];return m.a.P(fe,function ve(Re){if(!ge[Re]){var Qe=m.getBindingHandler(Re);Qe&&(Qe.after&&(we.push(Re),m.a.D(Qe.after,function(He){if(fe[He]){if(m.a.A(we,He)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+we.join(", "));ve(He)}}),we.length--),xe.push({key:Re,Mc:Qe})),ge[Re]=!0}}),xe}function G(fe,xe,ge){var we=m.a.g.Ub(fe,Ae,{}),ve=we.hd;if(!xe){if(ve)throw Error("You cannot apply bindings multiple times to the same element.");we.hd=!0}ve||(we.context=ge),we.Zb||(we.Zb={});var Re;if(xe&&typeof xe!="function")Re=xe;else{var Qe=m.ga.instance,He=Qe.getBindingAccessors||V,Ye=m.$(function(){return(Re=xe?xe(ge,fe):He.call(Qe,fe,ge))&&(ge[Q]&&ge[Q](),ge[J]&&ge[J]()),Re},null,{l:fe});Re&&Ye.ja()||(Ye=null)}var Ke=ge,Pe;if(Re){var qe=function(){return m.a.Ga(Ye?Ye():Re,D)},st=Ye?function(vt){return function(){return D(Ye()[vt])}}:function(vt){return Re[vt]};qe.get=function(vt){return Re[vt]&&D(st(vt))},qe.has=function(vt){return vt in Re},m.i.H in Re&&m.i.subscribe(fe,m.i.H,function(){var vt=(0,Re[m.i.H])();if(vt){var jt=m.h.childNodes(fe);jt.length&&vt(jt,m.Ec(jt[0]))}}),m.i.pa in Re&&(Ke=m.i.Cb(fe,ge),m.i.subscribe(fe,m.i.pa,function(){var vt=(0,Re[m.i.pa])();vt&&m.h.firstChild(fe)&&vt(fe)})),we=k(Re),m.a.D(we,function(vt){var jt=vt.Mc.init,lt=vt.Mc.update,mt=vt.key;if(fe.nodeType===8&&!m.h.ea[mt])throw Error("The binding '"+mt+"' cannot be used with virtual elements");try{typeof jt=="function"&&m.u.G(function(){var ft=jt(fe,st(mt),qe,Ke.$data,Ke);if(ft&&ft.controlsDescendantBindings){if(Pe!==e)throw Error("Multiple bindings ("+Pe+" and "+mt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Pe=mt}}),typeof lt=="function"&&m.$(function(){lt(fe,st(mt),qe,Ke.$data,Ke)},null,{l:fe})}catch(ft){throw ft.message='Unable to process binding "'+mt+": "+Re[mt]+`" +Message: `+ft.message,ft}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&Ke}}function q(fe,xe){return fe&&fe instanceof m.fa?fe:new m.fa(fe,e,e,xe)}var Q=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(fe){return m.c[fe]};var ae={};m.fa=function(fe,xe,ge,we,ve){function Re(){var st=Ke?Ye():Ye,vt=m.a.f(st);return xe?(m.a.extend(Qe,xe),W in xe&&(Qe[W]=xe[W])):(Qe.$parents=[],Qe.$root=vt,Qe.ko=m),Qe[Q]=Pe,He?vt=Qe.$data:(Qe.$rawData=st,Qe.$data=vt),ge&&(Qe[ge]=vt),we&&we(Qe,xe,vt),xe&&xe[Q]&&!m.S.o().Vb(xe[Q])&&xe[Q](),qe&&(Qe[J]=qe),Qe.$data}var Qe=this,He=fe===ae,Ye=He?e:fe,Ke=typeof Ye=="function"&&!m.O(Ye),Pe,qe=ve&&ve.dataDependency;ve&&ve.exportDependencies?Re():(Pe=m.xb(Re),Pe.v(),Pe.ja()?Pe.equalityComparer=null:Qe[Q]=e)},m.fa.prototype.createChildContext=function(fe,xe,ge,we){if(!we&&xe&&typeof xe=="object"&&(we=xe,xe=we.as,ge=we.extend),xe&&we&&we.noChildContext){var ve=typeof fe=="function"&&!m.O(fe);return new m.fa(ae,this,null,function(Re){ge&&ge(Re),Re[xe]=ve?fe():fe},we)}return new m.fa(fe,this,xe,function(Re,Qe){Re.$parentContext=Qe,Re.$parent=Qe.$data,Re.$parents=(Qe.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),ge&&ge(Re)},we)},m.fa.prototype.extend=function(fe,xe){return new m.fa(ae,this,null,function(ge){m.a.extend(ge,typeof fe=="function"?fe(ge):fe)},xe)};var Ae=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(fe){m.a.Pa(this.kb,fe),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(fe,xe,ge,we,ve){var Re=m.a.g.Ub(fe,Ae,{});return Re.Fa||(Re.Fa=new m.T),ve&&ve.notifyImmediately&&Re.Zb[xe]&&m.u.G(ge,we,[fe]),Re.Fa.subscribe(ge,we,xe)},ma:function(fe,xe){var ge=m.a.g.get(fe,Ae);if(ge&&(ge.Zb[xe]=!0,ge.Fa&&ge.Fa.notifySubscribers(fe,xe),xe==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(fe,xe){var ge=m.a.g.Ub(fe,Ae,{});return ge.N||(ge.N=new C(fe,ge,xe[W])),xe[W]==ge?xe:xe.extend(function(we){we[W]=ge})}},m.Td=function(fe){return(fe=m.a.g.get(fe,Ae))&&fe.context},m.ib=function(fe,xe,ge){return fe.nodeType===1&&m.h.Sc(fe),G(fe,xe,q(ge))},m.ld=function(fe,xe,ge){return ge=q(ge),m.ib(fe,F(xe,ge,fe),ge)},m.Oa=function(fe,xe){xe.nodeType!==1&&xe.nodeType!==8||B(q(fe),xe)},m.vc=function(fe,xe,ge){if(!r&&t.jQuery&&(r=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");j(q(fe,ge),xe)},m.Dc=function(fe){return!fe||fe.nodeType!==1&&fe.nodeType!==8?e:m.Td(fe)},m.Ec=function(fe){return(fe=m.Dc(fe))?fe.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(V,B){var j=Object.prototype.hasOwnProperty.call(N,V)?N[V]:_,k;j?j.subscribe(B):(j=N[V]=new m.T,j.subscribe(B),w(V,function(G,q){var Q=!(!q||!q.synchronous);F[V]={definition:G,Gd:Q},delete N[V],k||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),k=!0)}function w(V,B){D("getConfig",[V],function(j){j?D("loadComponent",[V,j],function(k){B(k,j)}):B(null,null)})}function D(V,B,j,k){k||(k=m.j.loaders.slice(0));var G=k.shift();if(G){var q=G[V];if(q){var Q=!1;if(q.apply(G,B.concat(function(W){Q?j(null):W!==null?j(W):D(V,B,j,k)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else D(V,B,j,k)}else j(null)}var N={},F={};m.j={get:function(V,B){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){B(j.definition)}):m.na.zb(function(){B(j.definition)}):C(V,B)},Bc:function(V){delete F[V]},oc:D},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,k,G,q){function Q(){--J===0&&q(W)}var W={},J=2,Z=G.template;G=G.viewModel,Z?N(k,Z,function(ae){m.j.oc("loadTemplate",[j,ae],function(Ae){W.template=Ae,Q()})}):Q(),G?N(k,G,function(ae){m.j.oc("loadViewModel",[j,ae],function(Ae){W[B]=Ae,Q()})}):Q()}function C(j,k,G){if(typeof k=="function")G(function(Q){return new k(Q)});else if(typeof k[B]=="function")G(k[B]);else if("instance"in k){var q=k.instance;G(function(){return q})}else"viewModel"in k?C(j,k.viewModel,G):j("Unknown viewModel value: "+k)}function w(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(D(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function D(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,k,G){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),G(q)}):j("Uses require, but no AMD loader is present"):G(k)}function F(j){return function(k){throw Error("Component '"+j+"': "+k)}}var V={};m.j.register=function(j,k){if(!k)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=k},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,k){k(m.j.tb(j)?V[j]:null)},loadComponent:function(j,k,G){var q=F(j);N(q,k,function(Q){_(j,q,Q,G)})},loadTemplate:function(j,k,G){if(j=F(j),typeof k=="string")G(m.a.ua(k));else if(k instanceof Array)G(k);else if(D(k))G(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)G(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?G(w(q)):j("Cannot find element with ID "+k)}else j("Unknown element type: "+k);else j("Unknown template value: "+k)},loadViewModel:function(j,k,G){C(F(j),k,G)}};var B="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=V})(),(function(){function _(w,D){var N=w.getAttribute("params");if(N){var N=C.parseBindingsString(N,D,w,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(B){return m.o(B,null,{l:w})}),F=m.a.Ga(N,function(B){var j=B.v();return B.ja()?m.o({read:function(){return m.a.f(B())},write:m.Za(j)&&function(k){B()(k)},l:w}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=N),F}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var D=m.a.R(w);if(m.j.tb(D)&&(D.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===D))return D},m.j.tc=function(w,D,N,F){if(D.nodeType===1){var V=m.j.getComponentNameForNode(D);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var B={name:V,params:_(D,N)};w.component=F?function(){return B}:B}}return w};var C=new m.ga;9>m.a.W&&(m.j.register=(function(w){return function(D){return w.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(w){return function(){var D=w(),N=m.j.dd,F;for(F in N);return D}})(n.createDocumentFragment))})(),(function(){function _(D,N,F){if(N=N.template,!N)throw Error("Component '"+D+"' has no template");D=m.a.Ca(N),m.h.va(F,D)}function C(D,N,F){var V=D.createViewModel;return V?V.call(D,N,F):N}var w=0;m.c.component={init:function(D,N,F,V,B){function j(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),q&&q.s(),G=k=q=null}var k,G,q,Q=m.a.la(m.h.childNodes(D));return m.h.Ea(D),m.a.K.za(D,j),m.o(function(){var W=m.a.f(N()),J,Z;if(typeof W=="string"?J=W:(J=m.a.f(W.name),Z=m.a.f(W.params)),!J)throw Error("No component name specified");var ae=m.i.Cb(D,B),Ae=G=++w;m.j.get(J,function(fe){if(G===Ae){if(j(),!fe)throw Error("Unknown component '"+J+"'");_(J,fe,D);var xe=C(fe,Z,{element:D,templateNodes:Q});fe=ae.createChildContext(xe,{extend:function(ge){ge.$component=xe,ge.$componentTemplateNodes=Q}}),xe&&xe.koDescendantsComplete&&(q=m.i.subscribe(D,m.i.pa,xe.koDescendantsComplete,xe)),k=xe,m.Oa(fe,D)}})},null,{l:D}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var w=m.a.f(C())||{};m.a.P(w,function(D,N){N=m.a.f(N);var F=D.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(D.substr(0,F)),V=N===!1||N===null||N===e;V?F?_.removeAttributeNS(F,D):_.removeAttribute(D):N=N.toString(),8>=m.a.W&&D in O?(D=O[D],V?_.removeAttribute(D):_[D]=N):V||(F?_.setAttributeNS(F,D,N):_.setAttribute(D,N)),D==="name"&&m.a.Yc(_,V?"":N)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,w){function D(){var W=_.checked,J=F();if(!m.S.Ya()&&(W||!B&&!m.S.qa())){var Z=m.u.G(C);if(k){var ae=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?W&&(m.a.Na(ae,J,!0),m.a.Na(ae,Ae,!1)):m.a.Na(ae,J,W),G&&m.Za(Z)&&Z(ae)}else V&&(J===e?J=W:W||(J=e)),m.m.eb(Z,w,"checked",J,!0)}}function N(){var W=m.a.f(C()),J=F();k?(_.checked=0<=m.a.A(W,J),Q=J):_.checked=V&&J===e?!!W:F()===W}var F=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),V=_.type=="checkbox",B=_.type=="radio";if(V||B){var j=C(),k=V&&m.a.f(j)instanceof Array,G=!(k&&j.push&&j.splice),q=B||k,Q=k?F():e;B&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(D,null,{l:_}),m.a.B(_,"click",D),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var w=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,C){var w=m.a.f(C());w!==null&&typeof w=="object"?m.a.P(w,function(D,N){N=m.a.f(N),m.a.Eb(_,D,N)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var w=m.a.f(C());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,w,D,N){var F=C()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(B){var j,k=C()[V];if(k){try{var G=m.a.la(arguments);D=N.$data,G.unshift(D),j=k.apply(D,G)}finally{j!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}w.get(V+"Bubble")===!1&&(B.cancelBubble=!0,B.stopPropagation&&B.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),w=m.a.bc(C);return!w||typeof w.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,w,D,N){return m.c.template.update(_,m.c.foreach.Rc(C),w,D,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,w){function D(V){_.__ko_hasfocusUpdating=!0;var B=_.ownerDocument;if("activeElement"in B){var j;try{j=B.activeElement}catch{j=B.body}V=j===_}B=C(),m.m.eb(B,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var N=D.bind(null,!0),F=D.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,C){var w=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,w,D){m.c[C]={init:function(N,F,V,B,j){var k,G,q={},Q,W,J;if(w){B=V.get("as");var Z=V.get("noChildContext");J=!(B&&Z),q={as:B,noChildContext:Z,exportDependencies:J}}return W=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ae=m.a.f(F()),Ae=!D!=!ae,fe=!G,xe;(J||Ae!==k)&&(W&&(j=m.i.Cb(N,j)),Ae&&((!w||J)&&(q.dataDependency=m.S.o()),xe=w?j.createChildContext(typeof ae=="function"?ae:F,q):m.S.qa()?j.extend(null,q):j),fe&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(N),!0)),Ae?(fe||m.h.va(N,m.a.Ca(G)),m.Oa(xe,N)):(m.h.Ea(N),Q||m.i.ma(N,m.i.H)),k=Ae)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,w,D,N){return C=N.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,w){function D(){return m.a.jb(_.options,function(Z){return Z.selected})}function N(Z,ae,Ae){var fe=typeof ae;return fe=="function"?ae(Z):fe=="string"?Z[ae]:Ae}function F(Z,ae){if(W&&k)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ae[0]));m.a.Zc(ae[0],Ae),W&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,B=_.length!=0&&V?_.scrollTop:null,j=m.a.f(C()),k=w.get("valueAllowUnset")&&w.has("value"),G=w.get("optionsIncludeDestroyed");C={};var q,Q=[];k||(V?Q=m.a.Mb(D(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),q=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),w.has("optionsCaption")&&(j=m.a.f(w.get("optionsCaption")),j!==null&&j!==e&&q.unshift(L)));var W=!1;if(C.beforeRemove=function(Z){_.removeChild(Z)},j=F,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(j=function(Z,ae){F(0,ae),m.u.G(w.get("optionsAfterRender"),null,[ae[0],Z!==L?Z:e])}),m.a.ec(_,q,function(Z,ae,Ae){return Ae.length&&(Q=!k&&Ae[0].selected?[m.w.M(Ae[0])]:[],W=!0),ae=_.ownerDocument.createElement("option"),Z===L?(m.a.Bb(ae,w.get("optionsCaption")),m.w.cb(ae,e)):(Ae=N(Z,w.get("optionsValue"),Z),m.w.cb(ae,m.a.f(Ae)),Z=N(Z,w.get("optionsText"),Ae),m.a.Bb(ae,Z)),[ae]},C,j),!k){var J;V?J=Q.length&&D().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),B&&20<Math.abs(B-_.scrollTop)&&(_.scrollTop=B)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,w){function D(){var V=C(),B=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&B.push(m.w.M(j))}),m.m.eb(V,w,"selectedOptions",B)}function N(){var V=m.a.f(C()),B=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var k=0<=m.a.A(V,m.w.M(j));j.selected!=k&&m.a.Zc(j,k)}),_.scrollTop=B}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?D():(m.a.B(_,"change",D),F=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var w=m.a.f(C()||{});m.a.P(w,function(D,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),r)r(_).css(D,N);else if(/^--/.test(D))_.style.setProperty(D,N);else{D=D.replace(/-(\w)/g,function(V,B){return B.toUpperCase()});var F=_.style[D];_.style[D]=N,N===F||_.style[D]!=F||isNaN(N)||(_.style[D]=N+"px")}})}},m.c.submit={init:function(_,C,w,D,N){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,B=C();try{V=B.call(N.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,w,D,N,F,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(D=_(C.match(/Version\/([^ ]+) Safari/)))||(N=_(C.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(F=_(C.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var B=m.a.g.Z(),j=m.a.g.Z(),k=function(q){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(q)},G=function(q,Q){var W=q.ownerDocument;m.a.g.get(W,B)||(m.a.g.set(W,B,!0),m.a.B(W,"selectionchange",k)),m.a.g.set(q,j,Q)};m.c.textInput={init:function(q,Q,W){function J(Re,Qe){m.a.B(q,Re,Qe)}function Z(){var Re=m.a.f(Q());(Re===null||Re===e)&&(Re=""),ge!==e&&Re===ge?m.a.setTimeout(Z,4):q.value!==Re&&(ve=!0,q.value=Re,ve=!1,fe=q.value)}function ae(){xe||(ge=q.value,xe=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(xe),ge=xe=e;var Re=q.value;fe!==Re&&(fe=Re,m.m.eb(Q(),W,"textInput",Re))}var fe=q.value,xe,ge,we=m.a.W==9?ae:Ae,ve=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Re){ve||Re.propertyName!=="value"||we(Re)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(q,we),J("dragend",ae)),(!F||9<=F)&&J("input",we),5>D&&m.a.R(q)==="textarea"?(J("keydown",ae),J("paste",ae),J("cut",ae)):11>w?J("keydown",ae):4>N?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&q.type==="number"&&J("keydown",ae),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,Q,W){W("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,w,D,N){var F;return w.has("as")&&(F={as:w.get("as"),noChildContext:w.get("noChildContext")}),C=N.createChildContext(C,F),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,w){var D=m.a.R(_),N=D=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var F=[],V=w.get("valueUpdate"),B=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var k=function(){j=null,B=!1;var Q=C(),W=m.w.M(_);m.m.eb(Q,w,"value",W)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){B=!0}),m.a.B(_,"focus",function(){B=!1}),m.a.B(_,"blur",function(){B&&k()})),m.a.D(F,function(Q){var W=k;m.a.Ud(Q,"after")&&(W=function(){j=m.w.M(_),m.a.setTimeout(k,0)},Q=Q.substring(5)),m.a.B(_,Q,W)});var G;if(G=N&&_.type=="file"?function(){var Q=m.a.f(C());Q===null||Q===e||Q===""?_.value="":m.u.G(k)}:function(){var Q=m.a.f(C()),W=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==W||W===e)&&(D==="select"?(W=w.get("valueAllowUnset"),m.w.cb(_,Q,W),W||Q===m.w.M(_)||m.u.G(k)):m.w.cb(_,Q))},D==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?G():k():(m.a.B(_,"change",k),q=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var w=m.a.f(C()),D=_.style.display!="none";w&&!D?_.style.display="":!w&&D&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,w,D,N,F){return m.c.event.init.call(this,C,function(){var V={};return V[_]=w(),V},D,N,F)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var w=C.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,w,D){return _=this.makeTemplateSource(_,D),this.renderTemplateSource(_,C,w,D)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,w){_=this.makeTemplateSource(_,w),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(D,N,F,V){D=m.m.ac(D);for(var B=m.m.Ra,j=0;j<D.length;j++){var k=D[j].key;if(Object.prototype.hasOwnProperty.call(B,k)){var G=B[k];if(typeof G=="function"){if(k=G(D[j].value))throw Error(k)}else if(!G)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(D,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+N}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(D,N,F){N.isTemplateRewritten(D,F)||N.rewriteTemplate(D,function(V){return m.kc.Ld(V,N)},F)},Ld:function(D,N){return D.replace(C,function(F,V,B,j,k){return _(k,V,B,N)}).replace(w,function(F,V){return _(V,"<!-- ko -->","#comment",N)})},md:function(D,N){return m.aa.Xb(function(F,V){var B=F.nextSibling;B&&B.nodeName.toLowerCase()===N&&m.ib(B,D,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(w){if(this.F=w){var D=m.a.R(w);this.ab=D==="script"?1:D==="textarea"?2:D=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var D=arguments[0];w==="innerHTML"?m.a.fc(this.F,D):this.F[w]=D};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var D=m.a.g.get(w,C)||{},N=D.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!N||D.jd){var F=this.text();F&&F!==D.bb&&(N=m.a.Md(F,w.ownerDocument),m.a.g.set(w,C,{lb:N,bb:F,jd:!0}))}return N}D=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,C,{lb:D})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,C)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(j,k,G){var q;for(k=m.h.nextSibling(k);j&&(q=j)!==k;)j=m.h.nextSibling(q),G(q,j)}function C(j,k){if(j.length){var G=j[0],q=j[j.length-1],Q=G.parentNode,W=m.ga.instance,J=W.preprocessNode;if(J){if(_(G,q,function(Z,ae){var Ae=Z.previousSibling,fe=J.call(W,Z);fe&&(Z===G&&(G=fe[0]||ae),Z===q&&(q=fe[fe.length-1]||Ae))}),j.length=0,!G)return;G===q?j.push(G):(j.push(G,q),m.a.Ua(j,Q))}_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(k,Z)}),_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[k])}),m.a.Ua(j,Q)}}function w(j){return j.nodeType?j:0<j.length?j[0]:null}function D(j,k,G,q,Q){Q=Q||{};var W=(j&&w(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,W),G=J.renderTemplate(G,q,Q,W),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":m.h.va(j,G),W=!0;break;case"replaceNode":m.a.Xc(j,G),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(C(G,q),Q.afterRender&&m.u.G(Q.afterRender,null,[G,q[Q.as||"$data"]]),k=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function N(j,k,G){return m.O(j)?j():typeof j=="function"?j(k,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,k,G,q,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",q){var W=w(q);return m.$(function(){var Z=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),J=N(j,Z.$data,Z),Z=D(q,Q,J,Z,G);Q=="replaceNode"&&(q=Z,W=w(q))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(J){m.dc(j,k,G,J,"replaceNode")})},m.Qd=function(j,k,G,q,Q){function W(ge,we){m.u.G(m.a.ec,null,[q,ge,Z,G,J,we]),m.i.ma(q,m.i.H)}function J(ge,we){C(we,ae),G.afterRender&&G.afterRender(we,ge),ae=null}function Z(ge,we){ae=Q.createChildContext(ge,{as:Ae,noChildContext:G.noChildContext,extend:function(Re){Re.$index=we,Ae&&(Re[Ae+"Index"]=we)}});var ve=N(j,ge,ae);return D(q,"ignoreTargetNode",ve,ae,G)}var ae,Ae=G.as,fe=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(fe||G.beforeRemove||!m.Pc(k))return m.$(function(){var ge=m.a.f(k)||[];typeof ge.length>"u"&&(ge=[ge]),fe&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),W(ge)},null,{l:q});W(k.v());var xe=k.subscribe(function(ge){W(k(),ge)},null,"arrayChange");return xe.l(q),xe};var V=m.a.g.Z(),B=m.a.g.Z();m.c.template={init:function(j,k){var G=m.a.f(k());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var q=G[0]&&G[0].parentNode;q&&m.a.g.get(q,B)||(q=m.a.Yb(G),m.a.g.set(q,B,!0)),new m.C.ia(j).nodes(q)}else if(G=m.h.childNodes(j),0<G.length)q=m.a.Yb(G),new m.C.ia(j).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,k,G,q,Q){var W=k();k=m.a.f(W),G=!0,q=null,typeof k=="string"?k={}:(W="name"in k?k.name:j,"if"in k&&(G=m.a.f(k.if)),G&&"ifnot"in k&&(G=!m.a.f(k.ifnot)),G&&!W&&(G=!1)),"foreach"in k?q=m.Qd(W,G&&k.foreach||[],k,j,Q):G?(G=Q,"data"in k&&(G=Q.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(W,G,k,j)):m.h.Ea(j),Q=q,(k=m.a.g.get(j,V))&&typeof k.s=="function"&&k.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,w){if(_.length&&C.length){var D,N,F,V,B;for(D=N=0;(!w||D<w)&&(V=_[N]);++N){for(F=0;B=C[F];++F)if(V.value===B.value){V.moved=B.index,B.moved=V.index,C.splice(F,1),D=F=0;break}D+=F}}},m.a.Pb=(function(){function _(C,w,D,N,F){var V=Math.min,B=Math.max,j=[],k,G=C.length,q,Q=w.length,W=Q-G||1,J=G+Q+1,Z,ae,Ae;for(k=0;k<=G;k++)for(ae=Z,j.push(Z=[]),Ae=V(Q,k+W),q=B(0,k-1);q<=Ae;q++)Z[q]=q?k?C[k-1]===w[q-1]?ae[q-1]:V(ae[q]||J,Z[q-1]||J)+1:q+1:k+1;for(V=[],B=[],W=[],k=G,q=Q;k||q;)Q=j[k][q]-1,q&&Q===j[k][q-1]?B.push(V[V.length]={status:D,value:w[--q],index:q}):k&&Q===j[k-1][q]?W.push(V[V.length]={status:N,value:C[--k],index:k}):(--q,--k,F.sparse||V.push({status:"retained",value:w[q]}));return m.a.Kc(W,B,!F.dontLimitMoves&&10*G),V.reverse()}return function(C,w,D){return D=typeof D=="boolean"?{dontLimitMoves:D}:D||{},C=C||[],w=w||[],C.length<w.length?_(C,w,"added","deleted",D):_(w,C,"deleted","added",D)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(D,N,F,V,B){var j=[],k=m.$(function(){var G=N(F,B,m.a.Ua(j,D))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,B])),j.length=0,m.a.Nb(j,G)},null,{l:D,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:k.ja()?k:e}}var C=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(D,N,F,V,B,j){function k(vt){ve={Aa:vt,pb:m.ta(ae++)},J.push(ve),W||we.push(ve)}function G(vt){ve=Q[vt],ae!==ve.pb.v()&&ge.push(ve),ve.pb(ae++),m.a.Ua(ve.Y,D),J.push(ve)}function q(vt,jt){if(vt)for(var lt=0,mt=jt.length;lt<mt;lt++)m.a.D(jt[lt].Y,function(ft){vt(ft,lt,jt[lt].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),V=V||{};var Q=m.a.g.get(D,C),W=!Q,J=[],Z=0,ae=0,Ae=[],fe=[],xe=[],ge=[],we=[],ve,Re=0;if(W)m.a.D(N,k);else{if(!j||Q&&Q._countWaitingForRemove){var Qe=m.a.Mb(Q,function(vt){return vt.Aa});j=m.a.Pb(Qe,N,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var Qe=0,He,Ye,Ke;He=j[Qe];Qe++)switch(Ye=He.moved,Ke=He.index,He.status){case"deleted":for(;Z<Ke;)G(Z++);Ye===e&&(ve=Q[Z],ve.$&&(ve.$.s(),ve.$=e),m.a.Ua(ve.Y,D).length&&(V.beforeRemove&&(J.push(ve),Re++,ve.Aa===w?ve=null:xe.push(ve)),ve&&Ae.push.apply(Ae,ve.Y))),Z++;break;case"added":for(;ae<Ke;)G(Z++);Ye!==e?(fe.push(J.length),G(Ye)):k(He.value)}for(;ae<N.length;)G(Z++);J._countWaitingForRemove=Re}m.a.g.set(D,C,J),q(V.beforeMove,ge),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var Pe,qe,st;try{st=D.ownerDocument.activeElement}catch{}if(fe.length)for(;(Qe=fe.shift())!=e;){for(ve=J[Qe],Pe=e;Qe;)if((qe=J[--Qe].Y)&&qe.length){Pe=qe[qe.length-1];break}for(N=0;Z=ve.Y[N];Pe=Z,N++)m.h.Wb(D,Z,Pe)}for(Qe=0;ve=J[Qe];Qe++){for(ve.Y||m.a.extend(ve,_(D,F,ve.Aa,B,ve.pb)),N=0;Z=ve.Y[N];Pe=Z,N++)m.h.Wb(D,Z,Pe);!ve.Ed&&B&&(B(ve.Aa,ve.Y,ve.pb),ve.Ed=!0,Pe=ve.Y[ve.Y.length-1])}for(st&&D.ownerDocument.activeElement!=st&&st.focus(),q(V.beforeRemove,xe),Qe=0;Qe<xe.length;++Qe)xe[Qe].Aa=w;q(V.afterMove,ge),q(V.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,w,D){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,D))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(w,D,N,F){if(F=F||n,N=N||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[D.$data],D=r.extend({koBindingContext:D},N.templateOptions),D=r.tmpl(V,w,D),D.appendTo(F.createElement("div")),r.fragments={},D},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,D){n.write("<script type='text/html' id='"+w+"'>"+D+"<\/script>")},0<C&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var u6t=ko;typeof window<"u"?(ko=window.ko,typeof WM<"u"?window.ko=WM:delete window.ko):(ko=global.ko,typeof WM<"u"?global.ko=WM:delete global.ko);var wI=u6t;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var R$="__knockoutObservables",M$="__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=pCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===R$||o===M$)&&!(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&&fEt(n,a)}}),e}function pCe(e,t){var n=e[R$];return!n&&t&&(n={},Object.defineProperty(e,R$,{value:n})),n}function uEt(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 fEt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=dEt(e,t,i))})}function dEt(e,t,n){var i=hEt(e,n);return i.subscribe(t)}function hEt(e,t){var n=t[M$];if(!n){n=new e.subscribable,Object.defineProperty(t,M$,{value:n});var i={};mEt(t,n,i),pEt(e,t,n,i)}return n}function mEt(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 pEt(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 _Ce(e,t){if(!e)return null;var n=pCe(e,!1);return n&&n[t]||null}function _Et(e,t){var n=_Ce(e,t);n&&n.valueHasMutated()}function gEt(e){e.track=mCe,e.getObservable=_Ce,e.valueHasMutated=_Et,e.defineProperty=uEt}var BH={attachToKo:gEt};var gCe="http://www.w3.org/2000/svg",yCe="cesium-svgPath-svg",yEt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(gCe,"svg:svg");i.setAttribute("class",yCe);let o=document.createElementNS(gCe,"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",`${yCe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},kH=yEt;BH.attachToKo(US);kH.register(US);var Te=US;function tO(e){c(e)||(e=new mm),this._clock=e,this._eventHelper=new Ar,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(tO.prototype,{clock:{get:function(){return this._clock}}});tO.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};tO.prototype.isDestroyed=function(){return!1};tO.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var UH=tO;function bEt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,C.throwInstantiationError()}var bCe=bEt;function xEt(e,t){if(!c(e))throw new C("func is required.");t=t??!0;let n=new pe,i=new pe;function o(){if(!o.canExecute)throw new C("Cannot execute command, canExecute is false.");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,Te.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var wn=xEt;var VS={};VS.createCheckbox=function(e,t,n){T.typeOf.string("labelText",e),T.typeOf.string("checkedBinding",t);let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return c(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};VS.createSection=function(e,t,n,i){T.defined("panel",e),T.typeOf.string("headerText",t),T.typeOf.string("sectionVisibleBinding",n),T.typeOf.string("toggleSectionVisibilityBinding",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};VS.createRangeInput=function(e,t,n,i,o,r){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),T.typeOf.number("min",n),T.typeOf.number("max",i),r=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=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let l=document.createElement("div");l.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(l),u};VS.createRangeInputWithDynamicMinMax=function(e,t,n,i){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};VS.createButton=function(e,t,n){T.typeOf.string("buttonText",e),T.typeOf.string("clickedBinding",t);let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return c(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Vu=VS;function TEt(e,t,n,i,o){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,o)}var Ba=TEt;function xCe(e,t){if(!c(e))throw new C("command is required.");this._command=e,t=t??W.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Te.track(this,["toggled","tooltip"])}Object.defineProperties(xCe.prototype,{command:{get:function(){return this._command}}});var Zx=xCe;var Qx="http://www.w3.org/2000/svg",CCe="http://www.w3.org/1999/xlink",VH,nO=G.fromCssColorString("rgba(247,250,255,0.384)"),zH=G.fromCssColorString("rgba(143,191,255,0.216)"),L$=G.fromCssColorString("rgba(153,197,255,0.098)"),HH=G.fromCssColorString("rgba(255,255,255,0.086)"),AEt=G.fromCssColorString("rgba(255,255,255,0.267)"),CEt=G.fromCssColorString("rgba(255,255,255,0)"),TCe=G.fromCssColorString("rgba(66,67,68,0.3)"),ACe=G.fromCssColorString("rgba(0,0,0,0.5)");function A0(e){return G.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var iO={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 bh(e){let t=document.createElementNS(Qx,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(bh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(CCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function N$(e,t,n){let i=document.createElementNS(Qx,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(Qx,"tspan");return o.textContent=n,i.appendChild(o),i}function EEt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var GH=new G;function Jr(e,t){let n=t.alpha,i=1-n;return GH.red=e.red*i+t.red*n,GH.green=e.green*i+t.green*n,GH.blue=e.blue*i+t.blue*n,GH.toCssColorString()}function F$(e,t,n){let i=iO[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 bh(o)}function SEt(e,t,n){let i=iO[n],o=iO.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 bh(r)}function wEt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&VH!==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(),l,u;if(t.type==="touchstart"||t.type==="touchmove"?(l=t.touches[0].clientX,u=t.touches[0].clientY):(l=t.clientX,u=t.clientY),!i&&(l>a.right||l<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=l-o-a.left,p=u-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||l<f.right&&l>f.left&&u>f.top&&u<f.bottom?(VH=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===VH&&(VH=void 0),n.shuttleRingDragging=!1}function L_(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=[Ba(t,"toggled",this.setToggled,this),Ba(t,"tooltip",this.setTooltip,this),Ba(t.command,"canExecute",this.setEnabled,this)]}L_.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();de(this)};L_.prototype.isDestroyed=function(){return!1};L_.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")}};L_.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")))};L_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function zS(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("viewModel is required.");e=Rn(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(Qx,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",CCe);let s=document.createElementNS(Qx,"g");this._topG=s,this._realtimeSVG=new L_(SEt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new L_(F$(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new L_(F$(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new L_(F$(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Qx,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let l=bh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;let u=iO.animation_pathSwooshFX,f=iO.animation_pathPointer,h=bh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=bh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=bh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=bh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=bh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=N$(0,-24,""),this._knobTime=N$(0,-7,""),this._knobStatus=N$(0,-41,"");let y=bh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(Qx,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(l),b.appendChild(h),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let x=this;function A(M){wEt(x,M)}this._mouseCallback=A,l.addEventListener("mousedown",A,!0),l.addEventListener("touchstart",A,!0),h.addEventListener("mousedown",A,!0),h.addEventListener("touchstart",A,!0),n.addEventListener("mousemove",A,!0),n.addEventListener("touchmove",A,!0),n.addEventListener("mouseup",A,!0),n.addEventListener("touchend",A,!0),n.addEventListener("touchcancel",A,!0),this._shuttleRingPointer.addEventListener("mousedown",A,!0),this._shuttleRingPointer.addEventListener("touchstart",A,!0),this._knobOuter.addEventListener("mousedown",A,!0),this._knobOuter.addEventListener("touchstart",A,!0);let E=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],P;this._subscriptions=[Ba(t.pauseViewModel,"toggled",function(M){P!==M&&(P=M,P?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ba(t,"shuttleRingAngle",function(M){EEt(x._shuttleRingPointer,x._knobOuter,M)}),Ba(t,"dateLabel",function(M){S.textContent!==M&&(S.textContent=M)}),Ba(t,"timeLabel",function(M){E.textContent!==M&&(E.textContent=M)}),Ba(t,"multiplierLabel",function(M){v.textContent!==M&&(v.textContent=M)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(zS.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zS.prototype.isDestroyed=function(){return!1};zS.prototype.destroy=function(){c(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 de(this)};zS.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,l=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},${l})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t};zS.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(c(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=A0(this._themeNormal),n=A0(this._themeHover),i=A0(this._themeSelect),o=A0(this._themeDisabled),r=A0(this._themeKnob),s=A0(this._themePointer),a=A0(this._themeSwoosh),l=A0(this._themeSwooshHover),u=bh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(t,nO)},{tagName:"stop",offset:"12%","stop-color":Jr(t,zH)},{tagName:"stop",offset:"46%","stop-color":Jr(t,L$)},{tagName:"stop",offset:"81%","stop-color":Jr(t,HH)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(n,nO)},{tagName:"stop",offset:"12%","stop-color":Jr(n,zH)},{tagName:"stop",offset:"46%","stop-color":Jr(n,L$)},{tagName:"stop",offset:"81%","stop-color":Jr(n,HH)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(i,nO)},{tagName:"stop",offset:"12%","stop-color":Jr(i,zH)},{tagName:"stop",offset:"46%","stop-color":Jr(i,L$)},{tagName:"stop",offset:"81%","stop-color":Jr(i,HH)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(o,AEt)},{tagName:"stop",offset:"75%","stop-color":Jr(o,CEt)}]},{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":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.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":Jr(s,ACe)},{tagName:"stop",offset:"100%","stop-color":Jr(s,ACe)}]},{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":Jr(r,nO)},{tagName:"stop",offset:"60%","stop-color":Jr(r,TCe)},{tagName:"stop",offset:"85%","stop-color":Jr(r,zH)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,TCe)},{tagName:"stop",offset:"60%","stop-color":Jr(r,nO)},{tagName:"stop",offset:"85%","stop-color":Jr(r,HH)}]}]});c(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var jH=zS;var vEt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],C0=15,HS=105;function ECe(e,t){return e-t}function B$(e,t){let n=Mo(t,e,ECe);return n<0?~n:n}function DEt(e,t){if(Math.abs(e)<=C0)return e/C0;let n=C0,i=HS,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 PEt(e,t,n){if(n.clockStep===_o.SYSTEM_CLOCK)return C0;if(Math.abs(e)<=1)return e*C0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=C0,r=HS,s,a=0,l;return e>0?(s=Math.log(i),l=(s-a)/(r-o),(Math.log(e)-a)/l+o):(s=Math.log(-t[0]),l=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/l+o))}function nd(e){if(!c(e))throw new C("clockViewModel is required.");let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=nd.defaultDateFormatter,this._timeFormatter=nd.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(nd.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===_o.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,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return PEt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,HS),-HS);let a=t._allShuttleRingTicks,l=t._clockViewModel;if(l.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===HS){l.multiplier=s>0?a[a.length-1]:a[0];return}let u=DEt(s,a);if(t.snapToTicks)u=a[B$(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>C0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}l.multiplier=u}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===$r.UNBOUNDED)return!0;let l=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===$r.LOOP_STOP)h=Q.greaterThan(u,f)||u.equals(f)&&l>0;else{let p=s.stopTime;h=Q.greaterThan(u,f)&&Q.lessThan(u,p)||u.equals(f)&&l>0||u.equals(p)&&l<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===$r.UNBOUNDED)return!0;let l=s.systemTime;return Q.greaterThanOrEquals(l,s.startTime)&&Q.lessThanOrEquals(l,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=wn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Zx(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=wn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Zx(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=wn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Zx(o,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==_o.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=wn(function(){t._clockViewModel.clockStep=_o.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Zx(r,{toggled:Te.computed(function(){return e.clockStep===_o.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=wn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=B$(l,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=wn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=B$(l,a)+1;u<a.length&&(s.multiplier=a[u])})}nd.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${vEt[n.month-1]} ${n.day} ${n.year}`};nd.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];nd.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`};nd.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};nd.prototype.setShuttleRingTicks=function(e){if(!c(e))throw new C("positiveTicks is required.");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(ECe);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(nd.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){if(typeof e!="function")throw new C("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if(typeof e!="function")throw new C("timeFormatter must be a function");this._timeFormatter=e}}});nd._maxShuttleRingAngle=HS;nd._realtimeShuttleRingAngle=C0;var WH=nd;function SCe(e){e=e??W.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??W.EMPTY_ARRAY,i=e.terrainProviderViewModels??W.EMPTY_ARRAY;if(!c(t))throw new C("globe is required");this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Te.getObservable(this,"imageryProviderViewModels"),r=Te.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._imageryProviders=r;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=c(h)?h.name:void 0,m=c(p)?p.name:void 0;return c(g)&&c(m)?`${g} -${m}`:c(g)?g:m}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(c(h))return h.iconUrl}),this.selectedImagery=void 0;let l=Te.observable();this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(h){if(l()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let x=y.length;for(let A=0;A<x;A++){let E=y.get(A);if(E===g[p]){y.remove(E),b=!0;break}}}if(c(h)){let x=h.creationCommand();if(Array.isArray(x)){let A=x.length;for(this._currentImageryLayers=[],p=A-1;p>=0;p--){let E=mc.fromProviderAsync(x[p]);y.add(E,0),this._currentImageryLayers.push(E)}}else{this._currentImageryLayers=[];let A=mc.fromProviderAsync(x);if(A.name=h.name,b)y.add(A,0);else{let E=y.get(0);c(E)&&y.remove(E),y.add(A,0)}this._currentImageryLayers.push(A)}}l(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Te.observable();Te.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(c(h)&&(p=h.creationCommand()),c(p)&&!c(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof b_),this._globe.terrainProvider=p;else if(c(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),b=new LH(p).readyEvent.addEventListener(x=>{g||(this._globe.depthTestAgainstTerrain=!(x instanceof b_),this._globe.terrainProvider=x,b())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=wn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(SCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var qH=SCe;function YH(e,t){if(!c(e))throw new C("container is required.");e=Rn(e);let n=new qH(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 l=document.createElement("div");l.className="cesium-baseLayerPicker-category",a.appendChild(l);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),l.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),l.appendChild(f);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; }'),f.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 m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",y.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-categoryTitle",x.setAttribute("data-bind","text: name"),b.appendChild(x);let A=document.createElement("div");A.className="cesium-baseLayerPicker-choices",A.setAttribute("data-bind","foreach: providers"),b.appendChild(A);let E=document.createElement("div");E.className="cesium-baseLayerPicker-item",E.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),A.appendChild(E);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),E.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),E.appendChild(v),Te.applyBindings(n,i),Te.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(P){i.contains(P.target)||r.contains(P.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(YH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YH.prototype.isDestroyed=function(){return!1};YH.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),de(this)};var XH=YH;function wCe(e){if(!c(e.name))throw new C("options.name is required.");if(!c(e.tooltip))throw new C("options.tooltip is required.");if(!c(e.iconUrl))throw new C("options.iconUrl is required.");if(typeof e.creationFunction!="function")throw new C("options.creationFunction is required.");let t=e.creationFunction;c(t.canExecute)||(t=wn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(wCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ms=wCe;function IEt(){let e=[],t=devicePixelRatio>=2;return e.push(new ms({name:"Bing Maps Aerial",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ky({style:Xy.AERIAL})}})),e.push(new ms({name:"Bing Maps Aerial with Labels",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ky({style:Xy.AERIAL_WITH_LABELS})}})),e.push(new ms({name:"Bing Maps Roads",iconUrl:tn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ky({style:Xy.ROAD})}})),e.push(new ms({name:"ArcGIS World Imagery",iconUrl:tn("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 qy.fromBasemapType(km.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ms({name:"ArcGIS World Hillshade",iconUrl:tn("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 qy.fromBasemapType(km.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ms({name:"Esri World Ocean",iconUrl:tn("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 qy.fromBasemapType(km.OCEANS,{enablePickFeatures:!1})}})),e.push(new ms({name:"Open\xADStreet\xADMap",iconUrl:tn("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 T0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ms({name:"Stadia x Stamen Watercolor",iconUrl:tn("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 T0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var _ae="__knockoutObservables",yae="__knockoutSubscribable";function A2e(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=b2e(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===_ae||r===yae)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&d6t(n,a)}}),e}function b2e(e,t){var n=e[_ae];return!n&&t&&(n={},Object.defineProperty(e,_ae,{value:n})),n}function f6t(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.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".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),A2e.call(i,e,[t]),e}function d6t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=h6t(e,t,i))})}function h6t(e,t,n){var i=m6t(e,n);return i.subscribe(t)}function m6t(e,t){var n=t[yae];if(!n){n=new e.subscribable,Object.defineProperty(t,yae,{value:n});var i={};p6t(t,n,i),g6t(e,t,n,i)}return n}function p6t(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function g6t(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function x2e(e,t){if(!e)return null;var n=b2e(e,!1);return n&&n[t]||null}function _6t(e,t){var n=x2e(e,t);n&&n.valueHasMutated()}function y6t(e){e.track=A2e,e.getObservable=x2e,e.valueHasMutated=_6t,e.defineProperty=f6t}var z7={attachToKo:y6t};var T2e="http://www.w3.org/2000/svg",E2e="cesium-svgPath-svg",A6t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(T2e,"svg:svg");i.setAttribute("class",E2e);let r=document.createElementNS(T2e,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${E2e} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},V7=A6t;z7.attachToKo(wI);V7.register(wI);var Se=wI;function qM(e){l(e)||(e=new up),this._clock=e,this._eventHelper=new Xo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=K.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(qM.prototype,{clock:{get:function(){return this._clock}}});qM.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.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};qM.prototype.isDestroyed=function(){return!1};qM.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var j7=qM;function b6t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var C2e=b6t;function x6t(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,Se.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var On=x6t;var II={};II.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};II.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};II.createRangeInput=function(e,t,n,i,r,o){o=o??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=r??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};II.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(r),a.appendChild(s),a};II.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Wf=II;function T6t(e,t,n,i,r){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,r)}var Oc=T6t;function v2e(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Se.track(this,["toggled","tooltip"])}Object.defineProperties(v2e.prototype,{command:{get:function(){return this._command}}});var aE=v2e;var gl="http://www.w3.org/2000/svg",P2e="http://www.w3.org/1999/xlink",H7,YM=z.fromCssColorString("rgba(247,250,255,0.384)"),G7=z.fromCssColorString("rgba(143,191,255,0.216)"),Aae=z.fromCssColorString("rgba(153,197,255,0.098)"),W7=z.fromCssColorString("rgba(255,255,255,0.086)"),E6t=z.fromCssColorString("rgba(255,255,255,0.267)"),C6t=z.fromCssColorString("rgba(255,255,255,0)"),S2e=z.fromCssColorString("rgba(66,67,68,0.3)"),w2e=z.fromCssColorString("rgba(0,0,0,0.5)");function ob(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var XM={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 Pm(e){let t=document.createElementNS(gl,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Pm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(P2e,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function xae(e,t,n){let i=document.createElementNS(gl,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(gl,"tspan");return r.textContent=n,i.appendChild(r),i}function v6t(e,t){let n=xae(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["month","day","year"];for(let a=0;a<o.length;++a){if(a>0){let f=document.createElementNS(gl,"tspan");f.textContent=" ",r.push(f),n.appendChild(f)}let c=o[a],u=document.createElementNS(gl,"tspan");u.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),u.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=u,n.appendChild(u)}let s=document.createElementNS(gl,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:r}}function S6t(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",r[0].textContent="",r[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],r[0].textContent=" ",r[1].textContent=" ",e.fallback.textContent=""}function w6t(e,t){let n=xae(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["hour","minute","second"];for(let f=0;f<o.length;++f){if(f>0){let g=document.createElementNS(gl,"tspan");g.textContent=":",r.push(g),n.appendChild(g)}let d=o[f],p=document.createElementNS(gl,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${d}`),p.setAttribute("aria-label",`Adjust ${d} with mouse wheel`),i[d]=p,n.appendChild(p)}let s=document.createElementNS(gl,"tspan");n.appendChild(s);let a=document.createElementNS(gl,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(gl,"tspan");n.appendChild(c);let u=document.createElementNS(gl,"tspan");return n.appendChild(u),{decimalPoint:s,element:n,fallback:u,parts:i,separators:r,suffix:c}}function I6t(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",r[0].textContent="",r[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],r[0].textContent=":",r[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function I2e(e,t,n){let i=Object.keys(t);for(let r=0;r<i.length;++r){let o=i[r],s=t[o],a=function(c){c.deltaY!==0&&(n(o,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function P6t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var q7=new z;function Us(e,t){let n=t.alpha,i=1-n;return q7.red=e.red*i+t.red*n,q7.green=e.green*i+t.green*n,q7.blue=e.blue*i+t.blue*n,q7.toCssColorString()}function bae(e,t,n){let i=XM[n],r={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 Pm(r)}function D6t(e,t,n){let i=XM[n],r=XM.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Pm(o)}function R6t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&H7!==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 r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(H7=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===H7&&(H7=void 0),n.shuttleRingDragging=!1}function y_(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=[Oc(t,"toggled",this.setToggled,this),Oc(t,"tooltip",this.setTooltip,this),Oc(t.command,"canExecute",this.setEnabled,this)]}y_.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();ue(this)};y_.prototype.isDestroyed=function(){return!1};y_.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")}};y_.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")))};y_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function PI(e,t){e=kn(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 r=document.createElement("div");r.className="cesium-animation-theme",r.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=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(gl,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",P2e);let s=document.createElementNS(gl,"g");this._topG=s,this._realtimeSVG=new y_(D6t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new y_(bae(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new y_(bae(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new y_(bae(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(gl,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Pm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=XM.animation_pathSwooshFX,f=XM.animation_pathPointer,d=Pm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Pm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Pm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Pm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Pm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g}),y=v6t(0,-24);this._knobDate=y.element;let A=w6t(0,-7);this._knobTime=A.element,this._knobStatus=xae(0,-41,"");let b=Pm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(gl,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobStatus),p.appendChild(b),p.appendChild(this._knobDate),p.appendChild(this._knobTime),o.appendChild(s),e.appendChild(o);let T=this;function E(I){R6t(T,I)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),d.addEventListener("mousedown",E,!0),d.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let v=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],I2e(this,y.parts,function(I,R){t.adjustDate(I,R)}),I2e(this,A.parts,function(I,R){t.adjustTime(I,R)});let S;this._subscriptions=[Oc(t.pauseViewModel,"toggled",function(I){S!==I&&(S=I,S?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Oc(t,"shuttleRingAngle",function(I){P6t(T._shuttleRingPointer,T._knobOuter,I)}),Oc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&S6t(y,I)}),Oc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&I6t(A,I)}),Oc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(PI.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PI.prototype.isDestroyed=function(){return!1};PI.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);let n=this._fieldWheelListeners;for(let r=0;r<n.length;++r){let o=n[r];o.element.removeEventListener("wheel",o.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let r=0,o=i.length;r<o;r++)i[r].dispose();return ue(this)};PI.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,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${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};PI.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=ob(this._themeNormal),n=ob(this._themeHover),i=ob(this._themeSelect),r=ob(this._themeDisabled),o=ob(this._themeKnob),s=ob(this._themePointer),a=ob(this._themeSwoosh),c=ob(this._themeSwooshHover),u=Pm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(t,YM)},{tagName:"stop",offset:"12%","stop-color":Us(t,G7)},{tagName:"stop",offset:"46%","stop-color":Us(t,Aae)},{tagName:"stop",offset:"81%","stop-color":Us(t,W7)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(n,YM)},{tagName:"stop",offset:"12%","stop-color":Us(n,G7)},{tagName:"stop",offset:"46%","stop-color":Us(n,Aae)},{tagName:"stop",offset:"81%","stop-color":Us(n,W7)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(i,YM)},{tagName:"stop",offset:"12%","stop-color":Us(i,G7)},{tagName:"stop",offset:"46%","stop-color":Us(i,Aae)},{tagName:"stop",offset:"81%","stop-color":Us(i,W7)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(r,E6t)},{tagName:"stop",offset:"75%","stop-color":Us(r,C6t)}]},{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":Us(s,w2e)},{tagName:"stop",offset:"100%","stop-color":Us(s,w2e)}]},{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":Us(o,YM)},{tagName:"stop",offset:"60%","stop-color":Us(o,S2e)},{tagName:"stop",offset:"85%","stop-color":Us(o,G7)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,S2e)},{tagName:"stop",offset:"60%","stop-color":Us(o,YM)},{tagName:"stop",offset:"85%","stop-color":Us(o,W7)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var Y7=PI;var O6t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],sb=15,DI=105,M6t=[31,28,31,30,31,30,31,31,30,31,30,31];function N6t(e,t){return t===2&&Jf(e)?29:M6t[t-1]}function D2e(e,t,n){return K.fromGregorianDate(new Fm(t,n,Math.min(e.day,N6t(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function R2e(e,t){return e-t}function Tae(e,t){let n=Pr(t,e,R2e);return n<0?~n:n}function L6t(e,t){if(Math.abs(e)<=sb)return e/sb;let n=sb,i=DI,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function F6t(e,t,n){if(n.clockStep===jr.SYSTEM_CLOCK)return sb;if(Math.abs(e)<=1)return e*sb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=sb,o=DI,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Zu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Zu.defaultDateFormatter,this._timeFormatter=Zu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Zu.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===jr.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 F6t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,DI),-DI);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===DI){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=L6t(s,a);if(t.snapToTicks)u=a[Tae(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>sb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Ps.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===Ps.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Ps.UNBOUNDED)return!0;let c=s.systemTime;return K.greaterThanOrEquals(c,s.startTime)&&K.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=On(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new aE(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=On(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new aE(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=On(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new aE(r,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==jr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=On(function(){t._clockViewModel.clockStep=jr.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new aE(o,{toggled:Se.computed(function(){return e.clockStep===jr.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Tae(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Tae(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Zu.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${O6t[n.month-1]} ${n.day} ${n.year}`};Zu.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];Zu.defaultTimeFormatter=function(e,t){let n=K.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`};Zu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Zu.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(R2e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Zn(s,o),this._allShuttleRingTicks=s};Zu.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r=K.toGregorianDate(i),o;if(e==="day"){o=K.addDays(i,t,new K);let s=K.toGregorianDate(o);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((r.year-1)*12+r.month-1+t,0),119987),c=Math.floor(a/12)+1,u=a%12+1;o=D2e(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=D2e(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};Zu.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r;if(e==="hour")r=K.addHours(i,t,new K);else if(e==="minute")r=K.addMinutes(i,t,new K);else{let s=e==="second"?t:t/1e3;r=K.addSeconds(i,s,new K)}let o=K.toGregorianDate(r);o.year<1||o.year>9999||(n.shouldAnimate=!1,n.currentTime=r)};Object.defineProperties(Zu.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}}});Zu._maxShuttleRingAngle=DI;Zu._realtimeShuttleRingAngle=sb;var X7=Zu;function B6t(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Eae(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var k6t=new gn,U6t=new h;function KM(e,t){let n=this,i=e.canvas,r=new da(i);this._eventHandler=r,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 o=this._scene.globe;o.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=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=On(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=On(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=On(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new XA({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=On(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=On(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new f7({modelMatrix:u}),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=On(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.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(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=On(function(){let u=n.depthFrustum+1;return n.depthFrustum=Eae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=On(function(){let u=n.depthFrustum-1;return n.depthFrustum=Eae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=On(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new F7({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=On(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=On(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=On(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,fn.LEFT_CLICK):r.removeInputAction(fn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,k6t),g=o.pick(p,n._scene,U6t);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=On(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,fn.LEFT_CLICK):r.removeInputAction(fn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(KM.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 On(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return On(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return On(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return On(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return On(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}}});KM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=B6t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Eae(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}`};KM.prototype.isDestroyed=function(){return!1};KM.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(),ue(this)};var K7=KM;function $7(e,t){e=kn(e);let n=document.createElement("div"),i=new K7(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.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",r.appendChild(s);let a=Wf.createSection,c=Wf.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let S=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",S.appendChild(I);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",I.appendChild(v);let O=document.createElement("div");I.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let D=document.createElement("input");D.type="button",D.value="SE",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(N),O.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),B=document.createElement("tr"),j=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let G=document.createElement("td");G.appendChild(_);let q=document.createElement("td");q.appendChild(C),B.appendChild(k),B.appendChild(G),B.appendChild(q);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let J=document.createElement("td");J.appendChild(D),j.appendChild(Q),j.appendChild(W),j.appendChild(J),V.appendChild(B),V.appendChild(j),O.appendChild(V),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),S.appendChild(c("Wireframe","wireframe")),S.appendChild(c("Suspend LOD update","suspendUpdates")),S.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties($7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$7.prototype.isDestroyed=function(){return!1};$7.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var J7=$7;function O2e(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Se.getObservable(this,"imageryProviderViewModels"),o=Se.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} +${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=Fs.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Fs.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof og),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new L7(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof og),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=On(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(O2e.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var Z7=O2e;function Q7(e,t){e=kn(e);let n=new Z7(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 r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),Se.applyBindings(n,i),Se.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(S){i.contains(S.target)||o.contains(S.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Q7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Q7.prototype.isDestroyed=function(){return!1};Q7.prototype.destroy=function(){return dn.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),ue(this)};var eW=Q7;function M2e(e){let t=e.creationFunction;l(t.canExecute)||(t=On(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(M2e.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var yo=M2e;function z6t(){let e=[],t=devicePixelRatio>=2;return e.push(new yo({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Qy({style:Zy.AERIAL})}})),e.push(new yo({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Qy({style:Zy.AERIAL_WITH_LABELS})}})),e.push(new yo({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Qy({style:Zy.ROAD})}})),e.push(new yo({name:"ArcGIS World Imagery",iconUrl:Zt("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 Jy.fromBasemapType(Mp.SATELLITE,{enablePickFeatures:!1})}})),e.push(new yo({name:"ArcGIS World Hillshade",iconUrl:Zt("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 Jy.fromBasemapType(Mp.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new yo({name:"Esri World Ocean",iconUrl:Zt("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 Jy.fromBasemapType(Mp.OCEANS,{enablePickFeatures:!1})}})),e.push(new yo({name:"Open\xADStreet\xADMap",iconUrl:Zt("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 rb({url:"https://tile.openstreetmap.org/"})}})),e.push(new yo({name:"Stadia x Stamen Watercolor",iconUrl:Zt("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 rb({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Stadia x Stamen Toner",iconUrl:tn("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 T0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Stadia x Stamen Toner",iconUrl:Zt("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 rb({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Stadia Alidade Smooth",iconUrl:tn("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 T0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Stadia Alidade Smooth",iconUrl:Zt("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 rb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Stadia Alidade Smooth Dark",iconUrl:tn("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 T0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Stadia Alidade Smooth Dark",iconUrl:Zt("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 rb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Sentinel-2",iconUrl:tn("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 Yy.fromAssetId(3954)}})),e.push(new ms({name:"Blue Marble",iconUrl:tn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Yy.fromAssetId(3845)}})),e.push(new ms({name:"Earth at night",iconUrl:tn("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 Yy.fromAssetId(3812)}})),e.push(new ms({name:"Natural Earth\xA0II",iconUrl:tn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return _x.fromUrl(tn("Assets/Textures/NaturalEarthII"))}})),e}var KH=IEt;function OEt(){let e=[];return e.push(new ms({name:"WGS84 Ellipsoid",iconUrl:tn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new b_({ellipsoid:ie.WGS84})}})),e.push(new ms({name:"Cesium World Terrain",iconUrl:tn("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 ES({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var $H=OEt;function REt(e){return function(t){let n=e._scene.pick(t.position);c(n)&&n.primitive instanceof As&&(e.tileset=n.primitive),e.pickActive=!1}}function DCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);c(i)&&i.primitive instanceof As&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var MEt={maximumFractionDigits:3};function oO(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,MEt):Math.round(t).toLocaleString()}function rO(e,t){if(!c(e))return"";let n=t?e._statisticsPerPass[Uo.PICK]:e._statisticsPerPass[Uo.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>${oO(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${oO(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${oO(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function PCe(){let e=Di.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${oO(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${oO(e.texturesByteLength)}</li> - </ul> - `}var LEt=[{text:"Highlight",value:nu.HIGHLIGHT},{text:"Replace",value:nu.REPLACE},{text:"Mix",value:nu.MIX}],vCe=new G(1,1,0,.4),NEt=new G,ZH=new G;function xa(e,t){T.typeOf.object("scene",e),T.typeOf.object("performanceContainer",t);let n=this,i=e.canvas;this._eventHandler=new $f(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new t0({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,Te.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=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let U=[],q=n._properties();for(let X in q)q.hasOwnProperty(X)&&U.push(X);return U});let o=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),c(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=nu.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(q){let X=e.pick(q.endPosition);if(X instanceof ta?(n.feature=X,n.tile=X.content.tile):c(X)&&c(X.content)?(n.feature=void 0,n.tile=X.content.tile):(n.feature=void 0,n.tile=void 0),!!c(n._tileset)){if(s&&c(X)&&c(X.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(q.endPosition),c(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=X.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let l=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return l()},set:function(U){l(U),c(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),c(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),c(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(U){h(U),c(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),c(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),c(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),c(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(U){m(U),c(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(U){y(U),c(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(U){b(U),c(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let x=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return x()},set:function(U){x(U),c(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let A=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),c(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let E=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(E(),1/6)},set:function(U){let q=Math.pow(U,6);E(q),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=q)}});let S=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let v=REt(this),P=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return P()},set:function(U){P(U),U?n._eventHandler.setInputAction(v,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let M=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return M()},set:function(U){M(U),c(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let R=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),c(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let L=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),c(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let B=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return B()},set:function(U){U=Number(U),isNaN(U)||(B(U),c(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let w=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(U){U=Number(U),isNaN(U)||(w(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let D=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(U){U=Number(U),isNaN(U)||(D(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),c(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let N=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),c(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let k=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),c(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let H=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return H()},set:function(U){U=Number(U),isNaN(U)||(H(U),c(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),c(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(U){j(U),c(n._tileset)&&(n._tileset.loadSiblings=U)}}),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()}),c(this._tileset)||DCe(this,!0)}Object.defineProperties(xa.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 LEt}},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,c(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=rO(e,!1),this._pickStatisticsText=rO(e,!0),this._resourceCacheStatisticsText=PCe(),DCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;c(t)&&!t.content.isDestroyed()&&(!this.colorize&&c(this._style)?t.color=c(this._style.color)?this._style.color.evaluateColor(t,NEt):G.WHITE:t.color=ZH,this._scene.requestRender()),c(e)&&(G.clone(e.color,ZH),e.color=vCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;c(t)&&!t.isDestroyed()&&!k$(t.content)&&(t.color=ZH,this._scene.requestRender()),c(e)&&!k$(e.content)&&(G.clone(e.color,ZH),e.color=vCe,this._scene.requestRender()),this._tile=e}}});function k$(e){if(!c(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)if(!k$(t[i]))return!1;return!0}return!1}xa.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};xa.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};xa.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};xa.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};xa.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};xa.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};xa.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};xa.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};xa.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};xa.prototype.trimTilesCache=function(){c(this._tileset)&&this._tileset.trimLoadedTiles()};xa.prototype.compileStyle=function(){let e=this._tileset;if(!(!c(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}};xa.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(` -`),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+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};xa.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),c(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=rO(e,!1),this._pickStatisticsText=rO(e,!0),this._resourceCacheStatisticsText=PCe())};xa.prototype.isDestroyed=function(){return!1};xa.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),de(this)};xa.getStatistics=rO;var QH=xa;function JH(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=Rn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new QH(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=Vu.createSection,l=Vu.createCheckbox,u=Vu.createRangeInput,f=Vu.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),x=a(s,"Optimization","optimizationVisible","toggleOptimization"),A=document.createElement("div");A.className="field-group";let E=document.createElement("label");E.className="field-label",E.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),A.appendChild(E),A.appendChild(S),h.appendChild(A),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(l("Enable Picking","picking")),p.appendChild(l("Colorize","colorize"));let v=p.appendChild(l("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),P=document.createElement("p");P.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),P.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),P.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(P),p.appendChild(l("Bounding Volumes","showBoundingVolumes")),p.appendChild(l("Content Volumes","showContentBoundingVolumes")),p.appendChild(l("Request Volumes","showRequestVolumes")),p.appendChild(l("Point Cloud Shading","pointCloudShading"));let M=document.createElement("div");M.setAttribute("data-bind","visible: pointCloudShading"),M.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),M.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),M.appendChild(u("Base Resolution","baseResolution",0,1,.01)),M.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(M);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),M.appendChild(R),g.appendChild(l("Freeze Frame","freezeFrame")),g.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let B=document.createElement("div");B.setAttribute("data-bind","visible: dynamicScreenSpaceError"),B.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),B.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(B),m.appendChild(l("Performance","performance")),m.appendChild(i),m.appendChild(l("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(l("Pick Statistics","showPickStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(w),m.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));let D=document.createElement("div");D.className="cesium-3dTilesInspector-statistics",D.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(D);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let k=document.createElement("textarea");k.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(k);let H=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(H);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),y.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(l("Geometric Error","showGeometricError")),y.appendChild(l("Rendering Statistics","showRenderingStatistics")),y.appendChild(l("Memory Usage (MB)","showMemoryUsage")),y.appendChild(l("Url","showUrl")),x.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),x.appendChild(j);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),x.appendChild(U);let q=document.createElement("div");q.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),x.appendChild(q),x.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(l("Load siblings of visible tiles","loadSiblings")),Te.applyBindings(o,n)}Object.defineProperties(JH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});JH.prototype.isDestroyed=function(){return!1};JH.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var eG=JH;function FEt(e){let t;if(c(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 l=Math.pow(2,a);o>=l&&(s.push(a+1),o-=l)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function U$(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var BEt=new _n,kEt=new d;function sO(e,t){if(!c(e))throw new C("scene is required");if(!c(t))throw new C("performanceContainer is required");let n=this,i=e.canvas,o=new $f(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="",Te.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=wn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=wn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=wn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=wn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new t0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=wn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=wn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new gH({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else c(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=wn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return c(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:c(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=wn(function(){let u=n.depthFrustum+1;return n.depthFrustum=U$(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=wn(function(){let u=n.depthFrustum-1;return n.depthFrustum=U$(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=wn(function(){return n.tileCoordinates&&!c(s)?s=e.imageryLayers.addImageryProvider(new NH({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&c(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=wn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=wn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],c(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Te.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});c(f)&&(n.primitive=c(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=wn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)});function l(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,BEt),g=r.pick(p,n._scene,kEt);if(c(g)){let m=h.cartesianToCartographic(g),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<y.length;++b){let x=y[b];if(c(x))for(let A=0;!f&&A<x.length;++A){let E=x[A];ce.contains(E.rectangle,m)&&(f=E)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=wn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(l,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(sO.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 wn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return wn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return wn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return wn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return wn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,c(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,c(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(c(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;c(n)&&c(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}}});sO.prototype._update=function(){this.frustums&&(this.frustumStatisticText=FEt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=U$(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}`};sO.prototype.isDestroyed=function(){return!1};sO.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(),de(this)};var tG=sO;function nG(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let n=document.createElement("div"),i=new tG(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=Vu.createSection,l=Vu.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=l("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(l("Show Frustum Planes","frustumPlanes")),u.appendChild(l("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let x=document.createElement("input");x.type="button",x.value="+",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(x);let A=a(s,"Primitives","primitivesVisible","togglePrimitives"),E=document.createElement("div");E.className="cesium-cesiumInspector-pickSection",A.appendChild(E);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),E.appendChild(v),E.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),E.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),E.appendChild(this._primitiveOnly);let P=a(s,"Terrain","terrainVisible","toggleTerrain"),M=document.createElement("div");M.className="cesium-cesiumInspector-pickSection",P.appendChild(M);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",M.appendChild(v);let L=document.createElement("div");M.appendChild(L);let B=document.createElement("input");B.type="button",B.value="Parent",B.className="cesium-cesiumInspector-pickButton",B.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let w=document.createElement("input");w.type="button",w.value="NE",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectNE");let D=document.createElement("input");D.type="button",D.value="SW",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(N),L.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let k=document.createElement("div");k.className="cesium-cesiumInspector-relativeText",k.textContent="Select relative:",L.appendChild(k);let H=document.createElement("table"),V=document.createElement("tr"),j=document.createElement("tr"),U=document.createElement("td");U.appendChild(B);let q=document.createElement("td");q.appendChild(_);let X=document.createElement("td");X.appendChild(w),V.appendChild(U),V.appendChild(q),V.appendChild(X);let te=document.createElement("td"),K=document.createElement("td");K.appendChild(D);let Z=document.createElement("td");Z.appendChild(I),j.appendChild(te),j.appendChild(K),j.appendChild(Z),H.appendChild(V),H.appendChild(j),L.appendChild(H),M.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),M.appendChild(l("Show only selected","filterTile","hasPickedTile")),P.appendChild(l("Wireframe","wireframe")),P.appendChild(l("Suspend LOD update","suspendUpdates")),P.appendChild(l("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(nG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nG.prototype.isDestroyed=function(){return!1};nG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var iG=nG;function oG(e,t){c(t)||(t=document.body),t=Rn(t);let n=this,i=Te.observable(Ir.fullscreen),o=Te.observable(Ir.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Ir.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=wn(function(){Ir.fullscreen?Ir.exitFullscreen():Ir.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Rn(e)??r.body,this._callback=function(){i(Ir.fullscreen)},r.addEventListener(Ir.changeEventName,this._callback)}Object.defineProperties(oG.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new C("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}});oG.prototype.isDestroyed=function(){return!1};oG.prototype.destroy=function(){document.removeEventListener(Ir.changeEventName,this._callback),de(this)};var rG=oG;var UEt="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",VEt="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 sG(e,t){if(!c(e))throw new C("container is required.");e=Rn(e);let n=new rG(t,e);n._exitFullScreenPath=VEt,n._enterFullScreenPath=UEt;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),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(sG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sG.prototype.isDestroyed=function(){return!1};sG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var aG=sG;function ICe(e,t){if(!c(e))throw new C("scene is required.");this._scene=e,this._duration=t;let n=this;this._command=wn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(ICe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(c(e)&&e<0)throw new C("value must be positive.");this._duration=e}}});var cG=ICe;function lG(e,t,n){if(!c(e))throw new C("container is required.");e=Rn(e);let i=new cG(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),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(lG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lG.prototype.isDestroyed=function(){return!1};lG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var uG=lG;var OCe=1e3;function id(e){if(!c(e)||!c(e.scene))throw new C("options.scene is required.");c(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new vS({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 pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=MCe,this._handleArrowUp=RCe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let o=Te.getObservable(t,"_suggestions")().length>0,r=Te.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=wn(function(i){if(i=i??Gx.SEARCH,t._focusTextbox=!1,c(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)qEt(t);else return jEt(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?RCe(t):r?MCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;FCe(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=e.autocomplete??!0,this.destinationFound=e.destinationFound??id.flyToDestination,this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){id._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){if(typeof i!="string")throw new C("value must be a valid string.");this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){if(c(i)&&i<0)throw new C("value must be positive.");this._flightDuration=i}})}Object.defineProperties(id.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}}});id.prototype.destroy=function(){this._suggestionSubscription.dispose()};function RCe(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],id._adjustSuggestionsScroll(e,n)}function MCe(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],id._adjustSuggestionsScroll(e,i)}function zEt(e,t){let n=c(t)?t.availability:void 0;return c(n)?vE(t,[e]).then(function(i){return e=i[0],e.height+=OCe,e}):(e.height+=OCe,Promise.resolve(e))}function HEt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?O.equalsEpsilon(t.south,t.north,O.EPSILON7)&&O.equalsEpsilon(t.east,t.west,O.EPSILON7)?t=ce.center(t):a=DE(t,n):t=i.cartesianToCartographic(t),c(a)||(a=zEt(t,r)),a.then(function(l){s=i.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function GEt(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 jEt(e,t,n){let i=e._searchText;if(NCe(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 GEt(t[o],i,n),c(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,z$(e);let s=r.value;if(r.state==="fulfilled"&&c(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=LCe(e,BI.getCreditsFromResult(s[0]));c(a)||V$(e,t[o].credit);return}e._searchText=`${i} (not found)`}function V$(e,t){c(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function LCe(e,t){return c(t)&&t.forEach(n=>V$(e,n)),t}function z$(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function WEt(e,t){let n=Rn(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 qEt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function NCe(e){return/^\s*$/.test(e)}function FCe(e){Te.getObservable(e,"_suggestions").removeAll()}async function YEt(e){if(!e.autoComplete)return;let t=e._searchText;if(FCe(e),z$(e),!NCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Gx.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=BI.getCreditsFromResult(r);o=o&&!c(s),LCe(e,s)}),o&&V$(e,n.credit)}if(e._suggestions.length>=5)return}}id.flyToDestination=HEt;id._updateSearchSuggestions=YEt;id._adjustSuggestionsScroll=WEt;id.prototype.isDestroyed=function(){return!1};id.prototype.destroy=function(){return z$(this),de(this)};var fG=id;var XEt="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",KEt="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 dG(e){if(!c(e)||!c(e.container))throw new C("options.container is required.");if(!c(e.scene))throw new C("options.scene is required.");let t=Rn(e.container),n=new fG(e);n._startSearchPath=XEt,n._stopSearchPath=KEt;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 l=document.createElement("li");a.appendChild(l),l.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Te.applyBindings(n,i),Te.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},zt.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(dG.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});dG.prototype.isDestroyed=function(){return!1};dG.prototype.destroy=function(){let e=this._container;return zt.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(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),de(this)};var hG=dG;function $Et(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function kCe(e,t){Te.track(e);for(let n=0;n<e.sublayers.length;n++)kCe(e.sublayers[n],t)}function mG(e){return e.modelName==="FullModel"}function UCe(e){return e.modelName==="Overview"}function VCe(e){return UCe(e)||mG(e)}function BCe(e,t){if(VCe(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:Te.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function ZEt(e,t){if(VCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");mG(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function QEt(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 JEt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Te.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Te.observable(!0),index:-1}],currentLayer:Te.observable(),expandClickHandler:$Et,setOptionDisable:function(i,o){Te.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){ZEt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){kCe(n[i],this.viewModel);let o=BCe(n[i],this.viewModel);c(o)&&(UCe(o)||!c(this.viewModel.defaultLayer)&&mG(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=BCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=mG(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return QEt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var pG=JEt;function eSt(e,t){let n=document.getElementById(e);T.defined("container",n),T.defined("i3sProvider",t);let i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Sentinel-2",iconUrl:Zt("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 Lu.fromAssetId(3954)}})),e.push(new yo({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3845)}})),e.push(new yo({name:"Earth at night",iconUrl:Zt("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 Lu.fromAssetId(3812)}})),e.push(new yo({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Fx.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new yo({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3830182)}})),e.push(new yo({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3830183)}})),e.push(new yo({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3830184)}})),e.push(new yo({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3830186)}})),e.push(new yo({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3891168)}})),e.push(new yo({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return Lu.fromAssetId(3891169)}})),e}var tW=z6t;function V6t(){let e=[];return e.push(new yo({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new og({ellipsoid:ee.WGS84})}})),e.push(new yo({name:"Cesium World Terrain",iconUrl:Zt("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 wC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var nW=V6t;function iW(e,t){l(t)||(t=document.body),t=kn(t);let n=this,i=Se.observable(ss.fullscreen),r=Se.observable(ss.enabled),o=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 r()},set:function(s){r(s&&ss.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=On(function(){ss.fullscreen?ss.exitFullscreen():ss.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=kn(e)??o.body,this._callback=function(){i(ss.fullscreen)},o.addEventListener(ss.changeEventName,this._callback)}Object.defineProperties(iW.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});iW.prototype.isDestroyed=function(){return!1};iW.prototype.destroy=function(){document.removeEventListener(ss.changeEventName,this._callback),ue(this)};var rW=iW;var j6t="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",H6t="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 oW(e,t){e=kn(e);let n=new rW(t,e);n._exitFullScreenPath=H6t,n._enterFullScreenPath=j6t;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(oW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});oW.prototype.isDestroyed=function(){return!1};oW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var sW=oW;var N2e=1e3;function Dm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new UC({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=F2e,this._handleArrowUp=L2e;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let r=Se.getObservable(t,"_suggestions")().length>0,o=Se.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=On(function(i){if(i=i??Qb.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)K6t(t);else return Y6t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?L2e(t):o?F2e(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;U2e(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??Dm.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(){Dm._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(Dm.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}}});function L2e(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],Dm._adjustSuggestionsScroll(e,n)}function F2e(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],Dm._adjustSuggestionsScroll(e,i)}function G6t(e,t){let n=l(t)?t.availability:void 0;return l(n)?rv(t,[e]).then(function(i){return e=i[0],e.height+=N2e,e}):(e.height+=N2e,Promise.resolve(e))}function W6t(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,s=t,a;return t instanceof ie?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ie.center(t):a=Xw(t,n):t=i.cartesianToCartographic(t),l(a)||(a=G6t(t,o)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function q6t(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 Y6t(e,t,n){let i=e._searchText;if(k2e(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await q6t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,vae(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=B2e(e,sD.getCreditsFromResult(s[0]));l(a)||Cae(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Cae(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function B2e(e,t){return l(t)&&t.forEach(n=>Cae(e,n)),t}function vae(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function X6t(e,t){let n=kn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function K6t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function k2e(e){return/^\s*$/.test(e)}function U2e(e){Se.getObservable(e,"_suggestions").removeAll()}async function $6t(e){if(!e.autoComplete)return;let t=e._searchText;if(U2e(e),vae(e),!k2e(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Qb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=sD.getCreditsFromResult(o);r=r&&!l(s),B2e(e,s)}),r&&Cae(e,n.credit)}if(e._suggestions.length>=5)return}}Dm.flyToDestination=W6t;Dm._updateSearchSuggestions=$6t;Dm._adjustSuggestionsScroll=X6t;Dm.prototype.isDestroyed=function(){return!1};Dm.prototype.destroy=function(){return this._suggestionSubscription.dispose(),vae(this),ue(this)};var aW=Dm;var J6t="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",Z6t="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 cW(e){let t=kn(e.container),n=new aW(e);n._startSearchPath=J6t,n._stopSearchPath=Z6t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.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(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),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(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},dn.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(cW.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});cW.prototype.isDestroyed=function(){return!1};cW.prototype.destroy=function(){let e=this._container;return dn.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),ue(this)};var lW=cW;function z2e(e,t){this._scene=e,this._duration=t;let n=this;this._command=On(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(z2e.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 uW=z2e;function fW(e,t,n){e=kn(e);let i=new uW(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 r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Se.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(fW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});fW.prototype.isDestroyed=function(){return!1};fW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var dW=fW;function Q6t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function j2e(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)j2e(e.sublayers[n],t)}function hW(e){return e.modelName==="FullModel"}function H2e(e){return e.modelName==="Overview"}function G2e(e){return H2e(e)||hW(e)}function V2e(e,t){if(G2e(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 eHt(e,t){if(G2e(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");hW(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function tHt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function nHt(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:Q6t,setOptionDisable:function(i,r){Se.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){eHt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){j2e(n[i],this.viewModel);let r=V2e(n[i],this.viewModel);l(r)&&(H2e(r)||!l(this.viewModel.defaultLayer)&&hW(r))&&(this.viewModel.defaultLayer=r)}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=V2e(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=hW(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return tHt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var mW=nHt;function iHt(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" @@ -10976,9 +12806,16 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new pG(t);Te.track(o),Te.applyBindings(o,n),c(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var zCe=eSt;var tSt="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",nSt="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 H$(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.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,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?nSt:tSt}}),Te.defineProperty(this,"_bodyless",{get:function(){return!c(this.description)||this.description.length===0}})}H$.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(H$.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var _G=H$;function gG(e){T.defined("container",e),e=Rn(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="×",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 _G;Te.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 l=r.contentDocument,u=l.createElement("link");u.href=tn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=l.createElement("div");f.className="cesium-infoBox-description",l.head.appendChild(u),l.body.appendChild(f),a._descriptionSubscription=Ba(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let y=window.getComputedStyle(g);if(y!==null){let b=y["background-color"],x=G.fromCssColorString(b);c(x)&&x.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(gG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});gG.prototype.isDestroyed=function(){return!1};gG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),c(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),de(this)};var yG=gG;function bG(e){if(!c(e))throw new C("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof on,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=wn(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 on}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=c(e.camera._currentFlight)}),this._switchToPerspective=wn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=wn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(bG.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}}});bG.prototype.isDestroyed=function(){return!1};bG.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var xG=bG;var iSt="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",oSt="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 TG(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let n=new xG(t);n._perspectivePath=iSt,n._orthographicPath=oSt;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),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(TG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});TG.prototype.isDestroyed=function(){return!1};TG.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var AG=TG;function G$(e){if(!c(e)||!c(e.scene))throw new C("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=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,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=wn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=xH.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(G$.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});G$.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),de(this)};var CG=G$;function EG(e){if(!c(e)||!c(e.container))throw new C("options.container is required.");if(!c(e.scene))throw new C("options.scene is required.");let t=Rn(e.container),n=new CG(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="×",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),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(EG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EG.prototype.isDestroyed=function(){return!1};EG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var SG=EG;function HCe(){this.showInstructions=!1;let e=this;this._command=wn(function(){e.showInstructions=!e.showInstructions}),this._showClick=wn(function(){e._touch=!1}),this._showTouch=wn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(HCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var wG=HCe;function vG(e){if(!c(e)||!c(e.container))throw new C("options.container is required.");let t=Rn(e.container),n=new wG,i=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 l=document.createElement("img");l.src=tn("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",a.appendChild(l),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=tn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);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="${tn("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="${tn("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="${tn("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="${tn("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="${tn("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="${tn("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="${tn("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),Te.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(vG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vG.prototype.isDestroyed=function(){return!1};vG.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var DG=vG;var rSt=new z,PG="-1000px";function aO(e,t,n){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("selectionIndicatorElement is required.");if(!c(n))throw new C("container is required.");this._scene=e,this._screenPositionX=PG,this._screenPositionY=PG,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&c(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Hi.worldToWindowCoordinates(e,i,o)}}aO.prototype.update=function(){if(this.showSelection&&c(this.position)){let e=this.computeScreenSpacePosition(this.position,rSt);if(!c(e))this._screenPositionX=PG,this._screenPositionY=PG;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`}}};aO.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};aO.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};Object.defineProperties(aO.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var IG=aO;function OG(e,t){if(!c(e))throw new C("container is required.");e=Rn(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 l=new IG(t,this._element,this._container);this._viewModel=l,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(OG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OG.prototype.isDestroyed=function(){return!1};OG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),de(this)};var RG=OG;function MG(e,t){if(!c(e))throw new C("scene is required.");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=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=wn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=wn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=wn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=wn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(MG.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new C("duration value must be positive.");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}}});MG.prototype.isDestroyed=function(){return!1};MG.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var LG=MG;var sSt="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",aSt="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",cSt="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 NG(e,t,n){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let i=new LG(t,n);i._globePath=sSt,i._flatMapPath=aSt,i._columbusViewPath=cSt;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 l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.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(l),Te.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(NG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NG.prototype.isDestroyed=function(){return!1};NG.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var FG=NG;function Jx(e,t,n){this._color=e,this._height=t,this._base=n??0}Jx.prototype.getHeight=function(){return this._height};Jx.prototype.getBase=function(){return this._base};Jx.prototype.getStartTime=function(){return this._start};Jx.prototype.getStopTime=function(){return this._stop};Jx.prototype.setRange=function(e,t){this._start=e,this._stop=t};Jx.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 BG=Jx;function GCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new G(.5,.5,.5,1),this.backgroundColor=i||new G(0,0,0,0)}GCe.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,l;for(s=0;s<t.timeBarWidth;++s){let u=Q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Q);!c(a)&&Q.greaterThanOrEquals(u,n)?a=s:!c(l)&&Q.greaterThanOrEquals(u,i)&&(l=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),c(a)&&(c(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(l-a,1),this.height))}};var kG=GCe;var j$=1e12,od={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},nl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},E0=[.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],lSt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function il(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("clock is required.");e=Rn(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=od.none,this._touchMode=nl.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=uSt(this),this._onMouseUp=fSt(this),this._onMouseMove=dSt(this),this._onMouseWheel=hSt(this),this._onTouchStart=mSt(this),this._onTouchMove=_St(this),this._onTouchEnd=pSt(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()}il.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};il.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};il.prototype.isDestroyed=function(){return!1};il.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),de(this)};il.prototype.addHighlightRange=function(e,t,n){let i=new BG(e,t,n);return this._highlightRanges.push(i),this.resize(),i};il.prototype.addTrack=function(e,t,n,i){let o=new kG(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};il.prototype.zoomTo=function(e,t){if(!c(e))throw new C("startTime is required.");if(!c(t))throw new C("stopTime is required");if(Q.lessThanOrEquals(t,e))throw new C("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==$r.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)};il.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 W$(e){return e<10?`0${e.toString()}`:e.toString()}il.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`${lSt[t.month-1]} ${t.day} ${t.year} ${W$(t.hour)}:${W$(t.minute)}:${W$(t.second)}${i}`};il.prototype.smallestTicInPixels=7;il.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,l=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):h>l&&(h=l,this._timeBarSecondsSpan=l,this._endJulian=Q.addSeconds(this._startJulian,l,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(h/p*1e-5,.4),y,b=Q.toGregorianDate(g);h>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):h>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):h>86400?y=Q.fromDate(new Date(Date.UTC(b.year,0))):y=Q.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let x=Q.secondsDifference(this._startJulian,Q.addSeconds(y,m,new Q)),A=x+h;this._epochJulian=y;function E(U){return Math.floor(x/U)*U}function S(U,q){return Math.ceil(U/q+.5)*q}function v(U){return(U-x)/h}function P(U,q){return U-q*Math.round(U/q)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let M=this._rulerEle.offsetWidth+20;M<30&&(M=180);let R=f;f-=u;let L={startTime:x,startJulian:g,epochJulian:y,duration:h,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(U){s+=U.render(L)});let B=0,_=0,w=0,D=M/p;D>1&&(D=1),D*=this._timeBarSecondsSpan;let I=-1,N=-1,k=E0.length,H;for(H=0;H<k;++H){let U=E0[H];if(++I,B=U,U>D&&U>f)break;N<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(P(B,E0[I]))<1e-5){E0[I]>=f&&(_=E0[I]);break}if(N>=0)for(;N<I;){if(Math.abs(P(_,E0[N]))<1e-5&&E0[N]>=f){w=E0[N];break}++N}}f=R,f>u&&w<1e-5&&Math.abs(f-B)>u&&(w=f,f<=B+u&&(_=0));let V=-999999,j;if(p*(w/this._timeBarSecondsSpan)>=3)for(o=E(w);o<=A;o=S(o,w))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=E(_);o<=A;o=S(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(B/this._timeBarSecondsSpan)>=2){this._mainTicSpan=B,A+=B,o=E(B);let U=Q.computeTaiMinusUtc(y);for(;o<=A;){let q=Q.addSeconds(g,o-x,new Q);if(B>2.1){let Z=Q.computeTaiMinusUtc(q);Math.abs(Z-U)>.1&&(o+=Z-U,q=Q.addSeconds(g,o-x,new Q))}let X=Math.round(p*v(o)),te=this.makeLabel(q);this._rulerEle.innerHTML=te,j=this._rulerEle.offsetWidth,j<10&&(j=M);let K=X-(j/2-1);K>V?(V=K+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${X.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${K.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${X.toString()}px;"></span>`,o=S(o,B)}}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),L.y=0,this._trackList.forEach(function(U){U.render(r._context,L),L.y+=U.height})};il.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(c(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`)}c(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)))};il.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 uSt(e){return function(t){e._mouseMode!==od.touchOnly&&(t.button===0?(e._mouseMode=od.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=od.zoom:e._mouseMode=od.slide)),t.preventDefault()}}function fSt(e){return function(t){e._mouseMode=od.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function dSt(e){return function(t){let n;if(e._mouseMode===od.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===od.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===od.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function hSt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;j$=Math.max(Math.min(Math.abs(n),j$),1),n/=j$,e.zoomFrom(Math.pow(1.05,-n))}}function mSt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=od.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=nl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=nl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=nl.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=nl.ignore}}function pSt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===nl.singleTap?(e._touchMode=nl.scrub,e._onTouchMove(t)):e._touchMode===nl.scrub&&e._onTouchMove(t),e._mouseMode=od.touchOnly,n!==1?e._touchMode=n>0?nl.ignore:nl.none:e._touchMode===nl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _St(e){return function(t){let n,i,o,r,s,a,l=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===nl.singleTap&&(e._touchMode=nl.slideZoom),e._mouseMode=od.touchOnly,e._touchMode===nl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===nl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),c(r)&&(s>0&&e._touchState.spanX>0?(l=e._touchState.spanX/s,a=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*l)/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*l,new Q)),e._touchState.centerX=r,e._touchState.spanX=s))}}il.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 UG=il;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 l=t[a];l.match(o)[0].length>=s&&(l=l.slice(s)),i+=`${l} -`}return i}function rd(e){T.typeOf.object("scene",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(f){t._voxelPrimitive[r]=f});let l=o.getPrimitiveFunction;l===!0&&(l=function(){t[r]=t._voxelPrimitive[r]}),c(l)&&t._getPrimitiveFunctions.push(l);let u=Te.observable();return Te.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),c(a)&&c(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}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===Na.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Na.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Na.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-O.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:O.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}})}var gSt=new d,ySt=new d,bSt=new Xa,xSt=new J;function ep(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,gSt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,ySt),i=bSt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=J.fromHeadingPitchRoll(i,xSt),r=J.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(rd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(c(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!c(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=jCe(i),c(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,ep(t)}}});rd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};rd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};rd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};rd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};rd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};rd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};rd.prototype.compileShader=function(){c(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new aS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};rd.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(` -`),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+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};rd.prototype.isDestroyed=function(){return!1};rd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),de(this)};var VG=rd;function zG(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=Rn(e);let n=document.createElement("div"),i=new VG(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{createSection:s,createCheckbox:a,createRangeInput:l,createButton:u}=Vu,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),g=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(l("Screen Space Error","screenSpaceError",0,128)),f.appendChild(l("Step Size","stepSize",0,2));let m=10,y=10,b=O.PI;h.appendChild(l("Translation X","translationX",-m,+m)),h.appendChild(l("Translation Y","translationY",-m,+m)),h.appendChild(l("Translation Z","translationZ",-m,+m)),h.appendChild(l("Scale X","scaleX",0,+y)),h.appendChild(l("Scale Y","scaleY",0,+y)),h.appendChild(l("Scale Z","scaleZ",0,+y)),h.appendChild(l("Heading","angleX",-b,+b)),h.appendChild(l("Pitch","angleY",-b,+b)),h.appendChild(l("Roll","angleZ",-b,+b)),q$("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),q$("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),q$("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let x=document.createElement("div");g.appendChild(x);let A=document.createElement("textarea");A.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(A);let E=u("Compile (Ctrl+Enter)","compileShader");x.appendChild(E);let S=document.createElement("label");S.style.display="block",S.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),x.appendChild(S),Te.applyBindings(i,n)}Object.defineProperties(zG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zG.prototype.isDestroyed=function(){return!1};zG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};function q$(e,t,n,i,o,r,s,a,l,u,f,h,p,g){let m=Vu.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,l)),y.appendChild(m(i,u)),y.appendChild(m(o,f)),y.appendChild(m(r,h))}var HG=zG;var KCe=jr(XCe(),1);function CSt(e){let t=!1,n=window.screen;return c(n)&&(c(n.lockOrientation)?t=n.lockOrientation(e):c(n.mozLockOrientation)?t=n.mozLockOrientation(e):c(n.msLockOrientation)?t=n.msLockOrientation(e):c(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function $Ce(){let e=window.screen;c(e)&&(c(e.unlockOrientation)?e.unlockOrientation():c(e.mozUnlockOrientation)?e.mozUnlockOrientation():c(e.msUnlockOrientation)?e.msUnlockOrientation():c(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function ESt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&($Ce(),e._locked=!1),e._noSleep.disable(),Ir.exitFullscreen(),n(!1)):(Ir.fullscreen||Ir.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=CSt("landscape")),t.useWebVR=!0,n(!0)))}function GG(e,t){if(!c(e))throw new C("scene is required.");let n=this,i=Te.observable(Ir.enabled),o=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Ir.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Ar,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof on)}),this._locked=!1,this._noSleep=new KCe.default,this._command=wn(function(){ESt(n,e,o,r)},Te.getObservable(this,"isVREnabled")),this._vrElement=Rn(t)??document.body,this._callback=function(){!Ir.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&($Ce(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Ir.changeEventName,this._callback)}Object.defineProperties(GG.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new C("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}});GG.prototype.isDestroyed=function(){return!1};GG.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Ir.changeEventName,this._callback),de(this)};var jG=GG;var SSt="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",wSt="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 WG(e,t,n){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let i=new jG(t,n);i._exitVRPath=wSt,i._enterVRPath=SSt;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),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(WG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WG.prototype.isDestroyed=function(){return!1};WG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var qG=WG;var ZCe=new le;function eEe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function vSt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);c(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 DSt(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(c(r)&&r!=="")return r}return"Unnamed Feature"}function QCe(e,t){let n=e.scene.pick(t.position);if(c(n)){let i=n.id??n.primitive.id;if(i instanceof rr)return i;if(n instanceof ta)return new rr({name:DSt(n),description:vSt(n),feature:n})}if(c(e.scene.globe))return OSt(e,t.position)}var PSt=new Q;function $$(e,t){if(c(t)){let n=t.clock;if(c(n)&&c(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,O.EPSILON2,PSt)),e.updateFromClock(),e.zoomTo(i,o)}}}var ISt=new d;function OSt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!c(o))return;let r=new rr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!c(s)||s.length===0){e.selectedEntity=JCe();return}let a=s[0],l=new rr({id:a.name,description:a.description});if(c(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,ISt);l.position=new gl(u)}e.selectedEntity=l},function(){e.selectedEntity===r&&(e.selectedEntity=JCe())}),r}function JCe(){return new rr({id:"None",description:"No features found."})}function RSt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,l=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(c(n)&&(n.container.style.visibility=p),c(i)&&(i.container.style.visibility=p),c(o)&&(o.container.style.visibility=p),c(r)&&(r.container.style.visibility=p),c(s)&&(s.container.style.visibility=p),c(a)&&(a.container.style.visibility=p),c(l)&&(l.container.style.visibility=p),c(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),c(f)&&(f.container.style.visibility=p),c(h)&&(h.container.style.visibility=p),e._container){let g=t||!c(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function qi(e,t){if(!c(e))throw new C("container is required.");if(e=Rn(e),t=t??W.EMPTY_OBJECT,t.globe===!1&&c(t.baseLayer)&&t.baseLayer!==!1)throw new C("Cannot use baseLayer when globe is disabled.");let n=(!c(t.globe)||t.globe!==!1)&&(!c(t.baseLayerPicker)||t.baseLayerPicker!==!1);if(!n&&c(t.selectedImageryProviderViewModel))throw new C("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.baseLayer instead or set options.baseLayerPicker to true.");if(!n&&c(t.selectedTerrainProviderViewModel))throw new C("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");let 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=t.scene3DOnly??!1,l,u,f=!1;c(t.clockViewModel)?(u=t.clockViewModel,l=u.clock):(l=new mm,u=new UH(l),f=!0);let h=new Y8(r,{baseLayer:n&&c(t.selectedImageryProviderViewModel)||c(t.baseLayer)||c(t.imageryProvider)?!1:void 0,clock:l,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:c(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(l.onTick,qi.prototype._onTick,this);let m;if(!c(t.selectionIndicator)||t.selectionIndicator!==!1){let q=document.createElement("div");q.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(q),m=new RG(q,p)}let y;if(!c(t.infoBox)||t.infoBox!==!1){let q=document.createElement("div");q.className="cesium-viewer-infoBoxContainer",o.appendChild(q),y=new yG(q);let X=y.viewModel;g.add(X.cameraClicked,qi.prototype._onInfoBoxCameraClicked,this),g.add(X.closeClicked,qi.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let x;if(!c(t.geocoder)||t.geocoder!==!1){let q=document.createElement("div");q.className="cesium-viewer-geocoderContainer",b.appendChild(q);let X;typeof t.geocoder=="string"?X=[new vS({scene:p,geocodeProviderType:t.geocoder})]:c(t.geocoder)&&typeof t.geocoder!="boolean"&&(X=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),x=new hG({container:q,geocoderServices:X,scene:p}),g.add(x.viewModel.search.beforeExecute,qi.prototype._clearObjects,this)}let A;if((!c(t.homeButton)||t.homeButton!==!1)&&(A=new uG(b,p),c(x)&&g.add(A.viewModel.command.afterExecute,function(){let q=x.viewModel;q.searchText="",q.isSearchInProgress&&q.search()}),g.add(A.viewModel.command.beforeExecute,qi.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&a)throw new C("options.sceneModePicker is not available when options.scene3DOnly is set to true.");let E;!a&&(!c(t.sceneModePicker)||t.sceneModePicker!==!1)&&(E=new FG(b,p));let S;t.projectionPicker&&(S=new AG(b,p));let v,P;if(n){let q=t.imageryProviderViewModels??KH(),X=t.terrainProviderViewModels??$H();v=new XH(b,{globe:p.globe,imageryProviderViewModels:q,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:X,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),P=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(c(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),c(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),c(t.terrain)){if(c(t.terrainProvider))throw new C("Specify either options.terrainProvider or options.terrain.");n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain)}let M;if(!c(t.navigationHelpButton)||t.navigationHelpButton!==!1){let q=!0;try{if(c(window.localStorage)){let X=window.localStorage.getItem("cesium-hasSeenNavHelp");c(X)&&X?q=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new DG({container:b,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??q})}let R;if(!c(t.animation)||t.animation!==!1){let q=document.createElement("div");q.className="cesium-viewer-animationContainer",o.appendChild(q),R=new jH(q,new WH(u))}let L;if(!c(t.timeline)||t.timeline!==!1){let q=document.createElement("div");q.className="cesium-viewer-timelineContainer",o.appendChild(q),L=new UG(q,l),L.addEventListener("settime",eEe,!1),L.zoomTo(l.startTime,l.stopTime)}let B,_,w;(!c(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),B=new aG(w,t.fullscreenElement),_=Ba(B.viewModel,"isFullscreenEnabled",function(q){w.style.display=q?"block":"none",c(L)&&(L.container.style.right=`${w.clientWidth}px`,L.resize())}));let D,I,N;if(t.vrButton){let q=document.createElement("div");q.className="cesium-viewer-vrContainer",o.appendChild(q),D=new qG(q,p,t.fullScreenElement),I=Ba(D.viewModel,"isVREnabled",function(X){q.style.display=X?"block":"none",c(B)&&(q.style.right=`${w.clientWidth}px`),c(L)&&(L.container.style.right=`${q.clientWidth}px`,L.resize())}),N=Ba(D.viewModel,"isVRMode",function(X){RSt(i,X)})}this._baseLayerPickerDropDown=P,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=A,this._sceneModePicker=E,this._projectionPicker=S,this._baseLayerPicker=v,this._navigationHelpButton=M,this._animation=R,this._timeline=L,this._fullscreenButton=B,this._vrButton=D,this._geocoder=x,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=c(y)||c(m),this._selectedEntity=void 0,this._selectedEntityChanged=new pe;let k=this._cesiumWidget.dataSources,H=this._cesiumWidget.dataSourceDisplay;g.add(k.dataSourceAdded,qi.prototype._onDataSourceAdded,this),g.add(k.dataSourceRemoved,qi.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,qi.prototype.resize,this);let V=k.length;for(let q=0;q<V;q++)this._dataSourceAdded(k,k.get(q));this._dataSourceAdded(void 0,H.defaultDataSource),g.add(k.dataSourceAdded,qi.prototype._dataSourceAdded,this),g.add(k.dataSourceRemoved,qi.prototype._dataSourceRemoved,this);function j(q){let X=QCe(i,q);c(X)?Y.getValueOrUndefined(X.position,i.clock.currentTime)?i.trackedEntity=X:i.zoomTo(X):c(i.trackedEntity)&&(i.trackedEntity=void 0)}function U(q){i.selectedEntity=QCe(i,q)}h.screenSpaceEventHandler.setInputAction(U,Cn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(j,Cn.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=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(e)?c(t)&&t.animateAppear():c(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,$$(this._timeline,e))}}});qi.prototype.extend=function(e,t){if(!c(e))throw new C("mixin is required.");e(this,t)};qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=c(this._animation),r=c(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(c(a)&&(a.style.maxHeight=`${s}px`),c(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}c(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let l=this._timeline,u,f=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,b=l.container,x=b.style;p=b.clientHeight+3,x.left=`${f}px`;let A=0;c(m)&&(A+=m.container.clientWidth),c(y)&&(A+=y.container.clientWidth),x.right=`${A}px`,l.resize()}!r&&c(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 c(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),c(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),c(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),c(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),c(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),c(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),c(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),c(this._timeline)&&(this._timeline.removeEventListener("settime",eEe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),c(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),c(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),c(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),c(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(),de(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),c(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=c(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,ZCe)!==lt.FAILED?n=ZCe.center:c(o.position)&&(n=o.position.getValue(t,n)),i=c(n));let s=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(s)&&(s.position=d.clone(n,s.position),s.showSelection=r&&i,s.update());let a=c(this._infoBox)?this._infoBox.viewModel:void 0;c(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=Y.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;c(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&&$$(this.timeline,e)};qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&$$(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 tEe=qi;function MSt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new eG(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var nEe=MSt;function LSt(e){if(!c(e))throw new C("viewer is required.");let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new iG(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var iEe=LSt;function NSt(e,t){if(!c(e))throw new C("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new C("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new C("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new C("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new C("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new C("flyToOnDrop is already defined by another mixin.");t=t??W.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new pe,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,l=t.proxy;s=Rn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){if(!c(f))throw new C("value is required.");oEe(s,u),s=f,Z$(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Z$(s,u):oEe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return l},set:function(f){l=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){eT(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let m=h[g],y=new FileReader;y.onload=FSt(e,m,l,a),y.onerror=BSt(e,m),y.readAsText(m)}}Z$(s,u),e.destroy=uH(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function eT(e){e.stopPropagation(),e.preventDefault()}function oEe(e,t){let n=e;c(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",eT,!1),n.removeEventListener("dragover",eT,!1),n.removeEventListener("dragexit",eT,!1))}function Z$(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",eT,!1),e.addEventListener("dragover",eT,!1),e.addEventListener("dragexit",eT,!1)}function FSt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=G3.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=hx.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=wE.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=YU.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}c(a)&&e.dataSources.add(a).then(function(l){e.flyToOnDrop&&e.flyTo(l)}).catch(function(l){e.dropError.raiseEvent(e,s,l)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function BSt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var rEe=NSt;function kSt(e,t){if(!c(e))throw new C("viewer is required.");t=t??W.EMPTY_OBJECT;let n=new SG({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var sEe=kSt;function USt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new HG(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var aEe=USt;globalThis.CESIUM_VERSION="1.129";var Cyo="1.129";export{Ip as AlphaMode,y2 as AlphaPipelineStage,yF as AnchorPointDirect,bF as AnchorPointIndirect,jH as Animation,WH as AnimationViewModel,no as Appearance,fi as ApproximateTerrainHeights,aTe as ArcGISTiledElevationTerrainProvider,km as ArcGisBaseMapType,qy as ArcGisMapServerImageryProvider,jf as ArcGisMapService,qt as ArcType,Uc as ArticulationStageType,Et as AssociativeArray,IA as Atmosphere,ZF as AtmospherePipelineStage,Ln as AttributeCompression,nn as AttributeType,V4 as AutoExposure,N_ as AutomaticUniforms,Fo as Axis,q0 as AxisAlignedBoundingBox,OF as B3dmLoader,IF as B3dmParser,XH as BaseLayerPicker,qH as BaseLayerPickerViewModel,zT as BatchTable,fA as BatchTableHierarchy,Tl as BatchTexture,b2 as BatchTexturePipelineStage,ao as Billboard,Cf as BillboardCollection,wc as BillboardGraphics,ss as BillboardLoadState,Wg as BillboardTexture,dL as BillboardVisualizer,lTe as BingMapsGeocoderService,UV as BingMapsImageryProvider,zP as BingMapsStyle,Qa as BlendEquation,vo as BlendFunction,Po as BlendOption,un as BlendingState,Ke as BoundingRectangle,le as BoundingSphere,lt as BoundingSphereState,CA as BoundingVolumeSemantics,aAe as BoxEmitter,Za as BoxGeometry,cN as BoxGeometryUpdater,KT as BoxGraphics,Mh as BoxOutlineGeometry,Mz as BrdfLutGenerator,bt as Buffer,pA as BufferLoader,Be as BufferUsage,C2 as CPUStylingPipelineStage,lN as CallbackPositionProperty,Vh as CallbackProperty,ro as Camera,W4 as CameraEventAggregator,Vi as CameraEventType,Lz as CameraFlightPath,z as Cartesian2,d as Cartesian3,se as Cartesian4,he as Cartographic,uTe as CartographicGeocoderService,dTe as CatmullRomSpline,uA as Cesium3DContentGroup,Fd as Cesium3DTile,cg as Cesium3DTileBatchTable,nu as Cesium3DTileColorBlendMode,cAe as Cesium3DTileContent,iC as Cesium3DTileContentFactory,$o as Cesium3DTileContentState,Us as Cesium3DTileContentType,ta as Cesium3DTileFeature,tm as Cesium3DTileFeatureTable,Ld as Cesium3DTileOptimizationHint,i3 as Cesium3DTileOptimizations,Uo as Cesium3DTilePass,lh as Cesium3DTilePassState,qg as Cesium3DTilePointFeature,Yo as Cesium3DTileRefine,RS as Cesium3DTileStyle,c3 as Cesium3DTileStyleEngine,eG as Cesium3DTilesInspector,QH as Cesium3DTilesInspectorViewModel,uAe as Cesium3DTilesVoxelProvider,As as Cesium3DTileset,u3 as Cesium3DTilesetBaseTraversal,r3 as Cesium3DTilesetCache,nA as Cesium3DTilesetGraphics,a3 as Cesium3DTilesetHeatmap,_C as Cesium3DTilesetMetadata,l3 as Cesium3DTilesetMostDetailedTraversal,d3 as Cesium3DTilesetSkipTraversal,fm as Cesium3DTilesetStatistics,ca as Cesium3DTilesetTraversal,m3 as Cesium3DTilesetVisualizer,iG as CesiumInspector,tG as CesiumInspectorViewModel,AS as CesiumTerrainProvider,Y8 as CesiumWidget,T as Check,TD as CheckerboardMaterialProperty,hH as CircleEmitter,TTe as CircleGeometry,ATe as CircleOutlineGeometry,mB as ClassificationModelDrawCommand,x2 as ClassificationPipelineStage,Ew as ClassificationPrimitive,Un as ClassificationType,ti as ClearCommand,SA as ClippingPlane,xs as ClippingPlaneCollection,vv as ClippingPolygon,Zh as ClippingPolygonCollection,mm as Clock,$r as ClockRange,_o as ClockStep,UH as ClockViewModel,gAe as CloudCollection,MS as CloudType,G as Color,kc as ColorBlendMode,jt as ColorGeometryInstanceAttribute,Ut as ColorMaterialProperty,bCe as Command,$ as ComponentDatatype,mN as Composite3DTileContent,wle as CompositeEntityCollection,SD as CompositeMaterialProperty,Pa as CompositePositionProperty,Gc as CompositeProperty,c1 as CompressedTextureBuffer,cl as ComputeCommand,a1 as ComputeEngine,fH as ConditionsExpression,yAe as ConeEmitter,gl as ConstantPositionProperty,Xn as ConstantProperty,UF as ConstantSpline,WB as ContentMetadata,aL as Context,ut as ContextLimits,ck as CoplanarPolygonGeometry,Zg as CoplanarPolygonGeometryLibrary,Nd as CoplanarPolygonOutlineGeometry,ki as CornerType,xF as CorrelationGroup,SC as CorridorGeometry,Gi as CorridorGeometryLibrary,E3 as CorridorGeometryUpdater,ZT as CorridorGraphics,C3 as CorridorOutlineGeometry,At as Credit,jz as CreditDisplay,Go as CubeMap,A1 as CubeMapFace,ET as CubicRealPolynomial,Ti as CullFace,ys as CullingVolume,td as CumulusCloud,P3 as CustomDataSource,CTe as CustomHeightmapTerrainProvider,aS as CustomShader,zg as CustomShaderMode,I2 as CustomShaderPipelineStage,Eb as CustomShaderTranslucencyMode,I3 as CylinderGeometry,vC as CylinderGeometryLibrary,R3 as CylinderGeometryUpdater,QT as CylinderGraphics,O3 as CylinderOutlineGeometry,G3 as CzmlDataSource,Kr as DataSource,pm as DataSourceClock,W3 as DataSourceCollection,Mk as DataSourceDisplay,vAe as DebugAppearance,T_ as DebugCameraPrimitive,r8 as DebugInspector,gH as DebugModelMatrixPrimitive,STe as DefaultProxy,Dc as DepthFunction,Kz as DepthPlane,O2 as DequantizationPipelineStage,A_ as DerivedCommand,C as DeveloperError,Zz as DeviceOrientationCameraController,DAe as DirectionalLight,GP as DiscardEmptyTileImagePolicy,BV as DiscardMissingTileImagePolicy,Lt as DistanceDisplayCondition,kn as DistanceDisplayConditionGeometryInstanceAttribute,dS as DoubleEndedPriorityQueue,o3 as DoublyLinkedList,yg as DracoLoader,Je as DrawCommand,Ig as DynamicAtmosphereLightingType,Og as DynamicEnvironmentMapManager,UC as DynamicGeometryBatch,ii as DynamicGeometryUpdater,GO as EarthOrientationParameters,D0 as EarthOrientationParametersSample,Qr as EasingFunction,Rl as EllipseGeometry,_u as EllipseGeometryLibrary,ek as EllipseGeometryUpdater,JT as EllipseGraphics,kf as EllipseOutlineGeometry,ie as Ellipsoid,J_ as EllipsoidGeodesic,da as EllipsoidGeometry,tk as EllipsoidGeometryUpdater,eA as EllipsoidGraphics,If as EllipsoidOutlineGeometry,Sz as EllipsoidPrimitive,Ja as EllipsoidRhumbLine,PAe as EllipsoidSurfaceAppearance,is as EllipsoidTangentPlane,b_ as EllipsoidTerrainProvider,cy as EllipsoidalOccluder,cD as Empty3DTileContent,Hn as EncodedCartesian3,rr as Entity,Lf as EntityCluster,la as EntityCollection,Fk as EntityView,pe as Event,Ar as EventHelper,bd as Expression,_t as ExpressionNodeType,Il as ExtrapolationType,zt as FeatureDetection,Cb as FeatureIdPipelineStage,Qz as Fog,Oe as ForEach,xH as FrameRateMonitor,Jz as FrameState,Wr as Framebuffer,pi as FramebufferManager,W as Frozen,s4 as FrustumCommands,jE as FrustumGeometry,qz as FrustumOutlineGeometry,Ir as Fullscreen,aG as FullscreenButton,rG as FullscreenButtonViewModel,hx as GeoJsonDataSource,MF as GeoJsonLoader,Gx as GeocodeType,hG as Geocoder,BI as GeocoderService,fG as GeocoderViewModel,Oi as GeographicProjection,Ki as GeographicTilingScheme,ct as Geometry,TN as Geometry3DTileContent,ve as GeometryAttribute,hn as GeometryAttributes,PTe as GeometryFactory,St as GeometryInstance,Pc as GeometryInstanceAttribute,Zt as GeometryOffsetAttribute,Nn as GeometryPipeline,L2 as GeometryPipelineStage,ld as GeometryType,oi as GeometryUpdater,tE as GeometryUpdaterSet,Ck as GeometryVisualizer,FE as GetFeatureInfoFormat,xz as Globe,a4 as GlobeDepth,NV as GlobeSurfaceShaderSet,rh as GlobeSurfaceTile,cz as GlobeSurfaceTileProvider,lz as GlobeTranslucency,c4 as GlobeTranslucencyFramebuffer,e4 as GlobeTranslucencyState,av as GltfBufferViewLoader,cv as GltfDracoLoader,AF as GltfGpmLoader,Mv as GltfGpmLocal,lv as GltfImageLoader,uv as GltfIndexBufferLoader,dv as GltfJsonLoader,em as GltfLoader,ru as GltfLoaderUtil,wF as GltfMeshPrimitiveGpmLoader,mF as GltfStructuralMetadataLoader,_v as GltfTextureLoader,gv as GltfVertexBufferLoader,OAe as GoogleEarthEnterpriseImageryProvider,WV as GoogleEarthEnterpriseMapsProvider,m0 as GoogleEarthEnterpriseMetadata,kI as GoogleEarthEnterpriseTerrainData,kTe as GoogleEarthEnterpriseTerrainProvider,tH as GoogleEarthEnterpriseTileInformation,VTe as GoogleGeocoderService,wS as GoogleMaps,YU as GpxDataSource,op as GregorianDate,RAe as GridImageryProvider,ND as GridMaterialProperty,Gn as GroundGeometryUpdater,qT as GroundPolylineGeometry,Nh as GroundPolylinePrimitive,_l as GroundPrimitive,dD as GroupMetadata,$d as HeadingPitchRange,Xa as HeadingPitchRoll,kO as Heap,qe as HeightReference,ih as HeightmapEncoding,dc as HeightmapTerrainData,VP as HeightmapTessellator,L3 as HermitePolynomialApproximation,xb as HermiteSpline,iv as HilbertOrder,uG as HomeButton,cG as HomeButtonViewModel,xi as HorizontalOrigin,zCe as I3SBuildingSceneLayerExplorer,pG as I3SBuildingSceneLayerExplorerViewModel,Jm as I3SDataProvider,TH as I3SDecoder,AH as I3SFeature,EH as I3SField,qI as I3SGeometry,NS as I3SLayer,YI as I3SNode,PH as I3SStatistics,IH as I3SSublayer,vH as I3SSymbology,kF as I3dmLoader,NF as I3dmParser,VAe as ITwinData,ds as ITwinPlatform,Az as Iau2000Orientation,qO as Iau2006XysData,gT as Iau2006XysSample,Cz as IauOrientationAxes,Tz as IauOrientationParameters,lA as ImageBasedLighting,JF as ImageBasedLightingPipelineStage,Q0 as ImageMaterialProperty,XP as Imagery,mc as ImageryLayer,fz as ImageryLayerCollection,Bm as ImageryLayerFeatureInfo,Ul as ImageryProvider,ai as ImageryState,Av as Implicit3DTileContent,ov as ImplicitAvailabilityBitstream,rv as ImplicitMetadataView,cr as ImplicitSubdivisionScheme,TA as ImplicitSubtree,dH as ImplicitSubtreeCache,SN as ImplicitSubtreeMetadata,bC as ImplicitTileCoordinates,yC as ImplicitTileset,Fe as IndexDatatype,yG as InfoBox,_G as InfoBoxViewModel,Vu as InspectorShared,rs as InstanceAttributeSemantic,m2 as InstancingPipelineStage,zTe as InterpolationAlgorithm,Jh as InterpolationType,Wt as Intersect,Qn as IntersectionTests,d0 as Intersections2D,$a as Interval,fI as InvertClassification,Gh as Ion,_0 as IonGeocodeProviderType,vS as IonGeocoderService,Yy as IonImageryProvider,uf as IonResource,Xy as IonWorldImageryStyle,Ge as Iso8601,n4 as JobScheduler,wa as JobType,Rg as JsonMetadataTable,Q as JulianDate,l1 as KTX2Transcoder,ba as KeyboardEventModifier,go as KeyframeNode,XU as KmlCamera,wE as KmlDataSource,KU as KmlLookAt,ZU as KmlTour,JU as KmlTourFlyTo,eV as KmlTourWait,Ob as Label,Gp as LabelCollection,Bh as LabelGraphics,Ko as LabelStyle,Ek as LabelVisualizer,N3 as LagrangePolynomialApproximation,Yi as LeapSecond,HAe as Light,Up as LightingModel,F2 as LightingPipelineStage,jb as LinearApproximation,bb as LinearSpline,xl as ManagedArray,Pu as MapMode2D,jTe as MapProjection,qV as MapboxImageryProvider,jAe as MapboxStyleImageryProvider,Xi as Material,so as MaterialAppearance,k2 as MaterialPipelineStage,or as MaterialProperty,O as Math,Ri as Matrix2,J as Matrix3,F as Matrix4,vI as Megatexture,SF as MeshPrimitiveGpmLocal,Kh as MetadataClass,vp as MetadataClassProperty,Nt as MetadataComponentType,Bn as MetadataEntity,XN as MetadataEnum,qN as MetadataEnumValue,o4 as MetadataPicking,yf as MetadataPickingPipelineStage,wd as MetadataPipelineStage,pf as MetadataSchema,bv as MetadataSchemaLoader,AA as MetadataSemantic,Td as MetadataTable,vN as MetadataTableProperty,at as MetadataType,hd as MipmapHint,om as Model,bf as Model3DTileContent,nB as ModelAlphaOptions,GF as ModelAnimation,HF as ModelAnimationChannel,WF as ModelAnimationCollection,au as ModelAnimationLoop,nm as ModelAnimationState,n2 as ModelArticulation,e2 as ModelArticulationStage,r2 as ModelClippingPlanesPipelineStage,c2 as ModelClippingPolygonsPipelineStage,Ab as ModelColorPipelineStage,An as ModelComponents,_B as ModelDrawCommand,bB as ModelDrawCommands,qF as ModelFeature,YF as ModelFeatureTable,ng as ModelGraphics,dB as ModelLightingOptions,p2 as ModelMatrixUpdateStage,l2 as ModelNode,iB as ModelRenderResources,g2 as ModelRuntimeNode,eB as ModelRuntimePrimitive,TB as ModelSceneGraph,aB as ModelSilhouettePipelineStage,tB as ModelSkin,uB as ModelSplitterPipelineStage,AB as ModelStatistics,Tr as ModelType,$t as ModelUtility,wk as ModelVisualizer,Dz as Moon,V2 as MorphTargetsPipelineStage,WTe as MorphWeightSpline,Ub as MortonOrder,XB as Multiple3DTileContent,cL as MultisampleFramebuffer,DG as NavigationHelpButton,wG as NavigationHelpButtonViewModel,Bt as NearFarScalar,WAe as NeverTileDiscardPolicy,fB as NodeRenderResources,_2 as NodeStatisticsPipelineStage,tA as NodeTransformationProperty,l4 as OIT,Rz as Occluder,Ji as OffsetGeometryInstanceAttribute,qTe as OpenCageGeocoderService,T0 as OpenStreetMapImageryProvider,Y3 as OrderedGroundPrimitiveCollection,Pn as OrientedBoundingBox,on as OrthographicFrustum,jo as OrthographicOffCenterFrustum,YTe as Packable,XTe as PackableForInterpolation,$I as Particle,XAe as ParticleBurst,$Ae as ParticleEmitter,JAe as ParticleSystem,De as Pass,Cc as PassState,ig as PathGraphics,vk as PathVisualizer,rH as PeliasGeocoderService,rn as PerInstanceColorAppearance,t0 as PerformanceDisplay,SG as PerformanceWatchdog,CG as PerformanceWatchdogViewModel,wi as PerspectiveFrustum,zl as PerspectiveOffCenterFrustum,r4 as PickDepth,u4 as PickDepthFramebuffer,f4 as PickFramebuffer,N8 as PickedMetadataInfo,T4 as Picking,z2 as PickingPipelineStage,Ny as PinBuilder,Ue as PixelDatatype,ke as PixelFormat,sn as Plane,ok as PlaneGeometry,ak as PlaneGeometryUpdater,aN as PlaneGraphics,sk as PlaneOutlineGeometry,EB as PntsLoader,KA as PntsParser,q8 as PointCloud,Ng as PointCloudEyeDomeLighting,Mp as PointCloudShading,G2 as PointCloudStylingPipelineStage,iA as PointGraphics,Hs as PointPrimitive,OD as PointPrimitiveCollection,Dk as PointVisualizer,Pg as PolygonGeometry,zn as PolygonGeometryLibrary,fk as PolygonGeometryUpdater,kh as PolygonGraphics,ec as PolygonHierarchy,uk as PolygonOutlineGeometry,si as PolygonPipeline,Dd as Polyline,FD as PolylineArrowMaterialProperty,cm as PolylineCollection,os as PolylineColorAppearance,BD as PolylineDashMaterialProperty,wy as PolylineGeometry,Ik as PolylineGeometryUpdater,kD as PolylineGlowMaterialProperty,Oc as PolylineGraphics,Ea as PolylineMaterialAppearance,qb as PolylineOutlineMaterialProperty,Bi as PolylinePipeline,Rk as PolylineVisualizer,dk as PolylineVolumeGeometry,dm as PolylineVolumeGeometryLibrary,mk as PolylineVolumeGeometryUpdater,oA as PolylineVolumeGraphics,hk as PolylineVolumeOutlineGeometry,Fh as PositionProperty,uy as PositionPropertyArray,fo as PostProcessStage,z4 as PostProcessStageCollection,Ou as PostProcessStageComposite,Kf as PostProcessStageLibrary,Xf as PostProcessStageSampleMode,JE as PostProcessStageTextureCache,EF as PpeMetadata,dCe as PpeSource,CF as PpeTexture,In as Primitive,Ol as PrimitiveCollection,LA as PrimitiveLoadPlan,MA as PrimitiveOutlineGenerator,q2 as PrimitiveOutlinePipelineStage,HT as PrimitivePipeline,hB as PrimitiveRenderResources,Mr as PrimitiveState,Y2 as PrimitiveStatisticsPipelineStage,Me as PrimitiveType,AG as ProjectionPicker,xG as ProjectionPickerViewModel,Y as Property,UD as PropertyArray,OA as PropertyAttribute,fF as PropertyAttributeProperty,bl as PropertyBag,Cl as PropertyTable,Mg as PropertyTexture,uF as PropertyTextureProperty,ms as ProviderViewModel,ZTe as Proxy,ul as QuadraticRealPolynomial,dz as QuadtreeOccluders,bz as QuadtreePrimitive,mz as QuadtreeTile,_a as QuadtreeTileLoadState,eCe as QuadtreeTileProvider,TS as QuantizedMeshTerrainData,f1 as QuarticRealPolynomial,Le as Quaternion,zF as QuaternionSpline,pb as Queue,_n as Ray,ce as Rectangle,oE as RectangleCollisionChecker,ZC as RectangleGeometry,zs as RectangleGeometryLibrary,pk as RectangleGeometryUpdater,Uh as RectangleGraphics,cC as RectangleOutlineGeometry,zi as ReferenceFrame,dy as ReferenceProperty,ze as RenderState,tf as Renderbuffer,Ec as RenderbufferFormat,ir as Request,sp as RequestErrorEvent,Tc as RequestScheduler,Zn as RequestState,gs as RequestType,we as Resource,Di as ResourceCache,su as ResourceCacheKey,ZN as ResourceCacheStatistics,$i as ResourceLoader,gt as ResourceLoaderState,Vd as Rotation,ae as RuntimeError,_g as S2Cell,sa as SDFSettings,Ia as SampledPositionProperty,Ff as SampledProperty,Qt as Sampler,f_ as ScaledPositionProperty,U8 as Scene,KE as SceneFramebuffer,oe as SceneMode,X2 as SceneMode2DPipelineStage,FG as SceneModePicker,LG as SceneModePickerViewModel,Hi as SceneTransforms,j4 as SceneTransitioner,t8 as ScreenSpaceCameraController,$f as ScreenSpaceEventHandler,Cn as ScreenSpaceEventType,Sb as SelectedFeatureIdPipelineStage,RG as SelectionIndicator,IG as SelectionIndicatorViewModel,HD as SensorVolumePortionToDisplay,MT as ShaderBuilder,tL as ShaderCache,ge as ShaderDestination,fL as ShaderFunction,en as ShaderProgram,He as ShaderSource,uL as ShaderStruct,i0 as ShadowMap,S_ as ShadowMapShader,Tn as ShadowMode,sf as ShadowVolumeAppearance,xn as ShowGeometryInstanceAttribute,z0 as Simon1994PlanetaryPositions,QTe as SimplePolylineGeometry,YV as SingleTileImageryProvider,$2 as SkinningPipelineStage,V8 as SkyAtmosphere,z8 as SkyBox,O8 as SpatialNode,TF as Spdcf,Hh as SpecularEnvironmentCubeMap,tCe as SphereEmitter,JTe as SphereGeometry,Jg as SphereOutlineGeometry,F3 as Spherical,Ni as Spline,qr as SplitDirection,OI as Splitter,Wd as StaticGeometryColorBatch,Yd as StaticGeometryPerMaterialBatch,tP as StaticGroundGeometryColorBatch,Ak as StaticGroundGeometryPerMaterialBatch,Ok as StaticGroundPolylinePerMaterialBatch,nP as StaticOutlineGeometryBatch,kt as StencilConstants,Vn as StencilFunction,ft as StencilOperation,VF as SteppedSpline,Bc as Stereographic,Rp as StorageType,VD as StripeMaterialProperty,_m as StripeOrientation,oa as StructuralMetadata,im as StyleCommandsNeeded,nCe as StyleExpression,H8 as Sun,Y_ as SunLight,o8 as SunPostProcess,gF as SupportedImageFormats,kH as SvgPathBindingHandler,bi as TaskProcessor,LH as Terrain,Fm as TerrainData,Zc as TerrainEncoding,ZP as TerrainFillMesh,oh as TerrainMesh,aA as TerrainOffsetProperty,us as TerrainProvider,pa as TerrainQuantization,uo as TerrainState,Rt as Texture,LT as TextureAtlas,iL as TextureCache,ui as TextureMagnificationFilter,v8 as TextureManager,Yt as TextureMinificationFilter,hw as TexturePacker,uCe as TextureUniform,gn as TextureWrap,$m as TileAvailability,Pf as TileBoundingRegion,QB as TileBoundingS2Cell,ey as TileBoundingSphere,iCe as TileBoundingVolume,NH as TileCoordinatesImageryProvider,oCe as TileDiscardPolicy,yn as TileEdge,KP as TileImagery,_x as TileMapServiceImageryProvider,qB as TileMetadata,fu as TileOrientedBoundingBox,Io as TileProviderError,_z as TileReplacementQueue,Yn as TileSelectionResult,rCe as TileState,wB as Tileset3DTileContent,n3 as TilesetMetadata,XF as TilesetPipelineStage,eAe as TilingScheme,qn as TimeConstants,BE as TimeDynamicImagery,MI as TimeDynamicPointCloud,Sn as TimeInterval,Xr as TimeIntervalCollection,my as TimeIntervalCollectionPositionProperty,py as TimeIntervalCollectionProperty,Wn as TimeStandard,UG as Timeline,BG as TimelineHighlightRange,kG as TimelineTrack,m1 as Tipsify,Zx as ToggleButtonViewModel,r0 as Tonemapper,Q_ as TrackingReferenceFrame,Ot as Transforms,eb as TranslationRotationScale,h4 as TranslucentTileClassification,Bv as TridiagonalSystemSolver,KS as TrustedServers,nS as TweenCollection,sL as UniformState,rS as UniformType,hc as UrlTemplateImageryProvider,Cyo as VERSION,qG as VRButton,jG as VRButtonViewModel,oAe as VRTheWorldTerrainProvider,fCe as VaryingType,Cp as Vector3DTileBatch,HB as Vector3DTileClampedPolylines,jB as Vector3DTileContent,fg as Vector3DTileGeometry,BB as Vector3DTilePoints,kB as Vector3DTilePolygons,nC as Vector3DTilePolylines,hA as Vector3DTilePrimitive,k3 as VelocityOrientationProperty,_y as VelocityVectorProperty,ni as VertexArray,X_ as VertexArrayFacade,ht as VertexAttributeSemantic,Ie as VertexFormat,Rr as VerticalExaggeration,Q2 as VerticalExaggerationPipelineStage,Fn as VerticalOrigin,tAe as VideoSynchronizer,ZE as View,tEe as Viewer,sCe as ViewportQuad,Sr as Visibility,j_e as Visualizer,lS as VoxelBoxShape,s8 as VoxelCell,cS as VoxelContent,uS as VoxelCylinderShape,fS as VoxelEllipsoidShape,HG as VoxelInspector,VG as VoxelInspectorViewModel,hh as VoxelMetadataOrder,Bx as VoxelPrimitive,aCe as VoxelProvider,T8 as VoxelRenderResources,cCe as VoxelShape,Na as VoxelShapeType,M8 as VoxelTraversal,rAe as VulkanConstants,gk as WallGeometry,JC as WallGeometryLibrary,bk as WallGeometryUpdater,og as WallGraphics,yk as WallOutlineGeometry,ne as WebGLConstants,KV as WebMapServiceImageryProvider,$V as WebMapTileServiceImageryProvider,Li as WebMercatorProjection,fs as WebMercatorTilingScheme,ts as WindingOrder,Gv as WireframeIndexGenerator,J2 as WireframePipelineStage,A4 as _shadersAcesTonemappingStage,n8 as _shadersAdditiveBlend,NP as _shadersAdjustTranslucentFS,mL as _shadersAllMaterialAppearanceFS,pL as _shadersAllMaterialAppearanceVS,C4 as _shadersAmbientOcclusionGenerate,E4 as _shadersAmbientOcclusionModulate,xL as _shadersAspectRampMaterial,Qh as _shadersAtmosphereCommon,KF as _shadersAtmosphereStageFS,$F as _shadersAtmosphereStageVS,_L as _shadersBasicMaterialAppearanceFS,gL as _shadersBasicMaterialAppearanceVS,vB as _shadersBillboardCollectionFS,DB as _shadersBillboardCollectionVS,S4 as _shadersBlackAndWhite,w4 as _shadersBloomComposite,aV as _shadersBrdfLutGeneratorFS,i8 as _shadersBrightPass,v4 as _shadersBrightness,TL as _shadersBumpMapMaterial,A2 as _shadersCPUStylingStageFS,T2 as _shadersCPUStylingStageVS,AL as _shadersCheckerboardMaterial,cV as _shadersCloudCollectionFS,lV as _shadersCloudCollectionVS,uV as _shadersCloudNoiseFS,fV as _shadersCloudNoiseVS,dV as _shadersCompareAndPackTranslucentDepth,hV as _shadersCompositeOITFS,$E as _shadersCompositeTranslucentClassification,sF as _shadersComputeIrradianceFS,aF as _shadersComputeRadianceMapFS,D4 as _shadersContrastBias,cF as _shadersConvolveSpecularMapFS,lF as _shadersConvolveSpecularMapVS,S2 as _shadersCustomShaderStageFS,E2 as _shadersCustomShaderStageVS,PT as _shadersCzmBuiltins,P4 as _shadersDepthOfField,mV as _shadersDepthPlaneFS,pV as _shadersDepthPlaneVS,I4 as _shadersDepthView,lCe as _shadersDepthViewPacked,CL as _shadersDotMaterial,O4 as _shadersEdgeDetection,EL as _shadersElevationBandMaterial,SL as _shadersElevationContourMaterial,wL as _shadersElevationRampMaterial,FP as _shadersEllipsoidFS,yH as _shadersEllipsoidSurfaceAppearanceFS,bH as _shadersEllipsoidSurfaceAppearanceVS,BP as _shadersEllipsoidVS,L4 as _shadersFXAA,_V as _shadersFXAA3_11,vL as _shadersFadeMaterial,w2 as _shadersFeatureIdStageFS,v2 as _shadersFeatureIdStageVS,R4 as _shadersFilmicTonemapping,wx as _shadersGaussianBlur1D,R2 as _shadersGeometryStageFS,M2 as _shadersGeometryStageVS,gV as _shadersGlobeFS,yV as _shadersGlobeVS,DL as _shadersGridMaterial,kP as _shadersGroundAtmosphere,eM as _shadersHSBToRGB,tM as _shadersHSLToRGB,QF as _shadersImageBasedLightingStageFS,u2 as _shadersInstancingStageCommon,f2 as _shadersInstancingStageVS,h8 as _shadersIntersectBox,d8 as _shadersIntersectClippingPlanes,m8 as _shadersIntersectCylinder,f8 as _shadersIntersectDepth,p8 as _shadersIntersectEllipsoid,CI as _shadersIntersectLongitude,oS as _shadersIntersection,u8 as _shadersIntersectionUtils,d2 as _shadersLegacyInstancingStageVS,N4 as _shadersLensFlare,N2 as _shadersLightingStageFS,B2 as _shadersMaterialStageFS,x8 as _shadersMegatexture,D2 as _shadersMetadataStageFS,P2 as _shadersMetadataStageVS,o2 as _shadersModelClippingPlanesStageFS,a2 as _shadersModelClippingPolygonsStageFS,s2 as _shadersModelClippingPolygonsStageVS,i2 as _shadersModelColorStageFS,yB as _shadersModelFS,oB as _shadersModelSilhouetteStageFS,rB as _shadersModelSilhouetteStageVS,cB as _shadersModelSplitterStageFS,gB as _shadersModelVS,F4 as _shadersModifiedReinhardTonemapping,U2 as _shadersMorphTargetsStageVS,B4 as _shadersNightVision,PL as _shadersNormalMapMaterial,b8 as _shadersOctree,Iu as _shadersPassThrough,Cx as _shadersPassThroughDepth,M4 as _shadersPbrNeutralTonemapping,UL as _shadersPerInstanceColorAppearanceFS,VL as _shadersPerInstanceColorAppearanceVS,UT as _shadersPerInstanceFlatColorAppearanceFS,zL as _shadersPerInstanceFlatColorAppearanceVS,PF as _shadersPointCloudEyeDomeLighting,H2 as _shadersPointCloudStylingStageVS,Hb as _shadersPointPrimitiveCollectionFS,v3 as _shadersPointPrimitiveCollectionVS,rF as _shadersPolygonSignedDistanceFS,IL as _shadersPolylineArrowMaterial,rN as _shadersPolylineColorAppearanceVS,af as _shadersPolylineCommon,OL as _shadersPolylineDashMaterial,YT as _shadersPolylineFS,RL as _shadersPolylineGlowMaterial,sN as _shadersPolylineMaterialAppearanceVS,ML as _shadersPolylineOutlineMaterial,tN as _shadersPolylineShadowVolumeFS,nN as _shadersPolylineShadowVolumeMorphFS,iN as _shadersPolylineShadowVolumeMorphVS,oN as _shadersPolylineShadowVolumeVS,RB as _shadersPolylineVS,W2 as _shadersPrimitiveOutlineStageFS,j2 as _shadersPrimitiveOutlineStageVS,vM as _shadersRGBToHSB,DM as _shadersRGBToHSL,PM as _shadersRGBToXYZ,k4 as _shadersReinhardTonemapping,bV as _shadersReprojectWebMercatorFS,xV as _shadersReprojectWebMercatorVS,LL as _shadersRimLightingMaterial,zv as _shadersSelectedFeatureIdStageCommon,Cw as _shadersShadowVolumeAppearanceFS,WL as _shadersShadowVolumeAppearanceVS,Y0 as _shadersShadowVolumeFS,U4 as _shadersSilhouette,K2 as _shadersSkinningStageVS,UP as _shadersSkyAtmosphereCommon,TV as _shadersSkyAtmosphereFS,AV as _shadersSkyAtmosphereVS,CV as _shadersSkyBoxFS,EV as _shadersSkyBoxVS,NL as _shadersSlopeRampMaterial,FL as _shadersStripeMaterial,SV as _shadersSunFS,wV as _shadersSunTextureFS,vV as _shadersSunVS,yL as _shadersTexturedMaterialAppearanceFS,bL as _shadersTexturedMaterialAppearanceVS,zB as _shadersVector3DTileClampedPolylinesFS,VB as _shadersVector3DTileClampedPolylinesVS,UB as _shadersVector3DTilePolylinesVS,tv as _shadersVectorTileVS,Z2 as _shadersVerticalExaggerationStageVS,DV as _shadersViewportQuadFS,xT as _shadersViewportQuadVS,c8 as _shadersVoxelFS,a8 as _shadersVoxelUtils,l8 as _shadersVoxelVS,kL as _shadersWater,BL as _shadersWaterMaskMaterial,JM as _shadersXYZToRGB,yR as _shadersacesTonemapping,bR as _shadersalphaWeight,xR as _shadersantialias,TR as _shadersapplyHSBShift,AR as _shadersapproximateSphericalCoordinates,CR as _shadersapproximateTanh,ER as _shadersbackFacing,SR as _shadersbranchFreeTernary,wR as _shaderscascadeColor,vR as _shaderscascadeDistance,DR as _shaderscascadeMatrix,PR as _shaderscascadeWeights,IR as _shadersclipPolygons,OR as _shaderscolumbusViewMorph,RR as _shaderscomputeAtmosphereColor,MR as _shaderscomputeGroundAtmosphereScattering,LR as _shaderscomputePosition,NR as _shaderscomputeScattering,_8 as _shadersconvertUvToBox,g8 as _shadersconvertUvToCylinder,y8 as _shadersconvertUvToEllipsoid,FR as _shaderscosineAndSine,BR as _shadersdecompressTextureCoordinates,w1 as _shadersdegreesPerRadian,kR as _shadersdepthClamp,v1 as _shadersdepthRange,uR as _shadersdepthRangeStruct,UR as _shaderseastNorthUpToEyeCoordinates,VR as _shadersellipsoidContainsPoint,zR as _shadersellipsoidTextureCoordinates,D1 as _shadersepsilon1,P1 as _shadersepsilon2,I1 as _shadersepsilon3,O1 as _shadersepsilon4,R1 as _shadersepsilon5,M1 as _shadersepsilon6,L1 as _shadersepsilon7,HR as _shadersequalsEpsilon,GR as _shaderseyeOffset,jR as _shaderseyeToWindowCoordinates,WR as _shadersfastApproximateAtan,qR as _shadersfog,YR as _shadersgammaCorrect,XR as _shadersgeodeticSurfaceNormal,KR as _shadersgetDefaultMaterial,$R as _shadersgetDynamicAtmosphereLightDirection,ZR as _shadersgetLambertDiffuse,QR as _shadersgetSpecular,JR as _shadersgetWaterNoise,nM as _shadershue,N1 as _shadersinfinity,iM as _shadersinverseGamma,oM as _shadersisEmpty,rM as _shadersisFull,sM as _shaderslatitudeToWebMercatorFraction,cM as _shaderslineDistance,aM as _shaderslinearToSrgb,lM as _shadersluminance,fR as _shadersmaterial,dR as _shadersmaterialInput,uM as _shadersmaximumComponent,fM as _shadersmetersPerPixel,hR as _shadersmodelMaterial,dM as _shadersmodelToWindowCoordinates,mR as _shadersmodelVertexOutput,hM as _shadersmultiplyWithColorBalance,mM as _shadersnearFarScalar,pM as _shadersoctDecode,F1 as _shadersoneOverPi,B1 as _shadersoneOverTwoPi,_M as _shaderspackDepth,k1 as _shaderspassCesium3DTile,U1 as _shaderspassCesium3DTileClassification,V1 as _shaderspassCesium3DTileClassificationIgnoreShow,z1 as _shaderspassClassification,H1 as _shaderspassCompute,G1 as _shaderspassEnvironment,j1 as _shaderspassGlobe,W1 as _shaderspassOpaque,q1 as _shaderspassOverlay,Y1 as _shaderspassTerrainClassification,X1 as _shaderspassTranslucent,K1 as _shaderspassVoxels,gM as _shaderspbrLighting,yM as _shaderspbrNeutralTonemapping,bM as _shadersphong,$1 as _shaderspi,Z1 as _shaderspiOverFour,Q1 as _shaderspiOverSix,J1 as _shaderspiOverThree,eR as _shaderspiOverTwo,xM as _shadersplaneDistance,TM as _shaderspointAlongRay,tR as _shadersradiansPerDegree,pR as _shadersray,AM as _shadersrayEllipsoidIntersectionInterval,_R as _shadersraySegment,CM as _shadersraySphereIntersectionInterval,EM as _shadersreadDepth,SM as _shadersreadNonPerspective,wM as _shadersreverseLogDepth,IM as _shadersround,OM as _shaderssaturation,nR as _shaderssceneMode2D,iR as _shaderssceneMode3D,oR as _shaderssceneModeColumbusView,rR as _shaderssceneModeMorphing,RM as _shadersshadowDepthCompare,gR as _shadersshadowParameters,MM as _shadersshadowVisibility,LM as _shaderssignNotZero,sR as _shaderssolarRadius,NM as _shaderssphericalHarmonics,FM as _shaderssrgbToLinear,BM as _shaderstangentToEyeSpaceMatrix,kM as _shaderstextureCube,aR as _shadersthreePiOver2,UM as _shaderstransformPlane,VM as _shaderstranslateRelativeToEye,zM as _shaderstranslucentPhong,HM as _shaderstranspose,cR as _shaderstwoPi,GM as _shadersunpackClippingExtents,jM as _shadersunpackDepth,WM as _shadersunpackFloat,qM as _shadersunpackUint,YM as _shadersvalueTransform,XM as _shadersvertexLogDepth,lR as _shaderswebMercatorMaxLatitude,KM as _shaderswindowToEyeCoordinates,$M as _shaderswriteDepthClamp,ZM as _shaderswriteLogDepth,QM as _shaderswriteNonPerspective,kN as addBuffer,DN as addDefaults,NN as addExtensionsRequired,Ad as addExtensionsUsed,ub as addPipelineExtras,Bs as addToArray,LO as appendForwardSlash,xo as arrayRemoveDuplicates,CT as barycentricCoordinates,Mo as binarySearch,tn as buildModuleUrl,E8 as buildVoxelDrawCommands,We as clone,xt as combine,DE as computeFlyToLocationForRectangle,ZA as createBillboardPointCallback,wn as createCommand,KH as createDefaultImageryProviderViewModels,$H as createDefaultTerrainProviderViewModels,AAe as createElevationBandMaterial,EAe as createGooglePhotorealistic3DTileset,jn as createGuid,No as createMaterialPropertyDescriptor,SAe as createOsmBuildingsAsync,fe as createPropertyDescriptor,yl as createRawPropertyDescriptor,wAe as createTangentSpaceDebugPrimitive,hCe as createTaskProcessorWorker,i1 as createUniform,o1 as createUniformArray,Q8 as createWorldBathymetryAsync,Ky as createWorldImageryAsync,ES as createWorldTerrainAsync,J8 as decodeGoogleEarthEnterpriseData,GB as decodeVectorPolylinePositions,vTe as defaultValue,Yl as defer,c as defined,eL as demodernizeShader,Ns as deprecationWarning,de as destroyObject,tpe as exportKml,yA as findAccessorMinMax,oC as findContentMetadata,rC as findGroupMetadata,YB as findTileMetadata,fv as forEachTextureInMaterial,g_ as formatError,t1 as freezeRenderState,rp as getAbsoluteUri,ou as getAccessorByteStride,NO as getBaseUri,df as getBinaryAccessor,G8 as getClipAndStyleCode,jy as getClippingFunction,Tg as getComponentReader,Rn as getElement,uT as getExtensionFromUri,ly as getFilenameFromUri,S8 as getImageFromTypedArray,Ah as getImagePixels,sr as getJsonFromTypedArray,Wh as getMagic,L8 as getMetadataClassProperty,F8 as getMetadataProperty,tu as getStringFromTypedArray,Ei as getTimestamp,ri as hasExtension,rg as heightReferenceOnEntityPropertyChanged,tl as isBitSet,fT as isBlobUri,P0 as isCrossOriginUrl,k_ as isDataUri,Th as isLeapYear,Te as knockout,US as knockout_3_5_1,BH as knockout_es5,dT as loadAndExecuteScript,lL as loadCubeMap,_A as loadImageFromTypedArray,Xl as loadKTX2,Zy as mergeSort,LN as moveTechniqueRenderStates,FN as moveTechniquesToExtension,mf as numberOfComponentsForType,hT as objectToQuery,dt as oneTimeWarning,Fg as parseBatchTable,hF as parseFeatureMetadataLegacy,ON as parseGlb,BO as parseResponseHeaders,dF as parseStructuralMetadata,qv as pickModel,KTe as pointInsideTriangle,$g as preprocess3DTileContent,C8 as processVoxelProperties,Ku as queryToObject,UN as readAccessorPacked,bA as removeExtension,IN as removeExtensionsRequired,gA as removeExtensionsUsed,MN as removePipelineExtras,BN as removeUnusedElements,db as resizeImageToNextPowerOfTwo,PV as sampleTerrain,vE as sampleTerrainMostDetailed,sT as scaleToGeodeticSurface,IS as srgbToLinear,qL as subdivideArray,Ba as subscribeAndEvaluate,zN as updateAccessorComponentTypes,GN as updateVersion,br as usesExtension,nEe as viewerCesium3DTilesInspectorMixin,iEe as viewerCesiumInspectorMixin,rEe as viewerDragDropMixin,sEe as viewerPerformanceWatchdogMixin,aEe as viewerVoxelInspectorMixin,sAe as webGLConstantToGlslType,uH as wrapFunction,JA as writeTextToCanvas}; + </div>`,n.appendChild(i);let r=new mW(t);Se.track(r),Se.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var W2e=iHt;var rHt="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",oHt="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 Sae(){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?oHt:rHt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Sae.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Sae.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var pW=Sae;function gW(e){e=kn(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=t.ownerDocument,r,o,s,a,c;function u(b){!l(r)||l(b)&&b.pointerId!==r||(r=void 0,t.classList.remove("cesium-infoBox-dragging"))}function f(b){if(!(b.button!==0||b.isPrimary===!1)){r=b.pointerId,o=b.clientX,s=b.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(b.pointerId)}catch{}b.preventDefault()}}function d(b){!l(r)||b.pointerId!==r||(t.style.left=`${a+b.clientX-o}px`,t.style.top=`${c+b.clientY-s}px`,b.preventDefault())}n.addEventListener("pointerdown",f),i.addEventListener("pointermove",d),i.addEventListener("pointerup",u),i.addEventListener("pointercancel",u);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.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(p);let g=document.createElement("button");g.type="button",g.className="cesium-infoBox-close",g.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),g.innerHTML="×",t.appendChild(g);let m=document.createElement("iframe");m.className="cesium-infoBox-iframe",m.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),m.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),m.setAttribute("allowfullscreen",!0),t.appendChild(m);let y=new pW;Se.applyBindings(y,t),this._container=e,this._element=t,this._frame=m,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=f,this._handlePointerMove=d,this._stopDragging=u;let A=this;m.addEventListener("load",function(){let b=m.contentDocument,x=b.createElement("link");x.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),x.rel="stylesheet",x.type="text/css";let T=b.createElement("div");T.className="cesium-infoBox-description",b.head.appendChild(x),b.body.appendChild(T),A._descriptionSubscription=Oc(y,"description",function(E){m.style.height="5px",T.innerHTML=E;let v=null,S=T.firstElementChild;if(S!==null&&T.childNodes.length===1){let R=window.getComputedStyle(S);if(R!==null){let O=R["background-color"],L=z.fromCssColorString(O);l(L)&&L.alpha!==0&&(v=R["background-color"])}}t.style["background-color"]=v;let I=T.getBoundingClientRect().height;m.style.height=`${I}px`})}),m.setAttribute("src","about:blank")}Object.defineProperties(gW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});gW.prototype.isDestroyed=function(){return!1};gW.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),Se.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var _W=gW;function q2e(){this.showInstructions=!1;let e=this;this._command=On(function(){e.showInstructions=!e.showInstructions}),this._showClick=On(function(){e._touch=!1}),this._showTouch=On(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(q2e.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var yW=q2e;function AW(e){let t=kn(e.container),n=new yW,i=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 r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.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=Zt("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 u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Zt("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="${Zt("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="${Zt("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(d);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="${Zt("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="${Zt("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="${Zt("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="${Zt("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,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(AW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});AW.prototype.isDestroyed=function(){return!1};AW.prototype.destroy=function(){return dn.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),ue(this)};var bW=AW;function wae(e){this._scene=e.scene,this.lowFrameRateMessage=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=On(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=y7.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(wae.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});wae.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var xW=wae;function TW(e){let t=kn(e.container),n=new xW(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(TW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});TW.prototype.isDestroyed=function(){return!1};TW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var EW=TW;function CW(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Xo,this._eventHelper.add(e.morphStart,i),this._duration=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 r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=On(function(){e.morphTo2D(n._duration)}),this._morphTo3D=On(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=On(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(CW.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}}});CW.prototype.isDestroyed=function(){return!1};CW.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var vW=CW;var sHt="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",aHt="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",cHt="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 SW(e,t,n){e=kn(e);let i=new vW(t,n);i._globePath=sHt,i._flatMapPath=aHt,i._columbusViewPath=cHt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.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'),o.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 -->',r.appendChild(o);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 }'),r.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 }'),r.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 }'),r.appendChild(c),Se.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(SW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SW.prototype.isDestroyed=function(){return!1};SW.prototype.destroy=function(){return this._viewModel.destroy(),dn.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),ue(this)};var wW=SW;function IW(e){this._scene=e,this._orthographic=e.camera.frustum instanceof _n,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=On(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Xo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof _n}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(IW.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}}});IW.prototype.isDestroyed=function(){return!1};IW.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var PW=IW;var lHt="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",uHt="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 DW(e,t){e=kn(e);let n=new PW(t);n._perspectivePath=lHt,n._orthographicPath=uHt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.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'),r.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(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.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(o);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)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(DW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DW.prototype.isDestroyed=function(){return!1};DW.prototype.destroy=function(){return this._viewModel.destroy(),dn.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),ue(this)};var RW=DW;var fHt=new U,OW="-1000px";function $M(e,t,n){this._scene=e,this._screenPositionX=OW,this._screenPositionY=OW,this._tweens=e.tweens,this._container=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,r){return gr.worldToWindowCoordinates(e,i,r)}}$M.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,fHt);if(!l(e))this._screenPositionX=OW,this._screenPositionY=OW;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};$M.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ds.EXPONENTIAL_OUT})};$M.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ds.EXPONENTIAL_OUT})};Object.defineProperties($M.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var MW=$M;function NW(e,t){e=kn(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",r="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",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new MW(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(NW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NW.prototype.isDestroyed=function(){return!1};NW.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),ue(this)};var LW=NW;function Y2e(e){let t=e.split(` +`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} +`}return i}function sh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Se.observable();return Se.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=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 r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Y2e(r)}}),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 r=t._voxelPrimitive.shape;t.shapeIsBox=r===Rc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Rc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Rc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-P.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:P.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}})}var dHt=new h,hHt=new h,mHt=new kc,pHt=new $;function S0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,dHt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,hHt),i=mHt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,pHt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(sh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Y2e(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,S0(t)}}});sh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};sh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};sh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};sh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};sh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};sh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};sh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new d_({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};sh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};sh.prototype.isDestroyed=function(){return!1};sh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),ue(this)};var FW=sh;function BW(e,t){e=kn(e);let n=document.createElement("div"),i=new FW(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=Wf,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Clipping","clippingVisible","toggleClipping"),g=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=P.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Iae("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Iae("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Iae("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(E),Se.applyBindings(i,n)}Object.defineProperties(BW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BW.prototype.isDestroyed=function(){return!1};BW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Iae(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=Wf.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var kW=BW;var Z2e=js(J2e(),1);function yHt(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 Q2e(){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 AHt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(Q2e(),e._locked=!1),e._noSleep.disable(),ss.exitFullscreen(),n(!1)):(ss.fullscreen||ss.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=yHt("landscape")),t.useWebVR=!0,n(!0)))}function UW(e,t){let n=this,i=Se.observable(ss.enabled),r=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&ss.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Xo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof _n)}),this._locked=!1,this._noSleep=new Z2e.default,this._command=On(function(){AHt(n,e,r,o)},Se.getObservable(this,"isVREnabled")),this._vrElement=kn(t)??document.body,this._callback=function(){!ss.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(Q2e(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(ss.changeEventName,this._callback)}Object.defineProperties(UW.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});UW.prototype.isDestroyed=function(){return!1};UW.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(ss.changeEventName,this._callback),ue(this)};var zW=UW;var bHt="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",xHt="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 VW(e,t,n){e=kn(e);let i=new zW(t,n);i._exitVRPath=xHt,i._enterVRPath=bHt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.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(r),Se.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(VW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});VW.prototype.isDestroyed=function(){return!1};VW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var jW=VW;function cE(e,t,n){this._color=e,this._height=t,this._base=n??0}cE.prototype.getHeight=function(){return this._height};cE.prototype.getBase=function(){return this._base};cE.prototype.getStartTime=function(){return this._start};cE.prototype.getStopTime=function(){return this._stop};cE.prototype.setRange=function(e,t){this._start=e,this._stop=t};cE.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var HW=cE;function eke(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}eke.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=K.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new K);!l(a)&&K.greaterThanOrEquals(u,n)?a=s:!l(c)&&K.greaterThanOrEquals(u,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 GW=eke;var Oae=1e12,ah={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ql={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},ab=[.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],THt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function eu(e,t){e=kn(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=ah.none,this._touchMode=Ql.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=EHt(this),this._onMouseUp=CHt(this),this._onMouseMove=vHt(this),this._onMouseWheel=SHt(this),this._onTouchStart=wHt(this),this._onTouchMove=PHt(this),this._onTouchEnd=IHt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}eu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};eu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};eu.prototype.isDestroyed=function(){return!1};eu.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),ue(this)};eu.prototype.addHighlightRange=function(e,t,n){let i=new HW(e,t,n);return this._highlightRanges.push(i),this.resize(),i};eu.prototype.addTrack=function(e,t,n,i){let r=new GW(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};eu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Ps.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),s=K.secondsDifference(i,this._startJulian),a=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=K.addSeconds(this._endJulian,s,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=K.addSeconds(this._startJulian,a,new K),this._endJulian=r,this._timeBarSecondsSpan=K.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)};eu.prototype.zoomFrom=function(e){let t=K.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(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function Mae(e){return e<10?`0${e.toString()}`:e.toString()}eu.prototype.makeLabel=function(e){let t=K.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`${THt[t.month-1]} ${t.day} ${t.year} ${Mae(t.hour)}:${Mae(t.minute)}:${Mae(t.second)}${i}`};eu.prototype.smallestTicInPixels=7;eu.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=K.addSeconds(this._startJulian,a,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(k){return Math.floor(b/k)*k}function E(k,G){return Math.ceil(k/G+.5)*G}function v(k){return(k-b)/d}function S(k,G){return k-G*Math.round(k/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-a,new K));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(O)});let L=0,_=0,C=0,w=I/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let D=-1,N=-1,F=ab.length,V;for(V=0;V<F;++V){let k=ab[V];if(++D,L=k,k>w&&k>f)break;N<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=D)}if(D>0){for(;D>0;)if(--D,Math.abs(S(L,ab[D]))<1e-5){ab[D]>=f&&(_=ab[D]);break}if(N>=0)for(;N<D;){if(Math.abs(S(_,ab[N]))<1e-5&&ab[N]>=f){C=ab[N];break}++N}}f=R,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let B=-999999,j;if(p*(C/this._timeBarSecondsSpan)>=3)for(r=T(C);r<=x;r=E(r,C))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=E(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,x+=L,r=T(L);let k=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(L>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-k)>.1&&(r+=J-k,G=K.addSeconds(g,r-b,new K))}let q=Math.round(p*v(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=I);let W=q-(j/2-1);W>B?(B=W+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,r=E(r,L)}}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),O.y=0,this._trackList.forEach(function(k){k.render(o._context,O),O.y+=k.height})};eu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.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(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};eu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),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 EHt(e){return function(t){e._mouseMode!==ah.touchOnly&&(t.button===0?(e._mouseMode=ah.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=ah.zoom:e._mouseMode=ah.slide)),t.preventDefault()}}function CHt(e){return function(t){e._mouseMode=ah.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function vHt(e){return function(t){let n;if(e._mouseMode===ah.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===ah.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===ah.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function SHt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Oae=Math.max(Math.min(Math.abs(n),Oae),1),n/=Oae,e.zoomFrom(Math.pow(1.05,-n))}}function wHt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=ah.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Ql.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Ql.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Ql.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Ql.ignore}}function IHt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Ql.singleTap?(e._touchMode=Ql.scrub,e._onTouchMove(t)):e._touchMode===Ql.scrub&&e._onTouchMove(t),e._mouseMode=ah.touchOnly,n!==1?e._touchMode=n>0?Ql.ignore:Ql.none:e._touchMode===Ql.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function PHt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Ql.singleTap&&(e._touchMode=Ql.slideZoom),e._mouseMode=ah.touchOnly,e._touchMode===Ql.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Ql.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,a=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(a,K.addSeconds(a,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=s))}}eu.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 WW=eu;var tke=new le;function rke(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function DHt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function RHt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function nke(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof no)return i;if(n instanceof pa||n instanceof TS)return new no({name:RHt(n),description:DHt(n),feature:n})}return LHt(e,t.position)}var OHt=new K;function Nae(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,P.EPSILON2,OHt)),e.updateFromClock(),e.zoomTo(i,r)}}}var MHt=new h;function NHt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof es)return i}}function LHt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=NHt(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new no({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=ike();return}let c=a[0],u=new no({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,MHt);u.position=new wu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=ike())}),s}function ike(){return new no({id:"None",description:"No features found."})}function FHt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.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(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function tr(e,t){e=kn(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new up,u=new j7(c),f=!0);let d=new J9(o,{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=d.scene,g=new Xo;g.add(c.onTick,tr.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new LW(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new _W(G);let q=y.viewModel;g.add(q.cameraClicked,tr.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,tr.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let q;typeof t.geocoder=="string"?q=[new UC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new lW({container:G,geocoderServices:q,scene:p}),g.add(b.viewModel.search.beforeExecute,tr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new dW(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,tr.prototype._clearTrackedObject,this));let T;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new wW(A,p));let E;t.projectionPicker&&(E=new RW(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??tW(),q=t.terrainProviderViewModels??nW();v=new eW(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),S=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let I;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}I=new bW({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new Y7(G,new X7(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new WW(G,c),O.addEventListener("settime",rke,!1),O.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",r.appendChild(C),L=new sW(C,t.fullscreenElement),_=Oc(L.viewModel,"isFullscreenEnabled",function(G){C.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${C.clientWidth}px`,O.resize())}));let w,D,N;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),w=new jW(G,p,t.fullScreenElement),D=Oc(w.viewModel,"isVREnabled",function(q){G.style.display=q?"block":"none",l(L)&&(G.style.right=`${C.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),N=Oc(w.viewModel,"isVRMode",function(q){FHt(i,q)})}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=_,this._vrSubscription=D,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=I,this._animation=R,this._timeline=O,this._fullscreenButton=L,this._vrButton=w,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,tr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,tr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,tr.prototype.resize,this);let B=F.length;for(let G=0;G<B;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,tr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,tr.prototype._dataSourceRemoved,this);function j(G){let q=nke(i,G);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(G){i.selectedEntity=nke(i,G)}d.screenSpaceEventHandler.setInputAction(k,fn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,fn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(tr.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,Nae(this._timeline,e))}}});tr.prototype.extend=function(e,t){e(this,t)};tr.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=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 m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};tr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};tr.prototype.render=function(){this._cesiumWidget.render()};tr.prototype.isDestroyed=function(){return!1};tr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(fn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(fn.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",rke,!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(),ue(this)};tr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(tr.prototype._onEntityCollectionChanged,this)};tr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(tr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};tr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};tr.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,tke)!==Pt.FAILED?n=tke.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=o&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=o,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(a.titleText=r.name??r.id,a.description=X.getValueOrDefault(r.description,t,"")):(a.titleText="",a.description=""))};tr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};tr.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)}};tr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};tr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};tr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};tr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Nae(this.timeline,e)};tr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Nae(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,tr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};tr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};tr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};tr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};tr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};tr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var oke=tr;function BHt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof es&&(e.tileset=n.primitive),e.pickActive=!1}}function ake(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof es&&(e.tileset=i.primitive)},fn.MOUSE_MOVE):(e._eventHandler.removeInputAction(fn.MOUSE_MOVE),e.picking=e.picking)}var kHt={maximumFractionDigits:3};function JM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,kHt):Math.round(t).toLocaleString()}function ZM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[go.PICK]:e._statisticsPerPass[go.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>${JM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${JM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${JM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function cke(){let e=Bi.statistics;return` + <ul class="cesium-cesiumInspector-statistics"> + <li><strong>Geometry Memory (MB): </strong>${JM(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${JM(e.texturesByteLength)}</li> + </ul> + `}var UHt=[{text:"Highlight",value:yf.HIGHLIGHT},{text:"Replace",value:yf.REPLACE},{text:"Mix",value:yf.MIX}],ske=new z(1,1,0,.4),zHt=new z,qW=new z;function mc(e,t){let n=this,i=e.canvas;this._eventHandler=new da(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new XA({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=[],G=n._properties();for(let q in G)G.hasOwnProperty(q)&&k.push(q);return k});let r=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=yf.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(G){let q=e.pick(G.endPosition);if(q instanceof pa?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},fn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(fn.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 u=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(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 m=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(k){y(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(k){A(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let x=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(k){k=Number(k),isNaN(k)||(x(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(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(T(),1/6)},set:function(k){let G=Math.pow(k,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let E=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=BHt(this),S=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,fn.LEFT_CLICK):n._eventHandler.removeInputAction(fn.LEFT_CLICK)}});let I=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let O=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let C=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let D=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return D()},set:function(k){D(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let N=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let F=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let B=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(k){B(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(k){j(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)||ake(this,!0)}Object.defineProperties(mc.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 UHt}},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 r=0;r<n;++r){let o=t[r];this[o]=this[o]}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=ZM(e,!1),this._pickStatisticsText=ZM(e,!0),this._resourceCacheStatisticsText=cke(),ake(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,zHt):z.WHITE:t.color=qW,this._scene.requestRender()),l(e)&&(z.clone(e.color,qW),e.color=ske,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()&&!Lae(t.content)&&(t.color=qW,this._scene.requestRender()),l(e)&&!Lae(e.content)&&(z.clone(e.color,qW),e.color=ske,this._scene.requestRender()),this._tile=e}}});function Lae(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(!Lae(t[i]))return!1;return!0}return!1}mc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};mc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};mc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};mc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};mc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};mc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};mc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};mc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};mc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};mc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};mc.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 cA(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};mc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};mc.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=ZM(e,!1),this._pickStatisticsText=ZM(e,!0),this._resourceCacheStatisticsText=cke())};mc.prototype.isDestroyed=function(){return!1};mc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),ue(this)};mc.getStatistics=ZM;var YW=mc;function XW(e,t){e=kn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new YW(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),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=Wf.createSection,c=Wf.createCheckbox,u=Wf.createRangeInput,f=Wf.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(E),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),S=document.createElement("p");S.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),S.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),S.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(S),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 I=document.createElement("div");I.setAttribute("data-bind","visible: pointCloudShading"),I.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),I.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),I.appendChild(u("Base Resolution","baseResolution",0,1,.01)),I.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(I);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),I.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let D=document.createElement("div");A.appendChild(D),D.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),D.appendChild(N);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),D.className="cesium-cesiumInspector-styleEditor",D.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");D.appendChild(V);let B=document.createElement("div");B.className="cesium-cesiumInspector-error",B.setAttribute("data-bind","text: editorError"),D.appendChild(B),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(k);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(r,n)}Object.defineProperties(XW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XW.prototype.isDestroyed=function(){return!1};XW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var KW=XW;function VHt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new KW(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var lke=VHt;function jHt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new J7(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var uke=jHt;function HHt(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=kn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){fke(s,u),s=f,Fae(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Fae(s,u):fke(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){lE(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=GHt(e,m,c,a),y.onerror=WHt(e,m),y.readAsText(m)}}Fae(s,u),e.destroy=Q3(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function lE(e){e.stopPropagation(),e.preventDefault()}function fke(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",lE,!1),n.removeEventListener("dragover",lE,!1),n.removeEventListener("dragexit",lE,!1))}function Fae(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",lE,!1),e.addEventListener("dragover",lE,!1),e.addEventListener("dragexit",lE,!1)}function GHt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=pj.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=DT.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Yw.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=LH.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 WHt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var dke=HHt;function qHt(e,t){t=t??H.EMPTY_OBJECT;let n=new EW({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var hke=qHt;function YHt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new kW(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var mke=YHt;globalThis.CESIUM_VERSION="1.145.0";var s9r="1.145.0";export{q0 as AlphaMode,fV as AlphaPipelineStage,fz as AnchorPointDirect,dz as AnchorPointIndirect,Y7 as Animation,X7 as AnimationViewModel,Or as Appearance,Ni as ApproximateTerrainHeights,pde as ArcGISTiledElevationTerrainProvider,Mp as ArcGisBaseMapType,Jy as ArcGisMapServerImageryProvider,vd as ArcGisMapService,ln as ArcType,Il as ArticulationStageType,zt as AssociativeArray,jv as Atmosphere,Vz as AtmospherePipelineStage,cn as AttributeCompression,Vt as AttributeType,L5 as AutoExposure,x_ as AutomaticUniforms,Hi as Axis,od as AxisAlignedBoundingBox,XV as Azure2DImageryProvider,Cz as B3dmLoader,Ez as B3dmParser,eW as BaseLayerPicker,Z7 as BaseLayerPickerViewModel,mv as BatchTable,Fv as BatchTableHierarchy,Du as BatchTexture,dV as BatchTexturePipelineStage,Fr as Billboard,Nd as BillboardCollection,Fl as BillboardGraphics,$s as BillboardLoadState,nA as BillboardTexture,eU as BillboardVisualizer,bde as BingMapsGeocoderService,LV as BingMapsImageryProvider,S1 as BingMapsStyle,Zc as BlendEquation,to as BlendFunction,ki as BlendOption,rn as BlendingState,et as BoundingRectangle,le as BoundingSphere,Pt as BoundingSphereState,wx as BoundingVolumeSemantics,zFe as BoxEmitter,zc as BoxGeometry,VU as BoxGeometryUpdater,bv as BoxGraphics,ep as BoxOutlineGeometry,vG as BrdfLutGenerator,tt as Buffer,tC as BufferLoader,sl as BufferPoint,Cf as BufferPointCollection,Vp as BufferPointMaterial,Fo as BufferPolygon,tc as BufferPolygonCollection,Ad as BufferPolygonMaterial,Oa as BufferPolyline,Ll as BufferPolylineCollection,bd as BufferPolylineMaterial,ms as BufferPrimitive,ha as BufferPrimitiveCollection,Tu as BufferPrimitiveMaterial,Me as BufferUsage,gV as CPUStylingPipelineStage,jU as CallbackPositionProperty,vp as CallbackProperty,Nr as Camera,U5 as CameraEventAggregator,mr as CameraEventType,SG as CameraFlightPath,U as Cartesian2,h as Cartesian3,se as Cartesian4,L1 as CartesianRectangle,he as Cartographic,Cde as CartographicGeocoderService,Rde as CatmullRomSpline,Lv as Cesium3DContentGroup,Zh as Cesium3DTile,wp as Cesium3DTileBatchTable,yf as Cesium3DTileColorBlendMode,jFe as Cesium3DTileContent,CS as Cesium3DTileContentFactory,Mr as Cesium3DTileContentState,Ua as Cesium3DTileContentType,pa as Cesium3DTileFeature,Pp as Cesium3DTileFeatureTable,Jh as Cesium3DTileOptimizationHint,j8 as Cesium3DTileOptimizations,go as Cesium3DTilePass,Tm as Cesium3DTilePassState,rA as Cesium3DTilePointFeature,wo as Cesium3DTileRefine,cA as Cesium3DTileStyle,q8 as Cesium3DTileStyleEngine,TS as Cesium3DTileVectorFeature,KW as Cesium3DTilesInspector,YW as Cesium3DTilesInspectorViewModel,E2 as Cesium3DTilesTerrainData,xP as Cesium3DTilesTerrainGeometryProcessor,Bhe as Cesium3DTilesTerrainProvider,GFe as Cesium3DTilesVoxelProvider,es as Cesium3DTileset,X8 as Cesium3DTilesetBaseTraversal,H8 as Cesium3DTilesetCache,wv as Cesium3DTilesetGraphics,W8 as Cesium3DTilesetHeatmap,OS as Cesium3DTilesetMetadata,Y8 as Cesium3DTilesetMostDetailedTraversal,$8 as Cesium3DTilesetSkipTraversal,Hp as Cesium3DTilesetStatistics,sc as Cesium3DTilesetTraversal,ej as Cesium3DTilesetVisualizer,J7 as CesiumInspector,K7 as CesiumInspectorViewModel,hC as CesiumTerrainProvider,J9 as CesiumWidget,qr as Check,hR as CheckerboardMaterialProperty,s7 as CircleEmitter,fme as CircleGeometry,pme as CircleOutlineGeometry,F4 as ClassificationModelDrawCommand,hV as ClassificationPipelineStage,GD as ClassificationPrimitive,ti as ClassificationType,fi as ClearCommand,ga as ClippingPlane,Ns as ClippingPlaneCollection,m1 as ClippingPolygon,il as ClippingPolygonCollection,up as Clock,Ps as ClockRange,jr as ClockStep,j7 as ClockViewModel,JFe as CloudCollection,RM as CloudType,z as Color,Ul as ColorBlendMode,Jt as ColorGeometryInstanceAttribute,Kt as ColorMaterialProperty,C2e as Command,Y as ComponentDatatype,HU as Composite3DTileContent,zve as CompositeEntityCollection,pR as CompositeMaterialProperty,Sc as CompositePositionProperty,Hl as CompositeProperty,KN as CompressedTextureBuffer,$f as ComputeCommand,XN as ComputeEngine,x8 as ConditionsExpression,ZFe as ConeEmitter,wu as ConstantPositionProperty,Ti as ConstantProperty,hk as ConstantSpline,M8 as ContentMetadata,HE as Context,Ut as ContextLimits,c2e as Controller,NG as ControllerHost,Ak as CoplanarPolygonGeometry,J_ as CoplanarPolygonGeometryLibrary,Ph as CoplanarPolygonOutlineGeometry,ar as CornerType,hz as CorrelationGroup,SC as CorridorGeometry,pr as CorridorGeometryLibrary,ij as CorridorGeometryUpdater,Tv as CorridorGraphics,Ik as CorridorOutlineGeometry,It as Credit,FG as CreditDisplay,ls as CubeMap,lL as CubeMapFace,_I as CubeMapPanorama,LE as CubicRealPolynomial,Gi as CullFace,aa as CullingVolume,oh as CumulusCloud,aj as CustomDataSource,vpe as CustomHeightmapTerrainProvider,d_ as CustomShader,$y as CustomShaderMode,EV as CustomShaderPipelineStage,Nx as CustomShaderTranslucencyMode,Rk as CylinderGeometry,PC as CylinderGeometryLibrary,cj as CylinderGeometryUpdater,Ev as CylinderGraphics,Ok as CylinderOutlineGeometry,pj as CzmlDataSource,ks as DataSource,Gp as DataSourceClock,_j as DataSourceCollection,Hj as DataSourceDisplay,aBe as DebugAppearance,r_ as DebugCameraPrimitive,t9 as DebugInspector,f7 as DebugModelMatrixPrimitive,Ppe as DefaultProxy,xc as DepthFunction,VG as DepthPlane,CV as DequantizationPipelineStage,d0 as DerivedCommand,pe as DeveloperError,HG as DeviceOrientationCameraController,cBe as DirectionalLight,I1 as DiscardEmptyTileImagePolicy,MV as DiscardMissingTileImagePolicy,Gt as DistanceDisplayCondition,ei as DistanceDisplayConditionGeometryInstanceAttribute,j_ as DoubleEndedPriorityQueue,Lk as DoublyLinkedList,G_ as DracoLoader,at as DrawCommand,jy as DynamicAtmosphereLightingType,Hy as DynamicEnvironmentMapManager,YS as DynamicGeometryBatch,Ri as DynamicGeometryUpdater,RN as EarthOrientationParameters,mb as EarthOrientationParametersSample,Ds as EasingFunction,SV as EdgeDetectionPipelineStage,Uh as EdgeDisplayMode,JG as EdgeFramebuffer,PV as EdgeVisibilityPipelineStage,pu as EllipseGeometry,df as EllipseGeometryLibrary,bj as EllipseGeometryUpdater,Cv as EllipseGraphics,ld as EllipseOutlineGeometry,ee as Ellipsoid,ty as EllipsoidGeodesic,ec as EllipsoidGeometry,xj as EllipsoidGeometryUpdater,vv as EllipsoidGraphics,dd as EllipsoidOutlineGeometry,bG as EllipsoidPrimitive,Yc as EllipsoidRhumbLine,lBe as EllipsoidSurfaceAppearance,qs as EllipsoidTangentPlane,og as EllipsoidTerrainProvider,Km as EllipsoidalOccluder,Og as Empty3DTileContent,Sn as EncodedCartesian3,no as Entity,Vd as EntityCluster,ac as EntityCollection,qj as EntityView,uBe as EquirectangularPanorama,be as Event,Xo as EventHelper,kh as Expression,Nt as ExpressionNodeType,yu as ExtrapolationType,dn as FeatureDetection,Mx as FeatureIdPipelineStage,GG as Fog,Ue as ForEach,y7 as FrameRateMonitor,Zx as FrameState,vs as Framebuffer,ci as FramebufferManager,H as Frozen,QG as FrustumCommands,FC as FrustumGeometry,Uk as FrustumOutlineGeometry,ss as Fullscreen,sW as FullscreenButton,rW as FullscreenButtonViewModel,Yx as GaussianSplat3DTileContent,O8 as GaussianSplatPrimitive,I8 as GaussianSplatRenderResources,ES as GaussianSplatSorter,w8 as GaussianSplatTextureGenerator,DT as GeoJsonDataSource,Sz as GeoJsonLoader,_Be as GeoJsonPrimitive,Qb as GeocodeType,lW as Geocoder,sD as GeocoderService,aW as GeocoderViewModel,ji as GeographicProjection,ir as GeographicTilingScheme,wt as Geometry,$U as Geometry3DTileContent,Ne as GeometryAttribute,En as GeometryAttributes,Ype as GeometryFactory,Bt as GeometryInstance,Rl as GeometryInstanceAttribute,pn as GeometryOffsetAttribute,Wn as GeometryPipeline,OV as GeometryPipelineStage,mh as GeometryType,Oi as GeometryUpdater,ew as GeometryUpdaterSet,Pj as GeometryVisualizer,Lp as GetFeatureInfoFormat,yG as Globe,e5 as GlobeDepth,JH as GlobeSurfaceShaderSet,bm as GlobeSurfaceTile,cG as GlobeSurfaceTileProvider,lG as GlobeTranslucency,t5 as GlobeTranslucencyFramebuffer,WG as GlobeTranslucencyState,DP as GltfBufferViewLoader,RP as GltfDracoLoader,pz as GltfGpmLoader,_1 as GltfGpmLocal,MP as GltfImageLoader,NP as GltfIndexBufferLoader,FP as GltfJsonLoader,Cd as GltfLoader,uf as GltfLoaderUtil,Az as GltfMeshPrimitiveGpmLoader,$2 as GltfSpzLoader,az as GltfStructuralMetadataLoader,BP as GltfTextureLoader,kP as GltfVertexBufferLoader,YV as Google2DImageryProvider,ABe as GoogleEarthEnterpriseImageryProvider,VV as GoogleEarthEnterpriseMapsProvider,cy as GoogleEarthEnterpriseMetadata,cD as GoogleEarthEnterpriseTerrainData,i0e as GoogleEarthEnterpriseTerrainProvider,jk as GoogleEarthEnterpriseTileInformation,o0e as GoogleGeocoderService,Da as GoogleMaps,bBe as GoogleStreetViewCubeMapPanoramaProvider,LH as GpxDataSource,Fm as GregorianDate,xBe as GridImageryProvider,bR as GridMaterialProperty,oi as GroundGeometryUpdater,kC as GroundPolylineGeometry,bp as GroundPolylinePrimitive,Su as GroundPrimitive,sR as GroupMetadata,Oh as HeadingPitchRange,kc as HeadingPitchRoll,SN as Heap,We as HeightReference,Th as HeightmapEncoding,jc as HeightmapTerrainData,pP as HeightmapTessellator,$k as HermitePolynomialApproximation,Mb as HermiteSpline,uD as HilbertOrder,dW as HomeButton,uW as HomeButtonViewModel,qi as HorizontalOrigin,f2e as HybridScreenSpacePanCameraController,W2e as I3SBuildingSceneLayerExplorer,mW as I3SBuildingSceneLayerExplorerViewModel,E0 as I3SDataProvider,A7 as I3SDecoder,b7 as I3SFeature,T7 as I3SField,BM as I3SGeometry,EI as I3SLayer,kM as I3SNode,w7 as I3SStatistics,I7 as I3SSublayer,v7 as I3SSymbology,Rz as I3dmLoader,Iz as I3dmParser,PBe as ITwinData,fa as ITwinPlatform,Zk as Iau2000Orientation,LN as Iau2006XysData,IE as Iau2006XysSample,Qk as IauOrientationAxes,Jk as IauOrientationParameters,Nv as ImageBasedLighting,Hz as ImageBasedLightingPipelineStage,bx as ImageMaterialProperty,M1 as Imagery,K4 as ImageryConfiguration,F1 as ImageryCoverage,ZV as ImageryFlags,e4 as ImageryInput,Fs as ImageryLayer,NS as ImageryLayerCollection,Op as ImageryLayerFeatureInfo,t4 as ImageryPipelineStage,Sd as ImageryProvider,jn as ImageryState,h1 as Implicit3DTileContent,CP as ImplicitAvailabilityBitstream,vP as ImplicitMetadataView,Ys as ImplicitSubdivisionScheme,K_ as ImplicitSubtree,o7 as ImplicitSubtreeCache,v2 as ImplicitSubtreeMetadata,Y0 as ImplicitTileCoordinates,X0 as ImplicitTileset,je as IndexDatatype,_W as InfoBox,pW as InfoBoxViewModel,Wf as InspectorShared,Bo as InstanceAttributeSemantic,aV as InstancingPipelineStage,X0e as InterpolationAlgorithm,pp as InterpolationType,$t as Intersect,bi as IntersectionTests,np as Intersections2D,Gs as Interval,JO as InvertClassification,ff as Ion,dy as IonGeocodeProviderType,UC as IonGeocoderService,Lu as IonImageryProvider,O1 as IonImageryProviderFactory,Yo as IonResource,Q0e as IonSnapGeometryType,tge as IonSnapHeat,t3 as IonSnapMode,rge as IonSnapParentGeometryType,age as IonSnapService,Zy as IonWorldImageryStyle,nt as Iso8601,YG as JobScheduler,Gc as JobType,Gy as JsonMetadataTable,K as JulianDate,$N as KTX2Transcoder,eo as KeyboardEventModifier,Gr as KeyframeNode,FH as KmlCamera,Yw as KmlDataSource,BH as KmlLookAt,UH as KmlTour,VH as KmlTourFlyTo,jH as KmlTourWait,Hx as Label,wg as LabelCollection,Tp as LabelGraphics,Po as LabelStyle,Dj as LabelVisualizer,i3 as LagrangePolynomialApproximation,yr as LeapSecond,RBe as Light,Cg as LightingModel,i4 as LightingPipelineStage,tx as LinearApproximation,Ob as LinearSpline,kBe as MVTDataProvider,xu as ManagedArray,qu as MapMode2D,fge as MapProjection,jV as MapboxImageryProvider,MBe as MapboxStyleImageryProvider,QV as MappedPositions,lr as Material,Sr as MaterialAppearance,a4 as MaterialPipelineStage,So as MaterialProperty,P as Math,$i as Matrix2,$ as Matrix3,M as Matrix4,S9 as Megatexture,yz as MeshPrimitiveGpmLocal,sp as MetadataClass,W0 as MetadataClassProperty,Lt as MetadataComponentType,Xn as MetadataEntity,ek as MetadataEnum,Z2 as MetadataEnumValue,KG as MetadataPicking,Id as MetadataPickingPipelineStage,Vh as MetadataPipelineStage,hu as MetadataSchema,zb as MetadataSchemaLoader,wh as MetadataSemantic,vh as MetadataTable,w2 as MetadataTableProperty,bt as MetadataType,yh as MipmapHint,Dd as Model,Rd as Model3DTileContent,hS as ModelAlphaOptions,Mz as ModelAnimation,Oz as ModelAnimationChannel,Lz as ModelAnimationCollection,bf as ModelAnimationLoop,Dp as ModelAnimationState,qz as ModelArticulation,Gz as ModelArticulationStage,Kz as ModelClippingPlanesPipelineStage,Zz as ModelClippingPolygonsPipelineStage,Ox as ModelColorPipelineStage,Cn as ModelComponents,k4 as ModelDrawCommand,V4 as ModelDrawCommands,Fz as ModelFeature,Bz as ModelFeatureTable,My as ModelGraphics,$4 as ModelImagery,fS as ModelImageryMapping,N4 as ModelLightingOptions,cV as ModelMatrixUpdateStage,nV as ModelNode,dS as ModelPrimitiveImagery,Fa as ModelReader,v4 as ModelRenderResources,uV as ModelRuntimeNode,E4 as ModelRuntimePrimitive,H4 as ModelSceneGraph,P4 as ModelSilhouettePipelineStage,C4 as ModelSkin,O4 as ModelSplitterPipelineStage,G4 as ModelStatistics,Qo as ModelType,xt as ModelUtility,tV as ModelVectorLookupPipelineStage,Rj as ModelVisualizer,EG as Moon,l4 as MorphTargetsPipelineStage,dge as MorphWeightSpline,Vb as MortonOrder,hc as MouseButton,F8 as Multiple3DTileContent,ZB as MultisampleFramebuffer,bW as NavigationHelpButton,yW as NavigationHelpButtonViewModel,qt as NearFarScalar,UBe as NeverTileDiscardPolicy,M4 as NodeRenderResources,lV as NodeStatisticsPipelineStage,Sv as NodeTransformationProperty,i5 as OIT,a3 as Occluder,vr as OffsetGeometryInstanceAttribute,gge as OpenCageGeocoderService,rb as OpenStreetMapImageryProvider,Aj as OrderedGroundPrimitiveCollection,en as OrientedBoundingBox,_n as OrthographicFrustum,Ss as OrthographicOffCenterFrustum,_ge as Packable,yge as PackableForInterpolation,VBe as Panorama,jBe as PanoramaProvider,VM as Particle,WBe as ParticleBurst,YBe as ParticleEmitter,$Be as ParticleSystem,Ie as Pass,gc as PassState,Ny as PathGraphics,Ug as PathMode,Bj as PathVisualizer,e3 as PeliasGeocoderService,An as PerInstanceColorAppearance,XA as PerformanceDisplay,EW as PerformanceWatchdog,xW as PerformanceWatchdogViewModel,Zi as PerspectiveFrustum,Au as PerspectiveOffCenterFrustum,$G as PickDepth,r5 as PickDepthFramebuffer,o5 as PickFramebuffer,uL as PickId,R9 as PickedMetadataInfo,p5 as Picking,u4 as PickingPipelineStage,hy as PinBuilder,ze as PixelDatatype,$e as PixelFormat,ZG as PlanarFillIdFramebuffer,sn as Plane,f3 as PlaneGeometry,Tj as PlaneGeometryUpdater,zU as PlaneGraphics,h3 as PlaneOutlineGeometry,q4 as PntsLoader,pS as PntsParser,$9 as PointCloud,qy as PointCloudEyeDomeLighting,_g as PointCloudShading,d4 as PointCloudStylingPipelineStage,Iv as PointGraphics,za as PointPrimitive,gR as PointPrimitiveCollection,kj as PointVisualizer,cg as PolygonGeometry,Qn as PolygonGeometryLibrary,Ej as PolygonGeometryUpdater,Ep as PolygonGraphics,Xc as PolygonHierarchy,g3 as PolygonOutlineGeometry,di as PolygonPipeline,qh as Polyline,xR as PolylineArrowMaterialProperty,zp as PolylineCollection,Ks as PolylineColorAppearance,TR as PolylineDashMaterialProperty,py as PolylineGeometry,zj as PolylineGeometryUpdater,ER as PolylineGlowMaterialProperty,Bl as PolylineGraphics,Tc as PolylineMaterialAppearance,nT as PolylineOutlineMaterialProperty,cr as PolylinePipeline,jj as PolylineVisualizer,_3 as PolylineVolumeGeometry,fp as PolylineVolumeGeometryLibrary,Cj as PolylineVolumeGeometryUpdater,Pv as PolylineVolumeGraphics,y3 as PolylineVolumeOutlineGeometry,xp as PositionProperty,yA as PositionPropertyArray,zr as PostProcessStage,F5 as PostProcessStageCollection,zf as PostProcessStageComposite,eh as PostProcessStageLibrary,Qd as PostProcessStageSampleMode,sI as PostProcessStageTextureCache,_z as PpeMetadata,_2e as PpeSource,gz as PpeTexture,Nn as Primitive,Yl as PrimitiveCollection,Yv as PrimitiveLoadPlan,qv as PrimitiveOutlineGenerator,p4 as PrimitiveOutlinePipelineStage,pv as PrimitivePipeline,L4 as PrimitiveRenderResources,gs as PrimitiveState,g4 as PrimitiveStatisticsPipelineStage,Oe as PrimitiveType,RW as ProjectionPicker,PW as ProjectionPickerViewModel,X as Property,CR as PropertyArray,Gv as PropertyAttribute,rz as PropertyAttributeProperty,Pu as PropertyBag,Ou as PropertyTable,Wy as PropertyTexture,iz as PropertyTextureProperty,yo as ProviderViewModel,Vge as Proxy,au as QuadraticRealPolynomial,uG as QuadtreeOccluders,_G as QuadtreePrimitive,dG as QuadtreeTile,uc as QuadtreeTileLoadState,JBe as QuadtreeTileProvider,dC as QuantizedMeshTerrainData,QN as QuarticRealPolynomial,Le as Quaternion,A3 as QuaternionSpline,qb as Queue,gn as Ray,ie as Rectangle,$C as RectangleCollisionChecker,QC as RectangleGeometry,Ra as RectangleGeometryLibrary,vj as RectangleGeometryUpdater,Cp as RectangleGraphics,nv as RectangleOutlineGeometry,Wi as ReferenceFrame,bA as ReferenceProperty,Ge as RenderState,rd as Renderbuffer,uu as RenderbufferFormat,Oo as Request,R0 as RequestErrorEvent,El as RequestScheduler,wi as RequestState,oa as RequestType,De as Resource,Bi as ResourceCache,mu as ResourceCacheKey,nk as ResourceCacheStatistics,sr as ResourceLoader,Ct as ResourceLoaderState,tm as Rotation,oe as RuntimeError,by as S2Cell,ic as SDFSettings,wc as SampledPositionProperty,Hd as SampledProperty,Ht as Sampler,Gg as ScaledPositionProperty,L9 as Scene,nI as SceneFramebuffer,re as SceneMode,_4 as SceneMode2DPipelineStage,wW as SceneModePicker,vW as SceneModePickerViewModel,gr as SceneTransforms,k5 as SceneTransitioner,K5 as ScreenSpaceCameraController,k7 as ScreenSpaceElevatorCameraController,da as ScreenSpaceEventHandler,fn as ScreenSpaceEventType,v0 as ScreenSpaceInputBindings,U7 as ScreenSpaceMapCameraController,d2e as ScreenSpaceTiltOrbitCameraController,h2e as ScreenSpaceZoomCameraController,Lx as SelectedFeatureIdPipelineStage,LW as SelectionIndicator,MW as SelectionIndicatorViewModel,wR as SensorVolumePortionToDisplay,N_ as ShaderBuilder,qB as ShaderCache,de as ShaderDestination,t2 as ShaderFunction,Qt as ShaderProgram,Xe as ShaderSource,e2 as ShaderStruct,ZA as ShadowMap,p0 as ShadowMapShader,Dn as ShadowMode,Td as ShadowVolumeAppearance,i2 as SharedContext,Pn as ShowGeometryInstanceAttribute,wb as Simon1994PlanetaryPositions,M_e as SimplePolylineGeometry,HV as SingleTileImageryProvider,A4 as SkinningPipelineStage,k9 as SkyAtmosphere,j9 as SkyBox,$5 as SnapFramebuffer,N_e as SnapService,J5 as Snapping,w9 as SpatialNode,mz as Spdcf,Sp as SpecularEnvironmentCubeMap,ZBe as SphereEmitter,M3 as SphereGeometry,Ey as SphereOutlineGeometry,N3 as Spherical,Rr as Spline,$o as SplitDirection,vM as Splitter,sm as StaticGeometryColorBatch,cm as StaticGeometryPerMaterialBatch,MR as StaticGroundGeometryColorBatch,Ij as StaticGroundGeometryPerMaterialBatch,Vj as StaticGroundPolylinePerMaterialBatch,NR as StaticOutlineGeometryBatch,Xt as StencilConstants,ni as StencilFunction,Rt as StencilOperation,L3 as SteppedSpline,Nl as Stereographic,Px as StorageType,vR as StripeMaterialProperty,Wp as StripeOrientation,nc as StructuralMetadata,Rp as StyleCommandsNeeded,QBe as StyleExpression,q9 as Sun,O_ as SunLight,e9 as SunPostProcess,uz as SupportedImageFormats,V7 as SvgPathBindingHandler,r2 as Sync,$n as TaskProcessor,L7 as Terrain,af as TerrainData,Eo as TerrainEncoding,FO as TerrainFillMesh,Ac as TerrainMesh,Ov as TerrainOffsetProperty,m2 as TerrainPicker,Yr as TerrainProvider,$a as TerrainQuantization,Ur as TerrainState,Dt as Texture,o2 as Texture3D,WE as TextureAtlas,XB as TextureCache,Jn as TextureMagnificationFilter,r9 as TextureManager,Wt as TextureMinificationFilter,sP as TexturePacker,o9 as TextureUniform,hn as TextureWrap,Zm as TileAvailability,Ud as TileBoundingRegion,U8 as TileBoundingS2Cell,fA as TileBoundingSphere,e2e as TileBoundingVolume,F7 as TileCoordinatesImageryProvider,t2e as TileDiscardPolicy,In as TileEdge,N1 as TileImagery,Fx as TileMapServiceImageryProvider,N8 as TileMetadata,vf as TileOrientedBoundingBox,Zr as TileProviderError,mG as TileReplacementQueue,mi as TileSelectionResult,i2e as TileState,Q4 as Tileset3DTileContent,V8 as TilesetMetadata,kz as TilesetPipelineStage,L_e as TilingScheme,Un as TimeConstants,cS as TimeDynamicImagery,wM as TimeDynamicPointCloud,vn as TimeInterval,Os as TimeIntervalCollection,TA as TimeIntervalCollectionPositionProperty,EA as TimeIntervalCollectionProperty,ai as TimeStandard,WW as Timeline,HW as TimelineHighlightRange,GW as TimelineTrack,tL as Tipsify,aE as ToggleButtonViewModel,eb as Tonemapper,Cy as TrackingReferenceFrame,At as Transforms,lx as TranslationRotationScale,c5 as TranslucentTileClassification,AP as TridiagonalSystemSolver,kI as TrustedServers,cI as TweenCollection,$B as UniformState,f_ as UniformType,D7 as UrlTemplate3DTilesDataProvider,Ls as UrlTemplateImageryProvider,s9r as VERSION,jW as VRButton,zW as VRButtonViewModel,uye as VRTheWorldTerrainProvider,p2e as VaryingType,pg as Vector3DTileBatch,p8 as Vector3DTileClampedPolylines,g8 as Vector3DTileContent,zy as Vector3DTileGeometry,u8 as Vector3DTilePoints,f8 as Vector3DTilePolygons,bS as Vector3DTilePolylines,Bv as Vector3DTilePrimitive,Wx as VectorGltf3DTileContent,Ms as VectorPipeline,Iy as VectorProvider,uj as VelocityOrientationProperty,CA as VelocityVectorProperty,Vn as VertexArray,F_ as VertexArrayFacade,ct as VertexAttributeSemantic,Be as VertexFormat,br as VerticalExaggeration,x4 as VerticalExaggerationPipelineStage,qn as VerticalOrigin,aye as VideoSynchronizer,rI as View,oke as Viewer,r2e as ViewportQuad,Ko as Visibility,bOe as Visualizer,tb as VoxelBoundsCollection,hI as VoxelBoxShape,n9 as VoxelCell,dI as VoxelContent,mI as VoxelCylinderShape,pI as VoxelEllipsoidShape,kW as VoxelInspector,FW as VoxelInspectorViewModel,h_ as VoxelMetadataOrder,$T as VoxelPrimitive,o2e as VoxelProvider,T9 as VoxelRenderResources,s2e as VoxelShape,Rc as VoxelShapeType,P9 as VoxelTraversal,dye as VulkanConstants,J3 as WallGeometry,uv as WallGeometryLibrary,Sj as WallGeometryUpdater,Ly as WallGraphics,Z3 as WallOutlineGeometry,te as WebGLConstants,WV as WebMapServiceImageryProvider,qV as WebMapTileServiceImageryProvider,xi as WebMercatorProjection,No as WebMercatorTilingScheme,sa as WindingOrder,BD as WireframeIndexGenerator,T4 as WireframePipelineStage,g5 as _shadersAcesTonemappingStage,Z5 as _shadersAdditiveBlend,ZO as _shadersAdjustTranslucentFS,tU as _shadersAllMaterialAppearanceFS,nU as _shadersAllMaterialAppearanceVS,_5 as _shadersAmbientOcclusionGenerate,y5 as _shadersAmbientOcclusionModulate,aU as _shadersAspectRampMaterial,Ip as _shadersAtmosphereCommon,Uz as _shadersAtmosphereStageFS,zz as _shadersAtmosphereStageVS,iU as _shadersBasicMaterialAppearanceFS,rU as _shadersBasicMaterialAppearanceVS,e8 as _shadersBillboardCollectionFS,t8 as _shadersBillboardCollectionVS,A5 as _shadersBlackAndWhite,b5 as _shadersBloomComposite,CG as _shadersBrdfLutGeneratorFS,Q5 as _shadersBrightPass,x5 as _shadersBrightness,A8 as _shadersBufferPointMaterialFS,y8 as _shadersBufferPointMaterialVS,j3 as _shadersBufferPolygonMaterialFS,V3 as _shadersBufferPolygonMaterialVS,W3 as _shadersBufferPolylineMaterialFS,G3 as _shadersBufferPolylineMaterialVS,cU as _shadersBumpMapMaterial,pV as _shadersCPUStylingStageFS,mV as _shadersCPUStylingStageVS,lU as _shadersCheckerboardMaterial,Z9 as _shadersCloudCollectionFS,Q9 as _shadersCloudCollectionVS,e7 as _shadersCloudNoiseFS,t7 as _shadersCloudNoiseVS,a5 as _shadersCompareAndPackTranslucentDepth,n5 as _shadersCompositeOITFS,iI as _shadersCompositeTranslucentClassification,QU as _shadersComputeIrradianceFS,ez as _shadersComputeRadianceMapFS,s4 as _shadersConstantLodStageFS,o4 as _shadersConstantLodStageVS,T5 as _shadersContrastBias,tz as _shadersConvolveSpecularMapFS,nz as _shadersConvolveSpecularMapVS,V9 as _shadersCubeMapPanoramaVS,yV as _shadersCustomShaderStageFS,_V as _shadersCustomShaderStageVS,zE as _shadersCzmBuiltins,E5 as _shadersDepthOfField,kG as _shadersDepthPlaneFS,UG as _shadersDepthPlaneVS,C5 as _shadersDepthView,a2e as _shadersDepthViewPacked,uU as _shadersDotMaterial,v5 as _shadersEdgeDetection,vV as _shadersEdgeDetectionStageFS,wV as _shadersEdgeVisibilityStageFS,IV as _shadersEdgeVisibilityStageVS,fU as _shadersElevationBandMaterial,dU as _shadersElevationContourMaterial,hU as _shadersElevationRampMaterial,zO as _shadersEllipsoidFS,g7 as _shadersEllipsoidSurfaceAppearanceFS,_7 as _shadersEllipsoidSurfaceAppearanceVS,VO as _shadersEllipsoidVS,I5 as _shadersFXAA,N5 as _shadersFXAA3_11,mU as _shadersFadeMaterial,AV as _shadersFeatureIdStageFS,bV as _shadersFeatureIdStageVS,S5 as _shadersFilmicTonemapping,jT as _shadersGaussianBlur1D,DV as _shadersGeometryStageFS,RV as _shadersGeometryStageVS,KH as _shadersGlobeFS,$H as _shadersGlobeVS,pU as _shadersGridMaterial,NO as _shadersGroundAtmosphere,WF as _shadersHSBToRGB,qF as _shadersHSLToRGB,jz as _shadersImageBasedLightingStageFS,iV as _shadersInstancingStageCommon,rV as _shadersInstancingStageVS,m9 as _shadersIntersectBox,p9 as _shadersIntersectCylinder,d9 as _shadersIntersectDepth,g9 as _shadersIntersectEllipsoid,pM as _shadersIntersectLongitude,h9 as _shadersIntersectPlane,fI as _shadersIntersection,f9 as _shadersIntersectionUtils,oV as _shadersLegacyInstancingStageVS,P5 as _shadersLensFlare,n4 as _shadersLightingStageFS,r4 as _shadersMaterialStageFS,x9 as _shadersMegatexture,xV as _shadersMetadataStageFS,TV as _shadersMetadataStageVS,Xz as _shadersModelClippingPlanesStageFS,$z as _shadersModelClippingPolygonsStageFS,Jz as _shadersModelClippingPolygonsStageVS,Yz as _shadersModelColorStageFS,z4 as _shadersModelFS,S4 as _shadersModelSilhouetteStageFS,w4 as _shadersModelSilhouetteStageVS,D4 as _shadersModelSplitterStageFS,U4 as _shadersModelVS,eV as _shadersModelVectorLookupStageFS,Qz as _shadersModelVectorLookupStageVS,D5 as _shadersModifiedReinhardTonemapping,c4 as _shadersMorphTargetsStageVS,R5 as _shadersNightVision,gU as _shadersNormalMapMaterial,b9 as _shadersOctree,Uf as _shadersPassThrough,UT as _shadersPassThroughDepth,w5 as _shadersPbrNeutralTonemapping,SU as _shadersPerInstanceColorAppearanceFS,wU as _shadersPerInstanceColorAppearanceVS,dv as _shadersPerInstanceFlatColorAppearanceFS,IU as _shadersPerInstanceFlatColorAppearanceVS,Tz as _shadersPointCloudEyeDomeLighting,f4 as _shadersPointCloudStylingStageVS,eT as _shadersPointPrimitiveCollectionFS,oj as _shadersPointPrimitiveCollectionVS,_U as _shadersPolylineArrowMaterial,kU as _shadersPolylineColorAppearanceVS,Eu as _shadersPolylineCommon,yU as _shadersPolylineDashMaterial,yv as _shadersPolylineFS,AU as _shadersPolylineGlowMaterial,UU as _shadersPolylineMaterialAppearanceVS,bU as _shadersPolylineOutlineMaterial,NU as _shadersPolylineShadowVolumeFS,LU as _shadersPolylineShadowVolumeMorphFS,FU as _shadersPolylineShadowVolumeMorphVS,BU as _shadersPolylineShadowVolumeVS,a8 as _shadersPolylineVS,D8 as _shadersPrimitiveGaussianSplatFS,P8 as _shadersPrimitiveGaussianSplatVS,m4 as _shadersPrimitiveOutlineStageFS,h4 as _shadersPrimitiveOutlineStageVS,yB as _shadersRGBToHSB,AB as _shadersRGBToHSL,bB as _shadersRGBToXYZ,O5 as _shadersReinhardTonemapping,KV as _shadersReprojectWebMercatorFS,$V as _shadersReprojectWebMercatorVS,xU as _shadersRimLightingMaterial,C1 as _shadersSelectedFeatureIdStageCommon,HD as _shadersShadowVolumeAppearanceFS,PU as _shadersShadowVolumeAppearanceVS,px as _shadersShadowVolumeFS,M5 as _shadersSilhouette,y4 as _shadersSkinningStageVS,xM as _shadersSkyAtmosphereCommon,F9 as _shadersSkyAtmosphereFS,B9 as _shadersSkyAtmosphereVS,U9 as _shadersSkyBoxFS,z9 as _shadersSkyBoxVS,TU as _shadersSlopeRampMaterial,EU as _shadersStripeMaterial,H9 as _shadersSunFS,G9 as _shadersSunTextureFS,W9 as _shadersSunVS,oU as _shadersTexturedMaterialAppearanceFS,sU as _shadersTexturedMaterialAppearanceVS,m8 as _shadersVector3DTileClampedPolylinesFS,h8 as _shadersVector3DTileClampedPolylinesVS,d8 as _shadersVector3DTilePolylinesVS,Ky as _shadersVectorCommon,f1 as _shadersVectorTileVS,b4 as _shadersVerticalExaggerationStageVS,n7 as _shadersViewportQuadFS,OE as _shadersViewportQuadVS,l9 as _shadersVoxelFS,c9 as _shadersVoxelUtils,u9 as _shadersVoxelVS,vU as _shadersWater,CU as _shadersWaterMaskMaterial,GB as _shadersXYZToRGB,aF as _shadersacesTonemapping,cF as _shadersalphaWeight,lF as _shadersantialias,uF as _shadersapplyHSBShift,fF as _shadersapproximateSphericalCoordinates,dF as _shadersapproximateTanh,hF as _shadersbackFacing,mF as _shadersbranchFreeTernary,pF as _shaderscascadeColor,gF as _shaderscascadeDistance,_F as _shaderscascadeMatrix,yF as _shaderscascadeWeights,AF as _shaderscolumbusViewMorph,bF as _shaderscomputeAtmosphereColor,xF as _shaderscomputeGroundAtmosphereScattering,TF as _shaderscomputePosition,EF as _shaderscomputeScattering,CF as _shaderscomputeTextureTransform,_9 as _shadersconvertLocalToBoxUv,y9 as _shadersconvertLocalToCylinderUv,A9 as _shadersconvertLocalToEllipsoidUv,vF as _shaderscosineAndSine,SF as _shadersdecodeRGB8,wF as _shadersdecompressTextureCoordinates,fL as _shadersdegreesPerRadian,IF as _shadersdepthClamp,dL as _shadersdepthRange,QL as _shadersdepthRangeStruct,PF as _shaderseastNorthUpToEyeCoordinates,DF as _shadersellipsoidContainsPoint,RF as _shadersellipsoidTextureCoordinates,hL as _shadersepsilon1,mL as _shadersepsilon2,pL as _shadersepsilon3,gL as _shadersepsilon4,_L as _shadersepsilon5,yL as _shadersepsilon6,AL as _shadersepsilon7,OF as _shadersequalsEpsilon,MF as _shaderseyeOffset,NF as _shaderseyeToCartographicDelta,LF as _shaderseyeToWindowCoordinates,FF as _shadersfastApproximateAtan,BF as _shadersfog,kF as _shadersgammaCorrect,UF as _shadersgeodeticSurfaceNormal,zF as _shadersgetDefaultMaterial,VF as _shadersgetDynamicAtmosphereLightDirection,jF as _shadersgetLambertDiffuse,HF as _shadersgetSpecular,GF as _shadersgetWaterNoise,YF as _shadershue,bL as _shadersinfinity,XF as _shadersinverseGamma,KF as _shadersisEmpty,$F as _shadersisFull,JF as _shaderslatitudeToWebMercatorFraction,QF as _shaderslineDistance,ZF as _shaderslinearToSrgb,eB as _shadersluminance,eF as _shadersmaterial,tF as _shadersmaterialInput,tB as _shadersmaximumComponent,nB as _shadersmetersPerPixel,nF as _shadersmodelMaterial,iB as _shadersmodelToWindowCoordinates,iF as _shadersmodelVertexOutput,rB as _shadersmultiplyWithColorBalance,oB as _shadersnearFarScalar,sB as _shadersoctDecode,xL as _shadersoneOverPi,TL as _shadersoneOverTwoPi,aB as _shaderspackDepth,EL as _shaderspassCesium3DTile,CL as _shaderspassCesium3DTileClassification,vL as _shaderspassCesium3DTileClassificationIgnoreShow,SL as _shaderspassCesium3DTileEdges,wL as _shaderspassCesium3DTileEdgesDirect,IL as _shaderspassCesium3DTilePlanarFillId,PL as _shaderspassClassification,DL as _shaderspassCompute,RL as _shaderspassEnvironment,OL as _shaderspassGaussianSplats,ML as _shaderspassGlobe,NL as _shaderspassOpaque,LL as _shaderspassOverlay,FL as _shaderspassTerrainClassification,BL as _shaderspassTranslucent,kL as _shaderspassVoxels,cB as _shaderspbrLighting,lB as _shaderspbrNeutralTonemapping,uB as _shadersphong,UL as _shaderspi,zL as _shaderspiOverFour,VL as _shaderspiOverSix,jL as _shaderspiOverThree,HL as _shaderspiOverTwo,fB as _shadersplaneDistance,dB as _shaderspointAlongRay,GL as _shadersradiansPerDegree,rF as _shadersray,hB as _shadersrayEllipsoidIntersectionInterval,oF as _shadersraySegment,mB as _shadersraySphereIntersectionInterval,pB as _shadersreadDepth,gB as _shadersreadNonPerspective,_B as _shadersreverseLogDepth,xB as _shadersround,TB as _shaderssaturation,WL as _shaderssceneMode2D,qL as _shaderssceneMode3D,YL as _shaderssceneModeColumbusView,XL as _shaderssceneModeMorphing,EB as _shadersshadowDepthCompare,sF as _shadersshadowParameters,CB as _shadersshadowVisibility,vB as _shaderssignNotZero,KL as _shaderssolarRadius,SB as _shaderssphericalHarmonics,wB as _shaderssrgbToLinear,IB as _shaderstangentToEyeSpaceMatrix,PB as _shaderstextureCube,$L as _shadersthreePiOver2,DB as _shaderstransformPlane,RB as _shaderstranslateRelativeToEye,OB as _shaderstranslucentPhong,MB as _shaderstranspose,JL as _shaderstwoPi,NB as _shadersunpackDepth,LB as _shadersunpackFloat,FB as _shadersunpackTexture,BB as _shadersunpackUint,kB as _shadersvalueTransform,UB as _shadersvertexLogDepth,ZL as _shaderswebMercatorMaxLatitude,zB as _shaderswindowToEyeCoordinates,VB as _shaderswriteDepthClamp,jB as _shaderswriteLogDepth,HB as _shaderswriteNonPerspective,Zn as addAllToArray,k2 as addBuffer,P2 as addDefaults,L2 as addExtensionsRequired,Sh as addExtensionsUsed,kb as addPipelineExtras,Pa as addToArray,TN as appendForwardSlash,Lr as arrayRemoveDuplicates,uue as assert,NE as barycentricCoordinates,Pr as binarySearch,Zt as buildModuleUrl,r7 as buildVectorGltfFromMVT,mM as buildVoxelCustomShader,E9 as buildVoxelDrawCommands,Ze as clone,Mt as combine,Xw as computeFlyToLocationForRectangle,gS as createBillboardPointCallback,Pk as createColorRamp,On as createCommand,tW as createDefaultImageryProviderViewModels,nW as createDefaultTerrainProviderViewModels,nBe as createElevationBandMaterial,rBe as createGooglePhotorealistic3DTileset,Kn as createGuid,ho as createMaterialPropertyDescriptor,oBe as createOsmBuildingsAsync,me as createPropertyDescriptor,Iu as createRawPropertyDescriptor,sBe as createTangentSpaceDebugPrimitive,y2e as createTaskProcessorWorker,GN as createUniform,WN as createUniformArray,E8 as createVectorTileBuffersFromModelComponents,Dk as createWorldBathymetryAsync,Qy as createWorldImageryAsync,wC as createWorldTerrainAsync,Mk as decodeGoogleEarthEnterpriseData,p7 as decodeMVT,Nk as decodeVectorPolylinePositions,C0 as defaultPickWorldPosition,ef as defer,l as defined,WB as demodernizeShader,Xr as deprecationWarning,ue as destroyObject,M1e as exportKml,rC as findAccessorMinMax,vS as findContentMetadata,SS as findGroupMetadata,Nb as findMeshoptExtension,L8 as findTileMetadata,LP as forEachTextureInMaterial,z0 as formatError,Qce as freezeRenderState,fh as getAbsoluteUri,lf as getAccessorByteStride,EN as getBaseUri,Fh as getBinaryAccessor,Y9 as getClipAndStyleCode,Kw as getClippingFunction,q_ as getComponentReader,kn as getElement,C_ as getExtensionFromUri,ay as getFilenameFromUri,Vk as getImageFromTypedArray,Bm as getImagePixels,Lo as getJsonFromTypedArray,ip as getMagic,bz as getMeshPrimitives,D9 as getMetadataClassProperty,O9 as getMetadataProperty,cf as getStringFromTypedArray,xn as getTimestamp,or as hasExtension,Fy as heightReferenceOnEntityPropertyChanged,Ol as isBitSet,TE as isBlobUri,pb as isCrossOriginUrl,Um as isDataUri,Jf as isLeapYear,Se as knockout,wI as knockout_3_5_1,z7 as knockout_es5,EE as loadAndExecuteScript,QB as loadCubeMap,W_ as loadImageFromTypedArray,tf as loadKTX2,ag as mergeSort,Ap as mostDetailedSurfaceHeight,N2 as moveTechniqueRenderStates,F2 as moveTechniquesToExtension,ad as numberOfComponentsForType,CE as objectToQuery,yt as oneTimeWarning,Yy as parseBatchTable,sz as parseFeatureMetadataLegacy,iC as parseGlb,vN as parseResponseHeaders,oz as parseStructuralMetadata,z1 as pickModel,xge as pointInsideTriangle,Ry as positionForSurfaceHeight,lA as preprocess3DTileContent,a9 as processVoxelProperties,Zf as queryToObject,U2 as readAccessorPacked,oC as removeExtension,R2 as removeExtensionsRequired,nC as removeExtensionsUsed,M2 as removePipelineExtras,B2 as removeUnusedElements,b8 as renderBufferPointCollection,H3 as renderBufferPolygonCollection,Y3 as renderBufferPolylineCollection,Ub as resizeImageToNextPowerOfTwo,w3 as sampleTerrain,rv as sampleTerrainMostDetailed,yE as scaleToGeodeticSurface,av as srgbToLinear,F3 as subdivideArray,Oc as subscribeAndEvaluate,V2 as updateAccessorComponentTypes,H2 as updateVersion,qo as usesExtension,lke as viewerCesium3DTilesInspectorMixin,uke as viewerCesiumInspectorMixin,dke as viewerDragDropMixin,hke as viewerPerformanceWatchdogMixin,mke as viewerVoxelInspectorMixin,bye as webGLConstantToGlslType,Q3 as wrapFunction,jC as writeTextToCanvas}; //# sourceMappingURL=index.js.map diff --git a/plugins/feature/map/audio/10.wav b/plugins/feature/map/audio/10.wav new file mode 100644 index 000000000..2709b0a4a Binary files /dev/null and b/plugins/feature/map/audio/10.wav differ diff --git a/plugins/feature/map/audio/100.wav b/plugins/feature/map/audio/100.wav new file mode 100644 index 000000000..a2cff5fff Binary files /dev/null and b/plugins/feature/map/audio/100.wav differ diff --git a/plugins/feature/map/audio/1000.wav b/plugins/feature/map/audio/1000.wav new file mode 100644 index 000000000..f9562c272 Binary files /dev/null and b/plugins/feature/map/audio/1000.wav differ diff --git a/plugins/feature/map/audio/2500.wav b/plugins/feature/map/audio/2500.wav new file mode 100644 index 000000000..1c7dd2d59 Binary files /dev/null and b/plugins/feature/map/audio/2500.wav differ diff --git a/plugins/feature/map/audio/30.wav b/plugins/feature/map/audio/30.wav new file mode 100644 index 000000000..415e60d41 Binary files /dev/null and b/plugins/feature/map/audio/30.wav differ diff --git a/plugins/feature/map/audio/40.wav b/plugins/feature/map/audio/40.wav new file mode 100644 index 000000000..793d730cd Binary files /dev/null and b/plugins/feature/map/audio/40.wav differ diff --git a/plugins/feature/map/audio/5.wav b/plugins/feature/map/audio/5.wav new file mode 100644 index 000000000..4dd68af5a Binary files /dev/null and b/plugins/feature/map/audio/5.wav differ diff --git a/plugins/feature/map/audio/50.wav b/plugins/feature/map/audio/50.wav new file mode 100644 index 000000000..fb209e6c4 Binary files /dev/null and b/plugins/feature/map/audio/50.wav differ diff --git a/plugins/feature/map/audio/500.wav b/plugins/feature/map/audio/500.wav new file mode 100644 index 000000000..14ea6a9cb Binary files /dev/null and b/plugins/feature/map/audio/500.wav differ diff --git a/plugins/feature/map/audio/A320_flaps.wav b/plugins/feature/map/audio/A320_flaps.wav new file mode 100644 index 000000000..a438a23bd Binary files /dev/null and b/plugins/feature/map/audio/A320_flaps.wav differ diff --git a/plugins/feature/map/audio/A320_gear.wav b/plugins/feature/map/audio/A320_gear.wav new file mode 100644 index 000000000..bd9cdeebc Binary files /dev/null and b/plugins/feature/map/audio/A320_gear.wav differ diff --git a/plugins/feature/map/audio/ATC.wav b/plugins/feature/map/audio/ATC.wav new file mode 100644 index 000000000..08091e7ba Binary files /dev/null and b/plugins/feature/map/audio/ATC.wav differ diff --git a/plugins/feature/map/audio/clear-of-conflict.wav b/plugins/feature/map/audio/clear-of-conflict.wav new file mode 100644 index 000000000..b78969ece Binary files /dev/null and b/plugins/feature/map/audio/clear-of-conflict.wav differ diff --git a/plugins/feature/map/audio/climb.wav b/plugins/feature/map/audio/climb.wav new file mode 100644 index 000000000..248b857f1 Binary files /dev/null and b/plugins/feature/map/audio/climb.wav differ diff --git a/plugins/feature/map/audio/descend.wav b/plugins/feature/map/audio/descend.wav new file mode 100644 index 000000000..1cf5fbc3f Binary files /dev/null and b/plugins/feature/map/audio/descend.wav differ diff --git a/plugins/feature/map/audio/engine-prop.wav b/plugins/feature/map/audio/engine-prop.wav new file mode 100644 index 000000000..40e4f9567 Binary files /dev/null and b/plugins/feature/map/audio/engine-prop.wav differ diff --git a/plugins/feature/map/audio/helicopter.wav b/plugins/feature/map/audio/helicopter.wav new file mode 100644 index 000000000..f3ca30958 Binary files /dev/null and b/plugins/feature/map/audio/helicopter.wav differ diff --git a/plugins/feature/map/audio/retard.wav b/plugins/feature/map/audio/retard.wav new file mode 100644 index 000000000..0c28fb735 Binary files /dev/null and b/plugins/feature/map/audio/retard.wav differ diff --git a/plugins/feature/map/audio/traffic.wav b/plugins/feature/map/audio/traffic.wav new file mode 100644 index 000000000..3c9cda6a1 Binary files /dev/null and b/plugins/feature/map/audio/traffic.wav differ diff --git a/plugins/feature/map/audio/v1.wav b/plugins/feature/map/audio/v1.wav new file mode 100644 index 000000000..82bff3e38 Binary files /dev/null and b/plugins/feature/map/audio/v1.wav differ diff --git a/plugins/feature/map/cesium.qrc b/plugins/feature/map/cesium.qrc index 7dffe358a..5912e5c2d 100644 --- a/plugins/feature/map/cesium.qrc +++ b/plugins/feature/map/cesium.qrc @@ -212,10 +212,13 @@ <file>Cesium/ThirdParty/draco_decoder.wasm</file> <file>Cesium/ThirdParty/google-earth-dbroot-parser.js</file> <file>Cesium/ThirdParty/google-earth-dbroot-parser.js.map</file> +<file>Cesium/ThirdParty/wasm_splats_bg.wasm</file> <file>Cesium/ThirdParty/Workers/package.json</file> <file>Cesium/ThirdParty/Workers/pako_deflate.min.js</file> <file>Cesium/ThirdParty/Workers/pako_inflate.min.js</file> <file>Cesium/ThirdParty/Workers/z-worker-pako.js</file> +<file>Cesium/ThirdParty/Workers/zip-web-worker.js</file> +<file>Cesium/ThirdParty/zip-module.wasm</file> <file>Cesium/Widgets/Animation/Animation.css</file> <file>Cesium/Widgets/Animation/lighter.css</file> <file>Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css</file> @@ -231,11 +234,17 @@ <file>Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png</file> <file>Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png</file> <file>Cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png</file> +<file>Cesium/Widgets/Images/ImageryProviders/azureAerial.png</file> +<file>Cesium/Widgets/Images/ImageryProviders/azureRoads.png</file> <file>Cesium/Widgets/Images/ImageryProviders/bingAerial.png</file> <file>Cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png</file> <file>Cesium/Widgets/Images/ImageryProviders/bingRoads.png</file> <file>Cesium/Widgets/Images/ImageryProviders/blueMarble.png</file> <file>Cesium/Widgets/Images/ImageryProviders/earthAtNight.png</file> +<file>Cesium/Widgets/Images/ImageryProviders/googleContour.png</file> +<file>Cesium/Widgets/Images/ImageryProviders/googleRoadmap.png</file> +<file>Cesium/Widgets/Images/ImageryProviders/googleSatellite.png</file> +<file>Cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png</file> <file>Cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png</file> <file>Cesium/Widgets/Images/ImageryProviders/mapboxStreets.png</file> <file>Cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png</file> @@ -277,57 +286,63 @@ <file>Cesium/Widgets/VoxelInspector/VoxelInspector.css</file> <file>Cesium/Widgets/VRButton/VRButton.css</file> <file>Cesium/Widgets/widgets.css</file> -<file>Cesium/Workers/chunk-23RYXNR3.js</file> -<file>Cesium/Workers/chunk-2RJONVEL.js</file> -<file>Cesium/Workers/chunk-2V6KZTKL.js</file> -<file>Cesium/Workers/chunk-3BGP4HCL.js</file> -<file>Cesium/Workers/chunk-3PT5NNSP.js</file> -<file>Cesium/Workers/chunk-3RMLTUUP.js</file> -<file>Cesium/Workers/chunk-3RSLEP7W.js</file> -<file>Cesium/Workers/chunk-4OIYAFXA.js</file> -<file>Cesium/Workers/chunk-4W2MZV6I.js</file> -<file>Cesium/Workers/chunk-ALKSRI7Y.js</file> -<file>Cesium/Workers/chunk-ASLWXOD7.js</file> -<file>Cesium/Workers/chunk-AVPLM4UI.js</file> -<file>Cesium/Workers/chunk-BCYPTFKK.js</file> -<file>Cesium/Workers/chunk-BKYT7QHD.js</file> -<file>Cesium/Workers/chunk-EFXTPVRC.js</file> -<file>Cesium/Workers/chunk-ELJAHN3H.js</file> -<file>Cesium/Workers/chunk-FGKVHLJ4.js</file> -<file>Cesium/Workers/chunk-FUD3WFGN.js</file> -<file>Cesium/Workers/chunk-G65SAF2P.js</file> -<file>Cesium/Workers/chunk-HRZKIJQA.js</file> -<file>Cesium/Workers/chunk-IAW6QHRG.js</file> -<file>Cesium/Workers/chunk-IFR5HKVH.js</file> -<file>Cesium/Workers/chunk-ITJR6PVW.js</file> -<file>Cesium/Workers/chunk-J3L5WX3X.js</file> -<file>Cesium/Workers/chunk-JQLYZQ6V.js</file> -<file>Cesium/Workers/chunk-K6A7NKZT.js</file> -<file>Cesium/Workers/chunk-L4JCTZ6Y.js</file> -<file>Cesium/Workers/chunk-LUT6AMUC.js</file> -<file>Cesium/Workers/chunk-NEXD3R4K.js</file> -<file>Cesium/Workers/chunk-NXL34BSE.js</file> -<file>Cesium/Workers/chunk-OAGMF473.js</file> -<file>Cesium/Workers/chunk-OM62BMPV.js</file> -<file>Cesium/Workers/chunk-OVIPITBL.js</file> -<file>Cesium/Workers/chunk-PNMU44JZ.js</file> -<file>Cesium/Workers/chunk-PZWPGERZ.js</file> -<file>Cesium/Workers/chunk-Q4LSC5X3.js</file> -<file>Cesium/Workers/chunk-Q7QJJ4HI.js</file> -<file>Cesium/Workers/chunk-QFKZXFLI.js</file> -<file>Cesium/Workers/chunk-QXSX66ML.js</file> -<file>Cesium/Workers/chunk-RQKZTHAV.js</file> -<file>Cesium/Workers/chunk-S3L7VZFL.js</file> -<file>Cesium/Workers/chunk-S5KJ4JQS.js</file> -<file>Cesium/Workers/chunk-SP23RJSN.js</file> -<file>Cesium/Workers/chunk-U3N6LNE4.js</file> -<file>Cesium/Workers/chunk-UVR3GLLW.js</file> -<file>Cesium/Workers/chunk-WER4LUMF.js</file> -<file>Cesium/Workers/chunk-X6N776GR.js</file> -<file>Cesium/Workers/chunk-XOTNFHCP.js</file> -<file>Cesium/Workers/chunk-YRCAQUFT.js</file> -<file>Cesium/Workers/chunk-ZQVZZSUG.js</file> -<file>Cesium/Workers/chunk-ZYYZDBKK.js</file> +<file>Cesium/Workers/chunk-23IOGON7.js</file> +<file>Cesium/Workers/chunk-3AERAMWF.js</file> +<file>Cesium/Workers/chunk-4U57P2C5.js</file> +<file>Cesium/Workers/chunk-76NBDD5E.js</file> +<file>Cesium/Workers/chunk-7IFFXLK3.js</file> +<file>Cesium/Workers/chunk-7RNSURKI.js</file> +<file>Cesium/Workers/chunk-ARDVIBNJ.js</file> +<file>Cesium/Workers/chunk-AZINMULF.js</file> +<file>Cesium/Workers/chunk-B2EMOZB6.js</file> +<file>Cesium/Workers/chunk-B5FT3Q23.js</file> +<file>Cesium/Workers/chunk-C5UTI7P4.js</file> +<file>Cesium/Workers/chunk-CB2GA3G5.js</file> +<file>Cesium/Workers/chunk-CYYYI5LY.js</file> +<file>Cesium/Workers/chunk-D3YAYYEG.js</file> +<file>Cesium/Workers/chunk-DV5LK4D5.js</file> +<file>Cesium/Workers/chunk-EL5WNS34.js</file> +<file>Cesium/Workers/chunk-FZSSAWMQ.js</file> +<file>Cesium/Workers/chunk-G2DFB5K6.js</file> +<file>Cesium/Workers/chunk-GH3KEUYL.js</file> +<file>Cesium/Workers/chunk-GNBKSQYP.js</file> +<file>Cesium/Workers/chunk-H7SJWKIY.js</file> +<file>Cesium/Workers/chunk-HLXNFZAZ.js</file> +<file>Cesium/Workers/chunk-ILBQ77ZM.js</file> +<file>Cesium/Workers/chunk-J6775DYR.js</file> +<file>Cesium/Workers/chunk-JJVL7F22.js</file> +<file>Cesium/Workers/chunk-JMWI6IHX.js</file> +<file>Cesium/Workers/chunk-KP72RGCH.js</file> +<file>Cesium/Workers/chunk-LHXP7CH5.js</file> +<file>Cesium/Workers/chunk-LXGG3JDP.js</file> +<file>Cesium/Workers/chunk-LZC73BOP.js</file> +<file>Cesium/Workers/chunk-MQTDGHHT.js</file> +<file>Cesium/Workers/chunk-MZG3W7S4.js</file> +<file>Cesium/Workers/chunk-NCJU5VAQ.js</file> +<file>Cesium/Workers/chunk-OSVSBQDY.js</file> +<file>Cesium/Workers/chunk-OU2IPMYE.js</file> +<file>Cesium/Workers/chunk-PICDM7L2.js</file> +<file>Cesium/Workers/chunk-PPEMEUUU.js</file> +<file>Cesium/Workers/chunk-PUJTKPNP.js</file> +<file>Cesium/Workers/chunk-QCE33JV5.js</file> +<file>Cesium/Workers/chunk-QQWQKL3T.js</file> +<file>Cesium/Workers/chunk-RDRVGSTZ.js</file> +<file>Cesium/Workers/chunk-RWR4JTSS.js</file> +<file>Cesium/Workers/chunk-SIBAZPZR.js</file> +<file>Cesium/Workers/chunk-SIFLADX4.js</file> +<file>Cesium/Workers/chunk-THB3EPLO.js</file> +<file>Cesium/Workers/chunk-UI4K6XI3.js</file> +<file>Cesium/Workers/chunk-V23IN42C.js</file> +<file>Cesium/Workers/chunk-WCOEOHX5.js</file> +<file>Cesium/Workers/chunk-WVRWFNLS.js</file> +<file>Cesium/Workers/chunk-XAERMS6D.js</file> +<file>Cesium/Workers/chunk-XSEHEM5B.js</file> +<file>Cesium/Workers/chunk-XUWPEWB7.js</file> +<file>Cesium/Workers/chunk-YAU2WIVW.js</file> +<file>Cesium/Workers/chunk-YZ5ZCI55.js</file> +<file>Cesium/Workers/chunk-ZJRS2FK6.js</file> +<file>Cesium/Workers/chunk-ZNBU4MZZ.js</file> +<file>Cesium/Workers/chunk-ZV4OMVCY.js</file> <file>Cesium/Workers/combineGeometry.js</file> <file>Cesium/Workers/createBoxGeometry.js</file> <file>Cesium/Workers/createBoxOutlineGeometry.js</file> @@ -365,6 +380,7 @@ <file>Cesium/Workers/createVectorTilePoints.js</file> <file>Cesium/Workers/createVectorTilePolygons.js</file> <file>Cesium/Workers/createVectorTilePolylines.js</file> +<file>Cesium/Workers/createVerticesFromCesium3DTilesTerrain.js</file> <file>Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js</file> <file>Cesium/Workers/createVerticesFromHeightmap.js</file> <file>Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js</file> @@ -373,8 +389,12 @@ <file>Cesium/Workers/decodeDraco.js</file> <file>Cesium/Workers/decodeGoogleEarthEnterprisePacket.js</file> <file>Cesium/Workers/decodeI3S.js</file> +<file>Cesium/Workers/gaussianSplatSorter.js</file> +<file>Cesium/Workers/gaussianSplatTextureGenerator.js</file> +<file>Cesium/Workers/incrementallyBuildTerrainPicker.js</file> <file>Cesium/Workers/transcodeKTX2.js</file> <file>Cesium/Workers/transferTypedArrayTest.js</file> <file>Cesium/Workers/upsampleQuantizedTerrainMesh.js</file> +<file>Cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js</file> </qresource> </RCC> diff --git a/plugins/feature/map/cesiuminterface.cpp b/plugins/feature/map/cesiuminterface.cpp index 84857c1d0..1e2ebc588 100644 --- a/plugins/feature/map/cesiuminterface.cpp +++ b/plugins/feature/map/cesiuminterface.cpp @@ -1,363 +1,557 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022-2023 Jon Beniston, M7RCE <jon@beniston.com> // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#include <QJsonObject> - -#include "cesiuminterface.h" - -CesiumInterface::CesiumInterface(const MapSettings *settings, QObject *parent) : - MapWebSocketServer(parent), - m_czml(settings) -{ -} - -// Set the view displayed when the Home button is pressed -// Angle in degrees of longitude or latitude either side of central location -void CesiumInterface::setHomeView(float latitude, float longitude, float angle) -{ - QJsonObject obj { - {"command", "setHomeView"}, - {"latitude", latitude}, - {"longitude", longitude}, - {"angle", angle} - }; - send(obj); -} - -// Set the current camera view to a given location -void CesiumInterface::setView(float latitude, float longitude, float altitude) -{ - QJsonObject obj { - {"command", "setView"}, - {"latitude", latitude}, - {"longitude", longitude}, - {"altitude", altitude} - }; - send(obj); -} - -void CesiumInterface::setViewFirstPerson(bool firstPerson) -{ - QJsonObject obj { - {"command", "setViewFirstPerson"}, - {"firstPerson", firstPerson} - }; - send(obj); -} - -// Play glTF model animation for the map item with the specified name -void CesiumInterface::playAnimation(const QString &name, Animation *animation) -{ - QJsonObject obj { - {"command", "playAnimation"}, - {"id", name}, - {"animation", animation->m_name}, - {"startDateTime", animation->m_startDateTime}, - {"reverse", animation->m_reverse}, - {"loop", animation->m_loop}, - {"stop", animation->m_stop}, - {"startOffset", animation->m_startOffset}, - {"duration", animation->m_duration}, - {"multiplier", animation->m_multiplier} - }; - send(obj); -} - -// Set date and time for the map -void CesiumInterface::setDateTime(QDateTime dateTime) -{ - QJsonObject obj { - {"command", "setDateTime"}, - {"dateTime", dateTime.toString(Qt::ISODate)} - }; - send(obj); -} - -// Get current date and time from the map -void CesiumInterface::getDateTime() -{ - QJsonObject obj { - {"command", "getDateTime"} - }; - send(obj); -} - -// Set the camera to track the map item with the specified name -void CesiumInterface::track(const QString& name) -{ - QJsonObject obj { - {"command", "trackId"}, - {"id", name} - }; - send(obj); -} - -void CesiumInterface::setDefaultImagery(const QString &imagery) -{ - QJsonObject obj { - {"command", "setDefaultImagery"}, - {"imagery", imagery} - }; - send(obj); -} - -void CesiumInterface::setTerrain(const QString &terrain, const QString &maptilerAPIKey, bool lighting, bool water) -{ - QString provider; - QString url; - if (terrain == "Maptiler") - { - provider = "CesiumTerrainProvider"; - url = "https://api.maptiler.com/tiles/terrain-quantized-mesh/?key=" + maptilerAPIKey; - } - else if (terrain == "ArcGIS") - { - provider = "ArcGISTiledElevationTerrainProvider"; - url = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"; - } - else - { - provider = terrain; - } - QJsonObject obj { - {"command", "setTerrain"}, - {"provider", provider}, - {"url", url}, - {"lighting", lighting}, - {"water", water} - }; - send(obj); -} - -void CesiumInterface::setBuildings(const QString &buildings) -{ - QJsonObject obj { - {"command", "setBuildings"}, - {"buildings", buildings} - }; - send(obj); -} - -void CesiumInterface::setLighting(bool useSunLight, float cameraLightIntensity) -{ - QJsonObject obj { - {"command", "setLighting"}, - {"useSunLight", useSunLight}, - {"cameraLightIntensity", cameraLightIntensity} - }; - send(obj); -} - -void CesiumInterface::setCameraReferenceFrame(bool eci) -{ - QJsonObject obj { - {"command", "setCameraReferenceFrame"}, - {"eci", eci} - }; - send(obj); -} - -void CesiumInterface::setAntiAliasing(bool fxaa, int msaa) -{ - QJsonObject obj { - {"command", "setAntiAliasing"}, - {"fxaa", fxaa}, - {"msaa", msaa} - }; - send(obj); -} - -void CesiumInterface::setHDR(bool enabled) -{ - QJsonObject obj { - {"command", "setHDR"}, - {"hdr", enabled} - }; - send(obj); -} - -void CesiumInterface::setFog(bool enabled) -{ - QJsonObject obj { - {"command", "setFog"}, - {"fog", enabled} - }; - send(obj); -} - -void CesiumInterface::showFPS(bool show) -{ - QJsonObject obj { - {"command", "showFPS"}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::showPFD(bool show) -{ - QJsonObject obj { - {"command", "showPFD"}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::showMUF(bool show) -{ - QJsonObject obj { - {"command", "showMUF"}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::showfoF2(bool show) -{ - QJsonObject obj { - {"command", "showfoF2"}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::showMagDec(bool show) -{ - QJsonObject obj { - {"command", "showMagneticDeclination"}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::showMaidenheadGrid(bool show) -{ - QJsonObject obj { - {"command", "showMaidenheadGrid"}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::showLayer(const QString& layer, bool show) -{ - QJsonObject obj { - {"command", "showLayer"}, - {"layer", layer}, - {"show", show} - }; - send(obj); -} - -void CesiumInterface::setLayerSettings(const QString& layer, const QStringList& settings, const QList<QVariant>& values) -{ - QJsonObject obj { - {"command", "setLayerSettings"}, - {"layer", layer}, - }; - for (int i = 0; i < settings.size(); i++) { - obj.insert(settings[i], QJsonValue::fromVariant(values[i])); - } - send(obj); -} - -void CesiumInterface::updateImage(const QString &name, float east, float west, float north, float south, float altitude, const QString &data) -{ - QJsonObject obj { - {"command", "updateImage"}, - {"name", name}, - {"east", east}, - {"west", west}, - {"north", north}, - {"south", south}, - {"altitude", altitude}, - {"data", data}, - }; - send(obj); -} - -void CesiumInterface::removeImage(const QString &name) -{ - QJsonObject obj { - {"command", "removeImage"}, - {"name", name} - }; - send(obj); -} - -void CesiumInterface::removeAllImages() -{ - QJsonObject obj { - {"command", "removeAllImages"} - }; - send(obj); -} - -// Remove all entities created by CZML -void CesiumInterface::removeAllCZMLEntities() -{ - QJsonObject obj { - {"command", "removeAllCZMLEntities"} - }; - send(obj); -} - -void CesiumInterface::initCZML() -{ - QJsonObject obj = m_czml.init(); - czml(obj); -} - -// Send and process CZML -void CesiumInterface::czml(QJsonObject &obj) -{ - obj.insert("command", "czml"); - send(obj); -} - -void CesiumInterface::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) -{ - QJsonObject obj = m_czml.update(mapItem, isTarget, isSelected); - czml(obj); -} - -void CesiumInterface::update(PolygonMapItem *mapItem) -{ - QJsonObject obj = m_czml.update(mapItem); - czml(obj); -} - -void CesiumInterface::update(PolylineMapItem *mapItem) -{ - QJsonObject obj = m_czml.update(mapItem); - czml(obj); -} - -void CesiumInterface::setPosition(const QGeoCoordinate& position) -{ - m_czml.setPosition(position); -} - -void CesiumInterface::save(const QString& filename, const QString& dataDir) -{ - QJsonObject obj { - {"command", "save"}, - {"filename", filename}, - {"dataDir", dataDir} - }; - send(obj); -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022-2023 Jon Beniston, M7RCE <jon@beniston.com> // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include <QJsonObject> + +#include "cesiuminterface.h" +#include "util/profiler.h" + +CesiumInterface::CesiumInterface(const MapSettings *settings, QObject *parent) : + MapWebSocketServer(parent), + m_czml(settings) +{ +} + +// Set the view displayed when the Home button is pressed +// Angle in degrees of longitude or latitude either side of central location +void CesiumInterface::setHomeView(float latitude, float longitude, float angle) +{ + QJsonObject obj { + {"command", "setHomeView"}, + {"latitude", latitude}, + {"longitude", longitude}, + {"angle", angle} + }; + send(obj); +} + +// Set the current camera view to a given location +void CesiumInterface::setView(float latitude, float longitude, float altitude) +{ + QJsonObject obj { + {"command", "setView"}, + {"latitude", latitude}, + {"longitude", longitude}, + {"altitude", altitude} + }; + send(obj); +} + +// How the camera follows the tracked object: MapSettings::CameraMode +void CesiumInterface::setCameraMode(int mode) +{ + QJsonObject obj { + {"command", "setCameraMode"}, + {"mode", mode} + }; + send(obj); +} + +// Play glTF model animation for the map item with the specified name +void CesiumInterface::playAnimation(const QString &name, Animation *animation) +{ + QJsonObject obj { + {"command", "playAnimation"}, + {"id", name}, + {"animation", animation->m_name}, + {"startDateTime", animation->m_startDateTime}, + {"reverse", animation->m_reverse}, + {"loop", animation->m_loop}, + {"stop", animation->m_stop}, + {"startOffset", animation->m_startOffset}, + {"duration", animation->m_duration}, + {"multiplier", animation->m_multiplier}, + {"sound", animation->m_sound} + }; + if (m_batching) { + // Queued so it cannot overtake the entity update it refers to + m_pendingCommands.append(obj); + return; + } + send(obj); +} + +// Set date and time for the map +void CesiumInterface::setDateTime(QDateTime dateTime) +{ + QJsonObject obj { + {"command", "setDateTime"}, + {"dateTime", dateTime.toString(Qt::ISODate)} + }; + send(obj); +} + +// Get current date and time from the map +void CesiumInterface::getDateTime() +{ + QJsonObject obj { + {"command", "getDateTime"} + }; + send(obj); +} + +// Set the camera to track the map item with the specified name +void CesiumInterface::track(const QString& name) +{ + QJsonObject obj { + {"command", "trackId"}, + {"id", name} + }; + send(obj); +} + +void CesiumInterface::setDefaultImagery(const QString &imagery) +{ + QJsonObject obj { + {"command", "setDefaultImagery"}, + {"imagery", imagery} + }; + send(obj); +} + +void CesiumInterface::setTerrain(const QString &terrain, const QString &maptilerAPIKey, bool lighting, bool water) +{ + QString provider; + QString url; + if (terrain == "Maptiler") + { + provider = "CesiumTerrainProvider"; + url = "https://api.maptiler.com/tiles/terrain-quantized-mesh/?key=" + maptilerAPIKey; + } + else if (terrain == "ArcGIS") + { + provider = "ArcGISTiledElevationTerrainProvider"; + url = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"; + } + else + { + provider = terrain; + } + QJsonObject obj { + {"command", "setTerrain"}, + {"provider", provider}, + {"url", url}, + // Not "lighting", which is the Sun/camera lighting in setLighting + {"terrainLighting", lighting}, + {"water", water} + }; + send(obj); +} + +void CesiumInterface::setBuildings(const QString &buildings) +{ + QJsonObject obj { + {"command", "setBuildings"}, + {"buildings", buildings} + }; + send(obj); +} + +void CesiumInterface::setGooglePhotorealistic3DTiles(bool enabled) +{ + QJsonObject obj { + {"command", "setGooglePhotorealistic3DTiles"}, + {"enabled", enabled} + }; + send(obj); +} + +void CesiumInterface::setLighting(bool useSunLight, float cameraLightIntensity) +{ + QJsonObject obj { + {"command", "setLighting"}, + {"useSunLight", useSunLight}, + {"cameraLightIntensity", cameraLightIntensity} + }; + send(obj); +} + +void CesiumInterface::setCameraReferenceFrame(bool eci) +{ + QJsonObject obj { + {"command", "setCameraReferenceFrame"}, + {"eci", eci} + }; + send(obj); +} + +void CesiumInterface::setAntiAliasing(bool fxaa, int msaa) +{ + QJsonObject obj { + {"command", "setAntiAliasing"}, + {"fxaa", fxaa}, + {"msaa", msaa} + }; + send(obj); +} + +void CesiumInterface::setHDR(bool enabled) +{ + QJsonObject obj { + {"command", "setHDR"}, + {"hdr", enabled} + }; + send(obj); +} + +void CesiumInterface::setFog(bool enabled) +{ + QJsonObject obj { + {"command", "setFog"}, + {"fog", enabled} + }; + send(obj); +} + +void CesiumInterface::showFPS(bool show) +{ + QJsonObject obj { + {"command", "showFPS"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showPFD(bool show) +{ + QJsonObject obj { + {"command", "showPFD"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showND(bool show) +{ + QJsonObject obj { + {"command", "showND"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showEFIS(bool show) +{ + QJsonObject obj { + {"command", "showEFIS"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showRMP(bool show) +{ + QJsonObject obj { + {"command", "showRMP"}, + {"show", show} + }; + send(obj); +} + +// The RMP's two VHF channels: {"vhf1": {"active": Hz, "standby": Hz, "available": bool}, +// "vhf2": {...}}. active is null when the linked AM Demod cannot be read +void CesiumInterface::setRMPState(const QJsonObject& state) +{ + QJsonObject obj = state; + obj.insert("command", "setRMPState"); + send(obj); +} + +// Hiding also suppresses the DCDU's pop-on-message behaviour +void CesiumInterface::showDCDU(bool show) +{ + QJsonObject obj { + {"command", "showDCDU"}, + {"show", show} + }; + send(obj); +} + +// The airport database for the ND's airport overlay: [{n, lat, lon, t}] with +// t 0 small, 1 medium, 2 large +// Where each cockpit panel is to be placed: {"pfd": {"l": x, "t": y, "w": w, "h": h}, ...} +// in CSS pixels, as the page last reported them +void CesiumInterface::setPanelGeometry(const QJsonObject& panels) +{ + QJsonObject obj { + {"command", "setPanelGeometry"}, + {"panels", panels} + }; + send(obj); +} + +// What the EFIS knobs and pushbuttons are set to: {"mode", "range", "wx", "terr", +// "arpt", "vor", "tcas"}, as the page last reported them +void CesiumInterface::setEFISState(const QJsonObject& state) +{ + QJsonObject obj { + {"command", "setEFISState"}, + {"state", state} + }; + send(obj); +} + +void CesiumInterface::setNDAirports(const QJsonArray& airports) +{ + QJsonObject obj { + {"command", "setNDAirports"}, + {"airports", airports} + }; + send(obj); +} + +// The VOR-family navaids for the ND's overlay: [{n, lat, lon}] +void CesiumInterface::setNDNavAids(const QJsonArray& navAids) +{ + QJsonObject obj { + {"command", "setNDNavAids"}, + {"navAids", navAids} + }; + send(obj); +} + +// Volumes are [0..100] +void CesiumInterface::setAudioVolume(int mapItemVolume, int cockpitVolume) +{ + QJsonObject obj { + {"command", "setAudioVolume"}, + {"mapItem", mapItemVolume / 100.0}, + {"cockpit", cockpitVolume / 100.0} + }; + send(obj); +} + +void CesiumInterface::showMUF(bool show) +{ + QJsonObject obj { + {"command", "showMUF"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showfoF2(bool show) +{ + QJsonObject obj { + {"command", "showfoF2"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showMagDec(bool show) +{ + QJsonObject obj { + {"command", "showMagneticDeclination"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showMaidenheadGrid(bool show) +{ + QJsonObject obj { + {"command", "showMaidenheadGrid"}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::showLayer(const QString& layer, bool show) +{ + QJsonObject obj { + {"command", "showLayer"}, + {"layer", layer}, + {"show", show} + }; + send(obj); +} + +void CesiumInterface::setLayerSettings(const QString& layer, const QStringList& settings, const QList<QVariant>& values) +{ + QJsonObject obj { + {"command", "setLayerSettings"}, + {"layer", layer}, + }; + for (int i = 0; i < settings.size(); i++) { + obj.insert(settings[i], QJsonValue::fromVariant(values[i])); + } + send(obj); +} + +void CesiumInterface::updateImage(const QString &name, float east, float west, float north, float south, float altitude, const QString &data) +{ + QJsonObject obj { + {"command", "updateImage"}, + {"name", name}, + {"east", east}, + {"west", west}, + {"north", north}, + {"south", south}, + {"altitude", altitude}, + {"data", data}, + }; + send(obj); +} + +void CesiumInterface::removeImage(const QString &name) +{ + QJsonObject obj { + {"command", "removeImage"}, + {"name", name} + }; + send(obj); +} + +void CesiumInterface::removeAllImages() +{ + QJsonObject obj { + {"command", "removeAllImages"} + }; + send(obj); +} + +// Remove all entities created by CZML +void CesiumInterface::removeAllCZMLEntities() +{ + QJsonObject obj { + {"command", "removeAllCZMLEntities"} + }; + send(obj); + // Cesium keeps nothing after this, so neither may we: describing an item against + // what it used to look like would leave out of the packet everything that has not + // changed, and none of it is there any more + m_czml.clear(); +} + +void CesiumInterface::initCZML() +{ + QJsonObject obj = m_czml.init(); + czml(obj); +} + +// Send and process CZML +void CesiumInterface::czml(QJsonObject &obj) +{ + if (m_batching) + { + // The command key is added once, to the array, not to every packet + m_batch.append(obj); + return; + } + obj.insert("command", "czml"); + send(obj); +} + +void CesiumInterface::beginBatch() +{ + m_batching = true; + m_batch = QJsonArray(); +} + +void CesiumInterface::endBatch() +{ + m_batching = false; + + // The CZML goes first, then anything that was issued while it was being collected - + // an animation must not arrive before the entity update it belongs to + if (m_batch.isEmpty()) + { + flushPendingCommands(); + return; + } + // One packet is not worth an array + if (m_batch.size() == 1) + { + QJsonObject obj = m_batch.first().toObject(); + obj.insert("command", "czml"); + send(obj); + } + else + { + QJsonObject obj { + {"command", "czmlArray"}, + {"packets", m_batch} + }; + send(obj); + } + m_batch = QJsonArray(); + flushPendingCommands(); +} + +void CesiumInterface::flushPendingCommands() +{ + for (auto& obj : m_pendingCommands) { + send(obj); + } + m_pendingCommands.clear(); +} + +void CesiumInterface::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) +{ + PROFILER_START() + // Track segments first: update() resets the item's cached state when the item is + // deleted, and the segments' cleanup packets are built from that state + const QList<QJsonObject> trackSegments = m_czml.updateTrackSegments3D(mapItem, isSelected); + PROFILER_STOP("Map CZML segments") + PROFILER_RESTART() + QJsonObject obj = m_czml.update(mapItem, isTarget, isSelected); + PROFILER_STOP("Map CZML update") + PROFILER_RESTART() + // Nothing changed: the packet holds an id and nothing else, so there is nothing for + // Cesium to do with it. Sending it anyway costs a websocket frame, a JSON parse and a + // czmlStream.process() call in the page, per item - which with 200,000 static items + // in the model was most of the traffic the 3D map ever saw. + if (obj.size() > 1) { + czml(obj); + } + for (QJsonObject segment : trackSegments) { // czml() takes a non-const reference + czml(segment); + } + PROFILER_STOP("Map CZML emit") +} + +void CesiumInterface::update(PolygonMapItem *mapItem) +{ + QJsonObject obj = m_czml.update(mapItem); + if (obj.size() > 1) { // id only means nothing to do - see update(ObjectMapItem *) + czml(obj); + } +} + +void CesiumInterface::update(PolylineMapItem *mapItem) +{ + QJsonObject obj = m_czml.update(mapItem); + if (obj.size() > 1) { // id only means nothing to do - see update(ObjectMapItem *) + czml(obj); + } +} + +void CesiumInterface::setPosition(const QGeoCoordinate& position) +{ + m_czml.setPosition(position); +} + +void CesiumInterface::save(const QString& filename, const QString& dataDir) +{ + QJsonObject obj { + {"command", "save"}, + {"filename", filename}, + {"dataDir", dataDir} + }; + send(obj); +} diff --git a/plugins/feature/map/cesiuminterface.h b/plugins/feature/map/cesiuminterface.h index a82606617..b92e51beb 100644 --- a/plugins/feature/map/cesiuminterface.h +++ b/plugins/feature/map/cesiuminterface.h @@ -18,6 +18,8 @@ #ifndef INCLUDE_FEATURE_CESIUMINTERFACE_H_ #define INCLUDE_FEATURE_CESIUMINTERFACE_H_ +#include <QJsonArray> + #include "mapwebsocketserver.h" #include "czml.h" #include "SWGMapAnimation.h" @@ -41,6 +43,9 @@ public: m_startOffset = swgAnimation->getStartOffset(); m_duration = swgAnimation->getDuration(); m_multiplier = swgAnimation->getMultiplier(); + if (swgAnimation->getSound()) { + m_sound = *swgAnimation->getSound(); + } } QString m_name; @@ -51,12 +56,13 @@ public: float m_startOffset; // [0..1] What point to start playing animation float m_duration; // How long to play animation for float m_multiplier; // Speed to play animation at + QString m_sound; // Audio file to play when the animation starts. Empty for none }; CesiumInterface(const MapSettings *settings, QObject *parent = nullptr); void setHomeView(float latitude, float longitude, float angle=1.0f); void setView(float latitude, float longitude, float altitude=60000); - void setViewFirstPerson(bool firstPerson); + void setCameraMode(int mode); void playAnimation(const QString &name, Animation *animation); void setDateTime(QDateTime dateTime); void getDateTime(); @@ -64,6 +70,7 @@ public: void setDefaultImagery(const QString &imagery); void setTerrain(const QString &terrain, const QString &maptilerAPIKey, bool lighting, bool water); void setBuildings(const QString &buildings); + void setGooglePhotorealistic3DTiles(bool enabled); void setCameraReferenceFrame(bool eci); void setLighting(bool useSunLight, float cameraLightIntensity); void setAntiAliasing(bool fxaa, int msaa); @@ -71,6 +78,16 @@ public: void setFog(bool enabled); void showFPS(bool show); void showPFD(bool show); + void showND(bool show); + void showEFIS(bool show); + void showRMP(bool show); + void showDCDU(bool show); + void setRMPState(const QJsonObject& state); + void setPanelGeometry(const QJsonObject& panels); + void setEFISState(const QJsonObject& state); + void setNDAirports(const QJsonArray& airports); + void setNDNavAids(const QJsonArray& navAids); + void setAudioVolume(int mapItemVolume, int cockpitVolume); void showMUF(bool show); void showfoF2(bool show); void showMagDec(bool show); @@ -83,6 +100,28 @@ public: void removeAllCZMLEntities(); void initCZML(); void czml(QJsonObject &obj); + + // Collect CZML packets instead of sending each one on its own. A flush of a busy sky + // is one message, one JSON.parse and one czmlStream.process() in the page rather than + // one of each per aircraft - which is where the 3D map's cost actually is, since the + // C++ side of a packet is only a few microseconds. + + void beginBatch(); + void endBatch(); + +private: + void flushPendingCommands(); + +public: + + bool m_batching = false; + QJsonArray m_batch; + // Commands issued while a batch is open. They must not overtake the CZML packets they + // refer to: ObjectMapModel::update3D() updates an entity and then plays its + // animations, and with the update queued but the animation sent immediately, the + // animation reached Cesium first - referring to an entity that had not been updated, + // or on the first sighting did not yet exist. + QList<QJsonObject> m_pendingCommands; void update(ObjectMapItem *mapItem, bool isTarget, bool isSelected); void update(PolygonMapItem *mapItem); void update(PolylineMapItem *mapItem); diff --git a/plugins/feature/map/czml.cpp b/plugins/feature/map/czml.cpp index 7872fa122..7e7df6fd1 100644 --- a/plugins/feature/map/czml.cpp +++ b/plugins/feature/map/czml.cpp @@ -15,13 +15,18 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // /////////////////////////////////////////////////////////////////////////////////// +#include <cmath> + #include <QDebug> +#include <QJsonDocument> #include "czml.h" #include "mapsettings.h" #include "mapmodel.h" #include "util/coordinates.h" +#include "util/flightpathpalette.h" +#include "util/units.h" // FIXME: Cesium now has some additional options: CLAMP_TO_TERRAIN, RELATIVE_TO_TERRAIN, CLAMP_TO_3D_TILE, RELATIVE_TO_3D_TILE // CLIP_TO_GROUND is our own addition @@ -48,6 +53,35 @@ bool CZML::filter(const MapItem *mapItem) const ); } +// Cesium rejects a null inside a coordinate array with a DeveloperError that stops the +// whole scene, and Qt writes null for any non-finite double - so one NaN from one sender +// takes the 3D map down rather than misplacing one item. A QGeoCoordinate built from the +// two argument constructor has altitude qQNaN() while still reporting isValid(), which +// makes this easy to introduce and invisible until Cesium sees it. Substituting zero +// puts the item somewhere wrong, which is recoverable and obvious; a null is not. +static double finiteOrZero(double value) +{ + if (!qIsFinite(value)) + { + static bool warned = false; + if (!warned) + { + warned = true; + qWarning() << "CZML: a non-finite coordinate was substituted with zero -" + << "some map item is sending NaN or infinity"; + } + return 0.0; + } + return value; +} + +void CZML::clear() +{ + m_ids.clear(); + m_lastPosition.clear(); + m_hasMoved.clear(); +} + QJsonObject CZML::init() { // Start a few seconds in the past, to allow for data to be received @@ -69,6 +103,48 @@ QJsonObject CZML::init() return doc; } +// A delete is only worth sending for an entity Cesium has actually been told about, and +// only once. Everything else was the great majority of the CZML traffic: in a measured run +// 231,680 of 231,779 deletes were for entities the page had never had - every airport in +// the database, filtered out by distance, deleted on first sight - and every airspace was +// deleted afresh on each settings pass. 91% of all packets. +// +// When a delete is sent, everything cached about the entity is reset, because Cesium is +// being told to throw it away entirely - history and all. Kept, it makes the next +// description a difference against a state Cesium no longer holds, and every unchanged +// property is then left out of a packet describing an entity that no longer has any of +// them. The position is the one that bites: it is suppressed when it has not moved, so a +// waypoint deleted and re-added in the same place - which is what selecting away from a +// flight and back does - came back as a billboard with nowhere to be drawn, and never +// appeared. Clearing m_seen alone was not enough; that only governs the early-out, while +// the rest of the packet is built against existingId, which is what m_firstSeenDateTime +// carries - so it is the whole State that goes. +bool CZML::deleteNeeded(const QString& id) +{ + auto it = m_ids.find(id); + + // Never described (an entry may exist without one: the track segments create them), + // or already deleted - which also clears m_firstSeenDateTime, so that check covers both + if ((it == m_ids.end()) || it->m_deleted || it->m_firstSeenDateTime.isEmpty()) { + return false; + } + *it = State(); + it->m_deleted = true; + m_lastPosition.remove(id); + m_hasMoved.remove(id); + return true; +} + +void CZML::described(const QString& id) +{ + State& state = m_ids[id]; + + if (state.m_firstSeenDateTime.isEmpty()) { + state.m_firstSeenDateTime = QDateTime::currentDateTimeUtc().toString(Qt::ISODateWithMs); + } + state.m_deleted = false; // visible again, so a later filter must re-delete it +} + QJsonObject CZML::update(PolygonMapItem *mapItem) { QString id = mapItem->m_name; @@ -83,10 +159,13 @@ QJsonObject CZML::update(PolygonMapItem *mapItem) || mapItem->m_deleted ) { - // Delete obj completely (including any history) - obj.insert("delete", true); - return obj; + // Delete obj completely (including any history) - if Cesium has it + if (deleteNeeded(id)) { + obj.insert("delete", true); + } + return obj; // id only otherwise, so nothing is sent } + described(id); // Need to use perPositionHeight for vertical polygons bool perPosition = mapItem->m_extrudedHeight == 0; @@ -94,9 +173,9 @@ QJsonObject CZML::update(PolygonMapItem *mapItem) QJsonArray positions; for (const auto c : mapItem->m_points) { - positions.append(c->longitude()); - positions.append(c->latitude()); - positions.append(c->altitude()); + positions.append(finiteOrZero(c->longitude())); + positions.append(finiteOrZero(c->latitude())); + positions.append(finiteOrZero(c->altitude())); } QJsonObject positionList { @@ -124,6 +203,19 @@ QJsonObject CZML::update(PolygonMapItem *mapItem) {"solidColor", solidColor} }; + // Outlined only when the polygon is FLAT, which is the difference between an outline + // that helps and one that ruins the picture. + // + // Cesium draws the outline of an extruded polygon at every vertex - not just around + // the top and bottom but a vertical edge at each point of the perimeter - in opaque + // black whatever colour the polygon is. An airspace is a faint translucent wall built + // from a great many vertices, so that came out as a row of hard dark bars across it. + // A flat polygon has no verticals, and its outline is simply its boundary: the ILS + // demodulator's beams and the Aircraft feature's coverage wedges both want that. + // + // Cesium has one flag for the whole outline, so this is decided from the item rather + // than asked of it - perPosition is already the test for "not extruded", and an + // explicit flag would mean a new SWGMapItem field and a swagger regeneration. QJsonArray outlineColorRGBA { 0, 0, 0, 255 }; @@ -134,7 +226,7 @@ QJsonObject CZML::update(PolygonMapItem *mapItem) QJsonObject polygon { {"positions", positionList}, {"material", material}, - {"outline", true}, + {"outline", perPosition}, {"outlineColor", outlineColor}, }; if (perPosition) @@ -153,7 +245,8 @@ QJsonObject CZML::update(PolygonMapItem *mapItem) // We need to have a position, otherwise viewer entity tracking doesn't seem to work QJsonArray coords { - mapItem->m_longitude, mapItem->m_latitude, mapItem->m_altitude + finiteOrZero(mapItem->m_longitude), finiteOrZero(mapItem->m_latitude), + finiteOrZero(mapItem->m_altitude) }; QJsonObject position { {"cartographicDegrees", coords}, @@ -181,17 +274,20 @@ QJsonObject CZML::update(PolylineMapItem *mapItem) || mapItem->m_deleted ) { - // Delete obj completely (including any history) - obj.insert("delete", true); - return obj; + // Delete obj completely (including any history) - if Cesium has it + if (deleteNeeded(id)) { + obj.insert("delete", true); + } + return obj; // id only otherwise, so nothing is sent } + described(id); QJsonArray positions; for (const auto c : mapItem->m_points) { - positions.append(c->longitude()); - positions.append(c->latitude()); - positions.append(c->altitude()); + positions.append(finiteOrZero(c->longitude())); + positions.append(finiteOrZero(c->latitude())); + positions.append(finiteOrZero(c->altitude())); } QJsonObject positionList { @@ -230,7 +326,8 @@ QJsonObject CZML::update(PolylineMapItem *mapItem) // We need to have a position, otherwise viewer entity tracking doesn't seem to work QJsonArray coords { - mapItem->m_longitude, mapItem->m_latitude, mapItem->m_altitude + finiteOrZero(mapItem->m_longitude), finiteOrZero(mapItem->m_latitude), + finiteOrZero(mapItem->m_altitude) }; QJsonObject position { {"cartographicDegrees", coords}, @@ -249,12 +346,23 @@ static void insertConstantProperty(QJsonObject& properties, const QString& name, properties.insert(name, value); } +// A sample needs a time. An item can legitimately not have one - a position datetime +// is invalid until a protocol that carries times has been heard, and the per-field +// datetimes are sender strings that serialize an invalid QDateTime as "" - and an +// empty string here made Cesium reject the ENTIRE packet ("Invalid ISO 8601 date."), +// state, position, model and all. The state being described is current, so 'now' is +// the honest anchor when the sender gave none. +static QString sampleTime(const QString& dateTime) +{ + return dateTime.isEmpty() ? QDateTime::currentDateTimeUtc().toString(Qt::ISODateWithMs) : dateTime; +} + static void insertProperty(QJsonObject& properties, const QString& name, const QString& dateTime, float value) { if (!std::isnan(value)) { QJsonArray ar; - ar.push_back(dateTime); + ar.push_back(sampleTime(dateTime)); ar.push_back(value); QJsonObject obj { {"number", ar}, @@ -267,6 +375,69 @@ static void insertProperty(QJsonObject& properties, const QString& name, const Q } } +// The flight plan is structured data of variable length, so it is sent as a single +// constant string property containing compact JSON, which the ND parses +static QString flightPlanJson(const MapFlightPlan& plan) +{ + if (!plan.m_valid) { + return QString(); + } + QJsonObject obj; + if (!plan.m_departure.isEmpty()) { + obj.insert("dep", plan.m_departure); + } + if (!plan.m_arrival.isEmpty()) { + obj.insert("arr", plan.m_arrival); + } + if (!plan.m_arrivalRunway.isEmpty()) { + obj.insert("rwy", plan.m_arrivalRunway); + } + if (!plan.m_approach.isEmpty()) { + obj.insert("app", plan.m_approach); + } + obj.insert("act", plan.m_activeWaypoint); + QJsonArray waypoints; + for (const auto& wp : plan.m_waypoints) + { + QJsonObject waypoint; + waypoint.insert("n", wp.m_name); + if (!std::isnan(wp.m_latitude) && !std::isnan(wp.m_longitude)) + { + waypoint.insert("lat", wp.m_latitude); + waypoint.insert("lon", wp.m_longitude); + } + if (!std::isnan(wp.m_altitudeFt)) { + waypoint.insert("alt", wp.m_altitudeFt); + } + if (!wp.m_eta.isEmpty()) { + waypoint.insert("eta", wp.m_eta); + } + waypoints.append(waypoint); + } + obj.insert("wpts", waypoints); + return QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact)); +} + +// A datalink (CPDLC/PDC) message for the DCDU, as a single constant string property of +// compact JSON, like the flight plan above +static QString datalinkMessageJson(const MapDatalinkMessage& message) +{ + if (!message.m_valid) { + return QString(); + } + QJsonObject obj; + obj.insert("id", message.m_id); + if (!message.m_received.isEmpty()) { + obj.insert("rx", message.m_received); + } + obj.insert("up", message.m_uplink ? 1 : 0); + if (!message.m_station.isEmpty()) { + obj.insert("stn", message.m_station); + } + obj.insert("txt", message.m_text); + return QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact)); +} + // SampledProperties are interpolated // Need to use intervals to avoid interpolation // See: https://sandcastle.cesium.com/?src=CZML%20Custom%20Properties.html&label=All @@ -275,7 +446,7 @@ static void insertProperty0(QJsonObject& properties, const QString& name, const if (!std::isnan(value)) { QJsonObject obj { - {"interval", dateTime + "/3000"}, // Year 3000 + {"interval", sampleTime(dateTime) + "/3000"}, // Year 3000 {"number", value} }; @@ -286,6 +457,268 @@ static void insertProperty0(QJsonObject& properties, const QString& name, const } } +// The 3D map's altitude coloured track: the taken track split into one polyline entity +// per altitude band, sharing the 2D map's palette and its 5000 ft bands. A Cesium path +// has a single material, so a multi coloured track cannot be drawn with the entity's +// own path graphic - when a palette is set the path is hidden (see the path block in +// update()) and these entities, named "<item name> t3d <n>", are drawn instead. +// +// Items with a predicted track (satellites) keep the path, which also draws the future +// leg - something a polyline of taken positions cannot. +// +// Called BEFORE update(), which resets the item's cached state when it is deleted. +QList<QJsonObject> CZML::updateTrackSegments3D(ObjectMapItem *mapItem, bool isSelected) +{ + QList<QJsonObject> packets; + const QString id = mapItem->m_name; + + // PFD samples from a fast log replay are sent immediately, while the accumulated + // track is sent by the model's normal flush. Rebuilding the growing tail for every + // frame would be quadratic work and can swamp the 3D page on a large log. + if (mapItem->m_replayStateUpdate) { + return packets; + } + + const QString& palette = mapItem->m_itemSettings->m_2DTrackPalette; + // With no palette but smoothing on, the track is still drawn as polylines - in the + // single track colour - rather than left to the entity's path. The path is drawn + // from the POSITION SAMPLES, which carry every raw live report interleaved between + // the smoothed ones at different timestamps, so it stays jagged whatever lambda is. + // Only the polylines below draw the smoothed track and nothing else. + const bool smoothedPlain = palette.isEmpty() + && (mapItem->m_itemSettings->m_smoothingWindow > 0) + && mapItem->m_trackSupplied; + const bool segmented = (!palette.isEmpty() || smoothedPlain) + && !mapItem->m_fixedPosition + && mapItem->m_predictedTrackCoords.isEmpty() + && mapItem->m_itemSettings->m_enabled + && !mapItem->m_deleted + && (mapItem->m_image != "") + && !filter(mapItem); + + if (!segmented) + { + // Take down anything drawn. Without creating a state entry: the settings walks + // visit every one of the model's items, most of which never segment a track. + auto it = m_ids.find(id); + if ((it == m_ids.end()) || (it->m_trackSegmentsEmitted == 0)) { + return packets; + } + State& state = *it; + for (int i = 0; i < state.m_trackSegmentsEmitted; i++) + { + packets.append(QJsonObject { + {"id", QString("%1 t3d %2").arg(id).arg(i)}, + {"delete", true} + }); + } + state.m_trackSegmentsEmitted = 0; + state.m_trackSegmentSizes.clear(); + state.m_trackSegmentBands.clear(); + state.m_trackPointCount = 0; + state.m_trackLastColorIndex = -1; + state.m_trackPalette.clear(); + state.m_trackSegmentsShow = false; + return packets; + } + + State& state = m_ids[id]; + const QList<QGeoCoordinate *>& coords = mapItem->m_takenTrackCoords; + + const bool show = mapItem->m_itemSettings->m_display3DTrack + && ( m_settings->m_displayAllGroundTracks + || (m_settings->m_displaySelectedGroundTracks && isSelected)); + const bool showChanged = (show != state.m_trackSegmentsShow) + && (state.m_trackSegmentsEmitted > 0); + + // Rebuild from scratch when the palette changed or the track is not simply longer + // than before - it shrank, or its first point moved, which is what a trim or a + // flight change looks like. In plain mode the key carries the track colour, so a + // colour change also recolours the already closed chunks + const QString paletteKey = smoothedPlain + ? QString("#plain %1").arg(mapItem->m_itemSettings->m_3DTrackColor) + : palette; + const bool tailChanged = (state.m_trackPointCount > 0) + && (coords.size() >= state.m_trackPointCount) + && (*coords[state.m_trackPointCount - 1] != state.m_trackLastCoord); + const bool rebuild = (paletteKey != state.m_trackPalette) + || (coords.size() < state.m_trackPointCount) + || tailChanged + || (state.m_trackRevision != mapItem->m_takenTrackRevision) + || ( (state.m_trackPointCount > 0) && !coords.isEmpty() + && (*coords[0] != state.m_trackFirstCoord)); + if (rebuild) + { + state.m_trackSegmentSizes.clear(); + state.m_trackSegmentBands.clear(); + state.m_trackPointCount = 0; + state.m_trackLastColorIndex = -1; + state.m_trackPalette = paletteKey; + } + if (!coords.isEmpty()) { + state.m_trackFirstCoord = *coords[0]; + } + + // Extend the segmentation over the new points, mirroring the 2D map's + // ObjectMapModel::colorTrackPoints(): the point a colour change happens at is + // repeated, in the segment that ends there and the one that starts there, so + // consecutive segments join without a gap + // A segment is also split when it reaches a maximum size. A closed segment is never + // re-sent, but the growing tail is - and a band only changes when the aircraft + // crosses 5000 ft, so at cruise the tail segment was the whole cruise, thousands of + // points re-serialized on the GUI thread every few seconds for every aircraft. That + // is what made position updates jerky with a few hundred tracks on screen. The cap + // bounds the tail: at most this many points per re-send, whatever the flight phase. + const int maxSegmentSize = 250; + const int previousCount = state.m_trackSegmentSizes.size(); + for (int i = state.m_trackPointCount; i < coords.size(); i++) + { + // Plain mode has no altitude bands - everything is one band in the single + // track colour, and the size cap alone chunks it + const int band = smoothedPlain + ? 0 + : FlightPathPalette::getColorIndex(Units::metresToFeet(coords[i]->altitude())); + if ( (band != state.m_trackLastColorIndex) + || (state.m_trackSegmentSizes.last() >= maxSegmentSize)) + { + if (state.m_trackLastColorIndex >= 0) { + state.m_trackSegmentSizes.last()++; + } + state.m_trackSegmentSizes.append(0); + state.m_trackSegmentBands.append(band); + state.m_trackLastColorIndex = band; + } + state.m_trackSegmentSizes.last()++; + } + const bool grew = coords.size() > state.m_trackPointCount; + state.m_trackPointCount = coords.size(); + state.m_trackLastCoord = coords.isEmpty() ? QGeoCoordinate() : *coords.last(); + state.m_trackRevision = mapItem->m_takenTrackRevision; + + const int segmentCount = state.m_trackSegmentSizes.size(); + if (segmentCount == 0) + { + state.m_trackSegmentsShow = show; + return packets; + } + + // While the track is hidden, nothing is emitted at all - the segmentation state + // above still advances, and showing the track re-emits everything current in one + // go (the show change below makes firstEmit 0). Hiding just flips the show flag + // on what is already drawn, rather than re-sending every position hidden + if (!show) + { + if (showChanged) + { + for (int k = 0; k < state.m_trackSegmentsEmitted; k++) + { + packets.append(QJsonObject { + {"id", QString("%1 t3d %2").arg(id).arg(k)}, + {"polyline", QJsonObject {{"show", false}}} + }); + } + } + state.m_trackSegmentsShow = false; + return packets; + } + + // Decide which segments go out. Closed segments never change again, so in the + // steady state only the growing tail is re-sent - and that at most once a second. + // The throttle was 5 s when the tail was a CZML polyline entity, whose every update + // re-batched static geometry on the page's main thread; the page now draws these + // through a PolylineCollection, where an update rewrites one line's vertex data + // (measured ~30 us a packet), so the track can afford to hug the aircraft. + int firstEmit; + const QDateTime now = QDateTime::currentDateTimeUtc(); + if (rebuild || showChanged || (state.m_trackSegmentsEmitted == 0)) { + firstEmit = 0; + } else if (segmentCount > previousCount) { + // A segment closed: it gained its boundary point, so re-send from it + firstEmit = qMax(0, previousCount - 1); + } else if (grew && (mapItem->m_replayTrackPending + || !state.m_trackTailEmit.isValid() || (state.m_trackTailEmit.msecsTo(now) >= 1000))) { + firstEmit = segmentCount - 1; + } else { + return packets; // Nothing changed, or the tail is throttled + } + // The Whittaker-Eilers smoother refines the last two windows of points in place + // (smoothTrack() filters twice the setting), which can reach back beyond + // the segment that grew - re-send far enough to cover it + const int smoothingWindow = 2 * mapItem->m_itemSettings->m_smoothingWindow; + if (smoothingWindow > 0) + { + int covered = (firstEmit < segmentCount) ? state.m_trackSegmentSizes[firstEmit] : 0; + while ((firstEmit > 0) && (covered < smoothingWindow)) { + firstEmit--; + covered += state.m_trackSegmentSizes[firstEmit] - 1; + } + } + + const QVariant *paletteColors = smoothedPlain ? nullptr : FlightPathPalette::getPalette(palette); + const QColor plainColor = QColor::fromRgba(mapItem->m_itemSettings->m_3DTrackColor); + + // Draw the smoothed shadow of the track where one is being maintained - the bands + // above stay keyed on the raw altitudes, which never change under us. The provisional + // live point rides one past the shadow (updateProvisionalTrackPoint() does not shadow + // it), and it is there on almost every flush - requiring exact equality here meant + // the raw track was what actually got drawn, quantized altitudes and all. + const int shadowSize = mapItem->m_smoothedTrackCoords.size(); + const bool smoothed = (shadowSize == coords.size()) + || (mapItem->m_trackProvisional && (shadowSize == coords.size() - 1)); + + // Consecutive segments share their boundary point, so segment k starts at the sum + // of the earlier sizes less one shared point per join + int start = 0; + for (int k = 0; k < firstEmit; k++) { + start += state.m_trackSegmentSizes[k] - 1; + } + for (int k = firstEmit; k < segmentCount; k++) + { + const int size = state.m_trackSegmentSizes[k]; + QJsonArray positions; + for (int j = start; j < start + size; j++) + { + const QGeoCoordinate& coord = (smoothed && (j < shadowSize)) + ? mapItem->m_smoothedTrackCoords[j] : *coords[j]; + // Rounded, not full precision: a raw double serializes to up to 17 + // significant digits, which is most of the packet's bytes. 1e-7 degrees + // is about a centimetre + positions.push_back(std::round(finiteOrZero(coord.longitude()) * 1e7) / 1e7); + positions.push_back(std::round(finiteOrZero(coord.latitude()) * 1e7) / 1e7); + positions.push_back(std::round(finiteOrZero(coord.altitude()) * 100.0) / 100.0); + } + const QColor color = smoothedPlain ? plainColor : paletteColors[state.m_trackSegmentBands[k]].value<QColor>(); + QJsonArray colorRGBA { + color.red(), color.green(), color.blue(), color.alpha() + }; + QJsonObject polyline { + {"positions", QJsonObject {{"cartographicDegrees", positions}}}, + {"material", QJsonObject {{"solidColor", QJsonObject {{"color", QJsonObject {{"rgba", colorRGBA}}}}}}}, + {"width", 2}, + {"show", show} + }; + packets.append(QJsonObject { + {"id", QString("%1 t3d %2").arg(id).arg(k)}, + {"polyline", polyline} + }); + start += size - 1; + } + + // A rebuild can produce fewer segments than were drawn + for (int k = segmentCount; k < state.m_trackSegmentsEmitted; k++) + { + packets.append(QJsonObject { + {"id", QString("%1 t3d %2").arg(id).arg(k)}, + {"delete", true} + }); + } + + state.m_trackSegmentsEmitted = segmentCount; + state.m_trackSegmentsShow = show; + state.m_trackTailEmit = now; + return packets; +} + QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) { (void) isTarget; @@ -296,17 +729,27 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) {"id", id} // id must be unique }; - if (!mapItem->m_itemSettings->m_enabled || filter(mapItem)) + if (!mapItem->m_itemSettings->m_enabled || filter(mapItem) || mapItem->m_deleted) { - // Delete obj completely (including any history) - obj.insert("delete", true); - return obj; + // Delete obj completely (including any history) - if Cesium has it, and only + // once. See deleteNeeded() for what that was costing. + if (deleteNeeded(id)) { + obj.insert("delete", true); + } + return obj; // id only otherwise, so nothing is sent } - // Don't currently use CLIP_TO_GROUND in Cesium due to Jitter bug - // https://github.com/CesiumGS/cesium/issues/4049 - // Instead we implement our own clipping code in map3d.html - const QStringList heightReferences = {"NONE", "CLAMP_TO_GROUND", "RELATIVE_TO_GROUND", "NONE"}; + // Models, labels, points and billboards are all kept above the surface by the + // CLIP_TO_GROUND height reference added to our Cesium, which re-queries the surface + // under each every frame - as terrain and tiles load, and between the positions we + // send, where Cesium interpolates and extrapolates. That costs: against Google's 3D + // tiles each query is a ray pick through the tile geometry, measured at 21 ms a + // frame for 90 models and far more for their labels. The alternative, clipping the + // positions we send in map3d.html from a height sampled off the depth buffer, was + // cheaper but wrong on those tiles - a sample that lands on a hangar roof or a parked + // aircraft's mesh lifts everything crossing that cell into the air - so Cesium's + // is used for everything until that is right, and this comment records the cost + const QStringList heightReferences = {"NONE", "CLAMP_TO_GROUND", "RELATIVE_TO_GROUND", "CLIP_TO_GROUND"}; QString dt; if (mapItem->m_availableFrom.isValid()) { @@ -318,14 +761,64 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) } // Keep a hash of the time we first saw each item - bool existingId = m_ids.contains(id); State& state = m_ids[id]; + // An item that was previously filtered out already has an entry, so the presence of + // one no longer means we have described it + bool existingId = !state.m_firstSeenDateTime.isEmpty(); if (!existingId) { state.m_firstSeenDateTime = dt; } + state.m_deleted = false; // visible again, so a later filter must re-delete it bool removeObj = false; bool fixedPosition = mapItem->m_fixedPosition; + + // EARLY OUT, before any JSON is built. + // + // allUpdated() walks every item whenever settings are applied, and the model holds of + // the order of 200,000 - airports, navaids, airspaces, waypoints - none of which ever + // move. Filtering the resulting packet was enough to stop them being SENT, but each + // one was still assembled into a QJsonObject and then discarded: measured at 217,510 + // constructions to produce 1,242 batches worth sending. + // + // A fixed item that we have already described, whose position, label, image and the + // settings CZML reads are all as they were, cannot produce anything but its own id. + const quint32 settingsSignature = mapItem->m_itemSettings->czmlSignature(); + if (state.m_seen + && fixedPosition + && (state.m_settingsSignature == settingsSignature) + && (state.m_latitude == mapItem->m_latitude) + && (state.m_longitude == mapItem->m_longitude) + && (state.m_altitude == mapItem->m_altitude) + && (state.m_lastLabel == mapItem->m_label) + && (state.m_lastImage == mapItem->m_image)) + { + return obj; // id only, which CesiumInterface::update() will not send + } + // How fast height is being lost, from the last update, so that the extrapolation + // below can be stopped before it flies the item into the ground. Worked out here + // because the previous altitude is about to be overwritten + double descentRate = 0.0; // m/s, positive while descending + if (state.m_altitudeDateTime.isValid() && mapItem->m_positionDateTime.isValid()) + { + const double seconds = state.m_altitudeDateTime.msecsTo(mapItem->m_positionDateTime) / 1000.0; + if (seconds > 0.0) + { + const double rate = (state.m_altitude - mapItem->m_altitude) / seconds; + if ((rate > 0.0) && (rate < 100.0)) { // Anything faster is a bad altitude, not a descent + descentRate = rate; + } + } + } + + state.m_seen = true; + state.m_settingsSignature = settingsSignature; + state.m_latitude = mapItem->m_latitude; + state.m_longitude = mapItem->m_longitude; + state.m_altitude = mapItem->m_altitude; + state.m_altitudeDateTime = mapItem->m_positionDateTime; + state.m_lastLabel = mapItem->m_label; + state.m_lastImage = mapItem->m_image; if (mapItem->m_image == "") { // Need to remove this from the map (but history is retained) @@ -375,9 +868,12 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) if (useDateTime) { coords.push_back(mapItem->m_interpolatedDateTimes[i]->toString(Qt::ISODateWithMs)); } - coords.push_back(mapItem->m_interpolatedCoords[i]->longitude()); - coords.push_back(mapItem->m_interpolatedCoords[i]->latitude()); - coords.push_back(mapItem->m_interpolatedCoords[i]->altitude()); + coords.push_back(finiteOrZero(mapItem->m_interpolatedCoords[i]->longitude())); + coords.push_back(finiteOrZero(mapItem->m_interpolatedCoords[i]->latitude())); + // The same offset the live position gets below - 0,0,0 is the + // middle of a 3D model, not the bottom of its undercarriage, so + // without it these samples sit lower than the ones around them + coords.push_back(finiteOrZero(mapItem->m_interpolatedCoords[i]->altitude() + mapItem->m_modelAltitudeOffset)); } mapItem->m_interpolatedCoords.clear(); mapItem->m_interpolatedDateTimes.clear(); @@ -390,21 +886,21 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) if (useDateTime) { coords.push_back(mapItem->m_takenTrackDateTimes.back()->toString(Qt::ISODateWithMs)); } - coords.push_back(mapItem->m_takenTrackCoords.back()->longitude()); - coords.push_back(mapItem->m_takenTrackCoords.back()->latitude()); + coords.push_back(finiteOrZero(mapItem->m_takenTrackCoords.back()->longitude())); + coords.push_back(finiteOrZero(mapItem->m_takenTrackCoords.back()->latitude())); } else { if (useDateTime) { coords.push_back(mapItem->m_positionDateTime.toString(Qt::ISODateWithMs)); } - coords.push_back(mapItem->m_longitude); - coords.push_back(mapItem->m_latitude); + coords.push_back(finiteOrZero(mapItem->m_longitude)); + coords.push_back(finiteOrZero(mapItem->m_latitude)); } if (!mapItem->m_takenTrackAltitudeExtrapolated.isEmpty() && mapItem->m_takenTrackAltitudeExtrapolated.back()) { - coords.push_back(mapItem->m_takenTrackCoords.back()->altitude()); + coords.push_back(finiteOrZero(mapItem->m_takenTrackCoords.back()->altitude())); } else { - coords.push_back(mapItem->m_altitude + mapItem->m_modelAltitudeOffset); // See nodeTransformations comment below, as to why we use this here + coords.push_back(finiteOrZero(mapItem->m_altitude + mapItem->m_modelAltitudeOffset)); // See nodeTransformations comment below, as to why we use this here } } } @@ -413,6 +909,12 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) { coords = m_lastPosition.value(id); } + // A position that has not moved does not need re-sending. For a fixed item - an + // airport, a navaid, an airspace - that is every update after the first, and there + // are of the order of 200,000 of those in the model. + const bool positionUnchanged = existingId && m_lastPosition.contains(id) + && (m_lastPosition.value(id) == coords); + QJsonObject position { {"cartographicDegrees", coords}, }; @@ -435,7 +937,21 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) position.insert("forwardExtrapolationType", "EXTRAPOLATE"); //position.insert("forwardExtrapolationType", "LINEAR_EXTRAPOLATE"); // LAGRANGE is poor for extrapolation //position.insert("forwardExtrapolationType", "HOLD"); // Keeps at last position - position.insert("forwardExtrapolationDuration", mapItem->m_itemSettings->m_extrapolate); + // Extrapolation carries the last vertical rate on, so an aircraft still + // descending when its updates stop is flown down through the ground and + // keeps going - they were seen 82 m under it. It may only be extrapolated + // for as long as the height it had would last at the rate it was losing + // it: an aircraft at cruise is unaffected, one on approach stops being + // extrapolated at the point it would have arrived. Only for items drawn + // at an absolute altitude that are meant to sit above the ground, so + // shipping, which is clamped to it, is untouched + int extrapolationSeconds = mapItem->m_itemSettings->m_extrapolate; + if ((mapItem->m_altitudeReference == 3) && (descentRate > 0.0) && (mapItem->m_altitude > 0.0f)) + { + const int secondsToGround = (int) (mapItem->m_altitude / descentRate); + extrapolationSeconds = qMin(extrapolationSeconds, qMax(1, secondsToGround)); + } + position.insert("forwardExtrapolationDuration", extrapolationSeconds); // To calc acceleration, we need to use non-linear interpolation. position.insert("interpolationAlgorithm", "LINEAR"); position.insert("interpolationDegree", 2); @@ -486,19 +1002,29 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) if (!removeObj) { + QJsonObject properties; if (mapItem->m_aircraftState) { - QJsonObject properties; - QDateTime aircraftStateDateTime = mapItem->m_positionDateTime; + // A replay sample has its own frame time. Live/coalesced senders omit it + // and retain the historical behaviour of tying state to the position time. + QDateTime aircraftStateDateTime = mapItem->m_aircraftState->m_dateTime.isValid() + ? mapItem->m_aircraftState->m_dateTime : mapItem->m_positionDateTime; QString dateTime = aircraftStateDateTime.toString(Qt::ISODateWithMs); bool aircraftStateDateTimeChanged = aircraftStateDateTime != state.m_aircraftStateDateTime; + const bool replayState = mapItem->m_aircraftState->m_dateTime.isValid(); QString aircraftCallsign = mapItem->m_aircraftState->m_callsign; QString aircraftType = mapItem->m_aircraftState->m_aircraftType; - QString aircraftIndicatedAirspeedDateTime = mapItem->m_aircraftState->m_indicatedAirspeedDateTime; + // During replay this is a complete snapshot, so even fields whose most + // recent measurement has its own time are sampled at the frame time. That + // preserves their held value throughout the replay instead of letting the + // CZML 30-second extrapolation expire between sparse measurements. + QString aircraftIndicatedAirspeedDateTime = replayState + ? dateTime : mapItem->m_aircraftState->m_indicatedAirspeedDateTime; float aircraftIndicatedAirspeed = mapItem->m_aircraftState->m_indicatedAirspeed; float aircraftTrueAirspeed = mapItem->m_aircraftState->m_trueAirspeed; float aircraftGroundspeed = mapItem->m_aircraftState->m_groundspeed; - QString aircraftAltitudeDateTime = mapItem->m_aircraftState->m_altitudeDateTime; + QString aircraftAltitudeDateTime = replayState + ? dateTime : mapItem->m_aircraftState->m_altitudeDateTime; float aircraftAltitude = mapItem->m_aircraftState->m_altitude; int aircraftOnSurface = mapItem->m_aircraftState->m_onSurface; float aircraftMach = mapItem->m_aircraftState->m_mach; @@ -507,12 +1033,19 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) float aircraftHeading = mapItem->m_aircraftState->m_heading; float aircraftTrack = mapItem->m_aircraftState->m_track; float aircraftRoll = mapItem->m_roll; + // The same estimate that orients the 3D model, so the attitude indicator and + // the aircraft on the map agree + float aircraftPitch = mapItem->m_pitch; float aircraftSelectedAltitude = mapItem->m_aircraftState->m_selectedAltitude; float aircraftSelectedHeading = mapItem->m_aircraftState->m_selectedHeading; int aircraftAutopilot = mapItem->m_aircraftState->m_autopilot; MapAircraftState::VerticalMode aircraftVerticalMode = mapItem->m_aircraftState->m_verticalMode; MapAircraftState::LateralMode aircraftLateralMode = mapItem->m_aircraftState->m_lateralMode; MapAircraftState::TCASMode aircraftTCASMode = mapItem->m_aircraftState->m_tcasMode; + int aircraftTcasRA = mapItem->m_aircraftState->m_tcasRA; + QString aircraftTcasThreatIcao = mapItem->m_aircraftState->m_tcasThreatIcao; + int aircraftSquawk = mapItem->m_aircraftState->m_squawk; + QString aircraftIcao = mapItem->m_aircraftState->m_icao; float aircraftWindSpeed = mapItem->m_aircraftState->m_windSpeed; float aircraftWindDirection = mapItem->m_aircraftState->m_windDirection; float aircraftStaticAirTemperature = mapItem->m_aircraftState->m_staticAirTemperature; @@ -622,6 +1155,14 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) insertProperty(properties, "pfdRoll", dateTime, aircraftRoll); state.m_aircraftRoll = aircraftRoll; } + if ( !existingId + || aircraftStateDateTimeChanged + || (aircraftPitch != state.m_aircraftPitch) + ) + { + insertProperty(properties, "pfdPitch", dateTime, aircraftPitch); + state.m_aircraftPitch = aircraftPitch; + } if ( !existingId || aircraftStateDateTimeChanged || (aircraftSelectedAltitude != state.m_aircraftState.m_selectedAltitude) @@ -670,6 +1211,35 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) insertProperty0(properties, "pfdTCASMode", dateTime, aircraftTCASMode); state.m_aircraftState.m_tcasMode = aircraftTCASMode; } + if ( !existingId + || aircraftStateDateTimeChanged + || (aircraftTcasRA != state.m_aircraftState.m_tcasRA) + ) + { + insertProperty0(properties, "pfdTcasRA", dateTime, aircraftTcasRA); + state.m_aircraftState.m_tcasRA = aircraftTcasRA; + } + if ( (!existingId && !aircraftTcasThreatIcao.isEmpty()) + || (aircraftTcasThreatIcao != state.m_aircraftState.m_tcasThreatIcao) + ) + { + insertConstantProperty(properties, "pfdThreatIcao", aircraftTcasThreatIcao); + state.m_aircraftState.m_tcasThreatIcao = aircraftTcasThreatIcao; + } + if ( (!existingId && (aircraftSquawk >= 0)) + || (aircraftSquawk != state.m_aircraftState.m_squawk) + ) + { + insertProperty0(properties, "pfdSquawk", dateTime, aircraftSquawk); + state.m_aircraftState.m_squawk = aircraftSquawk; + } + if ( (!existingId && !aircraftIcao.isEmpty()) + || (aircraftIcao != state.m_aircraftState.m_icao) + ) + { + insertConstantProperty(properties, "pfdIcao", aircraftIcao); + state.m_aircraftState.m_icao = aircraftIcao; + } if ( !existingId || aircraftStateDateTimeChanged || (aircraftWindSpeed != state.m_aircraftState.m_windSpeed) @@ -696,6 +1266,24 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) state.m_aircraftState.m_staticAirTemperature = aircraftStaticAirTemperature; } + QString ndPlan = flightPlanJson(mapItem->m_aircraftState->m_flightPlan); + if ( (!existingId && !ndPlan.isEmpty()) + || (existingId && (ndPlan != state.m_ndFlightPlan)) // Empty when a plan goes away, so the ND clears it + ) + { + insertConstantProperty(properties, "ndFlightPlan", ndPlan); + state.m_ndFlightPlan = ndPlan; + } + + QString dcduMessage = datalinkMessageJson(mapItem->m_aircraftState->m_datalinkMessage); + if ( (!existingId && !dcduMessage.isEmpty()) + || (existingId && (dcduMessage != state.m_dcduMessage)) + ) + { + insertConstantProperty(properties, "dcduMessage", dcduMessage); + state.m_dcduMessage = dcduMessage; + } + //QJsonObject speedProperty { // {"velocityReference", "#position"}, //}; @@ -708,18 +1296,51 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) state.m_aircraftStateDateTime = aircraftStateDateTime; } - if (properties.size() > 0) { - obj.insert("properties", properties); - } } - obj.insert("position", position); + // The engine sound looped at the item, which is on the item rather than the + // aircraft state, so it works for anything the sender knows a sound for + if ( (!existingId && !mapItem->m_loopSound.isEmpty()) + || (existingId && (mapItem->m_loopSound != state.m_loopSound)) + ) + { + insertConstantProperty(properties, "loopSound", mapItem->m_loopSound); + state.m_loopSound = mapItem->m_loopSound; + } + + if (properties.size() > 0) { + obj.insert("properties", properties); + } + + // ... while a moving aircraft still sends one every update, which is the point + if (!positionUnchanged) { + obj.insert("position", position); + } + if (!fixedPosition) { - if (mapItem->m_useHeadingPitchRoll) { - obj.insert("orientation", orientation); - } else { + // Orientation is a sampled property, so a sample Cesium already has is a no-op + // there - and a packet raised by something else, an altitude message say, + // carries the same sample as the last one. That was 36% of the orientations + // sent in a measured run, at ~190 bytes each. + if (mapItem->m_useHeadingPitchRoll) + { + const int extrapolate = mapItem->m_itemSettings->m_extrapolate; + if ( (state.m_orientationMode != 1) + || (quaternion != state.m_orientationQuaternion) + || (extrapolate != state.m_orientationExtrapolate)) + { + obj.insert("orientation", orientation); + state.m_orientationMode = 1; + state.m_orientationQuaternion = quaternion; + state.m_orientationExtrapolate = extrapolate; + } + } + else if (state.m_orientationMode != 0) // A reference to the position: constant + { obj.insert("orientation", orientationPosition); + state.m_orientationMode = 0; + state.m_orientationQuaternion = QJsonArray(); } } @@ -814,7 +1435,11 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) {"distanceDisplayCondition", labelDisplayDistance} }; - labelText.replace("<br>", "\n"); + // On a copy: replace() is in place, and the state must keep the raw text it is + // compared against, or the guard above never matches and the whole label - + // ~390 bytes of styling - goes out on every packet, as it did until measured + QString labelDisplayText = labelText; + labelDisplayText.replace("<br>", "\n"); QJsonObject label { //{"text", labelText}, {"show", labelShow}, @@ -829,14 +1454,14 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) }; if (!mapItem->m_labelDateTime.isValid()) { - label.insert("text", labelText); + label.insert("text", labelDisplayText); } else { - QString interval = mapItem->m_labelDateTime.toString(Qt::ISODateWithMs) + "/2999-12-31"; + QString interval = sampleTime(mapItem->m_labelDateTime.toString(Qt::ISODateWithMs)) + "/2999-12-31"; QJsonObject labelInterval { {"interval", interval}, - {"string", labelText} + {"string", labelDisplayText} }; QJsonArray labelIntervalArray { labelInterval @@ -940,6 +1565,15 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) && mapItem->m_itemSettings->m_display3DTrack && ( m_settings->m_displayAllGroundTracks || (m_settings->m_displaySelectedGroundTracks && isSelected)); + // When a palette is set - or the supplied track is smoothed - the track is + // drawn as polylines instead - see updateTrackSegments3D(). Items with a + // predicted track keep the path, which also draws the future leg. + if ( ( !mapItem->m_itemSettings->m_2DTrackPalette.isEmpty() + || ( (mapItem->m_itemSettings->m_smoothingWindow > 0) + && mapItem->m_trackSupplied)) + && mapItem->m_predictedTrackCoords.isEmpty()) { + pathShow = false; + } if ( !existingId || (pathColorInt != state.m_pathColorInt) @@ -979,31 +1613,24 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) } } - if (!fixedPosition) + // Availability, when it has changed. It moves on with each position - which is + // what keeps an aircraft that has gone quiet from being drawn for ever - but a + // packet raised by anything else carried the same interval again: 63% of them + QString availability; + if (!fixedPosition && (mapItem->m_takenTrackDateTimes.size() > 0) && (mapItem->m_predictedTrackDateTimes.size() > 0)) { - if (mapItem->m_takenTrackDateTimes.size() > 0 && mapItem->m_predictedTrackDateTimes.size() > 0) - { - QString availability = QString("%1/%2") - .arg(mapItem->m_takenTrackDateTimes.last()->toString(Qt::ISODateWithMs)) - .arg(mapItem->m_predictedTrackDateTimes.last()->toString(Qt::ISODateWithMs)); - obj.insert("availability", availability); - } - else - { - if (mapItem->m_availableUntil.isValid()) - { - QString period = QString("%1/%2").arg(state.m_firstSeenDateTime).arg(mapItem->m_availableUntil.toString(Qt::ISODateWithMs)); - obj.insert("availability", period); - } - } + availability = QString("%1/%2") + .arg(mapItem->m_takenTrackDateTimes.last()->toString(Qt::ISODateWithMs)) + .arg(mapItem->m_predictedTrackDateTimes.last()->toString(Qt::ISODateWithMs)); } - else + else if (mapItem->m_availableUntil.isValid()) { - if (mapItem->m_availableUntil.isValid()) - { - QString period = QString("%1/%2").arg(state.m_firstSeenDateTime).arg(mapItem->m_availableUntil.toString(Qt::ISODateWithMs)); - obj.insert("availability", period); - } + availability = QString("%1/%2").arg(state.m_firstSeenDateTime).arg(mapItem->m_availableUntil.toString(Qt::ISODateWithMs)); + } + if (!availability.isEmpty() && (availability != state.m_availability)) + { + obj.insert("availability", availability); + state.m_availability = availability; } m_lastPosition.insert(id, coords); } @@ -1013,12 +1640,6 @@ QJsonObject CZML::update(ObjectMapItem *mapItem, bool isTarget, bool isSelected) obj.insert("position", noPosition); } - // Use our own clipping routine, due to - // https://github.com/CesiumGS/cesium/issues/4049 - Has now been fixed - //if (mapItem->m_altitudeReference == 3) { - // obj.insert("altitudeReference", "CLIP_TO_GROUND"); - //} - //qDebug() << obj; /*if (id == "400b00") diff --git a/plugins/feature/map/czml.h b/plugins/feature/map/czml.h index 4dd949a15..26c5d6ce6 100644 --- a/plugins/feature/map/czml.h +++ b/plugins/feature/map/czml.h @@ -43,6 +43,18 @@ class CZML struct State { QString m_firstSeenDateTime; + // For the early-out in update(): what the item and its settings looked like the + // last time a packet was actually built for it + bool m_seen = false; + bool m_deleted = false; // Cesium has already been told to delete this one + quint32 m_settingsSignature = 0; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + float m_altitude = 0.0f; + QDateTime m_altitudeDateTime; // When m_altitude was set, to work out how fast it is being lost + QString m_lastLabel; + QString m_lastImage; + QString m_modelGLTF; int m_modelAltitudeReference; bool m_modelShow; @@ -66,6 +78,31 @@ class CZML QDateTime m_aircraftStateDateTime; MapAircraftState m_aircraftState; float m_aircraftRoll; + float m_aircraftPitch = 0.0f; + QString m_ndFlightPlan; // JSON, as last sent in the ndFlightPlan property + QString m_dcduMessage; // JSON, as last sent in the dcduMessage property + QString m_loopSound; // Sound-set directory or legacy file, as last sent + + // The 3D altitude coloured track, as last emitted - one polyline entity per + // altitude band, ids "<item name> t3d <n>". See updateTrackSegments3D(). + QString m_trackPalette; // Palette the segments were built with + int m_trackPointCount = 0; // Taken track points segmented so far + int m_trackLastColorIndex = -1; + QList<int> m_trackSegmentSizes; // Points per segment (boundary points repeated) + QList<int> m_trackSegmentBands; // Altitude band per segment + int m_trackSegmentsEmitted = 0; // Entities created in Cesium, for deletion + bool m_trackSegmentsShow = false; + QGeoCoordinate m_trackFirstCoord; // Trim/rebuild detection + QGeoCoordinate m_trackLastCoord; // Same-size provisional-tail replacement + quint64 m_trackRevision = 0; // Any rewrite, including timestamp-only changes + QDateTime m_trackTailEmit; // Throttle for the growing tail segment + + // Orientation and availability as last sent, so a packet raised by something + // else - a new altitude, say - does not carry them again unchanged + int m_orientationMode = -1; // -1 never sent, 0 velocityReference, 1 sampled quaternion + QJsonArray m_orientationQuaternion; + int m_orientationExtrapolate = -1; + QString m_availability; State() : m_modelAltitudeReference(0), @@ -88,6 +125,10 @@ class CZML private: const MapSettings *m_settings; QHash<QString, State> m_ids; + // Whether a delete needs sending for this id, and if so records that it has been + bool deleteNeeded(const QString& id); + // Records that Cesium has been told about this id, so a later delete is sent + void described(const QString& id); QHash<QString, QJsonArray> m_lastPosition; QHash<QString, bool> m_hasMoved; QGeoCoordinate m_position; @@ -98,7 +139,14 @@ private: public: CZML(const MapSettings *settings); QJsonObject init(); + // Forget everything cached about what Cesium has been told. Call whenever Cesium is + // made to drop its entities, or the next description of each one is a difference + // against a state that no longer exists there - see update(ObjectMapItem *). + void clear(); QJsonObject update(ObjectMapItem *mapItem, bool isTarget, bool isSelected); + // The altitude coloured track segments for the 3D map. Call BEFORE update(), which + // resets the item's cached state when the item is deleted. + QList<QJsonObject> updateTrackSegments3D(ObjectMapItem *mapItem, bool isSelected); QJsonObject update(PolygonMapItem *mapItem); QJsonObject update(PolylineMapItem *mapItem); bool filter(const MapItem *mapItem) const; diff --git a/plugins/feature/map/icons/flyby.png b/plugins/feature/map/icons/flyby.png new file mode 100644 index 000000000..89e16f5a1 Binary files /dev/null and b/plugins/feature/map/icons/flyby.png differ diff --git a/plugins/feature/map/icons/nd.png b/plugins/feature/map/icons/nd.png new file mode 100644 index 000000000..d3df90483 Binary files /dev/null and b/plugins/feature/map/icons/nd.png differ diff --git a/plugins/feature/map/map.cpp b/plugins/feature/map/map.cpp index 7623c9d37..1eb1ac8e6 100644 --- a/plugins/feature/map/map.cpp +++ b/plugins/feature/map/map.cpp @@ -109,8 +109,18 @@ bool Map::handleMessage(const Message& cmd) { // qDebug() << "Map::handleMessage: MsgMapItem"; MainCore::MsgMapItem& msgMapItem = (MainCore::MsgMapItem&) cmd; - MainCore::MsgMapItem *copy = new MainCore::MsgMapItem(msgMapItem); - getMessageQueueToGUI()->push(copy); + + if (getMessageQueueToGUI()) + { + // The GUI owns the item from here, and deletes it once the map has it + MainCore::MsgMapItem *copy = new MainCore::MsgMapItem(msgMapItem); + getMessageQueueToGUI()->push(copy); + } + else + { + // Nothing to display it, so it would otherwise be leaked + delete msgMapItem.getSWGMapItem(); + } return true; } else @@ -314,7 +324,13 @@ void Map::webapiFormatFeatureSettings( response.getMapSettings()->setDisplayMagDec(settings.m_displayMagDec ? 1 : 0); response.getMapSettings()->setDisplayMaidenheadGrid(settings.m_displayMaidenheadGrid ? 1 : 0); response.getMapSettings()->setDisplayPfd(settings.m_displayPFD ? 1 : 0); - response.getMapSettings()->setViewFirstPerson(settings.m_viewFirstPerson ? 1 : 0); + // The boolean this API field was built around became a three-valued camera mode + // (third person, first person, fly by). The field is kept working as it always did - + // true means first person - rather than dropped, which would break existing callers. + // Fly by is not reachable over the web API until the schema gains a cameraMode field, + // which needs a swagger regeneration. + response.getMapSettings()->setViewFirstPerson( + (settings.m_cameraMode == MapSettings::FirstPerson) ? 1 : 0); if (response.getMapSettings()->getDefaultImagery()) { *response.getMapSettings()->getDefaultImagery() = settings.m_defaultImagery; } else { @@ -464,8 +480,12 @@ void Map::webapiUpdateFeatureSettings( if (featureSettingsKeys.contains("displayPFD")) { settings.m_displayPFD = response.getMapSettings()->getDisplayPfd() != 0; } - if (featureSettingsKeys.contains("viewFirstPerson")) { - settings.m_viewFirstPerson = response.getMapSettings()->getViewFirstPerson() != 0; + if (featureSettingsKeys.contains("viewFirstPerson")) + { + // See webapiFormatFeatureSettings: clearing it returns to third person, which is + // what the boolean's false meant before the camera mode replaced it + settings.m_cameraMode = (response.getMapSettings()->getViewFirstPerson() != 0) + ? MapSettings::FirstPerson : MapSettings::ThirdPerson; } if (featureSettingsKeys.contains("defaultImagery")) { settings.m_defaultImagery = *response.getMapSettings()->getDefaultImagery(); @@ -610,7 +630,7 @@ void Map::webapiReverseSendSettings(const QList<QString>& featureSettingsKeys, c swgMapSettings->setDisplayPfd(settings.m_displayPFD); } if (featureSettingsKeys.contains("viewFirstPerson") || force) { - swgMapSettings->setViewFirstPerson(settings.m_viewFirstPerson); + swgMapSettings->setViewFirstPerson(settings.m_cameraMode == MapSettings::FirstPerson); } if (featureSettingsKeys.contains("defaultImagery") || force) { swgMapSettings->setDefaultImagery(new QString(settings.m_defaultImagery)); diff --git a/plugins/feature/map/map.h b/plugins/feature/map/map.h index 5ede97e65..2c15842ad 100644 --- a/plugins/feature/map/map.h +++ b/plugins/feature/map/map.h @@ -22,6 +22,7 @@ #define INCLUDE_FEATURE_MAP_H_ #include <QHash> +#include <QMultiHash> #include <QNetworkRequest> #include <QDateTime> #include <QRecursiveMutex> diff --git a/plugins/feature/map/map.qrc b/plugins/feature/map/map.qrc index e98695542..d359fee90 100644 --- a/plugins/feature/map/map.qrc +++ b/plugins/feature/map/map.qrc @@ -27,7 +27,11 @@ <file>map/waypoint.png</file> <file>map/pager.png</file> <file>map/map3d.html</file> + <file>map/aircraftaudio.js</file> <file>map/cockpit.js</file> + <file>map/navdisplay.js</file> + <file>map/rmp.js</file> + <file>map/dcdu.js</file> <file>map/grid.js</file> <file>data/transmitters.csv</file> </qresource> diff --git a/plugins/feature/map/map/aircraftaudio.js b/plugins/feature/map/map/aircraftaudio.js new file mode 100644 index 000000000..9328be1ea --- /dev/null +++ b/plugins/feature/map/map/aircraftaudio.js @@ -0,0 +1,232 @@ +/* + * Aircraft engine sound configuration support for the 3D Map. + * + * engine.json is a compact representation of the useful exterior portions of + * an FSX sound.cfg. This file deliberately contains no Cesium or WebAudio + * objects, so the curve and configuration handling stays easy to test. + */ +(function (global) { + "use strict"; + + const defaultFullScaleDistance = 50.0; + const configCache = new Map(); + + function finiteNumber(value, fallback) { + return (typeof value === "number") && Number.isFinite(value) ? value : fallback; + } + + function clamp(value, minimum, maximum) { + return Math.max(minimum, Math.min(maximum, value)); + } + + function safePathComponent(value, extension) { + return (typeof value === "string") + && (value.length > 0) + && (value !== ".") + && (value !== "..") + && !value.includes("..") + && /^[A-Za-z0-9._-]+$/.test(value) + && ((extension === undefined) || value.toLowerCase().endsWith(extension)); + } + + function normalizeCurve(value, description, minimumOutput, maximumOutput) { + if (!Array.isArray(value) || (value.length === 0)) { + throw new Error(description + " must contain at least one point"); + } + + const curve = value.map((point) => { + if (!Array.isArray(point) || (point.length !== 2) + || !Number.isFinite(point[0]) || !Number.isFinite(point[1])) { + throw new Error(description + " contains an invalid point"); + } + if ((point[0] < 0.0) || (point[0] > 1.0) + || (point[1] < minimumOutput) || (point[1] > maximumOutput)) { + throw new Error(description + " contains a point outside its allowed range"); + } + return [point[0], point[1]]; + }); + curve.sort((a, b) => a[0] - b[0]); + return curve; + } + + function normalizeLayer(value, kind, index) { + if ((value === null) || (typeof value !== "object")) { + throw new Error(kind + " layer " + index + " is not an object"); + } + if (!safePathComponent(value.filename, ".ogg")) { + throw new Error(kind + " layer " + index + " has an unsafe or non-OGG filename"); + } + + const hasCompleteCone = Number.isFinite(value.conePitch) + && Number.isFinite(value.coneHeading) + && Number.isFinite(value.insideConeAngle) + && Number.isFinite(value.outsideConeAngle) + && Number.isFinite(value.outsideConeVolume); + let insideConeAngle = hasCompleteCone ? clamp(value.insideConeAngle, 0.0, 360.0) : 360.0; + let outsideConeAngle = hasCompleteCone ? clamp(value.outsideConeAngle, 0.0, 360.0) : 360.0; + outsideConeAngle = Math.max(insideConeAngle, outsideConeAngle); + + return { + id: (typeof value.id === "string") ? value.id : kind.toUpperCase() + "." + (index + 1), + kind: kind, + filename: value.filename, + vparams: normalizeCurve(value.vparams, value.filename + " vparams", 0.0, 100.0), + // Some FSX layers explicitly use a zero rate at zero spool. The matching + // volume is silent there, and WebAudio accepts a zero playback rate. + rparams: normalizeCurve(value.rparams, value.filename + " rparams", 0.0, 8.0), + spatial: { + conePitch: hasCompleteCone ? value.conePitch : 0.0, + coneHeading: hasCompleteCone ? value.coneHeading : 0.0, + insideConeAngle: insideConeAngle, + outsideConeAngle: outsideConeAngle, + outsideConeVolume: hasCompleteCone ? clamp(value.outsideConeVolume, 0.0, 10000.0) : 10000.0, + fullScaleDistance: (Number.isFinite(value.fullScaleDistance) && (value.fullScaleDistance > 0.0)) + ? value.fullScaleDistance : defaultFullScaleDistance + } + }; + } + + function normalizeConfiguration(value, name) { + if ((value === null) || (typeof value !== "object")) { + throw new Error(name + " engine.json is not an object"); + } + if (value.formatVersion !== 1) { + throw new Error(name + " engine.json has unsupported formatVersion " + value.formatVersion); + } + + const n1 = Array.isArray(value.n1) ? value.n1.map((layer, index) => normalizeLayer(layer, "n1", index)) : []; + const n2 = Array.isArray(value.n2) ? value.n2.map((layer, index) => normalizeLayer(layer, "n2", index)) : []; + if ((n1.length + n2.length) === 0) { + throw new Error(name + " engine.json contains no N1 or N2 layers"); + } + + return { + formatVersion: 1, + numberOfEngines: finiteNumber(value.numberOfEngines, 1), + engine: finiteNumber(value.engine, 1), + layers: n1.concat(n2) + }; + } + + function configurationBaseURL(name) { + if (!safePathComponent(name)) { + throw new Error("Unsafe engine sound set name " + name); + } + return "/3d/Sounds/" + encodeURIComponent(name) + "/"; + } + + function loadConfiguration(name) { + if (!configCache.has(name)) { + let baseURL; + try { + baseURL = configurationBaseURL(name); + } catch (e) { + return Promise.reject(e); + } + const request = fetch(baseURL + "engine.json") + .then((response) => { + if (!response.ok) { + throw new Error("HTTP " + response.status + " loading " + baseURL + "engine.json"); + } + return response.json(); + }) + .then((value) => { + const configuration = normalizeConfiguration(value, name); + configuration.baseURL = baseURL; + return configuration; + }) + .catch((e) => { + configCache.delete(name); // An install completed while the Map is open can be retried + throw e; + }); + configCache.set(name, request); + } + return configCache.get(name); + } + + function interpolateCurve(curve, input) { + const x = clamp(finiteNumber(input, 0.0), 0.0, 1.0); + if (x <= curve[0][0]) { + return curve[0][1]; + } + for (let i = 1; i < curve.length; i++) { + if (x <= curve[i][0]) { + const previous = curve[i - 1]; + const next = curve[i]; + if (next[0] === previous[0]) { + return next[1]; + } + const fraction = (x - previous[0]) / (next[0] - previous[0]); + return previous[1] + fraction * (next[1] - previous[1]); + } + } + return curve[curve.length - 1][1]; + } + + // FSX volume curves are linear power percentages: 50 is approximately -3 dB. + function volumePercentToGain(value) { + return Math.sqrt(clamp(finiteNumber(value, 0.0), 0.0, 100.0) / 100.0); + } + + // OutsideConeVolume is hundredths of a decibel below the 10000 full-volume value. + function outsideConeVolumeToGain(value) { + const volume = clamp(finiteNumber(value, 10000.0), 0.0, 10000.0); + return volume <= 0.0 ? 0.0 : Math.pow(10.0, (volume - 10000.0) / 2000.0); + } + + function estimateEngineState(property) { + const onSurface = property("pfdOnSurface"); + const groundspeedValue = property("pfdGroundspeed"); + const groundspeed = Number.isFinite(groundspeedValue) ? Math.max(0.0, groundspeedValue) : 0.0; + + if (Number.isFinite(onSurface) && (onSurface > 0)) { + if (groundspeed > 60.0) { + return { n1: 0.98, n2: 0.98 }; // Take-off roll + } + if (groundspeed > 15.0) { + const fraction = clamp((groundspeed - 15.0) / 45.0, 0.0, 1.0); + return { n1: 0.28 + 0.32 * fraction, n2: 0.62 + 0.22 * fraction }; + } + return { n1: 0.20, n2: 0.55 }; // Parked or taxi idle + } + + const verticalSpeed = property("pfdVerticalSpeed"); + if (Number.isFinite(verticalSpeed)) { + if (verticalSpeed > 500.0) { + return { n1: 0.90, n2: 0.95 }; // Climb + } + if (verticalSpeed < -500.0) { + return { n1: 0.34, n2: 0.68 }; // Descent or approach + } + } + return { n1: 0.78, n2: 0.90 }; // Cruise, or the best airborne estimate + } + + function smoothEngineState(current, target, elapsedSeconds) { + if (current === undefined) { + return { n1: target.n1, n2: target.n2 }; + } + const alpha = 1.0 - Math.exp(-clamp(finiteNumber(elapsedSeconds, 0.25), 0.0, 2.0) / 2.5); + current.n1 += (target.n1 - current.n1) * alpha; + current.n2 += (target.n2 - current.n2) * alpha; + return current; + } + + function spatialProfileKey(spatial) { + return [spatial.conePitch, spatial.coneHeading, spatial.insideConeAngle, + spatial.outsideConeAngle, spatial.outsideConeVolume, spatial.fullScaleDistance].join("|"); + } + + global.AircraftAudio = Object.freeze({ + defaultFullScaleDistance: defaultFullScaleDistance, + configurationBaseURL: configurationBaseURL, + loadConfiguration: loadConfiguration, + normalizeConfiguration: normalizeConfiguration, + interpolateCurve: interpolateCurve, + volumePercentToGain: volumePercentToGain, + outsideConeVolumeToGain: outsideConeVolumeToGain, + estimateEngineState: estimateEngineState, + smoothEngineState: smoothEngineState, + spatialProfileKey: spatialProfileKey + }); +})(window); diff --git a/plugins/feature/map/map/cockpit.js b/plugins/feature/map/map/cockpit.js index 0214cb1a9..ded7ec257 100644 --- a/plugins/feature/map/map/cockpit.js +++ b/plugins/feature/map/map/cockpit.js @@ -1,4 +1,5 @@ -// Airbus like PFD (Primary Flight Display) +// PFD (Primary Flight Display) - Airbus (A320) style by default, Boeing (737NG/777) +// style when the selected aircraft's type is a Boeing. See the themes below cockpitThemeFor() var icao; var callsign; @@ -7,8 +8,6 @@ var onSurface; var wasOnSurface60SecsAgo; var speed; var modelSpeed; // Speed of 3D model in Cesium -var trueAirspeed; -var groundspeed; var targetSpeed; var altitude; var targetAltitude; @@ -23,29 +22,324 @@ var roll; var autopilot; var verticalMode; var lateralMode; -var tcasMode; -var windSpeed; -var windDirection; -var staticAirTemperature; -var mdoelSpeed; var toga = false; var rollOut = false; var runwayAltitude; +// State for the aural callouts, so each one is played once, on a crossing +var previousRadioAltitude; +var previousSpeed; +// TCAS resolution advisory bitfield: bit 0 active, 1 corrective, 2 downward sense, +// 3 positive, 4 clear of conflict, 5 multiple threats. The previous value gives the +// edges the aurals fire on +var tcasRA = 0; +var previousTcasRA = 0; +// Lowest first, so when more than one threshold is crossed between radio altitude +// updates only the lowest - the most urgent - is called +const radioAltCallouts = [5, 10, 30, 40, 50, 100, 500, 1000, 2500]; + +// The audio files are served from the qrc audio directory, a sibling of the +// directory map3d.html is in +function pfdPlayAudio(name) { + try { + const audio = new Audio("../audio/" + name); + // The cockpit volume slider in Map Display Settings - map3d.html holds the value + audio.volume = (typeof cockpitSoundVolume !== "undefined") ? cockpitSoundVolume : 1.0; + // play() returns a promise, which rejects rather than throws on failure + audio.play().catch((e) => { + console.log("PFD audio " + name + " failed: " + e); + }); + } catch (e) { + console.log("PFD audio failed: " + e); + } +} + +function pfdIsAirbus(type) { + // ICAO type designators: the A3xx families plus the A320neo family A19N/A20N/A21N + return (type !== undefined) && (/^A3[0-9][0-9]/.test(type) || /^A(19|20|21)N/.test(type)); +} + const grayColor = "#6A75AE"; +const redColor = "#FC2020"; const greenColor = "#20E966"; const cyanColor = "#2FF7FE"; const yellowColor = "#F4F82F"; const orangeColor = "#FEDA30"; const skyColor = "#26C9FF"; const groundColor = "#D35E34"; +const magentaColor = "#FF2CF5"; + +// Manufacturer look. Everything that differs between an Airbus and a Boeing display - +// colours, symbols, mode vocabulary, layout - comes from one of these two themes, +// chosen from the selected aircraft's ICAO type. Airbus is the default for every other +// type. navdisplay.js (loaded after this file) uses the nd section +const airbusTheme = { + name: "airbus", + sky: skyColor, + ground: groundColor, + tape: grayColor, // Tape backgrounds (speed, altitude, heading, VSI) + symbolColor: yellowColor, // Aircraft symbol, pointers, lubber line, zero marker + targetColor: cyanColor, // Selected speed / altitude / heading + readoutColor: greenColor, // Current altitude digits + readoutBoxColor: yellowColor, + vsiColor: greenColor, + machColor: greenColor, + raltColor: greenColor, + raltLowColor: orangeColor, // Radio altitude below 100 ft + baroColor: cyanColor, + baroBox: true, // STD in a box + armedColor: cyanColor, // Armed FMA modes + adi: "circle", // Attitude indicator outline + vsi: "airbus", // Filled strip, or a Boeing outline + tapeTop: 250, // Speed and altitude tapes, which on a Boeing are + tapeHeight: 500, // taller than the attitude indicator between them + vsiTop: 190, + vsiHeight: 620, + vsiSpacing: 35, // Per marker on the vertical speed scale + machY: 840, + baroY: 850, // Clear of the off-scale selected altitude above it + trendColor: yellowColor, // Speed trend vector + altitudeLabels: "fl", // Flight levels on the tape, or full altitudes + fdLabel: undefined, // Boeing annunciates the flight director in words + headingReadout: false, // Digits under the heading display + wingHeight: 35, // Aircraft symbol: length of the inner leg + wingThickness: 14, + fmaTcas: true, // TCAS annunciated as a vertical mode + fdColor: greenColor, // Flight director cross bars + pitchBrackets: true, // The green brackets at -15 deg pitch + bankBoxes: true, // Bank angle graduations as boxes, or plain ticks + bankArc: true, // An arc drawn through the bank graduations + rollPointer: true, // Fixed zero bank index above the scale + headingBackground: false, // Grey behind the heading display, as the tapes have + speedReadout: "pointer", // Current speed as a pointer onto the tape + headingStyle: "tape", // Heading tape under the ADI + fmaHighlight: false, // Box a mode for 10 s after it changes + landingSpans: true, // LAND / FLARE / ROLL OUT span both mode columns + verticalX: 290, // FMA column for the vertical (pitch) mode + lateralX: 510, // FMA column for the lateral (roll) mode + labels: { + speed: "SPEED", toga: "TOGA", clb: "CLB", des: "DES", alt: "ALT", gs: "G/S", + land: "LAND", flare: "FLARE", rollout: "ROLL OUT", nav: "NAV", loc: "LOC" + }, + nd: { + lubber: yellowColor, + compassTicks: "outward", // Graduations point out of the compass ring + rangeRings: "dashed", + aircraft: "airbus", // Stick aircraft + track: greenColor, + trackDiamond: true, + route: greenColor, // Route legs + activeRoute: "white", // The leg to the active waypoint + waypoint: greenColor, // Waypoint symbols and names + activeWaypoint: "white", + selectedHeading: cyanColor, + selectedHeadingLine: false, // Dashed line from own ship to the bug + headingBox: "airbus", // Grey box with the digits + rangeLabel: cyanColor, + airports: cyanColor, + airportSymbol: "star", + navaids: "white", + dataValue: greenColor, // GS / TAS / wind / distance values + unit: cyanColor, + waypointIdent: "white", // Active waypoint ident, top right + showSat: true, + showDepArr: true, + tcas: "airbus" // TCAS STBY / TA ONLY / TCAS RA box + } +}; + +const boeingTheme = { + name: "boeing", + sky: "#2C7FD6", + ground: "#A87A31", + tape: "#3A3A44", + symbolColor: "white", + targetColor: magentaColor, + readoutColor: "white", + readoutBoxColor: "white", + vsiColor: "white", + machColor: "white", + raltColor: "white", + raltLowColor: "white", + baroColor: greenColor, + baroBox: false, + armedColor: "white", + adi: "rounded", // Rounded square, not a circle + vsi: "boeing", // Outlined scale, not a filled strip + tapeTop: 165, // Taller than the 500 the attitude indicator spans, + tapeHeight: 670, // and centred on it + vsiTop: 150, + vsiHeight: 700, + vsiSpacing: 40, + machY: 875, + baroY: 895, + trendColor: greenColor, + altitudeLabels: "full", + fdLabel: "FLT DIR", + headingReadout: true, + wingHeight: 22, // Shorter, thicker wings than the Airbus symbol + wingThickness: 18, + fmaTcas: false, // Boeing does not annunciate TCAS on the FMA + fdColor: magentaColor, // Flight director cross bars + pitchBrackets: false, + bankBoxes: false, + bankArc: false, + rollPointer: false, // Boeing reads bank off the moving pointer alone, + // which keeps the scale clear of FLT DIR above it + headingBackground: true, + speedReadout: "box", // Current speed boxed on the tape + headingStyle: "arc", // Partial compass under the ADI + fmaHighlight: true, + landingSpans: false, // FLARE is a pitch mode, ROLLOUT a roll mode + verticalX: 510, // Boeing: roll left of pitch + lateralX: 290, + labels: { + speed: "SPD", toga: "TO/GA", clb: "VNAV SPD", des: "VNAV PTH", alt: "ALT", gs: "G/S", + land: "G/S", flare: "FLARE", rollout: "ROLLOUT", nav: "LNAV", loc: "LOC" + }, + nd: { + lubber: "white", + compassTicks: "inward", + rangeRings: "solid", + aircraft: "boeing", // Triangle + track: "white", + trackDiamond: false, + route: magentaColor, + activeRoute: magentaColor, + waypoint: "white", + activeWaypoint: magentaColor, + selectedHeading: magentaColor, + selectedHeadingLine: true, + headingBox: "boeing", // HDG xxx MAG + rangeLabel: "white", + airports: cyanColor, + airportSymbol: "circle", + navaids: cyanColor, + dataValue: "white", + unit: "white", + waypointIdent: magentaColor, + showSat: false, + showDepArr: false, + tcas: "boeing" // TRAFFIC / TCAS OFF / TA ONLY + } +}; + +function pfdIsBoeing(type) { + // ICAO type designators: B7xx (B737-B789, B77W, B78X, B712...) and the 737 MAX B3xM + return (type !== undefined) && (/^B7[0-9][0-9]/.test(type) || /^B3[0-9X]M/.test(type)); +} + +function cockpitThemeFor(type) { + return pfdIsBoeing(type) ? boeingTheme : airbusTheme; +} + +var pfdTheme = airbusTheme; + +// --------------------------------------------------------------------------------- +// TCAS altitude inhibit. Near the ground a resolution advisory could fly the aircraft +// into terrain, and the ordinary traffic on and around a runway would raise advisories +// continuously, so TCAS II suppresses RAs and its aural annunciations below a height +// above ground. Traffic advisories are still shown - the symbols are useful on the +// approach and the departure - they just stop speaking. +// The PFD and the ND always show the same aircraft, so the inhibit is worked out from +// whichever of them is being updated and read by both + +const tcasInhibitHeight = 1000; // ft AGL +var tcasInhibited = false; + +// radioAlt in feet AGL, onGround the aircraft's on-surface flag. Either may be unknown, +// in which case the last answer stands rather than TCAS being silently disabled +function updateTcasInhibit(radioAlt, onGround) { + if (onGround > 0) { + tcasInhibited = true; + } else if (radioAlt !== undefined) { + tcasInhibited = (radioAlt < tcasInhibitHeight); + } + return tcasInhibited; +} + +// --------------------------------------------------------------------------------- +// Cockpit panel furniture shared by the PFD, ND, EFIS, RMP and DCDU. Each is drawn in +// a 1000-unit wide logical space whose aspect ratio matches its displayed size, so one +// rectangle puts an equally sized close button in the top right corner of any of them + +const panelCloseRect = { x: 956, y: 6, w: 32, h: 32 }; + +function panelDrawClose(ctx) { + const r = panelCloseRect; + ctx.fillStyle = "#26262E"; + ctx.fillRect(r.x, r.y, r.w, r.h); + ctx.strokeStyle = "#8A8A95"; + ctx.lineWidth = 2; + ctx.strokeRect(r.x, r.y, r.w, r.h); + ctx.beginPath(); + ctx.moveTo(r.x + 9, r.y + 9); + ctx.lineTo(r.x + r.w - 9, r.y + r.h - 9); + ctx.moveTo(r.x + r.w - 9, r.y + 9); + ctx.lineTo(r.x + 9, r.y + r.h - 9); + ctx.strokeStyle = "white"; + ctx.lineWidth = 3; + ctx.stroke(); +} + +function panelInClose(x, y) { + const r = panelCloseRect; + return (x >= r.x) && (x < r.x + r.w) && (y >= r.y) && (y < r.y + r.h); +} + +// No socket in a test harness +function panelSend(obj) { + if ((typeof socket !== "undefined") && socket) { + socket.send(JSON.stringify(obj)); + } +} + +// Closing a panel is remembered: the GUI unticks it in the toolbar panel menu and it +// stays closed until it is asked for again +function panelClose(name, canvas) { + canvas.setAttribute("hidden", "hidden"); + panelSend({ event: "panelClosed", panel: name }); +} + +// Where the panel was left, in CSS pixels, saved at the end of a drag or a resize. +// A click that moved nothing reports nothing - it would only rewrite the same setting +const panelLastGeometry = new Map(); + +function panelSaveGeometry(name, canvas) { + const r = canvas.getBoundingClientRect(); + const key = Math.round(r.left) + "," + Math.round(r.top) + "," + Math.round(r.width) + "," + Math.round(r.height); + if (panelLastGeometry.get(name) === key) { + return; + } + panelLastGeometry.set(name, key); + panelSend({ + event: "panelGeometry", panel: name, + left: Math.round(r.left), top: Math.round(r.top), + width: Math.round(r.width), height: Math.round(r.height) + }); +} + +function panelApplyGeometry(canvas, g) { + if ((canvas === null) || (canvas === undefined) || (g === undefined) || (g === null)) { + return; + } + if ((g.w > 0) && (g.h > 0)) { + canvas.style.width = g.w + "px"; + canvas.style.height = g.h + "px"; + } + if ((g.l !== undefined) && (g.t !== undefined)) { + // Clamped, so a panel saved against a larger window is still reachable + canvas.style.position = "absolute"; + canvas.style.left = Math.max(0, Math.min(g.l, window.innerWidth - 80)) + "px"; + canvas.style.top = Math.max(0, Math.min(g.t, window.innerHeight - 40)) + "px"; + } +} function setPFDData(forward, newICAO, newCallsign, newAircraftType, newOnSurface, newWasOnSurface60SecsAgo, newRunwayAltitudeEstimate, - newModelSpeed, newIndicatedAirspeed, newTrueAirspeed, newGroundspeed, newMach, newAltitude, newRadioAltitude, newQnh, newVerticalSpeed, + newModelSpeed, newIndicatedAirspeed, newGroundspeed, newMach, newAltitude, newRadioAltitude, newQnh, newVerticalSpeed, newHeading, newTrack, newRoll, newSelectedAltitude, newSelectedHeading, - newAutopilot, newVerticalMode, newLateralMode, newTCASMode, - newWindSpeed, newWindDirection, newStaticAirTemperature) { + newAutopilot, newVerticalMode, newLateralMode, newTcasRA, newPitch) { //console.log('PFD', newIndicatedAirspeed, newMach, newAltitude, newQnh, newVerticalSpeed, newHeading, newTrack, newRoll, newSelectedAltitude, newSelectedHeading); @@ -55,11 +349,21 @@ function setPFDData(forward, newICAO, newCallsign, newAircraftType, newOnSurface toga = false; rollOut = false; runwayAltitude = undefined; + previousRadioAltitude = undefined; + previousSpeed = undefined; + previousTcasRA = 0; + // Height above ground is unknown for a moment after a selection change, and the + // inhibit holds its last answer while it is - which would be the old aircraft's + tcasInhibited = false; + pfdPitch = 0; + pfdFmaState = {}; + trendReset(); } icao = newICAO; callsign = newCallsign; aircraftType = newAircraftType; + pfdTheme = cockpitThemeFor(aircraftType); onSurface = newOnSurface; wasOnSurface60SecsAgo = newWasOnSurface60SecsAgo; modelSpeed = newModelSpeed; @@ -73,13 +377,12 @@ function setPFDData(forward, newICAO, newCallsign, newAircraftType, newOnSurface } else { speed = newIndicatedAirspeed; } - trueAirspeed = newTrueAirspeed; - groundspeed = newGroundspeed; mach = newMach; altitude = newAltitude; radioAltitude = newRadioAltitude; pressure = newQnh; verticalSpeed = newVerticalSpeed; + reportedPitch = newPitch; if (newHeading === undefined) { heading = newTrack; // Track more frequent than heading } else { @@ -96,10 +399,15 @@ function setPFDData(forward, newICAO, newCallsign, newAircraftType, newOnSurface } verticalMode = newVerticalMode; lateralMode = newLateralMode; - tcasMode = newTCASMode; - windSpeed = newWindSpeed; - windDirection = newWindDirection; - staticAirTemperature = newStaticAirTemperature; + tcasRA = (newTcasRA === undefined) ? 0 : newTcasRA; + // Below the inhibit height the RA is dropped entirely, so neither the flight mode + // annunciator nor the vertical speed guidance bands show one + if (updateTcasInhibit(radioAltitude, onSurface)) { + tcasRA = 0; + } + + updateSpeedTrend(forward); + updatePitch(); // Correct altitude for QNH setting if (pressure !== undefined) { @@ -130,6 +438,103 @@ function setPFDData(forward, newICAO, newCallsign, newAircraftType, newOnSurface if (toga && (runwayAltitude === undefined) && (newRunwayAltitudeEstimate !== undefined)) { runwayAltitude = newRunwayAltitudeEstimate; } + + // Aural callouts. setPFDData only runs while the PFD is displayed, so they are + // only heard when it is. Each fires on a crossing in the direction flown, so + // nothing repeats and playback in reverse is silent. + if (forward) + { + // Radio altitude callouts on approach + if ((radioAltitude !== undefined) && (previousRadioAltitude !== undefined) + && (radioAltitude < previousRadioAltitude)) + { + for (const callout of radioAltCallouts) + { + if ((previousRadioAltitude > callout) && (radioAltitude <= callout)) + { + pfdPlayAudio(callout + ".wav"); + break; + } + } + // The RETARD callout, which only Airbus aircraft make + if ((previousRadioAltitude > 20) && (radioAltitude <= 20) && pfdIsAirbus(aircraftType)) { + pfdPlayAudio("retard.wav"); + } + } + // V1 when accelerating through 120 knots on the takeoff roll + if ((speed !== undefined) && (previousSpeed !== undefined) && (onSurface > 0) + && (previousSpeed < 120) && (speed >= 120)) { + pfdPlayAudio("v1.wav"); + } + // TCAS resolution advisory aurals: the RA sound on becoming active or on a + // change of sense while active, clear of conflict when it ends (whether + // signalled as terminated or simply no longer broadcast). Silent below the + // inhibit height, including the clear of conflict the inhibit itself provokes + // by zeroing the RA + const raActive = (tcasRA & 1) !== 0; + const previousRaActive = (previousTcasRA & 1) !== 0; + if (tcasInhibited) + { + // Nothing to say + } + else if (raActive && (!previousRaActive || ((tcasRA & 70) !== (previousTcasRA & 70)))) + { + if ((tcasRA & 2) && !(tcasRA & 64)) { + pfdPlayAudio((tcasRA & 4) ? "descend.wav" : "climb.wav"); + } else { + pfdPlayAudio("traffic.wav"); + } + } + else if (!raActive && previousRaActive) + { + pfdPlayAudio("clear-of-conflict.wav"); + } + } + previousRadioAltitude = radioAltitude; + previousSpeed = speed; + previousTcasRA = tcasRA; +} + +// --------------------------------------------------------------------------------- +// Speed trend vector: where the speed will be in ten seconds at the current +// acceleration. ADS-B carries no acceleration, so it is differentiated from the speed +// itself - reports arrive every few seconds and are quantised, so each sample spans at +// least one report and the result is smoothed before it is drawn + +const trendSeconds = 10; +const trendMinKnots = 6; // Below this the arrow is not worth drawing +const trendInterval = 2000; // Milliseconds a sample spans, so it covers a report +const trendSmoothing = 0.3; +var trendAcceleration = 0; // Knots per second +var trendLastSpeed; +var trendLastTime; + +function trendReset() { + trendAcceleration = 0; + trendLastSpeed = undefined; + trendLastTime = undefined; +} + +function updateSpeedTrend(forward) { + // Nothing to predict when the track is being played backwards + if (!forward || (speed === undefined) || isNaN(speed)) { + trendReset(); + return; + } + const now = Date.now(); + if (trendLastSpeed === undefined) { + trendLastSpeed = speed; + trendLastTime = now; + return; + } + const dt = now - trendLastTime; + if (dt < trendInterval) { + return; + } + const acceleration = (speed - trendLastSpeed) / (dt / 1000); + trendAcceleration = trendAcceleration * (1 - trendSmoothing) + acceleration * trendSmoothing; + trendLastSpeed = speed; + trendLastTime = now; } function isStd() { @@ -140,15 +545,15 @@ function drawAirspeedIndicator(ctx, fm20, fm30) { // Airspeed indicator const speedIndWidth = 100; - const speedIndHeight = 500; + const speedIndHeight = pfdTheme.tapeHeight; const speedIndLeft = 30; const speedIndRight = speedIndLeft + speedIndWidth; - const speedIndTop = 250; + const speedIndTop = pfdTheme.tapeTop; const speedIndBottom = speedIndTop + speedIndHeight; const speedIndMid = speedIndTop + speedIndHeight / 2; // Background - ctx.fillStyle = grayColor; + ctx.fillStyle = pfdTheme.tape; ctx.fillRect(speedIndLeft, speedIndTop, speedIndWidth, speedIndHeight); // Clip speed tape @@ -166,8 +571,8 @@ function drawAirspeedIndicator(ctx, fm20, fm30) { const speedPerPixel = speedTapeSpacing / speedTapeStep; const speedOffset = (speed % speedTextStep) * speedPerPixel; ctx.beginPath(); - var speedTape = Math.round(speed - speed % speedTextStep + 6 * speedTapeStep); - for (var i = -6; i < 5; i++) { + var speedTape = Math.round(speed - speed % speedTextStep + 8 * speedTapeStep); + for (var i = -8; i < 8; i++) { if (speedTape >= speedTapMinSpeed) { ctx.moveTo(speedTapeLeft, speedOffset + i * speedTapeSpacing + speedIndMid); ctx.lineTo(speedTapeRight, speedOffset + i * speedTapeSpacing + speedIndMid); @@ -179,8 +584,8 @@ function drawAirspeedIndicator(ctx, fm20, fm30) { ctx.stroke(); // Speeds every 20knts - var speedText = Math.round(speed - speed % speedTextStep + 3 * speedTextStep); - for (var i = -3; i < 3; i++) { + var speedText = Math.round(speed - speed % speedTextStep + 4 * speedTextStep); + for (var i = -4; i < 4; i++) { ctx.font = "30px Arial"; ctx.fillStyle = "white"; if (speedText >= speedTapMinSpeed) { @@ -209,22 +614,74 @@ function drawAirspeedIndicator(ctx, fm20, fm30) { ctx.stroke(); // Speed indicator - ctx.beginPath(); - ctx.moveTo(speedIndLeft - 10, speedIndMid); - ctx.lineTo(speedIndLeft, speedIndMid); - ctx.moveTo(speedTapeLeft - 5, speedIndMid); - ctx.lineTo(speedTapeRight + 20, speedIndMid); - ctx.lineWidth = 2; - ctx.strokeStyle = yellowColor; - ctx.stroke(); + if (pfdTheme.speedReadout === "box") { + // Boeing: the current speed in a box over the tape, pointing at it + const boxHeight = 56; + const boxLeft = speedIndLeft - 10; + const boxRight = speedIndRight + 5; + ctx.beginPath(); + ctx.moveTo(boxLeft, speedIndMid - boxHeight / 2); + ctx.lineTo(boxRight, speedIndMid - boxHeight / 2); + ctx.lineTo(boxRight, speedIndMid - 12); + ctx.lineTo(boxRight + 18, speedIndMid); + ctx.lineTo(boxRight, speedIndMid + 12); + ctx.lineTo(boxRight, speedIndMid + boxHeight / 2); + ctx.lineTo(boxLeft, speedIndMid + boxHeight / 2); + ctx.closePath(); + ctx.fillStyle = "black"; + ctx.fill(); + ctx.lineWidth = 3; + ctx.strokeStyle = "white"; + ctx.stroke(); + if ((speed !== undefined) && !isNaN(speed)) { + ctx.font = "36px Arial"; + ctx.fillStyle = "white"; + const speedString = Math.round(speed).toString().padStart(3, '0'); + const speedMetrics = ctx.measureText(speedString); + ctx.fillText(speedString, boxRight - 8 - speedMetrics.width, speedIndMid + speedMetrics.actualBoundingBoxAscent / 2); + } + } else { + ctx.beginPath(); + ctx.moveTo(speedIndLeft - 10, speedIndMid); + ctx.lineTo(speedIndLeft, speedIndMid); + ctx.moveTo(speedTapeLeft - 5, speedIndMid); + ctx.lineTo(speedTapeRight + 20, speedIndMid); + ctx.lineWidth = 2; + ctx.strokeStyle = pfdTheme.symbolColor; + ctx.stroke(); - ctx.beginPath(); - ctx.moveTo(speedTapeRight + 10, speedIndMid); - ctx.lineTo(speedTapeRight + 35, speedIndMid - 10); - ctx.lineTo(speedTapeRight + 35, speedIndMid + 10); - ctx.lineTo(speedTapeRight + 10, speedIndMid); - ctx.fillStyle = yellowColor; - ctx.fill(); + ctx.beginPath(); + ctx.moveTo(speedTapeRight + 10, speedIndMid); + ctx.lineTo(speedTapeRight + 35, speedIndMid - 10); + ctx.lineTo(speedTapeRight + 35, speedIndMid + 10); + ctx.lineTo(speedTapeRight + 10, speedIndMid); + ctx.fillStyle = pfdTheme.symbolColor; + ctx.fill(); + } + + // Speed trend vector, from beside the readout to the speed ten seconds ahead + const trendKnots = trendAcceleration * trendSeconds; + if (Math.abs(trendKnots) >= trendMinKnots) { + const up = (trendKnots > 0) ? -1 : 1; // Faster is up the tape + const trendX = speedIndRight + 10; + const trendFrom = speedIndMid + up * 30; + const trendTo = Math.max(speedIndTop, Math.min(speedIndBottom, + speedIndMid - trendKnots * speedPerPixel)); + ctx.strokeStyle = pfdTheme.trendColor; + ctx.fillStyle = pfdTheme.trendColor; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(trendX, trendFrom); + ctx.lineTo(trendX, trendTo); + ctx.stroke(); + // Arrow head at the predicted speed + ctx.beginPath(); + ctx.moveTo(trendX, trendTo); + ctx.lineTo(trendX - 7, trendTo - 14 * up); + ctx.lineTo(trendX + 7, trendTo - 14 * up); + ctx.closePath(); + ctx.fill(); + } // Target speed @@ -234,14 +691,14 @@ function drawAirspeedIndicator(ctx, fm20, fm30) { if (targetSpeedY < speedIndTop) { // Target speed as text on top ctx.font = "20px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetSpeedMetrics = ctx.measureText(targetSpeed); ctx.fillText(targetSpeed, speedIndRight - targetSpeedMetrics.width / 2, speedIndTop - 4); } else if (targetSpeedY > speedIndBottom) { // Target speed as text underneath ctx.font = "20px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetSpeedMetrics = ctx.measureText(targetSpeed); ctx.fillText(targetSpeed, speedIndRight - targetSpeedMetrics.width / 2, speedIndBottom + fm20.actualBoundingBoxAscent + 4); } else { @@ -257,7 +714,7 @@ function drawAirspeedIndicator(ctx, fm20, fm30) { ctx.lineTo(targetSpeedRight, targetSpeedY + targetSpeedHeight / 2); ctx.lineTo(targetSpeedLeft, targetSpeedY); ctx.lineWidth = 2; - ctx.strokeStyle = cyanColor; + ctx.strokeStyle = pfdTheme.targetColor; ctx.stroke(); } } @@ -267,22 +724,22 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { // Altitude indicator const altitudeIndWidth = 70; - const altitudeIndHeight = 500; + const altitudeIndHeight = pfdTheme.tapeHeight; const altitudeIndLeft = 750; const altitudeIndRight = altitudeIndLeft + altitudeIndWidth; - const altitudeIndTop = 250; + const altitudeIndTop = pfdTheme.tapeTop; const altitudeIndBottom = altitudeIndTop + altitudeIndHeight; const altitudeIndMid = altitudeIndTop + altitudeIndHeight / 2; // Background - ctx.fillStyle = grayColor; + ctx.fillStyle = pfdTheme.tape; ctx.fillRect(altitudeIndLeft, altitudeIndTop, altitudeIndWidth, altitudeIndHeight); ctx.font = "30px Arial"; const greaterThanMetrics = ctx.measureText(">"); // Mid point marker (for glideslope, but always visible) - ctx.fillStyle = yellowColor; + ctx.fillStyle = pfdTheme.symbolColor; ctx.fillRect(altitudeIndLeft - 70, altitudeIndMid - 3, 50, 6); // Clip altitude tape @@ -299,11 +756,9 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { const altitudePerPixel = altitudeTapeSpacing / altitudeTapeStep; // reciprocal const altitudeOffset = (altitude % altitudeTextStep) * altitudePerPixel; ctx.beginPath(); - var altitudeTape = Math.round(altitude - altitude % altitudeTextStep + 10 * altitudeTapeStep); - for (var i = -10; i < 7; i++) { + for (var i = -12; i < 12; i++) { ctx.moveTo(altitudeTapeLeft, altitudeOffset + i * altitudeTapeSpacing + altitudeIndMid); ctx.lineTo(altitudeTapeRight, altitudeOffset + i * altitudeTapeSpacing + altitudeIndMid); - altitudeTape -= altitudeTapeStep; } ctx.lineWidth = 2; ctx.strokeStyle = "white"; @@ -312,10 +767,13 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { // Flight level texts every 500ft ctx.font = "30px Arial"; ctx.fillStyle = "white"; - var altitudeText = Math.round(altitude - altitude % altitudeTextStep + 2 * altitudeTextStep); - for (var i = -2; i < 2; i++) { + var altitudeText = Math.round(altitude - altitude % altitudeTextStep + 3 * altitudeTextStep); + for (var i = -3; i < 3; i++) { + // Airbus marks the tape in flight levels, Boeing in full altitudes const flightLevelText = Math.abs(altitudeText / 100); // Don't display - if negative - const flightLevelTextString = ">" + flightLevelText.toString().padStart(3, '0'); + const flightLevelTextString = (pfdTheme.altitudeLabels === "full") + ? Math.abs(altitudeText).toString() + : ">" + flightLevelText.toString().padStart(3, '0'); ctx.fillText(flightLevelTextString, altitudeIndLeft - greaterThanMetrics.width, altitudeOffset + i * altitudeTapeSpacing * 5 + altitudeIndMid + fm30.actualBoundingBoxAscent / 2); altitudeText -= altitudeTextStep; } @@ -341,27 +799,27 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { var targetAltitudeY = (altitude - targetAltitude) * altitudePerPixel; targetAltitudeY = targetAltitudeY + altitudeIndMid; - if (isStd()) { - targetAltitudeText = Math.round(targetAltitude / 100); - } else { - targetAltitudeText = Math.round(targetAltitude); - } + // The selected altitude reads as a flight level on an Airbus above the + // transition altitude, but a Boeing always shows it in full + const asFlightLevel = isStd() && (pfdTheme.altitudeLabels !== "full"); + var targetAltitudeText = asFlightLevel + ? Math.round(targetAltitude / 100) : Math.round(targetAltitude); if (targetAltitudeY < altitudeIndTop) { // Target altitude as text on top ctx.font = "30px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetAltitudeMetrics = ctx.measureText(targetAltitudeText); - if (isStd()) { + if (asFlightLevel) { ctx.fillText("FL", altitudeIndLeft, altitudeIndTop - 4); } ctx.fillText(targetAltitudeText, altitudeIndRight - targetAltitudeMetrics.width / 2, altitudeIndTop - 4); } else if (targetAltitudeY > altitudeIndBottom) { // Target altitude as text underneath ctx.font = "30px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetAltitudeMetrics = ctx.measureText(targetAltitudeText); - if (isStd()) { + if (asFlightLevel) { ctx.fillText("FL", altitudeIndLeft, altitudeIndBottom + fm30.actualBoundingBoxAscent + 4); } ctx.fillText(targetAltitudeText, altitudeIndRight - targetAltitudeMetrics.width / 2, altitudeIndBottom + fm30.actualBoundingBoxAscent + 4); @@ -375,10 +833,10 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { targetAltitudeText = targetAltitudeText.toString().padStart(3, '0'); ctx.font = "30px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetAltitudeMetrics = ctx.measureText(targetAltitudeText); - // Cyan box + // Cyan (Airbus) or magenta (Boeing) box const targetAltitudeWidth = 30; const targetAltitudeHeight = 3 * (fm30.actualBoundingBoxAscent + fm30.actualBoundingBoxDescent); const targetAltitudeBoxHeight = 1.1 * (fm30.actualBoundingBoxAscent + fm30.actualBoundingBoxDescent); @@ -395,13 +853,12 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { ctx.lineTo(targetAltitudeRight, targetAltitudeY - targetAltitudeHeight / 2); ctx.lineTo(targetAltitudeLeft, targetAltitudeY - targetAltitudeHeight / 2); ctx.lineWidth = 2; - ctx.lineWidth = 2; - ctx.strokeStyle = cyanColor; + ctx.strokeStyle = pfdTheme.targetColor; ctx.stroke(); ctx.fillStyle = 'black'; ctx.fillRect(altitudeIndLeft, targetAltitudeY - targetAltitudeBoxHeight / 2, altitudeIndWidth - 2, targetAltitudeBoxHeight); - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; ctx.fillText(targetAltitudeText, altitudeIndLeft, targetAltitudeY + fm30.actualBoundingBoxAscent / 2); // Disable clipping @@ -426,12 +883,12 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { ctx.fillRect(altitudeIndLeft, altitudeIndMid - levelHeight / 2, altitudeIndWidth + 1, levelHeight); // Current flight level + ctx.fillStyle = pfdTheme.readoutColor; if (levelText !== "") { - ctx.fillStyle = greenColor; ctx.fillText(levelText, altitudeIndRight - levelTextMetrics.width, altitudeIndMid + levelTextMetrics.actualBoundingBoxAscent / 2); } - // Yellow box + // Readout box - yellow on an Airbus, white on a Boeing ctx.beginPath(); ctx.moveTo(altitudeIndLeft, altitudeIndMid - levelHeight / 2); ctx.lineTo(altitudeIndRight, altitudeIndMid - levelHeight / 2); @@ -445,7 +902,7 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { if (Math.abs(verticalSpeed) >= 6000) { ctx.strokeStyle = orangeColor; } else { - ctx.strokeStyle = yellowColor; + ctx.strokeStyle = pfdTheme.readoutBoxColor; } ctx.stroke(); @@ -472,8 +929,143 @@ function drawAltitudeIndicator(ctx, fm20, fm30) { // Disable clipping ctx.restore(); } +// Boeing style heading indicator: a partial compass rose under the ADI, its centre well +// below the display, the current heading read against a pointer at the top. Occupies the +// same area as the Airbus heading tape +function drawHeadingArc(ctx, fm20, fm30) { + if (heading === undefined) { + return; + } + const areaLeft = 215; + const areaRight = 685; + const areaTop = 860; + const areaBottom = 955; + const cx = 450; + const cy = 1330; + const radius = 440; // Arc top at y = 890 + const visible = 33; // Degrees either side of the pointer + + ctx.save(); + ctx.beginPath(); + ctx.rect(areaLeft, areaTop, areaRight - areaLeft, areaBottom - areaTop); + ctx.clip(); + + // Background, the same grey as the tapes + if (pfdTheme.headingBackground) { + ctx.fillStyle = pfdTheme.tape; + ctx.fillRect(areaLeft, areaTop, areaRight - areaLeft, areaBottom - areaTop); + } + + // The arc itself + ctx.beginPath(); + ctx.arc(cx, cy, radius, (-90 - visible) * Math.PI / 180, (-90 + visible) * Math.PI / 180); + ctx.lineWidth = 2; + ctx.strokeStyle = "white"; + ctx.stroke(); + + // Ticks inside the arc every 5 degrees, numerals every 10 (tens digits, the 30s larger) + ctx.textAlign = "center"; + const first = Math.floor((heading - visible) / 5) * 5; + for (var deg = first; deg <= heading + visible; deg += 5) { + const a = (deg - heading) * Math.PI / 180; + const tens = ((deg % 10) + 10) % 10 === 0; + const len = tens ? 20 : 12; + ctx.beginPath(); + ctx.moveTo(cx + radius * Math.sin(a), cy - radius * Math.cos(a)); + ctx.lineTo(cx + (radius - len) * Math.sin(a), cy - (radius - len) * Math.cos(a)); + ctx.lineWidth = 2; + ctx.strokeStyle = "white"; + ctx.stroke(); + if (tens) { + var label = Math.round(deg / 10) % 36; + if (label < 0) { + label += 36; + } + ctx.font = (label % 3 === 0) ? "30px Arial" : "24px Arial"; + ctx.fillStyle = "white"; + ctx.save(); + ctx.translate(cx + (radius - 44) * Math.sin(a), cy - (radius - 44) * Math.cos(a)); + ctx.rotate(a); + ctx.fillText(label.toString(), 0, 10); + ctx.restore(); + } + } + + // Track: a line from the rose centre, seen where it crosses the arc + if (track !== undefined) { + var rel = track - heading; + while (rel > 180) rel -= 360; + while (rel < -180) rel += 360; + const a = rel * Math.PI / 180; + ctx.beginPath(); + ctx.moveTo(cx + (radius - 70) * Math.sin(a), cy - (radius - 70) * Math.cos(a)); + ctx.lineTo(cx + (radius + 12) * Math.sin(a), cy - (radius + 12) * Math.cos(a)); + ctx.lineWidth = 3; + ctx.strokeStyle = "white"; + ctx.stroke(); + } + + // Selected heading: a magenta bug riding the outside of the arc, or its value at + // the nearer end when off the visible part + if (targetHeading !== undefined) { + var rel = targetHeading - heading; + while (rel > 180) rel -= 360; + while (rel < -180) rel += 360; + ctx.strokeStyle = pfdTheme.targetColor; + ctx.fillStyle = pfdTheme.targetColor; + if (Math.abs(rel) <= visible) { + const a = rel * Math.PI / 180; + ctx.save(); + ctx.translate(cx + radius * Math.sin(a), cy - radius * Math.cos(a)); + ctx.rotate(a); + ctx.beginPath(); + ctx.moveTo(-16, -18); + ctx.lineTo(-8, 0); + ctx.lineTo(8, 0); + ctx.lineTo(16, -18); + ctx.closePath(); + ctx.lineWidth = 3; + ctx.stroke(); + ctx.restore(); + } else { + ctx.font = "24px Arial"; + ctx.textAlign = (rel > 0) ? "right" : "left"; + ctx.fillText(Math.round(targetHeading).toString().padStart(3, '0'), (rel > 0) ? areaRight - 6 : areaLeft + 6, areaTop + 24); + } + } + ctx.restore(); + + // Heading pointer above the arc + ctx.beginPath(); + ctx.moveTo(cx, 892); + ctx.lineTo(cx - 12, 870); + ctx.lineTo(cx + 12, 870); + ctx.closePath(); + ctx.lineWidth = 3; + ctx.strokeStyle = "white"; + ctx.stroke(); + + // The heading in figures under the arc, with the reference it is measured from + if (pfdTheme.headingReadout) { + ctx.font = "32px Arial"; + ctx.fillStyle = "white"; + ctx.textAlign = "right"; + ctx.fillText(Math.round(heading).toString().padStart(3, '0'), cx + 14, 990); + ctx.font = "24px Arial"; + ctx.fillStyle = greenColor; + ctx.textAlign = "left"; + ctx.fillText("MAG", cx + 26, 990); + } + ctx.textAlign = "left"; +} + function drawHeadingIndicator(ctx, fm20, fm30) { + if (pfdTheme.headingStyle === "arc") { + drawHeadingArc(ctx, fm20, fm30); + return; + } + const headingIndWidth = 450; const headingIndHeight = 60; const headingIndLeft = 225; @@ -482,7 +1074,7 @@ function drawHeadingIndicator(ctx, fm20, fm30) { const headingIndBottom = headingIndTop + headingIndHeight; const headingIndMid = headingIndLeft + headingIndWidth / 2; - ctx.fillStyle = grayColor; + ctx.fillStyle = pfdTheme.tape; ctx.fillRect(headingIndLeft, headingIndTop, headingIndWidth, headingIndHeight); // White lines left, right and top @@ -500,7 +1092,7 @@ function drawHeadingIndicator(ctx, fm20, fm30) { ctx.moveTo(headingIndMid, headingIndTop - 30); ctx.lineTo(headingIndMid, headingIndTop); ctx.lineWidth = 4; - ctx.strokeStyle = yellowColor; + ctx.strokeStyle = pfdTheme.symbolColor; ctx.stroke(); // Clip tape @@ -591,7 +1183,7 @@ function drawHeadingIndicator(ctx, fm20, fm30) { // Display target heading as text on left ctx.font = "20px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetHeadingText = Math.round(targetHeading).toString().padStart(3, '0'); const targetHeadingMetrics = ctx.measureText(targetHeadingText); ctx.fillText(targetHeadingText, headingIndLeft, headingIndTop - 4); @@ -600,7 +1192,7 @@ function drawHeadingIndicator(ctx, fm20, fm30) { // Display target heading as text on right ctx.font = "20px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.targetColor; const targetHeadingText = Math.round(targetHeading).toString().padStart(3, '0'); const targetHeadingMetrics = ctx.measureText(targetHeadingText); ctx.fillText(targetHeadingText, headingIndRight - targetHeadingMetrics.width, headingIndTop - 4); @@ -617,7 +1209,7 @@ function drawHeadingIndicator(ctx, fm20, fm30) { ctx.lineTo(targetMid + targetWidth / 2, headingIndTop - targetHeight); ctx.lineTo(targetMid, headingIndTop); ctx.lineWidth = 2; - ctx.strokeStyle = cyanColor; + ctx.strokeStyle = pfdTheme.targetColor; ctx.stroke(); } } @@ -642,6 +1234,195 @@ function drawBankAngleLineMarker(ctx, radius, height) { ctx.strokeStyle = 'white'; ctx.stroke(); } +// --------------------------------------------------------------------------------- +// Pitch. ADS-B carries no attitude, but it does carry vertical speed and speed, and +// those give the flight path angle - the angle of the aircraft's path through the air. +// That is what the attitude indicator's ladder is read against here. True pitch is the +// flight path angle plus the angle of attack, and nothing reported tells us the angle of +// attack, so in a climb the ladder reads a few degrees shallower than a real one would + +const pfdPitchScale = 10; // Pixels per degree on the pitch ladder +const pfdMaxPitch = 30; // Clamped, so a wild vertical speed cannot throw the horizon off +const pfdPitchSmoothing = 0.15; // Per frame - reported vertical speed is coarse and steps about +const pfdMinPathSpeed = 50; // Knots, below which the angle is meaningless +// An aircraft flies a few degrees nose up of its own flight path. Only used for map items +// with no pitch of their own - for an ADS-B aircraft the demod has already added it +const pfdAngleOfAttack = 3; +var pfdPitch = 0; // Degrees, nose up positive, as drawn +var reportedPitch; // What the item's own source estimated, when it has one + +// How fast the aircraft is going forwards. The speed of the 3D model is measured from +// its own track, so it is ground referenced; the indicated airspeed the tapes show is +// far slower than that at altitude and would overstate the angle +function pfdPathSpeed() { + if ((modelSpeed !== undefined) && (modelSpeed > pfdMinPathSpeed)) { + return modelSpeed; + } + return ((speed !== undefined) && (speed > pfdMinPathSpeed)) ? speed : undefined; +} + +function flightPathAngle() { + const v = pfdPathSpeed(); + if ((v === undefined) || (verticalSpeed === undefined)) { + return 0; + } + return Math.atan2(verticalSpeed, v * ftPerMinutePerKnot) * 180 / Math.PI; +} + +// The ADS-B demod works pitch out from the aircraft's own reports and orients its 3D +// model with it, so taking that here keeps the attitude indicator and the model on the +// map showing the same thing - and picks up the attitudes it sets on rotation, gear up +// and the approach, which no calculation from the reported rates would give. Anything on +// the map without a source for it falls back to the flight path angle +function updatePitch() { + const source = (reportedPitch !== undefined) ? reportedPitch + : (flightPathAngle() + pfdAngleOfAttack); + const target = Math.max(-pfdMaxPitch, Math.min(pfdMaxPitch, source)); + pfdPitch += (target - pfdPitch) * pfdPitchSmoothing; +} + +// --------------------------------------------------------------------------------- +// Flight director. ADS-B carries neither pitch nor the aircraft's own FD command, so +// the guidance is derived from what it does report: the selected heading gives a +// commanded bank, proportional to the heading error and limited as an airliner's +// autopilot limits it, and the selected altitude a commanded vertical speed, which +// becomes a commanded flight path angle. The bars therefore show what the aircraft is +// being asked to do rather than a recorded command. The pitch bar is the angle still to +// fly, which is where it belongs on a ladder that shows the current flight path angle + +const fdMaxBank = 25; // Degrees, as an airliner's autopilot +const fdMaxVerticalSpeed = 1800; // ft/min commanded towards the selected altitude +const fdBankGain = 1.3; // Commanded bank per degree of heading error +const fdVerticalGain = 3; // Commanded ft/min per foot of altitude error +const glideslopeAngle = 3; // Degrees of descent on a standard ILS glidepath + +// The course an ILS is flown on, taken from the arrival runway: a runway designator is +// its magnetic heading rounded to ten degrees, so 18R is 180. The flight plan belongs to +// the ND, which is loaded after this file, hence the guards. undefined when no plan names +// a runway, which is the common case for traffic that filed nothing +function pfdApproachCourse() { + const plan = (typeof ndFlightPlan !== "undefined") ? ndFlightPlan : undefined; + if ((plan === undefined) || (plan === null)) { + return undefined; + } + var runway = plan.rwy; + if ((runway === undefined) && (typeof ndApproachRunway === "function")) { + runway = ndApproachRunway(plan.app); + } + if (runway === undefined) { + return undefined; + } + const designator = parseInt(String(runway).substring(0, 2), 10); + if (isNaN(designator) || (designator < 1) || (designator > 36)) { + return undefined; + } + return designator * 10; +} +// Pixels per degree on the pitch ladder, which the flight director shares - its bar +// is placed on the same scale +const fdBankScale = 4; // Pixels per degree of bank still to be flown +const ftPerMinutePerKnot = 101.269; + +// The commanded bank and the pitch change still to fly, in degrees. undefined when +// nothing is guiding the aircraft, or when it is on the ground +function fdCommands() { + if ((roll === undefined) || (onSurface > 0)) { + return undefined; + } + if (!autopilot && (verticalMode === undefined) && (lateralMode === undefined)) { + return undefined; + } + const cmd = {}; + // On the localiser the selected heading is often left at the last vector the aircraft + // was given rather than the course it is now tracking, so steering to it turns the + // aircraft off the approach. The centreline is what is being flown, and the runway + // gives its course. As with the glidepath, beam deviation is not reported, so this + // asks for the course itself rather than for a correction back onto the centreline - + // and it falls back to the selected heading when no flight plan names a runway + const approachCourse = (lateralMode === 2) ? pfdApproachCourse() : undefined; + const commandedHeading = (approachCourse !== undefined) ? approachCourse : targetHeading; + if ((commandedHeading !== undefined) && (heading !== undefined)) { + var error = commandedHeading - heading; + while (error > 180) error -= 360; + while (error < -180) error += 360; + cmd.bank = Math.max(-fdMaxBank, Math.min(fdMaxBank, error * fdBankGain)); + } + // During a resolution advisory TCAS is flying the vertical path, as the FMA says, + // and the VSI carries its guidance - so there is no pitch command to show + const pathSpeed = pfdPathSpeed(); + if (!(tcasRA & 1) && (pathSpeed !== undefined)) + { + if (verticalMode === 3) + { + // On the glideslope the selected altitude is the missed approach altitude - + // it is set for the go-around, not as somewhere to fly to now. Capturing it + // commands a climb the whole way down the approach, which saturated the bar + // at its limit. What is being flown is the glidepath, and an ILS one is 3 + // degrees by definition, so the bar is referenced to that instead. Beam + // deviation is not reported, so this asks for the nominal angle rather than + // for a correction back onto the beam: on a correct glidepath the bar sits + // on the aircraft symbol, and it deflects when the descent is too shallow + // or too steep + cmd.pitch = -glideslopeAngle - flightPathAngle(); + } + else if ((targetAltitude !== undefined) && (altitude !== undefined)) + { + const error = targetAltitude - altitude; + const commandedVs = Math.max(-fdMaxVerticalSpeed, Math.min(fdMaxVerticalSpeed, error * fdVerticalGain)); + const rate = pathSpeed * ftPerMinutePerKnot; + const commandedAngle = Math.atan2(commandedVs, rate) * 180 / Math.PI; + cmd.pitch = commandedAngle - flightPathAngle(); + } + } + return ((cmd.bank === undefined) && (cmd.pitch === undefined)) ? undefined : cmd; +} + +function drawFlightDirector(ctx, cx, cy, radius) { + const cmd = fdCommands(); + if (cmd === undefined) { + return; + } + const limit = radius * 0.45; + const clamp = function (v) { return Math.max(-limit, Math.min(limit, v)); }; + // Up is a climb command, so the pitch bar moves opposite to the offset's sign + const dy = (cmd.pitch === undefined) ? 0 : clamp(-cmd.pitch * pfdPitchScale); + + ctx.save(); + ctx.beginPath(); + ctx.arc(cx, cy, radius, 0, 2 * Math.PI); + ctx.clip(); + ctx.strokeStyle = pfdTheme.fdColor; + ctx.lineWidth = 5; + + // Cross bars, each showing one axis, neither rotating with the horizon - green on + // an Airbus, magenta on a Boeing + if (cmd.pitch !== undefined) { + ctx.beginPath(); + ctx.moveTo(cx - radius * 0.5, cy + dy); + ctx.lineTo(cx + radius * 0.5, cy + dy); + ctx.stroke(); + } + if (cmd.bank !== undefined) { + const dx = clamp((cmd.bank - roll) * fdBankScale); + ctx.beginPath(); + ctx.moveTo(cx + dx, cy - radius * 0.5); + ctx.lineTo(cx + dx, cy + radius * 0.5); + ctx.stroke(); + } + ctx.restore(); +} + +// A rounded rectangle path, built from arcTo rather than the newer roundRect so it does +// not depend on how new the embedded browser is +function pfdRoundRectPath(ctx, x, y, w, h, r) { + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); +} + function drawAttitudeIndicator(ctx, fm20, fm30) { if (roll === undefined) { @@ -663,12 +1444,16 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { const attitudeIndMidY = attitudeIndTop + attitudeIndHeight / 2; const attitudeIndCrop = (attitudeIndWidth - 450) / 2; // headingIndWidth = 450 - // Clip + // Clip. An Airbus attitude indicator is a circle with the sides flattened off; a + // Boeing one is close to a square with rounded corners ctx.save(); - //ctx.arc(attitudeIndMidX, attitudeIndMidY, attitudeIndWidth / 2, 0, 2 * Math.PI); ctx.beginPath(); - ctx.arc(attitudeIndMidX, attitudeIndMidY, attitudeIndWidth / 2, Math.PI / 10 + Math.PI, Math.PI - Math.PI / 10 + Math.PI); - ctx.arc(attitudeIndMidX, attitudeIndMidY, attitudeIndWidth / 2, Math.PI / 10, Math.PI - Math.PI / 10); + if (pfdTheme.adi === "rounded") { + pfdRoundRectPath(ctx, attitudeIndLeft, attitudeIndTop, attitudeIndWidth, attitudeIndHeight, 70); + } else { + ctx.arc(attitudeIndMidX, attitudeIndMidY, attitudeIndWidth / 2, Math.PI / 10 + Math.PI, Math.PI - Math.PI / 10 + Math.PI); + ctx.arc(attitudeIndMidX, attitudeIndMidY, attitudeIndWidth / 2, Math.PI / 10, Math.PI - Math.PI / 10); + } // //ctx.rect(attitudeIndLeft + attitudeIndCrop, attitudeIndTop, attitudeIndWidth - 2 * attitudeIndCrop, attitudeIndWidth); // ctx.rect(attitudeIndLeft + attitudeIndCrop, attitudeIndTop, attitudeIndWidth - 2 * attitudeIndCrop, attitudeIndWidth); ctx.clip(); @@ -682,17 +1467,12 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { //console.log(attitudeIndMidX, attitudeIndMidY, attitudeIndWidth / 2, 0, 2 * Math.PI); //ctx.fill(); - ctx.fillStyle = skyColor; + ctx.fillStyle = pfdTheme.sky; ctx.fillRect(attitudeIndLeft, attitudeIndTop, attitudeIndWidth, attitudeIndWidth); const rollRad = -roll * Math.PI / 180; const radius = attitudeIndWidth / 2; - ctx.fillStyle = groundColor; - ctx.beginPath(); - ctx.arc(attitudeIndMidX, attitudeIndMidY, radius, 0 + rollRad, Math.PI + rollRad); - ctx.fill(); - //const offsetX = Math.cos(rollRad) * radius; //const offsetY = Math.sin(rollRad) * radius; //ctx.beginPath(); @@ -708,64 +1488,69 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { const twoAndHalfDegOffset = 15; const fiveDegOffset = twoAndHalfDegOffset * 2; const tenDegOffset = twoAndHalfDegOffset * 4; - const fifteenDegOffset = twoAndHalfDegOffset * 2.5; - const spacing = 50; - - // ctx.save(); + // Bank, then pitch: the ladder slides down the display by the angle it is showing, + // so the aircraft symbol fixed at the centre reads that angle straight off it ctx.translate(attitudeIndMidX, attitudeIndMidY); ctx.rotate(rollRad); - + ctx.translate(0, pfdPitch * pfdPitchScale); + + // Everything below the horizon. A rectangle rather than the half disc this used to + // be, so it still covers the corners of a square attitude indicator however far the + // horizon has moved from the centre - the clip trims it + ctx.fillStyle = pfdTheme.ground; + ctx.fillRect(-radius * 3, 0, radius * 6, radius * 6); + + // The pitch ladder, linear at pfdPitchScale pixels per degree: a bar every 2.5 + // degrees, wider at 5 and wider still at 10, which is where the numbers go. It runs + // well beyond the attitude indicator, or a climb would slide the end of it into view + const ladderSteps = Math.round((pfdMaxPitch + 25) / 2.5); ctx.beginPath(); ctx.moveTo(-radius, 0); ctx.lineTo(radius, 0); - for (var i = -2; i < 4; i++) { - ctx.moveTo(-twoAndHalfDegOffset, -i * spacing - spacing / 2); - ctx.lineTo(twoAndHalfDegOffset, -i * spacing - spacing / 2); - } - for (var i = -1; i < 5; i++) { - ctx.moveTo(-fiveDegOffset, -i * spacing); - ctx.lineTo(fiveDegOffset, -i * spacing); - } - for (var i = -1; i < 3; i++) { - ctx.moveTo(-tenDegOffset, -i * 2 * spacing); - ctx.lineTo(tenDegOffset, -i * 2 * spacing); - } - ctx.moveTo(-fifteenDegOffset, 2.75 * spacing); - ctx.lineTo(fifteenDegOffset, 2.75 * spacing); - ctx.moveTo(-tenDegOffset, 3.5 * spacing); - ctx.lineTo(tenDegOffset, 3.5 * spacing); + for (var k = -ladderSteps; k <= ladderSteps; k++) { + if (k === 0) { + continue; // The horizon itself, drawn full width above + } + const y = -k * 2.5 * pfdPitchScale; + const half = ((k % 4) === 0) ? tenDegOffset + : (((k % 2) === 0) ? fiveDegOffset : twoAndHalfDegOffset); + ctx.moveTo(-half, y); + ctx.lineTo(half, y); + } ctx.lineWidth = 2; ctx.strokeStyle = 'white'; ctx.stroke(); - const greenThingWidth = 20; - ctx.beginPath(); - ctx.strokeStyle = greenColor; - ctx.moveTo(-fifteenDegOffset - greenThingWidth, 2.75 * spacing - 3); - ctx.lineTo(-fifteenDegOffset, 2.75 * spacing - 3); - ctx.moveTo(-fifteenDegOffset - greenThingWidth, 2.75 * spacing + 3); - ctx.lineTo(-fifteenDegOffset, 2.75 * spacing + 3); - ctx.moveTo(fifteenDegOffset + greenThingWidth, 2.75 * spacing - 3); - ctx.lineTo(fifteenDegOffset, 2.75 * spacing - 3); - ctx.moveTo(fifteenDegOffset + greenThingWidth, 2.75 * spacing + 3); - ctx.lineTo(fifteenDegOffset, 2.75 * spacing + 3); - ctx.stroke(); + // The green brackets either side of 15 degrees nose down + if (pfdTheme.pitchBrackets) { + const bracketWidth = 20; + const bracketHalf = twoAndHalfDegOffset * 2.5; + const bracketY = 15 * pfdPitchScale; + ctx.beginPath(); + ctx.strokeStyle = greenColor; + for (const side of [-1, 1]) { + for (const dy of [-3, 3]) { + ctx.moveTo(side * (bracketHalf + bracketWidth), bracketY + dy); + ctx.lineTo(side * bracketHalf, bracketY + dy); + } + } + ctx.stroke(); + } ctx.font = "20px Arial"; ctx.fillStyle = 'white'; - const labelMetrics = ctx.measureText("20"); - const labelCenterY = labelMetrics.actualBoundingBoxAscent / 2; + const labelCenterY = ctx.measureText("20").actualBoundingBoxAscent / 2; const labelOffset = tenDegOffset + 10; - - ctx.fillText("10", labelOffset, spacing * 2 + labelCenterY); - ctx.fillText("10", -labelOffset - labelMetrics.width, spacing * 2 + labelCenterY); - ctx.fillText("10", labelOffset, -spacing * 2 + labelCenterY); - ctx.fillText("10", -labelOffset - labelMetrics.width, -spacing * 2 + labelCenterY); - ctx.fillText("20", labelOffset, -spacing * 4 + labelCenterY); - ctx.fillText("20", -labelOffset - labelMetrics.width, -spacing * 4 + labelCenterY); - ctx.fillText("20", labelOffset, spacing * 3.5 + labelCenterY); - ctx.fillText("20", -labelOffset - labelMetrics.width, spacing * 3.5 + labelCenterY); + for (var k = -ladderSteps; k <= ladderSteps; k++) { + if ((k === 0) || ((k % 4) !== 0)) { + continue; // Numbers go on the ten degree bars + } + const text = Math.abs(k * 2.5).toString(); + const y = -k * 2.5 * pfdPitchScale + labelCenterY; + ctx.fillText(text, labelOffset, y); + ctx.fillText(text, -labelOffset - ctx.measureText(text).width, y); + } const rollBig = 18; const rollSmall = 10; @@ -778,7 +1563,7 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { ctx.lineTo(-rollBig, -radius + rollBig + rollTriangleOffet); ctx.lineTo(0, -radius + rollTriangleOffet); ctx.lineWidth = 2; - ctx.strokeStyle = yellowColor; + ctx.strokeStyle = pfdTheme.symbolColor; ctx.stroke(); const rollTrapX1 = 20; @@ -793,7 +1578,7 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { ctx.lineTo(-rollTrapX2, rollTrapY2); ctx.lineTo(-rollTrapX1, rollTrapY1); ctx.lineWidth = 2; - ctx.strokeStyle = yellowColor; + ctx.strokeStyle = pfdTheme.symbolColor; ctx.stroke(); ctx.restore(); @@ -807,37 +1592,47 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { ctx.rect(-radius, -radius - 2 *rollBig , radius * 2, radius); ctx.clip(); - ctx.beginPath(); - ctx.moveTo(0, -radius); - ctx.lineTo(rollBig, -radius - rollBig); - ctx.lineTo(-rollBig, -radius - rollBig); - ctx.lineTo(0, -radius); - ctx.lineWidth = 2; - ctx.strokeStyle = yellowColor; - ctx.stroke(); + // Airbus marks zero bank with a fixed index above the scale. Boeing has none: bank + // is read off the moving pointer within the sky, which also leaves the space above + // the attitude indicator to the FLT DIR annunciation + if (pfdTheme.rollPointer) { + ctx.beginPath(); + ctx.moveTo(0, -radius); + ctx.lineTo(rollBig, -radius - rollBig); + ctx.lineTo(-rollBig, -radius - rollBig); + ctx.closePath(); + ctx.lineWidth = 2; + ctx.strokeStyle = pfdTheme.symbolColor; + ctx.stroke(); + } - ctx.beginPath(); - ctx.arc(0, 0, radius, (240 - 2) * Math.PI / 180, (300 + 2) * Math.PI / 180); - ctx.lineWidth = 2; - ctx.strokeStyle = 'white'; - ctx.stroke(); + if (pfdTheme.bankArc) { + ctx.beginPath(); + ctx.arc(0, 0, radius, (240 - 2) * Math.PI / 180, (300 + 2) * Math.PI / 180); + ctx.lineWidth = 2; + ctx.strokeStyle = 'white'; + ctx.stroke(); + } + // 10, 20 and 30 degrees are boxed on an Airbus and plain ticks on a Boeing; 45 is a + // tick on both + const bankMarker = pfdTheme.bankBoxes ? drawBankAngleBoxMarker : drawBankAngleLineMarker; ctx.rotate(45 * Math.PI / 180); drawBankAngleLineMarker(ctx, radius, rollBig); ctx.rotate(-15 * Math.PI / 180); - drawBankAngleBoxMarker(ctx, radius, rollBig); + bankMarker(ctx, radius, rollBig); ctx.rotate(-10 * Math.PI / 180); - drawBankAngleBoxMarker(ctx, radius, 10); + bankMarker(ctx, radius, 10); ctx.rotate(-10 * Math.PI / 180); - drawBankAngleBoxMarker(ctx, radius, 10); + bankMarker(ctx, radius, 10); ctx.rotate(-10 * Math.PI / 180); ctx.rotate(-10 * Math.PI / 180); - drawBankAngleBoxMarker(ctx, radius, 10); + bankMarker(ctx, radius, 10); ctx.rotate(-10 * Math.PI / 180); - drawBankAngleBoxMarker(ctx, radius, 10); + bankMarker(ctx, radius, 10); ctx.rotate(-10 * Math.PI / 180); - drawBankAngleBoxMarker(ctx, radius, rollBig); + bankMarker(ctx, radius, rollBig); ctx.rotate(-15 * Math.PI / 180); drawBankAngleLineMarker(ctx, radius, rollBig); @@ -847,12 +1642,25 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { ctx.restore(); - // Wings - const wingThickness = 14; - const wingHeight = 35; + // Flight director, under the aircraft symbol that is flown into it + drawFlightDirector(ctx, attitudeIndMidX, attitudeIndMidY, radius); + if ((pfdTheme.fdLabel !== undefined) && (fdCommands() !== undefined)) { + ctx.font = "30px Arial"; + ctx.fillStyle = greenColor; + const fdMetrics = ctx.measureText(pfdTheme.fdLabel); + ctx.fillText(pfdTheme.fdLabel, attitudeIndMidX - fdMetrics.width / 2, attitudeIndTop - 12); + } + + // Wings: a bar either side with a leg dropped at its inner end, which both makers + // draw - the proportions and the colour come from the theme + const wingThickness = pfdTheme.wingThickness; + const wingHeight = pfdTheme.wingHeight; const wingWidth = 90; const wingOffset = 130; + ctx.lineWidth = 4; + ctx.fillStyle = 'black'; + ctx.strokeStyle = pfdTheme.symbolColor; ctx.beginPath(); ctx.moveTo(attitudeIndMidX - wingOffset - wingWidth, attitudeIndMidY - wingThickness / 2); ctx.lineTo(attitudeIndMidX - wingOffset, attitudeIndMidY - wingThickness / 2); @@ -861,9 +1669,6 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { ctx.lineTo(attitudeIndMidX - wingOffset - wingThickness, attitudeIndMidY + wingThickness / 2); ctx.lineTo(attitudeIndMidX - wingOffset - wingWidth, attitudeIndMidY + wingThickness / 2); ctx.lineTo(attitudeIndMidX - wingOffset - wingWidth, attitudeIndMidY - wingThickness / 2); - ctx.lineWidth = 4; - ctx.fillStyle = 'black'; - ctx.strokeStyle = yellowColor; ctx.stroke(); ctx.fill(); @@ -875,9 +1680,6 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { ctx.lineTo(attitudeIndMidX + wingOffset + wingThickness, attitudeIndMidY + wingThickness / 2); ctx.lineTo(attitudeIndMidX + wingOffset + wingWidth, attitudeIndMidY + wingThickness / 2); ctx.lineTo(attitudeIndMidX + wingOffset + wingWidth, attitudeIndMidY - wingThickness / 2); - ctx.lineWidth = 4; - ctx.fillStyle = 'black'; - ctx.strokeStyle = yellowColor; ctx.stroke(); ctx.fill(); @@ -887,9 +1689,9 @@ function drawAttitudeIndicator(ctx, fm20, fm30) { if ((radioAltitude !== undefined) && (radioAltitude <= 2500)) { ctx.font = "30px Arial"; if (radioAltitude < 100) { - ctx.fillStyle = orangeColor; + ctx.fillStyle = pfdTheme.raltLowColor; } else { - ctx.fillStyle = greenColor; + ctx.fillStyle = pfdTheme.raltColor; } const raText = Math.round(radioAltitude).toString(); const raTextMetrics = ctx.measureText(raText); @@ -903,7 +1705,7 @@ function drawPressure(ctx, fm20, fm30) { const pressureLeft = 750; // Righthand side of altitude indicator const pressureMidX = 750 + 80; // Lefthand side of altitude indicator - const pressureMidY = 850; + const pressureMidY = pfdTheme.baroY; const pressureInt = Math.round(pressure); @@ -911,22 +1713,29 @@ function drawPressure(ctx, fm20, fm30) { const border = 3; ctx.font = "30px Arial"; - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.baroColor; const pressureText = "STD"; const pressureMetrics = ctx.measureText(pressureText); const height = pressureMetrics.actualBoundingBoxAscent + pressureMetrics.actualBoundingBoxDescent + 2 * border; ctx.fillText(pressureText, pressureMidX - pressureMetrics.width / 2, pressureMidY); - ctx.lineWidth = 2; - ctx.strokeStyle = yellowColor; - ctx.strokeRect(pressureMidX - pressureMetrics.width / 2 - border, pressureMidY - pressureMetrics.actualBoundingBoxAscent - 2 * border, pressureMetrics.width + border * 2, height + border * 2); + if (pfdTheme.baroBox) { + ctx.lineWidth = 2; + ctx.strokeStyle = pfdTheme.symbolColor; + ctx.strokeRect(pressureMidX - pressureMetrics.width / 2 - border, pressureMidY - pressureMetrics.actualBoundingBoxAscent - 2 * border, pressureMetrics.width + border * 2, height + border * 2); + } + } else if (pfdTheme.name === "boeing") { + // Boeing: the setting and its unit, in white + ctx.font = "30px Arial"; + ctx.fillStyle = "white"; + ctx.fillText(pressureInt.toString() + " HPA", pressureLeft, pressureMidY); } else { ctx.font = "30px Arial"; ctx.fillStyle = "white"; ctx.fillText("QNH", pressureLeft, pressureMidY); - ctx.fillStyle = cyanColor; + ctx.fillStyle = pfdTheme.baroColor; const pressureText = pressureInt.toString(); ctx.fillText(pressureText, pressureMidX, pressureMidY); } @@ -938,7 +1747,7 @@ function drawMachIndicator(ctx) { if (mach >= 0.45) { // Actually comes on at .5 and goes off at 0.45 ctx.font = "38px Arial"; - ctx.fillStyle = greenColor; + ctx.fillStyle = pfdTheme.machColor; var machString; if (mach < 1) { machString = mach.toFixed(3).substring(1); // No leading 0 @@ -946,22 +1755,40 @@ function drawMachIndicator(ctx) { machString = mach.toFixed(2); } - ctx.fillText(machString, 40, 840); + ctx.fillText(machString, 40, pfdTheme.machY); } } } +// The VSI scale is piecewise: 0-1000 ft/min covers 4 marker spacings, 1000-2000 the +// next 2, 2000-6000 the last 2, clamped beyond. Signed offset in pixels above (+) or +// below (-) the centre for a signed vertical speed +function vsToOffset(vs, spacing) { + const a = Math.abs(vs); + var offset; + if (a <= 1000) { + offset = a / 1000 * 4 * spacing; + } else if (a < 2000) { + offset = (a - 1000) / 1000 * 2 * spacing + 4 * spacing; + } else if (a < 6000) { + offset = (a - 2000) / 4000 * 2 * spacing + 6 * spacing; + } else { + offset = 8 * spacing; + } + return offset * Math.sign(vs); +} + function drawVerticalSpeedIndicator(ctx, fm20, fm30) { const verticalSpeedIndWidth = 50; - const verticalSpeedIndHeight = 620; + const verticalSpeedIndHeight = pfdTheme.vsiHeight; const verticalSpeedIndLeft = 900; - const verticalSpeedIndTop = 190; + const verticalSpeedIndTop = pfdTheme.vsiTop; const verticalSpeedIndBottom = verticalSpeedIndTop + verticalSpeedIndHeight; const verticalSpeedIndMidY = verticalSpeedIndTop + + verticalSpeedIndHeight / 2; const verticalSpeedIndMidX = verticalSpeedIndLeft + verticalSpeedIndWidth / 2; const verticalSpeedIndRight = verticalSpeedIndLeft + verticalSpeedIndWidth; const verticalSpeedBevel = 80; - const verticalSpeedMarkerSpacing = 35; + const verticalSpeedMarkerSpacing = pfdTheme.vsiSpacing; const verticalSpeedMarkerWidth = verticalSpeedIndWidth / 4; const verticalSpeedMarkerLeft = verticalSpeedIndLeft + verticalSpeedMarkerWidth; const verticalSpeedIndText = verticalSpeedIndLeft + 1; @@ -978,8 +1805,14 @@ function drawVerticalSpeedIndicator(ctx, fm20, fm30) { ctx.lineTo(verticalSpeedIndMidX, verticalSpeedIndBottom); ctx.lineTo(verticalSpeedIndLeft, verticalSpeedIndBottom); ctx.lineTo(verticalSpeedIndLeft, verticalSpeedIndTop); - ctx.fillStyle = grayColor; + ctx.fillStyle = pfdTheme.tape; ctx.fill(); + if (pfdTheme.vsi === "boeing") { + // Boeing outlines the scale as well as filling it + ctx.strokeStyle = "white"; + ctx.lineWidth = 2; + ctx.stroke(); + } // Labels ctx.font = "20px Arial"; @@ -1008,25 +1841,45 @@ function drawVerticalSpeedIndicator(ctx, fm20, fm30) { } // 0 marker - ctx.fillStyle = yellowColor; + ctx.fillStyle = pfdTheme.symbolColor; ctx.fillRect(verticalSpeedIndLeft, verticalSpeedIndMidY - 3, verticalSpeedIndWidth / 2, 6); + // TCAS RA guidance bands over the marker strip: red across the prohibited vertical + // speeds, with a green band beside it across the vertical speed to fly to avoid the + // traffic. The ARA does not carry a vertical speed limit's magnitude, so a limit is + // shown from level flight: the whole side towards the threat is red, and the green + // band asks for a gentle rate away from it + if ((tcasRA & 1) && !(tcasRA & 64)) + { + const raBand = function (vsFrom, vsTo, color) { + const y1 = verticalSpeedIndMidY - vsToOffset(vsFrom, verticalSpeedMarkerSpacing); + const y2 = verticalSpeedIndMidY - vsToOffset(vsTo, verticalSpeedMarkerSpacing); + ctx.fillStyle = color; + ctx.fillRect(verticalSpeedMarkerLeft, Math.min(y1, y2), verticalSpeedMarkerWidth, Math.abs(y2 - y1)); + }; + const raDown = (tcasRA & 4) !== 0; + const sense = raDown ? -1 : 1; + if ((tcasRA & 2) && (tcasRA & 8)) + { + // Corrective, positive: fly 1500-2000 ft/min in the advised sense + raBand(-6000 * sense, 1500 * sense, redColor); + raBand(1500 * sense, 2000 * sense, greenColor); + } + else + { + // Vertical speed limit (corrective "adjust vertical speed" or preventive + // "monitor vertical speed"): do not fly towards the threat, hold 0-500 + // ft/min away from it + raBand(0, -6000 * sense, redColor); + raBand(0, 500 * sense, greenColor); + } + } + // Indicator line const verticalSpeedAbsolute = Math.abs(verticalSpeed); - var verticalOffset; - var color = greenColor; - - if (verticalSpeedAbsolute <= 1000) { - verticalOffset = verticalSpeedAbsolute / 1000 * 4 * verticalSpeedMarkerSpacing; - } else if (verticalSpeedAbsolute < 2000) { - verticalOffset = (verticalSpeedAbsolute - 1000) / 1000 * 2 * verticalSpeedMarkerSpacing + 4 * verticalSpeedMarkerSpacing; - } else if (verticalSpeedAbsolute < 6000) { - verticalOffset = (verticalSpeedAbsolute - 2000) / 4000 * 2 * verticalSpeedMarkerSpacing + 6 * verticalSpeedMarkerSpacing; - } else { - verticalOffset = 8 * verticalSpeedMarkerSpacing; - color = orangeColor; - } + var color = (verticalSpeedAbsolute >= 6000) ? orangeColor : pfdTheme.vsiColor; + const verticalOffset = vsToOffset(verticalSpeedAbsolute, verticalSpeedMarkerSpacing); const verticalSpeedLineY = verticalSpeedIndMidY - verticalOffset * Math.sign(verticalSpeed); @@ -1037,8 +1890,19 @@ function drawVerticalSpeedIndicator(ctx, fm20, fm30) { ctx.strokeStyle = color; ctx.stroke(); + // Boeing shows the rate in figures above the scale once it is worth reading + if (pfdTheme.vsi === "boeing") + { + if (verticalSpeedAbsolute >= 400) { + ctx.font = "30px Arial"; + ctx.fillStyle = color; + const vsText = (Math.round(verticalSpeedAbsolute / 50) * 50).toString(); + const vsMetrics = ctx.measureText(vsText); + ctx.fillText(vsText, verticalSpeedIndMidX - vsMetrics.width / 2, verticalSpeedIndTop - 10); + } + } // Text - if (verticalSpeedAbsolute > 200) { + else if (verticalSpeedAbsolute > 200) { const verticalSpeedTextX = verticalSpeedLineLeft + 3; const verticalSpeedTextHeight = fm20.actualBoundingBoxAscent + fm20.actualBoundingBoxDescent + 2; @@ -1070,7 +1934,8 @@ var headingInc = 0.1; var altitudeInc = 1; var verticalSpeedInc = 10; var rollInc = 0.1; -function animatePFD() { +// type: the ICAO aircraft type to show as, e.g. "B738" for the Boeing look; A320 by default +function animatePFD(type) { if (speed === undefined) { speed = 0; targetSpeed = 200; @@ -1110,8 +1975,6 @@ function animatePFD() { rollInc = -0.1; } speed = speed + speedInc; - groundspeed = 150; - trueAirspeed = 130; heading = heading + headingInc; altitude = altitude + altitudeInc; altitude = 39; @@ -1119,22 +1982,59 @@ function animatePFD() { onSurface = 0; verticalSpeed = verticalSpeed + verticalSpeedInc; roll = roll + rollInc; + reportedPitch = undefined; // Let the flight path angle drive the ladder callsign = "BAW123G"; - aircraftType = "A320"; - windDirection = 85; - windSpeed = 15; - staticAirTemperature = 7; + aircraftType = (type === undefined) ? "A320" : type; + pfdTheme = cockpitThemeFor(aircraftType); verticalMode = 3; lateralMode = 2; autopilot = 1; - tcasMode = 1; pressure = 1013; //pressure = 1018; + // Cycle the TCAS RA through none / preventive / corrective climb / corrective + // descend / clear of conflict, ten seconds each, exercising the FMA TCAS + // annunciator, the VSI bands and (via the aural edge logic) each sound + if (animateRaStart === undefined) { + animateRaStart = Date.now(); + } + const raStates = [0, 1, 1 | 2 | 8, 1 | 2 | 4 | 8, 0]; + const raPhase = Math.floor((Date.now() - animateRaStart) / 10000) % raStates.length; + tcasRA = raStates[raPhase]; + if (tcasRA !== previousTcasRA) { + const raActive = (tcasRA & 1) !== 0; + if (raActive) { + pfdPlayAudio((tcasRA & 2) ? ((tcasRA & 4) ? "descend.wav" : "climb.wav") : "traffic.wav"); + } else if (previousTcasRA & 1) { + pfdPlayAudio("clear-of-conflict.wav"); + } + previousTcasRA = tcasRA; + } +} +var animateRaStart; +// Match the canvas backing store to the size it is displayed at, so text stays sharp +// however the window is resized - a fixed backing store scaled by CSS goes soft. +// Drawing code stays in the 1000x1000 logical space via the transform. +function pfdPrepareCanvas(pfd) { + // clientWidth/Height rather than getBoundingClientRect(), so the border is not + // included in the drawn area + if ((pfd.clientWidth > 0) && (pfd.clientHeight > 0)) { + const dpr = window.devicePixelRatio || 1; + const w = Math.round(pfd.clientWidth * dpr); + const h = Math.round(pfd.clientHeight * dpr); + if ((pfd.width !== w) || (pfd.height !== h)) { + pfd.width = w; + pfd.height = h; + } + } + const ctx = pfd.getContext("2d"); + ctx.setTransform(pfd.width / 1000, 0, 0, pfd.height / 1000, 0, 0); + return ctx; } + function drawPFD() { const canvas = document.getElementById("pfdCanvas"); - const ctx = canvas.getContext("2d"); + const ctx = pfdPrepareCanvas(canvas); ctx.font = "20px Arial"; const fm20 = ctx.measureText("180"); @@ -1174,221 +2074,222 @@ function drawPFD() { drawMachIndicator(ctx); - // Flight mode announciators + // Flight mode annunciators. Airbus: A/THR | vertical | lateral | approach capability | + // AP, FD, A/THR. Boeing: A/T | roll | pitch | AFDS status (LAND 3, CMD / FD). The + // column each mode goes in comes from the theme, as does the vocabulary - ctx.beginPath(); - ctx.moveTo(220, 5); - ctx.lineTo(220, 140); - ctx.lineWidth = 1; - ctx.strokeStyle = "white"; - ctx.stroke(); - if (targetSpeed !== undefined) { - ctx.font = "30px Arial"; - ctx.fillStyle = greenColor; - ctx.fillText("SPEED", 55, 50); // THR CLB is climbing? - } else if (toga) { - ctx.font = "30px Arial"; - ctx.fillStyle = "white"; - ctx.fillText("TOGA", 70, 50); + drawFMA(ctx); + + panelDrawClose(ctx); + + // Aircraft callsign and type + + ctx.fillStyle = "white"; + ctx.font = "30px Arial"; + if (callsign !== undefined) { + ctx.fillText(callsign, 20, 940); + } + ctx.font = "21px Arial"; + if (aircraftType !== undefined) { + ctx.fillText(aircraftType, 20, 980); } - // FIXME: - //ctx.font = "30px Arial"; - //ctx.fillStyle = "white"; - //ctx.fillText("toga " + toga + " roll " + rollOut + " Surf " + onSurface + " wasSurf " + wasOnSurface60SecsAgo + " MS " + modelSpeed + " r/w Alt " + runwayAltitude, 50, 150); + // TCAS mode, groundspeed, TAS, wind and SAT used to be drawn here, but they belong + // to the ND (navdisplay.js), which is where they are now - and setPFDData no longer + // takes them +} +// Per FMA slot, the label last shown there and when it appeared - a Boeing boxes a mode +// in green for ten seconds after it changes +var pfdFmaState = {}; +var pfdFmaDrawn = new Set(); + +function pfdFmaText(ctx, key, text, x, y, color) { + ctx.font = "30px Arial"; + ctx.fillStyle = color; + ctx.fillText(text, x, y); + pfdFmaDrawn.add(key); + if (pfdTheme.fmaHighlight) { + const now = Date.now(); + var s = pfdFmaState[key]; + if ((s === undefined) || (s.text !== text)) { + s = { text: text, since: now }; + pfdFmaState[key] = s; + } + if (now - s.since < 10000) { + const width = ctx.measureText(text).width; + ctx.lineWidth = 2; + ctx.strokeStyle = greenColor; + ctx.strokeRect(x - 6, y - 30, width + 12, 40); + } + } +} + +function drawFMA(ctx) { + const th = pfdTheme; + const L = th.labels; + const boeing = (th.name === "boeing"); + pfdFmaDrawn.clear(); + + const separator = function (x) { + ctx.beginPath(); + ctx.moveTo(x, 5); + ctx.lineTo(x, 140); + ctx.lineWidth = 1; + ctx.strokeStyle = "white"; + ctx.stroke(); + }; + + // Autothrust / autothrottle column + separator(220); + // Nothing sets targetSpeed: ADS-B carries a selected altitude and heading but no + // selected speed. The autopilot being on is the only signal there is, and both + // makers' displays are driven from it + if ((targetSpeed !== undefined) || (autopilot && !rollOut)) { + pfdFmaText(ctx, "athr", L.speed, 55, 50, greenColor); + } else if (toga) { + pfdFmaText(ctx, "athr", L.toga, 70, 50, "white"); + } + + // Vertical (pitch) and lateral (roll) modes. On an Airbus LAND, FLARE and ROLL OUT + // span both columns; on a Boeing FLARE is a pitch mode and ROLLOUT a roll mode var landing = false; - if (verticalMode !== undefined) { - ctx.font = "30px Arial"; - ctx.fillStyle = greenColor; + var spanX; + var pitchText; + var pitchColor = greenColor; + var rollText; + if (th.fmaTcas && (tcasRA & 1)) { + // An active resolution advisory takes the vertical mode column: TCAS is now + // flying the vertical path. Red for a corrective RA, white for preventive. + // Boeing does not annunciate TCAS there, so its pitch mode carries on + pitchText = "TCAS"; + pitchColor = (tcasRA & 2) ? redColor : "white"; + } else if (verticalMode !== undefined) { if (verticalMode == 1) { if (verticalSpeed !== undefined) { - if (verticalSpeed > 0) { - ctx.fillText("CLB", 290, 50); - } else if (verticalSpeed < 0) { - ctx.fillText("DES", 290, 50); - } else { - ctx.fillText("ALT", 290, 50); - } + pitchText = (verticalSpeed > 0) ? L.clb : ((verticalSpeed < 0) ? L.des : L.alt); } else if (targetAltitude !== undefined && altitude !== undefined) { - if (targetAltitude > altitude) { - ctx.fillText("CLB", 290, 50); - } else if (targetAltitude < altitude) { - ctx.fillText("DES", 290, 50); - } else { - ctx.fillText("ALT", 290, 50); - } + pitchText = (targetAltitude > altitude) ? L.clb : ((targetAltitude < altitude) ? L.des : L.alt); } } else if (verticalMode == 2) { - ctx.fillText("ALT", 290, 50); + pitchText = L.alt; } else if (verticalMode == 3) { if (rollOut) { - ctx.fillText("ROLL OUT", 370, 50); - landing = true; + if (th.landingSpans) { + pitchText = L.rollout; + spanX = 370; + landing = true; + } else { + rollText = L.rollout; + pitchText = L.flare; + } } else if ((onSurface === 0) && (radioAltitude < 40)) { - ctx.fillText("FLARE", 390, 50); - landing = true; + pitchText = L.flare; + if (th.landingSpans) { + spanX = 390; + landing = true; + } } else if ((onSurface === 0) && (radioAltitude < 400)) { - ctx.fillText("LAND", 400, 50); - landing = true; + pitchText = L.land; + if (th.landingSpans) { + spanX = 400; + landing = true; + } } else { - ctx.fillText("G/S", 290, 50); + pitchText = L.gs; } } } + if (pitchText !== undefined) { + pfdFmaText(ctx, "pitch", pitchText, landing ? spanX : th.verticalX, 50, pitchColor); + } + if (th.fmaTcas && !(tcasRA & 1) && !tcasInhibited + && (typeof ndHasTA === "function") && ndHasTA()) { + // A traffic advisory arms TCAS: it appears on the armed row beneath the active + // vertical mode, which carries on. Not below the inhibit height, where TCAS + // cannot resolve anything, so there is nothing for it to be armed for - the + // advisories themselves are still tracked and still drawn on the ND + pfdFmaText(ctx, "pitchArmed", "TCAS", th.verticalX, 85, th.armedColor); + } if (!landing) { - ctx.beginPath(); - ctx.moveTo(420, 5); - ctx.lineTo(420, 140); - ctx.lineWidth = 1; - ctx.strokeStyle = "white"; - ctx.stroke(); + separator(420); } + separator(660); - ctx.beginPath(); - ctx.moveTo(660, 5); - ctx.lineTo(660, 140); - ctx.lineWidth = 1; - ctx.strokeStyle = "white"; - ctx.stroke(); - if (lateralMode !== undefined) { - ctx.font = "30px Arial"; - ctx.fillStyle = greenColor; + if ((rollText === undefined) && (lateralMode !== undefined) && !landing) { if (lateralMode == 1) { - ctx.fillText("NAV", 510, 50); + rollText = L.nav; } else if (lateralMode == 2) { - if (!landing) { - ctx.fillText("LOC", 510, 50); - } + rollText = L.loc; } } + if (rollText !== undefined) { + pfdFmaText(ctx, "roll", rollText, th.lateralX, 50, greenColor); + } - ctx.beginPath(); - ctx.moveTo(850, 5); - ctx.lineTo(850, 140); - ctx.lineWidth = 1; - ctx.strokeStyle = "white"; - ctx.stroke(); - ctx.font = "30px Arial"; - ctx.fillStyle = "white"; - if (autopilot !== undefined) { + // Autoflight status + separator(850); + if (boeing) { + if (autopilot) { + pfdFmaText(ctx, "afds", "CMD", 870, 40, greenColor); + if (verticalMode == 3) { + pfdFmaText(ctx, "land", "LAND 3", 690, 40, greenColor); + } + } else if (autopilot !== undefined) { + pfdFmaText(ctx, "afds", "FD", 890, 40, "white"); + } + } else { + ctx.font = "30px Arial"; + ctx.fillStyle = "white"; if (autopilot) { if (verticalMode == 3) { // We can't tell whether both APs are enabled - but they typically would be - ctx.fillText("AP1+2", 870, 40); + ctx.fillText("AP1+2", 856, 40); ctx.fillText("CAT3", 720, 40); ctx.fillText("DUAL", 720, 85); } else { ctx.fillText("AP1", 890, 40); } } - } - ctx.fillText("1 FD 2", 870, 85); - if (((targetSpeed !== undefined) || autopilot) && !rollOut) { - ctx.fillText("A/THR", 870, 130); - } - - // Aircraft callsign and type - - ctx.fillStyle = "white"; - ctx.font = "30px Arial"; - if (callsign !== undefined) { - ctx.fillText(callsign, 20, 940); - } - ctx.font = "21px Arial"; - if (aircraftType !== undefined) { - ctx.fillText(aircraftType, 20, 980); - } - - const dataLeft = 750; // Aligned with QNH - const dataTop = 890; - - // TCAS - As displayed on ND/ECAM - if (tcasMode === 1) { - ctx.fillStyle = orangeColor; - ctx.font = "21px Arial"; - ctx.fillText("TCAS STBY", dataLeft, dataTop); - } else if (tcasMode === 2) { - ctx.fillStyle = "white"; - ctx.font = "21px Arial"; - ctx.fillText("TA ONLY", dataLeft, dataTop); - } - - // Groundspeed and TAS as displayed on ND - if ((groundspeed !== undefined) || (trueAirspeed !== undefined)) { - ctx.font = "21px Arial"; - if (groundspeed !== undefined) { - ctx.fillStyle = "white"; - ctx.fillText("GS", dataLeft, dataTop + 30); - ctx.fillStyle = greenColor; - ctx.fillText(Math.round(groundspeed).toString(), dataLeft + 40, dataTop + 30); + // Which flight directors are on is not reported; drawn for an aircraft that + // reports its autoflight state at all, rather than unconditionally + if (autopilot !== undefined) { + ctx.fillText("1 FD 2", 870, 85); } - if (trueAirspeed !== undefined) { - ctx.fillStyle = "white"; - ctx.fillText("TAS", dataLeft + 90, dataTop + 30); - ctx.fillStyle = greenColor; - ctx.fillText(Math.round(trueAirspeed).toString(), dataLeft + 140, dataTop + 30); + if (((targetSpeed !== undefined) || autopilot) && !rollOut) { + ctx.fillText("A/THR", 870, 130); } } - // Wind speed and direction as displayed on ND - if ((windSpeed !== undefined) && (windDirection !== undefined)) { - const windText = pad(Math.round(windDirection), 3) + "/" + Math.round(windSpeed); - ctx.fillStyle = greenColor; - ctx.font = "21px Arial"; - ctx.fillText(windText, dataLeft, dataTop + 60); - - if (heading !== undefined) { - // An arrow showing wind direction relative to heading - var angle = (windDirection - heading) * Math.PI / 180; - - ctx.save(); - ctx.translate(dataLeft + 80, dataTop + 53); - ctx.rotate(angle); - - ctx.strokeStyle = greenColor; - ctx.beginPath(); - ctx.moveTo(0, -10); - ctx.lineTo(0, 10); - ctx.lineTo(-5, 7); - ctx.moveTo(0, 10); - ctx.lineTo(5, 7); - ctx.stroke(); - - ctx.restore(); + // Forget slots that are empty this frame, so a mode that returns is boxed again + for (const key of Object.keys(pfdFmaState)) { + if (!pfdFmaDrawn.has(key)) { + delete pfdFmaState[key]; } } - - // Static air temperature as displayed on lower ECAM - if (staticAirTemperature !== undefined) { - var satText; - if (staticAirTemperature > 0) { - satText = "+" + Math.round(staticAirTemperature); - } else { - satText = Math.round(staticAirTemperature).toString(); - } - - ctx.font = "21px Arial"; - ctx.fillStyle = "white"; - ctx.fillText("SAT", dataLeft, dataTop + 90); - ctx.fillStyle = greenColor; - ctx.fillText(satText, dataLeft + 60, dataTop + 90); - ctx.fillStyle = cyanColor; - ctx.fillText("\u00B0C", dataLeft + 100, dataTop + 90); - } } + const canvas = document.getElementById('pfdCanvas'); canvas.onmousedown = pfdMouseDown; canvas.onmouseup = pfdMouseUp; canvas.onmousemove = pfdMouseMove; canvas.onmouseleave = pfdMouseLeave; canvas.onmouseenter = pfdMouseEnter; +// A drag that leaves the canvas carries on against the document, so the panel borrows +// its mouse handlers and gives them back when the drag ends. Whether they were borrowed +// has to be its own flag: nothing else in the page sets them, so what is saved is +// normally null, and testing that for truth never gave them back at all var docMouseMove = null; var docMouseUp = null; +var docMouseCaptured = false; var movePFD = false; var scalePFD = false; var posX = 0; +// Where the cursor was when the drag started, so each move places the panel +// absolutely from it rather than accumulating deltas +var pfdDragX = 0; +var pfdDragY = 0; var posY = 0; var canvasWidth = 0; var canvasHeight = 0; @@ -1403,10 +2304,16 @@ function pfdMouseDown(e) { e.preventDefault(); e.stopPropagation(); const r = canvas.getBoundingClientRect(); + if (panelInClose(e.offsetX * 1000 / r.width, e.offsetY * 1000 / r.height)) { + panelClose("pfd", canvas); + return; + } posX = r.left; posY = r.top; canvasWidth = r.width; canvasHeight = r.height; + pfdDragX = e.clientX; + pfdDragY = e.clientY; if ((e.offsetX > 0.95 * canvasWidth) && (e.offsetY > 0.95 * canvasHeight)) { scalePFD = true; } else { @@ -1416,6 +2323,9 @@ function pfdMouseDown(e) { function pfdMouseUp(e) { e.preventDefault(); e.stopPropagation(); + if (movePFD || scalePFD) { + panelSaveGeometry("pfd", canvas); + } movePFD = false; scalePFD = false; pfdRestoreDocMouse(); @@ -1424,38 +2334,39 @@ function pfdMouseMove(e) { e.preventDefault(); e.stopPropagation(); if (movePFD) { - posX = posX + e.movementX; - posY = posY + e.movementY; canvas.style.position = "absolute"; - canvas.style.left = posX + "px"; - canvas.style.top = posY + "px"; + canvas.style.left = (posX + e.clientX - pfdDragX) + "px"; + canvas.style.top = (posY + e.clientY - pfdDragY) + "px"; } else if (scalePFD) { - canvasWidth = canvasWidth + e.movementX; - canvasHeight = canvasHeight + e.movementY; - const constrainedWidth = Math.max(canvasWidth, 250); - const constrainedHeight = Math.max(canvasHeight, 250); + const newWidth = canvasWidth + e.clientX - pfdDragX; + const newHeight = canvasHeight + e.clientY - pfdDragY; + const constrainedWidth = Math.max(newWidth, 250); + const constrainedHeight = Math.max(newHeight, 250); canvas.style.width = constrainedWidth + "px"; canvas.style.height = constrainedHeight + "px"; + drawPFD(); // Redrawn at the new size, so it stays sharp while resizing } } function pfdMouseLeave(e) { //movePFD = false; //scalePFD = false; - if (scalePFD || movePFD) { + if ((scalePFD || movePFD) && !docMouseCaptured) { docMouseUp = document.onmouseup; docMouseMove = document.onmousemove; + docMouseCaptured = true; document.onmouseup = pfdMouseUp; document.onmousemove = pfdMouseMove; } } function pfdRestoreDocMouse() { - if (docMouseUp) { + if (docMouseCaptured) { document.onmouseup = docMouseUp; document.onmousemove = docMouseMove; - docMouseDown = null; + docMouseUp = null; docMouseMove = null; + docMouseCaptured = false; } } function pfdMouseEnter(e) { diff --git a/plugins/feature/map/map/dcdu.js b/plugins/feature/map/map/dcdu.js new file mode 100644 index 000000000..caa922c92 --- /dev/null +++ b/plugins/feature/map/map/dcdu.js @@ -0,0 +1,277 @@ +// Airbus like DCDU (Datalink Control and Display Unit), for CPDLC/PDC messages +// Must be loaded after cockpit.js, as it shares its color constants +// All globals are prefixed dcdu, to avoid clashing in the page's shared scope + +var dcduMessage; // Parsed dcduMessage property: {id, rx, up, stn, txt} +var dcduHeader = ""; +var dcduLines = []; // Message text, word wrapped +var dcduPage = 0; + +const dcduLinesPerPage = 9; +const dcduTextTop = 130; +const dcduLineHeight = 56; +// On-canvas controls, in the 1000x800 canvas coordinate space +const dcduPgRect = { x: 600, y: 680, w: 220, h: 100 }; +const dcduCloseRect = { x: 830, y: 680, w: 170, h: 100 }; + +function dcduPages() { + return Math.max(1, Math.ceil(dcduLines.length / dcduLinesPerPage)); +} + +function dcduWrapText(ctx, text, maxWidth) { + var lines = []; + for (const paragraph of text.split("\n")) { + var line = ""; + for (const word of paragraph.split(/\s+/)) { + const candidate = (line.length > 0) ? line + " " + word : word; + if ((ctx.measureText(candidate).width <= maxWidth) || (line.length === 0)) { + line = candidate; + } else { + lines.push(line); + line = word; + } + } + lines.push(line); + } + return lines; +} + +function setDCDUMessage(message) { + dcduMessage = message; + + // Header - e.g. "1412Z FROM EDDS" + var header = ""; + if ((message.rx !== undefined) && (message.rx.length >= 16)) { + header = message.rx.substring(11, 13) + message.rx.substring(14, 16) + "Z"; + } + header += (message.up === 1) ? " FROM" : " TO"; + if (message.stn !== undefined) { + header += " " + message.stn; + } + dcduHeader = header.trim(); + + const ctx = dcduCanvas.getContext("2d"); + ctx.font = "40px Courier New"; + dcduLines = dcduWrapText(ctx, message.txt !== undefined ? message.txt : "", 940); + dcduPage = 0; + drawDCDU(); +} + +// Match the canvas backing store to the size it is displayed at, so text stays sharp +// however the window is resized - a fixed backing store scaled by CSS goes soft. +// Drawing code stays in the 1000x800 logical space via the transform. +function dcduPrepareCanvas() { + // clientWidth/Height rather than getBoundingClientRect(), so the border is not + // included in the drawn area + if ((dcduCanvas.clientWidth > 0) && (dcduCanvas.clientHeight > 0)) { + const dpr = window.devicePixelRatio || 1; + const w = Math.round(dcduCanvas.clientWidth * dpr); + const h = Math.round(dcduCanvas.clientHeight * dpr); + if ((dcduCanvas.width !== w) || (dcduCanvas.height !== h)) { + dcduCanvas.width = w; + dcduCanvas.height = h; + } + } + const ctx = dcduCanvas.getContext("2d"); + ctx.setTransform(dcduCanvas.width / 1000, 0, 0, dcduCanvas.height / 800, 0, 0); + return ctx; +} + +function drawDCDU() { + const ctx = dcduPrepareCanvas(); + + ctx.fillStyle = "#0c0c0c"; + ctx.fillRect(0, 0, 1000, 800); + + // Header + ctx.font = "40px Courier New"; + ctx.textAlign = "left"; + ctx.fillStyle = "white"; + ctx.fillText(dcduHeader, 30, 60); + + // Message text + ctx.fillStyle = greenColor; + const first = dcduPage * dcduLinesPerPage; + for (var i = 0; (i < dcduLinesPerPage) && (first + i < dcduLines.length); i++) { + ctx.fillText(dcduLines[first + i], 30, dcduTextTop + i * dcduLineHeight); + } + + // Divider above the bottom row + ctx.strokeStyle = grayColor; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(0, 665); + ctx.lineTo(1000, 665); + ctx.stroke(); + + // Page indicator, click to flip + if (dcduPages() > 1) { + ctx.textAlign = "center"; + ctx.fillStyle = "white"; + ctx.fillText("PG", dcduPgRect.x + dcduPgRect.w / 2, 725); + ctx.fillStyle = cyanColor; + ctx.fillText((dcduPage + 1) + " " + dcduPages(), dcduPgRect.x + dcduPgRect.w / 2, 775); + } + + // Close button + ctx.textAlign = "right"; + ctx.fillStyle = cyanColor; + ctx.fillText("CLOSE*", dcduCloseRect.x + dcduCloseRect.w - 10, 755); + + panelDrawClose(ctx); +} + +// The panel-visibility menu on the Map toolbar can veto the DCDU entirely +var dcduEnabled = true; + +function showDCDUMessage(message, playSound) { + if (!dcduEnabled) { + return; + } + // Unhidden first: a hidden canvas has no size, and the backing store is matched + // to the displayed size when it is drawn + dcduCanvas.removeAttribute("hidden"); + setDCDUMessage(message); + // The ring's volume - and whether it is heard at all - is the cockpit volume + // slider in Map Display Settings + if (playSound) { + dcduRing(); + } +} + +// Ring for an incoming message. The audio files are served from the qrc audio +// directory, a sibling of the directory map3d.html is in +function dcduRing() { + try { + const audio = new Audio("../audio/ATC.wav"); + // The cockpit volume slider in Map Display Settings - map3d.html holds the value + audio.volume = (typeof cockpitSoundVolume !== "undefined") ? cockpitSoundVolume : 1.0; + // play() returns a promise, which rejects rather than throws on failure + audio.play().catch((e) => { + console.log("DCDU ring failed: " + e); + }); + } catch (e) { + console.log("DCDU ring failed: " + e); + } +} + +// Self-test with fake data, callable from the DevTools console while developing +function animateDCDU() { + showDCDUMessage({ + id: 1, + rx: "2026-09-01T14:12:03Z", + up: 1, + stn: "EDDS", + txt: "STATION PDC 001 . . . . .\nCLD 2042 220117 EDDS PDC 001 FBW291 CLRD TO EDDM OFF 25 VIA ABTAL4B " + + "CLIMB 5000 SQUAWK 1000 ADT MDI NEXT FREQ 121.905 ATIS K QNH 1021 " + + "TRANS LEVEL FL70 EXPECT FL230 TEN MIN AFTER DEP CONTACT LANGEN RADAR 118.800" + }, true); +} + +const dcduCanvas = document.getElementById('dcduCanvas'); +dcduCanvas.onmousedown = dcduMouseDown; +dcduCanvas.onmouseup = dcduMouseUp; +dcduCanvas.onmousemove = dcduMouseMove; +dcduCanvas.onmouseleave = dcduMouseLeave; +dcduCanvas.onmouseenter = dcduMouseEnter; +var dcduDocMouseMove = null; +var dcduDocMouseUp = null; +var dcduDocMouseCaptured = false; +var dcduMove = false; +var dcduScale = false; +var dcduPosX = 0; +// Where the cursor was when the drag started, so each move places the panel +// absolutely from it rather than accumulating deltas +var dcduDragX = 0; +var dcduDragY = 0; +var dcduPosY = 0; +var dcduCanvasWidth = 0; +var dcduCanvasHeight = 0; + +function dcduInRect(x, y, rect) { + return (x >= rect.x) && (x <= rect.x + rect.w) && (y >= rect.y) && (y <= rect.y + rect.h); +} + +function dcduMouseDown(e) { + e.preventDefault(); + e.stopPropagation(); + const r = dcduCanvas.getBoundingClientRect(); + // Canvas is drawn in a 1000x800 space, then CSS scaled + const x = e.offsetX * 1000 / r.width; + const y = e.offsetY * 800 / r.height; + // The corner button closes the panel for good; CLOSE* only dismisses the message + if (panelInClose(x, y)) { + panelClose("dcdu", dcduCanvas); + return; + } + if (dcduInRect(x, y, dcduCloseRect)) { + dcduCanvas.setAttribute("hidden", "hidden"); + return; + } + if ((dcduPages() > 1) && dcduInRect(x, y, dcduPgRect)) { + dcduPage = (dcduPage + 1) % dcduPages(); + drawDCDU(); + return; + } + dcduPosX = r.left; + dcduPosY = r.top; + dcduCanvasWidth = r.width; + dcduCanvasHeight = r.height; + dcduDragX = e.clientX; + dcduDragY = e.clientY; + if ((e.offsetX > 0.95 * dcduCanvasWidth) && (e.offsetY > 0.95 * dcduCanvasHeight)) { + dcduScale = true; + } else { + dcduMove = true; + } +} +function dcduMouseUp(e) { + e.preventDefault(); + e.stopPropagation(); + if (dcduMove || dcduScale) { + panelSaveGeometry("dcdu", dcduCanvas); + } + dcduMove = false; + dcduScale = false; + dcduRestoreDocMouse(); +} +function dcduMouseMove(e) { + e.preventDefault(); + e.stopPropagation(); + if (dcduMove) { + dcduCanvas.style.position = "absolute"; + dcduCanvas.style.left = (dcduPosX + e.clientX - dcduDragX) + "px"; + dcduCanvas.style.top = (dcduPosY + e.clientY - dcduDragY) + "px"; + } else if (dcduScale) { + const newWidth = dcduCanvasWidth + e.clientX - dcduDragX; + const newHeight = dcduCanvasHeight + e.clientY - dcduDragY; + const constrainedWidth = Math.max(newWidth, 250); + const constrainedHeight = Math.max(newHeight, 200); + dcduCanvas.style.width = constrainedWidth + "px"; + dcduCanvas.style.height = constrainedHeight + "px"; + drawDCDU(); // Redrawn at the new size, so it stays sharp while resizing + } +} + +function dcduMouseLeave(e) { + if ((dcduScale || dcduMove) && !dcduDocMouseCaptured) { + dcduDocMouseUp = document.onmouseup; + dcduDocMouseMove = document.onmousemove; + dcduDocMouseCaptured = true; + document.onmouseup = dcduMouseUp; + document.onmousemove = dcduMouseMove; + } +} + +function dcduRestoreDocMouse() { + if (dcduDocMouseCaptured) { + document.onmouseup = dcduDocMouseUp; + document.onmousemove = dcduDocMouseMove; + dcduDocMouseUp = null; + dcduDocMouseMove = null; + dcduDocMouseCaptured = false; + } +} +function dcduMouseEnter(e) { + dcduRestoreDocMouse(); +} diff --git a/plugins/feature/map/map/map.qml b/plugins/feature/map/map/map.qml index ba6b824cf..801abb4ea 100644 --- a/plugins/feature/map/map/map.qml +++ b/plugins/feature/map/map/map.qml @@ -88,6 +88,11 @@ Item { delegate: polylineComponent } + MapItemView { + model: polylineModelFiltered + delegate: polylineTrackComponent + } + MapItemView { model: polylineModelFiltered delegate: polylineNameComponent @@ -104,6 +109,11 @@ Item { delegate: groundTrack2Component } + MapItemView { + model: mapModelFiltered + delegate: groundTrackSegmentsComponent + } + MapItemView { model: mapModelFiltered delegate: predictedGroundTrack1Component @@ -115,27 +125,24 @@ Item { } MapItemView { + // Each MapItemView is a MapItemGroup, so it owns its delegates as children - a + // delegate's z only ranks it among that view's own items. Ordering icons above + // ground tracks therefore has to happen between the VIEWS, not inside them. + z: 1 model: mapModelFiltered delegate: mapComponent } onZoomLevelChanged: { mapZoomLevel = zoomLevel - mapModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - imageModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - polygonModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - polylineModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); + viewCoordinator.viewChanged(visibleRegion.boundingGeoRectangle(), zoomLevel); } // The map displays MapPolyLines in the wrong place (+360 degrees) if // they start to the left of the visible region, so we need to // split them so they don't, each time the visible region is changed. meh. onCenterChanged: { - polylineModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - polygonModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - imageModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - mapModelFiltered.viewChanged(visibleRegion.boundingGeoRectangle().topLeft.longitude, visibleRegion.boundingGeoRectangle().topLeft.latitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude, visibleRegion.boundingGeoRectangle().bottomRight.latitude, zoomLevel); - mapModel.viewChanged(visibleRegion.boundingGeoRectangle().bottomLeft.longitude, visibleRegion.boundingGeoRectangle().bottomRight.longitude); + viewCoordinator.viewChanged(visibleRegion.boundingGeoRectangle(), zoomLevel); } onSupportedMapTypesChanged : { @@ -238,13 +245,125 @@ Item { id: mapComponent MapQuickItem { id: mapElement - anchorPoint.x: image.width/2 - anchorPoint.y: image.height/2 + z: zOrder // Move to front / move to back + anchorPoint.x: imageBounds.width/2 + anchorPoint.y: imageBounds.height/2 coordinate: position // when zooming, mapImageMinZoom can be temporarily undefined. Not sure why zoomLevel: (typeof mapImageMinZoom !== 'undefined') ? (mapZoomLevel > mapImageMinZoom ? mapZoomLevel : mapImageMinZoom) : zoomLevel autoFadeIn: false // not in 5.12 + + // A context menu per item is most of what an item costs to show, and it is + // only ever needed for the one item that gets right-clicked, so it is built + // on demand rather than for every item on the map + Component { + id: contextMenuComponent + Item { + property alias contextMenu: contextMenu + property alias menus: menus + property alias menuItems: menuItems + property alias coordsMenuItem: coordsMenuItem + ListModel { + id: menus + } + ListModel { + id: menuItems + } + Menu { + id: contextMenu + MenuItem { + text: "Set as target" + onTriggered: target = true + } + MenuItem { + text: "Move to front" + onTriggered: mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) + } + MenuItem { + text: "Move to back" + onTriggered: mapModel.moveToBack(mapModelFiltered.mapRowToSource(index)) + } + MenuItem { + text: "Track on 3D map" + onTriggered: mapModel.track3D(mapModelFiltered.mapRowToSource(index)) + } + MenuItem { + id: coordsMenuItem + text: "" + } + Instantiator { + model: menus + delegate: Menu { + //cascade: true + id: contextSubMenu + title: model.title + } + onObjectAdded: function(index, object) { + contextMenu.insertMenu(index, object) + } + onObjectRemoved: function(index, object) { + contextMenu.removeMenu(object) + } + } + Instantiator { + model: menuItems + delegate: MenuItem { + text: model.text + onTriggered: mapModel.setFrequency(model.frequency, model.deviceSet) + } + onObjectAdded: function(index, object) { + // index is index in to menuItems model + // object is the MenuItem + var menuItem = menuItems.get(index) + var menu = menus.get(menuItem.menuIndex) + contextMenu.menuAt(menuItem.menuIndex).insertItem(index, object) + } + onObjectRemoved: function(index, object) { + // Can't use menuItems.get(index) here, as already removed from model + object.menu.removeItem(object) + } + } + } + } + } + + Loader { + id: contextMenuLoader + active: false + } + + // Populate and show the menu for this item, creating it the first time + function showContextMenu(mouseX, mouseY) { + if (!contextMenuLoader.active) { + contextMenuLoader.sourceComponent = contextMenuComponent + contextMenuLoader.active = true + } + var menu = contextMenuLoader.item + menu.menuItems.clear() + menu.menus.clear() + if (frequencies.length > 0) { + var deviceSets = mapModel.getDeviceSets() + for (var i = 0; i < deviceSets.length; i++) { + menu.menus.append({ + title: "Set " + deviceSets[i] + " to...", + deviceSet: i + }) + for (var j = 0; j < frequencies.length; j++) { + menu.menuItems.append({ + text: frequencyStrings[j], + frequency: frequencies[j], + deviceSet: deviceSets[i], + menuIndex: i + }) + } + } + } + var c = mapPtr.toCoordinate(Qt.point(mouseX, mouseY)) + menu.coordsMenuItem.text = "Coords: " + c.latitude.toFixed(6) + ", " + c.longitude.toFixed(6) + menu.contextMenu.popup() + } + sourceItem: Grid { id: gridItem columns: 1 @@ -253,44 +372,31 @@ Item { columnSpacing: 5 layer.enabled: smoothing layer.smooth: smoothing - Image { - id: image - rotation: mapImageRotation - source: mapImage - visible: mapImageVisible - MouseArea { - anchors.fill: parent - hoverEnabled: true - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - if (mouse.button === Qt.LeftButton) { - selected = !selected - if (selected) { - mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) - } - } else if (mouse.button === Qt.RightButton) { - menuItems.clear() - menus.clear() - if (frequencies.length > 0) { - var deviceSets = mapModel.getDeviceSets() - for (var i = 0; i < deviceSets.length; i++) { - menus.append({ - title: "Set " + deviceSets[i] + " to...", - deviceSet: i - }) - for (var j = 0; j < frequencies.length; j++) { - menuItems.append({ - text: frequencyStrings[j], - frequency: frequencies[j], - deviceSet: deviceSets[i], - menuIndex: i - }) - } + // Sized to the rotated image's bounding box, so the smoothing layer + // doesn't clip wingtips and the bubble sits close at every rotation + Item { + id: imageBounds + width: image.implicitWidth * Math.abs(Math.cos(mapImageRotation * Math.PI / 180)) + image.implicitHeight * Math.abs(Math.sin(mapImageRotation * Math.PI / 180)) + height: image.implicitWidth * Math.abs(Math.sin(mapImageRotation * Math.PI / 180)) + image.implicitHeight * Math.abs(Math.cos(mapImageRotation * Math.PI / 180)) + Image { + id: image + anchors.centerIn: parent + rotation: mapImageRotation + source: mapImage + visible: mapImageVisible + MouseArea { + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: { + if (mouse.button === Qt.LeftButton) { + selected = !selected + if (selected) { + mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) } + } else if (mouse.button === Qt.RightButton) { + mapElement.showContextMenu(mouse.x, mouse.y) } - var c = mapPtr.toCoordinate(Qt.point(mouse.x, mouse.y)) - coordsMenuItem.text = "Coords: " + c.latitude.toFixed(6) + ", " + c.longitude.toFixed(6) - contextMenu.popup() } } } @@ -314,89 +420,7 @@ Item { mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) } } else if (mouse.button === Qt.RightButton) { - menuItems.clear() - menus.clear() - if (frequencies.length > 0) { - var deviceSets = mapModel.getDeviceSets() - for (var i = 0; i < deviceSets.length; i++) { - menus.append({ - title: "Set " + deviceSets[i] + " to...", - deviceSet: i - }) - for (var j = 0; j < frequencies.length; j++) { - menuItems.append({ - text: frequencyStrings[j], - frequency: frequencies[j], - deviceSet: deviceSets[i], - menuIndex: i - }) - } - } - } - var c = mapPtr.toCoordinate(Qt.point(mouse.x, mouse.y)) - coordsMenuItem.text = "Coords: " + c.latitude.toFixed(6) + ", " + c.longitude.toFixed(6) - contextMenu.popup() - } - } - ListModel { - id: menus - } - ListModel { - id: menuItems - } - Menu { - id: contextMenu - MenuItem { - text: "Set as target" - onTriggered: target = true - } - MenuItem { - text: "Move to front" - onTriggered: mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) - } - MenuItem { - text: "Move to back" - onTriggered: mapModel.moveToBack(mapModelFiltered.mapRowToSource(index)) - } - MenuItem { - text: "Track on 3D map" - onTriggered: mapModel.track3D(mapModelFiltered.mapRowToSource(index)) - } - MenuItem { - id: coordsMenuItem - text: "" - } - Instantiator { - model: menus - delegate: Menu { - //cascade: true - id: contextSubMenu - title: model.title - } - onObjectAdded: function(index, object) { - contextMenu.insertMenu(index, object) - } - onObjectRemoved: function(index, object) { - contextMenu.removeMenu(object) - } - } - Instantiator { - model: menuItems - delegate: MenuItem { - text: model.text - onTriggered: mapModel.setFrequency(model.frequency, model.deviceSet) - } - onObjectAdded: function(index, object) { - // index is index in to menuItems model - // object is the MenuItem - var menuItem = menuItems.get(index) - var menu = menus.get(menuItem.menuIndex) - contextMenu.menuAt(menuItem.menuIndex).insertItem(index, object) - } - onObjectRemoved: function(index, object) { - // Can't use menuItems.get(index) here, as already removed from model - object.menu.removeItem(object) - } + mapElement.showContextMenu(mouse.x, mouse.y) } } } @@ -420,6 +444,7 @@ Item { Component { id: predictedGroundTrack1Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: predictedGroundTrackColor path: predictedGroundTrack1 @@ -431,6 +456,7 @@ Item { Component { id: predictedGroundTrack2Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: predictedGroundTrackColor path: predictedGroundTrack2 @@ -441,6 +467,7 @@ Item { Component { id: groundTrack1Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: groundTrackColor path: groundTrack1 @@ -452,6 +479,7 @@ Item { Component { id: groundTrack2Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: groundTrackColor path: groundTrack2 @@ -459,4 +487,41 @@ Item { } } + // A MapPolyline can only be one colour, so a ground track that's coloured according + // to altitude is drawn as a series of them + Component { + id: groundTrackSegmentComponent + MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above + line.width: 2 + line.color: segmentColor + path: segmentCoordinates + autoFadeIn: false + } + } + + Component { + id: groundTrackSegmentsComponent + MapItemGroup { + z: -0.5 // Under every icon, which sit at 0 or above + MapItemView { + model: groundTrackModel + delegate: groundTrackSegmentComponent + } + } + } + + // A line sent as a track (item type 4) is coloured by the altitude of its points, so + // like a ground track it has to be drawn as a series of lines rather than as one + Component { + id: polylineTrackComponent + MapItemGroup { + z: -0.5 // Under every icon, which sit at 0 or above + MapItemView { + model: polylineTrackModel + delegate: groundTrackSegmentComponent + } + } + } + } diff --git a/plugins/feature/map/map/map3d.html b/plugins/feature/map/map/map3d.html index 79d7df997..ef75df5d9 100644 --- a/plugins/feature/map/map/map3d.html +++ b/plugins/feature/map/map/map3d.html @@ -21,34 +21,653 @@ </head> <body style="margin:0;padding:0"> <div id="cesiumContainer"></div> + <script src="aircraftaudio.js"></script> <script src="grid.js"></script> <script> + // Cesium rejects some promises with plain objects rather than Errors, which the + // application log shows as an unhelpful "[object Object]" - so give every + // rejection a readable form, and report any that nothing caught + function formatRejection(e) { + if (e instanceof Error) { + return `${e.name}: ${e.message}`; + } + try { + return JSON.stringify(e); + } catch (x) { + return String(e); + } + } + + // Cesium's own logging passes objects to console.log as well, which the + // application log shows the same way - so those get the same readable form + const consoleLog = console.log.bind(console); + console.log = function (...args) { + consoleLog(...args.map((a) => ((a !== null) && (typeof a === 'object')) ? formatRejection(a) : a)); + }; + + window.addEventListener("unhandledrejection", function (ev) { + console.log("Unhandled promise rejection: " + formatRejection(ev.reason)); + ev.preventDefault(); + }); + // See: https://community.cesium.com/t/how-to-run-an-animation-for-an-entity-model/16932 - function getActiveAnimations(viewer, entity) { + // The loaded Model primitive drawn for an entity, if there is one yet + function getModelPrimitive(viewer, entity) { var primitives = viewer.scene.primitives; var length = primitives.length; for (var i = 0; i < length; i++) { var primitive = primitives.get(i); if (primitive.id === entity && primitive instanceof Cesium.Model && primitive.ready) { - return primitive.activeAnimations; + return primitive; + } + } + return undefined; + } + + function getActiveAnimations(viewer, entity) { + var primitive = getModelPrimitive(viewer, entity); + return (primitive !== undefined) ? primitive.activeAnimations : undefined; + } + + // Sounds accompanying model animations, positioned in 3D at the entity they are + // for, relative to the camera, so they appear to come from the aircraft + // How sound falls away with distance, shared by the one-shots and the engine + // loops. Within the reference distance it is at full volume; beyond it the + // inverse law applies, steepened by the rolloff. The maximum matters as much as + // the shape: WebAudio's default is 10 km, at which point the distance stops + // being taken into account at all - and engine loops play out to 20 km + const audioRefDistance = 500; // Metres + const audioRolloffFactor = 2; + const audioMaxDistance = 50000; + + // Doppler shift. WebAudio's own doppler support (setVelocity, dopplerFactor) was + // removed from the specification years ago, so the shift is applied by hand to the + // sample playback rate. Clamped well inside what the physics gives - an airliner + // approaching at 250 m/s is Mach 0.7 and would shift by nearly four times, which + // turns a recorded engine into a squeal + const dopplerSpeedOfSound = 343; // m/s + const dopplerMinRate = 0.75; // Receding + const dopplerMaxRate = 1.35; // Approaching + const dopplerJumpLimit = 400; // m/s, beyond which the camera or target jumped + const dopplerSmoothing = 0.4; // Of the shift itself, per update + var spatialAudioContext = null; + const spatialAudioBuffers = new Map(); // Full audio URL -> Promise of decoded AudioBuffer + + // [0..1] From the Map Display Settings volume sliders + var mapItemSoundVolume = 1.0; // Sounds located at map items - engines and animations + var cockpitSoundVolume = 1.0; // Cockpit sounds - callouts and the datalink ring + + function ensureSpatialAudioContext() { + if (spatialAudioContext === null) { + spatialAudioContext = new (window.AudioContext || window.webkitAudioContext)(); + } + // A suspended context plays nothing, silently + if (spatialAudioContext.state === "suspended") { + spatialAudioContext.resume().catch(() => { }); + } + return spatialAudioContext; + } + + function getSpatialAudioBuffer(name) { + const url = name.startsWith("/") || name.includes("://") ? name : "../audio/" + name; + if (!spatialAudioBuffers.has(url)) { + spatialAudioBuffers.set(url, + fetch(url) + .then((response) => { + if (!response.ok) { + throw new Error("HTTP " + response.status); + } + return response.arrayBuffer(); + }) + .then((data) => spatialAudioContext.decodeAudioData(data)) + ); + } + return spatialAudioBuffers.get(url); + } + + function playSpatialAudio(name, entity) { + try { + ensureSpatialAudioContext(); + const position = entity.position.getValue(viewer.clock.currentTime); + if (!Cesium.defined(position)) { + return; } + // The entity's position in the WebAudio listener frame, which is the + // camera's: x right, y up, -z forward. Units are metres in both. + const camera = viewer.camera; + const delta = Cesium.Cartesian3.subtract(position, camera.positionWC, new Cesium.Cartesian3()); + const x = Cesium.Cartesian3.dot(delta, camera.rightWC); + const y = Cesium.Cartesian3.dot(delta, camera.upWC); + const z = -Cesium.Cartesian3.dot(delta, camera.directionWC); + getSpatialAudioBuffer(name) + .then((buffer) => { + const source = spatialAudioContext.createBufferSource(); + source.buffer = buffer; + const panner = spatialAudioContext.createPanner(); + panner.panningModel = "HRTF"; + panner.distanceModel = "inverse"; + panner.refDistance = audioRefDistance; + panner.rolloffFactor = audioRolloffFactor; + panner.maxDistance = audioMaxDistance; + if (panner.positionX !== undefined) { + panner.positionX.value = x; + panner.positionY.value = y; + panner.positionZ.value = z; + } else { + panner.setPosition(x, y, z); + } + const gain = spatialAudioContext.createGain(); + gain.gain.value = mapItemSoundVolume; + source.connect(gain); + gain.connect(panner); + panner.connect(spatialAudioContext.destination); + source.start(); + }) + .catch((e) => { + console.log(`Spatial audio ${name} failed: ${e}`); + const url = name.startsWith("/") || name.includes("://") ? name : "../audio/" + name; + spatialAudioBuffers.delete(url); // So a transient fetch failure can be retried + }); + } catch (e) { + console.log(`Spatial audio failed: ${e}`); + } + } + + // Sounds looped at entities that have a loopSound property. A value ending in + // an audio extension is a legacy single recording; any other value names a + // directory below /3d/Sounds containing engine.json and its OGG layers. + const loopSounds = new Map(); + const loopSoundErrors = new Set(); + const loopSoundRange = 20000; + const loopSoundStopRange = 22000; + const loopSoundGain = 0.5; + const loopSoundMaxCount = 8; + const loopSoundRetryMilliseconds = 10000; + var loopSoundBus = null; + + function loopSoundProperty(entity, name, time) { + const p = entity.properties; + if (Cesium.defined(p) && p.hasProperty(name)) { + return p[name].getValue(time); } return undefined; } + function logLoopSoundError(key, message) { + if (!loopSoundErrors.has(key)) { + loopSoundErrors.add(key); + console.log(message); + } + } + + function ensureLoopSoundBus() { + ensureSpatialAudioContext(); + if (loopSoundBus === null) { + // Several layers and aircraft can peak together. A gentle final limiter + // protects the rest of the Map audio without changing the layer curves. + const limiter = spatialAudioContext.createDynamicsCompressor(); + limiter.threshold.value = -6.0; + limiter.knee.value = 6.0; + limiter.ratio.value = 6.0; + limiter.attack.value = 0.005; + limiter.release.value = 0.25; + limiter.connect(spatialAudioContext.destination); + loopSoundBus = limiter; + } + return loopSoundBus; + } + + function isSingleLoopSound(name) { + return !name.includes("..") && /^[A-Za-z0-9._-]+\.(wav|ogg)$/i.test(name); + } + + function createLoopMaster(entry) { + const master = spatialAudioContext.createGain(); + master.gain.value = loopSoundGain * mapItemSoundVolume; + master.connect(ensureLoopSoundBus()); + entry.masterGain = master; + return master; + } + + function createLoopPanner(entry, spatial) { + const panner = spatialAudioContext.createPanner(); + panner.panningModel = "equalpower"; + panner.distanceModel = "inverse"; + panner.refDistance = spatial.fullScaleDistance; + panner.rolloffFactor = audioRolloffFactor; + panner.maxDistance = audioMaxDistance; + panner.coneInnerAngle = spatial.insideConeAngle; + panner.coneOuterAngle = spatial.outsideConeAngle; + panner.coneOuterGain = AircraftAudio.outsideConeVolumeToGain(spatial.outsideConeVolume); + panner.connect(entry.masterGain); + const group = { panner: panner, spatial: spatial }; + entry.groups.push(group); + return group; + } + + function startLoopLayer(entry, group, definition, buffer, initialGain, initialRate) { + const source = spatialAudioContext.createBufferSource(); + source.buffer = buffer; + source.loop = true; // The converted files contain no separate loop-point metadata + source.playbackRate.value = initialRate; + const gain = spatialAudioContext.createGain(); + const now = spatialAudioContext.currentTime; + gain.gain.setValueAtTime(0.0, now); + gain.gain.linearRampToValueAtTime(initialGain, now + 0.5); + source.connect(gain); + gain.connect(group.panner); + source.start(0, Math.random() * buffer.duration); + entry.layers.push({ + definition: definition, + source: source, + gain: gain, + engineRate: initialRate + }); + } + + function startSingleLoopSound(entry) { + createLoopMaster(entry); + const spatial = { + conePitch: 0.0, + coneHeading: 0.0, + insideConeAngle: 360.0, + outsideConeAngle: 360.0, + outsideConeVolume: 10000.0, + fullScaleDistance: audioRefDistance + }; + const group = createLoopPanner(entry, spatial); + getSpatialAudioBuffer(entry.name) + .then((buffer) => { + if (loopSounds.get(entry.entity.id) === entry) { + startLoopLayer(entry, group, undefined, buffer, 1.0, 1.0); + } + }) + .catch((e) => { + const url = "../audio/" + entry.name; + spatialAudioBuffers.delete(url); + entry.failed = true; + entry.retryAfter = performance.now() + loopSoundRetryMilliseconds; + logLoopSoundError(entry.name, `Loop sound ${entry.name} failed: ${e}`); + }); + } + + function startEngineLoopSound(entry, time) { + AircraftAudio.loadConfiguration(entry.name) + .then((configuration) => Promise.all(configuration.layers.map((definition) => { + const url = configuration.baseURL + encodeURIComponent(definition.filename); + return getSpatialAudioBuffer(url) + .then((buffer) => ({ definition: definition, buffer: buffer })) + .catch((e) => { + spatialAudioBuffers.delete(url); + logLoopSoundError(url, `Engine layer ${url} failed: ${e}`); + return null; + }); + }))) + .then((loaded) => { + if (loopSounds.get(entry.entity.id) !== entry) { + return; + } + const available = loaded.filter((layer) => layer !== null); + if (available.length === 0) { + throw new Error("no engine layers could be loaded"); + } + + createLoopMaster(entry); + const groups = new Map(); + entry.engineState = AircraftAudio.estimateEngineState( + (name) => loopSoundProperty(entry.entity, name, time)); + const now = spatialAudioContext.currentTime; + for (const loadedLayer of available) { + const definition = loadedLayer.definition; + const key = AircraftAudio.spatialProfileKey(definition.spatial); + let group = groups.get(key); + if (group === undefined) { + group = createLoopPanner(entry, definition.spatial); + groups.set(key, group); + } + const spool = entry.engineState[definition.kind]; + const volume = AircraftAudio.volumePercentToGain( + AircraftAudio.interpolateCurve(definition.vparams, spool)); + const rate = AircraftAudio.interpolateCurve(definition.rparams, spool); + startLoopLayer(entry, group, definition, loadedLayer.buffer, volume, rate); + } + entry.lastEngineUpdate = performance.now(); + entry.failed = false; + // Give newly-created panners their true position before their fade-in + updateOneLoopSoundSpatial(entry, viewer.clock.currentTime, viewer.camera); + }) + .catch((e) => { + if (loopSounds.get(entry.entity.id) === entry) { + entry.failed = true; + entry.retryAfter = performance.now() + loopSoundRetryMilliseconds; + } + logLoopSoundError(entry.name, `Engine sound set ${entry.name} failed: ${e}`); + }); + } + + function stopLoopSound(id) { + const entry = loopSounds.get(id); + if (entry === undefined) { + return; + } + loopSounds.delete(id); + if (spatialAudioContext === null) { + return; + } + const now = spatialAudioContext.currentTime; + for (const layer of entry.layers) { + try { + layer.gain.gain.cancelScheduledValues(now); + layer.gain.gain.setValueAtTime(layer.gain.gain.value, now); + layer.gain.gain.linearRampToValueAtTime(0.0, now + 0.3); + layer.source.stop(now + 0.35); + } catch (e) { + } + } + setTimeout(() => { + for (const group of entry.groups) { + group.panner.disconnect(); + } + if (entry.masterGain !== null) { + entry.masterGain.disconnect(); + } + }, 400); + } + + function setLoopPannerPosition(panner, x, y, z, now) { + if (panner.positionX !== undefined) { + panner.positionX.setTargetAtTime(x, now, 0.06); + panner.positionY.setTargetAtTime(y, now, 0.06); + panner.positionZ.setTargetAtTime(z, now, 0.06); + } else { + panner.setPosition(x, y, z); + } + } + + function setLoopPannerOrientation(panner, x, y, z, now) { + if (panner.orientationX !== undefined) { + panner.orientationX.setTargetAtTime(x, now, 0.06); + panner.orientationY.setTargetAtTime(y, now, 0.06); + panner.orientationZ.setTargetAtTime(z, now, 0.06); + } else { + panner.setOrientation(x, y, z); + } + } + + function loopSoundConeDirection(entity, time, spatial, camera) { + if ((spatial.insideConeAngle >= 360.0) && (spatial.outsideConeAngle >= 360.0)) { + return undefined; + } + if (!Cesium.defined(entity.orientation)) { + return null; + } + const orientation = entity.orientation.getValue(time); + if (!Cesium.defined(orientation)) { + return null; + } + + // Cesium applies its glTF axis correction before entity.orientation. In + // this entity-local frame +X is forward, +Z is up and -Y is right. + const heading = Cesium.Math.toRadians(spatial.coneHeading); + const pitch = Cesium.Math.toRadians(spatial.conePitch); + const cosPitch = Math.cos(pitch); + const localDirection = new Cesium.Cartesian3( + Math.cos(heading) * cosPitch, + -Math.sin(heading) * cosPitch, + Math.sin(pitch)); + const worldDirection = Cesium.Matrix3.multiplyByVector( + Cesium.Matrix3.fromQuaternion(orientation), localDirection, new Cesium.Cartesian3()); + return { + x: Cesium.Cartesian3.dot(worldDirection, camera.rightWC), + y: Cesium.Cartesian3.dot(worldDirection, camera.upWC), + z: -Cesium.Cartesian3.dot(worldDirection, camera.directionWC) + }; + } + + function updateOneLoopSoundSpatial(entry, time, camera) { + const entity = entry.entity; + const position = Cesium.defined(entity.position) ? entity.position.getValue(time) : undefined; + if (!Cesium.defined(position)) { + return; + } + const delta = Cesium.Cartesian3.subtract(position, camera.positionWC, new Cesium.Cartesian3()); + const distance = Cesium.Cartesian3.magnitude(delta); + const wallNow = performance.now(); + if (entry.lastDistance !== undefined) { + const dt = (wallNow - entry.lastWallTime) / 1000.0; + if ((dt > 0.02) && (dt < 1.0)) { + const radialRate = (distance - entry.lastDistance) / dt; // Receding is positive + if (Math.abs(radialRate) < dopplerJumpLimit) { + const shift = Math.max(dopplerMinRate, Math.min(dopplerMaxRate, + dopplerSpeedOfSound / (dopplerSpeedOfSound + radialRate))); + entry.doppler += (shift - entry.doppler) * dopplerSmoothing; + } else { + entry.doppler = 1.0; + } + } + } + entry.lastDistance = distance; + entry.lastWallTime = wallNow; + + if (entry.groups.length === 0) { + return; + } + const x = Cesium.Cartesian3.dot(delta, camera.rightWC); + const y = Cesium.Cartesian3.dot(delta, camera.upWC); + const z = -Cesium.Cartesian3.dot(delta, camera.directionWC); + const now = spatialAudioContext.currentTime; + for (const group of entry.groups) { + setLoopPannerPosition(group.panner, x, y, z, now); + const direction = loopSoundConeDirection(entity, time, group.spatial, camera); + if (direction === null) { + // Until an orientation arrives, do not impose a cone in an arbitrary direction. + group.panner.coneInnerAngle = 360.0; + group.panner.coneOuterAngle = 360.0; + group.panner.coneOuterGain = 1.0; + } else if (direction !== undefined) { + group.panner.coneInnerAngle = group.spatial.insideConeAngle; + group.panner.coneOuterAngle = group.spatial.outsideConeAngle; + group.panner.coneOuterGain = AircraftAudio.outsideConeVolumeToGain(group.spatial.outsideConeVolume); + setLoopPannerOrientation(group.panner, direction.x, direction.y, direction.z, now); + } + } + for (const layer of entry.layers) { + layer.source.playbackRate.setTargetAtTime(layer.engineRate * entry.doppler, now, 0.04); + } + } + + function updateLoopSoundSpatial() { + if ((typeof viewer === "undefined") || (spatialAudioContext === null)) { + return; + } + const time = viewer.clock.currentTime; + const camera = viewer.camera; + for (const entry of loopSounds.values()) { + updateOneLoopSoundSpatial(entry, time, camera); + } + } + + function updateLoopSounds() { + if ((typeof viewer === "undefined") || (typeof czmlStream === "undefined")) { + return; + } + const time = viewer.clock.currentTime; + const camera = viewer.camera; + const candidates = []; + for (const candidateEntity of czmlStream.entities.values) { + if (!Cesium.defined(candidateEntity.properties) || !candidateEntity.properties.hasProperty("loopSound")) { + continue; + } + const candidateName = candidateEntity.properties["loopSound"].getValue(time); + if ((typeof candidateName !== "string") || (candidateName.length === 0) || !candidateEntity.isAvailable(time)) { + continue; + } + const position = Cesium.defined(candidateEntity.position) ? candidateEntity.position.getValue(time) : undefined; + if (!Cesium.defined(position)) { + continue; + } + const candidateDelta = Cesium.Cartesian3.subtract(position, camera.positionWC, new Cesium.Cartesian3()); + const distance = Cesium.Cartesian3.magnitude(candidateDelta); + const playing = loopSounds.has(candidateEntity.id); + if (distance > (playing ? loopSoundStopRange : loopSoundRange)) { + continue; + } + candidates.push({ + entity: candidateEntity, + name: candidateName, + sortDistance: playing ? distance - 500.0 : distance + }); + } + candidates.sort((a, b) => a.sortDistance - b.sortDistance); + + const seen = new Set(); + for (let i = 0; (i < candidates.length) && (i < loopSoundMaxCount); i++) { + const entity = candidates[i].entity; + const name = candidates[i].name; + let entry = loopSounds.get(entity.id); + if ((entry !== undefined) && ((entry.name !== name) + || (entry.failed && (performance.now() >= entry.retryAfter)))) { + stopLoopSound(entity.id); + entry = undefined; + } + if (entry === undefined) { + ensureSpatialAudioContext(); + entry = { + name: name, + entity: entity, + masterGain: null, + groups: [], + layers: [], + engineState: undefined, + lastEngineUpdate: performance.now(), + doppler: 1.0, + lastDistance: undefined, + lastWallTime: 0, + failed: false, + retryAfter: 0 + }; + loopSounds.set(entity.id, entry); + if (isSingleLoopSound(name)) { + startSingleLoopSound(entry); + } else { + startEngineLoopSound(entry, time); + } + } + seen.add(entity.id); + + if (entry.masterGain !== null) { + const now = spatialAudioContext.currentTime; + entry.masterGain.gain.setTargetAtTime(loopSoundGain * mapItemSoundVolume, now, 0.1); + if (entry.engineState !== undefined) { + const wallNow = performance.now(); + const target = AircraftAudio.estimateEngineState( + (property) => loopSoundProperty(entity, property, time)); + entry.engineState = AircraftAudio.smoothEngineState( + entry.engineState, target, (wallNow - entry.lastEngineUpdate) / 1000.0); + entry.lastEngineUpdate = wallNow; + for (const layer of entry.layers) { + if (layer.definition === undefined) { + continue; + } + const spool = entry.engineState[layer.definition.kind]; + const volume = AircraftAudio.volumePercentToGain( + AircraftAudio.interpolateCurve(layer.definition.vparams, spool)); + layer.engineRate = AircraftAudio.interpolateCurve(layer.definition.rparams, spool); + layer.gain.gain.setTargetAtTime(volume, now, 0.25); + } + } + } + } + for (const id of Array.from(loopSounds.keys())) { + if (!seen.has(id)) { + stopLoopSound(id); + } + } + } + setInterval(updateLoopSounds, 250); + setInterval(updateLoopSoundSpatial, 50); + + // Models the sender asks to animate but that lack the animation, keyed by model + // URI (so one discovery covers every aircraft using that model) + animation + // name. The ADS-B sender cannot know which animations each model has, and it + // re-asserts engine animations every few minutes - without this memo every + // re-assertion logged a DeveloperError per engine per aircraft, forever. + var missingAnimations = new Set(); + function animationMemoKey(entity, command) { + var model = ""; + try { + if (entity.model && entity.model.uri) { + model = String(entity.model.uri.getValue(viewer.clock.currentTime)); + } + } catch (e) { + } + return (model || command.id) + "|" + command.animation; + } + + // A model swap - a stand-in replaced once the aircraft's type is known - leaves + // the old primitive in the scene until the new glTF has loaded, while the + // entity's uri already names the new one. An animation asked for in that window + // would be played on the old model and, when that model lacks it, memoised + // against the new model's uri - suppressing it for every aircraft using that + // model for the rest of the session. So the primitive being replaced is + // remembered here, and playAnimation waits for its replacement instead. + var staleModelPrimitives = new Map(); // Entity id to the Model primitive on its way out + function noteModelChange(packet) { + var entity = czmlStream.entities.getById(packet.id); + if ((entity === undefined) || !entity.model || !entity.model.uri) { + return; + } + var url = entity.model.uri.getValue(viewer.clock.currentTime); + if (url && (typeof url !== "string")) { + url = url.url; // A Resource + } + if (url && (url != packet.model.gltf)) { + var primitive = getModelPrimitive(viewer, entity); + if (primitive !== undefined) { + staleModelPrimitives.set(packet.id, primitive); + } + } + } + function playAnimation(viewer, command, retries) { var entity = czmlStream.entities.getById(command.id); if (entity !== undefined) { - var animations = getActiveAnimations(viewer, entity); + if (missingAnimations.has(animationMemoKey(entity, command))) { + return; + } + var animations; + var primitive = getModelPrimitive(viewer, entity); + if ((primitive !== undefined) && (staleModelPrimitives.get(command.id) === primitive)) { + // Still the model being replaced - wait for the new one, via the + // retry below, as if no primitive existed yet + animations = undefined; + } else { + staleModelPrimitives.delete(command.id); + animations = (primitive !== undefined) ? primitive.activeAnimations : undefined; + } if (animations !== undefined) { try { + // A looped animation being (re)asserted replaces the one + // already playing, rather than piling up on it. Only looped: + // one-shot sequences legitimately queue the same animation + // several times with staggered start times. + if (command.loop) { + for (var ai = animations.length - 1; ai >= 0; ai--) { + var existing = animations.get(ai); + if (existing.name == command.animation) { + animations.remove(existing); + } + } + } let options = { name: command.animation, startOffset: command.startOffset, reverse: command.reverse, loop: command.loop ? Cesium.ModelAnimationLoop.REPEAT : Cesium.ModelAnimationLoop.NONE, - multiplier: 0.2 // command.multiplier, + // A sender that did not set a multiplier sends 0, which + // would freeze the animation + multiplier: command.multiplier ? command.multiplier : 1.0 }; options.startTime = Cesium.JulianDate.fromIso8601(command.startDateTime); // https://github.com/CesiumGS/cesium/issues/10048 @@ -61,13 +680,26 @@ options.stopTime = Cesium.JulianDate.addSeconds(options.startTime, command.duration, new Cesium.JulianDate()); } const anim = animations.add(options); + // Only reached when the model has the animation, so a sound is + // never played for an animation the aircraft does not make. + // Played when the animation actually starts - the start time + // may be in the future. + if ((command.sound !== undefined) && (command.sound.length > 0)) { + anim.start.addEventListener(function () { + playSpatialAudio(command.sound, entity); + }); + } } catch (e) { // Note we get TypeError instead of DeveloperError, if running minified version of Cesium if ((e instanceof Cesium.DeveloperError) || (e instanceof TypeError)) { - // ADS-B plugin doesn't know which animations each aircraft has - // so we should expect a lot of these, as it tries to start slat animations - // on aircraft that do not have them - console.log(`Exception playing ${command.animation} for ${command.id}\n${e}`); + // ADS-B plugin doesn't know which animations each aircraft + // has, so this model simply lacks it. Remember, so it is + // logged once per model and never attempted again + const key = animationMemoKey(entity, command); + if (!missingAnimations.has(key)) { + missingAnimations.add(key); + console.log(`Model has no animation ${command.animation} (first seen on ${command.id}) - suppressing further attempts`); + } } else { throw e; } @@ -153,7 +785,9 @@ if (Cesium.defined(picked)) { var firstPolygon = null; for (let i = 0; i < picked.length; i++) { - var id = Cesium.defaultValue(picked[i].id, picked[i].primitive.id); + // Not Cesium.defaultValue, which Cesium 1.126 removed + var id = Cesium.defined(picked[i].id) ? picked[i].id + : (Cesium.defined(picked[i].primitive) ? picked[i].primitive.id : undefined); if (id instanceof Cesium.Entity) { if (!Cesium.defined(id.polygon)) { return id; @@ -173,8 +807,10 @@ function pickAndTrack(e) { const entity = pickEntityPrioritized(e); if (Cesium.defined(entity)) { - if (viewFirstPerson) { + if (cameraMode === cameraModeFirstPerson) { setFirstPersonView(entity); + } else if (cameraMode === cameraModeFlyBy) { + setFlyByView(entity); } else { if (Cesium.Property.getValueOrUndefined(entity.position, viewer.clock.currentTime)) { setThirdPersonView(entity); @@ -207,7 +843,7 @@ const cartesian = viewer.scene.globe.pick(ray, viewer.scene); var cartographic = Cesium.Cartographic.fromCartesian(cartesian); Promise.resolve( - Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [cartographic]), + sampleSurfaceHeight([cartographic]), ).then((updatedPositions) => { longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(6); latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(6); @@ -219,6 +855,8 @@ `Lon: ${` ${longitudeString}`}\u00B0` + `\nLat: ${` ${latitudeString}`}\u00B0` + `\nAlt: ${` ${heightString}`}m`; + }).catch(() => { + // Terrain sampling can fail transiently - no marker this click }); } } @@ -228,15 +866,352 @@ positionMarker.label.show = false; } + // Whether there's a surface heights can be sampled from. Without one, everything + // is on the ellipsoid at height 0, and sampleTerrainMostDetailed would reject. + function hasSurfaceHeights() { + if (googleTileset !== undefined) { + return viewer.scene.sampleHeightSupported; + } + return !(viewer.terrainProvider instanceof Cesium.EllipsoidTerrainProvider); + } + + // Nothing on Earth is higher than Everest, so anything above this can't be underground + // and doesn't need the surface lookup below - which is most aircraft, in the cruise + const maxSurfaceHeight = 9000; + const minSurfaceHeight = -500; // The Dead Sea shore is -430 m; sea level itself ranges -106 to +85 m above the ellipsoid + + // Most of the rest aren't either: Cesium ships the highest terrain in each ~3 degree + // cell of the world, and only buildings stand above that - none taller than this. + // Sampling costs a render of the scene, so it is worth ruling out all it can + const maxBuildingHeight = 1000; + var terrainHeightsLoaded = false; + Cesium.ApproximateTerrainHeights.initialize().then(() => { + terrainHeightsLoaded = true; + }).catch((e) => { + console.log(`Approximate terrain heights unavailable: ${formatRejection(e)}`); + }); + const terrainHeightsRectangle = new Cesium.Rectangle(); + + function maxSurfaceHeightAt(cartographic) { + if (!terrainHeightsLoaded) { + return maxSurfaceHeight; + } + terrainHeightsRectangle.west = terrainHeightsRectangle.east = cartographic.longitude; + terrainHeightsRectangle.south = terrainHeightsRectangle.north = cartographic.latitude; + const heights = Cesium.ApproximateTerrainHeights.getMinimumMaximumHeights(terrainHeightsRectangle); + return Math.min(maxSurfaceHeight, heights.maximumTerrainHeight + maxBuildingHeight); + } + + // Height of the surface below a position, from what is already loaded or drawn, so it + // costs nothing to fetch. + // scene.getHeight is preferred, as it only considers the globe and 3D tilesets, so it + // can't pick up one of our own items by mistake. It works for terrain, but not for + // Google's tiles: it picks against tile content on the CPU, and their detailed content + // returns no hits (only the coarse root tiles do, which would give a height kilometres + // below the surface). So for those, read the depth buffer instead, which means sampling + // whatever is drawn - hence excluding our own items, otherwise an aircraft can end up + // clamped on to another aircraft that happens to be above it. + // sampleHeight renders the scene and reads it back, which is far too slow to do for + // every aircraft in a feed, so it is only used for positions that are on screen - + // where being underground is the only time it shows. Everything else keeps the + // altitude it was sent with, and is clipped when it next moves into view. + // The culling volume is computed from the viewer's camera here rather than taken + // from scene.frameState: sampleHeight renders with its own camera, a 0.01m wide + // orthographic frustum pointing down at the sampled point, and leaves that in + // frameState until the next frame is rendered. Tested against that, every position + // after the first in a message is off screen, so is never clipped + var onScreenFrame = -1; + var onScreenOccluder; + var onScreenCullingVolume; + const onScreenCartesian = new Cesium.Cartesian3(); + const onScreenSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(), 1.0); + + function positionOnScreen(cartographic) { + const scene = viewer.scene; + const ellipsoid = scene.ellipsoid ?? Cesium.Ellipsoid.WGS84; + const cartesian = Cesium.Cartographic.toCartesian(cartographic, ellipsoid, onScreenCartesian); + if (onScreenFrame !== scene.frameState.frameNumber) { + onScreenFrame = scene.frameState.frameNumber; + const camera = viewer.camera; + onScreenOccluder = new Cesium.EllipsoidalOccluder(ellipsoid, camera.positionWC); + onScreenCullingVolume = camera.frustum.computeCullingVolume(camera.positionWC, camera.directionWC, camera.upWC); + } + if (!onScreenOccluder.isPointVisible(cartesian)) { + return false; // Over the horizon + } + Cesium.Cartesian3.clone(cartesian, onScreenSphere.center); + return onScreenCullingVolume.computeVisibility(onScreenSphere) !== Cesium.Intersect.OUTSIDE; + } + + // The ground doesn't move, so heights are reused between updates and between aircraft, + // on a grid ~50m across - an aircraft doesn't need finer than that to sit on a runway. + // The tiles only refine after the camera moves, so a height is sampled again once + // the camera has moved since it was taken and it is this old - a still camera + // never samples twice. A sample costs ~13ms, whatever it draws: the scene is + // rendered again and a pixel read back, which waits for the GPU to finish the + // frame in hand. So at most one is taken per frame, and the rest of the positions + // keep what they have until their next update - they arrive every second. A sample + // that found nothing is retried sooner, as the tiles there are usually still on + // their way + const surfaceHeights = new Map(); + const surfaceHeightGrid = 0.0005; + const surfaceHeightsMax = 50000; + const surfaceHeightMaxAge = 20000; // ms + const surfaceHeightRetry = 1000; // ms + const surfaceSamplesPerFrame = 1; + var surfaceSampleFrame = -1; + var surfaceSamplesThisFrame = 0; + var cameraMoves = 0; // Counts camera.changed events + + // What became of each position that could have needed clipping, for the perf line: + // ruled out by the terrain gate, served from the cache, not sampled as it was off + // screen, sampled (and how long that took), or sampled but nothing found there + + // sampleHeight reads back whatever is drawn, so everything of ours is hidden while + // it samples: the data sources' primitives (labels, points, billboards), the + // entities' models - which ModelVisualizer adds straight to scene.primitives, not + // to the data source's collection, so they have to be found there - and the + // tracks, which are drawn outside the data sources. Naming the entities in + // objectsToExclude instead has Cesium render the scene again for each one the ray + // hits on its way to the ground - and for an aircraft, its own model and label + // are always hit first. Sampled at the aircraft's own position, an unhidden model + // reads back as ground at its own altitude, and a radio altitude of nothing. + // _primitives and _groundPrimitives are DataSourceDisplay's collections for all + // its data sources + function sampleDrawnHeight(cartographic) { + const display = viewer.dataSourceDisplay; + const hidden = []; + for (const collection of [display._primitives, display._groundPrimitives, trackPolylines]) { + if (Cesium.defined(collection) && collection.show) { + collection.show = false; + hidden.push(collection); + } + } + const primitives = viewer.scene.primitives; + for (let i = 0; i < primitives.length; i++) { + const primitive = primitives.get(i); + if ((primitive instanceof Cesium.Model) && (primitive.id instanceof Cesium.Entity) && primitive.show) { + primitive.show = false; + hidden.push(primitive); + } + } + try { + return viewer.scene.sampleHeight(cartographic); + } finally { + for (const item of hidden) { + item.show = true; + } + } + } + + function surfaceHeightAt(cartographic, force) { + if (googleTileset === undefined) { + return viewer.scene.getHeight(cartographic, Cesium.HeightReference.CLAMP_TO_GROUND); + } + const lat = Cesium.Math.toDegrees(cartographic.latitude); + const lon = Cesium.Math.toDegrees(cartographic.longitude); + const key = Math.round(lat / surfaceHeightGrid) + "," + Math.round(lon / surfaceHeightGrid); + const now = performance.now(); + let cached = surfaceHeights.get(key); + if ((cached !== undefined) && ((now < cached.expires) || (Cesium.defined(cached.height) && (cached.moves === cameraMoves)))) { + return cached.height; + } + const frame = viewer.scene.frameState.frameNumber; + if (frame !== surfaceSampleFrame) { + surfaceSampleFrame = frame; + surfaceSamplesThisFrame = 0; + } + if (!viewer.scene.sampleHeightSupported || (!force && !positionOnScreen(cartographic)) + || (!force && (surfaceSamplesThisFrame >= surfaceSamplesPerFrame))) { + // Can't be sampled now, so what was last sampled is still the best there is + return cached?.height; + } + surfaceSamplesThisFrame++; + let height = sampleDrawnHeight(cartographic); + // Nothing on Earth stands above maxSurfaceHeight, so a sample that does did not + // come from the ground: it found something else drawn there. Nor is any ground + // below minSurfaceHeight: that is the planet-scale tiles drawn before the ones + // for the place have arrived, seen 27 km down + if (!Cesium.defined(height) || !isFinite(height) || (height > maxSurfaceHeight) || (height < minSurfaceHeight)) { + height = undefined; + } + if (cached === undefined) { + if (surfaceHeights.size >= surfaceHeightsMax) { + surfaceHeights.clear(); + } + cached = { height: undefined, expires: 0, moves: -1 }; + surfaceHeights.set(key, cached); + } + cached.moves = cameraMoves; + if (Cesium.defined(height)) { + cached.height = height; + cached.expires = now + surfaceHeightMaxAge; + } else { + cached.expires = now + surfaceHeightRetry; + } + return cached.height; + } + + // One sample's height, lifted to the surface when it is below it. + // Aircraft on the ground are sent at an altitude of 0, so this runs for every + // position update - use what is already drawn or loaded, which is synchronous, + // rather than sampling for the most detailed. Stays synchronous: this runs for + // every aircraft in the feed, so it must not queue work per position update + const clipCartographic = new Cesium.Cartographic(); + function clipSampleToGround(coords, heightIdx) { + const height = coords[heightIdx]; + if (height > maxSurfaceHeight) { + return; // Above any surface, so nothing to look up + } + const position = Cesium.Cartographic.fromDegrees( + coords[heightIdx - 2], coords[heightIdx - 1], 0, clipCartographic); + if (height > maxSurfaceHeightAt(position)) { + return; // Above anything standing in this part of the world + } + const surface = surfaceHeightAt(position); + if (Cesium.defined(surface)) { + if (height < surface) { + coords[heightIdx] = surface; + } + } else if (!hasSurfaceHeights() && (height < 0)) { + // Nothing to sample - the surface is the ellipsoid, at height 0 + coords[heightIdx] = 0; + } + } + + // A track's vertices are lifted to just above the surface where they are below it, + // as the aircraft they belong to is by Cesium's CLIP_TO_GROUND - a track on the + // ground is otherwise drawn beneath the terrain or tiles and never seen. The same + // question Cesium asks for the aircraft, of what is loaded: cheap for terrain, + // a ray pick through the tiles otherwise, so only asked below the terrain gate + const trackGroundClearance = 1.0; // m, or the line fights the surface for pixels + // Heights under track vertices, on a grid ~10 m across. A segment is re-sent as + // the smoother refines it, and every vertex was asked for again each time - a ray + // pick through the tiles per vertex, a tenth of the frame time on a busy map - + // though the ground under it had not changed. Kept for as long as the surface is: + // the tiles refine a little as they load, which a line drawn a metre up forgives + const trackGroundHeights = new Map(); + const trackGroundGrid = 0.0001; // degrees + const trackGroundMax = 200000; + // ...and where nothing was loaded, when that was found: the tracks stretch + // far beyond the tiles selected around the camera, and each re-sent segment + // asked again for every vertex out there - a ray through every selected + // tile's bounding sphere per vertex, thousands a second + const trackGroundMisses = new Map(); + const trackGroundRetryMs = 10000; + function trackGroundAt(lon, lat, position, reference) { + const key = Math.round(lon / trackGroundGrid) + "," + Math.round(lat / trackGroundGrid); + const cached = trackGroundHeights.get(key); + if (cached !== undefined) { + return cached; + } + const now = performance.now(); + const missed = trackGroundMisses.get(key); + if ((missed !== undefined) && (now - missed < trackGroundRetryMs)) { + return undefined; + } + const ground = viewer.scene.getHeight(position, reference); + if (Cesium.defined(ground)) { + if (trackGroundHeights.size >= trackGroundMax) { + trackGroundHeights.clear(); + } + trackGroundHeights.set(key, ground); + trackGroundMisses.delete(key); + } else { + if (trackGroundMisses.size >= trackGroundMax) { + trackGroundMisses.clear(); + } + trackGroundMisses.set(key, now); + } + return ground; + } + function clipTrackToGround(coords) { + if (!hasSurfaceHeights()) { + return; + } + const reference = (googleTileset !== undefined) ? Cesium.HeightReference.CLAMP_TO_3D_TILE : Cesium.HeightReference.CLAMP_TO_GROUND; + for (let i = 0; i + 2 < coords.length; i += 3) { + const height = coords[i + 2]; + const position = Cesium.Cartographic.fromDegrees(coords[i], coords[i + 1], 0, clipCartographic); + if (height > maxSurfaceHeightAt(position)) { + continue; + } + const ground = trackGroundAt(coords[i], coords[i + 1], position, reference); + if (Cesium.defined(ground) && (height < ground + trackGroundClearance)) { + coords[i + 2] = ground + trackGroundClearance; + } + } + } + + // A CZML position is either a constant [lon, lat, height] or time tagged samples + // of [time, lon, lat, height] repeated. An aircraft with the PFD open sends its + // whole smoothed window as one packet, so every sample is clipped, not just the + // first - previously such a packet was passed through unclipped, and logged + var loggedBadPosition = false; + function clipPositionToGround(coords) { + const stride = (coords.length == 3) ? 3 : 4; + if ((coords.length % stride) != 0) { + // Can't happen from CZML::update() - logged once, never per packet + if (!loggedBadPosition) { + loggedBadPosition = true; + console.log(`Position of ${coords.length} values is neither a constant nor whole time tagged samples - not clipping`); + } + return; + } + for (let heightIdx = stride - 1; heightIdx < coords.length; heightIdx += stride) { + clipSampleToGround(coords, heightIdx); + } + } + + // Sample the height of the surface at the given Cartographic positions. + // Google's 3D tiles aren't terrain, so have to be sampled from the rendered scene, + // where objectsToExclude keeps an entity from being sampled against itself. + function sampleSurfaceHeight(positions, objectsToExclude) { + if (googleTileset === undefined) { + return Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, positions); + } + return Promise.resolve( + viewer.scene.sampleHeightMostDetailed(positions, objectsToExclude) + ).then((updatedPositions) => { + for (const position of updatedPositions) { + if (position.height === undefined) { // Nothing was hit at this position + position.height = 0; + } + } + return updatedPositions; + }); + } + Cesium.Ion.defaultAccessToken = '$CESIUM_ION_API_KEY$'; if ('$ARCGIS_API_KEY$' != '') { Cesium.ArcGisMapService.defaultAccessToken = '$ARCGIS_API_KEY$'; } + // Imagery in the "Cesium ion" category (Bing, Google, Azure, Sentinel-2, Blue Marble, + // Earth at night, Natural Earth) uses Cesium Ion quota, so is only offered in the base + // layer picker if the user has entered their own Cesium Ion API key + let imageryViewModels = Cesium.createDefaultImageryProviderViewModels(); + if ('$HAS_CESIUM_ION_USER_KEY$' != 'true') { + imageryViewModels = imageryViewModels.filter((vm) => vm.category != "Cesium ion"); + } + + // Names used in the settings dialog that differ from Cesium's view model names + const imageryNameMap = { + "ArcGIS world imagery": "ArcGIS World Imagery", + "Ersi world ocean": "Esri World Ocean" + }; + + function findImageryViewModel(name) { + const cesiumName = imageryNameMap[name] || name; + return imageryViewModels.find((vm) => vm.name == cesiumName); + } + // Start time is set via CZML::init() - const viewer = new Cesium.Viewer('cesiumContainer', { - baseLayer: false, - terrainProvider: Cesium.createWorldTerrainAsync(), + // Terrain is not set here - setTerrain is sent as soon as the websocket connects, + // and requesting world terrain here would use Cesium Ion quota whatever the settings say + const viewer = new Cesium.Viewer('cesiumContainer', { + imageryProviderViewModels: imageryViewModels, + selectedImageryProviderViewModel: findImageryViewModel('$DEFAULT_IMAGERY$'), animation: true, shouldAnimate: true, timeline: true, @@ -244,29 +1219,381 @@ fullscreenButton: true, navigationHelpButton: false, navigationInstructionsInitiallyVisible: false, + contextOptions: { + // An image material draws the placeholder texture while its own is + // still loading, and an opaque one flashes white + // https://github.com/CesiumGS/cesium/issues/1640 + transparentDefaultTexture: true + }, terrainProviderViewModels: [] // User should adjust terrain via dialog, so depthTestAgainstTerrain doesn't get set }); - //viewer.scene.debugShowFramesPerSecond = true; // FIXME: Embedded Chrome only runs at 60fps + viewer.targetFrameRate = $TARGET_FRAME_RATE$; viewer.scene.globe.depthTestAgainstTerrain = false; // So labels/points aren't clipped by terrain (this prevents pickPosition from working) viewer.scene.globe.tileCacheSize = 5000; // FIXME: Embedded Chrome is slower at loading from cache viewer.scene.moon.onlySunLighting = false; // Moon can be just a black dot if default of true viewer.screenSpaceEventHandler.setInputAction(pickEntity, Cesium.ScreenSpaceEventType.LEFT_CLICK); viewer.screenSpaceEventHandler.setInputAction(pickAndTrack, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); viewer.screenSpaceEventHandler.setInputAction(showCoords, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK, Cesium.KeyboardEventModifier.SHIFT); + viewer.screenSpaceEventHandler.setInputAction(flyByWheel, Cesium.ScreenSpaceEventType.WHEEL); viewer.screenSpaceEventHandler.setInputAction(hideCoords, Cesium.ScreenSpaceEventType.RIGHT_CLICK); + // The scene mode (2D/3D/Columbus) and imagery pickers act on the globe, which isn't + // drawn while Google's tiles are, so they are hidden rather than left there doing nothing + function showGlobePickers(show) { + const display = show ? "" : "none"; + // A picker's container is the viewer's toolbar, shared with the home, geocoder + // and help buttons - hiding that took them all. Its own elements are the + // button (_element, or _wrapper for the scene mode picker) and, for the base layer + // picker, the drop-down (_dropPanel) + if (Cesium.defined(viewer.baseLayerPicker)) { + for (const element of [viewer.baseLayerPicker._element, viewer.baseLayerPicker._dropPanel]) { + if (Cesium.defined(element)) { + element.style.display = display; + } + } + } + if (Cesium.defined(viewer.sceneModePicker) && Cesium.defined(viewer.sceneModePicker._wrapper)) { + viewer.sceneModePicker._wrapper.style.display = display; + } + } + + // Far mode. An aircraft model is one fuselage mesh plus ~30 animated parts - gear legs + // and doors, flaps, slats, tyres, engine fans - each on its own node so it can move, + // and each a draw call: ~31 per aircraft, which is what set the frame rate with a + // busy sky (2,772 draw commands for 92 aircraft, 44 ms of CPU a frame). Beyond + // farModelDistance those parts are a pixel or two of a minimumPixelSize icon, so they + // are hidden and only the fuselage draws. Which nodes are animated is read from each + // model's own glTF, once, so nothing here depends on the models' structure. + var farModelDistance = 20000; // metres from the camera + const modelAnimatedNodes = new Map(); // model URL -> node names, or null while loading + + // Fill light for distant aircraft. A model is lit by the single scene light, and + // its ambient comes from an environment map generated at the model's own position. + // Looking out at traffic near the horizon the camera usually sees the side away + // from the sun, and with the minimum pixel size holding those aircraft large they + // read as black cut-outs with no livery. A flat ambient term lifts the unlit side. + // + // It is the spherical harmonic coefficients rather than the environment map's + // atmosphereScatteringIntensity or the model's lightColor: measured against a + // backlit model, those two changed nothing once the model was built, and this + // moved it from 68 to 77 in mean brightness. Supplying coefficients replaces the + // sky-tinted ambient with a neutral one, which is what shows a livery best. + // Only the constant term is set - a uniform light from every direction + // Set from the Map's display settings - "Distant light intensity", 0 turns it off + var farModelAmbient = 0.5; + var farAmbientCoefficients = farAmbientFor(farModelAmbient); + + function farAmbientFor(a) { + return [ + new Cesium.Cartesian3(a, a, a), + new Cesium.Cartesian3(), new Cesium.Cartesian3(), new Cesium.Cartesian3(), + new Cesium.Cartesian3(), new Cesium.Cartesian3(), new Cesium.Cartesian3(), + new Cesium.Cartesian3(), new Cesium.Cartesian3() + ]; + } + + // A new strength has to reach models that already have the old one on them, so + // their flag is cleared and the next pass reapplies it + function setFarModelAmbient(a) { + if (a === farModelAmbient) { + return; + } + farModelAmbient = a; + farAmbientCoefficients = farAmbientFor(a); + const primitives = viewer.scene.primitives; + for (let i = 0; i < primitives.length; i++) { + const model = primitives.get(i); + if ((model instanceof Cesium.Model) && (model.imageBasedLighting !== undefined)) { + if (model.farAmbient) { + model.imageBasedLighting.sphericalHarmonicCoefficients = + (a > 0) ? farAmbientCoefficients : undefined; + } + model.farAmbient = undefined; + } + } + updateFarMode(); + } + + // Each model carries its own ImageBasedLighting, so this is per aircraft. Assigning + // rebuilds the model's shaders, so it is only done when the side it is on changes + function setFarAmbient(model, on) { + if ((farModelAmbient <= 0) || (model.imageBasedLighting === undefined) + || (model.farAmbient === on)) { + return; + } + model.farAmbient = on; + model.imageBasedLighting.sphericalHarmonicCoefficients = + on ? farAmbientCoefficients : undefined; + } + + // A model covering less than this achieves nothing by being drawn. Cesium draws a + // model whatever its size on screen, so a sub-pixel aircraft costs nearly as much + // as a close one - measured on a 128 aircraft feed, a frame took 25ms with them + // and 2ms without. A model given a minimum pixel size is never this small, so + // this only takes effect where the user asked for models that small: it never + // takes away an aircraft that would have been seen + const hideBelowPixels = 2; + + // Not drawn by hiding it, but by giving it a distanceDisplayCondition. Cesium + // tests that in the same expression as the model's own show, at the point it + // would push draw commands, so it skips exactly the same work - and unlike a + // hidden model, one that is merely out of range still reports a bounding sphere, + // so zooming to and tracking an aircraft too small to draw still work. + // The distance is worked out for each model from its own size and the viewport, + // so this stays a statement about pixels rather than a fixed range + const tinyPixelScratch = new Cesium.Cartesian2(); + function tooSmallBeyond(model) { + const frustum = viewer.camera.frustum; + if (frustum.fovy === undefined) { + return undefined; // Orthographic: size doesn't fall away with distance + } + const perMetre = frustum.getPixelDimensions( + viewer.scene.drawingBufferWidth, viewer.scene.drawingBufferHeight, + 1.0, viewer.scene.pixelRatio, tinyPixelScratch); + const metresPerPixelAtOneMetre = Math.max(perMetre.x, perMetre.y); + if (!(metresPerPixelAtOneMetre > 0)) { + return undefined; + } + return (model.boundingSphere.radius * 2) / (hideBelowPixels * metresPerPixelAtOneMetre); + } + + // The visualizer writes the entity's properties on to the primitive every frame, + // so this has to be set on the entity to stick. Replaced only when it has really + // moved, rather than allocating a property for every model every pass + function setTinyBeyond(entity, model, distance) { + if (distance === undefined) { + if (model.tinyBeyond !== undefined) { + entity.model.distanceDisplayCondition = undefined; + model.tinyBeyond = undefined; + } + return; + } + if ((model.tinyBeyond === undefined) || (Math.abs(distance - model.tinyBeyond) > model.tinyBeyond * 0.05)) { + model.tinyBeyond = distance; + entity.model.distanceDisplayCondition = + new Cesium.ConstantProperty(new Cesium.DistanceDisplayCondition(0.0, distance)); + } + } + + function animatedNodeNames(gltf) { + const animated = new Set(); + for (const animation of gltf.animations || []) { + for (const channel of animation.channels || []) { + if (channel.target && (channel.target.node !== undefined)) { + animated.add(channel.target.node); + } + } + } + // A child moves with its parent + const stack = [...animated]; + while (stack.length > 0) { + const n = stack.pop(); + for (const child of gltf.nodes[n].children || []) { + if (!animated.has(child)) { + animated.add(child); + stack.push(child); + } + } + } + const names = []; + for (const n of animated) { + const node = gltf.nodes[n]; + if ((node.mesh !== undefined) && node.name) { + names.push(node.name); + } + } + return names; + } + + function loadAnimatedNodes(url) { + modelAnimatedNodes.set(url, null); + fetch(url).then((response) => response.arrayBuffer()).then((buffer) => { + const bytes = new Uint8Array(buffer); + let json; + if ((bytes[0] == 0x67) && (bytes[1] == 0x6C) && (bytes[2] == 0x54) && (bytes[3] == 0x46)) { + // Binary glTF: the JSON chunk follows the 12 byte header and 8 byte chunk header + const length = new DataView(buffer).getUint32(12, true); + json = JSON.parse(new TextDecoder().decode(bytes.subarray(20, 20 + length))); + } else { + json = JSON.parse(new TextDecoder().decode(bytes)); + } + modelAnimatedNodes.set(url, animatedNodeNames(json)); + }).catch((e) => { + console.log("Far mode: can't read " + url + ": " + e); + modelAnimatedNodes.set(url, []); + }); + } + + function updateFarMode() { + const cameraPosition = viewer.camera.positionWC; + const time = viewer.clock.currentTime; + const primitives = viewer.scene.primitives; + for (let i = 0; i < primitives.length; i++) { + const model = primitives.get(i); + if (!(model instanceof Cesium.Model) || !model.ready || !(model.id instanceof Cesium.Entity)) { + continue; + } + const entity = model.id; + if (!entity.model || !entity.model.uri) { + continue; + } + // Beyond this it covers less than a couple of pixels and is not drawn + const tinyBeyond = (model.minimumPixelSize < hideBelowPixels) ? tooSmallBeyond(model) : undefined; + setTinyBeyond(entity, model, tinyBeyond); + const distance = Cesium.Cartesian3.distance(cameraPosition, model.boundingSphere.center); + // Before the checks below, which skip models with nothing animated to hide + setFarAmbient(model, distance > farModelDistance); + let url = entity.model.uri.getValue(time); + if (url && (typeof url !== "string")) { + url = url.url; // A Resource + } + if (!url) { + continue; + } + const nodes = modelAnimatedNodes.get(url); + if (nodes === undefined) { + loadAnimatedNodes(url); + continue; + } + if ((nodes === null) || (nodes.length == 0)) { + continue; // Still loading, or nothing animated to hide + } + const isFar = distance > farModelDistance; + if (model.farMode === isFar) { + continue; + } + model.farMode = isFar; + for (const name of nodes) { + const node = model.getNode(name); + if (node) { + node.show = !isFar; + } + } + } + } + setInterval(updateFarMode, 1000); // Aircraft move + viewer.camera.moveEnd.addEventListener(updateFarMode); + + // How much of Google's tileset is held in memory, and for how long. Both cost + // requests to keep low and memory to keep high, and memory is what shows: the + // tiles are only half of it, because a tile that is loaded, or was drawn + // recently, keeps the whole branch of the tile tree it sits in, and every + // garbage collection walks that tree. Flying low along a track discovers ground + // quickly, and with Cesium's defaults for Google (1.5 GB, and no release at all + // before the fix in our Cesium) the tree passed 460,000 tiles and 2 GB, where + // collections took a third of a second and showed as a stutter every few + // seconds. + // + // Measured on a low fly-by, with the tree release in place: + // + // cache idle tiles held frame rate requests + // 1536 MB 600 60k - 234k 21 - 59 fps - + // 512 MB 600 60k - 234k 21 - 59 fps 20.5/s + // 512 MB 120 60k - 107k 48 - 59 fps 30.5/s + // + // So the idle is what bounds the tree during flight, and it is paid for in + // requests against the Google quota - about half as many again. + // + // The screen space error is how much of a tile's own error, in pixels, is + // tolerated before it is refined, so it decides how much has to be fetched and + // drawn. Cesium's default of 16 loads about twice what 24 does, and on the same + // flight that showed as: + // + // error tiles loaded lost to collection frame rate + // 16 68/s 876 ms per 10s 24 - 49 fps + // 24 32/s 388 ms per 10s 50 - 59 fps + // + // Side by side from a fixed viewpoint the two are hard to tell apart - the + // foreground is identical and only the horizon softens - so the detail is worth + // less here than the frame rate + const googleTilesetOptions = { + cacheBytes: 512 * 1024 * 1024, + maximumCacheOverflowBytes: 256 * 1024 * 1024, + externalTilesetIdleFrames: 120, + maximumScreenSpaceError: 24 + }; + + // See surfaceHeightAt(). Raised once per frame the camera moved appreciably + viewer.camera.changed.addEventListener(function () { + cameraMoves++; + }); + viewer.useBrowserRecommendedResolution = false; // Improves label quality when false, as drawn at higher res viewer.infoBox.frame.setAttribute('sandbox', 'allow-same-origin allow-popups allow-forms allow-scripts allow-top-navigation'); viewer.infoBox.frame.src = "about:blank"; // Force reload so new attributes are applied - viewer.infoBox.viewModel.cameraClicked.removeEventListener(Cesium.Viewer.prototype._onInfoBoxCameraClicked, viewer); // Override info box camera button being clicked - viewer.infoBox.viewModel.cameraClicked.addEventListener(infoBoxCameraClicked, viewer); - - var pfdTimer = undefined; - var pfdRadioAltTimer = undefined; + viewer.infoBox.viewModel.cameraClicked.removeEventListener(Cesium.Viewer.prototype._onInfoBoxCameraClicked, viewer); // Override info box camera button being clicked + viewer.infoBox.viewModel.cameraClicked.addEventListener(infoBoxCameraClicked, viewer); + + // The PFD is redrawn once per displayed frame rather than on a timer. The old + // 100 Hz interval drew frames that were never shown - the application renders at + // 60 - and its period beating against the refresh made the tapes move unevenly. + // requestAnimationFrame also stops the redraw altogether while the map is not + // being composited. The radio altitude keeps its own timer: it samples terrain + // rather than drawing, and is wanted at a steady rate + var pfdRunning = false; + var pfdFrame = undefined; + var pfdRadioAltTimer = undefined; + + function pfdLoop() { + if (!pfdRunning) { + return; + } + // Booked before the work, so a throw in updatePFD does not end the loop + pfdFrame = requestAnimationFrame(pfdLoop); + updatePFD(); + } + + function startPFDUpdates() { + if (!pfdRunning) { + pfdRunning = true; + pfdFrame = requestAnimationFrame(pfdLoop); + } + } + + function stopPFDUpdates() { + pfdRunning = false; + if (pfdFrame !== undefined) { + cancelAnimationFrame(pfdFrame); + pfdFrame = undefined; + } + } + var ndTimer = undefined; + var ndTrafficTimer = undefined; + // The ND's state and traffic scan also run while only the PFD is shown, as the + // PFD arms TCAS on its FMA from the ND's traffic advisories. The ND itself is + // only drawn while visible + var pfdShown = false; + var ndShown = false; + function updateNDTimers() { + if (pfdShown || ndShown) { + if (ndTimer === undefined) { + ndTimer = setInterval(updateND, 50); + ndTrafficTimer = setInterval(updateNDTraffic, 1000); + // The radio altitude is the height the TCAS inhibit is measured + // against, so it is sampled for the ND as well as for the PFD + pfdRadioAltTimer = setInterval(updateRadioAlt, 250); + } + } else if (ndTimer !== undefined) { + clearInterval(ndTimer); + clearInterval(ndTrafficTimer); + clearInterval(pfdRadioAltTimer); + ndTimer = undefined; + ndTrafficTimer = undefined; + pfdRadioAltTimer = undefined; + } + } + var efisTimer = undefined; + var rmpTimer = undefined; var buildings = undefined; + // Aircraft tracks: a PrimitiveCollection of one PolylineCollection per segment - see + // handleTrackPolyline(). Declared out here because the surface sampling has to hide + // them - see surfaceHeightAt() - as well as handleTrackPolyline() building them + var trackPolylines = null; + var googleTileset = undefined; + var googleTilesetEnabled = false; // Set before the tileset has finished loading const images = new Map(); var mufGeoJSONStream = null; @@ -342,7 +1669,11 @@ var velocityVectorProperty = undefined; const velocityVector = new Cesium.Cartesian3(); - var viewFirstPerson = false; + // Camera mode, as MapSettings::CameraMode: 0 third person, 1 first person, 2 fly-by + const cameraModeThirdPerson = 0; + const cameraModeFirstPerson = 1; + const cameraModeFlyBy = 2; + var cameraMode = cameraModeThirdPerson; var firstPersonEntity; var firstPersonOffset = 0.0; var cameraSavedPositionValid = false; @@ -353,13 +1684,224 @@ var cameraSavedTransform; var cameraInitPos = false; +// --------------------------------------------------------------------------------- + // Fly-by camera: the camera is put at a fixed point ahead of the object and off to + // one side, and stays there - only turning to follow - while the object flies past. + // Once the object is away in the distance it is placed again ahead of the new track. + // Holding the point still is what makes this a fly-by rather than a chase camera + + const flyByLeadSeconds = 12; // How far ahead to sit, as flying time + const flyByMinLead = 800; // ...but no nearer than this, metres + const flyByMaxLead = 5000; // ...and no further than this + const flyByStandoff = 250; // To one side of the track, metres + const flyByHeight = 40; // Above the object, metres + const flyByRepositionDistance = 2500; // Move once it is this far away and receding + const flyByMinDwell = 3; // Seconds to hold a viewpoint at the least + const flyByStationary = 20; // Below this speed the object is treated as parked, m/s + const flyByTerrainClearance = 30; // Keep the camera at least this far above ground + + var flyByEntity; + var flyByVelocityProperty; + var flyByCameraPos; // Fixed world point the camera sits at + var flyByPlacedTime; + // A viewpoint placed before the object velocity was known - it stands off rather + // than leading the track, so it is replaced as soon as a velocity does arrive. + // Covers both the first frame after entering fly-by, where Cesium has not yet had + // two samples to differentiate, and an object that is parked and then sets off + var flyByProvisional = false; + var flyBySide = 1; + // The mouse wheel scales the whole standoff geometry, so how close the viewpoint + // sits carries over to the ones placed after it + const flyByZoomStep = 0.85; + const flyByZoomMin = 0.1; + const flyByZoomMax = 8; + var flyByZoom = 1; // Alternated, so successive passes are shot from either side + + // Scratch, so the per-frame path allocates nothing + const flyByScratch = { + velocity: new Cesium.Cartesian3(), + forward: new Cesium.Cartesian3(), + up: new Cesium.Cartesian3(), + side: new Cesium.Cartesian3(), + offset: new Cesium.Cartesian3(), + toTarget: new Cesium.Cartesian3(), + direction: new Cesium.Cartesian3(), + cameraUp: new Cesium.Cartesian3(), + right: new Cesium.Cartesian3(), + transform: new Cesium.Matrix4() + }; + + // The geodetic up at a point, which the local east-north-up frame's third column is + function flyByUpAt(position, result) { + const transform = Cesium.Transforms.eastNorthUpToFixedFrame(position, undefined, flyByScratch.transform); + Cesium.Matrix4.getColumn(transform, 2, result); + return Cesium.Cartesian3.normalize(result, result); + } + + // Choose a new viewpoint, ahead of the object and to one side of its track + function flyByReposition(position, velocity, time) { + const s = flyByScratch; + const speed = Cesium.Cartesian3.magnitude(velocity); + const up = flyByUpAt(position, s.up); + + if (speed >= flyByStationary) { + Cesium.Cartesian3.normalize(velocity, s.forward); + // Perpendicular to the track and level with the horizon + Cesium.Cartesian3.cross(s.forward, up, s.side); + Cesium.Cartesian3.normalize(s.side, s.side); + const lead = Math.max(flyByMinLead, Math.min(flyByMaxLead, speed * flyByLeadSeconds)) * flyByZoom; + Cesium.Cartesian3.multiplyByScalar(s.forward, lead, s.offset); + } else { + // Parked: there is no track to lead, so just stand off to the east + const transform = Cesium.Transforms.eastNorthUpToFixedFrame(position, undefined, s.transform); + Cesium.Matrix4.getColumn(transform, 0, s.side); + Cesium.Cartesian3.normalize(s.side, s.side); + Cesium.Cartesian3.multiplyByScalar(s.side, flyByMinLead * flyByZoom, s.offset); + } + + const camera = Cesium.Cartesian3.add(position, s.offset, new Cesium.Cartesian3()); + Cesium.Cartesian3.multiplyByScalar(s.side, flyBySide * flyByStandoff * flyByZoom, s.offset); + Cesium.Cartesian3.add(camera, s.offset, camera); + Cesium.Cartesian3.multiplyByScalar(up, flyByHeight * flyByZoom, s.offset); + Cesium.Cartesian3.add(camera, s.offset, camera); + + // Do not end up underground when the object is low over rising terrain, or on + // it. scene.getHeight asks the globe and the tilesets alike, so Google's tiles + // answer too - where they are loaded, which near the aircraft they are; where + // nothing is loaded the depth buffer is sampled instead, once per placement + const carto = Cesium.Cartographic.fromCartesian(camera); + if (Cesium.defined(carto)) { + let ground = viewer.scene.getHeight(carto, Cesium.HeightReference.CLAMP_TO_GROUND); + if (!Cesium.defined(ground)) { + ground = surfaceHeightAt(carto, true); + } + if (Cesium.defined(ground) && (carto.height < ground + flyByTerrainClearance)) { + carto.height = ground + flyByTerrainClearance; + Cesium.Cartographic.toCartesian(carto, undefined, camera); + } + } + + flyByCameraPos = camera; + flyByPlacedTime = Cesium.JulianDate.clone(time, flyByPlacedTime); + flyByProvisional = speed < flyByStationary; + flyBySide = -flyBySide; + } + + // Where an entity is drawn: its position at the time, lifted to the height Cesium's + // clip last put its model at where that is higher - an aircraft on the ground is + // sent at an altitude of 0, and drawn on the surface. Only the height is taken + // from the model, as its matrix is a frame behind the entity: a camera following + // the model's own position would lag it by a frame, and jitter with the frame rate + const drawnPositionScratch = new Cesium.Cartographic(); + function drawnPosition(entity, time, result) { + const position = entity.position.getValue(time, result); + if (!Cesium.defined(position)) { + return undefined; + } + const model = getModelPrimitive(viewer, entity); + const matrix = Cesium.defined(model) ? model._clampedModelMatrix : undefined; + if (!Cesium.defined(matrix)) { + return position; + } + const ellipsoid = viewer.scene.ellipsoid ?? Cesium.Ellipsoid.WGS84; + const drawnHeight = Cesium.Cartographic.fromCartesian(new Cesium.Cartesian3(matrix[12], matrix[13], matrix[14]), ellipsoid, drawnPositionScratch).height; + const cartographic = ellipsoid.cartesianToCartographic(position, drawnPositionScratch); + if (Cesium.defined(cartographic) && (drawnHeight > cartographic.height)) { + cartographic.height = drawnHeight; + return ellipsoid.cartographicToCartesian(cartographic, position); + } + return position; + } + + function cameraFlyBy(scene, time) { + const entity = flyByEntity; + if (!Cesium.defined(entity)) { + return; + } + const position = drawnPosition(entity, time); + if (!Cesium.defined(position)) { + return; + } + const s = flyByScratch; + var velocity = s.velocity; + if (Cesium.defined(flyByVelocityProperty)) { + velocity = flyByVelocityProperty.getValue(time, s.velocity); + } + if (!Cesium.defined(velocity)) { + velocity = Cesium.Cartesian3.clone(Cesium.Cartesian3.ZERO, s.velocity); + } + + if (!Cesium.defined(flyByCameraPos)) { + flyByReposition(position, velocity, time); + } else if (flyByProvisional && (Cesium.Cartesian3.magnitude(velocity) >= flyByStationary)) { + // The object is under way now, so lead its track properly + flyByReposition(position, velocity, time); + } else { + // Move on once it has gone past and is well away - but never so soon that + // the viewpoint jumps about + Cesium.Cartesian3.subtract(position, flyByCameraPos, s.toTarget); + const distance = Cesium.Cartesian3.magnitude(s.toTarget); + const receding = Cesium.Cartesian3.dot(velocity, s.toTarget) > 0; + const held = Cesium.defined(flyByPlacedTime) + ? Cesium.JulianDate.secondsDifference(time, flyByPlacedTime) : flyByMinDwell; + if (receding && (distance > flyByRepositionDistance * flyByZoom) && (Math.abs(held) >= flyByMinDwell)) { + flyByReposition(position, velocity, time); + } + } + + // Hold the viewpoint and just turn to keep the object framed + const camera = viewer.camera; + Cesium.Cartesian3.subtract(position, flyByCameraPos, s.direction); + if (Cesium.Cartesian3.magnitude(s.direction) < 1.0) { + return; + } + Cesium.Cartesian3.normalize(s.direction, s.direction); + // Up is the geodetic up made perpendicular to the view direction, so the + // horizon stays level + flyByUpAt(flyByCameraPos, s.cameraUp); + const along = Cesium.Cartesian3.dot(s.cameraUp, s.direction); + Cesium.Cartesian3.subtract(s.cameraUp, + Cesium.Cartesian3.multiplyByScalar(s.direction, along, s.offset), s.cameraUp); + Cesium.Cartesian3.normalize(s.cameraUp, s.cameraUp); + Cesium.Cartesian3.cross(s.direction, s.cameraUp, s.right); + Cesium.Cartesian3.normalize(s.right, s.right); + + camera.lookAtTransform(Cesium.Matrix4.IDENTITY); + Cesium.Cartesian3.clone(flyByCameraPos, camera.position); + Cesium.Cartesian3.clone(s.direction, camera.direction); + Cesium.Cartesian3.clone(s.cameraUp, camera.up); + Cesium.Cartesian3.clone(s.right, camera.right); + } + + // Mouse wheel while flying by: move the viewpoint in or out along the line of + // sight straight away, and remember the scale for the viewpoints placed later. + // Cesium's own wheel zoom is turned off while in this mode, since the camera + // position is written every frame and its zoom would be discarded anyway + function flyByWheel(delta) { + if (cameraMode !== cameraModeFlyBy) { + return; + } + const zoom = Math.max(flyByZoomMin, Math.min(flyByZoomMax, + flyByZoom * ((delta > 0) ? flyByZoomStep : 1 / flyByZoomStep))); + const applied = zoom / flyByZoom; + flyByZoom = zoom; + if (Cesium.defined(flyByCameraPos) && Cesium.defined(flyByEntity)) { + const position = drawnPosition(flyByEntity, viewer.clock.currentTime); + if (Cesium.defined(position)) { + const offset = Cesium.Cartesian3.subtract(flyByCameraPos, position, new Cesium.Cartesian3()); + Cesium.Cartesian3.multiplyByScalar(offset, applied, offset); + flyByCameraPos = Cesium.Cartesian3.add(position, offset, offset); + } + } + } + // First person camera function cameraFirstPerson(scene, time) { const entity = firstPersonEntity; if (!Cesium.defined(entity)) { return; } - const position = entity.position.getValue(time); + const position = drawnPosition(entity, time); if (!Cesium.defined(position)) { return; } @@ -537,6 +2079,204 @@ // and sending events back to it let socket = new WebSocket("ws://127.0.0.1:$WS_PORT$"); + // Track polylines ("<name> t3d <n>") are drawn through a PolylineCollection + // primitive rather than as CZML entities. Entity polylines go through the + // static geometry batcher: every positions update re-combines geometry in + // proportion to the TOTAL polyline count on the main thread, which with a + // few hundred aircraft tracks visible stalled it for ~100 ms about once a + // second (the perf line's longtasks) - position updates then applied late + // and movement went jerky while the frame rate looked fine. A + // PolylineCollection is built for dynamic updates: setting positions of the + // same length rewrites one line's vertex data - but see handleTrackPolyline() + // for what a change of length costs, and why each track has its own. + var trackPolylineById = new Map(); + // One PolylineCollection per track segment, all inside one PrimitiveCollection. + // A PolylineCollection rebuilds its vertex arrays for the whole collection when + // any of its polylines changes its number of points - and the growing tail of a + // track does exactly that on every update, ~28 times a second across a busy sky. + // With every track in one collection (108 tracks, 6,410 points) that was 11-17 ms + // in the frame each update landed in, the largest single cost of feeding the map; + // the same update in a collection holding only that track measured +0.1 ms. The + // PrimitiveCollection keeps show/removeAll working for everything else that uses + // trackPolylines. One draw command per segment instead of ~30 for all tracks + // together, which is nothing beside what far mode saves. + function handleTrackPolyline(command) { + if (command["delete"]) { + const track = trackPolylineById.get(command.id); + if (track) { + trackPolylines.remove(track.collection); // Destroys it + trackPolylineById.delete(command.id); + } + return; + } + const p = command.polyline; + if (!p) { + return; + } + if (!trackPolylines) { + trackPolylines = new Cesium.PrimitiveCollection(); + viewer.scene.primitives.add(trackPolylines); + } + let track = trackPolylineById.get(command.id); + if (!track) { + const collection = new Cesium.PolylineCollection(); + trackPolylines.add(collection); + track = { collection: collection, line: collection.add({ show: false }) }; + trackPolylineById.set(command.id, track); + } + const line = track.line; + if (p.positions && p.positions.cartographicDegrees) { + clipTrackToGround(p.positions.cartographicDegrees); + line.positions = Cesium.Cartesian3.fromDegreesArrayHeights(p.positions.cartographicDegrees); + } + if (p.material && p.material.solidColor) { + const rgba = p.material.solidColor.color.rgba; + line.material.uniforms.color = new Cesium.Color(rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3] / 255); + } + if (p.width !== undefined) { + line.width = p.width; + } + if (p.show !== undefined) { + line.show = p.show; + } + } + + // czmlStream.process returns a promise; a packet with bad data (an invalid + // date, say) rejects it, and without a catch that surfaced as an anonymous + // "Unhandled promise rejection" naming no entity - and a synchronous throw + // inside a czmlArray would abandon the rest of the batch. Isolate each + // packet and name the culprit, once per id and reason. + var czmlProcessErrors = new Set(); + function reportProcessError(packet, e) { + const key = (packet.id || "?") + "|" + e; + if (!czmlProcessErrors.has(key)) { + czmlProcessErrors.add(key); + console.log("CZML process failed for '" + (packet.id || "?") + "': " + formatRejection(e), packet); + } + } + // A window of samples is re-sent as the smoother refines it, and a refined sample + // can be as much as 17 m from where it was first sent. The aircraft is shown a + // few seconds behind the newest sample - the document clock starts in the past + // for that, so it interpolates between received samples rather than guessing + // ahead - which means the samples being rewritten are the ones under it now, + // and it steps back or forward along its track with each refinement. So samples + // at times the clock has already passed, or will pass within a couple of seconds, + // are dropped from a packet: what has been shown stays where it was shown, the + // segment being flown keeps both its ends, and refinement goes on for what has + // not been reached. The newest sample is always kept, or a single sample arriving + // late would be lost + const samplesKeptAheadS = 2.0; + function dropSamplesAlreadyShown(packet) { + const position = packet.position; + const coords = Cesium.defined(position) ? position.cartographicDegrees : undefined; + if (!Cesium.defined(coords) || (coords.length <= 4) || (typeof coords[0] !== 'string')) { + return; + } + const horizon = Cesium.JulianDate.addSeconds(viewer.clock.currentTime, samplesKeptAheadS, new Cesium.JulianDate()); + const kept = []; + for (let i = 0; i < coords.length; i += 4) { + const newest = (i + 4 >= coords.length); + if (newest || (Cesium.JulianDate.compare(Cesium.JulianDate.fromIso8601(coords[i]), horizon) >= 0)) { + kept.push(coords[i], coords[i + 1], coords[i + 2], coords[i + 3]); + } + } + position.cartographicDegrees = kept; + } + + function processPacket(packet) { + dropSamplesAlreadyShown(packet); + try { + const r = czmlStream.process(packet); + if (r && r.catch) { + r.catch(function (e) { reportProcessError(packet, e); }); + } + } catch (e) { + reportProcessError(packet, e); + } + } + + // One CZML packet. Pulled out of the message handler so that a batched + // "czmlArray" can run exactly the same logic per packet - including the + // terrain sampling special cases, which stay per packet and asynchronous. + function handleCzml(command) { + // Track segment polylines bypass the CZML datasource - see above + if (command.id && (command.id.indexOf(" t3d ") >= 0)) { + handleTrackPolyline(command); + return; + } + // Before the datasource updates the entity's uri - see noteModelChange + if (command.model && command.model.gltf) { + noteModelChange(command); + } + // Implement CLIP_TO_GROUND, to work around https://github.com/CesiumGS/cesium/issues/4049 - Now fixed, so this may be obsolete + if (command.hasOwnProperty('altitudeReference') && command.hasOwnProperty('position') && command.position.hasOwnProperty('cartographicDegrees')) { + clipPositionToGround(command.position.cartographicDegrees); + processPacket(command); + } else if ((command.hasOwnProperty('polygon') && command.polygon.hasOwnProperty('altitudeReference')) + || (command.hasOwnProperty('polyline') && command.polyline.hasOwnProperty('altitudeReference'))) { + // Support per vertex height reference in polygons and CLIP_TO_GROUND in polylines + var prim = command.hasOwnProperty('polygon') ? command.polygon : command.polyline; + var clipToGround = prim.altitudeReference == "CLIP_TO_GROUND"; + var clampToGround = prim.altitudeReference == "CLAMP_TO_GROUND"; + var size = prim.positions.cartographicDegrees.length; + var positionCount = size / 3; + var positions = new Array(positionCount); + if (!hasSurfaceHeights()) { + if (clampToGround) { + for (let i = 0; i < positionCount; i++) { + prim.positions.cartographicDegrees[i * 3 + 2] = 0; + } + } else if (clipToGround) { + for (let i = 0; i < positionCount; i++) { + if (prim.positions.cartographicDegrees[i * 3 + 2] < 0) { + prim.positions.cartographicDegrees[i * 3 + 2] = 0; + } + } + } + processPacket(command); + } else { + for (let i = 0; i < positionCount; i++) { + positions[i] = Cesium.Cartographic.fromDegrees(prim.positions.cartographicDegrees[i * 3 + 0], prim.positions.cartographicDegrees[i * 3 + 1]); + } + Promise.resolve( + sampleSurfaceHeight(positions), + ).then((updatedPositions) => { + if (clampToGround) { + for (let i = 0; i < positionCount; i++) { + prim.positions.cartographicDegrees[i * 3 + 2] = updatedPositions[i].height; + } + } else if (clipToGround) { + for (let i = 0; i < positionCount; i++) { + if (prim.positions.cartographicDegrees[i * 3 + 2] < updatedPositions[i].height) { + prim.positions.cartographicDegrees[i * 3 + 2] = updatedPositions[i].height; + } + } + } + processPacket(command); + }).catch((e) => { + // Without this the packet was simply lost. Terrain is sampled + // at EVERY vertex and at maximum detail, so a large polygon + // asks for a great many tiles at once - the aircraft coverage + // outlines are 144 vertices spread over thousands of miles - + // and one rejected request took the whole entity with it, + // silently and for good. It happened at startup, when nothing + // is cached yet, and not when the same polygon was sent again + // later, which is what made it look like the item had never + // been sent. + // + // Drawing it unclamped is a far better outcome than not + // drawing it: the heights are whatever the sender gave, so at + // worst it sits at the ellipsoid instead of on the terrain. + console.warn("Terrain sampling failed for", command.id, e); + processPacket(command); + }); + } + } else { + processPacket(command); + } + } + + socket.onmessage = function (event) { try { const command = JSON.parse(event.data); @@ -562,14 +2302,17 @@ heading: 0, }, }); - } else if (command.command == "setViewFirstPerson") { - if (command.firstPerson) { - // Use first person view from entity - viewFirstPerson = true; - setFirstPersonView(viewer.trackedEntity); + } else if (command.command == "setCameraMode") { + cameraMode = command.mode; + // Whatever is being followed now carries over to the new mode + const followed = Cesium.defined(viewer.trackedEntity) ? viewer.trackedEntity + : (Cesium.defined(firstPersonEntity) ? firstPersonEntity : flyByEntity); + if (cameraMode === cameraModeFirstPerson) { + setFirstPersonView(followed); + } else if (cameraMode === cameraModeFlyBy) { + setFlyByView(followed); } else { - viewFirstPerson = false; - setThirdPersonView(firstPersonEntity); + setThirdPersonView(followed); } } else if (command.command == "playAnimation") { // Play model animation @@ -644,8 +2387,44 @@ }); } } + } else if (command.command == "setGooglePhotorealistic3DTiles") { + // Google's tileset has terrain, buildings and imagery baked in, so the globe + // is hidden while it's used - which hides the layers draped on it too + // (rain, clouds, sea marks, railways, NASA global imagery, Maidenhead grid) + googleTilesetEnabled = command.enabled; + surfaceHeights.clear(); // The surface is about to change + trackGroundHeights.clear(); + trackGroundMisses.clear(); + showGlobePickers(!command.enabled); + + if (command.enabled) { + if (googleTileset === undefined) { + Promise.resolve( + Cesium.createGooglePhotorealistic3DTileset(undefined, googleTilesetOptions) + ).then((tileset) => { + if (!googleTilesetEnabled) { // Turned off while loading + tileset.destroy(); + return; + } + googleTileset = viewer.scene.primitives.add(tileset); + viewer.scene.globe.show = false; + }).catch((e) => { + console.log(`Failed to create Google Photorealistic 3D Tileset: ${e}`); + showGlobePickers(true); // Still on the globe after all + }); + } + } else { + if (googleTileset !== undefined) { + viewer.scene.primitives.remove(googleTileset); + googleTileset = undefined; + } + viewer.scene.globe.show = true; + } } else if (command.command == "setLighting") { viewer.scene.globe.enableLighting = command.useSunLight; + if (command.distantLightIntensity !== undefined) { + setFarModelAmbient(command.distantLightIntensity); + } //viewer.scene.globe.nightFadeOutDistance = 0.0; // FIXME: Can't be nearly 0. Causes terrain above horizon to be blacked out in 1.129 // Currently Cesium only supports a single light source, either Sun or Directional if (!command.useSunLight) { @@ -673,6 +2452,8 @@ } else { viewer.scene.highDynamicRange = false; } + } else if (command.command == "setFrameRate") { + viewer.targetFrameRate = command.frameRate; } else if (command.command == "setFog") { if (command.fog) { viewer.scene.fog.enabled = true; @@ -688,17 +2469,71 @@ } else if (command.command == "showPFD") { const pfdCanvas = document.getElementById("pfdCanvas"); if (command.show == true) { - if (pfdTimer === undefined) { - pfdTimer = setInterval(updatePFD, 10); - pfdRadioAltTimer = setInterval(updateRadioAlt, 250); - } + startPFDUpdates(); canvas.removeAttribute("hidden"); } else { canvas.setAttribute("hidden", "hidden"); - clearInterval(pfdTimer); - clearInterval(pfdRadioAltTimer); - pfdTimer = undefined; - pfdRadioAltTimer = undefined; + stopPFDUpdates(); + } + pfdShown = (command.show == true); + updateNDTimers(); + } else if (command.command == "setAudioVolume") { + // Playing loops pick the new volume up on the next update pass, + // which folds it into every layer's gain target + mapItemSoundVolume = command.mapItem; + cockpitSoundVolume = command.cockpit; + } else if (command.command == "showND") { + if (command.show == true) { + ndCanvas.removeAttribute("hidden"); + } else { + ndCanvas.setAttribute("hidden", "hidden"); + } + ndShown = (command.show == true); + updateNDTimers(); + } else if (command.command == "showEFIS") { + if (command.show == true) { + if (efisTimer === undefined) { + efisTimer = setInterval(drawEFIS, 100); + } + efisCanvas.removeAttribute("hidden"); + } else { + efisCanvas.setAttribute("hidden", "hidden"); + clearInterval(efisTimer); + efisTimer = undefined; + } + } else if (command.command == "showRMP") { + if (command.show == true) { + if (rmpTimer === undefined) { + rmpTimer = setInterval(updateRMP, 250); + } + rmpCanvas.removeAttribute("hidden"); + } else { + rmpCanvas.setAttribute("hidden", "hidden"); + clearInterval(rmpTimer); + rmpTimer = undefined; + } + } else if (command.command == "setRMPState") { + rmpSetState(command); + } else if (command.command == "setEFISState") { + setEFISState(command.state); + } else if (command.command == "setPanelGeometry") { + // Where each cockpit panel was left when SDRangel last closed + const g = command.panels; + if (g !== undefined) { + panelApplyGeometry(document.getElementById("pfdCanvas"), g.pfd); + panelApplyGeometry(ndCanvas, g.nd); + panelApplyGeometry(efisCanvas, g.efis); + panelApplyGeometry(rmpCanvas, g.rmp); + panelApplyGeometry(dcduCanvas, g.dcdu); + } + } else if (command.command == "showDCDU") { + // Unchecked suppresses the pop-on-message behaviour too + dcduEnabled = command.show == true; + if (dcduEnabled) { + dcduCanvas.removeAttribute("hidden"); + drawDCDU(); + } else { + dcduCanvas.setAttribute("hidden", "hidden"); } } else if (command.command == "showMUF") { if (command.show == true) { @@ -758,17 +2593,10 @@ showGrid(command.show); } else if (command.command == "setDefaultImagery") { - // For indexes, see pacakges/widgets/Source/BaseLayerPicker/createDefaultImageryProviderViewModels.js - if (command.imagery == "Bing Maps Aerial") { - viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[0]; - } else if (command.imagery == "ArcGIS world imagery") { - viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[3]; - } else if (command.imagery == "Ersi world ocean") { - viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[5]; - } else if (command.imagery == "Sentinel-2") { - viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[11]; - } else if (command.imagery == "Earth at night") { - viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[13]; + // By name, as the list is filtered when there's no Cesium Ion API key + const viewModel = findImageryViewModel(command.imagery); + if (viewModel !== undefined) { + viewer.baseLayerPicker.viewModel.selectedImagery = viewModel; } else { console.log(`Unknown imagery ${command.imagery}`); } @@ -825,23 +2653,42 @@ gibsLayer.alpha = command.opacity / 100.0; } } else if (command.layer == "clouds") { + // RainViewer can have no frames at all for a layer - its + // satellite.infrared array is empty as this is written, while + // radar.past has thirteen - and the tile URL is built by + // concatenation, so an empty path asks for + // tilecache.rainviewer.com//256/... That 404s, a 404 carries no + // Access-Control-Allow-Origin, and the browser reports every one + // of them as a CORS failure. Removing the layer rather than + // ignoring the command also covers a feed that stops mid-session, + // which would otherwise leave the last tiles showing for ever. viewer.imageryLayers.remove(cloudLayer, true); - cloudProvider = new Cesium.UrlTemplateImageryProvider({ - url: "https://tilecache.rainviewer.com/" + command.path + "/256/{z}/{x}/{y}/0/0_0.png" - }); - cloudLayer = new Cesium.ImageryLayer(cloudProvider); - cloudLayer.show = command.show; - viewer.imageryLayers.add(cloudLayer); - layers.set(command.layer, cloudLayer); + cloudLayer = undefined; + layers.delete(command.layer); + if (command.path) { + cloudProvider = new Cesium.UrlTemplateImageryProvider({ + url: "https://tilecache.rainviewer.com/" + command.path + "/256/{z}/{x}/{y}/0/0_0.png" + }); + cloudLayer = new Cesium.ImageryLayer(cloudProvider); + cloudLayer.show = command.show; + viewer.imageryLayers.add(cloudLayer); + layers.set(command.layer, cloudLayer); + } } else if (command.layer == "rain") { + // The ND's weather radar underlay uses the same frame + setNDWeatherPath(command.path ? command.path : undefined); viewer.imageryLayers.remove(rainLayer, true); - rainProvider = new Cesium.UrlTemplateImageryProvider({ - url: "https://tilecache.rainviewer.com/" + command.path + "/256/{z}/{x}/{y}/4/1_1.png" - }); - rainLayer = new Cesium.ImageryLayer(rainProvider); - rainLayer.show = command.show; - viewer.imageryLayers.add(rainLayer); - layers.set(command.layer, rainLayer); + rainLayer = undefined; + layers.delete(command.layer); + if (command.path) { + rainProvider = new Cesium.UrlTemplateImageryProvider({ + url: "https://tilecache.rainviewer.com/" + command.path + "/256/{z}/{x}/{y}/4/1_1.png" + }); + rainLayer = new Cesium.ImageryLayer(rainProvider); + rainLayer.show = command.show; + viewer.imageryLayers.add(rainLayer); + layers.set(command.layer, rainLayer); + } } else if (command.layer == "aurora") { viewer.imageryLayers.remove(auroraLayer, true); auroraProvider = new Cesium.SingleTileImageryProvider({ @@ -905,96 +2752,25 @@ for (let [k, image] of images) { viewer.scene.primitives.remove(image); } + } else if (command.command == "setNDAirports") { + // The whole airport database for the ND's airport overlay + setNDAirports(command.airports); + } else if (command.command == "setNDNavAids") { + setNDNavAids(command.navAids); } else if (command.command == "removeAllCZMLEntities") { czmlStream.entities.removeAll(); - } else if (command.command == "czml") { - // Implement CLIP_TO_GROUND, to work around https://github.com/CesiumGS/cesium/issues/4049 - Now fixed, so this may be obsolete - if (command.hasOwnProperty('altitudeReference') && command.hasOwnProperty('position') && command.position.hasOwnProperty('cartographicDegrees')) { - var size = command.position.cartographicDegrees.length; - if ((size == 3) || (size == 4)) { - var position; - var height; - if (size == 3) { - position = Cesium.Cartographic.fromDegrees(command.position.cartographicDegrees[0], command.position.cartographicDegrees[1]); - height = command.position.cartographicDegrees[2]; - } else if (size == 4) { - position = Cesium.Cartographic.fromDegrees(command.position.cartographicDegrees[1], command.position.cartographicDegrees[2]); - height = command.position.cartographicDegrees[3]; - } - if (viewer.terrainProvider instanceof Cesium.EllipsoidTerrainProvider) { - // sampleTerrainMostDetailed will reject Ellipsoid. - if (height < 0) { - if (size == 3) { - command.position.cartographicDegrees[2] = 0; - } else if (size == 4) { - command.position.cartographicDegrees[3] = 0; - } - } - czmlStream.process(command); - } else { - Promise.resolve( - Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [position]), - ).then((updatedPositions) => { - if (height < updatedPositions[0].height) { - if (size == 3) { - command.position.cartographicDegrees[2] = updatedPositions[0].height; - } else if (size == 4) { - command.position.cartographicDegrees[3] = updatedPositions[0].height; - } - } - czmlStream.process(command); - }); - }; - } else { - console.log(`Can't currently use altitudeReference when more than one position`, command.position); - czmlStream.process(command); - } - } else if ((command.hasOwnProperty('polygon') && command.polygon.hasOwnProperty('altitudeReference')) - || (command.hasOwnProperty('polyline') && command.polyline.hasOwnProperty('altitudeReference'))) { - // Support per vertex height reference in polygons and CLIP_TO_GROUND in polylines - var prim = command.hasOwnProperty('polygon') ? command.polygon : command.polyline; - var clipToGround = prim.altitudeReference == "CLIP_TO_GROUND"; - var clampToGround = prim.altitudeReference == "CLAMP_TO_GROUND"; - var size = prim.positions.cartographicDegrees.length; - var positionCount = size / 3; - var positions = new Array(positionCount); - if (viewer.terrainProvider instanceof Cesium.EllipsoidTerrainProvider) { - if (clampToGround) { - for (let i = 0; i < positionCount; i++) { - prim.positions.cartographicDegrees[i * 3 + 2] = 0; - } - } else if (clipToGround) { - for (let i = 0; i < positionCount; i++) { - if (prim.positions.cartographicDegrees[i * 3 + 2] < 0) { - prim.positions.cartographicDegrees[i * 3 + 2] = 0; - } - } - } - czmlStream.process(command); - } else { - for (let i = 0; i < positionCount; i++) { - positions[i] = Cesium.Cartographic.fromDegrees(prim.positions.cartographicDegrees[i * 3 + 0], prim.positions.cartographicDegrees[i * 3 + 1]); - } - Promise.resolve( - Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, positions), - ).then((updatedPositions) => { - if (clampToGround) { - for (let i = 0; i < positionCount; i++) { - prim.positions.cartographicDegrees[i * 3 + 2] = updatedPositions[i].height; - } - } else if (clipToGround) { - for (let i = 0; i < positionCount; i++) { - if (prim.positions.cartographicDegrees[i * 3 + 2] < updatedPositions[i].height) { - prim.positions.cartographicDegrees[i * 3 + 2] = updatedPositions[i].height; - } - } - } - czmlStream.process(command); - }); - } - } else { - czmlStream.process(command); + if (trackPolylines) { + trackPolylines.removeAll(); + trackPolylineById.clear(); } + } else if (command.command == "czmlArray") { + // A whole flush of packets in one message: one message, one + // JSON parse and one pass, rather than one of each per aircraft. + for (let i = 0; i < command.packets.length; i++) { + handleCzml(command.packets[i]); + } + } else if (command.command == "czml") { + handleCzml(command); } else if (command.command == "save") { // Export to kml/kmz dataDir = command.dataDir; @@ -1019,6 +2795,11 @@ }; function setFirstPersonView(entity) { + // Only one camera handler at a time, or they fight over the camera each frame + viewer.scene.postUpdate.removeEventListener(cameraFlyBy); + viewer.scene.screenSpaceCameraController.enableZoom = true; + flyByEntity = undefined; + flyByCameraPos = undefined; if (!Cesium.defined(entity)) { viewer.scene.postUpdate.removeEventListener(cameraFirstPerson); return; @@ -1055,10 +2836,42 @@ cameraInitPos = true; - viewer.scene.postUpdate.addEventListener(cameraFirstPerson); + viewer.scene.postUpdate.addEventListener(cameraFirstPerson); + } + + function setFlyByView(entity) { + viewer.scene.postUpdate.removeEventListener(cameraFirstPerson); + firstPersonEntity = undefined; + if (!Cesium.defined(entity)) { + // Nothing to follow, so the wheel goes back to Cesium + viewer.scene.postUpdate.removeEventListener(cameraFlyBy); + viewer.scene.screenSpaceCameraController.enableZoom = true; + flyByEntity = undefined; + return; + } + + viewer.trackedEntity = entity; // So the infobox camera icon shows it is being followed + viewer.cesiumWidget._needTrackedEntityUpdate = false; // Or Cesium flies to it a frame later + + flyByEntity = entity; + flyByVelocityProperty = Cesium.defined(entity.position) + ? new Cesium.VelocityVectorProperty(entity.position, false) : undefined; + flyByCameraPos = undefined; // Placed on the first frame, from where it is then + flyByPlacedTime = undefined; + flyByProvisional = false; + + // Removed first: Cesium keeps duplicate registrations, and re-entering fly-by + // would otherwise run the handler twice a frame + viewer.scene.postUpdate.removeEventListener(cameraFlyBy); + viewer.scene.postUpdate.addEventListener(cameraFlyBy); + viewer.scene.screenSpaceCameraController.enableZoom = false; } function setThirdPersonView(entity) { + viewer.scene.postUpdate.removeEventListener(cameraFlyBy); + viewer.scene.screenSpaceCameraController.enableZoom = true; + flyByEntity = undefined; + flyByCameraPos = undefined; viewer.trackedEntity = undefined; // If we're switching from first to third, ensure trackedEntity changes, so camera switches to it viewer.trackedEntity = entity; viewer.scene.postUpdate.removeEventListener(cameraFirstPerson); @@ -1084,15 +2897,17 @@ function infoBoxCameraClicked(infoBoxViewModel) { if (infoBoxViewModel.isCameraTracking && viewer.trackedEntity === viewer.selectedEntity) { - if (viewFirstPerson === true) { + if (cameraMode !== cameraModeThirdPerson) { setThirdPersonView(undefined); } else { viewer.trackedEntity = undefined; } } else { const selectedEntity = viewer.selectedEntity; - if (viewFirstPerson === true) { + if (cameraMode === cameraModeFirstPerson) { setFirstPersonView(selectedEntity); + } else if (cameraMode === cameraModeFlyBy) { + setFlyByView(selectedEntity); } else { const position = selectedEntity.position; if (Cesium.defined(position)) { @@ -1193,20 +3008,88 @@ height: 500px; } </style> + <canvas id="ndCanvas" width="1000" height="1000" style="border:1px solid #000000;" hidden> + Browser does not support canvas. + </canvas> + <style> + #ndCanvas { + position: absolute; + width: 500px; + height: 500px; + } + </style> + <canvas id="efisCanvas" width="1000" height="260" style="border:1px solid #000000;" hidden> + Browser does not support canvas. + </canvas> + <style> + #efisCanvas { + position: absolute; + width: 500px; + height: 130px; + } + </style> + <canvas id="rmpCanvas" width="1000" height="400" style="border:1px solid #000000;" hidden> + Browser does not support canvas. + </canvas> + <style> + #rmpCanvas { + position: absolute; + width: 500px; + height: 200px; + } + </style> + <canvas id="dcduCanvas" width="1000" height="800" style="border:1px solid #000000;" hidden> + Browser does not support canvas. + </canvas> + <style> + #dcduCanvas { + position: absolute; + width: 285px; + height: 228px; + } + </style> <script src="cockpit.js"></script> + <script src="navdisplay.js"></script> + <script src="rmp.js"></script> + <script src="dcdu.js"></script> <script> - // Position PFD in centre at bottom + // Position the PFD bottom left and the ND bottom right, each no more than + // half the window height, with the EFIS and RMP panels above the ND and the + // DCDU above the PFD + const cockpitDisplaySize = Math.max(250, Math.min(500, Math.floor(window.innerHeight / 2))); + const cockpitDisplayTop = window.innerHeight - cockpitDisplaySize - 30; + const pfdCanvas = document.getElementById("pfdCanvas"); - pfdCanvas.style.left = ((window.innerWidth / 2) - 250).toString() + "px"; - pfdCanvas.style.top = (window.innerHeight - 500 - 30).toString() + "px"; - if (pfdCanvas.style.width > window.innerWidth) { - pfdCanvas.style.width = Math.max(window.innerWidth, 250); - } - if (pfdCanvas.style.height > window.innerHeight) { - pfdCanvas.style.height = Math.max(window.innerHeight, 250); - } - + pfdCanvas.style.width = cockpitDisplaySize + "px"; + pfdCanvas.style.height = cockpitDisplaySize + "px"; + pfdCanvas.style.left = "10px"; + pfdCanvas.style.top = cockpitDisplayTop + "px"; + + ndCanvas.style.width = cockpitDisplaySize + "px"; + ndCanvas.style.height = cockpitDisplaySize + "px"; + ndCanvas.style.left = (window.innerWidth - cockpitDisplaySize - 10) + "px"; + ndCanvas.style.top = cockpitDisplayTop + "px"; + + // The EFIS control panel directly above the ND, at three quarters of its + // width, with the RMP above that, then the DCDU + const efisPanelWidth = Math.round(cockpitDisplaySize * 0.75); + const efisPanelHeight = Math.round(efisPanelWidth * 0.26); + efisCanvas.style.width = efisPanelWidth + "px"; + efisCanvas.style.height = efisPanelHeight + "px"; + efisCanvas.style.left = (window.innerWidth - efisPanelWidth - 10) + "px"; + efisCanvas.style.top = Math.max(cockpitDisplayTop - efisPanelHeight - 6, 0) + "px"; + + const rmpPanelHeight = Math.round(efisPanelWidth * 0.40); + rmpCanvas.style.width = efisPanelWidth + "px"; + rmpCanvas.style.height = rmpPanelHeight + "px"; + rmpCanvas.style.left = (window.innerWidth - efisPanelWidth - 10) + "px"; + rmpCanvas.style.top = Math.max(cockpitDisplayTop - efisPanelHeight - rmpPanelHeight - 12, 0) + "px"; + + // The DCDU above the PFD, their left edges aligned + dcduCanvas.style.left = "10px"; + dcduCanvas.style.top = Math.max(cockpitDisplayTop - 228 - 6, 0) + "px"; + function getPropertyValue(entity, propertyName) { const property = entity.properties[propertyName]; if (Cesium.defined(property)) { @@ -1279,7 +3162,6 @@ const onSurface = pfdEntity.properties["pfdOnSurface"].getValue(viewer.clock.currentTime); const wasOnSurface60SecsAgo = getTimerIntervalPropertyValueAt(pfdEntity, "pfdOnSurface", pfd60SecsAgo); const indicatedAirspeed = getPropertyValue(pfdEntity, "pfdIndicatedAirspeed"); - const trueAirspeed = getPropertyValue(pfdEntity, "pfdTrueAirspeed"); const groundspeed = getPropertyValue(pfdEntity, "pfdGroundspeed"); const mach = getPropertyValue(pfdEntity, "pfdMach"); const altitude = getPropertyValue(pfdEntity, "pfdAltitude"); @@ -1292,15 +3174,13 @@ const heading = getPropertyValue(pfdEntity, "pfdHeading"); const track = getPropertyValue(pfdEntity, "pfdTrack"); const roll = getPropertyValue(pfdEntity, "pfdRoll"); + const pitch = getPropertyValue(pfdEntity, "pfdPitch"); const selectedAltitude = getPropertyValue(pfdEntity, "pfdSelectedAltitude"); const selectedHeading = getPropertyValue(pfdEntity, "pfdSelectedHeading"); const autopilot = getPropertyValue(pfdEntity, "pfdAutopilot"); const verticalMode = getPropertyValue(pfdEntity, "pfdVerticalMode"); const lateralMode = getPropertyValue(pfdEntity, "pfdLateralMode"); - const tcasMode = getPropertyValue(pfdEntity, "pfdTCASMode"); - const windSpeed = getPropertyValue(pfdEntity, "pfdWindSpeed"); - const windDirection = getPropertyValue(pfdEntity, "pfdWindDirection"); - const staticAirTemperature = getPropertyValue(pfdEntity, "pfdStaticAirTemperature"); + const tcasRA = getPropertyValue(pfdEntity, "pfdTcasRA"); velocityVectorProperty.getValue(viewer.clock.currentTime, velocityVector); const modelSpeedMps = Cesium.Cartesian3.magnitude(velocityVector); @@ -1310,33 +3190,218 @@ const forward = pfdPrevClock === undefined ? true : Cesium.JulianDate.compare(viewer.clock.currentTime, pfdPrevClock) > 0; setPFDData(forward, pfdEntity.id, callsign, aircraftType, onSurface, wasOnSurface60SecsAgo, runwayAltitudeEstimate, - modelSpeedKnots, indicatedAirspeed, trueAirspeed, groundspeed, mach, altitude, pfdRadioAltitude, qnh, verticalSpeed, heading, track, roll, - selectedAltitude, selectedHeading, autopilot, verticalMode, lateralMode, tcasMode, - windSpeed, windDirection, staticAirTemperature + modelSpeedKnots, indicatedAirspeed, groundspeed, mach, altitude, pfdRadioAltitude, qnh, verticalSpeed, heading, track, roll, + selectedAltitude, selectedHeading, autopilot, verticalMode, lateralMode, tcasRA, pitch ); } drawPFD(); pfdPrevClock = Cesium.JulianDate.clone(viewer.clock.currentTime, pfdPrevClock); } + var ndEntity; + var ndFlightPlanRaw; + var ndFlightPlanParsed; + var ndPosition; + + function updateND() { + // Display ND for last selected aircraft, independently of the PFD + const entity = viewer.selectedEntity; + if (Cesium.defined(entity) && Cesium.defined(entity.properties) && ((entity.properties.hasProperty("pfdAltitude") || entity.properties.hasProperty("pfdOnSurface")))) { + ndEntity = entity; + } + if (Cesium.defined(ndEntity)) { + var callsign; + if (ndEntity.properties.hasProperty("pfdCallsign")) { + callsign = ndEntity.properties["pfdCallsign"].getValue(); + } + var latitude; + var longitude; + ndPosition = ndEntity.position.getValue(viewer.clock.currentTime, ndPosition); + if (Cesium.defined(ndPosition)) { + const carto = Cesium.Cartographic.fromCartesian(ndPosition); + latitude = Cesium.Math.toDegrees(carto.latitude); + longitude = Cesium.Math.toDegrees(carto.longitude); + } + // The flight plan is a JSON string - only reparse when it changes + var flightPlanRaw; + if (ndEntity.properties.hasProperty("ndFlightPlan")) { + flightPlanRaw = ndEntity.properties["ndFlightPlan"].getValue(); + } + if (flightPlanRaw !== ndFlightPlanRaw) { + ndFlightPlanRaw = flightPlanRaw; + if ((flightPlanRaw !== undefined) && (flightPlanRaw.length > 0)) { + try { + ndFlightPlanParsed = JSON.parse(flightPlanRaw); + } catch (e) { + ndFlightPlanParsed = undefined; + } + } else { + ndFlightPlanParsed = undefined; + } + } + setNDData({ + icao: ndEntity.id, + callsign: callsign, + aircraftType: getPropertyValue(ndEntity, "pfdAircraftType"), + latitude: latitude, + longitude: longitude, + altitude: getPropertyValue(ndEntity, "pfdAltitude"), + heading: getPropertyValue(ndEntity, "pfdHeading"), + track: getPropertyValue(ndEntity, "pfdTrack"), + selectedHeading: getPropertyValue(ndEntity, "pfdSelectedHeading"), + groundspeed: getPropertyValue(ndEntity, "pfdGroundspeed"), + verticalSpeed: getPropertyValue(ndEntity, "pfdVerticalSpeed"), + trueAirspeed: getPropertyValue(ndEntity, "pfdTrueAirspeed"), + windSpeed: getPropertyValue(ndEntity, "pfdWindSpeed"), + windDirection: getPropertyValue(ndEntity, "pfdWindDirection"), + tcasMode: getPropertyValue(ndEntity, "pfdTCASMode"), + tcasRA: getPropertyValue(ndEntity, "pfdTcasRA"), + threatIcao: getPropertyValue(ndEntity, "pfdThreatIcao"), + radioAltitude: pfdRadioAltitude, + onSurface: getPropertyValue(ndEntity, "pfdOnSurface"), + staticAirTemperature: getPropertyValue(ndEntity, "pfdStaticAirTemperature"), + verticalMode: getPropertyValue(ndEntity, "pfdVerticalMode"), + lateralMode: getPropertyValue(ndEntity, "pfdLateralMode"), + flightPlan: ndFlightPlanParsed + }); + } + // While only the PFD is shown this pass just keeps the ND's state and + // traffic advisories current + if (!ndCanvas.hasAttribute("hidden")) { + drawND(); + } + } + + // The RMP: the selected aircraft's squawk, and a redraw so knob changes, squawk + // updates and the entry flash all show. Latches its own entity so it works with + // the ND hidden + var rmpEntity; + function updateRMP() { + const entity = viewer.selectedEntity; + if (Cesium.defined(entity) && Cesium.defined(entity.properties) + && (entity.properties.hasProperty("pfdAltitude") || entity.properties.hasProperty("pfdOnSurface"))) { + rmpEntity = entity; + } + if (Cesium.defined(rmpEntity)) { + const squawk = getPropertyValue(rmpEntity, "pfdSquawk"); + ndSquawk = ((squawk === undefined) || (squawk < 0)) ? undefined : Math.round(squawk); + } else { + ndSquawk = undefined; + } + drawRMP(); + } + + function updateNDTraffic() { + // Other aircraft, for TCAS style traffic display on the ND + var traffic = []; + if (Cesium.defined(ndEntity)) { + for (const e of czmlStream.entities.values) { + if ((e !== ndEntity) && Cesium.defined(e.properties) && e.properties.hasProperty("pfdAltitude")) { + const pos = Cesium.defined(e.position) ? e.position.getValue(viewer.clock.currentTime) : undefined; + if (Cesium.defined(pos)) { + const carto = Cesium.Cartographic.fromCartesian(pos); + // Groundspeed and track give the ND's traffic advisory logic + // a closure rate; heading stands in when no track is known + var trk = getPropertyValue(e, "pfdTrack"); + if (trk === undefined) { + trk = getPropertyValue(e, "pfdHeading"); + } + traffic.push({ + lat: Cesium.Math.toDegrees(carto.latitude), + lon: Cesium.Math.toDegrees(carto.longitude), + altFt: getPropertyValue(e, "pfdAltitude"), + vs: getPropertyValue(e, "pfdVerticalSpeed"), + gs: getPropertyValue(e, "pfdGroundspeed"), + trk: trk, + icao: getPropertyValue(e, "pfdIcao") + }); + } + } + } + } + setNDTraffic(traffic); + } + + // The DCDU pops up when a datalink message arrives for the selected aircraft, + // so unlike the PFD and ND it is watched for all the time + var dcduEntity; + const dcduLastSeenIds = new Map(); // Entity id -> last dcduMessage id seen + + function updateDCDU() { + const entity = viewer.selectedEntity; + if (Cesium.defined(entity) && Cesium.defined(entity.properties) && ((entity.properties.hasProperty("pfdAltitude") || entity.properties.hasProperty("pfdOnSurface")))) { + dcduEntity = entity; + } + if (!Cesium.defined(dcduEntity) || !dcduEntity.properties.hasProperty("dcduMessage")) { + return; + } + const raw = dcduEntity.properties["dcduMessage"].getValue(); + if ((raw === undefined) || (raw.length === 0)) { + return; + } + var message; + try { + message = JSON.parse(raw); + } catch (e) { + return; + } + if (!dcduLastSeenIds.has(dcduEntity.id)) { + // First sight of this aircraft: note its current message silently, so + // selecting an aircraft does not pop up a historical message + dcduLastSeenIds.set(dcduEntity.id, message.id); + return; + } + if (message.id !== dcduLastSeenIds.get(dcduEntity.id)) { + dcduLastSeenIds.set(dcduEntity.id, message.id); + showDCDUMessage(message, true); + } + } + setInterval(updateDCDU, 1000); + function convertToNearest10Foot(metres) { return Math.round((metres * 3.28084) / 10.0) * 10.0; } function updateRadioAlt() { - if (Cesium.defined(pfdEntity)) { - pfdRadioAltitudeEntity = pfdEntity; + // pfdEntity is only maintained while the PFD is shown; ndEntity is kept + // whenever either panel is, which is when this runs + const raEntity = Cesium.defined(pfdEntity) ? pfdEntity : ndEntity; + if (Cesium.defined(raEntity)) { + pfdRadioAltitudeEntity = raEntity; pfdRadioAltPosition = pfdRadioAltitudeEntity.position.getValue(viewer.clock.currentTime, pfdRadioAltPosition); if (Cesium.defined(pfdRadioAltPosition)) { - if (viewer.terrainProvider instanceof Cesium.EllipsoidTerrainProvider) { - pfdRadioAltitude = convertToNearest10Foot(Cesium.Cartographic.fromCartesian(pfdRadioAltPosition).height); + const aircraft = Cesium.Cartographic.fromCartesian(pfdRadioAltPosition); + // Cesium clips the model to the surface every frame, and our Cesium + // records how far above it the model's lowest point ended up: zero on the + // ground by construction, the true clearance in the air, whichever of + // terrain and tiles is under it. That is the radio altitude, with no + // sampling of our own - the fallbacks below are for a model that has not + // found a surface yet, and for anything drawn without a model + const model = getModelPrimitive(viewer, raEntity); + const clearance = Cesium.defined(model) ? model.heightAboveSurface : undefined; + if (Cesium.defined(clearance)) { + pfdRadioAltitude = convertToNearest10Foot(clearance); + } else if (!hasSurfaceHeights()) { + // The surface is the ellipsoid, so height above it is the radio altitude + pfdRadioAltitude = convertToNearest10Foot(aircraft.height); + } else if (googleTileset !== undefined) { + // The same ground the aircraft is clipped to, so the two agree - and + // sampled with our own items excluded, so it is the ground below the + // aircraft rather than the aircraft itself + const surface = surfaceHeightAt(aircraft, true); + if (Cesium.defined(surface)) { + pfdRadioAltitude = convertToNearest10Foot(aircraft.height - surface); + } } else { Promise.resolve( - Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [pfdRadioAltPosition]), + Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [Cesium.Cartographic.clone(aircraft)]), ).then((updatedPositions) => { - if (pfdRadioAltitudeEntity === pfdEntity) { - pfdRadioAltitude = convertToNearest10Foot(Cesium.Cartographic.fromCartesian(updatedPositions[0]).height); + if (pfdRadioAltitudeEntity === raEntity) { + pfdRadioAltitude = convertToNearest10Foot(aircraft.height - updatedPositions[0].height); } + }).catch(() => { + // A terrain tile fetch can fail transiently - the radio + // altitude just keeps its last value until the next sample }); } } diff --git a/plugins/feature/map/map/map_5_12.qml b/plugins/feature/map/map/map_5_12.qml index df6f94175..5a82a40ee 100644 --- a/plugins/feature/map/map/map_5_12.qml +++ b/plugins/feature/map/map/map_5_12.qml @@ -6,7 +6,7 @@ import QtPositioning 5.12 Item { id: qmlMap - property int mapZoomLevel: 11 + property real mapZoomLevel: 11 property string mapProvider: "osm" property variant mapPtr property variant guiPtr @@ -120,8 +120,8 @@ Item { id: mapComponent MapQuickItem { id: mapElement - anchorPoint.x: image.width/2 - anchorPoint.y: image.height/2 + anchorPoint.x: imageBounds.width/2 + anchorPoint.y: imageBounds.height/2 coordinate: position zoomLevel: mapZoomLevel > mapImageMinZoom ? mapZoomLevel : mapImageMinZoom //autoFadeIn: false // not in 5.12 @@ -134,30 +134,38 @@ Item { columnSpacing: 5 layer.enabled: true layer.smooth: true - Image { - id: image - rotation: mapImageRotation - source: mapImage - visible: mapImageVisible - MouseArea { - anchors.fill: parent - hoverEnabled: true - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - if (mouse.button === Qt.LeftButton) { - selected = !selected - if (selected) { - mapModel.moveToFront(index) - } - } else if (mouse.button === Qt.RightButton) { - if (frequency > 0) { - freqMenuItem.text = "Set frequency to " + frequencyString - freqMenuItem.enabled = true - } else { - freqMenuItem.text = "No frequency available" - freqMenuItem.enabled = false + // Sized to the rotated image's bounding box, so the smoothing layer + // doesn't clip wingtips and the bubble sits close at every rotation + Item { + id: imageBounds + width: image.implicitWidth * Math.abs(Math.cos(mapImageRotation * Math.PI / 180)) + image.implicitHeight * Math.abs(Math.sin(mapImageRotation * Math.PI / 180)) + height: image.implicitWidth * Math.abs(Math.sin(mapImageRotation * Math.PI / 180)) + image.implicitHeight * Math.abs(Math.cos(mapImageRotation * Math.PI / 180)) + Image { + id: image + anchors.centerIn: parent + rotation: mapImageRotation + source: mapImage + visible: mapImageVisible + MouseArea { + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: { + if (mouse.button === Qt.LeftButton) { + selected = !selected + if (selected) { + mapModel.moveToFront(index) + } + } else if (mouse.button === Qt.RightButton) { + if (frequency > 0) { + freqMenuItem.text = "Set frequency to " + frequencyString + freqMenuItem.enabled = true + } else { + freqMenuItem.text = "No frequency available" + freqMenuItem.enabled = false + } + contextMenu.popup() } - contextMenu.popup() } } } diff --git a/plugins/feature/map/map/map_6.qml b/plugins/feature/map/map/map_6.qml index a39abe705..33ea6c85e 100644 --- a/plugins/feature/map/map/map_6.qml +++ b/plugins/feature/map/map/map_6.qml @@ -6,7 +6,7 @@ import QtLocation 6.5 Item { id: qmlMap - property int mapZoomLevel: 11 + property real mapZoomLevel: 11 property string mapProvider: "osm" property variant mapPtr property variant guiPtr @@ -95,6 +95,12 @@ Item { parent: mapView.map } + MapItemView { + model: polylineModelFiltered + delegate: polylineTrackComponent + parent: mapView.map + } + MapItemView { model: polylineModelFiltered delegate: polylineNameComponent @@ -114,6 +120,12 @@ Item { parent: mapView.map } + MapItemView { + model: mapModelFiltered + delegate: groundTrackSegmentsComponent + parent: mapView.map + } + MapItemView { model: mapModelFiltered delegate: predictedGroundTrack1Component @@ -127,6 +139,10 @@ Item { } MapItemView { + // Each MapItemView is a MapItemGroup, so it owns its delegates as children - a + // delegate's z only ranks it among that view's own items. Ordering icons above + // ground tracks therefore has to happen between the VIEWS, not inside them. + z: 1 model: mapModelFiltered delegate: mapComponent parent: mapView.map @@ -134,21 +150,14 @@ Item { map.onZoomLevelChanged: { mapZoomLevel = map.zoomLevel - mapModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - imageModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - polygonModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - polylineModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); + viewCoordinator.viewChanged(map.visibleRegion.boundingGeoRectangle(), map.zoomLevel); } // The map displays MapPolyLines in the wrong place (+360 degrees) if // they start to the left of the visible region, so we need to // split them so they don't, each time the visible region is changed. meh. map.onCenterChanged: { - polylineModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - polygonModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - imageModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - mapModelFiltered.viewChanged(map.visibleRegion.boundingGeoRectangle().topLeft.longitude, map.visibleRegion.boundingGeoRectangle().topLeft.latitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.latitude, map.zoomLevel); - mapModel.viewChanged(map.visibleRegion.boundingGeoRectangle().bottomLeft.longitude, map.visibleRegion.boundingGeoRectangle().bottomRight.longitude); + viewCoordinator.viewChanged(map.visibleRegion.boundingGeoRectangle(), map.zoomLevel); } map.onSupportedMapTypesChanged : { @@ -251,13 +260,128 @@ Item { id: mapComponent MapQuickItem { id: mapElement - anchorPoint.x: image.width/2 - anchorPoint.y: image.height/2 + z: zOrder // Move to front / move to back + anchorPoint.x: imageBounds.width/2 + anchorPoint.y: imageBounds.height/2 coordinate: position // when zooming, mapImageMinZoom can be temporarily undefined. Not sure why zoomLevel: (typeof mapImageMinZoom !== 'undefined') ? (mapZoomLevel > mapImageMinZoom ? mapZoomLevel : mapImageMinZoom) : zoomLevel autoFadeIn: false // not in 5.12 + + // A context menu per item is most of what an item costs to show, and it is + // only ever needed for the one item that gets right-clicked, so it is built + // on demand rather than for every item on the map + Component { + id: contextMenuComponent + Item { + property alias contextMenu: contextMenu + property alias menus: menus + property alias menuItems: menuItems + property alias coordsMenuItem: coordsMenuItem + ListModel { + id: menus + } + ListModel { + id: menuItems + } + Menu { + id: contextMenu + MenuItem { + text: "Set as target" + onTriggered: target = true + } + MenuItem { + text: "Move to front" + onTriggered: mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) + } + MenuItem { + text: "Move to back" + onTriggered: mapModel.moveToBack(mapModelFiltered.mapRowToSource(index)) + } + MenuItem { + text: "Track on 3D map" + onTriggered: mapModel.track3D(mapModelFiltered.mapRowToSource(index)) + } + MenuItem { + id: coordsMenuItem + text: "" + } + Instantiator { + model: menus + delegate: Menu { + //cascade: true + id: contextSubMenu + title: model.title + } + onObjectAdded: function(index, object) { + contextMenu.insertMenu(index, object) + } + onObjectRemoved: function(index, object) { + contextMenu.removeMenu(object) + } + } + Instantiator { + model: menuItems + delegate: MenuItem { + text: model.text + onTriggered: mapModel.setFrequency(model.frequency, model.deviceSet) + } + onObjectAdded: function(index, object) { + // index is index in to menuItems model + // object is the MenuItem + var menuItem = menuItems.get(index) + var menu = menus.get(menuItem.menuIndex) + contextMenu.menuAt(menuItem.menuIndex).insertItem(index, object) + } + onObjectRemoved: function(index, object) { + // Can't use menuItems.get(index) here, as already removed from model + object.menu.removeItem(object) + } + } + } + } + } + + Loader { + id: contextMenuLoader + active: false + } + + // Populate and show the menu for this item, creating it the first time + function showContextMenu(item, mouseX, mouseY) { + if (!contextMenuLoader.active) { + contextMenuLoader.sourceComponent = contextMenuComponent + contextMenuLoader.active = true + } + var menu = contextMenuLoader.item + menu.menuItems.clear() + menu.menus.clear() + if (frequencies.length > 0) { + var deviceSets = mapModel.getDeviceSets() + for (var i = 0; i < deviceSets.length; i++) { + menu.menus.append({ + title: "Set " + deviceSets[i] + " to...", + deviceSet: i + }) + for (var j = 0; j < frequencies.length; j++) { + menu.menuItems.append({ + text: frequencyStrings[j], + frequency: frequencies[j], + deviceSet: deviceSets[i], + menuIndex: i + }) + } + } + } + var c = mapPtr.map.toCoordinate(Qt.point(mouseX, mouseY)) + menu.coordsMenuItem.text = "Coords: " + c.latitude.toFixed(6) + ", " + c.longitude.toFixed(6) + var menuParent = menu.contextMenu.parent + var p = menuParent ? menuParent.mapFromItem(item, mouseX, mouseY) + : item.mapToItem(null, mouseX, mouseY) + menu.contextMenu.popup(p.x, p.y) + } + sourceItem: Grid { id: gridItem columns: 1 @@ -266,44 +390,32 @@ Item { columnSpacing: 5 layer.enabled: smoothing layer.smooth: smoothing - Image { - id: image - rotation: mapImageRotation - source: mapImage - visible: mapImageVisible - MouseArea { - anchors.fill: parent - hoverEnabled: true - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: (mouse) => { - if (mouse.button === Qt.LeftButton) { - selected = !selected - if (selected) { - mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) - } - } else if (mouse.button === Qt.RightButton) { - menuItems.clear() - menus.clear() - if (frequencies.length > 0) { - var deviceSets = mapModel.getDeviceSets() - for (var i = 0; i < deviceSets.length; i++) { - menus.append({ - title: "Set " + deviceSets[i] + " to...", - deviceSet: i - }) - for (var j = 0; j < frequencies.length; j++) { - menuItems.append({ - text: frequencyStrings[j], - frequency: frequencies[j], - deviceSet: deviceSets[i], - menuIndex: i - }) - } + // Sized to the rotated image's bounding box, so the smoothing layer + // doesn't clip wingtips and the bubble sits close at every rotation + Item { + id: imageBounds + width: image.implicitWidth * Math.abs(Math.cos(mapImageRotation * Math.PI / 180)) + image.implicitHeight * Math.abs(Math.sin(mapImageRotation * Math.PI / 180)) + height: image.implicitWidth * Math.abs(Math.sin(mapImageRotation * Math.PI / 180)) + image.implicitHeight * Math.abs(Math.cos(mapImageRotation * Math.PI / 180)) + Image { + id: image + anchors.centerIn: parent + rotation: mapImageRotation + source: mapImage + visible: mapImageVisible + MouseArea { + id: imageMouseArea + anchors.fill: parent + hoverEnabled: true + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: (mouse) => { + if (mouse.button === Qt.LeftButton) { + selected = !selected + if (selected) { + mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) } + } else if (mouse.button === Qt.RightButton) { + mapElement.showContextMenu(imageMouseArea, mouse.x, mouse.y) } - var c = mapPtr.map.toCoordinate(Qt.point(mouse.x, mouse.y)) - coordsMenuItem.text = "Coords: " + c.latitude.toFixed(6) + ", " + c.longitude.toFixed(6) - contextMenu.popup() } } } @@ -317,6 +429,7 @@ Item { radius: 5 visible: mapTextVisible MouseArea { + id: bubbleMouseArea anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton @@ -327,91 +440,9 @@ Item { mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) } } else if (mouse.button === Qt.RightButton) { - menuItems.clear() - menus.clear() - if (frequencies.length > 0) { - var deviceSets = mapModel.getDeviceSets() - for (var i = 0; i < deviceSets.length; i++) { - menus.append({ - title: "Set " + deviceSets[i] + " to...", - deviceSet: i - }) - for (var j = 0; j < frequencies.length; j++) { - menuItems.append({ - text: frequencyStrings[j], - frequency: frequencies[j], - deviceSet: deviceSets[i], - menuIndex: i - }) - } - } - } - var c = mapPtr.map.toCoordinate(Qt.point(mouse.x, mouse.y)) - coordsMenuItem.text = "Coords: " + c.latitude.toFixed(6) + ", " + c.longitude.toFixed(6) - contextMenu.popup() + mapElement.showContextMenu(bubbleMouseArea, mouse.x, mouse.y) } } - ListModel { - id: menus - } - ListModel { - id: menuItems - } - Menu { - id: contextMenu - MenuItem { - text: "Set as target" - onTriggered: target = true - } - MenuItem { - text: "Move to front" - onTriggered: mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) - } - MenuItem { - text: "Move to back" - onTriggered: mapModel.moveToBack(mapModelFiltered.mapRowToSource(index)) - } - MenuItem { - text: "Track on 3D map" - onTriggered: mapModel.track3D(mapModelFiltered.mapRowToSource(index)) - } - MenuItem { - id: coordsMenuItem - text: "" - } - Instantiator { - model: menus - delegate: Menu { - //cascade: true - id: contextSubMenu - title: model.title - } - onObjectAdded: function(index, object) { - contextMenu.insertMenu(index, object) - } - onObjectRemoved: function(index, object) { - contextMenu.removeMenu(object) - } - } - Instantiator { - model: menuItems - delegate: MenuItem { - text: model.text - onTriggered: mapModel.setFrequency(model.frequency, model.deviceSet) - } - onObjectAdded: function(index, object) { - // index is index in to menuItems model - // object is the MenuItem - var menuItem = menuItems.get(index) - var menu = menus.get(menuItem.menuIndex) - contextMenu.menuAt(menuItem.menuIndex).insertItem(index, object) - } - onObjectRemoved: function(index, object) { - // Can't use menuItems.get(index) here, as already removed from model - object.menu.removeItem(object) - } - } - } } // Have Text after MouseArea, so links can be clicked Text { @@ -433,6 +464,7 @@ Item { Component { id: predictedGroundTrack1Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: predictedGroundTrackColor path: predictedGroundTrack1 @@ -444,6 +476,7 @@ Item { Component { id: predictedGroundTrack2Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: predictedGroundTrackColor path: predictedGroundTrack2 @@ -454,6 +487,7 @@ Item { Component { id: groundTrack1Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: groundTrackColor path: groundTrack1 @@ -465,6 +499,7 @@ Item { Component { id: groundTrack2Component MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above line.width: 2 line.color: groundTrackColor path: groundTrack2 @@ -472,4 +507,41 @@ Item { } } + // A MapPolyline can only be one colour, so a ground track that's coloured according + // to altitude is drawn as a series of them + Component { + id: groundTrackSegmentComponent + MapPolyline { + z: -0.5 // Under every icon, which sit at 0 or above + line.width: 2 + line.color: segmentColor + path: segmentCoordinates + autoFadeIn: false + } + } + + Component { + id: groundTrackSegmentsComponent + MapItemGroup { + z: -0.5 // Under every icon, which sit at 0 or above + MapItemView { + model: groundTrackModel + delegate: groundTrackSegmentComponent + } + } + } + + // A line sent as a track (item type 4) is coloured by the altitude of its points, so + // like a ground track it has to be drawn as a series of lines rather than as one + Component { + id: polylineTrackComponent + MapItemGroup { + z: -0.5 // Under every icon, which sit at 0 or above + MapItemView { + model: polylineTrackModel + delegate: groundTrackSegmentComponent + } + } + } + } diff --git a/plugins/feature/map/map/navdisplay.js b/plugins/feature/map/map/navdisplay.js new file mode 100644 index 000000000..5f233fac3 --- /dev/null +++ b/plugins/feature/map/map/navdisplay.js @@ -0,0 +1,1946 @@ +// ND (Navigation Display) - Airbus style by default, Boeing style when the aircraft is a +// Boeing (see the themes in cockpit.js; ndTheme.nd holds this display's part of one) +// Must be loaded after cockpit.js, as it shares its color constants, themes and pad() +// All globals are prefixed nd, to avoid clashing with cockpit.js in the page's scope + +var ndIcao; +var ndCallsign; +var ndAircraftType; // ICAO type designator, which picks the manufacturer look +var ndTheme = airbusTheme; +var ndLat; // Own aircraft position, degrees +var ndLon; +var ndAltitude; // ft +var ndHeading; // degrees mag +var ndTrack; // degrees true +var ndSelectedHeading; +var ndGroundspeed; // knots +var ndTrueAirspeed; +var ndWindSpeed; +var ndWindDirection; +var ndTcasMode; +var ndTcasRA; // RA bitfield: bit 0 active, 1 corrective, 2 down, 3 positive, 4 clear, 5 multi +var ndThreatIcao; // Mode S address (hex) of the RA threat, matched against traffic +var ndStaticAirTemperature; // Celsius +var ndVerticalMode; // 3 = G/S +var ndLateralMode; // 2 = LOC +var ndFlightPlan; // Parsed ndFlightPlan property: {dep, arr, rwy, app, act, wpts: [{n, lat, lon, alt, eta}]} +var ndVerticalSpeed; // ft/min, for vertical closure in the traffic advisory logic +var ndRadioAltitude; // ft AGL, for the TCAS altitude inhibit +var ndOnSurface; // Non zero while the aircraft is on the ground +var ndTraffic = []; // [{lat, lon, altFt, vs, gs, trk, icao}] +var ndAirports = []; // [{n, lat, lon, t}] t: 0 small, 1 medium, 2 large - the whole database +var ndAirportsNear = []; // The ones near enough to be worth projecting, cached +var ndAirportsCacheKey; +var ndNavAids = []; // [{n, lat, lon}] - the VOR family (VOR, VOR-DME, VORTAC) +var ndNavAidsNear = []; +var ndNavAidsCacheKey; + +var ndMode = 1; // 0 = ROSE NAV, 1 = ARC +const ndRanges = [10, 20, 40, 80, 160, 320]; // NM +var ndRangeIdx = 3; + +// Weather radar underlay, composited from the same RainViewer tiles the map's rain +// overlay uses. The path names the frame (e.g. "v2/radar/1693659000") and changes +// every few minutes; map3d.html forwards it from the rain layer settings +var ndWxPath; +var ndWxEnabled = true; +var ndWxTiles = new Map(); // Tile URL -> Image, loading or complete + +// EGPWS style terrain display, from Terrarium-encoded elevation tiles generated by +// globetoterrarium.py ({url}/{z}/{x}/{y}.png, elevation = R*256 + G + B/256 - 32768, +// ocean alpha 0, NOAA GLOBE data, zooms 0-6). The tiles are recoloured relative to +// the aircraft's altitude, so the picture changes as it climbs and descends +var ndTerrainURL = "https://sdrangel.org/terrain"; +var ndTerrEnabled = false; +var ndTerrTiles = new Map(); +var ndTerrGen = 0; // Bumped as tiles finish loading, so the composite rebuilds +var ndTerrCanvas; // The recoloured composite, drawn rotated each frame +var ndTerrKey; + +// Overlay visibility, driven by the EFIS control panel's ARPT and VOR buttons +var ndShowArpt = true; +var ndShowVor = true; +// EFIS TCAS traffic selector: 0 THRT, 1 ALL, 2 ABV, 3 BLW +var ndTcasFilterIdx = 1; + +function setNDData(d) { + ndIcao = d.icao; + ndCallsign = d.callsign; + ndAircraftType = d.aircraftType; + ndTheme = cockpitThemeFor(ndAircraftType); + ndLat = d.latitude; + ndLon = d.longitude; + ndAltitude = d.altitude; + ndHeading = d.heading; + ndTrack = d.track; + ndSelectedHeading = d.selectedHeading; + ndGroundspeed = d.groundspeed; + ndVerticalSpeed = d.verticalSpeed; + ndTrueAirspeed = d.trueAirspeed; + ndWindSpeed = d.windSpeed; + ndWindDirection = d.windDirection; + ndTcasMode = d.tcasMode; + ndTcasRA = d.tcasRA; + ndThreatIcao = d.threatIcao; + ndRadioAltitude = d.radioAltitude; + ndOnSurface = d.onSurface; + // setNDData runs whenever either panel is shown, so this is where the inhibit is + // kept current. Below the height there is no RA: no red square, no RA annunciation + if (updateTcasInhibit(ndRadioAltitude, ndOnSurface)) { + ndTcasRA = 0; + } + ndStaticAirTemperature = d.staticAirTemperature; + ndVerticalMode = d.verticalMode; + ndLateralMode = d.lateralMode; + ndFlightPlan = d.flightPlan; +} + +// --------------------------------------------------------------------------------- +// The EFIS control settings - what the knobs and pushbuttons are set to - are kept in +// the Map's settings so they survive a restart. Rather than reporting from each of the +// scattered places that change them (knob clicks, button clicks, the wheel, the RMP's +// TCAS selector), the drawing passes compare a signature of the lot and report a +// change: one place, and nothing can quietly bypass it + +var efisStateSignature; +// Nothing is saved until the GUI has sent what it had, so the stored settings are not +// overwritten by the defaults this page starts with +var efisStateReady = false; + +function efisState() { + return { + mode: ndMode, range: ndRangeIdx, + wx: ndWxEnabled, terr: ndTerrEnabled, + arpt: ndShowArpt, vor: ndShowVor, + tcas: ndTcasFilterIdx + }; +} + +function efisCheckState() { + const signature = JSON.stringify(efisState()); + if (signature === efisStateSignature) { + return; + } + const first = (efisStateSignature === undefined); + efisStateSignature = signature; + if (efisStateReady && !first) { + panelSend(Object.assign({ event: "efisState" }, efisState())); + } +} + +// From the GUI, on connecting: the settings as they were left +function setEFISState(s) { + if (s !== undefined) + { + if ((s.mode === 0) || (s.mode === 1)) { + ndMode = s.mode; + } + if ((s.range >= 0) && (s.range < ndRanges.length)) { + ndRangeIdx = s.range; + } + if ((s.tcas >= 0) && (s.tcas <= 3)) { + ndTcasFilterIdx = s.tcas; + } + if (s.wx !== undefined) { + ndWxEnabled = (s.wx === true); + } + if (s.terr !== undefined) { + ndTerrEnabled = (s.terr === true); + } + if (s.arpt !== undefined) { + ndShowArpt = (s.arpt === true); + } + if (s.vor !== undefined) { + ndShowVor = (s.vor === true); + } + } + efisStateSignature = JSON.stringify(efisState()); + efisStateReady = true; +} + +function setNDTraffic(traffic) { + ndTraffic = traffic; + // Advisories are assessed at the traffic update rate (1 Hz), not per frame + ndUpdateAdvisories(); +} + +function setNDAirports(airports) { + ndAirports = (airports === undefined) ? [] : airports; + ndAirportsCacheKey = undefined; +} + +function setNDNavAids(navAids) { + ndNavAids = (navAids === undefined) ? [] : navAids; + ndNavAidsCacheKey = undefined; +} + +function setNDWeatherPath(path) { + // The RainViewer API returns the path WITH a leading slash ("/v2/radar/..."), and + // a double slash in the tile URL 404s (verified against the live server - Cesium's + // rain layer gets away with it only because its Resource class normalises URLs) + if (path !== undefined) { + path = path.replace(/^\/+/, ""); + } + if (path !== ndWxPath) { + ndWxPath = path; + ndWxTiles.clear(); // A new frame: every cached tile is stale + } +} + + +// Shared bounding-box pre-filter for the static overlay databases (airports, +// navaids): everything passing `keep` within a box slightly larger than the range +// circle, so a cached result stays valid while the aircraft moves a little +function ndNearbyPoints(points, keep) { + const range = ndRanges[ndRangeIdx]; + const maxLatDiff = range / 60 * 1.3; + const maxLonDiff = maxLatDiff / Math.max(0.2, Math.cos(ndLat * Math.PI / 180)); + const near = []; + for (const p of points) { + if (keep(p) && (Math.abs(p.lat - ndLat) <= maxLatDiff)) { + var lonDiff = Math.abs(p.lon - ndLon); + if (lonDiff > 180) { + lonDiff = 360 - lonDiff; + } + if (lonDiff <= maxLonDiff) { + near.push(p); + } + } + } + return near; +} + +// The compass rose is magnetic (ndHeading), but waypoint and traffic bearings are +// computed from true positions, so the overlay is off by local magnetic declination. +// Accepted for now - fixing it needs declination sent as an entity property +function ndReferenceHeading() { + return ndHeading !== undefined ? ndHeading : (ndTrack !== undefined ? ndTrack : 0); +} + +function ndGeometry() { + if (ndMode === 1) { + return { refX: 500, refY: 770, radius: 620 }; + } else { + return { refX: 500, refY: 520, radius: 400 }; + } +} + +// Project latitude/longitude to canvas coordinates, heading up around own position +// Equirectangular approximation - fine for ND ranges +function ndProject(lat, lon, geom, ppnm) { + const dN = (lat - ndLat) * 60.0; + const dE = (lon - ndLon) * 60.0 * Math.cos(ndLat * Math.PI / 180.0); + const h = ndReferenceHeading() * Math.PI / 180.0; + return { + x: geom.refX + (dE * Math.cos(h) - dN * Math.sin(h)) * ppnm, + y: geom.refY - (dN * Math.cos(h) + dE * Math.sin(h)) * ppnm, + dist: Math.sqrt(dN * dN + dE * dE) + }; +} + +function ndDrawWaypointSymbol(ctx, x, y, size) { + // 4 pointed star + const inner = size * 0.25; + ctx.beginPath(); + ctx.moveTo(x, y - size); + ctx.lineTo(x + inner, y - inner); + ctx.lineTo(x + size, y); + ctx.lineTo(x + inner, y + inner); + ctx.lineTo(x, y + size); + ctx.lineTo(x - inner, y + inner); + ctx.lineTo(x - size, y); + ctx.lineTo(x - inner, y - inner); + ctx.closePath(); + ctx.stroke(); +} + +function ndDrawFlightPlan(ctx, geom, ppnm) { + if ((ndFlightPlan === undefined) || (ndLat === undefined) || (ndLon === undefined)) { + return; + } + const wpts = ndFlightPlan.wpts; + if (!wpts || (wpts.length === 0)) { + return; + } + const act = ndFlightPlan.act; + + // Project the waypoints that have positions, keeping their index for active leg colouring + var placed = []; + for (var i = 0; i < wpts.length; i++) { + if ((wpts[i].lat !== undefined) && (wpts[i].lon !== undefined)) { + placed.push({ i: i, p: ndProject(wpts[i].lat, wpts[i].lon, geom, ppnm), wp: wpts[i] }); + } + } + + const T = ndTheme.nd; + ctx.lineWidth = 3; + for (var j = 1; j < placed.length; j++) { + // Airbus: the leg to the active waypoint is white, the rest of the route green. + // Boeing: the whole route magenta + ctx.strokeStyle = (placed[j].i === act) ? T.activeRoute : T.route; + ctx.beginPath(); + ctx.moveTo(placed[j - 1].p.x, placed[j - 1].p.y); + ctx.lineTo(placed[j].p.x, placed[j].p.y); + ctx.stroke(); + } + + ctx.font = "24px Arial"; + ctx.textAlign = "left"; + ctx.lineWidth = 3; + for (const pw of placed) { + const color = (pw.i === act) ? T.activeWaypoint : T.waypoint; + ctx.strokeStyle = color; + ctx.fillStyle = color; + ndDrawWaypointSymbol(ctx, pw.p.x, pw.p.y, 14); + if (pw.wp.n !== undefined) { + ctx.fillText(pw.wp.n, pw.p.x + 18, pw.p.y - 12); + } + } +} + +function ndDrawRangeRings(ctx, geom) { + ctx.strokeStyle = "white"; + ctx.lineWidth = 2; + // Airbus draws the range rings as dashes, Boeing as solid lines + ctx.setLineDash((ndTheme.nd.rangeRings === "dashed") ? [16, 14] : []); + for (var i = 1; i <= 3; i++) { + ctx.beginPath(); + if (ndMode === 1) { + // Only the part of the arc that is on the canvas + ctx.arc(geom.refX, geom.refY, geom.radius * i / 4, -Math.PI * 0.85, -Math.PI * 0.15); + } else { + ctx.arc(geom.refX, geom.refY, geom.radius * i / 4, 0, 2 * Math.PI); + } + ctx.stroke(); + } + ctx.setLineDash([]); + + // Label the half range ring + const halfRange = ndRanges[ndRangeIdx] / 2; + const labelAngle = (ndMode === 1) ? -25 : -45; // Degrees from up + const a = (labelAngle - 90) * Math.PI / 180.0; + ctx.fillStyle = ndTheme.nd.rangeLabel; + ctx.font = "24px Arial"; + ctx.textAlign = "center"; + ctx.fillText(halfRange.toString(), geom.refX + geom.radius * 0.5 * Math.cos(a), geom.refY + geom.radius * 0.5 * Math.sin(a) - 6); +} + +// The radius at which the graduations end - Airbus ticks point outwards from the +// compass ring, so the lubber line and the selected heading bug sit outside them +function ndCompassOuter(geom) { + return geom.radius + ((ndTheme.nd.compassTicks === "outward") ? 24 : 0); +} + +function ndDrawCompass(ctx, geom) { + const refHdg = ndReferenceHeading(); + + // Compass ring + ctx.strokeStyle = "white"; + ctx.lineWidth = 3; + ctx.beginPath(); + if (ndMode === 1) { + ctx.arc(geom.refX, geom.refY, geom.radius, -Math.PI * 0.85, -Math.PI * 0.15); + } else { + ctx.arc(geom.refX, geom.refY, geom.radius, 0, 2 * Math.PI); + } + ctx.stroke(); + + // Ticks and numerals, rotated with the rose + ctx.save(); + ctx.translate(geom.refX, geom.refY); + ctx.rotate(-refHdg * Math.PI / 180.0); + ctx.font = "30px Arial"; + ctx.textAlign = "center"; + ctx.lineWidth = 3; + const outward = (ndTheme.nd.compassTicks === "outward"); + for (var deg = 0; deg < 360; deg += 5) { + ctx.save(); + ctx.rotate(deg * Math.PI / 180.0); + const len = ((deg % 10) === 0) ? 24 : 12; + ctx.beginPath(); + ctx.moveTo(0, -geom.radius); + ctx.lineTo(0, outward ? -geom.radius - len : -geom.radius + len); + ctx.stroke(); + if ((deg % 30) === 0) { + ctx.fillStyle = "white"; + // Airbus: numerals outside, beyond the graduations. Boeing: inside the ring + ctx.fillText((deg / 10).toString(), 0, outward ? -geom.radius - 30 : -geom.radius + 58); + } + ctx.restore(); + } + ctx.restore(); + + // Lubber line + const T = ndTheme.nd; + ctx.strokeStyle = T.lubber; + ctx.lineWidth = 4; + const outerRadius = ndCompassOuter(geom); + ctx.beginPath(); + ctx.moveTo(geom.refX, geom.refY - outerRadius - 15); + ctx.lineTo(geom.refX, geom.refY - geom.radius + 40); + ctx.stroke(); + if (ndMode === 0) { + // Tail of the lubber line in ROSE mode + ctx.beginPath(); + ctx.moveTo(geom.refX, geom.refY + geom.radius - 40); + ctx.lineTo(geom.refX, geom.refY + outerRadius + 15); + ctx.stroke(); + } + + // Heading readout above the lubber line + if ((ndHeading !== undefined) || (ndTrack !== undefined)) { + const hdgText = pad(Math.round(ndReferenceHeading()) % 360, 3); + if (T.headingBox === "boeing") { + // Boeing: HDG in green, the digits boxed in white, MAG in green + ctx.fillStyle = "black"; + ctx.fillRect(geom.refX - 50, geom.refY - geom.radius - 70, 100, 50); + ctx.strokeStyle = "white"; + ctx.lineWidth = 2; + ctx.strokeRect(geom.refX - 50, geom.refY - geom.radius - 70, 100, 50); + ctx.fillStyle = "white"; + ctx.font = "40px Arial"; + ctx.textAlign = "center"; + ctx.fillText(hdgText, geom.refX, geom.refY - geom.radius - 30); + ctx.fillStyle = greenColor; + ctx.font = "26px Arial"; + ctx.textAlign = "right"; + ctx.fillText("HDG", geom.refX - 60, geom.refY - geom.radius - 34); + ctx.textAlign = "left"; + ctx.fillText("MAG", geom.refX + 60, geom.refY - geom.radius - 34); + } else { + ctx.fillStyle = "black"; + ctx.fillRect(geom.refX - 55, geom.refY - geom.radius - 70, 110, 50); + ctx.strokeStyle = grayColor; + ctx.lineWidth = 2; + ctx.strokeRect(geom.refX - 55, geom.refY - geom.radius - 70, 110, 50); + ctx.fillStyle = "white"; + ctx.font = "40px Arial"; + ctx.textAlign = "center"; + ctx.fillText(hdgText, geom.refX, geom.refY - geom.radius - 30); + } + } +} + +function ndDrawTrack(ctx, geom) { + if ((ndTrack === undefined) || (ndHeading === undefined)) { + return; + } + const rel = (ndTrack - ndReferenceHeading()) * Math.PI / 180.0; + const T = ndTheme.nd; + ctx.save(); + ctx.translate(geom.refX, geom.refY); + ctx.rotate(rel); + ctx.strokeStyle = T.track; + ctx.lineWidth = 3; + const diamondY = -geom.radius + 60; + ctx.beginPath(); + if (T.trackDiamond) { + ctx.moveTo(0, 0); + ctx.lineTo(0, diamondY + 14); + ctx.moveTo(0, diamondY - 14); + ctx.lineTo(0, -geom.radius); + ctx.stroke(); + // Open diamond on the track line, just inside the compass + ctx.beginPath(); + ctx.moveTo(0, diamondY - 14); + ctx.lineTo(10, diamondY); + ctx.lineTo(0, diamondY + 14); + ctx.lineTo(-10, diamondY); + ctx.closePath(); + ctx.stroke(); + } else { + // Boeing: a plain line, with range marks along it + ctx.moveTo(0, 0); + ctx.lineTo(0, -geom.radius); + for (var i = 1; i <= 3; i++) { + ctx.moveTo(-8, -geom.radius * i / 4); + ctx.lineTo(8, -geom.radius * i / 4); + } + ctx.stroke(); + } + ctx.restore(); +} + +function ndDrawSelectedHeading(ctx, geom) { + if (ndSelectedHeading === undefined) { + return; + } + var rel = ndSelectedHeading - ndReferenceHeading(); + while (rel > 180) rel -= 360; + while (rel < -180) rel += 360; + const T = ndTheme.nd; + if ((ndMode === 1) && (Math.abs(rel) > 55)) { + // Off the arc - show the selected value at the nearer end + ctx.fillStyle = T.selectedHeading; + ctx.font = "30px Arial"; + ctx.textAlign = (rel > 0) ? "right" : "left"; + const a = ((rel > 0 ? 55 : -55) - 90) * Math.PI / 180.0; + ctx.fillText(pad(Math.round(ndSelectedHeading) % 360, 3), geom.refX + geom.radius * Math.cos(a), geom.refY + geom.radius * Math.sin(a)); + return; + } + ctx.save(); + ctx.translate(geom.refX, geom.refY); + ctx.rotate(rel * Math.PI / 180.0); + ctx.strokeStyle = T.selectedHeading; + ctx.lineWidth = 3; + const outer = ndCompassOuter(geom); + if (T.selectedHeadingLine) { + // Boeing: a dashed line from own ship out to the bug + ctx.setLineDash([12, 10]); + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.lineTo(0, -geom.radius); + ctx.stroke(); + ctx.setLineDash([]); + // and the bug is a hollow trapezoid riding the outside of the compass + ctx.beginPath(); + ctx.moveTo(-16, -outer - 20); + ctx.lineTo(-8, -outer); + ctx.lineTo(8, -outer); + ctx.lineTo(16, -outer - 20); + ctx.closePath(); + ctx.stroke(); + } else { + // Chevron just outside the compass + ctx.beginPath(); + ctx.moveTo(-14, -outer - 20); + ctx.lineTo(0, -outer); + ctx.lineTo(14, -outer - 20); + ctx.stroke(); + } + ctx.restore(); +} + +function ndDrawAircraftSymbol(ctx, geom) { + if (ndTheme.nd.aircraft === "boeing") { + // Boeing: a white triangle, black inside + ctx.beginPath(); + ctx.moveTo(geom.refX, geom.refY - 22); + ctx.lineTo(geom.refX + 16, geom.refY + 16); + ctx.lineTo(geom.refX - 16, geom.refY + 16); + ctx.closePath(); + ctx.fillStyle = "black"; + ctx.fill(); + ctx.strokeStyle = "white"; + ctx.lineWidth = 3; + ctx.stroke(); + return; + } + ctx.strokeStyle = yellowColor; + ctx.lineWidth = 5; + ctx.beginPath(); + // Fuselage + ctx.moveTo(geom.refX, geom.refY - 30); + ctx.lineTo(geom.refX, geom.refY + 30); + // Wings + ctx.moveTo(geom.refX - 25, geom.refY); + ctx.lineTo(geom.refX + 25, geom.refY); + // Tailplane + ctx.moveTo(geom.refX - 12, geom.refY + 24); + ctx.lineTo(geom.refX + 12, geom.refY + 24); + ctx.stroke(); +} + +// Airports as cyan stars with their idents. The database holds tens of thousands, so +// a bounding-box pass caches the nearby candidates and only reruns when the aircraft +// has moved a little or the range changed; the smaller the airport the closer in it +// has to be zoomed before it appears, which is what keeps the long ranges legible +function ndDrawAirports(ctx, geom, ppnm) { + if ((ndLat === undefined) || (ndLon === undefined) || (ndAirports.length === 0)) { + return; + } + const range = ndRanges[ndRangeIdx]; + const minType = (range <= 40) ? 0 : ((range <= 160) ? 1 : 2); + const key = Math.round(ndLat * 20) + "," + Math.round(ndLon * 20) + "," + ndRangeIdx; + if (key !== ndAirportsCacheKey) { + ndAirportsCacheKey = key; + ndAirportsNear = ndNearbyPoints(ndAirports, function (a) { return a.t >= minType; }); + } + ctx.font = "22px Arial"; + ctx.strokeStyle = ndTheme.nd.airports; + ctx.fillStyle = ndTheme.nd.airports; + ctx.lineWidth = 2; + ctx.textAlign = "left"; + const circle = (ndTheme.nd.airportSymbol === "circle"); + var drawn = 0; + for (const a of ndAirportsNear) { + const p = ndProject(a.lat, a.lon, geom, ppnm); + if (p.dist > range) { + continue; + } + ctx.beginPath(); + if (circle) { + // Boeing: a circle + ctx.arc(p.x, p.y, 9, 0, 2 * Math.PI); + } else { + // Airbus: an eight-spoke star + ctx.moveTo(p.x - 10, p.y); + ctx.lineTo(p.x + 10, p.y); + ctx.moveTo(p.x, p.y - 10); + ctx.lineTo(p.x, p.y + 10); + ctx.moveTo(p.x - 7, p.y - 7); + ctx.lineTo(p.x + 7, p.y + 7); + ctx.moveTo(p.x - 7, p.y + 7); + ctx.lineTo(p.x + 7, p.y - 7); + } + ctx.stroke(); + ctx.fillText(a.n, p.x + 14, p.y + 8); + if (++drawn >= 50) { + break; // A dense area at short range is a smear, not information + } + } +} + +// Weather radar underlay: RainViewer web-mercator tiles drawn heading-up around own +// position. Mercator is conformal, so a tile patch this size scaled uniformly by +// cos(latitude) is locally correct - more than good enough for a radar picture. The +// zoom level is picked so one tile pixel is about one canvas pixel, and tiles load +// lazily through the cache; a frame draws whatever has arrived, and the missing +// tiles appear on the next redraw once their images complete +function ndWxTile(url) { + var img = ndWxTiles.get(url); + if (img === undefined) { + if (ndWxTiles.size > 256) { + ndWxTiles.clear(); // Zoom or area changed wholesale; reload is cheap + } + const entry = { canvas: undefined }; + const image = new Image(); + image.crossOrigin = "anonymous"; + image.onload = function () { entry.canvas = ndWxRecolour(image); }; + image.src = url; + ndWxTiles.set(url, entry); + return undefined; + } + return img.canvas; +} + +// RainViewer now bakes every tile in its Universal Blue palette - the colour scheme +// segment of the tile URL is ignored (verified: every scheme returns byte-identical +// tiles, and the API docs now document Universal Blue alone). So the NEXRAD Level +// III look is made here: each tile is recoloured once as it loads, translating +// Universal Blue -> dBZ -> NEXRAD via the palettes from RainViewer's published +// colour table (rainviewer_api_colors_table.csv, dBZ -10 to 75). Smoothing blends +// palette entries, so pixels go through a nearest-colour lookup table rather than +// exact matching. NEXRAD is transparent below about 0 dBZ, so drizzle disappears - +// which is what an airborne radar shows. +const ndWxUB = [99,97,89,102,99,90,105,102,92,108,104,93,111,107,95,114,110,97,117,112,98,120,115,100,124,117,101,127,120,103,130,123,105,133,125,106,136,128,108,139,130,109,142,133,111,146,136,113,158,147,117,170,158,121,182,169,126,194,180,130,206,192,135,210,196,139,214,200,143,218,204,147,222,208,151,136,221,238,108,209,235,81,197,232,54,186,229,27,174,226,0,163,224,0,154,213,0,145,202,0,136,191,0,127,180,0,119,170,0,112,163,0,105,156,0,98,149,0,91,142,0,85,136,0,81,128,0,78,120,0,74,112,0,71,104,255,238,0,255,224,0,255,210,0,255,197,0,255,183,0,255,170,0,255,159,0,255,149,0,255,139,0,255,129,0,255,68,0,242,54,0,230,40,0,217,27,0,205,13,0,193,0,0,168,0,0,143,0,0,118,0,0,93,0,0,255,170,255,255,159,255,255,149,255,255,139,255,255,129,255,255,119,255,255,108,255,255,98,255,255,88,255,255,78,255,255,255,255,0,255,0,206,255,255,205,255,255,204,255,255,203,255,255,202,255,255,201,255,255,200,255,255,199,255,255,198,255,255,197,255,255,196,255,255,195,255,255,194,255,255,193,255,255,192,255,255,191,255,255,184,248,255,178,242,255,171,235,255,165,229,255,159,223,255,152,216,255,146,210,255,139,203,255,133,197,255,127,191,255,120,184,255,114,178,255,107,171,255,101,165,255,95,159,255,91,155,255,88,152,255,85,149,255,82,146,255,79,143,255,75,139,255,72,136,255,69,133,255,66,130,255,63,127,255,59,123,255,56,120,255,53,117,255,50,114,255,47,111,255,43,107,255,40,104,255,37,101,255,34,98,255,31,95,255,27,91,255,24,88,255,21,85,255,18,82,255,15,79,255,12,75,255,9,72,255,6,69,255,2,66,255,0,63,255,0,59,255,0,56,255,0,53,255,0,50,255,0,47,255,0,43,255,0,40,255,0,37,255,0,34,255,0,31,255,0,27,255,0,24,255,0,21,255,0,18,255,0,15,255,0,12,255,0,9,255,0,6,255,0,2,255,0,0,255]; +const ndWxNX = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,233,231,255,3,234,231,255,2,235,231,255,1,236,231,255,0,237,231,255,0,239,231,255,0,222,234,255,0,205,237,255,0,189,240,255,0,172,243,255,0,156,247,255,0,124,247,255,0,93,247,255,0,62,247,255,0,31,247,255,0,0,247,255,0,51,197,255,0,102,148,255,0,153,98,255,0,204,49,255,0,255,0,255,0,240,0,255,1,226,1,255,1,211,1,255,2,197,2,255,3,183,3,255,4,169,3,255,5,155,3,255,6,142,4,255,7,128,4,255,8,115,5,255,57,143,4,255,106,171,3,255,156,199,2,255,205,227,0,255,255,255,0,255,251,245,0,255,247,235,0,255,243,225,0,255,239,215,0,255,236,206,0,255,239,194,0,255,243,182,0,255,246,170,0,255,250,158,0,255,254,147,0,255,254,117,0,255,254,88,0,255,254,58,0,255,254,29,0,255,255,0,0,255,241,0,0,255,228,0,0,255,215,0,0,255,202,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,202,0,50,255,215,0,101,255,228,0,152,255,241,0,203,255,254,0,254,255,254,254,254,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,234,231,255,2,235,231,255,1,236,231,255,0,237,231,255,0,222,234,255,0,205,237,255,0,189,240,255,0,172,243,255,0,124,247,255,0,93,247,255,0,62,247,255,0,31,247,255,0,0,247,255,0,51,197,255,0,102,148,255,0,153,98,255,0,204,49,255,0,255,0,255,0,240,0,255,1,226,1,255,1,211,1,255,2,197,2,255,3,183,3,255,4,169,3,255,5,155,3,255,6,142,4,255,7,128,4,255,8,115,5,255,57,143,4,255,106,171,3,255,156,199,2,255,205,227,0,255,255,255,0,255,251,245,0,255,247,235,0,255,243,225,0,255,239,215,0,255,236,206,0,255,239,194,0,255,243,182,0,255,246,170,0,255,250,158,0,255,254,147,0,255,254,117,0,255,254,88,0,255,254,58,0,255,254,29,0,255,255,0,0,255,241,0,0,255,228,0,0,255,215,0,0,255,202,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,189,0,0,255,202,0,50,255,215,0,101,255,228,0,152,255,241,0,203,255,254,0,254,255,234,16,242,255,214,32,231,255,195,49,220,255,175,65,209,255,156,82,198,255,175,116,209,255,195,150,220,255,214,185,231,255,234,219,242,255,254,254,254,255]; + +// 32x32x32 quantized RGB -> NEXRAD RGBA, built once by nearest-colour search over +// the Universal Blue entries (a few tens of ms, on first use) +var ndWxLut = null; + +function ndWxBuildLut() { + ndWxLut = new Uint8Array(32 * 32 * 32 * 4); + const entries = ndWxUB.length / 3; + for (var ri = 0; ri < 32; ri++) { + for (var gi = 0; gi < 32; gi++) { + for (var bi = 0; bi < 32; bi++) { + const r = ri * 8 + 4; + const g = gi * 8 + 4; + const b = bi * 8 + 4; + var best = 0; + var bestDist = Infinity; + for (var e = 0; e < entries; e++) { + const dr = r - ndWxUB[e * 3]; + const dg = g - ndWxUB[e * 3 + 1]; + const db = b - ndWxUB[e * 3 + 2]; + const dist = dr * dr + dg * dg + db * db; + if (dist < bestDist) { + bestDist = dist; + best = e; + } + } + const li = ((ri << 10) | (gi << 5) | bi) * 4; + ndWxLut[li] = ndWxNX[best * 4]; + ndWxLut[li + 1] = ndWxNX[best * 4 + 1]; + ndWxLut[li + 2] = ndWxNX[best * 4 + 2]; + ndWxLut[li + 3] = ndWxNX[best * 4 + 3]; + } + } + } +} + +function ndWxRecolour(image) { + const c = document.createElement("canvas"); + c.width = image.naturalWidth; + c.height = image.naturalHeight; + const cctx = c.getContext("2d", { willReadFrequently: true }); + cctx.drawImage(image, 0, 0); + var data; + try { + data = cctx.getImageData(0, 0, c.width, c.height); + } catch (e) { + // Cross-origin without CORS: draw the tile as it came rather than not at all + console.log("Weather tile pixels blocked, drawing unrecoloured: " + e); + return image; + } + if (ndWxLut === null) { + ndWxBuildLut(); + } + const px = data.data; + for (var i = 0; i < px.length; i += 4) { + const a = px[i + 3]; + if (a === 0) { + continue; + } + const li = (((px[i] >> 3) << 10) | ((px[i + 1] >> 3) << 5) | (px[i + 2] >> 3)) * 4; + px[i] = ndWxLut[li]; + px[i + 1] = ndWxLut[li + 1]; + px[i + 2] = ndWxLut[li + 2]; + // The NEXRAD alpha (drizzle is transparent), faded by the tile's own edges + px[i + 3] = (ndWxLut[li + 3] * a) / 255; + } + cctx.putImageData(data, 0, 0); + return c; +} + +function ndDrawWeather(ctx, geom, ppnm) { + if (!ndWxEnabled || (ndWxPath === undefined) || (ndLat === undefined) || (ndLon === undefined)) { + return; + } + const cosLat = Math.cos(ndLat * Math.PI / 180); + // 512 px tiles, and at most zoom 7: RainViewer's radar composite serves a "not + // supported" placeholder beyond that (probed empirically - the 256 px tiles stop + // at 7 too, so 512 is simply twice the resolution for the same limit) + const tileSize = 512; + // Ground distance per tile pixel at zoom z is 21600 * cos(lat) / (tileSize * 2^z) NM + var z = Math.round(Math.log2(ppnm * 21600 * cosLat / tileSize)); + z = Math.max(2, Math.min(7, z)); + const n = Math.pow(2, z); + // Own position in mercator pixel space at this zoom + const mx = (ndLon + 180) / 360 * n * tileSize; + const latRad = ndLat * Math.PI / 180; + const my = (1 - Math.log(Math.tan(latRad) + 1 / Math.cos(latRad)) / Math.PI) / 2 * n * tileSize; + const scale = ppnm * 21600 * cosLat / (tileSize * n); // Canvas px per mercator px + const radiusMerc = geom.radius / scale; + const tx0 = Math.floor((mx - radiusMerc) / tileSize); + const tx1 = Math.floor((mx + radiusMerc) / tileSize); + const ty0 = Math.max(0, Math.floor((my - radiusMerc) / tileSize)); + const ty1 = Math.min(n - 1, Math.floor((my + radiusMerc) / tileSize)); + + ctx.save(); + // Mercator y already increases southward, so north-up content drops straight in; + // this rotation turns it heading-up, exactly matching ndProject() + ctx.translate(geom.refX, geom.refY); + ctx.rotate(-ndReferenceHeading() * Math.PI / 180); + ctx.globalAlpha = 0.85; + for (var ty = ty0; ty <= ty1; ty++) { + for (var tx = tx0; tx <= tx1; tx++) { + const wrapped = ((tx % n) + n) % n; // Antimeridian + // The colour scheme segment is ignored by the server nowadays - every + // tile comes back Universal Blue and is recoloured to NEXRAD by + // ndWxRecolour() as it loads + const url = "https://tilecache.rainviewer.com/" + ndWxPath + "/" + tileSize + "/" + z + "/" + wrapped + "/" + ty + "/6/1_1.png"; + const img = ndWxTile(url); + if (img) { + ctx.drawImage(img, (tx * tileSize - mx) * scale, (ty * tileSize - my) * scale, tileSize * scale, tileSize * scale); + } + } + } + ctx.globalAlpha = 1.0; + ctx.restore(); +} + +function ndTerrTile(url) { + var img = ndTerrTiles.get(url); + if (img === undefined) { + if (ndTerrTiles.size > 256) { + ndTerrTiles.clear(); + } + img = new Image(); + img.crossOrigin = "anonymous"; // Required: the pixels are read back + img.onload = function () { ndTerrGen++; }; + img.src = url; + ndTerrTiles.set(url, img); + } + return (img.complete && (img.naturalWidth > 0)) ? img : undefined; +} + +// Composite the covering tiles north-up into an offscreen canvas and recolour each +// pixel by its elevation relative to the aircraft - the EGPWS bands: solid red well +// above the aircraft, dithered red/amber around it, green below, black far below +function ndTerrComposite(mx, my, radiusMerc, z, n, tileSize, altFt) { + const D = 512; // Composite resolution; the blocky look is authentic + const off = document.createElement("canvas"); + off.width = D; + off.height = D; + const octx = off.getContext("2d", { willReadFrequently: true }); + // Nearest-neighbour: smoothing would interpolate the ENCODED values, and an + // average of two Terrarium pixels is not the elevation of anything + octx.imageSmoothingEnabled = false; + const k = D / (2 * radiusMerc); + const tx0 = Math.floor((mx - radiusMerc) / tileSize); + const tx1 = Math.floor((mx + radiusMerc) / tileSize); + const ty0 = Math.max(0, Math.floor((my - radiusMerc) / tileSize)); + const ty1 = Math.min(n - 1, Math.floor((my + radiusMerc) / tileSize)); + for (var ty = ty0; ty <= ty1; ty++) { + for (var tx = tx0; tx <= tx1; tx++) { + const wrapped = ((tx % n) + n) % n; + const img = ndTerrTile(ndTerrainURL + "/" + z + "/" + wrapped + "/" + ty + ".png"); + if (img) { + octx.drawImage(img, (tx * tileSize - (mx - radiusMerc)) * k, (ty * tileSize - (my - radiusMerc)) * k, tileSize * k, tileSize * k); + } + } + } + var data; + try { + data = octx.getImageData(0, 0, D, D); + } catch (e) { + console.log("Terrain tiles blocked: the tile server must send Access-Control-Allow-Origin: * (" + e + ")"); + return undefined; + } + const px = data.data; + for (var y = 0; y < D; y++) { + for (var x = 0; x < D; x++) { + const i = (y * D + x) * 4; + var r = 0, g = 0, b = 0, a = 0; + if (px[i + 3] !== 0) { // Alpha 0 is ocean, or a tile not yet loaded + const elevFt = ((px[i] << 8) + px[i + 1] - 32768) * 3.28084; + const d = elevFt - altFt; + const dither2 = ((x ^ y) & 1) === 0; // 50% + const dither4 = ((x & 1) === 0) && ((y & 1) === 0); // 25% + if (d > 2000) { + r = 252; g = 40; b = 40; a = 255; // Solid red + } else if ((d > 1000) && dither2) { + r = 252; g = 40; b = 40; a = 255; + } else if ((d > -500) && (d <= 1000) && dither2) { + r = 254; g = 214; b = 48; a = 255; // Amber + } else if ((d > -1000) && (d <= -500) && dither4) { + r = 254; g = 214; b = 48; a = 255; + } else if ((d > -2000) && (d <= -1000) && dither2) { + r = 40; g = 180; b = 60; a = 255; // Green + } else if ((d <= -2000) && (elevFt > 100) && dither4) { + r = 30; g = 130; b = 50; a = 255; + } + } + px[i] = r; + px[i + 1] = g; + px[i + 2] = b; + px[i + 3] = a; + } + } + octx.putImageData(data, 0, 0); + return off; +} + +function ndDrawTerrain(ctx, geom, ppnm) { + if (!ndTerrEnabled || (ndTerrainURL === undefined) || (ndLat === undefined) + || (ndLon === undefined) || (ndAltitude === undefined)) { + return; + } + const cosLat = Math.cos(ndLat * Math.PI / 180); + const tileSize = 512; + // Zoom 6 at 512 px is about the native resolution of the GLOBE data + var z = Math.round(Math.log2(ppnm * 21600 * cosLat / tileSize)); + z = Math.max(0, Math.min(6, z)); + const n = Math.pow(2, z); + const mx = (ndLon + 180) / 360 * n * tileSize; + const latRad = ndLat * Math.PI / 180; + const my = (1 - Math.log(Math.tan(latRad) + 1 / Math.cos(latRad)) / Math.PI) / 2 * n * tileSize; + const scale = ppnm * 21600 * cosLat / (tileSize * n); + const radiusMerc = geom.radius / scale; + + // The per-pixel recolour runs only when the aircraft has moved an eighth of the + // radius, changed altitude band, the range/zoom changed, or a tile arrived + const key = z + "," + Math.round(mx * 8 / radiusMerc) + "," + Math.round(my * 8 / radiusMerc) + + "," + Math.round(ndAltitude / 200) + "," + ndTerrGen; + if (key !== ndTerrKey) { + ndTerrKey = key; + ndTerrCanvas = ndTerrComposite(mx, my, radiusMerc, z, n, tileSize, ndAltitude); + } + if (ndTerrCanvas) { + ctx.save(); + ctx.translate(geom.refX, geom.refY); + ctx.rotate(-ndReferenceHeading() * Math.PI / 180); + ctx.imageSmoothingEnabled = false; + ctx.drawImage(ndTerrCanvas, -geom.radius, -geom.radius, 2 * geom.radius, 2 * geom.radius); + ctx.restore(); + } +} + +// VORs (VOR, VOR-DME, VORTAC) as the conventional hexagon with a centre dot, in +// white, with the ident alongside +function ndDrawNavAids(ctx, geom, ppnm) { + if ((ndLat === undefined) || (ndLon === undefined) || (ndNavAids.length === 0)) { + return; + } + const range = ndRanges[ndRangeIdx]; + const key = Math.round(ndLat * 20) + "," + Math.round(ndLon * 20) + "," + ndRangeIdx; + if (key !== ndNavAidsCacheKey) { + ndNavAidsCacheKey = key; + ndNavAidsNear = ndNearbyPoints(ndNavAids, function (v) { return true; }); + } + ctx.font = "22px Arial"; + ctx.strokeStyle = ndTheme.nd.navaids; + ctx.fillStyle = ndTheme.nd.navaids; + ctx.lineWidth = 2; + ctx.textAlign = "left"; + var drawn = 0; + for (const v of ndNavAidsNear) { + const p = ndProject(v.lat, v.lon, geom, ppnm); + if (p.dist > range) { + continue; + } + // Hexagon, flat sides top and bottom + const r = 10; + ctx.beginPath(); + for (var i = 0; i < 6; i++) { + const angle = Math.PI / 6 + i * Math.PI / 3; + const x = p.x + r * Math.cos(angle); + const y = p.y + r * Math.sin(angle); + if (i === 0) { + ctx.moveTo(x, y); + } else { + ctx.lineTo(x, y); + } + } + ctx.closePath(); + ctx.stroke(); + ctx.fillRect(p.x - 2, p.y - 2, 4, 4); + ctx.fillText(v.n, p.x + 14, p.y + 8); + if (++drawn >= 40) { + break; + } + } +} + +// --------------------------------------------------------------------------------- +// Traffic advisories. TCAS II declares a TA when an intruder is within the range +// threshold (DMOD) or will reach closest approach within tau seconds, AND is within +// the altitude threshold or will be within tau seconds. The thresholds step up with +// own altitude (sensitivity level). Own altitude here is barometric - there is no +// AGL - so the lowest levels are approximate. Resolution advisories are NOT computed: +// red only ever comes from an RA the aircraft actually broadcast + +const ndTaLevels = [ // Sensitivity levels, from the lowest own altitude up + { below: 1000, tau: 20, dmod: 0.30, zthr: 850 }, + { below: 2350, tau: 25, dmod: 0.33, zthr: 850 }, + { below: 5000, tau: 30, dmod: 0.48, zthr: 850 }, + { below: 10000, tau: 40, dmod: 0.75, zthr: 850 }, + { below: 20000, tau: 45, dmod: 1.0, zthr: 850 }, + { below: 42000, tau: 48, dmod: 1.3, zthr: 850 }, + { below: Infinity, tau: 48, dmod: 1.3, zthr: 1200 } +]; +const ndTaHoldMs = 8000; // A TA persists this long after its conditions last held +const ndTaForgetMs = 30000; // Targets not reported for this long are dropped +// Mode S address (lower case) -> {ta, since, lastMet, seen} +var ndAdvisories = new Map(); + +function ndTaLevel(altitude) { + for (const level of ndTaLevels) { + if (altitude < level.below) { + return level; + } + } + return ndTaLevels[ndTaLevels.length - 1]; +} + +// North/east offset of a position from own aircraft, in NM (same approximation as +// ndProject, which needs the draw geometry so is not used here) +function ndRangeBearing(lat, lon) { + const dN = (lat - ndLat) * 60.0; + const dE = (lon - ndLon) * 60.0 * Math.cos(ndLat * Math.PI / 180.0); + return { dN: dN, dE: dE, dist: Math.sqrt(dN * dN + dE * dE) }; +} + +function ndVelocity(gs, trk) { + if ((gs === undefined) || (trk === undefined)) { + return undefined; + } + const a = trk * Math.PI / 180.0; + return { n: gs * Math.cos(a), e: gs * Math.sin(a) }; +} + +function ndIcaoKey(icao) { + return String(icao).toLowerCase(); +} + +function ndUpdateAdvisories() { + const now = Date.now(); + if ((ndLat === undefined) || (ndLon === undefined) || (ndAltitude === undefined) || (ndTcasMode === 1)) { + ndAdvisories.clear(); // Nothing is being scanned for + return; + } + const level = ndTaLevel(ndAltitude); + const ownV = ndVelocity(ndGroundspeed, (ndTrack !== undefined) ? ndTrack : ndHeading); + const threatKey = (ndThreatIcao !== undefined) ? ndIcaoKey(ndThreatIcao) : undefined; + var announce = false; + + for (const t of ndTraffic) { + if ((t.icao === undefined) || (t.lat === undefined) || (t.lon === undefined) || (t.altFt === undefined)) { + continue; // Cannot be tracked between updates, or has no altitude to test + } + const key = ndIcaoKey(t.icao); + const g = ndRangeBearing(t.lat, t.lon); + + // Range test: inside DMOD, or closing fast enough to get there within tau. + // Without velocities the closure is unknown and only DMOD counts + var rangeMet = g.dist <= level.dmod; + const tv = ndVelocity(t.gs, t.trk); + if (!rangeMet && (ownV !== undefined) && (tv !== undefined) && (g.dist > 0)) { + // Range rate: the intruder's velocity relative to own, along the line of + // sight. Negative is closing + const rdot = ((tv.n - ownV.n) * g.dN + (tv.e - ownV.e) * g.dE) / g.dist; + if (rdot < -1) { + rangeMet = (g.dist / -rdot) * 3600 <= level.tau; + } + } + + var met = false; + if (rangeMet) { + const dz = t.altFt - ndAltitude; + met = Math.abs(dz) <= level.zthr; + if (!met && (t.vs !== undefined) && (ndVerticalSpeed !== undefined)) { + const dzRate = t.vs - ndVerticalSpeed; // ft/min, converging when it reduces |dz| + if (((dz > 0) && (dzRate < 0)) || ((dz < 0) && (dzRate > 0))) { + met = (Math.abs(dz) / Math.abs(dzRate)) * 60 <= level.tau; + } + } + } + + var a = ndAdvisories.get(key); + if (a === undefined) { + a = { ta: false, since: 0, lastMet: 0, seen: now }; + ndAdvisories.set(key, a); + } + a.seen = now; + if (met) { + a.lastMet = now; + if (!a.ta) { + a.ta = true; + a.since = now; + // "Traffic, traffic" once as each TA is raised - but not for the RA + // threat, whose RA aurals take priority + if (key !== threatKey) { + announce = true; + } + } + } else if (a.ta && (now - a.lastMet > ndTaHoldMs)) { + a.ta = false; + } + } + + for (const [key, a] of ndAdvisories) { + if (now - a.seen > ndTaForgetMs) { + ndAdvisories.delete(key); + } + } + + // No TA aural during an RA, below the TCAS inhibit height, or when neither the ND + // nor the PFD (which arms TCAS on its FMA from these advisories) is displayed + const visible = function (canvas) { + return (canvas !== undefined) && (canvas !== null) && !canvas.hasAttribute("hidden"); + }; + const shown = visible(document.getElementById("ndCanvas")) || visible(document.getElementById("pfdCanvas")); + if (announce && !(ndTcasRA & 1) && !tcasInhibited && shown) { + pfdPlayAudio("traffic.wav"); + } +} + +// Whether any traffic advisory is current - the PFD arms TCAS on its FMA from this +function ndHasTA() { + for (const a of ndAdvisories.values()) { + if (a.ta) { + return true; + } + } + return false; +} + +function ndIsTA(t) { + if (t.icao === undefined) { + return false; + } + const a = ndAdvisories.get(ndIcaoKey(t.icao)); + return (a !== undefined) && a.ta; +} + +function ndDrawTraffic(ctx, geom, ppnm) { + if ((ndLat === undefined) || (ndLon === undefined)) { + return; + } + if (ndTcasMode === 1) { + return; // TCAS STANDBY: nothing is being scanned for, so nothing is shown + } + const range = ndRanges[ndRangeIdx]; + + // Project and classify everything in range first, so the EFIS TCAS filter can + // rank as well as cut + var targets = []; + for (const t of ndTraffic) { + if ((t.lat === undefined) || (t.lon === undefined)) { + continue; + } + var p = ndProject(t.lat, t.lon, geom, ppnm); + var rel; + if ((ndAltitude !== undefined) && (t.altFt !== undefined)) { + rel = Math.round((t.altFt - ndAltitude) / 100); + } + // The aircraft an active resolution advisory is against - never filtered out + const threat = (ndTcasRA & 1) && (ndThreatIcao !== undefined) && (t.icao !== undefined) + && (String(t.icao).toLowerCase() === String(ndThreatIcao).toLowerCase()); + const ta = !threat && ndIsTA(t); + if (p.dist > range) { + if (!(threat || ta)) { + continue; + } + // Advisory traffic beyond the selected range is still shown, clamped to + // the edge of the rose along its bearing - the rose clip then leaves the + // half symbol the real display draws + const k = range / p.dist; + p = { x: geom.refX + (p.x - geom.refX) * k, y: geom.refY + (p.y - geom.refY) * k, dist: p.dist }; + } + targets.push({ t: t, p: p, rel: rel, threat: threat, ta: ta }); + } + + // The EFIS TCAS selector: THRT keeps the 8 nearest within +-2700 ft, ALL keeps + // everything, ABV -2700..+7000 ft, BLW -7000..+2700 ft. Relative altitude is in + // hundreds of feet here. Advisory traffic is never cut + const f = ndTcasFilterIdx; + if (f !== 1) { + targets = targets.filter(function (e) { + if (e.threat || e.ta) { + return true; + } + if (e.rel === undefined) { + return false; // Cannot be classified against an altitude band + } + if (f === 0) { + return Math.abs(e.rel) <= 27; + } + if (f === 2) { + return (e.rel >= -27) && (e.rel <= 70); + } + return (e.rel >= -70) && (e.rel <= 27); + }); + if (f === 0) { + const rank = function (e) { return e.threat ? 0 : (e.ta ? 1 : 2); }; + targets.sort(function (a, b) { + if (rank(a) !== rank(b)) { + return rank(a) - rank(b); + } + return a.p.dist - b.p.dist; + }); + targets = targets.slice(0, 8); + } + } + + ctx.font = "24px Arial"; + for (const e of targets) { + const t = e.t; + const p = e.p; + const rel = e.rel; + const threat = e.threat; + // Proximate traffic (within 6 NM and 1200 ft) is a filled diamond + const proximate = (p.dist <= 6) && (rel !== undefined) && (Math.abs(rel) <= 12); + var color = "white"; + if (threat) { + // Resolution advisory: filled red square + color = redColor; + ctx.fillStyle = color; + ctx.fillRect(p.x - 13, p.y - 13, 26, 26); + } else if (e.ta) { + // Traffic advisory: filled yellow circle + color = yellowColor; + ctx.fillStyle = color; + ctx.beginPath(); + ctx.arc(p.x, p.y, 14, 0, 2 * Math.PI); + ctx.fill(); + } else { + ctx.strokeStyle = "white"; + ctx.fillStyle = "white"; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(p.x, p.y - 16); + ctx.lineTo(p.x + 12, p.y); + ctx.lineTo(p.x, p.y + 16); + ctx.lineTo(p.x - 12, p.y); + ctx.closePath(); + if (proximate) { + ctx.fill(); + } else { + ctx.stroke(); + } + } + ctx.fillStyle = color; + if (rel !== undefined) { + ctx.textAlign = "center"; + const text = (rel >= 0 ? "+" : "-") + pad(Math.abs(rel), 2); + const textY = (rel >= 0) ? p.y - 26 : p.y + 42; + ctx.fillText(text, p.x, textY); + if ((t.vs !== undefined) && (Math.abs(t.vs) > 500)) { + ctx.fillText(t.vs > 0 ? "\u2191" : "\u2193", p.x + 40, textY); + } + } + } +} + +function ndDrawData(ctx) { + const T = ndTheme.nd; + const boeing = (T.tcas === "boeing"); + // Groundspeed and TAS, top left + ctx.font = "28px Arial"; + ctx.textAlign = "left"; + if (ndGroundspeed !== undefined) { + ctx.fillStyle = "white"; + ctx.fillText("GS", 20, 40); + ctx.fillStyle = T.dataValue; + ctx.fillText(Math.round(ndGroundspeed).toString(), 70, 40); + } + if (ndTrueAirspeed !== undefined) { + ctx.fillStyle = "white"; + ctx.fillText("TAS", 140, 40); + ctx.fillStyle = T.dataValue; + ctx.fillText(Math.round(ndTrueAirspeed).toString(), 205, 40); + } + + // Wind direction/speed and arrow + if ((ndWindSpeed !== undefined) && (ndWindDirection !== undefined)) { + ctx.fillStyle = T.dataValue; + const windText = pad(Math.round(ndWindDirection), 3) + (boeing ? "\u00B0/" : "/") + Math.round(ndWindSpeed); + ctx.fillText(windText, 20, 80); + + // An arrow showing wind direction relative to heading, under the text + const angle = (ndWindDirection - ndReferenceHeading()) * Math.PI / 180.0; + ctx.save(); + ctx.translate(38, 112); + ctx.rotate(angle); + ctx.strokeStyle = T.dataValue; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(0, -14); + ctx.lineTo(0, 14); + ctx.lineTo(-7, 10); + ctx.moveTo(0, 14); + ctx.lineTo(7, 10); + ctx.stroke(); + ctx.restore(); + } + + // Static air temperature, bottom left - drawn on the PFD until now, but it is + // ECAM/ND data rather than a flight instrument, and the PFD had it tucked under the + // QNH where there is little room + if (T.showSat && (ndStaticAirTemperature !== undefined)) { + const sat = Math.round(ndStaticAirTemperature); + ctx.font = "28px Arial"; + ctx.textAlign = "left"; + ctx.fillStyle = "white"; + ctx.fillText("SAT", 20, 970); + ctx.fillStyle = greenColor; + // Always signed, as the ECAM shows it, and placed by measurement rather than a + // fixed offset so that the degree symbol does not collide with -40 or wander + // away from +7 + const satText = (sat > 0 ? "+" : "") + sat; + ctx.fillText(satText, 100, 970); + ctx.fillStyle = cyanColor; + ctx.fillText("\u00B0C", 108 + ctx.measureText(satText).width, 970); + } + + // TCAS mode, bottom middle in a box. An active resolution advisory outranks the + // degraded-mode annunciations + if (boeing) { + // Boeing: TRAFFIC below the approach annunciator, red for an RA and amber for a + // TA; the mode bottom right, TCAS OFF amber and TA ONLY cyan + // TRAFFIC sits on the right, just under the outer range ring - so it is + // placed from the ring rather than at a fixed spot, and follows ARC and ROSE + const geom = ndGeometry(); + // Kept inside the ring, so in ROSE the text does not sit across the ring line + const trafficX = Math.min(980, geom.refX + geom.radius - 10); + const dx = Math.min(trafficX, geom.refX + geom.radius - 20) - geom.refX; + const inside = geom.radius * geom.radius - dx * dx; + const trafficY = geom.refY - ((inside > 0) ? Math.sqrt(inside) : 0) + 40; + ctx.font = "28px Arial"; + ctx.textAlign = "right"; + if (ndTcasRA & 1) { + ctx.fillStyle = redColor; + ctx.fillText("TRAFFIC", trafficX, trafficY); + } else if ((ndTcasMode !== 1) && !tcasInhibited && ndHasTA()) { + // Silent below the inhibit height, as the PFD's armed TCAS is + ctx.fillStyle = orangeColor; + ctx.fillText("TRAFFIC", trafficX, trafficY); + } + ctx.textAlign = "right"; + if (ndTcasMode === 1) { + ctx.fillStyle = orangeColor; + ctx.fillText("TCAS OFF", 990, 970); + } else if (ndTcasMode === 2) { + ctx.fillStyle = cyanColor; + ctx.fillText("TA ONLY", 990, 970); + } + ctx.textAlign = "left"; + } else if (ndTcasRA & 1) { + const text = "TCAS RA"; + ctx.font = "28px Arial"; + ctx.textAlign = "center"; + const width = ctx.measureText(text).width + 40; + ctx.fillStyle = "black"; + ctx.fillRect(500 - width / 2, 940, width, 44); + ctx.strokeStyle = redColor; + ctx.lineWidth = 2; + ctx.strokeRect(500 - width / 2, 940, width, 44); + ctx.fillStyle = redColor; + ctx.fillText(text, 500, 972); + ctx.textAlign = "left"; + } else if ((ndTcasMode === 1) || (ndTcasMode === 2)) { + const text = (ndTcasMode === 1) ? "TCAS STBY" : "TA ONLY"; + ctx.font = "28px Arial"; + ctx.textAlign = "center"; + const width = ctx.measureText(text).width + 40; + ctx.fillStyle = "black"; + ctx.fillRect(500 - width / 2, 940, width, 44); + ctx.strokeStyle = "white"; + ctx.lineWidth = 2; + ctx.strokeRect(500 - width / 2, 940, width, 44); + // Standby is the one that matters - it means no traffic is being scanned for at + // all - so it is amber, where TA ONLY is only a downgrade and stays white + ctx.fillStyle = (ndTcasMode === 1) ? orangeColor : "white"; + ctx.fillText(text, 500, 972); + ctx.textAlign = "left"; + } + + // Departure and arrival, bottom right + if (T.showDepArr && (ndFlightPlan !== undefined) && (ndFlightPlan.dep !== undefined) && (ndFlightPlan.arr !== undefined)) { + ctx.fillStyle = "white"; + ctx.textAlign = "right"; + ctx.fillText(ndFlightPlan.dep + "-" + ndFlightPlan.arr, 990, 970); + } +} + +function ndDrawActiveWaypointInfo(ctx) { + if ((ndFlightPlan === undefined) || (ndFlightPlan.wpts === undefined)) { + return; + } + const act = ndFlightPlan.act; + if ((act === undefined) || (act < 0) || (act >= ndFlightPlan.wpts.length)) { + return; + } + const wp = ndFlightPlan.wpts[act]; + ctx.font = "28px Arial"; + ctx.textAlign = "right"; + // Top right, below the close button, where the on-canvas controls sat before they + // moved to the EFIS panel + var y = 78; + const T = ndTheme.nd; + if (wp.n !== undefined) { + ctx.fillStyle = T.waypointIdent; + ctx.fillText(wp.n, 990, y); + y += 35; + } + if ((wp.lat !== undefined) && (wp.lon !== undefined) && (ndLat !== undefined) && (ndLon !== undefined)) { + const dN = (wp.lat - ndLat) * 60.0; + const dE = (wp.lon - ndLon) * 60.0 * Math.cos(ndLat * Math.PI / 180.0); + const dist = Math.sqrt(dN * dN + dE * dE); + ctx.fillStyle = T.dataValue; + ctx.fillText(Math.round(dist).toString(), 938, y); + ctx.fillStyle = T.unit; + ctx.fillText("NM", 990, y); + y += 35; + } + if (wp.eta !== undefined) { + ctx.fillStyle = T.dataValue; + ctx.fillText(wp.eta, 990, y); + } +} + +// Distance in NM from own position to the arrival airport - the waypoint named as the +// arrival, or failing that the last placed waypoint. undefined when it cannot be known. +function ndDistanceToArrival() { + if ((ndFlightPlan === undefined) || (ndFlightPlan.wpts === undefined) + || (ndLat === undefined) || (ndLon === undefined)) { + return undefined; + } + var arrival; + for (const wp of ndFlightPlan.wpts) { + if ((wp.lat === undefined) || (wp.lon === undefined)) { + continue; + } + if (wp.n === ndFlightPlan.arr) { + arrival = wp; + break; + } + arrival = wp; // Last placed waypoint, unless the arrival itself is found + } + if (arrival === undefined) { + return undefined; + } + const dN = (arrival.lat - ndLat) * 60.0; + const dE = (arrival.lon - ndLon) * 60.0 * Math.cos(ndLat * Math.PI / 180.0); + return Math.sqrt(dN * dN + dE * dE); +} + +// The runway an approach serves, from the approach as filed - ILSY01R gives 01R. +// undefined when the name does not end in one, as a plain RNAV or VOR approach may not. +function ndApproachRunway(approach) { + if (approach === undefined) { + return undefined; + } + const match = approach.match(/([0-9]{2}[LRC]?)$/); + return match ? match[1] : undefined; +} + +// Arrival approach/runway annunciator, top middle - e.g. "ILSY 01R" - shown when the +// aircraft is flying an approach, or when it is within 250 NM of the arrival airport. +// +// Note that the PFD's G/S and LOC are not two independent facts: both are decoded from +// the single approach-mode bit of the ADS-B target state and status message, and which +// of them the PFD shows depends only on whether VNAV or LNAV masks it (see +// adsbdemodtrackerdecode.cpp). So either one on its own means "flying an approach", and +// testing for both would miss the aircraft that also report LNAV or VNAV. +function ndDrawApproach(ctx) { + const approaching = (ndVerticalMode === 3) || (ndLateralMode === 2); + const app = (ndFlightPlan !== undefined) ? ndFlightPlan.app : undefined; + const rwy = (ndFlightPlan !== undefined) ? ndFlightPlan.rwy : undefined; + var text; + if (approaching) + { + // Approach mode with a glideslope is an ILS, whatever was filed - so an approach + // filed as something else is named by its runway rather than by its own name, + // which would contradict what the aircraft is actually flying. A filed ILS keeps + // its full name, since the variant letter of an ILSY is worth having. + const runway = ndApproachRunway(app) || rwy; + if ((app !== undefined) && app.startsWith("ILS")) { + text = app.replace(/([0-9]{2}[LRC]?)$/, " $1"); + } else if (runway !== undefined) { + text = "ILS " + runway; + } else { + // No flight plan, or one that never named a runway. Most aircraft seen on + // approach here are in that position, so this is the common case rather than + // an edge one, and the annunciator still says what is being flown. + text = "ILS APPR"; + } + } + else + { + if (app !== undefined) { + // The approach as filed usually ends in the runway it serves - ILSY01R - + // so space it off for readability + text = app.replace(/([0-9]{2}[LRC]?)$/, " $1"); + } else if (rwy !== undefined) { + text = "RWY " + rwy; + } else { + return; + } + const distance = ndDistanceToArrival(); + if ((distance === undefined) || (distance > 250)) { + return; + } + } + ctx.fillStyle = "white"; + ctx.font = "28px Arial"; + ctx.textAlign = "center"; + ctx.fillText(text, 500, 38); +} + + +// Match the canvas backing store to the size it is displayed at, so text stays sharp +// however the window is resized - a fixed backing store scaled by CSS goes soft. +// Drawing code stays in the 1000x1000 logical space via the transform. +function ndPrepareCanvas() { + // clientWidth/Height rather than getBoundingClientRect(), so the border is not + // included in the drawn area + if ((ndCanvas.clientWidth > 0) && (ndCanvas.clientHeight > 0)) { + const dpr = window.devicePixelRatio || 1; + const w = Math.round(ndCanvas.clientWidth * dpr); + const h = Math.round(ndCanvas.clientHeight * dpr); + if ((ndCanvas.width !== w) || (ndCanvas.height !== h)) { + ndCanvas.width = w; + ndCanvas.height = h; + } + } + const ctx = ndCanvas.getContext("2d"); + ctx.setTransform(ndCanvas.width / 1000, 0, 0, ndCanvas.height / 1000, 0, 0); + return ctx; +} + +function drawND() { + const ctx = ndPrepareCanvas(); + const geom = ndGeometry(); + const ppnm = geom.radius / ndRanges[ndRangeIdx]; + + ctx.fillStyle = "black"; + ctx.fillRect(0, 0, 1000, 1000); + + // Map layers, clipped to the compass area + ctx.save(); + ctx.beginPath(); + ctx.arc(geom.refX, geom.refY, geom.radius, 0, 2 * Math.PI); + ctx.clip(); + if ((ndLat !== undefined) && (ndLon !== undefined)) { + ndDrawTerrain(ctx, geom, ppnm); + ndDrawWeather(ctx, geom, ppnm); + if (ndShowVor) { + ndDrawNavAids(ctx, geom, ppnm); + } + if (ndShowArpt) { + ndDrawAirports(ctx, geom, ppnm); + } + ndDrawFlightPlan(ctx, geom, ppnm); + ndDrawTraffic(ctx, geom, ppnm); + } + ctx.restore(); + + ndDrawRangeRings(ctx, geom); + ndDrawCompass(ctx, geom); + ndDrawTrack(ctx, geom); + ndDrawSelectedHeading(ctx, geom); + ndDrawAircraftSymbol(ctx, geom); + ndDrawData(ctx); + ndDrawActiveWaypointInfo(ctx); + ndDrawApproach(ctx); + + panelDrawClose(ctx); + + // The ND's own wheel changes range, so its settings are checked here too + efisCheckState(); +} + +// Self-test with fake data, callable from the DevTools console while developing. +// type: the ICAO aircraft type to show as, e.g. "B738" for the Boeing look; A320 by default +function animateND(type) { + ndAircraftType = (type === undefined) ? "A320" : type; + ndTheme = cockpitThemeFor(ndAircraftType); + ndLat = 51.47; + ndLon = -0.46; + ndAltitude = 10000; + ndHeading = 0; + ndTrack = 5; + ndSelectedHeading = 30; + ndGroundspeed = 456; + ndTrueAirspeed = 460; + ndWindSpeed = 25; + ndWindDirection = 240; + ndTcasMode = 2; + ndStaticAirTemperature = -47; + ndFlightPlan = { + dep: "EGLL", arr: "EHAM", rwy: "18R", app: "ILSY18R", act: 2, + wpts: [ + { n: "EGLL", lat: 51.4706, lon: -0.4619 }, + { n: "DET", lat: 51.304, lon: 0.5972, alt: 6000 }, + { n: "DVR", lat: 51.1626, lon: 1.3598, alt: 12000, eta: "12:34" }, + { n: "KONAN", lat: 51.0781, lon: 2.0, alt: 24000 }, + { n: "REDFA", lat: 51.8442, lon: 4.0, alt: 24000 }, + { n: "EHAM", lat: 52.3086, lon: 4.7639 } + ] + }; + ndVerticalSpeed = 0; + // An active corrective descend RA against the "abc123" entry, which draws as the + // red square and the TCAS RA annunciator + ndTcasRA = 1 | 2 | 4 | 8; + ndThreatIcao = "abc123"; + ndTraffic = [ + { lat: 51.2, lon: -0.3, altFt: 11000, vs: 1200, gs: 300, trk: 90, icao: "aaa001" }, + { lat: 51.6, lon: -0.7, altFt: 9500, vs: 0, gs: 250, trk: 270, icao: "aaa002" }, + { lat: 51.5, lon: -0.5, altFt: 10200, vs: -800, gs: 400, trk: 180, icao: "abc123" }, + // Head-on 4 NM ahead at the same level: a traffic advisory (yellow circle) + { lat: 51.5367, lon: -0.46, altFt: 10000, vs: 0, gs: 450, trk: 180, icao: "ta0001" }, + // Head-on 11 NM ahead, closing fast enough for a TA - off scale at 10 NM range + { lat: 51.6533, lon: -0.46, altFt: 10300, vs: 0, gs: 550, trk: 180, icao: "ta0002" } + ]; + ndUpdateAdvisories(); + setNDAirports([ + { n: "EGLL", lat: 51.4706, lon: -0.4619, t: 2 }, + { n: "EGKK", lat: 51.1481, lon: -0.1903, t: 2 }, + { n: "EGLC", lat: 51.5053, lon: 0.0553, t: 1 }, + { n: "EGKB", lat: 51.3308, lon: 0.0325, t: 0 } + ]); + setNDNavAids([ + { n: "LON", lat: 51.4870, lon: -0.4518 }, + { n: "BIG", lat: 51.3306, lon: 0.0347 }, + { n: "LAM", lat: 51.6461, lon: 0.1517 }, + { n: "OCK", lat: 51.3050, lon: -0.4472 } + ]); + // Live weather for the harness, straight from the RainViewer API (in the real + // page the frame path arrives with the rain layer settings instead) + fetch("https://api.rainviewer.com/public/weather-maps.json") + .then(function (r) { return r.json(); }) + .then(function (j) { + const frames = j.radar && j.radar.past; + if (frames && frames.length) { + setNDWeatherPath(frames[frames.length - 1].path.replace(/^\//, "")); + } + }) + .catch(function (e) { console.log("RainViewer fetch failed: " + e); }); + ndCanvas.removeAttribute("hidden"); + setInterval(function () { + ndHeading = (ndHeading + 0.2) % 360; + ndTrack = (ndHeading + 5) % 360; + drawND(); + }, 50); +} + +const ndCanvas = document.getElementById('ndCanvas'); +ndCanvas.onmousedown = ndMouseDown; +ndCanvas.onmouseup = ndMouseUp; +ndCanvas.onmousemove = ndMouseMove; +ndCanvas.onmouseleave = ndMouseLeave; +ndCanvas.onmouseenter = ndMouseEnter; +ndCanvas.onwheel = ndWheel; +var ndDocMouseMove = null; +var ndDocMouseUp = null; +var ndDocMouseCaptured = false; +var ndMove = false; +var ndScale = false; +var ndPosX = 0; +// Where the cursor was when the drag started, so each move places the panel +// absolutely from it rather than accumulating deltas +var ndDragX = 0; +var ndDragY = 0; +var ndPosY = 0; +var ndCanvasWidth = 0; +var ndCanvasHeight = 0; + +function ndInRect(x, y, rect) { + return (x >= rect.x) && (x <= rect.x + rect.w) && (y >= rect.y) && (y <= rect.y + rect.h); +} + +function ndSetRange(idx) { + ndRangeIdx = Math.min(Math.max(idx, 0), ndRanges.length - 1); + drawND(); +} + +function ndMouseDown(e) { + e.preventDefault(); + e.stopPropagation(); + const r = ndCanvas.getBoundingClientRect(); + // Canvas is drawn in a 1000x1000 space, then CSS scaled + const x = e.offsetX * 1000 / r.width; + const y = e.offsetY * 1000 / r.height; + if (panelInClose(x, y)) { + panelClose("nd", ndCanvas); + return; + } + ndPosX = r.left; + ndPosY = r.top; + ndCanvasWidth = r.width; + ndCanvasHeight = r.height; + ndDragX = e.clientX; + ndDragY = e.clientY; + if ((e.offsetX > 0.95 * ndCanvasWidth) && (e.offsetY > 0.95 * ndCanvasHeight)) { + ndScale = true; + } else { + ndMove = true; + } +} +function ndMouseUp(e) { + e.preventDefault(); + e.stopPropagation(); + if (ndMove || ndScale) { + panelSaveGeometry("nd", ndCanvas); + } + ndMove = false; + ndScale = false; + ndRestoreDocMouse(); +} +function ndMouseMove(e) { + e.preventDefault(); + e.stopPropagation(); + if (ndMove) { + ndCanvas.style.position = "absolute"; + ndCanvas.style.left = (ndPosX + e.clientX - ndDragX) + "px"; + ndCanvas.style.top = (ndPosY + e.clientY - ndDragY) + "px"; + } else if (ndScale) { + const newWidth = ndCanvasWidth + e.clientX - ndDragX; + const newHeight = ndCanvasHeight + e.clientY - ndDragY; + const constrainedWidth = Math.max(newWidth, 250); + const constrainedHeight = Math.max(newHeight, 250); + ndCanvas.style.width = constrainedWidth + "px"; + ndCanvas.style.height = constrainedHeight + "px"; + drawND(); // Redrawn at the new size, so it stays sharp while resizing + } +} + +function ndMouseLeave(e) { + if ((ndScale || ndMove) && !ndDocMouseCaptured) { + ndDocMouseUp = document.onmouseup; + ndDocMouseMove = document.onmousemove; + ndDocMouseCaptured = true; + document.onmouseup = ndMouseUp; + document.onmousemove = ndMouseMove; + } +} + +function ndRestoreDocMouse() { + if (ndDocMouseCaptured) { + document.onmouseup = ndDocMouseUp; + document.onmousemove = ndDocMouseMove; + ndDocMouseUp = null; + ndDocMouseMove = null; + ndDocMouseCaptured = false; + } +} +function ndMouseEnter(e) { + ndRestoreDocMouse(); +} + +function ndWheel(e) { + e.preventDefault(); + e.stopPropagation(); + // Wheel up zooms in + ndSetRange(ndRangeIdx + ((e.deltaY < 0) ? -1 : 1)); +} + +// --------------------------------------------------------------------------------- +// EFIS control panel - a separate canvas above the ND carrying its controls, in the +// style of the A320 EFIS section of the FCU: a MODE selector, a RANGE selector and +// the overlay pushbuttons (WX, TERR, ARPT, VOR - a lit green bar means on). Moving +// the controls here freed the ND's top right corner for the waypoint information. +// Drawn in a 1000x260 logical space; shares the nd* state it controls. + +const efisModeLabels = ["ROSE", "ARC"]; +const efisWxRect = { x: 580, y: 30, w: 170, h: 85 }; +const efisTerrRect = { x: 770, y: 30, w: 170, h: 85 }; +const efisArptRect = { x: 580, y: 145, w: 170, h: 85 }; +const efisVorRect = { x: 770, y: 145, w: 170, h: 85 }; +const efisModeKnob = { cx: 150, cy: 165, r: 55 }; +const efisRangeKnob = { cx: 430, cy: 165, r: 55 }; + +function efisPrepareCanvas() { + if ((efisCanvas.clientWidth > 0) && (efisCanvas.clientHeight > 0)) { + const dpr = window.devicePixelRatio || 1; + const w = Math.round(efisCanvas.clientWidth * dpr); + const h = Math.round(efisCanvas.clientHeight * dpr); + if ((efisCanvas.width !== w) || (efisCanvas.height !== h)) { + efisCanvas.width = w; + efisCanvas.height = h; + } + } + const ctx = efisCanvas.getContext("2d"); + ctx.setTransform(efisCanvas.width / 1000, 0, 0, efisCanvas.height / 260, 0, 0); + return ctx; +} + +// A rotary selector: labels on an arc over the knob, the selected one green, with +// the pointer turned to it +function efisDrawKnob(ctx, knob, title, labels, selected) { + ctx.font = "24px Arial"; + ctx.textAlign = "center"; + ctx.fillStyle = "white"; + // The title sits on the panel's title row unless the knob says otherwise (the RMP's + // TCAS knob is in the lower half of a taller panel) + ctx.fillText(title, knob.cx, (knob.titleY !== undefined) ? knob.titleY : 42); + + const n = labels.length; + for (var i = 0; i < n; i++) { + const a = (n === 1) ? 0 : (-65 + 130 * i / (n - 1)) * Math.PI / 180; + ctx.font = "20px Arial"; + ctx.fillStyle = (i === selected) ? greenColor : "#C8C8C8"; + ctx.fillText(labels[i], knob.cx + Math.sin(a) * (knob.r + 32), knob.cy - Math.cos(a) * (knob.r + 32) + 7); + } + + ctx.fillStyle = "#4A4A55"; + ctx.beginPath(); + ctx.arc(knob.cx, knob.cy, knob.r, 0, 2 * Math.PI); + ctx.fill(); + ctx.strokeStyle = "#6A6A75"; + ctx.lineWidth = 3; + ctx.stroke(); + + const a = (n === 1) ? 0 : (-65 + 130 * selected / (n - 1)) * Math.PI / 180; + ctx.strokeStyle = "white"; + ctx.lineWidth = 7; + ctx.beginPath(); + ctx.moveTo(knob.cx + Math.sin(a) * knob.r * 0.35, knob.cy - Math.cos(a) * knob.r * 0.35); + ctx.lineTo(knob.cx + Math.sin(a) * knob.r * 0.95, knob.cy - Math.cos(a) * knob.r * 0.95); + ctx.stroke(); +} + +// An A320 style pushbutton: dark cap, white legend, and a green bar lit when on +function efisDrawButton(ctx, rect, label, on) { + ctx.fillStyle = "#26262E"; + ctx.fillRect(rect.x, rect.y, rect.w, rect.h); + ctx.strokeStyle = "#55555F"; + ctx.lineWidth = 3; + ctx.strokeRect(rect.x, rect.y, rect.w, rect.h); + ctx.font = "26px Arial"; + ctx.textAlign = "center"; + ctx.fillStyle = "#C8C8C8"; + ctx.fillText(label, rect.x + rect.w / 2, rect.y + 38); + if (on) { + ctx.fillStyle = greenColor; + ctx.fillRect(rect.x + 30, rect.y + rect.h - 28, rect.w - 60, 14); + } +} + +function drawEFIS() { + if (efisCanvas === null) { + return; + } + const ctx = efisPrepareCanvas(); + + ctx.fillStyle = "#33333C"; + ctx.fillRect(0, 0, 1000, 260); + ctx.strokeStyle = "#55555F"; + ctx.lineWidth = 4; + ctx.strokeRect(2, 2, 996, 256); + + efisDrawKnob(ctx, efisModeKnob, "MODE", efisModeLabels, ndMode); + efisDrawKnob(ctx, efisRangeKnob, "RANGE", ndRanges.map(String), ndRangeIdx); + + efisDrawButton(ctx, efisWxRect, "WX", ndWxEnabled); + efisDrawButton(ctx, efisTerrRect, "TERR", ndTerrEnabled); + efisDrawButton(ctx, efisArptRect, "ARPT", ndShowArpt); + efisDrawButton(ctx, efisVorRect, "VOR", ndShowVor); + + panelDrawClose(ctx); + + efisCheckState(); +} + +function efisInKnob(x, y, knob) { + // The clickable area includes the label arc, so clicking a label works too + const dx = x - knob.cx; + const dy = y - knob.cy; + return Math.sqrt(dx * dx + dy * dy) <= knob.r + 55; +} + +var efisMove = false; +var efisScale = false; +var efisPosX = 0; +// Where the cursor was when the drag started, so each move places the panel +// absolutely from it rather than accumulating deltas +var efisDragX = 0; +var efisDragY = 0; +var efisPosY = 0; +var efisWidth = 0; +var efisHeight = 0; + +function efisMouseDown(e) { + e.preventDefault(); + e.stopPropagation(); + const r = efisCanvas.getBoundingClientRect(); + const x = e.offsetX * 1000 / r.width; + const y = e.offsetY * 260 / r.height; + if (panelInClose(x, y)) { + panelClose("efis", efisCanvas); + return; + } + if (efisInKnob(x, y, efisModeKnob)) { + // Left half turns one way, right half the other - with two positions, + // either just swaps + ndMode = (ndMode === 1) ? 0 : 1; + } else if (efisInKnob(x, y, efisRangeKnob)) { + ndSetRange(ndRangeIdx + ((x < efisRangeKnob.cx) ? -1 : 1)); + } else if (ndInRect(x, y, efisWxRect)) { + ndWxEnabled = !ndWxEnabled; + if (ndWxEnabled) { + ndTerrEnabled = false; // WX and TERR share the display, as on the aircraft + } + } else if (ndInRect(x, y, efisTerrRect)) { + ndTerrEnabled = !ndTerrEnabled; + if (ndTerrEnabled) { + ndWxEnabled = false; + } + } else if (ndInRect(x, y, efisArptRect)) { + ndShowArpt = !ndShowArpt; + } else if (ndInRect(x, y, efisVorRect)) { + ndShowVor = !ndShowVor; + } else { + efisPosX = r.left; + efisPosY = r.top; + efisWidth = r.width; + efisHeight = r.height; + efisDragX = e.clientX; + efisDragY = e.clientY; + // A fixed 25px corner, not a fraction: 5% of this short panel was unhittable + if ((e.offsetX > efisWidth - 25) && (e.offsetY > efisHeight - 25)) { + efisScale = true; + } else { + efisMove = true; + } + return; + } + drawND(); + drawEFIS(); +} +function efisMouseUp(e) { + e.preventDefault(); + e.stopPropagation(); + if (efisMove || efisScale) { + panelSaveGeometry("efis", efisCanvas); + } + efisMove = false; + efisScale = false; + efisRestoreDocMouse(); +} +function efisMouseMove(e) { + e.preventDefault(); + e.stopPropagation(); + if (efisMove) { + efisCanvas.style.position = "absolute"; + efisCanvas.style.left = (efisPosX + e.clientX - efisDragX) + "px"; + efisCanvas.style.top = (efisPosY + e.clientY - efisDragY) + "px"; + } else if (efisScale) { + const newWidth = efisWidth + e.clientX - efisDragX; + const newHeight = efisHeight + e.clientY - efisDragY; + efisCanvas.style.width = Math.max(newWidth, 250) + "px"; + efisCanvas.style.height = Math.max(newHeight, 65) + "px"; + drawEFIS(); + } +} +// The wheel turns whichever rotary it is over; anywhere else it works the range, +// matching the wheel's behaviour over the ND itself. Wheel up turns the selector +// clockwise - the way the knob would move under a finger - which steps to the next +// label to the right, so up is towards the longer ranges +function efisWheel(e) { + e.preventDefault(); + e.stopPropagation(); + const r = efisCanvas.getBoundingClientRect(); + const x = e.offsetX * 1000 / r.width; + const y = e.offsetY * 260 / r.height; + const step = (e.deltaY < 0) ? 1 : -1; + if (efisInKnob(x, y, efisModeKnob)) { + ndMode = (ndMode === 1) ? 0 : 1; + drawND(); + } else { + ndSetRange(ndRangeIdx + step); + } + drawEFIS(); +} + +// A drag chases a window that lags the cursor, so the cursor is forever escaping the +// canvas - especially one this short. Hand the drag to document-level handlers when +// it leaves, and take it back when it returns, exactly as the ND does +var efisDocMouseMove = null; +var efisDocMouseUp = null; +var efisDocMouseCaptured = false; + +function efisMouseLeave(e) { + if ((efisScale || efisMove) && !efisDocMouseCaptured) { + efisDocMouseUp = document.onmouseup; + efisDocMouseMove = document.onmousemove; + efisDocMouseCaptured = true; + document.onmouseup = efisMouseUp; + document.onmousemove = efisMouseMove; + } +} + +function efisRestoreDocMouse() { + if (efisDocMouseCaptured) { + document.onmouseup = efisDocMouseUp; + document.onmousemove = efisDocMouseMove; + efisDocMouseUp = null; + efisDocMouseMove = null; + efisDocMouseCaptured = false; + } +} + +function efisMouseEnter(e) { + efisRestoreDocMouse(); +} + +// Null in a page (such as a test harness) without the panel +const efisCanvas = document.getElementById('efisCanvas'); +if (efisCanvas !== null) { + efisCanvas.onmousedown = efisMouseDown; + efisCanvas.onmouseup = efisMouseUp; + efisCanvas.onmousemove = efisMouseMove; + efisCanvas.onmouseleave = efisMouseLeave; + efisCanvas.onmouseenter = efisMouseEnter; + efisCanvas.onwheel = efisWheel; +} + +// --------------------------------------------------------------------------------- +// The squawk, as the ADS-B demodulator decoded it: decimal digits, undefined when not +// decoded. Set by the page for the RMP panel (rmp.js), which shows it +var ndSquawk; diff --git a/plugins/feature/map/map/rmp.js b/plugins/feature/map/map/rmp.js new file mode 100644 index 000000000..b92dada0f --- /dev/null +++ b/plugins/feature/map/map/rmp.js @@ -0,0 +1,405 @@ +// RMP - a simplified radio management panel in the style of the A350's DRAIMS: two VHF +// COM channels, each with an ACTIVE and a STANDBY frequency, a keypad to enter a standby +// frequency and a swap key per channel that makes it active. Each VHF channel is linked +// to an SDRangel AM Demod, chosen in the Map's display settings, which is retuned when +// the active frequency changes. Also carries the transponder code and TCAS traffic +// selector, which on the real aircraft live on the ATC panel next to it. +// Drawn in a 1000x400 logical space. Uses the EFIS panel's knob and button primitives +// and the cockpit colours, so navdisplay.js and cockpit.js must be loaded first. + +// The band the keypad accepts, in Hz. The airband, with 8.33 kHz channels named on +// 5 kHz boundaries. Widen the lower limit to 108 MHz for NAV audio +const rmpMinFrequency = 118000000; +const rmpMaxFrequency = 136975000; +const rmpFrequencyStep = 5000; +const rmpWheelStep = 25000; // Per wheel tick over a standby display + +const rmpTcasLabels = ["THRT", "ALL", "ABV", "BLW"]; +const rmpTcasKnob = { cx: 470, cy: 335, r: 42, titleY: 240 }; +const rmpSquawkRect = { x: 90, y: 275, w: 220, h: 75 }; + +// Per VHF channel: what the linked AM Demod is tuned to (null when it cannot be read), +// the standby frequency, whether an AM Demod is linked, the digits being typed for a new +// standby (null when none) and when a rejected entry's amber flash ends +const rmpVhf = [ + { active: null, standby: 121500000, available: false, entry: null, flashUntil: 0 }, + { active: null, standby: 121500000, available: false, entry: null, flashUntil: 0 } +]; +var rmpSelected = 0; // Which channel's standby the keypad edits + +// Layout. The two VHF rows fill the left two thirds, the keypad the right third +const rmpRows = [ + { y: 40, label: "VHF1" }, + { y: 135, label: "VHF2" } +]; +const rmpActiveX = 90; +const rmpStandbyX = 400; +const rmpDisplayW = 220; +const rmpDisplayH = 75; +const rmpSwapX = 325; +function rmpActiveRect(i) { return { x: rmpActiveX, y: rmpRows[i].y, w: rmpDisplayW, h: rmpDisplayH }; } +function rmpStandbyRect(i) { return { x: rmpStandbyX, y: rmpRows[i].y, w: rmpDisplayW, h: rmpDisplayH }; } +function rmpSwapRect(i) { return { x: rmpSwapX, y: rmpRows[i].y + 7, w: 60, h: 60 }; } + +const rmpKeys = []; +(function () { + const labels = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "CLR", "0", "."]; + for (let i = 0; i < labels.length; i++) { + rmpKeys.push({ + label: labels[i], + x: 670 + (i % 3) * 107, + y: 40 + Math.floor(i / 3) * 85, + w: 95, + h: 70 + }); + } +})(); + +function rmpInRect(x, y, r) { + return (x >= r.x) && (x < r.x + r.w) && (y >= r.y) && (y < r.y + r.h); +} + +function rmpFormat(hz) { + if ((hz === null) || (hz === undefined)) { + return "---.---"; + } + return (hz / 1e6).toFixed(3); +} + +// The keypad entry as Hz, or null when it is not a usable channel frequency +function rmpParseEntry(entry) { + if ((entry === null) || !/^\d{3}(\.\d{1,3})?$/.test(entry)) { + return null; + } + const hz = Math.round(parseFloat(entry) * 1e6); + if ((hz < rmpMinFrequency) || (hz > rmpMaxFrequency) || ((hz % rmpFrequencyStep) !== 0)) { + return null; + } + return hz; +} + +function rmpSend(obj) { + // No socket in a test harness + if ((typeof socket !== "undefined") && socket) { + socket.send(JSON.stringify(obj)); + } +} + +function rmpSendStandby(i) { + rmpSend({ event: "rmpStandby", vhf: i + 1, frequency: rmpVhf[i].standby }); +} + +function rmpPrepareCanvas() { + if ((rmpCanvas.clientWidth > 0) && (rmpCanvas.clientHeight > 0)) { + const dpr = window.devicePixelRatio || 1; + const w = Math.round(rmpCanvas.clientWidth * dpr); + const h = Math.round(rmpCanvas.clientHeight * dpr); + if ((rmpCanvas.width !== w) || (rmpCanvas.height !== h)) { + rmpCanvas.width = w; + rmpCanvas.height = h; + } + } + const ctx = rmpCanvas.getContext("2d"); + ctx.setTransform(rmpCanvas.width / 1000, 0, 0, rmpCanvas.height / 400, 0, 0); + return ctx; +} + +// An LCD style inset frequency display. Amber while a rejected entry is flashed, a +// cyan frame on the standby the keypad is editing +function rmpDrawDisplay(ctx, rect, text, frameColor, textColor) { + ctx.fillStyle = "#101014"; + ctx.fillRect(rect.x, rect.y, rect.w, rect.h); + ctx.strokeStyle = frameColor; + ctx.lineWidth = 3; + ctx.strokeRect(rect.x, rect.y, rect.w, rect.h); + ctx.font = "52px monospace"; + ctx.textAlign = "center"; + ctx.fillStyle = textColor; + ctx.fillText(text, rect.x + rect.w / 2, rect.y + rect.h / 2 + 19); +} + +function drawRMP() { + if (rmpCanvas === null) { + return; + } + const ctx = rmpPrepareCanvas(); + const now = Date.now(); + + ctx.fillStyle = "#33333C"; + ctx.fillRect(0, 0, 1000, 400); + ctx.strokeStyle = "#55555F"; + ctx.lineWidth = 4; + ctx.strokeRect(2, 2, 996, 396); + + ctx.font = "20px Arial"; + ctx.fillStyle = "white"; + ctx.textAlign = "center"; + ctx.fillText("ACTIVE", rmpActiveX + rmpDisplayW / 2, 30); + ctx.fillText("STBY", rmpStandbyX + rmpDisplayW / 2, 30); + + for (let i = 0; i < 2; i++) { + const v = rmpVhf[i]; + const row = rmpRows[i]; + ctx.font = "24px Arial"; + ctx.fillStyle = "white"; + ctx.textAlign = "left"; + ctx.fillText(row.label, 12, row.y + rmpDisplayH / 2 + 9); + + rmpDrawDisplay(ctx, rmpActiveRect(i), v.available ? rmpFormat(v.active) : "---.---", "#55555F", greenColor); + + const flashing = now < v.flashUntil; + const text = (v.entry !== null) ? v.entry : rmpFormat(v.standby); + rmpDrawDisplay(ctx, rmpStandbyRect(i), text, + (i === rmpSelected) ? cyanColor : "#55555F", + flashing ? orangeColor : greenColor); + + efisDrawButton(ctx, rmpSwapRect(i), "\u21C4", false); // Left-right arrows + } + + for (const key of rmpKeys) { + efisDrawButton(ctx, key, key.label, false); + } + + // The transponder code + ctx.font = "20px Arial"; + ctx.textAlign = "center"; + ctx.fillStyle = "white"; + ctx.fillText("XPDR", rmpSquawkRect.x + rmpSquawkRect.w / 2, 262); + const code = (ndSquawk !== undefined) && (ndSquawk >= 0) + ? ndSquawk.toString().padStart(4, "0") : "----"; + rmpDrawDisplay(ctx, rmpSquawkRect, code, "#55555F", greenColor); + + efisDrawKnob(ctx, rmpTcasKnob, "TCAS", rmpTcasLabels, ndTcasFilterIdx); + + panelDrawClose(ctx); + + // The TCAS selector is saved with the EFIS settings, as it was once on that panel + efisCheckState(); +} + +function rmpStepTcas(step) { + ndTcasFilterIdx = Math.min(Math.max(ndTcasFilterIdx + step, 0), rmpTcasLabels.length - 1); + drawND(); + drawRMP(); +} + +function rmpKey(label) { + const v = rmpVhf[rmpSelected]; + if (label === "CLR") { + if (v.entry !== null) { + v.entry = v.entry.slice(0, -1); + if (v.entry.length === 0) { + v.entry = null; + } + } + } else if (label === ".") { + if ((v.entry !== null) && (v.entry.length === 3)) { + v.entry += "."; + } + } else { + const entry = (v.entry === null) ? "" : v.entry; + const dot = entry.indexOf("."); + if (dot < 0) { + if (entry.length < 3) { + v.entry = entry + label; + if (v.entry.length === 3) { + v.entry += "."; // The point is always there, so save a keystroke + } + } + } else if (entry.length - dot - 1 < 3) { + v.entry = entry + label; + } + } + drawRMP(); +} + +// The swap key: a typed entry becomes the standby first, then standby and active are +// exchanged and the linked AM Demod is retuned to the new active frequency +function rmpSwap(i) { + const v = rmpVhf[i]; + if (v.entry !== null) { + const hz = rmpParseEntry(v.entry); + if (hz === null) { + v.flashUntil = Date.now() + 700; + drawRMP(); + return; + } + v.standby = hz; + v.entry = null; + } + if (v.available) { + const newActive = v.standby; + if (v.active !== null) { + v.standby = v.active; + } + v.active = newActive; // Confirmed, or corrected, by the next setRMPState + rmpSend({ event: "rmpTune", vhf: i + 1, frequency: newActive }); + } + rmpSendStandby(i); + drawRMP(); +} + +// From the GUI: what the linked AM Demods are actually tuned to. A standby being +// typed over is left alone +function rmpSetState(state) { + for (let i = 0; i < 2; i++) { + const s = state["vhf" + (i + 1)]; + if (s === undefined) { + continue; + } + const v = rmpVhf[i]; + v.available = (s.available === true); + v.active = ((s.active === undefined) || (s.active === null)) ? null : s.active; + if ((v.entry === null) && (s.standby !== undefined)) { + v.standby = s.standby; + } + } + drawRMP(); +} + +var rmpMove = false; +var rmpScale = false; +var rmpPosX = 0; +var rmpPosY = 0; +// Where the cursor was when the drag started, so each move places the panel +// absolutely from it rather than accumulating deltas +var rmpDragX = 0; +var rmpDragY = 0; +var rmpWidth = 0; +var rmpHeight = 0; +var rmpDocMouseMove = null; +var rmpDocMouseUp = null; +var rmpDocMouseCaptured = false; + +function rmpMouseDown(e) { + e.preventDefault(); + e.stopPropagation(); + const r = rmpCanvas.getBoundingClientRect(); + const x = e.offsetX * 1000 / r.width; + const y = e.offsetY * 400 / r.height; + if (panelInClose(x, y)) { + panelClose("rmp", rmpCanvas); + return; + } + for (const key of rmpKeys) { + if (rmpInRect(x, y, key)) { + rmpKey(key.label); + return; + } + } + for (let i = 0; i < 2; i++) { + if (rmpInRect(x, y, rmpSwapRect(i))) { + rmpSwap(i); + return; + } + if (rmpInRect(x, y, rmpStandbyRect(i))) { + rmpSelected = i; + drawRMP(); + return; + } + } + if (efisInKnob(x, y, rmpTcasKnob)) { + rmpStepTcas((x < rmpTcasKnob.cx) ? -1 : 1); + return; + } + rmpPosX = r.left; + rmpPosY = r.top; + rmpWidth = r.width; + rmpHeight = r.height; + rmpDragX = e.clientX; + rmpDragY = e.clientY; + if ((e.offsetX > rmpWidth - 25) && (e.offsetY > rmpHeight - 25)) { + rmpScale = true; + } else { + rmpMove = true; + } +} + +function rmpMouseUp(e) { + e.preventDefault(); + e.stopPropagation(); + if (rmpMove || rmpScale) { + panelSaveGeometry("rmp", rmpCanvas); + } + rmpMove = false; + rmpScale = false; + rmpRestoreDocMouse(); +} + +function rmpMouseMove(e) { + e.preventDefault(); + e.stopPropagation(); + if (rmpMove) { + rmpCanvas.style.position = "absolute"; + rmpCanvas.style.left = (rmpPosX + e.clientX - rmpDragX) + "px"; + rmpCanvas.style.top = (rmpPosY + e.clientY - rmpDragY) + "px"; + } else if (rmpScale) { + const newWidth = rmpWidth + e.clientX - rmpDragX; + const newHeight = rmpHeight + e.clientY - rmpDragY; + rmpCanvas.style.width = Math.max(newWidth, 250) + "px"; + rmpCanvas.style.height = Math.max(newHeight, 100) + "px"; + drawRMP(); + } +} + +function rmpMouseLeave(e) { + if ((rmpScale || rmpMove) && !rmpDocMouseCaptured) { + rmpDocMouseUp = document.onmouseup; + rmpDocMouseMove = document.onmousemove; + rmpDocMouseCaptured = true; + document.onmouseup = rmpMouseUp; + document.onmousemove = rmpMouseMove; + } +} + +function rmpRestoreDocMouse() { + if (rmpDocMouseCaptured) { + document.onmouseup = rmpDocMouseUp; + document.onmousemove = rmpDocMouseMove; + rmpDocMouseUp = null; + rmpDocMouseMove = null; + rmpDocMouseCaptured = false; + } +} + +function rmpMouseEnter(e) { + rmpRestoreDocMouse(); +} + +function rmpWheel(e) { + e.preventDefault(); + e.stopPropagation(); + const r = rmpCanvas.getBoundingClientRect(); + const x = e.offsetX * 1000 / r.width; + const y = e.offsetY * 400 / r.height; + // Wheel up turns the selector clockwise, as on the EFIS panel + if (efisInKnob(x, y, rmpTcasKnob)) { + rmpStepTcas((e.deltaY < 0) ? 1 : -1); + return; + } + // Over a standby display, the wheel steps it a channel at a time, dropping any + // entry being typed + for (let i = 0; i < 2; i++) { + if (rmpInRect(x, y, rmpStandbyRect(i))) { + const v = rmpVhf[i]; + v.entry = null; + const step = (e.deltaY < 0) ? rmpWheelStep : -rmpWheelStep; + v.standby = Math.min(Math.max(v.standby + step, rmpMinFrequency), rmpMaxFrequency); + rmpSelected = i; + rmpSendStandby(i); + drawRMP(); + return; + } + } +} + +// Null in a page (such as a test harness) without the panel +const rmpCanvas = document.getElementById('rmpCanvas'); +if (rmpCanvas !== null) { + rmpCanvas.onmousedown = rmpMouseDown; + rmpCanvas.onmouseup = rmpMouseUp; + rmpCanvas.onmousemove = rmpMouseMove; + rmpCanvas.onmouseleave = rmpMouseLeave; + rmpCanvas.onmouseenter = rmpMouseEnter; + rmpCanvas.onwheel = rmpWheel; +} diff --git a/plugins/feature/map/mapaircraftstate.h b/plugins/feature/map/mapaircraftstate.h index 0462aba80..56601b738 100644 --- a/plugins/feature/map/mapaircraftstate.h +++ b/plugins/feature/map/mapaircraftstate.h @@ -18,7 +18,38 @@ #ifndef INCLUDE_FEATURE_MAPAIRCRAFTSTATE_H_ #define INCLUDE_FEATURE_MAPAIRCRAFTSTATE_H_ +#include <QDateTime> + +struct MapRouteWaypoint { + QString m_name; + float m_latitude; // NaN if the waypoint could not be placed + float m_longitude; + float m_altitudeFt; // NaN for unknown + QString m_eta; // Empty for unknown +}; + +struct MapFlightPlan { + bool m_valid = false; + QString m_departure; + QString m_arrival; + QString m_arrivalRunway; // E.g. 27R. Empty for unknown + QString m_approach; // As filed, e.g. ILSY01R. Empty for unknown + int m_activeWaypoint = -1; + QList<MapRouteWaypoint> m_waypoints; +}; + +struct MapDatalinkMessage { + bool m_valid = false; + int m_id = 0; // Sequence number, so a new message can be told from a re-send + QString m_received; // ISO 8601 + bool m_uplink = false; + QString m_station; // Empty for unknown + QString m_text; +}; + struct MapAircraftState { + QDateTime m_dateTime; // Time this complete state applies; invalid for a live/coalesced update + QString m_icao; // Mode S address as lower-case hex, empty for unknown QString m_callsign; QString m_aircraftType; int m_onSurface; // -1 for unknown @@ -53,9 +84,17 @@ struct MapAircraftState { TA, TA_RA } m_tcasMode; + // Active TCAS resolution advisory bitfield. 0 none; bit 0 active, bit 1 corrective, + // bit 2 downward sense, bit 3 positive (vs vertical speed limit), bit 4 clear of + // conflict, bit 5 multiple threats + int m_tcasRA = 0; + QString m_tcasThreatIcao; // Threat's Mode S address as hex, empty if unknown + int m_squawk = -1; // Mode A code as decimal digits (e.g. 7000), -1 unknown float m_windSpeed; float m_windDirection; float m_staticAirTemperature; + MapFlightPlan m_flightPlan; + MapDatalinkMessage m_datalinkMessage; }; #endif // INCLUDE_FEATURE_MAPAIRCRAFTSTATE_H_ diff --git a/plugins/feature/map/mapaudio.qrc b/plugins/feature/map/mapaudio.qrc new file mode 100644 index 000000000..785893b6d --- /dev/null +++ b/plugins/feature/map/mapaudio.qrc @@ -0,0 +1,24 @@ +<RCC> + <qresource prefix="/map/"> + <file>audio/10.wav</file> + <file>audio/100.wav</file> + <file>audio/1000.wav</file> + <file>audio/2500.wav</file> + <file>audio/30.wav</file> + <file>audio/40.wav</file> + <file>audio/5.wav</file> + <file>audio/50.wav</file> + <file>audio/500.wav</file> + <file>audio/retard.wav</file> + <file>audio/v1.wav</file> + <file>audio/ATC.wav</file> + <file>audio/engine-prop.wav</file> + <file>audio/helicopter.wav</file> + <file>audio/A320_flaps.wav</file> + <file>audio/A320_gear.wav</file> + <file>audio/traffic.wav</file> + <file>audio/clear-of-conflict.wav</file> + <file>audio/climb.wav</file> + <file>audio/descend.wav</file> + </qresource> +</RCC> diff --git a/plugins/feature/map/mapgui.cpp b/plugins/feature/map/mapgui.cpp index 014b38adf..4428ebaff 100644 --- a/plugins/feature/map/mapgui.cpp +++ b/plugins/feature/map/mapgui.cpp @@ -17,6 +17,8 @@ /////////////////////////////////////////////////////////////////////////////////// #include <cmath> +#include <QJsonArray> +#include <QJsonObject> #include <QQmlContext> #include <QQmlProperty> #include <QGeoLocation> @@ -25,9 +27,15 @@ #include <QGeoServiceProvider> #include <QSettings> #include <QMenu> +#include <QActionGroup> +#include <QToolButton> +#include <QIcon> #include <QScreen> #include <QSvgWidget> #include <QTableWidgetItem> +#include <QDir> +#include <QFileInfo> +#include <QSet> #ifdef QT_WEBENGINE_FOUND #include <QtWebEngineWidgets/QWebEngineView> @@ -36,14 +44,19 @@ #endif #include "feature/featureuiset.h" +// For aircraftSelect(), which is how an aircraft link in a popup reaches the +// Aircraft feature - see linkClicked() +#include "feature/featurewebapiutils.h" #include "gui/basicfeaturesettingsdialog.h" #include "gui/dialogpositioner.h" #include "device/deviceset.h" #include "device/deviceapi.h" #include "channel/channelwebapiutils.h" +#include "maincore.h" #include "dsp/devicesamplesource.h" #include "device/deviceenumerator.h" #include "util/units.h" +#include "util/profiler.h" #include "util/maidenhead.h" #include "util/morse.h" #include "util/navtex.h" @@ -72,21 +85,84 @@ void MapGUI::destroy() void MapGUI::resetToDefaults() { + const QString oldMSFSNavigraphDir = m_settings.m_msfsNavigraphDir; m_settings.resetToDefaults(); + if (oldMSFSNavigraphDir != m_settings.m_msfsNavigraphDir) { + addWaypoints(); + } displaySettings(); applyAllSettings(); } QByteArray MapGUI::serialize() const { - return m_settings.serialize(); + // Save where the map is now, so it can be restored when next opened. + // We can't write to m_settings here, so serialize a copy - MapSettings can be + // copied safely, as it doesn't own the item settings it points at + MapSettings settings = m_settings; + QGeoCoordinate coords; + double zoom; + + if (currentMapPosition(coords, zoom)) + { + settings.m_mapCenterLatitude = coords.latitude(); + settings.m_mapCenterLongitude = coords.longitude(); + settings.m_mapZoomLevel = zoom; + } + settings.m_splitterState = ui->splitter->saveState(); + + return settings.serialize(); +} + +// Put the splitter back where it was. Kept rather than consumed: the 3D map and the +// NASA panel are added to the splitter later and on their own schedule, and a state +// saved with three widgets will not apply to a splitter that currently has one - so this +// is called again each time the composition changes, and the first call that matches +// wins. restoreState() reports whether it applied, so a state that never fits is simply +// never used rather than half applied. +void MapGUI::restoreSplitterState() +{ + if (m_splitterStateToRestore.isEmpty()) { + return; + } + if (ui->splitter->restoreState(m_splitterStateToRestore)) { + m_splitterStateToRestore.clear(); + } +} + +// Get the position and zoom level of the 2D map, if it has been created +bool MapGUI::currentMapPosition(QGeoCoordinate& coords, double& zoom) const +{ + QQuickItem *item = ui->map->rootObject(); + + if (!item) { + return false; + } + + QObject *object = item->findChild<QObject*>("map"); + + if (!object) { + return false; + } + + coords = object->property("center").value<QGeoCoordinate>(); + zoom = object->property("zoomLevel").value<double>(); + + return coords.isValid(); } bool MapGUI::deserialize(const QByteArray& data) { + const QString oldMSFSNavigraphDir = m_settings.m_msfsNavigraphDir; if (m_settings.deserialize(data)) { + if (oldMSFSNavigraphDir != m_settings.m_msfsNavigraphDir) { + addWaypoints(); + } m_feature->setWorkspaceIndex(m_settings.m_workspaceIndex); + m_restoreMapPosition = true; + m_splitterStateToRestore = m_settings.m_splitterState; + restoreSplitterState(); displaySettings(); applyAllSettings(); return true; @@ -104,6 +180,7 @@ bool MapGUI::handleMessage(const Message& message) { qDebug("MapGUI::handleMessage: Map::MsgConfigureMap"); const Map::MsgConfigureMap& cfg = (Map::MsgConfigureMap&) message; + const QString oldMSFSNavigraphDir = m_settings.m_msfsNavigraphDir; if (cfg.getForce()) { m_settings = cfg.getSettings(); @@ -111,6 +188,10 @@ bool MapGUI::handleMessage(const Message& message) m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings()); } + if (oldMSFSNavigraphDir != m_settings.m_msfsNavigraphDir) { + addWaypoints(); + } + blockApplySettings(true); displaySettings(); blockApplySettings(false); @@ -122,6 +203,16 @@ bool MapGUI::handleMessage(const Message& message) Map::MsgReportAvailableChannelOrFeatures& report = (Map::MsgReportAvailableChannelOrFeatures&) message; m_availableChannelOrFeatures = report.getItems(); + // Work out which group each source belongs to now, rather than for every map + // item it sends us + m_pipeGroups.clear(); + for (const auto& channelOrFeature : m_availableChannelOrFeatures) + { + if (MapSettings::m_pipeTypes.contains(channelOrFeature.m_type)) { + m_pipeGroups.insert(channelOrFeature.m_object, channelOrFeature.m_type); + } + } + return true; } else if (Map::MsgFind::match(message)) @@ -140,26 +231,17 @@ bool MapGUI::handleMessage(const Message& message) } else if (MainCore::MsgMapItem::match(message)) { + PROFILER_START() MainCore::MsgMapItem& msgMapItem = (MainCore::MsgMapItem&) message; SWGSDRangel::SWGMapItem *swgMapItem = msgMapItem.getSWGMapItem(); // TODO: Could have this in SWGMapItem so plugins can create additional groups - QString group; - - for (int i = 0; i < m_availableChannelOrFeatures.size(); i++) - { - if (m_availableChannelOrFeatures[i].m_object == msgMapItem.getPipeSource()) - { - for (int j = 0; j < MapSettings::m_pipeTypes.size(); j++) - { - if (m_availableChannelOrFeatures[i].m_type == MapSettings::m_pipeTypes[j]) { - group = m_availableChannelOrFeatures[i].m_type; - } - } - } - } + const QString group = m_pipeGroups.value(msgMapItem.getPipeSource()); update(msgMapItem.getPipeSource(), swgMapItem, group); + // The sender creates one of these per pipe and hands it over to us + delete swgMapItem; + PROFILER_STOP("Map message") return true; } @@ -206,7 +288,9 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur m_nasaWidget(nullptr), m_legendWidget(nullptr), m_overviewWidget(nullptr), - m_descriptionWidget(nullptr) + m_descriptionWidget(nullptr), + m_restoreMapPosition(false), + m_viewCoordinator(this) { m_feature = feature; setAttribute(Qt::WA_DeleteOnClose, true); @@ -270,6 +354,7 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur m_polygonMapFilter.setSourceModel(&m_polygonMapModel); m_polylineMapFilter.setSourceModel(&m_polylineMapModel); + ui->map->rootContext()->setContextProperty("viewCoordinator", &m_viewCoordinator); ui->map->rootContext()->setContextProperty("mapModelFiltered", &m_objectMapFilter); ui->map->rootContext()->setContextProperty("mapModel", &m_objectMapModel); ui->map->rootContext()->setContextProperty("imageModelFiltered", &m_imageMapFilter); @@ -298,16 +383,21 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur connect(&m_sdrangelServerList, &SDRangelServerList::dataUpdated, this, &MapGUI::sdrangelServerUpdated); #ifdef QT_WEBENGINE_FOUND + // Before settings() and the page() connections below, which would otherwise apply to + // the page this replaces + ui->web->setPage(new MapWebPage(acquireWebEngineProfile(), ui->web)); QWebEngineSettings *settings = ui->web->settings(); settings->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true); + // The DCDU's ring is played by the page without any user gesture, which Chromium's + // autoplay policy would otherwise block + settings->setAttribute(QWebEngineSettings::PlaybackRequiresUserGesture, false); connect(ui->web->page(), &QWebEnginePage::fullScreenRequested, this, &MapGUI::fullScreenRequested); #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) connect(ui->web->page(), &QWebEnginePage::loadingChanged, this, &MapGUI::loadingChanged); connect(ui->web, &QWebEngineView::renderProcessTerminated, this, &MapGUI::renderProcessTerminated); #endif - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - connect(profile, &QWebEngineProfile::downloadRequested, this, &MapGUI::downloadRequested); + connect(s_webEngineProfile, &QWebEngineProfile::downloadRequested, this, &MapGUI::downloadRequested); #endif // Get station position @@ -316,6 +406,12 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur float stationAltitude = MainCore::instance()->getSettings().getAltitude(); m_azEl.setLocation(stationLatitude, stationLongitude, stationAltitude); QGeoCoordinate stationPosition(stationLatitude, stationLongitude, stationAltitude); + // The models work out how far each item is from the station, so the filters don't + // have to do it for every item every time the map moves + m_objectMapModel.setStationPosition(stationPosition); + m_imageMapModel.setStationPosition(stationPosition); + m_polygonMapModel.setStationPosition(stationPosition); + m_polylineMapModel.setStationPosition(stationPosition); m_objectMapFilter.setPosition(stationPosition); m_imageMapFilter.setPosition(stationPosition); m_polygonMapFilter.setPosition(stationPosition); @@ -354,6 +450,7 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur connect(&MainCore::instance()->getSettings(), &MainSettings::preferenceChanged, this, &MapGUI::preferenceChanged); // Read beacons, if they exist + PROFILER_START() QList<Beacon *> *beacons = Beacon::readIARUCSV(MapGUI::getBeaconFilename()); if (beacons != nullptr) { setBeacons(beacons); @@ -375,6 +472,11 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur addKiwiSDR(); addSpyServer(); addSDRangelServer(); + PROFILER_STOP("Map DB load") + + // Before displaySettings(), which sets the menu actions' check states + createCockpitPanelsMenu(); + createCameraModeMenu(); displaySettings(); applyAllSettings(); @@ -382,6 +484,15 @@ MapGUI::MapGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur connect(&m_objectMapModel, &ObjectMapModel::linkClicked, this, &MapGUI::linkClicked); connect(&m_redrawMapTimer, &QTimer::timeout, this, &MapGUI::redrawMap); + + // Items arrive far faster than the map can usefully be redrawn, so changes are + // collected and handed over at this rate instead + connect(&m_flushTimer, &QTimer::timeout, this, &MapGUI::flushModels); + m_flushTimer.start(m_flushPeriodMS); + // The AM Demods behind the RMP's VHF channels can be retuned from their own GUI or by + // the ADS-B plugin, so the panel is kept in step by polling rather than notification + connect(&m_rmpPollTimer, &QTimer::timeout, this, [this]() { sendRMPState(false); }); + m_rmpPollTimer.start(1000); m_redrawMapTimer.setSingleShot(true); ui->map->installEventFilter(this); @@ -417,9 +528,56 @@ MapGUI::~MapGUI() delete m_giro; delete m_aurora; qDeleteAll(m_ionosondeStations); +#ifdef QT_WEBENGINE_FOUND + // The page is a child of the view, and the view a child of this widget - which + // QWidget's destructor deletes after this one, too late for the profile the page + // uses. So the view goes now, and the profile after it + delete ui->web; + ui->web = nullptr; +#endif delete ui; +#ifdef QT_WEBENGINE_FOUND + releaseWebEngineProfile(); +#endif } +#ifdef QT_WEBENGINE_FOUND + +QWebEngineProfile *MapGUI::s_webEngineProfile = nullptr; +int MapGUI::s_webEngineProfileUsers = 0; + +// Qt 6's default profile is off-the-record, so every run started with an empty cache +// and fetched all of Cesium's assets, imagery, terrain and Google's 3D tiles again. +// This one keeps them on disk, under the application's cache directory. It is shared +// by every map open at once - two profiles with the same storage name would fight over +// the directory - and has to outlive every page that uses it, so is counted rather +// than owned by one map or left to the application's shutdown, which tears down +// Qt WebEngine before it deletes the application's children. +QWebEngineProfile *MapGUI::acquireWebEngineProfile() +{ + if (!s_webEngineProfile) + { + s_webEngineProfile = new QWebEngineProfile("Map"); + s_webEngineProfile->setHttpCacheType(QWebEngineProfile::DiskHttpCache); + // Chromium's own limit is a few hundred MB, and a city of photorealistic tiles + // is that on its own + s_webEngineProfile->setHttpCacheMaximumSize(1024 * 1024 * 1024); + } + s_webEngineProfileUsers++; + return s_webEngineProfile; +} + +void MapGUI::releaseWebEngineProfile() +{ + if (--s_webEngineProfileUsers == 0) + { + delete s_webEngineProfile; + s_webEngineProfile = nullptr; + } +} + +#endif + void MapGUI::setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; @@ -427,17 +585,53 @@ void MapGUI::setWorkspaceIndex(int index) } // Update a map item -void MapGUI::update(const QObject *source, SWGSDRangel::SWGMapItem *swgMapItem, const QString &group) -{ - int type = swgMapItem->getType(); - if (type == 0) { - m_objectMapModel.update(source, swgMapItem, group); - } else if (type == 1) { - m_imageMapModel.update(source, swgMapItem, group); - } else if (type == 2) { - m_polygonMapModel.update(source, swgMapItem, group); - } else if (type == 3) { - m_polylineMapModel.update(source, swgMapItem, group); +void MapGUI::update(const QObject *source, SWGSDRangel::SWGMapItem *swgMapItem, const QString &itemGroup) +{ + // The settings group is the sending plugin's, unless the item names one of its own - + // one plugin can want different settings for different things it draws. An unknown + // name falls back rather than failing: getItemSettings() returns nullptr for a group + // that does not exist, and every item holds that pointer for its lifetime. + QString group = itemGroup; + const QString *named = swgMapItem->getGroup(); + if (named && !named->isEmpty() && m_settings.m_itemSettings.contains(*named)) { + group = *named; + } + + MapModel *models[] = { + &m_objectMapModel, // 0 - Object + &m_imageMapModel, // 1 - Image + &m_polygonMapModel, // 2 - Polygon + &m_polylineMapModel, // 3 - Polyline + &m_polylineMapModel // 4 - Track: a polyline coloured by the altitude of its points + }; + const int count = (int) (sizeof(models) / sizeof(models[0])); + + // An empty image means take the item off the map, and a sender removing something by + // name does not have to say what kind of item it was - an SWGMapItem built for the + // purpose carries type 0 whatever was drawn. Looked up under type, a line or a polygon + // would then be searched for among the objects, never found, and left on the map beside + // whatever replaced it. Removals are rare, so one can afford to be looked for in every + // model rather than only in the one the type names. + const QString *image = swgMapItem->getImage(); + if (!image || !swgMapItem->getName()) { + return; // Neither drawable nor removable + } + if (image->isEmpty()) + { + const QString& name = *swgMapItem->getName(); + for (int i = 0; i < count; i++) + { + // The same model appears twice, so only the first of them finds the item + if (models[i]->findMapItem(source, name)) { + models[i]->update(source, swgMapItem, group); + } + } + return; + } + + const int type = swgMapItem->getType(); + if ((type >= 0) && (type < count)) { + models[type]->update(source, swgMapItem, group); } } @@ -1302,6 +1496,32 @@ void MapGUI::addNavAids() navAidMapItem.setAltitudeReference(1); update(m_map, &navAidMapItem, "NavAid"); } + + sendNavAidsToND(); +} + +// The VOR-family navaids for the ND's overlay, the same arrangement as the airports +// in sendAirportsToND() below +void MapGUI::sendNavAidsToND() +{ + if (!m_cesium || !m_navAids) { + return; + } + + QJsonArray navAids; + for (const auto navAid : *m_navAids) + { + // VOR, VOR-DME and VORTAC; NDBs and bare DMEs would clutter more than help + if (!navAid->m_type.startsWith("VOR")) { + continue; + } + navAids.append(QJsonObject { + {"n", navAid->m_ident}, + {"lat", navAid->m_latitude}, + {"lon", navAid->m_longitude} + }); + } + m_cesium->setNDNavAids(navAids); } void MapGUI::addAirspace(const Airspace *airspace, const QString& group, int cnt) @@ -1400,19 +1620,32 @@ void MapGUI::addAirports() m_airportInfo = OurAirportsDB::getAirportsById(); if (m_airportInfo) { + // One item, reused for every airport - see addWaypoints() for why. The strings + // have to be allocated before they can be assigned in place, as the default + // SWGMapItem constructor leaves every pointer null + SWGSDRangel::SWGMapItem airportMapItem; + airportMapItem.setName(new QString()); + airportMapItem.setImage(new QString()); + airportMapItem.setText(new QString()); + airportMapItem.setLabel(new QString()); + airportMapItem.setModel(new QString("airport.glb")); // No such model currently, but we don't really want one + airportMapItem.setImageRotation(0); + airportMapItem.setFixedPosition(true); + airportMapItem.setOrientation(0); + airportMapItem.setLabelAltitudeOffset(4.5); + airportMapItem.setAltitudeReference(1); + QHashIterator<int, AirportInformation *> i(*m_airportInfo); while (i.hasNext()) { i.next(); AirportInformation *airport = i.value(); - SWGSDRangel::SWGMapItem airportMapItem; - airportMapItem.setName(new QString(airport->m_ident)); + *airportMapItem.getName() = airport->m_ident; airportMapItem.setLatitude(airport->m_latitude); airportMapItem.setLongitude(airport->m_longitude); airportMapItem.setAltitude(Units::feetToMetres(airport->m_elevation)); - airportMapItem.setImage(new QString(airport->getImageName())); - airportMapItem.setImageRotation(0); + *airportMapItem.getImage() = airport->getImageName(); QStringList list; list.append(QString("%1: %2").arg(airport->m_ident).arg(airport->m_name)); for (int i = 0; i < airport->m_frequencies.size(); i++) @@ -1420,13 +1653,8 @@ void MapGUI::addAirports() const AirportInformation::FrequencyInformation *frequencyInfo = airport->m_frequencies[i]; list.append(QString("%1: %2 MHz").arg(frequencyInfo->m_type).arg(frequencyInfo->m_frequency)); } - airportMapItem.setText(new QString(list.join("\n"))); - airportMapItem.setModel(new QString("airport.glb")); // No such model currently, but we don't really want one - airportMapItem.setFixedPosition(true); - airportMapItem.setOrientation(0); - airportMapItem.setLabel(new QString(airport->m_ident)); - airportMapItem.setLabelAltitudeOffset(4.5); - airportMapItem.setAltitudeReference(1); + *airportMapItem.getText() = list.join("\n"); + *airportMapItem.getLabel() = airport->m_ident; QString group; if (airport->m_type == AirportInformation::Small) { group = "Airport (Small)"; @@ -1439,38 +1667,140 @@ void MapGUI::addAirports() } update(m_map, &airportMapItem, group); } + + sendAirportsToND(); } } +// The ND draws its own airport overlay - stars with idents - from a copy of the +// airport database sent to the page once, rather than scraping map entities, which +// come and go with the group settings. Re-sent when the database updates and when +// the 3D map (re)connects +void MapGUI::sendAirportsToND() +{ + if (!m_cesium || !m_airportInfo) { + return; + } + + QJsonArray airports; + QHashIterator<int, AirportInformation *> i(*m_airportInfo); + while (i.hasNext()) + { + i.next(); + const AirportInformation *airport = i.value(); + // Large airports only - the same classification the Map's groups use. The + // medium and small fields swamped the display; the type field is kept so the + // page's declutter logic still works if this is ever widened again + if (airport->m_type != AirportInformation::Large) { + continue; + } + airports.append(QJsonObject { + {"n", airport->m_ident}, + {"lat", airport->m_latitude}, + {"lon", airport->m_longitude}, + {"t", 2} + }); + } + m_cesium->setNDAirports(airports); +} + void MapGUI::addWaypoints() { - m_waypoints = Waypoints::getWaypoints(); if (m_waypoints) { - QHashIterator<QString, Waypoint *> i(*m_waypoints); - while (i.hasNext()) + QSet<QString> oldWaypointNames; + for (auto i = m_waypoints->constBegin(); i != m_waypoints->constEnd(); ++i) { + oldWaypointNames.insert(i.key()); + } + + SWGSDRangel::SWGMapItem removeWaypoint; + removeWaypoint.setName(new QString()); + removeWaypoint.setImage(new QString()); + for (const QString& name : oldWaypointNames) + { + *removeWaypoint.getName() = name; + update(m_map, &removeWaypoint, "Waypoints"); + } + } + + m_waypoints.reset(); + const QString bglDirectory = m_settings.m_msfsNavigraphDir.trimmed(); + if (!bglDirectory.isEmpty()) + { + QStringList errors; + QString bglSourceDirectory = QDir::fromNativeSeparators(bglDirectory); + + // Navigraph's standard nav-base package is a maintenance/exclusion + // layer. The actual navigation records are installed in its sibling + // nav-jepp package, so make the requested default package path useful + // without asking the user to know Navigraph's internal split. + if (QFileInfo(QDir::cleanPath(bglSourceDirectory)).fileName().compare( + QStringLiteral("navigraph-nav-base"), Qt::CaseInsensitive) == 0) + { + const QString navJeppDirectory = QFileInfo(QDir::cleanPath(bglSourceDirectory)) + .dir().filePath(QStringLiteral("navigraph-nav-jepp")); + if (QFileInfo(navJeppDirectory).isDir()) { + bglSourceDirectory = navJeppDirectory; + } + } + + QMultiHash<QString, Waypoint *> *waypoints = Waypoint::readBGL(bglSourceDirectory, &errors); + if (!waypoints->isEmpty()) + { + m_waypoints = QSharedPointer<const QMultiHash<QString, Waypoint *>>( + waypoints, + [](const QMultiHash<QString, Waypoint *> *values) { + qDeleteAll(*values); + delete values; + }); + qDebug() << "MapGUI::addWaypoints: Read" << waypoints->size() + << "waypoints from Navigraph BGL directory" << bglSourceDirectory; + } + else + { + delete waypoints; + qWarning() << "MapGUI::addWaypoints: No waypoints read from Navigraph BGL directory" + << bglDirectory << "- falling back to waypoints.csv"; + } + if (!errors.isEmpty()) { + qWarning() << "MapGUI::addWaypoints:" << errors.size() + << "Navigraph BGL read errors; first error:" << errors.first(); + } + } + if (!m_waypoints) { + m_waypoints = Waypoints::getWaypoints(); + } + if (m_waypoints) + { + // One item, reused for every waypoint. Building a fresh one per waypoint means a + // new QString for each field and a delete for each of them again straight after, + // so the strings are allocated once here and assigned in place below. Note the + // default SWGMapItem constructor leaves every pointer null - only the one that + // takes JSON allocates - so they have to be given something to point at first + SWGSDRangel::SWGMapItem waypointMapItem; + waypointMapItem.setName(new QString()); + waypointMapItem.setImage(new QString("waypoint.png")); + waypointMapItem.setText(new QString()); + waypointMapItem.setLabel(new QString()); + waypointMapItem.setImageRotation(0); + waypointMapItem.setFixedPosition(true); + waypointMapItem.setOrientation(0); + waypointMapItem.setLabelAltitudeOffset(4.5); + waypointMapItem.setAltitude(Units::feetToMetres(25000)); + waypointMapItem.setAltitudeReference(1); + + QMultiHash<QString, Waypoint *>::const_iterator i = m_waypoints->constBegin(); + while (i != m_waypoints->constEnd()) { - i.next(); const Waypoint *waypoint = i.value(); - SWGSDRangel::SWGMapItem waypointMapItem; - waypointMapItem.setName(new QString(waypoint->m_name)); + *waypointMapItem.getName() = waypoint->m_name; waypointMapItem.setLatitude(waypoint->m_latitude); waypointMapItem.setLongitude(waypoint->m_longitude); - waypointMapItem.setAltitude(0); - waypointMapItem.setImage(new QString("waypoint.png")); - waypointMapItem.setImageRotation(0); - QStringList list; - list.append(QString("Waypoint: %1").arg(waypoint->m_name)); - waypointMapItem.setText(new QString(list.join("\n"))); - //waypointMapItem.setModel(new QString("waypoint.glb")); // No such model currently - waypointMapItem.setFixedPosition(true); - waypointMapItem.setOrientation(0); - waypointMapItem.setLabel(new QString(waypoint->m_name)); - waypointMapItem.setLabelAltitudeOffset(4.5); - waypointMapItem.setAltitude(Units::feetToMetres(25000)); - waypointMapItem.setAltitudeReference(1); + *waypointMapItem.getText() = QString("Waypoint: %1").arg(waypoint->m_name); + *waypointMapItem.getLabel() = waypoint->m_name; update(m_map, &waypointMapItem, "Waypoints"); + ++i; } } } @@ -1605,6 +1935,7 @@ void MapGUI::createNASAGlobalImageryView() m_nasaWidget->setLayout(hbox); ui->splitter->addWidget(m_nasaWidget); + restoreSplitterState(); // Limit size of widget, otherwise the splitter makes it bigger than the maps for some unknown reason m_nasaWidget->setMaximumHeight(m_overviewWidget->sizeHint().height()); @@ -1652,13 +1983,71 @@ void MapGUI::nasaGlobalImageryMetaDataUpdated(const NASAGlobalImagery::MetaData& displayNASAMetaData(); } -void MapGUI::nasaGlobalImageryLegendAvailable(const QString& url, const QByteArray& data) +// NASA's colormap legends are drawn by matplotlib, which writes every character of +// every label as a <use> of a glyph defined in the file - including the spaces. A space +// has no outline, so no path is ever defined for one, and Qt's SVG renderer warns about +// the dangling reference every single time it meets it: 404 lines of log from two +// legends, all of them about a glyph that would draw nothing. +// +// Defining the missing ids as empty paths satisfies the references and changes nothing +// that is drawn. Done by finding what is referenced and not defined, rather than by +// naming the space glyph, so any other character the generator leaves out is covered too. +static QByteArray defineMissingGlyphs(const QByteArray& svg) { - (void) url; + const QString text = QString::fromUtf8(svg); + + // Custom delimiter: the pattern ends in )" , which would close a plain R"( ... )" + static const QRegularExpression idRe(R"RX(\bid\s*=\s*"([^"]+)")RX"); + QSet<QString> defined; + QRegularExpressionMatchIterator ids = idRe.globalMatch(text); + while (ids.hasNext()) { + defined.insert(ids.next().captured(1)); + } + + // Both spellings: SVG 1.1 writes xlink:href, SVG 2 writes href + static const QRegularExpression refRe(R"RX((?:xlink:)?href\s*=\s*"#([^"]+)")RX"); + QStringList missing; + QRegularExpressionMatchIterator refs = refRe.globalMatch(text); + while (refs.hasNext()) + { + const QString id = refs.next().captured(1); + if (!defined.contains(id) && !missing.contains(id)) { + missing.append(id); + } + } + if (missing.isEmpty()) { + return svg; + } + // After the opening <svg ...> tag, so the definitions precede every use of them + static const QRegularExpression svgTagRe(R"(<svg\b[^>]*>)"); + const QRegularExpressionMatch svgTag = svgTagRe.match(text); + if (!svgTag.hasMatch()) { + return svg; + } + + // With a "d", degenerate though it is. An empty <path id=...> registers nothing: + // Qt's SVG parser wants the d attribute and discards the element without one, so the + // id never enters its resolve map and every <use> of it still dangles - which is why + // the first attempt at this changed the warning count not at all. "M0,0" is a moveto + // and nothing else, so it draws exactly what a space should. + QString defs = "<defs>"; + for (const QString& id : missing) { + defs += QString("<path id=\"%1\" d=\"M0,0\"/>").arg(id); + } + defs += "</defs>"; + + QString repaired = text; + repaired.insert(svgTag.capturedEnd(), defs); + return repaired.toUtf8(); +} + +void MapGUI::nasaGlobalImageryLegendAvailable(const QString& url, const QByteArray& data) +{ if (m_legendWidget) { - m_legendWidget->load(data); + m_legendWidget->load(defineMissingGlyphs(data)); + m_loadedLegendUrl = url; if (m_legend && (m_legend->m_height > 0)) { m_legendWidget->setFixedSize(m_legend->m_width, m_legend->m_height); @@ -1738,14 +2127,20 @@ void MapGUI::applyMap2DSettings(bool reloadMap) QQuickItem *item = ui->map->rootObject(); - QObject *object = item->findChild<QObject*>("map"); QGeoCoordinate coords; double zoom; - if (object != nullptr) + if (m_restoreMapPosition && (m_settings.m_mapZoomLevel >= 0.0f)) + { + // Restore the position the map was left in when it was last saved + m_restoreMapPosition = false; + coords.setLatitude(m_settings.m_mapCenterLatitude); + coords.setLongitude(m_settings.m_mapCenterLongitude); + zoom = m_settings.m_mapZoomLevel; + } + else if (currentMapPosition(coords, zoom)) { - // Save existing position of map - coords = object->property("center").value<QGeoCoordinate>(); - zoom = object->property("zoomLevel").value<double>(); + // Keep the map where it is, as it's only being recreated + m_restoreMapPosition = false; } else { @@ -1849,6 +2244,33 @@ void MapGUI::applyMap2DSettings(bool reloadMap) } } +// The filters get a rectangle bigger than the screen, so that small pans don't need them +// re-run, while the tracks are split against what is actually visible +void MapGUI::applyMapView(const QGeoRectangle& filterRect, const QGeoRectangle& visibleRect, double zoomLevel) +{ + const double topLeftLongitude = filterRect.topLeft().longitude(); + const double topLeftLatitude = filterRect.topLeft().latitude(); + const double bottomRightLongitude = filterRect.bottomRight().longitude(); + const double bottomRightLatitude = filterRect.bottomRight().latitude(); + + m_objectMapFilter.viewChanged(topLeftLongitude, topLeftLatitude, bottomRightLongitude, bottomRightLatitude, zoomLevel); + m_imageMapFilter.viewChanged(topLeftLongitude, topLeftLatitude, bottomRightLongitude, bottomRightLatitude, zoomLevel); + m_polygonMapFilter.viewChanged(topLeftLongitude, topLeftLatitude, bottomRightLongitude, bottomRightLatitude, zoomLevel); + m_polylineMapFilter.viewChanged(topLeftLongitude, topLeftLatitude, bottomRightLongitude, bottomRightLatitude, zoomLevel); + + m_objectMapModel.viewChanged(visibleRect.bottomLeft().longitude(), visibleRect.bottomRight().longitude()); +} + +void MapGUI::flushModels() +{ + PROFILER_START() + m_objectMapModel.flush(); + m_imageMapModel.flush(); + m_polygonMapModel.flush(); + m_polylineMapModel.flush(); + PROFILER_STOP("Map flush") +} + void MapGUI::redrawMap() { // An awful workaround for https://bugreports.qt.io/browse/QTBUG-100333 @@ -1930,7 +2352,8 @@ void MapGUI::displayToolbar() ui->displayMagDec->setVisible(!narrow && m_settings.m_map3DEnabled); ui->displayMaidenheadGrid->setVisible(!narrow && m_settings.m_map3DEnabled); ui->displayPFD->setVisible(!narrow && m_settings.m_map3DEnabled); - ui->viewFirstPerson->setVisible(!narrow && m_settings.m_map3DEnabled); + ui->muteAudio->setVisible(!narrow && m_settings.m_map3DEnabled); + ui->cameraMode->setVisible(!narrow && m_settings.m_map3DEnabled); ui->save->setVisible(m_settings.m_map3DEnabled); } @@ -2016,6 +2439,9 @@ void MapGUI::applyMap3DSettings(bool reloadMap) m_webServer->addSubstitution("/map/map/map3d.html", "$WS_PORT$", QString::number(m_cesium->serverPort())); m_webServer->addSubstitution("/map/map/map3d.html", "$CESIUM_ION_API_KEY$", cesiumIonAPIKey()); m_webServer->addSubstitution("/map/map/map3d.html", "$ARCGIS_API_KEY$", m_settings.m_arcGISAPIKey); + // So the base layer picker doesn't offer imagery that would use our Cesium Ion quota + m_webServer->addSubstitution("/map/map/map3d.html", "$HAS_CESIUM_ION_USER_KEY$", m_settings.hasCesiumIonUserKey() ? "true" : ""); + m_webServer->addSubstitution("/map/map/map3d.html", "$DEFAULT_IMAGERY$", effectiveImagery()); //ui->web->page()->profile()->clearHttpCache(); ui->web->load(QUrl(QString("http://127.0.0.1:%1/map/map/map3d.html").arg(m_webPort))); //ui->web->load(QUrl(QString("http://webglreport.com/"))); @@ -2031,18 +2457,20 @@ void MapGUI::applyMap3DSettings(bool reloadMap) ui->web->setVisible(m_settings.m_map3DEnabled); if (m_cesium && m_cesium->isConnected()) { - m_cesium->setDefaultImagery(m_settings.m_defaultImagery); - m_cesium->setTerrain(m_settings.m_terrain, maptilerAPIKey(), m_settings.m_terrainLighting, m_settings.m_water); - m_cesium->setBuildings(m_settings.m_buildings); + m_cesium->setDefaultImagery(effectiveImagery()); + m_cesium->setTerrain(effectiveTerrain(), maptilerAPIKey(), m_settings.m_terrainLighting, m_settings.m_water); + m_cesium->setBuildings(effectiveBuildings()); + m_cesium->setGooglePhotorealistic3DTiles(effectiveGoogleTiles()); m_cesium->setLighting(m_settings.m_sunLightEnabled, m_settings.m_lightIntensity); m_cesium->setCameraReferenceFrame(m_settings.m_eciCamera); m_cesium->setAntiAliasing(m_settings.m_fxaa, m_settings.m_msaa); m_cesium->getDateTime(); - m_cesium->setViewFirstPerson(m_settings.m_viewFirstPerson); + m_cesium->setCameraMode(m_settings.m_cameraMode); m_cesium->setHDR(m_settings.m_hdr); m_cesium->setFog(m_settings.m_fog); m_cesium->showFPS(m_settings.m_fps); - m_cesium->showPFD(m_settings.m_displayPFD); + applyCockpitPanels(); + applyAudioVolume(); m_cesium->showMUF(m_settings.m_displayMUF); m_cesium->showfoF2(m_settings.m_displayfoF2); m_cesium->showMagDec(m_settings.m_displayMagDec); @@ -2096,6 +2524,28 @@ void MapGUI::statusChanged(QQuickWidget::Status status) #ifdef QT_WEBENGINE_FOUND +// The page's console. Its "perf" line, every five seconds, is where the 3D map's frame and +// message costs are reported - see the 3D map performance section of the plugin readme +void MapWebPage::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, + int lineNumber, const QString &sourceID) +{ + // sourceID is a URL, and only the file in it is worth the width of the log line + const QString source = QUrl(sourceID).fileName(); + + switch (level) + { + case ErrorMessageLevel: + qWarning() << "Map 3D:" << message << "-" << source << "line" << lineNumber; + break; + case WarningMessageLevel: + qWarning() << "Map 3D:" << message; + break; + default: + qInfo() << "Map 3D:" << message; + break; + } +} + void MapGUI::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus, int exitCode) { qDebug() << "MapGUI::renderProcessTerminated: " << terminationStatus << "exitCode" << exitCode; @@ -2129,9 +2579,10 @@ void MapGUI::init3DMap() float stationAltitude = MainCore::instance()->getSettings().getLongitude(); m_cesium->setPosition(QGeoCoordinate(stationLatitude, stationLongitude, stationAltitude)); - m_cesium->setDefaultImagery(m_settings.m_defaultImagery); - m_cesium->setTerrain(m_settings.m_terrain, maptilerAPIKey(), m_settings.m_terrainLighting, m_settings.m_water); - m_cesium->setBuildings(m_settings.m_buildings); + m_cesium->setDefaultImagery(effectiveImagery()); + m_cesium->setTerrain(effectiveTerrain(), maptilerAPIKey(), m_settings.m_terrainLighting, m_settings.m_water); + m_cesium->setBuildings(effectiveBuildings()); + m_cesium->setGooglePhotorealistic3DTiles(effectiveGoogleTiles()); m_cesium->setLighting(m_settings.m_sunLightEnabled, m_settings.m_lightIntensity); m_cesium->setCameraReferenceFrame(m_settings.m_eciCamera); m_cesium->setAntiAliasing(m_settings.m_fxaa, m_settings.m_msaa); @@ -2153,8 +2604,14 @@ void MapGUI::init3DMap() m_cesium->showMagDec(m_settings.m_displayMagDec); m_cesium->showMaidenheadGrid(m_settings.m_displayMaidenheadGrid); - m_cesium->setViewFirstPerson(m_settings.m_viewFirstPerson); - m_cesium->showPFD(m_settings.m_displayPFD); + m_cesium->setCameraMode(m_settings.m_cameraMode); + applyCockpitPanels(); + sendPanelGeometry(); + sendEFISState(); + sendAirportsToND(); + sendRMPState(true); + sendNavAidsToND(); + applyAudioVolume(); m_cesium->showLayer("rain", m_settings.m_displayRain); m_cesium->showLayer("clouds", m_settings.m_displayClouds); @@ -2179,8 +2636,14 @@ void MapGUI::displaySettings() setTitle(m_settings.m_title); blockApplySettings(true); ui->displayNames->setChecked(m_settings.m_displayNames); - ui->viewFirstPerson->setChecked(m_settings.m_viewFirstPerson); - ui->displayPFD->setChecked(m_settings.m_displayPFD); + displayCameraMode(); + ui->displayPFD->setChecked(m_settings.m_displayCockpitPanels); + m_displayPFDAction->setChecked(m_settings.m_displayPFD); + m_displayNDAction->setChecked(m_settings.m_displayND); + m_displayEFISAction->setChecked(m_settings.m_displayEFIS); + m_displayRMPAction->setChecked(m_settings.m_displayRMP); + m_displayDCDUAction->setChecked(m_settings.m_displayDCDU); + ui->muteAudio->setChecked(m_settings.m_audioMuted); ui->displaySelectedGroundTracks->setChecked(m_settings.m_displaySelectedGroundTracks); ui->displayAllGroundTracks->setChecked(m_settings.m_displayAllGroundTracks); ui->displayRain->setChecked(m_settings.m_displayRain); @@ -2299,22 +2762,126 @@ void MapGUI::on_maidenhead_clicked() dialog.exec(); } -void MapGUI::on_viewFirstPerson_clicked(bool checked) +// The camera mode button is a menu of the three mutually exclusive ways the camera can +// follow the tracked object; the button's icon shows which one is in use +void MapGUI::createCameraModeMenu() { - m_settings.m_viewFirstPerson = checked; - if (m_cesium) { - m_cesium->setViewFirstPerson(checked); + QMenu *menu = new QMenu(ui->cameraMode); + QActionGroup *group = new QActionGroup(menu); + + auto addMode = [this, menu, group](const QString& text, int mode) { + QAction *action = menu->addAction(text); + action->setCheckable(true); + action->setData(mode); + group->addAction(action); + connect(action, &QAction::triggered, this, [this, mode]() { + m_settings.m_cameraMode = mode; + displayCameraMode(); + if (m_cesium) { + m_cesium->setCameraMode(mode); + } + applySetting("cameraMode"); + }); + return action; + }; + + addMode("Third person", MapSettings::ThirdPerson); + addMode("First person", MapSettings::FirstPerson); + addMode("Fly-by", MapSettings::FlyBy); + + ui->cameraMode->setMenu(menu); + ui->cameraMode->setPopupMode(QToolButton::InstantPopup); +} + +void MapGUI::displayCameraMode() +{ + QMenu *menu = ui->cameraMode->menu(); + if (!menu) { + return; + } + for (QAction *action : menu->actions()) + { + if (action->data().toInt() == m_settings.m_cameraMode) { + action->setChecked(true); + } + } + QString icon; + if (m_settings.m_cameraMode == MapSettings::FirstPerson) { + icon = ":/map/icons/firstperson.png"; + } else if (m_settings.m_cameraMode == MapSettings::FlyBy) { + icon = ":/map/icons/flyby.png"; + } else { + icon = ":/map/icons/thirdperson.png"; } - applySetting("viewFirstPerson"); + ui->cameraMode->setIcon(QIcon(icon)); } -void MapGUI::on_displayPFD_clicked(bool checked) +// Show the cockpit panels selected in the toolbar button's menu, or hide them all +// when the button itself is off - it is the master switch for the selection +void MapGUI::applyCockpitPanels() { - m_settings.m_displayPFD = checked; - if (m_cesium) { - m_cesium->showPFD(checked); + if (!m_cesium) { + return; } - applySetting("viewFirstPerson"); + const bool on = m_settings.m_displayCockpitPanels; + m_cesium->showPFD(on && m_settings.m_displayPFD); + m_cesium->showND(on && m_settings.m_displayND); + m_cesium->showEFIS(on && m_settings.m_displayEFIS); + m_cesium->showRMP(on && m_settings.m_displayRMP); + m_cesium->showDCDU(on && m_settings.m_displayDCDU); +} + +// The PFD toolbar button is a switch with a menu: the menu's checkboxes choose which +// cockpit panels are wanted, and the button turns that whole selection on or off +void MapGUI::createCockpitPanelsMenu() +{ + QMenu *menu = new QMenu(ui->displayPFD); + + auto addPanel = [this, menu](const QString& text, bool MapSettings::*flag, const char *key) { + QAction *action = menu->addAction(text); + action->setCheckable(true); + connect(action, &QAction::triggered, this, [this, flag, key](bool checked) { + m_settings.*flag = checked; + applyCockpitPanels(); + applySetting(key); + }); + return action; + }; + + m_displayPFDAction = addPanel("PFD", &MapSettings::m_displayPFD, "displayPFD"); + m_displayNDAction = addPanel("ND", &MapSettings::m_displayND, "displayND"); + m_displayEFISAction = addPanel("EFIS", &MapSettings::m_displayEFIS, "displayEFIS"); + m_displayRMPAction = addPanel("RMP", &MapSettings::m_displayRMP, "displayRMP"); + m_displayDCDUAction = addPanel("DCDU", &MapSettings::m_displayDCDU, "displayDCDU"); + + ui->displayPFD->setMenu(menu); + // Clicking the button toggles; the arrow section opens the menu + ui->displayPFD->setPopupMode(QToolButton::MenuButtonPopup); + connect(ui->displayPFD, &ButtonSwitch::toggled, this, [this](bool checked) { + m_settings.m_displayCockpitPanels = checked; + applyCockpitPanels(); + applySetting("displayCockpitPanels"); + }); +} + +// The configured volumes with the toolbar mute applied on top - muting sends zero +// volumes to the page rather than changing the stored settings, so unmuting restores +// exactly what the sliders say +void MapGUI::applyAudioVolume() +{ + if (m_cesium) + { + m_cesium->setAudioVolume( + m_settings.m_audioMuted ? 0 : m_settings.m_mapItemSoundVolume, + m_settings.m_audioMuted ? 0 : m_settings.m_cockpitSoundVolume); + } +} + +void MapGUI::on_muteAudio_clicked(bool checked) +{ + m_settings.m_audioMuted = checked; + applyAudioVolume(); + applySetting("audioMuted"); } void MapGUI::on_displayNames_clicked(bool checked) @@ -2488,7 +3055,13 @@ void MapGUI::applyNASAGlobalImagerySettings() if ((index >= 0) && (m_nasaDataSets[index].m_legends.size() > 0)) { m_legend = &m_nasaDataSets[index].m_legends[0]; - m_nasaGlobalImagery.downloadLegend(*m_legend); + // Only when it is not the one already shown. This runs on every 3D settings + // apply as well as on a change of dataset, and re-fetching an unchanged legend + // costs a request to NASA and a re-parse to arrive at the same picture - which + // is why the warnings above arrived in twos. + if (m_legend->m_url != m_loadedLegendUrl) { + m_nasaGlobalImagery.downloadLegend(*m_legend); + } m_descriptionWidget->setHtml(""); if (m_nasaMetaData.m_layers.contains(m_settings.m_nasaGlobalImageryIdentifier)) { @@ -2746,6 +3319,46 @@ QString MapGUI::cesiumIonAPIKey() const : m_settings.m_cesiumIonAPIKey; } +// The effective* methods coerce settings that would consume Cesium Ion quota to +// free alternatives when the user hasn't entered their own Cesium Ion API key. +// The settings themselves are left untouched, so a preference saved in a preset +// comes back as soon as a key is entered. + +QString MapGUI::effectiveImagery() const +{ + if (!m_settings.hasCesiumIonUserKey() && MapSettings::m_cesiumIonImagery.contains(m_settings.m_defaultImagery)) { + return "ArcGIS world imagery"; + } + return m_settings.m_defaultImagery; +} + +QString MapGUI::effectiveTerrain() const +{ + if (effectiveGoogleTiles()) { // Google 3D tiles include terrain + return "Ellipsoid"; + } + if (!m_settings.hasCesiumIonUserKey() && MapSettings::m_cesiumIonTerrain.contains(m_settings.m_terrain)) { + return "Ellipsoid"; + } + return m_settings.m_terrain; +} + +QString MapGUI::effectiveBuildings() const +{ + if (effectiveGoogleTiles()) { // Google 3D tiles include buildings + return "None"; + } + if (!m_settings.hasCesiumIonUserKey() && MapSettings::m_cesiumIonBuildings.contains(m_settings.m_buildings)) { + return "None"; + } + return m_settings.m_buildings; +} + +bool MapGUI::effectiveGoogleTiles() const +{ + return m_settings.m_googlePhotorealistic3DTiles && m_settings.hasCesiumIonUserKey(); +} + void MapGUI::find(const QString& target) { if (!target.isEmpty()) @@ -2873,6 +3486,7 @@ void MapGUI::on_displaySettings_clicked() connect(&dialog, &MapSettingsDialog::navAidsUpdated, this, &MapGUI::navAidsUpdated); connect(&dialog, &MapSettingsDialog::airspacesUpdated, this, &MapGUI::airspacesUpdated); connect(&dialog, &MapSettingsDialog::airportsUpdated, this, &MapGUI::airportsUpdated); + connect(&dialog, &MapSettingsDialog::waypointsUpdated, this, &MapGUI::waypointsUpdated); new DialogPositioner(&dialog, true); if (dialog.exec() == QDialog::Accepted) { @@ -2882,7 +3496,11 @@ void MapGUI::on_displaySettings_clicked() displayToolbar(); applyMap2DSettings(dialog.m_map2DSettingsChanged); applyMap3DSettings(dialog.m_map3DSettingsChanged); + sendRMPState(true); // The VHF channel assignments may have changed applySettings(dialog.m_settingsKeysChanged); + if (dialog.m_settingsKeysChanged.contains("msfsNavigraphDir")) { + addWaypoints(); + } m_objectMapModel.allUpdated(); m_imageMapModel.allUpdated(); m_polygonMapModel.allUpdated(); @@ -2965,6 +3583,85 @@ void MapGUI::receivedCesiumEvent(const QJsonObject &obj) QString url = obj.value("url").toString(); linkClicked(url); } + else if (event == "rmpTune") + { + // The RMP made a standby frequency active: retune the linked AM Demod + const int vhf = obj.value("vhf").toInt(); + const qint64 hz = (qint64) obj.value("frequency").toDouble(); + const QString& channelId = (vhf == 2) ? m_settings.m_vhf2Channel : m_settings.m_vhf1Channel; + if (!rmpTune(channelId, hz)) { + qDebug() << "MapGUI::receivedCesiumEvent - Failed to tune" << channelId << "to" << hz; + } + sendRMPState(true); + } + else if (event == "panelClosed") + { + // A cockpit panel's close button: remember it as closed, and untick it in + // the toolbar's panel menu + const QString panel = obj.value("panel").toString(); + bool MapSettings::*flag = nullptr; + QAction *action = nullptr; + QString key; + if (panel == "pfd") { + flag = &MapSettings::m_displayPFD; action = m_displayPFDAction; key = "displayPFD"; + } else if (panel == "nd") { + flag = &MapSettings::m_displayND; action = m_displayNDAction; key = "displayND"; + } else if (panel == "efis") { + flag = &MapSettings::m_displayEFIS; action = m_displayEFISAction; key = "displayEFIS"; + } else if (panel == "rmp") { + flag = &MapSettings::m_displayRMP; action = m_displayRMPAction; key = "displayRMP"; + } else if (panel == "dcdu") { + flag = &MapSettings::m_displayDCDU; action = m_displayDCDUAction; key = "displayDCDU"; + } + if (flag) + { + m_settings.*flag = false; + if (action) { + action->setChecked(false); + } + // The page has hidden it already, but the show command also clears the + // page's own enable - without it a new datalink message reopens the DCDU + applyCockpitPanels(); + applySetting(key); + } + } + else if (event == "efisState") + { + // The EFIS knobs and pushbuttons were changed + QJsonObject state = obj; + state.remove("event"); + m_settings.m_efisState = QString::fromUtf8(QJsonDocument(state).toJson(QJsonDocument::Compact)); + applySetting("efisState"); + } + else if (event == "panelGeometry") + { + // A cockpit panel was dragged or resized: remember where it was left + const QString panel = obj.value("panel").toString(); + if (!panel.isEmpty()) + { + QJsonObject panels = QJsonDocument::fromJson(m_settings.m_cockpitPanelGeometry.toUtf8()).object(); + panels.insert(panel, QJsonObject { + {"l", obj.value("left").toInt()}, + {"t", obj.value("top").toInt()}, + {"w", obj.value("width").toInt()}, + {"h", obj.value("height").toInt()} + }); + m_settings.m_cockpitPanelGeometry = QString::fromUtf8(QJsonDocument(panels).toJson(QJsonDocument::Compact)); + applySetting("cockpitPanelGeometry"); + } + } + else if (event == "rmpStandby") + { + // Standby frequencies are kept here so they survive a restart + const int vhf = obj.value("vhf").toInt(); + const int hz = (int) obj.value("frequency").toDouble(); + if (vhf == 2) { + m_settings.m_vhf2Standby = hz; + } else { + m_settings.m_vhf1Standby = hz; + } + applySetting((vhf == 2) ? "vhf2Standby" : "vhf1Standby"); + } } else { @@ -2972,6 +3669,116 @@ void MapGUI::receivedCesiumEvent(const QJsonObject &obj) } } +// The absolute frequency an AM Demod is tuned to: the device centre plus the channel +// offset. False when the channel id no longer resolves (the channel was removed, or was +// never assigned) +bool MapGUI::rmpReadActive(const QString& channelId, qint64& hz) const +{ + unsigned int deviceSet, channelIndex; + if (channelId.isEmpty() || !MainCore::getDeviceAndChannelIndexFromId(channelId, deviceSet, channelIndex)) { + return false; + } + double centerFrequency; + int offset; + if (!ChannelWebAPIUtils::getCenterFrequency(deviceSet, centerFrequency) + || !ChannelWebAPIUtils::getFrequencyOffset(deviceSet, channelIndex, offset)) { + return false; + } + hz = (qint64) centerFrequency + offset; + return true; +} + +// Tune an AM Demod to an absolute frequency. As ADSBDemodGUI::setFrequency: the device is +// retuned when the target is outside the usable 75% of its passband, or when the channel +// would straddle DC, in which case the channel is parked just above DC. Unlike ADS-B the +// channel's own "frequency" setting is also patched, as the AM Demod GUI's dial shows +// that rather than the offset in its Airband and Medium Wave modes +bool MapGUI::rmpTune(const QString& channelId, qint64 hz) +{ + unsigned int deviceSet, channelIndex; + if (channelId.isEmpty() || !MainCore::getDeviceAndChannelIndexFromId(channelId, deviceSet, channelIndex)) { + return false; + } + + double rfBandwidth; + if (!ChannelWebAPIUtils::getChannelSetting(deviceSet, channelIndex, "rfBandwidth", rfBandwidth) || (rfBandwidth <= 0)) { + rfBandwidth = 20000.0; + } + const qint64 halfChannelBW = (qint64) (rfBandwidth / 2); + const qint64 dcOffset = halfChannelBW; + + double centerFrequency; + int sampleRate; + if (!ChannelWebAPIUtils::getCenterFrequency(deviceSet, centerFrequency) + || !ChannelWebAPIUtils::getDevSampleRate(deviceSet, sampleRate)) { + return false; + } + const qint64 usable = (qint64) (sampleRate * 0.75); // Keep clear of the guard bands + const qint64 centre = (qint64) centerFrequency; + const qint64 offset = hz - centre; + + if ( ((hz - halfChannelBW) < (centre - usable / 2)) + || ((hz + halfChannelBW) >= (centre + usable / 2)) + || (std::abs(offset) < halfChannelBW)) + { + ChannelWebAPIUtils::setCenterFrequency(deviceSet, (double) (hz - dcOffset)); + ChannelWebAPIUtils::setFrequencyOffset(deviceSet, channelIndex, (int) dcOffset); + } + else + { + ChannelWebAPIUtils::setFrequencyOffset(deviceSet, channelIndex, (int) offset); + } + ChannelWebAPIUtils::patchChannelSetting(deviceSet, channelIndex, "frequency", (double) hz); + return true; +} + +// Set the EFIS controls to what they were left on. Always sent, even when nothing has +// been saved: the page only starts reporting changes once it has been told +void MapGUI::sendEFISState() +{ + if (!m_cesium) { + return; + } + m_cesium->setEFISState(QJsonDocument::fromJson(m_settings.m_efisState.toUtf8()).object()); +} + +// Put the cockpit panels back where they were left when SDRangel last closed +void MapGUI::sendPanelGeometry() +{ + if (!m_cesium || m_settings.m_cockpitPanelGeometry.isEmpty()) { + return; + } + m_cesium->setPanelGeometry(QJsonDocument::fromJson(m_settings.m_cockpitPanelGeometry.toUtf8()).object()); +} + +// Tell the RMP panel what its two VHF channels are tuned to. With force false, only when +// something has changed since the last send - this is called from a 1 s poll +void MapGUI::sendRMPState(bool force) +{ + if (!m_cesium) { + return; + } + QJsonObject state; + const QString* channels[2] = { &m_settings.m_vhf1Channel, &m_settings.m_vhf2Channel }; + const int standbys[2] = { m_settings.m_vhf1Standby, m_settings.m_vhf2Standby }; + for (int i = 0; i < 2; i++) + { + qint64 active; + const bool available = rmpReadActive(*channels[i], active); + QJsonObject vhf { + {"available", available}, + {"standby", standbys[i]}, + {"active", available ? QJsonValue((double) active) : QJsonValue()} + }; + state.insert(QString("vhf%1").arg(i + 1), vhf); + } + if (force || (state != m_rmpState)) + { + m_rmpState = state; + m_cesium->setRMPState(state); + } +} + // Handle link clicked in 2D Map Text box or 3D map infobox. void MapGUI::linkClicked(const QString& url) { @@ -2995,6 +3802,30 @@ void MapGUI::linkClicked(const QString& url) QString sdrangelServerURL = url.mid(18); openSDRangelServer(sdrangelServerURL, false); } + else if (url.startsWith("sdrangel-aircraft://")) + { + // sdrangel-aircraft://<icao|registration|flight>/<value>, written into an + // aircraft's popup by whatever put the aircraft on the Map. The Map has no idea + // what an aircraft is, so it hands the whole thing to the Aircraft feature. + const QString rest = url.mid(20); + const int slash = rest.indexOf('/'); + if (slash <= 0) + { + qWarning() << "MapGUI::linkClicked: malformed aircraft link" << url; + return; + } + const QString kind = rest.left(slash); + const QString value = QUrl::fromPercentEncoding(rest.mid(slash + 1).toUtf8()); + if (kind == "icao") { + FeatureWebAPIUtils::aircraftSelect("selectIcao", value); + } else if (kind == "registration") { + FeatureWebAPIUtils::aircraftSelect("selectRegistration", value); + } else if (kind == "flight") { + FeatureWebAPIUtils::aircraftSelect("selectFlight", value); + } else { + qWarning() << "MapGUI::linkClicked: unknown aircraft link kind" << kind; + } + } } // Open a KiwiSDR RX device @@ -3060,6 +3891,7 @@ void MapGUI::fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest) else { ui->splitter->addWidget(ui->web); + restoreSplitterState(); } } #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) @@ -3099,6 +3931,10 @@ void MapGUI::preferenceChanged(int elementType) m_antennaMapItem.setPositionDateTime(new QString(QDateTime::currentDateTime().toString(Qt::ISODateWithMs))); update(m_map, &m_antennaMapItem, "Station"); + m_objectMapModel.setStationPosition(stationPosition); + m_imageMapModel.setStationPosition(stationPosition); + m_polygonMapModel.setStationPosition(stationPosition); + m_polylineMapModel.setStationPosition(stationPosition); m_objectMapFilter.setPosition(stationPosition); m_imageMapFilter.setPosition(stationPosition); m_polygonMapFilter.setPosition(stationPosition); @@ -3132,8 +3968,7 @@ void MapGUI::preferenceChanged(int elementType) void MapGUI::makeUIConnections() { QObject::connect(ui->displayNames, &ButtonSwitch::clicked, this, &MapGUI::on_displayNames_clicked); - QObject::connect(ui->viewFirstPerson, &ButtonSwitch::clicked, this, &MapGUI::on_viewFirstPerson_clicked); - QObject::connect(ui->displayPFD, &ButtonSwitch::clicked, this, &MapGUI::on_displayPFD_clicked); + QObject::connect(ui->muteAudio, &ButtonSwitch::clicked, this, &MapGUI::on_muteAudio_clicked); QObject::connect(ui->displayAllGroundTracks, &ButtonSwitch::clicked, this, &MapGUI::on_displayAllGroundTracks_clicked); QObject::connect(ui->displaySelectedGroundTracks, &ButtonSwitch::clicked, this, &MapGUI::on_displaySelectedGroundTracks_clicked); QObject::connect(ui->displayRain, &ButtonSwitch::clicked, this, &MapGUI::on_displayRain_clicked); diff --git a/plugins/feature/map/mapgui.h b/plugins/feature/map/mapgui.h index f8bc66445..cc46f3cf5 100644 --- a/plugins/feature/map/mapgui.h +++ b/plugins/feature/map/mapgui.h @@ -28,6 +28,7 @@ #ifdef QT_WEBENGINE_FOUND #include <QWebEngineFullScreenRequest> #include <QWebEnginePage> +#include <QWebEngineProfile> #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) #include <QWebEngineLoadingInfo> #endif @@ -56,6 +57,7 @@ #include "SWGDeviceSettings.h" #include "mapsettings.h" +#include "mapviewcoordinator.h" #include "mapbeacondialog.h" #include "mapibpbeacondialog.h" #include "mapradiotimedialog.h" @@ -77,6 +79,22 @@ namespace Ui { class MapGUI; struct Beacon; + +#ifdef QT_WEBENGINE_FOUND +// A page of our own, so the 3D map's JavaScript console reaches sdrangel.log. The page +// reports there what each frame and each message from SDRangel costs it (its "perf" line), +// and Cesium reports its own errors there, none of which was visible without attaching a +// browser debugger to it. +class MapWebPage : public QWebEnginePage { +public: + using QWebEnginePage::QWebEnginePage; // Inherit the constructors + +protected: + void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, + int lineNumber, const QString &sourceID) override; +}; +#endif + class QSvgWidget; struct RadioTimeTransmitter { @@ -202,6 +220,7 @@ public: Q_INVOKABLE void supportedMapsChanged(); MapSettings::MapItemSettings *getItemSettings(const QString &group); CesiumInterface *cesium() { return m_cesium; } + bool useLiveryIcons() const { return m_settings.m_useLiveryIcons; } private: Ui::MapGUI* ui; @@ -212,6 +231,7 @@ private: RollupState m_rollupState; bool m_doApplySettings; AvailableChannelOrFeatureList m_availableChannelOrFeatures; + QHash<const QObject *, QString> m_pipeGroups; // Group each source belongs to, so we don't search for it per map item QFileDialog m_fileDialog; Map* m_map; @@ -234,7 +254,23 @@ private: OSMTemplateServer *m_templateServer; quint16 m_mapTileServerPort; MapTileServer *m_mapTileServer; + MapViewCoordinator m_viewCoordinator; QTimer m_redrawMapTimer; + QTimer m_flushTimer; // Hands batched item changes to the map + QTimer m_rmpPollTimer; // Re-reads the RMP's AM Demod frequencies, which can be changed from elsewhere + QJsonObject m_rmpState; // What the RMP panel was last told, so the poll only sends changes + // Model updates are coalesced on to this period - a straight trade of CPU against + // how far behind real time the map is. Running it at 100 ms was measured at 7.10 s of + // flush time against 2.81 s, for 150 ms of latency, so it is only worth spending if + // something is actually waiting on it. + static const int m_flushPeriodMS = 250; + bool m_restoreMapPosition; + //!< The splitter's widgets are added as the 3D map and the NASA panel appear, and + //!< QSplitter::restoreState() only applies when the widget count matches what was + //!< saved - so the state is kept and re-applied as the composition changes, rather + //!< than restored once and lost. + QByteArray m_splitterStateToRestore; + void restoreSplitterState(); // Use the saved position next time the map is created, rather than where it is now GIRO *m_giro; QDateTime m_giroDateTime; QString m_giroRunId; @@ -243,13 +279,20 @@ private: QSharedPointer<const QList<NavAid *>> m_navAids; QSharedPointer<const QList<Airspace *>> m_airspaces; QSharedPointer<const QHash<int, AirportInformation *>> m_airportInfo; - QSharedPointer<const QHash<QString, Waypoint *>> m_waypoints; + QSharedPointer<const QMultiHash<QString, Waypoint *>> m_waypoints; QGeoCoordinate m_lastFullUpdatePosition; KiwiSDRList m_kiwiSDRList; SpyServerList m_spyServerList; SDRangelServerList m_sdrangelServerList; CesiumInterface *m_cesium; +#ifdef QT_WEBENGINE_FOUND + // One profile shared by every map, with a disk cache - see webEngineProfile() + static QWebEngineProfile *s_webEngineProfile; + static int s_webEngineProfileUsers; + static QWebEngineProfile *acquireWebEngineProfile(); + static void releaseWebEngineProfile(); +#endif WebServer *m_webServer; quint16 m_webPort; RainViewer *m_rainViewer; @@ -257,6 +300,13 @@ private: QList<NASAGlobalImagery::DataSet> m_nasaDataSets; QHash<QString, NASAGlobalImagery::DataSet> m_nasaDataSetsHash; NASAGlobalImagery::MetaData m_nasaMetaData; + // The cockpit-panels menu on the PFD toolbar button + QAction *m_displayPFDAction; + QAction *m_displayNDAction; + QAction *m_displayEFISAction; + QAction *m_displayRMPAction; + QAction *m_displayDCDUAction; + QAction *m_displaySeaMarks; QAction *m_displayRailways; QAction *m_displayRain; @@ -274,6 +324,7 @@ private: NASAGlobalImagery::Legend *m_legend; QWidget *m_nasaWidget; QSvgWidget *m_legendWidget; + QString m_loadedLegendUrl; //!< So an unchanged legend is not fetched again QTableWidget *m_overviewWidget; QTextEdit *m_descriptionWidget; @@ -290,7 +341,26 @@ private: void applySettings(const QStringList& settingsKeys, bool force = false); void applyAllSettings(); void applyMap2DSettings(bool reloadMap); + +public: + // Called by MapViewCoordinator once it decides the view has moved enough to matter + void applyMapView(const QGeoRectangle& filterRect, const QGeoRectangle& visibleRect, double zoomLevel); + +private: + bool currentMapPosition(QGeoCoordinate& coords, double& zoom) const; void applyMap3DSettings(bool reloadMap); + void applyAudioVolume(); + void sendAirportsToND(); + void sendNavAidsToND(); + void createCockpitPanelsMenu(); + void applyCockpitPanels(); + void createCameraModeMenu(); + void displayCameraMode(); + bool rmpReadActive(const QString& channelId, qint64& hz) const; + bool rmpTune(const QString& channelId, qint64 hz); + void sendRMPState(bool force); + void sendPanelGeometry(); + void sendEFISState(); QString osmCachePath(); void clearOSMCache(); void clearWikiMediaOSMCache(); @@ -300,7 +370,12 @@ private: QString thunderforestAPIKey() const; QString maptilerAPIKey() const; QString cesiumIonAPIKey() const; + QString effectiveImagery() const; + QString effectiveTerrain() const; + QString effectiveBuildings() const; + bool effectiveGoogleTiles() const; void redrawMap(); + void flushModels(); void makeUIConnections(); void createLayersMenu(); void displayToolbar(); @@ -336,8 +411,8 @@ private slots: void onMenuDialogCalled(const QPoint &p); void onWidgetRolled(QWidget* widget, bool rollDown); void handleInputMessages(); - void on_viewFirstPerson_clicked(bool checked=false); - void on_displayPFD_clicked(bool checked=false); + + void on_muteAudio_clicked(bool checked=false); void on_displayNames_clicked(bool checked=false); void on_displayAllGroundTracks_clicked(bool checked=false); void on_displaySelectedGroundTracks_clicked(bool checked=false); diff --git a/plugins/feature/map/mapguinowebengine.ui b/plugins/feature/map/mapguinowebengine.ui index 4d087dd23..24ee225b2 100644 --- a/plugins/feature/map/mapguinowebengine.ui +++ b/plugins/feature/map/mapguinowebengine.ui @@ -386,17 +386,30 @@ </widget> </item> <item> - <widget class="ButtonSwitch" name="viewFirstPerson"> + <widget class="QToolButton" name="cameraMode"> <property name="toolTip"> - <string>First person / third person view on 3D map</string> + <string>How the camera follows the tracked object on the 3D map: third person, first person or fly-by</string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="mapicons.qrc"> - <normaloff>:/map/icons/thirdperson.png</normaloff> - <normalon>:/map/icons/firstperson.png</normalon>:/map/icons/thirdperson.png</iconset> + <normaloff>:/map/icons/thirdperson.png</normaloff>:/map/icons/thirdperson.png</iconset> + </property> + </widget> + </item> + <item> + <widget class="ButtonSwitch" name="displayPFD"> + <property name="toolTip"> + <string>Display the cockpit panels selected in the drop down menu (PFD, ND, EFIS, RMP, DCDU) on the 3D map. Click the button to show or hide them all, or the arrow to choose which are wanted</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="mapicons.qrc"> + <normaloff>:/map/icons/pfd.png</normaloff>:/map/icons/pfd.png</iconset> </property> <property name="checkable"> <bool>true</bool> @@ -404,19 +417,23 @@ <property name="checked"> <bool>true</bool> </property> + <property name="popupMode"> + <enum>QToolButton::ToolButtonPopupMode::MenuButtonPopup</enum> + </property> </widget> </item> <item> - <widget class="ButtonSwitch" name="displayPFD"> + <widget class="ButtonSwitch" name="muteAudio"> <property name="toolTip"> - <string>Display aircraft PFD (Primary Flight Display) on 3D map</string> + <string>Mute 3D map audio</string> </property> <property name="text"> <string/> </property> <property name="icon"> - <iconset resource="mapicons.qrc"> - <normaloff>:/map/icons/pfd.png</normaloff>:/map/icons/pfd.png</iconset> + <iconset resource="../../../sdrgui/resources/res.qrc"> + <normaloff>:/sound_on.png</normaloff> + <normalon>:/sound_off.png</normalon>:/sound_on.png</iconset> </property> <property name="checkable"> <bool>true</bool> diff --git a/plugins/feature/map/mapguiwebengine.ui b/plugins/feature/map/mapguiwebengine.ui index 61416d15a..8a2d213e4 100644 --- a/plugins/feature/map/mapguiwebengine.ui +++ b/plugins/feature/map/mapguiwebengine.ui @@ -445,30 +445,23 @@ </widget> </item> <item> - <widget class="ButtonSwitch" name="viewFirstPerson"> + <widget class="QToolButton" name="cameraMode"> <property name="toolTip"> - <string>First person / third person view on 3D map</string> + <string>How the camera follows the tracked object on the 3D map: third person, first person or fly-by</string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="mapicons.qrc"> - <normaloff>:/map/icons/thirdperson.png</normaloff> - <normalon>:/map/icons/firstperson.png</normalon>:/map/icons/thirdperson.png</iconset> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>true</bool> + <normaloff>:/map/icons/thirdperson.png</normaloff>:/map/icons/thirdperson.png</iconset> </property> </widget> </item> <item> <widget class="ButtonSwitch" name="displayPFD"> <property name="toolTip"> - <string>Display aircraft PFD (Primary Flight Display) on 3D map</string> + <string>Display the cockpit panels selected in the drop down menu (PFD, ND, EFIS, RMP, DCDU) on the 3D map. Click the button to show or hide them all, or the arrow to choose which are wanted</string> </property> <property name="text"> <string/> @@ -481,7 +474,10 @@ <bool>true</bool> </property> <property name="checked"> - <bool>false</bool> + <bool>true</bool> + </property> + <property name="popupMode"> + <enum>QToolButton::ToolButtonPopupMode::MenuButtonPopup</enum> </property> </widget> </item> @@ -567,6 +563,27 @@ </property> </widget> </item> + <item> + <widget class="ButtonSwitch" name="muteAudio"> + <property name="toolTip"> + <string>Mute 3D map audio</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../../../sdrgui/resources/res.qrc"> + <normaloff>:/sound_on.png</normaloff> + <normalon>:/sound_off.png</normalon>:/sound_on.png</iconset> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> </layout> </item> </layout> @@ -666,17 +683,17 @@ <extends>QWidget</extends> <header location="global">QtQuickWidgets/QQuickWidget</header> </customwidget> - <customwidget> - <class>ButtonSwitch</class> - <extends>QToolButton</extends> - <header>gui/buttonswitch.h</header> - </customwidget> <customwidget> <class>RollupContents</class> <extends>QWidget</extends> <header>gui/rollupcontents.h</header> <container>1</container> </customwidget> + <customwidget> + <class>ButtonSwitch</class> + <extends>QToolButton</extends> + <header>gui/buttonswitch.h</header> + </customwidget> <customwidget> <class>QWebEngineView</class> <extends>QWidget</extends> diff --git a/plugins/feature/map/mapicons.qrc b/plugins/feature/map/mapicons.qrc index b7ee70a6e..c265bed7a 100644 --- a/plugins/feature/map/mapicons.qrc +++ b/plugins/feature/map/mapicons.qrc @@ -16,9 +16,11 @@ <file>icons/earthsat.png</file> <file>icons/aurora.png</file> <file>icons/pfd.png</file> + <file>icons/nd.png</file> <file>icons/compass.png</file> <file>icons/grid.png</file> <file>icons/thirdperson.png</file> <file>icons/firstperson.png</file> + <file>icons/flyby.png</file> </qresource> </RCC> diff --git a/plugins/feature/map/mapitem.cpp b/plugins/feature/map/mapitem.cpp index 50c3570dd..09e730450 100644 --- a/plugins/feature/map/mapitem.cpp +++ b/plugins/feature/map/mapitem.cpp @@ -15,7 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // /////////////////////////////////////////////////////////////////////////////////// +#include <algorithm> + +#include <QFile> +#include <QFileInfo> + #include "mapitem.h" +#include "util/profiler.h" MapItem::MapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) : m_latitude(0.0f), @@ -31,19 +37,28 @@ MapItem::MapItem(const QObject *sourcePipe, const QString &group, MapSettings::M void MapItem::update(SWGSDRangel::SWGMapItem *mapItem) { - if (mapItem->getLabel()) { - m_label = *mapItem->getLabel(); - } else { - m_label = ""; + m_changed = 0; + + const QString label = mapItem->getLabel() ? *mapItem->getLabel() : QString(); + if (label != m_label) + { + m_label = label; + m_changed |= ChangedLabel; } if (mapItem->getLabelDateTime()) { m_labelDateTime = QDateTime::fromString(*mapItem->getLabelDateTime(), Qt::ISODateWithMs); } else { m_labelDateTime = QDateTime(); } - m_latitude = mapItem->getLatitude(); - m_longitude = mapItem->getLongitude(); - m_altitude = mapItem->getAltitude(); + if ( (m_latitude != mapItem->getLatitude()) + || (m_longitude != mapItem->getLongitude()) + || (m_altitude != mapItem->getAltitude())) + { + m_latitude = mapItem->getLatitude(); + m_longitude = mapItem->getLongitude(); + m_altitude = mapItem->getAltitude(); + m_changed |= ChangedPosition; + } } QGeoCoordinate MapItem::getCoordinates() @@ -58,6 +73,17 @@ WhittakerEilers ObjectMapItem::m_filter; void ObjectMapItem::update(SWGSDRangel::SWGMapItem *mapItem) { + // An empty image means take it off the map. The 2D side reads that in the model, but + // the 3D side is driven from the item, so it has to be recorded here or Cesium keeps + // the entity - which is what left a route's waypoint markers and their names on the + // 3D map after the route itself had gone. + // + // Null checked, unlike the polygon and polyline versions of this: those are only ever + // built from the Map feature's own dispatch, which has already tested the image, while + // an object is built from several places and some of them set no image at all. + m_deleted = mapItem->getImage() && mapItem->getImage()->isEmpty(); + + PROFILER_START() MapItem::update(mapItem); if (mapItem->getPositionDateTime()) { m_positionDateTime = QDateTime::fromString(*mapItem->getPositionDateTime(), Qt::ISODateWithMs); @@ -78,18 +104,37 @@ void ObjectMapItem::update(SWGSDRangel::SWGMapItem *mapItem) } else { m_orientationDateTime = QDateTime(); } - m_image = *mapItem->getImage(); - m_imageRotation = mapItem->getImageRotation(); + if ((m_image != *mapItem->getImage()) || (m_imageRotation != mapItem->getImageRotation())) + { + m_image = *mapItem->getImage(); + m_imageRotation = mapItem->getImageRotation(); + m_changed |= ChangedImage; + } QString *text = mapItem->getText(); - if (text != nullptr) { - m_text = text->replace("\n", "<br>"); // Convert to HTML - } else { - m_text = ""; + QString newText = text != nullptr ? text->replace("\n", "<br>") : QString(); // Convert to HTML + bool textChanged = newText != m_text; + if (textChanged) + { + m_text = newText; + m_changed |= ChangedText; } - if (mapItem->getModel()) { - m_model = *mapItem->getModel(); - } else { - m_model = ""; + QString model = mapItem->getModel() ? *mapItem->getModel() : QString(); + if (model != m_model) + { + m_model = model; + // The livery icons are named after the 3D models they were rendered from + // (e.g. BB_Airbus_png/A320/A320_BAW.gltf -> A320_BAW.png), so an aircraft's + // icon follows its model's basename. The resources come from the plugin that + // sent the item (such as the ADS-B demod), so may not be registered + m_liveryImage = ""; + if (!m_model.isEmpty()) + { + QString base = QFileInfo(m_model).completeBaseName(); + if (QFile::exists(":/map/liveries/" + base + ".png")) { + m_liveryImage = "qrc:///map/liveries/" + base + ".png"; + } + } + m_changed |= ChangedImage; } m_labelAltitudeOffset = mapItem->getLabelAltitudeOffset(); m_modelAltitudeOffset = mapItem->getModelAltitudeOffset(); @@ -110,12 +155,25 @@ void ObjectMapItem::update(SWGSDRangel::SWGMapItem *mapItem) m_animations.append(new CesiumInterface::Animation(animation)); } } - findFrequencies(); + if (textChanged) { + findFrequencies(); + } if (!m_fixedPosition) { + PROFILER_START() updateTrack(mapItem->getTrack(), m_itemSettings); + updateProvisionalTrackPoint(); updatePredictedTrack(mapItem->getPredictedTrack()); + updateTakenTrackBounds(); + PROFILER_STOP("Map item track") + m_changed |= ChangedTrack; + if (mapItem->getPredictedTrack()) { + m_changed |= ChangedPredictedTrack; + } } + + // Anything else in here is only of interest to the 3D map + m_changed |= Changed3D; if (mapItem->getAvailableFrom()) { m_availableFrom = QDateTime::fromString(*mapItem->getAvailableFrom(), Qt::ISODateWithMs); } else { @@ -126,11 +184,19 @@ void ObjectMapItem::update(SWGSDRangel::SWGMapItem *mapItem) } else { m_availableUntil = QDateTime(); } + if (mapItem->getLoopSound()) { + m_loopSound = *mapItem->getLoopSound(); + } if (mapItem->getAircraftState()) { if (!m_aircraftState) { m_aircraftState = new MapAircraftState(); } SWGSDRangel::SWGMapAircraftState *as = mapItem->getAircraftState(); + if (as->getDateTime()) { + m_aircraftState->m_dateTime = QDateTime::fromString(*as->getDateTime(), Qt::ISODateWithMs); + } else { + m_aircraftState->m_dateTime = QDateTime(); + } if (as->getCallsign()) { m_aircraftState->m_callsign = *as->getCallsign(); } @@ -163,15 +229,66 @@ void ObjectMapItem::update(SWGSDRangel::SWGMapItem *mapItem) m_aircraftState->m_verticalMode = (MapAircraftState::VerticalMode) as->getVerticalMode(); m_aircraftState->m_lateralMode = (MapAircraftState::LateralMode) as->getLateralMode(); m_aircraftState->m_tcasMode = (MapAircraftState::TCASMode) as->getTcasMode(); + m_aircraftState->m_tcasRA = as->getTcasRa(); + m_aircraftState->m_tcasThreatIcao = as->getTcasThreatIcao() ? *as->getTcasThreatIcao() : QString(); + m_aircraftState->m_squawk = as->getSquawk(); + m_aircraftState->m_icao = as->getIcao() ? *as->getIcao() : QString(); m_aircraftState->m_windSpeed = as->getWindSpeed(); m_aircraftState->m_windDirection = as->getWindDirection(); m_aircraftState->m_staticAirTemperature = as->getStaticAirTemperature(); + MapFlightPlan& plan = m_aircraftState->m_flightPlan; + if (as->getFlightPlan() && as->getFlightPlan()->isSet()) + { + SWGSDRangel::SWGMapFlightPlan *fp = as->getFlightPlan(); + plan.m_valid = true; + plan.m_departure = fp->getDeparture() ? *fp->getDeparture() : QString(); + plan.m_arrival = fp->getArrival() ? *fp->getArrival() : QString(); + plan.m_arrivalRunway = fp->getArrivalRunway() ? *fp->getArrivalRunway() : QString(); + plan.m_approach = fp->getApproach() ? *fp->getApproach() : QString(); + plan.m_activeWaypoint = fp->getActiveWaypoint(); + plan.m_waypoints.clear(); + if (fp->getWaypoints()) + { + for (const auto wp : *fp->getWaypoints()) + { + MapRouteWaypoint waypoint; + waypoint.m_name = wp->getName() ? *wp->getName() : QString(); + waypoint.m_latitude = wp->getLatitude(); + waypoint.m_longitude = wp->getLongitude(); + waypoint.m_altitudeFt = wp->getAltitude(); + waypoint.m_eta = wp->getEta() ? *wp->getEta() : QString(); + plan.m_waypoints.append(waypoint); + } + } + } + else + { + plan.m_valid = false; + plan.m_waypoints.clear(); + } + MapDatalinkMessage& message = m_aircraftState->m_datalinkMessage; + if (as->getDatalinkMessage() && as->getDatalinkMessage()->isSet()) + { + SWGSDRangel::SWGMapDatalinkMessage *dm = as->getDatalinkMessage(); + message.m_valid = true; + message.m_id = dm->getId(); + message.m_received = dm->getReceived() ? *dm->getReceived() : QString(); + message.m_uplink = dm->getUplink() != 0; + message.m_station = dm->getStation() ? *dm->getStation() : QString(); + message.m_text = dm->getText() ? *dm->getText() : QString(); + } + else + { + message.m_valid = false; + } } + PROFILER_STOP("Map item update") } void ImageMapItem::update(SWGSDRangel::SWGMapItem *mapItem) { MapItem::update(mapItem); + m_changed = ChangedAll; // Low rate, so not worth working out what changed m_image = "data:image/png;base64," + *mapItem->getImage(); m_imageZoomLevel = mapItem->getImageZoomLevel(); @@ -188,6 +305,7 @@ void ImageMapItem::update(SWGSDRangel::SWGMapItem *mapItem) void PolygonMapItem::update(SWGSDRangel::SWGMapItem *mapItem) { MapItem::update(mapItem); + m_changed = ChangedAll; // Low rate, so not worth working out what changed m_extrudedHeight = mapItem->getExtrudedHeight(); m_colorValid = mapItem->getColorValid(); m_color = mapItem->getColor(); @@ -225,8 +343,10 @@ void PolygonMapItem::update(SWGSDRangel::SWGMapItem *mapItem) void PolylineMapItem::update(SWGSDRangel::SWGMapItem *mapItem) { MapItem::update(mapItem); + m_changed = ChangedAll; // Low rate, so not worth working out what changed m_colorValid = mapItem->getColorValid(); m_color = mapItem->getColor(); + m_altitudeColored = mapItem->getType() == 4; m_altitudeReference = mapItem->getAltitudeReference(); m_deleted = *mapItem->getImage() == ""; @@ -261,10 +381,11 @@ void PolylineMapItem::update(SWGSDRangel::SWGMapItem *mapItem) // Look for a frequency in the text for this object void ObjectMapItem::findFrequencies() { + PROFILER_START() m_frequencies.clear(); m_frequencyStrings.clear(); - const QRegularExpression re("(([0-9]+(\\.[0-9]+)?) *([kMG])?Hz)"); + static const QRegularExpression re("(([0-9]+(\\.[0-9]+)?) *([kMG])?Hz)"); QRegularExpressionMatchIterator itr = re.globalMatch(m_text); while (itr.hasNext()) { @@ -286,6 +407,7 @@ void ObjectMapItem::findFrequencies() m_frequencies.append((qint64)frequency); m_frequencyStrings.append(capture[0]); } + PROFILER_STOP("Map frequencies") } void ObjectMapItem::extrapolatePosition(QGeoCoordinate *c, const QDateTime& dateTime) @@ -314,6 +436,9 @@ void ObjectMapItem::extrapolatePosition(QGeoCoordinate *c, const QDateTime& date qint64 t1 = m_takenTrackDateTimes[p1]->msecsTo(*m_takenTrackDateTimes[p2]); qint64 t2 = m_takenTrackDateTimes[p2]->msecsTo(dateTime); + if (t1 <= 0) { + return; + } double latV = (m_takenTrackCoords[p2]->latitude() - m_takenTrackCoords[p1]->latitude()) / t1; double lonV = (m_takenTrackCoords[p2]->longitude() - m_takenTrackCoords[p1]->longitude()) / t1; @@ -351,10 +476,13 @@ void ObjectMapItem::extrapolateAltitude(QGeoCoordinate *c, const QDateTime& date qint64 t1 = m_takenTrackDateTimes[p1]->msecsTo(*m_takenTrackDateTimes[p2]); qint64 t2 = m_takenTrackDateTimes[p2]->msecsTo(dateTime); + if (t1 <= 0) { + return; + } double vertV = (m_takenTrackCoords[p2]->altitude() - m_takenTrackCoords[p1]->altitude()) / t1; - double newAlt = m_takenTrackCoords[p2]->latitude() + vertV * t2; + double newAlt = m_takenTrackCoords[p2]->altitude() + vertV * t2; c->setAltitude(newAlt); } @@ -380,6 +508,9 @@ void ObjectMapItem::interpolatePosition(int p2, const float p3Latitude, const fl qint64 t1 = m_takenTrackDateTimes[p1]->msecsTo(p3DateTime); qint64 t2 = m_takenTrackDateTimes[p1]->msecsTo(*m_takenTrackDateTimes[p2]); + if (t1 <= 0) { + return; + } double latV = (p3Latitude - m_takenTrackCoords[p1]->latitude()) / t1; double lonV = (p3Longitude - m_takenTrackCoords[p1]->longitude()) / t1; @@ -415,6 +546,9 @@ void ObjectMapItem::interpolateAltitude(int p2, const float p3Altitude, const QD qint64 t1 = m_takenTrackDateTimes[p1]->msecsTo(p3DateTime); qint64 t2 = m_takenTrackDateTimes[p1]->msecsTo(*m_takenTrackDateTimes[p2]); + if (t1 <= 0) { + return; + } double vertV = (p3Altitude - m_takenTrackCoords[p1]->altitude()) / t1; @@ -426,48 +560,434 @@ void ObjectMapItem::interpolateAltitude(int p2, const float p3Altitude, const QD m_interpolatedDateTimes.append(m_takenTrackDateTimes[p2]); } +void ObjectMapItem::updateTakenTrackBounds() +{ + for (int i = m_takenTrackBoundsCount; i < m_takenTrackCoords.size(); i++) + { + const double longitude = m_takenTrackCoords[i]->longitude(); + m_takenTrackMinLongitude = std::min(m_takenTrackMinLongitude, longitude); + m_takenTrackMaxLongitude = std::max(m_takenTrackMaxLongitude, longitude); + } + m_takenTrackBoundsCount = m_takenTrackCoords.size(); +} + + +// A sender that owns its track only adds a point when the aircraft has moved far enough +// to be worth storing - the Aircraft feature's threshold is 200 m - so the last point it +// has given us sits behind where the aircraft actually is. The Map used to hide that by +// appending a point of its own on every update, but those points became part of the +// stored track and were what made it jump (see updateTrack). +// +// So carry exactly ONE point beyond the sender's track, holding the live position, and +// replace it in place rather than accumulating. The track drawn on the 2D map reaches the +// aircraft as it did before, while the history behind it stays exactly what the sender +// said it was, and stays prefix-stable. +// Whittaker-Eilers penalises the second differences of z with respect to x, and those +// carry units of 1/x^2 - so the same lambda smooths far harder over a window spanning +// ten minutes than over one spanning twenty seconds. That is the difference between an +// aircraft overhead and one at the edge of range, and it would cut the corners off a +// distant aircraft's turns at a lambda that looks right for a near one. +// +// Rescaling the window to [0, n-1] fixes it. The RELATIVE spacing of the points is +// preserved, which is what the filter needs in order to weight uneven gaps properly, +// and evenly spaced data lands on 0, 1, 2, ... - the textbook formulation, where the +// familiar lambda range means what it usually does. Returns false if the window has no +// extent, which leaves nothing to smooth along. +static bool normaliseAbscissae(QVector<double>& x, int n) +{ + const double span = x[n - 1] - x[0]; + if (span <= 0.0) { + return false; + } + const double scale = (n - 1) / span; + for (int i = 0; i < n; i++) { + x[i] = (x[i] - x[0]) * scale; + } + return true; +} + +// Smoothing for both supplied and automatically collected tracks. The smoothed values +// are computed from the raw points and published separately. Besides keeping a supplied +// track comparable with its sender, this prevents the automatic path from feeding an +// earlier smoothed result back into its next fit and progressively amplifying an error. +// +// Only the 3D map sees them. The 2D map deliberately draws raw positions +// (onlyActual2D below), and the entity position is what Cesium draws its path from, so +// smoothing the samples smooths the 3D track. +void ObjectMapItem::smoothTrack(MapSettings::MapItemSettings *itemSettings) +{ + // These are one-shot corrections for the 3D entity. Clear them before every pass, + // including passes that return early, or a rejected/short window can resend values + // calculated for the previous version of the track. + m_smoothedWindow.clear(); + m_smoothedWindowTimes.clear(); + m_interpolatedCoords.clear(); + m_interpolatedDateTimes.clear(); + + const int filterLen = itemSettings ? itemSettings->m_smoothingWindow : 0; + if (filterLen <= 0) + { + m_lastSmoothedSize = 0; + m_smoothedTrackCoords.clear(); + return; + } + // Keep the smoothed shadow aligned with the track: new points start as their raw + // selves and are overwritten below as smoothing windows complete. Trims and + // rebuilds truncate it where they truncate the track - see updateTrack(). + while (m_smoothedTrackCoords.size() < m_takenTrackCoords.size()) { + m_smoothedTrackCoords.append(*m_takenTrackCoords[m_smoothedTrackCoords.size()]); + } + // The window actually filtered is twice the setting, and only its later three + // quarters are committed. Fitting exactly the last "window" points and committing + // all of them put a visible corner at every window boundary - measured on a real + // track, the heading kink at the seams averaged 4 degrees against 0.7 inside the + // windows, which is precisely the jaggedness smoothing is meant to remove. A + // point committed here has context on both sides of it in the fit. + const int windowLen = 2 * filterLen; + if (m_takenTrackCoords.size() < windowLen) { + return; + } + // Run every half setting-window, measured against where the last pass ended rather + // than testing the length for divisibility. The automatic track grows one point at + // a time so a "% (filterLen/2) == 0" test always came round; a supplied track + // arrives in batches - the Aircraft feature appends several points between sends - + // and the length steps straight over the multiples, so smoothing hardly ever ran. + if ((m_takenTrackCoords.size() - m_lastSmoothedSize) < (filterLen / 2)) { + return; + } + m_lastSmoothedSize = m_takenTrackCoords.size(); + + QVector<double> x(windowLen), y1(windowLen), y2(windowLen), y3(windowLen), w(windowLen); + for (int i = 0; i < windowLen; i++) + { + const int idx = m_takenTrackCoords.size() - (windowLen - i); + x[i] = (m_takenTrackDateTimes[idx]->toMSecsSinceEpoch() + - m_takenTrackDateTimes[0]->toMSecsSinceEpoch()) / 1000.0; + // The first half of the window was smoothed by earlier passes and is already + // on screen. The fit is anchored hard to those SMOOTHED values rather than the + // raw ones, which is what joins this window's curve onto the last one's - + // anchoring to the raw values put a corner at every seam. + if (i < (windowLen / 2)) + { + const QGeoCoordinate& c = m_smoothedTrackCoords[idx]; + y1[i] = c.latitude(); + y2[i] = c.longitude(); + y3[i] = c.altitude(); + w[i] = 100.0; + } + else + { + y1[i] = m_takenTrackCoords[idx]->latitude(); + y2[i] = m_takenTrackCoords[idx]->longitude(); + y3[i] = m_takenTrackCoords[idx]->altitude(); + w[i] = 1.0; + } + // Two points at the same instant make the divided differences below divide by + // zero. Nudging them apart was worse than useless: it leaves a gap a thousand + // times smaller than its neighbours, and the fit over such uneven spacing is + // ill conditioned - the window that produced 15 km errors had x values of + // 2.283, 2.284, 2.285 next to gaps of five seconds. Skip the window instead, + // and let the counter say it is happening. + if ((i > 0) && (x[i] <= x[i - 1])) { + return; + } + } + + // A window straddling a hole in coverage is just as ill conditioned: fitting + // across half-second points either side of a minute-long gap threw a point of a + // real track 1.9 km sideways. The aircraft was not being received - there is + // nothing true to draw across the gap, so leave those points as they came. + QVector<double> gaps(windowLen - 1); + for (int i = 1; i < windowLen; i++) { + gaps[i - 1] = x[i] - x[i - 1]; + } + QVector<double> sortedGaps = gaps; + std::nth_element(sortedGaps.begin(), sortedGaps.begin() + sortedGaps.size() / 2, sortedGaps.end()); + const double medianGap = sortedGaps[sortedGaps.size() / 2]; + const double maxGap = *std::max_element(gaps.constBegin(), gaps.constEnd()); + if ((maxGap > 30.0) || (maxGap > 20.0 * medianGap)) { + return; + } + + QVector<double> xn = x; + if (!normaliseAbscissae(xn, windowLen)) { + return; + } + + const double lambda = itemSettings->m_smoothingLambda; + m_filter.filter(xn.data(), y1.data(), w.data(), windowLen, lambda); + m_filter.filter(xn.data(), y2.data(), w.data(), windowLen, lambda); + m_filter.filter(xn.data(), y3.data(), w.data(), windowLen, lambda); + + for (int i = 0; i < windowLen; i++) + { + if (!std::isfinite(y1[i]) || !std::isfinite(y2[i]) || !std::isfinite(y3[i])) { + return; + } + } + + // Commit from a quarter of the way in: the anchored first quarter is already + // final, and everything after it has been fitted with points both sides. + // Filled completely before any pointer into it is taken, so nothing dangles when + // the lists grow. Cleared each pass, which also drops anything the 3D map did not + // collect because it was closed + const int commitFrom = windowLen / 4; + m_smoothedWindow.reserve(windowLen - commitFrom); + m_smoothedWindowTimes.reserve(windowLen - commitFrom); + for (int i = commitFrom; i < windowLen; i++) + { + const int idx = m_takenTrackCoords.size() - (windowLen - i); + m_smoothedWindow.append(QGeoCoordinate(y1[i], y2[i], y3[i])); + m_smoothedWindowTimes.append(*m_takenTrackDateTimes[idx]); + // And into the shadow track, which is what the 3D map's altitude coloured + // segments draw + m_smoothedTrackCoords[idx] = QGeoCoordinate(y1[i], y2[i], y3[i]); + } + for (int i = 0; i < m_smoothedWindow.size(); i++) + { + m_interpolatedCoords.append(&m_smoothedWindow[i]); + m_interpolatedDateTimes.append(&m_smoothedWindowTimes[i]); + } +} + +void ObjectMapItem::updateProvisionalTrackPoint() +{ + if (!m_trackSupplied || m_takenTrackCoords.isEmpty()) { + return; + } + + const int last = m_takenTrackCoords.size() - 1; + const int real = m_trackProvisional ? last - 1 : last; + if (real < 0) { + return; // Nothing from the sender yet to hang it off + } + + // Nothing to show while the aircraft is still on the sender's last point + const QGeoCoordinate *r = m_takenTrackCoords.at(real); + if ((r->latitude() == m_latitude) && (r->longitude() == m_longitude) + && (r->altitude() == m_altitude)) + { + dropProvisionalTrackPoint(); + return; + } + + const QGeoCoordinate live(m_latitude, m_longitude, m_altitude); + const QDateTime when = m_positionDateTime.isValid() ? m_positionDateTime + : QDateTime::currentDateTime(); + if (m_trackProvisional) + { + if ((*m_takenTrackCoords[last] != live) || (*m_takenTrackDateTimes[last] != when)) + { + *m_takenTrackCoords[last] = live; + *m_takenTrackDateTimes[last] = when; + m_takenTrackDateTimeStrings[last] = when.toString(Qt::ISODateWithMs); + m_takenTrack[last] = QVariant::fromValue(live); + m_takenTrackRevision++; + } + } + else + { + m_takenTrackCoords.push_back(new QGeoCoordinate(live)); + m_takenTrackDateTimes.push_back(new QDateTime(when)); + m_takenTrackDateTimeStrings.push_back(when.toString(Qt::ISODateWithMs)); + m_takenTrackPositionExtrapolated.push_back(false); + m_takenTrackAltitudeExtrapolated.push_back(false); + m_takenTrack.push_back(QVariant::fromValue(live)); + m_trackProvisional = true; + } +} + +void ObjectMapItem::dropProvisionalTrackPoint() +{ + if (!m_trackProvisional) { + return; + } + delete m_takenTrackCoords.takeLast(); + delete m_takenTrackDateTimes.takeLast(); + m_takenTrackDateTimeStrings.removeLast(); + m_takenTrackPositionExtrapolated.removeLast(); + m_takenTrackAltitudeExtrapolated.removeLast(); + m_takenTrack.removeLast(); + m_trackProvisional = false; + // The longitude bounds were extended over the point that has just gone. They are only + // used to decide whether a track is wholly on screen, so leaving them slightly wide + // costs a split that could have been skipped - never a wrong answer + m_takenTrackBoundsCount = std::min(m_takenTrackBoundsCount, (int) m_takenTrackCoords.size()); +} + void ObjectMapItem::updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, MapSettings::MapItemSettings *itemSettings) { if (track != nullptr) { - qDeleteAll(m_takenTrackCoords); - m_takenTrackCoords.clear(); - qDeleteAll(m_takenTrackDateTimes); - m_takenTrackDateTimes.clear(); - m_takenTrackPositionExtrapolated.clear(); - m_takenTrackAltitudeExtrapolated.clear(); - m_takenTrack.clear(); - m_takenTrack1.clear(); - m_takenTrack2.clear(); - for (int i = 0; i < track->size(); i++) + // From here on this track belongs to the sender, and the Map must not add points + // of its own to it - see the else branch below + m_trackSupplied = true; + + // The incoming sender point commonly replaces the provisional live point at + // the same index. Treat it as a rewrite only when its value actually differs; + // otherwise forcing both segment caches to rebuild on every append would throw + // away their main performance optimisation. + if (m_trackProvisional && (track->size() >= m_takenTrackCoords.size())) + { + const int i = m_takenTrackCoords.size() - 1; + SWGSDRangel::SWGMapCoordinate *p = track->at(i); + const QGeoCoordinate *c = m_takenTrackCoords.at(i); + const bool timeDiffers = !p->getDateTime() + || (m_takenTrackDateTimeStrings.at(i) != *p->getDateTime()); + if ((c->latitude() != p->getLatitude()) + || (c->longitude() != p->getLongitude()) + || (c->altitude() != p->getAltitude()) || timeDiffers) + { + m_takenTrackRevision++; + } + } + dropProvisionalTrackPoint(); + + // The sender hands over the WHOLE track on every message, but in the ordinary + // case it has simply grown by one point. Rebuilding it from nothing - two heap + // allocations and an ISO 8601 date parse per point - was measured at 173 us per + // message and 83% of all item update time, and it gets steadily worse the longer + // an aircraft is watched, which is exactly when the map feels slow. + // + // So check whether the points we already hold still match, and if they do, copy + // only what is new. The check is four comparisons per point with no + // allocation and no parsing, cheap enough to do exhaustively rather than assume + // the sender only ever appends - a sender that rewrote a track would otherwise + // leave a wrong one on the map, and that is not a bug worth risking to save a + // few hundred nanoseconds. + int keep = 0; + if ((track->size() >= m_takenTrackCoords.size()) + && (m_takenTrackDateTimeStrings.size() == m_takenTrackCoords.size())) + { + keep = m_takenTrackCoords.size(); + for (int i = 0; i < keep; i++) + { + // The generated accessors are not const, so neither is this + SWGSDRangel::SWGMapCoordinate *p = track->at(i); + const QGeoCoordinate *c = m_takenTrackCoords.at(i); + const bool latDiffers = (c->latitude() != p->getLatitude()); + const bool lonDiffers = (c->longitude() != p->getLongitude()); + const bool altDiffers = (c->altitude() != p->getAltitude()); + const bool timeDiffers = !p->getDateTime() + || (m_takenTrackDateTimeStrings.at(i) != *p->getDateTime()); + if (latDiffers || lonDiffers || altDiffers || timeDiffers) + { + // Keep everything before the divergence rather than starting again + keep = i; + break; + } + } + } + + if (keep == 0) + { + if (!m_takenTrackCoords.isEmpty()) { + m_takenTrackRevision++; + } + qDeleteAll(m_takenTrackCoords); + m_takenTrackCoords.clear(); + m_takenTrackMinLongitude = 180.0; + m_takenTrackMaxLongitude = -180.0; + m_takenTrackBoundsCount = 0; + qDeleteAll(m_takenTrackDateTimes); + m_takenTrackDateTimes.clear(); + m_takenTrackDateTimeStrings.clear(); + m_takenTrackPositionExtrapolated.clear(); + m_takenTrackAltitudeExtrapolated.clear(); + m_takenTrack.clear(); + m_takenTrack1.clear(); + m_takenTrack2.clear(); + m_lastSmoothedSize = 0; + m_smoothedTrackCoords.clear(); + } + else if (keep < m_takenTrackCoords.size()) + { + // Diverged part way: drop the tail from there and re-copy it. The longitude + // bounds were accumulated over points that are going away, so they have to be + // recomputed from scratch - updateTakenTrackBounds() resumes from this count. + m_takenTrackRevision++; + while (m_takenTrackCoords.size() > keep) + { + delete m_takenTrackCoords.takeLast(); + delete m_takenTrackDateTimes.takeLast(); + m_takenTrackDateTimeStrings.removeLast(); + m_takenTrackPositionExtrapolated.removeLast(); + m_takenTrackAltitudeExtrapolated.removeLast(); + m_takenTrack.removeLast(); + } + m_takenTrackMinLongitude = 180.0; + m_takenTrackMaxLongitude = -180.0; + m_takenTrackBoundsCount = 0; + m_takenTrack1.clear(); + m_takenTrack2.clear(); + m_lastSmoothedSize = std::min(m_lastSmoothedSize, keep); + while (m_smoothedTrackCoords.size() > keep) { + m_smoothedTrackCoords.removeLast(); + } + } + else if (keep == track->size()) + { + // Nothing new. The extrapolation flags below are still recomputed by the + // caller, so there is simply nothing to copy. + return; + } + + // Appending leaves m_takenTrackBoundsCount alone, and updateTakenTrackBounds() + // resumes from it, so the longitude bounds extend over just the new points + for (int i = keep; i < track->size(); i++) { SWGSDRangel::SWGMapCoordinate* p = track->at(i); QGeoCoordinate *c = new QGeoCoordinate(p->getLatitude(), p->getLongitude(), p->getAltitude()); - QDateTime *d = new QDateTime(QDateTime::fromString(*p->getDateTime(), Qt::ISODate)); + const QString dateTime = p->getDateTime() ? *p->getDateTime() : QString(); + QDateTime *d = new QDateTime(QDateTime::fromString(dateTime, Qt::ISODateWithMs)); m_takenTrackCoords.push_back(c); m_takenTrackDateTimes.push_back(d); + m_takenTrackDateTimeStrings.push_back(dateTime); m_takenTrackPositionExtrapolated.push_back(false); m_takenTrackAltitudeExtrapolated.push_back(false); m_takenTrack.push_back(QVariant::fromValue(*c)); } + + smoothTrack(itemSettings); } + else if (m_trackSupplied) + { + // This item supplies its own track, and simply has not changed it. Do NOT fall + // through to the automatic track below: rebuilding the whole track for every + // report is expensive, so a sender like the Aircraft feature sends it only when + // it grows and sends nothing in between - and the Map was appending its own + // point on each of those, so the stored track became the sender's points with + // Map-generated ones (including EXTRAPOLATED positions, and positions rewritten + // in place by the Whittaker-Eilers smoother) spliced in after them. The next real + // track then disagreed with what was held and rewrote the tail, which is the + // backwards jump seen in taken tracks on the 3D map. + // + // It showed in the counters as 8578 of 9916 track updates finding the stored + // track already different, diverging on average 39 points in - a sender that + // only ever appends cannot do that on its own. + } else { // Automatically create a track + bool trackGrew = false; if (m_takenTrackCoords.size() == 0) { QGeoCoordinate *c = new QGeoCoordinate(m_latitude, m_longitude, m_altitude); m_takenTrackCoords.push_back(c); - if (m_altitudeDateTime.isValid()) { - m_takenTrackDateTimes.push_back(new QDateTime(m_altitudeDateTime)); - } else if (m_positionDateTime.isValid()) { + // This coordinate says where the object is, so its time is the position + // time. Preferring a newer altitude time falsely moved the position sample + // forward and made later extrapolation use the wrong interval. + if (m_positionDateTime.isValid()) { m_takenTrackDateTimes.push_back(new QDateTime(m_positionDateTime)); + } else if (m_altitudeDateTime.isValid()) { + m_takenTrackDateTimes.push_back(new QDateTime(m_altitudeDateTime)); } else { m_takenTrackDateTimes.push_back(new QDateTime(QDateTime::currentDateTime())); } m_takenTrackPositionExtrapolated.push_back(false); m_takenTrackAltitudeExtrapolated.push_back(false); m_takenTrack.push_back(QVariant::fromValue(*c)); + trackGrew = true; } else { @@ -488,43 +1008,16 @@ void ObjectMapItem::updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, M QGeoCoordinate c(m_latitude, m_longitude, m_altitude); QGeoCoordinate cActual = c; - int prevSize = m_takenTrackPositionExtrapolated.size(); - - if (m_altitudeDateTime.isValid() && m_positionDateTime.isValid() && (m_altitudeDateTime > m_positionDateTime)) - { - if (interpolate) - { - for (int i = m_takenTrackAltitudeExtrapolated.size() - 1; (i >= 0) && m_takenTrackAltitudeExtrapolated[i]; i--) - { - interpolateAltitude(i, m_altitude, m_altitudeDateTime); - m_takenTrackAltitudeExtrapolated[i] = false; - } - } - if (samePos2) - { - *m_takenTrackDateTimes.last() = m_altitudeDateTime; - } - else - { - extrapolatePosition(&c, m_altitudeDateTime); - if (m_altitudeDateTime == *prevDateTime) - { - m_takenTrackPositionExtrapolated[m_takenTrackPositionExtrapolated.size() - 1] = true; - *m_takenTrackCoords.last() = c; - m_takenTrack.last() = QVariant::fromValue(onlyActual2D ? cActual : c); - } - else - { - m_takenTrackDateTimes.push_back(new QDateTime(m_altitudeDateTime)); - m_takenTrackPositionExtrapolated.push_back(true); - m_takenTrackAltitudeExtrapolated.push_back(false); - m_takenTrackCoords.push_back(new QGeoCoordinate(c)); - m_takenTrack.push_back(QVariant::fromValue(onlyActual2D ? cActual : c)); - } - } - } - else if (m_positionDateTime.isValid()) + // A new altitude is not a new position. The old code extrapolated a + // position to every altitude report and inserted it into the 3D track. With + // millisecond source timestamps, two close position fixes can legitimately + // be only a few ms apart; projecting that short-baseline velocity even one + // second forward produces the long spokes seen in the Map. The 2D list kept + // the actual coordinate while its parallel geometry list kept the projected + // one, so edge splitting could corrupt the 2D path as well. Only a newer + // position timestamp is allowed to grow a spatial track. + if (m_positionDateTime.isValid()) { if (interpolate) { @@ -543,6 +1036,19 @@ void ObjectMapItem::updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, M } else { + const qint64 elapsedMs = prevDateTime->msecsTo(m_positionDateTime); + const double segmentKm = prev1->distanceTo(cActual) / 1000.0; + const double speedKn = elapsedMs > 0 + ? segmentKm * 3600000.0 / elapsedMs / 1.852 : 0.0; + if (!cActual.isValid() || !std::isfinite(segmentKm) + || ((segmentKm > 20.0) && (speedKn > 1200.0))) + { + qWarning() << "MAP_TRACK_DIAG implausible input segment" + << m_name + << "from" << *prev1 << prevDateTime->toString(Qt::ISODateWithMs) + << "to" << cActual << m_positionDateTime.toString(Qt::ISODateWithMs) + << "distance-km" << segmentKm << "speed-kn" << speedKn; + } bool extrapolateAlt = m_altitudeDateTime.isValid() && (m_positionDateTime > m_altitudeDateTime); if (extrapolateAlt) { extrapolateAltitude(&c, m_positionDateTime); @@ -560,6 +1066,7 @@ void ObjectMapItem::updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, M m_takenTrackAltitudeExtrapolated.push_back(extrapolateAlt); m_takenTrackCoords.push_back(new QGeoCoordinate(c)); m_takenTrack.push_back(QVariant::fromValue(onlyActual2D ? cActual : c)); + trackGrew = true; } } } @@ -575,6 +1082,7 @@ void ObjectMapItem::updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, M m_takenTrackAltitudeExtrapolated.push_back(false); m_takenTrackCoords.push_back(new QGeoCoordinate(c)); m_takenTrack.push_back(QVariant::fromValue(onlyActual2D ? cActual : c)); + trackGrew = true; } /*if (m_takenTrackDateTimes.size() >= 2) { @@ -583,74 +1091,12 @@ void ObjectMapItem::updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, M } }*/ - if ((m_takenTrackPositionExtrapolated.size() > 0) && (prevSize != m_takenTrackPositionExtrapolated.size())) - { - const int filterLen = itemSettings->m_smoothingWindow; - if ((filterLen > 0) && (m_takenTrackCoords.size() >= filterLen) && (m_takenTrackCoords.size() % (filterLen/2)) == 0) - { - // Filter last filterLen coords - QVector<double> x(filterLen); - QVector<double> y1(filterLen); - QVector<double> y2(filterLen); - QVector<double> y3(filterLen); - QVector<double> w1(filterLen); - QVector<double> w3(filterLen); - - //qDebug() << "Filter from" << (m_takenTrackCoords.size() - (filterLen - 0)) << "to" << (m_takenTrackCoords.size() - 1); - for (int i = 0; i < filterLen; i++) - { - int idx = m_takenTrackCoords.size() - (filterLen - i); - x[i] = (m_takenTrackDateTimes[idx]->toMSecsSinceEpoch() - m_takenTrackDateTimes[0]->toMSecsSinceEpoch()) / 1000.0; - y1[i] = m_takenTrackCoords[idx]->latitude(); - y2[i] = m_takenTrackCoords[idx]->longitude(); - y3[i] = m_takenTrackCoords[idx]->altitude(); - if (i < (filterLen / 4)) - { - w1[i] = 10.0; // Try to avoid discontinuities between windows - w3[i] = 10.0; - } - else if (i == filterLen - 1) - { - w1[i] = 1.0; - w3[i] = 1.0; - } - else - { - w1[i] = m_takenTrackPositionExtrapolated[idx] ? 0.0 : 1.0; - w3[i] = m_takenTrackAltitudeExtrapolated[idx] ? 0.0 : 1.0; - } - } - - const double lambda = itemSettings->m_smoothingLambda; - m_filter.filter(x.data(), y1.data(), w1.data(), filterLen, lambda); - m_filter.filter(x.data(), y2.data(), w1.data(), filterLen, lambda); - m_filter.filter(x.data(), y3.data(), w3.data(), filterLen, lambda); - - for (int i = 0; i < filterLen; i++) - { - int idx = m_takenTrackCoords.size() - (filterLen - i); - m_takenTrackCoords[idx]->setLatitude(y1[i]); - m_takenTrackCoords[idx]->setLongitude(y2[i]); - m_takenTrackCoords[idx]->setAltitude(y3[i]); - m_takenTrackPositionExtrapolated[idx] = false; - m_takenTrackAltitudeExtrapolated[idx] = false; - if (!onlyActual2D) { - m_takenTrack[idx] = QVariant::fromValue(QGeoCoordinate(y1[i], y2[i], y3[i])); - } - - m_interpolatedCoords.append(m_takenTrackCoords[idx]); - m_interpolatedDateTimes.append(m_takenTrackDateTimes[idx]); - } - - // Update current position - Don't do this, as it can make aircraft move backwards on 2D map - if (!onlyActual2D) - { - m_latitude = m_takenTrackCoords.back()->latitude(); - m_longitude = m_takenTrackCoords.back()->longitude(); - m_altitude = m_takenTrackCoords.back()->altitude(); - } - } - } + } + // The same robust, non-destructive smoothing as a sender-owned track. It rejects + // duplicate/ill-conditioned time windows and gaps in coverage, and leaves the + // raw geometry used by the 2D map untouched. + if (trackGrew) { + smoothTrack(itemSettings); } } } @@ -677,4 +1123,3 @@ void ObjectMapItem::updatePredictedTrack(QList<SWGSDRangel::SWGMapCoordinate *> } } } - diff --git a/plugins/feature/map/mapitem.h b/plugins/feature/map/mapitem.h index b2b1aa177..3b50f0e56 100644 --- a/plugins/feature/map/mapitem.h +++ b/plugins/feature/map/mapitem.h @@ -32,6 +32,7 @@ class MapModel; class ObjectMapModel; +class TrackColorModel; class PolygonMapModel; class PolylineMapModel; class ImageMapModel; @@ -43,6 +44,33 @@ public: MapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem); virtual ~MapItem() = default; + + // What has changed about this item since the model last told the map about it. + // Lets us tell the map which roles to re-read, rather than all of them + enum Change : quint32 { + ChangedPosition = 1u << 0, + ChangedLabel = 1u << 1, + ChangedImage = 1u << 2, + ChangedText = 1u << 3, // Bubble text, and the frequencies in it + ChangedTrack = 1u << 4, + ChangedPredictedTrack = 1u << 5, + ChangedGeometry = 1u << 6, // Polygon/polyline points and bounds + ChangedSelection = 1u << 7, // Selected or targeted in the GUI + ChangedZOrder = 1u << 9, // Moved in front of or behind other items + Changed3D = 1u << 8, // Only of interest to the 3D map + ChangedAll = 0xffffffffu + }; + + quint32 m_changed = ChangedAll; // Set by update(), consumed by the model's flush + + // What the map draws this item in front of. Qt Quick orders siblings by z, and map + // items are plain QQuickItems, so this is all it takes to raise or lower one + qreal m_zOrder = 0.0; + + // Row this item is at in the model it belongs to, or -1 if it isn't in one. + // Saves a linear search of the model, which holds every airport and navaid in the + // world as well as the objects we're currently hearing + int m_row = -1; virtual void update(SWGSDRangel::SWGMapItem *mapItem); QGeoCoordinate getCoordinates(); @@ -71,11 +99,16 @@ protected: // Information required about each item displayed on the map class ObjectMapItem : public MapItem { - +public: + //!< Taken off the map, which an empty image is how a sender says. A polygon and a + //!< polyline have carried this for a while; an object did not, so the 3D map was + //!< never told and every marker a removed item had drawn stayed on it. + bool m_deleted = false; public: ObjectMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) : MapItem(sourcePipe, group, itemSettings, mapItem), - m_aircraftState(nullptr) + m_aircraftState(nullptr), + m_trackColorModel(nullptr) { update(mapItem); } @@ -85,6 +118,7 @@ public: delete m_aircraftState; qDeleteAll(m_takenTrackCoords); qDeleteAll(m_takenTrackDateTimes); + delete m_trackColorModel; } void update(SWGSDRangel::SWGMapItem *mapItem) override; @@ -92,12 +126,16 @@ public: protected: void findFrequencies(); void updateTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track, MapSettings::MapItemSettings *itemSettings); + void smoothTrack(MapSettings::MapItemSettings *itemSettings); + void updateProvisionalTrackPoint(); + void dropProvisionalTrackPoint(); void updatePredictedTrack(QList<SWGSDRangel::SWGMapCoordinate *> *track); void extrapolatePosition(QGeoCoordinate *c, const QDateTime& dateTime); void extrapolateAltitude(QGeoCoordinate *c, const QDateTime& dateTime); void interpolatePosition(int i, const float latitude, const float longitude, const QDateTime &dateTime); void interpolateAltitude(int i, const float altitude, const QDateTime &dateTime); + friend MapModel; friend ObjectMapModel; friend CZML; QDateTime m_positionDateTime; @@ -109,6 +147,10 @@ protected: QDateTime m_orientationDateTime; QString m_image; int m_imageRotation; + // 2D icon showing the livery of the matched 3D model (e.g. A320 in British Airways + // colours), for when the user prefers those to the plain icons in m_image. + // Empty when there is no model or no livery icon matching it + QString m_liveryImage; QString m_text; QList<qint64> m_frequencies; // Frequencies that can be tuned (currently only extracted from text) QStringList m_frequencyStrings; @@ -124,15 +166,56 @@ protected: QGeoCoordinate m_predictedEnd2; QList<QGeoCoordinate *> m_takenTrackCoords; QList<QDateTime *> m_takenTrackDateTimes; + // Exact strings received with a supplied track. They make the cheap prefix check in + // updateTrack() sensitive to timestamp corrections without reparsing every old point. + QList<QString> m_takenTrackDateTimeStrings; QList<bool> m_takenTrackPositionExtrapolated; QList<bool> m_takenTrackAltitudeExtrapolated; + // Incremented when points already presented to the Map are rewritten. Appends are + // deliberately excluded so the 2D and 3D segment caches can retain their fast path. + quint64 m_takenTrackRevision = 0; + // Longitude range of the taken track, so splitTrack() can skip tracks that are + // wholly on screen. Extended as points are appended, recomputed if it is rebuilt + double m_takenTrackMinLongitude = 180.0; + double m_takenTrackMaxLongitude = -180.0; + int m_takenTrackBoundsCount = 0; // Points the bounds above account for + bool m_trackSupplied = false; // The sender owns this track - see updateTrack() + bool m_trackProvisional = false; // Last point is the live position, not the sender's + + void updateTakenTrackBounds(); + + bool m_tracked = false; // In the model's list of items that have a track + bool m_takenTrackWholeOnScreen = false; // Whether the last split found the whole track on screen + + // Taken track split in to runs of constant colour, when coloured by altitude + QList<QVariantList> m_trackSegments; + QList<QVariant> m_trackSegmentColors; + QString m_trackSegmentPalette; // Palette they were built with + int m_trackSegmentPoints = 0; // Points of m_takenTrack1 they account for + int m_trackSegmentLastColor = -1; + QGeoCoordinate m_trackSegmentLastCoord; // Detect an in-place provisional tail update + quint64 m_trackSegmentRevision = 0; + QVariantList m_takenTrack; // Line showing where the object has been QVariantList m_takenTrack1; QVariantList m_takenTrack2; + TrackColorModel *m_trackColorModel; // m_takenTrack1 and 2 split in to segments of constant colour, when coloured by altitude QGeoCoordinate m_takenStart1; QGeoCoordinate m_takenStart2; QGeoCoordinate m_takenEnd1; QGeoCoordinate m_takenEnd2; + // The smoothed tail of a track. Owned here, and pointed at by + // m_interpolatedCoords, which the 3D map reads and then clears - see + // smoothTrack() + int m_lastSmoothedSize = 0; // Track length when smoothing last ran + QList<QGeoCoordinate> m_smoothedWindow; + QList<QDateTime> m_smoothedWindowTimes; + // The smoothed shadow of a track, aligned with m_takenTrackCoords: raw + // values where no smoothing pass has reached yet, overwritten as windows complete. + // The stored track itself stays raw (and, for a supplied track, exactly as sent), so + // the 3D map's altitude coloured segments draw from this instead. + // Empty when smoothing is off - the segments then draw the raw track. + QList<QGeoCoordinate> m_smoothedTrackCoords; QList<QGeoCoordinate *> m_interpolatedCoords; QList<QDateTime *> m_interpolatedDateTimes; @@ -143,6 +226,13 @@ protected: float m_modelAltitudeOffset; QList<CesiumInterface::Animation *> m_animations; MapAircraftState *m_aircraftState; + // Engine sound-set directory below 3d/Sounds, or a legacy bundled audio file. + QString m_loopSound; // Empty for none + // Fast replay sends PFD state immediately but lets the ordinary model flush send + // the accumulated altitude-coloured track once per batch. These flags keep those + // two jobs separate, so replay does not serialize the growing track for every frame. + bool m_replayStateUpdate = false; + bool m_replayTrackPending = false; static WhittakerEilers m_filter; // For smoothing/interpolating position }; @@ -168,14 +258,15 @@ protected: bool m_colorValid; QRgb m_color; int m_altitudeReference; - bool m_deleted; + bool m_deleted = false; }; class PolylineMapItem : public MapItem { public: PolylineMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) : - MapItem(sourcePipe, group, itemSettings, mapItem) + MapItem(sourcePipe, group, itemSettings, mapItem), + m_trackColorModel(nullptr) { update(mapItem); } @@ -190,8 +281,14 @@ protected: QGeoRectangle m_bounds; // Bounding boxes for the polyline, for view clipping bool m_colorValid; QRgb m_color; + // Item type 4: drawn as a series of lines coloured by the altitude of their points, + // the way an object's ground track is, rather than in one colour. That lets a track + // with no aircraft on it - an archived flight, say - still be drawn as a track. The + // segments are built by PolylineMapModel, which is where the palette lives. + bool m_altitudeColored; + TrackColorModel *m_trackColorModel; int m_altitudeReference; - bool m_deleted; + bool m_deleted = false; }; class ImageMapItem : public MapItem { @@ -215,4 +312,3 @@ protected: }; #endif // INCLUDE_FEATURE_MAPITEM_H_ - diff --git a/plugins/feature/map/mapmodel.cpp b/plugins/feature/map/mapmodel.cpp index 2c2d6ae4e..a59163c3f 100644 --- a/plugins/feature/map/mapmodel.cpp +++ b/plugins/feature/map/mapmodel.cpp @@ -19,6 +19,9 @@ #include <QGeoRectangle> #include "channel/channelwebapiutils.h" +#include "util/flightpathpalette.h" +#include "util/units.h" +#include "util/profiler.h" #include "maincore.h" #include "mapmodel.h" @@ -26,6 +29,7 @@ #include "map.h" #include "SWGTargetAzimuthElevation.h" +#include "SWGMapAircraftState.h" QVariant MapModel::data(const QModelIndex &index, int role) const { @@ -73,7 +77,10 @@ bool MapModel::setData(const QModelIndex &index, const QVariant& value, int role void MapModel::add(MapItem *item) { beginInsertRows(QModelIndex(), rowCount(), rowCount()); + item->m_row = m_items.size(); m_items.append(item); + m_filterData.append(FilterData()); + fillFilterData(item, m_filterData.last()); m_itemsHash.insert(item->m_hashKey, item); endInsertRows(); } @@ -99,6 +106,24 @@ void MapModel::update(const QObject *sourcePipe, SWGSDRangel::SWGMapItem *swgMap { // Update the item item->update(swgMapItem); + // Explicitly timestamped aircraft states are replay samples. They must + // reach CZML now: the ordinary model flush deliberately coalesces every + // update to an item, which would otherwise retain only the last PFD state + // from a fast ADS-B log load. The item remains dirty so the 2D map can + // still redraw once per normal batch. + SWGSDRangel::SWGMapAircraftState *aircraftState = swgMapItem->getAircraftState(); + if (aircraftState && aircraftState->getDateTime() + && !aircraftState->getDateTime()->isEmpty()) + { + ObjectMapItem *objectItem = dynamic_cast<ObjectMapItem *>(item); + if (objectItem) + { + objectItem->m_replayTrackPending = true; + objectItem->m_replayStateUpdate = true; + update3D(item); + objectItem->m_replayStateUpdate = false; + } + } update(item); } } @@ -119,23 +144,182 @@ void MapModel::update(const QObject *sourcePipe, SWGSDRangel::SWGMapItem *swgMap void MapModel::update(MapItem *item) { - int row = m_items.indexOf(item); - if (row >= 0) + markDirty(item, item->m_changed); +} + +// The expensive tests - the user's name regex and the great-circle distance to the +// station - are done here, once per change to an item, rather than once per item every +// time the map moves +void MapModel::fillFilterData(MapItem *item, FilterData& data) const +{ + const MapSettings::MapItemSettings *itemSettings = item->m_itemSettings; + + data.m_latitude = item->m_latitude; + data.m_longitude = item->m_longitude; + data.m_minZoom = itemSettings->m_2DMinZoom; + data.m_flags = 0; + + if (itemSettings->m_enabled) { + data.m_flags |= FilterEnabled; + } + if (itemSettings->m_display2DIcon) { + data.m_flags |= FilterDisplayIcon; + } + if (itemSettings->m_filterName.isEmpty() || itemSettings->m_filterNameRE.match(item->m_name).hasMatch()) { + data.m_flags |= FilterNameMatches; + } + if (itemSettings->m_filterDistance <= 0) { - QModelIndex idx = index(row); - emit dataChanged(idx, idx); + data.m_flags |= FilterDistanceOk; + } + else if (m_stationPosition.isValid()) + { + const QGeoCoordinate position(item->m_latitude, item->m_longitude); + if (m_stationPosition.distanceTo(position) <= itemSettings->m_filterDistance) { + data.m_flags |= FilterDistanceOk; + } } } +void MapModel::updateFilterData(int row) +{ + if ((row >= 0) && (row < m_filterData.size())) { + fillFilterData(m_items[row], m_filterData[row]); + } +} + +void MapModel::rebuildFilterData() +{ + m_filterData.resize(m_items.size()); + for (int row = 0; row < m_items.size(); row++) { + fillFilterData(m_items[row], m_filterData[row]); + } +} + +void MapModel::setStationPosition(const QGeoCoordinate& position) +{ + m_stationPosition = position; + rebuildFilterData(); +} + +void MapModel::markDirty(MapItem *item, quint32 changed) +{ + if (item->m_row >= 0) + { + m_dirty[item] |= changed; + // Kept in step here rather than at flush time, so that a pan in between the two + // filters on where the item actually is + updateFilterData(item->m_row); + } +} + +// Tell the map about everything that has changed since the last time, coalescing runs of +// neighbouring rows that changed in the same way in to a single signal +void MapModel::flush() +{ + if (m_dirty.isEmpty()) { + return; + } + + const quint32 of3DInterest = MapItem::ChangedPosition | MapItem::ChangedLabel + | MapItem::ChangedImage | MapItem::ChangedText + | MapItem::ChangedGeometry | MapItem::ChangedSelection + | MapItem::Changed3D; + + // Bracketed around the whole loop rather than per item: PROFILER_STOP takes a global + // mutex, and the per item cost is already covered by Map CZML. This gives what the 3D + // map costs per flush, which is the figure to compare against Map flush. + PROFILER_START() + CesiumInterface *cesium = m_gui->cesium(); + const bool batching = cesium && cesium->isConnected(); + if (batching) { + cesium->beginBatch(); + } + for (auto it = m_dirty.cbegin(); it != m_dirty.cend(); ++it) + { + updateFilterData(it.key()->m_row); + + quint32 interest = of3DInterest; + // With a track palette set - or smoothing on - the 3D map draws the track + // itself as polylines, so track changes matter to it. Per item rather than in + // the mask above: everything else's 3D track is drawn by Cesium from the + // position samples, and needs no update when the track changes. + if ( !it.key()->m_itemSettings->m_2DTrackPalette.isEmpty() + || (it.key()->m_itemSettings->m_smoothingWindow > 0)) { + interest |= MapItem::ChangedTrack | MapItem::ChangedPredictedTrack; + } + if (it.value() & interest) { + update3D(it.key()); + } + } + if (batching) { + cesium->endBatch(); + } + PROFILER_STOP("Map 3D update") + + QVector<QPair<int, quint32>> pending; + pending.reserve(m_dirty.size()); + for (auto it = m_dirty.cbegin(); it != m_dirty.cend(); ++it) + { + if (it.key()->m_row >= 0) { + pending.append(qMakePair(it.key()->m_row, it.value())); + } + } + m_dirty.clear(); + std::sort(pending.begin(), pending.end()); + + for (int i = 0; i < pending.size(); ) + { + const quint32 changed = pending[i].second; + int last = i; + while ((last + 1 < pending.size()) + && (pending[last + 1].second == changed) + && (pending[last + 1].first == pending[last].first + 1)) { + last++; + } + emit dataChanged(index(pending[i].first), index(pending[last].first), rolesFor(changed)); + i = last + 1; + } +} + +QVector<int> MapModel::rolesFor(quint32 changed) const +{ + if (changed == MapItem::ChangedAll) { + return QVector<int>(); // All of them + } + + if (m_roleCache.contains(changed)) { + return m_roleCache.value(changed); + } + + QVector<int> roles; + if (changed & MapItem::ChangedPosition) { + roles.append(positionRole); + } + if (changed & (MapItem::ChangedLabel | MapItem::ChangedText | MapItem::ChangedSelection)) { + roles.append(labelRole); + } + m_roleCache.insert(changed, roles); + + return roles; +} + void MapModel::remove(MapItem *item) { - int row = m_items.indexOf(item); + int row = item->m_row; if (row >= 0) { QString key = m_items[row]->m_hashKey; beginRemoveRows(QModelIndex(), row, row); m_items.removeAt(row); + m_filterData.remove(row); m_itemsHash.remove(key); + m_dirty.remove(item); + item->m_row = -1; + // Everything after it has moved up one + for (int i = row; i < m_items.size(); i++) { + m_items[i]->m_row = i; + } endRemoveRows(); } } @@ -145,8 +329,13 @@ void MapModel::removeAll() if (m_items.count() > 0) { beginRemoveRows(QModelIndex(), 0, m_items.count() - 1); + for (auto item : m_items) { + item->m_row = -1; + } + m_dirty.clear(); qDeleteAll(m_items); m_items.clear(); + m_filterData.clear(); m_itemsHash.clear(); endRemoveRows(); } @@ -162,12 +351,37 @@ void MapModel::updateItemSettings(QHash<QString, MapSettings::MapItemSettings *> item->m_itemSettings = m_itemSettings[item->m_group]; } } + rebuildFilterData(); } void MapModel::allUpdated() { - if (m_items.count() > 0) { + // Settings are what most of the filter data is derived from, and this is called + // whenever they change + rebuildFilterData(); + + if (m_items.count() > 0) + { emit dataChanged(index(0), index(m_items.count()-1)); + + // The 3D map is no longer driven by dataChanged, so it has to be told here. + // update3D() returns immediately when the 3D map isn't running. + // + // Batched, because this walks EVERY item - of the order of 200,000 once the + // airport, navaid, airspace and waypoint databases are loaded. Most of them will + // produce nothing at all now that an unchanged item emits only its id, but the + // ones that do produce something should still travel together. + CesiumInterface *cesium = m_gui->cesium(); + const bool batching = cesium && cesium->isConnected(); + if (batching) { + cesium->beginBatch(); + } + for (auto item : m_items) { + update3D(item); + } + if (batching) { + cesium->endBatch(); + } } } @@ -222,15 +436,6 @@ QHash<int, QByteArray> MapModel::roleNames() const } // Slot called on dataChanged signal, to update 3D map -void MapModel::update3DMap(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) -{ - (void) roles; - - for (int row = topLeft.row(); row <= bottomRight.row(); row++) { - update3D(m_items[row]); - } -} - MapItem *ImageMapModel::newMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) { return new ImageMapItem(sourcePipe, group, itemSettings, mapItem); @@ -256,6 +461,18 @@ QVariant ImageMapModel::data(const QModelIndex &index, int role) const } } +// These items have an extent, so the filter tests that rather than a single position +void ImageMapModel::fillFilterData(MapItem *item, FilterData& data) const +{ + MapModel::fillFilterData(item, data); + + const QGeoRectangle& bounds = ((const ImageMapItem *) item)->m_bounds; + data.m_boundsTop = bounds.topLeft().latitude(); + data.m_boundsBottom = bounds.bottomRight().latitude(); + data.m_boundsLeft = bounds.topLeft().longitude(); + data.m_boundsRight = bounds.bottomRight().longitude(); +} + void ImageMapModel::update3D(MapItem *item) { CesiumInterface *cesium = m_gui->cesium(); @@ -324,6 +541,18 @@ QVariant PolygonMapModel::data(const QModelIndex &index, int role) const } } +// These items have an extent, so the filter tests that rather than a single position +void PolygonMapModel::fillFilterData(MapItem *item, FilterData& data) const +{ + MapModel::fillFilterData(item, data); + + const QGeoRectangle& bounds = ((const PolygonMapItem *) item)->m_bounds; + data.m_boundsTop = bounds.topLeft().latitude(); + data.m_boundsBottom = bounds.bottomRight().latitude(); + data.m_boundsLeft = bounds.topLeft().longitude(); + data.m_boundsRight = bounds.bottomRight().longitude(); +} + void PolygonMapModel::update3D(MapItem *item) { CesiumInterface *cesium = m_gui->cesium(); @@ -334,7 +563,76 @@ void PolygonMapModel::update3D(MapItem *item) MapItem *PolylineMapModel::newMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) { - return new PolylineMapItem(sourcePipe, group, itemSettings, mapItem); + PolylineMapItem *item = new PolylineMapItem(sourcePipe, group, itemSettings, mapItem); + // Before it is added, because adding it is what makes the map read its roles - an + // item is only marked dirty when it CHANGES, so a new one would never reach flush() + updateTrackSegments(item); + return item; +} + +// A line drawn as a track is split in to runs of constant colour, the colour of each point +// coming from its altitude and the group's palette. The same mapping an object's ground +// track uses, so a track drawn on its own looks like one drawn under an aircraft. +void PolylineMapModel::updateTrackSegments(PolylineMapItem *item) +{ + const QString& paletteName = item->m_itemSettings->m_2DTrackPalette; + + if (!item->m_altitudeColored || paletteName.isEmpty()) + { + // Drawn in a single colour instead, by the plain polyline delegate + if (item->m_trackColorModel) { + item->m_trackColorModel->clear(); + } + return; + } + + const QVariant *palette = FlightPathPalette::getPalette(paletteName); + QList<QVariantList> segments; + QList<QVariant> colors; + int lastColor = -1; + + for (const QVariant& point : item->m_polyline) + { + const QGeoCoordinate coord = point.value<QGeoCoordinate>(); + const int colorIndex = FlightPathPalette::getColorIndex(Units::metresToFeet(coord.altitude())); + + if (colorIndex != lastColor) + { + // Repeat the point the colour changes at in the segment that ends there, so + // there's no gap between the two + if (lastColor >= 0) { + segments.last().append(point); + } + segments.append(QVariantList()); + colors.append(palette[colorIndex]); + lastColor = colorIndex; + } + segments.last().append(point); + } + + if (!item->m_trackColorModel) { + item->m_trackColorModel = new TrackColorModel(); + } + // No firstChanged: unlike a ground track, which grows a point at a time, a line is + // re-sent whole whenever it changes at all + item->m_trackColorModel->update(segments, colors); +} + +void PolylineMapModel::flush() +{ + for (auto it = m_dirty.cbegin(); it != m_dirty.cend(); ++it) { + updateTrackSegments((PolylineMapItem *) it.key()); + } + MapModel::flush(); +} + +// The palette is a setting, so a change to it recolours every line already drawn +void PolylineMapModel::allUpdated() +{ + for (auto item : m_items) { + updateTrackSegments((PolylineMapItem *) item); + } + MapModel::allUpdated(); } QVariant PolylineMapModel::data(const QModelIndex &index, int role) const @@ -353,7 +651,17 @@ QVariant PolylineMapModel::data(const QModelIndex &index, int role) const return QVariant::fromValue(QColor::fromRgba(polylineItem->m_itemSettings->m_2DTrackColor)); } case coordinatesRole: + // Nothing for the plain delegate to draw when the segments are drawing it, or the + // two would be drawn one on top of the other and the single colour would win + if (polylineItem->m_trackColorModel && (polylineItem->m_trackColorModel->rowCount() > 0)) { + return QVariant::fromValue(QVariantList()); + } return QVariant::fromValue(polylineItem->m_polyline); + case trackModelRole: + if (polylineItem->m_trackColorModel) { + return QVariant::fromValue(polylineItem->m_trackColorModel); + } + return QVariant::fromValue(&m_noTrackColors); case boundsRole: return QVariant::fromValue(polylineItem->m_bounds); default: @@ -361,6 +669,18 @@ QVariant PolylineMapModel::data(const QModelIndex &index, int role) const } } +// These items have an extent, so the filter tests that rather than a single position +void PolylineMapModel::fillFilterData(MapItem *item, FilterData& data) const +{ + MapModel::fillFilterData(item, data); + + const QGeoRectangle& bounds = ((const PolylineMapItem *) item)->m_bounds; + data.m_boundsTop = bounds.topLeft().latitude(); + data.m_boundsBottom = bounds.bottomRight().latitude(); + data.m_boundsLeft = bounds.topLeft().longitude(); + data.m_boundsRight = bounds.bottomRight().longitude(); +} + void PolylineMapModel::update3D(MapItem *item) { CesiumInterface *cesium = m_gui->cesium(); @@ -369,6 +689,63 @@ void PolylineMapModel::update3D(MapItem *item) } } +void ObjectMapModel::allUpdated() +{ + for (auto item : m_items) { + updateTrackSegments((ObjectMapItem *) item); + } + MapModel::allUpdated(); +} + +QVariant TrackColorModel::data(const QModelIndex& index, int role) const +{ + int row = index.row(); + + if ((row < 0) || (row >= m_segments.size())) { + return QVariant(); + } + + if (role == segmentCoordinatesRole) { + return m_segments[row]; + } else if (role == segmentColorRole) { + return m_colors[row]; + } + + return QVariant(); +} + +void TrackColorModel::update(const QList<QVariantList>& segments, const QList<QVariant>& colors, int firstChanged) +{ + if (segments.size() == m_segments.size()) + { + // Same segments as last time, just longer or shorter, so update them in place + // rather than having the map delete and recreate a polyline for each one + m_segments = segments; + m_colors = colors; + if (!m_segments.isEmpty() && (firstChanged < m_segments.size())) { + emit dataChanged(index(qMax(0, firstChanged)), index(m_segments.size() - 1)); + } + } + else + { + beginResetModel(); + m_segments = segments; + m_colors = colors; + endResetModel(); + } +} + +void TrackColorModel::clear() +{ + if (!m_segments.isEmpty()) + { + beginResetModel(); + m_segments.clear(); + m_colors.clear(); + endResetModel(); + } +} + ObjectMapModel::ObjectMapModel(MapGUI *gui) : MapModel(gui), m_target(-1), @@ -376,7 +753,9 @@ ObjectMapModel::ObjectMapModel(MapGUI *gui) : m_displaySelectedGroundTracks(false), m_displayAllGroundTracks(false), m_bottomLeftLongitude(0.0), - m_bottomRightLongitude(0.0) + m_bottomRightLongitude(0.0), + m_frontZOrder(0.0), + m_backZOrder(0.0) { //connect(this, &ObjectMapModel::dataChanged, this, &ObjectMapModel::update3DMap); } @@ -439,6 +818,11 @@ void ObjectMapModel::update3D(MapItem *item) { ObjectMapItem *objectMapItem = (ObjectMapItem *)item; cesium->update(objectMapItem, isTarget(objectMapItem), isSelected3D(objectMapItem)); + // An immediate replay-state update intentionally skipped track serialization. + // The normal batched update clears the debt after sending the complete tail. + if (!objectMapItem->m_replayStateUpdate) { + objectMapItem->m_replayTrackPending = false; + } playAnimations(objectMapItem); } } @@ -475,22 +859,143 @@ void ObjectMapModel::playAnimations(ObjectMapItem *item) void ObjectMapModel::update(MapItem *item) { - splitTracks((ObjectMapItem *)item); + // The track split and the target azimuth/elevation are done in flush(), so they + // happen once per batch rather than once per message MapModel::update(item); - int row = m_items.indexOf(item); - if (row >= 0) +} + +// An object that is off screen is still drawn if its track might be on screen +void ObjectMapModel::fillFilterData(MapItem *item, FilterData& data) const +{ + MapModel::fillFilterData(item, data); + + const ObjectMapItem *objectItem = (const ObjectMapItem *) item; + const bool selected = (item->m_row >= 0) && (item->m_row < m_selected.size()) && m_selected[item->m_row]; + + // Based on the split of the track that actually gets drawn, so that this keeps the + // same set of items on the map as before. The split is redone when the batch is + // flushed, so this can lag what the item holds by one flush - only ever for an item + // that is off screen, whose track isn't drawable until that flush anyway + if ( (m_displayAllGroundTracks || (m_displaySelectedGroundTracks && selected)) + && ( (objectItem->m_predictedTrack1.size() > 1) + || (objectItem->m_predictedTrack2.size() > 1) + || (objectItem->m_takenTrack1.size() > 1) + || (objectItem->m_takenTrack2.size() > 1))) { + data.m_flags |= FilterHasTracks; + } +} + +void ObjectMapModel::flush() +{ + if (!hasDirtyItems()) { + return; + } + + bool targetMoved = false; + ObjectMapItem *targetItem = nullptr; + + for (auto it = m_dirty.cbegin(); it != m_dirty.cend(); ++it) { - if (row == m_target) { - updateTarget(); + ObjectMapItem *item = (ObjectMapItem *) it.key(); + + if (it.value() & (MapItem::ChangedTrack | MapItem::ChangedPredictedTrack)) { + splitTracks(item); } + if (item->m_row == m_target) + { + targetMoved = true; + targetItem = item; + } + } + + if (targetMoved) + { + updateTarget(); + // The target's label carries the azimuth, elevation, range and coordinates that + // updateTarget() has just recomputed, so for THIS row a change of position is a + // change of label as well. Saying so in rolesFor() instead would reassign the + // label of every moving item on every flush, which is the cost that scoping the + // roles exists to avoid - here it is one row, once a flush. Safe after the loop + // above has finished, and picked up by the flush below. + markDirty(targetItem, MapItem::ChangedLabel); } + + MapModel::flush(); +} + +QVector<int> ObjectMapModel::rolesFor(quint32 changed) const +{ + if (changed == MapItem::ChangedAll) { + return QVector<int>(); // All of them + } + + if (m_roleCache.contains(changed)) { + return m_roleCache.value(changed); + } + + QVector<int> roles; + + if (changed & MapItem::ChangedPosition) { + roles.append(positionRole); + } + if (changed & (MapItem::ChangedLabel | MapItem::ChangedText | MapItem::ChangedSelection)) { + roles.append(labelRole); + roles.append(mapTextVisibleRole); + } + if (changed & MapItem::ChangedText) + { + roles.append(frequenciesRole); + roles.append(frequencyStringsRole); + } + if (changed & MapItem::ChangedImage) + { + roles.append(mapImageRole); + roles.append(mapImageRotationRole); + roles.append(mapImageVisibleRole); + } + if (changed & MapItem::ChangedZOrder) { + roles.append(zOrderRole); + } + if (changed & MapItem::ChangedSelection) + { + roles.append(selectedRole); + roles.append(targetRole); + roles.append(bubbleColourRole); + } + // Which tracks are drawn depends on what is selected, as well as on the track itself + if (changed & (MapItem::ChangedTrack | MapItem::ChangedSelection)) + { + roles.append(groundTrack1Role); + roles.append(groundTrack2Role); + roles.append(groundTrackModelRole); + roles.append(groundTrackColorRole); + } + if (changed & (MapItem::ChangedPredictedTrack | MapItem::ChangedSelection)) + { + roles.append(predictedGroundTrack1Role); + roles.append(predictedGroundTrack2Role); + roles.append(predictedGroundTrackColorRole); + } + if (changed & (MapItem::ChangedTrack | MapItem::ChangedPredictedTrack | MapItem::ChangedSelection)) { + roles.append(hasTracksRole); + } + + m_roleCache.insert(changed, roles); + + return roles; } void ObjectMapModel::remove(MapItem *item) { - int row = m_items.indexOf(item); + int row = item->m_row; if (row >= 0) { + ObjectMapItem *objectItem = (ObjectMapItem *) item; + if (objectItem->m_tracked) + { + m_trackedItems.removeOne(objectItem); + objectItem->m_tracked = false; + } m_selected.removeAt(row); if (row == m_target) { m_target = -1; @@ -503,6 +1008,10 @@ void ObjectMapModel::remove(MapItem *item) void ObjectMapModel::removeAll() { + for (auto item : m_trackedItems) { + item->m_tracked = false; + } + m_trackedItems.clear(); MapModel::removeAll(); m_selected.clear(); } @@ -532,6 +1041,8 @@ QHash<int, QByteArray> ObjectMapModel::roleNames() const roles[groundTrackColorRole] = "groundTrackColor"; roles[predictedGroundTrackColorRole] = "predictedGroundTrackColor"; roles[hasTracksRole] = "hasTracks"; + roles[groundTrackModelRole] = "groundTrackModel"; + roles[zOrderRole] = "zOrder"; return roles; } @@ -580,55 +1091,26 @@ bool ObjectMapModel::isTarget(const ObjectMapItem *mapItem) const } } -// FIXME: This should use Z order - rather than adding/removing -// but I couldn't quite get it to work -// Causes a crash with Qt 6.10+ -Q_INVOKABLE void ObjectMapModel::moveToFront(int oldRow) +Q_INVOKABLE void ObjectMapModel::moveToFront(int row) { -#if (QT_VERSION < QT_VERSION_CHECK(6, 10, 0)) - // Last item in list is drawn on top, so remove than add to end of list - if (oldRow < m_items.size() - 1) + if ((row >= 0) && (row < m_items.size())) { - bool wasTarget = m_target == oldRow; - ObjectMapItem *item = (ObjectMapItem *)m_items[oldRow]; - bool wasSelected = m_selected[oldRow]; - remove(item); - add(item); - int newRow = m_items.size() - 1; - if (wasTarget) { - m_target = newRow; - } - m_selected[newRow] = wasSelected; - QModelIndex idx = index(newRow); - emit dataChanged(idx, idx); + m_frontZOrder += 1.0; + m_items[row]->m_zOrder = m_frontZOrder; + markDirty(m_items[row], MapItem::ChangedZOrder); + flush(); } -#endif } -Q_INVOKABLE void ObjectMapModel::moveToBack(int oldRow) +Q_INVOKABLE void ObjectMapModel::moveToBack(int row) { -#if (QT_VERSION < QT_VERSION_CHECK(6, 10, 0)) - // First item in list is drawn first, so remove item then add to front of list - if ((oldRow < m_items.size()) && (oldRow > 0)) + if ((row >= 0) && (row < m_items.size())) { - bool wasTarget = m_target == oldRow; - int newRow = 0; - // See: https://forum.qt.io/topic/122991/changing-the-order-mapquickitems-are-drawn-on-a-map - //QModelIndex parent; - //beginMoveRows(parent, oldRow, oldRow, parent, newRow); - beginResetModel(); - m_items.move(oldRow, newRow); - m_selected.move(oldRow, newRow); - if (wasTarget) { - m_target = newRow; - } else if (m_target >= 0) { - m_target++; - } - //endMoveRows(); - endResetModel(); - //emit dataChanged(index(oldRow), index(newRow)); + m_backZOrder -= 1.0; + m_items[row]->m_zOrder = m_backZOrder; + markDirty(m_items[row], MapItem::ChangedZOrder); + flush(); } -#endif } Q_INVOKABLE void ObjectMapModel::link(const QString& url) @@ -676,7 +1158,11 @@ QVariant ObjectMapModel::data(const QModelIndex &index, int role) const case mapImageVisibleRole: return QVariant::fromValue(mapItem->m_itemSettings->m_display2DIcon); case mapImageRole: - return QVariant::fromValue(mapItem->m_image); // Set an image to use + // Set an image to use, preferring the livery icon when enabled and available + if (!mapItem->m_liveryImage.isEmpty() && m_gui->useLiveryIcons()) { + return QVariant::fromValue(mapItem->m_liveryImage); + } + return QVariant::fromValue(mapItem->m_image); case mapImageRotationRole: return QVariant::fromValue(mapItem->m_imageRotation); // Angle to rotate image by case bubbleColourRole: @@ -717,7 +1203,8 @@ QVariant ObjectMapModel::data(const QModelIndex &index, int role) const case groundTrack1Role: { if ( (m_displayAllGroundTracks || (m_displaySelectedGroundTracks && m_selected[row])) - && mapItem->m_itemSettings->m_display2DTrack) { + && mapItem->m_itemSettings->m_display2DTrack + && mapItem->m_itemSettings->m_2DTrackPalette.isEmpty()) { return mapItem->m_takenTrack1; } else { return QVariantList(); @@ -726,12 +1213,26 @@ QVariant ObjectMapModel::data(const QModelIndex &index, int role) const case groundTrack2Role: { if ( (m_displayAllGroundTracks || (m_displaySelectedGroundTracks && m_selected[row])) - && mapItem->m_itemSettings->m_display2DTrack) { + && mapItem->m_itemSettings->m_display2DTrack + && mapItem->m_itemSettings->m_2DTrackPalette.isEmpty()) { return mapItem->m_takenTrack2; } else { return QVariantList(); } } + case groundTrackModelRole: + { + if ( (m_displayAllGroundTracks || (m_displaySelectedGroundTracks && m_selected[row])) + && mapItem->m_itemSettings->m_display2DTrack + && !mapItem->m_itemSettings->m_2DTrackPalette.isEmpty() + && mapItem->m_trackColorModel) { + return QVariant::fromValue(mapItem->m_trackColorModel); + } else { + return QVariant::fromValue(&m_noTrackColors); + } + } + case zOrderRole: + return QVariant::fromValue(mapItem->m_zOrder); case groundTrackColorRole: return QVariant::fromValue(QColor::fromRgb(mapItem->m_itemSettings->m_2DTrackColor)); case predictedGroundTrackColorRole: @@ -759,7 +1260,8 @@ bool ObjectMapModel::setData(const QModelIndex &idx, const QVariant& value, int if (role == selectedRole) { m_selected[row] = value.toBool(); - emit dataChanged(idx, idx); + markDirty(m_items[row], MapItem::ChangedSelection); + flush(); return true; } else if (role == targetRole) @@ -767,13 +1269,13 @@ bool ObjectMapModel::setData(const QModelIndex &idx, const QVariant& value, int if (m_target >= 0) { // Update text bubble for old target - QModelIndex oldIdx = index(m_target); + markDirty(m_items[m_target], MapItem::ChangedSelection); m_target = -1; - emit dataChanged(oldIdx, oldIdx); } m_target = row; updateTarget(); - emit dataChanged(idx, idx); + markDirty(m_items[row], MapItem::ChangedSelection); + flush(); return true; } return true; @@ -787,12 +1289,14 @@ void ObjectMapModel::setDisplayNames(bool displayNames) void ObjectMapModel::setDisplaySelectedGroundTracks(bool displayGroundTracks) { + // Whether an off-screen item is kept for its track depends on this m_displaySelectedGroundTracks = displayGroundTracks; allUpdated(); } void ObjectMapModel::setDisplayAllGroundTracks(bool displayGroundTracks) { + // Whether an off-screen item is kept for its track depends on this m_displayAllGroundTracks = displayGroundTracks; allUpdated(); } @@ -824,16 +1328,129 @@ void ObjectMapModel::setFrequency(qint64 frequency, const QString& deviceSetId) void ObjectMapModel::splitTracks(ObjectMapItem *item) { - if (item->m_takenTrackCoords.size() > 1) + PROFILER_START() + if (!item->m_tracked && ((item->m_takenTrackCoords.size() > 1) || (item->m_predictedTrackCoords.size() > 1))) { - splitTrack(item->m_takenTrackCoords, item->m_takenTrack, item->m_takenTrack1, item->m_takenTrack2, - item->m_takenStart1, item->m_takenStart2, item->m_takenEnd1, item->m_takenEnd2); + item->m_tracked = true; + m_trackedItems.append(item); + } + const bool hasTaken = item->m_takenTrackCoords.size() > 1; + const bool hasPredicted = item->m_predictedTrackCoords.size() > 1; + + if (!hasTaken && !hasPredicted) + { + PROFILER_STOP("Map splitTracks") + return; } - if (item->m_predictedTrackCoords.size() > 1) + + const ViewLongitudes view = viewLongitudes(); + + if (hasTaken) { - splitTrack(item->m_predictedTrackCoords, item->m_predictedTrack, item->m_predictedTrack1, item->m_predictedTrack2, + splitTakenTrack(item, view); + updateTrackSegments(item); + } + if (hasPredicted) + { + splitTrack(view, item->m_predictedTrackCoords, item->m_predictedTrack, item->m_predictedTrack1, item->m_predictedTrack2, item->m_predictedStart1, item->m_predictedStart2, item->m_predictedEnd1, item->m_predictedEnd2); } + PROFILER_STOP("Map splitTracks") +} + +// Split the ground track in to segments of constant colour, so it can be drawn +// showing the altitude the object was at. The track has already been split where it +// crosses the edge of the map, so we split each of those parts again whenever the +// altitude moves in to a different band. +// Add points to the item's colour segments, starting a new segment wherever the altitude +// moves in to a different band +void ObjectMapModel::colorTrackPoints(ObjectMapItem *item, const QVariantList& track, int first, const QVariant *palette) +{ + for (int i = first; i < track.size(); i++) + { + const QVariant& point = track.at(i); + const QGeoCoordinate coord = point.value<QGeoCoordinate>(); + const int colorIndex = FlightPathPalette::getColorIndex(Units::metresToFeet(coord.altitude())); + + if (colorIndex != item->m_trackSegmentLastColor) + { + // Repeat the point the colour changes at in the segment that ends here, so + // there's no gap between the two + if (item->m_trackSegmentLastColor >= 0) { + item->m_trackSegments.last().append(point); + } + item->m_trackSegments.append(QVariantList()); + item->m_trackSegmentColors.append(palette[colorIndex]); + item->m_trackSegmentLastColor = colorIndex; + } + item->m_trackSegments.last().append(point); + } +} + +void ObjectMapModel::updateTrackSegments(ObjectMapItem *item) +{ + if (item->m_itemSettings->m_2DTrackPalette.isEmpty()) + { + // Not coloured by altitude - the track is drawn as a plain polyline instead + if (item->m_trackColorModel) { + item->m_trackColorModel->clear(); + } + item->m_trackSegmentPoints = 0; + item->m_trackSegmentLastCoord = QGeoCoordinate(); + item->m_trackSegmentRevision = item->m_takenTrackRevision; + return; + } + + PROFILER_START() + + const QString& paletteName = item->m_itemSettings->m_2DTrackPalette; + const QVariant *palette = FlightPathPalette::getPalette(paletteName); + + // Nothing before the last point we looked at can have changed if the whole track is + // on screen (so the split is just the track itself) and points have only been added + // to the end of it. Then we only have to colour what is new + const bool extend = item->m_takenTrackWholeOnScreen + && item->m_takenTrack2.isEmpty() + && (item->m_trackSegmentPoints > 0) + && (item->m_takenTrack1.size() >= item->m_trackSegmentPoints) + && (item->m_takenTrack1[item->m_trackSegmentPoints - 1].value<QGeoCoordinate>() + == item->m_trackSegmentLastCoord) + && (item->m_trackSegmentRevision == item->m_takenTrackRevision) + && (item->m_trackSegmentPalette == paletteName); + + if (!extend) + { + item->m_trackSegments.clear(); + item->m_trackSegmentColors.clear(); + item->m_trackSegmentPoints = 0; + item->m_trackSegmentLastColor = -1; + item->m_trackSegmentPalette = paletteName; + } + + // Colour the first part, continuing from where we left off if we can. Only the + // segment we carry on from, and anything after it, can have changed + const int firstChanged = extend ? qMax(0, (int) item->m_trackSegments.size() - 1) : 0; + + colorTrackPoints(item, item->m_takenTrack1, extend ? item->m_trackSegmentPoints : 0, palette); + item->m_trackSegmentPoints = item->m_takenTrack1.size(); + item->m_trackSegmentLastCoord = item->m_takenTrack1.isEmpty() + ? QGeoCoordinate() : item->m_takenTrack1.last().value<QGeoCoordinate>(); + item->m_trackSegmentRevision = item->m_takenTrackRevision; + + // The second part starts at the edge of the screen, so it doesn't join on to the + // first. It is only ever non-empty when the track had to be split, which is also + // when we rebuilt from scratch above + if (!item->m_takenTrack2.isEmpty()) + { + item->m_trackSegmentLastColor = -1; + colorTrackPoints(item, item->m_takenTrack2, 0, palette); + } + + if (!item->m_trackColorModel) { + item->m_trackColorModel = new TrackColorModel(); + } + item->m_trackColorModel->update(item->m_trackSegments, item->m_trackSegmentColors, firstChanged); + PROFILER_STOP("Map trackSegments") } void ObjectMapModel::interpolateEast(QGeoCoordinate *c1, QGeoCoordinate *c2, double x, QGeoCoordinate *ci, bool offScreen) @@ -987,7 +1604,59 @@ void ObjectMapModel::interpolate(QGeoCoordinate *c1, QGeoCoordinate *c2, double } } -void ObjectMapModel::splitTrack(const QList<QGeoCoordinate *>& coords, const QVariantList& track, +void ObjectMapModel::splitTakenTrack(ObjectMapItem *item, const ViewLongitudes& view) +{ + if (wholeTrackOnScreen(view, item->m_takenTrackMinLongitude, item->m_takenTrackMaxLongitude)) + { + // Nothing to split. The lists are implicitly shared, so this is just a pointer + // copy, rather than a walk over every point in the track + item->m_takenTrack1 = item->m_takenTrack; + item->m_takenTrack2.clear(); + item->m_takenTrackWholeOnScreen = true; + } + else + { + splitTrack(view, item->m_takenTrackCoords, item->m_takenTrack, item->m_takenTrack1, item->m_takenTrack2, + item->m_takenStart1, item->m_takenStart2, item->m_takenEnd1, item->m_takenEnd2); + item->m_takenTrackWholeOnScreen = false; + } +} + +// The split only exists to stop MapPolyline drawing lines that cross the edge of the map +// in the wrong place, so a track that is comfortably within what's on screen doesn't need +// it. The margin covers the last track point being moved slightly by extrapolation after +// the bounds were last extended +bool ObjectMapModel::wholeTrackOnScreen(const ViewLongitudes& view, double minLongitude, double maxLongitude) +{ + const double margin = 1.0; + + return !view.m_antimeridian + && (view.m_width < 360) + && (minLongitude - margin > view.m_bottomLeft) + && (maxLongitude + margin <= view.m_bottomRight); +} + +// Ask the map what it is showing. This is a synchronous call in to QML, so it's done +// once per pass over the items rather than once per track +ObjectMapModel::ViewLongitudes ObjectMapModel::viewLongitudes() const +{ + QQuickItem* map = m_gui->getMapItem(); + QVariant rectVariant; + QMetaObject::invokeMethod(map, "mapRect", Q_RETURN_ARG(QVariant, rectVariant)); + QGeoRectangle rect = qvariant_cast<QGeoRectangle>(rectVariant); + + ViewLongitudes view; + view.m_bottomLeft = rect.bottomLeft().longitude(); + view.m_bottomRight = rect.bottomRight().longitude(); + + view.m_width = round(rect.width()); + view.m_antimeridian = (view.m_width == 360) || (view.m_bottomLeft > view.m_bottomRight); + + return view; +} + +void ObjectMapModel::splitTrack(const ViewLongitudes& view, + const QList<QGeoCoordinate *>& coords, const QVariantList& track, QVariantList& track1, QVariantList& track2, QGeoCoordinate& start1, QGeoCoordinate& start2, QGeoCoordinate& end1, QGeoCoordinate& end2) @@ -1002,15 +1671,10 @@ void ObjectMapModel::splitTrack(const QList<QGeoCoordinate *>& coords, const QVa qDebug() << "Init T: " << l; */ - QQuickItem* map = m_gui->getMapItem(); - QVariant rectVariant; - QMetaObject::invokeMethod(map, "mapRect", Q_RETURN_ARG(QVariant, rectVariant)); - QGeoRectangle rect = qvariant_cast<QGeoRectangle>(rectVariant); - double bottomLeftLongitude = rect.bottomLeft().longitude(); - double bottomRightLongitude = rect.bottomRight().longitude(); - - int width = round(rect.width()); - bool antimed = (width == 360) || (bottomLeftLongitude > bottomRightLongitude); + const double bottomLeftLongitude = view.m_bottomLeft; + const double bottomRightLongitude = view.m_bottomRight; + const int width = view.m_width; + const bool antimed = view.m_antimeridian; /* qDebug() << "Anitmed visible: " << antimed; @@ -1108,26 +1772,36 @@ void ObjectMapModel::splitTrack(const QList<QGeoCoordinate *>& coords, const QVa void ObjectMapModel::viewChanged(double bottomLeftLongitude, double bottomRightLongitude) { + PROFILER_START() (void) bottomRightLongitude; if (!std::isnan(bottomLeftLongitude)) { - for (int row = 0; row < m_items.size(); row++) + const ViewLongitudes view = viewLongitudes(); + + for (ObjectMapItem *item : m_trackedItems) { - ObjectMapItem *item = (ObjectMapItem *)m_items[row]; - if (m_items[row]->m_itemSettings->m_enabled) + const int row = item->m_row; + if ((row >= 0) && item->m_itemSettings->m_enabled) { if (item->m_takenTrackCoords.size() > 1) { - splitTrack(item->m_takenTrackCoords, item->m_takenTrack, item->m_takenTrack1, item->m_takenTrack2, - item->m_takenStart1, item->m_takenStart2, item->m_takenEnd1, item->m_takenEnd2); - QModelIndex idx = index(row); - QVector<int> roles = {groundTrack1Role, groundTrack2Role}; - emit dataChanged(idx, idx, roles); + const bool wholeOnScreen = wholeTrackOnScreen(view, item->m_takenTrackMinLongitude, item->m_takenTrackMaxLongitude); + + // If it was wholly on screen before and still is, the split it already + // has is the whole track, so the pan hasn't changed anything + if (!wholeOnScreen || !item->m_takenTrackWholeOnScreen) + { + splitTakenTrack(item, view); + updateTrackSegments(item); + QModelIndex idx = index(row); + QVector<int> roles = {groundTrack1Role, groundTrack2Role, groundTrackModelRole}; + emit dataChanged(idx, idx, roles); + } } if (item->m_predictedTrackCoords.size() > 1) { - splitTrack(item->m_predictedTrackCoords, item->m_predictedTrack, item->m_predictedTrack1, item->m_predictedTrack2, + splitTrack(view, item->m_predictedTrackCoords, item->m_predictedTrack, item->m_predictedTrack1, item->m_predictedTrack2, item->m_predictedStart1, item->m_predictedStart2, item->m_predictedEnd1, item->m_predictedEnd2); QModelIndex idx = index(row); QVector<int> roles = {predictedGroundTrack1Role, predictedGroundTrack2Role}; @@ -1136,60 +1810,73 @@ void ObjectMapModel::viewChanged(double bottomLeftLongitude, double bottomRightL } } } + PROFILER_STOP("Map viewChanged") +} + +// Longitude wraps at the antimeridian, and a QGeoRectangle that crosses it reports a +// LEFT edge GREATER than its right - a view centred on the Pacific runs from 170 to +// -170. That is why the tests below cannot be plain comparisons: "longitude >= 170 and +// longitude <= -170" is false everywhere, so everything actually on screen was filtered +// out and the map went empty. QGeoRectangle::intersects() handles the wrap, but it was +// replaced by these scalar tests because it cost 10.5 ms a pan against 1.7 ms; these +// keep that and handle the wrap too. +// +// An item can wrap as well as the view - a flight plan from Anchorage to Tokyo does - +// so both sides are checked for it. +static inline bool longitudeInView(double longitude, double left, double right) +{ + return (left <= right) ? ((longitude >= left) && (longitude <= right)) + : ((longitude >= left) || (longitude <= right)); +} + +static inline bool longitudesOverlap(double aLeft, double aRight, double bLeft, double bRight) +{ + const bool aWraps = aLeft > aRight; + const bool bWraps = bLeft > bRight; + if (aWraps && bWraps) { + return true; // both contain the antimeridian, so they share it + } + if (aWraps) { + return (bRight >= aLeft) || (bLeft <= aRight); + } + if (bWraps) { + return (aRight >= bLeft) || (aLeft <= bRight); + } + return (aLeft <= bRight) && (aRight >= bLeft); } bool ObjectMapFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { - QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); + (void) sourceParent; + + // Everything expensive was worked out when the item last changed - see + // MapModel::fillFilterData. This runs for every row every time the map moves + const MapModel::FilterData& data = ((const MapModel *) sourceModel())->filterData(sourceRow); - MapSettings::MapItemSettings *itemSettings = sourceModel()->data(index0, ObjectMapModel::itemSettingsRole).value<MapSettings::MapItemSettings *>(); - if (!itemSettings->m_enabled) { + if (!(data.m_flags & MapModel::FilterEnabled)) { return false; } // Don't show tiny items when we're zoomed out - int minZoom = sourceModel()->data(index0, ObjectMapModel::mapImageMinZoomRole).toInt(); - if (minZoom - 3 >= m_zoomLevel) { + if (data.m_minZoom - 3 >= m_zoomLevel) { return false; } // Don't show off-screen items, unless they have tracks, as these may be on screen - // In the future, we could calculate a bounding box for tracks, if helpful for performance - QGeoCoordinate coord = sourceModel()->data(index0, ObjectMapModel::positionRole).value<QGeoCoordinate>(); - float lat = coord.latitude(); - float lon = coord.longitude(); - bool onScreen = (lat >= m_bottomRightLatitude) && (lat <= m_topLeftLatitude) && (lon >= m_topLeftLongitude) && (lon <= m_bottomRightLongitude); - if (!onScreen) - { - bool hasTracks = sourceModel()->data(index0, ObjectMapModel::hasTracksRole).toBool(); - if (!hasTracks) { - return false; - } - } - - // Apply user filter - if (!itemSettings->m_filterName.isEmpty()) - { - QString name = sourceModel()->data(index0, ObjectMapModel::nameRole).toString(); - QRegularExpressionMatch match = itemSettings->m_filterNameRE.match(name); - if (!match.hasMatch()) { - return false; - } - } - if (itemSettings->m_filterDistance > 0) - { - QGeoCoordinate position = sourceModel()->data(index0, ObjectMapModel::positionRole).value<QGeoCoordinate>(); - if (m_position.distanceTo(position) > itemSettings->m_filterDistance) { - return false; - } + const bool onScreen = (data.m_latitude >= m_bottomRightLatitude) && (data.m_latitude <= m_topLeftLatitude) + && longitudeInView(data.m_longitude, m_topLeftLongitude, m_bottomRightLongitude); + if (!onScreen && !(data.m_flags & MapModel::FilterHasTracks)) { + return false; } - return true; + // The user's name and distance filters + return (data.m_flags & (MapModel::FilterNameMatches | MapModel::FilterDistanceOk)) + == (MapModel::FilterNameMatches | MapModel::FilterDistanceOk); } - void ObjectMapFilter::viewChanged(double topLeftLongitude, double topLeftLatitude, double bottomRightLongitude, double bottomRightLatitude, double zoomLevel) { + PROFILER_START() m_zoomLevel = zoomLevel; if (!std::isnan(topLeftLongitude)) { @@ -1199,6 +1886,7 @@ void ObjectMapFilter::viewChanged(double topLeftLongitude, double topLeftLatitud m_bottomRightLatitude = bottomRightLatitude; } invalidateFilter(); + PROFILER_STOP("Map filter objects") } Q_INVOKABLE int ObjectMapFilter::mapRowToSource(int row) @@ -1210,52 +1898,41 @@ Q_INVOKABLE int ObjectMapFilter::mapRowToSource(int row) bool PolygonFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { - QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); + (void) sourceParent; + + const MapModel::FilterData& data = ((const MapModel *) sourceModel())->filterData(sourceRow); - MapSettings::MapItemSettings *itemSettings = sourceModel()->data(index0, PolygonMapModel::itemSettingsRole).value<MapSettings::MapItemSettings *>(); - if (!itemSettings->m_enabled) { + if (!(data.m_flags & MapModel::FilterEnabled)) { return false; } // Don't show tiny items when we're zoomed out - int minZoom = sourceModel()->data(index0, PolygonMapModel::mapImageMinZoomRole).toInt(); - if (minZoom - 3 >= m_zoomLevel) { + if (data.m_minZoom - 3 >= m_zoomLevel) { return false; } - // Filter off-screen items - QGeoRectangle bounds = sourceModel()->data(index0, PolygonMapModel::boundsRole).value<QGeoRectangle>(); - if (!m_view.intersects(bounds)) { + // Filter off-screen items, by overlap of their extent with what's visible + if ( (data.m_boundsBottom > m_view.topLeft().latitude()) + || (data.m_boundsTop < m_view.bottomRight().latitude()) + || !longitudesOverlap(data.m_boundsLeft, data.m_boundsRight, + m_view.topLeft().longitude(), m_view.bottomRight().longitude())) { return false; } - // Apply user filter - if (!itemSettings->m_filterName.isEmpty()) - { - QString name = sourceModel()->data(index0, PolygonMapModel::nameRole).toString(); - QRegularExpressionMatch match = itemSettings->m_filterNameRE.match(name); - if (!match.hasMatch()) { - return false; - } - } - if (itemSettings->m_filterDistance > 0) - { - QGeoCoordinate position = sourceModel()->data(index0, PolygonMapModel::positionRole).value<QGeoCoordinate>(); - if (m_position.distanceTo(position) > itemSettings->m_filterDistance) { - return false; - } - } - - return true; + // The user's name and distance filters + return (data.m_flags & (MapModel::FilterNameMatches | MapModel::FilterDistanceOk)) + == (MapModel::FilterNameMatches | MapModel::FilterDistanceOk); } void PolygonFilter::viewChanged(double topLeftLongitude, double topLeftLatitude, double bottomRightLongitude, double bottomRightLatitude, double zoomLevel) { + PROFILER_START() m_zoomLevel = zoomLevel; if (!std::isnan(topLeftLongitude)) { m_view = QGeoRectangle(QGeoCoordinate(topLeftLatitude, topLeftLongitude), QGeoCoordinate(bottomRightLatitude, bottomRightLongitude)); } invalidateFilter(); + PROFILER_STOP("Map filter polygons") } Q_INVOKABLE int PolygonFilter::mapRowToSource(int row) @@ -1266,52 +1943,41 @@ Q_INVOKABLE int PolygonFilter::mapRowToSource(int row) bool PolylineFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { - QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); + (void) sourceParent; - MapSettings::MapItemSettings *itemSettings = sourceModel()->data(index0, PolylineMapModel::itemSettingsRole).value<MapSettings::MapItemSettings *>(); - if (!itemSettings->m_enabled) { + const MapModel::FilterData& data = ((const MapModel *) sourceModel())->filterData(sourceRow); + + if (!(data.m_flags & MapModel::FilterEnabled)) { return false; } // Don't show tiny items when we're zoomed out - int minZoom = sourceModel()->data(index0, PolylineMapModel::mapImageMinZoomRole).toInt(); - if (minZoom - 3 >= m_zoomLevel) { + if (data.m_minZoom - 3 >= m_zoomLevel) { return false; } - // Filter off-screen items - QGeoRectangle bounds = sourceModel()->data(index0, PolylineMapModel::boundsRole).value<QGeoRectangle>(); - if (!m_view.intersects(bounds)) { + // Filter off-screen items, by overlap of their extent with what's visible + if ( (data.m_boundsBottom > m_view.topLeft().latitude()) + || (data.m_boundsTop < m_view.bottomRight().latitude()) + || !longitudesOverlap(data.m_boundsLeft, data.m_boundsRight, + m_view.topLeft().longitude(), m_view.bottomRight().longitude())) { return false; } - // Apply user filter - if (!itemSettings->m_filterName.isEmpty()) - { - QString name = sourceModel()->data(index0, PolylineMapModel::nameRole).toString(); - QRegularExpressionMatch match = itemSettings->m_filterNameRE.match(name); - if (!match.hasMatch()) { - return false; - } - } - if (itemSettings->m_filterDistance > 0) - { - QGeoCoordinate position = sourceModel()->data(index0, PolylineMapModel::positionRole).value<QGeoCoordinate>(); - if (m_position.distanceTo(position) > itemSettings->m_filterDistance) { - return false; - } - } - - return true; + // The user's name and distance filters + return (data.m_flags & (MapModel::FilterNameMatches | MapModel::FilterDistanceOk)) + == (MapModel::FilterNameMatches | MapModel::FilterDistanceOk); } void PolylineFilter::viewChanged(double topLeftLongitude, double topLeftLatitude, double bottomRightLongitude, double bottomRightLatitude, double zoomLevel) { + PROFILER_START() m_zoomLevel = zoomLevel; if (!std::isnan(topLeftLongitude)) { m_view = QGeoRectangle(QGeoCoordinate(topLeftLatitude, topLeftLongitude), QGeoCoordinate(bottomRightLatitude, bottomRightLongitude)); } invalidateFilter(); + PROFILER_STOP("Map filter polylines") } Q_INVOKABLE int PolylineFilter::mapRowToSource(int row) @@ -1322,52 +1988,45 @@ Q_INVOKABLE int PolylineFilter::mapRowToSource(int row) bool ImageFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { - QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent); + (void) sourceParent; + + const MapModel::FilterData& data = ((const MapModel *) sourceModel())->filterData(sourceRow); - MapSettings::MapItemSettings *itemSettings = sourceModel()->data(index0, ImageMapModel::itemSettingsRole).value<MapSettings::MapItemSettings *>(); - if (!itemSettings->m_enabled || !itemSettings->m_display2DIcon) { + if (!(data.m_flags & MapModel::FilterEnabled)) { return false; } - // Don't show tiny items when we're zoomed out - int minZoom = sourceModel()->data(index0, ImageMapModel::mapImageMinZoomRole).toInt(); - if (minZoom - 3 >= m_zoomLevel) { + if (!(data.m_flags & MapModel::FilterDisplayIcon)) { return false; } - // Filter off-screen items - QGeoRectangle bounds = sourceModel()->data(index0, ImageMapModel::boundsRole).value<QGeoRectangle>(); - if (!m_view.intersects(bounds)) { + // Don't show tiny items when we're zoomed out + if (data.m_minZoom - 3 >= m_zoomLevel) { return false; } - // Apply user filter - if (!itemSettings->m_filterName.isEmpty()) - { - QString name = sourceModel()->data(index0, ImageMapModel::nameRole).toString(); - QRegularExpressionMatch match = itemSettings->m_filterNameRE.match(name); - if (!match.hasMatch()) { - return false; - } - } - if (itemSettings->m_filterDistance > 0) - { - QGeoCoordinate position = sourceModel()->data(index0, ImageMapModel::positionRole).value<QGeoCoordinate>(); - if (m_position.distanceTo(position) > itemSettings->m_filterDistance) { - return false; - } + // Filter off-screen items, by overlap of their extent with what's visible + if ( (data.m_boundsBottom > m_view.topLeft().latitude()) + || (data.m_boundsTop < m_view.bottomRight().latitude()) + || !longitudesOverlap(data.m_boundsLeft, data.m_boundsRight, + m_view.topLeft().longitude(), m_view.bottomRight().longitude())) { + return false; } - return true; + // The user's name and distance filters + return (data.m_flags & (MapModel::FilterNameMatches | MapModel::FilterDistanceOk)) + == (MapModel::FilterNameMatches | MapModel::FilterDistanceOk); } void ImageFilter::viewChanged(double topLeftLongitude, double topLeftLatitude, double bottomRightLongitude, double bottomRightLatitude, double zoomLevel) { + PROFILER_START() m_zoomLevel = zoomLevel; if (!std::isnan(topLeftLongitude)) { m_view = QGeoRectangle(QGeoCoordinate(topLeftLatitude, topLeftLongitude), QGeoCoordinate(bottomRightLatitude, bottomRightLongitude)); } invalidateFilter(); + PROFILER_STOP("Map filter images") } Q_INVOKABLE int ImageFilter::mapRowToSource(int row) @@ -1399,4 +2058,3 @@ void ImageFilter::setPosition(const QGeoCoordinate& position) m_position = position; invalidateFilter(); } - diff --git a/plugins/feature/map/mapmodel.h b/plugins/feature/map/mapmodel.h index ea20d30cc..6188af909 100644 --- a/plugins/feature/map/mapmodel.h +++ b/plugins/feature/map/mapmodel.h @@ -52,7 +52,6 @@ public: MapModel(MapGUI *gui) : m_gui(gui) { - connect(this, &MapModel::dataChanged, this, &MapModel::update3DMap); } ~MapModel() override @@ -63,9 +62,46 @@ public: virtual void add(MapItem *item); virtual void remove(MapItem *item); virtual void removeAll(); + + // Map items arrive far faster than the map can usefully be redrawn - an aircraft + // sends one per decoded frame - so changes are collected here and handed to the map + // in batches, rather than a signal per item per message + void markDirty(MapItem *item, quint32 changed); + virtual void flush(); + bool hasDirtyItems() const { return !m_dirty.isEmpty(); } + + // Roles the map should re-read for a given set of changes. Empty means all of them + virtual QVector<int> rolesFor(quint32 changed) const; + + // Everything the filters need in order to decide whether to show an item, worked out + // when the item changes rather than every time the map is panned. The whole model is + // re-filtered on a view change, and it holds every airport and navaid in the world, + // so this is on the path that decides how smoothly the map pans + enum FilterFlags { + FilterEnabled = 1u << 0, + FilterDisplayIcon = 1u << 1, // Item settings say to draw the image + FilterNameMatches = 1u << 2, // Passes the user's name filter + FilterDistanceOk = 1u << 3, // Within the user's distance filter of the station + FilterHasTracks = 1u << 4 // Keep it even when off screen, as its track may be on screen + }; + + struct FilterData { + float m_latitude = 0.0f; + float m_longitude = 0.0f; + float m_boundsTop = 0.0f; // Only used by the items that have an extent + float m_boundsBottom = 0.0f; + float m_boundsLeft = 0.0f; + float m_boundsRight = 0.0f; + qint32 m_minZoom = 0; + quint32 m_flags = 0; + }; + + const FilterData& filterData(int row) const { return m_filterData.at(row); } + void setStationPosition(const QGeoCoordinate& position); + void rebuildFilterData(); void update(const QObject *source, SWGSDRangel::SWGMapItem *swgMapItem, const QString &group=""); void updateItemSettings(QHash<QString, MapSettings::MapItemSettings *> m_itemSettings); - void allUpdated(); + virtual void allUpdated(); MapItem *findMapItem(const QObject *source, const QString& name); MapItem *findMapItem(const QString& name); @@ -88,13 +124,19 @@ public: } public slots: - void update3DMap(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()); protected: MapGUI *m_gui; QList<MapItem *> m_items; QHash<QString, MapItem *> m_itemsHash; + QHash<MapItem *, quint32> m_dirty; // Items changed since the last flush + QVector<FilterData> m_filterData; // Parallel to m_items + QGeoCoordinate m_stationPosition; + mutable QHash<quint32, QVector<int>> m_roleCache; + + virtual void fillFilterData(MapItem *item, FilterData& data) const; + void updateFilterData(int row); virtual void update(MapItem *item); virtual void update3D(MapItem *item) = 0; @@ -102,6 +144,45 @@ protected: }; +// A MapPolyline can only be drawn in a single colour, so a track that is coloured +// according to altitude has to be drawn as a series of them. This is the model of those +// segments for one item, used by a MapItemView nested inside the item's delegate. +class TrackColorModel : public QAbstractListModel { + Q_OBJECT + +public: + + enum SegmentRoles { + segmentCoordinatesRole = Qt::UserRole + 1, + segmentColorRole = Qt::UserRole + 2 + }; + + int rowCount(const QModelIndex& parent = QModelIndex()) const override + { + (void) parent; + return m_segments.size(); + } + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + + QHash<int, QByteArray> roleNames() const override + { + QHash<int, QByteArray> roles; + roles[segmentCoordinatesRole] = "segmentCoordinates"; + roles[segmentColorRole] = "segmentColor"; + return roles; + } + + // firstChanged is the first segment that differs from what the model already has, + // so that appending to a track doesn't make the map redraw every segment of it + void update(const QList<QVariantList>& segments, const QList<QVariant>& colors, int firstChanged = 0); + void clear(); + +private: + QList<QVariantList> m_segments; + QList<QVariant> m_colors; +}; + class ImageMapModel : public MapModel { Q_OBJECT @@ -127,6 +208,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + void fillFilterData(MapItem *item, FilterData& data) const override; + protected: MapItem *newMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) override; void update3D(MapItem *item) override; @@ -160,6 +243,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + void fillFilterData(MapItem *item, FilterData& data) const override; + protected: void update3D(MapItem *item) override; MapItem *newMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) override; @@ -175,6 +260,7 @@ public: lineColorRole = MapModel::lastRole + 0, coordinatesRole = MapModel::lastRole + 1, boundsRole = MapModel::lastRole + 2, + trackModelRole = MapModel::lastRole + 3, }; PolylineMapModel(MapGUI *gui) : @@ -187,14 +273,24 @@ public: roles[lineColorRole] = "lineColor"; roles[coordinatesRole] = "coordinates"; roles[boundsRole] = "bounds"; + roles[trackModelRole] = "polylineTrackModel"; return roles; } QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + void fillFilterData(MapItem *item, FilterData& data) const override; + void flush() override; + void allUpdated() override; + protected: void update3D(MapItem *item) override; MapItem *newMapItem(const QObject *sourcePipe, const QString &group, MapSettings::MapItemSettings *itemSettings, SWGSDRangel::SWGMapItem *mapItem) override; + +private: + void updateTrackSegments(PolylineMapItem *item); + + mutable TrackColorModel m_noTrackColors; // Empty, for lines that aren't coloured by altitude }; // Model used for each item on the map @@ -224,7 +320,9 @@ public: groundTrack2Role = MapModel::lastRole + 12, groundTrackColorRole = MapModel::lastRole + 13, predictedGroundTrackColorRole = MapModel::lastRole + 14, - hasTracksRole = MapModel::lastRole + 15 + hasTracksRole = MapModel::lastRole + 15, + groundTrackModelRole = MapModel::lastRole + 16, + zOrderRole = MapModel::lastRole + 17 }; ObjectMapModel(MapGUI *gui); @@ -236,12 +334,17 @@ public: void removeAll() override; QHash<int, QByteArray> roleNames() const override; + void allUpdated() override; + void flush() override; + void fillFilterData(MapItem *item, FilterData& data) const override; + QVector<int> rolesFor(quint32 changed) const override; + void updateTarget(); void setTarget(const QString& name); bool isTarget(const ObjectMapItem *mapItem) const; - Q_INVOKABLE void moveToFront(int oldRow); - Q_INVOKABLE void moveToBack(int oldRow); + Q_INVOKABLE void moveToFront(int row); + Q_INVOKABLE void moveToBack(int row); Q_INVOKABLE void link(const QString& link); @@ -286,9 +389,13 @@ protected: } private: + mutable TrackColorModel m_noTrackColors; // Empty, for items whose track isn't coloured by altitude + QList<ObjectMapItem *> m_trackedItems; // Items with a track, so a pan doesn't walk every airport in the world QList<bool> m_selected; // Whether each item on 2D map is selected QString m_selected3D; // Name of item selected on 3D map - only supports 1 item, unlike 2D map int m_target; // Row number of current target, or -1 for none + qreal m_frontZOrder; // Draw order handed out by moveToFront + qreal m_backZOrder; // and by moveToBack bool m_displayNames; bool m_displaySelectedGroundTracks; bool m_displayAllGroundTracks; @@ -300,8 +407,23 @@ private: void interpolateWest(QGeoCoordinate *c1, QGeoCoordinate *c2, double x, QGeoCoordinate *ci, bool offScreen); void interpolate(QGeoCoordinate *c1, QGeoCoordinate *c2, double bottomLeftLongitude, double bottomRightLongitude, QGeoCoordinate* ci, bool offScreen); + // What's currently visible on the 2D map, which tracks are split against + struct ViewLongitudes { + double m_bottomLeft; + double m_bottomRight; + int m_width; // Degrees of longitude visible + bool m_antimeridian; // Whether the antimeridian is on screen + }; + + ViewLongitudes viewLongitudes() const; + static bool wholeTrackOnScreen(const ViewLongitudes& view, double minLongitude, double maxLongitude); + void splitTracks(ObjectMapItem *item); - void splitTrack(const QList<QGeoCoordinate *>& coords, const QVariantList& track, + void splitTakenTrack(ObjectMapItem *item, const ViewLongitudes& view); + void updateTrackSegments(ObjectMapItem *item); + static void colorTrackPoints(ObjectMapItem *item, const QVariantList& track, int first, const QVariant *palette); + void splitTrack(const ViewLongitudes& view, + const QList<QGeoCoordinate *>& coords, const QVariantList& track, QVariantList& track1, QVariantList& track2, QGeoCoordinate& start1, QGeoCoordinate& start2, QGeoCoordinate& end1, QGeoCoordinate& end2); diff --git a/plugins/feature/map/mapsettings.cpp b/plugins/feature/map/mapsettings.cpp index 2ad85642e..642c8b301 100644 --- a/plugins/feature/map/mapsettings.cpp +++ b/plugins/feature/map/mapsettings.cpp @@ -21,6 +21,7 @@ #include <QColor> #include <QDebug> +#include <QDir> #include "util/simpleserializer.h" #include "util/httpdownloadmanager.h" @@ -28,9 +29,36 @@ #include "mapsettings.h" +static QString defaultMSFSAircraftDirectory() +{ + QString localAppData = qEnvironmentVariable("LOCALAPPDATA"); + if (localAppData.isEmpty()) { + localAppData = QDir::home().filePath("AppData/Local"); + } + return QDir(localAppData).filePath( + "Packages/Microsoft.Limitless_8wekyb3d8bbwe/LocalCache/Packages/" + "Community/fsltl-traffic-base/SimObjects/Airplanes"); +} + +static QString defaultMSFSNavigraphDirectory() +{ +#ifdef Q_OS_WIN + QString localAppData = qEnvironmentVariable("LOCALAPPDATA"); + if (localAppData.isEmpty()) { + localAppData = QDir::home().filePath("AppData/Local"); + } + return QDir(localAppData).filePath( + "Packages/Microsoft.Limitless_8wekyb3d8bbwe/LocalCache/Packages/" + "Community/navigraph-nav-base"); +#else + return QString(); +#endif +} + const QStringList MapSettings::m_pipeTypes = { QStringLiteral("ACARSDemod"), QStringLiteral("ADSBDemod"), + QStringLiteral("Aircraft"), QStringLiteral("AIS"), QStringLiteral("APRS"), QStringLiteral("APTDemod"), @@ -51,6 +79,7 @@ const QStringList MapSettings::m_pipeTypes = { const QStringList MapSettings::m_pipeURIs = { QStringLiteral("sdrangel.channel.acarsdemod"), QStringLiteral("sdrangel.channel.adsbdemod"), + QStringLiteral("sdrangel.feature.aircraft"), QStringLiteral("sdrangel.feature.ais"), QStringLiteral("sdrangel.feature.aprs"), QStringLiteral("sdrangel.channel.aptdemod"), @@ -83,6 +112,26 @@ const QStringList MapSettings::m_mapProviderNames = { QStringLiteral("MapLibreGL") }; +// 3D map options that consume Cesium Ion quota, so need a user-supplied Cesium Ion +// API key. Names as used in the combo boxes in the settings dialog. +const QStringList MapSettings::m_cesiumIonImagery = { + QStringLiteral("Bing Maps Aerial"), + QStringLiteral("Sentinel-2"), + QStringLiteral("Earth at night"), + QStringLiteral("Google Maps Satellite"), + QStringLiteral("Google Maps Satellite with Labels"), + QStringLiteral("Google Maps Roadmap"), + QStringLiteral("Google Maps Contour") +}; + +const QStringList MapSettings::m_cesiumIonTerrain = { + QStringLiteral("Cesium World Terrain") +}; + +const QStringList MapSettings::m_cesiumIonBuildings = { + QStringLiteral("Cesium OSM Buildings") +}; + MapSettings::MapSettings() : m_rgbColor(QColor(0, 0, 0).rgb()), m_rollupState(nullptr) @@ -93,8 +142,28 @@ MapSettings::MapSettings() : MapItemSettings *aptSettings = new MapItemSettings("APTDemod", true, QColor(216, 112, 169), true, false, 11); aptSettings->m_display2DIcon = false; // Disabled as 2D projection is wrong m_itemSettings.insert("APTDemod", aptSettings); + // Built from the corrected defaults, so nothing to migrate + m_itemSettingsVersion = 1; + m_splitterState.clear(); m_itemSettings.insert("ACARSDemod", new MapItemSettings("ACARSDemod", true, QColor(244, 151, 57), true, false, 11, modelMinPixelSize)); m_itemSettings.insert("ADSBDemod", new MapItemSettings("ADSBDemod", true, QColor(244, 151, 57), true, false, 11, modelMinPixelSize)); + m_itemSettings.insert("Aircraft", new MapItemSettings("Aircraft", true, QColor(244, 151, 57), true, false, 11, modelMinPixelSize)); + // Filed flight plans and oceanic clearances, which the Aircraft feature asks for by + // name - see MapItem.group in the API. They are here rather than sharing the group + // above because a route wants the opposite of what an aircraft wants from a minimum + // zoom: an icon has to be decluttered away when zoomed out, while a route drawn + // across an ocean is exactly what you want to see at that zoom. Not a pipe type, so + // no source is ever assigned to it - only an item that names it. + m_itemSettings.insert("Aircraft Routes", new MapItemSettings("Aircraft Routes", true, QColor(244, 151, 57), false, false, 0, modelMinPixelSize)); + // The per protocol coverage polygons. Each carries its own colour, so the colour + // here only matters if one ever arrives without one. + // + // display2DTrack must be TRUE, unlike the routes above: PolygonMapModel::data() + // returns a transparent fill for a polygon whose group does not have it, and the + // border of every polygon is transparent unconditionally - so with it false the + // coverage was on the 2D map, filtered in and drawn, and completely invisible. + // Polylines have no such gate, which is why the routes are visible without it. + m_itemSettings.insert("Aircraft Coverage", new MapItemSettings("Aircraft Coverage", true, QColor(244, 151, 57), true, false, 0, modelMinPixelSize)); m_itemSettings.insert("AIS", new MapItemSettings("AIS", true, QColor(102, 0, 0), true, false, 11, modelMinPixelSize)); MapItemSettings *aprsSettings = new MapItemSettings("APRS", true, QColor(255, 255, 0), true, false, 11); aprsSettings->m_extrapolate = 0; @@ -145,25 +214,25 @@ MapSettings::MapSettings() : ionosondeItemSettings->m_display2DIcon = false; m_itemSettings.insert("Ionosonde Stations", ionosondeItemSettings); - m_itemSettings.insert("Airspace (A)", new MapItemSettings("Airspace (A)", false, QColor(255, 0, 0, 0x20), false, false, 7)); - m_itemSettings.insert("Airspace (B)", new MapItemSettings("Airspace (B)", false, QColor(255, 0, 0, 0x20), false, false, 7)); - m_itemSettings.insert("Airspace (C)", new MapItemSettings("Airspace (C)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (D)", new MapItemSettings("Airspace (D)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (E)", new MapItemSettings("Airspace (E)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (F)", new MapItemSettings("Airspace (F)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (G)", new MapItemSettings("Airspace (G)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (FIR)", new MapItemSettings("Airspace (FIR)", false, QColor(255, 0, 0, 0x20), false, false, 7)); - m_itemSettings.insert("Airspace (CTR)", new MapItemSettings("Airspace (CTR)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (RMZ)", new MapItemSettings("Airspace (RMZ)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (TMA)", new MapItemSettings("Airspace (TMA)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (TMZ)", new MapItemSettings("Airspace (TMZ)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (OTH)", new MapItemSettings("Airspace (OTH)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (Restricted)", new MapItemSettings("Airspace (Restricted)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (Gliding)", new MapItemSettings("Airspace (Gliding)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (Danger)", new MapItemSettings("Airspace (Danger)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (Prohibited)", new MapItemSettings("Airspace (Prohibited)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (Wave)", new MapItemSettings("Airspace (Wave)", false, QColor(255, 0, 0, 0x20), false, false, 11)); - m_itemSettings.insert("Airspace (Airports)", new MapItemSettings("Airspace (Airports)", false, QColor(0, 0, 255, 0x20), false, false, 11)); + m_itemSettings.insert("Airspace (A)", new MapItemSettings("Airspace (A)", false, QColor(255, 0, 0, 0x20), true, false, 7)); + m_itemSettings.insert("Airspace (B)", new MapItemSettings("Airspace (B)", false, QColor(255, 0, 0, 0x20), true, false, 7)); + m_itemSettings.insert("Airspace (C)", new MapItemSettings("Airspace (C)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (D)", new MapItemSettings("Airspace (D)", false, QColor(0, 0, 255, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (E)", new MapItemSettings("Airspace (E)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (F)", new MapItemSettings("Airspace (F)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (G)", new MapItemSettings("Airspace (G)", false, QColor(0, 0, 255, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (FIR)", new MapItemSettings("Airspace (FIR)", false, QColor(255, 0, 0, 0x20), true, false, 7)); + m_itemSettings.insert("Airspace (CTR)", new MapItemSettings("Airspace (CTR)", false, QColor(0, 0, 255, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (RMZ)", new MapItemSettings("Airspace (RMZ)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (TMA)", new MapItemSettings("Airspace (TMA)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (TMZ)", new MapItemSettings("Airspace (TMZ)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (OTH)", new MapItemSettings("Airspace (OTH)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (Restricted)", new MapItemSettings("Airspace (Restricted)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (Gliding)", new MapItemSettings("Airspace (Gliding)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (Danger)", new MapItemSettings("Airspace (Danger)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (Prohibited)", new MapItemSettings("Airspace (Prohibited)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (Wave)", new MapItemSettings("Airspace (Wave)", false, QColor(255, 0, 0, 0x20), true, false, 11)); + m_itemSettings.insert("Airspace (Airports)", new MapItemSettings("Airspace (Airports)", false, QColor(0, 0, 255, 0x20), true, false, 11)); MapItemSettings *waypointsSettings = new MapItemSettings("Waypoints", false, QColor(255, 0, 255), false, true, 11); waypointsSettings->m_filterDistance = 500000; @@ -220,13 +289,14 @@ void MapSettings::resetToDefaults() m_displaySelectedGroundTracks = true; m_displayAllGroundTracks = true; m_title = "Map"; - m_displayAllGroundTracks = QColor(225, 25, 99).rgba(); + m_rgbColor = QColor(225, 25, 99).rgba(); m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; m_reverseAPIFeatureSetIndex = 0; m_reverseAPIFeatureIndex = 0; m_map2DEnabled = true; + m_useLiveryIcons = true; m_map3DEnabled = true; m_terrain = "Ellipsoid"; m_buildings = "None"; @@ -234,10 +304,16 @@ void MapSettings::resetToDefaults() m_lightIntensity = 3.0f; m_eciCamera = false; m_modelDir = HttpDownloadManager::downloadDir() + "/3d"; + m_msfsNavigraphDir = defaultMSFSNavigraphDirectory(); + m_msfsAircraftDir = defaultMSFSAircraftDirectory(); m_fxaa = true; m_msaa = 1; + m_mapCenterLatitude = 0.0f; + m_mapCenterLongitude = 0.0f; + m_mapZoomLevel = -1.0f; m_terrainLighting = true; m_water = false; + m_googlePhotorealistic3DTiles = false; m_hdr = true; m_fog = true; m_fps = false; @@ -254,8 +330,22 @@ void MapSettings::resetToDefaults() m_displayMagDec = false; m_displayMaidenheadGrid = false; m_displayPFD = false; - m_viewFirstPerson = false; - m_defaultImagery = "Sentinel-2"; + m_displayND = false; + m_mapItemSoundVolume = 50; + m_cockpitSoundVolume = 100; + m_audioMuted = false; + m_displayCockpitPanels = true; + m_displayEFIS = false; + m_displayRMP = false; + m_vhf1Channel = ""; + m_vhf2Channel = ""; + m_vhf1Standby = 121500000; // The guard frequency, until something is entered + m_vhf2Standby = 121500000; + m_cockpitPanelGeometry = ""; + m_efisState = ""; + m_displayDCDU = false; + m_cameraMode = ThirdPerson; + m_defaultImagery = "ArcGIS world imagery"; m_arcGISAPIKey = ""; m_workspaceIndex = 0; m_checkWXAPIKey = ""; @@ -319,7 +409,6 @@ QByteArray MapSettings::serialize() const s.writeString(49, m_defaultImagery); s.writeString(50, m_arcGISAPIKey); s.writeBool(51, m_displayPFD); - s.writeBool(52, m_viewFirstPerson); s.writeBool(53, m_terrainLighting); s.writeBool(54, m_water); @@ -328,6 +417,32 @@ QByteArray MapSettings::serialize() const s.writeBool(57, m_fps); s.writeBool(58, m_fxaa); s.writeS32(59, m_msaa); + s.writeFloat(60, m_mapCenterLatitude); + s.writeFloat(61, m_mapCenterLongitude); + s.writeFloat(62, m_mapZoomLevel); + s.writeBool(63, m_useLiveryIcons); + s.writeBool(64, m_displayND); + s.writeS32(65, m_itemSettingsVersion); + s.writeBlob(66, m_splitterState); + // 67 was m_dcduSound, superseded by the cockpit volume slider + s.writeS32(68, m_mapItemSoundVolume); + s.writeS32(69, m_cockpitSoundVolume); + s.writeBool(70, m_audioMuted); + // 71 is m_googlePhotorealistic3DTiles (below); these start at 72 + s.writeBool(72, m_displayEFIS); + s.writeBool(73, m_displayRMP); + s.writeBool(74, m_displayDCDU); + s.writeBool(75, m_displayCockpitPanels); + s.writeString(76, m_vhf1Channel); + s.writeString(77, m_vhf2Channel); + s.writeS32(78, m_vhf1Standby); + s.writeS32(79, m_vhf2Standby); + s.writeString(80, m_cockpitPanelGeometry); + s.writeString(81, m_efisState); + s.writeBool(71, m_googlePhotorealistic3DTiles); + s.writeString(82, m_msfsAircraftDir); + s.writeS32(83, m_cameraMode); + s.writeString(84, m_msfsNavigraphDir); return s.final(); } @@ -418,10 +533,14 @@ bool MapSettings::deserialize(const QByteArray& data) d.readFloat(47, &m_lightIntensity, 3.0f); d.readBool(48, &m_displayMaidenheadGrid, false); - d.readString(49, &m_defaultImagery, "Sentinel-2"); + d.readString(49, &m_defaultImagery, "ArcGIS world imagery"); d.readString(50, &m_arcGISAPIKey, ""); d.readBool(51, &m_displayPFD, false); - d.readBool(52, &m_viewFirstPerson, false); + // Key 52 held the old first person/third person switch. It is no longer + // written, but it still chooses the default camera mode for anyone upgrading + bool viewFirstPerson; + d.readBool(52, &viewFirstPerson, false); + d.readS32(83, &m_cameraMode, viewFirstPerson ? FirstPerson : ThirdPerson); d.readBool(53, &m_terrainLighting, true); d.readBool(54, &m_water, false); @@ -430,6 +549,46 @@ bool MapSettings::deserialize(const QByteArray& data) d.readBool(57, &m_fps, false); d.readBool(58, &m_fxaa, false); d.readS32(59, &m_msaa, 1); + d.readFloat(60, &m_mapCenterLatitude, 0.0f); + d.readFloat(61, &m_mapCenterLongitude, 0.0f); + d.readFloat(62, &m_mapZoomLevel, -1.0f); + d.readBool(63, &m_useLiveryIcons, true); + d.readBool(64, &m_displayND, false); + d.readS32(65, &m_itemSettingsVersion, 0); + d.readBlob(66, &m_splitterState); + d.readS32(68, &m_mapItemSoundVolume, 50); + d.readS32(69, &m_cockpitSoundVolume, 100); + d.readBool(70, &m_audioMuted, false); + d.readBool(72, &m_displayEFIS, false); + d.readBool(73, &m_displayRMP, false); + d.readBool(74, &m_displayDCDU, true); + d.readBool(75, &m_displayCockpitPanels, true); + d.readString(76, &m_vhf1Channel, ""); + d.readString(77, &m_vhf2Channel, ""); + d.readS32(78, &m_vhf1Standby, 121500000); + d.readS32(79, &m_vhf2Standby, 121500000); + d.readString(80, &m_cockpitPanelGeometry, ""); + d.readString(81, &m_efisState, ""); + d.readBool(71, &m_googlePhotorealistic3DTiles, false); + d.readString(82, &m_msfsAircraftDir, defaultMSFSAircraftDirectory()); + d.readString(84, &m_msfsNavigraphDir, defaultMSFSNavigraphDirectory()); + + // Airspaces never had a usable 2D colour: their groups were created without + // display2DTrack, which makes PolygonMapModel::data() return a transparent fill, + // so they were drawn and invisible. A preset written before that was fixed still + // carries the false, and would go on overriding the corrected default - so it is + // turned on once, here, and the fact recorded so a later decision to switch them + // off again is left alone. + if (m_itemSettingsVersion < 1) + { + for (MapItemSettings *itemSettings : m_itemSettings) + { + if (itemSettings && itemSettings->m_group.startsWith("Airspace (")) { + itemSettings->m_display2DTrack = true; + } + } + m_itemSettingsVersion = 1; + } return true; } @@ -472,6 +631,7 @@ void MapSettings::MapItemSettings::resetToDefaults() m_display2DLabel = true; m_display2DTrack = true; m_2DTrackColor = QColor(150, 0, 20).rgba(); + m_2DTrackPalette = defaultTrackPalette(m_group); m_2DMinZoom = 1; m_display3DModel = true; m_display3DPoint = false; @@ -488,6 +648,17 @@ void MapSettings::MapItemSettings::resetToDefaults() m_smoothingLambda = 100; } +// Aircraft tracks are coloured by altitude by default, as they are on the ADS-B +// demodulator's own map. Everything else is drawn in a single colour. +QString MapSettings::MapItemSettings::defaultTrackPalette(const QString& group) +{ + if ((group == "ADSBDemod") || (group == "Aircraft")) { + return "Spectral"; + } else { + return ""; + } +} + QByteArray MapSettings::MapItemSettings::serialize() const { SimpleSerializer s(1); @@ -512,6 +683,7 @@ QByteArray MapSettings::MapItemSettings::serialize() const s.writeS32(18, m_extrapolate); s.writeS32(19, m_smoothingWindow); s.writeFloat(20, m_smoothingLambda); + s.writeString(21, m_2DTrackPalette); return s.final(); } @@ -546,9 +718,10 @@ bool MapSettings::MapItemSettings::deserialize(const QByteArray& data) d.readString(16, &m_filterName, ""); d.readS32(17, &m_filterDistance, 0); d.readS32(18, &m_extrapolate, 60); + d.readString(21, &m_2DTrackPalette, defaultTrackPalette(m_group)); m_filterNameRE.setPattern(m_filterName); m_filterNameRE.optimize(); - if (m_group == "ADSBDemod") + if ((m_group == "ADSBDemod") || (m_group == "Aircraft")) { d.readS32(19, &m_smoothingWindow, 10); d.readFloat(20, &m_smoothingLambda, 100); @@ -607,6 +780,7 @@ void MapSettings::deserializeItemSettings(const QByteArray& data, QHash<QString, } else { + d.readBlob(idx+2, &blob); if (itemSettings.contains(key)) { itemSettings[key]->deserialize(blob); @@ -677,6 +851,9 @@ void MapSettings::applySettings(const QStringList& settingsKeys, const MapSettin if (settingsKeys.contains("map2DEnabled")) { m_map2DEnabled = settings.m_map2DEnabled; } + if (settingsKeys.contains("useLiveryIcons")) { + m_useLiveryIcons = settings.m_useLiveryIcons; + } if (settingsKeys.contains("map3DEnabled")) { m_map3DEnabled = settings.m_map3DEnabled; } @@ -698,18 +875,36 @@ void MapSettings::applySettings(const QStringList& settingsKeys, const MapSettin if (settingsKeys.contains("modelDir")) { m_modelDir = settings.m_modelDir; } + if (settingsKeys.contains("msfsNavigraphDir")) { + m_msfsNavigraphDir = settings.m_msfsNavigraphDir; + } + if (settingsKeys.contains("msfsAircraftDir")) { + m_msfsAircraftDir = settings.m_msfsAircraftDir; + } if (settingsKeys.contains("fxaa")) { m_fxaa = settings.m_fxaa; } if (settingsKeys.contains("msaa")) { m_msaa = settings.m_msaa; } + if (settingsKeys.contains("mapCenterLatitude")) { + m_mapCenterLatitude = settings.m_mapCenterLatitude; + } + if (settingsKeys.contains("mapCenterLongitude")) { + m_mapCenterLongitude = settings.m_mapCenterLongitude; + } + if (settingsKeys.contains("mapZoomLevel")) { + m_mapZoomLevel = settings.m_mapZoomLevel; + } if (settingsKeys.contains("terrainLighting")) { m_terrainLighting = settings.m_terrainLighting; } if (settingsKeys.contains("water")) { m_water = settings.m_water; } + if (settingsKeys.contains("googlePhotorealistic3DTiles")) { + m_googlePhotorealistic3DTiles = settings.m_googlePhotorealistic3DTiles; + } if (settingsKeys.contains("hdr")) { m_hdr = settings.m_hdr; } @@ -761,11 +956,56 @@ void MapSettings::applySettings(const QStringList& settingsKeys, const MapSettin if (settingsKeys.contains("arcGISAPIKey")) { m_arcGISAPIKey = settings.m_arcGISAPIKey; } + if (settingsKeys.contains("cesiumIonAPIKey")) { + m_cesiumIonAPIKey = settings.m_cesiumIonAPIKey; + } if (settingsKeys.contains("displayPFD")) { m_displayPFD = settings.m_displayPFD; } - if (settingsKeys.contains("viewFirstPerson")) { - m_viewFirstPerson = settings.m_viewFirstPerson; + if (settingsKeys.contains("displayND")) { + m_displayND = settings.m_displayND; + } + if (settingsKeys.contains("mapItemSoundVolume")) { + m_mapItemSoundVolume = settings.m_mapItemSoundVolume; + } + if (settingsKeys.contains("cockpitSoundVolume")) { + m_cockpitSoundVolume = settings.m_cockpitSoundVolume; + } + if (settingsKeys.contains("audioMuted")) { + m_audioMuted = settings.m_audioMuted; + } + if (settingsKeys.contains("displayCockpitPanels")) { + m_displayCockpitPanels = settings.m_displayCockpitPanels; + } + if (settingsKeys.contains("displayEFIS")) { + m_displayEFIS = settings.m_displayEFIS; + } + if (settingsKeys.contains("displayRMP")) { + m_displayRMP = settings.m_displayRMP; + } + if (settingsKeys.contains("vhf1Channel")) { + m_vhf1Channel = settings.m_vhf1Channel; + } + if (settingsKeys.contains("vhf2Channel")) { + m_vhf2Channel = settings.m_vhf2Channel; + } + if (settingsKeys.contains("vhf1Standby")) { + m_vhf1Standby = settings.m_vhf1Standby; + } + if (settingsKeys.contains("vhf2Standby")) { + m_vhf2Standby = settings.m_vhf2Standby; + } + if (settingsKeys.contains("cockpitPanelGeometry")) { + m_cockpitPanelGeometry = settings.m_cockpitPanelGeometry; + } + if (settingsKeys.contains("efisState")) { + m_efisState = settings.m_efisState; + } + if (settingsKeys.contains("displayDCDU")) { + m_displayDCDU = settings.m_displayDCDU; + } + if (settingsKeys.contains("cameraMode")) { + m_cameraMode = settings.m_cameraMode; } if (settingsKeys.contains("workspaceIndex")) { m_workspaceIndex = settings.m_workspaceIndex; @@ -827,6 +1067,9 @@ QString MapSettings::getDebugString(const QStringList& settingsKeys, bool force) if (settingsKeys.contains("map2DEnabled") || force) { ostr << " m_map2DEnabled: " << m_map2DEnabled; } + if (settingsKeys.contains("useLiveryIcons") || force) { + ostr << " m_useLiveryIcons: " << m_useLiveryIcons; + } if (settingsKeys.contains("map3DEnabled") || force) { ostr << " m_map3DEnabled: " << m_map3DEnabled; } @@ -848,18 +1091,36 @@ QString MapSettings::getDebugString(const QStringList& settingsKeys, bool force) if (settingsKeys.contains("modelDir") || force) { ostr << " m_modelDir: " << m_modelDir.toStdString(); } + if (settingsKeys.contains("msfsNavigraphDir") || force) { + ostr << " m_msfsNavigraphDir: " << m_msfsNavigraphDir.toStdString(); + } + if (settingsKeys.contains("msfsAircraftDir") || force) { + ostr << " m_msfsAircraftDir: " << m_msfsAircraftDir.toStdString(); + } if (settingsKeys.contains("fxaa") || force) { ostr << " m_fxaa: " << m_fxaa; } if (settingsKeys.contains("msaa") || force) { ostr << " m_msaa: " << m_msaa; } + if (settingsKeys.contains("mapCenterLatitude") || force) { + ostr << " m_mapCenterLatitude: " << m_mapCenterLatitude; + } + if (settingsKeys.contains("mapCenterLongitude") || force) { + ostr << " m_mapCenterLongitude: " << m_mapCenterLongitude; + } + if (settingsKeys.contains("mapZoomLevel") || force) { + ostr << " m_mapZoomLevel: " << m_mapZoomLevel; + } if (settingsKeys.contains("terrainLighting") || force) { ostr << " m_terrainLighting: " << m_terrainLighting; } if (settingsKeys.contains("water") || force) { ostr << " m_water: " << m_water; } + if (settingsKeys.contains("googlePhotorealistic3DTiles") || force) { + ostr << " m_googlePhotorealistic3DTiles: " << m_googlePhotorealistic3DTiles; + } if (settingsKeys.contains("hdr") || force) { ostr << " m_hdr: " << m_hdr; } @@ -908,14 +1169,59 @@ QString MapSettings::getDebugString(const QStringList& settingsKeys, bool force) if (settingsKeys.contains("defaultImagery") || force) { ostr << " m_defaultImagery: " << m_defaultImagery.toStdString(); } + if (settingsKeys.contains("cesiumIonAPIKey") || force) { + ostr << " m_cesiumIonAPIKey: " << m_cesiumIonAPIKey.toStdString(); + } if (settingsKeys.contains("arcGISAPIKey") || force) { ostr << " m_arcGISAPIKey: " << m_arcGISAPIKey.toStdString(); } if (settingsKeys.contains("displayPFD") || force) { ostr << " m_displayPFD: " << m_displayPFD; } - if (settingsKeys.contains("viewFirstPerson") || force) { - ostr << " m_viewFirstPerson: " << m_viewFirstPerson; + if (settingsKeys.contains("displayND") || force) { + ostr << " m_displayND: " << m_displayND; + } + if (settingsKeys.contains("mapItemSoundVolume") || force) { + ostr << " m_mapItemSoundVolume: " << m_mapItemSoundVolume; + } + if (settingsKeys.contains("cockpitSoundVolume") || force) { + ostr << " m_cockpitSoundVolume: " << m_cockpitSoundVolume; + } + if (settingsKeys.contains("audioMuted") || force) { + ostr << " m_audioMuted: " << m_audioMuted; + } + if (settingsKeys.contains("displayCockpitPanels") || force) { + ostr << " m_displayCockpitPanels: " << m_displayCockpitPanels; + } + if (settingsKeys.contains("displayEFIS") || force) { + ostr << " m_displayEFIS: " << m_displayEFIS; + } + if (settingsKeys.contains("displayRMP") || force) { + ostr << " m_displayRMP: " << m_displayRMP; + } + if (settingsKeys.contains("vhf1Channel") || force) { + ostr << " m_vhf1Channel: " << m_vhf1Channel.toStdString(); + } + if (settingsKeys.contains("vhf2Channel") || force) { + ostr << " m_vhf2Channel: " << m_vhf2Channel.toStdString(); + } + if (settingsKeys.contains("vhf1Standby") || force) { + ostr << " m_vhf1Standby: " << m_vhf1Standby; + } + if (settingsKeys.contains("vhf2Standby") || force) { + ostr << " m_vhf2Standby: " << m_vhf2Standby; + } + if (settingsKeys.contains("cockpitPanelGeometry") || force) { + ostr << " m_cockpitPanelGeometry: " << m_cockpitPanelGeometry.toStdString(); + } + if (settingsKeys.contains("efisState") || force) { + ostr << " m_efisState: " << m_efisState.toStdString(); + } + if (settingsKeys.contains("displayDCDU") || force) { + ostr << " m_displayDCDU: " << m_displayDCDU; + } + if (settingsKeys.contains("cameraMode") || force) { + ostr << " m_cameraMode: " << m_cameraMode; } if (settingsKeys.contains("workspaceIndex") || force) { ostr << " m_workspaceIndex: " << m_workspaceIndex; diff --git a/plugins/feature/map/mapsettings.h b/plugins/feature/map/mapsettings.h index 7dddb15e0..a3c87a549 100644 --- a/plugins/feature/map/mapsettings.h +++ b/plugins/feature/map/mapsettings.h @@ -39,6 +39,8 @@ struct MapSettings bool m_display2DLabel; // Display label on 2D map bool m_display2DTrack; // Display tracks (or polygon) on 2D map quint32 m_2DTrackColor; + QString m_2DTrackPalette; // Palette used to colour the track by altitude, on BOTH the + // 2D and 3D maps. Empty for a plain single colour track int m_2DMinZoom; bool m_display3DModel; // Draw 3D model for item bool m_display3DLabel; // Display a label next to this item on the 3D map @@ -48,6 +50,26 @@ struct MapSettings quint32 m_3DTrackColor; int m_3DModelMinPixelSize; float m_3DLabelScale; + + // Everything CZML::update() reads from these settings, rolled into one value so + // it can tell in a few instructions whether an item's 3D representation could + // have changed. ADD TO THIS whenever CZML starts reading another field, or a + // change to it will not reach the 3D map. + quint32 czmlSignature() const + { + quint32 h = m_enabled ? 1u : 0u; + h = (h << 1) | (m_display3DModel ? 1u : 0u); + h = (h << 1) | (m_display3DLabel ? 1u : 0u); + h = (h << 1) | (m_display3DPoint ? 1u : 0u); + h = (h << 1) | (m_display3DTrack ? 1u : 0u); + h ^= m_3DPointColor * 2654435761u; + h ^= m_3DTrackColor * 2246822519u; + h ^= ((quint32) m_3DModelMinPixelSize) * 3266489917u; + h ^= ((quint32) (m_3DLabelScale * 1000.0f)) * 668265263u; + h ^= qHash(m_2DTrackPalette); // Colours the 3D track's altitude segments + h ^= ((quint32) m_smoothingWindow) * 2166136261u; // Switches the 3D track between path and smoothed polylines + return h; + } QString m_filterName; QRegularExpression m_filterNameRE; int m_filterDistance; // Filter items > this distance in metres away from My Position. <= 0 don't filter @@ -55,6 +77,8 @@ struct MapSettings int m_smoothingWindow; // Window size (numer of points) to smooth over. 0 for no smoothing float m_smoothingLambda; // Lambda parameter for WhittakerEilers, controls how much smoothing to apply + static QString defaultTrackPalette(const QString& group); + MapItemSettings(const QString& group, bool enabled, const QColor color, bool display2DTrack=true, bool display3DPoint=true, int minZoom=11, int modelMinPixelSize=0); MapItemSettings(const QByteArray& data); void resetToDefaults(); @@ -88,6 +112,7 @@ struct MapSettings uint16_t m_reverseAPIFeatureIndex; Serializable *m_rollupState; bool m_map2DEnabled; + bool m_useLiveryIcons; // Use aircraft icons with airline liveries on 2D map, instead of the sender's plain icons QString m_mapType; // "Street Map", "Satellite Map", etc.. as selected in combobox int m_workspaceIndex; QByteArray m_geometryBytes; @@ -98,14 +123,25 @@ struct MapSettings QString m_buildings; // "None" or "Cesium OSM Buildings" QString m_modelURL; // Base URL for 3D models (Not user settable, as depends on web server port) QString m_modelDir; // Directory to store 3D models (not customizable for now, as ADS-B plugin needs to know) + QString m_msfsNavigraphDir; // Directory recursively scanned for Navigraph waypoint BGL files + QString m_msfsAircraftDir; // Parent directory scanned for MSFS aircraft.cfg files bool m_sunLightEnabled; // Light globe from direction of Sun float m_lightIntensity; // Intensity of camera light bool m_eciCamera; // Use ECI instead of ECEF for camera QString m_cesiumIonAPIKey; bool m_fxaa; int m_msaa; + // Where the 2D map was left, so it can be restored when the Map is next opened. + // m_mapZoomLevel < 0 means nothing has been saved yet, in which case the map is + // centred on the station. 0,0 is a valid position, so it can't mean that. + float m_mapCenterLatitude; + float m_mapCenterLongitude; + float m_mapZoomLevel; bool m_terrainLighting; bool m_water; + //!< Google Photorealistic 3D Tiles - replaces terrain, buildings and imagery and + //!< hides the globe (so globe-draped overlays too). Requires a user Cesium Ion key. + bool m_googlePhotorealistic3DTiles; bool m_hdr; bool m_fog; bool m_fps; @@ -123,7 +159,47 @@ struct MapSettings bool m_displayMagDec; bool m_displayMaidenheadGrid; bool m_displayPFD; - bool m_viewFirstPerson; + bool m_displayND; + int m_mapItemSoundVolume; //!< [0..100] Engine and animation sounds located at map items + int m_cockpitSoundVolume; //!< [0..100] Altitude callouts, datalink ring, etc + bool m_audioMuted; //!< Toolbar mute: silences all 3D map audio, volumes kept + //!< Master switch for the cockpit panels: the toolbar button turns everything + //!< selected in its menu on or off together. A panel is shown only when this and + //!< its own flag below are both set + bool m_displayCockpitPanels; + bool m_displayEFIS; //!< Display the EFIS control panel on the 3D map + bool m_displayRMP; //!< Display the RMP (radio management / DRAIMS) panel on the 3D map + bool m_displayDCDU; //!< Display the DCDU (and allow it to pop on messages) + // The RMP's two VHF COM channels: the AM Demod each is linked to, as "R<deviceSet>:<channel>" + // (empty for unassigned), and its standby frequency in Hz. The active frequency is + // not stored - it lives in the AM Demod and is read back from it + QString m_vhf1Channel; + QString m_vhf2Channel; + int m_vhf1Standby; + int m_vhf2Standby; + // Position and size of each cockpit panel as the 3D map page last reported them, as + // compact JSON: {"pfd": {"l": left, "t": top, "w": width, "h": height}, ...} in CSS + // pixels. One setting rather than four per panel, so adding a panel needs no new key + QString m_cockpitPanelGeometry; + // What the EFIS panel's knobs and pushbuttons were left set to, as compact JSON: + // {"mode", "range", "wx", "terr", "arpt", "vor", "tcas"} + QString m_efisState; + //!< Bumped when a default in m_itemSettings changes in a way a stored preset would + //!< otherwise override for ever - see deserialize(). 0 means a preset written before + //!< airspaces were given a 2D fill. + int m_itemSettingsVersion; + //!< How the 2D map, the 3D map and the NASA panel divide the window, as QSplitter + //!< writes it. Not user editable, so it is nowhere in the settings dialog - it is + //!< saved because the layout is worth keeping across a restart, like the map + //!< position beside it. + QByteArray m_splitterState; + // How the camera follows the tracked object on the 3D map + enum CameraMode { + ThirdPerson = 0, + FirstPerson = 1, + FlyBy = 2 //!< Held ahead of and beside the object, watching it pass + }; + int m_cameraMode; QString m_defaultImagery; QString m_checkWXAPIKey; //!< checkwxapi.com API key @@ -144,15 +220,22 @@ struct MapSettings void deserializeItemSettings(const QByteArray& data, QHash<QString, MapItemSettings *>& itemSettings); void applySettings(const QStringList& settingsKeys, const MapSettings& settings); QString getDebugString(const QStringList& settingsKeys, bool force=false) const; + //!< Whether the user has entered their own Cesium Ion API key. Options in + //!< m_cesiumIon* use Cesium Ion quota, so are unavailable without one. + bool hasCesiumIonUserKey() const { return !m_cesiumIonAPIKey.trimmed().isEmpty(); } static const QStringList m_pipeTypes; static const QStringList m_pipeURIs; static const QStringList m_mapProviders; static const QStringList m_mapProviderNames; + + // Imagery/terrain/buildings options that consume Cesium Ion quota + static const QStringList m_cesiumIonImagery; + static const QStringList m_cesiumIonTerrain; + static const QStringList m_cesiumIonBuildings; }; Q_DECLARE_METATYPE(MapSettings::MapItemSettings *); #endif // INCLUDE_FEATURE_MAPSETTINGS_H_ - diff --git a/plugins/feature/map/mapsettingsdialog.cpp b/plugins/feature/map/mapsettingsdialog.cpp index f77db06b3..b6c8f4c56 100644 --- a/plugins/feature/map/mapsettingsdialog.cpp +++ b/plugins/feature/map/mapsettingsdialog.cpp @@ -20,9 +20,21 @@ #include <QColor> #include <QToolButton> #include <QFileDialog> +#include <QDir> +#include <QPointer> +#include <QStandardItemModel> +#include <QThread> + +#include "util/flightpathpalette.h" +#include "maincore.h" +#include "channel/channelapi.h" #include "mapsettingsdialog.h" #include "gui/messagedialog.h" +#include "msfsassetconverter/batchconverter.h" + +// Shown in the palette column when the track is drawn in a single colour +const QString NO_PALETTE = "None"; #if (QT_VERSION < QT_VERSION_CHECK(6, 6, 0)) #include <QtGui/private/qzipreader_p.h> @@ -35,6 +47,10 @@ MapItemSettingsGUI::MapItemSettingsGUI(QTableWidget *table, int row, MapSettings m_point3D(table, row, MapSettingsDialog::COL_3D_POINT, !settings->m_display3DPoint, settings->m_3DPointColor), m_track3D(table, row, MapSettingsDialog::COL_3D_TRACK, !settings->m_display3DTrack, settings->m_3DTrackColor) { + m_trackPalette = new QComboBox(table); + m_trackPalette->addItem(NO_PALETTE); + m_trackPalette->addItems(FlightPathPalette::getPaletteNames()); + m_trackPalette->setCurrentText(settings->m_2DTrackPalette.isEmpty() ? NO_PALETTE : settings->m_2DTrackPalette); m_minZoom = new QSpinBox(table); m_minZoom->setRange(0, 15); m_minZoom->setValue(settings->m_2DMinZoom); @@ -62,6 +78,7 @@ MapItemSettingsGUI::MapItemSettingsGUI(QTableWidget *table, int row, MapSettings m_smoothingLambda->setRange(0, 1e9); m_smoothingLambda->setValue(settings->m_smoothingLambda); m_smoothingLambda->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + table->setCellWidget(row, MapSettingsDialog::COL_2D_TRACK_PALETTE, m_trackPalette); table->setCellWidget(row, MapSettingsDialog::COL_2D_MIN_ZOOM, m_minZoom); table->setCellWidget(row, MapSettingsDialog::COL_3D_MIN_PIXELS, m_minPixels); table->setCellWidget(row, MapSettingsDialog::COL_3D_LABEL_SCALE, m_labelScale); @@ -79,6 +96,7 @@ MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : m_fileIdx(0), m_downloadDialog(this), m_progressDialog(nullptr), + m_msfsWorker(nullptr), ui(new Ui::MapSettingsDialog) { ui->setupUi(this); @@ -102,6 +120,7 @@ MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : ui->osmURL->setText(settings->m_osmURL); ui->mapBoxStyles->setText(settings->m_mapBoxStyles); ui->map2DEnabled->setChecked(m_settings->m_map2DEnabled); + ui->useLiveryIcons->setChecked(m_settings->m_useLiveryIcons); ui->map3DEnabled->setChecked(m_settings->m_map3DEnabled); ui->defaultImagery->setCurrentIndex(ui->defaultImagery->findText(m_settings->m_defaultImagery)); ui->terrain->setCurrentIndex(ui->terrain->findText(m_settings->m_terrain)); @@ -114,9 +133,39 @@ MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : ui->msaa->setCurrentText(msaaToString(m_settings->m_msaa)); ui->terrainLighting->setChecked(m_settings->m_terrainLighting); ui->water->setChecked(m_settings->m_water); + ui->googlePhotorealistic3DTiles->setChecked(m_settings->m_googlePhotorealistic3DTiles); ui->hdr->setChecked(m_settings->m_hdr); ui->fog->setChecked(m_settings->m_fog); ui->fps->setChecked(m_settings->m_fps); + ui->mapItemSoundVolume->setValue(m_settings->m_mapItemSoundVolume); + ui->cockpitSoundVolume->setValue(m_settings->m_cockpitSoundVolume); + ui->msfsNavigraphDirectory->setText(QDir::toNativeSeparators(m_settings->m_msfsNavigraphDir)); + ui->msfsAircraftDirectory->setText(QDir::toNativeSeparators(m_settings->m_msfsAircraftDir)); + ui->msfsOutputDirectory->setText(QDir::toNativeSeparators(QDir(m_settings->m_modelDir).filePath("MSFS"))); + ui->cancelMSFS->setEnabled(false); + + // The AM Demods the RMP's VHF channels can be linked to. The dialog is rebuilt each + // time it is opened, so the list is simply what exists now + std::vector<ChannelAPI*> amDemods = MainCore::instance()->getChannels("sdrangel.channel.amdemod"); + for (QComboBox *combo : {ui->vhf1Channel, ui->vhf2Channel}) + { + combo->addItem("None", ""); + for (const auto channel : amDemods) + { + const QString id = QString("R%1:%2").arg(channel->getDeviceSetIndex()).arg(channel->getIndexInDeviceSet()); + combo->addItem(id, id); + } + } + // A linked channel that no longer exists is kept, as it may be created later on + for (const auto& pair : {std::make_pair(ui->vhf1Channel, m_settings->m_vhf1Channel), std::make_pair(ui->vhf2Channel, m_settings->m_vhf2Channel)}) + { + QComboBox *combo = pair.first; + const QString& id = pair.second; + if (!id.isEmpty() && (combo->findData(id) < 0)) { + combo->addItem(id, id); + } + combo->setCurrentIndex(combo->findData(id)); + } // Sort groups in table alphabetically QList<MapSettings::MapItemSettings *> itemSettings = m_settings->m_itemSettings.values(); @@ -180,7 +229,12 @@ MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : connect(&m_ourAirportsDB, &OurAirportsDB::downloadProgress, this, &MapSettingsDialog::downloadProgress); connect(&m_ourAirportsDB, &OurAirportsDB::downloadError, this, &MapSettingsDialog::downloadError); connect(&m_ourAirportsDB, &OurAirportsDB::downloadAirportInformationFinished, this, &MapSettingsDialog::downloadAirportInformationFinished); + connect(&m_waypoints, &Waypoints::downloadingURL, this, &MapSettingsDialog::downloadingURL); + connect(&m_waypoints, &Waypoints::downloadError, this, &MapSettingsDialog::downloadError); connect(&m_waypoints, &Waypoints::downloadWaypointsFinished, this, &MapSettingsDialog::downloadWaypointsFinished); + connect(&m_sidStar, &SidStar::downloadingURL, this, &MapSettingsDialog::downloadingURL); + connect(&m_sidStar, &SidStar::downloadError, this, &MapSettingsDialog::downloadError); + connect(&m_sidStar, &SidStar::downloadSidStarFinished, this, &MapSettingsDialog::downloadSidStarFinished); #ifndef QT_WEBENGINE_FOUND ui->map3DSettings->setVisible(false); @@ -198,6 +252,12 @@ MapSettingsDialog::MapSettingsDialog(MapSettings *settings, QWidget* parent) : MapSettingsDialog::~MapSettingsDialog() { + if (m_msfsCancelRequested) { + m_msfsCancelRequested->store(true); + } + if (m_msfsWorker) { + m_msfsWorker->wait(); + } delete ui; qDeleteAll(m_mapItemSettingsGUIs); } @@ -212,6 +272,11 @@ void MapSettingsDialog::accept() QString maptilerAPIKey = ui->maptilerAPIKey->text(); QString cesiumIonAPIKey = ui->cesiumIonAPIKey->text(); QString arcGISAPIKey = ui->arcGISAPIKey->text(); + QString msfsNavigraphDir = QDir::fromNativeSeparators(ui->msfsNavigraphDirectory->text().trimmed()); + if (!msfsNavigraphDir.isEmpty()) { + msfsNavigraphDir = QDir::cleanPath(msfsNavigraphDir); + } + QString msfsAircraftDir = QDir::cleanPath(QDir::fromNativeSeparators(ui->msfsAircraftDirectory->text().trimmed())); m_osmURLChanged = osmURL != m_settings->m_osmURL; if ((mapProvider != m_settings->m_mapProvider) || (thunderforestAPIKey != m_settings->m_thunderforestAPIKey) @@ -250,11 +315,26 @@ void MapSettingsDialog::accept() m_settings->m_map2DEnabled = ui->map2DEnabled->isChecked(); m_settingsKeysChanged.append("map2DEnabled"); } + if (m_settings->m_useLiveryIcons != ui->useLiveryIcons->isChecked()) + { + m_settings->m_useLiveryIcons = ui->useLiveryIcons->isChecked(); + m_settingsKeysChanged.append("useLiveryIcons"); + } if (m_settings->m_map3DEnabled != ui->map3DEnabled->isChecked()) { m_settings->m_map3DEnabled = ui->map3DEnabled->isChecked(); m_settingsKeysChanged.append("map3DEnabled"); } + if (m_settings->m_msfsNavigraphDir != msfsNavigraphDir) + { + m_settings->m_msfsNavigraphDir = msfsNavigraphDir; + m_settingsKeysChanged.append("msfsNavigraphDir"); + } + if (m_settings->m_msfsAircraftDir != msfsAircraftDir) + { + m_settings->m_msfsAircraftDir = msfsAircraftDir; + m_settingsKeysChanged.append("msfsAircraftDir"); + } if (m_settings->m_defaultImagery != ui->defaultImagery->currentText()) { m_settings->m_defaultImagery = ui->defaultImagery->currentText(); @@ -305,6 +385,11 @@ void MapSettingsDialog::accept() m_settings->m_water = ui->water->isChecked(); m_settingsKeysChanged.append("water"); } + if (m_settings->m_googlePhotorealistic3DTiles != ui->googlePhotorealistic3DTiles->isChecked()) + { + m_settings->m_googlePhotorealistic3DTiles = ui->googlePhotorealistic3DTiles->isChecked(); + m_settingsKeysChanged.append("googlePhotorealistic3DTiles"); + } if (m_settings->m_hdr != ui->hdr->isChecked()) { m_settings->m_hdr = ui->hdr->isChecked(); @@ -320,6 +405,27 @@ void MapSettingsDialog::accept() m_settings->m_fps = ui->fps->isChecked(); m_settingsKeysChanged.append("fps"); } + if (m_settings->m_mapItemSoundVolume != ui->mapItemSoundVolume->value()) + { + m_settings->m_mapItemSoundVolume = ui->mapItemSoundVolume->value(); + m_settingsKeysChanged.append("mapItemSoundVolume"); + } + if (m_settings->m_cockpitSoundVolume != ui->cockpitSoundVolume->value()) + { + m_settings->m_cockpitSoundVolume = ui->cockpitSoundVolume->value(); + m_settingsKeysChanged.append("cockpitSoundVolume"); + } + // The 3D map need not be reloaded for these: the RMP is told its new channels + if (m_settings->m_vhf1Channel != ui->vhf1Channel->currentData().toString()) + { + m_settings->m_vhf1Channel = ui->vhf1Channel->currentData().toString(); + m_settingsKeysChanged.append("vhf1Channel"); + } + if (m_settings->m_vhf2Channel != ui->vhf2Channel->currentData().toString()) + { + m_settings->m_vhf2Channel = ui->vhf2Channel->currentData().toString(); + m_settingsKeysChanged.append("vhf2Channel"); + } for (int row = 0; row < ui->mapItemSettings->rowCount(); row++) { @@ -331,6 +437,7 @@ void MapSettingsDialog::accept() itemSettings->m_display2DLabel = ui->mapItemSettings->item(row, COL_2D_LABEL)->checkState() == Qt::Checked; itemSettings->m_display2DTrack = !gui->m_track2D.m_noColor; itemSettings->m_2DTrackColor = gui->m_track2D.m_color; + itemSettings->m_2DTrackPalette = gui->m_trackPalette->currentText() == NO_PALETTE ? "" : gui->m_trackPalette->currentText(); itemSettings->m_2DMinZoom = gui->m_minZoom->value(); itemSettings->m_display3DModel = ui->mapItemSettings->item(row, COL_3D_MODEL)->checkState() == Qt::Checked; itemSettings->m_display3DLabel = ui->mapItemSettings->item(row, COL_3D_LABEL)->checkState() == Qt::Checked; @@ -359,6 +466,7 @@ void MapSettingsDialog::on_map2DEnabled_clicked(bool checked) ui->mapItemSettings->showColumn(COL_2D_LABEL); ui->mapItemSettings->showColumn(COL_2D_MIN_ZOOM); ui->mapItemSettings->showColumn(COL_2D_TRACK); + ui->mapItemSettings->showColumn(COL_2D_TRACK_PALETTE); } else { @@ -366,10 +474,12 @@ void MapSettingsDialog::on_map2DEnabled_clicked(bool checked) ui->mapItemSettings->hideColumn(COL_2D_LABEL); ui->mapItemSettings->hideColumn(COL_2D_MIN_ZOOM); ui->mapItemSettings->hideColumn(COL_2D_TRACK); + ui->mapItemSettings->hideColumn(COL_2D_TRACK_PALETTE); } ui->mapProvider->setEnabled(checked); ui->osmURL->setEnabled(checked); ui->mapBoxStyles->setEnabled(checked); + ui->useLiveryIcons->setEnabled(checked); } void MapSettingsDialog::on_map3DEnabled_clicked(bool checked) @@ -396,12 +506,12 @@ void MapSettingsDialog::on_map3DEnabled_clicked(bool checked) ui->mapItemSettings->hideColumn(COL_SMOOTHING_WINDOW); ui->mapItemSettings->hideColumn(COL_SMOOTHING_LAMBDA); } - ui->terrain->setEnabled(checked); - ui->buildings->setEnabled(checked); ui->sunLightEnabled->setEnabled(checked); ui->eciCamera->setEnabled(checked); ui->fxaa->setEnabled(checked); ui->msaa->setEnabled(checked); + // Enables imagery, terrain and buildings, subject to Cesium Ion and Google 3D tiles + updateCesiumIonItems(); } void MapSettingsDialog::on_terrain_currentIndexChanged(int index) @@ -409,9 +519,84 @@ void MapSettingsDialog::on_terrain_currentIndexChanged(int index) (void) index; bool ellipsoid = ui->terrain->currentText() == "Ellipsoid"; + bool googleTiles = ui->googlePhotorealistic3DTiles->isChecked(); + + ui->terrainLighting->setEnabled(!ellipsoid && !googleTiles); + ui->water->setEnabled(!ellipsoid && !googleTiles); +} + +void MapSettingsDialog::on_cesiumIonAPIKey_textChanged(const QString& text) +{ + (void) text; + + updateCesiumIonItems(); +} + +void MapSettingsDialog::on_googlePhotorealistic3DTiles_toggled(bool checked) +{ + (void) checked; + + updateCesiumIonItems(); +} + +// Grey out options that would use our Cesium Ion quota, unless the user has entered +// their own Cesium Ion API key, and those that Google's 3D tiles override +void MapSettingsDialog::updateCesiumIonItems() +{ + bool hasKey = !ui->cesiumIonAPIKey->text().trimmed().isEmpty(); + + ui->googlePhotorealistic3DTiles->setEnabled(hasKey && ui->map3DEnabled->isChecked()); + ui->googlePhotorealistic3DTiles->setToolTip(hasKey ? + "Display Google Photorealistic 3D Tiles. This replaces the imagery, terrain and buildings settings and hides map layers drawn on the globe, such as rain and clouds" + : "Requires a Cesium Ion API key"); + if (!hasKey) { + ui->googlePhotorealistic3DTiles->setChecked(false); + } + + updateComboItems(ui->defaultImagery, MapSettings::m_cesiumIonImagery, hasKey, "ArcGIS world imagery"); + updateComboItems(ui->terrain, MapSettings::m_cesiumIonTerrain, hasKey, "Ellipsoid"); + updateComboItems(ui->buildings, MapSettings::m_cesiumIonBuildings, hasKey, "None"); + + // Google's 3D tiles include imagery, terrain and buildings, so those settings are unused + bool googleTiles = ui->googlePhotorealistic3DTiles->isChecked(); + ui->defaultImagery->setEnabled(!googleTiles && ui->map3DEnabled->isChecked()); + ui->terrain->setEnabled(!googleTiles && ui->map3DEnabled->isChecked()); + ui->buildings->setEnabled(!googleTiles && ui->map3DEnabled->isChecked()); + on_terrain_currentIndexChanged(ui->terrain->currentIndex()); +} + +void MapSettingsDialog::updateComboItems(QComboBox *combo, const QStringList& ionItems, bool enable, const QString& fallback) +{ + QStandardItemModel *model = qobject_cast<QStandardItemModel *>(combo->model()); + + if (!model) + { + qDebug() << "MapSettingsDialog::updateComboItems: Can't disable items in" << combo->objectName(); + return; + } + for (const auto& ionItem : ionItems) + { + int idx = combo->findText(ionItem); - ui->terrainLighting->setEnabled(!ellipsoid); - ui->water->setEnabled(!ellipsoid); + if (idx >= 0) + { + QStandardItem *item = model->item(idx); + + item->setEnabled(enable); + item->setToolTip(enable ? "" : "Requires a Cesium Ion API key"); + // Don't leave a disabled item selected + if (!enable && (combo->currentIndex() == idx)) + { + int fallbackIdx = combo->findText(fallback); + + if (fallbackIdx >= 0) { + combo->setCurrentIndex(fallbackIdx); + } else { + qDebug() << "MapSettingsDialog::updateComboItems: No" << fallback << "in" << combo->objectName(); + } + } + } + } } // Models have individual licensing. See LICENSE on github @@ -458,6 +643,159 @@ void MapSettingsDialog::unzip(const QString &filename) } } +void MapSettingsDialog::on_msfsBrowse_clicked() +{ + const QString directory = QFileDialog::getExistingDirectory( + this, + "Select the parent directory containing MSFS aircraft", + ui->msfsAircraftDirectory->text()); + if (!directory.isEmpty()) { + ui->msfsAircraftDirectory->setText(QDir::toNativeSeparators(directory)); + } +} + +void MapSettingsDialog::on_msfsNavigraphBrowse_clicked() +{ + const QString directory = QFileDialog::getExistingDirectory( + this, + "Select the Navigraph BGL directory", + ui->msfsNavigraphDirectory->text()); + if (!directory.isEmpty()) { + ui->msfsNavigraphDirectory->setText(QDir::toNativeSeparators(directory)); + } +} + +void MapSettingsDialog::on_convertMSFS_clicked() +{ + if (m_msfsWorker) { + return; + } + + const QString aircraftDirectory = QFileInfo( + QDir::fromNativeSeparators(ui->msfsAircraftDirectory->text().trimmed())).absoluteFilePath(); + if (!QFileInfo(aircraftDirectory).isDir()) + { + QMessageBox::critical(this, "MSFS aircraft conversion", + QString("Aircraft directory does not exist: %1").arg(QDir::toNativeSeparators(aircraftDirectory))); + return; + } + + const QString outputDirectory = QDir(m_settings->m_modelDir).filePath("MSFS"); + ui->msfsOutputDirectory->setText(QDir::toNativeSeparators(outputDirectory)); + ui->msfsLog->clear(); + ui->msfsProgress->setRange(0, 0); + ui->convertMSFS->setEnabled(false); + ui->cancelMSFS->setEnabled(true); + ui->msfsBrowse->setEnabled(false); + ui->msfsAircraftDirectory->setEnabled(false); + ui->buttonBox->setEnabled(false); + + m_msfsCancelRequested = std::make_shared<std::atomic_bool>(false); + const auto cancelRequested = m_msfsCancelRequested; + const QPointer<MapSettingsDialog> dialog(this); + m_msfsWorker = QThread::create([dialog, aircraftDirectory, outputDirectory, cancelRequested] { + MSFSBatchConversionSummary summary; + QString error; + const bool success = convertMSFSAircraftDirectory( + aircraftDirectory, + outputDirectory, + &summary, + &error, + [dialog](int current, int total, const QString& message) { + if (dialog) { + QMetaObject::invokeMethod(dialog.data(), [dialog, current, total, message] { + if (dialog) { + dialog->updateMSFSProgress(current, total, message); + } + }, Qt::QueuedConnection); + } + }, + [cancelRequested] { return cancelRequested->load(); }); + + if (dialog) { + QMetaObject::invokeMethod(dialog.data(), [dialog, success, summary, error] { + if (dialog) { + dialog->msfsConversionFinished(success, summary, error); + } + }, Qt::QueuedConnection); + } + }); + connect(m_msfsWorker, &QThread::finished, this, [this] { m_msfsWorker = nullptr; }); + connect(m_msfsWorker, &QThread::finished, m_msfsWorker, &QObject::deleteLater); + m_msfsWorker->start(); +} + +void MapSettingsDialog::on_cancelMSFS_clicked() +{ + if (m_msfsCancelRequested) + { + m_msfsCancelRequested->store(true); + ui->cancelMSFS->setEnabled(false); + ui->msfsLog->appendPlainText("Cancelling after the current conversion step…"); + } +} + +void MapSettingsDialog::updateMSFSProgress(int current, int total, const QString& message) +{ + if (total <= 0) { + ui->msfsProgress->setRange(0, 0); + } else { + ui->msfsProgress->setRange(0, total); + ui->msfsProgress->setValue(current); + } + ui->msfsLog->appendPlainText(message); +} + +void MapSettingsDialog::msfsConversionFinished( + bool success, const MSFSBatchConversionSummary& summary, const QString& error) +{ + m_msfsCancelRequested.reset(); + ui->convertMSFS->setEnabled(true); + ui->cancelMSFS->setEnabled(false); + ui->msfsBrowse->setEnabled(true); + ui->msfsAircraftDirectory->setEnabled(true); + ui->buttonBox->setEnabled(true); + + if (!success) + { + ui->msfsProgress->setRange(0, 1); + ui->msfsProgress->setValue(0); + ui->msfsLog->appendPlainText(QString("ERROR: %1").arg(error)); + QMessageBox::critical(this, "MSFS aircraft conversion", error); + return; + } + + ui->msfsProgress->setRange(0, qMax(1, summary.m_discovered)); + ui->msfsProgress->setValue(summary.m_converted + summary.m_failed); + const QString result = summary.m_cancelled + ? QString("Conversion cancelled. %1 of %2 aircraft variants converted; %3 failed.") + .arg(summary.m_converted).arg(summary.m_discovered).arg(summary.m_failed) + : QString("Conversion complete. %1 of %2 aircraft variants converted; %3 failed. Restart SDRangel to make the new models available.") + .arg(summary.m_converted).arg(summary.m_discovered).arg(summary.m_failed); + const QString performance = QString(" Used %1 worker%2; %3 cached texture%4 reused; " + "%5 missing optional texture%6 replaced; " + "%7 missing fallback director%8 skipped.") + .arg(summary.m_workerCount) + .arg(summary.m_workerCount == 1 ? QString() : QStringLiteral("s")) + .arg(summary.m_reusedTextures) + .arg(summary.m_reusedTextures == 1 ? QString() : QStringLiteral("s")) + .arg(summary.m_synthesizedTextures) + .arg(summary.m_synthesizedTextures == 1 ? QString() : QStringLiteral("s")) + .arg(summary.m_skippedFallbackDirectories) + .arg(summary.m_skippedFallbackDirectories == 1 + ? QStringLiteral("y") : QStringLiteral("ies")); + const QString resultWithPerformance = result + performance; + ui->msfsLog->appendPlainText(resultWithPerformance); + + if (summary.m_cancelled) { + QMessageBox::information(this, "MSFS aircraft conversion", resultWithPerformance); + } else if (summary.m_failed > 0) { + QMessageBox::warning(this, "MSFS aircraft conversion", resultWithPerformance + " See the log for details."); + } else { + QMessageBox::information(this, "MSFS aircraft conversion", resultWithPerformance); + } +} + void MapSettingsDialog::on_downloadModels_clicked() { m_downloadDialog.setText("Downloading 3D models"); @@ -560,13 +898,34 @@ void MapSettingsDialog::on_getWaypoints_clicked() if (m_progressDialog == nullptr) { m_progressDialog = new QProgressDialog(this); - m_progressDialog->setMaximum(1); + // Two steps, not one: downloadingURL() advances the bar by one, and a + // QProgressDialog defaults to autoReset and autoClose, so a maximum of 1 would + // have it hide itself the moment the download started. Neither of these emits a + // byte level progress signal, so the second step is the download completing. + m_progressDialog->setMaximum(2); m_progressDialog->setCancelButton(nullptr); m_progressDialog->setWindowFlag(Qt::WindowCloseButtonHint, false); m_waypoints.downloadWaypoints(); } } +void MapSettingsDialog::on_getSidStar_clicked() +{ + // Don't try to download while already in progress + if (m_progressDialog == nullptr) + { + m_progressDialog = new QProgressDialog(this); + // Two steps, not one: downloadingURL() advances the bar by one, and a + // QProgressDialog defaults to autoReset and autoClose, so a maximum of 1 would + // have it hide itself the moment the download started. Neither of these emits a + // byte level progress signal, so the second step is the download completing. + m_progressDialog->setMaximum(2); + m_progressDialog->setCancelButton(nullptr); + m_progressDialog->setWindowFlag(Qt::WindowCloseButtonHint, false); + m_sidStar.downloadSidStar(); + } +} + void MapSettingsDialog::downloadingURL(const QString& url) { if (m_progressDialog) @@ -647,6 +1006,21 @@ void MapSettingsDialog::downloadWaypointsFinished() } } +void MapSettingsDialog::downloadSidStarFinished() +{ + // No sidStarUpdated() to go with this, unlike the databases above: the Map draws none + // of these itself. SIDs and STARs are read by the Aircraft feature when it expands a + // flight plan, and SidStar::getWaypoints() re-reads the file whenever its modification + // time has moved - so a fresh download is picked up on the next route drawn, with + // nothing here needing to say so. + if (m_progressDialog) + { + m_progressDialog->close(); + delete m_progressDialog; + m_progressDialog = nullptr; + } +} + void MapSettingsDialog::on_sunLightEnabled_currentIndexChanged(int index) { ui->lightIntensity->setEnabled(index == 0); diff --git a/plugins/feature/map/mapsettingsdialog.h b/plugins/feature/map/mapsettingsdialog.h index fb80c2279..e57bef5ca 100644 --- a/plugins/feature/map/mapsettingsdialog.h +++ b/plugins/feature/map/mapsettingsdialog.h @@ -21,20 +21,29 @@ #ifndef INCLUDE_FEATURE_MAPSETTINGSDIALOG_H #define INCLUDE_FEATURE_MAPSETTINGSDIALOG_H +#include <QComboBox> #include <QSpinBox> #include <QDoubleSpinBox> #include <QMessageBox> +#include <QPointer> #include <QProgressDialog> +#include <QThread> + +#include <atomic> +#include <memory> #include "gui/httpdownloadmanagergui.h" #include "gui/tablecolorchooser.h" #include "util/openaip.h" #include "util/ourairportsdb.h" #include "util/waypoints.h" +#include "util/sidstar.h" #include "ui_mapsettingsdialog.h" #include "mapsettings.h" +struct MSFSBatchConversionSummary; + class MapItemSettingsGUI : public QObject { Q_OBJECT public: @@ -44,6 +53,7 @@ public: TableColorChooser m_track2D; TableColorChooser m_point3D; TableColorChooser m_track3D; + QComboBox *m_trackPalette; QSpinBox *m_minZoom; QSpinBox *m_minPixels; QDoubleSpinBox *m_labelScale; @@ -65,6 +75,7 @@ public: COL_2D_LABEL, COL_2D_MIN_ZOOM, COL_2D_TRACK, + COL_2D_TRACK_PALETTE, COL_3D_MODEL, COL_3D_MIN_PIXELS, COL_3D_LABEL, @@ -93,20 +104,34 @@ private: OpenAIP m_openAIP; OurAirportsDB m_ourAirportsDB; Waypoints m_waypoints; + SidStar m_sidStar; + QPointer<QThread> m_msfsWorker; + std::shared_ptr<std::atomic_bool> m_msfsCancelRequested; void unzip(const QString &filename); QString msaaToString(int msaa) const; int stringToMSAA(const QString& string) const; - + void updateCesiumIonItems(); + void updateComboItems(QComboBox *combo, const QStringList& ionItems, bool enable, const QString& fallback); + void updateMSFSProgress(int current, int total, const QString& message); + void msfsConversionFinished(bool success, const MSFSBatchConversionSummary& summary, const QString& error); + private slots: void accept(); void on_map2DEnabled_clicked(bool checked=false); void on_map3DEnabled_clicked(bool checked=false); void on_terrain_currentIndexChanged(int index); + void on_cesiumIonAPIKey_textChanged(const QString& text); + void on_googlePhotorealistic3DTiles_toggled(bool checked); void on_downloadModels_clicked(); + void on_msfsNavigraphBrowse_clicked(); + void on_msfsBrowse_clicked(); + void on_convertMSFS_clicked(); + void on_cancelMSFS_clicked(); void on_getAirportDB_clicked(); void on_getAirspacesDB_clicked(); void on_getWaypoints_clicked(); + void on_getSidStar_clicked(); void on_sunLightEnabled_currentIndexChanged(int index); void downloadComplete(const QString &filename, bool success, const QString &url, const QString &errorMessage); void downloadingURL(const QString& url); @@ -116,6 +141,7 @@ private slots: void downloadNavAidsFinished(); void downloadAirportInformationFinished(); void downloadWaypointsFinished(); + void downloadSidStarFinished(); signals: void navAidsUpdated(); diff --git a/plugins/feature/map/mapsettingsdialog.ui b/plugins/feature/map/mapsettingsdialog.ui index df2a98334..d7f202cfd 100644 --- a/plugins/feature/map/mapsettingsdialog.ui +++ b/plugins/feature/map/mapsettingsdialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>1267</width> - <height>775</height> + <width>1023</width> + <height>918</height> </rect> </property> <property name="font"> @@ -28,7 +28,7 @@ <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>0</number> + <number>3</number> </property> <widget class="QWidget" name="mapsTab"> <attribute name="title"> @@ -123,6 +123,23 @@ </property> </widget> </item> + <item row="4" column="0"> + <widget class="QLabel" name="useLiveryIconsLabel"> + <property name="text"> + <string>Livery aircraft icons</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QCheckBox" name="useLiveryIcons"> + <property name="toolTip"> + <string>Display aircraft icons showing airline liveries, matched from the aircraft type and operator, instead of black icons</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> </layout> </widget> </item> @@ -131,7 +148,41 @@ <property name="title"> <string>3D Map Settings</string> </property> - <layout class="QFormLayout" name="formLayout"> + <layout class="QGridLayout" name="gridLayout"> + <item row="3" column="0"> + <widget class="QLabel" name="terrainLabel"> + <property name="text"> + <string>Terrain</string> + </property> + </widget> + </item> + <item row="14" column="1"> + <widget class="QCheckBox" name="fps"> + <property name="toolTip"> + <string>Display frames per second (FPS)</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="googlePhotorealistic3DTiles"> + <property name="toolTip"> + <string>Display Google Photorealistic 3D Tiles. This replaces the imagery, terrain and buildings settings and hides map layers drawn on the globe, such as rain and clouds. Uses Cesium Ion quota, so requires a Cesium Ion API key to be entered on the API keys tab</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="defaultImageryLabel"> + <property name="text"> + <string>Default imagery</string> + </property> + </widget> + </item> <item row="0" column="0"> <widget class="QLabel" name="map3DEnabledLabel"> <property name="minimumSize"> @@ -145,6 +196,23 @@ </property> </widget> </item> + <item row="12" column="0"> + <widget class="QLabel" name="fxaaLabel"> + <property name="text"> + <string>FXAA</string> + </property> + </widget> + </item> + <item row="12" column="1"> + <widget class="QCheckBox" name="fxaa"> + <property name="toolTip"> + <string>Fast Approximate Anti-aliasing</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> <item row="0" column="1"> <widget class="QCheckBox" name="map3DEnabled"> <property name="text"> @@ -152,17 +220,98 @@ </property> </widget> </item> + <item row="11" column="0"> + <widget class="QLabel" name="eciCameraLabel"> + <property name="text"> + <string>Camera reference frame</string> + </property> + </widget> + </item> + <item row="15" column="1"> + <widget class="QSlider" name="mapItemSoundVolume"> + <property name="toolTip"> + <string>Volume of sounds located at map items, such as engines and animation sounds</string> + </property> + <property name="maximum"> + <number>100</number> + </property> + <property name="value"> + <number>100</number> + </property> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + </widget> + </item> <item row="1" column="0"> - <widget class="QLabel" name="defaultImageryLabel"> + <widget class="QLabel" name="googlePhotorealistic3DTilesLabel"> <property name="text"> - <string>Default imagery</string> + <string>Google 3D tiles</string> </property> </widget> </item> - <item row="1" column="1"> + <item row="6" column="0"> + <widget class="QLabel" name="sunLightEnabledLabel"> + <property name="text"> + <string>Lighting</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="buildingsLabel"> + <property name="text"> + <string>Buildings</string> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QCheckBox" name="hdr"> + <property name="toolTip"> + <string>High dynamic range</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QComboBox" name="sunLightEnabled"> + <property name="toolTip"> + <string>Whether lighting is from the Sun or Camera</string> + </property> + <item> + <property name="text"> + <string>Camera</string> + </property> + </item> + <item> + <property name="text"> + <string>Sun</string> + </property> + </item> + </widget> + </item> + <item row="11" column="1"> + <widget class="QComboBox" name="eciCamera"> + <property name="toolTip"> + <string>Selects camera reference frame. For ECEF the camera rotates with the Earth. For ECI, the camera position is fixed relative to the stars and the Earth's rotation will be visible.</string> + </property> + <item> + <property name="text"> + <string>ECEF</string> + </property> + </item> + <item> + <property name="text"> + <string>ECI</string> + </property> + </item> + </widget> + </item> + <item row="2" column="1"> <widget class="QComboBox" name="defaultImagery"> <property name="toolTip"> - <string>Default imagery (Note there is a quota on Bing Maps Ariel usage)</string> + <string>Default imagery. Bing, Sentinel-2, Earth at night and Google use Cesium Ion quota, so require a Cesium Ion API key to be entered on the API keys tab</string> </property> <item> <property name="text"> @@ -189,17 +338,40 @@ <string>Ersi world ocean</string> </property> </item> + <item> + <property name="text"> + <string>Google Maps Satellite</string> + </property> + </item> + <item> + <property name="text"> + <string>Google Maps Satellite with Labels</string> + </property> + </item> + <item> + <property name="text"> + <string>Google Maps Roadmap</string> + </property> + </item> + <item> + <property name="text"> + <string>Google Maps Contour</string> + </property> + </item> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="terrainLabel"> + <item row="6" column="2"> + <widget class="QLabel" name="lightIntensityLabel"> <property name="text"> - <string>Terrain</string> + <string>Camera light Intensity</string> </property> </widget> </item> - <item row="2" column="1"> + <item row="3" column="1"> <widget class="QComboBox" name="terrain"> + <property name="toolTip"> + <string>Terrain provider. Cesium World Terrain uses Cesium Ion quota, so requires a Cesium Ion API key to be entered on the API keys tab</string> + </property> <item> <property name="text"> <string>Cesium World Terrain</string> @@ -222,49 +394,35 @@ </item> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="terrainLightingLabel"> - <property name="text"> - <string>Terrain lighting</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QCheckBox" name="terrainLighting"> - <property name="toolTip"> - <string>Enable terrain lighting</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="waterLabel"> + <item row="14" column="0"> + <widget class="QLabel" name="fpsLabel"> <property name="text"> - <string>Water effects</string> + <string>Display FPS</string> </property> </widget> </item> - <item row="4" column="1"> - <widget class="QCheckBox" name="water"> + <item row="9" column="1"> + <widget class="QCheckBox" name="fog"> <property name="toolTip"> - <string>Enable water effects such as waves</string> + <string>Enable fog effect</string> </property> <property name="text"> <string/> </property> </widget> </item> - <item row="5" column="0"> - <widget class="QLabel" name="buildingsLabel"> + <item row="15" column="0"> + <widget class="QLabel" name="mapItemSoundVolumeLabel"> <property name="text"> - <string>Buildings</string> + <string>Map item volume</string> </property> </widget> </item> <item row="5" column="1"> <widget class="QComboBox" name="buildings"> + <property name="toolTip"> + <string>Buildings to display. Cesium OSM Buildings uses Cesium Ion quota, so requires a Cesium Ion API key to be entered on the API keys tab</string> + </property> <item> <property name="text"> <string>None</string> @@ -277,38 +435,21 @@ </item> </widget> </item> - <item row="6" column="0"> - <widget class="QLabel" name="sunLightEnabledLabel"> + <item row="8" column="0"> + <widget class="QLabel" name="hdrLabel"> <property name="text"> - <string>Lighting</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QComboBox" name="sunLightEnabled"> - <property name="toolTip"> - <string>Whether lighting is from the Sun or Camera</string> + <string>HDR</string> </property> - <item> - <property name="text"> - <string>Camera</string> - </property> - </item> - <item> - <property name="text"> - <string>Sun</string> - </property> - </item> </widget> </item> - <item row="7" column="0"> - <widget class="QLabel" name="lightIntensityLabel"> + <item row="9" column="0"> + <widget class="QLabel" name="fogLabel"> <property name="text"> - <string>Camera light Intensity</string> + <string>Fog</string> </property> </widget> </item> - <item row="7" column="1"> + <item row="6" column="3"> <widget class="QDoubleSpinBox" name="lightIntensity"> <property name="toolTip"> <string>Intensity of camera light</string> @@ -324,89 +465,31 @@ </property> </widget> </item> - <item row="8" column="0"> - <widget class="QLabel" name="hdrLabel"> - <property name="text"> - <string>HDR</string> - </property> - </widget> - </item> - <item row="8" column="1"> - <widget class="QCheckBox" name="hdr"> - <property name="toolTip"> - <string>High dynamic range</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="9" column="0"> - <widget class="QLabel" name="fogLabel"> - <property name="text"> - <string>Fog</string> - </property> - </widget> - </item> - <item row="9" column="1"> - <widget class="QCheckBox" name="fog"> - <property name="toolTip"> - <string>Enable fog effect</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="11" column="0"> - <widget class="QLabel" name="eciCameraLabel"> - <property name="text"> - <string>Camera reference frame</string> - </property> - </widget> - </item> - <item row="11" column="1"> - <widget class="QComboBox" name="eciCamera"> - <property name="toolTip"> - <string>Selects camera reference frame. For ECEF the camera rotates with the Earth. For ECI, the camera position is fixed relative to the stars and the Earth's rotation will be visible.</string> - </property> - <item> - <property name="text"> - <string>ECEF</string> - </property> - </item> - <item> - <property name="text"> - <string>ECI</string> - </property> - </item> - </widget> - </item> - <item row="14" column="0"> - <widget class="QLabel" name="fpsLabel"> + <item row="9" column="2"> + <widget class="QLabel" name="waterLabel"> <property name="text"> - <string>Display FPS</string> + <string>Water effects</string> </property> </widget> </item> - <item row="14" column="1"> - <widget class="QCheckBox" name="fps"> + <item row="9" column="3"> + <widget class="QCheckBox" name="water"> <property name="toolTip"> - <string>Display frames per second (FPS)</string> + <string>Enable water effects such as waves</string> </property> <property name="text"> <string/> </property> </widget> </item> - <item row="13" column="0"> + <item row="12" column="2"> <widget class="QLabel" name="msaaLabel"> <property name="text"> <string>MSAA</string> </property> </widget> </item> - <item row="13" column="1"> + <item row="12" column="3"> <widget class="QComboBox" name="msaa"> <property name="toolTip"> <string>Multisample Anti-Aliasing</string> @@ -438,17 +521,68 @@ </item> </widget> </item> - <item row="12" column="0"> - <widget class="QLabel" name="fxaaLabel"> + <item row="15" column="2"> + <widget class="QLabel" name="cockpitSoundVolumeLabel"> <property name="text"> - <string>FXAA</string> + <string>Cockpit volume</string> </property> </widget> </item> - <item row="12" column="1"> - <widget class="QCheckBox" name="fxaa"> + <item row="15" column="3"> + <widget class="QSlider" name="cockpitSoundVolume"> <property name="toolTip"> - <string>Fast Approximate Anti-aliasing</string> + <string>Volume of cockpit sounds, such as altitude callouts and the datalink message ring</string> + </property> + <property name="maximum"> + <number>100</number> + </property> + <property name="value"> + <number>100</number> + </property> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + </widget> + </item> + <item row="16" column="0"> + <widget class="QLabel" name="vhf1ChannelLabel"> + <property name="text"> + <string>VHF1 AM Demod</string> + </property> + </widget> + </item> + <item row="16" column="1"> + <widget class="QComboBox" name="vhf1Channel"> + <property name="toolTip"> + <string>AM Demod channel tuned by the RMP's VHF1 active frequency</string> + </property> + </widget> + </item> + <item row="16" column="2"> + <widget class="QLabel" name="vhf2ChannelLabel"> + <property name="text"> + <string>VHF2 AM Demod</string> + </property> + </widget> + </item> + <item row="16" column="3"> + <widget class="QComboBox" name="vhf2Channel"> + <property name="toolTip"> + <string>AM Demod channel tuned by the RMP's VHF2 active frequency</string> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QLabel" name="terrainLightingLabel"> + <property name="text"> + <string>Terrain lighting</string> + </property> + </widget> + </item> + <item row="3" column="3"> + <widget class="QCheckBox" name="terrainLighting"> + <property name="toolTip"> + <string>Enable terrain lighting</string> </property> <property name="text"> <string/> @@ -525,6 +659,20 @@ </property> </widget> </item> + <item> + <widget class="QToolButton" name="getSidStar"> + <property name="toolTip"> + <string>Download SID and STAR procedures (1MB)</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="mapicons.qrc"> + <normaloff>:/map/icons/groundtracks.png</normaloff>:/map/icons/groundtracks.png</iconset> + </property> + </widget> + </item> <item> <spacer name="horizontalSpacer"> <property name="orientation"> @@ -589,6 +737,14 @@ <string>Track colour or 2D map</string> </property> </column> + <column> + <property name="text"> + <string>Palette</string> + </property> + <property name="toolTip"> + <string>Palette used to colour the track on the 2D and 3D maps according to the altitude of the object, with a colour for every 5000ft. None to draw the track in a single colour.</string> + </property> + </column> <column> <property name="text"> <string>3D Model</string> @@ -791,6 +947,140 @@ </item> </layout> </widget> + <widget class="QWidget" name="msfsTab"> + <attribute name="title"> + <string>MSFS</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QLabel" name="msfsDescription"> + <property name="text"> + <string>Use Microsoft Flight Simulator Navigraph waypoint data and convert FSLTL aircraft models.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QGridLayout" name="msfsDirectoryLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="msfsNavigraphDirectoryLabel"> + <property name="text"> + <string>Navigraph BGL directory</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="msfsNavigraphDirectory"> + <property name="toolTip"> + <string>Directory recursively scanned for Navigraph waypoint BGL files. Leave empty to use waypoints.csv.</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QPushButton" name="msfsNavigraphBrowse"> + <property name="text"> + <string>Browse…</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="msfsAircraftDirectoryLabel"> + <property name="text"> + <string>FSLTL directory</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="msfsAircraftDirectory"> + <property name="toolTip"> + <string>Parent directory recursively scanned for aircraft.cfg files</string> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QPushButton" name="msfsBrowse"> + <property name="text"> + <string>Browse…</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="msfsOutputDirectoryLabel"> + <property name="text"> + <string>Converted models</string> + </property> + </widget> + </item> + <item row="2" column="1" colspan="2"> + <widget class="QLabel" name="msfsOutputDirectory"> + <property name="text"> + <string/> + </property> + <property name="textInteractionFlags"> + <set>Qt::TextInteractionFlag::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QPushButton" name="convertMSFS"> + <property name="toolTip"> + <string>Convert every aircraft.cfg below the selected directory</string> + </property> + <property name="text"> + <string>Convert Aircraft Models</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="cancelMSFS"> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + <item> + <spacer name="msfsButtonSpacer"> + <property name="orientation"> + <enum>Qt::Orientation::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QProgressBar" name="msfsProgress"> + <property name="maximum"> + <number>1</number> + </property> + <property name="value"> + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QPlainTextEdit" name="msfsLog"> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="placeholderText"> + <string>Conversion progress and errors will appear here.</string> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> </layout> @@ -818,8 +1108,12 @@ <tabstop>buildings</tabstop> <tabstop>sunLightEnabled</tabstop> <tabstop>eciCamera</tabstop> - <tabstop>msaa</tabstop> <tabstop>downloadModels</tabstop> + <tabstop>msfsNavigraphDirectory</tabstop> + <tabstop>msfsNavigraphBrowse</tabstop> + <tabstop>msfsAircraftDirectory</tabstop> + <tabstop>msfsBrowse</tabstop> + <tabstop>convertMSFS</tabstop> <tabstop>thunderforestAPIKey</tabstop> <tabstop>maptilerAPIKey</tabstop> <tabstop>mapBoxAPIKey</tabstop> diff --git a/plugins/feature/map/maptileserver.h b/plugins/feature/map/maptileserver.h index 1dd43fbc3..28c5c7b66 100644 --- a/plugins/feature/map/maptileserver.h +++ b/plugins/feature/map/maptileserver.h @@ -24,12 +24,16 @@ #include <QDebug> #include <QtNetwork> #include <QImage> +#include <QImageReader> +#include <QBuffer> #include <QPainter> #include <QHash> #include <QMutex> #include <QMutexLocker> #include <QNetworkDiskCache> +#include "util/profiler.h" + class MapTileServer : public QTcpServer { Q_OBJECT @@ -190,6 +194,7 @@ public: QImage combine(const TileJob *job) { + PROFILER_START() // Don't use job->m_images[job->m_urls[0]].size() as not always valid (E.g. map tiler can return http 204 - no content) // Do we need to support 512x512? QImage image(QSize(256, 256), QImage::Format_ARGB32_Premultiplied); @@ -209,11 +214,54 @@ public: } } + PROFILER_STOP("Map tile combine") return image; } + // A single-layer tile that is already what was asked for doesn't need to be decoded, + // composited and re-encoded - the bytes we downloaded can go straight to the client. + // Only the image header is read, to check it is the size combine() would have produced + bool canPassThrough(const QByteArray& data, QNetworkReply *reply, const TileJob *job) const + { + if (!job || (job->m_urls.size() != 1) || reply->error() || data.isEmpty()) { + return false; + } + + const QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString(); + if (job->m_format == "PNG") + { + if (!contentType.startsWith("image/png")) { + return false; + } + } + else if (!contentType.startsWith("image/jpeg") && !contentType.startsWith("image/jpg")) + { + return false; + } + + QByteArray copy(data); + QBuffer buffer(©); + QImageReader reader(&buffer); + + return reader.size() == QSize(256, 256); + } + + void replyData(QTcpSocket* socket, const QByteArray& data) + { + socket->write("HTTP/1.0 200 Ok\r\n" + "Content-Type: image/png\r\n" + "\r\n"); + socket->write(data); + socket->close(); + + if (socket->state() == QTcpSocket::UnconnectedState) { + delete socket; + } + } + void replyImage(QTcpSocket* socket, const QImage& image, const QString& format) { + PROFILER_START() QByteArray ba; QBuffer buffer(&ba); buffer.open(QIODevice::WriteOnly); @@ -229,6 +277,7 @@ public: if (socket->state() == QTcpSocket::UnconnectedState) { delete socket; } + PROFILER_STOP("Map tile encode") } void replyError(QTcpSocket* socket) @@ -295,7 +344,7 @@ private slots: } else if (map == "satellite") { baseMapURL = QString("https://api.maptiler.com/tiles/satellite-v2/%3/%1/%2.jpg?key=%4").arg(x).arg(y).arg(z).arg(m_maptilerAPIKey); } else if ((map == "dark_nolabels") || (map == "light_nolabels")) { - baseMapURL = QString("http://1.basemaps.cartocdn.com/%4/%3/%1/%2.png").arg(x).arg(y).arg(z).arg(map); + baseMapURL = QString("http://1.basemaps.cartocdn.com/%4/%3/%1/%2.png?key=%5").arg(x).arg(y).arg(z).arg(map).arg("cb1_27a9_1_036ae52d2884fda8713b961c"); } else { baseMapURL = QString("http://a.tile.thunderforest.com/%4/%3/%1/%2.png?apikey=%5").arg(x).arg(y).arg(z).arg(map).arg(m_thunderforestAPIKey); } @@ -353,10 +402,19 @@ private slots: if (!isHttpRedirect(reply)) { QByteArray data = reply->readAll(); + + bool found = false; + TileJob *job = m_replies[reply]; + if (!m_tileJobs.contains(job)) { + qDebug() << "job has been deleted!"; + } + + const bool passThrough = canPassThrough(data, reply, job); + QImage image; if (!reply->error()) { - if (!image.loadFromData(data)) + if (!passThrough && !image.loadFromData(data)) { qDebug() << "MapTileServer::downloadFinished: Failed to load image: " << url; } @@ -365,34 +423,45 @@ private slots: { qDebug() << "MapTileServer::downloadFinished: Error: " << reply->error() << "for" << url; } - - bool found = false; - TileJob *job = m_replies[reply]; - if (!m_tileJobs.contains(job)) { - qDebug() << "job has been deleted!"; - } for (const auto& jobURL : job->m_urls) { if (jobURL == url) { - job->m_images.insert(url, image); - if (job->m_urls.size() == job->m_images.size()) + if (passThrough) { - // All images available - QImage combinedImage = combine(job); if (job->m_socket) { - replyImage(job->m_socket, combinedImage, job->m_format); + replyData(job->m_socket, data); job->m_socket = nullptr; m_tileJobs.removeAll(job); delete job; - //qDebug() << "Delete job" << job; } else { qDebug() << "Socket was null. URL: " << url << "job:" << job; } } + else + { + job->m_images.insert(url, image); + if (job->m_urls.size() == job->m_images.size()) + { + // All images available + QImage combinedImage = combine(job); + if (job->m_socket) + { + replyImage(job->m_socket, combinedImage, job->m_format); + job->m_socket = nullptr; + m_tileJobs.removeAll(job); + delete job; + //qDebug() << "Delete job" << job; + } + else + { + qDebug() << "Socket was null. URL: " << url << "job:" << job; + } + } + } found = true; break; } diff --git a/plugins/feature/map/mapviewcoordinator.cpp b/plugins/feature/map/mapviewcoordinator.cpp new file mode 100644 index 000000000..7d780966f --- /dev/null +++ b/plugins/feature/map/mapviewcoordinator.cpp @@ -0,0 +1,92 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include <cmath> + +#include <QTimer> + +#include "util/profiler.h" + +#include "mapviewcoordinator.h" +#include "mapgui.h" + +MapViewCoordinator::MapViewCoordinator(MapGUI *gui) : + m_gui(gui), + m_zoomLevel(0.0), + m_appliedZoom(0.0), + m_applied(false), + m_applyQueued(false) +{ +} + +void MapViewCoordinator::viewChanged(const QGeoRectangle& visibleRect, double zoomLevel) +{ + m_visibleRect = visibleRect; + m_zoomLevel = zoomLevel; + + // A wheel notch changes the zoom and the centre, and a drag reports a change per + // rendered frame, so wait until the end of this turn of the event loop and act once + if (!m_applyQueued) + { + m_applyQueued = true; + QTimer::singleShot(0, this, &MapViewCoordinator::apply); + } +} + +void MapViewCoordinator::apply() +{ + PROFILER_START() + m_applyQueued = false; + + if (!m_visibleRect.isValid() || !materialChange()) + { + PROFILER_STOP("Map view apply") + return; + } + + m_appliedRect = inflate(m_visibleRect); + m_appliedZoom = m_zoomLevel; + m_applied = true; + + m_gui->applyMapView(m_appliedRect, m_visibleRect, m_zoomLevel); + PROFILER_STOP("Map view apply") +} + +// Only worth redoing the filters once what is on screen has left the area they were +// given, or the zoom has actually changed +bool MapViewCoordinator::materialChange() const +{ + if (!m_applied) { + return true; + } + if (std::fabs(m_zoomLevel - m_appliedZoom) > m_zoomEpsilon) { + return true; + } + + return !m_appliedRect.contains(m_visibleRect); +} + +QGeoRectangle MapViewCoordinator::inflate(const QGeoRectangle& rect) +{ + QGeoRectangle inflated = rect; + + inflated.setWidth(std::min(360.0, rect.width() * m_margin)); + inflated.setHeight(std::min(180.0, rect.height() * m_margin)); + + return inflated; +} diff --git a/plugins/feature/map/mapviewcoordinator.h b/plugins/feature/map/mapviewcoordinator.h new file mode 100644 index 000000000..ae5843734 --- /dev/null +++ b/plugins/feature/map/mapviewcoordinator.h @@ -0,0 +1,72 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_MAPVIEWCOORDINATOR_H_ +#define INCLUDE_FEATURE_MAPVIEWCOORDINATOR_H_ + +#include <QObject> +#include <QGeoRectangle> + +class MapGUI; + +// Decides when the 2D map's filters and tracks need to be recalculated as the map is +// panned and zoomed. +// +// QML reports a change on every rendered frame of a drag, and each one used to re-filter +// every item in the model - which includes every airport and navaid in the world - four +// times over. Two things stop that here: +// +// - calls arriving in the same turn of the event loop are coalesced in to one +// - the filters are given a rectangle larger than what is on screen, and are only +// updated once the visible area leaves it. Items that come in to view during a small +// pan are already in the model, so nothing appears late +class MapViewCoordinator : public QObject +{ + Q_OBJECT + +public: + + MapViewCoordinator(MapGUI *gui); + + // Called from QML whenever the map is panned or zoomed + Q_INVOKABLE void viewChanged(const QGeoRectangle& visibleRect, double zoomLevel); + + // How much larger than the visible area the filters are given, as a proportion + static constexpr double m_margin = 1.2; + // Zoom has to change by more than this before the filters are updated + static constexpr double m_zoomEpsilon = 0.05; + +private slots: + + void apply(); + +private: + + bool materialChange() const; + static QGeoRectangle inflate(const QGeoRectangle& rect); + + MapGUI *m_gui; + QGeoRectangle m_visibleRect; // What QML last told us is on screen + double m_zoomLevel; + QGeoRectangle m_appliedRect; // Inflated rectangle the filters are currently using + double m_appliedZoom; + bool m_applied; // Whether anything has been applied yet + bool m_applyQueued; +}; + +#endif // INCLUDE_FEATURE_MAPVIEWCOORDINATOR_H_ diff --git a/plugins/feature/map/mapwebsocketserver.cpp b/plugins/feature/map/mapwebsocketserver.cpp index f24087d85..9253ebc7d 100644 --- a/plugins/feature/map/mapwebsocketserver.cpp +++ b/plugins/feature/map/mapwebsocketserver.cpp @@ -1,104 +1,117 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Jon Beniston, M7RCE <jon@beniston.com> // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#include <QJsonDocument> - -#include "mapwebsocketserver.h" - -MapWebSocketServer::MapWebSocketServer(QObject *parent) : - QObject(parent), - m_socket("", QWebSocketServer::NonSecureMode, this), - m_client(nullptr) -{ - connect(&m_socket, &QWebSocketServer::newConnection, this, &MapWebSocketServer::onNewConnection); - int port = 0; - if (!m_socket.listen(QHostAddress::Any, port)) { - qCritical() << "MapWebSocketServer - Unable to listen on port " << port; - } -} - -quint16 MapWebSocketServer::serverPort() -{ - return m_socket.serverPort(); -} - -void MapWebSocketServer::onNewConnection() -{ - QWebSocket *socket = m_socket.nextPendingConnection(); - - connect(socket, &QWebSocket::textMessageReceived, this, &MapWebSocketServer::processTextMessage); - connect(socket, &QWebSocket::binaryMessageReceived, this, &MapWebSocketServer::processBinaryMessage); - connect(socket, &QWebSocket::disconnected, this, &MapWebSocketServer::socketDisconnected); - - m_client = socket; - - emit connected(); -} - -void MapWebSocketServer::processTextMessage(QString message) -{ - //QWebSocket *client = qobject_cast<QWebSocket *>(sender()); - //qDebug() << "MapWebSocketServer::processTextMessage - Received text " << message; - - QJsonParseError error; - QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8(), &error); - if (!doc.isNull() && doc.isObject()) { - emit received(doc.object()); - } else { - qDebug() << "MapWebSocketServer::processTextMessage: " << error.errorString(); - } -} - -void MapWebSocketServer::processBinaryMessage(QByteArray message) -{ - //QWebSocket *client = qobject_cast<QWebSocket *>(sender()); - // Shouldn't receive any binary messages for now - qDebug() << "MapWebSocketServer::processBinaryMessage - Received binary " << message; -} - -void MapWebSocketServer::socketDisconnected() -{ - QWebSocket *client = qobject_cast<QWebSocket *>(sender()); - if (client) { - client->deleteLater(); - m_client = nullptr; - } -} - -bool MapWebSocketServer::isConnected() -{ - return m_client != nullptr; -} - -void MapWebSocketServer::send(const QJsonObject &obj) -{ - if (m_client) - { - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - qint64 bytesSent = m_client->sendTextMessage(bytes); - m_client->flush(); // Try to reduce latency - if (bytesSent != bytes.size()) { - qDebug() << "MapWebSocketServer::send - Sent only " << bytesSent << " bytes out of " << bytes.size(); - } - } - else - { - qDebug() << "MapWebSocketServer::send - No client to send " << obj; - } -} - +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE <jon@beniston.com> // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include <QJsonDocument> + +#include "mapwebsocketserver.h" +#include "util/profiler.h" + +MapWebSocketServer::MapWebSocketServer(QObject *parent) : + QObject(parent), + m_socket("", QWebSocketServer::NonSecureMode, this), + m_client(nullptr) +{ + connect(&m_socket, &QWebSocketServer::newConnection, this, &MapWebSocketServer::onNewConnection); + int port = 0; + if (!m_socket.listen(QHostAddress::Any, port)) { + qCritical() << "MapWebSocketServer - Unable to listen on port " << port; + } +} + +quint16 MapWebSocketServer::serverPort() +{ + return m_socket.serverPort(); +} + +void MapWebSocketServer::onNewConnection() +{ + QWebSocket *socket = m_socket.nextPendingConnection(); + + connect(socket, &QWebSocket::textMessageReceived, this, &MapWebSocketServer::processTextMessage); + connect(socket, &QWebSocket::binaryMessageReceived, this, &MapWebSocketServer::processBinaryMessage); + connect(socket, &QWebSocket::disconnected, this, &MapWebSocketServer::socketDisconnected); + + m_client = socket; + + emit connected(); +} + +void MapWebSocketServer::processTextMessage(QString message) +{ + //QWebSocket *client = qobject_cast<QWebSocket *>(sender()); + //qDebug() << "MapWebSocketServer::processTextMessage - Received text " << message; + + QJsonParseError error; + QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8(), &error); + if (!doc.isNull() && doc.isObject()) { + emit received(doc.object()); + } else { + qDebug() << "MapWebSocketServer::processTextMessage: " << error.errorString(); + } +} + +void MapWebSocketServer::processBinaryMessage(QByteArray message) +{ + //QWebSocket *client = qobject_cast<QWebSocket *>(sender()); + // Shouldn't receive any binary messages for now + qDebug() << "MapWebSocketServer::processBinaryMessage - Received binary " << message; +} + +void MapWebSocketServer::socketDisconnected() +{ + QWebSocket *client = qobject_cast<QWebSocket *>(sender()); + if (client) { + client->deleteLater(); + m_client = nullptr; + } +} + +bool MapWebSocketServer::isConnected() +{ + return m_client != nullptr; +} + +void MapWebSocketServer::send(const QJsonObject &obj) +{ + if (m_client) + { + // Timed in three parts, because a single 650 ms maximum was once seen across the + // whole of this, and only the file write below can actually block the thread: + // sendTextMessage() buffers, and the socket is written by the event loop + PROFILER_START() + QJsonDocument doc(obj); + // Compact, not toJson()'s default of Indented. Nothing reads this but JSON.parse + // in the page, and a CZML packet is deeply nested - position and orientation + // arrays, point, label and model objects - so pretty printing was adding a + // newline and leading spaces to every one of those lines, for nobody to read. + QByteArray bytes = doc.toJson(QJsonDocument::Compact); + PROFILER_STOP("Map CZML serialise") + PROFILER_RESTART() + qint64 bytesSent = m_client->sendTextMessage(bytes); + // No flush(): it is non-blocking and the event loop writes the socket within the + // same iteration anyway, so it bought nothing - and read as if it could block + PROFILER_STOP("Map CZML socket") + if (bytesSent != bytes.size()) { + qDebug() << "MapWebSocketServer::send - Sent only " << bytesSent << " bytes out of " << bytes.size(); + } + } + else + { + qDebug() << "MapWebSocketServer::send - No client to send " << obj; + } +} + diff --git a/plugins/feature/map/mapwebsocketserver.h b/plugins/feature/map/mapwebsocketserver.h index ebf3616db..b52fe48f3 100644 --- a/plugins/feature/map/mapwebsocketserver.h +++ b/plugins/feature/map/mapwebsocketserver.h @@ -1,59 +1,59 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // -// written by Christian Daniel // -// Copyright (C) 2015-2019 Edouard Griffiths, F4EXB <f4exb06@gmail.com> // -// Copyright (C) 2021-2022 Jon Beniston, M7RCE <jon@beniston.com> // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_FEATURE_MAPWEBSOCKERSERVER_H_ -#define INCLUDE_FEATURE_MAPWEBSOCKERSERVER_H_ - -#include <QObject> -#include <QWebSocketServer> -#include <QWebSocket> -#include <QJsonObject> - -class MapWebSocketServer : public QObject -{ - Q_OBJECT - -private: - - QWebSocketServer m_socket; - QWebSocket *m_client; - -public: - - MapWebSocketServer(QObject *parent = nullptr); - quint16 serverPort(); - - bool isConnected(); - void send(const QJsonObject &obj); - -signals: - void connected(); - void received(const QJsonObject &obj); - -public slots: - - void onNewConnection(); - void processTextMessage(QString message); - void processBinaryMessage(QByteArray message); - void socketDisconnected(); - -}; - -#endif // INCLUDE_FEATURE_MAPWEBSOCKERSERVER_H_ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany // +// written by Christian Daniel // +// Copyright (C) 2015-2019 Edouard Griffiths, F4EXB <f4exb06@gmail.com> // +// Copyright (C) 2021-2022 Jon Beniston, M7RCE <jon@beniston.com> // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_MAPWEBSOCKERSERVER_H_ +#define INCLUDE_FEATURE_MAPWEBSOCKERSERVER_H_ + +#include <QObject> +#include <QWebSocketServer> +#include <QWebSocket> +#include <QJsonObject> + +class MapWebSocketServer : public QObject +{ + Q_OBJECT + +private: + + QWebSocketServer m_socket; + QWebSocket *m_client; + +public: + + MapWebSocketServer(QObject *parent = nullptr); + quint16 serverPort(); + + bool isConnected(); + void send(const QJsonObject &obj); + +signals: + void connected(); + void received(const QJsonObject &obj); + +public slots: + + void onNewConnection(); + void processTextMessage(QString message); + void processBinaryMessage(QByteArray message); + void socketDisconnected(); + +}; + +#endif // INCLUDE_FEATURE_MAPWEBSOCKERSERVER_H_ diff --git a/plugins/feature/map/msfsassetconverter/LICENSE.md b/plugins/feature/map/msfsassetconverter/LICENSE.md new file mode 100644 index 000000000..437656e06 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/LICENSE.md @@ -0,0 +1,1069 @@ +Copyright 2011-2026 CesiumJS Contributors + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2011-2026 CesiumJS 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. + +Patents US9153063B2 US9865085B1 US10592242 + +Patents pending US15/829,786 US16/850,266 US16/851,958 + +# Third-Party Code + +CesiumJS includes the following third-party code. + +### Sean O'Neil + +http://sponeil.net/ + +> Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com) +> +> 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 the project 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 AND CONTRIBUTORS "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. + +### zip.js + +https://github.com/gildas-lormeau/zip.js + +> Copyright (c) 2013 Gildas Lormeau. All rights reserved. +> +> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +> +> 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +> +> 2. 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. +> +> 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. +> +> THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 JCRAFT, INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE 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. + +### Autolinker.js + +https://github.com/gregjacobs/Autolinker.js + +The MIT License (MIT) + +> Copyright (c) 2015 Gregory Jacobs (http://greg-jacobs.com) + +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### tween.js + +https://github.com/sole/tween.js + +> Copyright (c) 2010-2012 Tween.js authors. +> +> Easing equations Copyright (c) 2001 Robert Penner http://robertpenner.com/easing/ +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### Knockout + +http://knockoutjs.com/ + +> (c) The Knockout.js team - http://knockoutjs.com/ +> License: MIT (http://www.opensource.org/licenses/mit-license.php) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### Knockout ES5 plugin + +https://github.com/SteveSanderson/knockout-es5 + +> Copyright (c) Steve Sanderson +> MIT license +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### topojson-client + +https://github.com/topojson/topojson-client + +> Copyright 2012-2019 Michael Bostock +> +> Permission to use, copy, modify, and/or distribute this software for any purpose +> with or without fee is hereby granted, provided that the above copyright notice +> and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +> THIS SOFTWARE. + +### mersenne-twister.js + +https://gist.github.com/banksean/300494 + +> Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +> +> 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +> +> 2. 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. +> +> 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 FXAA Shader + +Original source (archived): https://archive.org/details/nvidiagame-works-graphics-samples-master +Fork: https://github.com/lyntel/GraphicsSamples/blob/3d30817ebeeade64fe6a4fc3aa1fe4265c29b6fd/samples/es3-kepler/FXAA/FXAA3_11.h + +> ---------------------------------------------------------------------------------- +> File: es3-kepler\FXAA/FXAA3_11.h +> SDK Version: v3.00 +> Email: gameworks@nvidia.com +> Site: http://developer.nvidia.com/ +> +> 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. + + +### NoSleep.js + +https://github.com/richtr/NoSleep.js + +> NoSleep.js v0.5.0 - git.io/vfn01 +> Rich Tibbett +> MIT license + +### jsep + +https://github.com/EricSmekens/jsep + +> Copyright (c) 2013 Stephen Oney, https://ericsmekens.github.io/jsep/ +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the +> "Software"), to deal in the Software without restriction, including +> without limitation the rights to use, copy, modify, merge, publish, +> distribute, sublicense, and/or sell copies of the Software, and to +> permit persons to whom the Software is furnished to do so, subject to +> the following conditions: +> +> The above copyright notice and this permission notice shall be +> included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### earcut + +https://github.com/mapbox/earcut + +> Copyright (c) 2016, Mapbox +> +> Permission to use, copy, modify, and/or distribute this software for any purpose +> with or without fee is hereby granted, provided that the above copyright notice +> and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +> THIS SOFTWARE. + +### kdbush + +https://github.com/mourner/kdbush + +> Copyright (c) 2016, Vladimir Agafonkin +> +> Permission to use, copy, modify, and/or distribute this software for any purpose +> with or without fee is hereby granted, provided that the above copyright notice +> and this permission notice appear in all copies. +> +> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +> THIS SOFTWARE. + +### rbush + +https://github.com/mourner/rbush + +> MIT License + +> Copyright (c) 2016 Vladimir Agafonkin + +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +### basis_universal + +https://github.com/BinomialLLC/basis_universal + +> 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. + +### KTX-Parse + +https://github.com/donmccurdy/KTX-Parse/ + +> (The MIT License) +> +> Copyright (c) 2020 Don McCurdy +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +### meshoptimizer + +https://github.com/zeux/meshoptimizer/blob/master/LICENSE.md + +> MIT License +> +> Copyright (c) 2016-2021 Arseny Kapoulkine +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +### pako + +https://github.com/nodeca/pako + +> (The MIT License) +> +> Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +### protobuf + +https://github.com/dcodeIO/ProtoBuf.js + +> Copyright (c) 2016, Daniel Wirtz 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 its author, 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 AND CONTRIBUTORS +> "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. + +### gltf-WebGL-PBR + +https://github.com/KhronosGroup/glTF-WebGL-PBR + +> The MIT License +> +> Copyright (c) 2016-2017 Mohamad Moneimne and Contributors +> +> Permission is hereby granted, free of charge, to any person obtaining +> a copy of this software and associated documentation files (the "Software"), +> to deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +> sell copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +> INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +> PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +> CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +> OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### ShaderFastLibs + +https://github.com/michaldrobot/ShaderFastLibs + +> The MIT License (MIT) +> +> Copyright (c) 2014 Michal Drobot +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### Draco + +https://github.com/google/draco + +> 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. + +### DOMPurify + +https://github.com/cure53/DOMPurify + +> DOMPurify +> Copyright 2015 Mario Heiderich +> +> DOMPurify is free software; you can redistribute it and/or modify it under the +> terms of either: +> +> a) the Apache License Version 2.0, or +> b) the Mozilla Public License Version 2.0 +> +> 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. + +### LERC + +http://github.com/Esri/lerc/ + +> Copyright 2015 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 +> +> 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. +> +> A copy of the license and additional notices are located with the +> source distribution at: +> +> http://github.com/Esri/lerc/ + +### GraphemeSplitter + +https://github.com/orling/grapheme-splitter + +> The MIT License (MIT) +> +> Copyright (c) 2015 Orlin Georgiev +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +### bitmap-sdf + +https://github.com/dy/bitmap-sdf + +> (c) 2017 Dima Yv. MIT License +> +> Development supported by plot.ly. + +### s2geometry + +https://github.com/google/s2geometry/blob/master/LICENSE + +> Apache License +> Version 2.0, January 2004 +> http://www.apache.org/licenses/ +> +> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +> +> 1. Definitions. +> +> "License" shall mean the terms and conditions for use, reproduction, +> and distribution as defined by Sections 1 through 9 of this document. +> +> "Licensor" shall mean the copyright owner or entity authorized by +> the copyright owner that is granting the License. +> +> "Legal Entity" shall mean the union of the acting entity and all +> other entities that control, are controlled by, or are under common +> control with that entity. For the purposes of this definition, +> "control" means (i) the power, direct or indirect, to cause the +> direction or management of such entity, whether by contract or +> otherwise, or (ii) ownership of fifty percent (50%) or more of the +> outstanding shares, or (iii) beneficial ownership of such entity. +> +> "You" (or "Your") shall mean an individual or Legal Entity +> exercising permissions granted by this License. +> +> "Source" form shall mean the preferred form for making modifications, +> including but not limited to software source code, documentation +> source, and configuration files. +> +> "Object" form shall mean any form resulting from mechanical +> transformation or translation of a Source form, including but +> not limited to compiled object code, generated documentation, +> and conversions to other media types. +> +> "Work" shall mean the work of authorship, whether in Source or +> Object form, made available under the License, as indicated by a +> copyright notice that is included in or attached to the work +> (an example is provided in the Appendix below). +> +> "Derivative Works" shall mean any work, whether in Source or Object +> form, that is based on (or derived from) the Work and for which the +> editorial revisions, annotations, elaborations, or other modifications +> represent, as a whole, an original work of authorship. For the purposes +> of this License, Derivative Works shall not include works that remain +> separable from, or merely link (or bind by name) to the interfaces of, +> the Work and Derivative Works thereof. +> +> "Contribution" shall mean any work of authorship, including +> the original version of the Work and any modifications or additions +> to that Work or Derivative Works thereof, that is intentionally +> submitted to Licensor for inclusion in the Work by the copyright owner +> or by an individual or Legal Entity authorized to submit on behalf of +> the copyright owner. For the purposes of this definition, "submitted" +> means any form of electronic, verbal, or written communication sent +> to the Licensor or its representatives, including but not limited to +> communication on electronic mailing lists, source code control systems, +> and issue tracking systems that are managed by, or on behalf of, the +> Licensor for the purpose of discussing and improving the Work, but +> excluding communication that is conspicuously marked or otherwise +> designated in writing by the copyright owner as "Not a Contribution." +> +> "Contributor" shall mean Licensor and any individual or Legal Entity +> on behalf of whom a Contribution has been received by Licensor and +> subsequently incorporated within the Work. +> +> 2. Grant of Copyright License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> copyright license to reproduce, prepare Derivative Works of, +> publicly display, publicly perform, sublicense, and distribute the +> Work and such Derivative Works in Source or Object form. +> +> 3. Grant of Patent License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> (except as stated in this section) patent license to make, have made, +> use, offer to sell, sell, import, and otherwise transfer the Work, +> where such license applies only to those patent claims licensable +> by such Contributor that are necessarily infringed by their +> Contribution(s) alone or by combination of their Contribution(s) +> with the Work to which such Contribution(s) was submitted. If You +> institute patent litigation against any entity (including a +> cross-claim or counterclaim in a lawsuit) alleging that the Work +> or a Contribution incorporated within the Work constitutes direct +> or contributory patent infringement, then any patent licenses +> granted to You under this License for that Work shall terminate +> as of the date such litigation is filed. +> +> 4. Redistribution. You may reproduce and distribute copies of the +> Work or Derivative Works thereof in any medium, with or without +> modifications, and in Source or Object form, provided that You +> meet the following conditions: +> +> (a) You must give any other recipients of the Work or +> Derivative Works a copy of this License; and +> +> (b) You must cause any modified files to carry prominent notices +> stating that You changed the files; and +> +> (c) You must retain, in the Source form of any Derivative Works +> that You distribute, all copyright, patent, trademark, and +> attribution notices from the Source form of the Work, +> excluding those notices that do not pertain to any part of +> the Derivative Works; and +> +> (d) If the Work includes a "NOTICE" text file as part of its +> distribution, then any Derivative Works that You distribute must +> include a readable copy of the attribution notices contained +> within such NOTICE file, excluding those notices that do not +> pertain to any part of the Derivative Works, in at least one +> of the following places: within a NOTICE text file distributed +> as part of the Derivative Works; within the Source form or +> documentation, if provided along with the Derivative Works; or, +> within a display generated by the Derivative Works, if and +> wherever such third-party notices normally appear. The contents +> of the NOTICE file are for informational purposes only and +> do not modify the License. You may add Your own attribution +> notices within Derivative Works that You distribute, alongside +> or as an addendum to the NOTICE text from the Work, provided +> that such additional attribution notices cannot be construed +> as modifying the License. +> +> You may add Your own copyright statement to Your modifications and +> may provide additional or different license terms and conditions +> for use, reproduction, or distribution of Your modifications, or +> for any such Derivative Works as a whole, provided Your use, +> reproduction, and distribution of the Work otherwise complies with +> the conditions stated in this License. +> +> 5. Submission of Contributions. Unless You explicitly state otherwise, +> any Contribution intentionally submitted for inclusion in the Work +> by You to the Licensor shall be under the terms and conditions of +> this License, without any additional terms or conditions. +> Notwithstanding the above, nothing herein shall supersede or modify +> the terms of any separate license agreement you may have executed +> with Licensor regarding such Contributions. +> +> 6. Trademarks. This License does not grant permission to use the trade +> names, trademarks, service marks, or product names of the Licensor, +> except as required for reasonable and customary use in describing the +> origin of the Work and reproducing the content of the NOTICE file. +> +> 7. Disclaimer of Warranty. Unless required by applicable law or +> agreed to in writing, Licensor provides the Work (and each +> Contributor provides its Contributions) on an "AS IS" BASIS, +> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +> implied, including, without limitation, any warranties or conditions +> of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +> PARTICULAR PURPOSE. You are solely responsible for determining the +> appropriateness of using or redistributing the Work and assume any +> risks associated with Your exercise of permissions under this License. +> +> 8. Limitation of Liability. In no event and under no legal theory, +> whether in tort (including negligence), contract, or otherwise, +> unless required by applicable law (such as deliberate and grossly +> negligent acts) or agreed to in writing, shall any Contributor be +> liable to You for damages, including any direct, indirect, special, +> incidental, or consequential damages of any character arising as a +> result of this License or out of the use or inability to use the +> Work (including but not limited to damages for loss of goodwill, +> work stoppage, computer failure or malfunction, or any and all +> other commercial damages or losses), even if such Contributor +> has been advised of the possibility of such damages. +> +> 9. Accepting Warranty or Additional Liability. While redistributing +> the Work or Derivative Works thereof, You may choose to offer, +> and charge a fee for, acceptance of support, warranty, indemnity, +> or other liability obligations and/or rights consistent with this +> License. However, in accepting such obligations, You may act only +> on Your own behalf and on Your sole responsibility, not on behalf +> of any other Contributor, and only if You agree to indemnify, +> defend, and hold each Contributor harmless for any liability +> incurred by, or claims asserted against, such Contributor by reason +> of your accepting any such warranty or additional liability. +> +> END OF TERMS AND CONDITIONS +> +> APPENDIX: How to apply the Apache License to your work. +> +> To apply the Apache License to your work, attach the following +> boilerplate notice, with the fields enclosed by brackets "[]" +> replaced with your own identifying information. (Don't include +> the brackets!) The text should be enclosed in the appropriate +> comment syntax for the file format. We also recommend that a +> file or class name and description of purpose be included on the +> same "printed page" as the copyright notice for easier +> identification within third-party archives. +> +> Copyright [yyyy] [name of copyright owner] +> +> 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. + +### URI.js + +http://medialize.github.io/URI.js/ + +> The MIT License (MIT) +> +> Copyright (c) 2011 Rodney Rehm +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +# Tests + +The CesiumJS tests use the following third-party libraries and data. + +### Jasmine + +http://jasmine.github.io/ + +Copyright (c) 2008-2014 Pivotal Labs + +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# CesiumJS Documentation + +The CesiumJS documentation files include the following third-party content. + +### Source Sans Pro (Font) + +Source® Sans Pro, Adobe's first open source typeface family, was designed by Paul D. Hunt. It is a sans serif typeface intended to work well in user interfaces. + +[SIL Open Font License, 1.1](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL) ([text](http://scripts.sil.org/cms/scripts/render_download.php?format=file&media_id=OFL_plaintext&filename=OFL.txt)) + +# Example Applications + +The CesiumJS example applications include the following third-party libraries and data. + +### Public domain data from Natural Earth + +Free vector and raster map data @ naturalearthdata.com + +Terms of use: http://www.naturalearthdata.com/about/terms-of-use/ + +### Data from JHT's Planetary Pixel Emporium + +Copyright (c) by James Hastings-Trew + +http://planetpixelemporium.com/ + +Copyright Information: http://planetpixelemporium.com/planets.html + +### Sky box images from NASA + +http://maps.jpl.nasa.gov/stars.html + +http://svs.gsfc.nasa.gov/vis/a000000/a003500/a003572/ + +Terms of use: http://www.nasa.gov/audience/formedia/features/MP_Photo_Guidelines.html + +### Some vector icons from (or inspired by) Raphaël JS + +http://raphaeljs.com/icons/ + +http://raphaeljs.com/license.html + +### Mouse and gesture vector icons made by Freepik from Flaticon.com + +Creative Commons Attribution 3.0 +https://web.archive.org/web/20140419110558/http://www.flaticon.com/terms-of-use + +### Maki icon set from Mapbox + +https://www.mapbox.com/maki/ + +https://github.com/mapbox/maki + +### Big Buck Bunny trailer + +Creative Commons Attribution 3.0 +(c) copyright 2008, Blender Foundation +www.bigbuckbunny.org + +### population909500.json + +https://github.com/dataarts/webgl-globe + +> Copyright 2011 Google Data Arts Team +> +> 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. + +### Wooden Watch Tower + +Creative Commons Attribution 3.0 +(c) copyright 2012, Dennis Haupt +http://www.blendswap.com/blends/view/61653 + +### Perc Lead Mine + +Creative Commons Attribution 4.0 International +(c) copyright 2019, Dr Edward Alan Lockhart +https://sketchfab.com/3d-models/parc-lead-mine-4759a23abbff454c8c682ff9b02ba111 + +### KHR_mesh_primitive_restart sample models + +Creative Commons Attribution 4.0 International +(c) copyright 2026, Don McCurdy +https://github.com/KhronosGroup/glTF/pull/2569 + +### GitHub logo + +https://github.com/logos + +### GPX files + +Public domain +https://www.gpsvisualizer.com/examples/google_gpx.html + +Creative Commons Attribution-ShareAlike 2.0 +https://wiki.openstreetmap.org/wiki/GPX + +### Font Awesome Icon + +Font Awesome by Dave Gandy - http://fontawesome.io + diff --git a/plugins/feature/map/msfsassetconverter/animationmapper.cpp b/plugins/feature/map/msfsassetconverter/animationmapper.cpp new file mode 100644 index 000000000..f1ba1280a --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/animationmapper.cpp @@ -0,0 +1,538 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "animationmapper.h" + +#include <QFile> +#include <QJsonArray> +#include <QMap> +#include <QRegularExpression> +#include <QSet> +#include <QXmlStreamReader> + +#include <algorithm> +#include <cmath> +#include <cstring> + +namespace { + +// The animation names the ADS-B demodulator plays (adsbdemodtrackerdecode.cpp) +const QString GearName = QStringLiteral("libxplanemp/controls/gear_ratio"); +const QString FlapsName = QStringLiteral("libxplanemp/controls/flap_ratio"); +const QString SlatsName = QStringLiteral("libxplanemp/controls/slat_ratio"); +const QString EngineName = QStringLiteral("libxplanemp/engines/engine_rotation_angle_deg%1"); + +// GEAR ANIMATION POSITION, in keyframes: retracted at 0, extended with no load on it at +// 100, and the struts compressing as weight comes on beyond that - so the animations run +// to 120, 125, 200 and so on. Extended is keyframe 100 whatever the length: measured on +// the B788, A343 and DH8D, the wheels are lowest at 90-100 and rise again after it. A +// template's ANIM_LENGTH (50 on some) does not move it +constexpr double GearExtended = 100.0; +constexpr double DefaultGearLength = 200.0; +// The engine templates turn one revolution over the animation's length +constexpr double DefaultEngineLength = 100.0; + +struct TemplateUse { + QString m_name; + QString m_component; + int m_depth = 0; + QHash<QString, QString> m_parameters; // Direct children, upper case names +}; + +struct PartInfo { + int m_depth = 0; + QString m_name; + QString m_animLength; + QString m_variable; +}; + +int indexIn(const QString &text, const QRegularExpression &pattern, int fallback) +{ + const QRegularExpressionMatch match = pattern.match(text); + return match.hasMatch() ? match.captured(1).toInt() : fallback; +} + +double number(const QString &text, double fallback) +{ + bool ok = false; + const double value = text.trimmed().toDouble(&ok); + return (ok && (value > 0.0)) ? value : fallback; +} + +void classifyTemplate(const TemplateUse &use, QHash<QString, MsfsAnimationRole> *roles) +{ + const QString name = use.m_name.toUpper(); + QString animation = use.m_parameters.value(QStringLiteral("ANIM_NAME")).trimmed(); + if (animation.isEmpty()) + { + // Asobo's own aircraft use the gear templates' default names (CJ4, DA62, King Air) + if (name == QStringLiteral("ASOBO_GEAR_CENTER_TEMPLATE")) { + animation = QStringLiteral("GEAR_Center"); + } else if (name == QStringLiteral("ASOBO_GEAR_LEFT_TEMPLATE")) { + animation = QStringLiteral("GEAR_Left"); + } else if (name == QStringLiteral("ASOBO_GEAR_RIGHT_TEMPLATE")) { + animation = QStringLiteral("GEAR_Right"); + } + } + if (animation.isEmpty() || roles->contains(animation)) { + return; + } + const double length = number(use.m_parameters.value(QStringLiteral("ANIM_LENGTH")), 0.0); + MsfsAnimationRole role; + if ((name == QStringLiteral("FSLTL_COMPGEAR_TEMPLATE")) + || (name.startsWith(QStringLiteral("ASOBO_GEAR_")) + && (name.contains(QStringLiteral("CENTER")) || name.contains(QStringLiteral("LEFT")) + || name.contains(QStringLiteral("RIGHT"))) + && !name.contains(QStringLiteral("TIRE")) && !name.contains(QStringLiteral("STEER")))) + { + role.m_kind = MsfsAnimationRole::Gear; + role.m_length = (length > 0.0) ? length : DefaultGearLength; + } + else if ((name == QStringLiteral("FSLTL_ENGINE_BLUR")) || (name == QStringLiteral("FSLTL_ENGINE_STATIC"))) + { + // RPM_VAR is (A:ENG N1 RPM:2,degrees per second) or (A:GENERAL ENG RPM:2,...) + static const QRegularExpression engineIndex(QStringLiteral("RPM\\s*:\\s*(\\d+)"), + QRegularExpression::CaseInsensitiveOption); + role.m_kind = MsfsAnimationRole::Engine; + role.m_engine = indexIn(use.m_parameters.value(QStringLiteral("RPM_VAR")), engineIndex, 1); + role.m_length = (length > 0.0) ? length : DefaultEngineLength; + } + else if (name == QStringLiteral("ASOBO_ENGINE_PROPELLER_TEMPLATE")) + { + role.m_kind = MsfsAnimationRole::Engine; + role.m_engine = qMax(1, use.m_parameters.value(QStringLiteral("ID")).trimmed().toInt()); + role.m_length = (length > 0.0) ? length : DefaultEngineLength; + } + else if ((name == QStringLiteral("ASOBO_GT_ANIM_CODE")) || (name == QStringLiteral("ASOBO_GT_ANIM"))) + { + // Flaps and slats are custom code, but in components that say which they are - + // and the TFS models' slats read the trailing edge flaps variable, so the + // component comes first and the variable only where there is no component + const QString component = use.m_component.toUpper(); + const QString code = use.m_parameters.value(QStringLiteral("ANIM_CODE")).toUpper(); + if (component.startsWith(QStringLiteral("SLAT"))) { + role.m_kind = MsfsAnimationRole::Slats; + } else if (component.startsWith(QStringLiteral("FLAP"))) { + role.m_kind = MsfsAnimationRole::Flaps; + } else if (code.contains(QStringLiteral("LEADING EDGE FLAPS"))) { + role.m_kind = MsfsAnimationRole::Slats; + } else if (code.contains(QStringLiteral("TRAILING EDGE FLAPS")) + && !component.contains(QStringLiteral("SPOILER"))) { + role.m_kind = MsfsAnimationRole::Flaps; + } else { + return; + } + role.m_length = length; + } + else + { + return; + } + roles->insert(animation, role); +} + +// The older form: <PartInfo><Name>l_gear</Name><AnimLength>200</AnimLength> +// <Animation><Parameter><Sim><Variable>GEAR ANIMATION POSITION:1</Variable>... +void classifyPartInfo(const PartInfo &part, QHash<QString, MsfsAnimationRole> *roles) +{ + const QString animation = part.m_name.trimmed(); + if (animation.isEmpty() || roles->contains(animation)) { + return; + } + const QString variable = part.m_variable.toUpper(); + MsfsAnimationRole role; + if (variable.startsWith(QStringLiteral("GEAR ANIMATION POSITION"))) { + role.m_kind = MsfsAnimationRole::Gear; + role.m_length = number(part.m_animLength, DefaultGearLength); + } else if (variable.startsWith(QStringLiteral("TRAILING EDGE FLAPS"))) { + role.m_kind = MsfsAnimationRole::Flaps; + role.m_length = number(part.m_animLength, 0.0); + } else if (variable.startsWith(QStringLiteral("LEADING EDGE FLAPS"))) { + role.m_kind = MsfsAnimationRole::Slats; + role.m_length = number(part.m_animLength, 0.0); + } else { + return; + } + roles->insert(animation, role); +} + +// glTF accessor access. The animation data in MSFS models is all float - checked over +// every FSLTL model - so other component types are left alone rather than converted +bool readFloats(const QJsonObject &root, const QVector<QByteArray> &buffers, int accessorIndex, + int *components, QVector<float> *values) +{ + const QJsonArray accessors = root.value("accessors").toArray(); + if ((accessorIndex < 0) || (accessorIndex >= accessors.size())) { + return false; + } + const QJsonObject accessor = accessors.at(accessorIndex).toObject(); + if (accessor.value("componentType").toInt() != 5126 || accessor.contains("sparse")) { + return false; + } + const QString type = accessor.value("type").toString(); + const int n = (type == "SCALAR") ? 1 : (type == "VEC3") ? 3 : (type == "VEC4") ? 4 : 0; + if (n == 0) { + return false; + } + const QJsonObject view = root.value("bufferViews").toArray() + .at(accessor.value("bufferView").toInt(-1)).toObject(); + const int bufferIndex = view.value("buffer").toInt(-1); + if (view.isEmpty() || (bufferIndex < 0) || (bufferIndex >= buffers.size())) { + return false; + } + const QByteArray &buffer = buffers.at(bufferIndex); + // toDouble rather than toInteger, which Qt 5 doesn't have + const qint64 count = static_cast<qint64>(accessor.value("count").toDouble()); + const qint64 stride = static_cast<qint64>(view.value("byteStride").toDouble(n * 4)); + const qint64 offset = static_cast<qint64>(view.value("byteOffset").toDouble() + + accessor.value("byteOffset").toDouble()); + if ((count <= 0) || (offset + (count - 1) * stride + n * 4 > buffer.size())) { + return false; + } + values->resize(count * n); + for (qint64 i = 0; i < count; i++) { + std::memcpy(values->data() + i * n, buffer.constData() + offset + i * stride, n * 4); + } + *components = n; + return true; +} + +int appendFloats(QJsonObject *root, QVector<QByteArray> *buffers, const QVector<float> &values, + int components) +{ + QByteArray &buffer = (*buffers)[0]; + while (buffer.size() % 4) { + buffer.append('\0'); + } + const qint64 offset = buffer.size(); + buffer.append(reinterpret_cast<const char *>(values.constData()), values.size() * 4); + + QJsonArray views = root->value("bufferViews").toArray(); + views.append(QJsonObject{{"buffer", 0}, {"byteOffset", offset}, {"byteLength", values.size() * 4}}); + root->insert("bufferViews", views); + + QJsonObject accessor{ + {"bufferView", views.size() - 1}, + {"componentType", 5126}, + {"count", values.size() / components}, + {"type", (components == 1) ? "SCALAR" : (components == 3) ? "VEC3" : "VEC4"} + }; + if (components == 1) + { + // Required for animation input + const auto [low, high] = std::minmax_element(values.constBegin(), values.constEnd()); + accessor.insert("min", QJsonArray{*low}); + accessor.insert("max", QJsonArray{*high}); + } + QJsonArray accessors = root->value("accessors").toArray(); + accessors.append(accessor); + root->insert("accessors", accessors); + return static_cast<int>(accessors.size() - 1); +} + +// Keyframes up to and including `end`, with one made at `end` itself if it falls between +// two, so a gear animation stops at fully extended rather than carrying on into the +// compression the MSFS animation goes on to +void clipKeyframes(QVector<float> *times, QVector<float> *values, int components, double end, + bool step, bool rotation) +{ + const int count = times->size(); + int keep = 0; + while ((keep < count) && ((*times)[keep] <= end)) { + keep++; + } + if (keep == count) { + return; + } + QVector<float> value(components); + if (keep == 0) { + // Starts after the end: hold its first pose + std::copy(values->constBegin(), values->constBegin() + components, value.begin()); + } + else if ((*times)[keep - 1] == static_cast<float>(end)) + { + times->resize(keep); + values->resize(keep * components); + return; + } + else + { + const float t0 = (*times)[keep - 1]; + const float t1 = (*times)[keep]; + const float f = step ? 0.0f : static_cast<float>((end - t0) / (t1 - t0)); + const float *a = values->constData() + (keep - 1) * components; + const float *b = values->constData() + keep * components; + // Take the shorter way round between two quaternions + float dot = 0.0f; + for (int c = 0; c < components; c++) { + dot += a[c] * b[c]; + } + const float sign = (rotation && (dot < 0.0f)) ? -1.0f : 1.0f; + float length = 0.0f; + for (int c = 0; c < components; c++) + { + value[c] = a[c] + (sign * b[c] - a[c]) * f; + length += value[c] * value[c]; + } + if (rotation && (length > 0.0f)) + { + length = std::sqrt(length); + for (float &v : value) { + v /= length; + } + } + } + times->resize(keep + 1); + (*times)[keep] = static_cast<float>(end); + values->resize(keep * components); + values->append(value); +} + +struct Group { + MsfsAnimationRole m_role; + QList<int> m_animations; +}; + +} // namespace + +bool readMsfsAnimationRoles(const QString &xmlFile, QHash<QString, MsfsAnimationRole> *roles, + QString *error) +{ + roles->clear(); + QFile file(xmlFile); + if (!file.open(QIODevice::ReadOnly)) + { + *error = QStringLiteral("Cannot open %1: %2").arg(xmlFile, file.errorString()); + return false; + } + QXmlStreamReader xml(&file); + QStringList elements; + QStringList components; // Component IDs enclosing the current element + QVector<TemplateUse> uses; // UseTemplates enclosing the current element + QVector<PartInfo> parts; + while (!xml.atEnd()) + { + xml.readNext(); + if (xml.isStartElement()) + { + const QString name = xml.name().toString(); + elements.append(name); + const int depth = elements.size(); + if (name.compare(QStringLiteral("Component"), Qt::CaseInsensitive) == 0) { + components.append(xml.attributes().value(QStringLiteral("ID")).toString()); + } else if (name.compare(QStringLiteral("UseTemplate"), Qt::CaseInsensitive) == 0) { + uses.append({xml.attributes().value(QStringLiteral("Name")).toString(), + components.isEmpty() ? QString() : components.last(), depth, {}}); + } else if (name.compare(QStringLiteral("PartInfo"), Qt::CaseInsensitive) == 0) { + parts.append({depth, {}, {}, {}}); + } + } + else if (xml.isCharacters() && !xml.isWhitespace() && !elements.isEmpty()) + { + const QString &element = elements.last(); + const int depth = elements.size(); + if (!uses.isEmpty() && (depth == uses.last().m_depth + 1)) { + uses.last().m_parameters[element.toUpper()] += xml.text().toString(); + } + if (!parts.isEmpty()) + { + PartInfo &part = parts.last(); + if ((depth == part.m_depth + 1) && (element.compare(QStringLiteral("Name"), Qt::CaseInsensitive) == 0)) { + part.m_name += xml.text().toString(); + } else if ((depth == part.m_depth + 1) && (element.compare(QStringLiteral("AnimLength"), Qt::CaseInsensitive) == 0)) { + part.m_animLength += xml.text().toString(); + } else if (element.compare(QStringLiteral("Variable"), Qt::CaseInsensitive) == 0) { + part.m_variable += xml.text().toString(); + } + } + } + else if (xml.isEndElement() && !elements.isEmpty()) + { + const QString name = elements.takeLast(); + if (name.compare(QStringLiteral("Component"), Qt::CaseInsensitive) == 0) { + if (!components.isEmpty()) { + components.removeLast(); + } + } else if (name.compare(QStringLiteral("UseTemplate"), Qt::CaseInsensitive) == 0) { + if (!uses.isEmpty()) { + classifyTemplate(uses.takeLast(), roles); + } + } else if (name.compare(QStringLiteral("PartInfo"), Qt::CaseInsensitive) == 0) { + if (!parts.isEmpty()) { + classifyPartInfo(parts.takeLast(), roles); + } + } + } + } + if (xml.hasError()) + { + *error = QStringLiteral("Invalid model XML %1: %2").arg(xmlFile, xml.errorString()); + return false; + } + return true; +} + +QStringList mapMsfsAnimations(const QHash<QString, MsfsAnimationRole> &roles, QJsonObject *root, + QVector<QByteArray> *buffers) +{ + QStringList made; + QJsonArray animations = root->value("animations").toArray(); + if (roles.isEmpty() || animations.isEmpty() || buffers->isEmpty()) { + return made; + } + + // Which animations make each libxplanemp one. An animation exported once per node + // carries the node after the name: custom_anim_SIM_ON_GROUND_06_node30_anim_... + QMap<QString, Group> groups; + for (qsizetype i = 0; i < animations.size(); i++) + { + const QString name = animations.at(i).toObject().value("name").toString(); + auto exact = roles.constFind(name); + const MsfsAnimationRole *role = (exact != roles.constEnd()) ? &exact.value() : nullptr; + for (auto it = roles.constBegin(); !role && (it != roles.constEnd()); ++it) + { + if (name.startsWith(it.key() + QStringLiteral("_node"))) { + role = &it.value(); + } + } + if (!role) { + continue; + } + QString target; + switch (role->m_kind) + { + case MsfsAnimationRole::Gear: target = GearName; break; + case MsfsAnimationRole::Flaps: target = FlapsName; break; + case MsfsAnimationRole::Slats: target = SlatsName; break; + case MsfsAnimationRole::Engine: target = EngineName.arg(role->m_engine); break; + } + Group &group = groups[target]; + if (group.m_animations.isEmpty()) { + group.m_role = *role; + } + group.m_animations.append(static_cast<int>(i)); + } + + QSet<int> replaced; + QJsonArray added; + for (auto it = groups.constBegin(); it != groups.constEnd(); ++it) + { + const Group &group = it.value(); + const MsfsAnimationRole &role = group.m_role; + + // Where the animation is fully deployed, as a keyframe time. A flap or slat + // animation runs from retracted to fully out, so its last keyframe is that + double end = 0.0; + double scale = 1.0; + for (int index : group.m_animations) + { + for (const QJsonValue &sampler : animations.at(index).toObject().value("samplers").toArray()) + { + const QJsonObject input = root->value("accessors").toArray() + .at(sampler.toObject().value("input").toInt(-1)).toObject(); + end = qMax(end, input.value("max").toArray().at(0).toDouble()); + } + } + if (role.m_kind == MsfsAnimationRole::Gear) { + end = qMin(end, GearExtended); // A gear animation shorter than 100 ends extended + } else if (role.m_kind == MsfsAnimationRole::Engine) { + scale = 360.0 / role.m_length; // One degree per second, as the demod expects + } + if (role.m_kind != MsfsAnimationRole::Engine) + { + if (end <= 0.0) { + continue; + } + scale = 1.0 / end; + } + + QJsonArray samplers; + QJsonArray channels; + QSet<QString> targets; + for (int index : group.m_animations) + { + const QJsonObject animation = animations.at(index).toObject(); + const QJsonArray sourceSamplers = animation.value("samplers").toArray(); + for (const QJsonValue &channelValue : animation.value("channels").toArray()) + { + const QJsonObject channel = channelValue.toObject(); + const QJsonObject target = channel.value("target").toObject(); + const QString key = QStringLiteral("%1/%2").arg(target.value("node").toInt(-1)) + .arg(target.value("path").toString()); + if (targets.contains(key)) { + continue; // Two animations moving one part: the first wins + } + const QJsonObject sampler = sourceSamplers.at(channel.value("sampler").toInt(-1)).toObject(); + const QString interpolation = sampler.value("interpolation").toString(QStringLiteral("LINEAR")); + if (interpolation == QStringLiteral("CUBICSPLINE")) { + continue; + } + QVector<float> times; + QVector<float> values; + int timeComponents = 0; + int components = 0; + if (!readFloats(*root, *buffers, sampler.value("input").toInt(-1), &timeComponents, ×) + || !readFloats(*root, *buffers, sampler.value("output").toInt(-1), &components, &values) + || (timeComponents != 1) || (values.size() != times.size() * components)) { + continue; + } + if (role.m_kind != MsfsAnimationRole::Engine) + { + clipKeyframes(×, &values, components, end, interpolation == QStringLiteral("STEP"), + target.value("path").toString() == QStringLiteral("rotation")); + } + for (float &t : times) { + t = static_cast<float>(t * scale); + } + targets.insert(key); + samplers.append(QJsonObject{ + {"input", appendFloats(root, buffers, times, 1)}, + {"output", appendFloats(root, buffers, values, components)}, + {"interpolation", interpolation} + }); + channels.append(QJsonObject{{"sampler", samplers.size() - 1}, {"target", target}}); + } + } + if (channels.isEmpty()) { + continue; + } + for (int index : group.m_animations) { + replaced.insert(index); + } + added.append(QJsonObject{{"name", it.key()}, {"samplers", samplers}, {"channels", channels}}); + made.append(QStringLiteral("%1 from %2 animation%3 (%4 channels)") + .arg(it.key()) + .arg(group.m_animations.size()) + .arg(group.m_animations.size() == 1 ? QString() : QStringLiteral("s")) + .arg(channels.size())); + } + + // Kept: everything not replaced, wheels and steering and spoilers among them + QJsonArray result; + for (qsizetype i = 0; i < animations.size(); i++) + { + if (!replaced.contains(static_cast<int>(i))) { + result.append(animations.at(i)); + } + } + for (const QJsonValue &animation : added) { + result.append(animation); + } + root->insert("animations", result); + return made; +} diff --git a/plugins/feature/map/msfsassetconverter/animationmapper.h b/plugins/feature/map/msfsassetconverter/animationmapper.h new file mode 100644 index 000000000..38b0f47cc --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/animationmapper.h @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QByteArray> +#include <QHash> +#include <QJsonObject> +#include <QString> +#include <QStringList> +#include <QVector> + +// What an MSFS animation does, as the model's XML says. The glTF names do not say: +// in the FSLTL A320neo the flaps are custom_anim_SIM_ON_GROUND_05 and the slats +// custom_anim_SIM_ON_GROUND_06 - the XML binds each name to a template or to code that +// reads a simulation variable, and that is the only reliable source +struct MsfsAnimationRole { + enum Kind { Gear, Flaps, Slats, Engine }; + Kind m_kind = Gear; + int m_engine = 0; // Engine number, from 1, for Engine + double m_length = 0.0; // The animation's length in keyframes, where the XML gives it (used for engines) +}; + +// Reads the animation roles from an MSFS model XML (the file that lists the LODs). +// Returns false only when the file can't be read or parsed; a model with nothing +// recognisable gives an empty result +bool readMsfsAnimationRoles(const QString &xmlFile, QHash<QString, MsfsAnimationRole> *roles, + QString *error); + +// Replaces the animations the roles identify with the libxplanemp ones that the ADS-B +// demodulator plays (gear_ratio, flap_ratio, slat_ratio, engine_rotation_angle_degN), +// retimed to what it expects: 0 to 1 for a ratio, and degrees for an engine. Several +// MSFS animations with one role - three gear legs, or one split per node - become one +// animation, since Cesium plays only the first with a given name. New keyframe data is +// appended to buffers[0]. Returns a description of each animation made +QStringList mapMsfsAnimations(const QHash<QString, MsfsAnimationRole> &roles, QJsonObject *root, + QVector<QByteArray> *buffers); diff --git a/plugins/feature/map/msfsassetconverter/batchconverter.cpp b/plugins/feature/map/msfsassetconverter/batchconverter.cpp new file mode 100644 index 000000000..41773daaa --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/batchconverter.cpp @@ -0,0 +1,453 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "batchconverter.h" + +#include "converter.h" +#include "fsltlresolver.h" + +#include <QDir> +#include <QDirIterator> +#include <QFile> +#include <QFileInfo> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> +#include <QRegularExpression> +#include <QSet> +#include <QThread> +#include <QUrl> + +#include <algorithm> +#include <atomic> +#include <exception> +#include <map> +#include <mutex> +#include <thread> +#include <vector> + +namespace { + +struct AircraftTask { + QString m_config; + QString m_outputDirectory; + QString m_relativeConfig; + QString m_aircraftName; + QString m_outputNameSuffix; + int m_flightSimIndex = 0; +}; + +struct AircraftOutcome { + enum Status { + Pending, + Converted, + Failed, + Cancelled + }; + + Status m_status = Pending; + QString m_failure; + int m_reusedTextures = 0; + int m_synthesizedTextures = 0; + int m_skippedFallbackDirectories = 0; +}; + +int automaticWorkerCount(int taskCount) +{ + const int idealThreadCount = QThread::idealThreadCount(); + // UASTC encoding is CPU- and memory-intensive. Approximate physical cores + // on SMT systems and cap the default to keep SDRangel responsive. + const int cpuWorkers = idealThreadCount > 1 ? idealThreadCount / 2 : 1; + return qMin(taskCount, qBound(1, cpuWorkers, 8)); +} + +QString aircraftFamily(const QString& aircraftName) +{ + const QStringList parts = aircraftName.split('_'); + if ((parts.size() >= 2) && + (parts[0].compare(QStringLiteral("FSLTL"), Qt::CaseInsensitive) == 0)) { + return parts[0].toUpper() + '_' + parts[1].toUpper(); + } + return aircraftName.toUpper(); +} + +// The shared texture cache is content addressed: a texture is named by a hash of its source +// and of how it was encoded, so a change of encoding (zstd, say) writes every texture afresh +// under a new name, and nothing ever removed the old ones. After a complete run, cache files +// that no model below the output directory refers to are deleted. Only files with cache names +// are touched, and nothing at all if any model can't be read, so a model never loses a texture +bool removeUnreferencedTextures(const QDir& outputRoot, const QDir& textureDirectory, + int *removed, qint64 *removedBytes, QString *error) +{ +#ifdef Q_OS_WIN + const Qt::CaseSensitivity pathCase = Qt::CaseInsensitive; +#else + const Qt::CaseSensitivity pathCase = Qt::CaseSensitive; +#endif + const QString texturePath = QDir::cleanPath(textureDirectory.absolutePath()); + QSet<QString> referenced; + QDirIterator models(outputRoot.absolutePath(), {QStringLiteral("*.gltf")}, + QDir::Files | QDir::NoSymLinks, QDirIterator::Subdirectories); + while (models.hasNext()) + { + const QString model = models.next(); + QFile file(model); + if (!file.open(QIODevice::ReadOnly)) + { + *error = QStringLiteral("Cannot read %1: %2").arg(model, file.errorString()); + return false; + } + QJsonParseError parseError; + const QJsonDocument document = QJsonDocument::fromJson(file.readAll(), &parseError); + if (!document.isObject()) + { + *error = QStringLiteral("Cannot parse %1: %2").arg(model, parseError.errorString()); + return false; + } + const QDir modelDirectory = QFileInfo(model).absoluteDir(); + for (const QJsonValue& image : document.object().value("images").toArray()) + { + const QString uri = image.toObject().value("uri").toString(); + if (uri.isEmpty() || uri.startsWith(QStringLiteral("data:"), Qt::CaseInsensitive)) { + continue; + } + const QFileInfo target(QDir::cleanPath( + modelDirectory.absoluteFilePath(QUrl::fromPercentEncoding(uri.toUtf8())))); + if (target.absolutePath().compare(texturePath, pathCase) == 0) { + referenced.insert(target.fileName().toLower()); + } + } + } + + // What cachedKtxName and cachedImageName produce, and the checksum written beside them + static const QRegularExpression cacheName(QStringLiteral("^[0-9a-f]{64}(\\.[0-9a-z]+)?$")); + const QFileInfoList files = textureDirectory.entryInfoList(QDir::Files | QDir::NoSymLinks); + for (const QFileInfo& file : files) + { + const QString name = file.fileName().toLower(); + const bool checksum = name.endsWith(QStringLiteral(".sha256")); + const QString owner = checksum ? name.chopped(7) : name; + if (!cacheName.match(owner).hasMatch() || referenced.contains(owner)) { + continue; + } + const qint64 size = file.size(); + if (QFile::remove(file.absoluteFilePath())) + { + *removedBytes += size; + if (!checksum) { + ++*removed; + } + } + } + return true; +} + +} // namespace + +bool convertMSFSAircraftDirectory( + const QString& aircraftDirectory, + const QString& outputDirectory, + MSFSBatchConversionSummary *summary, + QString *error, + const MSFSBatchProgress& progress, + const MSFSBatchCancelled& isCancelled, + int maxThreadCount) +{ + *summary = {}; + error->clear(); + + const QFileInfo inputInfo(aircraftDirectory); + if (!inputInfo.isDir()) + { + *error = QStringLiteral("Aircraft directory does not exist: %1").arg(aircraftDirectory); + return false; + } + + const QDir inputRoot(inputInfo.absoluteFilePath()); + if (progress) { + progress(0, 0, QStringLiteral("Scanning for aircraft.cfg files…")); + } + + QStringList aircraftConfigs; + QDirIterator iterator( + inputRoot.absolutePath(), + {QStringLiteral("aircraft.cfg")}, + QDir::Files | QDir::Readable | QDir::NoSymLinks, + QDirIterator::Subdirectories); + while (iterator.hasNext()) + { + if (isCancelled && isCancelled()) + { + summary->m_cancelled = true; + return true; + } + aircraftConfigs.append(iterator.next()); + } + std::sort(aircraftConfigs.begin(), aircraftConfigs.end(), + [](const QString& left, const QString& right) { + return left.compare(right, Qt::CaseInsensitive) < 0; + }); + + if (aircraftConfigs.isEmpty()) + { + *error = QStringLiteral("No aircraft.cfg files were found below %1") + .arg(inputRoot.absolutePath()); + return false; + } + const QDir outputRoot(outputDirectory); + std::vector<AircraftTask> tasks; + tasks.reserve(static_cast<std::size_t>(aircraftConfigs.size())); + for (const QString& config : aircraftConfigs) + { + const QFileInfo configInfo(config); + const QString relativeDirectory = inputRoot.relativeFilePath(configInfo.absolutePath()); + QVector<int> flightSimIndices; + QString variantError; + if (!findFsltlAircraftVariants(config, &flightSimIndices, &variantError)) { + // Let the normal conversion path report the detailed failure. + flightSimIndices.append(0); + } + const bool multipleVariants = flightSimIndices.size() > 1; + for (int flightSimIndex : flightSimIndices) { + tasks.push_back({ + config, + outputRoot.filePath(relativeDirectory), + inputRoot.relativeFilePath(config), + configInfo.dir().dirName(), + multipleVariants + ? QStringLiteral("_fltsim_%1").arg(flightSimIndex) + : QString(), + flightSimIndex + }); + } + } + const int configurationCount = aircraftConfigs.size(); + summary->m_discovered = static_cast<int>(tasks.size()); + if (progress) { + progress(0, summary->m_discovered, + QStringLiteral("Found %1 aircraft configurations containing %2 distinct variants") + .arg(configurationCount) + .arg(summary->m_discovered)); + } + + // Interleave aircraft families so the first worker wave does not consist + // entirely of liveries for one type, all waiting on the same base texture. + std::map<QString, std::vector<AircraftTask>> aircraftFamilies; + for (AircraftTask& task : tasks) { + aircraftFamilies[aircraftFamily(task.m_aircraftName)].push_back(std::move(task)); + } + const std::size_t taskCount = tasks.size(); + tasks.clear(); + tasks.reserve(taskCount); + for (std::size_t familyIndex = 0; + tasks.size() < taskCount; + ++familyIndex) + { + for (auto& family : aircraftFamilies) + { + if (familyIndex < family.second.size()) { + tasks.push_back(std::move(family.second[familyIndex])); + } + } + } + + summary->m_workerCount = maxThreadCount > 0 + ? qMin(maxThreadCount, static_cast<int>(tasks.size())) + : automaticWorkerCount(static_cast<int>(tasks.size())); + summary->m_workerCount = qMax(1, summary->m_workerCount); + if (progress) { + progress(0, summary->m_discovered, + QStringLiteral( + "Converting with %1 parallel worker%2; shared textures are cached in MSFS/_textures") + .arg(summary->m_workerCount) + .arg(summary->m_workerCount == 1 ? QString() : QStringLiteral("s"))); + } + + std::vector<AircraftOutcome> outcomes(tasks.size()); + std::atomic<int> nextTask{0}; + std::atomic<int> completedTasks{0}; + std::atomic_bool stopRequested{false}; + std::mutex progressMutex; + const QString sharedTextureDirectory = outputRoot.filePath(QStringLiteral("_textures")); + if (!QDir().mkpath(sharedTextureDirectory)) + { + *error = QStringLiteral("Cannot create shared texture directory: %1") + .arg(sharedTextureDirectory); + return false; + } + const auto cancelled = [&] { + return stopRequested.load(std::memory_order_relaxed) || + (isCancelled && isCancelled()); + }; + const auto worker = [&] { + while (!cancelled()) + { + const int index = nextTask.fetch_add(1, std::memory_order_relaxed); + if (index >= static_cast<int>(tasks.size())) { + return; + } + + const AircraftTask& task = tasks[static_cast<std::size_t>(index)]; + ConversionOptions options; + options.m_inputGltf = task.m_config; + options.m_outputDirectory = task.m_outputDirectory; + options.m_outputNameSuffix = task.m_outputNameSuffix; + options.m_sharedTextureDirectory = sharedTextureDirectory; + options.m_flightSimIndex = task.m_flightSimIndex; + options.m_isCancelled = cancelled; + + ConversionResult conversion; + QString conversionError; + AircraftOutcome& outcome = outcomes[static_cast<std::size_t>(index)]; + QString message; + try + { + if (convertMsfsAsset(options, &conversion, &conversionError)) + { + outcome.m_status = AircraftOutcome::Converted; + outcome.m_reusedTextures = conversion.m_reusedTextures; + outcome.m_synthesizedTextures = conversion.m_synthesizedTextures; + outcome.m_skippedFallbackDirectories = + conversion.m_skippedFallbackDirectories; + message = QStringLiteral("Converted %1%2") + .arg(task.m_aircraftName, task.m_outputNameSuffix); + if (conversion.m_reusedTextures > 0) { + message += QStringLiteral(" (%1 cached texture%2 reused)") + .arg(conversion.m_reusedTextures) + .arg(conversion.m_reusedTextures == 1 ? QString() : QStringLiteral("s")); + } + if (conversion.m_synthesizedTextures > 0) { + message += QStringLiteral(" (%1 missing optional texture%2 replaced)") + .arg(conversion.m_synthesizedTextures) + .arg(conversion.m_synthesizedTextures == 1 + ? QString() : QStringLiteral("s")); + } + if (conversion.m_skippedFallbackDirectories > 0) { + message += QStringLiteral(" (%1 missing fallback director%2 skipped)") + .arg(conversion.m_skippedFallbackDirectories) + .arg(conversion.m_skippedFallbackDirectories == 1 + ? QStringLiteral("y") : QStringLiteral("ies")); + } + } + else if (conversionError == QStringLiteral("Conversion cancelled")) + { + outcome.m_status = AircraftOutcome::Cancelled; + return; + } + else + { + outcome.m_status = AircraftOutcome::Failed; + outcome.m_failure = QStringLiteral("%1 [FLTSIM.%2]: %3") + .arg(task.m_relativeConfig) + .arg(task.m_flightSimIndex) + .arg(conversionError); + message = QStringLiteral("Failed: %1").arg(outcome.m_failure); + } + } + catch (const std::exception& exception) + { + outcome.m_status = AircraftOutcome::Failed; + outcome.m_failure = QStringLiteral("%1 [FLTSIM.%2]: unexpected converter exception: %3") + .arg(task.m_relativeConfig) + .arg(task.m_flightSimIndex) + .arg(QString::fromLocal8Bit(exception.what())); + message = QStringLiteral("Failed: %1").arg(outcome.m_failure); + } + catch (...) + { + outcome.m_status = AircraftOutcome::Failed; + outcome.m_failure = QStringLiteral("%1 [FLTSIM.%2]: unexpected converter exception") + .arg(task.m_relativeConfig) + .arg(task.m_flightSimIndex); + message = QStringLiteral("Failed: %1").arg(outcome.m_failure); + } + + { + const std::lock_guard<std::mutex> guard(progressMutex); + const int completed = + completedTasks.fetch_add(1, std::memory_order_relaxed) + 1; + if (progress) { + progress(completed, summary->m_discovered, message); + } + } + } + }; + + std::vector<std::thread> workers; + workers.reserve(static_cast<std::size_t>(summary->m_workerCount - 1)); + try + { + for (int index = 1; index < summary->m_workerCount; ++index) { + workers.emplace_back(worker); + } + } + catch (const std::exception& exception) + { + stopRequested.store(true, std::memory_order_relaxed); + for (std::thread& thread : workers) { + thread.join(); + } + *error = QStringLiteral("Cannot start MSFS conversion workers: %1") + .arg(QString::fromLocal8Bit(exception.what())); + return false; + } + + worker(); + for (std::thread& thread : workers) { + thread.join(); + } + + for (const AircraftOutcome& outcome : outcomes) + { + if (outcome.m_status == AircraftOutcome::Converted) + { + ++summary->m_converted; + summary->m_reusedTextures += outcome.m_reusedTextures; + summary->m_synthesizedTextures += outcome.m_synthesizedTextures; + summary->m_skippedFallbackDirectories += outcome.m_skippedFallbackDirectories; + } + else if (outcome.m_status == AircraftOutcome::Failed) + { + ++summary->m_failed; + summary->m_errors.append(outcome.m_failure); + } + else if (outcome.m_status == AircraftOutcome::Cancelled) + { + summary->m_cancelled = true; + } + } + summary->m_cancelled = summary->m_cancelled || (isCancelled && isCancelled()); + + if (!summary->m_cancelled) + { + if (progress) { + progress(summary->m_discovered, summary->m_discovered, + QStringLiteral("Removing cached textures no model uses…")); + } + QString cleanupError; + if (!removeUnreferencedTextures(outputRoot, QDir(sharedTextureDirectory), + &summary->m_removedTextures, &summary->m_removedTextureBytes, &cleanupError) + && progress) + { + progress(summary->m_discovered, summary->m_discovered, + QStringLiteral("WARNING: unused textures not removed: %1").arg(cleanupError)); + } + } + + return true; +} diff --git a/plugins/feature/map/msfsassetconverter/batchconverter.h b/plugins/feature/map/msfsassetconverter/batchconverter.h new file mode 100644 index 000000000..d79df90c7 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/batchconverter.h @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QString> +#include <QStringList> + +#include <functional> + +struct MSFSBatchConversionSummary { + int m_discovered = 0; + int m_converted = 0; + int m_failed = 0; + int m_reusedTextures = 0; + int m_synthesizedTextures = 0; + int m_skippedFallbackDirectories = 0; + int m_removedTextures = 0; + qint64 m_removedTextureBytes = 0; + int m_workerCount = 0; + bool m_cancelled = false; + QStringList m_errors; +}; + +using MSFSBatchProgress = std::function<void(int current, int total, const QString& message)>; +using MSFSBatchCancelled = std::function<bool()>; + +// Recursively converts every distinct model/texture variant in each aircraft.cfg +// below aircraftDirectory. Models retain the input directory layout and textures +// use a shared content-addressed cache below outputDirectory. +bool convertMSFSAircraftDirectory( + const QString& aircraftDirectory, + const QString& outputDirectory, + MSFSBatchConversionSummary *summary, + QString *error, + const MSFSBatchProgress& progress = {}, + const MSFSBatchCancelled& isCancelled = {}, + int maxThreadCount = 0); diff --git a/plugins/feature/map/msfsassetconverter/bc7decoder.cpp b/plugins/feature/map/msfsassetconverter/bc7decoder.cpp new file mode 100644 index 000000000..2f3dac35f --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/bc7decoder.cpp @@ -0,0 +1,350 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// BC7 decoding logic adapted from Basis Universal's basisu_gpu_texture.cpp. // +// Copyright (C) 2019-2021 Binomial LLC. Licensed under Apache-2.0; see the // +// repository's LICENSE.md. The partition constants are defined by BPTC/BC7. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "bc7decoder.h" + +#include <algorithm> +#include <array> +#include <cstdint> + +namespace { + +// BC7 partition and anchor tables from the public BPTC format specification. +constexpr uint8_t Partition2[64 * 16] = { + 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, + 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1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13, 15, 12, 3, 3}; +constexpr uint8_t Anchor32[64] = { + 15, 8, 8, 3, 15, 15, 3, 8, 15, 15, 15, 15, 15, 15, 15, 8, + 15, 8, 15, 3, 15, 8, 15, 8, 3, 15, 6, 10, 15, 15, 10, 8, + 15, 3, 15, 10, 10, 8, 9, 10, 6, 15, 8, 15, 3, 6, 6, 8, + 15, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 15, 15, 8}; +constexpr int Weights2[4] = {0, 21, 43, 64}; +constexpr int Weights3[8] = {0, 9, 18, 27, 37, 46, 55, 64}; +constexpr int Weights4[16] = {0, 4, 9, 13, 17, 21, 26, 30, + 34, 38, 43, 47, 51, 55, 60, 64}; + +uint32_t readBits(const uchar *block, int &offset, int count) +{ + uint32_t value = 0; + for (int bit = 0; bit < count; ++bit) { + value |= ((block[(offset + bit) / 8] >> ((offset + bit) & 7)) & 1U) << bit; + } + offset += count; + return value; +} + +int dequant(int value, int bits) +{ + value <<= 8 - bits; + return value | (value >> bits); +} +int dequant(int value, int pbit, int bits) +{ + return dequant((value << 1) | pbit, bits + 1); +} +int interpolate(int low, int high, int index, int bits) +{ + const int *weights = bits == 2 ? Weights2 : (bits == 3 ? Weights3 : Weights4); + return (low * (64 - weights[index]) + high * weights[index] + 32) >> 6; +} + +bool decodeMode02(int mode, const uchar *block, Bc7Rgba *pixels) +{ + const int weightBits = mode == 0 ? 3 : 2; + const int endpointBits = mode == 0 ? 4 : 5; + int offset = 0; + if (readBits(block, offset, mode + 1) != (1U << mode)) + return false; + const int partition = readBits(block, offset, mode == 0 ? 4 : 6); + int endpoints[6][4]{}; + for (int component = 0; component < 3; ++component) + for (auto &endpoint : endpoints) + endpoint[component] = readBits(block, offset, endpointBits); + int pbits[6]{}; + if (mode == 0) + for (int &pbit : pbits) + pbit = readBits(block, offset, 1); + int weights[16]; + for (int i = 0; i < 16; ++i) + { + const bool anchor = + i == 0 || i == Anchor31[partition] || i == Anchor32[partition]; + weights[i] = readBits(block, offset, weightBits - (anchor ? 1 : 0)); + } + if (offset != 128) + return false; + for (int e = 0; e < 6; ++e) + for (int c = 0; c < 3; ++c) + endpoints[e][c] = mode == 0 + ? dequant(endpoints[e][c], pbits[e], endpointBits) + : dequant(endpoints[e][c], endpointBits); + for (int i = 0; i < 16; ++i) + { + const int subset = Partition3[partition * 16 + i]; + pixels[i] = { + interpolate(endpoints[subset * 2][0], endpoints[subset * 2 + 1][0], + weights[i], weightBits), + interpolate(endpoints[subset * 2][1], endpoints[subset * 2 + 1][1], + weights[i], weightBits), + interpolate(endpoints[subset * 2][2], endpoints[subset * 2 + 1][2], + weights[i], weightBits), + 255}; + } + return true; +} + +bool decodeMode137(int mode, const uchar *block, Bc7Rgba *pixels) +{ + const int components = mode == 7 ? 4 : 3; + const int weightBits = mode == 1 ? 3 : 2; + const int endpointBits = mode == 7 ? 5 : (mode == 1 ? 6 : 7); + int offset = 0; + if (readBits(block, offset, mode + 1) != (1U << mode)) + return false; + const int partition = readBits(block, offset, 6); + int endpoints[4][4]{}; + for (int c = 0; c < components; ++c) + for (auto &endpoint : endpoints) + endpoint[c] = readBits(block, offset, endpointBits); + int pbits[4]{}; + const int pbitCount = mode == 1 ? 2 : 4; + for (int i = 0; i < pbitCount; ++i) + pbits[i] = readBits(block, offset, 1); + int weights[16]; + for (int i = 0; i < 16; ++i) + weights[i] = + readBits(block, offset, + weightBits - ((i == 0 || i == Anchor2[partition]) ? 1 : 0)); + if (offset != 128) + return false; + for (int e = 0; e < 4; ++e) + { + for (int c = 0; c < components; ++c) + endpoints[e][c] = + dequant(endpoints[e][c], pbits[mode == 1 ? e / 2 : e], endpointBits); + if (components == 3) + endpoints[e][3] = 255; + } + for (int i = 0; i < 16; ++i) + { + const int subset = Partition2[partition * 16 + i]; + int value[4]; + for (int c = 0; c < 4; ++c) + value[c] = + interpolate(endpoints[subset * 2][c], endpoints[subset * 2 + 1][c], + weights[i], weightBits); + pixels[i] = {value[0], value[1], value[2], value[3]}; + } + return true; +} + +bool decodeMode45(int mode, const uchar *block, Bc7Rgba *pixels) +{ + const int alphaWeightBits = mode == 4 ? 3 : 2; + const int endpointBits = mode == 4 ? 5 : 7; + const int alphaEndpointBits = mode == 4 ? 6 : 8; + int offset = 0; + if (readBits(block, offset, mode + 1) != (1U << mode)) + return false; + const int rotation = readBits(block, offset, 2); + const int indexMode = mode == 4 ? readBits(block, offset, 1) : 0; + int endpoints[2][4]{}; + for (int c = 0; c < 4; ++c) + for (auto &endpoint : endpoints) + endpoint[c] = + readBits(block, offset, c == 3 ? alphaEndpointBits : endpointBits); + const int bits[2] = {indexMode ? alphaWeightBits : 2, + indexMode ? 2 : alphaWeightBits}; + int colorWeights[16]{}, alphaWeights[16]{}; + int *first = indexMode ? alphaWeights : colorWeights; + int *second = indexMode ? colorWeights : alphaWeights; + for (int i = 0; i < 16; ++i) + first[i] = readBits(block, offset, bits[indexMode] - (i == 0 ? 1 : 0)); + for (int i = 0; i < 16; ++i) + second[i] = readBits(block, offset, bits[1 - indexMode] - (i == 0 ? 1 : 0)); + if (offset != 128) + return false; + for (auto &endpoint : endpoints) + for (int c = 0; c < 4; ++c) + endpoint[c] = + dequant(endpoint[c], c == 3 ? alphaEndpointBits : endpointBits); + for (int i = 0; i < 16; ++i) + { + int values[4]; + for (int c = 0; c < 3; ++c) + values[c] = interpolate(endpoints[0][c], endpoints[1][c], colorWeights[i], + bits[0]); + values[3] = + interpolate(endpoints[0][3], endpoints[1][3], alphaWeights[i], bits[1]); + if (rotation >= 1) + std::swap(values[3], values[rotation - 1]); + pixels[i] = {values[0], values[1], values[2], values[3]}; + } + return true; +} + +bool decodeMode6(const uchar *block, Bc7Rgba *pixels) +{ + int offset = 0; + if (readBits(block, offset, 7) != 64) + return false; + int endpoints[2][4]{}; + for (int c = 0; c < 4; ++c) + for (auto &endpoint : endpoints) + endpoint[c] = readBits(block, offset, 7); + const int p0 = readBits(block, offset, 1), p1 = readBits(block, offset, 1); + for (int c = 0; c < 4; ++c) + { + endpoints[0][c] = endpoints[0][c] * 2 + p0; + endpoints[1][c] = endpoints[1][c] * 2 + p1; + } + for (int i = 0; i < 16; ++i) + { + const int weight = readBits(block, offset, i == 0 ? 3 : 4); + pixels[i] = {interpolate(endpoints[0][0], endpoints[1][0], weight, 4), + interpolate(endpoints[0][1], endpoints[1][1], weight, 4), + interpolate(endpoints[0][2], endpoints[1][2], weight, 4), + interpolate(endpoints[0][3], endpoints[1][3], weight, 4)}; + } + return offset == 128; +} + +} // namespace + +bool decodeBc7Block(const uchar *block, Bc7Rgba *pixels) +{ + if (!block || !pixels || block[0] == 0) + return false; + int mode = 0; + while (mode < 8 && (block[0] & (1U << mode)) == 0) + ++mode; + switch (mode) + { + case 0: + case 2: + return decodeMode02(mode, block, pixels); + case 1: + case 3: + case 7: + return decodeMode137(mode, block, pixels); + case 4: + case 5: + return decodeMode45(mode, block, pixels); + case 6: + return decodeMode6(block, pixels); + default: + return false; + } +} diff --git a/plugins/feature/map/msfsassetconverter/bc7decoder.h b/plugins/feature/map/msfsassetconverter/bc7decoder.h new file mode 100644 index 000000000..269325c4d --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/bc7decoder.h @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QtGlobal> + +struct Bc7Rgba { + int m_r; + int m_g; + int m_b; + int m_a; +}; + +// Decodes one 16-byte BC7 block in raster order. Supports all eight BC7 modes. +bool decodeBc7Block(const uchar *block, Bc7Rgba *pixels); diff --git a/plugins/feature/map/msfsassetconverter/converter.cpp b/plugins/feature/map/msfsassetconverter/converter.cpp new file mode 100644 index 000000000..47a47da2c --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/converter.cpp @@ -0,0 +1,1525 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "converter.h" +#include "animationmapper.h" + +#include "ddsdecoder.h" +#include "fsltlresolver.h" +#include "ktx2writer.h" + +#include <QCryptographicHash> +#include <QDir> +#include <QFile> +#include <QFileInfo> +#include <QJsonArray> +#include <QJsonDocument> +#include <QJsonObject> +#include <QImage> +#include <QSaveFile> +#include <QSet> +#include <QUrl> +#include <QtEndian> + +#include <algorithm> +#include <cmath> +#include <cstring> +#include <limits> +#include <map> +#include <memory> +#include <mutex> + +namespace { + +constexpr int ComponentByte = 5120; +constexpr int ComponentUnsignedByte = 5121; +constexpr int ComponentShort = 5122; +constexpr int ComponentUnsignedShort = 5123; +constexpr int ComponentUnsignedInt = 5125; +constexpr int ComponentFloat = 5126; +constexpr int ArrayBufferTarget = 34962; + +enum class AttributeKind { Normal, Tangent, TexCoord, Color }; + +std::mutex textureLocksMutex; +std::map<QString, std::shared_ptr<std::mutex>> textureLocks; + +std::shared_ptr<std::mutex> textureLock(const QString &fileName) +{ + const QString path = QFileInfo(fileName).absoluteFilePath(); + std::lock_guard<std::mutex> guard(textureLocksMutex); + auto &lock = textureLocks[path]; + if (!lock) { + lock = std::make_shared<std::mutex>(); + } + return lock; +} + +template <typename T> +T littleEndianValue(const QByteArray &bytes, qsizetype offset) +{ + return qFromLittleEndian<T>( + reinterpret_cast<const uchar *>(bytes.constData() + offset)); +} + +bool validFileRange(quint64 offset, quint64 length, quint64 fileSize) +{ + return offset <= fileSize && length <= fileSize - offset; +} + +bool reusableKtx2(const QString &fileName) +{ + QFile file(fileName); + const quint64 fileSize = static_cast<quint64>(file.size()); + if (!file.open(QIODevice::ReadOnly) || fileSize < 104) { + return false; + } + const QByteArray prefix = file.read(80 + 32 * 24); + static const QByteArray identifier("\xABKTX 20\xBB\r\n\x1A\n", 12); + if (prefix.size() < 80 || prefix.left(12) != identifier) { + return false; + } + + const quint32 width = littleEndianValue<quint32>(prefix, 20); + const quint32 height = littleEndianValue<quint32>(prefix, 24); + const quint32 faceCount = littleEndianValue<quint32>(prefix, 36); + const quint32 levelCount = littleEndianValue<quint32>(prefix, 40); + if (width == 0 || height == 0 || faceCount != 1 || levelCount == 0 || + levelCount > 32 || prefix.size() < 80 + levelCount * 24) { + return false; + } + + const quint32 dfdOffset = littleEndianValue<quint32>(prefix, 48); + const quint32 dfdLength = littleEndianValue<quint32>(prefix, 52); + const quint32 kvdOffset = littleEndianValue<quint32>(prefix, 56); + const quint32 kvdLength = littleEndianValue<quint32>(prefix, 60); + const quint64 sgdOffset = littleEndianValue<quint64>(prefix, 64); + const quint64 sgdLength = littleEndianValue<quint64>(prefix, 72); + if (dfdLength == 0 || !validFileRange(dfdOffset, dfdLength, fileSize) || + !validFileRange(kvdOffset, kvdLength, fileSize) || + !validFileRange(sgdOffset, sgdLength, fileSize)) { + return false; + } + for (quint32 level = 0; level < levelCount; ++level) + { + const qsizetype offset = 80 + static_cast<qsizetype>(level) * 24; + const quint64 byteOffset = littleEndianValue<quint64>(prefix, offset); + const quint64 byteLength = littleEndianValue<quint64>(prefix, offset + 8); + const quint64 uncompressedLength = + littleEndianValue<quint64>(prefix, offset + 16); + if (byteLength == 0 || uncompressedLength == 0 || + !validFileRange(byteOffset, byteLength, fileSize)) { + return false; + } + } + return true; +} + +QByteArray fileSha256(const QString &fileName, + const QByteArray &context = QByteArray()) +{ + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly)) { + return {}; + } + QCryptographicHash hash(QCryptographicHash::Sha256); + hash.addData(context); + return hash.addData(&file) ? hash.result().toHex() : QByteArray(); +} + +bool writeKtxChecksum(const QString &fileName, QString *error) +{ + const QByteArray digest = fileSha256(fileName); + if (digest.isEmpty()) + { + *error = QStringLiteral("Cannot checksum generated KTX2 texture: %1") + .arg(fileName); + return false; + } + QSaveFile checksum(fileName + QStringLiteral(".sha256")); + if (!checksum.open(QIODevice::WriteOnly) || + checksum.write(digest) != digest.size() || !checksum.commit()) { + *error = QStringLiteral("Cannot write KTX2 checksum: %1") + .arg(checksum.errorString()); + return false; + } + return true; +} + +bool reusableCachedKtx2(const QString &fileName) +{ + if (!reusableKtx2(fileName)) { + return false; + } + QFile checksum(fileName + QStringLiteral(".sha256")); + if (!checksum.open(QIODevice::ReadOnly)) { + return false; + } + const QByteArray expected = checksum.read(65).trimmed(); + return expected.size() == 64 && fileSha256(fileName) == expected; +} + +bool reusableCopy(const QString &fileName, const QString &sourceFile, + const QByteArray &context, + const QByteArray &sourceFingerprint) +{ + const QFileInfo cached(fileName); + const QFileInfo source(sourceFile); + if (!cached.isFile() || !cached.isReadable() || cached.size() <= 0 || + cached.size() != source.size()) { + return false; + } + return fileSha256(fileName, context) == sourceFingerprint; +} + +bool copyTextureAtomically(const QString &sourceFile, + const QString &destinationFile) +{ + QFile source(sourceFile); + QSaveFile destination(destinationFile); + if (!source.open(QIODevice::ReadOnly) || + !destination.open(QIODevice::WriteOnly)) { + return false; + } + while (!source.atEnd()) { + const QByteArray bytes = source.read(1024 * 1024); + if (bytes.isEmpty() || destination.write(bytes) != bytes.size()) + { + destination.cancelWriting(); + return false; + } + } + return destination.commit(); +} + +void emitLog(const ConversionLog &log, const QString &message) +{ + if (log) { + log(message); + } +} + +bool readFile(const QString &fileName, QByteArray *contents, QString *error) +{ + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly)) + { + *error = + QStringLiteral("Cannot open %1: %2").arg(fileName, file.errorString()); + return false; + } + *contents = file.readAll(); + return true; +} + +bool writeFile(const QString &fileName, const QByteArray &contents, + QString *error) +{ + QSaveFile file(fileName); + if (!file.open(QIODevice::WriteOnly)) + { + *error = QStringLiteral("Cannot create %1: %2") + .arg(fileName, file.errorString()); + return false; + } + if (file.write(contents) != contents.size() || !file.commit()) + { + *error = + QStringLiteral("Cannot write %1: %2").arg(fileName, file.errorString()); + return false; + } + return true; +} + +float halfToFloat(quint16 half) +{ + const quint32 sign = static_cast<quint32>(half & 0x8000U) << 16; + quint32 exponent = (half >> 10) & 0x1FU; + quint32 mantissa = half & 0x03FFU; + quint32 bits; + + if (exponent == 0) + { + if (mantissa == 0) { + bits = sign; + } + else + { + int shift = 0; + while ((mantissa & 0x0400U) == 0) + { + mantissa <<= 1; + ++shift; + } + mantissa &= 0x03FFU; + const quint32 floatExponent = static_cast<quint32>(127 - 14 - shift); + bits = sign | (floatExponent << 23) | (mantissa << 13); + } + } else if (exponent == 31) { + bits = sign | 0x7F800000U | (mantissa << 13); + } + else + { + exponent += 127 - 15; + bits = sign | (exponent << 23) | (mantissa << 13); + } + + float value; + std::memcpy(&value, &bits, sizeof(value)); + return value; +} + +void appendFloat(QByteArray *destination, float value) +{ + quint32 bits; + static_assert(sizeof(bits) == sizeof(value)); + std::memcpy(&bits, &value, sizeof(bits)); + bits = qToLittleEndian(bits); + destination->append(reinterpret_cast<const char *>(&bits), sizeof(bits)); +} + +int componentCount(const QString &type) +{ + if (type == "SCALAR") { + return 1; + } + if (type == "VEC2") { + return 2; + } + if (type == "VEC3") { + return 3; + } + if (type == "VEC4") { + return 4; + } + return 0; +} + +int componentSize(int componentType) +{ + switch (componentType) + { + case ComponentByte: + case ComponentUnsignedByte: + return 1; + case ComponentShort: + case ComponentUnsignedShort: + return 2; + case ComponentFloat: + return 4; + default: + return 0; + } +} + +bool identifyConversions(const QJsonArray &meshes, + QHash<int, AttributeKind> *conversions, + QString *error) +{ + for (const QJsonValue &meshValue : meshes) { + const QJsonArray primitives = + meshValue.toObject().value("primitives").toArray(); + for (const QJsonValue &primitiveValue : primitives) { + const QJsonObject attributes = + primitiveValue.toObject().value("attributes").toObject(); + for (auto it = attributes.begin(); it != attributes.end(); ++it) + { + AttributeKind kind; + if (it.key() == "NORMAL") { + kind = AttributeKind::Normal; + } else if (it.key() == "TANGENT") { + kind = AttributeKind::Tangent; + } else if (it.key().startsWith("TEXCOORD_")) { + kind = AttributeKind::TexCoord; + } else if (it.key().startsWith("COLOR_")) { + kind = AttributeKind::Color; + } else { + continue; + } + const int accessorIndex = it.value().toInt(-1); + if (accessorIndex < 0) + { + *error = + QStringLiteral("Invalid accessor for attribute %1").arg(it.key()); + return false; + } + if (conversions->contains(accessorIndex) && + conversions->value(accessorIndex) != kind) { + *error = QStringLiteral( + "Accessor %1 is reused with incompatible semantics") + .arg(accessorIndex); + return false; + } + conversions->insert(accessorIndex, kind); + } + } + } + return true; +} + +bool convertAccessor(int accessorIndex, AttributeKind kind, + QJsonArray *accessors, QJsonArray *bufferViews, + QVector<QByteArray> *buffers, QString *error) +{ + QJsonObject accessor = accessors->at(accessorIndex).toObject(); + if (accessor.contains("sparse")) + { + *error = QStringLiteral( + "Sparse accessor %1 is not supported for ASOBO expansion") + .arg(accessorIndex); + return false; + } + const int viewIndex = accessor.value("bufferView").toInt(-1); + if (viewIndex < 0 || viewIndex >= bufferViews->size()) + { + *error = QStringLiteral("Accessor %1 has no usable bufferView") + .arg(accessorIndex); + return false; + } + const QJsonObject view = bufferViews->at(viewIndex).toObject(); + const int bufferIndex = view.value("buffer").toInt(0); + if (bufferIndex < 0 || bufferIndex >= buffers->size()) + { + *error = QStringLiteral("Accessor %1 references invalid buffer %2") + .arg(accessorIndex) + .arg(bufferIndex); + return false; + } + + const int sourceComponents = + componentCount(accessor.value("type").toString()); + const int sourceComponentType = accessor.value("componentType").toInt(); + const int sourceComponentSize = componentSize(sourceComponentType); + const int count = accessor.value("count").toInt(-1); + if (sourceComponents <= 0 || sourceComponentSize <= 0 || count < 0) + { + *error = QStringLiteral("Accessor %1 has an unsupported source layout") + .arg(accessorIndex); + return false; + } + + const int packedSize = sourceComponents * sourceComponentSize; + const int stride = view.value("byteStride").toInt(packedSize); + const qsizetype viewStart = + static_cast<qsizetype>(view.value("byteOffset").toDouble()); + const qsizetype viewLength = + static_cast<qsizetype>(view.value("byteLength").toDouble(-1)); + const qsizetype accessorOffset = + static_cast<qsizetype>(accessor.value("byteOffset").toDouble()); + const qsizetype start = viewStart + accessorOffset; + const QByteArray &sourceBuffer = buffers->at(bufferIndex); + const quint64 relativeEnd = + count == 0 + ? static_cast<quint64>(accessorOffset) + : static_cast<quint64>(accessorOffset) + + static_cast<quint64>(count - 1) * static_cast<quint64>(stride) + + packedSize; + if (viewStart < 0 || viewLength < 0 || accessorOffset < 0 || + stride < packedSize || relativeEnd > static_cast<quint64>(viewLength) || + static_cast<quint64>(viewStart) + static_cast<quint64>(viewLength) > + static_cast<quint64>(sourceBuffer.size())) { + *error = QStringLiteral("Accessor %1 exceeds its source bufferView") + .arg(accessorIndex); + return false; + } + + int outputComponents = sourceComponents; + if (kind == AttributeKind::Normal) + { + if (sourceComponentType != ComponentByte || sourceComponents != 4) + { + *error = QStringLiteral("NORMAL accessor %1 is not ASOBO BYTE VEC4") + .arg(accessorIndex); + return false; + } + outputComponents = 3; + } + else if (kind == AttributeKind::Tangent) + { + if (sourceComponentType != ComponentByte || sourceComponents != 4) + { + *error = QStringLiteral("TANGENT accessor %1 is not ASOBO BYTE VEC4") + .arg(accessorIndex); + return false; + } + outputComponents = 4; + } + else if (kind == AttributeKind::TexCoord) + { + if (sourceComponentType != ComponentShort || sourceComponents != 2) + { + *error = QStringLiteral("TEXCOORD accessor %1 is not ASOBO SHORT VEC2") + .arg(accessorIndex); + return false; + } + outputComponents = 2; + } else if (kind == AttributeKind::Color) { + const bool byteColor = sourceComponentType == ComponentByte || + sourceComponentType == ComponentUnsignedByte; + if ((!byteColor && sourceComponentType != ComponentUnsignedShort) || + (sourceComponents != 3 && sourceComponents != 4)) { + *error = QStringLiteral( + "COLOR accessor %1 is not an ASOBO byte or ushort vector") + .arg(accessorIndex); + return false; + } + } + + QByteArray converted; + converted.reserve(count * outputComponents * static_cast<int>(sizeof(float))); + const uchar *source = + reinterpret_cast<const uchar *>(sourceBuffer.constData()); + for (int element = 0; element < count; ++element) { + const uchar *input = + source + start + static_cast<qsizetype>(element) * stride; + for (int component = 0; component < outputComponents; ++component) + { + float value; + if (kind == AttributeKind::Normal || kind == AttributeKind::Tangent) { + value = std::max(-1.0F, static_cast<qint8>(input[component]) / 127.0F); + } else if (kind == AttributeKind::Color && sourceComponentSize == 1) { + // Some stock-derived MSFS models declare packed colours as BYTE even + // though their raw values use the full unsigned 0..255 range. + value = input[component] / 255.0F; + } else { + value = halfToFloat(qFromLittleEndian<quint16>(input + component * 2)); + } + if (!std::isfinite(value)) + { + *error = + QStringLiteral("Accessor %1 contains a non-finite converted value") + .arg(accessorIndex); + return false; + } + appendFloat(&converted, value); + } + } + + QByteArray &destinationBuffer = (*buffers)[bufferIndex]; + while ((destinationBuffer.size() & 3) != 0) { + destinationBuffer.append('\0'); + } + const qsizetype destinationOffset = destinationBuffer.size(); + destinationBuffer.append(converted); + + QJsonObject newView; + newView.insert("buffer", bufferIndex); + newView.insert("byteOffset", static_cast<double>(destinationOffset)); + newView.insert("byteLength", converted.size()); + newView.insert("target", ArrayBufferTarget); + const int newViewIndex = bufferViews->size(); + bufferViews->append(newView); + + accessor.insert("bufferView", newViewIndex); + accessor.insert("byteOffset", 0); + accessor.insert("componentType", ComponentFloat); + accessor.insert("type", QStringLiteral("VEC%1").arg(outputComponents)); + accessor.remove("normalized"); + accessor.remove("min"); + accessor.remove("max"); + (*accessors)[accessorIndex] = accessor; + return true; +} + +bool flipTriangleWinding(const QJsonArray &meshes, const QJsonArray &accessors, + const QJsonArray &bufferViews, + QVector<QByteArray> *buffers, int *flippedTriangles, + QString *error) +{ + QSet<int> convertedIndexAccessors; + for (const QJsonValue &meshValue : meshes) + { + for (const QJsonValue &primitiveValue : + meshValue.toObject().value("primitives").toArray()) { + const QJsonObject primitive = primitiveValue.toObject(); + if (primitive.value("mode").toInt(4) != 4) { + continue; + } + const int accessorIndex = primitive.value("indices").toInt(-1); + if (accessorIndex < 0) + { + *error = QStringLiteral( + "Prototype cannot reverse a non-indexed triangle primitive"); + return false; + } + if (convertedIndexAccessors.contains(accessorIndex)) { + continue; + } + if (accessorIndex >= accessors.size()) + { + *error = + QStringLiteral("Primitive references missing index accessor %1") + .arg(accessorIndex); + return false; + } + + const QJsonObject accessor = accessors.at(accessorIndex).toObject(); + if (accessor.contains("sparse")) + { + *error = QStringLiteral( + "Sparse index accessor %1 cannot be modified in place") + .arg(accessorIndex); + return false; + } + const int viewIndex = accessor.value("bufferView").toInt(-1); + if (viewIndex < 0 || viewIndex >= bufferViews.size()) + { + *error = QStringLiteral("Index accessor %1 has no usable bufferView") + .arg(accessorIndex); + return false; + } + const QJsonObject view = bufferViews.at(viewIndex).toObject(); + const int bufferIndex = view.value("buffer").toInt(0); + if (bufferIndex < 0 || bufferIndex >= buffers->size()) + { + *error = QStringLiteral("Index accessor %1 references invalid buffer") + .arg(accessorIndex); + return false; + } + const int componentType = accessor.value("componentType").toInt(); + int bytesPerIndex = 0; + if (componentType == ComponentUnsignedByte) { + bytesPerIndex = 1; + } else if (componentType == ComponentUnsignedShort) { + bytesPerIndex = 2; + } else if (componentType == ComponentUnsignedInt) { + bytesPerIndex = 4; + } + else + { + *error = QStringLiteral( + "Index accessor %1 has unsupported component type %2") + .arg(accessorIndex) + .arg(componentType); + return false; + } + const int count = accessor.value("count").toInt(-1); + if (count < 0 || count % 3 != 0) + { + *error = + QStringLiteral("Triangle index accessor %1 has invalid count %2") + .arg(accessorIndex) + .arg(count); + return false; + } + const int stride = view.value("byteStride").toInt(bytesPerIndex); + const qsizetype viewStart = + static_cast<qsizetype>(view.value("byteOffset").toDouble()); + const qsizetype viewLength = + static_cast<qsizetype>(view.value("byteLength").toDouble(-1)); + const qsizetype accessorOffset = + static_cast<qsizetype>(accessor.value("byteOffset").toDouble()); + const qsizetype start = viewStart + accessorOffset; + QByteArray &buffer = (*buffers)[bufferIndex]; + const quint64 relativeEnd = count == 0 + ? static_cast<quint64>(accessorOffset) + : static_cast<quint64>(accessorOffset) + + static_cast<quint64>(count - 1) * + static_cast<quint64>(stride) + + bytesPerIndex; + if (viewStart < 0 || viewLength < 0 || accessorOffset < 0 || + stride < bytesPerIndex || + relativeEnd > static_cast<quint64>(viewLength) || + static_cast<quint64>(viewStart) + static_cast<quint64>(viewLength) > + static_cast<quint64>(buffer.size())) { + *error = + QStringLiteral("Index accessor %1 exceeds its source bufferView") + .arg(accessorIndex); + return false; + } + + char *data = buffer.data(); + for (int index = 0; index < count; index += 3) + { + char *second = + data + start + static_cast<qsizetype>(index + 1) * stride; + char *third = data + start + static_cast<qsizetype>(index + 2) * stride; + for (int byte = 0; byte < bytesPerIndex; ++byte) { + std::swap(second[byte], third[byte]); + } + } + *flippedTriangles += count / 3; + convertedIndexAccessors.insert(accessorIndex); + } + } + return true; +} + +int sanitizeExtras(QJsonValue *value) +{ + int removed = 0; + if (value->isArray()) + { + QJsonArray array = value->toArray(); + for (qsizetype i = 0; i < array.size(); ++i) + { + QJsonValue child = array.at(i); + removed += sanitizeExtras(&child); + array[i] = child; + } + *value = array; + } + else if (value->isObject()) + { + QJsonObject object = value->toObject(); + const auto keys = object.keys(); + for (const QString &key : keys) + { + if (key == "extras" && !object.value(key).isObject()) + { + object.remove(key); + ++removed; + } + else + { + QJsonValue child = object.value(key); + removed += sanitizeExtras(&child); + object.insert(key, child); + } + } + *value = object; + } + return removed; +} + +void stripExtensions(QJsonValue *value, const QSet<QString> &names) +{ + if (value->isArray()) + { + QJsonArray array = value->toArray(); + for (qsizetype i = 0; i < array.size(); ++i) + { + QJsonValue child = array.at(i); + stripExtensions(&child, names); + array[i] = child; + } + *value = array; + } + else if (value->isObject()) + { + QJsonObject object = value->toObject(); + const auto keys = object.keys(); + for (const QString &key : keys) + { + QJsonValue child = object.value(key); + if (key == "extensions" && child.isObject()) + { + QJsonObject extensions = child.toObject(); + for (const QString &name : names) { + extensions.remove(name); + } + if (extensions.isEmpty()) + { + object.remove(key); + continue; + } + child = extensions; + } + stripExtensions(&child, names); + object.insert(key, child); + } + *value = object; + } +} + +QJsonArray withoutExtensions(const QJsonArray &array, + const QSet<QString> &names) +{ + QJsonArray filtered; + for (const QJsonValue &value : array) + { + if (!names.contains(value.toString())) { + filtered.append(value); + } + } + return filtered; +} + +QJsonArray withExtension(QJsonArray array, const QString &name) +{ + for (const QJsonValue &value : array) + { + if (value.toString() == name) { + return array; + } + } + array.append(name); + return array; +} + +int textureSource(const QJsonObject &texture) +{ + const QJsonObject dds = texture.value("extensions") + .toObject() + .value("MSFT_texture_dds") + .toObject(); + return dds.contains("source") ? dds.value("source").toInt(-1) + : texture.value("source").toInt(-1); +} + +QString legacyKtxNameForDds(const QString &uri, qsizetype imageIndex, + const QByteArray &fingerprint) +{ + QString name = QFileInfo(uri).fileName(); + if (name.endsWith(".dds", Qt::CaseInsensitive)) { + name.chop(4); + } + return QStringLiteral("%1_%2_%3.ktx2") + .arg(name) + .arg(imageIndex) + .arg(QString::fromLatin1(fingerprint.left(12))); +} + +QString cachedKtxName(const QByteArray &fingerprint) +{ + return QString::fromLatin1(fingerprint) + QStringLiteral(".ktx2"); +} + +QString cachedImageName(const QString &sourceFile, + const QByteArray &fingerprint) +{ + const QString suffix = QFileInfo(sourceFile).suffix().toLower(); + return QString::fromLatin1(fingerprint) + + (suffix.isEmpty() ? QString() : QStringLiteral(".") + suffix); +} + +bool safeRelativePath(const QString &uri, QString *decoded, QString *error) +{ + const QUrl url = QUrl::fromEncoded(uri.toUtf8(), QUrl::StrictMode); + *decoded = url.path(QUrl::FullyDecoded); + const QString clean = QDir::cleanPath(*decoded); + if (!url.isValid() || !url.scheme().isEmpty() || !url.authority().isEmpty() || + QDir::isAbsolutePath(*decoded) || clean == ".." || + clean.startsWith("../") || clean.contains(':')) { + *error = QStringLiteral("Unsafe external URI is not allowed: %1").arg(uri); + return false; + } + *decoded = clean; + return true; +} + +QString containedFile(const QDir &root, const QString &relative) +{ + const QFileInfo candidate(root.filePath(relative)); + if (!candidate.isFile()) + return {}; + const QString rootPath = QFileInfo(root.absolutePath()).canonicalFilePath(); + const QString filePath = candidate.canonicalFilePath(); + if (rootPath.isEmpty() || filePath.isEmpty()) + return {}; + const QString prefix = QDir::toNativeSeparators(rootPath) + QDir::separator(); + const Qt::CaseSensitivity pathCase = +#ifdef Q_OS_WIN + Qt::CaseInsensitive; +#else + Qt::CaseSensitive; +#endif + if (!QDir::toNativeSeparators(filePath).startsWith(prefix, pathCase)) { + return {}; + } + return filePath; +} + +QString findTextureFile(const QString &uri, const QDir &modelDirectory, + const QStringList &textureDirectories, QString *error) +{ + QString relative; + if (!safeRelativePath(uri, &relative, error)) { + return {}; + } + for (const QString &directory : textureDirectories) + { + const QString candidate = containedFile(QDir(directory), relative); + if (!candidate.isEmpty()) + return candidate; + } + return containedFile(modelDirectory, relative); +} + +QByteArray fileFingerprint(const QString &fileName, const QByteArray &context, + QString *error) +{ + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly)) + { + *error = + QStringLiteral("Cannot hash %1: %2").arg(fileName, file.errorString()); + return {}; + } + QCryptographicHash hash(QCryptographicHash::Sha256); + hash.addData(context); + if (!hash.addData(&file)) + { + *error = QStringLiteral("Cannot hash %1").arg(fileName); + return {}; + } + return hash.result().toHex(); +} + +bool cancelled(const ConversionOptions &options, QString *error) +{ + if (options.m_isCancelled && options.m_isCancelled()) + { + *error = QStringLiteral("Conversion cancelled"); + return true; + } + return false; +} + +bool writeNeutralTexture(const ConversionOptions &options, + const QDir &outputDirectory, + const QDir &sharedTextureDirectory, + UastcTextureSemantic semantic, bool srgb, QRgb pixel, + QString *outputUri, bool *reused, QString *error) +{ + QByteArray identity = QByteArrayLiteral("MSFSAssetConverter-neutral-v1\0") + + QByteArray::number(static_cast<int>(semantic)) + ':' + + QByteArray::number(srgb) + ':' + + QByteArray::number(qRed(pixel)) + ':' + + QByteArray::number(qGreen(pixel)) + ':' + + QByteArray::number(qBlue(pixel)) + ':' + + QByteArray::number(qAlpha(pixel)) + ':' + + QByteArray::number(options.m_zstdSupercompression); + const QByteArray fingerprint = + QCryptographicHash::hash(identity, QCryptographicHash::Sha256).toHex(); + const QString outputName = cachedKtxName(fingerprint); + QString outputPath = outputDirectory.filePath(outputName); + *outputUri = outputName; + if (!options.m_sharedTextureDirectory.isEmpty()) + { + outputPath = sharedTextureDirectory.absoluteFilePath(outputName); + *outputUri = QDir::fromNativeSeparators( + outputDirectory.relativeFilePath(outputPath)); + } + + const std::shared_ptr<std::mutex> outputLock = textureLock(outputPath); + const std::lock_guard<std::mutex> outputGuard(*outputLock); + *reused = reusableCachedKtx2(outputPath); + if (*reused) { + return true; + } + + QImage neutral(1, 1, QImage::Format_RGBA8888); + neutral.fill(pixel); + if (!writeUastcKtx2({neutral}, outputPath, srgb, semantic, error, + options.m_isCancelled, options.m_zstdSupercompression)) { + return false; + } + if (!writeKtxChecksum(outputPath, error) || + !reusableCachedKtx2(outputPath)) { + *error = QStringLiteral("Generated neutral KTX2 texture failed validation: %1") + .arg(outputPath); + return false; + } + return true; +} + +// MSFS's Porthole shader blends its base color by alpha, so the window decal +// quads are declared OPAQUE. Core glTF ignores alpha for OPAQUE materials, which +// shows the quad's transparent white surround as a pale rectangle round each +// window. +int blendPortholeMaterials(QJsonObject *root) +{ + QJsonArray materials = root->value("materials").toArray(); + int count = 0; + for (qsizetype i = 0; i < materials.size(); ++i) + { + QJsonObject material = materials.at(i).toObject(); + const QString code = material.value("extras") + .toObject() + .value("ASOBO_material_code") + .toString(); + if (code.compare(QStringLiteral("Porthole"), Qt::CaseInsensitive) != 0 || + material.contains("alphaMode")) { + continue; + } + material.insert("alphaMode", QStringLiteral("BLEND")); + materials[i] = material; + ++count; + } + if (count > 0) { + root->insert("materials", materials); + } + return count; +} + +} // namespace + +bool convertMsfsAsset(const ConversionOptions &options, + ConversionResult *result, QString *error, + const ConversionLog &log) +{ + *result = {}; + const QFileInfo requestedInput(options.m_inputGltf); + if (!requestedInput.exists() || !requestedInput.isFile()) + { + *error = QStringLiteral("Input does not exist: %1").arg(options.m_inputGltf); + return false; + } + QFileInfo inputInfo = requestedInput; + QString outputBaseName = inputInfo.completeBaseName(); + QStringList textureDirectories; + QString modelXml; + if (requestedInput.fileName().compare(QStringLiteral("aircraft.cfg"), + Qt::CaseInsensitive) == 0) { + ResolvedFsltlAircraft aircraft; + if (!resolveFsltlAircraft(requestedInput.absoluteFilePath(), + options.m_flightSimIndex, options.m_lodIndex, + &aircraft, error)) { + return false; + } + inputInfo = QFileInfo(aircraft.m_gltfFile); + modelXml = aircraft.m_modelXml; + outputBaseName = aircraft.m_outputBaseName; + textureDirectories = aircraft.m_textureDirectories; + result->m_skippedFallbackDirectories = aircraft.m_warnings.size(); + emitLog(log, QStringLiteral("Resolved aircraft hierarchy: %1") + .arg(aircraft.m_aircraftHierarchy.join(" -> "))); + emitLog(log, QStringLiteral("Selected LOD %1 model: %2") + .arg(options.m_lodIndex) + .arg(inputInfo.absoluteFilePath())); + emitLog(log, QStringLiteral("Texture search order: %1") + .arg(textureDirectories.join(" -> "))); + for (const QString &warning : aircraft.m_warnings) { + emitLog(log, QStringLiteral("WARNING: %1").arg(warning)); + } + } + QDir outputDirectory(options.m_outputDirectory); + if (!outputDirectory.exists() && + !QDir().mkpath(outputDirectory.absolutePath())) { + *error = QStringLiteral("Cannot create output directory: %1") + .arg(outputDirectory.absolutePath()); + return false; + } + QDir sharedTextureDirectory(options.m_sharedTextureDirectory); + if (!options.m_sharedTextureDirectory.isEmpty() && + !sharedTextureDirectory.exists() && + !QDir().mkpath(sharedTextureDirectory.absolutePath())) { + *error = QStringLiteral("Cannot create shared texture directory: %1") + .arg(sharedTextureDirectory.absolutePath()); + return false; + } + + QByteArray jsonBytes; + if (!readFile(inputInfo.absoluteFilePath(), &jsonBytes, error)) { + return false; + } + QJsonParseError parseError; + const QJsonDocument document = + QJsonDocument::fromJson(jsonBytes, &parseError); + if (document.isNull() || !document.isObject()) + { + *error = QStringLiteral("Invalid glTF JSON at byte %1: %2") + .arg(parseError.offset) + .arg(parseError.errorString()); + return false; + } + QJsonObject root = document.object(); + emitLog(log, QStringLiteral("Loaded %1").arg(inputInfo.fileName())); + + QJsonArray bufferObjects = root.value("buffers").toArray(); + QVector<QByteArray> buffers; + buffers.reserve(bufferObjects.size()); + for (qsizetype i = 0; i < bufferObjects.size(); ++i) + { + if (cancelled(options, error)) + return false; + const QString uri = bufferObjects.at(i).toObject().value("uri").toString(); + if (uri.isEmpty() || uri.startsWith("data:")) + { + *error = + QStringLiteral("Prototype only supports external binary buffers"); + return false; + } + QString relative; + if (!safeRelativePath(uri, &relative, error)) + return false; + QByteArray bytes; + const QString bufferFile = containedFile(inputInfo.dir(), relative); + if (bufferFile.isEmpty()) + { + *error = QStringLiteral( + "Buffer URI does not resolve inside the model directory: %1") + .arg(uri); + return false; + } + if (!readFile(bufferFile, &bytes, error)) { + return false; + } + buffers.append(std::move(bytes)); + } + + QJsonArray accessors = root.value("accessors").toArray(); + QJsonArray bufferViews = root.value("bufferViews").toArray(); + QHash<int, AttributeKind> conversions; + if (!identifyConversions(root.value("meshes").toArray(), &conversions, + error)) { + return false; + } + QList<int> accessorIndices = conversions.keys(); + std::sort(accessorIndices.begin(), accessorIndices.end()); + for (int accessorIndex : accessorIndices) + { + if (cancelled(options, error)) + return false; + if (accessorIndex >= accessors.size()) + { + *error = QStringLiteral("Mesh references missing accessor %1") + .arg(accessorIndex); + return false; + } + if (!convertAccessor(accessorIndex, conversions.value(accessorIndex), + &accessors, &bufferViews, &buffers, error)) { + return false; + } + ++result->m_convertedAccessors; + } + root.insert("accessors", accessors); + root.insert("bufferViews", bufferViews); + emitLog(log, QStringLiteral("Expanded %1 packed vertex accessors to float32") + .arg(result->m_convertedAccessors)); + + if (!flipTriangleWinding(root.value("meshes").toArray(), accessors, + bufferViews, &buffers, &result->m_flippedTriangles, + error)) { + return false; + } + emitLog(log, + QStringLiteral("Reversed %1 triangle windings for glTF front faces") + .arg(result->m_flippedTriangles)); + + // Gear, flaps, slats and engines under the names the ADS-B demodulator plays. Only + // the model XML says which MSFS animation is which, so a bare glTF keeps its own + if (!modelXml.isEmpty()) + { + QHash<QString, MsfsAnimationRole> roles; + QString animationError; + if (!readMsfsAnimationRoles(modelXml, &roles, &animationError)) { + emitLog(log, QStringLiteral("WARNING: animations not mapped: %1").arg(animationError)); + } else { + for (const QString &made : mapMsfsAnimations(roles, &root, &buffers)) { + emitLog(log, QStringLiteral("Animation %1").arg(made)); + } + } + } + + const int portholes = blendPortholeMaterials(&root); + if (portholes > 0) { + emitLog(log, QStringLiteral("Set alpha blending on %1 porthole materials") + .arg(portholes)); + } + + QJsonArray textures = root.value("textures").toArray(); + QSet<int> normalImages; + QSet<int> linearImages; + QSet<int> colorImages; + QSet<int> emissiveImages; + QSet<int> opaqueBaseColorImages; + QSet<int> transparentBaseColorImages; + for (const QJsonValue &materialValue : root.value("materials").toArray()) + { + const QJsonObject material = materialValue.toObject(); + const int normalTexture = + material.value("normalTexture").toObject().value("index").toInt(-1); + if (normalTexture >= 0 && normalTexture < textures.size()) { + const int imageIndex = + textureSource(textures.at(normalTexture).toObject()); + if (imageIndex >= 0) + { + normalImages.insert(imageIndex); + linearImages.insert(imageIndex); + } + } + const QJsonObject pbr = material.value("pbrMetallicRoughness").toObject(); + const int baseColorTexture = + pbr.value("baseColorTexture").toObject().value("index").toInt(-1); + if (baseColorTexture >= 0 && baseColorTexture < textures.size()) { + const int imageIndex = + textureSource(textures.at(baseColorTexture).toObject()); + if (imageIndex >= 0) + { + colorImages.insert(imageIndex); + const QString alphaMode = + material.value("alphaMode").toString(QStringLiteral("OPAQUE")); + if (alphaMode.compare(QStringLiteral("OPAQUE"), + Qt::CaseInsensitive) == 0) { + opaqueBaseColorImages.insert(imageIndex); + } else { + transparentBaseColorImages.insert(imageIndex); + } + } + } + const int emissiveTexture = + material.value("emissiveTexture").toObject().value("index").toInt(-1); + if (emissiveTexture >= 0 && emissiveTexture < textures.size()) { + const int imageIndex = + textureSource(textures.at(emissiveTexture).toObject()); + if (imageIndex >= 0) + { + colorImages.insert(imageIndex); + emissiveImages.insert(imageIndex); + } + } + const QList<int> linearTextures{ + pbr.value("metallicRoughnessTexture") + .toObject() + .value("index") + .toInt(-1), + material.value("occlusionTexture").toObject().value("index").toInt(-1)}; + for (int textureIndex : linearTextures) + { + if (textureIndex >= 0 && textureIndex < textures.size()) { + const int imageIndex = + textureSource(textures.at(textureIndex).toObject()); + if (imageIndex >= 0) { + linearImages.insert(imageIndex); + } + } + } + } + for (int imageIndex : colorImages) + { + if (linearImages.contains(imageIndex)) + { + *error = QStringLiteral( + "Image %1 is reused by both color and linear/normal texture " + "slots; " + "production conversion requires separate image sources") + .arg(imageIndex); + return false; + } + } + + QJsonArray images = root.value("images").toArray(); + QSet<int> convertedImages; + for (qsizetype i = 0; i < images.size(); ++i) + { + if (cancelled(options, error)) + return false; + QJsonObject imageObject = images.at(i).toObject(); + const QString uri = imageObject.value("uri").toString(); + if (uri.isEmpty() || uri.startsWith(QStringLiteral("data:"), + Qt::CaseInsensitive)) { + continue; + } + bool ddsSource = uri.endsWith(".dds", Qt::CaseInsensitive); + QString sourceTexture = + findTextureFile(uri, inputInfo.dir(), textureDirectories, error); + if (sourceTexture.isEmpty() && error->isEmpty() && !ddsSource) + { + // Some MSFS glTF files expose the fallback image as foo.png even though + // only foo.png.DDS is shipped alongside the aircraft. + sourceTexture = findTextureFile(uri + QStringLiteral(".DDS"), + inputInfo.dir(), textureDirectories, + error); + ddsSource = !sourceTexture.isEmpty(); + } + if (sourceTexture.isEmpty()) + { + if (!error->isEmpty()) { + return false; + } + + const int imageIndex = static_cast<int>(i); + if (opaqueBaseColorImages.contains(imageIndex)) + { + *error = QStringLiteral( + "Cannot resolve required opaque base-color texture through " + "the fallback hierarchy: %1") + .arg(uri); + return false; + } + + const QString upperUri = uri.toUpper(); + const bool isNormal = normalImages.contains(imageIndex) || + upperUri.contains(QStringLiteral("NORMAL")) || + upperUri.contains(QStringLiteral("_NORM")); + const bool isLinear = linearImages.contains(imageIndex) || isNormal || + upperUri.contains(QStringLiteral("OCCLUSION")) || + upperUri.contains(QStringLiteral("ROUGHNESS")) || + upperUri.contains(QStringLiteral("METALLIC")) || + upperUri.contains(QStringLiteral("_COMP")) || + upperUri.contains(QStringLiteral("_MASK")); + const bool srgb = !isLinear; + const UastcTextureSemantic semantic = + isNormal ? UastcTextureSemantic::Normal + : (srgb ? UastcTextureSemantic::Color + : UastcTextureSemantic::Data); + QRgb neutralPixel = qRgba(255, 255, 255, 255); + if (isNormal) { + neutralPixel = qRgba(128, 128, 255, 255); + } else if (isLinear) { + // Neutral glTF ORM: full occlusion, full roughness, no metallic. + neutralPixel = qRgba(255, 255, 0, 255); + } else if (emissiveImages.contains(imageIndex)) { + neutralPixel = qRgba(0, 0, 0, 255); + } else if (transparentBaseColorImages.contains(imageIndex)) { + // Missing BLEND/MASK base colors are normally optional overlays. + neutralPixel = qRgba(255, 255, 255, 0); + } + + QString neutralUri; + bool reused = false; + if (!writeNeutralTexture(options, outputDirectory, + sharedTextureDirectory, semantic, srgb, + neutralPixel, &neutralUri, &reused, error)) { + return false; + } + imageObject.insert("uri", neutralUri); + imageObject.remove("mimeType"); + images[i] = imageObject; + convertedImages.insert(imageIndex); + ++result->m_convertedTextures; + ++result->m_synthesizedTextures; + if (reused) { + ++result->m_reusedTextures; + } + emitLog(log, + QStringLiteral("WARNING: Replaced missing optional texture %1 " + "with a neutral 1x1 KTX2 texture") + .arg(uri)); + continue; + } + if (!ddsSource) + { + const QByteArray copyContext = + QByteArrayLiteral("MSFSAssetConverter-image-copy-v1"); + const QByteArray fingerprint = fileFingerprint( + sourceTexture, copyContext, error); + if (fingerprint.isEmpty()) + return false; + const QString outputName = cachedImageName(sourceTexture, fingerprint); + QString outputPath = outputDirectory.filePath(outputName); + QString outputUri = outputName; + if (!options.m_sharedTextureDirectory.isEmpty()) + { + outputPath = sharedTextureDirectory.absoluteFilePath(outputName); + outputUri = QDir::fromNativeSeparators( + outputDirectory.relativeFilePath(outputPath)); + } + const std::shared_ptr<std::mutex> outputLock = textureLock(outputPath); + const std::lock_guard<std::mutex> outputGuard(*outputLock); + if (reusableCopy(outputPath, sourceTexture, copyContext, fingerprint)) + { + ++result->m_reusedTextures; + emitLog(log, QStringLiteral("Reused cached image for %1").arg(uri)); + } + else if (!copyTextureAtomically(sourceTexture, outputPath)) + { + *error = QStringLiteral("Cannot copy external image %1 to %2") + .arg(sourceTexture, outputPath); + return false; + } else { + emitLog(log, QStringLiteral("Copied external image %1").arg(uri)); + } + imageObject.insert("uri", outputUri); + images[i] = imageObject; + continue; + } + + const bool isNormal = normalImages.contains(static_cast<int>(i)); + const bool srgb = !linearImages.contains(static_cast<int>(i)); + const UastcTextureSemantic semantic = + isNormal + ? UastcTextureSemantic::Normal + : (srgb ? UastcTextureSemantic::Color : UastcTextureSemantic::Data); + const QByteArray fingerprint = + fileFingerprint(sourceTexture, + QByteArrayLiteral("MSFSAssetConverter-UASTC-v2\0") + + QByteArray::number(static_cast<int>(semantic)) + + QByteArray::number(options.m_flipDirectXNormalY) + + QByteArray::number(options.m_zstdSupercompression), + error); + if (fingerprint.isEmpty()) + return false; + const QString outputName = cachedKtxName(fingerprint); + QString outputPath = outputDirectory.filePath(outputName); + QString outputUri = outputName; + std::shared_ptr<std::mutex> sharedOutputLock; + std::unique_lock<std::mutex> outputGuard; + if (!options.m_sharedTextureDirectory.isEmpty()) + { + outputPath = sharedTextureDirectory.absoluteFilePath(outputName); + outputUri = QDir::fromNativeSeparators( + QDir(outputDirectory.absolutePath()).relativeFilePath(outputPath)); + sharedOutputLock = textureLock(outputPath); + outputGuard = std::unique_lock<std::mutex>(*sharedOutputLock); + const QString legacyOutput = outputDirectory.filePath( + legacyKtxNameForDds(uri, i, fingerprint)); + QString checksumError; + if (!reusableCachedKtx2(outputPath) && reusableKtx2(legacyOutput) && + copyTextureAtomically(legacyOutput, outputPath) && + writeKtxChecksum(outputPath, &checksumError)) { + emitLog( + log, + QStringLiteral("Copied existing KTX2 texture into the shared cache for %1") + .arg(uri)); + } + } + if (cancelled(options, error)) + return false; + + if (reusableCachedKtx2(outputPath)) + { + ++result->m_reusedTextures; + emitLog(log, QStringLiteral("Reused cached KTX2 texture for %1") + .arg(uri)); + } + else + { + DdsDecodeResult decoded; + if (!decodeDds(sourceTexture, isNormal, options.m_flipDirectXNormalY, + &decoded, error)) { + return false; + } + emitLog( + log, + QStringLiteral("Writing %1 DDS mip levels from %2 as %3 UASTC KTX2") + .arg(decoded.m_levels.size()) + .arg(uri, + srgb ? QStringLiteral("sRGB") : QStringLiteral("linear"))); + if (!writeUastcKtx2(decoded.m_levels, outputPath, srgb, semantic, error, + options.m_isCancelled, + options.m_zstdSupercompression)) { + return false; + } + if (!writeKtxChecksum(outputPath, error) || + !reusableCachedKtx2(outputPath)) { + *error = QStringLiteral("Generated KTX2 texture failed validation: %1") + .arg(outputPath); + return false; + } + result->m_preservedMipLevels += decoded.m_levels.size(); + emitLog(log, QStringLiteral("Converted %1 from %2 (%3, %4 mip levels)%5") + .arg(uri, QFileInfo(sourceTexture).absolutePath(), + decoded.m_format) + .arg(decoded.m_levels.size()) + .arg(isNormal + ? QStringLiteral(" as an OpenGL normal map") + : QString())); + } + imageObject.insert("uri", outputUri); + imageObject.remove("mimeType"); + images[i] = imageObject; + convertedImages.insert(static_cast<int>(i)); + ++result->m_convertedTextures; + } + root.insert("images", images); + + for (qsizetype i = 0; i < textures.size(); ++i) + { + QJsonObject texture = textures.at(i).toObject(); + const int source = textureSource(texture); + if (convertedImages.contains(source)) + { + texture.remove("source"); + QJsonObject extensions = texture.value("extensions").toObject(); + extensions.insert("KHR_texture_basisu", QJsonObject{{"source", source}}); + texture.insert("extensions", extensions); + } else if (source >= 0) { + texture.insert("source", source); + } + textures[i] = texture; + } + root.insert("textures", textures); + + const QSet<QString> removedExtensions{ + "ASOBO_asset_optimized", "ASOBO_macro_light", + "ASOBO_normal_map_convention", "MSFT_texture_dds"}; + const QJsonArray usedBeforeRemoval = root.value("extensionsUsed").toArray(); + if (usedBeforeRemoval.contains(QStringLiteral("ASOBO_macro_light"))) + { + const QString message = + QStringLiteral("ASOBO_macro_light is not representable in core glTF; " + "its payload will be dropped"); + if (options.m_strictExtensions) + { + *error = message; + return false; + } + emitLog(log, QStringLiteral("WARNING: %1").arg(message)); + } + root.insert("extensionsUsed", + withoutExtensions(root.value("extensionsUsed").toArray(), + removedExtensions)); + root.insert("extensionsRequired", + withoutExtensions(root.value("extensionsRequired").toArray(), + removedExtensions)); + QJsonValue rootValue(root); + stripExtensions(&rootValue, removedExtensions); + result->m_removedExtras = sanitizeExtras(&rootValue); + root = rootValue.toObject(); + if (!convertedImages.isEmpty()) + { + root.insert("extensionsUsed", + withExtension(root.value("extensionsUsed").toArray(), + QStringLiteral("KHR_texture_basisu"))); + root.insert("extensionsRequired", + withExtension(root.value("extensionsRequired").toArray(), + QStringLiteral("KHR_texture_basisu"))); + } + if (root.value("extensionsUsed").toArray().isEmpty()) { + root.remove("extensionsUsed"); + } + if (root.value("extensionsRequired").toArray().isEmpty()) { + root.remove("extensionsRequired"); + } + emitLog(log, QStringLiteral("Removed unsupported MSFS extension payloads and " + "%1 non-object extras") + .arg(result->m_removedExtras)); + + const QString baseName = + outputBaseName + options.m_outputNameSuffix + QStringLiteral("_cesium"); + for (qsizetype i = 0; i < buffers.size(); ++i) + { + if (cancelled(options, error)) + return false; + const QByteArray hash = + QCryptographicHash::hash(buffers.at(i), QCryptographicHash::Sha256) + .toHex() + .left(12); + const QString outputBufferName = QStringLiteral("%1_%2_%3.bin") + .arg(baseName) + .arg(i) + .arg(QString::fromLatin1(hash)); + if (!writeFile(outputDirectory.filePath(outputBufferName), buffers.at(i), + error)) { + return false; + } + QJsonObject bufferObject = bufferObjects.at(i).toObject(); + bufferObject.insert("uri", outputBufferName); + bufferObject.insert("byteLength", buffers.at(i).size()); + bufferObjects[i] = bufferObject; + } + root.insert("buffers", bufferObjects); + + QJsonObject asset = root.value("asset").toObject(); + const QString generator = asset.value("generator").toString(); + asset.insert("generator", generator.isEmpty() + ? QStringLiteral("MSFSAssetConverter") + : generator + "; MSFSAssetConverter"); + root.insert("asset", asset); + + result->m_outputGltf = outputDirectory.filePath(baseName + ".gltf"); + if (!writeFile(result->m_outputGltf, + QJsonDocument(root).toJson(QJsonDocument::Indented), error)) { + return false; + } + emitLog(log, QStringLiteral("Wrote %1").arg(result->m_outputGltf)); + return true; +} diff --git a/plugins/feature/map/msfsassetconverter/converter.h b/plugins/feature/map/msfsassetconverter/converter.h new file mode 100644 index 000000000..3ef79c861 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/converter.h @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QString> + +#include <functional> + +struct ConversionOptions { + QString m_inputGltf; + QString m_outputDirectory; + QString m_outputNameSuffix; + QString m_sharedTextureDirectory; + bool m_flipDirectXNormalY = true; + int m_flightSimIndex = 0; + int m_lodIndex = 0; + bool m_strictExtensions = false; +#ifdef MSFS_CONVERTER_WITH_ZSTD + // Lossless, and about 8x smaller for liveries, which are mostly flat colour + bool m_zstdSupercompression = true; +#else + bool m_zstdSupercompression = false; +#endif + std::function<bool()> m_isCancelled; +}; + +struct ConversionResult { + QString m_outputGltf; + int m_convertedAccessors = 0; + int m_convertedTextures = 0; + int m_synthesizedTextures = 0; + int m_reusedTextures = 0; + int m_skippedFallbackDirectories = 0; + int m_preservedMipLevels = 0; + int m_flippedTriangles = 0; + int m_removedExtras = 0; +}; + +using ConversionLog = std::function<void(const QString &)>; + +bool convertMsfsAsset(const ConversionOptions &options, + ConversionResult *result, QString *error, + const ConversionLog &log = {}); diff --git a/plugins/feature/map/msfsassetconverter/ddsdecoder.cpp b/plugins/feature/map/msfsassetconverter/ddsdecoder.cpp new file mode 100644 index 000000000..b07458cd7 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/ddsdecoder.cpp @@ -0,0 +1,542 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "ddsdecoder.h" +#include "bc7decoder.h" + +#include <QFile> +#include <QtEndian> + +#include <algorithm> +#include <array> +#include <cmath> +#include <cstdint> + +namespace { + +quint32 readU32(const QByteArray &data, qsizetype offset) +{ + return qFromLittleEndian<quint32>( + reinterpret_cast<const uchar *>(data.constData() + offset)); +} + +quint16 readU16(const uchar *data) +{ + return qFromLittleEndian<quint16>(data); +} + +struct Rgba { + int m_r; + int m_g; + int m_b; + int m_a; +}; + +Rgba color565(quint16 value) +{ + const int r = (value >> 11) & 31; + const int g = (value >> 5) & 63; + const int b = value & 31; + return {(r * 255 + 15) / 31, (g * 255 + 31) / 63, (b * 255 + 15) / 31, 255}; +} + +void writePixel(QImage &image, int x, int y, const Rgba &pixel) +{ + if (x < 0 || y < 0 || x >= image.width() || y >= image.height()) { + return; + } + uchar *destination = image.scanLine(y) + x * 4; + destination[0] = static_cast<uchar>(std::clamp(pixel.m_r, 0, 255)); + destination[1] = static_cast<uchar>(std::clamp(pixel.m_g, 0, 255)); + destination[2] = static_cast<uchar>(std::clamp(pixel.m_b, 0, 255)); + destination[3] = static_cast<uchar>(std::clamp(pixel.m_a, 0, 255)); +} + +std::array<Rgba, 4> makeBc1Palette(const uchar *block, bool allowTransparency) +{ + const quint16 packed0 = readU16(block); + const quint16 packed1 = readU16(block + 2); + const Rgba c0 = color565(packed0); + const Rgba c1 = color565(packed1); + std::array<Rgba, 4> palette{c0, c1, {}, {}}; + + if (!allowTransparency || packed0 > packed1) + { + palette[2] = {(2 * c0.m_r + c1.m_r) / 3, (2 * c0.m_g + c1.m_g) / 3, + (2 * c0.m_b + c1.m_b) / 3, 255}; + palette[3] = {(c0.m_r + 2 * c1.m_r) / 3, (c0.m_g + 2 * c1.m_g) / 3, + (c0.m_b + 2 * c1.m_b) / 3, 255}; + } + else + { + palette[2] = {(c0.m_r + c1.m_r) / 2, (c0.m_g + c1.m_g) / 2, (c0.m_b + c1.m_b) / 2, 255}; + palette[3] = {0, 0, 0, 0}; + } + return palette; +} + +void decodeBc1Block(const uchar *block, QImage &image, int blockX, int blockY) +{ + const auto palette = makeBc1Palette(block, true); + const quint32 indices = qFromLittleEndian<quint32>(block + 4); + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + const int index = (indices >> (2 * (4 * y + x))) & 3; + writePixel(image, blockX * 4 + x, blockY * 4 + y, palette[index]); + } + } +} + +std::array<int, 8> makeUnsignedBc4Palette(const uchar *block) +{ + const int e0 = block[0]; + const int e1 = block[1]; + std::array<int, 8> values{e0, e1, 0, 0, 0, 0, 0, 0}; + if (e0 > e1) + { + for (int i = 1; i <= 6; ++i) { + values[i + 1] = ((7 - i) * e0 + i * e1 + 3) / 7; + } + } + else + { + for (int i = 1; i <= 4; ++i) { + values[i + 1] = ((5 - i) * e0 + i * e1 + 2) / 5; + } + values[6] = 0; + values[7] = 255; + } + return values; +} + +std::array<int, 8> makeSignedBc4Palette(const uchar *block) +{ + auto signedEndpoint = [](uchar value) { + const int endpoint = static_cast<qint8>(value); + return endpoint == -128 ? -127 : endpoint; + }; + const int e0 = signedEndpoint(block[0]); + const int e1 = signedEndpoint(block[1]); + std::array<int, 8> values{e0, e1, 0, 0, 0, 0, 0, 0}; + if (e0 > e1) + { + for (int i = 1; i <= 6; ++i) { + values[i + 1] = ((7 - i) * e0 + i * e1) / 7; + } + } + else + { + for (int i = 1; i <= 4; ++i) { + values[i + 1] = ((5 - i) * e0 + i * e1) / 5; + } + values[6] = -127; + values[7] = 127; + } + return values; +} + +quint64 read48BitIndices(const uchar *block) +{ + quint64 indices = 0; + for (int i = 0; i < 6; ++i) { + indices |= static_cast<quint64>(block[2 + i]) << (8 * i); + } + return indices; +} + +void decodeBc3Block(const uchar *block, QImage &image, int blockX, int blockY) +{ + const auto alpha = makeUnsignedBc4Palette(block); + const quint64 alphaIndices = read48BitIndices(block); + const auto colors = makeBc1Palette(block + 8, false); + const quint32 colorIndices = qFromLittleEndian<quint32>(block + 12); + + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + const int pixel = 4 * y + x; + Rgba value = colors[(colorIndices >> (2 * pixel)) & 3]; + value.m_a = alpha[(alphaIndices >> (3 * pixel)) & 7]; + writePixel(image, blockX * 4 + x, blockY * 4 + y, value); + } + } +} + +void decodeBc2Block(const uchar *block, QImage &image, int blockX, int blockY) +{ + const auto colors = makeBc1Palette(block + 8, false); + const quint32 colorIndices = qFromLittleEndian<quint32>(block + 12); + const quint64 alphaValues = qFromLittleEndian<quint64>(block); + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + const int pixel = 4 * y + x; + Rgba value = colors[(colorIndices >> (2 * pixel)) & 3]; + value.m_a = static_cast<int>((alphaValues >> (4 * pixel)) & 15) * 17; + writePixel(image, blockX * 4 + x, blockY * 4 + y, value); + } + } +} + +void decodeBc5Block(const uchar *block, QImage &image, int blockX, int blockY, + bool signedValues, bool normalMap, bool flipNormalY) +{ + const quint64 redIndices = read48BitIndices(block); + const quint64 greenIndices = read48BitIndices(block + 8); + const auto signedRed = makeSignedBc4Palette(block); + const auto signedGreen = makeSignedBc4Palette(block + 8); + const auto unsignedRed = makeUnsignedBc4Palette(block); + const auto unsignedGreen = makeUnsignedBc4Palette(block + 8); + + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + const int pixel = 4 * y + x; + const int redIndex = (redIndices >> (3 * pixel)) & 7; + const int greenIndex = (greenIndices >> (3 * pixel)) & 7; + + if (normalMap) + { + float nx = signedValues ? signedRed[redIndex] / 127.0F + : unsignedRed[redIndex] / 127.5F - 1.0F; + float ny = signedValues ? signedGreen[greenIndex] / 127.0F + : unsignedGreen[greenIndex] / 127.5F - 1.0F; + nx = std::clamp(nx, -1.0F, 1.0F); + ny = std::clamp(ny, -1.0F, 1.0F); + if (flipNormalY) { + ny = -ny; + } + const float nz = std::sqrt(std::max(0.0F, 1.0F - nx * nx - ny * ny)); + writePixel(image, blockX * 4 + x, blockY * 4 + y, + {static_cast<int>((nx * 0.5F + 0.5F) * 255.0F + 0.5F), + static_cast<int>((ny * 0.5F + 0.5F) * 255.0F + 0.5F), + static_cast<int>((nz * 0.5F + 0.5F) * 255.0F + 0.5F), 255}); + } + else + { + const int red = + signedValues ? signedRed[redIndex] + 127 : unsignedRed[redIndex]; + const int green = signedValues ? signedGreen[greenIndex] + 127 + : unsignedGreen[greenIndex]; + writePixel(image, blockX * 4 + x, blockY * 4 + y, {red, green, 0, 255}); + } + } + } +} + +bool decodeBc7ImageBlock(const uchar *block, QImage &image, int blockX, + int blockY) +{ + Bc7Rgba pixels[16]; + if (!decodeBc7Block(block, pixels)) { + return false; + } + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + const Bc7Rgba &pixel = pixels[y * 4 + x]; + writePixel(image, blockX * 4 + x, blockY * 4 + y, + {pixel.m_r, pixel.m_g, pixel.m_b, pixel.m_a}); + } + } + return true; +} + +} // namespace + +bool decodeDds(const QString &fileName, bool normalMap, bool flipNormalY, + DdsDecodeResult *result, QString *error) +{ + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly)) + { + *error = + QStringLiteral("Cannot open %1: %2").arg(fileName, file.errorString()); + return false; + } + constexpr qint64 MaximumDdsBytes = 1024LL * 1024 * 1024; + if (file.size() > MaximumDdsBytes) + { + *error = QStringLiteral("DDS file exceeds the 1 GiB safety limit: %1") + .arg(fileName); + return false; + } + const QByteArray data = file.readAll(); + if (data.size() < 128 || data.left(4) != QByteArrayLiteral("DDS ") || + readU32(data, 4) != 124 || readU32(data, 76) != 32) { + *error = QStringLiteral("%1 is not a supported DDS file").arg(fileName); + return false; + } + + const int height = static_cast<int>(readU32(data, 12)); + const int width = static_cast<int>(readU32(data, 16)); + const int mipLevels = std::max(1, static_cast<int>(readU32(data, 28))); + const quint32 pixelFormatFlags = readU32(data, 80); + const quint32 caps2 = readU32(data, 112); + if ((caps2 & (0x200U | 0x200000U)) != 0) + { + *error = + QStringLiteral("DDS cubemaps and volume textures are not supported: %1") + .arg(fileName); + return false; + } + const QByteArray fourCc = data.mid(84, 4); + int blockSize = 0; + qsizetype sourceOffset = 128; + enum class Format { + Bc1, + Bc2, + Bc3, + Bc5Unsigned, + Bc5Signed, + Bc7, + Rgba32 + } format; + + if (fourCc == "DXT1") + { + format = Format::Bc1; + blockSize = 8; + } + else if (fourCc == "DXT3") + { + format = Format::Bc2; + blockSize = 16; + } + else if (fourCc == "DXT5") + { + format = Format::Bc3; + blockSize = 16; + } + else if (fourCc == "ATI2" || fourCc == "BC5U") + { + format = Format::Bc5Unsigned; + blockSize = 16; + } + else if (fourCc == "BC5S") + { + format = Format::Bc5Signed; + blockSize = 16; + } + else if (fourCc == "DX10") + { + if (data.size() < 148) + { + *error = QStringLiteral("Truncated DDS DX10 header in %1").arg(fileName); + return false; + } + const quint32 dxgiFormat = readU32(data, 128); + const quint32 resourceDimension = readU32(data, 132); + const quint32 miscFlag = readU32(data, 136); + const quint32 arraySize = readU32(data, 140); + if (resourceDimension != 3 || arraySize != 1 || (miscFlag & 0x4U) != 0) + { + *error = QStringLiteral("Only a single 2D DDS texture is supported in %1") + .arg(fileName); + return false; + } + sourceOffset = 148; + switch (dxgiFormat) + { + case 71: // DXGI_FORMAT_BC1_UNORM + case 72: // DXGI_FORMAT_BC1_UNORM_SRGB + format = Format::Bc1; + blockSize = 8; + break; + case 74: // DXGI_FORMAT_BC2_UNORM + case 75: // DXGI_FORMAT_BC2_UNORM_SRGB + format = Format::Bc2; + blockSize = 16; + break; + case 77: // DXGI_FORMAT_BC3_UNORM + case 78: // DXGI_FORMAT_BC3_UNORM_SRGB + format = Format::Bc3; + blockSize = 16; + break; + case 83: // DXGI_FORMAT_BC5_UNORM + format = Format::Bc5Unsigned; + blockSize = 16; + break; + case 84: // DXGI_FORMAT_BC5_SNORM + format = Format::Bc5Signed; + blockSize = 16; + break; + case 98: // DXGI_FORMAT_BC7_UNORM + case 99: // DXGI_FORMAT_BC7_UNORM_SRGB + format = Format::Bc7; + blockSize = 16; + break; + default: + *error = QStringLiteral("Unsupported DDS DXGI format %1 in %2") + .arg(dxgiFormat) + .arg(fileName); + return false; + } + } + else if ((pixelFormatFlags & 0x40U) != 0 && readU32(data, 88) == 32) + { + format = Format::Rgba32; + blockSize = 0; + } + else + { + *error = QStringLiteral("Unsupported DDS FourCC '%1' in %2") + .arg(QString::fromLatin1(fourCc), fileName); + return false; + } + + if (width <= 0 || height <= 0 || width > 32768 || height > 32768 || + mipLevels > 16) { + *error = QStringLiteral("Invalid DDS dimensions %1x%2 in %3") + .arg(width) + .arg(height) + .arg(fileName); + return false; + } + result->m_levels.clear(); + result->m_levels.reserve(mipLevels); + const quint32 redMask = readU32(data, 92); + const quint32 greenMask = readU32(data, 96); + const quint32 blueMask = readU32(data, 100); + const quint32 alphaMask = readU32(data, 104); + auto unpackMasked = [](quint32 value, quint32 mask, int defaultValue) { + if (mask == 0) { + return defaultValue; + } + int shift = 0; + while (((mask >> shift) & 1U) == 0) { + ++shift; + } + const quint32 maximum = mask >> shift; + return static_cast<int>(((value & mask) >> shift) * 255U / maximum); + }; + for (int level = 0; level < mipLevels; ++level) + { + const int levelWidth = std::max(1, width >> level); + const int levelHeight = std::max(1, height >> level); + const int blocksWide = (levelWidth + 3) / 4; + const int blocksHigh = (levelHeight + 3) / 4; + const qsizetype levelBytes = + format == Format::Rgba32 + ? static_cast<qsizetype>(levelWidth) * levelHeight * 4 + : static_cast<qsizetype>(blocksWide) * blocksHigh * blockSize; + if (sourceOffset > data.size() || levelBytes > data.size() - sourceOffset) + { + *error = QStringLiteral("DDS mip %1 (%2x%3) is truncated in %4") + .arg(level) + .arg(levelWidth) + .arg(levelHeight) + .arg(fileName); + return false; + } + + QImage image(levelWidth, levelHeight, QImage::Format_RGBA8888); + if (image.isNull()) + { + *error = QStringLiteral("Cannot allocate DDS mip %1 (%2x%3)") + .arg(level) + .arg(levelWidth) + .arg(levelHeight); + return false; + } + + const uchar *source = + reinterpret_cast<const uchar *>(data.constData() + sourceOffset); + if (format == Format::Rgba32) + { + for (int y = 0; y < levelHeight; ++y) + { + for (int x = 0; x < levelWidth; ++x) + { + const quint32 packed = qFromLittleEndian<quint32>( + source + (static_cast<qsizetype>(y) * levelWidth + x) * 4); + writePixel(image, x, y, + {unpackMasked(packed, redMask, 0), + unpackMasked(packed, greenMask, 0), + unpackMasked(packed, blueMask, 0), + unpackMasked(packed, alphaMask, 255)}); + } + } + } + else + { + for (int by = 0; by < blocksHigh; ++by) + { + for (int bx = 0; bx < blocksWide; ++bx) { + const uchar *block = source + (by * blocksWide + bx) * blockSize; + switch (format) + { + case Format::Bc1: + decodeBc1Block(block, image, bx, by); + break; + case Format::Bc2: + decodeBc2Block(block, image, bx, by); + break; + case Format::Bc3: + decodeBc3Block(block, image, bx, by); + break; + case Format::Bc5Unsigned: + decodeBc5Block(block, image, bx, by, false, normalMap, flipNormalY); + break; + case Format::Bc5Signed: + decodeBc5Block(block, image, bx, by, true, normalMap, flipNormalY); + break; + case Format::Bc7: + if (!decodeBc7ImageBlock(block, image, bx, by)) + { + *error = QStringLiteral( + "Invalid BC7 block in DDS mip %1 at (%2,%3) in %4") + .arg(level) + .arg(bx) + .arg(by) + .arg(fileName); + return false; + } + break; + case Format::Rgba32: + break; + } + } + } + } + if (normalMap && flipNormalY && format != Format::Bc5Unsigned && + format != Format::Bc5Signed) { + for (int y = 0; y < image.height(); ++y) { + uchar *row = image.scanLine(y); + for (int x = 0; x < image.width(); ++x) { + row[x * 4 + 1] = static_cast<uchar>(255 - row[x * 4 + 1]); + } + } + } + result->m_levels.append(std::move(image)); + sourceOffset += levelBytes; + } + + result->m_format = + fourCc == "DX10" + ? QStringLiteral("DX10/%1").arg(readU32(data, 128)) + : (format == Format::Rgba32 ? QStringLiteral("RGBA32") + : QString::fromLatin1(fourCc)); + return true; +} diff --git a/plugins/feature/map/msfsassetconverter/ddsdecoder.h b/plugins/feature/map/msfsassetconverter/ddsdecoder.h new file mode 100644 index 000000000..5c7063821 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/ddsdecoder.h @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QImage> +#include <QString> +#include <QVector> + +struct DdsDecodeResult { + QVector<QImage> m_levels; + QString m_format; +}; + +// Decodes every mip of the DDS variants used by the sample MSFS aircraft. +// When normalMap is true, signed BC5 XY values are converted to an RGB tangent +// space normal. flipNormalY changes the DirectX convention to glTF/OpenGL. +bool decodeDds(const QString &fileName, bool normalMap, bool flipNormalY, + DdsDecodeResult *result, QString *error); diff --git a/plugins/feature/map/msfsassetconverter/fsltlresolver.cpp b/plugins/feature/map/msfsassetconverter/fsltlresolver.cpp new file mode 100644 index 000000000..38cc4a176 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/fsltlresolver.cpp @@ -0,0 +1,418 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "fsltlresolver.h" + +#include <QDir> +#include <QFile> +#include <QFileInfo> +#include <QHash> +#include <QMap> +#include <QSet> +#include <QTextStream> +#include <QVector> +#include <QXmlStreamReader> + +#include <algorithm> + +namespace { + +using IniValues = QHash<QString, QString>; + +QString removeIniComment(const QString &line) +{ + bool inQuotes = false; + for (qsizetype i = 0; i < line.size(); ++i) + { + if (line.at(i) == '"') { + inQuotes = !inQuotes; + } else if (line.at(i) == ';' && !inQuotes) { + return line.left(i); + } + } + return line; +} + +QString cleanIniValue(QString value) +{ + value = value.trimmed(); + if (value.size() >= 2 && value.front() == '"' && value.back() == '"') { + value = value.mid(1, value.size() - 2); + } + return value.trimmed(); +} + +bool readIni(const QString &fileName, IniValues *values, QString *error) +{ + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + *error = + QStringLiteral("Cannot open %1: %2").arg(fileName, file.errorString()); + return false; + } + + QString section; + QTextStream stream(&file); + while (!stream.atEnd()) + { + const QString line = removeIniComment(stream.readLine()).trimmed(); + if (line.isEmpty()) { + continue; + } + if (line.startsWith('[') && line.endsWith(']')) + { + section = line.mid(1, line.size() - 2).trimmed().toLower(); + continue; + } + const qsizetype equals = line.indexOf('='); + if (equals <= 0) { + continue; + } + const QString key = line.left(equals).trimmed().toLower(); + values->insert(section + '/' + key, cleanIniValue(line.mid(equals + 1))); + } + return true; +} + +QString resolveRelative(const QDir &base, QString relative) +{ + relative.replace('\\', '/'); + return QDir::cleanPath(base.absoluteFilePath(relative)); +} + +QString canonicalDirectory(const QString &path) +{ + const QFileInfo info(path); + const QString canonical = info.canonicalFilePath(); + return canonical.isEmpty() ? info.absoluteFilePath() : canonical; +} + +bool buildAircraftHierarchy(const QString &aircraftCfg, QStringList *hierarchy, + QString *error) +{ + QString currentDirectory = QFileInfo(aircraftCfg).absolutePath(); + QSet<QString> visited; + for (int depth = 0; depth < 32; ++depth) + { + currentDirectory = canonicalDirectory(currentDirectory); + const QString key = currentDirectory.toLower(); + if (visited.contains(key)) + { + *error = QStringLiteral("Cycle in base_container hierarchy at %1") + .arg(currentDirectory); + return false; + } + visited.insert(key); + hierarchy->append(currentDirectory); + + const QString cfg = QDir(currentDirectory).filePath("aircraft.cfg"); + IniValues values; + if (!readIni(cfg, &values, error)) { + return false; + } + const QString baseContainer = values.value("variation/base_container"); + if (baseContainer.isEmpty()) { + return true; + } + currentDirectory = resolveRelative(QDir(currentDirectory), baseContainer); + if (!QFileInfo(currentDirectory).isDir()) + { + *error = QStringLiteral("base_container does not exist: %1") + .arg(currentDirectory); + return false; + } + } + *error = QStringLiteral("base_container hierarchy is too deep"); + return false; +} + +QString findVariantDirectory(const QStringList &hierarchy, + const QString &prefix, const QString &variant) +{ + const QString folderName = + variant.isEmpty() ? prefix : prefix + '.' + variant; + for (const QString &aircraftDirectory : hierarchy) { + const QString candidate = QDir(aircraftDirectory).filePath(folderName); + if (QFileInfo(candidate).isDir()) { + return canonicalDirectory(candidate); + } + } + return {}; +} + +bool selectLod(const QString &xmlFile, int lodIndex, QString *gltfFile, + QString *error) +{ + QFile file(xmlFile); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + *error = + QStringLiteral("Cannot open %1: %2").arg(xmlFile, file.errorString()); + return false; + } + QXmlStreamReader xml(&file); + QVector<QPair<double, QString>> models; + while (!xml.atEnd()) + { + xml.readNext(); + if (!xml.isStartElement() || + xml.name().compare(QStringLiteral("LOD"), Qt::CaseInsensitive) != 0) { + continue; + } + const auto attributes = xml.attributes(); + QString modelFile; + double minSize = 0.0; + for (const QXmlStreamAttribute &attribute : attributes) + { + if (attribute.name().compare(QStringLiteral("ModelFile"), + Qt::CaseInsensitive) == 0) { + modelFile = attribute.value().toString(); + } else if (attribute.name().compare(QStringLiteral("minSize"), + Qt::CaseInsensitive) == 0) { + bool ok = false; + const double parsed = attribute.value().toDouble(&ok); + if (ok) { + minSize = parsed; + } + } + } + if (!modelFile.isEmpty()) { + models.append({minSize, modelFile}); + } + } + if (xml.hasError()) + { + *error = QStringLiteral("Invalid model XML %1: %2") + .arg(xmlFile, xml.errorString()); + return false; + } + std::sort(models.begin(), models.end(), + [](const auto &left, const auto &right) { + return left.first > right.first; + }); + if (models.isEmpty()) + { + *error = QStringLiteral("No LOD ModelFile found in %1").arg(xmlFile); + return false; + } + if (lodIndex < 0 || lodIndex >= models.size()) + { + *error = QStringLiteral( + "LOD index %1 is out of range; %2 LODs are available in %3") + .arg(lodIndex) + .arg(models.size()) + .arg(xmlFile); + return false; + } + *gltfFile = + resolveRelative(QFileInfo(xmlFile).dir(), models.at(lodIndex).second); + if (!QFileInfo(*gltfFile).isFile()) + { + *error = QStringLiteral("LOD glTF does not exist: %1").arg(*gltfFile); + return false; + } + return true; +} + +bool resolveModel(const QStringList &hierarchy, const QString &variant, + int lodIndex, QString *gltfFile, QString *modelXml, QString *error) +{ + const QString modelDirectory = + findVariantDirectory(hierarchy, QStringLiteral("model"), variant); + if (modelDirectory.isEmpty()) + { + *error = QStringLiteral("Cannot find model.%1 in the aircraft hierarchy") + .arg(variant); + return false; + } + IniValues modelValues; + const QString modelCfg = QDir(modelDirectory).filePath("model.cfg"); + if (!readIni(modelCfg, &modelValues, error)) { + return false; + } + const QString normalModel = modelValues.value("models/normal"); + if (normalModel.isEmpty()) + { + *error = QStringLiteral("No [models] normal entry in %1").arg(modelCfg); + return false; + } + const QString modelDefinition = + resolveRelative(QDir(modelDirectory), normalModel); + if (modelDefinition.endsWith(".gltf", Qt::CaseInsensitive)) + { + *gltfFile = modelDefinition; + if (!QFileInfo(*gltfFile).isFile()) + { + *error = QStringLiteral("Model glTF does not exist: %1").arg(*gltfFile); + return false; + } + return true; + } + *modelXml = modelDefinition; + return selectLod(modelDefinition, lodIndex, gltfFile, error); +} + +bool appendTextureFallbacks(const QString &directory, QStringList *result, + QSet<QString> *visited, QStringList *warnings, + QString *error) +{ + const QString resolved = canonicalDirectory(directory); + const QString key = resolved.toLower(); + if (visited->contains(key)) { + return true; + } + visited->insert(key); + if (!QFileInfo(resolved).isDir()) + { + warnings->append( + QStringLiteral("Skipping missing texture fallback directory: %1") + .arg(resolved)); + return true; + } + result->append(resolved); + + const QString textureCfg = QDir(resolved).filePath("texture.cfg"); + if (!QFileInfo(textureCfg).isFile()) { + return true; + } + IniValues values; + if (!readIni(textureCfg, &values, error)) { + return false; + } + for (int index = 1; index <= 64; ++index) { + const QString fallback = + values.value(QStringLiteral("fltsim/fallback.%1").arg(index)); + if (fallback.isEmpty()) { + continue; + } + if (!appendTextureFallbacks(resolveRelative(QDir(resolved), fallback), + result, visited, warnings, error)) { + return false; + } + } + return true; +} + +} // namespace + +bool findFsltlAircraftVariants(const QString &aircraftCfg, + QVector<int> *flightSimIndices, + QString *error) +{ + flightSimIndices->clear(); + + IniValues aircraftValues; + if (!readIni(aircraftCfg, &aircraftValues, error)) { + return false; + } + + QMap<int, QPair<QString, QString>> variants; + for (auto it = aircraftValues.constBegin(); it != aircraftValues.constEnd(); + ++it) { + const QString &key = it.key(); + if (!key.startsWith(QStringLiteral("fltsim."))) { + continue; + } + const qsizetype slash = key.indexOf('/'); + if (slash < 8) { + continue; + } + bool validIndex = false; + const int index = key.mid(7, slash - 7).toInt(&validIndex); + if (!validIndex) { + continue; + } + const QString field = key.mid(slash + 1); + if (field == QStringLiteral("model")) { + variants[index].first = it.value(); + } else if (field == QStringLiteral("texture")) { + variants[index].second = it.value(); + } + } + + QSet<QString> seen; + for (auto it = variants.constBegin(); it != variants.constEnd(); ++it) { + const QString identity = it.value().first.toCaseFolded() + QChar(0) + + it.value().second.toCaseFolded(); + if (!seen.contains(identity)) + { + seen.insert(identity); + flightSimIndices->append(it.key()); + } + } + if (flightSimIndices->isEmpty()) + { + *error = QStringLiteral("No FLTSIM model/texture entries in %1") + .arg(aircraftCfg); + return false; + } + return true; +} + +bool resolveFsltlAircraft(const QString &aircraftCfg, int flightSimIndex, + int lodIndex, ResolvedFsltlAircraft *result, + QString *error) +{ + *result = {}; + const QFileInfo cfgInfo(aircraftCfg); + if (!cfgInfo.isFile()) + { + *error = QStringLiteral("aircraft.cfg does not exist: %1").arg(aircraftCfg); + return false; + } + IniValues aircraftValues; + if (!readIni(cfgInfo.absoluteFilePath(), &aircraftValues, error)) { + return false; + } + if (!buildAircraftHierarchy(cfgInfo.absoluteFilePath(), + &result->m_aircraftHierarchy, error)) { + return false; + } + + const QString section = QStringLiteral("fltsim.%1/").arg(flightSimIndex); + const QString modelVariant = aircraftValues.value(section + "model"); + const QString textureVariant = aircraftValues.value(section + "texture"); + if (!aircraftValues.contains(section + "model") && + !aircraftValues.contains(section + "texture")) { + *error = QStringLiteral("No [FLTSIM.%1] model/texture entries in %2") + .arg(flightSimIndex) + .arg(aircraftCfg); + return false; + } + if (!resolveModel(result->m_aircraftHierarchy, modelVariant, lodIndex, + &result->m_gltfFile, &result->m_modelXml, error)) { + return false; + } + + const QString textureDirectory = findVariantDirectory( + result->m_aircraftHierarchy, QStringLiteral("texture"), textureVariant); + if (textureDirectory.isEmpty()) + { + *error = QStringLiteral("Cannot find texture.%1 in the aircraft hierarchy") + .arg(textureVariant); + return false; + } + QSet<QString> visitedTextures; + if (!appendTextureFallbacks(textureDirectory, &result->m_textureDirectories, + &visitedTextures, &result->m_warnings, error)) { + return false; + } + result->m_outputBaseName = cfgInfo.dir().dirName(); + return true; +} diff --git a/plugins/feature/map/msfsassetconverter/fsltlresolver.h b/plugins/feature/map/msfsassetconverter/fsltlresolver.h new file mode 100644 index 000000000..e4efc3684 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/fsltlresolver.h @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QString> +#include <QStringList> +#include <QVector> + +struct ResolvedFsltlAircraft { + QString m_gltfFile; + QString m_modelXml; // Model definition the glTF was chosen from, if there is one + QString m_outputBaseName; + QStringList m_aircraftHierarchy; + QStringList m_textureDirectories; + QStringList m_warnings; +}; + +// Returns one representative FLTSIM index for every distinct model/texture +// combination in the aircraft configuration. +bool findFsltlAircraftVariants(const QString &aircraftCfg, + QVector<int> *flightSimIndices, + QString *error); + +bool resolveFsltlAircraft(const QString &aircraftCfg, int flightSimIndex, + int lodIndex, ResolvedFsltlAircraft *result, + QString *error); diff --git a/plugins/feature/map/msfsassetconverter/ktx2writer.cpp b/plugins/feature/map/msfsassetconverter/ktx2writer.cpp new file mode 100644 index 000000000..4f69244e3 --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/ktx2writer.cpp @@ -0,0 +1,896 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "ktx2writer.h" + +#include <QByteArray> +#include <QSaveFile> +#include <QtEndian> + +#ifdef MSFS_CONVERTER_WITH_ZSTD +#include <zstd.h> +#endif + +#include <algorithm> +#include <array> +#include <cmath> +#include <cstdint> +#include <limits> + +namespace { + +constexpr quint32 HeaderByteLength = 68; +constexpr quint32 LevelIndexEntryByteLength = 24; +constexpr quint32 DfdByteLength = 44; +constexpr quint32 UastcBlockByteLength = 16; +constexpr std::array<quint32, 4> UastcWeights{0, 21, 43, 64}; +constexpr int Etc1Modifiers[8][4] = { + {-8, -2, 2, 8}, {-17, -5, 5, 17}, {-29, -9, 9, 29}, {-42, -13, 13, 42}, {-60, -18, 18, 60}, {-80, -24, 24, 80}, {-106, -33, 33, 106}, {-183, -47, 47, 183}}; +constexpr int EacModifiers[16][8] = { + {-3, -6, -9, -15, 2, 5, 8, 14}, {-3, -7, -10, -13, 2, 6, 9, 12}, {-2, -5, -8, -13, 1, 4, 7, 12}, {-2, -4, -6, -13, 1, 3, 5, 12}, {-3, -6, -8, -12, 2, 5, 7, 11}, {-3, -7, -9, -11, 2, 6, 8, 10}, {-4, -7, -8, -11, 3, 6, 7, 10}, {-3, -5, -8, -11, 2, 4, 7, 10}, {-2, -6, -8, -10, 1, 5, 7, 9}, {-2, -5, -8, -10, 1, 4, 7, 9}, {-2, -4, -8, -10, 1, 3, 7, 9}, {-2, -5, -7, -10, 1, 4, 6, 9}, {-3, -4, -7, -10, 2, 3, 6, 9}, {-1, -2, -3, -10, 0, 1, 2, 9}, {-4, -6, -8, -9, 3, 5, 7, 8}, {-3, -5, -7, -9, 2, 4, 6, 8}}; + +using Rgba = std::array<quint8, 4>; +using PixelBlock = std::array<Rgba, 16>; + +struct Etc1SolidHints { + quint8 m_differential = 0; + quint8 m_intensity = 0; + quint8 m_selector = 0; + Rgba m_base{}; +}; + +struct Etc1BlockHints { + quint8 m_flip = 0; + quint8 m_differential = 0; + quint8 m_intensity0 = 0; + quint8 m_intensity1 = 0; + quint8 m_bias = 13; +}; + +struct Etc1ChannelChoice { + quint8 m_base = 0; + quint16 m_squaredError = 0; +}; + +struct Etc1InverseTables { + Etc1ChannelChoice m_choices[2][8][4][256]{}; + + Etc1InverseTables() + { + for (int differential = 0; differential < 2; ++differential) { + const int limit = differential ? 32 : 16; + for (int intensity = 0; intensity < 8; ++intensity) + { + for (int selector = 0; selector < 4; ++selector) + { + for (int color = 0; color < 256; ++color) { + int bestError = std::numeric_limits<int>::max(); + for (int base = 0; base < limit; ++base) + { + const int expanded = differential ? ((base << 3) | (base >> 2)) + : ((base << 4) | base); + const int decoded = std::clamp( + expanded + Etc1Modifiers[intensity][selector], 0, 255); + const int delta = decoded - color; + const int error = delta * delta; + if (error < bestError) + { + bestError = error; + m_choices[differential][intensity][selector][color] = { + static_cast<quint8>(base), static_cast<quint16>(error)}; + } + } + } + } + } + } + } +}; + +const Etc1InverseTables &etc1InverseTables() +{ + static const Etc1InverseTables tables; + return tables; +} + +void appendU8(QByteArray *output, quint8 value) +{ + output->append(static_cast<char>(value)); +} + +void appendU16(QByteArray *output, quint16 value) +{ + const quint16 littleEndian = qToLittleEndian(value); + output->append(reinterpret_cast<const char *>(&littleEndian), + sizeof(littleEndian)); +} + +void appendU32(QByteArray *output, quint32 value) +{ + const quint32 littleEndian = qToLittleEndian(value); + output->append(reinterpret_cast<const char *>(&littleEndian), + sizeof(littleEndian)); +} + +void appendU64(QByteArray *output, quint64 value) +{ + const quint64 littleEndian = qToLittleEndian(value); + output->append(reinterpret_cast<const char *>(&littleEndian), + sizeof(littleEndian)); +} + +void appendKeyValue(QByteArray *output, const QByteArray &key, + const QByteArray &value) +{ + const quint32 payloadLength = + static_cast<quint32>(key.size() + 1 + value.size() + 1); + appendU32(output, payloadLength); + output->append(key); + output->append('\0'); + output->append(value); + output->append('\0'); + while (output->size() % 4 != 0) { + output->append('\0'); + } +} + +QByteArray createDfd(bool srgb, bool hasAlpha) +{ + QByteArray dfd; + dfd.reserve(DfdByteLength); + appendU32(&dfd, DfdByteLength); + appendU16(&dfd, 0); // KHR_DF_VENDORID_KHRONOS + appendU16(&dfd, 0); // KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT + appendU16(&dfd, 2); // KHR_DF_VERSIONNUMBER_1_3 + appendU16(&dfd, 40); // Descriptor block size + appendU8(&dfd, 166); // KHR_DF_MODEL_UASTC + appendU8(&dfd, srgb ? 1 : 0); // BT709 for sRGB, unspecified for linear + appendU8(&dfd, srgb ? 2 : 1); // sRGB or linear transfer + appendU8(&dfd, 0); // Straight alpha + appendU8(&dfd, 3); // Four texels in X, stored as dimension minus one + appendU8(&dfd, 3); // Four texels in Y + appendU8(&dfd, 0); + appendU8(&dfd, 0); + appendU8(&dfd, UastcBlockByteLength); + for (int plane = 1; plane < 8; ++plane) { + appendU8(&dfd, 0); + } + + appendU16(&dfd, 0); + appendU8(&dfd, 127); // One sample covers the complete 128-bit block + appendU8(&dfd, hasAlpha ? 3 : 4); // UASTC RGBA or RGB + for (int position = 0; position < 4; ++position) { + appendU8(&dfd, 0); + } + appendU32(&dfd, 0); + appendU32(&dfd, 0xFFFFFFFFU); + return dfd; +} + +void writeBits(quint8 *block, int *bitOffset, quint32 value, int bitCount) +{ + for (int bit = 0; bit < bitCount; ++bit) + { + if ((value & (quint32(1) << bit)) != 0) { + block[*bitOffset / 8] |= quint8(1U << (*bitOffset % 8)); + } + ++*bitOffset; + } +} + +quint8 interpolate(quint8 low, quint8 high, quint32 weight) +{ + return static_cast<quint8>((low * (64U - weight) + high * weight + 32U) >> + 6U); +} + +quint8 clampByte(int value) +{ + return static_cast<quint8>(std::clamp(value, 0, 255)); +} + +quint64 rgbError(const Rgba &left, const Rgba &right) +{ + quint64 error = 0; + for (int channel = 0; channel < 3; ++channel) + { + const qint64 delta = qint64(left[channel]) - right[channel]; + error += static_cast<quint64>(delta * delta); + } + return error; +} + +quint64 pixelError(const Rgba &left, const Rgba &right, + UastcTextureSemantic semantic) +{ + if (semantic == UastcTextureSemantic::Normal) + { + auto normal = [](const Rgba &pixel) { + std::array<double, 3> value{pixel[0] / 127.5 - 1.0, + pixel[1] / 127.5 - 1.0, + pixel[2] / 127.5 - 1.0}; + const double length = std::sqrt( + value[0] * value[0] + value[1] * value[1] + value[2] * value[2]); + if (length > 1.0e-8) + { + for (double &component : value) { + component /= length; + } + } + return value; + }; + const auto leftNormal = normal(left); + const auto rightNormal = normal(right); + const double dot = std::clamp(leftNormal[0] * rightNormal[0] + + leftNormal[1] * rightNormal[1] + + leftNormal[2] * rightNormal[2], + -1.0, 1.0); + const qint64 alphaDelta = qint64(left[3]) - right[3]; + return static_cast<quint64>(std::lround((1.0 - dot) * 260100.0)) + + static_cast<quint64>(alphaDelta * alphaDelta); + } + + constexpr std::array<quint64, 4> ColorWeights{3, 6, 1, 4}; + quint64 error = 0; + for (int channel = 0; channel < 4; ++channel) + { + const qint64 delta = qint64(left[channel]) - right[channel]; + const quint64 weight = + semantic == UastcTextureSemantic::Color ? ColorWeights[channel] : 1; + error += static_cast<quint64>(delta * delta) * weight; + } + return error; +} + +quint64 chooseSelectors(const PixelBlock &pixels, const Rgba &low, + const Rgba &high, std::array<quint8, 16> *selectors, + UastcTextureSemantic semantic) +{ + std::array<Rgba, 4> palette{}; + for (std::size_t selector = 0; selector < palette.size(); ++selector) + { + for (int channel = 0; channel < 4; ++channel) { + palette[selector][channel] = + interpolate(low[channel], high[channel], UastcWeights[selector]); + } + } + + quint64 totalError = 0; + for (std::size_t pixel = 0; pixel < pixels.size(); ++pixel) + { + quint64 bestError = std::numeric_limits<quint64>::max(); + quint8 bestSelector = 0; + for (std::size_t selector = 0; selector < palette.size(); ++selector) { + const quint64 error = + pixelError(pixels[pixel], palette[selector], semantic); + if (error < bestError) + { + bestError = error; + bestSelector = static_cast<quint8>(selector); + } + } + (*selectors)[pixel] = bestSelector; + totalError += bestError; + } + return totalError; +} + +void optimizeEndpoints(const PixelBlock &pixels, + const std::array<quint8, 16> &selectors, Rgba *low, + Rgba *high) +{ + double lowLow = 0.0; + double lowHigh = 0.0; + double highHigh = 0.0; + for (const quint8 selector : selectors) + { + const double highWeight = UastcWeights[selector] / 64.0; + const double lowWeight = 1.0 - highWeight; + lowLow += lowWeight * lowWeight; + lowHigh += lowWeight * highWeight; + highHigh += highWeight * highWeight; + } + const double determinant = lowLow * highHigh - lowHigh * lowHigh; + if (std::abs(determinant) < 1.0e-8) { + return; + } + + for (int channel = 0; channel < 4; ++channel) + { + double lowTarget = 0.0; + double highTarget = 0.0; + for (std::size_t pixel = 0; pixel < pixels.size(); ++pixel) + { + const double highWeight = UastcWeights[selectors[pixel]] / 64.0; + const double lowWeight = 1.0 - highWeight; + lowTarget += lowWeight * pixels[pixel][channel]; + highTarget += highWeight * pixels[pixel][channel]; + } + const double optimizedLow = + (lowTarget * highHigh - highTarget * lowHigh) / determinant; + const double optimizedHigh = + (highTarget * lowLow - lowTarget * lowHigh) / determinant; + (*low)[channel] = + static_cast<quint8>(std::clamp(std::lround(optimizedLow), 0L, 255L)); + (*high)[channel] = + static_cast<quint8>(std::clamp(std::lround(optimizedHigh), 0L, 255L)); + } +} + +Etc1SolidHints makeEtc1SolidHints(const Rgba &color) +{ + const Etc1InverseTables &tables = etc1InverseTables(); + Etc1SolidHints best; + quint64 bestError = std::numeric_limits<quint64>::max(); + for (quint8 differential = 0; differential < 2; ++differential) + { + for (quint8 intensity = 0; intensity < 8; ++intensity) + { + for (quint8 selector = 0; selector < 4; ++selector) + { + Rgba bases{}; + quint64 error = 0; + for (int channel = 0; channel < 3; ++channel) + { + const Etc1ChannelChoice &choice = + tables.m_choices[differential][intensity][selector][color[channel]]; + bases[channel] = choice.m_base; + error += choice.m_squaredError; + } + if (error < bestError) + { + bestError = error; + best.m_differential = differential; + best.m_intensity = intensity; + best.m_selector = selector; + best.m_base = bases; + } + } + } + } + return best; +} + +Etc1BlockHints makeEtc1BlockHints(const PixelBlock &pixels) +{ + Etc1BlockHints best; + quint64 bestError = std::numeric_limits<quint64>::max(); + for (quint8 flip = 0; flip < 2; ++flip) + { + quint64 totalError = 0; + std::array<quint8, 2> intensities{}; + for (int subset = 0; subset < 2; ++subset) + { + std::array<int, 3> sums{}; + std::array<int, 8> indices{}; + int count = 0; + for (int y = 0; y < 4; ++y) + { + for (int x = 0; x < 4; ++x) + { + const int pixelSubset = flip ? y / 2 : x / 2; + if (pixelSubset != subset) { + continue; + } + const int index = y * 4 + x; + indices[count++] = index; + for (int channel = 0; channel < 3; ++channel) { + sums[channel] += pixels[index][channel]; + } + } + } + + Rgba base{}; + for (int channel = 0; channel < 3; ++channel) + { + const int packed = (sums[channel] * 15 + 1020) / (8 * 255); + base[channel] = static_cast<quint8>((packed << 4) | packed); + } + + quint64 bestSubsetError = std::numeric_limits<quint64>::max(); + quint8 bestIntensity = 0; + for (quint8 intensity = 0; intensity < 8; ++intensity) { + quint64 error = 0; + for (int i = 0; i < count; ++i) + { + quint64 bestPixelError = std::numeric_limits<quint64>::max(); + for (int selector = 0; selector < 4; ++selector) + { + Rgba decoded{}; + for (int channel = 0; channel < 3; ++channel) { + decoded[channel] = + clampByte(base[channel] + Etc1Modifiers[intensity][selector]); + } + bestPixelError = + std::min(bestPixelError, rgbError(pixels[indices[i]], decoded)); + } + error += bestPixelError; + } + if (error < bestSubsetError) + { + bestSubsetError = error; + bestIntensity = intensity; + } + } + intensities[subset] = bestIntensity; + totalError += bestSubsetError; + } + if (totalError < bestError) + { + bestError = totalError; + best.m_flip = flip; + best.m_intensity0 = intensities[0]; + best.m_intensity1 = intensities[1]; + } + } + return best; +} + +quint8 makeEacAlphaHints(const PixelBlock &pixels) +{ + int minimum = 255; + int maximum = 0; + for (const Rgba &pixel : pixels) + { + minimum = std::min(minimum, static_cast<int>(pixel[3])); + maximum = std::max(maximum, static_cast<int>(pixel[3])); + } + if (minimum == maximum) { + return 0x1D; // Multiplier 1 and the reference solid-alpha table 13. + } + + quint64 bestError = std::numeric_limits<quint64>::max(); + quint8 bestTable = 0; + quint8 bestMultiplier = 1; + for (quint8 table = 0; table < 16; ++table) + { + const int modifierRange = EacModifiers[table][7] - EacModifiers[table][3]; + const int estimatedMultiplier = static_cast<int>( + std::lround(double(maximum - minimum) / modifierRange)); + for (int candidate = estimatedMultiplier - 1; + candidate <= estimatedMultiplier + 1; ++candidate) { + const int multiplier = std::clamp(candidate, 1, 15); + const double blend = double(-EacModifiers[table][3]) / modifierRange; + const int base = std::clamp( + static_cast<int>(std::lround(minimum + (maximum - minimum) * blend)), + 0, 255); + quint64 error = 0; + for (const Rgba &pixel : pixels) + { + int bestPixelError = std::numeric_limits<int>::max(); + for (int selector = 0; selector < 8; ++selector) + { + const int decoded = std::clamp( + base + EacModifiers[table][selector] * multiplier, 0, 255); + const int delta = decoded - pixel[3]; + bestPixelError = std::min(bestPixelError, delta * delta); + } + error += static_cast<quint64>(bestPixelError); + } + if (error < bestError) + { + bestError = error; + bestTable = table; + bestMultiplier = static_cast<quint8>(multiplier); + } + } + } + return static_cast<quint8>((bestMultiplier << 4) | bestTable); +} + +QByteArray encodeSolidBlock(const Rgba &color) +{ + const Etc1SolidHints hints = makeEtc1SolidHints(color); + quint8 block[UastcBlockByteLength]{}; + int bitOffset = 0; + // UASTC mode 8 (solid RGBA) is the five-bit LSB-first Huffman code 0x17. + writeBits(block, &bitOffset, 0x17, 5); + for (const quint8 channel : color) { + writeBits(block, &bitOffset, channel, 8); + } + writeBits(block, &bitOffset, hints.m_differential, 1); + writeBits(block, &bitOffset, hints.m_intensity, 3); + writeBits(block, &bitOffset, hints.m_selector, 2); + for (int channel = 0; channel < 3; ++channel) { + writeBits(block, &bitOffset, hints.m_base[channel], 5); + } + return QByteArray(reinterpret_cast<const char *>(block), sizeof(block)); +} + +QByteArray encodeInterpolatedBlock(const PixelBlock &pixels, quint64 solidError, + UastcTextureSemantic semantic) +{ + Rgba low = pixels[0]; + Rgba high = pixels[0]; + quint64 greatestDistance = 0; + for (std::size_t first = 0; first < pixels.size(); ++first) + { + for (std::size_t second = first + 1; second < pixels.size(); ++second) { + const quint64 distance = + pixelError(pixels[first], pixels[second], semantic); + if (distance > greatestDistance) + { + greatestDistance = distance; + low = pixels[first]; + high = pixels[second]; + } + } + } + if (greatestDistance == 0) { + return {}; + } + + std::array<quint8, 16> selectors{}; + for (int iteration = 0; iteration < 4; ++iteration) + { + chooseSelectors(pixels, low, high, &selectors, semantic); + optimizeEndpoints(pixels, selectors, &low, &high); + } + const quint64 interpolatedError = + chooseSelectors(pixels, low, high, &selectors, semantic); + if (interpolatedError >= solidError) { + return {}; + } + + // The first texel is UASTC's anchor and stores one fewer selector bit. Make + // its top bit zero by reversing the palette without changing any colors. + if ((selectors[0] & 2U) != 0) { + std::swap(low, high); + for (quint8 &selector : selectors) { + selector = 3U - selector; + } + } + + PixelBlock decodedPixels{}; + for (std::size_t pixel = 0; pixel < pixels.size(); ++pixel) + { + for (int channel = 0; channel < 4; ++channel) { + decodedPixels[pixel][channel] = interpolate( + low[channel], high[channel], UastcWeights[selectors[pixel]]); + } + } + const Etc1BlockHints etc1 = makeEtc1BlockHints(decodedPixels); + const quint8 eacAlpha = makeEacAlphaHints(decodedPixels); + + quint8 block[UastcBlockByteLength]{}; + int bitOffset = 0; + writeBits(block, &bitOffset, 0x0D, 5); // UASTC mode 14 + writeBits(block, &bitOffset, 0, 2); // BC1 hints + writeBits(block, &bitOffset, etc1.m_flip, 1); + writeBits(block, &bitOffset, etc1.m_differential, 1); + writeBits(block, &bitOffset, etc1.m_intensity0, 3); + writeBits(block, &bitOffset, etc1.m_intensity1, 3); + writeBits(block, &bitOffset, etc1.m_bias, 5); + writeBits(block, &bitOffset, eacAlpha, 8); + for (int channel = 0; channel < 4; ++channel) + { + writeBits(block, &bitOffset, low[channel], 8); + writeBits(block, &bitOffset, high[channel], 8); + } + writeBits(block, &bitOffset, selectors[0], 1); + for (std::size_t pixel = 1; pixel < selectors.size(); ++pixel) { + writeBits(block, &bitOffset, selectors[pixel], 2); + } + return QByteArray(reinterpret_cast<const char *>(block), sizeof(block)); +} + +QByteArray encodeUastcRow(const QImage &image, int blockY, + UastcTextureSemantic semantic) +{ + QByteArray bytes; + const int blocksWide = (image.width() + 3) / 4; + bytes.reserve(static_cast<qsizetype>(blocksWide) * UastcBlockByteLength); + + for (int blockX = 0; blockX < blocksWide; ++blockX) + { + PixelBlock pixels{}; + quint32 sums[4]{}; + for (int localY = 0; localY < 4; ++localY) + { + const int y = qMin(blockY * 4 + localY, image.height() - 1); + const auto *row = + reinterpret_cast<const quint8 *>(image.constScanLine(y)); + for (int localX = 0; localX < 4; ++localX) + { + const int x = qMin(blockX * 4 + localX, image.width() - 1); + Rgba &pixel = pixels[localY * 4 + localX]; + for (int channel = 0; channel < 4; ++channel) + { + pixel[channel] = row[x * 4 + channel]; + sums[channel] += pixel[channel]; + } + } + } + + Rgba average{}; + for (int channel = 0; channel < 4; ++channel) { + average[channel] = static_cast<quint8>((sums[channel] + 8U) / 16U); + } + quint64 solidError = 0; + for (const Rgba &pixel : pixels) { + solidError += pixelError(pixel, average, semantic); + } + + const QByteArray interpolated = + encodeInterpolatedBlock(pixels, solidError, semantic); + bytes.append(interpolated.isEmpty() ? encodeSolidBlock(average) + : interpolated); + } + return bytes; +} + +bool writeBytes(QIODevice *destination, const QByteArray &bytes, + QString *error) +{ + if (destination->write(bytes) != bytes.size()) + { + *error = QStringLiteral("Cannot write KTX2 data: %1") + .arg(destination->errorString()); + return false; + } + return true; +} + +bool writePadding(QIODevice *destination, quint64 targetOffset, + QString *error) +{ + static const QByteArray zeros(16, '\0'); + while (static_cast<quint64>(destination->pos()) < targetOffset) + { + const quint64 remaining = + targetOffset - static_cast<quint64>(destination->pos()); + const qsizetype count = + static_cast<qsizetype>(std::min<quint64>(remaining, zeros.size())); + if (!writeBytes(destination, zeros.left(count), error)) { + return false; + } + } + return true; +} + +} // namespace + +bool writeUastcKtx2(const QVector<QImage> &levels, const QString &outputFile, + bool srgb, UastcTextureSemantic semantic, QString *error, + const std::function<bool()> &isCancelled, + bool zstdSupercompression) +{ +#ifndef MSFS_CONVERTER_WITH_ZSTD + if (zstdSupercompression) + { + *error = QStringLiteral( + "This build does not include optional Zstandard supercompression"); + return false; + } +#endif + if (levels.isEmpty() || levels.first().isNull()) + { + *error = QStringLiteral("Cannot write an empty KTX2 mip chain"); + return false; + } + if (levels.size() > 32) + { + *error = QStringLiteral("KTX2 mip chain has an unreasonable level count"); + return false; + } + + QVector<quint64> levelLengths; + QVector<quint64> uncompressedLevelLengths; + levelLengths.reserve(levels.size()); + uncompressedLevelLengths.reserve(levels.size()); + int expectedWidth = levels.first().width(); + int expectedHeight = levels.first().height(); + for (qsizetype level = 0; level < levels.size(); ++level) + { + if (isCancelled && isCancelled()) + { + *error = QStringLiteral("Conversion cancelled"); + return false; + } + const QImage &image = levels.at(level); + if (image.isNull() || image.width() != expectedWidth || + image.height() != expectedHeight) { + *error = QStringLiteral("KTX2 mip %1 is %2x%3; expected %4x%5") + .arg(level) + .arg(image.width()) + .arg(image.height()) + .arg(expectedWidth) + .arg(expectedHeight); + return false; + } + const quint64 blocksWide = (static_cast<quint64>(image.width()) + 3) / 4; + const quint64 blocksHigh = (static_cast<quint64>(image.height()) + 3) / 4; + const quint64 byteLength = blocksWide * blocksHigh * UastcBlockByteLength; + levelLengths.append(byteLength); + uncompressedLevelLengths.append(byteLength); + expectedWidth = qMax(1, expectedWidth / 2); + expectedHeight = qMax(1, expectedHeight / 2); + } + + QVector<QByteArray> compressedLevels; +#ifdef MSFS_CONVERTER_WITH_ZSTD + if (zstdSupercompression) { + compressedLevels.reserve(levels.size()); + for (qsizetype level = 0; level < levels.size(); ++level) + { + if (isCancelled && isCancelled()) + { + *error = QStringLiteral("Conversion cancelled"); + return false; + } + const QImage image = + levels.at(level).convertToFormat(QImage::Format_RGBA8888); + QByteArray uncompressed; + uncompressed.reserve( + static_cast<qsizetype>(uncompressedLevelLengths[level])); + const int blocksHigh = (image.height() + 3) / 4; + for (int blockY = 0; blockY < blocksHigh; ++blockY) { + uncompressed.append(encodeUastcRow(image, blockY, semantic)); + } + QByteArray compressed; + compressed.resize(static_cast<qsizetype>( + ZSTD_compressBound(static_cast<size_t>(uncompressed.size())))); + const size_t compressedSize = ZSTD_compress( + compressed.data(), static_cast<size_t>(compressed.size()), + uncompressed.constData(), static_cast<size_t>(uncompressed.size()), + 9); + if (ZSTD_isError(compressedSize)) + { + *error = + QStringLiteral("Zstandard compression failed: %1") + .arg(QString::fromLatin1(ZSTD_getErrorName(compressedSize))); + return false; + } + compressed.resize(static_cast<qsizetype>(compressedSize)); + levelLengths[level] = static_cast<quint64>(compressed.size()); + compressedLevels.append(std::move(compressed)); + } + } +#endif + + bool hasAlpha = false; + for (const QImage &source : levels) { + const QImage image = source.convertToFormat(QImage::Format_RGBA8888); + for (int y = 0; y < image.height() && !hasAlpha; ++y) { + const auto *row = + reinterpret_cast<const quint8 *>(image.constScanLine(y)); + for (int x = 0; x < image.width(); ++x) + { + if (row[x * 4 + 3] != 255) + { + hasAlpha = true; + break; + } + } + } + if (hasAlpha) { + break; + } + } + const QByteArray dfd = createDfd(srgb, hasAlpha); + QByteArray kvd; + appendKeyValue(&kvd, QByteArrayLiteral("KTXorientation"), + QByteArrayLiteral("rd")); + appendKeyValue(&kvd, QByteArrayLiteral("KTXwriter"), + QByteArrayLiteral("MSFSAssetConverter embedded UASTC writer")); + + const quint32 levelCount = static_cast<quint32>(levels.size()); + const quint32 dfdOffset = + 12 + HeaderByteLength + levelCount * LevelIndexEntryByteLength; + const quint32 kvdOffset = dfdOffset + static_cast<quint32>(dfd.size()); + quint64 dataOffset = kvdOffset + static_cast<quint32>(kvd.size()); + if (!zstdSupercompression) { + dataOffset = (dataOffset + 15U) & ~quint64(15U); + } + + QVector<quint64> levelOffsets(levelLengths.size()); + quint64 nextOffset = dataOffset; + for (qsizetype level = levelLengths.size(); level-- > 0;) + { + if (!zstdSupercompression) { + nextOffset = (nextOffset + 15U) & ~quint64(15U); + } + levelOffsets[level] = nextOffset; + if (levelLengths.at(level) > + std::numeric_limits<quint64>::max() - nextOffset) { + *error = QStringLiteral("KTX2 output size overflows 64 bits"); + return false; + } + nextOffset += levelLengths.at(level); + } + + QByteArray prefix; + prefix.reserve(static_cast<qsizetype>(dataOffset)); + prefix.append("\xABKTX 20\xBB\r\n\x1A\n", 12); + appendU32(&prefix, 0); // UASTC is described by the DFD, not a Vulkan format + appendU32(&prefix, 1); // typeSize + appendU32(&prefix, static_cast<quint32>(levels.first().width())); + appendU32(&prefix, static_cast<quint32>(levels.first().height())); + appendU32(&prefix, 0); // pixelDepth + appendU32(&prefix, 0); // layerCount + appendU32(&prefix, 1); // faceCount + appendU32(&prefix, levelCount); + appendU32(&prefix, zstdSupercompression ? 2U : 0U); + appendU32(&prefix, dfdOffset); + appendU32(&prefix, static_cast<quint32>(dfd.size())); + appendU32(&prefix, kvdOffset); + appendU32(&prefix, static_cast<quint32>(kvd.size())); + appendU64(&prefix, 0); // No supercompression global data + appendU64(&prefix, 0); + + for (qsizetype level = 0; level < levelLengths.size(); ++level) + { + appendU64(&prefix, levelOffsets.at(level)); + appendU64(&prefix, levelLengths.at(level)); + appendU64(&prefix, uncompressedLevelLengths.at(level)); + } + prefix.append(dfd); + prefix.append(kvd); + while (static_cast<quint64>(prefix.size()) < dataOffset) { + prefix.append('\0'); + } + + QSaveFile destination(outputFile); + if (!destination.open(QIODevice::WriteOnly)) + { + *error = QStringLiteral("Cannot write KTX2 texture: %1 (%2)") + .arg(outputFile, destination.errorString()); + return false; + } + if (!writeBytes(&destination, prefix, error)) { + return false; + } + for (qsizetype level = levels.size(); level-- > 0;) + { + if (!writePadding(&destination, levelOffsets.at(level), error)) { + return false; + } + if (zstdSupercompression) + { + if (!writeBytes(&destination, compressedLevels.at(level), error)) { + return false; + } + } + else + { + const QImage image = + levels.at(level).convertToFormat(QImage::Format_RGBA8888); + const int blocksHigh = (image.height() + 3) / 4; + for (int blockY = 0; blockY < blocksHigh; ++blockY) + { + if (isCancelled && isCancelled()) + { + destination.cancelWriting(); + *error = QStringLiteral("Conversion cancelled"); + return false; + } + if (!writeBytes(&destination, encodeUastcRow(image, blockY, semantic), + error)) { + return false; + } + } + } + } + if (!destination.commit()) + { + *error = QStringLiteral("Cannot commit KTX2 texture: %1 (%2)") + .arg(outputFile, destination.errorString()); + return false; + } + return true; +} diff --git a/plugins/feature/map/msfsassetconverter/ktx2writer.h b/plugins/feature/map/msfsassetconverter/ktx2writer.h new file mode 100644 index 000000000..0f0bc146b --- /dev/null +++ b/plugins/feature/map/msfsassetconverter/ktx2writer.h @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include <QImage> +#include <QString> +#include <QVector> + +#include <functional> + +enum class UastcTextureSemantic { Color, Data, Normal }; + +// Writes the narrow KTX2 subset needed by this converter: one non-array, +// non-cubemap 2D UASTC image with an explicit mip chain. The embedded encoder +// uses a compact subset of UASTC modes for each 4x4 tile, avoiding a Basis +// Universal or KTX-Software runtime dependency. +bool writeUastcKtx2(const QVector<QImage> &levels, const QString &outputFile, + bool srgb, UastcTextureSemantic semantic, QString *error, + const std::function<bool()> &isCancelled = {}, + bool zstdSupercompression = false); diff --git a/plugins/feature/map/osmtemplateserver.h b/plugins/feature/map/osmtemplateserver.h index a871002d0..743011e16 100644 --- a/plugins/feature/map/osmtemplateserver.h +++ b/plugins/feature/map/osmtemplateserver.h @@ -131,7 +131,7 @@ private slots: if (m_overlay) { url = QString("http://127.0.0.1:%1/%2/%z/%x/%y.png").arg(m_tileServerPort).arg(mapUrl[idx]); } else { - url = QString("http://1.basemaps.cartocdn.com/%2/%z/%x/%y.png%1").arg(hiresURL).arg(mapUrl[idx]); + url = QString("http://1.basemaps.cartocdn.com/%2/%z/%x/%y.png%1?key=%3").arg(hiresURL).arg(mapUrl[idx]).arg("cb1_27a9_1_036ae52d2884fda8713b961c"); } xml = QString("\ {\ diff --git a/plugins/feature/map/readme.md b/plugins/feature/map/readme.md index bbea10657..2ad957d33 100644 --- a/plugins/feature/map/readme.md +++ b/plugins/feature/map/readme.md @@ -225,15 +225,43 @@ The PFD can be moved by left clicking on it and dragging it. It can be resized b ![PFD](../../../doc/img/Map_plugin_pfd.png) -<h3>22: Display tracks for selected object</h3> +<h3>22: ND (Navigation Display)</h3> + +When checked, the aircraft ND (Navigation Display) will be displayed for the selected aircraft. This shows a compass rose with range rings, +ground speed, true air speed and wind direction, the flight plan and its waypoints when one has been received (via the Aircraft feature, +from an ACARS FPN message or oceanic clearance), and other nearby aircraft as TCAS-style traffic symbols with relative altitudes. + +Two display modes are supported, toggled by clicking the button in the top right corner: ARC, which shows a 120 degree arc ahead of +the aircraft, and ROSE, which shows a full 360 degree compass rose. The range (10 to 320 nautical miles) can be changed with the ++ and - buttons or by scrolling the mouse wheel over the display. + +When the flight plan includes an arrival approach or runway (e.g. ILSY 18R), it is displayed at the top of the ND once the aircraft +is within 250 nautical miles of the arrival airport, or whenever the approach is being flown (G/S or LOC mode active). + +The ND can be moved by left clicking on it and dragging it. It can be resized by left clicking and dragging in the bottom right corner. + +Note that the compass rose is orientated to the aircraft's magnetic heading, while waypoint and traffic positions are true bearings, +so the overlay can be off by the local magnetic declination. + +<h4>DCDU (Datalink Control and Display Unit)</h4> + +When a datalink ATC message (CPDLC, pre-departure clearance or oceanic clearance, received via the Aircraft feature) arrives for the +currently selected aircraft, a DCDU window pops up on the 3D map showing the time the message was received, which station it is to +or from (e.g. 1412Z FROM EDDS) and the message text. Long messages are split over multiple pages - click the PG indicator to move +between them. The window is closed by clicking CLOSE, and can be moved and resized like the PFD and ND. + +A ring is played when a message arrives. Its volume is set by the "Cockpit volume" slider in the Map Display Settings dialog, +under 3D Map Settings - drag it to zero to silence it. + +<h3>23: Display tracks for selected object</h3> When checked, displays the track (taken or predicted) for the selected object. -<h3>23: Display tracks for all objects</h3> +<h3>24: Display tracks for all objects</h3> When checked, displays the track (taken or predicted) for the all objects. -<h3>24: Save to .kml</h3> +<h3>25: Save to .kml</h3> When clicked, items and tracks on the map will be saved to a [KML](https://en.wikipedia.org/wiki/Keyhole_Markup_Language) (.kml or .kmz) file, for use in other applications. @@ -241,11 +269,11 @@ Note that the KML format requires 3D models in the Collada (.dae) format. Howeve If you wish to view the models in a KML viewer, you will need to manually convert them. Note that you should still be able to view tracks without the models. Note that the .glbe files cannot be converted to .dae. -<h3>25: Delete</h3> +<h3>26: Delete</h3> When clicked, all items will be deleted from the map. -<h3>26: Display settings</h3> +<h3>27: Display settings</h3> When clicked, opens the Map Display Settings dialog: @@ -260,15 +288,18 @@ For the 2D map, the settings include: or [gdal2tiles](https://gdal.org/programs/gdal2tiles.html) or any other tool that creates map images compatible with Google Maps, OpenLayers and Leaflet. * When MapboxGL is used as the provider, custom styles can be specified. +* Whether aircraft are displayed using icons showing their airline's livery, instead of black icons. Livery icons are matched from the aircraft type and operator, in the same way as 3D models, so require the 3D models to have been downloaded. Aircraft without a matching livery icon are displayed with the plain icon sent by the source plugin. For the 3D map, the settings include: * Whether the 3D map is displayed. -* The default imagery to use. Bing Maps Aerial and ArcGIS are higher resolution than Sentinel-2. To use these, you should enter your own API key on the API Keys tab. -* The terrain provider, which provides elevation data. For a "flat" globe, terrain can be set to Ellipsoid for the WGS-84 ellipsoid. +* The default imagery to use. Bing Maps Aerial, Sentinel-2, Earth at night and the Google Maps imagery use Cesium Ion quota, so require a Cesium Ion API key to be entered on the API Keys tab. Without one, they are greyed out and ArcGIS world imagery is used. +* The terrain provider, which provides elevation data. For a "flat" globe, terrain can be set to Ellipsoid for the WGS-84 ellipsoid. Cesium World Terrain requires a Cesium Ion API key. * Whether lighting is applied to the terrain. Not applicable if terrain is set to Ellipsoid. * Whether animated water effects (such as waves) are used. Not applicable if terrain is set to Ellipsoid. -* The buildings provider, which provides 3D building models. This can be set to None if no buildings are desired. The buildings may float in the air if terrain is set to Ellipsoid. +* The buildings provider, which provides 3D building models. This can be set to None if no buildings are desired. The buildings may float in the air if terrain is set to Ellipsoid. Cesium OSM Buildings requires a Cesium Ion API key. +* Whether Google Photorealistic 3D Tiles are displayed. These combine terrain, buildings and imagery in a single photorealistic model, so the imagery, terrain and buildings settings above are not used while they are enabled. As the globe itself is not drawn, the map layers that are drawn on it, such as rain, clouds, sea marks, railways, NASA global imagery and the Maidenhead grid, are not displayed either. Requires a Cesium Ion API key. +Aircraft are placed on top of the tiles, but items that are clamped to the ground by Cesium itself, rather than clipped to it by SDRangel, such as airports and navigation aids, may be hidden underneath them. * Whether the globe and models are lit from the direction of the Sun or the camera. * The camera light intensity if Lighting is set to Camera. * Whether HDT (High Dynamic Range) rendering should be used. @@ -284,11 +315,22 @@ These are not included with the SDRangel distribution, so must be downloaded. It ![Map Display Settings Dialog Items Tab](../../../doc/img/Map_plugin_display_settings_items.png) -The Map Items tab customization of how objects from different SDRangel plugins and the Internet are displayed on the 2D and 3D maps. This includes: +The Map Items tab customization of how objects from different SDRangel plugins and the Internet are displayed on the 2D and 3D maps. + +Each row is a group of items. Most groups are named after the plugin that sends them, and +everything that plugin draws shares the row. A plugin can also put some of what it draws +in a group of its own, where those items want different settings from the rest - the +Aircraft feature does this for filed flight plans and oceanic clearances, which appear as +**Aircraft Routes**. That exists because a route wants the opposite of an aircraft from +the 2D Min Zoom column: an aircraft icon has to be decluttered away when the map is zoomed +out, while a route drawn across an ocean is exactly what should still be visible there. +So Aircraft can be left at 11 and Aircraft Routes at 0. + +The settings include: * Whether images are displayed on the 2D map and whether 3D models are displayed on the 3D map. * Whether labels are displayed giving the name of the object. -* Whether taken and predicted tracks are displayed and in which colour. +* Whether taken and predicted tracks are displayed and in which colour. Instead of a single colour, a palette can be chosen in the Palette column, which colours the track on both the 2D and 3D maps according to the altitude of the object, with a different colour for every 5000ft, in the same way as the tracks on the ADS-B Demodulator's map. This defaults to Spectral for aircraft and None (a single colour) for everything else. Objects with predicted tracks, such as satellites, are always drawn in a single colour on the 3D map. * How the image or 3D model is scaled as the zoom level changes. ![Map Display Settings Dialog API Keys Tab](../../../doc/img/Map_plugin_display_settings_apikeys.png) @@ -305,6 +347,10 @@ Free API keys are available by signing up for an accounts with: If API keys are not specified, a default key will be used, but this may not work if too many users use it, so please create and use your own. +The Cesium Ion key is an exception: several 3D map layers use quota from the Cesium Ion account the key belongs to, so those layers are only available once you have entered your own key. +This applies to Bing Maps Aerial, Sentinel-2, Earth at night and Google Maps imagery, Cesium World Terrain, Cesium OSM Buildings and Google Photorealistic 3D Tiles. +Without a key, these are greyed out in the settings dialog and are not offered in the imagery selector on the 3D map itself. + <h3>Map</h3> The map feature displays a 2D and a 3D map overlaid with objects reported by other SDRangel channels and features, as well as beacon locations. diff --git a/plugins/feature/map/webserver.cpp b/plugins/feature/map/webserver.cpp index e9abcac8b..43006ae5b 100644 --- a/plugins/feature/map/webserver.cpp +++ b/plugins/feature/map/webserver.cpp @@ -41,6 +41,8 @@ WebServer::WebServer(quint16 &port, QObject* parent) : m_mimeTypes.insert(".json", new MimeType("application/json")); m_mimeTypes.insert(".geojson", new MimeType("application/geo+json")); m_mimeTypes.insert(".wasm", new MimeType("application/wasm")); + m_mimeTypes.insert(".wav", new MimeType("audio/wav")); + m_mimeTypes.insert(".ogg", new MimeType("audio/ogg")); } WebServer::~WebServer() diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index ac3ed3636..e447a114b 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -247,6 +247,7 @@ set(sdrbase_SOURCES util/fixedtraits.cpp util/fits.cpp util/flightinformation.cpp + util/flightpathpalette.cpp util/ft8message.cpp util/giro.cpp util/goesxray.cpp @@ -267,6 +268,8 @@ set(sdrbase_SOURCES util/nasaglobalimagery.cpp util/navtex.cpp util/openaip.cpp + util/aircraft3dmodels.cpp + util/bglwaypointreader.cpp util/osndb.cpp util/ourairportsdb.cpp util/peakfinder.cpp @@ -285,6 +288,9 @@ set(sdrbase_SOURCES util/sdrangelserverlist.cpp util/simpleserializer.cpp util/serialutil.cpp + util/acarsmessage.cpp + util/acarsmultipartassembler.cpp + util/sidstar.cpp util/socket.cpp util/solardynamicsobservatory.cpp util/sondehub.cpp @@ -427,6 +433,7 @@ set(sdrbase_HEADERS dsp/kissfft.h dsp/kissengine.h dsp/firfilter.h + dsp/afskmlse.h dsp/gaussian.h dsp/gmskmlse.h dsp/mimochannel.h @@ -529,6 +536,7 @@ set(sdrbase_HEADERS util/fixedtraits.h util/fits.h util/flightinformation.h + util/flightpathpalette.h util/ft8message.h util/giro.h util/goesxray.h @@ -553,9 +561,13 @@ set(sdrbase_HEADERS util/nasaglobalimagery.h util/navtex.h util/openaip.h + util/aircraft3dmodels.h + util/aircraftenginesound.h + util/bglwaypointreader.h util/osndb.h util/outairportsdb.h util/peakfinder.h + util/aircraftreport.h util/planespotters.h util/vesselfinder.h util/png.h @@ -574,6 +586,11 @@ set(sdrbase_HEADERS util/sdrangelserverlist.h util/simpleserializer.h util/serialutil.h + util/acarsmessage.h + util/acarstextformat.h + util/acarsmultipartassembler.h + util/do219.h + util/sidstar.h util/socket.h util/solardynamicsobservatory.h util/sondehub.h diff --git a/sdrbase/feature/featurewebapiutils.cpp b/sdrbase/feature/featurewebapiutils.cpp index fb284afb3..5af691f92 100644 --- a/sdrbase/feature/featurewebapiutils.cpp +++ b/sdrbase/feature/featurewebapiutils.cpp @@ -18,6 +18,7 @@ #include <QDebug> #include "SWGFeatureActions.h" +#include "SWGAircraftActions.h" #include "SWGMapActions.h" #include "SWGPERTesterActions.h" #include "SWGDeviceState.h" @@ -114,6 +115,46 @@ bool FeatureWebAPIUtils::mapFind(const QString& target, int featureSetIndex, int } } +// Ask the Aircraft feature to select an aircraft or a flight. This is how a link clicked +// in an aircraft's Map popup gets back to the feature that knows what an aircraft is - the +// Map deliberately knows nothing about them. +bool FeatureWebAPIUtils::aircraftSelect(const QString& key, const QString& value, + int featureSetIndex, int featureIndex) +{ + Feature *feature = FeatureWebAPIUtils::getFeature(featureSetIndex, featureIndex, "sdrangel.feature.aircraft"); + if (feature == nullptr) + { + qWarning("FeatureWebAPIUtils::aircraftSelect: no Aircraft feature"); + return false; + } + + QString errorMessage; + QStringList featureActionKeys = { key }; + SWGSDRangel::SWGFeatureActions query; + SWGSDRangel::SWGAircraftActions *aircraftActions = new SWGSDRangel::SWGAircraftActions(); + + if (key == "selectIcao") { + aircraftActions->setSelectIcao(new QString(value)); + } else if (key == "selectRegistration") { + aircraftActions->setSelectRegistration(new QString(value)); + } else if (key == "selectFlight") { + aircraftActions->setSelectFlight(new QString(value)); + } else { + qWarning() << "FeatureWebAPIUtils::aircraftSelect: unknown action" << key; + delete aircraftActions; + return false; + } + query.setAircraftActions(aircraftActions); + + int httpRC = feature->webapiActionsPost(featureActionKeys, query, errorMessage); + if (httpRC/100 != 2) + { + qWarning() << "FeatureWebAPIUtils::aircraftSelect: error " << httpRC << ":" << errorMessage; + return false; + } + return true; +} + // Set the date and time the map uses for display bool FeatureWebAPIUtils::mapSetDateTime(const QDateTime& dateTime, int featureSetIndex, int featureIndex) { diff --git a/sdrbase/feature/featurewebapiutils.h b/sdrbase/feature/featurewebapiutils.h index 535a35e27..e440e8ee6 100644 --- a/sdrbase/feature/featurewebapiutils.h +++ b/sdrbase/feature/featurewebapiutils.h @@ -52,6 +52,10 @@ public: static bool mapFind(const QString& target, int featureSetIndex=-1, int featureIndex=-1); static bool mapSetDateTime(const QDateTime& dateTime, int featureSetIndex=-1, int featureIndex=-1); static bool skyMapFind(const QString& target, int featureSetIndex=-1, int featureIndex=-1); + //!< Select an aircraft or flight in the Aircraft feature. key is "selectIcao", + //!< "selectRegistration" or "selectFlight" + static bool aircraftSelect(const QString& key, const QString& value, + int featureSetIndex=-1, int featureIndex=-1); static bool openSkyMapAndFind(const QString& target); static Feature *getFeature(int& featureSetIndex, int& featureIndex, const QString& uri); static bool satelliteAOS(const QString name, const QDateTime aos, const QDateTime los); diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index c6a35f43a..4cf91c4a5 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -34,6 +34,7 @@ #include "device/deviceset.h" #include "device/deviceapi.h" #include "channel/channelapi.h" +#include "SWGMapItem.h" #ifdef ANDROID #include "util/android.h" #endif @@ -74,6 +75,7 @@ MESSAGE_CLASS_DEFINITION(MainCore::MsgMoveFeatureUIToWorkspace, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgMoveChannelUIToWorkspace, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgMapItem, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgAircraftReport, Message) +MESSAGE_CLASS_DEFINITION(MainCore::MsgAcarsBlock, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgPacket, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgTargetAzimuthElevation, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgStarTrackerTarget, Message) @@ -828,3 +830,8 @@ bool MainCore::getWindowState(const void* owner, WindowState& state) const state = it.value(); return true; } + +MainCore::MsgAircraftReport::~MsgAircraftReport() +{ + delete m_report.m_mapItem; +} diff --git a/sdrbase/maincore.h b/sdrbase/maincore.h index 40dedf793..413d44471 100644 --- a/sdrbase/maincore.h +++ b/sdrbase/maincore.h @@ -808,6 +808,7 @@ public: { return new MsgAircraftReport(pipeSource, report); } + ~MsgAircraftReport() // Owns m_report.m_mapItem until a consumer takes it private: const QObject *m_pipeSource; @@ -820,6 +821,61 @@ public: { } }; + // Message to pass a received ACARS block, exactly as it came off the air, to a + // feature that archives it and feeds it on to aggregators. + // + // The RAW block rather than anything decoded, which is the whole point: a decoder + // improves, and everything already stored improves with it. That is not theoretical - + // a three character sublabel was being read as two, which put a stray character into + // the middle of every block after the first of a long message, and every rendered + // document written before the fix keeps its corruption for good. The block re-decodes + // clean. + // + // Per BLOCK, not per reassembled message: that defect was introduced while parsing a + // block's own header, before reassembly, so the reassembled text would not have been + // enough to recover from it. + // + // The reception metadata travels with it because none of it is in the block - the + // aggregators want the frequency and the signal level, and the archive wants to know + // which bearer heard it. + class SDRBASE_API MsgAcarsBlock : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const QObject *getPipeSource() const { return m_pipeSource; } + const QByteArray& getBlock() const { return m_block; } + const QDateTime& getDateTime() const { return m_dateTime; } + qint64 getFrequency() const { return m_frequency; } + double getLevel() const { return m_level; } + int getProtocol() const { return m_protocol; } + + static MsgAcarsBlock* create(const QObject *pipeSource, const QByteArray& block, + const QDateTime& dateTime, qint64 frequency, + double level, int protocol) + { + return new MsgAcarsBlock(pipeSource, block, dateTime, frequency, level, protocol); + } + + private: + const QObject *m_pipeSource; + QByteArray m_block; + QDateTime m_dateTime; + qint64 m_frequency; //!< Hz + double m_level; //!< dB + int m_protocol; //!< An AircraftReport::Protocol + + MsgAcarsBlock(const QObject *pipeSource, const QByteArray& block, + const QDateTime& dateTime, qint64 frequency, double level, int protocol) : + Message(), + m_pipeSource(pipeSource), + m_block(block), + m_dateTime(dateTime), + m_frequency(frequency), + m_level(level), + m_protocol(protocol) + { } + }; + // Message to pass received packets between channels and features class SDRBASE_API MsgPacket : public Message { MESSAGE_CLASS_DECLARATION @@ -844,6 +900,8 @@ public: QByteArray m_packet; QDateTime m_dateTime; + protected: + // Protected rather than private so it can be subclassed to add extra info MsgPacket(const QObject *pipeSource, QByteArray packet, QDateTime dateTime) : Message(), m_pipeSource(pipeSource), diff --git a/sdrbase/resources/webapi/doc/swagger/include/ACARSDemod.yaml b/sdrbase/resources/webapi/doc/swagger/include/ACARSDemod.yaml index 73b5f25aa..c7d56de7d 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/ACARSDemod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/ACARSDemod.yaml @@ -5,11 +5,14 @@ ACARSDemodSettings: type: integer format: int64 mode: - description: "Which protocol to demodulate: 0 ACARS, 1 VDL Mode 2, 2 HFDL, 3 Inmarsat Classic Aero" + description: "Which protocol to demodulate: 0 ACARS, 1 VDL Mode 2, 2 HFDL, 3 Inmarsat Classic Aero, 4 Iridium" type: integer aeroChannel: description: "Which Aero rate and channel is tuned. 0 600 bps P, 1 1200 bps P, 2 10500 bps P, 3 600 bps R, 4 1200 bps R, 5 600 bps T, 6 1200 bps T. Only used when mode is 3" type: integer + iridiumBandwidth: + description: "How much of the band the Iridium scanner covers: 0 1 MHz, 1 2 MHz, 2 4 MHz, 3 8 MHz. The device has to be able to supply the width chosen. Only used when mode is 4" + type: integer rfBandwidth: type: number format: float @@ -48,32 +51,6 @@ ACARSDemodSettings: type: string logEnabled: type: integer - feedEnabled: - description: "Feed received messages to aggregators, in acarsdec style JSON (1 for yes, 0 for no)" - type: integer - feedStationId: - description: "Station identifier sent with each fed message" - type: string - feedAirframes: - description: "Feed to airframes.io (1 for yes, 0 for no)" - type: integer - feedAirframesHost: - type: string - feedAirframesPort: - type: integer - feedAirframesTcp: - description: "Use TCP rather than UDP for the airframes.io feed (1 for yes, 0 for no)" - type: integer - feedAvdelphi: - description: "Feed to airframes.io's avdelphi (1 for yes, 0 for no)" - type: integer - feedAvdelphiHost: - type: string - feedAvdelphiPort: - type: integer - feedAvdelphiTcp: - description: "Use TCP rather than UDP for the avdelphi feed (1 for yes, 0 for no)" - type: integer scopeCh1: description: "Which internal signal the scope shows on channel 1" type: integer diff --git a/sdrbase/resources/webapi/doc/swagger/include/Aircraft.yaml b/sdrbase/resources/webapi/doc/swagger/include/Aircraft.yaml index d0e109145..6b6e2886c 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/Aircraft.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/Aircraft.yaml @@ -31,6 +31,42 @@ AircraftSettings: displayChart: description: "Show the message rate chart (1 for yes, 0 for no)" type: integer + displayCoverage: + description: "Draw each protocol's polar coverage on the map (1 for yes, 0 for no)" + type: integer + useLiveryIcons: + description: "Use aircraft icons in airline liveries on the 2D map, rather than black icons (1 for yes, 0 for no)" + type: integer + feedEnabled: + description: "Feed received ACARS messages on to aggregators (1 for yes, 0 for no)" + type: integer + feedStationId: + description: "Station ident sent with each message fed to aggregators" + type: string + feedAirframes: + description: "Feed airframes.io (1 for yes, 0 for no)" + type: integer + feedAirframesHost: + description: "airframes.io feed host" + type: string + feedAirframesPort: + description: "airframes.io feed port" + type: integer + feedAirframesTcp: + description: "Feed airframes.io over TCP rather than UDP (1 for TCP, 0 for UDP)" + type: integer + feedAvdelphi: + description: "Feed avdelphi.com (1 for yes, 0 for no)" + type: integer + feedAvdelphiHost: + description: "avdelphi.com feed host" + type: string + feedAvdelphiPort: + description: "avdelphi.com feed port" + type: integer + feedAvdelphiTcp: + description: "Feed avdelphi.com over TCP rather than UDP (1 for TCP, 0 for UDP)" + type: integer databaseFilename: description: "Where the session database is kept. Empty for the default location" type: string diff --git a/sdrbase/resources/webapi/doc/swagger/include/Map.yaml b/sdrbase/resources/webapi/doc/swagger/include/Map.yaml index 70f137873..e7e7509ad 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/Map.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/Map.yaml @@ -382,7 +382,7 @@ MapItem: $ref: "/doc/swagger/include/Map.yaml#/MapAircraftState" description: "Current states of aircraft tracked by the ADS-B demodulator." loopSound: - description: "Sound to loop while the item is on the 3D map, spatially located at the item. Either the name of an engine sound set (cfm, v2500, 777, 787, A380, jet), whose -n1/-n2/-idle recordings the map layers and mixes by phase of flight, or an audio file name from the Map's audio directory (e.g. helicopter.wav). Empty for none" + description: "Sound to loop while the item is on the 3D map, spatially located at the item. Either an engine sound-set directory below the configured 3d/Sounds directory, containing engine.json and OGG layers, or a legacy audio file name from the Map's bundled audio directory (e.g. helicopter.wav). Empty for none" type: string MapAnimation: @@ -452,6 +452,12 @@ MapCoordinate: MapAircraftState: description: "Aircraft state for PFD/ND" properties: + dateTime: + description: "Date and time at which this complete aircraft state applies (ISO 8601 extended format). When set, the Map preserves this sample instead of coalescing it with a later update." + type: string + icao: + description: "ICAO Mode S address of this aircraft as lower-case hex" + type: string callsign: type: string description: "Radio callsign." @@ -528,8 +534,17 @@ MapAircraftState: description: "0 unknown, 1 LNAV, APP (LOC)" type: integer tcasMode: - description: "-1 unknown, 0 Off, 1 TA, 2 TA/RA" - type: integer + description: "0 unknown, 1 Off, 2 TA only, 3 TA/RA" + type: integer + tcasRA: + description: "Active TCAS resolution advisory bitfield. 0 none, bit 0 active, bit 1 corrective (vs preventive), bit 2 downward sense (descend), bit 3 positive (vs vertical speed limit), bit 4 clear of conflict, bit 5 multiple threats, bit 6 opposite-sense multiple-threat coding" + type: integer + tcasThreatIcao: + description: "ICAO Mode S address of the RA threat aircraft as lower-case hex, empty if not identified" + type: string + squawk: + description: "Mode A squawk code as decimal digits (e.g. 7000), -1 for unknown" + type: integer windSpeed: type: number format: float @@ -608,4 +623,3 @@ MapRouteWaypoint: eta: description: "Estimated time over this waypoint (ISO 8601 extended format). Empty if unknown" type: string - diff --git a/sdrbase/util/acarsmessage.cpp b/sdrbase/util/acarsmessage.cpp new file mode 100644 index 000000000..fc391d964 --- /dev/null +++ b/sdrbase/util/acarsmessage.cpp @@ -0,0 +1,4401 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "util/acarsmessage.h" + +#include <cmath> +#include <mutex> + +#include <QDebug> +#include <QRegularExpression> + +#include "util/do219.h" +// For the OOOI event kinds, which the short movement reports map their label on to +#include "util/aircraftreport.h" + +// Imbedded Message Identifiers - ARINC 622: Table 2-1 +const QHash<QString, QString> m_imis = { + {"AD1", "Automatic dependent surveillance (ARINC 745-1)"}, + {"ADS", "Automatic dependent surveillance (ARINC 745-2)"}, + {"DIS", "Automatic dependent surveillance (ARINC 745-1/2)"}, + {"AT0", "Air traffic control communication (Preceeding DO-219)"}, + {"AT1", "Air traffic control communication"}, // DO-219 / CPCLD + {"CR1", "Air traffic control communication - Connect request"}, + {"CC1", "Air traffic control communication - Connect confirm"}, + {"DR1", "Air traffic control communication - Disconnect request"} +}; + +#include "util/ourairportsdb.h" + +QSharedPointer<const QHash<QString, AirportInformation *>> m_airportInfo; + +void acarsInitAirportInfo() +{ + static std::once_flag airportInfoInit; + std::call_once(airportInfoInit, []() { + m_airportInfo = OurAirportsDB::getAirportsByIdent(); + }); +} + +static QString icaoAirportName(const QString &icao) +{ + if (m_airportInfo) + { + if (m_airportInfo->contains(icao)) { + return m_airportInfo->value(icao)->m_name; + } + } + return ""; +} + +// Some formats name airports in three letter IATA where everything downstream - the +// map, the flight plan, the Aircraft feature - works in four letter ICAO. Translated on +// the way in rather than at each use, so only this one place has to know. +static QString icaoFromIata(const QString &iata) +{ + if (iata.size() != 3) { + return QString(); + } + QSharedPointer<const QHash<QString, AirportInformation *>> airports = + OurAirportsDB::getAirportsByIata(); + const AirportInformation *airport = airports ? airports->value(iata, nullptr) : nullptr; + return airport ? airport->m_ident : QString(); +} + +static QString icaoAndAirportName(const QString &icao) +{ + QString airportName = icaoAirportName(icao); + if (airportName.isEmpty()) { + return icao; + } else { + return QString("%1 (%2)").arg(icao).arg(airportName); + } +} + +AcarsMessage::AcarsMessage(const QByteArray &message) +{ + // Every field below is read at a fixed offset, so a block shorter than the smallest + // legal one would index off the end - and QString/QByteArray operator[] only asserts + // in a debug build, so a release build reads whatever is there instead of failing. + // decode() checks the length before it builds one of these, but nothing obliged it + // to: the test harness constructs an AcarsFlightStatus from an empty QByteArray to + // exercise decode() on its own. A short block leaves every field empty. + if (message.size() < ACARS_MIN_BYTES) { + return; + } + + // Mode is destination of message + // 2 = All ground stations / aircraft - Other characters are specific station / aircraft + // and country specific + m_mode = QString("%1").arg(message[1]); + + // Address is aircraft registration. Prefixed with '.'s if registration is shorter than field width + m_address = QString(message.mid(2, 7)); + while (m_address.startsWith(".")) { + m_address = m_address.mid(1); // Remove prefix + } + + m_ack = message[9]; + + // Label (type of message) + m_label = message.mid(10, 2); + + // Block ID indicates if downlink (0-9) or uplink (A-Z or NUL) + m_blockId = message[12]; + m_uplink = isUplink(m_blockId); + + // Extract text + qsizetype textSize = message.length() - 14 - 1 - 2 - 1; + if (textSize >= 10) + { + m_text = message.mid(14, textSize); + + if (!m_uplink) + { + // Extract downlink fields + m_originator = m_text[0]; + m_messageNumber = m_text.mid(1, 2); + m_blockSequence = m_text[3]; + m_flight = m_text.mid(4, 6); + // Remove extracted fields from text + m_text = m_text.mid(10); + // Is there a sublabel? (Typically for H1 label) + if ((m_text.size() >= 3) && (m_text[0] == '#')) + { + m_subLabel = m_text.mid(1, 2); + m_text = m_text.mid(3); + // An FMC sublabel is THREE characters - #M1B, #M3B - and taking only two + // of them left the third at the front of the block's text. + // + // On a single block message that is harmless, because the report parser + // recognises a stray character before POS or FPN/ and drops it. On a + // multi block message it is not: every block carries the prefix, so every + // block after the first left its supplementary character buried in the + // MIDDLE of the reassembled text, where nothing looks for it. Off air + // that put a stray B every 207 characters - one per block boundary - + // through the middle of numbers in flight plans and predicted routes, + // on four different aircraft. + // + // The supplementary character is a literal B, on EVERY sublabel and not + // only the FMC ones. That was first fixed for M1 alone, from the one + // message that showed it; measured across 5532 blocks off air it is B in + // 2247 cases out of 2247, spread over ten different sublabels - DF 1932, + // M1 126, CF 70, 10 60, EI 27, and T2, T3, T5, T6, T8. Never any other + // character, which a body starting at that position could not manage. + // + // Reading the bodies confirms it rather than resting on the count: #CFB + // is followed by ACMF210_TAKEOFF..., the aircraft condition monitoring + // function, #EIB by RPT28;PG1;REAL, and #T5B and #T6B by a path beginning + // with a slash. With the B left on they would read BACMF210, BRPT28 and + // B/ILNGE. + // + // So the M<digit> restriction was leaving it in place for 2121 blocks - + // and, on a message that arrives in several, at every block boundary in + // the middle of the text. Matched on the character itself rather than on + // "any capital", so a sublabel whose body genuinely begins with some + // other letter cannot lose it. + if ((m_subLabel.size() == 2) && !m_text.isEmpty() && (m_text[0] == 'B')) + { + m_subLabelSupplement = m_text.left(1); + m_text = m_text.mid(1); + } + } + } + else + { + if (m_text.startsWith("- #")) + { + m_subLabel = m_text.mid(3, 2); + m_text = m_text.mid(5); + } + } + } + + m_multiBlock = message[message.length() - 4] == ASCII_ETB; +} + +QString AcarsMessage::toString() +{ + return ""; // Return nothing, as we don't know how to decode this message +} + +AcarsMessage *AcarsMessage::decode(const QByteArray &message) +{ + return decodeBlock(message, nullptr); +} + +AcarsMessage *AcarsMessage::decode(const QByteArray &message, const QString &text) +{ + return decodeBlock(message, &text); +} + +AcarsMessage *AcarsMessage::decodeBlock(const QByteArray &message, const QString *textOverride) +{ + // A no-text block is 17 bytes and has ETX directly after the block identifier. STX is + // present only when text follows (ARINC 618 Appendix B). + const bool noText = (message.size() == 17) && ((message[13] & 0x7f) == ASCII_ETX); + const bool hasText = (message.size() >= 18) && ((message[13] & 0x7f) == ASCII_STX); + + if ((noText || hasText) + && (message[0] == (char)ASCII_SOH) + && (message[message.size()-1] == (char)ASCII_DEL)) + { + // Remove parity bit from MSB + QByteArray ascii = message; + for (int i = 0; i < message.length(); i++) { + ascii[i] = ascii[i] & 0x7f; + } + + // Extract label (type of message) + QString label(ascii.mid(10, 2)); + + // Extract block identifier to determine if uplink or downlink + QChar blockId(ascii[12]); + bool uplink = isUplink(blockId); + + // Extract message text + int start = 14; + if (!uplink) { + start += 10; // Skip msg num and flight + } + + QString text; + qsizetype textSize = message.length() - start - 1 - 2 - 1; + if (textSize > 0) { + text = ascii.mid(start, textSize); + } + + return decode(ascii, label, textOverride ? *textOverride : text, uplink); + } + else + { + return nullptr; + } +} + +// A runway designator without the padding an FMS writes when there is none. +// +// The field is a fixed three characters, so a runway with no parallel gets an O to fill +// it out: 27O is runway 27, 02O is runway 02. L, R and C are real designators and stay. +// Seen off air as 27O and 02O against genuine 19L, 19R and 26R - and neither Heraklion +// nor Alicante, the two that produced them, has a second parallel runway to designate. +// +// Applied to each designator in the field rather than to the field as a whole, because a +// plan gives the departure runway with the arrival's in brackets after it - 27O(19O). +static QString stripRunwayFiller(const QString& runway) +{ + static const QRegularExpression fillerRe(R"((^|[^0-9A-Z])([0-9]{2})O(?![0-9A-Z]))"); + QString stripped = runway; + // Repeated because the matches can abut through the bracket, and a single pass + // consumes the character between them + QString previous; + while (stripped != previous) + { + previous = stripped; + stripped.replace(fillerRe, "\\1\\2"); + } + return stripped; +} + +AcarsLoadsheet::AcarsLoadsheet(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// The figures out of a loadsheet. Every one is optional - a preliminary sheet carries +// less than a final, and airlines differ in what they bother to send - so anything not +// found simply stays unset rather than making the whole thing fail to decode. +bool AcarsLoadsheet::decode(const QString &text) +{ + m_text = text; + m_final = text.contains("LOADSHEET FINAL"); + + // WEIGHT nnnnn [MAX nnnnn]. The spacing varies between airlines and between fields + // in the same sheet, so it is matched rather than counted. + auto weight = [&text](const char *name, int *value, int *maximum) + { + const QRegularExpression re(QString(R"(\b%1\s+(\d{3,6})(?:\s+MAX\s+(\d{3,6}))?)") + .arg(name)); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return; + } + *value = match.captured(1).toInt(); + if (maximum && !match.captured(2).isEmpty()) { + *maximum = match.captured(2).toInt(); + } + }; + + weight("ZFW", &m_zeroFuelWeight, &m_zeroFuelWeightMax); + weight("TOW", &m_takeoffWeight, &m_takeoffWeightMax); + weight("LAW", &m_landingWeight, &m_landingWeightMax); + weight("TOF", &m_takeoffFuel, nullptr); + weight("TIF", &m_tripFuel, nullptr); + weight("UNDLD", &m_underload, nullptr); + + // PAX/16/120 TTL 137 - the classes and then the total, which is the useful one + static const QRegularExpression paxRe(R"(\bPAX/[0-9/]*\s*TTL\s+(\d{1,3}))"); + const QRegularExpressionMatch pax = paxRe.match(text); + if (pax.hasMatch()) { + m_passengers = pax.captured(1).toInt(); + } + + static const QRegularExpression macZfwRe(R"(\bMACZFW\s+([0-9]+\.[0-9]))"); + const QRegularExpressionMatch macZfw = macZfwRe.match(text); + if (macZfw.hasMatch()) { + m_macZeroFuel = macZfw.captured(1).toFloat(); + } + static const QRegularExpression macTowRe(R"(\bMACTOW\s+([0-9]+\.[0-9]))"); + const QRegularExpressionMatch macTow = macTowRe.match(text); + if (macTow.hasMatch()) { + m_macTakeoff = macTow.captured(1).toFloat(); + } + + // The route line, which is three letter airports and the registration without its + // dash - "VLC LHR GEUPG 2/4". Anchored to a line of its own so that three capitals + // in the free text at the bottom cannot be mistaken for it. + static const QRegularExpression routeRe( + R"((?:^|\n)\s*([A-Z]{3})\s+([A-Z]{3})\s+([A-Z0-9]{5,7})\b)"); + const QRegularExpressionMatch route = routeRe.match(text); + if (route.hasMatch()) + { + m_from = route.captured(1); + m_to = route.captured(2); + m_registration = route.captured(3); + } + + return true; +} + +QString AcarsLoadsheet::toString() +{ + QStringList lines; + lines.append(QString("<b>Loadsheet:</b> %1").arg(m_final ? "final" : "preliminary")); + if (!m_from.isEmpty() && !m_to.isEmpty()) { + lines.append(QString("<b>Route:</b> %1 to %2").arg(m_from).arg(m_to)); + } + if (!m_registration.isEmpty()) { + lines.append(QString("<b>Registration:</b> %1").arg(m_registration)); + } + + // Each with its limit where the sheet gave one, since the margin is the point of it + auto weightLine = [&lines](const char *what, int value, int maximum) + { + if (value < 0) { + return; + } + if (maximum > 0) { + lines.append(QString("<b>%1:</b> %2 (max %3)").arg(what).arg(value).arg(maximum)); + } else { + lines.append(QString("<b>%1:</b> %2").arg(what).arg(value)); + } + }; + weightLine("Zero fuel weight", m_zeroFuelWeight, m_zeroFuelWeightMax); + weightLine("Take off weight", m_takeoffWeight, m_takeoffWeightMax); + weightLine("Landing weight", m_landingWeight, m_landingWeightMax); + weightLine("Take off fuel", m_takeoffFuel, -1); + weightLine("Trip fuel", m_tripFuel, -1); + weightLine("Underload", m_underload, -1); + if (m_passengers >= 0) { + lines.append(QString("<b>Passengers:</b> %1").arg(m_passengers)); + } + if (m_macZeroFuel >= 0.0f) { + lines.append(QString("<b>MAC zero fuel:</b> %1%").arg(m_macZeroFuel, 0, 'f', 1)); + } + if (m_macTakeoff >= 0.0f) { + lines.append(QString("<b>MAC take off:</b> %1%").arg(m_macTakeoff, 0, 'f', 1)); + } + + // The sheet itself after the summary: it carries the crew, the baggage and the + // remarks, none of which is worth a field of its own but all of which is worth reading + lines.append(QString()); + lines.append(m_text); + return lines.join("<br>"); +} + +AcarsMessage *AcarsMessage::decode(const QByteArray &message, const QString &label, const QString &text, bool uplink) +{ + AcarsMessage *acarsMessage; + // Before the label dispatch: a loadsheet arrives under whatever label the airline + // uses for it - 10 and 30 have both been seen - so its content is what identifies it + // "173442,19231,2010, 23200,N 51.892,..." - see decodeCompanyPosition() + static const QRegularExpression poxOrCompanyPosition( + R"RX(^\d{6},\s*\d+,\d{4},[- \d]+,[NS][ \d.]+,[EW][ \d.]+,)RX"); + if (text.contains("LOADSHEET")) { + acarsMessage = new AcarsLoadsheet(message); + } else if (AcarsDepartureClearanceResponse::isPlainLanguage(text)) { + // Chosen on the text, because the plain language clearance turns up under at + // least five labels - RA, C1, 21, 4P and 3T were all seen in one week of real + // traffic - and under none of the two the coded dialects use. + acarsMessage = new AcarsDepartureClearanceResponse(message); + } else if (label == "H2") { + acarsMessage = new AcarsMeteorologicalReport(message); + } else if (label == "SA") { + acarsMessage = new AcarsMediaAdvisory(message); + } else if (label == ":;") { + acarsMessage = new AcarsDataTransceiverAutoTune(message); + } else if (label == "52") { + acarsMessage = new AcarsGroundUTCRequest(message); + } else if (label == "5U") { + acarsMessage = new AcarsWeatherRequest(message); + } else if ((label == "10") || (label == "12") || (label == "22") || (label == "24") || (label == "44") + // Airline formats that carry a position under a label registered as + // something else entirely - see decodeAirlinePosition(). Each of these + // labels carries other traffic too, and a text that is not one of the + // formats simply falls through to being shown as it came. + || (label == "11") || (label == "21") || (label == "36") || (label == "45") + || (label == "8H") || (label == "4N") || (label == "32") + || (label == "83") || (label == "30")) { + acarsMessage = new AcarsPositionReport(message); + } else if (label == "80") { + acarsMessage = new AcarsOpsReport(message); + } else if (((label == "17") || (label == "49")) && text.contains("01CLER")) { + // The cruise report, which names both airports - see decodeCruiseReport(). Label + // 49 is not otherwise decoded at all, and 17's other traffic is handled below. + acarsMessage = new AcarsPositionReport(message); + } else if ((label == "17") && poxOrCompanyPosition.match(text).hasMatch()) { + // Label 17 carries a company position report as well as event reports, and is + // chosen on the text for the same reason label 18 is just below + acarsMessage = new AcarsPositionReport(message); + } else if ((label == "18") && text.startsWith("POX,")) { + // Label 18 carries an airline position report as well as event reports, so it is + // chosen on the text - as labels 15 and 16 already are. Filed as an event it was + // titled "OOOI" in the documents while carrying no OOOI time at all, and its + // position, route and level were all discarded. + acarsMessage = new AcarsPositionReport(message); + } else if ((label == "8E") || (label == "8S")) { + // The destination and ETA form - see AcarsEventReport::decode() + acarsMessage = new AcarsEventReport(message); + } else if ((label == "13") || (label == "14") || (label == "17") || (label == "18")) { + acarsMessage = new AcarsEventReport(message); + } else if (label == "15") { + // Label 15 carries both FST01 flight status and /15 ON EVENT landing reports + if (text.startsWith("/15")) { + acarsMessage = new AcarsEventReport(message); + } else { + acarsMessage = new AcarsFlightStatus(message); + } + } else if (label == "16") { + // Label 16 carries both N space position reports and /16 IN EVENT gate reports + if (text.startsWith("/16")) { + acarsMessage = new AcarsEventReport(message); + } else { + acarsMessage = new AcarsPositionReport(message); + } + } else if (label == "A0") { + acarsMessage = new AcarsATSFacilitiesNotification(message); + } else if (label == "A1") { + acarsMessage = new AcarsOceanicClearanceResponse(message); + } else if ((label == "A3") || (label == "B4")) { + // A3 delivers the clearance, B4 reads it back, and both carry the same text + acarsMessage = new AcarsDepartureClearanceResponse(message); + } else if (label == "A4") { + acarsMessage = new AcarsFlightSystemsMessage(message); + } else if (label == "A9") { + acarsMessage = new AcarsATISReport(message); + } else if (label == "B0") { + acarsMessage = new AcarsATSFacilitiesNotification(message); + } else if (label == "B1") { + acarsMessage = new AcarsRequestOceanicClearance(message); + } else if (label == "B2") { + acarsMessage = new AcarsOceanicClearanceReadback(message); + } else if (label == "B9") { + acarsMessage = new AcarsRequestATISReport(message); + } else if (label == "AA") { + acarsMessage = new AcarsATCCommunications(message); + } else if (label == "BA") { + acarsMessage = new AcarsATCCommunications(message); + } else if (label == "H1") { + acarsMessage = new AcarsMessageFromSubsystem(message); + } else if (label == "QP") { + acarsMessage = new AcarsOutReport(message); + } else if (label == "QQ") { + acarsMessage = new AcarsOffReport(message); + } else if (label == "QR") { + acarsMessage = new AcarsOnReport(message); + } else if (label == "QS") { + acarsMessage = new AcarsInReport(message); + } else if (label == "QT") { + acarsMessage = new AcarsOutReturnInReport(message); + } else if ((label == "QA") || (label == "QB") || (label == "QD") || (label == "QE") + || (label == "QF") || (label == "QG") || (label == "Q1")) { + // The three character station form of the movement reports - see the note on + // AcarsShortOooiReport. QP to QT above are the four character ARINC 620 form. + acarsMessage = new AcarsShortOooiReport(message); + } else if (label == "SQ") { + acarsMessage = new AcarsSquitter(message); + } else { + acarsMessage = new AcarsMessage(message); + } + acarsMessage->decode(text); + return acarsMessage; +} + +// Block ID is 0-9 for downlink and A-Z for uplink +bool AcarsMessage::isUplink(QChar blockId) +{ + return !blockId.isDigit(); +} + +AcarsDataTransceiverAutoTune::AcarsDataTransceiverAutoTune(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsDataTransceiverAutoTune::decode(const QString &text) +{ + if (text.size() == 6) + { + m_frequencyHz = text.toInt() * 1000; + m_precision = 3; + return true; + } + else if (text.size() == 9) + { + m_frequencyHz = text.toInt(); + m_precision = 6; + return true; + } + else + { + qDebug() << "AcarsDataTransceiverAutoTune: Can't decode: " << text; + m_frequencyHz = -1; + m_precision = 0; + return false; + } +} + +QString AcarsDataTransceiverAutoTune::toString() +{ + if (m_frequencyHz != -1) { + return QString("<b>Tune to:</b> %1MHz").arg(m_frequencyHz/1000000.0, 0, 'f', m_precision); + } else { + return ""; + } +} + +AcarsGroundUTCRequest::AcarsGroundUTCRequest(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsGroundUTCRequest::decode(const QString &text) +{ + if (m_uplink) + { + QRegularExpression re(R"((\d\d)(\d\d)(\d\d)(\d)(\d\d)(\d\d)(\d\d))"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_date = QDate(match.captured(1).toInt() + 2000, match.captured(2).toInt(), match.captured(3).toInt()); + m_day = match.captured(4).toInt(); + m_time = QTime(match.captured(5).toInt(), match.captured(6).toInt(), match.captured(7).toInt()); + return true; + } + else + { + qDebug() << "AcarsGroundUTCRequest: Failed to match " << text; + return false; + } + } + else + { + return true; + } +} + +QString AcarsGroundUTCRequest::toString() +{ + if (m_uplink && m_date.isValid() && m_time.isValid()) + { + const QStringList days = {"", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; + return QString("<b>UTC:</b> %1 %2 %3") + .arg(m_date.toString("yyyy-MM-dd")) + .arg(((m_day >= 0) && (m_day < days.size())) ? days[m_day] : QString::number(m_day)) + .arg(m_time.toString()); + } + else + { + return ""; + } +} + +// See Table C-2 in Appendix C of ARINC 623 +AcarsOceanicClearanceResponse::AcarsOceanicClearanceResponse(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsOceanicClearanceResponse::decode(const QString &text) +{ + // \r\n not always positioned as spec, so just replace with spaces + QRegularExpression re(R"(CLX (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) CLRNCE (\d\d\d) (\w*) CLRD TO (\w\w\w\w) VIA (\w*) (\w* \w*) ([A-Za-z0-9/ ]*)FM (\w*)\/(\d\d)(\d\d) MNTN F(\d\d\d) M(\d\d\d))"); + QRegularExpressionMatch match = re.match(text.simplified()); + if (match.hasMatch()) + { + m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); + m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); + m_atcCenter = match.captured(6); + m_clearanceNumber = match.captured(7).toInt(); + m_aircraft = match.captured(8); + m_destination = match.captured(9); + m_via = match.captured(10); + m_routeId = match.captured(11); + m_route = match.captured(12).simplified(); + m_entryPoint = match.captured(13); + m_entryTime = QTime(match.captured(14).toInt(), match.captured(15).toInt()); + m_flightLevel = match.captured(16).toInt(); + m_mach = match.captured(17).toInt() / 100.0f; + + // TODO: ATC RECLEARANCE + +/* if (match.lastCapturedIndex() >= 9) { + m_freeText = match.captured(9).trimmed(); + }*/ + return true; + } + else + { + qDebug() << "AcarsOceanicClearanceReadback: Failed to match " << text; + return false; + } +} + +QString AcarsOceanicClearanceResponse::toString() +{ + if (m_messageTime.isValid()) + { + QString s = QString("<b>Time:</b> %1<br><b>Date:</b> %2<br><b>ATC center:</b> %3<br><b>Clearance number:</b> %4<br><b>Aircraft:</b> %5<br><b>Destination:</b> %6<br><b>Via:</b> %7<br><b>Route Id:</b> %8<br><b>Route:</b> %9<br><b>Entry point:</b> %10<br><b>Entry time:</b> %11<br><b>Flight level:</b> %12<br><b>Mach:</b> %13") + .arg(m_messageTime.toString("hh:mm")) + .arg(m_messageDate.toString()) + .arg(icaoAndAirportName(m_atcCenter)) + .arg(m_clearanceNumber) + .arg(m_aircraft) + .arg(icaoAndAirportName(m_destination)) + .arg(m_via) + .arg(m_routeId) + .arg(m_route) + .arg(m_entryPoint) + .arg(m_entryTime.toString("hh:mm")) + .arg(m_flightLevel) + .arg(m_mach) + ; + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; + } + else + { + return ""; + } +} + +// See Table D-2 in Appendix D of ARINC 623 +AcarsDepartureClearanceResponse::AcarsDepartureClearanceResponse(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// The heading is the only thing the plain language dialects share, and even that is +// written four ways. Static because decode() is not the only caller - the dispatch has to +// choose this class on the text, the labels being no guide. +bool AcarsDepartureClearanceResponse::isPlainLanguage(const QString &text) +{ + const QString flat = text.simplified(); + return flat.contains("PRE-DEPARTURE CLEARANCE") // also *PRE-DEPARTURE CLEARANCE* + || flat.contains("PRE-DEPARTURE ATC CLEARANCE") + || flat.contains("**DEPARTURE CLEARANCE**") + || flat.contains("NO DEPARTURE CLEARANCE"); // the refusal +} + +bool AcarsDepartureClearanceResponse::decode(const QString &text) +{ + // A pre departure clearance, on label A3 where it is delivered and B4 where it is + // read back. Two dialects share one core: North America writes CLD and a departure + // time type, Europe writes CDA and gives an initial altitude, a TSAT, a QNH and the + // frequency to call. So the core is matched first and each of the trailing items is + // then looked for on its own - a single regex over the lot matched neither dialect + // reliably, and one missing field threw the whole clearance away. + // + // CLD 1442 260829 LSZH PDC 256 SWR3EC CLRD TO LICJ OFF 28 VIA VEBIT1Y + // ALT 5000 FT SQUAWK 1000 ATIS P AIRBORNE FREQ 125.955 TSAT 1500 + // + // \r\n is not always where the spec says, so the text is flattened to spaces first. + const QString flat = text.simplified(); + + // The third family, and the one that says the most: rather than a coded line, North + // American and Canadian airports send the clearance as plain language. There is no + // single format - four dialects were seen in one week of real traffic - so each field + // is looked for on its own and a missing one costs only itself. + // + // PRE-DEPARTURE CLEARANCE PRE-DEPARTURE ATC CLEARANCE + // SKW5371 DEPART ORD 1745Z WJA228 DEPART YYC AT 1825Z FL 390 + // FL 150 CRJ2/L XPNDR 7263 M/B737/W TRANSPONDER 3330 + // ROUTE KORD PMPKN NEATO DLLAN KGRB ROUTE: + // CLEARED ORD9 DEPARTURE NOSIV Q909 DESNU VINBU SEGAP BEFAN5 + // REMARKS: + // **DEPARTURE CLEARANCE** USE SID CWBOY2 + // FLT 1357-30 KSEA-KSNA DEPARTURE RUNWAY 35R + // ASA1357 KSEA DESTINATION CYWG + // B738/L P1828 + // REQUESTED FL 370 *PRE-DEPARTURE CLEARANCE* + // XPDR 1525 FLT ACA025 CYVR + // ***FILED ROUTE*** H/B789/W FILED FL320 + // KSEA SUMMA2 SUMMA Q9 REBRG OHSEA3 KSNA XPRD 7017 + // ***ADDL INSTRUCTIONS*** USE SID FSR9 + // CLEARED SUMMA2 DEPARTURE DEPARTURE RUNWAY 08R + // + // Worth having for the route alone: where it runs between two airports it can be + // drawn, and the coded dialects give only the SID. + if (isPlainLanguage(text)) + { + m_text = text; + m_plainLanguage = true; + + // A refusal is a departure clearance response too, and showing it is the point - + // it tells the crew to call. But it names no route, so it is marked so that + // nothing downstream tries to draw one. + if (flat.contains("NO DEPARTURE CLEARANCE")) + { + m_clearanceAvailable = false; + m_freeText = flat; + return true; + } + + // "SKW5371 DEPART ORD 1745Z" and "WJA228 DEPART YYC AT 1825Z". The airport is + // three letter IATA as often as four letter ICAO. + static const QRegularExpression departRe( + R"((\S+) DEPART (?:FROM )?([A-Z]{3,4})(?: AT)? (\d{4})Z)"); + const QRegularExpressionMatch depart = departRe.match(flat); + if (depart.hasMatch()) + { + m_flight = depart.captured(1); + m_departureAirport = depart.captured(2); + m_departureTime = depart.captured(3); + m_departureTimeType = "DEPART"; + } + + // "FLT 1357-30 KSEA-KSNA" names both ends outright + static const QRegularExpression sectorRe( + R"(\bFLT\s+\S+\s+([A-Z]{4})-([A-Z]{4})\b)"); + const QRegularExpressionMatch sector = sectorRe.match(flat); + if (sector.hasMatch()) + { + m_departureAirport = sector.captured(1); + m_destination = sector.captured(2); + } + if (m_flight.isEmpty()) + { + // "FLT ACA025 CYVR", then the Alaska form, where the callsign simply + // precedes the departure airport on a line of its own + static const QRegularExpression fltRe(R"(\bFLT\s+([A-Z]{2,3}\d{1,4})\b)"); + static const QRegularExpression callsignRe(R"(\b([A-Z]{3}\d{1,4})\s+[A-Z]{4}\b)"); + const QRegularExpressionMatch flt = fltRe.match(flat); + const QRegularExpressionMatch callsign = callsignRe.match(flat); + if (flt.hasMatch()) { + m_flight = flt.captured(1); + } else if (callsign.hasMatch()) { + m_flight = callsign.captured(1); + } + } + if (m_departureAirport.isEmpty()) + { + static const QRegularExpression fltFromRe(R"(\bFLT\s+\S+\s+([A-Z]{4})\b)"); + const QRegularExpressionMatch fltFrom = fltFromRe.match(flat); + if (fltFrom.hasMatch()) { + m_departureAirport = fltFrom.captured(1); + } + } + + // "FL 150", "FILED FL320" and "REQUESTED FL 370" - the space is optional + static const QRegularExpression levelRe(R"(\bFL\s*(\d{2,3})\b)"); + const QRegularExpressionMatch level = levelRe.match(flat); + if (level.hasMatch()) { + m_initialAltitudeFt = level.captured(1).toInt() * 100; + } + + // The type and its equipment suffix: CRJ2/L, B738/L, and with a weight category + // in front of it M/B737/W and H/B789/W + static const QRegularExpression typeRe( + R"(\b((?:[A-Z]/)?[A-Z][A-Z0-9]{2,4}/[A-Z])\b)"); + const QRegularExpressionMatch type = typeRe.match(flat); + if (type.hasMatch()) { + m_aircraftType = type.captured(1); + } + + // Four spellings of the same field, all seen in one week + static const QRegularExpression squawkRe( + R"(\b(?:XPNDR|XPDR|XPRD|TRANSPONDER|SQUAWK|BCN)\s+(\d{4})\b)"); + const QRegularExpressionMatch squawk = squawkRe.match(flat); + if (squawk.hasMatch()) { + m_squawk = squawk.captured(1); + } + + // The route runs from the ROUTE heading to whatever announces the next section. + // It wraps across lines, which simplified() has already turned into single + // spaces. @PBN is not a section heading but an equipment note appended to the + // route itself, and must not be drawn. + static const QRegularExpression routeRe( + R"(\bROUTE\**:?\s+(.*?)\s*(?:\*\*\*|CLEARED\b|CLIMB\b|MAINTAIN\b|EXPECT\b|REMARKS\b|USE SID\b|DEPARTURE RUNWAY\b|DESTINATION\b|DPFRQ\b|CTC\b|@PBN|\*END-PDC|$))"); + const QRegularExpressionMatch route = routeRe.match(flat); + if (route.hasMatch()) + { + m_route = route.captured(1).simplified(); + + // An amended clearance writes the changed segment in dashes and then the + // whole route after it: + // + // ROUTE -MOBLE ADIME SEWTO KFWA- + // KORD MOBLE ADIME SEWTO FWA KFWA + // + // The segment is a subset of what follows, so keeping both would draw those + // fixes twice and hide the airports at the ends. 14 of 256 route-carrying + // clearances in a week of real traffic are written this way, on two + // different labels. + static const QRegularExpression amendedRe(R"(^-[^-]*-\s*(\S.*)$)"); + const QRegularExpressionMatch amended = amendedRe.match(m_route); + if (amended.hasMatch()) { + m_route = amended.captured(1); + } + + // Where both ends are airports, that is what it is flown between + static const QRegularExpression endsRe(R"(^([A-Z]{4})\b.*\b([A-Z]{4})$)"); + const QRegularExpressionMatch ends = endsRe.match(m_route); + if (ends.hasMatch()) + { + m_departureAirport = ends.captured(1); + m_destination = ends.captured(2); + } + } + + // "CLEARED ORD9 DEPARTURE" and "USE SID FSR9" + static const QRegularExpression clearedSidRe( + R"(\bCLEARED\s+(\S+)\s+DEPARTURE\b)"); + static const QRegularExpression useSidRe(R"(\bUSE SID\s+(\S+))"); + const QRegularExpressionMatch clearedSid = clearedSidRe.match(flat); + const QRegularExpressionMatch useSid = useSidRe.match(flat); + if (clearedSid.hasMatch()) { + m_sid = clearedSid.captured(1); + } else if (useSid.hasMatch()) { + m_sid = useSid.captured(1); + } + + static const QRegularExpression runwayRe(R"(\bDEPARTURE RUNWAY\s+(\S+))"); + const QRegularExpressionMatch runway = runwayRe.match(flat); + if (runway.hasMatch()) { + m_runway = stripRunwayFiller(runway.captured(1)); + } + + // Stated outright, so it beats whatever the ends of the route suggested - the + // dialect that writes this one is also the one whose route is a list of fixes + // with no airport at either end. + static const QRegularExpression destRe(R"(\bDESTINATION\s+([A-Z]{4})\b)"); + const QRegularExpressionMatch dest = destRe.match(flat); + if (dest.hasMatch()) { + m_destination = dest.captured(1); + } + + // Whichever end was written in IATA becomes ICAO, so that one clearance cannot + // hand the map a three letter code and the next a four letter one + const QString depIcao = icaoFromIata(m_departureAirport); + if (!depIcao.isEmpty()) { + m_departureAirport = depIcao; + } + const QString destIcao = icaoFromIata(m_destination); + if (!destIcao.isEmpty()) { + m_destination = destIcao; + } + + return true; + } + + static const QRegularExpression coreRe( + R"((?:CLD|CDA) (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w{4}) PDC (\d+) (\S+) CLRD TO (\w{4}) OFF (\S+) VIA (\S+))"); + const QRegularExpressionMatch match = coreRe.match(flat); + if (!match.hasMatch()) + { + // These labels carry other traffic, so not matching is ordinary. The caller + // shows the text as it came. + return false; + } + + m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); + m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); + m_departureAirport = match.captured(6); + m_clearanceNumber = match.captured(7).toInt(); + m_flight = match.captured(8); + m_destination = match.captured(9); + m_runway = match.captured(10); + m_sid = match.captured(11); + + // Everything the core did not take. Each item is removed from the tail as it is + // recognised, so that what is left over really is free text - taking the tail whole + // showed the altitude, squawk and frequency twice, once parsed and once raw. + QString tail = flat.mid(match.capturedEnd(0)); + auto scavenge = [&tail](const char *pattern, QString& into) + { + const QRegularExpression re(pattern); + const QRegularExpressionMatch m = re.match(tail); + if (m.hasMatch()) + { + into = m.captured(1); + tail.remove(m.capturedStart(0), m.capturedLength(0)); + } + }; + scavenge(R"(SQUAWK (\d{4}))", m_squawk); + scavenge(R"(ATIS (\w)\b)", m_atis); + scavenge(R"(TSAT (\d{4}))", m_tsat); + scavenge(R"(QNH (\d{3,4}))", m_qnh); + scavenge(R"((?:AIRBORNE|NEXT|CONTACT) FREQ (\d+\.\d+))", m_frequency); + + QString altitude; + // "ALT 5000 FT" and "CLIMB TO 4000 FT" are the same thing said two ways + scavenge(R"((?:ALT|CLIMB TO) (\d+) ?FT)", altitude); + if (!altitude.isEmpty()) { + m_initialAltitudeFt = altitude.toInt(); + } + + // The departure time comes with its type, so the two are taken together + { + static const QRegularExpression re(R"(\b(ADT|MDI) (\S+))"); + const QRegularExpressionMatch m = re.match(tail); + if (m.hasMatch()) + { + m_departureTimeType = m.captured(1); + m_departureTime = m.captured(2); + tail.remove(m.capturedStart(0), m.capturedLength(0)); + } + } + + // What an airport adds in its own words - "WITHIN TOBT +-5MIN", "REPORT READY" + m_freeText = tail.simplified(); + return true; +} + +QString AcarsDepartureClearanceResponse::toString() +{ + if (!m_messageTime.isValid() && !m_plainLanguage) { + return ""; + } + + // Only what the clearance actually said. Printed unconditionally, the fields the + // other dialect does not use came out as empty headings - "Departure time:" with + // nothing after it on every European clearance. The plain language dialects carry no + // message time or clearance number at all, so those two go the same way; keying the + // whole function on the time is what left them printing nothing whatsoever. + QStringList lines; + if (m_messageTime.isValid()) + { + lines.append(QString("<b>Time:</b> %1").arg(m_messageTime.toString("hh:mm"))); + lines.append(QString("<b>Date:</b> %1").arg(m_messageDate.toString())); + } + if (!m_clearanceAvailable) { + lines.append("<b>Clearance:</b> none on file, contact clearance delivery by voice"); + } + if (!m_departureAirport.isEmpty()) { + lines.append(QString("<b>Departure airport:</b> %1").arg(icaoAndAirportName(m_departureAirport))); + } + if (m_clearanceNumber > 0) { + lines.append(QString("<b>Clearance number:</b> %1").arg(m_clearanceNumber)); + } + if (!m_flight.isEmpty()) { + lines.append(QString("<b>Flight:</b> %1").arg(m_flight)); + } + if (!m_destination.isEmpty()) { + lines.append(QString("<b>Destination:</b> %1").arg(icaoAndAirportName(m_destination))); + } + if (!m_aircraftType.isEmpty()) { + lines.append(QString("<b>Aircraft type:</b> %1").arg(m_aircraftType)); + } + if (!m_runway.isEmpty()) { + lines.append(QString("<b>Runway:</b> %1").arg(m_runway)); + } + if (!m_sid.isEmpty()) { + lines.append(QString("<b>SID:</b> %1").arg(m_sid)); + } + if (!m_route.isEmpty()) { + lines.append(QString("<b>Route:</b> %1").arg(m_route)); + } + if (m_initialAltitudeFt >= 0) { + lines.append(QString("<b>Initial altitude:</b> %1 ft").arg(m_initialAltitudeFt)); + } + if (!m_squawk.isEmpty()) { + lines.append(QString("<b>Squawk:</b> %1").arg(m_squawk)); + } + if (!m_departureTime.isEmpty()) { + lines.append(QString("<b>Departure time:</b> %1 %2").arg(m_departureTimeType).arg(m_departureTime)); + } + if (!m_tsat.isEmpty()) { + lines.append(QString("<b>TSAT:</b> %1").arg(m_tsat)); + } + if (!m_atis.isEmpty()) { + lines.append(QString("<b>ATIS:</b> %1").arg(m_atis)); + } + if (!m_qnh.isEmpty()) { + lines.append(QString("<b>QNH:</b> %1").arg(m_qnh)); + } + if (!m_frequency.isEmpty()) { + lines.append(QString("<b>Frequency:</b> %1 MHz").arg(m_frequency)); + } + if (!m_freeText.isEmpty()) { + lines.append(QString("<b>Free text:</b> %1").arg(m_freeText)); + } + return lines.join("<br>"); +} + +// See Attachment 9 in ARINC 623 +AcarsFlightSystemsMessage::AcarsFlightSystemsMessage(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsFlightSystemsMessage::decode(const QString &text) +{ + QRegularExpression re(R"(FSM (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) (\w*) ([\w\s]*)?)"); + QRegularExpressionMatch match = re.match(text.simplified()); + if (match.hasMatch()) + { + m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); + m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); + m_departureAirport = match.captured(6); + m_flight = match.captured(7); + if (match.lastCapturedIndex() >= 8) { + m_freeText = match.captured(8).trimmed(); // Sometimes last 4 digits are CRC, but not always + } + return true; + } + else + { + qDebug() << "AcarsFlightSystemsMessage: Failed to match " << text; + return false; + } +} + +QString AcarsFlightSystemsMessage::toString() +{ + QString s; + if (m_messageTime.isValid()) + { + s.append(QString("<b>Time %1<br><b>Date:</b> %2<br><b>Departure airport:</b> %3<br><b>Flight:</b> %4") + .arg(m_messageTime.toString("hh:mm")) + .arg(m_messageDate.toString()) + .arg(icaoAndAirportName(m_departureAirport)) + .arg(m_flight)); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + } + return s; +} + +// Appendix B in ARINC 623 +AcarsATISReport::AcarsATISReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsATISReport::decode(const QString &text) +{ + QRegularExpression re(R"(TI2\/(\w\w\w\w)\s+(\w\w\w)\s+ATIS\s+(\w)\s+(\d\d)(\d\d)Z\s+([\s\S]*))"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_airport = match.captured(1); + m_indicator = match.captured(2); + m_atisId = match.captured(3); + m_time = QTime(match.captured(4).toInt(), match.captured(5).toInt()); + m_atisInformation = match.captured(6); + return true; + } + else + { + qDebug() << "AcarsATISReport: Failed to match " << text; + return false; + } +} + +QString AcarsATISReport::toString() +{ + if (!m_airport.isEmpty()) + { + // These are the only 3 in ARINC 623, but EGKK uses COM + const QHash<QString, QString> indicators = { + {"ARR", "Arrival"}, + {"DEP", "Departure"}, + {"ENR", "Enroute/VOLMET"} + }; + QString indicator = m_indicator; + if (indicators.contains(indicator)) { + indicator = indicators[indicator]; + } + QString s = QString("<b>Airport:</b> %1<br><b>Arrival/departure indicator:</b> %2<br><b>ATIS Id:</b> %3<br><b>Time:</b> %4") + .arg(icaoAndAirportName(m_airport)) + .arg(indicator) + .arg(m_atisId) + .arg(m_time.toString("hh:mm")); + s.append("\n"); + s.append(m_atisInformation); + if (m_multiBlock) + { + s.append(""); + } + return s; + } + else + { + return ""; + } +} + +// See section 3 in ARINC 622 +AcarsATSFacilitiesNotification::AcarsATSFacilitiesNotification(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsATSFacilitiesNotification::decode(const QString &text) +{ + QRegularExpression re(R"(\/(\w*)\.AFN\/FMH(\w*),([\.\-\w]*),(\w*)(,(\d\d)(\d\d)(\d\d))?)"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_atcCenter = match.captured(1); + m_flight = match.captured(2); + m_aircraftRegistration = match.captured(3); + while (m_aircraftRegistration.startsWith(".")) { + m_aircraftRegistration = m_aircraftRegistration.mid(1); // Remove prefix + } + m_aircraftICAO = match.captured(4); // 24-bit ICAO hex id + if (match.lastCapturedIndex() >= 7) { + m_time = QTime(match.captured(5).toInt(), match.captured(6).toInt(), match.captured(7).toInt()); + } + + int offset = match.capturedStart(0) + match.captured(0).length() + 1; // Skip matched string and / + m_mti = text.mid(offset, 3); + return true; + } + else + { + qDebug() << "AcarsATSFacilitiesNotification: Failed to match " << text; + return false; + } +} + +QString AcarsATSFacilitiesNotification::toString() +{ + QString s = QString("<b>ATC center:</b> %1<br><b>Flight:</b> %2<br><b>Aircraft:</b> %3") + .arg(icaoAndAirportName(m_atcCenter)) + .arg(m_flight) + .arg(m_aircraftRegistration); + if (!m_aircraftICAO.isEmpty()) { + s.append(QString("<br><b>Aircraft ICAO:</b> %1").arg(m_aircraftICAO)); + } + if (m_time.isValid()) { + s.append(QString("<br><b>Time:</b> %1").arg(m_time.toString("hh:mm:ss"))); + } + if (!m_mti.isEmpty()) + { + const QHash<QString, QString> mtis = { + {"FPO", "AFN contact"}, + {"FAK", "AFN acknowledge"}, + {"FCA", "AFN contact advisory"}, + {"FRP", "AFN response"}, + {"FCP", "AFN complete"}, + }; + s.append(QString("<br><b>MTI:</b> %1 (%2)").arg(m_mti).arg(mtis[m_mti])); + } + return s; +} + +AcarsRequestOceanicClearance::AcarsRequestOceanicClearance(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsRequestOceanicClearance::decode(const QString &text) +{ + // Mostly start OC1/RCL, but occasionally just RCL + QRegularExpression re(R"(RCL (\d\d\d)\ ([\w ]*)-([\w ]*)\/(\d\d)(\d\d) M(\d\d\d)F(\d\d\d)( -RMK\/(.*))?)"); + QRegularExpressionMatch match = re.match(text.simplified()); + if (match.hasMatch()) + { + m_avionicsIndicator = match.captured(1); + m_aircraft = match.captured(2); + m_entryPoint = match.captured(3); + m_entryTime = QTime(match.captured(4).toInt(), match.captured(5).toInt()); + m_mach = match.captured(6).toInt() / 100.0f; + m_flightLevel = match.captured(7).toInt(); + if (match.lastCapturedIndex() >= 9) { + m_freeText = match.captured(9).trimmed(); + } + return true; + } + else + { + qDebug() << "AcarsRequestOceanicClearance: Failed to match " << text; + return false; + } +} + +QString AcarsRequestOceanicClearance::toString() +{ + QString s = QString("<b>Avionics rows:</b> %1<br><b>Aircraft:</b> %2<br><b>Entry point:</b> %3<br><b>Time:</b> %4<br><b>Mach:</b> %5<br><b>Flight level:</b> %6") + .arg(m_avionicsIndicator) + .arg(m_aircraft) + .arg(m_entryPoint) + .arg(m_entryTime.toString("hh:mm")) + .arg(m_mach, 0, 'f', 2) + .arg(m_flightLevel); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +AcarsOceanicClearanceReadback::AcarsOceanicClearanceReadback(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsOceanicClearanceReadback::decode(const QString &text) +{ + // \r<br><b> not always positioned as spec, so just replace with spaces + // Mostly messages start OC1/CLA, but occasionally just CLA + QRegularExpression re(R"(CLA (\d\d)(\d\d) (\d\d)(\d\d)(\d\d) (\w\w\w\w) CLRNCE (\d\d\d) (\w*) CLRD TO (\w\w\w\w) VIA (\w*) (\w* \w*) ([A-Za-z0-9/ ]*)FM (\w*)\/(\d\d)(\d\d) MNTN F(\d\d\d) M(\d\d\d))"); + QRegularExpressionMatch match = re.match(text.simplified()); + if (match.hasMatch()) + { + m_messageTime = QTime(match.captured(1).toInt(), match.captured(2).toInt()); + m_messageDate = QDate(match.captured(3).toInt() + 2000, match.captured(4).toInt(), match.captured(5).toInt()); + m_atcCenter = match.captured(6); + m_clearanceNumber = match.captured(7).toInt(); + m_aircraft = match.captured(8); + m_destination = match.captured(9); + m_via = match.captured(10); + m_routeId = match.captured(11); + m_route = match.captured(12).simplified(); + m_entryPoint = match.captured(13); + m_entryTime = QTime(match.captured(14).toInt(), match.captured(15).toInt()); + m_flightLevel = match.captured(16).toInt(); + m_mach = match.captured(17).toInt() / 100.0f; + + // TODO: ATC RECLEARANCE + +/* if (match.lastCapturedIndex() >= 9) { + m_freeText = match.captured(9).trimmed(); + }*/ + return true; + } + else + { + qDebug() << "AcarsOceanicClearanceReadback: Failed to match " << text; + return false; + } +} + +QString AcarsOceanicClearanceReadback::toString() +{ + QString s = QString("<b>Time:</b> %1<br><b>Date:</b> %2<br><b>ATC center:</b> %3<br><b>Clearance number:</b> %4<br><b>Aircraft:</b> %5<br><b>Destination:</b> %6<br><b>Via:</b> %7<br><b>Route Id:</b> %8<br><b>Route:</b> %9<br><b>Entry point:</b> %10<br><b>Entry time:</b> %11<br><b>Flight level:</b> %12<br><b>Mach:</b> %13") + .arg(m_messageTime.toString("hh:mm")) + .arg(m_messageDate.toString()) + .arg(icaoAndAirportName(m_atcCenter)) + .arg(m_clearanceNumber) + .arg(m_aircraft) + .arg(icaoAndAirportName(m_destination)) + .arg(m_via) + .arg(m_routeId) + .arg(m_route) + .arg(m_entryPoint) + .arg(m_entryTime.toString("hh:mm")) + .arg(m_flightLevel) + .arg(m_mach) + ; + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +AcarsRequestATISReport::AcarsRequestATISReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsRequestATISReport::decode(const QString &text) +{ + int imiIdx = text.indexOf("TI2/"); + if (imiIdx != -1) + { + m_avionicsIndicator = text.mid(imiIdx + 4, 3); + m_airport = text.mid(imiIdx + 7, 4).trimmed(); + m_arrivalDepartureIndicator = text.mid(imiIdx + 11, 1); + return true; + } + else if (!text.contains('/')) + { + m_avionicsIndicator = text.mid(0, 3); + m_airport = text.mid(3, 4).trimmed(); + m_arrivalDepartureIndicator = text.mid(7, 1); + return true; + } + else + { + qDebug() << "AcarsRequestATISReport: Failed to match " << text; + return false; + } +} + +QString AcarsRequestATISReport::toString() +{ + // C and T are a pair: C subscribes to arrival ATIS updates and T cancels that + // subscription, which is why T exists at all and why it is rare. + // + // Measured over 982 requests off air: A 797, C 121, D 24, T 4, E 1, across 146 + // airports. 117 of those airports only ever appear with one letter, and C is heavily + // Canadian - 26 of 26 at CYUL and 19 of 26 at CYYZ - so the automatic update service + // is evidently offered in some places and not others. + // + // Note none of these says whether the airport is where the flight is GOING. Arrival + // ATIS is requested for an alternate as readily as for a destination, which is why + // the airport here is not taken as a destination: of 710 A requests whose flight had + // a known route, 572 named the arrival but 118 named neither end of it. + static const QHash<QString, QString> indicators = { + {"A", "Arrival ATIS"}, + {"D", "Departure ATIS"}, + {"C", "Arrival with automatic update"}, + {"E", "Automatic enroute information service (AEIS) or VOLMET"}, + {"T", "Terminate automatic update of ATIS"} + }; + // The raw letter when it is not one of those, rather than an empty field: the set is + // not closed, and a letter says more than a blank + const QString type = indicators.contains(m_arrivalDepartureIndicator) + ? indicators.value(m_arrivalDepartureIndicator) + : m_arrivalDepartureIndicator; + return QString("<b>Avionics rows:</b> %1<br><b>Airport:</b> %2<br><b>Request type:</b> %3") + .arg(m_avionicsIndicator) + .arg(icaoAndAirportName(m_airport)) + .arg(type); +} + +AcarsWeatherRequest::AcarsWeatherRequest(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsWeatherRequest::decode(const QString &text) +{ + if (text.contains("WXRQ")) + { + // E.g: 01 WXRQ 47EZ/20 LGRP/EGGP .G-JZDE /TYP 1/STA EGGP/STA EGCC/STA EGNX + QRegularExpression staRe(R"(\/STA\s+([A-Z0-9]{4}))"); + QRegularExpressionMatchIterator it = staRe.globalMatch(text); + while (it.hasNext()) { + m_airports.append(it.next().captured(1)); + } + QRegularExpression typRe(R"(\/TYP\s+(\w+))"); + QRegularExpressionMatch typMatch = typRe.match(text); + if (typMatch.hasMatch()) { + m_reportType = typMatch.captured(1); + } + // Flight route and registration: LGRP/EGGP .G-JZDE + QRegularExpression routeRe(R"(([A-Z]{4})\/([A-Z]{4})\s+\.([A-Z0-9\-]+))"); + QRegularExpressionMatch routeMatch = routeRe.match(text); + if (routeMatch.hasMatch()) + { + m_origin = routeMatch.captured(1); + m_destination = routeMatch.captured(2); + m_registration = routeMatch.captured(3); + } + if (!m_airports.isEmpty()) { + return true; + } + } + else + { + // A list of airports and the MET report code wanted, which airlines write both + // ways round and separate with either spaces or commas: + // + // LFLL LFPG LFSG EGKK-SA the code last, after a dash + // EGNM EGCC EGNT -SA the same, with the columns padded out + // SA EGPH,EGPF,EGPK,EGCC the code first + // SA/EGCC EGNX EGBB EGGP the code first, after a slash + // SAEIDW,EINN,EGAA, the code first, run straight into the list + // BHX LPL NCL-SA three letter IATA, right aligned in four columns + // + // The trailing form is tried first because it is unambiguous. Leading it is not: + // the first two letters of EGKK are as good a match for a report code as SA is, + // so a leading code is only accepted when it is one that exists - which is what + // reportTypeNames() is for. + const QString simplified = text.simplified(); + QString list; + + static const QRegularExpression trailingRe(R"(^([A-Z0-9 ,]+?)\s*-\s*([A-Z]{2})$)"); + const QRegularExpressionMatch trailing = trailingRe.match(simplified); + if (trailing.hasMatch()) + { + list = trailing.captured(1); + m_reportType = trailing.captured(2); + } + else + { + static const QRegularExpression leadingRe(R"(^([A-Z]{2})[ /]?([A-Z0-9][A-Z0-9 ,]*)$)"); + const QRegularExpressionMatch leading = leadingRe.match(simplified); + if (leading.hasMatch() && reportTypeNames().contains(leading.captured(1))) + { + m_reportType = leading.captured(1); + list = leading.captured(2); + } + } + + if (!list.isEmpty()) + { + // Airports are four letter ICAO or three letter IATA, and a message may + // carry both. IATA is translated here so that everything downstream - the + // name in the decode, the Weather tab - only ever sees ICAO. + static const QRegularExpression separatorRe(R"([ ,]+)"); + const QStringList fields = list.split(separatorRe, Qt::SkipEmptyParts); + for (const QString &field : fields) + { + if (field.size() == 4) + { + m_airports.append(field); + } + else if (field.size() == 3) + { + // An IATA code that is not in the database is kept as it stands + // rather than dropped - it still says which airport was asked about + const QString icao = icaoFromIata(field); + m_airports.append(icao.isEmpty() ? field : icao); + } + // Anything else is a corrupted field. One airport arriving mangled is + // not a reason to lose the rest of the request, so it is skipped + } + if (!m_airports.isEmpty()) { + return true; + } + } + } + qDebug() << "AcarsWeatherRequest: Failed to match " << text; + return false; +} + +// WMO MET report type codes as used in ARINC 620 weather requests. Shared with decode(), +// which needs the set of them to tell a leading report code from an airport. +const QHash<QString, QString>& AcarsWeatherRequest::reportTypeNames() +{ + static const QHash<QString, QString> reportTypes = { + {"SA", "METAR"}, + {"SP", "SPECI"}, + {"FT", "TAF"}, + {"FC", "Short TAF"}, + {"FA", "Area forecast"}, + {"WS", "SIGMET"}, + {"NO", "NOTAM"} + }; + return reportTypes; +} + +QString AcarsWeatherRequest::toString() +{ + if (m_airports.isEmpty()) { + return ""; + } + const QHash<QString, QString>& reportTypes = reportTypeNames(); + QStringList lines; + if (!m_registration.isEmpty()) { + lines.append(QString("<b>Aircraft:</b> %1").arg(m_registration)); + } + if (!m_origin.isEmpty()) { + lines.append(QString("<b>Origin:</b> %1").arg(icaoAndAirportName(m_origin))); + } + if (!m_destination.isEmpty()) { + lines.append(QString("<b>Destination:</b> %1").arg(icaoAndAirportName(m_destination))); + } + if (!m_reportType.isEmpty()) + { + QString type = m_reportType; + if (reportTypes.contains(type)) { + type = QString("%1 (%2)").arg(reportTypes[type]).arg(m_reportType); + } + lines.append(QString("<b>Report type:</b> %1").arg(type)); + } + for (const QString &airport : m_airports) { + lines.append(QString("<b>Airport:</b> %1").arg(icaoAndAirportName(airport))); + } + return lines.join("<br>"); +} + +AcarsFlightStatus::AcarsFlightStatus(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// Flight status report, as used by British Airways on label 15. The format is not +// publicly documented; the field identification here is inferred from off-air +// messages and consistent with the examples at +// https://github.com/airframesio/acars-message-documentation/blob/main/research/15.md +// +// After FST01 come the departure and arrival airports and the position, then a +// fixed-width block - altitude in flight levels, fuel on board, fuel used and static +// air temperature - and finally wind, heading, track and ground speed. +// +// The position is NOT a fixed width. Latitude carries three or four decimal places +// (five or six digits) and longitude three or four (six or seven), and which is used +// varies by aircraft rather than by value, so trailing digits alone cannot say where +// the longitude ends. What pins it is the temperature: it always sits eleven +// characters past the position and is five characters ending in 'C', or five spaces +// when not reported. Only one longitude width puts it there. Across 54 off-air +// messages spanning three field layouts that resolved every one unambiguously. +// +// Assuming seven digits, as this did until 2026-08-26, shifts every field after the +// position one place left for the aircraft that send six. That read altitudes of +// 68000 and 77000 ft, fuel of 62.7 t on an E190 that cannot carry 13, and dropped the +// sign from the temperature - all from messages whose positions still looked right, +// which is why it went unnoticed. E.g. G-LCYJ out of London City: +// FST01EGLCLEIB N51057 E000313 168 0627 0081 M010C 023 223 203 201 352 1244 1037 +// FL168 6270kg 810kg -10C 23kt/223 hdg/trk 352kt +// +// The two layouts differ in more than the position width. The compact one zero-pads +// its fields, signs the temperature adjacently, and counts fuel in 10 kg; the padded +// one right-aligns in spaces and counts fuel in 100 kg. E.g: +// FST01EHAMEGLLN51659E0001153 92 30 19 23246 230 13431335 +// FST01KLAXEGLLN513366W0014766140 1691219 M10C025091098097344 14031345 +// the second being a 747 from Los Angeles reporting 121900 kg burnt, which only makes +// sense at 100 kg a count. +bool AcarsFlightStatus::decode(const QString &text) +{ + // Departure and arrival airports, then latitude and longitude as degrees with a + // variable number of decimal places + static const QRegularExpression re( + R"(^FST01([A-Z0-9]{4})([A-Z0-9]{4})([NS])(\d{4,6})([EW])(\d{6,}))"); + QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) + { + qDebug() << "AcarsFlightStatus: Failed to match " << text; + return false; + } + m_departureAirport = match.captured(1); + m_arrivalAirport = match.captured(2); + + // Everything from the hemisphere character on, which is where the offsets below + // are measured from + const QString body = text.mid(13); + const int latDigits = match.captured(4).size(); + + // Find the longitude width by looking for the temperature where each candidate + // would put it. Five spaces means the aircraft did not report one. + static const QRegularExpression tempRe(R"(^(\s{5}|\s*[MP]?\s*(\d{1,3})C)$)"); + int lonDigits = 0; + bool ambiguous = false; + for (int candidate = 6; candidate <= 7; candidate++) + { + const int width = 2 + latDigits + candidate; + if (body.size() < width + 16) { + continue; + } + if (tempRe.match(body.mid(width + 11, 5)).hasMatch()) + { + ambiguous = lonDigits != 0; + lonDigits = candidate; + } + } + + // The position itself is usable either way - the two candidates differ by metres - + // so report it even when the layout is unrecognised, but leave the fields whose + // meaning depends on the width unset rather than guess at them + const bool widthKnown = (lonDigits != 0) && !ambiguous; + if (!widthKnown) + { + qDebug() << "AcarsFlightStatus: Could not locate the field boundary in " << text; + lonDigits = 7; + } + + QString latDigitStr = match.captured(4); + m_latitude = (latDigitStr.left(2) + "." + latDigitStr.mid(2)).toFloat(); + if (match.captured(3) == "S") { + m_latitude = -m_latitude; + } + QString lonDigitStr = match.captured(6).left(lonDigits); + m_longitude = (lonDigitStr.left(3) + "." + lonDigitStr.mid(3)).toFloat(); + if (match.captured(5) == "W") { + m_longitude = -m_longitude; + } + m_positionValid = true; + if (!widthKnown) { + return true; + } + + // Fixed width fields: altitude in flight levels, then fuel on board and fuel used + const bool compact = (lonDigits == 6); + const int fuelUnitKg = compact ? 10 : 100; + QString rest = body.mid(2 + latDigits + lonDigits); + auto takeField = [&rest](int width) + { + QString field = rest.left(width).trimmed(); + rest = rest.mid(width); + return field; + }; + bool ok; + int value = takeField(3).toInt(&ok); + // Guard against a layout we have not seen putting something else here. No airliner + // sending these reports cruises above FL430 + if (ok && (value * 100 <= ACARS_MAX_REPORTED_ALTITUDE_FT)) { + m_altitudeFt = value * 100; + } + value = takeField(4).toInt(&ok); + if (ok) { + m_fuelOnBoardKg = value * fuelUnitKg; + } + value = takeField(4).toInt(&ok); + if (ok) { + m_fuelUsedKg = value * fuelUnitKg; + } + + // Static air temperature, e.g. "M 58C" is -58C and "P018C" is +18C + QString tempField = takeField(5); + QRegularExpressionMatch tempMatch = tempRe.match(tempField); + if (tempMatch.hasMatch() && !tempMatch.captured(2).isEmpty()) + { + m_temperatureC = tempMatch.captured(2).toInt(); + if (tempField.contains('M')) { + m_temperatureC = -m_temperatureC; + } + m_temperatureValid = true; + } + + // The trailing eight digits are the ETA then the message time + QString middle = rest.trimmed(); + static const QRegularExpression timesRe(R"((\d\d)(\d\d)(\d\d)(\d\d)$)"); + QRegularExpressionMatch timesMatch = timesRe.match(middle); + if (timesMatch.hasMatch()) + { + m_eta = QTime(timesMatch.captured(1).toInt(), timesMatch.captured(2).toInt()); + m_time = QTime(timesMatch.captured(3).toInt(), timesMatch.captured(4).toInt()); + middle = middle.left(middle.size() - 8).trimmed(); + } + + // Wind speed and direction, then heading, track and ground speed. The compact + // layout packs all five as three digits each; the padded one gives two digits to + // the wind speed and leaves heading and track blank + static const QRegularExpression compactRe(R"(^(\d{3})(\d{3})(\d{3})(\d{3})(\d{3})$)"); + static const QRegularExpression paddedRe(R"(^(\d{1,2})(\d{3})\s+(\d{1,3})$)"); + QRegularExpressionMatch windMatch = compactRe.match(middle); + if (compact && windMatch.hasMatch() && (windMatch.captured(2).toInt() <= 360)) + { + m_windSpeedKts = windMatch.captured(1).toInt(); + m_windDirectionDeg = windMatch.captured(2).toInt(); + m_headingDeg = windMatch.captured(3).toInt(); + m_trackDeg = windMatch.captured(4).toInt(); + m_speedKts = windMatch.captured(5).toInt(); + } + else if ((windMatch = paddedRe.match(middle)).hasMatch() + && (windMatch.captured(2).toInt() <= 360)) + { + m_windSpeedKts = windMatch.captured(1).toInt(); + m_windDirectionDeg = windMatch.captured(2).toInt(); + m_speedKts = windMatch.captured(3).toInt(); + } + else if (!middle.isEmpty()) + { + m_additionalData = middle; + } + return true; +} + +QString AcarsFlightStatus::toString() +{ + if (m_departureAirport.isEmpty()) { + return ""; + } + QStringList lines; + lines.append(QString("<b>Departure:</b> %1").arg(icaoAndAirportName(m_departureAirport))); + lines.append(QString("<b>Arrival:</b> %1").arg(icaoAndAirportName(m_arrivalAirport))); + lines.append(QString("<b>Position:</b> %1%2 %3%4") + .arg(std::abs(m_latitude), 0, 'f', 4) + .arg(m_latitude < 0.0f ? "S" : "N") + .arg(std::abs(m_longitude), 0, 'f', 4) + .arg(m_longitude < 0.0f ? "W" : "E")); + if (m_altitudeFt >= 0) { + lines.append(QString("<b>Altitude:</b> %1 ft").arg(m_altitudeFt)); + } + if (m_fuelOnBoardKg >= 0) { + lines.append(QString("<b>Fuel on board:</b> %1 t").arg(m_fuelOnBoardKg / 1000.0, 0, 'f', 2)); + } + if (m_fuelUsedKg >= 0) { + lines.append(QString("<b>Fuel used:</b> %1 t").arg(m_fuelUsedKg / 1000.0, 0, 'f', 2)); + } + if (m_temperatureValid) { + lines.append(QString("<b>Temperature:</b> %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); + } + if (m_windSpeedKts >= 0) { + lines.append(QString("<b>Wind:</b> %1%2 %3 kts").arg(m_windDirectionDeg).arg(QChar(0xB0)).arg(m_windSpeedKts)); + } + if (m_headingDeg >= 0) { + lines.append(QString("<b>Heading:</b> %1%2").arg(m_headingDeg).arg(QChar(0xB0))); + } + if (m_trackDeg >= 0) { + lines.append(QString("<b>Track:</b> %1%2").arg(m_trackDeg).arg(QChar(0xB0))); + } + if (m_speedKts >= 0) { + lines.append(QString("<b>Ground speed:</b> %1 kts").arg(m_speedKts)); + } + if (m_eta.isValid()) { + lines.append(QString("<b>ETA:</b> %1").arg(m_eta.toString("hh:mm"))); + } + if (m_time.isValid()) { + lines.append(QString("<b>Time:</b> %1").arg(m_time.toString("hh:mm"))); + } + if (!m_additionalData.isEmpty()) { + lines.append(QString("<b>Additional data:</b> %1").arg(m_additionalData)); + } + return lines.join("<br>"); +} + +bool AcarsFlightStatus::getPosition(float& latitude, float& longitude, int& altitudeFt) const +{ + if (!m_positionValid) { + return false; + } + latitude = m_latitude; + longitude = m_longitude; + altitudeFt = m_altitudeFt; + return true; +} + +static QString positionString(float latitude, float longitude) +{ + return QString("%1%2 %3%4") + .arg(std::abs(latitude), 0, 'f', 4) + .arg(latitude < 0.0f ? "S" : "N") + .arg(std::abs(longitude), 0, 'f', 4) + .arg(longitude < 0.0f ? "W" : "E"); +} + +AcarsPositionReport::AcarsPositionReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// A family of related airline position report formats, one per label. Formats +// cross-checked against airframes.io's acars-decoder-typescript test vectors. + +// Latitude or longitude written as degrees and decimal minutes without a separator - +// N2725.8 is 27 degrees 25.8 minutes north, W08149.2 is 81 degrees 49.2 minutes west. +// Latitude takes two digits of degrees and longitude three, which is what tells the two +// apart when the minutes run to a leading zero. +static bool decodeDegreesMinutes(const QString& field, bool isLongitude, float& out) +{ + static const QRegularExpression re(R"(^([NSEW])\s*(\d+)\.(\d)$)"); + const QRegularExpressionMatch match = re.match(field.trimmed()); + if (!match.hasMatch()) { + return false; + } + const QString digits = match.captured(2); + const int degreeDigits = isLongitude ? 3 : 2; + if (digits.size() != degreeDigits + 2) { + return false; + } + const float degrees = digits.left(degreeDigits).toFloat(); + const float minutes = digits.mid(degreeDigits).toFloat() + match.captured(3).toFloat() / 10.0f; + out = degrees + minutes / 60.0f; + if ((match.captured(1) == "S") || (match.captured(1) == "W")) { + out = -out; + } + return true; +} + +// "N 51.410" or "-83.764" - decimal degrees, with the hemisphere either as a letter in +// front or as the sign +static bool decodeDecimalDegrees(const QString& field, float& out) +{ + static const QRegularExpression re(R"(^([NSEW])?\s*(-?\d+(?:\.\d+)?)$)"); + const QRegularExpressionMatch match = re.match(field.trimmed()); + if (!match.hasMatch()) { + return false; + } + out = match.captured(2).toFloat(); + if ((match.captured(1) == "S") || (match.captured(1) == "W")) { + out = -out; + } + return true; +} + +// "28AUG26" - the month as the usual three letter abbreviation, 0 when it is not one +static int monthFromName(const QString& name) +{ + static const QStringList months = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", + "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}; + return months.indexOf(name.toUpper()) + 1; +} + +static QTime decodeHms(const QString& field) +{ + const QString t = field.trimmed(); + if (t.size() == 6) { + return QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); + } + if (t.size() == 4) { + return QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt()); + } + return QTime(); +} + +// An airport code, or nothing if the field is not one. Four characters is ICAO, which is +// what these formats use; a runway or a count is not accepted just for being the right +// length, because every character has to be a letter. +static QString airportField(const QString& field) +{ + static const QRegularExpression re("^[A-Z]{4}$"); + const QString t = field.trimmed(); + return re.match(t).hasMatch() ? t : QString(); +} + + +// Position reports in the formats airlines put on labels 11, 21, 36, 45 and 8H. +// +// None of those labels is registered as a position report - 11 is "In Range Arrival", +// 21 is "Takeoff Data Calculation", 8H is "SAS Loadsheet Request" - and each of them +// also carries other traffic, so every one of these tests has to be certain before it +// claims the message. Where none matches, the caller falls through to the ARINC formats +// and finally to showing the text as it came. +// +// Formats and field meanings were taken from several hundred messages in the +// airframes.io archive, August 2026. Fields whose meaning could not be established from +// the sample are deliberately left unparsed rather than guessed at. +bool AcarsPositionReport::decodeAirlinePosition(const QString &text) +{ + // ---- Label 11: a self describing list, which is the easiest of them to be sure of + // POS + // CAS 278,LAT N 25.734,LON E120.484,ALT 32090,FOB 21800,UTC 151636, + // PD ----.--,WD 110,WS 29,TAT - 2 + if (text.startsWith("POS\n") || text.startsWith("POS\r") || text.startsWith("CAS ")) + { + bool haveLat = false, haveLon = false; + for (const QString& field : text.mid(text.indexOf("CAS ")).split(',')) + { + const QString f = field.trimmed(); + const int space = f.indexOf(' '); + if (space < 0) { + continue; + } + const QString key = f.left(space); + const QString value = f.mid(space + 1).trimmed(); + if (value.contains('-') && !value.startsWith('-')) { + continue; // ----.-- means the aircraft did not report it + } + + if (key == "LAT") { + haveLat = decodeDecimalDegrees(value, m_latitude); + } else if (key == "LON") { + haveLon = decodeDecimalDegrees(value, m_longitude); + } else if (key == "ALT") { + m_altitudeFt = value.toInt(); + } else if (key == "UTC") { + m_time = decodeHms(value); + } else if (key == "CAS") { + m_speedKts = value.toInt(); + } else if (key == "WD") { + m_windDirDeg = value.toInt(); + } else if (key == "WS") { + m_windSpeedKts = value.toInt(); + } else if (key == "FOB") { + m_fuelOnBoard = value; + } else if (key == "TAT") { + // Written with the sign detached from the digits, "- 2" + bool ok = false; + const int t = QString(value).remove(' ').toInt(&ok); + if (ok) { m_temperatureValid = true; m_temperatureC = t; } + } + } + if (haveLat && haveLon) + { + m_positionValid = true; + m_reportType = "POS"; + return true; + } + return false; + } + + // ---- Label 21: POS then the hemisphere letters, with no separator between them + // POSN 35.240W 85.333, 191,153530,38006, 1761, 30,-52,170406,KDFW + { + static const QRegularExpression re( + R"(^POS([NS])\s*(\d{1,2}\.\d+)([EW])\s*(\d{1,3}\.\d+),(.*)$)"); + const QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_latitude = match.captured(2).toFloat() * (match.captured(1) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(4).toFloat() * (match.captured(3) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_reportType = "POS"; + + // Track, time, altitude, then fields whose meaning the sample did not + // settle, and the destination last + const QStringList fields = match.captured(5).split(','); + if (fields.size() > 0) { m_trackDeg = fields[0].trimmed().toInt(); } + if (fields.size() > 1) { m_time = decodeHms(fields[1]); } + if (fields.size() > 2) { m_altitudeFt = fields[2].trimmed().toInt(); } + if (fields.size() > 5) + { + bool ok = false; + const int t = fields[5].trimmed().remove(' ').toInt(&ok); + if (ok) { m_temperatureValid = true; m_temperatureC = t; } + } + if (fields.size() > 6) { m_eta = decodeHms(fields[6]); } + if (fields.size() > 7) { m_arrivalAirport = airportField(fields[7]); } + return true; + } + } + + // ---- Label 8H: position, time, and BOTH airports + // N 51.410,W 1.275,0616,SMJP,EHAM,32200, 510625,35999,25151, 42 + { + const QStringList fields = text.split(','); + if (fields.size() >= 8) + { + float latitude = 0.0f, longitude = 0.0f; + const QString dep = airportField(fields[3]); + const QString arr = airportField(fields[4]); + if (!dep.isEmpty() && !arr.isEmpty() + // The hemisphere letters have to be there: without them this would + // claim any comma list whose first two fields happen to be numbers + && fields[0].trimmed().startsWith('N') != fields[0].trimmed().startsWith('S') + && fields[1].trimmed().startsWith('E') != fields[1].trimmed().startsWith('W') + && decodeDecimalDegrees(fields[0], latitude) + && decodeDecimalDegrees(fields[1], longitude)) + { + m_latitude = latitude; + m_longitude = longitude; + m_positionValid = true; + m_reportType = "POS"; + m_time = decodeHms(fields[2]); + m_departureAirport = dep; + m_arrivalAirport = arr; + // Field 8 is the only one of the trailing numbers that reads as an + // altitude across the whole sample; the others are left alone + m_altitudeFt = fields[7].trimmed().toInt(); + return true; + } + } + } + + return decodeInRangePosition(text) || decodeWaypointPosition(text); +} + + +// The in range formats on label 36, of which there are three. All give a position; two +// give the airports and the runways as well. +bool AcarsPositionReport::decodeInRangePosition(const QString &text) +{ + const QStringList lines = text.split(QRegularExpression("[\r\n]+"), Qt::SkipEmptyParts); + + // ---- Three lines: date and tail, then position and altitude, then fuel + // 28AUG26,141148,EI-DVG + // N 49.041,W 4.957,36022 + // ------, 401250 + if (lines.size() >= 2) + { + static const QRegularExpression dateRe(R"(^(\d{2})([A-Z]{3})(\d{2}),(\d{6}),(\S+)$)"); + const QRegularExpressionMatch head = dateRe.match(lines[0].trimmed()); + const QStringList second = lines[1].split(','); + float latitude = 0.0f, longitude = 0.0f; + if (head.hasMatch() && (second.size() >= 3) + && decodeDecimalDegrees(second[0], latitude) + && decodeDecimalDegrees(second[1], longitude)) + { + m_day = head.captured(1).toInt(); + m_month = monthFromName(head.captured(2)); + m_time = decodeHms(head.captured(4)); + m_tail = head.captured(5); + m_latitude = latitude; + m_longitude = longitude; + m_positionValid = true; + m_altitudeFt = second[2].trimmed().toInt(); + m_reportType = "POS"; + if (lines.size() >= 3) + { + const QStringList third = lines[2].split(','); + if ((third.size() >= 2) && !third[1].contains('-')) { + m_fuelOnBoard = third[1].trimmed(); + } + } + return true; + } + } + + const QStringList fields = text.split(','); + + // ---- Position, altitude, fuel, then departure, destination and alternate, then + // the runways. The position is decimal degrees in one variant and degrees and + // decimal minutes in the other. + // 28,E,29AUG26,144335,N2725.8,W08149.2,23010,11175,KMCO,KFLL,KFLL,10L/,10R/ + // 195,C,29AUG26,153523,42.057,-83.764,31079,5375,KIND,CYYZ,CYYZ,29,24R/- + if (fields.size() >= 11) + { + float latitude = 0.0f, longitude = 0.0f; + const bool placed = + (decodeDegreesMinutes(fields[4], false, latitude) + && decodeDegreesMinutes(fields[5], true, longitude)) + || (decodeDecimalDegrees(fields[4], latitude) + && decodeDecimalDegrees(fields[5], longitude)); + const QString dep = airportField(fields[8]); + const QString arr = airportField(fields[9]); + if (placed && !dep.isEmpty() && !arr.isEmpty()) + { + m_latitude = latitude; + m_longitude = longitude; + m_positionValid = true; + m_reportType = "POS"; + m_time = decodeHms(fields[3]); + m_altitudeFt = fields[6].trimmed().toInt(); + m_fuelOnBoard = fields[7].trimmed(); + m_departureAirport = dep; + m_arrivalAirport = arr; + m_alternateAirport = airportField(fields[10]); + // The runways are written with a trailing slash and the pair they were + // planned and cleared for, e.g. "10L/" or "24R/-" + if (fields.size() > 11) { m_departureRunway = fields[11].trimmed().remove('/').remove('-'); } + if (fields.size() > 12) { m_arrivalRunway = fields[12].trimmed().remove('/').remove('-'); } + return true; + } + } + + // ---- The commonest of the three, and the least self explanatory: a fixed column + // list with the position given twice, the wind as a single ddd/ss number and + // the flight level in hundreds of feet + // 71,M,1544,1,1,KLGA,40.86,-75.07,40.86,-75.07,17,281024,-8,68.3,7196,16,30,334,358,564CFA5 + if (fields.size() >= 19) + { + float latitude = 0.0f, longitude = 0.0f; + const QString airport = airportField(fields[5]); + if (!airport.isEmpty() + && decodeDecimalDegrees(fields[6], latitude) + && decodeDecimalDegrees(fields[7], longitude) + && (fields[11].trimmed().size() == 6)) + { + m_latitude = latitude; + m_longitude = longitude; + m_positionValid = true; + m_reportType = "POS"; + m_time = decodeHms(fields[2]); + m_arrivalAirport = airport; + // Hundreds of feet - the sample runs from 17 with an outside air temperature + // of -8 to 38 with -50, which no other reading of the column fits + m_altitudeFt = fields[10].trimmed().toInt() * 100; + const QString wind = fields[11].trimmed(); + m_windDirDeg = wind.left(3).toInt(); + m_windSpeedKts = wind.mid(3).toInt(); + bool ok = false; + const int t = fields[12].trimmed().toInt(&ok); + if (ok) { m_temperatureValid = true; m_temperatureC = t; } + m_speedKts = fields[17].trimmed().toInt(); + m_groundSpeedKts = fields[18].trimmed().toInt(); + return true; + } + } + + return false; +} + +// Labels 45 and 36 also carry a report that names the fixes either side of the aircraft, +// which no other ACARS position format does: +// +// 291545 KATL MMMY7 +// /FN 1929 +// 0340 STEIT MERDN N32232W088483 +// +// The day and time, the departure and destination, the flight number, then the fix just +// passed, the one coming up, and the position. The position is in the same degrees and +// tenths of a minute form the ARINC 702A route inserts use, so N32232W088483 is +// N32 23.2 W088 48.3. Where the aircraft could not place itself the field is dashes. +bool AcarsPositionReport::decodeWaypointPosition(const QString &text) +{ + const QStringList lines = text.split(QRegularExpression("[\r\n]+"), Qt::SkipEmptyParts); + if (lines.size() < 3) { + return false; + } + + static const QRegularExpression headRe(R"(^(\d{2})(\d{4})\s+([A-Z]{4})\s+([A-Z]{4})\d?\s*$)"); + const QRegularExpressionMatch head = headRe.match(lines[0]); + if (!head.hasMatch() || !lines[1].startsWith("/FN")) { + return false; + } + + // The position closes the third line, and is what makes this worth reporting + static const QRegularExpression posRe(R"(([NS])(\d{2})(\d{3})([EW])(\d{3})(\d{3})\s*$)"); + const QRegularExpressionMatch pos = posRe.match(lines[2]); + if (!pos.hasMatch()) { + return false; + } + + m_day = head.captured(1).toInt(); + m_time = decodeHms(head.captured(2)); + m_departureAirport = head.captured(3); + m_arrivalAirport = head.captured(4); + m_reportFlight = lines[1].mid(3).trimmed(); + m_reportType = "POS"; + + m_latitude = pos.captured(2).toFloat() + pos.captured(3).toFloat() / 600.0f; + if (pos.captured(1) == "S") { m_latitude = -m_latitude; } + m_longitude = pos.captured(5).toFloat() + pos.captured(6).toFloat() / 600.0f; + if (pos.captured(4) == "W") { m_longitude = -m_longitude; } + m_positionValid = true; + + // Whatever is between the leading number and the position, in fixed width columns. + // One fix means the one just passed; two means passed and next. + const QString middle = lines[2].left(lines[2].size() - pos.captured(0).size()); + QStringList names; + static const QRegularExpression nameRe("^[A-Z]{3,5}$"); + for (const QString& token : middle.split(' ', Qt::SkipEmptyParts)) + { + if (nameRe.match(token).hasMatch()) { + names.append(token); + } + } + if (names.size() >= 1) { m_lastWaypoint = names[0]; } + if (names.size() >= 2) { m_nextWaypoint = names[1]; } + return true; +} + +// The 01CLER cruise report, on labels 17 and 49. It carries no latitude or longitude, +// so it places nothing on the map - but it names both airports, which is a route pair +// straight from the aircraft, and the altitude it is at. +// +// 01CLERAIC118/302042EGBBVIAR 01CLER ETD078/310934EGCCOMAA +// 34726 287.6 -12.9 +34918291.3- 13.4 +// +// Two ways of writing the same thing. The callsign is left aligned on label 17 and right +// aligned on 49; the figures are space separated on 17 and packed together on 49, where +// they are also blank padded in the way label 17's position reports are - "+ 5231" is +// 5231 feet, not 5231 with something missing. +// +// UAL900 is the check that the altitude reading is right: it went off at 10:07:39 by its +// own OOOI message, and this report at 10:10 has it at 5231 feet, three minutes into the +// climb. The two figures after the altitude are left alone - around 250 to 300 and -28 to +// +22, so heading and an ISA deviation would fit, but nothing in the samples says so. +bool AcarsPositionReport::decodeCruiseReport(const QString &text) +{ + static const QRegularExpression re( + R"RX(01CLER\s*(\S+?)\s*/(\d{2})(\d{2})(\d{2})([A-Z]{4})([A-Z]{4})\s*[\r\n]+\s*(?:([+-])([ \d]{5})|(\d{4,5})[ ]))RX"); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return false; + } + + m_reportFlight = match.captured(1); + m_day = match.captured(2).toInt(); + m_time = QTime(match.captured(3).toInt(), match.captured(4).toInt()); + m_departureAirport = match.captured(5); + m_arrivalAirport = match.captured(6); + + // The packed form pads with blanks where a leading zero would be + if (!match.captured(8).isEmpty()) + { + const int feet = QString(match.captured(8)).replace(' ', '0').toInt(); + m_altitudeFt = (match.captured(7) == "-") ? -feet : feet; + } + else + { + m_altitudeFt = match.captured(9).toInt(); + } + m_reportType = "CRZ"; + + return true; +} + +// The company position report on label 17 - another label the dispatch sends to +// AcarsEventReport, so it was titled "OOOI" while carrying no OOOI time and nothing was +// taken from it: +// +// 173442,19231,2010, 23200,N 51.892,E .642,29AUG26,26736, 41,- 15 +// +// Time, a figure this format does not identify, an ETA, the altitude in feet, the +// position, the date, and three more unidentified figures. +// +// EVERY NUMBER IS BLANK PADDED, AND A BLANK IS A ZERO. That is the whole difficulty of +// the format and it is not a guess: across 900 coordinate fields the fraction is three +// digits 888 times and " dd" the other 12, with the blank ALWAYS leading and never in +// the middle or at the end, and the integer part is right aligned the same way. So +// "E .642" is 0.642 and "E . 73" is 0.073 - not 0.73, which is how it first read and +// would have put the aircraft seven times too far east. +// +// The ETA is read because it is a valid time in all 452 samples that parse; the figures +// either side of it are not, because nothing in the samples says what they are. +// +// "MMMM.MMM" in either coordinate means the position is not available, and "------" the +// same for the altitude. +bool AcarsPositionReport::decodeCompanyPosition(const QString &text) +{ + // The same report in a shorter form on label 16, which is a thousand messages here + // and the largest single block of traffic that was going undecoded: + // + // 202900,28645,2100, 98,N 50.191 W .870 + // + // Time, an unidentified figure, an ETA, a second unidentified figure, and the + // position - which is separated by a SPACE here where label 17 uses a comma, and + // carries no date or trailing figures. + // + // The blank padding is label 17's, and the positions are right: 411 of them checked + // against the same airframe's ADS-B within a minute came out with a median error of + // 0.010 degrees of latitude and 0.016 of longitude, about a kilometre. + // + // The fourth field is NOT the altitude, which is what it looks like beside label + // 17's. Read as hundreds of feet it misses the ADS-B altitude by 3587 ft at the + // median, and one aircraft reported 128 and then 77 while ADS-B had it at 10,600 ft + // both times. It is not the distance to the destination either - 154 nm out at the + // median. Within one leg it falls steadily as the ETA nears and resets for the next, + // so fuel is the likely answer, but nothing here establishes it and it is left alone + // rather than labelled wrongly. + if (m_label == "16") + { + static const QRegularExpression shortRe( + R"RX(^(\d{2})(\d{2})(\d{2}),[^,]*,(\d{2})(\d{2}),\s*\d{1,4},([NS])([ \d]{2,3}\.[ \d]{3}) ([EW])([ \d]{3}\.[ \d]{3}))RX"); + const QRegularExpressionMatch shortMatch = shortRe.match(text); + if (!shortMatch.hasMatch()) { + return false; + } + + auto blankPadded = [](const QString& field) + { + return QString(field).replace(' ', '0').toFloat(); + }; + + m_time = QTime(shortMatch.captured(1).toInt(), shortMatch.captured(2).toInt(), + shortMatch.captured(3).toInt()); + m_eta = QTime(shortMatch.captured(4).toInt(), shortMatch.captured(5).toInt()); + m_latitude = blankPadded(shortMatch.captured(7)) + * (shortMatch.captured(6) == "S" ? -1.0f : 1.0f); + m_longitude = blankPadded(shortMatch.captured(9)) + * (shortMatch.captured(8) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_reportType = "POS"; + return true; + } + + if (m_label != "17") { + return false; + } + + static const QRegularExpression re( + R"RX(^(\d{2})(\d{2})(\d{2}),\s*\d+,(\d{2})(\d{2}),([- \d]+),([NS])([ \d]{2,3}\.[ \d]{3}),([EW])([ \d]{3}\.[ \d]{3}),(\d{2})([A-Z]{3})(\d{2}),)RX"); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return false; + } + + // A blank stands for a zero, so it cannot simply be stripped + auto blankPadded = [](const QString& field) + { + return QString(field).replace(' ', '0').toFloat(); + }; + + m_time = QTime(match.captured(1).toInt(), match.captured(2).toInt(), + match.captured(3).toInt()); + m_eta = QTime(match.captured(4).toInt(), match.captured(5).toInt()); + m_day = match.captured(11).toInt(); + m_latitude = blankPadded(match.captured(8)) * (match.captured(7) == "S" ? -1.0f : 1.0f); + m_longitude = blankPadded(match.captured(10)) * (match.captured(9) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + const QString altitude = match.captured(6).trimmed(); + if (!altitude.isEmpty() && !altitude.contains('-')) { + m_altitudeFt = altitude.toInt(); + } + m_reportType = "POS"; + + return true; +} + +// The POX position report, which arrives on label 18 - a label the dispatch otherwise +// sends to AcarsEventReport, so it was filed as an OOOI event and nothing was taken from +// it at all: +// +// POX,CZ0673,31AUG26,161247,ZBAD,EGLL,N51.745,E001.690,240,108,0.639,-084,-056.3,053,-027,1635, +// +// Flight, date, time, both airports, the position, then the flight level, a figure that +// falls slowly through a flight, and the Mach number. +// +// The flight level is not a guess: taking one aircraft's reports in order gives a steady +// descent - 240, 201, 167, 144, 122, 090, 076, 067, 047 into Heathrow - and B-32EW's ADS-B +// puts it at 23000 ft twelve seconds after the report reading 240. The three fields after +// the Mach are left alone; one of them tracks temperature and another looks like an ETA, +// but the samples do not settle which is which. +// +// A second form of the same report carries no hemisphere letters and space pads its +// fields - "POX,CZ0689,31AUG26,050542,ZGGG,EGKK, 51.040, .89,..." - and is deliberately +// not decoded: without a hemisphere there is nothing to say which side of the equator or +// the meridian it is on, and half the longitude digits are missing as well. +bool AcarsPositionReport::decodePoxPosition(const QString &text) +{ + static const QRegularExpression re( + R"RX(^POX,(\S*),(\d{2})([A-Z]{3})(\d{2}),(\d{2})(\d{2})(\d{2}),([A-Z]{4}),([A-Z]{4}),([NS])(\d+\.\d+),([EW])(\d+\.\d+),(\d{1,3}),\d+,(\d\.\d+),)RX"); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return false; + } + + m_reportFlight = match.captured(1); + m_day = match.captured(2).toInt(); + m_time = QTime(match.captured(5).toInt(), match.captured(6).toInt(), + match.captured(7).toInt()); + m_departureAirport = match.captured(8); + m_arrivalAirport = match.captured(9); + m_latitude = match.captured(11).toFloat() * (match.captured(10) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(13).toFloat() * (match.captured(12) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_altitudeFt = match.captured(14).toInt() * 100; + m_reportType = "POS"; + + return true; +} + +// Label 83 carries two position formats, which together are nine tenths of the label. +// +// 001PR30193303N2746.0W08244.51193040029 +// EPWA,KJFK,301917, 42.48,- 71.07,41002,246,-138.7, 10200 +// +// The first is a sequence number, PR, the day, the time, the position in degrees and +// decimal minutes, then ten digits of which the first four are the altitude in tens of +// feet. That reading is not a guess: taking one aircraft's reports in time order gives a +// textbook climb and level-off - 29540, 38140, 39940, 39940, 40040, 40040, 39940 ft over +// an hour - and across 176 reports the figure never leaves 1410 to 45050 ft. +// +// The remaining six digits are left alone. The last group counts down about one per +// minute, so it is almost certainly time to destination, but the samples do not settle +// where the field boundary falls, and a mislabelled number is worse than an absent one. +// +// The second is the same report written by a different operator: both airports, the day +// and time, position in decimal degrees, altitude in feet and track. Note the sign of the +// longitude is separated from its digits by a space, which no ordinary conversion +// accepts. +bool AcarsPositionReport::decodeLabel83Position(const QString &text) +{ + if (m_label != "83") { + return false; + } + + static const QRegularExpression sequencedRe( + R"(^(\d{3})PR(\d{2})(\d{2})(\d{2})(\d{2})([NS])(\d{2})(\d{2}\.\d)([EW])(\d{3})(\d{2}\.\d)(\d{4}))"); + const QRegularExpressionMatch sequenced = sequencedRe.match(text); + if (sequenced.hasMatch()) + { + m_day = sequenced.captured(2).toInt(); + m_time = QTime(sequenced.captured(3).toInt(), sequenced.captured(4).toInt(), + sequenced.captured(5).toInt()); + m_latitude = (sequenced.captured(7).toFloat() + sequenced.captured(8).toFloat() / 60.0f) + * (sequenced.captured(6) == "S" ? -1.0f : 1.0f); + m_longitude = (sequenced.captured(10).toFloat() + sequenced.captured(11).toFloat() / 60.0f) + * (sequenced.captured(9) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_altitudeFt = sequenced.captured(12).toInt() * 10; + m_reportType = "POS"; + return true; + } + + static const QRegularExpression routedRe( + R"(^([A-Z]{4}),([A-Z]{4}),(\d{2})(\d{2})(\d{2}),\s*(-?\s*\d+\.\d+),\s*(-?\s*\d+\.\d+),\s*(\d+),\s*(\d+),)"); + const QRegularExpressionMatch routed = routedRe.match(text); + if (routed.hasMatch()) + { + m_departureAirport = routed.captured(1); + m_arrivalAirport = routed.captured(2); + m_day = routed.captured(3).toInt(); + m_time = QTime(routed.captured(4).toInt(), routed.captured(5).toInt()); + // "- 71.07" - the minus sign is separated from the digits, so the spaces have to + // go before the conversion, which would otherwise read it as +71.07 and put the + // aircraft on the wrong side of the Greenwich meridian + m_latitude = QString(routed.captured(6)).remove(' ').toFloat(); + m_longitude = QString(routed.captured(7)).remove(' ').toFloat(); + m_positionValid = true; + m_altitudeFt = routed.captured(8).toInt(); + m_trackDeg = routed.captured(9).toInt(); + m_reportType = "POS"; + return true; + } + + return false; +} + +// Label 30, of which this is about a fifth: +// +// 182,HG,1932,5,KSTL,N 38.690,W 77.747,,, 70 +// +// The time and the position are unambiguous and are what is taken. The airport and the +// trailing figure are not: the airport is consistent with being the destination in every +// sample but never stated to be, and the figure could be a flight level or a time to run. +// Neither is decoded on that basis. +bool AcarsPositionReport::decodeStationPosition(const QString &text) +{ + if (m_label != "30") { + return false; + } + + static const QRegularExpression re( + R"(^\d+,[A-Z]{2},(\d{2})(\d{2}),\d+,[A-Z]{4},\s*([NS])\s*(\d+\.\d+),\s*([EW])\s*(\d+\.\d+),)"); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return false; + } + + m_time = QTime(match.captured(1).toInt(), match.captured(2).toInt()); + m_latitude = match.captured(4).toFloat() * (match.captured(3) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(6).toFloat() * (match.captured(5) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_reportType = "POS"; + + return true; +} + +// The comma separated position report on label 32, in the three variants seen off air: +// +// P,E,2026-08-30 19:19:04,5820,55888,N 41.877 W 087.840,6999,254,034,15,316,281,426,1932, +// P,R,2026-08-30 19:18:05,5692,70900,N41.890 W088.268,34996,325,29,-45,467,440,748,, +// P,H,30AUG26 18:14:25,2904, 43680,N 45.571 W 93.609,11225,264, 31, 24,335375,282.4,520,1826, +// +// The subtype letter, a timestamp written two different ways, two figures this format +// does not identify, the position, the altitude in feet and the track. The columns after +// the track disagree between the variants, so nothing beyond it is read. +// +// Half of one hundred consecutive label 32 messages are this format and all fifty match; +// the other half are several airline formats that share the label, which is ordinary for +// these labels and why this returns false rather than assuming. +bool AcarsPositionReport::decodeCsvPosition(const QString &text) +{ + if (m_label != "32") { + return false; + } + + static const QRegularExpression re( + R"(^P,([A-Z]),([^,]+),\d+,\s*\d+,\s*([NS])\s*(\d+\.\d+)\s+([EW])\s*(\d+\.\d+),\s*(\d+),\s*(\d+),)"); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return false; + } + + m_latitude = match.captured(4).toFloat() * (match.captured(3) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(6).toFloat() * (match.captured(5) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_altitudeFt = match.captured(7).toInt(); + m_trackDeg = match.captured(8).toInt(); + m_reportType = "POS"; + + // "2026-08-30 19:19:04" and "30AUG26 18:14:25" - the same instant written by two + // different operators, so the day is taken from whichever end carries it + const QString when = match.captured(2); + static const QRegularExpression timeRe(R"((\d{2}):(\d{2}):(\d{2}))"); + const QRegularExpressionMatch time = timeRe.match(when); + if (time.hasMatch()) + { + m_time = QTime(time.captured(1).toInt(), time.captured(2).toInt(), + time.captured(3).toInt()); + } + static const QRegularExpression dayRe(R"(^(?:\d{4}-\d{2}-(\d{2})|(\d{1,2})[A-Z]{3}))"); + const QRegularExpressionMatch day = dayRe.match(when); + if (day.hasMatch()) + { + m_day = day.captured(1).isEmpty() ? day.captured(2).toInt() + : day.captured(1).toInt(); + } + + return true; +} + +// Label 4N: a short position report that also names the sector being flown. +// +// 30194N LGA HSV1 +// 0068 0087 N038544 W079020 360 +// +// Day and hour, the label repeated, origin and destination in three letter IATA and a +// part number; then two figures, the position in degrees and decimal minutes, and the +// flight level. Checked against 100 consecutive label 4N messages off air, every one of +// which matches, and the positions fall where the named sector says they should - an HPN +// to DTW report at flight level 037 sits over Detroit. +// +// The two leading figures are deliberately not decoded. Minutes remaining and fuel are +// both plausible readings and the samples do not settle it, and a mislabelled number is +// worse than an undisplayed one. +bool AcarsPositionReport::decodeRoutedPosition(const QString &text) +{ + if (m_label != "4N") { + return false; + } + + static const QRegularExpression re( + R"(^(\d{2})(\d{2})4N\s+([A-Z]{3})\s+([A-Z]{3})\d\s*[\r\n]+\s*\d{4}\s+\d{4}\s+([NS])(\d{3})(\d{3})\s+([EW])(\d{3})(\d{3})\s+(\d{3}))"); + const QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) { + return false; + } + + m_day = match.captured(1).toInt(); + m_time = QTime(match.captured(2).toInt(), 0); + + // Written in IATA, and everything downstream works in ICAO + const QString from = icaoFromIata(match.captured(3)); + const QString to = icaoFromIata(match.captured(4)); + m_departureAirport = from.isEmpty() ? match.captured(3) : from; + m_arrivalAirport = to.isEmpty() ? match.captured(4) : to; + + // Degrees and decimal minutes, so the minutes are tenths and there are 600 of them + // to the degree + m_latitude = (match.captured(6).toFloat() + match.captured(7).toFloat() / 600.0f) + * (match.captured(5) == "S" ? -1.0f : 1.0f); + m_longitude = (match.captured(9).toFloat() + match.captured(10).toFloat() / 600.0f) + * (match.captured(8) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_altitudeFt = match.captured(11).toInt() * 100; + m_reportType = "POS"; + + return true; +} + +bool AcarsPositionReport::decode(const QString &text) +{ + if (decodeAirlinePosition(text)) { + return true; + } + + if (decodeRoutedPosition(text)) { + return true; + } + + if (decodeCsvPosition(text)) { + return true; + } + + if (decodeLabel83Position(text)) { + return true; + } + + if (decodeStationPosition(text)) { + return true; + } + + if (decodePoxPosition(text)) { + return true; + } + + if (decodeCompanyPosition(text)) { + return true; + } + + if (decodeCruiseReport(text)) { + return true; + } + + if ((m_label == "12") || (m_label == "16")) + { + // E.g: N 42.150,W121.187,39000,161859, 109,.C-GWSO,1742 (12) + // N 44.203,W 86.546,31965,6, 290 (16) + // N 28.177/W 96.055 (16) + QRegularExpression re(R"(^([NS])\s*(\d{1,2}\.\d+)\s*[,/]\s*([EW])\s*(\d{1,3}\.\d+)(?:,\s*(\d+))?)"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_latitude = match.captured(2).toFloat() * (match.captured(1) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(4).toFloat() * (match.captured(3) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + if (!match.captured(5).isEmpty()) { + m_altitudeFt = match.captured(5).toInt(); + } + if (m_label == "12") + { + // The fourth field is the time as HHMMSS + QStringList fields = text.split(','); + if (fields.size() >= 4) + { + QString t = fields[3].trimmed(); + if (t.size() == 6) { + m_time = QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); + } + } + } + return true; + } + } + else if (m_label == "10") + { + // E.g: POS082150, N 3885,W 7841,---,308,26922, 51,22290, 529, 19,-225,6 + // The time is HHMMSS; latitude and longitude are degrees x100; the eighth + // field is the altitude in feet + QRegularExpression re(R"(^POS(\d{6}),\s*([NS])\s*(\d+),\s*([EW])\s*(\d+),)"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_time = QTime(match.captured(1).mid(0, 2).toInt(), + match.captured(1).mid(2, 2).toInt(), + match.captured(1).mid(4, 2).toInt()); + m_latitude = match.captured(3).toFloat() / 100.0f * (match.captured(2) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(5).toFloat() / 100.0f * (match.captured(4) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + QStringList fields = text.split(','); + if (fields.size() >= 8) + { + bool ok; + int alt = fields[7].trimmed().toInt(&ok); + if (ok) { + m_altitudeFt = alt; + } + } + return true; + } + } + else if (m_label == "22") + { + // E.g: N 370824W 760010,-------,194936,30418, , , ,M 42,27335 42, 107, + // Latitude and longitude are degrees x10000; the third field is the time as + // HHMMSS and the fourth the altitude in feet + QRegularExpression re(R"(^([NS])\s*(\d{6})\s*([EW])\s*(\d{6}),)"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_latitude = match.captured(2).toFloat() / 10000.0f * (match.captured(1) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(4).toFloat() / 10000.0f * (match.captured(3) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + QStringList fields = text.split(','); + if ((fields.size() >= 3) && (fields[2].trimmed().size() == 6)) + { + QString t = fields[2].trimmed(); + m_time = QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); + } + if (fields.size() >= 4) + { + bool ok; + int alt = fields[3].trimmed().toInt(&ok); + if (ok) { + m_altitudeFt = alt; + } + } + return true; + } + } + else if (m_label == "44") + { + // E.g: POS02,N38171W077507,319,KJFK,KUZA,0926,0245,0327,004.6 + // Coordinates are degrees then minutes x10 (38 degrees 17.1 minutes); + // altitude is in flight levels; then departure and arrival airports, the + // date as MMDD, the time and ETA as HHMM, and fuel in tonnes + QRegularExpression re(R"(^(?:00)?(POS|ETA|IN|OFF|ON)(\d{2}),([NS])(\d\d)(\d{3})([EW])(\d{3})(\d{3}),(\d{1,3}),(\w{4}),(\w{4}),(\d{4}),(\d{4}),(\d{4}),(\d+\.?\d*))"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_reportType = match.captured(1); + m_latitude = match.captured(4).toFloat() + match.captured(5).toFloat() / 10.0f / 60.0f; + if (match.captured(3) == "S") { + m_latitude = -m_latitude; + } + m_longitude = match.captured(7).toFloat() + match.captured(8).toFloat() / 10.0f / 60.0f; + if (match.captured(6) == "W") { + m_longitude = -m_longitude; + } + m_positionValid = true; + m_altitudeFt = match.captured(9).toInt() * 100; + m_departureAirport = match.captured(10); + m_arrivalAirport = match.captured(11); + m_month = match.captured(12).mid(0, 2).toInt(); + m_day = match.captured(12).mid(2, 2).toInt(); + m_time = QTime(match.captured(13).mid(0, 2).toInt(), match.captured(13).mid(2, 2).toInt()); + m_eta = QTime(match.captured(14).mid(0, 2).toInt(), match.captured(14).mid(2, 2).toInt()); + m_fuelTons = match.captured(15).toFloat(); + return true; + } + } + else if (m_label == "24") + { + // E.g: /241710/1021/04WM/34962/N53.13/E001.33/3374/1056/ + // Day and time, then flight, altitude in feet, position and ETA + QRegularExpression re(R"(^/24(\d{4})/(\d+)/(\w+)/(\d+)/([NS])(\d{1,2}\.\d+)/([EW])(\d{1,3}\.\d+)/(\d+)/(\d{4})/?)"); + QRegularExpressionMatch match = re.match(text); + if (match.hasMatch()) + { + m_time = QTime(match.captured(1).mid(0, 2).toInt(), match.captured(1).mid(2, 2).toInt()); + m_reportFlight = match.captured(3); + m_altitudeFt = match.captured(4).toInt(); + m_latitude = match.captured(6).toFloat() * (match.captured(5) == "S" ? -1.0f : 1.0f); + m_longitude = match.captured(8).toFloat() * (match.captured(7) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_eta = QTime(match.captured(10).mid(0, 2).toInt(), match.captured(10).mid(2, 2).toInt()); + return true; + } + } + qDebug() << "AcarsPositionReport: Failed to match label" << m_label << text; + return false; +} + +QString AcarsPositionReport::toString() +{ + if (!m_positionValid) { + return ""; + } + const QHash<QString, QString> reportTypes = { + {"POS", "Position report"}, + {"ETA", "ETA report"}, + {"IN", "In gate report"}, + {"OFF", "Takeoff report"}, + {"ON", "Landing report"} + }; + QStringList lines; + if (!m_reportType.isEmpty()) { + lines.append(QString("<b>Report:</b> %1").arg(reportTypes.value(m_reportType, m_reportType))); + } + if (!m_reportFlight.isEmpty()) { + lines.append(QString("<b>Flight:</b> %1").arg(m_reportFlight)); + } + if (!m_departureAirport.isEmpty()) { + lines.append(QString("<b>Departure:</b> %1").arg(icaoAndAirportName(m_departureAirport))); + } + if (!m_arrivalAirport.isEmpty()) { + lines.append(QString("<b>Arrival:</b> %1").arg(icaoAndAirportName(m_arrivalAirport))); + } + lines.append(QString("<b>Position:</b> %1").arg(positionString(m_latitude, m_longitude))); + if (m_altitudeFt >= 0) { + lines.append(QString("<b>Altitude:</b> %1 ft").arg(m_altitudeFt)); + } + if (m_day >= 0) { + lines.append(QString("<b>Date:</b> %1/%2").arg(m_day, 2, 10, QChar('0')).arg(m_month, 2, 10, QChar('0'))); + } + if (m_time.isValid()) { + lines.append(QString("<b>Time:</b> %1").arg(m_time.toString(m_time.second() ? "hh:mm:ss" : "hh:mm"))); + } + if (m_eta.isValid()) { + lines.append(QString("<b>ETA:</b> %1").arg(m_eta.toString("hh:mm"))); + } + if (m_fuelTons >= 0.0f) { + lines.append(QString("<b>Fuel on board:</b> %1 t").arg(m_fuelTons, 0, 'f', 1)); + } + // As reported - see m_fuelOnBoard, the units are the operator's + if (!m_fuelOnBoard.isEmpty()) { + lines.append(QString("<b>Fuel on board:</b> %1").arg(m_fuelOnBoard)); + } + if (!m_tail.isEmpty()) { + lines.append(QString("<b>Registration:</b> %1").arg(m_tail)); + } + if (!m_alternateAirport.isEmpty()) { + lines.append(QString("<b>Alternate:</b> %1").arg(icaoAndAirportName(m_alternateAirport))); + } + if (!m_departureRunway.isEmpty()) { + lines.append(QString("<b>Departure runway:</b> %1").arg(m_departureRunway)); + } + if (!m_arrivalRunway.isEmpty()) { + lines.append(QString("<b>Arrival runway:</b> %1").arg(m_arrivalRunway)); + } + if (!m_lastWaypoint.isEmpty()) { + lines.append(QString("<b>Last waypoint:</b> %1").arg(m_lastWaypoint)); + } + if (!m_nextWaypoint.isEmpty()) { + lines.append(QString("<b>Next waypoint:</b> %1").arg(m_nextWaypoint)); + } + if (m_trackDeg >= 0) { + lines.append(QString("<b>Track:</b> %1%2").arg(m_trackDeg).arg(QChar(0xB0))); + } + if (m_speedKts >= 0) { + lines.append(QString("<b>Airspeed:</b> %1 kn").arg(m_speedKts)); + } + if (m_groundSpeedKts >= 0) { + lines.append(QString("<b>Ground speed:</b> %1 kn").arg(m_groundSpeedKts)); + } + if ((m_windDirDeg >= 0) && (m_windSpeedKts >= 0)) { + lines.append(QString("<b>Wind:</b> %1%2 / %3 kn") + .arg(m_windDirDeg, 3, 10, QChar('0')).arg(QChar(0xB0)).arg(m_windSpeedKts)); + } + if (m_temperatureValid) { + lines.append(QString("<b>Temperature:</b> %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); + } + return lines.join("<br>"); +} + +bool AcarsPositionReport::getPosition(float& latitude, float& longitude, int& altitudeFt) const +{ + if (!m_positionValid) { + return false; + } + latitude = m_latitude; + longitude = m_longitude; + altitudeFt = m_altitudeFt; + return true; +} + +AcarsEventReport::AcarsEventReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// OOOI event reports: /13 OUT EVENT / KSFO KEWR 12 231445/TIME 2314 +// with optional additional lines such as /LOC N373703,W1222251 (degrees, minutes, +// seconds), /LOC +38.9603,-077.4595 (decimal) and /FOB 0215 (fuel, 100kg) +bool AcarsEventReport::decode(const QString &text) +{ + // Not every label 13 message is an OUT event. Six here read: + // + // EGLL,0639,0659 + // + // and the first time is the minute the message was RECEIVED in all six, while the + // second is about twenty minutes ahead. HB-JPA sent "EGLL,1034,1034" while ADS-B had + // it at 178 feet - on the runway, its ETA reached. The airport is the arrival in five + // of the six, the sixth having a doubtful flight attribution. + // + // So it is a destination and an ETA, not a pair of movement times. Taken as OUT and + // OFF - which is what the label suggests, and what it looks like - it would have + // recorded an aircraft leaving the gate at the moment it was landing somewhere else. + // Label 8E sends the same thing with the "time now" left off - "EGKK,0829" - and 189 + // of them here are all the destination and an ETA: the time is in the FUTURE in every + // single one, from 4 to 152 minutes ahead and a median of 30, and the airport is the + // arrival in 145 against the departure in 2. So they are not an OUT or an OFF, which + // are times that have already happened. + // Label 8S sends the same destination and ETA with flags and figures after it - + // "EGJJ,0851,N,Y,N,0,0,1" - so the ETA is not the end of the line there. All 106 of + // those have the time in the future too, 5 to 220 minutes ahead and a median of 55, + // with the airport the arrival in 75 against the departure in 1. + // + // What the three flags and three figures are is not established - they are operator + // specific and the samples do not say - so only the destination and the ETA are read + // and the rest is left in the message text. + static const QRegularExpression etaRe( + R"RX(^([A-Z]{4}),(?:(\d{2})(\d{2}),)?(\d{2})(\d{2})(?:,|$))RX"); + const QRegularExpressionMatch etaMatch = etaRe.match(text.trimmed()); + if (etaMatch.hasMatch()) + { + m_arrivalAirport = etaMatch.captured(1); + if (!etaMatch.captured(2).isEmpty()) { + m_eventTime = QTime(etaMatch.captured(2).toInt(), etaMatch.captured(3).toInt()); + } + m_eta = QTime(etaMatch.captured(4).toInt(), etaMatch.captured(5).toInt()); + m_eventDescription = "ETA report"; + // Deliberately NOT an OOOI event: m_event is left alone, so the worker files no + // movement time and the Out and Off columns stay empty, which is the truth + return true; + } + + QRegularExpression re(R"(^/1([3-8])\s+(.+?)/\s*([A-Z0-9]{4})\s+([A-Z0-9]{4})\s+(\d{1,2})\s+(\d{6}))"); + QRegularExpressionMatch match = re.match(text); + if (!match.hasMatch()) + { + qDebug() << "AcarsEventReport: Failed to match " << text; + return false; + } + m_event = 10 + match.captured(1).toInt(); + m_eventDescription = match.captured(2).trimmed(); + m_departureAirport = match.captured(3); + m_arrivalAirport = match.captured(4); + m_day = match.captured(5).toInt(); + QString t = match.captured(6); + m_eventTime = QTime(t.mid(0, 2).toInt(), t.mid(2, 2).toInt(), t.mid(4, 2).toInt()); + + QRegularExpression fobRe(R"(/FOB\s+(\d+))"); + QRegularExpressionMatch fobMatch = fobRe.match(text); + if (fobMatch.hasMatch()) { + m_fuelOnBoard = fobMatch.captured(1).toInt(); + } + + // Position in degrees/minutes/seconds, e.g. N373703,W1222251 + QRegularExpression locDmsRe(R"(/LOC\s+([NS])(\d\d)(\d\d)(\d\d),\s*([EW])(\d{2,3})(\d\d)(\d\d))"); + QRegularExpressionMatch locMatch = locDmsRe.match(text); + if (locMatch.hasMatch()) + { + m_latitude = locMatch.captured(2).toFloat() + locMatch.captured(3).toFloat() / 60.0f + locMatch.captured(4).toFloat() / 3600.0f; + if (locMatch.captured(1) == "S") { + m_latitude = -m_latitude; + } + m_longitude = locMatch.captured(6).toFloat() + locMatch.captured(7).toFloat() / 60.0f + locMatch.captured(8).toFloat() / 3600.0f; + if (locMatch.captured(5) == "W") { + m_longitude = -m_longitude; + } + m_positionValid = true; + } + else + { + // Or decimal, e.g. +38.9603,-077.4595 + QRegularExpression locDecRe(R"(/LOC\s+([+-]\d{1,2}\.\d+),\s*([+-]\d{1,3}\.\d+))"); + locMatch = locDecRe.match(text); + if (locMatch.hasMatch()) + { + m_latitude = locMatch.captured(1).toFloat(); + m_longitude = locMatch.captured(2).toFloat(); + m_positionValid = true; + } + } + return true; +} + +QString AcarsEventReport::toString() +{ + if (m_eventDescription.isEmpty()) { + return ""; + } + // The destination and ETA form, which is not an event and has no event name to look + // up below - see decode() + if (m_eta.isValid()) + { + QStringList lines; + lines.append(QString("<b>Destination:</b> %1").arg(icaoAndAirportName(m_arrivalAirport))); + if (m_eventTime.isValid()) { + lines.append(QString("<b>Time:</b> %1").arg(m_eventTime.toString("hh:mm"))); + } + lines.append(QString("<b>ETA:</b> %1").arg(m_eta.toString("hh:mm"))); + return lines.join("<br>"); + } + const QHash<int, QString> events = { + {13, "Out of gate"}, + {14, "Takeoff"}, + {15, "Landing"}, + {16, "In gate"}, + {17, "Post report"}, + {18, "Post times report"} + }; + QStringList lines; + lines.append(QString("<b>Event:</b> %1 (%2)").arg(events[m_event]).arg(m_eventDescription)); + lines.append(QString("<b>Departure:</b> %1").arg(icaoAndAirportName(m_departureAirport))); + lines.append(QString("<b>Arrival:</b> %1").arg(icaoAndAirportName(m_arrivalAirport))); + if (m_eventTime.isValid()) { + lines.append(QString("<b>Time:</b> Day %1 %2").arg(m_day).arg(m_eventTime.toString("hh:mm:ss"))); + } + if (m_fuelOnBoard >= 0) { + lines.append(QString("<b>Fuel on board:</b> %1 t").arg(m_fuelOnBoard / 10.0, 0, 'f', 1)); + } + if (m_positionValid) { + lines.append(QString("<b>Position:</b> %1").arg(positionString(m_latitude, m_longitude))); + } + return lines.join("<br>"); +} + +bool AcarsEventReport::getPosition(float& latitude, float& longitude, int& altitudeFt) const +{ + if (!m_positionValid) { + return false; + } + latitude = m_latitude; + longitude = m_longitude; + altitudeFt = -1; + return true; +} + +AcarsOpsReport::AcarsOpsReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// Coordinates in label 80 reports appear as N29395 (degrees x1000) or N3539.2 +// (degrees then decimal minutes) +static bool parseOpsCoordinate(const QString& s, float& value) +{ + QRegularExpression plainRe(R"(^([NSEW])(\d+)$)"); + QRegularExpressionMatch match = plainRe.match(s); + if (match.hasMatch()) + { + int degDigits = match.captured(2).size() - 3; + value = match.captured(2).left(degDigits).toFloat() + + match.captured(2).mid(degDigits).toFloat() / 1000.0f; + if ((match.captured(1) == "S") || (match.captured(1) == "W")) { + value = -value; + } + return true; + } + QRegularExpression minRe(R"(^([NSEW])(\d+)(\d\d\.\d)$)"); + match = minRe.match(s); + if (match.hasMatch()) + { + value = match.captured(2).toFloat() + match.captured(3).toFloat() / 60.0f; + if ((match.captured(1) == "S") || (match.captured(1) == "W")) { + value = -value; + } + return true; + } + return false; +} + +// Airline operational reports, e.g: +// 3N01 POSRPT 5891/04 KIAH/MMGL .XA-VOI +// /POS N29395W095133/ALT +15608/MCH 558/FOB 0100/ETA 0410 +// with OPNORM and INRANG variants, and optional /FL /TAS /SAT /HDG /NWYP /SPD /UTC +// keyed fields. Formats per airframes.io's decoder test vectors. +bool AcarsOpsReport::decode(const QString &text) +{ + QRegularExpression hdrRe(R"(^3\w0\d\s+(POSRPT|OPNORM|INRANG)\s+(\w+)/(\d{1,2})\s+([A-Z0-9]{4})/([A-Z0-9]{4})\s+\.([A-Z0-9-]+))"); + QRegularExpressionMatch match = hdrRe.match(text); + if (!match.hasMatch()) + { + qDebug() << "AcarsOpsReport: Failed to match " << text; + return false; + } + m_reportType = match.captured(1); + m_reportFlight = match.captured(2); + m_day = match.captured(3).toInt(); + m_departureAirport = match.captured(4); + m_arrivalAirport = match.captured(5); + m_tail = match.captured(6); + + // Keyed fields anywhere in the remainder + auto keyed = [&text](const char *pattern) -> QString + { + QRegularExpression re{QString(pattern)}; + QRegularExpressionMatch m = re.match(text); + return m.hasMatch() ? m.captured(1) : QString(); + }; + + QString pos = keyed(R"(/POS\s+([NS][\d.]+)\s?([EW][\d.]+))"); + if (!pos.isEmpty()) + { + QRegularExpression posRe(R"(/POS\s+([NS][\d.]+)\s?([EW][\d.]+))"); + QRegularExpressionMatch posMatch = posRe.match(text); + float lat, lon; + if (parseOpsCoordinate(posMatch.captured(1), lat) && parseOpsCoordinate(posMatch.captured(2), lon)) + { + m_latitude = lat; + m_longitude = lon; + m_positionValid = true; + } + } + QString alt = keyed(R"(/ALT\s+\+?(\d+))"); + if (!alt.isEmpty()) { + m_altitudeFt = alt.toInt(); + } + QString fl = keyed(R"(/FL\s+(\d+))"); + if (!fl.isEmpty()) { + m_altitudeFt = fl.toInt() * 100; + } + m_nextWaypoint = keyed(R"(/NWYP\s+(\w+))"); + QString hdg = keyed(R"(/HDG\s+(\d+))"); + if (!hdg.isEmpty()) { + m_headingDeg = hdg.toInt(); + } + QString mch = keyed(R"(/MCH\s+(\d+))"); + if (!mch.isEmpty()) { + m_machX1000 = mch.toInt(); + } + QString spd = keyed(R"(/(?:TAS|SPD)\s+(\d+))"); + if (!spd.isEmpty()) { + m_speedKts = spd.toInt(); + } + QString sat = keyed(R"(/SAT\s+([+-]?\d+))"); + if (!sat.isEmpty()) + { + m_temperatureC = sat.toInt(); + m_temperatureValid = true; + } + m_fuelOnBoard = keyed(R"(/FOB\s+([N\d.]+))"); + QString utc = keyed(R"(/UTC\s+(\d{6}))"); + if (!utc.isEmpty()) { + m_time = QTime(utc.mid(0, 2).toInt(), utc.mid(2, 2).toInt(), utc.mid(4, 2).toInt()); + } + QString eta = keyed(R"(/ETA\s+(\d\d):?(\d\d))"); + if (!eta.isEmpty()) + { + QRegularExpression etaRe(R"(/ETA\s+(\d\d):?(\d\d))"); + QRegularExpressionMatch etaMatch = etaRe.match(text); + m_eta = QTime(etaMatch.captured(1).toInt(), etaMatch.captured(2).toInt()); + } + return true; +} + +QString AcarsOpsReport::toString() +{ + if (m_reportType.isEmpty()) { + return ""; + } + const QHash<QString, QString> reportTypes = { + {"POSRPT", "Position report"}, + {"OPNORM", "Operations normal"}, + {"INRANG", "In range"} + }; + QStringList lines; + lines.append(QString("<b>Report:</b> %1").arg(reportTypes.value(m_reportType, m_reportType))); + lines.append(QString("<b>Flight:</b> %1").arg(m_reportFlight)); + lines.append(QString("<b>Aircraft:</b> %1").arg(m_tail)); + lines.append(QString("<b>Departure:</b> %1").arg(icaoAndAirportName(m_departureAirport))); + lines.append(QString("<b>Arrival:</b> %1").arg(icaoAndAirportName(m_arrivalAirport))); + if (m_positionValid) { + lines.append(QString("<b>Position:</b> %1").arg(positionString(m_latitude, m_longitude))); + } + if (m_altitudeFt >= 0) { + lines.append(QString("<b>Altitude:</b> %1 ft").arg(m_altitudeFt)); + } + if (!m_nextWaypoint.isEmpty()) { + lines.append(QString("<b>Next waypoint:</b> %1").arg(m_nextWaypoint)); + } + if (m_headingDeg >= 0) { + lines.append(QString("<b>Heading:</b> %1%2").arg(m_headingDeg).arg(QChar(0xB0))); + } + if (m_machX1000 >= 0) { + lines.append(QString("<b>Mach:</b> %1").arg(m_machX1000 / 1000.0, 0, 'f', 3)); + } + if (m_speedKts >= 0) { + lines.append(QString("<b>Speed:</b> %1 kts").arg(m_speedKts)); + } + if (m_temperatureValid) { + lines.append(QString("<b>Temperature:</b> %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); + } + if (!m_fuelOnBoard.isEmpty()) { + lines.append(QString("<b>Fuel on board:</b> %1").arg(m_fuelOnBoard)); + } + if (m_time.isValid()) { + lines.append(QString("<b>Time:</b> Day %1 %2").arg(m_day).arg(m_time.toString("hh:mm:ss"))); + } + if (m_eta.isValid()) { + lines.append(QString("<b>ETA:</b> %1").arg(m_eta.toString("hh:mm"))); + } + return lines.join("<br>"); +} + +bool AcarsOpsReport::getPosition(float& latitude, float& longitude, int& altitudeFt) const +{ + if (!m_positionValid) { + return false; + } + latitude = m_latitude; + longitude = m_longitude; + altitudeFt = m_altitudeFt; + return true; +} + +bool ARINC622::decode(const QString &text, bool uplink) +{ + QRegularExpression re(R"(\/(?:\w\w )?(\w*)\.(\w\w\d)([\.\w\-]{7})(.*)(\w\w\w\w))"); + QRegularExpressionMatch match = re.match(text.simplified()); + if (match.hasMatch()) + { + m_atcCenter = match.captured(1); + m_imi = match.captured(2); + m_aircraft = match.captured(3); + while (m_aircraft.startsWith(".")) { + m_aircraft = m_aircraft.mid(1); // Remove "." prefix + } + // m_aircraft should be checked against ACARS registration field to ensure they match + m_app = match.captured(4); + if ((m_imi == "AT1") || (m_imi == "CR1")) + { + DO219Decoder decoder; + m_do219 = decoder.decode(m_app, uplink); + } + + m_crc = match.captured(5).toInt(nullptr, 16); + m_valid = true; + return true; + } + else + { + return false; + } +} + +QString ARINC622::toString() +{ + if (m_valid) + { + QString s = QString("<b>ATC Center:</b> %1<br><b>IMI:</b> %2<br><b>Aircraft:</b> %3<br><b>CRC:</b> %4") + .arg(m_atcCenter) + .arg(m_imis[m_imi]) + .arg(m_aircraft) + .arg(QString::number(m_crc, 16)); + + if (!m_do219.isEmpty()) { + s.append(QString("<br><b>CPDLC decode:</b> %1").arg(m_do219)); + } else if (!m_app.isEmpty()) { + s.append(QString("<br><b>CPDLC data:</b> %1").arg(m_app)); + } + return s; + } + else + { + return ""; + } +} + +AcarsATCCommunications::AcarsATCCommunications(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsATCCommunications::decode(const QString &text) +{ + return m_622.decode(text, m_uplink); +} + +QString AcarsATCCommunications::toString() +{ + return m_622.toString(); +} + +AcarsMessageFromSubsystem::AcarsMessageFromSubsystem(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// The FMS's own predicted route, out of the /FH block a position report carries in its +// additional data. +// +// Worth having because the route field of the same message is often nearly empty - one +// real position report gave "ILSZ 10 VILNA", an approach and a single fix, while the FH +// block behind it listed 32 fixes all the way from the aircraft to the runway, each with +// the time, altitude, speed, wind and temperature the FMS expects there. +// +// The format is not documented anywhere I can find, so it was worked out from the data +// and every field checked against something independent. Records are separated by "." +// and each is exactly 11 comma separated fields: +// +// SIT01,043946,249K,3800,162,M52,254071,456,N,174,22 +// name eta cas alt fuel oat wind gs ? trk dist +// +// eta the message's own "next waypoint ETA" matched the first record's exactly +// alt tens of feet - 3800 is FL380, which is the altitude the report gives, and +// the last record reads 14 for Alicante, whose elevation is 141 ft +// oat M/P and degrees, M52 against the report's own -53 C at the fix before it +// wind three digits of direction and three of speed, moving smoothly along the route +// gs confirmed on every one of 27 consecutive pairs: distance divided by the gap +// between the two ETAs comes out within a few percent of it +// dist nautical miles from the previous fix, or from the aircraft for the first +// +// Only the name, altitude and ETA are taken. The fixes are NOT positioned from track and +// distance, tempting as that is with both in hand: dead reckoned against the fixes the +// databases can place, it came out 13 nm adrift at the first and 73 nm by the last, so +// it would draw a route visibly beside the real one. The names are placed the usual way +// instead, and the ones no database holds - SIT01, IAT18, RW10, the FMS's own computed +// fixes - are simply dropped, as any unplaceable fix is. +// Fields in one record of a predicted route block, which is what identifies the block +static const int ACARS_FH_FIELDS = 11; + +// The rest of the additional data a position report carries: slash separated blocks, +// most of them tagged with two letters. Worked out from 45 reports off air and each +// field checked against something the message says independently, or against the other +// blocks, rather than assumed. +// +// 239058,227 / DTLCPH,,67,183600,73 / PR1561,238,370,227,,44,7,237056,M49,60,P58,P0 +// +// The leading block, which carries no tag, is the wind at the aircraft and the fuel +// remaining. The wind repeats inside the PR block, within a degree or two. +// +// DT is the destination: +// +// DTLCPH , 19L , 67 , 183600 , 73 +// icao rwy fuel eta ? +// +// icao agreed with the report's own arrival airport on all 38 that carried one +// fuel never more than the fuel remaining, on all 37 that could be compared, and on +// a report that also carried a predicted route it equalled the last fix's fuel +// eta a valid hh:mm:ss on all 38, and equal to the predicted route's arrival at the +// runway on the report that had both +// +// PR is the flight as planned. Its third field is the CRUISE level, not the current +// altitude: it was at or above the reported altitude on all 41, and one report climbing +// out of Heathrow at 3800 ft gave 390. Field 9 is a temperature, within about 4 C of the +// reported one - close but not the same figure, so it is forecast rather than measured, +// and it is not used. The first field (PR1561) is probably a weight, but nothing here +// confirms it, so it is left alone. +void AcarsMessageFromSubsystem::extractAdditionalBlocks(const QString& additional) +{ + if (additional.isEmpty()) { + return; + } + + const QStringList blocks = additional.split('/'); + + for (int i = 0; i < blocks.size(); i++) + { + const QString& block = blocks[i]; + const QStringList fields = block.split(','); + + // The wind and the fuel, in the block before any tag + if ((i == 0) && (fields.size() >= 2)) + { + static const QRegularExpression windRe(R"(^([0-9]{3})([0-9]{2,3})$)"); + const QRegularExpressionMatch wind = windRe.match(fields[0].trimmed()); + if (wind.hasMatch()) + { + m_windValid = true; + m_windDirection = wind.captured(1).toInt(); + m_windSpeed = wind.captured(2).toInt(); + } + bool ok = false; + const int fuel = fields[1].trimmed().toInt(&ok); + if (ok) + { + m_fuelValid = true; + m_fuel = fuel; + } + continue; + } + + if (block.startsWith("FN")) + { + // Runs to the next block or, when it is the last, to the four character + // checksum the FMC puts on the end - "/FNUAL972C744" is UAL972, not + // UAL972C744. Taken as three letters and up to four alphanumerics, which is + // what a callsign is, so a checksum run together with it is not swallowed. + static const QRegularExpression callsignRe(R"RX(^FN([A-Z]{3}[A-Z0-9]{1,4}))RX"); + const QRegularExpressionMatch callsign = callsignRe.match(block); + if (callsign.hasMatch()) { + m_icaoCallsign = callsign.captured(1); + } + continue; + } + + if (block.startsWith("DT") && (fields.size() >= 4)) + { + m_destination = fields[0].mid(2).trimmed(); + m_destinationRunway = stripRunwayFiller(fields[1].trimmed()); + bool ok = false; + const int fuel = fields[2].trimmed().toInt(&ok); + if (ok) + { + m_destinationFuelValid = true; + m_destinationFuel = fuel; + } + const QString eta = fields[3].trimmed(); + if (eta.size() == 6) + { + const QTime time(eta.mid(0, 2).toInt(), eta.mid(2, 2).toInt(), + eta.mid(4, 2).toInt()); + if (time.isValid()) + { + m_destinationEtaValid = true; + m_destinationEta = time; + } + } + } + else if (block.startsWith("PR") && (fields.size() >= 3)) + { + bool ok = false; + const int level = fields[2].trimmed().toInt(&ok); + // A flight level, so hundreds of feet and not a silly one + if (ok && (level > 0) && (level <= 600)) + { + m_cruiseLevelValid = true; + m_cruiseLevelFt = level * 100; + } + } + } + + // A route from an insert names its fixes and nothing else, so the line is drawn flat + // on the ground. The cruise level is the one altitude the message does give, and it + // is right for the fixes in the middle of the route - but not for the ends, which + // are the airports the flight runs between, and not for a fix a predicted route has + // already given a real altitude. + if (m_cruiseLevelValid) + { + for (int i = 0; i < m_fpnWaypoints.size(); i++) + { + FpnWaypoint& waypoint = m_fpnWaypoints[i]; + // By name, not by position: an airport is four characters, and skipping the + // first and last entries would drop two perfectly good fixes from a list that + // does not have to start or end with one + if (!waypoint.m_hasAltitude && (waypoint.m_name.size() != 4)) + { + waypoint.m_hasAltitude = true; + waypoint.m_altitudeFt = m_cruiseLevelFt; + } + } + } +} + +bool AcarsMessageFromSubsystem::extractPredictedRoute(const QString& additional) +{ + const int at = additional.indexOf("/FH"); + if (at < 0) { + return false; + } + QString block = additional.mid(at + 3); + const int end = block.indexOf('/'); + if (end >= 0) { + block = block.left(end); + } + + // Digits only. Long messages come out of reassembly with the odd character inserted + // into a field - one had a stray B every 207 characters, in the middle of numbers + // that were otherwise correct - and a whole fix should not be lost to one of them. + auto number = [](const QString& field, bool *ok) + { + QString digits; + for (const QChar& c : field) + { + if (c.isDigit()) { + digits.append(c); + } + } + return digits.isEmpty() ? (*ok = false, 0) : (*ok = true, digits.toInt()); + }; + + QList<FpnWaypoint> waypoints; + QStringList names; + + for (const QString& record : block.split('.', Qt::SkipEmptyParts)) + { + const QStringList fields = record.split(','); + // Exactly 11, which is what makes this block recognisable rather than guessed at + if (fields.size() != ACARS_FH_FIELDS) { + continue; + } + const QString name = fields[0].trimmed(); + if (name.isEmpty()) { + continue; + } + + FpnWaypoint waypoint; + waypoint.m_name = name; + + bool ok = false; + const int altitude = number(fields[3], &ok); + if (ok) + { + waypoint.m_hasAltitude = true; + waypoint.m_altitudeFt = altitude * 10; + } + const QString eta = fields[1].trimmed(); + if (eta.size() == 6) + { + const QTime time(eta.mid(0, 2).toInt(), eta.mid(2, 2).toInt(), eta.mid(4, 2).toInt()); + if (time.isValid()) + { + waypoint.m_hasEta = true; + waypoint.m_eta = time; + } + } + + waypoints.append(waypoint); + names.append(name); + } + + if (waypoints.size() < 2) { + return false; + } + + // Only where it says more than what is already held. The route field of a position + // report is whatever the FMS put in it, and on some aircraft that IS the full path - + // this must not throw that away for a predicted one. + const int held = m_fpnRoute.split(QRegularExpression("[ .]+"), Qt::SkipEmptyParts).size(); + if ((int) names.size() <= held) { + return false; + } + + m_fpnRoute = names.join(" "); + m_fpnWaypoints = waypoints; + return true; +} + +bool AcarsMessageFromSubsystem::decode(const QString &text) +{ + if (m_622.decode(text, m_uplink)) { + return true; + } + + // Not an ARINC 622 ATS message: try the FMS report formats, which start with a + // #<sublabel> prefix such as #M1B (FMC), e.g: + // #M1BPOSN43312W123174,EASON,215754,370,EBINY,220601,ELENN,M48,02216,185/TS215754,092122 + // #M1BFPN/RP:DA:KSFO:AA:KEWR:R:... + // Field meanings per airframes.io's acars-message-documentation research + QString t = text; + QRegularExpression subRe(R"(^#(\w{2}[A-Z]?))"); + QRegularExpressionMatch subMatch = subRe.match(t); + if (subMatch.hasMatch()) + { + m_fmsSublabel = subMatch.captured(1); + t = t.mid(subMatch.capturedLength()); + } + else if (!t.startsWith("POS") && !t.startsWith("FPN/") + && (t.mid(1).startsWith("POS") || t.mid(1).startsWith("FPN/"))) + { + // The header parse strips a #xx sublabel from the text, which can leave just + // the supplementary character (the B of #M1B) before the report type - this + // is the form the multipart assembler's combined text takes + m_fmsSublabel = m_subLabel + t.left(1); + t = t.mid(1); + } + else if (!m_subLabel.isEmpty()) + { + // The prefix was consumed by the block header parse, supplementary character and + // all, so the text starts straight at the report and the sublabel comes from + // there instead of from in front of it + m_fmsSublabel = m_subLabel + m_subLabelSupplement; + } + + // A route insert - the flight plan the FMS is flying - as ARINC 702A writes it: + // colon separated fields in an /RP: block, appended to a position report or sent on + // its own as an FPN message. The /RA: alternate block has the same shape. + // + // /RP:DA:EGLL:AA:ENGM:R:27L(01R):D:BPK7G:A:RIPA3L:AP:ILSY01R.VABLPU..BPK, + // N51450W000064.Q295.PAAVO..PAAVO,N51518E000513.M604.GIVPO..LARGA,N54518E004092 + // + // DA is the departure airport, AA the arrival, R the departure runway with the + // arrival's in brackets, D the SID, A the STAR and AP the lateral path. In the path + // "." separates a fix from the airway to the next one and ".." is a direct leg, and + // a fix may be followed by its position. R used to be read as the route, which is + // why a plan only ever plotted as its two airports: it is the runway. + auto extractFlightPlan = [this](const QString& s) + { + // Read within the /RP: block where there is one, so the /RA: alternate block's + // own DA and AA are not taken for this flight's + auto block = [](const QString& text, const QString& tag) -> QString + { + const int start = text.indexOf(tag + ":"); + if (start < 0) { + return QString(); + } + const int end = text.indexOf('/', start); + return (end >= 0) ? text.mid(start, end - start) : text.mid(start); + }; + auto field = [](const QString& text, const char *tag) -> QString + { + if (text.isEmpty()) { + return QString(); + } + const QRegularExpression re(QString(":%1:([^:/]*)").arg(tag)); + const QRegularExpressionMatch match = re.match(text); + return match.hasMatch() ? match.captured(1).trimmed() : QString(); + }; + + const QString rpBlock = block(s, "RP"); + const QString rp = rpBlock.isEmpty() ? s : rpBlock; + + // An airport is four characters, and a field runs to the next : or / - so + // anything an airline writes after the code comes back stuck to it. Two forms + // turn up: the route written straight after the arrival, :AA:HEGN..DVR.UL9.., and + // the landing runway in brackets, :AA:ESSA(19L). Both left an "airport" that no + // database could match and that nothing would treat as an airport, so the + // arrival went missing from the tables and the Map, and the route with it. + // + // The trailing character has to be one an ICAO code cannot contain, or a longer + // identifier would be cut down to a valid looking code that is not the one meant. + auto airport = [](const QString& value, QString *bracketed = nullptr) + { + // Four characters, then either something that is not part of a code or the + // end of the field. The end matters because the checksum can be welded on + // with nothing in between - an alternate of KMKE86AC is KMKE with 86AC after + // it - and an ICAO code is exactly four, so anything beyond that is not part + // of it. + static const QRegularExpression airportRe(R"(^([A-Z0-9]{4})(?:[^A-Z0-9]|$))"); + QRegularExpressionMatch match = airportRe.match(value); + if (!match.hasMatch()) + { + static const QRegularExpression codeAndTailRe(R"(^([A-Z0-9]{4})[A-Z0-9]+$)"); + match = codeAndTailRe.match(value); + } + if (!match.hasMatch()) { + return value; + } + // The runway is worth keeping where it is the only place it is given + static const QRegularExpression runwayRe(R"(^[A-Z0-9]{4}\(([0-9]{2}[LRC]?)\))"); + const QRegularExpressionMatch runway = runwayRe.match(value); + if (bracketed && runway.hasMatch()) { + *bracketed = runway.captured(1); + } + return match.captured(1); + }; + + QString arrivalRunway; + m_fpnDeparture = airport(field(rp, "DA")); + m_fpnArrival = airport(field(rp, "AA"), &arrivalRunway); + m_fpnRunway = field(rp, "R"); + if (m_fpnRunway.isEmpty()) { + m_fpnRunway = arrivalRunway; + } + m_fpnRunway = stripRunwayFiller(m_fpnRunway); + m_fpnSid = field(rp, "D"); + m_fpnStar = field(rp, "A"); + // Through the same helper as the other two airports. It was taken raw, which + // was invisible until a message put its checksum straight onto the end of it - + // the alternate block is the last thing in the message, so it is the field that + // collects one - and the alternate read KMKE86AC. + m_fpnAlternate = airport(field(block(s, "RA"), "AA")); + + QString path = field(rp, "AP"); + if (path.isEmpty()) { + path = field(rp, "F"); + } + if (path.isEmpty()) + { + // Some aircraft hang the path straight off the arrival airport with no field + // of its own in front of it: + // + // FPN/RP:DA:EGPH:AA:EHAM..TLA,N55299W003212.Y96..OTBUN..ERKIT.N110..DOLAS + // + // The arrival is read off the front of that field either way - it stops at + // the first character that is not part of an ICAO code - so what is left after + // it was simply being thrown away, and a route written this way drew nothing + // at all between its two airports. + // + // Only when it is a path rather than a decoration: it has to start where the + // airport code ends and contain a separator, which "EHAM" alone and + // "ESSA(19L)" both fail. + const QString arrivalField = field(rp, "AA"); + if (arrivalField.startsWith(m_fpnArrival) && !m_fpnArrival.isEmpty()) + { + const QString rest = arrivalField.mid(m_fpnArrival.size()); + if (rest.startsWith('.')) { + path = rest; + } + } + } + // N51450 is 51 degrees 45.0 minutes north and W000064 is 0 degrees 6.4 minutes + // west: three digits of minutes of which the last is tenths, after two digits of + // degrees for latitude and three for longitude + // Not anchored at the end. The coordinate is thirteen characters and always the + // same shape, and the message writes its own checksum onto whatever field comes + // last - so the final fix of a route arrives as N37067W0814527814, which is + // N37067W081452 with 7814 stuck to it. Anchored, that matched nothing and the + // last fix of the route lost its position for the sake of four characters. + static const QRegularExpression coordRe(R"(^([NS])(\d{2})(\d{3})([EW])(\d{3})(\d{3}))"); + const QStringList tokens = path.split('.', Qt::SkipEmptyParts); + + // Everything before the first fix that carries a position is the approach and + // its transition: the path proper is the part that is placed. Where nothing is + // placed there is nothing to separate them by, and it is all route. + int first = 0; + while ((first < tokens.size()) + && !coordRe.match(tokens[first].section(',', 1, 1).trimmed()).hasMatch() + && !coordRe.match(tokens[first].section(',', 0, 0).trimmed()).hasMatch()) { + first++; + } + if (first >= tokens.size()) { + first = 0; + } else if (first > 0) { + m_fpnApproach = QStringList(tokens.mid(0, first)).join(" "); + } + + for (int i = first; i < tokens.size(); i++) + { + const QString name = tokens[i].section(',', 0, 0).trimmed(); + if (name.isEmpty()) { + continue; + } + // Usually NAME,POSITION - but a fix out over an ocean has no name to give, so + // the position IS the fix and stands on its own. An oceanic route is mostly + // made of them: + // + // BERGI.M90..LONAM..NALAN..N62000W010000..N63300W020000..N65000W030000.. + // + // Read as a name, each of those resolves against nothing and is dropped, which + // took the whole ocean crossing out of the drawn line and left it jumping from + // the last European fix to the first Canadian one. + const bool bare = coordRe.match(name).hasMatch(); + const QRegularExpressionMatch coord = bare + ? coordRe.match(name) + : coordRe.match(tokens[i].section(',', 1, 1).trimmed()); + + FpnWaypoint waypoint; + waypoint.m_name = name; + if (coord.hasMatch()) + { + waypoint.m_hasPosition = true; + waypoint.m_latitude = (coord.captured(2).toFloat() + + coord.captured(3).toFloat() / 600.0f) * (coord.captured(1) == "S" ? -1.0f : 1.0f); + waypoint.m_longitude = (coord.captured(5).toFloat() + + coord.captured(6).toFloat() / 600.0f) * (coord.captured(4) == "W" ? -1.0f : 1.0f); + } + + // A fix is usually given twice - once as the airway's far end and again + // with its position - so a name that has just repeated replaces rather than + // extends, keeping whichever of the two placed it + if (!m_fpnWaypoints.isEmpty() && (m_fpnWaypoints.last().m_name == name)) + { + if (waypoint.m_hasPosition) { + m_fpnWaypoints.last() = waypoint; + } + continue; + } + m_fpnWaypoints.append(waypoint); + } + + QStringList names; + for (const FpnWaypoint& waypoint : m_fpnWaypoints) { + names.append(waypoint.m_name); + } + m_fpnRoute = names.join(" "); + + // Older or airline specific forms write the route as free text after the + // arrival airport instead of as a path + if (m_fpnRoute.isEmpty() && !m_fpnArrival.isEmpty()) + { + static const QRegularExpression tailRe(R"(:AA:\w{4}\.+(.+)$)"); + const QRegularExpressionMatch tailMatch = tailRe.match(s); + if (tailMatch.hasMatch()) { + m_fpnRoute = tailMatch.captured(1).trimmed(); + } + } + + // A plan is filed in more than one insert: one carries the departure end and the + // en route path, another the arrival end - the STAR and the approach - and that + // one writes the approach where the path would be. The rule above cannot tell + // them apart, because it separates the approach from the path by the first fix + // that carries a position, and an insert like this places nothing. + // + // An approach names its aid and its runway, which a route never does, so the + // whole "path" being one of those is what identifies it. Called the route + // instead, it put "ILS 19L" in the Route column and left the Aircraft feature + // choosing between a path it could draw and one it could not. + static const QRegularExpression approachRe( + R"(^(ILS|LOC|LDA|SDF|RNAV|RNP|GPS|GNSS|VOR|VORDME|NDB|TACAN|VISUAL)[ .]?([0-9]{2}[LRC]?)?$)"); + if (m_fpnApproach.isEmpty() && !m_fpnRoute.isEmpty() + && approachRe.match(m_fpnRoute).hasMatch()) + { + m_fpnApproach = m_fpnRoute; + m_fpnRoute.clear(); + m_fpnWaypoints.clear(); + } + }; + + // Position report: position, last waypoint and time over it, altitude in flight + // levels, next waypoint and its ETA, the waypoint after, and the static air + // temperature. Latitude and longitude are degrees x1000. + QRegularExpression posRe(R"(^POS([NS])(\d{4,5})([EW])(\d{5,6}),([^,]*),(\d{6}),(\d+),([^,]*),(\d{6}),([^,]*),([MP])\s?(\d+)(.*)$)"); + QRegularExpressionMatch posMatch = posRe.match(t); + if (posMatch.hasMatch()) + { + m_latitude = posMatch.captured(2).toFloat() / 1000.0f * (posMatch.captured(1) == "S" ? -1.0f : 1.0f); + m_longitude = posMatch.captured(4).toFloat() / 1000.0f * (posMatch.captured(3) == "W" ? -1.0f : 1.0f); + m_positionValid = true; + m_lastWaypoint = posMatch.captured(5); + QString ts = posMatch.captured(6); + m_timeOver = QTime(ts.mid(0, 2).toInt(), ts.mid(2, 2).toInt(), ts.mid(4, 2).toInt()); + m_altitudeFt = posMatch.captured(7).toInt() * 100; + m_nextWaypoint = posMatch.captured(8); + ts = posMatch.captured(9); + m_etaNext = QTime(ts.mid(0, 2).toInt(), ts.mid(2, 2).toInt(), ts.mid(4, 2).toInt()); + m_nextPlus1Waypoint = posMatch.captured(10); + m_temperatureC = posMatch.captured(12).toInt(); + if (posMatch.captured(11) == "M") { + m_temperatureC = -m_temperatureC; + } + m_temperatureValid = true; + QString additional = posMatch.captured(13); + if (additional.startsWith(",")) { + additional = additional.mid(1); + } + m_posAdditionalData = additional.trimmed(); + // A position report can carry a route insert after the report fields; it is + // decoded into the flight plan fields above, so the several hundred characters + // it occupies are dropped from the raw remainder rather than shown twice. Cut + // out just those blocks: what follows them is a different subsystem's data. + extractFlightPlan(m_posAdditionalData); + // And the FMS's predicted route, which is a different block and usually says far + // more about where the aircraft is going than the route field does + extractPredictedRoute(m_posAdditionalData); + // Last, because it fills in the altitude of whatever waypoints the blocks above + // produced + extractAdditionalBlocks(m_posAdditionalData); + static const QRegularExpression insertRe(R"(/R[PIA]:[^/]*)"); + m_posAdditionalData.remove(insertRe); + m_posAdditionalData = m_posAdditionalData.trimmed(); + return true; + } + + // Flight plan + if (t.startsWith("FPN/")) + { + extractFlightPlan(t); + return !m_fpnDeparture.isEmpty() || !m_fpnArrival.isEmpty() || !m_fpnRoute.isEmpty() + || !m_fpnRunway.isEmpty() || !m_fpnSid.isEmpty() || !m_fpnStar.isEmpty(); + } + + return false; +} + +QString AcarsMessageFromSubsystem::toString() +{ + if (m_622.m_valid) { + return m_622.toString(); + } + QStringList lines; + bool hasFpn = !m_fpnDeparture.isEmpty() || !m_fpnArrival.isEmpty() || !m_fpnRoute.isEmpty() + || !m_fpnRunway.isEmpty() || !m_fpnSid.isEmpty() || !m_fpnStar.isEmpty() + || !m_fpnApproach.isEmpty() || !m_fpnAlternate.isEmpty(); + if (m_positionValid) + { + lines.append(QString("<b>Position:</b> %1").arg(positionString(m_latitude, m_longitude))); + if (m_altitudeFt >= 0) { + lines.append(QString("<b>Altitude:</b> %1 ft").arg(m_altitudeFt)); + } + if (!m_lastWaypoint.isEmpty()) { + lines.append(QString("<b>Last waypoint:</b> %1 at %2").arg(m_lastWaypoint).arg(m_timeOver.toString("hh:mm:ss"))); + } + if (!m_nextWaypoint.isEmpty()) { + lines.append(QString("<b>Next waypoint:</b> %1 ETA %2").arg(m_nextWaypoint).arg(m_etaNext.toString("hh:mm:ss"))); + } + if (!m_nextPlus1Waypoint.isEmpty()) { + lines.append(QString("<b>Then:</b> %1").arg(m_nextPlus1Waypoint)); + } + if (m_temperatureValid) { + lines.append(QString("<b>Temperature:</b> %1%2C").arg(m_temperatureC).arg(QChar(0xB0))); + } + } + if (hasFpn) + { + // In the order the flight is flown, rather than the order the fields happen + // to appear in the message + if (!m_fpnDeparture.isEmpty()) { + lines.append(QString("<b>Departure:</b> %1").arg(icaoAndAirportName(m_fpnDeparture))); + } + if (!m_fpnRunway.isEmpty()) { + lines.append(QString("<b>Runway:</b> %1").arg(m_fpnRunway)); + } + if (!m_fpnSid.isEmpty()) { + lines.append(QString("<b>SID:</b> %1").arg(m_fpnSid)); + } + if (!m_fpnRoute.isEmpty()) { + lines.append(QString("<b>Route:</b> %1").arg(m_fpnRoute)); + } + if (!m_fpnStar.isEmpty()) { + lines.append(QString("<b>STAR:</b> %1").arg(m_fpnStar)); + } + if (!m_fpnApproach.isEmpty()) { + lines.append(QString("<b>Approach:</b> %1").arg(m_fpnApproach)); + } + if (!m_fpnArrival.isEmpty()) { + lines.append(QString("<b>Arrival:</b> %1").arg(icaoAndAirportName(m_fpnArrival))); + } + if (!m_fpnAlternate.isEmpty()) { + lines.append(QString("<b>Alternate:</b> %1").arg(icaoAndAirportName(m_fpnAlternate))); + } + } + if (m_windValid) { + // The degree sign itself, not an HTML entity: the document is rendered as plain + // text, so an entity would be shown literally + lines.append(QString("<b>Wind:</b> %1%2 / %3 kn") + .arg(m_windDirection, 3, 10, QChar('0')).arg(QChar(0xB0)).arg(m_windSpeed)); + } + if (m_fuelValid) { + lines.append(QString("<b>Fuel:</b> %1").arg(m_fuel)); + } + if (m_cruiseLevelValid) { + lines.append(QString("<b>Cruise level:</b> FL%1").arg(m_cruiseLevelFt / 100)); + } + if (m_destinationEtaValid) { + lines.append(QString("<b>Destination ETA:</b> %1") + .arg(m_destinationEta.toString("hh:mm:ss"))); + } + if (!m_destinationRunway.isEmpty()) { + lines.append(QString("<b>Destination runway:</b> %1").arg(m_destinationRunway)); + } + if (m_destinationFuelValid) { + lines.append(QString("<b>Fuel on arrival:</b> %1").arg(m_destinationFuel)); + } + if (m_positionValid && !m_posAdditionalData.isEmpty()) { + lines.append(QString("<b>Additional data:</b> %1").arg(m_posAdditionalData)); + } + if (lines.isEmpty()) { + return ""; + } + if (!m_fmsSublabel.isEmpty()) { + lines.prepend(QString("<b>Subsystem:</b> %1").arg(m_fmsSublabel)); + } + return lines.join("<br>"); +} + +bool AcarsMessageFromSubsystem::getPosition(float& latitude, float& longitude, int& altitudeFt) const +{ + if (!m_positionValid) { + return false; + } + latitude = m_latitude; + longitude = m_longitude; + altitudeFt = m_altitudeFt; + return true; +} + +AcarsOutReport::AcarsOutReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsOutReport::decode(const QString &text) +{ + m_departure = text.mid(0, 4); + m_destination = text.mid(4, 4); + m_outTimeHours = text.mid(8, 2).toInt(); + m_outTimeMinutes = text.mid(10, 2).toInt(); + m_fuel = text.mid(12, 4).toInt(); + m_boardedFuel = text.mid(16, 4); // Can be ----- + m_freeText = text.mid(20, text.length() - 1).trimmed(); + return true; +} + +QString AcarsOutReport::toString() +{ + QString s = QString("<b>Departure:</b> %1<br><b><b>Destination:</b> %2<br><b><b>Out time:</b> %3:%4<br><b><b>Fuel:</b> %5<br><b><b>Boarded fuel:</b> %6") + .arg(icaoAndAirportName(m_departure)) + .arg(icaoAndAirportName(m_destination)) + .arg(m_outTimeHours, 2, 10, QChar('0')) + .arg(m_outTimeMinutes, 2, 10, QChar('0')) + .arg(m_fuel) + .arg(m_boardedFuel); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +AcarsOffReport::AcarsOffReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsOffReport::decode(const QString &text) +{ + m_departure = text.mid(0, 4); + m_destination = text.mid(4, 4); + m_offTimeHours = text.mid(8, 2).toInt(); + m_offTimeMinutes = text.mid(10, 2).toInt(); + m_freeText = text.mid(12, text.length() - 1).trimmed(); + return true; +} + +QString AcarsOffReport::toString() +{ + QString s = QString("<b>Departure:</b> %1<br><b>Destination:</b> %2<br><b>Off time:</b> %3:%4") + .arg(icaoAndAirportName(m_departure)) + .arg(icaoAndAirportName(m_destination)) + .arg(m_offTimeHours, 2, 10, QChar('0')) + .arg(m_offTimeMinutes, 2, 10, QChar('0')); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +AcarsOnReport::AcarsOnReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsOnReport::decode(const QString &text) +{ + m_departure = text.mid(0, 4); + m_destination = text.mid(4, 4); + m_onTimeHours = text.mid(8, 2).toInt(); + m_onTimeMinutes = text.mid(10, 2).toInt(); + m_freeText = text.mid(12, text.length() - 1).trimmed(); + return true; +} + +QString AcarsOnReport::toString() +{ + QString s = QString("<b>Departure:</b> %1<br><b>Destination:</b> %2<br><b>On time:</b> %3:%4") + .arg(icaoAndAirportName(m_departure)) + .arg(icaoAndAirportName(m_destination)) + .arg(m_onTimeHours, 2, 10, QChar('0')) + .arg(m_onTimeMinutes, 2, 10, QChar('0')); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +AcarsInReport::AcarsInReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsInReport::decode(const QString &text) +{ + m_departure = text.mid(0, 4); + m_destination = text.mid(4, 4); + m_inTimeHours = text.mid(8, 2).toInt(); + m_inTimeMinutes = text.mid(10, 2).toInt(); + m_fuel = text.mid(12, 4).toInt(); + m_captainFirstOfficerId = (text.length() > 16) ? text[16] : QChar(); + m_landingCategory = (text.length() > 17) ? text[17] : QChar(); + m_freeText = text.mid(18, text.length() - 1).trimmed(); + return true; +} + +QString AcarsInReport::toString() +{ + QString s = QString("<b>Departure:</b> %1<br><b>Destination:</b> %2<br><b>In time:</b> %3:%4<br><b>Fuel:</b> %5<br>Id: %6<br><b>Landing category:</b> %7") + .arg(icaoAndAirportName(m_departure)) + .arg(icaoAndAirportName(m_destination)) + .arg(m_inTimeHours, 2, 10, QChar('0')) + .arg(m_inTimeMinutes, 2, 10, QChar('0')) + .arg(m_fuel) + .arg(m_captainFirstOfficerId) + .arg(m_landingCategory); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +AcarsOutReturnInReport::AcarsOutReturnInReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsOutReturnInReport::decode(const QString &text) +{ + m_departure = text.mid(0, 4); + m_destination = text.mid(4, 4); + m_outTimeHours = text.mid(8, 2).toInt(); + m_outTimeMinutes = text.mid(10, 2).toInt(); + m_returnInTimeHours = text.mid(12, 2).toInt(); + m_returnInTimeMinutes = text.mid(14, 2).toInt(); + m_fuel = text.mid(16, 4).toInt(); + m_freeText = text.mid(20, text.length() - 1).trimmed(); + return true; +} + +QString AcarsOutReturnInReport::toString() +{ + QString s = QString("<b>Departure:</b> %1<br><b>Destination:</b> %2<br><b>Out time:</b> %3:%4<br><b>Return in time:</b> %5:%6<br><b>Fuel:</b> %7") + .arg(icaoAndAirportName(m_departure)) + .arg(icaoAndAirportName(m_destination)) + .arg(m_outTimeHours, 2, 10, QChar('0')) + .arg(m_outTimeMinutes, 2, 10, QChar('0')) + .arg(m_returnInTimeHours, 2, 10, QChar('0')) + .arg(m_returnInTimeMinutes, 2, 10, QChar('0')) + .arg(m_fuel); + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} + +// ARINC 620 + +AcarsShortOooiReport::AcarsShortOooiReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +bool AcarsShortOooiReport::decode(const QString &text) +{ + // Which event this is comes from the label, not from the text - the text says only + // where and when. QG reports two events at once, the departure and the return, and + // is recorded as the return because that is the one that ends the movement. + static const QHash<QString, int> events = { + {"QA", AircraftReport::OooiOut}, // Out, with fuel + {"QB", AircraftReport::OooiOff}, + {"QD", AircraftReport::OooiIn}, // In, with fuel + {"QE", AircraftReport::OooiOut}, // Out, with fuel and destination + {"QF", AircraftReport::OooiOff}, // Off, with destination + {"QG", AircraftReport::OooiIn}, // Out and back in again + }; + m_event = events.value(m_label, AircraftReport::OooiNone); + + const QString flat = text.split(QRegularExpression("[\r\n]")).first(); + + // Station and time. The station is three characters and may be dashes; the time is + // four digits run straight on to it. + static const QRegularExpression headRe(R"(^([A-Z]{3}|-{3})(\d{2})(\d{2}))"); + const QRegularExpressionMatch head = headRe.match(flat); + if (!head.hasMatch()) { + return false; + } + const int hours = head.captured(2).toInt(); + const int minutes = head.captured(3).toInt(); + if ((hours > 23) || (minutes > 59)) { + return false; // Four digits that are not a time, so not this format + } + if (!head.captured(1).startsWith('-')) { + m_station = head.captured(1); + } + m_time = QTime(hours, minutes); + + QString rest = flat.mid(head.capturedLength(0)); + + // A second time immediately after the first, which QG and Q1 use for the return and + // the arrival. Only where it really is a time - the other labels put fuel here. + if ((m_label == "QG") || (m_label == "Q1")) + { + static const QRegularExpression secondRe(R"(^(\d{2})(\d{2}))"); + const QRegularExpressionMatch second = secondRe.match(rest); + if (second.hasMatch() + && (second.captured(1).toInt() <= 23) && (second.captured(2).toInt() <= 59)) + { + m_secondTime = QTime(second.captured(1).toInt(), second.captured(2).toInt()); + rest = rest.mid(second.capturedLength(0)); + } + } + + // The trailing blocks, taken off before anything else is read so that a code inside + // one of them cannot be mistaken for the destination + // The block code is two or three characters and is not always letters - /FB and + // /FUL sit alongside /A1 and /A2 in the same message + static const QRegularExpression extraRe(R"(/[A-Z][A-Z0-9]{1,2}\s*[0-9A-Z]*)"); + QRegularExpressionMatchIterator extras = extraRe.globalMatch(rest); + int firstExtra = rest.size(); + while (extras.hasNext()) + { + const QRegularExpressionMatch e = extras.next(); + m_extras.append(e.captured(0).trimmed()); + firstExtra = std::min(firstExtra, (int) e.capturedStart(0)); + } + rest = rest.left(firstExtra); + + // The destination closes the fixed part, whether it comes straight after the time + // (SAT1458SFO) or after the fuel (SYD0642 62MEL) + static const QRegularExpression destRe(R"(([A-Z]{3})\s*$)"); + const QRegularExpressionMatch dest = destRe.match(rest); + if (dest.hasMatch()) + { + m_destination = dest.captured(1); + rest = rest.left(dest.capturedStart(1)); + } + + // The numeric run between the time and the destination is the fuel on the three + // labels registered as carrying it, and something else - a counter, a distance - + // on the rest. Only the three are read: naming a number "fuel" because it sits + // where fuel sits on another label is a guess, and a wrong one shows as a fact. + const QString remainder = rest.trimmed(); + static const QRegularExpression fuelRe(R"(^\d+$)"); + const bool carriesFuel = (m_label == "QA") || (m_label == "QD") || (m_label == "QE"); + if (carriesFuel && fuelRe.match(remainder).hasMatch()) { + m_fuel = remainder; + } + return true; +} + +QString AcarsShortOooiReport::toString() +{ + if (!m_time.isValid()) { + return ""; + } + static const QHash<QString, QString> names = { + {"QA", "Out of the gate, with fuel"}, + {"QB", "Takeoff"}, + {"QD", "On the gate, with fuel"}, + {"QE", "Out of the gate"}, + {"QF", "Takeoff"}, + {"QG", "Out of the gate and returned"}, + {"Q1", "Estimated departure and arrival"}, + }; + + QStringList lines; + lines.append(QString("<b>Report:</b> %1").arg(names.value(m_label, "Movement report"))); + if (!m_station.isEmpty()) { + lines.append(QString("<b>Station:</b> %1").arg(m_station)); + } + if (!m_destination.isEmpty()) { + lines.append(QString("<b>Destination:</b> %1").arg(m_destination)); + } + lines.append(QString("<b>Time:</b> %1").arg(m_time.toString("hh:mm"))); + if (m_secondTime.isValid()) + { + lines.append(QString("<b>%1:</b> %2") + .arg(m_label == "QG" ? "Returned in" : "Arrival") + .arg(m_secondTime.toString("hh:mm"))); + } + if (!m_fuel.isEmpty()) { + lines.append(QString("<b>Fuel:</b> %1").arg(m_fuel)); + } + for (const QString& extra : m_extras) { + lines.append(QString("<b>Also:</b> %1").arg(extra)); + } + return lines.join("<br>"); +} + +AcarsSquitter::AcarsSquitter(const QByteArray &message) : + AcarsMessage(message) +{ +} + +AcarsMeteorologicalReport::AcarsMeteorologicalReport(const QByteArray &message) : + AcarsMessage(message) +{ +} + +// Position in degrees and decimal minutes, time, flight level in tenths, temperature in +// tenths of a degree with M for minus, then the wind. Each observation ends in "G". +// +// Read out in order the observations describe a flight: one LEBL to EGKK message has the +// aircraft at 44.5 N climbing to 50.1 N over three quarters of an hour, descending from +// FL360 to FL267 at the end while the temperature rises from -51 to -40.5 and the wind +// falls from 109 knots to 47. That internal consistency is what says the field boundaries +// are in the right places; nothing else here would survive being read wrongly. +// +// 150 of 397 label H2 messages are this format. The rest are other things entirely - +// some of them binary - and are left alone. +bool AcarsMeteorologicalReport::decode(const QString &text) +{ + static const QRegularExpression headerRe(R"RX(^\S{5}([A-Z]{4})([A-Z]{4}))RX"); + const QRegularExpressionMatch header = headerRe.match(text); + if (header.hasMatch()) + { + m_departureAirport = header.captured(1); + m_arrivalAirport = header.captured(2); + } + + static const QRegularExpression observationRe( + R"RX(([NS])(\d{2})(\d{3})([EW])(\d{3})(\d{3})(\d{2})(\d{2})(\d{4})([MP])(\d{3})(\d{3})(\d{3})G)RX"); + QRegularExpressionMatchIterator it = observationRe.globalMatch(text); + while (it.hasNext()) + { + const QRegularExpressionMatch match = it.next(); + Observation observation; + // Minutes are tenths, so there are 600 of them to the degree + observation.m_latitude = (match.captured(2).toFloat() + match.captured(3).toFloat() / 600.0f) + * (match.captured(1) == "S" ? -1.0f : 1.0f); + observation.m_longitude = (match.captured(5).toFloat() + match.captured(6).toFloat() / 600.0f) + * (match.captured(4) == "W" ? -1.0f : 1.0f); + observation.m_time = QTime(match.captured(7).toInt(), match.captured(8).toInt()); + observation.m_altitudeFt = (int) (match.captured(9).toFloat() * 10.0f); + observation.m_temperatureC = match.captured(11).toFloat() / 10.0f + * (match.captured(10) == "M" ? -1.0f : 1.0f); + observation.m_windDirectionDeg = match.captured(12).toInt(); + observation.m_windSpeedKts = match.captured(13).toInt(); + m_observations.append(observation); + } + + return !m_observations.isEmpty(); +} + +QString AcarsMeteorologicalReport::toString() +{ + if (m_observations.isEmpty()) { + return ""; + } + + QStringList lines; + if (!m_departureAirport.isEmpty() && !m_arrivalAirport.isEmpty()) + { + lines.append(QString("<b>Route:</b> %1 to %2") + .arg(icaoAndAirportName(m_departureAirport)) + .arg(icaoAndAirportName(m_arrivalAirport))); + } + for (const Observation& observation : m_observations) + { + lines.append(QString("<b>%1</b> %2%3 %4%5 at %6 ft, %7°C, wind %8° / %9 kn") + .arg(observation.m_time.toString("hh:mm")) + .arg(qAbs(observation.m_latitude), 0, 'f', 3) + .arg(observation.m_latitude < 0.0f ? "S" : "N") + .arg(qAbs(observation.m_longitude), 0, 'f', 3) + .arg(observation.m_longitude < 0.0f ? "W" : "E") + .arg(observation.m_altitudeFt) + .arg(observation.m_temperatureC, 0, 'f', 1) + .arg(observation.m_windDirectionDeg, 3, 10, QChar('0')) + .arg(observation.m_windSpeedKts)); + } + return lines.join("<br>"); +} + +AcarsMediaAdvisory::AcarsMediaAdvisory(const QByteArray &message) : + AcarsMessage(message) +{ +} + +QString AcarsMediaAdvisory::mediaName(QChar code) +{ + switch (code.toLatin1()) + { + case 'V': return "VHF ACARS"; + case '2': return "VDL Mode 2"; + case 'S': return "SATCOM"; + case 'X': return "SATCOM (MTSAT)"; + case 'H': return "HF"; + case 'G': return "SATCOM (GlobalStar)"; + case 'C': return "SATCOM (ICO)"; + case 'I': return "SATCOM (Iridium)"; + default: return QString(code); + } +} + +bool AcarsMediaAdvisory::decode(const QString &text) +{ + // Version, whether the link was established or lost, which link, the time it + // happened, then every link still available and optional free text. Checked against + // 200 consecutive label SA messages off air, all 200 of which match - which is what + // makes it worth decoding strictly rather than showing the raw string. + static const QRegularExpression re( + R"(^(\d)([EL])([A-Z0-9])(\d{2})(\d{2})(\d{2})([A-Z0-9]*)(?:/(.*))?$)", + QRegularExpression::DotMatchesEverythingOption); + const QRegularExpressionMatch match = re.match(text.trimmed()); + if (!match.hasMatch()) { + return false; + } + + m_version = match.captured(1); + m_established = (match.captured(2) == "E"); + m_media = mediaName(match.captured(3).at(0)); + m_time = QTime(match.captured(4).toInt(), match.captured(5).toInt(), match.captured(6).toInt()); + if (!m_time.isValid()) { + return false; + } + for (const QChar &available : match.captured(7)) { + m_availableMedia.append(mediaName(available)); + } + m_freeText = match.captured(8).trimmed(); + + return true; +} + +QString AcarsMediaAdvisory::toString() +{ + if (!m_time.isValid()) { + return ""; + } + + QStringList lines; + lines.append(QString("<b>Link %1:</b> %2") + .arg(m_established ? "established" : "lost") + .arg(m_media)); + lines.append(QString("<b>Time:</b> %1").arg(m_time.toString("hh:mm:ss"))); + if (!m_availableMedia.isEmpty()) { + lines.append(QString("<b>Available:</b> %1").arg(m_availableMedia.join(", "))); + } + if (!m_freeText.isEmpty()) { + lines.append(QString("<b>Free text:</b> %1").arg(m_freeText)); + } + + return lines.join("<br>"); +} + +bool AcarsSquitter::decode(const QString &text) +{ + if (m_uplink) + { + m_version = text.mid(0, 2); + m_serviceProvider = text.mid(2, 2); + if (m_version == "00") + { + m_freeText = text.mid(4); + } + else + { + m_iataStationId = text.mid(4, 3); + m_icaoStationId = text.mid(7, 4); + m_stationNumber = text.mid(11, 1); + if (m_version == "01") + { + m_freeText = text.mid(12); + } + else + { + m_latitude = text.mid(12, 5); + m_longitude = text.mid(17, 6); + int idx = 23; + while ((idx < text.length()) && (text[idx] != '/')) + { + if (((text[idx] == 'V') || (text[idx] == 'A') || (text[idx] == 'B')) && (idx + 7 <= text.length())) + { + m_alternateService.append(text[idx]); + m_alternateFrequency.append(QString("%1.%2kHz") + .arg(text.mid(idx+1,3)) + .arg(text.mid(idx+4,3))); + idx += 7; + } + else + { + break; + } + } + idx++; + m_freeText = text.mid(idx); + } + } + } + return true; +} + +QString AcarsSquitter::toString() +{ + const QHash<QString, QString> service = { + {"A", "VDL Mode 2 ATN Only"}, + {"B", "VDL Mode 2 AOA and ATN"}, + {"V", "VDL Mode 2 AOA Only"}, + }; + const QHash<QString, QString> serviceProviders = { + {"XA", "Rockwell Collins IMS"}, + {"XS", "SITA VHF"}, + {"AS", "Honeywell"}, + }; + QString serviceProvider = m_serviceProvider; + if (serviceProviders.contains(m_serviceProvider)) { + serviceProvider = QString("%1 (%2)").arg(m_serviceProvider).arg(serviceProviders.value(m_serviceProvider)); + } + QString s = QString("<b>Version:</b> %1<br><b>Service provider:</b> %2") + .arg(m_version) + .arg(serviceProvider); + if (m_version != "00") + { + s.append(QString("<br><b>IATA station Id:</b> %1<br><b>ICAO station Id:</b> %2<br><b>Station number:</b> %3") + .arg(m_iataStationId) + .arg(icaoAndAirportName(m_icaoStationId)) + .arg(m_stationNumber)); + if (m_version != "01") + { + s.append(QString("<br><b>Latitude:</b> %1<br><b>Longitude:</b> %2") + .arg(m_latitude) + .arg(m_longitude)); + for (int i = 0; i < m_alternateService.size(); i++) + { + s.append(QString("<br><b>Alternate service:</b> %1 - %2") + .arg(service[m_alternateService[i]]) + .arg(m_alternateFrequency[i])); + } + } + } + if (!m_freeText.isEmpty()) { + s.append(QString("<br><b>Free text:</b> %1").arg(m_freeText)); + } + return s; +} diff --git a/plugins/channelrx/demodacars/acarsmessage.h b/sdrbase/util/acarsmessage.h similarity index 55% rename from plugins/channelrx/demodacars/acarsmessage.h rename to sdrbase/util/acarsmessage.h index 3fc5278ba..ef3b890d8 100644 --- a/plugins/channelrx/demodacars/acarsmessage.h +++ b/sdrbase/util/acarsmessage.h @@ -22,8 +22,12 @@ #include <QString> #include <QDate> #include <QTime> +#include <QSharedPointer> +#include <QHash> #include <QMetaType> +#include "export.h" + #define ASCII_SOH 0x01 #define ASCII_STX 0x02 #define ASCII_ETX 0x03 @@ -42,7 +46,19 @@ #define ACARS_MAX_REPORTED_ALTITUDE_FT 50000 // See ARINC 618 -class AcarsMessage { +class AirportInformation; + +// The airport database the parsers resolve ICAO codes against, shared process wide and +// filled in once - see AcarsDemodWorker::startWork(). Declared here now that the parser +// is in the library, because the plugin that fills it in has to import the same symbol. +extern SDRBASE_API QSharedPointer<const QHash<QString, AirportInformation *>> m_airportInfo; + +// Fill in m_airportInfo, once per process. Every demodulator worker and the Aircraft +// feature's tracker call this from their own threads, and QSharedPointer assignment is +// not atomic, so it must never be assigned anywhere else. +SDRBASE_API void acarsInitAirportInfo(); + +class SDRBASE_API AcarsMessage { public: QDateTime m_dateTime; // Date & time message was received QString m_mode; @@ -56,6 +72,9 @@ public: QString m_blockSequence; // Block sequence for multiblock messages (A-Z) QString m_flight; // Flight number - for downlinks QString m_subLabel; + //!< The character after a three character sublabel - the B of #M1B. Kept apart from + //!< m_subLabel, which everything else treats as two characters. + QString m_subLabelSupplement; bool m_multiBlock; // Indicates if this message has additional following blocks bool m_uplink; // Indicates if uplink or downlink AcarsMessage(const QByteArray &message); @@ -71,14 +90,20 @@ public: return false; } static AcarsMessage *decode(const QByteArray &message); + // As above, but with the text decoded in place of the block's own - the assembled + // whole, for the last block of several. Decoding the block and then calling the + // virtual decode() again with the whole decoded twice, which doubled every list a + // decoder appends to (route waypoints, METAR observations, airports...). + static AcarsMessage *decode(const QByteArray &message, const QString &text); protected: + static AcarsMessage *decodeBlock(const QByteArray &message, const QString *text); static AcarsMessage *decode(const QByteArray &message, const QString &label, const QString &text, bool uplink); static bool isUplink(QChar blockId); }; // ARINC622 - Character-Oriented Air Traffic Service (ATS) Applications // Application data embedded in ACARS text field -class ARINC622 { +class SDRBASE_API ARINC622 { public: QString m_atcCenter; QString m_imi; @@ -94,7 +119,7 @@ public: QString toString(); }; -class AcarsDataTransceiverAutoTune : public AcarsMessage { +class SDRBASE_API AcarsDataTransceiverAutoTune : public AcarsMessage { public: int m_frequencyHz; int m_precision; @@ -105,7 +130,7 @@ public: }; -class AcarsGroundUTCRequest : public AcarsMessage { +class SDRBASE_API AcarsGroundUTCRequest : public AcarsMessage { public: QDate m_date; int m_day; @@ -115,7 +140,7 @@ public: virtual QString toString() override; }; -class AcarsOceanicClearanceResponse : public AcarsMessage { +class SDRBASE_API AcarsOceanicClearanceResponse : public AcarsMessage { public: QTime m_messageTime; QDate m_messageDate; @@ -136,7 +161,7 @@ public: virtual QString toString() override; }; -class AcarsDepartureClearanceResponse : public AcarsMessage { +class SDRBASE_API AcarsDepartureClearanceResponse : public AcarsMessage { public: QTime m_messageTime; QDate m_messageDate; @@ -150,13 +175,33 @@ public: QString m_departureTimeType; QString m_departureTime; QString m_atis; + // The European form of the clearance carries these where the North American one + // carries a departure time type - see decode() + int m_initialAltitudeFt = -1; + QString m_tsat; // Target start up approval time + QString m_qnh; + QString m_frequency; // Airborne or next frequency, MHz as written QString m_freeText; + // The plain language forms carry a route the aircraft can be drawn on, and an + // aircraft type, where the two coded dialects carry neither - see decode() + QString m_route; + QString m_aircraftType; + // A clearance can also be a refusal - "NO DEPARTURE CLEARANCE MESSAGE ON FILE, + // CONTACT CLEARANCE DELIVERY VIA VOICE". It is still a departure clearance response + // and worth showing, but it names no route, so nothing may be drawn from it. + bool m_clearanceAvailable = true; + // Set by the plain language dialects, which carry no message time - toString() used + // to key on that time and so printed nothing at all for them + bool m_plainLanguage = false; AcarsDepartureClearanceResponse(const QByteArray &message); bool decode(const QString &text) override; + // The dispatch chooses this class on the text as well as on the label, because the + // plain language dialects arrive under labels that carry other traffic too + static bool isPlainLanguage(const QString &text); virtual QString toString() override; }; -class AcarsFlightSystemsMessage : public AcarsMessage { +class SDRBASE_API AcarsFlightSystemsMessage : public AcarsMessage { public: QTime m_messageTime; QDate m_messageDate; @@ -168,7 +213,7 @@ public: virtual QString toString() override; }; -class AcarsATISReport: public AcarsMessage { +class SDRBASE_API AcarsATISReport: public AcarsMessage { public: QString m_airport; QString m_indicator; @@ -180,7 +225,7 @@ public: virtual QString toString() override; }; -class AcarsATSFacilitiesNotification : public AcarsMessage { +class SDRBASE_API AcarsATSFacilitiesNotification : public AcarsMessage { public: QString m_atcCenter; QString m_flight; @@ -193,7 +238,7 @@ public: virtual QString toString() override; }; -class AcarsRequestOceanicClearance : public AcarsMessage { +class SDRBASE_API AcarsRequestOceanicClearance : public AcarsMessage { public: QString m_avionicsIndicator; QString m_aircraft; @@ -207,7 +252,7 @@ public: virtual QString toString() override; }; -class AcarsOceanicClearanceReadback : public AcarsMessage { +class SDRBASE_API AcarsOceanicClearanceReadback : public AcarsMessage { public: QTime m_messageTime; QDate m_messageDate; @@ -228,7 +273,7 @@ public: virtual QString toString() override; }; -class AcarsRequestATISReport : public AcarsMessage { +class SDRBASE_API AcarsRequestATISReport : public AcarsMessage { public: QString m_avionicsIndicator; QString m_airport; @@ -238,7 +283,7 @@ public: virtual QString toString() override; }; -class AcarsWeatherRequest : public AcarsMessage { +class SDRBASE_API AcarsWeatherRequest : public AcarsMessage { public: QStringList m_airports; QString m_reportType; // MET report code ("SA" = METAR) or the WXRQ /TYP value @@ -248,9 +293,42 @@ public: AcarsWeatherRequest(const QByteArray &message); bool decode(const QString &text) override; virtual QString toString() override; + //!< The MET report codes, by code - "SA" gives "METAR" + static const QHash<QString, QString>& reportTypeNames(); }; -class AcarsFlightStatus : public AcarsMessage { +// A loadsheet: what the aircraft weighs, what is on it and where its centre of gravity +// sits. Sent before departure and again as a final once loading is done. +// +// Recognised by its content rather than by its label, because it is not sent under one - +// seen off air under 10, 30 and others, and behind several different prefixes (WAB02-, +// LSOTIFA002*, :WAB11-). Every airline lays the rest of it out the same way, which is +// what makes the figures worth pulling out of it. +class SDRBASE_API AcarsLoadsheet : public AcarsMessage { +public: + bool m_final = false; //!< Final rather than preliminary + QString m_from; //!< IATA, as loadsheets give them + QString m_to; + QString m_registration; //!< Without its dash, as written here + int m_zeroFuelWeight = -1; //!< -1 where the loadsheet does not give it + int m_zeroFuelWeightMax = -1; + int m_takeoffFuel = -1; + int m_takeoffWeight = -1; + int m_takeoffWeightMax = -1; + int m_landingWeight = -1; + int m_landingWeightMax = -1; + int m_tripFuel = -1; + int m_underload = -1; + int m_passengers = -1; + float m_macZeroFuel = -1.0f; //!< Centre of gravity, percent of mean aerodynamic chord + float m_macTakeoff = -1.0f; + + AcarsLoadsheet(const QByteArray &message); + bool decode(const QString &text) override; + virtual QString toString() override; +}; + +class SDRBASE_API AcarsFlightStatus : public AcarsMessage { public: QString m_departureAirport; QString m_arrivalAirport; @@ -277,7 +355,7 @@ public: }; // Position reports in the related airline formats used on labels 10, 12, 16, 22, 24 and 44 -class AcarsPositionReport : public AcarsMessage { +class SDRBASE_API AcarsPositionReport : public AcarsMessage { public: bool m_positionValid = false; float m_latitude = 0.0f; @@ -292,14 +370,43 @@ public: int m_month = -1; int m_day = -1; float m_fuelTons = -1.0f; + // Carried by the airline formats on labels 11, 21, 36, 45 and 8H. Fuel is kept as + // written because the units are the operator's choice - pounds, kilos and tens of + // kilos all appear - and guessing would be worse than showing what was sent. + QString m_tail; + QString m_alternateAirport; + QString m_lastWaypoint; + QString m_nextWaypoint; + QString m_departureRunway; + QString m_arrivalRunway; + QString m_fuelOnBoard; + int m_trackDeg = -1; + int m_speedKts = -1; // True airspeed where the format distinguishes it + int m_groundSpeedKts = -1; + int m_windDirDeg = -1; + int m_windSpeedKts = -1; + bool m_temperatureValid = false; + int m_temperatureC = 0; AcarsPositionReport(const QByteArray &message); bool decode(const QString &text) override; + // The airline formats, tried before the ARINC ones. Each returns true only when the + // text really is that format, because these labels carry other things as well. + bool decodeAirlinePosition(const QString &text); + bool decodeInRangePosition(const QString &text); + bool decodeWaypointPosition(const QString &text); + bool decodeRoutedPosition(const QString &text); + bool decodeCsvPosition(const QString &text); + bool decodeLabel83Position(const QString &text); + bool decodeStationPosition(const QString &text); + bool decodePoxPosition(const QString &text); + bool decodeCompanyPosition(const QString &text); + bool decodeCruiseReport(const QString &text); virtual QString toString() override; bool getPosition(float& latitude, float& longitude, int& altitudeFt) const override; }; // Airline operational reports on label 80 (3X01 POSRPT / OPNORM / INRANG formats) -class AcarsOpsReport : public AcarsMessage { +class SDRBASE_API AcarsOpsReport : public AcarsMessage { public: QString m_reportType; // POSRPT, OPNORM or INRANG QString m_reportFlight; @@ -328,7 +435,7 @@ public: // OOOI event reports on labels 13 to 18 (out of gate, takeoff, landing, in gate and // the post reports), in the /13 OUT EVENT / KSFO KEWR ... format -class AcarsEventReport : public AcarsMessage { +class SDRBASE_API AcarsEventReport : public AcarsMessage { public: int m_event = 0; // The label as an int, 13 to 18 QString m_eventDescription; // From the message, e.g. "OUT EVENT" @@ -337,6 +444,8 @@ public: int m_day = -1; QTime m_eventTime; int m_fuelOnBoard = -1; // In 100kg + //!< Some of these are not an event at all but a destination and an ETA - see decode() + QTime m_eta; bool m_positionValid = false; float m_latitude = 0.0f; float m_longitude = 0.0f; @@ -346,7 +455,7 @@ public: bool getPosition(float& latitude, float& longitude, int& altitudeFt) const override; }; -class AcarsATCCommunications : public AcarsMessage { +class SDRBASE_API AcarsATCCommunications : public AcarsMessage { public: ARINC622 m_622; AcarsATCCommunications(const QByteArray &message); @@ -354,7 +463,7 @@ public: virtual QString toString() override; }; -class AcarsMessageFromSubsystem : public AcarsMessage { +class SDRBASE_API AcarsMessageFromSubsystem : public AcarsMessage { public: ARINC622 m_622; // FMS reports (e.g. #M1BPOS position, #M1BFPN flight plan) when the text is not @@ -372,8 +481,27 @@ public: bool m_temperatureValid = false; int m_temperatureC = 0; QString m_posAdditionalData; + //!< Decoded out of the additional data - see extractAdditionalBlocks() + bool m_windValid = false; + int m_windDirection = 0; //!< Degrees + int m_windSpeed = 0; //!< Knots + bool m_fuelValid = false; + int m_fuel = 0; //!< Units not established, see the README + bool m_cruiseLevelValid = false; + int m_cruiseLevelFt = 0; //!< The level the flight is planned at, not its current one + QString m_destination; //!< From the destination block, which agrees with the arrival + QString m_destinationRunway; + bool m_destinationFuelValid = false; + int m_destinationFuel = 0; + bool m_destinationEtaValid = false; + QTime m_destinationEta; QString m_fpnDeparture; QString m_fpnArrival; + //!< The callsign the FMC uses, from an /FN block. It is the ICAO form where the + //!< ACARS block's own flight field is the IATA one - SAS87J against SK087J - so it + //!< is the other half of the flight's name, and in 380 messages here the two were + //!< never the same. + QString m_icaoCallsign; QString m_fpnRoute; //!< Waypoints and airways, as a flight plan is written QString m_fpnRunway; //!< Departure runway, with the arrival's in brackets QString m_fpnSid; //!< Departure procedure @@ -387,6 +515,12 @@ public: bool m_hasPosition = false; float m_latitude = 0.0f; float m_longitude = 0.0f; + //!< What the FMS expects at the fix, from a predicted route block - see + //!< extractPredictedRoute(). A fix named by a route insert has neither. + bool m_hasAltitude = false; + int m_altitudeFt = 0; + bool m_hasEta = false; + QTime m_eta; }; //!< Same order and length as the names in m_fpnRoute. A route insert gives the //!< position of most of its fixes, which places fixes no database here holds and @@ -394,11 +528,13 @@ public: QList<FpnWaypoint> m_fpnWaypoints; AcarsMessageFromSubsystem(const QByteArray &message); bool decode(const QString &text) override; + bool extractPredictedRoute(const QString& additional); + void extractAdditionalBlocks(const QString& additional); virtual QString toString() override; bool getPosition(float& latitude, float& longitude, int& altitudeFt) const override; }; -class AcarsOutReport : public AcarsMessage { +class SDRBASE_API AcarsOutReport : public AcarsMessage { public: QString m_departure; QString m_destination; @@ -412,7 +548,7 @@ public: virtual QString toString() override; }; -class AcarsOffReport : public AcarsMessage { +class SDRBASE_API AcarsOffReport : public AcarsMessage { public: QString m_departure; QString m_destination; @@ -424,7 +560,7 @@ public: virtual QString toString() override; }; -class AcarsOnReport : public AcarsMessage { +class SDRBASE_API AcarsOnReport : public AcarsMessage { public: QString m_departure; QString m_destination; @@ -436,7 +572,7 @@ public: virtual QString toString() override; }; -class AcarsInReport : public AcarsMessage { +class SDRBASE_API AcarsInReport : public AcarsMessage { public: QString m_departure; QString m_destination; @@ -451,7 +587,7 @@ public: virtual QString toString() override; }; -class AcarsOutReturnInReport : public AcarsMessage { +class SDRBASE_API AcarsOutReturnInReport : public AcarsMessage { public: QString m_departure; QString m_destination; @@ -466,7 +602,37 @@ public: virtual QString toString() override; }; -class AcarsSquitter : public AcarsMessage { + +// The short OOOI reports, on labels QA, QB, QD, QE, QF, QG and Q1. +// +// These are NOT the ARINC 620 form that AcarsOutReport and its siblings parse on QP to +// QT, which names its airports with four character ICAO codes. These name a station with +// a three character IATA code and give the time as four digits with nothing between: +// +// QB BOS1553 off Boston at 15:53 +// QF SAT1458SFO off San Antonio at 14:58 for San Francisco +// QG PER20302036 out of Perth 20:30, back in 20:36 +// QE SYD0642 62MEL out of Sydney 06:42, 62 of fuel, for Melbourne +// QD PHL132300441/CA 01/DO 1323 in at Philadelphia 13:23 +// +// "---" stands in for a station the aircraft did not give. Trailing blocks written +// /XX nnnn - fuel on board, fuel used, times repeated - vary by operator and are kept +// as they were sent rather than guessed at. +class SDRBASE_API AcarsShortOooiReport : public AcarsMessage { +public: + int m_event = 0; //!< AircraftReport::OooiEventKind, from the label + QString m_station; //!< IATA code, empty where the aircraft sent --- + QString m_destination; //!< IATA code, where the report names one + QTime m_time; + QTime m_secondTime; //!< Return-in time on QG, arrival ETA on Q1 + QString m_fuel; //!< As sent; the units are the operator's + QStringList m_extras; //!< The /XX blocks, as sent + AcarsShortOooiReport(const QByteArray &message); + bool decode(const QString &text) override; + virtual QString toString() override; +}; + +class SDRBASE_API AcarsSquitter : public AcarsMessage { public: QString m_version; QString m_serviceProvider; @@ -483,6 +649,55 @@ public: virtual QString toString() override; }; +// ARINC 618 media advisory, label SA: the aircraft saying which datalink it has just +// gained or lost, and which ones it can still use. Sent by the avionics rather than by +// the airline, so unlike most of the labels above the format is the same everywhere. +// +// 0EV181451V established on VHF at 18:14:51, VHF available +// 0LS1918452H lost SATCOM at 19:18:45, VDL Mode 2 and HF still available +// 0E20832042S/ established on VDL Mode 2 at 08:32:04, VDL Mode 2 and SATCOM available +// +// The automated meteorological report on label H2 - the aircraft as a weather station. +// One message carries a route and a run of observations, each a position, a time, an +// altitude, the outside air temperature and the wind: +// +// 02E30EGPFEGGWN52381W00139420262773M422199015G +// +// which is Glasgow to Luton, 52 38.1 N 1 39.4 W at 20:26, FL277.3, -42.2 C, wind 199 at +// 15 knots. A long flight sends several in one message. +class SDRBASE_API AcarsMeteorologicalReport : public AcarsMessage { +public: + struct Observation { + float m_latitude = 0.0f; + float m_longitude = 0.0f; + QTime m_time; + int m_altitudeFt = 0; + float m_temperatureC = 0.0f; + int m_windDirectionDeg = 0; + int m_windSpeedKts = 0; + }; + QString m_departureAirport; + QString m_arrivalAirport; + QList<Observation> m_observations; + AcarsMeteorologicalReport(const QByteArray &message); + bool decode(const QString &text) override; + virtual QString toString() override; +}; + +class SDRBASE_API AcarsMediaAdvisory : public AcarsMessage { +public: + QString m_version; + bool m_established = true; // False when the link was lost rather than gained + QString m_media; // The link gained or lost, expanded + QTime m_time; + QStringList m_availableMedia; // Every link still usable, expanded + QString m_freeText; + AcarsMediaAdvisory(const QByteArray &message); + bool decode(const QString &text) override; + virtual QString toString() override; + static QString mediaName(QChar code); +}; + Q_DECLARE_METATYPE(AcarsMessage *) #endif // INCLUDE_ACARSMESSGAE_H diff --git a/plugins/channelrx/demodacars/acarsmultipartassembler.cpp b/sdrbase/util/acarsmultipartassembler.cpp similarity index 96% rename from plugins/channelrx/demodacars/acarsmultipartassembler.cpp rename to sdrbase/util/acarsmultipartassembler.cpp index c5cab418d..5e94e7907 100644 --- a/plugins/channelrx/demodacars/acarsmultipartassembler.cpp +++ b/sdrbase/util/acarsmultipartassembler.cpp @@ -1,438 +1,438 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#include "acarsmultipartassembler.h" - -#include <QMap> - -namespace { - -const QChar KEY_SEPARATOR(0x1f); -const int MAX_MESSAGE_BLOCKS = 16; - -} - -int AcarsMultipartAssembler::Assembly::partNumber(quint64 sourceId) const -{ - int number = 0; - - for (const Part& part : m_parts) - { - if (!m_uplink && (part.m_sourceId == sourceId)) - { - const ushort sequence = part.m_blockSequence.unicode(); - return ((sequence >= 'A') && (sequence <= 'Z')) - ? sequence - 'A' + 1 - : 0; - } - - if (!part.m_duplicate) { - ++number; - } - if (part.m_sourceId == sourceId) { - return number; - } - } - - return 0; -} - -bool AcarsMultipartAssembler::Assembly::isMultipart() const -{ - return (m_uniquePartCount > 1) - || (m_duplicateCount > 0) - || (m_status != Complete); -} - -AcarsMultipartAssembler::AcarsMultipartAssembler(int timeoutSeconds) : - m_timeoutSeconds(timeoutSeconds), - m_nextId(1) -{ -} - -AcarsMultipartAssembler::Result AcarsMultipartAssembler::add(const Part& part) -{ - expire(part.m_received); - return part.m_uplink ? addUplink(part) : addDownlink(part); -} - -QSharedPointer<const AcarsMultipartAssembler::Assembly> -AcarsMultipartAssembler::assemblyFor(quint64 sourceId) const -{ - return m_sourceAssemblies.value(sourceId); -} - -void AcarsMultipartAssembler::clear() -{ - m_downlinks.clear(); - m_uplinks.clear(); - m_uplinkReferences.clear(); - m_sourceAssemblies.clear(); - m_nextId = 1; -} - -QString AcarsMultipartAssembler::statusText(Status status) -{ - switch (status) - { - case InProgress: - return "In progress"; - case Complete: - return "Complete"; - case Incomplete: - return "Incomplete"; - case Ambiguous: - return "Ambiguous"; - } - - return QString(); -} - -QString AcarsMultipartAssembler::downlinkKey(const Part& part) -{ - return part.m_address + KEY_SEPARATOR - + part.m_originator + KEY_SEPARATOR - + part.m_messageNumber; -} - -QString AcarsMultipartAssembler::uplinkKey(const Part& part) -{ - return part.m_address + KEY_SEPARATOR - + part.m_label + KEY_SEPARATOR - + part.m_subLabel; -} - -bool AcarsMultipartAssembler::validMessageNumber(const QString& number) -{ - return (number.size() == 2) - && number[0].isDigit() - && number[1].isDigit(); -} - -int AcarsMultipartAssembler::sequenceIndex(QChar sequence) -{ - const ushort value = sequence.unicode(); - return ((value >= 'A') && (value <= 'Z')) ? value - 'A' : -1; -} - -bool AcarsMultipartAssembler::sameBlock(const Part& lhs, const Part& rhs) -{ - return (lhs.m_blockId == rhs.m_blockId) - && (lhs.m_text == rhs.m_text) - && (lhs.m_label == rhs.m_label) - && (lhs.m_subLabel == rhs.m_subLabel) - && (lhs.m_originator == rhs.m_originator) - && (lhs.m_messageNumber == rhs.m_messageNumber) - && (lhs.m_blockSequence == rhs.m_blockSequence) - && (lhs.m_more == rhs.m_more); -} - -QSharedPointer<AcarsMultipartAssembler::Assembly> -AcarsMultipartAssembler::createAssembly(const Part& part) -{ - QSharedPointer<Assembly> assembly(new Assembly); - assembly->m_id = m_nextId++; - assembly->m_uplink = part.m_uplink; - assembly->m_firstReceived = part.m_received; - assembly->m_lastReceived = part.m_received; - return assembly; -} - -AcarsMultipartAssembler::Result AcarsMultipartAssembler::addDownlink(Part part) -{ - const int sequence = sequenceIndex(part.m_blockSequence); - const bool sequenced = validMessageNumber(part.m_messageNumber) - && !part.m_originator.isEmpty() - && (sequence >= 0); - - // A legal no-text block has no MSN. Treat other unsequenced blocks as standalone but - // make an ETB block ambiguous because there is no safe way to attach its successor. - if (!sequenced) - { - QSharedPointer<Assembly> assembly = createAssembly(part); - appendPart(assembly, part); - assembly->m_combinedText = part.m_text; - assembly->m_uniquePartCount = 1; - assembly->m_status = part.m_more ? Ambiguous : Complete; - return {assembly, 1, false}; - } - - const QString key = downlinkKey(part); - QSharedPointer<Assembly> assembly = m_downlinks.value(key); - - if (assembly) - { - const Part *firstPart = nullptr; - for (const Part& existing : assembly->m_parts) - { - if (!existing.m_duplicate) - { - firstPart = &existing; - break; - } - } - if (firstPart - && ((firstPart->m_label != part.m_label) - || (firstPart->m_subLabel != part.m_subLabel))) - { - part.m_conflict = true; - } - - for (const Part& existing : assembly->m_parts) - { - if ((existing.m_blockSequence == part.m_blockSequence) && sameBlock(existing, part)) - { - part.m_duplicate = true; - appendPart(assembly, part); - refreshDownlink(assembly); - return {assembly, assembly->partNumber(part.m_sourceId), true}; - } - } - - // A new A with a different DBI/payload is a restart, not the successor of A. - if (sequence == 0) - { - if (assembly->m_status == InProgress) { - assembly->m_status = Incomplete; - } - assembly = QSharedPointer<Assembly>(); - } - } - - if (!assembly) - { - assembly = createAssembly(part); - m_downlinks.insert(key, assembly); - } - else - { - for (const Part& existing : assembly->m_parts) - { - if (!existing.m_duplicate && (existing.m_blockSequence == part.m_blockSequence)) - { - part.m_conflict = true; - break; - } - } - } - - appendPart(assembly, part); - refreshDownlink(assembly); - return {assembly, assembly->partNumber(part.m_sourceId), part.m_duplicate}; -} - -AcarsMultipartAssembler::Result AcarsMultipartAssembler::addUplink(Part part) -{ - const QString referenceKey = part.m_address; - const auto referenceIt = m_uplinkReferences.constFind(referenceKey); - const bool reusedUbi = (referenceIt != m_uplinkReferences.constEnd()) - && (referenceIt->m_part.m_blockId == part.m_blockId); - - if (reusedUbi - && sameBlock(referenceIt->m_part, part)) - { - part.m_duplicate = true; - appendPart(referenceIt->m_assembly, part); - refreshUplink(referenceIt->m_assembly); - return { - referenceIt->m_assembly, - referenceIt->m_assembly->partNumber(part.m_sourceId), - true - }; - } - - const QString key = uplinkKey(part); - QSharedPointer<Assembly> assembly = m_uplinks.value(key); - - if (reusedUbi) { - part.m_conflict = true; - } - - if (!assembly) - { - assembly = createAssembly(part); - if (part.m_more) { - m_uplinks.insert(key, assembly); - } - } - - appendPart(assembly, part); - refreshUplink(assembly); - - if (!part.m_more) { - m_uplinks.remove(key); - } - - UplinkReference reference; - reference.m_part = part; - reference.m_assembly = assembly; - m_uplinkReferences.insert(referenceKey, reference); - - return {assembly, assembly->partNumber(part.m_sourceId), false}; -} - -void AcarsMultipartAssembler::appendPart( - const QSharedPointer<Assembly>& assembly, - const Part& part) -{ - assembly->m_parts.append(part); - assembly->m_lastReceived = part.m_received; - m_sourceAssemblies.insert(part.m_sourceId, assembly); -} - -void AcarsMultipartAssembler::refreshDownlink(const QSharedPointer<Assembly>& assembly) -{ - QMap<int, const Part *> ordered; - bool conflict = false; - bool ended = false; - int finalSequence = assembly->m_finalSequence; - int duplicates = 0; - - for (const Part& part : assembly->m_parts) - { - if (part.m_duplicate) - { - ++duplicates; - continue; - } - - const int sequence = sequenceIndex(part.m_blockSequence); - conflict = conflict || part.m_conflict || (sequence < 0); - - if ((sequence >= 0) && !ordered.contains(sequence)) { - ordered.insert(sequence, &part); - } - - if (!part.m_more) - { - ended = true; - finalSequence = sequence; - } - } - - assembly->m_combinedText.clear(); - for (const Part *part : ordered) { - assembly->m_combinedText.append(part->m_text); - } - - assembly->m_missingSequences.clear(); - const int lastExpected = ended ? finalSequence : (ordered.isEmpty() ? -1 : ordered.lastKey()); - for (int sequence = 0; sequence <= lastExpected; ++sequence) - { - if (!ordered.contains(sequence)) { - assembly->m_missingSequences.append(QString(QChar('A' + sequence))); - } - } - - assembly->m_finalSequence = finalSequence; - assembly->m_uniquePartCount = ordered.size(); - assembly->m_duplicateCount = duplicates; - - if (conflict - || (ordered.size() > MAX_MESSAGE_BLOCKS) - || (!ordered.isEmpty() && (ordered.lastKey() >= MAX_MESSAGE_BLOCKS))) - { - assembly->m_status = Ambiguous; - } else if (ended) { - assembly->m_status = assembly->m_missingSequences.isEmpty() ? Complete : Incomplete; - } else { - assembly->m_status = InProgress; - } -} - -void AcarsMultipartAssembler::refreshUplink(const QSharedPointer<Assembly>& assembly) -{ - bool conflict = false; - bool ended = false; - int uniqueParts = 0; - int duplicates = 0; - - assembly->m_combinedText.clear(); - - for (const Part& part : assembly->m_parts) - { - if (part.m_duplicate) - { - ++duplicates; - continue; - } - - ++uniqueParts; - assembly->m_combinedText.append(part.m_text); - conflict = conflict || part.m_conflict; - ended = ended || !part.m_more; - } - - assembly->m_uniquePartCount = uniqueParts; - assembly->m_duplicateCount = duplicates; - - if (conflict || (uniqueParts > MAX_MESSAGE_BLOCKS)) { - assembly->m_status = Ambiguous; - } else { - assembly->m_status = ended ? Complete : InProgress; - } -} - -void AcarsMultipartAssembler::expire(const QDateTime& received) -{ - auto expireAssemblies = [this, &received](QHash<QString, QSharedPointer<Assembly>>& active) - { - auto it = active.begin(); - while (it != active.end()) - { - const QSharedPointer<Assembly>& assembly = it.value(); - if (assembly->m_lastReceived.secsTo(received) > m_timeoutSeconds) - { - if (assembly->m_status == InProgress) { - assembly->m_status = Incomplete; - } - it = active.erase(it); - } - else - { - ++it; - } - } - }; - - expireAssemblies(m_downlinks); - expireAssemblies(m_uplinks); - - // ... and the source-to-assembly lookup with them. It was never pruned at all, so it - // grew by one entry per message received for the life of the channel - the same leak - // the retained AcarsMessage list was, one indirection further along. - auto sourceIt = m_sourceAssemblies.begin(); - while (sourceIt != m_sourceAssemblies.end()) - { - if (sourceIt.value()->m_lastReceived.secsTo(received) > m_timeoutSeconds) { - sourceIt = m_sourceAssemblies.erase(sourceIt); - } else { - ++sourceIt; - } - } - - auto reference = m_uplinkReferences.begin(); - while (reference != m_uplinkReferences.end()) - { - if (reference->m_part.m_received.secsTo(received) > m_timeoutSeconds) { - reference = m_uplinkReferences.erase(reference); - } else { - ++reference; - } - } -} +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "util/acarsmultipartassembler.h" + +#include <QMap> + +namespace { + +const QChar KEY_SEPARATOR(0x1f); +const int MAX_MESSAGE_BLOCKS = 16; + +} + +int AcarsMultipartAssembler::Assembly::partNumber(quint64 sourceId) const +{ + int number = 0; + + for (const Part& part : m_parts) + { + if (!m_uplink && (part.m_sourceId == sourceId)) + { + const ushort sequence = part.m_blockSequence.unicode(); + return ((sequence >= 'A') && (sequence <= 'Z')) + ? sequence - 'A' + 1 + : 0; + } + + if (!part.m_duplicate) { + ++number; + } + if (part.m_sourceId == sourceId) { + return number; + } + } + + return 0; +} + +bool AcarsMultipartAssembler::Assembly::isMultipart() const +{ + return (m_uniquePartCount > 1) + || (m_duplicateCount > 0) + || (m_status != Complete); +} + +AcarsMultipartAssembler::AcarsMultipartAssembler(int timeoutSeconds) : + m_timeoutSeconds(timeoutSeconds), + m_nextId(1) +{ +} + +AcarsMultipartAssembler::Result AcarsMultipartAssembler::add(const Part& part) +{ + expire(part.m_received); + return part.m_uplink ? addUplink(part) : addDownlink(part); +} + +QSharedPointer<const AcarsMultipartAssembler::Assembly> +AcarsMultipartAssembler::assemblyFor(quint64 sourceId) const +{ + return m_sourceAssemblies.value(sourceId); +} + +void AcarsMultipartAssembler::clear() +{ + m_downlinks.clear(); + m_uplinks.clear(); + m_uplinkReferences.clear(); + m_sourceAssemblies.clear(); + m_nextId = 1; +} + +QString AcarsMultipartAssembler::statusText(Status status) +{ + switch (status) + { + case InProgress: + return "In progress"; + case Complete: + return "Complete"; + case Incomplete: + return "Incomplete"; + case Ambiguous: + return "Ambiguous"; + } + + return QString(); +} + +QString AcarsMultipartAssembler::downlinkKey(const Part& part) +{ + return part.m_address + KEY_SEPARATOR + + part.m_originator + KEY_SEPARATOR + + part.m_messageNumber; +} + +QString AcarsMultipartAssembler::uplinkKey(const Part& part) +{ + return part.m_address + KEY_SEPARATOR + + part.m_label + KEY_SEPARATOR + + part.m_subLabel; +} + +bool AcarsMultipartAssembler::validMessageNumber(const QString& number) +{ + return (number.size() == 2) + && number[0].isDigit() + && number[1].isDigit(); +} + +int AcarsMultipartAssembler::sequenceIndex(QChar sequence) +{ + const ushort value = sequence.unicode(); + return ((value >= 'A') && (value <= 'Z')) ? value - 'A' : -1; +} + +bool AcarsMultipartAssembler::sameBlock(const Part& lhs, const Part& rhs) +{ + return (lhs.m_blockId == rhs.m_blockId) + && (lhs.m_text == rhs.m_text) + && (lhs.m_label == rhs.m_label) + && (lhs.m_subLabel == rhs.m_subLabel) + && (lhs.m_originator == rhs.m_originator) + && (lhs.m_messageNumber == rhs.m_messageNumber) + && (lhs.m_blockSequence == rhs.m_blockSequence) + && (lhs.m_more == rhs.m_more); +} + +QSharedPointer<AcarsMultipartAssembler::Assembly> +AcarsMultipartAssembler::createAssembly(const Part& part) +{ + QSharedPointer<Assembly> assembly(new Assembly); + assembly->m_id = m_nextId++; + assembly->m_uplink = part.m_uplink; + assembly->m_firstReceived = part.m_received; + assembly->m_lastReceived = part.m_received; + return assembly; +} + +AcarsMultipartAssembler::Result AcarsMultipartAssembler::addDownlink(Part part) +{ + const int sequence = sequenceIndex(part.m_blockSequence); + const bool sequenced = validMessageNumber(part.m_messageNumber) + && !part.m_originator.isEmpty() + && (sequence >= 0); + + // A legal no-text block has no MSN. Treat other unsequenced blocks as standalone but + // make an ETB block ambiguous because there is no safe way to attach its successor. + if (!sequenced) + { + QSharedPointer<Assembly> assembly = createAssembly(part); + appendPart(assembly, part); + assembly->m_combinedText = part.m_text; + assembly->m_uniquePartCount = 1; + assembly->m_status = part.m_more ? Ambiguous : Complete; + return {assembly, 1, false}; + } + + const QString key = downlinkKey(part); + QSharedPointer<Assembly> assembly = m_downlinks.value(key); + + if (assembly) + { + const Part *firstPart = nullptr; + for (const Part& existing : assembly->m_parts) + { + if (!existing.m_duplicate) + { + firstPart = &existing; + break; + } + } + if (firstPart + && ((firstPart->m_label != part.m_label) + || (firstPart->m_subLabel != part.m_subLabel))) + { + part.m_conflict = true; + } + + for (const Part& existing : assembly->m_parts) + { + if ((existing.m_blockSequence == part.m_blockSequence) && sameBlock(existing, part)) + { + part.m_duplicate = true; + appendPart(assembly, part); + refreshDownlink(assembly); + return {assembly, assembly->partNumber(part.m_sourceId), true}; + } + } + + // A new A with a different DBI/payload is a restart, not the successor of A. + if (sequence == 0) + { + if (assembly->m_status == InProgress) { + assembly->m_status = Incomplete; + } + assembly = QSharedPointer<Assembly>(); + } + } + + if (!assembly) + { + assembly = createAssembly(part); + m_downlinks.insert(key, assembly); + } + else + { + for (const Part& existing : assembly->m_parts) + { + if (!existing.m_duplicate && (existing.m_blockSequence == part.m_blockSequence)) + { + part.m_conflict = true; + break; + } + } + } + + appendPart(assembly, part); + refreshDownlink(assembly); + return {assembly, assembly->partNumber(part.m_sourceId), part.m_duplicate}; +} + +AcarsMultipartAssembler::Result AcarsMultipartAssembler::addUplink(Part part) +{ + const QString referenceKey = part.m_address; + const auto referenceIt = m_uplinkReferences.constFind(referenceKey); + const bool reusedUbi = (referenceIt != m_uplinkReferences.constEnd()) + && (referenceIt->m_part.m_blockId == part.m_blockId); + + if (reusedUbi + && sameBlock(referenceIt->m_part, part)) + { + part.m_duplicate = true; + appendPart(referenceIt->m_assembly, part); + refreshUplink(referenceIt->m_assembly); + return { + referenceIt->m_assembly, + referenceIt->m_assembly->partNumber(part.m_sourceId), + true + }; + } + + const QString key = uplinkKey(part); + QSharedPointer<Assembly> assembly = m_uplinks.value(key); + + if (reusedUbi) { + part.m_conflict = true; + } + + if (!assembly) + { + assembly = createAssembly(part); + if (part.m_more) { + m_uplinks.insert(key, assembly); + } + } + + appendPart(assembly, part); + refreshUplink(assembly); + + if (!part.m_more) { + m_uplinks.remove(key); + } + + UplinkReference reference; + reference.m_part = part; + reference.m_assembly = assembly; + m_uplinkReferences.insert(referenceKey, reference); + + return {assembly, assembly->partNumber(part.m_sourceId), false}; +} + +void AcarsMultipartAssembler::appendPart( + const QSharedPointer<Assembly>& assembly, + const Part& part) +{ + assembly->m_parts.append(part); + assembly->m_lastReceived = part.m_received; + m_sourceAssemblies.insert(part.m_sourceId, assembly); +} + +void AcarsMultipartAssembler::refreshDownlink(const QSharedPointer<Assembly>& assembly) +{ + QMap<int, const Part *> ordered; + bool conflict = false; + bool ended = false; + int finalSequence = assembly->m_finalSequence; + int duplicates = 0; + + for (const Part& part : assembly->m_parts) + { + if (part.m_duplicate) + { + ++duplicates; + continue; + } + + const int sequence = sequenceIndex(part.m_blockSequence); + conflict = conflict || part.m_conflict || (sequence < 0); + + if ((sequence >= 0) && !ordered.contains(sequence)) { + ordered.insert(sequence, &part); + } + + if (!part.m_more) + { + ended = true; + finalSequence = sequence; + } + } + + assembly->m_combinedText.clear(); + for (const Part *part : ordered) { + assembly->m_combinedText.append(part->m_text); + } + + assembly->m_missingSequences.clear(); + const int lastExpected = ended ? finalSequence : (ordered.isEmpty() ? -1 : ordered.lastKey()); + for (int sequence = 0; sequence <= lastExpected; ++sequence) + { + if (!ordered.contains(sequence)) { + assembly->m_missingSequences.append(QString(QChar('A' + sequence))); + } + } + + assembly->m_finalSequence = finalSequence; + assembly->m_uniquePartCount = ordered.size(); + assembly->m_duplicateCount = duplicates; + + if (conflict + || (ordered.size() > MAX_MESSAGE_BLOCKS) + || (!ordered.isEmpty() && (ordered.lastKey() >= MAX_MESSAGE_BLOCKS))) + { + assembly->m_status = Ambiguous; + } else if (ended) { + assembly->m_status = assembly->m_missingSequences.isEmpty() ? Complete : Incomplete; + } else { + assembly->m_status = InProgress; + } +} + +void AcarsMultipartAssembler::refreshUplink(const QSharedPointer<Assembly>& assembly) +{ + bool conflict = false; + bool ended = false; + int uniqueParts = 0; + int duplicates = 0; + + assembly->m_combinedText.clear(); + + for (const Part& part : assembly->m_parts) + { + if (part.m_duplicate) + { + ++duplicates; + continue; + } + + ++uniqueParts; + assembly->m_combinedText.append(part.m_text); + conflict = conflict || part.m_conflict; + ended = ended || !part.m_more; + } + + assembly->m_uniquePartCount = uniqueParts; + assembly->m_duplicateCount = duplicates; + + if (conflict || (uniqueParts > MAX_MESSAGE_BLOCKS)) { + assembly->m_status = Ambiguous; + } else { + assembly->m_status = ended ? Complete : InProgress; + } +} + +void AcarsMultipartAssembler::expire(const QDateTime& received) +{ + auto expireAssemblies = [this, &received](QHash<QString, QSharedPointer<Assembly>>& active) + { + auto it = active.begin(); + while (it != active.end()) + { + const QSharedPointer<Assembly>& assembly = it.value(); + if (assembly->m_lastReceived.secsTo(received) > m_timeoutSeconds) + { + if (assembly->m_status == InProgress) { + assembly->m_status = Incomplete; + } + it = active.erase(it); + } + else + { + ++it; + } + } + }; + + expireAssemblies(m_downlinks); + expireAssemblies(m_uplinks); + + // ... and the source-to-assembly lookup with them. It was never pruned at all, so it + // grew by one entry per message received for the life of the channel - the same leak + // the retained AcarsMessage list was, one indirection further along. + auto sourceIt = m_sourceAssemblies.begin(); + while (sourceIt != m_sourceAssemblies.end()) + { + if (sourceIt.value()->m_lastReceived.secsTo(received) > m_timeoutSeconds) { + sourceIt = m_sourceAssemblies.erase(sourceIt); + } else { + ++sourceIt; + } + } + + auto reference = m_uplinkReferences.begin(); + while (reference != m_uplinkReferences.end()) + { + if (reference->m_part.m_received.secsTo(received) > m_timeoutSeconds) { + reference = m_uplinkReferences.erase(reference); + } else { + ++reference; + } + } +} diff --git a/plugins/channelrx/demodacars/acarsmultipartassembler.h b/sdrbase/util/acarsmultipartassembler.h similarity index 95% rename from plugins/channelrx/demodacars/acarsmultipartassembler.h rename to sdrbase/util/acarsmultipartassembler.h index f285a1eb2..392638e26 100644 --- a/plugins/channelrx/demodacars/acarsmultipartassembler.h +++ b/sdrbase/util/acarsmultipartassembler.h @@ -1,129 +1,131 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_ACARSMULTIPARTASSEMBLER_H -#define INCLUDE_ACARSMULTIPARTASSEMBLER_H - -#include <QDateTime> -#include <QHash> -#include <QList> -#include <QSharedPointer> -#include <QString> -#include <QStringList> - -// ARINC 618 gives downlinks an explicit MSN block sequence, but deliberately gives -// uplinks no block sequence. Keep the two assembly rules in one place so the GUI never -// has to infer message identity from table row order or from the retransmission IDs. -class AcarsMultipartAssembler -{ -public: - enum Status - { - InProgress, - Complete, - Incomplete, - Ambiguous - }; - - struct Part - { - // An opaque identity for the message this part came from, NOT a pointer to it. - // It used to be the AcarsMessage*, which forced the worker to keep every decoded - // message alive for the life of the channel purely so the addresses stayed - // unique - an unbounded leak, and one that headless operation paid for too. - quint64 m_sourceId = 0; - QDateTime m_received; - bool m_uplink = false; - QString m_address; - QString m_label; - QString m_subLabel; - QChar m_blockId; - QString m_originator; - QString m_messageNumber; - QChar m_blockSequence; - QString m_text; - bool m_more = false; - bool m_duplicate = false; - bool m_conflict = false; - }; - - struct Assembly - { - quint64 m_id = 0; - bool m_uplink = false; - Status m_status = InProgress; - QList<Part> m_parts; - QDateTime m_firstReceived; - QDateTime m_lastReceived; - QString m_combinedText; - QStringList m_missingSequences; - QString m_decodedText; - QString m_libAcarsDecodedText; - int m_finalSequence = -1; - int m_uniquePartCount = 0; - int m_duplicateCount = 0; - - int partNumber(quint64 sourceId) const; - bool isMultipart() const; - }; - - struct Result - { - QSharedPointer<Assembly> m_assembly; - int m_partNumber = 0; - bool m_duplicate = false; - }; - - explicit AcarsMultipartAssembler(int timeoutSeconds = 90); - - Result add(const Part& part); - QSharedPointer<const Assembly> assemblyFor(quint64 sourceId) const; - void clear(); - - static QString statusText(Status status); - -private: - struct UplinkReference - { - Part m_part; - QSharedPointer<Assembly> m_assembly; - }; - - int m_timeoutSeconds; - quint64 m_nextId; - QHash<QString, QSharedPointer<Assembly>> m_downlinks; - QHash<QString, QSharedPointer<Assembly>> m_uplinks; - QHash<QString, UplinkReference> m_uplinkReferences; - QHash<quint64, QSharedPointer<Assembly>> m_sourceAssemblies; - - static QString downlinkKey(const Part& part); - static QString uplinkKey(const Part& part); - static bool validMessageNumber(const QString& number); - static int sequenceIndex(QChar sequence); - static bool sameBlock(const Part& lhs, const Part& rhs); - - QSharedPointer<Assembly> createAssembly(const Part& part); - Result addDownlink(Part part); - Result addUplink(Part part); - void appendPart(const QSharedPointer<Assembly>& assembly, const Part& part); - void refreshDownlink(const QSharedPointer<Assembly>& assembly); - void refreshUplink(const QSharedPointer<Assembly>& assembly); - void expire(const QDateTime& received); -}; - -#endif // INCLUDE_ACARSMULTIPARTASSEMBLER_H +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_ACARSMULTIPARTASSEMBLER_H +#define INCLUDE_ACARSMULTIPARTASSEMBLER_H + +#include <QDateTime> +#include <QHash> +#include <QList> +#include <QSharedPointer> +#include <QString> +#include <QStringList> + +#include "export.h" + +// ARINC 618 gives downlinks an explicit MSN block sequence, but deliberately gives +// uplinks no block sequence. Keep the two assembly rules in one place so the GUI never +// has to infer message identity from table row order or from the retransmission IDs. +class SDRBASE_API AcarsMultipartAssembler +{ +public: + enum Status + { + InProgress, + Complete, + Incomplete, + Ambiguous + }; + + struct SDRBASE_API Part + { + // An opaque identity for the message this part came from, NOT a pointer to it. + // It used to be the AcarsMessage*, which forced the worker to keep every decoded + // message alive for the life of the channel purely so the addresses stayed + // unique - an unbounded leak, and one that headless operation paid for too. + quint64 m_sourceId = 0; + QDateTime m_received; + bool m_uplink = false; + QString m_address; + QString m_label; + QString m_subLabel; + QChar m_blockId; + QString m_originator; + QString m_messageNumber; + QChar m_blockSequence; + QString m_text; + bool m_more = false; + bool m_duplicate = false; + bool m_conflict = false; + }; + + struct SDRBASE_API Assembly + { + quint64 m_id = 0; + bool m_uplink = false; + Status m_status = InProgress; + QList<Part> m_parts; + QDateTime m_firstReceived; + QDateTime m_lastReceived; + QString m_combinedText; + QStringList m_missingSequences; + QString m_decodedText; + QString m_libAcarsDecodedText; + int m_finalSequence = -1; + int m_uniquePartCount = 0; + int m_duplicateCount = 0; + + int partNumber(quint64 sourceId) const; + bool isMultipart() const; + }; + + struct SDRBASE_API Result + { + QSharedPointer<Assembly> m_assembly; + int m_partNumber = 0; + bool m_duplicate = false; + }; + + explicit AcarsMultipartAssembler(int timeoutSeconds = 90); + + Result add(const Part& part); + QSharedPointer<const Assembly> assemblyFor(quint64 sourceId) const; + void clear(); + + static QString statusText(Status status); + +private: + struct SDRBASE_API UplinkReference + { + Part m_part; + QSharedPointer<Assembly> m_assembly; + }; + + int m_timeoutSeconds; + quint64 m_nextId; + QHash<QString, QSharedPointer<Assembly>> m_downlinks; + QHash<QString, QSharedPointer<Assembly>> m_uplinks; + QHash<QString, UplinkReference> m_uplinkReferences; + QHash<quint64, QSharedPointer<Assembly>> m_sourceAssemblies; + + static QString downlinkKey(const Part& part); + static QString uplinkKey(const Part& part); + static bool validMessageNumber(const QString& number); + static int sequenceIndex(QChar sequence); + static bool sameBlock(const Part& lhs, const Part& rhs); + + QSharedPointer<Assembly> createAssembly(const Part& part); + Result addDownlink(Part part); + Result addUplink(Part part); + void appendPart(const QSharedPointer<Assembly>& assembly, const Part& part); + void refreshDownlink(const QSharedPointer<Assembly>& assembly); + void refreshUplink(const QSharedPointer<Assembly>& assembly); + void expire(const QDateTime& received); +}; + +#endif // INCLUDE_ACARSMULTIPARTASSEMBLER_H diff --git a/plugins/channelrx/demodacars/acarstextformat.h b/sdrbase/util/acarstextformat.h similarity index 100% rename from plugins/channelrx/demodacars/acarstextformat.h rename to sdrbase/util/acarstextformat.h diff --git a/sdrbase/util/aircraft3dmodels.cpp b/sdrbase/util/aircraft3dmodels.cpp index 940c3666f..1a9153c3c 100644 --- a/sdrbase/util/aircraft3dmodels.cpp +++ b/sdrbase/util/aircraft3dmodels.cpp @@ -16,10 +16,21 @@ /////////////////////////////////////////////////////////////////////////////////// #include <QDir> +#include <QDirIterator> #include <QElapsedTimer> +#include <QFile> +#include <QFileInfo> +#include <QTimeZone> +#include <QSaveFile> #include <QDebug> #include <QRandomGenerator> #include <QStandardPaths> +#include <QUrl> +#include <QJsonDocument> +#include <QJsonObject> +#include <QJsonArray> +#include <QMutexLocker> +#include <QtEndian> #include "util/aircraft3dmodels.h" #include "util/osndb.h" @@ -41,6 +52,189 @@ const Aircraft3DModels& Aircraft3DModels::instance() return models; } +QString Aircraft3DModels::modelInfoCachePath() +{ + return dataDir() + "/3d_model_info.json"; +} + +// A glTF's JSON: the whole file for .gltf, the JSON chunk of a binary .glb +static QJsonObject gltfJson(const QString &path) +{ + QFile file(path); + if (!file.open(QIODevice::ReadOnly)) { + return QJsonObject(); + } + QByteArray bytes = file.readAll(); + if (bytes.startsWith("glTF")) + { + // A 12 byte header (magic, version, length), then chunks of length, type, data; + // the first chunk is the JSON + if (bytes.size() < 20) { + return QJsonObject(); + } + const quint32 length = qFromLittleEndian<quint32>(reinterpret_cast<const uchar *>(bytes.constData() + 12)); + if (20 + length > (quint32) bytes.size()) { + return QJsonObject(); + } + bytes = bytes.mid(20, length); + } + return QJsonDocument::fromJson(bytes).object(); +} + +bool Aircraft3DModels::hasAnimation(const QString &model, const QString &animation) const +{ + if (model.isEmpty()) { + return true; + } + const ModelInfo info = modelInfo(model); + return !info.readable || info.animations.contains(animation); +} + +bool Aircraft3DModels::hasTextures(const QString &model) const +{ + if (model.isEmpty()) { + return true; + } + const ModelInfo info = modelInfo(model); + return !info.readable || info.textures; +} + +Aircraft3DModels::ModelInfo Aircraft3DModels::modelInfo(const QString &model) const +{ + QMutexLocker locker(&m_modelInfoMutex); + + if (!m_modelInfoLoaded) + { + loadModelInfoCache(); + m_modelInfoLoaded = true; + } + if (m_unreadableModels.contains(model)) { + return ModelInfo(); + } + + const QString path = dataDir() + "/3d/" + model; + + // Answer from the cache without touching the disk, unless it is time to look again. + // This runs per aircraft per update, and a stat plus a local-time QDateTime + // conversion each time is not free: QDateTime takes a process-wide lock to reach the + // C library's time functions, so every thread doing anything with local time queues + // behind these calls + if (!m_modelInfoClock.isValid()) { + m_modelInfoClock.start(); + } + const qint64 nowMs = m_modelInfoClock.elapsed(); + const qint64 checkedMs = m_modelInfoCheckedMs.value(model, -1); + auto cached = m_modelInfo.constFind(model); + if ((cached != m_modelInfo.constEnd()) && (checkedMs >= 0) + && ((nowMs - checkedMs) < m_modelInfoRecheckMs)) { + return cached.value(); + } + + const QFileInfo fileInfo(path); + // UTC, so the conversion does not go through the shared local-time machinery. + // The QTimeZone overload only exists from Qt 6.6 +#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) + const QString stamp = QString("%1/%2").arg(fileInfo.size()) + .arg(fileInfo.lastModified(QTimeZone::UTC).toSecsSinceEpoch()); +#else + const QString stamp = QString("%1/%2").arg(fileInfo.size()) + .arg(fileInfo.lastModified().toSecsSinceEpoch()); +#endif + m_modelInfoCheckedMs.insert(model, nowMs); + + auto it = m_modelInfo.constFind(model); + if ((it != m_modelInfo.constEnd()) && (m_modelInfoStamp.value(model) == stamp)) { + return it.value(); + } + + // Not seen before, or the file has changed since it was + if (!fileInfo.exists()) + { + m_unreadableModels.insert(model); + return ModelInfo(); + } + const QJsonObject gltf = gltfJson(path); + if (gltf.isEmpty()) + { + qWarning() << "Aircraft3DModels: Can't read" << path; + m_unreadableModels.insert(model); + return ModelInfo(); + } + ModelInfo info; + info.readable = true; + for (const QJsonValue &value : gltf.value("animations").toArray()) + { + const QString name = value.toObject().value("name").toString(); + if (!name.isEmpty()) { + info.animations.insert(name); + } + } + // Textures are referred to by a URI relative to the glTF, unless embedded in it, + // as a data URI or in a buffer, where there is no uri at all + const QDir modelDir = fileInfo.dir(); + for (const QJsonValue &value : gltf.value("images").toArray()) + { + const QString uri = value.toObject().value("uri").toString(); + if (uri.isEmpty() || uri.startsWith("data:")) { + continue; + } + if (!modelDir.exists(QUrl::fromPercentEncoding(uri.toUtf8()))) + { + qWarning() << "Aircraft3DModels:" << model << "refers to a texture that is not installed:" << uri << "- not used"; + info.textures = false; + } + } + m_modelInfo.insert(model, info); + m_modelInfoStamp.insert(model, stamp); + saveModelInfoCache(); + return info; +} + +void Aircraft3DModels::loadModelInfoCache() const +{ + QFile file(modelInfoCachePath()); + if (!file.open(QIODevice::ReadOnly)) { + return; // The first run on this machine + } + const QJsonObject cache = QJsonDocument::fromJson(file.readAll()).object(); + for (auto it = cache.constBegin(); it != cache.constEnd(); ++it) + { + const QJsonObject entry = it.value().toObject(); + ModelInfo info; + info.readable = true; + info.textures = entry.value("textures").toBool(true); + for (const QJsonValue &value : entry.value("animations").toArray()) { + info.animations.insert(value.toString()); + } + m_modelInfo.insert(it.key(), info); + m_modelInfoStamp.insert(it.key(), entry.value("stamp").toString()); + } +} + +void Aircraft3DModels::saveModelInfoCache() const +{ + QJsonObject cache; + for (auto it = m_modelInfo.constBegin(); it != m_modelInfo.constEnd(); ++it) + { + QJsonArray names; + for (const QString &name : it.value().animations) { + names.append(name); + } + cache.insert(it.key(), QJsonObject { + {"stamp", m_modelInfoStamp.value(it.key())}, + {"textures", it.value().textures}, + {"animations", names} + }); + } + // Written whole and swapped in, so a crash mid-write cannot leave a half a cache + QSaveFile file(modelInfoCachePath()); + if (file.open(QIODevice::WriteOnly)) + { + file.write(QJsonDocument(cache).toJson(QJsonDocument::Compact)); + file.commit(); + } +} + QString Aircraft3DModels::dataDir() { // Where the aircraft and airport databases and the 3D models live @@ -48,6 +242,23 @@ QString Aircraft3DModels::dataDir() return locations[0]; } +QString Aircraft3DModels::liveryIconName(const QString &model) +{ + QString name = QFileInfo(model).completeBaseName(); + static const QString prefix = QStringLiteral("FSLTL_"); + static const QString lowDetail = QStringLiteral("_cesium_lod1"); + static const QString suffix = QStringLiteral("_cesium"); + if (name.startsWith(prefix, Qt::CaseInsensitive)) { + name = name.mid(prefix.size()); + } + if (name.endsWith(lowDetail, Qt::CaseInsensitive)) { + name.chop(lowDetail.size()); + } else if (name.endsWith(suffix, Qt::CaseInsensitive)) { + name.chop(suffix.size()); + } + return name; +} + Aircraft3DModels::~Aircraft3DModels() { qDeleteAll(m_3DModelMatch); @@ -99,6 +310,68 @@ Aircraft3DModels::Aircraft3DModels(bool verbose) } } + // Models converted from FSLTL/MSFS are stored separately from the downloadable + // Bluebell model set. Their directory names encode the ICAO type and, for + // liveries, the operator: FSLTL_A20N_AAN. Index them using the same keys as the + // existing models so ADS-B and Aircraft can select them without special cases. + const QString msfsDir = modelDir + "/MSFS"; + // The converter writes a second, lower level of detail beside the model as + // NAME_cesium_lod1.gltf, which the *_cesium.gltf scan below doesn't pick up + QSet<QString> lowDetailFiles; + QDirIterator lowDetailModels(msfsDir, {"*_cesium_lod1.gltf"}, QDir::Files, QDirIterator::Subdirectories); + while (lowDetailModels.hasNext()) { + lowDetailFiles.insert(lowDetailModels.next()); + } + QDirIterator msfsModels(msfsDir, {"*_cesium.gltf"}, QDir::Files, QDirIterator::Subdirectories); + while (msfsModels.hasNext()) + { + const QString gltf = msfsModels.next(); + const QString aircraft = QFileInfo(gltf).completeBaseName().chopped(QString("_cesium").size()); + const QStringList parts = aircraft.split('_'); + if ((parts.size() < 2) || (parts[0].compare("FSLTL", Qt::CaseInsensitive) != 0)) { + continue; + } + + int typeIndex = 1; + if ((parts[typeIndex].compare("Asobo", Qt::CaseInsensitive) == 0) && (parts.size() > 2)) { + ++typeIndex; + } + QString type = parts[typeIndex].toUpper(); + // The Asobo aircraft FSLTL reuses are named after the product, not the designator + static const QHash<QString, QString> asoboTypes = { + {"208B", "C208"}, {"TBM930", "TBM9"}, {"C172SP", "C172"}, {"G36", "BE36"}, {"DR400", "DR40"} + }; + type = asoboTypes.value(type, type); + if ((type.size() == 5) && type.endsWith('F')) { + type.chop(1); // FSLTL freighter suffix; the ICAO type remains four characters + } + if ((type.size() < 3) || (type.size() > 4)) { + continue; + } + + const QString filename = QDir(modelDir).relativeFilePath(gltf); + m_3DModelsByType[type].append(filename); + const QString lowDetail = gltf.chopped(QString(".gltf").size()) + "_lod1.gltf"; + if (lowDetailFiles.contains(lowDetail)) { + m_lowDetailModels.insert(filename, QDir(modelDir).relativeFilePath(lowDetail)); + } + if (parts.size() > typeIndex + 1) + { + const QString operatorICAO = parts[typeIndex + 1].toUpper(); + if (operatorICAO.size() == 3) { + m_3DModels.insert(type + "_" + operatorICAO, filename); + } + } + } + + const QHash<QString, QStringList> &modelsByType = m_3DModelsByType; + for (const QStringList &models : modelsByType) + { + for (const QString &model : models) { + m_installedModels.insert(model); + } + } + // Vertical offset so undercarriage isn't underground, because 0,0,0 is in the middle of the model // rather than at the bottom m_modelAltitudeOffset.insert("A306", 4.6f); @@ -164,6 +437,31 @@ Aircraft3DModels::Aircraft3DModels(bool verbose) m_modelAltitudeOffset.insert("SB20", 2.0f); m_modelAltitudeOffset.insert("SF34", 1.89f); + // The models converted from FSLTL have their origin at MSFS's reference datum rather + // than where the Bluebell models have theirs, so the same type needs a different + // height - a Bluebell 737-800's 3.31 m left an FSLTL one floating 0.6 m up, and its + // E170 2.3 m up, as that model's origin is at the wheels. These are the main wheels' + // contact points below the datum, from each type's flight_model.cfg [CONTACT_POINTS], + // checked against the models' own geometry with the gear down (A20N, B738, CRJ7, + // BCS3, DH8D, E170, E190, SU95, LJ25, P28A within 0.15 m). The Asobo light aircraft + // FSLTL reuses don't agree with their contact points (the Caravan's are 1.1 m out), + // so theirs are the lowest point of their wheels, measured with the skinning their + // gear legs use applied - not of the whole model, which has parts MSFS hides + m_msfsModelAltitudeOffset = { + {"A20N", 3.80f}, {"A21N", 3.93f}, {"A306", 5.24f}, {"A30B", 5.32f}, {"A319", 3.84f}, + {"A320", 3.80f}, {"A321", 3.89f}, {"A332", 5.64f}, {"A333", 5.61f}, {"A343", 5.45f}, + {"A346", 5.50f}, {"A359", 3.99f}, {"A388", 4.99f}, {"AT45", 2.01f}, {"AT46", 2.01f}, + {"AT75", 2.01f}, {"AT76", 2.01f}, {"B733", 2.49f}, {"B734", 2.30f}, {"B737", 2.73f}, + {"B738", 2.71f}, {"B739", 2.75f}, {"B73X", 2.59f}, {"B744", 4.82f}, {"B748", 4.98f}, + {"B763", 4.90f}, {"B772", 5.01f}, {"B77L", 5.01f}, {"B77W", 5.01f}, {"B788", 5.31f}, + {"B789", 5.30f}, {"B78X", 4.86f}, {"BCS1", 2.32f}, {"BCS3", 2.29f}, {"CRJ7", 2.43f}, + {"DH8C", 3.78f}, {"DH8D", 4.11f}, {"E170", 0.0f}, {"E190", 2.65f}, {"LJ25", 1.32f}, + {"MD11", 5.25f}, {"P28A", 1.18f}, {"SF34", 2.06f}, {"SU95", 0.08f}, + // Asobo, from their wheels + {"B350", 1.46f}, {"C152", 0.97f}, {"C172", 1.33f}, {"C208", 2.46f}, {"C25C", 0.88f}, + {"DA40", 1.07f}, {"DA62", 1.01f}, {"DR40", 0.93f}, {"TBM9", 1.12f}, {"VL3", 1.02f} + }; + // Label offsets (from bottom of aircraft) m_labelAltitudeOffset.insert("A306", 10.0f); m_labelAltitudeOffset.insert("A310", 15.0f); @@ -227,8 +525,66 @@ Aircraft3DModels::Aircraft3DModels(bool verbose) m_labelAltitudeOffset.insert("L410", 5.0f); m_labelAltitudeOffset.insert("SB20", 6.5f); m_labelAltitudeOffset.insert("SF34", 6.0f); + // Types only the FSLTL models have, sized like their nearest relatives above + m_labelAltitudeOffset.insert("A20N", 10.0f); + m_labelAltitudeOffset.insert("A21N", 10.0f); + m_labelAltitudeOffset.insert("A30B", 10.0f); + m_labelAltitudeOffset.insert("A359", 14.0f); + m_labelAltitudeOffset.insert("AT45", 7.0f); + m_labelAltitudeOffset.insert("AT46", 7.0f); + m_labelAltitudeOffset.insert("AT75", 7.0f); + m_labelAltitudeOffset.insert("AT76", 7.0f); + m_labelAltitudeOffset.insert("B73X", 10.0f); + m_labelAltitudeOffset.insert("B748", 15.0f); + m_labelAltitudeOffset.insert("B789", 14.0f); + m_labelAltitudeOffset.insert("B78X", 14.0f); + m_labelAltitudeOffset.insert("BCS1", 8.0f); + m_labelAltitudeOffset.insert("BCS3", 8.5f); + m_labelAltitudeOffset.insert("C208", 4.0f); + m_labelAltitudeOffset.insert("DA62", 3.0f); + m_labelAltitudeOffset.insert("DH8C", 6.5f); + m_labelAltitudeOffset.insert("LJ25", 4.0f); + m_labelAltitudeOffset.insert("P28A", 3.0f); + m_labelAltitudeOffset.insert("SU95", 8.5f); + m_labelAltitudeOffset.insert("TBM9", 3.5f); + m_labelAltitudeOffset.insert("VL3", 2.5f); + m_labelAltitudeOffset.insert("B350", 4.5f); + m_labelAltitudeOffset.insert("C152", 3.0f); + m_labelAltitudeOffset.insert("C25C", 4.5f); + m_labelAltitudeOffset.insert("DA40", 3.0f); + m_labelAltitudeOffset.insert("DR40", 3.0f); + + // Map from OpenSky database names to 3D model names. Only needed where the database + // gives no ICAO type designator (0.2% of airline aircraft), which modelFor() prefers. + // A pattern names the type the aircraft is, and modelFor() steps to a relative where + // that has no model - so these name the A320neo, 787-9 and so on as what they are. + // First match wins, so each specific pattern comes before the general one it is in + m_3DModelMatch.append(new ModelMatch("A.?319.?1\\d\\dN", "A19N")); + m_3DModelMatch.append(new ModelMatch("A.?320.?2\\d\\dN", "A20N")); + m_3DModelMatch.append(new ModelMatch("A.?321.?2\\d\\dN", "A21N")); + m_3DModelMatch.append(new ModelMatch("A350.?10\\d\\d", "A35K")); + m_3DModelMatch.append(new ModelMatch("A220.?100|C.?Series.*100|CS100", "BCS1")); + m_3DModelMatch.append(new ModelMatch("A220.?300|C.?Series.*300|CS300", "BCS3")); + m_3DModelMatch.append(new ModelMatch("737.?MAX.?10", "B3XM")); + m_3DModelMatch.append(new ModelMatch("737.?MAX.?7", "B37M")); + m_3DModelMatch.append(new ModelMatch("737.?MAX.?8", "B38M")); + m_3DModelMatch.append(new ModelMatch("737.?MAX.?9", "B39M")); + m_3DModelMatch.append(new ModelMatch("747.?8", "B748")); + m_3DModelMatch.append(new ModelMatch("787.?10", "B78X")); + m_3DModelMatch.append(new ModelMatch("787.?9", "B789")); + m_3DModelMatch.append(new ModelMatch("ATR.*42.*600", "AT46")); + m_3DModelMatch.append(new ModelMatch("ATR.*42.*500", "AT45")); + m_3DModelMatch.append(new ModelMatch("ATR.*72.*600", "AT76")); + m_3DModelMatch.append(new ModelMatch("ATR.*72.*500", "AT75")); + m_3DModelMatch.append(new ModelMatch("Superjet|RRJ.?95", "SU95")); + m_3DModelMatch.append(new ModelMatch("EMB.?190.?E2|E190.?E2", "E290")); + m_3DModelMatch.append(new ModelMatch("EMB.?195.?E2|E195.?E2", "E295")); + m_3DModelMatch.append(new ModelMatch("EMB.?175|ERJ.?175|Embraer 175", "E75L")); + m_3DModelMatch.append(new ModelMatch("DHC-8.?1\\d\\d", "DH8A")); + m_3DModelMatch.append(new ModelMatch("DHC-8.?2\\d\\d", "DH8B")); + m_3DModelMatch.append(new ModelMatch("DHC-8.?3\\d\\d", "DH8C")); + m_3DModelMatch.append(new ManufacturerModelMatch("^208", "Cessna|Textron", "C208")); - // Map from OpenSky database names to 3D model names m_3DModelMatch.append(new ModelMatch("A300.*", "A306")); // A300 B4 is A300-600, but use for others as closest match m_3DModelMatch.append(new ModelMatch("A310.*", "A310")); m_3DModelMatch.append(new ModelMatch("A318.*", "A318")); @@ -243,7 +599,7 @@ Aircraft3DModels::Aircraft3DModels(bool verbose) m_3DModelMatch.append(new ModelMatch("A340.3.*", "A343")); m_3DModelMatch.append(new ModelMatch("A340.5.*", "A345")); m_3DModelMatch.append(new ModelMatch("A340.6.*", "A346")); - m_3DModelMatch.append(new ModelMatch("A350.*", "A333")); // No A350 model - use 330 as twin engine + m_3DModelMatch.append(new ModelMatch("A350.*", "A359")); // modelFor() falls back to the A330 without one m_3DModelMatch.append(new ModelMatch("A380.*", "A388")); m_3DModelMatch.append(new ModelMatch("737.2.*", "B733")); // No 200 model @@ -255,11 +611,9 @@ Aircraft3DModels::Aircraft3DModels(bool verbose) m_3DModelMatch.append(new ModelMatch("737.7.*", "B737")); m_3DModelMatch.append(new ModelMatch("737NG.7.*", "B737")); m_3DModelMatch.append(new ModelMatch("737.8.*", "B738")); - m_3DModelMatch.append(new ModelMatch("737NG.8.*", "B738")); // No Max model yet - m_3DModelMatch.append(new ModelMatch("737MAX.8.*", "B738")); + m_3DModelMatch.append(new ModelMatch("737NG.8.*", "B738")); m_3DModelMatch.append(new ModelMatch("737.9", "B739")); m_3DModelMatch.append(new ModelMatch("737NG.9", "B739")); - m_3DModelMatch.append(new ModelMatch("737MAX.9", "B739")); m_3DModelMatch.append(new ModelMatch("B747.*F", "B74F")); m_3DModelMatch.append(new ModelMatch("B747.*\\(F\\)", "B74F")); m_3DModelMatch.append(new ModelMatch("747.*", "B744")); @@ -341,10 +695,17 @@ Aircraft3DModels::Aircraft3DModels(bool verbose) QString Aircraft3DModels::modelForTypeAndOperator(const QString &type, const QString &operatorICAO, bool verbose) const { QString typeOperator = type + "_" + operatorICAO; - if (m_3DModels.contains(typeOperator)) { - return m_3DModels.value(typeOperator); + if (m_3DModels.contains(typeOperator)) + { + const QString model = m_3DModels.value(typeOperator); + if (hasTextures(model)) { + return model; + } + if (verbose) { + qDebug() << "Aircraft3DModels: livery" << model << "is missing its texture"; + } } - if (verbose) { + else if (verbose) { qDebug() << "Aircraft3DModels: no livery for" << typeOperator; } return ""; @@ -354,31 +715,47 @@ QString Aircraft3DModels::modelForType(const QString &type) const { if (m_3DModelsByType.contains(type)) { - // Choose a random livery. QRandomGenerator::global() is thread safe, which the - // ADS-B tracker's own generator was not once these tables became shared. + // Choose a random livery - the first from a random start whose textures are + // installed. QRandomGenerator::global() is thread safe, which the ADS-B tracker's + // own generator was not once these tables became shared. const QStringList models = m_3DModelsByType.value(type); - return models[QRandomGenerator::global()->bounded(models.size())]; + const int start = QRandomGenerator::global()->bounded(models.size()); + for (int i = 0; i < models.size(); i++) + { + const QString &model = models[(start + i) % models.size()]; + if (hasTextures(model)) { + return model; + } + } } return ""; } -void Aircraft3DModels::offsetsForType(const QString &type, float &altitudeOffset, float &labelOffset) const +void Aircraft3DModels::offsetsForType(const QString &type, float &altitudeOffset, float &labelOffset, + const QString &model) const { - if (m_modelAltitudeOffset.contains(type)) - { + const bool msfs = model.startsWith("MSFS/"); + if (msfs && m_msfsModelAltitudeOffset.contains(type)) { + altitudeOffset = m_msfsModelAltitudeOffset.value(type); + } else if (m_modelAltitudeOffset.contains(type)) { altitudeOffset = m_modelAltitudeOffset.value(type); - labelOffset = m_labelAltitudeOffset.value(type); + } else { + return; } + labelOffset = m_labelAltitudeOffset.value(type, labelOffset); } // Types are grouped by what they LOOK like rather than by what they are, because the // stand-in only has to be the right shape and size at map distances: a four engine -// heavy, a widebody twin, a narrowbody twin, or something small. Within a group the -// candidates are ordered by how commonly a model for them is installed, and the search -// widens rather than giving up - a wrong-but-plausible airliner reads far better than a -// billboard among modelled aircraft. +// heavy, a widebody twin, a narrowbody twin, a regional jet or turboprop, a business +// jet or a light piston/turboprop. Within a group the candidates are ordered by how +// close a match they are, and the search widens rather than giving up - a +// wrong-but-plausible aircraft reads far better than a billboard among modelled ones. +// The models span both sets: the Bluebell one has the business jets and Cessnas, the +// FSLTL one the Learjet 25, Caravan, TBM and DA62 instead. bool Aircraft3DModels::defaultModel(const QString &icaoType, QString &model, - float &altitudeOffset, float &labelOffset) const + float &altitudeOffset, float &labelOffset, + bool knownTypesOnly) const { if (m_3DModelsByType.isEmpty()) { return false; @@ -389,32 +766,69 @@ bool Aircraft3DModels::defaultModel(const QString &icaoType, QString &model, "B748", "B74F", "BLCF", "C130", "C17", "IL76", "AN12", "E3TF", "K35R"}; static const QStringList heavyTwin = { "B762", "B763", "B764", "B772", "B773", "B77L", "B77W", "B788", "B789", - "B78X", "A306", "A310", "A332", "A333", "A338", "A339", "A359", "A35K", - "MD11", "DC10"}; - static const QStringList small = { - "GLF4", "GLF5", "GLF6", "GLEX", "GL5T", "CL60", "C25A", "C25B", "C25C", - "C525", "C550", "C560", "C56X", "C680", "C68A", "C750", "E50P", "E55P", - "E545", "E550", "F2TH", "F900", "FA7X", "FA8X", "LJ35", "LJ45", "LJ60", - "PC24", "PRM1", "HDJT", "BE20", "C172", "C182", "PA28", "SR22", "DA42", - "P28A", "TBM9", "PC12", "SF50"}; + "B78X", "A306", "A30B", "A310", "A332", "A333", "A338", "A339", "A359", + "A35K", "MD11", "DC10", "B778", "B779"}; + static const QStringList narrowBody = { + "B712", "B717", "B732", "B735", "B736", "B752", "B753", "MD81", "MD82", + "MD83", "MD87", "MD88", "MD90", "A318", "C919", "B37M", "B38M", "B39M", + "B3XM"}; + static const QStringList regionalJet = { + "E135", "E145", "E35L", "E170", "E75L", "E75S", "E190", "E195", "E290", + "E295", "CRJ1", "CRJ2", "CRJ7", "CRJ9", "CRJX", "F28", "F70", "F100", + "B461", "B462", "B463", "RJ70", "RJ85", "RJ1H", "J328", "SU95", "BCS1", + "BCS3", "A148"}; + static const QStringList turboprop = { + "AT42", "AT43", "AT45", "AT46", "AT72", "AT73", "AT75", "AT76", "DH8A", + "DH8B", "DH8C", "DH8D", "SF34", "SB20", "JS41", "JS32", "D328", "F50", + "L410", "E120", "B190", "SW4", "DHC6", "AN26", "C295"}; + static const QStringList smallJet = { + "GLF4", "GLF5", "GLF6", "GLEX", "GL5T", "GL7T", "CL30", "CL35", "CL60", + "C25A", "C25B", "C25C", "C25M", "C501", "C510", "C525", "C550", "C560", + "C56X", "C650", "C680", "C68A", "C700", "C750", "E50P", "E55P", "E545", + "E550", "F2TH", "F900", "FA7X", "FA8X", "FA50", "LJ25", "LJ31", "LJ35", + "LJ40", "LJ45", "LJ55", "LJ60", "LJ75", "H25A", "H25B", "H25C", "PC24", + "PRM1", "HDJT", "SF50", "BE40", "G150", "G280", "ASTR", "GALX", "EA50"}; + static const QStringList smallProp = { + "BE9L", "BE20", "BE30", "B350", "BE36", "BE33", "BE35", "BE55", "BE58", + "BE76", "C150", "C152", "C162", "C170", "C172", "C177", "C182", "C206", + "C208", "C210", "C310", "C340", "C414", "C421", "PA18", "PA22", "PA24", + "PA28", "P28A", "P28B", "P28R", "PA30", "PA31", "PA32", "PA34", "PA44", + "PA46", "SR20", "SR22", "DA20", "DA40", "DA42", "DA62", "TBM7", "TBM8", + "TBM9", "PC6T", "PC12", "M20P", "M20T", "AA5", "DR40", "VL3", "P180", + "TB20", "TOBA", "RV7", "RV8", "RV9"}; // Preference order per group. First one with a model installed wins - static const QStringList fourEngineModels = {"B744", "A388", "A343", "B74F", "B742"}; - static const QStringList heavyTwinModels = {"B77W", "A333", "B788", "A332", "B763", "B772"}; - static const QStringList smallModels = {"GLF5", "GLEX", "C750", "CL60", "LJ45", "C680"}; - static const QStringList narrowBodyModels = {"A320", "B738", "A319", "A321", "B737", "B739", "B733"}; + static const QStringList fourEngineModels = {"B744", "A388", "A343", "B74F", "B742", "B748"}; + static const QStringList heavyTwinModels = {"B77W", "A333", "B788", "A332", "B763", "B772", "B789", "A359"}; + static const QStringList narrowBodyModels = {"A320", "B738", "A319", "A321", "B737", "B739", "B733", "A20N", "A21N"}; + static const QStringList regionalJetModels = {"CRJ7", "E190", "E170", "CRJ9", "CRJ2", "E145", "BCS1", "BCS3"}; + static const QStringList turbopropModels = {"AT75", "AT72", "AT76", "DH8D", "DH8C", "SF34", "AT45", "AT42"}; + static const QStringList smallJetModels = {"GLF5", "GLEX", "C750", "CL60", "LJ45", "C680", "C25C", "LJ25"}; + static const QStringList smallPropModels = {"B350", "BE20", "DA62", "C421", "C208", "TBM9", "DA40", "P28A", + "C172", "C152", "C150", "VL3"}; QList<const QStringList *> order; if (fourEngine.contains(icaoType)) { - order = {&fourEngineModels, &heavyTwinModels, &narrowBodyModels, &smallModels}; + order = {&fourEngineModels, &heavyTwinModels, &narrowBodyModels, ®ionalJetModels, &smallJetModels}; } else if (heavyTwin.contains(icaoType)) { - order = {&heavyTwinModels, &fourEngineModels, &narrowBodyModels, &smallModels}; - } else if (small.contains(icaoType)) { - order = {&smallModels, &narrowBodyModels, &heavyTwinModels, &fourEngineModels}; + order = {&heavyTwinModels, &fourEngineModels, &narrowBodyModels, ®ionalJetModels, &smallJetModels}; + } else if (narrowBody.contains(icaoType)) { + order = {&narrowBodyModels, ®ionalJetModels, &heavyTwinModels, &turbopropModels, &smallJetModels}; + } else if (regionalJet.contains(icaoType)) { + order = {®ionalJetModels, &narrowBodyModels, &turbopropModels, &smallJetModels, &heavyTwinModels}; + } else if (turboprop.contains(icaoType)) { + order = {&turbopropModels, ®ionalJetModels, &smallPropModels, &narrowBodyModels}; + } else if (smallJet.contains(icaoType)) { + order = {&smallJetModels, &smallPropModels, ®ionalJetModels, &narrowBodyModels}; + } else if (smallProp.contains(icaoType)) { + order = {&smallPropModels, &smallJetModels, &turbopropModels, &narrowBodyModels}; + } else if (knownTypesOnly) { + return false; } else { // Unknown or blank type. Most of what flies with a transponder and no model of // its own is an airliner-shaped thing, so that is the safer guess - order = {&narrowBodyModels, &heavyTwinModels, &smallModels, &fourEngineModels}; + order = {&narrowBodyModels, &heavyTwinModels, ®ionalJetModels, &smallJetModels, &smallPropModels, + &fourEngineModels, &turbopropModels}; } for (const QStringList *candidates : order) @@ -425,7 +839,7 @@ bool Aircraft3DModels::defaultModel(const QString &icaoType, QString &model, if (!found.isEmpty()) { model = found; - offsetsForType(candidate, altitudeOffset, labelOffset); + offsetsForType(candidate, altitudeOffset, labelOffset, model); return true; } } @@ -437,31 +851,206 @@ bool Aircraft3DModels::defaultModel(const QString &icaoType, QString &model, types.sort(); const QString type = types.first(); model = modelForType(type); - offsetsForType(type, altitudeOffset, labelOffset); + offsetsForType(type, altitudeOffset, labelOffset, model); return !model.isEmpty(); } +// A type's nearest relatives, closest first, to stand in when it has no model installed. +// Both ways round, so a model set with only one generation of an aircraft serves the +// other: the FSLTL set has the ATR 72-500 and -600 (AT75, AT76) but not the AT72 the +// Bluebell set has, and the Bluebell set has no A320neo or 787-9 at all +static const QHash<QString, QStringList>& similarTypes() +{ + static const QHash<QString, QStringList> similar = { + // Airbus narrowbodies + {"A318", {"A319", "A19N", "A320"}}, + {"A319", {"A19N", "A320", "A318"}}, + {"A19N", {"A319", "A20N", "A320"}}, + {"A320", {"A20N", "A319", "A321"}}, + {"A20N", {"A320", "A21N", "A321"}}, + {"A321", {"A21N", "A320", "A20N"}}, + {"A21N", {"A321", "A20N", "A320"}}, + // Airbus widebodies + {"A306", {"A30B", "A310"}}, + {"A30B", {"A306", "A310"}}, + {"A310", {"A306", "A30B"}}, + {"A332", {"A338", "A333"}}, + {"A333", {"A339", "A332"}}, + {"A338", {"A332", "A339", "A333"}}, + {"A339", {"A333", "A338", "A332"}}, + {"A342", {"A343", "A345", "A346"}}, + {"A343", {"A342", "A345", "A346"}}, + {"A345", {"A346", "A343", "A342"}}, + {"A346", {"A345", "A343", "A342"}}, + {"A359", {"A35K", "A339", "A333"}}, + {"A35K", {"A359", "A339", "A333"}}, + // Boeing narrowbodies + {"B732", {"B733", "B734"}}, + {"B733", {"B734", "B735", "B737"}}, + {"B734", {"B733", "B735", "B738"}}, + {"B735", {"B734", "B733", "B737"}}, + {"B736", {"B737", "B735"}}, + {"B737", {"B37M", "B736", "B738"}}, + {"B738", {"B38M", "B739", "B737"}}, + {"B739", {"B39M", "B738", "B73X"}}, + {"B37M", {"B737", "B38M", "B738"}}, + {"B38M", {"B738", "B39M", "B739"}}, + {"B39M", {"B739", "B38M", "B738"}}, + {"B3XM", {"B73X", "B39M", "B739"}}, + {"B73X", {"B3XM", "B39M", "B739"}}, + {"B752", {"B753"}}, + {"B753", {"B752"}}, + // Boeing widebodies + {"B741", {"B742", "B744"}}, + {"B742", {"B744", "B741"}}, + {"B743", {"B744", "B742"}}, + {"B744", {"B748", "B743"}}, + {"B748", {"B744"}}, + {"B762", {"B763", "B764"}}, + {"B763", {"B762", "B764"}}, + {"B764", {"B763", "B762"}}, + {"B772", {"B77L", "B77W", "B773"}}, + {"B77L", {"B772", "B77W", "B773"}}, + {"B773", {"B77W", "B772", "B77L"}}, + {"B77W", {"B773", "B77L", "B772"}}, + {"B778", {"B77W", "B773"}}, + {"B779", {"B77W", "B773"}}, + {"B788", {"B789", "B78X"}}, + {"B789", {"B788", "B78X"}}, + {"B78X", {"B789", "B788"}}, + {"DC10", {"MD11"}}, + {"MD11", {"DC10"}}, + {"MD81", {"MD83", "MD90"}}, + {"MD82", {"MD83", "MD90"}}, + {"MD83", {"MD90"}}, + {"MD87", {"MD83", "MD90"}}, + {"MD88", {"MD83", "MD90"}}, + {"MD90", {"MD83"}}, + // Regional + {"AT42", {"AT45", "AT43", "AT46"}}, + {"AT43", {"AT45", "AT42", "AT46"}}, + {"AT45", {"AT46", "AT43", "AT42"}}, + {"AT46", {"AT45", "AT43", "AT42"}}, + {"AT72", {"AT75", "AT73", "AT76"}}, + {"AT73", {"AT75", "AT72", "AT76"}}, + {"AT75", {"AT76", "AT73", "AT72"}}, + {"AT76", {"AT75", "AT73", "AT72"}}, + {"BCS1", {"BCS3"}}, + {"BCS3", {"BCS1"}}, + {"CRJ1", {"CRJ2"}}, + {"CRJ2", {"CRJ1", "CRJ7"}}, + {"CRJ7", {"CRJ9", "CRJ2"}}, + {"CRJ9", {"CRJ7", "CRJX"}}, + {"CRJX", {"CRJ9", "CRJ7"}}, + {"DH8A", {"DH8B", "DH8C", "DH8D"}}, + {"DH8B", {"DH8C", "DH8A", "DH8D"}}, + {"DH8C", {"DH8B", "DH8D"}}, + {"DH8D", {"DH8C"}}, + {"E135", {"E145"}}, + {"E145", {"E135"}}, + {"E35L", {"E135", "E145"}}, + {"E170", {"E75S", "E75L", "E190"}}, + {"E75L", {"E75S", "E170", "E190"}}, + {"E75S", {"E75L", "E170", "E190"}}, + {"E190", {"E290", "E195", "E170"}}, + {"E195", {"E295", "E190"}}, + {"E290", {"E190", "E295", "E195"}}, + {"E295", {"E195", "E290", "E190"}}, + {"F70", {"F100"}}, + {"F100", {"F70"}}, + {"B461", {"B462", "B463"}}, + {"B462", {"B463", "B461"}}, + {"B463", {"B462", "B461"}}, + // Light aircraft + {"BE9L", {"BE20", "B350"}}, + {"BE20", {"B350", "BE30", "BE9L"}}, + {"BE30", {"B350", "BE20"}}, + {"B350", {"BE30", "BE20"}}, + {"C150", {"C152", "C172"}}, + {"C152", {"C150", "C172"}}, + {"C172", {"C152", "C150"}}, + {"LJ25", {"LJ35", "LJ45"}}, + {"LJ35", {"LJ45", "LJ25"}}, + {"LJ45", {"LJ35", "LJ25"}}, + }; + return similar; +} + bool Aircraft3DModels::modelFor(const AircraftInformation *info, bool favourLivery, bool verbose, QString &model, float &altitudeOffset, float &labelOffset) const { - if (!info || info->m_model.isEmpty()) { + if (!info || (info->m_model.isEmpty() && info->m_type.isEmpty())) { return false; } model = ""; - QString type; + // The types to try, best first. The ICAO designator the database gives comes first: + // it tells an A320neo from an A320 and a 787-9 from a 787-8, which the name patterns + // can't - "A320 251NSL" is an A20N - and it is there for 99.8% of airline aircraft. + // Then the type the model's name suggests, for the rest. Each is followed by its + // nearest relatives, for when it has no model of its own installed + QStringList candidates; + const auto addCandidate = [&candidates](const QString &candidate) { + if (candidate.isEmpty() || candidates.contains(candidate)) { + return; + } + candidates.append(candidate); + for (const QString &similar : similarTypes().value(candidate)) + { + if (!candidates.contains(similar)) { + candidates.append(similar); + } + } + }; + static const QRegularExpression designator("^[A-Z0-9]{2,4}$"); + const QString icaoType = info->m_type.trimmed().toUpper(); + if (designator.match(icaoType).hasMatch()) { + addCandidate(icaoType); + } for (auto mm : m_3DModelMatch) { - if (!mm->match(info->m_model, info->m_manufacturerName, type)) { - continue; + QString matched; + if (mm->match(info->m_model, info->m_manufacturerName, matched)) + { + addCandidate(matched); + break; } + } + + QString type; + for (const QString &candidate : candidates) + { + if (!modelForType(candidate).isEmpty()) + { + type = candidate; + break; + } + } + if (!type.isEmpty()) + { QString operatorICAO = info->m_operatorICAO; - // Look for operator specific livery + // The operator's livery, on the type or one of its nearest relatives: an airline's + // A320 is a better match for its A320neo than another airline's A320neo + QStringList liveryTypes = {type}; + liveryTypes.append(similarTypes().value(type)); + const auto liveryFor = [&](const QString &op, const QStringList &types) { + for (const QString &candidate : types) + { + const QString found = modelForTypeAndOperator(candidate, op, verbose); + if (!found.isEmpty()) + { + type = candidate; + return found; + } + } + return QString(); + }; + if (!operatorICAO.isEmpty()) { - model = modelForTypeAndOperator(type, operatorICAO, verbose); + model = liveryFor(operatorICAO, liveryTypes); } if (model.isEmpty()) @@ -479,46 +1068,55 @@ bool Aircraft3DModels::modelFor(const AircraftInformation *info, bool favourLive if (alternateOperator.contains(operatorICAO)) { operatorICAO = alternateOperator.value(operatorICAO); - model = modelForTypeAndOperator(type, operatorICAO, verbose); + model = liveryFor(operatorICAO, liveryTypes); } if (model.isEmpty() && favourLivery && !operatorICAO.isEmpty()) { - // Try to find similar aircraft with matching livery + // Try to find a different aircraft of about the same size in the livery static const QHash<QString, QStringList> alternateTypes = { - {"B788", {"B77W", "B77L", "B772", "B773", "B763", "A332", "A333"}}, - {"B77W", {"B77L", "B772", "B773", "B788", "B763", "A332", "A333"}}, - {"B77L", {"B77W", "B772", "B773", "B788", "B763", "A332", "A333"}}, - {"B772", {"B77W", "B77L", "B773", "B788", "B763", "A332", "A333"}}, - {"B773", {"B77W", "B77L", "B772", "B788", "B763", "A332", "A333"}}, - {"A332", {"A333", "B77W", "B77L", "B773", "B772", "B788", "B763"}}, - {"A333", {"A332", "B77W", "B77L", "B773", "B772", "B788", "B763"}}, + {"B788", {"B789", "B78X", "B77W", "B77L", "B772", "B773", "B763", "A332", "A333", "A359"}}, + {"B789", {"B788", "B78X", "B77W", "B77L", "B772", "B773", "B763", "A332", "A333", "A359"}}, + {"B78X", {"B789", "B788", "B77W", "B77L", "B772", "B773", "B763", "A333", "A359"}}, + {"B77W", {"B77L", "B772", "B773", "B788", "B789", "B763", "A332", "A333", "A359"}}, + {"B77L", {"B77W", "B772", "B773", "B788", "B789", "B763", "A332", "A333", "A359"}}, + {"B772", {"B77W", "B77L", "B773", "B788", "B789", "B763", "A332", "A333", "A359"}}, + {"B773", {"B77W", "B77L", "B772", "B788", "B789", "B763", "A332", "A333", "A359"}}, + {"A332", {"A333", "A359", "B77W", "B77L", "B773", "B772", "B788", "B789", "B763"}}, + {"A333", {"A332", "A359", "B77W", "B77L", "B773", "B772", "B788", "B789", "B763"}}, + {"A359", {"A333", "A332", "B789", "B788", "B77W", "B77L", "B772", "B773"}}, {"A342", {"A343", "A345", "A346"}}, {"A343", {"A342", "A345", "A346"}}, {"A345", {"A343", "A342", "A346"}}, {"A346", {"A345", "A343", "A342"}}, - {"B744", {"B74F"}}, - {"B74F", {"B744"}}, - {"B733", {"B734", "B737", "B738", "B739", "B752", "A320", "A319", "A321"}}, - {"B734", {"B733", "B737", "B738", "B739", "B752", "A320", "A319", "A321"}}, - {"B737", {"B733", "B734", "B738", "B739", "B752", "A320", "A319", "A321"}}, - {"B738", {"B733", "B734", "B737", "B739", "B752", "A320", "A319", "A321"}}, - {"B739", {"B733", "B734", "B737", "B738", "B752", "A320", "A319", "A321"}}, - {"A319", {"A320", "A321", "B733", "B734", "B737", "B738", "B739"}}, - {"A320", {"A319", "A321", "B733", "B734", "B737", "B738", "B739"}}, - {"A321", {"A319", "A320", "B733", "B734", "B737", "B738", "B739"}}, - {"A306", {"A332", "A333", "B763"}}, + {"B744", {"B74F", "B748"}}, + {"B74F", {"B744", "B748"}}, + {"B748", {"B744", "B74F"}}, + {"B733", {"B734", "B737", "B738", "B739", "B752", "A320", "A20N", "A319", "A321", "A21N"}}, + {"B734", {"B733", "B737", "B738", "B739", "B752", "A320", "A20N", "A319", "A321", "A21N"}}, + {"B737", {"B733", "B734", "B738", "B739", "B752", "A320", "A20N", "A319", "A321", "A21N"}}, + {"B738", {"B733", "B734", "B737", "B739", "B752", "A320", "A20N", "A319", "A321", "A21N"}}, + {"B739", {"B733", "B734", "B737", "B738", "B752", "A320", "A20N", "A319", "A321", "A21N"}}, + {"A319", {"A320", "A20N", "A321", "A21N", "B733", "B734", "B737", "B738", "B739"}}, + {"A320", {"A20N", "A319", "A321", "A21N", "B733", "B734", "B737", "B738", "B739"}}, + {"A20N", {"A320", "A21N", "A319", "A321", "B738", "B737", "B739", "B733", "B734"}}, + {"A321", {"A21N", "A320", "A20N", "A319", "B739", "B738", "B737", "B733", "B734"}}, + {"A21N", {"A321", "A20N", "A320", "A319", "B739", "B738", "B737", "B733", "B734"}}, + {"A306", {"A30B", "A332", "A333", "B763"}}, + {"AT75", {"AT76", "AT72", "AT45", "AT46", "AT42", "DH8D"}}, + {"AT76", {"AT75", "AT72", "AT46", "AT45", "AT42", "DH8D"}}, + {"AT72", {"AT75", "AT76", "AT45", "AT46", "AT42", "DH8D"}}, + {"AT45", {"AT46", "AT42", "AT75", "AT76", "AT72"}}, + {"AT46", {"AT45", "AT42", "AT76", "AT75", "AT72"}}, + {"AT42", {"AT45", "AT46", "AT72", "AT75", "AT76"}}, + {"BCS1", {"BCS3", "E190", "E195", "A319"}}, + {"BCS3", {"BCS1", "E195", "E190", "A319", "A20N"}}, + {"E190", {"E195", "E170", "BCS1", "BCS3", "CRJ9"}}, + {"E170", {"E190", "CRJ7", "CRJ9"}}, }; - if (alternateTypes.contains(type)) - { - for (const auto& alternate : alternateTypes.value(type)) - { - model = modelForTypeAndOperator(alternate, operatorICAO, verbose); - if (!model.isEmpty()) { - break; - } - } + if (alternateTypes.contains(type)) { + model = liveryFor(operatorICAO, alternateTypes.value(type)); } } @@ -528,21 +1126,21 @@ bool Aircraft3DModels::modelFor(const AircraftInformation *info, bool favourLive model = modelForType(type); } } - break; } if (verbose) { if (model.isEmpty()) { - qDebug() << "Aircraft3DModels: no model for" << info->m_model << info->m_operatorICAO; + qDebug() << "Aircraft3DModels: no model for" << info->m_type << info->m_model << info->m_operatorICAO + << "- tried" << candidates; } else { - qDebug() << "Aircraft3DModels: matched" << info->m_model << info->m_operatorICAO << "to" << model; + qDebug() << "Aircraft3DModels: matched" << info->m_type << info->m_model << info->m_operatorICAO << "to" << model; } } if (model.isEmpty()) { return false; } - offsetsForType(type, altitudeOffset, labelOffset); + offsetsForType(type, altitudeOffset, labelOffset, model); return true; } diff --git a/sdrbase/util/aircraft3dmodels.h b/sdrbase/util/aircraft3dmodels.h index 7a161e536..3edfd48ea 100644 --- a/sdrbase/util/aircraft3dmodels.h +++ b/sdrbase/util/aircraft3dmodels.h @@ -22,6 +22,9 @@ #include <QStringList> #include <QHash> #include <QList> +#include <QSet> +#include <QMutex> +#include <QElapsedTimer> #include <QRegularExpression> #include "export.h" @@ -115,27 +118,93 @@ public: QString modelForTypeAndOperator(const QString &type, const QString &operatorICAO, bool verbose = false) const; - // Where a type's model has to sit so its undercarriage is not underground - void offsetsForType(const QString &type, float &altitudeOffset, float &labelOffset) const; + // Where a type's model has to sit so its undercarriage is not underground. The model + // matters as well as the type: the two model sets put the origin in different places + void offsetsForType(const QString &type, float &altitudeOffset, float &labelOffset, + const QString &model = QString()) const; bool isEmpty() const { return m_3DModelsByType.isEmpty(); } + // Whether a model path, as modelFor() returns it, is one of the models installed + // now. A model chosen in an earlier session - and kept, as the Aircraft feature + // keeps them in its database - may since have been removed with its model pack + bool isInstalled(const QString &model) const { return m_installedModels.contains(model); } + + // A cheaper model of the same aircraft and livery, for the 3D map to draw it with + // when it is only a few dozen pixels across. Empty when there is none: only the + // MSFS models converted with a second level of detail have one + QString lowDetailModel(const QString &model) const { return m_lowDetailModels.value(model); } + // A stand-in for an aircraft the matcher has no model for. Only a fraction of the // types that fly have a model, so without this a Falcon 900, a King Air or anything // else outside the set shows as a flat billboard next to fully modelled airliners. + // With knownTypesOnly, false for a type it has no shape group for - so a caller that + // has something better to go on, such as an ADS-B emitter category, can use that bool defaultModel(const QString &icaoType, QString &model, - float &altitudeOffset, float &labelOffset) const; + float &altitudeOffset, float &labelOffset, + bool knownTypesOnly = false) const; static QString dataDir(); + // The 2D livery icon name for a model. The icons are named after the Bluebell + // models, <type>_<operator>; the models converted from FSLTL/MSFS are named + // FSLTL_<type>_<operator>_cesium, so neither the prefix nor the suffix belongs + // in an icon name and both are taken off + static QString liveryIconName(const QString &model); + + // Whether a model has a named animation, so an animation is only asked for from a + // model that can play it. The models differ: 111 of the 183 A320 liveries have no + // engine animation and 72 do, and the category stand-ins have only some of the set. + // Read from the model's own glTF the first time a model is asked about, and + // remembered on disk, so each model is parsed once per machine rather than once per + // session - and never at start up, where reading 1,758 files would be felt. + // Unknown - no such file, or unreadable - answers true: asking is harmless, as the + // map declines what a model lacks, where wrongly suppressing is not. + bool hasAnimation(const QString &model, const QString &animation) const; + + // Whether every texture a model refers to is installed. Some liveries in the model + // pack name an image that was never shipped, and Cesium draws nothing for such a + // model, so it is passed over when a model is chosen and the type's other liveries + // are used instead. Read from the glTF alongside the animations, and remembered + // the same way. Unknown answers true, as hasAnimation() does. + bool hasTextures(const QString &model) const; + private: + + // What is read from a model's own glTF: only worth having once, so kept on disk + struct ModelInfo { + bool readable = false; // False for a model that could not be read + bool textures = true; + QSet<QString> animations; + }; + Aircraft3DModels(bool verbose); ~Aircraft3DModels(); + ModelInfo modelInfo(const QString &model) const; + void loadModelInfoCache() const; + void saveModelInfoCache() const; + static QString modelInfoCachePath(); + + // Built on demand, from whichever worker thread asks first - hence mutable, and the + // mutex. Entries are stamped with the file's size and modification time, so a + // replaced model pack is re-read rather than trusted. + mutable QMutex m_modelInfoMutex; + mutable bool m_modelInfoLoaded = false; + mutable QHash<QString, ModelInfo> m_modelInfo; // Model path to what its glTF says + mutable QHash<QString, QString> m_modelInfoStamp; // Model path to the size/mtime it was read at + mutable QHash<QString, qint64> m_modelInfoCheckedMs; // When each model was last stat()ed. + mutable QElapsedTimer m_modelInfoClock; + static constexpr qint64 m_modelInfoRecheckMs = 30000; + mutable QSet<QString> m_unreadableModels; // Not persisted: tried again next session + QHash<QString, QString> m_3DModels; // "TYPE_LIVERY" to model path QHash<QString, QStringList> m_3DModelsByType; // Type to every livery of it + QHash<QString, QString> m_lowDetailModels; // Model path to its low detail sibling + QSet<QString> m_installedModels; // Every model path found QList<ModelMatch *> m_3DModelMatch; // Database names to type designators QHash<QString, float> m_modelAltitudeOffset; + QHash<QString, float> m_msfsModelAltitudeOffset; // For the models in MSFS/ QHash<QString, float> m_labelAltitudeOffset; }; diff --git a/sdrbase/util/aircraftenginesound.h b/sdrbase/util/aircraftenginesound.h new file mode 100644 index 000000000..45a353709 --- /dev/null +++ b/sdrbase/util/aircraftenginesound.h @@ -0,0 +1,131 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_AIRCRAFTENGINESOUND_H +#define INCLUDE_AIRCRAFTENGINESOUND_H + +#include <QString> +#include <QRegularExpression> + +// Pick the exterior engine sound the 3D map loops for an aircraft, from its ICAO type +// designator and, on ADS-B, the transmitted emitter category. A designator does not +// say what sort of aircraft it is, so this is pattern matching over the common ones - +// anything unrecognised is taken to be a jet, which is what most of the traffic is. +// Shared by the ADS-B demodulator and the Aircraft feature, like the 3D model +// matching in Aircraft3DModels. +class AircraftEngineSound +{ +public: + // Returns a directory below the Map's 3d/Sounds directory. Its engine.json + // describes the N1/N2 OGG layers, volume and pitch curves, and spatial cones. + // Propeller aircraft and helicopters retain their single bundled recording. + // The model is the database's model designation (e.g. "A320 232"), which for + // Airbus can identify the engine variant. + static QString engineSound(const QString& type, const QString& emitterCategory = QString(), + const QString& model = QString()) + { + // The category is transmitted by the aircraft itself, so it wins for + // rotorcraft - the helicopter designator list below cannot be complete + if (emitterCategory == QLatin1String("Rotorcraft")) { + return QStringLiteral("helicopter.wav"); + } + + const QString normalizedType = type.trimmed().toUpper(); + const QString normalizedModel = model.trimmed().toUpper(); + + if (!normalizedType.isEmpty()) + { + // Airbus jets. Deliberately not plain A..., which would take in Antonovs + // (A124, A225) and Agustas (A109, A139). + static const QRegularExpression airbusRe(QStringLiteral("^(A3[0-9]{2}|A(19|20|21)N)")); + static const QRegularExpression a320neoRe(QStringLiteral("^A(19|20|21)N$")); + static const QRegularExpression a320ceoRe(QStringLiteral("^A3(18|19|20|21)$")); + static const QRegularExpression b737ngRe(QStringLiteral("^B73[6-9]$")); + // Widebody Boeings - 747 and 767 use the available large-turbofan fallback. + static const QRegularExpression widebodyBoeingRe(QStringLiteral("^B7[467]")); + // Common helicopter designators: Robinson, Airbus Helicopters/Eurocopter, + // Aerospatiale, Agusta/Leonardo, Sikorsky, military H-, Bell, and others + static const QRegularExpression helicopterRe(QStringLiteral( + "^(R(22|44|66)$|EC[0-9]|AS(32|50|55|65)|A(109|119|129|139|149|169|189)" + "|S(61|64|76|92)$|H(47|53|60|64)$|H500|B(06|105|212|214|222|407|412|427|429|430|505)" + "|NH90|LYNX|PUMA|TIGR|GAZL|EXPL|KA32|MI[0-9]|EH10|MD52|MD60|V22)")); + // Common piston and turboprop designators: Cessna singles, Pipers, + // Beechcraft, Diamond, Cirrus, ATR, Dash 8, de Havilland Canada, Pilatus, + // TBM, Mooney, Saab, Metroliner, Jetstream, Fokker 50, Bandeirante, + // Brasilia, Antonov, Hercules, A400M, Let 410, Dornier, Reims, Partenavia + static const QRegularExpression propellerRe(QStringLiteral( + "^(C1[0-9]{2}|C2[0-9]{2}|P28|P32|P46|PA3|PA4|BE[0-9]|B350|DA4|DA62|DV20" + "|SR2|AT[47]|DH8|DHC|PC12|PC6|PC7|PC9|PC21|TBM|M20|SF34|SW[34]|JS[34]" + "|F50$|E110|E120|AN[0-9]|C30J|A400|L410|D228|D328|F406|P68)")); + + if (a320neoRe.match(normalizedType).hasMatch()) { + // Some neos have PW1100Gs, but LEAP is the only installed neo set. + return QStringLiteral("A320n_CFMLeap"); + } + if (a320ceoRe.match(normalizedType).hasMatch()) + { + // The A320ceo family flies with either CFM56s or IAE V2500s, and the + // model designation says which: the middle digit of the variant is + // the engine manufacturer, 1 = CFM International, 3 = IAE - so an + // A320-214 is a CFM56 and an A320-232 a V2500. + static const QRegularExpression v2500Re(QStringLiteral("A3(?:18|19|20|21)\\D{0,3}[0-9]3[0-9]")); + if (v2500Re.match(normalizedModel).hasMatch()) { + return QStringLiteral("A320_IAE_V2500"); + } + return QStringLiteral("A320_CFM56"); + } + if (normalizedType.startsWith(QLatin1String("B78"))) { + // A GEnx/Trent distinction is not available in ordinary ICAO data. + return QStringLiteral("B787_RR"); + } + if (normalizedType.startsWith(QLatin1String("B77"))) { + return QStringLiteral("B777_GE90"); + } + if (b737ngRe.match(normalizedType).hasMatch() + || normalizedType.startsWith(QLatin1String("B38M")) + || normalizedType.startsWith(QLatin1String("B39M"))) { + return QStringLiteral("B737NG_CFM56"); + } + if (airbusRe.match(normalizedType).hasMatch() + || widebodyBoeingRe.match(normalizedType).hasMatch()) { + return QStringLiteral("B777_GE90"); + } + if (helicopterRe.match(normalizedType).hasMatch()) { + return QStringLiteral("helicopter.wav"); + } + // The Beechjet is the one BExx that is not a propeller aircraft + if (propellerRe.match(normalizedType).hasMatch() && !normalizedType.startsWith(QLatin1String("BE40"))) { + return QStringLiteral("engine-prop.wav"); + } + return emitterCategory == QLatin1String("Heavy") + ? QStringLiteral("B777_GE90") : QStringLiteral("B737NG_CFM56"); + } + + // No type known - the emitter category is the only clue + if ((emitterCategory == QLatin1String("Light")) || (emitterCategory == QLatin1String("Ultralight"))) { + return QStringLiteral("engine-prop.wav"); + } + if (!emitterCategory.isEmpty()) { + return emitterCategory == QLatin1String("Heavy") + ? QStringLiteral("B777_GE90") : QStringLiteral("B737NG_CFM56"); + } + return QString(); + } +}; + +#endif // INCLUDE_AIRCRAFTENGINESOUND_H diff --git a/sdrbase/util/aircraftreport.h b/sdrbase/util/aircraftreport.h index 350c03527..a745a3b4f 100644 --- a/sdrbase/util/aircraftreport.h +++ b/sdrbase/util/aircraftreport.h @@ -1,145 +1,323 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // -// Some code by AI // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_UTIL_AIRCRAFTREPORT_H -#define INCLUDE_UTIL_AIRCRAFTREPORT_H - -#include <QString> -#include <QDateTime> - -namespace SWGSDRangel { - class SWGMapItem; -} - -// One sighting of an aircraft by a demodulator, passed from channels (ADS-B and -// ACARS family demodulators) to the Aircraft feature over the "aircraftreport" -// message pipe. Every field is optional except the source description - a report -// carries whichever identities, position and document the received frame had. -struct AircraftReport -{ - // New protocols go on the END: the Aircraft feature keys a per-source map and a - // message rate chart on this value - enum Protocol { - ADSB, - ACARS, // Plain VHF ACARS - VDL2, - HFDL, - AERO, // Inmarsat Classic Aero (aviation SATCOM) - ProtocolCount - }; - - enum DocumentKind { - NoDocument, - AcarsText, // A plain ACARS message - PositionReport, - OooiEvent, // Out/off/on/in event - Loadsheet, - FlightPlan, - Clearance, // Oceanic/departure clearance - Cpdlc, - Logon, // Link management: logons, logoffs - PerformanceReport - }; - - // Source - Protocol m_protocol = ACARS; - qint64 m_frequency = 0; // Channel centre frequency in Hz, 0 if unknown - int m_deviceSetIndex = -1; - int m_channelIndex = -1; - - // Identity - whichever the frame carried - quint32 m_icao = 0; // 24 bit ICAO address, 0 if unknown - QString m_registration; - QString m_flight; // Flight number / callsign as transmitted - - // Position and kinematics - bool m_positionValid = false; - float m_latitude = 0.0f; - float m_longitude = 0.0f; - bool m_altitudeValid = false; - float m_altitudeFt = 0.0f; - bool m_headingValid = false; - float m_heading = 0.0f; // Degrees - bool m_speedValid = false; - float m_speedKts = 0.0f; - QDateTime m_positionDateTime; // The report's own time when it differs from reception - // When the altitude was observed. On ADS-B this is often NOT the position's time: - // a Mode S altitude reply carries no position, so the two are measured separately. - // Invalid on bearers that report a single fix, where the position's time serves. - QDateTime m_altitudeDateTime; - - QDateTime m_received; - - // The OOOI event this report carried, if any. Out of gate, take off, landing and on - // gate are the four times that describe a flight, and they arrive as separate ACARS - // messages on labels 13 to 16. - enum OooiEventKind { OooiNone = 0, OooiOut = 13, OooiOff, OooiOn, OooiIn }; - int m_oooiEvent = OooiNone; - QDateTime m_oooiTime; //!< When the event happened, not when it was reported - - // Weather this report carried. Aircraft ask for it and the ground sends it, so it - // arrives through ACARS like everything else - but it describes an AIRPORT rather - // than the aircraft that happened to request it, which is why it is kept separately. - enum WeatherKind { - WeatherNone = 0, - Metar, //!< Observation - Taf, //!< Forecast - Atis, //!< D-ATIS - Twip, //!< Terminal weather information for pilots - Notam, - Pirep, //!< Pilot report - Sigmet, //!< Significant meteorological information, and AIRMET - WeatherOther //!< Recognised as weather, not as any of the above - }; - int m_weatherKind = WeatherNone; - QString m_weatherAirport; //!< ICAO code the report is about, when it names one - QString m_weatherText; //!< The report itself, as sent - - // Decoded content - DocumentKind m_documentKind = NoDocument; - QString m_documentTitle; - QString m_documentText; // Full multi-line decode - QString m_label; // ACARS label or frame type - bool m_uplink = false; // true when ground to air - QString m_atc; // Concise ATC message text (e.g. "WILCO") for CPDLC - QString m_station; // Ground station / ATC facility, when known - - // Route facts the message revealed (OOOI events, flight plans, clearances) - QString m_departure; - QString m_arrival; - QString m_route; - // One waypoint of m_route. A route insert gives the position of most of its fixes, - // and using those beats looking the names up: it places fixes no database here - // holds, and settles which of two identically named fixes was meant. - struct RouteWaypoint { - QString m_name; - bool m_positionValid = false; - float m_latitude = 0.0f; - float m_longitude = 0.0f; - }; - // Same order and length as the space separated names in m_route, and empty when the - // route came from somewhere that names waypoints without placing them - QList<RouteWaypoint> m_routeWaypoints; - - // Phase 2: a fully-built map item from the ADS-B demodulator, passed through - // so its PFD state reaches the Map losslessly. Ownership transfers with the - // report; nullptr for reports that do not carry one. - SWGSDRangel::SWGMapItem *m_mapItem = nullptr; -}; - -#endif // INCLUDE_UTIL_AIRCRAFTREPORT_H +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_UTIL_AIRCRAFTREPORT_H +#define INCLUDE_UTIL_AIRCRAFTREPORT_H + +#include <QString> +#include <QList> +#include <QRegularExpression> +#include <QDateTime> +#include <QUrl> + +namespace SWGSDRangel { + class SWGMapItem; +} + +// One sighting of an aircraft by a demodulator, passed from channels (ADS-B and +// ACARS family demodulators) to the Aircraft feature over the "aircraftreport" +// message pipe. Every field is optional except the source description - a report +// carries whichever identities, position and document the received frame had. +// A link in an aircraft's Map popup that selects it in the Aircraft feature when it is +// clicked. Both the href and the onclick are needed and neither is redundant: the 2D map +// is QML and follows the href through Text.onLinkActivated, while the 3D map is a Cesium +// infobox in a web view and has to post the URL back over the websocket, which is what +// parent.infoboxLink() does. MapGUI::linkClicked() ends up with it either way. +// +// Written here rather than in either producer because both the ADS-B demodulator and the +// Aircraft feature build popups, and a link that differs between them would send half the +// aircraft on the Map somewhere else. +// +// kind is "icao", "registration" or "flight". +// "Destination airport: EGCC" out of a VDL-2 XID logon's decoded text. +// +// Here rather than beside the VDL-2 decoder because both need it and they are separate +// plugins that cannot link one another: the ACARS demodulator reads it as logons arrive, +// and the Aircraft feature reads it again over stored logons, to fill in flights heard +// before it was read at all. +// +// Anchored to the end of the line so a longer value - the parameter is an octet string, +// so nothing guarantees four characters - is rejected rather than truncated to its first +// four. Only exactly four letters is an ICAO ident. +inline QString xidDestinationAirport(const QString& decoded) +{ + static const QRegularExpression re("Destination airport: ([A-Z]{4})\\s*$", + QRegularExpression::MultilineOption); + const QRegularExpressionMatch match = re.match(decoded); + return match.hasMatch() ? match.captured(1) : QString(); +} + +// The name an aircraft is drawn under on the Map. +// +// Shared because the name is not always chosen by whoever decoded the aircraft. With an +// Aircraft feature present the ADS-B demodulator sends its map item to that feature +// rather than to the Map (ADSBDemodTracker::sendToMap), and the feature renames it - +// one airframe heard on ADS-B, ACARS and VDL-2 has to be one item, and the registration +// is the only identity all three protocols share. So the demodulator has to ask the Map +// for the name its aircraft ACTUALLY has, not the one it would have chosen, and the two +// have to agree on the rule to do that. +// +// Registration first for that reason. The flight is next because an airframe with no +// registration still has to be identifiable, and the address last because it is the one +// thing always available. +inline QString aircraftMapItemName(const QString& registration, const QString& flight, + quint32 icao) +{ + if (!registration.isEmpty()) { + return registration; + } + if (!flight.isEmpty()) { + return flight; + } + if (icao) { + return QString("%1").arg(icao, 6, 16, QChar('0')).toUpper(); + } + return QString(); +} + +inline QString aircraftMapLink(const QString& kind, const QString& value) +{ + const QString url = QString("sdrangel-aircraft://%1/%2").arg(kind, + QString::fromUtf8(QUrl::toPercentEncoding(value))); + return QString("<a href=\"%1\" onclick=\"return parent.infoboxLink('%1')\">%2</a>") + .arg(url, value.toHtmlEscaped()); +} + +struct AircraftReport +{ + // New protocols go on the END: the Aircraft feature keys a per-source map and a + // message rate chart on this value + enum Protocol { + ADSB, + ACARS, // Plain VHF ACARS + VDL2, + HFDL, + AERO, // Inmarsat Classic Aero (aviation SATCOM) + //!< A selective call on an HF or VHF voice channel. It identifies no aircraft on + //!< its own - see m_selcalCode - and carries no position. + SELCAL, + //!< Iridium (satcom from low earth orbit). Its own protocol rather than plain + //!< ACARS: the bearer is what the statistics, the range figures and the source + //!< column are about, and an aircraft reporting through a satellite has nothing + //!< in common with one heard directly on VHF. Added at the end so that every + //!< value already stored in a database or a preset keeps the number it had + IRIDIUM, + ProtocolCount + }; + + //!< The order to list the protocols in for the user, which is not the order they are + //!< stored in. A new protocol has to be appended to the enum so that every value + //!< already in a database or a preset keeps its meaning, but that puts it after + //!< SELCAL, which belongs at the end of a list: it is the one that names no aircraft, + //!< carries no position and is not a datalink at all. Holds every value exactly once + static const QList<int>& displayOrder() + { + static const QList<int> order = { ADSB, ACARS, VDL2, HFDL, AERO, IRIDIUM, SELCAL }; + + return order; + } + + //!< Whether reports on a protocol can carry a position. Statistics derived from one, + //!< such as the furthest aircraft heard, are meaningless for a protocol that cannot, + //!< and would show as a permanently empty entry + static bool reportsPosition(int protocol) + { + return protocol != SELCAL; + } + + enum DocumentKind { + NoDocument, + AcarsText, // A plain ACARS message + PositionReport, + OooiEvent, // Out/off/on/in event + Loadsheet, + FlightPlan, + Clearance, // Oceanic/departure clearance + Cpdlc, + Logon, // Link management: logons, logoffs + PerformanceReport, + // Appended, not placed beside Clearance where it belongs: the kind is stored in + // the database as an integer, so inserting one in the middle would reinterpret + // every document already held. + // + // Distinct from Clearance because the two behave differently: an oceanic + // clearance is drawn on the map as a clearance, while this one names the route + // the aircraft is cleared to fly from departure and is drawn as its plan. Both + // are clearances as far as the Flights table is concerned. + DepartureClearance, + // What the aircraft ASKED for, as against what it was given. Worth keeping for + // the same reason the answers are: the request names the oceanic entry point, + // level and Mach the crew wanted, and which airport they are planning to land + // at. Appended, like the two above, because the kind is stored as an integer. + ClearanceRequest, // Label B1: request oceanic clearance + AtisRequest, // Label B9: request the ATIS for an airport + // Categories worth keeping that have no decoder of their own - they are free + // text, or airline specific, so the label is all that classifies them. Appended + // like the rest because the kind is stored as an integer. + WeatherRequest, // Label 5U: which can name an alternate the crew is weighing + AirlineDownlink, // Label 5Z + AircrewMessage, // Labels 80 to 8F, addressed to or written by the crew + EmergencyMessage // Label 99 + }; + + // Source + Protocol m_protocol = ACARS; + qint64 m_frequency = 0; // Channel centre frequency in Hz, 0 if unknown + int m_deviceSetIndex = -1; + int m_channelIndex = -1; + + // Identity - whichever the frame carried + quint32 m_icao = 0; // 24 bit ICAO address, 0 if unknown + QString m_registration; + QString m_flight; // Flight number / callsign as transmitted + //!< Another name for the same flight, where a message gave one - the FMC's ICAO + //!< callsign beside the block's IATA flight number, say. Recorded as an alias rather + //!< than replacing m_flight, which would look like a different flight and start one. + QString m_flightAlias; + + // Position and kinematics + bool m_positionValid = false; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + bool m_altitudeValid = false; + float m_altitudeFt = 0.0f; + bool m_headingValid = false; + float m_heading = 0.0f; // Degrees + bool m_speedValid = false; + float m_speedKts = 0.0f; + QDateTime m_positionDateTime; // The report's own time when it differs from reception + // When the altitude was observed. On ADS-B this is often NOT the position's time: + // a Mode S altitude reply carries no position, so the two are measured separately. + // Invalid on bearers that report a single fix, where the position's time serves. + QDateTime m_altitudeDateTime; + + QDateTime m_received; + + // Set on reports emitted while an historical log is being replayed. The first + // report for each aircraft also marks the boundary between the receiver's live + // state (or an earlier replay) and this replay's independent track. + bool m_replay = false; + bool m_replayStart = false; + + // The OOOI event this report carried, if any. Out of gate, take off, landing and on + // gate are the four times that describe a flight, and they arrive as separate ACARS + // messages on labels 13 to 16. + enum OooiEventKind { OooiNone = 0, OooiOut = 13, OooiOff, OooiOn, OooiIn }; + int m_oooiEvent = OooiNone; + QDateTime m_oooiTime; //!< When the event happened, not when it was reported + + // Weather this report carried. Aircraft ask for it and the ground sends it, so it + // arrives through ACARS like everything else - but it describes an AIRPORT rather + // than the aircraft that happened to request it, which is why it is kept separately. + enum WeatherKind { + WeatherNone = 0, + Metar, //!< Observation + Taf, //!< Forecast + Atis, //!< D-ATIS + Twip, //!< Terminal weather information for pilots + Notam, + Pirep, //!< Pilot report + Sigmet, //!< Significant meteorological information, and AIRMET + WeatherOther, //!< Recognised as weather, not as any of the above + //!< An automated observation made by the aircraft itself, in flight, rather than + //!< a report about an airport - see AcarsMeteorologicalReport + AirReport + }; + int m_weatherKind = WeatherNone; + QString m_weatherAirport; //!< ICAO code the report is about, when it names one + QString m_weatherText; //!< The report itself, as sent + + // Decoded content + DocumentKind m_documentKind = NoDocument; + QString m_documentTitle; + QString m_documentText; // Full multi-line decode + QString m_label; // ACARS label or frame type + bool m_uplink = false; // true when ground to air + QString m_atc; // Concise ATC message text (e.g. "WILCO") for CPDLC + QString m_station; // Ground station / ATC facility, when known + //!< The SELCAL code called, as AB-CD, on a SELCAL report. A code is shared by + //!< several aircraft, so the demodulator sends it without an identity and the + //!< Aircraft feature decides which of them, if any, it was. + QString m_selcalCode; + + // Route facts the message revealed (OOOI events, flight plans, clearances) + QString m_departure; + QString m_arrival; + QString m_route; + // One waypoint of m_route. A route insert gives the position of most of its fixes, + // and using those beats looking the names up: it places fixes no database here + // holds, and settles which of two identically named fixes was meant. + struct RouteWaypoint { + QString m_name; + bool m_positionValid = false; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + //!< The departure or arrival procedure this fix belongs to, and which of the two + //!< it is. Empty for a fix the plan named itself, which is most of them - these + //!< are only set for fixes expanded out of a SID or STAR. + QString m_procedure; + QString m_procedureType; + //!< What the procedure requires of the aircraft at this fix, in feet. A fix can + //!< be given a floor, a ceiling, both - which is a window, or a crossing + //!< altitude when they are equal - or neither. + bool m_hasMinimumAltitude = false; + int m_minimumAltitudeFt = 0; + bool m_hasMaximumAltitude = false; + int m_maximumAltitudeFt = 0; + //!< What the aircraft's own FMS predicts for the fix, where the message carried a + //!< predicted route. Not a constraint like the two above - this is where it + //!< expects to be, and when. + bool m_hasAltitude = false; + int m_altitudeFt = 0; + bool m_hasEta = false; + QTime m_eta; + }; + // Same order and length as the space separated names in m_route, and empty when the + // route came from somewhere that names waypoints without placing them + QList<RouteWaypoint> m_routeWaypoints; + // The rest of the filed plan. A route insert carries one part of it - the departure + // end, the path, or the arrival end - so these arrive in different messages from + // each other and from m_route, and the Aircraft feature assembles one plan of them. + QString m_routeRunway; + QString m_routeSid; + QString m_routeStar; + QString m_routeApproach; + QString m_routeAlternate; + //!< What the document was rendered FROM, so that it can be rendered again by a later + //!< decoder instead of being frozen as text - see AircraftTracker::renderDocument(). + //!< m_documentRaw is the block the message's header came from and m_documentSource the + //!< text that was decoded, which for a multi block message is the assembled whole. + //!< Only set when OUR parser produced the document: libacars and the ATN decoder live + //!< in the demodulator plugin and cannot be re-run from the feature, so what they + //!< produced is kept as text. + QByteArray m_documentRaw; + QString m_documentSource; + bool m_documentDerivable = false; + //!< What an oceanic clearance clears the aircraft to fly the route AT. Nothing else + //!< fills these in - a filed plan gives its cruise level in the position report's + //!< additional data instead. + int m_routeFlightLevel = 0; //!< Hundreds of feet, 0 when not given + float m_routeMach = 0.0f; //!< 0 when not given + + // Phase 2: a fully-built map item from the ADS-B demodulator, passed through + // so its PFD state reaches the Map losslessly. Ownership transfers with the + // report; nullptr for reports that do not carry one. + SWGSDRangel::SWGMapItem *m_mapItem = nullptr; +}; + +#endif // INCLUDE_UTIL_AIRCRAFTREPORT_H diff --git a/sdrbase/util/bglwaypointreader.cpp b/sdrbase/util/bglwaypointreader.cpp new file mode 100644 index 000000000..d13f7703a --- /dev/null +++ b/sdrbase/util/bglwaypointreader.cpp @@ -0,0 +1,565 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// // +// BGL structure and identifier conversion based on atools: // +// https://github.com/albar965/atools // +// Copyright (C) 2015-2026 Alexander Barthel // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "bglwaypointreader.h" + +#include <algorithm> +#include <QCryptographicHash> +#include <QDataStream> +#include <QDir> +#include <QDirIterator> +#include <QFile> +#include <QFileInfo> +#include <QSaveFile> +#include <QStandardPaths> +#include <QTextStream> +#include <QVector> + +#include "waypoints.h" +#include "csv.h" + +namespace { + +const quint32 BGL_MAGIC_1 = 0x19920201; +const quint32 BGL_MAGIC_2 = 0x08051803; +const quint32 BGL_HEADER_SIZE = 0x38; +const quint32 BGL_SECTION_SIZE = 20; +const quint32 BGL_WAYPOINT_SECTION = 0x22; +const quint16 BGL_WAYPOINT_RECORD = 0x22; +const quint16 BGL_WAYPOINT_RECORD_MSFS_2024 = 0x108; + +struct Section +{ + quint32 m_subsectionSize; + quint32 m_subsectionCount; + quint32 m_firstSubsectionOffset; + quint32 m_totalSubsectionSize; +}; + +bool within(qint64 offset, qint64 length, qint64 limit) +{ + return (offset >= 0) && (length >= 0) && (offset <= limit) && (length <= limit - offset); +} + +QString decodeIcao(quint64 value, int characterCount, int bitShift) +{ + value >>= bitShift; + + if (value == 0) { + return QString(); + } + + quint64 codes[8] = {}; + int codeCount = 0; + + if (value > 37) + { + while ((value > 37) && (codeCount < characterCount)) + { + const quint64 code = value % 38; + codes[codeCount++] = code; + value = (value - code) / 38; + + if ((value < 38) && (codeCount < characterCount)) { + codes[codeCount++] = value; + } + } + } + else + { + codes[codeCount++] = value; + } + + QString ident; + + for (int i = 0; i < codeCount; i++) + { + const quint64 code = codes[i]; + + if (code == 0) { + break; + } else if ((code > 1) && (code < 12)) { + ident.prepend(QChar('0' + static_cast<char>(code - 2))); + } else if ((code >= 12) && (code < 38)) { + ident.prepend(QChar('A' + static_cast<char>(code - 12))); + } else { + return QString(); + } + } + + return ident; +} + +double decodeLongitude(qint32 value) +{ + return value * (360.0 / (3.0 * 0x10000000)) - 180.0; +} + +double decodeLatitude(qint32 value) +{ + return 90.0 - value * (180.0 / (2.0 * 0x10000000)); +} + +void addError(QStringList *errors, const QString& filename, const QString& message) +{ + if (errors) { + errors->append(QStringLiteral("%1: %2").arg(filename, message)); + } +} + +QString sourcePath(const QFileInfo& source) +{ + const QString canonicalPath = source.canonicalFilePath(); + return QDir::cleanPath(canonicalPath.isEmpty() ? source.absoluteFilePath() : canonicalPath); +} + +QList<QFileInfo> sourceFiles(const QFileInfo& source) +{ + QList<QFileInfo> files; + + if (source.isFile()) + { + files.append(source); + } + else if (source.isDir()) + { + QDirIterator iterator( + source.absoluteFilePath(), + QStringList() << QStringLiteral("*.bgl") << QStringLiteral("*.BGL"), + QDir::Files, + QDirIterator::Subdirectories); + while (iterator.hasNext()) { + files.append(QFileInfo(iterator.next())); + } + } + + std::sort(files.begin(), files.end(), [](const QFileInfo& a, const QFileInfo& b) { + return a.absoluteFilePath() < b.absoluteFilePath(); + }); + return files; +} + +QByteArray sourceFingerprint(const QList<QFileInfo>& files, const QString& rootPath) +{ + QCryptographicHash hash(QCryptographicHash::Sha256); + + for (const QFileInfo& file : files) + { + QString filename = file.absoluteFilePath(); + if (filename.startsWith(rootPath)) { + filename = filename.mid(rootPath.size()); + } + hash.addData(filename.toUtf8()); + hash.addData("\0", 1); + hash.addData(QByteArray::number(file.size())); + hash.addData("\0", 1); + hash.addData(QByteArray::number(file.lastModified().toMSecsSinceEpoch())); + hash.addData("\0", 1); + } + + return hash.result().toHex(); +} + +QString cacheFilename(const QString& rootPath) +{ + const QByteArray pathHash = QCryptographicHash::hash( + rootPath.toUtf8(), QCryptographicHash::Sha256).toHex().left(16); + const QString appDataDirectory = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); + if (appDataDirectory.isEmpty()) { + return QString(); + } + const QString cacheDirectory = appDataDirectory + QStringLiteral("/cache"); + QDir().mkpath(cacheDirectory); + return QDir(cacheDirectory).filePath( + QStringLiteral("navigraph-waypoints-%1.csv").arg(QString::fromLatin1(pathHash))); +} + +QMultiHash<QString, Waypoint *> *readCache( + const QString& filename, + const QByteArray& fingerprint) +{ + QFile file(filename); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + return nullptr; + } + + const QList<QByteArray> header = file.readLine().trimmed().split(','); + file.close(); + if ((header.size() != 3) + || (header[0] != QByteArrayLiteral("# SDRangel Navigraph waypoint cache v1")) + || (header[1] != fingerprint)) + { + return nullptr; + } + + bool countOk; + const int expectedCount = header[2].toInt(&countOk); + if (!countOk || (expectedCount <= 0)) { + return nullptr; + } + + QMultiHash<QString, Waypoint *> *waypoints = Waypoint::readCSV(filename); + if (waypoints->size() == expectedCount) { + return waypoints; + } + + qDeleteAll(*waypoints); + delete waypoints; + return nullptr; +} + +bool writeCache( + const QString& filename, + const QByteArray& fingerprint, + const QMultiHash<QString, Waypoint *>& waypoints) +{ + QSaveFile file(filename); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + return false; + } + + QTextStream out(&file); + out << "# SDRangel Navigraph waypoint cache v1," << fingerprint << ',' << waypoints.size() << '\n'; + for (auto i = waypoints.constBegin(); i != waypoints.constEnd(); ++i) + { + const Waypoint *waypoint = i.value(); + out << CSV::escape(waypoint->m_name) << ',' + << QString::number(waypoint->m_latitude, 'g', 9) << ',' + << QString::number(waypoint->m_longitude, 'g', 9) << '\n'; + } + out.flush(); + + return (out.status() == QTextStream::Ok) && file.commit(); +} + +bool readWaypointRecord( + QDataStream& stream, + QFile& file, + qint64 recordOffset, + qint64 subsectionEnd, + QMultiHash<QString, Waypoint *>& waypoints, + QString *error) +{ + if (!within(recordOffset, 6, subsectionEnd)) + { + *error = QStringLiteral("truncated waypoint record header at offset 0x%1").arg(recordOffset, 0, 16); + return false; + } + + if (!file.seek(recordOffset)) + { + *error = QStringLiteral("could not seek to waypoint record at offset 0x%1").arg(recordOffset, 0, 16); + return false; + } + + quint16 recordType; + quint32 recordSize; + stream >> recordType >> recordSize; + + if (stream.status() != QDataStream::Ok) + { + *error = QStringLiteral("could not read waypoint record header at offset 0x%1").arg(recordOffset, 0, 16); + return false; + } + + if ((recordSize < 6) || !within(recordOffset, recordSize, subsectionEnd)) + { + *error = QStringLiteral("invalid waypoint record size %1 at offset 0x%2").arg(recordSize).arg(recordOffset, 0, 16); + return false; + } + + const bool msfs2024 = recordType == BGL_WAYPOINT_RECORD_MSFS_2024; + + if ((recordType != BGL_WAYPOINT_RECORD) && !msfs2024) { + return true; + } + + const quint32 minimumSize = msfs2024 ? 36 : 28; + + if (recordSize < minimumSize) + { + *error = QStringLiteral("waypoint record 0x%1 is too short (%2 bytes) at offset 0x%3") + .arg(recordType, 0, 16).arg(recordSize).arg(recordOffset, 0, 16); + return false; + } + + quint8 waypointType; + quint8 airwayCount; + qint32 longitudeValue; + qint32 latitudeValue; + float magneticVariation; + quint64 encodedIdent; + + stream >> waypointType >> airwayCount >> longitudeValue >> latitudeValue >> magneticVariation; + + if (msfs2024) + { + stream >> encodedIdent; + } + else + { + quint32 shortIdent; + stream >> shortIdent; + encodedIdent = shortIdent; + } + + // The remaining fixed fields contain region/airport flags and, for the + // MSFS 2024 record, four currently unknown bytes. Airway data follows. + quint32 regionFlags; + stream >> regionFlags; + + if (msfs2024) + { + quint32 unknown; + stream >> unknown; + } + + Q_UNUSED(waypointType) + Q_UNUSED(airwayCount) + Q_UNUSED(magneticVariation) + Q_UNUSED(regionFlags) + + if (stream.status() != QDataStream::Ok) + { + *error = QStringLiteral("could not read waypoint record at offset 0x%1").arg(recordOffset, 0, 16); + return false; + } + + const QString ident = decodeIcao(encodedIdent, msfs2024 ? 8 : 5, msfs2024 ? 6 : 5); + const double latitude = decodeLatitude(latitudeValue); + const double longitude = decodeLongitude(longitudeValue); + + // Unnamed records cannot be looked up by Waypoints. Reject malformed + // coordinates while retaining valid polar waypoints such as NPOLE. + if (!ident.isEmpty() + && (latitude >= -90.0) && (latitude <= 90.0) + && (longitude >= -180.0) && (longitude <= 180.0)) + { + Waypoint *waypoint = new Waypoint(); + waypoint->m_name = ident; + waypoint->m_latitude = static_cast<float>(latitude); + waypoint->m_longitude = static_cast<float>(longitude); + waypoints.insert(ident, waypoint); + } + + return true; +} + +bool readFile(const QString& filename, QMultiHash<QString, Waypoint *>& waypoints, QString *error) +{ + QFile file(filename); + + if (!file.open(QIODevice::ReadOnly)) + { + *error = QStringLiteral("could not open file"); + return false; + } + + const qint64 fileSize = file.size(); + + if (fileSize < BGL_HEADER_SIZE) + { + *error = QStringLiteral("file is too small to contain a BGL header"); + return false; + } + + QDataStream stream(&file); + stream.setByteOrder(QDataStream::LittleEndian); + stream.setFloatingPointPrecision(QDataStream::SinglePrecision); + + quint32 magic1; + quint32 headerSize; + quint32 lowDateTime; + quint32 highDateTime; + quint32 magic2; + quint32 sectionCount; + stream >> magic1 >> headerSize >> lowDateTime >> highDateTime >> magic2 >> sectionCount; + Q_UNUSED(lowDateTime) + Q_UNUSED(highDateTime) + + if ((stream.status() != QDataStream::Ok) || (magic1 != BGL_MAGIC_1) || (magic2 != BGL_MAGIC_2)) + { + *error = QStringLiteral("not a supported section-based BGL file"); + return false; + } + + if ((headerSize < BGL_HEADER_SIZE) || !within(headerSize, static_cast<qint64>(sectionCount) * BGL_SECTION_SIZE, fileSize)) + { + *error = QStringLiteral("invalid BGL header or section count"); + return false; + } + + if (!file.seek(headerSize)) + { + *error = QStringLiteral("could not seek to BGL section table"); + return false; + } + + QVector<Section> waypointSections; + + for (quint32 i = 0; i < sectionCount; i++) + { + quint32 type; + quint32 sizeFlag; + quint32 subsectionCount; + quint32 firstSubsectionOffset; + quint32 totalSubsectionSize; + stream >> type >> sizeFlag >> subsectionCount >> firstSubsectionOffset >> totalSubsectionSize; + + if (stream.status() != QDataStream::Ok) + { + *error = QStringLiteral("could not read BGL section table"); + return false; + } + + if (type == BGL_WAYPOINT_SECTION) + { + Section section; + section.m_subsectionSize = ((sizeFlag & 0x10000) | 0x40000) >> 14; + section.m_subsectionCount = subsectionCount; + section.m_firstSubsectionOffset = firstSubsectionOffset; + section.m_totalSubsectionSize = totalSubsectionSize; + waypointSections.append(section); + } + } + + for (const Section& section : waypointSections) + { + if ((section.m_subsectionSize < 16) + || !within(section.m_firstSubsectionOffset, section.m_totalSubsectionSize, fileSize) + || (static_cast<quint64>(section.m_subsectionSize) * section.m_subsectionCount > section.m_totalSubsectionSize)) + { + *error = QStringLiteral("invalid waypoint subsection table"); + return false; + } + + for (quint32 i = 0; i < section.m_subsectionCount; i++) + { + const qint64 subsectionOffset = section.m_firstSubsectionOffset + static_cast<qint64>(i) * section.m_subsectionSize; + + if (!within(subsectionOffset, 16, fileSize) || !file.seek(subsectionOffset)) + { + *error = QStringLiteral("invalid waypoint subsection entry at offset 0x%1").arg(subsectionOffset, 0, 16); + return false; + } + + qint32 subsectionId; + qint32 recordCount; + qint32 firstRecordOffset; + qint32 dataSize; + stream >> subsectionId >> recordCount >> firstRecordOffset >> dataSize; + Q_UNUSED(subsectionId) + + if ((stream.status() != QDataStream::Ok) + || (recordCount < 0) || (firstRecordOffset < 0) || (dataSize < 0) + || !within(firstRecordOffset, dataSize, fileSize)) + { + *error = QStringLiteral("invalid waypoint subsection entry at offset 0x%1").arg(subsectionOffset, 0, 16); + return false; + } + + const qint64 subsectionEnd = static_cast<qint64>(firstRecordOffset) + dataSize; + qint64 recordOffset = firstRecordOffset; + + for (qint32 recordIndex = 0; recordIndex < recordCount; recordIndex++) + { + if (!readWaypointRecord(stream, file, recordOffset, subsectionEnd, waypoints, error)) { + return false; + } + + if (!file.seek(recordOffset + 2)) + { + *error = QStringLiteral("could not seek within waypoint record at offset 0x%1").arg(recordOffset, 0, 16); + return false; + } + + quint32 recordSize; + stream >> recordSize; + + if ((stream.status() != QDataStream::Ok) || (recordSize < 6)) + { + *error = QStringLiteral("invalid waypoint record at offset 0x%1").arg(recordOffset, 0, 16); + return false; + } + + recordOffset += recordSize; + } + } + } + + return true; +} + +} + +QMultiHash<QString, Waypoint *> *BGLWaypointReader::read(const QString& path, QStringList *errors) +{ + QMultiHash<QString, Waypoint *> *waypoints = new QMultiHash<QString, Waypoint *>(); + const QFileInfo fileInfo(path); + + if (!fileInfo.isFile() && !fileInfo.isDir()) + { + addError(errors, path, QStringLiteral("path does not exist")); + return waypoints; + } + + const QString rootPath = sourcePath(fileInfo); + const QList<QFileInfo> files = sourceFiles(fileInfo); + if (files.isEmpty()) { + return waypoints; + } + + const QByteArray fingerprint = sourceFingerprint(files, rootPath); + const QString cache = cacheFilename(rootPath); + QMultiHash<QString, Waypoint *> *cachedWaypoints = cache.isEmpty() + ? nullptr : readCache(cache, fingerprint); + if (cachedWaypoints) + { + delete waypoints; + qDebug() << "BGLWaypointReader::read: Read" << cachedWaypoints->size() + << "waypoints from cache" << cache; + return cachedWaypoints; + } + + bool readError = false; + for (const QFileInfo& file : files) + { + QString error; + + if (!readFile(file.absoluteFilePath(), *waypoints, &error)) + { + addError(errors, file.absoluteFilePath(), error); + readError = true; + } + } + + if (!cache.isEmpty() && !waypoints->isEmpty() && !readError) + { + if (writeCache(cache, fingerprint, *waypoints)) { + qDebug() << "BGLWaypointReader::read: Cached" << waypoints->size() + << "waypoints in" << cache; + } else { + qWarning() << "BGLWaypointReader::read: Could not write waypoint cache" << cache; + } + } + + return waypoints; +} diff --git a/sdrbase/util/bglwaypointreader.h b/sdrbase/util/bglwaypointreader.h new file mode 100644 index 000000000..87793bf2e --- /dev/null +++ b/sdrbase/util/bglwaypointreader.h @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_BGLWAYPOINTREADER_H +#define INCLUDE_BGLWAYPOINTREADER_H + +#include <QMultiHash> +#include <QString> +#include <QStringList> + +#include "export.h" + +struct Waypoint; + +// Reads FSX/P3D/MSFS waypoint sections from either one BGL file or all BGL +// files below a directory. Successful reads are cached as CSV in the application +// data cache and invalidated when any source filename, size or modification date +// changes. The caller owns the returned hash and waypoints. +class SDRBASE_API BGLWaypointReader +{ +public: + static QMultiHash<QString, Waypoint *> *read(const QString& path, QStringList *errors = nullptr); +}; + +#endif // INCLUDE_BGLWAYPOINTREADER_H diff --git a/plugins/channelrx/demodacars/do219.h b/sdrbase/util/do219.h similarity index 95% rename from plugins/channelrx/demodacars/do219.h rename to sdrbase/util/do219.h index 22904191b..b32f11c33 100644 --- a/plugins/channelrx/demodacars/do219.h +++ b/sdrbase/util/do219.h @@ -1,2188 +1,2204 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Jon Beniston, M7RCE // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see <http://www.gnu.org/licenses/>. // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDE_DO219_H -#define INCLUDE_DO219_H - -// RCTA DO-219 / CPDLC decoder -class DO219Decoder { - QByteArray m_bytes; - int m_byteIndex; - int m_bitIndex; - bool m_cpdlc; -public: - QString m_msgIdentificationNumber; - QString m_msgReferenceNumber; - QTime m_timeStamp; - - DO219Decoder() : - m_byteIndex(0), - m_bitIndex(0), - m_cpdlc(true) - { - } - - QString decode(const QString &msg, bool uplink) - { - if (msg.isEmpty()) { - return ""; - } - m_bytes = QByteArray::fromHex(msg.toLatin1()); - if (uplink) { - return decodeATCUplinkMessage(); - } else { - return decodeATCDownlinkMessage(); - } - } - -protected: - int getBit() - { - if (m_byteIndex >= m_bytes.size()) { - qDebug() << "DO219Decoder::getBit: Attempt to read beyond end of data"; - } - int bit = (m_bytes[m_byteIndex] >> (7 - m_bitIndex)) & 1; - m_bitIndex++; - if (m_bitIndex == 8) - { - m_bitIndex = 0; - m_byteIndex++; - } - return bit; - } - - int getBits(int numberOfBits) - { - int bits = 0; - for (int i = 0; i < numberOfBits; i++) - { - bits <<= 1; - bits |= getBit(); - } - return bits; - } - - QString decodeATCDownlinkMessage() - { - bool flag = getBits(1); - - QString s; - decodeATCMessageHeader(); - s.append(decodeATCDownlinkMsgElementId()); - if (flag) - { - int size = getBits(2) + 1; - for (int i = 0; i < size; i++) { - s.append("\n" + decodeATCDownlinkMsgElementId()); - } - } - return s; - } - QString decodeATCUplinkMessage() - { - bool flag = getBits(1); - QString s; - decodeATCMessageHeader(); - s.append(decodeATCUplinkMsgElementId()); - if (flag) - { - int size = getBits(2) + 1; - for (int i = 0; i < size; i++) { - s.append("\n" + decodeATCUplinkMsgElementId()); - } - } - return s; - } - - void decodeATCMessageHeader() - { - bool flag = getBits(1); - bool flag1 = false; - if (m_cpdlc) { - flag1 = getBits(1); - } - m_msgIdentificationNumber = decodeMsgIdentificationNumber(); - if (flag) { - m_msgReferenceNumber = decodeMsgReferenceNumber(); - } - if (flag1) { - m_timeStamp = QTime::fromString(decodeTimeHHMMSS()); - } - } - - QString decodeTimeHHMMSS() - { - QString hours = decodeTimeHours(); - QString minutes = decodeTimeMinutes(); - QString seconds = decodeTimeSeconds(); - return hours + ":" + minutes + ":" + seconds; - } - - QString decodeMsgIdentificationNumber() - { - int num = getBits(6); - return QString::number(num); - } - - QString decodeMsgReferenceNumber() - { - int num = getBits(6); - return QString::number(num); - } - - QString decodeATCUplinkMsgElementId() - { - int id = getBits(8); - switch (id) - { - case 0: - return "UNABLE"; - case 1: - return "STANDBY"; - case 2: - return "REQUEST DEFERRED"; - case 3: - return "ROGER"; - case 4: - return "AFFIRM"; - case 5: - return "NEGATIVE"; - case 6: - return "EXPECT " + decodeAltitude(); - case 7: - return "EXPECT CLIMB AT " + decodeTime(); - case 8: - return "EXPECT CLIMB AT " + decodePosition(); - case 9: - return "EXPECT DESCENT AT " + decodeTime(); - case 10: - return "EXPECT DESCENT AT " + decodePosition(); - case 11: - return "EXPECT CRUISE CLIMB AT " + decodeTime(); - case 12: - return "EXPECT CRUISE CLIMB AT " + decodePosition(); - case 13: - { - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "AT " + time + " EXPECT CLIMB TO " + altitude; - } - case 14: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + position + " EXPECT CLIMB TO " + altitude; - } - case 15: - { - return "AT " + decodeTime() + " EXPECT DESCENT TO " + decodeAltitude(); - } - case 16: - { - return "AT " + decodePosition() + " EXPECT DESCENT TO " + decodeAltitude(); - } - case 17: - { - return "AT " + decodeTime() + " EXPECT CRUISE CLIMB TO " + decodeAltitude(); - } - case 18: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + position + " EXPECT CRUISE CLIMB TO " + altitude; - } - case 19: - return "MAINTAIN " + decodeAltitude(); - case 20: - return "CLIMB AND MAINTAIN " + decodeAltitude(); - case 21: - { - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "AT " + time + " CLIMB AND MAINTAIN " + altitude; - } - case 22: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + position + " CLIMB AND MAINTAIN " + altitude; - } - case 23: - return "DESCEND AND MAINTAIN " + decodeAltitude(); - case 24: - { - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "AT " + time + " DESCEND AND MAINTAIN " + decodeAltitude(); - } - case 25: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + position + " DESCEND AND MAINTAIN " + altitude; - } - case 26: - { - QString altitude = decodeAltitude(); - QString time = decodeTime(); - return "CLIMB TO REACH " + altitude + " BY " + time; - } - case 27: - { - QString altitude = decodeAltitude(); - QString position = decodePosition(); - return "CLIMB TO REACH " + altitude + " BY " + position; - } - case 28: - { - QString altiutude = decodeAltitude(); - QString time = decodeTime(); - return "DESCEND TO REACH " + altiutude + " BY " + time; - } - case 29: - { - QString altiutude = decodeAltitude(); - QString position = decodePosition(); - return "DESCEND TO REACH " + decodeAltitude() + " BY " + decodePosition(); - } - case 30: - { - QString altiutude1 = decodeAltitude(); - QString altiutude2 = decodeAltitude(); - return "MAINTAIN BLOCK " + altiutude1 + " TO " + altiutude2; - } - case 31: - { - QString altiutude1 = decodeAltitude(); - QString altiutude2 = decodeAltitude(); - return "CLIMB TO MAINTAIN BLOCK " + altiutude2 + " TO " + altiutude2; - } - case 32: - { - QString altiutude1 = decodeAltitude(); - QString altiutude2 = decodeAltitude(); - return "DESCEND TO MAINTAIN BLOCK " + altiutude1 + " TO " + altiutude2; - } - case 33: - return "CRUISE " + decodeAltitude(); - case 34: - return "CRUISE CLIMB TO " + decodeAltitude(); - case 35: - return "CRUISE CLIMB ABOVE " + decodeAltitude(); - case 36: - return "EXPEDITE CLIMB TO " + decodeAltitude(); - case 37: - return "EXPEDITE CLIMB ABOVE " + decodeAltitude(); - case 38: - return "IMMEDIATELY CLIMB TO " + decodeAltitude(); - case 39: - return "IMMEDIATELY DESCEND TO " + decodeAltitude(); - case 40: - return "IMMEDIATELY STOP CLIMB AT " + decodeAltitude(); - case 41: - return "IMMEDIATELY STOP DESCENT AT " + decodeAltitude(); - case 42: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "EXPECT TO CROSS " + position + " AT " + altitude; - } - case 43: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "EXPECT TO CROSS " + position + " AT OR ABOVE " + altitude; - } - case 44: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "EXPECT TO CROSS " + position + " AT OR BELOW " + altitude; - } - case 45: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "EXPECT TO CROSS " + position + " AT AND MAINTAIN " + altitude; - } - case 46: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT " + altitude; - } - case 47: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT OR ABOVE " + altitude; - } - case 48: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT OR BELOW " + altitude; - } - case 49: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT AND MAINTAIN " + altitude; - } - case 50: - { - QString position = decodePosition(); - QString altitude1 = decodeAltitude(); - QString altitude2 = decodeAltitude(); - return "CROSS " + position + " BETWEEN " + altitude1 + " AND " + altitude2; - } - case 51: - { - QString position = decodePosition(); - QString time = decodeTime(); - return "CROSS " + position + " AT " + time; - } - case 52: - { - QString position = decodePosition(); - QString time = decodeTime(); - return "CROSS " + position + " AT OR BEFORE " + time; - } - case 53: - { - QString position = decodePosition(); - QString time = decodeTime(); - return "CROSS " + position + " AT OR AFTER " + time; - } - case 54: - { - QString position = decodePosition(); - QString time1 = decodeTime(); - QString time2 = decodeTime(); - return "CROSS " + position + " BETWEEN " + time1 + " AND " + time2; - } - case 55: - { - QString position = decodePosition(); - QString speed = decodeSpeed(); - return "CROSS " + position + " AT " + speed; - } - case 56: - { - QString position = decodePosition(); - QString speed = decodeSpeed(); - return "CROSS " + position + " AT OR LESS THAN " + speed; - } - case 57: - { - QString position = decodePosition(); - QString speed = decodeSpeed(); - return "CROSS " + position + " AT OR GREATER THAN " + speed; - } - case 58: - { - QString position = decodePosition(); - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT " + time + " AT " + altitude; - } - case 59: - { - QString position = decodePosition(); - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT OR BEOFRE " + time + " AT " + altitude; - } - case 60: - { - QString position = decodePosition(); - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "CROSS " + position + " AT OR AFTER " + time + " AT " + altitude; - } - case 61: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - QString speed = decodeSpeed(); - return "CROSS " + position + " AT AND MAINTAIN " + altitude + " AT " + speed; - } - case 62: - { - QString time = decodeTime(); - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + time + " CROSS " + position + " AT AND MAINTAIN " + altitude; - } - case 63: - { - QString time = decodeTime(); - QString position = decodePosition(); - QString altitude = decodeAltitude(); - QString speed = decodeSpeed(); - return "AT " + time + " CROSS " + position + " AT AND MAINTAIN " + altitude + " AT " + speed; - } - case 64: - { - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 65: - { - QString position = decodePosition(); - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "AT " + position + " OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 66: - { - QString time = decodeTime(); - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "AT " + time + " OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 67: - return "PROCEED BACK ON ROUTE"; - case 68: - return "REJOIN ROUTE BY " + decodePosition(); - case 69: - return "REJOIN ROUTE BY " + decodeTime(); - case 70: - return "EXPECT BACK ON ROUTE BY " + decodePosition(); - case 71: - return "EXPECT BACK ON ROUTE BY " + decodeTime(); - case 72: - return "RESUME OWN NAVIGATION"; - case 73: - return decodePredepartureClearance(); - case 74: - return "PROCEED DIRECT TO " + decodePosition(); - case 75: - return "WHEN ABLE PROCEED DIRECT TO " + decodePosition(); - case 76: - { - QString time = decodeTime(); - QString position = decodePosition(); - return "AT " + time + " PROCEED DIRECT TO " + position; - } - case 77: - { - QString position1 = decodePosition(); - QString position2 = decodePosition(); - return "AT " + position1 + " PROCEED DIRECT TO " + position2; - } - case 78: - { - QString altitude = decodeAltitude(); - QString position = decodePosition(); - return "AT " + altitude + " PROCEED DIRECT TO " + position; - } - case 79: - { - QString position = decodePosition(); - QString routeClearance = decodeRouteClearance(); - return "CLEARED TO " + position + " VIA " + routeClearance; - } - case 80: - return "CLEARED " + decodeRouteClearance(); - case 81: - return "CLEARED " + decodeProcedureName(); - case 82: - { - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "CLEARD TO DEVIATE UP TO " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 83: - { - QString position = decodePosition(); - QString routeClearance = decodeRouteClearance(); - return "AT " + position + " CLEARED " + routeClearance; - } - case 84: - { - QString position = decodePosition(); - QString procedureName = decodeProcedureName(); - return "AT " + position + " CLEARED " + procedureName; - } - case 85: - return "EXPECT " + decodeRouteClearance(); - case 86: - { - QString position = decodePosition(); - QString routeClearance = decodeRouteClearance(); - return "AT " + position + " EXPECT " + routeClearance; - } - case 87: - return "EXPECT DIRECT TO " + decodePosition(); - case 88: - { - QString position1 = decodePosition(); - QString position2 = decodePosition(); - return "AT " + position1 + " EXPECT DIRECT TO " + position2; - } - case 89: - { - QString time = decodeTime(); - QString position = decodePosition(); - return "AT " + time + " EXPECT DIRECT TO " + position; - } - case 90: - { - QString altitude = decodeAltitude(); - QString position = decodePosition(); - return "AT " + altitude + " EXPECT DIRECT TO " + position; - } - case 91: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "HOLD AT " + position + " MAINTAIN " + altitude + " INBOUND TRACK"; - } - case 92: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "HOLD AT " + position + " AS PUBLISHED MAINTAIN " + altitude; - } - case 93: - return "EXPECT FURTHER CLEARANCE AT " + decodeTime(); - case 94: - { - QString direction = decodeDirection(); - QString degrees = decodeDegrees(); - return "TURN " + direction + " HEADING " + degrees; - } - case 95: - { - QString direction = decodeDirection(); - QString degrees = decodeDegrees(); - return "TURN " + direction + " GROUND TRACK " + degrees; - } - case 96: - return "FLY PRESENT HEADING"; - case 97: - { - QString position = decodePosition(); - QString degrees = decodeDegrees(); - return "AT " + position + " FLY HEADING " + degrees; - } - case 98: - { - QString direction = decodeDirection(); - QString degrees = decodeDegrees(); - return "IMMEDIATELY TURN " + direction + " HEADING " + degrees; - } - case 99: - return "EXPECT " + decodeProcedureName(); - case 100: - { - QString time = decodeTime(); - QString speed = decodeSpeed(); - return "AT " + time + " EXPECT " + speed; - } - case 101: - { - QString position = decodePosition(); - QString speed = decodeSpeed(); - return "AT " + position + " EXPECT " + speed; - } - case 102: - { - QString altitude = decodeAltitude(); - QString speed = decodeSpeed(); - return "AT " + altitude + " EXPECT " + speed; - } - case 103: - { - QString time = decodeTime(); - QString speed1 = decodeSpeed(); - QString speed2 = decodeSpeed(); - return "AT " + time + " EXPECT " + speed1 + " TO " + speed2; - } - case 104: - { - QString position = decodePosition(); - QString speed1 = decodeSpeed(); - QString speed2 = decodeSpeed(); - return "AT " + position + " EXPECT " + speed1 + " TO " + speed2; - } - case 105: - { - QString altitude = decodeAltitude(); - QString speed1 = decodeSpeed(); - QString speed2 = decodeSpeed(); - return "AT " + altitude + " EXPECT " + speed1 + " TO " + speed2; - } - case 106: - return "MAINTAIN " + decodeSpeed(); - case 107: - return "MAINTAIN PRESENT SPEED"; - case 108: - return "MAINTAIN " + decodeSpeed() + " OR GREATER"; - case 109: - return "MAINTAIN " + decodeSpeed() + " OR LESS"; - case 110: - { - QString speed1 = decodeSpeed(); - QString speed2 = decodeSpeed(); - return "MAINTAIN " + speed1 + " THROUGH " + speed2; - } - case 111: - return "INCREASE SPEED TO " + decodeSpeed(); - case 112: - return "INCREASE SPEED TO " + decodeSpeed() + " OR GREATER"; - case 113: - return "REDUCE SPEED TO " + decodeSpeed(); - case 114: - return "REDUCE SPEED TO " + decodeSpeed() + " OR LESS"; - case 115: - return "DO NOT EXCEED " + decodeSpeed(); - case 116: - return "RESUME NORMAL SPEED"; - case 117: - { - QString icaoUnitName = decodeICAOUnitName(); - QString frequency = decodeFrequency(); - return "CONTACT " + icaoUnitName + " " + frequency; - } - case 118: - { - QString position = decodePosition(); - QString icaoUnitName = decodeICAOUnitName(); - QString frequency = decodeFrequency(); - return "AT " + position + " CONTACT " + icaoUnitName + " " + decodeFrequency(); - } - case 119: - { - QString time = decodeTime(); - QString icaoUnitName = decodeICAOUnitName(); - QString frequency = decodeFrequency(); - return "AT " + time + " CONTACT " + icaoUnitName + " " + frequency; - } - case 120: - { - QString icaoUnitName = decodeICAOUnitName(); - QString frequency = decodeFrequency(); - return "MONITOR " + icaoUnitName + " " + frequency; - } - case 121: - { - QString position = decodePosition(); - QString icaoUnitName = decodeICAOUnitName(); - QString frequency = decodeFrequency(); - return "AT " + position + " MONITOR " + icaoUnitName + " " + frequency; - } - case 122: - { - QString time = decodeTime(); - QString icaoUnitName = decodeICAOUnitName(); - QString frequency = decodeFrequency(); - return "AT " + time + " MONITOR " + icaoUnitName + " " + frequency; - } - case 123: - return "SQUAWK " + decodeBeaconCode(); - case 124: - return "STOP SQUAWK"; - case 125: - return "SQUAWK ALTITUDE"; - case 126: - return "STOP ALTITUDE SQUAWK"; - case 127: - return "REPORT BACK ON ROUTE"; - case 128: - return "REPORT LEAVING " + decodeAltitude(); - case 129: - return "REPORT LEVEL " + decodeAltitude(); - case 130: - return "REPORT PASSING " + decodeAltitude(); - case 131: - return "REPORT REAMINING FUEL AND SOULS ON BOARD"; - case 132: - return "CONFIRM POSITION"; - case 133: - return "CONFIRM ALTITUDE"; - case 134: - return "CONFIRM SPEED"; - case 135: - return "CONFIRM ASSIGNED ALTITUDE"; - case 136: - return "CONFIRM ASSIGNED SPEED"; - case 137: - return "CONFIRM ASSIGNED ROUTE"; - case 138: - return "CONFIRM TIME OVER REPORTED WAYPOINT"; - case 139: - return "CONFIRM REPORTED WAYPOINT"; - case 140: - return "CONFIRM NEXT WAYPOINT"; - case 141: - return "CONFIRM NEXT WAYPOINT ETA"; - case 142: - return "CONFIRM ENSUING WAYPOINT"; - case 143: - return "CONFIRM REQUEST"; - case 144: - return "CONFIRM SQUAWK"; - case 145: - return "CONFIRM HEADING"; - case 146: - return "CONFIRM GROUND TRACK"; - case 147: - return "REQUEST POSITION REPORT"; - case 148: - return "WHEN CAN YOU ACCEPT " + decodeAltitude(); - case 149: - { - QString altitude = decodeAltitude(); - QString position = decodePosition(); - return "CAN YOU ACCEPT " + altitude + " AT " + position; - } - case 150: - { - QString altitude = decodeAltitude(); - QString time = decodeTime(); - return "CAN YOU ACCEPT " + altitude + " AT " + time; - } - case 151: - return "WHEN CAN YOU ACCEPT " + decodeSpeed(); - case 152: - { - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "WHEN CAN YOU ACCEPT " + distanceOffset + " " + direction + " OFFSET"; - } - case 153: - return "ALTIMETER " + decodeAltimeter(); - case 154: - return "RADAR SERVICES TERMINATED"; - case 155: - return "RADAR CONTACT " + decodePosition(); - case 156: - return "RADAR CONTACT LOST"; - case 157: - return "CHECK STUCK MICROPHONE " + decodeFrequency(); - case 158: - return "ATIS " + decodeATISCode(); - case 159: - return "ERROR " + decodeErrorInformation(); - case 160: - return "NEXT DATA AUTHORITY " + decodeICAOFacilityDesignation(); - case 161: - return "END SERVICE"; - case 162: - return "SERVICE UNAVAILABLE"; - case 163: - { - QString icaoFacilityDesignation = decodeICAOFacilityDesignation(); - QString tp4Table = decodeTp4Table(); - return icaoFacilityDesignation + " " + tp4Table; - } - case 164: - return "WHEN READY"; - case 165: - return "THEN"; - case 166: - return "DUE TO TRAFFIC"; - case 167: - return "DUE TO AIRSPACE RESTRICTION"; - case 168: - return "DISREGARD"; - case 169: - return decodeFreeText(); - case 170: - return decodeFreeText(); - case 171: - return "CLIMB AT " + decodeVerticalRate() + " MINIMUM"; - case 172: - return "CLIMB AT " + decodeVerticalRate() + " MAXIMUM"; - case 173: - return "DESCEND AT " + decodeVerticalRate() + " MINIMUM"; - case 174: - return "DESCEND AT " + decodeVerticalRate() + " MAXIMUM"; - case 175: - return "REPORT REACHING " + decodeAltitude(); - case 176: - return "MAINTAIN OWN SEPERATION AND VMC"; - case 177: - return "AT PILOTS DISCRETION"; - case 178: - return decodeTrackDetailMsg(); - case 179: - return "SQUAWK IDENT"; - case 180: - { - QString altitude1 = decodeAltitude(); - QString altitude2 = decodeAltitude(); - return "REPORT REACHING BLOCK " + altitude1 + " TO " + altitude2; - } - case 181: - { - QString toFrom = decodeToFrom(); - QString position = decodePosition(); - return "REPORT DISTANCE " + toFrom + " " + position; - } - case 182: - return "CONFIRM ATIS CODE"; - default: - return "UNKNOWN ATCUplinkMsgElementId: " + QString::number(id); - } - } - - QString decodeATCDownlinkMsgElementId() - { - int id = getBits(8); - switch (id) - { - case 0: - return "WILCO"; - case 1: - return "UNABLE"; - case 2: - return "STANDBY"; - case 3: - return "ROGER"; - case 4: - return "AFFIRM"; - case 5: - return "NEGATIVE"; - case 6: - return "REQUEST " + decodeAltitude(); - case 7: - { - QString altitude1 = decodeAltitude(); - QString altitude2 = decodeAltitude(); - return "REQUEST BLOCK " + altitude1 + " TO " + altitude2; - } - case 8: - return "REQUEST CRUISE CLIMB TO " + decodeAltitude(); - case 9: - return "REQUEST CLIMB TO " + decodeAltitude(); - case 10: - return "REQUEST DESCENT TO " + decodeAltitude(); - case 11: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + position + " REQUEST CLIMB TO " + altitude; - } - case 12: - { - QString position = decodePosition(); - QString altitude = decodeAltitude(); - return "AT " + position + " REQUEST DESCENT TO " + altitude; - } - case 13: - { - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "AT " + time + " REQUEST CLIMB TO " + altitude; - } - case 14: - { - QString time = decodeTime(); - QString altitude = decodeAltitude(); - return "AT " + time + " REQUEST DESCENT TO " + altitude; - } - case 15: - { - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "REQUEST OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 16: - { - QString position = decodePosition(); - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "AT " + position + " REQUEST OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 17: - { - QString time = decodeTime(); - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "AT " + time + " REQUEST OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 18: - return "REQUEST " + decodeSpeed(); - case 19: - { - QString speed1 = decodeSpeed(); - QString speed2 = decodeSpeed(); - return "REQUEST " + speed1 + " TO " + speed2; - } - case 20: - return "REQUEST VOICE CONTACT"; - case 21: - return "REQUEST VOICE CONTACT " + decodeFrequency(); - case 22: - return "REQUEST DIRECT TO " + decodePosition(); - case 23: - return "REQUEST " + decodeProcedureName(); - case 24: - return "REQUEST " + decodeRouteClearance(); - case 25: - return "REQUEST CLEARANCE"; - case 26: - { - QString position = decodePosition(); - QString routeClearance = decodeRouteClearance(); - return "REQUEST WEATHER DEVIATION TO " + position + " VIA " + routeClearance; - } - case 27: - { - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "REQUEST WEATHER DEVIATION UP TO " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 28: - return "LEAVING " + decodeAltitude(); - case 29: - return "CLIMBING TO " + decodeAltitude(); - case 30: - return "DESCENDING TO " + decodeAltitude(); - case 31: - return "PASSING POSITION " + decodePosition(); - case 32: - return "PRESENT ALTITUDE " + decodeAltitude(); - case 33: - return "PRESENT POSITION " + decodePosition(); - case 34: - return "PRESENT SPEED " + decodeSpeed(); - case 35: - return "PRESENT HEADING " + decodeDegrees(); - case 36: - return "PRESENT GROUND TRACK " + decodeDegrees(); - case 37: - return "LEVEL " + decodeAltitude(); - case 38: - return "ASSIGNED ALTITUDE " + decodeAltitude(); - case 39: - return "ASSIGNED SPEED " + decodeSpeed(); - case 40: - return "ASSIGNED ROUTE " + decodeRouteClearance(); - case 41: - return "BACK ON ROUTE"; - case 42: - return "NEXT WAYPOINT " + decodePosition(); - case 43: - return "NEXT WAYPOINT ETA " + decodeTime(); - case 44: - return "ENSUING WAYPOINT " + decodePosition(); - case 45: - return "REPORTED WAYPOINT " + decodePosition(); - case 46: - return "REPORTED WAYPOINT " + decodeTime(); - case 47: - return "SQUAWKING " + decodeBeaconCode(); - case 48: - return "POSITION REPORT " + decodePositionReport(); - case 49: - return "WHEN CAN WE EXPECT " + decodeSpeed(); - case 50: - { - QString speed1 = decodeSpeed(); - QString speed2 = decodeSpeed(); - return "WHEN CAN WE EXPECT " + speed1 + " TO " + speed2; - } - case 51: - return "WHEN CAN WE EXPECT BACK ON ROUTE"; - case 52: - return "WHEN CAN WE EXPECT LOWER ALTITUDE"; - case 53: - return "WHEN CAN WE EXPECT HIGHER ALTITUDE"; - case 54: - return "WHEN CAN WE EXPECT CRUISE CLIMB TO " + decodeAltitude(); - case 55: - return "PAN PAN PAN"; - case 56: - return "MAYDAY MAYDAY MAYDAY"; - case 57: - { - QString remainingFuel = decodeRemainingFuel(); - QString remainingSouls = decodeRemainingSouls(); - return remainingFuel + " OF FUEL REMAINING AND " + remainingSouls + " SOULS ON BOARD"; - } - case 58: - return "CANCEL EMERGENCY"; - case 59: - { - QString position = decodePosition(); - QString routeClearance = decodeRouteClearance(); - return "DIVERTING TO " + position + " VIA " + routeClearance; - } - case 60: - { - QString distanceOffset = decodeDistanceOffset(); - QString direction = decodeDirection(); - return "OFFSETING " + distanceOffset + " " + direction + " OF ROUTE"; - } - case 61: - return "DESCENDING TO ALTITUDE " + decodeAltitude(); - case 62: - return "ERROR " + decodeErrorInformation(); - case 63: - return "NOT CURRET DATA AUTHORITY"; - case 64: - return decodeICAOFacilityDesignation(); - case 65: - return "DUE TO WEATHER"; - case 66: - return "DUE TO AIRCRAFT PERFORAMNCE"; - case 67: - return decodeFreeText(); - case 68: - return decodeFreeText(); - case 69: - return "REQUEST VMC DESCENT"; - case 70: - return "REQUEST HEADING " + decodeDegrees(); - case 71: - return "REQUEST GROUND TRACK " + decodeDegrees(); - case 72: - return "REACHING ALTITUDE " + decodeAltitude(); - case 73: - return decodeVersionNumber(); - case 74: - return "MAINTAIN OWN SEPERATION AND VMC"; - case 75: - return "AT PILOTS DISCRETION"; - case 76: - { - QString altitude1 = decodeAltitude(); - QString altitude2 = decodeAltitude(); - return "REACHING BLOCK " + altitude1 + " TO " + altitude2; - } - case 77: - { - QString altitude1 = decodeAltitude(); - QString altitude2 = decodeAltitude(); - return "ASSIGNED BLOCK " + altitude1 + " TO " + altitude2; - } - case 78: - { - QString time = decodeTime(); - QString distance = decodeDistance(); - QString toFrom = decodeToFrom(); - QString position = decodePosition(); - return "AT " + time + " " + distance + " " + toFrom + " " + position; - } - case 79: - return "ATIS " + decodeATISCode(); - default: - return "UNKNOWN ATCDownlinkMsgElementId: " + QString::number(id); - } - } - - QString decodeAltitude() - { - int type = getBits(3); - switch (type) - { - case 0: - return decodeAltitudeQNH(); - case 1: - return decodeAltitudeQNHMeters(); - case 2: - return decodeAltitudeQFE(); - case 3: - return decodeAltitudeQFEMeters(); - case 4: - return decodeAltitudeGNSSFeet(); - case 5: - return decodeAltitudeGNSSMeters(); - case 6: - return decodeAltitudeFlightLevel(); - case 7: - return decodeAltitudeFlightLevelMetric(); - default: - return QString("UNKOWNN ALTITUDE TYPE %1").arg(type); - } - } - - QString decodeAltitudeQNH() - { - int v = getBits(12); - return QString("%1 FT").arg(v * 10); - } - - QString decodeAltitudeQNHMeters() - { - int v = getBits(14); - return QString("%1 M").arg(v); - } - - QString decodeAltitudeQFE() - { - int v = getBits(12); - return QString("QFE %1 FT").arg(v * 10); - } - - QString decodeAltitudeQFEMeters() - { - int v = getBits(13); - return QString("QFE %1 M").arg(v); - } - - QString decodeAltitudeGNSSFeet() - { - int v = getBits(18); - return QString("GNSS %1 FT").arg(v); - } - - QString decodeAltitudeGNSSMeters() - { - int v = getBits(16); - return QString("GNSS %1 M").arg(v); - } - - QString decodeAltitudeFlightLevel() - { - int v = getBits(10); - return QString("F%1").arg((v+30), 3, 10, QChar('0')); - } - - QString decodeAltitudeFlightLevelMetric() - { - int v = getBits(11); - return QString("S%1").arg((v+10), 3, 10, QChar('0')); - } - - QString decodeATISCode() - { - return decodeIA5String(5); - } - - QString decodeAltimeter() - { - bool flag = getBits(1); - if (flag) { - return decodeAltimeterEnglish(); - } else { - return decodeAltimeterMetric(); - } - } - - QString decodeAltimeterEnglish() - { - bool alt = getBits(10); - return QString("%1").arg((alt+2200)/100.0, 0, 'f', 2); - } - - QString decodeAltimeterMetric() - { - bool alt = getBits(13); - return QString("%1 HPA").arg((alt+7500)/10.0, 0, 'f', 1); - } - - QString decodePredepartureClearance() - { - bool flag0 = getBits(1); - bool flag1 = getBits(1); - bool flag2 = getBits(2); - QString s = decodeAircraftFlightIdentification(); - if (flag0) { - s.append(" " + decodeAircraftType()); - } - if (flag1) { - s.append(" " + decodeAircraftEquipmentCode()); - } - s.append(" " + decodeTime()); - s.append(" " + decodeRouteClearance()); - if (flag2) { - s.append(" " + decodeAltitude()); - } - s.append(" " + decodeFrequencyDeparture()); - s.append(" " + decodeBeaconCode()); - s.append(" " + decodePDCRevision()); - return s; - } - - QString decodeFrequencyDeparture() - { - return decodeFrequencyVHF(); - } - - QString decodePDCRevision() - { - int rev = getBits(4); - return QString::number(rev + 1); - } - - QString decodeAircraftFlightIdentification() - { - int size = getBits(3) + 2; - return decodeIA5String(size); - } - - QString decodeAircraftType() - { - int size = getBits(3) + 2; - return decodeIA5String(size); - } - - QString decodeAircraftEquipmentCode() - { - QString s = decodeComNavApproachEquipmentAvailable(); - int size = getBits(4) + 1; - for (int i = 0; i < size; i++) { - s.append(" " + decodeComNavEquipmentStatus()); - } - s.append(" " + decodeSSREquipmentAvailable()); - return s; - } - - QString decodeComNavApproachEquipmentAvailable() - { - int d = getBits(1); - return d == 0 ? "Y" : "N"; - } - - QString decodeComNavEquipmentStatus() - { - int d = getBits(4); - switch (d) - { - case 0: - return "A"; // Loran A - case 1: - return "C"; // Loran C - case 2: - return "D"; // DME - case 3: - return "E"; // DECCA - case 4: - return "F"; // ADF - case 5: - return "G"; // GNSS - case 6: - return "H"; // hfRTF - case 7: - return "I"; // INS - case 8: - return "L"; // ILS - case 9: - return "M"; // Omega - case 10: - return "O"; // VOR - case 11: - return "P"; // Doppler - case 12: - return "R"; // RNAV - case 13: - return "T"; // TACAN - case 14: - return "U"; // UHF RTF - case 15: - return "V"; // VHF RTF - default: - return QString("UNKNOWN EQUIPMENT STATUS %1").arg(d); - } - } - - QString decodeSSREquipmentAvailable() - { - int d = getBits(3); - switch (d) - { - case 0: - return "N"; // nil - case 1: - return "A"; - case 2: - return "C"; - case 3: - return "X"; - case 4: - return "P"; - case 5: - return "I"; - case 6: - return "D"; - default: - return QString("UNKNOWN SSR EQUIPMENT %1").arg(d); - } - } - - QString decodeTp4Table() - { - int t = getBits(1); - return ""; // Nothing to display - } - - QString decodeTrackDetailMsg() - { - return ""; // FIMXE - } - - QString decodeDegrees() - { - int choice = getBits(1); - if (choice == 0) { - return decodeDegreesMagnetic(); - } else { - return decodeDegreesTrue(); - } - } - - QString decodeDegreesMagnetic() - { - int degrees = getBits(9); - return QString("%1").arg(degrees, 3, 10, QChar('0')); - } - - QString decodeDegreesTrue() - { - int degrees = getBits(9); - return QString("%1 T").arg(degrees, 3, 10, QChar('0')); - } - - QString decodeDirection() - { - int dir = getBits(4); - const QStringList dirs = {"L", "R", "L OR R", "N", "S", "E", "W", "NE", "NW", "SE", "SW"}; - if (dir >= dirs.size()) { - return QString("UNKNOWN DIRECTION $1").arg(dir); - } else { - return dirs[dir]; - } - } - QString decodeDistance() - { - int unit = getBits(1); - if (unit == 0) { - return decodeDistanceNM(); - } else { - return decodeDistanceKM(); - } - } - - QString decodeDistanceNM() - { - int d = getBits(14); - return QString("%1 NM").arg((d + 1) / 10.0f, 0, 'f', 1); - } - - QString decodeDistanceKM() - { - int d = getBits(10); - return QString("%1 KM").arg(d + 1); - } - - QString decodeDistanceOffset() - { - int unit = getBits(1); - if (unit == 0) { - return decodeDistanceOffsetNM(); - } else { - return decodeDistanceOffsetKM(); - } - } - - QString decodeDistanceOffsetNM() - { - int d = getBits(7); - return QString("%1 NM").arg(d + 1); - } - - QString decodeDistanceOffsetKM() - { - int d = getBits(8); - return QString("%1 KM").arg(d + 1); - } - - QString decodeErrorInformation() - { - int error = getBits(5); - QStringList errors = { - "Application Error", - "Duplicate Msg Identification Number", - "Unrecognized Msg Reference Number", - "End Service With Pending Msgs", - "End Serivce With No Valid Response", - "Insufficient Msg Storage Capacity", - "No Available Msg Identification Number", - "Command Termination", - "Insufficient Data", - "Unexpected Data", - "Invalid Data" - }; - if (error >= errors.size()) { - return QString("Reserved Error Msg %1").arg(error); - } else { - return errors[error]; - } - } - - QString decodeFixName() - { - int size = getBits(3) + 1; - return decodeIA5String(size); - } - - QString decodeFreeText() - { - int size = getBits(8) + 1; - return decodeIA5String(size); - } - - QString decodeFrequency() - { - int choice = getBits(2); - switch (choice) - { - case 0: - return decodeFrequencyHF(); - case 1: - return decodeFrequencyVHF(); - case 2: - return decodeFrequencyUHF(); - case 3: - return decodeFrequencySatChannel(); - default: - return QString("UNKNOWN FREQUENCY %1").arg(choice); - } - } - - QString decodeFrequencyHF() - { - int f = getBits(15); - return QString("%1 KHZ").arg(f + 2850); - } - - QString decodeFrequencyVHF() - { - int f = getBits(15); - float freq = (117000.0f + f) / 1000.0f; - return QString("%1").arg(freq, 7, 'f', 3); - } - - QString decodeFrequencyUHF() - { - int f = getBits(18); - float freq = (225000.0f + f) / 1000.0f; - return QString("%1").arg(freq, 7, 'f', 3); - } - - QString decodeFrequencySatChannel() - { - QString channel; - for (int i = 0; i < 12; i++) { - channel = channel + decodeDigit(); - } - return channel; - } - - QString decodeIA5String(int size) - { - QString s; - for (int i = 0; i < size; i++) { - s.append(decodeIA5Char()); - } - return s; - } - - QChar decodeIA5Char() - { - int bits = getBits(7); - return QChar(bits); - } - - QString decodeDigit() - { - int bits = getBits(4); - return QString::number(bits); - } - - QString decodeAirport() - { - return decodeIA5String(4); - } - - QString decodeBeaconCode() - { - QString s; - for (int i = 0; i < 4; i++) { - s.append(decodeBeaconOctalDigit()); - } - return s; - } - - QString decodeBeaconOctalDigit() - { - int bits = getBits(3); - return QString::number(bits); - } - - QString decodeICAOUnitName() - { - // DO-219 spec is inconsistent in it's description of this element - page 22 appears to be wrong - QString icaoFacilityIndentification = decodeICAOFacilityIdentification(); - QString icaoFacilityFunction = decodeICAOFacilityFunction(); - return icaoFacilityIndentification + " " + icaoFacilityFunction; - } - - QString decodeICAOFacilityIdentification() - { - int type = getBits(1); - if (type == 0) { - return decodeICAOFacilityDesignation(); - } else { - return decodeICAOFacilityName(); - } - } - - QString decodeICAOFacilityDesignation() - { - return decodeIA5String(4); - } - - QString decodeICAOFacilityName() - { - int size = getBits(4) + 3; - return decodeIA5String(size); - } - - QString decodeICAOFacilityFunction() - { - int func = getBits(3); - const QStringList funcs = { - "CENTER", - "APPROACH", - "TOWER", - "FINAL", - "GROUND CONTROL", - "CLEARANCE DELIVERY", - "DEPARTURE", - "CONTROL" - }; - return funcs[func]; - } - - QString decodeLatitudeLongitude() - { - QString latitude = decodeLatitude(); - QString longitude = decodeLongitude(); - return latitude + " " + longitude; - } - - QString decodeLatitude() - { - bool flag = getBits(1); - QString s = decodeLatitudeDegrees(); - if (flag) { - s.append(" " + decodeMinutesLatLon()); - } - s.append(" " + decodeLatitudeDirection()); - return s; - } - - QString decodeLatitudeDegrees() - { - int degrees = getBits(7); - return QString::number(degrees); - } - - QString decodeMinutesLatLon() - { - int minutes = getBits(10); - return QString::number(minutes / 10.0f, 'f', 1); - } - - QString decodeLatitudeDirection() - { - int dir = getBits(1); - return dir == 0 ? "N" : "S"; - } - - QString decodeLongitude() - { - bool flag = getBits(1); - QString s = decodeLongitudeDegrees(); - if (flag) { - s.append(" " + decodeMinutesLatLon()); - } - s.append(" " + decodeLongitudeDirection()); - return s; - } - - QString decodeLongitudeDegrees() - { - int degrees = getBits(8); - return QString::number(degrees); - } - - QString decodeLongitudeDirection() - { - int dir = getBits(1); - return dir == 0 ? "E" : "W"; - } - - QString decodePlaceBearingDistance() - { - bool flag = getBits(1); - QString s = decodeFixName(); - if (flag) { - s.append(" " + decodeLatitudeLongitude()); - } - s.append(" " + decodeDegrees()); - s.append(" " + decodeDistance()); - return s; - } - - QString decodeProcedureName() - { - bool flag0 = getBits(1); - QString procedureType = decodeProcedureType(); - QString procedure = decodeProcedure(); - QString s = procedureType + " " + procedure; - if (flag0) { - s.append(decodeProcedureTransistion()); - } - return s; - } - - QString decodeProcedureType() - { - int type = getBits(2); - const QStringList types = {"Arrival", "Approach", "Departure"}; - if (type >= types.size()) { - return QString("UNKNOWN PROCEDURE TYPE %1").arg(type); - } else { - return types[type]; - } - } - - QString decodeProcedure() - { - int size = getBits(3) + 1; - return decodeIA5String(size); - } - - QString decodeProcedureTransistion() - { - int size = getBits(3) + 1; - return decodeIA5String(size); - } - - QString decodePosition() - { - int type = getBits(3); - switch (type) - { - case 0: - return decodeFixName(); - case 1: - return decodeNavAid(); - case 2: - return decodeAirport(); - case 3: - return decodeLatitudeLongitude(); - case 4: - return decodePlaceBearingDistance(); - default: - return QString("UNKNOWN POSITION %1").arg(type); - } - } - - QString decodeNavAid() - { - int size = getBits(2) + 1; - return decodeIA5String(size); - } - - QString decodePositionReport() - { - bool flag0 = getBits(1); - bool flag1 = getBits(1); - bool flag2 = getBits(1); - bool flag3 = getBits(1); - bool flag4 = getBits(1); - bool flag5 = getBits(1); - bool flag6 = getBits(1); - bool flag7 = getBits(1); - bool flag8 = getBits(1); - bool flag9 = getBits(1); - bool flag10 = getBits(1); - bool flag11 = getBits(1); - bool flag12 = getBits(1); - bool flag13 = getBits(1); - bool flag14 = getBits(1); - bool flag15 = getBits(1); - QString s = "\nPositionCurrent: " + decodePosition(); - s.append("\nTimeAtPositionCurrent: " + decodeTime()); - s.append("\nAltitude: " + decodeAltitude()); - if (flag0) { - s.append("\nFixNext: " + decodePosition()); - } - if (flag1) { - s.append("\nTimeAtFixNext: " + decodeTime()); - } - if (flag2) { - s.append("\nFixNextPlusOne: " + decodePosition()); - } - if (flag3) { - s.append("\nTimeAtDestination: " + decodeTime()); - } - if (flag4) { - s.append("\nRemainingFuel" + decodeRemainingFuel()); - } - if (flag5) { - s.append("\nTemperature: " + decodeTemperature()); - } - if (flag6) { - s.append("\nWinds: " + decodeWinds()); - } - if (flag7) { - s.append("\nTurbulence: " + decodeTurbulence()); - } - if (flag8) { - s.append("\nIcing: " + decodeIcing()); - } - if (flag9) { - s.append("\nSpeed: " + decodeSpeed()); - } - if (flag10) { - s.append("\nSpeedGround: " + decodeSpeedGround()); - } - if (flag11) { - s.append("\nVerticalChange: " + decodeVerticalChange()); - } - if (flag12) { - s.append("\nTrackAngle: " + decodeDegrees()); - } - if (flag13) { - s.append("\nTrueHeading: " + decodeDegrees()); - } - if (flag14) { - s.append("\nDistance: " + decodeDistance()); - } - if (flag15) { - s.append("\nSupplementaryInformation: " + decodeSupplementaryInformation()); - } - return s; - } - - QString decodeTemperature() - { - bool scale = getBits(1); - if (scale == 0) { - return decodeTemperatureC(); - } else { - return decodeTemperatureF(); - } - } - - QString decodeTemperatureC() - { - int temp = getBits(7); - return QString("%1 C").arg(temp - 80); - } - - QString decodeTemperatureF() - { - int temp = getBits(8); - return QString("%1 F").arg(temp - 105); - } - - QString decodeWinds() - { - QString windDirection = decodeWindDirection(); - QString windSpeed = decodeWindSpeed(); - return windDirection + windSpeed; - } - - QString decodeWindDirection() - { - int dir = getBits(9); - return QString("%1/").arg(dir + 1); - } - - QString decodeWindSpeed() - { - int units = getBits(1); - if (units == 0) { - return decodeWindSpeedEnglish(); - } else { - return decodeWindSpeedMetric(); - } - } - - QString decodeWindSpeedEnglish() - { - int speed = getBits(8); - return QString("%1 KNTS").arg(speed); - } - - QString decodeWindSpeedMetric() - { - int speed = getBits(9); - return QString("%1 KPH").arg(speed); - } - - QString decodeTurbulence() - { - int turb = getBits(2); - const QStringList turbs = {"LIGHT", "MODERATE", "SEVERE"}; - if (turb >= turbs.size()) { - return QString("UNKNOWN TURBULENCE %1").arg(turb); - } else { - return turbs[turb]; - } - } - - QString decodeIcing() - { - int icing = getBits(2); - const QStringList icings = {"TRACE", "LIGHT", "MODERATE", "SEVERE"}; - if (icing >= icings.size()) { - return QString("UNKNOWN ICING %1").arg(icing); - } else { - return icings[icing]; - } - } - - QString decodeVerticalChange() - { - QString verticalDirection = decodeVerticalDirection(); - QString verticalRate = decodeVerticalRate(); - return verticalDirection + " " + verticalRate; - } - - QString decodeVerticalDirection() - { - int dir = getBits(1); - if (dir == 0) { - return "UP"; - } else { - return "DOWN"; - } - } - - QString decodeVerticalRate() - { - int units = getBits(1); - if (units == 0) { - return decodeVerticalRateEnglish(); - } else { - return decodeVerticalRateMetric(); - } - } - - QString decodeVerticalRateEnglish() - { - int rate = getBits(6); - return QString("%1 FT/MIN").arg(rate * 100); - } - - QString decodeVerticalRateMetric() - { - int rate = getBits(8); - return QString("%1 M/MIN").arg(rate * 10); - } - - QString decodeSpeed() - { - int type = getBits(3); - switch (type) - { - case 0: - return decodeSpeedIndicated(); - case 1: - return decodeSpeedIndicatedMetric(); - case 2: - return decodeSpeedTrue(); - case 3: - return decodeSpeedTrueMetric(); - case 4: - return decodeSpeedGround(); - case 5: - return decodeSpeedGroundMetric(); - case 6: - return decodeSpeedMach(); - case 7: - return decodeSpeedMachLarge(); - default: - return QString("UKNOWN SPEED TYPE %1").arg(type); - } - } - - QString decodeSpeedIndicated() - { - int speed = getBits(5); - return QString("%1 IAS").arg((speed + 7) * 10); - } - - QString decodeSpeedIndicatedMetric() - { - int speed = getBits(7); - return QString("%1 KMIAS").arg((speed + 10) * 10); - } - - QString decodeSpeedTrue() - { - int speed = getBits(6); - return QString("%1 TAS").arg((speed + 7) * 10); - } - - QString decodeSpeedTrueMetric() - { - int speed = getBits(7); - return QString("%1 KMTAS").arg((speed + 10) * 10); - } - - QString decodeSpeedGround() - { - int speed = getBits(6); - return QString("%1 GS").arg((speed + 7) * 10); - } - - QString decodeSpeedGroundMetric() - { - int speed = getBits(8); - return QString("%1 KMGS").arg((speed + 10) * 10); - } - - QString decodeSpeedMach() - { - int speed = getBits(5); - return QString("%M").arg((speed + 61) / 100.0f, 0, 'f', 2); - } - - QString decodeSpeedMachLarge() - { - int speed = getBits(9); - return QString("%1M").arg((speed + 93) / 100.0f, 0, 'f', 2); - } - - QString decodeTime() - { - QString timeHours = decodeTimeHours(); - QString timeMinutes = decodeTimeMinutes(); - return timeHours + ":" + timeMinutes; - } - - QString decodeTimeHours() - { - int h = getBits(5); - return QString("%1").arg(h, 2, 10, QChar('0')); - } - - QString decodeTimeMinutes() - { - int m = getBits(6); - return QString("%1").arg(m, 2, 10, QChar('0')); - } - - QString decodeTimeSeconds() - { - int s = getBits(6); - return QString("%1").arg(s, 2, 10, QChar('0')); - } - - QString decodeToFrom() - { - int dir = getBits(1); - if (dir == 0) { - return "TO"; - } else { - return "FROM"; - } - } - - QString decodeRemainingFuel() - { - QString timeHours = decodeTimeHours(); - QString timeMinutes = decodeTimeMinutes(); - return timeHours + ":" + timeMinutes; - } - - QString decodeRouteClearance() - { - bool flag0 = getBits(1); - bool flag1 = getBits(1); - bool flag2 = getBits(1); - bool flag3 = getBits(1); - bool flag4 = getBits(1); - bool flag5 = getBits(1); - bool flag6 = getBits(1); - bool flag7 = getBits(1); - bool flag8 = getBits(1); - bool flag9 = getBits(1); - QString s; - if (flag0) { - s.append("\nAirportDeparture: " + decodeAirport()); - } - if (flag1) { - s.append("\nAirportDestination: " + decodeAirport()); - } - if (flag2) { - s.append("\nRunwayDeparture: " + decodeRunway()); - } - if (flag3) { - s.append("\nProcedureDeparture: " + decodeProcedureName()); - } - if (flag4) { - s.append("\nRunwayArrival: " + decodeRunway()); - } - if (flag5) { - s.append("\nProcedureApproach: " + decodeProcedureName()); - } - if (flag6) { - s.append("\nProcedureArrival: " + decodeProcedureName()); - } - if (flag7) { - s.append("\nAirwayIntercept: " + decodeAirwayIntercept()); - } - if (flag8) { - int size = getBits(7) + 1; - s.append("\nRouteInformation: "); - for (int i = 0; i < size; i++) { - s.append(decodeRouteInformation() + " "); - } - } - if (flag9) { - s.append("\nRouteInformationAdditional: " + decodeRouteInformationAdditional()); - } - return s; - } - - QString decodePublishedIdentifier() - { - bool flag = getBits(1); - QString s = decodeFixName(); - if (flag) { - s.append(" " + decodeLatitudeLongitude()); - } - return s; - } - - QString decodeRemainingSouls() - { - int souls = getBits(10); - return QString::number(souls + 1); - } - - QString decodeVersionNumber() - { - int version = getBits(4); - return QString::number(version); - } - - QString decodeRunway() - { - QString runwayDirection = decodeRunwayDirection(); - QString runwayConfiguration = decodeRunwayConfiguration(); - return runwayDirection + runwayConfiguration; - } - - QString decodeRunwayDirection() - { - int dir = getBits(6); - return QString::number(dir); - } - - QString decodeRunwayConfiguration() - { - int cfg = getBits(2); - QStringList cfgs = {"L", "R", "C", ""}; - return cfgs[cfg]; - } - - QString decodeAirwayIntercept() - { - int size = getBits(3) + 1; - return decodeIA5String(size); - } - - QString decodeRouteInformation() - { - int type = getBits(3); - switch (type) - { - case 0: - return decodePublishedIdentifier(); - case 1: - return decodeLatitudeLongitude(); - case 2: - return decodePlaceBearingPlaceBearing(); - case 3: - return decodePlaceBearingDistance(); - case 4: - return decodeAirwayIdentifier(); - case 5: - return decodeTrackDetail(); - default: - return QString("UNKOWN ROUTE INFORMATION TYPE %1").arg(type); - } - } - - QString decodePlaceBearing() - { - bool flag = getBits(1); - QString s = decodeFixName(); - if (flag) { - s.append(" " + decodeLatitudeLongitude()); - } - s.append(" " + decodeDegrees()); - return s; - } - - QString decodePlaceBearingPlaceBearing() - { - QString placeBearing1 = decodePlaceBearing(); - QString placeBearing2 = decodePlaceBearing(); - return placeBearing1 + " " + placeBearing2; - } - - QString decodeAirwayIdentifier() - { - int size = getBits(3) + 1; - return decodeIA5String(size); - } - - QString decodeTrackDetail() - { - int size = getBits(7) + 1; - QString s; - for (int i = 0; i < size; i++) { - s.append(" " + decodeLatitudeLongitude()); - } - return s; - } - - QString decodeTrackName() - { - int size = getBits(2) + 3; - return decodeIA5String(size); - } - - QString decodeSupplementaryInformation() - { - return ""; - } - - QString decodeRouteInformationAdditional() - { - return ""; - } - -}; - -#endif // INCLUDE_DO219_H +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_DO219_H +#define INCLUDE_DO219_H + +// RCTA DO-219 / CPDLC decoder +class DO219Decoder { + QByteArray m_bytes; + int m_byteIndex; + int m_bitIndex; + bool m_cpdlc; + bool m_overrun; +public: + QString m_msgIdentificationNumber; + QString m_msgReferenceNumber; + QTime m_timeStamp; + + DO219Decoder() : + m_byteIndex(0), + m_bitIndex(0), + m_cpdlc(true), + m_overrun(false) + { + } + + QString decode(const QString &msg, bool uplink) + { + if (msg.isEmpty()) { + return ""; + } + m_bytes = QByteArray::fromHex(msg.toLatin1()); + QString s = uplink ? decodeATCUplinkMessage() : decodeATCDownlinkMessage(); + if (m_overrun) { + s.append("\n(message truncated)"); + } + return s; + } + +protected: + int getBit() + { + // Data short of what the elements declare is routine, not just corrupt: each + // block of a multi-block message is decoded on its own before reassembly. Past + // the end, read zeros - which also ends any element count read from them. + if (m_byteIndex >= m_bytes.size()) + { + if (!m_overrun) { + qDebug() << "DO219Decoder::getBit: Attempt to read beyond end of data"; + } + m_overrun = true; + return 0; + } + int bit = (m_bytes[m_byteIndex] >> (7 - m_bitIndex)) & 1; + m_bitIndex++; + if (m_bitIndex == 8) + { + m_bitIndex = 0; + m_byteIndex++; + } + return bit; + } + + int getBits(int numberOfBits) + { + int bits = 0; + for (int i = 0; i < numberOfBits; i++) + { + bits <<= 1; + bits |= getBit(); + } + return bits; + } + + QString decodeATCDownlinkMessage() + { + bool flag = getBits(1); + + QString s; + decodeATCMessageHeader(); + s.append(decodeATCDownlinkMsgElementId()); + if (flag) + { + int size = getBits(2) + 1; + for (int i = 0; i < size; i++) { + s.append("\n" + decodeATCDownlinkMsgElementId()); + } + } + return s; + } + QString decodeATCUplinkMessage() + { + bool flag = getBits(1); + QString s; + decodeATCMessageHeader(); + s.append(decodeATCUplinkMsgElementId()); + if (flag) + { + int size = getBits(2) + 1; + for (int i = 0; i < size; i++) { + s.append("\n" + decodeATCUplinkMsgElementId()); + } + } + return s; + } + + void decodeATCMessageHeader() + { + bool flag = getBits(1); + bool flag1 = false; + if (m_cpdlc) { + flag1 = getBits(1); + } + m_msgIdentificationNumber = decodeMsgIdentificationNumber(); + if (flag) { + m_msgReferenceNumber = decodeMsgReferenceNumber(); + } + if (flag1) { + m_timeStamp = QTime::fromString(decodeTimeHHMMSS()); + } + } + + QString decodeTimeHHMMSS() + { + QString hours = decodeTimeHours(); + QString minutes = decodeTimeMinutes(); + QString seconds = decodeTimeSeconds(); + return hours + ":" + minutes + ":" + seconds; + } + + QString decodeMsgIdentificationNumber() + { + int num = getBits(6); + return QString::number(num); + } + + QString decodeMsgReferenceNumber() + { + int num = getBits(6); + return QString::number(num); + } + + QString decodeATCUplinkMsgElementId() + { + int id = getBits(8); + switch (id) + { + case 0: + return "UNABLE"; + case 1: + return "STANDBY"; + case 2: + return "REQUEST DEFERRED"; + case 3: + return "ROGER"; + case 4: + return "AFFIRM"; + case 5: + return "NEGATIVE"; + case 6: + return "EXPECT " + decodeAltitude(); + case 7: + return "EXPECT CLIMB AT " + decodeTime(); + case 8: + return "EXPECT CLIMB AT " + decodePosition(); + case 9: + return "EXPECT DESCENT AT " + decodeTime(); + case 10: + return "EXPECT DESCENT AT " + decodePosition(); + case 11: + return "EXPECT CRUISE CLIMB AT " + decodeTime(); + case 12: + return "EXPECT CRUISE CLIMB AT " + decodePosition(); + case 13: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " EXPECT CLIMB TO " + altitude; + } + case 14: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " EXPECT CLIMB TO " + altitude; + } + case 15: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " EXPECT DESCENT TO " + altitude; + } + case 16: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " EXPECT DESCENT TO " + altitude; + } + case 17: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " EXPECT CRUISE CLIMB TO " + altitude; + } + case 18: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " EXPECT CRUISE CLIMB TO " + altitude; + } + case 19: + return "MAINTAIN " + decodeAltitude(); + case 20: + return "CLIMB AND MAINTAIN " + decodeAltitude(); + case 21: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " CLIMB AND MAINTAIN " + altitude; + } + case 22: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " CLIMB AND MAINTAIN " + altitude; + } + case 23: + return "DESCEND AND MAINTAIN " + decodeAltitude(); + case 24: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " DESCEND AND MAINTAIN " + altitude; + } + case 25: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " DESCEND AND MAINTAIN " + altitude; + } + case 26: + { + QString altitude = decodeAltitude(); + QString time = decodeTime(); + return "CLIMB TO REACH " + altitude + " BY " + time; + } + case 27: + { + QString altitude = decodeAltitude(); + QString position = decodePosition(); + return "CLIMB TO REACH " + altitude + " BY " + position; + } + case 28: + { + QString altiutude = decodeAltitude(); + QString time = decodeTime(); + return "DESCEND TO REACH " + altiutude + " BY " + time; + } + case 29: + { + QString altiutude = decodeAltitude(); + QString position = decodePosition(); + return "DESCEND TO REACH " + altiutude + " BY " + position; + } + case 30: + { + QString altiutude1 = decodeAltitude(); + QString altiutude2 = decodeAltitude(); + return "MAINTAIN BLOCK " + altiutude1 + " TO " + altiutude2; + } + case 31: + { + QString altiutude1 = decodeAltitude(); + QString altiutude2 = decodeAltitude(); + return "CLIMB TO MAINTAIN BLOCK " + altiutude1 + " TO " + altiutude2; + } + case 32: + { + QString altiutude1 = decodeAltitude(); + QString altiutude2 = decodeAltitude(); + return "DESCEND TO MAINTAIN BLOCK " + altiutude1 + " TO " + altiutude2; + } + case 33: + return "CRUISE " + decodeAltitude(); + case 34: + return "CRUISE CLIMB TO " + decodeAltitude(); + case 35: + return "CRUISE CLIMB ABOVE " + decodeAltitude(); + case 36: + return "EXPEDITE CLIMB TO " + decodeAltitude(); + case 37: + return "EXPEDITE CLIMB ABOVE " + decodeAltitude(); + case 38: + return "IMMEDIATELY CLIMB TO " + decodeAltitude(); + case 39: + return "IMMEDIATELY DESCEND TO " + decodeAltitude(); + case 40: + return "IMMEDIATELY STOP CLIMB AT " + decodeAltitude(); + case 41: + return "IMMEDIATELY STOP DESCENT AT " + decodeAltitude(); + case 42: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "EXPECT TO CROSS " + position + " AT " + altitude; + } + case 43: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "EXPECT TO CROSS " + position + " AT OR ABOVE " + altitude; + } + case 44: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "EXPECT TO CROSS " + position + " AT OR BELOW " + altitude; + } + case 45: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "EXPECT TO CROSS " + position + " AT AND MAINTAIN " + altitude; + } + case 46: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT " + altitude; + } + case 47: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT OR ABOVE " + altitude; + } + case 48: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT OR BELOW " + altitude; + } + case 49: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT AND MAINTAIN " + altitude; + } + case 50: + { + QString position = decodePosition(); + QString altitude1 = decodeAltitude(); + QString altitude2 = decodeAltitude(); + return "CROSS " + position + " BETWEEN " + altitude1 + " AND " + altitude2; + } + case 51: + { + QString position = decodePosition(); + QString time = decodeTime(); + return "CROSS " + position + " AT " + time; + } + case 52: + { + QString position = decodePosition(); + QString time = decodeTime(); + return "CROSS " + position + " AT OR BEFORE " + time; + } + case 53: + { + QString position = decodePosition(); + QString time = decodeTime(); + return "CROSS " + position + " AT OR AFTER " + time; + } + case 54: + { + QString position = decodePosition(); + QString time1 = decodeTime(); + QString time2 = decodeTime(); + return "CROSS " + position + " BETWEEN " + time1 + " AND " + time2; + } + case 55: + { + QString position = decodePosition(); + QString speed = decodeSpeed(); + return "CROSS " + position + " AT " + speed; + } + case 56: + { + QString position = decodePosition(); + QString speed = decodeSpeed(); + return "CROSS " + position + " AT OR LESS THAN " + speed; + } + case 57: + { + QString position = decodePosition(); + QString speed = decodeSpeed(); + return "CROSS " + position + " AT OR GREATER THAN " + speed; + } + case 58: + { + QString position = decodePosition(); + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT " + time + " AT " + altitude; + } + case 59: + { + QString position = decodePosition(); + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT OR BEOFRE " + time + " AT " + altitude; + } + case 60: + { + QString position = decodePosition(); + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "CROSS " + position + " AT OR AFTER " + time + " AT " + altitude; + } + case 61: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + QString speed = decodeSpeed(); + return "CROSS " + position + " AT AND MAINTAIN " + altitude + " AT " + speed; + } + case 62: + { + QString time = decodeTime(); + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + time + " CROSS " + position + " AT AND MAINTAIN " + altitude; + } + case 63: + { + QString time = decodeTime(); + QString position = decodePosition(); + QString altitude = decodeAltitude(); + QString speed = decodeSpeed(); + return "AT " + time + " CROSS " + position + " AT AND MAINTAIN " + altitude + " AT " + speed; + } + case 64: + { + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 65: + { + QString position = decodePosition(); + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "AT " + position + " OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 66: + { + QString time = decodeTime(); + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "AT " + time + " OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 67: + return "PROCEED BACK ON ROUTE"; + case 68: + return "REJOIN ROUTE BY " + decodePosition(); + case 69: + return "REJOIN ROUTE BY " + decodeTime(); + case 70: + return "EXPECT BACK ON ROUTE BY " + decodePosition(); + case 71: + return "EXPECT BACK ON ROUTE BY " + decodeTime(); + case 72: + return "RESUME OWN NAVIGATION"; + case 73: + return decodePredepartureClearance(); + case 74: + return "PROCEED DIRECT TO " + decodePosition(); + case 75: + return "WHEN ABLE PROCEED DIRECT TO " + decodePosition(); + case 76: + { + QString time = decodeTime(); + QString position = decodePosition(); + return "AT " + time + " PROCEED DIRECT TO " + position; + } + case 77: + { + QString position1 = decodePosition(); + QString position2 = decodePosition(); + return "AT " + position1 + " PROCEED DIRECT TO " + position2; + } + case 78: + { + QString altitude = decodeAltitude(); + QString position = decodePosition(); + return "AT " + altitude + " PROCEED DIRECT TO " + position; + } + case 79: + { + QString position = decodePosition(); + QString routeClearance = decodeRouteClearance(); + return "CLEARED TO " + position + " VIA " + routeClearance; + } + case 80: + return "CLEARED " + decodeRouteClearance(); + case 81: + return "CLEARED " + decodeProcedureName(); + case 82: + { + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "CLEARD TO DEVIATE UP TO " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 83: + { + QString position = decodePosition(); + QString routeClearance = decodeRouteClearance(); + return "AT " + position + " CLEARED " + routeClearance; + } + case 84: + { + QString position = decodePosition(); + QString procedureName = decodeProcedureName(); + return "AT " + position + " CLEARED " + procedureName; + } + case 85: + return "EXPECT " + decodeRouteClearance(); + case 86: + { + QString position = decodePosition(); + QString routeClearance = decodeRouteClearance(); + return "AT " + position + " EXPECT " + routeClearance; + } + case 87: + return "EXPECT DIRECT TO " + decodePosition(); + case 88: + { + QString position1 = decodePosition(); + QString position2 = decodePosition(); + return "AT " + position1 + " EXPECT DIRECT TO " + position2; + } + case 89: + { + QString time = decodeTime(); + QString position = decodePosition(); + return "AT " + time + " EXPECT DIRECT TO " + position; + } + case 90: + { + QString altitude = decodeAltitude(); + QString position = decodePosition(); + return "AT " + altitude + " EXPECT DIRECT TO " + position; + } + case 91: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "HOLD AT " + position + " MAINTAIN " + altitude + " INBOUND TRACK"; + } + case 92: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "HOLD AT " + position + " AS PUBLISHED MAINTAIN " + altitude; + } + case 93: + return "EXPECT FURTHER CLEARANCE AT " + decodeTime(); + case 94: + { + QString direction = decodeDirection(); + QString degrees = decodeDegrees(); + return "TURN " + direction + " HEADING " + degrees; + } + case 95: + { + QString direction = decodeDirection(); + QString degrees = decodeDegrees(); + return "TURN " + direction + " GROUND TRACK " + degrees; + } + case 96: + return "FLY PRESENT HEADING"; + case 97: + { + QString position = decodePosition(); + QString degrees = decodeDegrees(); + return "AT " + position + " FLY HEADING " + degrees; + } + case 98: + { + QString direction = decodeDirection(); + QString degrees = decodeDegrees(); + return "IMMEDIATELY TURN " + direction + " HEADING " + degrees; + } + case 99: + return "EXPECT " + decodeProcedureName(); + case 100: + { + QString time = decodeTime(); + QString speed = decodeSpeed(); + return "AT " + time + " EXPECT " + speed; + } + case 101: + { + QString position = decodePosition(); + QString speed = decodeSpeed(); + return "AT " + position + " EXPECT " + speed; + } + case 102: + { + QString altitude = decodeAltitude(); + QString speed = decodeSpeed(); + return "AT " + altitude + " EXPECT " + speed; + } + case 103: + { + QString time = decodeTime(); + QString speed1 = decodeSpeed(); + QString speed2 = decodeSpeed(); + return "AT " + time + " EXPECT " + speed1 + " TO " + speed2; + } + case 104: + { + QString position = decodePosition(); + QString speed1 = decodeSpeed(); + QString speed2 = decodeSpeed(); + return "AT " + position + " EXPECT " + speed1 + " TO " + speed2; + } + case 105: + { + QString altitude = decodeAltitude(); + QString speed1 = decodeSpeed(); + QString speed2 = decodeSpeed(); + return "AT " + altitude + " EXPECT " + speed1 + " TO " + speed2; + } + case 106: + return "MAINTAIN " + decodeSpeed(); + case 107: + return "MAINTAIN PRESENT SPEED"; + case 108: + return "MAINTAIN " + decodeSpeed() + " OR GREATER"; + case 109: + return "MAINTAIN " + decodeSpeed() + " OR LESS"; + case 110: + { + QString speed1 = decodeSpeed(); + QString speed2 = decodeSpeed(); + return "MAINTAIN " + speed1 + " THROUGH " + speed2; + } + case 111: + return "INCREASE SPEED TO " + decodeSpeed(); + case 112: + return "INCREASE SPEED TO " + decodeSpeed() + " OR GREATER"; + case 113: + return "REDUCE SPEED TO " + decodeSpeed(); + case 114: + return "REDUCE SPEED TO " + decodeSpeed() + " OR LESS"; + case 115: + return "DO NOT EXCEED " + decodeSpeed(); + case 116: + return "RESUME NORMAL SPEED"; + case 117: + { + QString icaoUnitName = decodeICAOUnitName(); + QString frequency = decodeFrequency(); + return "CONTACT " + icaoUnitName + " " + frequency; + } + case 118: + { + QString position = decodePosition(); + QString icaoUnitName = decodeICAOUnitName(); + QString frequency = decodeFrequency(); + return "AT " + position + " CONTACT " + icaoUnitName + " " + frequency; + } + case 119: + { + QString time = decodeTime(); + QString icaoUnitName = decodeICAOUnitName(); + QString frequency = decodeFrequency(); + return "AT " + time + " CONTACT " + icaoUnitName + " " + frequency; + } + case 120: + { + QString icaoUnitName = decodeICAOUnitName(); + QString frequency = decodeFrequency(); + return "MONITOR " + icaoUnitName + " " + frequency; + } + case 121: + { + QString position = decodePosition(); + QString icaoUnitName = decodeICAOUnitName(); + QString frequency = decodeFrequency(); + return "AT " + position + " MONITOR " + icaoUnitName + " " + frequency; + } + case 122: + { + QString time = decodeTime(); + QString icaoUnitName = decodeICAOUnitName(); + QString frequency = decodeFrequency(); + return "AT " + time + " MONITOR " + icaoUnitName + " " + frequency; + } + case 123: + return "SQUAWK " + decodeBeaconCode(); + case 124: + return "STOP SQUAWK"; + case 125: + return "SQUAWK ALTITUDE"; + case 126: + return "STOP ALTITUDE SQUAWK"; + case 127: + return "REPORT BACK ON ROUTE"; + case 128: + return "REPORT LEAVING " + decodeAltitude(); + case 129: + return "REPORT LEVEL " + decodeAltitude(); + case 130: + return "REPORT PASSING " + decodeAltitude(); + case 131: + return "REPORT REAMINING FUEL AND SOULS ON BOARD"; + case 132: + return "CONFIRM POSITION"; + case 133: + return "CONFIRM ALTITUDE"; + case 134: + return "CONFIRM SPEED"; + case 135: + return "CONFIRM ASSIGNED ALTITUDE"; + case 136: + return "CONFIRM ASSIGNED SPEED"; + case 137: + return "CONFIRM ASSIGNED ROUTE"; + case 138: + return "CONFIRM TIME OVER REPORTED WAYPOINT"; + case 139: + return "CONFIRM REPORTED WAYPOINT"; + case 140: + return "CONFIRM NEXT WAYPOINT"; + case 141: + return "CONFIRM NEXT WAYPOINT ETA"; + case 142: + return "CONFIRM ENSUING WAYPOINT"; + case 143: + return "CONFIRM REQUEST"; + case 144: + return "CONFIRM SQUAWK"; + case 145: + return "CONFIRM HEADING"; + case 146: + return "CONFIRM GROUND TRACK"; + case 147: + return "REQUEST POSITION REPORT"; + case 148: + return "WHEN CAN YOU ACCEPT " + decodeAltitude(); + case 149: + { + QString altitude = decodeAltitude(); + QString position = decodePosition(); + return "CAN YOU ACCEPT " + altitude + " AT " + position; + } + case 150: + { + QString altitude = decodeAltitude(); + QString time = decodeTime(); + return "CAN YOU ACCEPT " + altitude + " AT " + time; + } + case 151: + return "WHEN CAN YOU ACCEPT " + decodeSpeed(); + case 152: + { + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "WHEN CAN YOU ACCEPT " + distanceOffset + " " + direction + " OFFSET"; + } + case 153: + return "ALTIMETER " + decodeAltimeter(); + case 154: + return "RADAR SERVICES TERMINATED"; + case 155: + return "RADAR CONTACT " + decodePosition(); + case 156: + return "RADAR CONTACT LOST"; + case 157: + return "CHECK STUCK MICROPHONE " + decodeFrequency(); + case 158: + return "ATIS " + decodeATISCode(); + case 159: + return "ERROR " + decodeErrorInformation(); + case 160: + return "NEXT DATA AUTHORITY " + decodeICAOFacilityDesignation(); + case 161: + return "END SERVICE"; + case 162: + return "SERVICE UNAVAILABLE"; + case 163: + { + QString icaoFacilityDesignation = decodeICAOFacilityDesignation(); + QString tp4Table = decodeTp4Table(); + return icaoFacilityDesignation + " " + tp4Table; + } + case 164: + return "WHEN READY"; + case 165: + return "THEN"; + case 166: + return "DUE TO TRAFFIC"; + case 167: + return "DUE TO AIRSPACE RESTRICTION"; + case 168: + return "DISREGARD"; + case 169: + return decodeFreeText(); + case 170: + return decodeFreeText(); + case 171: + return "CLIMB AT " + decodeVerticalRate() + " MINIMUM"; + case 172: + return "CLIMB AT " + decodeVerticalRate() + " MAXIMUM"; + case 173: + return "DESCEND AT " + decodeVerticalRate() + " MINIMUM"; + case 174: + return "DESCEND AT " + decodeVerticalRate() + " MAXIMUM"; + case 175: + return "REPORT REACHING " + decodeAltitude(); + case 176: + return "MAINTAIN OWN SEPERATION AND VMC"; + case 177: + return "AT PILOTS DISCRETION"; + case 178: + return decodeTrackDetailMsg(); + case 179: + return "SQUAWK IDENT"; + case 180: + { + QString altitude1 = decodeAltitude(); + QString altitude2 = decodeAltitude(); + return "REPORT REACHING BLOCK " + altitude1 + " TO " + altitude2; + } + case 181: + { + QString toFrom = decodeToFrom(); + QString position = decodePosition(); + return "REPORT DISTANCE " + toFrom + " " + position; + } + case 182: + return "CONFIRM ATIS CODE"; + default: + return "UNKNOWN ATCUplinkMsgElementId: " + QString::number(id); + } + } + + QString decodeATCDownlinkMsgElementId() + { + int id = getBits(8); + switch (id) + { + case 0: + return "WILCO"; + case 1: + return "UNABLE"; + case 2: + return "STANDBY"; + case 3: + return "ROGER"; + case 4: + return "AFFIRM"; + case 5: + return "NEGATIVE"; + case 6: + return "REQUEST " + decodeAltitude(); + case 7: + { + QString altitude1 = decodeAltitude(); + QString altitude2 = decodeAltitude(); + return "REQUEST BLOCK " + altitude1 + " TO " + altitude2; + } + case 8: + return "REQUEST CRUISE CLIMB TO " + decodeAltitude(); + case 9: + return "REQUEST CLIMB TO " + decodeAltitude(); + case 10: + return "REQUEST DESCENT TO " + decodeAltitude(); + case 11: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " REQUEST CLIMB TO " + altitude; + } + case 12: + { + QString position = decodePosition(); + QString altitude = decodeAltitude(); + return "AT " + position + " REQUEST DESCENT TO " + altitude; + } + case 13: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " REQUEST CLIMB TO " + altitude; + } + case 14: + { + QString time = decodeTime(); + QString altitude = decodeAltitude(); + return "AT " + time + " REQUEST DESCENT TO " + altitude; + } + case 15: + { + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "REQUEST OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 16: + { + QString position = decodePosition(); + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "AT " + position + " REQUEST OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 17: + { + QString time = decodeTime(); + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "AT " + time + " REQUEST OFFSET " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 18: + return "REQUEST " + decodeSpeed(); + case 19: + { + QString speed1 = decodeSpeed(); + QString speed2 = decodeSpeed(); + return "REQUEST " + speed1 + " TO " + speed2; + } + case 20: + return "REQUEST VOICE CONTACT"; + case 21: + return "REQUEST VOICE CONTACT " + decodeFrequency(); + case 22: + return "REQUEST DIRECT TO " + decodePosition(); + case 23: + return "REQUEST " + decodeProcedureName(); + case 24: + return "REQUEST " + decodeRouteClearance(); + case 25: + return "REQUEST CLEARANCE"; + case 26: + { + QString position = decodePosition(); + QString routeClearance = decodeRouteClearance(); + return "REQUEST WEATHER DEVIATION TO " + position + " VIA " + routeClearance; + } + case 27: + { + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "REQUEST WEATHER DEVIATION UP TO " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 28: + return "LEAVING " + decodeAltitude(); + case 29: + return "CLIMBING TO " + decodeAltitude(); + case 30: + return "DESCENDING TO " + decodeAltitude(); + case 31: + return "PASSING POSITION " + decodePosition(); + case 32: + return "PRESENT ALTITUDE " + decodeAltitude(); + case 33: + return "PRESENT POSITION " + decodePosition(); + case 34: + return "PRESENT SPEED " + decodeSpeed(); + case 35: + return "PRESENT HEADING " + decodeDegrees(); + case 36: + return "PRESENT GROUND TRACK " + decodeDegrees(); + case 37: + return "LEVEL " + decodeAltitude(); + case 38: + return "ASSIGNED ALTITUDE " + decodeAltitude(); + case 39: + return "ASSIGNED SPEED " + decodeSpeed(); + case 40: + return "ASSIGNED ROUTE " + decodeRouteClearance(); + case 41: + return "BACK ON ROUTE"; + case 42: + return "NEXT WAYPOINT " + decodePosition(); + case 43: + return "NEXT WAYPOINT ETA " + decodeTime(); + case 44: + return "ENSUING WAYPOINT " + decodePosition(); + case 45: + return "REPORTED WAYPOINT " + decodePosition(); + case 46: + return "REPORTED WAYPOINT " + decodeTime(); + case 47: + return "SQUAWKING " + decodeBeaconCode(); + case 48: + return "POSITION REPORT " + decodePositionReport(); + case 49: + return "WHEN CAN WE EXPECT " + decodeSpeed(); + case 50: + { + QString speed1 = decodeSpeed(); + QString speed2 = decodeSpeed(); + return "WHEN CAN WE EXPECT " + speed1 + " TO " + speed2; + } + case 51: + return "WHEN CAN WE EXPECT BACK ON ROUTE"; + case 52: + return "WHEN CAN WE EXPECT LOWER ALTITUDE"; + case 53: + return "WHEN CAN WE EXPECT HIGHER ALTITUDE"; + case 54: + return "WHEN CAN WE EXPECT CRUISE CLIMB TO " + decodeAltitude(); + case 55: + return "PAN PAN PAN"; + case 56: + return "MAYDAY MAYDAY MAYDAY"; + case 57: + { + QString remainingFuel = decodeRemainingFuel(); + QString remainingSouls = decodeRemainingSouls(); + return remainingFuel + " OF FUEL REMAINING AND " + remainingSouls + " SOULS ON BOARD"; + } + case 58: + return "CANCEL EMERGENCY"; + case 59: + { + QString position = decodePosition(); + QString routeClearance = decodeRouteClearance(); + return "DIVERTING TO " + position + " VIA " + routeClearance; + } + case 60: + { + QString distanceOffset = decodeDistanceOffset(); + QString direction = decodeDirection(); + return "OFFSETING " + distanceOffset + " " + direction + " OF ROUTE"; + } + case 61: + return "DESCENDING TO ALTITUDE " + decodeAltitude(); + case 62: + return "ERROR " + decodeErrorInformation(); + case 63: + return "NOT CURRET DATA AUTHORITY"; + case 64: + return decodeICAOFacilityDesignation(); + case 65: + return "DUE TO WEATHER"; + case 66: + return "DUE TO AIRCRAFT PERFORAMNCE"; + case 67: + return decodeFreeText(); + case 68: + return decodeFreeText(); + case 69: + return "REQUEST VMC DESCENT"; + case 70: + return "REQUEST HEADING " + decodeDegrees(); + case 71: + return "REQUEST GROUND TRACK " + decodeDegrees(); + case 72: + return "REACHING ALTITUDE " + decodeAltitude(); + case 73: + return decodeVersionNumber(); + case 74: + return "MAINTAIN OWN SEPERATION AND VMC"; + case 75: + return "AT PILOTS DISCRETION"; + case 76: + { + QString altitude1 = decodeAltitude(); + QString altitude2 = decodeAltitude(); + return "REACHING BLOCK " + altitude1 + " TO " + altitude2; + } + case 77: + { + QString altitude1 = decodeAltitude(); + QString altitude2 = decodeAltitude(); + return "ASSIGNED BLOCK " + altitude1 + " TO " + altitude2; + } + case 78: + { + QString time = decodeTime(); + QString distance = decodeDistance(); + QString toFrom = decodeToFrom(); + QString position = decodePosition(); + return "AT " + time + " " + distance + " " + toFrom + " " + position; + } + case 79: + return "ATIS " + decodeATISCode(); + default: + return "UNKNOWN ATCDownlinkMsgElementId: " + QString::number(id); + } + } + + QString decodeAltitude() + { + int type = getBits(3); + switch (type) + { + case 0: + return decodeAltitudeQNH(); + case 1: + return decodeAltitudeQNHMeters(); + case 2: + return decodeAltitudeQFE(); + case 3: + return decodeAltitudeQFEMeters(); + case 4: + return decodeAltitudeGNSSFeet(); + case 5: + return decodeAltitudeGNSSMeters(); + case 6: + return decodeAltitudeFlightLevel(); + case 7: + return decodeAltitudeFlightLevelMetric(); + default: + return QString("UNKOWNN ALTITUDE TYPE %1").arg(type); + } + } + + QString decodeAltitudeQNH() + { + int v = getBits(12); + return QString("%1 FT").arg(v * 10); + } + + QString decodeAltitudeQNHMeters() + { + int v = getBits(14); + return QString("%1 M").arg(v); + } + + QString decodeAltitudeQFE() + { + int v = getBits(12); + return QString("QFE %1 FT").arg(v * 10); + } + + QString decodeAltitudeQFEMeters() + { + int v = getBits(13); + return QString("QFE %1 M").arg(v); + } + + QString decodeAltitudeGNSSFeet() + { + int v = getBits(18); + return QString("GNSS %1 FT").arg(v); + } + + QString decodeAltitudeGNSSMeters() + { + int v = getBits(16); + return QString("GNSS %1 M").arg(v); + } + + QString decodeAltitudeFlightLevel() + { + int v = getBits(10); + return QString("F%1").arg((v+30), 3, 10, QChar('0')); + } + + QString decodeAltitudeFlightLevelMetric() + { + int v = getBits(11); + return QString("S%1").arg((v+10), 3, 10, QChar('0')); + } + + QString decodeATISCode() + { + return decodeIA5String(5); + } + + QString decodeAltimeter() + { + bool flag = getBits(1); + if (flag) { + return decodeAltimeterEnglish(); + } else { + return decodeAltimeterMetric(); + } + } + + QString decodeAltimeterEnglish() + { + bool alt = getBits(10); + return QString("%1").arg((alt+2200)/100.0, 0, 'f', 2); + } + + QString decodeAltimeterMetric() + { + bool alt = getBits(13); + return QString("%1 HPA").arg((alt+7500)/10.0, 0, 'f', 1); + } + + QString decodePredepartureClearance() + { + bool flag0 = getBits(1); + bool flag1 = getBits(1); + bool flag2 = getBits(2); + QString s = decodeAircraftFlightIdentification(); + if (flag0) { + s.append(" " + decodeAircraftType()); + } + if (flag1) { + s.append(" " + decodeAircraftEquipmentCode()); + } + s.append(" " + decodeTime()); + s.append(" " + decodeRouteClearance()); + if (flag2) { + s.append(" " + decodeAltitude()); + } + s.append(" " + decodeFrequencyDeparture()); + s.append(" " + decodeBeaconCode()); + s.append(" " + decodePDCRevision()); + return s; + } + + QString decodeFrequencyDeparture() + { + return decodeFrequencyVHF(); + } + + QString decodePDCRevision() + { + int rev = getBits(4); + return QString::number(rev + 1); + } + + QString decodeAircraftFlightIdentification() + { + int size = getBits(3) + 2; + return decodeIA5String(size); + } + + QString decodeAircraftType() + { + int size = getBits(3) + 2; + return decodeIA5String(size); + } + + QString decodeAircraftEquipmentCode() + { + QString s = decodeComNavApproachEquipmentAvailable(); + int size = getBits(4) + 1; + for (int i = 0; i < size; i++) { + s.append(" " + decodeComNavEquipmentStatus()); + } + s.append(" " + decodeSSREquipmentAvailable()); + return s; + } + + QString decodeComNavApproachEquipmentAvailable() + { + int d = getBits(1); + return d == 0 ? "Y" : "N"; + } + + QString decodeComNavEquipmentStatus() + { + int d = getBits(4); + switch (d) + { + case 0: + return "A"; // Loran A + case 1: + return "C"; // Loran C + case 2: + return "D"; // DME + case 3: + return "E"; // DECCA + case 4: + return "F"; // ADF + case 5: + return "G"; // GNSS + case 6: + return "H"; // hfRTF + case 7: + return "I"; // INS + case 8: + return "L"; // ILS + case 9: + return "M"; // Omega + case 10: + return "O"; // VOR + case 11: + return "P"; // Doppler + case 12: + return "R"; // RNAV + case 13: + return "T"; // TACAN + case 14: + return "U"; // UHF RTF + case 15: + return "V"; // VHF RTF + default: + return QString("UNKNOWN EQUIPMENT STATUS %1").arg(d); + } + } + + QString decodeSSREquipmentAvailable() + { + int d = getBits(3); + switch (d) + { + case 0: + return "N"; // nil + case 1: + return "A"; + case 2: + return "C"; + case 3: + return "X"; + case 4: + return "P"; + case 5: + return "I"; + case 6: + return "D"; + default: + return QString("UNKNOWN SSR EQUIPMENT %1").arg(d); + } + } + + QString decodeTp4Table() + { + int t = getBits(1); + return ""; // Nothing to display + } + + QString decodeTrackDetailMsg() + { + return ""; // FIMXE + } + + QString decodeDegrees() + { + int choice = getBits(1); + if (choice == 0) { + return decodeDegreesMagnetic(); + } else { + return decodeDegreesTrue(); + } + } + + QString decodeDegreesMagnetic() + { + int degrees = getBits(9); + return QString("%1").arg(degrees, 3, 10, QChar('0')); + } + + QString decodeDegreesTrue() + { + int degrees = getBits(9); + return QString("%1 T").arg(degrees, 3, 10, QChar('0')); + } + + QString decodeDirection() + { + int dir = getBits(4); + const QStringList dirs = {"L", "R", "L OR R", "N", "S", "E", "W", "NE", "NW", "SE", "SW"}; + if (dir >= dirs.size()) { + return QString("UNKNOWN DIRECTION $1").arg(dir); + } else { + return dirs[dir]; + } + } + QString decodeDistance() + { + int unit = getBits(1); + if (unit == 0) { + return decodeDistanceNM(); + } else { + return decodeDistanceKM(); + } + } + + QString decodeDistanceNM() + { + int d = getBits(14); + return QString("%1 NM").arg((d + 1) / 10.0f, 0, 'f', 1); + } + + QString decodeDistanceKM() + { + int d = getBits(10); + return QString("%1 KM").arg(d + 1); + } + + QString decodeDistanceOffset() + { + int unit = getBits(1); + if (unit == 0) { + return decodeDistanceOffsetNM(); + } else { + return decodeDistanceOffsetKM(); + } + } + + QString decodeDistanceOffsetNM() + { + int d = getBits(7); + return QString("%1 NM").arg(d + 1); + } + + QString decodeDistanceOffsetKM() + { + int d = getBits(8); + return QString("%1 KM").arg(d + 1); + } + + QString decodeErrorInformation() + { + int error = getBits(5); + QStringList errors = { + "Application Error", + "Duplicate Msg Identification Number", + "Unrecognized Msg Reference Number", + "End Service With Pending Msgs", + "End Serivce With No Valid Response", + "Insufficient Msg Storage Capacity", + "No Available Msg Identification Number", + "Command Termination", + "Insufficient Data", + "Unexpected Data", + "Invalid Data" + }; + if (error >= errors.size()) { + return QString("Reserved Error Msg %1").arg(error); + } else { + return errors[error]; + } + } + + QString decodeFixName() + { + int size = getBits(3) + 1; + return decodeIA5String(size); + } + + QString decodeFreeText() + { + int size = getBits(8) + 1; + return decodeIA5String(size); + } + + QString decodeFrequency() + { + int choice = getBits(2); + switch (choice) + { + case 0: + return decodeFrequencyHF(); + case 1: + return decodeFrequencyVHF(); + case 2: + return decodeFrequencyUHF(); + case 3: + return decodeFrequencySatChannel(); + default: + return QString("UNKNOWN FREQUENCY %1").arg(choice); + } + } + + QString decodeFrequencyHF() + { + int f = getBits(15); + return QString("%1 KHZ").arg(f + 2850); + } + + QString decodeFrequencyVHF() + { + int f = getBits(15); + float freq = (117000.0f + f) / 1000.0f; + return QString("%1").arg(freq, 7, 'f', 3); + } + + QString decodeFrequencyUHF() + { + int f = getBits(18); + float freq = (225000.0f + f) / 1000.0f; + return QString("%1").arg(freq, 7, 'f', 3); + } + + QString decodeFrequencySatChannel() + { + QString channel; + for (int i = 0; i < 12; i++) { + channel = channel + decodeDigit(); + } + return channel; + } + + QString decodeIA5String(int size) + { + QString s; + for (int i = 0; i < size; i++) { + s.append(decodeIA5Char()); + } + return s; + } + + QChar decodeIA5Char() + { + int bits = getBits(7); + return QChar(bits); + } + + QString decodeDigit() + { + int bits = getBits(4); + return QString::number(bits); + } + + QString decodeAirport() + { + return decodeIA5String(4); + } + + QString decodeBeaconCode() + { + QString s; + for (int i = 0; i < 4; i++) { + s.append(decodeBeaconOctalDigit()); + } + return s; + } + + QString decodeBeaconOctalDigit() + { + int bits = getBits(3); + return QString::number(bits); + } + + QString decodeICAOUnitName() + { + // DO-219 spec is inconsistent in it's description of this element - page 22 appears to be wrong + QString icaoFacilityIndentification = decodeICAOFacilityIdentification(); + QString icaoFacilityFunction = decodeICAOFacilityFunction(); + return icaoFacilityIndentification + " " + icaoFacilityFunction; + } + + QString decodeICAOFacilityIdentification() + { + int type = getBits(1); + if (type == 0) { + return decodeICAOFacilityDesignation(); + } else { + return decodeICAOFacilityName(); + } + } + + QString decodeICAOFacilityDesignation() + { + return decodeIA5String(4); + } + + QString decodeICAOFacilityName() + { + int size = getBits(4) + 3; + return decodeIA5String(size); + } + + QString decodeICAOFacilityFunction() + { + int func = getBits(3); + const QStringList funcs = { + "CENTER", + "APPROACH", + "TOWER", + "FINAL", + "GROUND CONTROL", + "CLEARANCE DELIVERY", + "DEPARTURE", + "CONTROL" + }; + return funcs[func]; + } + + QString decodeLatitudeLongitude() + { + QString latitude = decodeLatitude(); + QString longitude = decodeLongitude(); + return latitude + " " + longitude; + } + + QString decodeLatitude() + { + bool flag = getBits(1); + QString s = decodeLatitudeDegrees(); + if (flag) { + s.append(" " + decodeMinutesLatLon()); + } + s.append(" " + decodeLatitudeDirection()); + return s; + } + + QString decodeLatitudeDegrees() + { + int degrees = getBits(7); + return QString::number(degrees); + } + + QString decodeMinutesLatLon() + { + int minutes = getBits(10); + return QString::number(minutes / 10.0f, 'f', 1); + } + + QString decodeLatitudeDirection() + { + int dir = getBits(1); + return dir == 0 ? "N" : "S"; + } + + QString decodeLongitude() + { + bool flag = getBits(1); + QString s = decodeLongitudeDegrees(); + if (flag) { + s.append(" " + decodeMinutesLatLon()); + } + s.append(" " + decodeLongitudeDirection()); + return s; + } + + QString decodeLongitudeDegrees() + { + int degrees = getBits(8); + return QString::number(degrees); + } + + QString decodeLongitudeDirection() + { + int dir = getBits(1); + return dir == 0 ? "E" : "W"; + } + + QString decodePlaceBearingDistance() + { + bool flag = getBits(1); + QString s = decodeFixName(); + if (flag) { + s.append(" " + decodeLatitudeLongitude()); + } + s.append(" " + decodeDegrees()); + s.append(" " + decodeDistance()); + return s; + } + + QString decodeProcedureName() + { + bool flag0 = getBits(1); + QString procedureType = decodeProcedureType(); + QString procedure = decodeProcedure(); + QString s = procedureType + " " + procedure; + if (flag0) { + s.append(decodeProcedureTransistion()); + } + return s; + } + + QString decodeProcedureType() + { + int type = getBits(2); + const QStringList types = {"Arrival", "Approach", "Departure"}; + if (type >= types.size()) { + return QString("UNKNOWN PROCEDURE TYPE %1").arg(type); + } else { + return types[type]; + } + } + + QString decodeProcedure() + { + int size = getBits(3) + 1; + return decodeIA5String(size); + } + + QString decodeProcedureTransistion() + { + int size = getBits(3) + 1; + return decodeIA5String(size); + } + + QString decodePosition() + { + int type = getBits(3); + switch (type) + { + case 0: + return decodeFixName(); + case 1: + return decodeNavAid(); + case 2: + return decodeAirport(); + case 3: + return decodeLatitudeLongitude(); + case 4: + return decodePlaceBearingDistance(); + default: + return QString("UNKNOWN POSITION %1").arg(type); + } + } + + QString decodeNavAid() + { + int size = getBits(2) + 1; + return decodeIA5String(size); + } + + QString decodePositionReport() + { + bool flag0 = getBits(1); + bool flag1 = getBits(1); + bool flag2 = getBits(1); + bool flag3 = getBits(1); + bool flag4 = getBits(1); + bool flag5 = getBits(1); + bool flag6 = getBits(1); + bool flag7 = getBits(1); + bool flag8 = getBits(1); + bool flag9 = getBits(1); + bool flag10 = getBits(1); + bool flag11 = getBits(1); + bool flag12 = getBits(1); + bool flag13 = getBits(1); + bool flag14 = getBits(1); + bool flag15 = getBits(1); + QString s = "\nPositionCurrent: " + decodePosition(); + s.append("\nTimeAtPositionCurrent: " + decodeTime()); + s.append("\nAltitude: " + decodeAltitude()); + if (flag0) { + s.append("\nFixNext: " + decodePosition()); + } + if (flag1) { + s.append("\nTimeAtFixNext: " + decodeTime()); + } + if (flag2) { + s.append("\nFixNextPlusOne: " + decodePosition()); + } + if (flag3) { + s.append("\nTimeAtDestination: " + decodeTime()); + } + if (flag4) { + s.append("\nRemainingFuel" + decodeRemainingFuel()); + } + if (flag5) { + s.append("\nTemperature: " + decodeTemperature()); + } + if (flag6) { + s.append("\nWinds: " + decodeWinds()); + } + if (flag7) { + s.append("\nTurbulence: " + decodeTurbulence()); + } + if (flag8) { + s.append("\nIcing: " + decodeIcing()); + } + if (flag9) { + s.append("\nSpeed: " + decodeSpeed()); + } + if (flag10) { + s.append("\nSpeedGround: " + decodeSpeedGround()); + } + if (flag11) { + s.append("\nVerticalChange: " + decodeVerticalChange()); + } + if (flag12) { + s.append("\nTrackAngle: " + decodeDegrees()); + } + if (flag13) { + s.append("\nTrueHeading: " + decodeDegrees()); + } + if (flag14) { + s.append("\nDistance: " + decodeDistance()); + } + if (flag15) { + s.append("\nSupplementaryInformation: " + decodeSupplementaryInformation()); + } + return s; + } + + QString decodeTemperature() + { + bool scale = getBits(1); + if (scale == 0) { + return decodeTemperatureC(); + } else { + return decodeTemperatureF(); + } + } + + QString decodeTemperatureC() + { + int temp = getBits(7); + return QString("%1 C").arg(temp - 80); + } + + QString decodeTemperatureF() + { + int temp = getBits(8); + return QString("%1 F").arg(temp - 105); + } + + QString decodeWinds() + { + QString windDirection = decodeWindDirection(); + QString windSpeed = decodeWindSpeed(); + return windDirection + windSpeed; + } + + QString decodeWindDirection() + { + int dir = getBits(9); + return QString("%1/").arg(dir + 1); + } + + QString decodeWindSpeed() + { + int units = getBits(1); + if (units == 0) { + return decodeWindSpeedEnglish(); + } else { + return decodeWindSpeedMetric(); + } + } + + QString decodeWindSpeedEnglish() + { + int speed = getBits(8); + return QString("%1 KNTS").arg(speed); + } + + QString decodeWindSpeedMetric() + { + int speed = getBits(9); + return QString("%1 KPH").arg(speed); + } + + QString decodeTurbulence() + { + int turb = getBits(2); + const QStringList turbs = {"LIGHT", "MODERATE", "SEVERE"}; + if (turb >= turbs.size()) { + return QString("UNKNOWN TURBULENCE %1").arg(turb); + } else { + return turbs[turb]; + } + } + + QString decodeIcing() + { + int icing = getBits(2); + const QStringList icings = {"TRACE", "LIGHT", "MODERATE", "SEVERE"}; + if (icing >= icings.size()) { + return QString("UNKNOWN ICING %1").arg(icing); + } else { + return icings[icing]; + } + } + + QString decodeVerticalChange() + { + QString verticalDirection = decodeVerticalDirection(); + QString verticalRate = decodeVerticalRate(); + return verticalDirection + " " + verticalRate; + } + + QString decodeVerticalDirection() + { + int dir = getBits(1); + if (dir == 0) { + return "UP"; + } else { + return "DOWN"; + } + } + + QString decodeVerticalRate() + { + int units = getBits(1); + if (units == 0) { + return decodeVerticalRateEnglish(); + } else { + return decodeVerticalRateMetric(); + } + } + + QString decodeVerticalRateEnglish() + { + int rate = getBits(6); + return QString("%1 FT/MIN").arg(rate * 100); + } + + QString decodeVerticalRateMetric() + { + int rate = getBits(8); + return QString("%1 M/MIN").arg(rate * 10); + } + + QString decodeSpeed() + { + int type = getBits(3); + switch (type) + { + case 0: + return decodeSpeedIndicated(); + case 1: + return decodeSpeedIndicatedMetric(); + case 2: + return decodeSpeedTrue(); + case 3: + return decodeSpeedTrueMetric(); + case 4: + return decodeSpeedGround(); + case 5: + return decodeSpeedGroundMetric(); + case 6: + return decodeSpeedMach(); + case 7: + return decodeSpeedMachLarge(); + default: + return QString("UKNOWN SPEED TYPE %1").arg(type); + } + } + + QString decodeSpeedIndicated() + { + int speed = getBits(5); + return QString("%1 IAS").arg((speed + 7) * 10); + } + + QString decodeSpeedIndicatedMetric() + { + int speed = getBits(7); + return QString("%1 KMIAS").arg((speed + 10) * 10); + } + + QString decodeSpeedTrue() + { + int speed = getBits(6); + return QString("%1 TAS").arg((speed + 7) * 10); + } + + QString decodeSpeedTrueMetric() + { + int speed = getBits(7); + return QString("%1 KMTAS").arg((speed + 10) * 10); + } + + QString decodeSpeedGround() + { + int speed = getBits(6); + return QString("%1 GS").arg((speed + 7) * 10); + } + + QString decodeSpeedGroundMetric() + { + int speed = getBits(8); + return QString("%1 KMGS").arg((speed + 10) * 10); + } + + QString decodeSpeedMach() + { + int speed = getBits(5); + return QString("%M").arg((speed + 61) / 100.0f, 0, 'f', 2); + } + + QString decodeSpeedMachLarge() + { + int speed = getBits(9); + return QString("%1M").arg((speed + 93) / 100.0f, 0, 'f', 2); + } + + QString decodeTime() + { + QString timeHours = decodeTimeHours(); + QString timeMinutes = decodeTimeMinutes(); + return timeHours + ":" + timeMinutes; + } + + QString decodeTimeHours() + { + int h = getBits(5); + return QString("%1").arg(h, 2, 10, QChar('0')); + } + + QString decodeTimeMinutes() + { + int m = getBits(6); + return QString("%1").arg(m, 2, 10, QChar('0')); + } + + QString decodeTimeSeconds() + { + int s = getBits(6); + return QString("%1").arg(s, 2, 10, QChar('0')); + } + + QString decodeToFrom() + { + int dir = getBits(1); + if (dir == 0) { + return "TO"; + } else { + return "FROM"; + } + } + + QString decodeRemainingFuel() + { + QString timeHours = decodeTimeHours(); + QString timeMinutes = decodeTimeMinutes(); + return timeHours + ":" + timeMinutes; + } + + QString decodeRouteClearance() + { + bool flag0 = getBits(1); + bool flag1 = getBits(1); + bool flag2 = getBits(1); + bool flag3 = getBits(1); + bool flag4 = getBits(1); + bool flag5 = getBits(1); + bool flag6 = getBits(1); + bool flag7 = getBits(1); + bool flag8 = getBits(1); + bool flag9 = getBits(1); + QString s; + if (flag0) { + s.append("\nAirportDeparture: " + decodeAirport()); + } + if (flag1) { + s.append("\nAirportDestination: " + decodeAirport()); + } + if (flag2) { + s.append("\nRunwayDeparture: " + decodeRunway()); + } + if (flag3) { + s.append("\nProcedureDeparture: " + decodeProcedureName()); + } + if (flag4) { + s.append("\nRunwayArrival: " + decodeRunway()); + } + if (flag5) { + s.append("\nProcedureApproach: " + decodeProcedureName()); + } + if (flag6) { + s.append("\nProcedureArrival: " + decodeProcedureName()); + } + if (flag7) { + s.append("\nAirwayIntercept: " + decodeAirwayIntercept()); + } + if (flag8) { + int size = getBits(7) + 1; + s.append("\nRouteInformation: "); + for (int i = 0; i < size; i++) { + s.append(decodeRouteInformation() + " "); + } + } + if (flag9) { + s.append("\nRouteInformationAdditional: " + decodeRouteInformationAdditional()); + } + return s; + } + + QString decodePublishedIdentifier() + { + bool flag = getBits(1); + QString s = decodeFixName(); + if (flag) { + s.append(" " + decodeLatitudeLongitude()); + } + return s; + } + + QString decodeRemainingSouls() + { + int souls = getBits(10); + return QString::number(souls + 1); + } + + QString decodeVersionNumber() + { + int version = getBits(4); + return QString::number(version); + } + + QString decodeRunway() + { + QString runwayDirection = decodeRunwayDirection(); + QString runwayConfiguration = decodeRunwayConfiguration(); + return runwayDirection + runwayConfiguration; + } + + QString decodeRunwayDirection() + { + int dir = getBits(6); + return QString::number(dir); + } + + QString decodeRunwayConfiguration() + { + int cfg = getBits(2); + QStringList cfgs = {"L", "R", "C", ""}; + return cfgs[cfg]; + } + + QString decodeAirwayIntercept() + { + int size = getBits(3) + 1; + return decodeIA5String(size); + } + + QString decodeRouteInformation() + { + int type = getBits(3); + switch (type) + { + case 0: + return decodePublishedIdentifier(); + case 1: + return decodeLatitudeLongitude(); + case 2: + return decodePlaceBearingPlaceBearing(); + case 3: + return decodePlaceBearingDistance(); + case 4: + return decodeAirwayIdentifier(); + case 5: + return decodeTrackDetail(); + default: + return QString("UNKOWN ROUTE INFORMATION TYPE %1").arg(type); + } + } + + QString decodePlaceBearing() + { + bool flag = getBits(1); + QString s = decodeFixName(); + if (flag) { + s.append(" " + decodeLatitudeLongitude()); + } + s.append(" " + decodeDegrees()); + return s; + } + + QString decodePlaceBearingPlaceBearing() + { + QString placeBearing1 = decodePlaceBearing(); + QString placeBearing2 = decodePlaceBearing(); + return placeBearing1 + " " + placeBearing2; + } + + QString decodeAirwayIdentifier() + { + int size = getBits(3) + 1; + return decodeIA5String(size); + } + + QString decodeTrackDetail() + { + int size = getBits(7) + 1; + QString s; + for (int i = 0; i < size; i++) { + s.append(" " + decodeLatitudeLongitude()); + } + return s; + } + + QString decodeTrackName() + { + int size = getBits(2) + 3; + return decodeIA5String(size); + } + + QString decodeSupplementaryInformation() + { + return ""; + } + + QString decodeRouteInformationAdditional() + { + return ""; + } + +}; + +#endif // INCLUDE_DO219_H diff --git a/sdrbase/util/osndb.cpp b/sdrbase/util/osndb.cpp index a96ddbffe..0e594b920 100644 --- a/sdrbase/util/osndb.cpp +++ b/sdrbase/util/osndb.cpp @@ -41,6 +41,7 @@ QMutex AircraftInformation::m_mutex; QSharedPointer<const QHash<int, AircraftInformation *>> OsnDB::m_aircraftInformation; QSharedPointer<const QHash<QString, AircraftInformation *>> OsnDB::m_aircraftInformationByReg; QSharedPointer<const QHash<QString, AircraftRouteInformation *>> OsnDB::m_aircraftRouteInformation; +QRecursiveMutex OsnDB::m_dbMutex; QDateTime OsnDB::m_modifiedDateTime; @@ -100,6 +101,8 @@ void OsnDB::downloadFinished(const QString& filename, bool success) QSharedPointer<const QHash<int, AircraftInformation *>> OsnDB::getAircraftInformation() { + QMutexLocker locker(&m_dbMutex); + QFileInfo fastFileInfo(getFastDBFilename()); QFileInfo fullFileInfo(getOSNDBFilename()); QDateTime fastModifiedDateTime = fastFileInfo.lastModified(); @@ -134,12 +137,16 @@ QSharedPointer<const QHash<int, AircraftInformation *>> OsnDB::getAircraftInform QSharedPointer<const QHash<QString, AircraftInformation *>> OsnDB::getAircraftInformationByReg() { + QMutexLocker locker(&m_dbMutex); + getAircraftInformation(); return m_aircraftInformationByReg; } QSharedPointer<const QHash<QString, AircraftRouteInformation *>> OsnDB::getAircraftRouteInformation() { + QMutexLocker locker(&m_dbMutex); + if (!m_aircraftRouteInformation) { m_aircraftRouteInformation = QSharedPointer<const QHash<QString, AircraftRouteInformation *>>(OsnDB::readRouteDB(getRouteDBFilename())); } diff --git a/sdrbase/util/osndb.h b/sdrbase/util/osndb.h index 00aa3dfbb..6c9f981d9 100644 --- a/sdrbase/util/osndb.h +++ b/sdrbase/util/osndb.h @@ -141,6 +141,8 @@ private: static QSharedPointer<const QHash<QString, AircraftInformation *>> m_aircraftInformationByReg; static QSharedPointer<const QHash<QString, AircraftRouteInformation *>> m_aircraftRouteInformation; static QDateTime m_modifiedDateTime; + // Guards the loading and replacement of the three databases above. + static QRecursiveMutex m_dbMutex; // Write a reduced size and validated version of the DB, so it loads quicker static bool writeFastDB(const QString &filename, const QHash<int, AircraftInformation *> *aircraftInfo); diff --git a/sdrbase/util/ourairportsdb.cpp b/sdrbase/util/ourairportsdb.cpp index 8d616afb4..be3afd4ad 100644 --- a/sdrbase/util/ourairportsdb.cpp +++ b/sdrbase/util/ourairportsdb.cpp @@ -26,9 +26,14 @@ #include "util/ourairportsdb.h" +// The file has 19 columns today and gains one occasionally, so this is the ceiling +// rather than the count - a row with more simply keeps the ones that fit +#define MAX_CSV_FIELDS 32 + QMutex OurAirportsDB::m_mutex; QSharedPointer<QHash<int, AirportInformation *>> OurAirportsDB::m_airportsById; QSharedPointer<QHash<QString, AirportInformation *>> OurAirportsDB::m_airportsByIdent; +QSharedPointer<QHash<QString, AirportInformation *>> OurAirportsDB::m_airportsByIata; QDateTime OurAirportsDB::m_modifiedDateTime; AirportInformation::~AirportInformation() @@ -121,6 +126,14 @@ QSharedPointer<const QHash<QString, AirportInformation *>> OurAirportsDB::getAir return m_airportsByIdent; } +QSharedPointer<const QHash<QString, AirportInformation *>> OurAirportsDB::getAirportsByIata() +{ + QMutexLocker locker(&m_mutex); + + readDB(); + return m_airportsByIata; +} + void OurAirportsDB::readDB() { QFileInfo airportDBFileInfo(getAirportDBFilename()); @@ -141,11 +154,19 @@ void OurAirportsDB::readDB() } ); OurAirportsDB::readFrequenciesDB(getAirportFrequenciesDBFilename(), airportsById.get()); - QSharedPointer<QHash<QString, AirportInformation *>> airportsByIdent(identHash(airportsById.get())); + QSharedPointer<QHash<QString, AirportInformation *>> airportsByIdent( + identHash(airportsById.get()), + [airportsById](QHash<QString, AirportInformation *> *index) { delete index; } + ); + QSharedPointer<QHash<QString, AirportInformation *>> airportsByIata( + iataHash(airportsById.get()), + [airportsById](QHash<QString, AirportInformation *> *index) { delete index; } + ); - // Replace both indexes together only after the new database was loaded successfully. + // Replace all three indexes together only after the new database was loaded successfully. m_airportsById = airportsById; m_airportsByIdent = airportsByIdent; + m_airportsByIata = airportsByIata; m_modifiedDateTime = airportDBModifiedDateTime; } } @@ -180,6 +201,57 @@ QString OurAirportsDB::trimQuotes(const QString s) // Read OurAirport's airport CSV file // See comments for readOSNDB +// One CSV row into its fields, in place, keeping the empty ones. +// +// strtok cannot do this: it treats a run of delimiters as one, so a row with an empty +// field loses it and every column after it shifts left. 83,575 of the 83,000-odd rows in +// this file have at least one - "no",,,"00AA" is an airport with neither an ICAO nor an +// IATA code - so anything read from beyond the first empty field came out as its +// neighbour. It went unnoticed because everything read here used to live in the first +// seven columns, before any of them. +// +// Quotes are respected, since a name may contain a comma. The fields keep their quotes; +// the caller strips them as it already did. +static int splitCsvRow(char *row, char **fields, int maxFields) +{ + int count = 0; + char *p = row; + + while (count < maxFields) + { + fields[count++] = p; + + bool quoted = false; + while (*p && (quoted || ((*p != ',') && (*p != '\n') && (*p != '\r')))) + { + if (*p == '"') { + quoted = !quoted; + } + p++; + } + const bool more = (*p == ','); + *p = '\0'; + if (!more) { + break; + } + p++; + } + return count; +} + +// A quoted field without its quotes, and an empty string for a field that has none +static QString csvField(const char *field) +{ + if (!field || !*field) { + return QString(); + } + QString value = QString(field); + if (value.startsWith('"') && value.endsWith('"') && (value.size() >= 2)) { + value = value.mid(1, value.size() - 2); + } + return value; +} + QHash<int, AirportInformation *> *OurAirportsDB::readAirportsDB(const QString &filename) { int cnt = 0; @@ -193,6 +265,7 @@ QHash<int, AirportInformation *> *OurAirportsDB::readAirportsDB(const QString &f int latitudeCol = 4; int longitudeCol = 5; int elevationCol = 6; + int iataCol = 13; qDebug() << "OurAirportsDB::readAirportsDB: " << filename; @@ -209,121 +282,67 @@ QHash<int, AirportInformation *> *OurAirportsDB::readAirportsDB(const QString &f airportInfo->reserve(70000); // Read header - int idx = 0; - char *p = strtok(row, ","); - while (p != NULL) + char *headerFields[MAX_CSV_FIELDS]; + const int headerCount = splitCsvRow(row, headerFields, MAX_CSV_FIELDS); + for (int idx = 0; idx < headerCount; idx++) { - if (!strcmp(p, "id")) + const QString name = csvField(headerFields[idx]); + if (name == "id") idCol = idx; - else if (!strcmp(p, "ident")) + else if (name == "ident") identCol = idx; - else if (!strcmp(p, "type")) + else if (name == "type") typeCol = idx; - else if (!strcmp(p, "name")) + else if (name == "name") nameCol = idx; - else if (!strcmp(p, "latitude_deg")) + else if (name == "latitude_deg") latitudeCol = idx; - else if (!strcmp(p, "longitude_deg")) + else if (name == "longitude_deg") longitudeCol = idx; - else if (!strcmp(p, "elevation_ft")) + else if (name == "elevation_ft") elevationCol = idx; - p = strtok(NULL, ","); - idx++; + else if (name == "iata_code") + iataCol = idx; } // Read data + char *fields[MAX_CSV_FIELDS]; while (fgets(row, sizeof(row), file)) { - int id = 0; - char *idString = NULL; - char *ident = NULL; - size_t identLen = 0; - char *type = NULL; - size_t typeLen = 0; - char *name = NULL; - size_t nameLen = 0; - float latitude = 0.0f; - char *latitudeString = NULL; - size_t latitudeLen = 0; - float longitude = 0.0f; - char *longitudeString = NULL; - size_t longitudeLen = 0; - float elevation = 0.0f; - char *elevationString = NULL; - size_t elevationLen = 0; - - p = strtok(row, ","); - idx = 0; - while (p != NULL) + const int count = splitCsvRow(row, fields, MAX_CSV_FIELDS); + + auto value = [&fields, count](int column) { - // Read strings, stripping quotes - if (idx == idCol) - { - idString = p; - idString[strlen(idString)] = '\0'; - id = strtol(idString, NULL, 10); - } - else if (idx == identCol) - { - ident = p+1; - identLen = strlen(ident)-1; - ident[identLen] = '\0'; - } - else if (idx == typeCol) - { - type = p+1; - typeLen = strlen(type)-1; - type[typeLen] = '\0'; - } - else if (idx == nameCol) - { - name = p+1; - nameLen = strlen(name)-1; - name[nameLen] = '\0'; - } - else if (idx == latitudeCol) - { - latitudeString = p; - latitudeLen = strlen(latitudeString)-1; - latitudeString[latitudeLen] = '\0'; - latitude = cLocale.toFloat(latitudeString); - } - else if (idx == longitudeCol) - { - longitudeString = p; - longitudeLen = strlen(longitudeString)-1; - longitudeString[longitudeLen] = '\0'; - longitude = cLocale.toFloat(longitudeString); - } - else if (idx == elevationCol) - { - elevationString = p; - elevationLen = strlen(elevationString)-1; - elevationString[elevationLen] = '\0'; - elevation = cLocale.toFloat(elevationString); - } - p = strtok(NULL, ","); - idx++; - } + return ((column >= 0) && (column < count)) ? csvField(fields[column]) + : QString(); + }; + + const QString type = value(typeCol); + const QString latitudeString = value(latitudeCol); + const QString longitudeString = value(longitudeCol); + const float latitude = cLocale.toFloat(latitudeString); + const float longitude = cLocale.toFloat(longitudeString); // Only create the entry if we have some interesting data - if (((latitude != 0.0f) || (longitude != 0.0f)) && (type && strcmp(type, "closed"))) + if (((latitude != 0.0f) || (longitude != 0.0f)) && (type != "closed")) { AirportInformation *airport = new AirportInformation(); - airport->m_id = id; - airport->m_ident = QString(ident); - if (!strcmp(type, "small_airport")) { + airport->m_id = value(idCol).toInt(); + airport->m_ident = value(identCol); + airport->m_iata = value(iataCol); + if (type == "small_airport") { airport->m_type = AirportInformation::AirportType::Small; - } else if (!strcmp(type, "medium_airport")) { + } else if (type == "medium_airport") { airport->m_type = AirportInformation::AirportType::Medium; - } else if (!strcmp(type, "large_airport")) { + } else if (type == "large_airport") { airport->m_type = AirportInformation::AirportType::Large; - } else if (!strcmp(type, "heliport")) { + } else if (type == "heliport") { airport->m_type = AirportInformation::AirportType::Heliport; } - airport->m_name = QString(name); + airport->m_name = value(nameCol); airport->m_latitude = latitude; airport->m_longitude = longitude; - airport->m_elevation = elevation; + airport->m_elevation = cLocale.toFloat(value(elevationCol)); + const int id = airport->m_id; airportInfo->insert(id, airport); cnt++; } @@ -353,6 +372,31 @@ QHash<QString, AirportInformation *> *OurAirportsDB::identHash(QHash<int, Airpor return out; } +// Create hash table using the three letter IATA code as key +// +// Only the airports that have one, which is a small minority - the file holds every +// airstrip and heliport, and an IATA code belongs to somewhere with scheduled service. +// Where two claim the same code the larger wins: they are not quite unique in the data, +// and a loadsheet means the airline one. +QHash<QString, AirportInformation *> *OurAirportsDB::iataHash(QHash<int, AirportInformation *> *in) +{ + QHash<QString, AirportInformation *> *out = new QHash<QString, AirportInformation *>(); + QHashIterator<int, AirportInformation *> i(*in); + while (i.hasNext()) + { + i.next(); + AirportInformation *info = i.value(); + if (info->m_iata.size() != 3) { + continue; + } + AirportInformation *existing = out->value(info->m_iata, nullptr); + if (!existing || (info->m_type > existing->m_type)) { + out->insert(info->m_iata, info); + } + } + return out; +} + // Read OurAirport's airport frequencies CSV file bool OurAirportsDB::readFrequenciesDB(const QString &filename, QHash<int, AirportInformation *> *airportInfo) { diff --git a/sdrbase/util/ourairportsdb.h b/sdrbase/util/ourairportsdb.h index c24179aae..530f04af7 100644 --- a/sdrbase/util/ourairportsdb.h +++ b/sdrbase/util/ourairportsdb.h @@ -49,7 +49,8 @@ public: }; int m_id; - QString m_ident; + QString m_ident; //!< ICAO, four characters + QString m_iata; //!< IATA, three characters - empty for most airports AirportType m_type; QString m_name; float m_latitude; @@ -74,12 +75,15 @@ public: static QSharedPointer<const QHash<int, AirportInformation *>> getAirportsById(); static QSharedPointer<const QHash<QString, AirportInformation *>> getAirportsByIdent(); + //!< Keyed on the three letter IATA code, which is how a loadsheet writes an airport + static QSharedPointer<const QHash<QString, AirportInformation *>> getAirportsByIata(); private: HttpDownloadManager m_dlm; static QSharedPointer<QHash<int, AirportInformation *>> m_airportsById; static QSharedPointer<QHash<QString, AirportInformation *>> m_airportsByIdent; + static QSharedPointer<QHash<QString, AirportInformation *>> m_airportsByIata; static QDateTime m_modifiedDateTime; static QMutex m_mutex; @@ -94,6 +98,7 @@ private: // Create hash table using ICAO identifier as key static QHash<QString, AirportInformation *> *identHash(QHash<int, AirportInformation *> *in); + static QHash<QString, AirportInformation *> *iataHash(QHash<int, AirportInformation *> *in); // Read OurAirport's airport frequencies CSV file static bool readFrequenciesDB(const QString &filename, QHash<int, AirportInformation *> *airportInfo); diff --git a/sdrbase/util/profiler.cpp b/sdrbase/util/profiler.cpp index 2ffc1fa3e..18f1e9131 100644 --- a/sdrbase/util/profiler.cpp +++ b/sdrbase/util/profiler.cpp @@ -25,7 +25,7 @@ #include "profiler.h" QHash<QString, ProfileData> GlobalProfileData::m_profileData; -QMutex GlobalProfileData::m_mutex; +QRecursiveMutex GlobalProfileData::m_mutex; QElapsedTimer GlobalProfileData::m_startTimer; // Format a time in nanoseconds as the Profile dialog does diff --git a/sdrbase/util/profiler.h b/sdrbase/util/profiler.h index 69cfa15ea..58991ee4e 100644 --- a/sdrbase/util/profiler.h +++ b/sdrbase/util/profiler.h @@ -134,7 +134,7 @@ public: private: static QHash<QString, ProfileData> m_profileData; - static QMutex m_mutex; + static QRecursiveMutex m_mutex; static QElapsedTimer m_startTimer; }; diff --git a/sdrbase/util/selcaldb.cpp b/sdrbase/util/selcaldb.cpp index d7fe89ba8..ff006bca6 100644 --- a/sdrbase/util/selcaldb.cpp +++ b/sdrbase/util/selcaldb.cpp @@ -35,6 +35,7 @@ #include "util/csv.h" QSharedPointer<const QMultiHash<QString, QString>> SELCALDB::m_registrations; +QSharedPointer<const QHash<QString, QString>> SELCALDB::m_codes; QDateTime SELCALDB::m_modifiedDateTime; QMutex SELCALDB::m_mutex; @@ -182,12 +183,29 @@ QSharedPointer<const QMultiHash<QString, QString>> SELCALDB::getRegistrations() { m_registrations = QSharedPointer<const QMultiHash<QString, QString>>(registrations); m_modifiedDateTime = modifiedDateTime; + + QHash<QString, QString> *codes = new QHash<QString, QString>(); + for (auto it = registrations->constBegin(); it != registrations->constEnd(); ++it) + { + QString& held = (*codes)[it.value()]; + if (!held.split(", ").contains(it.key())) { + held = held.isEmpty() ? it.key() : held + ", " + it.key(); + } + } + m_codes = QSharedPointer<const QHash<QString, QString>>(codes); } } return m_registrations; } +QSharedPointer<const QHash<QString, QString>> SELCALDB::getCodesByRegistration() +{ + getRegistrations(); // Loads, or reloads after a download, both tables together + QMutexLocker locker(&m_mutex); + return m_codes; +} + QStringList SELCALDB::getRegistrations(const QString& code) { QSharedPointer<const QMultiHash<QString, QString>> registrations = getRegistrations(); diff --git a/sdrbase/util/selcaldb.h b/sdrbase/util/selcaldb.h index 0607e662f..f8d068453 100644 --- a/sdrbase/util/selcaldb.h +++ b/sdrbase/util/selcaldb.h @@ -50,6 +50,11 @@ public: // Registrations of aircraft assigned a code, in file order. static QStringList getRegistrations(const QString& code); + // The other way round: the codes assigned to each registration, joined with ", " + // where an aircraft has more than one. Built with the forward table, so it reloads + // with it. Null if the database has not been downloaded. + static QSharedPointer<const QHash<QString, QString>> getCodesByRegistration(); + // Code in the form AB-CD, with each pair in tone designation order, or an // empty string if it is not a valid code. static QString normalizeCode(const QString& code); @@ -63,6 +68,7 @@ private: HttpDownloadManager m_dlm; static QSharedPointer<const QMultiHash<QString, QString>> m_registrations; + static QSharedPointer<const QHash<QString, QString>> m_codes; static QDateTime m_modifiedDateTime; static QMutex m_mutex; diff --git a/sdrbase/util/sidstar.cpp b/sdrbase/util/sidstar.cpp new file mode 100644 index 000000000..207f43139 --- /dev/null +++ b/sdrbase/util/sidstar.cpp @@ -0,0 +1,358 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include "sidstar.h" + +#include <algorithm> + +#include <QDebug> +#include <QFile> +#include <QFileInfo> +#include <QMutexLocker> +#include <QStandardPaths> + +#if (QT_VERSION < QT_VERSION_CHECK(6, 6, 0)) +#include <QtGui/private/qzipreader_p.h> +#else +#include <QtCore/private/qzipreader_p.h> +#endif + +QSharedPointer<SidStar::ProcedureMap> SidStar::m_procedures; +QDateTime SidStar::m_sidStarModifiedDateTime; +QMutex SidStar::m_mutex; + +SidStar::SidStar(QObject *parent) : + QObject(parent) +{ + connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &SidStar::downloadFinished); +} + +SidStar::~SidStar() +{ + disconnect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &SidStar::downloadFinished); +} + +QString SidStar::procedureKey(const QString& airport, const QString& procedure) +{ + return airport.trimmed().toUpper() + QChar(0x1f) + procedure.trimmed().toUpper(); +} + +// Whether a procedure name is one a flight plan would have to shorten. +// +// An ARINC 424 procedure identifier is the significant fix, a validity digit and a route +// letter, and it is limited to six characters. A five letter fix makes seven - ROXOG, 1, +// H - so the fix is truncated to four and the plan files ROXO1H where the procedure is +// really ROXOG1H. +static bool truncatableProcedure(const QString& procedure) +{ + if (procedure.size() != 7) { + return false; + } + + for (int i = 0; i < 5; i++) + { + if (!procedure[i].isLetter()) { + return false; + } + } + + return procedure[5].isDigit() && procedure[6].isLetter(); +} + +SidStar::ProcedureMap *SidStar::readCSV(const QString& filename) +{ + ProcedureMap *procedures = new ProcedureMap(); + QFile file(filename); + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + qWarning() << "SidStar::readCSV: Could not open" << filename << "for reading."; + return procedures; + } + + const QList<QByteArray> requiredColumns { + "country", + "airport", + "procedure_type", + "procedure", + "sequence", + "waypoint", + "latitude", + "longitude", + "minimum_altitude_ft", + "maximum_altitude_ft" + }; + QByteArray headerLine = file.readLine(); + + while (headerLine.endsWith('\n') || headerLine.endsWith('\r')) { + headerLine.chop(1); + } + + const QList<QByteArray> header = headerLine.split(','); + QHash<QByteArray, int> columns; + + for (const QByteArray& column : requiredColumns) + { + const int index = header.indexOf(column); + + if (index < 0) + { + qWarning() << "SidStar::readCSV: Missing column" << column << "in" << filename; + return procedures; + } + + columns.insert(column, index); + } + + int highestColumn = 0; + + for (const QByteArray& column : requiredColumns) { + highestColumn = std::max(highestColumn, columns.value(column)); + } + + const int countryColumn = columns.value("country"); + const int airportColumn = columns.value("airport"); + const int procedureTypeColumn = columns.value("procedure_type"); + const int procedureColumn = columns.value("procedure"); + const int sequenceColumn = columns.value("sequence"); + const int waypointColumn = columns.value("waypoint"); + const int latitudeColumn = columns.value("latitude"); + const int longitudeColumn = columns.value("longitude"); + const int minimumAltitudeColumn = columns.value("minimum_altitude_ft"); + const int maximumAltitudeColumn = columns.value("maximum_altitude_ft"); + int invalidRows = 0; + int pointCount = 0; + + // These fields are identifiers and numbers and do not contain quoted commas, + // so line-based parsing is substantially faster than the generic CSV reader. + while (!file.atEnd()) + { + QByteArray line = file.readLine(); + + while (line.endsWith('\n') || line.endsWith('\r')) { + line.chop(1); + } + + const QList<QByteArray> fields = line.split(','); + + if (fields.size() <= highestColumn) + { + invalidRows++; + continue; + } + + bool sequenceValid; + bool latitudeValid; + bool longitudeValid; + SidStarPoint point; + + point.m_country = QString::fromUtf8(fields[countryColumn]); + point.m_airport = QString::fromUtf8(fields[airportColumn]); + point.m_procedureType = QString::fromUtf8(fields[procedureTypeColumn]); + point.m_procedure = QString::fromUtf8(fields[procedureColumn]); + point.m_sequence = fields[sequenceColumn].toInt(&sequenceValid); + point.m_waypoint = QString::fromUtf8(fields[waypointColumn]); + point.m_latitude = fields[latitudeColumn].toFloat(&latitudeValid); + point.m_longitude = fields[longitudeColumn].toFloat(&longitudeValid); + point.m_minimumAltitudeFt = fields[minimumAltitudeColumn].toInt(&point.m_hasMinimumAltitude); + point.m_maximumAltitudeFt = fields[maximumAltitudeColumn].toInt(&point.m_hasMaximumAltitude); + + if (!sequenceValid || !latitudeValid || !longitudeValid) + { + invalidRows++; + continue; + } + + (*procedures)[procedureKey(point.m_airport, point.m_procedure)].append(point); + pointCount++; + } + + ProcedureMap::iterator procedure = procedures->begin(); + + while (procedure != procedures->end()) + { + QList<SidStarPoint>& points = procedure.value(); + std::sort(points.begin(), points.end(), [](const SidStarPoint& a, const SidStarPoint& b) { + const int typeOrder = QString::compare(a.m_procedureType, b.m_procedureType, Qt::CaseInsensitive); + + if (typeOrder != 0) { + return typeOrder < 0; + } + + return a.m_sequence < b.m_sequence; + }); + ++procedure; + } + + // Index the six character form a flight plan would file as well as the full name, + // so that a plan naming ROXO1H finds ROXOG1H. See truncatableProcedure(). + // + // Only where it is unambiguous, which on the current data means always: of the 1475 + // procedures long enough to be truncated, no two at the same airport shorten to the + // same thing and none of them collides with a procedure that is genuinely six + // characters. Both are checked rather than assumed, because an alias that shadowed a + // real procedure would draw the wrong route rather than none - a worse failure than + // the one this fixes. + QHash<QString, QString> aliases; //!< Short form -> the one full name, or empty + const QList<QString> keys = procedures->keys(); + + for (const QString& key : keys) + { + const int split = key.indexOf(QChar(0x1f)); + + if (split < 0) { + continue; + } + + const QString procedure = key.mid(split + 1); + + if (!truncatableProcedure(procedure)) { + continue; + } + + const QString shortKey = procedureKey(key.left(split), + procedure.left(4) + procedure.mid(5)); + + // A procedure that really is six characters keeps its own name + if (procedures->contains(shortKey)) { + continue; + } + + // Two full names shortening to one - neither gets the alias + aliases.insert(shortKey, aliases.contains(shortKey) ? QString() : key); + } + + int aliasCount = 0; + + for (auto alias = aliases.cbegin(); alias != aliases.cend(); ++alias) + { + if (alias.value().isEmpty()) { + qWarning() << "SidStar::readCSV: Ambiguous shortened procedure" << alias.key() + << "- not indexed"; + continue; + } + + procedures->insert(alias.key(), procedures->value(alias.value())); + aliasCount++; + } + + qDebug() << "SidStar::readCSV: Read" << pointCount << "points in" + << procedures->size() - aliasCount << "procedures from" << filename + << "with" << aliasCount << "shortened names also indexed"; + + if (invalidRows > 0) { + qWarning() << "SidStar::readCSV: Ignored" << invalidRows << "invalid rows in" << filename; + } + + return procedures; +} + +QList<SidStarPoint> SidStar::getWaypoints( + const QString& procedure, + const QString& airport, + const QString& procedureType +) +{ + QMutexLocker locker(&m_mutex); + const QDateTime fileDateTime = getSidStarModifiedDateTime(); + + if (!m_procedures || (fileDateTime > m_sidStarModifiedDateTime)) + { + m_procedures = QSharedPointer<ProcedureMap>(readCSV(getSidStarFilename())); + m_sidStarModifiedDateTime = fileDateTime; + } + + const QList<SidStarPoint> points = m_procedures->value(procedureKey(airport, procedure)); + + if (procedureType.isEmpty()) { + return points; + } + + QList<SidStarPoint> matchingPoints; + matchingPoints.reserve(points.size()); + + for (const SidStarPoint& point : points) + { + if (point.m_procedureType.compare(procedureType, Qt::CaseInsensitive) == 0) { + matchingPoints.append(point); + } + } + + return matchingPoints; +} + +QString SidStar::getDataDir() +{ + const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); + return locations[0]; +} + +QString SidStar::getSidStarZipFilename() +{ + return getDataDir() + "/sidstar.zip"; +} + +QString SidStar::getSidStarFilename() +{ + return getDataDir() + "/sidstar.csv"; +} + +QDateTime SidStar::getSidStarModifiedDateTime() +{ + const QFileInfo fileInfo(getSidStarFilename()); + return fileInfo.lastModified(); +} + +void SidStar::downloadSidStar() +{ + const QString filename = getSidStarZipFilename(); + const QString urlString = SIDSTAR_URL; + const QUrl url(urlString); + + qDebug() << "SidStar::downloadSidStar: Downloading" << urlString; + emit downloadingURL(urlString); + m_dlm.download(url, filename); +} + +void SidStar::downloadFinished(const QString& filename, bool success) +{ + if (!success) + { + qWarning() << "SidStar::downloadFinished: Failed to download:" << filename; + emit downloadError(QString("Failed to download: %1").arg(filename)); + } + else if (filename == getSidStarZipFilename()) + { + QZipReader reader(filename); + + if (reader.extractAll(getDataDir())) + { + emit downloadSidStarFinished(); + } + else + { + qWarning() << "SidStar::downloadFinished: Failed to extract files from" << filename; + emit downloadError(QString("Failed to extract files from %1").arg(filename)); + } + } + else + { + qWarning() << "SidStar::downloadFinished: Unexpected filename:" << filename; + emit downloadError(QString("Unexpected filename: %1").arg(filename)); + } +} diff --git a/sdrbase/util/sidstar.h b/sdrbase/util/sidstar.h new file mode 100644 index 000000000..dd773734a --- /dev/null +++ b/sdrbase/util/sidstar.h @@ -0,0 +1,98 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_SIDSTAR_H +#define INCLUDE_SIDSTAR_H + +#include <QDateTime> +#include <QHash> +#include <QList> +#include <QMutex> +#include <QObject> +#include <QSharedPointer> +#include <QString> + +#include "export.h" +#include "util/httpdownloadmanager.h" + +#define SIDSTAR_URL "https://www.sdrangel.org/downloads/sidstar.zip" + +// One ordered waypoint in a standard instrument departure or arrival procedure. +struct SDRBASE_API SidStarPoint +{ + QString m_country; + QString m_airport; + QString m_procedureType; + QString m_procedure; + int m_sequence = 0; + QString m_waypoint; + float m_latitude = 0.0f; + float m_longitude = 0.0f; + bool m_hasMinimumAltitude = false; + int m_minimumAltitudeFt = 0; + bool m_hasMaximumAltitude = false; + int m_maximumAltitudeFt = 0; +}; + +// Aviation standard instrument departures (SIDs) and standard terminal arrival +// routes (STARs). +class SDRBASE_API SidStar : public QObject +{ + Q_OBJECT + +public: + SidStar(QObject *parent = nullptr); + ~SidStar(); + + void downloadSidStar(); + + // Returns the procedure's points in sequence order. procedureType may be + // "SID" or "STAR" when an airport uses the same name for both; without + // it, both groups are returned in type and then sequence order. + static QList<SidStarPoint> getWaypoints( + const QString& procedure, + const QString& airport, + const QString& procedureType = QString() + ); + +private: + typedef QHash<QString, QList<SidStarPoint>> ProcedureMap; + + HttpDownloadManager m_dlm; + + static QSharedPointer<ProcedureMap> m_procedures; + static QDateTime m_sidStarModifiedDateTime; + static QMutex m_mutex; + + static ProcedureMap *readCSV(const QString& filename); + static QString procedureKey(const QString& airport, const QString& procedure); + static QString getDataDir(); + static QString getSidStarZipFilename(); + static QString getSidStarFilename(); + static QDateTime getSidStarModifiedDateTime(); + +private slots: + void downloadFinished(const QString& filename, bool success); + +signals: + void downloadingURL(const QString& url); + void downloadError(const QString& error); + void downloadSidStarFinished(); +}; + +#endif // INCLUDE_SIDSTAR_H diff --git a/sdrbase/util/waypoints.cpp b/sdrbase/util/waypoints.cpp index e368a59ef..6733bbe32 100644 --- a/sdrbase/util/waypoints.cpp +++ b/sdrbase/util/waypoints.cpp @@ -1,5 +1,6 @@ /////////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2024 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -28,6 +29,7 @@ #endif #include "waypoints.h" +#include "bglwaypointreader.h" #include "csv.h" namespace { @@ -61,10 +63,22 @@ QMultiHash<QString, Waypoint *> *Waypoint::readCSV(const QString &filename) QStringList cols; while(CSV::readRow(in, &cols)) { + if ((cols.size() < 3) || cols[0].startsWith('#')) { + continue; + } + + bool latitudeOk; + bool longitudeOk; + const float latitude = cols[1].toFloat(&latitudeOk); + const float longitude = cols[2].toFloat(&longitudeOk); + if (cols[0].isEmpty() || !latitudeOk || !longitudeOk) { + continue; + } + Waypoint *waypoint = new Waypoint(); waypoint->m_name = cols[0]; - waypoint->m_latitude = cols[1].toFloat(); - waypoint->m_longitude = cols[2].toFloat(); + waypoint->m_latitude = latitude; + waypoint->m_longitude = longitude; waypoints->insert(waypoint->m_name, waypoint); } @@ -77,6 +91,11 @@ QMultiHash<QString, Waypoint *> *Waypoint::readCSV(const QString &filename) return waypoints; } +QMultiHash<QString, Waypoint *> *Waypoint::readBGL(const QString& path, QStringList *errors) +{ + return BGLWaypointReader::read(path, errors); +} + QSharedPointer<QMultiHash<QString, Waypoint *>> Waypoints::m_waypoints; QDateTime Waypoints::m_waypointsModifiedDateTime; @@ -177,6 +196,46 @@ QDateTime Waypoints::getWaypointsModifiedDateTime() // Find a waypoint by name. If the name is ambiguous, use nearby waypoint names // to select the candidate closest to the surrounding route. +const Waypoint *Waypoints::findWayPoint(const QString& name, const QList<QGeoCoordinate>& nearby) +{ + const QList<Waypoint *> matches = m_waypoints->values(name); + + if (matches.isEmpty()) { + return nullptr; + } + + if ((matches.size() == 1) || nearby.isEmpty()) { + return matches.constFirst(); + } + + const Waypoint *closest = matches.constFirst(); + double closestDistance = std::numeric_limits<double>::max(); + + for (const Waypoint *candidate : matches) + { + const QGeoCoordinate at(candidate->m_latitude, candidate->m_longitude); + double totalDistance = 0.0; + int nearbyCount = 0; + + for (const QGeoCoordinate& position : nearby) + { + if (!position.isValid()) { + continue; + } + totalDistance += at.distanceTo(position); + nearbyCount++; + } + + if ((nearbyCount > 0) && ((totalDistance / nearbyCount) < closestDistance)) + { + closest = candidate; + closestDistance = totalDistance / nearbyCount; + } + } + + return closest; +} + const Waypoint *Waypoints::findWayPoint(const QString& name, const QStringList& nearby) { const QList<Waypoint *> matches = m_waypoints->values(name); diff --git a/sdrbase/util/waypoints.h b/sdrbase/util/waypoints.h index 72872a9ef..8742c8a47 100644 --- a/sdrbase/util/waypoints.h +++ b/sdrbase/util/waypoints.h @@ -1,5 +1,6 @@ /////////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2021-2024 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -22,6 +23,7 @@ #include <QStringList> #include <QFile> #include <QMultiHash> +#include <QGeoCoordinate> #include <stdio.h> #include <string.h> @@ -41,6 +43,7 @@ struct SDRBASE_API Waypoint { float m_longitude; static QMultiHash<QString, Waypoint *> *readCSV(const QString &filename); + static QMultiHash<QString, Waypoint *> *readBGL(const QString& path, QStringList *errors = nullptr); }; class SDRBASE_API Waypoints : public QObject { @@ -53,6 +56,12 @@ public: void downloadWaypoints(); static const Waypoint* findWayPoint(const QString& name, const QStringList& nearby = QStringList()); + // The same choice made against positions rather than names. Needed wherever the + // fixes around a name are things no waypoint database holds - an oceanic clearance + // surrounds its named entry point with bare latitudes and longitudes - because the + // name form can only score against names it can itself look up, and scores nothing + // at all when it cannot. + static const Waypoint* findWayPoint(const QString& name, const QList<QGeoCoordinate>& nearby); static QSharedPointer<const QMultiHash<QString, Waypoint *>> getWaypoints(); private: diff --git a/sdrbase/util/whittakereilers.cpp b/sdrbase/util/whittakereilers.cpp index c0ef44cac..43156a592 100644 --- a/sdrbase/util/whittakereilers.cpp +++ b/sdrbase/util/whittakereilers.cpp @@ -172,18 +172,19 @@ void WhittakerEilers::filter(const double *xi, double *yi, const double *w, cons } // Backward substituion C \ (C' \ (w .* y)); - b = za; + // Reads za directly. This used to be written "b = za;", which repointed the + // member at za's allocation - so dealloc() freed za twice and leaked the real b. i = m - 1; - zb[i] = b[i] / ca[i * 3]; + zb[i] = za[i] / ca[i * 3]; i = m - 2; sum = ca[i * 3 + 1] * zb[i + 1]; - zb[i] = (b[i] - sum) / ca[i * 3]; + zb[i] = (za[i] - sum) / ca[i * 3]; for (i = m - 2; i >= 1; i--) { sum = ca[(i - 1) * 3 + 2] * zb[i + 1] + ca[(i - 1) * 3 + 1] * zb[i]; - zb[i-1] = (b[i - 1] - sum) / ca[(i - 1) * 3]; + zb[i-1] = (za[i - 1] - sum) / ca[(i - 1) * 3]; } if (std::isnan(zb[0])) { diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 758754315..e03615b55 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -4853,7 +4853,13 @@ bool WebAPIRequestMapper::getChannelSettings( << " channelSettingsKey: " << channelSettingsKey << " channelSettingsKeys: " << channelSettingsKeys; - if (channelSettingsKey == "ADSBDemodSettings") + if (channelSettingsKey == "ACARSDemodSettings") + { + channelSettings->setAcarsDemodSettings(new SWGSDRangel::SWGACARSDemodSettings()); + channelSettings->getAcarsDemodSettings()->init(); + channelSettings->getAcarsDemodSettings()->fromJsonObject(settingsJsonObject); + } + else if (channelSettingsKey == "ADSBDemodSettings") { channelSettings->setAdsbDemodSettings(new SWGSDRangel::SWGADSBDemodSettings()); channelSettings->getAdsbDemodSettings()->init(); @@ -5775,6 +5781,12 @@ bool WebAPIRequestMapper::getFeatureSettings( featureSettings->setAisSettings(new SWGSDRangel::SWGAISSettings()); featureSettings->getAisSettings()->fromJsonObject(settingsJsonObject); } + else if (featureSettingsKey == "AircraftSettings") + { + featureSettings->setAircraftSettings(new SWGSDRangel::SWGAircraftSettings()); + featureSettings->getAircraftSettings()->init(); // fromJsonObject() fills the lists init() allocates + featureSettings->getAircraftSettings()->fromJsonObject(settingsJsonObject); + } else if (featureSettingsKey == "AntennaToolsSettings") { featureSettings->setAntennaToolsSettings(new SWGSDRangel::SWGAntennaToolsSettings()); @@ -5905,6 +5917,11 @@ bool WebAPIRequestMapper::getFeatureActions( featureActions->setAfcActions(new SWGSDRangel::SWGAFCActions()); featureActions->getAfcActions()->fromJsonObject(actionsJsonObject); } + else if (featureActionsKey == "AircraftActions") + { + featureActions->setAircraftActions(new SWGSDRangel::SWGAircraftActions()); + featureActions->getAircraftActions()->fromJsonObject(actionsJsonObject); + } else if (featureActionsKey == "AMBEActions") { featureActions->setAmbeActions(new SWGSDRangel::SWGAMBEActions()); @@ -6103,6 +6120,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings& { channelSettings.cleanup(); channelSettings.setChannelType(nullptr); + channelSettings.setAcarsDemodSettings(nullptr); channelSettings.setAdsbDemodSettings(nullptr); channelSettings.setAisDemodSettings(nullptr); channelSettings.setAisModSettings(nullptr); @@ -6157,6 +6175,7 @@ void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& chan { channelReport.cleanup(); channelReport.setChannelType(nullptr); + channelReport.setAcarsDemodReport(nullptr); channelReport.setAdsbDemodReport(nullptr); channelReport.setAisDemodReport(nullptr); channelReport.setAisModReport(nullptr); @@ -6235,6 +6254,7 @@ void WebAPIRequestMapper::resetFeatureSettings(SWGSDRangel::SWGFeatureSettings& { featureSettings.cleanup(); featureSettings.setFeatureType(nullptr); + featureSettings.setAircraftSettings(nullptr); featureSettings.setAisSettings(nullptr); featureSettings.setAntennaToolsSettings(nullptr); featureSettings.setAprsSettings(nullptr); @@ -6257,6 +6277,7 @@ void WebAPIRequestMapper::resetFeatureReport(SWGSDRangel::SWGFeatureReport& feat featureReport.cleanup(); featureReport.setFeatureType(nullptr); featureReport.setAfcReport(nullptr); + featureReport.setAircraftReport(nullptr); featureReport.setFreqDisplayReport(nullptr); featureReport.setGs232ControllerReport(nullptr); featureReport.setPerTesterReport(nullptr); @@ -6275,6 +6296,7 @@ void WebAPIRequestMapper::resetFeatureActions(SWGSDRangel::SWGFeatureActions& fe featureActions.cleanup(); featureActions.setFeatureType(nullptr); featureActions.setAfcActions(nullptr); + featureActions.setAircraftActions(nullptr); featureActions.setGs232ControllerActions(nullptr); featureActions.setMapActions(nullptr); featureActions.setPerTesterActions(nullptr); diff --git a/sdrbase/webapi/webapiutils.cpp b/sdrbase/webapi/webapiutils.cpp index 0681004b4..138a132fe 100644 --- a/sdrbase/webapi/webapiutils.cpp +++ b/sdrbase/webapi/webapiutils.cpp @@ -22,6 +22,7 @@ #include "webapiutils.h" const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = { + {"sdrangel.channel.acarsdemod", "ACARSDemodSettings"}, {"sdrangel.channel.adsbdemod", "ADSBDemodSettings"}, {"sdrangel.channel.modais", "AISModSettings"}, {"sdrangel.channel.aisdemod", "AISDemodSettings"}, @@ -164,6 +165,7 @@ const QMap<QString, QString> WebAPIUtils::m_deviceIdToSettingsKey = { }; const QMap<QString, QString> WebAPIUtils::m_channelTypeToSettingsKey = { + {"ACARSDemod", "ACARSDemodSettings"}, {"ADSBDemod", "ADSBDemodSettings"}, {"AISDemod", "AISDemodSettings"}, {"AISMod", "AISModSettings"}, @@ -343,6 +345,7 @@ const QMap<QString, QString> WebAPIUtils::m_mimoDeviceHwIdToActionsKey = { const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = { {"AFC", "AFCSettings"}, {"AIS", "AISSettings"}, + {"Aircraft", "AircraftSettings"}, {"AMBE", "AMBESettings"}, {"AntennaTools", "AntennaToolsSettings"}, {"APRS", "APRSSettings"}, @@ -367,6 +370,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = { const QMap<QString, QString> WebAPIUtils::m_featureTypeToActionsKey = { {"AFC", "AFCActions"}, + {"Aircraft", "AircraftActions"}, {"AMBE", "AMBEActions"}, {"GS232Controller", "GS232ControllerActions"}, {"LimeRFE", "LimeRFEActions"}, @@ -386,6 +390,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToActionsKey = { const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = { {"sdrangel.feature.afc", "AFCSettings"}, {"sdrangel.feature.ais", "AISSSettings"}, + {"sdrangel.feature.aircraft", "AircraftSettings"}, {"sdrangel.feature.ambe", "AMBESSettings"}, {"sdrangel.feature.antennatools", "AntennaToolsSettings"}, {"sdrangel.feature.aprs", "APRSSettings"}, diff --git a/sdrgui/CMakeLists.txt b/sdrgui/CMakeLists.txt index 1d844fe63..c1339ef15 100644 --- a/sdrgui/CMakeLists.txt +++ b/sdrgui/CMakeLists.txt @@ -41,6 +41,8 @@ set(sdrgui_SOURCES gui/messagedialog.cpp gui/dialpopup.cpp gui/dmsspinbox.cpp + gui/fastheaderview.cpp + gui/fastitemdelegate.cpp gui/editcommanddialog.cpp gui/externalclockbutton.cpp gui/externalclockdialog.cpp @@ -157,6 +159,8 @@ set(sdrgui_SOURCES set(sdrgui_HEADERS mainwindow.h gui/aboutdialog.h + gui/fastheaderview.h + gui/fastitemdelegate.h gui/accessiblevaluedial.h gui/accessiblevaluedialz.h gui/acarsmessageview.h diff --git a/sdrgui/gui/acarsmessageview.cpp b/sdrgui/gui/acarsmessageview.cpp index 9f32642e2..fdf9f0840 100644 --- a/sdrgui/gui/acarsmessageview.cpp +++ b/sdrgui/gui/acarsmessageview.cpp @@ -75,7 +75,7 @@ AcarsMessageView::AcarsMessageView(QWidget *parent) : {"SID", "Standard Instrument Departure"}, {"SMI", "Standard Message Identifier"}, {"STAR", "Standard Terminal Arrival Route"}, - {"SITA", "Société Internationale de Télécommunications Aéronautiques"}, + {"SITA", "Society Internationale de Telecommunications Aeronautiques"}, {"TCAS", "Traffic Alert/Collision Avoidance System"}, {"TEI", "Text Element Identifier"}, {"TWI", "Terminal Weather Information"}, @@ -237,8 +237,8 @@ AcarsMessageView::AcarsMessageView(QWidget *parent) : {"SVC", "Unable to Deliver Uplink Messages"}, {"DLA", "Delay Message"}, {"DIV", "Diversion Report"}, - {"JRE", "Refuel – Administrative and General Purpose"}, - {"JRF", "Refuel – CG Targeting"}, + {"JRE", "Refuel � Administrative and General Purpose"}, + {"JRF", "Refuel � CG Targeting"}, {"NSR", "Network Statistics Report/Request"}, {"NPR", "VHF Performance Report/Request"}, {"APR", "LRU Configuration Report/Request"}, diff --git a/sdrgui/gui/fastheaderview.cpp b/sdrgui/gui/fastheaderview.cpp new file mode 100644 index 000000000..e887f4be4 --- /dev/null +++ b/sdrgui/gui/fastheaderview.cpp @@ -0,0 +1,94 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include <QAbstractItemModel> +#include <QPainter> +#include <QPolygon> + +#include "gui/fastheaderview.h" + +FastHeaderView::FastHeaderView(Qt::Orientation orientation, QWidget *parent) : + QHeaderView(orientation, parent) +{ + setSectionsClickable(true); + setHighlightSections(false); +} + +void FastHeaderView::paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const +{ + if (!rect.isValid()) { + return; + } + + const QPalette &pal = palette(); + painter->fillRect(rect, pal.brush(QPalette::Button)); + + // A single separator on the trailing edge, where Fusion draws its outline + painter->setPen(pal.color(QPalette::Mid)); + if (orientation() == Qt::Horizontal) { + painter->drawLine(rect.right(), rect.top() + 2, rect.right(), rect.bottom() - 2); + } else { + painter->drawLine(rect.left() + 2, rect.bottom(), rect.right() - 2, rect.bottom()); + } + painter->drawLine(rect.bottomLeft(), rect.bottomRight()); + + const QAbstractItemModel *m = model(); + if (!m) { + return; + } + + QRect content = rect.adjusted(4, 0, -4, 0); + + // The sort arrow, drawn as a small triangle rather than by the style + if (isSortIndicatorShown() && (sortIndicatorSection() == logicalIndex) + && (orientation() == Qt::Horizontal) && (content.width() > 12)) + { + const int size = 6; + const int x = content.right() - size; + const int y = content.center().y() - (size / 4); + QPolygon arrow; + if (sortIndicatorOrder() == Qt::AscendingOrder) { + arrow << QPoint(x, y + (size / 2)) << QPoint(x + size, y + (size / 2)) << QPoint(x + size / 2, y - (size / 2)); + } else { + arrow << QPoint(x, y - (size / 2)) << QPoint(x + size, y - (size / 2)) << QPoint(x + size / 2, y + (size / 2)); + } + painter->setBrush(pal.color(QPalette::ButtonText)); + painter->setPen(Qt::NoPen); + painter->drawPolygon(arrow); + content.setRight(x - 3); + } + + if (content.width() <= 0) { + return; + } + + const QVariant text = m->headerData(logicalIndex, orientation(), Qt::DisplayRole); + if (!text.isValid()) { + return; + } + + const QVariant alignment = m->headerData(logicalIndex, orientation(), Qt::TextAlignmentRole); + int flags = alignment.isValid() ? alignment.toInt() + : (int) ((orientation() == Qt::Horizontal ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignVCenter); + + painter->setPen(pal.color(QPalette::ButtonText)); + painter->setBrush(Qt::NoBrush); + painter->setFont(font()); + painter->drawText(content, flags, + fontMetrics().elidedText(text.toString(), Qt::ElideRight, content.width())); +} diff --git a/sdrgui/gui/fastheaderview.h b/sdrgui/gui/fastheaderview.h new file mode 100644 index 000000000..18056af75 --- /dev/null +++ b/sdrgui/gui/fastheaderview.h @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef SDRGUI_GUI_FASTHEADERVIEW_H +#define SDRGUI_GUI_FASTHEADERVIEW_H + +#include <QHeaderView> + +#include "export.h" + +// Draws header sections without going through QStyle, for the same reason as FastItemDelegate +class SDRGUI_API FastHeaderView : public QHeaderView { + Q_OBJECT + +public: + + FastHeaderView(Qt::Orientation orientation, QWidget *parent = nullptr); + +protected: + + void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const override; + +}; + +#endif // SDRGUI_GUI_FASTHEADERVIEW_H diff --git a/sdrgui/gui/fastitemdelegate.cpp b/sdrgui/gui/fastitemdelegate.cpp new file mode 100644 index 000000000..fb47cea30 --- /dev/null +++ b/sdrgui/gui/fastitemdelegate.cpp @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#include <QPainter> + +#include "gui/fastitemdelegate.h" + +void FastItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + // Check boxes, and anything else below, are left to the style: they are rare in the + // tables this is used on, and the point here is the common cell, not completeness + if (index.data(Qt::CheckStateRole).isValid()) + { + QStyledItemDelegate::paint(painter, option, index); + return; + } + + QStyleOptionViewItem opt = option; + initStyleOption(&opt, index); + + const bool selected = opt.state.testFlag(QStyle::State_Selected); + const QPalette::ColorGroup group = opt.state.testFlag(QStyle::State_Enabled) + ? (opt.state.testFlag(QStyle::State_Active) ? QPalette::Active : QPalette::Inactive) + : QPalette::Disabled; + + // Background. The view asks for alternating rows through the option rather than + // painting them itself, so that has to be honoured here + if (selected) { + painter->fillRect(opt.rect, opt.palette.brush(group, QPalette::Highlight)); + } else if (opt.backgroundBrush.style() != Qt::NoBrush) { + painter->fillRect(opt.rect, opt.backgroundBrush); + } else if (opt.features.testFlag(QStyleOptionViewItem::Alternate)) { + painter->fillRect(opt.rect, opt.palette.brush(group, QPalette::AlternateBase)); + } + + // A small inset, as the style leaves, so text does not touch the cell edge + QRect content = opt.rect.adjusted(3, 0, -3, 0); + if (content.width() <= 0) { + return; + } + + if (!opt.icon.isNull()) + { + const QSize size = opt.icon.actualSize(opt.decorationSize); + const QRect iconRect(content.left(), + content.top() + (content.height() - size.height()) / 2, + size.width(), size.height()); + opt.icon.paint(painter, iconRect, Qt::AlignLeft | Qt::AlignVCenter, + selected ? QIcon::Selected : QIcon::Normal); + content.setLeft(iconRect.right() + 4); + } + + if (!opt.text.isEmpty() && (content.width() > 0)) + { + painter->setPen(opt.palette.color(group, selected ? QPalette::HighlightedText : QPalette::Text)); + int alignment = opt.displayAlignment; + if ((alignment & Qt::AlignHorizontal_Mask) == 0) { + alignment |= Qt::AlignLeft; + } + if ((alignment & Qt::AlignVertical_Mask) == 0) { + alignment |= Qt::AlignVCenter; + } + painter->setFont(opt.font); + const QString text = opt.fontMetrics.elidedText(opt.text, opt.textElideMode, content.width()); + painter->drawText(content, alignment, text); + } +} diff --git a/sdrgui/gui/fastitemdelegate.h b/sdrgui/gui/fastitemdelegate.h new file mode 100644 index 000000000..c8983bb0c --- /dev/null +++ b/sdrgui/gui/fastitemdelegate.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> // +// Some code by AI // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see <http://www.gnu.org/licenses/>. // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef SDRGUI_GUI_FASTITEMDELEGATE_H +#define SDRGUI_GUI_FASTITEMDELEGATE_H + +#include <QStyledItemDelegate> + +#include "export.h" + +// Draws a table cell without going through QStyle. +// +// On Windows, QStyledItemDelegate::paint() asks Windows whether +// high contrast is on - SystemParametersInfo(SPI_GETHIGHCONTRAST), uncached. +// That costs 28-170 us. At one call per cell, a table showing a few hundred cells costs +// 15-50 ms every time it repaints. +// +// So these cells are drawn directly: background, icon, text. Anything with a check box, +// or an editor open, falls back to the full implementation, since those are rare enough +// not to matter and not worth reimplementing. +class SDRGUI_API FastItemDelegate : public QStyledItemDelegate { + Q_OBJECT + +public: + + explicit FastItemDelegate(QObject *parent = nullptr) : + QStyledItemDelegate(parent) + { } + + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + +}; + +#endif // SDRGUI_GUI_FASTITEMDELEGATE_H diff --git a/sdrgui/gui/glspectrumview.cpp b/sdrgui/gui/glspectrumview.cpp index a298b5e55..866013713 100644 --- a/sdrgui/gui/glspectrumview.cpp +++ b/sdrgui/gui/glspectrumview.cpp @@ -5432,6 +5432,15 @@ void GLSpectrumView::tick() if (m_displayChanged) { + // Qt only skips painting widgets that are hidden, not ones that are covered, so + // a spectrum behind another subwindow or under a floating workspace still gets + // repainted at the full rate. The paint itself is not the expense: on a window + // holding a QQuickWidget or QWebEngineView, every repaint makes Qt composite the + // whole window through the RHI. + if (!isVisible() || window()->isMinimized() || visibleRegion().isEmpty()) { + return; + } + m_displayChanged = false; update(); } diff --git a/sdrgui/gui/levelmeter.cpp b/sdrgui/gui/levelmeter.cpp index 54c08b759..f5cd748dc 100644 --- a/sdrgui/gui/levelmeter.cpp +++ b/sdrgui/gui/levelmeter.cpp @@ -75,6 +75,10 @@ const int PeakHoldLevelDuration = 2000; // ms LevelMeter::LevelMeter(QWidget *parent) : QWidget(parent) + , m_paintedAvg(-1) + , m_paintedPeak(-1) + , m_paintedHold(-1) + , m_updatePending(false) , m_avgLevel(0.0) , m_peakLevel(0.0) , m_decayedPeakLevel(0.0) @@ -105,6 +109,27 @@ void LevelMeter::reset() { m_avgLevel = 0.0; m_peakLevel = 0.0; + requestUpdate(); +} + +void LevelMeter::requestUpdate() +{ + if (m_updatePending) { + return; + } + // A hidden meter is still fed by its channel's tick. Qt would discard the repaint, + // but asking for it still marks the window dirty + if (!isVisible()) { + return; + } + if ((levelPixel(m_avgLevel) == m_paintedAvg) + && (levelPixel(m_decayedPeakLevel) == m_paintedPeak) + && (levelPixel(m_peakHoldLevel) == m_paintedHold)) + { + return; + } + + m_updatePending = true; update(); } @@ -125,7 +150,13 @@ void LevelMeter::levelChanged(qreal avgLevel, qreal peakLevel, int numSamples) m_peakHoldLevelChanged.start(); } - update(); + // The redraw timer exists to animate the peak decaying between readings. A reading + // has just arrived, so restart it rather than let it free run: otherwise its ticks + // interleave with these and the meter asks for half as many repaints again as there + // is new data to show + m_redrawTimer->start(RedrawInterval); + + requestUpdate(); } void LevelMeter::redrawTimerExpired() @@ -142,7 +173,13 @@ void LevelMeter::redrawTimerExpired() if (m_peakHoldLevelChanged.elapsed() > PeakHoldLevelDuration) m_peakHoldLevel = 0.0; - update(); + // Nothing left to decay or hold, so there is nothing for the timer to animate until + // the next reading arrives, which restarts it + if ((m_decayedPeakLevel == 0.0) && (m_peakHoldLevel == 0.0)) { + m_redrawTimer->stop(); + } + + requestUpdate(); } void LevelMeter::paintEvent(QPaintEvent *event) @@ -151,6 +188,13 @@ void LevelMeter::paintEvent(QPaintEvent *event) QPainter painter(this); render(&painter); + + // Record what is now on screen, so the next reading can tell whether it would + // change anything + m_paintedAvg = levelPixel(m_avgLevel); + m_paintedPeak = levelPixel(m_decayedPeakLevel); + m_paintedHold = levelPixel(m_peakHoldLevel); + m_updatePending = false; } void LevelMeter::resizeEvent(QResizeEvent * event) @@ -158,6 +202,10 @@ void LevelMeter::resizeEvent(QResizeEvent * event) Q_UNUSED(event) resized(); + // Pixel positions from the old width say nothing about the new one + m_paintedAvg = -1; + m_paintedPeak = -1; + m_paintedHold = -1; } void LevelMeter::setAverageSmoothing(uint32_t smoothingFactor) @@ -302,6 +350,14 @@ LevelMeterSignalDB::LevelMeterSignalDB(QWidget *parent) : m_scaleEngine.setOrientation(Qt::Horizontal); m_scaleEngine.setRange(Unit::Decibel, -100, 0); + // render() draws an opaque background pixmap over the whole widget, so nothing + // underneath can show through. Saying so stops Qt repainting the parent beneath this + // widget on every level change - and with it every sibling the repaint touches. + // Each channel GUI updates its meter 20 times a second, and the profile showed the + // whole settings container being redrawn at that rate: every button, dial and label, + // at 60-100 us each through the Fusion style + setAttribute(Qt::WA_OpaquePaintEvent, true); + resized(); } diff --git a/sdrgui/gui/levelmeter.h b/sdrgui/gui/levelmeter.h index f7fe300c5..4b799442b 100644 --- a/sdrgui/gui/levelmeter.h +++ b/sdrgui/gui/levelmeter.h @@ -96,6 +96,26 @@ protected slots: void redrawTimerExpired(); protected: + /** Repaint only if the meter would actually look different. */ + void requestUpdate(); + + /** Position of a level in pixels, as the renders below compute it */ + int levelPixel(qreal level) const + { + return (int) (width() - (1.0 - levelScale() * level) * width()); + } + + /** Fraction of the width the bars span: the VU meter uses three quarters of it */ + virtual qreal levelScale() const { return 1.0; } + + /** Levels, in pixels, as of the last paint, to compare the current ones against */ + int m_paintedAvg; + int m_paintedPeak; + int m_paintedHold; + + /** A repaint already asked for will show the newest levels, so do not ask again */ + bool m_updatePending; + /** * Height of RMS level bar. * Range 0.0 - 1.0. @@ -169,6 +189,7 @@ public: protected: virtual void render(QPainter *painter); virtual void resized(); + virtual qreal levelScale() const override { return 0.75; } }; class SDRGUI_API LevelMeterSignalDB : public LevelMeter diff --git a/sdrgui/gui/profiledialog.cpp b/sdrgui/gui/profiledialog.cpp index 70934bb40..a7c813443 100644 --- a/sdrgui/gui/profiledialog.cpp +++ b/sdrgui/gui/profiledialog.cpp @@ -23,12 +23,20 @@ #include "ui_profiledialog.h" #include "gui/nanosecondsdelegate.h" #include "util/profiler.h" +#include "gui/fastitemdelegate.h" ProfileDialog::ProfileDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ProfileDialog) { ui->setupUi(this); + + ui->table->setItemDelegate(new FastItemDelegate(ui->table)); + + ui->table->setItemDelegateForColumn(COL_TOTAL, new NanoSecondsDelegate()); + ui->table->setItemDelegateForColumn(COL_AVERAGE, new NanoSecondsDelegate()); + ui->table->setItemDelegateForColumn(COL_LAST, new NanoSecondsDelegate()); + ui->table->setItemDelegateForColumn(COL_MAX, new NanoSecondsDelegate()); connect(&m_timer, &QTimer::timeout, this, &ProfileDialog::updateData); resizeTable(); m_timer.start(500); @@ -58,12 +66,12 @@ void ProfileDialog::resizeTable() int row = ui->table->rowCount(); ui->table->setRowCount(row + 1); ui->table->setItem(row, COL_NAME, new QTableWidgetItem("Random-SDR[0] Spectrum @12345678910")); - ui->table->setItem(row, COL_TOTAL, new QTableWidgetItem("1000.000 ms")); - ui->table->setItem(row, COL_PERCENT, new QTableWidgetItem("100.0")); - ui->table->setItem(row, COL_AVERAGE, new QTableWidgetItem("1000.000 ns/frame")); - ui->table->setItem(row, COL_LAST, new QTableWidgetItem("1000.000 ms")); - ui->table->setItem(row, COL_MAX, new QTableWidgetItem("1000.000 ms")); - ui->table->setItem(row, COL_NUM_SAMPLES, new QTableWidgetItem("1000000000")); + ui->table->setItem(row, COL_TOTAL, new QTableWidgetItem("8000.000 ms")); + ui->table->setItem(row, COL_PERCENT, new QTableWidgetItem("800.0")); + ui->table->setItem(row, COL_AVERAGE, new QTableWidgetItem("8000.000 ns/frame")); + ui->table->setItem(row, COL_LAST, new QTableWidgetItem("8000.000 ms")); + ui->table->setItem(row, COL_MAX, new QTableWidgetItem("8000.000 ms")); + ui->table->setItem(row, COL_NUM_SAMPLES, new QTableWidgetItem("8000000000")); ui->table->resizeColumnsToContents(); ui->table->setRowCount(row); } @@ -71,7 +79,14 @@ void ProfileDialog::resizeTable() // Update table with latest profile data void ProfileDialog::updateData() { - QHash<QString, ProfileData>& profileData = GlobalProfileData::getProfileData(); + // Copy, then release: every PROFILER_STOP in every thread takes this same lock, so + // holding it while the table is rebuilt stops the whole application for as long as + // that takes - and distorts the very measurements the dialog exists to show + const QHash<QString, ProfileData> profileData = [] { + const QHash<QString, ProfileData> copy = GlobalProfileData::getProfileData(); + GlobalProfileData::releaseProfileData(); + return copy; + }(); const double runTime = GlobalProfileData::getMSSinceStart() * 1e6; // ns QHashIterator<QString, ProfileData> itr(profileData); @@ -140,17 +155,10 @@ void ProfileDialog::updateData() max->setData(Qt::DisplayRole, maxTime); numSamples->setData(Qt::DisplayRole, data.getNumSamples()); - ui->table->setItemDelegateForColumn(COL_TOTAL, new NanoSecondsDelegate()); - ui->table->setItemDelegateForColumn(COL_AVERAGE, new NanoSecondsDelegate()); - ui->table->setItemDelegateForColumn(COL_LAST, new NanoSecondsDelegate()); - ui->table->setItemDelegateForColumn(COL_MAX, new NanoSecondsDelegate()); - ui->table->setSortingEnabled(true); } } - GlobalProfileData::releaseProfileData(); - qint64 msecSinceStart = GlobalProfileData::getMSSinceStart(); QString s; diff --git a/sdrgui/gui/rollupcontents.cpp b/sdrgui/gui/rollupcontents.cpp index a966bb9f3..008811e03 100644 --- a/sdrgui/gui/rollupcontents.cpp +++ b/sdrgui/gui/rollupcontents.cpp @@ -141,13 +141,28 @@ int RollupContents::arrangeRollups() // We use minimumSizeHint for auto-calculated width, so // minimumWidth can be set by user in .ui file - m_minimumSizeHint.setHeight(pos); - m_minimumSizeHint.setWidth(minWidthHint); + // A layout request that changes nothing has to stay free: anything updating a + // widget in a rollup, such as a QLabel showing a live value, invalidates the + // layout on every change, and that arrives here several times a second. Track + // whether this pass actually alters anything, so the propagation below can be + // skipped when it does not + bool changed = false; + const QSize newMinimumSizeHint(minWidthHint, pos); + + if (newMinimumSizeHint != m_minimumSizeHint) + { + m_minimumSizeHint = newMinimumSizeHint; + changed = true; + } // However, we need to set minimumHeight, as the value in the .ui // files is typically set as the minimum height for when widget is unrolled // but when rolled-up, we want it to be smaller - setMinimumHeight(pos); + if (minimumHeight() != pos) + { + setMinimumHeight(pos); + changed = true; + } // Split extra space equally between widgets // If there's a remainder, we give it to the first widget @@ -178,8 +193,6 @@ int RollupContents::arrangeRollups() if (!r->isHidden()) { - r->move(2, pos + 3); - int h = 0; if (r->hasHeightForWidth()) { h = r->heightForWidth(width() - 4); @@ -193,18 +206,32 @@ int RollupContents::arrangeRollups() firstExtra = 0; } - r->resize(width() - 4, h); + const QRect target(2, pos + 3, width() - 4, h); + + if (r->geometry() != target) + { + r->setGeometry(target); + changed = true; + } pos += r->height() + 5; } } } - if (expandingChildren == 0) { - setMaximumHeight(pos); - } else { - setMaximumHeight(16777215); + const int newMaximumHeight = (expandingChildren == 0) ? pos : 16777215; + + if (maximumHeight() != newMaximumHeight) + { + setMaximumHeight(newMaximumHeight); + changed = true; + } + + // updateGeometry() posts a layout request to the parent, which comes back here, so + // calling it unconditionally turns one live value update into a repeating relayout + // of the whole channel window + if (changed) { + updateGeometry(); } - updateGeometry(); return pos; } diff --git a/swagger/sdrangel/api/swagger/include/ACARSDemod.yaml b/swagger/sdrangel/api/swagger/include/ACARSDemod.yaml index 74107940d..52a326da0 100644 --- a/swagger/sdrangel/api/swagger/include/ACARSDemod.yaml +++ b/swagger/sdrangel/api/swagger/include/ACARSDemod.yaml @@ -5,11 +5,14 @@ ACARSDemodSettings: type: integer format: int64 mode: - description: "Which protocol to demodulate: 0 ACARS, 1 VDL Mode 2, 2 HFDL, 3 Inmarsat Classic Aero" + description: "Which protocol to demodulate: 0 ACARS, 1 VDL Mode 2, 2 HFDL, 3 Inmarsat Classic Aero, 4 Iridium" type: integer aeroChannel: description: "Which Aero rate and channel is tuned. 0 600 bps P, 1 1200 bps P, 2 10500 bps P, 3 600 bps R, 4 1200 bps R, 5 600 bps T, 6 1200 bps T. Only used when mode is 3" type: integer + iridiumBandwidth: + description: "How much of the band the Iridium scanner covers: 0 1 MHz, 1 2 MHz, 2 4 MHz, 3 8 MHz. The device has to be able to supply the width chosen. Only used when mode is 4" + type: integer rfBandwidth: type: number format: float @@ -48,32 +51,6 @@ ACARSDemodSettings: type: string logEnabled: type: integer - feedEnabled: - description: "Feed received messages to aggregators, in acarsdec style JSON (1 for yes, 0 for no)" - type: integer - feedStationId: - description: "Station identifier sent with each fed message" - type: string - feedAirframes: - description: "Feed to airframes.io (1 for yes, 0 for no)" - type: integer - feedAirframesHost: - type: string - feedAirframesPort: - type: integer - feedAirframesTcp: - description: "Use TCP rather than UDP for the airframes.io feed (1 for yes, 0 for no)" - type: integer - feedAvdelphi: - description: "Feed to airframes.io's avdelphi (1 for yes, 0 for no)" - type: integer - feedAvdelphiHost: - type: string - feedAvdelphiPort: - type: integer - feedAvdelphiTcp: - description: "Use TCP rather than UDP for the avdelphi feed (1 for yes, 0 for no)" - type: integer scopeCh1: description: "Which internal signal the scope shows on channel 1" type: integer diff --git a/swagger/sdrangel/api/swagger/include/Aircraft.yaml b/swagger/sdrangel/api/swagger/include/Aircraft.yaml index 9bd50ae61..01de8c6c1 100644 --- a/swagger/sdrangel/api/swagger/include/Aircraft.yaml +++ b/swagger/sdrangel/api/swagger/include/Aircraft.yaml @@ -31,6 +31,42 @@ AircraftSettings: displayChart: description: "Show the message rate chart (1 for yes, 0 for no)" type: integer + displayCoverage: + description: "Draw each protocol's polar coverage on the map (1 for yes, 0 for no)" + type: integer + useLiveryIcons: + description: "Use aircraft icons in airline liveries on the 2D map, rather than black icons (1 for yes, 0 for no)" + type: integer + feedEnabled: + description: "Feed received ACARS messages on to aggregators (1 for yes, 0 for no)" + type: integer + feedStationId: + description: "Station ident sent with each message fed to aggregators" + type: string + feedAirframes: + description: "Feed airframes.io (1 for yes, 0 for no)" + type: integer + feedAirframesHost: + description: "airframes.io feed host" + type: string + feedAirframesPort: + description: "airframes.io feed port" + type: integer + feedAirframesTcp: + description: "Feed airframes.io over TCP rather than UDP (1 for TCP, 0 for UDP)" + type: integer + feedAvdelphi: + description: "Feed avdelphi.com (1 for yes, 0 for no)" + type: integer + feedAvdelphiHost: + description: "avdelphi.com feed host" + type: string + feedAvdelphiPort: + description: "avdelphi.com feed port" + type: integer + feedAvdelphiTcp: + description: "Feed avdelphi.com over TCP rather than UDP (1 for TCP, 0 for UDP)" + type: integer databaseFilename: description: "Where the session database is kept. Empty for the default location" type: string diff --git a/swagger/sdrangel/api/swagger/include/Map.yaml b/swagger/sdrangel/api/swagger/include/Map.yaml index 81735742c..087176c47 100644 --- a/swagger/sdrangel/api/swagger/include/Map.yaml +++ b/swagger/sdrangel/api/swagger/include/Map.yaml @@ -382,7 +382,7 @@ MapItem: $ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapAircraftState" description: "Current states of aircraft tracked by the ADS-B demodulator." loopSound: - description: "Sound to loop while the item is on the 3D map, spatially located at the item. Either the name of an engine sound set (cfm, v2500, 777, 787, A380, jet), whose -n1/-n2/-idle recordings the map layers and mixes by phase of flight, or an audio file name from the Map's audio directory (e.g. helicopter.wav). Empty for none" + description: "Sound to loop while the item is on the 3D map, spatially located at the item. Either an engine sound-set directory below the configured 3d/Sounds directory, containing engine.json and OGG layers, or a legacy audio file name from the Map's bundled audio directory (e.g. helicopter.wav). Empty for none" type: string MapAnimation: @@ -452,6 +452,12 @@ MapCoordinate: MapAircraftState: description: "Aircraft state for PFD/ND" properties: + dateTime: + description: "Date and time at which this complete aircraft state applies (ISO 8601 extended format). When set, the Map preserves this sample instead of coalescing it with a later update." + type: string + icao: + description: "ICAO Mode S address of this aircraft as lower-case hex" + type: string callsign: type: string description: "Radio callsign." @@ -528,8 +534,17 @@ MapAircraftState: description: "0 unknown, 1 LNAV, APP (LOC)" type: integer tcasMode: - description: "-1 unknown, 0 Off, 1 TA, 2 TA/RA" - type: integer + description: "0 unknown, 1 Off, 2 TA only, 3 TA/RA" + type: integer + tcasRA: + description: "Active TCAS resolution advisory bitfield. 0 none, bit 0 active, bit 1 corrective (vs preventive), bit 2 downward sense (descend), bit 3 positive (vs vertical speed limit), bit 4 clear of conflict, bit 5 multiple threats, bit 6 opposite-sense multiple-threat coding" + type: integer + tcasThreatIcao: + description: "ICAO Mode S address of the RA threat aircraft as lower-case hex, empty if not identified" + type: string + squawk: + description: "Mode A squawk code as decimal digits (e.g. 7000), -1 for unknown" + type: integer windSpeed: type: number format: float @@ -608,4 +623,3 @@ MapRouteWaypoint: eta: description: "Estimated time over this waypoint (ISO 8601 extended format). Empty if unknown" type: string - diff --git a/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.cpp index 0cd68b2d4..b36850869 100644 --- a/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.cpp @@ -34,6 +34,8 @@ SWGACARSDemodSettings::SWGACARSDemodSettings() { m_mode_isSet = false; aero_channel = 0; m_aero_channel_isSet = false; + iridium_bandwidth = 0; + m_iridium_bandwidth_isSet = false; rf_bandwidth = 0.0f; m_rf_bandwidth_isSet = false; correlation_threshold = 0.0f; @@ -60,26 +62,6 @@ SWGACARSDemodSettings::SWGACARSDemodSettings() { m_log_filename_isSet = false; log_enabled = 0; m_log_enabled_isSet = false; - feed_enabled = 0; - m_feed_enabled_isSet = false; - feed_station_id = nullptr; - m_feed_station_id_isSet = false; - feed_airframes = 0; - m_feed_airframes_isSet = false; - feed_airframes_host = nullptr; - m_feed_airframes_host_isSet = false; - feed_airframes_port = 0; - m_feed_airframes_port_isSet = false; - feed_airframes_tcp = 0; - m_feed_airframes_tcp_isSet = false; - feed_avdelphi = 0; - m_feed_avdelphi_isSet = false; - feed_avdelphi_host = nullptr; - m_feed_avdelphi_host_isSet = false; - feed_avdelphi_port = 0; - m_feed_avdelphi_port_isSet = false; - feed_avdelphi_tcp = 0; - m_feed_avdelphi_tcp_isSet = false; scope_ch1 = 0; m_scope_ch1_isSet = false; scope_ch2 = 0; @@ -122,6 +104,8 @@ SWGACARSDemodSettings::init() { m_mode_isSet = false; aero_channel = 0; m_aero_channel_isSet = false; + iridium_bandwidth = 0; + m_iridium_bandwidth_isSet = false; rf_bandwidth = 0.0f; m_rf_bandwidth_isSet = false; correlation_threshold = 0.0f; @@ -148,26 +132,6 @@ SWGACARSDemodSettings::init() { m_log_filename_isSet = false; log_enabled = 0; m_log_enabled_isSet = false; - feed_enabled = 0; - m_feed_enabled_isSet = false; - feed_station_id = new QString(""); - m_feed_station_id_isSet = false; - feed_airframes = 0; - m_feed_airframes_isSet = false; - feed_airframes_host = new QString(""); - m_feed_airframes_host_isSet = false; - feed_airframes_port = 0; - m_feed_airframes_port_isSet = false; - feed_airframes_tcp = 0; - m_feed_airframes_tcp_isSet = false; - feed_avdelphi = 0; - m_feed_avdelphi_isSet = false; - feed_avdelphi_host = new QString(""); - m_feed_avdelphi_host_isSet = false; - feed_avdelphi_port = 0; - m_feed_avdelphi_port_isSet = false; - feed_avdelphi_tcp = 0; - m_feed_avdelphi_tcp_isSet = false; scope_ch1 = 0; m_scope_ch1_isSet = false; scope_ch2 = 0; @@ -205,6 +169,7 @@ SWGACARSDemodSettings::cleanup() { + if(filter != nullptr) { delete filter; } @@ -223,22 +188,6 @@ SWGACARSDemodSettings::cleanup() { } - if(feed_station_id != nullptr) { - delete feed_station_id; - } - - if(feed_airframes_host != nullptr) { - delete feed_airframes_host; - } - - - - if(feed_avdelphi_host != nullptr) { - delete feed_avdelphi_host; - } - - - if(title != nullptr) { @@ -281,6 +230,8 @@ SWGACARSDemodSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&aero_channel, pJson["aeroChannel"], "qint32", ""); + ::SWGSDRangel::setValue(&iridium_bandwidth, pJson["iridiumBandwidth"], "qint32", ""); + ::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", ""); ::SWGSDRangel::setValue(&correlation_threshold, pJson["correlationThreshold"], "float", ""); @@ -307,26 +258,6 @@ SWGACARSDemodSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&log_enabled, pJson["logEnabled"], "qint32", ""); - ::SWGSDRangel::setValue(&feed_enabled, pJson["feedEnabled"], "qint32", ""); - - ::SWGSDRangel::setValue(&feed_station_id, pJson["feedStationId"], "QString", "QString"); - - ::SWGSDRangel::setValue(&feed_airframes, pJson["feedAirframes"], "qint32", ""); - - ::SWGSDRangel::setValue(&feed_airframes_host, pJson["feedAirframesHost"], "QString", "QString"); - - ::SWGSDRangel::setValue(&feed_airframes_port, pJson["feedAirframesPort"], "qint32", ""); - - ::SWGSDRangel::setValue(&feed_airframes_tcp, pJson["feedAirframesTcp"], "qint32", ""); - - ::SWGSDRangel::setValue(&feed_avdelphi, pJson["feedAvdelphi"], "qint32", ""); - - ::SWGSDRangel::setValue(&feed_avdelphi_host, pJson["feedAvdelphiHost"], "QString", "QString"); - - ::SWGSDRangel::setValue(&feed_avdelphi_port, pJson["feedAvdelphiPort"], "qint32", ""); - - ::SWGSDRangel::setValue(&feed_avdelphi_tcp, pJson["feedAvdelphiTcp"], "qint32", ""); - ::SWGSDRangel::setValue(&scope_ch1, pJson["scopeCh1"], "qint32", ""); ::SWGSDRangel::setValue(&scope_ch2, pJson["scopeCh2"], "qint32", ""); @@ -380,6 +311,9 @@ SWGACARSDemodSettings::asJsonObject() { if(m_aero_channel_isSet){ obj->insert("aeroChannel", QJsonValue(aero_channel)); } + if(m_iridium_bandwidth_isSet){ + obj->insert("iridiumBandwidth", QJsonValue(iridium_bandwidth)); + } if(m_rf_bandwidth_isSet){ obj->insert("rfBandwidth", QJsonValue(rf_bandwidth)); } @@ -419,36 +353,6 @@ SWGACARSDemodSettings::asJsonObject() { if(m_log_enabled_isSet){ obj->insert("logEnabled", QJsonValue(log_enabled)); } - if(m_feed_enabled_isSet){ - obj->insert("feedEnabled", QJsonValue(feed_enabled)); - } - if(feed_station_id != nullptr && *feed_station_id != QString("")){ - toJsonValue(QString("feedStationId"), feed_station_id, obj, QString("QString")); - } - if(m_feed_airframes_isSet){ - obj->insert("feedAirframes", QJsonValue(feed_airframes)); - } - if(feed_airframes_host != nullptr && *feed_airframes_host != QString("")){ - toJsonValue(QString("feedAirframesHost"), feed_airframes_host, obj, QString("QString")); - } - if(m_feed_airframes_port_isSet){ - obj->insert("feedAirframesPort", QJsonValue(feed_airframes_port)); - } - if(m_feed_airframes_tcp_isSet){ - obj->insert("feedAirframesTcp", QJsonValue(feed_airframes_tcp)); - } - if(m_feed_avdelphi_isSet){ - obj->insert("feedAvdelphi", QJsonValue(feed_avdelphi)); - } - if(feed_avdelphi_host != nullptr && *feed_avdelphi_host != QString("")){ - toJsonValue(QString("feedAvdelphiHost"), feed_avdelphi_host, obj, QString("QString")); - } - if(m_feed_avdelphi_port_isSet){ - obj->insert("feedAvdelphiPort", QJsonValue(feed_avdelphi_port)); - } - if(m_feed_avdelphi_tcp_isSet){ - obj->insert("feedAvdelphiTcp", QJsonValue(feed_avdelphi_tcp)); - } if(m_scope_ch1_isSet){ obj->insert("scopeCh1", QJsonValue(scope_ch1)); } @@ -525,6 +429,16 @@ SWGACARSDemodSettings::setAeroChannel(qint32 aero_channel) { this->m_aero_channel_isSet = true; } +qint32 +SWGACARSDemodSettings::getIridiumBandwidth() { + return iridium_bandwidth; +} +void +SWGACARSDemodSettings::setIridiumBandwidth(qint32 iridium_bandwidth) { + this->iridium_bandwidth = iridium_bandwidth; + this->m_iridium_bandwidth_isSet = true; +} + float SWGACARSDemodSettings::getRfBandwidth() { return rf_bandwidth; @@ -655,106 +569,6 @@ SWGACARSDemodSettings::setLogEnabled(qint32 log_enabled) { this->m_log_enabled_isSet = true; } -qint32 -SWGACARSDemodSettings::getFeedEnabled() { - return feed_enabled; -} -void -SWGACARSDemodSettings::setFeedEnabled(qint32 feed_enabled) { - this->feed_enabled = feed_enabled; - this->m_feed_enabled_isSet = true; -} - -QString* -SWGACARSDemodSettings::getFeedStationId() { - return feed_station_id; -} -void -SWGACARSDemodSettings::setFeedStationId(QString* feed_station_id) { - this->feed_station_id = feed_station_id; - this->m_feed_station_id_isSet = true; -} - -qint32 -SWGACARSDemodSettings::getFeedAirframes() { - return feed_airframes; -} -void -SWGACARSDemodSettings::setFeedAirframes(qint32 feed_airframes) { - this->feed_airframes = feed_airframes; - this->m_feed_airframes_isSet = true; -} - -QString* -SWGACARSDemodSettings::getFeedAirframesHost() { - return feed_airframes_host; -} -void -SWGACARSDemodSettings::setFeedAirframesHost(QString* feed_airframes_host) { - this->feed_airframes_host = feed_airframes_host; - this->m_feed_airframes_host_isSet = true; -} - -qint32 -SWGACARSDemodSettings::getFeedAirframesPort() { - return feed_airframes_port; -} -void -SWGACARSDemodSettings::setFeedAirframesPort(qint32 feed_airframes_port) { - this->feed_airframes_port = feed_airframes_port; - this->m_feed_airframes_port_isSet = true; -} - -qint32 -SWGACARSDemodSettings::getFeedAirframesTcp() { - return feed_airframes_tcp; -} -void -SWGACARSDemodSettings::setFeedAirframesTcp(qint32 feed_airframes_tcp) { - this->feed_airframes_tcp = feed_airframes_tcp; - this->m_feed_airframes_tcp_isSet = true; -} - -qint32 -SWGACARSDemodSettings::getFeedAvdelphi() { - return feed_avdelphi; -} -void -SWGACARSDemodSettings::setFeedAvdelphi(qint32 feed_avdelphi) { - this->feed_avdelphi = feed_avdelphi; - this->m_feed_avdelphi_isSet = true; -} - -QString* -SWGACARSDemodSettings::getFeedAvdelphiHost() { - return feed_avdelphi_host; -} -void -SWGACARSDemodSettings::setFeedAvdelphiHost(QString* feed_avdelphi_host) { - this->feed_avdelphi_host = feed_avdelphi_host; - this->m_feed_avdelphi_host_isSet = true; -} - -qint32 -SWGACARSDemodSettings::getFeedAvdelphiPort() { - return feed_avdelphi_port; -} -void -SWGACARSDemodSettings::setFeedAvdelphiPort(qint32 feed_avdelphi_port) { - this->feed_avdelphi_port = feed_avdelphi_port; - this->m_feed_avdelphi_port_isSet = true; -} - -qint32 -SWGACARSDemodSettings::getFeedAvdelphiTcp() { - return feed_avdelphi_tcp; -} -void -SWGACARSDemodSettings::setFeedAvdelphiTcp(qint32 feed_avdelphi_tcp) { - this->feed_avdelphi_tcp = feed_avdelphi_tcp; - this->m_feed_avdelphi_tcp_isSet = true; -} - qint32 SWGACARSDemodSettings::getScopeCh1() { return scope_ch1; @@ -909,6 +723,9 @@ SWGACARSDemodSettings::isSet(){ if(m_aero_channel_isSet){ isObjectUpdated = true; break; } + if(m_iridium_bandwidth_isSet){ + isObjectUpdated = true; break; + } if(m_rf_bandwidth_isSet){ isObjectUpdated = true; break; } @@ -948,36 +765,6 @@ SWGACARSDemodSettings::isSet(){ if(m_log_enabled_isSet){ isObjectUpdated = true; break; } - if(m_feed_enabled_isSet){ - isObjectUpdated = true; break; - } - if(feed_station_id && *feed_station_id != QString("")){ - isObjectUpdated = true; break; - } - if(m_feed_airframes_isSet){ - isObjectUpdated = true; break; - } - if(feed_airframes_host && *feed_airframes_host != QString("")){ - isObjectUpdated = true; break; - } - if(m_feed_airframes_port_isSet){ - isObjectUpdated = true; break; - } - if(m_feed_airframes_tcp_isSet){ - isObjectUpdated = true; break; - } - if(m_feed_avdelphi_isSet){ - isObjectUpdated = true; break; - } - if(feed_avdelphi_host && *feed_avdelphi_host != QString("")){ - isObjectUpdated = true; break; - } - if(m_feed_avdelphi_port_isSet){ - isObjectUpdated = true; break; - } - if(m_feed_avdelphi_tcp_isSet){ - isObjectUpdated = true; break; - } if(m_scope_ch1_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.h b/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.h index 2d52fd0c8..3b77b40e2 100644 --- a/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGACARSDemodSettings.h @@ -54,6 +54,9 @@ public: qint32 getAeroChannel(); void setAeroChannel(qint32 aero_channel); + qint32 getIridiumBandwidth(); + void setIridiumBandwidth(qint32 iridium_bandwidth); + float getRfBandwidth(); void setRfBandwidth(float rf_bandwidth); @@ -93,36 +96,6 @@ public: qint32 getLogEnabled(); void setLogEnabled(qint32 log_enabled); - qint32 getFeedEnabled(); - void setFeedEnabled(qint32 feed_enabled); - - QString* getFeedStationId(); - void setFeedStationId(QString* feed_station_id); - - qint32 getFeedAirframes(); - void setFeedAirframes(qint32 feed_airframes); - - QString* getFeedAirframesHost(); - void setFeedAirframesHost(QString* feed_airframes_host); - - qint32 getFeedAirframesPort(); - void setFeedAirframesPort(qint32 feed_airframes_port); - - qint32 getFeedAirframesTcp(); - void setFeedAirframesTcp(qint32 feed_airframes_tcp); - - qint32 getFeedAvdelphi(); - void setFeedAvdelphi(qint32 feed_avdelphi); - - QString* getFeedAvdelphiHost(); - void setFeedAvdelphiHost(QString* feed_avdelphi_host); - - qint32 getFeedAvdelphiPort(); - void setFeedAvdelphiPort(qint32 feed_avdelphi_port); - - qint32 getFeedAvdelphiTcp(); - void setFeedAvdelphiTcp(qint32 feed_avdelphi_tcp); - qint32 getScopeCh1(); void setScopeCh1(qint32 scope_ch1); @@ -178,6 +151,9 @@ private: qint32 aero_channel; bool m_aero_channel_isSet; + qint32 iridium_bandwidth; + bool m_iridium_bandwidth_isSet; + float rf_bandwidth; bool m_rf_bandwidth_isSet; @@ -217,36 +193,6 @@ private: qint32 log_enabled; bool m_log_enabled_isSet; - qint32 feed_enabled; - bool m_feed_enabled_isSet; - - QString* feed_station_id; - bool m_feed_station_id_isSet; - - qint32 feed_airframes; - bool m_feed_airframes_isSet; - - QString* feed_airframes_host; - bool m_feed_airframes_host_isSet; - - qint32 feed_airframes_port; - bool m_feed_airframes_port_isSet; - - qint32 feed_airframes_tcp; - bool m_feed_airframes_tcp_isSet; - - qint32 feed_avdelphi; - bool m_feed_avdelphi_isSet; - - QString* feed_avdelphi_host; - bool m_feed_avdelphi_host_isSet; - - qint32 feed_avdelphi_port; - bool m_feed_avdelphi_port_isSet; - - qint32 feed_avdelphi_tcp; - bool m_feed_avdelphi_tcp_isSet; - qint32 scope_ch1; bool m_scope_ch1_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.cpp index 289e9990e..c327a1ac0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.cpp @@ -48,6 +48,30 @@ SWGAircraftSettings::SWGAircraftSettings() { m_display_statistics_isSet = false; display_chart = 0; m_display_chart_isSet = false; + display_coverage = 0; + m_display_coverage_isSet = false; + use_livery_icons = 0; + m_use_livery_icons_isSet = false; + feed_enabled = 0; + m_feed_enabled_isSet = false; + feed_station_id = nullptr; + m_feed_station_id_isSet = false; + feed_airframes = 0; + m_feed_airframes_isSet = false; + feed_airframes_host = nullptr; + m_feed_airframes_host_isSet = false; + feed_airframes_port = 0; + m_feed_airframes_port_isSet = false; + feed_airframes_tcp = 0; + m_feed_airframes_tcp_isSet = false; + feed_avdelphi = 0; + m_feed_avdelphi_isSet = false; + feed_avdelphi_host = nullptr; + m_feed_avdelphi_host_isSet = false; + feed_avdelphi_port = 0; + m_feed_avdelphi_port_isSet = false; + feed_avdelphi_tcp = 0; + m_feed_avdelphi_tcp_isSet = false; database_filename = nullptr; m_database_filename_isSet = false; disabled_sources = nullptr; @@ -100,6 +124,30 @@ SWGAircraftSettings::init() { m_display_statistics_isSet = false; display_chart = 0; m_display_chart_isSet = false; + display_coverage = 0; + m_display_coverage_isSet = false; + use_livery_icons = 0; + m_use_livery_icons_isSet = false; + feed_enabled = 0; + m_feed_enabled_isSet = false; + feed_station_id = new QString(""); + m_feed_station_id_isSet = false; + feed_airframes = 0; + m_feed_airframes_isSet = false; + feed_airframes_host = new QString(""); + m_feed_airframes_host_isSet = false; + feed_airframes_port = 0; + m_feed_airframes_port_isSet = false; + feed_airframes_tcp = 0; + m_feed_airframes_tcp_isSet = false; + feed_avdelphi = 0; + m_feed_avdelphi_isSet = false; + feed_avdelphi_host = new QString(""); + m_feed_avdelphi_host_isSet = false; + feed_avdelphi_port = 0; + m_feed_avdelphi_port_isSet = false; + feed_avdelphi_tcp = 0; + m_feed_avdelphi_tcp_isSet = false; database_filename = new QString(""); m_database_filename_isSet = false; disabled_sources = new QList<QString*>(); @@ -138,6 +186,15 @@ SWGAircraftSettings::cleanup() { + if(feed_station_id != nullptr) { + delete feed_station_id; + } + if(feed_airframes_host != nullptr) { + delete feed_airframes_host; + } + if(feed_avdelphi_host != nullptr) { + delete feed_avdelphi_host; + } if(database_filename != nullptr) { delete database_filename; } @@ -203,6 +260,30 @@ SWGAircraftSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&display_chart, pJson["displayChart"], "qint32", ""); + ::SWGSDRangel::setValue(&display_coverage, pJson["displayCoverage"], "qint32", ""); + + ::SWGSDRangel::setValue(&use_livery_icons, pJson["useLiveryIcons"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_enabled, pJson["feedEnabled"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_station_id, pJson["feedStationId"], "QString", "QString"); + + ::SWGSDRangel::setValue(&feed_airframes, pJson["feedAirframes"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_airframes_host, pJson["feedAirframesHost"], "QString", "QString"); + + ::SWGSDRangel::setValue(&feed_airframes_port, pJson["feedAirframesPort"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_airframes_tcp, pJson["feedAirframesTcp"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_avdelphi, pJson["feedAvdelphi"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_avdelphi_host, pJson["feedAvdelphiHost"], "QString", "QString"); + + ::SWGSDRangel::setValue(&feed_avdelphi_port, pJson["feedAvdelphiPort"], "qint32", ""); + + ::SWGSDRangel::setValue(&feed_avdelphi_tcp, pJson["feedAvdelphiTcp"], "qint32", ""); + ::SWGSDRangel::setValue(&database_filename, pJson["databaseFilename"], "QString", "QString"); @@ -273,6 +354,42 @@ SWGAircraftSettings::asJsonObject() { if(m_display_chart_isSet){ obj->insert("displayChart", QJsonValue(display_chart)); } + if(m_display_coverage_isSet){ + obj->insert("displayCoverage", QJsonValue(display_coverage)); + } + if(m_use_livery_icons_isSet){ + obj->insert("useLiveryIcons", QJsonValue(use_livery_icons)); + } + if(m_feed_enabled_isSet){ + obj->insert("feedEnabled", QJsonValue(feed_enabled)); + } + if(feed_station_id != nullptr && *feed_station_id != QString("")){ + toJsonValue(QString("feedStationId"), feed_station_id, obj, QString("QString")); + } + if(m_feed_airframes_isSet){ + obj->insert("feedAirframes", QJsonValue(feed_airframes)); + } + if(feed_airframes_host != nullptr && *feed_airframes_host != QString("")){ + toJsonValue(QString("feedAirframesHost"), feed_airframes_host, obj, QString("QString")); + } + if(m_feed_airframes_port_isSet){ + obj->insert("feedAirframesPort", QJsonValue(feed_airframes_port)); + } + if(m_feed_airframes_tcp_isSet){ + obj->insert("feedAirframesTcp", QJsonValue(feed_airframes_tcp)); + } + if(m_feed_avdelphi_isSet){ + obj->insert("feedAvdelphi", QJsonValue(feed_avdelphi)); + } + if(feed_avdelphi_host != nullptr && *feed_avdelphi_host != QString("")){ + toJsonValue(QString("feedAvdelphiHost"), feed_avdelphi_host, obj, QString("QString")); + } + if(m_feed_avdelphi_port_isSet){ + obj->insert("feedAvdelphiPort", QJsonValue(feed_avdelphi_port)); + } + if(m_feed_avdelphi_tcp_isSet){ + obj->insert("feedAvdelphiTcp", QJsonValue(feed_avdelphi_tcp)); + } if(database_filename != nullptr && *database_filename != QString("")){ toJsonValue(QString("databaseFilename"), database_filename, obj, QString("QString")); } @@ -413,6 +530,126 @@ SWGAircraftSettings::setDisplayChart(qint32 display_chart) { this->m_display_chart_isSet = true; } +qint32 +SWGAircraftSettings::getDisplayCoverage() { + return display_coverage; +} +void +SWGAircraftSettings::setDisplayCoverage(qint32 display_coverage) { + this->display_coverage = display_coverage; + this->m_display_coverage_isSet = true; +} + +qint32 +SWGAircraftSettings::getUseLiveryIcons() { + return use_livery_icons; +} +void +SWGAircraftSettings::setUseLiveryIcons(qint32 use_livery_icons) { + this->use_livery_icons = use_livery_icons; + this->m_use_livery_icons_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedEnabled() { + return feed_enabled; +} +void +SWGAircraftSettings::setFeedEnabled(qint32 feed_enabled) { + this->feed_enabled = feed_enabled; + this->m_feed_enabled_isSet = true; +} + +QString* +SWGAircraftSettings::getFeedStationId() { + return feed_station_id; +} +void +SWGAircraftSettings::setFeedStationId(QString* feed_station_id) { + this->feed_station_id = feed_station_id; + this->m_feed_station_id_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedAirframes() { + return feed_airframes; +} +void +SWGAircraftSettings::setFeedAirframes(qint32 feed_airframes) { + this->feed_airframes = feed_airframes; + this->m_feed_airframes_isSet = true; +} + +QString* +SWGAircraftSettings::getFeedAirframesHost() { + return feed_airframes_host; +} +void +SWGAircraftSettings::setFeedAirframesHost(QString* feed_airframes_host) { + this->feed_airframes_host = feed_airframes_host; + this->m_feed_airframes_host_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedAirframesPort() { + return feed_airframes_port; +} +void +SWGAircraftSettings::setFeedAirframesPort(qint32 feed_airframes_port) { + this->feed_airframes_port = feed_airframes_port; + this->m_feed_airframes_port_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedAirframesTcp() { + return feed_airframes_tcp; +} +void +SWGAircraftSettings::setFeedAirframesTcp(qint32 feed_airframes_tcp) { + this->feed_airframes_tcp = feed_airframes_tcp; + this->m_feed_airframes_tcp_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedAvdelphi() { + return feed_avdelphi; +} +void +SWGAircraftSettings::setFeedAvdelphi(qint32 feed_avdelphi) { + this->feed_avdelphi = feed_avdelphi; + this->m_feed_avdelphi_isSet = true; +} + +QString* +SWGAircraftSettings::getFeedAvdelphiHost() { + return feed_avdelphi_host; +} +void +SWGAircraftSettings::setFeedAvdelphiHost(QString* feed_avdelphi_host) { + this->feed_avdelphi_host = feed_avdelphi_host; + this->m_feed_avdelphi_host_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedAvdelphiPort() { + return feed_avdelphi_port; +} +void +SWGAircraftSettings::setFeedAvdelphiPort(qint32 feed_avdelphi_port) { + this->feed_avdelphi_port = feed_avdelphi_port; + this->m_feed_avdelphi_port_isSet = true; +} + +qint32 +SWGAircraftSettings::getFeedAvdelphiTcp() { + return feed_avdelphi_tcp; +} +void +SWGAircraftSettings::setFeedAvdelphiTcp(qint32 feed_avdelphi_tcp) { + this->feed_avdelphi_tcp = feed_avdelphi_tcp; + this->m_feed_avdelphi_tcp_isSet = true; +} + QString* SWGAircraftSettings::getDatabaseFilename() { return database_filename; @@ -568,6 +805,42 @@ SWGAircraftSettings::isSet(){ if(m_display_chart_isSet){ isObjectUpdated = true; break; } + if(m_display_coverage_isSet){ + isObjectUpdated = true; break; + } + if(m_use_livery_icons_isSet){ + isObjectUpdated = true; break; + } + if(m_feed_enabled_isSet){ + isObjectUpdated = true; break; + } + if(feed_station_id && *feed_station_id != QString("")){ + isObjectUpdated = true; break; + } + if(m_feed_airframes_isSet){ + isObjectUpdated = true; break; + } + if(feed_airframes_host && *feed_airframes_host != QString("")){ + isObjectUpdated = true; break; + } + if(m_feed_airframes_port_isSet){ + isObjectUpdated = true; break; + } + if(m_feed_airframes_tcp_isSet){ + isObjectUpdated = true; break; + } + if(m_feed_avdelphi_isSet){ + isObjectUpdated = true; break; + } + if(feed_avdelphi_host && *feed_avdelphi_host != QString("")){ + isObjectUpdated = true; break; + } + if(m_feed_avdelphi_port_isSet){ + isObjectUpdated = true; break; + } + if(m_feed_avdelphi_tcp_isSet){ + isObjectUpdated = true; break; + } if(database_filename && *database_filename != QString("")){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.h b/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.h index d6edf1d93..2160c9bc6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGAircraftSettings.h @@ -75,6 +75,42 @@ public: qint32 getDisplayChart(); void setDisplayChart(qint32 display_chart); + qint32 getDisplayCoverage(); + void setDisplayCoverage(qint32 display_coverage); + + qint32 getUseLiveryIcons(); + void setUseLiveryIcons(qint32 use_livery_icons); + + qint32 getFeedEnabled(); + void setFeedEnabled(qint32 feed_enabled); + + QString* getFeedStationId(); + void setFeedStationId(QString* feed_station_id); + + qint32 getFeedAirframes(); + void setFeedAirframes(qint32 feed_airframes); + + QString* getFeedAirframesHost(); + void setFeedAirframesHost(QString* feed_airframes_host); + + qint32 getFeedAirframesPort(); + void setFeedAirframesPort(qint32 feed_airframes_port); + + qint32 getFeedAirframesTcp(); + void setFeedAirframesTcp(qint32 feed_airframes_tcp); + + qint32 getFeedAvdelphi(); + void setFeedAvdelphi(qint32 feed_avdelphi); + + QString* getFeedAvdelphiHost(); + void setFeedAvdelphiHost(QString* feed_avdelphi_host); + + qint32 getFeedAvdelphiPort(); + void setFeedAvdelphiPort(qint32 feed_avdelphi_port); + + qint32 getFeedAvdelphiTcp(); + void setFeedAvdelphiTcp(qint32 feed_avdelphi_tcp); + QString* getDatabaseFilename(); void setDatabaseFilename(QString* database_filename); @@ -145,6 +181,42 @@ private: qint32 display_chart; bool m_display_chart_isSet; + qint32 display_coverage; + bool m_display_coverage_isSet; + + qint32 use_livery_icons; + bool m_use_livery_icons_isSet; + + qint32 feed_enabled; + bool m_feed_enabled_isSet; + + QString* feed_station_id; + bool m_feed_station_id_isSet; + + qint32 feed_airframes; + bool m_feed_airframes_isSet; + + QString* feed_airframes_host; + bool m_feed_airframes_host_isSet; + + qint32 feed_airframes_port; + bool m_feed_airframes_port_isSet; + + qint32 feed_airframes_tcp; + bool m_feed_airframes_tcp_isSet; + + qint32 feed_avdelphi; + bool m_feed_avdelphi_isSet; + + QString* feed_avdelphi_host; + bool m_feed_avdelphi_host_isSet; + + qint32 feed_avdelphi_port; + bool m_feed_avdelphi_port_isSet; + + qint32 feed_avdelphi_tcp; + bool m_feed_avdelphi_tcp_isSet; + QString* database_filename; bool m_database_filename_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.cpp b/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.cpp index 8041d7c02..2c832b9f8 100644 --- a/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.cpp @@ -28,6 +28,10 @@ SWGMapAircraftState::SWGMapAircraftState(QString* json) { } SWGMapAircraftState::SWGMapAircraftState() { + date_time = nullptr; + m_date_time_isSet = false; + icao = nullptr; + m_icao_isSet = false; callsign = nullptr; m_callsign_isSet = false; aircraft_type = nullptr; @@ -72,6 +76,12 @@ SWGMapAircraftState::SWGMapAircraftState() { m_lateral_mode_isSet = false; tcas_mode = 0; m_tcas_mode_isSet = false; + tcas_ra = 0; + m_tcas_ra_isSet = false; + tcas_threat_icao = nullptr; + m_tcas_threat_icao_isSet = false; + squawk = 0; + m_squawk_isSet = false; wind_speed = 0.0f; m_wind_speed_isSet = false; wind_direction = 0.0f; @@ -90,6 +100,10 @@ SWGMapAircraftState::~SWGMapAircraftState() { void SWGMapAircraftState::init() { + date_time = new QString(""); + m_date_time_isSet = false; + icao = new QString(""); + m_icao_isSet = false; callsign = new QString(""); m_callsign_isSet = false; aircraft_type = new QString(""); @@ -134,6 +148,12 @@ SWGMapAircraftState::init() { m_lateral_mode_isSet = false; tcas_mode = 0; m_tcas_mode_isSet = false; + tcas_ra = 0; + m_tcas_ra_isSet = false; + tcas_threat_icao = new QString(""); + m_tcas_threat_icao_isSet = false; + squawk = 0; + m_squawk_isSet = false; wind_speed = 0.0f; m_wind_speed_isSet = false; wind_direction = 0.0f; @@ -148,12 +168,21 @@ SWGMapAircraftState::init() { void SWGMapAircraftState::cleanup() { + if(date_time != nullptr) { + delete date_time; + } + if(icao != nullptr) { + delete icao; + } if(callsign != nullptr) { delete callsign; } if(aircraft_type != nullptr) { delete aircraft_type; } + if(tcas_threat_icao != nullptr) { + delete tcas_threat_icao; + } if(airspeed_date_time != nullptr) { @@ -202,12 +231,16 @@ SWGMapAircraftState::fromJson(QString &json) { void SWGMapAircraftState::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&date_time, pJson["dateTime"], "QString", "QString"); + + ::SWGSDRangel::setValue(&icao, pJson["icao"], "QString", "QString"); + ::SWGSDRangel::setValue(&callsign, pJson["callsign"], "QString", "QString"); - + ::SWGSDRangel::setValue(&aircraft_type, pJson["aircraftType"], "QString", "QString"); - + ::SWGSDRangel::setValue(&on_surface, pJson["onSurface"], "qint32", ""); - + ::SWGSDRangel::setValue(&airspeed, pJson["airspeed"], "float", ""); ::SWGSDRangel::setValue(&airspeed_date_time, pJson["airspeedDateTime"], "QString", "QString"); @@ -246,6 +279,12 @@ SWGMapAircraftState::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&tcas_mode, pJson["tcasMode"], "qint32", ""); + ::SWGSDRangel::setValue(&tcas_ra, pJson["tcasRA"], "qint32", ""); + + ::SWGSDRangel::setValue(&tcas_threat_icao, pJson["tcasThreatIcao"], "QString", "QString"); + + ::SWGSDRangel::setValue(&squawk, pJson["squawk"], "qint32", ""); + ::SWGSDRangel::setValue(&wind_speed, pJson["windSpeed"], "float", ""); ::SWGSDRangel::setValue(&wind_direction, pJson["windDirection"], "float", ""); @@ -272,6 +311,12 @@ SWGMapAircraftState::asJson () QJsonObject* SWGMapAircraftState::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(date_time != nullptr && *date_time != QString("")){ + toJsonValue(QString("dateTime"), date_time, obj, QString("QString")); + } + if(icao != nullptr && *icao != QString("")){ + toJsonValue(QString("icao"), icao, obj, QString("QString")); + } if(callsign != nullptr && *callsign != QString("")){ toJsonValue(QString("callsign"), callsign, obj, QString("QString")); } @@ -338,6 +383,15 @@ SWGMapAircraftState::asJsonObject() { if(m_tcas_mode_isSet){ obj->insert("tcasMode", QJsonValue(tcas_mode)); } + if(m_tcas_ra_isSet){ + obj->insert("tcasRA", QJsonValue(tcas_ra)); + } + if(tcas_threat_icao != nullptr && *tcas_threat_icao != QString("")){ + toJsonValue(QString("tcasThreatIcao"), tcas_threat_icao, obj, QString("QString")); + } + if(m_squawk_isSet){ + obj->insert("squawk", QJsonValue(squawk)); + } if(m_wind_speed_isSet){ obj->insert("windSpeed", QJsonValue(wind_speed)); } @@ -357,6 +411,26 @@ SWGMapAircraftState::asJsonObject() { return obj; } +QString* +SWGMapAircraftState::getDateTime() { + return date_time; +} +void +SWGMapAircraftState::setDateTime(QString* date_time) { + this->date_time = date_time; + this->m_date_time_isSet = true; +} + +QString* +SWGMapAircraftState::getIcao() { + return icao; +} +void +SWGMapAircraftState::setIcao(QString* icao) { + this->icao = icao; + this->m_icao_isSet = true; +} + QString* SWGMapAircraftState::getCallsign() { return callsign; @@ -577,6 +651,36 @@ SWGMapAircraftState::setTcasMode(qint32 tcas_mode) { this->m_tcas_mode_isSet = true; } +qint32 +SWGMapAircraftState::getTcasRa() { + return tcas_ra; +} +void +SWGMapAircraftState::setTcasRa(qint32 tcas_ra) { + this->tcas_ra = tcas_ra; + this->m_tcas_ra_isSet = true; +} + +QString* +SWGMapAircraftState::getTcasThreatIcao() { + return tcas_threat_icao; +} +void +SWGMapAircraftState::setTcasThreatIcao(QString* tcas_threat_icao) { + this->tcas_threat_icao = tcas_threat_icao; + this->m_tcas_threat_icao_isSet = true; +} + +qint32 +SWGMapAircraftState::getSquawk() { + return squawk; +} +void +SWGMapAircraftState::setSquawk(qint32 squawk) { + this->squawk = squawk; + this->m_squawk_isSet = true; +} + float SWGMapAircraftState::getWindSpeed() { return wind_speed; @@ -632,6 +736,12 @@ bool SWGMapAircraftState::isSet(){ bool isObjectUpdated = false; do{ + if(date_time && *date_time != QString("")){ + isObjectUpdated = true; break; + } + if(icao && *icao != QString("")){ + isObjectUpdated = true; break; + } if(callsign && *callsign != QString("")){ isObjectUpdated = true; break; } @@ -698,6 +808,15 @@ SWGMapAircraftState::isSet(){ if(m_tcas_mode_isSet){ isObjectUpdated = true; break; } + if(m_tcas_ra_isSet){ + isObjectUpdated = true; break; + } + if(tcas_threat_icao && *tcas_threat_icao != QString("")){ + isObjectUpdated = true; break; + } + if(m_squawk_isSet){ + isObjectUpdated = true; break; + } if(m_wind_speed_isSet){ isObjectUpdated = true; break; } @@ -717,4 +836,3 @@ SWGMapAircraftState::isSet(){ return isObjectUpdated; } } - diff --git a/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.h b/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.h index aa1e13f8c..157c8fe2f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.h +++ b/swagger/sdrangel/code/qt5/client/SWGMapAircraftState.h @@ -44,6 +44,12 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGMapAircraftState* fromJson(QString &jsonString) override; + QString* getDateTime(); + void setDateTime(QString* date_time); + + QString* getIcao(); + void setIcao(QString* icao); + QString* getCallsign(); void setCallsign(QString* callsign); @@ -110,6 +116,15 @@ public: qint32 getTcasMode(); void setTcasMode(qint32 tcas_mode); + qint32 getTcasRa(); + void setTcasRa(qint32 tcas_ra); + + QString* getTcasThreatIcao(); + void setTcasThreatIcao(QString* tcas_threat_icao); + + qint32 getSquawk(); + void setSquawk(qint32 squawk); + float getWindSpeed(); void setWindSpeed(float wind_speed); @@ -129,6 +144,12 @@ public: virtual bool isSet() override; private: + QString* date_time; + bool m_date_time_isSet; + + QString* icao; + bool m_icao_isSet; + QString* callsign; bool m_callsign_isSet; @@ -195,6 +216,15 @@ private: qint32 tcas_mode; bool m_tcas_mode_isSet; + qint32 tcas_ra; + bool m_tcas_ra_isSet; + + QString* tcas_threat_icao; + bool m_tcas_threat_icao_isSet; + + qint32 squawk; + bool m_squawk_isSet; + float wind_speed; bool m_wind_speed_isSet;